diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000000000000000000000000000000000000..07953cae39ba75dbf550a5ce013974ca1e829206 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,10 @@ +# Treat all files in the Go repo as binary, with no git magic updating +# line endings. Windows users contributing to Go will need to use a +# modern version of git and editors capable of LF line endings. +# +# We'll prevent accidental CRLF line endings from entering the repo +# via the git-review gofmt checks. +# +# See golang.org/issue/9281 + +* -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..6a3ce32ec8a62d7d98b065c13d1439bfd0bf3c05 --- /dev/null +++ b/.gitignore @@ -0,0 +1,44 @@ +.DS_Store +*.[56789ao] +*.a[56789o] +*.so +*.pyc +._* +.nfs.* +[56789a].out +*~ +*.orig +*.rej +*.exe +.*.swp +core +*.cgo*.go +*.cgo*.c +_cgo_* +_obj +_test +_testmain.go +build.out +test.out +doc/articles/wiki/*.bin +misc/cgo/life/run.out +misc/cgo/stdio/run.out +misc/cgo/testso/main +src/cmd/**/y.output +src/cmd/cgo/zdefaultcc.go +src/cmd/go/zdefaultcc.go +src/cmd/internal/obj/zbootstrap.go +src/go/doc/headscan +src/runtime/zversion.go +src/unicode/maketables +src/*.*/ +test/pass.out +test/run.out +test/times.out +test/garbage/*.out +goinstall.log +last-change +VERSION.cache + +bin/ +pkg/ diff --git a/AUTHORS b/AUTHORS new file mode 100644 index 0000000000000000000000000000000000000000..54a10ad8ea0f62dd60ad6f5ec8efb495a651095f --- /dev/null +++ b/AUTHORS @@ -0,0 +1,556 @@ +# This is the official list of Go authors for copyright purposes. +# This file is distinct from the CONTRIBUTORS files. +# See the latter for an explanation. + +# Names should be added to this file as +# Name or Organization +# The email address is not required for organizations. + +# Please keep the list sorted. + +A Medium Corporation +Aamir Khan +Aaron France +Abhinav Gupta +Adrian Nos +Adrian O'Grady +Adrien Bustany +Ahmed Waheed Moanes +Ainar Garipov +Akshat Kumar +Alan Shreve +Albert Strasheim +Alberto Donizetti +Alberto García Hierro +Aleksandar Dezelin +Alex A Skinner +Alex Brainman +Alex Jin +Alex Plugaru +Alex Schroeder +Alex Sergeyev +Alexander Larsson +Alexander Morozov +Alexander Orlov +Alexander Reece +Alexander Surma +Alexander Zhavnerchik +Alexander Zolotov +Alexandre Cesaro +Alexandre Normand +Alexei Sholik +Alexey Borzenkov +Alexey Palazhchenko +Amir Mohammad Saied +Amrut Joshi +Andrei Korzhevskii +Andrei Vieru +Andrew Balholm +Andrew Bonventre +Andrew Bursavich +Andrew Ekstedt +Andrew Harding +Andrew Lutomirski +Andrew Pritchard +Andrew Radev +Andrew Skiba +Andrew Szeto +Andrew Wilkins +Andrew Williams +Andrey Mirtchovski +Andrey Petrov +Andriy Lytvynov +Andy Davis +Andy Maloney +Anfernee Yongkun Gui +Anh Hai Trinh +Anschel Schaffer-Cohen +Anthony Eufemio +Anthony Martin +Anthony Starks +Apisak Darakananda +Aram Hăvărneanu +Areski Belaid +Arnaud Ysmal +Arne Hormann +Aron Nopanen +Arvindh Rajesh Tamilmani +Ato Araki +Aulus Egnatius Varialus +awaw fumin +Aymerick Jéhanne +Ben Burkert +Ben Olive +Benjamin Black +Benny Siegert +Benoit Sigoure +Berengar Lehr +Billie Harold Cleek +Bjorn Tillenius +Bjorn Tipling +Blake Gentry +Blake Mizerany +Bobby Powers +Brendan Daniel Tracey +Brett Cannon +Brian Dellisanti +Brian G. Merrell +Brian Gitonga Marete +Brian Ketelsen +Brian Smith +Bryan Ford +Caine Tighe +Caleb Spare +Carl Chatfield +Carlos Castillo +Carlos Cirello +Case Nelson +Casey Marshall +Cezar Sá Espinola +ChaiShushan +Charles L. Dorian +Charles Lee +Chris Dollin +Chris Farmiloe +Chris Howey +Chris Jones +Chris Kastorff +Chris Lennert +Chris McGee +Christian Himpel +Christine Hansmann +Christoffer Buchholz +Christoph Hack +Christopher Cahoon +Christopher Guiney +Christopher Nielsen +Christopher Redden +Christopher Wedgwood +Clement Skau +CloudFlare Inc. +Colin Kennedy +Conrad Meyer +Corey Thomasson +Cristian Staretu +Damian Gryski +Dan Callahan +Dan Peterson +Dan Sinclair +Daniel Fleischman +Daniel Krech +Daniel Lidén +Daniel Morsing +Daniel Theophanes +Darren Elwood +Dave Cheney +David Bürgin <676c7473@gmail.com> +David Calavera +David du Colombier <0intro@gmail.com> +David Forsythe +David G. Andersen +David Jakob Fritz +David Leon Gil +David Thomas +David Titarenco +Davies Liu +Dean Prichard +Denis Brandolini +Derek Buitenhuis +Derek Parker +Devon H. O'Dell +Dhiru Kholia +Didier Spezia +Dimitri Tcaciuc +Dmitri Shuralyov +Dmitriy Shelenin +Dmitry Chestnykh +Dmitry Savintsev +Dominik Honnef +Donovan Hide +Dropbox, Inc. +Duncan Holm +Dustin Sallings +Dustin Shields-Cloues +Dvir Volk +Eden Li +Egon Elbre +Ehren Kret +Eivind Uggedal +Elias Naur +Emil Hessman +Eoghan Sherry +Eric Clark +Eric Milliken +Eric Roshan-Eisner +Erik Aigner +Erik St. Martin +Erik Westrup +Esko Luontola +Evan Phoenix +Evan Shaw +Ewan Chou +Fabrizio Milo +Fan Hongjian +Fastly, Inc. +Fatih Arslan +Fazlul Shahriar +Felix Geisendörfer +Firmansyah Adiputra +Florian Uekermann +Florian Weimer +Florin Patan +Francisco Souza +Frederick Kelly Mayle III +Fredrik Enestad +Frithjof Schulze +Gabriel Aszalos +Gary Burd +Gautham Thambidorai +Geert-Johan Riemer +Georg Reinke +George Shammas +Gerasimos Dimitriadis +Gideon Jan-Wessel Redelinghuys +Giles Lean +Giulio Iotti +Google Inc. +Gordon Klaus +Graham King +Graham Miller +Greg Ward +Guillaume J. Charmes +Guobiao Mei +Gustav Paul +Gustavo Niemeyer +Gwenael Treguier +Hajime Hoshi +Hari haran +Hariharan Srinath +Harley Laue +Håvard Haugen +Hector Chu +Hector Martin Cantero +Henning Schmiedehausen +Henrik Edwards +Herbert Georg Fischer +Hong Ruiqi +IBM +Icarus Sparry +Igneous Systems, Inc. +Igor Dolzhikov +INADA Naoki +Ingo Krabbe +Ingo Oeser +Isaac Wagner +Ivan Ukhov +Jae Kwon +Jakob Borg +Jakub Ryszard Czarnowicz +James David Chalfant +James Fysh +James Gray +James Meneghello +James P. Cooper +James Toy +James Whitehead +Jan H. Hosang +Jan Mercl <0xjnml@gmail.com> +Jan Mercl +Jan Newmarch +Jan Ziak <0xe2.0x9a.0x9b@gmail.com> +Jani Monoses +Jaroslavas Počepko +Jason Del Ponte +Jason Travis +Jay Weisskopf +Jeff Hodges +Jeff R. Allen +Jeff Sickel +Jeff Wendling +Jens Frederich +Jeremy Jackins +Jim McGrath +Jimmy Zelinskie +Jingcheng Zhang +Jiong Du +Joakim Sernbrant +Joe Harrison +Joe Poirier +Joe Shaw +Joe Tsai +Joel Stemmer +John Asmuth +John C Barstow +John Graham-Cumming +John Howard Palevich +John Potocny +John Shahid +John Tuley +Jonathan Gold +Jonathan Mark +Jonathan Rudenberg +Jonathan Wills +Jongmin Kim +Jose Luis Vázquez González +Joseph Holsten +Josh Bleecher Snyder +Josh Goebel +Josh Holland +Joshua Chase +JT Olds +Jukka-Pekka Kekkonen +Julian Phillips +Julien Schmidt +Justin Nuß +Kai Backman +Kamil Kisiel +Kang Hu +Kato Kazuyoshi +Katrina Owen +Kei Son +Keith Rarick +Kelsey Hightower +Kelvin Foo Chuan Lyi +Ken Friedenbach +Ken Rockot +Kevin Ballard +Konstantin Shaposhnikov +Kyle Consalus +Kyle Isom +Kyle Lemons +L Campbell +Lai Jiangshan +Larz Conwell +Lee Packham +Linaro Limited +Lloyd Dewolf +Lorenzo Stoakes +Luca Greco +Lucio De Re +Luit van Drongelen +Luka Zakrajšek +Luke Curley +Manuel Mendez +Marc Weistroff +Marco Hennings +Mark Bucciarelli +Mark Theunissen +Marko Juhani Silokunnas +Marko Tiikkaja +Markover Inc. DBA Poptip +Markus Duft +Markus Sonderegger +Markus Zimmermann +Martin Möhrmann +Martin Neubauer +Martin Olsson +Mateusz Czapliński +Mathias Beke +Mathieu Lonjaret +Mats Lidell +Matt Aimonetti +Matt Bostock +Matt Jibson +Matt Joiner +Matt Layher +Matt Reiferson +Matt T. Proud +Matt Williams +Matthew Brennan +Matthew Cottingham +Matthew Holt +Matthew Horsnell +Maxim Khitrov +Meir Fischer +Micah Stetson +Michael Chaten +Michael Elkins +Michael Fraenkel +Michael Gehring +Michael Hoisie +Michael Käufl +Michael Lewis +Michael MacInnis +Michael Pearson +Michael Schaller +Michael Stapelberg +Michael Teichgräber +Michael Vetter +Michał Derkacz +Miek Gieben +Mihai Borobocea +Mikael Tillenius +Mike Andrews +Mike Rosset +Mikhail Panchenko +Miki Tebeka +Mikio Hara +Mikkel Krautz +Miquel Sabaté Solà +Moov Corporation +Moriyoshi Koizumi +Môshe van der Sterre +Nan Deng +Nathan John Youngman +Nathan P Finch +Nathan Youngman +Nevins Bartolomeo +ngmoco, LLC +Nicholas Katsaros +Nicholas Presta +Nicholas Sullivan +Nicholas Waples +Nick Craig-Wood +Nicolas Kaiser +Nicolas Owens +Nicolas S. Dade +Nigel Kerr +Noah Campbell +Oling Cat +Oliver Hookins +Olivier Antoine +Olivier Duperray +Olivier Saingre +Oracle +Padraig Kitterick +Palm Stone Games +Paolo Giarrusso +Paolo Martini +Pascal S. de Kloe +Patrick Crosby +Patrick Gavlin +Patrick Higgins +Patrick Mézard +Patrick Mylund Nielsen +Patrick Smith +Paul A Querna +Paul Hammond +Paul Lalonde +Paul Sbarra +Paul Smith +Paul van Brouwershaven +Pavel Zinovkin +Percy Wegmann +Petar Maymounkov +Peter Armitage +Peter Froehlich +Peter Kleiweg +Peter Moody +Peter Mundy +Péter Surányi +Péter Szilágyi +Peter Waldschmidt +Peter Waller +Peter Williams +Philip K. Warren +Pieter Droogendijk +Pietro Gagliardi +Preetam Jinka +Quan Yong Zhai +Quoc-Viet Nguyen +Raif S. Naffah +Rajat Goel +Red Hat, Inc. +Rémy Oudompheng +Richard Barnes +Richard Crowley +Richard Eric Gavaletz +Richard Musiol +Rick Arnold +Risto Jaakko Saarelma +Robert Daniel Kortschak +Robert Dinu +Robert Figueiredo +Robert Hencke +Robert Obryk +Robin Eklind +Rodrigo Moraes de Oliveira +Rodrigo Rafael Monti Kochenburger +Roger Pau Monné +Roger Peppe +Ron Hashimoto +Ron Minnich +Ross Light +Rowan Worth +Ryan Hitchman +Ryan Seys +Ryan Slade +S.Çağlar Onur +Sanjay Menakuru +Scott Barron +Scott Ferguson +Scott Lawrence +Sebastien Binet +Sébastien Paolacci +Sergei Skorobogatov +Sergey 'SnakE' Gromov +Sergio Luis O. B. Correia +Shane Hansen +Shawn Smith +Shenghou Ma +Shivakumar GN +Silvan Jegen +Simon Whitehead +Sokolov Yura +Spring Mc +StalkR +Stan Schwertly +Stefan Nilsson +Stéphane Travostino +Stephen McQuay +Stephen Weinberg +Steve McCoy +Steve Streeting +Steven Elliot Harris +Steven Hartland +Stripe, Inc. +Sven Almgren +Szabolcs Nagy +Tad Glines +Taj Khattra +Tamir Duberstein +Tarmigan Casebolt +Taru Karttunen +Tetsuo Kiso +Thiago Fransosi Farina +Thomas Alan Copeland +Thomas Kappler +Timo Savola +Timo Truyts +Tobias Columbus +Todd Neal +Tom Heng +Tom Linford +Tommy Schaefer +Tor Andersson +Travis Cline +Tudor Golubenco +Tw +Tyler Bunnell +Ugorji Nwoke +Ulf Holm Nielsen +Uriel Mangado +Vadim Vygonets +Vincent Ambo +Vincent Batts +Vincent Vanackere +Vinu Rajashekhar +Vladimir Nikishenko +Volker Dobler +Wei Guangjing +Willem van der Schyff +William Josephson +William Orr +Xia Bin +Xing Xing +Yasuhiro Matsumoto +Yissakhar Z. Beck +Yo-An Lin +Yongjian Xu +Yoshiyuki Kanno +Yusuke Kagiwada +Yuusei Kuwana +Yuval Pavel Zholkover +Ziad Hatahet +Zorion Arrizabalaga +申习之 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000000000000000000000000000000000000..712431cab5e97144a43414c92700ef17f09fe1c3 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,33 @@ +# Contributing to Go + +Go is an open source project. + +It is the work of hundreds of contributors. We appreciate your help! + + +## Filing issues + +When filing an issue, make sure to answer these five questions: + +1. What version of Go are you using (`go version`)? +2. What operating system and processor architecture are you using? +3. What did you do? +4. What did you expect to see? +5. What did you see instead? + +General questions should go to the [golang-nuts mailing list](https://groups.google.com/group/golang-nuts) instead of the issue tracker. +The gophers there will answer or ask you to file an issue if you've tripped over a bug. + +Sensitive security-related issues should be reported to [security@golang.org](mailto:security@golang.org). + +## Contributing code + +Please read the [Contribution Guidelines](https://golang.org/doc/contribute.html) +before sending patches. + +**We do not accept GitHub pull requests** +(we use [Gerrit](https://code.google.com/p/gerrit/) instead for code review). + +Unless otherwise noted, the Go source files are distributed under +the BSD-style license found in the LICENSE file. + diff --git a/CONTRIBUTORS b/CONTRIBUTORS new file mode 100644 index 0000000000000000000000000000000000000000..d974f363be4eb0361371ce246baa94cf4110bd0f --- /dev/null +++ b/CONTRIBUTORS @@ -0,0 +1,737 @@ +# This is the official list of people who can contribute +# (and typically have contributed) code to the Go repository. +# The AUTHORS file lists the copyright holders; this file +# lists people. For example, Google employees are listed here +# but not in AUTHORS, because Google holds the copyright. +# +# The submission process automatically checks to make sure +# that people submitting code are listed in this file (by email address). +# +# Names should be added to this file only after verifying that +# the individual or the individual's organization has agreed to +# the appropriate Contributor License Agreement, found here: +# +# http://code.google.com/legal/individual-cla-v1.0.html +# http://code.google.com/legal/corporate-cla-v1.0.html +# +# The agreement for individuals can be filled out on the web. +# +# When adding J Random Contributor's name to this file, +# either J's name or J's organization's name should be +# added to the AUTHORS file, depending on whether the +# individual or corporate CLA was used. + +# Names should be added to this file like so: +# Name +# +# An entry with two email addresses specifies that the +# first address should be used in the submit logs and +# that the second address should be recognized as the +# same person when interacting with Rietveld. + +# Please keep the list sorted. + +Aamir Khan +Aaron France +Aaron Jacobs +Aaron Kemp +Abhinav Gupta +Adam Langley +Adrian Nos +Adrian O'Grady +Adrien Bustany +Ahmed Waheed Moanes +Ainar Garipov +Akshat Kumar +Alan Donovan +Alan Shreve +Albert Strasheim +Alberto Donizetti +Alberto García Hierro +Aleksandar Dezelin +Alex A Skinner +Alex Brainman +Alex Bramley +Alex Jin +Alex Plugaru +Alex Schroeder +Alex Sergeyev +Alexander Larsson +Alexander Morozov +Alexander Orlov +Alexander Reece +Alexander Surma +Alexander Zhavnerchik +Alexander Zolotov +Alexandre Cesaro +Alexandre Normand +Alexandru Moșoi +Alexei Sholik +Alexey Borzenkov +Alexey Palazhchenko +Alexis Imperial-Legrand +Amir Mohammad Saied +Amrut Joshi +Andrea Spadaccini +Andreas Jellinghaus +Andrei Korzhevskii +Andrei Vieru +Andres Erbsen +Andrew Balholm +Andrew Bonventre +Andrew Bursavich +Andrew Ekstedt +Andrew Gerrand +Andrew Harding +Andrew Lutomirski +Andrew Pilloud +Andrew Pritchard +Andrew Radev +Andrew Skiba +Andrew Szeto +Andrew Wilkins +Andrew Williams +Andrey Mirtchovski +Andrey Petrov +Andriy Lytvynov +Andy Davis +Andy Maloney +Anfernee Yongkun Gui +Anh Hai Trinh +Anschel Schaffer-Cohen +Anthony Eufemio +Anthony Martin +Anthony Starks +Apisak Darakananda +Aram Hăvărneanu +Areski Belaid +Arnaud Ysmal +Arne Hormann +Aron Nopanen +Arvindh Rajesh Tamilmani +Asim Shankar +Ato Araki +Aulus Egnatius Varialus +Austin Clements +awaw fumin +Aymerick Jéhanne +Balazs Lecz +Ben Burkert +Ben Eitzen +Ben Fried +Ben Lynn +Ben Olive +Benjamin Black +Benny Siegert +Benoit Sigoure +Berengar Lehr +Bill Neubauer +Bill Thiede +Billie Harold Cleek +Bjorn Tillenius +Bjorn Tipling +Blake Gentry +Blake Mizerany +Bobby Powers +Brad Fitzpatrick +Brad Garcia +Brandon Gilmore +Brendan Daniel Tracey +Brendan O'Dea +Brett Cannon +Brian Dellisanti +Brian G. Merrell +Brian Gitonga Marete +Brian Ketelsen +Brian Slesinsky +Brian Smith +Bryan Ford +Burcu Dogan +Caine Tighe +Caleb Spare +Carl Chatfield +Carl Jackson +Carl Mastrangelo +Carl Shapiro +Carlos Castillo +Carlos Cirello +Cary Hull +Case Nelson +Casey Marshall +Catalin Patulea +Cezar Sá Espinola +ChaiShushan +Charles L. Dorian +Charles Lee +Chris Broadfoot +Chris Dollin +Chris Farmiloe +Chris Howey +Chris Hundt +Chris Jones +Chris Kastorff +Chris Lennert +Chris Manghane +Chris McGee +Christian Himpel +Christine Hansmann +Christoffer Buchholz +Christoph Hack +Christopher Cahoon +Christopher Guiney +Christopher Nielsen +Christopher Redden +Christopher Swenson +Christopher Wedgwood +Clement Skau +Colby Ranger +Colin Kennedy +Conrad Meyer +Corey Thomasson +Cosmos Nicolaou +Cristian Staretu +Damian Gryski +Damien Neil +Dan Callahan +Dan Peterson +Dan Pupius +Dan Sinclair +Daniel Fleischman +Daniel Krech +Daniel Lidén +Daniel Morsing +Daniel Nadasi +Daniel Theophanes +Darren Elwood +Dave Borowitz +Dave Cheney +Dave Day +Dave Grijalva +David Anderson +David Barnett +David Bürgin <676c7473@gmail.com> +David Calavera +David Chase +David Covert +David Crawshaw +David du Colombier <0intro@gmail.com> +David Forsythe +David G. Andersen +David Jakob Fritz +David Leon Gil +David McLeish +David Presotto +David Symonds +David Thomas +David Titarenco +Davies Liu +Dean Prichard +Denis Brandolini +Derek Buitenhuis +Derek Parker +Devon H. O'Dell +Dhiru Kholia +Didier Spezia +Dimitri Tcaciuc +Dmitri Shuralyov +Dmitriy Shelenin +Dmitriy Vyukov +Dmitry Chestnykh +Dmitry Savintsev +Dominik Honnef +Dominik Vogt +Donovan Hide +Drew Hintz +Duncan Holm +Dustin Long +Dustin Sallings +Dustin Shields-Cloues +Dvir Volk +Eden Li +Egon Elbre +Ehren Kret +Eivind Uggedal +Elias Naur +Emil Hessman +Eoghan Sherry +Eric Clark +Eric Milliken +Eric Roshan-Eisner +Erik Aigner +Erik St. Martin +Erik Westrup +Esko Luontola +Evan Kroske +Evan Martin +Evan Phoenix +Evan Shaw +Ewan Chou +Fabrizio Milo +Fan Hongjian +Fatih Arslan +Fazlul Shahriar +Felix Geisendörfer +Firmansyah Adiputra +Florian Uekermann +Florian Weimer +Florin Patan +Folke Behrens +Francesc Campoy +Francisco Souza +Frederick Kelly Mayle III +Fredrik Enestad +Frithjof Schulze +Fumitoshi Ukai +Gaal Yahas +Gabriel Aszalos +Gary Burd +Gautham Thambidorai +Geert-Johan Riemer +Georg Reinke +George Shammas +Gerasimos Dimitriadis +Gideon Jan-Wessel Redelinghuys +Giles Lean +Giulio Iotti +Glenn Lewis +Gordon Klaus +Graham King +Graham Miller +Greg Ward +Guillaume J. Charmes +Guobiao Mei +Gustav Paul +Gustavo Franco +Gustavo Niemeyer +Gwenael Treguier +Hajime Hoshi +Han-Wen Nienhuys +Hari haran +Hariharan Srinath +Harley Laue +Håvard Haugen +Hector Chu +Hector Martin Cantero +Henning Schmiedehausen +Henrik Edwards +Herbert Georg Fischer +Hong Ruiqi +Hossein Sheikh Attar +Hyang-Ah Hana Kim +Ian Lance Taylor +Icarus Sparry +Igor Dolzhikov +INADA Naoki +Ingo Krabbe +Ingo Oeser +Isaac Wagner +Ivan Krasin +Ivan Ukhov +Jacob Baskin +Jacob H. Haven +Jae Kwon +Jakob Borg +Jakub Ryszard Czarnowicz +James Aguilar +James David Chalfant +James Fysh +James Gray +James Meneghello +James P. Cooper +James Robinson +James Toy +James Tucker +James Whitehead +Jamie Gennis +Jamie Turner +Jamie Wilkinson +Jan H. Hosang +Jan Kratochvil +Jan Mercl <0xjnml@gmail.com> +Jan Mercl +Jan Newmarch +Jan Ziak <0xe2.0x9a.0x9b@gmail.com> +Jani Monoses +Jaroslavas Počepko +Jason Del Ponte +Jason Travis +Jay Weisskopf +Jean-Marc Eurin +Jed Denlea +Jeff Hodges +Jeff R. Allen +Jeff Sickel +Jeff Wendling +Jens Frederich +Jeremiah Harmsen +Jeremy Jackins +Jeremy Schlatter +Jim McGrath +Jimmy Zelinskie +Jingcheng Zhang +Jiong Du +Joakim Sernbrant +Joe Harrison +Joe Poirier +Joe Shaw +Joe Tsai +Joel Sing +Joel Stemmer +Johan Euphrosine +John Asmuth +John Beisley +John C Barstow +John DeNero +John Dethridge +John Graham-Cumming +John Howard Palevich +John Newlin +John Potocny +John Shahid +John Tuley +Jonathan Allie +Jonathan Feinberg +Jonathan Gold +Jonathan Hseu +Jonathan Mark +Jonathan Nieder +Jonathan Pittman +Jonathan Rudenberg +Jonathan Wills +Jongmin Kim +Jos Visser +Jose Luis Vázquez González +Joseph Bonneau +Joseph Holsten +Josh Bleecher Snyder +Josh Goebel +Josh Hoak +Josh Holland +Joshua Chase +JP Sugarbroad +JT Olds +Jukka-Pekka Kekkonen +Julian Phillips +Julien Schmidt +Justin Nuß +Kai Backman +Kamil Kisiel +Kang Hu +Kato Kazuyoshi +Katrina Owen +Kay Zhu +Kei Son +Keith Randall +Keith Rarick +Kelsey Hightower +Kelvin Foo Chuan Lyi +Ken Friedenbach +Ken Rockot +Ken Thompson +Kevin Ballard +Kevin Klues +Kirklin McDonald +Konstantin Shaposhnikov +Kyle Consalus +Kyle Isom +Kyle Lemons +L Campbell +Lai Jiangshan +Larry Hosken +Larz Conwell +Lee Packham +Lloyd Dewolf +Lorenzo Stoakes +Louis Kruger +Luca Greco +Lucio De Re +Luit van Drongelen +Luka Zakrajšek +Luke Curley +Luna Duclos +Luuk van Dijk +Lynn Boger +Manoj Dayaram +Manu Garg +Manuel Mendez +Marc Weistroff +Marcel van Lohuizen +Marco Hennings +Marius Nuennerich +Mark Bucciarelli +Mark Theunissen +Mark Zavislak +Marko Juhani Silokunnas +Marko Mikulicic +Marko Tiikkaja +Markus Duft +Markus Sonderegger +Markus Zimmermann +Martin Möhrmann +Martin Neubauer +Martin Olsson +Mateusz Czapliński +Mathias Beke +Mathieu Lonjaret +Mats Lidell +Matt Aimonetti +Matt Bostock +Matt Brown +Matt Jibson +Matt Joiner +Matt Jones +Matt Layher +Matt Reiferson +Matt T. Proud +Matt Williams +Matthew Brennan +Matthew Cottingham +Matthew Dempsky +Matthew Holt +Matthew Horsnell +Maxim Khitrov +Maxim Pimenov +Maxim Ushakov +Meir Fischer +Micah Stetson +Michael Chaten +Michael Elkins +Michael Fraenkel +Michael Gehring +Michael Hoisie +Michael Hudson-Doyle +Michael Käufl +Michael Kelly +Michael Lewis +Michael MacInnis +Michael Matloob +Michael McGreevy +Michael Pearson +Michael Piatek +Michael Schaller +Michael Shields +Michael Stapelberg +Michael T. Jones +Michael Teichgräber +Michael Vetter +Michal Cierniak +Michał Derkacz +Michalis Kargakis +Miek Gieben +Mihai Borobocea +Mikael Tillenius +Mike Andrews +Mike Rosset +Mike Samuel +Mike Solomon +Mikhail Panchenko +Miki Tebeka +Mikio Hara +Mikkel Krautz +Miquel Sabaté Solà +Moriyoshi Koizumi +Môshe van der Sterre +Mrunal Patel +Nan Deng +Nathan John Youngman +Nathan P Finch +Nathan Youngman +Nevins Bartolomeo +Nicholas Katsaros +Nicholas Presta +Nicholas Sullivan +Nicholas Waples +Nick Cooper +Nick Craig-Wood +Nicolas Kaiser +Nicolas Owens +Nicolas S. Dade +Nigel Kerr +Nigel Tao +Noah Campbell +Oling Cat +Oliver Hookins +Olivier Antoine +Olivier Duperray +Olivier Saingre +Padraig Kitterick +Paolo Giarrusso +Paolo Martini +Pascal S. de Kloe +Patrick Crosby +Patrick Gavlin +Patrick Higgins +Patrick Mézard +Patrick Mylund Nielsen +Patrick Riley +Patrick Smith +Paul A Querna +Paul Borman +Paul Chang +Paul Hammond +Paul Lalonde +Paul Marks +Paul Nasrat +Paul Sbarra +Paul Smith +Paul van Brouwershaven +Pavel Zinovkin +Pawel Szczur +Percy Wegmann +Petar Maymounkov +Peter Armitage +Peter Collingbourne +Peter Froehlich +Peter Kleiweg +Peter McKenzie +Peter Moody +Peter Mundy +Péter Surányi +Péter Szabó +Péter Szilágyi +Peter Waldschmidt +Peter Waller +Peter Weinberger +Peter Williams +Phil Pennock +Philip K. Warren +Pieter Droogendijk +Pietro Gagliardi +Preetam Jinka +Quan Yong Zhai +Quoc-Viet Nguyen +Rahul Chaudhry +Raif S. Naffah +Rajat Goel +Raph Levien +Raul Silvera +Rémy Oudompheng +Richard Barnes +Richard Crowley +Richard Eric Gavaletz +Richard Musiol +Rick Arnold +Rick Hudson +Risto Jaakko Saarelma +Rob Pike +Robert Daniel Kortschak +Robert Dinu +Robert Figueiredo +Robert Griesemer +Robert Hencke +Robert Obryk +Robert Sesek +Robert Snedegar +Robin Eklind +Rodrigo Moraes de Oliveira +Rodrigo Rafael Monti Kochenburger +Roger Pau Monné +Roger Peppe +Ron Hashimoto +Ron Minnich +Ross Light +Rowan Worth +Rui Ueyama +Russ Cox +Ryan Barrett +Ryan Brown +Ryan Hitchman +Ryan Seys +Ryan Slade +S.Çağlar Onur +Sam Thorogood +Sameer Ajmani +Sanjay Menakuru +Scott Barron +Scott Ferguson +Scott Lawrence +Scott Schwartz +Sean Burford +Sebastien Binet +Sébastien Paolacci +Sergei Skorobogatov +Sergey 'SnakE' Gromov +Sergio Luis O. B. Correia +Shane Hansen +Shawn Ledbetter +Shawn Smith +Shenghou Ma +Shivakumar GN +Silvan Jegen +Simon Whitehead +Sokolov Yura +Spring Mc +Srdjan Petrovic +StalkR +Stan Schwertly +Stefan Nilsson +Stéphane Travostino +Stephen Ma +Stephen McQuay +Stephen Weinberg +Steve McCoy +Steve Streeting +Steven Elliot Harris +Steven Hartland +Sugu Sougoumarane +Sven Almgren +Szabolcs Nagy +Tad Glines +Taj Khattra +Tamir Duberstein +Tarmigan Casebolt +Taru Karttunen +Tetsuo Kiso +Thiago Fransosi Farina +Thomas Alan Copeland +Thomas Habets +Thomas Kappler +Timo Savola +Timo Truyts +Tobias Columbus +Todd Neal +Todd Wang +Tom Heng +Tom Linford +Tom Szymanski +Tommy Schaefer +Tor Andersson +Travis Cline +Trevor Strohman +Tudor Golubenco +Tw +Tyler Bunnell +Ugorji Nwoke +Ulf Holm Nielsen +Uriel Mangado +Vadim Vygonets +Vega Garcia Luis Alfonso +Vincent Ambo +Vincent Batts +Vincent Vanackere +Vinu Rajashekhar +Vish Subramanian +Vlad Krasnov +Vladimir Nikishenko +Volker Dobler +Wei Guangjing +Will Norris +Willem van der Schyff +William Chan +William Josephson +William Orr +Xia Bin +Xing Xing +Yan Zou +Yasuhiro Matsumoto +Yissakhar Z. Beck +Yo-An Lin +Yongjian Xu +Yoshiyuki Kanno +Yusuke Kagiwada +Yuusei Kuwana +Yuval Pavel Zholkover +Yves Junqueira +Ziad Hatahet +Zorion Arrizabalaga +申习之 diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..74487567632c8f137ef3971b0f5912ca50bebcda --- /dev/null +++ b/LICENSE @@ -0,0 +1,27 @@ +Copyright (c) 2012 The Go Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/PATENTS b/PATENTS new file mode 100644 index 0000000000000000000000000000000000000000..733099041f84fa1e58611ab2e11af51c1f26d1d2 --- /dev/null +++ b/PATENTS @@ -0,0 +1,22 @@ +Additional IP Rights Grant (Patents) + +"This implementation" means the copyrightable works distributed by +Google as part of the Go project. + +Google hereby grants to You a perpetual, worldwide, non-exclusive, +no-charge, royalty-free, irrevocable (except as stated in this section) +patent license to make, have made, use, offer to sell, sell, import, +transfer and otherwise run, modify and propagate the contents of this +implementation of Go, where such license applies only to those patent +claims, both currently owned or controlled by Google and acquired in +the future, licensable by Google that are necessarily infringed by this +implementation of Go. This grant does not include claims that would be +infringed only as a consequence of further modification of this +implementation. If you or your agent or exclusive licensee institute or +order or agree to the institution of patent litigation against any +entity (including a cross-claim or counterclaim in a lawsuit) alleging +that this implementation of Go or any code incorporated within this +implementation of Go constitutes direct or contributory patent +infringement, or inducement of patent infringement, then any patent +rights granted to you under this License for this implementation of Go +shall terminate as of the date such litigation is filed. diff --git a/README.md b/README.md new file mode 100644 index 0000000000000000000000000000000000000000..4e6d7bde1fae42cc830c7f1760abcb7a12d839a8 --- /dev/null +++ b/README.md @@ -0,0 +1,45 @@ +# The Go Programming Language + +Go is an open source programming language that makes it easy to build simple, +reliable, and efficient software. + +![Gopher image](doc/gopher/fiveyears.jpg) + +For documentation about how to install and use Go, +visit https://golang.org/ or load doc/install-source.html +in your web browser. + +Our canonical Git repository is located at https://go.googlesource.com/go. +There is a mirror of the repository at https://github.com/golang/go. + +Please report issues here: https://golang.org/issue/new + +Go is the work of hundreds of contributors. We appreciate your help! + +To contribute, please read the contribution guidelines: + https://golang.org/doc/contribute.html + +##### Please note that we do not use pull requests. + +Unless otherwise noted, the Go source files are distributed +under the BSD-style license found in the LICENSE file. + +-- + +## Binary Distribution Notes + +If you have just untarred a binary Go distribution, you need to set +the environment variable $GOROOT to the full path of the go +directory (the one containing this file). You can omit the +variable if you unpack it into /usr/local/go, or if you rebuild +from sources by running all.bash (see doc/install-source.html). +You should also add the Go binary directory $GOROOT/bin +to your shell's path. + +For example, if you extracted the tar file into $HOME/go, you might +put the following in your .profile: + + export GOROOT=$HOME/go + export PATH=$PATH:$GOROOT/bin + +See https://golang.org/doc/install or doc/install.html for more details. diff --git a/VERSION b/VERSION new file mode 100644 index 0000000000000000000000000000000000000000..77af434f110af853a21db3f2317bc0586ecb4bb8 --- /dev/null +++ b/VERSION @@ -0,0 +1 @@ +go1.5.1 \ No newline at end of file diff --git a/api/README b/api/README new file mode 100644 index 0000000000000000000000000000000000000000..897abc8d273e676408d6bc10d603f6ee2d278406 --- /dev/null +++ b/api/README @@ -0,0 +1,14 @@ +Files in this directory are data for Go's API checker ("go tool api", in src/cmd/api). + +Each file is a list of of API features, one per line. + +go1.txt (and similarly named files) are frozen once a version has been +shipped. Each file adds new lines but does not remove any. + +except.txt lists features that may disappear without breaking true +compatibility. + +next.txt is the only file intended to be mutated. It's a list of +features that may be added to the next version. It only affects +warning output from the go api tool. + diff --git a/api/except.txt b/api/except.txt new file mode 100644 index 0000000000000000000000000000000000000000..59ef94211db55a67b8e38e411faf7d6709337347 --- /dev/null +++ b/api/except.txt @@ -0,0 +1,331 @@ +pkg net, func ListenUnixgram(string, *UnixAddr) (*UDPConn, error) +pkg syscall (darwin-386), func Fchflags(string, int) error +pkg syscall (darwin-386-cgo), func Fchflags(string, int) error +pkg syscall (darwin-amd64), func Fchflags(string, int) error +pkg syscall (darwin-amd64-cgo), func Fchflags(string, int) error +pkg syscall (freebsd-386), func Fchflags(string, int) error +pkg syscall (freebsd-amd64), func Fchflags(string, int) error +pkg syscall (freebsd-arm), func Fchflags(string, int) error +pkg syscall (freebsd-arm-cgo), func Fchflags(string, int) error +pkg syscall (netbsd-arm), func Fchflags(string, int) error +pkg syscall (netbsd-arm-cgo), func Fchflags(string, int) error +pkg testing, func RegisterCover(Cover) +pkg text/template/parse, type DotNode bool +pkg text/template/parse, type Node interface { Copy, String, Type } +pkg os (linux-arm), const O_SYNC = 4096 +pkg os (linux-arm-cgo), const O_SYNC = 4096 +pkg syscall (darwin-386), const ImplementsGetwd = false +pkg syscall (darwin-386-cgo), const ImplementsGetwd = false +pkg syscall (darwin-amd64), const ImplementsGetwd = false +pkg syscall (darwin-amd64-cgo), const ImplementsGetwd = false +pkg syscall (openbsd-386), const BIOCGRTIMEOUT = 1074283118 +pkg syscall (openbsd-386), const BIOCSRTIMEOUT = 2148024941 +pkg syscall (openbsd-386), const RTF_FMASK = 63496 +pkg syscall (openbsd-386), const RTM_VERSION = 4 +pkg syscall (openbsd-386), const SIOCBRDGDADDR = 2150132039 +pkg syscall (openbsd-386), const SIOCBRDGGPARAM = 3224922456 +pkg syscall (openbsd-386), const SIOCBRDGSADDR = 3223873860 +pkg syscall (openbsd-386), const SYS_CLOCK_GETRES = 234 +pkg syscall (openbsd-386), const SYS_CLOCK_GETTIME = 232 +pkg syscall (openbsd-386), const SYS_CLOCK_SETTIME = 233 +pkg syscall (openbsd-386), const SYS_FHSTATFS = 309 +pkg syscall (openbsd-386), const SYS_FSTAT = 292 +pkg syscall (openbsd-386), const SYS_FSTATAT = 316 +pkg syscall (openbsd-386), const SYS_FSTATFS = 308 +pkg syscall (openbsd-386), const SYS_FUTIMENS = 327 +pkg syscall (openbsd-386), const SYS_FUTIMES = 206 +pkg syscall (openbsd-386), const SYS_GETDIRENTRIES = 312 +pkg syscall (openbsd-386), const SYS_GETDIRENTRIES ideal-int +pkg syscall (openbsd-386), const SYS_GETFSSTAT = 306 +pkg syscall (openbsd-386), const SYS_GETITIMER = 86 +pkg syscall (openbsd-386), const SYS_GETRUSAGE = 117 +pkg syscall (openbsd-386), const SYS_GETTIMEOFDAY = 116 +pkg syscall (openbsd-386), const SYS_KEVENT = 270 +pkg syscall (openbsd-386), const SYS_LSTAT = 293 +pkg syscall (openbsd-386), const SYS_NANOSLEEP = 240 +pkg syscall (openbsd-386), const SYS_SELECT = 93 +pkg syscall (openbsd-386), const SYS_SETITIMER = 83 +pkg syscall (openbsd-386), const SYS_SETTIMEOFDAY = 122 +pkg syscall (openbsd-386), const SYS_STAT = 291 +pkg syscall (openbsd-386), const SYS_STATFS = 307 +pkg syscall (openbsd-386), const SYS_UTIMENSAT = 326 +pkg syscall (openbsd-386), const SYS_UTIMES = 138 +pkg syscall (openbsd-386), const SYS_WAIT4 = 7 +pkg syscall (openbsd-386), const SYS___THRSLEEP = 300 +pkg syscall (openbsd-386), const SizeofIfData = 208 +pkg syscall (openbsd-386), const SizeofIfMsghdr = 232 +pkg syscall (openbsd-386), const SizeofRtMetrics = 48 +pkg syscall (openbsd-386), const SizeofRtMsghdr = 88 +pkg syscall (openbsd-386), const TIOCGTSTAMP = 1074295899 +pkg syscall (openbsd-386), type Dirent struct, Fileno uint32 +pkg syscall (openbsd-386), type FdSet struct, Bits [32]int32 +pkg syscall (openbsd-386), type Kevent_t struct, Data int32 +pkg syscall (openbsd-386), type Mclpool struct, Grown uint32 +pkg syscall (openbsd-386), type RtMetrics struct, Expire uint32 +pkg syscall (openbsd-386), type Stat_t struct, Ino uint32 +pkg syscall (openbsd-386), type Stat_t struct, Lspare0 int32 +pkg syscall (openbsd-386), type Stat_t struct, Lspare1 int32 +pkg syscall (openbsd-386), type Stat_t struct, Qspare [2]int64 +pkg syscall (openbsd-386), type Statfs_t struct, F_ctime uint32 +pkg syscall (openbsd-386), type Statfs_t struct, F_spare [3]uint32 +pkg syscall (openbsd-386), type Timespec struct, Sec int32 +pkg syscall (openbsd-386), type Timeval struct, Sec int32 +pkg syscall (openbsd-386-cgo), const BIOCGRTIMEOUT = 1074283118 +pkg syscall (openbsd-386-cgo), const BIOCSRTIMEOUT = 2148024941 +pkg syscall (openbsd-386-cgo), const RTF_FMASK = 63496 +pkg syscall (openbsd-386-cgo), const RTM_VERSION = 4 +pkg syscall (openbsd-386-cgo), const SIOCBRDGDADDR = 2150132039 +pkg syscall (openbsd-386-cgo), const SIOCBRDGGPARAM = 3224922456 +pkg syscall (openbsd-386-cgo), const SIOCBRDGSADDR = 3223873860 +pkg syscall (openbsd-386-cgo), const SYS_CLOCK_GETRES = 234 +pkg syscall (openbsd-386-cgo), const SYS_CLOCK_GETTIME = 232 +pkg syscall (openbsd-386-cgo), const SYS_CLOCK_SETTIME = 233 +pkg syscall (openbsd-386-cgo), const SYS_FHSTATFS = 309 +pkg syscall (openbsd-386-cgo), const SYS_FSTAT = 292 +pkg syscall (openbsd-386-cgo), const SYS_FSTATAT = 316 +pkg syscall (openbsd-386-cgo), const SYS_FSTATFS = 308 +pkg syscall (openbsd-386-cgo), const SYS_FUTIMENS = 327 +pkg syscall (openbsd-386-cgo), const SYS_FUTIMES = 206 +pkg syscall (openbsd-386-cgo), const SYS_GETDIRENTRIES = 312 +pkg syscall (openbsd-386-cgo), const SYS_GETDIRENTRIES ideal-int +pkg syscall (openbsd-386-cgo), const SYS_GETFSSTAT = 306 +pkg syscall (openbsd-386-cgo), const SYS_GETITIMER = 86 +pkg syscall (openbsd-386-cgo), const SYS_GETRUSAGE = 117 +pkg syscall (openbsd-386-cgo), const SYS_GETTIMEOFDAY = 116 +pkg syscall (openbsd-386-cgo), const SYS_KEVENT = 270 +pkg syscall (openbsd-386-cgo), const SYS_LSTAT = 293 +pkg syscall (openbsd-386-cgo), const SYS_NANOSLEEP = 240 +pkg syscall (openbsd-386-cgo), const SYS_SELECT = 93 +pkg syscall (openbsd-386-cgo), const SYS_SETITIMER = 83 +pkg syscall (openbsd-386-cgo), const SYS_SETTIMEOFDAY = 122 +pkg syscall (openbsd-386-cgo), const SYS_STAT = 291 +pkg syscall (openbsd-386-cgo), const SYS_STATFS = 307 +pkg syscall (openbsd-386-cgo), const SYS_UTIMENSAT = 326 +pkg syscall (openbsd-386-cgo), const SYS_UTIMES = 138 +pkg syscall (openbsd-386-cgo), const SYS_WAIT4 = 7 +pkg syscall (openbsd-386-cgo), const SYS___THRSLEEP = 300 +pkg syscall (openbsd-386-cgo), const SizeofIfData = 208 +pkg syscall (openbsd-386-cgo), const SizeofIfMsghdr = 232 +pkg syscall (openbsd-386-cgo), const SizeofRtMetrics = 48 +pkg syscall (openbsd-386-cgo), const SizeofRtMsghdr = 88 +pkg syscall (openbsd-386-cgo), const TIOCGTSTAMP = 1074295899 +pkg syscall (openbsd-386-cgo), type Dirent struct, Fileno uint32 +pkg syscall (openbsd-386-cgo), type FdSet struct, Bits [32]int32 +pkg syscall (openbsd-386-cgo), type Kevent_t struct, Data int32 +pkg syscall (openbsd-386-cgo), type Mclpool struct, Grown uint32 +pkg syscall (openbsd-386-cgo), type RtMetrics struct, Expire uint32 +pkg syscall (openbsd-386-cgo), type Stat_t struct, Ino uint32 +pkg syscall (openbsd-386-cgo), type Stat_t struct, Lspare0 int32 +pkg syscall (openbsd-386-cgo), type Stat_t struct, Lspare1 int32 +pkg syscall (openbsd-386-cgo), type Stat_t struct, Qspare [2]int64 +pkg syscall (openbsd-386-cgo), type Statfs_t struct, F_ctime uint32 +pkg syscall (openbsd-386-cgo), type Statfs_t struct, F_spare [3]uint32 +pkg syscall (openbsd-386-cgo), type Timespec struct, Sec int32 +pkg syscall (openbsd-386-cgo), type Timeval struct, Sec int32 +pkg syscall (openbsd-amd64), const CCR0_FLUSH = 16 +pkg syscall (openbsd-amd64), const CCR0_FLUSH ideal-int +pkg syscall (openbsd-amd64), const CPUID_CFLUSH = 524288 +pkg syscall (openbsd-amd64), const CPUID_CFLUSH ideal-int +pkg syscall (openbsd-amd64), const EFER_LMA = 1024 +pkg syscall (openbsd-amd64), const EFER_LMA ideal-int +pkg syscall (openbsd-amd64), const EFER_LME = 256 +pkg syscall (openbsd-amd64), const EFER_LME ideal-int +pkg syscall (openbsd-amd64), const EFER_NXE = 2048 +pkg syscall (openbsd-amd64), const EFER_NXE ideal-int +pkg syscall (openbsd-amd64), const EFER_SCE = 1 +pkg syscall (openbsd-amd64), const EFER_SCE ideal-int +pkg syscall (openbsd-amd64), const PMC5_PIPELINE_FLUSH = 21 +pkg syscall (openbsd-amd64), const PMC5_PIPELINE_FLUSH ideal-int +pkg syscall (openbsd-amd64), const RTF_FMASK = 63496 +pkg syscall (openbsd-amd64), const RTM_VERSION = 4 +pkg syscall (openbsd-amd64), const SIOCBRDGDADDR = 2150132039 +pkg syscall (openbsd-amd64), const SIOCBRDGSADDR = 3223873860 +pkg syscall (openbsd-amd64), const SYS_CLOCK_GETRES = 234 +pkg syscall (openbsd-amd64), const SYS_CLOCK_GETTIME = 232 +pkg syscall (openbsd-amd64), const SYS_CLOCK_SETTIME = 233 +pkg syscall (openbsd-amd64), const SYS_FHSTATFS = 309 +pkg syscall (openbsd-amd64), const SYS_FSTAT = 292 +pkg syscall (openbsd-amd64), const SYS_FSTATAT = 316 +pkg syscall (openbsd-amd64), const SYS_FSTATFS = 308 +pkg syscall (openbsd-amd64), const SYS_FUTIMENS = 327 +pkg syscall (openbsd-amd64), const SYS_FUTIMES = 206 +pkg syscall (openbsd-amd64), const SYS_GETDIRENTRIES = 312 +pkg syscall (openbsd-amd64), const SYS_GETDIRENTRIES ideal-int +pkg syscall (openbsd-amd64), const SYS_GETFSSTAT = 306 +pkg syscall (openbsd-amd64), const SYS_GETITIMER = 86 +pkg syscall (openbsd-amd64), const SYS_GETRUSAGE = 117 +pkg syscall (openbsd-amd64), const SYS_GETTIMEOFDAY = 116 +pkg syscall (openbsd-amd64), const SYS_KEVENT = 270 +pkg syscall (openbsd-amd64), const SYS_LSTAT = 293 +pkg syscall (openbsd-amd64), const SYS_NANOSLEEP = 240 +pkg syscall (openbsd-amd64), const SYS_SELECT = 93 +pkg syscall (openbsd-amd64), const SYS_SETITIMER = 83 +pkg syscall (openbsd-amd64), const SYS_SETTIMEOFDAY = 122 +pkg syscall (openbsd-amd64), const SYS_STAT = 291 +pkg syscall (openbsd-amd64), const SYS_STATFS = 307 +pkg syscall (openbsd-amd64), const SYS_UTIMENSAT = 326 +pkg syscall (openbsd-amd64), const SYS_UTIMES = 138 +pkg syscall (openbsd-amd64), const SYS_WAIT4 = 7 +pkg syscall (openbsd-amd64), const SYS___THRSLEEP = 300 +pkg syscall (openbsd-amd64), const SizeofRtMetrics = 48 +pkg syscall (openbsd-amd64), const SizeofRtMsghdr = 88 +pkg syscall (openbsd-amd64), type Dirent struct, Fileno uint32 +pkg syscall (openbsd-amd64), type FdSet struct, Bits [32]int32 +pkg syscall (openbsd-amd64), type Kevent_t struct, Data int32 +pkg syscall (openbsd-amd64), type Kevent_t struct, Ident uint32 +pkg syscall (openbsd-amd64), type Mclpool struct, Grown uint32 +pkg syscall (openbsd-amd64), type RtMetrics struct, Expire uint32 +pkg syscall (openbsd-amd64), type Stat_t struct, Ino uint32 +pkg syscall (openbsd-amd64), type Stat_t struct, Lspare0 int32 +pkg syscall (openbsd-amd64), type Stat_t struct, Lspare1 int32 +pkg syscall (openbsd-amd64), type Stat_t struct, Qspare [2]int64 +pkg syscall (openbsd-amd64), type Statfs_t struct, F_ctime uint32 +pkg syscall (openbsd-amd64), type Statfs_t struct, F_spare [3]uint32 +pkg syscall (openbsd-amd64), type Statfs_t struct, Pad_cgo_1 [4]uint8 +pkg syscall (openbsd-amd64), type Timespec struct, Pad_cgo_0 [4]uint8 +pkg syscall (openbsd-amd64), type Timespec struct, Sec int32 +pkg syscall (openbsd-amd64-cgo), const CCR0_FLUSH = 16 +pkg syscall (openbsd-amd64-cgo), const CCR0_FLUSH ideal-int +pkg syscall (openbsd-amd64-cgo), const CPUID_CFLUSH = 524288 +pkg syscall (openbsd-amd64-cgo), const CPUID_CFLUSH ideal-int +pkg syscall (openbsd-amd64-cgo), const EFER_LMA = 1024 +pkg syscall (openbsd-amd64-cgo), const EFER_LMA ideal-int +pkg syscall (openbsd-amd64-cgo), const EFER_LME = 256 +pkg syscall (openbsd-amd64-cgo), const EFER_LME ideal-int +pkg syscall (openbsd-amd64-cgo), const EFER_NXE = 2048 +pkg syscall (openbsd-amd64-cgo), const EFER_NXE ideal-int +pkg syscall (openbsd-amd64-cgo), const EFER_SCE = 1 +pkg syscall (openbsd-amd64-cgo), const EFER_SCE ideal-int +pkg syscall (openbsd-amd64-cgo), const PMC5_PIPELINE_FLUSH = 21 +pkg syscall (openbsd-amd64-cgo), const PMC5_PIPELINE_FLUSH ideal-int +pkg syscall (openbsd-amd64-cgo), const RTF_FMASK = 63496 +pkg syscall (openbsd-amd64-cgo), const RTM_VERSION = 4 +pkg syscall (openbsd-amd64-cgo), const SIOCBRDGDADDR = 2150132039 +pkg syscall (openbsd-amd64-cgo), const SIOCBRDGSADDR = 3223873860 +pkg syscall (openbsd-amd64-cgo), const SYS_CLOCK_GETRES = 234 +pkg syscall (openbsd-amd64-cgo), const SYS_CLOCK_GETTIME = 232 +pkg syscall (openbsd-amd64-cgo), const SYS_CLOCK_SETTIME = 233 +pkg syscall (openbsd-amd64-cgo), const SYS_FHSTATFS = 309 +pkg syscall (openbsd-amd64-cgo), const SYS_FSTAT = 292 +pkg syscall (openbsd-amd64-cgo), const SYS_FSTATAT = 316 +pkg syscall (openbsd-amd64-cgo), const SYS_FSTATFS = 308 +pkg syscall (openbsd-amd64-cgo), const SYS_FUTIMENS = 327 +pkg syscall (openbsd-amd64-cgo), const SYS_FUTIMES = 206 +pkg syscall (openbsd-amd64-cgo), const SYS_GETDIRENTRIES = 312 +pkg syscall (openbsd-amd64-cgo), const SYS_GETDIRENTRIES ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_GETFSSTAT = 306 +pkg syscall (openbsd-amd64-cgo), const SYS_GETITIMER = 86 +pkg syscall (openbsd-amd64-cgo), const SYS_GETRUSAGE = 117 +pkg syscall (openbsd-amd64-cgo), const SYS_GETTIMEOFDAY = 116 +pkg syscall (openbsd-amd64-cgo), const SYS_KEVENT = 270 +pkg syscall (openbsd-amd64-cgo), const SYS_LSTAT = 293 +pkg syscall (openbsd-amd64-cgo), const SYS_NANOSLEEP = 240 +pkg syscall (openbsd-amd64-cgo), const SYS_SELECT = 93 +pkg syscall (openbsd-amd64-cgo), const SYS_SETITIMER = 83 +pkg syscall (openbsd-amd64-cgo), const SYS_SETTIMEOFDAY = 122 +pkg syscall (openbsd-amd64-cgo), const SYS_STAT = 291 +pkg syscall (openbsd-amd64-cgo), const SYS_STATFS = 307 +pkg syscall (openbsd-amd64-cgo), const SYS_UTIMENSAT = 326 +pkg syscall (openbsd-amd64-cgo), const SYS_UTIMES = 138 +pkg syscall (openbsd-amd64-cgo), const SYS_WAIT4 = 7 +pkg syscall (openbsd-amd64-cgo), const SYS___THRSLEEP = 300 +pkg syscall (openbsd-amd64-cgo), const SizeofRtMetrics = 48 +pkg syscall (openbsd-amd64-cgo), const SizeofRtMsghdr = 88 +pkg syscall (openbsd-amd64-cgo), type Dirent struct, Fileno uint32 +pkg syscall (openbsd-amd64-cgo), type FdSet struct, Bits [32]int32 +pkg syscall (openbsd-amd64-cgo), type Kevent_t struct, Data int32 +pkg syscall (openbsd-amd64-cgo), type Kevent_t struct, Ident uint32 +pkg syscall (openbsd-amd64-cgo), type Mclpool struct, Grown uint32 +pkg syscall (openbsd-amd64-cgo), type RtMetrics struct, Expire uint32 +pkg syscall (openbsd-amd64-cgo), type Stat_t struct, Ino uint32 +pkg syscall (openbsd-amd64-cgo), type Stat_t struct, Lspare0 int32 +pkg syscall (openbsd-amd64-cgo), type Stat_t struct, Lspare1 int32 +pkg syscall (openbsd-amd64-cgo), type Stat_t struct, Qspare [2]int64 +pkg syscall (openbsd-amd64-cgo), type Statfs_t struct, F_ctime uint32 +pkg syscall (openbsd-amd64-cgo), type Statfs_t struct, F_spare [3]uint32 +pkg syscall (openbsd-amd64-cgo), type Statfs_t struct, Pad_cgo_1 [4]uint8 +pkg syscall (openbsd-amd64-cgo), type Timespec struct, Pad_cgo_0 [4]uint8 +pkg syscall (openbsd-amd64-cgo), type Timespec struct, Sec int32 +pkg unicode, const Version = "6.2.0" +pkg syscall (freebsd-386), const AF_MAX = 38 +pkg syscall (freebsd-386), const DLT_MATCHING_MAX = 242 +pkg syscall (freebsd-386), const ELAST = 94 +pkg syscall (freebsd-386), const O_CLOEXEC = 0 +pkg syscall (freebsd-386-cgo), const AF_MAX = 38 +pkg syscall (freebsd-386-cgo), const DLT_MATCHING_MAX = 242 +pkg syscall (freebsd-386-cgo), const ELAST = 94 +pkg syscall (freebsd-386-cgo), const O_CLOEXEC = 0 +pkg syscall (freebsd-amd64), const AF_MAX = 38 +pkg syscall (freebsd-amd64), const DLT_MATCHING_MAX = 242 +pkg syscall (freebsd-amd64), const ELAST = 94 +pkg syscall (freebsd-amd64), const O_CLOEXEC = 0 +pkg syscall (freebsd-amd64-cgo), const AF_MAX = 38 +pkg syscall (freebsd-amd64-cgo), const DLT_MATCHING_MAX = 242 +pkg syscall (freebsd-amd64-cgo), const ELAST = 94 +pkg syscall (freebsd-amd64-cgo), const O_CLOEXEC = 0 +pkg syscall (freebsd-arm), const AF_MAX = 38 +pkg syscall (freebsd-arm), const BIOCGRTIMEOUT = 1074545262 +pkg syscall (freebsd-arm), const BIOCSRTIMEOUT = 2148287085 +pkg syscall (freebsd-arm), const ELAST = 94 +pkg syscall (freebsd-arm), const O_CLOEXEC = 0 +pkg syscall (freebsd-arm), const SIOCAIFADDR = 2151967019 +pkg syscall (freebsd-arm), const SIOCGIFSTATUS = 3274991931 +pkg syscall (freebsd-arm), const SIOCSIFPHYADDR = 2151967046 +pkg syscall (freebsd-arm), const SYS_CAP_FCNTLS_GET = 537 +pkg syscall (freebsd-arm), const SYS_CAP_FCNTLS_GET ideal-int +pkg syscall (freebsd-arm), const SYS_CAP_FCNTLS_LIMIT = 536 +pkg syscall (freebsd-arm), const SYS_CAP_FCNTLS_LIMIT ideal-int +pkg syscall (freebsd-arm), const SYS_CAP_IOCTLS_GET = 535 +pkg syscall (freebsd-arm), const SYS_CAP_IOCTLS_GET ideal-int +pkg syscall (freebsd-arm), const SYS_CAP_IOCTLS_LIMIT = 534 +pkg syscall (freebsd-arm), const SYS_CAP_IOCTLS_LIMIT ideal-int +pkg syscall (freebsd-arm), const SYS_CAP_RIGHTS_GET = 515 +pkg syscall (freebsd-arm), const SYS_CAP_RIGHTS_GET ideal-int +pkg syscall (freebsd-arm), const SYS_CAP_RIGHTS_LIMIT = 533 +pkg syscall (freebsd-arm), const SYS_CAP_RIGHTS_LIMIT ideal-int +pkg syscall (freebsd-arm), const SizeofBpfHdr = 24 +pkg syscall (freebsd-arm), const SizeofIfData = 88 +pkg syscall (freebsd-arm), const SizeofIfMsghdr = 104 +pkg syscall (freebsd-arm), const SizeofSockaddrDatalink = 56 +pkg syscall (freebsd-arm), const SizeofSockaddrUnix = 108 +pkg syscall (freebsd-arm), const TIOCTIMESTAMP = 1074558041 +pkg syscall (freebsd-arm), type BpfHdr struct, Pad_cgo_0 [2]uint8 +pkg syscall (freebsd-arm), type RawSockaddrDatalink struct, Pad_cgo_0 [2]uint8 +pkg syscall (freebsd-arm), type RawSockaddrUnix struct, Pad_cgo_0 [2]uint8 +pkg syscall (freebsd-arm), type Stat_t struct, Pad_cgo_0 [4]uint8 +pkg syscall (freebsd-arm-cgo), const AF_MAX = 38 +pkg syscall (freebsd-arm-cgo), const BIOCGRTIMEOUT = 1074545262 +pkg syscall (freebsd-arm-cgo), const BIOCSRTIMEOUT = 2148287085 +pkg syscall (freebsd-arm-cgo), const ELAST = 94 +pkg syscall (freebsd-arm-cgo), const O_CLOEXEC = 0 +pkg syscall (freebsd-arm-cgo), const SIOCAIFADDR = 2151967019 +pkg syscall (freebsd-arm-cgo), const SIOCGIFSTATUS = 3274991931 +pkg syscall (freebsd-arm-cgo), const SIOCSIFPHYADDR = 2151967046 +pkg syscall (freebsd-arm-cgo), const SYS_CAP_FCNTLS_GET = 537 +pkg syscall (freebsd-arm-cgo), const SYS_CAP_FCNTLS_GET ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_CAP_FCNTLS_LIMIT = 536 +pkg syscall (freebsd-arm-cgo), const SYS_CAP_FCNTLS_LIMIT ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_CAP_IOCTLS_GET = 535 +pkg syscall (freebsd-arm-cgo), const SYS_CAP_IOCTLS_GET ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_CAP_IOCTLS_LIMIT = 534 +pkg syscall (freebsd-arm-cgo), const SYS_CAP_IOCTLS_LIMIT ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_CAP_RIGHTS_GET = 515 +pkg syscall (freebsd-arm-cgo), const SYS_CAP_RIGHTS_GET ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_CAP_RIGHTS_LIMIT = 533 +pkg syscall (freebsd-arm-cgo), const SYS_CAP_RIGHTS_LIMIT ideal-int +pkg syscall (freebsd-arm-cgo), const SizeofBpfHdr = 24 +pkg syscall (freebsd-arm-cgo), const SizeofIfData = 88 +pkg syscall (freebsd-arm-cgo), const SizeofIfMsghdr = 104 +pkg syscall (freebsd-arm-cgo), const SizeofSockaddrDatalink = 56 +pkg syscall (freebsd-arm-cgo), const SizeofSockaddrUnix = 108 +pkg syscall (freebsd-arm-cgo), const TIOCTIMESTAMP = 1074558041 +pkg syscall (freebsd-arm-cgo), type BpfHdr struct, Pad_cgo_0 [2]uint8 +pkg syscall (freebsd-arm-cgo), type RawSockaddrDatalink struct, Pad_cgo_0 [2]uint8 +pkg syscall (freebsd-arm-cgo), type RawSockaddrUnix struct, Pad_cgo_0 [2]uint8 +pkg syscall (freebsd-arm-cgo), type Stat_t struct, Pad_cgo_0 [4]uint8 +pkg syscall (netbsd-arm), const SizeofIfData = 132 +pkg syscall (netbsd-arm), type IfMsghdr struct, Pad_cgo_1 [4]uint8 +pkg syscall (netbsd-arm-cgo), const SizeofIfData = 132 +pkg syscall (netbsd-arm-cgo), type IfMsghdr struct, Pad_cgo_1 [4]uint8 +pkg unicode, const Version = "6.3.0" +pkg unicode, const Version = "7.0.0" diff --git a/api/go1.1.txt b/api/go1.1.txt new file mode 100644 index 0000000000000000000000000000000000000000..0b27523ab551347068e10fa2cc55aa39b6f9bb05 --- /dev/null +++ b/api/go1.1.txt @@ -0,0 +1,50427 @@ +pkg archive/tar, const TypeBlock = 52 +pkg archive/tar, const TypeChar = 51 +pkg archive/tar, const TypeCont = 55 +pkg archive/tar, const TypeDir = 53 +pkg archive/tar, const TypeFifo = 54 +pkg archive/tar, const TypeGNULongLink = 75 +pkg archive/tar, const TypeGNULongLink ideal-char +pkg archive/tar, const TypeGNULongName = 76 +pkg archive/tar, const TypeGNULongName ideal-char +pkg archive/tar, const TypeLink = 49 +pkg archive/tar, const TypeReg = 48 +pkg archive/tar, const TypeRegA = 0 +pkg archive/tar, const TypeSymlink = 50 +pkg archive/tar, const TypeXGlobalHeader = 103 +pkg archive/tar, const TypeXHeader = 120 +pkg archive/tar, func FileInfoHeader(os.FileInfo, string) (*Header, error) +pkg archive/tar, method (*Header) FileInfo() os.FileInfo +pkg archive/zip, const Deflate = 8 +pkg archive/zip, const Store = 0 +pkg archive/zip, type FileHeader struct, CompressedSize64 uint64 +pkg archive/zip, type FileHeader struct, UncompressedSize64 uint64 +pkg bufio, const MaxScanTokenSize = 65536 +pkg bufio, const MaxScanTokenSize ideal-int +pkg bufio, func NewScanner(io.Reader) *Scanner +pkg bufio, func ScanBytes([]uint8, bool) (int, []uint8, error) +pkg bufio, func ScanLines([]uint8, bool) (int, []uint8, error) +pkg bufio, func ScanRunes([]uint8, bool) (int, []uint8, error) +pkg bufio, func ScanWords([]uint8, bool) (int, []uint8, error) +pkg bufio, method (*Reader) WriteTo(io.Writer) (int64, error) +pkg bufio, method (*Scanner) Bytes() []uint8 +pkg bufio, method (*Scanner) Err() error +pkg bufio, method (*Scanner) Scan() bool +pkg bufio, method (*Scanner) Split(SplitFunc) +pkg bufio, method (*Scanner) Text() string +pkg bufio, method (*Writer) ReadFrom(io.Reader) (int64, error) +pkg bufio, method (ReadWriter) ReadFrom(io.Reader) (int64, error) +pkg bufio, method (ReadWriter) WriteTo(io.Writer) (int64, error) +pkg bufio, type Scanner struct +pkg bufio, type SplitFunc func([]uint8, bool) (int, []uint8, error) +pkg bufio, var ErrAdvanceTooFar error +pkg bufio, var ErrNegativeAdvance error +pkg bufio, var ErrTooLong error +pkg bytes, const MinRead = 512 +pkg bytes, func TrimPrefix([]uint8, []uint8) []uint8 +pkg bytes, func TrimSuffix([]uint8, []uint8) []uint8 +pkg bytes, method (*Buffer) Grow(int) +pkg bytes, method (*Reader) WriteTo(io.Writer) (int64, error) +pkg compress/flate, const BestCompression = 9 +pkg compress/flate, const BestSpeed = 1 +pkg compress/flate, const DefaultCompression = -1 +pkg compress/flate, const NoCompression = 0 +pkg compress/gzip, const BestCompression = 9 +pkg compress/gzip, const BestSpeed = 1 +pkg compress/gzip, const DefaultCompression = -1 +pkg compress/gzip, const NoCompression = 0 +pkg compress/gzip, method (*Writer) Flush() error +pkg compress/lzw, const LSB = 0 +pkg compress/lzw, const MSB = 1 +pkg compress/zlib, const BestCompression = 9 +pkg compress/zlib, const BestSpeed = 1 +pkg compress/zlib, const DefaultCompression = -1 +pkg compress/zlib, const NoCompression = 0 +pkg crypto, const MD4 = 1 +pkg crypto, const MD5 = 2 +pkg crypto, const MD5SHA1 = 8 +pkg crypto, const RIPEMD160 = 9 +pkg crypto, const SHA1 = 3 +pkg crypto, const SHA224 = 4 +pkg crypto, const SHA256 = 5 +pkg crypto, const SHA384 = 6 +pkg crypto, const SHA512 = 7 +pkg crypto/aes, const BlockSize = 16 +pkg crypto/des, const BlockSize = 8 +pkg crypto/dsa, const L1024N160 = 0 +pkg crypto/dsa, const L2048N224 = 1 +pkg crypto/dsa, const L2048N256 = 2 +pkg crypto/dsa, const L3072N256 = 3 +pkg crypto/hmac, func Equal([]uint8, []uint8) bool +pkg crypto/md5, const BlockSize = 64 +pkg crypto/md5, const Size = 16 +pkg crypto/sha1, const BlockSize = 64 +pkg crypto/sha1, const Size = 20 +pkg crypto/sha256, const BlockSize = 64 +pkg crypto/sha256, const Size = 32 +pkg crypto/sha256, const Size224 = 28 +pkg crypto/sha512, const BlockSize = 128 +pkg crypto/sha512, const Size = 64 +pkg crypto/sha512, const Size384 = 48 +pkg crypto/tls, const NoClientCert = 0 +pkg crypto/tls, const RequestClientCert = 1 +pkg crypto/tls, const RequireAndVerifyClientCert = 4 +pkg crypto/tls, const RequireAnyClientCert = 2 +pkg crypto/tls, const TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA = 49170 +pkg crypto/tls, const TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA = 49171 +pkg crypto/tls, const TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA = 49172 +pkg crypto/tls, const TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA uint16 +pkg crypto/tls, const TLS_ECDHE_RSA_WITH_RC4_128_SHA = 49169 +pkg crypto/tls, const TLS_RSA_WITH_3DES_EDE_CBC_SHA = 10 +pkg crypto/tls, const TLS_RSA_WITH_AES_128_CBC_SHA = 47 +pkg crypto/tls, const TLS_RSA_WITH_AES_256_CBC_SHA = 53 +pkg crypto/tls, const TLS_RSA_WITH_AES_256_CBC_SHA uint16 +pkg crypto/tls, const TLS_RSA_WITH_RC4_128_SHA = 5 +pkg crypto/tls, const VerifyClientCertIfGiven = 3 +pkg crypto/tls, type Config struct, PreferServerCipherSuites bool +pkg crypto/tls, type Config struct, SessionTicketKey [32]uint8 +pkg crypto/tls, type Config struct, SessionTicketsDisabled bool +pkg crypto/tls, type ConnectionState struct, DidResume bool +pkg crypto/x509, const CANotAuthorizedForThisName = 2 +pkg crypto/x509, const DSA = 2 +pkg crypto/x509, const DSAWithSHA1 = 7 +pkg crypto/x509, const DSAWithSHA256 = 8 +pkg crypto/x509, const ECDSA = 3 +pkg crypto/x509, const ECDSA PublicKeyAlgorithm +pkg crypto/x509, const ECDSAWithSHA1 = 9 +pkg crypto/x509, const ECDSAWithSHA1 SignatureAlgorithm +pkg crypto/x509, const ECDSAWithSHA256 = 10 +pkg crypto/x509, const ECDSAWithSHA256 SignatureAlgorithm +pkg crypto/x509, const ECDSAWithSHA384 = 11 +pkg crypto/x509, const ECDSAWithSHA384 SignatureAlgorithm +pkg crypto/x509, const ECDSAWithSHA512 = 12 +pkg crypto/x509, const ECDSAWithSHA512 SignatureAlgorithm +pkg crypto/x509, const Expired = 1 +pkg crypto/x509, const ExtKeyUsageAny = 0 +pkg crypto/x509, const ExtKeyUsageClientAuth = 2 +pkg crypto/x509, const ExtKeyUsageCodeSigning = 3 +pkg crypto/x509, const ExtKeyUsageEmailProtection = 4 +pkg crypto/x509, const ExtKeyUsageIPSECEndSystem = 5 +pkg crypto/x509, const ExtKeyUsageIPSECEndSystem ExtKeyUsage +pkg crypto/x509, const ExtKeyUsageIPSECTunnel = 6 +pkg crypto/x509, const ExtKeyUsageIPSECTunnel ExtKeyUsage +pkg crypto/x509, const ExtKeyUsageIPSECUser = 7 +pkg crypto/x509, const ExtKeyUsageIPSECUser ExtKeyUsage +pkg crypto/x509, const ExtKeyUsageMicrosoftServerGatedCrypto = 10 +pkg crypto/x509, const ExtKeyUsageMicrosoftServerGatedCrypto ExtKeyUsage +pkg crypto/x509, const ExtKeyUsageNetscapeServerGatedCrypto = 11 +pkg crypto/x509, const ExtKeyUsageNetscapeServerGatedCrypto ExtKeyUsage +pkg crypto/x509, const ExtKeyUsageOCSPSigning = 9 +pkg crypto/x509, const ExtKeyUsageServerAuth = 1 +pkg crypto/x509, const ExtKeyUsageTimeStamping = 8 +pkg crypto/x509, const IncompatibleUsage = 4 +pkg crypto/x509, const IncompatibleUsage InvalidReason +pkg crypto/x509, const KeyUsageCRLSign = 64 +pkg crypto/x509, const KeyUsageCertSign = 32 +pkg crypto/x509, const KeyUsageContentCommitment = 2 +pkg crypto/x509, const KeyUsageDataEncipherment = 8 +pkg crypto/x509, const KeyUsageDecipherOnly = 256 +pkg crypto/x509, const KeyUsageDigitalSignature = 1 +pkg crypto/x509, const KeyUsageEncipherOnly = 128 +pkg crypto/x509, const KeyUsageKeyAgreement = 16 +pkg crypto/x509, const KeyUsageKeyEncipherment = 4 +pkg crypto/x509, const MD2WithRSA = 1 +pkg crypto/x509, const MD5WithRSA = 2 +pkg crypto/x509, const NotAuthorizedToSign = 0 +pkg crypto/x509, const PEMCipher3DES = 2 +pkg crypto/x509, const PEMCipher3DES PEMCipher +pkg crypto/x509, const PEMCipherAES128 = 3 +pkg crypto/x509, const PEMCipherAES128 PEMCipher +pkg crypto/x509, const PEMCipherAES192 = 4 +pkg crypto/x509, const PEMCipherAES192 PEMCipher +pkg crypto/x509, const PEMCipherAES256 = 5 +pkg crypto/x509, const PEMCipherAES256 PEMCipher +pkg crypto/x509, const PEMCipherDES = 1 +pkg crypto/x509, const PEMCipherDES PEMCipher +pkg crypto/x509, const RSA = 1 +pkg crypto/x509, const SHA1WithRSA = 3 +pkg crypto/x509, const SHA256WithRSA = 4 +pkg crypto/x509, const SHA384WithRSA = 5 +pkg crypto/x509, const SHA512WithRSA = 6 +pkg crypto/x509, const TooManyIntermediates = 3 +pkg crypto/x509, const UnknownPublicKeyAlgorithm = 0 +pkg crypto/x509, const UnknownSignatureAlgorithm = 0 +pkg crypto/x509, func DecryptPEMBlock(*pem.Block, []uint8) ([]uint8, error) +pkg crypto/x509, func EncryptPEMBlock(io.Reader, string, []uint8, []uint8, PEMCipher) (*pem.Block, error) +pkg crypto/x509, func IsEncryptedPEMBlock(*pem.Block) bool +pkg crypto/x509, func ParseECPrivateKey([]uint8) (*ecdsa.PrivateKey, error) +pkg crypto/x509, method (SystemRootsError) Error() string +pkg crypto/x509, type Certificate struct, IPAddresses []net.IP +pkg crypto/x509, type PEMCipher int +pkg crypto/x509, type SystemRootsError struct +pkg crypto/x509, type VerifyOptions struct, KeyUsages []ExtKeyUsage +pkg crypto/x509, var IncorrectPasswordError error +pkg database/sql, method (*DB) Ping() error +pkg database/sql, method (*DB) SetMaxIdleConns(int) +pkg database/sql/driver, type Queryer interface { Query } +pkg database/sql/driver, type Queryer interface, Query(string, []Value) (Rows, error) +pkg debug/dwarf, const AttrAbstractOrigin = 49 +pkg debug/dwarf, const AttrAccessibility = 50 +pkg debug/dwarf, const AttrAddrClass = 51 +pkg debug/dwarf, const AttrAllocated = 78 +pkg debug/dwarf, const AttrArtificial = 52 +pkg debug/dwarf, const AttrAssociated = 79 +pkg debug/dwarf, const AttrBaseTypes = 53 +pkg debug/dwarf, const AttrBitOffset = 12 +pkg debug/dwarf, const AttrBitSize = 13 +pkg debug/dwarf, const AttrByteSize = 11 +pkg debug/dwarf, const AttrCallColumn = 87 +pkg debug/dwarf, const AttrCallFile = 88 +pkg debug/dwarf, const AttrCallLine = 89 +pkg debug/dwarf, const AttrCalling = 54 +pkg debug/dwarf, const AttrCommonRef = 26 +pkg debug/dwarf, const AttrCompDir = 27 +pkg debug/dwarf, const AttrConstValue = 28 +pkg debug/dwarf, const AttrContainingType = 29 +pkg debug/dwarf, const AttrCount = 55 +pkg debug/dwarf, const AttrDataLocation = 80 +pkg debug/dwarf, const AttrDataMemberLoc = 56 +pkg debug/dwarf, const AttrDeclColumn = 57 +pkg debug/dwarf, const AttrDeclFile = 58 +pkg debug/dwarf, const AttrDeclLine = 59 +pkg debug/dwarf, const AttrDeclaration = 60 +pkg debug/dwarf, const AttrDefaultValue = 30 +pkg debug/dwarf, const AttrDescription = 90 +pkg debug/dwarf, const AttrDiscr = 21 +pkg debug/dwarf, const AttrDiscrList = 61 +pkg debug/dwarf, const AttrDiscrValue = 22 +pkg debug/dwarf, const AttrEncoding = 62 +pkg debug/dwarf, const AttrEntrypc = 82 +pkg debug/dwarf, const AttrExtension = 84 +pkg debug/dwarf, const AttrExternal = 63 +pkg debug/dwarf, const AttrFrameBase = 64 +pkg debug/dwarf, const AttrFriend = 65 +pkg debug/dwarf, const AttrHighpc = 18 +pkg debug/dwarf, const AttrIdentifierCase = 66 +pkg debug/dwarf, const AttrImport = 24 +pkg debug/dwarf, const AttrInline = 32 +pkg debug/dwarf, const AttrIsOptional = 33 +pkg debug/dwarf, const AttrLanguage = 19 +pkg debug/dwarf, const AttrLocation = 2 +pkg debug/dwarf, const AttrLowerBound = 34 +pkg debug/dwarf, const AttrLowpc = 17 +pkg debug/dwarf, const AttrMacroInfo = 67 +pkg debug/dwarf, const AttrName = 3 +pkg debug/dwarf, const AttrNamelistItem = 68 +pkg debug/dwarf, const AttrOrdering = 9 +pkg debug/dwarf, const AttrPriority = 69 +pkg debug/dwarf, const AttrProducer = 37 +pkg debug/dwarf, const AttrPrototyped = 39 +pkg debug/dwarf, const AttrRanges = 85 +pkg debug/dwarf, const AttrReturnAddr = 42 +pkg debug/dwarf, const AttrSegment = 70 +pkg debug/dwarf, const AttrSibling = 1 +pkg debug/dwarf, const AttrSpecification = 71 +pkg debug/dwarf, const AttrStartScope = 44 +pkg debug/dwarf, const AttrStaticLink = 72 +pkg debug/dwarf, const AttrStmtList = 16 +pkg debug/dwarf, const AttrStride = 81 +pkg debug/dwarf, const AttrStrideSize = 46 +pkg debug/dwarf, const AttrStringLength = 25 +pkg debug/dwarf, const AttrTrampoline = 86 +pkg debug/dwarf, const AttrType = 73 +pkg debug/dwarf, const AttrUpperBound = 47 +pkg debug/dwarf, const AttrUseLocation = 74 +pkg debug/dwarf, const AttrUseUTF8 = 83 +pkg debug/dwarf, const AttrVarParam = 75 +pkg debug/dwarf, const AttrVirtuality = 76 +pkg debug/dwarf, const AttrVisibility = 23 +pkg debug/dwarf, const AttrVtableElemLoc = 77 +pkg debug/dwarf, const TagAccessDeclaration = 35 +pkg debug/dwarf, const TagArrayType = 1 +pkg debug/dwarf, const TagBaseType = 36 +pkg debug/dwarf, const TagCatchDwarfBlock = 37 +pkg debug/dwarf, const TagClassType = 2 +pkg debug/dwarf, const TagCommonDwarfBlock = 26 +pkg debug/dwarf, const TagCommonInclusion = 27 +pkg debug/dwarf, const TagCompileUnit = 17 +pkg debug/dwarf, const TagConstType = 38 +pkg debug/dwarf, const TagConstant = 39 +pkg debug/dwarf, const TagDwarfProcedure = 54 +pkg debug/dwarf, const TagEntryPoint = 3 +pkg debug/dwarf, const TagEnumerationType = 4 +pkg debug/dwarf, const TagEnumerator = 40 +pkg debug/dwarf, const TagFileType = 41 +pkg debug/dwarf, const TagFormalParameter = 5 +pkg debug/dwarf, const TagFriend = 42 +pkg debug/dwarf, const TagImportedDeclaration = 8 +pkg debug/dwarf, const TagImportedModule = 58 +pkg debug/dwarf, const TagImportedUnit = 61 +pkg debug/dwarf, const TagInheritance = 28 +pkg debug/dwarf, const TagInlinedSubroutine = 29 +pkg debug/dwarf, const TagInterfaceType = 56 +pkg debug/dwarf, const TagLabel = 10 +pkg debug/dwarf, const TagLexDwarfBlock = 11 +pkg debug/dwarf, const TagMember = 13 +pkg debug/dwarf, const TagModule = 30 +pkg debug/dwarf, const TagMutableType = 62 +pkg debug/dwarf, const TagNamelist = 43 +pkg debug/dwarf, const TagNamelistItem = 44 +pkg debug/dwarf, const TagNamespace = 57 +pkg debug/dwarf, const TagPackedType = 45 +pkg debug/dwarf, const TagPartialUnit = 60 +pkg debug/dwarf, const TagPointerType = 15 +pkg debug/dwarf, const TagPtrToMemberType = 31 +pkg debug/dwarf, const TagReferenceType = 16 +pkg debug/dwarf, const TagRestrictType = 55 +pkg debug/dwarf, const TagSetType = 32 +pkg debug/dwarf, const TagStringType = 18 +pkg debug/dwarf, const TagStructType = 19 +pkg debug/dwarf, const TagSubprogram = 46 +pkg debug/dwarf, const TagSubrangeType = 33 +pkg debug/dwarf, const TagSubroutineType = 21 +pkg debug/dwarf, const TagTemplateTypeParameter = 47 +pkg debug/dwarf, const TagTemplateValueParameter = 48 +pkg debug/dwarf, const TagThrownType = 49 +pkg debug/dwarf, const TagTryDwarfBlock = 50 +pkg debug/dwarf, const TagTypedef = 22 +pkg debug/dwarf, const TagUnionType = 23 +pkg debug/dwarf, const TagUnspecifiedParameters = 24 +pkg debug/dwarf, const TagUnspecifiedType = 59 +pkg debug/dwarf, const TagVariable = 52 +pkg debug/dwarf, const TagVariant = 25 +pkg debug/dwarf, const TagVariantPart = 51 +pkg debug/dwarf, const TagVolatileType = 53 +pkg debug/dwarf, const TagWithStmt = 34 +pkg debug/elf, const ARM_MAGIC_TRAMP_NUMBER = 1543503875 +pkg debug/elf, const DF_BIND_NOW = 8 +pkg debug/elf, const DF_ORIGIN = 1 +pkg debug/elf, const DF_STATIC_TLS = 16 +pkg debug/elf, const DF_SYMBOLIC = 2 +pkg debug/elf, const DF_TEXTREL = 4 +pkg debug/elf, const DT_BIND_NOW = 24 +pkg debug/elf, const DT_DEBUG = 21 +pkg debug/elf, const DT_ENCODING = 32 +pkg debug/elf, const DT_FINI = 13 +pkg debug/elf, const DT_FINI_ARRAY = 26 +pkg debug/elf, const DT_FINI_ARRAYSZ = 28 +pkg debug/elf, const DT_FLAGS = 30 +pkg debug/elf, const DT_HASH = 4 +pkg debug/elf, const DT_HIOS = 1879044096 +pkg debug/elf, const DT_HIPROC = 2147483647 +pkg debug/elf, const DT_INIT = 12 +pkg debug/elf, const DT_INIT_ARRAY = 25 +pkg debug/elf, const DT_INIT_ARRAYSZ = 27 +pkg debug/elf, const DT_JMPREL = 23 +pkg debug/elf, const DT_LOOS = 1610612749 +pkg debug/elf, const DT_LOPROC = 1879048192 +pkg debug/elf, const DT_NEEDED = 1 +pkg debug/elf, const DT_NULL = 0 +pkg debug/elf, const DT_PLTGOT = 3 +pkg debug/elf, const DT_PLTREL = 20 +pkg debug/elf, const DT_PLTRELSZ = 2 +pkg debug/elf, const DT_PREINIT_ARRAY = 32 +pkg debug/elf, const DT_PREINIT_ARRAYSZ = 33 +pkg debug/elf, const DT_REL = 17 +pkg debug/elf, const DT_RELA = 7 +pkg debug/elf, const DT_RELAENT = 9 +pkg debug/elf, const DT_RELASZ = 8 +pkg debug/elf, const DT_RELENT = 19 +pkg debug/elf, const DT_RELSZ = 18 +pkg debug/elf, const DT_RPATH = 15 +pkg debug/elf, const DT_RUNPATH = 29 +pkg debug/elf, const DT_SONAME = 14 +pkg debug/elf, const DT_STRSZ = 10 +pkg debug/elf, const DT_STRTAB = 5 +pkg debug/elf, const DT_SYMBOLIC = 16 +pkg debug/elf, const DT_SYMENT = 11 +pkg debug/elf, const DT_SYMTAB = 6 +pkg debug/elf, const DT_TEXTREL = 22 +pkg debug/elf, const DT_VERNEED = 1879048190 +pkg debug/elf, const DT_VERNEEDNUM = 1879048191 +pkg debug/elf, const DT_VERSYM = 1879048176 +pkg debug/elf, const EI_ABIVERSION = 8 +pkg debug/elf, const EI_CLASS = 4 +pkg debug/elf, const EI_DATA = 5 +pkg debug/elf, const EI_NIDENT = 16 +pkg debug/elf, const EI_OSABI = 7 +pkg debug/elf, const EI_PAD = 9 +pkg debug/elf, const EI_VERSION = 6 +pkg debug/elf, const ELFCLASS32 = 1 +pkg debug/elf, const ELFCLASS64 = 2 +pkg debug/elf, const ELFCLASSNONE = 0 +pkg debug/elf, const ELFDATA2LSB = 1 +pkg debug/elf, const ELFDATA2MSB = 2 +pkg debug/elf, const ELFDATANONE = 0 +pkg debug/elf, const ELFMAG = "\u007fELF" +pkg debug/elf, const ELFOSABI_86OPEN = 5 +pkg debug/elf, const ELFOSABI_AIX = 7 +pkg debug/elf, const ELFOSABI_ARM = 97 +pkg debug/elf, const ELFOSABI_FREEBSD = 9 +pkg debug/elf, const ELFOSABI_HPUX = 1 +pkg debug/elf, const ELFOSABI_HURD = 4 +pkg debug/elf, const ELFOSABI_IRIX = 8 +pkg debug/elf, const ELFOSABI_LINUX = 3 +pkg debug/elf, const ELFOSABI_MODESTO = 11 +pkg debug/elf, const ELFOSABI_NETBSD = 2 +pkg debug/elf, const ELFOSABI_NONE = 0 +pkg debug/elf, const ELFOSABI_NSK = 14 +pkg debug/elf, const ELFOSABI_OPENBSD = 12 +pkg debug/elf, const ELFOSABI_OPENVMS = 13 +pkg debug/elf, const ELFOSABI_SOLARIS = 6 +pkg debug/elf, const ELFOSABI_STANDALONE = 255 +pkg debug/elf, const ELFOSABI_TRU64 = 10 +pkg debug/elf, const EM_386 = 3 +pkg debug/elf, const EM_486 = 6 +pkg debug/elf, const EM_68HC12 = 53 +pkg debug/elf, const EM_68K = 4 +pkg debug/elf, const EM_860 = 7 +pkg debug/elf, const EM_88K = 5 +pkg debug/elf, const EM_960 = 19 +pkg debug/elf, const EM_ALPHA = 36902 +pkg debug/elf, const EM_ALPHA_STD = 41 +pkg debug/elf, const EM_ARC = 45 +pkg debug/elf, const EM_ARM = 40 +pkg debug/elf, const EM_COLDFIRE = 52 +pkg debug/elf, const EM_FR20 = 37 +pkg debug/elf, const EM_H8S = 48 +pkg debug/elf, const EM_H8_300 = 46 +pkg debug/elf, const EM_H8_300H = 47 +pkg debug/elf, const EM_H8_500 = 49 +pkg debug/elf, const EM_IA_64 = 50 +pkg debug/elf, const EM_M32 = 1 +pkg debug/elf, const EM_ME16 = 59 +pkg debug/elf, const EM_MIPS = 8 +pkg debug/elf, const EM_MIPS_RS3_LE = 10 +pkg debug/elf, const EM_MIPS_RS4_BE = 10 +pkg debug/elf, const EM_MIPS_X = 51 +pkg debug/elf, const EM_MMA = 54 +pkg debug/elf, const EM_NCPU = 56 +pkg debug/elf, const EM_NDR1 = 57 +pkg debug/elf, const EM_NONE = 0 +pkg debug/elf, const EM_PARISC = 15 +pkg debug/elf, const EM_PCP = 55 +pkg debug/elf, const EM_PPC = 20 +pkg debug/elf, const EM_PPC64 = 21 +pkg debug/elf, const EM_RCE = 39 +pkg debug/elf, const EM_RH32 = 38 +pkg debug/elf, const EM_S370 = 9 +pkg debug/elf, const EM_S390 = 22 +pkg debug/elf, const EM_SH = 42 +pkg debug/elf, const EM_SPARC = 2 +pkg debug/elf, const EM_SPARC32PLUS = 18 +pkg debug/elf, const EM_SPARCV9 = 43 +pkg debug/elf, const EM_ST100 = 60 +pkg debug/elf, const EM_STARCORE = 58 +pkg debug/elf, const EM_TINYJ = 61 +pkg debug/elf, const EM_TRICORE = 44 +pkg debug/elf, const EM_V800 = 36 +pkg debug/elf, const EM_VPP500 = 17 +pkg debug/elf, const EM_X86_64 = 62 +pkg debug/elf, const ET_CORE = 4 +pkg debug/elf, const ET_DYN = 3 +pkg debug/elf, const ET_EXEC = 2 +pkg debug/elf, const ET_HIOS = 65279 +pkg debug/elf, const ET_HIPROC = 65535 +pkg debug/elf, const ET_LOOS = 65024 +pkg debug/elf, const ET_LOPROC = 65280 +pkg debug/elf, const ET_NONE = 0 +pkg debug/elf, const ET_REL = 1 +pkg debug/elf, const EV_CURRENT = 1 +pkg debug/elf, const EV_NONE = 0 +pkg debug/elf, const NT_FPREGSET = 2 +pkg debug/elf, const NT_PRPSINFO = 3 +pkg debug/elf, const NT_PRSTATUS = 1 +pkg debug/elf, const PF_MASKOS = 267386880 +pkg debug/elf, const PF_MASKPROC = 4026531840 +pkg debug/elf, const PF_R = 4 +pkg debug/elf, const PF_W = 2 +pkg debug/elf, const PF_X = 1 +pkg debug/elf, const PT_DYNAMIC = 2 +pkg debug/elf, const PT_HIOS = 1879048191 +pkg debug/elf, const PT_HIPROC = 2147483647 +pkg debug/elf, const PT_INTERP = 3 +pkg debug/elf, const PT_LOAD = 1 +pkg debug/elf, const PT_LOOS = 1610612736 +pkg debug/elf, const PT_LOPROC = 1879048192 +pkg debug/elf, const PT_NOTE = 4 +pkg debug/elf, const PT_NULL = 0 +pkg debug/elf, const PT_PHDR = 6 +pkg debug/elf, const PT_SHLIB = 5 +pkg debug/elf, const PT_TLS = 7 +pkg debug/elf, const R_386_32 = 1 +pkg debug/elf, const R_386_COPY = 5 +pkg debug/elf, const R_386_GLOB_DAT = 6 +pkg debug/elf, const R_386_GOT32 = 3 +pkg debug/elf, const R_386_GOTOFF = 9 +pkg debug/elf, const R_386_GOTPC = 10 +pkg debug/elf, const R_386_JMP_SLOT = 7 +pkg debug/elf, const R_386_NONE = 0 +pkg debug/elf, const R_386_PC32 = 2 +pkg debug/elf, const R_386_PLT32 = 4 +pkg debug/elf, const R_386_RELATIVE = 8 +pkg debug/elf, const R_386_TLS_DTPMOD32 = 35 +pkg debug/elf, const R_386_TLS_DTPOFF32 = 36 +pkg debug/elf, const R_386_TLS_GD = 18 +pkg debug/elf, const R_386_TLS_GD_32 = 24 +pkg debug/elf, const R_386_TLS_GD_CALL = 26 +pkg debug/elf, const R_386_TLS_GD_POP = 27 +pkg debug/elf, const R_386_TLS_GD_PUSH = 25 +pkg debug/elf, const R_386_TLS_GOTIE = 16 +pkg debug/elf, const R_386_TLS_IE = 15 +pkg debug/elf, const R_386_TLS_IE_32 = 33 +pkg debug/elf, const R_386_TLS_LDM = 19 +pkg debug/elf, const R_386_TLS_LDM_32 = 28 +pkg debug/elf, const R_386_TLS_LDM_CALL = 30 +pkg debug/elf, const R_386_TLS_LDM_POP = 31 +pkg debug/elf, const R_386_TLS_LDM_PUSH = 29 +pkg debug/elf, const R_386_TLS_LDO_32 = 32 +pkg debug/elf, const R_386_TLS_LE = 17 +pkg debug/elf, const R_386_TLS_LE_32 = 34 +pkg debug/elf, const R_386_TLS_TPOFF = 14 +pkg debug/elf, const R_386_TLS_TPOFF32 = 37 +pkg debug/elf, const R_ALPHA_BRADDR = 7 +pkg debug/elf, const R_ALPHA_COPY = 24 +pkg debug/elf, const R_ALPHA_GLOB_DAT = 25 +pkg debug/elf, const R_ALPHA_GPDISP = 6 +pkg debug/elf, const R_ALPHA_GPREL32 = 3 +pkg debug/elf, const R_ALPHA_GPRELHIGH = 17 +pkg debug/elf, const R_ALPHA_GPRELLOW = 18 +pkg debug/elf, const R_ALPHA_GPVALUE = 16 +pkg debug/elf, const R_ALPHA_HINT = 8 +pkg debug/elf, const R_ALPHA_IMMED_BR_HI32 = 22 +pkg debug/elf, const R_ALPHA_IMMED_GP_16 = 19 +pkg debug/elf, const R_ALPHA_IMMED_GP_HI32 = 20 +pkg debug/elf, const R_ALPHA_IMMED_LO32 = 23 +pkg debug/elf, const R_ALPHA_IMMED_SCN_HI32 = 21 +pkg debug/elf, const R_ALPHA_JMP_SLOT = 26 +pkg debug/elf, const R_ALPHA_LITERAL = 4 +pkg debug/elf, const R_ALPHA_LITUSE = 5 +pkg debug/elf, const R_ALPHA_NONE = 0 +pkg debug/elf, const R_ALPHA_OP_PRSHIFT = 15 +pkg debug/elf, const R_ALPHA_OP_PSUB = 14 +pkg debug/elf, const R_ALPHA_OP_PUSH = 12 +pkg debug/elf, const R_ALPHA_OP_STORE = 13 +pkg debug/elf, const R_ALPHA_REFLONG = 1 +pkg debug/elf, const R_ALPHA_REFQUAD = 2 +pkg debug/elf, const R_ALPHA_RELATIVE = 27 +pkg debug/elf, const R_ALPHA_SREL16 = 9 +pkg debug/elf, const R_ALPHA_SREL32 = 10 +pkg debug/elf, const R_ALPHA_SREL64 = 11 +pkg debug/elf, const R_ARM_ABS12 = 6 +pkg debug/elf, const R_ARM_ABS16 = 5 +pkg debug/elf, const R_ARM_ABS32 = 2 +pkg debug/elf, const R_ARM_ABS8 = 8 +pkg debug/elf, const R_ARM_AMP_VCALL9 = 12 +pkg debug/elf, const R_ARM_COPY = 20 +pkg debug/elf, const R_ARM_GLOB_DAT = 21 +pkg debug/elf, const R_ARM_GNU_VTENTRY = 100 +pkg debug/elf, const R_ARM_GNU_VTINHERIT = 101 +pkg debug/elf, const R_ARM_GOT32 = 26 +pkg debug/elf, const R_ARM_GOTOFF = 24 +pkg debug/elf, const R_ARM_GOTPC = 25 +pkg debug/elf, const R_ARM_JUMP_SLOT = 22 +pkg debug/elf, const R_ARM_NONE = 0 +pkg debug/elf, const R_ARM_PC13 = 4 +pkg debug/elf, const R_ARM_PC24 = 1 +pkg debug/elf, const R_ARM_PLT32 = 27 +pkg debug/elf, const R_ARM_RABS32 = 253 +pkg debug/elf, const R_ARM_RBASE = 255 +pkg debug/elf, const R_ARM_REL32 = 3 +pkg debug/elf, const R_ARM_RELATIVE = 23 +pkg debug/elf, const R_ARM_RPC24 = 254 +pkg debug/elf, const R_ARM_RREL32 = 252 +pkg debug/elf, const R_ARM_RSBREL32 = 250 +pkg debug/elf, const R_ARM_SBREL32 = 9 +pkg debug/elf, const R_ARM_SWI24 = 13 +pkg debug/elf, const R_ARM_THM_ABS5 = 7 +pkg debug/elf, const R_ARM_THM_PC22 = 10 +pkg debug/elf, const R_ARM_THM_PC8 = 11 +pkg debug/elf, const R_ARM_THM_RPC22 = 251 +pkg debug/elf, const R_ARM_THM_SWI8 = 14 +pkg debug/elf, const R_ARM_THM_XPC22 = 16 +pkg debug/elf, const R_ARM_XPC25 = 15 +pkg debug/elf, const R_PPC_ADDR14 = 7 +pkg debug/elf, const R_PPC_ADDR14_BRNTAKEN = 9 +pkg debug/elf, const R_PPC_ADDR14_BRTAKEN = 8 +pkg debug/elf, const R_PPC_ADDR16 = 3 +pkg debug/elf, const R_PPC_ADDR16_HA = 6 +pkg debug/elf, const R_PPC_ADDR16_HI = 5 +pkg debug/elf, const R_PPC_ADDR16_LO = 4 +pkg debug/elf, const R_PPC_ADDR24 = 2 +pkg debug/elf, const R_PPC_ADDR32 = 1 +pkg debug/elf, const R_PPC_COPY = 19 +pkg debug/elf, const R_PPC_DTPMOD32 = 68 +pkg debug/elf, const R_PPC_DTPREL16 = 74 +pkg debug/elf, const R_PPC_DTPREL16_HA = 77 +pkg debug/elf, const R_PPC_DTPREL16_HI = 76 +pkg debug/elf, const R_PPC_DTPREL16_LO = 75 +pkg debug/elf, const R_PPC_DTPREL32 = 78 +pkg debug/elf, const R_PPC_EMB_BIT_FLD = 115 +pkg debug/elf, const R_PPC_EMB_MRKREF = 110 +pkg debug/elf, const R_PPC_EMB_NADDR16 = 102 +pkg debug/elf, const R_PPC_EMB_NADDR16_HA = 105 +pkg debug/elf, const R_PPC_EMB_NADDR16_HI = 104 +pkg debug/elf, const R_PPC_EMB_NADDR16_LO = 103 +pkg debug/elf, const R_PPC_EMB_NADDR32 = 101 +pkg debug/elf, const R_PPC_EMB_RELSDA = 116 +pkg debug/elf, const R_PPC_EMB_RELSEC16 = 111 +pkg debug/elf, const R_PPC_EMB_RELST_HA = 114 +pkg debug/elf, const R_PPC_EMB_RELST_HI = 113 +pkg debug/elf, const R_PPC_EMB_RELST_LO = 112 +pkg debug/elf, const R_PPC_EMB_SDA21 = 109 +pkg debug/elf, const R_PPC_EMB_SDA2I16 = 107 +pkg debug/elf, const R_PPC_EMB_SDA2REL = 108 +pkg debug/elf, const R_PPC_EMB_SDAI16 = 106 +pkg debug/elf, const R_PPC_GLOB_DAT = 20 +pkg debug/elf, const R_PPC_GOT16 = 14 +pkg debug/elf, const R_PPC_GOT16_HA = 17 +pkg debug/elf, const R_PPC_GOT16_HI = 16 +pkg debug/elf, const R_PPC_GOT16_LO = 15 +pkg debug/elf, const R_PPC_GOT_TLSGD16 = 79 +pkg debug/elf, const R_PPC_GOT_TLSGD16_HA = 82 +pkg debug/elf, const R_PPC_GOT_TLSGD16_HI = 81 +pkg debug/elf, const R_PPC_GOT_TLSGD16_LO = 80 +pkg debug/elf, const R_PPC_GOT_TLSLD16 = 83 +pkg debug/elf, const R_PPC_GOT_TLSLD16_HA = 86 +pkg debug/elf, const R_PPC_GOT_TLSLD16_HI = 85 +pkg debug/elf, const R_PPC_GOT_TLSLD16_LO = 84 +pkg debug/elf, const R_PPC_GOT_TPREL16 = 87 +pkg debug/elf, const R_PPC_GOT_TPREL16_HA = 90 +pkg debug/elf, const R_PPC_GOT_TPREL16_HI = 89 +pkg debug/elf, const R_PPC_GOT_TPREL16_LO = 88 +pkg debug/elf, const R_PPC_JMP_SLOT = 21 +pkg debug/elf, const R_PPC_LOCAL24PC = 23 +pkg debug/elf, const R_PPC_NONE = 0 +pkg debug/elf, const R_PPC_PLT16_HA = 31 +pkg debug/elf, const R_PPC_PLT16_HI = 30 +pkg debug/elf, const R_PPC_PLT16_LO = 29 +pkg debug/elf, const R_PPC_PLT32 = 27 +pkg debug/elf, const R_PPC_PLTREL24 = 18 +pkg debug/elf, const R_PPC_PLTREL32 = 28 +pkg debug/elf, const R_PPC_REL14 = 11 +pkg debug/elf, const R_PPC_REL14_BRNTAKEN = 13 +pkg debug/elf, const R_PPC_REL14_BRTAKEN = 12 +pkg debug/elf, const R_PPC_REL24 = 10 +pkg debug/elf, const R_PPC_REL32 = 26 +pkg debug/elf, const R_PPC_RELATIVE = 22 +pkg debug/elf, const R_PPC_SDAREL16 = 32 +pkg debug/elf, const R_PPC_SECTOFF = 33 +pkg debug/elf, const R_PPC_SECTOFF_HA = 36 +pkg debug/elf, const R_PPC_SECTOFF_HI = 35 +pkg debug/elf, const R_PPC_SECTOFF_LO = 34 +pkg debug/elf, const R_PPC_TLS = 67 +pkg debug/elf, const R_PPC_TPREL16 = 69 +pkg debug/elf, const R_PPC_TPREL16_HA = 72 +pkg debug/elf, const R_PPC_TPREL16_HI = 71 +pkg debug/elf, const R_PPC_TPREL16_LO = 70 +pkg debug/elf, const R_PPC_TPREL32 = 73 +pkg debug/elf, const R_PPC_UADDR16 = 25 +pkg debug/elf, const R_PPC_UADDR32 = 24 +pkg debug/elf, const R_SPARC_10 = 30 +pkg debug/elf, const R_SPARC_11 = 31 +pkg debug/elf, const R_SPARC_13 = 11 +pkg debug/elf, const R_SPARC_16 = 2 +pkg debug/elf, const R_SPARC_22 = 10 +pkg debug/elf, const R_SPARC_32 = 3 +pkg debug/elf, const R_SPARC_5 = 44 +pkg debug/elf, const R_SPARC_6 = 45 +pkg debug/elf, const R_SPARC_64 = 32 +pkg debug/elf, const R_SPARC_7 = 43 +pkg debug/elf, const R_SPARC_8 = 1 +pkg debug/elf, const R_SPARC_COPY = 19 +pkg debug/elf, const R_SPARC_DISP16 = 5 +pkg debug/elf, const R_SPARC_DISP32 = 6 +pkg debug/elf, const R_SPARC_DISP64 = 46 +pkg debug/elf, const R_SPARC_DISP8 = 4 +pkg debug/elf, const R_SPARC_GLOB_DAT = 20 +pkg debug/elf, const R_SPARC_GLOB_JMP = 42 +pkg debug/elf, const R_SPARC_GOT10 = 13 +pkg debug/elf, const R_SPARC_GOT13 = 14 +pkg debug/elf, const R_SPARC_GOT22 = 15 +pkg debug/elf, const R_SPARC_H44 = 50 +pkg debug/elf, const R_SPARC_HH22 = 34 +pkg debug/elf, const R_SPARC_HI22 = 9 +pkg debug/elf, const R_SPARC_HIPLT22 = 25 +pkg debug/elf, const R_SPARC_HIX22 = 48 +pkg debug/elf, const R_SPARC_HM10 = 35 +pkg debug/elf, const R_SPARC_JMP_SLOT = 21 +pkg debug/elf, const R_SPARC_L44 = 52 +pkg debug/elf, const R_SPARC_LM22 = 36 +pkg debug/elf, const R_SPARC_LO10 = 12 +pkg debug/elf, const R_SPARC_LOPLT10 = 26 +pkg debug/elf, const R_SPARC_LOX10 = 49 +pkg debug/elf, const R_SPARC_M44 = 51 +pkg debug/elf, const R_SPARC_NONE = 0 +pkg debug/elf, const R_SPARC_OLO10 = 33 +pkg debug/elf, const R_SPARC_PC10 = 16 +pkg debug/elf, const R_SPARC_PC22 = 17 +pkg debug/elf, const R_SPARC_PCPLT10 = 29 +pkg debug/elf, const R_SPARC_PCPLT22 = 28 +pkg debug/elf, const R_SPARC_PCPLT32 = 27 +pkg debug/elf, const R_SPARC_PC_HH22 = 37 +pkg debug/elf, const R_SPARC_PC_HM10 = 38 +pkg debug/elf, const R_SPARC_PC_LM22 = 39 +pkg debug/elf, const R_SPARC_PLT32 = 24 +pkg debug/elf, const R_SPARC_PLT64 = 47 +pkg debug/elf, const R_SPARC_REGISTER = 53 +pkg debug/elf, const R_SPARC_RELATIVE = 22 +pkg debug/elf, const R_SPARC_UA16 = 55 +pkg debug/elf, const R_SPARC_UA32 = 23 +pkg debug/elf, const R_SPARC_UA64 = 54 +pkg debug/elf, const R_SPARC_WDISP16 = 40 +pkg debug/elf, const R_SPARC_WDISP19 = 41 +pkg debug/elf, const R_SPARC_WDISP22 = 8 +pkg debug/elf, const R_SPARC_WDISP30 = 7 +pkg debug/elf, const R_SPARC_WPLT30 = 18 +pkg debug/elf, const R_X86_64_16 = 12 +pkg debug/elf, const R_X86_64_32 = 10 +pkg debug/elf, const R_X86_64_32S = 11 +pkg debug/elf, const R_X86_64_64 = 1 +pkg debug/elf, const R_X86_64_8 = 14 +pkg debug/elf, const R_X86_64_COPY = 5 +pkg debug/elf, const R_X86_64_DTPMOD64 = 16 +pkg debug/elf, const R_X86_64_DTPOFF32 = 21 +pkg debug/elf, const R_X86_64_DTPOFF64 = 17 +pkg debug/elf, const R_X86_64_GLOB_DAT = 6 +pkg debug/elf, const R_X86_64_GOT32 = 3 +pkg debug/elf, const R_X86_64_GOTPCREL = 9 +pkg debug/elf, const R_X86_64_GOTTPOFF = 22 +pkg debug/elf, const R_X86_64_JMP_SLOT = 7 +pkg debug/elf, const R_X86_64_NONE = 0 +pkg debug/elf, const R_X86_64_PC16 = 13 +pkg debug/elf, const R_X86_64_PC32 = 2 +pkg debug/elf, const R_X86_64_PC8 = 15 +pkg debug/elf, const R_X86_64_PLT32 = 4 +pkg debug/elf, const R_X86_64_RELATIVE = 8 +pkg debug/elf, const R_X86_64_TLSGD = 19 +pkg debug/elf, const R_X86_64_TLSLD = 20 +pkg debug/elf, const R_X86_64_TPOFF32 = 23 +pkg debug/elf, const R_X86_64_TPOFF64 = 18 +pkg debug/elf, const SHF_ALLOC = 2 +pkg debug/elf, const SHF_EXECINSTR = 4 +pkg debug/elf, const SHF_GROUP = 512 +pkg debug/elf, const SHF_INFO_LINK = 64 +pkg debug/elf, const SHF_LINK_ORDER = 128 +pkg debug/elf, const SHF_MASKOS = 267386880 +pkg debug/elf, const SHF_MASKPROC = 4026531840 +pkg debug/elf, const SHF_MERGE = 16 +pkg debug/elf, const SHF_OS_NONCONFORMING = 256 +pkg debug/elf, const SHF_STRINGS = 32 +pkg debug/elf, const SHF_TLS = 1024 +pkg debug/elf, const SHF_WRITE = 1 +pkg debug/elf, const SHN_ABS = 65521 +pkg debug/elf, const SHN_COMMON = 65522 +pkg debug/elf, const SHN_HIOS = 65343 +pkg debug/elf, const SHN_HIPROC = 65311 +pkg debug/elf, const SHN_HIRESERVE = 65535 +pkg debug/elf, const SHN_LOOS = 65312 +pkg debug/elf, const SHN_LOPROC = 65280 +pkg debug/elf, const SHN_LORESERVE = 65280 +pkg debug/elf, const SHN_UNDEF = 0 +pkg debug/elf, const SHN_XINDEX = 65535 +pkg debug/elf, const SHT_DYNAMIC = 6 +pkg debug/elf, const SHT_DYNSYM = 11 +pkg debug/elf, const SHT_FINI_ARRAY = 15 +pkg debug/elf, const SHT_GNU_ATTRIBUTES = 1879048181 +pkg debug/elf, const SHT_GNU_HASH = 1879048182 +pkg debug/elf, const SHT_GNU_LIBLIST = 1879048183 +pkg debug/elf, const SHT_GNU_VERDEF = 1879048189 +pkg debug/elf, const SHT_GNU_VERNEED = 1879048190 +pkg debug/elf, const SHT_GNU_VERSYM = 1879048191 +pkg debug/elf, const SHT_GROUP = 17 +pkg debug/elf, const SHT_HASH = 5 +pkg debug/elf, const SHT_HIOS = 1879048191 +pkg debug/elf, const SHT_HIPROC = 2147483647 +pkg debug/elf, const SHT_HIUSER = 4294967295 +pkg debug/elf, const SHT_INIT_ARRAY = 14 +pkg debug/elf, const SHT_LOOS = 1610612736 +pkg debug/elf, const SHT_LOPROC = 1879048192 +pkg debug/elf, const SHT_LOUSER = 2147483648 +pkg debug/elf, const SHT_NOBITS = 8 +pkg debug/elf, const SHT_NOTE = 7 +pkg debug/elf, const SHT_NULL = 0 +pkg debug/elf, const SHT_PREINIT_ARRAY = 16 +pkg debug/elf, const SHT_PROGBITS = 1 +pkg debug/elf, const SHT_REL = 9 +pkg debug/elf, const SHT_RELA = 4 +pkg debug/elf, const SHT_SHLIB = 10 +pkg debug/elf, const SHT_STRTAB = 3 +pkg debug/elf, const SHT_SYMTAB = 2 +pkg debug/elf, const SHT_SYMTAB_SHNDX = 18 +pkg debug/elf, const STB_GLOBAL = 1 +pkg debug/elf, const STB_HIOS = 12 +pkg debug/elf, const STB_HIPROC = 15 +pkg debug/elf, const STB_LOCAL = 0 +pkg debug/elf, const STB_LOOS = 10 +pkg debug/elf, const STB_LOPROC = 13 +pkg debug/elf, const STB_WEAK = 2 +pkg debug/elf, const STT_COMMON = 5 +pkg debug/elf, const STT_FILE = 4 +pkg debug/elf, const STT_FUNC = 2 +pkg debug/elf, const STT_HIOS = 12 +pkg debug/elf, const STT_HIPROC = 15 +pkg debug/elf, const STT_LOOS = 10 +pkg debug/elf, const STT_LOPROC = 13 +pkg debug/elf, const STT_NOTYPE = 0 +pkg debug/elf, const STT_OBJECT = 1 +pkg debug/elf, const STT_SECTION = 3 +pkg debug/elf, const STT_TLS = 6 +pkg debug/elf, const STV_DEFAULT = 0 +pkg debug/elf, const STV_HIDDEN = 2 +pkg debug/elf, const STV_INTERNAL = 1 +pkg debug/elf, const STV_PROTECTED = 3 +pkg debug/elf, const Sym32Size = 16 +pkg debug/elf, const Sym64Size = 24 +pkg debug/elf, method (*File) DynString(DynTag) ([]string, error) +pkg debug/elf, type FileHeader struct, Entry uint64 +pkg debug/macho, const Cpu386 = 7 +pkg debug/macho, const CpuAmd64 = 16777223 +pkg debug/macho, const LoadCmdDylib = 12 +pkg debug/macho, const LoadCmdDylinker = 15 +pkg debug/macho, const LoadCmdDysymtab = 11 +pkg debug/macho, const LoadCmdSegment = 1 +pkg debug/macho, const LoadCmdSegment64 = 25 +pkg debug/macho, const LoadCmdSymtab = 2 +pkg debug/macho, const LoadCmdThread = 4 +pkg debug/macho, const LoadCmdUnixThread = 5 +pkg debug/macho, const Magic32 = 4277009102 +pkg debug/macho, const Magic64 = 4277009103 +pkg debug/macho, const TypeExec = 2 +pkg debug/macho, const TypeObj = 1 +pkg debug/pe, const COFFSymbolSize = 18 +pkg debug/pe, const COFFSymbolSize ideal-int +pkg debug/pe, const IMAGE_FILE_MACHINE_AM33 = 467 +pkg debug/pe, const IMAGE_FILE_MACHINE_AMD64 = 34404 +pkg debug/pe, const IMAGE_FILE_MACHINE_ARM = 448 +pkg debug/pe, const IMAGE_FILE_MACHINE_EBC = 3772 +pkg debug/pe, const IMAGE_FILE_MACHINE_I386 = 332 +pkg debug/pe, const IMAGE_FILE_MACHINE_IA64 = 512 +pkg debug/pe, const IMAGE_FILE_MACHINE_M32R = 36929 +pkg debug/pe, const IMAGE_FILE_MACHINE_MIPS16 = 614 +pkg debug/pe, const IMAGE_FILE_MACHINE_MIPSFPU = 870 +pkg debug/pe, const IMAGE_FILE_MACHINE_MIPSFPU16 = 1126 +pkg debug/pe, const IMAGE_FILE_MACHINE_POWERPC = 496 +pkg debug/pe, const IMAGE_FILE_MACHINE_POWERPCFP = 497 +pkg debug/pe, const IMAGE_FILE_MACHINE_R4000 = 358 +pkg debug/pe, const IMAGE_FILE_MACHINE_SH3 = 418 +pkg debug/pe, const IMAGE_FILE_MACHINE_SH3DSP = 419 +pkg debug/pe, const IMAGE_FILE_MACHINE_SH4 = 422 +pkg debug/pe, const IMAGE_FILE_MACHINE_SH5 = 424 +pkg debug/pe, const IMAGE_FILE_MACHINE_THUMB = 450 +pkg debug/pe, const IMAGE_FILE_MACHINE_UNKNOWN = 0 +pkg debug/pe, const IMAGE_FILE_MACHINE_WCEMIPSV2 = 361 +pkg debug/pe, type COFFSymbol struct +pkg debug/pe, type COFFSymbol struct, Name [8]uint8 +pkg debug/pe, type COFFSymbol struct, NumberOfAuxSymbols uint8 +pkg debug/pe, type COFFSymbol struct, SectionNumber int16 +pkg debug/pe, type COFFSymbol struct, StorageClass uint8 +pkg debug/pe, type COFFSymbol struct, Type uint16 +pkg debug/pe, type COFFSymbol struct, Value uint32 +pkg debug/pe, type File struct, Symbols []*Symbol +pkg debug/pe, type Symbol struct +pkg debug/pe, type Symbol struct, Name string +pkg debug/pe, type Symbol struct, SectionNumber int16 +pkg debug/pe, type Symbol struct, StorageClass uint8 +pkg debug/pe, type Symbol struct, Type uint16 +pkg debug/pe, type Symbol struct, Value uint32 +pkg encoding/binary, const MaxVarintLen16 = 3 +pkg encoding/binary, const MaxVarintLen32 = 5 +pkg encoding/binary, const MaxVarintLen64 = 10 +pkg encoding/csv, method (*Writer) Error() error +pkg encoding/json, method (*Decoder) Buffered() io.Reader +pkg encoding/json, method (*Decoder) UseNumber() +pkg encoding/json, method (Number) Float64() (float64, error) +pkg encoding/json, method (Number) Int64() (int64, error) +pkg encoding/json, method (Number) String() string +pkg encoding/json, type Number string +pkg encoding/xml, const Header = "\n" +pkg encoding/xml, func EscapeText(io.Writer, []uint8) error +pkg encoding/xml, method (*Encoder) Indent(string, string) +pkg encoding/xml, type Decoder struct, DefaultSpace string +pkg flag, const ContinueOnError = 0 +pkg flag, const ExitOnError = 1 +pkg flag, const PanicOnError = 2 +pkg go/ast, const Bad = 0 +pkg go/ast, const Con = 2 +pkg go/ast, const FilterFuncDuplicates = 1 +pkg go/ast, const FilterImportDuplicates = 4 +pkg go/ast, const FilterUnassociatedComments = 2 +pkg go/ast, const Fun = 5 +pkg go/ast, const Lbl = 6 +pkg go/ast, const Pkg = 1 +pkg go/ast, const RECV = 2 +pkg go/ast, const SEND = 1 +pkg go/ast, const Typ = 3 +pkg go/ast, const Var = 4 +pkg go/ast, func NewCommentMap(*token.FileSet, Node, []*CommentGroup) CommentMap +pkg go/ast, method (CommentMap) Comments() []*CommentGroup +pkg go/ast, method (CommentMap) Filter(Node) CommentMap +pkg go/ast, method (CommentMap) String() string +pkg go/ast, method (CommentMap) Update(Node, Node) Node +pkg go/ast, type ChanType struct, Arrow token.Pos +pkg go/ast, type CommentMap map[Node][]*CommentGroup +pkg go/build, const AllowBinary = 2 +pkg go/build, const FindOnly = 1 +pkg go/build, type Context struct, InstallSuffix string +pkg go/build, type Context struct, ReleaseTags []string +pkg go/build, type Package struct, IgnoredGoFiles []string +pkg go/build, type Package struct, SwigCXXFiles []string +pkg go/build, type Package struct, SwigFiles []string +pkg go/doc, const AllDecls = 1 +pkg go/doc, const AllMethods = 2 +pkg go/doc, type Example struct, EmptyOutput bool +pkg go/doc, type Example struct, Order int +pkg go/doc, type Example struct, Play *ast.File +pkg go/doc, type Note struct +pkg go/doc, type Note struct, Body string +pkg go/doc, type Note struct, End token.Pos +pkg go/doc, type Note struct, Pos token.Pos +pkg go/doc, type Note struct, UID string +pkg go/doc, type Package struct, Notes map[string][]*Note +pkg go/doc, var IllegalPrefixes []string +pkg go/format, func Node(io.Writer, *token.FileSet, interface{}) error +pkg go/format, func Source([]uint8) ([]uint8, error) +pkg go/parser, const AllErrors = 32 +pkg go/parser, const AllErrors Mode +pkg go/parser, const DeclarationErrors = 16 +pkg go/parser, const ImportsOnly = 2 +pkg go/parser, const PackageClauseOnly = 1 +pkg go/parser, const ParseComments = 4 +pkg go/parser, const SpuriousErrors = 32 +pkg go/parser, const Trace = 8 +pkg go/printer, const RawFormat = 1 +pkg go/printer, const SourcePos = 8 +pkg go/printer, const TabIndent = 2 +pkg go/printer, const UseSpaces = 4 +pkg go/printer, type Config struct, Indent int +pkg go/scanner, const ScanComments = 1 +pkg go/token, const ADD = 12 +pkg go/token, const ADD_ASSIGN = 23 +pkg go/token, const AND = 17 +pkg go/token, const AND_ASSIGN = 28 +pkg go/token, const AND_NOT = 22 +pkg go/token, const AND_NOT_ASSIGN = 33 +pkg go/token, const ARROW = 36 +pkg go/token, const ASSIGN = 42 +pkg go/token, const BREAK = 61 +pkg go/token, const CASE = 62 +pkg go/token, const CHAN = 63 +pkg go/token, const CHAR = 8 +pkg go/token, const COLON = 58 +pkg go/token, const COMMA = 52 +pkg go/token, const COMMENT = 2 +pkg go/token, const CONST = 64 +pkg go/token, const CONTINUE = 65 +pkg go/token, const DEC = 38 +pkg go/token, const DEFAULT = 66 +pkg go/token, const DEFER = 67 +pkg go/token, const DEFINE = 47 +pkg go/token, const ELLIPSIS = 48 +pkg go/token, const ELSE = 68 +pkg go/token, const EOF = 1 +pkg go/token, const EQL = 39 +pkg go/token, const FALLTHROUGH = 69 +pkg go/token, const FLOAT = 6 +pkg go/token, const FOR = 70 +pkg go/token, const FUNC = 71 +pkg go/token, const GEQ = 46 +pkg go/token, const GO = 72 +pkg go/token, const GOTO = 73 +pkg go/token, const GTR = 41 +pkg go/token, const HighestPrec = 7 +pkg go/token, const IDENT = 4 +pkg go/token, const IF = 74 +pkg go/token, const ILLEGAL = 0 +pkg go/token, const IMAG = 7 +pkg go/token, const IMPORT = 75 +pkg go/token, const INC = 37 +pkg go/token, const INT = 5 +pkg go/token, const INTERFACE = 76 +pkg go/token, const LAND = 34 +pkg go/token, const LBRACE = 51 +pkg go/token, const LBRACK = 50 +pkg go/token, const LEQ = 45 +pkg go/token, const LOR = 35 +pkg go/token, const LPAREN = 49 +pkg go/token, const LSS = 40 +pkg go/token, const LowestPrec = 0 +pkg go/token, const MAP = 77 +pkg go/token, const MUL = 14 +pkg go/token, const MUL_ASSIGN = 25 +pkg go/token, const NEQ = 44 +pkg go/token, const NOT = 43 +pkg go/token, const NoPos = 0 +pkg go/token, const OR = 18 +pkg go/token, const OR_ASSIGN = 29 +pkg go/token, const PACKAGE = 78 +pkg go/token, const PERIOD = 53 +pkg go/token, const QUO = 15 +pkg go/token, const QUO_ASSIGN = 26 +pkg go/token, const RANGE = 79 +pkg go/token, const RBRACE = 56 +pkg go/token, const RBRACK = 55 +pkg go/token, const REM = 16 +pkg go/token, const REM_ASSIGN = 27 +pkg go/token, const RETURN = 80 +pkg go/token, const RPAREN = 54 +pkg go/token, const SELECT = 81 +pkg go/token, const SEMICOLON = 57 +pkg go/token, const SHL = 20 +pkg go/token, const SHL_ASSIGN = 31 +pkg go/token, const SHR = 21 +pkg go/token, const SHR_ASSIGN = 32 +pkg go/token, const STRING = 9 +pkg go/token, const STRUCT = 82 +pkg go/token, const SUB = 13 +pkg go/token, const SUB_ASSIGN = 24 +pkg go/token, const SWITCH = 83 +pkg go/token, const TYPE = 84 +pkg go/token, const UnaryPrec = 6 +pkg go/token, const VAR = 85 +pkg go/token, const XOR = 19 +pkg go/token, const XOR_ASSIGN = 30 +pkg hash/adler32, const Size = 4 +pkg hash/crc32, const Castagnoli = 2197175160 +pkg hash/crc32, const IEEE = 3988292384 +pkg hash/crc32, const Koopman = 3945912366 +pkg hash/crc32, const Size = 4 +pkg hash/crc64, const ECMA = 14514072000185962306 +pkg hash/crc64, const ISO = 15564440312192434176 +pkg hash/crc64, const Size = 8 +pkg html/template, const ErrAmbigContext = 1 +pkg html/template, const ErrBadHTML = 2 +pkg html/template, const ErrBranchEnd = 3 +pkg html/template, const ErrEndContext = 4 +pkg html/template, const ErrNoSuchTemplate = 5 +pkg html/template, const ErrOutputContext = 6 +pkg html/template, const ErrPartialCharset = 7 +pkg html/template, const ErrPartialEscape = 8 +pkg html/template, const ErrRangeLoopReentry = 9 +pkg html/template, const ErrSlashAmbig = 10 +pkg html/template, const OK = 0 +pkg image, const YCbCrSubsampleRatio420 = 2 +pkg image, const YCbCrSubsampleRatio422 = 1 +pkg image, const YCbCrSubsampleRatio440 = 3 +pkg image, const YCbCrSubsampleRatio440 YCbCrSubsampleRatio +pkg image, const YCbCrSubsampleRatio444 = 0 +pkg image/draw, const Over = 0 +pkg image/draw, const Src = 1 +pkg image/jpeg, const DefaultQuality = 75 +pkg io, type ByteWriter interface { WriteByte } +pkg io, type ByteWriter interface, WriteByte(uint8) error +pkg io, var ErrNoProgress error +pkg log, const Ldate = 1 +pkg log, const Llongfile = 8 +pkg log, const Lmicroseconds = 4 +pkg log, const Lshortfile = 16 +pkg log, const LstdFlags = 3 +pkg log, const Ltime = 2 +pkg log/syslog (darwin-386), const LOG_ALERT = 1 +pkg log/syslog (darwin-386), const LOG_AUTH = 32 +pkg log/syslog (darwin-386), const LOG_AUTH Priority +pkg log/syslog (darwin-386), const LOG_AUTHPRIV = 80 +pkg log/syslog (darwin-386), const LOG_AUTHPRIV Priority +pkg log/syslog (darwin-386), const LOG_CRIT = 2 +pkg log/syslog (darwin-386), const LOG_CRON = 72 +pkg log/syslog (darwin-386), const LOG_CRON Priority +pkg log/syslog (darwin-386), const LOG_DAEMON = 24 +pkg log/syslog (darwin-386), const LOG_DAEMON Priority +pkg log/syslog (darwin-386), const LOG_DEBUG = 7 +pkg log/syslog (darwin-386), const LOG_EMERG = 0 +pkg log/syslog (darwin-386), const LOG_ERR = 3 +pkg log/syslog (darwin-386), const LOG_FTP = 88 +pkg log/syslog (darwin-386), const LOG_FTP Priority +pkg log/syslog (darwin-386), const LOG_INFO = 6 +pkg log/syslog (darwin-386), const LOG_KERN = 0 +pkg log/syslog (darwin-386), const LOG_KERN Priority +pkg log/syslog (darwin-386), const LOG_LOCAL0 = 128 +pkg log/syslog (darwin-386), const LOG_LOCAL0 Priority +pkg log/syslog (darwin-386), const LOG_LOCAL1 = 136 +pkg log/syslog (darwin-386), const LOG_LOCAL1 Priority +pkg log/syslog (darwin-386), const LOG_LOCAL2 = 144 +pkg log/syslog (darwin-386), const LOG_LOCAL2 Priority +pkg log/syslog (darwin-386), const LOG_LOCAL3 = 152 +pkg log/syslog (darwin-386), const LOG_LOCAL3 Priority +pkg log/syslog (darwin-386), const LOG_LOCAL4 = 160 +pkg log/syslog (darwin-386), const LOG_LOCAL4 Priority +pkg log/syslog (darwin-386), const LOG_LOCAL5 = 168 +pkg log/syslog (darwin-386), const LOG_LOCAL5 Priority +pkg log/syslog (darwin-386), const LOG_LOCAL6 = 176 +pkg log/syslog (darwin-386), const LOG_LOCAL6 Priority +pkg log/syslog (darwin-386), const LOG_LOCAL7 = 184 +pkg log/syslog (darwin-386), const LOG_LOCAL7 Priority +pkg log/syslog (darwin-386), const LOG_LPR = 48 +pkg log/syslog (darwin-386), const LOG_LPR Priority +pkg log/syslog (darwin-386), const LOG_MAIL = 16 +pkg log/syslog (darwin-386), const LOG_MAIL Priority +pkg log/syslog (darwin-386), const LOG_NEWS = 56 +pkg log/syslog (darwin-386), const LOG_NEWS Priority +pkg log/syslog (darwin-386), const LOG_NOTICE = 5 +pkg log/syslog (darwin-386), const LOG_SYSLOG = 40 +pkg log/syslog (darwin-386), const LOG_SYSLOG Priority +pkg log/syslog (darwin-386), const LOG_USER = 8 +pkg log/syslog (darwin-386), const LOG_USER Priority +pkg log/syslog (darwin-386), const LOG_UUCP = 64 +pkg log/syslog (darwin-386), const LOG_UUCP Priority +pkg log/syslog (darwin-386), const LOG_WARNING = 4 +pkg log/syslog (darwin-386-cgo), const LOG_ALERT = 1 +pkg log/syslog (darwin-386-cgo), const LOG_AUTH = 32 +pkg log/syslog (darwin-386-cgo), const LOG_AUTH Priority +pkg log/syslog (darwin-386-cgo), const LOG_AUTHPRIV = 80 +pkg log/syslog (darwin-386-cgo), const LOG_AUTHPRIV Priority +pkg log/syslog (darwin-386-cgo), const LOG_CRIT = 2 +pkg log/syslog (darwin-386-cgo), const LOG_CRON = 72 +pkg log/syslog (darwin-386-cgo), const LOG_CRON Priority +pkg log/syslog (darwin-386-cgo), const LOG_DAEMON = 24 +pkg log/syslog (darwin-386-cgo), const LOG_DAEMON Priority +pkg log/syslog (darwin-386-cgo), const LOG_DEBUG = 7 +pkg log/syslog (darwin-386-cgo), const LOG_EMERG = 0 +pkg log/syslog (darwin-386-cgo), const LOG_ERR = 3 +pkg log/syslog (darwin-386-cgo), const LOG_FTP = 88 +pkg log/syslog (darwin-386-cgo), const LOG_FTP Priority +pkg log/syslog (darwin-386-cgo), const LOG_INFO = 6 +pkg log/syslog (darwin-386-cgo), const LOG_KERN = 0 +pkg log/syslog (darwin-386-cgo), const LOG_KERN Priority +pkg log/syslog (darwin-386-cgo), const LOG_LOCAL0 = 128 +pkg log/syslog (darwin-386-cgo), const LOG_LOCAL0 Priority +pkg log/syslog (darwin-386-cgo), const LOG_LOCAL1 = 136 +pkg log/syslog (darwin-386-cgo), const LOG_LOCAL1 Priority +pkg log/syslog (darwin-386-cgo), const LOG_LOCAL2 = 144 +pkg log/syslog (darwin-386-cgo), const LOG_LOCAL2 Priority +pkg log/syslog (darwin-386-cgo), const LOG_LOCAL3 = 152 +pkg log/syslog (darwin-386-cgo), const LOG_LOCAL3 Priority +pkg log/syslog (darwin-386-cgo), const LOG_LOCAL4 = 160 +pkg log/syslog (darwin-386-cgo), const LOG_LOCAL4 Priority +pkg log/syslog (darwin-386-cgo), const LOG_LOCAL5 = 168 +pkg log/syslog (darwin-386-cgo), const LOG_LOCAL5 Priority +pkg log/syslog (darwin-386-cgo), const LOG_LOCAL6 = 176 +pkg log/syslog (darwin-386-cgo), const LOG_LOCAL6 Priority +pkg log/syslog (darwin-386-cgo), const LOG_LOCAL7 = 184 +pkg log/syslog (darwin-386-cgo), const LOG_LOCAL7 Priority +pkg log/syslog (darwin-386-cgo), const LOG_LPR = 48 +pkg log/syslog (darwin-386-cgo), const LOG_LPR Priority +pkg log/syslog (darwin-386-cgo), const LOG_MAIL = 16 +pkg log/syslog (darwin-386-cgo), const LOG_MAIL Priority +pkg log/syslog (darwin-386-cgo), const LOG_NEWS = 56 +pkg log/syslog (darwin-386-cgo), const LOG_NEWS Priority +pkg log/syslog (darwin-386-cgo), const LOG_NOTICE = 5 +pkg log/syslog (darwin-386-cgo), const LOG_SYSLOG = 40 +pkg log/syslog (darwin-386-cgo), const LOG_SYSLOG Priority +pkg log/syslog (darwin-386-cgo), const LOG_USER = 8 +pkg log/syslog (darwin-386-cgo), const LOG_USER Priority +pkg log/syslog (darwin-386-cgo), const LOG_UUCP = 64 +pkg log/syslog (darwin-386-cgo), const LOG_UUCP Priority +pkg log/syslog (darwin-386-cgo), const LOG_WARNING = 4 +pkg log/syslog (darwin-amd64), const LOG_ALERT = 1 +pkg log/syslog (darwin-amd64), const LOG_AUTH = 32 +pkg log/syslog (darwin-amd64), const LOG_AUTH Priority +pkg log/syslog (darwin-amd64), const LOG_AUTHPRIV = 80 +pkg log/syslog (darwin-amd64), const LOG_AUTHPRIV Priority +pkg log/syslog (darwin-amd64), const LOG_CRIT = 2 +pkg log/syslog (darwin-amd64), const LOG_CRON = 72 +pkg log/syslog (darwin-amd64), const LOG_CRON Priority +pkg log/syslog (darwin-amd64), const LOG_DAEMON = 24 +pkg log/syslog (darwin-amd64), const LOG_DAEMON Priority +pkg log/syslog (darwin-amd64), const LOG_DEBUG = 7 +pkg log/syslog (darwin-amd64), const LOG_EMERG = 0 +pkg log/syslog (darwin-amd64), const LOG_ERR = 3 +pkg log/syslog (darwin-amd64), const LOG_FTP = 88 +pkg log/syslog (darwin-amd64), const LOG_FTP Priority +pkg log/syslog (darwin-amd64), const LOG_INFO = 6 +pkg log/syslog (darwin-amd64), const LOG_KERN = 0 +pkg log/syslog (darwin-amd64), const LOG_KERN Priority +pkg log/syslog (darwin-amd64), const LOG_LOCAL0 = 128 +pkg log/syslog (darwin-amd64), const LOG_LOCAL0 Priority +pkg log/syslog (darwin-amd64), const LOG_LOCAL1 = 136 +pkg log/syslog (darwin-amd64), const LOG_LOCAL1 Priority +pkg log/syslog (darwin-amd64), const LOG_LOCAL2 = 144 +pkg log/syslog (darwin-amd64), const LOG_LOCAL2 Priority +pkg log/syslog (darwin-amd64), const LOG_LOCAL3 = 152 +pkg log/syslog (darwin-amd64), const LOG_LOCAL3 Priority +pkg log/syslog (darwin-amd64), const LOG_LOCAL4 = 160 +pkg log/syslog (darwin-amd64), const LOG_LOCAL4 Priority +pkg log/syslog (darwin-amd64), const LOG_LOCAL5 = 168 +pkg log/syslog (darwin-amd64), const LOG_LOCAL5 Priority +pkg log/syslog (darwin-amd64), const LOG_LOCAL6 = 176 +pkg log/syslog (darwin-amd64), const LOG_LOCAL6 Priority +pkg log/syslog (darwin-amd64), const LOG_LOCAL7 = 184 +pkg log/syslog (darwin-amd64), const LOG_LOCAL7 Priority +pkg log/syslog (darwin-amd64), const LOG_LPR = 48 +pkg log/syslog (darwin-amd64), const LOG_LPR Priority +pkg log/syslog (darwin-amd64), const LOG_MAIL = 16 +pkg log/syslog (darwin-amd64), const LOG_MAIL Priority +pkg log/syslog (darwin-amd64), const LOG_NEWS = 56 +pkg log/syslog (darwin-amd64), const LOG_NEWS Priority +pkg log/syslog (darwin-amd64), const LOG_NOTICE = 5 +pkg log/syslog (darwin-amd64), const LOG_SYSLOG = 40 +pkg log/syslog (darwin-amd64), const LOG_SYSLOG Priority +pkg log/syslog (darwin-amd64), const LOG_USER = 8 +pkg log/syslog (darwin-amd64), const LOG_USER Priority +pkg log/syslog (darwin-amd64), const LOG_UUCP = 64 +pkg log/syslog (darwin-amd64), const LOG_UUCP Priority +pkg log/syslog (darwin-amd64), const LOG_WARNING = 4 +pkg log/syslog (darwin-amd64-cgo), const LOG_ALERT = 1 +pkg log/syslog (darwin-amd64-cgo), const LOG_AUTH = 32 +pkg log/syslog (darwin-amd64-cgo), const LOG_AUTH Priority +pkg log/syslog (darwin-amd64-cgo), const LOG_AUTHPRIV = 80 +pkg log/syslog (darwin-amd64-cgo), const LOG_AUTHPRIV Priority +pkg log/syslog (darwin-amd64-cgo), const LOG_CRIT = 2 +pkg log/syslog (darwin-amd64-cgo), const LOG_CRON = 72 +pkg log/syslog (darwin-amd64-cgo), const LOG_CRON Priority +pkg log/syslog (darwin-amd64-cgo), const LOG_DAEMON = 24 +pkg log/syslog (darwin-amd64-cgo), const LOG_DAEMON Priority +pkg log/syslog (darwin-amd64-cgo), const LOG_DEBUG = 7 +pkg log/syslog (darwin-amd64-cgo), const LOG_EMERG = 0 +pkg log/syslog (darwin-amd64-cgo), const LOG_ERR = 3 +pkg log/syslog (darwin-amd64-cgo), const LOG_FTP = 88 +pkg log/syslog (darwin-amd64-cgo), const LOG_FTP Priority +pkg log/syslog (darwin-amd64-cgo), const LOG_INFO = 6 +pkg log/syslog (darwin-amd64-cgo), const LOG_KERN = 0 +pkg log/syslog (darwin-amd64-cgo), const LOG_KERN Priority +pkg log/syslog (darwin-amd64-cgo), const LOG_LOCAL0 = 128 +pkg log/syslog (darwin-amd64-cgo), const LOG_LOCAL0 Priority +pkg log/syslog (darwin-amd64-cgo), const LOG_LOCAL1 = 136 +pkg log/syslog (darwin-amd64-cgo), const LOG_LOCAL1 Priority +pkg log/syslog (darwin-amd64-cgo), const LOG_LOCAL2 = 144 +pkg log/syslog (darwin-amd64-cgo), const LOG_LOCAL2 Priority +pkg log/syslog (darwin-amd64-cgo), const LOG_LOCAL3 = 152 +pkg log/syslog (darwin-amd64-cgo), const LOG_LOCAL3 Priority +pkg log/syslog (darwin-amd64-cgo), const LOG_LOCAL4 = 160 +pkg log/syslog (darwin-amd64-cgo), const LOG_LOCAL4 Priority +pkg log/syslog (darwin-amd64-cgo), const LOG_LOCAL5 = 168 +pkg log/syslog (darwin-amd64-cgo), const LOG_LOCAL5 Priority +pkg log/syslog (darwin-amd64-cgo), const LOG_LOCAL6 = 176 +pkg log/syslog (darwin-amd64-cgo), const LOG_LOCAL6 Priority +pkg log/syslog (darwin-amd64-cgo), const LOG_LOCAL7 = 184 +pkg log/syslog (darwin-amd64-cgo), const LOG_LOCAL7 Priority +pkg log/syslog (darwin-amd64-cgo), const LOG_LPR = 48 +pkg log/syslog (darwin-amd64-cgo), const LOG_LPR Priority +pkg log/syslog (darwin-amd64-cgo), const LOG_MAIL = 16 +pkg log/syslog (darwin-amd64-cgo), const LOG_MAIL Priority +pkg log/syslog (darwin-amd64-cgo), const LOG_NEWS = 56 +pkg log/syslog (darwin-amd64-cgo), const LOG_NEWS Priority +pkg log/syslog (darwin-amd64-cgo), const LOG_NOTICE = 5 +pkg log/syslog (darwin-amd64-cgo), const LOG_SYSLOG = 40 +pkg log/syslog (darwin-amd64-cgo), const LOG_SYSLOG Priority +pkg log/syslog (darwin-amd64-cgo), const LOG_USER = 8 +pkg log/syslog (darwin-amd64-cgo), const LOG_USER Priority +pkg log/syslog (darwin-amd64-cgo), const LOG_UUCP = 64 +pkg log/syslog (darwin-amd64-cgo), const LOG_UUCP Priority +pkg log/syslog (darwin-amd64-cgo), const LOG_WARNING = 4 +pkg log/syslog (freebsd-386), const LOG_ALERT = 1 +pkg log/syslog (freebsd-386), const LOG_AUTH = 32 +pkg log/syslog (freebsd-386), const LOG_AUTH Priority +pkg log/syslog (freebsd-386), const LOG_AUTHPRIV = 80 +pkg log/syslog (freebsd-386), const LOG_AUTHPRIV Priority +pkg log/syslog (freebsd-386), const LOG_CRIT = 2 +pkg log/syslog (freebsd-386), const LOG_CRON = 72 +pkg log/syslog (freebsd-386), const LOG_CRON Priority +pkg log/syslog (freebsd-386), const LOG_DAEMON = 24 +pkg log/syslog (freebsd-386), const LOG_DAEMON Priority +pkg log/syslog (freebsd-386), const LOG_DEBUG = 7 +pkg log/syslog (freebsd-386), const LOG_EMERG = 0 +pkg log/syslog (freebsd-386), const LOG_ERR = 3 +pkg log/syslog (freebsd-386), const LOG_FTP = 88 +pkg log/syslog (freebsd-386), const LOG_FTP Priority +pkg log/syslog (freebsd-386), const LOG_INFO = 6 +pkg log/syslog (freebsd-386), const LOG_KERN = 0 +pkg log/syslog (freebsd-386), const LOG_KERN Priority +pkg log/syslog (freebsd-386), const LOG_LOCAL0 = 128 +pkg log/syslog (freebsd-386), const LOG_LOCAL0 Priority +pkg log/syslog (freebsd-386), const LOG_LOCAL1 = 136 +pkg log/syslog (freebsd-386), const LOG_LOCAL1 Priority +pkg log/syslog (freebsd-386), const LOG_LOCAL2 = 144 +pkg log/syslog (freebsd-386), const LOG_LOCAL2 Priority +pkg log/syslog (freebsd-386), const LOG_LOCAL3 = 152 +pkg log/syslog (freebsd-386), const LOG_LOCAL3 Priority +pkg log/syslog (freebsd-386), const LOG_LOCAL4 = 160 +pkg log/syslog (freebsd-386), const LOG_LOCAL4 Priority +pkg log/syslog (freebsd-386), const LOG_LOCAL5 = 168 +pkg log/syslog (freebsd-386), const LOG_LOCAL5 Priority +pkg log/syslog (freebsd-386), const LOG_LOCAL6 = 176 +pkg log/syslog (freebsd-386), const LOG_LOCAL6 Priority +pkg log/syslog (freebsd-386), const LOG_LOCAL7 = 184 +pkg log/syslog (freebsd-386), const LOG_LOCAL7 Priority +pkg log/syslog (freebsd-386), const LOG_LPR = 48 +pkg log/syslog (freebsd-386), const LOG_LPR Priority +pkg log/syslog (freebsd-386), const LOG_MAIL = 16 +pkg log/syslog (freebsd-386), const LOG_MAIL Priority +pkg log/syslog (freebsd-386), const LOG_NEWS = 56 +pkg log/syslog (freebsd-386), const LOG_NEWS Priority +pkg log/syslog (freebsd-386), const LOG_NOTICE = 5 +pkg log/syslog (freebsd-386), const LOG_SYSLOG = 40 +pkg log/syslog (freebsd-386), const LOG_SYSLOG Priority +pkg log/syslog (freebsd-386), const LOG_USER = 8 +pkg log/syslog (freebsd-386), const LOG_USER Priority +pkg log/syslog (freebsd-386), const LOG_UUCP = 64 +pkg log/syslog (freebsd-386), const LOG_UUCP Priority +pkg log/syslog (freebsd-386), const LOG_WARNING = 4 +pkg log/syslog (freebsd-386-cgo), const LOG_ALERT = 1 +pkg log/syslog (freebsd-386-cgo), const LOG_AUTH = 32 +pkg log/syslog (freebsd-386-cgo), const LOG_AUTHPRIV = 80 +pkg log/syslog (freebsd-386-cgo), const LOG_CRIT = 2 +pkg log/syslog (freebsd-386-cgo), const LOG_CRON = 72 +pkg log/syslog (freebsd-386-cgo), const LOG_DAEMON = 24 +pkg log/syslog (freebsd-386-cgo), const LOG_DEBUG = 7 +pkg log/syslog (freebsd-386-cgo), const LOG_EMERG = 0 +pkg log/syslog (freebsd-386-cgo), const LOG_ERR = 3 +pkg log/syslog (freebsd-386-cgo), const LOG_FTP = 88 +pkg log/syslog (freebsd-386-cgo), const LOG_INFO = 6 +pkg log/syslog (freebsd-386-cgo), const LOG_KERN = 0 +pkg log/syslog (freebsd-386-cgo), const LOG_LOCAL0 = 128 +pkg log/syslog (freebsd-386-cgo), const LOG_LOCAL1 = 136 +pkg log/syslog (freebsd-386-cgo), const LOG_LOCAL2 = 144 +pkg log/syslog (freebsd-386-cgo), const LOG_LOCAL3 = 152 +pkg log/syslog (freebsd-386-cgo), const LOG_LOCAL4 = 160 +pkg log/syslog (freebsd-386-cgo), const LOG_LOCAL5 = 168 +pkg log/syslog (freebsd-386-cgo), const LOG_LOCAL6 = 176 +pkg log/syslog (freebsd-386-cgo), const LOG_LOCAL7 = 184 +pkg log/syslog (freebsd-386-cgo), const LOG_LPR = 48 +pkg log/syslog (freebsd-386-cgo), const LOG_MAIL = 16 +pkg log/syslog (freebsd-386-cgo), const LOG_NEWS = 56 +pkg log/syslog (freebsd-386-cgo), const LOG_NOTICE = 5 +pkg log/syslog (freebsd-386-cgo), const LOG_SYSLOG = 40 +pkg log/syslog (freebsd-386-cgo), const LOG_USER = 8 +pkg log/syslog (freebsd-386-cgo), const LOG_UUCP = 64 +pkg log/syslog (freebsd-386-cgo), const LOG_WARNING = 4 +pkg log/syslog (freebsd-amd64), const LOG_ALERT = 1 +pkg log/syslog (freebsd-amd64), const LOG_AUTH = 32 +pkg log/syslog (freebsd-amd64), const LOG_AUTH Priority +pkg log/syslog (freebsd-amd64), const LOG_AUTHPRIV = 80 +pkg log/syslog (freebsd-amd64), const LOG_AUTHPRIV Priority +pkg log/syslog (freebsd-amd64), const LOG_CRIT = 2 +pkg log/syslog (freebsd-amd64), const LOG_CRON = 72 +pkg log/syslog (freebsd-amd64), const LOG_CRON Priority +pkg log/syslog (freebsd-amd64), const LOG_DAEMON = 24 +pkg log/syslog (freebsd-amd64), const LOG_DAEMON Priority +pkg log/syslog (freebsd-amd64), const LOG_DEBUG = 7 +pkg log/syslog (freebsd-amd64), const LOG_EMERG = 0 +pkg log/syslog (freebsd-amd64), const LOG_ERR = 3 +pkg log/syslog (freebsd-amd64), const LOG_FTP = 88 +pkg log/syslog (freebsd-amd64), const LOG_FTP Priority +pkg log/syslog (freebsd-amd64), const LOG_INFO = 6 +pkg log/syslog (freebsd-amd64), const LOG_KERN = 0 +pkg log/syslog (freebsd-amd64), const LOG_KERN Priority +pkg log/syslog (freebsd-amd64), const LOG_LOCAL0 = 128 +pkg log/syslog (freebsd-amd64), const LOG_LOCAL0 Priority +pkg log/syslog (freebsd-amd64), const LOG_LOCAL1 = 136 +pkg log/syslog (freebsd-amd64), const LOG_LOCAL1 Priority +pkg log/syslog (freebsd-amd64), const LOG_LOCAL2 = 144 +pkg log/syslog (freebsd-amd64), const LOG_LOCAL2 Priority +pkg log/syslog (freebsd-amd64), const LOG_LOCAL3 = 152 +pkg log/syslog (freebsd-amd64), const LOG_LOCAL3 Priority +pkg log/syslog (freebsd-amd64), const LOG_LOCAL4 = 160 +pkg log/syslog (freebsd-amd64), const LOG_LOCAL4 Priority +pkg log/syslog (freebsd-amd64), const LOG_LOCAL5 = 168 +pkg log/syslog (freebsd-amd64), const LOG_LOCAL5 Priority +pkg log/syslog (freebsd-amd64), const LOG_LOCAL6 = 176 +pkg log/syslog (freebsd-amd64), const LOG_LOCAL6 Priority +pkg log/syslog (freebsd-amd64), const LOG_LOCAL7 = 184 +pkg log/syslog (freebsd-amd64), const LOG_LOCAL7 Priority +pkg log/syslog (freebsd-amd64), const LOG_LPR = 48 +pkg log/syslog (freebsd-amd64), const LOG_LPR Priority +pkg log/syslog (freebsd-amd64), const LOG_MAIL = 16 +pkg log/syslog (freebsd-amd64), const LOG_MAIL Priority +pkg log/syslog (freebsd-amd64), const LOG_NEWS = 56 +pkg log/syslog (freebsd-amd64), const LOG_NEWS Priority +pkg log/syslog (freebsd-amd64), const LOG_NOTICE = 5 +pkg log/syslog (freebsd-amd64), const LOG_SYSLOG = 40 +pkg log/syslog (freebsd-amd64), const LOG_SYSLOG Priority +pkg log/syslog (freebsd-amd64), const LOG_USER = 8 +pkg log/syslog (freebsd-amd64), const LOG_USER Priority +pkg log/syslog (freebsd-amd64), const LOG_UUCP = 64 +pkg log/syslog (freebsd-amd64), const LOG_UUCP Priority +pkg log/syslog (freebsd-amd64), const LOG_WARNING = 4 +pkg log/syslog (freebsd-amd64-cgo), const LOG_ALERT = 1 +pkg log/syslog (freebsd-amd64-cgo), const LOG_AUTH = 32 +pkg log/syslog (freebsd-amd64-cgo), const LOG_AUTHPRIV = 80 +pkg log/syslog (freebsd-amd64-cgo), const LOG_CRIT = 2 +pkg log/syslog (freebsd-amd64-cgo), const LOG_CRON = 72 +pkg log/syslog (freebsd-amd64-cgo), const LOG_DAEMON = 24 +pkg log/syslog (freebsd-amd64-cgo), const LOG_DEBUG = 7 +pkg log/syslog (freebsd-amd64-cgo), const LOG_EMERG = 0 +pkg log/syslog (freebsd-amd64-cgo), const LOG_ERR = 3 +pkg log/syslog (freebsd-amd64-cgo), const LOG_FTP = 88 +pkg log/syslog (freebsd-amd64-cgo), const LOG_INFO = 6 +pkg log/syslog (freebsd-amd64-cgo), const LOG_KERN = 0 +pkg log/syslog (freebsd-amd64-cgo), const LOG_LOCAL0 = 128 +pkg log/syslog (freebsd-amd64-cgo), const LOG_LOCAL1 = 136 +pkg log/syslog (freebsd-amd64-cgo), const LOG_LOCAL2 = 144 +pkg log/syslog (freebsd-amd64-cgo), const LOG_LOCAL3 = 152 +pkg log/syslog (freebsd-amd64-cgo), const LOG_LOCAL4 = 160 +pkg log/syslog (freebsd-amd64-cgo), const LOG_LOCAL5 = 168 +pkg log/syslog (freebsd-amd64-cgo), const LOG_LOCAL6 = 176 +pkg log/syslog (freebsd-amd64-cgo), const LOG_LOCAL7 = 184 +pkg log/syslog (freebsd-amd64-cgo), const LOG_LPR = 48 +pkg log/syslog (freebsd-amd64-cgo), const LOG_MAIL = 16 +pkg log/syslog (freebsd-amd64-cgo), const LOG_NEWS = 56 +pkg log/syslog (freebsd-amd64-cgo), const LOG_NOTICE = 5 +pkg log/syslog (freebsd-amd64-cgo), const LOG_SYSLOG = 40 +pkg log/syslog (freebsd-amd64-cgo), const LOG_USER = 8 +pkg log/syslog (freebsd-amd64-cgo), const LOG_UUCP = 64 +pkg log/syslog (freebsd-amd64-cgo), const LOG_WARNING = 4 +pkg log/syslog (freebsd-arm), const LOG_ALERT = 1 +pkg log/syslog (freebsd-arm), const LOG_AUTH = 32 +pkg log/syslog (freebsd-arm), const LOG_AUTHPRIV = 80 +pkg log/syslog (freebsd-arm), const LOG_CRIT = 2 +pkg log/syslog (freebsd-arm), const LOG_CRON = 72 +pkg log/syslog (freebsd-arm), const LOG_DAEMON = 24 +pkg log/syslog (freebsd-arm), const LOG_DEBUG = 7 +pkg log/syslog (freebsd-arm), const LOG_EMERG = 0 +pkg log/syslog (freebsd-arm), const LOG_ERR = 3 +pkg log/syslog (freebsd-arm), const LOG_FTP = 88 +pkg log/syslog (freebsd-arm), const LOG_INFO = 6 +pkg log/syslog (freebsd-arm), const LOG_KERN = 0 +pkg log/syslog (freebsd-arm), const LOG_LOCAL0 = 128 +pkg log/syslog (freebsd-arm), const LOG_LOCAL1 = 136 +pkg log/syslog (freebsd-arm), const LOG_LOCAL2 = 144 +pkg log/syslog (freebsd-arm), const LOG_LOCAL3 = 152 +pkg log/syslog (freebsd-arm), const LOG_LOCAL4 = 160 +pkg log/syslog (freebsd-arm), const LOG_LOCAL5 = 168 +pkg log/syslog (freebsd-arm), const LOG_LOCAL6 = 176 +pkg log/syslog (freebsd-arm), const LOG_LOCAL7 = 184 +pkg log/syslog (freebsd-arm), const LOG_LPR = 48 +pkg log/syslog (freebsd-arm), const LOG_MAIL = 16 +pkg log/syslog (freebsd-arm), const LOG_NEWS = 56 +pkg log/syslog (freebsd-arm), const LOG_NOTICE = 5 +pkg log/syslog (freebsd-arm), const LOG_SYSLOG = 40 +pkg log/syslog (freebsd-arm), const LOG_USER = 8 +pkg log/syslog (freebsd-arm), const LOG_UUCP = 64 +pkg log/syslog (freebsd-arm), const LOG_WARNING = 4 +pkg log/syslog (freebsd-arm-cgo), const LOG_ALERT = 1 +pkg log/syslog (freebsd-arm-cgo), const LOG_AUTH = 32 +pkg log/syslog (freebsd-arm-cgo), const LOG_AUTHPRIV = 80 +pkg log/syslog (freebsd-arm-cgo), const LOG_CRIT = 2 +pkg log/syslog (freebsd-arm-cgo), const LOG_CRON = 72 +pkg log/syslog (freebsd-arm-cgo), const LOG_DAEMON = 24 +pkg log/syslog (freebsd-arm-cgo), const LOG_DEBUG = 7 +pkg log/syslog (freebsd-arm-cgo), const LOG_EMERG = 0 +pkg log/syslog (freebsd-arm-cgo), const LOG_ERR = 3 +pkg log/syslog (freebsd-arm-cgo), const LOG_FTP = 88 +pkg log/syslog (freebsd-arm-cgo), const LOG_INFO = 6 +pkg log/syslog (freebsd-arm-cgo), const LOG_KERN = 0 +pkg log/syslog (freebsd-arm-cgo), const LOG_LOCAL0 = 128 +pkg log/syslog (freebsd-arm-cgo), const LOG_LOCAL1 = 136 +pkg log/syslog (freebsd-arm-cgo), const LOG_LOCAL2 = 144 +pkg log/syslog (freebsd-arm-cgo), const LOG_LOCAL3 = 152 +pkg log/syslog (freebsd-arm-cgo), const LOG_LOCAL4 = 160 +pkg log/syslog (freebsd-arm-cgo), const LOG_LOCAL5 = 168 +pkg log/syslog (freebsd-arm-cgo), const LOG_LOCAL6 = 176 +pkg log/syslog (freebsd-arm-cgo), const LOG_LOCAL7 = 184 +pkg log/syslog (freebsd-arm-cgo), const LOG_LPR = 48 +pkg log/syslog (freebsd-arm-cgo), const LOG_MAIL = 16 +pkg log/syslog (freebsd-arm-cgo), const LOG_NEWS = 56 +pkg log/syslog (freebsd-arm-cgo), const LOG_NOTICE = 5 +pkg log/syslog (freebsd-arm-cgo), const LOG_SYSLOG = 40 +pkg log/syslog (freebsd-arm-cgo), const LOG_USER = 8 +pkg log/syslog (freebsd-arm-cgo), const LOG_UUCP = 64 +pkg log/syslog (freebsd-arm-cgo), const LOG_WARNING = 4 +pkg log/syslog (linux-386), const LOG_ALERT = 1 +pkg log/syslog (linux-386), const LOG_AUTH = 32 +pkg log/syslog (linux-386), const LOG_AUTH Priority +pkg log/syslog (linux-386), const LOG_AUTHPRIV = 80 +pkg log/syslog (linux-386), const LOG_AUTHPRIV Priority +pkg log/syslog (linux-386), const LOG_CRIT = 2 +pkg log/syslog (linux-386), const LOG_CRON = 72 +pkg log/syslog (linux-386), const LOG_CRON Priority +pkg log/syslog (linux-386), const LOG_DAEMON = 24 +pkg log/syslog (linux-386), const LOG_DAEMON Priority +pkg log/syslog (linux-386), const LOG_DEBUG = 7 +pkg log/syslog (linux-386), const LOG_EMERG = 0 +pkg log/syslog (linux-386), const LOG_ERR = 3 +pkg log/syslog (linux-386), const LOG_FTP = 88 +pkg log/syslog (linux-386), const LOG_FTP Priority +pkg log/syslog (linux-386), const LOG_INFO = 6 +pkg log/syslog (linux-386), const LOG_KERN = 0 +pkg log/syslog (linux-386), const LOG_KERN Priority +pkg log/syslog (linux-386), const LOG_LOCAL0 = 128 +pkg log/syslog (linux-386), const LOG_LOCAL0 Priority +pkg log/syslog (linux-386), const LOG_LOCAL1 = 136 +pkg log/syslog (linux-386), const LOG_LOCAL1 Priority +pkg log/syslog (linux-386), const LOG_LOCAL2 = 144 +pkg log/syslog (linux-386), const LOG_LOCAL2 Priority +pkg log/syslog (linux-386), const LOG_LOCAL3 = 152 +pkg log/syslog (linux-386), const LOG_LOCAL3 Priority +pkg log/syslog (linux-386), const LOG_LOCAL4 = 160 +pkg log/syslog (linux-386), const LOG_LOCAL4 Priority +pkg log/syslog (linux-386), const LOG_LOCAL5 = 168 +pkg log/syslog (linux-386), const LOG_LOCAL5 Priority +pkg log/syslog (linux-386), const LOG_LOCAL6 = 176 +pkg log/syslog (linux-386), const LOG_LOCAL6 Priority +pkg log/syslog (linux-386), const LOG_LOCAL7 = 184 +pkg log/syslog (linux-386), const LOG_LOCAL7 Priority +pkg log/syslog (linux-386), const LOG_LPR = 48 +pkg log/syslog (linux-386), const LOG_LPR Priority +pkg log/syslog (linux-386), const LOG_MAIL = 16 +pkg log/syslog (linux-386), const LOG_MAIL Priority +pkg log/syslog (linux-386), const LOG_NEWS = 56 +pkg log/syslog (linux-386), const LOG_NEWS Priority +pkg log/syslog (linux-386), const LOG_NOTICE = 5 +pkg log/syslog (linux-386), const LOG_SYSLOG = 40 +pkg log/syslog (linux-386), const LOG_SYSLOG Priority +pkg log/syslog (linux-386), const LOG_USER = 8 +pkg log/syslog (linux-386), const LOG_USER Priority +pkg log/syslog (linux-386), const LOG_UUCP = 64 +pkg log/syslog (linux-386), const LOG_UUCP Priority +pkg log/syslog (linux-386), const LOG_WARNING = 4 +pkg log/syslog (linux-386-cgo), const LOG_ALERT = 1 +pkg log/syslog (linux-386-cgo), const LOG_AUTH = 32 +pkg log/syslog (linux-386-cgo), const LOG_AUTH Priority +pkg log/syslog (linux-386-cgo), const LOG_AUTHPRIV = 80 +pkg log/syslog (linux-386-cgo), const LOG_AUTHPRIV Priority +pkg log/syslog (linux-386-cgo), const LOG_CRIT = 2 +pkg log/syslog (linux-386-cgo), const LOG_CRON = 72 +pkg log/syslog (linux-386-cgo), const LOG_CRON Priority +pkg log/syslog (linux-386-cgo), const LOG_DAEMON = 24 +pkg log/syslog (linux-386-cgo), const LOG_DAEMON Priority +pkg log/syslog (linux-386-cgo), const LOG_DEBUG = 7 +pkg log/syslog (linux-386-cgo), const LOG_EMERG = 0 +pkg log/syslog (linux-386-cgo), const LOG_ERR = 3 +pkg log/syslog (linux-386-cgo), const LOG_FTP = 88 +pkg log/syslog (linux-386-cgo), const LOG_FTP Priority +pkg log/syslog (linux-386-cgo), const LOG_INFO = 6 +pkg log/syslog (linux-386-cgo), const LOG_KERN = 0 +pkg log/syslog (linux-386-cgo), const LOG_KERN Priority +pkg log/syslog (linux-386-cgo), const LOG_LOCAL0 = 128 +pkg log/syslog (linux-386-cgo), const LOG_LOCAL0 Priority +pkg log/syslog (linux-386-cgo), const LOG_LOCAL1 = 136 +pkg log/syslog (linux-386-cgo), const LOG_LOCAL1 Priority +pkg log/syslog (linux-386-cgo), const LOG_LOCAL2 = 144 +pkg log/syslog (linux-386-cgo), const LOG_LOCAL2 Priority +pkg log/syslog (linux-386-cgo), const LOG_LOCAL3 = 152 +pkg log/syslog (linux-386-cgo), const LOG_LOCAL3 Priority +pkg log/syslog (linux-386-cgo), const LOG_LOCAL4 = 160 +pkg log/syslog (linux-386-cgo), const LOG_LOCAL4 Priority +pkg log/syslog (linux-386-cgo), const LOG_LOCAL5 = 168 +pkg log/syslog (linux-386-cgo), const LOG_LOCAL5 Priority +pkg log/syslog (linux-386-cgo), const LOG_LOCAL6 = 176 +pkg log/syslog (linux-386-cgo), const LOG_LOCAL6 Priority +pkg log/syslog (linux-386-cgo), const LOG_LOCAL7 = 184 +pkg log/syslog (linux-386-cgo), const LOG_LOCAL7 Priority +pkg log/syslog (linux-386-cgo), const LOG_LPR = 48 +pkg log/syslog (linux-386-cgo), const LOG_LPR Priority +pkg log/syslog (linux-386-cgo), const LOG_MAIL = 16 +pkg log/syslog (linux-386-cgo), const LOG_MAIL Priority +pkg log/syslog (linux-386-cgo), const LOG_NEWS = 56 +pkg log/syslog (linux-386-cgo), const LOG_NEWS Priority +pkg log/syslog (linux-386-cgo), const LOG_NOTICE = 5 +pkg log/syslog (linux-386-cgo), const LOG_SYSLOG = 40 +pkg log/syslog (linux-386-cgo), const LOG_SYSLOG Priority +pkg log/syslog (linux-386-cgo), const LOG_USER = 8 +pkg log/syslog (linux-386-cgo), const LOG_USER Priority +pkg log/syslog (linux-386-cgo), const LOG_UUCP = 64 +pkg log/syslog (linux-386-cgo), const LOG_UUCP Priority +pkg log/syslog (linux-386-cgo), const LOG_WARNING = 4 +pkg log/syslog (linux-amd64), const LOG_ALERT = 1 +pkg log/syslog (linux-amd64), const LOG_AUTH = 32 +pkg log/syslog (linux-amd64), const LOG_AUTH Priority +pkg log/syslog (linux-amd64), const LOG_AUTHPRIV = 80 +pkg log/syslog (linux-amd64), const LOG_AUTHPRIV Priority +pkg log/syslog (linux-amd64), const LOG_CRIT = 2 +pkg log/syslog (linux-amd64), const LOG_CRON = 72 +pkg log/syslog (linux-amd64), const LOG_CRON Priority +pkg log/syslog (linux-amd64), const LOG_DAEMON = 24 +pkg log/syslog (linux-amd64), const LOG_DAEMON Priority +pkg log/syslog (linux-amd64), const LOG_DEBUG = 7 +pkg log/syslog (linux-amd64), const LOG_EMERG = 0 +pkg log/syslog (linux-amd64), const LOG_ERR = 3 +pkg log/syslog (linux-amd64), const LOG_FTP = 88 +pkg log/syslog (linux-amd64), const LOG_FTP Priority +pkg log/syslog (linux-amd64), const LOG_INFO = 6 +pkg log/syslog (linux-amd64), const LOG_KERN = 0 +pkg log/syslog (linux-amd64), const LOG_KERN Priority +pkg log/syslog (linux-amd64), const LOG_LOCAL0 = 128 +pkg log/syslog (linux-amd64), const LOG_LOCAL0 Priority +pkg log/syslog (linux-amd64), const LOG_LOCAL1 = 136 +pkg log/syslog (linux-amd64), const LOG_LOCAL1 Priority +pkg log/syslog (linux-amd64), const LOG_LOCAL2 = 144 +pkg log/syslog (linux-amd64), const LOG_LOCAL2 Priority +pkg log/syslog (linux-amd64), const LOG_LOCAL3 = 152 +pkg log/syslog (linux-amd64), const LOG_LOCAL3 Priority +pkg log/syslog (linux-amd64), const LOG_LOCAL4 = 160 +pkg log/syslog (linux-amd64), const LOG_LOCAL4 Priority +pkg log/syslog (linux-amd64), const LOG_LOCAL5 = 168 +pkg log/syslog (linux-amd64), const LOG_LOCAL5 Priority +pkg log/syslog (linux-amd64), const LOG_LOCAL6 = 176 +pkg log/syslog (linux-amd64), const LOG_LOCAL6 Priority +pkg log/syslog (linux-amd64), const LOG_LOCAL7 = 184 +pkg log/syslog (linux-amd64), const LOG_LOCAL7 Priority +pkg log/syslog (linux-amd64), const LOG_LPR = 48 +pkg log/syslog (linux-amd64), const LOG_LPR Priority +pkg log/syslog (linux-amd64), const LOG_MAIL = 16 +pkg log/syslog (linux-amd64), const LOG_MAIL Priority +pkg log/syslog (linux-amd64), const LOG_NEWS = 56 +pkg log/syslog (linux-amd64), const LOG_NEWS Priority +pkg log/syslog (linux-amd64), const LOG_NOTICE = 5 +pkg log/syslog (linux-amd64), const LOG_SYSLOG = 40 +pkg log/syslog (linux-amd64), const LOG_SYSLOG Priority +pkg log/syslog (linux-amd64), const LOG_USER = 8 +pkg log/syslog (linux-amd64), const LOG_USER Priority +pkg log/syslog (linux-amd64), const LOG_UUCP = 64 +pkg log/syslog (linux-amd64), const LOG_UUCP Priority +pkg log/syslog (linux-amd64), const LOG_WARNING = 4 +pkg log/syslog (linux-amd64-cgo), const LOG_ALERT = 1 +pkg log/syslog (linux-amd64-cgo), const LOG_AUTH = 32 +pkg log/syslog (linux-amd64-cgo), const LOG_AUTH Priority +pkg log/syslog (linux-amd64-cgo), const LOG_AUTHPRIV = 80 +pkg log/syslog (linux-amd64-cgo), const LOG_AUTHPRIV Priority +pkg log/syslog (linux-amd64-cgo), const LOG_CRIT = 2 +pkg log/syslog (linux-amd64-cgo), const LOG_CRON = 72 +pkg log/syslog (linux-amd64-cgo), const LOG_CRON Priority +pkg log/syslog (linux-amd64-cgo), const LOG_DAEMON = 24 +pkg log/syslog (linux-amd64-cgo), const LOG_DAEMON Priority +pkg log/syslog (linux-amd64-cgo), const LOG_DEBUG = 7 +pkg log/syslog (linux-amd64-cgo), const LOG_EMERG = 0 +pkg log/syslog (linux-amd64-cgo), const LOG_ERR = 3 +pkg log/syslog (linux-amd64-cgo), const LOG_FTP = 88 +pkg log/syslog (linux-amd64-cgo), const LOG_FTP Priority +pkg log/syslog (linux-amd64-cgo), const LOG_INFO = 6 +pkg log/syslog (linux-amd64-cgo), const LOG_KERN = 0 +pkg log/syslog (linux-amd64-cgo), const LOG_KERN Priority +pkg log/syslog (linux-amd64-cgo), const LOG_LOCAL0 = 128 +pkg log/syslog (linux-amd64-cgo), const LOG_LOCAL0 Priority +pkg log/syslog (linux-amd64-cgo), const LOG_LOCAL1 = 136 +pkg log/syslog (linux-amd64-cgo), const LOG_LOCAL1 Priority +pkg log/syslog (linux-amd64-cgo), const LOG_LOCAL2 = 144 +pkg log/syslog (linux-amd64-cgo), const LOG_LOCAL2 Priority +pkg log/syslog (linux-amd64-cgo), const LOG_LOCAL3 = 152 +pkg log/syslog (linux-amd64-cgo), const LOG_LOCAL3 Priority +pkg log/syslog (linux-amd64-cgo), const LOG_LOCAL4 = 160 +pkg log/syslog (linux-amd64-cgo), const LOG_LOCAL4 Priority +pkg log/syslog (linux-amd64-cgo), const LOG_LOCAL5 = 168 +pkg log/syslog (linux-amd64-cgo), const LOG_LOCAL5 Priority +pkg log/syslog (linux-amd64-cgo), const LOG_LOCAL6 = 176 +pkg log/syslog (linux-amd64-cgo), const LOG_LOCAL6 Priority +pkg log/syslog (linux-amd64-cgo), const LOG_LOCAL7 = 184 +pkg log/syslog (linux-amd64-cgo), const LOG_LOCAL7 Priority +pkg log/syslog (linux-amd64-cgo), const LOG_LPR = 48 +pkg log/syslog (linux-amd64-cgo), const LOG_LPR Priority +pkg log/syslog (linux-amd64-cgo), const LOG_MAIL = 16 +pkg log/syslog (linux-amd64-cgo), const LOG_MAIL Priority +pkg log/syslog (linux-amd64-cgo), const LOG_NEWS = 56 +pkg log/syslog (linux-amd64-cgo), const LOG_NEWS Priority +pkg log/syslog (linux-amd64-cgo), const LOG_NOTICE = 5 +pkg log/syslog (linux-amd64-cgo), const LOG_SYSLOG = 40 +pkg log/syslog (linux-amd64-cgo), const LOG_SYSLOG Priority +pkg log/syslog (linux-amd64-cgo), const LOG_USER = 8 +pkg log/syslog (linux-amd64-cgo), const LOG_USER Priority +pkg log/syslog (linux-amd64-cgo), const LOG_UUCP = 64 +pkg log/syslog (linux-amd64-cgo), const LOG_UUCP Priority +pkg log/syslog (linux-amd64-cgo), const LOG_WARNING = 4 +pkg log/syslog (linux-arm), const LOG_ALERT = 1 +pkg log/syslog (linux-arm), const LOG_AUTH = 32 +pkg log/syslog (linux-arm), const LOG_AUTH Priority +pkg log/syslog (linux-arm), const LOG_AUTHPRIV = 80 +pkg log/syslog (linux-arm), const LOG_AUTHPRIV Priority +pkg log/syslog (linux-arm), const LOG_CRIT = 2 +pkg log/syslog (linux-arm), const LOG_CRON = 72 +pkg log/syslog (linux-arm), const LOG_CRON Priority +pkg log/syslog (linux-arm), const LOG_DAEMON = 24 +pkg log/syslog (linux-arm), const LOG_DAEMON Priority +pkg log/syslog (linux-arm), const LOG_DEBUG = 7 +pkg log/syslog (linux-arm), const LOG_EMERG = 0 +pkg log/syslog (linux-arm), const LOG_ERR = 3 +pkg log/syslog (linux-arm), const LOG_FTP = 88 +pkg log/syslog (linux-arm), const LOG_FTP Priority +pkg log/syslog (linux-arm), const LOG_INFO = 6 +pkg log/syslog (linux-arm), const LOG_KERN = 0 +pkg log/syslog (linux-arm), const LOG_KERN Priority +pkg log/syslog (linux-arm), const LOG_LOCAL0 = 128 +pkg log/syslog (linux-arm), const LOG_LOCAL0 Priority +pkg log/syslog (linux-arm), const LOG_LOCAL1 = 136 +pkg log/syslog (linux-arm), const LOG_LOCAL1 Priority +pkg log/syslog (linux-arm), const LOG_LOCAL2 = 144 +pkg log/syslog (linux-arm), const LOG_LOCAL2 Priority +pkg log/syslog (linux-arm), const LOG_LOCAL3 = 152 +pkg log/syslog (linux-arm), const LOG_LOCAL3 Priority +pkg log/syslog (linux-arm), const LOG_LOCAL4 = 160 +pkg log/syslog (linux-arm), const LOG_LOCAL4 Priority +pkg log/syslog (linux-arm), const LOG_LOCAL5 = 168 +pkg log/syslog (linux-arm), const LOG_LOCAL5 Priority +pkg log/syslog (linux-arm), const LOG_LOCAL6 = 176 +pkg log/syslog (linux-arm), const LOG_LOCAL6 Priority +pkg log/syslog (linux-arm), const LOG_LOCAL7 = 184 +pkg log/syslog (linux-arm), const LOG_LOCAL7 Priority +pkg log/syslog (linux-arm), const LOG_LPR = 48 +pkg log/syslog (linux-arm), const LOG_LPR Priority +pkg log/syslog (linux-arm), const LOG_MAIL = 16 +pkg log/syslog (linux-arm), const LOG_MAIL Priority +pkg log/syslog (linux-arm), const LOG_NEWS = 56 +pkg log/syslog (linux-arm), const LOG_NEWS Priority +pkg log/syslog (linux-arm), const LOG_NOTICE = 5 +pkg log/syslog (linux-arm), const LOG_SYSLOG = 40 +pkg log/syslog (linux-arm), const LOG_SYSLOG Priority +pkg log/syslog (linux-arm), const LOG_USER = 8 +pkg log/syslog (linux-arm), const LOG_USER Priority +pkg log/syslog (linux-arm), const LOG_UUCP = 64 +pkg log/syslog (linux-arm), const LOG_UUCP Priority +pkg log/syslog (linux-arm), const LOG_WARNING = 4 +pkg log/syslog (linux-arm-cgo), const LOG_ALERT = 1 +pkg log/syslog (linux-arm-cgo), const LOG_AUTH = 32 +pkg log/syslog (linux-arm-cgo), const LOG_AUTHPRIV = 80 +pkg log/syslog (linux-arm-cgo), const LOG_CRIT = 2 +pkg log/syslog (linux-arm-cgo), const LOG_CRON = 72 +pkg log/syslog (linux-arm-cgo), const LOG_DAEMON = 24 +pkg log/syslog (linux-arm-cgo), const LOG_DEBUG = 7 +pkg log/syslog (linux-arm-cgo), const LOG_EMERG = 0 +pkg log/syslog (linux-arm-cgo), const LOG_ERR = 3 +pkg log/syslog (linux-arm-cgo), const LOG_FTP = 88 +pkg log/syslog (linux-arm-cgo), const LOG_INFO = 6 +pkg log/syslog (linux-arm-cgo), const LOG_KERN = 0 +pkg log/syslog (linux-arm-cgo), const LOG_LOCAL0 = 128 +pkg log/syslog (linux-arm-cgo), const LOG_LOCAL1 = 136 +pkg log/syslog (linux-arm-cgo), const LOG_LOCAL2 = 144 +pkg log/syslog (linux-arm-cgo), const LOG_LOCAL3 = 152 +pkg log/syslog (linux-arm-cgo), const LOG_LOCAL4 = 160 +pkg log/syslog (linux-arm-cgo), const LOG_LOCAL5 = 168 +pkg log/syslog (linux-arm-cgo), const LOG_LOCAL6 = 176 +pkg log/syslog (linux-arm-cgo), const LOG_LOCAL7 = 184 +pkg log/syslog (linux-arm-cgo), const LOG_LPR = 48 +pkg log/syslog (linux-arm-cgo), const LOG_MAIL = 16 +pkg log/syslog (linux-arm-cgo), const LOG_NEWS = 56 +pkg log/syslog (linux-arm-cgo), const LOG_NOTICE = 5 +pkg log/syslog (linux-arm-cgo), const LOG_SYSLOG = 40 +pkg log/syslog (linux-arm-cgo), const LOG_USER = 8 +pkg log/syslog (linux-arm-cgo), const LOG_UUCP = 64 +pkg log/syslog (linux-arm-cgo), const LOG_WARNING = 4 +pkg log/syslog (netbsd-386), const LOG_ALERT = 1 +pkg log/syslog (netbsd-386), const LOG_AUTH = 32 +pkg log/syslog (netbsd-386), const LOG_AUTHPRIV = 80 +pkg log/syslog (netbsd-386), const LOG_CRIT = 2 +pkg log/syslog (netbsd-386), const LOG_CRON = 72 +pkg log/syslog (netbsd-386), const LOG_DAEMON = 24 +pkg log/syslog (netbsd-386), const LOG_DEBUG = 7 +pkg log/syslog (netbsd-386), const LOG_EMERG = 0 +pkg log/syslog (netbsd-386), const LOG_ERR = 3 +pkg log/syslog (netbsd-386), const LOG_FTP = 88 +pkg log/syslog (netbsd-386), const LOG_INFO = 6 +pkg log/syslog (netbsd-386), const LOG_KERN = 0 +pkg log/syslog (netbsd-386), const LOG_LOCAL0 = 128 +pkg log/syslog (netbsd-386), const LOG_LOCAL1 = 136 +pkg log/syslog (netbsd-386), const LOG_LOCAL2 = 144 +pkg log/syslog (netbsd-386), const LOG_LOCAL3 = 152 +pkg log/syslog (netbsd-386), const LOG_LOCAL4 = 160 +pkg log/syslog (netbsd-386), const LOG_LOCAL5 = 168 +pkg log/syslog (netbsd-386), const LOG_LOCAL6 = 176 +pkg log/syslog (netbsd-386), const LOG_LOCAL7 = 184 +pkg log/syslog (netbsd-386), const LOG_LPR = 48 +pkg log/syslog (netbsd-386), const LOG_MAIL = 16 +pkg log/syslog (netbsd-386), const LOG_NEWS = 56 +pkg log/syslog (netbsd-386), const LOG_NOTICE = 5 +pkg log/syslog (netbsd-386), const LOG_SYSLOG = 40 +pkg log/syslog (netbsd-386), const LOG_USER = 8 +pkg log/syslog (netbsd-386), const LOG_UUCP = 64 +pkg log/syslog (netbsd-386), const LOG_WARNING = 4 +pkg log/syslog (netbsd-386-cgo), const LOG_ALERT = 1 +pkg log/syslog (netbsd-386-cgo), const LOG_AUTH = 32 +pkg log/syslog (netbsd-386-cgo), const LOG_AUTHPRIV = 80 +pkg log/syslog (netbsd-386-cgo), const LOG_CRIT = 2 +pkg log/syslog (netbsd-386-cgo), const LOG_CRON = 72 +pkg log/syslog (netbsd-386-cgo), const LOG_DAEMON = 24 +pkg log/syslog (netbsd-386-cgo), const LOG_DEBUG = 7 +pkg log/syslog (netbsd-386-cgo), const LOG_EMERG = 0 +pkg log/syslog (netbsd-386-cgo), const LOG_ERR = 3 +pkg log/syslog (netbsd-386-cgo), const LOG_FTP = 88 +pkg log/syslog (netbsd-386-cgo), const LOG_INFO = 6 +pkg log/syslog (netbsd-386-cgo), const LOG_KERN = 0 +pkg log/syslog (netbsd-386-cgo), const LOG_LOCAL0 = 128 +pkg log/syslog (netbsd-386-cgo), const LOG_LOCAL1 = 136 +pkg log/syslog (netbsd-386-cgo), const LOG_LOCAL2 = 144 +pkg log/syslog (netbsd-386-cgo), const LOG_LOCAL3 = 152 +pkg log/syslog (netbsd-386-cgo), const LOG_LOCAL4 = 160 +pkg log/syslog (netbsd-386-cgo), const LOG_LOCAL5 = 168 +pkg log/syslog (netbsd-386-cgo), const LOG_LOCAL6 = 176 +pkg log/syslog (netbsd-386-cgo), const LOG_LOCAL7 = 184 +pkg log/syslog (netbsd-386-cgo), const LOG_LPR = 48 +pkg log/syslog (netbsd-386-cgo), const LOG_MAIL = 16 +pkg log/syslog (netbsd-386-cgo), const LOG_NEWS = 56 +pkg log/syslog (netbsd-386-cgo), const LOG_NOTICE = 5 +pkg log/syslog (netbsd-386-cgo), const LOG_SYSLOG = 40 +pkg log/syslog (netbsd-386-cgo), const LOG_USER = 8 +pkg log/syslog (netbsd-386-cgo), const LOG_UUCP = 64 +pkg log/syslog (netbsd-386-cgo), const LOG_WARNING = 4 +pkg log/syslog (netbsd-amd64), const LOG_ALERT = 1 +pkg log/syslog (netbsd-amd64), const LOG_AUTH = 32 +pkg log/syslog (netbsd-amd64), const LOG_AUTHPRIV = 80 +pkg log/syslog (netbsd-amd64), const LOG_CRIT = 2 +pkg log/syslog (netbsd-amd64), const LOG_CRON = 72 +pkg log/syslog (netbsd-amd64), const LOG_DAEMON = 24 +pkg log/syslog (netbsd-amd64), const LOG_DEBUG = 7 +pkg log/syslog (netbsd-amd64), const LOG_EMERG = 0 +pkg log/syslog (netbsd-amd64), const LOG_ERR = 3 +pkg log/syslog (netbsd-amd64), const LOG_FTP = 88 +pkg log/syslog (netbsd-amd64), const LOG_INFO = 6 +pkg log/syslog (netbsd-amd64), const LOG_KERN = 0 +pkg log/syslog (netbsd-amd64), const LOG_LOCAL0 = 128 +pkg log/syslog (netbsd-amd64), const LOG_LOCAL1 = 136 +pkg log/syslog (netbsd-amd64), const LOG_LOCAL2 = 144 +pkg log/syslog (netbsd-amd64), const LOG_LOCAL3 = 152 +pkg log/syslog (netbsd-amd64), const LOG_LOCAL4 = 160 +pkg log/syslog (netbsd-amd64), const LOG_LOCAL5 = 168 +pkg log/syslog (netbsd-amd64), const LOG_LOCAL6 = 176 +pkg log/syslog (netbsd-amd64), const LOG_LOCAL7 = 184 +pkg log/syslog (netbsd-amd64), const LOG_LPR = 48 +pkg log/syslog (netbsd-amd64), const LOG_MAIL = 16 +pkg log/syslog (netbsd-amd64), const LOG_NEWS = 56 +pkg log/syslog (netbsd-amd64), const LOG_NOTICE = 5 +pkg log/syslog (netbsd-amd64), const LOG_SYSLOG = 40 +pkg log/syslog (netbsd-amd64), const LOG_USER = 8 +pkg log/syslog (netbsd-amd64), const LOG_UUCP = 64 +pkg log/syslog (netbsd-amd64), const LOG_WARNING = 4 +pkg log/syslog (netbsd-amd64-cgo), const LOG_ALERT = 1 +pkg log/syslog (netbsd-amd64-cgo), const LOG_AUTH = 32 +pkg log/syslog (netbsd-amd64-cgo), const LOG_AUTHPRIV = 80 +pkg log/syslog (netbsd-amd64-cgo), const LOG_CRIT = 2 +pkg log/syslog (netbsd-amd64-cgo), const LOG_CRON = 72 +pkg log/syslog (netbsd-amd64-cgo), const LOG_DAEMON = 24 +pkg log/syslog (netbsd-amd64-cgo), const LOG_DEBUG = 7 +pkg log/syslog (netbsd-amd64-cgo), const LOG_EMERG = 0 +pkg log/syslog (netbsd-amd64-cgo), const LOG_ERR = 3 +pkg log/syslog (netbsd-amd64-cgo), const LOG_FTP = 88 +pkg log/syslog (netbsd-amd64-cgo), const LOG_INFO = 6 +pkg log/syslog (netbsd-amd64-cgo), const LOG_KERN = 0 +pkg log/syslog (netbsd-amd64-cgo), const LOG_LOCAL0 = 128 +pkg log/syslog (netbsd-amd64-cgo), const LOG_LOCAL1 = 136 +pkg log/syslog (netbsd-amd64-cgo), const LOG_LOCAL2 = 144 +pkg log/syslog (netbsd-amd64-cgo), const LOG_LOCAL3 = 152 +pkg log/syslog (netbsd-amd64-cgo), const LOG_LOCAL4 = 160 +pkg log/syslog (netbsd-amd64-cgo), const LOG_LOCAL5 = 168 +pkg log/syslog (netbsd-amd64-cgo), const LOG_LOCAL6 = 176 +pkg log/syslog (netbsd-amd64-cgo), const LOG_LOCAL7 = 184 +pkg log/syslog (netbsd-amd64-cgo), const LOG_LPR = 48 +pkg log/syslog (netbsd-amd64-cgo), const LOG_MAIL = 16 +pkg log/syslog (netbsd-amd64-cgo), const LOG_NEWS = 56 +pkg log/syslog (netbsd-amd64-cgo), const LOG_NOTICE = 5 +pkg log/syslog (netbsd-amd64-cgo), const LOG_SYSLOG = 40 +pkg log/syslog (netbsd-amd64-cgo), const LOG_USER = 8 +pkg log/syslog (netbsd-amd64-cgo), const LOG_UUCP = 64 +pkg log/syslog (netbsd-amd64-cgo), const LOG_WARNING = 4 +pkg log/syslog (netbsd-arm), const LOG_ALERT = 1 +pkg log/syslog (netbsd-arm), const LOG_AUTH = 32 +pkg log/syslog (netbsd-arm), const LOG_AUTHPRIV = 80 +pkg log/syslog (netbsd-arm), const LOG_CRIT = 2 +pkg log/syslog (netbsd-arm), const LOG_CRON = 72 +pkg log/syslog (netbsd-arm), const LOG_DAEMON = 24 +pkg log/syslog (netbsd-arm), const LOG_DEBUG = 7 +pkg log/syslog (netbsd-arm), const LOG_EMERG = 0 +pkg log/syslog (netbsd-arm), const LOG_ERR = 3 +pkg log/syslog (netbsd-arm), const LOG_FTP = 88 +pkg log/syslog (netbsd-arm), const LOG_INFO = 6 +pkg log/syslog (netbsd-arm), const LOG_KERN = 0 +pkg log/syslog (netbsd-arm), const LOG_LOCAL0 = 128 +pkg log/syslog (netbsd-arm), const LOG_LOCAL1 = 136 +pkg log/syslog (netbsd-arm), const LOG_LOCAL2 = 144 +pkg log/syslog (netbsd-arm), const LOG_LOCAL3 = 152 +pkg log/syslog (netbsd-arm), const LOG_LOCAL4 = 160 +pkg log/syslog (netbsd-arm), const LOG_LOCAL5 = 168 +pkg log/syslog (netbsd-arm), const LOG_LOCAL6 = 176 +pkg log/syslog (netbsd-arm), const LOG_LOCAL7 = 184 +pkg log/syslog (netbsd-arm), const LOG_LPR = 48 +pkg log/syslog (netbsd-arm), const LOG_MAIL = 16 +pkg log/syslog (netbsd-arm), const LOG_NEWS = 56 +pkg log/syslog (netbsd-arm), const LOG_NOTICE = 5 +pkg log/syslog (netbsd-arm), const LOG_SYSLOG = 40 +pkg log/syslog (netbsd-arm), const LOG_USER = 8 +pkg log/syslog (netbsd-arm), const LOG_UUCP = 64 +pkg log/syslog (netbsd-arm), const LOG_WARNING = 4 +pkg log/syslog (netbsd-arm-cgo), const LOG_ALERT = 1 +pkg log/syslog (netbsd-arm-cgo), const LOG_AUTH = 32 +pkg log/syslog (netbsd-arm-cgo), const LOG_AUTHPRIV = 80 +pkg log/syslog (netbsd-arm-cgo), const LOG_CRIT = 2 +pkg log/syslog (netbsd-arm-cgo), const LOG_CRON = 72 +pkg log/syslog (netbsd-arm-cgo), const LOG_DAEMON = 24 +pkg log/syslog (netbsd-arm-cgo), const LOG_DEBUG = 7 +pkg log/syslog (netbsd-arm-cgo), const LOG_EMERG = 0 +pkg log/syslog (netbsd-arm-cgo), const LOG_ERR = 3 +pkg log/syslog (netbsd-arm-cgo), const LOG_FTP = 88 +pkg log/syslog (netbsd-arm-cgo), const LOG_INFO = 6 +pkg log/syslog (netbsd-arm-cgo), const LOG_KERN = 0 +pkg log/syslog (netbsd-arm-cgo), const LOG_LOCAL0 = 128 +pkg log/syslog (netbsd-arm-cgo), const LOG_LOCAL1 = 136 +pkg log/syslog (netbsd-arm-cgo), const LOG_LOCAL2 = 144 +pkg log/syslog (netbsd-arm-cgo), const LOG_LOCAL3 = 152 +pkg log/syslog (netbsd-arm-cgo), const LOG_LOCAL4 = 160 +pkg log/syslog (netbsd-arm-cgo), const LOG_LOCAL5 = 168 +pkg log/syslog (netbsd-arm-cgo), const LOG_LOCAL6 = 176 +pkg log/syslog (netbsd-arm-cgo), const LOG_LOCAL7 = 184 +pkg log/syslog (netbsd-arm-cgo), const LOG_LPR = 48 +pkg log/syslog (netbsd-arm-cgo), const LOG_MAIL = 16 +pkg log/syslog (netbsd-arm-cgo), const LOG_NEWS = 56 +pkg log/syslog (netbsd-arm-cgo), const LOG_NOTICE = 5 +pkg log/syslog (netbsd-arm-cgo), const LOG_SYSLOG = 40 +pkg log/syslog (netbsd-arm-cgo), const LOG_USER = 8 +pkg log/syslog (netbsd-arm-cgo), const LOG_UUCP = 64 +pkg log/syslog (netbsd-arm-cgo), const LOG_WARNING = 4 +pkg log/syslog (openbsd-386), const LOG_ALERT = 1 +pkg log/syslog (openbsd-386), const LOG_AUTH = 32 +pkg log/syslog (openbsd-386), const LOG_AUTHPRIV = 80 +pkg log/syslog (openbsd-386), const LOG_CRIT = 2 +pkg log/syslog (openbsd-386), const LOG_CRON = 72 +pkg log/syslog (openbsd-386), const LOG_DAEMON = 24 +pkg log/syslog (openbsd-386), const LOG_DEBUG = 7 +pkg log/syslog (openbsd-386), const LOG_EMERG = 0 +pkg log/syslog (openbsd-386), const LOG_ERR = 3 +pkg log/syslog (openbsd-386), const LOG_FTP = 88 +pkg log/syslog (openbsd-386), const LOG_INFO = 6 +pkg log/syslog (openbsd-386), const LOG_KERN = 0 +pkg log/syslog (openbsd-386), const LOG_LOCAL0 = 128 +pkg log/syslog (openbsd-386), const LOG_LOCAL1 = 136 +pkg log/syslog (openbsd-386), const LOG_LOCAL2 = 144 +pkg log/syslog (openbsd-386), const LOG_LOCAL3 = 152 +pkg log/syslog (openbsd-386), const LOG_LOCAL4 = 160 +pkg log/syslog (openbsd-386), const LOG_LOCAL5 = 168 +pkg log/syslog (openbsd-386), const LOG_LOCAL6 = 176 +pkg log/syslog (openbsd-386), const LOG_LOCAL7 = 184 +pkg log/syslog (openbsd-386), const LOG_LPR = 48 +pkg log/syslog (openbsd-386), const LOG_MAIL = 16 +pkg log/syslog (openbsd-386), const LOG_NEWS = 56 +pkg log/syslog (openbsd-386), const LOG_NOTICE = 5 +pkg log/syslog (openbsd-386), const LOG_SYSLOG = 40 +pkg log/syslog (openbsd-386), const LOG_USER = 8 +pkg log/syslog (openbsd-386), const LOG_UUCP = 64 +pkg log/syslog (openbsd-386), const LOG_WARNING = 4 +pkg log/syslog (openbsd-386-cgo), const LOG_ALERT = 1 +pkg log/syslog (openbsd-386-cgo), const LOG_AUTH = 32 +pkg log/syslog (openbsd-386-cgo), const LOG_AUTHPRIV = 80 +pkg log/syslog (openbsd-386-cgo), const LOG_CRIT = 2 +pkg log/syslog (openbsd-386-cgo), const LOG_CRON = 72 +pkg log/syslog (openbsd-386-cgo), const LOG_DAEMON = 24 +pkg log/syslog (openbsd-386-cgo), const LOG_DEBUG = 7 +pkg log/syslog (openbsd-386-cgo), const LOG_EMERG = 0 +pkg log/syslog (openbsd-386-cgo), const LOG_ERR = 3 +pkg log/syslog (openbsd-386-cgo), const LOG_FTP = 88 +pkg log/syslog (openbsd-386-cgo), const LOG_INFO = 6 +pkg log/syslog (openbsd-386-cgo), const LOG_KERN = 0 +pkg log/syslog (openbsd-386-cgo), const LOG_LOCAL0 = 128 +pkg log/syslog (openbsd-386-cgo), const LOG_LOCAL1 = 136 +pkg log/syslog (openbsd-386-cgo), const LOG_LOCAL2 = 144 +pkg log/syslog (openbsd-386-cgo), const LOG_LOCAL3 = 152 +pkg log/syslog (openbsd-386-cgo), const LOG_LOCAL4 = 160 +pkg log/syslog (openbsd-386-cgo), const LOG_LOCAL5 = 168 +pkg log/syslog (openbsd-386-cgo), const LOG_LOCAL6 = 176 +pkg log/syslog (openbsd-386-cgo), const LOG_LOCAL7 = 184 +pkg log/syslog (openbsd-386-cgo), const LOG_LPR = 48 +pkg log/syslog (openbsd-386-cgo), const LOG_MAIL = 16 +pkg log/syslog (openbsd-386-cgo), const LOG_NEWS = 56 +pkg log/syslog (openbsd-386-cgo), const LOG_NOTICE = 5 +pkg log/syslog (openbsd-386-cgo), const LOG_SYSLOG = 40 +pkg log/syslog (openbsd-386-cgo), const LOG_USER = 8 +pkg log/syslog (openbsd-386-cgo), const LOG_UUCP = 64 +pkg log/syslog (openbsd-386-cgo), const LOG_WARNING = 4 +pkg log/syslog (openbsd-amd64), const LOG_ALERT = 1 +pkg log/syslog (openbsd-amd64), const LOG_AUTH = 32 +pkg log/syslog (openbsd-amd64), const LOG_AUTHPRIV = 80 +pkg log/syslog (openbsd-amd64), const LOG_CRIT = 2 +pkg log/syslog (openbsd-amd64), const LOG_CRON = 72 +pkg log/syslog (openbsd-amd64), const LOG_DAEMON = 24 +pkg log/syslog (openbsd-amd64), const LOG_DEBUG = 7 +pkg log/syslog (openbsd-amd64), const LOG_EMERG = 0 +pkg log/syslog (openbsd-amd64), const LOG_ERR = 3 +pkg log/syslog (openbsd-amd64), const LOG_FTP = 88 +pkg log/syslog (openbsd-amd64), const LOG_INFO = 6 +pkg log/syslog (openbsd-amd64), const LOG_KERN = 0 +pkg log/syslog (openbsd-amd64), const LOG_LOCAL0 = 128 +pkg log/syslog (openbsd-amd64), const LOG_LOCAL1 = 136 +pkg log/syslog (openbsd-amd64), const LOG_LOCAL2 = 144 +pkg log/syslog (openbsd-amd64), const LOG_LOCAL3 = 152 +pkg log/syslog (openbsd-amd64), const LOG_LOCAL4 = 160 +pkg log/syslog (openbsd-amd64), const LOG_LOCAL5 = 168 +pkg log/syslog (openbsd-amd64), const LOG_LOCAL6 = 176 +pkg log/syslog (openbsd-amd64), const LOG_LOCAL7 = 184 +pkg log/syslog (openbsd-amd64), const LOG_LPR = 48 +pkg log/syslog (openbsd-amd64), const LOG_MAIL = 16 +pkg log/syslog (openbsd-amd64), const LOG_NEWS = 56 +pkg log/syslog (openbsd-amd64), const LOG_NOTICE = 5 +pkg log/syslog (openbsd-amd64), const LOG_SYSLOG = 40 +pkg log/syslog (openbsd-amd64), const LOG_USER = 8 +pkg log/syslog (openbsd-amd64), const LOG_UUCP = 64 +pkg log/syslog (openbsd-amd64), const LOG_WARNING = 4 +pkg log/syslog (openbsd-amd64-cgo), const LOG_ALERT = 1 +pkg log/syslog (openbsd-amd64-cgo), const LOG_AUTH = 32 +pkg log/syslog (openbsd-amd64-cgo), const LOG_AUTHPRIV = 80 +pkg log/syslog (openbsd-amd64-cgo), const LOG_CRIT = 2 +pkg log/syslog (openbsd-amd64-cgo), const LOG_CRON = 72 +pkg log/syslog (openbsd-amd64-cgo), const LOG_DAEMON = 24 +pkg log/syslog (openbsd-amd64-cgo), const LOG_DEBUG = 7 +pkg log/syslog (openbsd-amd64-cgo), const LOG_EMERG = 0 +pkg log/syslog (openbsd-amd64-cgo), const LOG_ERR = 3 +pkg log/syslog (openbsd-amd64-cgo), const LOG_FTP = 88 +pkg log/syslog (openbsd-amd64-cgo), const LOG_INFO = 6 +pkg log/syslog (openbsd-amd64-cgo), const LOG_KERN = 0 +pkg log/syslog (openbsd-amd64-cgo), const LOG_LOCAL0 = 128 +pkg log/syslog (openbsd-amd64-cgo), const LOG_LOCAL1 = 136 +pkg log/syslog (openbsd-amd64-cgo), const LOG_LOCAL2 = 144 +pkg log/syslog (openbsd-amd64-cgo), const LOG_LOCAL3 = 152 +pkg log/syslog (openbsd-amd64-cgo), const LOG_LOCAL4 = 160 +pkg log/syslog (openbsd-amd64-cgo), const LOG_LOCAL5 = 168 +pkg log/syslog (openbsd-amd64-cgo), const LOG_LOCAL6 = 176 +pkg log/syslog (openbsd-amd64-cgo), const LOG_LOCAL7 = 184 +pkg log/syslog (openbsd-amd64-cgo), const LOG_LPR = 48 +pkg log/syslog (openbsd-amd64-cgo), const LOG_MAIL = 16 +pkg log/syslog (openbsd-amd64-cgo), const LOG_NEWS = 56 +pkg log/syslog (openbsd-amd64-cgo), const LOG_NOTICE = 5 +pkg log/syslog (openbsd-amd64-cgo), const LOG_SYSLOG = 40 +pkg log/syslog (openbsd-amd64-cgo), const LOG_USER = 8 +pkg log/syslog (openbsd-amd64-cgo), const LOG_UUCP = 64 +pkg log/syslog (openbsd-amd64-cgo), const LOG_WARNING = 4 +pkg math, const E = 271828182845904523536028747135266249775724709369995957496696763/100000000000000000000000000000000000000000000000000000000000000 +pkg math, const Ln10 = 23025850929940456840179914546843642076011014886287729760333279/10000000000000000000000000000000000000000000000000000000000000 +pkg math, const Ln2 = 693147180559945309417232121458176568075500134360255254120680009/1000000000000000000000000000000000000000000000000000000000000000 +pkg math, const Log10E = 10000000000000000000000000000000000000000000000000000000000000/23025850929940456840179914546843642076011014886287729760333279 +pkg math, const Log2E = 1000000000000000000000000000000000000000000000000000000000000000/693147180559945309417232121458176568075500134360255254120680009 +pkg math, const MaxFloat32 = 340282346638528859811704183484516925440 +pkg math, const MaxFloat64 = 179769313486231570814527423731704356798100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +pkg math, const MaxInt16 = 32767 +pkg math, const MaxInt32 = 2147483647 +pkg math, const MaxInt64 = 9223372036854775807 +pkg math, const MaxInt8 = 127 +pkg math, const MaxUint16 = 65535 +pkg math, const MaxUint32 = 4294967295 +pkg math, const MaxUint64 = 18446744073709551615 +pkg math, const MaxUint8 = 255 +pkg math, const MinInt16 = -32768 +pkg math, const MinInt32 = -2147483648 +pkg math, const MinInt64 = -9223372036854775808 +pkg math, const MinInt8 = -128 +pkg math, const Phi = 80901699437494742410229341718281905886015458990288143106772431/50000000000000000000000000000000000000000000000000000000000000 +pkg math, const Pi = 314159265358979323846264338327950288419716939937510582097494459/100000000000000000000000000000000000000000000000000000000000000 +pkg math, const SmallestNonzeroFloat32 = 17516230804060213386546619791123951641/12500000000000000000000000000000000000000000000000000000000000000000000000000000000 +pkg math, const SmallestNonzeroFloat64 = 4940656458412465441765687928682213723651/1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +pkg math, const Sqrt2 = 70710678118654752440084436210484903928483593768847403658833987/50000000000000000000000000000000000000000000000000000000000000 +pkg math, const SqrtE = 164872127070012814684865078781416357165377610071014801157507931/100000000000000000000000000000000000000000000000000000000000000 +pkg math, const SqrtPhi = 63600982475703448212621123086874574585780402092004812430832019/50000000000000000000000000000000000000000000000000000000000000 +pkg math, const SqrtPi = 177245385090551602729816748334114518279754945612238712821380779/100000000000000000000000000000000000000000000000000000000000000 +pkg math/big, const MaxBase = 36 +pkg math/big, method (*Int) MarshalJSON() ([]uint8, error) +pkg math/big, method (*Int) SetUint64(uint64) *Int +pkg math/big, method (*Int) Uint64() uint64 +pkg math/big, method (*Int) UnmarshalJSON([]uint8) error +pkg math/big, method (*Rat) Float64() (float64, bool) +pkg math/big, method (*Rat) SetFloat64(float64) *Rat +pkg mime/multipart, method (*Writer) SetBoundary(string) error +pkg net, const FlagBroadcast = 2 +pkg net, const FlagLoopback = 4 +pkg net, const FlagMulticast = 16 +pkg net, const FlagPointToPoint = 8 +pkg net, const FlagUp = 1 +pkg net, const IPv4len = 4 +pkg net, const IPv6len = 16 +pkg net, func ListenUnixgram(string, *UnixAddr) (*UnixConn, error) +pkg net, func LookupNS(string) ([]*NS, error) +pkg net, method (*Dialer) Dial(string, string) (Conn, error) +pkg net, method (*IPConn) ReadMsgIP([]uint8, []uint8) (int, int, int, *IPAddr, error) +pkg net, method (*IPConn) WriteMsgIP([]uint8, []uint8, *IPAddr) (int, int, error) +pkg net, method (*UDPConn) ReadMsgUDP([]uint8, []uint8) (int, int, int, *UDPAddr, error) +pkg net, method (*UDPConn) WriteMsgUDP([]uint8, []uint8, *UDPAddr) (int, int, error) +pkg net, method (*UnixConn) CloseRead() error +pkg net, method (*UnixConn) CloseWrite() error +pkg net, type Dialer struct +pkg net, type Dialer struct, Deadline time.Time +pkg net, type Dialer struct, LocalAddr Addr +pkg net, type Dialer struct, Timeout time.Duration +pkg net, type IPAddr struct, Zone string +pkg net, type NS struct +pkg net, type NS struct, Host string +pkg net, type TCPAddr struct, Zone string +pkg net, type UDPAddr struct, Zone string +pkg net/http, const DefaultMaxHeaderBytes = 1048576 +pkg net/http, const DefaultMaxIdleConnsPerHost = 2 +pkg net/http, const StatusAccepted = 202 +pkg net/http, const StatusBadGateway = 502 +pkg net/http, const StatusBadRequest = 400 +pkg net/http, const StatusConflict = 409 +pkg net/http, const StatusContinue = 100 +pkg net/http, const StatusCreated = 201 +pkg net/http, const StatusExpectationFailed = 417 +pkg net/http, const StatusForbidden = 403 +pkg net/http, const StatusFound = 302 +pkg net/http, const StatusGatewayTimeout = 504 +pkg net/http, const StatusGone = 410 +pkg net/http, const StatusHTTPVersionNotSupported = 505 +pkg net/http, const StatusInternalServerError = 500 +pkg net/http, const StatusLengthRequired = 411 +pkg net/http, const StatusMethodNotAllowed = 405 +pkg net/http, const StatusMovedPermanently = 301 +pkg net/http, const StatusMultipleChoices = 300 +pkg net/http, const StatusNoContent = 204 +pkg net/http, const StatusNonAuthoritativeInfo = 203 +pkg net/http, const StatusNotAcceptable = 406 +pkg net/http, const StatusNotFound = 404 +pkg net/http, const StatusNotImplemented = 501 +pkg net/http, const StatusNotModified = 304 +pkg net/http, const StatusOK = 200 +pkg net/http, const StatusPartialContent = 206 +pkg net/http, const StatusPaymentRequired = 402 +pkg net/http, const StatusPreconditionFailed = 412 +pkg net/http, const StatusProxyAuthRequired = 407 +pkg net/http, const StatusRequestEntityTooLarge = 413 +pkg net/http, const StatusRequestTimeout = 408 +pkg net/http, const StatusRequestURITooLong = 414 +pkg net/http, const StatusRequestedRangeNotSatisfiable = 416 +pkg net/http, const StatusResetContent = 205 +pkg net/http, const StatusSeeOther = 303 +pkg net/http, const StatusServiceUnavailable = 503 +pkg net/http, const StatusSwitchingProtocols = 101 +pkg net/http, const StatusTeapot = 418 +pkg net/http, const StatusTemporaryRedirect = 307 +pkg net/http, const StatusUnauthorized = 401 +pkg net/http, const StatusUnsupportedMediaType = 415 +pkg net/http, const StatusUseProxy = 305 +pkg net/http, const TimeFormat = "Mon, 02 Jan 2006 15:04:05 GMT" +pkg net/http, func ParseTime(string) (time.Time, error) +pkg net/http, method (*Request) PostFormValue(string) string +pkg net/http, method (*ServeMux) Handler(*Request) (Handler, string) +pkg net/http, method (*Transport) CancelRequest(*Request) +pkg net/http, type CloseNotifier interface { CloseNotify } +pkg net/http, type CloseNotifier interface, CloseNotify() <-chan bool +pkg net/http, type Request struct, PostForm url.Values +pkg net/http, type Server struct, TLSNextProto map[string]func(*Server, *tls.Conn, Handler) +pkg net/http, type Transport struct, ResponseHeaderTimeout time.Duration +pkg net/http/cookiejar, func New(*Options) (*Jar, error) +pkg net/http/cookiejar, method (*Jar) Cookies(*url.URL) []*http.Cookie +pkg net/http/cookiejar, method (*Jar) SetCookies(*url.URL, []*http.Cookie) +pkg net/http/cookiejar, type Jar struct +pkg net/http/cookiejar, type Options struct +pkg net/http/cookiejar, type Options struct, PublicSuffixList PublicSuffixList +pkg net/http/cookiejar, type PublicSuffixList interface { PublicSuffix, String } +pkg net/http/cookiejar, type PublicSuffixList interface, PublicSuffix(string) string +pkg net/http/cookiejar, type PublicSuffixList interface, String() string +pkg net/http/httptest, const DefaultRemoteAddr = "1.2.3.4" +pkg net/mail, func ParseAddress(string) (*Address, error) +pkg net/mail, func ParseAddressList(string) ([]*Address, error) +pkg net/rpc, const DefaultDebugPath = "/debug/rpc" +pkg net/rpc, const DefaultRPCPath = "/_goRPC_" +pkg net/smtp, method (*Client) Hello(string) error +pkg net/textproto, func TrimBytes([]uint8) []uint8 +pkg net/textproto, func TrimString(string) string +pkg os (darwin-386), const DevNull = "/dev/null" +pkg os (darwin-386), const O_APPEND = 8 +pkg os (darwin-386), const O_CREATE = 512 +pkg os (darwin-386), const O_EXCL = 2048 +pkg os (darwin-386), const O_SYNC = 128 +pkg os (darwin-386), const O_TRUNC = 1024 +pkg os (darwin-386), const PathListSeparator = 58 +pkg os (darwin-386), const PathSeparator = 47 +pkg os (darwin-386-cgo), const DevNull = "/dev/null" +pkg os (darwin-386-cgo), const O_APPEND = 8 +pkg os (darwin-386-cgo), const O_CREATE = 512 +pkg os (darwin-386-cgo), const O_EXCL = 2048 +pkg os (darwin-386-cgo), const O_SYNC = 128 +pkg os (darwin-386-cgo), const O_TRUNC = 1024 +pkg os (darwin-386-cgo), const PathListSeparator = 58 +pkg os (darwin-386-cgo), const PathSeparator = 47 +pkg os (darwin-amd64), const DevNull = "/dev/null" +pkg os (darwin-amd64), const O_APPEND = 8 +pkg os (darwin-amd64), const O_CREATE = 512 +pkg os (darwin-amd64), const O_EXCL = 2048 +pkg os (darwin-amd64), const O_SYNC = 128 +pkg os (darwin-amd64), const O_TRUNC = 1024 +pkg os (darwin-amd64), const PathListSeparator = 58 +pkg os (darwin-amd64), const PathSeparator = 47 +pkg os (darwin-amd64-cgo), const DevNull = "/dev/null" +pkg os (darwin-amd64-cgo), const O_APPEND = 8 +pkg os (darwin-amd64-cgo), const O_CREATE = 512 +pkg os (darwin-amd64-cgo), const O_EXCL = 2048 +pkg os (darwin-amd64-cgo), const O_SYNC = 128 +pkg os (darwin-amd64-cgo), const O_TRUNC = 1024 +pkg os (darwin-amd64-cgo), const PathListSeparator = 58 +pkg os (darwin-amd64-cgo), const PathSeparator = 47 +pkg os (freebsd-386), const DevNull = "/dev/null" +pkg os (freebsd-386), const O_APPEND = 8 +pkg os (freebsd-386), const O_CREATE = 512 +pkg os (freebsd-386), const O_EXCL = 2048 +pkg os (freebsd-386), const O_SYNC = 128 +pkg os (freebsd-386), const O_TRUNC = 1024 +pkg os (freebsd-386), const PathListSeparator = 58 +pkg os (freebsd-386), const PathSeparator = 47 +pkg os (freebsd-386-cgo), const DevNull = "/dev/null" +pkg os (freebsd-386-cgo), const O_APPEND = 8 +pkg os (freebsd-386-cgo), const O_CREATE = 512 +pkg os (freebsd-386-cgo), const O_EXCL = 2048 +pkg os (freebsd-386-cgo), const O_SYNC = 128 +pkg os (freebsd-386-cgo), const O_TRUNC = 1024 +pkg os (freebsd-386-cgo), const PathListSeparator = 58 +pkg os (freebsd-386-cgo), const PathSeparator = 47 +pkg os (freebsd-amd64), const DevNull = "/dev/null" +pkg os (freebsd-amd64), const O_APPEND = 8 +pkg os (freebsd-amd64), const O_CREATE = 512 +pkg os (freebsd-amd64), const O_EXCL = 2048 +pkg os (freebsd-amd64), const O_SYNC = 128 +pkg os (freebsd-amd64), const O_TRUNC = 1024 +pkg os (freebsd-amd64), const PathListSeparator = 58 +pkg os (freebsd-amd64), const PathSeparator = 47 +pkg os (freebsd-amd64-cgo), const DevNull = "/dev/null" +pkg os (freebsd-amd64-cgo), const O_APPEND = 8 +pkg os (freebsd-amd64-cgo), const O_CREATE = 512 +pkg os (freebsd-amd64-cgo), const O_EXCL = 2048 +pkg os (freebsd-amd64-cgo), const O_SYNC = 128 +pkg os (freebsd-amd64-cgo), const O_TRUNC = 1024 +pkg os (freebsd-amd64-cgo), const PathListSeparator = 58 +pkg os (freebsd-amd64-cgo), const PathSeparator = 47 +pkg os (freebsd-arm), const DevNull = "/dev/null" +pkg os (freebsd-arm), const O_APPEND = 8 +pkg os (freebsd-arm), const O_CREATE = 512 +pkg os (freebsd-arm), const O_EXCL = 2048 +pkg os (freebsd-arm), const O_SYNC = 128 +pkg os (freebsd-arm), const O_TRUNC = 1024 +pkg os (freebsd-arm), const PathListSeparator = 58 +pkg os (freebsd-arm), const PathSeparator = 47 +pkg os (freebsd-arm-cgo), const DevNull = "/dev/null" +pkg os (freebsd-arm-cgo), const O_APPEND = 8 +pkg os (freebsd-arm-cgo), const O_CREATE = 512 +pkg os (freebsd-arm-cgo), const O_EXCL = 2048 +pkg os (freebsd-arm-cgo), const O_SYNC = 128 +pkg os (freebsd-arm-cgo), const O_TRUNC = 1024 +pkg os (freebsd-arm-cgo), const PathListSeparator = 58 +pkg os (freebsd-arm-cgo), const PathSeparator = 47 +pkg os (linux-386), const DevNull = "/dev/null" +pkg os (linux-386), const O_APPEND = 1024 +pkg os (linux-386), const O_CREATE = 64 +pkg os (linux-386), const O_EXCL = 128 +pkg os (linux-386), const O_SYNC = 1052672 +pkg os (linux-386), const O_TRUNC = 512 +pkg os (linux-386), const PathListSeparator = 58 +pkg os (linux-386), const PathSeparator = 47 +pkg os (linux-386-cgo), const DevNull = "/dev/null" +pkg os (linux-386-cgo), const O_APPEND = 1024 +pkg os (linux-386-cgo), const O_CREATE = 64 +pkg os (linux-386-cgo), const O_EXCL = 128 +pkg os (linux-386-cgo), const O_SYNC = 1052672 +pkg os (linux-386-cgo), const O_TRUNC = 512 +pkg os (linux-386-cgo), const PathListSeparator = 58 +pkg os (linux-386-cgo), const PathSeparator = 47 +pkg os (linux-amd64), const DevNull = "/dev/null" +pkg os (linux-amd64), const O_APPEND = 1024 +pkg os (linux-amd64), const O_CREATE = 64 +pkg os (linux-amd64), const O_EXCL = 128 +pkg os (linux-amd64), const O_SYNC = 1052672 +pkg os (linux-amd64), const O_TRUNC = 512 +pkg os (linux-amd64), const PathListSeparator = 58 +pkg os (linux-amd64), const PathSeparator = 47 +pkg os (linux-amd64-cgo), const DevNull = "/dev/null" +pkg os (linux-amd64-cgo), const O_APPEND = 1024 +pkg os (linux-amd64-cgo), const O_CREATE = 64 +pkg os (linux-amd64-cgo), const O_EXCL = 128 +pkg os (linux-amd64-cgo), const O_SYNC = 1052672 +pkg os (linux-amd64-cgo), const O_TRUNC = 512 +pkg os (linux-amd64-cgo), const PathListSeparator = 58 +pkg os (linux-amd64-cgo), const PathSeparator = 47 +pkg os (linux-arm), const DevNull = "/dev/null" +pkg os (linux-arm), const O_APPEND = 1024 +pkg os (linux-arm), const O_CREATE = 64 +pkg os (linux-arm), const O_EXCL = 128 +pkg os (linux-arm), const O_SYNC = 4096 +pkg os (linux-arm), const O_TRUNC = 512 +pkg os (linux-arm), const PathListSeparator = 58 +pkg os (linux-arm), const PathSeparator = 47 +pkg os (linux-arm-cgo), const DevNull = "/dev/null" +pkg os (linux-arm-cgo), const O_APPEND = 1024 +pkg os (linux-arm-cgo), const O_CREATE = 64 +pkg os (linux-arm-cgo), const O_EXCL = 128 +pkg os (linux-arm-cgo), const O_SYNC = 4096 +pkg os (linux-arm-cgo), const O_TRUNC = 512 +pkg os (linux-arm-cgo), const PathListSeparator = 58 +pkg os (linux-arm-cgo), const PathSeparator = 47 +pkg os (netbsd-386), const DevNull = "/dev/null" +pkg os (netbsd-386), const O_APPEND = 8 +pkg os (netbsd-386), const O_CREATE = 512 +pkg os (netbsd-386), const O_EXCL = 2048 +pkg os (netbsd-386), const O_SYNC = 128 +pkg os (netbsd-386), const O_TRUNC = 1024 +pkg os (netbsd-386), const PathListSeparator = 58 +pkg os (netbsd-386), const PathSeparator = 47 +pkg os (netbsd-386-cgo), const DevNull = "/dev/null" +pkg os (netbsd-386-cgo), const O_APPEND = 8 +pkg os (netbsd-386-cgo), const O_CREATE = 512 +pkg os (netbsd-386-cgo), const O_EXCL = 2048 +pkg os (netbsd-386-cgo), const O_SYNC = 128 +pkg os (netbsd-386-cgo), const O_TRUNC = 1024 +pkg os (netbsd-386-cgo), const PathListSeparator = 58 +pkg os (netbsd-386-cgo), const PathSeparator = 47 +pkg os (netbsd-amd64), const DevNull = "/dev/null" +pkg os (netbsd-amd64), const O_APPEND = 8 +pkg os (netbsd-amd64), const O_CREATE = 512 +pkg os (netbsd-amd64), const O_EXCL = 2048 +pkg os (netbsd-amd64), const O_SYNC = 128 +pkg os (netbsd-amd64), const O_TRUNC = 1024 +pkg os (netbsd-amd64), const PathListSeparator = 58 +pkg os (netbsd-amd64), const PathSeparator = 47 +pkg os (netbsd-amd64-cgo), const DevNull = "/dev/null" +pkg os (netbsd-amd64-cgo), const O_APPEND = 8 +pkg os (netbsd-amd64-cgo), const O_CREATE = 512 +pkg os (netbsd-amd64-cgo), const O_EXCL = 2048 +pkg os (netbsd-amd64-cgo), const O_SYNC = 128 +pkg os (netbsd-amd64-cgo), const O_TRUNC = 1024 +pkg os (netbsd-amd64-cgo), const PathListSeparator = 58 +pkg os (netbsd-amd64-cgo), const PathSeparator = 47 +pkg os (netbsd-arm), const DevNull = "/dev/null" +pkg os (netbsd-arm), const O_APPEND = 8 +pkg os (netbsd-arm), const O_CREATE = 512 +pkg os (netbsd-arm), const O_EXCL = 2048 +pkg os (netbsd-arm), const O_SYNC = 128 +pkg os (netbsd-arm), const O_TRUNC = 1024 +pkg os (netbsd-arm), const PathListSeparator = 58 +pkg os (netbsd-arm), const PathSeparator = 47 +pkg os (netbsd-arm-cgo), const DevNull = "/dev/null" +pkg os (netbsd-arm-cgo), const O_APPEND = 8 +pkg os (netbsd-arm-cgo), const O_CREATE = 512 +pkg os (netbsd-arm-cgo), const O_EXCL = 2048 +pkg os (netbsd-arm-cgo), const O_SYNC = 128 +pkg os (netbsd-arm-cgo), const O_TRUNC = 1024 +pkg os (netbsd-arm-cgo), const PathListSeparator = 58 +pkg os (netbsd-arm-cgo), const PathSeparator = 47 +pkg os (openbsd-386), const DevNull = "/dev/null" +pkg os (openbsd-386), const O_APPEND = 8 +pkg os (openbsd-386), const O_CREATE = 512 +pkg os (openbsd-386), const O_EXCL = 2048 +pkg os (openbsd-386), const O_SYNC = 128 +pkg os (openbsd-386), const O_TRUNC = 1024 +pkg os (openbsd-386), const PathListSeparator = 58 +pkg os (openbsd-386), const PathSeparator = 47 +pkg os (openbsd-386-cgo), const DevNull = "/dev/null" +pkg os (openbsd-386-cgo), const O_APPEND = 8 +pkg os (openbsd-386-cgo), const O_CREATE = 512 +pkg os (openbsd-386-cgo), const O_EXCL = 2048 +pkg os (openbsd-386-cgo), const O_SYNC = 128 +pkg os (openbsd-386-cgo), const O_TRUNC = 1024 +pkg os (openbsd-386-cgo), const PathListSeparator = 58 +pkg os (openbsd-386-cgo), const PathSeparator = 47 +pkg os (openbsd-amd64), const DevNull = "/dev/null" +pkg os (openbsd-amd64), const O_APPEND = 8 +pkg os (openbsd-amd64), const O_CREATE = 512 +pkg os (openbsd-amd64), const O_EXCL = 2048 +pkg os (openbsd-amd64), const O_SYNC = 128 +pkg os (openbsd-amd64), const O_TRUNC = 1024 +pkg os (openbsd-amd64), const PathListSeparator = 58 +pkg os (openbsd-amd64), const PathSeparator = 47 +pkg os (openbsd-amd64-cgo), const DevNull = "/dev/null" +pkg os (openbsd-amd64-cgo), const O_APPEND = 8 +pkg os (openbsd-amd64-cgo), const O_CREATE = 512 +pkg os (openbsd-amd64-cgo), const O_EXCL = 2048 +pkg os (openbsd-amd64-cgo), const O_SYNC = 128 +pkg os (openbsd-amd64-cgo), const O_TRUNC = 1024 +pkg os (openbsd-amd64-cgo), const PathListSeparator = 58 +pkg os (openbsd-amd64-cgo), const PathSeparator = 47 +pkg os (windows-386), const DevNull = "NUL" +pkg os (windows-386), const O_APPEND = 1024 +pkg os (windows-386), const O_CREATE = 64 +pkg os (windows-386), const O_EXCL = 128 +pkg os (windows-386), const O_SYNC = 4096 +pkg os (windows-386), const O_TRUNC = 512 +pkg os (windows-386), const PathListSeparator = 59 +pkg os (windows-386), const PathSeparator = 92 +pkg os (windows-amd64), const DevNull = "NUL" +pkg os (windows-amd64), const O_APPEND = 1024 +pkg os (windows-amd64), const O_CREATE = 64 +pkg os (windows-amd64), const O_EXCL = 128 +pkg os (windows-amd64), const O_SYNC = 4096 +pkg os (windows-amd64), const O_TRUNC = 512 +pkg os (windows-amd64), const PathListSeparator = 59 +pkg os (windows-amd64), const PathSeparator = 92 +pkg os, const ModeAppend = 1073741824 +pkg os, const ModeCharDevice = 2097152 +pkg os, const ModeDevice = 67108864 +pkg os, const ModeDir = 2147483648 +pkg os, const ModeExclusive = 536870912 +pkg os, const ModeNamedPipe = 33554432 +pkg os, const ModePerm = 511 +pkg os, const ModeSetgid = 4194304 +pkg os, const ModeSetuid = 8388608 +pkg os, const ModeSocket = 16777216 +pkg os, const ModeSticky = 1048576 +pkg os, const ModeSymlink = 134217728 +pkg os, const ModeTemporary = 268435456 +pkg os, const ModeType = 2399141888 +pkg os, const O_RDONLY = 0 +pkg os, const O_RDWR = 2 +pkg os, const O_WRONLY = 1 +pkg os, const SEEK_CUR = 1 +pkg os, const SEEK_END = 2 +pkg os, const SEEK_SET = 0 +pkg os, method (FileMode) IsRegular() bool +pkg os/signal, func Stop(chan<- os.Signal) +pkg path/filepath (darwin-386), const ListSeparator = 58 +pkg path/filepath (darwin-386), const Separator = 47 +pkg path/filepath (darwin-386-cgo), const ListSeparator = 58 +pkg path/filepath (darwin-386-cgo), const Separator = 47 +pkg path/filepath (darwin-amd64), const ListSeparator = 58 +pkg path/filepath (darwin-amd64), const Separator = 47 +pkg path/filepath (darwin-amd64-cgo), const ListSeparator = 58 +pkg path/filepath (darwin-amd64-cgo), const Separator = 47 +pkg path/filepath (freebsd-386), const ListSeparator = 58 +pkg path/filepath (freebsd-386), const Separator = 47 +pkg path/filepath (freebsd-386-cgo), const ListSeparator = 58 +pkg path/filepath (freebsd-386-cgo), const Separator = 47 +pkg path/filepath (freebsd-amd64), const ListSeparator = 58 +pkg path/filepath (freebsd-amd64), const Separator = 47 +pkg path/filepath (freebsd-amd64-cgo), const ListSeparator = 58 +pkg path/filepath (freebsd-amd64-cgo), const Separator = 47 +pkg path/filepath (freebsd-arm), const ListSeparator = 58 +pkg path/filepath (freebsd-arm), const Separator = 47 +pkg path/filepath (freebsd-arm-cgo), const ListSeparator = 58 +pkg path/filepath (freebsd-arm-cgo), const Separator = 47 +pkg path/filepath (linux-386), const ListSeparator = 58 +pkg path/filepath (linux-386), const Separator = 47 +pkg path/filepath (linux-386-cgo), const ListSeparator = 58 +pkg path/filepath (linux-386-cgo), const Separator = 47 +pkg path/filepath (linux-amd64), const ListSeparator = 58 +pkg path/filepath (linux-amd64), const Separator = 47 +pkg path/filepath (linux-amd64-cgo), const ListSeparator = 58 +pkg path/filepath (linux-amd64-cgo), const Separator = 47 +pkg path/filepath (linux-arm), const ListSeparator = 58 +pkg path/filepath (linux-arm), const Separator = 47 +pkg path/filepath (linux-arm-cgo), const ListSeparator = 58 +pkg path/filepath (linux-arm-cgo), const Separator = 47 +pkg path/filepath (netbsd-386), const ListSeparator = 58 +pkg path/filepath (netbsd-386), const Separator = 47 +pkg path/filepath (netbsd-386-cgo), const ListSeparator = 58 +pkg path/filepath (netbsd-386-cgo), const Separator = 47 +pkg path/filepath (netbsd-amd64), const ListSeparator = 58 +pkg path/filepath (netbsd-amd64), const Separator = 47 +pkg path/filepath (netbsd-amd64-cgo), const ListSeparator = 58 +pkg path/filepath (netbsd-amd64-cgo), const Separator = 47 +pkg path/filepath (netbsd-arm), const ListSeparator = 58 +pkg path/filepath (netbsd-arm), const Separator = 47 +pkg path/filepath (netbsd-arm-cgo), const ListSeparator = 58 +pkg path/filepath (netbsd-arm-cgo), const Separator = 47 +pkg path/filepath (openbsd-386), const ListSeparator = 58 +pkg path/filepath (openbsd-386), const Separator = 47 +pkg path/filepath (openbsd-386-cgo), const ListSeparator = 58 +pkg path/filepath (openbsd-386-cgo), const Separator = 47 +pkg path/filepath (openbsd-amd64), const ListSeparator = 58 +pkg path/filepath (openbsd-amd64), const Separator = 47 +pkg path/filepath (openbsd-amd64-cgo), const ListSeparator = 58 +pkg path/filepath (openbsd-amd64-cgo), const Separator = 47 +pkg path/filepath (windows-386), const ListSeparator = 59 +pkg path/filepath (windows-386), const Separator = 92 +pkg path/filepath (windows-amd64), const ListSeparator = 59 +pkg path/filepath (windows-amd64), const Separator = 92 +pkg reflect, const Array = 17 +pkg reflect, const Bool = 1 +pkg reflect, const BothDir = 3 +pkg reflect, const Chan = 18 +pkg reflect, const Complex128 = 16 +pkg reflect, const Complex64 = 15 +pkg reflect, const Float32 = 13 +pkg reflect, const Float64 = 14 +pkg reflect, const Func = 19 +pkg reflect, const Int = 2 +pkg reflect, const Int16 = 4 +pkg reflect, const Int32 = 5 +pkg reflect, const Int64 = 6 +pkg reflect, const Int8 = 3 +pkg reflect, const Interface = 20 +pkg reflect, const Invalid = 0 +pkg reflect, const Map = 21 +pkg reflect, const Ptr = 22 +pkg reflect, const RecvDir = 1 +pkg reflect, const SelectDefault = 3 +pkg reflect, const SelectDefault SelectDir +pkg reflect, const SelectRecv = 2 +pkg reflect, const SelectRecv SelectDir +pkg reflect, const SelectSend = 1 +pkg reflect, const SelectSend SelectDir +pkg reflect, const SendDir = 2 +pkg reflect, const Slice = 23 +pkg reflect, const String = 24 +pkg reflect, const Struct = 25 +pkg reflect, const Uint = 7 +pkg reflect, const Uint16 = 9 +pkg reflect, const Uint32 = 10 +pkg reflect, const Uint64 = 11 +pkg reflect, const Uint8 = 8 +pkg reflect, const Uintptr = 12 +pkg reflect, const UnsafePointer = 26 +pkg reflect, func ChanOf(ChanDir, Type) Type +pkg reflect, func MakeFunc(Type, func([]Value) []Value) Value +pkg reflect, func MapOf(Type, Type) Type +pkg reflect, func Select([]SelectCase) (int, Value, bool) +pkg reflect, func SliceOf(Type) Type +pkg reflect, method (Value) Convert(Type) Value +pkg reflect, type SelectCase struct +pkg reflect, type SelectCase struct, Chan Value +pkg reflect, type SelectCase struct, Dir SelectDir +pkg reflect, type SelectCase struct, Send Value +pkg reflect, type SelectDir int +pkg reflect, type Type interface, ConvertibleTo(Type) bool +pkg regexp, method (*Regexp) Longest() +pkg regexp, method (*Regexp) Split(string, int) []string +pkg regexp/syntax, const ClassNL = 4 +pkg regexp/syntax, const DotNL = 8 +pkg regexp/syntax, const EmptyBeginLine = 1 +pkg regexp/syntax, const EmptyBeginText = 4 +pkg regexp/syntax, const EmptyEndLine = 2 +pkg regexp/syntax, const EmptyEndText = 8 +pkg regexp/syntax, const EmptyNoWordBoundary = 32 +pkg regexp/syntax, const EmptyWordBoundary = 16 +pkg regexp/syntax, const ErrInternalError = "regexp/syntax: internal error" +pkg regexp/syntax, const ErrInvalidCharClass = "invalid character class" +pkg regexp/syntax, const ErrInvalidCharRange = "invalid character class range" +pkg regexp/syntax, const ErrInvalidEscape = "invalid escape sequence" +pkg regexp/syntax, const ErrInvalidNamedCapture = "invalid named capture" +pkg regexp/syntax, const ErrInvalidPerlOp = "invalid or unsupported Perl syntax" +pkg regexp/syntax, const ErrInvalidRepeatOp = "invalid nested repetition operator" +pkg regexp/syntax, const ErrInvalidRepeatSize = "invalid repeat count" +pkg regexp/syntax, const ErrInvalidUTF8 = "invalid UTF-8" +pkg regexp/syntax, const ErrMissingBracket = "missing closing ]" +pkg regexp/syntax, const ErrMissingParen = "missing closing )" +pkg regexp/syntax, const ErrMissingRepeatArgument = "missing argument to repetition operator" +pkg regexp/syntax, const ErrTrailingBackslash = "trailing backslash at end of expression" +pkg regexp/syntax, const ErrUnexpectedParen = "unexpected )" +pkg regexp/syntax, const ErrUnexpectedParen ErrorCode +pkg regexp/syntax, const FoldCase = 1 +pkg regexp/syntax, const InstAlt = 0 +pkg regexp/syntax, const InstAltMatch = 1 +pkg regexp/syntax, const InstCapture = 2 +pkg regexp/syntax, const InstEmptyWidth = 3 +pkg regexp/syntax, const InstFail = 5 +pkg regexp/syntax, const InstMatch = 4 +pkg regexp/syntax, const InstNop = 6 +pkg regexp/syntax, const InstRune = 7 +pkg regexp/syntax, const InstRune1 = 8 +pkg regexp/syntax, const InstRuneAny = 9 +pkg regexp/syntax, const InstRuneAnyNotNL = 10 +pkg regexp/syntax, const Literal = 2 +pkg regexp/syntax, const MatchNL = 12 +pkg regexp/syntax, const NonGreedy = 32 +pkg regexp/syntax, const OneLine = 16 +pkg regexp/syntax, const OpAlternate = 19 +pkg regexp/syntax, const OpAnyChar = 6 +pkg regexp/syntax, const OpAnyCharNotNL = 5 +pkg regexp/syntax, const OpBeginLine = 7 +pkg regexp/syntax, const OpBeginText = 9 +pkg regexp/syntax, const OpCapture = 13 +pkg regexp/syntax, const OpCharClass = 4 +pkg regexp/syntax, const OpConcat = 18 +pkg regexp/syntax, const OpEmptyMatch = 2 +pkg regexp/syntax, const OpEndLine = 8 +pkg regexp/syntax, const OpEndText = 10 +pkg regexp/syntax, const OpLiteral = 3 +pkg regexp/syntax, const OpNoMatch = 1 +pkg regexp/syntax, const OpNoWordBoundary = 12 +pkg regexp/syntax, const OpPlus = 15 +pkg regexp/syntax, const OpQuest = 16 +pkg regexp/syntax, const OpRepeat = 17 +pkg regexp/syntax, const OpStar = 14 +pkg regexp/syntax, const OpWordBoundary = 11 +pkg regexp/syntax, const POSIX = 0 +pkg regexp/syntax, const Perl = 212 +pkg regexp/syntax, const PerlX = 64 +pkg regexp/syntax, const Simple = 512 +pkg regexp/syntax, const UnicodeGroups = 128 +pkg regexp/syntax, const WasDollar = 256 +pkg runtime (darwin-386), const GOARCH = "386" +pkg runtime (darwin-386), const GOOS = "darwin" +pkg runtime (darwin-386-cgo), const GOARCH = "386" +pkg runtime (darwin-386-cgo), const GOOS = "darwin" +pkg runtime (darwin-amd64), const GOARCH = "amd64" +pkg runtime (darwin-amd64), const GOOS = "darwin" +pkg runtime (darwin-amd64-cgo), const GOARCH = "amd64" +pkg runtime (darwin-amd64-cgo), const GOOS = "darwin" +pkg runtime (freebsd-386), const GOARCH = "386" +pkg runtime (freebsd-386), const GOOS = "freebsd" +pkg runtime (freebsd-386-cgo), const GOARCH = "386" +pkg runtime (freebsd-386-cgo), const GOOS = "freebsd" +pkg runtime (freebsd-amd64), const GOARCH = "amd64" +pkg runtime (freebsd-amd64), const GOOS = "freebsd" +pkg runtime (freebsd-amd64-cgo), const GOARCH = "amd64" +pkg runtime (freebsd-amd64-cgo), const GOOS = "freebsd" +pkg runtime (freebsd-arm), const GOARCH = "arm" +pkg runtime (freebsd-arm), const GOOS = "freebsd" +pkg runtime (freebsd-arm-cgo), const GOARCH = "arm" +pkg runtime (freebsd-arm-cgo), const GOOS = "freebsd" +pkg runtime (linux-386), const GOARCH = "386" +pkg runtime (linux-386), const GOOS = "linux" +pkg runtime (linux-386-cgo), const GOARCH = "386" +pkg runtime (linux-386-cgo), const GOOS = "linux" +pkg runtime (linux-amd64), const GOARCH = "amd64" +pkg runtime (linux-amd64), const GOOS = "linux" +pkg runtime (linux-amd64-cgo), const GOARCH = "amd64" +pkg runtime (linux-amd64-cgo), const GOOS = "linux" +pkg runtime (linux-arm), const GOARCH = "arm" +pkg runtime (linux-arm), const GOOS = "linux" +pkg runtime (linux-arm-cgo), const GOARCH = "arm" +pkg runtime (linux-arm-cgo), const GOOS = "linux" +pkg runtime (netbsd-386), const GOARCH = "386" +pkg runtime (netbsd-386), const GOOS = "netbsd" +pkg runtime (netbsd-386-cgo), const GOARCH = "386" +pkg runtime (netbsd-386-cgo), const GOOS = "netbsd" +pkg runtime (netbsd-amd64), const GOARCH = "amd64" +pkg runtime (netbsd-amd64), const GOOS = "netbsd" +pkg runtime (netbsd-amd64-cgo), const GOARCH = "amd64" +pkg runtime (netbsd-amd64-cgo), const GOOS = "netbsd" +pkg runtime (netbsd-arm), const GOARCH = "arm" +pkg runtime (netbsd-arm), const GOOS = "netbsd" +pkg runtime (netbsd-arm-cgo), const GOARCH = "arm" +pkg runtime (netbsd-arm-cgo), const GOOS = "netbsd" +pkg runtime (openbsd-386), const GOARCH = "386" +pkg runtime (openbsd-386), const GOOS = "openbsd" +pkg runtime (openbsd-386-cgo), const GOARCH = "386" +pkg runtime (openbsd-386-cgo), const GOOS = "openbsd" +pkg runtime (openbsd-amd64), const GOARCH = "amd64" +pkg runtime (openbsd-amd64), const GOOS = "openbsd" +pkg runtime (openbsd-amd64-cgo), const GOARCH = "amd64" +pkg runtime (openbsd-amd64-cgo), const GOOS = "openbsd" +pkg runtime (windows-386), const GOARCH = "386" +pkg runtime (windows-386), const GOOS = "windows" +pkg runtime (windows-amd64), const GOARCH = "amd64" +pkg runtime (windows-amd64), const GOOS = "windows" +pkg runtime, const Compiler = "gc" +pkg runtime, func BlockProfile([]BlockProfileRecord) (int, bool) +pkg runtime, func SetBlockProfileRate(int) +pkg runtime, method (*BlockProfileRecord) Stack() []uintptr +pkg runtime, type BlockProfileRecord struct +pkg runtime, type BlockProfileRecord struct, Count int64 +pkg runtime, type BlockProfileRecord struct, Cycles int64 +pkg runtime, type BlockProfileRecord struct, embedded StackRecord +pkg runtime/debug, func FreeOSMemory() +pkg runtime/debug, func ReadGCStats(*GCStats) +pkg runtime/debug, func SetGCPercent(int) int +pkg runtime/debug, type GCStats struct +pkg runtime/debug, type GCStats struct, LastGC time.Time +pkg runtime/debug, type GCStats struct, NumGC int64 +pkg runtime/debug, type GCStats struct, Pause []time.Duration +pkg runtime/debug, type GCStats struct, PauseQuantiles []time.Duration +pkg runtime/debug, type GCStats struct, PauseTotal time.Duration +pkg sort, func Reverse(Interface) Interface +pkg strconv, const IntSize = 64 +pkg strings, func TrimPrefix(string, string) string +pkg strings, func TrimSuffix(string, string) string +pkg strings, method (*Reader) WriteTo(io.Writer) (int64, error) +pkg syscall (darwin-386), const AF_APPLETALK = 16 +pkg syscall (darwin-386), const AF_CCITT = 10 +pkg syscall (darwin-386), const AF_CHAOS = 5 +pkg syscall (darwin-386), const AF_CNT = 21 +pkg syscall (darwin-386), const AF_COIP = 20 +pkg syscall (darwin-386), const AF_DATAKIT = 9 +pkg syscall (darwin-386), const AF_DECnet = 12 +pkg syscall (darwin-386), const AF_DLI = 13 +pkg syscall (darwin-386), const AF_E164 = 28 +pkg syscall (darwin-386), const AF_ECMA = 8 +pkg syscall (darwin-386), const AF_HYLINK = 15 +pkg syscall (darwin-386), const AF_IEEE80211 = 37 +pkg syscall (darwin-386), const AF_IMPLINK = 3 +pkg syscall (darwin-386), const AF_INET6 = 30 +pkg syscall (darwin-386), const AF_IPX = 23 +pkg syscall (darwin-386), const AF_ISDN = 28 +pkg syscall (darwin-386), const AF_ISO = 7 +pkg syscall (darwin-386), const AF_LAT = 14 +pkg syscall (darwin-386), const AF_LINK = 18 +pkg syscall (darwin-386), const AF_LOCAL = 1 +pkg syscall (darwin-386), const AF_MAX = 38 +pkg syscall (darwin-386), const AF_NATM = 31 +pkg syscall (darwin-386), const AF_NDRV = 27 +pkg syscall (darwin-386), const AF_NETBIOS = 33 +pkg syscall (darwin-386), const AF_NS = 6 +pkg syscall (darwin-386), const AF_OSI = 7 +pkg syscall (darwin-386), const AF_PPP = 34 +pkg syscall (darwin-386), const AF_PUP = 4 +pkg syscall (darwin-386), const AF_RESERVED_36 = 36 +pkg syscall (darwin-386), const AF_ROUTE = 17 +pkg syscall (darwin-386), const AF_SIP = 24 +pkg syscall (darwin-386), const AF_SNA = 11 +pkg syscall (darwin-386), const AF_SYSTEM = 32 +pkg syscall (darwin-386), const B0 = 0 +pkg syscall (darwin-386), const B0 ideal-int +pkg syscall (darwin-386), const B110 = 110 +pkg syscall (darwin-386), const B110 ideal-int +pkg syscall (darwin-386), const B115200 = 115200 +pkg syscall (darwin-386), const B115200 ideal-int +pkg syscall (darwin-386), const B1200 = 1200 +pkg syscall (darwin-386), const B1200 ideal-int +pkg syscall (darwin-386), const B134 = 134 +pkg syscall (darwin-386), const B134 ideal-int +pkg syscall (darwin-386), const B14400 = 14400 +pkg syscall (darwin-386), const B14400 ideal-int +pkg syscall (darwin-386), const B150 = 150 +pkg syscall (darwin-386), const B150 ideal-int +pkg syscall (darwin-386), const B1800 = 1800 +pkg syscall (darwin-386), const B1800 ideal-int +pkg syscall (darwin-386), const B19200 = 19200 +pkg syscall (darwin-386), const B19200 ideal-int +pkg syscall (darwin-386), const B200 = 200 +pkg syscall (darwin-386), const B200 ideal-int +pkg syscall (darwin-386), const B230400 = 230400 +pkg syscall (darwin-386), const B230400 ideal-int +pkg syscall (darwin-386), const B2400 = 2400 +pkg syscall (darwin-386), const B2400 ideal-int +pkg syscall (darwin-386), const B28800 = 28800 +pkg syscall (darwin-386), const B28800 ideal-int +pkg syscall (darwin-386), const B300 = 300 +pkg syscall (darwin-386), const B300 ideal-int +pkg syscall (darwin-386), const B38400 = 38400 +pkg syscall (darwin-386), const B38400 ideal-int +pkg syscall (darwin-386), const B4800 = 4800 +pkg syscall (darwin-386), const B4800 ideal-int +pkg syscall (darwin-386), const B50 = 50 +pkg syscall (darwin-386), const B50 ideal-int +pkg syscall (darwin-386), const B57600 = 57600 +pkg syscall (darwin-386), const B57600 ideal-int +pkg syscall (darwin-386), const B600 = 600 +pkg syscall (darwin-386), const B600 ideal-int +pkg syscall (darwin-386), const B7200 = 7200 +pkg syscall (darwin-386), const B7200 ideal-int +pkg syscall (darwin-386), const B75 = 75 +pkg syscall (darwin-386), const B75 ideal-int +pkg syscall (darwin-386), const B76800 = 76800 +pkg syscall (darwin-386), const B76800 ideal-int +pkg syscall (darwin-386), const B9600 = 9600 +pkg syscall (darwin-386), const B9600 ideal-int +pkg syscall (darwin-386), const BIOCFLUSH = 536887912 +pkg syscall (darwin-386), const BIOCGBLEN = 1074020966 +pkg syscall (darwin-386), const BIOCGDLT = 1074020970 +pkg syscall (darwin-386), const BIOCGDLTLIST = 3222028921 +pkg syscall (darwin-386), const BIOCGETIF = 1075855979 +pkg syscall (darwin-386), const BIOCGHDRCMPLT = 1074020980 +pkg syscall (darwin-386), const BIOCGRSIG = 1074020978 +pkg syscall (darwin-386), const BIOCGRTIMEOUT = 1074283118 +pkg syscall (darwin-386), const BIOCGSEESENT = 1074020982 +pkg syscall (darwin-386), const BIOCGSTATS = 1074283119 +pkg syscall (darwin-386), const BIOCIMMEDIATE = 2147762800 +pkg syscall (darwin-386), const BIOCPROMISC = 536887913 +pkg syscall (darwin-386), const BIOCSBLEN = 3221504614 +pkg syscall (darwin-386), const BIOCSDLT = 2147762808 +pkg syscall (darwin-386), const BIOCSETF = 2148024935 +pkg syscall (darwin-386), const BIOCSETIF = 2149597804 +pkg syscall (darwin-386), const BIOCSHDRCMPLT = 2147762805 +pkg syscall (darwin-386), const BIOCSRSIG = 2147762803 +pkg syscall (darwin-386), const BIOCSRTIMEOUT = 2148024941 +pkg syscall (darwin-386), const BIOCSSEESENT = 2147762807 +pkg syscall (darwin-386), const BIOCVERSION = 1074020977 +pkg syscall (darwin-386), const BPF_A = 16 +pkg syscall (darwin-386), const BPF_ABS = 32 +pkg syscall (darwin-386), const BPF_ADD = 0 +pkg syscall (darwin-386), const BPF_ALIGNMENT = 4 +pkg syscall (darwin-386), const BPF_ALU = 4 +pkg syscall (darwin-386), const BPF_AND = 80 +pkg syscall (darwin-386), const BPF_B = 16 +pkg syscall (darwin-386), const BPF_DIV = 48 +pkg syscall (darwin-386), const BPF_H = 8 +pkg syscall (darwin-386), const BPF_IMM = 0 +pkg syscall (darwin-386), const BPF_IND = 64 +pkg syscall (darwin-386), const BPF_JA = 0 +pkg syscall (darwin-386), const BPF_JEQ = 16 +pkg syscall (darwin-386), const BPF_JGE = 48 +pkg syscall (darwin-386), const BPF_JGT = 32 +pkg syscall (darwin-386), const BPF_JMP = 5 +pkg syscall (darwin-386), const BPF_JSET = 64 +pkg syscall (darwin-386), const BPF_K = 0 +pkg syscall (darwin-386), const BPF_LD = 0 +pkg syscall (darwin-386), const BPF_LDX = 1 +pkg syscall (darwin-386), const BPF_LEN = 128 +pkg syscall (darwin-386), const BPF_LSH = 96 +pkg syscall (darwin-386), const BPF_MAJOR_VERSION = 1 +pkg syscall (darwin-386), const BPF_MAXBUFSIZE = 524288 +pkg syscall (darwin-386), const BPF_MAXINSNS = 512 +pkg syscall (darwin-386), const BPF_MEM = 96 +pkg syscall (darwin-386), const BPF_MEMWORDS = 16 +pkg syscall (darwin-386), const BPF_MINBUFSIZE = 32 +pkg syscall (darwin-386), const BPF_MINOR_VERSION = 1 +pkg syscall (darwin-386), const BPF_MISC = 7 +pkg syscall (darwin-386), const BPF_MSH = 160 +pkg syscall (darwin-386), const BPF_MUL = 32 +pkg syscall (darwin-386), const BPF_NEG = 128 +pkg syscall (darwin-386), const BPF_OR = 64 +pkg syscall (darwin-386), const BPF_RELEASE = 199606 +pkg syscall (darwin-386), const BPF_RET = 6 +pkg syscall (darwin-386), const BPF_RSH = 112 +pkg syscall (darwin-386), const BPF_ST = 2 +pkg syscall (darwin-386), const BPF_STX = 3 +pkg syscall (darwin-386), const BPF_SUB = 16 +pkg syscall (darwin-386), const BPF_TAX = 0 +pkg syscall (darwin-386), const BPF_TXA = 128 +pkg syscall (darwin-386), const BPF_W = 0 +pkg syscall (darwin-386), const BPF_X = 8 +pkg syscall (darwin-386), const BRKINT = 2 +pkg syscall (darwin-386), const BRKINT ideal-int +pkg syscall (darwin-386), const CFLUSH = 15 +pkg syscall (darwin-386), const CFLUSH ideal-int +pkg syscall (darwin-386), const CLOCAL = 32768 +pkg syscall (darwin-386), const CLOCAL ideal-int +pkg syscall (darwin-386), const CREAD = 2048 +pkg syscall (darwin-386), const CREAD ideal-int +pkg syscall (darwin-386), const CS5 = 0 +pkg syscall (darwin-386), const CS5 ideal-int +pkg syscall (darwin-386), const CS6 = 256 +pkg syscall (darwin-386), const CS6 ideal-int +pkg syscall (darwin-386), const CS7 = 512 +pkg syscall (darwin-386), const CS7 ideal-int +pkg syscall (darwin-386), const CS8 = 768 +pkg syscall (darwin-386), const CS8 ideal-int +pkg syscall (darwin-386), const CSIZE = 768 +pkg syscall (darwin-386), const CSIZE ideal-int +pkg syscall (darwin-386), const CSTART = 17 +pkg syscall (darwin-386), const CSTART ideal-int +pkg syscall (darwin-386), const CSTATUS = 20 +pkg syscall (darwin-386), const CSTATUS ideal-int +pkg syscall (darwin-386), const CSTOP = 19 +pkg syscall (darwin-386), const CSTOP ideal-int +pkg syscall (darwin-386), const CSTOPB = 1024 +pkg syscall (darwin-386), const CSTOPB ideal-int +pkg syscall (darwin-386), const CSUSP = 26 +pkg syscall (darwin-386), const CSUSP ideal-int +pkg syscall (darwin-386), const CTL_MAXNAME = 12 +pkg syscall (darwin-386), const CTL_NET = 4 +pkg syscall (darwin-386), const DLT_APPLE_IP_OVER_IEEE1394 = 138 +pkg syscall (darwin-386), const DLT_ARCNET = 7 +pkg syscall (darwin-386), const DLT_ATM_CLIP = 19 +pkg syscall (darwin-386), const DLT_ATM_RFC1483 = 11 +pkg syscall (darwin-386), const DLT_AX25 = 3 +pkg syscall (darwin-386), const DLT_CHAOS = 5 +pkg syscall (darwin-386), const DLT_CHDLC = 104 +pkg syscall (darwin-386), const DLT_C_HDLC = 104 +pkg syscall (darwin-386), const DLT_EN10MB = 1 +pkg syscall (darwin-386), const DLT_EN3MB = 2 +pkg syscall (darwin-386), const DLT_FDDI = 10 +pkg syscall (darwin-386), const DLT_IEEE802 = 6 +pkg syscall (darwin-386), const DLT_IEEE802_11 = 105 +pkg syscall (darwin-386), const DLT_IEEE802_11_RADIO = 127 +pkg syscall (darwin-386), const DLT_IEEE802_11_RADIO_AVS = 163 +pkg syscall (darwin-386), const DLT_LINUX_SLL = 113 +pkg syscall (darwin-386), const DLT_LOOP = 108 +pkg syscall (darwin-386), const DLT_NULL = 0 +pkg syscall (darwin-386), const DLT_PFLOG = 117 +pkg syscall (darwin-386), const DLT_PFSYNC = 18 +pkg syscall (darwin-386), const DLT_PPP = 9 +pkg syscall (darwin-386), const DLT_PPP_BSDOS = 16 +pkg syscall (darwin-386), const DLT_PPP_SERIAL = 50 +pkg syscall (darwin-386), const DLT_PRONET = 4 +pkg syscall (darwin-386), const DLT_RAW = 12 +pkg syscall (darwin-386), const DLT_SLIP = 8 +pkg syscall (darwin-386), const DLT_SLIP_BSDOS = 15 +pkg syscall (darwin-386), const DT_BLK = 6 +pkg syscall (darwin-386), const DT_CHR = 2 +pkg syscall (darwin-386), const DT_DIR = 4 +pkg syscall (darwin-386), const DT_FIFO = 1 +pkg syscall (darwin-386), const DT_LNK = 10 +pkg syscall (darwin-386), const DT_REG = 8 +pkg syscall (darwin-386), const DT_SOCK = 12 +pkg syscall (darwin-386), const DT_UNKNOWN = 0 +pkg syscall (darwin-386), const DT_WHT = 14 +pkg syscall (darwin-386), const E2BIG = 7 +pkg syscall (darwin-386), const EACCES = 13 +pkg syscall (darwin-386), const EADDRINUSE = 48 +pkg syscall (darwin-386), const EADDRNOTAVAIL = 49 +pkg syscall (darwin-386), const EAFNOSUPPORT = 47 +pkg syscall (darwin-386), const EAGAIN = 35 +pkg syscall (darwin-386), const EALREADY = 37 +pkg syscall (darwin-386), const EAUTH = 80 +pkg syscall (darwin-386), const EBADARCH = 86 +pkg syscall (darwin-386), const EBADEXEC = 85 +pkg syscall (darwin-386), const EBADF = 9 +pkg syscall (darwin-386), const EBADMACHO = 88 +pkg syscall (darwin-386), const EBADMSG = 94 +pkg syscall (darwin-386), const EBADRPC = 72 +pkg syscall (darwin-386), const EBUSY = 16 +pkg syscall (darwin-386), const ECANCELED = 89 +pkg syscall (darwin-386), const ECHILD = 10 +pkg syscall (darwin-386), const ECHO = 8 +pkg syscall (darwin-386), const ECHOCTL = 64 +pkg syscall (darwin-386), const ECHOE = 2 +pkg syscall (darwin-386), const ECHOK = 4 +pkg syscall (darwin-386), const ECHOKE = 1 +pkg syscall (darwin-386), const ECHONL = 16 +pkg syscall (darwin-386), const ECHOPRT = 32 +pkg syscall (darwin-386), const ECONNABORTED = 53 +pkg syscall (darwin-386), const ECONNREFUSED = 61 +pkg syscall (darwin-386), const ECONNRESET = 54 +pkg syscall (darwin-386), const EDEADLK = 11 +pkg syscall (darwin-386), const EDESTADDRREQ = 39 +pkg syscall (darwin-386), const EDEVERR = 83 +pkg syscall (darwin-386), const EDOM = 33 +pkg syscall (darwin-386), const EDQUOT = 69 +pkg syscall (darwin-386), const EEXIST = 17 +pkg syscall (darwin-386), const EFAULT = 14 +pkg syscall (darwin-386), const EFBIG = 27 +pkg syscall (darwin-386), const EFTYPE = 79 +pkg syscall (darwin-386), const EHOSTDOWN = 64 +pkg syscall (darwin-386), const EHOSTUNREACH = 65 +pkg syscall (darwin-386), const EIDRM = 90 +pkg syscall (darwin-386), const EILSEQ = 92 +pkg syscall (darwin-386), const EINPROGRESS = 36 +pkg syscall (darwin-386), const EINTR = 4 +pkg syscall (darwin-386), const EINVAL = 22 +pkg syscall (darwin-386), const EIO = 5 +pkg syscall (darwin-386), const EISCONN = 56 +pkg syscall (darwin-386), const EISDIR = 21 +pkg syscall (darwin-386), const ELAST = 105 +pkg syscall (darwin-386), const ELOOP = 62 +pkg syscall (darwin-386), const EMFILE = 24 +pkg syscall (darwin-386), const EMLINK = 31 +pkg syscall (darwin-386), const EMSGSIZE = 40 +pkg syscall (darwin-386), const EMULTIHOP = 95 +pkg syscall (darwin-386), const ENAMETOOLONG = 63 +pkg syscall (darwin-386), const ENEEDAUTH = 81 +pkg syscall (darwin-386), const ENETDOWN = 50 +pkg syscall (darwin-386), const ENETRESET = 52 +pkg syscall (darwin-386), const ENETUNREACH = 51 +pkg syscall (darwin-386), const ENFILE = 23 +pkg syscall (darwin-386), const ENOATTR = 93 +pkg syscall (darwin-386), const ENOBUFS = 55 +pkg syscall (darwin-386), const ENODATA = 96 +pkg syscall (darwin-386), const ENODEV = 19 +pkg syscall (darwin-386), const ENOEXEC = 8 +pkg syscall (darwin-386), const ENOLCK = 77 +pkg syscall (darwin-386), const ENOLINK = 97 +pkg syscall (darwin-386), const ENOMEM = 12 +pkg syscall (darwin-386), const ENOMSG = 91 +pkg syscall (darwin-386), const ENOPOLICY = 103 +pkg syscall (darwin-386), const ENOPROTOOPT = 42 +pkg syscall (darwin-386), const ENOSPC = 28 +pkg syscall (darwin-386), const ENOSR = 98 +pkg syscall (darwin-386), const ENOSTR = 99 +pkg syscall (darwin-386), const ENOSYS = 78 +pkg syscall (darwin-386), const ENOTBLK = 15 +pkg syscall (darwin-386), const ENOTCONN = 57 +pkg syscall (darwin-386), const ENOTDIR = 20 +pkg syscall (darwin-386), const ENOTEMPTY = 66 +pkg syscall (darwin-386), const ENOTRECOVERABLE = 104 +pkg syscall (darwin-386), const ENOTSOCK = 38 +pkg syscall (darwin-386), const ENOTSUP = 45 +pkg syscall (darwin-386), const ENOTTY = 25 +pkg syscall (darwin-386), const ENXIO = 6 +pkg syscall (darwin-386), const EOPNOTSUPP = 102 +pkg syscall (darwin-386), const EOVERFLOW = 84 +pkg syscall (darwin-386), const EOWNERDEAD = 105 +pkg syscall (darwin-386), const EPERM = 1 +pkg syscall (darwin-386), const EPFNOSUPPORT = 46 +pkg syscall (darwin-386), const EPIPE = 32 +pkg syscall (darwin-386), const EPROCLIM = 67 +pkg syscall (darwin-386), const EPROCUNAVAIL = 76 +pkg syscall (darwin-386), const EPROGMISMATCH = 75 +pkg syscall (darwin-386), const EPROGUNAVAIL = 74 +pkg syscall (darwin-386), const EPROTO = 100 +pkg syscall (darwin-386), const EPROTONOSUPPORT = 43 +pkg syscall (darwin-386), const EPROTOTYPE = 41 +pkg syscall (darwin-386), const EPWROFF = 82 +pkg syscall (darwin-386), const ERANGE = 34 +pkg syscall (darwin-386), const EREMOTE = 71 +pkg syscall (darwin-386), const EROFS = 30 +pkg syscall (darwin-386), const ERPCMISMATCH = 73 +pkg syscall (darwin-386), const ESHLIBVERS = 87 +pkg syscall (darwin-386), const ESHUTDOWN = 58 +pkg syscall (darwin-386), const ESOCKTNOSUPPORT = 44 +pkg syscall (darwin-386), const ESPIPE = 29 +pkg syscall (darwin-386), const ESRCH = 3 +pkg syscall (darwin-386), const ESTALE = 70 +pkg syscall (darwin-386), const ETIME = 101 +pkg syscall (darwin-386), const ETIMEDOUT = 60 +pkg syscall (darwin-386), const ETOOMANYREFS = 59 +pkg syscall (darwin-386), const ETXTBSY = 26 +pkg syscall (darwin-386), const EUSERS = 68 +pkg syscall (darwin-386), const EVFILT_AIO = -3 +pkg syscall (darwin-386), const EVFILT_FS = -9 +pkg syscall (darwin-386), const EVFILT_MACHPORT = -8 +pkg syscall (darwin-386), const EVFILT_PROC = -5 +pkg syscall (darwin-386), const EVFILT_READ = -1 +pkg syscall (darwin-386), const EVFILT_SIGNAL = -6 +pkg syscall (darwin-386), const EVFILT_SYSCOUNT = 12 +pkg syscall (darwin-386), const EVFILT_THREADMARKER = 12 +pkg syscall (darwin-386), const EVFILT_TIMER = -7 +pkg syscall (darwin-386), const EVFILT_USER = -10 +pkg syscall (darwin-386), const EVFILT_VM = -12 +pkg syscall (darwin-386), const EVFILT_VNODE = -4 +pkg syscall (darwin-386), const EVFILT_WRITE = -2 +pkg syscall (darwin-386), const EV_ADD = 1 +pkg syscall (darwin-386), const EV_CLEAR = 32 +pkg syscall (darwin-386), const EV_DELETE = 2 +pkg syscall (darwin-386), const EV_DISABLE = 8 +pkg syscall (darwin-386), const EV_DISPATCH = 128 +pkg syscall (darwin-386), const EV_ENABLE = 4 +pkg syscall (darwin-386), const EV_EOF = 32768 +pkg syscall (darwin-386), const EV_ERROR = 16384 +pkg syscall (darwin-386), const EV_FLAG0 = 4096 +pkg syscall (darwin-386), const EV_FLAG1 = 8192 +pkg syscall (darwin-386), const EV_ONESHOT = 16 +pkg syscall (darwin-386), const EV_OOBAND = 8192 +pkg syscall (darwin-386), const EV_POLL = 4096 +pkg syscall (darwin-386), const EV_RECEIPT = 64 +pkg syscall (darwin-386), const EV_SYSFLAGS = 61440 +pkg syscall (darwin-386), const EWOULDBLOCK = 35 +pkg syscall (darwin-386), const EXDEV = 18 +pkg syscall (darwin-386), const EXTA = 19200 +pkg syscall (darwin-386), const EXTB = 38400 +pkg syscall (darwin-386), const EXTPROC = 2048 +pkg syscall (darwin-386), const FD_CLOEXEC = 1 +pkg syscall (darwin-386), const FD_SETSIZE = 1024 +pkg syscall (darwin-386), const FLUSHO = 8388608 +pkg syscall (darwin-386), const FLUSHO ideal-int +pkg syscall (darwin-386), const F_ADDFILESIGS = 61 +pkg syscall (darwin-386), const F_ADDSIGS = 59 +pkg syscall (darwin-386), const F_ALLOCATEALL = 4 +pkg syscall (darwin-386), const F_ALLOCATECONTIG = 2 +pkg syscall (darwin-386), const F_CHKCLEAN = 41 +pkg syscall (darwin-386), const F_DUPFD = 0 +pkg syscall (darwin-386), const F_DUPFD_CLOEXEC = 67 +pkg syscall (darwin-386), const F_FLUSH_DATA = 40 +pkg syscall (darwin-386), const F_FREEZE_FS = 53 +pkg syscall (darwin-386), const F_FULLFSYNC = 51 +pkg syscall (darwin-386), const F_GETFD = 1 +pkg syscall (darwin-386), const F_GETFL = 3 +pkg syscall (darwin-386), const F_GETLK = 7 +pkg syscall (darwin-386), const F_GETLKPID = 66 +pkg syscall (darwin-386), const F_GETNOSIGPIPE = 74 +pkg syscall (darwin-386), const F_GETOWN = 5 +pkg syscall (darwin-386), const F_GETPATH = 50 +pkg syscall (darwin-386), const F_GETPATH_MTMINFO = 71 +pkg syscall (darwin-386), const F_GETPROTECTIONCLASS = 63 +pkg syscall (darwin-386), const F_GLOBAL_NOCACHE = 55 +pkg syscall (darwin-386), const F_LOG2PHYS = 49 +pkg syscall (darwin-386), const F_LOG2PHYS_EXT = 65 +pkg syscall (darwin-386), const F_MARKDEPENDENCY = 60 +pkg syscall (darwin-386), const F_NOCACHE = 48 +pkg syscall (darwin-386), const F_NODIRECT = 62 +pkg syscall (darwin-386), const F_OK = 0 +pkg syscall (darwin-386), const F_PATHPKG_CHECK = 52 +pkg syscall (darwin-386), const F_PEOFPOSMODE = 3 +pkg syscall (darwin-386), const F_PREALLOCATE = 42 +pkg syscall (darwin-386), const F_RDADVISE = 44 +pkg syscall (darwin-386), const F_RDAHEAD = 45 +pkg syscall (darwin-386), const F_RDLCK = 1 +pkg syscall (darwin-386), const F_READBOOTSTRAP = 46 +pkg syscall (darwin-386), const F_SETBACKINGSTORE = 70 +pkg syscall (darwin-386), const F_SETFD = 2 +pkg syscall (darwin-386), const F_SETFL = 4 +pkg syscall (darwin-386), const F_SETLK = 8 +pkg syscall (darwin-386), const F_SETLKW = 9 +pkg syscall (darwin-386), const F_SETNOSIGPIPE = 73 +pkg syscall (darwin-386), const F_SETOWN = 6 +pkg syscall (darwin-386), const F_SETPROTECTIONCLASS = 64 +pkg syscall (darwin-386), const F_SETSIZE = 43 +pkg syscall (darwin-386), const F_THAW_FS = 54 +pkg syscall (darwin-386), const F_UNLCK = 2 +pkg syscall (darwin-386), const F_VOLPOSMODE = 4 +pkg syscall (darwin-386), const F_WRITEBOOTSTRAP = 47 +pkg syscall (darwin-386), const F_WRLCK = 3 +pkg syscall (darwin-386), const HUPCL = 16384 +pkg syscall (darwin-386), const HUPCL ideal-int +pkg syscall (darwin-386), const ICANON = 256 +pkg syscall (darwin-386), const ICANON ideal-int +pkg syscall (darwin-386), const ICRNL = 256 +pkg syscall (darwin-386), const ICRNL ideal-int +pkg syscall (darwin-386), const IEXTEN = 1024 +pkg syscall (darwin-386), const IEXTEN ideal-int +pkg syscall (darwin-386), const IFF_ALLMULTI = 512 +pkg syscall (darwin-386), const IFF_ALTPHYS = 16384 +pkg syscall (darwin-386), const IFF_DEBUG = 4 +pkg syscall (darwin-386), const IFF_LINK0 = 4096 +pkg syscall (darwin-386), const IFF_LINK1 = 8192 +pkg syscall (darwin-386), const IFF_LINK2 = 16384 +pkg syscall (darwin-386), const IFF_LOOPBACK = 8 +pkg syscall (darwin-386), const IFF_MULTICAST = 32768 +pkg syscall (darwin-386), const IFF_NOARP = 128 +pkg syscall (darwin-386), const IFF_NOTRAILERS = 32 +pkg syscall (darwin-386), const IFF_OACTIVE = 1024 +pkg syscall (darwin-386), const IFF_POINTOPOINT = 16 +pkg syscall (darwin-386), const IFF_PROMISC = 256 +pkg syscall (darwin-386), const IFF_RUNNING = 64 +pkg syscall (darwin-386), const IFF_SIMPLEX = 2048 +pkg syscall (darwin-386), const IFNAMSIZ = 16 +pkg syscall (darwin-386), const IFT_1822 = 2 +pkg syscall (darwin-386), const IFT_AAL5 = 49 +pkg syscall (darwin-386), const IFT_ARCNET = 35 +pkg syscall (darwin-386), const IFT_ARCNETPLUS = 36 +pkg syscall (darwin-386), const IFT_ATM = 37 +pkg syscall (darwin-386), const IFT_BRIDGE = 209 +pkg syscall (darwin-386), const IFT_CARP = 248 +pkg syscall (darwin-386), const IFT_CELLULAR = 255 +pkg syscall (darwin-386), const IFT_CEPT = 19 +pkg syscall (darwin-386), const IFT_DS3 = 30 +pkg syscall (darwin-386), const IFT_ENC = 244 +pkg syscall (darwin-386), const IFT_EON = 25 +pkg syscall (darwin-386), const IFT_ETHER = 6 +pkg syscall (darwin-386), const IFT_FAITH = 56 +pkg syscall (darwin-386), const IFT_FDDI = 15 +pkg syscall (darwin-386), const IFT_FRELAY = 32 +pkg syscall (darwin-386), const IFT_FRELAYDCE = 44 +pkg syscall (darwin-386), const IFT_GIF = 55 +pkg syscall (darwin-386), const IFT_HDH1822 = 3 +pkg syscall (darwin-386), const IFT_HIPPI = 47 +pkg syscall (darwin-386), const IFT_HSSI = 46 +pkg syscall (darwin-386), const IFT_HY = 14 +pkg syscall (darwin-386), const IFT_IEEE1394 = 144 +pkg syscall (darwin-386), const IFT_IEEE8023ADLAG = 136 +pkg syscall (darwin-386), const IFT_ISDNBASIC = 20 +pkg syscall (darwin-386), const IFT_ISDNPRIMARY = 21 +pkg syscall (darwin-386), const IFT_ISO88022LLC = 41 +pkg syscall (darwin-386), const IFT_ISO88023 = 7 +pkg syscall (darwin-386), const IFT_ISO88024 = 8 +pkg syscall (darwin-386), const IFT_ISO88025 = 9 +pkg syscall (darwin-386), const IFT_ISO88026 = 10 +pkg syscall (darwin-386), const IFT_L2VLAN = 135 +pkg syscall (darwin-386), const IFT_LAPB = 16 +pkg syscall (darwin-386), const IFT_LOCALTALK = 42 +pkg syscall (darwin-386), const IFT_LOOP = 24 +pkg syscall (darwin-386), const IFT_MIOX25 = 38 +pkg syscall (darwin-386), const IFT_MODEM = 48 +pkg syscall (darwin-386), const IFT_NSIP = 27 +pkg syscall (darwin-386), const IFT_OTHER = 1 +pkg syscall (darwin-386), const IFT_P10 = 12 +pkg syscall (darwin-386), const IFT_P80 = 13 +pkg syscall (darwin-386), const IFT_PARA = 34 +pkg syscall (darwin-386), const IFT_PDP = 255 +pkg syscall (darwin-386), const IFT_PFLOG = 245 +pkg syscall (darwin-386), const IFT_PFSYNC = 246 +pkg syscall (darwin-386), const IFT_PPP = 23 +pkg syscall (darwin-386), const IFT_PROPMUX = 54 +pkg syscall (darwin-386), const IFT_PROPVIRTUAL = 53 +pkg syscall (darwin-386), const IFT_PTPSERIAL = 22 +pkg syscall (darwin-386), const IFT_RS232 = 33 +pkg syscall (darwin-386), const IFT_SDLC = 17 +pkg syscall (darwin-386), const IFT_SIP = 31 +pkg syscall (darwin-386), const IFT_SLIP = 28 +pkg syscall (darwin-386), const IFT_SMDSDXI = 43 +pkg syscall (darwin-386), const IFT_SMDSICIP = 52 +pkg syscall (darwin-386), const IFT_SONET = 39 +pkg syscall (darwin-386), const IFT_SONETPATH = 50 +pkg syscall (darwin-386), const IFT_SONETVT = 51 +pkg syscall (darwin-386), const IFT_STARLAN = 11 +pkg syscall (darwin-386), const IFT_STF = 57 +pkg syscall (darwin-386), const IFT_T1 = 18 +pkg syscall (darwin-386), const IFT_ULTRA = 29 +pkg syscall (darwin-386), const IFT_V35 = 45 +pkg syscall (darwin-386), const IFT_X25 = 5 +pkg syscall (darwin-386), const IFT_X25DDN = 4 +pkg syscall (darwin-386), const IFT_X25PLE = 40 +pkg syscall (darwin-386), const IFT_XETHER = 26 +pkg syscall (darwin-386), const IGNBRK = 1 +pkg syscall (darwin-386), const IGNBRK ideal-int +pkg syscall (darwin-386), const IGNCR = 128 +pkg syscall (darwin-386), const IGNCR ideal-int +pkg syscall (darwin-386), const IGNPAR = 4 +pkg syscall (darwin-386), const IGNPAR ideal-int +pkg syscall (darwin-386), const IMAXBEL = 8192 +pkg syscall (darwin-386), const IMAXBEL ideal-int +pkg syscall (darwin-386), const INLCR = 64 +pkg syscall (darwin-386), const INLCR ideal-int +pkg syscall (darwin-386), const INPCK = 16 +pkg syscall (darwin-386), const INPCK ideal-int +pkg syscall (darwin-386), const IN_CLASSA_HOST = 16777215 +pkg syscall (darwin-386), const IN_CLASSA_MAX = 128 +pkg syscall (darwin-386), const IN_CLASSA_NET = 4278190080 +pkg syscall (darwin-386), const IN_CLASSA_NSHIFT = 24 +pkg syscall (darwin-386), const IN_CLASSB_HOST = 65535 +pkg syscall (darwin-386), const IN_CLASSB_MAX = 65536 +pkg syscall (darwin-386), const IN_CLASSB_NET = 4294901760 +pkg syscall (darwin-386), const IN_CLASSB_NSHIFT = 16 +pkg syscall (darwin-386), const IN_CLASSC_HOST = 255 +pkg syscall (darwin-386), const IN_CLASSC_NET = 4294967040 +pkg syscall (darwin-386), const IN_CLASSC_NSHIFT = 8 +pkg syscall (darwin-386), const IN_CLASSD_HOST = 268435455 +pkg syscall (darwin-386), const IN_CLASSD_NET = 4026531840 +pkg syscall (darwin-386), const IN_CLASSD_NSHIFT = 28 +pkg syscall (darwin-386), const IN_LINKLOCALNETNUM = 2851995648 +pkg syscall (darwin-386), const IN_LOOPBACKNET = 127 +pkg syscall (darwin-386), const IPPROTO_3PC = 34 +pkg syscall (darwin-386), const IPPROTO_ADFS = 68 +pkg syscall (darwin-386), const IPPROTO_AH = 51 +pkg syscall (darwin-386), const IPPROTO_AHIP = 61 +pkg syscall (darwin-386), const IPPROTO_APES = 99 +pkg syscall (darwin-386), const IPPROTO_ARGUS = 13 +pkg syscall (darwin-386), const IPPROTO_AX25 = 93 +pkg syscall (darwin-386), const IPPROTO_BHA = 49 +pkg syscall (darwin-386), const IPPROTO_BLT = 30 +pkg syscall (darwin-386), const IPPROTO_BRSATMON = 76 +pkg syscall (darwin-386), const IPPROTO_CFTP = 62 +pkg syscall (darwin-386), const IPPROTO_CHAOS = 16 +pkg syscall (darwin-386), const IPPROTO_CMTP = 38 +pkg syscall (darwin-386), const IPPROTO_CPHB = 73 +pkg syscall (darwin-386), const IPPROTO_CPNX = 72 +pkg syscall (darwin-386), const IPPROTO_DDP = 37 +pkg syscall (darwin-386), const IPPROTO_DGP = 86 +pkg syscall (darwin-386), const IPPROTO_DIVERT = 254 +pkg syscall (darwin-386), const IPPROTO_DONE = 257 +pkg syscall (darwin-386), const IPPROTO_DSTOPTS = 60 +pkg syscall (darwin-386), const IPPROTO_EGP = 8 +pkg syscall (darwin-386), const IPPROTO_EMCON = 14 +pkg syscall (darwin-386), const IPPROTO_ENCAP = 98 +pkg syscall (darwin-386), const IPPROTO_EON = 80 +pkg syscall (darwin-386), const IPPROTO_ESP = 50 +pkg syscall (darwin-386), const IPPROTO_ETHERIP = 97 +pkg syscall (darwin-386), const IPPROTO_FRAGMENT = 44 +pkg syscall (darwin-386), const IPPROTO_GGP = 3 +pkg syscall (darwin-386), const IPPROTO_GMTP = 100 +pkg syscall (darwin-386), const IPPROTO_GRE = 47 +pkg syscall (darwin-386), const IPPROTO_HELLO = 63 +pkg syscall (darwin-386), const IPPROTO_HMP = 20 +pkg syscall (darwin-386), const IPPROTO_HOPOPTS = 0 +pkg syscall (darwin-386), const IPPROTO_ICMP = 1 +pkg syscall (darwin-386), const IPPROTO_ICMPV6 = 58 +pkg syscall (darwin-386), const IPPROTO_IDP = 22 +pkg syscall (darwin-386), const IPPROTO_IDPR = 35 +pkg syscall (darwin-386), const IPPROTO_IDRP = 45 +pkg syscall (darwin-386), const IPPROTO_IGMP = 2 +pkg syscall (darwin-386), const IPPROTO_IGP = 85 +pkg syscall (darwin-386), const IPPROTO_IGRP = 88 +pkg syscall (darwin-386), const IPPROTO_IL = 40 +pkg syscall (darwin-386), const IPPROTO_INLSP = 52 +pkg syscall (darwin-386), const IPPROTO_INP = 32 +pkg syscall (darwin-386), const IPPROTO_IPCOMP = 108 +pkg syscall (darwin-386), const IPPROTO_IPCV = 71 +pkg syscall (darwin-386), const IPPROTO_IPEIP = 94 +pkg syscall (darwin-386), const IPPROTO_IPIP = 4 +pkg syscall (darwin-386), const IPPROTO_IPPC = 67 +pkg syscall (darwin-386), const IPPROTO_IPV4 = 4 +pkg syscall (darwin-386), const IPPROTO_IRTP = 28 +pkg syscall (darwin-386), const IPPROTO_KRYPTOLAN = 65 +pkg syscall (darwin-386), const IPPROTO_LARP = 91 +pkg syscall (darwin-386), const IPPROTO_LEAF1 = 25 +pkg syscall (darwin-386), const IPPROTO_LEAF2 = 26 +pkg syscall (darwin-386), const IPPROTO_MAX = 256 +pkg syscall (darwin-386), const IPPROTO_MAXID = 52 +pkg syscall (darwin-386), const IPPROTO_MEAS = 19 +pkg syscall (darwin-386), const IPPROTO_MHRP = 48 +pkg syscall (darwin-386), const IPPROTO_MICP = 95 +pkg syscall (darwin-386), const IPPROTO_MTP = 92 +pkg syscall (darwin-386), const IPPROTO_MUX = 18 +pkg syscall (darwin-386), const IPPROTO_ND = 77 +pkg syscall (darwin-386), const IPPROTO_NHRP = 54 +pkg syscall (darwin-386), const IPPROTO_NONE = 59 +pkg syscall (darwin-386), const IPPROTO_NSP = 31 +pkg syscall (darwin-386), const IPPROTO_NVPII = 11 +pkg syscall (darwin-386), const IPPROTO_OSPFIGP = 89 +pkg syscall (darwin-386), const IPPROTO_PGM = 113 +pkg syscall (darwin-386), const IPPROTO_PIGP = 9 +pkg syscall (darwin-386), const IPPROTO_PIM = 103 +pkg syscall (darwin-386), const IPPROTO_PRM = 21 +pkg syscall (darwin-386), const IPPROTO_PUP = 12 +pkg syscall (darwin-386), const IPPROTO_PVP = 75 +pkg syscall (darwin-386), const IPPROTO_RAW = 255 +pkg syscall (darwin-386), const IPPROTO_RCCMON = 10 +pkg syscall (darwin-386), const IPPROTO_RDP = 27 +pkg syscall (darwin-386), const IPPROTO_ROUTING = 43 +pkg syscall (darwin-386), const IPPROTO_RSVP = 46 +pkg syscall (darwin-386), const IPPROTO_RVD = 66 +pkg syscall (darwin-386), const IPPROTO_SATEXPAK = 64 +pkg syscall (darwin-386), const IPPROTO_SATMON = 69 +pkg syscall (darwin-386), const IPPROTO_SCCSP = 96 +pkg syscall (darwin-386), const IPPROTO_SCTP = 132 +pkg syscall (darwin-386), const IPPROTO_SDRP = 42 +pkg syscall (darwin-386), const IPPROTO_SEP = 33 +pkg syscall (darwin-386), const IPPROTO_SRPC = 90 +pkg syscall (darwin-386), const IPPROTO_ST = 7 +pkg syscall (darwin-386), const IPPROTO_SVMTP = 82 +pkg syscall (darwin-386), const IPPROTO_SWIPE = 53 +pkg syscall (darwin-386), const IPPROTO_TCF = 87 +pkg syscall (darwin-386), const IPPROTO_TP = 29 +pkg syscall (darwin-386), const IPPROTO_TPXX = 39 +pkg syscall (darwin-386), const IPPROTO_TRUNK1 = 23 +pkg syscall (darwin-386), const IPPROTO_TRUNK2 = 24 +pkg syscall (darwin-386), const IPPROTO_TTP = 84 +pkg syscall (darwin-386), const IPPROTO_VINES = 83 +pkg syscall (darwin-386), const IPPROTO_VISA = 70 +pkg syscall (darwin-386), const IPPROTO_VMTP = 81 +pkg syscall (darwin-386), const IPPROTO_WBEXPAK = 79 +pkg syscall (darwin-386), const IPPROTO_WBMON = 78 +pkg syscall (darwin-386), const IPPROTO_WSN = 74 +pkg syscall (darwin-386), const IPPROTO_XNET = 15 +pkg syscall (darwin-386), const IPPROTO_XTP = 36 +pkg syscall (darwin-386), const IPV6_2292DSTOPTS = 23 +pkg syscall (darwin-386), const IPV6_2292HOPLIMIT = 20 +pkg syscall (darwin-386), const IPV6_2292HOPOPTS = 22 +pkg syscall (darwin-386), const IPV6_2292NEXTHOP = 21 +pkg syscall (darwin-386), const IPV6_2292PKTINFO = 19 +pkg syscall (darwin-386), const IPV6_2292PKTOPTIONS = 25 +pkg syscall (darwin-386), const IPV6_2292RTHDR = 24 +pkg syscall (darwin-386), const IPV6_BINDV6ONLY = 27 +pkg syscall (darwin-386), const IPV6_BOUND_IF = 125 +pkg syscall (darwin-386), const IPV6_CHECKSUM = 26 +pkg syscall (darwin-386), const IPV6_DEFAULT_MULTICAST_HOPS = 1 +pkg syscall (darwin-386), const IPV6_DEFAULT_MULTICAST_LOOP = 1 +pkg syscall (darwin-386), const IPV6_DEFHLIM = 64 +pkg syscall (darwin-386), const IPV6_FAITH = 29 +pkg syscall (darwin-386), const IPV6_FLOWINFO_MASK = 4294967055 +pkg syscall (darwin-386), const IPV6_FLOWLABEL_MASK = 4294905600 +pkg syscall (darwin-386), const IPV6_FRAGTTL = 120 +pkg syscall (darwin-386), const IPV6_FW_ADD = 30 +pkg syscall (darwin-386), const IPV6_FW_DEL = 31 +pkg syscall (darwin-386), const IPV6_FW_FLUSH = 32 +pkg syscall (darwin-386), const IPV6_FW_GET = 34 +pkg syscall (darwin-386), const IPV6_FW_ZERO = 33 +pkg syscall (darwin-386), const IPV6_HLIMDEC = 1 +pkg syscall (darwin-386), const IPV6_IPSEC_POLICY = 28 +pkg syscall (darwin-386), const IPV6_JOIN_GROUP = 12 +pkg syscall (darwin-386), const IPV6_LEAVE_GROUP = 13 +pkg syscall (darwin-386), const IPV6_MAXHLIM = 255 +pkg syscall (darwin-386), const IPV6_MAXOPTHDR = 2048 +pkg syscall (darwin-386), const IPV6_MAXPACKET = 65535 +pkg syscall (darwin-386), const IPV6_MAX_GROUP_SRC_FILTER = 512 +pkg syscall (darwin-386), const IPV6_MAX_MEMBERSHIPS = 4095 +pkg syscall (darwin-386), const IPV6_MAX_SOCK_SRC_FILTER = 128 +pkg syscall (darwin-386), const IPV6_MIN_MEMBERSHIPS = 31 +pkg syscall (darwin-386), const IPV6_MMTU = 1280 +pkg syscall (darwin-386), const IPV6_MULTICAST_HOPS = 10 +pkg syscall (darwin-386), const IPV6_MULTICAST_IF = 9 +pkg syscall (darwin-386), const IPV6_MULTICAST_LOOP = 11 +pkg syscall (darwin-386), const IPV6_PORTRANGE = 14 +pkg syscall (darwin-386), const IPV6_PORTRANGE_DEFAULT = 0 +pkg syscall (darwin-386), const IPV6_PORTRANGE_HIGH = 1 +pkg syscall (darwin-386), const IPV6_PORTRANGE_LOW = 2 +pkg syscall (darwin-386), const IPV6_RECVTCLASS = 35 +pkg syscall (darwin-386), const IPV6_RTHDR_LOOSE = 0 +pkg syscall (darwin-386), const IPV6_RTHDR_STRICT = 1 +pkg syscall (darwin-386), const IPV6_RTHDR_TYPE_0 = 0 +pkg syscall (darwin-386), const IPV6_SOCKOPT_RESERVED1 = 3 +pkg syscall (darwin-386), const IPV6_TCLASS = 36 +pkg syscall (darwin-386), const IPV6_UNICAST_HOPS = 4 +pkg syscall (darwin-386), const IPV6_V6ONLY = 27 +pkg syscall (darwin-386), const IPV6_VERSION = 96 +pkg syscall (darwin-386), const IPV6_VERSION_MASK = 240 +pkg syscall (darwin-386), const IP_ADD_MEMBERSHIP = 12 +pkg syscall (darwin-386), const IP_ADD_SOURCE_MEMBERSHIP = 70 +pkg syscall (darwin-386), const IP_BLOCK_SOURCE = 72 +pkg syscall (darwin-386), const IP_BOUND_IF = 25 +pkg syscall (darwin-386), const IP_DEFAULT_MULTICAST_LOOP = 1 +pkg syscall (darwin-386), const IP_DEFAULT_MULTICAST_TTL = 1 +pkg syscall (darwin-386), const IP_DF = 16384 +pkg syscall (darwin-386), const IP_DROP_MEMBERSHIP = 13 +pkg syscall (darwin-386), const IP_DROP_SOURCE_MEMBERSHIP = 71 +pkg syscall (darwin-386), const IP_DUMMYNET_CONFIGURE = 60 +pkg syscall (darwin-386), const IP_DUMMYNET_DEL = 61 +pkg syscall (darwin-386), const IP_DUMMYNET_FLUSH = 62 +pkg syscall (darwin-386), const IP_DUMMYNET_GET = 64 +pkg syscall (darwin-386), const IP_FAITH = 22 +pkg syscall (darwin-386), const IP_FW_ADD = 40 +pkg syscall (darwin-386), const IP_FW_DEL = 41 +pkg syscall (darwin-386), const IP_FW_FLUSH = 42 +pkg syscall (darwin-386), const IP_FW_GET = 44 +pkg syscall (darwin-386), const IP_FW_RESETLOG = 45 +pkg syscall (darwin-386), const IP_FW_ZERO = 43 +pkg syscall (darwin-386), const IP_HDRINCL = 2 +pkg syscall (darwin-386), const IP_IPSEC_POLICY = 21 +pkg syscall (darwin-386), const IP_MAXPACKET = 65535 +pkg syscall (darwin-386), const IP_MAX_GROUP_SRC_FILTER = 512 +pkg syscall (darwin-386), const IP_MAX_MEMBERSHIPS = 4095 +pkg syscall (darwin-386), const IP_MAX_SOCK_MUTE_FILTER = 128 +pkg syscall (darwin-386), const IP_MAX_SOCK_SRC_FILTER = 128 +pkg syscall (darwin-386), const IP_MF = 8192 +pkg syscall (darwin-386), const IP_MIN_MEMBERSHIPS = 31 +pkg syscall (darwin-386), const IP_MSFILTER = 74 +pkg syscall (darwin-386), const IP_MSS = 576 +pkg syscall (darwin-386), const IP_MULTICAST_IF = 9 +pkg syscall (darwin-386), const IP_MULTICAST_IFINDEX = 66 +pkg syscall (darwin-386), const IP_MULTICAST_LOOP = 11 +pkg syscall (darwin-386), const IP_MULTICAST_TTL = 10 +pkg syscall (darwin-386), const IP_MULTICAST_VIF = 14 +pkg syscall (darwin-386), const IP_NAT__XXX = 55 +pkg syscall (darwin-386), const IP_OFFMASK = 8191 +pkg syscall (darwin-386), const IP_OLD_FW_ADD = 50 +pkg syscall (darwin-386), const IP_OLD_FW_DEL = 51 +pkg syscall (darwin-386), const IP_OLD_FW_FLUSH = 52 +pkg syscall (darwin-386), const IP_OLD_FW_GET = 54 +pkg syscall (darwin-386), const IP_OLD_FW_RESETLOG = 56 +pkg syscall (darwin-386), const IP_OLD_FW_ZERO = 53 +pkg syscall (darwin-386), const IP_OPTIONS = 1 +pkg syscall (darwin-386), const IP_PKTINFO = 26 +pkg syscall (darwin-386), const IP_PORTRANGE = 19 +pkg syscall (darwin-386), const IP_PORTRANGE_DEFAULT = 0 +pkg syscall (darwin-386), const IP_PORTRANGE_HIGH = 1 +pkg syscall (darwin-386), const IP_PORTRANGE_LOW = 2 +pkg syscall (darwin-386), const IP_RECVDSTADDR = 7 +pkg syscall (darwin-386), const IP_RECVIF = 20 +pkg syscall (darwin-386), const IP_RECVOPTS = 5 +pkg syscall (darwin-386), const IP_RECVPKTINFO = 26 +pkg syscall (darwin-386), const IP_RECVRETOPTS = 6 +pkg syscall (darwin-386), const IP_RECVTTL = 24 +pkg syscall (darwin-386), const IP_RETOPTS = 8 +pkg syscall (darwin-386), const IP_RF = 32768 +pkg syscall (darwin-386), const IP_RSVP_OFF = 16 +pkg syscall (darwin-386), const IP_RSVP_ON = 15 +pkg syscall (darwin-386), const IP_RSVP_VIF_OFF = 18 +pkg syscall (darwin-386), const IP_RSVP_VIF_ON = 17 +pkg syscall (darwin-386), const IP_STRIPHDR = 23 +pkg syscall (darwin-386), const IP_TOS = 3 +pkg syscall (darwin-386), const IP_TRAFFIC_MGT_BACKGROUND = 65 +pkg syscall (darwin-386), const IP_TTL = 4 +pkg syscall (darwin-386), const IP_UNBLOCK_SOURCE = 73 +pkg syscall (darwin-386), const ISIG = 128 +pkg syscall (darwin-386), const ISIG ideal-int +pkg syscall (darwin-386), const ISTRIP = 32 +pkg syscall (darwin-386), const ISTRIP ideal-int +pkg syscall (darwin-386), const IUTF8 = 16384 +pkg syscall (darwin-386), const IUTF8 ideal-int +pkg syscall (darwin-386), const IXANY = 2048 +pkg syscall (darwin-386), const IXANY ideal-int +pkg syscall (darwin-386), const IXOFF = 1024 +pkg syscall (darwin-386), const IXOFF ideal-int +pkg syscall (darwin-386), const IXON = 512 +pkg syscall (darwin-386), const IXON ideal-int +pkg syscall (darwin-386), const ImplementsGetwd = false +pkg syscall (darwin-386), const LOCK_EX = 2 +pkg syscall (darwin-386), const LOCK_NB = 4 +pkg syscall (darwin-386), const LOCK_SH = 1 +pkg syscall (darwin-386), const LOCK_UN = 8 +pkg syscall (darwin-386), const MADV_CAN_REUSE = 9 +pkg syscall (darwin-386), const MADV_DONTNEED = 4 +pkg syscall (darwin-386), const MADV_FREE = 5 +pkg syscall (darwin-386), const MADV_FREE_REUSABLE = 7 +pkg syscall (darwin-386), const MADV_FREE_REUSE = 8 +pkg syscall (darwin-386), const MADV_NORMAL = 0 +pkg syscall (darwin-386), const MADV_RANDOM = 1 +pkg syscall (darwin-386), const MADV_SEQUENTIAL = 2 +pkg syscall (darwin-386), const MADV_WILLNEED = 3 +pkg syscall (darwin-386), const MADV_ZERO_WIRED_PAGES = 6 +pkg syscall (darwin-386), const MAP_ANON = 4096 +pkg syscall (darwin-386), const MAP_COPY = 2 +pkg syscall (darwin-386), const MAP_FILE = 0 +pkg syscall (darwin-386), const MAP_FIXED = 16 +pkg syscall (darwin-386), const MAP_HASSEMAPHORE = 512 +pkg syscall (darwin-386), const MAP_JIT = 2048 +pkg syscall (darwin-386), const MAP_NOCACHE = 1024 +pkg syscall (darwin-386), const MAP_NOEXTEND = 256 +pkg syscall (darwin-386), const MAP_NORESERVE = 64 +pkg syscall (darwin-386), const MAP_PRIVATE = 2 +pkg syscall (darwin-386), const MAP_RENAME = 32 +pkg syscall (darwin-386), const MAP_RESERVED0080 = 128 +pkg syscall (darwin-386), const MAP_SHARED = 1 +pkg syscall (darwin-386), const MCL_CURRENT = 1 +pkg syscall (darwin-386), const MCL_FUTURE = 2 +pkg syscall (darwin-386), const MSG_CTRUNC = 32 +pkg syscall (darwin-386), const MSG_DONTROUTE = 4 +pkg syscall (darwin-386), const MSG_DONTWAIT = 128 +pkg syscall (darwin-386), const MSG_EOF = 256 +pkg syscall (darwin-386), const MSG_EOR = 8 +pkg syscall (darwin-386), const MSG_FLUSH = 1024 +pkg syscall (darwin-386), const MSG_HAVEMORE = 8192 +pkg syscall (darwin-386), const MSG_HOLD = 2048 +pkg syscall (darwin-386), const MSG_NEEDSA = 65536 +pkg syscall (darwin-386), const MSG_OOB = 1 +pkg syscall (darwin-386), const MSG_PEEK = 2 +pkg syscall (darwin-386), const MSG_RCVMORE = 16384 +pkg syscall (darwin-386), const MSG_SEND = 4096 +pkg syscall (darwin-386), const MSG_TRUNC = 16 +pkg syscall (darwin-386), const MSG_WAITALL = 64 +pkg syscall (darwin-386), const MSG_WAITSTREAM = 512 +pkg syscall (darwin-386), const MS_ASYNC = 1 +pkg syscall (darwin-386), const MS_DEACTIVATE = 8 +pkg syscall (darwin-386), const MS_INVALIDATE = 2 +pkg syscall (darwin-386), const MS_KILLPAGES = 4 +pkg syscall (darwin-386), const MS_SYNC = 16 +pkg syscall (darwin-386), const NAME_MAX = 255 +pkg syscall (darwin-386), const NET_RT_DUMP = 1 +pkg syscall (darwin-386), const NET_RT_DUMP2 = 7 +pkg syscall (darwin-386), const NET_RT_FLAGS = 2 +pkg syscall (darwin-386), const NET_RT_IFLIST = 3 +pkg syscall (darwin-386), const NET_RT_IFLIST2 = 6 +pkg syscall (darwin-386), const NET_RT_MAXID = 10 +pkg syscall (darwin-386), const NET_RT_STAT = 4 +pkg syscall (darwin-386), const NET_RT_TRASH = 5 +pkg syscall (darwin-386), const NOFLSH = 2147483648 +pkg syscall (darwin-386), const NOFLSH ideal-int +pkg syscall (darwin-386), const NOTE_ABSOLUTE = 8 +pkg syscall (darwin-386), const NOTE_ATTRIB = 8 +pkg syscall (darwin-386), const NOTE_CHILD = 4 +pkg syscall (darwin-386), const NOTE_DELETE = 1 +pkg syscall (darwin-386), const NOTE_EXEC = 536870912 +pkg syscall (darwin-386), const NOTE_EXIT = 2147483648 +pkg syscall (darwin-386), const NOTE_EXITSTATUS = 67108864 +pkg syscall (darwin-386), const NOTE_EXTEND = 4 +pkg syscall (darwin-386), const NOTE_FFAND = 1073741824 +pkg syscall (darwin-386), const NOTE_FFCOPY = 3221225472 +pkg syscall (darwin-386), const NOTE_FFCTRLMASK = 3221225472 +pkg syscall (darwin-386), const NOTE_FFLAGSMASK = 16777215 +pkg syscall (darwin-386), const NOTE_FFNOP = 0 +pkg syscall (darwin-386), const NOTE_FFOR = 2147483648 +pkg syscall (darwin-386), const NOTE_FORK = 1073741824 +pkg syscall (darwin-386), const NOTE_LINK = 16 +pkg syscall (darwin-386), const NOTE_LOWAT = 1 +pkg syscall (darwin-386), const NOTE_NONE = 128 +pkg syscall (darwin-386), const NOTE_NSECONDS = 4 +pkg syscall (darwin-386), const NOTE_PCTRLMASK = -1048576 +pkg syscall (darwin-386), const NOTE_PDATAMASK = 1048575 +pkg syscall (darwin-386), const NOTE_REAP = 268435456 +pkg syscall (darwin-386), const NOTE_RENAME = 32 +pkg syscall (darwin-386), const NOTE_RESOURCEEND = 33554432 +pkg syscall (darwin-386), const NOTE_REVOKE = 64 +pkg syscall (darwin-386), const NOTE_SECONDS = 1 +pkg syscall (darwin-386), const NOTE_SIGNAL = 134217728 +pkg syscall (darwin-386), const NOTE_TRACK = 1 +pkg syscall (darwin-386), const NOTE_TRACKERR = 2 +pkg syscall (darwin-386), const NOTE_TRIGGER = 16777216 +pkg syscall (darwin-386), const NOTE_USECONDS = 2 +pkg syscall (darwin-386), const NOTE_VM_ERROR = 268435456 +pkg syscall (darwin-386), const NOTE_VM_PRESSURE = 2147483648 +pkg syscall (darwin-386), const NOTE_VM_PRESSURE_SUDDEN_TERMINATE = 536870912 +pkg syscall (darwin-386), const NOTE_VM_PRESSURE_TERMINATE = 1073741824 +pkg syscall (darwin-386), const NOTE_WRITE = 2 +pkg syscall (darwin-386), const OCRNL = 16 +pkg syscall (darwin-386), const OCRNL ideal-int +pkg syscall (darwin-386), const OFDEL = 131072 +pkg syscall (darwin-386), const OFDEL ideal-int +pkg syscall (darwin-386), const OFILL = 128 +pkg syscall (darwin-386), const OFILL ideal-int +pkg syscall (darwin-386), const ONLCR = 2 +pkg syscall (darwin-386), const ONLCR ideal-int +pkg syscall (darwin-386), const ONLRET = 64 +pkg syscall (darwin-386), const ONLRET ideal-int +pkg syscall (darwin-386), const ONOCR = 32 +pkg syscall (darwin-386), const ONOCR ideal-int +pkg syscall (darwin-386), const ONOEOT = 8 +pkg syscall (darwin-386), const ONOEOT ideal-int +pkg syscall (darwin-386), const OPOST = 1 +pkg syscall (darwin-386), const OPOST ideal-int +pkg syscall (darwin-386), const O_ACCMODE = 3 +pkg syscall (darwin-386), const O_ALERT = 536870912 +pkg syscall (darwin-386), const O_APPEND = 8 +pkg syscall (darwin-386), const O_ASYNC = 64 +pkg syscall (darwin-386), const O_CLOEXEC = 16777216 +pkg syscall (darwin-386), const O_CREAT = 512 +pkg syscall (darwin-386), const O_DIRECTORY = 1048576 +pkg syscall (darwin-386), const O_DSYNC = 4194304 +pkg syscall (darwin-386), const O_EVTONLY = 32768 +pkg syscall (darwin-386), const O_EXCL = 2048 +pkg syscall (darwin-386), const O_EXLOCK = 32 +pkg syscall (darwin-386), const O_FSYNC = 128 +pkg syscall (darwin-386), const O_NDELAY = 4 +pkg syscall (darwin-386), const O_NOCTTY = 131072 +pkg syscall (darwin-386), const O_NOFOLLOW = 256 +pkg syscall (darwin-386), const O_NONBLOCK = 4 +pkg syscall (darwin-386), const O_POPUP = 2147483648 +pkg syscall (darwin-386), const O_SHLOCK = 16 +pkg syscall (darwin-386), const O_SYMLINK = 2097152 +pkg syscall (darwin-386), const O_SYNC = 128 +pkg syscall (darwin-386), const O_TRUNC = 1024 +pkg syscall (darwin-386), const PARENB = 4096 +pkg syscall (darwin-386), const PARENB ideal-int +pkg syscall (darwin-386), const PARMRK = 8 +pkg syscall (darwin-386), const PARMRK ideal-int +pkg syscall (darwin-386), const PARODD = 8192 +pkg syscall (darwin-386), const PARODD ideal-int +pkg syscall (darwin-386), const PENDIN = 536870912 +pkg syscall (darwin-386), const PENDIN ideal-int +pkg syscall (darwin-386), const PROT_EXEC = 4 +pkg syscall (darwin-386), const PROT_NONE = 0 +pkg syscall (darwin-386), const PROT_READ = 1 +pkg syscall (darwin-386), const PROT_WRITE = 2 +pkg syscall (darwin-386), const PTRACE_CONT = 7 +pkg syscall (darwin-386), const PTRACE_KILL = 8 +pkg syscall (darwin-386), const PTRACE_TRACEME = 0 +pkg syscall (darwin-386), const PT_ATTACH = 10 +pkg syscall (darwin-386), const PT_ATTACHEXC = 14 +pkg syscall (darwin-386), const PT_CONTINUE = 7 +pkg syscall (darwin-386), const PT_DENY_ATTACH = 31 +pkg syscall (darwin-386), const PT_DETACH = 11 +pkg syscall (darwin-386), const PT_FIRSTMACH = 32 +pkg syscall (darwin-386), const PT_FORCEQUOTA = 30 +pkg syscall (darwin-386), const PT_KILL = 8 +pkg syscall (darwin-386), const PT_READ_D = 2 +pkg syscall (darwin-386), const PT_READ_I = 1 +pkg syscall (darwin-386), const PT_READ_U = 3 +pkg syscall (darwin-386), const PT_SIGEXC = 12 +pkg syscall (darwin-386), const PT_STEP = 9 +pkg syscall (darwin-386), const PT_THUPDATE = 13 +pkg syscall (darwin-386), const PT_TRACE_ME = 0 +pkg syscall (darwin-386), const PT_WRITE_D = 5 +pkg syscall (darwin-386), const PT_WRITE_I = 4 +pkg syscall (darwin-386), const PT_WRITE_U = 6 +pkg syscall (darwin-386), const RLIMIT_AS = 5 +pkg syscall (darwin-386), const RLIMIT_CORE = 4 +pkg syscall (darwin-386), const RLIMIT_CPU = 0 +pkg syscall (darwin-386), const RLIMIT_DATA = 2 +pkg syscall (darwin-386), const RLIMIT_FSIZE = 1 +pkg syscall (darwin-386), const RLIMIT_NOFILE = 8 +pkg syscall (darwin-386), const RLIMIT_STACK = 3 +pkg syscall (darwin-386), const RLIM_INFINITY = 9223372036854775807 +pkg syscall (darwin-386), const RTAX_AUTHOR = 6 +pkg syscall (darwin-386), const RTAX_BRD = 7 +pkg syscall (darwin-386), const RTAX_DST = 0 +pkg syscall (darwin-386), const RTAX_GATEWAY = 1 +pkg syscall (darwin-386), const RTAX_GENMASK = 3 +pkg syscall (darwin-386), const RTAX_IFA = 5 +pkg syscall (darwin-386), const RTAX_IFP = 4 +pkg syscall (darwin-386), const RTAX_MAX = 8 +pkg syscall (darwin-386), const RTAX_NETMASK = 2 +pkg syscall (darwin-386), const RTA_AUTHOR = 64 +pkg syscall (darwin-386), const RTA_BRD = 128 +pkg syscall (darwin-386), const RTA_DST = 1 +pkg syscall (darwin-386), const RTA_GATEWAY = 2 +pkg syscall (darwin-386), const RTA_GENMASK = 8 +pkg syscall (darwin-386), const RTA_IFA = 32 +pkg syscall (darwin-386), const RTA_IFP = 16 +pkg syscall (darwin-386), const RTA_NETMASK = 4 +pkg syscall (darwin-386), const RTF_BLACKHOLE = 4096 +pkg syscall (darwin-386), const RTF_BROADCAST = 4194304 +pkg syscall (darwin-386), const RTF_CLONING = 256 +pkg syscall (darwin-386), const RTF_CONDEMNED = 33554432 +pkg syscall (darwin-386), const RTF_DELCLONE = 128 +pkg syscall (darwin-386), const RTF_DONE = 64 +pkg syscall (darwin-386), const RTF_DYNAMIC = 16 +pkg syscall (darwin-386), const RTF_GATEWAY = 2 +pkg syscall (darwin-386), const RTF_HOST = 4 +pkg syscall (darwin-386), const RTF_IFREF = 67108864 +pkg syscall (darwin-386), const RTF_IFSCOPE = 16777216 +pkg syscall (darwin-386), const RTF_LLINFO = 1024 +pkg syscall (darwin-386), const RTF_LOCAL = 2097152 +pkg syscall (darwin-386), const RTF_MODIFIED = 32 +pkg syscall (darwin-386), const RTF_MULTICAST = 8388608 +pkg syscall (darwin-386), const RTF_PINNED = 1048576 +pkg syscall (darwin-386), const RTF_PRCLONING = 65536 +pkg syscall (darwin-386), const RTF_PROTO1 = 32768 +pkg syscall (darwin-386), const RTF_PROTO2 = 16384 +pkg syscall (darwin-386), const RTF_PROTO3 = 262144 +pkg syscall (darwin-386), const RTF_REJECT = 8 +pkg syscall (darwin-386), const RTF_STATIC = 2048 +pkg syscall (darwin-386), const RTF_UP = 1 +pkg syscall (darwin-386), const RTF_WASCLONED = 131072 +pkg syscall (darwin-386), const RTF_XRESOLVE = 512 +pkg syscall (darwin-386), const RTM_ADD = 1 +pkg syscall (darwin-386), const RTM_CHANGE = 3 +pkg syscall (darwin-386), const RTM_DELADDR = 13 +pkg syscall (darwin-386), const RTM_DELETE = 2 +pkg syscall (darwin-386), const RTM_DELMADDR = 16 +pkg syscall (darwin-386), const RTM_GET = 4 +pkg syscall (darwin-386), const RTM_GET2 = 20 +pkg syscall (darwin-386), const RTM_IFINFO = 14 +pkg syscall (darwin-386), const RTM_IFINFO2 = 18 +pkg syscall (darwin-386), const RTM_LOCK = 8 +pkg syscall (darwin-386), const RTM_LOSING = 5 +pkg syscall (darwin-386), const RTM_MISS = 7 +pkg syscall (darwin-386), const RTM_NEWADDR = 12 +pkg syscall (darwin-386), const RTM_NEWMADDR = 15 +pkg syscall (darwin-386), const RTM_NEWMADDR2 = 19 +pkg syscall (darwin-386), const RTM_OLDADD = 9 +pkg syscall (darwin-386), const RTM_OLDDEL = 10 +pkg syscall (darwin-386), const RTM_REDIRECT = 6 +pkg syscall (darwin-386), const RTM_RESOLVE = 11 +pkg syscall (darwin-386), const RTM_RTTUNIT = 1000000 +pkg syscall (darwin-386), const RTM_VERSION = 5 +pkg syscall (darwin-386), const RTV_EXPIRE = 4 +pkg syscall (darwin-386), const RTV_HOPCOUNT = 2 +pkg syscall (darwin-386), const RTV_MTU = 1 +pkg syscall (darwin-386), const RTV_RPIPE = 8 +pkg syscall (darwin-386), const RTV_RTT = 64 +pkg syscall (darwin-386), const RTV_RTTVAR = 128 +pkg syscall (darwin-386), const RTV_SPIPE = 16 +pkg syscall (darwin-386), const RTV_SSTHRESH = 32 +pkg syscall (darwin-386), const RUSAGE_CHILDREN = -1 +pkg syscall (darwin-386), const RUSAGE_SELF = 0 +pkg syscall (darwin-386), const SCM_CREDS = 3 +pkg syscall (darwin-386), const SCM_RIGHTS = 1 +pkg syscall (darwin-386), const SCM_TIMESTAMP = 2 +pkg syscall (darwin-386), const SCM_TIMESTAMP_MONOTONIC = 4 +pkg syscall (darwin-386), const SIGBUS = 10 +pkg syscall (darwin-386), const SIGCHLD = 20 +pkg syscall (darwin-386), const SIGCONT = 19 +pkg syscall (darwin-386), const SIGEMT = 7 +pkg syscall (darwin-386), const SIGINFO = 29 +pkg syscall (darwin-386), const SIGIO = 23 +pkg syscall (darwin-386), const SIGIOT = 6 +pkg syscall (darwin-386), const SIGPROF = 27 +pkg syscall (darwin-386), const SIGSTOP = 17 +pkg syscall (darwin-386), const SIGSYS = 12 +pkg syscall (darwin-386), const SIGTSTP = 18 +pkg syscall (darwin-386), const SIGTTIN = 21 +pkg syscall (darwin-386), const SIGTTOU = 22 +pkg syscall (darwin-386), const SIGURG = 16 +pkg syscall (darwin-386), const SIGUSR1 = 30 +pkg syscall (darwin-386), const SIGUSR2 = 31 +pkg syscall (darwin-386), const SIGVTALRM = 26 +pkg syscall (darwin-386), const SIGWINCH = 28 +pkg syscall (darwin-386), const SIGXCPU = 24 +pkg syscall (darwin-386), const SIGXFSZ = 25 +pkg syscall (darwin-386), const SIOCADDMULTI = 2149607729 +pkg syscall (darwin-386), const SIOCAIFADDR = 2151704858 +pkg syscall (darwin-386), const SIOCALIFADDR = 2165860637 +pkg syscall (darwin-386), const SIOCARPIPLL = 3223349544 +pkg syscall (darwin-386), const SIOCATMARK = 1074033415 +pkg syscall (darwin-386), const SIOCAUTOADDR = 3223349542 +pkg syscall (darwin-386), const SIOCAUTONETMASK = 2149607719 +pkg syscall (darwin-386), const SIOCDELMULTI = 2149607730 +pkg syscall (darwin-386), const SIOCDIFADDR = 2149607705 +pkg syscall (darwin-386), const SIOCDIFPHYADDR = 2149607745 +pkg syscall (darwin-386), const SIOCDLIFADDR = 2165860639 +pkg syscall (darwin-386), const SIOCGDRVSPEC = 3223087483 +pkg syscall (darwin-386), const SIOCGETSGCNT = 3222565404 +pkg syscall (darwin-386), const SIOCGETVIFCNT = 3222565403 +pkg syscall (darwin-386), const SIOCGETVLAN = 3223349631 +pkg syscall (darwin-386), const SIOCGHIWAT = 1074033409 +pkg syscall (darwin-386), const SIOCGIFADDR = 3223349537 +pkg syscall (darwin-386), const SIOCGIFALTMTU = 3223349576 +pkg syscall (darwin-386), const SIOCGIFASYNCMAP = 3223349628 +pkg syscall (darwin-386), const SIOCGIFBOND = 3223349575 +pkg syscall (darwin-386), const SIOCGIFBRDADDR = 3223349539 +pkg syscall (darwin-386), const SIOCGIFCAP = 3223349595 +pkg syscall (darwin-386), const SIOCGIFCONF = 3221776676 +pkg syscall (darwin-386), const SIOCGIFDEVMTU = 3223349572 +pkg syscall (darwin-386), const SIOCGIFDSTADDR = 3223349538 +pkg syscall (darwin-386), const SIOCGIFFLAGS = 3223349521 +pkg syscall (darwin-386), const SIOCGIFGENERIC = 3223349562 +pkg syscall (darwin-386), const SIOCGIFKPI = 3223349639 +pkg syscall (darwin-386), const SIOCGIFMAC = 3223349634 +pkg syscall (darwin-386), const SIOCGIFMEDIA = 3223873848 +pkg syscall (darwin-386), const SIOCGIFMETRIC = 3223349527 +pkg syscall (darwin-386), const SIOCGIFMTU = 3223349555 +pkg syscall (darwin-386), const SIOCGIFNETMASK = 3223349541 +pkg syscall (darwin-386), const SIOCGIFPDSTADDR = 3223349568 +pkg syscall (darwin-386), const SIOCGIFPHYS = 3223349557 +pkg syscall (darwin-386), const SIOCGIFPSRCADDR = 3223349567 +pkg syscall (darwin-386), const SIOCGIFSTATUS = 3274795325 +pkg syscall (darwin-386), const SIOCGIFVLAN = 3223349631 +pkg syscall (darwin-386), const SIOCGIFWAKEFLAGS = 3223349640 +pkg syscall (darwin-386), const SIOCGLIFADDR = 3239602462 +pkg syscall (darwin-386), const SIOCGLIFPHYADDR = 3239602499 +pkg syscall (darwin-386), const SIOCGLOWAT = 1074033411 +pkg syscall (darwin-386), const SIOCGPGRP = 1074033417 +pkg syscall (darwin-386), const SIOCIFCREATE = 3223349624 +pkg syscall (darwin-386), const SIOCIFCREATE2 = 3223349626 +pkg syscall (darwin-386), const SIOCIFDESTROY = 2149607801 +pkg syscall (darwin-386), const SIOCRSLVMULTI = 3221776699 +pkg syscall (darwin-386), const SIOCSDRVSPEC = 2149345659 +pkg syscall (darwin-386), const SIOCSETVLAN = 2149607806 +pkg syscall (darwin-386), const SIOCSHIWAT = 2147775232 +pkg syscall (darwin-386), const SIOCSIFADDR = 2149607692 +pkg syscall (darwin-386), const SIOCSIFALTMTU = 2149607749 +pkg syscall (darwin-386), const SIOCSIFASYNCMAP = 2149607805 +pkg syscall (darwin-386), const SIOCSIFBOND = 2149607750 +pkg syscall (darwin-386), const SIOCSIFBRDADDR = 2149607699 +pkg syscall (darwin-386), const SIOCSIFCAP = 2149607770 +pkg syscall (darwin-386), const SIOCSIFDSTADDR = 2149607694 +pkg syscall (darwin-386), const SIOCSIFFLAGS = 2149607696 +pkg syscall (darwin-386), const SIOCSIFGENERIC = 2149607737 +pkg syscall (darwin-386), const SIOCSIFKPI = 2149607814 +pkg syscall (darwin-386), const SIOCSIFLLADDR = 2149607740 +pkg syscall (darwin-386), const SIOCSIFMAC = 2149607811 +pkg syscall (darwin-386), const SIOCSIFMEDIA = 3223349559 +pkg syscall (darwin-386), const SIOCSIFMETRIC = 2149607704 +pkg syscall (darwin-386), const SIOCSIFMTU = 2149607732 +pkg syscall (darwin-386), const SIOCSIFNETMASK = 2149607702 +pkg syscall (darwin-386), const SIOCSIFPHYADDR = 2151704894 +pkg syscall (darwin-386), const SIOCSIFPHYS = 2149607734 +pkg syscall (darwin-386), const SIOCSIFVLAN = 2149607806 +pkg syscall (darwin-386), const SIOCSLIFPHYADDR = 2165860674 +pkg syscall (darwin-386), const SIOCSLOWAT = 2147775234 +pkg syscall (darwin-386), const SIOCSPGRP = 2147775240 +pkg syscall (darwin-386), const SOCK_MAXADDRLEN = 255 +pkg syscall (darwin-386), const SOCK_RDM = 4 +pkg syscall (darwin-386), const SOL_SOCKET = 65535 +pkg syscall (darwin-386), const SOMAXCONN = 128 +pkg syscall (darwin-386), const SO_ACCEPTCONN = 2 +pkg syscall (darwin-386), const SO_BROADCAST = 32 +pkg syscall (darwin-386), const SO_DEBUG = 1 +pkg syscall (darwin-386), const SO_DONTROUTE = 16 +pkg syscall (darwin-386), const SO_DONTTRUNC = 8192 +pkg syscall (darwin-386), const SO_ERROR = 4103 +pkg syscall (darwin-386), const SO_KEEPALIVE = 8 +pkg syscall (darwin-386), const SO_LABEL = 4112 +pkg syscall (darwin-386), const SO_LINGER = 128 +pkg syscall (darwin-386), const SO_LINGER_SEC = 4224 +pkg syscall (darwin-386), const SO_NKE = 4129 +pkg syscall (darwin-386), const SO_NOADDRERR = 4131 +pkg syscall (darwin-386), const SO_NOSIGPIPE = 4130 +pkg syscall (darwin-386), const SO_NOTIFYCONFLICT = 4134 +pkg syscall (darwin-386), const SO_NP_EXTENSIONS = 4227 +pkg syscall (darwin-386), const SO_NREAD = 4128 +pkg syscall (darwin-386), const SO_NWRITE = 4132 +pkg syscall (darwin-386), const SO_OOBINLINE = 256 +pkg syscall (darwin-386), const SO_PEERLABEL = 4113 +pkg syscall (darwin-386), const SO_RANDOMPORT = 4226 +pkg syscall (darwin-386), const SO_RCVBUF = 4098 +pkg syscall (darwin-386), const SO_RCVLOWAT = 4100 +pkg syscall (darwin-386), const SO_RCVTIMEO = 4102 +pkg syscall (darwin-386), const SO_RESTRICTIONS = 4225 +pkg syscall (darwin-386), const SO_RESTRICT_DENYIN = 1 +pkg syscall (darwin-386), const SO_RESTRICT_DENYOUT = 2 +pkg syscall (darwin-386), const SO_RESTRICT_DENYSET = 2147483648 +pkg syscall (darwin-386), const SO_REUSEADDR = 4 +pkg syscall (darwin-386), const SO_REUSEPORT = 512 +pkg syscall (darwin-386), const SO_REUSESHAREUID = 4133 +pkg syscall (darwin-386), const SO_SNDBUF = 4097 +pkg syscall (darwin-386), const SO_SNDLOWAT = 4099 +pkg syscall (darwin-386), const SO_SNDTIMEO = 4101 +pkg syscall (darwin-386), const SO_TIMESTAMP = 1024 +pkg syscall (darwin-386), const SO_TIMESTAMP_MONOTONIC = 2048 +pkg syscall (darwin-386), const SO_TYPE = 4104 +pkg syscall (darwin-386), const SO_UPCALLCLOSEWAIT = 4135 +pkg syscall (darwin-386), const SO_USELOOPBACK = 64 +pkg syscall (darwin-386), const SO_WANTMORE = 16384 +pkg syscall (darwin-386), const SO_WANTOOBFLAG = 32768 +pkg syscall (darwin-386), const SYS_ACCEPT = 30 +pkg syscall (darwin-386), const SYS_ACCEPT_NOCANCEL = 404 +pkg syscall (darwin-386), const SYS_ACCESS = 33 +pkg syscall (darwin-386), const SYS_ACCESS_EXTENDED = 284 +pkg syscall (darwin-386), const SYS_ACCT = 51 +pkg syscall (darwin-386), const SYS_ADD_PROFIL = 176 +pkg syscall (darwin-386), const SYS_ADJTIME = 140 +pkg syscall (darwin-386), const SYS_AIO_CANCEL = 316 +pkg syscall (darwin-386), const SYS_AIO_ERROR = 317 +pkg syscall (darwin-386), const SYS_AIO_FSYNC = 313 +pkg syscall (darwin-386), const SYS_AIO_READ = 318 +pkg syscall (darwin-386), const SYS_AIO_RETURN = 314 +pkg syscall (darwin-386), const SYS_AIO_SUSPEND = 315 +pkg syscall (darwin-386), const SYS_AIO_SUSPEND_NOCANCEL = 421 +pkg syscall (darwin-386), const SYS_AIO_WRITE = 319 +pkg syscall (darwin-386), const SYS_ATGETMSG = 207 +pkg syscall (darwin-386), const SYS_ATPGETREQ = 211 +pkg syscall (darwin-386), const SYS_ATPGETRSP = 212 +pkg syscall (darwin-386), const SYS_ATPSNDREQ = 209 +pkg syscall (darwin-386), const SYS_ATPSNDRSP = 210 +pkg syscall (darwin-386), const SYS_ATPUTMSG = 208 +pkg syscall (darwin-386), const SYS_ATSOCKET = 206 +pkg syscall (darwin-386), const SYS_AUDIT = 350 +pkg syscall (darwin-386), const SYS_AUDITCTL = 359 +pkg syscall (darwin-386), const SYS_AUDITON = 351 +pkg syscall (darwin-386), const SYS_AUDIT_SESSION_JOIN = 429 +pkg syscall (darwin-386), const SYS_AUDIT_SESSION_PORT = 432 +pkg syscall (darwin-386), const SYS_AUDIT_SESSION_SELF = 428 +pkg syscall (darwin-386), const SYS_BIND = 104 +pkg syscall (darwin-386), const SYS_BSDTHREAD_CREATE = 360 +pkg syscall (darwin-386), const SYS_BSDTHREAD_REGISTER = 366 +pkg syscall (darwin-386), const SYS_BSDTHREAD_TERMINATE = 361 +pkg syscall (darwin-386), const SYS_CHDIR = 12 +pkg syscall (darwin-386), const SYS_CHFLAGS = 34 +pkg syscall (darwin-386), const SYS_CHMOD = 15 +pkg syscall (darwin-386), const SYS_CHMOD_EXTENDED = 282 +pkg syscall (darwin-386), const SYS_CHOWN = 16 +pkg syscall (darwin-386), const SYS_CHROOT = 61 +pkg syscall (darwin-386), const SYS_CHUD = 185 +pkg syscall (darwin-386), const SYS_CLOSE = 6 +pkg syscall (darwin-386), const SYS_CLOSE_NOCANCEL = 399 +pkg syscall (darwin-386), const SYS_CONNECT = 98 +pkg syscall (darwin-386), const SYS_CONNECT_NOCANCEL = 409 +pkg syscall (darwin-386), const SYS_COPYFILE = 227 +pkg syscall (darwin-386), const SYS_CSOPS = 169 +pkg syscall (darwin-386), const SYS_DELETE = 226 +pkg syscall (darwin-386), const SYS_DUP = 41 +pkg syscall (darwin-386), const SYS_DUP2 = 90 +pkg syscall (darwin-386), const SYS_EXCHANGEDATA = 223 +pkg syscall (darwin-386), const SYS_EXECVE = 59 +pkg syscall (darwin-386), const SYS_EXIT = 1 +pkg syscall (darwin-386), const SYS_FCHDIR = 13 +pkg syscall (darwin-386), const SYS_FCHFLAGS = 35 +pkg syscall (darwin-386), const SYS_FCHMOD = 124 +pkg syscall (darwin-386), const SYS_FCHMOD_EXTENDED = 283 +pkg syscall (darwin-386), const SYS_FCHOWN = 123 +pkg syscall (darwin-386), const SYS_FCNTL = 92 +pkg syscall (darwin-386), const SYS_FCNTL_NOCANCEL = 406 +pkg syscall (darwin-386), const SYS_FDATASYNC = 187 +pkg syscall (darwin-386), const SYS_FFSCTL = 245 +pkg syscall (darwin-386), const SYS_FGETATTRLIST = 228 +pkg syscall (darwin-386), const SYS_FGETXATTR = 235 +pkg syscall (darwin-386), const SYS_FHOPEN = 248 +pkg syscall (darwin-386), const SYS_FILEPORT_MAKEFD = 431 +pkg syscall (darwin-386), const SYS_FILEPORT_MAKEPORT = 430 +pkg syscall (darwin-386), const SYS_FLISTXATTR = 241 +pkg syscall (darwin-386), const SYS_FLOCK = 131 +pkg syscall (darwin-386), const SYS_FORK = 2 +pkg syscall (darwin-386), const SYS_FPATHCONF = 192 +pkg syscall (darwin-386), const SYS_FREMOVEXATTR = 239 +pkg syscall (darwin-386), const SYS_FSCTL = 242 +pkg syscall (darwin-386), const SYS_FSETATTRLIST = 229 +pkg syscall (darwin-386), const SYS_FSETXATTR = 237 +pkg syscall (darwin-386), const SYS_FSGETPATH = 427 +pkg syscall (darwin-386), const SYS_FSTAT = 189 +pkg syscall (darwin-386), const SYS_FSTAT64 = 339 +pkg syscall (darwin-386), const SYS_FSTAT64_EXTENDED = 343 +pkg syscall (darwin-386), const SYS_FSTATFS = 158 +pkg syscall (darwin-386), const SYS_FSTATFS64 = 346 +pkg syscall (darwin-386), const SYS_FSTATV = 219 +pkg syscall (darwin-386), const SYS_FSTAT_EXTENDED = 281 +pkg syscall (darwin-386), const SYS_FSYNC = 95 +pkg syscall (darwin-386), const SYS_FSYNC_NOCANCEL = 408 +pkg syscall (darwin-386), const SYS_FTRUNCATE = 201 +pkg syscall (darwin-386), const SYS_FUTIMES = 139 +pkg syscall (darwin-386), const SYS_GETATTRLIST = 220 +pkg syscall (darwin-386), const SYS_GETAUDIT = 355 +pkg syscall (darwin-386), const SYS_GETAUDIT_ADDR = 357 +pkg syscall (darwin-386), const SYS_GETAUID = 353 +pkg syscall (darwin-386), const SYS_GETDIRENTRIES = 196 +pkg syscall (darwin-386), const SYS_GETDIRENTRIES64 = 344 +pkg syscall (darwin-386), const SYS_GETDIRENTRIESATTR = 222 +pkg syscall (darwin-386), const SYS_GETDTABLESIZE = 89 +pkg syscall (darwin-386), const SYS_GETEGID = 43 +pkg syscall (darwin-386), const SYS_GETEUID = 25 +pkg syscall (darwin-386), const SYS_GETFH = 161 +pkg syscall (darwin-386), const SYS_GETFSSTAT = 18 +pkg syscall (darwin-386), const SYS_GETFSSTAT64 = 347 +pkg syscall (darwin-386), const SYS_GETGID = 47 +pkg syscall (darwin-386), const SYS_GETGROUPS = 79 +pkg syscall (darwin-386), const SYS_GETHOSTUUID = 142 +pkg syscall (darwin-386), const SYS_GETITIMER = 86 +pkg syscall (darwin-386), const SYS_GETLCID = 395 +pkg syscall (darwin-386), const SYS_GETLOGIN = 49 +pkg syscall (darwin-386), const SYS_GETPEERNAME = 31 +pkg syscall (darwin-386), const SYS_GETPGID = 151 +pkg syscall (darwin-386), const SYS_GETPGRP = 81 +pkg syscall (darwin-386), const SYS_GETPID = 20 +pkg syscall (darwin-386), const SYS_GETPPID = 39 +pkg syscall (darwin-386), const SYS_GETPRIORITY = 100 +pkg syscall (darwin-386), const SYS_GETRLIMIT = 194 +pkg syscall (darwin-386), const SYS_GETRUSAGE = 117 +pkg syscall (darwin-386), const SYS_GETSGROUPS = 288 +pkg syscall (darwin-386), const SYS_GETSID = 310 +pkg syscall (darwin-386), const SYS_GETSOCKNAME = 32 +pkg syscall (darwin-386), const SYS_GETSOCKOPT = 118 +pkg syscall (darwin-386), const SYS_GETTID = 286 +pkg syscall (darwin-386), const SYS_GETTIMEOFDAY = 116 +pkg syscall (darwin-386), const SYS_GETUID = 24 +pkg syscall (darwin-386), const SYS_GETWGROUPS = 290 +pkg syscall (darwin-386), const SYS_GETXATTR = 234 +pkg syscall (darwin-386), const SYS_IDENTITYSVC = 293 +pkg syscall (darwin-386), const SYS_INITGROUPS = 243 +pkg syscall (darwin-386), const SYS_IOCTL = 54 +pkg syscall (darwin-386), const SYS_IOPOLICYSYS = 322 +pkg syscall (darwin-386), const SYS_ISSETUGID = 327 +pkg syscall (darwin-386), const SYS_KDEBUG_TRACE = 180 +pkg syscall (darwin-386), const SYS_KEVENT = 363 +pkg syscall (darwin-386), const SYS_KEVENT64 = 369 +pkg syscall (darwin-386), const SYS_KILL = 37 +pkg syscall (darwin-386), const SYS_KQUEUE = 362 +pkg syscall (darwin-386), const SYS_LCHOWN = 364 +pkg syscall (darwin-386), const SYS_LINK = 9 +pkg syscall (darwin-386), const SYS_LIO_LISTIO = 320 +pkg syscall (darwin-386), const SYS_LISTEN = 106 +pkg syscall (darwin-386), const SYS_LISTXATTR = 240 +pkg syscall (darwin-386), const SYS_LSEEK = 199 +pkg syscall (darwin-386), const SYS_LSTAT = 190 +pkg syscall (darwin-386), const SYS_LSTAT64 = 340 +pkg syscall (darwin-386), const SYS_LSTAT64_EXTENDED = 342 +pkg syscall (darwin-386), const SYS_LSTATV = 218 +pkg syscall (darwin-386), const SYS_LSTAT_EXTENDED = 280 +pkg syscall (darwin-386), const SYS_MADVISE = 75 +pkg syscall (darwin-386), const SYS_MAXSYSCALL = 439 +pkg syscall (darwin-386), const SYS_MINCORE = 78 +pkg syscall (darwin-386), const SYS_MINHERIT = 250 +pkg syscall (darwin-386), const SYS_MKCOMPLEX = 216 +pkg syscall (darwin-386), const SYS_MKDIR = 136 +pkg syscall (darwin-386), const SYS_MKDIR_EXTENDED = 292 +pkg syscall (darwin-386), const SYS_MKFIFO = 132 +pkg syscall (darwin-386), const SYS_MKFIFO_EXTENDED = 291 +pkg syscall (darwin-386), const SYS_MKNOD = 14 +pkg syscall (darwin-386), const SYS_MLOCK = 203 +pkg syscall (darwin-386), const SYS_MLOCKALL = 324 +pkg syscall (darwin-386), const SYS_MMAP = 197 +pkg syscall (darwin-386), const SYS_MODWATCH = 233 +pkg syscall (darwin-386), const SYS_MOUNT = 167 +pkg syscall (darwin-386), const SYS_MPROTECT = 74 +pkg syscall (darwin-386), const SYS_MSGCTL = 258 +pkg syscall (darwin-386), const SYS_MSGGET = 259 +pkg syscall (darwin-386), const SYS_MSGRCV = 261 +pkg syscall (darwin-386), const SYS_MSGRCV_NOCANCEL = 419 +pkg syscall (darwin-386), const SYS_MSGSND = 260 +pkg syscall (darwin-386), const SYS_MSGSND_NOCANCEL = 418 +pkg syscall (darwin-386), const SYS_MSGSYS = 252 +pkg syscall (darwin-386), const SYS_MSYNC = 65 +pkg syscall (darwin-386), const SYS_MSYNC_NOCANCEL = 405 +pkg syscall (darwin-386), const SYS_MUNLOCK = 204 +pkg syscall (darwin-386), const SYS_MUNLOCKALL = 325 +pkg syscall (darwin-386), const SYS_MUNMAP = 73 +pkg syscall (darwin-386), const SYS_NFSCLNT = 247 +pkg syscall (darwin-386), const SYS_NFSSVC = 155 +pkg syscall (darwin-386), const SYS_OPEN = 5 +pkg syscall (darwin-386), const SYS_OPEN_EXTENDED = 277 +pkg syscall (darwin-386), const SYS_OPEN_NOCANCEL = 398 +pkg syscall (darwin-386), const SYS_PATHCONF = 191 +pkg syscall (darwin-386), const SYS_PID_HIBERNATE = 435 +pkg syscall (darwin-386), const SYS_PID_RESUME = 434 +pkg syscall (darwin-386), const SYS_PID_SHUTDOWN_SOCKETS = 436 +pkg syscall (darwin-386), const SYS_PID_SUSPEND = 433 +pkg syscall (darwin-386), const SYS_PIPE = 42 +pkg syscall (darwin-386), const SYS_POLL = 230 +pkg syscall (darwin-386), const SYS_POLL_NOCANCEL = 417 +pkg syscall (darwin-386), const SYS_POSIX_SPAWN = 244 +pkg syscall (darwin-386), const SYS_PREAD = 153 +pkg syscall (darwin-386), const SYS_PREAD_NOCANCEL = 414 +pkg syscall (darwin-386), const SYS_PROCESS_POLICY = 323 +pkg syscall (darwin-386), const SYS_PROC_INFO = 336 +pkg syscall (darwin-386), const SYS_PROFIL = 44 +pkg syscall (darwin-386), const SYS_PSYNCH_CVBROAD = 303 +pkg syscall (darwin-386), const SYS_PSYNCH_CVCLRPREPOST = 312 +pkg syscall (darwin-386), const SYS_PSYNCH_CVSIGNAL = 304 +pkg syscall (darwin-386), const SYS_PSYNCH_CVWAIT = 305 +pkg syscall (darwin-386), const SYS_PSYNCH_MUTEXDROP = 302 +pkg syscall (darwin-386), const SYS_PSYNCH_MUTEXWAIT = 301 +pkg syscall (darwin-386), const SYS_PSYNCH_RW_DOWNGRADE = 299 +pkg syscall (darwin-386), const SYS_PSYNCH_RW_LONGRDLOCK = 297 +pkg syscall (darwin-386), const SYS_PSYNCH_RW_RDLOCK = 306 +pkg syscall (darwin-386), const SYS_PSYNCH_RW_UNLOCK = 308 +pkg syscall (darwin-386), const SYS_PSYNCH_RW_UNLOCK2 = 309 +pkg syscall (darwin-386), const SYS_PSYNCH_RW_UPGRADE = 300 +pkg syscall (darwin-386), const SYS_PSYNCH_RW_WRLOCK = 307 +pkg syscall (darwin-386), const SYS_PSYNCH_RW_YIELDWRLOCK = 298 +pkg syscall (darwin-386), const SYS_PTRACE = 26 +pkg syscall (darwin-386), const SYS_PWRITE = 154 +pkg syscall (darwin-386), const SYS_PWRITE_NOCANCEL = 415 +pkg syscall (darwin-386), const SYS_QUOTACTL = 165 +pkg syscall (darwin-386), const SYS_READ = 3 +pkg syscall (darwin-386), const SYS_READLINK = 58 +pkg syscall (darwin-386), const SYS_READV = 120 +pkg syscall (darwin-386), const SYS_READV_NOCANCEL = 411 +pkg syscall (darwin-386), const SYS_READ_NOCANCEL = 396 +pkg syscall (darwin-386), const SYS_REBOOT = 55 +pkg syscall (darwin-386), const SYS_RECVFROM = 29 +pkg syscall (darwin-386), const SYS_RECVFROM_NOCANCEL = 403 +pkg syscall (darwin-386), const SYS_RECVMSG = 27 +pkg syscall (darwin-386), const SYS_RECVMSG_NOCANCEL = 401 +pkg syscall (darwin-386), const SYS_REMOVEXATTR = 238 +pkg syscall (darwin-386), const SYS_RENAME = 128 +pkg syscall (darwin-386), const SYS_REVOKE = 56 +pkg syscall (darwin-386), const SYS_RMDIR = 137 +pkg syscall (darwin-386), const SYS_SEARCHFS = 225 +pkg syscall (darwin-386), const SYS_SELECT = 93 +pkg syscall (darwin-386), const SYS_SELECT_NOCANCEL = 407 +pkg syscall (darwin-386), const SYS_SEMCTL = 254 +pkg syscall (darwin-386), const SYS_SEMGET = 255 +pkg syscall (darwin-386), const SYS_SEMOP = 256 +pkg syscall (darwin-386), const SYS_SEMSYS = 251 +pkg syscall (darwin-386), const SYS_SEM_CLOSE = 269 +pkg syscall (darwin-386), const SYS_SEM_DESTROY = 276 +pkg syscall (darwin-386), const SYS_SEM_GETVALUE = 274 +pkg syscall (darwin-386), const SYS_SEM_INIT = 275 +pkg syscall (darwin-386), const SYS_SEM_OPEN = 268 +pkg syscall (darwin-386), const SYS_SEM_POST = 273 +pkg syscall (darwin-386), const SYS_SEM_TRYWAIT = 272 +pkg syscall (darwin-386), const SYS_SEM_UNLINK = 270 +pkg syscall (darwin-386), const SYS_SEM_WAIT = 271 +pkg syscall (darwin-386), const SYS_SEM_WAIT_NOCANCEL = 420 +pkg syscall (darwin-386), const SYS_SENDFILE = 337 +pkg syscall (darwin-386), const SYS_SENDMSG = 28 +pkg syscall (darwin-386), const SYS_SENDMSG_NOCANCEL = 402 +pkg syscall (darwin-386), const SYS_SENDTO = 133 +pkg syscall (darwin-386), const SYS_SENDTO_NOCANCEL = 413 +pkg syscall (darwin-386), const SYS_SETATTRLIST = 221 +pkg syscall (darwin-386), const SYS_SETAUDIT = 356 +pkg syscall (darwin-386), const SYS_SETAUDIT_ADDR = 358 +pkg syscall (darwin-386), const SYS_SETAUID = 354 +pkg syscall (darwin-386), const SYS_SETEGID = 182 +pkg syscall (darwin-386), const SYS_SETEUID = 183 +pkg syscall (darwin-386), const SYS_SETGID = 181 +pkg syscall (darwin-386), const SYS_SETGROUPS = 80 +pkg syscall (darwin-386), const SYS_SETITIMER = 83 +pkg syscall (darwin-386), const SYS_SETLCID = 394 +pkg syscall (darwin-386), const SYS_SETLOGIN = 50 +pkg syscall (darwin-386), const SYS_SETPGID = 82 +pkg syscall (darwin-386), const SYS_SETPRIORITY = 96 +pkg syscall (darwin-386), const SYS_SETPRIVEXEC = 152 +pkg syscall (darwin-386), const SYS_SETREGID = 127 +pkg syscall (darwin-386), const SYS_SETREUID = 126 +pkg syscall (darwin-386), const SYS_SETRLIMIT = 195 +pkg syscall (darwin-386), const SYS_SETSGROUPS = 287 +pkg syscall (darwin-386), const SYS_SETSID = 147 +pkg syscall (darwin-386), const SYS_SETSOCKOPT = 105 +pkg syscall (darwin-386), const SYS_SETTID = 285 +pkg syscall (darwin-386), const SYS_SETTID_WITH_PID = 311 +pkg syscall (darwin-386), const SYS_SETTIMEOFDAY = 122 +pkg syscall (darwin-386), const SYS_SETUID = 23 +pkg syscall (darwin-386), const SYS_SETWGROUPS = 289 +pkg syscall (darwin-386), const SYS_SETXATTR = 236 +pkg syscall (darwin-386), const SYS_SHARED_REGION_CHECK_NP = 294 +pkg syscall (darwin-386), const SYS_SHARED_REGION_MAP_AND_SLIDE_NP = 438 +pkg syscall (darwin-386), const SYS_SHMAT = 262 +pkg syscall (darwin-386), const SYS_SHMCTL = 263 +pkg syscall (darwin-386), const SYS_SHMDT = 264 +pkg syscall (darwin-386), const SYS_SHMGET = 265 +pkg syscall (darwin-386), const SYS_SHMSYS = 253 +pkg syscall (darwin-386), const SYS_SHM_OPEN = 266 +pkg syscall (darwin-386), const SYS_SHM_UNLINK = 267 +pkg syscall (darwin-386), const SYS_SHUTDOWN = 134 +pkg syscall (darwin-386), const SYS_SIGACTION = 46 +pkg syscall (darwin-386), const SYS_SIGALTSTACK = 53 +pkg syscall (darwin-386), const SYS_SIGPENDING = 52 +pkg syscall (darwin-386), const SYS_SIGPROCMASK = 48 +pkg syscall (darwin-386), const SYS_SIGRETURN = 184 +pkg syscall (darwin-386), const SYS_SIGSUSPEND = 111 +pkg syscall (darwin-386), const SYS_SIGSUSPEND_NOCANCEL = 410 +pkg syscall (darwin-386), const SYS_SOCKET = 97 +pkg syscall (darwin-386), const SYS_SOCKETPAIR = 135 +pkg syscall (darwin-386), const SYS_STACK_SNAPSHOT = 365 +pkg syscall (darwin-386), const SYS_STAT = 188 +pkg syscall (darwin-386), const SYS_STAT64 = 338 +pkg syscall (darwin-386), const SYS_STAT64_EXTENDED = 341 +pkg syscall (darwin-386), const SYS_STATFS = 157 +pkg syscall (darwin-386), const SYS_STATFS64 = 345 +pkg syscall (darwin-386), const SYS_STATV = 217 +pkg syscall (darwin-386), const SYS_STAT_EXTENDED = 279 +pkg syscall (darwin-386), const SYS_SWAPON = 85 +pkg syscall (darwin-386), const SYS_SYMLINK = 57 +pkg syscall (darwin-386), const SYS_SYNC = 36 +pkg syscall (darwin-386), const SYS_SYSCALL = 0 +pkg syscall (darwin-386), const SYS_THREAD_SELFID = 372 +pkg syscall (darwin-386), const SYS_TRUNCATE = 200 +pkg syscall (darwin-386), const SYS_UMASK = 60 +pkg syscall (darwin-386), const SYS_UMASK_EXTENDED = 278 +pkg syscall (darwin-386), const SYS_UNDELETE = 205 +pkg syscall (darwin-386), const SYS_UNLINK = 10 +pkg syscall (darwin-386), const SYS_UNMOUNT = 159 +pkg syscall (darwin-386), const SYS_UTIMES = 138 +pkg syscall (darwin-386), const SYS_VFORK = 66 +pkg syscall (darwin-386), const SYS_VM_PRESSURE_MONITOR = 296 +pkg syscall (darwin-386), const SYS_WAIT4 = 7 +pkg syscall (darwin-386), const SYS_WAIT4_NOCANCEL = 400 +pkg syscall (darwin-386), const SYS_WAITEVENT = 232 +pkg syscall (darwin-386), const SYS_WAITID = 173 +pkg syscall (darwin-386), const SYS_WAITID_NOCANCEL = 416 +pkg syscall (darwin-386), const SYS_WATCHEVENT = 231 +pkg syscall (darwin-386), const SYS_WORKQ_KERNRETURN = 368 +pkg syscall (darwin-386), const SYS_WORKQ_OPEN = 367 +pkg syscall (darwin-386), const SYS_WRITE = 4 +pkg syscall (darwin-386), const SYS_WRITEV = 121 +pkg syscall (darwin-386), const SYS_WRITEV_NOCANCEL = 412 +pkg syscall (darwin-386), const SYS_WRITE_NOCANCEL = 397 +pkg syscall (darwin-386), const SYS___DISABLE_THREADSIGNAL = 331 +pkg syscall (darwin-386), const SYS___MAC_EXECVE = 380 +pkg syscall (darwin-386), const SYS___MAC_GETFSSTAT = 426 +pkg syscall (darwin-386), const SYS___MAC_GET_FD = 388 +pkg syscall (darwin-386), const SYS___MAC_GET_FILE = 382 +pkg syscall (darwin-386), const SYS___MAC_GET_LCID = 391 +pkg syscall (darwin-386), const SYS___MAC_GET_LCTX = 392 +pkg syscall (darwin-386), const SYS___MAC_GET_LINK = 384 +pkg syscall (darwin-386), const SYS___MAC_GET_MOUNT = 425 +pkg syscall (darwin-386), const SYS___MAC_GET_PID = 390 +pkg syscall (darwin-386), const SYS___MAC_GET_PROC = 386 +pkg syscall (darwin-386), const SYS___MAC_MOUNT = 424 +pkg syscall (darwin-386), const SYS___MAC_SET_FD = 389 +pkg syscall (darwin-386), const SYS___MAC_SET_FILE = 383 +pkg syscall (darwin-386), const SYS___MAC_SET_LCTX = 393 +pkg syscall (darwin-386), const SYS___MAC_SET_LINK = 385 +pkg syscall (darwin-386), const SYS___MAC_SET_PROC = 387 +pkg syscall (darwin-386), const SYS___MAC_SYSCALL = 381 +pkg syscall (darwin-386), const SYS___OLD_SEMWAIT_SIGNAL = 370 +pkg syscall (darwin-386), const SYS___OLD_SEMWAIT_SIGNAL_NOCANCEL = 371 +pkg syscall (darwin-386), const SYS___PTHREAD_CANCELED = 333 +pkg syscall (darwin-386), const SYS___PTHREAD_CHDIR = 348 +pkg syscall (darwin-386), const SYS___PTHREAD_FCHDIR = 349 +pkg syscall (darwin-386), const SYS___PTHREAD_KILL = 328 +pkg syscall (darwin-386), const SYS___PTHREAD_MARKCANCEL = 332 +pkg syscall (darwin-386), const SYS___PTHREAD_SIGMASK = 329 +pkg syscall (darwin-386), const SYS___SEMWAIT_SIGNAL = 334 +pkg syscall (darwin-386), const SYS___SEMWAIT_SIGNAL_NOCANCEL = 423 +pkg syscall (darwin-386), const SYS___SIGWAIT = 330 +pkg syscall (darwin-386), const SYS___SIGWAIT_NOCANCEL = 422 +pkg syscall (darwin-386), const SYS___SYSCTL = 202 +pkg syscall (darwin-386), const S_IEXEC = 64 +pkg syscall (darwin-386), const S_IFMT = 61440 +pkg syscall (darwin-386), const S_IFWHT = 57344 +pkg syscall (darwin-386), const S_IREAD = 256 +pkg syscall (darwin-386), const S_IRGRP = 32 +pkg syscall (darwin-386), const S_IROTH = 4 +pkg syscall (darwin-386), const S_IRWXG = 56 +pkg syscall (darwin-386), const S_IRWXO = 7 +pkg syscall (darwin-386), const S_IRWXU = 448 +pkg syscall (darwin-386), const S_ISTXT = 512 +pkg syscall (darwin-386), const S_IWGRP = 16 +pkg syscall (darwin-386), const S_IWOTH = 2 +pkg syscall (darwin-386), const S_IWRITE = 128 +pkg syscall (darwin-386), const S_IXGRP = 8 +pkg syscall (darwin-386), const S_IXOTH = 1 +pkg syscall (darwin-386), const SizeofBpfHdr = 20 +pkg syscall (darwin-386), const SizeofBpfInsn = 8 +pkg syscall (darwin-386), const SizeofBpfProgram = 8 +pkg syscall (darwin-386), const SizeofBpfStat = 8 +pkg syscall (darwin-386), const SizeofBpfVersion = 4 +pkg syscall (darwin-386), const SizeofCmsghdr = 12 +pkg syscall (darwin-386), const SizeofIPMreq = 8 +pkg syscall (darwin-386), const SizeofIPv6Mreq = 20 +pkg syscall (darwin-386), const SizeofIfData = 96 +pkg syscall (darwin-386), const SizeofIfMsghdr = 112 +pkg syscall (darwin-386), const SizeofIfaMsghdr = 20 +pkg syscall (darwin-386), const SizeofIfmaMsghdr = 16 +pkg syscall (darwin-386), const SizeofIfmaMsghdr2 = 20 +pkg syscall (darwin-386), const SizeofInet4Pktinfo = 12 +pkg syscall (darwin-386), const SizeofInet4Pktinfo ideal-int +pkg syscall (darwin-386), const SizeofInet6Pktinfo = 20 +pkg syscall (darwin-386), const SizeofLinger = 8 +pkg syscall (darwin-386), const SizeofMsghdr = 28 +pkg syscall (darwin-386), const SizeofRtMetrics = 56 +pkg syscall (darwin-386), const SizeofRtMsghdr = 92 +pkg syscall (darwin-386), const SizeofSockaddrAny = 108 +pkg syscall (darwin-386), const SizeofSockaddrDatalink = 20 +pkg syscall (darwin-386), const SizeofSockaddrInet4 = 16 +pkg syscall (darwin-386), const SizeofSockaddrInet6 = 28 +pkg syscall (darwin-386), const SizeofSockaddrUnix = 106 +pkg syscall (darwin-386), const TCIFLUSH = 1 +pkg syscall (darwin-386), const TCIFLUSH ideal-int +pkg syscall (darwin-386), const TCIOFLUSH = 3 +pkg syscall (darwin-386), const TCIOFLUSH ideal-int +pkg syscall (darwin-386), const TCOFLUSH = 2 +pkg syscall (darwin-386), const TCOFLUSH ideal-int +pkg syscall (darwin-386), const TCP_CONNECTIONTIMEOUT = 32 +pkg syscall (darwin-386), const TCP_KEEPALIVE = 16 +pkg syscall (darwin-386), const TCP_MAXHLEN = 60 +pkg syscall (darwin-386), const TCP_MAXOLEN = 40 +pkg syscall (darwin-386), const TCP_MAXSEG = 2 +pkg syscall (darwin-386), const TCP_MAXWIN = 65535 +pkg syscall (darwin-386), const TCP_MAX_SACK = 3 +pkg syscall (darwin-386), const TCP_MAX_WINSHIFT = 14 +pkg syscall (darwin-386), const TCP_MINMSS = 216 +pkg syscall (darwin-386), const TCP_MINMSSOVERLOAD = 1000 +pkg syscall (darwin-386), const TCP_MSS = 512 +pkg syscall (darwin-386), const TCP_NOOPT = 8 +pkg syscall (darwin-386), const TCP_NOPUSH = 4 +pkg syscall (darwin-386), const TCP_RXT_CONNDROPTIME = 128 +pkg syscall (darwin-386), const TCP_RXT_FINDROP = 256 +pkg syscall (darwin-386), const TCSAFLUSH = 2 +pkg syscall (darwin-386), const TCSAFLUSH ideal-int +pkg syscall (darwin-386), const TIOCCBRK = 536900730 +pkg syscall (darwin-386), const TIOCCDTR = 536900728 +pkg syscall (darwin-386), const TIOCCONS = 2147775586 +pkg syscall (darwin-386), const TIOCDCDTIMESTAMP = 1074295896 +pkg syscall (darwin-386), const TIOCDRAIN = 536900702 +pkg syscall (darwin-386), const TIOCDSIMICROCODE = 536900693 +pkg syscall (darwin-386), const TIOCEXCL = 536900621 +pkg syscall (darwin-386), const TIOCEXT = 2147775584 +pkg syscall (darwin-386), const TIOCFLUSH = 2147775504 +pkg syscall (darwin-386), const TIOCGDRAINWAIT = 1074033750 +pkg syscall (darwin-386), const TIOCGETA = 1076655123 +pkg syscall (darwin-386), const TIOCGETD = 1074033690 +pkg syscall (darwin-386), const TIOCGPGRP = 1074033783 +pkg syscall (darwin-386), const TIOCGWINSZ = 1074295912 +pkg syscall (darwin-386), const TIOCIXOFF = 536900736 +pkg syscall (darwin-386), const TIOCIXON = 536900737 +pkg syscall (darwin-386), const TIOCMBIC = 2147775595 +pkg syscall (darwin-386), const TIOCMBIS = 2147775596 +pkg syscall (darwin-386), const TIOCMGDTRWAIT = 1074033754 +pkg syscall (darwin-386), const TIOCMGET = 1074033770 +pkg syscall (darwin-386), const TIOCMODG = 1074033667 +pkg syscall (darwin-386), const TIOCMODS = 2147775492 +pkg syscall (darwin-386), const TIOCMSDTRWAIT = 2147775579 +pkg syscall (darwin-386), const TIOCMSET = 2147775597 +pkg syscall (darwin-386), const TIOCM_CAR = 64 +pkg syscall (darwin-386), const TIOCM_CD = 64 +pkg syscall (darwin-386), const TIOCM_CTS = 32 +pkg syscall (darwin-386), const TIOCM_DSR = 256 +pkg syscall (darwin-386), const TIOCM_DTR = 2 +pkg syscall (darwin-386), const TIOCM_LE = 1 +pkg syscall (darwin-386), const TIOCM_RI = 128 +pkg syscall (darwin-386), const TIOCM_RNG = 128 +pkg syscall (darwin-386), const TIOCM_RTS = 4 +pkg syscall (darwin-386), const TIOCM_SR = 16 +pkg syscall (darwin-386), const TIOCM_ST = 8 +pkg syscall (darwin-386), const TIOCNOTTY = 536900721 +pkg syscall (darwin-386), const TIOCNXCL = 536900622 +pkg syscall (darwin-386), const TIOCOUTQ = 1074033779 +pkg syscall (darwin-386), const TIOCPKT = 2147775600 +pkg syscall (darwin-386), const TIOCPKT_DATA = 0 +pkg syscall (darwin-386), const TIOCPKT_DOSTOP = 32 +pkg syscall (darwin-386), const TIOCPKT_FLUSHREAD = 1 +pkg syscall (darwin-386), const TIOCPKT_FLUSHWRITE = 2 +pkg syscall (darwin-386), const TIOCPKT_IOCTL = 64 +pkg syscall (darwin-386), const TIOCPKT_NOSTOP = 16 +pkg syscall (darwin-386), const TIOCPKT_START = 8 +pkg syscall (darwin-386), const TIOCPKT_STOP = 4 +pkg syscall (darwin-386), const TIOCPTYGNAME = 1082160211 +pkg syscall (darwin-386), const TIOCPTYGRANT = 536900692 +pkg syscall (darwin-386), const TIOCPTYUNLK = 536900690 +pkg syscall (darwin-386), const TIOCREMOTE = 2147775593 +pkg syscall (darwin-386), const TIOCSBRK = 536900731 +pkg syscall (darwin-386), const TIOCSCONS = 536900707 +pkg syscall (darwin-386), const TIOCSCTTY = 536900705 +pkg syscall (darwin-386), const TIOCSDRAINWAIT = 2147775575 +pkg syscall (darwin-386), const TIOCSDTR = 536900729 +pkg syscall (darwin-386), const TIOCSETA = 2150396948 +pkg syscall (darwin-386), const TIOCSETAF = 2150396950 +pkg syscall (darwin-386), const TIOCSETAW = 2150396949 +pkg syscall (darwin-386), const TIOCSETD = 2147775515 +pkg syscall (darwin-386), const TIOCSIG = 536900703 +pkg syscall (darwin-386), const TIOCSPGRP = 2147775606 +pkg syscall (darwin-386), const TIOCSTART = 536900718 +pkg syscall (darwin-386), const TIOCSTAT = 536900709 +pkg syscall (darwin-386), const TIOCSTI = 2147578994 +pkg syscall (darwin-386), const TIOCSTOP = 536900719 +pkg syscall (darwin-386), const TIOCSWINSZ = 2148037735 +pkg syscall (darwin-386), const TIOCTIMESTAMP = 1074295897 +pkg syscall (darwin-386), const TIOCUCNTL = 2147775590 +pkg syscall (darwin-386), const TOSTOP = 4194304 +pkg syscall (darwin-386), const TOSTOP ideal-int +pkg syscall (darwin-386), const VDISCARD = 15 +pkg syscall (darwin-386), const VDISCARD ideal-int +pkg syscall (darwin-386), const VDSUSP = 11 +pkg syscall (darwin-386), const VDSUSP ideal-int +pkg syscall (darwin-386), const VEOF = 0 +pkg syscall (darwin-386), const VEOF ideal-int +pkg syscall (darwin-386), const VEOL = 1 +pkg syscall (darwin-386), const VEOL ideal-int +pkg syscall (darwin-386), const VEOL2 = 2 +pkg syscall (darwin-386), const VEOL2 ideal-int +pkg syscall (darwin-386), const VERASE = 3 +pkg syscall (darwin-386), const VERASE ideal-int +pkg syscall (darwin-386), const VINTR = 8 +pkg syscall (darwin-386), const VINTR ideal-int +pkg syscall (darwin-386), const VKILL = 5 +pkg syscall (darwin-386), const VKILL ideal-int +pkg syscall (darwin-386), const VLNEXT = 14 +pkg syscall (darwin-386), const VLNEXT ideal-int +pkg syscall (darwin-386), const VMIN = 16 +pkg syscall (darwin-386), const VMIN ideal-int +pkg syscall (darwin-386), const VQUIT = 9 +pkg syscall (darwin-386), const VQUIT ideal-int +pkg syscall (darwin-386), const VREPRINT = 6 +pkg syscall (darwin-386), const VREPRINT ideal-int +pkg syscall (darwin-386), const VSTART = 12 +pkg syscall (darwin-386), const VSTART ideal-int +pkg syscall (darwin-386), const VSTATUS = 18 +pkg syscall (darwin-386), const VSTATUS ideal-int +pkg syscall (darwin-386), const VSTOP = 13 +pkg syscall (darwin-386), const VSTOP ideal-int +pkg syscall (darwin-386), const VSUSP = 10 +pkg syscall (darwin-386), const VSUSP ideal-int +pkg syscall (darwin-386), const VT0 = 0 +pkg syscall (darwin-386), const VT0 ideal-int +pkg syscall (darwin-386), const VT1 = 65536 +pkg syscall (darwin-386), const VT1 ideal-int +pkg syscall (darwin-386), const VTDLY = 65536 +pkg syscall (darwin-386), const VTDLY ideal-int +pkg syscall (darwin-386), const VTIME = 17 +pkg syscall (darwin-386), const VTIME ideal-int +pkg syscall (darwin-386), const VWERASE = 4 +pkg syscall (darwin-386), const VWERASE ideal-int +pkg syscall (darwin-386), const WCONTINUED = 16 +pkg syscall (darwin-386), const WCOREFLAG = 128 +pkg syscall (darwin-386), const WEXITED = 4 +pkg syscall (darwin-386), const WNOHANG = 1 +pkg syscall (darwin-386), const WNOWAIT = 32 +pkg syscall (darwin-386), const WORDSIZE = 32 +pkg syscall (darwin-386), const WSTOPPED = 8 +pkg syscall (darwin-386), const WUNTRACED = 2 +pkg syscall (darwin-386), func Fchflags(int, int) error +pkg syscall (darwin-386), func SlicePtrFromStrings([]string) ([]*uint8, error) +pkg syscall (darwin-386), type Inet4Pktinfo struct +pkg syscall (darwin-386), type Inet4Pktinfo struct, Addr [4]uint8 +pkg syscall (darwin-386), type Inet4Pktinfo struct, Ifindex uint32 +pkg syscall (darwin-386), type Inet4Pktinfo struct, Spec_dst [4]uint8 +pkg syscall (darwin-386), type Termios struct +pkg syscall (darwin-386), type Termios struct, Cc [20]uint8 +pkg syscall (darwin-386), type Termios struct, Cflag uint32 +pkg syscall (darwin-386), type Termios struct, Iflag uint32 +pkg syscall (darwin-386), type Termios struct, Ispeed uint32 +pkg syscall (darwin-386), type Termios struct, Lflag uint32 +pkg syscall (darwin-386), type Termios struct, Oflag uint32 +pkg syscall (darwin-386), type Termios struct, Ospeed uint32 +pkg syscall (darwin-386-cgo), const AF_APPLETALK = 16 +pkg syscall (darwin-386-cgo), const AF_CCITT = 10 +pkg syscall (darwin-386-cgo), const AF_CHAOS = 5 +pkg syscall (darwin-386-cgo), const AF_CNT = 21 +pkg syscall (darwin-386-cgo), const AF_COIP = 20 +pkg syscall (darwin-386-cgo), const AF_DATAKIT = 9 +pkg syscall (darwin-386-cgo), const AF_DECnet = 12 +pkg syscall (darwin-386-cgo), const AF_DLI = 13 +pkg syscall (darwin-386-cgo), const AF_E164 = 28 +pkg syscall (darwin-386-cgo), const AF_ECMA = 8 +pkg syscall (darwin-386-cgo), const AF_HYLINK = 15 +pkg syscall (darwin-386-cgo), const AF_IEEE80211 = 37 +pkg syscall (darwin-386-cgo), const AF_IMPLINK = 3 +pkg syscall (darwin-386-cgo), const AF_INET6 = 30 +pkg syscall (darwin-386-cgo), const AF_IPX = 23 +pkg syscall (darwin-386-cgo), const AF_ISDN = 28 +pkg syscall (darwin-386-cgo), const AF_ISO = 7 +pkg syscall (darwin-386-cgo), const AF_LAT = 14 +pkg syscall (darwin-386-cgo), const AF_LINK = 18 +pkg syscall (darwin-386-cgo), const AF_LOCAL = 1 +pkg syscall (darwin-386-cgo), const AF_MAX = 38 +pkg syscall (darwin-386-cgo), const AF_NATM = 31 +pkg syscall (darwin-386-cgo), const AF_NDRV = 27 +pkg syscall (darwin-386-cgo), const AF_NETBIOS = 33 +pkg syscall (darwin-386-cgo), const AF_NS = 6 +pkg syscall (darwin-386-cgo), const AF_OSI = 7 +pkg syscall (darwin-386-cgo), const AF_PPP = 34 +pkg syscall (darwin-386-cgo), const AF_PUP = 4 +pkg syscall (darwin-386-cgo), const AF_RESERVED_36 = 36 +pkg syscall (darwin-386-cgo), const AF_ROUTE = 17 +pkg syscall (darwin-386-cgo), const AF_SIP = 24 +pkg syscall (darwin-386-cgo), const AF_SNA = 11 +pkg syscall (darwin-386-cgo), const AF_SYSTEM = 32 +pkg syscall (darwin-386-cgo), const B0 = 0 +pkg syscall (darwin-386-cgo), const B0 ideal-int +pkg syscall (darwin-386-cgo), const B110 = 110 +pkg syscall (darwin-386-cgo), const B110 ideal-int +pkg syscall (darwin-386-cgo), const B115200 = 115200 +pkg syscall (darwin-386-cgo), const B115200 ideal-int +pkg syscall (darwin-386-cgo), const B1200 = 1200 +pkg syscall (darwin-386-cgo), const B1200 ideal-int +pkg syscall (darwin-386-cgo), const B134 = 134 +pkg syscall (darwin-386-cgo), const B134 ideal-int +pkg syscall (darwin-386-cgo), const B14400 = 14400 +pkg syscall (darwin-386-cgo), const B14400 ideal-int +pkg syscall (darwin-386-cgo), const B150 = 150 +pkg syscall (darwin-386-cgo), const B150 ideal-int +pkg syscall (darwin-386-cgo), const B1800 = 1800 +pkg syscall (darwin-386-cgo), const B1800 ideal-int +pkg syscall (darwin-386-cgo), const B19200 = 19200 +pkg syscall (darwin-386-cgo), const B19200 ideal-int +pkg syscall (darwin-386-cgo), const B200 = 200 +pkg syscall (darwin-386-cgo), const B200 ideal-int +pkg syscall (darwin-386-cgo), const B230400 = 230400 +pkg syscall (darwin-386-cgo), const B230400 ideal-int +pkg syscall (darwin-386-cgo), const B2400 = 2400 +pkg syscall (darwin-386-cgo), const B2400 ideal-int +pkg syscall (darwin-386-cgo), const B28800 = 28800 +pkg syscall (darwin-386-cgo), const B28800 ideal-int +pkg syscall (darwin-386-cgo), const B300 = 300 +pkg syscall (darwin-386-cgo), const B300 ideal-int +pkg syscall (darwin-386-cgo), const B38400 = 38400 +pkg syscall (darwin-386-cgo), const B38400 ideal-int +pkg syscall (darwin-386-cgo), const B4800 = 4800 +pkg syscall (darwin-386-cgo), const B4800 ideal-int +pkg syscall (darwin-386-cgo), const B50 = 50 +pkg syscall (darwin-386-cgo), const B50 ideal-int +pkg syscall (darwin-386-cgo), const B57600 = 57600 +pkg syscall (darwin-386-cgo), const B57600 ideal-int +pkg syscall (darwin-386-cgo), const B600 = 600 +pkg syscall (darwin-386-cgo), const B600 ideal-int +pkg syscall (darwin-386-cgo), const B7200 = 7200 +pkg syscall (darwin-386-cgo), const B7200 ideal-int +pkg syscall (darwin-386-cgo), const B75 = 75 +pkg syscall (darwin-386-cgo), const B75 ideal-int +pkg syscall (darwin-386-cgo), const B76800 = 76800 +pkg syscall (darwin-386-cgo), const B76800 ideal-int +pkg syscall (darwin-386-cgo), const B9600 = 9600 +pkg syscall (darwin-386-cgo), const B9600 ideal-int +pkg syscall (darwin-386-cgo), const BIOCFLUSH = 536887912 +pkg syscall (darwin-386-cgo), const BIOCGBLEN = 1074020966 +pkg syscall (darwin-386-cgo), const BIOCGDLT = 1074020970 +pkg syscall (darwin-386-cgo), const BIOCGDLTLIST = 3222028921 +pkg syscall (darwin-386-cgo), const BIOCGETIF = 1075855979 +pkg syscall (darwin-386-cgo), const BIOCGHDRCMPLT = 1074020980 +pkg syscall (darwin-386-cgo), const BIOCGRSIG = 1074020978 +pkg syscall (darwin-386-cgo), const BIOCGRTIMEOUT = 1074283118 +pkg syscall (darwin-386-cgo), const BIOCGSEESENT = 1074020982 +pkg syscall (darwin-386-cgo), const BIOCGSTATS = 1074283119 +pkg syscall (darwin-386-cgo), const BIOCIMMEDIATE = 2147762800 +pkg syscall (darwin-386-cgo), const BIOCPROMISC = 536887913 +pkg syscall (darwin-386-cgo), const BIOCSBLEN = 3221504614 +pkg syscall (darwin-386-cgo), const BIOCSDLT = 2147762808 +pkg syscall (darwin-386-cgo), const BIOCSETF = 2148024935 +pkg syscall (darwin-386-cgo), const BIOCSETIF = 2149597804 +pkg syscall (darwin-386-cgo), const BIOCSHDRCMPLT = 2147762805 +pkg syscall (darwin-386-cgo), const BIOCSRSIG = 2147762803 +pkg syscall (darwin-386-cgo), const BIOCSRTIMEOUT = 2148024941 +pkg syscall (darwin-386-cgo), const BIOCSSEESENT = 2147762807 +pkg syscall (darwin-386-cgo), const BIOCVERSION = 1074020977 +pkg syscall (darwin-386-cgo), const BPF_A = 16 +pkg syscall (darwin-386-cgo), const BPF_ABS = 32 +pkg syscall (darwin-386-cgo), const BPF_ADD = 0 +pkg syscall (darwin-386-cgo), const BPF_ALIGNMENT = 4 +pkg syscall (darwin-386-cgo), const BPF_ALU = 4 +pkg syscall (darwin-386-cgo), const BPF_AND = 80 +pkg syscall (darwin-386-cgo), const BPF_B = 16 +pkg syscall (darwin-386-cgo), const BPF_DIV = 48 +pkg syscall (darwin-386-cgo), const BPF_H = 8 +pkg syscall (darwin-386-cgo), const BPF_IMM = 0 +pkg syscall (darwin-386-cgo), const BPF_IND = 64 +pkg syscall (darwin-386-cgo), const BPF_JA = 0 +pkg syscall (darwin-386-cgo), const BPF_JEQ = 16 +pkg syscall (darwin-386-cgo), const BPF_JGE = 48 +pkg syscall (darwin-386-cgo), const BPF_JGT = 32 +pkg syscall (darwin-386-cgo), const BPF_JMP = 5 +pkg syscall (darwin-386-cgo), const BPF_JSET = 64 +pkg syscall (darwin-386-cgo), const BPF_K = 0 +pkg syscall (darwin-386-cgo), const BPF_LD = 0 +pkg syscall (darwin-386-cgo), const BPF_LDX = 1 +pkg syscall (darwin-386-cgo), const BPF_LEN = 128 +pkg syscall (darwin-386-cgo), const BPF_LSH = 96 +pkg syscall (darwin-386-cgo), const BPF_MAJOR_VERSION = 1 +pkg syscall (darwin-386-cgo), const BPF_MAXBUFSIZE = 524288 +pkg syscall (darwin-386-cgo), const BPF_MAXINSNS = 512 +pkg syscall (darwin-386-cgo), const BPF_MEM = 96 +pkg syscall (darwin-386-cgo), const BPF_MEMWORDS = 16 +pkg syscall (darwin-386-cgo), const BPF_MINBUFSIZE = 32 +pkg syscall (darwin-386-cgo), const BPF_MINOR_VERSION = 1 +pkg syscall (darwin-386-cgo), const BPF_MISC = 7 +pkg syscall (darwin-386-cgo), const BPF_MSH = 160 +pkg syscall (darwin-386-cgo), const BPF_MUL = 32 +pkg syscall (darwin-386-cgo), const BPF_NEG = 128 +pkg syscall (darwin-386-cgo), const BPF_OR = 64 +pkg syscall (darwin-386-cgo), const BPF_RELEASE = 199606 +pkg syscall (darwin-386-cgo), const BPF_RET = 6 +pkg syscall (darwin-386-cgo), const BPF_RSH = 112 +pkg syscall (darwin-386-cgo), const BPF_ST = 2 +pkg syscall (darwin-386-cgo), const BPF_STX = 3 +pkg syscall (darwin-386-cgo), const BPF_SUB = 16 +pkg syscall (darwin-386-cgo), const BPF_TAX = 0 +pkg syscall (darwin-386-cgo), const BPF_TXA = 128 +pkg syscall (darwin-386-cgo), const BPF_W = 0 +pkg syscall (darwin-386-cgo), const BPF_X = 8 +pkg syscall (darwin-386-cgo), const BRKINT = 2 +pkg syscall (darwin-386-cgo), const BRKINT ideal-int +pkg syscall (darwin-386-cgo), const CFLUSH = 15 +pkg syscall (darwin-386-cgo), const CFLUSH ideal-int +pkg syscall (darwin-386-cgo), const CLOCAL = 32768 +pkg syscall (darwin-386-cgo), const CLOCAL ideal-int +pkg syscall (darwin-386-cgo), const CREAD = 2048 +pkg syscall (darwin-386-cgo), const CREAD ideal-int +pkg syscall (darwin-386-cgo), const CS5 = 0 +pkg syscall (darwin-386-cgo), const CS5 ideal-int +pkg syscall (darwin-386-cgo), const CS6 = 256 +pkg syscall (darwin-386-cgo), const CS6 ideal-int +pkg syscall (darwin-386-cgo), const CS7 = 512 +pkg syscall (darwin-386-cgo), const CS7 ideal-int +pkg syscall (darwin-386-cgo), const CS8 = 768 +pkg syscall (darwin-386-cgo), const CS8 ideal-int +pkg syscall (darwin-386-cgo), const CSIZE = 768 +pkg syscall (darwin-386-cgo), const CSIZE ideal-int +pkg syscall (darwin-386-cgo), const CSTART = 17 +pkg syscall (darwin-386-cgo), const CSTART ideal-int +pkg syscall (darwin-386-cgo), const CSTATUS = 20 +pkg syscall (darwin-386-cgo), const CSTATUS ideal-int +pkg syscall (darwin-386-cgo), const CSTOP = 19 +pkg syscall (darwin-386-cgo), const CSTOP ideal-int +pkg syscall (darwin-386-cgo), const CSTOPB = 1024 +pkg syscall (darwin-386-cgo), const CSTOPB ideal-int +pkg syscall (darwin-386-cgo), const CSUSP = 26 +pkg syscall (darwin-386-cgo), const CSUSP ideal-int +pkg syscall (darwin-386-cgo), const CTL_MAXNAME = 12 +pkg syscall (darwin-386-cgo), const CTL_NET = 4 +pkg syscall (darwin-386-cgo), const DLT_APPLE_IP_OVER_IEEE1394 = 138 +pkg syscall (darwin-386-cgo), const DLT_ARCNET = 7 +pkg syscall (darwin-386-cgo), const DLT_ATM_CLIP = 19 +pkg syscall (darwin-386-cgo), const DLT_ATM_RFC1483 = 11 +pkg syscall (darwin-386-cgo), const DLT_AX25 = 3 +pkg syscall (darwin-386-cgo), const DLT_CHAOS = 5 +pkg syscall (darwin-386-cgo), const DLT_CHDLC = 104 +pkg syscall (darwin-386-cgo), const DLT_C_HDLC = 104 +pkg syscall (darwin-386-cgo), const DLT_EN10MB = 1 +pkg syscall (darwin-386-cgo), const DLT_EN3MB = 2 +pkg syscall (darwin-386-cgo), const DLT_FDDI = 10 +pkg syscall (darwin-386-cgo), const DLT_IEEE802 = 6 +pkg syscall (darwin-386-cgo), const DLT_IEEE802_11 = 105 +pkg syscall (darwin-386-cgo), const DLT_IEEE802_11_RADIO = 127 +pkg syscall (darwin-386-cgo), const DLT_IEEE802_11_RADIO_AVS = 163 +pkg syscall (darwin-386-cgo), const DLT_LINUX_SLL = 113 +pkg syscall (darwin-386-cgo), const DLT_LOOP = 108 +pkg syscall (darwin-386-cgo), const DLT_NULL = 0 +pkg syscall (darwin-386-cgo), const DLT_PFLOG = 117 +pkg syscall (darwin-386-cgo), const DLT_PFSYNC = 18 +pkg syscall (darwin-386-cgo), const DLT_PPP = 9 +pkg syscall (darwin-386-cgo), const DLT_PPP_BSDOS = 16 +pkg syscall (darwin-386-cgo), const DLT_PPP_SERIAL = 50 +pkg syscall (darwin-386-cgo), const DLT_PRONET = 4 +pkg syscall (darwin-386-cgo), const DLT_RAW = 12 +pkg syscall (darwin-386-cgo), const DLT_SLIP = 8 +pkg syscall (darwin-386-cgo), const DLT_SLIP_BSDOS = 15 +pkg syscall (darwin-386-cgo), const DT_BLK = 6 +pkg syscall (darwin-386-cgo), const DT_CHR = 2 +pkg syscall (darwin-386-cgo), const DT_DIR = 4 +pkg syscall (darwin-386-cgo), const DT_FIFO = 1 +pkg syscall (darwin-386-cgo), const DT_LNK = 10 +pkg syscall (darwin-386-cgo), const DT_REG = 8 +pkg syscall (darwin-386-cgo), const DT_SOCK = 12 +pkg syscall (darwin-386-cgo), const DT_UNKNOWN = 0 +pkg syscall (darwin-386-cgo), const DT_WHT = 14 +pkg syscall (darwin-386-cgo), const E2BIG = 7 +pkg syscall (darwin-386-cgo), const EACCES = 13 +pkg syscall (darwin-386-cgo), const EADDRINUSE = 48 +pkg syscall (darwin-386-cgo), const EADDRNOTAVAIL = 49 +pkg syscall (darwin-386-cgo), const EAFNOSUPPORT = 47 +pkg syscall (darwin-386-cgo), const EAGAIN = 35 +pkg syscall (darwin-386-cgo), const EALREADY = 37 +pkg syscall (darwin-386-cgo), const EAUTH = 80 +pkg syscall (darwin-386-cgo), const EBADARCH = 86 +pkg syscall (darwin-386-cgo), const EBADEXEC = 85 +pkg syscall (darwin-386-cgo), const EBADF = 9 +pkg syscall (darwin-386-cgo), const EBADMACHO = 88 +pkg syscall (darwin-386-cgo), const EBADMSG = 94 +pkg syscall (darwin-386-cgo), const EBADRPC = 72 +pkg syscall (darwin-386-cgo), const EBUSY = 16 +pkg syscall (darwin-386-cgo), const ECANCELED = 89 +pkg syscall (darwin-386-cgo), const ECHILD = 10 +pkg syscall (darwin-386-cgo), const ECHO = 8 +pkg syscall (darwin-386-cgo), const ECHOCTL = 64 +pkg syscall (darwin-386-cgo), const ECHOE = 2 +pkg syscall (darwin-386-cgo), const ECHOK = 4 +pkg syscall (darwin-386-cgo), const ECHOKE = 1 +pkg syscall (darwin-386-cgo), const ECHONL = 16 +pkg syscall (darwin-386-cgo), const ECHOPRT = 32 +pkg syscall (darwin-386-cgo), const ECONNABORTED = 53 +pkg syscall (darwin-386-cgo), const ECONNREFUSED = 61 +pkg syscall (darwin-386-cgo), const ECONNRESET = 54 +pkg syscall (darwin-386-cgo), const EDEADLK = 11 +pkg syscall (darwin-386-cgo), const EDESTADDRREQ = 39 +pkg syscall (darwin-386-cgo), const EDEVERR = 83 +pkg syscall (darwin-386-cgo), const EDOM = 33 +pkg syscall (darwin-386-cgo), const EDQUOT = 69 +pkg syscall (darwin-386-cgo), const EEXIST = 17 +pkg syscall (darwin-386-cgo), const EFAULT = 14 +pkg syscall (darwin-386-cgo), const EFBIG = 27 +pkg syscall (darwin-386-cgo), const EFTYPE = 79 +pkg syscall (darwin-386-cgo), const EHOSTDOWN = 64 +pkg syscall (darwin-386-cgo), const EHOSTUNREACH = 65 +pkg syscall (darwin-386-cgo), const EIDRM = 90 +pkg syscall (darwin-386-cgo), const EILSEQ = 92 +pkg syscall (darwin-386-cgo), const EINPROGRESS = 36 +pkg syscall (darwin-386-cgo), const EINTR = 4 +pkg syscall (darwin-386-cgo), const EINVAL = 22 +pkg syscall (darwin-386-cgo), const EIO = 5 +pkg syscall (darwin-386-cgo), const EISCONN = 56 +pkg syscall (darwin-386-cgo), const EISDIR = 21 +pkg syscall (darwin-386-cgo), const ELAST = 105 +pkg syscall (darwin-386-cgo), const ELOOP = 62 +pkg syscall (darwin-386-cgo), const EMFILE = 24 +pkg syscall (darwin-386-cgo), const EMLINK = 31 +pkg syscall (darwin-386-cgo), const EMSGSIZE = 40 +pkg syscall (darwin-386-cgo), const EMULTIHOP = 95 +pkg syscall (darwin-386-cgo), const ENAMETOOLONG = 63 +pkg syscall (darwin-386-cgo), const ENEEDAUTH = 81 +pkg syscall (darwin-386-cgo), const ENETDOWN = 50 +pkg syscall (darwin-386-cgo), const ENETRESET = 52 +pkg syscall (darwin-386-cgo), const ENETUNREACH = 51 +pkg syscall (darwin-386-cgo), const ENFILE = 23 +pkg syscall (darwin-386-cgo), const ENOATTR = 93 +pkg syscall (darwin-386-cgo), const ENOBUFS = 55 +pkg syscall (darwin-386-cgo), const ENODATA = 96 +pkg syscall (darwin-386-cgo), const ENODEV = 19 +pkg syscall (darwin-386-cgo), const ENOEXEC = 8 +pkg syscall (darwin-386-cgo), const ENOLCK = 77 +pkg syscall (darwin-386-cgo), const ENOLINK = 97 +pkg syscall (darwin-386-cgo), const ENOMEM = 12 +pkg syscall (darwin-386-cgo), const ENOMSG = 91 +pkg syscall (darwin-386-cgo), const ENOPOLICY = 103 +pkg syscall (darwin-386-cgo), const ENOPROTOOPT = 42 +pkg syscall (darwin-386-cgo), const ENOSPC = 28 +pkg syscall (darwin-386-cgo), const ENOSR = 98 +pkg syscall (darwin-386-cgo), const ENOSTR = 99 +pkg syscall (darwin-386-cgo), const ENOSYS = 78 +pkg syscall (darwin-386-cgo), const ENOTBLK = 15 +pkg syscall (darwin-386-cgo), const ENOTCONN = 57 +pkg syscall (darwin-386-cgo), const ENOTDIR = 20 +pkg syscall (darwin-386-cgo), const ENOTEMPTY = 66 +pkg syscall (darwin-386-cgo), const ENOTRECOVERABLE = 104 +pkg syscall (darwin-386-cgo), const ENOTSOCK = 38 +pkg syscall (darwin-386-cgo), const ENOTSUP = 45 +pkg syscall (darwin-386-cgo), const ENOTTY = 25 +pkg syscall (darwin-386-cgo), const ENXIO = 6 +pkg syscall (darwin-386-cgo), const EOPNOTSUPP = 102 +pkg syscall (darwin-386-cgo), const EOVERFLOW = 84 +pkg syscall (darwin-386-cgo), const EOWNERDEAD = 105 +pkg syscall (darwin-386-cgo), const EPERM = 1 +pkg syscall (darwin-386-cgo), const EPFNOSUPPORT = 46 +pkg syscall (darwin-386-cgo), const EPIPE = 32 +pkg syscall (darwin-386-cgo), const EPROCLIM = 67 +pkg syscall (darwin-386-cgo), const EPROCUNAVAIL = 76 +pkg syscall (darwin-386-cgo), const EPROGMISMATCH = 75 +pkg syscall (darwin-386-cgo), const EPROGUNAVAIL = 74 +pkg syscall (darwin-386-cgo), const EPROTO = 100 +pkg syscall (darwin-386-cgo), const EPROTONOSUPPORT = 43 +pkg syscall (darwin-386-cgo), const EPROTOTYPE = 41 +pkg syscall (darwin-386-cgo), const EPWROFF = 82 +pkg syscall (darwin-386-cgo), const ERANGE = 34 +pkg syscall (darwin-386-cgo), const EREMOTE = 71 +pkg syscall (darwin-386-cgo), const EROFS = 30 +pkg syscall (darwin-386-cgo), const ERPCMISMATCH = 73 +pkg syscall (darwin-386-cgo), const ESHLIBVERS = 87 +pkg syscall (darwin-386-cgo), const ESHUTDOWN = 58 +pkg syscall (darwin-386-cgo), const ESOCKTNOSUPPORT = 44 +pkg syscall (darwin-386-cgo), const ESPIPE = 29 +pkg syscall (darwin-386-cgo), const ESRCH = 3 +pkg syscall (darwin-386-cgo), const ESTALE = 70 +pkg syscall (darwin-386-cgo), const ETIME = 101 +pkg syscall (darwin-386-cgo), const ETIMEDOUT = 60 +pkg syscall (darwin-386-cgo), const ETOOMANYREFS = 59 +pkg syscall (darwin-386-cgo), const ETXTBSY = 26 +pkg syscall (darwin-386-cgo), const EUSERS = 68 +pkg syscall (darwin-386-cgo), const EVFILT_AIO = -3 +pkg syscall (darwin-386-cgo), const EVFILT_FS = -9 +pkg syscall (darwin-386-cgo), const EVFILT_MACHPORT = -8 +pkg syscall (darwin-386-cgo), const EVFILT_PROC = -5 +pkg syscall (darwin-386-cgo), const EVFILT_READ = -1 +pkg syscall (darwin-386-cgo), const EVFILT_SIGNAL = -6 +pkg syscall (darwin-386-cgo), const EVFILT_SYSCOUNT = 12 +pkg syscall (darwin-386-cgo), const EVFILT_THREADMARKER = 12 +pkg syscall (darwin-386-cgo), const EVFILT_TIMER = -7 +pkg syscall (darwin-386-cgo), const EVFILT_USER = -10 +pkg syscall (darwin-386-cgo), const EVFILT_VM = -12 +pkg syscall (darwin-386-cgo), const EVFILT_VNODE = -4 +pkg syscall (darwin-386-cgo), const EVFILT_WRITE = -2 +pkg syscall (darwin-386-cgo), const EV_ADD = 1 +pkg syscall (darwin-386-cgo), const EV_CLEAR = 32 +pkg syscall (darwin-386-cgo), const EV_DELETE = 2 +pkg syscall (darwin-386-cgo), const EV_DISABLE = 8 +pkg syscall (darwin-386-cgo), const EV_DISPATCH = 128 +pkg syscall (darwin-386-cgo), const EV_ENABLE = 4 +pkg syscall (darwin-386-cgo), const EV_EOF = 32768 +pkg syscall (darwin-386-cgo), const EV_ERROR = 16384 +pkg syscall (darwin-386-cgo), const EV_FLAG0 = 4096 +pkg syscall (darwin-386-cgo), const EV_FLAG1 = 8192 +pkg syscall (darwin-386-cgo), const EV_ONESHOT = 16 +pkg syscall (darwin-386-cgo), const EV_OOBAND = 8192 +pkg syscall (darwin-386-cgo), const EV_POLL = 4096 +pkg syscall (darwin-386-cgo), const EV_RECEIPT = 64 +pkg syscall (darwin-386-cgo), const EV_SYSFLAGS = 61440 +pkg syscall (darwin-386-cgo), const EWOULDBLOCK = 35 +pkg syscall (darwin-386-cgo), const EXDEV = 18 +pkg syscall (darwin-386-cgo), const EXTA = 19200 +pkg syscall (darwin-386-cgo), const EXTB = 38400 +pkg syscall (darwin-386-cgo), const EXTPROC = 2048 +pkg syscall (darwin-386-cgo), const FD_CLOEXEC = 1 +pkg syscall (darwin-386-cgo), const FD_SETSIZE = 1024 +pkg syscall (darwin-386-cgo), const FLUSHO = 8388608 +pkg syscall (darwin-386-cgo), const FLUSHO ideal-int +pkg syscall (darwin-386-cgo), const F_ADDFILESIGS = 61 +pkg syscall (darwin-386-cgo), const F_ADDSIGS = 59 +pkg syscall (darwin-386-cgo), const F_ALLOCATEALL = 4 +pkg syscall (darwin-386-cgo), const F_ALLOCATECONTIG = 2 +pkg syscall (darwin-386-cgo), const F_CHKCLEAN = 41 +pkg syscall (darwin-386-cgo), const F_DUPFD = 0 +pkg syscall (darwin-386-cgo), const F_DUPFD_CLOEXEC = 67 +pkg syscall (darwin-386-cgo), const F_FLUSH_DATA = 40 +pkg syscall (darwin-386-cgo), const F_FREEZE_FS = 53 +pkg syscall (darwin-386-cgo), const F_FULLFSYNC = 51 +pkg syscall (darwin-386-cgo), const F_GETFD = 1 +pkg syscall (darwin-386-cgo), const F_GETFL = 3 +pkg syscall (darwin-386-cgo), const F_GETLK = 7 +pkg syscall (darwin-386-cgo), const F_GETLKPID = 66 +pkg syscall (darwin-386-cgo), const F_GETNOSIGPIPE = 74 +pkg syscall (darwin-386-cgo), const F_GETOWN = 5 +pkg syscall (darwin-386-cgo), const F_GETPATH = 50 +pkg syscall (darwin-386-cgo), const F_GETPATH_MTMINFO = 71 +pkg syscall (darwin-386-cgo), const F_GETPROTECTIONCLASS = 63 +pkg syscall (darwin-386-cgo), const F_GLOBAL_NOCACHE = 55 +pkg syscall (darwin-386-cgo), const F_LOG2PHYS = 49 +pkg syscall (darwin-386-cgo), const F_LOG2PHYS_EXT = 65 +pkg syscall (darwin-386-cgo), const F_MARKDEPENDENCY = 60 +pkg syscall (darwin-386-cgo), const F_NOCACHE = 48 +pkg syscall (darwin-386-cgo), const F_NODIRECT = 62 +pkg syscall (darwin-386-cgo), const F_OK = 0 +pkg syscall (darwin-386-cgo), const F_PATHPKG_CHECK = 52 +pkg syscall (darwin-386-cgo), const F_PEOFPOSMODE = 3 +pkg syscall (darwin-386-cgo), const F_PREALLOCATE = 42 +pkg syscall (darwin-386-cgo), const F_RDADVISE = 44 +pkg syscall (darwin-386-cgo), const F_RDAHEAD = 45 +pkg syscall (darwin-386-cgo), const F_RDLCK = 1 +pkg syscall (darwin-386-cgo), const F_READBOOTSTRAP = 46 +pkg syscall (darwin-386-cgo), const F_SETBACKINGSTORE = 70 +pkg syscall (darwin-386-cgo), const F_SETFD = 2 +pkg syscall (darwin-386-cgo), const F_SETFL = 4 +pkg syscall (darwin-386-cgo), const F_SETLK = 8 +pkg syscall (darwin-386-cgo), const F_SETLKW = 9 +pkg syscall (darwin-386-cgo), const F_SETNOSIGPIPE = 73 +pkg syscall (darwin-386-cgo), const F_SETOWN = 6 +pkg syscall (darwin-386-cgo), const F_SETPROTECTIONCLASS = 64 +pkg syscall (darwin-386-cgo), const F_SETSIZE = 43 +pkg syscall (darwin-386-cgo), const F_THAW_FS = 54 +pkg syscall (darwin-386-cgo), const F_UNLCK = 2 +pkg syscall (darwin-386-cgo), const F_VOLPOSMODE = 4 +pkg syscall (darwin-386-cgo), const F_WRITEBOOTSTRAP = 47 +pkg syscall (darwin-386-cgo), const F_WRLCK = 3 +pkg syscall (darwin-386-cgo), const HUPCL = 16384 +pkg syscall (darwin-386-cgo), const HUPCL ideal-int +pkg syscall (darwin-386-cgo), const ICANON = 256 +pkg syscall (darwin-386-cgo), const ICANON ideal-int +pkg syscall (darwin-386-cgo), const ICRNL = 256 +pkg syscall (darwin-386-cgo), const ICRNL ideal-int +pkg syscall (darwin-386-cgo), const IEXTEN = 1024 +pkg syscall (darwin-386-cgo), const IEXTEN ideal-int +pkg syscall (darwin-386-cgo), const IFF_ALLMULTI = 512 +pkg syscall (darwin-386-cgo), const IFF_ALTPHYS = 16384 +pkg syscall (darwin-386-cgo), const IFF_DEBUG = 4 +pkg syscall (darwin-386-cgo), const IFF_LINK0 = 4096 +pkg syscall (darwin-386-cgo), const IFF_LINK1 = 8192 +pkg syscall (darwin-386-cgo), const IFF_LINK2 = 16384 +pkg syscall (darwin-386-cgo), const IFF_LOOPBACK = 8 +pkg syscall (darwin-386-cgo), const IFF_MULTICAST = 32768 +pkg syscall (darwin-386-cgo), const IFF_NOARP = 128 +pkg syscall (darwin-386-cgo), const IFF_NOTRAILERS = 32 +pkg syscall (darwin-386-cgo), const IFF_OACTIVE = 1024 +pkg syscall (darwin-386-cgo), const IFF_POINTOPOINT = 16 +pkg syscall (darwin-386-cgo), const IFF_PROMISC = 256 +pkg syscall (darwin-386-cgo), const IFF_RUNNING = 64 +pkg syscall (darwin-386-cgo), const IFF_SIMPLEX = 2048 +pkg syscall (darwin-386-cgo), const IFNAMSIZ = 16 +pkg syscall (darwin-386-cgo), const IFT_1822 = 2 +pkg syscall (darwin-386-cgo), const IFT_AAL5 = 49 +pkg syscall (darwin-386-cgo), const IFT_ARCNET = 35 +pkg syscall (darwin-386-cgo), const IFT_ARCNETPLUS = 36 +pkg syscall (darwin-386-cgo), const IFT_ATM = 37 +pkg syscall (darwin-386-cgo), const IFT_BRIDGE = 209 +pkg syscall (darwin-386-cgo), const IFT_CARP = 248 +pkg syscall (darwin-386-cgo), const IFT_CELLULAR = 255 +pkg syscall (darwin-386-cgo), const IFT_CEPT = 19 +pkg syscall (darwin-386-cgo), const IFT_DS3 = 30 +pkg syscall (darwin-386-cgo), const IFT_ENC = 244 +pkg syscall (darwin-386-cgo), const IFT_EON = 25 +pkg syscall (darwin-386-cgo), const IFT_ETHER = 6 +pkg syscall (darwin-386-cgo), const IFT_FAITH = 56 +pkg syscall (darwin-386-cgo), const IFT_FDDI = 15 +pkg syscall (darwin-386-cgo), const IFT_FRELAY = 32 +pkg syscall (darwin-386-cgo), const IFT_FRELAYDCE = 44 +pkg syscall (darwin-386-cgo), const IFT_GIF = 55 +pkg syscall (darwin-386-cgo), const IFT_HDH1822 = 3 +pkg syscall (darwin-386-cgo), const IFT_HIPPI = 47 +pkg syscall (darwin-386-cgo), const IFT_HSSI = 46 +pkg syscall (darwin-386-cgo), const IFT_HY = 14 +pkg syscall (darwin-386-cgo), const IFT_IEEE1394 = 144 +pkg syscall (darwin-386-cgo), const IFT_IEEE8023ADLAG = 136 +pkg syscall (darwin-386-cgo), const IFT_ISDNBASIC = 20 +pkg syscall (darwin-386-cgo), const IFT_ISDNPRIMARY = 21 +pkg syscall (darwin-386-cgo), const IFT_ISO88022LLC = 41 +pkg syscall (darwin-386-cgo), const IFT_ISO88023 = 7 +pkg syscall (darwin-386-cgo), const IFT_ISO88024 = 8 +pkg syscall (darwin-386-cgo), const IFT_ISO88025 = 9 +pkg syscall (darwin-386-cgo), const IFT_ISO88026 = 10 +pkg syscall (darwin-386-cgo), const IFT_L2VLAN = 135 +pkg syscall (darwin-386-cgo), const IFT_LAPB = 16 +pkg syscall (darwin-386-cgo), const IFT_LOCALTALK = 42 +pkg syscall (darwin-386-cgo), const IFT_LOOP = 24 +pkg syscall (darwin-386-cgo), const IFT_MIOX25 = 38 +pkg syscall (darwin-386-cgo), const IFT_MODEM = 48 +pkg syscall (darwin-386-cgo), const IFT_NSIP = 27 +pkg syscall (darwin-386-cgo), const IFT_OTHER = 1 +pkg syscall (darwin-386-cgo), const IFT_P10 = 12 +pkg syscall (darwin-386-cgo), const IFT_P80 = 13 +pkg syscall (darwin-386-cgo), const IFT_PARA = 34 +pkg syscall (darwin-386-cgo), const IFT_PDP = 255 +pkg syscall (darwin-386-cgo), const IFT_PFLOG = 245 +pkg syscall (darwin-386-cgo), const IFT_PFSYNC = 246 +pkg syscall (darwin-386-cgo), const IFT_PPP = 23 +pkg syscall (darwin-386-cgo), const IFT_PROPMUX = 54 +pkg syscall (darwin-386-cgo), const IFT_PROPVIRTUAL = 53 +pkg syscall (darwin-386-cgo), const IFT_PTPSERIAL = 22 +pkg syscall (darwin-386-cgo), const IFT_RS232 = 33 +pkg syscall (darwin-386-cgo), const IFT_SDLC = 17 +pkg syscall (darwin-386-cgo), const IFT_SIP = 31 +pkg syscall (darwin-386-cgo), const IFT_SLIP = 28 +pkg syscall (darwin-386-cgo), const IFT_SMDSDXI = 43 +pkg syscall (darwin-386-cgo), const IFT_SMDSICIP = 52 +pkg syscall (darwin-386-cgo), const IFT_SONET = 39 +pkg syscall (darwin-386-cgo), const IFT_SONETPATH = 50 +pkg syscall (darwin-386-cgo), const IFT_SONETVT = 51 +pkg syscall (darwin-386-cgo), const IFT_STARLAN = 11 +pkg syscall (darwin-386-cgo), const IFT_STF = 57 +pkg syscall (darwin-386-cgo), const IFT_T1 = 18 +pkg syscall (darwin-386-cgo), const IFT_ULTRA = 29 +pkg syscall (darwin-386-cgo), const IFT_V35 = 45 +pkg syscall (darwin-386-cgo), const IFT_X25 = 5 +pkg syscall (darwin-386-cgo), const IFT_X25DDN = 4 +pkg syscall (darwin-386-cgo), const IFT_X25PLE = 40 +pkg syscall (darwin-386-cgo), const IFT_XETHER = 26 +pkg syscall (darwin-386-cgo), const IGNBRK = 1 +pkg syscall (darwin-386-cgo), const IGNBRK ideal-int +pkg syscall (darwin-386-cgo), const IGNCR = 128 +pkg syscall (darwin-386-cgo), const IGNCR ideal-int +pkg syscall (darwin-386-cgo), const IGNPAR = 4 +pkg syscall (darwin-386-cgo), const IGNPAR ideal-int +pkg syscall (darwin-386-cgo), const IMAXBEL = 8192 +pkg syscall (darwin-386-cgo), const IMAXBEL ideal-int +pkg syscall (darwin-386-cgo), const INLCR = 64 +pkg syscall (darwin-386-cgo), const INLCR ideal-int +pkg syscall (darwin-386-cgo), const INPCK = 16 +pkg syscall (darwin-386-cgo), const INPCK ideal-int +pkg syscall (darwin-386-cgo), const IN_CLASSA_HOST = 16777215 +pkg syscall (darwin-386-cgo), const IN_CLASSA_MAX = 128 +pkg syscall (darwin-386-cgo), const IN_CLASSA_NET = 4278190080 +pkg syscall (darwin-386-cgo), const IN_CLASSA_NSHIFT = 24 +pkg syscall (darwin-386-cgo), const IN_CLASSB_HOST = 65535 +pkg syscall (darwin-386-cgo), const IN_CLASSB_MAX = 65536 +pkg syscall (darwin-386-cgo), const IN_CLASSB_NET = 4294901760 +pkg syscall (darwin-386-cgo), const IN_CLASSB_NSHIFT = 16 +pkg syscall (darwin-386-cgo), const IN_CLASSC_HOST = 255 +pkg syscall (darwin-386-cgo), const IN_CLASSC_NET = 4294967040 +pkg syscall (darwin-386-cgo), const IN_CLASSC_NSHIFT = 8 +pkg syscall (darwin-386-cgo), const IN_CLASSD_HOST = 268435455 +pkg syscall (darwin-386-cgo), const IN_CLASSD_NET = 4026531840 +pkg syscall (darwin-386-cgo), const IN_CLASSD_NSHIFT = 28 +pkg syscall (darwin-386-cgo), const IN_LINKLOCALNETNUM = 2851995648 +pkg syscall (darwin-386-cgo), const IN_LOOPBACKNET = 127 +pkg syscall (darwin-386-cgo), const IPPROTO_3PC = 34 +pkg syscall (darwin-386-cgo), const IPPROTO_ADFS = 68 +pkg syscall (darwin-386-cgo), const IPPROTO_AH = 51 +pkg syscall (darwin-386-cgo), const IPPROTO_AHIP = 61 +pkg syscall (darwin-386-cgo), const IPPROTO_APES = 99 +pkg syscall (darwin-386-cgo), const IPPROTO_ARGUS = 13 +pkg syscall (darwin-386-cgo), const IPPROTO_AX25 = 93 +pkg syscall (darwin-386-cgo), const IPPROTO_BHA = 49 +pkg syscall (darwin-386-cgo), const IPPROTO_BLT = 30 +pkg syscall (darwin-386-cgo), const IPPROTO_BRSATMON = 76 +pkg syscall (darwin-386-cgo), const IPPROTO_CFTP = 62 +pkg syscall (darwin-386-cgo), const IPPROTO_CHAOS = 16 +pkg syscall (darwin-386-cgo), const IPPROTO_CMTP = 38 +pkg syscall (darwin-386-cgo), const IPPROTO_CPHB = 73 +pkg syscall (darwin-386-cgo), const IPPROTO_CPNX = 72 +pkg syscall (darwin-386-cgo), const IPPROTO_DDP = 37 +pkg syscall (darwin-386-cgo), const IPPROTO_DGP = 86 +pkg syscall (darwin-386-cgo), const IPPROTO_DIVERT = 254 +pkg syscall (darwin-386-cgo), const IPPROTO_DONE = 257 +pkg syscall (darwin-386-cgo), const IPPROTO_DSTOPTS = 60 +pkg syscall (darwin-386-cgo), const IPPROTO_EGP = 8 +pkg syscall (darwin-386-cgo), const IPPROTO_EMCON = 14 +pkg syscall (darwin-386-cgo), const IPPROTO_ENCAP = 98 +pkg syscall (darwin-386-cgo), const IPPROTO_EON = 80 +pkg syscall (darwin-386-cgo), const IPPROTO_ESP = 50 +pkg syscall (darwin-386-cgo), const IPPROTO_ETHERIP = 97 +pkg syscall (darwin-386-cgo), const IPPROTO_FRAGMENT = 44 +pkg syscall (darwin-386-cgo), const IPPROTO_GGP = 3 +pkg syscall (darwin-386-cgo), const IPPROTO_GMTP = 100 +pkg syscall (darwin-386-cgo), const IPPROTO_GRE = 47 +pkg syscall (darwin-386-cgo), const IPPROTO_HELLO = 63 +pkg syscall (darwin-386-cgo), const IPPROTO_HMP = 20 +pkg syscall (darwin-386-cgo), const IPPROTO_HOPOPTS = 0 +pkg syscall (darwin-386-cgo), const IPPROTO_ICMP = 1 +pkg syscall (darwin-386-cgo), const IPPROTO_ICMPV6 = 58 +pkg syscall (darwin-386-cgo), const IPPROTO_IDP = 22 +pkg syscall (darwin-386-cgo), const IPPROTO_IDPR = 35 +pkg syscall (darwin-386-cgo), const IPPROTO_IDRP = 45 +pkg syscall (darwin-386-cgo), const IPPROTO_IGMP = 2 +pkg syscall (darwin-386-cgo), const IPPROTO_IGP = 85 +pkg syscall (darwin-386-cgo), const IPPROTO_IGRP = 88 +pkg syscall (darwin-386-cgo), const IPPROTO_IL = 40 +pkg syscall (darwin-386-cgo), const IPPROTO_INLSP = 52 +pkg syscall (darwin-386-cgo), const IPPROTO_INP = 32 +pkg syscall (darwin-386-cgo), const IPPROTO_IPCOMP = 108 +pkg syscall (darwin-386-cgo), const IPPROTO_IPCV = 71 +pkg syscall (darwin-386-cgo), const IPPROTO_IPEIP = 94 +pkg syscall (darwin-386-cgo), const IPPROTO_IPIP = 4 +pkg syscall (darwin-386-cgo), const IPPROTO_IPPC = 67 +pkg syscall (darwin-386-cgo), const IPPROTO_IPV4 = 4 +pkg syscall (darwin-386-cgo), const IPPROTO_IRTP = 28 +pkg syscall (darwin-386-cgo), const IPPROTO_KRYPTOLAN = 65 +pkg syscall (darwin-386-cgo), const IPPROTO_LARP = 91 +pkg syscall (darwin-386-cgo), const IPPROTO_LEAF1 = 25 +pkg syscall (darwin-386-cgo), const IPPROTO_LEAF2 = 26 +pkg syscall (darwin-386-cgo), const IPPROTO_MAX = 256 +pkg syscall (darwin-386-cgo), const IPPROTO_MAXID = 52 +pkg syscall (darwin-386-cgo), const IPPROTO_MEAS = 19 +pkg syscall (darwin-386-cgo), const IPPROTO_MHRP = 48 +pkg syscall (darwin-386-cgo), const IPPROTO_MICP = 95 +pkg syscall (darwin-386-cgo), const IPPROTO_MTP = 92 +pkg syscall (darwin-386-cgo), const IPPROTO_MUX = 18 +pkg syscall (darwin-386-cgo), const IPPROTO_ND = 77 +pkg syscall (darwin-386-cgo), const IPPROTO_NHRP = 54 +pkg syscall (darwin-386-cgo), const IPPROTO_NONE = 59 +pkg syscall (darwin-386-cgo), const IPPROTO_NSP = 31 +pkg syscall (darwin-386-cgo), const IPPROTO_NVPII = 11 +pkg syscall (darwin-386-cgo), const IPPROTO_OSPFIGP = 89 +pkg syscall (darwin-386-cgo), const IPPROTO_PGM = 113 +pkg syscall (darwin-386-cgo), const IPPROTO_PIGP = 9 +pkg syscall (darwin-386-cgo), const IPPROTO_PIM = 103 +pkg syscall (darwin-386-cgo), const IPPROTO_PRM = 21 +pkg syscall (darwin-386-cgo), const IPPROTO_PUP = 12 +pkg syscall (darwin-386-cgo), const IPPROTO_PVP = 75 +pkg syscall (darwin-386-cgo), const IPPROTO_RAW = 255 +pkg syscall (darwin-386-cgo), const IPPROTO_RCCMON = 10 +pkg syscall (darwin-386-cgo), const IPPROTO_RDP = 27 +pkg syscall (darwin-386-cgo), const IPPROTO_ROUTING = 43 +pkg syscall (darwin-386-cgo), const IPPROTO_RSVP = 46 +pkg syscall (darwin-386-cgo), const IPPROTO_RVD = 66 +pkg syscall (darwin-386-cgo), const IPPROTO_SATEXPAK = 64 +pkg syscall (darwin-386-cgo), const IPPROTO_SATMON = 69 +pkg syscall (darwin-386-cgo), const IPPROTO_SCCSP = 96 +pkg syscall (darwin-386-cgo), const IPPROTO_SCTP = 132 +pkg syscall (darwin-386-cgo), const IPPROTO_SDRP = 42 +pkg syscall (darwin-386-cgo), const IPPROTO_SEP = 33 +pkg syscall (darwin-386-cgo), const IPPROTO_SRPC = 90 +pkg syscall (darwin-386-cgo), const IPPROTO_ST = 7 +pkg syscall (darwin-386-cgo), const IPPROTO_SVMTP = 82 +pkg syscall (darwin-386-cgo), const IPPROTO_SWIPE = 53 +pkg syscall (darwin-386-cgo), const IPPROTO_TCF = 87 +pkg syscall (darwin-386-cgo), const IPPROTO_TP = 29 +pkg syscall (darwin-386-cgo), const IPPROTO_TPXX = 39 +pkg syscall (darwin-386-cgo), const IPPROTO_TRUNK1 = 23 +pkg syscall (darwin-386-cgo), const IPPROTO_TRUNK2 = 24 +pkg syscall (darwin-386-cgo), const IPPROTO_TTP = 84 +pkg syscall (darwin-386-cgo), const IPPROTO_VINES = 83 +pkg syscall (darwin-386-cgo), const IPPROTO_VISA = 70 +pkg syscall (darwin-386-cgo), const IPPROTO_VMTP = 81 +pkg syscall (darwin-386-cgo), const IPPROTO_WBEXPAK = 79 +pkg syscall (darwin-386-cgo), const IPPROTO_WBMON = 78 +pkg syscall (darwin-386-cgo), const IPPROTO_WSN = 74 +pkg syscall (darwin-386-cgo), const IPPROTO_XNET = 15 +pkg syscall (darwin-386-cgo), const IPPROTO_XTP = 36 +pkg syscall (darwin-386-cgo), const IPV6_2292DSTOPTS = 23 +pkg syscall (darwin-386-cgo), const IPV6_2292HOPLIMIT = 20 +pkg syscall (darwin-386-cgo), const IPV6_2292HOPOPTS = 22 +pkg syscall (darwin-386-cgo), const IPV6_2292NEXTHOP = 21 +pkg syscall (darwin-386-cgo), const IPV6_2292PKTINFO = 19 +pkg syscall (darwin-386-cgo), const IPV6_2292PKTOPTIONS = 25 +pkg syscall (darwin-386-cgo), const IPV6_2292RTHDR = 24 +pkg syscall (darwin-386-cgo), const IPV6_BINDV6ONLY = 27 +pkg syscall (darwin-386-cgo), const IPV6_BOUND_IF = 125 +pkg syscall (darwin-386-cgo), const IPV6_CHECKSUM = 26 +pkg syscall (darwin-386-cgo), const IPV6_DEFAULT_MULTICAST_HOPS = 1 +pkg syscall (darwin-386-cgo), const IPV6_DEFAULT_MULTICAST_LOOP = 1 +pkg syscall (darwin-386-cgo), const IPV6_DEFHLIM = 64 +pkg syscall (darwin-386-cgo), const IPV6_FAITH = 29 +pkg syscall (darwin-386-cgo), const IPV6_FLOWINFO_MASK = 4294967055 +pkg syscall (darwin-386-cgo), const IPV6_FLOWLABEL_MASK = 4294905600 +pkg syscall (darwin-386-cgo), const IPV6_FRAGTTL = 120 +pkg syscall (darwin-386-cgo), const IPV6_FW_ADD = 30 +pkg syscall (darwin-386-cgo), const IPV6_FW_DEL = 31 +pkg syscall (darwin-386-cgo), const IPV6_FW_FLUSH = 32 +pkg syscall (darwin-386-cgo), const IPV6_FW_GET = 34 +pkg syscall (darwin-386-cgo), const IPV6_FW_ZERO = 33 +pkg syscall (darwin-386-cgo), const IPV6_HLIMDEC = 1 +pkg syscall (darwin-386-cgo), const IPV6_IPSEC_POLICY = 28 +pkg syscall (darwin-386-cgo), const IPV6_JOIN_GROUP = 12 +pkg syscall (darwin-386-cgo), const IPV6_LEAVE_GROUP = 13 +pkg syscall (darwin-386-cgo), const IPV6_MAXHLIM = 255 +pkg syscall (darwin-386-cgo), const IPV6_MAXOPTHDR = 2048 +pkg syscall (darwin-386-cgo), const IPV6_MAXPACKET = 65535 +pkg syscall (darwin-386-cgo), const IPV6_MAX_GROUP_SRC_FILTER = 512 +pkg syscall (darwin-386-cgo), const IPV6_MAX_MEMBERSHIPS = 4095 +pkg syscall (darwin-386-cgo), const IPV6_MAX_SOCK_SRC_FILTER = 128 +pkg syscall (darwin-386-cgo), const IPV6_MIN_MEMBERSHIPS = 31 +pkg syscall (darwin-386-cgo), const IPV6_MMTU = 1280 +pkg syscall (darwin-386-cgo), const IPV6_MULTICAST_HOPS = 10 +pkg syscall (darwin-386-cgo), const IPV6_MULTICAST_IF = 9 +pkg syscall (darwin-386-cgo), const IPV6_MULTICAST_LOOP = 11 +pkg syscall (darwin-386-cgo), const IPV6_PORTRANGE = 14 +pkg syscall (darwin-386-cgo), const IPV6_PORTRANGE_DEFAULT = 0 +pkg syscall (darwin-386-cgo), const IPV6_PORTRANGE_HIGH = 1 +pkg syscall (darwin-386-cgo), const IPV6_PORTRANGE_LOW = 2 +pkg syscall (darwin-386-cgo), const IPV6_RECVTCLASS = 35 +pkg syscall (darwin-386-cgo), const IPV6_RTHDR_LOOSE = 0 +pkg syscall (darwin-386-cgo), const IPV6_RTHDR_STRICT = 1 +pkg syscall (darwin-386-cgo), const IPV6_RTHDR_TYPE_0 = 0 +pkg syscall (darwin-386-cgo), const IPV6_SOCKOPT_RESERVED1 = 3 +pkg syscall (darwin-386-cgo), const IPV6_TCLASS = 36 +pkg syscall (darwin-386-cgo), const IPV6_UNICAST_HOPS = 4 +pkg syscall (darwin-386-cgo), const IPV6_V6ONLY = 27 +pkg syscall (darwin-386-cgo), const IPV6_VERSION = 96 +pkg syscall (darwin-386-cgo), const IPV6_VERSION_MASK = 240 +pkg syscall (darwin-386-cgo), const IP_ADD_MEMBERSHIP = 12 +pkg syscall (darwin-386-cgo), const IP_ADD_SOURCE_MEMBERSHIP = 70 +pkg syscall (darwin-386-cgo), const IP_BLOCK_SOURCE = 72 +pkg syscall (darwin-386-cgo), const IP_BOUND_IF = 25 +pkg syscall (darwin-386-cgo), const IP_DEFAULT_MULTICAST_LOOP = 1 +pkg syscall (darwin-386-cgo), const IP_DEFAULT_MULTICAST_TTL = 1 +pkg syscall (darwin-386-cgo), const IP_DF = 16384 +pkg syscall (darwin-386-cgo), const IP_DROP_MEMBERSHIP = 13 +pkg syscall (darwin-386-cgo), const IP_DROP_SOURCE_MEMBERSHIP = 71 +pkg syscall (darwin-386-cgo), const IP_DUMMYNET_CONFIGURE = 60 +pkg syscall (darwin-386-cgo), const IP_DUMMYNET_DEL = 61 +pkg syscall (darwin-386-cgo), const IP_DUMMYNET_FLUSH = 62 +pkg syscall (darwin-386-cgo), const IP_DUMMYNET_GET = 64 +pkg syscall (darwin-386-cgo), const IP_FAITH = 22 +pkg syscall (darwin-386-cgo), const IP_FW_ADD = 40 +pkg syscall (darwin-386-cgo), const IP_FW_DEL = 41 +pkg syscall (darwin-386-cgo), const IP_FW_FLUSH = 42 +pkg syscall (darwin-386-cgo), const IP_FW_GET = 44 +pkg syscall (darwin-386-cgo), const IP_FW_RESETLOG = 45 +pkg syscall (darwin-386-cgo), const IP_FW_ZERO = 43 +pkg syscall (darwin-386-cgo), const IP_HDRINCL = 2 +pkg syscall (darwin-386-cgo), const IP_IPSEC_POLICY = 21 +pkg syscall (darwin-386-cgo), const IP_MAXPACKET = 65535 +pkg syscall (darwin-386-cgo), const IP_MAX_GROUP_SRC_FILTER = 512 +pkg syscall (darwin-386-cgo), const IP_MAX_MEMBERSHIPS = 4095 +pkg syscall (darwin-386-cgo), const IP_MAX_SOCK_MUTE_FILTER = 128 +pkg syscall (darwin-386-cgo), const IP_MAX_SOCK_SRC_FILTER = 128 +pkg syscall (darwin-386-cgo), const IP_MF = 8192 +pkg syscall (darwin-386-cgo), const IP_MIN_MEMBERSHIPS = 31 +pkg syscall (darwin-386-cgo), const IP_MSFILTER = 74 +pkg syscall (darwin-386-cgo), const IP_MSS = 576 +pkg syscall (darwin-386-cgo), const IP_MULTICAST_IF = 9 +pkg syscall (darwin-386-cgo), const IP_MULTICAST_IFINDEX = 66 +pkg syscall (darwin-386-cgo), const IP_MULTICAST_LOOP = 11 +pkg syscall (darwin-386-cgo), const IP_MULTICAST_TTL = 10 +pkg syscall (darwin-386-cgo), const IP_MULTICAST_VIF = 14 +pkg syscall (darwin-386-cgo), const IP_NAT__XXX = 55 +pkg syscall (darwin-386-cgo), const IP_OFFMASK = 8191 +pkg syscall (darwin-386-cgo), const IP_OLD_FW_ADD = 50 +pkg syscall (darwin-386-cgo), const IP_OLD_FW_DEL = 51 +pkg syscall (darwin-386-cgo), const IP_OLD_FW_FLUSH = 52 +pkg syscall (darwin-386-cgo), const IP_OLD_FW_GET = 54 +pkg syscall (darwin-386-cgo), const IP_OLD_FW_RESETLOG = 56 +pkg syscall (darwin-386-cgo), const IP_OLD_FW_ZERO = 53 +pkg syscall (darwin-386-cgo), const IP_OPTIONS = 1 +pkg syscall (darwin-386-cgo), const IP_PKTINFO = 26 +pkg syscall (darwin-386-cgo), const IP_PORTRANGE = 19 +pkg syscall (darwin-386-cgo), const IP_PORTRANGE_DEFAULT = 0 +pkg syscall (darwin-386-cgo), const IP_PORTRANGE_HIGH = 1 +pkg syscall (darwin-386-cgo), const IP_PORTRANGE_LOW = 2 +pkg syscall (darwin-386-cgo), const IP_RECVDSTADDR = 7 +pkg syscall (darwin-386-cgo), const IP_RECVIF = 20 +pkg syscall (darwin-386-cgo), const IP_RECVOPTS = 5 +pkg syscall (darwin-386-cgo), const IP_RECVPKTINFO = 26 +pkg syscall (darwin-386-cgo), const IP_RECVRETOPTS = 6 +pkg syscall (darwin-386-cgo), const IP_RECVTTL = 24 +pkg syscall (darwin-386-cgo), const IP_RETOPTS = 8 +pkg syscall (darwin-386-cgo), const IP_RF = 32768 +pkg syscall (darwin-386-cgo), const IP_RSVP_OFF = 16 +pkg syscall (darwin-386-cgo), const IP_RSVP_ON = 15 +pkg syscall (darwin-386-cgo), const IP_RSVP_VIF_OFF = 18 +pkg syscall (darwin-386-cgo), const IP_RSVP_VIF_ON = 17 +pkg syscall (darwin-386-cgo), const IP_STRIPHDR = 23 +pkg syscall (darwin-386-cgo), const IP_TOS = 3 +pkg syscall (darwin-386-cgo), const IP_TRAFFIC_MGT_BACKGROUND = 65 +pkg syscall (darwin-386-cgo), const IP_TTL = 4 +pkg syscall (darwin-386-cgo), const IP_UNBLOCK_SOURCE = 73 +pkg syscall (darwin-386-cgo), const ISIG = 128 +pkg syscall (darwin-386-cgo), const ISIG ideal-int +pkg syscall (darwin-386-cgo), const ISTRIP = 32 +pkg syscall (darwin-386-cgo), const ISTRIP ideal-int +pkg syscall (darwin-386-cgo), const IUTF8 = 16384 +pkg syscall (darwin-386-cgo), const IUTF8 ideal-int +pkg syscall (darwin-386-cgo), const IXANY = 2048 +pkg syscall (darwin-386-cgo), const IXANY ideal-int +pkg syscall (darwin-386-cgo), const IXOFF = 1024 +pkg syscall (darwin-386-cgo), const IXOFF ideal-int +pkg syscall (darwin-386-cgo), const IXON = 512 +pkg syscall (darwin-386-cgo), const IXON ideal-int +pkg syscall (darwin-386-cgo), const ImplementsGetwd = false +pkg syscall (darwin-386-cgo), const LOCK_EX = 2 +pkg syscall (darwin-386-cgo), const LOCK_NB = 4 +pkg syscall (darwin-386-cgo), const LOCK_SH = 1 +pkg syscall (darwin-386-cgo), const LOCK_UN = 8 +pkg syscall (darwin-386-cgo), const MADV_CAN_REUSE = 9 +pkg syscall (darwin-386-cgo), const MADV_DONTNEED = 4 +pkg syscall (darwin-386-cgo), const MADV_FREE = 5 +pkg syscall (darwin-386-cgo), const MADV_FREE_REUSABLE = 7 +pkg syscall (darwin-386-cgo), const MADV_FREE_REUSE = 8 +pkg syscall (darwin-386-cgo), const MADV_NORMAL = 0 +pkg syscall (darwin-386-cgo), const MADV_RANDOM = 1 +pkg syscall (darwin-386-cgo), const MADV_SEQUENTIAL = 2 +pkg syscall (darwin-386-cgo), const MADV_WILLNEED = 3 +pkg syscall (darwin-386-cgo), const MADV_ZERO_WIRED_PAGES = 6 +pkg syscall (darwin-386-cgo), const MAP_ANON = 4096 +pkg syscall (darwin-386-cgo), const MAP_COPY = 2 +pkg syscall (darwin-386-cgo), const MAP_FILE = 0 +pkg syscall (darwin-386-cgo), const MAP_FIXED = 16 +pkg syscall (darwin-386-cgo), const MAP_HASSEMAPHORE = 512 +pkg syscall (darwin-386-cgo), const MAP_JIT = 2048 +pkg syscall (darwin-386-cgo), const MAP_NOCACHE = 1024 +pkg syscall (darwin-386-cgo), const MAP_NOEXTEND = 256 +pkg syscall (darwin-386-cgo), const MAP_NORESERVE = 64 +pkg syscall (darwin-386-cgo), const MAP_PRIVATE = 2 +pkg syscall (darwin-386-cgo), const MAP_RENAME = 32 +pkg syscall (darwin-386-cgo), const MAP_RESERVED0080 = 128 +pkg syscall (darwin-386-cgo), const MAP_SHARED = 1 +pkg syscall (darwin-386-cgo), const MCL_CURRENT = 1 +pkg syscall (darwin-386-cgo), const MCL_FUTURE = 2 +pkg syscall (darwin-386-cgo), const MSG_CTRUNC = 32 +pkg syscall (darwin-386-cgo), const MSG_DONTROUTE = 4 +pkg syscall (darwin-386-cgo), const MSG_DONTWAIT = 128 +pkg syscall (darwin-386-cgo), const MSG_EOF = 256 +pkg syscall (darwin-386-cgo), const MSG_EOR = 8 +pkg syscall (darwin-386-cgo), const MSG_FLUSH = 1024 +pkg syscall (darwin-386-cgo), const MSG_HAVEMORE = 8192 +pkg syscall (darwin-386-cgo), const MSG_HOLD = 2048 +pkg syscall (darwin-386-cgo), const MSG_NEEDSA = 65536 +pkg syscall (darwin-386-cgo), const MSG_OOB = 1 +pkg syscall (darwin-386-cgo), const MSG_PEEK = 2 +pkg syscall (darwin-386-cgo), const MSG_RCVMORE = 16384 +pkg syscall (darwin-386-cgo), const MSG_SEND = 4096 +pkg syscall (darwin-386-cgo), const MSG_TRUNC = 16 +pkg syscall (darwin-386-cgo), const MSG_WAITALL = 64 +pkg syscall (darwin-386-cgo), const MSG_WAITSTREAM = 512 +pkg syscall (darwin-386-cgo), const MS_ASYNC = 1 +pkg syscall (darwin-386-cgo), const MS_DEACTIVATE = 8 +pkg syscall (darwin-386-cgo), const MS_INVALIDATE = 2 +pkg syscall (darwin-386-cgo), const MS_KILLPAGES = 4 +pkg syscall (darwin-386-cgo), const MS_SYNC = 16 +pkg syscall (darwin-386-cgo), const NAME_MAX = 255 +pkg syscall (darwin-386-cgo), const NET_RT_DUMP = 1 +pkg syscall (darwin-386-cgo), const NET_RT_DUMP2 = 7 +pkg syscall (darwin-386-cgo), const NET_RT_FLAGS = 2 +pkg syscall (darwin-386-cgo), const NET_RT_IFLIST = 3 +pkg syscall (darwin-386-cgo), const NET_RT_IFLIST2 = 6 +pkg syscall (darwin-386-cgo), const NET_RT_MAXID = 10 +pkg syscall (darwin-386-cgo), const NET_RT_STAT = 4 +pkg syscall (darwin-386-cgo), const NET_RT_TRASH = 5 +pkg syscall (darwin-386-cgo), const NOFLSH = 2147483648 +pkg syscall (darwin-386-cgo), const NOFLSH ideal-int +pkg syscall (darwin-386-cgo), const NOTE_ABSOLUTE = 8 +pkg syscall (darwin-386-cgo), const NOTE_ATTRIB = 8 +pkg syscall (darwin-386-cgo), const NOTE_CHILD = 4 +pkg syscall (darwin-386-cgo), const NOTE_DELETE = 1 +pkg syscall (darwin-386-cgo), const NOTE_EXEC = 536870912 +pkg syscall (darwin-386-cgo), const NOTE_EXIT = 2147483648 +pkg syscall (darwin-386-cgo), const NOTE_EXITSTATUS = 67108864 +pkg syscall (darwin-386-cgo), const NOTE_EXTEND = 4 +pkg syscall (darwin-386-cgo), const NOTE_FFAND = 1073741824 +pkg syscall (darwin-386-cgo), const NOTE_FFCOPY = 3221225472 +pkg syscall (darwin-386-cgo), const NOTE_FFCTRLMASK = 3221225472 +pkg syscall (darwin-386-cgo), const NOTE_FFLAGSMASK = 16777215 +pkg syscall (darwin-386-cgo), const NOTE_FFNOP = 0 +pkg syscall (darwin-386-cgo), const NOTE_FFOR = 2147483648 +pkg syscall (darwin-386-cgo), const NOTE_FORK = 1073741824 +pkg syscall (darwin-386-cgo), const NOTE_LINK = 16 +pkg syscall (darwin-386-cgo), const NOTE_LOWAT = 1 +pkg syscall (darwin-386-cgo), const NOTE_NONE = 128 +pkg syscall (darwin-386-cgo), const NOTE_NSECONDS = 4 +pkg syscall (darwin-386-cgo), const NOTE_PCTRLMASK = -1048576 +pkg syscall (darwin-386-cgo), const NOTE_PDATAMASK = 1048575 +pkg syscall (darwin-386-cgo), const NOTE_REAP = 268435456 +pkg syscall (darwin-386-cgo), const NOTE_RENAME = 32 +pkg syscall (darwin-386-cgo), const NOTE_RESOURCEEND = 33554432 +pkg syscall (darwin-386-cgo), const NOTE_REVOKE = 64 +pkg syscall (darwin-386-cgo), const NOTE_SECONDS = 1 +pkg syscall (darwin-386-cgo), const NOTE_SIGNAL = 134217728 +pkg syscall (darwin-386-cgo), const NOTE_TRACK = 1 +pkg syscall (darwin-386-cgo), const NOTE_TRACKERR = 2 +pkg syscall (darwin-386-cgo), const NOTE_TRIGGER = 16777216 +pkg syscall (darwin-386-cgo), const NOTE_USECONDS = 2 +pkg syscall (darwin-386-cgo), const NOTE_VM_ERROR = 268435456 +pkg syscall (darwin-386-cgo), const NOTE_VM_PRESSURE = 2147483648 +pkg syscall (darwin-386-cgo), const NOTE_VM_PRESSURE_SUDDEN_TERMINATE = 536870912 +pkg syscall (darwin-386-cgo), const NOTE_VM_PRESSURE_TERMINATE = 1073741824 +pkg syscall (darwin-386-cgo), const NOTE_WRITE = 2 +pkg syscall (darwin-386-cgo), const OCRNL = 16 +pkg syscall (darwin-386-cgo), const OCRNL ideal-int +pkg syscall (darwin-386-cgo), const OFDEL = 131072 +pkg syscall (darwin-386-cgo), const OFDEL ideal-int +pkg syscall (darwin-386-cgo), const OFILL = 128 +pkg syscall (darwin-386-cgo), const OFILL ideal-int +pkg syscall (darwin-386-cgo), const ONLCR = 2 +pkg syscall (darwin-386-cgo), const ONLCR ideal-int +pkg syscall (darwin-386-cgo), const ONLRET = 64 +pkg syscall (darwin-386-cgo), const ONLRET ideal-int +pkg syscall (darwin-386-cgo), const ONOCR = 32 +pkg syscall (darwin-386-cgo), const ONOCR ideal-int +pkg syscall (darwin-386-cgo), const ONOEOT = 8 +pkg syscall (darwin-386-cgo), const ONOEOT ideal-int +pkg syscall (darwin-386-cgo), const OPOST = 1 +pkg syscall (darwin-386-cgo), const OPOST ideal-int +pkg syscall (darwin-386-cgo), const O_ACCMODE = 3 +pkg syscall (darwin-386-cgo), const O_ALERT = 536870912 +pkg syscall (darwin-386-cgo), const O_APPEND = 8 +pkg syscall (darwin-386-cgo), const O_ASYNC = 64 +pkg syscall (darwin-386-cgo), const O_CLOEXEC = 16777216 +pkg syscall (darwin-386-cgo), const O_CREAT = 512 +pkg syscall (darwin-386-cgo), const O_DIRECTORY = 1048576 +pkg syscall (darwin-386-cgo), const O_DSYNC = 4194304 +pkg syscall (darwin-386-cgo), const O_EVTONLY = 32768 +pkg syscall (darwin-386-cgo), const O_EXCL = 2048 +pkg syscall (darwin-386-cgo), const O_EXLOCK = 32 +pkg syscall (darwin-386-cgo), const O_FSYNC = 128 +pkg syscall (darwin-386-cgo), const O_NDELAY = 4 +pkg syscall (darwin-386-cgo), const O_NOCTTY = 131072 +pkg syscall (darwin-386-cgo), const O_NOFOLLOW = 256 +pkg syscall (darwin-386-cgo), const O_NONBLOCK = 4 +pkg syscall (darwin-386-cgo), const O_POPUP = 2147483648 +pkg syscall (darwin-386-cgo), const O_SHLOCK = 16 +pkg syscall (darwin-386-cgo), const O_SYMLINK = 2097152 +pkg syscall (darwin-386-cgo), const O_SYNC = 128 +pkg syscall (darwin-386-cgo), const O_TRUNC = 1024 +pkg syscall (darwin-386-cgo), const PARENB = 4096 +pkg syscall (darwin-386-cgo), const PARENB ideal-int +pkg syscall (darwin-386-cgo), const PARMRK = 8 +pkg syscall (darwin-386-cgo), const PARMRK ideal-int +pkg syscall (darwin-386-cgo), const PARODD = 8192 +pkg syscall (darwin-386-cgo), const PARODD ideal-int +pkg syscall (darwin-386-cgo), const PENDIN = 536870912 +pkg syscall (darwin-386-cgo), const PENDIN ideal-int +pkg syscall (darwin-386-cgo), const PROT_EXEC = 4 +pkg syscall (darwin-386-cgo), const PROT_NONE = 0 +pkg syscall (darwin-386-cgo), const PROT_READ = 1 +pkg syscall (darwin-386-cgo), const PROT_WRITE = 2 +pkg syscall (darwin-386-cgo), const PTRACE_CONT = 7 +pkg syscall (darwin-386-cgo), const PTRACE_KILL = 8 +pkg syscall (darwin-386-cgo), const PTRACE_TRACEME = 0 +pkg syscall (darwin-386-cgo), const PT_ATTACH = 10 +pkg syscall (darwin-386-cgo), const PT_ATTACHEXC = 14 +pkg syscall (darwin-386-cgo), const PT_CONTINUE = 7 +pkg syscall (darwin-386-cgo), const PT_DENY_ATTACH = 31 +pkg syscall (darwin-386-cgo), const PT_DETACH = 11 +pkg syscall (darwin-386-cgo), const PT_FIRSTMACH = 32 +pkg syscall (darwin-386-cgo), const PT_FORCEQUOTA = 30 +pkg syscall (darwin-386-cgo), const PT_KILL = 8 +pkg syscall (darwin-386-cgo), const PT_READ_D = 2 +pkg syscall (darwin-386-cgo), const PT_READ_I = 1 +pkg syscall (darwin-386-cgo), const PT_READ_U = 3 +pkg syscall (darwin-386-cgo), const PT_SIGEXC = 12 +pkg syscall (darwin-386-cgo), const PT_STEP = 9 +pkg syscall (darwin-386-cgo), const PT_THUPDATE = 13 +pkg syscall (darwin-386-cgo), const PT_TRACE_ME = 0 +pkg syscall (darwin-386-cgo), const PT_WRITE_D = 5 +pkg syscall (darwin-386-cgo), const PT_WRITE_I = 4 +pkg syscall (darwin-386-cgo), const PT_WRITE_U = 6 +pkg syscall (darwin-386-cgo), const RLIMIT_AS = 5 +pkg syscall (darwin-386-cgo), const RLIMIT_CORE = 4 +pkg syscall (darwin-386-cgo), const RLIMIT_CPU = 0 +pkg syscall (darwin-386-cgo), const RLIMIT_DATA = 2 +pkg syscall (darwin-386-cgo), const RLIMIT_FSIZE = 1 +pkg syscall (darwin-386-cgo), const RLIMIT_NOFILE = 8 +pkg syscall (darwin-386-cgo), const RLIMIT_STACK = 3 +pkg syscall (darwin-386-cgo), const RLIM_INFINITY = 9223372036854775807 +pkg syscall (darwin-386-cgo), const RTAX_AUTHOR = 6 +pkg syscall (darwin-386-cgo), const RTAX_BRD = 7 +pkg syscall (darwin-386-cgo), const RTAX_DST = 0 +pkg syscall (darwin-386-cgo), const RTAX_GATEWAY = 1 +pkg syscall (darwin-386-cgo), const RTAX_GENMASK = 3 +pkg syscall (darwin-386-cgo), const RTAX_IFA = 5 +pkg syscall (darwin-386-cgo), const RTAX_IFP = 4 +pkg syscall (darwin-386-cgo), const RTAX_MAX = 8 +pkg syscall (darwin-386-cgo), const RTAX_NETMASK = 2 +pkg syscall (darwin-386-cgo), const RTA_AUTHOR = 64 +pkg syscall (darwin-386-cgo), const RTA_BRD = 128 +pkg syscall (darwin-386-cgo), const RTA_DST = 1 +pkg syscall (darwin-386-cgo), const RTA_GATEWAY = 2 +pkg syscall (darwin-386-cgo), const RTA_GENMASK = 8 +pkg syscall (darwin-386-cgo), const RTA_IFA = 32 +pkg syscall (darwin-386-cgo), const RTA_IFP = 16 +pkg syscall (darwin-386-cgo), const RTA_NETMASK = 4 +pkg syscall (darwin-386-cgo), const RTF_BLACKHOLE = 4096 +pkg syscall (darwin-386-cgo), const RTF_BROADCAST = 4194304 +pkg syscall (darwin-386-cgo), const RTF_CLONING = 256 +pkg syscall (darwin-386-cgo), const RTF_CONDEMNED = 33554432 +pkg syscall (darwin-386-cgo), const RTF_DELCLONE = 128 +pkg syscall (darwin-386-cgo), const RTF_DONE = 64 +pkg syscall (darwin-386-cgo), const RTF_DYNAMIC = 16 +pkg syscall (darwin-386-cgo), const RTF_GATEWAY = 2 +pkg syscall (darwin-386-cgo), const RTF_HOST = 4 +pkg syscall (darwin-386-cgo), const RTF_IFREF = 67108864 +pkg syscall (darwin-386-cgo), const RTF_IFSCOPE = 16777216 +pkg syscall (darwin-386-cgo), const RTF_LLINFO = 1024 +pkg syscall (darwin-386-cgo), const RTF_LOCAL = 2097152 +pkg syscall (darwin-386-cgo), const RTF_MODIFIED = 32 +pkg syscall (darwin-386-cgo), const RTF_MULTICAST = 8388608 +pkg syscall (darwin-386-cgo), const RTF_PINNED = 1048576 +pkg syscall (darwin-386-cgo), const RTF_PRCLONING = 65536 +pkg syscall (darwin-386-cgo), const RTF_PROTO1 = 32768 +pkg syscall (darwin-386-cgo), const RTF_PROTO2 = 16384 +pkg syscall (darwin-386-cgo), const RTF_PROTO3 = 262144 +pkg syscall (darwin-386-cgo), const RTF_REJECT = 8 +pkg syscall (darwin-386-cgo), const RTF_STATIC = 2048 +pkg syscall (darwin-386-cgo), const RTF_UP = 1 +pkg syscall (darwin-386-cgo), const RTF_WASCLONED = 131072 +pkg syscall (darwin-386-cgo), const RTF_XRESOLVE = 512 +pkg syscall (darwin-386-cgo), const RTM_ADD = 1 +pkg syscall (darwin-386-cgo), const RTM_CHANGE = 3 +pkg syscall (darwin-386-cgo), const RTM_DELADDR = 13 +pkg syscall (darwin-386-cgo), const RTM_DELETE = 2 +pkg syscall (darwin-386-cgo), const RTM_DELMADDR = 16 +pkg syscall (darwin-386-cgo), const RTM_GET = 4 +pkg syscall (darwin-386-cgo), const RTM_GET2 = 20 +pkg syscall (darwin-386-cgo), const RTM_IFINFO = 14 +pkg syscall (darwin-386-cgo), const RTM_IFINFO2 = 18 +pkg syscall (darwin-386-cgo), const RTM_LOCK = 8 +pkg syscall (darwin-386-cgo), const RTM_LOSING = 5 +pkg syscall (darwin-386-cgo), const RTM_MISS = 7 +pkg syscall (darwin-386-cgo), const RTM_NEWADDR = 12 +pkg syscall (darwin-386-cgo), const RTM_NEWMADDR = 15 +pkg syscall (darwin-386-cgo), const RTM_NEWMADDR2 = 19 +pkg syscall (darwin-386-cgo), const RTM_OLDADD = 9 +pkg syscall (darwin-386-cgo), const RTM_OLDDEL = 10 +pkg syscall (darwin-386-cgo), const RTM_REDIRECT = 6 +pkg syscall (darwin-386-cgo), const RTM_RESOLVE = 11 +pkg syscall (darwin-386-cgo), const RTM_RTTUNIT = 1000000 +pkg syscall (darwin-386-cgo), const RTM_VERSION = 5 +pkg syscall (darwin-386-cgo), const RTV_EXPIRE = 4 +pkg syscall (darwin-386-cgo), const RTV_HOPCOUNT = 2 +pkg syscall (darwin-386-cgo), const RTV_MTU = 1 +pkg syscall (darwin-386-cgo), const RTV_RPIPE = 8 +pkg syscall (darwin-386-cgo), const RTV_RTT = 64 +pkg syscall (darwin-386-cgo), const RTV_RTTVAR = 128 +pkg syscall (darwin-386-cgo), const RTV_SPIPE = 16 +pkg syscall (darwin-386-cgo), const RTV_SSTHRESH = 32 +pkg syscall (darwin-386-cgo), const RUSAGE_CHILDREN = -1 +pkg syscall (darwin-386-cgo), const RUSAGE_SELF = 0 +pkg syscall (darwin-386-cgo), const SCM_CREDS = 3 +pkg syscall (darwin-386-cgo), const SCM_RIGHTS = 1 +pkg syscall (darwin-386-cgo), const SCM_TIMESTAMP = 2 +pkg syscall (darwin-386-cgo), const SCM_TIMESTAMP_MONOTONIC = 4 +pkg syscall (darwin-386-cgo), const SIGBUS = 10 +pkg syscall (darwin-386-cgo), const SIGCHLD = 20 +pkg syscall (darwin-386-cgo), const SIGCONT = 19 +pkg syscall (darwin-386-cgo), const SIGEMT = 7 +pkg syscall (darwin-386-cgo), const SIGINFO = 29 +pkg syscall (darwin-386-cgo), const SIGIO = 23 +pkg syscall (darwin-386-cgo), const SIGIOT = 6 +pkg syscall (darwin-386-cgo), const SIGPROF = 27 +pkg syscall (darwin-386-cgo), const SIGSTOP = 17 +pkg syscall (darwin-386-cgo), const SIGSYS = 12 +pkg syscall (darwin-386-cgo), const SIGTSTP = 18 +pkg syscall (darwin-386-cgo), const SIGTTIN = 21 +pkg syscall (darwin-386-cgo), const SIGTTOU = 22 +pkg syscall (darwin-386-cgo), const SIGURG = 16 +pkg syscall (darwin-386-cgo), const SIGUSR1 = 30 +pkg syscall (darwin-386-cgo), const SIGUSR2 = 31 +pkg syscall (darwin-386-cgo), const SIGVTALRM = 26 +pkg syscall (darwin-386-cgo), const SIGWINCH = 28 +pkg syscall (darwin-386-cgo), const SIGXCPU = 24 +pkg syscall (darwin-386-cgo), const SIGXFSZ = 25 +pkg syscall (darwin-386-cgo), const SIOCADDMULTI = 2149607729 +pkg syscall (darwin-386-cgo), const SIOCAIFADDR = 2151704858 +pkg syscall (darwin-386-cgo), const SIOCALIFADDR = 2165860637 +pkg syscall (darwin-386-cgo), const SIOCARPIPLL = 3223349544 +pkg syscall (darwin-386-cgo), const SIOCATMARK = 1074033415 +pkg syscall (darwin-386-cgo), const SIOCAUTOADDR = 3223349542 +pkg syscall (darwin-386-cgo), const SIOCAUTONETMASK = 2149607719 +pkg syscall (darwin-386-cgo), const SIOCDELMULTI = 2149607730 +pkg syscall (darwin-386-cgo), const SIOCDIFADDR = 2149607705 +pkg syscall (darwin-386-cgo), const SIOCDIFPHYADDR = 2149607745 +pkg syscall (darwin-386-cgo), const SIOCDLIFADDR = 2165860639 +pkg syscall (darwin-386-cgo), const SIOCGDRVSPEC = 3223087483 +pkg syscall (darwin-386-cgo), const SIOCGETSGCNT = 3222565404 +pkg syscall (darwin-386-cgo), const SIOCGETVIFCNT = 3222565403 +pkg syscall (darwin-386-cgo), const SIOCGETVLAN = 3223349631 +pkg syscall (darwin-386-cgo), const SIOCGHIWAT = 1074033409 +pkg syscall (darwin-386-cgo), const SIOCGIFADDR = 3223349537 +pkg syscall (darwin-386-cgo), const SIOCGIFALTMTU = 3223349576 +pkg syscall (darwin-386-cgo), const SIOCGIFASYNCMAP = 3223349628 +pkg syscall (darwin-386-cgo), const SIOCGIFBOND = 3223349575 +pkg syscall (darwin-386-cgo), const SIOCGIFBRDADDR = 3223349539 +pkg syscall (darwin-386-cgo), const SIOCGIFCAP = 3223349595 +pkg syscall (darwin-386-cgo), const SIOCGIFCONF = 3221776676 +pkg syscall (darwin-386-cgo), const SIOCGIFDEVMTU = 3223349572 +pkg syscall (darwin-386-cgo), const SIOCGIFDSTADDR = 3223349538 +pkg syscall (darwin-386-cgo), const SIOCGIFFLAGS = 3223349521 +pkg syscall (darwin-386-cgo), const SIOCGIFGENERIC = 3223349562 +pkg syscall (darwin-386-cgo), const SIOCGIFKPI = 3223349639 +pkg syscall (darwin-386-cgo), const SIOCGIFMAC = 3223349634 +pkg syscall (darwin-386-cgo), const SIOCGIFMEDIA = 3223873848 +pkg syscall (darwin-386-cgo), const SIOCGIFMETRIC = 3223349527 +pkg syscall (darwin-386-cgo), const SIOCGIFMTU = 3223349555 +pkg syscall (darwin-386-cgo), const SIOCGIFNETMASK = 3223349541 +pkg syscall (darwin-386-cgo), const SIOCGIFPDSTADDR = 3223349568 +pkg syscall (darwin-386-cgo), const SIOCGIFPHYS = 3223349557 +pkg syscall (darwin-386-cgo), const SIOCGIFPSRCADDR = 3223349567 +pkg syscall (darwin-386-cgo), const SIOCGIFSTATUS = 3274795325 +pkg syscall (darwin-386-cgo), const SIOCGIFVLAN = 3223349631 +pkg syscall (darwin-386-cgo), const SIOCGIFWAKEFLAGS = 3223349640 +pkg syscall (darwin-386-cgo), const SIOCGLIFADDR = 3239602462 +pkg syscall (darwin-386-cgo), const SIOCGLIFPHYADDR = 3239602499 +pkg syscall (darwin-386-cgo), const SIOCGLOWAT = 1074033411 +pkg syscall (darwin-386-cgo), const SIOCGPGRP = 1074033417 +pkg syscall (darwin-386-cgo), const SIOCIFCREATE = 3223349624 +pkg syscall (darwin-386-cgo), const SIOCIFCREATE2 = 3223349626 +pkg syscall (darwin-386-cgo), const SIOCIFDESTROY = 2149607801 +pkg syscall (darwin-386-cgo), const SIOCRSLVMULTI = 3221776699 +pkg syscall (darwin-386-cgo), const SIOCSDRVSPEC = 2149345659 +pkg syscall (darwin-386-cgo), const SIOCSETVLAN = 2149607806 +pkg syscall (darwin-386-cgo), const SIOCSHIWAT = 2147775232 +pkg syscall (darwin-386-cgo), const SIOCSIFADDR = 2149607692 +pkg syscall (darwin-386-cgo), const SIOCSIFALTMTU = 2149607749 +pkg syscall (darwin-386-cgo), const SIOCSIFASYNCMAP = 2149607805 +pkg syscall (darwin-386-cgo), const SIOCSIFBOND = 2149607750 +pkg syscall (darwin-386-cgo), const SIOCSIFBRDADDR = 2149607699 +pkg syscall (darwin-386-cgo), const SIOCSIFCAP = 2149607770 +pkg syscall (darwin-386-cgo), const SIOCSIFDSTADDR = 2149607694 +pkg syscall (darwin-386-cgo), const SIOCSIFFLAGS = 2149607696 +pkg syscall (darwin-386-cgo), const SIOCSIFGENERIC = 2149607737 +pkg syscall (darwin-386-cgo), const SIOCSIFKPI = 2149607814 +pkg syscall (darwin-386-cgo), const SIOCSIFLLADDR = 2149607740 +pkg syscall (darwin-386-cgo), const SIOCSIFMAC = 2149607811 +pkg syscall (darwin-386-cgo), const SIOCSIFMEDIA = 3223349559 +pkg syscall (darwin-386-cgo), const SIOCSIFMETRIC = 2149607704 +pkg syscall (darwin-386-cgo), const SIOCSIFMTU = 2149607732 +pkg syscall (darwin-386-cgo), const SIOCSIFNETMASK = 2149607702 +pkg syscall (darwin-386-cgo), const SIOCSIFPHYADDR = 2151704894 +pkg syscall (darwin-386-cgo), const SIOCSIFPHYS = 2149607734 +pkg syscall (darwin-386-cgo), const SIOCSIFVLAN = 2149607806 +pkg syscall (darwin-386-cgo), const SIOCSLIFPHYADDR = 2165860674 +pkg syscall (darwin-386-cgo), const SIOCSLOWAT = 2147775234 +pkg syscall (darwin-386-cgo), const SIOCSPGRP = 2147775240 +pkg syscall (darwin-386-cgo), const SOCK_MAXADDRLEN = 255 +pkg syscall (darwin-386-cgo), const SOCK_RDM = 4 +pkg syscall (darwin-386-cgo), const SOL_SOCKET = 65535 +pkg syscall (darwin-386-cgo), const SOMAXCONN = 128 +pkg syscall (darwin-386-cgo), const SO_ACCEPTCONN = 2 +pkg syscall (darwin-386-cgo), const SO_BROADCAST = 32 +pkg syscall (darwin-386-cgo), const SO_DEBUG = 1 +pkg syscall (darwin-386-cgo), const SO_DONTROUTE = 16 +pkg syscall (darwin-386-cgo), const SO_DONTTRUNC = 8192 +pkg syscall (darwin-386-cgo), const SO_ERROR = 4103 +pkg syscall (darwin-386-cgo), const SO_KEEPALIVE = 8 +pkg syscall (darwin-386-cgo), const SO_LABEL = 4112 +pkg syscall (darwin-386-cgo), const SO_LINGER = 128 +pkg syscall (darwin-386-cgo), const SO_LINGER_SEC = 4224 +pkg syscall (darwin-386-cgo), const SO_NKE = 4129 +pkg syscall (darwin-386-cgo), const SO_NOADDRERR = 4131 +pkg syscall (darwin-386-cgo), const SO_NOSIGPIPE = 4130 +pkg syscall (darwin-386-cgo), const SO_NOTIFYCONFLICT = 4134 +pkg syscall (darwin-386-cgo), const SO_NP_EXTENSIONS = 4227 +pkg syscall (darwin-386-cgo), const SO_NREAD = 4128 +pkg syscall (darwin-386-cgo), const SO_NWRITE = 4132 +pkg syscall (darwin-386-cgo), const SO_OOBINLINE = 256 +pkg syscall (darwin-386-cgo), const SO_PEERLABEL = 4113 +pkg syscall (darwin-386-cgo), const SO_RANDOMPORT = 4226 +pkg syscall (darwin-386-cgo), const SO_RCVBUF = 4098 +pkg syscall (darwin-386-cgo), const SO_RCVLOWAT = 4100 +pkg syscall (darwin-386-cgo), const SO_RCVTIMEO = 4102 +pkg syscall (darwin-386-cgo), const SO_RESTRICTIONS = 4225 +pkg syscall (darwin-386-cgo), const SO_RESTRICT_DENYIN = 1 +pkg syscall (darwin-386-cgo), const SO_RESTRICT_DENYOUT = 2 +pkg syscall (darwin-386-cgo), const SO_RESTRICT_DENYSET = 2147483648 +pkg syscall (darwin-386-cgo), const SO_REUSEADDR = 4 +pkg syscall (darwin-386-cgo), const SO_REUSEPORT = 512 +pkg syscall (darwin-386-cgo), const SO_REUSESHAREUID = 4133 +pkg syscall (darwin-386-cgo), const SO_SNDBUF = 4097 +pkg syscall (darwin-386-cgo), const SO_SNDLOWAT = 4099 +pkg syscall (darwin-386-cgo), const SO_SNDTIMEO = 4101 +pkg syscall (darwin-386-cgo), const SO_TIMESTAMP = 1024 +pkg syscall (darwin-386-cgo), const SO_TIMESTAMP_MONOTONIC = 2048 +pkg syscall (darwin-386-cgo), const SO_TYPE = 4104 +pkg syscall (darwin-386-cgo), const SO_UPCALLCLOSEWAIT = 4135 +pkg syscall (darwin-386-cgo), const SO_USELOOPBACK = 64 +pkg syscall (darwin-386-cgo), const SO_WANTMORE = 16384 +pkg syscall (darwin-386-cgo), const SO_WANTOOBFLAG = 32768 +pkg syscall (darwin-386-cgo), const SYS_ACCEPT = 30 +pkg syscall (darwin-386-cgo), const SYS_ACCEPT_NOCANCEL = 404 +pkg syscall (darwin-386-cgo), const SYS_ACCESS = 33 +pkg syscall (darwin-386-cgo), const SYS_ACCESS_EXTENDED = 284 +pkg syscall (darwin-386-cgo), const SYS_ACCT = 51 +pkg syscall (darwin-386-cgo), const SYS_ADD_PROFIL = 176 +pkg syscall (darwin-386-cgo), const SYS_ADJTIME = 140 +pkg syscall (darwin-386-cgo), const SYS_AIO_CANCEL = 316 +pkg syscall (darwin-386-cgo), const SYS_AIO_ERROR = 317 +pkg syscall (darwin-386-cgo), const SYS_AIO_FSYNC = 313 +pkg syscall (darwin-386-cgo), const SYS_AIO_READ = 318 +pkg syscall (darwin-386-cgo), const SYS_AIO_RETURN = 314 +pkg syscall (darwin-386-cgo), const SYS_AIO_SUSPEND = 315 +pkg syscall (darwin-386-cgo), const SYS_AIO_SUSPEND_NOCANCEL = 421 +pkg syscall (darwin-386-cgo), const SYS_AIO_WRITE = 319 +pkg syscall (darwin-386-cgo), const SYS_ATGETMSG = 207 +pkg syscall (darwin-386-cgo), const SYS_ATPGETREQ = 211 +pkg syscall (darwin-386-cgo), const SYS_ATPGETRSP = 212 +pkg syscall (darwin-386-cgo), const SYS_ATPSNDREQ = 209 +pkg syscall (darwin-386-cgo), const SYS_ATPSNDRSP = 210 +pkg syscall (darwin-386-cgo), const SYS_ATPUTMSG = 208 +pkg syscall (darwin-386-cgo), const SYS_ATSOCKET = 206 +pkg syscall (darwin-386-cgo), const SYS_AUDIT = 350 +pkg syscall (darwin-386-cgo), const SYS_AUDITCTL = 359 +pkg syscall (darwin-386-cgo), const SYS_AUDITON = 351 +pkg syscall (darwin-386-cgo), const SYS_AUDIT_SESSION_JOIN = 429 +pkg syscall (darwin-386-cgo), const SYS_AUDIT_SESSION_PORT = 432 +pkg syscall (darwin-386-cgo), const SYS_AUDIT_SESSION_SELF = 428 +pkg syscall (darwin-386-cgo), const SYS_BIND = 104 +pkg syscall (darwin-386-cgo), const SYS_BSDTHREAD_CREATE = 360 +pkg syscall (darwin-386-cgo), const SYS_BSDTHREAD_REGISTER = 366 +pkg syscall (darwin-386-cgo), const SYS_BSDTHREAD_TERMINATE = 361 +pkg syscall (darwin-386-cgo), const SYS_CHDIR = 12 +pkg syscall (darwin-386-cgo), const SYS_CHFLAGS = 34 +pkg syscall (darwin-386-cgo), const SYS_CHMOD = 15 +pkg syscall (darwin-386-cgo), const SYS_CHMOD_EXTENDED = 282 +pkg syscall (darwin-386-cgo), const SYS_CHOWN = 16 +pkg syscall (darwin-386-cgo), const SYS_CHROOT = 61 +pkg syscall (darwin-386-cgo), const SYS_CHUD = 185 +pkg syscall (darwin-386-cgo), const SYS_CLOSE = 6 +pkg syscall (darwin-386-cgo), const SYS_CLOSE_NOCANCEL = 399 +pkg syscall (darwin-386-cgo), const SYS_CONNECT = 98 +pkg syscall (darwin-386-cgo), const SYS_CONNECT_NOCANCEL = 409 +pkg syscall (darwin-386-cgo), const SYS_COPYFILE = 227 +pkg syscall (darwin-386-cgo), const SYS_CSOPS = 169 +pkg syscall (darwin-386-cgo), const SYS_DELETE = 226 +pkg syscall (darwin-386-cgo), const SYS_DUP = 41 +pkg syscall (darwin-386-cgo), const SYS_DUP2 = 90 +pkg syscall (darwin-386-cgo), const SYS_EXCHANGEDATA = 223 +pkg syscall (darwin-386-cgo), const SYS_EXECVE = 59 +pkg syscall (darwin-386-cgo), const SYS_EXIT = 1 +pkg syscall (darwin-386-cgo), const SYS_FCHDIR = 13 +pkg syscall (darwin-386-cgo), const SYS_FCHFLAGS = 35 +pkg syscall (darwin-386-cgo), const SYS_FCHMOD = 124 +pkg syscall (darwin-386-cgo), const SYS_FCHMOD_EXTENDED = 283 +pkg syscall (darwin-386-cgo), const SYS_FCHOWN = 123 +pkg syscall (darwin-386-cgo), const SYS_FCNTL = 92 +pkg syscall (darwin-386-cgo), const SYS_FCNTL_NOCANCEL = 406 +pkg syscall (darwin-386-cgo), const SYS_FDATASYNC = 187 +pkg syscall (darwin-386-cgo), const SYS_FFSCTL = 245 +pkg syscall (darwin-386-cgo), const SYS_FGETATTRLIST = 228 +pkg syscall (darwin-386-cgo), const SYS_FGETXATTR = 235 +pkg syscall (darwin-386-cgo), const SYS_FHOPEN = 248 +pkg syscall (darwin-386-cgo), const SYS_FILEPORT_MAKEFD = 431 +pkg syscall (darwin-386-cgo), const SYS_FILEPORT_MAKEPORT = 430 +pkg syscall (darwin-386-cgo), const SYS_FLISTXATTR = 241 +pkg syscall (darwin-386-cgo), const SYS_FLOCK = 131 +pkg syscall (darwin-386-cgo), const SYS_FORK = 2 +pkg syscall (darwin-386-cgo), const SYS_FPATHCONF = 192 +pkg syscall (darwin-386-cgo), const SYS_FREMOVEXATTR = 239 +pkg syscall (darwin-386-cgo), const SYS_FSCTL = 242 +pkg syscall (darwin-386-cgo), const SYS_FSETATTRLIST = 229 +pkg syscall (darwin-386-cgo), const SYS_FSETXATTR = 237 +pkg syscall (darwin-386-cgo), const SYS_FSGETPATH = 427 +pkg syscall (darwin-386-cgo), const SYS_FSTAT = 189 +pkg syscall (darwin-386-cgo), const SYS_FSTAT64 = 339 +pkg syscall (darwin-386-cgo), const SYS_FSTAT64_EXTENDED = 343 +pkg syscall (darwin-386-cgo), const SYS_FSTATFS = 158 +pkg syscall (darwin-386-cgo), const SYS_FSTATFS64 = 346 +pkg syscall (darwin-386-cgo), const SYS_FSTATV = 219 +pkg syscall (darwin-386-cgo), const SYS_FSTAT_EXTENDED = 281 +pkg syscall (darwin-386-cgo), const SYS_FSYNC = 95 +pkg syscall (darwin-386-cgo), const SYS_FSYNC_NOCANCEL = 408 +pkg syscall (darwin-386-cgo), const SYS_FTRUNCATE = 201 +pkg syscall (darwin-386-cgo), const SYS_FUTIMES = 139 +pkg syscall (darwin-386-cgo), const SYS_GETATTRLIST = 220 +pkg syscall (darwin-386-cgo), const SYS_GETAUDIT = 355 +pkg syscall (darwin-386-cgo), const SYS_GETAUDIT_ADDR = 357 +pkg syscall (darwin-386-cgo), const SYS_GETAUID = 353 +pkg syscall (darwin-386-cgo), const SYS_GETDIRENTRIES = 196 +pkg syscall (darwin-386-cgo), const SYS_GETDIRENTRIES64 = 344 +pkg syscall (darwin-386-cgo), const SYS_GETDIRENTRIESATTR = 222 +pkg syscall (darwin-386-cgo), const SYS_GETDTABLESIZE = 89 +pkg syscall (darwin-386-cgo), const SYS_GETEGID = 43 +pkg syscall (darwin-386-cgo), const SYS_GETEUID = 25 +pkg syscall (darwin-386-cgo), const SYS_GETFH = 161 +pkg syscall (darwin-386-cgo), const SYS_GETFSSTAT = 18 +pkg syscall (darwin-386-cgo), const SYS_GETFSSTAT64 = 347 +pkg syscall (darwin-386-cgo), const SYS_GETGID = 47 +pkg syscall (darwin-386-cgo), const SYS_GETGROUPS = 79 +pkg syscall (darwin-386-cgo), const SYS_GETHOSTUUID = 142 +pkg syscall (darwin-386-cgo), const SYS_GETITIMER = 86 +pkg syscall (darwin-386-cgo), const SYS_GETLCID = 395 +pkg syscall (darwin-386-cgo), const SYS_GETLOGIN = 49 +pkg syscall (darwin-386-cgo), const SYS_GETPEERNAME = 31 +pkg syscall (darwin-386-cgo), const SYS_GETPGID = 151 +pkg syscall (darwin-386-cgo), const SYS_GETPGRP = 81 +pkg syscall (darwin-386-cgo), const SYS_GETPID = 20 +pkg syscall (darwin-386-cgo), const SYS_GETPPID = 39 +pkg syscall (darwin-386-cgo), const SYS_GETPRIORITY = 100 +pkg syscall (darwin-386-cgo), const SYS_GETRLIMIT = 194 +pkg syscall (darwin-386-cgo), const SYS_GETRUSAGE = 117 +pkg syscall (darwin-386-cgo), const SYS_GETSGROUPS = 288 +pkg syscall (darwin-386-cgo), const SYS_GETSID = 310 +pkg syscall (darwin-386-cgo), const SYS_GETSOCKNAME = 32 +pkg syscall (darwin-386-cgo), const SYS_GETSOCKOPT = 118 +pkg syscall (darwin-386-cgo), const SYS_GETTID = 286 +pkg syscall (darwin-386-cgo), const SYS_GETTIMEOFDAY = 116 +pkg syscall (darwin-386-cgo), const SYS_GETUID = 24 +pkg syscall (darwin-386-cgo), const SYS_GETWGROUPS = 290 +pkg syscall (darwin-386-cgo), const SYS_GETXATTR = 234 +pkg syscall (darwin-386-cgo), const SYS_IDENTITYSVC = 293 +pkg syscall (darwin-386-cgo), const SYS_INITGROUPS = 243 +pkg syscall (darwin-386-cgo), const SYS_IOCTL = 54 +pkg syscall (darwin-386-cgo), const SYS_IOPOLICYSYS = 322 +pkg syscall (darwin-386-cgo), const SYS_ISSETUGID = 327 +pkg syscall (darwin-386-cgo), const SYS_KDEBUG_TRACE = 180 +pkg syscall (darwin-386-cgo), const SYS_KEVENT = 363 +pkg syscall (darwin-386-cgo), const SYS_KEVENT64 = 369 +pkg syscall (darwin-386-cgo), const SYS_KILL = 37 +pkg syscall (darwin-386-cgo), const SYS_KQUEUE = 362 +pkg syscall (darwin-386-cgo), const SYS_LCHOWN = 364 +pkg syscall (darwin-386-cgo), const SYS_LINK = 9 +pkg syscall (darwin-386-cgo), const SYS_LIO_LISTIO = 320 +pkg syscall (darwin-386-cgo), const SYS_LISTEN = 106 +pkg syscall (darwin-386-cgo), const SYS_LISTXATTR = 240 +pkg syscall (darwin-386-cgo), const SYS_LSEEK = 199 +pkg syscall (darwin-386-cgo), const SYS_LSTAT = 190 +pkg syscall (darwin-386-cgo), const SYS_LSTAT64 = 340 +pkg syscall (darwin-386-cgo), const SYS_LSTAT64_EXTENDED = 342 +pkg syscall (darwin-386-cgo), const SYS_LSTATV = 218 +pkg syscall (darwin-386-cgo), const SYS_LSTAT_EXTENDED = 280 +pkg syscall (darwin-386-cgo), const SYS_MADVISE = 75 +pkg syscall (darwin-386-cgo), const SYS_MAXSYSCALL = 439 +pkg syscall (darwin-386-cgo), const SYS_MINCORE = 78 +pkg syscall (darwin-386-cgo), const SYS_MINHERIT = 250 +pkg syscall (darwin-386-cgo), const SYS_MKCOMPLEX = 216 +pkg syscall (darwin-386-cgo), const SYS_MKDIR = 136 +pkg syscall (darwin-386-cgo), const SYS_MKDIR_EXTENDED = 292 +pkg syscall (darwin-386-cgo), const SYS_MKFIFO = 132 +pkg syscall (darwin-386-cgo), const SYS_MKFIFO_EXTENDED = 291 +pkg syscall (darwin-386-cgo), const SYS_MKNOD = 14 +pkg syscall (darwin-386-cgo), const SYS_MLOCK = 203 +pkg syscall (darwin-386-cgo), const SYS_MLOCKALL = 324 +pkg syscall (darwin-386-cgo), const SYS_MMAP = 197 +pkg syscall (darwin-386-cgo), const SYS_MODWATCH = 233 +pkg syscall (darwin-386-cgo), const SYS_MOUNT = 167 +pkg syscall (darwin-386-cgo), const SYS_MPROTECT = 74 +pkg syscall (darwin-386-cgo), const SYS_MSGCTL = 258 +pkg syscall (darwin-386-cgo), const SYS_MSGGET = 259 +pkg syscall (darwin-386-cgo), const SYS_MSGRCV = 261 +pkg syscall (darwin-386-cgo), const SYS_MSGRCV_NOCANCEL = 419 +pkg syscall (darwin-386-cgo), const SYS_MSGSND = 260 +pkg syscall (darwin-386-cgo), const SYS_MSGSND_NOCANCEL = 418 +pkg syscall (darwin-386-cgo), const SYS_MSGSYS = 252 +pkg syscall (darwin-386-cgo), const SYS_MSYNC = 65 +pkg syscall (darwin-386-cgo), const SYS_MSYNC_NOCANCEL = 405 +pkg syscall (darwin-386-cgo), const SYS_MUNLOCK = 204 +pkg syscall (darwin-386-cgo), const SYS_MUNLOCKALL = 325 +pkg syscall (darwin-386-cgo), const SYS_MUNMAP = 73 +pkg syscall (darwin-386-cgo), const SYS_NFSCLNT = 247 +pkg syscall (darwin-386-cgo), const SYS_NFSSVC = 155 +pkg syscall (darwin-386-cgo), const SYS_OPEN = 5 +pkg syscall (darwin-386-cgo), const SYS_OPEN_EXTENDED = 277 +pkg syscall (darwin-386-cgo), const SYS_OPEN_NOCANCEL = 398 +pkg syscall (darwin-386-cgo), const SYS_PATHCONF = 191 +pkg syscall (darwin-386-cgo), const SYS_PID_HIBERNATE = 435 +pkg syscall (darwin-386-cgo), const SYS_PID_RESUME = 434 +pkg syscall (darwin-386-cgo), const SYS_PID_SHUTDOWN_SOCKETS = 436 +pkg syscall (darwin-386-cgo), const SYS_PID_SUSPEND = 433 +pkg syscall (darwin-386-cgo), const SYS_PIPE = 42 +pkg syscall (darwin-386-cgo), const SYS_POLL = 230 +pkg syscall (darwin-386-cgo), const SYS_POLL_NOCANCEL = 417 +pkg syscall (darwin-386-cgo), const SYS_POSIX_SPAWN = 244 +pkg syscall (darwin-386-cgo), const SYS_PREAD = 153 +pkg syscall (darwin-386-cgo), const SYS_PREAD_NOCANCEL = 414 +pkg syscall (darwin-386-cgo), const SYS_PROCESS_POLICY = 323 +pkg syscall (darwin-386-cgo), const SYS_PROC_INFO = 336 +pkg syscall (darwin-386-cgo), const SYS_PROFIL = 44 +pkg syscall (darwin-386-cgo), const SYS_PSYNCH_CVBROAD = 303 +pkg syscall (darwin-386-cgo), const SYS_PSYNCH_CVCLRPREPOST = 312 +pkg syscall (darwin-386-cgo), const SYS_PSYNCH_CVSIGNAL = 304 +pkg syscall (darwin-386-cgo), const SYS_PSYNCH_CVWAIT = 305 +pkg syscall (darwin-386-cgo), const SYS_PSYNCH_MUTEXDROP = 302 +pkg syscall (darwin-386-cgo), const SYS_PSYNCH_MUTEXWAIT = 301 +pkg syscall (darwin-386-cgo), const SYS_PSYNCH_RW_DOWNGRADE = 299 +pkg syscall (darwin-386-cgo), const SYS_PSYNCH_RW_LONGRDLOCK = 297 +pkg syscall (darwin-386-cgo), const SYS_PSYNCH_RW_RDLOCK = 306 +pkg syscall (darwin-386-cgo), const SYS_PSYNCH_RW_UNLOCK = 308 +pkg syscall (darwin-386-cgo), const SYS_PSYNCH_RW_UNLOCK2 = 309 +pkg syscall (darwin-386-cgo), const SYS_PSYNCH_RW_UPGRADE = 300 +pkg syscall (darwin-386-cgo), const SYS_PSYNCH_RW_WRLOCK = 307 +pkg syscall (darwin-386-cgo), const SYS_PSYNCH_RW_YIELDWRLOCK = 298 +pkg syscall (darwin-386-cgo), const SYS_PTRACE = 26 +pkg syscall (darwin-386-cgo), const SYS_PWRITE = 154 +pkg syscall (darwin-386-cgo), const SYS_PWRITE_NOCANCEL = 415 +pkg syscall (darwin-386-cgo), const SYS_QUOTACTL = 165 +pkg syscall (darwin-386-cgo), const SYS_READ = 3 +pkg syscall (darwin-386-cgo), const SYS_READLINK = 58 +pkg syscall (darwin-386-cgo), const SYS_READV = 120 +pkg syscall (darwin-386-cgo), const SYS_READV_NOCANCEL = 411 +pkg syscall (darwin-386-cgo), const SYS_READ_NOCANCEL = 396 +pkg syscall (darwin-386-cgo), const SYS_REBOOT = 55 +pkg syscall (darwin-386-cgo), const SYS_RECVFROM = 29 +pkg syscall (darwin-386-cgo), const SYS_RECVFROM_NOCANCEL = 403 +pkg syscall (darwin-386-cgo), const SYS_RECVMSG = 27 +pkg syscall (darwin-386-cgo), const SYS_RECVMSG_NOCANCEL = 401 +pkg syscall (darwin-386-cgo), const SYS_REMOVEXATTR = 238 +pkg syscall (darwin-386-cgo), const SYS_RENAME = 128 +pkg syscall (darwin-386-cgo), const SYS_REVOKE = 56 +pkg syscall (darwin-386-cgo), const SYS_RMDIR = 137 +pkg syscall (darwin-386-cgo), const SYS_SEARCHFS = 225 +pkg syscall (darwin-386-cgo), const SYS_SELECT = 93 +pkg syscall (darwin-386-cgo), const SYS_SELECT_NOCANCEL = 407 +pkg syscall (darwin-386-cgo), const SYS_SEMCTL = 254 +pkg syscall (darwin-386-cgo), const SYS_SEMGET = 255 +pkg syscall (darwin-386-cgo), const SYS_SEMOP = 256 +pkg syscall (darwin-386-cgo), const SYS_SEMSYS = 251 +pkg syscall (darwin-386-cgo), const SYS_SEM_CLOSE = 269 +pkg syscall (darwin-386-cgo), const SYS_SEM_DESTROY = 276 +pkg syscall (darwin-386-cgo), const SYS_SEM_GETVALUE = 274 +pkg syscall (darwin-386-cgo), const SYS_SEM_INIT = 275 +pkg syscall (darwin-386-cgo), const SYS_SEM_OPEN = 268 +pkg syscall (darwin-386-cgo), const SYS_SEM_POST = 273 +pkg syscall (darwin-386-cgo), const SYS_SEM_TRYWAIT = 272 +pkg syscall (darwin-386-cgo), const SYS_SEM_UNLINK = 270 +pkg syscall (darwin-386-cgo), const SYS_SEM_WAIT = 271 +pkg syscall (darwin-386-cgo), const SYS_SEM_WAIT_NOCANCEL = 420 +pkg syscall (darwin-386-cgo), const SYS_SENDFILE = 337 +pkg syscall (darwin-386-cgo), const SYS_SENDMSG = 28 +pkg syscall (darwin-386-cgo), const SYS_SENDMSG_NOCANCEL = 402 +pkg syscall (darwin-386-cgo), const SYS_SENDTO = 133 +pkg syscall (darwin-386-cgo), const SYS_SENDTO_NOCANCEL = 413 +pkg syscall (darwin-386-cgo), const SYS_SETATTRLIST = 221 +pkg syscall (darwin-386-cgo), const SYS_SETAUDIT = 356 +pkg syscall (darwin-386-cgo), const SYS_SETAUDIT_ADDR = 358 +pkg syscall (darwin-386-cgo), const SYS_SETAUID = 354 +pkg syscall (darwin-386-cgo), const SYS_SETEGID = 182 +pkg syscall (darwin-386-cgo), const SYS_SETEUID = 183 +pkg syscall (darwin-386-cgo), const SYS_SETGID = 181 +pkg syscall (darwin-386-cgo), const SYS_SETGROUPS = 80 +pkg syscall (darwin-386-cgo), const SYS_SETITIMER = 83 +pkg syscall (darwin-386-cgo), const SYS_SETLCID = 394 +pkg syscall (darwin-386-cgo), const SYS_SETLOGIN = 50 +pkg syscall (darwin-386-cgo), const SYS_SETPGID = 82 +pkg syscall (darwin-386-cgo), const SYS_SETPRIORITY = 96 +pkg syscall (darwin-386-cgo), const SYS_SETPRIVEXEC = 152 +pkg syscall (darwin-386-cgo), const SYS_SETREGID = 127 +pkg syscall (darwin-386-cgo), const SYS_SETREUID = 126 +pkg syscall (darwin-386-cgo), const SYS_SETRLIMIT = 195 +pkg syscall (darwin-386-cgo), const SYS_SETSGROUPS = 287 +pkg syscall (darwin-386-cgo), const SYS_SETSID = 147 +pkg syscall (darwin-386-cgo), const SYS_SETSOCKOPT = 105 +pkg syscall (darwin-386-cgo), const SYS_SETTID = 285 +pkg syscall (darwin-386-cgo), const SYS_SETTID_WITH_PID = 311 +pkg syscall (darwin-386-cgo), const SYS_SETTIMEOFDAY = 122 +pkg syscall (darwin-386-cgo), const SYS_SETUID = 23 +pkg syscall (darwin-386-cgo), const SYS_SETWGROUPS = 289 +pkg syscall (darwin-386-cgo), const SYS_SETXATTR = 236 +pkg syscall (darwin-386-cgo), const SYS_SHARED_REGION_CHECK_NP = 294 +pkg syscall (darwin-386-cgo), const SYS_SHARED_REGION_MAP_AND_SLIDE_NP = 438 +pkg syscall (darwin-386-cgo), const SYS_SHMAT = 262 +pkg syscall (darwin-386-cgo), const SYS_SHMCTL = 263 +pkg syscall (darwin-386-cgo), const SYS_SHMDT = 264 +pkg syscall (darwin-386-cgo), const SYS_SHMGET = 265 +pkg syscall (darwin-386-cgo), const SYS_SHMSYS = 253 +pkg syscall (darwin-386-cgo), const SYS_SHM_OPEN = 266 +pkg syscall (darwin-386-cgo), const SYS_SHM_UNLINK = 267 +pkg syscall (darwin-386-cgo), const SYS_SHUTDOWN = 134 +pkg syscall (darwin-386-cgo), const SYS_SIGACTION = 46 +pkg syscall (darwin-386-cgo), const SYS_SIGALTSTACK = 53 +pkg syscall (darwin-386-cgo), const SYS_SIGPENDING = 52 +pkg syscall (darwin-386-cgo), const SYS_SIGPROCMASK = 48 +pkg syscall (darwin-386-cgo), const SYS_SIGRETURN = 184 +pkg syscall (darwin-386-cgo), const SYS_SIGSUSPEND = 111 +pkg syscall (darwin-386-cgo), const SYS_SIGSUSPEND_NOCANCEL = 410 +pkg syscall (darwin-386-cgo), const SYS_SOCKET = 97 +pkg syscall (darwin-386-cgo), const SYS_SOCKETPAIR = 135 +pkg syscall (darwin-386-cgo), const SYS_STACK_SNAPSHOT = 365 +pkg syscall (darwin-386-cgo), const SYS_STAT = 188 +pkg syscall (darwin-386-cgo), const SYS_STAT64 = 338 +pkg syscall (darwin-386-cgo), const SYS_STAT64_EXTENDED = 341 +pkg syscall (darwin-386-cgo), const SYS_STATFS = 157 +pkg syscall (darwin-386-cgo), const SYS_STATFS64 = 345 +pkg syscall (darwin-386-cgo), const SYS_STATV = 217 +pkg syscall (darwin-386-cgo), const SYS_STAT_EXTENDED = 279 +pkg syscall (darwin-386-cgo), const SYS_SWAPON = 85 +pkg syscall (darwin-386-cgo), const SYS_SYMLINK = 57 +pkg syscall (darwin-386-cgo), const SYS_SYNC = 36 +pkg syscall (darwin-386-cgo), const SYS_SYSCALL = 0 +pkg syscall (darwin-386-cgo), const SYS_THREAD_SELFID = 372 +pkg syscall (darwin-386-cgo), const SYS_TRUNCATE = 200 +pkg syscall (darwin-386-cgo), const SYS_UMASK = 60 +pkg syscall (darwin-386-cgo), const SYS_UMASK_EXTENDED = 278 +pkg syscall (darwin-386-cgo), const SYS_UNDELETE = 205 +pkg syscall (darwin-386-cgo), const SYS_UNLINK = 10 +pkg syscall (darwin-386-cgo), const SYS_UNMOUNT = 159 +pkg syscall (darwin-386-cgo), const SYS_UTIMES = 138 +pkg syscall (darwin-386-cgo), const SYS_VFORK = 66 +pkg syscall (darwin-386-cgo), const SYS_VM_PRESSURE_MONITOR = 296 +pkg syscall (darwin-386-cgo), const SYS_WAIT4 = 7 +pkg syscall (darwin-386-cgo), const SYS_WAIT4_NOCANCEL = 400 +pkg syscall (darwin-386-cgo), const SYS_WAITEVENT = 232 +pkg syscall (darwin-386-cgo), const SYS_WAITID = 173 +pkg syscall (darwin-386-cgo), const SYS_WAITID_NOCANCEL = 416 +pkg syscall (darwin-386-cgo), const SYS_WATCHEVENT = 231 +pkg syscall (darwin-386-cgo), const SYS_WORKQ_KERNRETURN = 368 +pkg syscall (darwin-386-cgo), const SYS_WORKQ_OPEN = 367 +pkg syscall (darwin-386-cgo), const SYS_WRITE = 4 +pkg syscall (darwin-386-cgo), const SYS_WRITEV = 121 +pkg syscall (darwin-386-cgo), const SYS_WRITEV_NOCANCEL = 412 +pkg syscall (darwin-386-cgo), const SYS_WRITE_NOCANCEL = 397 +pkg syscall (darwin-386-cgo), const SYS___DISABLE_THREADSIGNAL = 331 +pkg syscall (darwin-386-cgo), const SYS___MAC_EXECVE = 380 +pkg syscall (darwin-386-cgo), const SYS___MAC_GETFSSTAT = 426 +pkg syscall (darwin-386-cgo), const SYS___MAC_GET_FD = 388 +pkg syscall (darwin-386-cgo), const SYS___MAC_GET_FILE = 382 +pkg syscall (darwin-386-cgo), const SYS___MAC_GET_LCID = 391 +pkg syscall (darwin-386-cgo), const SYS___MAC_GET_LCTX = 392 +pkg syscall (darwin-386-cgo), const SYS___MAC_GET_LINK = 384 +pkg syscall (darwin-386-cgo), const SYS___MAC_GET_MOUNT = 425 +pkg syscall (darwin-386-cgo), const SYS___MAC_GET_PID = 390 +pkg syscall (darwin-386-cgo), const SYS___MAC_GET_PROC = 386 +pkg syscall (darwin-386-cgo), const SYS___MAC_MOUNT = 424 +pkg syscall (darwin-386-cgo), const SYS___MAC_SET_FD = 389 +pkg syscall (darwin-386-cgo), const SYS___MAC_SET_FILE = 383 +pkg syscall (darwin-386-cgo), const SYS___MAC_SET_LCTX = 393 +pkg syscall (darwin-386-cgo), const SYS___MAC_SET_LINK = 385 +pkg syscall (darwin-386-cgo), const SYS___MAC_SET_PROC = 387 +pkg syscall (darwin-386-cgo), const SYS___MAC_SYSCALL = 381 +pkg syscall (darwin-386-cgo), const SYS___OLD_SEMWAIT_SIGNAL = 370 +pkg syscall (darwin-386-cgo), const SYS___OLD_SEMWAIT_SIGNAL_NOCANCEL = 371 +pkg syscall (darwin-386-cgo), const SYS___PTHREAD_CANCELED = 333 +pkg syscall (darwin-386-cgo), const SYS___PTHREAD_CHDIR = 348 +pkg syscall (darwin-386-cgo), const SYS___PTHREAD_FCHDIR = 349 +pkg syscall (darwin-386-cgo), const SYS___PTHREAD_KILL = 328 +pkg syscall (darwin-386-cgo), const SYS___PTHREAD_MARKCANCEL = 332 +pkg syscall (darwin-386-cgo), const SYS___PTHREAD_SIGMASK = 329 +pkg syscall (darwin-386-cgo), const SYS___SEMWAIT_SIGNAL = 334 +pkg syscall (darwin-386-cgo), const SYS___SEMWAIT_SIGNAL_NOCANCEL = 423 +pkg syscall (darwin-386-cgo), const SYS___SIGWAIT = 330 +pkg syscall (darwin-386-cgo), const SYS___SIGWAIT_NOCANCEL = 422 +pkg syscall (darwin-386-cgo), const SYS___SYSCTL = 202 +pkg syscall (darwin-386-cgo), const S_IEXEC = 64 +pkg syscall (darwin-386-cgo), const S_IFMT = 61440 +pkg syscall (darwin-386-cgo), const S_IFWHT = 57344 +pkg syscall (darwin-386-cgo), const S_IREAD = 256 +pkg syscall (darwin-386-cgo), const S_IRGRP = 32 +pkg syscall (darwin-386-cgo), const S_IROTH = 4 +pkg syscall (darwin-386-cgo), const S_IRWXG = 56 +pkg syscall (darwin-386-cgo), const S_IRWXO = 7 +pkg syscall (darwin-386-cgo), const S_IRWXU = 448 +pkg syscall (darwin-386-cgo), const S_ISTXT = 512 +pkg syscall (darwin-386-cgo), const S_IWGRP = 16 +pkg syscall (darwin-386-cgo), const S_IWOTH = 2 +pkg syscall (darwin-386-cgo), const S_IWRITE = 128 +pkg syscall (darwin-386-cgo), const S_IXGRP = 8 +pkg syscall (darwin-386-cgo), const S_IXOTH = 1 +pkg syscall (darwin-386-cgo), const SizeofBpfHdr = 20 +pkg syscall (darwin-386-cgo), const SizeofBpfInsn = 8 +pkg syscall (darwin-386-cgo), const SizeofBpfProgram = 8 +pkg syscall (darwin-386-cgo), const SizeofBpfStat = 8 +pkg syscall (darwin-386-cgo), const SizeofBpfVersion = 4 +pkg syscall (darwin-386-cgo), const SizeofCmsghdr = 12 +pkg syscall (darwin-386-cgo), const SizeofIPMreq = 8 +pkg syscall (darwin-386-cgo), const SizeofIPv6Mreq = 20 +pkg syscall (darwin-386-cgo), const SizeofIfData = 96 +pkg syscall (darwin-386-cgo), const SizeofIfMsghdr = 112 +pkg syscall (darwin-386-cgo), const SizeofIfaMsghdr = 20 +pkg syscall (darwin-386-cgo), const SizeofIfmaMsghdr = 16 +pkg syscall (darwin-386-cgo), const SizeofIfmaMsghdr2 = 20 +pkg syscall (darwin-386-cgo), const SizeofInet4Pktinfo = 12 +pkg syscall (darwin-386-cgo), const SizeofInet4Pktinfo ideal-int +pkg syscall (darwin-386-cgo), const SizeofInet6Pktinfo = 20 +pkg syscall (darwin-386-cgo), const SizeofLinger = 8 +pkg syscall (darwin-386-cgo), const SizeofMsghdr = 28 +pkg syscall (darwin-386-cgo), const SizeofRtMetrics = 56 +pkg syscall (darwin-386-cgo), const SizeofRtMsghdr = 92 +pkg syscall (darwin-386-cgo), const SizeofSockaddrAny = 108 +pkg syscall (darwin-386-cgo), const SizeofSockaddrDatalink = 20 +pkg syscall (darwin-386-cgo), const SizeofSockaddrInet4 = 16 +pkg syscall (darwin-386-cgo), const SizeofSockaddrInet6 = 28 +pkg syscall (darwin-386-cgo), const SizeofSockaddrUnix = 106 +pkg syscall (darwin-386-cgo), const TCIFLUSH = 1 +pkg syscall (darwin-386-cgo), const TCIFLUSH ideal-int +pkg syscall (darwin-386-cgo), const TCIOFLUSH = 3 +pkg syscall (darwin-386-cgo), const TCIOFLUSH ideal-int +pkg syscall (darwin-386-cgo), const TCOFLUSH = 2 +pkg syscall (darwin-386-cgo), const TCOFLUSH ideal-int +pkg syscall (darwin-386-cgo), const TCP_CONNECTIONTIMEOUT = 32 +pkg syscall (darwin-386-cgo), const TCP_KEEPALIVE = 16 +pkg syscall (darwin-386-cgo), const TCP_MAXHLEN = 60 +pkg syscall (darwin-386-cgo), const TCP_MAXOLEN = 40 +pkg syscall (darwin-386-cgo), const TCP_MAXSEG = 2 +pkg syscall (darwin-386-cgo), const TCP_MAXWIN = 65535 +pkg syscall (darwin-386-cgo), const TCP_MAX_SACK = 3 +pkg syscall (darwin-386-cgo), const TCP_MAX_WINSHIFT = 14 +pkg syscall (darwin-386-cgo), const TCP_MINMSS = 216 +pkg syscall (darwin-386-cgo), const TCP_MINMSSOVERLOAD = 1000 +pkg syscall (darwin-386-cgo), const TCP_MSS = 512 +pkg syscall (darwin-386-cgo), const TCP_NOOPT = 8 +pkg syscall (darwin-386-cgo), const TCP_NOPUSH = 4 +pkg syscall (darwin-386-cgo), const TCP_RXT_CONNDROPTIME = 128 +pkg syscall (darwin-386-cgo), const TCP_RXT_FINDROP = 256 +pkg syscall (darwin-386-cgo), const TCSAFLUSH = 2 +pkg syscall (darwin-386-cgo), const TCSAFLUSH ideal-int +pkg syscall (darwin-386-cgo), const TIOCCBRK = 536900730 +pkg syscall (darwin-386-cgo), const TIOCCDTR = 536900728 +pkg syscall (darwin-386-cgo), const TIOCCONS = 2147775586 +pkg syscall (darwin-386-cgo), const TIOCDCDTIMESTAMP = 1074295896 +pkg syscall (darwin-386-cgo), const TIOCDRAIN = 536900702 +pkg syscall (darwin-386-cgo), const TIOCDSIMICROCODE = 536900693 +pkg syscall (darwin-386-cgo), const TIOCEXCL = 536900621 +pkg syscall (darwin-386-cgo), const TIOCEXT = 2147775584 +pkg syscall (darwin-386-cgo), const TIOCFLUSH = 2147775504 +pkg syscall (darwin-386-cgo), const TIOCGDRAINWAIT = 1074033750 +pkg syscall (darwin-386-cgo), const TIOCGETA = 1076655123 +pkg syscall (darwin-386-cgo), const TIOCGETD = 1074033690 +pkg syscall (darwin-386-cgo), const TIOCGPGRP = 1074033783 +pkg syscall (darwin-386-cgo), const TIOCGWINSZ = 1074295912 +pkg syscall (darwin-386-cgo), const TIOCIXOFF = 536900736 +pkg syscall (darwin-386-cgo), const TIOCIXON = 536900737 +pkg syscall (darwin-386-cgo), const TIOCMBIC = 2147775595 +pkg syscall (darwin-386-cgo), const TIOCMBIS = 2147775596 +pkg syscall (darwin-386-cgo), const TIOCMGDTRWAIT = 1074033754 +pkg syscall (darwin-386-cgo), const TIOCMGET = 1074033770 +pkg syscall (darwin-386-cgo), const TIOCMODG = 1074033667 +pkg syscall (darwin-386-cgo), const TIOCMODS = 2147775492 +pkg syscall (darwin-386-cgo), const TIOCMSDTRWAIT = 2147775579 +pkg syscall (darwin-386-cgo), const TIOCMSET = 2147775597 +pkg syscall (darwin-386-cgo), const TIOCM_CAR = 64 +pkg syscall (darwin-386-cgo), const TIOCM_CD = 64 +pkg syscall (darwin-386-cgo), const TIOCM_CTS = 32 +pkg syscall (darwin-386-cgo), const TIOCM_DSR = 256 +pkg syscall (darwin-386-cgo), const TIOCM_DTR = 2 +pkg syscall (darwin-386-cgo), const TIOCM_LE = 1 +pkg syscall (darwin-386-cgo), const TIOCM_RI = 128 +pkg syscall (darwin-386-cgo), const TIOCM_RNG = 128 +pkg syscall (darwin-386-cgo), const TIOCM_RTS = 4 +pkg syscall (darwin-386-cgo), const TIOCM_SR = 16 +pkg syscall (darwin-386-cgo), const TIOCM_ST = 8 +pkg syscall (darwin-386-cgo), const TIOCNOTTY = 536900721 +pkg syscall (darwin-386-cgo), const TIOCNXCL = 536900622 +pkg syscall (darwin-386-cgo), const TIOCOUTQ = 1074033779 +pkg syscall (darwin-386-cgo), const TIOCPKT = 2147775600 +pkg syscall (darwin-386-cgo), const TIOCPKT_DATA = 0 +pkg syscall (darwin-386-cgo), const TIOCPKT_DOSTOP = 32 +pkg syscall (darwin-386-cgo), const TIOCPKT_FLUSHREAD = 1 +pkg syscall (darwin-386-cgo), const TIOCPKT_FLUSHWRITE = 2 +pkg syscall (darwin-386-cgo), const TIOCPKT_IOCTL = 64 +pkg syscall (darwin-386-cgo), const TIOCPKT_NOSTOP = 16 +pkg syscall (darwin-386-cgo), const TIOCPKT_START = 8 +pkg syscall (darwin-386-cgo), const TIOCPKT_STOP = 4 +pkg syscall (darwin-386-cgo), const TIOCPTYGNAME = 1082160211 +pkg syscall (darwin-386-cgo), const TIOCPTYGRANT = 536900692 +pkg syscall (darwin-386-cgo), const TIOCPTYUNLK = 536900690 +pkg syscall (darwin-386-cgo), const TIOCREMOTE = 2147775593 +pkg syscall (darwin-386-cgo), const TIOCSBRK = 536900731 +pkg syscall (darwin-386-cgo), const TIOCSCONS = 536900707 +pkg syscall (darwin-386-cgo), const TIOCSCTTY = 536900705 +pkg syscall (darwin-386-cgo), const TIOCSDRAINWAIT = 2147775575 +pkg syscall (darwin-386-cgo), const TIOCSDTR = 536900729 +pkg syscall (darwin-386-cgo), const TIOCSETA = 2150396948 +pkg syscall (darwin-386-cgo), const TIOCSETAF = 2150396950 +pkg syscall (darwin-386-cgo), const TIOCSETAW = 2150396949 +pkg syscall (darwin-386-cgo), const TIOCSETD = 2147775515 +pkg syscall (darwin-386-cgo), const TIOCSIG = 536900703 +pkg syscall (darwin-386-cgo), const TIOCSPGRP = 2147775606 +pkg syscall (darwin-386-cgo), const TIOCSTART = 536900718 +pkg syscall (darwin-386-cgo), const TIOCSTAT = 536900709 +pkg syscall (darwin-386-cgo), const TIOCSTI = 2147578994 +pkg syscall (darwin-386-cgo), const TIOCSTOP = 536900719 +pkg syscall (darwin-386-cgo), const TIOCSWINSZ = 2148037735 +pkg syscall (darwin-386-cgo), const TIOCTIMESTAMP = 1074295897 +pkg syscall (darwin-386-cgo), const TIOCUCNTL = 2147775590 +pkg syscall (darwin-386-cgo), const TOSTOP = 4194304 +pkg syscall (darwin-386-cgo), const TOSTOP ideal-int +pkg syscall (darwin-386-cgo), const VDISCARD = 15 +pkg syscall (darwin-386-cgo), const VDISCARD ideal-int +pkg syscall (darwin-386-cgo), const VDSUSP = 11 +pkg syscall (darwin-386-cgo), const VDSUSP ideal-int +pkg syscall (darwin-386-cgo), const VEOF = 0 +pkg syscall (darwin-386-cgo), const VEOF ideal-int +pkg syscall (darwin-386-cgo), const VEOL = 1 +pkg syscall (darwin-386-cgo), const VEOL ideal-int +pkg syscall (darwin-386-cgo), const VEOL2 = 2 +pkg syscall (darwin-386-cgo), const VEOL2 ideal-int +pkg syscall (darwin-386-cgo), const VERASE = 3 +pkg syscall (darwin-386-cgo), const VERASE ideal-int +pkg syscall (darwin-386-cgo), const VINTR = 8 +pkg syscall (darwin-386-cgo), const VINTR ideal-int +pkg syscall (darwin-386-cgo), const VKILL = 5 +pkg syscall (darwin-386-cgo), const VKILL ideal-int +pkg syscall (darwin-386-cgo), const VLNEXT = 14 +pkg syscall (darwin-386-cgo), const VLNEXT ideal-int +pkg syscall (darwin-386-cgo), const VMIN = 16 +pkg syscall (darwin-386-cgo), const VMIN ideal-int +pkg syscall (darwin-386-cgo), const VQUIT = 9 +pkg syscall (darwin-386-cgo), const VQUIT ideal-int +pkg syscall (darwin-386-cgo), const VREPRINT = 6 +pkg syscall (darwin-386-cgo), const VREPRINT ideal-int +pkg syscall (darwin-386-cgo), const VSTART = 12 +pkg syscall (darwin-386-cgo), const VSTART ideal-int +pkg syscall (darwin-386-cgo), const VSTATUS = 18 +pkg syscall (darwin-386-cgo), const VSTATUS ideal-int +pkg syscall (darwin-386-cgo), const VSTOP = 13 +pkg syscall (darwin-386-cgo), const VSTOP ideal-int +pkg syscall (darwin-386-cgo), const VSUSP = 10 +pkg syscall (darwin-386-cgo), const VSUSP ideal-int +pkg syscall (darwin-386-cgo), const VT0 = 0 +pkg syscall (darwin-386-cgo), const VT0 ideal-int +pkg syscall (darwin-386-cgo), const VT1 = 65536 +pkg syscall (darwin-386-cgo), const VT1 ideal-int +pkg syscall (darwin-386-cgo), const VTDLY = 65536 +pkg syscall (darwin-386-cgo), const VTDLY ideal-int +pkg syscall (darwin-386-cgo), const VTIME = 17 +pkg syscall (darwin-386-cgo), const VTIME ideal-int +pkg syscall (darwin-386-cgo), const VWERASE = 4 +pkg syscall (darwin-386-cgo), const VWERASE ideal-int +pkg syscall (darwin-386-cgo), const WCONTINUED = 16 +pkg syscall (darwin-386-cgo), const WCOREFLAG = 128 +pkg syscall (darwin-386-cgo), const WEXITED = 4 +pkg syscall (darwin-386-cgo), const WNOHANG = 1 +pkg syscall (darwin-386-cgo), const WNOWAIT = 32 +pkg syscall (darwin-386-cgo), const WORDSIZE = 32 +pkg syscall (darwin-386-cgo), const WSTOPPED = 8 +pkg syscall (darwin-386-cgo), const WUNTRACED = 2 +pkg syscall (darwin-386-cgo), func Fchflags(int, int) error +pkg syscall (darwin-386-cgo), func SlicePtrFromStrings([]string) ([]*uint8, error) +pkg syscall (darwin-386-cgo), type Inet4Pktinfo struct +pkg syscall (darwin-386-cgo), type Inet4Pktinfo struct, Addr [4]uint8 +pkg syscall (darwin-386-cgo), type Inet4Pktinfo struct, Ifindex uint32 +pkg syscall (darwin-386-cgo), type Inet4Pktinfo struct, Spec_dst [4]uint8 +pkg syscall (darwin-386-cgo), type Termios struct +pkg syscall (darwin-386-cgo), type Termios struct, Cc [20]uint8 +pkg syscall (darwin-386-cgo), type Termios struct, Cflag uint32 +pkg syscall (darwin-386-cgo), type Termios struct, Iflag uint32 +pkg syscall (darwin-386-cgo), type Termios struct, Ispeed uint32 +pkg syscall (darwin-386-cgo), type Termios struct, Lflag uint32 +pkg syscall (darwin-386-cgo), type Termios struct, Oflag uint32 +pkg syscall (darwin-386-cgo), type Termios struct, Ospeed uint32 +pkg syscall (darwin-amd64), const AF_APPLETALK = 16 +pkg syscall (darwin-amd64), const AF_CCITT = 10 +pkg syscall (darwin-amd64), const AF_CHAOS = 5 +pkg syscall (darwin-amd64), const AF_CNT = 21 +pkg syscall (darwin-amd64), const AF_COIP = 20 +pkg syscall (darwin-amd64), const AF_DATAKIT = 9 +pkg syscall (darwin-amd64), const AF_DECnet = 12 +pkg syscall (darwin-amd64), const AF_DLI = 13 +pkg syscall (darwin-amd64), const AF_E164 = 28 +pkg syscall (darwin-amd64), const AF_ECMA = 8 +pkg syscall (darwin-amd64), const AF_HYLINK = 15 +pkg syscall (darwin-amd64), const AF_IEEE80211 = 37 +pkg syscall (darwin-amd64), const AF_IMPLINK = 3 +pkg syscall (darwin-amd64), const AF_INET6 = 30 +pkg syscall (darwin-amd64), const AF_IPX = 23 +pkg syscall (darwin-amd64), const AF_ISDN = 28 +pkg syscall (darwin-amd64), const AF_ISO = 7 +pkg syscall (darwin-amd64), const AF_LAT = 14 +pkg syscall (darwin-amd64), const AF_LINK = 18 +pkg syscall (darwin-amd64), const AF_LOCAL = 1 +pkg syscall (darwin-amd64), const AF_MAX = 38 +pkg syscall (darwin-amd64), const AF_NATM = 31 +pkg syscall (darwin-amd64), const AF_NDRV = 27 +pkg syscall (darwin-amd64), const AF_NETBIOS = 33 +pkg syscall (darwin-amd64), const AF_NS = 6 +pkg syscall (darwin-amd64), const AF_OSI = 7 +pkg syscall (darwin-amd64), const AF_PPP = 34 +pkg syscall (darwin-amd64), const AF_PUP = 4 +pkg syscall (darwin-amd64), const AF_RESERVED_36 = 36 +pkg syscall (darwin-amd64), const AF_ROUTE = 17 +pkg syscall (darwin-amd64), const AF_SIP = 24 +pkg syscall (darwin-amd64), const AF_SNA = 11 +pkg syscall (darwin-amd64), const AF_SYSTEM = 32 +pkg syscall (darwin-amd64), const B0 = 0 +pkg syscall (darwin-amd64), const B0 ideal-int +pkg syscall (darwin-amd64), const B110 = 110 +pkg syscall (darwin-amd64), const B110 ideal-int +pkg syscall (darwin-amd64), const B115200 = 115200 +pkg syscall (darwin-amd64), const B115200 ideal-int +pkg syscall (darwin-amd64), const B1200 = 1200 +pkg syscall (darwin-amd64), const B1200 ideal-int +pkg syscall (darwin-amd64), const B134 = 134 +pkg syscall (darwin-amd64), const B134 ideal-int +pkg syscall (darwin-amd64), const B14400 = 14400 +pkg syscall (darwin-amd64), const B14400 ideal-int +pkg syscall (darwin-amd64), const B150 = 150 +pkg syscall (darwin-amd64), const B150 ideal-int +pkg syscall (darwin-amd64), const B1800 = 1800 +pkg syscall (darwin-amd64), const B1800 ideal-int +pkg syscall (darwin-amd64), const B19200 = 19200 +pkg syscall (darwin-amd64), const B19200 ideal-int +pkg syscall (darwin-amd64), const B200 = 200 +pkg syscall (darwin-amd64), const B200 ideal-int +pkg syscall (darwin-amd64), const B230400 = 230400 +pkg syscall (darwin-amd64), const B230400 ideal-int +pkg syscall (darwin-amd64), const B2400 = 2400 +pkg syscall (darwin-amd64), const B2400 ideal-int +pkg syscall (darwin-amd64), const B28800 = 28800 +pkg syscall (darwin-amd64), const B28800 ideal-int +pkg syscall (darwin-amd64), const B300 = 300 +pkg syscall (darwin-amd64), const B300 ideal-int +pkg syscall (darwin-amd64), const B38400 = 38400 +pkg syscall (darwin-amd64), const B38400 ideal-int +pkg syscall (darwin-amd64), const B4800 = 4800 +pkg syscall (darwin-amd64), const B4800 ideal-int +pkg syscall (darwin-amd64), const B50 = 50 +pkg syscall (darwin-amd64), const B50 ideal-int +pkg syscall (darwin-amd64), const B57600 = 57600 +pkg syscall (darwin-amd64), const B57600 ideal-int +pkg syscall (darwin-amd64), const B600 = 600 +pkg syscall (darwin-amd64), const B600 ideal-int +pkg syscall (darwin-amd64), const B7200 = 7200 +pkg syscall (darwin-amd64), const B7200 ideal-int +pkg syscall (darwin-amd64), const B75 = 75 +pkg syscall (darwin-amd64), const B75 ideal-int +pkg syscall (darwin-amd64), const B76800 = 76800 +pkg syscall (darwin-amd64), const B76800 ideal-int +pkg syscall (darwin-amd64), const B9600 = 9600 +pkg syscall (darwin-amd64), const B9600 ideal-int +pkg syscall (darwin-amd64), const BIOCFLUSH = 536887912 +pkg syscall (darwin-amd64), const BIOCGBLEN = 1074020966 +pkg syscall (darwin-amd64), const BIOCGDLT = 1074020970 +pkg syscall (darwin-amd64), const BIOCGDLTLIST = 3222028921 +pkg syscall (darwin-amd64), const BIOCGETIF = 1075855979 +pkg syscall (darwin-amd64), const BIOCGHDRCMPLT = 1074020980 +pkg syscall (darwin-amd64), const BIOCGRSIG = 1074020978 +pkg syscall (darwin-amd64), const BIOCGRTIMEOUT = 1074807406 +pkg syscall (darwin-amd64), const BIOCGSEESENT = 1074020982 +pkg syscall (darwin-amd64), const BIOCGSTATS = 1074283119 +pkg syscall (darwin-amd64), const BIOCIMMEDIATE = 2147762800 +pkg syscall (darwin-amd64), const BIOCPROMISC = 536887913 +pkg syscall (darwin-amd64), const BIOCSBLEN = 3221504614 +pkg syscall (darwin-amd64), const BIOCSDLT = 2147762808 +pkg syscall (darwin-amd64), const BIOCSETF = 2148549223 +pkg syscall (darwin-amd64), const BIOCSETIF = 2149597804 +pkg syscall (darwin-amd64), const BIOCSHDRCMPLT = 2147762805 +pkg syscall (darwin-amd64), const BIOCSRSIG = 2147762803 +pkg syscall (darwin-amd64), const BIOCSRTIMEOUT = 2148549229 +pkg syscall (darwin-amd64), const BIOCSSEESENT = 2147762807 +pkg syscall (darwin-amd64), const BIOCVERSION = 1074020977 +pkg syscall (darwin-amd64), const BPF_A = 16 +pkg syscall (darwin-amd64), const BPF_ABS = 32 +pkg syscall (darwin-amd64), const BPF_ADD = 0 +pkg syscall (darwin-amd64), const BPF_ALIGNMENT = 4 +pkg syscall (darwin-amd64), const BPF_ALU = 4 +pkg syscall (darwin-amd64), const BPF_AND = 80 +pkg syscall (darwin-amd64), const BPF_B = 16 +pkg syscall (darwin-amd64), const BPF_DIV = 48 +pkg syscall (darwin-amd64), const BPF_H = 8 +pkg syscall (darwin-amd64), const BPF_IMM = 0 +pkg syscall (darwin-amd64), const BPF_IND = 64 +pkg syscall (darwin-amd64), const BPF_JA = 0 +pkg syscall (darwin-amd64), const BPF_JEQ = 16 +pkg syscall (darwin-amd64), const BPF_JGE = 48 +pkg syscall (darwin-amd64), const BPF_JGT = 32 +pkg syscall (darwin-amd64), const BPF_JMP = 5 +pkg syscall (darwin-amd64), const BPF_JSET = 64 +pkg syscall (darwin-amd64), const BPF_K = 0 +pkg syscall (darwin-amd64), const BPF_LD = 0 +pkg syscall (darwin-amd64), const BPF_LDX = 1 +pkg syscall (darwin-amd64), const BPF_LEN = 128 +pkg syscall (darwin-amd64), const BPF_LSH = 96 +pkg syscall (darwin-amd64), const BPF_MAJOR_VERSION = 1 +pkg syscall (darwin-amd64), const BPF_MAXBUFSIZE = 524288 +pkg syscall (darwin-amd64), const BPF_MAXINSNS = 512 +pkg syscall (darwin-amd64), const BPF_MEM = 96 +pkg syscall (darwin-amd64), const BPF_MEMWORDS = 16 +pkg syscall (darwin-amd64), const BPF_MINBUFSIZE = 32 +pkg syscall (darwin-amd64), const BPF_MINOR_VERSION = 1 +pkg syscall (darwin-amd64), const BPF_MISC = 7 +pkg syscall (darwin-amd64), const BPF_MSH = 160 +pkg syscall (darwin-amd64), const BPF_MUL = 32 +pkg syscall (darwin-amd64), const BPF_NEG = 128 +pkg syscall (darwin-amd64), const BPF_OR = 64 +pkg syscall (darwin-amd64), const BPF_RELEASE = 199606 +pkg syscall (darwin-amd64), const BPF_RET = 6 +pkg syscall (darwin-amd64), const BPF_RSH = 112 +pkg syscall (darwin-amd64), const BPF_ST = 2 +pkg syscall (darwin-amd64), const BPF_STX = 3 +pkg syscall (darwin-amd64), const BPF_SUB = 16 +pkg syscall (darwin-amd64), const BPF_TAX = 0 +pkg syscall (darwin-amd64), const BPF_TXA = 128 +pkg syscall (darwin-amd64), const BPF_W = 0 +pkg syscall (darwin-amd64), const BPF_X = 8 +pkg syscall (darwin-amd64), const BRKINT = 2 +pkg syscall (darwin-amd64), const BRKINT ideal-int +pkg syscall (darwin-amd64), const CFLUSH = 15 +pkg syscall (darwin-amd64), const CFLUSH ideal-int +pkg syscall (darwin-amd64), const CLOCAL = 32768 +pkg syscall (darwin-amd64), const CLOCAL ideal-int +pkg syscall (darwin-amd64), const CREAD = 2048 +pkg syscall (darwin-amd64), const CREAD ideal-int +pkg syscall (darwin-amd64), const CS5 = 0 +pkg syscall (darwin-amd64), const CS5 ideal-int +pkg syscall (darwin-amd64), const CS6 = 256 +pkg syscall (darwin-amd64), const CS6 ideal-int +pkg syscall (darwin-amd64), const CS7 = 512 +pkg syscall (darwin-amd64), const CS7 ideal-int +pkg syscall (darwin-amd64), const CS8 = 768 +pkg syscall (darwin-amd64), const CS8 ideal-int +pkg syscall (darwin-amd64), const CSIZE = 768 +pkg syscall (darwin-amd64), const CSIZE ideal-int +pkg syscall (darwin-amd64), const CSTART = 17 +pkg syscall (darwin-amd64), const CSTART ideal-int +pkg syscall (darwin-amd64), const CSTATUS = 20 +pkg syscall (darwin-amd64), const CSTATUS ideal-int +pkg syscall (darwin-amd64), const CSTOP = 19 +pkg syscall (darwin-amd64), const CSTOP ideal-int +pkg syscall (darwin-amd64), const CSTOPB = 1024 +pkg syscall (darwin-amd64), const CSTOPB ideal-int +pkg syscall (darwin-amd64), const CSUSP = 26 +pkg syscall (darwin-amd64), const CSUSP ideal-int +pkg syscall (darwin-amd64), const CTL_MAXNAME = 12 +pkg syscall (darwin-amd64), const CTL_NET = 4 +pkg syscall (darwin-amd64), const DLT_APPLE_IP_OVER_IEEE1394 = 138 +pkg syscall (darwin-amd64), const DLT_ARCNET = 7 +pkg syscall (darwin-amd64), const DLT_ATM_CLIP = 19 +pkg syscall (darwin-amd64), const DLT_ATM_RFC1483 = 11 +pkg syscall (darwin-amd64), const DLT_AX25 = 3 +pkg syscall (darwin-amd64), const DLT_CHAOS = 5 +pkg syscall (darwin-amd64), const DLT_CHDLC = 104 +pkg syscall (darwin-amd64), const DLT_C_HDLC = 104 +pkg syscall (darwin-amd64), const DLT_EN10MB = 1 +pkg syscall (darwin-amd64), const DLT_EN3MB = 2 +pkg syscall (darwin-amd64), const DLT_FDDI = 10 +pkg syscall (darwin-amd64), const DLT_IEEE802 = 6 +pkg syscall (darwin-amd64), const DLT_IEEE802_11 = 105 +pkg syscall (darwin-amd64), const DLT_IEEE802_11_RADIO = 127 +pkg syscall (darwin-amd64), const DLT_IEEE802_11_RADIO_AVS = 163 +pkg syscall (darwin-amd64), const DLT_LINUX_SLL = 113 +pkg syscall (darwin-amd64), const DLT_LOOP = 108 +pkg syscall (darwin-amd64), const DLT_NULL = 0 +pkg syscall (darwin-amd64), const DLT_PFLOG = 117 +pkg syscall (darwin-amd64), const DLT_PFSYNC = 18 +pkg syscall (darwin-amd64), const DLT_PPP = 9 +pkg syscall (darwin-amd64), const DLT_PPP_BSDOS = 16 +pkg syscall (darwin-amd64), const DLT_PPP_SERIAL = 50 +pkg syscall (darwin-amd64), const DLT_PRONET = 4 +pkg syscall (darwin-amd64), const DLT_RAW = 12 +pkg syscall (darwin-amd64), const DLT_SLIP = 8 +pkg syscall (darwin-amd64), const DLT_SLIP_BSDOS = 15 +pkg syscall (darwin-amd64), const DT_BLK = 6 +pkg syscall (darwin-amd64), const DT_CHR = 2 +pkg syscall (darwin-amd64), const DT_DIR = 4 +pkg syscall (darwin-amd64), const DT_FIFO = 1 +pkg syscall (darwin-amd64), const DT_LNK = 10 +pkg syscall (darwin-amd64), const DT_REG = 8 +pkg syscall (darwin-amd64), const DT_SOCK = 12 +pkg syscall (darwin-amd64), const DT_UNKNOWN = 0 +pkg syscall (darwin-amd64), const DT_WHT = 14 +pkg syscall (darwin-amd64), const E2BIG = 7 +pkg syscall (darwin-amd64), const EACCES = 13 +pkg syscall (darwin-amd64), const EADDRINUSE = 48 +pkg syscall (darwin-amd64), const EADDRNOTAVAIL = 49 +pkg syscall (darwin-amd64), const EAFNOSUPPORT = 47 +pkg syscall (darwin-amd64), const EAGAIN = 35 +pkg syscall (darwin-amd64), const EALREADY = 37 +pkg syscall (darwin-amd64), const EAUTH = 80 +pkg syscall (darwin-amd64), const EBADARCH = 86 +pkg syscall (darwin-amd64), const EBADEXEC = 85 +pkg syscall (darwin-amd64), const EBADF = 9 +pkg syscall (darwin-amd64), const EBADMACHO = 88 +pkg syscall (darwin-amd64), const EBADMSG = 94 +pkg syscall (darwin-amd64), const EBADRPC = 72 +pkg syscall (darwin-amd64), const EBUSY = 16 +pkg syscall (darwin-amd64), const ECANCELED = 89 +pkg syscall (darwin-amd64), const ECHILD = 10 +pkg syscall (darwin-amd64), const ECHO = 8 +pkg syscall (darwin-amd64), const ECHOCTL = 64 +pkg syscall (darwin-amd64), const ECHOE = 2 +pkg syscall (darwin-amd64), const ECHOK = 4 +pkg syscall (darwin-amd64), const ECHOKE = 1 +pkg syscall (darwin-amd64), const ECHONL = 16 +pkg syscall (darwin-amd64), const ECHOPRT = 32 +pkg syscall (darwin-amd64), const ECONNABORTED = 53 +pkg syscall (darwin-amd64), const ECONNREFUSED = 61 +pkg syscall (darwin-amd64), const ECONNRESET = 54 +pkg syscall (darwin-amd64), const EDEADLK = 11 +pkg syscall (darwin-amd64), const EDESTADDRREQ = 39 +pkg syscall (darwin-amd64), const EDEVERR = 83 +pkg syscall (darwin-amd64), const EDOM = 33 +pkg syscall (darwin-amd64), const EDQUOT = 69 +pkg syscall (darwin-amd64), const EEXIST = 17 +pkg syscall (darwin-amd64), const EFAULT = 14 +pkg syscall (darwin-amd64), const EFBIG = 27 +pkg syscall (darwin-amd64), const EFTYPE = 79 +pkg syscall (darwin-amd64), const EHOSTDOWN = 64 +pkg syscall (darwin-amd64), const EHOSTUNREACH = 65 +pkg syscall (darwin-amd64), const EIDRM = 90 +pkg syscall (darwin-amd64), const EILSEQ = 92 +pkg syscall (darwin-amd64), const EINPROGRESS = 36 +pkg syscall (darwin-amd64), const EINTR = 4 +pkg syscall (darwin-amd64), const EINVAL = 22 +pkg syscall (darwin-amd64), const EIO = 5 +pkg syscall (darwin-amd64), const EISCONN = 56 +pkg syscall (darwin-amd64), const EISDIR = 21 +pkg syscall (darwin-amd64), const ELAST = 105 +pkg syscall (darwin-amd64), const ELOOP = 62 +pkg syscall (darwin-amd64), const EMFILE = 24 +pkg syscall (darwin-amd64), const EMLINK = 31 +pkg syscall (darwin-amd64), const EMSGSIZE = 40 +pkg syscall (darwin-amd64), const EMULTIHOP = 95 +pkg syscall (darwin-amd64), const ENAMETOOLONG = 63 +pkg syscall (darwin-amd64), const ENEEDAUTH = 81 +pkg syscall (darwin-amd64), const ENETDOWN = 50 +pkg syscall (darwin-amd64), const ENETRESET = 52 +pkg syscall (darwin-amd64), const ENETUNREACH = 51 +pkg syscall (darwin-amd64), const ENFILE = 23 +pkg syscall (darwin-amd64), const ENOATTR = 93 +pkg syscall (darwin-amd64), const ENOBUFS = 55 +pkg syscall (darwin-amd64), const ENODATA = 96 +pkg syscall (darwin-amd64), const ENODEV = 19 +pkg syscall (darwin-amd64), const ENOEXEC = 8 +pkg syscall (darwin-amd64), const ENOLCK = 77 +pkg syscall (darwin-amd64), const ENOLINK = 97 +pkg syscall (darwin-amd64), const ENOMEM = 12 +pkg syscall (darwin-amd64), const ENOMSG = 91 +pkg syscall (darwin-amd64), const ENOPOLICY = 103 +pkg syscall (darwin-amd64), const ENOPROTOOPT = 42 +pkg syscall (darwin-amd64), const ENOSPC = 28 +pkg syscall (darwin-amd64), const ENOSR = 98 +pkg syscall (darwin-amd64), const ENOSTR = 99 +pkg syscall (darwin-amd64), const ENOSYS = 78 +pkg syscall (darwin-amd64), const ENOTBLK = 15 +pkg syscall (darwin-amd64), const ENOTCONN = 57 +pkg syscall (darwin-amd64), const ENOTDIR = 20 +pkg syscall (darwin-amd64), const ENOTEMPTY = 66 +pkg syscall (darwin-amd64), const ENOTRECOVERABLE = 104 +pkg syscall (darwin-amd64), const ENOTSOCK = 38 +pkg syscall (darwin-amd64), const ENOTSUP = 45 +pkg syscall (darwin-amd64), const ENOTTY = 25 +pkg syscall (darwin-amd64), const ENXIO = 6 +pkg syscall (darwin-amd64), const EOPNOTSUPP = 102 +pkg syscall (darwin-amd64), const EOVERFLOW = 84 +pkg syscall (darwin-amd64), const EOWNERDEAD = 105 +pkg syscall (darwin-amd64), const EPERM = 1 +pkg syscall (darwin-amd64), const EPFNOSUPPORT = 46 +pkg syscall (darwin-amd64), const EPIPE = 32 +pkg syscall (darwin-amd64), const EPROCLIM = 67 +pkg syscall (darwin-amd64), const EPROCUNAVAIL = 76 +pkg syscall (darwin-amd64), const EPROGMISMATCH = 75 +pkg syscall (darwin-amd64), const EPROGUNAVAIL = 74 +pkg syscall (darwin-amd64), const EPROTO = 100 +pkg syscall (darwin-amd64), const EPROTONOSUPPORT = 43 +pkg syscall (darwin-amd64), const EPROTOTYPE = 41 +pkg syscall (darwin-amd64), const EPWROFF = 82 +pkg syscall (darwin-amd64), const ERANGE = 34 +pkg syscall (darwin-amd64), const EREMOTE = 71 +pkg syscall (darwin-amd64), const EROFS = 30 +pkg syscall (darwin-amd64), const ERPCMISMATCH = 73 +pkg syscall (darwin-amd64), const ESHLIBVERS = 87 +pkg syscall (darwin-amd64), const ESHUTDOWN = 58 +pkg syscall (darwin-amd64), const ESOCKTNOSUPPORT = 44 +pkg syscall (darwin-amd64), const ESPIPE = 29 +pkg syscall (darwin-amd64), const ESRCH = 3 +pkg syscall (darwin-amd64), const ESTALE = 70 +pkg syscall (darwin-amd64), const ETIME = 101 +pkg syscall (darwin-amd64), const ETIMEDOUT = 60 +pkg syscall (darwin-amd64), const ETOOMANYREFS = 59 +pkg syscall (darwin-amd64), const ETXTBSY = 26 +pkg syscall (darwin-amd64), const EUSERS = 68 +pkg syscall (darwin-amd64), const EVFILT_AIO = -3 +pkg syscall (darwin-amd64), const EVFILT_FS = -9 +pkg syscall (darwin-amd64), const EVFILT_MACHPORT = -8 +pkg syscall (darwin-amd64), const EVFILT_PROC = -5 +pkg syscall (darwin-amd64), const EVFILT_READ = -1 +pkg syscall (darwin-amd64), const EVFILT_SIGNAL = -6 +pkg syscall (darwin-amd64), const EVFILT_SYSCOUNT = 12 +pkg syscall (darwin-amd64), const EVFILT_THREADMARKER = 12 +pkg syscall (darwin-amd64), const EVFILT_TIMER = -7 +pkg syscall (darwin-amd64), const EVFILT_USER = -10 +pkg syscall (darwin-amd64), const EVFILT_VM = -12 +pkg syscall (darwin-amd64), const EVFILT_VNODE = -4 +pkg syscall (darwin-amd64), const EVFILT_WRITE = -2 +pkg syscall (darwin-amd64), const EV_ADD = 1 +pkg syscall (darwin-amd64), const EV_CLEAR = 32 +pkg syscall (darwin-amd64), const EV_DELETE = 2 +pkg syscall (darwin-amd64), const EV_DISABLE = 8 +pkg syscall (darwin-amd64), const EV_DISPATCH = 128 +pkg syscall (darwin-amd64), const EV_ENABLE = 4 +pkg syscall (darwin-amd64), const EV_EOF = 32768 +pkg syscall (darwin-amd64), const EV_ERROR = 16384 +pkg syscall (darwin-amd64), const EV_FLAG0 = 4096 +pkg syscall (darwin-amd64), const EV_FLAG1 = 8192 +pkg syscall (darwin-amd64), const EV_ONESHOT = 16 +pkg syscall (darwin-amd64), const EV_OOBAND = 8192 +pkg syscall (darwin-amd64), const EV_POLL = 4096 +pkg syscall (darwin-amd64), const EV_RECEIPT = 64 +pkg syscall (darwin-amd64), const EV_SYSFLAGS = 61440 +pkg syscall (darwin-amd64), const EWOULDBLOCK = 35 +pkg syscall (darwin-amd64), const EXDEV = 18 +pkg syscall (darwin-amd64), const EXTA = 19200 +pkg syscall (darwin-amd64), const EXTB = 38400 +pkg syscall (darwin-amd64), const EXTPROC = 2048 +pkg syscall (darwin-amd64), const FD_CLOEXEC = 1 +pkg syscall (darwin-amd64), const FD_SETSIZE = 1024 +pkg syscall (darwin-amd64), const FLUSHO = 8388608 +pkg syscall (darwin-amd64), const FLUSHO ideal-int +pkg syscall (darwin-amd64), const F_ADDFILESIGS = 61 +pkg syscall (darwin-amd64), const F_ADDSIGS = 59 +pkg syscall (darwin-amd64), const F_ALLOCATEALL = 4 +pkg syscall (darwin-amd64), const F_ALLOCATECONTIG = 2 +pkg syscall (darwin-amd64), const F_CHKCLEAN = 41 +pkg syscall (darwin-amd64), const F_DUPFD = 0 +pkg syscall (darwin-amd64), const F_DUPFD_CLOEXEC = 67 +pkg syscall (darwin-amd64), const F_FLUSH_DATA = 40 +pkg syscall (darwin-amd64), const F_FREEZE_FS = 53 +pkg syscall (darwin-amd64), const F_FULLFSYNC = 51 +pkg syscall (darwin-amd64), const F_GETFD = 1 +pkg syscall (darwin-amd64), const F_GETFL = 3 +pkg syscall (darwin-amd64), const F_GETLK = 7 +pkg syscall (darwin-amd64), const F_GETLKPID = 66 +pkg syscall (darwin-amd64), const F_GETNOSIGPIPE = 74 +pkg syscall (darwin-amd64), const F_GETOWN = 5 +pkg syscall (darwin-amd64), const F_GETPATH = 50 +pkg syscall (darwin-amd64), const F_GETPATH_MTMINFO = 71 +pkg syscall (darwin-amd64), const F_GETPROTECTIONCLASS = 63 +pkg syscall (darwin-amd64), const F_GLOBAL_NOCACHE = 55 +pkg syscall (darwin-amd64), const F_LOG2PHYS = 49 +pkg syscall (darwin-amd64), const F_LOG2PHYS_EXT = 65 +pkg syscall (darwin-amd64), const F_MARKDEPENDENCY = 60 +pkg syscall (darwin-amd64), const F_NOCACHE = 48 +pkg syscall (darwin-amd64), const F_NODIRECT = 62 +pkg syscall (darwin-amd64), const F_OK = 0 +pkg syscall (darwin-amd64), const F_PATHPKG_CHECK = 52 +pkg syscall (darwin-amd64), const F_PEOFPOSMODE = 3 +pkg syscall (darwin-amd64), const F_PREALLOCATE = 42 +pkg syscall (darwin-amd64), const F_RDADVISE = 44 +pkg syscall (darwin-amd64), const F_RDAHEAD = 45 +pkg syscall (darwin-amd64), const F_RDLCK = 1 +pkg syscall (darwin-amd64), const F_READBOOTSTRAP = 46 +pkg syscall (darwin-amd64), const F_SETBACKINGSTORE = 70 +pkg syscall (darwin-amd64), const F_SETFD = 2 +pkg syscall (darwin-amd64), const F_SETFL = 4 +pkg syscall (darwin-amd64), const F_SETLK = 8 +pkg syscall (darwin-amd64), const F_SETLKW = 9 +pkg syscall (darwin-amd64), const F_SETNOSIGPIPE = 73 +pkg syscall (darwin-amd64), const F_SETOWN = 6 +pkg syscall (darwin-amd64), const F_SETPROTECTIONCLASS = 64 +pkg syscall (darwin-amd64), const F_SETSIZE = 43 +pkg syscall (darwin-amd64), const F_THAW_FS = 54 +pkg syscall (darwin-amd64), const F_UNLCK = 2 +pkg syscall (darwin-amd64), const F_VOLPOSMODE = 4 +pkg syscall (darwin-amd64), const F_WRITEBOOTSTRAP = 47 +pkg syscall (darwin-amd64), const F_WRLCK = 3 +pkg syscall (darwin-amd64), const HUPCL = 16384 +pkg syscall (darwin-amd64), const HUPCL ideal-int +pkg syscall (darwin-amd64), const ICANON = 256 +pkg syscall (darwin-amd64), const ICANON ideal-int +pkg syscall (darwin-amd64), const ICRNL = 256 +pkg syscall (darwin-amd64), const ICRNL ideal-int +pkg syscall (darwin-amd64), const IEXTEN = 1024 +pkg syscall (darwin-amd64), const IEXTEN ideal-int +pkg syscall (darwin-amd64), const IFF_ALLMULTI = 512 +pkg syscall (darwin-amd64), const IFF_ALTPHYS = 16384 +pkg syscall (darwin-amd64), const IFF_DEBUG = 4 +pkg syscall (darwin-amd64), const IFF_LINK0 = 4096 +pkg syscall (darwin-amd64), const IFF_LINK1 = 8192 +pkg syscall (darwin-amd64), const IFF_LINK2 = 16384 +pkg syscall (darwin-amd64), const IFF_LOOPBACK = 8 +pkg syscall (darwin-amd64), const IFF_MULTICAST = 32768 +pkg syscall (darwin-amd64), const IFF_NOARP = 128 +pkg syscall (darwin-amd64), const IFF_NOTRAILERS = 32 +pkg syscall (darwin-amd64), const IFF_OACTIVE = 1024 +pkg syscall (darwin-amd64), const IFF_POINTOPOINT = 16 +pkg syscall (darwin-amd64), const IFF_PROMISC = 256 +pkg syscall (darwin-amd64), const IFF_RUNNING = 64 +pkg syscall (darwin-amd64), const IFF_SIMPLEX = 2048 +pkg syscall (darwin-amd64), const IFNAMSIZ = 16 +pkg syscall (darwin-amd64), const IFT_1822 = 2 +pkg syscall (darwin-amd64), const IFT_AAL5 = 49 +pkg syscall (darwin-amd64), const IFT_ARCNET = 35 +pkg syscall (darwin-amd64), const IFT_ARCNETPLUS = 36 +pkg syscall (darwin-amd64), const IFT_ATM = 37 +pkg syscall (darwin-amd64), const IFT_BRIDGE = 209 +pkg syscall (darwin-amd64), const IFT_CARP = 248 +pkg syscall (darwin-amd64), const IFT_CELLULAR = 255 +pkg syscall (darwin-amd64), const IFT_CEPT = 19 +pkg syscall (darwin-amd64), const IFT_DS3 = 30 +pkg syscall (darwin-amd64), const IFT_ENC = 244 +pkg syscall (darwin-amd64), const IFT_EON = 25 +pkg syscall (darwin-amd64), const IFT_ETHER = 6 +pkg syscall (darwin-amd64), const IFT_FAITH = 56 +pkg syscall (darwin-amd64), const IFT_FDDI = 15 +pkg syscall (darwin-amd64), const IFT_FRELAY = 32 +pkg syscall (darwin-amd64), const IFT_FRELAYDCE = 44 +pkg syscall (darwin-amd64), const IFT_GIF = 55 +pkg syscall (darwin-amd64), const IFT_HDH1822 = 3 +pkg syscall (darwin-amd64), const IFT_HIPPI = 47 +pkg syscall (darwin-amd64), const IFT_HSSI = 46 +pkg syscall (darwin-amd64), const IFT_HY = 14 +pkg syscall (darwin-amd64), const IFT_IEEE1394 = 144 +pkg syscall (darwin-amd64), const IFT_IEEE8023ADLAG = 136 +pkg syscall (darwin-amd64), const IFT_ISDNBASIC = 20 +pkg syscall (darwin-amd64), const IFT_ISDNPRIMARY = 21 +pkg syscall (darwin-amd64), const IFT_ISO88022LLC = 41 +pkg syscall (darwin-amd64), const IFT_ISO88023 = 7 +pkg syscall (darwin-amd64), const IFT_ISO88024 = 8 +pkg syscall (darwin-amd64), const IFT_ISO88025 = 9 +pkg syscall (darwin-amd64), const IFT_ISO88026 = 10 +pkg syscall (darwin-amd64), const IFT_L2VLAN = 135 +pkg syscall (darwin-amd64), const IFT_LAPB = 16 +pkg syscall (darwin-amd64), const IFT_LOCALTALK = 42 +pkg syscall (darwin-amd64), const IFT_LOOP = 24 +pkg syscall (darwin-amd64), const IFT_MIOX25 = 38 +pkg syscall (darwin-amd64), const IFT_MODEM = 48 +pkg syscall (darwin-amd64), const IFT_NSIP = 27 +pkg syscall (darwin-amd64), const IFT_OTHER = 1 +pkg syscall (darwin-amd64), const IFT_P10 = 12 +pkg syscall (darwin-amd64), const IFT_P80 = 13 +pkg syscall (darwin-amd64), const IFT_PARA = 34 +pkg syscall (darwin-amd64), const IFT_PDP = 255 +pkg syscall (darwin-amd64), const IFT_PFLOG = 245 +pkg syscall (darwin-amd64), const IFT_PFSYNC = 246 +pkg syscall (darwin-amd64), const IFT_PPP = 23 +pkg syscall (darwin-amd64), const IFT_PROPMUX = 54 +pkg syscall (darwin-amd64), const IFT_PROPVIRTUAL = 53 +pkg syscall (darwin-amd64), const IFT_PTPSERIAL = 22 +pkg syscall (darwin-amd64), const IFT_RS232 = 33 +pkg syscall (darwin-amd64), const IFT_SDLC = 17 +pkg syscall (darwin-amd64), const IFT_SIP = 31 +pkg syscall (darwin-amd64), const IFT_SLIP = 28 +pkg syscall (darwin-amd64), const IFT_SMDSDXI = 43 +pkg syscall (darwin-amd64), const IFT_SMDSICIP = 52 +pkg syscall (darwin-amd64), const IFT_SONET = 39 +pkg syscall (darwin-amd64), const IFT_SONETPATH = 50 +pkg syscall (darwin-amd64), const IFT_SONETVT = 51 +pkg syscall (darwin-amd64), const IFT_STARLAN = 11 +pkg syscall (darwin-amd64), const IFT_STF = 57 +pkg syscall (darwin-amd64), const IFT_T1 = 18 +pkg syscall (darwin-amd64), const IFT_ULTRA = 29 +pkg syscall (darwin-amd64), const IFT_V35 = 45 +pkg syscall (darwin-amd64), const IFT_X25 = 5 +pkg syscall (darwin-amd64), const IFT_X25DDN = 4 +pkg syscall (darwin-amd64), const IFT_X25PLE = 40 +pkg syscall (darwin-amd64), const IFT_XETHER = 26 +pkg syscall (darwin-amd64), const IGNBRK = 1 +pkg syscall (darwin-amd64), const IGNBRK ideal-int +pkg syscall (darwin-amd64), const IGNCR = 128 +pkg syscall (darwin-amd64), const IGNCR ideal-int +pkg syscall (darwin-amd64), const IGNPAR = 4 +pkg syscall (darwin-amd64), const IGNPAR ideal-int +pkg syscall (darwin-amd64), const IMAXBEL = 8192 +pkg syscall (darwin-amd64), const IMAXBEL ideal-int +pkg syscall (darwin-amd64), const INLCR = 64 +pkg syscall (darwin-amd64), const INLCR ideal-int +pkg syscall (darwin-amd64), const INPCK = 16 +pkg syscall (darwin-amd64), const INPCK ideal-int +pkg syscall (darwin-amd64), const IN_CLASSA_HOST = 16777215 +pkg syscall (darwin-amd64), const IN_CLASSA_MAX = 128 +pkg syscall (darwin-amd64), const IN_CLASSA_NET = 4278190080 +pkg syscall (darwin-amd64), const IN_CLASSA_NSHIFT = 24 +pkg syscall (darwin-amd64), const IN_CLASSB_HOST = 65535 +pkg syscall (darwin-amd64), const IN_CLASSB_MAX = 65536 +pkg syscall (darwin-amd64), const IN_CLASSB_NET = 4294901760 +pkg syscall (darwin-amd64), const IN_CLASSB_NSHIFT = 16 +pkg syscall (darwin-amd64), const IN_CLASSC_HOST = 255 +pkg syscall (darwin-amd64), const IN_CLASSC_NET = 4294967040 +pkg syscall (darwin-amd64), const IN_CLASSC_NSHIFT = 8 +pkg syscall (darwin-amd64), const IN_CLASSD_HOST = 268435455 +pkg syscall (darwin-amd64), const IN_CLASSD_NET = 4026531840 +pkg syscall (darwin-amd64), const IN_CLASSD_NSHIFT = 28 +pkg syscall (darwin-amd64), const IN_LINKLOCALNETNUM = 2851995648 +pkg syscall (darwin-amd64), const IN_LOOPBACKNET = 127 +pkg syscall (darwin-amd64), const IPPROTO_3PC = 34 +pkg syscall (darwin-amd64), const IPPROTO_ADFS = 68 +pkg syscall (darwin-amd64), const IPPROTO_AH = 51 +pkg syscall (darwin-amd64), const IPPROTO_AHIP = 61 +pkg syscall (darwin-amd64), const IPPROTO_APES = 99 +pkg syscall (darwin-amd64), const IPPROTO_ARGUS = 13 +pkg syscall (darwin-amd64), const IPPROTO_AX25 = 93 +pkg syscall (darwin-amd64), const IPPROTO_BHA = 49 +pkg syscall (darwin-amd64), const IPPROTO_BLT = 30 +pkg syscall (darwin-amd64), const IPPROTO_BRSATMON = 76 +pkg syscall (darwin-amd64), const IPPROTO_CFTP = 62 +pkg syscall (darwin-amd64), const IPPROTO_CHAOS = 16 +pkg syscall (darwin-amd64), const IPPROTO_CMTP = 38 +pkg syscall (darwin-amd64), const IPPROTO_CPHB = 73 +pkg syscall (darwin-amd64), const IPPROTO_CPNX = 72 +pkg syscall (darwin-amd64), const IPPROTO_DDP = 37 +pkg syscall (darwin-amd64), const IPPROTO_DGP = 86 +pkg syscall (darwin-amd64), const IPPROTO_DIVERT = 254 +pkg syscall (darwin-amd64), const IPPROTO_DONE = 257 +pkg syscall (darwin-amd64), const IPPROTO_DSTOPTS = 60 +pkg syscall (darwin-amd64), const IPPROTO_EGP = 8 +pkg syscall (darwin-amd64), const IPPROTO_EMCON = 14 +pkg syscall (darwin-amd64), const IPPROTO_ENCAP = 98 +pkg syscall (darwin-amd64), const IPPROTO_EON = 80 +pkg syscall (darwin-amd64), const IPPROTO_ESP = 50 +pkg syscall (darwin-amd64), const IPPROTO_ETHERIP = 97 +pkg syscall (darwin-amd64), const IPPROTO_FRAGMENT = 44 +pkg syscall (darwin-amd64), const IPPROTO_GGP = 3 +pkg syscall (darwin-amd64), const IPPROTO_GMTP = 100 +pkg syscall (darwin-amd64), const IPPROTO_GRE = 47 +pkg syscall (darwin-amd64), const IPPROTO_HELLO = 63 +pkg syscall (darwin-amd64), const IPPROTO_HMP = 20 +pkg syscall (darwin-amd64), const IPPROTO_HOPOPTS = 0 +pkg syscall (darwin-amd64), const IPPROTO_ICMP = 1 +pkg syscall (darwin-amd64), const IPPROTO_ICMPV6 = 58 +pkg syscall (darwin-amd64), const IPPROTO_IDP = 22 +pkg syscall (darwin-amd64), const IPPROTO_IDPR = 35 +pkg syscall (darwin-amd64), const IPPROTO_IDRP = 45 +pkg syscall (darwin-amd64), const IPPROTO_IGMP = 2 +pkg syscall (darwin-amd64), const IPPROTO_IGP = 85 +pkg syscall (darwin-amd64), const IPPROTO_IGRP = 88 +pkg syscall (darwin-amd64), const IPPROTO_IL = 40 +pkg syscall (darwin-amd64), const IPPROTO_INLSP = 52 +pkg syscall (darwin-amd64), const IPPROTO_INP = 32 +pkg syscall (darwin-amd64), const IPPROTO_IPCOMP = 108 +pkg syscall (darwin-amd64), const IPPROTO_IPCV = 71 +pkg syscall (darwin-amd64), const IPPROTO_IPEIP = 94 +pkg syscall (darwin-amd64), const IPPROTO_IPIP = 4 +pkg syscall (darwin-amd64), const IPPROTO_IPPC = 67 +pkg syscall (darwin-amd64), const IPPROTO_IPV4 = 4 +pkg syscall (darwin-amd64), const IPPROTO_IRTP = 28 +pkg syscall (darwin-amd64), const IPPROTO_KRYPTOLAN = 65 +pkg syscall (darwin-amd64), const IPPROTO_LARP = 91 +pkg syscall (darwin-amd64), const IPPROTO_LEAF1 = 25 +pkg syscall (darwin-amd64), const IPPROTO_LEAF2 = 26 +pkg syscall (darwin-amd64), const IPPROTO_MAX = 256 +pkg syscall (darwin-amd64), const IPPROTO_MAXID = 52 +pkg syscall (darwin-amd64), const IPPROTO_MEAS = 19 +pkg syscall (darwin-amd64), const IPPROTO_MHRP = 48 +pkg syscall (darwin-amd64), const IPPROTO_MICP = 95 +pkg syscall (darwin-amd64), const IPPROTO_MTP = 92 +pkg syscall (darwin-amd64), const IPPROTO_MUX = 18 +pkg syscall (darwin-amd64), const IPPROTO_ND = 77 +pkg syscall (darwin-amd64), const IPPROTO_NHRP = 54 +pkg syscall (darwin-amd64), const IPPROTO_NONE = 59 +pkg syscall (darwin-amd64), const IPPROTO_NSP = 31 +pkg syscall (darwin-amd64), const IPPROTO_NVPII = 11 +pkg syscall (darwin-amd64), const IPPROTO_OSPFIGP = 89 +pkg syscall (darwin-amd64), const IPPROTO_PGM = 113 +pkg syscall (darwin-amd64), const IPPROTO_PIGP = 9 +pkg syscall (darwin-amd64), const IPPROTO_PIM = 103 +pkg syscall (darwin-amd64), const IPPROTO_PRM = 21 +pkg syscall (darwin-amd64), const IPPROTO_PUP = 12 +pkg syscall (darwin-amd64), const IPPROTO_PVP = 75 +pkg syscall (darwin-amd64), const IPPROTO_RAW = 255 +pkg syscall (darwin-amd64), const IPPROTO_RCCMON = 10 +pkg syscall (darwin-amd64), const IPPROTO_RDP = 27 +pkg syscall (darwin-amd64), const IPPROTO_ROUTING = 43 +pkg syscall (darwin-amd64), const IPPROTO_RSVP = 46 +pkg syscall (darwin-amd64), const IPPROTO_RVD = 66 +pkg syscall (darwin-amd64), const IPPROTO_SATEXPAK = 64 +pkg syscall (darwin-amd64), const IPPROTO_SATMON = 69 +pkg syscall (darwin-amd64), const IPPROTO_SCCSP = 96 +pkg syscall (darwin-amd64), const IPPROTO_SCTP = 132 +pkg syscall (darwin-amd64), const IPPROTO_SDRP = 42 +pkg syscall (darwin-amd64), const IPPROTO_SEP = 33 +pkg syscall (darwin-amd64), const IPPROTO_SRPC = 90 +pkg syscall (darwin-amd64), const IPPROTO_ST = 7 +pkg syscall (darwin-amd64), const IPPROTO_SVMTP = 82 +pkg syscall (darwin-amd64), const IPPROTO_SWIPE = 53 +pkg syscall (darwin-amd64), const IPPROTO_TCF = 87 +pkg syscall (darwin-amd64), const IPPROTO_TP = 29 +pkg syscall (darwin-amd64), const IPPROTO_TPXX = 39 +pkg syscall (darwin-amd64), const IPPROTO_TRUNK1 = 23 +pkg syscall (darwin-amd64), const IPPROTO_TRUNK2 = 24 +pkg syscall (darwin-amd64), const IPPROTO_TTP = 84 +pkg syscall (darwin-amd64), const IPPROTO_VINES = 83 +pkg syscall (darwin-amd64), const IPPROTO_VISA = 70 +pkg syscall (darwin-amd64), const IPPROTO_VMTP = 81 +pkg syscall (darwin-amd64), const IPPROTO_WBEXPAK = 79 +pkg syscall (darwin-amd64), const IPPROTO_WBMON = 78 +pkg syscall (darwin-amd64), const IPPROTO_WSN = 74 +pkg syscall (darwin-amd64), const IPPROTO_XNET = 15 +pkg syscall (darwin-amd64), const IPPROTO_XTP = 36 +pkg syscall (darwin-amd64), const IPV6_2292DSTOPTS = 23 +pkg syscall (darwin-amd64), const IPV6_2292HOPLIMIT = 20 +pkg syscall (darwin-amd64), const IPV6_2292HOPOPTS = 22 +pkg syscall (darwin-amd64), const IPV6_2292NEXTHOP = 21 +pkg syscall (darwin-amd64), const IPV6_2292PKTINFO = 19 +pkg syscall (darwin-amd64), const IPV6_2292PKTOPTIONS = 25 +pkg syscall (darwin-amd64), const IPV6_2292RTHDR = 24 +pkg syscall (darwin-amd64), const IPV6_BINDV6ONLY = 27 +pkg syscall (darwin-amd64), const IPV6_BOUND_IF = 125 +pkg syscall (darwin-amd64), const IPV6_CHECKSUM = 26 +pkg syscall (darwin-amd64), const IPV6_DEFAULT_MULTICAST_HOPS = 1 +pkg syscall (darwin-amd64), const IPV6_DEFAULT_MULTICAST_LOOP = 1 +pkg syscall (darwin-amd64), const IPV6_DEFHLIM = 64 +pkg syscall (darwin-amd64), const IPV6_FAITH = 29 +pkg syscall (darwin-amd64), const IPV6_FLOWINFO_MASK = 4294967055 +pkg syscall (darwin-amd64), const IPV6_FLOWLABEL_MASK = 4294905600 +pkg syscall (darwin-amd64), const IPV6_FRAGTTL = 120 +pkg syscall (darwin-amd64), const IPV6_FW_ADD = 30 +pkg syscall (darwin-amd64), const IPV6_FW_DEL = 31 +pkg syscall (darwin-amd64), const IPV6_FW_FLUSH = 32 +pkg syscall (darwin-amd64), const IPV6_FW_GET = 34 +pkg syscall (darwin-amd64), const IPV6_FW_ZERO = 33 +pkg syscall (darwin-amd64), const IPV6_HLIMDEC = 1 +pkg syscall (darwin-amd64), const IPV6_IPSEC_POLICY = 28 +pkg syscall (darwin-amd64), const IPV6_JOIN_GROUP = 12 +pkg syscall (darwin-amd64), const IPV6_LEAVE_GROUP = 13 +pkg syscall (darwin-amd64), const IPV6_MAXHLIM = 255 +pkg syscall (darwin-amd64), const IPV6_MAXOPTHDR = 2048 +pkg syscall (darwin-amd64), const IPV6_MAXPACKET = 65535 +pkg syscall (darwin-amd64), const IPV6_MAX_GROUP_SRC_FILTER = 512 +pkg syscall (darwin-amd64), const IPV6_MAX_MEMBERSHIPS = 4095 +pkg syscall (darwin-amd64), const IPV6_MAX_SOCK_SRC_FILTER = 128 +pkg syscall (darwin-amd64), const IPV6_MIN_MEMBERSHIPS = 31 +pkg syscall (darwin-amd64), const IPV6_MMTU = 1280 +pkg syscall (darwin-amd64), const IPV6_MULTICAST_HOPS = 10 +pkg syscall (darwin-amd64), const IPV6_MULTICAST_IF = 9 +pkg syscall (darwin-amd64), const IPV6_MULTICAST_LOOP = 11 +pkg syscall (darwin-amd64), const IPV6_PORTRANGE = 14 +pkg syscall (darwin-amd64), const IPV6_PORTRANGE_DEFAULT = 0 +pkg syscall (darwin-amd64), const IPV6_PORTRANGE_HIGH = 1 +pkg syscall (darwin-amd64), const IPV6_PORTRANGE_LOW = 2 +pkg syscall (darwin-amd64), const IPV6_RECVTCLASS = 35 +pkg syscall (darwin-amd64), const IPV6_RTHDR_LOOSE = 0 +pkg syscall (darwin-amd64), const IPV6_RTHDR_STRICT = 1 +pkg syscall (darwin-amd64), const IPV6_RTHDR_TYPE_0 = 0 +pkg syscall (darwin-amd64), const IPV6_SOCKOPT_RESERVED1 = 3 +pkg syscall (darwin-amd64), const IPV6_TCLASS = 36 +pkg syscall (darwin-amd64), const IPV6_UNICAST_HOPS = 4 +pkg syscall (darwin-amd64), const IPV6_V6ONLY = 27 +pkg syscall (darwin-amd64), const IPV6_VERSION = 96 +pkg syscall (darwin-amd64), const IPV6_VERSION_MASK = 240 +pkg syscall (darwin-amd64), const IP_ADD_MEMBERSHIP = 12 +pkg syscall (darwin-amd64), const IP_ADD_SOURCE_MEMBERSHIP = 70 +pkg syscall (darwin-amd64), const IP_BLOCK_SOURCE = 72 +pkg syscall (darwin-amd64), const IP_BOUND_IF = 25 +pkg syscall (darwin-amd64), const IP_DEFAULT_MULTICAST_LOOP = 1 +pkg syscall (darwin-amd64), const IP_DEFAULT_MULTICAST_TTL = 1 +pkg syscall (darwin-amd64), const IP_DF = 16384 +pkg syscall (darwin-amd64), const IP_DROP_MEMBERSHIP = 13 +pkg syscall (darwin-amd64), const IP_DROP_SOURCE_MEMBERSHIP = 71 +pkg syscall (darwin-amd64), const IP_DUMMYNET_CONFIGURE = 60 +pkg syscall (darwin-amd64), const IP_DUMMYNET_DEL = 61 +pkg syscall (darwin-amd64), const IP_DUMMYNET_FLUSH = 62 +pkg syscall (darwin-amd64), const IP_DUMMYNET_GET = 64 +pkg syscall (darwin-amd64), const IP_FAITH = 22 +pkg syscall (darwin-amd64), const IP_FW_ADD = 40 +pkg syscall (darwin-amd64), const IP_FW_DEL = 41 +pkg syscall (darwin-amd64), const IP_FW_FLUSH = 42 +pkg syscall (darwin-amd64), const IP_FW_GET = 44 +pkg syscall (darwin-amd64), const IP_FW_RESETLOG = 45 +pkg syscall (darwin-amd64), const IP_FW_ZERO = 43 +pkg syscall (darwin-amd64), const IP_HDRINCL = 2 +pkg syscall (darwin-amd64), const IP_IPSEC_POLICY = 21 +pkg syscall (darwin-amd64), const IP_MAXPACKET = 65535 +pkg syscall (darwin-amd64), const IP_MAX_GROUP_SRC_FILTER = 512 +pkg syscall (darwin-amd64), const IP_MAX_MEMBERSHIPS = 4095 +pkg syscall (darwin-amd64), const IP_MAX_SOCK_MUTE_FILTER = 128 +pkg syscall (darwin-amd64), const IP_MAX_SOCK_SRC_FILTER = 128 +pkg syscall (darwin-amd64), const IP_MF = 8192 +pkg syscall (darwin-amd64), const IP_MIN_MEMBERSHIPS = 31 +pkg syscall (darwin-amd64), const IP_MSFILTER = 74 +pkg syscall (darwin-amd64), const IP_MSS = 576 +pkg syscall (darwin-amd64), const IP_MULTICAST_IF = 9 +pkg syscall (darwin-amd64), const IP_MULTICAST_IFINDEX = 66 +pkg syscall (darwin-amd64), const IP_MULTICAST_LOOP = 11 +pkg syscall (darwin-amd64), const IP_MULTICAST_TTL = 10 +pkg syscall (darwin-amd64), const IP_MULTICAST_VIF = 14 +pkg syscall (darwin-amd64), const IP_NAT__XXX = 55 +pkg syscall (darwin-amd64), const IP_OFFMASK = 8191 +pkg syscall (darwin-amd64), const IP_OLD_FW_ADD = 50 +pkg syscall (darwin-amd64), const IP_OLD_FW_DEL = 51 +pkg syscall (darwin-amd64), const IP_OLD_FW_FLUSH = 52 +pkg syscall (darwin-amd64), const IP_OLD_FW_GET = 54 +pkg syscall (darwin-amd64), const IP_OLD_FW_RESETLOG = 56 +pkg syscall (darwin-amd64), const IP_OLD_FW_ZERO = 53 +pkg syscall (darwin-amd64), const IP_OPTIONS = 1 +pkg syscall (darwin-amd64), const IP_PKTINFO = 26 +pkg syscall (darwin-amd64), const IP_PORTRANGE = 19 +pkg syscall (darwin-amd64), const IP_PORTRANGE_DEFAULT = 0 +pkg syscall (darwin-amd64), const IP_PORTRANGE_HIGH = 1 +pkg syscall (darwin-amd64), const IP_PORTRANGE_LOW = 2 +pkg syscall (darwin-amd64), const IP_RECVDSTADDR = 7 +pkg syscall (darwin-amd64), const IP_RECVIF = 20 +pkg syscall (darwin-amd64), const IP_RECVOPTS = 5 +pkg syscall (darwin-amd64), const IP_RECVPKTINFO = 26 +pkg syscall (darwin-amd64), const IP_RECVRETOPTS = 6 +pkg syscall (darwin-amd64), const IP_RECVTTL = 24 +pkg syscall (darwin-amd64), const IP_RETOPTS = 8 +pkg syscall (darwin-amd64), const IP_RF = 32768 +pkg syscall (darwin-amd64), const IP_RSVP_OFF = 16 +pkg syscall (darwin-amd64), const IP_RSVP_ON = 15 +pkg syscall (darwin-amd64), const IP_RSVP_VIF_OFF = 18 +pkg syscall (darwin-amd64), const IP_RSVP_VIF_ON = 17 +pkg syscall (darwin-amd64), const IP_STRIPHDR = 23 +pkg syscall (darwin-amd64), const IP_TOS = 3 +pkg syscall (darwin-amd64), const IP_TRAFFIC_MGT_BACKGROUND = 65 +pkg syscall (darwin-amd64), const IP_TTL = 4 +pkg syscall (darwin-amd64), const IP_UNBLOCK_SOURCE = 73 +pkg syscall (darwin-amd64), const ISIG = 128 +pkg syscall (darwin-amd64), const ISIG ideal-int +pkg syscall (darwin-amd64), const ISTRIP = 32 +pkg syscall (darwin-amd64), const ISTRIP ideal-int +pkg syscall (darwin-amd64), const IUTF8 = 16384 +pkg syscall (darwin-amd64), const IUTF8 ideal-int +pkg syscall (darwin-amd64), const IXANY = 2048 +pkg syscall (darwin-amd64), const IXANY ideal-int +pkg syscall (darwin-amd64), const IXOFF = 1024 +pkg syscall (darwin-amd64), const IXOFF ideal-int +pkg syscall (darwin-amd64), const IXON = 512 +pkg syscall (darwin-amd64), const IXON ideal-int +pkg syscall (darwin-amd64), const ImplementsGetwd = false +pkg syscall (darwin-amd64), const LOCK_EX = 2 +pkg syscall (darwin-amd64), const LOCK_NB = 4 +pkg syscall (darwin-amd64), const LOCK_SH = 1 +pkg syscall (darwin-amd64), const LOCK_UN = 8 +pkg syscall (darwin-amd64), const MADV_CAN_REUSE = 9 +pkg syscall (darwin-amd64), const MADV_DONTNEED = 4 +pkg syscall (darwin-amd64), const MADV_FREE = 5 +pkg syscall (darwin-amd64), const MADV_FREE_REUSABLE = 7 +pkg syscall (darwin-amd64), const MADV_FREE_REUSE = 8 +pkg syscall (darwin-amd64), const MADV_NORMAL = 0 +pkg syscall (darwin-amd64), const MADV_RANDOM = 1 +pkg syscall (darwin-amd64), const MADV_SEQUENTIAL = 2 +pkg syscall (darwin-amd64), const MADV_WILLNEED = 3 +pkg syscall (darwin-amd64), const MADV_ZERO_WIRED_PAGES = 6 +pkg syscall (darwin-amd64), const MAP_ANON = 4096 +pkg syscall (darwin-amd64), const MAP_COPY = 2 +pkg syscall (darwin-amd64), const MAP_FILE = 0 +pkg syscall (darwin-amd64), const MAP_FIXED = 16 +pkg syscall (darwin-amd64), const MAP_HASSEMAPHORE = 512 +pkg syscall (darwin-amd64), const MAP_JIT = 2048 +pkg syscall (darwin-amd64), const MAP_NOCACHE = 1024 +pkg syscall (darwin-amd64), const MAP_NOEXTEND = 256 +pkg syscall (darwin-amd64), const MAP_NORESERVE = 64 +pkg syscall (darwin-amd64), const MAP_PRIVATE = 2 +pkg syscall (darwin-amd64), const MAP_RENAME = 32 +pkg syscall (darwin-amd64), const MAP_RESERVED0080 = 128 +pkg syscall (darwin-amd64), const MAP_SHARED = 1 +pkg syscall (darwin-amd64), const MCL_CURRENT = 1 +pkg syscall (darwin-amd64), const MCL_FUTURE = 2 +pkg syscall (darwin-amd64), const MSG_CTRUNC = 32 +pkg syscall (darwin-amd64), const MSG_DONTROUTE = 4 +pkg syscall (darwin-amd64), const MSG_DONTWAIT = 128 +pkg syscall (darwin-amd64), const MSG_EOF = 256 +pkg syscall (darwin-amd64), const MSG_EOR = 8 +pkg syscall (darwin-amd64), const MSG_FLUSH = 1024 +pkg syscall (darwin-amd64), const MSG_HAVEMORE = 8192 +pkg syscall (darwin-amd64), const MSG_HOLD = 2048 +pkg syscall (darwin-amd64), const MSG_NEEDSA = 65536 +pkg syscall (darwin-amd64), const MSG_OOB = 1 +pkg syscall (darwin-amd64), const MSG_PEEK = 2 +pkg syscall (darwin-amd64), const MSG_RCVMORE = 16384 +pkg syscall (darwin-amd64), const MSG_SEND = 4096 +pkg syscall (darwin-amd64), const MSG_TRUNC = 16 +pkg syscall (darwin-amd64), const MSG_WAITALL = 64 +pkg syscall (darwin-amd64), const MSG_WAITSTREAM = 512 +pkg syscall (darwin-amd64), const MS_ASYNC = 1 +pkg syscall (darwin-amd64), const MS_DEACTIVATE = 8 +pkg syscall (darwin-amd64), const MS_INVALIDATE = 2 +pkg syscall (darwin-amd64), const MS_KILLPAGES = 4 +pkg syscall (darwin-amd64), const MS_SYNC = 16 +pkg syscall (darwin-amd64), const NAME_MAX = 255 +pkg syscall (darwin-amd64), const NET_RT_DUMP = 1 +pkg syscall (darwin-amd64), const NET_RT_DUMP2 = 7 +pkg syscall (darwin-amd64), const NET_RT_FLAGS = 2 +pkg syscall (darwin-amd64), const NET_RT_IFLIST = 3 +pkg syscall (darwin-amd64), const NET_RT_IFLIST2 = 6 +pkg syscall (darwin-amd64), const NET_RT_MAXID = 10 +pkg syscall (darwin-amd64), const NET_RT_STAT = 4 +pkg syscall (darwin-amd64), const NET_RT_TRASH = 5 +pkg syscall (darwin-amd64), const NOFLSH = 2147483648 +pkg syscall (darwin-amd64), const NOFLSH ideal-int +pkg syscall (darwin-amd64), const NOTE_ABSOLUTE = 8 +pkg syscall (darwin-amd64), const NOTE_ATTRIB = 8 +pkg syscall (darwin-amd64), const NOTE_CHILD = 4 +pkg syscall (darwin-amd64), const NOTE_DELETE = 1 +pkg syscall (darwin-amd64), const NOTE_EXEC = 536870912 +pkg syscall (darwin-amd64), const NOTE_EXIT = 2147483648 +pkg syscall (darwin-amd64), const NOTE_EXITSTATUS = 67108864 +pkg syscall (darwin-amd64), const NOTE_EXTEND = 4 +pkg syscall (darwin-amd64), const NOTE_FFAND = 1073741824 +pkg syscall (darwin-amd64), const NOTE_FFCOPY = 3221225472 +pkg syscall (darwin-amd64), const NOTE_FFCTRLMASK = 3221225472 +pkg syscall (darwin-amd64), const NOTE_FFLAGSMASK = 16777215 +pkg syscall (darwin-amd64), const NOTE_FFNOP = 0 +pkg syscall (darwin-amd64), const NOTE_FFOR = 2147483648 +pkg syscall (darwin-amd64), const NOTE_FORK = 1073741824 +pkg syscall (darwin-amd64), const NOTE_LINK = 16 +pkg syscall (darwin-amd64), const NOTE_LOWAT = 1 +pkg syscall (darwin-amd64), const NOTE_NONE = 128 +pkg syscall (darwin-amd64), const NOTE_NSECONDS = 4 +pkg syscall (darwin-amd64), const NOTE_PCTRLMASK = -1048576 +pkg syscall (darwin-amd64), const NOTE_PDATAMASK = 1048575 +pkg syscall (darwin-amd64), const NOTE_REAP = 268435456 +pkg syscall (darwin-amd64), const NOTE_RENAME = 32 +pkg syscall (darwin-amd64), const NOTE_RESOURCEEND = 33554432 +pkg syscall (darwin-amd64), const NOTE_REVOKE = 64 +pkg syscall (darwin-amd64), const NOTE_SECONDS = 1 +pkg syscall (darwin-amd64), const NOTE_SIGNAL = 134217728 +pkg syscall (darwin-amd64), const NOTE_TRACK = 1 +pkg syscall (darwin-amd64), const NOTE_TRACKERR = 2 +pkg syscall (darwin-amd64), const NOTE_TRIGGER = 16777216 +pkg syscall (darwin-amd64), const NOTE_USECONDS = 2 +pkg syscall (darwin-amd64), const NOTE_VM_ERROR = 268435456 +pkg syscall (darwin-amd64), const NOTE_VM_PRESSURE = 2147483648 +pkg syscall (darwin-amd64), const NOTE_VM_PRESSURE_SUDDEN_TERMINATE = 536870912 +pkg syscall (darwin-amd64), const NOTE_VM_PRESSURE_TERMINATE = 1073741824 +pkg syscall (darwin-amd64), const NOTE_WRITE = 2 +pkg syscall (darwin-amd64), const OCRNL = 16 +pkg syscall (darwin-amd64), const OCRNL ideal-int +pkg syscall (darwin-amd64), const OFDEL = 131072 +pkg syscall (darwin-amd64), const OFDEL ideal-int +pkg syscall (darwin-amd64), const OFILL = 128 +pkg syscall (darwin-amd64), const OFILL ideal-int +pkg syscall (darwin-amd64), const ONLCR = 2 +pkg syscall (darwin-amd64), const ONLCR ideal-int +pkg syscall (darwin-amd64), const ONLRET = 64 +pkg syscall (darwin-amd64), const ONLRET ideal-int +pkg syscall (darwin-amd64), const ONOCR = 32 +pkg syscall (darwin-amd64), const ONOCR ideal-int +pkg syscall (darwin-amd64), const ONOEOT = 8 +pkg syscall (darwin-amd64), const ONOEOT ideal-int +pkg syscall (darwin-amd64), const OPOST = 1 +pkg syscall (darwin-amd64), const OPOST ideal-int +pkg syscall (darwin-amd64), const O_ACCMODE = 3 +pkg syscall (darwin-amd64), const O_ALERT = 536870912 +pkg syscall (darwin-amd64), const O_APPEND = 8 +pkg syscall (darwin-amd64), const O_ASYNC = 64 +pkg syscall (darwin-amd64), const O_CLOEXEC = 16777216 +pkg syscall (darwin-amd64), const O_CREAT = 512 +pkg syscall (darwin-amd64), const O_DIRECTORY = 1048576 +pkg syscall (darwin-amd64), const O_DSYNC = 4194304 +pkg syscall (darwin-amd64), const O_EVTONLY = 32768 +pkg syscall (darwin-amd64), const O_EXCL = 2048 +pkg syscall (darwin-amd64), const O_EXLOCK = 32 +pkg syscall (darwin-amd64), const O_FSYNC = 128 +pkg syscall (darwin-amd64), const O_NDELAY = 4 +pkg syscall (darwin-amd64), const O_NOCTTY = 131072 +pkg syscall (darwin-amd64), const O_NOFOLLOW = 256 +pkg syscall (darwin-amd64), const O_NONBLOCK = 4 +pkg syscall (darwin-amd64), const O_POPUP = 2147483648 +pkg syscall (darwin-amd64), const O_SHLOCK = 16 +pkg syscall (darwin-amd64), const O_SYMLINK = 2097152 +pkg syscall (darwin-amd64), const O_SYNC = 128 +pkg syscall (darwin-amd64), const O_TRUNC = 1024 +pkg syscall (darwin-amd64), const PARENB = 4096 +pkg syscall (darwin-amd64), const PARENB ideal-int +pkg syscall (darwin-amd64), const PARMRK = 8 +pkg syscall (darwin-amd64), const PARMRK ideal-int +pkg syscall (darwin-amd64), const PARODD = 8192 +pkg syscall (darwin-amd64), const PARODD ideal-int +pkg syscall (darwin-amd64), const PENDIN = 536870912 +pkg syscall (darwin-amd64), const PENDIN ideal-int +pkg syscall (darwin-amd64), const PROT_EXEC = 4 +pkg syscall (darwin-amd64), const PROT_NONE = 0 +pkg syscall (darwin-amd64), const PROT_READ = 1 +pkg syscall (darwin-amd64), const PROT_WRITE = 2 +pkg syscall (darwin-amd64), const PTRACE_CONT = 7 +pkg syscall (darwin-amd64), const PTRACE_KILL = 8 +pkg syscall (darwin-amd64), const PTRACE_TRACEME = 0 +pkg syscall (darwin-amd64), const PT_ATTACH = 10 +pkg syscall (darwin-amd64), const PT_ATTACHEXC = 14 +pkg syscall (darwin-amd64), const PT_CONTINUE = 7 +pkg syscall (darwin-amd64), const PT_DENY_ATTACH = 31 +pkg syscall (darwin-amd64), const PT_DETACH = 11 +pkg syscall (darwin-amd64), const PT_FIRSTMACH = 32 +pkg syscall (darwin-amd64), const PT_FORCEQUOTA = 30 +pkg syscall (darwin-amd64), const PT_KILL = 8 +pkg syscall (darwin-amd64), const PT_READ_D = 2 +pkg syscall (darwin-amd64), const PT_READ_I = 1 +pkg syscall (darwin-amd64), const PT_READ_U = 3 +pkg syscall (darwin-amd64), const PT_SIGEXC = 12 +pkg syscall (darwin-amd64), const PT_STEP = 9 +pkg syscall (darwin-amd64), const PT_THUPDATE = 13 +pkg syscall (darwin-amd64), const PT_TRACE_ME = 0 +pkg syscall (darwin-amd64), const PT_WRITE_D = 5 +pkg syscall (darwin-amd64), const PT_WRITE_I = 4 +pkg syscall (darwin-amd64), const PT_WRITE_U = 6 +pkg syscall (darwin-amd64), const RLIMIT_AS = 5 +pkg syscall (darwin-amd64), const RLIMIT_CORE = 4 +pkg syscall (darwin-amd64), const RLIMIT_CPU = 0 +pkg syscall (darwin-amd64), const RLIMIT_DATA = 2 +pkg syscall (darwin-amd64), const RLIMIT_FSIZE = 1 +pkg syscall (darwin-amd64), const RLIMIT_NOFILE = 8 +pkg syscall (darwin-amd64), const RLIMIT_STACK = 3 +pkg syscall (darwin-amd64), const RLIM_INFINITY = 9223372036854775807 +pkg syscall (darwin-amd64), const RTAX_AUTHOR = 6 +pkg syscall (darwin-amd64), const RTAX_BRD = 7 +pkg syscall (darwin-amd64), const RTAX_DST = 0 +pkg syscall (darwin-amd64), const RTAX_GATEWAY = 1 +pkg syscall (darwin-amd64), const RTAX_GENMASK = 3 +pkg syscall (darwin-amd64), const RTAX_IFA = 5 +pkg syscall (darwin-amd64), const RTAX_IFP = 4 +pkg syscall (darwin-amd64), const RTAX_MAX = 8 +pkg syscall (darwin-amd64), const RTAX_NETMASK = 2 +pkg syscall (darwin-amd64), const RTA_AUTHOR = 64 +pkg syscall (darwin-amd64), const RTA_BRD = 128 +pkg syscall (darwin-amd64), const RTA_DST = 1 +pkg syscall (darwin-amd64), const RTA_GATEWAY = 2 +pkg syscall (darwin-amd64), const RTA_GENMASK = 8 +pkg syscall (darwin-amd64), const RTA_IFA = 32 +pkg syscall (darwin-amd64), const RTA_IFP = 16 +pkg syscall (darwin-amd64), const RTA_NETMASK = 4 +pkg syscall (darwin-amd64), const RTF_BLACKHOLE = 4096 +pkg syscall (darwin-amd64), const RTF_BROADCAST = 4194304 +pkg syscall (darwin-amd64), const RTF_CLONING = 256 +pkg syscall (darwin-amd64), const RTF_CONDEMNED = 33554432 +pkg syscall (darwin-amd64), const RTF_DELCLONE = 128 +pkg syscall (darwin-amd64), const RTF_DONE = 64 +pkg syscall (darwin-amd64), const RTF_DYNAMIC = 16 +pkg syscall (darwin-amd64), const RTF_GATEWAY = 2 +pkg syscall (darwin-amd64), const RTF_HOST = 4 +pkg syscall (darwin-amd64), const RTF_IFREF = 67108864 +pkg syscall (darwin-amd64), const RTF_IFSCOPE = 16777216 +pkg syscall (darwin-amd64), const RTF_LLINFO = 1024 +pkg syscall (darwin-amd64), const RTF_LOCAL = 2097152 +pkg syscall (darwin-amd64), const RTF_MODIFIED = 32 +pkg syscall (darwin-amd64), const RTF_MULTICAST = 8388608 +pkg syscall (darwin-amd64), const RTF_PINNED = 1048576 +pkg syscall (darwin-amd64), const RTF_PRCLONING = 65536 +pkg syscall (darwin-amd64), const RTF_PROTO1 = 32768 +pkg syscall (darwin-amd64), const RTF_PROTO2 = 16384 +pkg syscall (darwin-amd64), const RTF_PROTO3 = 262144 +pkg syscall (darwin-amd64), const RTF_REJECT = 8 +pkg syscall (darwin-amd64), const RTF_STATIC = 2048 +pkg syscall (darwin-amd64), const RTF_UP = 1 +pkg syscall (darwin-amd64), const RTF_WASCLONED = 131072 +pkg syscall (darwin-amd64), const RTF_XRESOLVE = 512 +pkg syscall (darwin-amd64), const RTM_ADD = 1 +pkg syscall (darwin-amd64), const RTM_CHANGE = 3 +pkg syscall (darwin-amd64), const RTM_DELADDR = 13 +pkg syscall (darwin-amd64), const RTM_DELETE = 2 +pkg syscall (darwin-amd64), const RTM_DELMADDR = 16 +pkg syscall (darwin-amd64), const RTM_GET = 4 +pkg syscall (darwin-amd64), const RTM_GET2 = 20 +pkg syscall (darwin-amd64), const RTM_IFINFO = 14 +pkg syscall (darwin-amd64), const RTM_IFINFO2 = 18 +pkg syscall (darwin-amd64), const RTM_LOCK = 8 +pkg syscall (darwin-amd64), const RTM_LOSING = 5 +pkg syscall (darwin-amd64), const RTM_MISS = 7 +pkg syscall (darwin-amd64), const RTM_NEWADDR = 12 +pkg syscall (darwin-amd64), const RTM_NEWMADDR = 15 +pkg syscall (darwin-amd64), const RTM_NEWMADDR2 = 19 +pkg syscall (darwin-amd64), const RTM_OLDADD = 9 +pkg syscall (darwin-amd64), const RTM_OLDDEL = 10 +pkg syscall (darwin-amd64), const RTM_REDIRECT = 6 +pkg syscall (darwin-amd64), const RTM_RESOLVE = 11 +pkg syscall (darwin-amd64), const RTM_RTTUNIT = 1000000 +pkg syscall (darwin-amd64), const RTM_VERSION = 5 +pkg syscall (darwin-amd64), const RTV_EXPIRE = 4 +pkg syscall (darwin-amd64), const RTV_HOPCOUNT = 2 +pkg syscall (darwin-amd64), const RTV_MTU = 1 +pkg syscall (darwin-amd64), const RTV_RPIPE = 8 +pkg syscall (darwin-amd64), const RTV_RTT = 64 +pkg syscall (darwin-amd64), const RTV_RTTVAR = 128 +pkg syscall (darwin-amd64), const RTV_SPIPE = 16 +pkg syscall (darwin-amd64), const RTV_SSTHRESH = 32 +pkg syscall (darwin-amd64), const RUSAGE_CHILDREN = -1 +pkg syscall (darwin-amd64), const RUSAGE_SELF = 0 +pkg syscall (darwin-amd64), const SCM_CREDS = 3 +pkg syscall (darwin-amd64), const SCM_RIGHTS = 1 +pkg syscall (darwin-amd64), const SCM_TIMESTAMP = 2 +pkg syscall (darwin-amd64), const SCM_TIMESTAMP_MONOTONIC = 4 +pkg syscall (darwin-amd64), const SIGBUS = 10 +pkg syscall (darwin-amd64), const SIGCHLD = 20 +pkg syscall (darwin-amd64), const SIGCONT = 19 +pkg syscall (darwin-amd64), const SIGEMT = 7 +pkg syscall (darwin-amd64), const SIGINFO = 29 +pkg syscall (darwin-amd64), const SIGIO = 23 +pkg syscall (darwin-amd64), const SIGIOT = 6 +pkg syscall (darwin-amd64), const SIGPROF = 27 +pkg syscall (darwin-amd64), const SIGSTOP = 17 +pkg syscall (darwin-amd64), const SIGSYS = 12 +pkg syscall (darwin-amd64), const SIGTSTP = 18 +pkg syscall (darwin-amd64), const SIGTTIN = 21 +pkg syscall (darwin-amd64), const SIGTTOU = 22 +pkg syscall (darwin-amd64), const SIGURG = 16 +pkg syscall (darwin-amd64), const SIGUSR1 = 30 +pkg syscall (darwin-amd64), const SIGUSR2 = 31 +pkg syscall (darwin-amd64), const SIGVTALRM = 26 +pkg syscall (darwin-amd64), const SIGWINCH = 28 +pkg syscall (darwin-amd64), const SIGXCPU = 24 +pkg syscall (darwin-amd64), const SIGXFSZ = 25 +pkg syscall (darwin-amd64), const SIOCADDMULTI = 2149607729 +pkg syscall (darwin-amd64), const SIOCAIFADDR = 2151704858 +pkg syscall (darwin-amd64), const SIOCALIFADDR = 2165860637 +pkg syscall (darwin-amd64), const SIOCARPIPLL = 3223349544 +pkg syscall (darwin-amd64), const SIOCATMARK = 1074033415 +pkg syscall (darwin-amd64), const SIOCAUTOADDR = 3223349542 +pkg syscall (darwin-amd64), const SIOCAUTONETMASK = 2149607719 +pkg syscall (darwin-amd64), const SIOCDELMULTI = 2149607730 +pkg syscall (darwin-amd64), const SIOCDIFADDR = 2149607705 +pkg syscall (darwin-amd64), const SIOCDIFPHYADDR = 2149607745 +pkg syscall (darwin-amd64), const SIOCDLIFADDR = 2165860639 +pkg syscall (darwin-amd64), const SIOCGDRVSPEC = 3223873915 +pkg syscall (darwin-amd64), const SIOCGETSGCNT = 3222565404 +pkg syscall (darwin-amd64), const SIOCGETVIFCNT = 3222565403 +pkg syscall (darwin-amd64), const SIOCGETVLAN = 3223349631 +pkg syscall (darwin-amd64), const SIOCGHIWAT = 1074033409 +pkg syscall (darwin-amd64), const SIOCGIFADDR = 3223349537 +pkg syscall (darwin-amd64), const SIOCGIFALTMTU = 3223349576 +pkg syscall (darwin-amd64), const SIOCGIFASYNCMAP = 3223349628 +pkg syscall (darwin-amd64), const SIOCGIFBOND = 3223349575 +pkg syscall (darwin-amd64), const SIOCGIFBRDADDR = 3223349539 +pkg syscall (darwin-amd64), const SIOCGIFCAP = 3223349595 +pkg syscall (darwin-amd64), const SIOCGIFCONF = 3222038820 +pkg syscall (darwin-amd64), const SIOCGIFDEVMTU = 3223349572 +pkg syscall (darwin-amd64), const SIOCGIFDSTADDR = 3223349538 +pkg syscall (darwin-amd64), const SIOCGIFFLAGS = 3223349521 +pkg syscall (darwin-amd64), const SIOCGIFGENERIC = 3223349562 +pkg syscall (darwin-amd64), const SIOCGIFKPI = 3223349639 +pkg syscall (darwin-amd64), const SIOCGIFMAC = 3223349634 +pkg syscall (darwin-amd64), const SIOCGIFMEDIA = 3224135992 +pkg syscall (darwin-amd64), const SIOCGIFMETRIC = 3223349527 +pkg syscall (darwin-amd64), const SIOCGIFMTU = 3223349555 +pkg syscall (darwin-amd64), const SIOCGIFNETMASK = 3223349541 +pkg syscall (darwin-amd64), const SIOCGIFPDSTADDR = 3223349568 +pkg syscall (darwin-amd64), const SIOCGIFPHYS = 3223349557 +pkg syscall (darwin-amd64), const SIOCGIFPSRCADDR = 3223349567 +pkg syscall (darwin-amd64), const SIOCGIFSTATUS = 3274795325 +pkg syscall (darwin-amd64), const SIOCGIFVLAN = 3223349631 +pkg syscall (darwin-amd64), const SIOCGIFWAKEFLAGS = 3223349640 +pkg syscall (darwin-amd64), const SIOCGLIFADDR = 3239602462 +pkg syscall (darwin-amd64), const SIOCGLIFPHYADDR = 3239602499 +pkg syscall (darwin-amd64), const SIOCGLOWAT = 1074033411 +pkg syscall (darwin-amd64), const SIOCGPGRP = 1074033417 +pkg syscall (darwin-amd64), const SIOCIFCREATE = 3223349624 +pkg syscall (darwin-amd64), const SIOCIFCREATE2 = 3223349626 +pkg syscall (darwin-amd64), const SIOCIFDESTROY = 2149607801 +pkg syscall (darwin-amd64), const SIOCRSLVMULTI = 3222300987 +pkg syscall (darwin-amd64), const SIOCSDRVSPEC = 2150132091 +pkg syscall (darwin-amd64), const SIOCSETVLAN = 2149607806 +pkg syscall (darwin-amd64), const SIOCSHIWAT = 2147775232 +pkg syscall (darwin-amd64), const SIOCSIFADDR = 2149607692 +pkg syscall (darwin-amd64), const SIOCSIFALTMTU = 2149607749 +pkg syscall (darwin-amd64), const SIOCSIFASYNCMAP = 2149607805 +pkg syscall (darwin-amd64), const SIOCSIFBOND = 2149607750 +pkg syscall (darwin-amd64), const SIOCSIFBRDADDR = 2149607699 +pkg syscall (darwin-amd64), const SIOCSIFCAP = 2149607770 +pkg syscall (darwin-amd64), const SIOCSIFDSTADDR = 2149607694 +pkg syscall (darwin-amd64), const SIOCSIFFLAGS = 2149607696 +pkg syscall (darwin-amd64), const SIOCSIFGENERIC = 2149607737 +pkg syscall (darwin-amd64), const SIOCSIFKPI = 2149607814 +pkg syscall (darwin-amd64), const SIOCSIFLLADDR = 2149607740 +pkg syscall (darwin-amd64), const SIOCSIFMAC = 2149607811 +pkg syscall (darwin-amd64), const SIOCSIFMEDIA = 3223349559 +pkg syscall (darwin-amd64), const SIOCSIFMETRIC = 2149607704 +pkg syscall (darwin-amd64), const SIOCSIFMTU = 2149607732 +pkg syscall (darwin-amd64), const SIOCSIFNETMASK = 2149607702 +pkg syscall (darwin-amd64), const SIOCSIFPHYADDR = 2151704894 +pkg syscall (darwin-amd64), const SIOCSIFPHYS = 2149607734 +pkg syscall (darwin-amd64), const SIOCSIFVLAN = 2149607806 +pkg syscall (darwin-amd64), const SIOCSLIFPHYADDR = 2165860674 +pkg syscall (darwin-amd64), const SIOCSLOWAT = 2147775234 +pkg syscall (darwin-amd64), const SIOCSPGRP = 2147775240 +pkg syscall (darwin-amd64), const SOCK_MAXADDRLEN = 255 +pkg syscall (darwin-amd64), const SOCK_RDM = 4 +pkg syscall (darwin-amd64), const SOL_SOCKET = 65535 +pkg syscall (darwin-amd64), const SOMAXCONN = 128 +pkg syscall (darwin-amd64), const SO_ACCEPTCONN = 2 +pkg syscall (darwin-amd64), const SO_BROADCAST = 32 +pkg syscall (darwin-amd64), const SO_DEBUG = 1 +pkg syscall (darwin-amd64), const SO_DONTROUTE = 16 +pkg syscall (darwin-amd64), const SO_DONTTRUNC = 8192 +pkg syscall (darwin-amd64), const SO_ERROR = 4103 +pkg syscall (darwin-amd64), const SO_KEEPALIVE = 8 +pkg syscall (darwin-amd64), const SO_LABEL = 4112 +pkg syscall (darwin-amd64), const SO_LINGER = 128 +pkg syscall (darwin-amd64), const SO_LINGER_SEC = 4224 +pkg syscall (darwin-amd64), const SO_NKE = 4129 +pkg syscall (darwin-amd64), const SO_NOADDRERR = 4131 +pkg syscall (darwin-amd64), const SO_NOSIGPIPE = 4130 +pkg syscall (darwin-amd64), const SO_NOTIFYCONFLICT = 4134 +pkg syscall (darwin-amd64), const SO_NP_EXTENSIONS = 4227 +pkg syscall (darwin-amd64), const SO_NREAD = 4128 +pkg syscall (darwin-amd64), const SO_NWRITE = 4132 +pkg syscall (darwin-amd64), const SO_OOBINLINE = 256 +pkg syscall (darwin-amd64), const SO_PEERLABEL = 4113 +pkg syscall (darwin-amd64), const SO_RANDOMPORT = 4226 +pkg syscall (darwin-amd64), const SO_RCVBUF = 4098 +pkg syscall (darwin-amd64), const SO_RCVLOWAT = 4100 +pkg syscall (darwin-amd64), const SO_RCVTIMEO = 4102 +pkg syscall (darwin-amd64), const SO_RESTRICTIONS = 4225 +pkg syscall (darwin-amd64), const SO_RESTRICT_DENYIN = 1 +pkg syscall (darwin-amd64), const SO_RESTRICT_DENYOUT = 2 +pkg syscall (darwin-amd64), const SO_RESTRICT_DENYSET = 2147483648 +pkg syscall (darwin-amd64), const SO_REUSEADDR = 4 +pkg syscall (darwin-amd64), const SO_REUSEPORT = 512 +pkg syscall (darwin-amd64), const SO_REUSESHAREUID = 4133 +pkg syscall (darwin-amd64), const SO_SNDBUF = 4097 +pkg syscall (darwin-amd64), const SO_SNDLOWAT = 4099 +pkg syscall (darwin-amd64), const SO_SNDTIMEO = 4101 +pkg syscall (darwin-amd64), const SO_TIMESTAMP = 1024 +pkg syscall (darwin-amd64), const SO_TIMESTAMP_MONOTONIC = 2048 +pkg syscall (darwin-amd64), const SO_TYPE = 4104 +pkg syscall (darwin-amd64), const SO_UPCALLCLOSEWAIT = 4135 +pkg syscall (darwin-amd64), const SO_USELOOPBACK = 64 +pkg syscall (darwin-amd64), const SO_WANTMORE = 16384 +pkg syscall (darwin-amd64), const SO_WANTOOBFLAG = 32768 +pkg syscall (darwin-amd64), const SYS_ACCEPT = 30 +pkg syscall (darwin-amd64), const SYS_ACCEPT_NOCANCEL = 404 +pkg syscall (darwin-amd64), const SYS_ACCESS = 33 +pkg syscall (darwin-amd64), const SYS_ACCESS_EXTENDED = 284 +pkg syscall (darwin-amd64), const SYS_ACCT = 51 +pkg syscall (darwin-amd64), const SYS_ADD_PROFIL = 176 +pkg syscall (darwin-amd64), const SYS_ADJTIME = 140 +pkg syscall (darwin-amd64), const SYS_AIO_CANCEL = 316 +pkg syscall (darwin-amd64), const SYS_AIO_ERROR = 317 +pkg syscall (darwin-amd64), const SYS_AIO_FSYNC = 313 +pkg syscall (darwin-amd64), const SYS_AIO_READ = 318 +pkg syscall (darwin-amd64), const SYS_AIO_RETURN = 314 +pkg syscall (darwin-amd64), const SYS_AIO_SUSPEND = 315 +pkg syscall (darwin-amd64), const SYS_AIO_SUSPEND_NOCANCEL = 421 +pkg syscall (darwin-amd64), const SYS_AIO_WRITE = 319 +pkg syscall (darwin-amd64), const SYS_ATGETMSG = 207 +pkg syscall (darwin-amd64), const SYS_ATPGETREQ = 211 +pkg syscall (darwin-amd64), const SYS_ATPGETRSP = 212 +pkg syscall (darwin-amd64), const SYS_ATPSNDREQ = 209 +pkg syscall (darwin-amd64), const SYS_ATPSNDRSP = 210 +pkg syscall (darwin-amd64), const SYS_ATPUTMSG = 208 +pkg syscall (darwin-amd64), const SYS_ATSOCKET = 206 +pkg syscall (darwin-amd64), const SYS_AUDIT = 350 +pkg syscall (darwin-amd64), const SYS_AUDITCTL = 359 +pkg syscall (darwin-amd64), const SYS_AUDITON = 351 +pkg syscall (darwin-amd64), const SYS_AUDIT_SESSION_JOIN = 429 +pkg syscall (darwin-amd64), const SYS_AUDIT_SESSION_PORT = 432 +pkg syscall (darwin-amd64), const SYS_AUDIT_SESSION_SELF = 428 +pkg syscall (darwin-amd64), const SYS_BIND = 104 +pkg syscall (darwin-amd64), const SYS_BSDTHREAD_CREATE = 360 +pkg syscall (darwin-amd64), const SYS_BSDTHREAD_REGISTER = 366 +pkg syscall (darwin-amd64), const SYS_BSDTHREAD_TERMINATE = 361 +pkg syscall (darwin-amd64), const SYS_CHDIR = 12 +pkg syscall (darwin-amd64), const SYS_CHFLAGS = 34 +pkg syscall (darwin-amd64), const SYS_CHMOD = 15 +pkg syscall (darwin-amd64), const SYS_CHMOD_EXTENDED = 282 +pkg syscall (darwin-amd64), const SYS_CHOWN = 16 +pkg syscall (darwin-amd64), const SYS_CHROOT = 61 +pkg syscall (darwin-amd64), const SYS_CHUD = 185 +pkg syscall (darwin-amd64), const SYS_CLOSE = 6 +pkg syscall (darwin-amd64), const SYS_CLOSE_NOCANCEL = 399 +pkg syscall (darwin-amd64), const SYS_CONNECT = 98 +pkg syscall (darwin-amd64), const SYS_CONNECT_NOCANCEL = 409 +pkg syscall (darwin-amd64), const SYS_COPYFILE = 227 +pkg syscall (darwin-amd64), const SYS_CSOPS = 169 +pkg syscall (darwin-amd64), const SYS_DELETE = 226 +pkg syscall (darwin-amd64), const SYS_DUP = 41 +pkg syscall (darwin-amd64), const SYS_DUP2 = 90 +pkg syscall (darwin-amd64), const SYS_EXCHANGEDATA = 223 +pkg syscall (darwin-amd64), const SYS_EXECVE = 59 +pkg syscall (darwin-amd64), const SYS_EXIT = 1 +pkg syscall (darwin-amd64), const SYS_FCHDIR = 13 +pkg syscall (darwin-amd64), const SYS_FCHFLAGS = 35 +pkg syscall (darwin-amd64), const SYS_FCHMOD = 124 +pkg syscall (darwin-amd64), const SYS_FCHMOD_EXTENDED = 283 +pkg syscall (darwin-amd64), const SYS_FCHOWN = 123 +pkg syscall (darwin-amd64), const SYS_FCNTL = 92 +pkg syscall (darwin-amd64), const SYS_FCNTL_NOCANCEL = 406 +pkg syscall (darwin-amd64), const SYS_FDATASYNC = 187 +pkg syscall (darwin-amd64), const SYS_FFSCTL = 245 +pkg syscall (darwin-amd64), const SYS_FGETATTRLIST = 228 +pkg syscall (darwin-amd64), const SYS_FGETXATTR = 235 +pkg syscall (darwin-amd64), const SYS_FHOPEN = 248 +pkg syscall (darwin-amd64), const SYS_FILEPORT_MAKEFD = 431 +pkg syscall (darwin-amd64), const SYS_FILEPORT_MAKEPORT = 430 +pkg syscall (darwin-amd64), const SYS_FLISTXATTR = 241 +pkg syscall (darwin-amd64), const SYS_FLOCK = 131 +pkg syscall (darwin-amd64), const SYS_FORK = 2 +pkg syscall (darwin-amd64), const SYS_FPATHCONF = 192 +pkg syscall (darwin-amd64), const SYS_FREMOVEXATTR = 239 +pkg syscall (darwin-amd64), const SYS_FSCTL = 242 +pkg syscall (darwin-amd64), const SYS_FSETATTRLIST = 229 +pkg syscall (darwin-amd64), const SYS_FSETXATTR = 237 +pkg syscall (darwin-amd64), const SYS_FSGETPATH = 427 +pkg syscall (darwin-amd64), const SYS_FSTAT = 189 +pkg syscall (darwin-amd64), const SYS_FSTAT64 = 339 +pkg syscall (darwin-amd64), const SYS_FSTAT64_EXTENDED = 343 +pkg syscall (darwin-amd64), const SYS_FSTATFS = 158 +pkg syscall (darwin-amd64), const SYS_FSTATFS64 = 346 +pkg syscall (darwin-amd64), const SYS_FSTATV = 219 +pkg syscall (darwin-amd64), const SYS_FSTAT_EXTENDED = 281 +pkg syscall (darwin-amd64), const SYS_FSYNC = 95 +pkg syscall (darwin-amd64), const SYS_FSYNC_NOCANCEL = 408 +pkg syscall (darwin-amd64), const SYS_FTRUNCATE = 201 +pkg syscall (darwin-amd64), const SYS_FUTIMES = 139 +pkg syscall (darwin-amd64), const SYS_GETATTRLIST = 220 +pkg syscall (darwin-amd64), const SYS_GETAUDIT = 355 +pkg syscall (darwin-amd64), const SYS_GETAUDIT_ADDR = 357 +pkg syscall (darwin-amd64), const SYS_GETAUID = 353 +pkg syscall (darwin-amd64), const SYS_GETDIRENTRIES = 196 +pkg syscall (darwin-amd64), const SYS_GETDIRENTRIES64 = 344 +pkg syscall (darwin-amd64), const SYS_GETDIRENTRIESATTR = 222 +pkg syscall (darwin-amd64), const SYS_GETDTABLESIZE = 89 +pkg syscall (darwin-amd64), const SYS_GETEGID = 43 +pkg syscall (darwin-amd64), const SYS_GETEUID = 25 +pkg syscall (darwin-amd64), const SYS_GETFH = 161 +pkg syscall (darwin-amd64), const SYS_GETFSSTAT = 18 +pkg syscall (darwin-amd64), const SYS_GETFSSTAT64 = 347 +pkg syscall (darwin-amd64), const SYS_GETGID = 47 +pkg syscall (darwin-amd64), const SYS_GETGROUPS = 79 +pkg syscall (darwin-amd64), const SYS_GETHOSTUUID = 142 +pkg syscall (darwin-amd64), const SYS_GETITIMER = 86 +pkg syscall (darwin-amd64), const SYS_GETLCID = 395 +pkg syscall (darwin-amd64), const SYS_GETLOGIN = 49 +pkg syscall (darwin-amd64), const SYS_GETPEERNAME = 31 +pkg syscall (darwin-amd64), const SYS_GETPGID = 151 +pkg syscall (darwin-amd64), const SYS_GETPGRP = 81 +pkg syscall (darwin-amd64), const SYS_GETPID = 20 +pkg syscall (darwin-amd64), const SYS_GETPPID = 39 +pkg syscall (darwin-amd64), const SYS_GETPRIORITY = 100 +pkg syscall (darwin-amd64), const SYS_GETRLIMIT = 194 +pkg syscall (darwin-amd64), const SYS_GETRUSAGE = 117 +pkg syscall (darwin-amd64), const SYS_GETSGROUPS = 288 +pkg syscall (darwin-amd64), const SYS_GETSID = 310 +pkg syscall (darwin-amd64), const SYS_GETSOCKNAME = 32 +pkg syscall (darwin-amd64), const SYS_GETSOCKOPT = 118 +pkg syscall (darwin-amd64), const SYS_GETTID = 286 +pkg syscall (darwin-amd64), const SYS_GETTIMEOFDAY = 116 +pkg syscall (darwin-amd64), const SYS_GETUID = 24 +pkg syscall (darwin-amd64), const SYS_GETWGROUPS = 290 +pkg syscall (darwin-amd64), const SYS_GETXATTR = 234 +pkg syscall (darwin-amd64), const SYS_IDENTITYSVC = 293 +pkg syscall (darwin-amd64), const SYS_INITGROUPS = 243 +pkg syscall (darwin-amd64), const SYS_IOCTL = 54 +pkg syscall (darwin-amd64), const SYS_IOPOLICYSYS = 322 +pkg syscall (darwin-amd64), const SYS_ISSETUGID = 327 +pkg syscall (darwin-amd64), const SYS_KDEBUG_TRACE = 180 +pkg syscall (darwin-amd64), const SYS_KEVENT = 363 +pkg syscall (darwin-amd64), const SYS_KEVENT64 = 369 +pkg syscall (darwin-amd64), const SYS_KILL = 37 +pkg syscall (darwin-amd64), const SYS_KQUEUE = 362 +pkg syscall (darwin-amd64), const SYS_LCHOWN = 364 +pkg syscall (darwin-amd64), const SYS_LINK = 9 +pkg syscall (darwin-amd64), const SYS_LIO_LISTIO = 320 +pkg syscall (darwin-amd64), const SYS_LISTEN = 106 +pkg syscall (darwin-amd64), const SYS_LISTXATTR = 240 +pkg syscall (darwin-amd64), const SYS_LSEEK = 199 +pkg syscall (darwin-amd64), const SYS_LSTAT = 190 +pkg syscall (darwin-amd64), const SYS_LSTAT64 = 340 +pkg syscall (darwin-amd64), const SYS_LSTAT64_EXTENDED = 342 +pkg syscall (darwin-amd64), const SYS_LSTATV = 218 +pkg syscall (darwin-amd64), const SYS_LSTAT_EXTENDED = 280 +pkg syscall (darwin-amd64), const SYS_MADVISE = 75 +pkg syscall (darwin-amd64), const SYS_MAXSYSCALL = 439 +pkg syscall (darwin-amd64), const SYS_MINCORE = 78 +pkg syscall (darwin-amd64), const SYS_MINHERIT = 250 +pkg syscall (darwin-amd64), const SYS_MKCOMPLEX = 216 +pkg syscall (darwin-amd64), const SYS_MKDIR = 136 +pkg syscall (darwin-amd64), const SYS_MKDIR_EXTENDED = 292 +pkg syscall (darwin-amd64), const SYS_MKFIFO = 132 +pkg syscall (darwin-amd64), const SYS_MKFIFO_EXTENDED = 291 +pkg syscall (darwin-amd64), const SYS_MKNOD = 14 +pkg syscall (darwin-amd64), const SYS_MLOCK = 203 +pkg syscall (darwin-amd64), const SYS_MLOCKALL = 324 +pkg syscall (darwin-amd64), const SYS_MMAP = 197 +pkg syscall (darwin-amd64), const SYS_MODWATCH = 233 +pkg syscall (darwin-amd64), const SYS_MOUNT = 167 +pkg syscall (darwin-amd64), const SYS_MPROTECT = 74 +pkg syscall (darwin-amd64), const SYS_MSGCTL = 258 +pkg syscall (darwin-amd64), const SYS_MSGGET = 259 +pkg syscall (darwin-amd64), const SYS_MSGRCV = 261 +pkg syscall (darwin-amd64), const SYS_MSGRCV_NOCANCEL = 419 +pkg syscall (darwin-amd64), const SYS_MSGSND = 260 +pkg syscall (darwin-amd64), const SYS_MSGSND_NOCANCEL = 418 +pkg syscall (darwin-amd64), const SYS_MSGSYS = 252 +pkg syscall (darwin-amd64), const SYS_MSYNC = 65 +pkg syscall (darwin-amd64), const SYS_MSYNC_NOCANCEL = 405 +pkg syscall (darwin-amd64), const SYS_MUNLOCK = 204 +pkg syscall (darwin-amd64), const SYS_MUNLOCKALL = 325 +pkg syscall (darwin-amd64), const SYS_MUNMAP = 73 +pkg syscall (darwin-amd64), const SYS_NFSCLNT = 247 +pkg syscall (darwin-amd64), const SYS_NFSSVC = 155 +pkg syscall (darwin-amd64), const SYS_OPEN = 5 +pkg syscall (darwin-amd64), const SYS_OPEN_EXTENDED = 277 +pkg syscall (darwin-amd64), const SYS_OPEN_NOCANCEL = 398 +pkg syscall (darwin-amd64), const SYS_PATHCONF = 191 +pkg syscall (darwin-amd64), const SYS_PID_HIBERNATE = 435 +pkg syscall (darwin-amd64), const SYS_PID_RESUME = 434 +pkg syscall (darwin-amd64), const SYS_PID_SHUTDOWN_SOCKETS = 436 +pkg syscall (darwin-amd64), const SYS_PID_SUSPEND = 433 +pkg syscall (darwin-amd64), const SYS_PIPE = 42 +pkg syscall (darwin-amd64), const SYS_POLL = 230 +pkg syscall (darwin-amd64), const SYS_POLL_NOCANCEL = 417 +pkg syscall (darwin-amd64), const SYS_POSIX_SPAWN = 244 +pkg syscall (darwin-amd64), const SYS_PREAD = 153 +pkg syscall (darwin-amd64), const SYS_PREAD_NOCANCEL = 414 +pkg syscall (darwin-amd64), const SYS_PROCESS_POLICY = 323 +pkg syscall (darwin-amd64), const SYS_PROC_INFO = 336 +pkg syscall (darwin-amd64), const SYS_PROFIL = 44 +pkg syscall (darwin-amd64), const SYS_PSYNCH_CVBROAD = 303 +pkg syscall (darwin-amd64), const SYS_PSYNCH_CVCLRPREPOST = 312 +pkg syscall (darwin-amd64), const SYS_PSYNCH_CVSIGNAL = 304 +pkg syscall (darwin-amd64), const SYS_PSYNCH_CVWAIT = 305 +pkg syscall (darwin-amd64), const SYS_PSYNCH_MUTEXDROP = 302 +pkg syscall (darwin-amd64), const SYS_PSYNCH_MUTEXWAIT = 301 +pkg syscall (darwin-amd64), const SYS_PSYNCH_RW_DOWNGRADE = 299 +pkg syscall (darwin-amd64), const SYS_PSYNCH_RW_LONGRDLOCK = 297 +pkg syscall (darwin-amd64), const SYS_PSYNCH_RW_RDLOCK = 306 +pkg syscall (darwin-amd64), const SYS_PSYNCH_RW_UNLOCK = 308 +pkg syscall (darwin-amd64), const SYS_PSYNCH_RW_UNLOCK2 = 309 +pkg syscall (darwin-amd64), const SYS_PSYNCH_RW_UPGRADE = 300 +pkg syscall (darwin-amd64), const SYS_PSYNCH_RW_WRLOCK = 307 +pkg syscall (darwin-amd64), const SYS_PSYNCH_RW_YIELDWRLOCK = 298 +pkg syscall (darwin-amd64), const SYS_PTRACE = 26 +pkg syscall (darwin-amd64), const SYS_PWRITE = 154 +pkg syscall (darwin-amd64), const SYS_PWRITE_NOCANCEL = 415 +pkg syscall (darwin-amd64), const SYS_QUOTACTL = 165 +pkg syscall (darwin-amd64), const SYS_READ = 3 +pkg syscall (darwin-amd64), const SYS_READLINK = 58 +pkg syscall (darwin-amd64), const SYS_READV = 120 +pkg syscall (darwin-amd64), const SYS_READV_NOCANCEL = 411 +pkg syscall (darwin-amd64), const SYS_READ_NOCANCEL = 396 +pkg syscall (darwin-amd64), const SYS_REBOOT = 55 +pkg syscall (darwin-amd64), const SYS_RECVFROM = 29 +pkg syscall (darwin-amd64), const SYS_RECVFROM_NOCANCEL = 403 +pkg syscall (darwin-amd64), const SYS_RECVMSG = 27 +pkg syscall (darwin-amd64), const SYS_RECVMSG_NOCANCEL = 401 +pkg syscall (darwin-amd64), const SYS_REMOVEXATTR = 238 +pkg syscall (darwin-amd64), const SYS_RENAME = 128 +pkg syscall (darwin-amd64), const SYS_REVOKE = 56 +pkg syscall (darwin-amd64), const SYS_RMDIR = 137 +pkg syscall (darwin-amd64), const SYS_SEARCHFS = 225 +pkg syscall (darwin-amd64), const SYS_SELECT = 93 +pkg syscall (darwin-amd64), const SYS_SELECT_NOCANCEL = 407 +pkg syscall (darwin-amd64), const SYS_SEMCTL = 254 +pkg syscall (darwin-amd64), const SYS_SEMGET = 255 +pkg syscall (darwin-amd64), const SYS_SEMOP = 256 +pkg syscall (darwin-amd64), const SYS_SEMSYS = 251 +pkg syscall (darwin-amd64), const SYS_SEM_CLOSE = 269 +pkg syscall (darwin-amd64), const SYS_SEM_DESTROY = 276 +pkg syscall (darwin-amd64), const SYS_SEM_GETVALUE = 274 +pkg syscall (darwin-amd64), const SYS_SEM_INIT = 275 +pkg syscall (darwin-amd64), const SYS_SEM_OPEN = 268 +pkg syscall (darwin-amd64), const SYS_SEM_POST = 273 +pkg syscall (darwin-amd64), const SYS_SEM_TRYWAIT = 272 +pkg syscall (darwin-amd64), const SYS_SEM_UNLINK = 270 +pkg syscall (darwin-amd64), const SYS_SEM_WAIT = 271 +pkg syscall (darwin-amd64), const SYS_SEM_WAIT_NOCANCEL = 420 +pkg syscall (darwin-amd64), const SYS_SENDFILE = 337 +pkg syscall (darwin-amd64), const SYS_SENDMSG = 28 +pkg syscall (darwin-amd64), const SYS_SENDMSG_NOCANCEL = 402 +pkg syscall (darwin-amd64), const SYS_SENDTO = 133 +pkg syscall (darwin-amd64), const SYS_SENDTO_NOCANCEL = 413 +pkg syscall (darwin-amd64), const SYS_SETATTRLIST = 221 +pkg syscall (darwin-amd64), const SYS_SETAUDIT = 356 +pkg syscall (darwin-amd64), const SYS_SETAUDIT_ADDR = 358 +pkg syscall (darwin-amd64), const SYS_SETAUID = 354 +pkg syscall (darwin-amd64), const SYS_SETEGID = 182 +pkg syscall (darwin-amd64), const SYS_SETEUID = 183 +pkg syscall (darwin-amd64), const SYS_SETGID = 181 +pkg syscall (darwin-amd64), const SYS_SETGROUPS = 80 +pkg syscall (darwin-amd64), const SYS_SETITIMER = 83 +pkg syscall (darwin-amd64), const SYS_SETLCID = 394 +pkg syscall (darwin-amd64), const SYS_SETLOGIN = 50 +pkg syscall (darwin-amd64), const SYS_SETPGID = 82 +pkg syscall (darwin-amd64), const SYS_SETPRIORITY = 96 +pkg syscall (darwin-amd64), const SYS_SETPRIVEXEC = 152 +pkg syscall (darwin-amd64), const SYS_SETREGID = 127 +pkg syscall (darwin-amd64), const SYS_SETREUID = 126 +pkg syscall (darwin-amd64), const SYS_SETRLIMIT = 195 +pkg syscall (darwin-amd64), const SYS_SETSGROUPS = 287 +pkg syscall (darwin-amd64), const SYS_SETSID = 147 +pkg syscall (darwin-amd64), const SYS_SETSOCKOPT = 105 +pkg syscall (darwin-amd64), const SYS_SETTID = 285 +pkg syscall (darwin-amd64), const SYS_SETTID_WITH_PID = 311 +pkg syscall (darwin-amd64), const SYS_SETTIMEOFDAY = 122 +pkg syscall (darwin-amd64), const SYS_SETUID = 23 +pkg syscall (darwin-amd64), const SYS_SETWGROUPS = 289 +pkg syscall (darwin-amd64), const SYS_SETXATTR = 236 +pkg syscall (darwin-amd64), const SYS_SHARED_REGION_CHECK_NP = 294 +pkg syscall (darwin-amd64), const SYS_SHARED_REGION_MAP_AND_SLIDE_NP = 438 +pkg syscall (darwin-amd64), const SYS_SHMAT = 262 +pkg syscall (darwin-amd64), const SYS_SHMCTL = 263 +pkg syscall (darwin-amd64), const SYS_SHMDT = 264 +pkg syscall (darwin-amd64), const SYS_SHMGET = 265 +pkg syscall (darwin-amd64), const SYS_SHMSYS = 253 +pkg syscall (darwin-amd64), const SYS_SHM_OPEN = 266 +pkg syscall (darwin-amd64), const SYS_SHM_UNLINK = 267 +pkg syscall (darwin-amd64), const SYS_SHUTDOWN = 134 +pkg syscall (darwin-amd64), const SYS_SIGACTION = 46 +pkg syscall (darwin-amd64), const SYS_SIGALTSTACK = 53 +pkg syscall (darwin-amd64), const SYS_SIGPENDING = 52 +pkg syscall (darwin-amd64), const SYS_SIGPROCMASK = 48 +pkg syscall (darwin-amd64), const SYS_SIGRETURN = 184 +pkg syscall (darwin-amd64), const SYS_SIGSUSPEND = 111 +pkg syscall (darwin-amd64), const SYS_SIGSUSPEND_NOCANCEL = 410 +pkg syscall (darwin-amd64), const SYS_SOCKET = 97 +pkg syscall (darwin-amd64), const SYS_SOCKETPAIR = 135 +pkg syscall (darwin-amd64), const SYS_STACK_SNAPSHOT = 365 +pkg syscall (darwin-amd64), const SYS_STAT = 188 +pkg syscall (darwin-amd64), const SYS_STAT64 = 338 +pkg syscall (darwin-amd64), const SYS_STAT64_EXTENDED = 341 +pkg syscall (darwin-amd64), const SYS_STATFS = 157 +pkg syscall (darwin-amd64), const SYS_STATFS64 = 345 +pkg syscall (darwin-amd64), const SYS_STATV = 217 +pkg syscall (darwin-amd64), const SYS_STAT_EXTENDED = 279 +pkg syscall (darwin-amd64), const SYS_SWAPON = 85 +pkg syscall (darwin-amd64), const SYS_SYMLINK = 57 +pkg syscall (darwin-amd64), const SYS_SYNC = 36 +pkg syscall (darwin-amd64), const SYS_SYSCALL = 0 +pkg syscall (darwin-amd64), const SYS_THREAD_SELFID = 372 +pkg syscall (darwin-amd64), const SYS_TRUNCATE = 200 +pkg syscall (darwin-amd64), const SYS_UMASK = 60 +pkg syscall (darwin-amd64), const SYS_UMASK_EXTENDED = 278 +pkg syscall (darwin-amd64), const SYS_UNDELETE = 205 +pkg syscall (darwin-amd64), const SYS_UNLINK = 10 +pkg syscall (darwin-amd64), const SYS_UNMOUNT = 159 +pkg syscall (darwin-amd64), const SYS_UTIMES = 138 +pkg syscall (darwin-amd64), const SYS_VFORK = 66 +pkg syscall (darwin-amd64), const SYS_VM_PRESSURE_MONITOR = 296 +pkg syscall (darwin-amd64), const SYS_WAIT4 = 7 +pkg syscall (darwin-amd64), const SYS_WAIT4_NOCANCEL = 400 +pkg syscall (darwin-amd64), const SYS_WAITEVENT = 232 +pkg syscall (darwin-amd64), const SYS_WAITID = 173 +pkg syscall (darwin-amd64), const SYS_WAITID_NOCANCEL = 416 +pkg syscall (darwin-amd64), const SYS_WATCHEVENT = 231 +pkg syscall (darwin-amd64), const SYS_WORKQ_KERNRETURN = 368 +pkg syscall (darwin-amd64), const SYS_WORKQ_OPEN = 367 +pkg syscall (darwin-amd64), const SYS_WRITE = 4 +pkg syscall (darwin-amd64), const SYS_WRITEV = 121 +pkg syscall (darwin-amd64), const SYS_WRITEV_NOCANCEL = 412 +pkg syscall (darwin-amd64), const SYS_WRITE_NOCANCEL = 397 +pkg syscall (darwin-amd64), const SYS___DISABLE_THREADSIGNAL = 331 +pkg syscall (darwin-amd64), const SYS___MAC_EXECVE = 380 +pkg syscall (darwin-amd64), const SYS___MAC_GETFSSTAT = 426 +pkg syscall (darwin-amd64), const SYS___MAC_GET_FD = 388 +pkg syscall (darwin-amd64), const SYS___MAC_GET_FILE = 382 +pkg syscall (darwin-amd64), const SYS___MAC_GET_LCID = 391 +pkg syscall (darwin-amd64), const SYS___MAC_GET_LCTX = 392 +pkg syscall (darwin-amd64), const SYS___MAC_GET_LINK = 384 +pkg syscall (darwin-amd64), const SYS___MAC_GET_MOUNT = 425 +pkg syscall (darwin-amd64), const SYS___MAC_GET_PID = 390 +pkg syscall (darwin-amd64), const SYS___MAC_GET_PROC = 386 +pkg syscall (darwin-amd64), const SYS___MAC_MOUNT = 424 +pkg syscall (darwin-amd64), const SYS___MAC_SET_FD = 389 +pkg syscall (darwin-amd64), const SYS___MAC_SET_FILE = 383 +pkg syscall (darwin-amd64), const SYS___MAC_SET_LCTX = 393 +pkg syscall (darwin-amd64), const SYS___MAC_SET_LINK = 385 +pkg syscall (darwin-amd64), const SYS___MAC_SET_PROC = 387 +pkg syscall (darwin-amd64), const SYS___MAC_SYSCALL = 381 +pkg syscall (darwin-amd64), const SYS___OLD_SEMWAIT_SIGNAL = 370 +pkg syscall (darwin-amd64), const SYS___OLD_SEMWAIT_SIGNAL_NOCANCEL = 371 +pkg syscall (darwin-amd64), const SYS___PTHREAD_CANCELED = 333 +pkg syscall (darwin-amd64), const SYS___PTHREAD_CHDIR = 348 +pkg syscall (darwin-amd64), const SYS___PTHREAD_FCHDIR = 349 +pkg syscall (darwin-amd64), const SYS___PTHREAD_KILL = 328 +pkg syscall (darwin-amd64), const SYS___PTHREAD_MARKCANCEL = 332 +pkg syscall (darwin-amd64), const SYS___PTHREAD_SIGMASK = 329 +pkg syscall (darwin-amd64), const SYS___SEMWAIT_SIGNAL = 334 +pkg syscall (darwin-amd64), const SYS___SEMWAIT_SIGNAL_NOCANCEL = 423 +pkg syscall (darwin-amd64), const SYS___SIGWAIT = 330 +pkg syscall (darwin-amd64), const SYS___SIGWAIT_NOCANCEL = 422 +pkg syscall (darwin-amd64), const SYS___SYSCTL = 202 +pkg syscall (darwin-amd64), const S_IEXEC = 64 +pkg syscall (darwin-amd64), const S_IFMT = 61440 +pkg syscall (darwin-amd64), const S_IFWHT = 57344 +pkg syscall (darwin-amd64), const S_IREAD = 256 +pkg syscall (darwin-amd64), const S_IRGRP = 32 +pkg syscall (darwin-amd64), const S_IROTH = 4 +pkg syscall (darwin-amd64), const S_IRWXG = 56 +pkg syscall (darwin-amd64), const S_IRWXO = 7 +pkg syscall (darwin-amd64), const S_IRWXU = 448 +pkg syscall (darwin-amd64), const S_ISTXT = 512 +pkg syscall (darwin-amd64), const S_IWGRP = 16 +pkg syscall (darwin-amd64), const S_IWOTH = 2 +pkg syscall (darwin-amd64), const S_IWRITE = 128 +pkg syscall (darwin-amd64), const S_IXGRP = 8 +pkg syscall (darwin-amd64), const S_IXOTH = 1 +pkg syscall (darwin-amd64), const SizeofBpfHdr = 20 +pkg syscall (darwin-amd64), const SizeofBpfInsn = 8 +pkg syscall (darwin-amd64), const SizeofBpfProgram = 16 +pkg syscall (darwin-amd64), const SizeofBpfStat = 8 +pkg syscall (darwin-amd64), const SizeofBpfVersion = 4 +pkg syscall (darwin-amd64), const SizeofCmsghdr = 12 +pkg syscall (darwin-amd64), const SizeofIPMreq = 8 +pkg syscall (darwin-amd64), const SizeofIPv6Mreq = 20 +pkg syscall (darwin-amd64), const SizeofIfData = 96 +pkg syscall (darwin-amd64), const SizeofIfMsghdr = 112 +pkg syscall (darwin-amd64), const SizeofIfaMsghdr = 20 +pkg syscall (darwin-amd64), const SizeofIfmaMsghdr = 16 +pkg syscall (darwin-amd64), const SizeofIfmaMsghdr2 = 20 +pkg syscall (darwin-amd64), const SizeofInet4Pktinfo = 12 +pkg syscall (darwin-amd64), const SizeofInet4Pktinfo ideal-int +pkg syscall (darwin-amd64), const SizeofInet6Pktinfo = 20 +pkg syscall (darwin-amd64), const SizeofLinger = 8 +pkg syscall (darwin-amd64), const SizeofMsghdr = 48 +pkg syscall (darwin-amd64), const SizeofRtMetrics = 56 +pkg syscall (darwin-amd64), const SizeofRtMsghdr = 92 +pkg syscall (darwin-amd64), const SizeofSockaddrAny = 108 +pkg syscall (darwin-amd64), const SizeofSockaddrDatalink = 20 +pkg syscall (darwin-amd64), const SizeofSockaddrInet4 = 16 +pkg syscall (darwin-amd64), const SizeofSockaddrInet6 = 28 +pkg syscall (darwin-amd64), const SizeofSockaddrUnix = 106 +pkg syscall (darwin-amd64), const TCIFLUSH = 1 +pkg syscall (darwin-amd64), const TCIFLUSH ideal-int +pkg syscall (darwin-amd64), const TCIOFLUSH = 3 +pkg syscall (darwin-amd64), const TCIOFLUSH ideal-int +pkg syscall (darwin-amd64), const TCOFLUSH = 2 +pkg syscall (darwin-amd64), const TCOFLUSH ideal-int +pkg syscall (darwin-amd64), const TCP_CONNECTIONTIMEOUT = 32 +pkg syscall (darwin-amd64), const TCP_KEEPALIVE = 16 +pkg syscall (darwin-amd64), const TCP_MAXHLEN = 60 +pkg syscall (darwin-amd64), const TCP_MAXOLEN = 40 +pkg syscall (darwin-amd64), const TCP_MAXSEG = 2 +pkg syscall (darwin-amd64), const TCP_MAXWIN = 65535 +pkg syscall (darwin-amd64), const TCP_MAX_SACK = 3 +pkg syscall (darwin-amd64), const TCP_MAX_WINSHIFT = 14 +pkg syscall (darwin-amd64), const TCP_MINMSS = 216 +pkg syscall (darwin-amd64), const TCP_MINMSSOVERLOAD = 1000 +pkg syscall (darwin-amd64), const TCP_MSS = 512 +pkg syscall (darwin-amd64), const TCP_NOOPT = 8 +pkg syscall (darwin-amd64), const TCP_NOPUSH = 4 +pkg syscall (darwin-amd64), const TCP_RXT_CONNDROPTIME = 128 +pkg syscall (darwin-amd64), const TCP_RXT_FINDROP = 256 +pkg syscall (darwin-amd64), const TCSAFLUSH = 2 +pkg syscall (darwin-amd64), const TCSAFLUSH ideal-int +pkg syscall (darwin-amd64), const TIOCCBRK = 536900730 +pkg syscall (darwin-amd64), const TIOCCDTR = 536900728 +pkg syscall (darwin-amd64), const TIOCCONS = 2147775586 +pkg syscall (darwin-amd64), const TIOCDCDTIMESTAMP = 1074820184 +pkg syscall (darwin-amd64), const TIOCDRAIN = 536900702 +pkg syscall (darwin-amd64), const TIOCDSIMICROCODE = 536900693 +pkg syscall (darwin-amd64), const TIOCEXCL = 536900621 +pkg syscall (darwin-amd64), const TIOCEXT = 2147775584 +pkg syscall (darwin-amd64), const TIOCFLUSH = 2147775504 +pkg syscall (darwin-amd64), const TIOCGDRAINWAIT = 1074033750 +pkg syscall (darwin-amd64), const TIOCGETA = 1078490131 +pkg syscall (darwin-amd64), const TIOCGETD = 1074033690 +pkg syscall (darwin-amd64), const TIOCGPGRP = 1074033783 +pkg syscall (darwin-amd64), const TIOCGWINSZ = 1074295912 +pkg syscall (darwin-amd64), const TIOCIXOFF = 536900736 +pkg syscall (darwin-amd64), const TIOCIXON = 536900737 +pkg syscall (darwin-amd64), const TIOCMBIC = 2147775595 +pkg syscall (darwin-amd64), const TIOCMBIS = 2147775596 +pkg syscall (darwin-amd64), const TIOCMGDTRWAIT = 1074033754 +pkg syscall (darwin-amd64), const TIOCMGET = 1074033770 +pkg syscall (darwin-amd64), const TIOCMODG = 1074033667 +pkg syscall (darwin-amd64), const TIOCMODS = 2147775492 +pkg syscall (darwin-amd64), const TIOCMSDTRWAIT = 2147775579 +pkg syscall (darwin-amd64), const TIOCMSET = 2147775597 +pkg syscall (darwin-amd64), const TIOCM_CAR = 64 +pkg syscall (darwin-amd64), const TIOCM_CD = 64 +pkg syscall (darwin-amd64), const TIOCM_CTS = 32 +pkg syscall (darwin-amd64), const TIOCM_DSR = 256 +pkg syscall (darwin-amd64), const TIOCM_DTR = 2 +pkg syscall (darwin-amd64), const TIOCM_LE = 1 +pkg syscall (darwin-amd64), const TIOCM_RI = 128 +pkg syscall (darwin-amd64), const TIOCM_RNG = 128 +pkg syscall (darwin-amd64), const TIOCM_RTS = 4 +pkg syscall (darwin-amd64), const TIOCM_SR = 16 +pkg syscall (darwin-amd64), const TIOCM_ST = 8 +pkg syscall (darwin-amd64), const TIOCNOTTY = 536900721 +pkg syscall (darwin-amd64), const TIOCNXCL = 536900622 +pkg syscall (darwin-amd64), const TIOCOUTQ = 1074033779 +pkg syscall (darwin-amd64), const TIOCPKT = 2147775600 +pkg syscall (darwin-amd64), const TIOCPKT_DATA = 0 +pkg syscall (darwin-amd64), const TIOCPKT_DOSTOP = 32 +pkg syscall (darwin-amd64), const TIOCPKT_FLUSHREAD = 1 +pkg syscall (darwin-amd64), const TIOCPKT_FLUSHWRITE = 2 +pkg syscall (darwin-amd64), const TIOCPKT_IOCTL = 64 +pkg syscall (darwin-amd64), const TIOCPKT_NOSTOP = 16 +pkg syscall (darwin-amd64), const TIOCPKT_START = 8 +pkg syscall (darwin-amd64), const TIOCPKT_STOP = 4 +pkg syscall (darwin-amd64), const TIOCPTYGNAME = 1082160211 +pkg syscall (darwin-amd64), const TIOCPTYGRANT = 536900692 +pkg syscall (darwin-amd64), const TIOCPTYUNLK = 536900690 +pkg syscall (darwin-amd64), const TIOCREMOTE = 2147775593 +pkg syscall (darwin-amd64), const TIOCSBRK = 536900731 +pkg syscall (darwin-amd64), const TIOCSCONS = 536900707 +pkg syscall (darwin-amd64), const TIOCSCTTY = 536900705 +pkg syscall (darwin-amd64), const TIOCSDRAINWAIT = 2147775575 +pkg syscall (darwin-amd64), const TIOCSDTR = 536900729 +pkg syscall (darwin-amd64), const TIOCSETA = 2152231956 +pkg syscall (darwin-amd64), const TIOCSETAF = 2152231958 +pkg syscall (darwin-amd64), const TIOCSETAW = 2152231957 +pkg syscall (darwin-amd64), const TIOCSETD = 2147775515 +pkg syscall (darwin-amd64), const TIOCSIG = 536900703 +pkg syscall (darwin-amd64), const TIOCSPGRP = 2147775606 +pkg syscall (darwin-amd64), const TIOCSTART = 536900718 +pkg syscall (darwin-amd64), const TIOCSTAT = 536900709 +pkg syscall (darwin-amd64), const TIOCSTI = 2147578994 +pkg syscall (darwin-amd64), const TIOCSTOP = 536900719 +pkg syscall (darwin-amd64), const TIOCSWINSZ = 2148037735 +pkg syscall (darwin-amd64), const TIOCTIMESTAMP = 1074820185 +pkg syscall (darwin-amd64), const TIOCUCNTL = 2147775590 +pkg syscall (darwin-amd64), const TOSTOP = 4194304 +pkg syscall (darwin-amd64), const TOSTOP ideal-int +pkg syscall (darwin-amd64), const VDISCARD = 15 +pkg syscall (darwin-amd64), const VDISCARD ideal-int +pkg syscall (darwin-amd64), const VDSUSP = 11 +pkg syscall (darwin-amd64), const VDSUSP ideal-int +pkg syscall (darwin-amd64), const VEOF = 0 +pkg syscall (darwin-amd64), const VEOF ideal-int +pkg syscall (darwin-amd64), const VEOL = 1 +pkg syscall (darwin-amd64), const VEOL ideal-int +pkg syscall (darwin-amd64), const VEOL2 = 2 +pkg syscall (darwin-amd64), const VEOL2 ideal-int +pkg syscall (darwin-amd64), const VERASE = 3 +pkg syscall (darwin-amd64), const VERASE ideal-int +pkg syscall (darwin-amd64), const VINTR = 8 +pkg syscall (darwin-amd64), const VINTR ideal-int +pkg syscall (darwin-amd64), const VKILL = 5 +pkg syscall (darwin-amd64), const VKILL ideal-int +pkg syscall (darwin-amd64), const VLNEXT = 14 +pkg syscall (darwin-amd64), const VLNEXT ideal-int +pkg syscall (darwin-amd64), const VMIN = 16 +pkg syscall (darwin-amd64), const VMIN ideal-int +pkg syscall (darwin-amd64), const VQUIT = 9 +pkg syscall (darwin-amd64), const VQUIT ideal-int +pkg syscall (darwin-amd64), const VREPRINT = 6 +pkg syscall (darwin-amd64), const VREPRINT ideal-int +pkg syscall (darwin-amd64), const VSTART = 12 +pkg syscall (darwin-amd64), const VSTART ideal-int +pkg syscall (darwin-amd64), const VSTATUS = 18 +pkg syscall (darwin-amd64), const VSTATUS ideal-int +pkg syscall (darwin-amd64), const VSTOP = 13 +pkg syscall (darwin-amd64), const VSTOP ideal-int +pkg syscall (darwin-amd64), const VSUSP = 10 +pkg syscall (darwin-amd64), const VSUSP ideal-int +pkg syscall (darwin-amd64), const VT0 = 0 +pkg syscall (darwin-amd64), const VT0 ideal-int +pkg syscall (darwin-amd64), const VT1 = 65536 +pkg syscall (darwin-amd64), const VT1 ideal-int +pkg syscall (darwin-amd64), const VTDLY = 65536 +pkg syscall (darwin-amd64), const VTDLY ideal-int +pkg syscall (darwin-amd64), const VTIME = 17 +pkg syscall (darwin-amd64), const VTIME ideal-int +pkg syscall (darwin-amd64), const VWERASE = 4 +pkg syscall (darwin-amd64), const VWERASE ideal-int +pkg syscall (darwin-amd64), const WCONTINUED = 16 +pkg syscall (darwin-amd64), const WCOREFLAG = 128 +pkg syscall (darwin-amd64), const WEXITED = 4 +pkg syscall (darwin-amd64), const WNOHANG = 1 +pkg syscall (darwin-amd64), const WNOWAIT = 32 +pkg syscall (darwin-amd64), const WORDSIZE = 64 +pkg syscall (darwin-amd64), const WSTOPPED = 8 +pkg syscall (darwin-amd64), const WUNTRACED = 2 +pkg syscall (darwin-amd64), func Fchflags(int, int) error +pkg syscall (darwin-amd64), func SlicePtrFromStrings([]string) ([]*uint8, error) +pkg syscall (darwin-amd64), type Inet4Pktinfo struct +pkg syscall (darwin-amd64), type Inet4Pktinfo struct, Addr [4]uint8 +pkg syscall (darwin-amd64), type Inet4Pktinfo struct, Ifindex uint32 +pkg syscall (darwin-amd64), type Inet4Pktinfo struct, Spec_dst [4]uint8 +pkg syscall (darwin-amd64), type Termios struct +pkg syscall (darwin-amd64), type Termios struct, Cc [20]uint8 +pkg syscall (darwin-amd64), type Termios struct, Cflag uint64 +pkg syscall (darwin-amd64), type Termios struct, Iflag uint64 +pkg syscall (darwin-amd64), type Termios struct, Ispeed uint64 +pkg syscall (darwin-amd64), type Termios struct, Lflag uint64 +pkg syscall (darwin-amd64), type Termios struct, Oflag uint64 +pkg syscall (darwin-amd64), type Termios struct, Ospeed uint64 +pkg syscall (darwin-amd64), type Termios struct, Pad_cgo_0 [4]uint8 +pkg syscall (darwin-amd64-cgo), const AF_APPLETALK = 16 +pkg syscall (darwin-amd64-cgo), const AF_CCITT = 10 +pkg syscall (darwin-amd64-cgo), const AF_CHAOS = 5 +pkg syscall (darwin-amd64-cgo), const AF_CNT = 21 +pkg syscall (darwin-amd64-cgo), const AF_COIP = 20 +pkg syscall (darwin-amd64-cgo), const AF_DATAKIT = 9 +pkg syscall (darwin-amd64-cgo), const AF_DECnet = 12 +pkg syscall (darwin-amd64-cgo), const AF_DLI = 13 +pkg syscall (darwin-amd64-cgo), const AF_E164 = 28 +pkg syscall (darwin-amd64-cgo), const AF_ECMA = 8 +pkg syscall (darwin-amd64-cgo), const AF_HYLINK = 15 +pkg syscall (darwin-amd64-cgo), const AF_IEEE80211 = 37 +pkg syscall (darwin-amd64-cgo), const AF_IMPLINK = 3 +pkg syscall (darwin-amd64-cgo), const AF_INET6 = 30 +pkg syscall (darwin-amd64-cgo), const AF_IPX = 23 +pkg syscall (darwin-amd64-cgo), const AF_ISDN = 28 +pkg syscall (darwin-amd64-cgo), const AF_ISO = 7 +pkg syscall (darwin-amd64-cgo), const AF_LAT = 14 +pkg syscall (darwin-amd64-cgo), const AF_LINK = 18 +pkg syscall (darwin-amd64-cgo), const AF_LOCAL = 1 +pkg syscall (darwin-amd64-cgo), const AF_MAX = 38 +pkg syscall (darwin-amd64-cgo), const AF_NATM = 31 +pkg syscall (darwin-amd64-cgo), const AF_NDRV = 27 +pkg syscall (darwin-amd64-cgo), const AF_NETBIOS = 33 +pkg syscall (darwin-amd64-cgo), const AF_NS = 6 +pkg syscall (darwin-amd64-cgo), const AF_OSI = 7 +pkg syscall (darwin-amd64-cgo), const AF_PPP = 34 +pkg syscall (darwin-amd64-cgo), const AF_PUP = 4 +pkg syscall (darwin-amd64-cgo), const AF_RESERVED_36 = 36 +pkg syscall (darwin-amd64-cgo), const AF_ROUTE = 17 +pkg syscall (darwin-amd64-cgo), const AF_SIP = 24 +pkg syscall (darwin-amd64-cgo), const AF_SNA = 11 +pkg syscall (darwin-amd64-cgo), const AF_SYSTEM = 32 +pkg syscall (darwin-amd64-cgo), const B0 = 0 +pkg syscall (darwin-amd64-cgo), const B0 ideal-int +pkg syscall (darwin-amd64-cgo), const B110 = 110 +pkg syscall (darwin-amd64-cgo), const B110 ideal-int +pkg syscall (darwin-amd64-cgo), const B115200 = 115200 +pkg syscall (darwin-amd64-cgo), const B115200 ideal-int +pkg syscall (darwin-amd64-cgo), const B1200 = 1200 +pkg syscall (darwin-amd64-cgo), const B1200 ideal-int +pkg syscall (darwin-amd64-cgo), const B134 = 134 +pkg syscall (darwin-amd64-cgo), const B134 ideal-int +pkg syscall (darwin-amd64-cgo), const B14400 = 14400 +pkg syscall (darwin-amd64-cgo), const B14400 ideal-int +pkg syscall (darwin-amd64-cgo), const B150 = 150 +pkg syscall (darwin-amd64-cgo), const B150 ideal-int +pkg syscall (darwin-amd64-cgo), const B1800 = 1800 +pkg syscall (darwin-amd64-cgo), const B1800 ideal-int +pkg syscall (darwin-amd64-cgo), const B19200 = 19200 +pkg syscall (darwin-amd64-cgo), const B19200 ideal-int +pkg syscall (darwin-amd64-cgo), const B200 = 200 +pkg syscall (darwin-amd64-cgo), const B200 ideal-int +pkg syscall (darwin-amd64-cgo), const B230400 = 230400 +pkg syscall (darwin-amd64-cgo), const B230400 ideal-int +pkg syscall (darwin-amd64-cgo), const B2400 = 2400 +pkg syscall (darwin-amd64-cgo), const B2400 ideal-int +pkg syscall (darwin-amd64-cgo), const B28800 = 28800 +pkg syscall (darwin-amd64-cgo), const B28800 ideal-int +pkg syscall (darwin-amd64-cgo), const B300 = 300 +pkg syscall (darwin-amd64-cgo), const B300 ideal-int +pkg syscall (darwin-amd64-cgo), const B38400 = 38400 +pkg syscall (darwin-amd64-cgo), const B38400 ideal-int +pkg syscall (darwin-amd64-cgo), const B4800 = 4800 +pkg syscall (darwin-amd64-cgo), const B4800 ideal-int +pkg syscall (darwin-amd64-cgo), const B50 = 50 +pkg syscall (darwin-amd64-cgo), const B50 ideal-int +pkg syscall (darwin-amd64-cgo), const B57600 = 57600 +pkg syscall (darwin-amd64-cgo), const B57600 ideal-int +pkg syscall (darwin-amd64-cgo), const B600 = 600 +pkg syscall (darwin-amd64-cgo), const B600 ideal-int +pkg syscall (darwin-amd64-cgo), const B7200 = 7200 +pkg syscall (darwin-amd64-cgo), const B7200 ideal-int +pkg syscall (darwin-amd64-cgo), const B75 = 75 +pkg syscall (darwin-amd64-cgo), const B75 ideal-int +pkg syscall (darwin-amd64-cgo), const B76800 = 76800 +pkg syscall (darwin-amd64-cgo), const B76800 ideal-int +pkg syscall (darwin-amd64-cgo), const B9600 = 9600 +pkg syscall (darwin-amd64-cgo), const B9600 ideal-int +pkg syscall (darwin-amd64-cgo), const BIOCFLUSH = 536887912 +pkg syscall (darwin-amd64-cgo), const BIOCGBLEN = 1074020966 +pkg syscall (darwin-amd64-cgo), const BIOCGDLT = 1074020970 +pkg syscall (darwin-amd64-cgo), const BIOCGDLTLIST = 3222028921 +pkg syscall (darwin-amd64-cgo), const BIOCGETIF = 1075855979 +pkg syscall (darwin-amd64-cgo), const BIOCGHDRCMPLT = 1074020980 +pkg syscall (darwin-amd64-cgo), const BIOCGRSIG = 1074020978 +pkg syscall (darwin-amd64-cgo), const BIOCGRTIMEOUT = 1074807406 +pkg syscall (darwin-amd64-cgo), const BIOCGSEESENT = 1074020982 +pkg syscall (darwin-amd64-cgo), const BIOCGSTATS = 1074283119 +pkg syscall (darwin-amd64-cgo), const BIOCIMMEDIATE = 2147762800 +pkg syscall (darwin-amd64-cgo), const BIOCPROMISC = 536887913 +pkg syscall (darwin-amd64-cgo), const BIOCSBLEN = 3221504614 +pkg syscall (darwin-amd64-cgo), const BIOCSDLT = 2147762808 +pkg syscall (darwin-amd64-cgo), const BIOCSETF = 2148549223 +pkg syscall (darwin-amd64-cgo), const BIOCSETIF = 2149597804 +pkg syscall (darwin-amd64-cgo), const BIOCSHDRCMPLT = 2147762805 +pkg syscall (darwin-amd64-cgo), const BIOCSRSIG = 2147762803 +pkg syscall (darwin-amd64-cgo), const BIOCSRTIMEOUT = 2148549229 +pkg syscall (darwin-amd64-cgo), const BIOCSSEESENT = 2147762807 +pkg syscall (darwin-amd64-cgo), const BIOCVERSION = 1074020977 +pkg syscall (darwin-amd64-cgo), const BPF_A = 16 +pkg syscall (darwin-amd64-cgo), const BPF_ABS = 32 +pkg syscall (darwin-amd64-cgo), const BPF_ADD = 0 +pkg syscall (darwin-amd64-cgo), const BPF_ALIGNMENT = 4 +pkg syscall (darwin-amd64-cgo), const BPF_ALU = 4 +pkg syscall (darwin-amd64-cgo), const BPF_AND = 80 +pkg syscall (darwin-amd64-cgo), const BPF_B = 16 +pkg syscall (darwin-amd64-cgo), const BPF_DIV = 48 +pkg syscall (darwin-amd64-cgo), const BPF_H = 8 +pkg syscall (darwin-amd64-cgo), const BPF_IMM = 0 +pkg syscall (darwin-amd64-cgo), const BPF_IND = 64 +pkg syscall (darwin-amd64-cgo), const BPF_JA = 0 +pkg syscall (darwin-amd64-cgo), const BPF_JEQ = 16 +pkg syscall (darwin-amd64-cgo), const BPF_JGE = 48 +pkg syscall (darwin-amd64-cgo), const BPF_JGT = 32 +pkg syscall (darwin-amd64-cgo), const BPF_JMP = 5 +pkg syscall (darwin-amd64-cgo), const BPF_JSET = 64 +pkg syscall (darwin-amd64-cgo), const BPF_K = 0 +pkg syscall (darwin-amd64-cgo), const BPF_LD = 0 +pkg syscall (darwin-amd64-cgo), const BPF_LDX = 1 +pkg syscall (darwin-amd64-cgo), const BPF_LEN = 128 +pkg syscall (darwin-amd64-cgo), const BPF_LSH = 96 +pkg syscall (darwin-amd64-cgo), const BPF_MAJOR_VERSION = 1 +pkg syscall (darwin-amd64-cgo), const BPF_MAXBUFSIZE = 524288 +pkg syscall (darwin-amd64-cgo), const BPF_MAXINSNS = 512 +pkg syscall (darwin-amd64-cgo), const BPF_MEM = 96 +pkg syscall (darwin-amd64-cgo), const BPF_MEMWORDS = 16 +pkg syscall (darwin-amd64-cgo), const BPF_MINBUFSIZE = 32 +pkg syscall (darwin-amd64-cgo), const BPF_MINOR_VERSION = 1 +pkg syscall (darwin-amd64-cgo), const BPF_MISC = 7 +pkg syscall (darwin-amd64-cgo), const BPF_MSH = 160 +pkg syscall (darwin-amd64-cgo), const BPF_MUL = 32 +pkg syscall (darwin-amd64-cgo), const BPF_NEG = 128 +pkg syscall (darwin-amd64-cgo), const BPF_OR = 64 +pkg syscall (darwin-amd64-cgo), const BPF_RELEASE = 199606 +pkg syscall (darwin-amd64-cgo), const BPF_RET = 6 +pkg syscall (darwin-amd64-cgo), const BPF_RSH = 112 +pkg syscall (darwin-amd64-cgo), const BPF_ST = 2 +pkg syscall (darwin-amd64-cgo), const BPF_STX = 3 +pkg syscall (darwin-amd64-cgo), const BPF_SUB = 16 +pkg syscall (darwin-amd64-cgo), const BPF_TAX = 0 +pkg syscall (darwin-amd64-cgo), const BPF_TXA = 128 +pkg syscall (darwin-amd64-cgo), const BPF_W = 0 +pkg syscall (darwin-amd64-cgo), const BPF_X = 8 +pkg syscall (darwin-amd64-cgo), const BRKINT = 2 +pkg syscall (darwin-amd64-cgo), const BRKINT ideal-int +pkg syscall (darwin-amd64-cgo), const CFLUSH = 15 +pkg syscall (darwin-amd64-cgo), const CFLUSH ideal-int +pkg syscall (darwin-amd64-cgo), const CLOCAL = 32768 +pkg syscall (darwin-amd64-cgo), const CLOCAL ideal-int +pkg syscall (darwin-amd64-cgo), const CREAD = 2048 +pkg syscall (darwin-amd64-cgo), const CREAD ideal-int +pkg syscall (darwin-amd64-cgo), const CS5 = 0 +pkg syscall (darwin-amd64-cgo), const CS5 ideal-int +pkg syscall (darwin-amd64-cgo), const CS6 = 256 +pkg syscall (darwin-amd64-cgo), const CS6 ideal-int +pkg syscall (darwin-amd64-cgo), const CS7 = 512 +pkg syscall (darwin-amd64-cgo), const CS7 ideal-int +pkg syscall (darwin-amd64-cgo), const CS8 = 768 +pkg syscall (darwin-amd64-cgo), const CS8 ideal-int +pkg syscall (darwin-amd64-cgo), const CSIZE = 768 +pkg syscall (darwin-amd64-cgo), const CSIZE ideal-int +pkg syscall (darwin-amd64-cgo), const CSTART = 17 +pkg syscall (darwin-amd64-cgo), const CSTART ideal-int +pkg syscall (darwin-amd64-cgo), const CSTATUS = 20 +pkg syscall (darwin-amd64-cgo), const CSTATUS ideal-int +pkg syscall (darwin-amd64-cgo), const CSTOP = 19 +pkg syscall (darwin-amd64-cgo), const CSTOP ideal-int +pkg syscall (darwin-amd64-cgo), const CSTOPB = 1024 +pkg syscall (darwin-amd64-cgo), const CSTOPB ideal-int +pkg syscall (darwin-amd64-cgo), const CSUSP = 26 +pkg syscall (darwin-amd64-cgo), const CSUSP ideal-int +pkg syscall (darwin-amd64-cgo), const CTL_MAXNAME = 12 +pkg syscall (darwin-amd64-cgo), const CTL_NET = 4 +pkg syscall (darwin-amd64-cgo), const DLT_APPLE_IP_OVER_IEEE1394 = 138 +pkg syscall (darwin-amd64-cgo), const DLT_ARCNET = 7 +pkg syscall (darwin-amd64-cgo), const DLT_ATM_CLIP = 19 +pkg syscall (darwin-amd64-cgo), const DLT_ATM_RFC1483 = 11 +pkg syscall (darwin-amd64-cgo), const DLT_AX25 = 3 +pkg syscall (darwin-amd64-cgo), const DLT_CHAOS = 5 +pkg syscall (darwin-amd64-cgo), const DLT_CHDLC = 104 +pkg syscall (darwin-amd64-cgo), const DLT_C_HDLC = 104 +pkg syscall (darwin-amd64-cgo), const DLT_EN10MB = 1 +pkg syscall (darwin-amd64-cgo), const DLT_EN3MB = 2 +pkg syscall (darwin-amd64-cgo), const DLT_FDDI = 10 +pkg syscall (darwin-amd64-cgo), const DLT_IEEE802 = 6 +pkg syscall (darwin-amd64-cgo), const DLT_IEEE802_11 = 105 +pkg syscall (darwin-amd64-cgo), const DLT_IEEE802_11_RADIO = 127 +pkg syscall (darwin-amd64-cgo), const DLT_IEEE802_11_RADIO_AVS = 163 +pkg syscall (darwin-amd64-cgo), const DLT_LINUX_SLL = 113 +pkg syscall (darwin-amd64-cgo), const DLT_LOOP = 108 +pkg syscall (darwin-amd64-cgo), const DLT_NULL = 0 +pkg syscall (darwin-amd64-cgo), const DLT_PFLOG = 117 +pkg syscall (darwin-amd64-cgo), const DLT_PFSYNC = 18 +pkg syscall (darwin-amd64-cgo), const DLT_PPP = 9 +pkg syscall (darwin-amd64-cgo), const DLT_PPP_BSDOS = 16 +pkg syscall (darwin-amd64-cgo), const DLT_PPP_SERIAL = 50 +pkg syscall (darwin-amd64-cgo), const DLT_PRONET = 4 +pkg syscall (darwin-amd64-cgo), const DLT_RAW = 12 +pkg syscall (darwin-amd64-cgo), const DLT_SLIP = 8 +pkg syscall (darwin-amd64-cgo), const DLT_SLIP_BSDOS = 15 +pkg syscall (darwin-amd64-cgo), const DT_BLK = 6 +pkg syscall (darwin-amd64-cgo), const DT_CHR = 2 +pkg syscall (darwin-amd64-cgo), const DT_DIR = 4 +pkg syscall (darwin-amd64-cgo), const DT_FIFO = 1 +pkg syscall (darwin-amd64-cgo), const DT_LNK = 10 +pkg syscall (darwin-amd64-cgo), const DT_REG = 8 +pkg syscall (darwin-amd64-cgo), const DT_SOCK = 12 +pkg syscall (darwin-amd64-cgo), const DT_UNKNOWN = 0 +pkg syscall (darwin-amd64-cgo), const DT_WHT = 14 +pkg syscall (darwin-amd64-cgo), const E2BIG = 7 +pkg syscall (darwin-amd64-cgo), const EACCES = 13 +pkg syscall (darwin-amd64-cgo), const EADDRINUSE = 48 +pkg syscall (darwin-amd64-cgo), const EADDRNOTAVAIL = 49 +pkg syscall (darwin-amd64-cgo), const EAFNOSUPPORT = 47 +pkg syscall (darwin-amd64-cgo), const EAGAIN = 35 +pkg syscall (darwin-amd64-cgo), const EALREADY = 37 +pkg syscall (darwin-amd64-cgo), const EAUTH = 80 +pkg syscall (darwin-amd64-cgo), const EBADARCH = 86 +pkg syscall (darwin-amd64-cgo), const EBADEXEC = 85 +pkg syscall (darwin-amd64-cgo), const EBADF = 9 +pkg syscall (darwin-amd64-cgo), const EBADMACHO = 88 +pkg syscall (darwin-amd64-cgo), const EBADMSG = 94 +pkg syscall (darwin-amd64-cgo), const EBADRPC = 72 +pkg syscall (darwin-amd64-cgo), const EBUSY = 16 +pkg syscall (darwin-amd64-cgo), const ECANCELED = 89 +pkg syscall (darwin-amd64-cgo), const ECHILD = 10 +pkg syscall (darwin-amd64-cgo), const ECHO = 8 +pkg syscall (darwin-amd64-cgo), const ECHOCTL = 64 +pkg syscall (darwin-amd64-cgo), const ECHOE = 2 +pkg syscall (darwin-amd64-cgo), const ECHOK = 4 +pkg syscall (darwin-amd64-cgo), const ECHOKE = 1 +pkg syscall (darwin-amd64-cgo), const ECHONL = 16 +pkg syscall (darwin-amd64-cgo), const ECHOPRT = 32 +pkg syscall (darwin-amd64-cgo), const ECONNABORTED = 53 +pkg syscall (darwin-amd64-cgo), const ECONNREFUSED = 61 +pkg syscall (darwin-amd64-cgo), const ECONNRESET = 54 +pkg syscall (darwin-amd64-cgo), const EDEADLK = 11 +pkg syscall (darwin-amd64-cgo), const EDESTADDRREQ = 39 +pkg syscall (darwin-amd64-cgo), const EDEVERR = 83 +pkg syscall (darwin-amd64-cgo), const EDOM = 33 +pkg syscall (darwin-amd64-cgo), const EDQUOT = 69 +pkg syscall (darwin-amd64-cgo), const EEXIST = 17 +pkg syscall (darwin-amd64-cgo), const EFAULT = 14 +pkg syscall (darwin-amd64-cgo), const EFBIG = 27 +pkg syscall (darwin-amd64-cgo), const EFTYPE = 79 +pkg syscall (darwin-amd64-cgo), const EHOSTDOWN = 64 +pkg syscall (darwin-amd64-cgo), const EHOSTUNREACH = 65 +pkg syscall (darwin-amd64-cgo), const EIDRM = 90 +pkg syscall (darwin-amd64-cgo), const EILSEQ = 92 +pkg syscall (darwin-amd64-cgo), const EINPROGRESS = 36 +pkg syscall (darwin-amd64-cgo), const EINTR = 4 +pkg syscall (darwin-amd64-cgo), const EINVAL = 22 +pkg syscall (darwin-amd64-cgo), const EIO = 5 +pkg syscall (darwin-amd64-cgo), const EISCONN = 56 +pkg syscall (darwin-amd64-cgo), const EISDIR = 21 +pkg syscall (darwin-amd64-cgo), const ELAST = 105 +pkg syscall (darwin-amd64-cgo), const ELOOP = 62 +pkg syscall (darwin-amd64-cgo), const EMFILE = 24 +pkg syscall (darwin-amd64-cgo), const EMLINK = 31 +pkg syscall (darwin-amd64-cgo), const EMSGSIZE = 40 +pkg syscall (darwin-amd64-cgo), const EMULTIHOP = 95 +pkg syscall (darwin-amd64-cgo), const ENAMETOOLONG = 63 +pkg syscall (darwin-amd64-cgo), const ENEEDAUTH = 81 +pkg syscall (darwin-amd64-cgo), const ENETDOWN = 50 +pkg syscall (darwin-amd64-cgo), const ENETRESET = 52 +pkg syscall (darwin-amd64-cgo), const ENETUNREACH = 51 +pkg syscall (darwin-amd64-cgo), const ENFILE = 23 +pkg syscall (darwin-amd64-cgo), const ENOATTR = 93 +pkg syscall (darwin-amd64-cgo), const ENOBUFS = 55 +pkg syscall (darwin-amd64-cgo), const ENODATA = 96 +pkg syscall (darwin-amd64-cgo), const ENODEV = 19 +pkg syscall (darwin-amd64-cgo), const ENOEXEC = 8 +pkg syscall (darwin-amd64-cgo), const ENOLCK = 77 +pkg syscall (darwin-amd64-cgo), const ENOLINK = 97 +pkg syscall (darwin-amd64-cgo), const ENOMEM = 12 +pkg syscall (darwin-amd64-cgo), const ENOMSG = 91 +pkg syscall (darwin-amd64-cgo), const ENOPOLICY = 103 +pkg syscall (darwin-amd64-cgo), const ENOPROTOOPT = 42 +pkg syscall (darwin-amd64-cgo), const ENOSPC = 28 +pkg syscall (darwin-amd64-cgo), const ENOSR = 98 +pkg syscall (darwin-amd64-cgo), const ENOSTR = 99 +pkg syscall (darwin-amd64-cgo), const ENOSYS = 78 +pkg syscall (darwin-amd64-cgo), const ENOTBLK = 15 +pkg syscall (darwin-amd64-cgo), const ENOTCONN = 57 +pkg syscall (darwin-amd64-cgo), const ENOTDIR = 20 +pkg syscall (darwin-amd64-cgo), const ENOTEMPTY = 66 +pkg syscall (darwin-amd64-cgo), const ENOTRECOVERABLE = 104 +pkg syscall (darwin-amd64-cgo), const ENOTSOCK = 38 +pkg syscall (darwin-amd64-cgo), const ENOTSUP = 45 +pkg syscall (darwin-amd64-cgo), const ENOTTY = 25 +pkg syscall (darwin-amd64-cgo), const ENXIO = 6 +pkg syscall (darwin-amd64-cgo), const EOPNOTSUPP = 102 +pkg syscall (darwin-amd64-cgo), const EOVERFLOW = 84 +pkg syscall (darwin-amd64-cgo), const EOWNERDEAD = 105 +pkg syscall (darwin-amd64-cgo), const EPERM = 1 +pkg syscall (darwin-amd64-cgo), const EPFNOSUPPORT = 46 +pkg syscall (darwin-amd64-cgo), const EPIPE = 32 +pkg syscall (darwin-amd64-cgo), const EPROCLIM = 67 +pkg syscall (darwin-amd64-cgo), const EPROCUNAVAIL = 76 +pkg syscall (darwin-amd64-cgo), const EPROGMISMATCH = 75 +pkg syscall (darwin-amd64-cgo), const EPROGUNAVAIL = 74 +pkg syscall (darwin-amd64-cgo), const EPROTO = 100 +pkg syscall (darwin-amd64-cgo), const EPROTONOSUPPORT = 43 +pkg syscall (darwin-amd64-cgo), const EPROTOTYPE = 41 +pkg syscall (darwin-amd64-cgo), const EPWROFF = 82 +pkg syscall (darwin-amd64-cgo), const ERANGE = 34 +pkg syscall (darwin-amd64-cgo), const EREMOTE = 71 +pkg syscall (darwin-amd64-cgo), const EROFS = 30 +pkg syscall (darwin-amd64-cgo), const ERPCMISMATCH = 73 +pkg syscall (darwin-amd64-cgo), const ESHLIBVERS = 87 +pkg syscall (darwin-amd64-cgo), const ESHUTDOWN = 58 +pkg syscall (darwin-amd64-cgo), const ESOCKTNOSUPPORT = 44 +pkg syscall (darwin-amd64-cgo), const ESPIPE = 29 +pkg syscall (darwin-amd64-cgo), const ESRCH = 3 +pkg syscall (darwin-amd64-cgo), const ESTALE = 70 +pkg syscall (darwin-amd64-cgo), const ETIME = 101 +pkg syscall (darwin-amd64-cgo), const ETIMEDOUT = 60 +pkg syscall (darwin-amd64-cgo), const ETOOMANYREFS = 59 +pkg syscall (darwin-amd64-cgo), const ETXTBSY = 26 +pkg syscall (darwin-amd64-cgo), const EUSERS = 68 +pkg syscall (darwin-amd64-cgo), const EVFILT_AIO = -3 +pkg syscall (darwin-amd64-cgo), const EVFILT_FS = -9 +pkg syscall (darwin-amd64-cgo), const EVFILT_MACHPORT = -8 +pkg syscall (darwin-amd64-cgo), const EVFILT_PROC = -5 +pkg syscall (darwin-amd64-cgo), const EVFILT_READ = -1 +pkg syscall (darwin-amd64-cgo), const EVFILT_SIGNAL = -6 +pkg syscall (darwin-amd64-cgo), const EVFILT_SYSCOUNT = 12 +pkg syscall (darwin-amd64-cgo), const EVFILT_THREADMARKER = 12 +pkg syscall (darwin-amd64-cgo), const EVFILT_TIMER = -7 +pkg syscall (darwin-amd64-cgo), const EVFILT_USER = -10 +pkg syscall (darwin-amd64-cgo), const EVFILT_VM = -12 +pkg syscall (darwin-amd64-cgo), const EVFILT_VNODE = -4 +pkg syscall (darwin-amd64-cgo), const EVFILT_WRITE = -2 +pkg syscall (darwin-amd64-cgo), const EV_ADD = 1 +pkg syscall (darwin-amd64-cgo), const EV_CLEAR = 32 +pkg syscall (darwin-amd64-cgo), const EV_DELETE = 2 +pkg syscall (darwin-amd64-cgo), const EV_DISABLE = 8 +pkg syscall (darwin-amd64-cgo), const EV_DISPATCH = 128 +pkg syscall (darwin-amd64-cgo), const EV_ENABLE = 4 +pkg syscall (darwin-amd64-cgo), const EV_EOF = 32768 +pkg syscall (darwin-amd64-cgo), const EV_ERROR = 16384 +pkg syscall (darwin-amd64-cgo), const EV_FLAG0 = 4096 +pkg syscall (darwin-amd64-cgo), const EV_FLAG1 = 8192 +pkg syscall (darwin-amd64-cgo), const EV_ONESHOT = 16 +pkg syscall (darwin-amd64-cgo), const EV_OOBAND = 8192 +pkg syscall (darwin-amd64-cgo), const EV_POLL = 4096 +pkg syscall (darwin-amd64-cgo), const EV_RECEIPT = 64 +pkg syscall (darwin-amd64-cgo), const EV_SYSFLAGS = 61440 +pkg syscall (darwin-amd64-cgo), const EWOULDBLOCK = 35 +pkg syscall (darwin-amd64-cgo), const EXDEV = 18 +pkg syscall (darwin-amd64-cgo), const EXTA = 19200 +pkg syscall (darwin-amd64-cgo), const EXTB = 38400 +pkg syscall (darwin-amd64-cgo), const EXTPROC = 2048 +pkg syscall (darwin-amd64-cgo), const FD_CLOEXEC = 1 +pkg syscall (darwin-amd64-cgo), const FD_SETSIZE = 1024 +pkg syscall (darwin-amd64-cgo), const FLUSHO = 8388608 +pkg syscall (darwin-amd64-cgo), const FLUSHO ideal-int +pkg syscall (darwin-amd64-cgo), const F_ADDFILESIGS = 61 +pkg syscall (darwin-amd64-cgo), const F_ADDSIGS = 59 +pkg syscall (darwin-amd64-cgo), const F_ALLOCATEALL = 4 +pkg syscall (darwin-amd64-cgo), const F_ALLOCATECONTIG = 2 +pkg syscall (darwin-amd64-cgo), const F_CHKCLEAN = 41 +pkg syscall (darwin-amd64-cgo), const F_DUPFD = 0 +pkg syscall (darwin-amd64-cgo), const F_DUPFD_CLOEXEC = 67 +pkg syscall (darwin-amd64-cgo), const F_FLUSH_DATA = 40 +pkg syscall (darwin-amd64-cgo), const F_FREEZE_FS = 53 +pkg syscall (darwin-amd64-cgo), const F_FULLFSYNC = 51 +pkg syscall (darwin-amd64-cgo), const F_GETFD = 1 +pkg syscall (darwin-amd64-cgo), const F_GETFL = 3 +pkg syscall (darwin-amd64-cgo), const F_GETLK = 7 +pkg syscall (darwin-amd64-cgo), const F_GETLKPID = 66 +pkg syscall (darwin-amd64-cgo), const F_GETNOSIGPIPE = 74 +pkg syscall (darwin-amd64-cgo), const F_GETOWN = 5 +pkg syscall (darwin-amd64-cgo), const F_GETPATH = 50 +pkg syscall (darwin-amd64-cgo), const F_GETPATH_MTMINFO = 71 +pkg syscall (darwin-amd64-cgo), const F_GETPROTECTIONCLASS = 63 +pkg syscall (darwin-amd64-cgo), const F_GLOBAL_NOCACHE = 55 +pkg syscall (darwin-amd64-cgo), const F_LOG2PHYS = 49 +pkg syscall (darwin-amd64-cgo), const F_LOG2PHYS_EXT = 65 +pkg syscall (darwin-amd64-cgo), const F_MARKDEPENDENCY = 60 +pkg syscall (darwin-amd64-cgo), const F_NOCACHE = 48 +pkg syscall (darwin-amd64-cgo), const F_NODIRECT = 62 +pkg syscall (darwin-amd64-cgo), const F_OK = 0 +pkg syscall (darwin-amd64-cgo), const F_PATHPKG_CHECK = 52 +pkg syscall (darwin-amd64-cgo), const F_PEOFPOSMODE = 3 +pkg syscall (darwin-amd64-cgo), const F_PREALLOCATE = 42 +pkg syscall (darwin-amd64-cgo), const F_RDADVISE = 44 +pkg syscall (darwin-amd64-cgo), const F_RDAHEAD = 45 +pkg syscall (darwin-amd64-cgo), const F_RDLCK = 1 +pkg syscall (darwin-amd64-cgo), const F_READBOOTSTRAP = 46 +pkg syscall (darwin-amd64-cgo), const F_SETBACKINGSTORE = 70 +pkg syscall (darwin-amd64-cgo), const F_SETFD = 2 +pkg syscall (darwin-amd64-cgo), const F_SETFL = 4 +pkg syscall (darwin-amd64-cgo), const F_SETLK = 8 +pkg syscall (darwin-amd64-cgo), const F_SETLKW = 9 +pkg syscall (darwin-amd64-cgo), const F_SETNOSIGPIPE = 73 +pkg syscall (darwin-amd64-cgo), const F_SETOWN = 6 +pkg syscall (darwin-amd64-cgo), const F_SETPROTECTIONCLASS = 64 +pkg syscall (darwin-amd64-cgo), const F_SETSIZE = 43 +pkg syscall (darwin-amd64-cgo), const F_THAW_FS = 54 +pkg syscall (darwin-amd64-cgo), const F_UNLCK = 2 +pkg syscall (darwin-amd64-cgo), const F_VOLPOSMODE = 4 +pkg syscall (darwin-amd64-cgo), const F_WRITEBOOTSTRAP = 47 +pkg syscall (darwin-amd64-cgo), const F_WRLCK = 3 +pkg syscall (darwin-amd64-cgo), const HUPCL = 16384 +pkg syscall (darwin-amd64-cgo), const HUPCL ideal-int +pkg syscall (darwin-amd64-cgo), const ICANON = 256 +pkg syscall (darwin-amd64-cgo), const ICANON ideal-int +pkg syscall (darwin-amd64-cgo), const ICRNL = 256 +pkg syscall (darwin-amd64-cgo), const ICRNL ideal-int +pkg syscall (darwin-amd64-cgo), const IEXTEN = 1024 +pkg syscall (darwin-amd64-cgo), const IEXTEN ideal-int +pkg syscall (darwin-amd64-cgo), const IFF_ALLMULTI = 512 +pkg syscall (darwin-amd64-cgo), const IFF_ALTPHYS = 16384 +pkg syscall (darwin-amd64-cgo), const IFF_DEBUG = 4 +pkg syscall (darwin-amd64-cgo), const IFF_LINK0 = 4096 +pkg syscall (darwin-amd64-cgo), const IFF_LINK1 = 8192 +pkg syscall (darwin-amd64-cgo), const IFF_LINK2 = 16384 +pkg syscall (darwin-amd64-cgo), const IFF_LOOPBACK = 8 +pkg syscall (darwin-amd64-cgo), const IFF_MULTICAST = 32768 +pkg syscall (darwin-amd64-cgo), const IFF_NOARP = 128 +pkg syscall (darwin-amd64-cgo), const IFF_NOTRAILERS = 32 +pkg syscall (darwin-amd64-cgo), const IFF_OACTIVE = 1024 +pkg syscall (darwin-amd64-cgo), const IFF_POINTOPOINT = 16 +pkg syscall (darwin-amd64-cgo), const IFF_PROMISC = 256 +pkg syscall (darwin-amd64-cgo), const IFF_RUNNING = 64 +pkg syscall (darwin-amd64-cgo), const IFF_SIMPLEX = 2048 +pkg syscall (darwin-amd64-cgo), const IFNAMSIZ = 16 +pkg syscall (darwin-amd64-cgo), const IFT_1822 = 2 +pkg syscall (darwin-amd64-cgo), const IFT_AAL5 = 49 +pkg syscall (darwin-amd64-cgo), const IFT_ARCNET = 35 +pkg syscall (darwin-amd64-cgo), const IFT_ARCNETPLUS = 36 +pkg syscall (darwin-amd64-cgo), const IFT_ATM = 37 +pkg syscall (darwin-amd64-cgo), const IFT_BRIDGE = 209 +pkg syscall (darwin-amd64-cgo), const IFT_CARP = 248 +pkg syscall (darwin-amd64-cgo), const IFT_CELLULAR = 255 +pkg syscall (darwin-amd64-cgo), const IFT_CEPT = 19 +pkg syscall (darwin-amd64-cgo), const IFT_DS3 = 30 +pkg syscall (darwin-amd64-cgo), const IFT_ENC = 244 +pkg syscall (darwin-amd64-cgo), const IFT_EON = 25 +pkg syscall (darwin-amd64-cgo), const IFT_ETHER = 6 +pkg syscall (darwin-amd64-cgo), const IFT_FAITH = 56 +pkg syscall (darwin-amd64-cgo), const IFT_FDDI = 15 +pkg syscall (darwin-amd64-cgo), const IFT_FRELAY = 32 +pkg syscall (darwin-amd64-cgo), const IFT_FRELAYDCE = 44 +pkg syscall (darwin-amd64-cgo), const IFT_GIF = 55 +pkg syscall (darwin-amd64-cgo), const IFT_HDH1822 = 3 +pkg syscall (darwin-amd64-cgo), const IFT_HIPPI = 47 +pkg syscall (darwin-amd64-cgo), const IFT_HSSI = 46 +pkg syscall (darwin-amd64-cgo), const IFT_HY = 14 +pkg syscall (darwin-amd64-cgo), const IFT_IEEE1394 = 144 +pkg syscall (darwin-amd64-cgo), const IFT_IEEE8023ADLAG = 136 +pkg syscall (darwin-amd64-cgo), const IFT_ISDNBASIC = 20 +pkg syscall (darwin-amd64-cgo), const IFT_ISDNPRIMARY = 21 +pkg syscall (darwin-amd64-cgo), const IFT_ISO88022LLC = 41 +pkg syscall (darwin-amd64-cgo), const IFT_ISO88023 = 7 +pkg syscall (darwin-amd64-cgo), const IFT_ISO88024 = 8 +pkg syscall (darwin-amd64-cgo), const IFT_ISO88025 = 9 +pkg syscall (darwin-amd64-cgo), const IFT_ISO88026 = 10 +pkg syscall (darwin-amd64-cgo), const IFT_L2VLAN = 135 +pkg syscall (darwin-amd64-cgo), const IFT_LAPB = 16 +pkg syscall (darwin-amd64-cgo), const IFT_LOCALTALK = 42 +pkg syscall (darwin-amd64-cgo), const IFT_LOOP = 24 +pkg syscall (darwin-amd64-cgo), const IFT_MIOX25 = 38 +pkg syscall (darwin-amd64-cgo), const IFT_MODEM = 48 +pkg syscall (darwin-amd64-cgo), const IFT_NSIP = 27 +pkg syscall (darwin-amd64-cgo), const IFT_OTHER = 1 +pkg syscall (darwin-amd64-cgo), const IFT_P10 = 12 +pkg syscall (darwin-amd64-cgo), const IFT_P80 = 13 +pkg syscall (darwin-amd64-cgo), const IFT_PARA = 34 +pkg syscall (darwin-amd64-cgo), const IFT_PDP = 255 +pkg syscall (darwin-amd64-cgo), const IFT_PFLOG = 245 +pkg syscall (darwin-amd64-cgo), const IFT_PFSYNC = 246 +pkg syscall (darwin-amd64-cgo), const IFT_PPP = 23 +pkg syscall (darwin-amd64-cgo), const IFT_PROPMUX = 54 +pkg syscall (darwin-amd64-cgo), const IFT_PROPVIRTUAL = 53 +pkg syscall (darwin-amd64-cgo), const IFT_PTPSERIAL = 22 +pkg syscall (darwin-amd64-cgo), const IFT_RS232 = 33 +pkg syscall (darwin-amd64-cgo), const IFT_SDLC = 17 +pkg syscall (darwin-amd64-cgo), const IFT_SIP = 31 +pkg syscall (darwin-amd64-cgo), const IFT_SLIP = 28 +pkg syscall (darwin-amd64-cgo), const IFT_SMDSDXI = 43 +pkg syscall (darwin-amd64-cgo), const IFT_SMDSICIP = 52 +pkg syscall (darwin-amd64-cgo), const IFT_SONET = 39 +pkg syscall (darwin-amd64-cgo), const IFT_SONETPATH = 50 +pkg syscall (darwin-amd64-cgo), const IFT_SONETVT = 51 +pkg syscall (darwin-amd64-cgo), const IFT_STARLAN = 11 +pkg syscall (darwin-amd64-cgo), const IFT_STF = 57 +pkg syscall (darwin-amd64-cgo), const IFT_T1 = 18 +pkg syscall (darwin-amd64-cgo), const IFT_ULTRA = 29 +pkg syscall (darwin-amd64-cgo), const IFT_V35 = 45 +pkg syscall (darwin-amd64-cgo), const IFT_X25 = 5 +pkg syscall (darwin-amd64-cgo), const IFT_X25DDN = 4 +pkg syscall (darwin-amd64-cgo), const IFT_X25PLE = 40 +pkg syscall (darwin-amd64-cgo), const IFT_XETHER = 26 +pkg syscall (darwin-amd64-cgo), const IGNBRK = 1 +pkg syscall (darwin-amd64-cgo), const IGNBRK ideal-int +pkg syscall (darwin-amd64-cgo), const IGNCR = 128 +pkg syscall (darwin-amd64-cgo), const IGNCR ideal-int +pkg syscall (darwin-amd64-cgo), const IGNPAR = 4 +pkg syscall (darwin-amd64-cgo), const IGNPAR ideal-int +pkg syscall (darwin-amd64-cgo), const IMAXBEL = 8192 +pkg syscall (darwin-amd64-cgo), const IMAXBEL ideal-int +pkg syscall (darwin-amd64-cgo), const INLCR = 64 +pkg syscall (darwin-amd64-cgo), const INLCR ideal-int +pkg syscall (darwin-amd64-cgo), const INPCK = 16 +pkg syscall (darwin-amd64-cgo), const INPCK ideal-int +pkg syscall (darwin-amd64-cgo), const IN_CLASSA_HOST = 16777215 +pkg syscall (darwin-amd64-cgo), const IN_CLASSA_MAX = 128 +pkg syscall (darwin-amd64-cgo), const IN_CLASSA_NET = 4278190080 +pkg syscall (darwin-amd64-cgo), const IN_CLASSA_NSHIFT = 24 +pkg syscall (darwin-amd64-cgo), const IN_CLASSB_HOST = 65535 +pkg syscall (darwin-amd64-cgo), const IN_CLASSB_MAX = 65536 +pkg syscall (darwin-amd64-cgo), const IN_CLASSB_NET = 4294901760 +pkg syscall (darwin-amd64-cgo), const IN_CLASSB_NSHIFT = 16 +pkg syscall (darwin-amd64-cgo), const IN_CLASSC_HOST = 255 +pkg syscall (darwin-amd64-cgo), const IN_CLASSC_NET = 4294967040 +pkg syscall (darwin-amd64-cgo), const IN_CLASSC_NSHIFT = 8 +pkg syscall (darwin-amd64-cgo), const IN_CLASSD_HOST = 268435455 +pkg syscall (darwin-amd64-cgo), const IN_CLASSD_NET = 4026531840 +pkg syscall (darwin-amd64-cgo), const IN_CLASSD_NSHIFT = 28 +pkg syscall (darwin-amd64-cgo), const IN_LINKLOCALNETNUM = 2851995648 +pkg syscall (darwin-amd64-cgo), const IN_LOOPBACKNET = 127 +pkg syscall (darwin-amd64-cgo), const IPPROTO_3PC = 34 +pkg syscall (darwin-amd64-cgo), const IPPROTO_ADFS = 68 +pkg syscall (darwin-amd64-cgo), const IPPROTO_AH = 51 +pkg syscall (darwin-amd64-cgo), const IPPROTO_AHIP = 61 +pkg syscall (darwin-amd64-cgo), const IPPROTO_APES = 99 +pkg syscall (darwin-amd64-cgo), const IPPROTO_ARGUS = 13 +pkg syscall (darwin-amd64-cgo), const IPPROTO_AX25 = 93 +pkg syscall (darwin-amd64-cgo), const IPPROTO_BHA = 49 +pkg syscall (darwin-amd64-cgo), const IPPROTO_BLT = 30 +pkg syscall (darwin-amd64-cgo), const IPPROTO_BRSATMON = 76 +pkg syscall (darwin-amd64-cgo), const IPPROTO_CFTP = 62 +pkg syscall (darwin-amd64-cgo), const IPPROTO_CHAOS = 16 +pkg syscall (darwin-amd64-cgo), const IPPROTO_CMTP = 38 +pkg syscall (darwin-amd64-cgo), const IPPROTO_CPHB = 73 +pkg syscall (darwin-amd64-cgo), const IPPROTO_CPNX = 72 +pkg syscall (darwin-amd64-cgo), const IPPROTO_DDP = 37 +pkg syscall (darwin-amd64-cgo), const IPPROTO_DGP = 86 +pkg syscall (darwin-amd64-cgo), const IPPROTO_DIVERT = 254 +pkg syscall (darwin-amd64-cgo), const IPPROTO_DONE = 257 +pkg syscall (darwin-amd64-cgo), const IPPROTO_DSTOPTS = 60 +pkg syscall (darwin-amd64-cgo), const IPPROTO_EGP = 8 +pkg syscall (darwin-amd64-cgo), const IPPROTO_EMCON = 14 +pkg syscall (darwin-amd64-cgo), const IPPROTO_ENCAP = 98 +pkg syscall (darwin-amd64-cgo), const IPPROTO_EON = 80 +pkg syscall (darwin-amd64-cgo), const IPPROTO_ESP = 50 +pkg syscall (darwin-amd64-cgo), const IPPROTO_ETHERIP = 97 +pkg syscall (darwin-amd64-cgo), const IPPROTO_FRAGMENT = 44 +pkg syscall (darwin-amd64-cgo), const IPPROTO_GGP = 3 +pkg syscall (darwin-amd64-cgo), const IPPROTO_GMTP = 100 +pkg syscall (darwin-amd64-cgo), const IPPROTO_GRE = 47 +pkg syscall (darwin-amd64-cgo), const IPPROTO_HELLO = 63 +pkg syscall (darwin-amd64-cgo), const IPPROTO_HMP = 20 +pkg syscall (darwin-amd64-cgo), const IPPROTO_HOPOPTS = 0 +pkg syscall (darwin-amd64-cgo), const IPPROTO_ICMP = 1 +pkg syscall (darwin-amd64-cgo), const IPPROTO_ICMPV6 = 58 +pkg syscall (darwin-amd64-cgo), const IPPROTO_IDP = 22 +pkg syscall (darwin-amd64-cgo), const IPPROTO_IDPR = 35 +pkg syscall (darwin-amd64-cgo), const IPPROTO_IDRP = 45 +pkg syscall (darwin-amd64-cgo), const IPPROTO_IGMP = 2 +pkg syscall (darwin-amd64-cgo), const IPPROTO_IGP = 85 +pkg syscall (darwin-amd64-cgo), const IPPROTO_IGRP = 88 +pkg syscall (darwin-amd64-cgo), const IPPROTO_IL = 40 +pkg syscall (darwin-amd64-cgo), const IPPROTO_INLSP = 52 +pkg syscall (darwin-amd64-cgo), const IPPROTO_INP = 32 +pkg syscall (darwin-amd64-cgo), const IPPROTO_IPCOMP = 108 +pkg syscall (darwin-amd64-cgo), const IPPROTO_IPCV = 71 +pkg syscall (darwin-amd64-cgo), const IPPROTO_IPEIP = 94 +pkg syscall (darwin-amd64-cgo), const IPPROTO_IPIP = 4 +pkg syscall (darwin-amd64-cgo), const IPPROTO_IPPC = 67 +pkg syscall (darwin-amd64-cgo), const IPPROTO_IPV4 = 4 +pkg syscall (darwin-amd64-cgo), const IPPROTO_IRTP = 28 +pkg syscall (darwin-amd64-cgo), const IPPROTO_KRYPTOLAN = 65 +pkg syscall (darwin-amd64-cgo), const IPPROTO_LARP = 91 +pkg syscall (darwin-amd64-cgo), const IPPROTO_LEAF1 = 25 +pkg syscall (darwin-amd64-cgo), const IPPROTO_LEAF2 = 26 +pkg syscall (darwin-amd64-cgo), const IPPROTO_MAX = 256 +pkg syscall (darwin-amd64-cgo), const IPPROTO_MAXID = 52 +pkg syscall (darwin-amd64-cgo), const IPPROTO_MEAS = 19 +pkg syscall (darwin-amd64-cgo), const IPPROTO_MHRP = 48 +pkg syscall (darwin-amd64-cgo), const IPPROTO_MICP = 95 +pkg syscall (darwin-amd64-cgo), const IPPROTO_MTP = 92 +pkg syscall (darwin-amd64-cgo), const IPPROTO_MUX = 18 +pkg syscall (darwin-amd64-cgo), const IPPROTO_ND = 77 +pkg syscall (darwin-amd64-cgo), const IPPROTO_NHRP = 54 +pkg syscall (darwin-amd64-cgo), const IPPROTO_NONE = 59 +pkg syscall (darwin-amd64-cgo), const IPPROTO_NSP = 31 +pkg syscall (darwin-amd64-cgo), const IPPROTO_NVPII = 11 +pkg syscall (darwin-amd64-cgo), const IPPROTO_OSPFIGP = 89 +pkg syscall (darwin-amd64-cgo), const IPPROTO_PGM = 113 +pkg syscall (darwin-amd64-cgo), const IPPROTO_PIGP = 9 +pkg syscall (darwin-amd64-cgo), const IPPROTO_PIM = 103 +pkg syscall (darwin-amd64-cgo), const IPPROTO_PRM = 21 +pkg syscall (darwin-amd64-cgo), const IPPROTO_PUP = 12 +pkg syscall (darwin-amd64-cgo), const IPPROTO_PVP = 75 +pkg syscall (darwin-amd64-cgo), const IPPROTO_RAW = 255 +pkg syscall (darwin-amd64-cgo), const IPPROTO_RCCMON = 10 +pkg syscall (darwin-amd64-cgo), const IPPROTO_RDP = 27 +pkg syscall (darwin-amd64-cgo), const IPPROTO_ROUTING = 43 +pkg syscall (darwin-amd64-cgo), const IPPROTO_RSVP = 46 +pkg syscall (darwin-amd64-cgo), const IPPROTO_RVD = 66 +pkg syscall (darwin-amd64-cgo), const IPPROTO_SATEXPAK = 64 +pkg syscall (darwin-amd64-cgo), const IPPROTO_SATMON = 69 +pkg syscall (darwin-amd64-cgo), const IPPROTO_SCCSP = 96 +pkg syscall (darwin-amd64-cgo), const IPPROTO_SCTP = 132 +pkg syscall (darwin-amd64-cgo), const IPPROTO_SDRP = 42 +pkg syscall (darwin-amd64-cgo), const IPPROTO_SEP = 33 +pkg syscall (darwin-amd64-cgo), const IPPROTO_SRPC = 90 +pkg syscall (darwin-amd64-cgo), const IPPROTO_ST = 7 +pkg syscall (darwin-amd64-cgo), const IPPROTO_SVMTP = 82 +pkg syscall (darwin-amd64-cgo), const IPPROTO_SWIPE = 53 +pkg syscall (darwin-amd64-cgo), const IPPROTO_TCF = 87 +pkg syscall (darwin-amd64-cgo), const IPPROTO_TP = 29 +pkg syscall (darwin-amd64-cgo), const IPPROTO_TPXX = 39 +pkg syscall (darwin-amd64-cgo), const IPPROTO_TRUNK1 = 23 +pkg syscall (darwin-amd64-cgo), const IPPROTO_TRUNK2 = 24 +pkg syscall (darwin-amd64-cgo), const IPPROTO_TTP = 84 +pkg syscall (darwin-amd64-cgo), const IPPROTO_VINES = 83 +pkg syscall (darwin-amd64-cgo), const IPPROTO_VISA = 70 +pkg syscall (darwin-amd64-cgo), const IPPROTO_VMTP = 81 +pkg syscall (darwin-amd64-cgo), const IPPROTO_WBEXPAK = 79 +pkg syscall (darwin-amd64-cgo), const IPPROTO_WBMON = 78 +pkg syscall (darwin-amd64-cgo), const IPPROTO_WSN = 74 +pkg syscall (darwin-amd64-cgo), const IPPROTO_XNET = 15 +pkg syscall (darwin-amd64-cgo), const IPPROTO_XTP = 36 +pkg syscall (darwin-amd64-cgo), const IPV6_2292DSTOPTS = 23 +pkg syscall (darwin-amd64-cgo), const IPV6_2292HOPLIMIT = 20 +pkg syscall (darwin-amd64-cgo), const IPV6_2292HOPOPTS = 22 +pkg syscall (darwin-amd64-cgo), const IPV6_2292NEXTHOP = 21 +pkg syscall (darwin-amd64-cgo), const IPV6_2292PKTINFO = 19 +pkg syscall (darwin-amd64-cgo), const IPV6_2292PKTOPTIONS = 25 +pkg syscall (darwin-amd64-cgo), const IPV6_2292RTHDR = 24 +pkg syscall (darwin-amd64-cgo), const IPV6_BINDV6ONLY = 27 +pkg syscall (darwin-amd64-cgo), const IPV6_BOUND_IF = 125 +pkg syscall (darwin-amd64-cgo), const IPV6_CHECKSUM = 26 +pkg syscall (darwin-amd64-cgo), const IPV6_DEFAULT_MULTICAST_HOPS = 1 +pkg syscall (darwin-amd64-cgo), const IPV6_DEFAULT_MULTICAST_LOOP = 1 +pkg syscall (darwin-amd64-cgo), const IPV6_DEFHLIM = 64 +pkg syscall (darwin-amd64-cgo), const IPV6_FAITH = 29 +pkg syscall (darwin-amd64-cgo), const IPV6_FLOWINFO_MASK = 4294967055 +pkg syscall (darwin-amd64-cgo), const IPV6_FLOWLABEL_MASK = 4294905600 +pkg syscall (darwin-amd64-cgo), const IPV6_FRAGTTL = 120 +pkg syscall (darwin-amd64-cgo), const IPV6_FW_ADD = 30 +pkg syscall (darwin-amd64-cgo), const IPV6_FW_DEL = 31 +pkg syscall (darwin-amd64-cgo), const IPV6_FW_FLUSH = 32 +pkg syscall (darwin-amd64-cgo), const IPV6_FW_GET = 34 +pkg syscall (darwin-amd64-cgo), const IPV6_FW_ZERO = 33 +pkg syscall (darwin-amd64-cgo), const IPV6_HLIMDEC = 1 +pkg syscall (darwin-amd64-cgo), const IPV6_IPSEC_POLICY = 28 +pkg syscall (darwin-amd64-cgo), const IPV6_JOIN_GROUP = 12 +pkg syscall (darwin-amd64-cgo), const IPV6_LEAVE_GROUP = 13 +pkg syscall (darwin-amd64-cgo), const IPV6_MAXHLIM = 255 +pkg syscall (darwin-amd64-cgo), const IPV6_MAXOPTHDR = 2048 +pkg syscall (darwin-amd64-cgo), const IPV6_MAXPACKET = 65535 +pkg syscall (darwin-amd64-cgo), const IPV6_MAX_GROUP_SRC_FILTER = 512 +pkg syscall (darwin-amd64-cgo), const IPV6_MAX_MEMBERSHIPS = 4095 +pkg syscall (darwin-amd64-cgo), const IPV6_MAX_SOCK_SRC_FILTER = 128 +pkg syscall (darwin-amd64-cgo), const IPV6_MIN_MEMBERSHIPS = 31 +pkg syscall (darwin-amd64-cgo), const IPV6_MMTU = 1280 +pkg syscall (darwin-amd64-cgo), const IPV6_MULTICAST_HOPS = 10 +pkg syscall (darwin-amd64-cgo), const IPV6_MULTICAST_IF = 9 +pkg syscall (darwin-amd64-cgo), const IPV6_MULTICAST_LOOP = 11 +pkg syscall (darwin-amd64-cgo), const IPV6_PORTRANGE = 14 +pkg syscall (darwin-amd64-cgo), const IPV6_PORTRANGE_DEFAULT = 0 +pkg syscall (darwin-amd64-cgo), const IPV6_PORTRANGE_HIGH = 1 +pkg syscall (darwin-amd64-cgo), const IPV6_PORTRANGE_LOW = 2 +pkg syscall (darwin-amd64-cgo), const IPV6_RECVTCLASS = 35 +pkg syscall (darwin-amd64-cgo), const IPV6_RTHDR_LOOSE = 0 +pkg syscall (darwin-amd64-cgo), const IPV6_RTHDR_STRICT = 1 +pkg syscall (darwin-amd64-cgo), const IPV6_RTHDR_TYPE_0 = 0 +pkg syscall (darwin-amd64-cgo), const IPV6_SOCKOPT_RESERVED1 = 3 +pkg syscall (darwin-amd64-cgo), const IPV6_TCLASS = 36 +pkg syscall (darwin-amd64-cgo), const IPV6_UNICAST_HOPS = 4 +pkg syscall (darwin-amd64-cgo), const IPV6_V6ONLY = 27 +pkg syscall (darwin-amd64-cgo), const IPV6_VERSION = 96 +pkg syscall (darwin-amd64-cgo), const IPV6_VERSION_MASK = 240 +pkg syscall (darwin-amd64-cgo), const IP_ADD_MEMBERSHIP = 12 +pkg syscall (darwin-amd64-cgo), const IP_ADD_SOURCE_MEMBERSHIP = 70 +pkg syscall (darwin-amd64-cgo), const IP_BLOCK_SOURCE = 72 +pkg syscall (darwin-amd64-cgo), const IP_BOUND_IF = 25 +pkg syscall (darwin-amd64-cgo), const IP_DEFAULT_MULTICAST_LOOP = 1 +pkg syscall (darwin-amd64-cgo), const IP_DEFAULT_MULTICAST_TTL = 1 +pkg syscall (darwin-amd64-cgo), const IP_DF = 16384 +pkg syscall (darwin-amd64-cgo), const IP_DROP_MEMBERSHIP = 13 +pkg syscall (darwin-amd64-cgo), const IP_DROP_SOURCE_MEMBERSHIP = 71 +pkg syscall (darwin-amd64-cgo), const IP_DUMMYNET_CONFIGURE = 60 +pkg syscall (darwin-amd64-cgo), const IP_DUMMYNET_DEL = 61 +pkg syscall (darwin-amd64-cgo), const IP_DUMMYNET_FLUSH = 62 +pkg syscall (darwin-amd64-cgo), const IP_DUMMYNET_GET = 64 +pkg syscall (darwin-amd64-cgo), const IP_FAITH = 22 +pkg syscall (darwin-amd64-cgo), const IP_FW_ADD = 40 +pkg syscall (darwin-amd64-cgo), const IP_FW_DEL = 41 +pkg syscall (darwin-amd64-cgo), const IP_FW_FLUSH = 42 +pkg syscall (darwin-amd64-cgo), const IP_FW_GET = 44 +pkg syscall (darwin-amd64-cgo), const IP_FW_RESETLOG = 45 +pkg syscall (darwin-amd64-cgo), const IP_FW_ZERO = 43 +pkg syscall (darwin-amd64-cgo), const IP_HDRINCL = 2 +pkg syscall (darwin-amd64-cgo), const IP_IPSEC_POLICY = 21 +pkg syscall (darwin-amd64-cgo), const IP_MAXPACKET = 65535 +pkg syscall (darwin-amd64-cgo), const IP_MAX_GROUP_SRC_FILTER = 512 +pkg syscall (darwin-amd64-cgo), const IP_MAX_MEMBERSHIPS = 4095 +pkg syscall (darwin-amd64-cgo), const IP_MAX_SOCK_MUTE_FILTER = 128 +pkg syscall (darwin-amd64-cgo), const IP_MAX_SOCK_SRC_FILTER = 128 +pkg syscall (darwin-amd64-cgo), const IP_MF = 8192 +pkg syscall (darwin-amd64-cgo), const IP_MIN_MEMBERSHIPS = 31 +pkg syscall (darwin-amd64-cgo), const IP_MSFILTER = 74 +pkg syscall (darwin-amd64-cgo), const IP_MSS = 576 +pkg syscall (darwin-amd64-cgo), const IP_MULTICAST_IF = 9 +pkg syscall (darwin-amd64-cgo), const IP_MULTICAST_IFINDEX = 66 +pkg syscall (darwin-amd64-cgo), const IP_MULTICAST_LOOP = 11 +pkg syscall (darwin-amd64-cgo), const IP_MULTICAST_TTL = 10 +pkg syscall (darwin-amd64-cgo), const IP_MULTICAST_VIF = 14 +pkg syscall (darwin-amd64-cgo), const IP_NAT__XXX = 55 +pkg syscall (darwin-amd64-cgo), const IP_OFFMASK = 8191 +pkg syscall (darwin-amd64-cgo), const IP_OLD_FW_ADD = 50 +pkg syscall (darwin-amd64-cgo), const IP_OLD_FW_DEL = 51 +pkg syscall (darwin-amd64-cgo), const IP_OLD_FW_FLUSH = 52 +pkg syscall (darwin-amd64-cgo), const IP_OLD_FW_GET = 54 +pkg syscall (darwin-amd64-cgo), const IP_OLD_FW_RESETLOG = 56 +pkg syscall (darwin-amd64-cgo), const IP_OLD_FW_ZERO = 53 +pkg syscall (darwin-amd64-cgo), const IP_OPTIONS = 1 +pkg syscall (darwin-amd64-cgo), const IP_PKTINFO = 26 +pkg syscall (darwin-amd64-cgo), const IP_PORTRANGE = 19 +pkg syscall (darwin-amd64-cgo), const IP_PORTRANGE_DEFAULT = 0 +pkg syscall (darwin-amd64-cgo), const IP_PORTRANGE_HIGH = 1 +pkg syscall (darwin-amd64-cgo), const IP_PORTRANGE_LOW = 2 +pkg syscall (darwin-amd64-cgo), const IP_RECVDSTADDR = 7 +pkg syscall (darwin-amd64-cgo), const IP_RECVIF = 20 +pkg syscall (darwin-amd64-cgo), const IP_RECVOPTS = 5 +pkg syscall (darwin-amd64-cgo), const IP_RECVPKTINFO = 26 +pkg syscall (darwin-amd64-cgo), const IP_RECVRETOPTS = 6 +pkg syscall (darwin-amd64-cgo), const IP_RECVTTL = 24 +pkg syscall (darwin-amd64-cgo), const IP_RETOPTS = 8 +pkg syscall (darwin-amd64-cgo), const IP_RF = 32768 +pkg syscall (darwin-amd64-cgo), const IP_RSVP_OFF = 16 +pkg syscall (darwin-amd64-cgo), const IP_RSVP_ON = 15 +pkg syscall (darwin-amd64-cgo), const IP_RSVP_VIF_OFF = 18 +pkg syscall (darwin-amd64-cgo), const IP_RSVP_VIF_ON = 17 +pkg syscall (darwin-amd64-cgo), const IP_STRIPHDR = 23 +pkg syscall (darwin-amd64-cgo), const IP_TOS = 3 +pkg syscall (darwin-amd64-cgo), const IP_TRAFFIC_MGT_BACKGROUND = 65 +pkg syscall (darwin-amd64-cgo), const IP_TTL = 4 +pkg syscall (darwin-amd64-cgo), const IP_UNBLOCK_SOURCE = 73 +pkg syscall (darwin-amd64-cgo), const ISIG = 128 +pkg syscall (darwin-amd64-cgo), const ISIG ideal-int +pkg syscall (darwin-amd64-cgo), const ISTRIP = 32 +pkg syscall (darwin-amd64-cgo), const ISTRIP ideal-int +pkg syscall (darwin-amd64-cgo), const IUTF8 = 16384 +pkg syscall (darwin-amd64-cgo), const IUTF8 ideal-int +pkg syscall (darwin-amd64-cgo), const IXANY = 2048 +pkg syscall (darwin-amd64-cgo), const IXANY ideal-int +pkg syscall (darwin-amd64-cgo), const IXOFF = 1024 +pkg syscall (darwin-amd64-cgo), const IXOFF ideal-int +pkg syscall (darwin-amd64-cgo), const IXON = 512 +pkg syscall (darwin-amd64-cgo), const IXON ideal-int +pkg syscall (darwin-amd64-cgo), const ImplementsGetwd = false +pkg syscall (darwin-amd64-cgo), const LOCK_EX = 2 +pkg syscall (darwin-amd64-cgo), const LOCK_NB = 4 +pkg syscall (darwin-amd64-cgo), const LOCK_SH = 1 +pkg syscall (darwin-amd64-cgo), const LOCK_UN = 8 +pkg syscall (darwin-amd64-cgo), const MADV_CAN_REUSE = 9 +pkg syscall (darwin-amd64-cgo), const MADV_DONTNEED = 4 +pkg syscall (darwin-amd64-cgo), const MADV_FREE = 5 +pkg syscall (darwin-amd64-cgo), const MADV_FREE_REUSABLE = 7 +pkg syscall (darwin-amd64-cgo), const MADV_FREE_REUSE = 8 +pkg syscall (darwin-amd64-cgo), const MADV_NORMAL = 0 +pkg syscall (darwin-amd64-cgo), const MADV_RANDOM = 1 +pkg syscall (darwin-amd64-cgo), const MADV_SEQUENTIAL = 2 +pkg syscall (darwin-amd64-cgo), const MADV_WILLNEED = 3 +pkg syscall (darwin-amd64-cgo), const MADV_ZERO_WIRED_PAGES = 6 +pkg syscall (darwin-amd64-cgo), const MAP_ANON = 4096 +pkg syscall (darwin-amd64-cgo), const MAP_COPY = 2 +pkg syscall (darwin-amd64-cgo), const MAP_FILE = 0 +pkg syscall (darwin-amd64-cgo), const MAP_FIXED = 16 +pkg syscall (darwin-amd64-cgo), const MAP_HASSEMAPHORE = 512 +pkg syscall (darwin-amd64-cgo), const MAP_JIT = 2048 +pkg syscall (darwin-amd64-cgo), const MAP_NOCACHE = 1024 +pkg syscall (darwin-amd64-cgo), const MAP_NOEXTEND = 256 +pkg syscall (darwin-amd64-cgo), const MAP_NORESERVE = 64 +pkg syscall (darwin-amd64-cgo), const MAP_PRIVATE = 2 +pkg syscall (darwin-amd64-cgo), const MAP_RENAME = 32 +pkg syscall (darwin-amd64-cgo), const MAP_RESERVED0080 = 128 +pkg syscall (darwin-amd64-cgo), const MAP_SHARED = 1 +pkg syscall (darwin-amd64-cgo), const MCL_CURRENT = 1 +pkg syscall (darwin-amd64-cgo), const MCL_FUTURE = 2 +pkg syscall (darwin-amd64-cgo), const MSG_CTRUNC = 32 +pkg syscall (darwin-amd64-cgo), const MSG_DONTROUTE = 4 +pkg syscall (darwin-amd64-cgo), const MSG_DONTWAIT = 128 +pkg syscall (darwin-amd64-cgo), const MSG_EOF = 256 +pkg syscall (darwin-amd64-cgo), const MSG_EOR = 8 +pkg syscall (darwin-amd64-cgo), const MSG_FLUSH = 1024 +pkg syscall (darwin-amd64-cgo), const MSG_HAVEMORE = 8192 +pkg syscall (darwin-amd64-cgo), const MSG_HOLD = 2048 +pkg syscall (darwin-amd64-cgo), const MSG_NEEDSA = 65536 +pkg syscall (darwin-amd64-cgo), const MSG_OOB = 1 +pkg syscall (darwin-amd64-cgo), const MSG_PEEK = 2 +pkg syscall (darwin-amd64-cgo), const MSG_RCVMORE = 16384 +pkg syscall (darwin-amd64-cgo), const MSG_SEND = 4096 +pkg syscall (darwin-amd64-cgo), const MSG_TRUNC = 16 +pkg syscall (darwin-amd64-cgo), const MSG_WAITALL = 64 +pkg syscall (darwin-amd64-cgo), const MSG_WAITSTREAM = 512 +pkg syscall (darwin-amd64-cgo), const MS_ASYNC = 1 +pkg syscall (darwin-amd64-cgo), const MS_DEACTIVATE = 8 +pkg syscall (darwin-amd64-cgo), const MS_INVALIDATE = 2 +pkg syscall (darwin-amd64-cgo), const MS_KILLPAGES = 4 +pkg syscall (darwin-amd64-cgo), const MS_SYNC = 16 +pkg syscall (darwin-amd64-cgo), const NAME_MAX = 255 +pkg syscall (darwin-amd64-cgo), const NET_RT_DUMP = 1 +pkg syscall (darwin-amd64-cgo), const NET_RT_DUMP2 = 7 +pkg syscall (darwin-amd64-cgo), const NET_RT_FLAGS = 2 +pkg syscall (darwin-amd64-cgo), const NET_RT_IFLIST = 3 +pkg syscall (darwin-amd64-cgo), const NET_RT_IFLIST2 = 6 +pkg syscall (darwin-amd64-cgo), const NET_RT_MAXID = 10 +pkg syscall (darwin-amd64-cgo), const NET_RT_STAT = 4 +pkg syscall (darwin-amd64-cgo), const NET_RT_TRASH = 5 +pkg syscall (darwin-amd64-cgo), const NOFLSH = 2147483648 +pkg syscall (darwin-amd64-cgo), const NOFLSH ideal-int +pkg syscall (darwin-amd64-cgo), const NOTE_ABSOLUTE = 8 +pkg syscall (darwin-amd64-cgo), const NOTE_ATTRIB = 8 +pkg syscall (darwin-amd64-cgo), const NOTE_CHILD = 4 +pkg syscall (darwin-amd64-cgo), const NOTE_DELETE = 1 +pkg syscall (darwin-amd64-cgo), const NOTE_EXEC = 536870912 +pkg syscall (darwin-amd64-cgo), const NOTE_EXIT = 2147483648 +pkg syscall (darwin-amd64-cgo), const NOTE_EXITSTATUS = 67108864 +pkg syscall (darwin-amd64-cgo), const NOTE_EXTEND = 4 +pkg syscall (darwin-amd64-cgo), const NOTE_FFAND = 1073741824 +pkg syscall (darwin-amd64-cgo), const NOTE_FFCOPY = 3221225472 +pkg syscall (darwin-amd64-cgo), const NOTE_FFCTRLMASK = 3221225472 +pkg syscall (darwin-amd64-cgo), const NOTE_FFLAGSMASK = 16777215 +pkg syscall (darwin-amd64-cgo), const NOTE_FFNOP = 0 +pkg syscall (darwin-amd64-cgo), const NOTE_FFOR = 2147483648 +pkg syscall (darwin-amd64-cgo), const NOTE_FORK = 1073741824 +pkg syscall (darwin-amd64-cgo), const NOTE_LINK = 16 +pkg syscall (darwin-amd64-cgo), const NOTE_LOWAT = 1 +pkg syscall (darwin-amd64-cgo), const NOTE_NONE = 128 +pkg syscall (darwin-amd64-cgo), const NOTE_NSECONDS = 4 +pkg syscall (darwin-amd64-cgo), const NOTE_PCTRLMASK = -1048576 +pkg syscall (darwin-amd64-cgo), const NOTE_PDATAMASK = 1048575 +pkg syscall (darwin-amd64-cgo), const NOTE_REAP = 268435456 +pkg syscall (darwin-amd64-cgo), const NOTE_RENAME = 32 +pkg syscall (darwin-amd64-cgo), const NOTE_RESOURCEEND = 33554432 +pkg syscall (darwin-amd64-cgo), const NOTE_REVOKE = 64 +pkg syscall (darwin-amd64-cgo), const NOTE_SECONDS = 1 +pkg syscall (darwin-amd64-cgo), const NOTE_SIGNAL = 134217728 +pkg syscall (darwin-amd64-cgo), const NOTE_TRACK = 1 +pkg syscall (darwin-amd64-cgo), const NOTE_TRACKERR = 2 +pkg syscall (darwin-amd64-cgo), const NOTE_TRIGGER = 16777216 +pkg syscall (darwin-amd64-cgo), const NOTE_USECONDS = 2 +pkg syscall (darwin-amd64-cgo), const NOTE_VM_ERROR = 268435456 +pkg syscall (darwin-amd64-cgo), const NOTE_VM_PRESSURE = 2147483648 +pkg syscall (darwin-amd64-cgo), const NOTE_VM_PRESSURE_SUDDEN_TERMINATE = 536870912 +pkg syscall (darwin-amd64-cgo), const NOTE_VM_PRESSURE_TERMINATE = 1073741824 +pkg syscall (darwin-amd64-cgo), const NOTE_WRITE = 2 +pkg syscall (darwin-amd64-cgo), const OCRNL = 16 +pkg syscall (darwin-amd64-cgo), const OCRNL ideal-int +pkg syscall (darwin-amd64-cgo), const OFDEL = 131072 +pkg syscall (darwin-amd64-cgo), const OFDEL ideal-int +pkg syscall (darwin-amd64-cgo), const OFILL = 128 +pkg syscall (darwin-amd64-cgo), const OFILL ideal-int +pkg syscall (darwin-amd64-cgo), const ONLCR = 2 +pkg syscall (darwin-amd64-cgo), const ONLCR ideal-int +pkg syscall (darwin-amd64-cgo), const ONLRET = 64 +pkg syscall (darwin-amd64-cgo), const ONLRET ideal-int +pkg syscall (darwin-amd64-cgo), const ONOCR = 32 +pkg syscall (darwin-amd64-cgo), const ONOCR ideal-int +pkg syscall (darwin-amd64-cgo), const ONOEOT = 8 +pkg syscall (darwin-amd64-cgo), const ONOEOT ideal-int +pkg syscall (darwin-amd64-cgo), const OPOST = 1 +pkg syscall (darwin-amd64-cgo), const OPOST ideal-int +pkg syscall (darwin-amd64-cgo), const O_ACCMODE = 3 +pkg syscall (darwin-amd64-cgo), const O_ALERT = 536870912 +pkg syscall (darwin-amd64-cgo), const O_APPEND = 8 +pkg syscall (darwin-amd64-cgo), const O_ASYNC = 64 +pkg syscall (darwin-amd64-cgo), const O_CLOEXEC = 16777216 +pkg syscall (darwin-amd64-cgo), const O_CREAT = 512 +pkg syscall (darwin-amd64-cgo), const O_DIRECTORY = 1048576 +pkg syscall (darwin-amd64-cgo), const O_DSYNC = 4194304 +pkg syscall (darwin-amd64-cgo), const O_EVTONLY = 32768 +pkg syscall (darwin-amd64-cgo), const O_EXCL = 2048 +pkg syscall (darwin-amd64-cgo), const O_EXLOCK = 32 +pkg syscall (darwin-amd64-cgo), const O_FSYNC = 128 +pkg syscall (darwin-amd64-cgo), const O_NDELAY = 4 +pkg syscall (darwin-amd64-cgo), const O_NOCTTY = 131072 +pkg syscall (darwin-amd64-cgo), const O_NOFOLLOW = 256 +pkg syscall (darwin-amd64-cgo), const O_NONBLOCK = 4 +pkg syscall (darwin-amd64-cgo), const O_POPUP = 2147483648 +pkg syscall (darwin-amd64-cgo), const O_SHLOCK = 16 +pkg syscall (darwin-amd64-cgo), const O_SYMLINK = 2097152 +pkg syscall (darwin-amd64-cgo), const O_SYNC = 128 +pkg syscall (darwin-amd64-cgo), const O_TRUNC = 1024 +pkg syscall (darwin-amd64-cgo), const PARENB = 4096 +pkg syscall (darwin-amd64-cgo), const PARENB ideal-int +pkg syscall (darwin-amd64-cgo), const PARMRK = 8 +pkg syscall (darwin-amd64-cgo), const PARMRK ideal-int +pkg syscall (darwin-amd64-cgo), const PARODD = 8192 +pkg syscall (darwin-amd64-cgo), const PARODD ideal-int +pkg syscall (darwin-amd64-cgo), const PENDIN = 536870912 +pkg syscall (darwin-amd64-cgo), const PENDIN ideal-int +pkg syscall (darwin-amd64-cgo), const PROT_EXEC = 4 +pkg syscall (darwin-amd64-cgo), const PROT_NONE = 0 +pkg syscall (darwin-amd64-cgo), const PROT_READ = 1 +pkg syscall (darwin-amd64-cgo), const PROT_WRITE = 2 +pkg syscall (darwin-amd64-cgo), const PTRACE_CONT = 7 +pkg syscall (darwin-amd64-cgo), const PTRACE_KILL = 8 +pkg syscall (darwin-amd64-cgo), const PTRACE_TRACEME = 0 +pkg syscall (darwin-amd64-cgo), const PT_ATTACH = 10 +pkg syscall (darwin-amd64-cgo), const PT_ATTACHEXC = 14 +pkg syscall (darwin-amd64-cgo), const PT_CONTINUE = 7 +pkg syscall (darwin-amd64-cgo), const PT_DENY_ATTACH = 31 +pkg syscall (darwin-amd64-cgo), const PT_DETACH = 11 +pkg syscall (darwin-amd64-cgo), const PT_FIRSTMACH = 32 +pkg syscall (darwin-amd64-cgo), const PT_FORCEQUOTA = 30 +pkg syscall (darwin-amd64-cgo), const PT_KILL = 8 +pkg syscall (darwin-amd64-cgo), const PT_READ_D = 2 +pkg syscall (darwin-amd64-cgo), const PT_READ_I = 1 +pkg syscall (darwin-amd64-cgo), const PT_READ_U = 3 +pkg syscall (darwin-amd64-cgo), const PT_SIGEXC = 12 +pkg syscall (darwin-amd64-cgo), const PT_STEP = 9 +pkg syscall (darwin-amd64-cgo), const PT_THUPDATE = 13 +pkg syscall (darwin-amd64-cgo), const PT_TRACE_ME = 0 +pkg syscall (darwin-amd64-cgo), const PT_WRITE_D = 5 +pkg syscall (darwin-amd64-cgo), const PT_WRITE_I = 4 +pkg syscall (darwin-amd64-cgo), const PT_WRITE_U = 6 +pkg syscall (darwin-amd64-cgo), const RLIMIT_AS = 5 +pkg syscall (darwin-amd64-cgo), const RLIMIT_CORE = 4 +pkg syscall (darwin-amd64-cgo), const RLIMIT_CPU = 0 +pkg syscall (darwin-amd64-cgo), const RLIMIT_DATA = 2 +pkg syscall (darwin-amd64-cgo), const RLIMIT_FSIZE = 1 +pkg syscall (darwin-amd64-cgo), const RLIMIT_NOFILE = 8 +pkg syscall (darwin-amd64-cgo), const RLIMIT_STACK = 3 +pkg syscall (darwin-amd64-cgo), const RLIM_INFINITY = 9223372036854775807 +pkg syscall (darwin-amd64-cgo), const RTAX_AUTHOR = 6 +pkg syscall (darwin-amd64-cgo), const RTAX_BRD = 7 +pkg syscall (darwin-amd64-cgo), const RTAX_DST = 0 +pkg syscall (darwin-amd64-cgo), const RTAX_GATEWAY = 1 +pkg syscall (darwin-amd64-cgo), const RTAX_GENMASK = 3 +pkg syscall (darwin-amd64-cgo), const RTAX_IFA = 5 +pkg syscall (darwin-amd64-cgo), const RTAX_IFP = 4 +pkg syscall (darwin-amd64-cgo), const RTAX_MAX = 8 +pkg syscall (darwin-amd64-cgo), const RTAX_NETMASK = 2 +pkg syscall (darwin-amd64-cgo), const RTA_AUTHOR = 64 +pkg syscall (darwin-amd64-cgo), const RTA_BRD = 128 +pkg syscall (darwin-amd64-cgo), const RTA_DST = 1 +pkg syscall (darwin-amd64-cgo), const RTA_GATEWAY = 2 +pkg syscall (darwin-amd64-cgo), const RTA_GENMASK = 8 +pkg syscall (darwin-amd64-cgo), const RTA_IFA = 32 +pkg syscall (darwin-amd64-cgo), const RTA_IFP = 16 +pkg syscall (darwin-amd64-cgo), const RTA_NETMASK = 4 +pkg syscall (darwin-amd64-cgo), const RTF_BLACKHOLE = 4096 +pkg syscall (darwin-amd64-cgo), const RTF_BROADCAST = 4194304 +pkg syscall (darwin-amd64-cgo), const RTF_CLONING = 256 +pkg syscall (darwin-amd64-cgo), const RTF_CONDEMNED = 33554432 +pkg syscall (darwin-amd64-cgo), const RTF_DELCLONE = 128 +pkg syscall (darwin-amd64-cgo), const RTF_DONE = 64 +pkg syscall (darwin-amd64-cgo), const RTF_DYNAMIC = 16 +pkg syscall (darwin-amd64-cgo), const RTF_GATEWAY = 2 +pkg syscall (darwin-amd64-cgo), const RTF_HOST = 4 +pkg syscall (darwin-amd64-cgo), const RTF_IFREF = 67108864 +pkg syscall (darwin-amd64-cgo), const RTF_IFSCOPE = 16777216 +pkg syscall (darwin-amd64-cgo), const RTF_LLINFO = 1024 +pkg syscall (darwin-amd64-cgo), const RTF_LOCAL = 2097152 +pkg syscall (darwin-amd64-cgo), const RTF_MODIFIED = 32 +pkg syscall (darwin-amd64-cgo), const RTF_MULTICAST = 8388608 +pkg syscall (darwin-amd64-cgo), const RTF_PINNED = 1048576 +pkg syscall (darwin-amd64-cgo), const RTF_PRCLONING = 65536 +pkg syscall (darwin-amd64-cgo), const RTF_PROTO1 = 32768 +pkg syscall (darwin-amd64-cgo), const RTF_PROTO2 = 16384 +pkg syscall (darwin-amd64-cgo), const RTF_PROTO3 = 262144 +pkg syscall (darwin-amd64-cgo), const RTF_REJECT = 8 +pkg syscall (darwin-amd64-cgo), const RTF_STATIC = 2048 +pkg syscall (darwin-amd64-cgo), const RTF_UP = 1 +pkg syscall (darwin-amd64-cgo), const RTF_WASCLONED = 131072 +pkg syscall (darwin-amd64-cgo), const RTF_XRESOLVE = 512 +pkg syscall (darwin-amd64-cgo), const RTM_ADD = 1 +pkg syscall (darwin-amd64-cgo), const RTM_CHANGE = 3 +pkg syscall (darwin-amd64-cgo), const RTM_DELADDR = 13 +pkg syscall (darwin-amd64-cgo), const RTM_DELETE = 2 +pkg syscall (darwin-amd64-cgo), const RTM_DELMADDR = 16 +pkg syscall (darwin-amd64-cgo), const RTM_GET = 4 +pkg syscall (darwin-amd64-cgo), const RTM_GET2 = 20 +pkg syscall (darwin-amd64-cgo), const RTM_IFINFO = 14 +pkg syscall (darwin-amd64-cgo), const RTM_IFINFO2 = 18 +pkg syscall (darwin-amd64-cgo), const RTM_LOCK = 8 +pkg syscall (darwin-amd64-cgo), const RTM_LOSING = 5 +pkg syscall (darwin-amd64-cgo), const RTM_MISS = 7 +pkg syscall (darwin-amd64-cgo), const RTM_NEWADDR = 12 +pkg syscall (darwin-amd64-cgo), const RTM_NEWMADDR = 15 +pkg syscall (darwin-amd64-cgo), const RTM_NEWMADDR2 = 19 +pkg syscall (darwin-amd64-cgo), const RTM_OLDADD = 9 +pkg syscall (darwin-amd64-cgo), const RTM_OLDDEL = 10 +pkg syscall (darwin-amd64-cgo), const RTM_REDIRECT = 6 +pkg syscall (darwin-amd64-cgo), const RTM_RESOLVE = 11 +pkg syscall (darwin-amd64-cgo), const RTM_RTTUNIT = 1000000 +pkg syscall (darwin-amd64-cgo), const RTM_VERSION = 5 +pkg syscall (darwin-amd64-cgo), const RTV_EXPIRE = 4 +pkg syscall (darwin-amd64-cgo), const RTV_HOPCOUNT = 2 +pkg syscall (darwin-amd64-cgo), const RTV_MTU = 1 +pkg syscall (darwin-amd64-cgo), const RTV_RPIPE = 8 +pkg syscall (darwin-amd64-cgo), const RTV_RTT = 64 +pkg syscall (darwin-amd64-cgo), const RTV_RTTVAR = 128 +pkg syscall (darwin-amd64-cgo), const RTV_SPIPE = 16 +pkg syscall (darwin-amd64-cgo), const RTV_SSTHRESH = 32 +pkg syscall (darwin-amd64-cgo), const RUSAGE_CHILDREN = -1 +pkg syscall (darwin-amd64-cgo), const RUSAGE_SELF = 0 +pkg syscall (darwin-amd64-cgo), const SCM_CREDS = 3 +pkg syscall (darwin-amd64-cgo), const SCM_RIGHTS = 1 +pkg syscall (darwin-amd64-cgo), const SCM_TIMESTAMP = 2 +pkg syscall (darwin-amd64-cgo), const SCM_TIMESTAMP_MONOTONIC = 4 +pkg syscall (darwin-amd64-cgo), const SIGBUS = 10 +pkg syscall (darwin-amd64-cgo), const SIGCHLD = 20 +pkg syscall (darwin-amd64-cgo), const SIGCONT = 19 +pkg syscall (darwin-amd64-cgo), const SIGEMT = 7 +pkg syscall (darwin-amd64-cgo), const SIGINFO = 29 +pkg syscall (darwin-amd64-cgo), const SIGIO = 23 +pkg syscall (darwin-amd64-cgo), const SIGIOT = 6 +pkg syscall (darwin-amd64-cgo), const SIGPROF = 27 +pkg syscall (darwin-amd64-cgo), const SIGSTOP = 17 +pkg syscall (darwin-amd64-cgo), const SIGSYS = 12 +pkg syscall (darwin-amd64-cgo), const SIGTSTP = 18 +pkg syscall (darwin-amd64-cgo), const SIGTTIN = 21 +pkg syscall (darwin-amd64-cgo), const SIGTTOU = 22 +pkg syscall (darwin-amd64-cgo), const SIGURG = 16 +pkg syscall (darwin-amd64-cgo), const SIGUSR1 = 30 +pkg syscall (darwin-amd64-cgo), const SIGUSR2 = 31 +pkg syscall (darwin-amd64-cgo), const SIGVTALRM = 26 +pkg syscall (darwin-amd64-cgo), const SIGWINCH = 28 +pkg syscall (darwin-amd64-cgo), const SIGXCPU = 24 +pkg syscall (darwin-amd64-cgo), const SIGXFSZ = 25 +pkg syscall (darwin-amd64-cgo), const SIOCADDMULTI = 2149607729 +pkg syscall (darwin-amd64-cgo), const SIOCAIFADDR = 2151704858 +pkg syscall (darwin-amd64-cgo), const SIOCALIFADDR = 2165860637 +pkg syscall (darwin-amd64-cgo), const SIOCARPIPLL = 3223349544 +pkg syscall (darwin-amd64-cgo), const SIOCATMARK = 1074033415 +pkg syscall (darwin-amd64-cgo), const SIOCAUTOADDR = 3223349542 +pkg syscall (darwin-amd64-cgo), const SIOCAUTONETMASK = 2149607719 +pkg syscall (darwin-amd64-cgo), const SIOCDELMULTI = 2149607730 +pkg syscall (darwin-amd64-cgo), const SIOCDIFADDR = 2149607705 +pkg syscall (darwin-amd64-cgo), const SIOCDIFPHYADDR = 2149607745 +pkg syscall (darwin-amd64-cgo), const SIOCDLIFADDR = 2165860639 +pkg syscall (darwin-amd64-cgo), const SIOCGDRVSPEC = 3223873915 +pkg syscall (darwin-amd64-cgo), const SIOCGETSGCNT = 3222565404 +pkg syscall (darwin-amd64-cgo), const SIOCGETVIFCNT = 3222565403 +pkg syscall (darwin-amd64-cgo), const SIOCGETVLAN = 3223349631 +pkg syscall (darwin-amd64-cgo), const SIOCGHIWAT = 1074033409 +pkg syscall (darwin-amd64-cgo), const SIOCGIFADDR = 3223349537 +pkg syscall (darwin-amd64-cgo), const SIOCGIFALTMTU = 3223349576 +pkg syscall (darwin-amd64-cgo), const SIOCGIFASYNCMAP = 3223349628 +pkg syscall (darwin-amd64-cgo), const SIOCGIFBOND = 3223349575 +pkg syscall (darwin-amd64-cgo), const SIOCGIFBRDADDR = 3223349539 +pkg syscall (darwin-amd64-cgo), const SIOCGIFCAP = 3223349595 +pkg syscall (darwin-amd64-cgo), const SIOCGIFCONF = 3222038820 +pkg syscall (darwin-amd64-cgo), const SIOCGIFDEVMTU = 3223349572 +pkg syscall (darwin-amd64-cgo), const SIOCGIFDSTADDR = 3223349538 +pkg syscall (darwin-amd64-cgo), const SIOCGIFFLAGS = 3223349521 +pkg syscall (darwin-amd64-cgo), const SIOCGIFGENERIC = 3223349562 +pkg syscall (darwin-amd64-cgo), const SIOCGIFKPI = 3223349639 +pkg syscall (darwin-amd64-cgo), const SIOCGIFMAC = 3223349634 +pkg syscall (darwin-amd64-cgo), const SIOCGIFMEDIA = 3224135992 +pkg syscall (darwin-amd64-cgo), const SIOCGIFMETRIC = 3223349527 +pkg syscall (darwin-amd64-cgo), const SIOCGIFMTU = 3223349555 +pkg syscall (darwin-amd64-cgo), const SIOCGIFNETMASK = 3223349541 +pkg syscall (darwin-amd64-cgo), const SIOCGIFPDSTADDR = 3223349568 +pkg syscall (darwin-amd64-cgo), const SIOCGIFPHYS = 3223349557 +pkg syscall (darwin-amd64-cgo), const SIOCGIFPSRCADDR = 3223349567 +pkg syscall (darwin-amd64-cgo), const SIOCGIFSTATUS = 3274795325 +pkg syscall (darwin-amd64-cgo), const SIOCGIFVLAN = 3223349631 +pkg syscall (darwin-amd64-cgo), const SIOCGIFWAKEFLAGS = 3223349640 +pkg syscall (darwin-amd64-cgo), const SIOCGLIFADDR = 3239602462 +pkg syscall (darwin-amd64-cgo), const SIOCGLIFPHYADDR = 3239602499 +pkg syscall (darwin-amd64-cgo), const SIOCGLOWAT = 1074033411 +pkg syscall (darwin-amd64-cgo), const SIOCGPGRP = 1074033417 +pkg syscall (darwin-amd64-cgo), const SIOCIFCREATE = 3223349624 +pkg syscall (darwin-amd64-cgo), const SIOCIFCREATE2 = 3223349626 +pkg syscall (darwin-amd64-cgo), const SIOCIFDESTROY = 2149607801 +pkg syscall (darwin-amd64-cgo), const SIOCRSLVMULTI = 3222300987 +pkg syscall (darwin-amd64-cgo), const SIOCSDRVSPEC = 2150132091 +pkg syscall (darwin-amd64-cgo), const SIOCSETVLAN = 2149607806 +pkg syscall (darwin-amd64-cgo), const SIOCSHIWAT = 2147775232 +pkg syscall (darwin-amd64-cgo), const SIOCSIFADDR = 2149607692 +pkg syscall (darwin-amd64-cgo), const SIOCSIFALTMTU = 2149607749 +pkg syscall (darwin-amd64-cgo), const SIOCSIFASYNCMAP = 2149607805 +pkg syscall (darwin-amd64-cgo), const SIOCSIFBOND = 2149607750 +pkg syscall (darwin-amd64-cgo), const SIOCSIFBRDADDR = 2149607699 +pkg syscall (darwin-amd64-cgo), const SIOCSIFCAP = 2149607770 +pkg syscall (darwin-amd64-cgo), const SIOCSIFDSTADDR = 2149607694 +pkg syscall (darwin-amd64-cgo), const SIOCSIFFLAGS = 2149607696 +pkg syscall (darwin-amd64-cgo), const SIOCSIFGENERIC = 2149607737 +pkg syscall (darwin-amd64-cgo), const SIOCSIFKPI = 2149607814 +pkg syscall (darwin-amd64-cgo), const SIOCSIFLLADDR = 2149607740 +pkg syscall (darwin-amd64-cgo), const SIOCSIFMAC = 2149607811 +pkg syscall (darwin-amd64-cgo), const SIOCSIFMEDIA = 3223349559 +pkg syscall (darwin-amd64-cgo), const SIOCSIFMETRIC = 2149607704 +pkg syscall (darwin-amd64-cgo), const SIOCSIFMTU = 2149607732 +pkg syscall (darwin-amd64-cgo), const SIOCSIFNETMASK = 2149607702 +pkg syscall (darwin-amd64-cgo), const SIOCSIFPHYADDR = 2151704894 +pkg syscall (darwin-amd64-cgo), const SIOCSIFPHYS = 2149607734 +pkg syscall (darwin-amd64-cgo), const SIOCSIFVLAN = 2149607806 +pkg syscall (darwin-amd64-cgo), const SIOCSLIFPHYADDR = 2165860674 +pkg syscall (darwin-amd64-cgo), const SIOCSLOWAT = 2147775234 +pkg syscall (darwin-amd64-cgo), const SIOCSPGRP = 2147775240 +pkg syscall (darwin-amd64-cgo), const SOCK_MAXADDRLEN = 255 +pkg syscall (darwin-amd64-cgo), const SOCK_RDM = 4 +pkg syscall (darwin-amd64-cgo), const SOL_SOCKET = 65535 +pkg syscall (darwin-amd64-cgo), const SOMAXCONN = 128 +pkg syscall (darwin-amd64-cgo), const SO_ACCEPTCONN = 2 +pkg syscall (darwin-amd64-cgo), const SO_BROADCAST = 32 +pkg syscall (darwin-amd64-cgo), const SO_DEBUG = 1 +pkg syscall (darwin-amd64-cgo), const SO_DONTROUTE = 16 +pkg syscall (darwin-amd64-cgo), const SO_DONTTRUNC = 8192 +pkg syscall (darwin-amd64-cgo), const SO_ERROR = 4103 +pkg syscall (darwin-amd64-cgo), const SO_KEEPALIVE = 8 +pkg syscall (darwin-amd64-cgo), const SO_LABEL = 4112 +pkg syscall (darwin-amd64-cgo), const SO_LINGER = 128 +pkg syscall (darwin-amd64-cgo), const SO_LINGER_SEC = 4224 +pkg syscall (darwin-amd64-cgo), const SO_NKE = 4129 +pkg syscall (darwin-amd64-cgo), const SO_NOADDRERR = 4131 +pkg syscall (darwin-amd64-cgo), const SO_NOSIGPIPE = 4130 +pkg syscall (darwin-amd64-cgo), const SO_NOTIFYCONFLICT = 4134 +pkg syscall (darwin-amd64-cgo), const SO_NP_EXTENSIONS = 4227 +pkg syscall (darwin-amd64-cgo), const SO_NREAD = 4128 +pkg syscall (darwin-amd64-cgo), const SO_NWRITE = 4132 +pkg syscall (darwin-amd64-cgo), const SO_OOBINLINE = 256 +pkg syscall (darwin-amd64-cgo), const SO_PEERLABEL = 4113 +pkg syscall (darwin-amd64-cgo), const SO_RANDOMPORT = 4226 +pkg syscall (darwin-amd64-cgo), const SO_RCVBUF = 4098 +pkg syscall (darwin-amd64-cgo), const SO_RCVLOWAT = 4100 +pkg syscall (darwin-amd64-cgo), const SO_RCVTIMEO = 4102 +pkg syscall (darwin-amd64-cgo), const SO_RESTRICTIONS = 4225 +pkg syscall (darwin-amd64-cgo), const SO_RESTRICT_DENYIN = 1 +pkg syscall (darwin-amd64-cgo), const SO_RESTRICT_DENYOUT = 2 +pkg syscall (darwin-amd64-cgo), const SO_RESTRICT_DENYSET = 2147483648 +pkg syscall (darwin-amd64-cgo), const SO_REUSEADDR = 4 +pkg syscall (darwin-amd64-cgo), const SO_REUSEPORT = 512 +pkg syscall (darwin-amd64-cgo), const SO_REUSESHAREUID = 4133 +pkg syscall (darwin-amd64-cgo), const SO_SNDBUF = 4097 +pkg syscall (darwin-amd64-cgo), const SO_SNDLOWAT = 4099 +pkg syscall (darwin-amd64-cgo), const SO_SNDTIMEO = 4101 +pkg syscall (darwin-amd64-cgo), const SO_TIMESTAMP = 1024 +pkg syscall (darwin-amd64-cgo), const SO_TIMESTAMP_MONOTONIC = 2048 +pkg syscall (darwin-amd64-cgo), const SO_TYPE = 4104 +pkg syscall (darwin-amd64-cgo), const SO_UPCALLCLOSEWAIT = 4135 +pkg syscall (darwin-amd64-cgo), const SO_USELOOPBACK = 64 +pkg syscall (darwin-amd64-cgo), const SO_WANTMORE = 16384 +pkg syscall (darwin-amd64-cgo), const SO_WANTOOBFLAG = 32768 +pkg syscall (darwin-amd64-cgo), const SYS_ACCEPT = 30 +pkg syscall (darwin-amd64-cgo), const SYS_ACCEPT_NOCANCEL = 404 +pkg syscall (darwin-amd64-cgo), const SYS_ACCESS = 33 +pkg syscall (darwin-amd64-cgo), const SYS_ACCESS_EXTENDED = 284 +pkg syscall (darwin-amd64-cgo), const SYS_ACCT = 51 +pkg syscall (darwin-amd64-cgo), const SYS_ADD_PROFIL = 176 +pkg syscall (darwin-amd64-cgo), const SYS_ADJTIME = 140 +pkg syscall (darwin-amd64-cgo), const SYS_AIO_CANCEL = 316 +pkg syscall (darwin-amd64-cgo), const SYS_AIO_ERROR = 317 +pkg syscall (darwin-amd64-cgo), const SYS_AIO_FSYNC = 313 +pkg syscall (darwin-amd64-cgo), const SYS_AIO_READ = 318 +pkg syscall (darwin-amd64-cgo), const SYS_AIO_RETURN = 314 +pkg syscall (darwin-amd64-cgo), const SYS_AIO_SUSPEND = 315 +pkg syscall (darwin-amd64-cgo), const SYS_AIO_SUSPEND_NOCANCEL = 421 +pkg syscall (darwin-amd64-cgo), const SYS_AIO_WRITE = 319 +pkg syscall (darwin-amd64-cgo), const SYS_ATGETMSG = 207 +pkg syscall (darwin-amd64-cgo), const SYS_ATPGETREQ = 211 +pkg syscall (darwin-amd64-cgo), const SYS_ATPGETRSP = 212 +pkg syscall (darwin-amd64-cgo), const SYS_ATPSNDREQ = 209 +pkg syscall (darwin-amd64-cgo), const SYS_ATPSNDRSP = 210 +pkg syscall (darwin-amd64-cgo), const SYS_ATPUTMSG = 208 +pkg syscall (darwin-amd64-cgo), const SYS_ATSOCKET = 206 +pkg syscall (darwin-amd64-cgo), const SYS_AUDIT = 350 +pkg syscall (darwin-amd64-cgo), const SYS_AUDITCTL = 359 +pkg syscall (darwin-amd64-cgo), const SYS_AUDITON = 351 +pkg syscall (darwin-amd64-cgo), const SYS_AUDIT_SESSION_JOIN = 429 +pkg syscall (darwin-amd64-cgo), const SYS_AUDIT_SESSION_PORT = 432 +pkg syscall (darwin-amd64-cgo), const SYS_AUDIT_SESSION_SELF = 428 +pkg syscall (darwin-amd64-cgo), const SYS_BIND = 104 +pkg syscall (darwin-amd64-cgo), const SYS_BSDTHREAD_CREATE = 360 +pkg syscall (darwin-amd64-cgo), const SYS_BSDTHREAD_REGISTER = 366 +pkg syscall (darwin-amd64-cgo), const SYS_BSDTHREAD_TERMINATE = 361 +pkg syscall (darwin-amd64-cgo), const SYS_CHDIR = 12 +pkg syscall (darwin-amd64-cgo), const SYS_CHFLAGS = 34 +pkg syscall (darwin-amd64-cgo), const SYS_CHMOD = 15 +pkg syscall (darwin-amd64-cgo), const SYS_CHMOD_EXTENDED = 282 +pkg syscall (darwin-amd64-cgo), const SYS_CHOWN = 16 +pkg syscall (darwin-amd64-cgo), const SYS_CHROOT = 61 +pkg syscall (darwin-amd64-cgo), const SYS_CHUD = 185 +pkg syscall (darwin-amd64-cgo), const SYS_CLOSE = 6 +pkg syscall (darwin-amd64-cgo), const SYS_CLOSE_NOCANCEL = 399 +pkg syscall (darwin-amd64-cgo), const SYS_CONNECT = 98 +pkg syscall (darwin-amd64-cgo), const SYS_CONNECT_NOCANCEL = 409 +pkg syscall (darwin-amd64-cgo), const SYS_COPYFILE = 227 +pkg syscall (darwin-amd64-cgo), const SYS_CSOPS = 169 +pkg syscall (darwin-amd64-cgo), const SYS_DELETE = 226 +pkg syscall (darwin-amd64-cgo), const SYS_DUP = 41 +pkg syscall (darwin-amd64-cgo), const SYS_DUP2 = 90 +pkg syscall (darwin-amd64-cgo), const SYS_EXCHANGEDATA = 223 +pkg syscall (darwin-amd64-cgo), const SYS_EXECVE = 59 +pkg syscall (darwin-amd64-cgo), const SYS_EXIT = 1 +pkg syscall (darwin-amd64-cgo), const SYS_FCHDIR = 13 +pkg syscall (darwin-amd64-cgo), const SYS_FCHFLAGS = 35 +pkg syscall (darwin-amd64-cgo), const SYS_FCHMOD = 124 +pkg syscall (darwin-amd64-cgo), const SYS_FCHMOD_EXTENDED = 283 +pkg syscall (darwin-amd64-cgo), const SYS_FCHOWN = 123 +pkg syscall (darwin-amd64-cgo), const SYS_FCNTL = 92 +pkg syscall (darwin-amd64-cgo), const SYS_FCNTL_NOCANCEL = 406 +pkg syscall (darwin-amd64-cgo), const SYS_FDATASYNC = 187 +pkg syscall (darwin-amd64-cgo), const SYS_FFSCTL = 245 +pkg syscall (darwin-amd64-cgo), const SYS_FGETATTRLIST = 228 +pkg syscall (darwin-amd64-cgo), const SYS_FGETXATTR = 235 +pkg syscall (darwin-amd64-cgo), const SYS_FHOPEN = 248 +pkg syscall (darwin-amd64-cgo), const SYS_FILEPORT_MAKEFD = 431 +pkg syscall (darwin-amd64-cgo), const SYS_FILEPORT_MAKEPORT = 430 +pkg syscall (darwin-amd64-cgo), const SYS_FLISTXATTR = 241 +pkg syscall (darwin-amd64-cgo), const SYS_FLOCK = 131 +pkg syscall (darwin-amd64-cgo), const SYS_FORK = 2 +pkg syscall (darwin-amd64-cgo), const SYS_FPATHCONF = 192 +pkg syscall (darwin-amd64-cgo), const SYS_FREMOVEXATTR = 239 +pkg syscall (darwin-amd64-cgo), const SYS_FSCTL = 242 +pkg syscall (darwin-amd64-cgo), const SYS_FSETATTRLIST = 229 +pkg syscall (darwin-amd64-cgo), const SYS_FSETXATTR = 237 +pkg syscall (darwin-amd64-cgo), const SYS_FSGETPATH = 427 +pkg syscall (darwin-amd64-cgo), const SYS_FSTAT = 189 +pkg syscall (darwin-amd64-cgo), const SYS_FSTAT64 = 339 +pkg syscall (darwin-amd64-cgo), const SYS_FSTAT64_EXTENDED = 343 +pkg syscall (darwin-amd64-cgo), const SYS_FSTATFS = 158 +pkg syscall (darwin-amd64-cgo), const SYS_FSTATFS64 = 346 +pkg syscall (darwin-amd64-cgo), const SYS_FSTATV = 219 +pkg syscall (darwin-amd64-cgo), const SYS_FSTAT_EXTENDED = 281 +pkg syscall (darwin-amd64-cgo), const SYS_FSYNC = 95 +pkg syscall (darwin-amd64-cgo), const SYS_FSYNC_NOCANCEL = 408 +pkg syscall (darwin-amd64-cgo), const SYS_FTRUNCATE = 201 +pkg syscall (darwin-amd64-cgo), const SYS_FUTIMES = 139 +pkg syscall (darwin-amd64-cgo), const SYS_GETATTRLIST = 220 +pkg syscall (darwin-amd64-cgo), const SYS_GETAUDIT = 355 +pkg syscall (darwin-amd64-cgo), const SYS_GETAUDIT_ADDR = 357 +pkg syscall (darwin-amd64-cgo), const SYS_GETAUID = 353 +pkg syscall (darwin-amd64-cgo), const SYS_GETDIRENTRIES = 196 +pkg syscall (darwin-amd64-cgo), const SYS_GETDIRENTRIES64 = 344 +pkg syscall (darwin-amd64-cgo), const SYS_GETDIRENTRIESATTR = 222 +pkg syscall (darwin-amd64-cgo), const SYS_GETDTABLESIZE = 89 +pkg syscall (darwin-amd64-cgo), const SYS_GETEGID = 43 +pkg syscall (darwin-amd64-cgo), const SYS_GETEUID = 25 +pkg syscall (darwin-amd64-cgo), const SYS_GETFH = 161 +pkg syscall (darwin-amd64-cgo), const SYS_GETFSSTAT = 18 +pkg syscall (darwin-amd64-cgo), const SYS_GETFSSTAT64 = 347 +pkg syscall (darwin-amd64-cgo), const SYS_GETGID = 47 +pkg syscall (darwin-amd64-cgo), const SYS_GETGROUPS = 79 +pkg syscall (darwin-amd64-cgo), const SYS_GETHOSTUUID = 142 +pkg syscall (darwin-amd64-cgo), const SYS_GETITIMER = 86 +pkg syscall (darwin-amd64-cgo), const SYS_GETLCID = 395 +pkg syscall (darwin-amd64-cgo), const SYS_GETLOGIN = 49 +pkg syscall (darwin-amd64-cgo), const SYS_GETPEERNAME = 31 +pkg syscall (darwin-amd64-cgo), const SYS_GETPGID = 151 +pkg syscall (darwin-amd64-cgo), const SYS_GETPGRP = 81 +pkg syscall (darwin-amd64-cgo), const SYS_GETPID = 20 +pkg syscall (darwin-amd64-cgo), const SYS_GETPPID = 39 +pkg syscall (darwin-amd64-cgo), const SYS_GETPRIORITY = 100 +pkg syscall (darwin-amd64-cgo), const SYS_GETRLIMIT = 194 +pkg syscall (darwin-amd64-cgo), const SYS_GETRUSAGE = 117 +pkg syscall (darwin-amd64-cgo), const SYS_GETSGROUPS = 288 +pkg syscall (darwin-amd64-cgo), const SYS_GETSID = 310 +pkg syscall (darwin-amd64-cgo), const SYS_GETSOCKNAME = 32 +pkg syscall (darwin-amd64-cgo), const SYS_GETSOCKOPT = 118 +pkg syscall (darwin-amd64-cgo), const SYS_GETTID = 286 +pkg syscall (darwin-amd64-cgo), const SYS_GETTIMEOFDAY = 116 +pkg syscall (darwin-amd64-cgo), const SYS_GETUID = 24 +pkg syscall (darwin-amd64-cgo), const SYS_GETWGROUPS = 290 +pkg syscall (darwin-amd64-cgo), const SYS_GETXATTR = 234 +pkg syscall (darwin-amd64-cgo), const SYS_IDENTITYSVC = 293 +pkg syscall (darwin-amd64-cgo), const SYS_INITGROUPS = 243 +pkg syscall (darwin-amd64-cgo), const SYS_IOCTL = 54 +pkg syscall (darwin-amd64-cgo), const SYS_IOPOLICYSYS = 322 +pkg syscall (darwin-amd64-cgo), const SYS_ISSETUGID = 327 +pkg syscall (darwin-amd64-cgo), const SYS_KDEBUG_TRACE = 180 +pkg syscall (darwin-amd64-cgo), const SYS_KEVENT = 363 +pkg syscall (darwin-amd64-cgo), const SYS_KEVENT64 = 369 +pkg syscall (darwin-amd64-cgo), const SYS_KILL = 37 +pkg syscall (darwin-amd64-cgo), const SYS_KQUEUE = 362 +pkg syscall (darwin-amd64-cgo), const SYS_LCHOWN = 364 +pkg syscall (darwin-amd64-cgo), const SYS_LINK = 9 +pkg syscall (darwin-amd64-cgo), const SYS_LIO_LISTIO = 320 +pkg syscall (darwin-amd64-cgo), const SYS_LISTEN = 106 +pkg syscall (darwin-amd64-cgo), const SYS_LISTXATTR = 240 +pkg syscall (darwin-amd64-cgo), const SYS_LSEEK = 199 +pkg syscall (darwin-amd64-cgo), const SYS_LSTAT = 190 +pkg syscall (darwin-amd64-cgo), const SYS_LSTAT64 = 340 +pkg syscall (darwin-amd64-cgo), const SYS_LSTAT64_EXTENDED = 342 +pkg syscall (darwin-amd64-cgo), const SYS_LSTATV = 218 +pkg syscall (darwin-amd64-cgo), const SYS_LSTAT_EXTENDED = 280 +pkg syscall (darwin-amd64-cgo), const SYS_MADVISE = 75 +pkg syscall (darwin-amd64-cgo), const SYS_MAXSYSCALL = 439 +pkg syscall (darwin-amd64-cgo), const SYS_MINCORE = 78 +pkg syscall (darwin-amd64-cgo), const SYS_MINHERIT = 250 +pkg syscall (darwin-amd64-cgo), const SYS_MKCOMPLEX = 216 +pkg syscall (darwin-amd64-cgo), const SYS_MKDIR = 136 +pkg syscall (darwin-amd64-cgo), const SYS_MKDIR_EXTENDED = 292 +pkg syscall (darwin-amd64-cgo), const SYS_MKFIFO = 132 +pkg syscall (darwin-amd64-cgo), const SYS_MKFIFO_EXTENDED = 291 +pkg syscall (darwin-amd64-cgo), const SYS_MKNOD = 14 +pkg syscall (darwin-amd64-cgo), const SYS_MLOCK = 203 +pkg syscall (darwin-amd64-cgo), const SYS_MLOCKALL = 324 +pkg syscall (darwin-amd64-cgo), const SYS_MMAP = 197 +pkg syscall (darwin-amd64-cgo), const SYS_MODWATCH = 233 +pkg syscall (darwin-amd64-cgo), const SYS_MOUNT = 167 +pkg syscall (darwin-amd64-cgo), const SYS_MPROTECT = 74 +pkg syscall (darwin-amd64-cgo), const SYS_MSGCTL = 258 +pkg syscall (darwin-amd64-cgo), const SYS_MSGGET = 259 +pkg syscall (darwin-amd64-cgo), const SYS_MSGRCV = 261 +pkg syscall (darwin-amd64-cgo), const SYS_MSGRCV_NOCANCEL = 419 +pkg syscall (darwin-amd64-cgo), const SYS_MSGSND = 260 +pkg syscall (darwin-amd64-cgo), const SYS_MSGSND_NOCANCEL = 418 +pkg syscall (darwin-amd64-cgo), const SYS_MSGSYS = 252 +pkg syscall (darwin-amd64-cgo), const SYS_MSYNC = 65 +pkg syscall (darwin-amd64-cgo), const SYS_MSYNC_NOCANCEL = 405 +pkg syscall (darwin-amd64-cgo), const SYS_MUNLOCK = 204 +pkg syscall (darwin-amd64-cgo), const SYS_MUNLOCKALL = 325 +pkg syscall (darwin-amd64-cgo), const SYS_MUNMAP = 73 +pkg syscall (darwin-amd64-cgo), const SYS_NFSCLNT = 247 +pkg syscall (darwin-amd64-cgo), const SYS_NFSSVC = 155 +pkg syscall (darwin-amd64-cgo), const SYS_OPEN = 5 +pkg syscall (darwin-amd64-cgo), const SYS_OPEN_EXTENDED = 277 +pkg syscall (darwin-amd64-cgo), const SYS_OPEN_NOCANCEL = 398 +pkg syscall (darwin-amd64-cgo), const SYS_PATHCONF = 191 +pkg syscall (darwin-amd64-cgo), const SYS_PID_HIBERNATE = 435 +pkg syscall (darwin-amd64-cgo), const SYS_PID_RESUME = 434 +pkg syscall (darwin-amd64-cgo), const SYS_PID_SHUTDOWN_SOCKETS = 436 +pkg syscall (darwin-amd64-cgo), const SYS_PID_SUSPEND = 433 +pkg syscall (darwin-amd64-cgo), const SYS_PIPE = 42 +pkg syscall (darwin-amd64-cgo), const SYS_POLL = 230 +pkg syscall (darwin-amd64-cgo), const SYS_POLL_NOCANCEL = 417 +pkg syscall (darwin-amd64-cgo), const SYS_POSIX_SPAWN = 244 +pkg syscall (darwin-amd64-cgo), const SYS_PREAD = 153 +pkg syscall (darwin-amd64-cgo), const SYS_PREAD_NOCANCEL = 414 +pkg syscall (darwin-amd64-cgo), const SYS_PROCESS_POLICY = 323 +pkg syscall (darwin-amd64-cgo), const SYS_PROC_INFO = 336 +pkg syscall (darwin-amd64-cgo), const SYS_PROFIL = 44 +pkg syscall (darwin-amd64-cgo), const SYS_PSYNCH_CVBROAD = 303 +pkg syscall (darwin-amd64-cgo), const SYS_PSYNCH_CVCLRPREPOST = 312 +pkg syscall (darwin-amd64-cgo), const SYS_PSYNCH_CVSIGNAL = 304 +pkg syscall (darwin-amd64-cgo), const SYS_PSYNCH_CVWAIT = 305 +pkg syscall (darwin-amd64-cgo), const SYS_PSYNCH_MUTEXDROP = 302 +pkg syscall (darwin-amd64-cgo), const SYS_PSYNCH_MUTEXWAIT = 301 +pkg syscall (darwin-amd64-cgo), const SYS_PSYNCH_RW_DOWNGRADE = 299 +pkg syscall (darwin-amd64-cgo), const SYS_PSYNCH_RW_LONGRDLOCK = 297 +pkg syscall (darwin-amd64-cgo), const SYS_PSYNCH_RW_RDLOCK = 306 +pkg syscall (darwin-amd64-cgo), const SYS_PSYNCH_RW_UNLOCK = 308 +pkg syscall (darwin-amd64-cgo), const SYS_PSYNCH_RW_UNLOCK2 = 309 +pkg syscall (darwin-amd64-cgo), const SYS_PSYNCH_RW_UPGRADE = 300 +pkg syscall (darwin-amd64-cgo), const SYS_PSYNCH_RW_WRLOCK = 307 +pkg syscall (darwin-amd64-cgo), const SYS_PSYNCH_RW_YIELDWRLOCK = 298 +pkg syscall (darwin-amd64-cgo), const SYS_PTRACE = 26 +pkg syscall (darwin-amd64-cgo), const SYS_PWRITE = 154 +pkg syscall (darwin-amd64-cgo), const SYS_PWRITE_NOCANCEL = 415 +pkg syscall (darwin-amd64-cgo), const SYS_QUOTACTL = 165 +pkg syscall (darwin-amd64-cgo), const SYS_READ = 3 +pkg syscall (darwin-amd64-cgo), const SYS_READLINK = 58 +pkg syscall (darwin-amd64-cgo), const SYS_READV = 120 +pkg syscall (darwin-amd64-cgo), const SYS_READV_NOCANCEL = 411 +pkg syscall (darwin-amd64-cgo), const SYS_READ_NOCANCEL = 396 +pkg syscall (darwin-amd64-cgo), const SYS_REBOOT = 55 +pkg syscall (darwin-amd64-cgo), const SYS_RECVFROM = 29 +pkg syscall (darwin-amd64-cgo), const SYS_RECVFROM_NOCANCEL = 403 +pkg syscall (darwin-amd64-cgo), const SYS_RECVMSG = 27 +pkg syscall (darwin-amd64-cgo), const SYS_RECVMSG_NOCANCEL = 401 +pkg syscall (darwin-amd64-cgo), const SYS_REMOVEXATTR = 238 +pkg syscall (darwin-amd64-cgo), const SYS_RENAME = 128 +pkg syscall (darwin-amd64-cgo), const SYS_REVOKE = 56 +pkg syscall (darwin-amd64-cgo), const SYS_RMDIR = 137 +pkg syscall (darwin-amd64-cgo), const SYS_SEARCHFS = 225 +pkg syscall (darwin-amd64-cgo), const SYS_SELECT = 93 +pkg syscall (darwin-amd64-cgo), const SYS_SELECT_NOCANCEL = 407 +pkg syscall (darwin-amd64-cgo), const SYS_SEMCTL = 254 +pkg syscall (darwin-amd64-cgo), const SYS_SEMGET = 255 +pkg syscall (darwin-amd64-cgo), const SYS_SEMOP = 256 +pkg syscall (darwin-amd64-cgo), const SYS_SEMSYS = 251 +pkg syscall (darwin-amd64-cgo), const SYS_SEM_CLOSE = 269 +pkg syscall (darwin-amd64-cgo), const SYS_SEM_DESTROY = 276 +pkg syscall (darwin-amd64-cgo), const SYS_SEM_GETVALUE = 274 +pkg syscall (darwin-amd64-cgo), const SYS_SEM_INIT = 275 +pkg syscall (darwin-amd64-cgo), const SYS_SEM_OPEN = 268 +pkg syscall (darwin-amd64-cgo), const SYS_SEM_POST = 273 +pkg syscall (darwin-amd64-cgo), const SYS_SEM_TRYWAIT = 272 +pkg syscall (darwin-amd64-cgo), const SYS_SEM_UNLINK = 270 +pkg syscall (darwin-amd64-cgo), const SYS_SEM_WAIT = 271 +pkg syscall (darwin-amd64-cgo), const SYS_SEM_WAIT_NOCANCEL = 420 +pkg syscall (darwin-amd64-cgo), const SYS_SENDFILE = 337 +pkg syscall (darwin-amd64-cgo), const SYS_SENDMSG = 28 +pkg syscall (darwin-amd64-cgo), const SYS_SENDMSG_NOCANCEL = 402 +pkg syscall (darwin-amd64-cgo), const SYS_SENDTO = 133 +pkg syscall (darwin-amd64-cgo), const SYS_SENDTO_NOCANCEL = 413 +pkg syscall (darwin-amd64-cgo), const SYS_SETATTRLIST = 221 +pkg syscall (darwin-amd64-cgo), const SYS_SETAUDIT = 356 +pkg syscall (darwin-amd64-cgo), const SYS_SETAUDIT_ADDR = 358 +pkg syscall (darwin-amd64-cgo), const SYS_SETAUID = 354 +pkg syscall (darwin-amd64-cgo), const SYS_SETEGID = 182 +pkg syscall (darwin-amd64-cgo), const SYS_SETEUID = 183 +pkg syscall (darwin-amd64-cgo), const SYS_SETGID = 181 +pkg syscall (darwin-amd64-cgo), const SYS_SETGROUPS = 80 +pkg syscall (darwin-amd64-cgo), const SYS_SETITIMER = 83 +pkg syscall (darwin-amd64-cgo), const SYS_SETLCID = 394 +pkg syscall (darwin-amd64-cgo), const SYS_SETLOGIN = 50 +pkg syscall (darwin-amd64-cgo), const SYS_SETPGID = 82 +pkg syscall (darwin-amd64-cgo), const SYS_SETPRIORITY = 96 +pkg syscall (darwin-amd64-cgo), const SYS_SETPRIVEXEC = 152 +pkg syscall (darwin-amd64-cgo), const SYS_SETREGID = 127 +pkg syscall (darwin-amd64-cgo), const SYS_SETREUID = 126 +pkg syscall (darwin-amd64-cgo), const SYS_SETRLIMIT = 195 +pkg syscall (darwin-amd64-cgo), const SYS_SETSGROUPS = 287 +pkg syscall (darwin-amd64-cgo), const SYS_SETSID = 147 +pkg syscall (darwin-amd64-cgo), const SYS_SETSOCKOPT = 105 +pkg syscall (darwin-amd64-cgo), const SYS_SETTID = 285 +pkg syscall (darwin-amd64-cgo), const SYS_SETTID_WITH_PID = 311 +pkg syscall (darwin-amd64-cgo), const SYS_SETTIMEOFDAY = 122 +pkg syscall (darwin-amd64-cgo), const SYS_SETUID = 23 +pkg syscall (darwin-amd64-cgo), const SYS_SETWGROUPS = 289 +pkg syscall (darwin-amd64-cgo), const SYS_SETXATTR = 236 +pkg syscall (darwin-amd64-cgo), const SYS_SHARED_REGION_CHECK_NP = 294 +pkg syscall (darwin-amd64-cgo), const SYS_SHARED_REGION_MAP_AND_SLIDE_NP = 438 +pkg syscall (darwin-amd64-cgo), const SYS_SHMAT = 262 +pkg syscall (darwin-amd64-cgo), const SYS_SHMCTL = 263 +pkg syscall (darwin-amd64-cgo), const SYS_SHMDT = 264 +pkg syscall (darwin-amd64-cgo), const SYS_SHMGET = 265 +pkg syscall (darwin-amd64-cgo), const SYS_SHMSYS = 253 +pkg syscall (darwin-amd64-cgo), const SYS_SHM_OPEN = 266 +pkg syscall (darwin-amd64-cgo), const SYS_SHM_UNLINK = 267 +pkg syscall (darwin-amd64-cgo), const SYS_SHUTDOWN = 134 +pkg syscall (darwin-amd64-cgo), const SYS_SIGACTION = 46 +pkg syscall (darwin-amd64-cgo), const SYS_SIGALTSTACK = 53 +pkg syscall (darwin-amd64-cgo), const SYS_SIGPENDING = 52 +pkg syscall (darwin-amd64-cgo), const SYS_SIGPROCMASK = 48 +pkg syscall (darwin-amd64-cgo), const SYS_SIGRETURN = 184 +pkg syscall (darwin-amd64-cgo), const SYS_SIGSUSPEND = 111 +pkg syscall (darwin-amd64-cgo), const SYS_SIGSUSPEND_NOCANCEL = 410 +pkg syscall (darwin-amd64-cgo), const SYS_SOCKET = 97 +pkg syscall (darwin-amd64-cgo), const SYS_SOCKETPAIR = 135 +pkg syscall (darwin-amd64-cgo), const SYS_STACK_SNAPSHOT = 365 +pkg syscall (darwin-amd64-cgo), const SYS_STAT = 188 +pkg syscall (darwin-amd64-cgo), const SYS_STAT64 = 338 +pkg syscall (darwin-amd64-cgo), const SYS_STAT64_EXTENDED = 341 +pkg syscall (darwin-amd64-cgo), const SYS_STATFS = 157 +pkg syscall (darwin-amd64-cgo), const SYS_STATFS64 = 345 +pkg syscall (darwin-amd64-cgo), const SYS_STATV = 217 +pkg syscall (darwin-amd64-cgo), const SYS_STAT_EXTENDED = 279 +pkg syscall (darwin-amd64-cgo), const SYS_SWAPON = 85 +pkg syscall (darwin-amd64-cgo), const SYS_SYMLINK = 57 +pkg syscall (darwin-amd64-cgo), const SYS_SYNC = 36 +pkg syscall (darwin-amd64-cgo), const SYS_SYSCALL = 0 +pkg syscall (darwin-amd64-cgo), const SYS_THREAD_SELFID = 372 +pkg syscall (darwin-amd64-cgo), const SYS_TRUNCATE = 200 +pkg syscall (darwin-amd64-cgo), const SYS_UMASK = 60 +pkg syscall (darwin-amd64-cgo), const SYS_UMASK_EXTENDED = 278 +pkg syscall (darwin-amd64-cgo), const SYS_UNDELETE = 205 +pkg syscall (darwin-amd64-cgo), const SYS_UNLINK = 10 +pkg syscall (darwin-amd64-cgo), const SYS_UNMOUNT = 159 +pkg syscall (darwin-amd64-cgo), const SYS_UTIMES = 138 +pkg syscall (darwin-amd64-cgo), const SYS_VFORK = 66 +pkg syscall (darwin-amd64-cgo), const SYS_VM_PRESSURE_MONITOR = 296 +pkg syscall (darwin-amd64-cgo), const SYS_WAIT4 = 7 +pkg syscall (darwin-amd64-cgo), const SYS_WAIT4_NOCANCEL = 400 +pkg syscall (darwin-amd64-cgo), const SYS_WAITEVENT = 232 +pkg syscall (darwin-amd64-cgo), const SYS_WAITID = 173 +pkg syscall (darwin-amd64-cgo), const SYS_WAITID_NOCANCEL = 416 +pkg syscall (darwin-amd64-cgo), const SYS_WATCHEVENT = 231 +pkg syscall (darwin-amd64-cgo), const SYS_WORKQ_KERNRETURN = 368 +pkg syscall (darwin-amd64-cgo), const SYS_WORKQ_OPEN = 367 +pkg syscall (darwin-amd64-cgo), const SYS_WRITE = 4 +pkg syscall (darwin-amd64-cgo), const SYS_WRITEV = 121 +pkg syscall (darwin-amd64-cgo), const SYS_WRITEV_NOCANCEL = 412 +pkg syscall (darwin-amd64-cgo), const SYS_WRITE_NOCANCEL = 397 +pkg syscall (darwin-amd64-cgo), const SYS___DISABLE_THREADSIGNAL = 331 +pkg syscall (darwin-amd64-cgo), const SYS___MAC_EXECVE = 380 +pkg syscall (darwin-amd64-cgo), const SYS___MAC_GETFSSTAT = 426 +pkg syscall (darwin-amd64-cgo), const SYS___MAC_GET_FD = 388 +pkg syscall (darwin-amd64-cgo), const SYS___MAC_GET_FILE = 382 +pkg syscall (darwin-amd64-cgo), const SYS___MAC_GET_LCID = 391 +pkg syscall (darwin-amd64-cgo), const SYS___MAC_GET_LCTX = 392 +pkg syscall (darwin-amd64-cgo), const SYS___MAC_GET_LINK = 384 +pkg syscall (darwin-amd64-cgo), const SYS___MAC_GET_MOUNT = 425 +pkg syscall (darwin-amd64-cgo), const SYS___MAC_GET_PID = 390 +pkg syscall (darwin-amd64-cgo), const SYS___MAC_GET_PROC = 386 +pkg syscall (darwin-amd64-cgo), const SYS___MAC_MOUNT = 424 +pkg syscall (darwin-amd64-cgo), const SYS___MAC_SET_FD = 389 +pkg syscall (darwin-amd64-cgo), const SYS___MAC_SET_FILE = 383 +pkg syscall (darwin-amd64-cgo), const SYS___MAC_SET_LCTX = 393 +pkg syscall (darwin-amd64-cgo), const SYS___MAC_SET_LINK = 385 +pkg syscall (darwin-amd64-cgo), const SYS___MAC_SET_PROC = 387 +pkg syscall (darwin-amd64-cgo), const SYS___MAC_SYSCALL = 381 +pkg syscall (darwin-amd64-cgo), const SYS___OLD_SEMWAIT_SIGNAL = 370 +pkg syscall (darwin-amd64-cgo), const SYS___OLD_SEMWAIT_SIGNAL_NOCANCEL = 371 +pkg syscall (darwin-amd64-cgo), const SYS___PTHREAD_CANCELED = 333 +pkg syscall (darwin-amd64-cgo), const SYS___PTHREAD_CHDIR = 348 +pkg syscall (darwin-amd64-cgo), const SYS___PTHREAD_FCHDIR = 349 +pkg syscall (darwin-amd64-cgo), const SYS___PTHREAD_KILL = 328 +pkg syscall (darwin-amd64-cgo), const SYS___PTHREAD_MARKCANCEL = 332 +pkg syscall (darwin-amd64-cgo), const SYS___PTHREAD_SIGMASK = 329 +pkg syscall (darwin-amd64-cgo), const SYS___SEMWAIT_SIGNAL = 334 +pkg syscall (darwin-amd64-cgo), const SYS___SEMWAIT_SIGNAL_NOCANCEL = 423 +pkg syscall (darwin-amd64-cgo), const SYS___SIGWAIT = 330 +pkg syscall (darwin-amd64-cgo), const SYS___SIGWAIT_NOCANCEL = 422 +pkg syscall (darwin-amd64-cgo), const SYS___SYSCTL = 202 +pkg syscall (darwin-amd64-cgo), const S_IEXEC = 64 +pkg syscall (darwin-amd64-cgo), const S_IFMT = 61440 +pkg syscall (darwin-amd64-cgo), const S_IFWHT = 57344 +pkg syscall (darwin-amd64-cgo), const S_IREAD = 256 +pkg syscall (darwin-amd64-cgo), const S_IRGRP = 32 +pkg syscall (darwin-amd64-cgo), const S_IROTH = 4 +pkg syscall (darwin-amd64-cgo), const S_IRWXG = 56 +pkg syscall (darwin-amd64-cgo), const S_IRWXO = 7 +pkg syscall (darwin-amd64-cgo), const S_IRWXU = 448 +pkg syscall (darwin-amd64-cgo), const S_ISTXT = 512 +pkg syscall (darwin-amd64-cgo), const S_IWGRP = 16 +pkg syscall (darwin-amd64-cgo), const S_IWOTH = 2 +pkg syscall (darwin-amd64-cgo), const S_IWRITE = 128 +pkg syscall (darwin-amd64-cgo), const S_IXGRP = 8 +pkg syscall (darwin-amd64-cgo), const S_IXOTH = 1 +pkg syscall (darwin-amd64-cgo), const SizeofBpfHdr = 20 +pkg syscall (darwin-amd64-cgo), const SizeofBpfInsn = 8 +pkg syscall (darwin-amd64-cgo), const SizeofBpfProgram = 16 +pkg syscall (darwin-amd64-cgo), const SizeofBpfStat = 8 +pkg syscall (darwin-amd64-cgo), const SizeofBpfVersion = 4 +pkg syscall (darwin-amd64-cgo), const SizeofCmsghdr = 12 +pkg syscall (darwin-amd64-cgo), const SizeofIPMreq = 8 +pkg syscall (darwin-amd64-cgo), const SizeofIPv6Mreq = 20 +pkg syscall (darwin-amd64-cgo), const SizeofIfData = 96 +pkg syscall (darwin-amd64-cgo), const SizeofIfMsghdr = 112 +pkg syscall (darwin-amd64-cgo), const SizeofIfaMsghdr = 20 +pkg syscall (darwin-amd64-cgo), const SizeofIfmaMsghdr = 16 +pkg syscall (darwin-amd64-cgo), const SizeofIfmaMsghdr2 = 20 +pkg syscall (darwin-amd64-cgo), const SizeofInet4Pktinfo = 12 +pkg syscall (darwin-amd64-cgo), const SizeofInet4Pktinfo ideal-int +pkg syscall (darwin-amd64-cgo), const SizeofInet6Pktinfo = 20 +pkg syscall (darwin-amd64-cgo), const SizeofLinger = 8 +pkg syscall (darwin-amd64-cgo), const SizeofMsghdr = 48 +pkg syscall (darwin-amd64-cgo), const SizeofRtMetrics = 56 +pkg syscall (darwin-amd64-cgo), const SizeofRtMsghdr = 92 +pkg syscall (darwin-amd64-cgo), const SizeofSockaddrAny = 108 +pkg syscall (darwin-amd64-cgo), const SizeofSockaddrDatalink = 20 +pkg syscall (darwin-amd64-cgo), const SizeofSockaddrInet4 = 16 +pkg syscall (darwin-amd64-cgo), const SizeofSockaddrInet6 = 28 +pkg syscall (darwin-amd64-cgo), const SizeofSockaddrUnix = 106 +pkg syscall (darwin-amd64-cgo), const TCIFLUSH = 1 +pkg syscall (darwin-amd64-cgo), const TCIFLUSH ideal-int +pkg syscall (darwin-amd64-cgo), const TCIOFLUSH = 3 +pkg syscall (darwin-amd64-cgo), const TCIOFLUSH ideal-int +pkg syscall (darwin-amd64-cgo), const TCOFLUSH = 2 +pkg syscall (darwin-amd64-cgo), const TCOFLUSH ideal-int +pkg syscall (darwin-amd64-cgo), const TCP_CONNECTIONTIMEOUT = 32 +pkg syscall (darwin-amd64-cgo), const TCP_KEEPALIVE = 16 +pkg syscall (darwin-amd64-cgo), const TCP_MAXHLEN = 60 +pkg syscall (darwin-amd64-cgo), const TCP_MAXOLEN = 40 +pkg syscall (darwin-amd64-cgo), const TCP_MAXSEG = 2 +pkg syscall (darwin-amd64-cgo), const TCP_MAXWIN = 65535 +pkg syscall (darwin-amd64-cgo), const TCP_MAX_SACK = 3 +pkg syscall (darwin-amd64-cgo), const TCP_MAX_WINSHIFT = 14 +pkg syscall (darwin-amd64-cgo), const TCP_MINMSS = 216 +pkg syscall (darwin-amd64-cgo), const TCP_MINMSSOVERLOAD = 1000 +pkg syscall (darwin-amd64-cgo), const TCP_MSS = 512 +pkg syscall (darwin-amd64-cgo), const TCP_NOOPT = 8 +pkg syscall (darwin-amd64-cgo), const TCP_NOPUSH = 4 +pkg syscall (darwin-amd64-cgo), const TCP_RXT_CONNDROPTIME = 128 +pkg syscall (darwin-amd64-cgo), const TCP_RXT_FINDROP = 256 +pkg syscall (darwin-amd64-cgo), const TCSAFLUSH = 2 +pkg syscall (darwin-amd64-cgo), const TCSAFLUSH ideal-int +pkg syscall (darwin-amd64-cgo), const TIOCCBRK = 536900730 +pkg syscall (darwin-amd64-cgo), const TIOCCDTR = 536900728 +pkg syscall (darwin-amd64-cgo), const TIOCCONS = 2147775586 +pkg syscall (darwin-amd64-cgo), const TIOCDCDTIMESTAMP = 1074820184 +pkg syscall (darwin-amd64-cgo), const TIOCDRAIN = 536900702 +pkg syscall (darwin-amd64-cgo), const TIOCDSIMICROCODE = 536900693 +pkg syscall (darwin-amd64-cgo), const TIOCEXCL = 536900621 +pkg syscall (darwin-amd64-cgo), const TIOCEXT = 2147775584 +pkg syscall (darwin-amd64-cgo), const TIOCFLUSH = 2147775504 +pkg syscall (darwin-amd64-cgo), const TIOCGDRAINWAIT = 1074033750 +pkg syscall (darwin-amd64-cgo), const TIOCGETA = 1078490131 +pkg syscall (darwin-amd64-cgo), const TIOCGETD = 1074033690 +pkg syscall (darwin-amd64-cgo), const TIOCGPGRP = 1074033783 +pkg syscall (darwin-amd64-cgo), const TIOCGWINSZ = 1074295912 +pkg syscall (darwin-amd64-cgo), const TIOCIXOFF = 536900736 +pkg syscall (darwin-amd64-cgo), const TIOCIXON = 536900737 +pkg syscall (darwin-amd64-cgo), const TIOCMBIC = 2147775595 +pkg syscall (darwin-amd64-cgo), const TIOCMBIS = 2147775596 +pkg syscall (darwin-amd64-cgo), const TIOCMGDTRWAIT = 1074033754 +pkg syscall (darwin-amd64-cgo), const TIOCMGET = 1074033770 +pkg syscall (darwin-amd64-cgo), const TIOCMODG = 1074033667 +pkg syscall (darwin-amd64-cgo), const TIOCMODS = 2147775492 +pkg syscall (darwin-amd64-cgo), const TIOCMSDTRWAIT = 2147775579 +pkg syscall (darwin-amd64-cgo), const TIOCMSET = 2147775597 +pkg syscall (darwin-amd64-cgo), const TIOCM_CAR = 64 +pkg syscall (darwin-amd64-cgo), const TIOCM_CD = 64 +pkg syscall (darwin-amd64-cgo), const TIOCM_CTS = 32 +pkg syscall (darwin-amd64-cgo), const TIOCM_DSR = 256 +pkg syscall (darwin-amd64-cgo), const TIOCM_DTR = 2 +pkg syscall (darwin-amd64-cgo), const TIOCM_LE = 1 +pkg syscall (darwin-amd64-cgo), const TIOCM_RI = 128 +pkg syscall (darwin-amd64-cgo), const TIOCM_RNG = 128 +pkg syscall (darwin-amd64-cgo), const TIOCM_RTS = 4 +pkg syscall (darwin-amd64-cgo), const TIOCM_SR = 16 +pkg syscall (darwin-amd64-cgo), const TIOCM_ST = 8 +pkg syscall (darwin-amd64-cgo), const TIOCNOTTY = 536900721 +pkg syscall (darwin-amd64-cgo), const TIOCNXCL = 536900622 +pkg syscall (darwin-amd64-cgo), const TIOCOUTQ = 1074033779 +pkg syscall (darwin-amd64-cgo), const TIOCPKT = 2147775600 +pkg syscall (darwin-amd64-cgo), const TIOCPKT_DATA = 0 +pkg syscall (darwin-amd64-cgo), const TIOCPKT_DOSTOP = 32 +pkg syscall (darwin-amd64-cgo), const TIOCPKT_FLUSHREAD = 1 +pkg syscall (darwin-amd64-cgo), const TIOCPKT_FLUSHWRITE = 2 +pkg syscall (darwin-amd64-cgo), const TIOCPKT_IOCTL = 64 +pkg syscall (darwin-amd64-cgo), const TIOCPKT_NOSTOP = 16 +pkg syscall (darwin-amd64-cgo), const TIOCPKT_START = 8 +pkg syscall (darwin-amd64-cgo), const TIOCPKT_STOP = 4 +pkg syscall (darwin-amd64-cgo), const TIOCPTYGNAME = 1082160211 +pkg syscall (darwin-amd64-cgo), const TIOCPTYGRANT = 536900692 +pkg syscall (darwin-amd64-cgo), const TIOCPTYUNLK = 536900690 +pkg syscall (darwin-amd64-cgo), const TIOCREMOTE = 2147775593 +pkg syscall (darwin-amd64-cgo), const TIOCSBRK = 536900731 +pkg syscall (darwin-amd64-cgo), const TIOCSCONS = 536900707 +pkg syscall (darwin-amd64-cgo), const TIOCSCTTY = 536900705 +pkg syscall (darwin-amd64-cgo), const TIOCSDRAINWAIT = 2147775575 +pkg syscall (darwin-amd64-cgo), const TIOCSDTR = 536900729 +pkg syscall (darwin-amd64-cgo), const TIOCSETA = 2152231956 +pkg syscall (darwin-amd64-cgo), const TIOCSETAF = 2152231958 +pkg syscall (darwin-amd64-cgo), const TIOCSETAW = 2152231957 +pkg syscall (darwin-amd64-cgo), const TIOCSETD = 2147775515 +pkg syscall (darwin-amd64-cgo), const TIOCSIG = 536900703 +pkg syscall (darwin-amd64-cgo), const TIOCSPGRP = 2147775606 +pkg syscall (darwin-amd64-cgo), const TIOCSTART = 536900718 +pkg syscall (darwin-amd64-cgo), const TIOCSTAT = 536900709 +pkg syscall (darwin-amd64-cgo), const TIOCSTI = 2147578994 +pkg syscall (darwin-amd64-cgo), const TIOCSTOP = 536900719 +pkg syscall (darwin-amd64-cgo), const TIOCSWINSZ = 2148037735 +pkg syscall (darwin-amd64-cgo), const TIOCTIMESTAMP = 1074820185 +pkg syscall (darwin-amd64-cgo), const TIOCUCNTL = 2147775590 +pkg syscall (darwin-amd64-cgo), const TOSTOP = 4194304 +pkg syscall (darwin-amd64-cgo), const TOSTOP ideal-int +pkg syscall (darwin-amd64-cgo), const VDISCARD = 15 +pkg syscall (darwin-amd64-cgo), const VDISCARD ideal-int +pkg syscall (darwin-amd64-cgo), const VDSUSP = 11 +pkg syscall (darwin-amd64-cgo), const VDSUSP ideal-int +pkg syscall (darwin-amd64-cgo), const VEOF = 0 +pkg syscall (darwin-amd64-cgo), const VEOF ideal-int +pkg syscall (darwin-amd64-cgo), const VEOL = 1 +pkg syscall (darwin-amd64-cgo), const VEOL ideal-int +pkg syscall (darwin-amd64-cgo), const VEOL2 = 2 +pkg syscall (darwin-amd64-cgo), const VEOL2 ideal-int +pkg syscall (darwin-amd64-cgo), const VERASE = 3 +pkg syscall (darwin-amd64-cgo), const VERASE ideal-int +pkg syscall (darwin-amd64-cgo), const VINTR = 8 +pkg syscall (darwin-amd64-cgo), const VINTR ideal-int +pkg syscall (darwin-amd64-cgo), const VKILL = 5 +pkg syscall (darwin-amd64-cgo), const VKILL ideal-int +pkg syscall (darwin-amd64-cgo), const VLNEXT = 14 +pkg syscall (darwin-amd64-cgo), const VLNEXT ideal-int +pkg syscall (darwin-amd64-cgo), const VMIN = 16 +pkg syscall (darwin-amd64-cgo), const VMIN ideal-int +pkg syscall (darwin-amd64-cgo), const VQUIT = 9 +pkg syscall (darwin-amd64-cgo), const VQUIT ideal-int +pkg syscall (darwin-amd64-cgo), const VREPRINT = 6 +pkg syscall (darwin-amd64-cgo), const VREPRINT ideal-int +pkg syscall (darwin-amd64-cgo), const VSTART = 12 +pkg syscall (darwin-amd64-cgo), const VSTART ideal-int +pkg syscall (darwin-amd64-cgo), const VSTATUS = 18 +pkg syscall (darwin-amd64-cgo), const VSTATUS ideal-int +pkg syscall (darwin-amd64-cgo), const VSTOP = 13 +pkg syscall (darwin-amd64-cgo), const VSTOP ideal-int +pkg syscall (darwin-amd64-cgo), const VSUSP = 10 +pkg syscall (darwin-amd64-cgo), const VSUSP ideal-int +pkg syscall (darwin-amd64-cgo), const VT0 = 0 +pkg syscall (darwin-amd64-cgo), const VT0 ideal-int +pkg syscall (darwin-amd64-cgo), const VT1 = 65536 +pkg syscall (darwin-amd64-cgo), const VT1 ideal-int +pkg syscall (darwin-amd64-cgo), const VTDLY = 65536 +pkg syscall (darwin-amd64-cgo), const VTDLY ideal-int +pkg syscall (darwin-amd64-cgo), const VTIME = 17 +pkg syscall (darwin-amd64-cgo), const VTIME ideal-int +pkg syscall (darwin-amd64-cgo), const VWERASE = 4 +pkg syscall (darwin-amd64-cgo), const VWERASE ideal-int +pkg syscall (darwin-amd64-cgo), const WCONTINUED = 16 +pkg syscall (darwin-amd64-cgo), const WCOREFLAG = 128 +pkg syscall (darwin-amd64-cgo), const WEXITED = 4 +pkg syscall (darwin-amd64-cgo), const WNOHANG = 1 +pkg syscall (darwin-amd64-cgo), const WNOWAIT = 32 +pkg syscall (darwin-amd64-cgo), const WORDSIZE = 64 +pkg syscall (darwin-amd64-cgo), const WSTOPPED = 8 +pkg syscall (darwin-amd64-cgo), const WUNTRACED = 2 +pkg syscall (darwin-amd64-cgo), func Fchflags(int, int) error +pkg syscall (darwin-amd64-cgo), func SlicePtrFromStrings([]string) ([]*uint8, error) +pkg syscall (darwin-amd64-cgo), type Inet4Pktinfo struct +pkg syscall (darwin-amd64-cgo), type Inet4Pktinfo struct, Addr [4]uint8 +pkg syscall (darwin-amd64-cgo), type Inet4Pktinfo struct, Ifindex uint32 +pkg syscall (darwin-amd64-cgo), type Inet4Pktinfo struct, Spec_dst [4]uint8 +pkg syscall (darwin-amd64-cgo), type Termios struct +pkg syscall (darwin-amd64-cgo), type Termios struct, Cc [20]uint8 +pkg syscall (darwin-amd64-cgo), type Termios struct, Cflag uint64 +pkg syscall (darwin-amd64-cgo), type Termios struct, Iflag uint64 +pkg syscall (darwin-amd64-cgo), type Termios struct, Ispeed uint64 +pkg syscall (darwin-amd64-cgo), type Termios struct, Lflag uint64 +pkg syscall (darwin-amd64-cgo), type Termios struct, Oflag uint64 +pkg syscall (darwin-amd64-cgo), type Termios struct, Ospeed uint64 +pkg syscall (darwin-amd64-cgo), type Termios struct, Pad_cgo_0 [4]uint8 +pkg syscall (freebsd-386), const AF_APPLETALK = 16 +pkg syscall (freebsd-386), const AF_ARP = 35 +pkg syscall (freebsd-386), const AF_ATM = 30 +pkg syscall (freebsd-386), const AF_BLUETOOTH = 36 +pkg syscall (freebsd-386), const AF_CCITT = 10 +pkg syscall (freebsd-386), const AF_CHAOS = 5 +pkg syscall (freebsd-386), const AF_CNT = 21 +pkg syscall (freebsd-386), const AF_COIP = 20 +pkg syscall (freebsd-386), const AF_DATAKIT = 9 +pkg syscall (freebsd-386), const AF_DECnet = 12 +pkg syscall (freebsd-386), const AF_DLI = 13 +pkg syscall (freebsd-386), const AF_E164 = 26 +pkg syscall (freebsd-386), const AF_ECMA = 8 +pkg syscall (freebsd-386), const AF_HYLINK = 15 +pkg syscall (freebsd-386), const AF_IEEE80211 = 37 +pkg syscall (freebsd-386), const AF_IMPLINK = 3 +pkg syscall (freebsd-386), const AF_INET6 = 28 +pkg syscall (freebsd-386), const AF_IPX = 23 +pkg syscall (freebsd-386), const AF_ISDN = 26 +pkg syscall (freebsd-386), const AF_ISO = 7 +pkg syscall (freebsd-386), const AF_LAT = 14 +pkg syscall (freebsd-386), const AF_LINK = 18 +pkg syscall (freebsd-386), const AF_LOCAL = 1 +pkg syscall (freebsd-386), const AF_MAX = 38 +pkg syscall (freebsd-386), const AF_NATM = 29 +pkg syscall (freebsd-386), const AF_NETBIOS = 6 +pkg syscall (freebsd-386), const AF_NETGRAPH = 32 +pkg syscall (freebsd-386), const AF_OSI = 7 +pkg syscall (freebsd-386), const AF_PUP = 4 +pkg syscall (freebsd-386), const AF_ROUTE = 17 +pkg syscall (freebsd-386), const AF_SCLUSTER = 34 +pkg syscall (freebsd-386), const AF_SIP = 24 +pkg syscall (freebsd-386), const AF_SLOW = 33 +pkg syscall (freebsd-386), const AF_SNA = 11 +pkg syscall (freebsd-386), const AF_VENDOR00 = 39 +pkg syscall (freebsd-386), const AF_VENDOR01 = 41 +pkg syscall (freebsd-386), const AF_VENDOR02 = 43 +pkg syscall (freebsd-386), const AF_VENDOR03 = 45 +pkg syscall (freebsd-386), const AF_VENDOR04 = 47 +pkg syscall (freebsd-386), const AF_VENDOR05 = 49 +pkg syscall (freebsd-386), const AF_VENDOR06 = 51 +pkg syscall (freebsd-386), const AF_VENDOR07 = 53 +pkg syscall (freebsd-386), const AF_VENDOR08 = 55 +pkg syscall (freebsd-386), const AF_VENDOR09 = 57 +pkg syscall (freebsd-386), const AF_VENDOR10 = 59 +pkg syscall (freebsd-386), const AF_VENDOR11 = 61 +pkg syscall (freebsd-386), const AF_VENDOR12 = 63 +pkg syscall (freebsd-386), const AF_VENDOR13 = 65 +pkg syscall (freebsd-386), const AF_VENDOR14 = 67 +pkg syscall (freebsd-386), const AF_VENDOR15 = 69 +pkg syscall (freebsd-386), const AF_VENDOR16 = 71 +pkg syscall (freebsd-386), const AF_VENDOR17 = 73 +pkg syscall (freebsd-386), const AF_VENDOR18 = 75 +pkg syscall (freebsd-386), const AF_VENDOR19 = 77 +pkg syscall (freebsd-386), const AF_VENDOR20 = 79 +pkg syscall (freebsd-386), const AF_VENDOR21 = 81 +pkg syscall (freebsd-386), const AF_VENDOR22 = 83 +pkg syscall (freebsd-386), const AF_VENDOR23 = 85 +pkg syscall (freebsd-386), const AF_VENDOR24 = 87 +pkg syscall (freebsd-386), const AF_VENDOR25 = 89 +pkg syscall (freebsd-386), const AF_VENDOR26 = 91 +pkg syscall (freebsd-386), const AF_VENDOR27 = 93 +pkg syscall (freebsd-386), const AF_VENDOR28 = 95 +pkg syscall (freebsd-386), const AF_VENDOR29 = 97 +pkg syscall (freebsd-386), const AF_VENDOR30 = 99 +pkg syscall (freebsd-386), const AF_VENDOR31 = 101 +pkg syscall (freebsd-386), const AF_VENDOR32 = 103 +pkg syscall (freebsd-386), const AF_VENDOR33 = 105 +pkg syscall (freebsd-386), const AF_VENDOR34 = 107 +pkg syscall (freebsd-386), const AF_VENDOR35 = 109 +pkg syscall (freebsd-386), const AF_VENDOR36 = 111 +pkg syscall (freebsd-386), const AF_VENDOR37 = 113 +pkg syscall (freebsd-386), const AF_VENDOR38 = 115 +pkg syscall (freebsd-386), const AF_VENDOR39 = 117 +pkg syscall (freebsd-386), const AF_VENDOR40 = 119 +pkg syscall (freebsd-386), const AF_VENDOR41 = 121 +pkg syscall (freebsd-386), const AF_VENDOR42 = 123 +pkg syscall (freebsd-386), const AF_VENDOR43 = 125 +pkg syscall (freebsd-386), const AF_VENDOR44 = 127 +pkg syscall (freebsd-386), const AF_VENDOR45 = 129 +pkg syscall (freebsd-386), const AF_VENDOR46 = 131 +pkg syscall (freebsd-386), const AF_VENDOR47 = 133 +pkg syscall (freebsd-386), const B0 = 0 +pkg syscall (freebsd-386), const B0 ideal-int +pkg syscall (freebsd-386), const B110 = 110 +pkg syscall (freebsd-386), const B110 ideal-int +pkg syscall (freebsd-386), const B115200 = 115200 +pkg syscall (freebsd-386), const B115200 ideal-int +pkg syscall (freebsd-386), const B1200 = 1200 +pkg syscall (freebsd-386), const B1200 ideal-int +pkg syscall (freebsd-386), const B134 = 134 +pkg syscall (freebsd-386), const B134 ideal-int +pkg syscall (freebsd-386), const B14400 = 14400 +pkg syscall (freebsd-386), const B14400 ideal-int +pkg syscall (freebsd-386), const B150 = 150 +pkg syscall (freebsd-386), const B150 ideal-int +pkg syscall (freebsd-386), const B1800 = 1800 +pkg syscall (freebsd-386), const B1800 ideal-int +pkg syscall (freebsd-386), const B19200 = 19200 +pkg syscall (freebsd-386), const B19200 ideal-int +pkg syscall (freebsd-386), const B200 = 200 +pkg syscall (freebsd-386), const B200 ideal-int +pkg syscall (freebsd-386), const B230400 = 230400 +pkg syscall (freebsd-386), const B230400 ideal-int +pkg syscall (freebsd-386), const B2400 = 2400 +pkg syscall (freebsd-386), const B2400 ideal-int +pkg syscall (freebsd-386), const B28800 = 28800 +pkg syscall (freebsd-386), const B28800 ideal-int +pkg syscall (freebsd-386), const B300 = 300 +pkg syscall (freebsd-386), const B300 ideal-int +pkg syscall (freebsd-386), const B38400 = 38400 +pkg syscall (freebsd-386), const B38400 ideal-int +pkg syscall (freebsd-386), const B460800 = 460800 +pkg syscall (freebsd-386), const B460800 ideal-int +pkg syscall (freebsd-386), const B4800 = 4800 +pkg syscall (freebsd-386), const B4800 ideal-int +pkg syscall (freebsd-386), const B50 = 50 +pkg syscall (freebsd-386), const B50 ideal-int +pkg syscall (freebsd-386), const B57600 = 57600 +pkg syscall (freebsd-386), const B57600 ideal-int +pkg syscall (freebsd-386), const B600 = 600 +pkg syscall (freebsd-386), const B600 ideal-int +pkg syscall (freebsd-386), const B7200 = 7200 +pkg syscall (freebsd-386), const B7200 ideal-int +pkg syscall (freebsd-386), const B75 = 75 +pkg syscall (freebsd-386), const B75 ideal-int +pkg syscall (freebsd-386), const B76800 = 76800 +pkg syscall (freebsd-386), const B76800 ideal-int +pkg syscall (freebsd-386), const B921600 = 921600 +pkg syscall (freebsd-386), const B921600 ideal-int +pkg syscall (freebsd-386), const B9600 = 9600 +pkg syscall (freebsd-386), const B9600 ideal-int +pkg syscall (freebsd-386), const BIOCFEEDBACK = 2147762812 +pkg syscall (freebsd-386), const BIOCFLUSH = 536887912 +pkg syscall (freebsd-386), const BIOCGBLEN = 1074020966 +pkg syscall (freebsd-386), const BIOCGDIRECTION = 1074020982 +pkg syscall (freebsd-386), const BIOCGDLT = 1074020970 +pkg syscall (freebsd-386), const BIOCGDLTLIST = 3221766777 +pkg syscall (freebsd-386), const BIOCGETBUFMODE = 1074020989 +pkg syscall (freebsd-386), const BIOCGETIF = 1075855979 +pkg syscall (freebsd-386), const BIOCGETZMAX = 1074020991 +pkg syscall (freebsd-386), const BIOCGHDRCMPLT = 1074020980 +pkg syscall (freebsd-386), const BIOCGRSIG = 1074020978 +pkg syscall (freebsd-386), const BIOCGRTIMEOUT = 1074283118 +pkg syscall (freebsd-386), const BIOCGSEESENT = 1074020982 +pkg syscall (freebsd-386), const BIOCGSTATS = 1074283119 +pkg syscall (freebsd-386), const BIOCGTSTAMP = 1074020995 +pkg syscall (freebsd-386), const BIOCGTSTAMP ideal-int +pkg syscall (freebsd-386), const BIOCIMMEDIATE = 2147762800 +pkg syscall (freebsd-386), const BIOCLOCK = 536887930 +pkg syscall (freebsd-386), const BIOCPROMISC = 536887913 +pkg syscall (freebsd-386), const BIOCROTZBUF = 1074545280 +pkg syscall (freebsd-386), const BIOCSBLEN = 3221504614 +pkg syscall (freebsd-386), const BIOCSDIRECTION = 2147762807 +pkg syscall (freebsd-386), const BIOCSDLT = 2147762808 +pkg syscall (freebsd-386), const BIOCSETBUFMODE = 2147762814 +pkg syscall (freebsd-386), const BIOCSETF = 2148024935 +pkg syscall (freebsd-386), const BIOCSETFNR = 2148024962 +pkg syscall (freebsd-386), const BIOCSETIF = 2149597804 +pkg syscall (freebsd-386), const BIOCSETWF = 2148024955 +pkg syscall (freebsd-386), const BIOCSETZBUF = 2148287105 +pkg syscall (freebsd-386), const BIOCSHDRCMPLT = 2147762805 +pkg syscall (freebsd-386), const BIOCSRSIG = 2147762803 +pkg syscall (freebsd-386), const BIOCSRTIMEOUT = 2148024941 +pkg syscall (freebsd-386), const BIOCSSEESENT = 2147762807 +pkg syscall (freebsd-386), const BIOCSTSTAMP = 2147762820 +pkg syscall (freebsd-386), const BIOCSTSTAMP ideal-int +pkg syscall (freebsd-386), const BIOCVERSION = 1074020977 +pkg syscall (freebsd-386), const BPF_A = 16 +pkg syscall (freebsd-386), const BPF_ABS = 32 +pkg syscall (freebsd-386), const BPF_ADD = 0 +pkg syscall (freebsd-386), const BPF_ALIGNMENT = 4 +pkg syscall (freebsd-386), const BPF_ALU = 4 +pkg syscall (freebsd-386), const BPF_AND = 80 +pkg syscall (freebsd-386), const BPF_B = 16 +pkg syscall (freebsd-386), const BPF_BUFMODE_BUFFER = 1 +pkg syscall (freebsd-386), const BPF_BUFMODE_ZBUF = 2 +pkg syscall (freebsd-386), const BPF_DIV = 48 +pkg syscall (freebsd-386), const BPF_H = 8 +pkg syscall (freebsd-386), const BPF_IMM = 0 +pkg syscall (freebsd-386), const BPF_IND = 64 +pkg syscall (freebsd-386), const BPF_JA = 0 +pkg syscall (freebsd-386), const BPF_JEQ = 16 +pkg syscall (freebsd-386), const BPF_JGE = 48 +pkg syscall (freebsd-386), const BPF_JGT = 32 +pkg syscall (freebsd-386), const BPF_JMP = 5 +pkg syscall (freebsd-386), const BPF_JSET = 64 +pkg syscall (freebsd-386), const BPF_K = 0 +pkg syscall (freebsd-386), const BPF_LD = 0 +pkg syscall (freebsd-386), const BPF_LDX = 1 +pkg syscall (freebsd-386), const BPF_LEN = 128 +pkg syscall (freebsd-386), const BPF_LSH = 96 +pkg syscall (freebsd-386), const BPF_MAJOR_VERSION = 1 +pkg syscall (freebsd-386), const BPF_MAXBUFSIZE = 524288 +pkg syscall (freebsd-386), const BPF_MAXINSNS = 512 +pkg syscall (freebsd-386), const BPF_MEM = 96 +pkg syscall (freebsd-386), const BPF_MEMWORDS = 16 +pkg syscall (freebsd-386), const BPF_MINBUFSIZE = 32 +pkg syscall (freebsd-386), const BPF_MINOR_VERSION = 1 +pkg syscall (freebsd-386), const BPF_MISC = 7 +pkg syscall (freebsd-386), const BPF_MSH = 160 +pkg syscall (freebsd-386), const BPF_MUL = 32 +pkg syscall (freebsd-386), const BPF_NEG = 128 +pkg syscall (freebsd-386), const BPF_OR = 64 +pkg syscall (freebsd-386), const BPF_RELEASE = 199606 +pkg syscall (freebsd-386), const BPF_RET = 6 +pkg syscall (freebsd-386), const BPF_RSH = 112 +pkg syscall (freebsd-386), const BPF_ST = 2 +pkg syscall (freebsd-386), const BPF_STX = 3 +pkg syscall (freebsd-386), const BPF_SUB = 16 +pkg syscall (freebsd-386), const BPF_TAX = 0 +pkg syscall (freebsd-386), const BPF_TXA = 128 +pkg syscall (freebsd-386), const BPF_T_BINTIME = 2 +pkg syscall (freebsd-386), const BPF_T_BINTIME ideal-int +pkg syscall (freebsd-386), const BPF_T_BINTIME_FAST = 258 +pkg syscall (freebsd-386), const BPF_T_BINTIME_FAST ideal-int +pkg syscall (freebsd-386), const BPF_T_BINTIME_MONOTONIC = 514 +pkg syscall (freebsd-386), const BPF_T_BINTIME_MONOTONIC ideal-int +pkg syscall (freebsd-386), const BPF_T_BINTIME_MONOTONIC_FAST = 770 +pkg syscall (freebsd-386), const BPF_T_BINTIME_MONOTONIC_FAST ideal-int +pkg syscall (freebsd-386), const BPF_T_FAST = 256 +pkg syscall (freebsd-386), const BPF_T_FAST ideal-int +pkg syscall (freebsd-386), const BPF_T_FLAG_MASK = 768 +pkg syscall (freebsd-386), const BPF_T_FLAG_MASK ideal-int +pkg syscall (freebsd-386), const BPF_T_FORMAT_MASK = 3 +pkg syscall (freebsd-386), const BPF_T_FORMAT_MASK ideal-int +pkg syscall (freebsd-386), const BPF_T_MICROTIME = 0 +pkg syscall (freebsd-386), const BPF_T_MICROTIME ideal-int +pkg syscall (freebsd-386), const BPF_T_MICROTIME_FAST = 256 +pkg syscall (freebsd-386), const BPF_T_MICROTIME_FAST ideal-int +pkg syscall (freebsd-386), const BPF_T_MICROTIME_MONOTONIC = 512 +pkg syscall (freebsd-386), const BPF_T_MICROTIME_MONOTONIC ideal-int +pkg syscall (freebsd-386), const BPF_T_MICROTIME_MONOTONIC_FAST = 768 +pkg syscall (freebsd-386), const BPF_T_MICROTIME_MONOTONIC_FAST ideal-int +pkg syscall (freebsd-386), const BPF_T_MONOTONIC = 512 +pkg syscall (freebsd-386), const BPF_T_MONOTONIC ideal-int +pkg syscall (freebsd-386), const BPF_T_MONOTONIC_FAST = 768 +pkg syscall (freebsd-386), const BPF_T_MONOTONIC_FAST ideal-int +pkg syscall (freebsd-386), const BPF_T_NANOTIME = 1 +pkg syscall (freebsd-386), const BPF_T_NANOTIME ideal-int +pkg syscall (freebsd-386), const BPF_T_NANOTIME_FAST = 257 +pkg syscall (freebsd-386), const BPF_T_NANOTIME_FAST ideal-int +pkg syscall (freebsd-386), const BPF_T_NANOTIME_MONOTONIC = 513 +pkg syscall (freebsd-386), const BPF_T_NANOTIME_MONOTONIC ideal-int +pkg syscall (freebsd-386), const BPF_T_NANOTIME_MONOTONIC_FAST = 769 +pkg syscall (freebsd-386), const BPF_T_NANOTIME_MONOTONIC_FAST ideal-int +pkg syscall (freebsd-386), const BPF_T_NONE = 3 +pkg syscall (freebsd-386), const BPF_T_NONE ideal-int +pkg syscall (freebsd-386), const BPF_T_NORMAL = 0 +pkg syscall (freebsd-386), const BPF_T_NORMAL ideal-int +pkg syscall (freebsd-386), const BPF_W = 0 +pkg syscall (freebsd-386), const BPF_X = 8 +pkg syscall (freebsd-386), const BRKINT = 2 +pkg syscall (freebsd-386), const BRKINT ideal-int +pkg syscall (freebsd-386), const CFLUSH = 15 +pkg syscall (freebsd-386), const CFLUSH ideal-int +pkg syscall (freebsd-386), const CLOCAL = 32768 +pkg syscall (freebsd-386), const CLOCAL ideal-int +pkg syscall (freebsd-386), const CREAD = 2048 +pkg syscall (freebsd-386), const CREAD ideal-int +pkg syscall (freebsd-386), const CS5 = 0 +pkg syscall (freebsd-386), const CS5 ideal-int +pkg syscall (freebsd-386), const CS6 = 256 +pkg syscall (freebsd-386), const CS6 ideal-int +pkg syscall (freebsd-386), const CS7 = 512 +pkg syscall (freebsd-386), const CS7 ideal-int +pkg syscall (freebsd-386), const CS8 = 768 +pkg syscall (freebsd-386), const CS8 ideal-int +pkg syscall (freebsd-386), const CSIZE = 768 +pkg syscall (freebsd-386), const CSIZE ideal-int +pkg syscall (freebsd-386), const CSTART = 17 +pkg syscall (freebsd-386), const CSTART ideal-int +pkg syscall (freebsd-386), const CSTATUS = 20 +pkg syscall (freebsd-386), const CSTATUS ideal-int +pkg syscall (freebsd-386), const CSTOP = 19 +pkg syscall (freebsd-386), const CSTOP ideal-int +pkg syscall (freebsd-386), const CSTOPB = 1024 +pkg syscall (freebsd-386), const CSTOPB ideal-int +pkg syscall (freebsd-386), const CSUSP = 26 +pkg syscall (freebsd-386), const CSUSP ideal-int +pkg syscall (freebsd-386), const CTL_MAXNAME = 24 +pkg syscall (freebsd-386), const CTL_NET = 4 +pkg syscall (freebsd-386), const DLT_A429 = 184 +pkg syscall (freebsd-386), const DLT_A653_ICM = 185 +pkg syscall (freebsd-386), const DLT_AIRONET_HEADER = 120 +pkg syscall (freebsd-386), const DLT_AOS = 222 +pkg syscall (freebsd-386), const DLT_AOS ideal-int +pkg syscall (freebsd-386), const DLT_APPLE_IP_OVER_IEEE1394 = 138 +pkg syscall (freebsd-386), const DLT_ARCNET = 7 +pkg syscall (freebsd-386), const DLT_ARCNET_LINUX = 129 +pkg syscall (freebsd-386), const DLT_ATM_CLIP = 19 +pkg syscall (freebsd-386), const DLT_ATM_RFC1483 = 11 +pkg syscall (freebsd-386), const DLT_AURORA = 126 +pkg syscall (freebsd-386), const DLT_AX25 = 3 +pkg syscall (freebsd-386), const DLT_AX25_KISS = 202 +pkg syscall (freebsd-386), const DLT_BACNET_MS_TP = 165 +pkg syscall (freebsd-386), const DLT_BLUETOOTH_HCI_H4 = 187 +pkg syscall (freebsd-386), const DLT_BLUETOOTH_HCI_H4_WITH_PHDR = 201 +pkg syscall (freebsd-386), const DLT_CAN20B = 190 +pkg syscall (freebsd-386), const DLT_CAN_SOCKETCAN = 227 +pkg syscall (freebsd-386), const DLT_CAN_SOCKETCAN ideal-int +pkg syscall (freebsd-386), const DLT_CHAOS = 5 +pkg syscall (freebsd-386), const DLT_CHDLC = 104 +pkg syscall (freebsd-386), const DLT_CISCO_IOS = 118 +pkg syscall (freebsd-386), const DLT_C_HDLC = 104 +pkg syscall (freebsd-386), const DLT_C_HDLC_WITH_DIR = 205 +pkg syscall (freebsd-386), const DLT_DBUS = 231 +pkg syscall (freebsd-386), const DLT_DBUS ideal-int +pkg syscall (freebsd-386), const DLT_DECT = 221 +pkg syscall (freebsd-386), const DLT_DECT ideal-int +pkg syscall (freebsd-386), const DLT_DOCSIS = 143 +pkg syscall (freebsd-386), const DLT_DVB_CI = 235 +pkg syscall (freebsd-386), const DLT_DVB_CI ideal-int +pkg syscall (freebsd-386), const DLT_ECONET = 115 +pkg syscall (freebsd-386), const DLT_EN10MB = 1 +pkg syscall (freebsd-386), const DLT_EN3MB = 2 +pkg syscall (freebsd-386), const DLT_ENC = 109 +pkg syscall (freebsd-386), const DLT_ERF = 197 +pkg syscall (freebsd-386), const DLT_ERF_ETH = 175 +pkg syscall (freebsd-386), const DLT_ERF_POS = 176 +pkg syscall (freebsd-386), const DLT_FC_2 = 224 +pkg syscall (freebsd-386), const DLT_FC_2 ideal-int +pkg syscall (freebsd-386), const DLT_FC_2_WITH_FRAME_DELIMS = 225 +pkg syscall (freebsd-386), const DLT_FC_2_WITH_FRAME_DELIMS ideal-int +pkg syscall (freebsd-386), const DLT_FDDI = 10 +pkg syscall (freebsd-386), const DLT_FLEXRAY = 210 +pkg syscall (freebsd-386), const DLT_FRELAY = 107 +pkg syscall (freebsd-386), const DLT_FRELAY_WITH_DIR = 206 +pkg syscall (freebsd-386), const DLT_GCOM_SERIAL = 173 +pkg syscall (freebsd-386), const DLT_GCOM_T1E1 = 172 +pkg syscall (freebsd-386), const DLT_GPF_F = 171 +pkg syscall (freebsd-386), const DLT_GPF_T = 170 +pkg syscall (freebsd-386), const DLT_GPRS_LLC = 169 +pkg syscall (freebsd-386), const DLT_GSMTAP_ABIS = 218 +pkg syscall (freebsd-386), const DLT_GSMTAP_ABIS ideal-int +pkg syscall (freebsd-386), const DLT_GSMTAP_UM = 217 +pkg syscall (freebsd-386), const DLT_GSMTAP_UM ideal-int +pkg syscall (freebsd-386), const DLT_HHDLC = 121 +pkg syscall (freebsd-386), const DLT_IBM_SN = 146 +pkg syscall (freebsd-386), const DLT_IBM_SP = 145 +pkg syscall (freebsd-386), const DLT_IEEE802 = 6 +pkg syscall (freebsd-386), const DLT_IEEE802_11 = 105 +pkg syscall (freebsd-386), const DLT_IEEE802_11_RADIO = 127 +pkg syscall (freebsd-386), const DLT_IEEE802_11_RADIO_AVS = 163 +pkg syscall (freebsd-386), const DLT_IEEE802_15_4 = 195 +pkg syscall (freebsd-386), const DLT_IEEE802_15_4_LINUX = 191 +pkg syscall (freebsd-386), const DLT_IEEE802_15_4_NOFCS = 230 +pkg syscall (freebsd-386), const DLT_IEEE802_15_4_NOFCS ideal-int +pkg syscall (freebsd-386), const DLT_IEEE802_15_4_NONASK_PHY = 215 +pkg syscall (freebsd-386), const DLT_IEEE802_16_MAC_CPS = 188 +pkg syscall (freebsd-386), const DLT_IEEE802_16_MAC_CPS_RADIO = 193 +pkg syscall (freebsd-386), const DLT_IPFILTER = 116 +pkg syscall (freebsd-386), const DLT_IPMB = 199 +pkg syscall (freebsd-386), const DLT_IPMB_LINUX = 209 +pkg syscall (freebsd-386), const DLT_IPNET = 226 +pkg syscall (freebsd-386), const DLT_IPNET ideal-int +pkg syscall (freebsd-386), const DLT_IPOIB = 242 +pkg syscall (freebsd-386), const DLT_IPOIB ideal-int +pkg syscall (freebsd-386), const DLT_IPV4 = 228 +pkg syscall (freebsd-386), const DLT_IPV4 ideal-int +pkg syscall (freebsd-386), const DLT_IPV6 = 229 +pkg syscall (freebsd-386), const DLT_IPV6 ideal-int +pkg syscall (freebsd-386), const DLT_IP_OVER_FC = 122 +pkg syscall (freebsd-386), const DLT_JUNIPER_ATM1 = 137 +pkg syscall (freebsd-386), const DLT_JUNIPER_ATM2 = 135 +pkg syscall (freebsd-386), const DLT_JUNIPER_ATM_CEMIC = 238 +pkg syscall (freebsd-386), const DLT_JUNIPER_ATM_CEMIC ideal-int +pkg syscall (freebsd-386), const DLT_JUNIPER_CHDLC = 181 +pkg syscall (freebsd-386), const DLT_JUNIPER_ES = 132 +pkg syscall (freebsd-386), const DLT_JUNIPER_ETHER = 178 +pkg syscall (freebsd-386), const DLT_JUNIPER_FIBRECHANNEL = 234 +pkg syscall (freebsd-386), const DLT_JUNIPER_FIBRECHANNEL ideal-int +pkg syscall (freebsd-386), const DLT_JUNIPER_FRELAY = 180 +pkg syscall (freebsd-386), const DLT_JUNIPER_GGSN = 133 +pkg syscall (freebsd-386), const DLT_JUNIPER_ISM = 194 +pkg syscall (freebsd-386), const DLT_JUNIPER_MFR = 134 +pkg syscall (freebsd-386), const DLT_JUNIPER_MLFR = 131 +pkg syscall (freebsd-386), const DLT_JUNIPER_MLPPP = 130 +pkg syscall (freebsd-386), const DLT_JUNIPER_MONITOR = 164 +pkg syscall (freebsd-386), const DLT_JUNIPER_PIC_PEER = 174 +pkg syscall (freebsd-386), const DLT_JUNIPER_PPP = 179 +pkg syscall (freebsd-386), const DLT_JUNIPER_PPPOE = 167 +pkg syscall (freebsd-386), const DLT_JUNIPER_PPPOE_ATM = 168 +pkg syscall (freebsd-386), const DLT_JUNIPER_SERVICES = 136 +pkg syscall (freebsd-386), const DLT_JUNIPER_SRX_E2E = 233 +pkg syscall (freebsd-386), const DLT_JUNIPER_SRX_E2E ideal-int +pkg syscall (freebsd-386), const DLT_JUNIPER_ST = 200 +pkg syscall (freebsd-386), const DLT_JUNIPER_VP = 183 +pkg syscall (freebsd-386), const DLT_JUNIPER_VS = 232 +pkg syscall (freebsd-386), const DLT_JUNIPER_VS ideal-int +pkg syscall (freebsd-386), const DLT_LAPB_WITH_DIR = 207 +pkg syscall (freebsd-386), const DLT_LAPD = 203 +pkg syscall (freebsd-386), const DLT_LIN = 212 +pkg syscall (freebsd-386), const DLT_LINUX_EVDEV = 216 +pkg syscall (freebsd-386), const DLT_LINUX_EVDEV ideal-int +pkg syscall (freebsd-386), const DLT_LINUX_IRDA = 144 +pkg syscall (freebsd-386), const DLT_LINUX_LAPD = 177 +pkg syscall (freebsd-386), const DLT_LINUX_PPP_WITHDIRECTION = 166 +pkg syscall (freebsd-386), const DLT_LINUX_SLL = 113 +pkg syscall (freebsd-386), const DLT_LOOP = 108 +pkg syscall (freebsd-386), const DLT_LTALK = 114 +pkg syscall (freebsd-386), const DLT_MATCHING_MAX = 242 +pkg syscall (freebsd-386), const DLT_MATCHING_MAX ideal-int +pkg syscall (freebsd-386), const DLT_MATCHING_MIN = 104 +pkg syscall (freebsd-386), const DLT_MATCHING_MIN ideal-int +pkg syscall (freebsd-386), const DLT_MFR = 182 +pkg syscall (freebsd-386), const DLT_MOST = 211 +pkg syscall (freebsd-386), const DLT_MPLS = 219 +pkg syscall (freebsd-386), const DLT_MPLS ideal-int +pkg syscall (freebsd-386), const DLT_MTP2 = 140 +pkg syscall (freebsd-386), const DLT_MTP2_WITH_PHDR = 139 +pkg syscall (freebsd-386), const DLT_MTP3 = 141 +pkg syscall (freebsd-386), const DLT_MUX27010 = 236 +pkg syscall (freebsd-386), const DLT_MUX27010 ideal-int +pkg syscall (freebsd-386), const DLT_NETANALYZER = 240 +pkg syscall (freebsd-386), const DLT_NETANALYZER ideal-int +pkg syscall (freebsd-386), const DLT_NETANALYZER_TRANSPARENT = 241 +pkg syscall (freebsd-386), const DLT_NETANALYZER_TRANSPARENT ideal-int +pkg syscall (freebsd-386), const DLT_NFLOG = 239 +pkg syscall (freebsd-386), const DLT_NFLOG ideal-int +pkg syscall (freebsd-386), const DLT_NULL = 0 +pkg syscall (freebsd-386), const DLT_PCI_EXP = 125 +pkg syscall (freebsd-386), const DLT_PFLOG = 117 +pkg syscall (freebsd-386), const DLT_PFSYNC = 121 +pkg syscall (freebsd-386), const DLT_PPI = 192 +pkg syscall (freebsd-386), const DLT_PPP = 9 +pkg syscall (freebsd-386), const DLT_PPP_BSDOS = 16 +pkg syscall (freebsd-386), const DLT_PPP_ETHER = 51 +pkg syscall (freebsd-386), const DLT_PPP_PPPD = 166 +pkg syscall (freebsd-386), const DLT_PPP_SERIAL = 50 +pkg syscall (freebsd-386), const DLT_PPP_WITH_DIR = 204 +pkg syscall (freebsd-386), const DLT_PPP_WITH_DIRECTION = 166 +pkg syscall (freebsd-386), const DLT_PRISM_HEADER = 119 +pkg syscall (freebsd-386), const DLT_PRONET = 4 +pkg syscall (freebsd-386), const DLT_RAIF1 = 198 +pkg syscall (freebsd-386), const DLT_RAW = 12 +pkg syscall (freebsd-386), const DLT_RIO = 124 +pkg syscall (freebsd-386), const DLT_SCCP = 142 +pkg syscall (freebsd-386), const DLT_SITA = 196 +pkg syscall (freebsd-386), const DLT_SLIP = 8 +pkg syscall (freebsd-386), const DLT_SLIP_BSDOS = 15 +pkg syscall (freebsd-386), const DLT_STANAG_5066_D_PDU = 237 +pkg syscall (freebsd-386), const DLT_STANAG_5066_D_PDU ideal-int +pkg syscall (freebsd-386), const DLT_SUNATM = 123 +pkg syscall (freebsd-386), const DLT_SYMANTEC_FIREWALL = 99 +pkg syscall (freebsd-386), const DLT_TZSP = 128 +pkg syscall (freebsd-386), const DLT_USB = 186 +pkg syscall (freebsd-386), const DLT_USB_LINUX = 189 +pkg syscall (freebsd-386), const DLT_USB_LINUX_MMAPPED = 220 +pkg syscall (freebsd-386), const DLT_USB_LINUX_MMAPPED ideal-int +pkg syscall (freebsd-386), const DLT_USER0 = 147 +pkg syscall (freebsd-386), const DLT_USER1 = 148 +pkg syscall (freebsd-386), const DLT_USER10 = 157 +pkg syscall (freebsd-386), const DLT_USER11 = 158 +pkg syscall (freebsd-386), const DLT_USER12 = 159 +pkg syscall (freebsd-386), const DLT_USER13 = 160 +pkg syscall (freebsd-386), const DLT_USER14 = 161 +pkg syscall (freebsd-386), const DLT_USER15 = 162 +pkg syscall (freebsd-386), const DLT_USER2 = 149 +pkg syscall (freebsd-386), const DLT_USER3 = 150 +pkg syscall (freebsd-386), const DLT_USER4 = 151 +pkg syscall (freebsd-386), const DLT_USER5 = 152 +pkg syscall (freebsd-386), const DLT_USER6 = 153 +pkg syscall (freebsd-386), const DLT_USER7 = 154 +pkg syscall (freebsd-386), const DLT_USER8 = 155 +pkg syscall (freebsd-386), const DLT_USER9 = 156 +pkg syscall (freebsd-386), const DLT_WIHART = 223 +pkg syscall (freebsd-386), const DLT_WIHART ideal-int +pkg syscall (freebsd-386), const DLT_X2E_SERIAL = 213 +pkg syscall (freebsd-386), const DLT_X2E_XORAYA = 214 +pkg syscall (freebsd-386), const DT_BLK = 6 +pkg syscall (freebsd-386), const DT_CHR = 2 +pkg syscall (freebsd-386), const DT_DIR = 4 +pkg syscall (freebsd-386), const DT_FIFO = 1 +pkg syscall (freebsd-386), const DT_LNK = 10 +pkg syscall (freebsd-386), const DT_REG = 8 +pkg syscall (freebsd-386), const DT_SOCK = 12 +pkg syscall (freebsd-386), const DT_UNKNOWN = 0 +pkg syscall (freebsd-386), const DT_WHT = 14 +pkg syscall (freebsd-386), const E2BIG = 7 +pkg syscall (freebsd-386), const EACCES = 13 +pkg syscall (freebsd-386), const EADDRINUSE = 48 +pkg syscall (freebsd-386), const EADDRNOTAVAIL = 49 +pkg syscall (freebsd-386), const EAFNOSUPPORT = 47 +pkg syscall (freebsd-386), const EAGAIN = 35 +pkg syscall (freebsd-386), const EALREADY = 37 +pkg syscall (freebsd-386), const EAUTH = 80 +pkg syscall (freebsd-386), const EBADF = 9 +pkg syscall (freebsd-386), const EBADMSG = 89 +pkg syscall (freebsd-386), const EBADRPC = 72 +pkg syscall (freebsd-386), const EBUSY = 16 +pkg syscall (freebsd-386), const ECANCELED = 85 +pkg syscall (freebsd-386), const ECAPMODE = 94 +pkg syscall (freebsd-386), const ECAPMODE Errno +pkg syscall (freebsd-386), const ECHILD = 10 +pkg syscall (freebsd-386), const ECHO = 8 +pkg syscall (freebsd-386), const ECHOCTL = 64 +pkg syscall (freebsd-386), const ECHOE = 2 +pkg syscall (freebsd-386), const ECHOK = 4 +pkg syscall (freebsd-386), const ECHOKE = 1 +pkg syscall (freebsd-386), const ECHONL = 16 +pkg syscall (freebsd-386), const ECHOPRT = 32 +pkg syscall (freebsd-386), const ECONNABORTED = 53 +pkg syscall (freebsd-386), const ECONNREFUSED = 61 +pkg syscall (freebsd-386), const ECONNRESET = 54 +pkg syscall (freebsd-386), const EDEADLK = 11 +pkg syscall (freebsd-386), const EDESTADDRREQ = 39 +pkg syscall (freebsd-386), const EDOM = 33 +pkg syscall (freebsd-386), const EDOOFUS = 88 +pkg syscall (freebsd-386), const EDQUOT = 69 +pkg syscall (freebsd-386), const EEXIST = 17 +pkg syscall (freebsd-386), const EFAULT = 14 +pkg syscall (freebsd-386), const EFBIG = 27 +pkg syscall (freebsd-386), const EFTYPE = 79 +pkg syscall (freebsd-386), const EHOSTDOWN = 64 +pkg syscall (freebsd-386), const EHOSTUNREACH = 65 +pkg syscall (freebsd-386), const EIDRM = 82 +pkg syscall (freebsd-386), const EILSEQ = 86 +pkg syscall (freebsd-386), const EINPROGRESS = 36 +pkg syscall (freebsd-386), const EINTR = 4 +pkg syscall (freebsd-386), const EINVAL = 22 +pkg syscall (freebsd-386), const EIO = 5 +pkg syscall (freebsd-386), const EISCONN = 56 +pkg syscall (freebsd-386), const EISDIR = 21 +pkg syscall (freebsd-386), const ELAST = 94 +pkg syscall (freebsd-386), const ELOOP = 62 +pkg syscall (freebsd-386), const EMFILE = 24 +pkg syscall (freebsd-386), const EMLINK = 31 +pkg syscall (freebsd-386), const EMSGSIZE = 40 +pkg syscall (freebsd-386), const EMULTIHOP = 90 +pkg syscall (freebsd-386), const ENAMETOOLONG = 63 +pkg syscall (freebsd-386), const ENEEDAUTH = 81 +pkg syscall (freebsd-386), const ENETDOWN = 50 +pkg syscall (freebsd-386), const ENETRESET = 52 +pkg syscall (freebsd-386), const ENETUNREACH = 51 +pkg syscall (freebsd-386), const ENFILE = 23 +pkg syscall (freebsd-386), const ENOATTR = 87 +pkg syscall (freebsd-386), const ENOBUFS = 55 +pkg syscall (freebsd-386), const ENODEV = 19 +pkg syscall (freebsd-386), const ENOEXEC = 8 +pkg syscall (freebsd-386), const ENOLCK = 77 +pkg syscall (freebsd-386), const ENOLINK = 91 +pkg syscall (freebsd-386), const ENOMEM = 12 +pkg syscall (freebsd-386), const ENOMSG = 83 +pkg syscall (freebsd-386), const ENOPROTOOPT = 42 +pkg syscall (freebsd-386), const ENOSPC = 28 +pkg syscall (freebsd-386), const ENOSYS = 78 +pkg syscall (freebsd-386), const ENOTBLK = 15 +pkg syscall (freebsd-386), const ENOTCAPABLE = 93 +pkg syscall (freebsd-386), const ENOTCONN = 57 +pkg syscall (freebsd-386), const ENOTDIR = 20 +pkg syscall (freebsd-386), const ENOTEMPTY = 66 +pkg syscall (freebsd-386), const ENOTSOCK = 38 +pkg syscall (freebsd-386), const ENOTSUP = 45 +pkg syscall (freebsd-386), const ENOTTY = 25 +pkg syscall (freebsd-386), const ENXIO = 6 +pkg syscall (freebsd-386), const EOPNOTSUPP = 45 +pkg syscall (freebsd-386), const EOVERFLOW = 84 +pkg syscall (freebsd-386), const EPERM = 1 +pkg syscall (freebsd-386), const EPFNOSUPPORT = 46 +pkg syscall (freebsd-386), const EPIPE = 32 +pkg syscall (freebsd-386), const EPROCLIM = 67 +pkg syscall (freebsd-386), const EPROCUNAVAIL = 76 +pkg syscall (freebsd-386), const EPROGMISMATCH = 75 +pkg syscall (freebsd-386), const EPROGUNAVAIL = 74 +pkg syscall (freebsd-386), const EPROTO = 92 +pkg syscall (freebsd-386), const EPROTONOSUPPORT = 43 +pkg syscall (freebsd-386), const EPROTOTYPE = 41 +pkg syscall (freebsd-386), const ERANGE = 34 +pkg syscall (freebsd-386), const EREMOTE = 71 +pkg syscall (freebsd-386), const EROFS = 30 +pkg syscall (freebsd-386), const ERPCMISMATCH = 73 +pkg syscall (freebsd-386), const ESHUTDOWN = 58 +pkg syscall (freebsd-386), const ESOCKTNOSUPPORT = 44 +pkg syscall (freebsd-386), const ESPIPE = 29 +pkg syscall (freebsd-386), const ESRCH = 3 +pkg syscall (freebsd-386), const ESTALE = 70 +pkg syscall (freebsd-386), const ETIMEDOUT = 60 +pkg syscall (freebsd-386), const ETOOMANYREFS = 59 +pkg syscall (freebsd-386), const ETXTBSY = 26 +pkg syscall (freebsd-386), const EUSERS = 68 +pkg syscall (freebsd-386), const EVFILT_AIO = -3 +pkg syscall (freebsd-386), const EVFILT_FS = -9 +pkg syscall (freebsd-386), const EVFILT_LIO = -10 +pkg syscall (freebsd-386), const EVFILT_PROC = -5 +pkg syscall (freebsd-386), const EVFILT_READ = -1 +pkg syscall (freebsd-386), const EVFILT_SIGNAL = -6 +pkg syscall (freebsd-386), const EVFILT_SYSCOUNT = 11 +pkg syscall (freebsd-386), const EVFILT_TIMER = -7 +pkg syscall (freebsd-386), const EVFILT_USER = -11 +pkg syscall (freebsd-386), const EVFILT_VNODE = -4 +pkg syscall (freebsd-386), const EVFILT_WRITE = -2 +pkg syscall (freebsd-386), const EV_ADD = 1 +pkg syscall (freebsd-386), const EV_CLEAR = 32 +pkg syscall (freebsd-386), const EV_DELETE = 2 +pkg syscall (freebsd-386), const EV_DISABLE = 8 +pkg syscall (freebsd-386), const EV_DISPATCH = 128 +pkg syscall (freebsd-386), const EV_ENABLE = 4 +pkg syscall (freebsd-386), const EV_EOF = 32768 +pkg syscall (freebsd-386), const EV_ERROR = 16384 +pkg syscall (freebsd-386), const EV_FLAG1 = 8192 +pkg syscall (freebsd-386), const EV_ONESHOT = 16 +pkg syscall (freebsd-386), const EV_RECEIPT = 64 +pkg syscall (freebsd-386), const EV_SYSFLAGS = 61440 +pkg syscall (freebsd-386), const EWOULDBLOCK = 35 +pkg syscall (freebsd-386), const EXDEV = 18 +pkg syscall (freebsd-386), const EXTA = 19200 +pkg syscall (freebsd-386), const EXTB = 38400 +pkg syscall (freebsd-386), const EXTPROC = 2048 +pkg syscall (freebsd-386), const FD_CLOEXEC = 1 +pkg syscall (freebsd-386), const FD_SETSIZE = 1024 +pkg syscall (freebsd-386), const FLUSHO = 8388608 +pkg syscall (freebsd-386), const FLUSHO ideal-int +pkg syscall (freebsd-386), const F_CANCEL = 5 +pkg syscall (freebsd-386), const F_DUP2FD = 10 +pkg syscall (freebsd-386), const F_DUPFD = 0 +pkg syscall (freebsd-386), const F_GETFD = 1 +pkg syscall (freebsd-386), const F_GETFL = 3 +pkg syscall (freebsd-386), const F_GETLK = 11 +pkg syscall (freebsd-386), const F_GETOWN = 5 +pkg syscall (freebsd-386), const F_OGETLK = 7 +pkg syscall (freebsd-386), const F_OK = 0 +pkg syscall (freebsd-386), const F_OSETLK = 8 +pkg syscall (freebsd-386), const F_OSETLKW = 9 +pkg syscall (freebsd-386), const F_RDAHEAD = 16 +pkg syscall (freebsd-386), const F_RDLCK = 1 +pkg syscall (freebsd-386), const F_READAHEAD = 15 +pkg syscall (freebsd-386), const F_SETFD = 2 +pkg syscall (freebsd-386), const F_SETFL = 4 +pkg syscall (freebsd-386), const F_SETLK = 12 +pkg syscall (freebsd-386), const F_SETLKW = 13 +pkg syscall (freebsd-386), const F_SETLK_REMOTE = 14 +pkg syscall (freebsd-386), const F_SETOWN = 6 +pkg syscall (freebsd-386), const F_UNLCK = 2 +pkg syscall (freebsd-386), const F_UNLCKSYS = 4 +pkg syscall (freebsd-386), const F_WRLCK = 3 +pkg syscall (freebsd-386), const HUPCL = 16384 +pkg syscall (freebsd-386), const HUPCL ideal-int +pkg syscall (freebsd-386), const ICANON = 256 +pkg syscall (freebsd-386), const ICANON ideal-int +pkg syscall (freebsd-386), const ICRNL = 256 +pkg syscall (freebsd-386), const ICRNL ideal-int +pkg syscall (freebsd-386), const IEXTEN = 1024 +pkg syscall (freebsd-386), const IEXTEN ideal-int +pkg syscall (freebsd-386), const IFAN_ARRIVAL = 0 +pkg syscall (freebsd-386), const IFAN_ARRIVAL ideal-int +pkg syscall (freebsd-386), const IFAN_DEPARTURE = 1 +pkg syscall (freebsd-386), const IFAN_DEPARTURE ideal-int +pkg syscall (freebsd-386), const IFF_ALLMULTI = 512 +pkg syscall (freebsd-386), const IFF_ALTPHYS = 16384 +pkg syscall (freebsd-386), const IFF_CANTCHANGE = 2199410 +pkg syscall (freebsd-386), const IFF_CANTCONFIG = 65536 +pkg syscall (freebsd-386), const IFF_CANTCONFIG ideal-int +pkg syscall (freebsd-386), const IFF_DEBUG = 4 +pkg syscall (freebsd-386), const IFF_DRV_OACTIVE = 1024 +pkg syscall (freebsd-386), const IFF_DRV_RUNNING = 64 +pkg syscall (freebsd-386), const IFF_DYING = 2097152 +pkg syscall (freebsd-386), const IFF_LINK0 = 4096 +pkg syscall (freebsd-386), const IFF_LINK1 = 8192 +pkg syscall (freebsd-386), const IFF_LINK2 = 16384 +pkg syscall (freebsd-386), const IFF_LOOPBACK = 8 +pkg syscall (freebsd-386), const IFF_MONITOR = 262144 +pkg syscall (freebsd-386), const IFF_MULTICAST = 32768 +pkg syscall (freebsd-386), const IFF_NOARP = 128 +pkg syscall (freebsd-386), const IFF_OACTIVE = 1024 +pkg syscall (freebsd-386), const IFF_POINTOPOINT = 16 +pkg syscall (freebsd-386), const IFF_PPROMISC = 131072 +pkg syscall (freebsd-386), const IFF_PROMISC = 256 +pkg syscall (freebsd-386), const IFF_RENAMING = 4194304 +pkg syscall (freebsd-386), const IFF_RUNNING = 64 +pkg syscall (freebsd-386), const IFF_SIMPLEX = 2048 +pkg syscall (freebsd-386), const IFF_SMART = 32 +pkg syscall (freebsd-386), const IFF_STATICARP = 524288 +pkg syscall (freebsd-386), const IFNAMSIZ = 16 +pkg syscall (freebsd-386), const IFT_1822 = 2 +pkg syscall (freebsd-386), const IFT_A12MPPSWITCH = 130 +pkg syscall (freebsd-386), const IFT_AAL2 = 187 +pkg syscall (freebsd-386), const IFT_AAL5 = 49 +pkg syscall (freebsd-386), const IFT_ADSL = 94 +pkg syscall (freebsd-386), const IFT_AFLANE8023 = 59 +pkg syscall (freebsd-386), const IFT_AFLANE8025 = 60 +pkg syscall (freebsd-386), const IFT_ARAP = 88 +pkg syscall (freebsd-386), const IFT_ARCNET = 35 +pkg syscall (freebsd-386), const IFT_ARCNETPLUS = 36 +pkg syscall (freebsd-386), const IFT_ASYNC = 84 +pkg syscall (freebsd-386), const IFT_ATM = 37 +pkg syscall (freebsd-386), const IFT_ATMDXI = 105 +pkg syscall (freebsd-386), const IFT_ATMFUNI = 106 +pkg syscall (freebsd-386), const IFT_ATMIMA = 107 +pkg syscall (freebsd-386), const IFT_ATMLOGICAL = 80 +pkg syscall (freebsd-386), const IFT_ATMRADIO = 189 +pkg syscall (freebsd-386), const IFT_ATMSUBINTERFACE = 134 +pkg syscall (freebsd-386), const IFT_ATMVCIENDPT = 194 +pkg syscall (freebsd-386), const IFT_ATMVIRTUAL = 149 +pkg syscall (freebsd-386), const IFT_BGPPOLICYACCOUNTING = 162 +pkg syscall (freebsd-386), const IFT_BRIDGE = 209 +pkg syscall (freebsd-386), const IFT_BSC = 83 +pkg syscall (freebsd-386), const IFT_CARP = 248 +pkg syscall (freebsd-386), const IFT_CCTEMUL = 61 +pkg syscall (freebsd-386), const IFT_CEPT = 19 +pkg syscall (freebsd-386), const IFT_CES = 133 +pkg syscall (freebsd-386), const IFT_CHANNEL = 70 +pkg syscall (freebsd-386), const IFT_CNR = 85 +pkg syscall (freebsd-386), const IFT_COFFEE = 132 +pkg syscall (freebsd-386), const IFT_COMPOSITELINK = 155 +pkg syscall (freebsd-386), const IFT_DCN = 141 +pkg syscall (freebsd-386), const IFT_DIGITALPOWERLINE = 138 +pkg syscall (freebsd-386), const IFT_DIGITALWRAPPEROVERHEADCHANNEL = 186 +pkg syscall (freebsd-386), const IFT_DLSW = 74 +pkg syscall (freebsd-386), const IFT_DOCSCABLEDOWNSTREAM = 128 +pkg syscall (freebsd-386), const IFT_DOCSCABLEMACLAYER = 127 +pkg syscall (freebsd-386), const IFT_DOCSCABLEUPSTREAM = 129 +pkg syscall (freebsd-386), const IFT_DS0 = 81 +pkg syscall (freebsd-386), const IFT_DS0BUNDLE = 82 +pkg syscall (freebsd-386), const IFT_DS1FDL = 170 +pkg syscall (freebsd-386), const IFT_DS3 = 30 +pkg syscall (freebsd-386), const IFT_DTM = 140 +pkg syscall (freebsd-386), const IFT_DVBASILN = 172 +pkg syscall (freebsd-386), const IFT_DVBASIOUT = 173 +pkg syscall (freebsd-386), const IFT_DVBRCCDOWNSTREAM = 147 +pkg syscall (freebsd-386), const IFT_DVBRCCMACLAYER = 146 +pkg syscall (freebsd-386), const IFT_DVBRCCUPSTREAM = 148 +pkg syscall (freebsd-386), const IFT_ENC = 244 +pkg syscall (freebsd-386), const IFT_EON = 25 +pkg syscall (freebsd-386), const IFT_EPLRS = 87 +pkg syscall (freebsd-386), const IFT_ESCON = 73 +pkg syscall (freebsd-386), const IFT_ETHER = 6 +pkg syscall (freebsd-386), const IFT_FAITH = 242 +pkg syscall (freebsd-386), const IFT_FAST = 125 +pkg syscall (freebsd-386), const IFT_FASTETHER = 62 +pkg syscall (freebsd-386), const IFT_FASTETHERFX = 69 +pkg syscall (freebsd-386), const IFT_FDDI = 15 +pkg syscall (freebsd-386), const IFT_FIBRECHANNEL = 56 +pkg syscall (freebsd-386), const IFT_FRAMERELAYINTERCONNECT = 58 +pkg syscall (freebsd-386), const IFT_FRAMERELAYMPI = 92 +pkg syscall (freebsd-386), const IFT_FRDLCIENDPT = 193 +pkg syscall (freebsd-386), const IFT_FRELAY = 32 +pkg syscall (freebsd-386), const IFT_FRELAYDCE = 44 +pkg syscall (freebsd-386), const IFT_FRF16MFRBUNDLE = 163 +pkg syscall (freebsd-386), const IFT_FRFORWARD = 158 +pkg syscall (freebsd-386), const IFT_G703AT2MB = 67 +pkg syscall (freebsd-386), const IFT_G703AT64K = 66 +pkg syscall (freebsd-386), const IFT_GIF = 240 +pkg syscall (freebsd-386), const IFT_GIGABITETHERNET = 117 +pkg syscall (freebsd-386), const IFT_GR303IDT = 178 +pkg syscall (freebsd-386), const IFT_GR303RDT = 177 +pkg syscall (freebsd-386), const IFT_H323GATEKEEPER = 164 +pkg syscall (freebsd-386), const IFT_H323PROXY = 165 +pkg syscall (freebsd-386), const IFT_HDH1822 = 3 +pkg syscall (freebsd-386), const IFT_HDLC = 118 +pkg syscall (freebsd-386), const IFT_HDSL2 = 168 +pkg syscall (freebsd-386), const IFT_HIPERLAN2 = 183 +pkg syscall (freebsd-386), const IFT_HIPPI = 47 +pkg syscall (freebsd-386), const IFT_HIPPIINTERFACE = 57 +pkg syscall (freebsd-386), const IFT_HOSTPAD = 90 +pkg syscall (freebsd-386), const IFT_HSSI = 46 +pkg syscall (freebsd-386), const IFT_HY = 14 +pkg syscall (freebsd-386), const IFT_IBM370PARCHAN = 72 +pkg syscall (freebsd-386), const IFT_IDSL = 154 +pkg syscall (freebsd-386), const IFT_IEEE1394 = 144 +pkg syscall (freebsd-386), const IFT_IEEE80211 = 71 +pkg syscall (freebsd-386), const IFT_IEEE80212 = 55 +pkg syscall (freebsd-386), const IFT_IEEE8023ADLAG = 161 +pkg syscall (freebsd-386), const IFT_IFGSN = 145 +pkg syscall (freebsd-386), const IFT_IMT = 190 +pkg syscall (freebsd-386), const IFT_INFINIBAND = 199 +pkg syscall (freebsd-386), const IFT_INFINIBAND ideal-int +pkg syscall (freebsd-386), const IFT_INTERLEAVE = 124 +pkg syscall (freebsd-386), const IFT_IP = 126 +pkg syscall (freebsd-386), const IFT_IPFORWARD = 142 +pkg syscall (freebsd-386), const IFT_IPOVERATM = 114 +pkg syscall (freebsd-386), const IFT_IPOVERCDLC = 109 +pkg syscall (freebsd-386), const IFT_IPOVERCLAW = 110 +pkg syscall (freebsd-386), const IFT_IPSWITCH = 78 +pkg syscall (freebsd-386), const IFT_IPXIP = 249 +pkg syscall (freebsd-386), const IFT_ISDN = 63 +pkg syscall (freebsd-386), const IFT_ISDNBASIC = 20 +pkg syscall (freebsd-386), const IFT_ISDNPRIMARY = 21 +pkg syscall (freebsd-386), const IFT_ISDNS = 75 +pkg syscall (freebsd-386), const IFT_ISDNU = 76 +pkg syscall (freebsd-386), const IFT_ISO88022LLC = 41 +pkg syscall (freebsd-386), const IFT_ISO88023 = 7 +pkg syscall (freebsd-386), const IFT_ISO88024 = 8 +pkg syscall (freebsd-386), const IFT_ISO88025 = 9 +pkg syscall (freebsd-386), const IFT_ISO88025CRFPINT = 98 +pkg syscall (freebsd-386), const IFT_ISO88025DTR = 86 +pkg syscall (freebsd-386), const IFT_ISO88025FIBER = 115 +pkg syscall (freebsd-386), const IFT_ISO88026 = 10 +pkg syscall (freebsd-386), const IFT_ISUP = 179 +pkg syscall (freebsd-386), const IFT_L2VLAN = 135 +pkg syscall (freebsd-386), const IFT_L3IPVLAN = 136 +pkg syscall (freebsd-386), const IFT_L3IPXVLAN = 137 +pkg syscall (freebsd-386), const IFT_LAPB = 16 +pkg syscall (freebsd-386), const IFT_LAPD = 77 +pkg syscall (freebsd-386), const IFT_LAPF = 119 +pkg syscall (freebsd-386), const IFT_LOCALTALK = 42 +pkg syscall (freebsd-386), const IFT_LOOP = 24 +pkg syscall (freebsd-386), const IFT_MEDIAMAILOVERIP = 139 +pkg syscall (freebsd-386), const IFT_MFSIGLINK = 167 +pkg syscall (freebsd-386), const IFT_MIOX25 = 38 +pkg syscall (freebsd-386), const IFT_MODEM = 48 +pkg syscall (freebsd-386), const IFT_MPC = 113 +pkg syscall (freebsd-386), const IFT_MPLS = 166 +pkg syscall (freebsd-386), const IFT_MPLSTUNNEL = 150 +pkg syscall (freebsd-386), const IFT_MSDSL = 143 +pkg syscall (freebsd-386), const IFT_MVL = 191 +pkg syscall (freebsd-386), const IFT_MYRINET = 99 +pkg syscall (freebsd-386), const IFT_NFAS = 175 +pkg syscall (freebsd-386), const IFT_NSIP = 27 +pkg syscall (freebsd-386), const IFT_OPTICALCHANNEL = 195 +pkg syscall (freebsd-386), const IFT_OPTICALTRANSPORT = 196 +pkg syscall (freebsd-386), const IFT_OTHER = 1 +pkg syscall (freebsd-386), const IFT_P10 = 12 +pkg syscall (freebsd-386), const IFT_P80 = 13 +pkg syscall (freebsd-386), const IFT_PARA = 34 +pkg syscall (freebsd-386), const IFT_PFLOG = 246 +pkg syscall (freebsd-386), const IFT_PFSYNC = 247 +pkg syscall (freebsd-386), const IFT_PLC = 174 +pkg syscall (freebsd-386), const IFT_POS = 171 +pkg syscall (freebsd-386), const IFT_PPP = 23 +pkg syscall (freebsd-386), const IFT_PPPMULTILINKBUNDLE = 108 +pkg syscall (freebsd-386), const IFT_PROPBWAP2MP = 184 +pkg syscall (freebsd-386), const IFT_PROPCNLS = 89 +pkg syscall (freebsd-386), const IFT_PROPDOCSWIRELESSDOWNSTREAM = 181 +pkg syscall (freebsd-386), const IFT_PROPDOCSWIRELESSMACLAYER = 180 +pkg syscall (freebsd-386), const IFT_PROPDOCSWIRELESSUPSTREAM = 182 +pkg syscall (freebsd-386), const IFT_PROPMUX = 54 +pkg syscall (freebsd-386), const IFT_PROPVIRTUAL = 53 +pkg syscall (freebsd-386), const IFT_PROPWIRELESSP2P = 157 +pkg syscall (freebsd-386), const IFT_PTPSERIAL = 22 +pkg syscall (freebsd-386), const IFT_PVC = 241 +pkg syscall (freebsd-386), const IFT_QLLC = 68 +pkg syscall (freebsd-386), const IFT_RADIOMAC = 188 +pkg syscall (freebsd-386), const IFT_RADSL = 95 +pkg syscall (freebsd-386), const IFT_REACHDSL = 192 +pkg syscall (freebsd-386), const IFT_RFC1483 = 159 +pkg syscall (freebsd-386), const IFT_RS232 = 33 +pkg syscall (freebsd-386), const IFT_RSRB = 79 +pkg syscall (freebsd-386), const IFT_SDLC = 17 +pkg syscall (freebsd-386), const IFT_SDSL = 96 +pkg syscall (freebsd-386), const IFT_SHDSL = 169 +pkg syscall (freebsd-386), const IFT_SIP = 31 +pkg syscall (freebsd-386), const IFT_SLIP = 28 +pkg syscall (freebsd-386), const IFT_SMDSDXI = 43 +pkg syscall (freebsd-386), const IFT_SMDSICIP = 52 +pkg syscall (freebsd-386), const IFT_SONET = 39 +pkg syscall (freebsd-386), const IFT_SONETOVERHEADCHANNEL = 185 +pkg syscall (freebsd-386), const IFT_SONETPATH = 50 +pkg syscall (freebsd-386), const IFT_SONETVT = 51 +pkg syscall (freebsd-386), const IFT_SRP = 151 +pkg syscall (freebsd-386), const IFT_SS7SIGLINK = 156 +pkg syscall (freebsd-386), const IFT_STACKTOSTACK = 111 +pkg syscall (freebsd-386), const IFT_STARLAN = 11 +pkg syscall (freebsd-386), const IFT_STF = 215 +pkg syscall (freebsd-386), const IFT_T1 = 18 +pkg syscall (freebsd-386), const IFT_TDLC = 116 +pkg syscall (freebsd-386), const IFT_TERMPAD = 91 +pkg syscall (freebsd-386), const IFT_TR008 = 176 +pkg syscall (freebsd-386), const IFT_TRANSPHDLC = 123 +pkg syscall (freebsd-386), const IFT_TUNNEL = 131 +pkg syscall (freebsd-386), const IFT_ULTRA = 29 +pkg syscall (freebsd-386), const IFT_USB = 160 +pkg syscall (freebsd-386), const IFT_V11 = 64 +pkg syscall (freebsd-386), const IFT_V35 = 45 +pkg syscall (freebsd-386), const IFT_V36 = 65 +pkg syscall (freebsd-386), const IFT_V37 = 120 +pkg syscall (freebsd-386), const IFT_VDSL = 97 +pkg syscall (freebsd-386), const IFT_VIRTUALIPADDRESS = 112 +pkg syscall (freebsd-386), const IFT_VOICEEM = 100 +pkg syscall (freebsd-386), const IFT_VOICEENCAP = 103 +pkg syscall (freebsd-386), const IFT_VOICEFXO = 101 +pkg syscall (freebsd-386), const IFT_VOICEFXS = 102 +pkg syscall (freebsd-386), const IFT_VOICEOVERATM = 152 +pkg syscall (freebsd-386), const IFT_VOICEOVERFRAMERELAY = 153 +pkg syscall (freebsd-386), const IFT_VOICEOVERIP = 104 +pkg syscall (freebsd-386), const IFT_X213 = 93 +pkg syscall (freebsd-386), const IFT_X25 = 5 +pkg syscall (freebsd-386), const IFT_X25DDN = 4 +pkg syscall (freebsd-386), const IFT_X25HUNTGROUP = 122 +pkg syscall (freebsd-386), const IFT_X25MLP = 121 +pkg syscall (freebsd-386), const IFT_X25PLE = 40 +pkg syscall (freebsd-386), const IFT_XETHER = 26 +pkg syscall (freebsd-386), const IGNBRK = 1 +pkg syscall (freebsd-386), const IGNBRK ideal-int +pkg syscall (freebsd-386), const IGNCR = 128 +pkg syscall (freebsd-386), const IGNCR ideal-int +pkg syscall (freebsd-386), const IGNPAR = 4 +pkg syscall (freebsd-386), const IGNPAR ideal-int +pkg syscall (freebsd-386), const IMAXBEL = 8192 +pkg syscall (freebsd-386), const IMAXBEL ideal-int +pkg syscall (freebsd-386), const INLCR = 64 +pkg syscall (freebsd-386), const INLCR ideal-int +pkg syscall (freebsd-386), const INPCK = 16 +pkg syscall (freebsd-386), const INPCK ideal-int +pkg syscall (freebsd-386), const IN_CLASSA_HOST = 16777215 +pkg syscall (freebsd-386), const IN_CLASSA_MAX = 128 +pkg syscall (freebsd-386), const IN_CLASSA_NET = 4278190080 +pkg syscall (freebsd-386), const IN_CLASSA_NSHIFT = 24 +pkg syscall (freebsd-386), const IN_CLASSB_HOST = 65535 +pkg syscall (freebsd-386), const IN_CLASSB_MAX = 65536 +pkg syscall (freebsd-386), const IN_CLASSB_NET = 4294901760 +pkg syscall (freebsd-386), const IN_CLASSB_NSHIFT = 16 +pkg syscall (freebsd-386), const IN_CLASSC_HOST = 255 +pkg syscall (freebsd-386), const IN_CLASSC_NET = 4294967040 +pkg syscall (freebsd-386), const IN_CLASSC_NSHIFT = 8 +pkg syscall (freebsd-386), const IN_CLASSD_HOST = 268435455 +pkg syscall (freebsd-386), const IN_CLASSD_NET = 4026531840 +pkg syscall (freebsd-386), const IN_CLASSD_NSHIFT = 28 +pkg syscall (freebsd-386), const IN_LOOPBACKNET = 127 +pkg syscall (freebsd-386), const IN_RFC3021_MASK = 4294967294 +pkg syscall (freebsd-386), const IN_RFC3021_MASK ideal-int +pkg syscall (freebsd-386), const IPPROTO_3PC = 34 +pkg syscall (freebsd-386), const IPPROTO_ADFS = 68 +pkg syscall (freebsd-386), const IPPROTO_AH = 51 +pkg syscall (freebsd-386), const IPPROTO_AHIP = 61 +pkg syscall (freebsd-386), const IPPROTO_APES = 99 +pkg syscall (freebsd-386), const IPPROTO_ARGUS = 13 +pkg syscall (freebsd-386), const IPPROTO_AX25 = 93 +pkg syscall (freebsd-386), const IPPROTO_BHA = 49 +pkg syscall (freebsd-386), const IPPROTO_BLT = 30 +pkg syscall (freebsd-386), const IPPROTO_BRSATMON = 76 +pkg syscall (freebsd-386), const IPPROTO_CARP = 112 +pkg syscall (freebsd-386), const IPPROTO_CFTP = 62 +pkg syscall (freebsd-386), const IPPROTO_CHAOS = 16 +pkg syscall (freebsd-386), const IPPROTO_CMTP = 38 +pkg syscall (freebsd-386), const IPPROTO_CPHB = 73 +pkg syscall (freebsd-386), const IPPROTO_CPNX = 72 +pkg syscall (freebsd-386), const IPPROTO_DDP = 37 +pkg syscall (freebsd-386), const IPPROTO_DGP = 86 +pkg syscall (freebsd-386), const IPPROTO_DIVERT = 258 +pkg syscall (freebsd-386), const IPPROTO_DONE = 257 +pkg syscall (freebsd-386), const IPPROTO_DSTOPTS = 60 +pkg syscall (freebsd-386), const IPPROTO_EGP = 8 +pkg syscall (freebsd-386), const IPPROTO_EMCON = 14 +pkg syscall (freebsd-386), const IPPROTO_ENCAP = 98 +pkg syscall (freebsd-386), const IPPROTO_EON = 80 +pkg syscall (freebsd-386), const IPPROTO_ESP = 50 +pkg syscall (freebsd-386), const IPPROTO_ETHERIP = 97 +pkg syscall (freebsd-386), const IPPROTO_FRAGMENT = 44 +pkg syscall (freebsd-386), const IPPROTO_GGP = 3 +pkg syscall (freebsd-386), const IPPROTO_GMTP = 100 +pkg syscall (freebsd-386), const IPPROTO_GRE = 47 +pkg syscall (freebsd-386), const IPPROTO_HELLO = 63 +pkg syscall (freebsd-386), const IPPROTO_HMP = 20 +pkg syscall (freebsd-386), const IPPROTO_HOPOPTS = 0 +pkg syscall (freebsd-386), const IPPROTO_ICMP = 1 +pkg syscall (freebsd-386), const IPPROTO_ICMPV6 = 58 +pkg syscall (freebsd-386), const IPPROTO_IDP = 22 +pkg syscall (freebsd-386), const IPPROTO_IDPR = 35 +pkg syscall (freebsd-386), const IPPROTO_IDRP = 45 +pkg syscall (freebsd-386), const IPPROTO_IGMP = 2 +pkg syscall (freebsd-386), const IPPROTO_IGP = 85 +pkg syscall (freebsd-386), const IPPROTO_IGRP = 88 +pkg syscall (freebsd-386), const IPPROTO_IL = 40 +pkg syscall (freebsd-386), const IPPROTO_INLSP = 52 +pkg syscall (freebsd-386), const IPPROTO_INP = 32 +pkg syscall (freebsd-386), const IPPROTO_IPCOMP = 108 +pkg syscall (freebsd-386), const IPPROTO_IPCV = 71 +pkg syscall (freebsd-386), const IPPROTO_IPEIP = 94 +pkg syscall (freebsd-386), const IPPROTO_IPIP = 4 +pkg syscall (freebsd-386), const IPPROTO_IPPC = 67 +pkg syscall (freebsd-386), const IPPROTO_IPV4 = 4 +pkg syscall (freebsd-386), const IPPROTO_IRTP = 28 +pkg syscall (freebsd-386), const IPPROTO_KRYPTOLAN = 65 +pkg syscall (freebsd-386), const IPPROTO_LARP = 91 +pkg syscall (freebsd-386), const IPPROTO_LEAF1 = 25 +pkg syscall (freebsd-386), const IPPROTO_LEAF2 = 26 +pkg syscall (freebsd-386), const IPPROTO_MAX = 256 +pkg syscall (freebsd-386), const IPPROTO_MAXID = 52 +pkg syscall (freebsd-386), const IPPROTO_MEAS = 19 +pkg syscall (freebsd-386), const IPPROTO_MH = 135 +pkg syscall (freebsd-386), const IPPROTO_MH ideal-int +pkg syscall (freebsd-386), const IPPROTO_MHRP = 48 +pkg syscall (freebsd-386), const IPPROTO_MICP = 95 +pkg syscall (freebsd-386), const IPPROTO_MOBILE = 55 +pkg syscall (freebsd-386), const IPPROTO_MTP = 92 +pkg syscall (freebsd-386), const IPPROTO_MUX = 18 +pkg syscall (freebsd-386), const IPPROTO_ND = 77 +pkg syscall (freebsd-386), const IPPROTO_NHRP = 54 +pkg syscall (freebsd-386), const IPPROTO_NONE = 59 +pkg syscall (freebsd-386), const IPPROTO_NSP = 31 +pkg syscall (freebsd-386), const IPPROTO_NVPII = 11 +pkg syscall (freebsd-386), const IPPROTO_OLD_DIVERT = 254 +pkg syscall (freebsd-386), const IPPROTO_OSPFIGP = 89 +pkg syscall (freebsd-386), const IPPROTO_PFSYNC = 240 +pkg syscall (freebsd-386), const IPPROTO_PGM = 113 +pkg syscall (freebsd-386), const IPPROTO_PIGP = 9 +pkg syscall (freebsd-386), const IPPROTO_PIM = 103 +pkg syscall (freebsd-386), const IPPROTO_PRM = 21 +pkg syscall (freebsd-386), const IPPROTO_PUP = 12 +pkg syscall (freebsd-386), const IPPROTO_PVP = 75 +pkg syscall (freebsd-386), const IPPROTO_RAW = 255 +pkg syscall (freebsd-386), const IPPROTO_RCCMON = 10 +pkg syscall (freebsd-386), const IPPROTO_RDP = 27 +pkg syscall (freebsd-386), const IPPROTO_ROUTING = 43 +pkg syscall (freebsd-386), const IPPROTO_RSVP = 46 +pkg syscall (freebsd-386), const IPPROTO_RVD = 66 +pkg syscall (freebsd-386), const IPPROTO_SATEXPAK = 64 +pkg syscall (freebsd-386), const IPPROTO_SATMON = 69 +pkg syscall (freebsd-386), const IPPROTO_SCCSP = 96 +pkg syscall (freebsd-386), const IPPROTO_SCTP = 132 +pkg syscall (freebsd-386), const IPPROTO_SDRP = 42 +pkg syscall (freebsd-386), const IPPROTO_SEND = 259 +pkg syscall (freebsd-386), const IPPROTO_SEND ideal-int +pkg syscall (freebsd-386), const IPPROTO_SEP = 33 +pkg syscall (freebsd-386), const IPPROTO_SKIP = 57 +pkg syscall (freebsd-386), const IPPROTO_SPACER = 32767 +pkg syscall (freebsd-386), const IPPROTO_SRPC = 90 +pkg syscall (freebsd-386), const IPPROTO_ST = 7 +pkg syscall (freebsd-386), const IPPROTO_SVMTP = 82 +pkg syscall (freebsd-386), const IPPROTO_SWIPE = 53 +pkg syscall (freebsd-386), const IPPROTO_TCF = 87 +pkg syscall (freebsd-386), const IPPROTO_TLSP = 56 +pkg syscall (freebsd-386), const IPPROTO_TP = 29 +pkg syscall (freebsd-386), const IPPROTO_TPXX = 39 +pkg syscall (freebsd-386), const IPPROTO_TRUNK1 = 23 +pkg syscall (freebsd-386), const IPPROTO_TRUNK2 = 24 +pkg syscall (freebsd-386), const IPPROTO_TTP = 84 +pkg syscall (freebsd-386), const IPPROTO_VINES = 83 +pkg syscall (freebsd-386), const IPPROTO_VISA = 70 +pkg syscall (freebsd-386), const IPPROTO_VMTP = 81 +pkg syscall (freebsd-386), const IPPROTO_WBEXPAK = 79 +pkg syscall (freebsd-386), const IPPROTO_WBMON = 78 +pkg syscall (freebsd-386), const IPPROTO_WSN = 74 +pkg syscall (freebsd-386), const IPPROTO_XNET = 15 +pkg syscall (freebsd-386), const IPPROTO_XTP = 36 +pkg syscall (freebsd-386), const IPV6_AUTOFLOWLABEL = 59 +pkg syscall (freebsd-386), const IPV6_BINDANY = 64 +pkg syscall (freebsd-386), const IPV6_BINDV6ONLY = 27 +pkg syscall (freebsd-386), const IPV6_CHECKSUM = 26 +pkg syscall (freebsd-386), const IPV6_DEFAULT_MULTICAST_HOPS = 1 +pkg syscall (freebsd-386), const IPV6_DEFAULT_MULTICAST_LOOP = 1 +pkg syscall (freebsd-386), const IPV6_DEFHLIM = 64 +pkg syscall (freebsd-386), const IPV6_DONTFRAG = 62 +pkg syscall (freebsd-386), const IPV6_DSTOPTS = 50 +pkg syscall (freebsd-386), const IPV6_FAITH = 29 +pkg syscall (freebsd-386), const IPV6_FLOWINFO_MASK = 4294967055 +pkg syscall (freebsd-386), const IPV6_FLOWLABEL_MASK = 4294905600 +pkg syscall (freebsd-386), const IPV6_FRAGTTL = 120 +pkg syscall (freebsd-386), const IPV6_FW_ADD = 30 +pkg syscall (freebsd-386), const IPV6_FW_DEL = 31 +pkg syscall (freebsd-386), const IPV6_FW_FLUSH = 32 +pkg syscall (freebsd-386), const IPV6_FW_GET = 34 +pkg syscall (freebsd-386), const IPV6_FW_ZERO = 33 +pkg syscall (freebsd-386), const IPV6_HLIMDEC = 1 +pkg syscall (freebsd-386), const IPV6_HOPLIMIT = 47 +pkg syscall (freebsd-386), const IPV6_HOPOPTS = 49 +pkg syscall (freebsd-386), const IPV6_IPSEC_POLICY = 28 +pkg syscall (freebsd-386), const IPV6_JOIN_GROUP = 12 +pkg syscall (freebsd-386), const IPV6_LEAVE_GROUP = 13 +pkg syscall (freebsd-386), const IPV6_MAXHLIM = 255 +pkg syscall (freebsd-386), const IPV6_MAXOPTHDR = 2048 +pkg syscall (freebsd-386), const IPV6_MAXPACKET = 65535 +pkg syscall (freebsd-386), const IPV6_MAX_GROUP_SRC_FILTER = 512 +pkg syscall (freebsd-386), const IPV6_MAX_MEMBERSHIPS = 4095 +pkg syscall (freebsd-386), const IPV6_MAX_SOCK_SRC_FILTER = 128 +pkg syscall (freebsd-386), const IPV6_MIN_MEMBERSHIPS = 31 +pkg syscall (freebsd-386), const IPV6_MMTU = 1280 +pkg syscall (freebsd-386), const IPV6_MSFILTER = 74 +pkg syscall (freebsd-386), const IPV6_MULTICAST_HOPS = 10 +pkg syscall (freebsd-386), const IPV6_MULTICAST_IF = 9 +pkg syscall (freebsd-386), const IPV6_MULTICAST_LOOP = 11 +pkg syscall (freebsd-386), const IPV6_NEXTHOP = 48 +pkg syscall (freebsd-386), const IPV6_PATHMTU = 44 +pkg syscall (freebsd-386), const IPV6_PKTINFO = 46 +pkg syscall (freebsd-386), const IPV6_PORTRANGE = 14 +pkg syscall (freebsd-386), const IPV6_PORTRANGE_DEFAULT = 0 +pkg syscall (freebsd-386), const IPV6_PORTRANGE_HIGH = 1 +pkg syscall (freebsd-386), const IPV6_PORTRANGE_LOW = 2 +pkg syscall (freebsd-386), const IPV6_PREFER_TEMPADDR = 63 +pkg syscall (freebsd-386), const IPV6_RECVDSTOPTS = 40 +pkg syscall (freebsd-386), const IPV6_RECVHOPLIMIT = 37 +pkg syscall (freebsd-386), const IPV6_RECVHOPOPTS = 39 +pkg syscall (freebsd-386), const IPV6_RECVPATHMTU = 43 +pkg syscall (freebsd-386), const IPV6_RECVPKTINFO = 36 +pkg syscall (freebsd-386), const IPV6_RECVRTHDR = 38 +pkg syscall (freebsd-386), const IPV6_RECVTCLASS = 57 +pkg syscall (freebsd-386), const IPV6_RTHDR = 51 +pkg syscall (freebsd-386), const IPV6_RTHDRDSTOPTS = 35 +pkg syscall (freebsd-386), const IPV6_RTHDR_LOOSE = 0 +pkg syscall (freebsd-386), const IPV6_RTHDR_STRICT = 1 +pkg syscall (freebsd-386), const IPV6_RTHDR_TYPE_0 = 0 +pkg syscall (freebsd-386), const IPV6_SOCKOPT_RESERVED1 = 3 +pkg syscall (freebsd-386), const IPV6_TCLASS = 61 +pkg syscall (freebsd-386), const IPV6_UNICAST_HOPS = 4 +pkg syscall (freebsd-386), const IPV6_USE_MIN_MTU = 42 +pkg syscall (freebsd-386), const IPV6_V6ONLY = 27 +pkg syscall (freebsd-386), const IPV6_VERSION = 96 +pkg syscall (freebsd-386), const IPV6_VERSION_MASK = 240 +pkg syscall (freebsd-386), const IP_ADD_MEMBERSHIP = 12 +pkg syscall (freebsd-386), const IP_ADD_SOURCE_MEMBERSHIP = 70 +pkg syscall (freebsd-386), const IP_BINDANY = 24 +pkg syscall (freebsd-386), const IP_BLOCK_SOURCE = 72 +pkg syscall (freebsd-386), const IP_DEFAULT_MULTICAST_LOOP = 1 +pkg syscall (freebsd-386), const IP_DEFAULT_MULTICAST_TTL = 1 +pkg syscall (freebsd-386), const IP_DF = 16384 +pkg syscall (freebsd-386), const IP_DONTFRAG = 67 +pkg syscall (freebsd-386), const IP_DROP_MEMBERSHIP = 13 +pkg syscall (freebsd-386), const IP_DROP_SOURCE_MEMBERSHIP = 71 +pkg syscall (freebsd-386), const IP_DUMMYNET3 = 49 +pkg syscall (freebsd-386), const IP_DUMMYNET_CONFIGURE = 60 +pkg syscall (freebsd-386), const IP_DUMMYNET_DEL = 61 +pkg syscall (freebsd-386), const IP_DUMMYNET_FLUSH = 62 +pkg syscall (freebsd-386), const IP_DUMMYNET_GET = 64 +pkg syscall (freebsd-386), const IP_FAITH = 22 +pkg syscall (freebsd-386), const IP_FW3 = 48 +pkg syscall (freebsd-386), const IP_FW_ADD = 50 +pkg syscall (freebsd-386), const IP_FW_DEL = 51 +pkg syscall (freebsd-386), const IP_FW_FLUSH = 52 +pkg syscall (freebsd-386), const IP_FW_GET = 54 +pkg syscall (freebsd-386), const IP_FW_NAT_CFG = 56 +pkg syscall (freebsd-386), const IP_FW_NAT_DEL = 57 +pkg syscall (freebsd-386), const IP_FW_NAT_GET_CONFIG = 58 +pkg syscall (freebsd-386), const IP_FW_NAT_GET_LOG = 59 +pkg syscall (freebsd-386), const IP_FW_RESETLOG = 55 +pkg syscall (freebsd-386), const IP_FW_TABLE_ADD = 40 +pkg syscall (freebsd-386), const IP_FW_TABLE_DEL = 41 +pkg syscall (freebsd-386), const IP_FW_TABLE_FLUSH = 42 +pkg syscall (freebsd-386), const IP_FW_TABLE_GETSIZE = 43 +pkg syscall (freebsd-386), const IP_FW_TABLE_LIST = 44 +pkg syscall (freebsd-386), const IP_FW_ZERO = 53 +pkg syscall (freebsd-386), const IP_HDRINCL = 2 +pkg syscall (freebsd-386), const IP_IPSEC_POLICY = 21 +pkg syscall (freebsd-386), const IP_MAXPACKET = 65535 +pkg syscall (freebsd-386), const IP_MAX_GROUP_SRC_FILTER = 512 +pkg syscall (freebsd-386), const IP_MAX_MEMBERSHIPS = 4095 +pkg syscall (freebsd-386), const IP_MAX_SOCK_MUTE_FILTER = 128 +pkg syscall (freebsd-386), const IP_MAX_SOCK_SRC_FILTER = 128 +pkg syscall (freebsd-386), const IP_MAX_SOURCE_FILTER = 1024 +pkg syscall (freebsd-386), const IP_MF = 8192 +pkg syscall (freebsd-386), const IP_MINTTL = 66 +pkg syscall (freebsd-386), const IP_MIN_MEMBERSHIPS = 31 +pkg syscall (freebsd-386), const IP_MSFILTER = 74 +pkg syscall (freebsd-386), const IP_MSS = 576 +pkg syscall (freebsd-386), const IP_MULTICAST_IF = 9 +pkg syscall (freebsd-386), const IP_MULTICAST_LOOP = 11 +pkg syscall (freebsd-386), const IP_MULTICAST_TTL = 10 +pkg syscall (freebsd-386), const IP_MULTICAST_VIF = 14 +pkg syscall (freebsd-386), const IP_OFFMASK = 8191 +pkg syscall (freebsd-386), const IP_ONESBCAST = 23 +pkg syscall (freebsd-386), const IP_OPTIONS = 1 +pkg syscall (freebsd-386), const IP_PORTRANGE = 19 +pkg syscall (freebsd-386), const IP_PORTRANGE_DEFAULT = 0 +pkg syscall (freebsd-386), const IP_PORTRANGE_HIGH = 1 +pkg syscall (freebsd-386), const IP_PORTRANGE_LOW = 2 +pkg syscall (freebsd-386), const IP_RECVDSTADDR = 7 +pkg syscall (freebsd-386), const IP_RECVIF = 20 +pkg syscall (freebsd-386), const IP_RECVOPTS = 5 +pkg syscall (freebsd-386), const IP_RECVRETOPTS = 6 +pkg syscall (freebsd-386), const IP_RECVTOS = 68 +pkg syscall (freebsd-386), const IP_RECVTOS ideal-int +pkg syscall (freebsd-386), const IP_RECVTTL = 65 +pkg syscall (freebsd-386), const IP_RETOPTS = 8 +pkg syscall (freebsd-386), const IP_RF = 32768 +pkg syscall (freebsd-386), const IP_RSVP_OFF = 16 +pkg syscall (freebsd-386), const IP_RSVP_ON = 15 +pkg syscall (freebsd-386), const IP_RSVP_VIF_OFF = 18 +pkg syscall (freebsd-386), const IP_RSVP_VIF_ON = 17 +pkg syscall (freebsd-386), const IP_SENDSRCADDR = 7 +pkg syscall (freebsd-386), const IP_TOS = 3 +pkg syscall (freebsd-386), const IP_TTL = 4 +pkg syscall (freebsd-386), const IP_UNBLOCK_SOURCE = 73 +pkg syscall (freebsd-386), const ISIG = 128 +pkg syscall (freebsd-386), const ISIG ideal-int +pkg syscall (freebsd-386), const ISTRIP = 32 +pkg syscall (freebsd-386), const ISTRIP ideal-int +pkg syscall (freebsd-386), const IXANY = 2048 +pkg syscall (freebsd-386), const IXANY ideal-int +pkg syscall (freebsd-386), const IXOFF = 1024 +pkg syscall (freebsd-386), const IXOFF ideal-int +pkg syscall (freebsd-386), const IXON = 512 +pkg syscall (freebsd-386), const IXON ideal-int +pkg syscall (freebsd-386), const ImplementsGetwd = false +pkg syscall (freebsd-386), const LOCK_EX = 2 +pkg syscall (freebsd-386), const LOCK_NB = 4 +pkg syscall (freebsd-386), const LOCK_SH = 1 +pkg syscall (freebsd-386), const LOCK_UN = 8 +pkg syscall (freebsd-386), const MADV_AUTOSYNC = 7 +pkg syscall (freebsd-386), const MADV_AUTOSYNC ideal-int +pkg syscall (freebsd-386), const MADV_CORE = 9 +pkg syscall (freebsd-386), const MADV_CORE ideal-int +pkg syscall (freebsd-386), const MADV_DONTNEED = 4 +pkg syscall (freebsd-386), const MADV_DONTNEED ideal-int +pkg syscall (freebsd-386), const MADV_FREE = 5 +pkg syscall (freebsd-386), const MADV_FREE ideal-int +pkg syscall (freebsd-386), const MADV_NOCORE = 8 +pkg syscall (freebsd-386), const MADV_NOCORE ideal-int +pkg syscall (freebsd-386), const MADV_NORMAL = 0 +pkg syscall (freebsd-386), const MADV_NORMAL ideal-int +pkg syscall (freebsd-386), const MADV_NOSYNC = 6 +pkg syscall (freebsd-386), const MADV_NOSYNC ideal-int +pkg syscall (freebsd-386), const MADV_PROTECT = 10 +pkg syscall (freebsd-386), const MADV_PROTECT ideal-int +pkg syscall (freebsd-386), const MADV_RANDOM = 1 +pkg syscall (freebsd-386), const MADV_RANDOM ideal-int +pkg syscall (freebsd-386), const MADV_SEQUENTIAL = 2 +pkg syscall (freebsd-386), const MADV_SEQUENTIAL ideal-int +pkg syscall (freebsd-386), const MADV_WILLNEED = 3 +pkg syscall (freebsd-386), const MADV_WILLNEED ideal-int +pkg syscall (freebsd-386), const MAP_ANON = 4096 +pkg syscall (freebsd-386), const MAP_ANON ideal-int +pkg syscall (freebsd-386), const MAP_ANONYMOUS = 4096 +pkg syscall (freebsd-386), const MAP_ANONYMOUS ideal-int +pkg syscall (freebsd-386), const MAP_COPY = 2 +pkg syscall (freebsd-386), const MAP_COPY ideal-int +pkg syscall (freebsd-386), const MAP_FILE = 0 +pkg syscall (freebsd-386), const MAP_FILE ideal-int +pkg syscall (freebsd-386), const MAP_FIXED = 16 +pkg syscall (freebsd-386), const MAP_FIXED ideal-int +pkg syscall (freebsd-386), const MAP_HASSEMAPHORE = 512 +pkg syscall (freebsd-386), const MAP_HASSEMAPHORE ideal-int +pkg syscall (freebsd-386), const MAP_NOCORE = 131072 +pkg syscall (freebsd-386), const MAP_NOCORE ideal-int +pkg syscall (freebsd-386), const MAP_NORESERVE = 64 +pkg syscall (freebsd-386), const MAP_NORESERVE ideal-int +pkg syscall (freebsd-386), const MAP_NOSYNC = 2048 +pkg syscall (freebsd-386), const MAP_NOSYNC ideal-int +pkg syscall (freebsd-386), const MAP_PREFAULT_READ = 262144 +pkg syscall (freebsd-386), const MAP_PREFAULT_READ ideal-int +pkg syscall (freebsd-386), const MAP_PRIVATE = 2 +pkg syscall (freebsd-386), const MAP_PRIVATE ideal-int +pkg syscall (freebsd-386), const MAP_RENAME = 32 +pkg syscall (freebsd-386), const MAP_RENAME ideal-int +pkg syscall (freebsd-386), const MAP_RESERVED0080 = 128 +pkg syscall (freebsd-386), const MAP_RESERVED0080 ideal-int +pkg syscall (freebsd-386), const MAP_RESERVED0100 = 256 +pkg syscall (freebsd-386), const MAP_RESERVED0100 ideal-int +pkg syscall (freebsd-386), const MAP_SHARED = 1 +pkg syscall (freebsd-386), const MAP_SHARED ideal-int +pkg syscall (freebsd-386), const MAP_STACK = 1024 +pkg syscall (freebsd-386), const MAP_STACK ideal-int +pkg syscall (freebsd-386), const MCL_CURRENT = 1 +pkg syscall (freebsd-386), const MCL_CURRENT ideal-int +pkg syscall (freebsd-386), const MCL_FUTURE = 2 +pkg syscall (freebsd-386), const MCL_FUTURE ideal-int +pkg syscall (freebsd-386), const MSG_COMPAT = 32768 +pkg syscall (freebsd-386), const MSG_CTRUNC = 32 +pkg syscall (freebsd-386), const MSG_DONTROUTE = 4 +pkg syscall (freebsd-386), const MSG_DONTWAIT = 128 +pkg syscall (freebsd-386), const MSG_EOF = 256 +pkg syscall (freebsd-386), const MSG_EOR = 8 +pkg syscall (freebsd-386), const MSG_NBIO = 16384 +pkg syscall (freebsd-386), const MSG_NOSIGNAL = 131072 +pkg syscall (freebsd-386), const MSG_NOTIFICATION = 8192 +pkg syscall (freebsd-386), const MSG_OOB = 1 +pkg syscall (freebsd-386), const MSG_PEEK = 2 +pkg syscall (freebsd-386), const MSG_TRUNC = 16 +pkg syscall (freebsd-386), const MSG_WAITALL = 64 +pkg syscall (freebsd-386), const MS_ASYNC = 1 +pkg syscall (freebsd-386), const MS_ASYNC ideal-int +pkg syscall (freebsd-386), const MS_INVALIDATE = 2 +pkg syscall (freebsd-386), const MS_INVALIDATE ideal-int +pkg syscall (freebsd-386), const MS_SYNC = 0 +pkg syscall (freebsd-386), const MS_SYNC ideal-int +pkg syscall (freebsd-386), const NET_RT_DUMP = 1 +pkg syscall (freebsd-386), const NET_RT_FLAGS = 2 +pkg syscall (freebsd-386), const NET_RT_IFLIST = 3 +pkg syscall (freebsd-386), const NET_RT_IFLISTL = 5 +pkg syscall (freebsd-386), const NET_RT_IFLISTL ideal-int +pkg syscall (freebsd-386), const NET_RT_IFMALIST = 4 +pkg syscall (freebsd-386), const NET_RT_MAXID = 6 +pkg syscall (freebsd-386), const NOFLSH = 2147483648 +pkg syscall (freebsd-386), const NOFLSH ideal-int +pkg syscall (freebsd-386), const NOTE_ATTRIB = 8 +pkg syscall (freebsd-386), const NOTE_CHILD = 4 +pkg syscall (freebsd-386), const NOTE_DELETE = 1 +pkg syscall (freebsd-386), const NOTE_EXEC = 536870912 +pkg syscall (freebsd-386), const NOTE_EXIT = 2147483648 +pkg syscall (freebsd-386), const NOTE_EXTEND = 4 +pkg syscall (freebsd-386), const NOTE_FFAND = 1073741824 +pkg syscall (freebsd-386), const NOTE_FFCOPY = 3221225472 +pkg syscall (freebsd-386), const NOTE_FFCTRLMASK = 3221225472 +pkg syscall (freebsd-386), const NOTE_FFLAGSMASK = 16777215 +pkg syscall (freebsd-386), const NOTE_FFNOP = 0 +pkg syscall (freebsd-386), const NOTE_FFOR = 2147483648 +pkg syscall (freebsd-386), const NOTE_FORK = 1073741824 +pkg syscall (freebsd-386), const NOTE_LINK = 16 +pkg syscall (freebsd-386), const NOTE_LOWAT = 1 +pkg syscall (freebsd-386), const NOTE_PCTRLMASK = 4026531840 +pkg syscall (freebsd-386), const NOTE_PDATAMASK = 1048575 +pkg syscall (freebsd-386), const NOTE_RENAME = 32 +pkg syscall (freebsd-386), const NOTE_REVOKE = 64 +pkg syscall (freebsd-386), const NOTE_TRACK = 1 +pkg syscall (freebsd-386), const NOTE_TRACKERR = 2 +pkg syscall (freebsd-386), const NOTE_TRIGGER = 16777216 +pkg syscall (freebsd-386), const NOTE_WRITE = 2 +pkg syscall (freebsd-386), const OCRNL = 16 +pkg syscall (freebsd-386), const OCRNL ideal-int +pkg syscall (freebsd-386), const ONLCR = 2 +pkg syscall (freebsd-386), const ONLCR ideal-int +pkg syscall (freebsd-386), const ONLRET = 64 +pkg syscall (freebsd-386), const ONLRET ideal-int +pkg syscall (freebsd-386), const ONOCR = 32 +pkg syscall (freebsd-386), const ONOCR ideal-int +pkg syscall (freebsd-386), const ONOEOT = 8 +pkg syscall (freebsd-386), const ONOEOT ideal-int +pkg syscall (freebsd-386), const OPOST = 1 +pkg syscall (freebsd-386), const OPOST ideal-int +pkg syscall (freebsd-386), const O_ACCMODE = 3 +pkg syscall (freebsd-386), const O_APPEND = 8 +pkg syscall (freebsd-386), const O_ASYNC = 64 +pkg syscall (freebsd-386), const O_CLOEXEC = 0 +pkg syscall (freebsd-386), const O_CREAT = 512 +pkg syscall (freebsd-386), const O_DIRECT = 65536 +pkg syscall (freebsd-386), const O_DIRECTORY = 131072 +pkg syscall (freebsd-386), const O_EXCL = 2048 +pkg syscall (freebsd-386), const O_EXEC = 262144 +pkg syscall (freebsd-386), const O_EXLOCK = 32 +pkg syscall (freebsd-386), const O_FSYNC = 128 +pkg syscall (freebsd-386), const O_NDELAY = 4 +pkg syscall (freebsd-386), const O_NOCTTY = 32768 +pkg syscall (freebsd-386), const O_NOFOLLOW = 256 +pkg syscall (freebsd-386), const O_NONBLOCK = 4 +pkg syscall (freebsd-386), const O_SHLOCK = 16 +pkg syscall (freebsd-386), const O_SYNC = 128 +pkg syscall (freebsd-386), const O_TRUNC = 1024 +pkg syscall (freebsd-386), const O_TTY_INIT = 524288 +pkg syscall (freebsd-386), const PARENB = 4096 +pkg syscall (freebsd-386), const PARENB ideal-int +pkg syscall (freebsd-386), const PARMRK = 8 +pkg syscall (freebsd-386), const PARMRK ideal-int +pkg syscall (freebsd-386), const PARODD = 8192 +pkg syscall (freebsd-386), const PARODD ideal-int +pkg syscall (freebsd-386), const PENDIN = 536870912 +pkg syscall (freebsd-386), const PENDIN ideal-int +pkg syscall (freebsd-386), const PROT_EXEC = 4 +pkg syscall (freebsd-386), const PROT_EXEC ideal-int +pkg syscall (freebsd-386), const PROT_NONE = 0 +pkg syscall (freebsd-386), const PROT_NONE ideal-int +pkg syscall (freebsd-386), const PROT_READ = 1 +pkg syscall (freebsd-386), const PROT_READ ideal-int +pkg syscall (freebsd-386), const PROT_WRITE = 2 +pkg syscall (freebsd-386), const PROT_WRITE ideal-int +pkg syscall (freebsd-386), const PTRACE_CONT = 7 +pkg syscall (freebsd-386), const PTRACE_KILL = 8 +pkg syscall (freebsd-386), const PTRACE_TRACEME = 0 +pkg syscall (freebsd-386), const RLIMIT_AS = 10 +pkg syscall (freebsd-386), const RLIMIT_CORE = 4 +pkg syscall (freebsd-386), const RLIMIT_CPU = 0 +pkg syscall (freebsd-386), const RLIMIT_DATA = 2 +pkg syscall (freebsd-386), const RLIMIT_FSIZE = 1 +pkg syscall (freebsd-386), const RLIMIT_NOFILE = 8 +pkg syscall (freebsd-386), const RLIMIT_STACK = 3 +pkg syscall (freebsd-386), const RLIM_INFINITY = 9223372036854775807 +pkg syscall (freebsd-386), const RTAX_AUTHOR = 6 +pkg syscall (freebsd-386), const RTAX_BRD = 7 +pkg syscall (freebsd-386), const RTAX_DST = 0 +pkg syscall (freebsd-386), const RTAX_GATEWAY = 1 +pkg syscall (freebsd-386), const RTAX_GENMASK = 3 +pkg syscall (freebsd-386), const RTAX_IFA = 5 +pkg syscall (freebsd-386), const RTAX_IFP = 4 +pkg syscall (freebsd-386), const RTAX_MAX = 8 +pkg syscall (freebsd-386), const RTAX_NETMASK = 2 +pkg syscall (freebsd-386), const RTA_AUTHOR = 64 +pkg syscall (freebsd-386), const RTA_BRD = 128 +pkg syscall (freebsd-386), const RTA_DST = 1 +pkg syscall (freebsd-386), const RTA_GATEWAY = 2 +pkg syscall (freebsd-386), const RTA_GENMASK = 8 +pkg syscall (freebsd-386), const RTA_IFA = 32 +pkg syscall (freebsd-386), const RTA_IFP = 16 +pkg syscall (freebsd-386), const RTA_NETMASK = 4 +pkg syscall (freebsd-386), const RTF_BLACKHOLE = 4096 +pkg syscall (freebsd-386), const RTF_BROADCAST = 4194304 +pkg syscall (freebsd-386), const RTF_DONE = 64 +pkg syscall (freebsd-386), const RTF_DYNAMIC = 16 +pkg syscall (freebsd-386), const RTF_FMASK = 268752904 +pkg syscall (freebsd-386), const RTF_GATEWAY = 2 +pkg syscall (freebsd-386), const RTF_HOST = 4 +pkg syscall (freebsd-386), const RTF_LLDATA = 1024 +pkg syscall (freebsd-386), const RTF_LLINFO = 1024 +pkg syscall (freebsd-386), const RTF_LOCAL = 2097152 +pkg syscall (freebsd-386), const RTF_MODIFIED = 32 +pkg syscall (freebsd-386), const RTF_MULTICAST = 8388608 +pkg syscall (freebsd-386), const RTF_PINNED = 1048576 +pkg syscall (freebsd-386), const RTF_PRCLONING = 65536 +pkg syscall (freebsd-386), const RTF_PROTO1 = 32768 +pkg syscall (freebsd-386), const RTF_PROTO2 = 16384 +pkg syscall (freebsd-386), const RTF_PROTO3 = 262144 +pkg syscall (freebsd-386), const RTF_REJECT = 8 +pkg syscall (freebsd-386), const RTF_RNH_LOCKED = 1073741824 +pkg syscall (freebsd-386), const RTF_STATIC = 2048 +pkg syscall (freebsd-386), const RTF_STICKY = 268435456 +pkg syscall (freebsd-386), const RTF_UP = 1 +pkg syscall (freebsd-386), const RTF_XRESOLVE = 512 +pkg syscall (freebsd-386), const RTM_ADD = 1 +pkg syscall (freebsd-386), const RTM_CHANGE = 3 +pkg syscall (freebsd-386), const RTM_DELADDR = 13 +pkg syscall (freebsd-386), const RTM_DELETE = 2 +pkg syscall (freebsd-386), const RTM_DELMADDR = 16 +pkg syscall (freebsd-386), const RTM_GET = 4 +pkg syscall (freebsd-386), const RTM_IEEE80211 = 18 +pkg syscall (freebsd-386), const RTM_IFANNOUNCE = 17 +pkg syscall (freebsd-386), const RTM_IFINFO = 14 +pkg syscall (freebsd-386), const RTM_LOCK = 8 +pkg syscall (freebsd-386), const RTM_LOSING = 5 +pkg syscall (freebsd-386), const RTM_MISS = 7 +pkg syscall (freebsd-386), const RTM_NEWADDR = 12 +pkg syscall (freebsd-386), const RTM_NEWMADDR = 15 +pkg syscall (freebsd-386), const RTM_OLDADD = 9 +pkg syscall (freebsd-386), const RTM_OLDDEL = 10 +pkg syscall (freebsd-386), const RTM_REDIRECT = 6 +pkg syscall (freebsd-386), const RTM_RESOLVE = 11 +pkg syscall (freebsd-386), const RTM_RTTUNIT = 1000000 +pkg syscall (freebsd-386), const RTM_VERSION = 5 +pkg syscall (freebsd-386), const RTV_EXPIRE = 4 +pkg syscall (freebsd-386), const RTV_HOPCOUNT = 2 +pkg syscall (freebsd-386), const RTV_MTU = 1 +pkg syscall (freebsd-386), const RTV_RPIPE = 8 +pkg syscall (freebsd-386), const RTV_RTT = 64 +pkg syscall (freebsd-386), const RTV_RTTVAR = 128 +pkg syscall (freebsd-386), const RTV_SPIPE = 16 +pkg syscall (freebsd-386), const RTV_SSTHRESH = 32 +pkg syscall (freebsd-386), const RTV_WEIGHT = 256 +pkg syscall (freebsd-386), const RT_CACHING_CONTEXT = 1 +pkg syscall (freebsd-386), const RT_CACHING_CONTEXT ideal-int +pkg syscall (freebsd-386), const RT_DEFAULT_FIB = 0 +pkg syscall (freebsd-386), const RT_DEFAULT_FIB ideal-int +pkg syscall (freebsd-386), const RUSAGE_CHILDREN = -1 +pkg syscall (freebsd-386), const RUSAGE_SELF = 0 +pkg syscall (freebsd-386), const RUSAGE_THREAD = 1 +pkg syscall (freebsd-386), const SCM_BINTIME = 4 +pkg syscall (freebsd-386), const SCM_CREDS = 3 +pkg syscall (freebsd-386), const SCM_RIGHTS = 1 +pkg syscall (freebsd-386), const SCM_TIMESTAMP = 2 +pkg syscall (freebsd-386), const SIGBUS = 10 +pkg syscall (freebsd-386), const SIGCHLD = 20 +pkg syscall (freebsd-386), const SIGCONT = 19 +pkg syscall (freebsd-386), const SIGEMT = 7 +pkg syscall (freebsd-386), const SIGINFO = 29 +pkg syscall (freebsd-386), const SIGIO = 23 +pkg syscall (freebsd-386), const SIGIOT = 6 +pkg syscall (freebsd-386), const SIGLWP = 32 +pkg syscall (freebsd-386), const SIGPROF = 27 +pkg syscall (freebsd-386), const SIGSTOP = 17 +pkg syscall (freebsd-386), const SIGSYS = 12 +pkg syscall (freebsd-386), const SIGTHR = 32 +pkg syscall (freebsd-386), const SIGTSTP = 18 +pkg syscall (freebsd-386), const SIGTTIN = 21 +pkg syscall (freebsd-386), const SIGTTOU = 22 +pkg syscall (freebsd-386), const SIGURG = 16 +pkg syscall (freebsd-386), const SIGUSR1 = 30 +pkg syscall (freebsd-386), const SIGUSR2 = 31 +pkg syscall (freebsd-386), const SIGVTALRM = 26 +pkg syscall (freebsd-386), const SIGWINCH = 28 +pkg syscall (freebsd-386), const SIGXCPU = 24 +pkg syscall (freebsd-386), const SIGXFSZ = 25 +pkg syscall (freebsd-386), const SIOCADDMULTI = 2149607729 +pkg syscall (freebsd-386), const SIOCADDRT = 2150658570 +pkg syscall (freebsd-386), const SIOCAIFADDR = 2151704858 +pkg syscall (freebsd-386), const SIOCAIFGROUP = 2149869959 +pkg syscall (freebsd-386), const SIOCALIFADDR = 2165860635 +pkg syscall (freebsd-386), const SIOCATMARK = 1074033415 +pkg syscall (freebsd-386), const SIOCDELMULTI = 2149607730 +pkg syscall (freebsd-386), const SIOCDELRT = 2150658571 +pkg syscall (freebsd-386), const SIOCDIFADDR = 2149607705 +pkg syscall (freebsd-386), const SIOCDIFGROUP = 2149869961 +pkg syscall (freebsd-386), const SIOCDIFPHYADDR = 2149607753 +pkg syscall (freebsd-386), const SIOCDLIFADDR = 2165860637 +pkg syscall (freebsd-386), const SIOCGDRVSPEC = 3223087483 +pkg syscall (freebsd-386), const SIOCGETSGCNT = 3222565392 +pkg syscall (freebsd-386), const SIOCGETVIFCNT = 3222565391 +pkg syscall (freebsd-386), const SIOCGHIWAT = 1074033409 +pkg syscall (freebsd-386), const SIOCGIFADDR = 3223349537 +pkg syscall (freebsd-386), const SIOCGIFBRDADDR = 3223349539 +pkg syscall (freebsd-386), const SIOCGIFCAP = 3223349535 +pkg syscall (freebsd-386), const SIOCGIFCONF = 3221776676 +pkg syscall (freebsd-386), const SIOCGIFDESCR = 3223349546 +pkg syscall (freebsd-386), const SIOCGIFDSTADDR = 3223349538 +pkg syscall (freebsd-386), const SIOCGIFFIB = 3223349596 +pkg syscall (freebsd-386), const SIOCGIFFIB ideal-int +pkg syscall (freebsd-386), const SIOCGIFFLAGS = 3223349521 +pkg syscall (freebsd-386), const SIOCGIFGENERIC = 3223349562 +pkg syscall (freebsd-386), const SIOCGIFGMEMB = 3223611786 +pkg syscall (freebsd-386), const SIOCGIFGROUP = 3223611784 +pkg syscall (freebsd-386), const SIOCGIFINDEX = 3223349536 +pkg syscall (freebsd-386), const SIOCGIFMAC = 3223349542 +pkg syscall (freebsd-386), const SIOCGIFMEDIA = 3223873848 +pkg syscall (freebsd-386), const SIOCGIFMETRIC = 3223349527 +pkg syscall (freebsd-386), const SIOCGIFMTU = 3223349555 +pkg syscall (freebsd-386), const SIOCGIFNETMASK = 3223349541 +pkg syscall (freebsd-386), const SIOCGIFPDSTADDR = 3223349576 +pkg syscall (freebsd-386), const SIOCGIFPHYS = 3223349557 +pkg syscall (freebsd-386), const SIOCGIFPSRCADDR = 3223349575 +pkg syscall (freebsd-386), const SIOCGIFSTATUS = 3274795323 +pkg syscall (freebsd-386), const SIOCGLIFADDR = 3239602460 +pkg syscall (freebsd-386), const SIOCGLIFPHYADDR = 3239602507 +pkg syscall (freebsd-386), const SIOCGLOWAT = 1074033411 +pkg syscall (freebsd-386), const SIOCGPGRP = 1074033417 +pkg syscall (freebsd-386), const SIOCGPRIVATE_0 = 3223349584 +pkg syscall (freebsd-386), const SIOCGPRIVATE_1 = 3223349585 +pkg syscall (freebsd-386), const SIOCIFCREATE = 3223349626 +pkg syscall (freebsd-386), const SIOCIFCREATE2 = 3223349628 +pkg syscall (freebsd-386), const SIOCIFDESTROY = 2149607801 +pkg syscall (freebsd-386), const SIOCIFGCLONERS = 3222038904 +pkg syscall (freebsd-386), const SIOCSDRVSPEC = 2149345659 +pkg syscall (freebsd-386), const SIOCSHIWAT = 2147775232 +pkg syscall (freebsd-386), const SIOCSIFADDR = 2149607692 +pkg syscall (freebsd-386), const SIOCSIFBRDADDR = 2149607699 +pkg syscall (freebsd-386), const SIOCSIFCAP = 2149607710 +pkg syscall (freebsd-386), const SIOCSIFDESCR = 2149607721 +pkg syscall (freebsd-386), const SIOCSIFDSTADDR = 2149607694 +pkg syscall (freebsd-386), const SIOCSIFFIB = 2149607773 +pkg syscall (freebsd-386), const SIOCSIFFIB ideal-int +pkg syscall (freebsd-386), const SIOCSIFFLAGS = 2149607696 +pkg syscall (freebsd-386), const SIOCSIFGENERIC = 2149607737 +pkg syscall (freebsd-386), const SIOCSIFLLADDR = 2149607740 +pkg syscall (freebsd-386), const SIOCSIFMAC = 2149607719 +pkg syscall (freebsd-386), const SIOCSIFMEDIA = 3223349559 +pkg syscall (freebsd-386), const SIOCSIFMETRIC = 2149607704 +pkg syscall (freebsd-386), const SIOCSIFMTU = 2149607732 +pkg syscall (freebsd-386), const SIOCSIFNAME = 2149607720 +pkg syscall (freebsd-386), const SIOCSIFNETMASK = 2149607702 +pkg syscall (freebsd-386), const SIOCSIFPHYADDR = 2151704902 +pkg syscall (freebsd-386), const SIOCSIFPHYS = 2149607734 +pkg syscall (freebsd-386), const SIOCSIFRVNET = 3223349595 +pkg syscall (freebsd-386), const SIOCSIFVNET = 3223349594 +pkg syscall (freebsd-386), const SIOCSLIFPHYADDR = 2165860682 +pkg syscall (freebsd-386), const SIOCSLOWAT = 2147775234 +pkg syscall (freebsd-386), const SIOCSPGRP = 2147775240 +pkg syscall (freebsd-386), const SOCK_MAXADDRLEN = 255 +pkg syscall (freebsd-386), const SOCK_RDM = 4 +pkg syscall (freebsd-386), const SOL_SOCKET = 65535 +pkg syscall (freebsd-386), const SOMAXCONN = 128 +pkg syscall (freebsd-386), const SO_ACCEPTCONN = 2 +pkg syscall (freebsd-386), const SO_ACCEPTFILTER = 4096 +pkg syscall (freebsd-386), const SO_BINTIME = 8192 +pkg syscall (freebsd-386), const SO_BROADCAST = 32 +pkg syscall (freebsd-386), const SO_DEBUG = 1 +pkg syscall (freebsd-386), const SO_DONTROUTE = 16 +pkg syscall (freebsd-386), const SO_ERROR = 4103 +pkg syscall (freebsd-386), const SO_KEEPALIVE = 8 +pkg syscall (freebsd-386), const SO_LABEL = 4105 +pkg syscall (freebsd-386), const SO_LINGER = 128 +pkg syscall (freebsd-386), const SO_LISTENINCQLEN = 4115 +pkg syscall (freebsd-386), const SO_LISTENQLEN = 4114 +pkg syscall (freebsd-386), const SO_LISTENQLIMIT = 4113 +pkg syscall (freebsd-386), const SO_NOSIGPIPE = 2048 +pkg syscall (freebsd-386), const SO_NO_DDP = 32768 +pkg syscall (freebsd-386), const SO_NO_OFFLOAD = 16384 +pkg syscall (freebsd-386), const SO_OOBINLINE = 256 +pkg syscall (freebsd-386), const SO_PEERLABEL = 4112 +pkg syscall (freebsd-386), const SO_PROTOCOL = 4118 +pkg syscall (freebsd-386), const SO_PROTOCOL ideal-int +pkg syscall (freebsd-386), const SO_PROTOTYPE = 4118 +pkg syscall (freebsd-386), const SO_PROTOTYPE ideal-int +pkg syscall (freebsd-386), const SO_RCVBUF = 4098 +pkg syscall (freebsd-386), const SO_RCVLOWAT = 4100 +pkg syscall (freebsd-386), const SO_RCVTIMEO = 4102 +pkg syscall (freebsd-386), const SO_REUSEADDR = 4 +pkg syscall (freebsd-386), const SO_REUSEPORT = 512 +pkg syscall (freebsd-386), const SO_SETFIB = 4116 +pkg syscall (freebsd-386), const SO_SNDBUF = 4097 +pkg syscall (freebsd-386), const SO_SNDLOWAT = 4099 +pkg syscall (freebsd-386), const SO_SNDTIMEO = 4101 +pkg syscall (freebsd-386), const SO_TIMESTAMP = 1024 +pkg syscall (freebsd-386), const SO_TYPE = 4104 +pkg syscall (freebsd-386), const SO_USELOOPBACK = 64 +pkg syscall (freebsd-386), const SO_USER_COOKIE = 4117 +pkg syscall (freebsd-386), const SO_USER_COOKIE ideal-int +pkg syscall (freebsd-386), const SYS_ABORT2 = 463 +pkg syscall (freebsd-386), const SYS_ACCEPT = 30 +pkg syscall (freebsd-386), const SYS_ACCESS = 33 +pkg syscall (freebsd-386), const SYS_ACCT = 51 +pkg syscall (freebsd-386), const SYS_ADJTIME = 140 +pkg syscall (freebsd-386), const SYS_AUDIT = 445 +pkg syscall (freebsd-386), const SYS_AUDITCTL = 453 +pkg syscall (freebsd-386), const SYS_AUDITON = 446 +pkg syscall (freebsd-386), const SYS_BIND = 104 +pkg syscall (freebsd-386), const SYS_CAP_ENTER = 516 +pkg syscall (freebsd-386), const SYS_CAP_GETMODE = 517 +pkg syscall (freebsd-386), const SYS_CAP_GETRIGHTS = 515 +pkg syscall (freebsd-386), const SYS_CAP_NEW = 514 +pkg syscall (freebsd-386), const SYS_CHDIR = 12 +pkg syscall (freebsd-386), const SYS_CHFLAGS = 34 +pkg syscall (freebsd-386), const SYS_CHMOD = 15 +pkg syscall (freebsd-386), const SYS_CHOWN = 16 +pkg syscall (freebsd-386), const SYS_CHROOT = 61 +pkg syscall (freebsd-386), const SYS_CLOCK_GETCPUCLOCKID2 = 247 +pkg syscall (freebsd-386), const SYS_CLOCK_GETCPUCLOCKID2 ideal-int +pkg syscall (freebsd-386), const SYS_CLOCK_GETRES = 234 +pkg syscall (freebsd-386), const SYS_CLOCK_GETTIME = 232 +pkg syscall (freebsd-386), const SYS_CLOCK_SETTIME = 233 +pkg syscall (freebsd-386), const SYS_CLOSE = 6 +pkg syscall (freebsd-386), const SYS_CLOSEFROM = 509 +pkg syscall (freebsd-386), const SYS_CONNECT = 98 +pkg syscall (freebsd-386), const SYS_CPUSET = 484 +pkg syscall (freebsd-386), const SYS_CPUSET_GETAFFINITY = 487 +pkg syscall (freebsd-386), const SYS_CPUSET_GETID = 486 +pkg syscall (freebsd-386), const SYS_CPUSET_SETAFFINITY = 488 +pkg syscall (freebsd-386), const SYS_CPUSET_SETID = 485 +pkg syscall (freebsd-386), const SYS_DUP = 41 +pkg syscall (freebsd-386), const SYS_DUP2 = 90 +pkg syscall (freebsd-386), const SYS_EACCESS = 376 +pkg syscall (freebsd-386), const SYS_EXECVE = 59 +pkg syscall (freebsd-386), const SYS_EXIT = 1 +pkg syscall (freebsd-386), const SYS_EXTATTRCTL = 355 +pkg syscall (freebsd-386), const SYS_EXTATTR_DELETE_FD = 373 +pkg syscall (freebsd-386), const SYS_EXTATTR_DELETE_FILE = 358 +pkg syscall (freebsd-386), const SYS_EXTATTR_DELETE_LINK = 414 +pkg syscall (freebsd-386), const SYS_EXTATTR_GET_FD = 372 +pkg syscall (freebsd-386), const SYS_EXTATTR_GET_FILE = 357 +pkg syscall (freebsd-386), const SYS_EXTATTR_GET_LINK = 413 +pkg syscall (freebsd-386), const SYS_EXTATTR_LIST_FD = 437 +pkg syscall (freebsd-386), const SYS_EXTATTR_LIST_FILE = 438 +pkg syscall (freebsd-386), const SYS_EXTATTR_LIST_LINK = 439 +pkg syscall (freebsd-386), const SYS_EXTATTR_SET_FD = 371 +pkg syscall (freebsd-386), const SYS_EXTATTR_SET_FILE = 356 +pkg syscall (freebsd-386), const SYS_EXTATTR_SET_LINK = 412 +pkg syscall (freebsd-386), const SYS_FACCESSAT = 489 +pkg syscall (freebsd-386), const SYS_FCHDIR = 13 +pkg syscall (freebsd-386), const SYS_FCHFLAGS = 35 +pkg syscall (freebsd-386), const SYS_FCHMOD = 124 +pkg syscall (freebsd-386), const SYS_FCHMODAT = 490 +pkg syscall (freebsd-386), const SYS_FCHOWN = 123 +pkg syscall (freebsd-386), const SYS_FCHOWNAT = 491 +pkg syscall (freebsd-386), const SYS_FCNTL = 92 +pkg syscall (freebsd-386), const SYS_FEXECVE = 492 +pkg syscall (freebsd-386), const SYS_FFCLOCK_GETCOUNTER = 241 +pkg syscall (freebsd-386), const SYS_FFCLOCK_GETESTIMATE = 243 +pkg syscall (freebsd-386), const SYS_FFCLOCK_SETESTIMATE = 242 +pkg syscall (freebsd-386), const SYS_FHOPEN = 298 +pkg syscall (freebsd-386), const SYS_FHSTAT = 299 +pkg syscall (freebsd-386), const SYS_FHSTATFS = 398 +pkg syscall (freebsd-386), const SYS_FLOCK = 131 +pkg syscall (freebsd-386), const SYS_FORK = 2 +pkg syscall (freebsd-386), const SYS_FPATHCONF = 192 +pkg syscall (freebsd-386), const SYS_FREEBSD6_FTRUNCATE = 201 +pkg syscall (freebsd-386), const SYS_FREEBSD6_LSEEK = 199 +pkg syscall (freebsd-386), const SYS_FREEBSD6_MMAP = 197 +pkg syscall (freebsd-386), const SYS_FREEBSD6_PREAD = 173 +pkg syscall (freebsd-386), const SYS_FREEBSD6_PWRITE = 174 +pkg syscall (freebsd-386), const SYS_FREEBSD6_TRUNCATE = 200 +pkg syscall (freebsd-386), const SYS_FSTAT = 189 +pkg syscall (freebsd-386), const SYS_FSTATAT = 493 +pkg syscall (freebsd-386), const SYS_FSTATFS = 397 +pkg syscall (freebsd-386), const SYS_FSYNC = 95 +pkg syscall (freebsd-386), const SYS_FTRUNCATE = 480 +pkg syscall (freebsd-386), const SYS_FUTIMES = 206 +pkg syscall (freebsd-386), const SYS_FUTIMESAT = 494 +pkg syscall (freebsd-386), const SYS_GETAUDIT = 449 +pkg syscall (freebsd-386), const SYS_GETAUDIT_ADDR = 451 +pkg syscall (freebsd-386), const SYS_GETAUID = 447 +pkg syscall (freebsd-386), const SYS_GETCONTEXT = 421 +pkg syscall (freebsd-386), const SYS_GETDENTS = 272 +pkg syscall (freebsd-386), const SYS_GETDIRENTRIES = 196 +pkg syscall (freebsd-386), const SYS_GETDTABLESIZE = 89 +pkg syscall (freebsd-386), const SYS_GETEGID = 43 +pkg syscall (freebsd-386), const SYS_GETEUID = 25 +pkg syscall (freebsd-386), const SYS_GETFH = 161 +pkg syscall (freebsd-386), const SYS_GETFSSTAT = 395 +pkg syscall (freebsd-386), const SYS_GETGID = 47 +pkg syscall (freebsd-386), const SYS_GETGROUPS = 79 +pkg syscall (freebsd-386), const SYS_GETITIMER = 86 +pkg syscall (freebsd-386), const SYS_GETLOGIN = 49 +pkg syscall (freebsd-386), const SYS_GETLOGINCLASS = 523 +pkg syscall (freebsd-386), const SYS_GETPEERNAME = 31 +pkg syscall (freebsd-386), const SYS_GETPGID = 207 +pkg syscall (freebsd-386), const SYS_GETPGRP = 81 +pkg syscall (freebsd-386), const SYS_GETPID = 20 +pkg syscall (freebsd-386), const SYS_GETPPID = 39 +pkg syscall (freebsd-386), const SYS_GETPRIORITY = 100 +pkg syscall (freebsd-386), const SYS_GETRESGID = 361 +pkg syscall (freebsd-386), const SYS_GETRESUID = 360 +pkg syscall (freebsd-386), const SYS_GETRLIMIT = 194 +pkg syscall (freebsd-386), const SYS_GETRUSAGE = 117 +pkg syscall (freebsd-386), const SYS_GETSID = 310 +pkg syscall (freebsd-386), const SYS_GETSOCKNAME = 32 +pkg syscall (freebsd-386), const SYS_GETSOCKOPT = 118 +pkg syscall (freebsd-386), const SYS_GETTIMEOFDAY = 116 +pkg syscall (freebsd-386), const SYS_GETUID = 24 +pkg syscall (freebsd-386), const SYS_IOCTL = 54 +pkg syscall (freebsd-386), const SYS_ISSETUGID = 253 +pkg syscall (freebsd-386), const SYS_JAIL = 338 +pkg syscall (freebsd-386), const SYS_JAIL_ATTACH = 436 +pkg syscall (freebsd-386), const SYS_JAIL_GET = 506 +pkg syscall (freebsd-386), const SYS_JAIL_REMOVE = 508 +pkg syscall (freebsd-386), const SYS_JAIL_SET = 507 +pkg syscall (freebsd-386), const SYS_KENV = 390 +pkg syscall (freebsd-386), const SYS_KEVENT = 363 +pkg syscall (freebsd-386), const SYS_KILL = 37 +pkg syscall (freebsd-386), const SYS_KLDFIND = 306 +pkg syscall (freebsd-386), const SYS_KLDFIRSTMOD = 309 +pkg syscall (freebsd-386), const SYS_KLDLOAD = 304 +pkg syscall (freebsd-386), const SYS_KLDNEXT = 307 +pkg syscall (freebsd-386), const SYS_KLDSTAT = 308 +pkg syscall (freebsd-386), const SYS_KLDSYM = 337 +pkg syscall (freebsd-386), const SYS_KLDUNLOAD = 305 +pkg syscall (freebsd-386), const SYS_KLDUNLOADF = 444 +pkg syscall (freebsd-386), const SYS_KQUEUE = 362 +pkg syscall (freebsd-386), const SYS_KTIMER_CREATE = 235 +pkg syscall (freebsd-386), const SYS_KTIMER_DELETE = 236 +pkg syscall (freebsd-386), const SYS_KTIMER_GETOVERRUN = 239 +pkg syscall (freebsd-386), const SYS_KTIMER_GETTIME = 238 +pkg syscall (freebsd-386), const SYS_KTIMER_SETTIME = 237 +pkg syscall (freebsd-386), const SYS_KTRACE = 45 +pkg syscall (freebsd-386), const SYS_LCHFLAGS = 391 +pkg syscall (freebsd-386), const SYS_LCHMOD = 274 +pkg syscall (freebsd-386), const SYS_LCHOWN = 254 +pkg syscall (freebsd-386), const SYS_LGETFH = 160 +pkg syscall (freebsd-386), const SYS_LINK = 9 +pkg syscall (freebsd-386), const SYS_LINKAT = 495 +pkg syscall (freebsd-386), const SYS_LISTEN = 106 +pkg syscall (freebsd-386), const SYS_LPATHCONF = 513 +pkg syscall (freebsd-386), const SYS_LSEEK = 478 +pkg syscall (freebsd-386), const SYS_LSTAT = 190 +pkg syscall (freebsd-386), const SYS_LUTIMES = 276 +pkg syscall (freebsd-386), const SYS_MAC_SYSCALL = 394 +pkg syscall (freebsd-386), const SYS_MADVISE = 75 +pkg syscall (freebsd-386), const SYS_MINCORE = 78 +pkg syscall (freebsd-386), const SYS_MINHERIT = 250 +pkg syscall (freebsd-386), const SYS_MKDIR = 136 +pkg syscall (freebsd-386), const SYS_MKDIRAT = 496 +pkg syscall (freebsd-386), const SYS_MKFIFO = 132 +pkg syscall (freebsd-386), const SYS_MKFIFOAT = 497 +pkg syscall (freebsd-386), const SYS_MKNOD = 14 +pkg syscall (freebsd-386), const SYS_MKNODAT = 498 +pkg syscall (freebsd-386), const SYS_MLOCK = 203 +pkg syscall (freebsd-386), const SYS_MLOCKALL = 324 +pkg syscall (freebsd-386), const SYS_MMAP = 477 +pkg syscall (freebsd-386), const SYS_MODFIND = 303 +pkg syscall (freebsd-386), const SYS_MODFNEXT = 302 +pkg syscall (freebsd-386), const SYS_MODNEXT = 300 +pkg syscall (freebsd-386), const SYS_MODSTAT = 301 +pkg syscall (freebsd-386), const SYS_MOUNT = 21 +pkg syscall (freebsd-386), const SYS_MPROTECT = 74 +pkg syscall (freebsd-386), const SYS_MSYNC = 65 +pkg syscall (freebsd-386), const SYS_MUNLOCK = 204 +pkg syscall (freebsd-386), const SYS_MUNLOCKALL = 325 +pkg syscall (freebsd-386), const SYS_MUNMAP = 73 +pkg syscall (freebsd-386), const SYS_NANOSLEEP = 240 +pkg syscall (freebsd-386), const SYS_NFSTAT = 279 +pkg syscall (freebsd-386), const SYS_NLSTAT = 280 +pkg syscall (freebsd-386), const SYS_NMOUNT = 378 +pkg syscall (freebsd-386), const SYS_NSTAT = 278 +pkg syscall (freebsd-386), const SYS_NTP_ADJTIME = 176 +pkg syscall (freebsd-386), const SYS_NTP_GETTIME = 248 +pkg syscall (freebsd-386), const SYS_OBREAK = 17 +pkg syscall (freebsd-386), const SYS_OPEN = 5 +pkg syscall (freebsd-386), const SYS_OPENAT = 499 +pkg syscall (freebsd-386), const SYS_OPENBSD_POLL = 252 +pkg syscall (freebsd-386), const SYS_OVADVISE = 72 +pkg syscall (freebsd-386), const SYS_PATHCONF = 191 +pkg syscall (freebsd-386), const SYS_PDFORK = 518 +pkg syscall (freebsd-386), const SYS_PDGETPID = 520 +pkg syscall (freebsd-386), const SYS_PDKILL = 519 +pkg syscall (freebsd-386), const SYS_PIPE = 42 +pkg syscall (freebsd-386), const SYS_POLL = 209 +pkg syscall (freebsd-386), const SYS_POSIX_FADVISE = 531 +pkg syscall (freebsd-386), const SYS_POSIX_FALLOCATE = 530 +pkg syscall (freebsd-386), const SYS_POSIX_OPENPT = 504 +pkg syscall (freebsd-386), const SYS_PREAD = 475 +pkg syscall (freebsd-386), const SYS_PREADV = 289 +pkg syscall (freebsd-386), const SYS_PROFIL = 44 +pkg syscall (freebsd-386), const SYS_PSELECT = 522 +pkg syscall (freebsd-386), const SYS_PTRACE = 26 +pkg syscall (freebsd-386), const SYS_PWRITE = 476 +pkg syscall (freebsd-386), const SYS_PWRITEV = 290 +pkg syscall (freebsd-386), const SYS_QUOTACTL = 148 +pkg syscall (freebsd-386), const SYS_RCTL_ADD_RULE = 528 +pkg syscall (freebsd-386), const SYS_RCTL_GET_LIMITS = 527 +pkg syscall (freebsd-386), const SYS_RCTL_GET_RACCT = 525 +pkg syscall (freebsd-386), const SYS_RCTL_GET_RULES = 526 +pkg syscall (freebsd-386), const SYS_RCTL_REMOVE_RULE = 529 +pkg syscall (freebsd-386), const SYS_READ = 3 +pkg syscall (freebsd-386), const SYS_READLINK = 58 +pkg syscall (freebsd-386), const SYS_READLINKAT = 500 +pkg syscall (freebsd-386), const SYS_READV = 120 +pkg syscall (freebsd-386), const SYS_REBOOT = 55 +pkg syscall (freebsd-386), const SYS_RECVFROM = 29 +pkg syscall (freebsd-386), const SYS_RECVMSG = 27 +pkg syscall (freebsd-386), const SYS_RENAME = 128 +pkg syscall (freebsd-386), const SYS_RENAMEAT = 501 +pkg syscall (freebsd-386), const SYS_REVOKE = 56 +pkg syscall (freebsd-386), const SYS_RFORK = 251 +pkg syscall (freebsd-386), const SYS_RMDIR = 137 +pkg syscall (freebsd-386), const SYS_RTPRIO = 166 +pkg syscall (freebsd-386), const SYS_RTPRIO_THREAD = 466 +pkg syscall (freebsd-386), const SYS_SBRK = 69 +pkg syscall (freebsd-386), const SYS_SCHED_GETPARAM = 328 +pkg syscall (freebsd-386), const SYS_SCHED_GETSCHEDULER = 330 +pkg syscall (freebsd-386), const SYS_SCHED_GET_PRIORITY_MAX = 332 +pkg syscall (freebsd-386), const SYS_SCHED_GET_PRIORITY_MIN = 333 +pkg syscall (freebsd-386), const SYS_SCHED_RR_GET_INTERVAL = 334 +pkg syscall (freebsd-386), const SYS_SCHED_SETPARAM = 327 +pkg syscall (freebsd-386), const SYS_SCHED_SETSCHEDULER = 329 +pkg syscall (freebsd-386), const SYS_SCHED_YIELD = 331 +pkg syscall (freebsd-386), const SYS_SCTP_GENERIC_RECVMSG = 474 +pkg syscall (freebsd-386), const SYS_SCTP_GENERIC_SENDMSG = 472 +pkg syscall (freebsd-386), const SYS_SCTP_GENERIC_SENDMSG_IOV = 473 +pkg syscall (freebsd-386), const SYS_SCTP_PEELOFF = 471 +pkg syscall (freebsd-386), const SYS_SELECT = 93 +pkg syscall (freebsd-386), const SYS_SENDFILE = 393 +pkg syscall (freebsd-386), const SYS_SENDMSG = 28 +pkg syscall (freebsd-386), const SYS_SENDTO = 133 +pkg syscall (freebsd-386), const SYS_SETAUDIT = 450 +pkg syscall (freebsd-386), const SYS_SETAUDIT_ADDR = 452 +pkg syscall (freebsd-386), const SYS_SETAUID = 448 +pkg syscall (freebsd-386), const SYS_SETCONTEXT = 422 +pkg syscall (freebsd-386), const SYS_SETEGID = 182 +pkg syscall (freebsd-386), const SYS_SETEUID = 183 +pkg syscall (freebsd-386), const SYS_SETFIB = 175 +pkg syscall (freebsd-386), const SYS_SETGID = 181 +pkg syscall (freebsd-386), const SYS_SETGROUPS = 80 +pkg syscall (freebsd-386), const SYS_SETITIMER = 83 +pkg syscall (freebsd-386), const SYS_SETLOGIN = 50 +pkg syscall (freebsd-386), const SYS_SETLOGINCLASS = 524 +pkg syscall (freebsd-386), const SYS_SETPGID = 82 +pkg syscall (freebsd-386), const SYS_SETPRIORITY = 96 +pkg syscall (freebsd-386), const SYS_SETREGID = 127 +pkg syscall (freebsd-386), const SYS_SETRESGID = 312 +pkg syscall (freebsd-386), const SYS_SETRESUID = 311 +pkg syscall (freebsd-386), const SYS_SETREUID = 126 +pkg syscall (freebsd-386), const SYS_SETRLIMIT = 195 +pkg syscall (freebsd-386), const SYS_SETSID = 147 +pkg syscall (freebsd-386), const SYS_SETSOCKOPT = 105 +pkg syscall (freebsd-386), const SYS_SETTIMEOFDAY = 122 +pkg syscall (freebsd-386), const SYS_SETUID = 23 +pkg syscall (freebsd-386), const SYS_SHM_OPEN = 482 +pkg syscall (freebsd-386), const SYS_SHM_UNLINK = 483 +pkg syscall (freebsd-386), const SYS_SHUTDOWN = 134 +pkg syscall (freebsd-386), const SYS_SIGACTION = 416 +pkg syscall (freebsd-386), const SYS_SIGALTSTACK = 53 +pkg syscall (freebsd-386), const SYS_SIGPENDING = 343 +pkg syscall (freebsd-386), const SYS_SIGPROCMASK = 340 +pkg syscall (freebsd-386), const SYS_SIGQUEUE = 456 +pkg syscall (freebsd-386), const SYS_SIGRETURN = 417 +pkg syscall (freebsd-386), const SYS_SIGSUSPEND = 341 +pkg syscall (freebsd-386), const SYS_SIGTIMEDWAIT = 345 +pkg syscall (freebsd-386), const SYS_SIGWAIT = 429 +pkg syscall (freebsd-386), const SYS_SIGWAITINFO = 346 +pkg syscall (freebsd-386), const SYS_SOCKET = 97 +pkg syscall (freebsd-386), const SYS_SOCKETPAIR = 135 +pkg syscall (freebsd-386), const SYS_SSTK = 70 +pkg syscall (freebsd-386), const SYS_STAT = 188 +pkg syscall (freebsd-386), const SYS_STATFS = 396 +pkg syscall (freebsd-386), const SYS_SWAPCONTEXT = 423 +pkg syscall (freebsd-386), const SYS_SWAPOFF = 424 +pkg syscall (freebsd-386), const SYS_SWAPON = 85 +pkg syscall (freebsd-386), const SYS_SYMLINK = 57 +pkg syscall (freebsd-386), const SYS_SYMLINKAT = 502 +pkg syscall (freebsd-386), const SYS_SYNC = 36 +pkg syscall (freebsd-386), const SYS_SYSARCH = 165 +pkg syscall (freebsd-386), const SYS_THR_CREATE = 430 +pkg syscall (freebsd-386), const SYS_THR_EXIT = 431 +pkg syscall (freebsd-386), const SYS_THR_KILL = 433 +pkg syscall (freebsd-386), const SYS_THR_KILL2 = 481 +pkg syscall (freebsd-386), const SYS_THR_NEW = 455 +pkg syscall (freebsd-386), const SYS_THR_SELF = 432 +pkg syscall (freebsd-386), const SYS_THR_SET_NAME = 464 +pkg syscall (freebsd-386), const SYS_THR_SUSPEND = 442 +pkg syscall (freebsd-386), const SYS_THR_WAKE = 443 +pkg syscall (freebsd-386), const SYS_TRUNCATE = 479 +pkg syscall (freebsd-386), const SYS_UMASK = 60 +pkg syscall (freebsd-386), const SYS_UNDELETE = 205 +pkg syscall (freebsd-386), const SYS_UNLINK = 10 +pkg syscall (freebsd-386), const SYS_UNLINKAT = 503 +pkg syscall (freebsd-386), const SYS_UNMOUNT = 22 +pkg syscall (freebsd-386), const SYS_UTIMES = 138 +pkg syscall (freebsd-386), const SYS_UTRACE = 335 +pkg syscall (freebsd-386), const SYS_UUIDGEN = 392 +pkg syscall (freebsd-386), const SYS_VFORK = 66 +pkg syscall (freebsd-386), const SYS_WAIT4 = 7 +pkg syscall (freebsd-386), const SYS_WAIT6 = 532 +pkg syscall (freebsd-386), const SYS_WAIT6 ideal-int +pkg syscall (freebsd-386), const SYS_WRITE = 4 +pkg syscall (freebsd-386), const SYS_WRITEV = 121 +pkg syscall (freebsd-386), const SYS_YIELD = 321 +pkg syscall (freebsd-386), const SYS__UMTX_LOCK = 434 +pkg syscall (freebsd-386), const SYS__UMTX_OP = 454 +pkg syscall (freebsd-386), const SYS__UMTX_UNLOCK = 435 +pkg syscall (freebsd-386), const SYS___ACL_ACLCHECK_FD = 354 +pkg syscall (freebsd-386), const SYS___ACL_ACLCHECK_FILE = 353 +pkg syscall (freebsd-386), const SYS___ACL_ACLCHECK_LINK = 428 +pkg syscall (freebsd-386), const SYS___ACL_DELETE_FD = 352 +pkg syscall (freebsd-386), const SYS___ACL_DELETE_FILE = 351 +pkg syscall (freebsd-386), const SYS___ACL_DELETE_LINK = 427 +pkg syscall (freebsd-386), const SYS___ACL_GET_FD = 349 +pkg syscall (freebsd-386), const SYS___ACL_GET_FILE = 347 +pkg syscall (freebsd-386), const SYS___ACL_GET_LINK = 425 +pkg syscall (freebsd-386), const SYS___ACL_SET_FD = 350 +pkg syscall (freebsd-386), const SYS___ACL_SET_FILE = 348 +pkg syscall (freebsd-386), const SYS___ACL_SET_LINK = 426 +pkg syscall (freebsd-386), const SYS___GETCWD = 326 +pkg syscall (freebsd-386), const SYS___MAC_EXECVE = 415 +pkg syscall (freebsd-386), const SYS___MAC_GET_FD = 386 +pkg syscall (freebsd-386), const SYS___MAC_GET_FILE = 387 +pkg syscall (freebsd-386), const SYS___MAC_GET_LINK = 410 +pkg syscall (freebsd-386), const SYS___MAC_GET_PID = 409 +pkg syscall (freebsd-386), const SYS___MAC_GET_PROC = 384 +pkg syscall (freebsd-386), const SYS___MAC_SET_FD = 388 +pkg syscall (freebsd-386), const SYS___MAC_SET_FILE = 389 +pkg syscall (freebsd-386), const SYS___MAC_SET_LINK = 411 +pkg syscall (freebsd-386), const SYS___MAC_SET_PROC = 385 +pkg syscall (freebsd-386), const SYS___SETUGID = 374 +pkg syscall (freebsd-386), const SYS___SYSCTL = 202 +pkg syscall (freebsd-386), const S_IFMT = 61440 +pkg syscall (freebsd-386), const SizeofBpfHdr = 20 +pkg syscall (freebsd-386), const SizeofBpfInsn = 8 +pkg syscall (freebsd-386), const SizeofBpfProgram = 8 +pkg syscall (freebsd-386), const SizeofBpfStat = 8 +pkg syscall (freebsd-386), const SizeofBpfVersion = 4 +pkg syscall (freebsd-386), const SizeofBpfZbuf = 12 +pkg syscall (freebsd-386), const SizeofBpfZbufHeader = 32 +pkg syscall (freebsd-386), const SizeofCmsghdr = 12 +pkg syscall (freebsd-386), const SizeofIPMreq = 8 +pkg syscall (freebsd-386), const SizeofIPMreqn = 12 +pkg syscall (freebsd-386), const SizeofIPv6Mreq = 20 +pkg syscall (freebsd-386), const SizeofIfAnnounceMsghdr = 24 +pkg syscall (freebsd-386), const SizeofIfAnnounceMsghdr ideal-int +pkg syscall (freebsd-386), const SizeofIfData = 80 +pkg syscall (freebsd-386), const SizeofIfMsghdr = 96 +pkg syscall (freebsd-386), const SizeofIfaMsghdr = 20 +pkg syscall (freebsd-386), const SizeofIfmaMsghdr = 16 +pkg syscall (freebsd-386), const SizeofInet6Pktinfo = 20 +pkg syscall (freebsd-386), const SizeofLinger = 8 +pkg syscall (freebsd-386), const SizeofMsghdr = 28 +pkg syscall (freebsd-386), const SizeofRtMetrics = 56 +pkg syscall (freebsd-386), const SizeofRtMsghdr = 92 +pkg syscall (freebsd-386), const SizeofSockaddrAny = 108 +pkg syscall (freebsd-386), const SizeofSockaddrDatalink = 54 +pkg syscall (freebsd-386), const SizeofSockaddrInet4 = 16 +pkg syscall (freebsd-386), const SizeofSockaddrInet6 = 28 +pkg syscall (freebsd-386), const SizeofSockaddrUnix = 106 +pkg syscall (freebsd-386), const TCIFLUSH = 1 +pkg syscall (freebsd-386), const TCIFLUSH ideal-int +pkg syscall (freebsd-386), const TCIOFLUSH = 3 +pkg syscall (freebsd-386), const TCIOFLUSH ideal-int +pkg syscall (freebsd-386), const TCOFLUSH = 2 +pkg syscall (freebsd-386), const TCOFLUSH ideal-int +pkg syscall (freebsd-386), const TCP_CA_NAME_MAX = 16 +pkg syscall (freebsd-386), const TCP_CONGESTION = 64 +pkg syscall (freebsd-386), const TCP_INFO = 32 +pkg syscall (freebsd-386), const TCP_KEEPCNT = 1024 +pkg syscall (freebsd-386), const TCP_KEEPCNT ideal-int +pkg syscall (freebsd-386), const TCP_KEEPIDLE = 256 +pkg syscall (freebsd-386), const TCP_KEEPIDLE ideal-int +pkg syscall (freebsd-386), const TCP_KEEPINIT = 128 +pkg syscall (freebsd-386), const TCP_KEEPINIT ideal-int +pkg syscall (freebsd-386), const TCP_KEEPINTVL = 512 +pkg syscall (freebsd-386), const TCP_KEEPINTVL ideal-int +pkg syscall (freebsd-386), const TCP_MAXBURST = 4 +pkg syscall (freebsd-386), const TCP_MAXHLEN = 60 +pkg syscall (freebsd-386), const TCP_MAXOLEN = 40 +pkg syscall (freebsd-386), const TCP_MAXSEG = 2 +pkg syscall (freebsd-386), const TCP_MAXWIN = 65535 +pkg syscall (freebsd-386), const TCP_MAX_SACK = 4 +pkg syscall (freebsd-386), const TCP_MAX_WINSHIFT = 14 +pkg syscall (freebsd-386), const TCP_MD5SIG = 16 +pkg syscall (freebsd-386), const TCP_MINMSS = 216 +pkg syscall (freebsd-386), const TCP_MSS = 536 +pkg syscall (freebsd-386), const TCP_NOOPT = 8 +pkg syscall (freebsd-386), const TCP_NOPUSH = 4 +pkg syscall (freebsd-386), const TCSAFLUSH = 2 +pkg syscall (freebsd-386), const TCSAFLUSH ideal-int +pkg syscall (freebsd-386), const TIOCCBRK = 536900730 +pkg syscall (freebsd-386), const TIOCCDTR = 536900728 +pkg syscall (freebsd-386), const TIOCCONS = 2147775586 +pkg syscall (freebsd-386), const TIOCDRAIN = 536900702 +pkg syscall (freebsd-386), const TIOCEXCL = 536900621 +pkg syscall (freebsd-386), const TIOCEXT = 2147775584 +pkg syscall (freebsd-386), const TIOCFLUSH = 2147775504 +pkg syscall (freebsd-386), const TIOCGDRAINWAIT = 1074033750 +pkg syscall (freebsd-386), const TIOCGETA = 1076655123 +pkg syscall (freebsd-386), const TIOCGETD = 1074033690 +pkg syscall (freebsd-386), const TIOCGPGRP = 1074033783 +pkg syscall (freebsd-386), const TIOCGPTN = 1074033679 +pkg syscall (freebsd-386), const TIOCGSID = 1074033763 +pkg syscall (freebsd-386), const TIOCGWINSZ = 1074295912 +pkg syscall (freebsd-386), const TIOCMBIC = 2147775595 +pkg syscall (freebsd-386), const TIOCMBIS = 2147775596 +pkg syscall (freebsd-386), const TIOCMGDTRWAIT = 1074033754 +pkg syscall (freebsd-386), const TIOCMGET = 1074033770 +pkg syscall (freebsd-386), const TIOCMSDTRWAIT = 2147775579 +pkg syscall (freebsd-386), const TIOCMSET = 2147775597 +pkg syscall (freebsd-386), const TIOCM_CAR = 64 +pkg syscall (freebsd-386), const TIOCM_CD = 64 +pkg syscall (freebsd-386), const TIOCM_CTS = 32 +pkg syscall (freebsd-386), const TIOCM_DCD = 64 +pkg syscall (freebsd-386), const TIOCM_DSR = 256 +pkg syscall (freebsd-386), const TIOCM_DTR = 2 +pkg syscall (freebsd-386), const TIOCM_LE = 1 +pkg syscall (freebsd-386), const TIOCM_RI = 128 +pkg syscall (freebsd-386), const TIOCM_RNG = 128 +pkg syscall (freebsd-386), const TIOCM_RTS = 4 +pkg syscall (freebsd-386), const TIOCM_SR = 16 +pkg syscall (freebsd-386), const TIOCM_ST = 8 +pkg syscall (freebsd-386), const TIOCNOTTY = 536900721 +pkg syscall (freebsd-386), const TIOCNXCL = 536900622 +pkg syscall (freebsd-386), const TIOCOUTQ = 1074033779 +pkg syscall (freebsd-386), const TIOCPKT = 2147775600 +pkg syscall (freebsd-386), const TIOCPKT_DATA = 0 +pkg syscall (freebsd-386), const TIOCPKT_DOSTOP = 32 +pkg syscall (freebsd-386), const TIOCPKT_FLUSHREAD = 1 +pkg syscall (freebsd-386), const TIOCPKT_FLUSHWRITE = 2 +pkg syscall (freebsd-386), const TIOCPKT_IOCTL = 64 +pkg syscall (freebsd-386), const TIOCPKT_NOSTOP = 16 +pkg syscall (freebsd-386), const TIOCPKT_START = 8 +pkg syscall (freebsd-386), const TIOCPKT_STOP = 4 +pkg syscall (freebsd-386), const TIOCPTMASTER = 536900636 +pkg syscall (freebsd-386), const TIOCSBRK = 536900731 +pkg syscall (freebsd-386), const TIOCSCTTY = 536900705 +pkg syscall (freebsd-386), const TIOCSDRAINWAIT = 2147775575 +pkg syscall (freebsd-386), const TIOCSDTR = 536900729 +pkg syscall (freebsd-386), const TIOCSETA = 2150396948 +pkg syscall (freebsd-386), const TIOCSETAF = 2150396950 +pkg syscall (freebsd-386), const TIOCSETAW = 2150396949 +pkg syscall (freebsd-386), const TIOCSETD = 2147775515 +pkg syscall (freebsd-386), const TIOCSIG = 537162847 +pkg syscall (freebsd-386), const TIOCSPGRP = 2147775606 +pkg syscall (freebsd-386), const TIOCSTART = 536900718 +pkg syscall (freebsd-386), const TIOCSTAT = 536900709 +pkg syscall (freebsd-386), const TIOCSTI = 2147578994 +pkg syscall (freebsd-386), const TIOCSTOP = 536900719 +pkg syscall (freebsd-386), const TIOCSWINSZ = 2148037735 +pkg syscall (freebsd-386), const TIOCTIMESTAMP = 1074295897 +pkg syscall (freebsd-386), const TIOCUCNTL = 2147775590 +pkg syscall (freebsd-386), const TOSTOP = 4194304 +pkg syscall (freebsd-386), const TOSTOP ideal-int +pkg syscall (freebsd-386), const VDISCARD = 15 +pkg syscall (freebsd-386), const VDISCARD ideal-int +pkg syscall (freebsd-386), const VDSUSP = 11 +pkg syscall (freebsd-386), const VDSUSP ideal-int +pkg syscall (freebsd-386), const VEOF = 0 +pkg syscall (freebsd-386), const VEOF ideal-int +pkg syscall (freebsd-386), const VEOL = 1 +pkg syscall (freebsd-386), const VEOL ideal-int +pkg syscall (freebsd-386), const VEOL2 = 2 +pkg syscall (freebsd-386), const VEOL2 ideal-int +pkg syscall (freebsd-386), const VERASE = 3 +pkg syscall (freebsd-386), const VERASE ideal-int +pkg syscall (freebsd-386), const VERASE2 = 7 +pkg syscall (freebsd-386), const VERASE2 ideal-int +pkg syscall (freebsd-386), const VINTR = 8 +pkg syscall (freebsd-386), const VINTR ideal-int +pkg syscall (freebsd-386), const VKILL = 5 +pkg syscall (freebsd-386), const VKILL ideal-int +pkg syscall (freebsd-386), const VLNEXT = 14 +pkg syscall (freebsd-386), const VLNEXT ideal-int +pkg syscall (freebsd-386), const VMIN = 16 +pkg syscall (freebsd-386), const VMIN ideal-int +pkg syscall (freebsd-386), const VQUIT = 9 +pkg syscall (freebsd-386), const VQUIT ideal-int +pkg syscall (freebsd-386), const VREPRINT = 6 +pkg syscall (freebsd-386), const VREPRINT ideal-int +pkg syscall (freebsd-386), const VSTART = 12 +pkg syscall (freebsd-386), const VSTART ideal-int +pkg syscall (freebsd-386), const VSTATUS = 18 +pkg syscall (freebsd-386), const VSTATUS ideal-int +pkg syscall (freebsd-386), const VSTOP = 13 +pkg syscall (freebsd-386), const VSTOP ideal-int +pkg syscall (freebsd-386), const VSUSP = 10 +pkg syscall (freebsd-386), const VSUSP ideal-int +pkg syscall (freebsd-386), const VTIME = 17 +pkg syscall (freebsd-386), const VTIME ideal-int +pkg syscall (freebsd-386), const VWERASE = 4 +pkg syscall (freebsd-386), const VWERASE ideal-int +pkg syscall (freebsd-386), const WCONTINUED = 4 +pkg syscall (freebsd-386), const WCOREFLAG = 128 +pkg syscall (freebsd-386), const WLINUXCLONE = 2147483648 +pkg syscall (freebsd-386), const WNOHANG = 1 +pkg syscall (freebsd-386), const WNOWAIT = 8 +pkg syscall (freebsd-386), const WSTOPPED = 2 +pkg syscall (freebsd-386), const WUNTRACED = 2 +pkg syscall (freebsd-386), func Fchflags(int, int) error +pkg syscall (freebsd-386), func SlicePtrFromStrings([]string) ([]*uint8, error) +pkg syscall (freebsd-386), type IfAnnounceMsghdr struct +pkg syscall (freebsd-386), type IfAnnounceMsghdr struct, Index uint16 +pkg syscall (freebsd-386), type IfAnnounceMsghdr struct, Msglen uint16 +pkg syscall (freebsd-386), type IfAnnounceMsghdr struct, Name [16]int8 +pkg syscall (freebsd-386), type IfAnnounceMsghdr struct, Type uint8 +pkg syscall (freebsd-386), type IfAnnounceMsghdr struct, Version uint8 +pkg syscall (freebsd-386), type IfAnnounceMsghdr struct, What uint16 +pkg syscall (freebsd-386), type InterfaceAnnounceMessage struct +pkg syscall (freebsd-386), type InterfaceAnnounceMessage struct, Header IfAnnounceMsghdr +pkg syscall (freebsd-386-cgo), const AF_APPLETALK = 16 +pkg syscall (freebsd-386-cgo), const AF_ARP = 35 +pkg syscall (freebsd-386-cgo), const AF_ATM = 30 +pkg syscall (freebsd-386-cgo), const AF_BLUETOOTH = 36 +pkg syscall (freebsd-386-cgo), const AF_CCITT = 10 +pkg syscall (freebsd-386-cgo), const AF_CHAOS = 5 +pkg syscall (freebsd-386-cgo), const AF_CNT = 21 +pkg syscall (freebsd-386-cgo), const AF_COIP = 20 +pkg syscall (freebsd-386-cgo), const AF_DATAKIT = 9 +pkg syscall (freebsd-386-cgo), const AF_DECnet = 12 +pkg syscall (freebsd-386-cgo), const AF_DLI = 13 +pkg syscall (freebsd-386-cgo), const AF_E164 = 26 +pkg syscall (freebsd-386-cgo), const AF_ECMA = 8 +pkg syscall (freebsd-386-cgo), const AF_HYLINK = 15 +pkg syscall (freebsd-386-cgo), const AF_IEEE80211 = 37 +pkg syscall (freebsd-386-cgo), const AF_IMPLINK = 3 +pkg syscall (freebsd-386-cgo), const AF_INET6 = 28 +pkg syscall (freebsd-386-cgo), const AF_IPX = 23 +pkg syscall (freebsd-386-cgo), const AF_ISDN = 26 +pkg syscall (freebsd-386-cgo), const AF_ISO = 7 +pkg syscall (freebsd-386-cgo), const AF_LAT = 14 +pkg syscall (freebsd-386-cgo), const AF_LINK = 18 +pkg syscall (freebsd-386-cgo), const AF_LOCAL = 1 +pkg syscall (freebsd-386-cgo), const AF_MAX = 38 +pkg syscall (freebsd-386-cgo), const AF_NATM = 29 +pkg syscall (freebsd-386-cgo), const AF_NETBIOS = 6 +pkg syscall (freebsd-386-cgo), const AF_NETGRAPH = 32 +pkg syscall (freebsd-386-cgo), const AF_OSI = 7 +pkg syscall (freebsd-386-cgo), const AF_PUP = 4 +pkg syscall (freebsd-386-cgo), const AF_ROUTE = 17 +pkg syscall (freebsd-386-cgo), const AF_SCLUSTER = 34 +pkg syscall (freebsd-386-cgo), const AF_SIP = 24 +pkg syscall (freebsd-386-cgo), const AF_SLOW = 33 +pkg syscall (freebsd-386-cgo), const AF_SNA = 11 +pkg syscall (freebsd-386-cgo), const AF_VENDOR00 = 39 +pkg syscall (freebsd-386-cgo), const AF_VENDOR01 = 41 +pkg syscall (freebsd-386-cgo), const AF_VENDOR02 = 43 +pkg syscall (freebsd-386-cgo), const AF_VENDOR03 = 45 +pkg syscall (freebsd-386-cgo), const AF_VENDOR04 = 47 +pkg syscall (freebsd-386-cgo), const AF_VENDOR05 = 49 +pkg syscall (freebsd-386-cgo), const AF_VENDOR06 = 51 +pkg syscall (freebsd-386-cgo), const AF_VENDOR07 = 53 +pkg syscall (freebsd-386-cgo), const AF_VENDOR08 = 55 +pkg syscall (freebsd-386-cgo), const AF_VENDOR09 = 57 +pkg syscall (freebsd-386-cgo), const AF_VENDOR10 = 59 +pkg syscall (freebsd-386-cgo), const AF_VENDOR11 = 61 +pkg syscall (freebsd-386-cgo), const AF_VENDOR12 = 63 +pkg syscall (freebsd-386-cgo), const AF_VENDOR13 = 65 +pkg syscall (freebsd-386-cgo), const AF_VENDOR14 = 67 +pkg syscall (freebsd-386-cgo), const AF_VENDOR15 = 69 +pkg syscall (freebsd-386-cgo), const AF_VENDOR16 = 71 +pkg syscall (freebsd-386-cgo), const AF_VENDOR17 = 73 +pkg syscall (freebsd-386-cgo), const AF_VENDOR18 = 75 +pkg syscall (freebsd-386-cgo), const AF_VENDOR19 = 77 +pkg syscall (freebsd-386-cgo), const AF_VENDOR20 = 79 +pkg syscall (freebsd-386-cgo), const AF_VENDOR21 = 81 +pkg syscall (freebsd-386-cgo), const AF_VENDOR22 = 83 +pkg syscall (freebsd-386-cgo), const AF_VENDOR23 = 85 +pkg syscall (freebsd-386-cgo), const AF_VENDOR24 = 87 +pkg syscall (freebsd-386-cgo), const AF_VENDOR25 = 89 +pkg syscall (freebsd-386-cgo), const AF_VENDOR26 = 91 +pkg syscall (freebsd-386-cgo), const AF_VENDOR27 = 93 +pkg syscall (freebsd-386-cgo), const AF_VENDOR28 = 95 +pkg syscall (freebsd-386-cgo), const AF_VENDOR29 = 97 +pkg syscall (freebsd-386-cgo), const AF_VENDOR30 = 99 +pkg syscall (freebsd-386-cgo), const AF_VENDOR31 = 101 +pkg syscall (freebsd-386-cgo), const AF_VENDOR32 = 103 +pkg syscall (freebsd-386-cgo), const AF_VENDOR33 = 105 +pkg syscall (freebsd-386-cgo), const AF_VENDOR34 = 107 +pkg syscall (freebsd-386-cgo), const AF_VENDOR35 = 109 +pkg syscall (freebsd-386-cgo), const AF_VENDOR36 = 111 +pkg syscall (freebsd-386-cgo), const AF_VENDOR37 = 113 +pkg syscall (freebsd-386-cgo), const AF_VENDOR38 = 115 +pkg syscall (freebsd-386-cgo), const AF_VENDOR39 = 117 +pkg syscall (freebsd-386-cgo), const AF_VENDOR40 = 119 +pkg syscall (freebsd-386-cgo), const AF_VENDOR41 = 121 +pkg syscall (freebsd-386-cgo), const AF_VENDOR42 = 123 +pkg syscall (freebsd-386-cgo), const AF_VENDOR43 = 125 +pkg syscall (freebsd-386-cgo), const AF_VENDOR44 = 127 +pkg syscall (freebsd-386-cgo), const AF_VENDOR45 = 129 +pkg syscall (freebsd-386-cgo), const AF_VENDOR46 = 131 +pkg syscall (freebsd-386-cgo), const AF_VENDOR47 = 133 +pkg syscall (freebsd-386-cgo), const B0 = 0 +pkg syscall (freebsd-386-cgo), const B110 = 110 +pkg syscall (freebsd-386-cgo), const B115200 = 115200 +pkg syscall (freebsd-386-cgo), const B1200 = 1200 +pkg syscall (freebsd-386-cgo), const B134 = 134 +pkg syscall (freebsd-386-cgo), const B14400 = 14400 +pkg syscall (freebsd-386-cgo), const B150 = 150 +pkg syscall (freebsd-386-cgo), const B1800 = 1800 +pkg syscall (freebsd-386-cgo), const B19200 = 19200 +pkg syscall (freebsd-386-cgo), const B200 = 200 +pkg syscall (freebsd-386-cgo), const B230400 = 230400 +pkg syscall (freebsd-386-cgo), const B2400 = 2400 +pkg syscall (freebsd-386-cgo), const B28800 = 28800 +pkg syscall (freebsd-386-cgo), const B300 = 300 +pkg syscall (freebsd-386-cgo), const B38400 = 38400 +pkg syscall (freebsd-386-cgo), const B460800 = 460800 +pkg syscall (freebsd-386-cgo), const B4800 = 4800 +pkg syscall (freebsd-386-cgo), const B50 = 50 +pkg syscall (freebsd-386-cgo), const B57600 = 57600 +pkg syscall (freebsd-386-cgo), const B600 = 600 +pkg syscall (freebsd-386-cgo), const B7200 = 7200 +pkg syscall (freebsd-386-cgo), const B75 = 75 +pkg syscall (freebsd-386-cgo), const B76800 = 76800 +pkg syscall (freebsd-386-cgo), const B921600 = 921600 +pkg syscall (freebsd-386-cgo), const B9600 = 9600 +pkg syscall (freebsd-386-cgo), const BIOCFEEDBACK = 2147762812 +pkg syscall (freebsd-386-cgo), const BIOCFLUSH = 536887912 +pkg syscall (freebsd-386-cgo), const BIOCGBLEN = 1074020966 +pkg syscall (freebsd-386-cgo), const BIOCGDIRECTION = 1074020982 +pkg syscall (freebsd-386-cgo), const BIOCGDLT = 1074020970 +pkg syscall (freebsd-386-cgo), const BIOCGDLTLIST = 3221766777 +pkg syscall (freebsd-386-cgo), const BIOCGETBUFMODE = 1074020989 +pkg syscall (freebsd-386-cgo), const BIOCGETIF = 1075855979 +pkg syscall (freebsd-386-cgo), const BIOCGETZMAX = 1074020991 +pkg syscall (freebsd-386-cgo), const BIOCGHDRCMPLT = 1074020980 +pkg syscall (freebsd-386-cgo), const BIOCGRSIG = 1074020978 +pkg syscall (freebsd-386-cgo), const BIOCGRTIMEOUT = 1074283118 +pkg syscall (freebsd-386-cgo), const BIOCGSEESENT = 1074020982 +pkg syscall (freebsd-386-cgo), const BIOCGSTATS = 1074283119 +pkg syscall (freebsd-386-cgo), const BIOCGTSTAMP = 1074020995 +pkg syscall (freebsd-386-cgo), const BIOCIMMEDIATE = 2147762800 +pkg syscall (freebsd-386-cgo), const BIOCLOCK = 536887930 +pkg syscall (freebsd-386-cgo), const BIOCPROMISC = 536887913 +pkg syscall (freebsd-386-cgo), const BIOCROTZBUF = 1074545280 +pkg syscall (freebsd-386-cgo), const BIOCSBLEN = 3221504614 +pkg syscall (freebsd-386-cgo), const BIOCSDIRECTION = 2147762807 +pkg syscall (freebsd-386-cgo), const BIOCSDLT = 2147762808 +pkg syscall (freebsd-386-cgo), const BIOCSETBUFMODE = 2147762814 +pkg syscall (freebsd-386-cgo), const BIOCSETF = 2148024935 +pkg syscall (freebsd-386-cgo), const BIOCSETFNR = 2148024962 +pkg syscall (freebsd-386-cgo), const BIOCSETIF = 2149597804 +pkg syscall (freebsd-386-cgo), const BIOCSETWF = 2148024955 +pkg syscall (freebsd-386-cgo), const BIOCSETZBUF = 2148287105 +pkg syscall (freebsd-386-cgo), const BIOCSHDRCMPLT = 2147762805 +pkg syscall (freebsd-386-cgo), const BIOCSRSIG = 2147762803 +pkg syscall (freebsd-386-cgo), const BIOCSRTIMEOUT = 2148024941 +pkg syscall (freebsd-386-cgo), const BIOCSSEESENT = 2147762807 +pkg syscall (freebsd-386-cgo), const BIOCSTSTAMP = 2147762820 +pkg syscall (freebsd-386-cgo), const BIOCVERSION = 1074020977 +pkg syscall (freebsd-386-cgo), const BPF_A = 16 +pkg syscall (freebsd-386-cgo), const BPF_ABS = 32 +pkg syscall (freebsd-386-cgo), const BPF_ADD = 0 +pkg syscall (freebsd-386-cgo), const BPF_ALIGNMENT = 4 +pkg syscall (freebsd-386-cgo), const BPF_ALU = 4 +pkg syscall (freebsd-386-cgo), const BPF_AND = 80 +pkg syscall (freebsd-386-cgo), const BPF_B = 16 +pkg syscall (freebsd-386-cgo), const BPF_BUFMODE_BUFFER = 1 +pkg syscall (freebsd-386-cgo), const BPF_BUFMODE_ZBUF = 2 +pkg syscall (freebsd-386-cgo), const BPF_DIV = 48 +pkg syscall (freebsd-386-cgo), const BPF_H = 8 +pkg syscall (freebsd-386-cgo), const BPF_IMM = 0 +pkg syscall (freebsd-386-cgo), const BPF_IND = 64 +pkg syscall (freebsd-386-cgo), const BPF_JA = 0 +pkg syscall (freebsd-386-cgo), const BPF_JEQ = 16 +pkg syscall (freebsd-386-cgo), const BPF_JGE = 48 +pkg syscall (freebsd-386-cgo), const BPF_JGT = 32 +pkg syscall (freebsd-386-cgo), const BPF_JMP = 5 +pkg syscall (freebsd-386-cgo), const BPF_JSET = 64 +pkg syscall (freebsd-386-cgo), const BPF_K = 0 +pkg syscall (freebsd-386-cgo), const BPF_LD = 0 +pkg syscall (freebsd-386-cgo), const BPF_LDX = 1 +pkg syscall (freebsd-386-cgo), const BPF_LEN = 128 +pkg syscall (freebsd-386-cgo), const BPF_LSH = 96 +pkg syscall (freebsd-386-cgo), const BPF_MAJOR_VERSION = 1 +pkg syscall (freebsd-386-cgo), const BPF_MAXBUFSIZE = 524288 +pkg syscall (freebsd-386-cgo), const BPF_MAXINSNS = 512 +pkg syscall (freebsd-386-cgo), const BPF_MEM = 96 +pkg syscall (freebsd-386-cgo), const BPF_MEMWORDS = 16 +pkg syscall (freebsd-386-cgo), const BPF_MINBUFSIZE = 32 +pkg syscall (freebsd-386-cgo), const BPF_MINOR_VERSION = 1 +pkg syscall (freebsd-386-cgo), const BPF_MISC = 7 +pkg syscall (freebsd-386-cgo), const BPF_MSH = 160 +pkg syscall (freebsd-386-cgo), const BPF_MUL = 32 +pkg syscall (freebsd-386-cgo), const BPF_NEG = 128 +pkg syscall (freebsd-386-cgo), const BPF_OR = 64 +pkg syscall (freebsd-386-cgo), const BPF_RELEASE = 199606 +pkg syscall (freebsd-386-cgo), const BPF_RET = 6 +pkg syscall (freebsd-386-cgo), const BPF_RSH = 112 +pkg syscall (freebsd-386-cgo), const BPF_ST = 2 +pkg syscall (freebsd-386-cgo), const BPF_STX = 3 +pkg syscall (freebsd-386-cgo), const BPF_SUB = 16 +pkg syscall (freebsd-386-cgo), const BPF_TAX = 0 +pkg syscall (freebsd-386-cgo), const BPF_TXA = 128 +pkg syscall (freebsd-386-cgo), const BPF_T_BINTIME = 2 +pkg syscall (freebsd-386-cgo), const BPF_T_BINTIME_FAST = 258 +pkg syscall (freebsd-386-cgo), const BPF_T_BINTIME_MONOTONIC = 514 +pkg syscall (freebsd-386-cgo), const BPF_T_BINTIME_MONOTONIC_FAST = 770 +pkg syscall (freebsd-386-cgo), const BPF_T_FAST = 256 +pkg syscall (freebsd-386-cgo), const BPF_T_FLAG_MASK = 768 +pkg syscall (freebsd-386-cgo), const BPF_T_FORMAT_MASK = 3 +pkg syscall (freebsd-386-cgo), const BPF_T_MICROTIME = 0 +pkg syscall (freebsd-386-cgo), const BPF_T_MICROTIME_FAST = 256 +pkg syscall (freebsd-386-cgo), const BPF_T_MICROTIME_MONOTONIC = 512 +pkg syscall (freebsd-386-cgo), const BPF_T_MICROTIME_MONOTONIC_FAST = 768 +pkg syscall (freebsd-386-cgo), const BPF_T_MONOTONIC = 512 +pkg syscall (freebsd-386-cgo), const BPF_T_MONOTONIC_FAST = 768 +pkg syscall (freebsd-386-cgo), const BPF_T_NANOTIME = 1 +pkg syscall (freebsd-386-cgo), const BPF_T_NANOTIME_FAST = 257 +pkg syscall (freebsd-386-cgo), const BPF_T_NANOTIME_MONOTONIC = 513 +pkg syscall (freebsd-386-cgo), const BPF_T_NANOTIME_MONOTONIC_FAST = 769 +pkg syscall (freebsd-386-cgo), const BPF_T_NONE = 3 +pkg syscall (freebsd-386-cgo), const BPF_T_NORMAL = 0 +pkg syscall (freebsd-386-cgo), const BPF_W = 0 +pkg syscall (freebsd-386-cgo), const BPF_X = 8 +pkg syscall (freebsd-386-cgo), const BRKINT = 2 +pkg syscall (freebsd-386-cgo), const CFLUSH = 15 +pkg syscall (freebsd-386-cgo), const CLOCAL = 32768 +pkg syscall (freebsd-386-cgo), const CREAD = 2048 +pkg syscall (freebsd-386-cgo), const CS5 = 0 +pkg syscall (freebsd-386-cgo), const CS6 = 256 +pkg syscall (freebsd-386-cgo), const CS7 = 512 +pkg syscall (freebsd-386-cgo), const CS8 = 768 +pkg syscall (freebsd-386-cgo), const CSIZE = 768 +pkg syscall (freebsd-386-cgo), const CSTART = 17 +pkg syscall (freebsd-386-cgo), const CSTATUS = 20 +pkg syscall (freebsd-386-cgo), const CSTOP = 19 +pkg syscall (freebsd-386-cgo), const CSTOPB = 1024 +pkg syscall (freebsd-386-cgo), const CSUSP = 26 +pkg syscall (freebsd-386-cgo), const CTL_MAXNAME = 24 +pkg syscall (freebsd-386-cgo), const CTL_NET = 4 +pkg syscall (freebsd-386-cgo), const DLT_A429 = 184 +pkg syscall (freebsd-386-cgo), const DLT_A653_ICM = 185 +pkg syscall (freebsd-386-cgo), const DLT_AIRONET_HEADER = 120 +pkg syscall (freebsd-386-cgo), const DLT_AOS = 222 +pkg syscall (freebsd-386-cgo), const DLT_APPLE_IP_OVER_IEEE1394 = 138 +pkg syscall (freebsd-386-cgo), const DLT_ARCNET = 7 +pkg syscall (freebsd-386-cgo), const DLT_ARCNET_LINUX = 129 +pkg syscall (freebsd-386-cgo), const DLT_ATM_CLIP = 19 +pkg syscall (freebsd-386-cgo), const DLT_ATM_RFC1483 = 11 +pkg syscall (freebsd-386-cgo), const DLT_AURORA = 126 +pkg syscall (freebsd-386-cgo), const DLT_AX25 = 3 +pkg syscall (freebsd-386-cgo), const DLT_AX25_KISS = 202 +pkg syscall (freebsd-386-cgo), const DLT_BACNET_MS_TP = 165 +pkg syscall (freebsd-386-cgo), const DLT_BLUETOOTH_HCI_H4 = 187 +pkg syscall (freebsd-386-cgo), const DLT_BLUETOOTH_HCI_H4_WITH_PHDR = 201 +pkg syscall (freebsd-386-cgo), const DLT_CAN20B = 190 +pkg syscall (freebsd-386-cgo), const DLT_CAN_SOCKETCAN = 227 +pkg syscall (freebsd-386-cgo), const DLT_CHAOS = 5 +pkg syscall (freebsd-386-cgo), const DLT_CHDLC = 104 +pkg syscall (freebsd-386-cgo), const DLT_CISCO_IOS = 118 +pkg syscall (freebsd-386-cgo), const DLT_C_HDLC = 104 +pkg syscall (freebsd-386-cgo), const DLT_C_HDLC_WITH_DIR = 205 +pkg syscall (freebsd-386-cgo), const DLT_DBUS = 231 +pkg syscall (freebsd-386-cgo), const DLT_DECT = 221 +pkg syscall (freebsd-386-cgo), const DLT_DOCSIS = 143 +pkg syscall (freebsd-386-cgo), const DLT_DVB_CI = 235 +pkg syscall (freebsd-386-cgo), const DLT_ECONET = 115 +pkg syscall (freebsd-386-cgo), const DLT_EN10MB = 1 +pkg syscall (freebsd-386-cgo), const DLT_EN3MB = 2 +pkg syscall (freebsd-386-cgo), const DLT_ENC = 109 +pkg syscall (freebsd-386-cgo), const DLT_ERF = 197 +pkg syscall (freebsd-386-cgo), const DLT_ERF_ETH = 175 +pkg syscall (freebsd-386-cgo), const DLT_ERF_POS = 176 +pkg syscall (freebsd-386-cgo), const DLT_FC_2 = 224 +pkg syscall (freebsd-386-cgo), const DLT_FC_2_WITH_FRAME_DELIMS = 225 +pkg syscall (freebsd-386-cgo), const DLT_FDDI = 10 +pkg syscall (freebsd-386-cgo), const DLT_FLEXRAY = 210 +pkg syscall (freebsd-386-cgo), const DLT_FRELAY = 107 +pkg syscall (freebsd-386-cgo), const DLT_FRELAY_WITH_DIR = 206 +pkg syscall (freebsd-386-cgo), const DLT_GCOM_SERIAL = 173 +pkg syscall (freebsd-386-cgo), const DLT_GCOM_T1E1 = 172 +pkg syscall (freebsd-386-cgo), const DLT_GPF_F = 171 +pkg syscall (freebsd-386-cgo), const DLT_GPF_T = 170 +pkg syscall (freebsd-386-cgo), const DLT_GPRS_LLC = 169 +pkg syscall (freebsd-386-cgo), const DLT_GSMTAP_ABIS = 218 +pkg syscall (freebsd-386-cgo), const DLT_GSMTAP_UM = 217 +pkg syscall (freebsd-386-cgo), const DLT_HHDLC = 121 +pkg syscall (freebsd-386-cgo), const DLT_IBM_SN = 146 +pkg syscall (freebsd-386-cgo), const DLT_IBM_SP = 145 +pkg syscall (freebsd-386-cgo), const DLT_IEEE802 = 6 +pkg syscall (freebsd-386-cgo), const DLT_IEEE802_11 = 105 +pkg syscall (freebsd-386-cgo), const DLT_IEEE802_11_RADIO = 127 +pkg syscall (freebsd-386-cgo), const DLT_IEEE802_11_RADIO_AVS = 163 +pkg syscall (freebsd-386-cgo), const DLT_IEEE802_15_4 = 195 +pkg syscall (freebsd-386-cgo), const DLT_IEEE802_15_4_LINUX = 191 +pkg syscall (freebsd-386-cgo), const DLT_IEEE802_15_4_NOFCS = 230 +pkg syscall (freebsd-386-cgo), const DLT_IEEE802_15_4_NONASK_PHY = 215 +pkg syscall (freebsd-386-cgo), const DLT_IEEE802_16_MAC_CPS = 188 +pkg syscall (freebsd-386-cgo), const DLT_IEEE802_16_MAC_CPS_RADIO = 193 +pkg syscall (freebsd-386-cgo), const DLT_IPFILTER = 116 +pkg syscall (freebsd-386-cgo), const DLT_IPMB = 199 +pkg syscall (freebsd-386-cgo), const DLT_IPMB_LINUX = 209 +pkg syscall (freebsd-386-cgo), const DLT_IPNET = 226 +pkg syscall (freebsd-386-cgo), const DLT_IPOIB = 242 +pkg syscall (freebsd-386-cgo), const DLT_IPV4 = 228 +pkg syscall (freebsd-386-cgo), const DLT_IPV6 = 229 +pkg syscall (freebsd-386-cgo), const DLT_IP_OVER_FC = 122 +pkg syscall (freebsd-386-cgo), const DLT_JUNIPER_ATM1 = 137 +pkg syscall (freebsd-386-cgo), const DLT_JUNIPER_ATM2 = 135 +pkg syscall (freebsd-386-cgo), const DLT_JUNIPER_ATM_CEMIC = 238 +pkg syscall (freebsd-386-cgo), const DLT_JUNIPER_CHDLC = 181 +pkg syscall (freebsd-386-cgo), const DLT_JUNIPER_ES = 132 +pkg syscall (freebsd-386-cgo), const DLT_JUNIPER_ETHER = 178 +pkg syscall (freebsd-386-cgo), const DLT_JUNIPER_FIBRECHANNEL = 234 +pkg syscall (freebsd-386-cgo), const DLT_JUNIPER_FRELAY = 180 +pkg syscall (freebsd-386-cgo), const DLT_JUNIPER_GGSN = 133 +pkg syscall (freebsd-386-cgo), const DLT_JUNIPER_ISM = 194 +pkg syscall (freebsd-386-cgo), const DLT_JUNIPER_MFR = 134 +pkg syscall (freebsd-386-cgo), const DLT_JUNIPER_MLFR = 131 +pkg syscall (freebsd-386-cgo), const DLT_JUNIPER_MLPPP = 130 +pkg syscall (freebsd-386-cgo), const DLT_JUNIPER_MONITOR = 164 +pkg syscall (freebsd-386-cgo), const DLT_JUNIPER_PIC_PEER = 174 +pkg syscall (freebsd-386-cgo), const DLT_JUNIPER_PPP = 179 +pkg syscall (freebsd-386-cgo), const DLT_JUNIPER_PPPOE = 167 +pkg syscall (freebsd-386-cgo), const DLT_JUNIPER_PPPOE_ATM = 168 +pkg syscall (freebsd-386-cgo), const DLT_JUNIPER_SERVICES = 136 +pkg syscall (freebsd-386-cgo), const DLT_JUNIPER_SRX_E2E = 233 +pkg syscall (freebsd-386-cgo), const DLT_JUNIPER_ST = 200 +pkg syscall (freebsd-386-cgo), const DLT_JUNIPER_VP = 183 +pkg syscall (freebsd-386-cgo), const DLT_JUNIPER_VS = 232 +pkg syscall (freebsd-386-cgo), const DLT_LAPB_WITH_DIR = 207 +pkg syscall (freebsd-386-cgo), const DLT_LAPD = 203 +pkg syscall (freebsd-386-cgo), const DLT_LIN = 212 +pkg syscall (freebsd-386-cgo), const DLT_LINUX_EVDEV = 216 +pkg syscall (freebsd-386-cgo), const DLT_LINUX_IRDA = 144 +pkg syscall (freebsd-386-cgo), const DLT_LINUX_LAPD = 177 +pkg syscall (freebsd-386-cgo), const DLT_LINUX_PPP_WITHDIRECTION = 166 +pkg syscall (freebsd-386-cgo), const DLT_LINUX_SLL = 113 +pkg syscall (freebsd-386-cgo), const DLT_LOOP = 108 +pkg syscall (freebsd-386-cgo), const DLT_LTALK = 114 +pkg syscall (freebsd-386-cgo), const DLT_MATCHING_MAX = 242 +pkg syscall (freebsd-386-cgo), const DLT_MATCHING_MIN = 104 +pkg syscall (freebsd-386-cgo), const DLT_MFR = 182 +pkg syscall (freebsd-386-cgo), const DLT_MOST = 211 +pkg syscall (freebsd-386-cgo), const DLT_MPLS = 219 +pkg syscall (freebsd-386-cgo), const DLT_MTP2 = 140 +pkg syscall (freebsd-386-cgo), const DLT_MTP2_WITH_PHDR = 139 +pkg syscall (freebsd-386-cgo), const DLT_MTP3 = 141 +pkg syscall (freebsd-386-cgo), const DLT_MUX27010 = 236 +pkg syscall (freebsd-386-cgo), const DLT_NETANALYZER = 240 +pkg syscall (freebsd-386-cgo), const DLT_NETANALYZER_TRANSPARENT = 241 +pkg syscall (freebsd-386-cgo), const DLT_NFLOG = 239 +pkg syscall (freebsd-386-cgo), const DLT_NULL = 0 +pkg syscall (freebsd-386-cgo), const DLT_PCI_EXP = 125 +pkg syscall (freebsd-386-cgo), const DLT_PFLOG = 117 +pkg syscall (freebsd-386-cgo), const DLT_PFSYNC = 121 +pkg syscall (freebsd-386-cgo), const DLT_PPI = 192 +pkg syscall (freebsd-386-cgo), const DLT_PPP = 9 +pkg syscall (freebsd-386-cgo), const DLT_PPP_BSDOS = 16 +pkg syscall (freebsd-386-cgo), const DLT_PPP_ETHER = 51 +pkg syscall (freebsd-386-cgo), const DLT_PPP_PPPD = 166 +pkg syscall (freebsd-386-cgo), const DLT_PPP_SERIAL = 50 +pkg syscall (freebsd-386-cgo), const DLT_PPP_WITH_DIR = 204 +pkg syscall (freebsd-386-cgo), const DLT_PPP_WITH_DIRECTION = 166 +pkg syscall (freebsd-386-cgo), const DLT_PRISM_HEADER = 119 +pkg syscall (freebsd-386-cgo), const DLT_PRONET = 4 +pkg syscall (freebsd-386-cgo), const DLT_RAIF1 = 198 +pkg syscall (freebsd-386-cgo), const DLT_RAW = 12 +pkg syscall (freebsd-386-cgo), const DLT_RIO = 124 +pkg syscall (freebsd-386-cgo), const DLT_SCCP = 142 +pkg syscall (freebsd-386-cgo), const DLT_SITA = 196 +pkg syscall (freebsd-386-cgo), const DLT_SLIP = 8 +pkg syscall (freebsd-386-cgo), const DLT_SLIP_BSDOS = 15 +pkg syscall (freebsd-386-cgo), const DLT_STANAG_5066_D_PDU = 237 +pkg syscall (freebsd-386-cgo), const DLT_SUNATM = 123 +pkg syscall (freebsd-386-cgo), const DLT_SYMANTEC_FIREWALL = 99 +pkg syscall (freebsd-386-cgo), const DLT_TZSP = 128 +pkg syscall (freebsd-386-cgo), const DLT_USB = 186 +pkg syscall (freebsd-386-cgo), const DLT_USB_LINUX = 189 +pkg syscall (freebsd-386-cgo), const DLT_USB_LINUX_MMAPPED = 220 +pkg syscall (freebsd-386-cgo), const DLT_USER0 = 147 +pkg syscall (freebsd-386-cgo), const DLT_USER1 = 148 +pkg syscall (freebsd-386-cgo), const DLT_USER10 = 157 +pkg syscall (freebsd-386-cgo), const DLT_USER11 = 158 +pkg syscall (freebsd-386-cgo), const DLT_USER12 = 159 +pkg syscall (freebsd-386-cgo), const DLT_USER13 = 160 +pkg syscall (freebsd-386-cgo), const DLT_USER14 = 161 +pkg syscall (freebsd-386-cgo), const DLT_USER15 = 162 +pkg syscall (freebsd-386-cgo), const DLT_USER2 = 149 +pkg syscall (freebsd-386-cgo), const DLT_USER3 = 150 +pkg syscall (freebsd-386-cgo), const DLT_USER4 = 151 +pkg syscall (freebsd-386-cgo), const DLT_USER5 = 152 +pkg syscall (freebsd-386-cgo), const DLT_USER6 = 153 +pkg syscall (freebsd-386-cgo), const DLT_USER7 = 154 +pkg syscall (freebsd-386-cgo), const DLT_USER8 = 155 +pkg syscall (freebsd-386-cgo), const DLT_USER9 = 156 +pkg syscall (freebsd-386-cgo), const DLT_WIHART = 223 +pkg syscall (freebsd-386-cgo), const DLT_X2E_SERIAL = 213 +pkg syscall (freebsd-386-cgo), const DLT_X2E_XORAYA = 214 +pkg syscall (freebsd-386-cgo), const DT_BLK = 6 +pkg syscall (freebsd-386-cgo), const DT_CHR = 2 +pkg syscall (freebsd-386-cgo), const DT_DIR = 4 +pkg syscall (freebsd-386-cgo), const DT_FIFO = 1 +pkg syscall (freebsd-386-cgo), const DT_LNK = 10 +pkg syscall (freebsd-386-cgo), const DT_REG = 8 +pkg syscall (freebsd-386-cgo), const DT_SOCK = 12 +pkg syscall (freebsd-386-cgo), const DT_UNKNOWN = 0 +pkg syscall (freebsd-386-cgo), const DT_WHT = 14 +pkg syscall (freebsd-386-cgo), const E2BIG = 7 +pkg syscall (freebsd-386-cgo), const EACCES = 13 +pkg syscall (freebsd-386-cgo), const EADDRINUSE = 48 +pkg syscall (freebsd-386-cgo), const EADDRNOTAVAIL = 49 +pkg syscall (freebsd-386-cgo), const EAFNOSUPPORT = 47 +pkg syscall (freebsd-386-cgo), const EAGAIN = 35 +pkg syscall (freebsd-386-cgo), const EALREADY = 37 +pkg syscall (freebsd-386-cgo), const EAUTH = 80 +pkg syscall (freebsd-386-cgo), const EBADF = 9 +pkg syscall (freebsd-386-cgo), const EBADMSG = 89 +pkg syscall (freebsd-386-cgo), const EBADRPC = 72 +pkg syscall (freebsd-386-cgo), const EBUSY = 16 +pkg syscall (freebsd-386-cgo), const ECANCELED = 85 +pkg syscall (freebsd-386-cgo), const ECAPMODE = 94 +pkg syscall (freebsd-386-cgo), const ECHILD = 10 +pkg syscall (freebsd-386-cgo), const ECHO = 8 +pkg syscall (freebsd-386-cgo), const ECHOCTL = 64 +pkg syscall (freebsd-386-cgo), const ECHOE = 2 +pkg syscall (freebsd-386-cgo), const ECHOK = 4 +pkg syscall (freebsd-386-cgo), const ECHOKE = 1 +pkg syscall (freebsd-386-cgo), const ECHONL = 16 +pkg syscall (freebsd-386-cgo), const ECHOPRT = 32 +pkg syscall (freebsd-386-cgo), const ECONNABORTED = 53 +pkg syscall (freebsd-386-cgo), const ECONNREFUSED = 61 +pkg syscall (freebsd-386-cgo), const ECONNRESET = 54 +pkg syscall (freebsd-386-cgo), const EDEADLK = 11 +pkg syscall (freebsd-386-cgo), const EDESTADDRREQ = 39 +pkg syscall (freebsd-386-cgo), const EDOM = 33 +pkg syscall (freebsd-386-cgo), const EDOOFUS = 88 +pkg syscall (freebsd-386-cgo), const EDQUOT = 69 +pkg syscall (freebsd-386-cgo), const EEXIST = 17 +pkg syscall (freebsd-386-cgo), const EFAULT = 14 +pkg syscall (freebsd-386-cgo), const EFBIG = 27 +pkg syscall (freebsd-386-cgo), const EFTYPE = 79 +pkg syscall (freebsd-386-cgo), const EHOSTDOWN = 64 +pkg syscall (freebsd-386-cgo), const EHOSTUNREACH = 65 +pkg syscall (freebsd-386-cgo), const EIDRM = 82 +pkg syscall (freebsd-386-cgo), const EILSEQ = 86 +pkg syscall (freebsd-386-cgo), const EINPROGRESS = 36 +pkg syscall (freebsd-386-cgo), const EINTR = 4 +pkg syscall (freebsd-386-cgo), const EINVAL = 22 +pkg syscall (freebsd-386-cgo), const EIO = 5 +pkg syscall (freebsd-386-cgo), const EISCONN = 56 +pkg syscall (freebsd-386-cgo), const EISDIR = 21 +pkg syscall (freebsd-386-cgo), const ELAST = 94 +pkg syscall (freebsd-386-cgo), const ELOOP = 62 +pkg syscall (freebsd-386-cgo), const EMFILE = 24 +pkg syscall (freebsd-386-cgo), const EMLINK = 31 +pkg syscall (freebsd-386-cgo), const EMSGSIZE = 40 +pkg syscall (freebsd-386-cgo), const EMULTIHOP = 90 +pkg syscall (freebsd-386-cgo), const ENAMETOOLONG = 63 +pkg syscall (freebsd-386-cgo), const ENEEDAUTH = 81 +pkg syscall (freebsd-386-cgo), const ENETDOWN = 50 +pkg syscall (freebsd-386-cgo), const ENETRESET = 52 +pkg syscall (freebsd-386-cgo), const ENETUNREACH = 51 +pkg syscall (freebsd-386-cgo), const ENFILE = 23 +pkg syscall (freebsd-386-cgo), const ENOATTR = 87 +pkg syscall (freebsd-386-cgo), const ENOBUFS = 55 +pkg syscall (freebsd-386-cgo), const ENODEV = 19 +pkg syscall (freebsd-386-cgo), const ENOEXEC = 8 +pkg syscall (freebsd-386-cgo), const ENOLCK = 77 +pkg syscall (freebsd-386-cgo), const ENOLINK = 91 +pkg syscall (freebsd-386-cgo), const ENOMEM = 12 +pkg syscall (freebsd-386-cgo), const ENOMSG = 83 +pkg syscall (freebsd-386-cgo), const ENOPROTOOPT = 42 +pkg syscall (freebsd-386-cgo), const ENOSPC = 28 +pkg syscall (freebsd-386-cgo), const ENOSYS = 78 +pkg syscall (freebsd-386-cgo), const ENOTBLK = 15 +pkg syscall (freebsd-386-cgo), const ENOTCAPABLE = 93 +pkg syscall (freebsd-386-cgo), const ENOTCONN = 57 +pkg syscall (freebsd-386-cgo), const ENOTDIR = 20 +pkg syscall (freebsd-386-cgo), const ENOTEMPTY = 66 +pkg syscall (freebsd-386-cgo), const ENOTSOCK = 38 +pkg syscall (freebsd-386-cgo), const ENOTSUP = 45 +pkg syscall (freebsd-386-cgo), const ENOTTY = 25 +pkg syscall (freebsd-386-cgo), const ENXIO = 6 +pkg syscall (freebsd-386-cgo), const EOPNOTSUPP = 45 +pkg syscall (freebsd-386-cgo), const EOVERFLOW = 84 +pkg syscall (freebsd-386-cgo), const EPERM = 1 +pkg syscall (freebsd-386-cgo), const EPFNOSUPPORT = 46 +pkg syscall (freebsd-386-cgo), const EPIPE = 32 +pkg syscall (freebsd-386-cgo), const EPROCLIM = 67 +pkg syscall (freebsd-386-cgo), const EPROCUNAVAIL = 76 +pkg syscall (freebsd-386-cgo), const EPROGMISMATCH = 75 +pkg syscall (freebsd-386-cgo), const EPROGUNAVAIL = 74 +pkg syscall (freebsd-386-cgo), const EPROTO = 92 +pkg syscall (freebsd-386-cgo), const EPROTONOSUPPORT = 43 +pkg syscall (freebsd-386-cgo), const EPROTOTYPE = 41 +pkg syscall (freebsd-386-cgo), const ERANGE = 34 +pkg syscall (freebsd-386-cgo), const EREMOTE = 71 +pkg syscall (freebsd-386-cgo), const EROFS = 30 +pkg syscall (freebsd-386-cgo), const ERPCMISMATCH = 73 +pkg syscall (freebsd-386-cgo), const ESHUTDOWN = 58 +pkg syscall (freebsd-386-cgo), const ESOCKTNOSUPPORT = 44 +pkg syscall (freebsd-386-cgo), const ESPIPE = 29 +pkg syscall (freebsd-386-cgo), const ESRCH = 3 +pkg syscall (freebsd-386-cgo), const ESTALE = 70 +pkg syscall (freebsd-386-cgo), const ETIMEDOUT = 60 +pkg syscall (freebsd-386-cgo), const ETOOMANYREFS = 59 +pkg syscall (freebsd-386-cgo), const ETXTBSY = 26 +pkg syscall (freebsd-386-cgo), const EUSERS = 68 +pkg syscall (freebsd-386-cgo), const EVFILT_AIO = -3 +pkg syscall (freebsd-386-cgo), const EVFILT_FS = -9 +pkg syscall (freebsd-386-cgo), const EVFILT_LIO = -10 +pkg syscall (freebsd-386-cgo), const EVFILT_PROC = -5 +pkg syscall (freebsd-386-cgo), const EVFILT_READ = -1 +pkg syscall (freebsd-386-cgo), const EVFILT_SIGNAL = -6 +pkg syscall (freebsd-386-cgo), const EVFILT_SYSCOUNT = 11 +pkg syscall (freebsd-386-cgo), const EVFILT_TIMER = -7 +pkg syscall (freebsd-386-cgo), const EVFILT_USER = -11 +pkg syscall (freebsd-386-cgo), const EVFILT_VNODE = -4 +pkg syscall (freebsd-386-cgo), const EVFILT_WRITE = -2 +pkg syscall (freebsd-386-cgo), const EV_ADD = 1 +pkg syscall (freebsd-386-cgo), const EV_CLEAR = 32 +pkg syscall (freebsd-386-cgo), const EV_DELETE = 2 +pkg syscall (freebsd-386-cgo), const EV_DISABLE = 8 +pkg syscall (freebsd-386-cgo), const EV_DISPATCH = 128 +pkg syscall (freebsd-386-cgo), const EV_ENABLE = 4 +pkg syscall (freebsd-386-cgo), const EV_EOF = 32768 +pkg syscall (freebsd-386-cgo), const EV_ERROR = 16384 +pkg syscall (freebsd-386-cgo), const EV_FLAG1 = 8192 +pkg syscall (freebsd-386-cgo), const EV_ONESHOT = 16 +pkg syscall (freebsd-386-cgo), const EV_RECEIPT = 64 +pkg syscall (freebsd-386-cgo), const EV_SYSFLAGS = 61440 +pkg syscall (freebsd-386-cgo), const EWOULDBLOCK = 35 +pkg syscall (freebsd-386-cgo), const EXDEV = 18 +pkg syscall (freebsd-386-cgo), const EXTA = 19200 +pkg syscall (freebsd-386-cgo), const EXTB = 38400 +pkg syscall (freebsd-386-cgo), const EXTPROC = 2048 +pkg syscall (freebsd-386-cgo), const FD_CLOEXEC = 1 +pkg syscall (freebsd-386-cgo), const FD_SETSIZE = 1024 +pkg syscall (freebsd-386-cgo), const FLUSHO = 8388608 +pkg syscall (freebsd-386-cgo), const F_CANCEL = 5 +pkg syscall (freebsd-386-cgo), const F_DUP2FD = 10 +pkg syscall (freebsd-386-cgo), const F_DUPFD = 0 +pkg syscall (freebsd-386-cgo), const F_GETFD = 1 +pkg syscall (freebsd-386-cgo), const F_GETFL = 3 +pkg syscall (freebsd-386-cgo), const F_GETLK = 11 +pkg syscall (freebsd-386-cgo), const F_GETOWN = 5 +pkg syscall (freebsd-386-cgo), const F_OGETLK = 7 +pkg syscall (freebsd-386-cgo), const F_OK = 0 +pkg syscall (freebsd-386-cgo), const F_OSETLK = 8 +pkg syscall (freebsd-386-cgo), const F_OSETLKW = 9 +pkg syscall (freebsd-386-cgo), const F_RDAHEAD = 16 +pkg syscall (freebsd-386-cgo), const F_RDLCK = 1 +pkg syscall (freebsd-386-cgo), const F_READAHEAD = 15 +pkg syscall (freebsd-386-cgo), const F_SETFD = 2 +pkg syscall (freebsd-386-cgo), const F_SETFL = 4 +pkg syscall (freebsd-386-cgo), const F_SETLK = 12 +pkg syscall (freebsd-386-cgo), const F_SETLKW = 13 +pkg syscall (freebsd-386-cgo), const F_SETLK_REMOTE = 14 +pkg syscall (freebsd-386-cgo), const F_SETOWN = 6 +pkg syscall (freebsd-386-cgo), const F_UNLCK = 2 +pkg syscall (freebsd-386-cgo), const F_UNLCKSYS = 4 +pkg syscall (freebsd-386-cgo), const F_WRLCK = 3 +pkg syscall (freebsd-386-cgo), const HUPCL = 16384 +pkg syscall (freebsd-386-cgo), const ICANON = 256 +pkg syscall (freebsd-386-cgo), const ICRNL = 256 +pkg syscall (freebsd-386-cgo), const IEXTEN = 1024 +pkg syscall (freebsd-386-cgo), const IFAN_ARRIVAL = 0 +pkg syscall (freebsd-386-cgo), const IFAN_DEPARTURE = 1 +pkg syscall (freebsd-386-cgo), const IFF_ALLMULTI = 512 +pkg syscall (freebsd-386-cgo), const IFF_ALTPHYS = 16384 +pkg syscall (freebsd-386-cgo), const IFF_CANTCHANGE = 2199410 +pkg syscall (freebsd-386-cgo), const IFF_CANTCONFIG = 65536 +pkg syscall (freebsd-386-cgo), const IFF_DEBUG = 4 +pkg syscall (freebsd-386-cgo), const IFF_DRV_OACTIVE = 1024 +pkg syscall (freebsd-386-cgo), const IFF_DRV_RUNNING = 64 +pkg syscall (freebsd-386-cgo), const IFF_DYING = 2097152 +pkg syscall (freebsd-386-cgo), const IFF_LINK0 = 4096 +pkg syscall (freebsd-386-cgo), const IFF_LINK1 = 8192 +pkg syscall (freebsd-386-cgo), const IFF_LINK2 = 16384 +pkg syscall (freebsd-386-cgo), const IFF_LOOPBACK = 8 +pkg syscall (freebsd-386-cgo), const IFF_MONITOR = 262144 +pkg syscall (freebsd-386-cgo), const IFF_MULTICAST = 32768 +pkg syscall (freebsd-386-cgo), const IFF_NOARP = 128 +pkg syscall (freebsd-386-cgo), const IFF_OACTIVE = 1024 +pkg syscall (freebsd-386-cgo), const IFF_POINTOPOINT = 16 +pkg syscall (freebsd-386-cgo), const IFF_PPROMISC = 131072 +pkg syscall (freebsd-386-cgo), const IFF_PROMISC = 256 +pkg syscall (freebsd-386-cgo), const IFF_RENAMING = 4194304 +pkg syscall (freebsd-386-cgo), const IFF_RUNNING = 64 +pkg syscall (freebsd-386-cgo), const IFF_SIMPLEX = 2048 +pkg syscall (freebsd-386-cgo), const IFF_SMART = 32 +pkg syscall (freebsd-386-cgo), const IFF_STATICARP = 524288 +pkg syscall (freebsd-386-cgo), const IFNAMSIZ = 16 +pkg syscall (freebsd-386-cgo), const IFT_1822 = 2 +pkg syscall (freebsd-386-cgo), const IFT_A12MPPSWITCH = 130 +pkg syscall (freebsd-386-cgo), const IFT_AAL2 = 187 +pkg syscall (freebsd-386-cgo), const IFT_AAL5 = 49 +pkg syscall (freebsd-386-cgo), const IFT_ADSL = 94 +pkg syscall (freebsd-386-cgo), const IFT_AFLANE8023 = 59 +pkg syscall (freebsd-386-cgo), const IFT_AFLANE8025 = 60 +pkg syscall (freebsd-386-cgo), const IFT_ARAP = 88 +pkg syscall (freebsd-386-cgo), const IFT_ARCNET = 35 +pkg syscall (freebsd-386-cgo), const IFT_ARCNETPLUS = 36 +pkg syscall (freebsd-386-cgo), const IFT_ASYNC = 84 +pkg syscall (freebsd-386-cgo), const IFT_ATM = 37 +pkg syscall (freebsd-386-cgo), const IFT_ATMDXI = 105 +pkg syscall (freebsd-386-cgo), const IFT_ATMFUNI = 106 +pkg syscall (freebsd-386-cgo), const IFT_ATMIMA = 107 +pkg syscall (freebsd-386-cgo), const IFT_ATMLOGICAL = 80 +pkg syscall (freebsd-386-cgo), const IFT_ATMRADIO = 189 +pkg syscall (freebsd-386-cgo), const IFT_ATMSUBINTERFACE = 134 +pkg syscall (freebsd-386-cgo), const IFT_ATMVCIENDPT = 194 +pkg syscall (freebsd-386-cgo), const IFT_ATMVIRTUAL = 149 +pkg syscall (freebsd-386-cgo), const IFT_BGPPOLICYACCOUNTING = 162 +pkg syscall (freebsd-386-cgo), const IFT_BRIDGE = 209 +pkg syscall (freebsd-386-cgo), const IFT_BSC = 83 +pkg syscall (freebsd-386-cgo), const IFT_CARP = 248 +pkg syscall (freebsd-386-cgo), const IFT_CCTEMUL = 61 +pkg syscall (freebsd-386-cgo), const IFT_CEPT = 19 +pkg syscall (freebsd-386-cgo), const IFT_CES = 133 +pkg syscall (freebsd-386-cgo), const IFT_CHANNEL = 70 +pkg syscall (freebsd-386-cgo), const IFT_CNR = 85 +pkg syscall (freebsd-386-cgo), const IFT_COFFEE = 132 +pkg syscall (freebsd-386-cgo), const IFT_COMPOSITELINK = 155 +pkg syscall (freebsd-386-cgo), const IFT_DCN = 141 +pkg syscall (freebsd-386-cgo), const IFT_DIGITALPOWERLINE = 138 +pkg syscall (freebsd-386-cgo), const IFT_DIGITALWRAPPEROVERHEADCHANNEL = 186 +pkg syscall (freebsd-386-cgo), const IFT_DLSW = 74 +pkg syscall (freebsd-386-cgo), const IFT_DOCSCABLEDOWNSTREAM = 128 +pkg syscall (freebsd-386-cgo), const IFT_DOCSCABLEMACLAYER = 127 +pkg syscall (freebsd-386-cgo), const IFT_DOCSCABLEUPSTREAM = 129 +pkg syscall (freebsd-386-cgo), const IFT_DS0 = 81 +pkg syscall (freebsd-386-cgo), const IFT_DS0BUNDLE = 82 +pkg syscall (freebsd-386-cgo), const IFT_DS1FDL = 170 +pkg syscall (freebsd-386-cgo), const IFT_DS3 = 30 +pkg syscall (freebsd-386-cgo), const IFT_DTM = 140 +pkg syscall (freebsd-386-cgo), const IFT_DVBASILN = 172 +pkg syscall (freebsd-386-cgo), const IFT_DVBASIOUT = 173 +pkg syscall (freebsd-386-cgo), const IFT_DVBRCCDOWNSTREAM = 147 +pkg syscall (freebsd-386-cgo), const IFT_DVBRCCMACLAYER = 146 +pkg syscall (freebsd-386-cgo), const IFT_DVBRCCUPSTREAM = 148 +pkg syscall (freebsd-386-cgo), const IFT_ENC = 244 +pkg syscall (freebsd-386-cgo), const IFT_EON = 25 +pkg syscall (freebsd-386-cgo), const IFT_EPLRS = 87 +pkg syscall (freebsd-386-cgo), const IFT_ESCON = 73 +pkg syscall (freebsd-386-cgo), const IFT_ETHER = 6 +pkg syscall (freebsd-386-cgo), const IFT_FAITH = 242 +pkg syscall (freebsd-386-cgo), const IFT_FAST = 125 +pkg syscall (freebsd-386-cgo), const IFT_FASTETHER = 62 +pkg syscall (freebsd-386-cgo), const IFT_FASTETHERFX = 69 +pkg syscall (freebsd-386-cgo), const IFT_FDDI = 15 +pkg syscall (freebsd-386-cgo), const IFT_FIBRECHANNEL = 56 +pkg syscall (freebsd-386-cgo), const IFT_FRAMERELAYINTERCONNECT = 58 +pkg syscall (freebsd-386-cgo), const IFT_FRAMERELAYMPI = 92 +pkg syscall (freebsd-386-cgo), const IFT_FRDLCIENDPT = 193 +pkg syscall (freebsd-386-cgo), const IFT_FRELAY = 32 +pkg syscall (freebsd-386-cgo), const IFT_FRELAYDCE = 44 +pkg syscall (freebsd-386-cgo), const IFT_FRF16MFRBUNDLE = 163 +pkg syscall (freebsd-386-cgo), const IFT_FRFORWARD = 158 +pkg syscall (freebsd-386-cgo), const IFT_G703AT2MB = 67 +pkg syscall (freebsd-386-cgo), const IFT_G703AT64K = 66 +pkg syscall (freebsd-386-cgo), const IFT_GIF = 240 +pkg syscall (freebsd-386-cgo), const IFT_GIGABITETHERNET = 117 +pkg syscall (freebsd-386-cgo), const IFT_GR303IDT = 178 +pkg syscall (freebsd-386-cgo), const IFT_GR303RDT = 177 +pkg syscall (freebsd-386-cgo), const IFT_H323GATEKEEPER = 164 +pkg syscall (freebsd-386-cgo), const IFT_H323PROXY = 165 +pkg syscall (freebsd-386-cgo), const IFT_HDH1822 = 3 +pkg syscall (freebsd-386-cgo), const IFT_HDLC = 118 +pkg syscall (freebsd-386-cgo), const IFT_HDSL2 = 168 +pkg syscall (freebsd-386-cgo), const IFT_HIPERLAN2 = 183 +pkg syscall (freebsd-386-cgo), const IFT_HIPPI = 47 +pkg syscall (freebsd-386-cgo), const IFT_HIPPIINTERFACE = 57 +pkg syscall (freebsd-386-cgo), const IFT_HOSTPAD = 90 +pkg syscall (freebsd-386-cgo), const IFT_HSSI = 46 +pkg syscall (freebsd-386-cgo), const IFT_HY = 14 +pkg syscall (freebsd-386-cgo), const IFT_IBM370PARCHAN = 72 +pkg syscall (freebsd-386-cgo), const IFT_IDSL = 154 +pkg syscall (freebsd-386-cgo), const IFT_IEEE1394 = 144 +pkg syscall (freebsd-386-cgo), const IFT_IEEE80211 = 71 +pkg syscall (freebsd-386-cgo), const IFT_IEEE80212 = 55 +pkg syscall (freebsd-386-cgo), const IFT_IEEE8023ADLAG = 161 +pkg syscall (freebsd-386-cgo), const IFT_IFGSN = 145 +pkg syscall (freebsd-386-cgo), const IFT_IMT = 190 +pkg syscall (freebsd-386-cgo), const IFT_INFINIBAND = 199 +pkg syscall (freebsd-386-cgo), const IFT_INTERLEAVE = 124 +pkg syscall (freebsd-386-cgo), const IFT_IP = 126 +pkg syscall (freebsd-386-cgo), const IFT_IPFORWARD = 142 +pkg syscall (freebsd-386-cgo), const IFT_IPOVERATM = 114 +pkg syscall (freebsd-386-cgo), const IFT_IPOVERCDLC = 109 +pkg syscall (freebsd-386-cgo), const IFT_IPOVERCLAW = 110 +pkg syscall (freebsd-386-cgo), const IFT_IPSWITCH = 78 +pkg syscall (freebsd-386-cgo), const IFT_IPXIP = 249 +pkg syscall (freebsd-386-cgo), const IFT_ISDN = 63 +pkg syscall (freebsd-386-cgo), const IFT_ISDNBASIC = 20 +pkg syscall (freebsd-386-cgo), const IFT_ISDNPRIMARY = 21 +pkg syscall (freebsd-386-cgo), const IFT_ISDNS = 75 +pkg syscall (freebsd-386-cgo), const IFT_ISDNU = 76 +pkg syscall (freebsd-386-cgo), const IFT_ISO88022LLC = 41 +pkg syscall (freebsd-386-cgo), const IFT_ISO88023 = 7 +pkg syscall (freebsd-386-cgo), const IFT_ISO88024 = 8 +pkg syscall (freebsd-386-cgo), const IFT_ISO88025 = 9 +pkg syscall (freebsd-386-cgo), const IFT_ISO88025CRFPINT = 98 +pkg syscall (freebsd-386-cgo), const IFT_ISO88025DTR = 86 +pkg syscall (freebsd-386-cgo), const IFT_ISO88025FIBER = 115 +pkg syscall (freebsd-386-cgo), const IFT_ISO88026 = 10 +pkg syscall (freebsd-386-cgo), const IFT_ISUP = 179 +pkg syscall (freebsd-386-cgo), const IFT_L2VLAN = 135 +pkg syscall (freebsd-386-cgo), const IFT_L3IPVLAN = 136 +pkg syscall (freebsd-386-cgo), const IFT_L3IPXVLAN = 137 +pkg syscall (freebsd-386-cgo), const IFT_LAPB = 16 +pkg syscall (freebsd-386-cgo), const IFT_LAPD = 77 +pkg syscall (freebsd-386-cgo), const IFT_LAPF = 119 +pkg syscall (freebsd-386-cgo), const IFT_LOCALTALK = 42 +pkg syscall (freebsd-386-cgo), const IFT_LOOP = 24 +pkg syscall (freebsd-386-cgo), const IFT_MEDIAMAILOVERIP = 139 +pkg syscall (freebsd-386-cgo), const IFT_MFSIGLINK = 167 +pkg syscall (freebsd-386-cgo), const IFT_MIOX25 = 38 +pkg syscall (freebsd-386-cgo), const IFT_MODEM = 48 +pkg syscall (freebsd-386-cgo), const IFT_MPC = 113 +pkg syscall (freebsd-386-cgo), const IFT_MPLS = 166 +pkg syscall (freebsd-386-cgo), const IFT_MPLSTUNNEL = 150 +pkg syscall (freebsd-386-cgo), const IFT_MSDSL = 143 +pkg syscall (freebsd-386-cgo), const IFT_MVL = 191 +pkg syscall (freebsd-386-cgo), const IFT_MYRINET = 99 +pkg syscall (freebsd-386-cgo), const IFT_NFAS = 175 +pkg syscall (freebsd-386-cgo), const IFT_NSIP = 27 +pkg syscall (freebsd-386-cgo), const IFT_OPTICALCHANNEL = 195 +pkg syscall (freebsd-386-cgo), const IFT_OPTICALTRANSPORT = 196 +pkg syscall (freebsd-386-cgo), const IFT_OTHER = 1 +pkg syscall (freebsd-386-cgo), const IFT_P10 = 12 +pkg syscall (freebsd-386-cgo), const IFT_P80 = 13 +pkg syscall (freebsd-386-cgo), const IFT_PARA = 34 +pkg syscall (freebsd-386-cgo), const IFT_PFLOG = 246 +pkg syscall (freebsd-386-cgo), const IFT_PFSYNC = 247 +pkg syscall (freebsd-386-cgo), const IFT_PLC = 174 +pkg syscall (freebsd-386-cgo), const IFT_POS = 171 +pkg syscall (freebsd-386-cgo), const IFT_PPP = 23 +pkg syscall (freebsd-386-cgo), const IFT_PPPMULTILINKBUNDLE = 108 +pkg syscall (freebsd-386-cgo), const IFT_PROPBWAP2MP = 184 +pkg syscall (freebsd-386-cgo), const IFT_PROPCNLS = 89 +pkg syscall (freebsd-386-cgo), const IFT_PROPDOCSWIRELESSDOWNSTREAM = 181 +pkg syscall (freebsd-386-cgo), const IFT_PROPDOCSWIRELESSMACLAYER = 180 +pkg syscall (freebsd-386-cgo), const IFT_PROPDOCSWIRELESSUPSTREAM = 182 +pkg syscall (freebsd-386-cgo), const IFT_PROPMUX = 54 +pkg syscall (freebsd-386-cgo), const IFT_PROPVIRTUAL = 53 +pkg syscall (freebsd-386-cgo), const IFT_PROPWIRELESSP2P = 157 +pkg syscall (freebsd-386-cgo), const IFT_PTPSERIAL = 22 +pkg syscall (freebsd-386-cgo), const IFT_PVC = 241 +pkg syscall (freebsd-386-cgo), const IFT_QLLC = 68 +pkg syscall (freebsd-386-cgo), const IFT_RADIOMAC = 188 +pkg syscall (freebsd-386-cgo), const IFT_RADSL = 95 +pkg syscall (freebsd-386-cgo), const IFT_REACHDSL = 192 +pkg syscall (freebsd-386-cgo), const IFT_RFC1483 = 159 +pkg syscall (freebsd-386-cgo), const IFT_RS232 = 33 +pkg syscall (freebsd-386-cgo), const IFT_RSRB = 79 +pkg syscall (freebsd-386-cgo), const IFT_SDLC = 17 +pkg syscall (freebsd-386-cgo), const IFT_SDSL = 96 +pkg syscall (freebsd-386-cgo), const IFT_SHDSL = 169 +pkg syscall (freebsd-386-cgo), const IFT_SIP = 31 +pkg syscall (freebsd-386-cgo), const IFT_SLIP = 28 +pkg syscall (freebsd-386-cgo), const IFT_SMDSDXI = 43 +pkg syscall (freebsd-386-cgo), const IFT_SMDSICIP = 52 +pkg syscall (freebsd-386-cgo), const IFT_SONET = 39 +pkg syscall (freebsd-386-cgo), const IFT_SONETOVERHEADCHANNEL = 185 +pkg syscall (freebsd-386-cgo), const IFT_SONETPATH = 50 +pkg syscall (freebsd-386-cgo), const IFT_SONETVT = 51 +pkg syscall (freebsd-386-cgo), const IFT_SRP = 151 +pkg syscall (freebsd-386-cgo), const IFT_SS7SIGLINK = 156 +pkg syscall (freebsd-386-cgo), const IFT_STACKTOSTACK = 111 +pkg syscall (freebsd-386-cgo), const IFT_STARLAN = 11 +pkg syscall (freebsd-386-cgo), const IFT_STF = 215 +pkg syscall (freebsd-386-cgo), const IFT_T1 = 18 +pkg syscall (freebsd-386-cgo), const IFT_TDLC = 116 +pkg syscall (freebsd-386-cgo), const IFT_TERMPAD = 91 +pkg syscall (freebsd-386-cgo), const IFT_TR008 = 176 +pkg syscall (freebsd-386-cgo), const IFT_TRANSPHDLC = 123 +pkg syscall (freebsd-386-cgo), const IFT_TUNNEL = 131 +pkg syscall (freebsd-386-cgo), const IFT_ULTRA = 29 +pkg syscall (freebsd-386-cgo), const IFT_USB = 160 +pkg syscall (freebsd-386-cgo), const IFT_V11 = 64 +pkg syscall (freebsd-386-cgo), const IFT_V35 = 45 +pkg syscall (freebsd-386-cgo), const IFT_V36 = 65 +pkg syscall (freebsd-386-cgo), const IFT_V37 = 120 +pkg syscall (freebsd-386-cgo), const IFT_VDSL = 97 +pkg syscall (freebsd-386-cgo), const IFT_VIRTUALIPADDRESS = 112 +pkg syscall (freebsd-386-cgo), const IFT_VOICEEM = 100 +pkg syscall (freebsd-386-cgo), const IFT_VOICEENCAP = 103 +pkg syscall (freebsd-386-cgo), const IFT_VOICEFXO = 101 +pkg syscall (freebsd-386-cgo), const IFT_VOICEFXS = 102 +pkg syscall (freebsd-386-cgo), const IFT_VOICEOVERATM = 152 +pkg syscall (freebsd-386-cgo), const IFT_VOICEOVERFRAMERELAY = 153 +pkg syscall (freebsd-386-cgo), const IFT_VOICEOVERIP = 104 +pkg syscall (freebsd-386-cgo), const IFT_X213 = 93 +pkg syscall (freebsd-386-cgo), const IFT_X25 = 5 +pkg syscall (freebsd-386-cgo), const IFT_X25DDN = 4 +pkg syscall (freebsd-386-cgo), const IFT_X25HUNTGROUP = 122 +pkg syscall (freebsd-386-cgo), const IFT_X25MLP = 121 +pkg syscall (freebsd-386-cgo), const IFT_X25PLE = 40 +pkg syscall (freebsd-386-cgo), const IFT_XETHER = 26 +pkg syscall (freebsd-386-cgo), const IGNBRK = 1 +pkg syscall (freebsd-386-cgo), const IGNCR = 128 +pkg syscall (freebsd-386-cgo), const IGNPAR = 4 +pkg syscall (freebsd-386-cgo), const IMAXBEL = 8192 +pkg syscall (freebsd-386-cgo), const INLCR = 64 +pkg syscall (freebsd-386-cgo), const INPCK = 16 +pkg syscall (freebsd-386-cgo), const IN_CLASSA_HOST = 16777215 +pkg syscall (freebsd-386-cgo), const IN_CLASSA_MAX = 128 +pkg syscall (freebsd-386-cgo), const IN_CLASSA_NET = 4278190080 +pkg syscall (freebsd-386-cgo), const IN_CLASSA_NSHIFT = 24 +pkg syscall (freebsd-386-cgo), const IN_CLASSB_HOST = 65535 +pkg syscall (freebsd-386-cgo), const IN_CLASSB_MAX = 65536 +pkg syscall (freebsd-386-cgo), const IN_CLASSB_NET = 4294901760 +pkg syscall (freebsd-386-cgo), const IN_CLASSB_NSHIFT = 16 +pkg syscall (freebsd-386-cgo), const IN_CLASSC_HOST = 255 +pkg syscall (freebsd-386-cgo), const IN_CLASSC_NET = 4294967040 +pkg syscall (freebsd-386-cgo), const IN_CLASSC_NSHIFT = 8 +pkg syscall (freebsd-386-cgo), const IN_CLASSD_HOST = 268435455 +pkg syscall (freebsd-386-cgo), const IN_CLASSD_NET = 4026531840 +pkg syscall (freebsd-386-cgo), const IN_CLASSD_NSHIFT = 28 +pkg syscall (freebsd-386-cgo), const IN_LOOPBACKNET = 127 +pkg syscall (freebsd-386-cgo), const IN_RFC3021_MASK = 4294967294 +pkg syscall (freebsd-386-cgo), const IPPROTO_3PC = 34 +pkg syscall (freebsd-386-cgo), const IPPROTO_ADFS = 68 +pkg syscall (freebsd-386-cgo), const IPPROTO_AH = 51 +pkg syscall (freebsd-386-cgo), const IPPROTO_AHIP = 61 +pkg syscall (freebsd-386-cgo), const IPPROTO_APES = 99 +pkg syscall (freebsd-386-cgo), const IPPROTO_ARGUS = 13 +pkg syscall (freebsd-386-cgo), const IPPROTO_AX25 = 93 +pkg syscall (freebsd-386-cgo), const IPPROTO_BHA = 49 +pkg syscall (freebsd-386-cgo), const IPPROTO_BLT = 30 +pkg syscall (freebsd-386-cgo), const IPPROTO_BRSATMON = 76 +pkg syscall (freebsd-386-cgo), const IPPROTO_CARP = 112 +pkg syscall (freebsd-386-cgo), const IPPROTO_CFTP = 62 +pkg syscall (freebsd-386-cgo), const IPPROTO_CHAOS = 16 +pkg syscall (freebsd-386-cgo), const IPPROTO_CMTP = 38 +pkg syscall (freebsd-386-cgo), const IPPROTO_CPHB = 73 +pkg syscall (freebsd-386-cgo), const IPPROTO_CPNX = 72 +pkg syscall (freebsd-386-cgo), const IPPROTO_DDP = 37 +pkg syscall (freebsd-386-cgo), const IPPROTO_DGP = 86 +pkg syscall (freebsd-386-cgo), const IPPROTO_DIVERT = 258 +pkg syscall (freebsd-386-cgo), const IPPROTO_DONE = 257 +pkg syscall (freebsd-386-cgo), const IPPROTO_DSTOPTS = 60 +pkg syscall (freebsd-386-cgo), const IPPROTO_EGP = 8 +pkg syscall (freebsd-386-cgo), const IPPROTO_EMCON = 14 +pkg syscall (freebsd-386-cgo), const IPPROTO_ENCAP = 98 +pkg syscall (freebsd-386-cgo), const IPPROTO_EON = 80 +pkg syscall (freebsd-386-cgo), const IPPROTO_ESP = 50 +pkg syscall (freebsd-386-cgo), const IPPROTO_ETHERIP = 97 +pkg syscall (freebsd-386-cgo), const IPPROTO_FRAGMENT = 44 +pkg syscall (freebsd-386-cgo), const IPPROTO_GGP = 3 +pkg syscall (freebsd-386-cgo), const IPPROTO_GMTP = 100 +pkg syscall (freebsd-386-cgo), const IPPROTO_GRE = 47 +pkg syscall (freebsd-386-cgo), const IPPROTO_HELLO = 63 +pkg syscall (freebsd-386-cgo), const IPPROTO_HMP = 20 +pkg syscall (freebsd-386-cgo), const IPPROTO_HOPOPTS = 0 +pkg syscall (freebsd-386-cgo), const IPPROTO_ICMP = 1 +pkg syscall (freebsd-386-cgo), const IPPROTO_ICMPV6 = 58 +pkg syscall (freebsd-386-cgo), const IPPROTO_IDP = 22 +pkg syscall (freebsd-386-cgo), const IPPROTO_IDPR = 35 +pkg syscall (freebsd-386-cgo), const IPPROTO_IDRP = 45 +pkg syscall (freebsd-386-cgo), const IPPROTO_IGMP = 2 +pkg syscall (freebsd-386-cgo), const IPPROTO_IGP = 85 +pkg syscall (freebsd-386-cgo), const IPPROTO_IGRP = 88 +pkg syscall (freebsd-386-cgo), const IPPROTO_IL = 40 +pkg syscall (freebsd-386-cgo), const IPPROTO_INLSP = 52 +pkg syscall (freebsd-386-cgo), const IPPROTO_INP = 32 +pkg syscall (freebsd-386-cgo), const IPPROTO_IPCOMP = 108 +pkg syscall (freebsd-386-cgo), const IPPROTO_IPCV = 71 +pkg syscall (freebsd-386-cgo), const IPPROTO_IPEIP = 94 +pkg syscall (freebsd-386-cgo), const IPPROTO_IPIP = 4 +pkg syscall (freebsd-386-cgo), const IPPROTO_IPPC = 67 +pkg syscall (freebsd-386-cgo), const IPPROTO_IPV4 = 4 +pkg syscall (freebsd-386-cgo), const IPPROTO_IRTP = 28 +pkg syscall (freebsd-386-cgo), const IPPROTO_KRYPTOLAN = 65 +pkg syscall (freebsd-386-cgo), const IPPROTO_LARP = 91 +pkg syscall (freebsd-386-cgo), const IPPROTO_LEAF1 = 25 +pkg syscall (freebsd-386-cgo), const IPPROTO_LEAF2 = 26 +pkg syscall (freebsd-386-cgo), const IPPROTO_MAX = 256 +pkg syscall (freebsd-386-cgo), const IPPROTO_MAXID = 52 +pkg syscall (freebsd-386-cgo), const IPPROTO_MEAS = 19 +pkg syscall (freebsd-386-cgo), const IPPROTO_MH = 135 +pkg syscall (freebsd-386-cgo), const IPPROTO_MHRP = 48 +pkg syscall (freebsd-386-cgo), const IPPROTO_MICP = 95 +pkg syscall (freebsd-386-cgo), const IPPROTO_MOBILE = 55 +pkg syscall (freebsd-386-cgo), const IPPROTO_MTP = 92 +pkg syscall (freebsd-386-cgo), const IPPROTO_MUX = 18 +pkg syscall (freebsd-386-cgo), const IPPROTO_ND = 77 +pkg syscall (freebsd-386-cgo), const IPPROTO_NHRP = 54 +pkg syscall (freebsd-386-cgo), const IPPROTO_NONE = 59 +pkg syscall (freebsd-386-cgo), const IPPROTO_NSP = 31 +pkg syscall (freebsd-386-cgo), const IPPROTO_NVPII = 11 +pkg syscall (freebsd-386-cgo), const IPPROTO_OLD_DIVERT = 254 +pkg syscall (freebsd-386-cgo), const IPPROTO_OSPFIGP = 89 +pkg syscall (freebsd-386-cgo), const IPPROTO_PFSYNC = 240 +pkg syscall (freebsd-386-cgo), const IPPROTO_PGM = 113 +pkg syscall (freebsd-386-cgo), const IPPROTO_PIGP = 9 +pkg syscall (freebsd-386-cgo), const IPPROTO_PIM = 103 +pkg syscall (freebsd-386-cgo), const IPPROTO_PRM = 21 +pkg syscall (freebsd-386-cgo), const IPPROTO_PUP = 12 +pkg syscall (freebsd-386-cgo), const IPPROTO_PVP = 75 +pkg syscall (freebsd-386-cgo), const IPPROTO_RAW = 255 +pkg syscall (freebsd-386-cgo), const IPPROTO_RCCMON = 10 +pkg syscall (freebsd-386-cgo), const IPPROTO_RDP = 27 +pkg syscall (freebsd-386-cgo), const IPPROTO_ROUTING = 43 +pkg syscall (freebsd-386-cgo), const IPPROTO_RSVP = 46 +pkg syscall (freebsd-386-cgo), const IPPROTO_RVD = 66 +pkg syscall (freebsd-386-cgo), const IPPROTO_SATEXPAK = 64 +pkg syscall (freebsd-386-cgo), const IPPROTO_SATMON = 69 +pkg syscall (freebsd-386-cgo), const IPPROTO_SCCSP = 96 +pkg syscall (freebsd-386-cgo), const IPPROTO_SCTP = 132 +pkg syscall (freebsd-386-cgo), const IPPROTO_SDRP = 42 +pkg syscall (freebsd-386-cgo), const IPPROTO_SEND = 259 +pkg syscall (freebsd-386-cgo), const IPPROTO_SEP = 33 +pkg syscall (freebsd-386-cgo), const IPPROTO_SKIP = 57 +pkg syscall (freebsd-386-cgo), const IPPROTO_SPACER = 32767 +pkg syscall (freebsd-386-cgo), const IPPROTO_SRPC = 90 +pkg syscall (freebsd-386-cgo), const IPPROTO_ST = 7 +pkg syscall (freebsd-386-cgo), const IPPROTO_SVMTP = 82 +pkg syscall (freebsd-386-cgo), const IPPROTO_SWIPE = 53 +pkg syscall (freebsd-386-cgo), const IPPROTO_TCF = 87 +pkg syscall (freebsd-386-cgo), const IPPROTO_TLSP = 56 +pkg syscall (freebsd-386-cgo), const IPPROTO_TP = 29 +pkg syscall (freebsd-386-cgo), const IPPROTO_TPXX = 39 +pkg syscall (freebsd-386-cgo), const IPPROTO_TRUNK1 = 23 +pkg syscall (freebsd-386-cgo), const IPPROTO_TRUNK2 = 24 +pkg syscall (freebsd-386-cgo), const IPPROTO_TTP = 84 +pkg syscall (freebsd-386-cgo), const IPPROTO_VINES = 83 +pkg syscall (freebsd-386-cgo), const IPPROTO_VISA = 70 +pkg syscall (freebsd-386-cgo), const IPPROTO_VMTP = 81 +pkg syscall (freebsd-386-cgo), const IPPROTO_WBEXPAK = 79 +pkg syscall (freebsd-386-cgo), const IPPROTO_WBMON = 78 +pkg syscall (freebsd-386-cgo), const IPPROTO_WSN = 74 +pkg syscall (freebsd-386-cgo), const IPPROTO_XNET = 15 +pkg syscall (freebsd-386-cgo), const IPPROTO_XTP = 36 +pkg syscall (freebsd-386-cgo), const IPV6_AUTOFLOWLABEL = 59 +pkg syscall (freebsd-386-cgo), const IPV6_BINDANY = 64 +pkg syscall (freebsd-386-cgo), const IPV6_BINDV6ONLY = 27 +pkg syscall (freebsd-386-cgo), const IPV6_CHECKSUM = 26 +pkg syscall (freebsd-386-cgo), const IPV6_DEFAULT_MULTICAST_HOPS = 1 +pkg syscall (freebsd-386-cgo), const IPV6_DEFAULT_MULTICAST_LOOP = 1 +pkg syscall (freebsd-386-cgo), const IPV6_DEFHLIM = 64 +pkg syscall (freebsd-386-cgo), const IPV6_DONTFRAG = 62 +pkg syscall (freebsd-386-cgo), const IPV6_DSTOPTS = 50 +pkg syscall (freebsd-386-cgo), const IPV6_FAITH = 29 +pkg syscall (freebsd-386-cgo), const IPV6_FLOWINFO_MASK = 4294967055 +pkg syscall (freebsd-386-cgo), const IPV6_FLOWLABEL_MASK = 4294905600 +pkg syscall (freebsd-386-cgo), const IPV6_FRAGTTL = 120 +pkg syscall (freebsd-386-cgo), const IPV6_FW_ADD = 30 +pkg syscall (freebsd-386-cgo), const IPV6_FW_DEL = 31 +pkg syscall (freebsd-386-cgo), const IPV6_FW_FLUSH = 32 +pkg syscall (freebsd-386-cgo), const IPV6_FW_GET = 34 +pkg syscall (freebsd-386-cgo), const IPV6_FW_ZERO = 33 +pkg syscall (freebsd-386-cgo), const IPV6_HLIMDEC = 1 +pkg syscall (freebsd-386-cgo), const IPV6_HOPLIMIT = 47 +pkg syscall (freebsd-386-cgo), const IPV6_HOPOPTS = 49 +pkg syscall (freebsd-386-cgo), const IPV6_IPSEC_POLICY = 28 +pkg syscall (freebsd-386-cgo), const IPV6_JOIN_GROUP = 12 +pkg syscall (freebsd-386-cgo), const IPV6_LEAVE_GROUP = 13 +pkg syscall (freebsd-386-cgo), const IPV6_MAXHLIM = 255 +pkg syscall (freebsd-386-cgo), const IPV6_MAXOPTHDR = 2048 +pkg syscall (freebsd-386-cgo), const IPV6_MAXPACKET = 65535 +pkg syscall (freebsd-386-cgo), const IPV6_MAX_GROUP_SRC_FILTER = 512 +pkg syscall (freebsd-386-cgo), const IPV6_MAX_MEMBERSHIPS = 4095 +pkg syscall (freebsd-386-cgo), const IPV6_MAX_SOCK_SRC_FILTER = 128 +pkg syscall (freebsd-386-cgo), const IPV6_MIN_MEMBERSHIPS = 31 +pkg syscall (freebsd-386-cgo), const IPV6_MMTU = 1280 +pkg syscall (freebsd-386-cgo), const IPV6_MSFILTER = 74 +pkg syscall (freebsd-386-cgo), const IPV6_MULTICAST_HOPS = 10 +pkg syscall (freebsd-386-cgo), const IPV6_MULTICAST_IF = 9 +pkg syscall (freebsd-386-cgo), const IPV6_MULTICAST_LOOP = 11 +pkg syscall (freebsd-386-cgo), const IPV6_NEXTHOP = 48 +pkg syscall (freebsd-386-cgo), const IPV6_PATHMTU = 44 +pkg syscall (freebsd-386-cgo), const IPV6_PKTINFO = 46 +pkg syscall (freebsd-386-cgo), const IPV6_PORTRANGE = 14 +pkg syscall (freebsd-386-cgo), const IPV6_PORTRANGE_DEFAULT = 0 +pkg syscall (freebsd-386-cgo), const IPV6_PORTRANGE_HIGH = 1 +pkg syscall (freebsd-386-cgo), const IPV6_PORTRANGE_LOW = 2 +pkg syscall (freebsd-386-cgo), const IPV6_PREFER_TEMPADDR = 63 +pkg syscall (freebsd-386-cgo), const IPV6_RECVDSTOPTS = 40 +pkg syscall (freebsd-386-cgo), const IPV6_RECVHOPLIMIT = 37 +pkg syscall (freebsd-386-cgo), const IPV6_RECVHOPOPTS = 39 +pkg syscall (freebsd-386-cgo), const IPV6_RECVPATHMTU = 43 +pkg syscall (freebsd-386-cgo), const IPV6_RECVPKTINFO = 36 +pkg syscall (freebsd-386-cgo), const IPV6_RECVRTHDR = 38 +pkg syscall (freebsd-386-cgo), const IPV6_RECVTCLASS = 57 +pkg syscall (freebsd-386-cgo), const IPV6_RTHDR = 51 +pkg syscall (freebsd-386-cgo), const IPV6_RTHDRDSTOPTS = 35 +pkg syscall (freebsd-386-cgo), const IPV6_RTHDR_LOOSE = 0 +pkg syscall (freebsd-386-cgo), const IPV6_RTHDR_STRICT = 1 +pkg syscall (freebsd-386-cgo), const IPV6_RTHDR_TYPE_0 = 0 +pkg syscall (freebsd-386-cgo), const IPV6_SOCKOPT_RESERVED1 = 3 +pkg syscall (freebsd-386-cgo), const IPV6_TCLASS = 61 +pkg syscall (freebsd-386-cgo), const IPV6_UNICAST_HOPS = 4 +pkg syscall (freebsd-386-cgo), const IPV6_USE_MIN_MTU = 42 +pkg syscall (freebsd-386-cgo), const IPV6_V6ONLY = 27 +pkg syscall (freebsd-386-cgo), const IPV6_VERSION = 96 +pkg syscall (freebsd-386-cgo), const IPV6_VERSION_MASK = 240 +pkg syscall (freebsd-386-cgo), const IP_ADD_MEMBERSHIP = 12 +pkg syscall (freebsd-386-cgo), const IP_ADD_SOURCE_MEMBERSHIP = 70 +pkg syscall (freebsd-386-cgo), const IP_BINDANY = 24 +pkg syscall (freebsd-386-cgo), const IP_BLOCK_SOURCE = 72 +pkg syscall (freebsd-386-cgo), const IP_DEFAULT_MULTICAST_LOOP = 1 +pkg syscall (freebsd-386-cgo), const IP_DEFAULT_MULTICAST_TTL = 1 +pkg syscall (freebsd-386-cgo), const IP_DF = 16384 +pkg syscall (freebsd-386-cgo), const IP_DONTFRAG = 67 +pkg syscall (freebsd-386-cgo), const IP_DROP_MEMBERSHIP = 13 +pkg syscall (freebsd-386-cgo), const IP_DROP_SOURCE_MEMBERSHIP = 71 +pkg syscall (freebsd-386-cgo), const IP_DUMMYNET3 = 49 +pkg syscall (freebsd-386-cgo), const IP_DUMMYNET_CONFIGURE = 60 +pkg syscall (freebsd-386-cgo), const IP_DUMMYNET_DEL = 61 +pkg syscall (freebsd-386-cgo), const IP_DUMMYNET_FLUSH = 62 +pkg syscall (freebsd-386-cgo), const IP_DUMMYNET_GET = 64 +pkg syscall (freebsd-386-cgo), const IP_FAITH = 22 +pkg syscall (freebsd-386-cgo), const IP_FW3 = 48 +pkg syscall (freebsd-386-cgo), const IP_FW_ADD = 50 +pkg syscall (freebsd-386-cgo), const IP_FW_DEL = 51 +pkg syscall (freebsd-386-cgo), const IP_FW_FLUSH = 52 +pkg syscall (freebsd-386-cgo), const IP_FW_GET = 54 +pkg syscall (freebsd-386-cgo), const IP_FW_NAT_CFG = 56 +pkg syscall (freebsd-386-cgo), const IP_FW_NAT_DEL = 57 +pkg syscall (freebsd-386-cgo), const IP_FW_NAT_GET_CONFIG = 58 +pkg syscall (freebsd-386-cgo), const IP_FW_NAT_GET_LOG = 59 +pkg syscall (freebsd-386-cgo), const IP_FW_RESETLOG = 55 +pkg syscall (freebsd-386-cgo), const IP_FW_TABLE_ADD = 40 +pkg syscall (freebsd-386-cgo), const IP_FW_TABLE_DEL = 41 +pkg syscall (freebsd-386-cgo), const IP_FW_TABLE_FLUSH = 42 +pkg syscall (freebsd-386-cgo), const IP_FW_TABLE_GETSIZE = 43 +pkg syscall (freebsd-386-cgo), const IP_FW_TABLE_LIST = 44 +pkg syscall (freebsd-386-cgo), const IP_FW_ZERO = 53 +pkg syscall (freebsd-386-cgo), const IP_HDRINCL = 2 +pkg syscall (freebsd-386-cgo), const IP_IPSEC_POLICY = 21 +pkg syscall (freebsd-386-cgo), const IP_MAXPACKET = 65535 +pkg syscall (freebsd-386-cgo), const IP_MAX_GROUP_SRC_FILTER = 512 +pkg syscall (freebsd-386-cgo), const IP_MAX_MEMBERSHIPS = 4095 +pkg syscall (freebsd-386-cgo), const IP_MAX_SOCK_MUTE_FILTER = 128 +pkg syscall (freebsd-386-cgo), const IP_MAX_SOCK_SRC_FILTER = 128 +pkg syscall (freebsd-386-cgo), const IP_MAX_SOURCE_FILTER = 1024 +pkg syscall (freebsd-386-cgo), const IP_MF = 8192 +pkg syscall (freebsd-386-cgo), const IP_MINTTL = 66 +pkg syscall (freebsd-386-cgo), const IP_MIN_MEMBERSHIPS = 31 +pkg syscall (freebsd-386-cgo), const IP_MSFILTER = 74 +pkg syscall (freebsd-386-cgo), const IP_MSS = 576 +pkg syscall (freebsd-386-cgo), const IP_MULTICAST_IF = 9 +pkg syscall (freebsd-386-cgo), const IP_MULTICAST_LOOP = 11 +pkg syscall (freebsd-386-cgo), const IP_MULTICAST_TTL = 10 +pkg syscall (freebsd-386-cgo), const IP_MULTICAST_VIF = 14 +pkg syscall (freebsd-386-cgo), const IP_OFFMASK = 8191 +pkg syscall (freebsd-386-cgo), const IP_ONESBCAST = 23 +pkg syscall (freebsd-386-cgo), const IP_OPTIONS = 1 +pkg syscall (freebsd-386-cgo), const IP_PORTRANGE = 19 +pkg syscall (freebsd-386-cgo), const IP_PORTRANGE_DEFAULT = 0 +pkg syscall (freebsd-386-cgo), const IP_PORTRANGE_HIGH = 1 +pkg syscall (freebsd-386-cgo), const IP_PORTRANGE_LOW = 2 +pkg syscall (freebsd-386-cgo), const IP_RECVDSTADDR = 7 +pkg syscall (freebsd-386-cgo), const IP_RECVIF = 20 +pkg syscall (freebsd-386-cgo), const IP_RECVOPTS = 5 +pkg syscall (freebsd-386-cgo), const IP_RECVRETOPTS = 6 +pkg syscall (freebsd-386-cgo), const IP_RECVTOS = 68 +pkg syscall (freebsd-386-cgo), const IP_RECVTTL = 65 +pkg syscall (freebsd-386-cgo), const IP_RETOPTS = 8 +pkg syscall (freebsd-386-cgo), const IP_RF = 32768 +pkg syscall (freebsd-386-cgo), const IP_RSVP_OFF = 16 +pkg syscall (freebsd-386-cgo), const IP_RSVP_ON = 15 +pkg syscall (freebsd-386-cgo), const IP_RSVP_VIF_OFF = 18 +pkg syscall (freebsd-386-cgo), const IP_RSVP_VIF_ON = 17 +pkg syscall (freebsd-386-cgo), const IP_SENDSRCADDR = 7 +pkg syscall (freebsd-386-cgo), const IP_TOS = 3 +pkg syscall (freebsd-386-cgo), const IP_TTL = 4 +pkg syscall (freebsd-386-cgo), const IP_UNBLOCK_SOURCE = 73 +pkg syscall (freebsd-386-cgo), const ISIG = 128 +pkg syscall (freebsd-386-cgo), const ISTRIP = 32 +pkg syscall (freebsd-386-cgo), const IXANY = 2048 +pkg syscall (freebsd-386-cgo), const IXOFF = 1024 +pkg syscall (freebsd-386-cgo), const IXON = 512 +pkg syscall (freebsd-386-cgo), const ImplementsGetwd = false +pkg syscall (freebsd-386-cgo), const LOCK_EX = 2 +pkg syscall (freebsd-386-cgo), const LOCK_NB = 4 +pkg syscall (freebsd-386-cgo), const LOCK_SH = 1 +pkg syscall (freebsd-386-cgo), const LOCK_UN = 8 +pkg syscall (freebsd-386-cgo), const MADV_AUTOSYNC = 7 +pkg syscall (freebsd-386-cgo), const MADV_CORE = 9 +pkg syscall (freebsd-386-cgo), const MADV_DONTNEED = 4 +pkg syscall (freebsd-386-cgo), const MADV_FREE = 5 +pkg syscall (freebsd-386-cgo), const MADV_NOCORE = 8 +pkg syscall (freebsd-386-cgo), const MADV_NORMAL = 0 +pkg syscall (freebsd-386-cgo), const MADV_NOSYNC = 6 +pkg syscall (freebsd-386-cgo), const MADV_PROTECT = 10 +pkg syscall (freebsd-386-cgo), const MADV_RANDOM = 1 +pkg syscall (freebsd-386-cgo), const MADV_SEQUENTIAL = 2 +pkg syscall (freebsd-386-cgo), const MADV_WILLNEED = 3 +pkg syscall (freebsd-386-cgo), const MAP_ANON = 4096 +pkg syscall (freebsd-386-cgo), const MAP_ANONYMOUS = 4096 +pkg syscall (freebsd-386-cgo), const MAP_COPY = 2 +pkg syscall (freebsd-386-cgo), const MAP_FILE = 0 +pkg syscall (freebsd-386-cgo), const MAP_FIXED = 16 +pkg syscall (freebsd-386-cgo), const MAP_HASSEMAPHORE = 512 +pkg syscall (freebsd-386-cgo), const MAP_NOCORE = 131072 +pkg syscall (freebsd-386-cgo), const MAP_NORESERVE = 64 +pkg syscall (freebsd-386-cgo), const MAP_NOSYNC = 2048 +pkg syscall (freebsd-386-cgo), const MAP_PREFAULT_READ = 262144 +pkg syscall (freebsd-386-cgo), const MAP_PRIVATE = 2 +pkg syscall (freebsd-386-cgo), const MAP_RENAME = 32 +pkg syscall (freebsd-386-cgo), const MAP_RESERVED0080 = 128 +pkg syscall (freebsd-386-cgo), const MAP_RESERVED0100 = 256 +pkg syscall (freebsd-386-cgo), const MAP_SHARED = 1 +pkg syscall (freebsd-386-cgo), const MAP_STACK = 1024 +pkg syscall (freebsd-386-cgo), const MCL_CURRENT = 1 +pkg syscall (freebsd-386-cgo), const MCL_FUTURE = 2 +pkg syscall (freebsd-386-cgo), const MSG_COMPAT = 32768 +pkg syscall (freebsd-386-cgo), const MSG_CTRUNC = 32 +pkg syscall (freebsd-386-cgo), const MSG_DONTROUTE = 4 +pkg syscall (freebsd-386-cgo), const MSG_DONTWAIT = 128 +pkg syscall (freebsd-386-cgo), const MSG_EOF = 256 +pkg syscall (freebsd-386-cgo), const MSG_EOR = 8 +pkg syscall (freebsd-386-cgo), const MSG_NBIO = 16384 +pkg syscall (freebsd-386-cgo), const MSG_NOSIGNAL = 131072 +pkg syscall (freebsd-386-cgo), const MSG_NOTIFICATION = 8192 +pkg syscall (freebsd-386-cgo), const MSG_OOB = 1 +pkg syscall (freebsd-386-cgo), const MSG_PEEK = 2 +pkg syscall (freebsd-386-cgo), const MSG_TRUNC = 16 +pkg syscall (freebsd-386-cgo), const MSG_WAITALL = 64 +pkg syscall (freebsd-386-cgo), const MS_ASYNC = 1 +pkg syscall (freebsd-386-cgo), const MS_INVALIDATE = 2 +pkg syscall (freebsd-386-cgo), const MS_SYNC = 0 +pkg syscall (freebsd-386-cgo), const NET_RT_DUMP = 1 +pkg syscall (freebsd-386-cgo), const NET_RT_FLAGS = 2 +pkg syscall (freebsd-386-cgo), const NET_RT_IFLIST = 3 +pkg syscall (freebsd-386-cgo), const NET_RT_IFLISTL = 5 +pkg syscall (freebsd-386-cgo), const NET_RT_IFMALIST = 4 +pkg syscall (freebsd-386-cgo), const NET_RT_MAXID = 6 +pkg syscall (freebsd-386-cgo), const NOFLSH = 2147483648 +pkg syscall (freebsd-386-cgo), const NOTE_ATTRIB = 8 +pkg syscall (freebsd-386-cgo), const NOTE_CHILD = 4 +pkg syscall (freebsd-386-cgo), const NOTE_DELETE = 1 +pkg syscall (freebsd-386-cgo), const NOTE_EXEC = 536870912 +pkg syscall (freebsd-386-cgo), const NOTE_EXIT = 2147483648 +pkg syscall (freebsd-386-cgo), const NOTE_EXTEND = 4 +pkg syscall (freebsd-386-cgo), const NOTE_FFAND = 1073741824 +pkg syscall (freebsd-386-cgo), const NOTE_FFCOPY = 3221225472 +pkg syscall (freebsd-386-cgo), const NOTE_FFCTRLMASK = 3221225472 +pkg syscall (freebsd-386-cgo), const NOTE_FFLAGSMASK = 16777215 +pkg syscall (freebsd-386-cgo), const NOTE_FFNOP = 0 +pkg syscall (freebsd-386-cgo), const NOTE_FFOR = 2147483648 +pkg syscall (freebsd-386-cgo), const NOTE_FORK = 1073741824 +pkg syscall (freebsd-386-cgo), const NOTE_LINK = 16 +pkg syscall (freebsd-386-cgo), const NOTE_LOWAT = 1 +pkg syscall (freebsd-386-cgo), const NOTE_PCTRLMASK = 4026531840 +pkg syscall (freebsd-386-cgo), const NOTE_PDATAMASK = 1048575 +pkg syscall (freebsd-386-cgo), const NOTE_RENAME = 32 +pkg syscall (freebsd-386-cgo), const NOTE_REVOKE = 64 +pkg syscall (freebsd-386-cgo), const NOTE_TRACK = 1 +pkg syscall (freebsd-386-cgo), const NOTE_TRACKERR = 2 +pkg syscall (freebsd-386-cgo), const NOTE_TRIGGER = 16777216 +pkg syscall (freebsd-386-cgo), const NOTE_WRITE = 2 +pkg syscall (freebsd-386-cgo), const OCRNL = 16 +pkg syscall (freebsd-386-cgo), const ONLCR = 2 +pkg syscall (freebsd-386-cgo), const ONLRET = 64 +pkg syscall (freebsd-386-cgo), const ONOCR = 32 +pkg syscall (freebsd-386-cgo), const ONOEOT = 8 +pkg syscall (freebsd-386-cgo), const OPOST = 1 +pkg syscall (freebsd-386-cgo), const O_ACCMODE = 3 +pkg syscall (freebsd-386-cgo), const O_APPEND = 8 +pkg syscall (freebsd-386-cgo), const O_ASYNC = 64 +pkg syscall (freebsd-386-cgo), const O_CLOEXEC = 0 +pkg syscall (freebsd-386-cgo), const O_CREAT = 512 +pkg syscall (freebsd-386-cgo), const O_DIRECT = 65536 +pkg syscall (freebsd-386-cgo), const O_DIRECTORY = 131072 +pkg syscall (freebsd-386-cgo), const O_EXCL = 2048 +pkg syscall (freebsd-386-cgo), const O_EXEC = 262144 +pkg syscall (freebsd-386-cgo), const O_EXLOCK = 32 +pkg syscall (freebsd-386-cgo), const O_FSYNC = 128 +pkg syscall (freebsd-386-cgo), const O_NDELAY = 4 +pkg syscall (freebsd-386-cgo), const O_NOCTTY = 32768 +pkg syscall (freebsd-386-cgo), const O_NOFOLLOW = 256 +pkg syscall (freebsd-386-cgo), const O_NONBLOCK = 4 +pkg syscall (freebsd-386-cgo), const O_SHLOCK = 16 +pkg syscall (freebsd-386-cgo), const O_SYNC = 128 +pkg syscall (freebsd-386-cgo), const O_TRUNC = 1024 +pkg syscall (freebsd-386-cgo), const O_TTY_INIT = 524288 +pkg syscall (freebsd-386-cgo), const PARENB = 4096 +pkg syscall (freebsd-386-cgo), const PARMRK = 8 +pkg syscall (freebsd-386-cgo), const PARODD = 8192 +pkg syscall (freebsd-386-cgo), const PENDIN = 536870912 +pkg syscall (freebsd-386-cgo), const PROT_EXEC = 4 +pkg syscall (freebsd-386-cgo), const PROT_NONE = 0 +pkg syscall (freebsd-386-cgo), const PROT_READ = 1 +pkg syscall (freebsd-386-cgo), const PROT_WRITE = 2 +pkg syscall (freebsd-386-cgo), const PTRACE_CONT = 7 +pkg syscall (freebsd-386-cgo), const PTRACE_KILL = 8 +pkg syscall (freebsd-386-cgo), const PTRACE_TRACEME = 0 +pkg syscall (freebsd-386-cgo), const RLIMIT_AS = 10 +pkg syscall (freebsd-386-cgo), const RLIMIT_CORE = 4 +pkg syscall (freebsd-386-cgo), const RLIMIT_CPU = 0 +pkg syscall (freebsd-386-cgo), const RLIMIT_DATA = 2 +pkg syscall (freebsd-386-cgo), const RLIMIT_FSIZE = 1 +pkg syscall (freebsd-386-cgo), const RLIMIT_NOFILE = 8 +pkg syscall (freebsd-386-cgo), const RLIMIT_STACK = 3 +pkg syscall (freebsd-386-cgo), const RLIM_INFINITY = 9223372036854775807 +pkg syscall (freebsd-386-cgo), const RTAX_AUTHOR = 6 +pkg syscall (freebsd-386-cgo), const RTAX_BRD = 7 +pkg syscall (freebsd-386-cgo), const RTAX_DST = 0 +pkg syscall (freebsd-386-cgo), const RTAX_GATEWAY = 1 +pkg syscall (freebsd-386-cgo), const RTAX_GENMASK = 3 +pkg syscall (freebsd-386-cgo), const RTAX_IFA = 5 +pkg syscall (freebsd-386-cgo), const RTAX_IFP = 4 +pkg syscall (freebsd-386-cgo), const RTAX_MAX = 8 +pkg syscall (freebsd-386-cgo), const RTAX_NETMASK = 2 +pkg syscall (freebsd-386-cgo), const RTA_AUTHOR = 64 +pkg syscall (freebsd-386-cgo), const RTA_BRD = 128 +pkg syscall (freebsd-386-cgo), const RTA_DST = 1 +pkg syscall (freebsd-386-cgo), const RTA_GATEWAY = 2 +pkg syscall (freebsd-386-cgo), const RTA_GENMASK = 8 +pkg syscall (freebsd-386-cgo), const RTA_IFA = 32 +pkg syscall (freebsd-386-cgo), const RTA_IFP = 16 +pkg syscall (freebsd-386-cgo), const RTA_NETMASK = 4 +pkg syscall (freebsd-386-cgo), const RTF_BLACKHOLE = 4096 +pkg syscall (freebsd-386-cgo), const RTF_BROADCAST = 4194304 +pkg syscall (freebsd-386-cgo), const RTF_DONE = 64 +pkg syscall (freebsd-386-cgo), const RTF_DYNAMIC = 16 +pkg syscall (freebsd-386-cgo), const RTF_FMASK = 268752904 +pkg syscall (freebsd-386-cgo), const RTF_GATEWAY = 2 +pkg syscall (freebsd-386-cgo), const RTF_HOST = 4 +pkg syscall (freebsd-386-cgo), const RTF_LLDATA = 1024 +pkg syscall (freebsd-386-cgo), const RTF_LLINFO = 1024 +pkg syscall (freebsd-386-cgo), const RTF_LOCAL = 2097152 +pkg syscall (freebsd-386-cgo), const RTF_MODIFIED = 32 +pkg syscall (freebsd-386-cgo), const RTF_MULTICAST = 8388608 +pkg syscall (freebsd-386-cgo), const RTF_PINNED = 1048576 +pkg syscall (freebsd-386-cgo), const RTF_PRCLONING = 65536 +pkg syscall (freebsd-386-cgo), const RTF_PROTO1 = 32768 +pkg syscall (freebsd-386-cgo), const RTF_PROTO2 = 16384 +pkg syscall (freebsd-386-cgo), const RTF_PROTO3 = 262144 +pkg syscall (freebsd-386-cgo), const RTF_REJECT = 8 +pkg syscall (freebsd-386-cgo), const RTF_RNH_LOCKED = 1073741824 +pkg syscall (freebsd-386-cgo), const RTF_STATIC = 2048 +pkg syscall (freebsd-386-cgo), const RTF_STICKY = 268435456 +pkg syscall (freebsd-386-cgo), const RTF_UP = 1 +pkg syscall (freebsd-386-cgo), const RTF_XRESOLVE = 512 +pkg syscall (freebsd-386-cgo), const RTM_ADD = 1 +pkg syscall (freebsd-386-cgo), const RTM_CHANGE = 3 +pkg syscall (freebsd-386-cgo), const RTM_DELADDR = 13 +pkg syscall (freebsd-386-cgo), const RTM_DELETE = 2 +pkg syscall (freebsd-386-cgo), const RTM_DELMADDR = 16 +pkg syscall (freebsd-386-cgo), const RTM_GET = 4 +pkg syscall (freebsd-386-cgo), const RTM_IEEE80211 = 18 +pkg syscall (freebsd-386-cgo), const RTM_IFANNOUNCE = 17 +pkg syscall (freebsd-386-cgo), const RTM_IFINFO = 14 +pkg syscall (freebsd-386-cgo), const RTM_LOCK = 8 +pkg syscall (freebsd-386-cgo), const RTM_LOSING = 5 +pkg syscall (freebsd-386-cgo), const RTM_MISS = 7 +pkg syscall (freebsd-386-cgo), const RTM_NEWADDR = 12 +pkg syscall (freebsd-386-cgo), const RTM_NEWMADDR = 15 +pkg syscall (freebsd-386-cgo), const RTM_OLDADD = 9 +pkg syscall (freebsd-386-cgo), const RTM_OLDDEL = 10 +pkg syscall (freebsd-386-cgo), const RTM_REDIRECT = 6 +pkg syscall (freebsd-386-cgo), const RTM_RESOLVE = 11 +pkg syscall (freebsd-386-cgo), const RTM_RTTUNIT = 1000000 +pkg syscall (freebsd-386-cgo), const RTM_VERSION = 5 +pkg syscall (freebsd-386-cgo), const RTV_EXPIRE = 4 +pkg syscall (freebsd-386-cgo), const RTV_HOPCOUNT = 2 +pkg syscall (freebsd-386-cgo), const RTV_MTU = 1 +pkg syscall (freebsd-386-cgo), const RTV_RPIPE = 8 +pkg syscall (freebsd-386-cgo), const RTV_RTT = 64 +pkg syscall (freebsd-386-cgo), const RTV_RTTVAR = 128 +pkg syscall (freebsd-386-cgo), const RTV_SPIPE = 16 +pkg syscall (freebsd-386-cgo), const RTV_SSTHRESH = 32 +pkg syscall (freebsd-386-cgo), const RTV_WEIGHT = 256 +pkg syscall (freebsd-386-cgo), const RT_CACHING_CONTEXT = 1 +pkg syscall (freebsd-386-cgo), const RT_DEFAULT_FIB = 0 +pkg syscall (freebsd-386-cgo), const RUSAGE_CHILDREN = -1 +pkg syscall (freebsd-386-cgo), const RUSAGE_SELF = 0 +pkg syscall (freebsd-386-cgo), const RUSAGE_THREAD = 1 +pkg syscall (freebsd-386-cgo), const SCM_BINTIME = 4 +pkg syscall (freebsd-386-cgo), const SCM_CREDS = 3 +pkg syscall (freebsd-386-cgo), const SCM_RIGHTS = 1 +pkg syscall (freebsd-386-cgo), const SCM_TIMESTAMP = 2 +pkg syscall (freebsd-386-cgo), const SIGBUS = 10 +pkg syscall (freebsd-386-cgo), const SIGCHLD = 20 +pkg syscall (freebsd-386-cgo), const SIGCONT = 19 +pkg syscall (freebsd-386-cgo), const SIGEMT = 7 +pkg syscall (freebsd-386-cgo), const SIGINFO = 29 +pkg syscall (freebsd-386-cgo), const SIGIO = 23 +pkg syscall (freebsd-386-cgo), const SIGIOT = 6 +pkg syscall (freebsd-386-cgo), const SIGLWP = 32 +pkg syscall (freebsd-386-cgo), const SIGPROF = 27 +pkg syscall (freebsd-386-cgo), const SIGSTOP = 17 +pkg syscall (freebsd-386-cgo), const SIGSYS = 12 +pkg syscall (freebsd-386-cgo), const SIGTHR = 32 +pkg syscall (freebsd-386-cgo), const SIGTSTP = 18 +pkg syscall (freebsd-386-cgo), const SIGTTIN = 21 +pkg syscall (freebsd-386-cgo), const SIGTTOU = 22 +pkg syscall (freebsd-386-cgo), const SIGURG = 16 +pkg syscall (freebsd-386-cgo), const SIGUSR1 = 30 +pkg syscall (freebsd-386-cgo), const SIGUSR2 = 31 +pkg syscall (freebsd-386-cgo), const SIGVTALRM = 26 +pkg syscall (freebsd-386-cgo), const SIGWINCH = 28 +pkg syscall (freebsd-386-cgo), const SIGXCPU = 24 +pkg syscall (freebsd-386-cgo), const SIGXFSZ = 25 +pkg syscall (freebsd-386-cgo), const SIOCADDMULTI = 2149607729 +pkg syscall (freebsd-386-cgo), const SIOCADDRT = 2150658570 +pkg syscall (freebsd-386-cgo), const SIOCAIFADDR = 2151704858 +pkg syscall (freebsd-386-cgo), const SIOCAIFGROUP = 2149869959 +pkg syscall (freebsd-386-cgo), const SIOCALIFADDR = 2165860635 +pkg syscall (freebsd-386-cgo), const SIOCATMARK = 1074033415 +pkg syscall (freebsd-386-cgo), const SIOCDELMULTI = 2149607730 +pkg syscall (freebsd-386-cgo), const SIOCDELRT = 2150658571 +pkg syscall (freebsd-386-cgo), const SIOCDIFADDR = 2149607705 +pkg syscall (freebsd-386-cgo), const SIOCDIFGROUP = 2149869961 +pkg syscall (freebsd-386-cgo), const SIOCDIFPHYADDR = 2149607753 +pkg syscall (freebsd-386-cgo), const SIOCDLIFADDR = 2165860637 +pkg syscall (freebsd-386-cgo), const SIOCGDRVSPEC = 3223087483 +pkg syscall (freebsd-386-cgo), const SIOCGETSGCNT = 3222565392 +pkg syscall (freebsd-386-cgo), const SIOCGETVIFCNT = 3222565391 +pkg syscall (freebsd-386-cgo), const SIOCGHIWAT = 1074033409 +pkg syscall (freebsd-386-cgo), const SIOCGIFADDR = 3223349537 +pkg syscall (freebsd-386-cgo), const SIOCGIFBRDADDR = 3223349539 +pkg syscall (freebsd-386-cgo), const SIOCGIFCAP = 3223349535 +pkg syscall (freebsd-386-cgo), const SIOCGIFCONF = 3221776676 +pkg syscall (freebsd-386-cgo), const SIOCGIFDESCR = 3223349546 +pkg syscall (freebsd-386-cgo), const SIOCGIFDSTADDR = 3223349538 +pkg syscall (freebsd-386-cgo), const SIOCGIFFIB = 3223349596 +pkg syscall (freebsd-386-cgo), const SIOCGIFFLAGS = 3223349521 +pkg syscall (freebsd-386-cgo), const SIOCGIFGENERIC = 3223349562 +pkg syscall (freebsd-386-cgo), const SIOCGIFGMEMB = 3223611786 +pkg syscall (freebsd-386-cgo), const SIOCGIFGROUP = 3223611784 +pkg syscall (freebsd-386-cgo), const SIOCGIFINDEX = 3223349536 +pkg syscall (freebsd-386-cgo), const SIOCGIFMAC = 3223349542 +pkg syscall (freebsd-386-cgo), const SIOCGIFMEDIA = 3223873848 +pkg syscall (freebsd-386-cgo), const SIOCGIFMETRIC = 3223349527 +pkg syscall (freebsd-386-cgo), const SIOCGIFMTU = 3223349555 +pkg syscall (freebsd-386-cgo), const SIOCGIFNETMASK = 3223349541 +pkg syscall (freebsd-386-cgo), const SIOCGIFPDSTADDR = 3223349576 +pkg syscall (freebsd-386-cgo), const SIOCGIFPHYS = 3223349557 +pkg syscall (freebsd-386-cgo), const SIOCGIFPSRCADDR = 3223349575 +pkg syscall (freebsd-386-cgo), const SIOCGIFSTATUS = 3274795323 +pkg syscall (freebsd-386-cgo), const SIOCGLIFADDR = 3239602460 +pkg syscall (freebsd-386-cgo), const SIOCGLIFPHYADDR = 3239602507 +pkg syscall (freebsd-386-cgo), const SIOCGLOWAT = 1074033411 +pkg syscall (freebsd-386-cgo), const SIOCGPGRP = 1074033417 +pkg syscall (freebsd-386-cgo), const SIOCGPRIVATE_0 = 3223349584 +pkg syscall (freebsd-386-cgo), const SIOCGPRIVATE_1 = 3223349585 +pkg syscall (freebsd-386-cgo), const SIOCIFCREATE = 3223349626 +pkg syscall (freebsd-386-cgo), const SIOCIFCREATE2 = 3223349628 +pkg syscall (freebsd-386-cgo), const SIOCIFDESTROY = 2149607801 +pkg syscall (freebsd-386-cgo), const SIOCIFGCLONERS = 3222038904 +pkg syscall (freebsd-386-cgo), const SIOCSDRVSPEC = 2149345659 +pkg syscall (freebsd-386-cgo), const SIOCSHIWAT = 2147775232 +pkg syscall (freebsd-386-cgo), const SIOCSIFADDR = 2149607692 +pkg syscall (freebsd-386-cgo), const SIOCSIFBRDADDR = 2149607699 +pkg syscall (freebsd-386-cgo), const SIOCSIFCAP = 2149607710 +pkg syscall (freebsd-386-cgo), const SIOCSIFDESCR = 2149607721 +pkg syscall (freebsd-386-cgo), const SIOCSIFDSTADDR = 2149607694 +pkg syscall (freebsd-386-cgo), const SIOCSIFFIB = 2149607773 +pkg syscall (freebsd-386-cgo), const SIOCSIFFLAGS = 2149607696 +pkg syscall (freebsd-386-cgo), const SIOCSIFGENERIC = 2149607737 +pkg syscall (freebsd-386-cgo), const SIOCSIFLLADDR = 2149607740 +pkg syscall (freebsd-386-cgo), const SIOCSIFMAC = 2149607719 +pkg syscall (freebsd-386-cgo), const SIOCSIFMEDIA = 3223349559 +pkg syscall (freebsd-386-cgo), const SIOCSIFMETRIC = 2149607704 +pkg syscall (freebsd-386-cgo), const SIOCSIFMTU = 2149607732 +pkg syscall (freebsd-386-cgo), const SIOCSIFNAME = 2149607720 +pkg syscall (freebsd-386-cgo), const SIOCSIFNETMASK = 2149607702 +pkg syscall (freebsd-386-cgo), const SIOCSIFPHYADDR = 2151704902 +pkg syscall (freebsd-386-cgo), const SIOCSIFPHYS = 2149607734 +pkg syscall (freebsd-386-cgo), const SIOCSIFRVNET = 3223349595 +pkg syscall (freebsd-386-cgo), const SIOCSIFVNET = 3223349594 +pkg syscall (freebsd-386-cgo), const SIOCSLIFPHYADDR = 2165860682 +pkg syscall (freebsd-386-cgo), const SIOCSLOWAT = 2147775234 +pkg syscall (freebsd-386-cgo), const SIOCSPGRP = 2147775240 +pkg syscall (freebsd-386-cgo), const SOCK_MAXADDRLEN = 255 +pkg syscall (freebsd-386-cgo), const SOCK_RDM = 4 +pkg syscall (freebsd-386-cgo), const SOL_SOCKET = 65535 +pkg syscall (freebsd-386-cgo), const SOMAXCONN = 128 +pkg syscall (freebsd-386-cgo), const SO_ACCEPTCONN = 2 +pkg syscall (freebsd-386-cgo), const SO_ACCEPTFILTER = 4096 +pkg syscall (freebsd-386-cgo), const SO_BINTIME = 8192 +pkg syscall (freebsd-386-cgo), const SO_BROADCAST = 32 +pkg syscall (freebsd-386-cgo), const SO_DEBUG = 1 +pkg syscall (freebsd-386-cgo), const SO_DONTROUTE = 16 +pkg syscall (freebsd-386-cgo), const SO_ERROR = 4103 +pkg syscall (freebsd-386-cgo), const SO_KEEPALIVE = 8 +pkg syscall (freebsd-386-cgo), const SO_LABEL = 4105 +pkg syscall (freebsd-386-cgo), const SO_LINGER = 128 +pkg syscall (freebsd-386-cgo), const SO_LISTENINCQLEN = 4115 +pkg syscall (freebsd-386-cgo), const SO_LISTENQLEN = 4114 +pkg syscall (freebsd-386-cgo), const SO_LISTENQLIMIT = 4113 +pkg syscall (freebsd-386-cgo), const SO_NOSIGPIPE = 2048 +pkg syscall (freebsd-386-cgo), const SO_NO_DDP = 32768 +pkg syscall (freebsd-386-cgo), const SO_NO_OFFLOAD = 16384 +pkg syscall (freebsd-386-cgo), const SO_OOBINLINE = 256 +pkg syscall (freebsd-386-cgo), const SO_PEERLABEL = 4112 +pkg syscall (freebsd-386-cgo), const SO_PROTOCOL = 4118 +pkg syscall (freebsd-386-cgo), const SO_PROTOTYPE = 4118 +pkg syscall (freebsd-386-cgo), const SO_RCVBUF = 4098 +pkg syscall (freebsd-386-cgo), const SO_RCVLOWAT = 4100 +pkg syscall (freebsd-386-cgo), const SO_RCVTIMEO = 4102 +pkg syscall (freebsd-386-cgo), const SO_REUSEADDR = 4 +pkg syscall (freebsd-386-cgo), const SO_REUSEPORT = 512 +pkg syscall (freebsd-386-cgo), const SO_SETFIB = 4116 +pkg syscall (freebsd-386-cgo), const SO_SNDBUF = 4097 +pkg syscall (freebsd-386-cgo), const SO_SNDLOWAT = 4099 +pkg syscall (freebsd-386-cgo), const SO_SNDTIMEO = 4101 +pkg syscall (freebsd-386-cgo), const SO_TIMESTAMP = 1024 +pkg syscall (freebsd-386-cgo), const SO_TYPE = 4104 +pkg syscall (freebsd-386-cgo), const SO_USELOOPBACK = 64 +pkg syscall (freebsd-386-cgo), const SO_USER_COOKIE = 4117 +pkg syscall (freebsd-386-cgo), const SYS_ABORT2 = 463 +pkg syscall (freebsd-386-cgo), const SYS_ACCEPT = 30 +pkg syscall (freebsd-386-cgo), const SYS_ACCESS = 33 +pkg syscall (freebsd-386-cgo), const SYS_ACCT = 51 +pkg syscall (freebsd-386-cgo), const SYS_ADJTIME = 140 +pkg syscall (freebsd-386-cgo), const SYS_AUDIT = 445 +pkg syscall (freebsd-386-cgo), const SYS_AUDITCTL = 453 +pkg syscall (freebsd-386-cgo), const SYS_AUDITON = 446 +pkg syscall (freebsd-386-cgo), const SYS_BIND = 104 +pkg syscall (freebsd-386-cgo), const SYS_CAP_ENTER = 516 +pkg syscall (freebsd-386-cgo), const SYS_CAP_GETMODE = 517 +pkg syscall (freebsd-386-cgo), const SYS_CAP_GETRIGHTS = 515 +pkg syscall (freebsd-386-cgo), const SYS_CAP_NEW = 514 +pkg syscall (freebsd-386-cgo), const SYS_CHDIR = 12 +pkg syscall (freebsd-386-cgo), const SYS_CHFLAGS = 34 +pkg syscall (freebsd-386-cgo), const SYS_CHMOD = 15 +pkg syscall (freebsd-386-cgo), const SYS_CHOWN = 16 +pkg syscall (freebsd-386-cgo), const SYS_CHROOT = 61 +pkg syscall (freebsd-386-cgo), const SYS_CLOCK_GETCPUCLOCKID2 = 247 +pkg syscall (freebsd-386-cgo), const SYS_CLOCK_GETRES = 234 +pkg syscall (freebsd-386-cgo), const SYS_CLOCK_GETTIME = 232 +pkg syscall (freebsd-386-cgo), const SYS_CLOCK_SETTIME = 233 +pkg syscall (freebsd-386-cgo), const SYS_CLOSE = 6 +pkg syscall (freebsd-386-cgo), const SYS_CLOSEFROM = 509 +pkg syscall (freebsd-386-cgo), const SYS_CONNECT = 98 +pkg syscall (freebsd-386-cgo), const SYS_CPUSET = 484 +pkg syscall (freebsd-386-cgo), const SYS_CPUSET_GETAFFINITY = 487 +pkg syscall (freebsd-386-cgo), const SYS_CPUSET_GETID = 486 +pkg syscall (freebsd-386-cgo), const SYS_CPUSET_SETAFFINITY = 488 +pkg syscall (freebsd-386-cgo), const SYS_CPUSET_SETID = 485 +pkg syscall (freebsd-386-cgo), const SYS_DUP = 41 +pkg syscall (freebsd-386-cgo), const SYS_DUP2 = 90 +pkg syscall (freebsd-386-cgo), const SYS_EACCESS = 376 +pkg syscall (freebsd-386-cgo), const SYS_EXECVE = 59 +pkg syscall (freebsd-386-cgo), const SYS_EXIT = 1 +pkg syscall (freebsd-386-cgo), const SYS_EXTATTRCTL = 355 +pkg syscall (freebsd-386-cgo), const SYS_EXTATTR_DELETE_FD = 373 +pkg syscall (freebsd-386-cgo), const SYS_EXTATTR_DELETE_FILE = 358 +pkg syscall (freebsd-386-cgo), const SYS_EXTATTR_DELETE_LINK = 414 +pkg syscall (freebsd-386-cgo), const SYS_EXTATTR_GET_FD = 372 +pkg syscall (freebsd-386-cgo), const SYS_EXTATTR_GET_FILE = 357 +pkg syscall (freebsd-386-cgo), const SYS_EXTATTR_GET_LINK = 413 +pkg syscall (freebsd-386-cgo), const SYS_EXTATTR_LIST_FD = 437 +pkg syscall (freebsd-386-cgo), const SYS_EXTATTR_LIST_FILE = 438 +pkg syscall (freebsd-386-cgo), const SYS_EXTATTR_LIST_LINK = 439 +pkg syscall (freebsd-386-cgo), const SYS_EXTATTR_SET_FD = 371 +pkg syscall (freebsd-386-cgo), const SYS_EXTATTR_SET_FILE = 356 +pkg syscall (freebsd-386-cgo), const SYS_EXTATTR_SET_LINK = 412 +pkg syscall (freebsd-386-cgo), const SYS_FACCESSAT = 489 +pkg syscall (freebsd-386-cgo), const SYS_FCHDIR = 13 +pkg syscall (freebsd-386-cgo), const SYS_FCHFLAGS = 35 +pkg syscall (freebsd-386-cgo), const SYS_FCHMOD = 124 +pkg syscall (freebsd-386-cgo), const SYS_FCHMODAT = 490 +pkg syscall (freebsd-386-cgo), const SYS_FCHOWN = 123 +pkg syscall (freebsd-386-cgo), const SYS_FCHOWNAT = 491 +pkg syscall (freebsd-386-cgo), const SYS_FCNTL = 92 +pkg syscall (freebsd-386-cgo), const SYS_FEXECVE = 492 +pkg syscall (freebsd-386-cgo), const SYS_FFCLOCK_GETCOUNTER = 241 +pkg syscall (freebsd-386-cgo), const SYS_FFCLOCK_GETESTIMATE = 243 +pkg syscall (freebsd-386-cgo), const SYS_FFCLOCK_SETESTIMATE = 242 +pkg syscall (freebsd-386-cgo), const SYS_FHOPEN = 298 +pkg syscall (freebsd-386-cgo), const SYS_FHSTAT = 299 +pkg syscall (freebsd-386-cgo), const SYS_FHSTATFS = 398 +pkg syscall (freebsd-386-cgo), const SYS_FLOCK = 131 +pkg syscall (freebsd-386-cgo), const SYS_FORK = 2 +pkg syscall (freebsd-386-cgo), const SYS_FPATHCONF = 192 +pkg syscall (freebsd-386-cgo), const SYS_FREEBSD6_FTRUNCATE = 201 +pkg syscall (freebsd-386-cgo), const SYS_FREEBSD6_LSEEK = 199 +pkg syscall (freebsd-386-cgo), const SYS_FREEBSD6_MMAP = 197 +pkg syscall (freebsd-386-cgo), const SYS_FREEBSD6_PREAD = 173 +pkg syscall (freebsd-386-cgo), const SYS_FREEBSD6_PWRITE = 174 +pkg syscall (freebsd-386-cgo), const SYS_FREEBSD6_TRUNCATE = 200 +pkg syscall (freebsd-386-cgo), const SYS_FSTAT = 189 +pkg syscall (freebsd-386-cgo), const SYS_FSTATAT = 493 +pkg syscall (freebsd-386-cgo), const SYS_FSTATFS = 397 +pkg syscall (freebsd-386-cgo), const SYS_FSYNC = 95 +pkg syscall (freebsd-386-cgo), const SYS_FTRUNCATE = 480 +pkg syscall (freebsd-386-cgo), const SYS_FUTIMES = 206 +pkg syscall (freebsd-386-cgo), const SYS_FUTIMESAT = 494 +pkg syscall (freebsd-386-cgo), const SYS_GETAUDIT = 449 +pkg syscall (freebsd-386-cgo), const SYS_GETAUDIT_ADDR = 451 +pkg syscall (freebsd-386-cgo), const SYS_GETAUID = 447 +pkg syscall (freebsd-386-cgo), const SYS_GETCONTEXT = 421 +pkg syscall (freebsd-386-cgo), const SYS_GETDENTS = 272 +pkg syscall (freebsd-386-cgo), const SYS_GETDIRENTRIES = 196 +pkg syscall (freebsd-386-cgo), const SYS_GETDTABLESIZE = 89 +pkg syscall (freebsd-386-cgo), const SYS_GETEGID = 43 +pkg syscall (freebsd-386-cgo), const SYS_GETEUID = 25 +pkg syscall (freebsd-386-cgo), const SYS_GETFH = 161 +pkg syscall (freebsd-386-cgo), const SYS_GETFSSTAT = 395 +pkg syscall (freebsd-386-cgo), const SYS_GETGID = 47 +pkg syscall (freebsd-386-cgo), const SYS_GETGROUPS = 79 +pkg syscall (freebsd-386-cgo), const SYS_GETITIMER = 86 +pkg syscall (freebsd-386-cgo), const SYS_GETLOGIN = 49 +pkg syscall (freebsd-386-cgo), const SYS_GETLOGINCLASS = 523 +pkg syscall (freebsd-386-cgo), const SYS_GETPEERNAME = 31 +pkg syscall (freebsd-386-cgo), const SYS_GETPGID = 207 +pkg syscall (freebsd-386-cgo), const SYS_GETPGRP = 81 +pkg syscall (freebsd-386-cgo), const SYS_GETPID = 20 +pkg syscall (freebsd-386-cgo), const SYS_GETPPID = 39 +pkg syscall (freebsd-386-cgo), const SYS_GETPRIORITY = 100 +pkg syscall (freebsd-386-cgo), const SYS_GETRESGID = 361 +pkg syscall (freebsd-386-cgo), const SYS_GETRESUID = 360 +pkg syscall (freebsd-386-cgo), const SYS_GETRLIMIT = 194 +pkg syscall (freebsd-386-cgo), const SYS_GETRUSAGE = 117 +pkg syscall (freebsd-386-cgo), const SYS_GETSID = 310 +pkg syscall (freebsd-386-cgo), const SYS_GETSOCKNAME = 32 +pkg syscall (freebsd-386-cgo), const SYS_GETSOCKOPT = 118 +pkg syscall (freebsd-386-cgo), const SYS_GETTIMEOFDAY = 116 +pkg syscall (freebsd-386-cgo), const SYS_GETUID = 24 +pkg syscall (freebsd-386-cgo), const SYS_IOCTL = 54 +pkg syscall (freebsd-386-cgo), const SYS_ISSETUGID = 253 +pkg syscall (freebsd-386-cgo), const SYS_JAIL = 338 +pkg syscall (freebsd-386-cgo), const SYS_JAIL_ATTACH = 436 +pkg syscall (freebsd-386-cgo), const SYS_JAIL_GET = 506 +pkg syscall (freebsd-386-cgo), const SYS_JAIL_REMOVE = 508 +pkg syscall (freebsd-386-cgo), const SYS_JAIL_SET = 507 +pkg syscall (freebsd-386-cgo), const SYS_KENV = 390 +pkg syscall (freebsd-386-cgo), const SYS_KEVENT = 363 +pkg syscall (freebsd-386-cgo), const SYS_KILL = 37 +pkg syscall (freebsd-386-cgo), const SYS_KLDFIND = 306 +pkg syscall (freebsd-386-cgo), const SYS_KLDFIRSTMOD = 309 +pkg syscall (freebsd-386-cgo), const SYS_KLDLOAD = 304 +pkg syscall (freebsd-386-cgo), const SYS_KLDNEXT = 307 +pkg syscall (freebsd-386-cgo), const SYS_KLDSTAT = 308 +pkg syscall (freebsd-386-cgo), const SYS_KLDSYM = 337 +pkg syscall (freebsd-386-cgo), const SYS_KLDUNLOAD = 305 +pkg syscall (freebsd-386-cgo), const SYS_KLDUNLOADF = 444 +pkg syscall (freebsd-386-cgo), const SYS_KQUEUE = 362 +pkg syscall (freebsd-386-cgo), const SYS_KTIMER_CREATE = 235 +pkg syscall (freebsd-386-cgo), const SYS_KTIMER_DELETE = 236 +pkg syscall (freebsd-386-cgo), const SYS_KTIMER_GETOVERRUN = 239 +pkg syscall (freebsd-386-cgo), const SYS_KTIMER_GETTIME = 238 +pkg syscall (freebsd-386-cgo), const SYS_KTIMER_SETTIME = 237 +pkg syscall (freebsd-386-cgo), const SYS_KTRACE = 45 +pkg syscall (freebsd-386-cgo), const SYS_LCHFLAGS = 391 +pkg syscall (freebsd-386-cgo), const SYS_LCHMOD = 274 +pkg syscall (freebsd-386-cgo), const SYS_LCHOWN = 254 +pkg syscall (freebsd-386-cgo), const SYS_LGETFH = 160 +pkg syscall (freebsd-386-cgo), const SYS_LINK = 9 +pkg syscall (freebsd-386-cgo), const SYS_LINKAT = 495 +pkg syscall (freebsd-386-cgo), const SYS_LISTEN = 106 +pkg syscall (freebsd-386-cgo), const SYS_LPATHCONF = 513 +pkg syscall (freebsd-386-cgo), const SYS_LSEEK = 478 +pkg syscall (freebsd-386-cgo), const SYS_LSTAT = 190 +pkg syscall (freebsd-386-cgo), const SYS_LUTIMES = 276 +pkg syscall (freebsd-386-cgo), const SYS_MAC_SYSCALL = 394 +pkg syscall (freebsd-386-cgo), const SYS_MADVISE = 75 +pkg syscall (freebsd-386-cgo), const SYS_MINCORE = 78 +pkg syscall (freebsd-386-cgo), const SYS_MINHERIT = 250 +pkg syscall (freebsd-386-cgo), const SYS_MKDIR = 136 +pkg syscall (freebsd-386-cgo), const SYS_MKDIRAT = 496 +pkg syscall (freebsd-386-cgo), const SYS_MKFIFO = 132 +pkg syscall (freebsd-386-cgo), const SYS_MKFIFOAT = 497 +pkg syscall (freebsd-386-cgo), const SYS_MKNOD = 14 +pkg syscall (freebsd-386-cgo), const SYS_MKNODAT = 498 +pkg syscall (freebsd-386-cgo), const SYS_MLOCK = 203 +pkg syscall (freebsd-386-cgo), const SYS_MLOCKALL = 324 +pkg syscall (freebsd-386-cgo), const SYS_MMAP = 477 +pkg syscall (freebsd-386-cgo), const SYS_MODFIND = 303 +pkg syscall (freebsd-386-cgo), const SYS_MODFNEXT = 302 +pkg syscall (freebsd-386-cgo), const SYS_MODNEXT = 300 +pkg syscall (freebsd-386-cgo), const SYS_MODSTAT = 301 +pkg syscall (freebsd-386-cgo), const SYS_MOUNT = 21 +pkg syscall (freebsd-386-cgo), const SYS_MPROTECT = 74 +pkg syscall (freebsd-386-cgo), const SYS_MSYNC = 65 +pkg syscall (freebsd-386-cgo), const SYS_MUNLOCK = 204 +pkg syscall (freebsd-386-cgo), const SYS_MUNLOCKALL = 325 +pkg syscall (freebsd-386-cgo), const SYS_MUNMAP = 73 +pkg syscall (freebsd-386-cgo), const SYS_NANOSLEEP = 240 +pkg syscall (freebsd-386-cgo), const SYS_NFSTAT = 279 +pkg syscall (freebsd-386-cgo), const SYS_NLSTAT = 280 +pkg syscall (freebsd-386-cgo), const SYS_NMOUNT = 378 +pkg syscall (freebsd-386-cgo), const SYS_NSTAT = 278 +pkg syscall (freebsd-386-cgo), const SYS_NTP_ADJTIME = 176 +pkg syscall (freebsd-386-cgo), const SYS_NTP_GETTIME = 248 +pkg syscall (freebsd-386-cgo), const SYS_OBREAK = 17 +pkg syscall (freebsd-386-cgo), const SYS_OPEN = 5 +pkg syscall (freebsd-386-cgo), const SYS_OPENAT = 499 +pkg syscall (freebsd-386-cgo), const SYS_OPENBSD_POLL = 252 +pkg syscall (freebsd-386-cgo), const SYS_OVADVISE = 72 +pkg syscall (freebsd-386-cgo), const SYS_PATHCONF = 191 +pkg syscall (freebsd-386-cgo), const SYS_PDFORK = 518 +pkg syscall (freebsd-386-cgo), const SYS_PDGETPID = 520 +pkg syscall (freebsd-386-cgo), const SYS_PDKILL = 519 +pkg syscall (freebsd-386-cgo), const SYS_PIPE = 42 +pkg syscall (freebsd-386-cgo), const SYS_POLL = 209 +pkg syscall (freebsd-386-cgo), const SYS_POSIX_FADVISE = 531 +pkg syscall (freebsd-386-cgo), const SYS_POSIX_FALLOCATE = 530 +pkg syscall (freebsd-386-cgo), const SYS_POSIX_OPENPT = 504 +pkg syscall (freebsd-386-cgo), const SYS_PREAD = 475 +pkg syscall (freebsd-386-cgo), const SYS_PREADV = 289 +pkg syscall (freebsd-386-cgo), const SYS_PROFIL = 44 +pkg syscall (freebsd-386-cgo), const SYS_PSELECT = 522 +pkg syscall (freebsd-386-cgo), const SYS_PTRACE = 26 +pkg syscall (freebsd-386-cgo), const SYS_PWRITE = 476 +pkg syscall (freebsd-386-cgo), const SYS_PWRITEV = 290 +pkg syscall (freebsd-386-cgo), const SYS_QUOTACTL = 148 +pkg syscall (freebsd-386-cgo), const SYS_RCTL_ADD_RULE = 528 +pkg syscall (freebsd-386-cgo), const SYS_RCTL_GET_LIMITS = 527 +pkg syscall (freebsd-386-cgo), const SYS_RCTL_GET_RACCT = 525 +pkg syscall (freebsd-386-cgo), const SYS_RCTL_GET_RULES = 526 +pkg syscall (freebsd-386-cgo), const SYS_RCTL_REMOVE_RULE = 529 +pkg syscall (freebsd-386-cgo), const SYS_READ = 3 +pkg syscall (freebsd-386-cgo), const SYS_READLINK = 58 +pkg syscall (freebsd-386-cgo), const SYS_READLINKAT = 500 +pkg syscall (freebsd-386-cgo), const SYS_READV = 120 +pkg syscall (freebsd-386-cgo), const SYS_REBOOT = 55 +pkg syscall (freebsd-386-cgo), const SYS_RECVFROM = 29 +pkg syscall (freebsd-386-cgo), const SYS_RECVMSG = 27 +pkg syscall (freebsd-386-cgo), const SYS_RENAME = 128 +pkg syscall (freebsd-386-cgo), const SYS_RENAMEAT = 501 +pkg syscall (freebsd-386-cgo), const SYS_REVOKE = 56 +pkg syscall (freebsd-386-cgo), const SYS_RFORK = 251 +pkg syscall (freebsd-386-cgo), const SYS_RMDIR = 137 +pkg syscall (freebsd-386-cgo), const SYS_RTPRIO = 166 +pkg syscall (freebsd-386-cgo), const SYS_RTPRIO_THREAD = 466 +pkg syscall (freebsd-386-cgo), const SYS_SBRK = 69 +pkg syscall (freebsd-386-cgo), const SYS_SCHED_GETPARAM = 328 +pkg syscall (freebsd-386-cgo), const SYS_SCHED_GETSCHEDULER = 330 +pkg syscall (freebsd-386-cgo), const SYS_SCHED_GET_PRIORITY_MAX = 332 +pkg syscall (freebsd-386-cgo), const SYS_SCHED_GET_PRIORITY_MIN = 333 +pkg syscall (freebsd-386-cgo), const SYS_SCHED_RR_GET_INTERVAL = 334 +pkg syscall (freebsd-386-cgo), const SYS_SCHED_SETPARAM = 327 +pkg syscall (freebsd-386-cgo), const SYS_SCHED_SETSCHEDULER = 329 +pkg syscall (freebsd-386-cgo), const SYS_SCHED_YIELD = 331 +pkg syscall (freebsd-386-cgo), const SYS_SCTP_GENERIC_RECVMSG = 474 +pkg syscall (freebsd-386-cgo), const SYS_SCTP_GENERIC_SENDMSG = 472 +pkg syscall (freebsd-386-cgo), const SYS_SCTP_GENERIC_SENDMSG_IOV = 473 +pkg syscall (freebsd-386-cgo), const SYS_SCTP_PEELOFF = 471 +pkg syscall (freebsd-386-cgo), const SYS_SELECT = 93 +pkg syscall (freebsd-386-cgo), const SYS_SENDFILE = 393 +pkg syscall (freebsd-386-cgo), const SYS_SENDMSG = 28 +pkg syscall (freebsd-386-cgo), const SYS_SENDTO = 133 +pkg syscall (freebsd-386-cgo), const SYS_SETAUDIT = 450 +pkg syscall (freebsd-386-cgo), const SYS_SETAUDIT_ADDR = 452 +pkg syscall (freebsd-386-cgo), const SYS_SETAUID = 448 +pkg syscall (freebsd-386-cgo), const SYS_SETCONTEXT = 422 +pkg syscall (freebsd-386-cgo), const SYS_SETEGID = 182 +pkg syscall (freebsd-386-cgo), const SYS_SETEUID = 183 +pkg syscall (freebsd-386-cgo), const SYS_SETFIB = 175 +pkg syscall (freebsd-386-cgo), const SYS_SETGID = 181 +pkg syscall (freebsd-386-cgo), const SYS_SETGROUPS = 80 +pkg syscall (freebsd-386-cgo), const SYS_SETITIMER = 83 +pkg syscall (freebsd-386-cgo), const SYS_SETLOGIN = 50 +pkg syscall (freebsd-386-cgo), const SYS_SETLOGINCLASS = 524 +pkg syscall (freebsd-386-cgo), const SYS_SETPGID = 82 +pkg syscall (freebsd-386-cgo), const SYS_SETPRIORITY = 96 +pkg syscall (freebsd-386-cgo), const SYS_SETREGID = 127 +pkg syscall (freebsd-386-cgo), const SYS_SETRESGID = 312 +pkg syscall (freebsd-386-cgo), const SYS_SETRESUID = 311 +pkg syscall (freebsd-386-cgo), const SYS_SETREUID = 126 +pkg syscall (freebsd-386-cgo), const SYS_SETRLIMIT = 195 +pkg syscall (freebsd-386-cgo), const SYS_SETSID = 147 +pkg syscall (freebsd-386-cgo), const SYS_SETSOCKOPT = 105 +pkg syscall (freebsd-386-cgo), const SYS_SETTIMEOFDAY = 122 +pkg syscall (freebsd-386-cgo), const SYS_SETUID = 23 +pkg syscall (freebsd-386-cgo), const SYS_SHM_OPEN = 482 +pkg syscall (freebsd-386-cgo), const SYS_SHM_UNLINK = 483 +pkg syscall (freebsd-386-cgo), const SYS_SHUTDOWN = 134 +pkg syscall (freebsd-386-cgo), const SYS_SIGACTION = 416 +pkg syscall (freebsd-386-cgo), const SYS_SIGALTSTACK = 53 +pkg syscall (freebsd-386-cgo), const SYS_SIGPENDING = 343 +pkg syscall (freebsd-386-cgo), const SYS_SIGPROCMASK = 340 +pkg syscall (freebsd-386-cgo), const SYS_SIGQUEUE = 456 +pkg syscall (freebsd-386-cgo), const SYS_SIGRETURN = 417 +pkg syscall (freebsd-386-cgo), const SYS_SIGSUSPEND = 341 +pkg syscall (freebsd-386-cgo), const SYS_SIGTIMEDWAIT = 345 +pkg syscall (freebsd-386-cgo), const SYS_SIGWAIT = 429 +pkg syscall (freebsd-386-cgo), const SYS_SIGWAITINFO = 346 +pkg syscall (freebsd-386-cgo), const SYS_SOCKET = 97 +pkg syscall (freebsd-386-cgo), const SYS_SOCKETPAIR = 135 +pkg syscall (freebsd-386-cgo), const SYS_SSTK = 70 +pkg syscall (freebsd-386-cgo), const SYS_STAT = 188 +pkg syscall (freebsd-386-cgo), const SYS_STATFS = 396 +pkg syscall (freebsd-386-cgo), const SYS_SWAPCONTEXT = 423 +pkg syscall (freebsd-386-cgo), const SYS_SWAPOFF = 424 +pkg syscall (freebsd-386-cgo), const SYS_SWAPON = 85 +pkg syscall (freebsd-386-cgo), const SYS_SYMLINK = 57 +pkg syscall (freebsd-386-cgo), const SYS_SYMLINKAT = 502 +pkg syscall (freebsd-386-cgo), const SYS_SYNC = 36 +pkg syscall (freebsd-386-cgo), const SYS_SYSARCH = 165 +pkg syscall (freebsd-386-cgo), const SYS_THR_CREATE = 430 +pkg syscall (freebsd-386-cgo), const SYS_THR_EXIT = 431 +pkg syscall (freebsd-386-cgo), const SYS_THR_KILL = 433 +pkg syscall (freebsd-386-cgo), const SYS_THR_KILL2 = 481 +pkg syscall (freebsd-386-cgo), const SYS_THR_NEW = 455 +pkg syscall (freebsd-386-cgo), const SYS_THR_SELF = 432 +pkg syscall (freebsd-386-cgo), const SYS_THR_SET_NAME = 464 +pkg syscall (freebsd-386-cgo), const SYS_THR_SUSPEND = 442 +pkg syscall (freebsd-386-cgo), const SYS_THR_WAKE = 443 +pkg syscall (freebsd-386-cgo), const SYS_TRUNCATE = 479 +pkg syscall (freebsd-386-cgo), const SYS_UMASK = 60 +pkg syscall (freebsd-386-cgo), const SYS_UNDELETE = 205 +pkg syscall (freebsd-386-cgo), const SYS_UNLINK = 10 +pkg syscall (freebsd-386-cgo), const SYS_UNLINKAT = 503 +pkg syscall (freebsd-386-cgo), const SYS_UNMOUNT = 22 +pkg syscall (freebsd-386-cgo), const SYS_UTIMES = 138 +pkg syscall (freebsd-386-cgo), const SYS_UTRACE = 335 +pkg syscall (freebsd-386-cgo), const SYS_UUIDGEN = 392 +pkg syscall (freebsd-386-cgo), const SYS_VFORK = 66 +pkg syscall (freebsd-386-cgo), const SYS_WAIT4 = 7 +pkg syscall (freebsd-386-cgo), const SYS_WAIT6 = 532 +pkg syscall (freebsd-386-cgo), const SYS_WRITE = 4 +pkg syscall (freebsd-386-cgo), const SYS_WRITEV = 121 +pkg syscall (freebsd-386-cgo), const SYS_YIELD = 321 +pkg syscall (freebsd-386-cgo), const SYS__UMTX_LOCK = 434 +pkg syscall (freebsd-386-cgo), const SYS__UMTX_OP = 454 +pkg syscall (freebsd-386-cgo), const SYS__UMTX_UNLOCK = 435 +pkg syscall (freebsd-386-cgo), const SYS___ACL_ACLCHECK_FD = 354 +pkg syscall (freebsd-386-cgo), const SYS___ACL_ACLCHECK_FILE = 353 +pkg syscall (freebsd-386-cgo), const SYS___ACL_ACLCHECK_LINK = 428 +pkg syscall (freebsd-386-cgo), const SYS___ACL_DELETE_FD = 352 +pkg syscall (freebsd-386-cgo), const SYS___ACL_DELETE_FILE = 351 +pkg syscall (freebsd-386-cgo), const SYS___ACL_DELETE_LINK = 427 +pkg syscall (freebsd-386-cgo), const SYS___ACL_GET_FD = 349 +pkg syscall (freebsd-386-cgo), const SYS___ACL_GET_FILE = 347 +pkg syscall (freebsd-386-cgo), const SYS___ACL_GET_LINK = 425 +pkg syscall (freebsd-386-cgo), const SYS___ACL_SET_FD = 350 +pkg syscall (freebsd-386-cgo), const SYS___ACL_SET_FILE = 348 +pkg syscall (freebsd-386-cgo), const SYS___ACL_SET_LINK = 426 +pkg syscall (freebsd-386-cgo), const SYS___GETCWD = 326 +pkg syscall (freebsd-386-cgo), const SYS___MAC_EXECVE = 415 +pkg syscall (freebsd-386-cgo), const SYS___MAC_GET_FD = 386 +pkg syscall (freebsd-386-cgo), const SYS___MAC_GET_FILE = 387 +pkg syscall (freebsd-386-cgo), const SYS___MAC_GET_LINK = 410 +pkg syscall (freebsd-386-cgo), const SYS___MAC_GET_PID = 409 +pkg syscall (freebsd-386-cgo), const SYS___MAC_GET_PROC = 384 +pkg syscall (freebsd-386-cgo), const SYS___MAC_SET_FD = 388 +pkg syscall (freebsd-386-cgo), const SYS___MAC_SET_FILE = 389 +pkg syscall (freebsd-386-cgo), const SYS___MAC_SET_LINK = 411 +pkg syscall (freebsd-386-cgo), const SYS___MAC_SET_PROC = 385 +pkg syscall (freebsd-386-cgo), const SYS___SETUGID = 374 +pkg syscall (freebsd-386-cgo), const SYS___SYSCTL = 202 +pkg syscall (freebsd-386-cgo), const S_IFMT = 61440 +pkg syscall (freebsd-386-cgo), const SizeofBpfHdr = 20 +pkg syscall (freebsd-386-cgo), const SizeofBpfInsn = 8 +pkg syscall (freebsd-386-cgo), const SizeofBpfProgram = 8 +pkg syscall (freebsd-386-cgo), const SizeofBpfStat = 8 +pkg syscall (freebsd-386-cgo), const SizeofBpfVersion = 4 +pkg syscall (freebsd-386-cgo), const SizeofBpfZbuf = 12 +pkg syscall (freebsd-386-cgo), const SizeofBpfZbufHeader = 32 +pkg syscall (freebsd-386-cgo), const SizeofCmsghdr = 12 +pkg syscall (freebsd-386-cgo), const SizeofIPMreq = 8 +pkg syscall (freebsd-386-cgo), const SizeofIPMreqn = 12 +pkg syscall (freebsd-386-cgo), const SizeofIPv6Mreq = 20 +pkg syscall (freebsd-386-cgo), const SizeofIfAnnounceMsghdr = 24 +pkg syscall (freebsd-386-cgo), const SizeofIfData = 80 +pkg syscall (freebsd-386-cgo), const SizeofIfMsghdr = 96 +pkg syscall (freebsd-386-cgo), const SizeofIfaMsghdr = 20 +pkg syscall (freebsd-386-cgo), const SizeofIfmaMsghdr = 16 +pkg syscall (freebsd-386-cgo), const SizeofInet6Pktinfo = 20 +pkg syscall (freebsd-386-cgo), const SizeofLinger = 8 +pkg syscall (freebsd-386-cgo), const SizeofMsghdr = 28 +pkg syscall (freebsd-386-cgo), const SizeofRtMetrics = 56 +pkg syscall (freebsd-386-cgo), const SizeofRtMsghdr = 92 +pkg syscall (freebsd-386-cgo), const SizeofSockaddrAny = 108 +pkg syscall (freebsd-386-cgo), const SizeofSockaddrDatalink = 54 +pkg syscall (freebsd-386-cgo), const SizeofSockaddrInet4 = 16 +pkg syscall (freebsd-386-cgo), const SizeofSockaddrInet6 = 28 +pkg syscall (freebsd-386-cgo), const SizeofSockaddrUnix = 106 +pkg syscall (freebsd-386-cgo), const TCIFLUSH = 1 +pkg syscall (freebsd-386-cgo), const TCIOFLUSH = 3 +pkg syscall (freebsd-386-cgo), const TCOFLUSH = 2 +pkg syscall (freebsd-386-cgo), const TCP_CA_NAME_MAX = 16 +pkg syscall (freebsd-386-cgo), const TCP_CONGESTION = 64 +pkg syscall (freebsd-386-cgo), const TCP_INFO = 32 +pkg syscall (freebsd-386-cgo), const TCP_KEEPCNT = 1024 +pkg syscall (freebsd-386-cgo), const TCP_KEEPIDLE = 256 +pkg syscall (freebsd-386-cgo), const TCP_KEEPINIT = 128 +pkg syscall (freebsd-386-cgo), const TCP_KEEPINTVL = 512 +pkg syscall (freebsd-386-cgo), const TCP_MAXBURST = 4 +pkg syscall (freebsd-386-cgo), const TCP_MAXHLEN = 60 +pkg syscall (freebsd-386-cgo), const TCP_MAXOLEN = 40 +pkg syscall (freebsd-386-cgo), const TCP_MAXSEG = 2 +pkg syscall (freebsd-386-cgo), const TCP_MAXWIN = 65535 +pkg syscall (freebsd-386-cgo), const TCP_MAX_SACK = 4 +pkg syscall (freebsd-386-cgo), const TCP_MAX_WINSHIFT = 14 +pkg syscall (freebsd-386-cgo), const TCP_MD5SIG = 16 +pkg syscall (freebsd-386-cgo), const TCP_MINMSS = 216 +pkg syscall (freebsd-386-cgo), const TCP_MSS = 536 +pkg syscall (freebsd-386-cgo), const TCP_NOOPT = 8 +pkg syscall (freebsd-386-cgo), const TCP_NOPUSH = 4 +pkg syscall (freebsd-386-cgo), const TCSAFLUSH = 2 +pkg syscall (freebsd-386-cgo), const TIOCCBRK = 536900730 +pkg syscall (freebsd-386-cgo), const TIOCCDTR = 536900728 +pkg syscall (freebsd-386-cgo), const TIOCCONS = 2147775586 +pkg syscall (freebsd-386-cgo), const TIOCDRAIN = 536900702 +pkg syscall (freebsd-386-cgo), const TIOCEXCL = 536900621 +pkg syscall (freebsd-386-cgo), const TIOCEXT = 2147775584 +pkg syscall (freebsd-386-cgo), const TIOCFLUSH = 2147775504 +pkg syscall (freebsd-386-cgo), const TIOCGDRAINWAIT = 1074033750 +pkg syscall (freebsd-386-cgo), const TIOCGETA = 1076655123 +pkg syscall (freebsd-386-cgo), const TIOCGETD = 1074033690 +pkg syscall (freebsd-386-cgo), const TIOCGPGRP = 1074033783 +pkg syscall (freebsd-386-cgo), const TIOCGPTN = 1074033679 +pkg syscall (freebsd-386-cgo), const TIOCGSID = 1074033763 +pkg syscall (freebsd-386-cgo), const TIOCGWINSZ = 1074295912 +pkg syscall (freebsd-386-cgo), const TIOCMBIC = 2147775595 +pkg syscall (freebsd-386-cgo), const TIOCMBIS = 2147775596 +pkg syscall (freebsd-386-cgo), const TIOCMGDTRWAIT = 1074033754 +pkg syscall (freebsd-386-cgo), const TIOCMGET = 1074033770 +pkg syscall (freebsd-386-cgo), const TIOCMSDTRWAIT = 2147775579 +pkg syscall (freebsd-386-cgo), const TIOCMSET = 2147775597 +pkg syscall (freebsd-386-cgo), const TIOCM_CAR = 64 +pkg syscall (freebsd-386-cgo), const TIOCM_CD = 64 +pkg syscall (freebsd-386-cgo), const TIOCM_CTS = 32 +pkg syscall (freebsd-386-cgo), const TIOCM_DCD = 64 +pkg syscall (freebsd-386-cgo), const TIOCM_DSR = 256 +pkg syscall (freebsd-386-cgo), const TIOCM_DTR = 2 +pkg syscall (freebsd-386-cgo), const TIOCM_LE = 1 +pkg syscall (freebsd-386-cgo), const TIOCM_RI = 128 +pkg syscall (freebsd-386-cgo), const TIOCM_RNG = 128 +pkg syscall (freebsd-386-cgo), const TIOCM_RTS = 4 +pkg syscall (freebsd-386-cgo), const TIOCM_SR = 16 +pkg syscall (freebsd-386-cgo), const TIOCM_ST = 8 +pkg syscall (freebsd-386-cgo), const TIOCNOTTY = 536900721 +pkg syscall (freebsd-386-cgo), const TIOCNXCL = 536900622 +pkg syscall (freebsd-386-cgo), const TIOCOUTQ = 1074033779 +pkg syscall (freebsd-386-cgo), const TIOCPKT = 2147775600 +pkg syscall (freebsd-386-cgo), const TIOCPKT_DATA = 0 +pkg syscall (freebsd-386-cgo), const TIOCPKT_DOSTOP = 32 +pkg syscall (freebsd-386-cgo), const TIOCPKT_FLUSHREAD = 1 +pkg syscall (freebsd-386-cgo), const TIOCPKT_FLUSHWRITE = 2 +pkg syscall (freebsd-386-cgo), const TIOCPKT_IOCTL = 64 +pkg syscall (freebsd-386-cgo), const TIOCPKT_NOSTOP = 16 +pkg syscall (freebsd-386-cgo), const TIOCPKT_START = 8 +pkg syscall (freebsd-386-cgo), const TIOCPKT_STOP = 4 +pkg syscall (freebsd-386-cgo), const TIOCPTMASTER = 536900636 +pkg syscall (freebsd-386-cgo), const TIOCSBRK = 536900731 +pkg syscall (freebsd-386-cgo), const TIOCSCTTY = 536900705 +pkg syscall (freebsd-386-cgo), const TIOCSDRAINWAIT = 2147775575 +pkg syscall (freebsd-386-cgo), const TIOCSDTR = 536900729 +pkg syscall (freebsd-386-cgo), const TIOCSETA = 2150396948 +pkg syscall (freebsd-386-cgo), const TIOCSETAF = 2150396950 +pkg syscall (freebsd-386-cgo), const TIOCSETAW = 2150396949 +pkg syscall (freebsd-386-cgo), const TIOCSETD = 2147775515 +pkg syscall (freebsd-386-cgo), const TIOCSIG = 537162847 +pkg syscall (freebsd-386-cgo), const TIOCSPGRP = 2147775606 +pkg syscall (freebsd-386-cgo), const TIOCSTART = 536900718 +pkg syscall (freebsd-386-cgo), const TIOCSTAT = 536900709 +pkg syscall (freebsd-386-cgo), const TIOCSTI = 2147578994 +pkg syscall (freebsd-386-cgo), const TIOCSTOP = 536900719 +pkg syscall (freebsd-386-cgo), const TIOCSWINSZ = 2148037735 +pkg syscall (freebsd-386-cgo), const TIOCTIMESTAMP = 1074295897 +pkg syscall (freebsd-386-cgo), const TIOCUCNTL = 2147775590 +pkg syscall (freebsd-386-cgo), const TOSTOP = 4194304 +pkg syscall (freebsd-386-cgo), const VDISCARD = 15 +pkg syscall (freebsd-386-cgo), const VDSUSP = 11 +pkg syscall (freebsd-386-cgo), const VEOF = 0 +pkg syscall (freebsd-386-cgo), const VEOL = 1 +pkg syscall (freebsd-386-cgo), const VEOL2 = 2 +pkg syscall (freebsd-386-cgo), const VERASE = 3 +pkg syscall (freebsd-386-cgo), const VERASE2 = 7 +pkg syscall (freebsd-386-cgo), const VINTR = 8 +pkg syscall (freebsd-386-cgo), const VKILL = 5 +pkg syscall (freebsd-386-cgo), const VLNEXT = 14 +pkg syscall (freebsd-386-cgo), const VMIN = 16 +pkg syscall (freebsd-386-cgo), const VQUIT = 9 +pkg syscall (freebsd-386-cgo), const VREPRINT = 6 +pkg syscall (freebsd-386-cgo), const VSTART = 12 +pkg syscall (freebsd-386-cgo), const VSTATUS = 18 +pkg syscall (freebsd-386-cgo), const VSTOP = 13 +pkg syscall (freebsd-386-cgo), const VSUSP = 10 +pkg syscall (freebsd-386-cgo), const VTIME = 17 +pkg syscall (freebsd-386-cgo), const VWERASE = 4 +pkg syscall (freebsd-386-cgo), const WCONTINUED = 4 +pkg syscall (freebsd-386-cgo), const WCOREFLAG = 128 +pkg syscall (freebsd-386-cgo), const WLINUXCLONE = 2147483648 +pkg syscall (freebsd-386-cgo), const WNOHANG = 1 +pkg syscall (freebsd-386-cgo), const WNOWAIT = 8 +pkg syscall (freebsd-386-cgo), const WSTOPPED = 2 +pkg syscall (freebsd-386-cgo), const WUNTRACED = 2 +pkg syscall (freebsd-amd64), const AF_APPLETALK = 16 +pkg syscall (freebsd-amd64), const AF_ARP = 35 +pkg syscall (freebsd-amd64), const AF_ATM = 30 +pkg syscall (freebsd-amd64), const AF_BLUETOOTH = 36 +pkg syscall (freebsd-amd64), const AF_CCITT = 10 +pkg syscall (freebsd-amd64), const AF_CHAOS = 5 +pkg syscall (freebsd-amd64), const AF_CNT = 21 +pkg syscall (freebsd-amd64), const AF_COIP = 20 +pkg syscall (freebsd-amd64), const AF_DATAKIT = 9 +pkg syscall (freebsd-amd64), const AF_DECnet = 12 +pkg syscall (freebsd-amd64), const AF_DLI = 13 +pkg syscall (freebsd-amd64), const AF_E164 = 26 +pkg syscall (freebsd-amd64), const AF_ECMA = 8 +pkg syscall (freebsd-amd64), const AF_HYLINK = 15 +pkg syscall (freebsd-amd64), const AF_IEEE80211 = 37 +pkg syscall (freebsd-amd64), const AF_IMPLINK = 3 +pkg syscall (freebsd-amd64), const AF_INET6 = 28 +pkg syscall (freebsd-amd64), const AF_IPX = 23 +pkg syscall (freebsd-amd64), const AF_ISDN = 26 +pkg syscall (freebsd-amd64), const AF_ISO = 7 +pkg syscall (freebsd-amd64), const AF_LAT = 14 +pkg syscall (freebsd-amd64), const AF_LINK = 18 +pkg syscall (freebsd-amd64), const AF_LOCAL = 1 +pkg syscall (freebsd-amd64), const AF_MAX = 38 +pkg syscall (freebsd-amd64), const AF_NATM = 29 +pkg syscall (freebsd-amd64), const AF_NETBIOS = 6 +pkg syscall (freebsd-amd64), const AF_NETGRAPH = 32 +pkg syscall (freebsd-amd64), const AF_OSI = 7 +pkg syscall (freebsd-amd64), const AF_PUP = 4 +pkg syscall (freebsd-amd64), const AF_ROUTE = 17 +pkg syscall (freebsd-amd64), const AF_SCLUSTER = 34 +pkg syscall (freebsd-amd64), const AF_SIP = 24 +pkg syscall (freebsd-amd64), const AF_SLOW = 33 +pkg syscall (freebsd-amd64), const AF_SNA = 11 +pkg syscall (freebsd-amd64), const AF_VENDOR00 = 39 +pkg syscall (freebsd-amd64), const AF_VENDOR01 = 41 +pkg syscall (freebsd-amd64), const AF_VENDOR02 = 43 +pkg syscall (freebsd-amd64), const AF_VENDOR03 = 45 +pkg syscall (freebsd-amd64), const AF_VENDOR04 = 47 +pkg syscall (freebsd-amd64), const AF_VENDOR05 = 49 +pkg syscall (freebsd-amd64), const AF_VENDOR06 = 51 +pkg syscall (freebsd-amd64), const AF_VENDOR07 = 53 +pkg syscall (freebsd-amd64), const AF_VENDOR08 = 55 +pkg syscall (freebsd-amd64), const AF_VENDOR09 = 57 +pkg syscall (freebsd-amd64), const AF_VENDOR10 = 59 +pkg syscall (freebsd-amd64), const AF_VENDOR11 = 61 +pkg syscall (freebsd-amd64), const AF_VENDOR12 = 63 +pkg syscall (freebsd-amd64), const AF_VENDOR13 = 65 +pkg syscall (freebsd-amd64), const AF_VENDOR14 = 67 +pkg syscall (freebsd-amd64), const AF_VENDOR15 = 69 +pkg syscall (freebsd-amd64), const AF_VENDOR16 = 71 +pkg syscall (freebsd-amd64), const AF_VENDOR17 = 73 +pkg syscall (freebsd-amd64), const AF_VENDOR18 = 75 +pkg syscall (freebsd-amd64), const AF_VENDOR19 = 77 +pkg syscall (freebsd-amd64), const AF_VENDOR20 = 79 +pkg syscall (freebsd-amd64), const AF_VENDOR21 = 81 +pkg syscall (freebsd-amd64), const AF_VENDOR22 = 83 +pkg syscall (freebsd-amd64), const AF_VENDOR23 = 85 +pkg syscall (freebsd-amd64), const AF_VENDOR24 = 87 +pkg syscall (freebsd-amd64), const AF_VENDOR25 = 89 +pkg syscall (freebsd-amd64), const AF_VENDOR26 = 91 +pkg syscall (freebsd-amd64), const AF_VENDOR27 = 93 +pkg syscall (freebsd-amd64), const AF_VENDOR28 = 95 +pkg syscall (freebsd-amd64), const AF_VENDOR29 = 97 +pkg syscall (freebsd-amd64), const AF_VENDOR30 = 99 +pkg syscall (freebsd-amd64), const AF_VENDOR31 = 101 +pkg syscall (freebsd-amd64), const AF_VENDOR32 = 103 +pkg syscall (freebsd-amd64), const AF_VENDOR33 = 105 +pkg syscall (freebsd-amd64), const AF_VENDOR34 = 107 +pkg syscall (freebsd-amd64), const AF_VENDOR35 = 109 +pkg syscall (freebsd-amd64), const AF_VENDOR36 = 111 +pkg syscall (freebsd-amd64), const AF_VENDOR37 = 113 +pkg syscall (freebsd-amd64), const AF_VENDOR38 = 115 +pkg syscall (freebsd-amd64), const AF_VENDOR39 = 117 +pkg syscall (freebsd-amd64), const AF_VENDOR40 = 119 +pkg syscall (freebsd-amd64), const AF_VENDOR41 = 121 +pkg syscall (freebsd-amd64), const AF_VENDOR42 = 123 +pkg syscall (freebsd-amd64), const AF_VENDOR43 = 125 +pkg syscall (freebsd-amd64), const AF_VENDOR44 = 127 +pkg syscall (freebsd-amd64), const AF_VENDOR45 = 129 +pkg syscall (freebsd-amd64), const AF_VENDOR46 = 131 +pkg syscall (freebsd-amd64), const AF_VENDOR47 = 133 +pkg syscall (freebsd-amd64), const B0 = 0 +pkg syscall (freebsd-amd64), const B0 ideal-int +pkg syscall (freebsd-amd64), const B110 = 110 +pkg syscall (freebsd-amd64), const B110 ideal-int +pkg syscall (freebsd-amd64), const B115200 = 115200 +pkg syscall (freebsd-amd64), const B115200 ideal-int +pkg syscall (freebsd-amd64), const B1200 = 1200 +pkg syscall (freebsd-amd64), const B1200 ideal-int +pkg syscall (freebsd-amd64), const B134 = 134 +pkg syscall (freebsd-amd64), const B134 ideal-int +pkg syscall (freebsd-amd64), const B14400 = 14400 +pkg syscall (freebsd-amd64), const B14400 ideal-int +pkg syscall (freebsd-amd64), const B150 = 150 +pkg syscall (freebsd-amd64), const B150 ideal-int +pkg syscall (freebsd-amd64), const B1800 = 1800 +pkg syscall (freebsd-amd64), const B1800 ideal-int +pkg syscall (freebsd-amd64), const B19200 = 19200 +pkg syscall (freebsd-amd64), const B19200 ideal-int +pkg syscall (freebsd-amd64), const B200 = 200 +pkg syscall (freebsd-amd64), const B200 ideal-int +pkg syscall (freebsd-amd64), const B230400 = 230400 +pkg syscall (freebsd-amd64), const B230400 ideal-int +pkg syscall (freebsd-amd64), const B2400 = 2400 +pkg syscall (freebsd-amd64), const B2400 ideal-int +pkg syscall (freebsd-amd64), const B28800 = 28800 +pkg syscall (freebsd-amd64), const B28800 ideal-int +pkg syscall (freebsd-amd64), const B300 = 300 +pkg syscall (freebsd-amd64), const B300 ideal-int +pkg syscall (freebsd-amd64), const B38400 = 38400 +pkg syscall (freebsd-amd64), const B38400 ideal-int +pkg syscall (freebsd-amd64), const B460800 = 460800 +pkg syscall (freebsd-amd64), const B460800 ideal-int +pkg syscall (freebsd-amd64), const B4800 = 4800 +pkg syscall (freebsd-amd64), const B4800 ideal-int +pkg syscall (freebsd-amd64), const B50 = 50 +pkg syscall (freebsd-amd64), const B50 ideal-int +pkg syscall (freebsd-amd64), const B57600 = 57600 +pkg syscall (freebsd-amd64), const B57600 ideal-int +pkg syscall (freebsd-amd64), const B600 = 600 +pkg syscall (freebsd-amd64), const B600 ideal-int +pkg syscall (freebsd-amd64), const B7200 = 7200 +pkg syscall (freebsd-amd64), const B7200 ideal-int +pkg syscall (freebsd-amd64), const B75 = 75 +pkg syscall (freebsd-amd64), const B75 ideal-int +pkg syscall (freebsd-amd64), const B76800 = 76800 +pkg syscall (freebsd-amd64), const B76800 ideal-int +pkg syscall (freebsd-amd64), const B921600 = 921600 +pkg syscall (freebsd-amd64), const B921600 ideal-int +pkg syscall (freebsd-amd64), const B9600 = 9600 +pkg syscall (freebsd-amd64), const B9600 ideal-int +pkg syscall (freebsd-amd64), const BIOCFEEDBACK = 2147762812 +pkg syscall (freebsd-amd64), const BIOCFLUSH = 536887912 +pkg syscall (freebsd-amd64), const BIOCGBLEN = 1074020966 +pkg syscall (freebsd-amd64), const BIOCGDIRECTION = 1074020982 +pkg syscall (freebsd-amd64), const BIOCGDLT = 1074020970 +pkg syscall (freebsd-amd64), const BIOCGDLTLIST = 3222291065 +pkg syscall (freebsd-amd64), const BIOCGETBUFMODE = 1074020989 +pkg syscall (freebsd-amd64), const BIOCGETIF = 1075855979 +pkg syscall (freebsd-amd64), const BIOCGETZMAX = 1074283135 +pkg syscall (freebsd-amd64), const BIOCGHDRCMPLT = 1074020980 +pkg syscall (freebsd-amd64), const BIOCGRSIG = 1074020978 +pkg syscall (freebsd-amd64), const BIOCGRTIMEOUT = 1074807406 +pkg syscall (freebsd-amd64), const BIOCGSEESENT = 1074020982 +pkg syscall (freebsd-amd64), const BIOCGSTATS = 1074283119 +pkg syscall (freebsd-amd64), const BIOCGTSTAMP = 1074020995 +pkg syscall (freebsd-amd64), const BIOCGTSTAMP ideal-int +pkg syscall (freebsd-amd64), const BIOCIMMEDIATE = 2147762800 +pkg syscall (freebsd-amd64), const BIOCLOCK = 536887930 +pkg syscall (freebsd-amd64), const BIOCPROMISC = 536887913 +pkg syscall (freebsd-amd64), const BIOCROTZBUF = 1075331712 +pkg syscall (freebsd-amd64), const BIOCSBLEN = 3221504614 +pkg syscall (freebsd-amd64), const BIOCSDIRECTION = 2147762807 +pkg syscall (freebsd-amd64), const BIOCSDLT = 2147762808 +pkg syscall (freebsd-amd64), const BIOCSETBUFMODE = 2147762814 +pkg syscall (freebsd-amd64), const BIOCSETF = 2148549223 +pkg syscall (freebsd-amd64), const BIOCSETFNR = 2148549250 +pkg syscall (freebsd-amd64), const BIOCSETIF = 2149597804 +pkg syscall (freebsd-amd64), const BIOCSETWF = 2148549243 +pkg syscall (freebsd-amd64), const BIOCSETZBUF = 2149073537 +pkg syscall (freebsd-amd64), const BIOCSHDRCMPLT = 2147762805 +pkg syscall (freebsd-amd64), const BIOCSRSIG = 2147762803 +pkg syscall (freebsd-amd64), const BIOCSRTIMEOUT = 2148549229 +pkg syscall (freebsd-amd64), const BIOCSSEESENT = 2147762807 +pkg syscall (freebsd-amd64), const BIOCSTSTAMP = 2147762820 +pkg syscall (freebsd-amd64), const BIOCSTSTAMP ideal-int +pkg syscall (freebsd-amd64), const BIOCVERSION = 1074020977 +pkg syscall (freebsd-amd64), const BPF_A = 16 +pkg syscall (freebsd-amd64), const BPF_ABS = 32 +pkg syscall (freebsd-amd64), const BPF_ADD = 0 +pkg syscall (freebsd-amd64), const BPF_ALIGNMENT = 8 +pkg syscall (freebsd-amd64), const BPF_ALU = 4 +pkg syscall (freebsd-amd64), const BPF_AND = 80 +pkg syscall (freebsd-amd64), const BPF_B = 16 +pkg syscall (freebsd-amd64), const BPF_BUFMODE_BUFFER = 1 +pkg syscall (freebsd-amd64), const BPF_BUFMODE_ZBUF = 2 +pkg syscall (freebsd-amd64), const BPF_DIV = 48 +pkg syscall (freebsd-amd64), const BPF_H = 8 +pkg syscall (freebsd-amd64), const BPF_IMM = 0 +pkg syscall (freebsd-amd64), const BPF_IND = 64 +pkg syscall (freebsd-amd64), const BPF_JA = 0 +pkg syscall (freebsd-amd64), const BPF_JEQ = 16 +pkg syscall (freebsd-amd64), const BPF_JGE = 48 +pkg syscall (freebsd-amd64), const BPF_JGT = 32 +pkg syscall (freebsd-amd64), const BPF_JMP = 5 +pkg syscall (freebsd-amd64), const BPF_JSET = 64 +pkg syscall (freebsd-amd64), const BPF_K = 0 +pkg syscall (freebsd-amd64), const BPF_LD = 0 +pkg syscall (freebsd-amd64), const BPF_LDX = 1 +pkg syscall (freebsd-amd64), const BPF_LEN = 128 +pkg syscall (freebsd-amd64), const BPF_LSH = 96 +pkg syscall (freebsd-amd64), const BPF_MAJOR_VERSION = 1 +pkg syscall (freebsd-amd64), const BPF_MAXBUFSIZE = 524288 +pkg syscall (freebsd-amd64), const BPF_MAXINSNS = 512 +pkg syscall (freebsd-amd64), const BPF_MEM = 96 +pkg syscall (freebsd-amd64), const BPF_MEMWORDS = 16 +pkg syscall (freebsd-amd64), const BPF_MINBUFSIZE = 32 +pkg syscall (freebsd-amd64), const BPF_MINOR_VERSION = 1 +pkg syscall (freebsd-amd64), const BPF_MISC = 7 +pkg syscall (freebsd-amd64), const BPF_MSH = 160 +pkg syscall (freebsd-amd64), const BPF_MUL = 32 +pkg syscall (freebsd-amd64), const BPF_NEG = 128 +pkg syscall (freebsd-amd64), const BPF_OR = 64 +pkg syscall (freebsd-amd64), const BPF_RELEASE = 199606 +pkg syscall (freebsd-amd64), const BPF_RET = 6 +pkg syscall (freebsd-amd64), const BPF_RSH = 112 +pkg syscall (freebsd-amd64), const BPF_ST = 2 +pkg syscall (freebsd-amd64), const BPF_STX = 3 +pkg syscall (freebsd-amd64), const BPF_SUB = 16 +pkg syscall (freebsd-amd64), const BPF_TAX = 0 +pkg syscall (freebsd-amd64), const BPF_TXA = 128 +pkg syscall (freebsd-amd64), const BPF_T_BINTIME = 2 +pkg syscall (freebsd-amd64), const BPF_T_BINTIME ideal-int +pkg syscall (freebsd-amd64), const BPF_T_BINTIME_FAST = 258 +pkg syscall (freebsd-amd64), const BPF_T_BINTIME_FAST ideal-int +pkg syscall (freebsd-amd64), const BPF_T_BINTIME_MONOTONIC = 514 +pkg syscall (freebsd-amd64), const BPF_T_BINTIME_MONOTONIC ideal-int +pkg syscall (freebsd-amd64), const BPF_T_BINTIME_MONOTONIC_FAST = 770 +pkg syscall (freebsd-amd64), const BPF_T_BINTIME_MONOTONIC_FAST ideal-int +pkg syscall (freebsd-amd64), const BPF_T_FAST = 256 +pkg syscall (freebsd-amd64), const BPF_T_FAST ideal-int +pkg syscall (freebsd-amd64), const BPF_T_FLAG_MASK = 768 +pkg syscall (freebsd-amd64), const BPF_T_FLAG_MASK ideal-int +pkg syscall (freebsd-amd64), const BPF_T_FORMAT_MASK = 3 +pkg syscall (freebsd-amd64), const BPF_T_FORMAT_MASK ideal-int +pkg syscall (freebsd-amd64), const BPF_T_MICROTIME = 0 +pkg syscall (freebsd-amd64), const BPF_T_MICROTIME ideal-int +pkg syscall (freebsd-amd64), const BPF_T_MICROTIME_FAST = 256 +pkg syscall (freebsd-amd64), const BPF_T_MICROTIME_FAST ideal-int +pkg syscall (freebsd-amd64), const BPF_T_MICROTIME_MONOTONIC = 512 +pkg syscall (freebsd-amd64), const BPF_T_MICROTIME_MONOTONIC ideal-int +pkg syscall (freebsd-amd64), const BPF_T_MICROTIME_MONOTONIC_FAST = 768 +pkg syscall (freebsd-amd64), const BPF_T_MICROTIME_MONOTONIC_FAST ideal-int +pkg syscall (freebsd-amd64), const BPF_T_MONOTONIC = 512 +pkg syscall (freebsd-amd64), const BPF_T_MONOTONIC ideal-int +pkg syscall (freebsd-amd64), const BPF_T_MONOTONIC_FAST = 768 +pkg syscall (freebsd-amd64), const BPF_T_MONOTONIC_FAST ideal-int +pkg syscall (freebsd-amd64), const BPF_T_NANOTIME = 1 +pkg syscall (freebsd-amd64), const BPF_T_NANOTIME ideal-int +pkg syscall (freebsd-amd64), const BPF_T_NANOTIME_FAST = 257 +pkg syscall (freebsd-amd64), const BPF_T_NANOTIME_FAST ideal-int +pkg syscall (freebsd-amd64), const BPF_T_NANOTIME_MONOTONIC = 513 +pkg syscall (freebsd-amd64), const BPF_T_NANOTIME_MONOTONIC ideal-int +pkg syscall (freebsd-amd64), const BPF_T_NANOTIME_MONOTONIC_FAST = 769 +pkg syscall (freebsd-amd64), const BPF_T_NANOTIME_MONOTONIC_FAST ideal-int +pkg syscall (freebsd-amd64), const BPF_T_NONE = 3 +pkg syscall (freebsd-amd64), const BPF_T_NONE ideal-int +pkg syscall (freebsd-amd64), const BPF_T_NORMAL = 0 +pkg syscall (freebsd-amd64), const BPF_T_NORMAL ideal-int +pkg syscall (freebsd-amd64), const BPF_W = 0 +pkg syscall (freebsd-amd64), const BPF_X = 8 +pkg syscall (freebsd-amd64), const BRKINT = 2 +pkg syscall (freebsd-amd64), const BRKINT ideal-int +pkg syscall (freebsd-amd64), const CFLUSH = 15 +pkg syscall (freebsd-amd64), const CFLUSH ideal-int +pkg syscall (freebsd-amd64), const CLOCAL = 32768 +pkg syscall (freebsd-amd64), const CLOCAL ideal-int +pkg syscall (freebsd-amd64), const CREAD = 2048 +pkg syscall (freebsd-amd64), const CREAD ideal-int +pkg syscall (freebsd-amd64), const CS5 = 0 +pkg syscall (freebsd-amd64), const CS5 ideal-int +pkg syscall (freebsd-amd64), const CS6 = 256 +pkg syscall (freebsd-amd64), const CS6 ideal-int +pkg syscall (freebsd-amd64), const CS7 = 512 +pkg syscall (freebsd-amd64), const CS7 ideal-int +pkg syscall (freebsd-amd64), const CS8 = 768 +pkg syscall (freebsd-amd64), const CS8 ideal-int +pkg syscall (freebsd-amd64), const CSIZE = 768 +pkg syscall (freebsd-amd64), const CSIZE ideal-int +pkg syscall (freebsd-amd64), const CSTART = 17 +pkg syscall (freebsd-amd64), const CSTART ideal-int +pkg syscall (freebsd-amd64), const CSTATUS = 20 +pkg syscall (freebsd-amd64), const CSTATUS ideal-int +pkg syscall (freebsd-amd64), const CSTOP = 19 +pkg syscall (freebsd-amd64), const CSTOP ideal-int +pkg syscall (freebsd-amd64), const CSTOPB = 1024 +pkg syscall (freebsd-amd64), const CSTOPB ideal-int +pkg syscall (freebsd-amd64), const CSUSP = 26 +pkg syscall (freebsd-amd64), const CSUSP ideal-int +pkg syscall (freebsd-amd64), const CTL_MAXNAME = 24 +pkg syscall (freebsd-amd64), const CTL_NET = 4 +pkg syscall (freebsd-amd64), const DLT_A429 = 184 +pkg syscall (freebsd-amd64), const DLT_A653_ICM = 185 +pkg syscall (freebsd-amd64), const DLT_AIRONET_HEADER = 120 +pkg syscall (freebsd-amd64), const DLT_AOS = 222 +pkg syscall (freebsd-amd64), const DLT_AOS ideal-int +pkg syscall (freebsd-amd64), const DLT_APPLE_IP_OVER_IEEE1394 = 138 +pkg syscall (freebsd-amd64), const DLT_ARCNET = 7 +pkg syscall (freebsd-amd64), const DLT_ARCNET_LINUX = 129 +pkg syscall (freebsd-amd64), const DLT_ATM_CLIP = 19 +pkg syscall (freebsd-amd64), const DLT_ATM_RFC1483 = 11 +pkg syscall (freebsd-amd64), const DLT_AURORA = 126 +pkg syscall (freebsd-amd64), const DLT_AX25 = 3 +pkg syscall (freebsd-amd64), const DLT_AX25_KISS = 202 +pkg syscall (freebsd-amd64), const DLT_BACNET_MS_TP = 165 +pkg syscall (freebsd-amd64), const DLT_BLUETOOTH_HCI_H4 = 187 +pkg syscall (freebsd-amd64), const DLT_BLUETOOTH_HCI_H4_WITH_PHDR = 201 +pkg syscall (freebsd-amd64), const DLT_CAN20B = 190 +pkg syscall (freebsd-amd64), const DLT_CAN_SOCKETCAN = 227 +pkg syscall (freebsd-amd64), const DLT_CAN_SOCKETCAN ideal-int +pkg syscall (freebsd-amd64), const DLT_CHAOS = 5 +pkg syscall (freebsd-amd64), const DLT_CHDLC = 104 +pkg syscall (freebsd-amd64), const DLT_CISCO_IOS = 118 +pkg syscall (freebsd-amd64), const DLT_C_HDLC = 104 +pkg syscall (freebsd-amd64), const DLT_C_HDLC_WITH_DIR = 205 +pkg syscall (freebsd-amd64), const DLT_DBUS = 231 +pkg syscall (freebsd-amd64), const DLT_DBUS ideal-int +pkg syscall (freebsd-amd64), const DLT_DECT = 221 +pkg syscall (freebsd-amd64), const DLT_DECT ideal-int +pkg syscall (freebsd-amd64), const DLT_DOCSIS = 143 +pkg syscall (freebsd-amd64), const DLT_DVB_CI = 235 +pkg syscall (freebsd-amd64), const DLT_DVB_CI ideal-int +pkg syscall (freebsd-amd64), const DLT_ECONET = 115 +pkg syscall (freebsd-amd64), const DLT_EN10MB = 1 +pkg syscall (freebsd-amd64), const DLT_EN3MB = 2 +pkg syscall (freebsd-amd64), const DLT_ENC = 109 +pkg syscall (freebsd-amd64), const DLT_ERF = 197 +pkg syscall (freebsd-amd64), const DLT_ERF_ETH = 175 +pkg syscall (freebsd-amd64), const DLT_ERF_POS = 176 +pkg syscall (freebsd-amd64), const DLT_FC_2 = 224 +pkg syscall (freebsd-amd64), const DLT_FC_2 ideal-int +pkg syscall (freebsd-amd64), const DLT_FC_2_WITH_FRAME_DELIMS = 225 +pkg syscall (freebsd-amd64), const DLT_FC_2_WITH_FRAME_DELIMS ideal-int +pkg syscall (freebsd-amd64), const DLT_FDDI = 10 +pkg syscall (freebsd-amd64), const DLT_FLEXRAY = 210 +pkg syscall (freebsd-amd64), const DLT_FRELAY = 107 +pkg syscall (freebsd-amd64), const DLT_FRELAY_WITH_DIR = 206 +pkg syscall (freebsd-amd64), const DLT_GCOM_SERIAL = 173 +pkg syscall (freebsd-amd64), const DLT_GCOM_T1E1 = 172 +pkg syscall (freebsd-amd64), const DLT_GPF_F = 171 +pkg syscall (freebsd-amd64), const DLT_GPF_T = 170 +pkg syscall (freebsd-amd64), const DLT_GPRS_LLC = 169 +pkg syscall (freebsd-amd64), const DLT_GSMTAP_ABIS = 218 +pkg syscall (freebsd-amd64), const DLT_GSMTAP_ABIS ideal-int +pkg syscall (freebsd-amd64), const DLT_GSMTAP_UM = 217 +pkg syscall (freebsd-amd64), const DLT_GSMTAP_UM ideal-int +pkg syscall (freebsd-amd64), const DLT_HHDLC = 121 +pkg syscall (freebsd-amd64), const DLT_IBM_SN = 146 +pkg syscall (freebsd-amd64), const DLT_IBM_SP = 145 +pkg syscall (freebsd-amd64), const DLT_IEEE802 = 6 +pkg syscall (freebsd-amd64), const DLT_IEEE802_11 = 105 +pkg syscall (freebsd-amd64), const DLT_IEEE802_11_RADIO = 127 +pkg syscall (freebsd-amd64), const DLT_IEEE802_11_RADIO_AVS = 163 +pkg syscall (freebsd-amd64), const DLT_IEEE802_15_4 = 195 +pkg syscall (freebsd-amd64), const DLT_IEEE802_15_4_LINUX = 191 +pkg syscall (freebsd-amd64), const DLT_IEEE802_15_4_NOFCS = 230 +pkg syscall (freebsd-amd64), const DLT_IEEE802_15_4_NOFCS ideal-int +pkg syscall (freebsd-amd64), const DLT_IEEE802_15_4_NONASK_PHY = 215 +pkg syscall (freebsd-amd64), const DLT_IEEE802_16_MAC_CPS = 188 +pkg syscall (freebsd-amd64), const DLT_IEEE802_16_MAC_CPS_RADIO = 193 +pkg syscall (freebsd-amd64), const DLT_IPFILTER = 116 +pkg syscall (freebsd-amd64), const DLT_IPMB = 199 +pkg syscall (freebsd-amd64), const DLT_IPMB_LINUX = 209 +pkg syscall (freebsd-amd64), const DLT_IPNET = 226 +pkg syscall (freebsd-amd64), const DLT_IPNET ideal-int +pkg syscall (freebsd-amd64), const DLT_IPOIB = 242 +pkg syscall (freebsd-amd64), const DLT_IPOIB ideal-int +pkg syscall (freebsd-amd64), const DLT_IPV4 = 228 +pkg syscall (freebsd-amd64), const DLT_IPV4 ideal-int +pkg syscall (freebsd-amd64), const DLT_IPV6 = 229 +pkg syscall (freebsd-amd64), const DLT_IPV6 ideal-int +pkg syscall (freebsd-amd64), const DLT_IP_OVER_FC = 122 +pkg syscall (freebsd-amd64), const DLT_JUNIPER_ATM1 = 137 +pkg syscall (freebsd-amd64), const DLT_JUNIPER_ATM2 = 135 +pkg syscall (freebsd-amd64), const DLT_JUNIPER_ATM_CEMIC = 238 +pkg syscall (freebsd-amd64), const DLT_JUNIPER_ATM_CEMIC ideal-int +pkg syscall (freebsd-amd64), const DLT_JUNIPER_CHDLC = 181 +pkg syscall (freebsd-amd64), const DLT_JUNIPER_ES = 132 +pkg syscall (freebsd-amd64), const DLT_JUNIPER_ETHER = 178 +pkg syscall (freebsd-amd64), const DLT_JUNIPER_FIBRECHANNEL = 234 +pkg syscall (freebsd-amd64), const DLT_JUNIPER_FIBRECHANNEL ideal-int +pkg syscall (freebsd-amd64), const DLT_JUNIPER_FRELAY = 180 +pkg syscall (freebsd-amd64), const DLT_JUNIPER_GGSN = 133 +pkg syscall (freebsd-amd64), const DLT_JUNIPER_ISM = 194 +pkg syscall (freebsd-amd64), const DLT_JUNIPER_MFR = 134 +pkg syscall (freebsd-amd64), const DLT_JUNIPER_MLFR = 131 +pkg syscall (freebsd-amd64), const DLT_JUNIPER_MLPPP = 130 +pkg syscall (freebsd-amd64), const DLT_JUNIPER_MONITOR = 164 +pkg syscall (freebsd-amd64), const DLT_JUNIPER_PIC_PEER = 174 +pkg syscall (freebsd-amd64), const DLT_JUNIPER_PPP = 179 +pkg syscall (freebsd-amd64), const DLT_JUNIPER_PPPOE = 167 +pkg syscall (freebsd-amd64), const DLT_JUNIPER_PPPOE_ATM = 168 +pkg syscall (freebsd-amd64), const DLT_JUNIPER_SERVICES = 136 +pkg syscall (freebsd-amd64), const DLT_JUNIPER_SRX_E2E = 233 +pkg syscall (freebsd-amd64), const DLT_JUNIPER_SRX_E2E ideal-int +pkg syscall (freebsd-amd64), const DLT_JUNIPER_ST = 200 +pkg syscall (freebsd-amd64), const DLT_JUNIPER_VP = 183 +pkg syscall (freebsd-amd64), const DLT_JUNIPER_VS = 232 +pkg syscall (freebsd-amd64), const DLT_JUNIPER_VS ideal-int +pkg syscall (freebsd-amd64), const DLT_LAPB_WITH_DIR = 207 +pkg syscall (freebsd-amd64), const DLT_LAPD = 203 +pkg syscall (freebsd-amd64), const DLT_LIN = 212 +pkg syscall (freebsd-amd64), const DLT_LINUX_EVDEV = 216 +pkg syscall (freebsd-amd64), const DLT_LINUX_EVDEV ideal-int +pkg syscall (freebsd-amd64), const DLT_LINUX_IRDA = 144 +pkg syscall (freebsd-amd64), const DLT_LINUX_LAPD = 177 +pkg syscall (freebsd-amd64), const DLT_LINUX_PPP_WITHDIRECTION = 166 +pkg syscall (freebsd-amd64), const DLT_LINUX_SLL = 113 +pkg syscall (freebsd-amd64), const DLT_LOOP = 108 +pkg syscall (freebsd-amd64), const DLT_LTALK = 114 +pkg syscall (freebsd-amd64), const DLT_MATCHING_MAX = 242 +pkg syscall (freebsd-amd64), const DLT_MATCHING_MAX ideal-int +pkg syscall (freebsd-amd64), const DLT_MATCHING_MIN = 104 +pkg syscall (freebsd-amd64), const DLT_MATCHING_MIN ideal-int +pkg syscall (freebsd-amd64), const DLT_MFR = 182 +pkg syscall (freebsd-amd64), const DLT_MOST = 211 +pkg syscall (freebsd-amd64), const DLT_MPLS = 219 +pkg syscall (freebsd-amd64), const DLT_MPLS ideal-int +pkg syscall (freebsd-amd64), const DLT_MTP2 = 140 +pkg syscall (freebsd-amd64), const DLT_MTP2_WITH_PHDR = 139 +pkg syscall (freebsd-amd64), const DLT_MTP3 = 141 +pkg syscall (freebsd-amd64), const DLT_MUX27010 = 236 +pkg syscall (freebsd-amd64), const DLT_MUX27010 ideal-int +pkg syscall (freebsd-amd64), const DLT_NETANALYZER = 240 +pkg syscall (freebsd-amd64), const DLT_NETANALYZER ideal-int +pkg syscall (freebsd-amd64), const DLT_NETANALYZER_TRANSPARENT = 241 +pkg syscall (freebsd-amd64), const DLT_NETANALYZER_TRANSPARENT ideal-int +pkg syscall (freebsd-amd64), const DLT_NFLOG = 239 +pkg syscall (freebsd-amd64), const DLT_NFLOG ideal-int +pkg syscall (freebsd-amd64), const DLT_NULL = 0 +pkg syscall (freebsd-amd64), const DLT_PCI_EXP = 125 +pkg syscall (freebsd-amd64), const DLT_PFLOG = 117 +pkg syscall (freebsd-amd64), const DLT_PFSYNC = 121 +pkg syscall (freebsd-amd64), const DLT_PPI = 192 +pkg syscall (freebsd-amd64), const DLT_PPP = 9 +pkg syscall (freebsd-amd64), const DLT_PPP_BSDOS = 16 +pkg syscall (freebsd-amd64), const DLT_PPP_ETHER = 51 +pkg syscall (freebsd-amd64), const DLT_PPP_PPPD = 166 +pkg syscall (freebsd-amd64), const DLT_PPP_SERIAL = 50 +pkg syscall (freebsd-amd64), const DLT_PPP_WITH_DIR = 204 +pkg syscall (freebsd-amd64), const DLT_PPP_WITH_DIRECTION = 166 +pkg syscall (freebsd-amd64), const DLT_PRISM_HEADER = 119 +pkg syscall (freebsd-amd64), const DLT_PRONET = 4 +pkg syscall (freebsd-amd64), const DLT_RAIF1 = 198 +pkg syscall (freebsd-amd64), const DLT_RAW = 12 +pkg syscall (freebsd-amd64), const DLT_RIO = 124 +pkg syscall (freebsd-amd64), const DLT_SCCP = 142 +pkg syscall (freebsd-amd64), const DLT_SITA = 196 +pkg syscall (freebsd-amd64), const DLT_SLIP = 8 +pkg syscall (freebsd-amd64), const DLT_SLIP_BSDOS = 15 +pkg syscall (freebsd-amd64), const DLT_STANAG_5066_D_PDU = 237 +pkg syscall (freebsd-amd64), const DLT_STANAG_5066_D_PDU ideal-int +pkg syscall (freebsd-amd64), const DLT_SUNATM = 123 +pkg syscall (freebsd-amd64), const DLT_SYMANTEC_FIREWALL = 99 +pkg syscall (freebsd-amd64), const DLT_TZSP = 128 +pkg syscall (freebsd-amd64), const DLT_USB = 186 +pkg syscall (freebsd-amd64), const DLT_USB_LINUX = 189 +pkg syscall (freebsd-amd64), const DLT_USB_LINUX_MMAPPED = 220 +pkg syscall (freebsd-amd64), const DLT_USB_LINUX_MMAPPED ideal-int +pkg syscall (freebsd-amd64), const DLT_USER0 = 147 +pkg syscall (freebsd-amd64), const DLT_USER1 = 148 +pkg syscall (freebsd-amd64), const DLT_USER10 = 157 +pkg syscall (freebsd-amd64), const DLT_USER11 = 158 +pkg syscall (freebsd-amd64), const DLT_USER12 = 159 +pkg syscall (freebsd-amd64), const DLT_USER13 = 160 +pkg syscall (freebsd-amd64), const DLT_USER14 = 161 +pkg syscall (freebsd-amd64), const DLT_USER15 = 162 +pkg syscall (freebsd-amd64), const DLT_USER2 = 149 +pkg syscall (freebsd-amd64), const DLT_USER3 = 150 +pkg syscall (freebsd-amd64), const DLT_USER4 = 151 +pkg syscall (freebsd-amd64), const DLT_USER5 = 152 +pkg syscall (freebsd-amd64), const DLT_USER6 = 153 +pkg syscall (freebsd-amd64), const DLT_USER7 = 154 +pkg syscall (freebsd-amd64), const DLT_USER8 = 155 +pkg syscall (freebsd-amd64), const DLT_USER9 = 156 +pkg syscall (freebsd-amd64), const DLT_WIHART = 223 +pkg syscall (freebsd-amd64), const DLT_WIHART ideal-int +pkg syscall (freebsd-amd64), const DLT_X2E_SERIAL = 213 +pkg syscall (freebsd-amd64), const DLT_X2E_XORAYA = 214 +pkg syscall (freebsd-amd64), const DT_BLK = 6 +pkg syscall (freebsd-amd64), const DT_CHR = 2 +pkg syscall (freebsd-amd64), const DT_DIR = 4 +pkg syscall (freebsd-amd64), const DT_FIFO = 1 +pkg syscall (freebsd-amd64), const DT_LNK = 10 +pkg syscall (freebsd-amd64), const DT_REG = 8 +pkg syscall (freebsd-amd64), const DT_SOCK = 12 +pkg syscall (freebsd-amd64), const DT_UNKNOWN = 0 +pkg syscall (freebsd-amd64), const DT_WHT = 14 +pkg syscall (freebsd-amd64), const E2BIG = 7 +pkg syscall (freebsd-amd64), const EACCES = 13 +pkg syscall (freebsd-amd64), const EADDRINUSE = 48 +pkg syscall (freebsd-amd64), const EADDRNOTAVAIL = 49 +pkg syscall (freebsd-amd64), const EAFNOSUPPORT = 47 +pkg syscall (freebsd-amd64), const EAGAIN = 35 +pkg syscall (freebsd-amd64), const EALREADY = 37 +pkg syscall (freebsd-amd64), const EAUTH = 80 +pkg syscall (freebsd-amd64), const EBADF = 9 +pkg syscall (freebsd-amd64), const EBADMSG = 89 +pkg syscall (freebsd-amd64), const EBADRPC = 72 +pkg syscall (freebsd-amd64), const EBUSY = 16 +pkg syscall (freebsd-amd64), const ECANCELED = 85 +pkg syscall (freebsd-amd64), const ECAPMODE = 94 +pkg syscall (freebsd-amd64), const ECAPMODE Errno +pkg syscall (freebsd-amd64), const ECHILD = 10 +pkg syscall (freebsd-amd64), const ECHO = 8 +pkg syscall (freebsd-amd64), const ECHOCTL = 64 +pkg syscall (freebsd-amd64), const ECHOE = 2 +pkg syscall (freebsd-amd64), const ECHOK = 4 +pkg syscall (freebsd-amd64), const ECHOKE = 1 +pkg syscall (freebsd-amd64), const ECHONL = 16 +pkg syscall (freebsd-amd64), const ECHOPRT = 32 +pkg syscall (freebsd-amd64), const ECONNABORTED = 53 +pkg syscall (freebsd-amd64), const ECONNREFUSED = 61 +pkg syscall (freebsd-amd64), const ECONNRESET = 54 +pkg syscall (freebsd-amd64), const EDEADLK = 11 +pkg syscall (freebsd-amd64), const EDESTADDRREQ = 39 +pkg syscall (freebsd-amd64), const EDOM = 33 +pkg syscall (freebsd-amd64), const EDOOFUS = 88 +pkg syscall (freebsd-amd64), const EDQUOT = 69 +pkg syscall (freebsd-amd64), const EEXIST = 17 +pkg syscall (freebsd-amd64), const EFAULT = 14 +pkg syscall (freebsd-amd64), const EFBIG = 27 +pkg syscall (freebsd-amd64), const EFTYPE = 79 +pkg syscall (freebsd-amd64), const EHOSTDOWN = 64 +pkg syscall (freebsd-amd64), const EHOSTUNREACH = 65 +pkg syscall (freebsd-amd64), const EIDRM = 82 +pkg syscall (freebsd-amd64), const EILSEQ = 86 +pkg syscall (freebsd-amd64), const EINPROGRESS = 36 +pkg syscall (freebsd-amd64), const EINTR = 4 +pkg syscall (freebsd-amd64), const EINVAL = 22 +pkg syscall (freebsd-amd64), const EIO = 5 +pkg syscall (freebsd-amd64), const EISCONN = 56 +pkg syscall (freebsd-amd64), const EISDIR = 21 +pkg syscall (freebsd-amd64), const ELAST = 94 +pkg syscall (freebsd-amd64), const ELOOP = 62 +pkg syscall (freebsd-amd64), const EMFILE = 24 +pkg syscall (freebsd-amd64), const EMLINK = 31 +pkg syscall (freebsd-amd64), const EMSGSIZE = 40 +pkg syscall (freebsd-amd64), const EMULTIHOP = 90 +pkg syscall (freebsd-amd64), const ENAMETOOLONG = 63 +pkg syscall (freebsd-amd64), const ENEEDAUTH = 81 +pkg syscall (freebsd-amd64), const ENETDOWN = 50 +pkg syscall (freebsd-amd64), const ENETRESET = 52 +pkg syscall (freebsd-amd64), const ENETUNREACH = 51 +pkg syscall (freebsd-amd64), const ENFILE = 23 +pkg syscall (freebsd-amd64), const ENOATTR = 87 +pkg syscall (freebsd-amd64), const ENOBUFS = 55 +pkg syscall (freebsd-amd64), const ENODEV = 19 +pkg syscall (freebsd-amd64), const ENOEXEC = 8 +pkg syscall (freebsd-amd64), const ENOLCK = 77 +pkg syscall (freebsd-amd64), const ENOLINK = 91 +pkg syscall (freebsd-amd64), const ENOMEM = 12 +pkg syscall (freebsd-amd64), const ENOMSG = 83 +pkg syscall (freebsd-amd64), const ENOPROTOOPT = 42 +pkg syscall (freebsd-amd64), const ENOSPC = 28 +pkg syscall (freebsd-amd64), const ENOSYS = 78 +pkg syscall (freebsd-amd64), const ENOTBLK = 15 +pkg syscall (freebsd-amd64), const ENOTCAPABLE = 93 +pkg syscall (freebsd-amd64), const ENOTCONN = 57 +pkg syscall (freebsd-amd64), const ENOTDIR = 20 +pkg syscall (freebsd-amd64), const ENOTEMPTY = 66 +pkg syscall (freebsd-amd64), const ENOTSOCK = 38 +pkg syscall (freebsd-amd64), const ENOTSUP = 45 +pkg syscall (freebsd-amd64), const ENOTTY = 25 +pkg syscall (freebsd-amd64), const ENXIO = 6 +pkg syscall (freebsd-amd64), const EOPNOTSUPP = 45 +pkg syscall (freebsd-amd64), const EOVERFLOW = 84 +pkg syscall (freebsd-amd64), const EPERM = 1 +pkg syscall (freebsd-amd64), const EPFNOSUPPORT = 46 +pkg syscall (freebsd-amd64), const EPIPE = 32 +pkg syscall (freebsd-amd64), const EPROCLIM = 67 +pkg syscall (freebsd-amd64), const EPROCUNAVAIL = 76 +pkg syscall (freebsd-amd64), const EPROGMISMATCH = 75 +pkg syscall (freebsd-amd64), const EPROGUNAVAIL = 74 +pkg syscall (freebsd-amd64), const EPROTO = 92 +pkg syscall (freebsd-amd64), const EPROTONOSUPPORT = 43 +pkg syscall (freebsd-amd64), const EPROTOTYPE = 41 +pkg syscall (freebsd-amd64), const ERANGE = 34 +pkg syscall (freebsd-amd64), const EREMOTE = 71 +pkg syscall (freebsd-amd64), const EROFS = 30 +pkg syscall (freebsd-amd64), const ERPCMISMATCH = 73 +pkg syscall (freebsd-amd64), const ESHUTDOWN = 58 +pkg syscall (freebsd-amd64), const ESOCKTNOSUPPORT = 44 +pkg syscall (freebsd-amd64), const ESPIPE = 29 +pkg syscall (freebsd-amd64), const ESRCH = 3 +pkg syscall (freebsd-amd64), const ESTALE = 70 +pkg syscall (freebsd-amd64), const ETIMEDOUT = 60 +pkg syscall (freebsd-amd64), const ETOOMANYREFS = 59 +pkg syscall (freebsd-amd64), const ETXTBSY = 26 +pkg syscall (freebsd-amd64), const EUSERS = 68 +pkg syscall (freebsd-amd64), const EVFILT_AIO = -3 +pkg syscall (freebsd-amd64), const EVFILT_FS = -9 +pkg syscall (freebsd-amd64), const EVFILT_LIO = -10 +pkg syscall (freebsd-amd64), const EVFILT_PROC = -5 +pkg syscall (freebsd-amd64), const EVFILT_READ = -1 +pkg syscall (freebsd-amd64), const EVFILT_SIGNAL = -6 +pkg syscall (freebsd-amd64), const EVFILT_SYSCOUNT = 11 +pkg syscall (freebsd-amd64), const EVFILT_TIMER = -7 +pkg syscall (freebsd-amd64), const EVFILT_USER = -11 +pkg syscall (freebsd-amd64), const EVFILT_VNODE = -4 +pkg syscall (freebsd-amd64), const EVFILT_WRITE = -2 +pkg syscall (freebsd-amd64), const EV_ADD = 1 +pkg syscall (freebsd-amd64), const EV_CLEAR = 32 +pkg syscall (freebsd-amd64), const EV_DELETE = 2 +pkg syscall (freebsd-amd64), const EV_DISABLE = 8 +pkg syscall (freebsd-amd64), const EV_DISPATCH = 128 +pkg syscall (freebsd-amd64), const EV_ENABLE = 4 +pkg syscall (freebsd-amd64), const EV_EOF = 32768 +pkg syscall (freebsd-amd64), const EV_ERROR = 16384 +pkg syscall (freebsd-amd64), const EV_FLAG1 = 8192 +pkg syscall (freebsd-amd64), const EV_ONESHOT = 16 +pkg syscall (freebsd-amd64), const EV_RECEIPT = 64 +pkg syscall (freebsd-amd64), const EV_SYSFLAGS = 61440 +pkg syscall (freebsd-amd64), const EWOULDBLOCK = 35 +pkg syscall (freebsd-amd64), const EXDEV = 18 +pkg syscall (freebsd-amd64), const EXTA = 19200 +pkg syscall (freebsd-amd64), const EXTB = 38400 +pkg syscall (freebsd-amd64), const EXTPROC = 2048 +pkg syscall (freebsd-amd64), const FD_CLOEXEC = 1 +pkg syscall (freebsd-amd64), const FD_SETSIZE = 1024 +pkg syscall (freebsd-amd64), const FLUSHO = 8388608 +pkg syscall (freebsd-amd64), const FLUSHO ideal-int +pkg syscall (freebsd-amd64), const F_CANCEL = 5 +pkg syscall (freebsd-amd64), const F_DUP2FD = 10 +pkg syscall (freebsd-amd64), const F_DUPFD = 0 +pkg syscall (freebsd-amd64), const F_GETFD = 1 +pkg syscall (freebsd-amd64), const F_GETFL = 3 +pkg syscall (freebsd-amd64), const F_GETLK = 11 +pkg syscall (freebsd-amd64), const F_GETOWN = 5 +pkg syscall (freebsd-amd64), const F_OGETLK = 7 +pkg syscall (freebsd-amd64), const F_OK = 0 +pkg syscall (freebsd-amd64), const F_OSETLK = 8 +pkg syscall (freebsd-amd64), const F_OSETLKW = 9 +pkg syscall (freebsd-amd64), const F_RDAHEAD = 16 +pkg syscall (freebsd-amd64), const F_RDLCK = 1 +pkg syscall (freebsd-amd64), const F_READAHEAD = 15 +pkg syscall (freebsd-amd64), const F_SETFD = 2 +pkg syscall (freebsd-amd64), const F_SETFL = 4 +pkg syscall (freebsd-amd64), const F_SETLK = 12 +pkg syscall (freebsd-amd64), const F_SETLKW = 13 +pkg syscall (freebsd-amd64), const F_SETLK_REMOTE = 14 +pkg syscall (freebsd-amd64), const F_SETOWN = 6 +pkg syscall (freebsd-amd64), const F_UNLCK = 2 +pkg syscall (freebsd-amd64), const F_UNLCKSYS = 4 +pkg syscall (freebsd-amd64), const F_WRLCK = 3 +pkg syscall (freebsd-amd64), const HUPCL = 16384 +pkg syscall (freebsd-amd64), const HUPCL ideal-int +pkg syscall (freebsd-amd64), const ICANON = 256 +pkg syscall (freebsd-amd64), const ICANON ideal-int +pkg syscall (freebsd-amd64), const ICRNL = 256 +pkg syscall (freebsd-amd64), const ICRNL ideal-int +pkg syscall (freebsd-amd64), const IEXTEN = 1024 +pkg syscall (freebsd-amd64), const IEXTEN ideal-int +pkg syscall (freebsd-amd64), const IFAN_ARRIVAL = 0 +pkg syscall (freebsd-amd64), const IFAN_ARRIVAL ideal-int +pkg syscall (freebsd-amd64), const IFAN_DEPARTURE = 1 +pkg syscall (freebsd-amd64), const IFAN_DEPARTURE ideal-int +pkg syscall (freebsd-amd64), const IFF_ALLMULTI = 512 +pkg syscall (freebsd-amd64), const IFF_ALTPHYS = 16384 +pkg syscall (freebsd-amd64), const IFF_CANTCHANGE = 2199410 +pkg syscall (freebsd-amd64), const IFF_CANTCONFIG = 65536 +pkg syscall (freebsd-amd64), const IFF_CANTCONFIG ideal-int +pkg syscall (freebsd-amd64), const IFF_DEBUG = 4 +pkg syscall (freebsd-amd64), const IFF_DRV_OACTIVE = 1024 +pkg syscall (freebsd-amd64), const IFF_DRV_RUNNING = 64 +pkg syscall (freebsd-amd64), const IFF_DYING = 2097152 +pkg syscall (freebsd-amd64), const IFF_LINK0 = 4096 +pkg syscall (freebsd-amd64), const IFF_LINK1 = 8192 +pkg syscall (freebsd-amd64), const IFF_LINK2 = 16384 +pkg syscall (freebsd-amd64), const IFF_LOOPBACK = 8 +pkg syscall (freebsd-amd64), const IFF_MONITOR = 262144 +pkg syscall (freebsd-amd64), const IFF_MULTICAST = 32768 +pkg syscall (freebsd-amd64), const IFF_NOARP = 128 +pkg syscall (freebsd-amd64), const IFF_OACTIVE = 1024 +pkg syscall (freebsd-amd64), const IFF_POINTOPOINT = 16 +pkg syscall (freebsd-amd64), const IFF_PPROMISC = 131072 +pkg syscall (freebsd-amd64), const IFF_PROMISC = 256 +pkg syscall (freebsd-amd64), const IFF_RENAMING = 4194304 +pkg syscall (freebsd-amd64), const IFF_RUNNING = 64 +pkg syscall (freebsd-amd64), const IFF_SIMPLEX = 2048 +pkg syscall (freebsd-amd64), const IFF_SMART = 32 +pkg syscall (freebsd-amd64), const IFF_STATICARP = 524288 +pkg syscall (freebsd-amd64), const IFNAMSIZ = 16 +pkg syscall (freebsd-amd64), const IFT_1822 = 2 +pkg syscall (freebsd-amd64), const IFT_A12MPPSWITCH = 130 +pkg syscall (freebsd-amd64), const IFT_AAL2 = 187 +pkg syscall (freebsd-amd64), const IFT_AAL5 = 49 +pkg syscall (freebsd-amd64), const IFT_ADSL = 94 +pkg syscall (freebsd-amd64), const IFT_AFLANE8023 = 59 +pkg syscall (freebsd-amd64), const IFT_AFLANE8025 = 60 +pkg syscall (freebsd-amd64), const IFT_ARAP = 88 +pkg syscall (freebsd-amd64), const IFT_ARCNET = 35 +pkg syscall (freebsd-amd64), const IFT_ARCNETPLUS = 36 +pkg syscall (freebsd-amd64), const IFT_ASYNC = 84 +pkg syscall (freebsd-amd64), const IFT_ATM = 37 +pkg syscall (freebsd-amd64), const IFT_ATMDXI = 105 +pkg syscall (freebsd-amd64), const IFT_ATMFUNI = 106 +pkg syscall (freebsd-amd64), const IFT_ATMIMA = 107 +pkg syscall (freebsd-amd64), const IFT_ATMLOGICAL = 80 +pkg syscall (freebsd-amd64), const IFT_ATMRADIO = 189 +pkg syscall (freebsd-amd64), const IFT_ATMSUBINTERFACE = 134 +pkg syscall (freebsd-amd64), const IFT_ATMVCIENDPT = 194 +pkg syscall (freebsd-amd64), const IFT_ATMVIRTUAL = 149 +pkg syscall (freebsd-amd64), const IFT_BGPPOLICYACCOUNTING = 162 +pkg syscall (freebsd-amd64), const IFT_BRIDGE = 209 +pkg syscall (freebsd-amd64), const IFT_BSC = 83 +pkg syscall (freebsd-amd64), const IFT_CARP = 248 +pkg syscall (freebsd-amd64), const IFT_CCTEMUL = 61 +pkg syscall (freebsd-amd64), const IFT_CEPT = 19 +pkg syscall (freebsd-amd64), const IFT_CES = 133 +pkg syscall (freebsd-amd64), const IFT_CHANNEL = 70 +pkg syscall (freebsd-amd64), const IFT_CNR = 85 +pkg syscall (freebsd-amd64), const IFT_COFFEE = 132 +pkg syscall (freebsd-amd64), const IFT_COMPOSITELINK = 155 +pkg syscall (freebsd-amd64), const IFT_DCN = 141 +pkg syscall (freebsd-amd64), const IFT_DIGITALPOWERLINE = 138 +pkg syscall (freebsd-amd64), const IFT_DIGITALWRAPPEROVERHEADCHANNEL = 186 +pkg syscall (freebsd-amd64), const IFT_DLSW = 74 +pkg syscall (freebsd-amd64), const IFT_DOCSCABLEDOWNSTREAM = 128 +pkg syscall (freebsd-amd64), const IFT_DOCSCABLEMACLAYER = 127 +pkg syscall (freebsd-amd64), const IFT_DOCSCABLEUPSTREAM = 129 +pkg syscall (freebsd-amd64), const IFT_DS0 = 81 +pkg syscall (freebsd-amd64), const IFT_DS0BUNDLE = 82 +pkg syscall (freebsd-amd64), const IFT_DS1FDL = 170 +pkg syscall (freebsd-amd64), const IFT_DS3 = 30 +pkg syscall (freebsd-amd64), const IFT_DTM = 140 +pkg syscall (freebsd-amd64), const IFT_DVBASILN = 172 +pkg syscall (freebsd-amd64), const IFT_DVBASIOUT = 173 +pkg syscall (freebsd-amd64), const IFT_DVBRCCDOWNSTREAM = 147 +pkg syscall (freebsd-amd64), const IFT_DVBRCCMACLAYER = 146 +pkg syscall (freebsd-amd64), const IFT_DVBRCCUPSTREAM = 148 +pkg syscall (freebsd-amd64), const IFT_ENC = 244 +pkg syscall (freebsd-amd64), const IFT_EON = 25 +pkg syscall (freebsd-amd64), const IFT_EPLRS = 87 +pkg syscall (freebsd-amd64), const IFT_ESCON = 73 +pkg syscall (freebsd-amd64), const IFT_ETHER = 6 +pkg syscall (freebsd-amd64), const IFT_FAITH = 242 +pkg syscall (freebsd-amd64), const IFT_FAST = 125 +pkg syscall (freebsd-amd64), const IFT_FASTETHER = 62 +pkg syscall (freebsd-amd64), const IFT_FASTETHERFX = 69 +pkg syscall (freebsd-amd64), const IFT_FDDI = 15 +pkg syscall (freebsd-amd64), const IFT_FIBRECHANNEL = 56 +pkg syscall (freebsd-amd64), const IFT_FRAMERELAYINTERCONNECT = 58 +pkg syscall (freebsd-amd64), const IFT_FRAMERELAYMPI = 92 +pkg syscall (freebsd-amd64), const IFT_FRDLCIENDPT = 193 +pkg syscall (freebsd-amd64), const IFT_FRELAY = 32 +pkg syscall (freebsd-amd64), const IFT_FRELAYDCE = 44 +pkg syscall (freebsd-amd64), const IFT_FRF16MFRBUNDLE = 163 +pkg syscall (freebsd-amd64), const IFT_FRFORWARD = 158 +pkg syscall (freebsd-amd64), const IFT_G703AT2MB = 67 +pkg syscall (freebsd-amd64), const IFT_G703AT64K = 66 +pkg syscall (freebsd-amd64), const IFT_GIF = 240 +pkg syscall (freebsd-amd64), const IFT_GIGABITETHERNET = 117 +pkg syscall (freebsd-amd64), const IFT_GR303IDT = 178 +pkg syscall (freebsd-amd64), const IFT_GR303RDT = 177 +pkg syscall (freebsd-amd64), const IFT_H323GATEKEEPER = 164 +pkg syscall (freebsd-amd64), const IFT_H323PROXY = 165 +pkg syscall (freebsd-amd64), const IFT_HDH1822 = 3 +pkg syscall (freebsd-amd64), const IFT_HDLC = 118 +pkg syscall (freebsd-amd64), const IFT_HDSL2 = 168 +pkg syscall (freebsd-amd64), const IFT_HIPERLAN2 = 183 +pkg syscall (freebsd-amd64), const IFT_HIPPI = 47 +pkg syscall (freebsd-amd64), const IFT_HIPPIINTERFACE = 57 +pkg syscall (freebsd-amd64), const IFT_HOSTPAD = 90 +pkg syscall (freebsd-amd64), const IFT_HSSI = 46 +pkg syscall (freebsd-amd64), const IFT_HY = 14 +pkg syscall (freebsd-amd64), const IFT_IBM370PARCHAN = 72 +pkg syscall (freebsd-amd64), const IFT_IDSL = 154 +pkg syscall (freebsd-amd64), const IFT_IEEE1394 = 144 +pkg syscall (freebsd-amd64), const IFT_IEEE80211 = 71 +pkg syscall (freebsd-amd64), const IFT_IEEE80212 = 55 +pkg syscall (freebsd-amd64), const IFT_IEEE8023ADLAG = 161 +pkg syscall (freebsd-amd64), const IFT_IFGSN = 145 +pkg syscall (freebsd-amd64), const IFT_IMT = 190 +pkg syscall (freebsd-amd64), const IFT_INFINIBAND = 199 +pkg syscall (freebsd-amd64), const IFT_INFINIBAND ideal-int +pkg syscall (freebsd-amd64), const IFT_INTERLEAVE = 124 +pkg syscall (freebsd-amd64), const IFT_IP = 126 +pkg syscall (freebsd-amd64), const IFT_IPFORWARD = 142 +pkg syscall (freebsd-amd64), const IFT_IPOVERATM = 114 +pkg syscall (freebsd-amd64), const IFT_IPOVERCDLC = 109 +pkg syscall (freebsd-amd64), const IFT_IPOVERCLAW = 110 +pkg syscall (freebsd-amd64), const IFT_IPSWITCH = 78 +pkg syscall (freebsd-amd64), const IFT_IPXIP = 249 +pkg syscall (freebsd-amd64), const IFT_ISDN = 63 +pkg syscall (freebsd-amd64), const IFT_ISDNBASIC = 20 +pkg syscall (freebsd-amd64), const IFT_ISDNPRIMARY = 21 +pkg syscall (freebsd-amd64), const IFT_ISDNS = 75 +pkg syscall (freebsd-amd64), const IFT_ISDNU = 76 +pkg syscall (freebsd-amd64), const IFT_ISO88022LLC = 41 +pkg syscall (freebsd-amd64), const IFT_ISO88023 = 7 +pkg syscall (freebsd-amd64), const IFT_ISO88024 = 8 +pkg syscall (freebsd-amd64), const IFT_ISO88025 = 9 +pkg syscall (freebsd-amd64), const IFT_ISO88025CRFPINT = 98 +pkg syscall (freebsd-amd64), const IFT_ISO88025DTR = 86 +pkg syscall (freebsd-amd64), const IFT_ISO88025FIBER = 115 +pkg syscall (freebsd-amd64), const IFT_ISO88026 = 10 +pkg syscall (freebsd-amd64), const IFT_ISUP = 179 +pkg syscall (freebsd-amd64), const IFT_L2VLAN = 135 +pkg syscall (freebsd-amd64), const IFT_L3IPVLAN = 136 +pkg syscall (freebsd-amd64), const IFT_L3IPXVLAN = 137 +pkg syscall (freebsd-amd64), const IFT_LAPB = 16 +pkg syscall (freebsd-amd64), const IFT_LAPD = 77 +pkg syscall (freebsd-amd64), const IFT_LAPF = 119 +pkg syscall (freebsd-amd64), const IFT_LOCALTALK = 42 +pkg syscall (freebsd-amd64), const IFT_LOOP = 24 +pkg syscall (freebsd-amd64), const IFT_MEDIAMAILOVERIP = 139 +pkg syscall (freebsd-amd64), const IFT_MFSIGLINK = 167 +pkg syscall (freebsd-amd64), const IFT_MIOX25 = 38 +pkg syscall (freebsd-amd64), const IFT_MODEM = 48 +pkg syscall (freebsd-amd64), const IFT_MPC = 113 +pkg syscall (freebsd-amd64), const IFT_MPLS = 166 +pkg syscall (freebsd-amd64), const IFT_MPLSTUNNEL = 150 +pkg syscall (freebsd-amd64), const IFT_MSDSL = 143 +pkg syscall (freebsd-amd64), const IFT_MVL = 191 +pkg syscall (freebsd-amd64), const IFT_MYRINET = 99 +pkg syscall (freebsd-amd64), const IFT_NFAS = 175 +pkg syscall (freebsd-amd64), const IFT_NSIP = 27 +pkg syscall (freebsd-amd64), const IFT_OPTICALCHANNEL = 195 +pkg syscall (freebsd-amd64), const IFT_OPTICALTRANSPORT = 196 +pkg syscall (freebsd-amd64), const IFT_OTHER = 1 +pkg syscall (freebsd-amd64), const IFT_P10 = 12 +pkg syscall (freebsd-amd64), const IFT_P80 = 13 +pkg syscall (freebsd-amd64), const IFT_PARA = 34 +pkg syscall (freebsd-amd64), const IFT_PFLOG = 246 +pkg syscall (freebsd-amd64), const IFT_PFSYNC = 247 +pkg syscall (freebsd-amd64), const IFT_PLC = 174 +pkg syscall (freebsd-amd64), const IFT_POS = 171 +pkg syscall (freebsd-amd64), const IFT_PPP = 23 +pkg syscall (freebsd-amd64), const IFT_PPPMULTILINKBUNDLE = 108 +pkg syscall (freebsd-amd64), const IFT_PROPBWAP2MP = 184 +pkg syscall (freebsd-amd64), const IFT_PROPCNLS = 89 +pkg syscall (freebsd-amd64), const IFT_PROPDOCSWIRELESSDOWNSTREAM = 181 +pkg syscall (freebsd-amd64), const IFT_PROPDOCSWIRELESSMACLAYER = 180 +pkg syscall (freebsd-amd64), const IFT_PROPDOCSWIRELESSUPSTREAM = 182 +pkg syscall (freebsd-amd64), const IFT_PROPMUX = 54 +pkg syscall (freebsd-amd64), const IFT_PROPVIRTUAL = 53 +pkg syscall (freebsd-amd64), const IFT_PROPWIRELESSP2P = 157 +pkg syscall (freebsd-amd64), const IFT_PTPSERIAL = 22 +pkg syscall (freebsd-amd64), const IFT_PVC = 241 +pkg syscall (freebsd-amd64), const IFT_QLLC = 68 +pkg syscall (freebsd-amd64), const IFT_RADIOMAC = 188 +pkg syscall (freebsd-amd64), const IFT_RADSL = 95 +pkg syscall (freebsd-amd64), const IFT_REACHDSL = 192 +pkg syscall (freebsd-amd64), const IFT_RFC1483 = 159 +pkg syscall (freebsd-amd64), const IFT_RS232 = 33 +pkg syscall (freebsd-amd64), const IFT_RSRB = 79 +pkg syscall (freebsd-amd64), const IFT_SDLC = 17 +pkg syscall (freebsd-amd64), const IFT_SDSL = 96 +pkg syscall (freebsd-amd64), const IFT_SHDSL = 169 +pkg syscall (freebsd-amd64), const IFT_SIP = 31 +pkg syscall (freebsd-amd64), const IFT_SLIP = 28 +pkg syscall (freebsd-amd64), const IFT_SMDSDXI = 43 +pkg syscall (freebsd-amd64), const IFT_SMDSICIP = 52 +pkg syscall (freebsd-amd64), const IFT_SONET = 39 +pkg syscall (freebsd-amd64), const IFT_SONETOVERHEADCHANNEL = 185 +pkg syscall (freebsd-amd64), const IFT_SONETPATH = 50 +pkg syscall (freebsd-amd64), const IFT_SONETVT = 51 +pkg syscall (freebsd-amd64), const IFT_SRP = 151 +pkg syscall (freebsd-amd64), const IFT_SS7SIGLINK = 156 +pkg syscall (freebsd-amd64), const IFT_STACKTOSTACK = 111 +pkg syscall (freebsd-amd64), const IFT_STARLAN = 11 +pkg syscall (freebsd-amd64), const IFT_STF = 215 +pkg syscall (freebsd-amd64), const IFT_T1 = 18 +pkg syscall (freebsd-amd64), const IFT_TDLC = 116 +pkg syscall (freebsd-amd64), const IFT_TERMPAD = 91 +pkg syscall (freebsd-amd64), const IFT_TR008 = 176 +pkg syscall (freebsd-amd64), const IFT_TRANSPHDLC = 123 +pkg syscall (freebsd-amd64), const IFT_TUNNEL = 131 +pkg syscall (freebsd-amd64), const IFT_ULTRA = 29 +pkg syscall (freebsd-amd64), const IFT_USB = 160 +pkg syscall (freebsd-amd64), const IFT_V11 = 64 +pkg syscall (freebsd-amd64), const IFT_V35 = 45 +pkg syscall (freebsd-amd64), const IFT_V36 = 65 +pkg syscall (freebsd-amd64), const IFT_V37 = 120 +pkg syscall (freebsd-amd64), const IFT_VDSL = 97 +pkg syscall (freebsd-amd64), const IFT_VIRTUALIPADDRESS = 112 +pkg syscall (freebsd-amd64), const IFT_VOICEEM = 100 +pkg syscall (freebsd-amd64), const IFT_VOICEENCAP = 103 +pkg syscall (freebsd-amd64), const IFT_VOICEFXO = 101 +pkg syscall (freebsd-amd64), const IFT_VOICEFXS = 102 +pkg syscall (freebsd-amd64), const IFT_VOICEOVERATM = 152 +pkg syscall (freebsd-amd64), const IFT_VOICEOVERFRAMERELAY = 153 +pkg syscall (freebsd-amd64), const IFT_VOICEOVERIP = 104 +pkg syscall (freebsd-amd64), const IFT_X213 = 93 +pkg syscall (freebsd-amd64), const IFT_X25 = 5 +pkg syscall (freebsd-amd64), const IFT_X25DDN = 4 +pkg syscall (freebsd-amd64), const IFT_X25HUNTGROUP = 122 +pkg syscall (freebsd-amd64), const IFT_X25MLP = 121 +pkg syscall (freebsd-amd64), const IFT_X25PLE = 40 +pkg syscall (freebsd-amd64), const IFT_XETHER = 26 +pkg syscall (freebsd-amd64), const IGNBRK = 1 +pkg syscall (freebsd-amd64), const IGNBRK ideal-int +pkg syscall (freebsd-amd64), const IGNCR = 128 +pkg syscall (freebsd-amd64), const IGNCR ideal-int +pkg syscall (freebsd-amd64), const IGNPAR = 4 +pkg syscall (freebsd-amd64), const IGNPAR ideal-int +pkg syscall (freebsd-amd64), const IMAXBEL = 8192 +pkg syscall (freebsd-amd64), const IMAXBEL ideal-int +pkg syscall (freebsd-amd64), const INLCR = 64 +pkg syscall (freebsd-amd64), const INLCR ideal-int +pkg syscall (freebsd-amd64), const INPCK = 16 +pkg syscall (freebsd-amd64), const INPCK ideal-int +pkg syscall (freebsd-amd64), const IN_CLASSA_HOST = 16777215 +pkg syscall (freebsd-amd64), const IN_CLASSA_MAX = 128 +pkg syscall (freebsd-amd64), const IN_CLASSA_NET = 4278190080 +pkg syscall (freebsd-amd64), const IN_CLASSA_NSHIFT = 24 +pkg syscall (freebsd-amd64), const IN_CLASSB_HOST = 65535 +pkg syscall (freebsd-amd64), const IN_CLASSB_MAX = 65536 +pkg syscall (freebsd-amd64), const IN_CLASSB_NET = 4294901760 +pkg syscall (freebsd-amd64), const IN_CLASSB_NSHIFT = 16 +pkg syscall (freebsd-amd64), const IN_CLASSC_HOST = 255 +pkg syscall (freebsd-amd64), const IN_CLASSC_NET = 4294967040 +pkg syscall (freebsd-amd64), const IN_CLASSC_NSHIFT = 8 +pkg syscall (freebsd-amd64), const IN_CLASSD_HOST = 268435455 +pkg syscall (freebsd-amd64), const IN_CLASSD_NET = 4026531840 +pkg syscall (freebsd-amd64), const IN_CLASSD_NSHIFT = 28 +pkg syscall (freebsd-amd64), const IN_LOOPBACKNET = 127 +pkg syscall (freebsd-amd64), const IN_RFC3021_MASK = 4294967294 +pkg syscall (freebsd-amd64), const IN_RFC3021_MASK ideal-int +pkg syscall (freebsd-amd64), const IPPROTO_3PC = 34 +pkg syscall (freebsd-amd64), const IPPROTO_ADFS = 68 +pkg syscall (freebsd-amd64), const IPPROTO_AH = 51 +pkg syscall (freebsd-amd64), const IPPROTO_AHIP = 61 +pkg syscall (freebsd-amd64), const IPPROTO_APES = 99 +pkg syscall (freebsd-amd64), const IPPROTO_ARGUS = 13 +pkg syscall (freebsd-amd64), const IPPROTO_AX25 = 93 +pkg syscall (freebsd-amd64), const IPPROTO_BHA = 49 +pkg syscall (freebsd-amd64), const IPPROTO_BLT = 30 +pkg syscall (freebsd-amd64), const IPPROTO_BRSATMON = 76 +pkg syscall (freebsd-amd64), const IPPROTO_CARP = 112 +pkg syscall (freebsd-amd64), const IPPROTO_CFTP = 62 +pkg syscall (freebsd-amd64), const IPPROTO_CHAOS = 16 +pkg syscall (freebsd-amd64), const IPPROTO_CMTP = 38 +pkg syscall (freebsd-amd64), const IPPROTO_CPHB = 73 +pkg syscall (freebsd-amd64), const IPPROTO_CPNX = 72 +pkg syscall (freebsd-amd64), const IPPROTO_DDP = 37 +pkg syscall (freebsd-amd64), const IPPROTO_DGP = 86 +pkg syscall (freebsd-amd64), const IPPROTO_DIVERT = 258 +pkg syscall (freebsd-amd64), const IPPROTO_DONE = 257 +pkg syscall (freebsd-amd64), const IPPROTO_DSTOPTS = 60 +pkg syscall (freebsd-amd64), const IPPROTO_EGP = 8 +pkg syscall (freebsd-amd64), const IPPROTO_EMCON = 14 +pkg syscall (freebsd-amd64), const IPPROTO_ENCAP = 98 +pkg syscall (freebsd-amd64), const IPPROTO_EON = 80 +pkg syscall (freebsd-amd64), const IPPROTO_ESP = 50 +pkg syscall (freebsd-amd64), const IPPROTO_ETHERIP = 97 +pkg syscall (freebsd-amd64), const IPPROTO_FRAGMENT = 44 +pkg syscall (freebsd-amd64), const IPPROTO_GGP = 3 +pkg syscall (freebsd-amd64), const IPPROTO_GMTP = 100 +pkg syscall (freebsd-amd64), const IPPROTO_GRE = 47 +pkg syscall (freebsd-amd64), const IPPROTO_HELLO = 63 +pkg syscall (freebsd-amd64), const IPPROTO_HMP = 20 +pkg syscall (freebsd-amd64), const IPPROTO_HOPOPTS = 0 +pkg syscall (freebsd-amd64), const IPPROTO_ICMP = 1 +pkg syscall (freebsd-amd64), const IPPROTO_ICMPV6 = 58 +pkg syscall (freebsd-amd64), const IPPROTO_IDP = 22 +pkg syscall (freebsd-amd64), const IPPROTO_IDPR = 35 +pkg syscall (freebsd-amd64), const IPPROTO_IDRP = 45 +pkg syscall (freebsd-amd64), const IPPROTO_IGMP = 2 +pkg syscall (freebsd-amd64), const IPPROTO_IGP = 85 +pkg syscall (freebsd-amd64), const IPPROTO_IGRP = 88 +pkg syscall (freebsd-amd64), const IPPROTO_IL = 40 +pkg syscall (freebsd-amd64), const IPPROTO_INLSP = 52 +pkg syscall (freebsd-amd64), const IPPROTO_INP = 32 +pkg syscall (freebsd-amd64), const IPPROTO_IPCOMP = 108 +pkg syscall (freebsd-amd64), const IPPROTO_IPCV = 71 +pkg syscall (freebsd-amd64), const IPPROTO_IPEIP = 94 +pkg syscall (freebsd-amd64), const IPPROTO_IPIP = 4 +pkg syscall (freebsd-amd64), const IPPROTO_IPPC = 67 +pkg syscall (freebsd-amd64), const IPPROTO_IPV4 = 4 +pkg syscall (freebsd-amd64), const IPPROTO_IRTP = 28 +pkg syscall (freebsd-amd64), const IPPROTO_KRYPTOLAN = 65 +pkg syscall (freebsd-amd64), const IPPROTO_LARP = 91 +pkg syscall (freebsd-amd64), const IPPROTO_LEAF1 = 25 +pkg syscall (freebsd-amd64), const IPPROTO_LEAF2 = 26 +pkg syscall (freebsd-amd64), const IPPROTO_MAX = 256 +pkg syscall (freebsd-amd64), const IPPROTO_MAXID = 52 +pkg syscall (freebsd-amd64), const IPPROTO_MEAS = 19 +pkg syscall (freebsd-amd64), const IPPROTO_MH = 135 +pkg syscall (freebsd-amd64), const IPPROTO_MH ideal-int +pkg syscall (freebsd-amd64), const IPPROTO_MHRP = 48 +pkg syscall (freebsd-amd64), const IPPROTO_MICP = 95 +pkg syscall (freebsd-amd64), const IPPROTO_MOBILE = 55 +pkg syscall (freebsd-amd64), const IPPROTO_MTP = 92 +pkg syscall (freebsd-amd64), const IPPROTO_MUX = 18 +pkg syscall (freebsd-amd64), const IPPROTO_ND = 77 +pkg syscall (freebsd-amd64), const IPPROTO_NHRP = 54 +pkg syscall (freebsd-amd64), const IPPROTO_NONE = 59 +pkg syscall (freebsd-amd64), const IPPROTO_NSP = 31 +pkg syscall (freebsd-amd64), const IPPROTO_NVPII = 11 +pkg syscall (freebsd-amd64), const IPPROTO_OLD_DIVERT = 254 +pkg syscall (freebsd-amd64), const IPPROTO_OSPFIGP = 89 +pkg syscall (freebsd-amd64), const IPPROTO_PFSYNC = 240 +pkg syscall (freebsd-amd64), const IPPROTO_PGM = 113 +pkg syscall (freebsd-amd64), const IPPROTO_PIGP = 9 +pkg syscall (freebsd-amd64), const IPPROTO_PIM = 103 +pkg syscall (freebsd-amd64), const IPPROTO_PRM = 21 +pkg syscall (freebsd-amd64), const IPPROTO_PUP = 12 +pkg syscall (freebsd-amd64), const IPPROTO_PVP = 75 +pkg syscall (freebsd-amd64), const IPPROTO_RAW = 255 +pkg syscall (freebsd-amd64), const IPPROTO_RCCMON = 10 +pkg syscall (freebsd-amd64), const IPPROTO_RDP = 27 +pkg syscall (freebsd-amd64), const IPPROTO_ROUTING = 43 +pkg syscall (freebsd-amd64), const IPPROTO_RSVP = 46 +pkg syscall (freebsd-amd64), const IPPROTO_RVD = 66 +pkg syscall (freebsd-amd64), const IPPROTO_SATEXPAK = 64 +pkg syscall (freebsd-amd64), const IPPROTO_SATMON = 69 +pkg syscall (freebsd-amd64), const IPPROTO_SCCSP = 96 +pkg syscall (freebsd-amd64), const IPPROTO_SCTP = 132 +pkg syscall (freebsd-amd64), const IPPROTO_SDRP = 42 +pkg syscall (freebsd-amd64), const IPPROTO_SEND = 259 +pkg syscall (freebsd-amd64), const IPPROTO_SEND ideal-int +pkg syscall (freebsd-amd64), const IPPROTO_SEP = 33 +pkg syscall (freebsd-amd64), const IPPROTO_SKIP = 57 +pkg syscall (freebsd-amd64), const IPPROTO_SPACER = 32767 +pkg syscall (freebsd-amd64), const IPPROTO_SRPC = 90 +pkg syscall (freebsd-amd64), const IPPROTO_ST = 7 +pkg syscall (freebsd-amd64), const IPPROTO_SVMTP = 82 +pkg syscall (freebsd-amd64), const IPPROTO_SWIPE = 53 +pkg syscall (freebsd-amd64), const IPPROTO_TCF = 87 +pkg syscall (freebsd-amd64), const IPPROTO_TLSP = 56 +pkg syscall (freebsd-amd64), const IPPROTO_TP = 29 +pkg syscall (freebsd-amd64), const IPPROTO_TPXX = 39 +pkg syscall (freebsd-amd64), const IPPROTO_TRUNK1 = 23 +pkg syscall (freebsd-amd64), const IPPROTO_TRUNK2 = 24 +pkg syscall (freebsd-amd64), const IPPROTO_TTP = 84 +pkg syscall (freebsd-amd64), const IPPROTO_VINES = 83 +pkg syscall (freebsd-amd64), const IPPROTO_VISA = 70 +pkg syscall (freebsd-amd64), const IPPROTO_VMTP = 81 +pkg syscall (freebsd-amd64), const IPPROTO_WBEXPAK = 79 +pkg syscall (freebsd-amd64), const IPPROTO_WBMON = 78 +pkg syscall (freebsd-amd64), const IPPROTO_WSN = 74 +pkg syscall (freebsd-amd64), const IPPROTO_XNET = 15 +pkg syscall (freebsd-amd64), const IPPROTO_XTP = 36 +pkg syscall (freebsd-amd64), const IPV6_AUTOFLOWLABEL = 59 +pkg syscall (freebsd-amd64), const IPV6_BINDANY = 64 +pkg syscall (freebsd-amd64), const IPV6_BINDV6ONLY = 27 +pkg syscall (freebsd-amd64), const IPV6_CHECKSUM = 26 +pkg syscall (freebsd-amd64), const IPV6_DEFAULT_MULTICAST_HOPS = 1 +pkg syscall (freebsd-amd64), const IPV6_DEFAULT_MULTICAST_LOOP = 1 +pkg syscall (freebsd-amd64), const IPV6_DEFHLIM = 64 +pkg syscall (freebsd-amd64), const IPV6_DONTFRAG = 62 +pkg syscall (freebsd-amd64), const IPV6_DSTOPTS = 50 +pkg syscall (freebsd-amd64), const IPV6_FAITH = 29 +pkg syscall (freebsd-amd64), const IPV6_FLOWINFO_MASK = 4294967055 +pkg syscall (freebsd-amd64), const IPV6_FLOWLABEL_MASK = 4294905600 +pkg syscall (freebsd-amd64), const IPV6_FRAGTTL = 120 +pkg syscall (freebsd-amd64), const IPV6_FW_ADD = 30 +pkg syscall (freebsd-amd64), const IPV6_FW_DEL = 31 +pkg syscall (freebsd-amd64), const IPV6_FW_FLUSH = 32 +pkg syscall (freebsd-amd64), const IPV6_FW_GET = 34 +pkg syscall (freebsd-amd64), const IPV6_FW_ZERO = 33 +pkg syscall (freebsd-amd64), const IPV6_HLIMDEC = 1 +pkg syscall (freebsd-amd64), const IPV6_HOPLIMIT = 47 +pkg syscall (freebsd-amd64), const IPV6_HOPOPTS = 49 +pkg syscall (freebsd-amd64), const IPV6_IPSEC_POLICY = 28 +pkg syscall (freebsd-amd64), const IPV6_JOIN_GROUP = 12 +pkg syscall (freebsd-amd64), const IPV6_LEAVE_GROUP = 13 +pkg syscall (freebsd-amd64), const IPV6_MAXHLIM = 255 +pkg syscall (freebsd-amd64), const IPV6_MAXOPTHDR = 2048 +pkg syscall (freebsd-amd64), const IPV6_MAXPACKET = 65535 +pkg syscall (freebsd-amd64), const IPV6_MAX_GROUP_SRC_FILTER = 512 +pkg syscall (freebsd-amd64), const IPV6_MAX_MEMBERSHIPS = 4095 +pkg syscall (freebsd-amd64), const IPV6_MAX_SOCK_SRC_FILTER = 128 +pkg syscall (freebsd-amd64), const IPV6_MIN_MEMBERSHIPS = 31 +pkg syscall (freebsd-amd64), const IPV6_MMTU = 1280 +pkg syscall (freebsd-amd64), const IPV6_MSFILTER = 74 +pkg syscall (freebsd-amd64), const IPV6_MULTICAST_HOPS = 10 +pkg syscall (freebsd-amd64), const IPV6_MULTICAST_IF = 9 +pkg syscall (freebsd-amd64), const IPV6_MULTICAST_LOOP = 11 +pkg syscall (freebsd-amd64), const IPV6_NEXTHOP = 48 +pkg syscall (freebsd-amd64), const IPV6_PATHMTU = 44 +pkg syscall (freebsd-amd64), const IPV6_PKTINFO = 46 +pkg syscall (freebsd-amd64), const IPV6_PORTRANGE = 14 +pkg syscall (freebsd-amd64), const IPV6_PORTRANGE_DEFAULT = 0 +pkg syscall (freebsd-amd64), const IPV6_PORTRANGE_HIGH = 1 +pkg syscall (freebsd-amd64), const IPV6_PORTRANGE_LOW = 2 +pkg syscall (freebsd-amd64), const IPV6_PREFER_TEMPADDR = 63 +pkg syscall (freebsd-amd64), const IPV6_RECVDSTOPTS = 40 +pkg syscall (freebsd-amd64), const IPV6_RECVHOPLIMIT = 37 +pkg syscall (freebsd-amd64), const IPV6_RECVHOPOPTS = 39 +pkg syscall (freebsd-amd64), const IPV6_RECVPATHMTU = 43 +pkg syscall (freebsd-amd64), const IPV6_RECVPKTINFO = 36 +pkg syscall (freebsd-amd64), const IPV6_RECVRTHDR = 38 +pkg syscall (freebsd-amd64), const IPV6_RECVTCLASS = 57 +pkg syscall (freebsd-amd64), const IPV6_RTHDR = 51 +pkg syscall (freebsd-amd64), const IPV6_RTHDRDSTOPTS = 35 +pkg syscall (freebsd-amd64), const IPV6_RTHDR_LOOSE = 0 +pkg syscall (freebsd-amd64), const IPV6_RTHDR_STRICT = 1 +pkg syscall (freebsd-amd64), const IPV6_RTHDR_TYPE_0 = 0 +pkg syscall (freebsd-amd64), const IPV6_SOCKOPT_RESERVED1 = 3 +pkg syscall (freebsd-amd64), const IPV6_TCLASS = 61 +pkg syscall (freebsd-amd64), const IPV6_UNICAST_HOPS = 4 +pkg syscall (freebsd-amd64), const IPV6_USE_MIN_MTU = 42 +pkg syscall (freebsd-amd64), const IPV6_V6ONLY = 27 +pkg syscall (freebsd-amd64), const IPV6_VERSION = 96 +pkg syscall (freebsd-amd64), const IPV6_VERSION_MASK = 240 +pkg syscall (freebsd-amd64), const IP_ADD_MEMBERSHIP = 12 +pkg syscall (freebsd-amd64), const IP_ADD_SOURCE_MEMBERSHIP = 70 +pkg syscall (freebsd-amd64), const IP_BINDANY = 24 +pkg syscall (freebsd-amd64), const IP_BLOCK_SOURCE = 72 +pkg syscall (freebsd-amd64), const IP_DEFAULT_MULTICAST_LOOP = 1 +pkg syscall (freebsd-amd64), const IP_DEFAULT_MULTICAST_TTL = 1 +pkg syscall (freebsd-amd64), const IP_DF = 16384 +pkg syscall (freebsd-amd64), const IP_DONTFRAG = 67 +pkg syscall (freebsd-amd64), const IP_DROP_MEMBERSHIP = 13 +pkg syscall (freebsd-amd64), const IP_DROP_SOURCE_MEMBERSHIP = 71 +pkg syscall (freebsd-amd64), const IP_DUMMYNET3 = 49 +pkg syscall (freebsd-amd64), const IP_DUMMYNET_CONFIGURE = 60 +pkg syscall (freebsd-amd64), const IP_DUMMYNET_DEL = 61 +pkg syscall (freebsd-amd64), const IP_DUMMYNET_FLUSH = 62 +pkg syscall (freebsd-amd64), const IP_DUMMYNET_GET = 64 +pkg syscall (freebsd-amd64), const IP_FAITH = 22 +pkg syscall (freebsd-amd64), const IP_FW3 = 48 +pkg syscall (freebsd-amd64), const IP_FW_ADD = 50 +pkg syscall (freebsd-amd64), const IP_FW_DEL = 51 +pkg syscall (freebsd-amd64), const IP_FW_FLUSH = 52 +pkg syscall (freebsd-amd64), const IP_FW_GET = 54 +pkg syscall (freebsd-amd64), const IP_FW_NAT_CFG = 56 +pkg syscall (freebsd-amd64), const IP_FW_NAT_DEL = 57 +pkg syscall (freebsd-amd64), const IP_FW_NAT_GET_CONFIG = 58 +pkg syscall (freebsd-amd64), const IP_FW_NAT_GET_LOG = 59 +pkg syscall (freebsd-amd64), const IP_FW_RESETLOG = 55 +pkg syscall (freebsd-amd64), const IP_FW_TABLE_ADD = 40 +pkg syscall (freebsd-amd64), const IP_FW_TABLE_DEL = 41 +pkg syscall (freebsd-amd64), const IP_FW_TABLE_FLUSH = 42 +pkg syscall (freebsd-amd64), const IP_FW_TABLE_GETSIZE = 43 +pkg syscall (freebsd-amd64), const IP_FW_TABLE_LIST = 44 +pkg syscall (freebsd-amd64), const IP_FW_ZERO = 53 +pkg syscall (freebsd-amd64), const IP_HDRINCL = 2 +pkg syscall (freebsd-amd64), const IP_IPSEC_POLICY = 21 +pkg syscall (freebsd-amd64), const IP_MAXPACKET = 65535 +pkg syscall (freebsd-amd64), const IP_MAX_GROUP_SRC_FILTER = 512 +pkg syscall (freebsd-amd64), const IP_MAX_MEMBERSHIPS = 4095 +pkg syscall (freebsd-amd64), const IP_MAX_SOCK_MUTE_FILTER = 128 +pkg syscall (freebsd-amd64), const IP_MAX_SOCK_SRC_FILTER = 128 +pkg syscall (freebsd-amd64), const IP_MAX_SOURCE_FILTER = 1024 +pkg syscall (freebsd-amd64), const IP_MF = 8192 +pkg syscall (freebsd-amd64), const IP_MINTTL = 66 +pkg syscall (freebsd-amd64), const IP_MIN_MEMBERSHIPS = 31 +pkg syscall (freebsd-amd64), const IP_MSFILTER = 74 +pkg syscall (freebsd-amd64), const IP_MSS = 576 +pkg syscall (freebsd-amd64), const IP_MULTICAST_IF = 9 +pkg syscall (freebsd-amd64), const IP_MULTICAST_LOOP = 11 +pkg syscall (freebsd-amd64), const IP_MULTICAST_TTL = 10 +pkg syscall (freebsd-amd64), const IP_MULTICAST_VIF = 14 +pkg syscall (freebsd-amd64), const IP_OFFMASK = 8191 +pkg syscall (freebsd-amd64), const IP_ONESBCAST = 23 +pkg syscall (freebsd-amd64), const IP_OPTIONS = 1 +pkg syscall (freebsd-amd64), const IP_PORTRANGE = 19 +pkg syscall (freebsd-amd64), const IP_PORTRANGE_DEFAULT = 0 +pkg syscall (freebsd-amd64), const IP_PORTRANGE_HIGH = 1 +pkg syscall (freebsd-amd64), const IP_PORTRANGE_LOW = 2 +pkg syscall (freebsd-amd64), const IP_RECVDSTADDR = 7 +pkg syscall (freebsd-amd64), const IP_RECVIF = 20 +pkg syscall (freebsd-amd64), const IP_RECVOPTS = 5 +pkg syscall (freebsd-amd64), const IP_RECVRETOPTS = 6 +pkg syscall (freebsd-amd64), const IP_RECVTOS = 68 +pkg syscall (freebsd-amd64), const IP_RECVTOS ideal-int +pkg syscall (freebsd-amd64), const IP_RECVTTL = 65 +pkg syscall (freebsd-amd64), const IP_RETOPTS = 8 +pkg syscall (freebsd-amd64), const IP_RF = 32768 +pkg syscall (freebsd-amd64), const IP_RSVP_OFF = 16 +pkg syscall (freebsd-amd64), const IP_RSVP_ON = 15 +pkg syscall (freebsd-amd64), const IP_RSVP_VIF_OFF = 18 +pkg syscall (freebsd-amd64), const IP_RSVP_VIF_ON = 17 +pkg syscall (freebsd-amd64), const IP_SENDSRCADDR = 7 +pkg syscall (freebsd-amd64), const IP_TOS = 3 +pkg syscall (freebsd-amd64), const IP_TTL = 4 +pkg syscall (freebsd-amd64), const IP_UNBLOCK_SOURCE = 73 +pkg syscall (freebsd-amd64), const ISIG = 128 +pkg syscall (freebsd-amd64), const ISIG ideal-int +pkg syscall (freebsd-amd64), const ISTRIP = 32 +pkg syscall (freebsd-amd64), const ISTRIP ideal-int +pkg syscall (freebsd-amd64), const IXANY = 2048 +pkg syscall (freebsd-amd64), const IXANY ideal-int +pkg syscall (freebsd-amd64), const IXOFF = 1024 +pkg syscall (freebsd-amd64), const IXOFF ideal-int +pkg syscall (freebsd-amd64), const IXON = 512 +pkg syscall (freebsd-amd64), const IXON ideal-int +pkg syscall (freebsd-amd64), const ImplementsGetwd = false +pkg syscall (freebsd-amd64), const LOCK_EX = 2 +pkg syscall (freebsd-amd64), const LOCK_NB = 4 +pkg syscall (freebsd-amd64), const LOCK_SH = 1 +pkg syscall (freebsd-amd64), const LOCK_UN = 8 +pkg syscall (freebsd-amd64), const MADV_AUTOSYNC = 7 +pkg syscall (freebsd-amd64), const MADV_AUTOSYNC ideal-int +pkg syscall (freebsd-amd64), const MADV_CORE = 9 +pkg syscall (freebsd-amd64), const MADV_CORE ideal-int +pkg syscall (freebsd-amd64), const MADV_DONTNEED = 4 +pkg syscall (freebsd-amd64), const MADV_DONTNEED ideal-int +pkg syscall (freebsd-amd64), const MADV_FREE = 5 +pkg syscall (freebsd-amd64), const MADV_FREE ideal-int +pkg syscall (freebsd-amd64), const MADV_NOCORE = 8 +pkg syscall (freebsd-amd64), const MADV_NOCORE ideal-int +pkg syscall (freebsd-amd64), const MADV_NORMAL = 0 +pkg syscall (freebsd-amd64), const MADV_NORMAL ideal-int +pkg syscall (freebsd-amd64), const MADV_NOSYNC = 6 +pkg syscall (freebsd-amd64), const MADV_NOSYNC ideal-int +pkg syscall (freebsd-amd64), const MADV_PROTECT = 10 +pkg syscall (freebsd-amd64), const MADV_PROTECT ideal-int +pkg syscall (freebsd-amd64), const MADV_RANDOM = 1 +pkg syscall (freebsd-amd64), const MADV_RANDOM ideal-int +pkg syscall (freebsd-amd64), const MADV_SEQUENTIAL = 2 +pkg syscall (freebsd-amd64), const MADV_SEQUENTIAL ideal-int +pkg syscall (freebsd-amd64), const MADV_WILLNEED = 3 +pkg syscall (freebsd-amd64), const MADV_WILLNEED ideal-int +pkg syscall (freebsd-amd64), const MAP_ANON = 4096 +pkg syscall (freebsd-amd64), const MAP_ANON ideal-int +pkg syscall (freebsd-amd64), const MAP_ANONYMOUS = 4096 +pkg syscall (freebsd-amd64), const MAP_ANONYMOUS ideal-int +pkg syscall (freebsd-amd64), const MAP_COPY = 2 +pkg syscall (freebsd-amd64), const MAP_COPY ideal-int +pkg syscall (freebsd-amd64), const MAP_FILE = 0 +pkg syscall (freebsd-amd64), const MAP_FILE ideal-int +pkg syscall (freebsd-amd64), const MAP_FIXED = 16 +pkg syscall (freebsd-amd64), const MAP_FIXED ideal-int +pkg syscall (freebsd-amd64), const MAP_HASSEMAPHORE = 512 +pkg syscall (freebsd-amd64), const MAP_HASSEMAPHORE ideal-int +pkg syscall (freebsd-amd64), const MAP_NOCORE = 131072 +pkg syscall (freebsd-amd64), const MAP_NOCORE ideal-int +pkg syscall (freebsd-amd64), const MAP_NORESERVE = 64 +pkg syscall (freebsd-amd64), const MAP_NORESERVE ideal-int +pkg syscall (freebsd-amd64), const MAP_NOSYNC = 2048 +pkg syscall (freebsd-amd64), const MAP_NOSYNC ideal-int +pkg syscall (freebsd-amd64), const MAP_PREFAULT_READ = 262144 +pkg syscall (freebsd-amd64), const MAP_PREFAULT_READ ideal-int +pkg syscall (freebsd-amd64), const MAP_PRIVATE = 2 +pkg syscall (freebsd-amd64), const MAP_PRIVATE ideal-int +pkg syscall (freebsd-amd64), const MAP_RENAME = 32 +pkg syscall (freebsd-amd64), const MAP_RENAME ideal-int +pkg syscall (freebsd-amd64), const MAP_RESERVED0080 = 128 +pkg syscall (freebsd-amd64), const MAP_RESERVED0080 ideal-int +pkg syscall (freebsd-amd64), const MAP_RESERVED0100 = 256 +pkg syscall (freebsd-amd64), const MAP_RESERVED0100 ideal-int +pkg syscall (freebsd-amd64), const MAP_SHARED = 1 +pkg syscall (freebsd-amd64), const MAP_SHARED ideal-int +pkg syscall (freebsd-amd64), const MAP_STACK = 1024 +pkg syscall (freebsd-amd64), const MAP_STACK ideal-int +pkg syscall (freebsd-amd64), const MCL_CURRENT = 1 +pkg syscall (freebsd-amd64), const MCL_CURRENT ideal-int +pkg syscall (freebsd-amd64), const MCL_FUTURE = 2 +pkg syscall (freebsd-amd64), const MCL_FUTURE ideal-int +pkg syscall (freebsd-amd64), const MSG_COMPAT = 32768 +pkg syscall (freebsd-amd64), const MSG_CTRUNC = 32 +pkg syscall (freebsd-amd64), const MSG_DONTROUTE = 4 +pkg syscall (freebsd-amd64), const MSG_DONTWAIT = 128 +pkg syscall (freebsd-amd64), const MSG_EOF = 256 +pkg syscall (freebsd-amd64), const MSG_EOR = 8 +pkg syscall (freebsd-amd64), const MSG_NBIO = 16384 +pkg syscall (freebsd-amd64), const MSG_NOSIGNAL = 131072 +pkg syscall (freebsd-amd64), const MSG_NOTIFICATION = 8192 +pkg syscall (freebsd-amd64), const MSG_OOB = 1 +pkg syscall (freebsd-amd64), const MSG_PEEK = 2 +pkg syscall (freebsd-amd64), const MSG_TRUNC = 16 +pkg syscall (freebsd-amd64), const MSG_WAITALL = 64 +pkg syscall (freebsd-amd64), const MS_ASYNC = 1 +pkg syscall (freebsd-amd64), const MS_ASYNC ideal-int +pkg syscall (freebsd-amd64), const MS_INVALIDATE = 2 +pkg syscall (freebsd-amd64), const MS_INVALIDATE ideal-int +pkg syscall (freebsd-amd64), const MS_SYNC = 0 +pkg syscall (freebsd-amd64), const MS_SYNC ideal-int +pkg syscall (freebsd-amd64), const NET_RT_DUMP = 1 +pkg syscall (freebsd-amd64), const NET_RT_FLAGS = 2 +pkg syscall (freebsd-amd64), const NET_RT_IFLIST = 3 +pkg syscall (freebsd-amd64), const NET_RT_IFLISTL = 5 +pkg syscall (freebsd-amd64), const NET_RT_IFLISTL ideal-int +pkg syscall (freebsd-amd64), const NET_RT_IFMALIST = 4 +pkg syscall (freebsd-amd64), const NET_RT_MAXID = 6 +pkg syscall (freebsd-amd64), const NOFLSH = 2147483648 +pkg syscall (freebsd-amd64), const NOFLSH ideal-int +pkg syscall (freebsd-amd64), const NOTE_ATTRIB = 8 +pkg syscall (freebsd-amd64), const NOTE_CHILD = 4 +pkg syscall (freebsd-amd64), const NOTE_DELETE = 1 +pkg syscall (freebsd-amd64), const NOTE_EXEC = 536870912 +pkg syscall (freebsd-amd64), const NOTE_EXIT = 2147483648 +pkg syscall (freebsd-amd64), const NOTE_EXTEND = 4 +pkg syscall (freebsd-amd64), const NOTE_FFAND = 1073741824 +pkg syscall (freebsd-amd64), const NOTE_FFCOPY = 3221225472 +pkg syscall (freebsd-amd64), const NOTE_FFCTRLMASK = 3221225472 +pkg syscall (freebsd-amd64), const NOTE_FFLAGSMASK = 16777215 +pkg syscall (freebsd-amd64), const NOTE_FFNOP = 0 +pkg syscall (freebsd-amd64), const NOTE_FFOR = 2147483648 +pkg syscall (freebsd-amd64), const NOTE_FORK = 1073741824 +pkg syscall (freebsd-amd64), const NOTE_LINK = 16 +pkg syscall (freebsd-amd64), const NOTE_LOWAT = 1 +pkg syscall (freebsd-amd64), const NOTE_PCTRLMASK = 4026531840 +pkg syscall (freebsd-amd64), const NOTE_PDATAMASK = 1048575 +pkg syscall (freebsd-amd64), const NOTE_RENAME = 32 +pkg syscall (freebsd-amd64), const NOTE_REVOKE = 64 +pkg syscall (freebsd-amd64), const NOTE_TRACK = 1 +pkg syscall (freebsd-amd64), const NOTE_TRACKERR = 2 +pkg syscall (freebsd-amd64), const NOTE_TRIGGER = 16777216 +pkg syscall (freebsd-amd64), const NOTE_WRITE = 2 +pkg syscall (freebsd-amd64), const OCRNL = 16 +pkg syscall (freebsd-amd64), const OCRNL ideal-int +pkg syscall (freebsd-amd64), const ONLCR = 2 +pkg syscall (freebsd-amd64), const ONLCR ideal-int +pkg syscall (freebsd-amd64), const ONLRET = 64 +pkg syscall (freebsd-amd64), const ONLRET ideal-int +pkg syscall (freebsd-amd64), const ONOCR = 32 +pkg syscall (freebsd-amd64), const ONOCR ideal-int +pkg syscall (freebsd-amd64), const ONOEOT = 8 +pkg syscall (freebsd-amd64), const ONOEOT ideal-int +pkg syscall (freebsd-amd64), const OPOST = 1 +pkg syscall (freebsd-amd64), const OPOST ideal-int +pkg syscall (freebsd-amd64), const O_ACCMODE = 3 +pkg syscall (freebsd-amd64), const O_APPEND = 8 +pkg syscall (freebsd-amd64), const O_ASYNC = 64 +pkg syscall (freebsd-amd64), const O_CLOEXEC = 0 +pkg syscall (freebsd-amd64), const O_CREAT = 512 +pkg syscall (freebsd-amd64), const O_DIRECT = 65536 +pkg syscall (freebsd-amd64), const O_DIRECTORY = 131072 +pkg syscall (freebsd-amd64), const O_EXCL = 2048 +pkg syscall (freebsd-amd64), const O_EXEC = 262144 +pkg syscall (freebsd-amd64), const O_EXLOCK = 32 +pkg syscall (freebsd-amd64), const O_FSYNC = 128 +pkg syscall (freebsd-amd64), const O_NDELAY = 4 +pkg syscall (freebsd-amd64), const O_NOCTTY = 32768 +pkg syscall (freebsd-amd64), const O_NOFOLLOW = 256 +pkg syscall (freebsd-amd64), const O_NONBLOCK = 4 +pkg syscall (freebsd-amd64), const O_SHLOCK = 16 +pkg syscall (freebsd-amd64), const O_SYNC = 128 +pkg syscall (freebsd-amd64), const O_TRUNC = 1024 +pkg syscall (freebsd-amd64), const O_TTY_INIT = 524288 +pkg syscall (freebsd-amd64), const PARENB = 4096 +pkg syscall (freebsd-amd64), const PARENB ideal-int +pkg syscall (freebsd-amd64), const PARMRK = 8 +pkg syscall (freebsd-amd64), const PARMRK ideal-int +pkg syscall (freebsd-amd64), const PARODD = 8192 +pkg syscall (freebsd-amd64), const PARODD ideal-int +pkg syscall (freebsd-amd64), const PENDIN = 536870912 +pkg syscall (freebsd-amd64), const PENDIN ideal-int +pkg syscall (freebsd-amd64), const PROT_EXEC = 4 +pkg syscall (freebsd-amd64), const PROT_EXEC ideal-int +pkg syscall (freebsd-amd64), const PROT_NONE = 0 +pkg syscall (freebsd-amd64), const PROT_NONE ideal-int +pkg syscall (freebsd-amd64), const PROT_READ = 1 +pkg syscall (freebsd-amd64), const PROT_READ ideal-int +pkg syscall (freebsd-amd64), const PROT_WRITE = 2 +pkg syscall (freebsd-amd64), const PROT_WRITE ideal-int +pkg syscall (freebsd-amd64), const PTRACE_CONT = 7 +pkg syscall (freebsd-amd64), const PTRACE_KILL = 8 +pkg syscall (freebsd-amd64), const PTRACE_TRACEME = 0 +pkg syscall (freebsd-amd64), const RLIMIT_AS = 10 +pkg syscall (freebsd-amd64), const RLIMIT_CORE = 4 +pkg syscall (freebsd-amd64), const RLIMIT_CPU = 0 +pkg syscall (freebsd-amd64), const RLIMIT_DATA = 2 +pkg syscall (freebsd-amd64), const RLIMIT_FSIZE = 1 +pkg syscall (freebsd-amd64), const RLIMIT_NOFILE = 8 +pkg syscall (freebsd-amd64), const RLIMIT_STACK = 3 +pkg syscall (freebsd-amd64), const RLIM_INFINITY = 9223372036854775807 +pkg syscall (freebsd-amd64), const RTAX_AUTHOR = 6 +pkg syscall (freebsd-amd64), const RTAX_BRD = 7 +pkg syscall (freebsd-amd64), const RTAX_DST = 0 +pkg syscall (freebsd-amd64), const RTAX_GATEWAY = 1 +pkg syscall (freebsd-amd64), const RTAX_GENMASK = 3 +pkg syscall (freebsd-amd64), const RTAX_IFA = 5 +pkg syscall (freebsd-amd64), const RTAX_IFP = 4 +pkg syscall (freebsd-amd64), const RTAX_MAX = 8 +pkg syscall (freebsd-amd64), const RTAX_NETMASK = 2 +pkg syscall (freebsd-amd64), const RTA_AUTHOR = 64 +pkg syscall (freebsd-amd64), const RTA_BRD = 128 +pkg syscall (freebsd-amd64), const RTA_DST = 1 +pkg syscall (freebsd-amd64), const RTA_GATEWAY = 2 +pkg syscall (freebsd-amd64), const RTA_GENMASK = 8 +pkg syscall (freebsd-amd64), const RTA_IFA = 32 +pkg syscall (freebsd-amd64), const RTA_IFP = 16 +pkg syscall (freebsd-amd64), const RTA_NETMASK = 4 +pkg syscall (freebsd-amd64), const RTF_BLACKHOLE = 4096 +pkg syscall (freebsd-amd64), const RTF_BROADCAST = 4194304 +pkg syscall (freebsd-amd64), const RTF_DONE = 64 +pkg syscall (freebsd-amd64), const RTF_DYNAMIC = 16 +pkg syscall (freebsd-amd64), const RTF_FMASK = 268752904 +pkg syscall (freebsd-amd64), const RTF_GATEWAY = 2 +pkg syscall (freebsd-amd64), const RTF_HOST = 4 +pkg syscall (freebsd-amd64), const RTF_LLDATA = 1024 +pkg syscall (freebsd-amd64), const RTF_LLINFO = 1024 +pkg syscall (freebsd-amd64), const RTF_LOCAL = 2097152 +pkg syscall (freebsd-amd64), const RTF_MODIFIED = 32 +pkg syscall (freebsd-amd64), const RTF_MULTICAST = 8388608 +pkg syscall (freebsd-amd64), const RTF_PINNED = 1048576 +pkg syscall (freebsd-amd64), const RTF_PRCLONING = 65536 +pkg syscall (freebsd-amd64), const RTF_PROTO1 = 32768 +pkg syscall (freebsd-amd64), const RTF_PROTO2 = 16384 +pkg syscall (freebsd-amd64), const RTF_PROTO3 = 262144 +pkg syscall (freebsd-amd64), const RTF_REJECT = 8 +pkg syscall (freebsd-amd64), const RTF_RNH_LOCKED = 1073741824 +pkg syscall (freebsd-amd64), const RTF_STATIC = 2048 +pkg syscall (freebsd-amd64), const RTF_STICKY = 268435456 +pkg syscall (freebsd-amd64), const RTF_UP = 1 +pkg syscall (freebsd-amd64), const RTF_XRESOLVE = 512 +pkg syscall (freebsd-amd64), const RTM_ADD = 1 +pkg syscall (freebsd-amd64), const RTM_CHANGE = 3 +pkg syscall (freebsd-amd64), const RTM_DELADDR = 13 +pkg syscall (freebsd-amd64), const RTM_DELETE = 2 +pkg syscall (freebsd-amd64), const RTM_DELMADDR = 16 +pkg syscall (freebsd-amd64), const RTM_GET = 4 +pkg syscall (freebsd-amd64), const RTM_IEEE80211 = 18 +pkg syscall (freebsd-amd64), const RTM_IFANNOUNCE = 17 +pkg syscall (freebsd-amd64), const RTM_IFINFO = 14 +pkg syscall (freebsd-amd64), const RTM_LOCK = 8 +pkg syscall (freebsd-amd64), const RTM_LOSING = 5 +pkg syscall (freebsd-amd64), const RTM_MISS = 7 +pkg syscall (freebsd-amd64), const RTM_NEWADDR = 12 +pkg syscall (freebsd-amd64), const RTM_NEWMADDR = 15 +pkg syscall (freebsd-amd64), const RTM_OLDADD = 9 +pkg syscall (freebsd-amd64), const RTM_OLDDEL = 10 +pkg syscall (freebsd-amd64), const RTM_REDIRECT = 6 +pkg syscall (freebsd-amd64), const RTM_RESOLVE = 11 +pkg syscall (freebsd-amd64), const RTM_RTTUNIT = 1000000 +pkg syscall (freebsd-amd64), const RTM_VERSION = 5 +pkg syscall (freebsd-amd64), const RTV_EXPIRE = 4 +pkg syscall (freebsd-amd64), const RTV_HOPCOUNT = 2 +pkg syscall (freebsd-amd64), const RTV_MTU = 1 +pkg syscall (freebsd-amd64), const RTV_RPIPE = 8 +pkg syscall (freebsd-amd64), const RTV_RTT = 64 +pkg syscall (freebsd-amd64), const RTV_RTTVAR = 128 +pkg syscall (freebsd-amd64), const RTV_SPIPE = 16 +pkg syscall (freebsd-amd64), const RTV_SSTHRESH = 32 +pkg syscall (freebsd-amd64), const RTV_WEIGHT = 256 +pkg syscall (freebsd-amd64), const RT_CACHING_CONTEXT = 1 +pkg syscall (freebsd-amd64), const RT_CACHING_CONTEXT ideal-int +pkg syscall (freebsd-amd64), const RT_DEFAULT_FIB = 0 +pkg syscall (freebsd-amd64), const RT_DEFAULT_FIB ideal-int +pkg syscall (freebsd-amd64), const RUSAGE_CHILDREN = -1 +pkg syscall (freebsd-amd64), const RUSAGE_SELF = 0 +pkg syscall (freebsd-amd64), const RUSAGE_THREAD = 1 +pkg syscall (freebsd-amd64), const SCM_BINTIME = 4 +pkg syscall (freebsd-amd64), const SCM_CREDS = 3 +pkg syscall (freebsd-amd64), const SCM_RIGHTS = 1 +pkg syscall (freebsd-amd64), const SCM_TIMESTAMP = 2 +pkg syscall (freebsd-amd64), const SIGBUS = 10 +pkg syscall (freebsd-amd64), const SIGCHLD = 20 +pkg syscall (freebsd-amd64), const SIGCONT = 19 +pkg syscall (freebsd-amd64), const SIGEMT = 7 +pkg syscall (freebsd-amd64), const SIGINFO = 29 +pkg syscall (freebsd-amd64), const SIGIO = 23 +pkg syscall (freebsd-amd64), const SIGIOT = 6 +pkg syscall (freebsd-amd64), const SIGLWP = 32 +pkg syscall (freebsd-amd64), const SIGPROF = 27 +pkg syscall (freebsd-amd64), const SIGSTOP = 17 +pkg syscall (freebsd-amd64), const SIGSYS = 12 +pkg syscall (freebsd-amd64), const SIGTHR = 32 +pkg syscall (freebsd-amd64), const SIGTSTP = 18 +pkg syscall (freebsd-amd64), const SIGTTIN = 21 +pkg syscall (freebsd-amd64), const SIGTTOU = 22 +pkg syscall (freebsd-amd64), const SIGURG = 16 +pkg syscall (freebsd-amd64), const SIGUSR1 = 30 +pkg syscall (freebsd-amd64), const SIGUSR2 = 31 +pkg syscall (freebsd-amd64), const SIGVTALRM = 26 +pkg syscall (freebsd-amd64), const SIGWINCH = 28 +pkg syscall (freebsd-amd64), const SIGXCPU = 24 +pkg syscall (freebsd-amd64), const SIGXFSZ = 25 +pkg syscall (freebsd-amd64), const SIOCADDMULTI = 2149607729 +pkg syscall (freebsd-amd64), const SIOCADDRT = 2151707146 +pkg syscall (freebsd-amd64), const SIOCAIFADDR = 2151704858 +pkg syscall (freebsd-amd64), const SIOCAIFGROUP = 2150132103 +pkg syscall (freebsd-amd64), const SIOCALIFADDR = 2165860635 +pkg syscall (freebsd-amd64), const SIOCATMARK = 1074033415 +pkg syscall (freebsd-amd64), const SIOCDELMULTI = 2149607730 +pkg syscall (freebsd-amd64), const SIOCDELRT = 2151707147 +pkg syscall (freebsd-amd64), const SIOCDIFADDR = 2149607705 +pkg syscall (freebsd-amd64), const SIOCDIFGROUP = 2150132105 +pkg syscall (freebsd-amd64), const SIOCDIFPHYADDR = 2149607753 +pkg syscall (freebsd-amd64), const SIOCDLIFADDR = 2165860637 +pkg syscall (freebsd-amd64), const SIOCGDRVSPEC = 3223873915 +pkg syscall (freebsd-amd64), const SIOCGETSGCNT = 3223351824 +pkg syscall (freebsd-amd64), const SIOCGETVIFCNT = 3223876111 +pkg syscall (freebsd-amd64), const SIOCGHIWAT = 1074033409 +pkg syscall (freebsd-amd64), const SIOCGIFADDR = 3223349537 +pkg syscall (freebsd-amd64), const SIOCGIFBRDADDR = 3223349539 +pkg syscall (freebsd-amd64), const SIOCGIFCAP = 3223349535 +pkg syscall (freebsd-amd64), const SIOCGIFCONF = 3222300964 +pkg syscall (freebsd-amd64), const SIOCGIFDESCR = 3223349546 +pkg syscall (freebsd-amd64), const SIOCGIFDSTADDR = 3223349538 +pkg syscall (freebsd-amd64), const SIOCGIFFIB = 3223349596 +pkg syscall (freebsd-amd64), const SIOCGIFFIB ideal-int +pkg syscall (freebsd-amd64), const SIOCGIFFLAGS = 3223349521 +pkg syscall (freebsd-amd64), const SIOCGIFGENERIC = 3223349562 +pkg syscall (freebsd-amd64), const SIOCGIFGMEMB = 3223873930 +pkg syscall (freebsd-amd64), const SIOCGIFGROUP = 3223873928 +pkg syscall (freebsd-amd64), const SIOCGIFINDEX = 3223349536 +pkg syscall (freebsd-amd64), const SIOCGIFMAC = 3223349542 +pkg syscall (freebsd-amd64), const SIOCGIFMEDIA = 3224398136 +pkg syscall (freebsd-amd64), const SIOCGIFMETRIC = 3223349527 +pkg syscall (freebsd-amd64), const SIOCGIFMTU = 3223349555 +pkg syscall (freebsd-amd64), const SIOCGIFNETMASK = 3223349541 +pkg syscall (freebsd-amd64), const SIOCGIFPDSTADDR = 3223349576 +pkg syscall (freebsd-amd64), const SIOCGIFPHYS = 3223349557 +pkg syscall (freebsd-amd64), const SIOCGIFPSRCADDR = 3223349575 +pkg syscall (freebsd-amd64), const SIOCGIFSTATUS = 3274795323 +pkg syscall (freebsd-amd64), const SIOCGLIFADDR = 3239602460 +pkg syscall (freebsd-amd64), const SIOCGLIFPHYADDR = 3239602507 +pkg syscall (freebsd-amd64), const SIOCGLOWAT = 1074033411 +pkg syscall (freebsd-amd64), const SIOCGPGRP = 1074033417 +pkg syscall (freebsd-amd64), const SIOCGPRIVATE_0 = 3223349584 +pkg syscall (freebsd-amd64), const SIOCGPRIVATE_1 = 3223349585 +pkg syscall (freebsd-amd64), const SIOCIFCREATE = 3223349626 +pkg syscall (freebsd-amd64), const SIOCIFCREATE2 = 3223349628 +pkg syscall (freebsd-amd64), const SIOCIFDESTROY = 2149607801 +pkg syscall (freebsd-amd64), const SIOCIFGCLONERS = 3222301048 +pkg syscall (freebsd-amd64), const SIOCSDRVSPEC = 2150132091 +pkg syscall (freebsd-amd64), const SIOCSHIWAT = 2147775232 +pkg syscall (freebsd-amd64), const SIOCSIFADDR = 2149607692 +pkg syscall (freebsd-amd64), const SIOCSIFBRDADDR = 2149607699 +pkg syscall (freebsd-amd64), const SIOCSIFCAP = 2149607710 +pkg syscall (freebsd-amd64), const SIOCSIFDESCR = 2149607721 +pkg syscall (freebsd-amd64), const SIOCSIFDSTADDR = 2149607694 +pkg syscall (freebsd-amd64), const SIOCSIFFIB = 2149607773 +pkg syscall (freebsd-amd64), const SIOCSIFFIB ideal-int +pkg syscall (freebsd-amd64), const SIOCSIFFLAGS = 2149607696 +pkg syscall (freebsd-amd64), const SIOCSIFGENERIC = 2149607737 +pkg syscall (freebsd-amd64), const SIOCSIFLLADDR = 2149607740 +pkg syscall (freebsd-amd64), const SIOCSIFMAC = 2149607719 +pkg syscall (freebsd-amd64), const SIOCSIFMEDIA = 3223349559 +pkg syscall (freebsd-amd64), const SIOCSIFMETRIC = 2149607704 +pkg syscall (freebsd-amd64), const SIOCSIFMTU = 2149607732 +pkg syscall (freebsd-amd64), const SIOCSIFNAME = 2149607720 +pkg syscall (freebsd-amd64), const SIOCSIFNETMASK = 2149607702 +pkg syscall (freebsd-amd64), const SIOCSIFPHYADDR = 2151704902 +pkg syscall (freebsd-amd64), const SIOCSIFPHYS = 2149607734 +pkg syscall (freebsd-amd64), const SIOCSIFRVNET = 3223349595 +pkg syscall (freebsd-amd64), const SIOCSIFVNET = 3223349594 +pkg syscall (freebsd-amd64), const SIOCSLIFPHYADDR = 2165860682 +pkg syscall (freebsd-amd64), const SIOCSLOWAT = 2147775234 +pkg syscall (freebsd-amd64), const SIOCSPGRP = 2147775240 +pkg syscall (freebsd-amd64), const SOCK_MAXADDRLEN = 255 +pkg syscall (freebsd-amd64), const SOCK_RDM = 4 +pkg syscall (freebsd-amd64), const SOL_SOCKET = 65535 +pkg syscall (freebsd-amd64), const SOMAXCONN = 128 +pkg syscall (freebsd-amd64), const SO_ACCEPTCONN = 2 +pkg syscall (freebsd-amd64), const SO_ACCEPTFILTER = 4096 +pkg syscall (freebsd-amd64), const SO_BINTIME = 8192 +pkg syscall (freebsd-amd64), const SO_BROADCAST = 32 +pkg syscall (freebsd-amd64), const SO_DEBUG = 1 +pkg syscall (freebsd-amd64), const SO_DONTROUTE = 16 +pkg syscall (freebsd-amd64), const SO_ERROR = 4103 +pkg syscall (freebsd-amd64), const SO_KEEPALIVE = 8 +pkg syscall (freebsd-amd64), const SO_LABEL = 4105 +pkg syscall (freebsd-amd64), const SO_LINGER = 128 +pkg syscall (freebsd-amd64), const SO_LISTENINCQLEN = 4115 +pkg syscall (freebsd-amd64), const SO_LISTENQLEN = 4114 +pkg syscall (freebsd-amd64), const SO_LISTENQLIMIT = 4113 +pkg syscall (freebsd-amd64), const SO_NOSIGPIPE = 2048 +pkg syscall (freebsd-amd64), const SO_NO_DDP = 32768 +pkg syscall (freebsd-amd64), const SO_NO_OFFLOAD = 16384 +pkg syscall (freebsd-amd64), const SO_OOBINLINE = 256 +pkg syscall (freebsd-amd64), const SO_PEERLABEL = 4112 +pkg syscall (freebsd-amd64), const SO_PROTOCOL = 4118 +pkg syscall (freebsd-amd64), const SO_PROTOCOL ideal-int +pkg syscall (freebsd-amd64), const SO_PROTOTYPE = 4118 +pkg syscall (freebsd-amd64), const SO_PROTOTYPE ideal-int +pkg syscall (freebsd-amd64), const SO_RCVBUF = 4098 +pkg syscall (freebsd-amd64), const SO_RCVLOWAT = 4100 +pkg syscall (freebsd-amd64), const SO_RCVTIMEO = 4102 +pkg syscall (freebsd-amd64), const SO_REUSEADDR = 4 +pkg syscall (freebsd-amd64), const SO_REUSEPORT = 512 +pkg syscall (freebsd-amd64), const SO_SETFIB = 4116 +pkg syscall (freebsd-amd64), const SO_SNDBUF = 4097 +pkg syscall (freebsd-amd64), const SO_SNDLOWAT = 4099 +pkg syscall (freebsd-amd64), const SO_SNDTIMEO = 4101 +pkg syscall (freebsd-amd64), const SO_TIMESTAMP = 1024 +pkg syscall (freebsd-amd64), const SO_TYPE = 4104 +pkg syscall (freebsd-amd64), const SO_USELOOPBACK = 64 +pkg syscall (freebsd-amd64), const SO_USER_COOKIE = 4117 +pkg syscall (freebsd-amd64), const SO_USER_COOKIE ideal-int +pkg syscall (freebsd-amd64), const SYS_ABORT2 = 463 +pkg syscall (freebsd-amd64), const SYS_ACCEPT = 30 +pkg syscall (freebsd-amd64), const SYS_ACCESS = 33 +pkg syscall (freebsd-amd64), const SYS_ACCT = 51 +pkg syscall (freebsd-amd64), const SYS_ADJTIME = 140 +pkg syscall (freebsd-amd64), const SYS_AUDIT = 445 +pkg syscall (freebsd-amd64), const SYS_AUDITCTL = 453 +pkg syscall (freebsd-amd64), const SYS_AUDITON = 446 +pkg syscall (freebsd-amd64), const SYS_BIND = 104 +pkg syscall (freebsd-amd64), const SYS_CAP_ENTER = 516 +pkg syscall (freebsd-amd64), const SYS_CAP_GETMODE = 517 +pkg syscall (freebsd-amd64), const SYS_CAP_GETRIGHTS = 515 +pkg syscall (freebsd-amd64), const SYS_CAP_NEW = 514 +pkg syscall (freebsd-amd64), const SYS_CHDIR = 12 +pkg syscall (freebsd-amd64), const SYS_CHFLAGS = 34 +pkg syscall (freebsd-amd64), const SYS_CHMOD = 15 +pkg syscall (freebsd-amd64), const SYS_CHOWN = 16 +pkg syscall (freebsd-amd64), const SYS_CHROOT = 61 +pkg syscall (freebsd-amd64), const SYS_CLOCK_GETCPUCLOCKID2 = 247 +pkg syscall (freebsd-amd64), const SYS_CLOCK_GETCPUCLOCKID2 ideal-int +pkg syscall (freebsd-amd64), const SYS_CLOCK_GETRES = 234 +pkg syscall (freebsd-amd64), const SYS_CLOCK_GETTIME = 232 +pkg syscall (freebsd-amd64), const SYS_CLOCK_SETTIME = 233 +pkg syscall (freebsd-amd64), const SYS_CLOSE = 6 +pkg syscall (freebsd-amd64), const SYS_CLOSEFROM = 509 +pkg syscall (freebsd-amd64), const SYS_CONNECT = 98 +pkg syscall (freebsd-amd64), const SYS_CPUSET = 484 +pkg syscall (freebsd-amd64), const SYS_CPUSET_GETAFFINITY = 487 +pkg syscall (freebsd-amd64), const SYS_CPUSET_GETID = 486 +pkg syscall (freebsd-amd64), const SYS_CPUSET_SETAFFINITY = 488 +pkg syscall (freebsd-amd64), const SYS_CPUSET_SETID = 485 +pkg syscall (freebsd-amd64), const SYS_DUP = 41 +pkg syscall (freebsd-amd64), const SYS_DUP2 = 90 +pkg syscall (freebsd-amd64), const SYS_EACCESS = 376 +pkg syscall (freebsd-amd64), const SYS_EXECVE = 59 +pkg syscall (freebsd-amd64), const SYS_EXIT = 1 +pkg syscall (freebsd-amd64), const SYS_EXTATTRCTL = 355 +pkg syscall (freebsd-amd64), const SYS_EXTATTR_DELETE_FD = 373 +pkg syscall (freebsd-amd64), const SYS_EXTATTR_DELETE_FILE = 358 +pkg syscall (freebsd-amd64), const SYS_EXTATTR_DELETE_LINK = 414 +pkg syscall (freebsd-amd64), const SYS_EXTATTR_GET_FD = 372 +pkg syscall (freebsd-amd64), const SYS_EXTATTR_GET_FILE = 357 +pkg syscall (freebsd-amd64), const SYS_EXTATTR_GET_LINK = 413 +pkg syscall (freebsd-amd64), const SYS_EXTATTR_LIST_FD = 437 +pkg syscall (freebsd-amd64), const SYS_EXTATTR_LIST_FILE = 438 +pkg syscall (freebsd-amd64), const SYS_EXTATTR_LIST_LINK = 439 +pkg syscall (freebsd-amd64), const SYS_EXTATTR_SET_FD = 371 +pkg syscall (freebsd-amd64), const SYS_EXTATTR_SET_FILE = 356 +pkg syscall (freebsd-amd64), const SYS_EXTATTR_SET_LINK = 412 +pkg syscall (freebsd-amd64), const SYS_FACCESSAT = 489 +pkg syscall (freebsd-amd64), const SYS_FCHDIR = 13 +pkg syscall (freebsd-amd64), const SYS_FCHFLAGS = 35 +pkg syscall (freebsd-amd64), const SYS_FCHMOD = 124 +pkg syscall (freebsd-amd64), const SYS_FCHMODAT = 490 +pkg syscall (freebsd-amd64), const SYS_FCHOWN = 123 +pkg syscall (freebsd-amd64), const SYS_FCHOWNAT = 491 +pkg syscall (freebsd-amd64), const SYS_FCNTL = 92 +pkg syscall (freebsd-amd64), const SYS_FEXECVE = 492 +pkg syscall (freebsd-amd64), const SYS_FFCLOCK_GETCOUNTER = 241 +pkg syscall (freebsd-amd64), const SYS_FFCLOCK_GETESTIMATE = 243 +pkg syscall (freebsd-amd64), const SYS_FFCLOCK_SETESTIMATE = 242 +pkg syscall (freebsd-amd64), const SYS_FHOPEN = 298 +pkg syscall (freebsd-amd64), const SYS_FHSTAT = 299 +pkg syscall (freebsd-amd64), const SYS_FHSTATFS = 398 +pkg syscall (freebsd-amd64), const SYS_FLOCK = 131 +pkg syscall (freebsd-amd64), const SYS_FORK = 2 +pkg syscall (freebsd-amd64), const SYS_FPATHCONF = 192 +pkg syscall (freebsd-amd64), const SYS_FREEBSD6_FTRUNCATE = 201 +pkg syscall (freebsd-amd64), const SYS_FREEBSD6_LSEEK = 199 +pkg syscall (freebsd-amd64), const SYS_FREEBSD6_MMAP = 197 +pkg syscall (freebsd-amd64), const SYS_FREEBSD6_PREAD = 173 +pkg syscall (freebsd-amd64), const SYS_FREEBSD6_PWRITE = 174 +pkg syscall (freebsd-amd64), const SYS_FREEBSD6_TRUNCATE = 200 +pkg syscall (freebsd-amd64), const SYS_FSTAT = 189 +pkg syscall (freebsd-amd64), const SYS_FSTATAT = 493 +pkg syscall (freebsd-amd64), const SYS_FSTATFS = 397 +pkg syscall (freebsd-amd64), const SYS_FSYNC = 95 +pkg syscall (freebsd-amd64), const SYS_FTRUNCATE = 480 +pkg syscall (freebsd-amd64), const SYS_FUTIMES = 206 +pkg syscall (freebsd-amd64), const SYS_FUTIMESAT = 494 +pkg syscall (freebsd-amd64), const SYS_GETAUDIT = 449 +pkg syscall (freebsd-amd64), const SYS_GETAUDIT_ADDR = 451 +pkg syscall (freebsd-amd64), const SYS_GETAUID = 447 +pkg syscall (freebsd-amd64), const SYS_GETCONTEXT = 421 +pkg syscall (freebsd-amd64), const SYS_GETDENTS = 272 +pkg syscall (freebsd-amd64), const SYS_GETDIRENTRIES = 196 +pkg syscall (freebsd-amd64), const SYS_GETDTABLESIZE = 89 +pkg syscall (freebsd-amd64), const SYS_GETEGID = 43 +pkg syscall (freebsd-amd64), const SYS_GETEUID = 25 +pkg syscall (freebsd-amd64), const SYS_GETFH = 161 +pkg syscall (freebsd-amd64), const SYS_GETFSSTAT = 395 +pkg syscall (freebsd-amd64), const SYS_GETGID = 47 +pkg syscall (freebsd-amd64), const SYS_GETGROUPS = 79 +pkg syscall (freebsd-amd64), const SYS_GETITIMER = 86 +pkg syscall (freebsd-amd64), const SYS_GETLOGIN = 49 +pkg syscall (freebsd-amd64), const SYS_GETLOGINCLASS = 523 +pkg syscall (freebsd-amd64), const SYS_GETPEERNAME = 31 +pkg syscall (freebsd-amd64), const SYS_GETPGID = 207 +pkg syscall (freebsd-amd64), const SYS_GETPGRP = 81 +pkg syscall (freebsd-amd64), const SYS_GETPID = 20 +pkg syscall (freebsd-amd64), const SYS_GETPPID = 39 +pkg syscall (freebsd-amd64), const SYS_GETPRIORITY = 100 +pkg syscall (freebsd-amd64), const SYS_GETRESGID = 361 +pkg syscall (freebsd-amd64), const SYS_GETRESUID = 360 +pkg syscall (freebsd-amd64), const SYS_GETRLIMIT = 194 +pkg syscall (freebsd-amd64), const SYS_GETRUSAGE = 117 +pkg syscall (freebsd-amd64), const SYS_GETSID = 310 +pkg syscall (freebsd-amd64), const SYS_GETSOCKNAME = 32 +pkg syscall (freebsd-amd64), const SYS_GETSOCKOPT = 118 +pkg syscall (freebsd-amd64), const SYS_GETTIMEOFDAY = 116 +pkg syscall (freebsd-amd64), const SYS_GETUID = 24 +pkg syscall (freebsd-amd64), const SYS_IOCTL = 54 +pkg syscall (freebsd-amd64), const SYS_ISSETUGID = 253 +pkg syscall (freebsd-amd64), const SYS_JAIL = 338 +pkg syscall (freebsd-amd64), const SYS_JAIL_ATTACH = 436 +pkg syscall (freebsd-amd64), const SYS_JAIL_GET = 506 +pkg syscall (freebsd-amd64), const SYS_JAIL_REMOVE = 508 +pkg syscall (freebsd-amd64), const SYS_JAIL_SET = 507 +pkg syscall (freebsd-amd64), const SYS_KENV = 390 +pkg syscall (freebsd-amd64), const SYS_KEVENT = 363 +pkg syscall (freebsd-amd64), const SYS_KILL = 37 +pkg syscall (freebsd-amd64), const SYS_KLDFIND = 306 +pkg syscall (freebsd-amd64), const SYS_KLDFIRSTMOD = 309 +pkg syscall (freebsd-amd64), const SYS_KLDLOAD = 304 +pkg syscall (freebsd-amd64), const SYS_KLDNEXT = 307 +pkg syscall (freebsd-amd64), const SYS_KLDSTAT = 308 +pkg syscall (freebsd-amd64), const SYS_KLDSYM = 337 +pkg syscall (freebsd-amd64), const SYS_KLDUNLOAD = 305 +pkg syscall (freebsd-amd64), const SYS_KLDUNLOADF = 444 +pkg syscall (freebsd-amd64), const SYS_KQUEUE = 362 +pkg syscall (freebsd-amd64), const SYS_KTIMER_CREATE = 235 +pkg syscall (freebsd-amd64), const SYS_KTIMER_DELETE = 236 +pkg syscall (freebsd-amd64), const SYS_KTIMER_GETOVERRUN = 239 +pkg syscall (freebsd-amd64), const SYS_KTIMER_GETTIME = 238 +pkg syscall (freebsd-amd64), const SYS_KTIMER_SETTIME = 237 +pkg syscall (freebsd-amd64), const SYS_KTRACE = 45 +pkg syscall (freebsd-amd64), const SYS_LCHFLAGS = 391 +pkg syscall (freebsd-amd64), const SYS_LCHMOD = 274 +pkg syscall (freebsd-amd64), const SYS_LCHOWN = 254 +pkg syscall (freebsd-amd64), const SYS_LGETFH = 160 +pkg syscall (freebsd-amd64), const SYS_LINK = 9 +pkg syscall (freebsd-amd64), const SYS_LINKAT = 495 +pkg syscall (freebsd-amd64), const SYS_LISTEN = 106 +pkg syscall (freebsd-amd64), const SYS_LPATHCONF = 513 +pkg syscall (freebsd-amd64), const SYS_LSEEK = 478 +pkg syscall (freebsd-amd64), const SYS_LSTAT = 190 +pkg syscall (freebsd-amd64), const SYS_LUTIMES = 276 +pkg syscall (freebsd-amd64), const SYS_MAC_SYSCALL = 394 +pkg syscall (freebsd-amd64), const SYS_MADVISE = 75 +pkg syscall (freebsd-amd64), const SYS_MINCORE = 78 +pkg syscall (freebsd-amd64), const SYS_MINHERIT = 250 +pkg syscall (freebsd-amd64), const SYS_MKDIR = 136 +pkg syscall (freebsd-amd64), const SYS_MKDIRAT = 496 +pkg syscall (freebsd-amd64), const SYS_MKFIFO = 132 +pkg syscall (freebsd-amd64), const SYS_MKFIFOAT = 497 +pkg syscall (freebsd-amd64), const SYS_MKNOD = 14 +pkg syscall (freebsd-amd64), const SYS_MKNODAT = 498 +pkg syscall (freebsd-amd64), const SYS_MLOCK = 203 +pkg syscall (freebsd-amd64), const SYS_MLOCKALL = 324 +pkg syscall (freebsd-amd64), const SYS_MMAP = 477 +pkg syscall (freebsd-amd64), const SYS_MODFIND = 303 +pkg syscall (freebsd-amd64), const SYS_MODFNEXT = 302 +pkg syscall (freebsd-amd64), const SYS_MODNEXT = 300 +pkg syscall (freebsd-amd64), const SYS_MODSTAT = 301 +pkg syscall (freebsd-amd64), const SYS_MOUNT = 21 +pkg syscall (freebsd-amd64), const SYS_MPROTECT = 74 +pkg syscall (freebsd-amd64), const SYS_MSYNC = 65 +pkg syscall (freebsd-amd64), const SYS_MUNLOCK = 204 +pkg syscall (freebsd-amd64), const SYS_MUNLOCKALL = 325 +pkg syscall (freebsd-amd64), const SYS_MUNMAP = 73 +pkg syscall (freebsd-amd64), const SYS_NANOSLEEP = 240 +pkg syscall (freebsd-amd64), const SYS_NFSTAT = 279 +pkg syscall (freebsd-amd64), const SYS_NLSTAT = 280 +pkg syscall (freebsd-amd64), const SYS_NMOUNT = 378 +pkg syscall (freebsd-amd64), const SYS_NSTAT = 278 +pkg syscall (freebsd-amd64), const SYS_NTP_ADJTIME = 176 +pkg syscall (freebsd-amd64), const SYS_NTP_GETTIME = 248 +pkg syscall (freebsd-amd64), const SYS_OBREAK = 17 +pkg syscall (freebsd-amd64), const SYS_OPEN = 5 +pkg syscall (freebsd-amd64), const SYS_OPENAT = 499 +pkg syscall (freebsd-amd64), const SYS_OPENBSD_POLL = 252 +pkg syscall (freebsd-amd64), const SYS_OVADVISE = 72 +pkg syscall (freebsd-amd64), const SYS_PATHCONF = 191 +pkg syscall (freebsd-amd64), const SYS_PDFORK = 518 +pkg syscall (freebsd-amd64), const SYS_PDGETPID = 520 +pkg syscall (freebsd-amd64), const SYS_PDKILL = 519 +pkg syscall (freebsd-amd64), const SYS_PIPE = 42 +pkg syscall (freebsd-amd64), const SYS_POLL = 209 +pkg syscall (freebsd-amd64), const SYS_POSIX_FADVISE = 531 +pkg syscall (freebsd-amd64), const SYS_POSIX_FALLOCATE = 530 +pkg syscall (freebsd-amd64), const SYS_POSIX_OPENPT = 504 +pkg syscall (freebsd-amd64), const SYS_PREAD = 475 +pkg syscall (freebsd-amd64), const SYS_PREADV = 289 +pkg syscall (freebsd-amd64), const SYS_PROFIL = 44 +pkg syscall (freebsd-amd64), const SYS_PSELECT = 522 +pkg syscall (freebsd-amd64), const SYS_PTRACE = 26 +pkg syscall (freebsd-amd64), const SYS_PWRITE = 476 +pkg syscall (freebsd-amd64), const SYS_PWRITEV = 290 +pkg syscall (freebsd-amd64), const SYS_QUOTACTL = 148 +pkg syscall (freebsd-amd64), const SYS_RCTL_ADD_RULE = 528 +pkg syscall (freebsd-amd64), const SYS_RCTL_GET_LIMITS = 527 +pkg syscall (freebsd-amd64), const SYS_RCTL_GET_RACCT = 525 +pkg syscall (freebsd-amd64), const SYS_RCTL_GET_RULES = 526 +pkg syscall (freebsd-amd64), const SYS_RCTL_REMOVE_RULE = 529 +pkg syscall (freebsd-amd64), const SYS_READ = 3 +pkg syscall (freebsd-amd64), const SYS_READLINK = 58 +pkg syscall (freebsd-amd64), const SYS_READLINKAT = 500 +pkg syscall (freebsd-amd64), const SYS_READV = 120 +pkg syscall (freebsd-amd64), const SYS_REBOOT = 55 +pkg syscall (freebsd-amd64), const SYS_RECVFROM = 29 +pkg syscall (freebsd-amd64), const SYS_RECVMSG = 27 +pkg syscall (freebsd-amd64), const SYS_RENAME = 128 +pkg syscall (freebsd-amd64), const SYS_RENAMEAT = 501 +pkg syscall (freebsd-amd64), const SYS_REVOKE = 56 +pkg syscall (freebsd-amd64), const SYS_RFORK = 251 +pkg syscall (freebsd-amd64), const SYS_RMDIR = 137 +pkg syscall (freebsd-amd64), const SYS_RTPRIO = 166 +pkg syscall (freebsd-amd64), const SYS_RTPRIO_THREAD = 466 +pkg syscall (freebsd-amd64), const SYS_SBRK = 69 +pkg syscall (freebsd-amd64), const SYS_SCHED_GETPARAM = 328 +pkg syscall (freebsd-amd64), const SYS_SCHED_GETSCHEDULER = 330 +pkg syscall (freebsd-amd64), const SYS_SCHED_GET_PRIORITY_MAX = 332 +pkg syscall (freebsd-amd64), const SYS_SCHED_GET_PRIORITY_MIN = 333 +pkg syscall (freebsd-amd64), const SYS_SCHED_RR_GET_INTERVAL = 334 +pkg syscall (freebsd-amd64), const SYS_SCHED_SETPARAM = 327 +pkg syscall (freebsd-amd64), const SYS_SCHED_SETSCHEDULER = 329 +pkg syscall (freebsd-amd64), const SYS_SCHED_YIELD = 331 +pkg syscall (freebsd-amd64), const SYS_SCTP_GENERIC_RECVMSG = 474 +pkg syscall (freebsd-amd64), const SYS_SCTP_GENERIC_SENDMSG = 472 +pkg syscall (freebsd-amd64), const SYS_SCTP_GENERIC_SENDMSG_IOV = 473 +pkg syscall (freebsd-amd64), const SYS_SCTP_PEELOFF = 471 +pkg syscall (freebsd-amd64), const SYS_SELECT = 93 +pkg syscall (freebsd-amd64), const SYS_SENDFILE = 393 +pkg syscall (freebsd-amd64), const SYS_SENDMSG = 28 +pkg syscall (freebsd-amd64), const SYS_SENDTO = 133 +pkg syscall (freebsd-amd64), const SYS_SETAUDIT = 450 +pkg syscall (freebsd-amd64), const SYS_SETAUDIT_ADDR = 452 +pkg syscall (freebsd-amd64), const SYS_SETAUID = 448 +pkg syscall (freebsd-amd64), const SYS_SETCONTEXT = 422 +pkg syscall (freebsd-amd64), const SYS_SETEGID = 182 +pkg syscall (freebsd-amd64), const SYS_SETEUID = 183 +pkg syscall (freebsd-amd64), const SYS_SETFIB = 175 +pkg syscall (freebsd-amd64), const SYS_SETGID = 181 +pkg syscall (freebsd-amd64), const SYS_SETGROUPS = 80 +pkg syscall (freebsd-amd64), const SYS_SETITIMER = 83 +pkg syscall (freebsd-amd64), const SYS_SETLOGIN = 50 +pkg syscall (freebsd-amd64), const SYS_SETLOGINCLASS = 524 +pkg syscall (freebsd-amd64), const SYS_SETPGID = 82 +pkg syscall (freebsd-amd64), const SYS_SETPRIORITY = 96 +pkg syscall (freebsd-amd64), const SYS_SETREGID = 127 +pkg syscall (freebsd-amd64), const SYS_SETRESGID = 312 +pkg syscall (freebsd-amd64), const SYS_SETRESUID = 311 +pkg syscall (freebsd-amd64), const SYS_SETREUID = 126 +pkg syscall (freebsd-amd64), const SYS_SETRLIMIT = 195 +pkg syscall (freebsd-amd64), const SYS_SETSID = 147 +pkg syscall (freebsd-amd64), const SYS_SETSOCKOPT = 105 +pkg syscall (freebsd-amd64), const SYS_SETTIMEOFDAY = 122 +pkg syscall (freebsd-amd64), const SYS_SETUID = 23 +pkg syscall (freebsd-amd64), const SYS_SHM_OPEN = 482 +pkg syscall (freebsd-amd64), const SYS_SHM_UNLINK = 483 +pkg syscall (freebsd-amd64), const SYS_SHUTDOWN = 134 +pkg syscall (freebsd-amd64), const SYS_SIGACTION = 416 +pkg syscall (freebsd-amd64), const SYS_SIGALTSTACK = 53 +pkg syscall (freebsd-amd64), const SYS_SIGPENDING = 343 +pkg syscall (freebsd-amd64), const SYS_SIGPROCMASK = 340 +pkg syscall (freebsd-amd64), const SYS_SIGQUEUE = 456 +pkg syscall (freebsd-amd64), const SYS_SIGRETURN = 417 +pkg syscall (freebsd-amd64), const SYS_SIGSUSPEND = 341 +pkg syscall (freebsd-amd64), const SYS_SIGTIMEDWAIT = 345 +pkg syscall (freebsd-amd64), const SYS_SIGWAIT = 429 +pkg syscall (freebsd-amd64), const SYS_SIGWAITINFO = 346 +pkg syscall (freebsd-amd64), const SYS_SOCKET = 97 +pkg syscall (freebsd-amd64), const SYS_SOCKETPAIR = 135 +pkg syscall (freebsd-amd64), const SYS_SSTK = 70 +pkg syscall (freebsd-amd64), const SYS_STAT = 188 +pkg syscall (freebsd-amd64), const SYS_STATFS = 396 +pkg syscall (freebsd-amd64), const SYS_SWAPCONTEXT = 423 +pkg syscall (freebsd-amd64), const SYS_SWAPOFF = 424 +pkg syscall (freebsd-amd64), const SYS_SWAPON = 85 +pkg syscall (freebsd-amd64), const SYS_SYMLINK = 57 +pkg syscall (freebsd-amd64), const SYS_SYMLINKAT = 502 +pkg syscall (freebsd-amd64), const SYS_SYNC = 36 +pkg syscall (freebsd-amd64), const SYS_SYSARCH = 165 +pkg syscall (freebsd-amd64), const SYS_THR_CREATE = 430 +pkg syscall (freebsd-amd64), const SYS_THR_EXIT = 431 +pkg syscall (freebsd-amd64), const SYS_THR_KILL = 433 +pkg syscall (freebsd-amd64), const SYS_THR_KILL2 = 481 +pkg syscall (freebsd-amd64), const SYS_THR_NEW = 455 +pkg syscall (freebsd-amd64), const SYS_THR_SELF = 432 +pkg syscall (freebsd-amd64), const SYS_THR_SET_NAME = 464 +pkg syscall (freebsd-amd64), const SYS_THR_SUSPEND = 442 +pkg syscall (freebsd-amd64), const SYS_THR_WAKE = 443 +pkg syscall (freebsd-amd64), const SYS_TRUNCATE = 479 +pkg syscall (freebsd-amd64), const SYS_UMASK = 60 +pkg syscall (freebsd-amd64), const SYS_UNDELETE = 205 +pkg syscall (freebsd-amd64), const SYS_UNLINK = 10 +pkg syscall (freebsd-amd64), const SYS_UNLINKAT = 503 +pkg syscall (freebsd-amd64), const SYS_UNMOUNT = 22 +pkg syscall (freebsd-amd64), const SYS_UTIMES = 138 +pkg syscall (freebsd-amd64), const SYS_UTRACE = 335 +pkg syscall (freebsd-amd64), const SYS_UUIDGEN = 392 +pkg syscall (freebsd-amd64), const SYS_VFORK = 66 +pkg syscall (freebsd-amd64), const SYS_WAIT4 = 7 +pkg syscall (freebsd-amd64), const SYS_WAIT6 = 532 +pkg syscall (freebsd-amd64), const SYS_WAIT6 ideal-int +pkg syscall (freebsd-amd64), const SYS_WRITE = 4 +pkg syscall (freebsd-amd64), const SYS_WRITEV = 121 +pkg syscall (freebsd-amd64), const SYS_YIELD = 321 +pkg syscall (freebsd-amd64), const SYS__UMTX_LOCK = 434 +pkg syscall (freebsd-amd64), const SYS__UMTX_OP = 454 +pkg syscall (freebsd-amd64), const SYS__UMTX_UNLOCK = 435 +pkg syscall (freebsd-amd64), const SYS___ACL_ACLCHECK_FD = 354 +pkg syscall (freebsd-amd64), const SYS___ACL_ACLCHECK_FILE = 353 +pkg syscall (freebsd-amd64), const SYS___ACL_ACLCHECK_LINK = 428 +pkg syscall (freebsd-amd64), const SYS___ACL_DELETE_FD = 352 +pkg syscall (freebsd-amd64), const SYS___ACL_DELETE_FILE = 351 +pkg syscall (freebsd-amd64), const SYS___ACL_DELETE_LINK = 427 +pkg syscall (freebsd-amd64), const SYS___ACL_GET_FD = 349 +pkg syscall (freebsd-amd64), const SYS___ACL_GET_FILE = 347 +pkg syscall (freebsd-amd64), const SYS___ACL_GET_LINK = 425 +pkg syscall (freebsd-amd64), const SYS___ACL_SET_FD = 350 +pkg syscall (freebsd-amd64), const SYS___ACL_SET_FILE = 348 +pkg syscall (freebsd-amd64), const SYS___ACL_SET_LINK = 426 +pkg syscall (freebsd-amd64), const SYS___GETCWD = 326 +pkg syscall (freebsd-amd64), const SYS___MAC_EXECVE = 415 +pkg syscall (freebsd-amd64), const SYS___MAC_GET_FD = 386 +pkg syscall (freebsd-amd64), const SYS___MAC_GET_FILE = 387 +pkg syscall (freebsd-amd64), const SYS___MAC_GET_LINK = 410 +pkg syscall (freebsd-amd64), const SYS___MAC_GET_PID = 409 +pkg syscall (freebsd-amd64), const SYS___MAC_GET_PROC = 384 +pkg syscall (freebsd-amd64), const SYS___MAC_SET_FD = 388 +pkg syscall (freebsd-amd64), const SYS___MAC_SET_FILE = 389 +pkg syscall (freebsd-amd64), const SYS___MAC_SET_LINK = 411 +pkg syscall (freebsd-amd64), const SYS___MAC_SET_PROC = 385 +pkg syscall (freebsd-amd64), const SYS___SETUGID = 374 +pkg syscall (freebsd-amd64), const SYS___SYSCTL = 202 +pkg syscall (freebsd-amd64), const S_IFMT = 61440 +pkg syscall (freebsd-amd64), const SizeofBpfHdr = 32 +pkg syscall (freebsd-amd64), const SizeofBpfInsn = 8 +pkg syscall (freebsd-amd64), const SizeofBpfProgram = 16 +pkg syscall (freebsd-amd64), const SizeofBpfStat = 8 +pkg syscall (freebsd-amd64), const SizeofBpfVersion = 4 +pkg syscall (freebsd-amd64), const SizeofBpfZbuf = 24 +pkg syscall (freebsd-amd64), const SizeofBpfZbufHeader = 32 +pkg syscall (freebsd-amd64), const SizeofCmsghdr = 12 +pkg syscall (freebsd-amd64), const SizeofIPMreq = 8 +pkg syscall (freebsd-amd64), const SizeofIPMreqn = 12 +pkg syscall (freebsd-amd64), const SizeofIPv6Mreq = 20 +pkg syscall (freebsd-amd64), const SizeofIfAnnounceMsghdr = 24 +pkg syscall (freebsd-amd64), const SizeofIfAnnounceMsghdr ideal-int +pkg syscall (freebsd-amd64), const SizeofIfData = 152 +pkg syscall (freebsd-amd64), const SizeofIfMsghdr = 168 +pkg syscall (freebsd-amd64), const SizeofIfaMsghdr = 20 +pkg syscall (freebsd-amd64), const SizeofIfmaMsghdr = 16 +pkg syscall (freebsd-amd64), const SizeofInet6Pktinfo = 20 +pkg syscall (freebsd-amd64), const SizeofLinger = 8 +pkg syscall (freebsd-amd64), const SizeofMsghdr = 48 +pkg syscall (freebsd-amd64), const SizeofRtMetrics = 112 +pkg syscall (freebsd-amd64), const SizeofRtMsghdr = 152 +pkg syscall (freebsd-amd64), const SizeofSockaddrAny = 108 +pkg syscall (freebsd-amd64), const SizeofSockaddrDatalink = 54 +pkg syscall (freebsd-amd64), const SizeofSockaddrInet4 = 16 +pkg syscall (freebsd-amd64), const SizeofSockaddrInet6 = 28 +pkg syscall (freebsd-amd64), const SizeofSockaddrUnix = 106 +pkg syscall (freebsd-amd64), const TCIFLUSH = 1 +pkg syscall (freebsd-amd64), const TCIFLUSH ideal-int +pkg syscall (freebsd-amd64), const TCIOFLUSH = 3 +pkg syscall (freebsd-amd64), const TCIOFLUSH ideal-int +pkg syscall (freebsd-amd64), const TCOFLUSH = 2 +pkg syscall (freebsd-amd64), const TCOFLUSH ideal-int +pkg syscall (freebsd-amd64), const TCP_CA_NAME_MAX = 16 +pkg syscall (freebsd-amd64), const TCP_CONGESTION = 64 +pkg syscall (freebsd-amd64), const TCP_INFO = 32 +pkg syscall (freebsd-amd64), const TCP_KEEPCNT = 1024 +pkg syscall (freebsd-amd64), const TCP_KEEPCNT ideal-int +pkg syscall (freebsd-amd64), const TCP_KEEPIDLE = 256 +pkg syscall (freebsd-amd64), const TCP_KEEPIDLE ideal-int +pkg syscall (freebsd-amd64), const TCP_KEEPINIT = 128 +pkg syscall (freebsd-amd64), const TCP_KEEPINIT ideal-int +pkg syscall (freebsd-amd64), const TCP_KEEPINTVL = 512 +pkg syscall (freebsd-amd64), const TCP_KEEPINTVL ideal-int +pkg syscall (freebsd-amd64), const TCP_MAXBURST = 4 +pkg syscall (freebsd-amd64), const TCP_MAXHLEN = 60 +pkg syscall (freebsd-amd64), const TCP_MAXOLEN = 40 +pkg syscall (freebsd-amd64), const TCP_MAXSEG = 2 +pkg syscall (freebsd-amd64), const TCP_MAXWIN = 65535 +pkg syscall (freebsd-amd64), const TCP_MAX_SACK = 4 +pkg syscall (freebsd-amd64), const TCP_MAX_WINSHIFT = 14 +pkg syscall (freebsd-amd64), const TCP_MD5SIG = 16 +pkg syscall (freebsd-amd64), const TCP_MINMSS = 216 +pkg syscall (freebsd-amd64), const TCP_MSS = 536 +pkg syscall (freebsd-amd64), const TCP_NOOPT = 8 +pkg syscall (freebsd-amd64), const TCP_NOPUSH = 4 +pkg syscall (freebsd-amd64), const TCSAFLUSH = 2 +pkg syscall (freebsd-amd64), const TCSAFLUSH ideal-int +pkg syscall (freebsd-amd64), const TIOCCBRK = 536900730 +pkg syscall (freebsd-amd64), const TIOCCDTR = 536900728 +pkg syscall (freebsd-amd64), const TIOCCONS = 2147775586 +pkg syscall (freebsd-amd64), const TIOCDRAIN = 536900702 +pkg syscall (freebsd-amd64), const TIOCEXCL = 536900621 +pkg syscall (freebsd-amd64), const TIOCEXT = 2147775584 +pkg syscall (freebsd-amd64), const TIOCFLUSH = 2147775504 +pkg syscall (freebsd-amd64), const TIOCGDRAINWAIT = 1074033750 +pkg syscall (freebsd-amd64), const TIOCGETA = 1076655123 +pkg syscall (freebsd-amd64), const TIOCGETD = 1074033690 +pkg syscall (freebsd-amd64), const TIOCGPGRP = 1074033783 +pkg syscall (freebsd-amd64), const TIOCGPTN = 1074033679 +pkg syscall (freebsd-amd64), const TIOCGSID = 1074033763 +pkg syscall (freebsd-amd64), const TIOCGWINSZ = 1074295912 +pkg syscall (freebsd-amd64), const TIOCMBIC = 2147775595 +pkg syscall (freebsd-amd64), const TIOCMBIS = 2147775596 +pkg syscall (freebsd-amd64), const TIOCMGDTRWAIT = 1074033754 +pkg syscall (freebsd-amd64), const TIOCMGET = 1074033770 +pkg syscall (freebsd-amd64), const TIOCMSDTRWAIT = 2147775579 +pkg syscall (freebsd-amd64), const TIOCMSET = 2147775597 +pkg syscall (freebsd-amd64), const TIOCM_CAR = 64 +pkg syscall (freebsd-amd64), const TIOCM_CD = 64 +pkg syscall (freebsd-amd64), const TIOCM_CTS = 32 +pkg syscall (freebsd-amd64), const TIOCM_DCD = 64 +pkg syscall (freebsd-amd64), const TIOCM_DSR = 256 +pkg syscall (freebsd-amd64), const TIOCM_DTR = 2 +pkg syscall (freebsd-amd64), const TIOCM_LE = 1 +pkg syscall (freebsd-amd64), const TIOCM_RI = 128 +pkg syscall (freebsd-amd64), const TIOCM_RNG = 128 +pkg syscall (freebsd-amd64), const TIOCM_RTS = 4 +pkg syscall (freebsd-amd64), const TIOCM_SR = 16 +pkg syscall (freebsd-amd64), const TIOCM_ST = 8 +pkg syscall (freebsd-amd64), const TIOCNOTTY = 536900721 +pkg syscall (freebsd-amd64), const TIOCNXCL = 536900622 +pkg syscall (freebsd-amd64), const TIOCOUTQ = 1074033779 +pkg syscall (freebsd-amd64), const TIOCPKT = 2147775600 +pkg syscall (freebsd-amd64), const TIOCPKT_DATA = 0 +pkg syscall (freebsd-amd64), const TIOCPKT_DOSTOP = 32 +pkg syscall (freebsd-amd64), const TIOCPKT_FLUSHREAD = 1 +pkg syscall (freebsd-amd64), const TIOCPKT_FLUSHWRITE = 2 +pkg syscall (freebsd-amd64), const TIOCPKT_IOCTL = 64 +pkg syscall (freebsd-amd64), const TIOCPKT_NOSTOP = 16 +pkg syscall (freebsd-amd64), const TIOCPKT_START = 8 +pkg syscall (freebsd-amd64), const TIOCPKT_STOP = 4 +pkg syscall (freebsd-amd64), const TIOCPTMASTER = 536900636 +pkg syscall (freebsd-amd64), const TIOCSBRK = 536900731 +pkg syscall (freebsd-amd64), const TIOCSCTTY = 536900705 +pkg syscall (freebsd-amd64), const TIOCSDRAINWAIT = 2147775575 +pkg syscall (freebsd-amd64), const TIOCSDTR = 536900729 +pkg syscall (freebsd-amd64), const TIOCSETA = 2150396948 +pkg syscall (freebsd-amd64), const TIOCSETAF = 2150396950 +pkg syscall (freebsd-amd64), const TIOCSETAW = 2150396949 +pkg syscall (freebsd-amd64), const TIOCSETD = 2147775515 +pkg syscall (freebsd-amd64), const TIOCSIG = 537162847 +pkg syscall (freebsd-amd64), const TIOCSPGRP = 2147775606 +pkg syscall (freebsd-amd64), const TIOCSTART = 536900718 +pkg syscall (freebsd-amd64), const TIOCSTAT = 536900709 +pkg syscall (freebsd-amd64), const TIOCSTI = 2147578994 +pkg syscall (freebsd-amd64), const TIOCSTOP = 536900719 +pkg syscall (freebsd-amd64), const TIOCSWINSZ = 2148037735 +pkg syscall (freebsd-amd64), const TIOCTIMESTAMP = 1074820185 +pkg syscall (freebsd-amd64), const TIOCUCNTL = 2147775590 +pkg syscall (freebsd-amd64), const TOSTOP = 4194304 +pkg syscall (freebsd-amd64), const TOSTOP ideal-int +pkg syscall (freebsd-amd64), const VDISCARD = 15 +pkg syscall (freebsd-amd64), const VDISCARD ideal-int +pkg syscall (freebsd-amd64), const VDSUSP = 11 +pkg syscall (freebsd-amd64), const VDSUSP ideal-int +pkg syscall (freebsd-amd64), const VEOF = 0 +pkg syscall (freebsd-amd64), const VEOF ideal-int +pkg syscall (freebsd-amd64), const VEOL = 1 +pkg syscall (freebsd-amd64), const VEOL ideal-int +pkg syscall (freebsd-amd64), const VEOL2 = 2 +pkg syscall (freebsd-amd64), const VEOL2 ideal-int +pkg syscall (freebsd-amd64), const VERASE = 3 +pkg syscall (freebsd-amd64), const VERASE ideal-int +pkg syscall (freebsd-amd64), const VERASE2 = 7 +pkg syscall (freebsd-amd64), const VERASE2 ideal-int +pkg syscall (freebsd-amd64), const VINTR = 8 +pkg syscall (freebsd-amd64), const VINTR ideal-int +pkg syscall (freebsd-amd64), const VKILL = 5 +pkg syscall (freebsd-amd64), const VKILL ideal-int +pkg syscall (freebsd-amd64), const VLNEXT = 14 +pkg syscall (freebsd-amd64), const VLNEXT ideal-int +pkg syscall (freebsd-amd64), const VMIN = 16 +pkg syscall (freebsd-amd64), const VMIN ideal-int +pkg syscall (freebsd-amd64), const VQUIT = 9 +pkg syscall (freebsd-amd64), const VQUIT ideal-int +pkg syscall (freebsd-amd64), const VREPRINT = 6 +pkg syscall (freebsd-amd64), const VREPRINT ideal-int +pkg syscall (freebsd-amd64), const VSTART = 12 +pkg syscall (freebsd-amd64), const VSTART ideal-int +pkg syscall (freebsd-amd64), const VSTATUS = 18 +pkg syscall (freebsd-amd64), const VSTATUS ideal-int +pkg syscall (freebsd-amd64), const VSTOP = 13 +pkg syscall (freebsd-amd64), const VSTOP ideal-int +pkg syscall (freebsd-amd64), const VSUSP = 10 +pkg syscall (freebsd-amd64), const VSUSP ideal-int +pkg syscall (freebsd-amd64), const VTIME = 17 +pkg syscall (freebsd-amd64), const VTIME ideal-int +pkg syscall (freebsd-amd64), const VWERASE = 4 +pkg syscall (freebsd-amd64), const VWERASE ideal-int +pkg syscall (freebsd-amd64), const WCONTINUED = 4 +pkg syscall (freebsd-amd64), const WCOREFLAG = 128 +pkg syscall (freebsd-amd64), const WLINUXCLONE = 2147483648 +pkg syscall (freebsd-amd64), const WNOHANG = 1 +pkg syscall (freebsd-amd64), const WNOWAIT = 8 +pkg syscall (freebsd-amd64), const WSTOPPED = 2 +pkg syscall (freebsd-amd64), const WUNTRACED = 2 +pkg syscall (freebsd-amd64), func Fchflags(int, int) error +pkg syscall (freebsd-amd64), func SlicePtrFromStrings([]string) ([]*uint8, error) +pkg syscall (freebsd-amd64), func Syscall9(uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno) +pkg syscall (freebsd-amd64), type IfAnnounceMsghdr struct +pkg syscall (freebsd-amd64), type IfAnnounceMsghdr struct, Index uint16 +pkg syscall (freebsd-amd64), type IfAnnounceMsghdr struct, Msglen uint16 +pkg syscall (freebsd-amd64), type IfAnnounceMsghdr struct, Name [16]int8 +pkg syscall (freebsd-amd64), type IfAnnounceMsghdr struct, Type uint8 +pkg syscall (freebsd-amd64), type IfAnnounceMsghdr struct, Version uint8 +pkg syscall (freebsd-amd64), type IfAnnounceMsghdr struct, What uint16 +pkg syscall (freebsd-amd64), type InterfaceAnnounceMessage struct +pkg syscall (freebsd-amd64), type InterfaceAnnounceMessage struct, Header IfAnnounceMsghdr +pkg syscall (freebsd-amd64-cgo), const AF_APPLETALK = 16 +pkg syscall (freebsd-amd64-cgo), const AF_ARP = 35 +pkg syscall (freebsd-amd64-cgo), const AF_ATM = 30 +pkg syscall (freebsd-amd64-cgo), const AF_BLUETOOTH = 36 +pkg syscall (freebsd-amd64-cgo), const AF_CCITT = 10 +pkg syscall (freebsd-amd64-cgo), const AF_CHAOS = 5 +pkg syscall (freebsd-amd64-cgo), const AF_CNT = 21 +pkg syscall (freebsd-amd64-cgo), const AF_COIP = 20 +pkg syscall (freebsd-amd64-cgo), const AF_DATAKIT = 9 +pkg syscall (freebsd-amd64-cgo), const AF_DECnet = 12 +pkg syscall (freebsd-amd64-cgo), const AF_DLI = 13 +pkg syscall (freebsd-amd64-cgo), const AF_E164 = 26 +pkg syscall (freebsd-amd64-cgo), const AF_ECMA = 8 +pkg syscall (freebsd-amd64-cgo), const AF_HYLINK = 15 +pkg syscall (freebsd-amd64-cgo), const AF_IEEE80211 = 37 +pkg syscall (freebsd-amd64-cgo), const AF_IMPLINK = 3 +pkg syscall (freebsd-amd64-cgo), const AF_INET6 = 28 +pkg syscall (freebsd-amd64-cgo), const AF_IPX = 23 +pkg syscall (freebsd-amd64-cgo), const AF_ISDN = 26 +pkg syscall (freebsd-amd64-cgo), const AF_ISO = 7 +pkg syscall (freebsd-amd64-cgo), const AF_LAT = 14 +pkg syscall (freebsd-amd64-cgo), const AF_LINK = 18 +pkg syscall (freebsd-amd64-cgo), const AF_LOCAL = 1 +pkg syscall (freebsd-amd64-cgo), const AF_MAX = 38 +pkg syscall (freebsd-amd64-cgo), const AF_NATM = 29 +pkg syscall (freebsd-amd64-cgo), const AF_NETBIOS = 6 +pkg syscall (freebsd-amd64-cgo), const AF_NETGRAPH = 32 +pkg syscall (freebsd-amd64-cgo), const AF_OSI = 7 +pkg syscall (freebsd-amd64-cgo), const AF_PUP = 4 +pkg syscall (freebsd-amd64-cgo), const AF_ROUTE = 17 +pkg syscall (freebsd-amd64-cgo), const AF_SCLUSTER = 34 +pkg syscall (freebsd-amd64-cgo), const AF_SIP = 24 +pkg syscall (freebsd-amd64-cgo), const AF_SLOW = 33 +pkg syscall (freebsd-amd64-cgo), const AF_SNA = 11 +pkg syscall (freebsd-amd64-cgo), const AF_VENDOR00 = 39 +pkg syscall (freebsd-amd64-cgo), const AF_VENDOR01 = 41 +pkg syscall (freebsd-amd64-cgo), const AF_VENDOR02 = 43 +pkg syscall (freebsd-amd64-cgo), const AF_VENDOR03 = 45 +pkg syscall (freebsd-amd64-cgo), const AF_VENDOR04 = 47 +pkg syscall (freebsd-amd64-cgo), const AF_VENDOR05 = 49 +pkg syscall (freebsd-amd64-cgo), const AF_VENDOR06 = 51 +pkg syscall (freebsd-amd64-cgo), const AF_VENDOR07 = 53 +pkg syscall (freebsd-amd64-cgo), const AF_VENDOR08 = 55 +pkg syscall (freebsd-amd64-cgo), const AF_VENDOR09 = 57 +pkg syscall (freebsd-amd64-cgo), const AF_VENDOR10 = 59 +pkg syscall (freebsd-amd64-cgo), const AF_VENDOR11 = 61 +pkg syscall (freebsd-amd64-cgo), const AF_VENDOR12 = 63 +pkg syscall (freebsd-amd64-cgo), const AF_VENDOR13 = 65 +pkg syscall (freebsd-amd64-cgo), const AF_VENDOR14 = 67 +pkg syscall (freebsd-amd64-cgo), const AF_VENDOR15 = 69 +pkg syscall (freebsd-amd64-cgo), const AF_VENDOR16 = 71 +pkg syscall (freebsd-amd64-cgo), const AF_VENDOR17 = 73 +pkg syscall (freebsd-amd64-cgo), const AF_VENDOR18 = 75 +pkg syscall (freebsd-amd64-cgo), const AF_VENDOR19 = 77 +pkg syscall (freebsd-amd64-cgo), const AF_VENDOR20 = 79 +pkg syscall (freebsd-amd64-cgo), const AF_VENDOR21 = 81 +pkg syscall (freebsd-amd64-cgo), const AF_VENDOR22 = 83 +pkg syscall (freebsd-amd64-cgo), const AF_VENDOR23 = 85 +pkg syscall (freebsd-amd64-cgo), const AF_VENDOR24 = 87 +pkg syscall (freebsd-amd64-cgo), const AF_VENDOR25 = 89 +pkg syscall (freebsd-amd64-cgo), const AF_VENDOR26 = 91 +pkg syscall (freebsd-amd64-cgo), const AF_VENDOR27 = 93 +pkg syscall (freebsd-amd64-cgo), const AF_VENDOR28 = 95 +pkg syscall (freebsd-amd64-cgo), const AF_VENDOR29 = 97 +pkg syscall (freebsd-amd64-cgo), const AF_VENDOR30 = 99 +pkg syscall (freebsd-amd64-cgo), const AF_VENDOR31 = 101 +pkg syscall (freebsd-amd64-cgo), const AF_VENDOR32 = 103 +pkg syscall (freebsd-amd64-cgo), const AF_VENDOR33 = 105 +pkg syscall (freebsd-amd64-cgo), const AF_VENDOR34 = 107 +pkg syscall (freebsd-amd64-cgo), const AF_VENDOR35 = 109 +pkg syscall (freebsd-amd64-cgo), const AF_VENDOR36 = 111 +pkg syscall (freebsd-amd64-cgo), const AF_VENDOR37 = 113 +pkg syscall (freebsd-amd64-cgo), const AF_VENDOR38 = 115 +pkg syscall (freebsd-amd64-cgo), const AF_VENDOR39 = 117 +pkg syscall (freebsd-amd64-cgo), const AF_VENDOR40 = 119 +pkg syscall (freebsd-amd64-cgo), const AF_VENDOR41 = 121 +pkg syscall (freebsd-amd64-cgo), const AF_VENDOR42 = 123 +pkg syscall (freebsd-amd64-cgo), const AF_VENDOR43 = 125 +pkg syscall (freebsd-amd64-cgo), const AF_VENDOR44 = 127 +pkg syscall (freebsd-amd64-cgo), const AF_VENDOR45 = 129 +pkg syscall (freebsd-amd64-cgo), const AF_VENDOR46 = 131 +pkg syscall (freebsd-amd64-cgo), const AF_VENDOR47 = 133 +pkg syscall (freebsd-amd64-cgo), const B0 = 0 +pkg syscall (freebsd-amd64-cgo), const B110 = 110 +pkg syscall (freebsd-amd64-cgo), const B115200 = 115200 +pkg syscall (freebsd-amd64-cgo), const B1200 = 1200 +pkg syscall (freebsd-amd64-cgo), const B134 = 134 +pkg syscall (freebsd-amd64-cgo), const B14400 = 14400 +pkg syscall (freebsd-amd64-cgo), const B150 = 150 +pkg syscall (freebsd-amd64-cgo), const B1800 = 1800 +pkg syscall (freebsd-amd64-cgo), const B19200 = 19200 +pkg syscall (freebsd-amd64-cgo), const B200 = 200 +pkg syscall (freebsd-amd64-cgo), const B230400 = 230400 +pkg syscall (freebsd-amd64-cgo), const B2400 = 2400 +pkg syscall (freebsd-amd64-cgo), const B28800 = 28800 +pkg syscall (freebsd-amd64-cgo), const B300 = 300 +pkg syscall (freebsd-amd64-cgo), const B38400 = 38400 +pkg syscall (freebsd-amd64-cgo), const B460800 = 460800 +pkg syscall (freebsd-amd64-cgo), const B4800 = 4800 +pkg syscall (freebsd-amd64-cgo), const B50 = 50 +pkg syscall (freebsd-amd64-cgo), const B57600 = 57600 +pkg syscall (freebsd-amd64-cgo), const B600 = 600 +pkg syscall (freebsd-amd64-cgo), const B7200 = 7200 +pkg syscall (freebsd-amd64-cgo), const B75 = 75 +pkg syscall (freebsd-amd64-cgo), const B76800 = 76800 +pkg syscall (freebsd-amd64-cgo), const B921600 = 921600 +pkg syscall (freebsd-amd64-cgo), const B9600 = 9600 +pkg syscall (freebsd-amd64-cgo), const BIOCFEEDBACK = 2147762812 +pkg syscall (freebsd-amd64-cgo), const BIOCFLUSH = 536887912 +pkg syscall (freebsd-amd64-cgo), const BIOCGBLEN = 1074020966 +pkg syscall (freebsd-amd64-cgo), const BIOCGDIRECTION = 1074020982 +pkg syscall (freebsd-amd64-cgo), const BIOCGDLT = 1074020970 +pkg syscall (freebsd-amd64-cgo), const BIOCGDLTLIST = 3222291065 +pkg syscall (freebsd-amd64-cgo), const BIOCGETBUFMODE = 1074020989 +pkg syscall (freebsd-amd64-cgo), const BIOCGETIF = 1075855979 +pkg syscall (freebsd-amd64-cgo), const BIOCGETZMAX = 1074283135 +pkg syscall (freebsd-amd64-cgo), const BIOCGHDRCMPLT = 1074020980 +pkg syscall (freebsd-amd64-cgo), const BIOCGRSIG = 1074020978 +pkg syscall (freebsd-amd64-cgo), const BIOCGRTIMEOUT = 1074807406 +pkg syscall (freebsd-amd64-cgo), const BIOCGSEESENT = 1074020982 +pkg syscall (freebsd-amd64-cgo), const BIOCGSTATS = 1074283119 +pkg syscall (freebsd-amd64-cgo), const BIOCGTSTAMP = 1074020995 +pkg syscall (freebsd-amd64-cgo), const BIOCIMMEDIATE = 2147762800 +pkg syscall (freebsd-amd64-cgo), const BIOCLOCK = 536887930 +pkg syscall (freebsd-amd64-cgo), const BIOCPROMISC = 536887913 +pkg syscall (freebsd-amd64-cgo), const BIOCROTZBUF = 1075331712 +pkg syscall (freebsd-amd64-cgo), const BIOCSBLEN = 3221504614 +pkg syscall (freebsd-amd64-cgo), const BIOCSDIRECTION = 2147762807 +pkg syscall (freebsd-amd64-cgo), const BIOCSDLT = 2147762808 +pkg syscall (freebsd-amd64-cgo), const BIOCSETBUFMODE = 2147762814 +pkg syscall (freebsd-amd64-cgo), const BIOCSETF = 2148549223 +pkg syscall (freebsd-amd64-cgo), const BIOCSETFNR = 2148549250 +pkg syscall (freebsd-amd64-cgo), const BIOCSETIF = 2149597804 +pkg syscall (freebsd-amd64-cgo), const BIOCSETWF = 2148549243 +pkg syscall (freebsd-amd64-cgo), const BIOCSETZBUF = 2149073537 +pkg syscall (freebsd-amd64-cgo), const BIOCSHDRCMPLT = 2147762805 +pkg syscall (freebsd-amd64-cgo), const BIOCSRSIG = 2147762803 +pkg syscall (freebsd-amd64-cgo), const BIOCSRTIMEOUT = 2148549229 +pkg syscall (freebsd-amd64-cgo), const BIOCSSEESENT = 2147762807 +pkg syscall (freebsd-amd64-cgo), const BIOCSTSTAMP = 2147762820 +pkg syscall (freebsd-amd64-cgo), const BIOCVERSION = 1074020977 +pkg syscall (freebsd-amd64-cgo), const BPF_A = 16 +pkg syscall (freebsd-amd64-cgo), const BPF_ABS = 32 +pkg syscall (freebsd-amd64-cgo), const BPF_ADD = 0 +pkg syscall (freebsd-amd64-cgo), const BPF_ALIGNMENT = 8 +pkg syscall (freebsd-amd64-cgo), const BPF_ALU = 4 +pkg syscall (freebsd-amd64-cgo), const BPF_AND = 80 +pkg syscall (freebsd-amd64-cgo), const BPF_B = 16 +pkg syscall (freebsd-amd64-cgo), const BPF_BUFMODE_BUFFER = 1 +pkg syscall (freebsd-amd64-cgo), const BPF_BUFMODE_ZBUF = 2 +pkg syscall (freebsd-amd64-cgo), const BPF_DIV = 48 +pkg syscall (freebsd-amd64-cgo), const BPF_H = 8 +pkg syscall (freebsd-amd64-cgo), const BPF_IMM = 0 +pkg syscall (freebsd-amd64-cgo), const BPF_IND = 64 +pkg syscall (freebsd-amd64-cgo), const BPF_JA = 0 +pkg syscall (freebsd-amd64-cgo), const BPF_JEQ = 16 +pkg syscall (freebsd-amd64-cgo), const BPF_JGE = 48 +pkg syscall (freebsd-amd64-cgo), const BPF_JGT = 32 +pkg syscall (freebsd-amd64-cgo), const BPF_JMP = 5 +pkg syscall (freebsd-amd64-cgo), const BPF_JSET = 64 +pkg syscall (freebsd-amd64-cgo), const BPF_K = 0 +pkg syscall (freebsd-amd64-cgo), const BPF_LD = 0 +pkg syscall (freebsd-amd64-cgo), const BPF_LDX = 1 +pkg syscall (freebsd-amd64-cgo), const BPF_LEN = 128 +pkg syscall (freebsd-amd64-cgo), const BPF_LSH = 96 +pkg syscall (freebsd-amd64-cgo), const BPF_MAJOR_VERSION = 1 +pkg syscall (freebsd-amd64-cgo), const BPF_MAXBUFSIZE = 524288 +pkg syscall (freebsd-amd64-cgo), const BPF_MAXINSNS = 512 +pkg syscall (freebsd-amd64-cgo), const BPF_MEM = 96 +pkg syscall (freebsd-amd64-cgo), const BPF_MEMWORDS = 16 +pkg syscall (freebsd-amd64-cgo), const BPF_MINBUFSIZE = 32 +pkg syscall (freebsd-amd64-cgo), const BPF_MINOR_VERSION = 1 +pkg syscall (freebsd-amd64-cgo), const BPF_MISC = 7 +pkg syscall (freebsd-amd64-cgo), const BPF_MSH = 160 +pkg syscall (freebsd-amd64-cgo), const BPF_MUL = 32 +pkg syscall (freebsd-amd64-cgo), const BPF_NEG = 128 +pkg syscall (freebsd-amd64-cgo), const BPF_OR = 64 +pkg syscall (freebsd-amd64-cgo), const BPF_RELEASE = 199606 +pkg syscall (freebsd-amd64-cgo), const BPF_RET = 6 +pkg syscall (freebsd-amd64-cgo), const BPF_RSH = 112 +pkg syscall (freebsd-amd64-cgo), const BPF_ST = 2 +pkg syscall (freebsd-amd64-cgo), const BPF_STX = 3 +pkg syscall (freebsd-amd64-cgo), const BPF_SUB = 16 +pkg syscall (freebsd-amd64-cgo), const BPF_TAX = 0 +pkg syscall (freebsd-amd64-cgo), const BPF_TXA = 128 +pkg syscall (freebsd-amd64-cgo), const BPF_T_BINTIME = 2 +pkg syscall (freebsd-amd64-cgo), const BPF_T_BINTIME_FAST = 258 +pkg syscall (freebsd-amd64-cgo), const BPF_T_BINTIME_MONOTONIC = 514 +pkg syscall (freebsd-amd64-cgo), const BPF_T_BINTIME_MONOTONIC_FAST = 770 +pkg syscall (freebsd-amd64-cgo), const BPF_T_FAST = 256 +pkg syscall (freebsd-amd64-cgo), const BPF_T_FLAG_MASK = 768 +pkg syscall (freebsd-amd64-cgo), const BPF_T_FORMAT_MASK = 3 +pkg syscall (freebsd-amd64-cgo), const BPF_T_MICROTIME = 0 +pkg syscall (freebsd-amd64-cgo), const BPF_T_MICROTIME_FAST = 256 +pkg syscall (freebsd-amd64-cgo), const BPF_T_MICROTIME_MONOTONIC = 512 +pkg syscall (freebsd-amd64-cgo), const BPF_T_MICROTIME_MONOTONIC_FAST = 768 +pkg syscall (freebsd-amd64-cgo), const BPF_T_MONOTONIC = 512 +pkg syscall (freebsd-amd64-cgo), const BPF_T_MONOTONIC_FAST = 768 +pkg syscall (freebsd-amd64-cgo), const BPF_T_NANOTIME = 1 +pkg syscall (freebsd-amd64-cgo), const BPF_T_NANOTIME_FAST = 257 +pkg syscall (freebsd-amd64-cgo), const BPF_T_NANOTIME_MONOTONIC = 513 +pkg syscall (freebsd-amd64-cgo), const BPF_T_NANOTIME_MONOTONIC_FAST = 769 +pkg syscall (freebsd-amd64-cgo), const BPF_T_NONE = 3 +pkg syscall (freebsd-amd64-cgo), const BPF_T_NORMAL = 0 +pkg syscall (freebsd-amd64-cgo), const BPF_W = 0 +pkg syscall (freebsd-amd64-cgo), const BPF_X = 8 +pkg syscall (freebsd-amd64-cgo), const BRKINT = 2 +pkg syscall (freebsd-amd64-cgo), const CFLUSH = 15 +pkg syscall (freebsd-amd64-cgo), const CLOCAL = 32768 +pkg syscall (freebsd-amd64-cgo), const CREAD = 2048 +pkg syscall (freebsd-amd64-cgo), const CS5 = 0 +pkg syscall (freebsd-amd64-cgo), const CS6 = 256 +pkg syscall (freebsd-amd64-cgo), const CS7 = 512 +pkg syscall (freebsd-amd64-cgo), const CS8 = 768 +pkg syscall (freebsd-amd64-cgo), const CSIZE = 768 +pkg syscall (freebsd-amd64-cgo), const CSTART = 17 +pkg syscall (freebsd-amd64-cgo), const CSTATUS = 20 +pkg syscall (freebsd-amd64-cgo), const CSTOP = 19 +pkg syscall (freebsd-amd64-cgo), const CSTOPB = 1024 +pkg syscall (freebsd-amd64-cgo), const CSUSP = 26 +pkg syscall (freebsd-amd64-cgo), const CTL_MAXNAME = 24 +pkg syscall (freebsd-amd64-cgo), const CTL_NET = 4 +pkg syscall (freebsd-amd64-cgo), const DLT_A429 = 184 +pkg syscall (freebsd-amd64-cgo), const DLT_A653_ICM = 185 +pkg syscall (freebsd-amd64-cgo), const DLT_AIRONET_HEADER = 120 +pkg syscall (freebsd-amd64-cgo), const DLT_AOS = 222 +pkg syscall (freebsd-amd64-cgo), const DLT_APPLE_IP_OVER_IEEE1394 = 138 +pkg syscall (freebsd-amd64-cgo), const DLT_ARCNET = 7 +pkg syscall (freebsd-amd64-cgo), const DLT_ARCNET_LINUX = 129 +pkg syscall (freebsd-amd64-cgo), const DLT_ATM_CLIP = 19 +pkg syscall (freebsd-amd64-cgo), const DLT_ATM_RFC1483 = 11 +pkg syscall (freebsd-amd64-cgo), const DLT_AURORA = 126 +pkg syscall (freebsd-amd64-cgo), const DLT_AX25 = 3 +pkg syscall (freebsd-amd64-cgo), const DLT_AX25_KISS = 202 +pkg syscall (freebsd-amd64-cgo), const DLT_BACNET_MS_TP = 165 +pkg syscall (freebsd-amd64-cgo), const DLT_BLUETOOTH_HCI_H4 = 187 +pkg syscall (freebsd-amd64-cgo), const DLT_BLUETOOTH_HCI_H4_WITH_PHDR = 201 +pkg syscall (freebsd-amd64-cgo), const DLT_CAN20B = 190 +pkg syscall (freebsd-amd64-cgo), const DLT_CAN_SOCKETCAN = 227 +pkg syscall (freebsd-amd64-cgo), const DLT_CHAOS = 5 +pkg syscall (freebsd-amd64-cgo), const DLT_CHDLC = 104 +pkg syscall (freebsd-amd64-cgo), const DLT_CISCO_IOS = 118 +pkg syscall (freebsd-amd64-cgo), const DLT_C_HDLC = 104 +pkg syscall (freebsd-amd64-cgo), const DLT_C_HDLC_WITH_DIR = 205 +pkg syscall (freebsd-amd64-cgo), const DLT_DBUS = 231 +pkg syscall (freebsd-amd64-cgo), const DLT_DECT = 221 +pkg syscall (freebsd-amd64-cgo), const DLT_DOCSIS = 143 +pkg syscall (freebsd-amd64-cgo), const DLT_DVB_CI = 235 +pkg syscall (freebsd-amd64-cgo), const DLT_ECONET = 115 +pkg syscall (freebsd-amd64-cgo), const DLT_EN10MB = 1 +pkg syscall (freebsd-amd64-cgo), const DLT_EN3MB = 2 +pkg syscall (freebsd-amd64-cgo), const DLT_ENC = 109 +pkg syscall (freebsd-amd64-cgo), const DLT_ERF = 197 +pkg syscall (freebsd-amd64-cgo), const DLT_ERF_ETH = 175 +pkg syscall (freebsd-amd64-cgo), const DLT_ERF_POS = 176 +pkg syscall (freebsd-amd64-cgo), const DLT_FC_2 = 224 +pkg syscall (freebsd-amd64-cgo), const DLT_FC_2_WITH_FRAME_DELIMS = 225 +pkg syscall (freebsd-amd64-cgo), const DLT_FDDI = 10 +pkg syscall (freebsd-amd64-cgo), const DLT_FLEXRAY = 210 +pkg syscall (freebsd-amd64-cgo), const DLT_FRELAY = 107 +pkg syscall (freebsd-amd64-cgo), const DLT_FRELAY_WITH_DIR = 206 +pkg syscall (freebsd-amd64-cgo), const DLT_GCOM_SERIAL = 173 +pkg syscall (freebsd-amd64-cgo), const DLT_GCOM_T1E1 = 172 +pkg syscall (freebsd-amd64-cgo), const DLT_GPF_F = 171 +pkg syscall (freebsd-amd64-cgo), const DLT_GPF_T = 170 +pkg syscall (freebsd-amd64-cgo), const DLT_GPRS_LLC = 169 +pkg syscall (freebsd-amd64-cgo), const DLT_GSMTAP_ABIS = 218 +pkg syscall (freebsd-amd64-cgo), const DLT_GSMTAP_UM = 217 +pkg syscall (freebsd-amd64-cgo), const DLT_HHDLC = 121 +pkg syscall (freebsd-amd64-cgo), const DLT_IBM_SN = 146 +pkg syscall (freebsd-amd64-cgo), const DLT_IBM_SP = 145 +pkg syscall (freebsd-amd64-cgo), const DLT_IEEE802 = 6 +pkg syscall (freebsd-amd64-cgo), const DLT_IEEE802_11 = 105 +pkg syscall (freebsd-amd64-cgo), const DLT_IEEE802_11_RADIO = 127 +pkg syscall (freebsd-amd64-cgo), const DLT_IEEE802_11_RADIO_AVS = 163 +pkg syscall (freebsd-amd64-cgo), const DLT_IEEE802_15_4 = 195 +pkg syscall (freebsd-amd64-cgo), const DLT_IEEE802_15_4_LINUX = 191 +pkg syscall (freebsd-amd64-cgo), const DLT_IEEE802_15_4_NOFCS = 230 +pkg syscall (freebsd-amd64-cgo), const DLT_IEEE802_15_4_NONASK_PHY = 215 +pkg syscall (freebsd-amd64-cgo), const DLT_IEEE802_16_MAC_CPS = 188 +pkg syscall (freebsd-amd64-cgo), const DLT_IEEE802_16_MAC_CPS_RADIO = 193 +pkg syscall (freebsd-amd64-cgo), const DLT_IPFILTER = 116 +pkg syscall (freebsd-amd64-cgo), const DLT_IPMB = 199 +pkg syscall (freebsd-amd64-cgo), const DLT_IPMB_LINUX = 209 +pkg syscall (freebsd-amd64-cgo), const DLT_IPNET = 226 +pkg syscall (freebsd-amd64-cgo), const DLT_IPOIB = 242 +pkg syscall (freebsd-amd64-cgo), const DLT_IPV4 = 228 +pkg syscall (freebsd-amd64-cgo), const DLT_IPV6 = 229 +pkg syscall (freebsd-amd64-cgo), const DLT_IP_OVER_FC = 122 +pkg syscall (freebsd-amd64-cgo), const DLT_JUNIPER_ATM1 = 137 +pkg syscall (freebsd-amd64-cgo), const DLT_JUNIPER_ATM2 = 135 +pkg syscall (freebsd-amd64-cgo), const DLT_JUNIPER_ATM_CEMIC = 238 +pkg syscall (freebsd-amd64-cgo), const DLT_JUNIPER_CHDLC = 181 +pkg syscall (freebsd-amd64-cgo), const DLT_JUNIPER_ES = 132 +pkg syscall (freebsd-amd64-cgo), const DLT_JUNIPER_ETHER = 178 +pkg syscall (freebsd-amd64-cgo), const DLT_JUNIPER_FIBRECHANNEL = 234 +pkg syscall (freebsd-amd64-cgo), const DLT_JUNIPER_FRELAY = 180 +pkg syscall (freebsd-amd64-cgo), const DLT_JUNIPER_GGSN = 133 +pkg syscall (freebsd-amd64-cgo), const DLT_JUNIPER_ISM = 194 +pkg syscall (freebsd-amd64-cgo), const DLT_JUNIPER_MFR = 134 +pkg syscall (freebsd-amd64-cgo), const DLT_JUNIPER_MLFR = 131 +pkg syscall (freebsd-amd64-cgo), const DLT_JUNIPER_MLPPP = 130 +pkg syscall (freebsd-amd64-cgo), const DLT_JUNIPER_MONITOR = 164 +pkg syscall (freebsd-amd64-cgo), const DLT_JUNIPER_PIC_PEER = 174 +pkg syscall (freebsd-amd64-cgo), const DLT_JUNIPER_PPP = 179 +pkg syscall (freebsd-amd64-cgo), const DLT_JUNIPER_PPPOE = 167 +pkg syscall (freebsd-amd64-cgo), const DLT_JUNIPER_PPPOE_ATM = 168 +pkg syscall (freebsd-amd64-cgo), const DLT_JUNIPER_SERVICES = 136 +pkg syscall (freebsd-amd64-cgo), const DLT_JUNIPER_SRX_E2E = 233 +pkg syscall (freebsd-amd64-cgo), const DLT_JUNIPER_ST = 200 +pkg syscall (freebsd-amd64-cgo), const DLT_JUNIPER_VP = 183 +pkg syscall (freebsd-amd64-cgo), const DLT_JUNIPER_VS = 232 +pkg syscall (freebsd-amd64-cgo), const DLT_LAPB_WITH_DIR = 207 +pkg syscall (freebsd-amd64-cgo), const DLT_LAPD = 203 +pkg syscall (freebsd-amd64-cgo), const DLT_LIN = 212 +pkg syscall (freebsd-amd64-cgo), const DLT_LINUX_EVDEV = 216 +pkg syscall (freebsd-amd64-cgo), const DLT_LINUX_IRDA = 144 +pkg syscall (freebsd-amd64-cgo), const DLT_LINUX_LAPD = 177 +pkg syscall (freebsd-amd64-cgo), const DLT_LINUX_PPP_WITHDIRECTION = 166 +pkg syscall (freebsd-amd64-cgo), const DLT_LINUX_SLL = 113 +pkg syscall (freebsd-amd64-cgo), const DLT_LOOP = 108 +pkg syscall (freebsd-amd64-cgo), const DLT_LTALK = 114 +pkg syscall (freebsd-amd64-cgo), const DLT_MATCHING_MAX = 242 +pkg syscall (freebsd-amd64-cgo), const DLT_MATCHING_MIN = 104 +pkg syscall (freebsd-amd64-cgo), const DLT_MFR = 182 +pkg syscall (freebsd-amd64-cgo), const DLT_MOST = 211 +pkg syscall (freebsd-amd64-cgo), const DLT_MPLS = 219 +pkg syscall (freebsd-amd64-cgo), const DLT_MTP2 = 140 +pkg syscall (freebsd-amd64-cgo), const DLT_MTP2_WITH_PHDR = 139 +pkg syscall (freebsd-amd64-cgo), const DLT_MTP3 = 141 +pkg syscall (freebsd-amd64-cgo), const DLT_MUX27010 = 236 +pkg syscall (freebsd-amd64-cgo), const DLT_NETANALYZER = 240 +pkg syscall (freebsd-amd64-cgo), const DLT_NETANALYZER_TRANSPARENT = 241 +pkg syscall (freebsd-amd64-cgo), const DLT_NFLOG = 239 +pkg syscall (freebsd-amd64-cgo), const DLT_NULL = 0 +pkg syscall (freebsd-amd64-cgo), const DLT_PCI_EXP = 125 +pkg syscall (freebsd-amd64-cgo), const DLT_PFLOG = 117 +pkg syscall (freebsd-amd64-cgo), const DLT_PFSYNC = 121 +pkg syscall (freebsd-amd64-cgo), const DLT_PPI = 192 +pkg syscall (freebsd-amd64-cgo), const DLT_PPP = 9 +pkg syscall (freebsd-amd64-cgo), const DLT_PPP_BSDOS = 16 +pkg syscall (freebsd-amd64-cgo), const DLT_PPP_ETHER = 51 +pkg syscall (freebsd-amd64-cgo), const DLT_PPP_PPPD = 166 +pkg syscall (freebsd-amd64-cgo), const DLT_PPP_SERIAL = 50 +pkg syscall (freebsd-amd64-cgo), const DLT_PPP_WITH_DIR = 204 +pkg syscall (freebsd-amd64-cgo), const DLT_PPP_WITH_DIRECTION = 166 +pkg syscall (freebsd-amd64-cgo), const DLT_PRISM_HEADER = 119 +pkg syscall (freebsd-amd64-cgo), const DLT_PRONET = 4 +pkg syscall (freebsd-amd64-cgo), const DLT_RAIF1 = 198 +pkg syscall (freebsd-amd64-cgo), const DLT_RAW = 12 +pkg syscall (freebsd-amd64-cgo), const DLT_RIO = 124 +pkg syscall (freebsd-amd64-cgo), const DLT_SCCP = 142 +pkg syscall (freebsd-amd64-cgo), const DLT_SITA = 196 +pkg syscall (freebsd-amd64-cgo), const DLT_SLIP = 8 +pkg syscall (freebsd-amd64-cgo), const DLT_SLIP_BSDOS = 15 +pkg syscall (freebsd-amd64-cgo), const DLT_STANAG_5066_D_PDU = 237 +pkg syscall (freebsd-amd64-cgo), const DLT_SUNATM = 123 +pkg syscall (freebsd-amd64-cgo), const DLT_SYMANTEC_FIREWALL = 99 +pkg syscall (freebsd-amd64-cgo), const DLT_TZSP = 128 +pkg syscall (freebsd-amd64-cgo), const DLT_USB = 186 +pkg syscall (freebsd-amd64-cgo), const DLT_USB_LINUX = 189 +pkg syscall (freebsd-amd64-cgo), const DLT_USB_LINUX_MMAPPED = 220 +pkg syscall (freebsd-amd64-cgo), const DLT_USER0 = 147 +pkg syscall (freebsd-amd64-cgo), const DLT_USER1 = 148 +pkg syscall (freebsd-amd64-cgo), const DLT_USER10 = 157 +pkg syscall (freebsd-amd64-cgo), const DLT_USER11 = 158 +pkg syscall (freebsd-amd64-cgo), const DLT_USER12 = 159 +pkg syscall (freebsd-amd64-cgo), const DLT_USER13 = 160 +pkg syscall (freebsd-amd64-cgo), const DLT_USER14 = 161 +pkg syscall (freebsd-amd64-cgo), const DLT_USER15 = 162 +pkg syscall (freebsd-amd64-cgo), const DLT_USER2 = 149 +pkg syscall (freebsd-amd64-cgo), const DLT_USER3 = 150 +pkg syscall (freebsd-amd64-cgo), const DLT_USER4 = 151 +pkg syscall (freebsd-amd64-cgo), const DLT_USER5 = 152 +pkg syscall (freebsd-amd64-cgo), const DLT_USER6 = 153 +pkg syscall (freebsd-amd64-cgo), const DLT_USER7 = 154 +pkg syscall (freebsd-amd64-cgo), const DLT_USER8 = 155 +pkg syscall (freebsd-amd64-cgo), const DLT_USER9 = 156 +pkg syscall (freebsd-amd64-cgo), const DLT_WIHART = 223 +pkg syscall (freebsd-amd64-cgo), const DLT_X2E_SERIAL = 213 +pkg syscall (freebsd-amd64-cgo), const DLT_X2E_XORAYA = 214 +pkg syscall (freebsd-amd64-cgo), const DT_BLK = 6 +pkg syscall (freebsd-amd64-cgo), const DT_CHR = 2 +pkg syscall (freebsd-amd64-cgo), const DT_DIR = 4 +pkg syscall (freebsd-amd64-cgo), const DT_FIFO = 1 +pkg syscall (freebsd-amd64-cgo), const DT_LNK = 10 +pkg syscall (freebsd-amd64-cgo), const DT_REG = 8 +pkg syscall (freebsd-amd64-cgo), const DT_SOCK = 12 +pkg syscall (freebsd-amd64-cgo), const DT_UNKNOWN = 0 +pkg syscall (freebsd-amd64-cgo), const DT_WHT = 14 +pkg syscall (freebsd-amd64-cgo), const E2BIG = 7 +pkg syscall (freebsd-amd64-cgo), const EACCES = 13 +pkg syscall (freebsd-amd64-cgo), const EADDRINUSE = 48 +pkg syscall (freebsd-amd64-cgo), const EADDRNOTAVAIL = 49 +pkg syscall (freebsd-amd64-cgo), const EAFNOSUPPORT = 47 +pkg syscall (freebsd-amd64-cgo), const EAGAIN = 35 +pkg syscall (freebsd-amd64-cgo), const EALREADY = 37 +pkg syscall (freebsd-amd64-cgo), const EAUTH = 80 +pkg syscall (freebsd-amd64-cgo), const EBADF = 9 +pkg syscall (freebsd-amd64-cgo), const EBADMSG = 89 +pkg syscall (freebsd-amd64-cgo), const EBADRPC = 72 +pkg syscall (freebsd-amd64-cgo), const EBUSY = 16 +pkg syscall (freebsd-amd64-cgo), const ECANCELED = 85 +pkg syscall (freebsd-amd64-cgo), const ECAPMODE = 94 +pkg syscall (freebsd-amd64-cgo), const ECHILD = 10 +pkg syscall (freebsd-amd64-cgo), const ECHO = 8 +pkg syscall (freebsd-amd64-cgo), const ECHOCTL = 64 +pkg syscall (freebsd-amd64-cgo), const ECHOE = 2 +pkg syscall (freebsd-amd64-cgo), const ECHOK = 4 +pkg syscall (freebsd-amd64-cgo), const ECHOKE = 1 +pkg syscall (freebsd-amd64-cgo), const ECHONL = 16 +pkg syscall (freebsd-amd64-cgo), const ECHOPRT = 32 +pkg syscall (freebsd-amd64-cgo), const ECONNABORTED = 53 +pkg syscall (freebsd-amd64-cgo), const ECONNREFUSED = 61 +pkg syscall (freebsd-amd64-cgo), const ECONNRESET = 54 +pkg syscall (freebsd-amd64-cgo), const EDEADLK = 11 +pkg syscall (freebsd-amd64-cgo), const EDESTADDRREQ = 39 +pkg syscall (freebsd-amd64-cgo), const EDOM = 33 +pkg syscall (freebsd-amd64-cgo), const EDOOFUS = 88 +pkg syscall (freebsd-amd64-cgo), const EDQUOT = 69 +pkg syscall (freebsd-amd64-cgo), const EEXIST = 17 +pkg syscall (freebsd-amd64-cgo), const EFAULT = 14 +pkg syscall (freebsd-amd64-cgo), const EFBIG = 27 +pkg syscall (freebsd-amd64-cgo), const EFTYPE = 79 +pkg syscall (freebsd-amd64-cgo), const EHOSTDOWN = 64 +pkg syscall (freebsd-amd64-cgo), const EHOSTUNREACH = 65 +pkg syscall (freebsd-amd64-cgo), const EIDRM = 82 +pkg syscall (freebsd-amd64-cgo), const EILSEQ = 86 +pkg syscall (freebsd-amd64-cgo), const EINPROGRESS = 36 +pkg syscall (freebsd-amd64-cgo), const EINTR = 4 +pkg syscall (freebsd-amd64-cgo), const EINVAL = 22 +pkg syscall (freebsd-amd64-cgo), const EIO = 5 +pkg syscall (freebsd-amd64-cgo), const EISCONN = 56 +pkg syscall (freebsd-amd64-cgo), const EISDIR = 21 +pkg syscall (freebsd-amd64-cgo), const ELAST = 94 +pkg syscall (freebsd-amd64-cgo), const ELOOP = 62 +pkg syscall (freebsd-amd64-cgo), const EMFILE = 24 +pkg syscall (freebsd-amd64-cgo), const EMLINK = 31 +pkg syscall (freebsd-amd64-cgo), const EMSGSIZE = 40 +pkg syscall (freebsd-amd64-cgo), const EMULTIHOP = 90 +pkg syscall (freebsd-amd64-cgo), const ENAMETOOLONG = 63 +pkg syscall (freebsd-amd64-cgo), const ENEEDAUTH = 81 +pkg syscall (freebsd-amd64-cgo), const ENETDOWN = 50 +pkg syscall (freebsd-amd64-cgo), const ENETRESET = 52 +pkg syscall (freebsd-amd64-cgo), const ENETUNREACH = 51 +pkg syscall (freebsd-amd64-cgo), const ENFILE = 23 +pkg syscall (freebsd-amd64-cgo), const ENOATTR = 87 +pkg syscall (freebsd-amd64-cgo), const ENOBUFS = 55 +pkg syscall (freebsd-amd64-cgo), const ENODEV = 19 +pkg syscall (freebsd-amd64-cgo), const ENOEXEC = 8 +pkg syscall (freebsd-amd64-cgo), const ENOLCK = 77 +pkg syscall (freebsd-amd64-cgo), const ENOLINK = 91 +pkg syscall (freebsd-amd64-cgo), const ENOMEM = 12 +pkg syscall (freebsd-amd64-cgo), const ENOMSG = 83 +pkg syscall (freebsd-amd64-cgo), const ENOPROTOOPT = 42 +pkg syscall (freebsd-amd64-cgo), const ENOSPC = 28 +pkg syscall (freebsd-amd64-cgo), const ENOSYS = 78 +pkg syscall (freebsd-amd64-cgo), const ENOTBLK = 15 +pkg syscall (freebsd-amd64-cgo), const ENOTCAPABLE = 93 +pkg syscall (freebsd-amd64-cgo), const ENOTCONN = 57 +pkg syscall (freebsd-amd64-cgo), const ENOTDIR = 20 +pkg syscall (freebsd-amd64-cgo), const ENOTEMPTY = 66 +pkg syscall (freebsd-amd64-cgo), const ENOTSOCK = 38 +pkg syscall (freebsd-amd64-cgo), const ENOTSUP = 45 +pkg syscall (freebsd-amd64-cgo), const ENOTTY = 25 +pkg syscall (freebsd-amd64-cgo), const ENXIO = 6 +pkg syscall (freebsd-amd64-cgo), const EOPNOTSUPP = 45 +pkg syscall (freebsd-amd64-cgo), const EOVERFLOW = 84 +pkg syscall (freebsd-amd64-cgo), const EPERM = 1 +pkg syscall (freebsd-amd64-cgo), const EPFNOSUPPORT = 46 +pkg syscall (freebsd-amd64-cgo), const EPIPE = 32 +pkg syscall (freebsd-amd64-cgo), const EPROCLIM = 67 +pkg syscall (freebsd-amd64-cgo), const EPROCUNAVAIL = 76 +pkg syscall (freebsd-amd64-cgo), const EPROGMISMATCH = 75 +pkg syscall (freebsd-amd64-cgo), const EPROGUNAVAIL = 74 +pkg syscall (freebsd-amd64-cgo), const EPROTO = 92 +pkg syscall (freebsd-amd64-cgo), const EPROTONOSUPPORT = 43 +pkg syscall (freebsd-amd64-cgo), const EPROTOTYPE = 41 +pkg syscall (freebsd-amd64-cgo), const ERANGE = 34 +pkg syscall (freebsd-amd64-cgo), const EREMOTE = 71 +pkg syscall (freebsd-amd64-cgo), const EROFS = 30 +pkg syscall (freebsd-amd64-cgo), const ERPCMISMATCH = 73 +pkg syscall (freebsd-amd64-cgo), const ESHUTDOWN = 58 +pkg syscall (freebsd-amd64-cgo), const ESOCKTNOSUPPORT = 44 +pkg syscall (freebsd-amd64-cgo), const ESPIPE = 29 +pkg syscall (freebsd-amd64-cgo), const ESRCH = 3 +pkg syscall (freebsd-amd64-cgo), const ESTALE = 70 +pkg syscall (freebsd-amd64-cgo), const ETIMEDOUT = 60 +pkg syscall (freebsd-amd64-cgo), const ETOOMANYREFS = 59 +pkg syscall (freebsd-amd64-cgo), const ETXTBSY = 26 +pkg syscall (freebsd-amd64-cgo), const EUSERS = 68 +pkg syscall (freebsd-amd64-cgo), const EVFILT_AIO = -3 +pkg syscall (freebsd-amd64-cgo), const EVFILT_FS = -9 +pkg syscall (freebsd-amd64-cgo), const EVFILT_LIO = -10 +pkg syscall (freebsd-amd64-cgo), const EVFILT_PROC = -5 +pkg syscall (freebsd-amd64-cgo), const EVFILT_READ = -1 +pkg syscall (freebsd-amd64-cgo), const EVFILT_SIGNAL = -6 +pkg syscall (freebsd-amd64-cgo), const EVFILT_SYSCOUNT = 11 +pkg syscall (freebsd-amd64-cgo), const EVFILT_TIMER = -7 +pkg syscall (freebsd-amd64-cgo), const EVFILT_USER = -11 +pkg syscall (freebsd-amd64-cgo), const EVFILT_VNODE = -4 +pkg syscall (freebsd-amd64-cgo), const EVFILT_WRITE = -2 +pkg syscall (freebsd-amd64-cgo), const EV_ADD = 1 +pkg syscall (freebsd-amd64-cgo), const EV_CLEAR = 32 +pkg syscall (freebsd-amd64-cgo), const EV_DELETE = 2 +pkg syscall (freebsd-amd64-cgo), const EV_DISABLE = 8 +pkg syscall (freebsd-amd64-cgo), const EV_DISPATCH = 128 +pkg syscall (freebsd-amd64-cgo), const EV_ENABLE = 4 +pkg syscall (freebsd-amd64-cgo), const EV_EOF = 32768 +pkg syscall (freebsd-amd64-cgo), const EV_ERROR = 16384 +pkg syscall (freebsd-amd64-cgo), const EV_FLAG1 = 8192 +pkg syscall (freebsd-amd64-cgo), const EV_ONESHOT = 16 +pkg syscall (freebsd-amd64-cgo), const EV_RECEIPT = 64 +pkg syscall (freebsd-amd64-cgo), const EV_SYSFLAGS = 61440 +pkg syscall (freebsd-amd64-cgo), const EWOULDBLOCK = 35 +pkg syscall (freebsd-amd64-cgo), const EXDEV = 18 +pkg syscall (freebsd-amd64-cgo), const EXTA = 19200 +pkg syscall (freebsd-amd64-cgo), const EXTB = 38400 +pkg syscall (freebsd-amd64-cgo), const EXTPROC = 2048 +pkg syscall (freebsd-amd64-cgo), const FD_CLOEXEC = 1 +pkg syscall (freebsd-amd64-cgo), const FD_SETSIZE = 1024 +pkg syscall (freebsd-amd64-cgo), const FLUSHO = 8388608 +pkg syscall (freebsd-amd64-cgo), const F_CANCEL = 5 +pkg syscall (freebsd-amd64-cgo), const F_DUP2FD = 10 +pkg syscall (freebsd-amd64-cgo), const F_DUPFD = 0 +pkg syscall (freebsd-amd64-cgo), const F_GETFD = 1 +pkg syscall (freebsd-amd64-cgo), const F_GETFL = 3 +pkg syscall (freebsd-amd64-cgo), const F_GETLK = 11 +pkg syscall (freebsd-amd64-cgo), const F_GETOWN = 5 +pkg syscall (freebsd-amd64-cgo), const F_OGETLK = 7 +pkg syscall (freebsd-amd64-cgo), const F_OK = 0 +pkg syscall (freebsd-amd64-cgo), const F_OSETLK = 8 +pkg syscall (freebsd-amd64-cgo), const F_OSETLKW = 9 +pkg syscall (freebsd-amd64-cgo), const F_RDAHEAD = 16 +pkg syscall (freebsd-amd64-cgo), const F_RDLCK = 1 +pkg syscall (freebsd-amd64-cgo), const F_READAHEAD = 15 +pkg syscall (freebsd-amd64-cgo), const F_SETFD = 2 +pkg syscall (freebsd-amd64-cgo), const F_SETFL = 4 +pkg syscall (freebsd-amd64-cgo), const F_SETLK = 12 +pkg syscall (freebsd-amd64-cgo), const F_SETLKW = 13 +pkg syscall (freebsd-amd64-cgo), const F_SETLK_REMOTE = 14 +pkg syscall (freebsd-amd64-cgo), const F_SETOWN = 6 +pkg syscall (freebsd-amd64-cgo), const F_UNLCK = 2 +pkg syscall (freebsd-amd64-cgo), const F_UNLCKSYS = 4 +pkg syscall (freebsd-amd64-cgo), const F_WRLCK = 3 +pkg syscall (freebsd-amd64-cgo), const HUPCL = 16384 +pkg syscall (freebsd-amd64-cgo), const ICANON = 256 +pkg syscall (freebsd-amd64-cgo), const ICRNL = 256 +pkg syscall (freebsd-amd64-cgo), const IEXTEN = 1024 +pkg syscall (freebsd-amd64-cgo), const IFAN_ARRIVAL = 0 +pkg syscall (freebsd-amd64-cgo), const IFAN_DEPARTURE = 1 +pkg syscall (freebsd-amd64-cgo), const IFF_ALLMULTI = 512 +pkg syscall (freebsd-amd64-cgo), const IFF_ALTPHYS = 16384 +pkg syscall (freebsd-amd64-cgo), const IFF_CANTCHANGE = 2199410 +pkg syscall (freebsd-amd64-cgo), const IFF_CANTCONFIG = 65536 +pkg syscall (freebsd-amd64-cgo), const IFF_DEBUG = 4 +pkg syscall (freebsd-amd64-cgo), const IFF_DRV_OACTIVE = 1024 +pkg syscall (freebsd-amd64-cgo), const IFF_DRV_RUNNING = 64 +pkg syscall (freebsd-amd64-cgo), const IFF_DYING = 2097152 +pkg syscall (freebsd-amd64-cgo), const IFF_LINK0 = 4096 +pkg syscall (freebsd-amd64-cgo), const IFF_LINK1 = 8192 +pkg syscall (freebsd-amd64-cgo), const IFF_LINK2 = 16384 +pkg syscall (freebsd-amd64-cgo), const IFF_LOOPBACK = 8 +pkg syscall (freebsd-amd64-cgo), const IFF_MONITOR = 262144 +pkg syscall (freebsd-amd64-cgo), const IFF_MULTICAST = 32768 +pkg syscall (freebsd-amd64-cgo), const IFF_NOARP = 128 +pkg syscall (freebsd-amd64-cgo), const IFF_OACTIVE = 1024 +pkg syscall (freebsd-amd64-cgo), const IFF_POINTOPOINT = 16 +pkg syscall (freebsd-amd64-cgo), const IFF_PPROMISC = 131072 +pkg syscall (freebsd-amd64-cgo), const IFF_PROMISC = 256 +pkg syscall (freebsd-amd64-cgo), const IFF_RENAMING = 4194304 +pkg syscall (freebsd-amd64-cgo), const IFF_RUNNING = 64 +pkg syscall (freebsd-amd64-cgo), const IFF_SIMPLEX = 2048 +pkg syscall (freebsd-amd64-cgo), const IFF_SMART = 32 +pkg syscall (freebsd-amd64-cgo), const IFF_STATICARP = 524288 +pkg syscall (freebsd-amd64-cgo), const IFNAMSIZ = 16 +pkg syscall (freebsd-amd64-cgo), const IFT_1822 = 2 +pkg syscall (freebsd-amd64-cgo), const IFT_A12MPPSWITCH = 130 +pkg syscall (freebsd-amd64-cgo), const IFT_AAL2 = 187 +pkg syscall (freebsd-amd64-cgo), const IFT_AAL5 = 49 +pkg syscall (freebsd-amd64-cgo), const IFT_ADSL = 94 +pkg syscall (freebsd-amd64-cgo), const IFT_AFLANE8023 = 59 +pkg syscall (freebsd-amd64-cgo), const IFT_AFLANE8025 = 60 +pkg syscall (freebsd-amd64-cgo), const IFT_ARAP = 88 +pkg syscall (freebsd-amd64-cgo), const IFT_ARCNET = 35 +pkg syscall (freebsd-amd64-cgo), const IFT_ARCNETPLUS = 36 +pkg syscall (freebsd-amd64-cgo), const IFT_ASYNC = 84 +pkg syscall (freebsd-amd64-cgo), const IFT_ATM = 37 +pkg syscall (freebsd-amd64-cgo), const IFT_ATMDXI = 105 +pkg syscall (freebsd-amd64-cgo), const IFT_ATMFUNI = 106 +pkg syscall (freebsd-amd64-cgo), const IFT_ATMIMA = 107 +pkg syscall (freebsd-amd64-cgo), const IFT_ATMLOGICAL = 80 +pkg syscall (freebsd-amd64-cgo), const IFT_ATMRADIO = 189 +pkg syscall (freebsd-amd64-cgo), const IFT_ATMSUBINTERFACE = 134 +pkg syscall (freebsd-amd64-cgo), const IFT_ATMVCIENDPT = 194 +pkg syscall (freebsd-amd64-cgo), const IFT_ATMVIRTUAL = 149 +pkg syscall (freebsd-amd64-cgo), const IFT_BGPPOLICYACCOUNTING = 162 +pkg syscall (freebsd-amd64-cgo), const IFT_BRIDGE = 209 +pkg syscall (freebsd-amd64-cgo), const IFT_BSC = 83 +pkg syscall (freebsd-amd64-cgo), const IFT_CARP = 248 +pkg syscall (freebsd-amd64-cgo), const IFT_CCTEMUL = 61 +pkg syscall (freebsd-amd64-cgo), const IFT_CEPT = 19 +pkg syscall (freebsd-amd64-cgo), const IFT_CES = 133 +pkg syscall (freebsd-amd64-cgo), const IFT_CHANNEL = 70 +pkg syscall (freebsd-amd64-cgo), const IFT_CNR = 85 +pkg syscall (freebsd-amd64-cgo), const IFT_COFFEE = 132 +pkg syscall (freebsd-amd64-cgo), const IFT_COMPOSITELINK = 155 +pkg syscall (freebsd-amd64-cgo), const IFT_DCN = 141 +pkg syscall (freebsd-amd64-cgo), const IFT_DIGITALPOWERLINE = 138 +pkg syscall (freebsd-amd64-cgo), const IFT_DIGITALWRAPPEROVERHEADCHANNEL = 186 +pkg syscall (freebsd-amd64-cgo), const IFT_DLSW = 74 +pkg syscall (freebsd-amd64-cgo), const IFT_DOCSCABLEDOWNSTREAM = 128 +pkg syscall (freebsd-amd64-cgo), const IFT_DOCSCABLEMACLAYER = 127 +pkg syscall (freebsd-amd64-cgo), const IFT_DOCSCABLEUPSTREAM = 129 +pkg syscall (freebsd-amd64-cgo), const IFT_DS0 = 81 +pkg syscall (freebsd-amd64-cgo), const IFT_DS0BUNDLE = 82 +pkg syscall (freebsd-amd64-cgo), const IFT_DS1FDL = 170 +pkg syscall (freebsd-amd64-cgo), const IFT_DS3 = 30 +pkg syscall (freebsd-amd64-cgo), const IFT_DTM = 140 +pkg syscall (freebsd-amd64-cgo), const IFT_DVBASILN = 172 +pkg syscall (freebsd-amd64-cgo), const IFT_DVBASIOUT = 173 +pkg syscall (freebsd-amd64-cgo), const IFT_DVBRCCDOWNSTREAM = 147 +pkg syscall (freebsd-amd64-cgo), const IFT_DVBRCCMACLAYER = 146 +pkg syscall (freebsd-amd64-cgo), const IFT_DVBRCCUPSTREAM = 148 +pkg syscall (freebsd-amd64-cgo), const IFT_ENC = 244 +pkg syscall (freebsd-amd64-cgo), const IFT_EON = 25 +pkg syscall (freebsd-amd64-cgo), const IFT_EPLRS = 87 +pkg syscall (freebsd-amd64-cgo), const IFT_ESCON = 73 +pkg syscall (freebsd-amd64-cgo), const IFT_ETHER = 6 +pkg syscall (freebsd-amd64-cgo), const IFT_FAITH = 242 +pkg syscall (freebsd-amd64-cgo), const IFT_FAST = 125 +pkg syscall (freebsd-amd64-cgo), const IFT_FASTETHER = 62 +pkg syscall (freebsd-amd64-cgo), const IFT_FASTETHERFX = 69 +pkg syscall (freebsd-amd64-cgo), const IFT_FDDI = 15 +pkg syscall (freebsd-amd64-cgo), const IFT_FIBRECHANNEL = 56 +pkg syscall (freebsd-amd64-cgo), const IFT_FRAMERELAYINTERCONNECT = 58 +pkg syscall (freebsd-amd64-cgo), const IFT_FRAMERELAYMPI = 92 +pkg syscall (freebsd-amd64-cgo), const IFT_FRDLCIENDPT = 193 +pkg syscall (freebsd-amd64-cgo), const IFT_FRELAY = 32 +pkg syscall (freebsd-amd64-cgo), const IFT_FRELAYDCE = 44 +pkg syscall (freebsd-amd64-cgo), const IFT_FRF16MFRBUNDLE = 163 +pkg syscall (freebsd-amd64-cgo), const IFT_FRFORWARD = 158 +pkg syscall (freebsd-amd64-cgo), const IFT_G703AT2MB = 67 +pkg syscall (freebsd-amd64-cgo), const IFT_G703AT64K = 66 +pkg syscall (freebsd-amd64-cgo), const IFT_GIF = 240 +pkg syscall (freebsd-amd64-cgo), const IFT_GIGABITETHERNET = 117 +pkg syscall (freebsd-amd64-cgo), const IFT_GR303IDT = 178 +pkg syscall (freebsd-amd64-cgo), const IFT_GR303RDT = 177 +pkg syscall (freebsd-amd64-cgo), const IFT_H323GATEKEEPER = 164 +pkg syscall (freebsd-amd64-cgo), const IFT_H323PROXY = 165 +pkg syscall (freebsd-amd64-cgo), const IFT_HDH1822 = 3 +pkg syscall (freebsd-amd64-cgo), const IFT_HDLC = 118 +pkg syscall (freebsd-amd64-cgo), const IFT_HDSL2 = 168 +pkg syscall (freebsd-amd64-cgo), const IFT_HIPERLAN2 = 183 +pkg syscall (freebsd-amd64-cgo), const IFT_HIPPI = 47 +pkg syscall (freebsd-amd64-cgo), const IFT_HIPPIINTERFACE = 57 +pkg syscall (freebsd-amd64-cgo), const IFT_HOSTPAD = 90 +pkg syscall (freebsd-amd64-cgo), const IFT_HSSI = 46 +pkg syscall (freebsd-amd64-cgo), const IFT_HY = 14 +pkg syscall (freebsd-amd64-cgo), const IFT_IBM370PARCHAN = 72 +pkg syscall (freebsd-amd64-cgo), const IFT_IDSL = 154 +pkg syscall (freebsd-amd64-cgo), const IFT_IEEE1394 = 144 +pkg syscall (freebsd-amd64-cgo), const IFT_IEEE80211 = 71 +pkg syscall (freebsd-amd64-cgo), const IFT_IEEE80212 = 55 +pkg syscall (freebsd-amd64-cgo), const IFT_IEEE8023ADLAG = 161 +pkg syscall (freebsd-amd64-cgo), const IFT_IFGSN = 145 +pkg syscall (freebsd-amd64-cgo), const IFT_IMT = 190 +pkg syscall (freebsd-amd64-cgo), const IFT_INFINIBAND = 199 +pkg syscall (freebsd-amd64-cgo), const IFT_INTERLEAVE = 124 +pkg syscall (freebsd-amd64-cgo), const IFT_IP = 126 +pkg syscall (freebsd-amd64-cgo), const IFT_IPFORWARD = 142 +pkg syscall (freebsd-amd64-cgo), const IFT_IPOVERATM = 114 +pkg syscall (freebsd-amd64-cgo), const IFT_IPOVERCDLC = 109 +pkg syscall (freebsd-amd64-cgo), const IFT_IPOVERCLAW = 110 +pkg syscall (freebsd-amd64-cgo), const IFT_IPSWITCH = 78 +pkg syscall (freebsd-amd64-cgo), const IFT_IPXIP = 249 +pkg syscall (freebsd-amd64-cgo), const IFT_ISDN = 63 +pkg syscall (freebsd-amd64-cgo), const IFT_ISDNBASIC = 20 +pkg syscall (freebsd-amd64-cgo), const IFT_ISDNPRIMARY = 21 +pkg syscall (freebsd-amd64-cgo), const IFT_ISDNS = 75 +pkg syscall (freebsd-amd64-cgo), const IFT_ISDNU = 76 +pkg syscall (freebsd-amd64-cgo), const IFT_ISO88022LLC = 41 +pkg syscall (freebsd-amd64-cgo), const IFT_ISO88023 = 7 +pkg syscall (freebsd-amd64-cgo), const IFT_ISO88024 = 8 +pkg syscall (freebsd-amd64-cgo), const IFT_ISO88025 = 9 +pkg syscall (freebsd-amd64-cgo), const IFT_ISO88025CRFPINT = 98 +pkg syscall (freebsd-amd64-cgo), const IFT_ISO88025DTR = 86 +pkg syscall (freebsd-amd64-cgo), const IFT_ISO88025FIBER = 115 +pkg syscall (freebsd-amd64-cgo), const IFT_ISO88026 = 10 +pkg syscall (freebsd-amd64-cgo), const IFT_ISUP = 179 +pkg syscall (freebsd-amd64-cgo), const IFT_L2VLAN = 135 +pkg syscall (freebsd-amd64-cgo), const IFT_L3IPVLAN = 136 +pkg syscall (freebsd-amd64-cgo), const IFT_L3IPXVLAN = 137 +pkg syscall (freebsd-amd64-cgo), const IFT_LAPB = 16 +pkg syscall (freebsd-amd64-cgo), const IFT_LAPD = 77 +pkg syscall (freebsd-amd64-cgo), const IFT_LAPF = 119 +pkg syscall (freebsd-amd64-cgo), const IFT_LOCALTALK = 42 +pkg syscall (freebsd-amd64-cgo), const IFT_LOOP = 24 +pkg syscall (freebsd-amd64-cgo), const IFT_MEDIAMAILOVERIP = 139 +pkg syscall (freebsd-amd64-cgo), const IFT_MFSIGLINK = 167 +pkg syscall (freebsd-amd64-cgo), const IFT_MIOX25 = 38 +pkg syscall (freebsd-amd64-cgo), const IFT_MODEM = 48 +pkg syscall (freebsd-amd64-cgo), const IFT_MPC = 113 +pkg syscall (freebsd-amd64-cgo), const IFT_MPLS = 166 +pkg syscall (freebsd-amd64-cgo), const IFT_MPLSTUNNEL = 150 +pkg syscall (freebsd-amd64-cgo), const IFT_MSDSL = 143 +pkg syscall (freebsd-amd64-cgo), const IFT_MVL = 191 +pkg syscall (freebsd-amd64-cgo), const IFT_MYRINET = 99 +pkg syscall (freebsd-amd64-cgo), const IFT_NFAS = 175 +pkg syscall (freebsd-amd64-cgo), const IFT_NSIP = 27 +pkg syscall (freebsd-amd64-cgo), const IFT_OPTICALCHANNEL = 195 +pkg syscall (freebsd-amd64-cgo), const IFT_OPTICALTRANSPORT = 196 +pkg syscall (freebsd-amd64-cgo), const IFT_OTHER = 1 +pkg syscall (freebsd-amd64-cgo), const IFT_P10 = 12 +pkg syscall (freebsd-amd64-cgo), const IFT_P80 = 13 +pkg syscall (freebsd-amd64-cgo), const IFT_PARA = 34 +pkg syscall (freebsd-amd64-cgo), const IFT_PFLOG = 246 +pkg syscall (freebsd-amd64-cgo), const IFT_PFSYNC = 247 +pkg syscall (freebsd-amd64-cgo), const IFT_PLC = 174 +pkg syscall (freebsd-amd64-cgo), const IFT_POS = 171 +pkg syscall (freebsd-amd64-cgo), const IFT_PPP = 23 +pkg syscall (freebsd-amd64-cgo), const IFT_PPPMULTILINKBUNDLE = 108 +pkg syscall (freebsd-amd64-cgo), const IFT_PROPBWAP2MP = 184 +pkg syscall (freebsd-amd64-cgo), const IFT_PROPCNLS = 89 +pkg syscall (freebsd-amd64-cgo), const IFT_PROPDOCSWIRELESSDOWNSTREAM = 181 +pkg syscall (freebsd-amd64-cgo), const IFT_PROPDOCSWIRELESSMACLAYER = 180 +pkg syscall (freebsd-amd64-cgo), const IFT_PROPDOCSWIRELESSUPSTREAM = 182 +pkg syscall (freebsd-amd64-cgo), const IFT_PROPMUX = 54 +pkg syscall (freebsd-amd64-cgo), const IFT_PROPVIRTUAL = 53 +pkg syscall (freebsd-amd64-cgo), const IFT_PROPWIRELESSP2P = 157 +pkg syscall (freebsd-amd64-cgo), const IFT_PTPSERIAL = 22 +pkg syscall (freebsd-amd64-cgo), const IFT_PVC = 241 +pkg syscall (freebsd-amd64-cgo), const IFT_QLLC = 68 +pkg syscall (freebsd-amd64-cgo), const IFT_RADIOMAC = 188 +pkg syscall (freebsd-amd64-cgo), const IFT_RADSL = 95 +pkg syscall (freebsd-amd64-cgo), const IFT_REACHDSL = 192 +pkg syscall (freebsd-amd64-cgo), const IFT_RFC1483 = 159 +pkg syscall (freebsd-amd64-cgo), const IFT_RS232 = 33 +pkg syscall (freebsd-amd64-cgo), const IFT_RSRB = 79 +pkg syscall (freebsd-amd64-cgo), const IFT_SDLC = 17 +pkg syscall (freebsd-amd64-cgo), const IFT_SDSL = 96 +pkg syscall (freebsd-amd64-cgo), const IFT_SHDSL = 169 +pkg syscall (freebsd-amd64-cgo), const IFT_SIP = 31 +pkg syscall (freebsd-amd64-cgo), const IFT_SLIP = 28 +pkg syscall (freebsd-amd64-cgo), const IFT_SMDSDXI = 43 +pkg syscall (freebsd-amd64-cgo), const IFT_SMDSICIP = 52 +pkg syscall (freebsd-amd64-cgo), const IFT_SONET = 39 +pkg syscall (freebsd-amd64-cgo), const IFT_SONETOVERHEADCHANNEL = 185 +pkg syscall (freebsd-amd64-cgo), const IFT_SONETPATH = 50 +pkg syscall (freebsd-amd64-cgo), const IFT_SONETVT = 51 +pkg syscall (freebsd-amd64-cgo), const IFT_SRP = 151 +pkg syscall (freebsd-amd64-cgo), const IFT_SS7SIGLINK = 156 +pkg syscall (freebsd-amd64-cgo), const IFT_STACKTOSTACK = 111 +pkg syscall (freebsd-amd64-cgo), const IFT_STARLAN = 11 +pkg syscall (freebsd-amd64-cgo), const IFT_STF = 215 +pkg syscall (freebsd-amd64-cgo), const IFT_T1 = 18 +pkg syscall (freebsd-amd64-cgo), const IFT_TDLC = 116 +pkg syscall (freebsd-amd64-cgo), const IFT_TERMPAD = 91 +pkg syscall (freebsd-amd64-cgo), const IFT_TR008 = 176 +pkg syscall (freebsd-amd64-cgo), const IFT_TRANSPHDLC = 123 +pkg syscall (freebsd-amd64-cgo), const IFT_TUNNEL = 131 +pkg syscall (freebsd-amd64-cgo), const IFT_ULTRA = 29 +pkg syscall (freebsd-amd64-cgo), const IFT_USB = 160 +pkg syscall (freebsd-amd64-cgo), const IFT_V11 = 64 +pkg syscall (freebsd-amd64-cgo), const IFT_V35 = 45 +pkg syscall (freebsd-amd64-cgo), const IFT_V36 = 65 +pkg syscall (freebsd-amd64-cgo), const IFT_V37 = 120 +pkg syscall (freebsd-amd64-cgo), const IFT_VDSL = 97 +pkg syscall (freebsd-amd64-cgo), const IFT_VIRTUALIPADDRESS = 112 +pkg syscall (freebsd-amd64-cgo), const IFT_VOICEEM = 100 +pkg syscall (freebsd-amd64-cgo), const IFT_VOICEENCAP = 103 +pkg syscall (freebsd-amd64-cgo), const IFT_VOICEFXO = 101 +pkg syscall (freebsd-amd64-cgo), const IFT_VOICEFXS = 102 +pkg syscall (freebsd-amd64-cgo), const IFT_VOICEOVERATM = 152 +pkg syscall (freebsd-amd64-cgo), const IFT_VOICEOVERFRAMERELAY = 153 +pkg syscall (freebsd-amd64-cgo), const IFT_VOICEOVERIP = 104 +pkg syscall (freebsd-amd64-cgo), const IFT_X213 = 93 +pkg syscall (freebsd-amd64-cgo), const IFT_X25 = 5 +pkg syscall (freebsd-amd64-cgo), const IFT_X25DDN = 4 +pkg syscall (freebsd-amd64-cgo), const IFT_X25HUNTGROUP = 122 +pkg syscall (freebsd-amd64-cgo), const IFT_X25MLP = 121 +pkg syscall (freebsd-amd64-cgo), const IFT_X25PLE = 40 +pkg syscall (freebsd-amd64-cgo), const IFT_XETHER = 26 +pkg syscall (freebsd-amd64-cgo), const IGNBRK = 1 +pkg syscall (freebsd-amd64-cgo), const IGNCR = 128 +pkg syscall (freebsd-amd64-cgo), const IGNPAR = 4 +pkg syscall (freebsd-amd64-cgo), const IMAXBEL = 8192 +pkg syscall (freebsd-amd64-cgo), const INLCR = 64 +pkg syscall (freebsd-amd64-cgo), const INPCK = 16 +pkg syscall (freebsd-amd64-cgo), const IN_CLASSA_HOST = 16777215 +pkg syscall (freebsd-amd64-cgo), const IN_CLASSA_MAX = 128 +pkg syscall (freebsd-amd64-cgo), const IN_CLASSA_NET = 4278190080 +pkg syscall (freebsd-amd64-cgo), const IN_CLASSA_NSHIFT = 24 +pkg syscall (freebsd-amd64-cgo), const IN_CLASSB_HOST = 65535 +pkg syscall (freebsd-amd64-cgo), const IN_CLASSB_MAX = 65536 +pkg syscall (freebsd-amd64-cgo), const IN_CLASSB_NET = 4294901760 +pkg syscall (freebsd-amd64-cgo), const IN_CLASSB_NSHIFT = 16 +pkg syscall (freebsd-amd64-cgo), const IN_CLASSC_HOST = 255 +pkg syscall (freebsd-amd64-cgo), const IN_CLASSC_NET = 4294967040 +pkg syscall (freebsd-amd64-cgo), const IN_CLASSC_NSHIFT = 8 +pkg syscall (freebsd-amd64-cgo), const IN_CLASSD_HOST = 268435455 +pkg syscall (freebsd-amd64-cgo), const IN_CLASSD_NET = 4026531840 +pkg syscall (freebsd-amd64-cgo), const IN_CLASSD_NSHIFT = 28 +pkg syscall (freebsd-amd64-cgo), const IN_LOOPBACKNET = 127 +pkg syscall (freebsd-amd64-cgo), const IN_RFC3021_MASK = 4294967294 +pkg syscall (freebsd-amd64-cgo), const IPPROTO_3PC = 34 +pkg syscall (freebsd-amd64-cgo), const IPPROTO_ADFS = 68 +pkg syscall (freebsd-amd64-cgo), const IPPROTO_AH = 51 +pkg syscall (freebsd-amd64-cgo), const IPPROTO_AHIP = 61 +pkg syscall (freebsd-amd64-cgo), const IPPROTO_APES = 99 +pkg syscall (freebsd-amd64-cgo), const IPPROTO_ARGUS = 13 +pkg syscall (freebsd-amd64-cgo), const IPPROTO_AX25 = 93 +pkg syscall (freebsd-amd64-cgo), const IPPROTO_BHA = 49 +pkg syscall (freebsd-amd64-cgo), const IPPROTO_BLT = 30 +pkg syscall (freebsd-amd64-cgo), const IPPROTO_BRSATMON = 76 +pkg syscall (freebsd-amd64-cgo), const IPPROTO_CARP = 112 +pkg syscall (freebsd-amd64-cgo), const IPPROTO_CFTP = 62 +pkg syscall (freebsd-amd64-cgo), const IPPROTO_CHAOS = 16 +pkg syscall (freebsd-amd64-cgo), const IPPROTO_CMTP = 38 +pkg syscall (freebsd-amd64-cgo), const IPPROTO_CPHB = 73 +pkg syscall (freebsd-amd64-cgo), const IPPROTO_CPNX = 72 +pkg syscall (freebsd-amd64-cgo), const IPPROTO_DDP = 37 +pkg syscall (freebsd-amd64-cgo), const IPPROTO_DGP = 86 +pkg syscall (freebsd-amd64-cgo), const IPPROTO_DIVERT = 258 +pkg syscall (freebsd-amd64-cgo), const IPPROTO_DONE = 257 +pkg syscall (freebsd-amd64-cgo), const IPPROTO_DSTOPTS = 60 +pkg syscall (freebsd-amd64-cgo), const IPPROTO_EGP = 8 +pkg syscall (freebsd-amd64-cgo), const IPPROTO_EMCON = 14 +pkg syscall (freebsd-amd64-cgo), const IPPROTO_ENCAP = 98 +pkg syscall (freebsd-amd64-cgo), const IPPROTO_EON = 80 +pkg syscall (freebsd-amd64-cgo), const IPPROTO_ESP = 50 +pkg syscall (freebsd-amd64-cgo), const IPPROTO_ETHERIP = 97 +pkg syscall (freebsd-amd64-cgo), const IPPROTO_FRAGMENT = 44 +pkg syscall (freebsd-amd64-cgo), const IPPROTO_GGP = 3 +pkg syscall (freebsd-amd64-cgo), const IPPROTO_GMTP = 100 +pkg syscall (freebsd-amd64-cgo), const IPPROTO_GRE = 47 +pkg syscall (freebsd-amd64-cgo), const IPPROTO_HELLO = 63 +pkg syscall (freebsd-amd64-cgo), const IPPROTO_HMP = 20 +pkg syscall (freebsd-amd64-cgo), const IPPROTO_HOPOPTS = 0 +pkg syscall (freebsd-amd64-cgo), const IPPROTO_ICMP = 1 +pkg syscall (freebsd-amd64-cgo), const IPPROTO_ICMPV6 = 58 +pkg syscall (freebsd-amd64-cgo), const IPPROTO_IDP = 22 +pkg syscall (freebsd-amd64-cgo), const IPPROTO_IDPR = 35 +pkg syscall (freebsd-amd64-cgo), const IPPROTO_IDRP = 45 +pkg syscall (freebsd-amd64-cgo), const IPPROTO_IGMP = 2 +pkg syscall (freebsd-amd64-cgo), const IPPROTO_IGP = 85 +pkg syscall (freebsd-amd64-cgo), const IPPROTO_IGRP = 88 +pkg syscall (freebsd-amd64-cgo), const IPPROTO_IL = 40 +pkg syscall (freebsd-amd64-cgo), const IPPROTO_INLSP = 52 +pkg syscall (freebsd-amd64-cgo), const IPPROTO_INP = 32 +pkg syscall (freebsd-amd64-cgo), const IPPROTO_IPCOMP = 108 +pkg syscall (freebsd-amd64-cgo), const IPPROTO_IPCV = 71 +pkg syscall (freebsd-amd64-cgo), const IPPROTO_IPEIP = 94 +pkg syscall (freebsd-amd64-cgo), const IPPROTO_IPIP = 4 +pkg syscall (freebsd-amd64-cgo), const IPPROTO_IPPC = 67 +pkg syscall (freebsd-amd64-cgo), const IPPROTO_IPV4 = 4 +pkg syscall (freebsd-amd64-cgo), const IPPROTO_IRTP = 28 +pkg syscall (freebsd-amd64-cgo), const IPPROTO_KRYPTOLAN = 65 +pkg syscall (freebsd-amd64-cgo), const IPPROTO_LARP = 91 +pkg syscall (freebsd-amd64-cgo), const IPPROTO_LEAF1 = 25 +pkg syscall (freebsd-amd64-cgo), const IPPROTO_LEAF2 = 26 +pkg syscall (freebsd-amd64-cgo), const IPPROTO_MAX = 256 +pkg syscall (freebsd-amd64-cgo), const IPPROTO_MAXID = 52 +pkg syscall (freebsd-amd64-cgo), const IPPROTO_MEAS = 19 +pkg syscall (freebsd-amd64-cgo), const IPPROTO_MH = 135 +pkg syscall (freebsd-amd64-cgo), const IPPROTO_MHRP = 48 +pkg syscall (freebsd-amd64-cgo), const IPPROTO_MICP = 95 +pkg syscall (freebsd-amd64-cgo), const IPPROTO_MOBILE = 55 +pkg syscall (freebsd-amd64-cgo), const IPPROTO_MTP = 92 +pkg syscall (freebsd-amd64-cgo), const IPPROTO_MUX = 18 +pkg syscall (freebsd-amd64-cgo), const IPPROTO_ND = 77 +pkg syscall (freebsd-amd64-cgo), const IPPROTO_NHRP = 54 +pkg syscall (freebsd-amd64-cgo), const IPPROTO_NONE = 59 +pkg syscall (freebsd-amd64-cgo), const IPPROTO_NSP = 31 +pkg syscall (freebsd-amd64-cgo), const IPPROTO_NVPII = 11 +pkg syscall (freebsd-amd64-cgo), const IPPROTO_OLD_DIVERT = 254 +pkg syscall (freebsd-amd64-cgo), const IPPROTO_OSPFIGP = 89 +pkg syscall (freebsd-amd64-cgo), const IPPROTO_PFSYNC = 240 +pkg syscall (freebsd-amd64-cgo), const IPPROTO_PGM = 113 +pkg syscall (freebsd-amd64-cgo), const IPPROTO_PIGP = 9 +pkg syscall (freebsd-amd64-cgo), const IPPROTO_PIM = 103 +pkg syscall (freebsd-amd64-cgo), const IPPROTO_PRM = 21 +pkg syscall (freebsd-amd64-cgo), const IPPROTO_PUP = 12 +pkg syscall (freebsd-amd64-cgo), const IPPROTO_PVP = 75 +pkg syscall (freebsd-amd64-cgo), const IPPROTO_RAW = 255 +pkg syscall (freebsd-amd64-cgo), const IPPROTO_RCCMON = 10 +pkg syscall (freebsd-amd64-cgo), const IPPROTO_RDP = 27 +pkg syscall (freebsd-amd64-cgo), const IPPROTO_ROUTING = 43 +pkg syscall (freebsd-amd64-cgo), const IPPROTO_RSVP = 46 +pkg syscall (freebsd-amd64-cgo), const IPPROTO_RVD = 66 +pkg syscall (freebsd-amd64-cgo), const IPPROTO_SATEXPAK = 64 +pkg syscall (freebsd-amd64-cgo), const IPPROTO_SATMON = 69 +pkg syscall (freebsd-amd64-cgo), const IPPROTO_SCCSP = 96 +pkg syscall (freebsd-amd64-cgo), const IPPROTO_SCTP = 132 +pkg syscall (freebsd-amd64-cgo), const IPPROTO_SDRP = 42 +pkg syscall (freebsd-amd64-cgo), const IPPROTO_SEND = 259 +pkg syscall (freebsd-amd64-cgo), const IPPROTO_SEP = 33 +pkg syscall (freebsd-amd64-cgo), const IPPROTO_SKIP = 57 +pkg syscall (freebsd-amd64-cgo), const IPPROTO_SPACER = 32767 +pkg syscall (freebsd-amd64-cgo), const IPPROTO_SRPC = 90 +pkg syscall (freebsd-amd64-cgo), const IPPROTO_ST = 7 +pkg syscall (freebsd-amd64-cgo), const IPPROTO_SVMTP = 82 +pkg syscall (freebsd-amd64-cgo), const IPPROTO_SWIPE = 53 +pkg syscall (freebsd-amd64-cgo), const IPPROTO_TCF = 87 +pkg syscall (freebsd-amd64-cgo), const IPPROTO_TLSP = 56 +pkg syscall (freebsd-amd64-cgo), const IPPROTO_TP = 29 +pkg syscall (freebsd-amd64-cgo), const IPPROTO_TPXX = 39 +pkg syscall (freebsd-amd64-cgo), const IPPROTO_TRUNK1 = 23 +pkg syscall (freebsd-amd64-cgo), const IPPROTO_TRUNK2 = 24 +pkg syscall (freebsd-amd64-cgo), const IPPROTO_TTP = 84 +pkg syscall (freebsd-amd64-cgo), const IPPROTO_VINES = 83 +pkg syscall (freebsd-amd64-cgo), const IPPROTO_VISA = 70 +pkg syscall (freebsd-amd64-cgo), const IPPROTO_VMTP = 81 +pkg syscall (freebsd-amd64-cgo), const IPPROTO_WBEXPAK = 79 +pkg syscall (freebsd-amd64-cgo), const IPPROTO_WBMON = 78 +pkg syscall (freebsd-amd64-cgo), const IPPROTO_WSN = 74 +pkg syscall (freebsd-amd64-cgo), const IPPROTO_XNET = 15 +pkg syscall (freebsd-amd64-cgo), const IPPROTO_XTP = 36 +pkg syscall (freebsd-amd64-cgo), const IPV6_AUTOFLOWLABEL = 59 +pkg syscall (freebsd-amd64-cgo), const IPV6_BINDANY = 64 +pkg syscall (freebsd-amd64-cgo), const IPV6_BINDV6ONLY = 27 +pkg syscall (freebsd-amd64-cgo), const IPV6_CHECKSUM = 26 +pkg syscall (freebsd-amd64-cgo), const IPV6_DEFAULT_MULTICAST_HOPS = 1 +pkg syscall (freebsd-amd64-cgo), const IPV6_DEFAULT_MULTICAST_LOOP = 1 +pkg syscall (freebsd-amd64-cgo), const IPV6_DEFHLIM = 64 +pkg syscall (freebsd-amd64-cgo), const IPV6_DONTFRAG = 62 +pkg syscall (freebsd-amd64-cgo), const IPV6_DSTOPTS = 50 +pkg syscall (freebsd-amd64-cgo), const IPV6_FAITH = 29 +pkg syscall (freebsd-amd64-cgo), const IPV6_FLOWINFO_MASK = 4294967055 +pkg syscall (freebsd-amd64-cgo), const IPV6_FLOWLABEL_MASK = 4294905600 +pkg syscall (freebsd-amd64-cgo), const IPV6_FRAGTTL = 120 +pkg syscall (freebsd-amd64-cgo), const IPV6_FW_ADD = 30 +pkg syscall (freebsd-amd64-cgo), const IPV6_FW_DEL = 31 +pkg syscall (freebsd-amd64-cgo), const IPV6_FW_FLUSH = 32 +pkg syscall (freebsd-amd64-cgo), const IPV6_FW_GET = 34 +pkg syscall (freebsd-amd64-cgo), const IPV6_FW_ZERO = 33 +pkg syscall (freebsd-amd64-cgo), const IPV6_HLIMDEC = 1 +pkg syscall (freebsd-amd64-cgo), const IPV6_HOPLIMIT = 47 +pkg syscall (freebsd-amd64-cgo), const IPV6_HOPOPTS = 49 +pkg syscall (freebsd-amd64-cgo), const IPV6_IPSEC_POLICY = 28 +pkg syscall (freebsd-amd64-cgo), const IPV6_JOIN_GROUP = 12 +pkg syscall (freebsd-amd64-cgo), const IPV6_LEAVE_GROUP = 13 +pkg syscall (freebsd-amd64-cgo), const IPV6_MAXHLIM = 255 +pkg syscall (freebsd-amd64-cgo), const IPV6_MAXOPTHDR = 2048 +pkg syscall (freebsd-amd64-cgo), const IPV6_MAXPACKET = 65535 +pkg syscall (freebsd-amd64-cgo), const IPV6_MAX_GROUP_SRC_FILTER = 512 +pkg syscall (freebsd-amd64-cgo), const IPV6_MAX_MEMBERSHIPS = 4095 +pkg syscall (freebsd-amd64-cgo), const IPV6_MAX_SOCK_SRC_FILTER = 128 +pkg syscall (freebsd-amd64-cgo), const IPV6_MIN_MEMBERSHIPS = 31 +pkg syscall (freebsd-amd64-cgo), const IPV6_MMTU = 1280 +pkg syscall (freebsd-amd64-cgo), const IPV6_MSFILTER = 74 +pkg syscall (freebsd-amd64-cgo), const IPV6_MULTICAST_HOPS = 10 +pkg syscall (freebsd-amd64-cgo), const IPV6_MULTICAST_IF = 9 +pkg syscall (freebsd-amd64-cgo), const IPV6_MULTICAST_LOOP = 11 +pkg syscall (freebsd-amd64-cgo), const IPV6_NEXTHOP = 48 +pkg syscall (freebsd-amd64-cgo), const IPV6_PATHMTU = 44 +pkg syscall (freebsd-amd64-cgo), const IPV6_PKTINFO = 46 +pkg syscall (freebsd-amd64-cgo), const IPV6_PORTRANGE = 14 +pkg syscall (freebsd-amd64-cgo), const IPV6_PORTRANGE_DEFAULT = 0 +pkg syscall (freebsd-amd64-cgo), const IPV6_PORTRANGE_HIGH = 1 +pkg syscall (freebsd-amd64-cgo), const IPV6_PORTRANGE_LOW = 2 +pkg syscall (freebsd-amd64-cgo), const IPV6_PREFER_TEMPADDR = 63 +pkg syscall (freebsd-amd64-cgo), const IPV6_RECVDSTOPTS = 40 +pkg syscall (freebsd-amd64-cgo), const IPV6_RECVHOPLIMIT = 37 +pkg syscall (freebsd-amd64-cgo), const IPV6_RECVHOPOPTS = 39 +pkg syscall (freebsd-amd64-cgo), const IPV6_RECVPATHMTU = 43 +pkg syscall (freebsd-amd64-cgo), const IPV6_RECVPKTINFO = 36 +pkg syscall (freebsd-amd64-cgo), const IPV6_RECVRTHDR = 38 +pkg syscall (freebsd-amd64-cgo), const IPV6_RECVTCLASS = 57 +pkg syscall (freebsd-amd64-cgo), const IPV6_RTHDR = 51 +pkg syscall (freebsd-amd64-cgo), const IPV6_RTHDRDSTOPTS = 35 +pkg syscall (freebsd-amd64-cgo), const IPV6_RTHDR_LOOSE = 0 +pkg syscall (freebsd-amd64-cgo), const IPV6_RTHDR_STRICT = 1 +pkg syscall (freebsd-amd64-cgo), const IPV6_RTHDR_TYPE_0 = 0 +pkg syscall (freebsd-amd64-cgo), const IPV6_SOCKOPT_RESERVED1 = 3 +pkg syscall (freebsd-amd64-cgo), const IPV6_TCLASS = 61 +pkg syscall (freebsd-amd64-cgo), const IPV6_UNICAST_HOPS = 4 +pkg syscall (freebsd-amd64-cgo), const IPV6_USE_MIN_MTU = 42 +pkg syscall (freebsd-amd64-cgo), const IPV6_V6ONLY = 27 +pkg syscall (freebsd-amd64-cgo), const IPV6_VERSION = 96 +pkg syscall (freebsd-amd64-cgo), const IPV6_VERSION_MASK = 240 +pkg syscall (freebsd-amd64-cgo), const IP_ADD_MEMBERSHIP = 12 +pkg syscall (freebsd-amd64-cgo), const IP_ADD_SOURCE_MEMBERSHIP = 70 +pkg syscall (freebsd-amd64-cgo), const IP_BINDANY = 24 +pkg syscall (freebsd-amd64-cgo), const IP_BLOCK_SOURCE = 72 +pkg syscall (freebsd-amd64-cgo), const IP_DEFAULT_MULTICAST_LOOP = 1 +pkg syscall (freebsd-amd64-cgo), const IP_DEFAULT_MULTICAST_TTL = 1 +pkg syscall (freebsd-amd64-cgo), const IP_DF = 16384 +pkg syscall (freebsd-amd64-cgo), const IP_DONTFRAG = 67 +pkg syscall (freebsd-amd64-cgo), const IP_DROP_MEMBERSHIP = 13 +pkg syscall (freebsd-amd64-cgo), const IP_DROP_SOURCE_MEMBERSHIP = 71 +pkg syscall (freebsd-amd64-cgo), const IP_DUMMYNET3 = 49 +pkg syscall (freebsd-amd64-cgo), const IP_DUMMYNET_CONFIGURE = 60 +pkg syscall (freebsd-amd64-cgo), const IP_DUMMYNET_DEL = 61 +pkg syscall (freebsd-amd64-cgo), const IP_DUMMYNET_FLUSH = 62 +pkg syscall (freebsd-amd64-cgo), const IP_DUMMYNET_GET = 64 +pkg syscall (freebsd-amd64-cgo), const IP_FAITH = 22 +pkg syscall (freebsd-amd64-cgo), const IP_FW3 = 48 +pkg syscall (freebsd-amd64-cgo), const IP_FW_ADD = 50 +pkg syscall (freebsd-amd64-cgo), const IP_FW_DEL = 51 +pkg syscall (freebsd-amd64-cgo), const IP_FW_FLUSH = 52 +pkg syscall (freebsd-amd64-cgo), const IP_FW_GET = 54 +pkg syscall (freebsd-amd64-cgo), const IP_FW_NAT_CFG = 56 +pkg syscall (freebsd-amd64-cgo), const IP_FW_NAT_DEL = 57 +pkg syscall (freebsd-amd64-cgo), const IP_FW_NAT_GET_CONFIG = 58 +pkg syscall (freebsd-amd64-cgo), const IP_FW_NAT_GET_LOG = 59 +pkg syscall (freebsd-amd64-cgo), const IP_FW_RESETLOG = 55 +pkg syscall (freebsd-amd64-cgo), const IP_FW_TABLE_ADD = 40 +pkg syscall (freebsd-amd64-cgo), const IP_FW_TABLE_DEL = 41 +pkg syscall (freebsd-amd64-cgo), const IP_FW_TABLE_FLUSH = 42 +pkg syscall (freebsd-amd64-cgo), const IP_FW_TABLE_GETSIZE = 43 +pkg syscall (freebsd-amd64-cgo), const IP_FW_TABLE_LIST = 44 +pkg syscall (freebsd-amd64-cgo), const IP_FW_ZERO = 53 +pkg syscall (freebsd-amd64-cgo), const IP_HDRINCL = 2 +pkg syscall (freebsd-amd64-cgo), const IP_IPSEC_POLICY = 21 +pkg syscall (freebsd-amd64-cgo), const IP_MAXPACKET = 65535 +pkg syscall (freebsd-amd64-cgo), const IP_MAX_GROUP_SRC_FILTER = 512 +pkg syscall (freebsd-amd64-cgo), const IP_MAX_MEMBERSHIPS = 4095 +pkg syscall (freebsd-amd64-cgo), const IP_MAX_SOCK_MUTE_FILTER = 128 +pkg syscall (freebsd-amd64-cgo), const IP_MAX_SOCK_SRC_FILTER = 128 +pkg syscall (freebsd-amd64-cgo), const IP_MAX_SOURCE_FILTER = 1024 +pkg syscall (freebsd-amd64-cgo), const IP_MF = 8192 +pkg syscall (freebsd-amd64-cgo), const IP_MINTTL = 66 +pkg syscall (freebsd-amd64-cgo), const IP_MIN_MEMBERSHIPS = 31 +pkg syscall (freebsd-amd64-cgo), const IP_MSFILTER = 74 +pkg syscall (freebsd-amd64-cgo), const IP_MSS = 576 +pkg syscall (freebsd-amd64-cgo), const IP_MULTICAST_IF = 9 +pkg syscall (freebsd-amd64-cgo), const IP_MULTICAST_LOOP = 11 +pkg syscall (freebsd-amd64-cgo), const IP_MULTICAST_TTL = 10 +pkg syscall (freebsd-amd64-cgo), const IP_MULTICAST_VIF = 14 +pkg syscall (freebsd-amd64-cgo), const IP_OFFMASK = 8191 +pkg syscall (freebsd-amd64-cgo), const IP_ONESBCAST = 23 +pkg syscall (freebsd-amd64-cgo), const IP_OPTIONS = 1 +pkg syscall (freebsd-amd64-cgo), const IP_PORTRANGE = 19 +pkg syscall (freebsd-amd64-cgo), const IP_PORTRANGE_DEFAULT = 0 +pkg syscall (freebsd-amd64-cgo), const IP_PORTRANGE_HIGH = 1 +pkg syscall (freebsd-amd64-cgo), const IP_PORTRANGE_LOW = 2 +pkg syscall (freebsd-amd64-cgo), const IP_RECVDSTADDR = 7 +pkg syscall (freebsd-amd64-cgo), const IP_RECVIF = 20 +pkg syscall (freebsd-amd64-cgo), const IP_RECVOPTS = 5 +pkg syscall (freebsd-amd64-cgo), const IP_RECVRETOPTS = 6 +pkg syscall (freebsd-amd64-cgo), const IP_RECVTOS = 68 +pkg syscall (freebsd-amd64-cgo), const IP_RECVTTL = 65 +pkg syscall (freebsd-amd64-cgo), const IP_RETOPTS = 8 +pkg syscall (freebsd-amd64-cgo), const IP_RF = 32768 +pkg syscall (freebsd-amd64-cgo), const IP_RSVP_OFF = 16 +pkg syscall (freebsd-amd64-cgo), const IP_RSVP_ON = 15 +pkg syscall (freebsd-amd64-cgo), const IP_RSVP_VIF_OFF = 18 +pkg syscall (freebsd-amd64-cgo), const IP_RSVP_VIF_ON = 17 +pkg syscall (freebsd-amd64-cgo), const IP_SENDSRCADDR = 7 +pkg syscall (freebsd-amd64-cgo), const IP_TOS = 3 +pkg syscall (freebsd-amd64-cgo), const IP_TTL = 4 +pkg syscall (freebsd-amd64-cgo), const IP_UNBLOCK_SOURCE = 73 +pkg syscall (freebsd-amd64-cgo), const ISIG = 128 +pkg syscall (freebsd-amd64-cgo), const ISTRIP = 32 +pkg syscall (freebsd-amd64-cgo), const IXANY = 2048 +pkg syscall (freebsd-amd64-cgo), const IXOFF = 1024 +pkg syscall (freebsd-amd64-cgo), const IXON = 512 +pkg syscall (freebsd-amd64-cgo), const ImplementsGetwd = false +pkg syscall (freebsd-amd64-cgo), const LOCK_EX = 2 +pkg syscall (freebsd-amd64-cgo), const LOCK_NB = 4 +pkg syscall (freebsd-amd64-cgo), const LOCK_SH = 1 +pkg syscall (freebsd-amd64-cgo), const LOCK_UN = 8 +pkg syscall (freebsd-amd64-cgo), const MADV_AUTOSYNC = 7 +pkg syscall (freebsd-amd64-cgo), const MADV_CORE = 9 +pkg syscall (freebsd-amd64-cgo), const MADV_DONTNEED = 4 +pkg syscall (freebsd-amd64-cgo), const MADV_FREE = 5 +pkg syscall (freebsd-amd64-cgo), const MADV_NOCORE = 8 +pkg syscall (freebsd-amd64-cgo), const MADV_NORMAL = 0 +pkg syscall (freebsd-amd64-cgo), const MADV_NOSYNC = 6 +pkg syscall (freebsd-amd64-cgo), const MADV_PROTECT = 10 +pkg syscall (freebsd-amd64-cgo), const MADV_RANDOM = 1 +pkg syscall (freebsd-amd64-cgo), const MADV_SEQUENTIAL = 2 +pkg syscall (freebsd-amd64-cgo), const MADV_WILLNEED = 3 +pkg syscall (freebsd-amd64-cgo), const MAP_ANON = 4096 +pkg syscall (freebsd-amd64-cgo), const MAP_ANONYMOUS = 4096 +pkg syscall (freebsd-amd64-cgo), const MAP_COPY = 2 +pkg syscall (freebsd-amd64-cgo), const MAP_FILE = 0 +pkg syscall (freebsd-amd64-cgo), const MAP_FIXED = 16 +pkg syscall (freebsd-amd64-cgo), const MAP_HASSEMAPHORE = 512 +pkg syscall (freebsd-amd64-cgo), const MAP_NOCORE = 131072 +pkg syscall (freebsd-amd64-cgo), const MAP_NORESERVE = 64 +pkg syscall (freebsd-amd64-cgo), const MAP_NOSYNC = 2048 +pkg syscall (freebsd-amd64-cgo), const MAP_PREFAULT_READ = 262144 +pkg syscall (freebsd-amd64-cgo), const MAP_PRIVATE = 2 +pkg syscall (freebsd-amd64-cgo), const MAP_RENAME = 32 +pkg syscall (freebsd-amd64-cgo), const MAP_RESERVED0080 = 128 +pkg syscall (freebsd-amd64-cgo), const MAP_RESERVED0100 = 256 +pkg syscall (freebsd-amd64-cgo), const MAP_SHARED = 1 +pkg syscall (freebsd-amd64-cgo), const MAP_STACK = 1024 +pkg syscall (freebsd-amd64-cgo), const MCL_CURRENT = 1 +pkg syscall (freebsd-amd64-cgo), const MCL_FUTURE = 2 +pkg syscall (freebsd-amd64-cgo), const MSG_COMPAT = 32768 +pkg syscall (freebsd-amd64-cgo), const MSG_CTRUNC = 32 +pkg syscall (freebsd-amd64-cgo), const MSG_DONTROUTE = 4 +pkg syscall (freebsd-amd64-cgo), const MSG_DONTWAIT = 128 +pkg syscall (freebsd-amd64-cgo), const MSG_EOF = 256 +pkg syscall (freebsd-amd64-cgo), const MSG_EOR = 8 +pkg syscall (freebsd-amd64-cgo), const MSG_NBIO = 16384 +pkg syscall (freebsd-amd64-cgo), const MSG_NOSIGNAL = 131072 +pkg syscall (freebsd-amd64-cgo), const MSG_NOTIFICATION = 8192 +pkg syscall (freebsd-amd64-cgo), const MSG_OOB = 1 +pkg syscall (freebsd-amd64-cgo), const MSG_PEEK = 2 +pkg syscall (freebsd-amd64-cgo), const MSG_TRUNC = 16 +pkg syscall (freebsd-amd64-cgo), const MSG_WAITALL = 64 +pkg syscall (freebsd-amd64-cgo), const MS_ASYNC = 1 +pkg syscall (freebsd-amd64-cgo), const MS_INVALIDATE = 2 +pkg syscall (freebsd-amd64-cgo), const MS_SYNC = 0 +pkg syscall (freebsd-amd64-cgo), const NET_RT_DUMP = 1 +pkg syscall (freebsd-amd64-cgo), const NET_RT_FLAGS = 2 +pkg syscall (freebsd-amd64-cgo), const NET_RT_IFLIST = 3 +pkg syscall (freebsd-amd64-cgo), const NET_RT_IFLISTL = 5 +pkg syscall (freebsd-amd64-cgo), const NET_RT_IFMALIST = 4 +pkg syscall (freebsd-amd64-cgo), const NET_RT_MAXID = 6 +pkg syscall (freebsd-amd64-cgo), const NOFLSH = 2147483648 +pkg syscall (freebsd-amd64-cgo), const NOTE_ATTRIB = 8 +pkg syscall (freebsd-amd64-cgo), const NOTE_CHILD = 4 +pkg syscall (freebsd-amd64-cgo), const NOTE_DELETE = 1 +pkg syscall (freebsd-amd64-cgo), const NOTE_EXEC = 536870912 +pkg syscall (freebsd-amd64-cgo), const NOTE_EXIT = 2147483648 +pkg syscall (freebsd-amd64-cgo), const NOTE_EXTEND = 4 +pkg syscall (freebsd-amd64-cgo), const NOTE_FFAND = 1073741824 +pkg syscall (freebsd-amd64-cgo), const NOTE_FFCOPY = 3221225472 +pkg syscall (freebsd-amd64-cgo), const NOTE_FFCTRLMASK = 3221225472 +pkg syscall (freebsd-amd64-cgo), const NOTE_FFLAGSMASK = 16777215 +pkg syscall (freebsd-amd64-cgo), const NOTE_FFNOP = 0 +pkg syscall (freebsd-amd64-cgo), const NOTE_FFOR = 2147483648 +pkg syscall (freebsd-amd64-cgo), const NOTE_FORK = 1073741824 +pkg syscall (freebsd-amd64-cgo), const NOTE_LINK = 16 +pkg syscall (freebsd-amd64-cgo), const NOTE_LOWAT = 1 +pkg syscall (freebsd-amd64-cgo), const NOTE_PCTRLMASK = 4026531840 +pkg syscall (freebsd-amd64-cgo), const NOTE_PDATAMASK = 1048575 +pkg syscall (freebsd-amd64-cgo), const NOTE_RENAME = 32 +pkg syscall (freebsd-amd64-cgo), const NOTE_REVOKE = 64 +pkg syscall (freebsd-amd64-cgo), const NOTE_TRACK = 1 +pkg syscall (freebsd-amd64-cgo), const NOTE_TRACKERR = 2 +pkg syscall (freebsd-amd64-cgo), const NOTE_TRIGGER = 16777216 +pkg syscall (freebsd-amd64-cgo), const NOTE_WRITE = 2 +pkg syscall (freebsd-amd64-cgo), const OCRNL = 16 +pkg syscall (freebsd-amd64-cgo), const ONLCR = 2 +pkg syscall (freebsd-amd64-cgo), const ONLRET = 64 +pkg syscall (freebsd-amd64-cgo), const ONOCR = 32 +pkg syscall (freebsd-amd64-cgo), const ONOEOT = 8 +pkg syscall (freebsd-amd64-cgo), const OPOST = 1 +pkg syscall (freebsd-amd64-cgo), const O_ACCMODE = 3 +pkg syscall (freebsd-amd64-cgo), const O_APPEND = 8 +pkg syscall (freebsd-amd64-cgo), const O_ASYNC = 64 +pkg syscall (freebsd-amd64-cgo), const O_CLOEXEC = 0 +pkg syscall (freebsd-amd64-cgo), const O_CREAT = 512 +pkg syscall (freebsd-amd64-cgo), const O_DIRECT = 65536 +pkg syscall (freebsd-amd64-cgo), const O_DIRECTORY = 131072 +pkg syscall (freebsd-amd64-cgo), const O_EXCL = 2048 +pkg syscall (freebsd-amd64-cgo), const O_EXEC = 262144 +pkg syscall (freebsd-amd64-cgo), const O_EXLOCK = 32 +pkg syscall (freebsd-amd64-cgo), const O_FSYNC = 128 +pkg syscall (freebsd-amd64-cgo), const O_NDELAY = 4 +pkg syscall (freebsd-amd64-cgo), const O_NOCTTY = 32768 +pkg syscall (freebsd-amd64-cgo), const O_NOFOLLOW = 256 +pkg syscall (freebsd-amd64-cgo), const O_NONBLOCK = 4 +pkg syscall (freebsd-amd64-cgo), const O_SHLOCK = 16 +pkg syscall (freebsd-amd64-cgo), const O_SYNC = 128 +pkg syscall (freebsd-amd64-cgo), const O_TRUNC = 1024 +pkg syscall (freebsd-amd64-cgo), const O_TTY_INIT = 524288 +pkg syscall (freebsd-amd64-cgo), const PARENB = 4096 +pkg syscall (freebsd-amd64-cgo), const PARMRK = 8 +pkg syscall (freebsd-amd64-cgo), const PARODD = 8192 +pkg syscall (freebsd-amd64-cgo), const PENDIN = 536870912 +pkg syscall (freebsd-amd64-cgo), const PROT_EXEC = 4 +pkg syscall (freebsd-amd64-cgo), const PROT_NONE = 0 +pkg syscall (freebsd-amd64-cgo), const PROT_READ = 1 +pkg syscall (freebsd-amd64-cgo), const PROT_WRITE = 2 +pkg syscall (freebsd-amd64-cgo), const PTRACE_CONT = 7 +pkg syscall (freebsd-amd64-cgo), const PTRACE_KILL = 8 +pkg syscall (freebsd-amd64-cgo), const PTRACE_TRACEME = 0 +pkg syscall (freebsd-amd64-cgo), const RLIMIT_AS = 10 +pkg syscall (freebsd-amd64-cgo), const RLIMIT_CORE = 4 +pkg syscall (freebsd-amd64-cgo), const RLIMIT_CPU = 0 +pkg syscall (freebsd-amd64-cgo), const RLIMIT_DATA = 2 +pkg syscall (freebsd-amd64-cgo), const RLIMIT_FSIZE = 1 +pkg syscall (freebsd-amd64-cgo), const RLIMIT_NOFILE = 8 +pkg syscall (freebsd-amd64-cgo), const RLIMIT_STACK = 3 +pkg syscall (freebsd-amd64-cgo), const RLIM_INFINITY = 9223372036854775807 +pkg syscall (freebsd-amd64-cgo), const RTAX_AUTHOR = 6 +pkg syscall (freebsd-amd64-cgo), const RTAX_BRD = 7 +pkg syscall (freebsd-amd64-cgo), const RTAX_DST = 0 +pkg syscall (freebsd-amd64-cgo), const RTAX_GATEWAY = 1 +pkg syscall (freebsd-amd64-cgo), const RTAX_GENMASK = 3 +pkg syscall (freebsd-amd64-cgo), const RTAX_IFA = 5 +pkg syscall (freebsd-amd64-cgo), const RTAX_IFP = 4 +pkg syscall (freebsd-amd64-cgo), const RTAX_MAX = 8 +pkg syscall (freebsd-amd64-cgo), const RTAX_NETMASK = 2 +pkg syscall (freebsd-amd64-cgo), const RTA_AUTHOR = 64 +pkg syscall (freebsd-amd64-cgo), const RTA_BRD = 128 +pkg syscall (freebsd-amd64-cgo), const RTA_DST = 1 +pkg syscall (freebsd-amd64-cgo), const RTA_GATEWAY = 2 +pkg syscall (freebsd-amd64-cgo), const RTA_GENMASK = 8 +pkg syscall (freebsd-amd64-cgo), const RTA_IFA = 32 +pkg syscall (freebsd-amd64-cgo), const RTA_IFP = 16 +pkg syscall (freebsd-amd64-cgo), const RTA_NETMASK = 4 +pkg syscall (freebsd-amd64-cgo), const RTF_BLACKHOLE = 4096 +pkg syscall (freebsd-amd64-cgo), const RTF_BROADCAST = 4194304 +pkg syscall (freebsd-amd64-cgo), const RTF_DONE = 64 +pkg syscall (freebsd-amd64-cgo), const RTF_DYNAMIC = 16 +pkg syscall (freebsd-amd64-cgo), const RTF_FMASK = 268752904 +pkg syscall (freebsd-amd64-cgo), const RTF_GATEWAY = 2 +pkg syscall (freebsd-amd64-cgo), const RTF_HOST = 4 +pkg syscall (freebsd-amd64-cgo), const RTF_LLDATA = 1024 +pkg syscall (freebsd-amd64-cgo), const RTF_LLINFO = 1024 +pkg syscall (freebsd-amd64-cgo), const RTF_LOCAL = 2097152 +pkg syscall (freebsd-amd64-cgo), const RTF_MODIFIED = 32 +pkg syscall (freebsd-amd64-cgo), const RTF_MULTICAST = 8388608 +pkg syscall (freebsd-amd64-cgo), const RTF_PINNED = 1048576 +pkg syscall (freebsd-amd64-cgo), const RTF_PRCLONING = 65536 +pkg syscall (freebsd-amd64-cgo), const RTF_PROTO1 = 32768 +pkg syscall (freebsd-amd64-cgo), const RTF_PROTO2 = 16384 +pkg syscall (freebsd-amd64-cgo), const RTF_PROTO3 = 262144 +pkg syscall (freebsd-amd64-cgo), const RTF_REJECT = 8 +pkg syscall (freebsd-amd64-cgo), const RTF_RNH_LOCKED = 1073741824 +pkg syscall (freebsd-amd64-cgo), const RTF_STATIC = 2048 +pkg syscall (freebsd-amd64-cgo), const RTF_STICKY = 268435456 +pkg syscall (freebsd-amd64-cgo), const RTF_UP = 1 +pkg syscall (freebsd-amd64-cgo), const RTF_XRESOLVE = 512 +pkg syscall (freebsd-amd64-cgo), const RTM_ADD = 1 +pkg syscall (freebsd-amd64-cgo), const RTM_CHANGE = 3 +pkg syscall (freebsd-amd64-cgo), const RTM_DELADDR = 13 +pkg syscall (freebsd-amd64-cgo), const RTM_DELETE = 2 +pkg syscall (freebsd-amd64-cgo), const RTM_DELMADDR = 16 +pkg syscall (freebsd-amd64-cgo), const RTM_GET = 4 +pkg syscall (freebsd-amd64-cgo), const RTM_IEEE80211 = 18 +pkg syscall (freebsd-amd64-cgo), const RTM_IFANNOUNCE = 17 +pkg syscall (freebsd-amd64-cgo), const RTM_IFINFO = 14 +pkg syscall (freebsd-amd64-cgo), const RTM_LOCK = 8 +pkg syscall (freebsd-amd64-cgo), const RTM_LOSING = 5 +pkg syscall (freebsd-amd64-cgo), const RTM_MISS = 7 +pkg syscall (freebsd-amd64-cgo), const RTM_NEWADDR = 12 +pkg syscall (freebsd-amd64-cgo), const RTM_NEWMADDR = 15 +pkg syscall (freebsd-amd64-cgo), const RTM_OLDADD = 9 +pkg syscall (freebsd-amd64-cgo), const RTM_OLDDEL = 10 +pkg syscall (freebsd-amd64-cgo), const RTM_REDIRECT = 6 +pkg syscall (freebsd-amd64-cgo), const RTM_RESOLVE = 11 +pkg syscall (freebsd-amd64-cgo), const RTM_RTTUNIT = 1000000 +pkg syscall (freebsd-amd64-cgo), const RTM_VERSION = 5 +pkg syscall (freebsd-amd64-cgo), const RTV_EXPIRE = 4 +pkg syscall (freebsd-amd64-cgo), const RTV_HOPCOUNT = 2 +pkg syscall (freebsd-amd64-cgo), const RTV_MTU = 1 +pkg syscall (freebsd-amd64-cgo), const RTV_RPIPE = 8 +pkg syscall (freebsd-amd64-cgo), const RTV_RTT = 64 +pkg syscall (freebsd-amd64-cgo), const RTV_RTTVAR = 128 +pkg syscall (freebsd-amd64-cgo), const RTV_SPIPE = 16 +pkg syscall (freebsd-amd64-cgo), const RTV_SSTHRESH = 32 +pkg syscall (freebsd-amd64-cgo), const RTV_WEIGHT = 256 +pkg syscall (freebsd-amd64-cgo), const RT_CACHING_CONTEXT = 1 +pkg syscall (freebsd-amd64-cgo), const RT_DEFAULT_FIB = 0 +pkg syscall (freebsd-amd64-cgo), const RUSAGE_CHILDREN = -1 +pkg syscall (freebsd-amd64-cgo), const RUSAGE_SELF = 0 +pkg syscall (freebsd-amd64-cgo), const RUSAGE_THREAD = 1 +pkg syscall (freebsd-amd64-cgo), const SCM_BINTIME = 4 +pkg syscall (freebsd-amd64-cgo), const SCM_CREDS = 3 +pkg syscall (freebsd-amd64-cgo), const SCM_RIGHTS = 1 +pkg syscall (freebsd-amd64-cgo), const SCM_TIMESTAMP = 2 +pkg syscall (freebsd-amd64-cgo), const SIGBUS = 10 +pkg syscall (freebsd-amd64-cgo), const SIGCHLD = 20 +pkg syscall (freebsd-amd64-cgo), const SIGCONT = 19 +pkg syscall (freebsd-amd64-cgo), const SIGEMT = 7 +pkg syscall (freebsd-amd64-cgo), const SIGINFO = 29 +pkg syscall (freebsd-amd64-cgo), const SIGIO = 23 +pkg syscall (freebsd-amd64-cgo), const SIGIOT = 6 +pkg syscall (freebsd-amd64-cgo), const SIGLWP = 32 +pkg syscall (freebsd-amd64-cgo), const SIGPROF = 27 +pkg syscall (freebsd-amd64-cgo), const SIGSTOP = 17 +pkg syscall (freebsd-amd64-cgo), const SIGSYS = 12 +pkg syscall (freebsd-amd64-cgo), const SIGTHR = 32 +pkg syscall (freebsd-amd64-cgo), const SIGTSTP = 18 +pkg syscall (freebsd-amd64-cgo), const SIGTTIN = 21 +pkg syscall (freebsd-amd64-cgo), const SIGTTOU = 22 +pkg syscall (freebsd-amd64-cgo), const SIGURG = 16 +pkg syscall (freebsd-amd64-cgo), const SIGUSR1 = 30 +pkg syscall (freebsd-amd64-cgo), const SIGUSR2 = 31 +pkg syscall (freebsd-amd64-cgo), const SIGVTALRM = 26 +pkg syscall (freebsd-amd64-cgo), const SIGWINCH = 28 +pkg syscall (freebsd-amd64-cgo), const SIGXCPU = 24 +pkg syscall (freebsd-amd64-cgo), const SIGXFSZ = 25 +pkg syscall (freebsd-amd64-cgo), const SIOCADDMULTI = 2149607729 +pkg syscall (freebsd-amd64-cgo), const SIOCADDRT = 2151707146 +pkg syscall (freebsd-amd64-cgo), const SIOCAIFADDR = 2151704858 +pkg syscall (freebsd-amd64-cgo), const SIOCAIFGROUP = 2150132103 +pkg syscall (freebsd-amd64-cgo), const SIOCALIFADDR = 2165860635 +pkg syscall (freebsd-amd64-cgo), const SIOCATMARK = 1074033415 +pkg syscall (freebsd-amd64-cgo), const SIOCDELMULTI = 2149607730 +pkg syscall (freebsd-amd64-cgo), const SIOCDELRT = 2151707147 +pkg syscall (freebsd-amd64-cgo), const SIOCDIFADDR = 2149607705 +pkg syscall (freebsd-amd64-cgo), const SIOCDIFGROUP = 2150132105 +pkg syscall (freebsd-amd64-cgo), const SIOCDIFPHYADDR = 2149607753 +pkg syscall (freebsd-amd64-cgo), const SIOCDLIFADDR = 2165860637 +pkg syscall (freebsd-amd64-cgo), const SIOCGDRVSPEC = 3223873915 +pkg syscall (freebsd-amd64-cgo), const SIOCGETSGCNT = 3223351824 +pkg syscall (freebsd-amd64-cgo), const SIOCGETVIFCNT = 3223876111 +pkg syscall (freebsd-amd64-cgo), const SIOCGHIWAT = 1074033409 +pkg syscall (freebsd-amd64-cgo), const SIOCGIFADDR = 3223349537 +pkg syscall (freebsd-amd64-cgo), const SIOCGIFBRDADDR = 3223349539 +pkg syscall (freebsd-amd64-cgo), const SIOCGIFCAP = 3223349535 +pkg syscall (freebsd-amd64-cgo), const SIOCGIFCONF = 3222300964 +pkg syscall (freebsd-amd64-cgo), const SIOCGIFDESCR = 3223349546 +pkg syscall (freebsd-amd64-cgo), const SIOCGIFDSTADDR = 3223349538 +pkg syscall (freebsd-amd64-cgo), const SIOCGIFFIB = 3223349596 +pkg syscall (freebsd-amd64-cgo), const SIOCGIFFLAGS = 3223349521 +pkg syscall (freebsd-amd64-cgo), const SIOCGIFGENERIC = 3223349562 +pkg syscall (freebsd-amd64-cgo), const SIOCGIFGMEMB = 3223873930 +pkg syscall (freebsd-amd64-cgo), const SIOCGIFGROUP = 3223873928 +pkg syscall (freebsd-amd64-cgo), const SIOCGIFINDEX = 3223349536 +pkg syscall (freebsd-amd64-cgo), const SIOCGIFMAC = 3223349542 +pkg syscall (freebsd-amd64-cgo), const SIOCGIFMEDIA = 3224398136 +pkg syscall (freebsd-amd64-cgo), const SIOCGIFMETRIC = 3223349527 +pkg syscall (freebsd-amd64-cgo), const SIOCGIFMTU = 3223349555 +pkg syscall (freebsd-amd64-cgo), const SIOCGIFNETMASK = 3223349541 +pkg syscall (freebsd-amd64-cgo), const SIOCGIFPDSTADDR = 3223349576 +pkg syscall (freebsd-amd64-cgo), const SIOCGIFPHYS = 3223349557 +pkg syscall (freebsd-amd64-cgo), const SIOCGIFPSRCADDR = 3223349575 +pkg syscall (freebsd-amd64-cgo), const SIOCGIFSTATUS = 3274795323 +pkg syscall (freebsd-amd64-cgo), const SIOCGLIFADDR = 3239602460 +pkg syscall (freebsd-amd64-cgo), const SIOCGLIFPHYADDR = 3239602507 +pkg syscall (freebsd-amd64-cgo), const SIOCGLOWAT = 1074033411 +pkg syscall (freebsd-amd64-cgo), const SIOCGPGRP = 1074033417 +pkg syscall (freebsd-amd64-cgo), const SIOCGPRIVATE_0 = 3223349584 +pkg syscall (freebsd-amd64-cgo), const SIOCGPRIVATE_1 = 3223349585 +pkg syscall (freebsd-amd64-cgo), const SIOCIFCREATE = 3223349626 +pkg syscall (freebsd-amd64-cgo), const SIOCIFCREATE2 = 3223349628 +pkg syscall (freebsd-amd64-cgo), const SIOCIFDESTROY = 2149607801 +pkg syscall (freebsd-amd64-cgo), const SIOCIFGCLONERS = 3222301048 +pkg syscall (freebsd-amd64-cgo), const SIOCSDRVSPEC = 2150132091 +pkg syscall (freebsd-amd64-cgo), const SIOCSHIWAT = 2147775232 +pkg syscall (freebsd-amd64-cgo), const SIOCSIFADDR = 2149607692 +pkg syscall (freebsd-amd64-cgo), const SIOCSIFBRDADDR = 2149607699 +pkg syscall (freebsd-amd64-cgo), const SIOCSIFCAP = 2149607710 +pkg syscall (freebsd-amd64-cgo), const SIOCSIFDESCR = 2149607721 +pkg syscall (freebsd-amd64-cgo), const SIOCSIFDSTADDR = 2149607694 +pkg syscall (freebsd-amd64-cgo), const SIOCSIFFIB = 2149607773 +pkg syscall (freebsd-amd64-cgo), const SIOCSIFFLAGS = 2149607696 +pkg syscall (freebsd-amd64-cgo), const SIOCSIFGENERIC = 2149607737 +pkg syscall (freebsd-amd64-cgo), const SIOCSIFLLADDR = 2149607740 +pkg syscall (freebsd-amd64-cgo), const SIOCSIFMAC = 2149607719 +pkg syscall (freebsd-amd64-cgo), const SIOCSIFMEDIA = 3223349559 +pkg syscall (freebsd-amd64-cgo), const SIOCSIFMETRIC = 2149607704 +pkg syscall (freebsd-amd64-cgo), const SIOCSIFMTU = 2149607732 +pkg syscall (freebsd-amd64-cgo), const SIOCSIFNAME = 2149607720 +pkg syscall (freebsd-amd64-cgo), const SIOCSIFNETMASK = 2149607702 +pkg syscall (freebsd-amd64-cgo), const SIOCSIFPHYADDR = 2151704902 +pkg syscall (freebsd-amd64-cgo), const SIOCSIFPHYS = 2149607734 +pkg syscall (freebsd-amd64-cgo), const SIOCSIFRVNET = 3223349595 +pkg syscall (freebsd-amd64-cgo), const SIOCSIFVNET = 3223349594 +pkg syscall (freebsd-amd64-cgo), const SIOCSLIFPHYADDR = 2165860682 +pkg syscall (freebsd-amd64-cgo), const SIOCSLOWAT = 2147775234 +pkg syscall (freebsd-amd64-cgo), const SIOCSPGRP = 2147775240 +pkg syscall (freebsd-amd64-cgo), const SOCK_MAXADDRLEN = 255 +pkg syscall (freebsd-amd64-cgo), const SOCK_RDM = 4 +pkg syscall (freebsd-amd64-cgo), const SOL_SOCKET = 65535 +pkg syscall (freebsd-amd64-cgo), const SOMAXCONN = 128 +pkg syscall (freebsd-amd64-cgo), const SO_ACCEPTCONN = 2 +pkg syscall (freebsd-amd64-cgo), const SO_ACCEPTFILTER = 4096 +pkg syscall (freebsd-amd64-cgo), const SO_BINTIME = 8192 +pkg syscall (freebsd-amd64-cgo), const SO_BROADCAST = 32 +pkg syscall (freebsd-amd64-cgo), const SO_DEBUG = 1 +pkg syscall (freebsd-amd64-cgo), const SO_DONTROUTE = 16 +pkg syscall (freebsd-amd64-cgo), const SO_ERROR = 4103 +pkg syscall (freebsd-amd64-cgo), const SO_KEEPALIVE = 8 +pkg syscall (freebsd-amd64-cgo), const SO_LABEL = 4105 +pkg syscall (freebsd-amd64-cgo), const SO_LINGER = 128 +pkg syscall (freebsd-amd64-cgo), const SO_LISTENINCQLEN = 4115 +pkg syscall (freebsd-amd64-cgo), const SO_LISTENQLEN = 4114 +pkg syscall (freebsd-amd64-cgo), const SO_LISTENQLIMIT = 4113 +pkg syscall (freebsd-amd64-cgo), const SO_NOSIGPIPE = 2048 +pkg syscall (freebsd-amd64-cgo), const SO_NO_DDP = 32768 +pkg syscall (freebsd-amd64-cgo), const SO_NO_OFFLOAD = 16384 +pkg syscall (freebsd-amd64-cgo), const SO_OOBINLINE = 256 +pkg syscall (freebsd-amd64-cgo), const SO_PEERLABEL = 4112 +pkg syscall (freebsd-amd64-cgo), const SO_PROTOCOL = 4118 +pkg syscall (freebsd-amd64-cgo), const SO_PROTOTYPE = 4118 +pkg syscall (freebsd-amd64-cgo), const SO_RCVBUF = 4098 +pkg syscall (freebsd-amd64-cgo), const SO_RCVLOWAT = 4100 +pkg syscall (freebsd-amd64-cgo), const SO_RCVTIMEO = 4102 +pkg syscall (freebsd-amd64-cgo), const SO_REUSEADDR = 4 +pkg syscall (freebsd-amd64-cgo), const SO_REUSEPORT = 512 +pkg syscall (freebsd-amd64-cgo), const SO_SETFIB = 4116 +pkg syscall (freebsd-amd64-cgo), const SO_SNDBUF = 4097 +pkg syscall (freebsd-amd64-cgo), const SO_SNDLOWAT = 4099 +pkg syscall (freebsd-amd64-cgo), const SO_SNDTIMEO = 4101 +pkg syscall (freebsd-amd64-cgo), const SO_TIMESTAMP = 1024 +pkg syscall (freebsd-amd64-cgo), const SO_TYPE = 4104 +pkg syscall (freebsd-amd64-cgo), const SO_USELOOPBACK = 64 +pkg syscall (freebsd-amd64-cgo), const SO_USER_COOKIE = 4117 +pkg syscall (freebsd-amd64-cgo), const SYS_ABORT2 = 463 +pkg syscall (freebsd-amd64-cgo), const SYS_ACCEPT = 30 +pkg syscall (freebsd-amd64-cgo), const SYS_ACCESS = 33 +pkg syscall (freebsd-amd64-cgo), const SYS_ACCT = 51 +pkg syscall (freebsd-amd64-cgo), const SYS_ADJTIME = 140 +pkg syscall (freebsd-amd64-cgo), const SYS_AUDIT = 445 +pkg syscall (freebsd-amd64-cgo), const SYS_AUDITCTL = 453 +pkg syscall (freebsd-amd64-cgo), const SYS_AUDITON = 446 +pkg syscall (freebsd-amd64-cgo), const SYS_BIND = 104 +pkg syscall (freebsd-amd64-cgo), const SYS_CAP_ENTER = 516 +pkg syscall (freebsd-amd64-cgo), const SYS_CAP_GETMODE = 517 +pkg syscall (freebsd-amd64-cgo), const SYS_CAP_GETRIGHTS = 515 +pkg syscall (freebsd-amd64-cgo), const SYS_CAP_NEW = 514 +pkg syscall (freebsd-amd64-cgo), const SYS_CHDIR = 12 +pkg syscall (freebsd-amd64-cgo), const SYS_CHFLAGS = 34 +pkg syscall (freebsd-amd64-cgo), const SYS_CHMOD = 15 +pkg syscall (freebsd-amd64-cgo), const SYS_CHOWN = 16 +pkg syscall (freebsd-amd64-cgo), const SYS_CHROOT = 61 +pkg syscall (freebsd-amd64-cgo), const SYS_CLOCK_GETCPUCLOCKID2 = 247 +pkg syscall (freebsd-amd64-cgo), const SYS_CLOCK_GETRES = 234 +pkg syscall (freebsd-amd64-cgo), const SYS_CLOCK_GETTIME = 232 +pkg syscall (freebsd-amd64-cgo), const SYS_CLOCK_SETTIME = 233 +pkg syscall (freebsd-amd64-cgo), const SYS_CLOSE = 6 +pkg syscall (freebsd-amd64-cgo), const SYS_CLOSEFROM = 509 +pkg syscall (freebsd-amd64-cgo), const SYS_CONNECT = 98 +pkg syscall (freebsd-amd64-cgo), const SYS_CPUSET = 484 +pkg syscall (freebsd-amd64-cgo), const SYS_CPUSET_GETAFFINITY = 487 +pkg syscall (freebsd-amd64-cgo), const SYS_CPUSET_GETID = 486 +pkg syscall (freebsd-amd64-cgo), const SYS_CPUSET_SETAFFINITY = 488 +pkg syscall (freebsd-amd64-cgo), const SYS_CPUSET_SETID = 485 +pkg syscall (freebsd-amd64-cgo), const SYS_DUP = 41 +pkg syscall (freebsd-amd64-cgo), const SYS_DUP2 = 90 +pkg syscall (freebsd-amd64-cgo), const SYS_EACCESS = 376 +pkg syscall (freebsd-amd64-cgo), const SYS_EXECVE = 59 +pkg syscall (freebsd-amd64-cgo), const SYS_EXIT = 1 +pkg syscall (freebsd-amd64-cgo), const SYS_EXTATTRCTL = 355 +pkg syscall (freebsd-amd64-cgo), const SYS_EXTATTR_DELETE_FD = 373 +pkg syscall (freebsd-amd64-cgo), const SYS_EXTATTR_DELETE_FILE = 358 +pkg syscall (freebsd-amd64-cgo), const SYS_EXTATTR_DELETE_LINK = 414 +pkg syscall (freebsd-amd64-cgo), const SYS_EXTATTR_GET_FD = 372 +pkg syscall (freebsd-amd64-cgo), const SYS_EXTATTR_GET_FILE = 357 +pkg syscall (freebsd-amd64-cgo), const SYS_EXTATTR_GET_LINK = 413 +pkg syscall (freebsd-amd64-cgo), const SYS_EXTATTR_LIST_FD = 437 +pkg syscall (freebsd-amd64-cgo), const SYS_EXTATTR_LIST_FILE = 438 +pkg syscall (freebsd-amd64-cgo), const SYS_EXTATTR_LIST_LINK = 439 +pkg syscall (freebsd-amd64-cgo), const SYS_EXTATTR_SET_FD = 371 +pkg syscall (freebsd-amd64-cgo), const SYS_EXTATTR_SET_FILE = 356 +pkg syscall (freebsd-amd64-cgo), const SYS_EXTATTR_SET_LINK = 412 +pkg syscall (freebsd-amd64-cgo), const SYS_FACCESSAT = 489 +pkg syscall (freebsd-amd64-cgo), const SYS_FCHDIR = 13 +pkg syscall (freebsd-amd64-cgo), const SYS_FCHFLAGS = 35 +pkg syscall (freebsd-amd64-cgo), const SYS_FCHMOD = 124 +pkg syscall (freebsd-amd64-cgo), const SYS_FCHMODAT = 490 +pkg syscall (freebsd-amd64-cgo), const SYS_FCHOWN = 123 +pkg syscall (freebsd-amd64-cgo), const SYS_FCHOWNAT = 491 +pkg syscall (freebsd-amd64-cgo), const SYS_FCNTL = 92 +pkg syscall (freebsd-amd64-cgo), const SYS_FEXECVE = 492 +pkg syscall (freebsd-amd64-cgo), const SYS_FFCLOCK_GETCOUNTER = 241 +pkg syscall (freebsd-amd64-cgo), const SYS_FFCLOCK_GETESTIMATE = 243 +pkg syscall (freebsd-amd64-cgo), const SYS_FFCLOCK_SETESTIMATE = 242 +pkg syscall (freebsd-amd64-cgo), const SYS_FHOPEN = 298 +pkg syscall (freebsd-amd64-cgo), const SYS_FHSTAT = 299 +pkg syscall (freebsd-amd64-cgo), const SYS_FHSTATFS = 398 +pkg syscall (freebsd-amd64-cgo), const SYS_FLOCK = 131 +pkg syscall (freebsd-amd64-cgo), const SYS_FORK = 2 +pkg syscall (freebsd-amd64-cgo), const SYS_FPATHCONF = 192 +pkg syscall (freebsd-amd64-cgo), const SYS_FREEBSD6_FTRUNCATE = 201 +pkg syscall (freebsd-amd64-cgo), const SYS_FREEBSD6_LSEEK = 199 +pkg syscall (freebsd-amd64-cgo), const SYS_FREEBSD6_MMAP = 197 +pkg syscall (freebsd-amd64-cgo), const SYS_FREEBSD6_PREAD = 173 +pkg syscall (freebsd-amd64-cgo), const SYS_FREEBSD6_PWRITE = 174 +pkg syscall (freebsd-amd64-cgo), const SYS_FREEBSD6_TRUNCATE = 200 +pkg syscall (freebsd-amd64-cgo), const SYS_FSTAT = 189 +pkg syscall (freebsd-amd64-cgo), const SYS_FSTATAT = 493 +pkg syscall (freebsd-amd64-cgo), const SYS_FSTATFS = 397 +pkg syscall (freebsd-amd64-cgo), const SYS_FSYNC = 95 +pkg syscall (freebsd-amd64-cgo), const SYS_FTRUNCATE = 480 +pkg syscall (freebsd-amd64-cgo), const SYS_FUTIMES = 206 +pkg syscall (freebsd-amd64-cgo), const SYS_FUTIMESAT = 494 +pkg syscall (freebsd-amd64-cgo), const SYS_GETAUDIT = 449 +pkg syscall (freebsd-amd64-cgo), const SYS_GETAUDIT_ADDR = 451 +pkg syscall (freebsd-amd64-cgo), const SYS_GETAUID = 447 +pkg syscall (freebsd-amd64-cgo), const SYS_GETCONTEXT = 421 +pkg syscall (freebsd-amd64-cgo), const SYS_GETDENTS = 272 +pkg syscall (freebsd-amd64-cgo), const SYS_GETDIRENTRIES = 196 +pkg syscall (freebsd-amd64-cgo), const SYS_GETDTABLESIZE = 89 +pkg syscall (freebsd-amd64-cgo), const SYS_GETEGID = 43 +pkg syscall (freebsd-amd64-cgo), const SYS_GETEUID = 25 +pkg syscall (freebsd-amd64-cgo), const SYS_GETFH = 161 +pkg syscall (freebsd-amd64-cgo), const SYS_GETFSSTAT = 395 +pkg syscall (freebsd-amd64-cgo), const SYS_GETGID = 47 +pkg syscall (freebsd-amd64-cgo), const SYS_GETGROUPS = 79 +pkg syscall (freebsd-amd64-cgo), const SYS_GETITIMER = 86 +pkg syscall (freebsd-amd64-cgo), const SYS_GETLOGIN = 49 +pkg syscall (freebsd-amd64-cgo), const SYS_GETLOGINCLASS = 523 +pkg syscall (freebsd-amd64-cgo), const SYS_GETPEERNAME = 31 +pkg syscall (freebsd-amd64-cgo), const SYS_GETPGID = 207 +pkg syscall (freebsd-amd64-cgo), const SYS_GETPGRP = 81 +pkg syscall (freebsd-amd64-cgo), const SYS_GETPID = 20 +pkg syscall (freebsd-amd64-cgo), const SYS_GETPPID = 39 +pkg syscall (freebsd-amd64-cgo), const SYS_GETPRIORITY = 100 +pkg syscall (freebsd-amd64-cgo), const SYS_GETRESGID = 361 +pkg syscall (freebsd-amd64-cgo), const SYS_GETRESUID = 360 +pkg syscall (freebsd-amd64-cgo), const SYS_GETRLIMIT = 194 +pkg syscall (freebsd-amd64-cgo), const SYS_GETRUSAGE = 117 +pkg syscall (freebsd-amd64-cgo), const SYS_GETSID = 310 +pkg syscall (freebsd-amd64-cgo), const SYS_GETSOCKNAME = 32 +pkg syscall (freebsd-amd64-cgo), const SYS_GETSOCKOPT = 118 +pkg syscall (freebsd-amd64-cgo), const SYS_GETTIMEOFDAY = 116 +pkg syscall (freebsd-amd64-cgo), const SYS_GETUID = 24 +pkg syscall (freebsd-amd64-cgo), const SYS_IOCTL = 54 +pkg syscall (freebsd-amd64-cgo), const SYS_ISSETUGID = 253 +pkg syscall (freebsd-amd64-cgo), const SYS_JAIL = 338 +pkg syscall (freebsd-amd64-cgo), const SYS_JAIL_ATTACH = 436 +pkg syscall (freebsd-amd64-cgo), const SYS_JAIL_GET = 506 +pkg syscall (freebsd-amd64-cgo), const SYS_JAIL_REMOVE = 508 +pkg syscall (freebsd-amd64-cgo), const SYS_JAIL_SET = 507 +pkg syscall (freebsd-amd64-cgo), const SYS_KENV = 390 +pkg syscall (freebsd-amd64-cgo), const SYS_KEVENT = 363 +pkg syscall (freebsd-amd64-cgo), const SYS_KILL = 37 +pkg syscall (freebsd-amd64-cgo), const SYS_KLDFIND = 306 +pkg syscall (freebsd-amd64-cgo), const SYS_KLDFIRSTMOD = 309 +pkg syscall (freebsd-amd64-cgo), const SYS_KLDLOAD = 304 +pkg syscall (freebsd-amd64-cgo), const SYS_KLDNEXT = 307 +pkg syscall (freebsd-amd64-cgo), const SYS_KLDSTAT = 308 +pkg syscall (freebsd-amd64-cgo), const SYS_KLDSYM = 337 +pkg syscall (freebsd-amd64-cgo), const SYS_KLDUNLOAD = 305 +pkg syscall (freebsd-amd64-cgo), const SYS_KLDUNLOADF = 444 +pkg syscall (freebsd-amd64-cgo), const SYS_KQUEUE = 362 +pkg syscall (freebsd-amd64-cgo), const SYS_KTIMER_CREATE = 235 +pkg syscall (freebsd-amd64-cgo), const SYS_KTIMER_DELETE = 236 +pkg syscall (freebsd-amd64-cgo), const SYS_KTIMER_GETOVERRUN = 239 +pkg syscall (freebsd-amd64-cgo), const SYS_KTIMER_GETTIME = 238 +pkg syscall (freebsd-amd64-cgo), const SYS_KTIMER_SETTIME = 237 +pkg syscall (freebsd-amd64-cgo), const SYS_KTRACE = 45 +pkg syscall (freebsd-amd64-cgo), const SYS_LCHFLAGS = 391 +pkg syscall (freebsd-amd64-cgo), const SYS_LCHMOD = 274 +pkg syscall (freebsd-amd64-cgo), const SYS_LCHOWN = 254 +pkg syscall (freebsd-amd64-cgo), const SYS_LGETFH = 160 +pkg syscall (freebsd-amd64-cgo), const SYS_LINK = 9 +pkg syscall (freebsd-amd64-cgo), const SYS_LINKAT = 495 +pkg syscall (freebsd-amd64-cgo), const SYS_LISTEN = 106 +pkg syscall (freebsd-amd64-cgo), const SYS_LPATHCONF = 513 +pkg syscall (freebsd-amd64-cgo), const SYS_LSEEK = 478 +pkg syscall (freebsd-amd64-cgo), const SYS_LSTAT = 190 +pkg syscall (freebsd-amd64-cgo), const SYS_LUTIMES = 276 +pkg syscall (freebsd-amd64-cgo), const SYS_MAC_SYSCALL = 394 +pkg syscall (freebsd-amd64-cgo), const SYS_MADVISE = 75 +pkg syscall (freebsd-amd64-cgo), const SYS_MINCORE = 78 +pkg syscall (freebsd-amd64-cgo), const SYS_MINHERIT = 250 +pkg syscall (freebsd-amd64-cgo), const SYS_MKDIR = 136 +pkg syscall (freebsd-amd64-cgo), const SYS_MKDIRAT = 496 +pkg syscall (freebsd-amd64-cgo), const SYS_MKFIFO = 132 +pkg syscall (freebsd-amd64-cgo), const SYS_MKFIFOAT = 497 +pkg syscall (freebsd-amd64-cgo), const SYS_MKNOD = 14 +pkg syscall (freebsd-amd64-cgo), const SYS_MKNODAT = 498 +pkg syscall (freebsd-amd64-cgo), const SYS_MLOCK = 203 +pkg syscall (freebsd-amd64-cgo), const SYS_MLOCKALL = 324 +pkg syscall (freebsd-amd64-cgo), const SYS_MMAP = 477 +pkg syscall (freebsd-amd64-cgo), const SYS_MODFIND = 303 +pkg syscall (freebsd-amd64-cgo), const SYS_MODFNEXT = 302 +pkg syscall (freebsd-amd64-cgo), const SYS_MODNEXT = 300 +pkg syscall (freebsd-amd64-cgo), const SYS_MODSTAT = 301 +pkg syscall (freebsd-amd64-cgo), const SYS_MOUNT = 21 +pkg syscall (freebsd-amd64-cgo), const SYS_MPROTECT = 74 +pkg syscall (freebsd-amd64-cgo), const SYS_MSYNC = 65 +pkg syscall (freebsd-amd64-cgo), const SYS_MUNLOCK = 204 +pkg syscall (freebsd-amd64-cgo), const SYS_MUNLOCKALL = 325 +pkg syscall (freebsd-amd64-cgo), const SYS_MUNMAP = 73 +pkg syscall (freebsd-amd64-cgo), const SYS_NANOSLEEP = 240 +pkg syscall (freebsd-amd64-cgo), const SYS_NFSTAT = 279 +pkg syscall (freebsd-amd64-cgo), const SYS_NLSTAT = 280 +pkg syscall (freebsd-amd64-cgo), const SYS_NMOUNT = 378 +pkg syscall (freebsd-amd64-cgo), const SYS_NSTAT = 278 +pkg syscall (freebsd-amd64-cgo), const SYS_NTP_ADJTIME = 176 +pkg syscall (freebsd-amd64-cgo), const SYS_NTP_GETTIME = 248 +pkg syscall (freebsd-amd64-cgo), const SYS_OBREAK = 17 +pkg syscall (freebsd-amd64-cgo), const SYS_OPEN = 5 +pkg syscall (freebsd-amd64-cgo), const SYS_OPENAT = 499 +pkg syscall (freebsd-amd64-cgo), const SYS_OPENBSD_POLL = 252 +pkg syscall (freebsd-amd64-cgo), const SYS_OVADVISE = 72 +pkg syscall (freebsd-amd64-cgo), const SYS_PATHCONF = 191 +pkg syscall (freebsd-amd64-cgo), const SYS_PDFORK = 518 +pkg syscall (freebsd-amd64-cgo), const SYS_PDGETPID = 520 +pkg syscall (freebsd-amd64-cgo), const SYS_PDKILL = 519 +pkg syscall (freebsd-amd64-cgo), const SYS_PIPE = 42 +pkg syscall (freebsd-amd64-cgo), const SYS_POLL = 209 +pkg syscall (freebsd-amd64-cgo), const SYS_POSIX_FADVISE = 531 +pkg syscall (freebsd-amd64-cgo), const SYS_POSIX_FALLOCATE = 530 +pkg syscall (freebsd-amd64-cgo), const SYS_POSIX_OPENPT = 504 +pkg syscall (freebsd-amd64-cgo), const SYS_PREAD = 475 +pkg syscall (freebsd-amd64-cgo), const SYS_PREADV = 289 +pkg syscall (freebsd-amd64-cgo), const SYS_PROFIL = 44 +pkg syscall (freebsd-amd64-cgo), const SYS_PSELECT = 522 +pkg syscall (freebsd-amd64-cgo), const SYS_PTRACE = 26 +pkg syscall (freebsd-amd64-cgo), const SYS_PWRITE = 476 +pkg syscall (freebsd-amd64-cgo), const SYS_PWRITEV = 290 +pkg syscall (freebsd-amd64-cgo), const SYS_QUOTACTL = 148 +pkg syscall (freebsd-amd64-cgo), const SYS_RCTL_ADD_RULE = 528 +pkg syscall (freebsd-amd64-cgo), const SYS_RCTL_GET_LIMITS = 527 +pkg syscall (freebsd-amd64-cgo), const SYS_RCTL_GET_RACCT = 525 +pkg syscall (freebsd-amd64-cgo), const SYS_RCTL_GET_RULES = 526 +pkg syscall (freebsd-amd64-cgo), const SYS_RCTL_REMOVE_RULE = 529 +pkg syscall (freebsd-amd64-cgo), const SYS_READ = 3 +pkg syscall (freebsd-amd64-cgo), const SYS_READLINK = 58 +pkg syscall (freebsd-amd64-cgo), const SYS_READLINKAT = 500 +pkg syscall (freebsd-amd64-cgo), const SYS_READV = 120 +pkg syscall (freebsd-amd64-cgo), const SYS_REBOOT = 55 +pkg syscall (freebsd-amd64-cgo), const SYS_RECVFROM = 29 +pkg syscall (freebsd-amd64-cgo), const SYS_RECVMSG = 27 +pkg syscall (freebsd-amd64-cgo), const SYS_RENAME = 128 +pkg syscall (freebsd-amd64-cgo), const SYS_RENAMEAT = 501 +pkg syscall (freebsd-amd64-cgo), const SYS_REVOKE = 56 +pkg syscall (freebsd-amd64-cgo), const SYS_RFORK = 251 +pkg syscall (freebsd-amd64-cgo), const SYS_RMDIR = 137 +pkg syscall (freebsd-amd64-cgo), const SYS_RTPRIO = 166 +pkg syscall (freebsd-amd64-cgo), const SYS_RTPRIO_THREAD = 466 +pkg syscall (freebsd-amd64-cgo), const SYS_SBRK = 69 +pkg syscall (freebsd-amd64-cgo), const SYS_SCHED_GETPARAM = 328 +pkg syscall (freebsd-amd64-cgo), const SYS_SCHED_GETSCHEDULER = 330 +pkg syscall (freebsd-amd64-cgo), const SYS_SCHED_GET_PRIORITY_MAX = 332 +pkg syscall (freebsd-amd64-cgo), const SYS_SCHED_GET_PRIORITY_MIN = 333 +pkg syscall (freebsd-amd64-cgo), const SYS_SCHED_RR_GET_INTERVAL = 334 +pkg syscall (freebsd-amd64-cgo), const SYS_SCHED_SETPARAM = 327 +pkg syscall (freebsd-amd64-cgo), const SYS_SCHED_SETSCHEDULER = 329 +pkg syscall (freebsd-amd64-cgo), const SYS_SCHED_YIELD = 331 +pkg syscall (freebsd-amd64-cgo), const SYS_SCTP_GENERIC_RECVMSG = 474 +pkg syscall (freebsd-amd64-cgo), const SYS_SCTP_GENERIC_SENDMSG = 472 +pkg syscall (freebsd-amd64-cgo), const SYS_SCTP_GENERIC_SENDMSG_IOV = 473 +pkg syscall (freebsd-amd64-cgo), const SYS_SCTP_PEELOFF = 471 +pkg syscall (freebsd-amd64-cgo), const SYS_SELECT = 93 +pkg syscall (freebsd-amd64-cgo), const SYS_SENDFILE = 393 +pkg syscall (freebsd-amd64-cgo), const SYS_SENDMSG = 28 +pkg syscall (freebsd-amd64-cgo), const SYS_SENDTO = 133 +pkg syscall (freebsd-amd64-cgo), const SYS_SETAUDIT = 450 +pkg syscall (freebsd-amd64-cgo), const SYS_SETAUDIT_ADDR = 452 +pkg syscall (freebsd-amd64-cgo), const SYS_SETAUID = 448 +pkg syscall (freebsd-amd64-cgo), const SYS_SETCONTEXT = 422 +pkg syscall (freebsd-amd64-cgo), const SYS_SETEGID = 182 +pkg syscall (freebsd-amd64-cgo), const SYS_SETEUID = 183 +pkg syscall (freebsd-amd64-cgo), const SYS_SETFIB = 175 +pkg syscall (freebsd-amd64-cgo), const SYS_SETGID = 181 +pkg syscall (freebsd-amd64-cgo), const SYS_SETGROUPS = 80 +pkg syscall (freebsd-amd64-cgo), const SYS_SETITIMER = 83 +pkg syscall (freebsd-amd64-cgo), const SYS_SETLOGIN = 50 +pkg syscall (freebsd-amd64-cgo), const SYS_SETLOGINCLASS = 524 +pkg syscall (freebsd-amd64-cgo), const SYS_SETPGID = 82 +pkg syscall (freebsd-amd64-cgo), const SYS_SETPRIORITY = 96 +pkg syscall (freebsd-amd64-cgo), const SYS_SETREGID = 127 +pkg syscall (freebsd-amd64-cgo), const SYS_SETRESGID = 312 +pkg syscall (freebsd-amd64-cgo), const SYS_SETRESUID = 311 +pkg syscall (freebsd-amd64-cgo), const SYS_SETREUID = 126 +pkg syscall (freebsd-amd64-cgo), const SYS_SETRLIMIT = 195 +pkg syscall (freebsd-amd64-cgo), const SYS_SETSID = 147 +pkg syscall (freebsd-amd64-cgo), const SYS_SETSOCKOPT = 105 +pkg syscall (freebsd-amd64-cgo), const SYS_SETTIMEOFDAY = 122 +pkg syscall (freebsd-amd64-cgo), const SYS_SETUID = 23 +pkg syscall (freebsd-amd64-cgo), const SYS_SHM_OPEN = 482 +pkg syscall (freebsd-amd64-cgo), const SYS_SHM_UNLINK = 483 +pkg syscall (freebsd-amd64-cgo), const SYS_SHUTDOWN = 134 +pkg syscall (freebsd-amd64-cgo), const SYS_SIGACTION = 416 +pkg syscall (freebsd-amd64-cgo), const SYS_SIGALTSTACK = 53 +pkg syscall (freebsd-amd64-cgo), const SYS_SIGPENDING = 343 +pkg syscall (freebsd-amd64-cgo), const SYS_SIGPROCMASK = 340 +pkg syscall (freebsd-amd64-cgo), const SYS_SIGQUEUE = 456 +pkg syscall (freebsd-amd64-cgo), const SYS_SIGRETURN = 417 +pkg syscall (freebsd-amd64-cgo), const SYS_SIGSUSPEND = 341 +pkg syscall (freebsd-amd64-cgo), const SYS_SIGTIMEDWAIT = 345 +pkg syscall (freebsd-amd64-cgo), const SYS_SIGWAIT = 429 +pkg syscall (freebsd-amd64-cgo), const SYS_SIGWAITINFO = 346 +pkg syscall (freebsd-amd64-cgo), const SYS_SOCKET = 97 +pkg syscall (freebsd-amd64-cgo), const SYS_SOCKETPAIR = 135 +pkg syscall (freebsd-amd64-cgo), const SYS_SSTK = 70 +pkg syscall (freebsd-amd64-cgo), const SYS_STAT = 188 +pkg syscall (freebsd-amd64-cgo), const SYS_STATFS = 396 +pkg syscall (freebsd-amd64-cgo), const SYS_SWAPCONTEXT = 423 +pkg syscall (freebsd-amd64-cgo), const SYS_SWAPOFF = 424 +pkg syscall (freebsd-amd64-cgo), const SYS_SWAPON = 85 +pkg syscall (freebsd-amd64-cgo), const SYS_SYMLINK = 57 +pkg syscall (freebsd-amd64-cgo), const SYS_SYMLINKAT = 502 +pkg syscall (freebsd-amd64-cgo), const SYS_SYNC = 36 +pkg syscall (freebsd-amd64-cgo), const SYS_SYSARCH = 165 +pkg syscall (freebsd-amd64-cgo), const SYS_THR_CREATE = 430 +pkg syscall (freebsd-amd64-cgo), const SYS_THR_EXIT = 431 +pkg syscall (freebsd-amd64-cgo), const SYS_THR_KILL = 433 +pkg syscall (freebsd-amd64-cgo), const SYS_THR_KILL2 = 481 +pkg syscall (freebsd-amd64-cgo), const SYS_THR_NEW = 455 +pkg syscall (freebsd-amd64-cgo), const SYS_THR_SELF = 432 +pkg syscall (freebsd-amd64-cgo), const SYS_THR_SET_NAME = 464 +pkg syscall (freebsd-amd64-cgo), const SYS_THR_SUSPEND = 442 +pkg syscall (freebsd-amd64-cgo), const SYS_THR_WAKE = 443 +pkg syscall (freebsd-amd64-cgo), const SYS_TRUNCATE = 479 +pkg syscall (freebsd-amd64-cgo), const SYS_UMASK = 60 +pkg syscall (freebsd-amd64-cgo), const SYS_UNDELETE = 205 +pkg syscall (freebsd-amd64-cgo), const SYS_UNLINK = 10 +pkg syscall (freebsd-amd64-cgo), const SYS_UNLINKAT = 503 +pkg syscall (freebsd-amd64-cgo), const SYS_UNMOUNT = 22 +pkg syscall (freebsd-amd64-cgo), const SYS_UTIMES = 138 +pkg syscall (freebsd-amd64-cgo), const SYS_UTRACE = 335 +pkg syscall (freebsd-amd64-cgo), const SYS_UUIDGEN = 392 +pkg syscall (freebsd-amd64-cgo), const SYS_VFORK = 66 +pkg syscall (freebsd-amd64-cgo), const SYS_WAIT4 = 7 +pkg syscall (freebsd-amd64-cgo), const SYS_WAIT6 = 532 +pkg syscall (freebsd-amd64-cgo), const SYS_WRITE = 4 +pkg syscall (freebsd-amd64-cgo), const SYS_WRITEV = 121 +pkg syscall (freebsd-amd64-cgo), const SYS_YIELD = 321 +pkg syscall (freebsd-amd64-cgo), const SYS__UMTX_LOCK = 434 +pkg syscall (freebsd-amd64-cgo), const SYS__UMTX_OP = 454 +pkg syscall (freebsd-amd64-cgo), const SYS__UMTX_UNLOCK = 435 +pkg syscall (freebsd-amd64-cgo), const SYS___ACL_ACLCHECK_FD = 354 +pkg syscall (freebsd-amd64-cgo), const SYS___ACL_ACLCHECK_FILE = 353 +pkg syscall (freebsd-amd64-cgo), const SYS___ACL_ACLCHECK_LINK = 428 +pkg syscall (freebsd-amd64-cgo), const SYS___ACL_DELETE_FD = 352 +pkg syscall (freebsd-amd64-cgo), const SYS___ACL_DELETE_FILE = 351 +pkg syscall (freebsd-amd64-cgo), const SYS___ACL_DELETE_LINK = 427 +pkg syscall (freebsd-amd64-cgo), const SYS___ACL_GET_FD = 349 +pkg syscall (freebsd-amd64-cgo), const SYS___ACL_GET_FILE = 347 +pkg syscall (freebsd-amd64-cgo), const SYS___ACL_GET_LINK = 425 +pkg syscall (freebsd-amd64-cgo), const SYS___ACL_SET_FD = 350 +pkg syscall (freebsd-amd64-cgo), const SYS___ACL_SET_FILE = 348 +pkg syscall (freebsd-amd64-cgo), const SYS___ACL_SET_LINK = 426 +pkg syscall (freebsd-amd64-cgo), const SYS___GETCWD = 326 +pkg syscall (freebsd-amd64-cgo), const SYS___MAC_EXECVE = 415 +pkg syscall (freebsd-amd64-cgo), const SYS___MAC_GET_FD = 386 +pkg syscall (freebsd-amd64-cgo), const SYS___MAC_GET_FILE = 387 +pkg syscall (freebsd-amd64-cgo), const SYS___MAC_GET_LINK = 410 +pkg syscall (freebsd-amd64-cgo), const SYS___MAC_GET_PID = 409 +pkg syscall (freebsd-amd64-cgo), const SYS___MAC_GET_PROC = 384 +pkg syscall (freebsd-amd64-cgo), const SYS___MAC_SET_FD = 388 +pkg syscall (freebsd-amd64-cgo), const SYS___MAC_SET_FILE = 389 +pkg syscall (freebsd-amd64-cgo), const SYS___MAC_SET_LINK = 411 +pkg syscall (freebsd-amd64-cgo), const SYS___MAC_SET_PROC = 385 +pkg syscall (freebsd-amd64-cgo), const SYS___SETUGID = 374 +pkg syscall (freebsd-amd64-cgo), const SYS___SYSCTL = 202 +pkg syscall (freebsd-amd64-cgo), const S_IFMT = 61440 +pkg syscall (freebsd-amd64-cgo), const SizeofBpfHdr = 32 +pkg syscall (freebsd-amd64-cgo), const SizeofBpfInsn = 8 +pkg syscall (freebsd-amd64-cgo), const SizeofBpfProgram = 16 +pkg syscall (freebsd-amd64-cgo), const SizeofBpfStat = 8 +pkg syscall (freebsd-amd64-cgo), const SizeofBpfVersion = 4 +pkg syscall (freebsd-amd64-cgo), const SizeofBpfZbuf = 24 +pkg syscall (freebsd-amd64-cgo), const SizeofBpfZbufHeader = 32 +pkg syscall (freebsd-amd64-cgo), const SizeofCmsghdr = 12 +pkg syscall (freebsd-amd64-cgo), const SizeofIPMreq = 8 +pkg syscall (freebsd-amd64-cgo), const SizeofIPMreqn = 12 +pkg syscall (freebsd-amd64-cgo), const SizeofIPv6Mreq = 20 +pkg syscall (freebsd-amd64-cgo), const SizeofIfAnnounceMsghdr = 24 +pkg syscall (freebsd-amd64-cgo), const SizeofIfData = 152 +pkg syscall (freebsd-amd64-cgo), const SizeofIfMsghdr = 168 +pkg syscall (freebsd-amd64-cgo), const SizeofIfaMsghdr = 20 +pkg syscall (freebsd-amd64-cgo), const SizeofIfmaMsghdr = 16 +pkg syscall (freebsd-amd64-cgo), const SizeofInet6Pktinfo = 20 +pkg syscall (freebsd-amd64-cgo), const SizeofLinger = 8 +pkg syscall (freebsd-amd64-cgo), const SizeofMsghdr = 48 +pkg syscall (freebsd-amd64-cgo), const SizeofRtMetrics = 112 +pkg syscall (freebsd-amd64-cgo), const SizeofRtMsghdr = 152 +pkg syscall (freebsd-amd64-cgo), const SizeofSockaddrAny = 108 +pkg syscall (freebsd-amd64-cgo), const SizeofSockaddrDatalink = 54 +pkg syscall (freebsd-amd64-cgo), const SizeofSockaddrInet4 = 16 +pkg syscall (freebsd-amd64-cgo), const SizeofSockaddrInet6 = 28 +pkg syscall (freebsd-amd64-cgo), const SizeofSockaddrUnix = 106 +pkg syscall (freebsd-amd64-cgo), const TCIFLUSH = 1 +pkg syscall (freebsd-amd64-cgo), const TCIOFLUSH = 3 +pkg syscall (freebsd-amd64-cgo), const TCOFLUSH = 2 +pkg syscall (freebsd-amd64-cgo), const TCP_CA_NAME_MAX = 16 +pkg syscall (freebsd-amd64-cgo), const TCP_CONGESTION = 64 +pkg syscall (freebsd-amd64-cgo), const TCP_INFO = 32 +pkg syscall (freebsd-amd64-cgo), const TCP_KEEPCNT = 1024 +pkg syscall (freebsd-amd64-cgo), const TCP_KEEPIDLE = 256 +pkg syscall (freebsd-amd64-cgo), const TCP_KEEPINIT = 128 +pkg syscall (freebsd-amd64-cgo), const TCP_KEEPINTVL = 512 +pkg syscall (freebsd-amd64-cgo), const TCP_MAXBURST = 4 +pkg syscall (freebsd-amd64-cgo), const TCP_MAXHLEN = 60 +pkg syscall (freebsd-amd64-cgo), const TCP_MAXOLEN = 40 +pkg syscall (freebsd-amd64-cgo), const TCP_MAXSEG = 2 +pkg syscall (freebsd-amd64-cgo), const TCP_MAXWIN = 65535 +pkg syscall (freebsd-amd64-cgo), const TCP_MAX_SACK = 4 +pkg syscall (freebsd-amd64-cgo), const TCP_MAX_WINSHIFT = 14 +pkg syscall (freebsd-amd64-cgo), const TCP_MD5SIG = 16 +pkg syscall (freebsd-amd64-cgo), const TCP_MINMSS = 216 +pkg syscall (freebsd-amd64-cgo), const TCP_MSS = 536 +pkg syscall (freebsd-amd64-cgo), const TCP_NOOPT = 8 +pkg syscall (freebsd-amd64-cgo), const TCP_NOPUSH = 4 +pkg syscall (freebsd-amd64-cgo), const TCSAFLUSH = 2 +pkg syscall (freebsd-amd64-cgo), const TIOCCBRK = 536900730 +pkg syscall (freebsd-amd64-cgo), const TIOCCDTR = 536900728 +pkg syscall (freebsd-amd64-cgo), const TIOCCONS = 2147775586 +pkg syscall (freebsd-amd64-cgo), const TIOCDRAIN = 536900702 +pkg syscall (freebsd-amd64-cgo), const TIOCEXCL = 536900621 +pkg syscall (freebsd-amd64-cgo), const TIOCEXT = 2147775584 +pkg syscall (freebsd-amd64-cgo), const TIOCFLUSH = 2147775504 +pkg syscall (freebsd-amd64-cgo), const TIOCGDRAINWAIT = 1074033750 +pkg syscall (freebsd-amd64-cgo), const TIOCGETA = 1076655123 +pkg syscall (freebsd-amd64-cgo), const TIOCGETD = 1074033690 +pkg syscall (freebsd-amd64-cgo), const TIOCGPGRP = 1074033783 +pkg syscall (freebsd-amd64-cgo), const TIOCGPTN = 1074033679 +pkg syscall (freebsd-amd64-cgo), const TIOCGSID = 1074033763 +pkg syscall (freebsd-amd64-cgo), const TIOCGWINSZ = 1074295912 +pkg syscall (freebsd-amd64-cgo), const TIOCMBIC = 2147775595 +pkg syscall (freebsd-amd64-cgo), const TIOCMBIS = 2147775596 +pkg syscall (freebsd-amd64-cgo), const TIOCMGDTRWAIT = 1074033754 +pkg syscall (freebsd-amd64-cgo), const TIOCMGET = 1074033770 +pkg syscall (freebsd-amd64-cgo), const TIOCMSDTRWAIT = 2147775579 +pkg syscall (freebsd-amd64-cgo), const TIOCMSET = 2147775597 +pkg syscall (freebsd-amd64-cgo), const TIOCM_CAR = 64 +pkg syscall (freebsd-amd64-cgo), const TIOCM_CD = 64 +pkg syscall (freebsd-amd64-cgo), const TIOCM_CTS = 32 +pkg syscall (freebsd-amd64-cgo), const TIOCM_DCD = 64 +pkg syscall (freebsd-amd64-cgo), const TIOCM_DSR = 256 +pkg syscall (freebsd-amd64-cgo), const TIOCM_DTR = 2 +pkg syscall (freebsd-amd64-cgo), const TIOCM_LE = 1 +pkg syscall (freebsd-amd64-cgo), const TIOCM_RI = 128 +pkg syscall (freebsd-amd64-cgo), const TIOCM_RNG = 128 +pkg syscall (freebsd-amd64-cgo), const TIOCM_RTS = 4 +pkg syscall (freebsd-amd64-cgo), const TIOCM_SR = 16 +pkg syscall (freebsd-amd64-cgo), const TIOCM_ST = 8 +pkg syscall (freebsd-amd64-cgo), const TIOCNOTTY = 536900721 +pkg syscall (freebsd-amd64-cgo), const TIOCNXCL = 536900622 +pkg syscall (freebsd-amd64-cgo), const TIOCOUTQ = 1074033779 +pkg syscall (freebsd-amd64-cgo), const TIOCPKT = 2147775600 +pkg syscall (freebsd-amd64-cgo), const TIOCPKT_DATA = 0 +pkg syscall (freebsd-amd64-cgo), const TIOCPKT_DOSTOP = 32 +pkg syscall (freebsd-amd64-cgo), const TIOCPKT_FLUSHREAD = 1 +pkg syscall (freebsd-amd64-cgo), const TIOCPKT_FLUSHWRITE = 2 +pkg syscall (freebsd-amd64-cgo), const TIOCPKT_IOCTL = 64 +pkg syscall (freebsd-amd64-cgo), const TIOCPKT_NOSTOP = 16 +pkg syscall (freebsd-amd64-cgo), const TIOCPKT_START = 8 +pkg syscall (freebsd-amd64-cgo), const TIOCPKT_STOP = 4 +pkg syscall (freebsd-amd64-cgo), const TIOCPTMASTER = 536900636 +pkg syscall (freebsd-amd64-cgo), const TIOCSBRK = 536900731 +pkg syscall (freebsd-amd64-cgo), const TIOCSCTTY = 536900705 +pkg syscall (freebsd-amd64-cgo), const TIOCSDRAINWAIT = 2147775575 +pkg syscall (freebsd-amd64-cgo), const TIOCSDTR = 536900729 +pkg syscall (freebsd-amd64-cgo), const TIOCSETA = 2150396948 +pkg syscall (freebsd-amd64-cgo), const TIOCSETAF = 2150396950 +pkg syscall (freebsd-amd64-cgo), const TIOCSETAW = 2150396949 +pkg syscall (freebsd-amd64-cgo), const TIOCSETD = 2147775515 +pkg syscall (freebsd-amd64-cgo), const TIOCSIG = 537162847 +pkg syscall (freebsd-amd64-cgo), const TIOCSPGRP = 2147775606 +pkg syscall (freebsd-amd64-cgo), const TIOCSTART = 536900718 +pkg syscall (freebsd-amd64-cgo), const TIOCSTAT = 536900709 +pkg syscall (freebsd-amd64-cgo), const TIOCSTI = 2147578994 +pkg syscall (freebsd-amd64-cgo), const TIOCSTOP = 536900719 +pkg syscall (freebsd-amd64-cgo), const TIOCSWINSZ = 2148037735 +pkg syscall (freebsd-amd64-cgo), const TIOCTIMESTAMP = 1074820185 +pkg syscall (freebsd-amd64-cgo), const TIOCUCNTL = 2147775590 +pkg syscall (freebsd-amd64-cgo), const TOSTOP = 4194304 +pkg syscall (freebsd-amd64-cgo), const VDISCARD = 15 +pkg syscall (freebsd-amd64-cgo), const VDSUSP = 11 +pkg syscall (freebsd-amd64-cgo), const VEOF = 0 +pkg syscall (freebsd-amd64-cgo), const VEOL = 1 +pkg syscall (freebsd-amd64-cgo), const VEOL2 = 2 +pkg syscall (freebsd-amd64-cgo), const VERASE = 3 +pkg syscall (freebsd-amd64-cgo), const VERASE2 = 7 +pkg syscall (freebsd-amd64-cgo), const VINTR = 8 +pkg syscall (freebsd-amd64-cgo), const VKILL = 5 +pkg syscall (freebsd-amd64-cgo), const VLNEXT = 14 +pkg syscall (freebsd-amd64-cgo), const VMIN = 16 +pkg syscall (freebsd-amd64-cgo), const VQUIT = 9 +pkg syscall (freebsd-amd64-cgo), const VREPRINT = 6 +pkg syscall (freebsd-amd64-cgo), const VSTART = 12 +pkg syscall (freebsd-amd64-cgo), const VSTATUS = 18 +pkg syscall (freebsd-amd64-cgo), const VSTOP = 13 +pkg syscall (freebsd-amd64-cgo), const VSUSP = 10 +pkg syscall (freebsd-amd64-cgo), const VTIME = 17 +pkg syscall (freebsd-amd64-cgo), const VWERASE = 4 +pkg syscall (freebsd-amd64-cgo), const WCONTINUED = 4 +pkg syscall (freebsd-amd64-cgo), const WCOREFLAG = 128 +pkg syscall (freebsd-amd64-cgo), const WLINUXCLONE = 2147483648 +pkg syscall (freebsd-amd64-cgo), const WNOHANG = 1 +pkg syscall (freebsd-amd64-cgo), const WNOWAIT = 8 +pkg syscall (freebsd-amd64-cgo), const WSTOPPED = 2 +pkg syscall (freebsd-amd64-cgo), const WUNTRACED = 2 +pkg syscall (freebsd-arm), const AF_APPLETALK = 16 +pkg syscall (freebsd-arm), const AF_ARP = 35 +pkg syscall (freebsd-arm), const AF_ATM = 30 +pkg syscall (freebsd-arm), const AF_BLUETOOTH = 36 +pkg syscall (freebsd-arm), const AF_CCITT = 10 +pkg syscall (freebsd-arm), const AF_CHAOS = 5 +pkg syscall (freebsd-arm), const AF_CNT = 21 +pkg syscall (freebsd-arm), const AF_COIP = 20 +pkg syscall (freebsd-arm), const AF_DATAKIT = 9 +pkg syscall (freebsd-arm), const AF_DECnet = 12 +pkg syscall (freebsd-arm), const AF_DLI = 13 +pkg syscall (freebsd-arm), const AF_E164 = 26 +pkg syscall (freebsd-arm), const AF_ECMA = 8 +pkg syscall (freebsd-arm), const AF_HYLINK = 15 +pkg syscall (freebsd-arm), const AF_IEEE80211 = 37 +pkg syscall (freebsd-arm), const AF_IMPLINK = 3 +pkg syscall (freebsd-arm), const AF_INET6 = 28 +pkg syscall (freebsd-arm), const AF_IPX = 23 +pkg syscall (freebsd-arm), const AF_ISDN = 26 +pkg syscall (freebsd-arm), const AF_ISO = 7 +pkg syscall (freebsd-arm), const AF_LAT = 14 +pkg syscall (freebsd-arm), const AF_LINK = 18 +pkg syscall (freebsd-arm), const AF_LOCAL = 1 +pkg syscall (freebsd-arm), const AF_MAX = 38 +pkg syscall (freebsd-arm), const AF_NATM = 29 +pkg syscall (freebsd-arm), const AF_NETBIOS = 6 +pkg syscall (freebsd-arm), const AF_NETGRAPH = 32 +pkg syscall (freebsd-arm), const AF_OSI = 7 +pkg syscall (freebsd-arm), const AF_PUP = 4 +pkg syscall (freebsd-arm), const AF_ROUTE = 17 +pkg syscall (freebsd-arm), const AF_SCLUSTER = 34 +pkg syscall (freebsd-arm), const AF_SIP = 24 +pkg syscall (freebsd-arm), const AF_SLOW = 33 +pkg syscall (freebsd-arm), const AF_SNA = 11 +pkg syscall (freebsd-arm), const AF_VENDOR00 = 39 +pkg syscall (freebsd-arm), const AF_VENDOR01 = 41 +pkg syscall (freebsd-arm), const AF_VENDOR02 = 43 +pkg syscall (freebsd-arm), const AF_VENDOR03 = 45 +pkg syscall (freebsd-arm), const AF_VENDOR04 = 47 +pkg syscall (freebsd-arm), const AF_VENDOR05 = 49 +pkg syscall (freebsd-arm), const AF_VENDOR06 = 51 +pkg syscall (freebsd-arm), const AF_VENDOR07 = 53 +pkg syscall (freebsd-arm), const AF_VENDOR08 = 55 +pkg syscall (freebsd-arm), const AF_VENDOR09 = 57 +pkg syscall (freebsd-arm), const AF_VENDOR10 = 59 +pkg syscall (freebsd-arm), const AF_VENDOR11 = 61 +pkg syscall (freebsd-arm), const AF_VENDOR12 = 63 +pkg syscall (freebsd-arm), const AF_VENDOR13 = 65 +pkg syscall (freebsd-arm), const AF_VENDOR14 = 67 +pkg syscall (freebsd-arm), const AF_VENDOR15 = 69 +pkg syscall (freebsd-arm), const AF_VENDOR16 = 71 +pkg syscall (freebsd-arm), const AF_VENDOR17 = 73 +pkg syscall (freebsd-arm), const AF_VENDOR18 = 75 +pkg syscall (freebsd-arm), const AF_VENDOR19 = 77 +pkg syscall (freebsd-arm), const AF_VENDOR20 = 79 +pkg syscall (freebsd-arm), const AF_VENDOR21 = 81 +pkg syscall (freebsd-arm), const AF_VENDOR22 = 83 +pkg syscall (freebsd-arm), const AF_VENDOR23 = 85 +pkg syscall (freebsd-arm), const AF_VENDOR24 = 87 +pkg syscall (freebsd-arm), const AF_VENDOR25 = 89 +pkg syscall (freebsd-arm), const AF_VENDOR26 = 91 +pkg syscall (freebsd-arm), const AF_VENDOR27 = 93 +pkg syscall (freebsd-arm), const AF_VENDOR28 = 95 +pkg syscall (freebsd-arm), const AF_VENDOR29 = 97 +pkg syscall (freebsd-arm), const AF_VENDOR30 = 99 +pkg syscall (freebsd-arm), const AF_VENDOR31 = 101 +pkg syscall (freebsd-arm), const AF_VENDOR32 = 103 +pkg syscall (freebsd-arm), const AF_VENDOR33 = 105 +pkg syscall (freebsd-arm), const AF_VENDOR34 = 107 +pkg syscall (freebsd-arm), const AF_VENDOR35 = 109 +pkg syscall (freebsd-arm), const AF_VENDOR36 = 111 +pkg syscall (freebsd-arm), const AF_VENDOR37 = 113 +pkg syscall (freebsd-arm), const AF_VENDOR38 = 115 +pkg syscall (freebsd-arm), const AF_VENDOR39 = 117 +pkg syscall (freebsd-arm), const AF_VENDOR40 = 119 +pkg syscall (freebsd-arm), const AF_VENDOR41 = 121 +pkg syscall (freebsd-arm), const AF_VENDOR42 = 123 +pkg syscall (freebsd-arm), const AF_VENDOR43 = 125 +pkg syscall (freebsd-arm), const AF_VENDOR44 = 127 +pkg syscall (freebsd-arm), const AF_VENDOR45 = 129 +pkg syscall (freebsd-arm), const AF_VENDOR46 = 131 +pkg syscall (freebsd-arm), const AF_VENDOR47 = 133 +pkg syscall (freebsd-arm), const B0 = 0 +pkg syscall (freebsd-arm), const B110 = 110 +pkg syscall (freebsd-arm), const B115200 = 115200 +pkg syscall (freebsd-arm), const B1200 = 1200 +pkg syscall (freebsd-arm), const B134 = 134 +pkg syscall (freebsd-arm), const B14400 = 14400 +pkg syscall (freebsd-arm), const B150 = 150 +pkg syscall (freebsd-arm), const B1800 = 1800 +pkg syscall (freebsd-arm), const B19200 = 19200 +pkg syscall (freebsd-arm), const B200 = 200 +pkg syscall (freebsd-arm), const B230400 = 230400 +pkg syscall (freebsd-arm), const B2400 = 2400 +pkg syscall (freebsd-arm), const B28800 = 28800 +pkg syscall (freebsd-arm), const B300 = 300 +pkg syscall (freebsd-arm), const B38400 = 38400 +pkg syscall (freebsd-arm), const B460800 = 460800 +pkg syscall (freebsd-arm), const B4800 = 4800 +pkg syscall (freebsd-arm), const B50 = 50 +pkg syscall (freebsd-arm), const B57600 = 57600 +pkg syscall (freebsd-arm), const B600 = 600 +pkg syscall (freebsd-arm), const B7200 = 7200 +pkg syscall (freebsd-arm), const B75 = 75 +pkg syscall (freebsd-arm), const B76800 = 76800 +pkg syscall (freebsd-arm), const B921600 = 921600 +pkg syscall (freebsd-arm), const B9600 = 9600 +pkg syscall (freebsd-arm), const BIOCFEEDBACK = 2147762812 +pkg syscall (freebsd-arm), const BIOCFLUSH = 536887912 +pkg syscall (freebsd-arm), const BIOCGBLEN = 1074020966 +pkg syscall (freebsd-arm), const BIOCGDIRECTION = 1074020982 +pkg syscall (freebsd-arm), const BIOCGDLT = 1074020970 +pkg syscall (freebsd-arm), const BIOCGDLTLIST = 3221766777 +pkg syscall (freebsd-arm), const BIOCGETBUFMODE = 1074020989 +pkg syscall (freebsd-arm), const BIOCGETIF = 1075855979 +pkg syscall (freebsd-arm), const BIOCGETZMAX = 1074020991 +pkg syscall (freebsd-arm), const BIOCGHDRCMPLT = 1074020980 +pkg syscall (freebsd-arm), const BIOCGRSIG = 1074020978 +pkg syscall (freebsd-arm), const BIOCGRTIMEOUT = 1074545262 +pkg syscall (freebsd-arm), const BIOCGSEESENT = 1074020982 +pkg syscall (freebsd-arm), const BIOCGSTATS = 1074283119 +pkg syscall (freebsd-arm), const BIOCGTSTAMP = 1074020995 +pkg syscall (freebsd-arm), const BIOCIMMEDIATE = 2147762800 +pkg syscall (freebsd-arm), const BIOCLOCK = 536887930 +pkg syscall (freebsd-arm), const BIOCPROMISC = 536887913 +pkg syscall (freebsd-arm), const BIOCROTZBUF = 1074545280 +pkg syscall (freebsd-arm), const BIOCSBLEN = 3221504614 +pkg syscall (freebsd-arm), const BIOCSDIRECTION = 2147762807 +pkg syscall (freebsd-arm), const BIOCSDLT = 2147762808 +pkg syscall (freebsd-arm), const BIOCSETBUFMODE = 2147762814 +pkg syscall (freebsd-arm), const BIOCSETF = 2148024935 +pkg syscall (freebsd-arm), const BIOCSETFNR = 2148024962 +pkg syscall (freebsd-arm), const BIOCSETIF = 2149597804 +pkg syscall (freebsd-arm), const BIOCSETWF = 2148024955 +pkg syscall (freebsd-arm), const BIOCSETZBUF = 2148287105 +pkg syscall (freebsd-arm), const BIOCSHDRCMPLT = 2147762805 +pkg syscall (freebsd-arm), const BIOCSRSIG = 2147762803 +pkg syscall (freebsd-arm), const BIOCSRTIMEOUT = 2148287085 +pkg syscall (freebsd-arm), const BIOCSSEESENT = 2147762807 +pkg syscall (freebsd-arm), const BIOCSTSTAMP = 2147762820 +pkg syscall (freebsd-arm), const BIOCVERSION = 1074020977 +pkg syscall (freebsd-arm), const BPF_A = 16 +pkg syscall (freebsd-arm), const BPF_ABS = 32 +pkg syscall (freebsd-arm), const BPF_ADD = 0 +pkg syscall (freebsd-arm), const BPF_ALIGNMENT = 4 +pkg syscall (freebsd-arm), const BPF_ALU = 4 +pkg syscall (freebsd-arm), const BPF_AND = 80 +pkg syscall (freebsd-arm), const BPF_B = 16 +pkg syscall (freebsd-arm), const BPF_BUFMODE_BUFFER = 1 +pkg syscall (freebsd-arm), const BPF_BUFMODE_ZBUF = 2 +pkg syscall (freebsd-arm), const BPF_DIV = 48 +pkg syscall (freebsd-arm), const BPF_H = 8 +pkg syscall (freebsd-arm), const BPF_IMM = 0 +pkg syscall (freebsd-arm), const BPF_IND = 64 +pkg syscall (freebsd-arm), const BPF_JA = 0 +pkg syscall (freebsd-arm), const BPF_JEQ = 16 +pkg syscall (freebsd-arm), const BPF_JGE = 48 +pkg syscall (freebsd-arm), const BPF_JGT = 32 +pkg syscall (freebsd-arm), const BPF_JMP = 5 +pkg syscall (freebsd-arm), const BPF_JSET = 64 +pkg syscall (freebsd-arm), const BPF_K = 0 +pkg syscall (freebsd-arm), const BPF_LD = 0 +pkg syscall (freebsd-arm), const BPF_LDX = 1 +pkg syscall (freebsd-arm), const BPF_LEN = 128 +pkg syscall (freebsd-arm), const BPF_LSH = 96 +pkg syscall (freebsd-arm), const BPF_MAJOR_VERSION = 1 +pkg syscall (freebsd-arm), const BPF_MAXBUFSIZE = 524288 +pkg syscall (freebsd-arm), const BPF_MAXINSNS = 512 +pkg syscall (freebsd-arm), const BPF_MEM = 96 +pkg syscall (freebsd-arm), const BPF_MEMWORDS = 16 +pkg syscall (freebsd-arm), const BPF_MINBUFSIZE = 32 +pkg syscall (freebsd-arm), const BPF_MINOR_VERSION = 1 +pkg syscall (freebsd-arm), const BPF_MISC = 7 +pkg syscall (freebsd-arm), const BPF_MSH = 160 +pkg syscall (freebsd-arm), const BPF_MUL = 32 +pkg syscall (freebsd-arm), const BPF_NEG = 128 +pkg syscall (freebsd-arm), const BPF_OR = 64 +pkg syscall (freebsd-arm), const BPF_RELEASE = 199606 +pkg syscall (freebsd-arm), const BPF_RET = 6 +pkg syscall (freebsd-arm), const BPF_RSH = 112 +pkg syscall (freebsd-arm), const BPF_ST = 2 +pkg syscall (freebsd-arm), const BPF_STX = 3 +pkg syscall (freebsd-arm), const BPF_SUB = 16 +pkg syscall (freebsd-arm), const BPF_TAX = 0 +pkg syscall (freebsd-arm), const BPF_TXA = 128 +pkg syscall (freebsd-arm), const BPF_T_BINTIME = 2 +pkg syscall (freebsd-arm), const BPF_T_BINTIME_FAST = 258 +pkg syscall (freebsd-arm), const BPF_T_BINTIME_MONOTONIC = 514 +pkg syscall (freebsd-arm), const BPF_T_BINTIME_MONOTONIC_FAST = 770 +pkg syscall (freebsd-arm), const BPF_T_FAST = 256 +pkg syscall (freebsd-arm), const BPF_T_FLAG_MASK = 768 +pkg syscall (freebsd-arm), const BPF_T_FORMAT_MASK = 3 +pkg syscall (freebsd-arm), const BPF_T_MICROTIME = 0 +pkg syscall (freebsd-arm), const BPF_T_MICROTIME_FAST = 256 +pkg syscall (freebsd-arm), const BPF_T_MICROTIME_MONOTONIC = 512 +pkg syscall (freebsd-arm), const BPF_T_MICROTIME_MONOTONIC_FAST = 768 +pkg syscall (freebsd-arm), const BPF_T_MONOTONIC = 512 +pkg syscall (freebsd-arm), const BPF_T_MONOTONIC_FAST = 768 +pkg syscall (freebsd-arm), const BPF_T_NANOTIME = 1 +pkg syscall (freebsd-arm), const BPF_T_NANOTIME_FAST = 257 +pkg syscall (freebsd-arm), const BPF_T_NANOTIME_MONOTONIC = 513 +pkg syscall (freebsd-arm), const BPF_T_NANOTIME_MONOTONIC_FAST = 769 +pkg syscall (freebsd-arm), const BPF_T_NONE = 3 +pkg syscall (freebsd-arm), const BPF_T_NORMAL = 0 +pkg syscall (freebsd-arm), const BPF_W = 0 +pkg syscall (freebsd-arm), const BPF_X = 8 +pkg syscall (freebsd-arm), const BRKINT = 2 +pkg syscall (freebsd-arm), const CFLUSH = 15 +pkg syscall (freebsd-arm), const CLOCAL = 32768 +pkg syscall (freebsd-arm), const CREAD = 2048 +pkg syscall (freebsd-arm), const CS5 = 0 +pkg syscall (freebsd-arm), const CS6 = 256 +pkg syscall (freebsd-arm), const CS7 = 512 +pkg syscall (freebsd-arm), const CS8 = 768 +pkg syscall (freebsd-arm), const CSIZE = 768 +pkg syscall (freebsd-arm), const CSTART = 17 +pkg syscall (freebsd-arm), const CSTATUS = 20 +pkg syscall (freebsd-arm), const CSTOP = 19 +pkg syscall (freebsd-arm), const CSTOPB = 1024 +pkg syscall (freebsd-arm), const CSUSP = 26 +pkg syscall (freebsd-arm), const CTL_MAXNAME = 24 +pkg syscall (freebsd-arm), const CTL_NET = 4 +pkg syscall (freebsd-arm), const DLT_A429 = 184 +pkg syscall (freebsd-arm), const DLT_A653_ICM = 185 +pkg syscall (freebsd-arm), const DLT_AIRONET_HEADER = 120 +pkg syscall (freebsd-arm), const DLT_AOS = 222 +pkg syscall (freebsd-arm), const DLT_APPLE_IP_OVER_IEEE1394 = 138 +pkg syscall (freebsd-arm), const DLT_ARCNET = 7 +pkg syscall (freebsd-arm), const DLT_ARCNET_LINUX = 129 +pkg syscall (freebsd-arm), const DLT_ATM_CLIP = 19 +pkg syscall (freebsd-arm), const DLT_ATM_RFC1483 = 11 +pkg syscall (freebsd-arm), const DLT_AURORA = 126 +pkg syscall (freebsd-arm), const DLT_AX25 = 3 +pkg syscall (freebsd-arm), const DLT_AX25_KISS = 202 +pkg syscall (freebsd-arm), const DLT_BACNET_MS_TP = 165 +pkg syscall (freebsd-arm), const DLT_BLUETOOTH_HCI_H4 = 187 +pkg syscall (freebsd-arm), const DLT_BLUETOOTH_HCI_H4_WITH_PHDR = 201 +pkg syscall (freebsd-arm), const DLT_CAN20B = 190 +pkg syscall (freebsd-arm), const DLT_CAN_SOCKETCAN = 227 +pkg syscall (freebsd-arm), const DLT_CHAOS = 5 +pkg syscall (freebsd-arm), const DLT_CHDLC = 104 +pkg syscall (freebsd-arm), const DLT_CISCO_IOS = 118 +pkg syscall (freebsd-arm), const DLT_C_HDLC = 104 +pkg syscall (freebsd-arm), const DLT_C_HDLC_WITH_DIR = 205 +pkg syscall (freebsd-arm), const DLT_DBUS = 231 +pkg syscall (freebsd-arm), const DLT_DECT = 221 +pkg syscall (freebsd-arm), const DLT_DOCSIS = 143 +pkg syscall (freebsd-arm), const DLT_DVB_CI = 235 +pkg syscall (freebsd-arm), const DLT_ECONET = 115 +pkg syscall (freebsd-arm), const DLT_EN10MB = 1 +pkg syscall (freebsd-arm), const DLT_EN3MB = 2 +pkg syscall (freebsd-arm), const DLT_ENC = 109 +pkg syscall (freebsd-arm), const DLT_ERF = 197 +pkg syscall (freebsd-arm), const DLT_ERF_ETH = 175 +pkg syscall (freebsd-arm), const DLT_ERF_POS = 176 +pkg syscall (freebsd-arm), const DLT_FC_2 = 224 +pkg syscall (freebsd-arm), const DLT_FC_2_WITH_FRAME_DELIMS = 225 +pkg syscall (freebsd-arm), const DLT_FDDI = 10 +pkg syscall (freebsd-arm), const DLT_FLEXRAY = 210 +pkg syscall (freebsd-arm), const DLT_FRELAY = 107 +pkg syscall (freebsd-arm), const DLT_FRELAY_WITH_DIR = 206 +pkg syscall (freebsd-arm), const DLT_GCOM_SERIAL = 173 +pkg syscall (freebsd-arm), const DLT_GCOM_T1E1 = 172 +pkg syscall (freebsd-arm), const DLT_GPF_F = 171 +pkg syscall (freebsd-arm), const DLT_GPF_T = 170 +pkg syscall (freebsd-arm), const DLT_GPRS_LLC = 169 +pkg syscall (freebsd-arm), const DLT_GSMTAP_ABIS = 218 +pkg syscall (freebsd-arm), const DLT_GSMTAP_UM = 217 +pkg syscall (freebsd-arm), const DLT_HHDLC = 121 +pkg syscall (freebsd-arm), const DLT_IBM_SN = 146 +pkg syscall (freebsd-arm), const DLT_IBM_SP = 145 +pkg syscall (freebsd-arm), const DLT_IEEE802 = 6 +pkg syscall (freebsd-arm), const DLT_IEEE802_11 = 105 +pkg syscall (freebsd-arm), const DLT_IEEE802_11_RADIO = 127 +pkg syscall (freebsd-arm), const DLT_IEEE802_11_RADIO_AVS = 163 +pkg syscall (freebsd-arm), const DLT_IEEE802_15_4 = 195 +pkg syscall (freebsd-arm), const DLT_IEEE802_15_4_LINUX = 191 +pkg syscall (freebsd-arm), const DLT_IEEE802_15_4_NOFCS = 230 +pkg syscall (freebsd-arm), const DLT_IEEE802_15_4_NONASK_PHY = 215 +pkg syscall (freebsd-arm), const DLT_IEEE802_16_MAC_CPS = 188 +pkg syscall (freebsd-arm), const DLT_IEEE802_16_MAC_CPS_RADIO = 193 +pkg syscall (freebsd-arm), const DLT_IPFILTER = 116 +pkg syscall (freebsd-arm), const DLT_IPMB = 199 +pkg syscall (freebsd-arm), const DLT_IPMB_LINUX = 209 +pkg syscall (freebsd-arm), const DLT_IPNET = 226 +pkg syscall (freebsd-arm), const DLT_IPOIB = 242 +pkg syscall (freebsd-arm), const DLT_IPV4 = 228 +pkg syscall (freebsd-arm), const DLT_IPV6 = 229 +pkg syscall (freebsd-arm), const DLT_IP_OVER_FC = 122 +pkg syscall (freebsd-arm), const DLT_JUNIPER_ATM1 = 137 +pkg syscall (freebsd-arm), const DLT_JUNIPER_ATM2 = 135 +pkg syscall (freebsd-arm), const DLT_JUNIPER_ATM_CEMIC = 238 +pkg syscall (freebsd-arm), const DLT_JUNIPER_CHDLC = 181 +pkg syscall (freebsd-arm), const DLT_JUNIPER_ES = 132 +pkg syscall (freebsd-arm), const DLT_JUNIPER_ETHER = 178 +pkg syscall (freebsd-arm), const DLT_JUNIPER_FIBRECHANNEL = 234 +pkg syscall (freebsd-arm), const DLT_JUNIPER_FRELAY = 180 +pkg syscall (freebsd-arm), const DLT_JUNIPER_GGSN = 133 +pkg syscall (freebsd-arm), const DLT_JUNIPER_ISM = 194 +pkg syscall (freebsd-arm), const DLT_JUNIPER_MFR = 134 +pkg syscall (freebsd-arm), const DLT_JUNIPER_MLFR = 131 +pkg syscall (freebsd-arm), const DLT_JUNIPER_MLPPP = 130 +pkg syscall (freebsd-arm), const DLT_JUNIPER_MONITOR = 164 +pkg syscall (freebsd-arm), const DLT_JUNIPER_PIC_PEER = 174 +pkg syscall (freebsd-arm), const DLT_JUNIPER_PPP = 179 +pkg syscall (freebsd-arm), const DLT_JUNIPER_PPPOE = 167 +pkg syscall (freebsd-arm), const DLT_JUNIPER_PPPOE_ATM = 168 +pkg syscall (freebsd-arm), const DLT_JUNIPER_SERVICES = 136 +pkg syscall (freebsd-arm), const DLT_JUNIPER_SRX_E2E = 233 +pkg syscall (freebsd-arm), const DLT_JUNIPER_ST = 200 +pkg syscall (freebsd-arm), const DLT_JUNIPER_VP = 183 +pkg syscall (freebsd-arm), const DLT_JUNIPER_VS = 232 +pkg syscall (freebsd-arm), const DLT_LAPB_WITH_DIR = 207 +pkg syscall (freebsd-arm), const DLT_LAPD = 203 +pkg syscall (freebsd-arm), const DLT_LIN = 212 +pkg syscall (freebsd-arm), const DLT_LINUX_EVDEV = 216 +pkg syscall (freebsd-arm), const DLT_LINUX_IRDA = 144 +pkg syscall (freebsd-arm), const DLT_LINUX_LAPD = 177 +pkg syscall (freebsd-arm), const DLT_LINUX_PPP_WITHDIRECTION = 166 +pkg syscall (freebsd-arm), const DLT_LINUX_SLL = 113 +pkg syscall (freebsd-arm), const DLT_LOOP = 108 +pkg syscall (freebsd-arm), const DLT_LTALK = 114 +pkg syscall (freebsd-arm), const DLT_MATCHING_MAX = 246 +pkg syscall (freebsd-arm), const DLT_MATCHING_MIN = 104 +pkg syscall (freebsd-arm), const DLT_MFR = 182 +pkg syscall (freebsd-arm), const DLT_MOST = 211 +pkg syscall (freebsd-arm), const DLT_MPEG_2_TS = 243 +pkg syscall (freebsd-arm), const DLT_MPLS = 219 +pkg syscall (freebsd-arm), const DLT_MTP2 = 140 +pkg syscall (freebsd-arm), const DLT_MTP2_WITH_PHDR = 139 +pkg syscall (freebsd-arm), const DLT_MTP3 = 141 +pkg syscall (freebsd-arm), const DLT_MUX27010 = 236 +pkg syscall (freebsd-arm), const DLT_NETANALYZER = 240 +pkg syscall (freebsd-arm), const DLT_NETANALYZER_TRANSPARENT = 241 +pkg syscall (freebsd-arm), const DLT_NFC_LLCP = 245 +pkg syscall (freebsd-arm), const DLT_NFLOG = 239 +pkg syscall (freebsd-arm), const DLT_NG40 = 244 +pkg syscall (freebsd-arm), const DLT_NULL = 0 +pkg syscall (freebsd-arm), const DLT_PCI_EXP = 125 +pkg syscall (freebsd-arm), const DLT_PFLOG = 117 +pkg syscall (freebsd-arm), const DLT_PFSYNC = 121 +pkg syscall (freebsd-arm), const DLT_PPI = 192 +pkg syscall (freebsd-arm), const DLT_PPP = 9 +pkg syscall (freebsd-arm), const DLT_PPP_BSDOS = 16 +pkg syscall (freebsd-arm), const DLT_PPP_ETHER = 51 +pkg syscall (freebsd-arm), const DLT_PPP_PPPD = 166 +pkg syscall (freebsd-arm), const DLT_PPP_SERIAL = 50 +pkg syscall (freebsd-arm), const DLT_PPP_WITH_DIR = 204 +pkg syscall (freebsd-arm), const DLT_PPP_WITH_DIRECTION = 166 +pkg syscall (freebsd-arm), const DLT_PRISM_HEADER = 119 +pkg syscall (freebsd-arm), const DLT_PRONET = 4 +pkg syscall (freebsd-arm), const DLT_RAIF1 = 198 +pkg syscall (freebsd-arm), const DLT_RAW = 12 +pkg syscall (freebsd-arm), const DLT_RIO = 124 +pkg syscall (freebsd-arm), const DLT_SCCP = 142 +pkg syscall (freebsd-arm), const DLT_SITA = 196 +pkg syscall (freebsd-arm), const DLT_SLIP = 8 +pkg syscall (freebsd-arm), const DLT_SLIP_BSDOS = 15 +pkg syscall (freebsd-arm), const DLT_STANAG_5066_D_PDU = 237 +pkg syscall (freebsd-arm), const DLT_SUNATM = 123 +pkg syscall (freebsd-arm), const DLT_SYMANTEC_FIREWALL = 99 +pkg syscall (freebsd-arm), const DLT_TZSP = 128 +pkg syscall (freebsd-arm), const DLT_USB = 186 +pkg syscall (freebsd-arm), const DLT_USB_LINUX = 189 +pkg syscall (freebsd-arm), const DLT_USB_LINUX_MMAPPED = 220 +pkg syscall (freebsd-arm), const DLT_USER0 = 147 +pkg syscall (freebsd-arm), const DLT_USER1 = 148 +pkg syscall (freebsd-arm), const DLT_USER10 = 157 +pkg syscall (freebsd-arm), const DLT_USER11 = 158 +pkg syscall (freebsd-arm), const DLT_USER12 = 159 +pkg syscall (freebsd-arm), const DLT_USER13 = 160 +pkg syscall (freebsd-arm), const DLT_USER14 = 161 +pkg syscall (freebsd-arm), const DLT_USER15 = 162 +pkg syscall (freebsd-arm), const DLT_USER2 = 149 +pkg syscall (freebsd-arm), const DLT_USER3 = 150 +pkg syscall (freebsd-arm), const DLT_USER4 = 151 +pkg syscall (freebsd-arm), const DLT_USER5 = 152 +pkg syscall (freebsd-arm), const DLT_USER6 = 153 +pkg syscall (freebsd-arm), const DLT_USER7 = 154 +pkg syscall (freebsd-arm), const DLT_USER8 = 155 +pkg syscall (freebsd-arm), const DLT_USER9 = 156 +pkg syscall (freebsd-arm), const DLT_WIHART = 223 +pkg syscall (freebsd-arm), const DLT_X2E_SERIAL = 213 +pkg syscall (freebsd-arm), const DLT_X2E_XORAYA = 214 +pkg syscall (freebsd-arm), const DT_BLK = 6 +pkg syscall (freebsd-arm), const DT_CHR = 2 +pkg syscall (freebsd-arm), const DT_DIR = 4 +pkg syscall (freebsd-arm), const DT_FIFO = 1 +pkg syscall (freebsd-arm), const DT_LNK = 10 +pkg syscall (freebsd-arm), const DT_REG = 8 +pkg syscall (freebsd-arm), const DT_SOCK = 12 +pkg syscall (freebsd-arm), const DT_UNKNOWN = 0 +pkg syscall (freebsd-arm), const DT_WHT = 14 +pkg syscall (freebsd-arm), const E2BIG = 7 +pkg syscall (freebsd-arm), const EACCES = 13 +pkg syscall (freebsd-arm), const EADDRINUSE = 48 +pkg syscall (freebsd-arm), const EADDRNOTAVAIL = 49 +pkg syscall (freebsd-arm), const EAFNOSUPPORT = 47 +pkg syscall (freebsd-arm), const EAGAIN = 35 +pkg syscall (freebsd-arm), const EALREADY = 37 +pkg syscall (freebsd-arm), const EAUTH = 80 +pkg syscall (freebsd-arm), const EBADF = 9 +pkg syscall (freebsd-arm), const EBADMSG = 89 +pkg syscall (freebsd-arm), const EBADRPC = 72 +pkg syscall (freebsd-arm), const EBUSY = 16 +pkg syscall (freebsd-arm), const ECANCELED = 85 +pkg syscall (freebsd-arm), const ECAPMODE = 94 +pkg syscall (freebsd-arm), const ECHILD = 10 +pkg syscall (freebsd-arm), const ECHO = 8 +pkg syscall (freebsd-arm), const ECHOCTL = 64 +pkg syscall (freebsd-arm), const ECHOE = 2 +pkg syscall (freebsd-arm), const ECHOK = 4 +pkg syscall (freebsd-arm), const ECHOKE = 1 +pkg syscall (freebsd-arm), const ECHONL = 16 +pkg syscall (freebsd-arm), const ECHOPRT = 32 +pkg syscall (freebsd-arm), const ECONNABORTED = 53 +pkg syscall (freebsd-arm), const ECONNREFUSED = 61 +pkg syscall (freebsd-arm), const ECONNRESET = 54 +pkg syscall (freebsd-arm), const EDEADLK = 11 +pkg syscall (freebsd-arm), const EDESTADDRREQ = 39 +pkg syscall (freebsd-arm), const EDOM = 33 +pkg syscall (freebsd-arm), const EDOOFUS = 88 +pkg syscall (freebsd-arm), const EDQUOT = 69 +pkg syscall (freebsd-arm), const EEXIST = 17 +pkg syscall (freebsd-arm), const EFAULT = 14 +pkg syscall (freebsd-arm), const EFBIG = 27 +pkg syscall (freebsd-arm), const EFTYPE = 79 +pkg syscall (freebsd-arm), const EHOSTDOWN = 64 +pkg syscall (freebsd-arm), const EHOSTUNREACH = 65 +pkg syscall (freebsd-arm), const EIDRM = 82 +pkg syscall (freebsd-arm), const EILSEQ = 86 +pkg syscall (freebsd-arm), const EINPROGRESS = 36 +pkg syscall (freebsd-arm), const EINTR = 4 +pkg syscall (freebsd-arm), const EINVAL = 22 +pkg syscall (freebsd-arm), const EIO = 5 +pkg syscall (freebsd-arm), const EISCONN = 56 +pkg syscall (freebsd-arm), const EISDIR = 21 +pkg syscall (freebsd-arm), const ELAST = 94 +pkg syscall (freebsd-arm), const ELOOP = 62 +pkg syscall (freebsd-arm), const EMFILE = 24 +pkg syscall (freebsd-arm), const EMLINK = 31 +pkg syscall (freebsd-arm), const EMSGSIZE = 40 +pkg syscall (freebsd-arm), const EMULTIHOP = 90 +pkg syscall (freebsd-arm), const ENAMETOOLONG = 63 +pkg syscall (freebsd-arm), const ENEEDAUTH = 81 +pkg syscall (freebsd-arm), const ENETDOWN = 50 +pkg syscall (freebsd-arm), const ENETRESET = 52 +pkg syscall (freebsd-arm), const ENETUNREACH = 51 +pkg syscall (freebsd-arm), const ENFILE = 23 +pkg syscall (freebsd-arm), const ENOATTR = 87 +pkg syscall (freebsd-arm), const ENOBUFS = 55 +pkg syscall (freebsd-arm), const ENODEV = 19 +pkg syscall (freebsd-arm), const ENOEXEC = 8 +pkg syscall (freebsd-arm), const ENOLCK = 77 +pkg syscall (freebsd-arm), const ENOLINK = 91 +pkg syscall (freebsd-arm), const ENOMEM = 12 +pkg syscall (freebsd-arm), const ENOMSG = 83 +pkg syscall (freebsd-arm), const ENOPROTOOPT = 42 +pkg syscall (freebsd-arm), const ENOSPC = 28 +pkg syscall (freebsd-arm), const ENOSYS = 78 +pkg syscall (freebsd-arm), const ENOTBLK = 15 +pkg syscall (freebsd-arm), const ENOTCAPABLE = 93 +pkg syscall (freebsd-arm), const ENOTCONN = 57 +pkg syscall (freebsd-arm), const ENOTDIR = 20 +pkg syscall (freebsd-arm), const ENOTEMPTY = 66 +pkg syscall (freebsd-arm), const ENOTSOCK = 38 +pkg syscall (freebsd-arm), const ENOTSUP = 45 +pkg syscall (freebsd-arm), const ENOTTY = 25 +pkg syscall (freebsd-arm), const ENXIO = 6 +pkg syscall (freebsd-arm), const EOPNOTSUPP = 45 +pkg syscall (freebsd-arm), const EOVERFLOW = 84 +pkg syscall (freebsd-arm), const EPERM = 1 +pkg syscall (freebsd-arm), const EPFNOSUPPORT = 46 +pkg syscall (freebsd-arm), const EPIPE = 32 +pkg syscall (freebsd-arm), const EPROCLIM = 67 +pkg syscall (freebsd-arm), const EPROCUNAVAIL = 76 +pkg syscall (freebsd-arm), const EPROGMISMATCH = 75 +pkg syscall (freebsd-arm), const EPROGUNAVAIL = 74 +pkg syscall (freebsd-arm), const EPROTO = 92 +pkg syscall (freebsd-arm), const EPROTONOSUPPORT = 43 +pkg syscall (freebsd-arm), const EPROTOTYPE = 41 +pkg syscall (freebsd-arm), const ERANGE = 34 +pkg syscall (freebsd-arm), const EREMOTE = 71 +pkg syscall (freebsd-arm), const EROFS = 30 +pkg syscall (freebsd-arm), const ERPCMISMATCH = 73 +pkg syscall (freebsd-arm), const ESHUTDOWN = 58 +pkg syscall (freebsd-arm), const ESOCKTNOSUPPORT = 44 +pkg syscall (freebsd-arm), const ESPIPE = 29 +pkg syscall (freebsd-arm), const ESRCH = 3 +pkg syscall (freebsd-arm), const ESTALE = 70 +pkg syscall (freebsd-arm), const ETIMEDOUT = 60 +pkg syscall (freebsd-arm), const ETOOMANYREFS = 59 +pkg syscall (freebsd-arm), const ETXTBSY = 26 +pkg syscall (freebsd-arm), const EUSERS = 68 +pkg syscall (freebsd-arm), const EVFILT_AIO = -3 +pkg syscall (freebsd-arm), const EVFILT_FS = -9 +pkg syscall (freebsd-arm), const EVFILT_LIO = -10 +pkg syscall (freebsd-arm), const EVFILT_PROC = -5 +pkg syscall (freebsd-arm), const EVFILT_READ = -1 +pkg syscall (freebsd-arm), const EVFILT_SIGNAL = -6 +pkg syscall (freebsd-arm), const EVFILT_SYSCOUNT = 11 +pkg syscall (freebsd-arm), const EVFILT_TIMER = -7 +pkg syscall (freebsd-arm), const EVFILT_USER = -11 +pkg syscall (freebsd-arm), const EVFILT_VNODE = -4 +pkg syscall (freebsd-arm), const EVFILT_WRITE = -2 +pkg syscall (freebsd-arm), const EV_ADD = 1 +pkg syscall (freebsd-arm), const EV_CLEAR = 32 +pkg syscall (freebsd-arm), const EV_DELETE = 2 +pkg syscall (freebsd-arm), const EV_DISABLE = 8 +pkg syscall (freebsd-arm), const EV_DISPATCH = 128 +pkg syscall (freebsd-arm), const EV_ENABLE = 4 +pkg syscall (freebsd-arm), const EV_EOF = 32768 +pkg syscall (freebsd-arm), const EV_ERROR = 16384 +pkg syscall (freebsd-arm), const EV_FLAG1 = 8192 +pkg syscall (freebsd-arm), const EV_ONESHOT = 16 +pkg syscall (freebsd-arm), const EV_RECEIPT = 64 +pkg syscall (freebsd-arm), const EV_SYSFLAGS = 61440 +pkg syscall (freebsd-arm), const EWOULDBLOCK = 35 +pkg syscall (freebsd-arm), const EXDEV = 18 +pkg syscall (freebsd-arm), const EXTA = 19200 +pkg syscall (freebsd-arm), const EXTB = 38400 +pkg syscall (freebsd-arm), const EXTPROC = 2048 +pkg syscall (freebsd-arm), const FD_CLOEXEC = 1 +pkg syscall (freebsd-arm), const FD_SETSIZE = 1024 +pkg syscall (freebsd-arm), const FLUSHO = 8388608 +pkg syscall (freebsd-arm), const F_CANCEL = 5 +pkg syscall (freebsd-arm), const F_DUP2FD = 10 +pkg syscall (freebsd-arm), const F_DUP2FD_CLOEXEC = 18 +pkg syscall (freebsd-arm), const F_DUPFD = 0 +pkg syscall (freebsd-arm), const F_DUPFD_CLOEXEC = 17 +pkg syscall (freebsd-arm), const F_GETFD = 1 +pkg syscall (freebsd-arm), const F_GETFL = 3 +pkg syscall (freebsd-arm), const F_GETLK = 11 +pkg syscall (freebsd-arm), const F_GETOWN = 5 +pkg syscall (freebsd-arm), const F_OGETLK = 7 +pkg syscall (freebsd-arm), const F_OK = 0 +pkg syscall (freebsd-arm), const F_OSETLK = 8 +pkg syscall (freebsd-arm), const F_OSETLKW = 9 +pkg syscall (freebsd-arm), const F_RDAHEAD = 16 +pkg syscall (freebsd-arm), const F_RDLCK = 1 +pkg syscall (freebsd-arm), const F_READAHEAD = 15 +pkg syscall (freebsd-arm), const F_SETFD = 2 +pkg syscall (freebsd-arm), const F_SETFL = 4 +pkg syscall (freebsd-arm), const F_SETLK = 12 +pkg syscall (freebsd-arm), const F_SETLKW = 13 +pkg syscall (freebsd-arm), const F_SETLK_REMOTE = 14 +pkg syscall (freebsd-arm), const F_SETOWN = 6 +pkg syscall (freebsd-arm), const F_UNLCK = 2 +pkg syscall (freebsd-arm), const F_UNLCKSYS = 4 +pkg syscall (freebsd-arm), const F_WRLCK = 3 +pkg syscall (freebsd-arm), const HUPCL = 16384 +pkg syscall (freebsd-arm), const ICANON = 256 +pkg syscall (freebsd-arm), const ICRNL = 256 +pkg syscall (freebsd-arm), const IEXTEN = 1024 +pkg syscall (freebsd-arm), const IFAN_ARRIVAL = 0 +pkg syscall (freebsd-arm), const IFAN_DEPARTURE = 1 +pkg syscall (freebsd-arm), const IFF_ALLMULTI = 512 +pkg syscall (freebsd-arm), const IFF_ALTPHYS = 16384 +pkg syscall (freebsd-arm), const IFF_CANTCHANGE = 2199410 +pkg syscall (freebsd-arm), const IFF_CANTCONFIG = 65536 +pkg syscall (freebsd-arm), const IFF_DEBUG = 4 +pkg syscall (freebsd-arm), const IFF_DRV_OACTIVE = 1024 +pkg syscall (freebsd-arm), const IFF_DRV_RUNNING = 64 +pkg syscall (freebsd-arm), const IFF_DYING = 2097152 +pkg syscall (freebsd-arm), const IFF_LINK0 = 4096 +pkg syscall (freebsd-arm), const IFF_LINK1 = 8192 +pkg syscall (freebsd-arm), const IFF_LINK2 = 16384 +pkg syscall (freebsd-arm), const IFF_LOOPBACK = 8 +pkg syscall (freebsd-arm), const IFF_MONITOR = 262144 +pkg syscall (freebsd-arm), const IFF_MULTICAST = 32768 +pkg syscall (freebsd-arm), const IFF_NOARP = 128 +pkg syscall (freebsd-arm), const IFF_OACTIVE = 1024 +pkg syscall (freebsd-arm), const IFF_POINTOPOINT = 16 +pkg syscall (freebsd-arm), const IFF_PPROMISC = 131072 +pkg syscall (freebsd-arm), const IFF_PROMISC = 256 +pkg syscall (freebsd-arm), const IFF_RENAMING = 4194304 +pkg syscall (freebsd-arm), const IFF_RUNNING = 64 +pkg syscall (freebsd-arm), const IFF_SIMPLEX = 2048 +pkg syscall (freebsd-arm), const IFF_SMART = 32 +pkg syscall (freebsd-arm), const IFF_STATICARP = 524288 +pkg syscall (freebsd-arm), const IFNAMSIZ = 16 +pkg syscall (freebsd-arm), const IFT_1822 = 2 +pkg syscall (freebsd-arm), const IFT_A12MPPSWITCH = 130 +pkg syscall (freebsd-arm), const IFT_AAL2 = 187 +pkg syscall (freebsd-arm), const IFT_AAL5 = 49 +pkg syscall (freebsd-arm), const IFT_ADSL = 94 +pkg syscall (freebsd-arm), const IFT_AFLANE8023 = 59 +pkg syscall (freebsd-arm), const IFT_AFLANE8025 = 60 +pkg syscall (freebsd-arm), const IFT_ARAP = 88 +pkg syscall (freebsd-arm), const IFT_ARCNET = 35 +pkg syscall (freebsd-arm), const IFT_ARCNETPLUS = 36 +pkg syscall (freebsd-arm), const IFT_ASYNC = 84 +pkg syscall (freebsd-arm), const IFT_ATM = 37 +pkg syscall (freebsd-arm), const IFT_ATMDXI = 105 +pkg syscall (freebsd-arm), const IFT_ATMFUNI = 106 +pkg syscall (freebsd-arm), const IFT_ATMIMA = 107 +pkg syscall (freebsd-arm), const IFT_ATMLOGICAL = 80 +pkg syscall (freebsd-arm), const IFT_ATMRADIO = 189 +pkg syscall (freebsd-arm), const IFT_ATMSUBINTERFACE = 134 +pkg syscall (freebsd-arm), const IFT_ATMVCIENDPT = 194 +pkg syscall (freebsd-arm), const IFT_ATMVIRTUAL = 149 +pkg syscall (freebsd-arm), const IFT_BGPPOLICYACCOUNTING = 162 +pkg syscall (freebsd-arm), const IFT_BRIDGE = 209 +pkg syscall (freebsd-arm), const IFT_BSC = 83 +pkg syscall (freebsd-arm), const IFT_CCTEMUL = 61 +pkg syscall (freebsd-arm), const IFT_CEPT = 19 +pkg syscall (freebsd-arm), const IFT_CES = 133 +pkg syscall (freebsd-arm), const IFT_CHANNEL = 70 +pkg syscall (freebsd-arm), const IFT_CNR = 85 +pkg syscall (freebsd-arm), const IFT_COFFEE = 132 +pkg syscall (freebsd-arm), const IFT_COMPOSITELINK = 155 +pkg syscall (freebsd-arm), const IFT_DCN = 141 +pkg syscall (freebsd-arm), const IFT_DIGITALPOWERLINE = 138 +pkg syscall (freebsd-arm), const IFT_DIGITALWRAPPEROVERHEADCHANNEL = 186 +pkg syscall (freebsd-arm), const IFT_DLSW = 74 +pkg syscall (freebsd-arm), const IFT_DOCSCABLEDOWNSTREAM = 128 +pkg syscall (freebsd-arm), const IFT_DOCSCABLEMACLAYER = 127 +pkg syscall (freebsd-arm), const IFT_DOCSCABLEUPSTREAM = 129 +pkg syscall (freebsd-arm), const IFT_DS0 = 81 +pkg syscall (freebsd-arm), const IFT_DS0BUNDLE = 82 +pkg syscall (freebsd-arm), const IFT_DS1FDL = 170 +pkg syscall (freebsd-arm), const IFT_DS3 = 30 +pkg syscall (freebsd-arm), const IFT_DTM = 140 +pkg syscall (freebsd-arm), const IFT_DVBASILN = 172 +pkg syscall (freebsd-arm), const IFT_DVBASIOUT = 173 +pkg syscall (freebsd-arm), const IFT_DVBRCCDOWNSTREAM = 147 +pkg syscall (freebsd-arm), const IFT_DVBRCCMACLAYER = 146 +pkg syscall (freebsd-arm), const IFT_DVBRCCUPSTREAM = 148 +pkg syscall (freebsd-arm), const IFT_ENC = 244 +pkg syscall (freebsd-arm), const IFT_EON = 25 +pkg syscall (freebsd-arm), const IFT_EPLRS = 87 +pkg syscall (freebsd-arm), const IFT_ESCON = 73 +pkg syscall (freebsd-arm), const IFT_ETHER = 6 +pkg syscall (freebsd-arm), const IFT_FAITH = 242 +pkg syscall (freebsd-arm), const IFT_FAST = 125 +pkg syscall (freebsd-arm), const IFT_FASTETHER = 62 +pkg syscall (freebsd-arm), const IFT_FASTETHERFX = 69 +pkg syscall (freebsd-arm), const IFT_FDDI = 15 +pkg syscall (freebsd-arm), const IFT_FIBRECHANNEL = 56 +pkg syscall (freebsd-arm), const IFT_FRAMERELAYINTERCONNECT = 58 +pkg syscall (freebsd-arm), const IFT_FRAMERELAYMPI = 92 +pkg syscall (freebsd-arm), const IFT_FRDLCIENDPT = 193 +pkg syscall (freebsd-arm), const IFT_FRELAY = 32 +pkg syscall (freebsd-arm), const IFT_FRELAYDCE = 44 +pkg syscall (freebsd-arm), const IFT_FRF16MFRBUNDLE = 163 +pkg syscall (freebsd-arm), const IFT_FRFORWARD = 158 +pkg syscall (freebsd-arm), const IFT_G703AT2MB = 67 +pkg syscall (freebsd-arm), const IFT_G703AT64K = 66 +pkg syscall (freebsd-arm), const IFT_GIF = 240 +pkg syscall (freebsd-arm), const IFT_GIGABITETHERNET = 117 +pkg syscall (freebsd-arm), const IFT_GR303IDT = 178 +pkg syscall (freebsd-arm), const IFT_GR303RDT = 177 +pkg syscall (freebsd-arm), const IFT_H323GATEKEEPER = 164 +pkg syscall (freebsd-arm), const IFT_H323PROXY = 165 +pkg syscall (freebsd-arm), const IFT_HDH1822 = 3 +pkg syscall (freebsd-arm), const IFT_HDLC = 118 +pkg syscall (freebsd-arm), const IFT_HDSL2 = 168 +pkg syscall (freebsd-arm), const IFT_HIPERLAN2 = 183 +pkg syscall (freebsd-arm), const IFT_HIPPI = 47 +pkg syscall (freebsd-arm), const IFT_HIPPIINTERFACE = 57 +pkg syscall (freebsd-arm), const IFT_HOSTPAD = 90 +pkg syscall (freebsd-arm), const IFT_HSSI = 46 +pkg syscall (freebsd-arm), const IFT_HY = 14 +pkg syscall (freebsd-arm), const IFT_IBM370PARCHAN = 72 +pkg syscall (freebsd-arm), const IFT_IDSL = 154 +pkg syscall (freebsd-arm), const IFT_IEEE1394 = 144 +pkg syscall (freebsd-arm), const IFT_IEEE80211 = 71 +pkg syscall (freebsd-arm), const IFT_IEEE80212 = 55 +pkg syscall (freebsd-arm), const IFT_IEEE8023ADLAG = 161 +pkg syscall (freebsd-arm), const IFT_IFGSN = 145 +pkg syscall (freebsd-arm), const IFT_IMT = 190 +pkg syscall (freebsd-arm), const IFT_INFINIBAND = 199 +pkg syscall (freebsd-arm), const IFT_INTERLEAVE = 124 +pkg syscall (freebsd-arm), const IFT_IP = 126 +pkg syscall (freebsd-arm), const IFT_IPFORWARD = 142 +pkg syscall (freebsd-arm), const IFT_IPOVERATM = 114 +pkg syscall (freebsd-arm), const IFT_IPOVERCDLC = 109 +pkg syscall (freebsd-arm), const IFT_IPOVERCLAW = 110 +pkg syscall (freebsd-arm), const IFT_IPSWITCH = 78 +pkg syscall (freebsd-arm), const IFT_IPXIP = 249 +pkg syscall (freebsd-arm), const IFT_ISDN = 63 +pkg syscall (freebsd-arm), const IFT_ISDNBASIC = 20 +pkg syscall (freebsd-arm), const IFT_ISDNPRIMARY = 21 +pkg syscall (freebsd-arm), const IFT_ISDNS = 75 +pkg syscall (freebsd-arm), const IFT_ISDNU = 76 +pkg syscall (freebsd-arm), const IFT_ISO88022LLC = 41 +pkg syscall (freebsd-arm), const IFT_ISO88023 = 7 +pkg syscall (freebsd-arm), const IFT_ISO88024 = 8 +pkg syscall (freebsd-arm), const IFT_ISO88025 = 9 +pkg syscall (freebsd-arm), const IFT_ISO88025CRFPINT = 98 +pkg syscall (freebsd-arm), const IFT_ISO88025DTR = 86 +pkg syscall (freebsd-arm), const IFT_ISO88025FIBER = 115 +pkg syscall (freebsd-arm), const IFT_ISO88026 = 10 +pkg syscall (freebsd-arm), const IFT_ISUP = 179 +pkg syscall (freebsd-arm), const IFT_L2VLAN = 135 +pkg syscall (freebsd-arm), const IFT_L3IPVLAN = 136 +pkg syscall (freebsd-arm), const IFT_L3IPXVLAN = 137 +pkg syscall (freebsd-arm), const IFT_LAPB = 16 +pkg syscall (freebsd-arm), const IFT_LAPD = 77 +pkg syscall (freebsd-arm), const IFT_LAPF = 119 +pkg syscall (freebsd-arm), const IFT_LOCALTALK = 42 +pkg syscall (freebsd-arm), const IFT_LOOP = 24 +pkg syscall (freebsd-arm), const IFT_MEDIAMAILOVERIP = 139 +pkg syscall (freebsd-arm), const IFT_MFSIGLINK = 167 +pkg syscall (freebsd-arm), const IFT_MIOX25 = 38 +pkg syscall (freebsd-arm), const IFT_MODEM = 48 +pkg syscall (freebsd-arm), const IFT_MPC = 113 +pkg syscall (freebsd-arm), const IFT_MPLS = 166 +pkg syscall (freebsd-arm), const IFT_MPLSTUNNEL = 150 +pkg syscall (freebsd-arm), const IFT_MSDSL = 143 +pkg syscall (freebsd-arm), const IFT_MVL = 191 +pkg syscall (freebsd-arm), const IFT_MYRINET = 99 +pkg syscall (freebsd-arm), const IFT_NFAS = 175 +pkg syscall (freebsd-arm), const IFT_NSIP = 27 +pkg syscall (freebsd-arm), const IFT_OPTICALCHANNEL = 195 +pkg syscall (freebsd-arm), const IFT_OPTICALTRANSPORT = 196 +pkg syscall (freebsd-arm), const IFT_OTHER = 1 +pkg syscall (freebsd-arm), const IFT_P10 = 12 +pkg syscall (freebsd-arm), const IFT_P80 = 13 +pkg syscall (freebsd-arm), const IFT_PARA = 34 +pkg syscall (freebsd-arm), const IFT_PFLOG = 246 +pkg syscall (freebsd-arm), const IFT_PFSYNC = 247 +pkg syscall (freebsd-arm), const IFT_PLC = 174 +pkg syscall (freebsd-arm), const IFT_POS = 171 +pkg syscall (freebsd-arm), const IFT_PPP = 23 +pkg syscall (freebsd-arm), const IFT_PPPMULTILINKBUNDLE = 108 +pkg syscall (freebsd-arm), const IFT_PROPBWAP2MP = 184 +pkg syscall (freebsd-arm), const IFT_PROPCNLS = 89 +pkg syscall (freebsd-arm), const IFT_PROPDOCSWIRELESSDOWNSTREAM = 181 +pkg syscall (freebsd-arm), const IFT_PROPDOCSWIRELESSMACLAYER = 180 +pkg syscall (freebsd-arm), const IFT_PROPDOCSWIRELESSUPSTREAM = 182 +pkg syscall (freebsd-arm), const IFT_PROPMUX = 54 +pkg syscall (freebsd-arm), const IFT_PROPVIRTUAL = 53 +pkg syscall (freebsd-arm), const IFT_PROPWIRELESSP2P = 157 +pkg syscall (freebsd-arm), const IFT_PTPSERIAL = 22 +pkg syscall (freebsd-arm), const IFT_PVC = 241 +pkg syscall (freebsd-arm), const IFT_QLLC = 68 +pkg syscall (freebsd-arm), const IFT_RADIOMAC = 188 +pkg syscall (freebsd-arm), const IFT_RADSL = 95 +pkg syscall (freebsd-arm), const IFT_REACHDSL = 192 +pkg syscall (freebsd-arm), const IFT_RFC1483 = 159 +pkg syscall (freebsd-arm), const IFT_RS232 = 33 +pkg syscall (freebsd-arm), const IFT_RSRB = 79 +pkg syscall (freebsd-arm), const IFT_SDLC = 17 +pkg syscall (freebsd-arm), const IFT_SDSL = 96 +pkg syscall (freebsd-arm), const IFT_SHDSL = 169 +pkg syscall (freebsd-arm), const IFT_SIP = 31 +pkg syscall (freebsd-arm), const IFT_SLIP = 28 +pkg syscall (freebsd-arm), const IFT_SMDSDXI = 43 +pkg syscall (freebsd-arm), const IFT_SMDSICIP = 52 +pkg syscall (freebsd-arm), const IFT_SONET = 39 +pkg syscall (freebsd-arm), const IFT_SONETOVERHEADCHANNEL = 185 +pkg syscall (freebsd-arm), const IFT_SONETPATH = 50 +pkg syscall (freebsd-arm), const IFT_SONETVT = 51 +pkg syscall (freebsd-arm), const IFT_SRP = 151 +pkg syscall (freebsd-arm), const IFT_SS7SIGLINK = 156 +pkg syscall (freebsd-arm), const IFT_STACKTOSTACK = 111 +pkg syscall (freebsd-arm), const IFT_STARLAN = 11 +pkg syscall (freebsd-arm), const IFT_STF = 215 +pkg syscall (freebsd-arm), const IFT_T1 = 18 +pkg syscall (freebsd-arm), const IFT_TDLC = 116 +pkg syscall (freebsd-arm), const IFT_TERMPAD = 91 +pkg syscall (freebsd-arm), const IFT_TR008 = 176 +pkg syscall (freebsd-arm), const IFT_TRANSPHDLC = 123 +pkg syscall (freebsd-arm), const IFT_TUNNEL = 131 +pkg syscall (freebsd-arm), const IFT_ULTRA = 29 +pkg syscall (freebsd-arm), const IFT_USB = 160 +pkg syscall (freebsd-arm), const IFT_V11 = 64 +pkg syscall (freebsd-arm), const IFT_V35 = 45 +pkg syscall (freebsd-arm), const IFT_V36 = 65 +pkg syscall (freebsd-arm), const IFT_V37 = 120 +pkg syscall (freebsd-arm), const IFT_VDSL = 97 +pkg syscall (freebsd-arm), const IFT_VIRTUALIPADDRESS = 112 +pkg syscall (freebsd-arm), const IFT_VOICEEM = 100 +pkg syscall (freebsd-arm), const IFT_VOICEENCAP = 103 +pkg syscall (freebsd-arm), const IFT_VOICEFXO = 101 +pkg syscall (freebsd-arm), const IFT_VOICEFXS = 102 +pkg syscall (freebsd-arm), const IFT_VOICEOVERATM = 152 +pkg syscall (freebsd-arm), const IFT_VOICEOVERFRAMERELAY = 153 +pkg syscall (freebsd-arm), const IFT_VOICEOVERIP = 104 +pkg syscall (freebsd-arm), const IFT_X213 = 93 +pkg syscall (freebsd-arm), const IFT_X25 = 5 +pkg syscall (freebsd-arm), const IFT_X25DDN = 4 +pkg syscall (freebsd-arm), const IFT_X25HUNTGROUP = 122 +pkg syscall (freebsd-arm), const IFT_X25MLP = 121 +pkg syscall (freebsd-arm), const IFT_X25PLE = 40 +pkg syscall (freebsd-arm), const IFT_XETHER = 26 +pkg syscall (freebsd-arm), const IGNBRK = 1 +pkg syscall (freebsd-arm), const IGNCR = 128 +pkg syscall (freebsd-arm), const IGNPAR = 4 +pkg syscall (freebsd-arm), const IMAXBEL = 8192 +pkg syscall (freebsd-arm), const INLCR = 64 +pkg syscall (freebsd-arm), const INPCK = 16 +pkg syscall (freebsd-arm), const IN_CLASSA_HOST = 16777215 +pkg syscall (freebsd-arm), const IN_CLASSA_MAX = 128 +pkg syscall (freebsd-arm), const IN_CLASSA_NET = 4278190080 +pkg syscall (freebsd-arm), const IN_CLASSA_NSHIFT = 24 +pkg syscall (freebsd-arm), const IN_CLASSB_HOST = 65535 +pkg syscall (freebsd-arm), const IN_CLASSB_MAX = 65536 +pkg syscall (freebsd-arm), const IN_CLASSB_NET = 4294901760 +pkg syscall (freebsd-arm), const IN_CLASSB_NSHIFT = 16 +pkg syscall (freebsd-arm), const IN_CLASSC_HOST = 255 +pkg syscall (freebsd-arm), const IN_CLASSC_NET = 4294967040 +pkg syscall (freebsd-arm), const IN_CLASSC_NSHIFT = 8 +pkg syscall (freebsd-arm), const IN_CLASSD_HOST = 268435455 +pkg syscall (freebsd-arm), const IN_CLASSD_NET = 4026531840 +pkg syscall (freebsd-arm), const IN_CLASSD_NSHIFT = 28 +pkg syscall (freebsd-arm), const IN_LOOPBACKNET = 127 +pkg syscall (freebsd-arm), const IN_RFC3021_MASK = 4294967294 +pkg syscall (freebsd-arm), const IPPROTO_3PC = 34 +pkg syscall (freebsd-arm), const IPPROTO_ADFS = 68 +pkg syscall (freebsd-arm), const IPPROTO_AH = 51 +pkg syscall (freebsd-arm), const IPPROTO_AHIP = 61 +pkg syscall (freebsd-arm), const IPPROTO_APES = 99 +pkg syscall (freebsd-arm), const IPPROTO_ARGUS = 13 +pkg syscall (freebsd-arm), const IPPROTO_AX25 = 93 +pkg syscall (freebsd-arm), const IPPROTO_BHA = 49 +pkg syscall (freebsd-arm), const IPPROTO_BLT = 30 +pkg syscall (freebsd-arm), const IPPROTO_BRSATMON = 76 +pkg syscall (freebsd-arm), const IPPROTO_CARP = 112 +pkg syscall (freebsd-arm), const IPPROTO_CFTP = 62 +pkg syscall (freebsd-arm), const IPPROTO_CHAOS = 16 +pkg syscall (freebsd-arm), const IPPROTO_CMTP = 38 +pkg syscall (freebsd-arm), const IPPROTO_CPHB = 73 +pkg syscall (freebsd-arm), const IPPROTO_CPNX = 72 +pkg syscall (freebsd-arm), const IPPROTO_DDP = 37 +pkg syscall (freebsd-arm), const IPPROTO_DGP = 86 +pkg syscall (freebsd-arm), const IPPROTO_DIVERT = 258 +pkg syscall (freebsd-arm), const IPPROTO_DONE = 257 +pkg syscall (freebsd-arm), const IPPROTO_DSTOPTS = 60 +pkg syscall (freebsd-arm), const IPPROTO_EGP = 8 +pkg syscall (freebsd-arm), const IPPROTO_EMCON = 14 +pkg syscall (freebsd-arm), const IPPROTO_ENCAP = 98 +pkg syscall (freebsd-arm), const IPPROTO_EON = 80 +pkg syscall (freebsd-arm), const IPPROTO_ESP = 50 +pkg syscall (freebsd-arm), const IPPROTO_ETHERIP = 97 +pkg syscall (freebsd-arm), const IPPROTO_FRAGMENT = 44 +pkg syscall (freebsd-arm), const IPPROTO_GGP = 3 +pkg syscall (freebsd-arm), const IPPROTO_GMTP = 100 +pkg syscall (freebsd-arm), const IPPROTO_GRE = 47 +pkg syscall (freebsd-arm), const IPPROTO_HELLO = 63 +pkg syscall (freebsd-arm), const IPPROTO_HMP = 20 +pkg syscall (freebsd-arm), const IPPROTO_HOPOPTS = 0 +pkg syscall (freebsd-arm), const IPPROTO_ICMP = 1 +pkg syscall (freebsd-arm), const IPPROTO_ICMPV6 = 58 +pkg syscall (freebsd-arm), const IPPROTO_IDP = 22 +pkg syscall (freebsd-arm), const IPPROTO_IDPR = 35 +pkg syscall (freebsd-arm), const IPPROTO_IDRP = 45 +pkg syscall (freebsd-arm), const IPPROTO_IGMP = 2 +pkg syscall (freebsd-arm), const IPPROTO_IGP = 85 +pkg syscall (freebsd-arm), const IPPROTO_IGRP = 88 +pkg syscall (freebsd-arm), const IPPROTO_IL = 40 +pkg syscall (freebsd-arm), const IPPROTO_INLSP = 52 +pkg syscall (freebsd-arm), const IPPROTO_INP = 32 +pkg syscall (freebsd-arm), const IPPROTO_IPCOMP = 108 +pkg syscall (freebsd-arm), const IPPROTO_IPCV = 71 +pkg syscall (freebsd-arm), const IPPROTO_IPEIP = 94 +pkg syscall (freebsd-arm), const IPPROTO_IPIP = 4 +pkg syscall (freebsd-arm), const IPPROTO_IPPC = 67 +pkg syscall (freebsd-arm), const IPPROTO_IPV4 = 4 +pkg syscall (freebsd-arm), const IPPROTO_IRTP = 28 +pkg syscall (freebsd-arm), const IPPROTO_KRYPTOLAN = 65 +pkg syscall (freebsd-arm), const IPPROTO_LARP = 91 +pkg syscall (freebsd-arm), const IPPROTO_LEAF1 = 25 +pkg syscall (freebsd-arm), const IPPROTO_LEAF2 = 26 +pkg syscall (freebsd-arm), const IPPROTO_MAX = 256 +pkg syscall (freebsd-arm), const IPPROTO_MAXID = 52 +pkg syscall (freebsd-arm), const IPPROTO_MEAS = 19 +pkg syscall (freebsd-arm), const IPPROTO_MH = 135 +pkg syscall (freebsd-arm), const IPPROTO_MHRP = 48 +pkg syscall (freebsd-arm), const IPPROTO_MICP = 95 +pkg syscall (freebsd-arm), const IPPROTO_MOBILE = 55 +pkg syscall (freebsd-arm), const IPPROTO_MPLS = 137 +pkg syscall (freebsd-arm), const IPPROTO_MTP = 92 +pkg syscall (freebsd-arm), const IPPROTO_MUX = 18 +pkg syscall (freebsd-arm), const IPPROTO_ND = 77 +pkg syscall (freebsd-arm), const IPPROTO_NHRP = 54 +pkg syscall (freebsd-arm), const IPPROTO_NONE = 59 +pkg syscall (freebsd-arm), const IPPROTO_NSP = 31 +pkg syscall (freebsd-arm), const IPPROTO_NVPII = 11 +pkg syscall (freebsd-arm), const IPPROTO_OLD_DIVERT = 254 +pkg syscall (freebsd-arm), const IPPROTO_OSPFIGP = 89 +pkg syscall (freebsd-arm), const IPPROTO_PFSYNC = 240 +pkg syscall (freebsd-arm), const IPPROTO_PGM = 113 +pkg syscall (freebsd-arm), const IPPROTO_PIGP = 9 +pkg syscall (freebsd-arm), const IPPROTO_PIM = 103 +pkg syscall (freebsd-arm), const IPPROTO_PRM = 21 +pkg syscall (freebsd-arm), const IPPROTO_PUP = 12 +pkg syscall (freebsd-arm), const IPPROTO_PVP = 75 +pkg syscall (freebsd-arm), const IPPROTO_RAW = 255 +pkg syscall (freebsd-arm), const IPPROTO_RCCMON = 10 +pkg syscall (freebsd-arm), const IPPROTO_RDP = 27 +pkg syscall (freebsd-arm), const IPPROTO_ROUTING = 43 +pkg syscall (freebsd-arm), const IPPROTO_RSVP = 46 +pkg syscall (freebsd-arm), const IPPROTO_RVD = 66 +pkg syscall (freebsd-arm), const IPPROTO_SATEXPAK = 64 +pkg syscall (freebsd-arm), const IPPROTO_SATMON = 69 +pkg syscall (freebsd-arm), const IPPROTO_SCCSP = 96 +pkg syscall (freebsd-arm), const IPPROTO_SCTP = 132 +pkg syscall (freebsd-arm), const IPPROTO_SDRP = 42 +pkg syscall (freebsd-arm), const IPPROTO_SEND = 259 +pkg syscall (freebsd-arm), const IPPROTO_SEP = 33 +pkg syscall (freebsd-arm), const IPPROTO_SKIP = 57 +pkg syscall (freebsd-arm), const IPPROTO_SPACER = 32767 +pkg syscall (freebsd-arm), const IPPROTO_SRPC = 90 +pkg syscall (freebsd-arm), const IPPROTO_ST = 7 +pkg syscall (freebsd-arm), const IPPROTO_SVMTP = 82 +pkg syscall (freebsd-arm), const IPPROTO_SWIPE = 53 +pkg syscall (freebsd-arm), const IPPROTO_TCF = 87 +pkg syscall (freebsd-arm), const IPPROTO_TLSP = 56 +pkg syscall (freebsd-arm), const IPPROTO_TP = 29 +pkg syscall (freebsd-arm), const IPPROTO_TPXX = 39 +pkg syscall (freebsd-arm), const IPPROTO_TRUNK1 = 23 +pkg syscall (freebsd-arm), const IPPROTO_TRUNK2 = 24 +pkg syscall (freebsd-arm), const IPPROTO_TTP = 84 +pkg syscall (freebsd-arm), const IPPROTO_VINES = 83 +pkg syscall (freebsd-arm), const IPPROTO_VISA = 70 +pkg syscall (freebsd-arm), const IPPROTO_VMTP = 81 +pkg syscall (freebsd-arm), const IPPROTO_WBEXPAK = 79 +pkg syscall (freebsd-arm), const IPPROTO_WBMON = 78 +pkg syscall (freebsd-arm), const IPPROTO_WSN = 74 +pkg syscall (freebsd-arm), const IPPROTO_XNET = 15 +pkg syscall (freebsd-arm), const IPPROTO_XTP = 36 +pkg syscall (freebsd-arm), const IPV6_AUTOFLOWLABEL = 59 +pkg syscall (freebsd-arm), const IPV6_BINDANY = 64 +pkg syscall (freebsd-arm), const IPV6_BINDV6ONLY = 27 +pkg syscall (freebsd-arm), const IPV6_CHECKSUM = 26 +pkg syscall (freebsd-arm), const IPV6_DEFAULT_MULTICAST_HOPS = 1 +pkg syscall (freebsd-arm), const IPV6_DEFAULT_MULTICAST_LOOP = 1 +pkg syscall (freebsd-arm), const IPV6_DEFHLIM = 64 +pkg syscall (freebsd-arm), const IPV6_DONTFRAG = 62 +pkg syscall (freebsd-arm), const IPV6_DSTOPTS = 50 +pkg syscall (freebsd-arm), const IPV6_FAITH = 29 +pkg syscall (freebsd-arm), const IPV6_FLOWINFO_MASK = 4294967055 +pkg syscall (freebsd-arm), const IPV6_FLOWLABEL_MASK = 4294905600 +pkg syscall (freebsd-arm), const IPV6_FRAGTTL = 120 +pkg syscall (freebsd-arm), const IPV6_FW_ADD = 30 +pkg syscall (freebsd-arm), const IPV6_FW_DEL = 31 +pkg syscall (freebsd-arm), const IPV6_FW_FLUSH = 32 +pkg syscall (freebsd-arm), const IPV6_FW_GET = 34 +pkg syscall (freebsd-arm), const IPV6_FW_ZERO = 33 +pkg syscall (freebsd-arm), const IPV6_HLIMDEC = 1 +pkg syscall (freebsd-arm), const IPV6_HOPLIMIT = 47 +pkg syscall (freebsd-arm), const IPV6_HOPOPTS = 49 +pkg syscall (freebsd-arm), const IPV6_IPSEC_POLICY = 28 +pkg syscall (freebsd-arm), const IPV6_JOIN_GROUP = 12 +pkg syscall (freebsd-arm), const IPV6_LEAVE_GROUP = 13 +pkg syscall (freebsd-arm), const IPV6_MAXHLIM = 255 +pkg syscall (freebsd-arm), const IPV6_MAXOPTHDR = 2048 +pkg syscall (freebsd-arm), const IPV6_MAXPACKET = 65535 +pkg syscall (freebsd-arm), const IPV6_MAX_GROUP_SRC_FILTER = 512 +pkg syscall (freebsd-arm), const IPV6_MAX_MEMBERSHIPS = 4095 +pkg syscall (freebsd-arm), const IPV6_MAX_SOCK_SRC_FILTER = 128 +pkg syscall (freebsd-arm), const IPV6_MIN_MEMBERSHIPS = 31 +pkg syscall (freebsd-arm), const IPV6_MMTU = 1280 +pkg syscall (freebsd-arm), const IPV6_MSFILTER = 74 +pkg syscall (freebsd-arm), const IPV6_MULTICAST_HOPS = 10 +pkg syscall (freebsd-arm), const IPV6_MULTICAST_IF = 9 +pkg syscall (freebsd-arm), const IPV6_MULTICAST_LOOP = 11 +pkg syscall (freebsd-arm), const IPV6_NEXTHOP = 48 +pkg syscall (freebsd-arm), const IPV6_PATHMTU = 44 +pkg syscall (freebsd-arm), const IPV6_PKTINFO = 46 +pkg syscall (freebsd-arm), const IPV6_PORTRANGE = 14 +pkg syscall (freebsd-arm), const IPV6_PORTRANGE_DEFAULT = 0 +pkg syscall (freebsd-arm), const IPV6_PORTRANGE_HIGH = 1 +pkg syscall (freebsd-arm), const IPV6_PORTRANGE_LOW = 2 +pkg syscall (freebsd-arm), const IPV6_PREFER_TEMPADDR = 63 +pkg syscall (freebsd-arm), const IPV6_RECVDSTOPTS = 40 +pkg syscall (freebsd-arm), const IPV6_RECVHOPLIMIT = 37 +pkg syscall (freebsd-arm), const IPV6_RECVHOPOPTS = 39 +pkg syscall (freebsd-arm), const IPV6_RECVPATHMTU = 43 +pkg syscall (freebsd-arm), const IPV6_RECVPKTINFO = 36 +pkg syscall (freebsd-arm), const IPV6_RECVRTHDR = 38 +pkg syscall (freebsd-arm), const IPV6_RECVTCLASS = 57 +pkg syscall (freebsd-arm), const IPV6_RTHDR = 51 +pkg syscall (freebsd-arm), const IPV6_RTHDRDSTOPTS = 35 +pkg syscall (freebsd-arm), const IPV6_RTHDR_LOOSE = 0 +pkg syscall (freebsd-arm), const IPV6_RTHDR_STRICT = 1 +pkg syscall (freebsd-arm), const IPV6_RTHDR_TYPE_0 = 0 +pkg syscall (freebsd-arm), const IPV6_SOCKOPT_RESERVED1 = 3 +pkg syscall (freebsd-arm), const IPV6_TCLASS = 61 +pkg syscall (freebsd-arm), const IPV6_UNICAST_HOPS = 4 +pkg syscall (freebsd-arm), const IPV6_USE_MIN_MTU = 42 +pkg syscall (freebsd-arm), const IPV6_V6ONLY = 27 +pkg syscall (freebsd-arm), const IPV6_VERSION = 96 +pkg syscall (freebsd-arm), const IPV6_VERSION_MASK = 240 +pkg syscall (freebsd-arm), const IP_ADD_MEMBERSHIP = 12 +pkg syscall (freebsd-arm), const IP_ADD_SOURCE_MEMBERSHIP = 70 +pkg syscall (freebsd-arm), const IP_BINDANY = 24 +pkg syscall (freebsd-arm), const IP_BLOCK_SOURCE = 72 +pkg syscall (freebsd-arm), const IP_DEFAULT_MULTICAST_LOOP = 1 +pkg syscall (freebsd-arm), const IP_DEFAULT_MULTICAST_TTL = 1 +pkg syscall (freebsd-arm), const IP_DF = 16384 +pkg syscall (freebsd-arm), const IP_DONTFRAG = 67 +pkg syscall (freebsd-arm), const IP_DROP_MEMBERSHIP = 13 +pkg syscall (freebsd-arm), const IP_DROP_SOURCE_MEMBERSHIP = 71 +pkg syscall (freebsd-arm), const IP_DUMMYNET3 = 49 +pkg syscall (freebsd-arm), const IP_DUMMYNET_CONFIGURE = 60 +pkg syscall (freebsd-arm), const IP_DUMMYNET_DEL = 61 +pkg syscall (freebsd-arm), const IP_DUMMYNET_FLUSH = 62 +pkg syscall (freebsd-arm), const IP_DUMMYNET_GET = 64 +pkg syscall (freebsd-arm), const IP_FAITH = 22 +pkg syscall (freebsd-arm), const IP_FW3 = 48 +pkg syscall (freebsd-arm), const IP_FW_ADD = 50 +pkg syscall (freebsd-arm), const IP_FW_DEL = 51 +pkg syscall (freebsd-arm), const IP_FW_FLUSH = 52 +pkg syscall (freebsd-arm), const IP_FW_GET = 54 +pkg syscall (freebsd-arm), const IP_FW_NAT_CFG = 56 +pkg syscall (freebsd-arm), const IP_FW_NAT_DEL = 57 +pkg syscall (freebsd-arm), const IP_FW_NAT_GET_CONFIG = 58 +pkg syscall (freebsd-arm), const IP_FW_NAT_GET_LOG = 59 +pkg syscall (freebsd-arm), const IP_FW_RESETLOG = 55 +pkg syscall (freebsd-arm), const IP_FW_TABLE_ADD = 40 +pkg syscall (freebsd-arm), const IP_FW_TABLE_DEL = 41 +pkg syscall (freebsd-arm), const IP_FW_TABLE_FLUSH = 42 +pkg syscall (freebsd-arm), const IP_FW_TABLE_GETSIZE = 43 +pkg syscall (freebsd-arm), const IP_FW_TABLE_LIST = 44 +pkg syscall (freebsd-arm), const IP_FW_ZERO = 53 +pkg syscall (freebsd-arm), const IP_HDRINCL = 2 +pkg syscall (freebsd-arm), const IP_IPSEC_POLICY = 21 +pkg syscall (freebsd-arm), const IP_MAXPACKET = 65535 +pkg syscall (freebsd-arm), const IP_MAX_GROUP_SRC_FILTER = 512 +pkg syscall (freebsd-arm), const IP_MAX_MEMBERSHIPS = 4095 +pkg syscall (freebsd-arm), const IP_MAX_SOCK_MUTE_FILTER = 128 +pkg syscall (freebsd-arm), const IP_MAX_SOCK_SRC_FILTER = 128 +pkg syscall (freebsd-arm), const IP_MAX_SOURCE_FILTER = 1024 +pkg syscall (freebsd-arm), const IP_MF = 8192 +pkg syscall (freebsd-arm), const IP_MINTTL = 66 +pkg syscall (freebsd-arm), const IP_MIN_MEMBERSHIPS = 31 +pkg syscall (freebsd-arm), const IP_MSFILTER = 74 +pkg syscall (freebsd-arm), const IP_MSS = 576 +pkg syscall (freebsd-arm), const IP_MULTICAST_IF = 9 +pkg syscall (freebsd-arm), const IP_MULTICAST_LOOP = 11 +pkg syscall (freebsd-arm), const IP_MULTICAST_TTL = 10 +pkg syscall (freebsd-arm), const IP_MULTICAST_VIF = 14 +pkg syscall (freebsd-arm), const IP_OFFMASK = 8191 +pkg syscall (freebsd-arm), const IP_ONESBCAST = 23 +pkg syscall (freebsd-arm), const IP_OPTIONS = 1 +pkg syscall (freebsd-arm), const IP_PORTRANGE = 19 +pkg syscall (freebsd-arm), const IP_PORTRANGE_DEFAULT = 0 +pkg syscall (freebsd-arm), const IP_PORTRANGE_HIGH = 1 +pkg syscall (freebsd-arm), const IP_PORTRANGE_LOW = 2 +pkg syscall (freebsd-arm), const IP_RECVDSTADDR = 7 +pkg syscall (freebsd-arm), const IP_RECVIF = 20 +pkg syscall (freebsd-arm), const IP_RECVOPTS = 5 +pkg syscall (freebsd-arm), const IP_RECVRETOPTS = 6 +pkg syscall (freebsd-arm), const IP_RECVTOS = 68 +pkg syscall (freebsd-arm), const IP_RECVTTL = 65 +pkg syscall (freebsd-arm), const IP_RETOPTS = 8 +pkg syscall (freebsd-arm), const IP_RF = 32768 +pkg syscall (freebsd-arm), const IP_RSVP_OFF = 16 +pkg syscall (freebsd-arm), const IP_RSVP_ON = 15 +pkg syscall (freebsd-arm), const IP_RSVP_VIF_OFF = 18 +pkg syscall (freebsd-arm), const IP_RSVP_VIF_ON = 17 +pkg syscall (freebsd-arm), const IP_SENDSRCADDR = 7 +pkg syscall (freebsd-arm), const IP_TOS = 3 +pkg syscall (freebsd-arm), const IP_TTL = 4 +pkg syscall (freebsd-arm), const IP_UNBLOCK_SOURCE = 73 +pkg syscall (freebsd-arm), const ISIG = 128 +pkg syscall (freebsd-arm), const ISTRIP = 32 +pkg syscall (freebsd-arm), const IXANY = 2048 +pkg syscall (freebsd-arm), const IXOFF = 1024 +pkg syscall (freebsd-arm), const IXON = 512 +pkg syscall (freebsd-arm), const ImplementsGetwd = false +pkg syscall (freebsd-arm), const LOCK_EX = 2 +pkg syscall (freebsd-arm), const LOCK_NB = 4 +pkg syscall (freebsd-arm), const LOCK_SH = 1 +pkg syscall (freebsd-arm), const LOCK_UN = 8 +pkg syscall (freebsd-arm), const MADV_AUTOSYNC = 7 +pkg syscall (freebsd-arm), const MADV_CORE = 9 +pkg syscall (freebsd-arm), const MADV_DONTNEED = 4 +pkg syscall (freebsd-arm), const MADV_FREE = 5 +pkg syscall (freebsd-arm), const MADV_NOCORE = 8 +pkg syscall (freebsd-arm), const MADV_NORMAL = 0 +pkg syscall (freebsd-arm), const MADV_NOSYNC = 6 +pkg syscall (freebsd-arm), const MADV_PROTECT = 10 +pkg syscall (freebsd-arm), const MADV_RANDOM = 1 +pkg syscall (freebsd-arm), const MADV_SEQUENTIAL = 2 +pkg syscall (freebsd-arm), const MADV_WILLNEED = 3 +pkg syscall (freebsd-arm), const MAP_ANON = 4096 +pkg syscall (freebsd-arm), const MAP_ANONYMOUS = 4096 +pkg syscall (freebsd-arm), const MAP_COPY = 2 +pkg syscall (freebsd-arm), const MAP_FILE = 0 +pkg syscall (freebsd-arm), const MAP_FIXED = 16 +pkg syscall (freebsd-arm), const MAP_HASSEMAPHORE = 512 +pkg syscall (freebsd-arm), const MAP_NOCORE = 131072 +pkg syscall (freebsd-arm), const MAP_NORESERVE = 64 +pkg syscall (freebsd-arm), const MAP_NOSYNC = 2048 +pkg syscall (freebsd-arm), const MAP_PREFAULT_READ = 262144 +pkg syscall (freebsd-arm), const MAP_PRIVATE = 2 +pkg syscall (freebsd-arm), const MAP_RENAME = 32 +pkg syscall (freebsd-arm), const MAP_RESERVED0080 = 128 +pkg syscall (freebsd-arm), const MAP_RESERVED0100 = 256 +pkg syscall (freebsd-arm), const MAP_SHARED = 1 +pkg syscall (freebsd-arm), const MAP_STACK = 1024 +pkg syscall (freebsd-arm), const MCL_CURRENT = 1 +pkg syscall (freebsd-arm), const MCL_FUTURE = 2 +pkg syscall (freebsd-arm), const MSG_COMPAT = 32768 +pkg syscall (freebsd-arm), const MSG_CTRUNC = 32 +pkg syscall (freebsd-arm), const MSG_DONTROUTE = 4 +pkg syscall (freebsd-arm), const MSG_DONTWAIT = 128 +pkg syscall (freebsd-arm), const MSG_EOF = 256 +pkg syscall (freebsd-arm), const MSG_EOR = 8 +pkg syscall (freebsd-arm), const MSG_NBIO = 16384 +pkg syscall (freebsd-arm), const MSG_NOSIGNAL = 131072 +pkg syscall (freebsd-arm), const MSG_NOTIFICATION = 8192 +pkg syscall (freebsd-arm), const MSG_OOB = 1 +pkg syscall (freebsd-arm), const MSG_PEEK = 2 +pkg syscall (freebsd-arm), const MSG_TRUNC = 16 +pkg syscall (freebsd-arm), const MSG_WAITALL = 64 +pkg syscall (freebsd-arm), const MS_ASYNC = 1 +pkg syscall (freebsd-arm), const MS_INVALIDATE = 2 +pkg syscall (freebsd-arm), const MS_SYNC = 0 +pkg syscall (freebsd-arm), const NET_RT_DUMP = 1 +pkg syscall (freebsd-arm), const NET_RT_FLAGS = 2 +pkg syscall (freebsd-arm), const NET_RT_IFLIST = 3 +pkg syscall (freebsd-arm), const NET_RT_IFLISTL = 5 +pkg syscall (freebsd-arm), const NET_RT_IFMALIST = 4 +pkg syscall (freebsd-arm), const NET_RT_MAXID = 6 +pkg syscall (freebsd-arm), const NOFLSH = 2147483648 +pkg syscall (freebsd-arm), const NOTE_ATTRIB = 8 +pkg syscall (freebsd-arm), const NOTE_CHILD = 4 +pkg syscall (freebsd-arm), const NOTE_DELETE = 1 +pkg syscall (freebsd-arm), const NOTE_EXEC = 536870912 +pkg syscall (freebsd-arm), const NOTE_EXIT = 2147483648 +pkg syscall (freebsd-arm), const NOTE_EXTEND = 4 +pkg syscall (freebsd-arm), const NOTE_FFAND = 1073741824 +pkg syscall (freebsd-arm), const NOTE_FFCOPY = 3221225472 +pkg syscall (freebsd-arm), const NOTE_FFCTRLMASK = 3221225472 +pkg syscall (freebsd-arm), const NOTE_FFLAGSMASK = 16777215 +pkg syscall (freebsd-arm), const NOTE_FFNOP = 0 +pkg syscall (freebsd-arm), const NOTE_FFOR = 2147483648 +pkg syscall (freebsd-arm), const NOTE_FORK = 1073741824 +pkg syscall (freebsd-arm), const NOTE_LINK = 16 +pkg syscall (freebsd-arm), const NOTE_LOWAT = 1 +pkg syscall (freebsd-arm), const NOTE_PCTRLMASK = 4026531840 +pkg syscall (freebsd-arm), const NOTE_PDATAMASK = 1048575 +pkg syscall (freebsd-arm), const NOTE_RENAME = 32 +pkg syscall (freebsd-arm), const NOTE_REVOKE = 64 +pkg syscall (freebsd-arm), const NOTE_TRACK = 1 +pkg syscall (freebsd-arm), const NOTE_TRACKERR = 2 +pkg syscall (freebsd-arm), const NOTE_TRIGGER = 16777216 +pkg syscall (freebsd-arm), const NOTE_WRITE = 2 +pkg syscall (freebsd-arm), const OCRNL = 16 +pkg syscall (freebsd-arm), const ONLCR = 2 +pkg syscall (freebsd-arm), const ONLRET = 64 +pkg syscall (freebsd-arm), const ONOCR = 32 +pkg syscall (freebsd-arm), const ONOEOT = 8 +pkg syscall (freebsd-arm), const OPOST = 1 +pkg syscall (freebsd-arm), const O_ACCMODE = 3 +pkg syscall (freebsd-arm), const O_APPEND = 8 +pkg syscall (freebsd-arm), const O_ASYNC = 64 +pkg syscall (freebsd-arm), const O_CLOEXEC = 0 +pkg syscall (freebsd-arm), const O_CREAT = 512 +pkg syscall (freebsd-arm), const O_DIRECT = 65536 +pkg syscall (freebsd-arm), const O_DIRECTORY = 131072 +pkg syscall (freebsd-arm), const O_EXCL = 2048 +pkg syscall (freebsd-arm), const O_EXEC = 262144 +pkg syscall (freebsd-arm), const O_EXLOCK = 32 +pkg syscall (freebsd-arm), const O_FSYNC = 128 +pkg syscall (freebsd-arm), const O_NDELAY = 4 +pkg syscall (freebsd-arm), const O_NOCTTY = 32768 +pkg syscall (freebsd-arm), const O_NOFOLLOW = 256 +pkg syscall (freebsd-arm), const O_NONBLOCK = 4 +pkg syscall (freebsd-arm), const O_SHLOCK = 16 +pkg syscall (freebsd-arm), const O_SYNC = 128 +pkg syscall (freebsd-arm), const O_TRUNC = 1024 +pkg syscall (freebsd-arm), const O_TTY_INIT = 524288 +pkg syscall (freebsd-arm), const PARENB = 4096 +pkg syscall (freebsd-arm), const PARMRK = 8 +pkg syscall (freebsd-arm), const PARODD = 8192 +pkg syscall (freebsd-arm), const PENDIN = 536870912 +pkg syscall (freebsd-arm), const PROT_EXEC = 4 +pkg syscall (freebsd-arm), const PROT_NONE = 0 +pkg syscall (freebsd-arm), const PROT_READ = 1 +pkg syscall (freebsd-arm), const PROT_WRITE = 2 +pkg syscall (freebsd-arm), const PTRACE_CONT = 7 +pkg syscall (freebsd-arm), const PTRACE_KILL = 8 +pkg syscall (freebsd-arm), const PTRACE_TRACEME = 0 +pkg syscall (freebsd-arm), const RLIMIT_AS = 10 +pkg syscall (freebsd-arm), const RLIMIT_CORE = 4 +pkg syscall (freebsd-arm), const RLIMIT_CPU = 0 +pkg syscall (freebsd-arm), const RLIMIT_DATA = 2 +pkg syscall (freebsd-arm), const RLIMIT_FSIZE = 1 +pkg syscall (freebsd-arm), const RLIMIT_NOFILE = 8 +pkg syscall (freebsd-arm), const RLIMIT_STACK = 3 +pkg syscall (freebsd-arm), const RLIM_INFINITY = 9223372036854775807 +pkg syscall (freebsd-arm), const RTAX_AUTHOR = 6 +pkg syscall (freebsd-arm), const RTAX_BRD = 7 +pkg syscall (freebsd-arm), const RTAX_DST = 0 +pkg syscall (freebsd-arm), const RTAX_GATEWAY = 1 +pkg syscall (freebsd-arm), const RTAX_GENMASK = 3 +pkg syscall (freebsd-arm), const RTAX_IFA = 5 +pkg syscall (freebsd-arm), const RTAX_IFP = 4 +pkg syscall (freebsd-arm), const RTAX_MAX = 8 +pkg syscall (freebsd-arm), const RTAX_NETMASK = 2 +pkg syscall (freebsd-arm), const RTA_AUTHOR = 64 +pkg syscall (freebsd-arm), const RTA_BRD = 128 +pkg syscall (freebsd-arm), const RTA_DST = 1 +pkg syscall (freebsd-arm), const RTA_GATEWAY = 2 +pkg syscall (freebsd-arm), const RTA_GENMASK = 8 +pkg syscall (freebsd-arm), const RTA_IFA = 32 +pkg syscall (freebsd-arm), const RTA_IFP = 16 +pkg syscall (freebsd-arm), const RTA_NETMASK = 4 +pkg syscall (freebsd-arm), const RTF_BLACKHOLE = 4096 +pkg syscall (freebsd-arm), const RTF_BROADCAST = 4194304 +pkg syscall (freebsd-arm), const RTF_DONE = 64 +pkg syscall (freebsd-arm), const RTF_DYNAMIC = 16 +pkg syscall (freebsd-arm), const RTF_FMASK = 268752904 +pkg syscall (freebsd-arm), const RTF_GATEWAY = 2 +pkg syscall (freebsd-arm), const RTF_HOST = 4 +pkg syscall (freebsd-arm), const RTF_LLDATA = 1024 +pkg syscall (freebsd-arm), const RTF_LLINFO = 1024 +pkg syscall (freebsd-arm), const RTF_LOCAL = 2097152 +pkg syscall (freebsd-arm), const RTF_MODIFIED = 32 +pkg syscall (freebsd-arm), const RTF_MULTICAST = 8388608 +pkg syscall (freebsd-arm), const RTF_PINNED = 1048576 +pkg syscall (freebsd-arm), const RTF_PRCLONING = 65536 +pkg syscall (freebsd-arm), const RTF_PROTO1 = 32768 +pkg syscall (freebsd-arm), const RTF_PROTO2 = 16384 +pkg syscall (freebsd-arm), const RTF_PROTO3 = 262144 +pkg syscall (freebsd-arm), const RTF_REJECT = 8 +pkg syscall (freebsd-arm), const RTF_RNH_LOCKED = 1073741824 +pkg syscall (freebsd-arm), const RTF_STATIC = 2048 +pkg syscall (freebsd-arm), const RTF_STICKY = 268435456 +pkg syscall (freebsd-arm), const RTF_UP = 1 +pkg syscall (freebsd-arm), const RTF_XRESOLVE = 512 +pkg syscall (freebsd-arm), const RTM_ADD = 1 +pkg syscall (freebsd-arm), const RTM_CHANGE = 3 +pkg syscall (freebsd-arm), const RTM_DELADDR = 13 +pkg syscall (freebsd-arm), const RTM_DELETE = 2 +pkg syscall (freebsd-arm), const RTM_DELMADDR = 16 +pkg syscall (freebsd-arm), const RTM_GET = 4 +pkg syscall (freebsd-arm), const RTM_IEEE80211 = 18 +pkg syscall (freebsd-arm), const RTM_IFANNOUNCE = 17 +pkg syscall (freebsd-arm), const RTM_IFINFO = 14 +pkg syscall (freebsd-arm), const RTM_LOCK = 8 +pkg syscall (freebsd-arm), const RTM_LOSING = 5 +pkg syscall (freebsd-arm), const RTM_MISS = 7 +pkg syscall (freebsd-arm), const RTM_NEWADDR = 12 +pkg syscall (freebsd-arm), const RTM_NEWMADDR = 15 +pkg syscall (freebsd-arm), const RTM_OLDADD = 9 +pkg syscall (freebsd-arm), const RTM_OLDDEL = 10 +pkg syscall (freebsd-arm), const RTM_REDIRECT = 6 +pkg syscall (freebsd-arm), const RTM_RESOLVE = 11 +pkg syscall (freebsd-arm), const RTM_RTTUNIT = 1000000 +pkg syscall (freebsd-arm), const RTM_VERSION = 5 +pkg syscall (freebsd-arm), const RTV_EXPIRE = 4 +pkg syscall (freebsd-arm), const RTV_HOPCOUNT = 2 +pkg syscall (freebsd-arm), const RTV_MTU = 1 +pkg syscall (freebsd-arm), const RTV_RPIPE = 8 +pkg syscall (freebsd-arm), const RTV_RTT = 64 +pkg syscall (freebsd-arm), const RTV_RTTVAR = 128 +pkg syscall (freebsd-arm), const RTV_SPIPE = 16 +pkg syscall (freebsd-arm), const RTV_SSTHRESH = 32 +pkg syscall (freebsd-arm), const RTV_WEIGHT = 256 +pkg syscall (freebsd-arm), const RT_CACHING_CONTEXT = 1 +pkg syscall (freebsd-arm), const RT_DEFAULT_FIB = 0 +pkg syscall (freebsd-arm), const RT_NORTREF = 2 +pkg syscall (freebsd-arm), const RUSAGE_CHILDREN = -1 +pkg syscall (freebsd-arm), const RUSAGE_SELF = 0 +pkg syscall (freebsd-arm), const RUSAGE_THREAD = 1 +pkg syscall (freebsd-arm), const SCM_BINTIME = 4 +pkg syscall (freebsd-arm), const SCM_CREDS = 3 +pkg syscall (freebsd-arm), const SCM_RIGHTS = 1 +pkg syscall (freebsd-arm), const SCM_TIMESTAMP = 2 +pkg syscall (freebsd-arm), const SIGBUS = 10 +pkg syscall (freebsd-arm), const SIGCHLD = 20 +pkg syscall (freebsd-arm), const SIGCONT = 19 +pkg syscall (freebsd-arm), const SIGEMT = 7 +pkg syscall (freebsd-arm), const SIGINFO = 29 +pkg syscall (freebsd-arm), const SIGIO = 23 +pkg syscall (freebsd-arm), const SIGIOT = 6 +pkg syscall (freebsd-arm), const SIGLIBRT = 33 +pkg syscall (freebsd-arm), const SIGLWP = 32 +pkg syscall (freebsd-arm), const SIGPROF = 27 +pkg syscall (freebsd-arm), const SIGSTOP = 17 +pkg syscall (freebsd-arm), const SIGSYS = 12 +pkg syscall (freebsd-arm), const SIGTHR = 32 +pkg syscall (freebsd-arm), const SIGTSTP = 18 +pkg syscall (freebsd-arm), const SIGTTIN = 21 +pkg syscall (freebsd-arm), const SIGTTOU = 22 +pkg syscall (freebsd-arm), const SIGURG = 16 +pkg syscall (freebsd-arm), const SIGUSR1 = 30 +pkg syscall (freebsd-arm), const SIGUSR2 = 31 +pkg syscall (freebsd-arm), const SIGVTALRM = 26 +pkg syscall (freebsd-arm), const SIGWINCH = 28 +pkg syscall (freebsd-arm), const SIGXCPU = 24 +pkg syscall (freebsd-arm), const SIGXFSZ = 25 +pkg syscall (freebsd-arm), const SIOCADDMULTI = 2149607729 +pkg syscall (freebsd-arm), const SIOCADDRT = 2150658570 +pkg syscall (freebsd-arm), const SIOCAIFADDR = 2151967019 +pkg syscall (freebsd-arm), const SIOCAIFGROUP = 2149869959 +pkg syscall (freebsd-arm), const SIOCALIFADDR = 2165860635 +pkg syscall (freebsd-arm), const SIOCATMARK = 1074033415 +pkg syscall (freebsd-arm), const SIOCDELMULTI = 2149607730 +pkg syscall (freebsd-arm), const SIOCDELRT = 2150658571 +pkg syscall (freebsd-arm), const SIOCDIFADDR = 2149607705 +pkg syscall (freebsd-arm), const SIOCDIFGROUP = 2149869961 +pkg syscall (freebsd-arm), const SIOCDIFPHYADDR = 2149607753 +pkg syscall (freebsd-arm), const SIOCDLIFADDR = 2165860637 +pkg syscall (freebsd-arm), const SIOCGDRVSPEC = 3223087483 +pkg syscall (freebsd-arm), const SIOCGETSGCNT = 3222565392 +pkg syscall (freebsd-arm), const SIOCGETVIFCNT = 3222565391 +pkg syscall (freebsd-arm), const SIOCGHIWAT = 1074033409 +pkg syscall (freebsd-arm), const SIOCGIFADDR = 3223349537 +pkg syscall (freebsd-arm), const SIOCGIFBRDADDR = 3223349539 +pkg syscall (freebsd-arm), const SIOCGIFCAP = 3223349535 +pkg syscall (freebsd-arm), const SIOCGIFCONF = 3221776676 +pkg syscall (freebsd-arm), const SIOCGIFDESCR = 3223349546 +pkg syscall (freebsd-arm), const SIOCGIFDSTADDR = 3223349538 +pkg syscall (freebsd-arm), const SIOCGIFFIB = 3223349596 +pkg syscall (freebsd-arm), const SIOCGIFFLAGS = 3223349521 +pkg syscall (freebsd-arm), const SIOCGIFGENERIC = 3223349562 +pkg syscall (freebsd-arm), const SIOCGIFGMEMB = 3223611786 +pkg syscall (freebsd-arm), const SIOCGIFGROUP = 3223611784 +pkg syscall (freebsd-arm), const SIOCGIFINDEX = 3223349536 +pkg syscall (freebsd-arm), const SIOCGIFMAC = 3223349542 +pkg syscall (freebsd-arm), const SIOCGIFMEDIA = 3223873848 +pkg syscall (freebsd-arm), const SIOCGIFMETRIC = 3223349527 +pkg syscall (freebsd-arm), const SIOCGIFMTU = 3223349555 +pkg syscall (freebsd-arm), const SIOCGIFNETMASK = 3223349541 +pkg syscall (freebsd-arm), const SIOCGIFPDSTADDR = 3223349576 +pkg syscall (freebsd-arm), const SIOCGIFPHYS = 3223349557 +pkg syscall (freebsd-arm), const SIOCGIFPSRCADDR = 3223349575 +pkg syscall (freebsd-arm), const SIOCGIFSTATUS = 3274991931 +pkg syscall (freebsd-arm), const SIOCGLIFADDR = 3239602460 +pkg syscall (freebsd-arm), const SIOCGLIFPHYADDR = 3239602507 +pkg syscall (freebsd-arm), const SIOCGLOWAT = 1074033411 +pkg syscall (freebsd-arm), const SIOCGPGRP = 1074033417 +pkg syscall (freebsd-arm), const SIOCGPRIVATE_0 = 3223349584 +pkg syscall (freebsd-arm), const SIOCGPRIVATE_1 = 3223349585 +pkg syscall (freebsd-arm), const SIOCIFCREATE = 3223349626 +pkg syscall (freebsd-arm), const SIOCIFCREATE2 = 3223349628 +pkg syscall (freebsd-arm), const SIOCIFDESTROY = 2149607801 +pkg syscall (freebsd-arm), const SIOCIFGCLONERS = 3222038904 +pkg syscall (freebsd-arm), const SIOCSDRVSPEC = 2149345659 +pkg syscall (freebsd-arm), const SIOCSHIWAT = 2147775232 +pkg syscall (freebsd-arm), const SIOCSIFADDR = 2149607692 +pkg syscall (freebsd-arm), const SIOCSIFBRDADDR = 2149607699 +pkg syscall (freebsd-arm), const SIOCSIFCAP = 2149607710 +pkg syscall (freebsd-arm), const SIOCSIFDESCR = 2149607721 +pkg syscall (freebsd-arm), const SIOCSIFDSTADDR = 2149607694 +pkg syscall (freebsd-arm), const SIOCSIFFIB = 2149607773 +pkg syscall (freebsd-arm), const SIOCSIFFLAGS = 2149607696 +pkg syscall (freebsd-arm), const SIOCSIFGENERIC = 2149607737 +pkg syscall (freebsd-arm), const SIOCSIFLLADDR = 2149607740 +pkg syscall (freebsd-arm), const SIOCSIFMAC = 2149607719 +pkg syscall (freebsd-arm), const SIOCSIFMEDIA = 3223349559 +pkg syscall (freebsd-arm), const SIOCSIFMETRIC = 2149607704 +pkg syscall (freebsd-arm), const SIOCSIFMTU = 2149607732 +pkg syscall (freebsd-arm), const SIOCSIFNAME = 2149607720 +pkg syscall (freebsd-arm), const SIOCSIFNETMASK = 2149607702 +pkg syscall (freebsd-arm), const SIOCSIFPHYADDR = 2151967046 +pkg syscall (freebsd-arm), const SIOCSIFPHYS = 2149607734 +pkg syscall (freebsd-arm), const SIOCSIFRVNET = 3223349595 +pkg syscall (freebsd-arm), const SIOCSIFVNET = 3223349594 +pkg syscall (freebsd-arm), const SIOCSLIFPHYADDR = 2165860682 +pkg syscall (freebsd-arm), const SIOCSLOWAT = 2147775234 +pkg syscall (freebsd-arm), const SIOCSPGRP = 2147775240 +pkg syscall (freebsd-arm), const SOCK_MAXADDRLEN = 255 +pkg syscall (freebsd-arm), const SOCK_RDM = 4 +pkg syscall (freebsd-arm), const SOL_SOCKET = 65535 +pkg syscall (freebsd-arm), const SOMAXCONN = 128 +pkg syscall (freebsd-arm), const SO_ACCEPTCONN = 2 +pkg syscall (freebsd-arm), const SO_ACCEPTFILTER = 4096 +pkg syscall (freebsd-arm), const SO_BINTIME = 8192 +pkg syscall (freebsd-arm), const SO_BROADCAST = 32 +pkg syscall (freebsd-arm), const SO_DEBUG = 1 +pkg syscall (freebsd-arm), const SO_DONTROUTE = 16 +pkg syscall (freebsd-arm), const SO_ERROR = 4103 +pkg syscall (freebsd-arm), const SO_KEEPALIVE = 8 +pkg syscall (freebsd-arm), const SO_LABEL = 4105 +pkg syscall (freebsd-arm), const SO_LINGER = 128 +pkg syscall (freebsd-arm), const SO_LISTENINCQLEN = 4115 +pkg syscall (freebsd-arm), const SO_LISTENQLEN = 4114 +pkg syscall (freebsd-arm), const SO_LISTENQLIMIT = 4113 +pkg syscall (freebsd-arm), const SO_NOSIGPIPE = 2048 +pkg syscall (freebsd-arm), const SO_NO_DDP = 32768 +pkg syscall (freebsd-arm), const SO_NO_OFFLOAD = 16384 +pkg syscall (freebsd-arm), const SO_OOBINLINE = 256 +pkg syscall (freebsd-arm), const SO_PEERLABEL = 4112 +pkg syscall (freebsd-arm), const SO_PROTOCOL = 4118 +pkg syscall (freebsd-arm), const SO_PROTOTYPE = 4118 +pkg syscall (freebsd-arm), const SO_RCVBUF = 4098 +pkg syscall (freebsd-arm), const SO_RCVLOWAT = 4100 +pkg syscall (freebsd-arm), const SO_RCVTIMEO = 4102 +pkg syscall (freebsd-arm), const SO_REUSEADDR = 4 +pkg syscall (freebsd-arm), const SO_REUSEPORT = 512 +pkg syscall (freebsd-arm), const SO_SETFIB = 4116 +pkg syscall (freebsd-arm), const SO_SNDBUF = 4097 +pkg syscall (freebsd-arm), const SO_SNDLOWAT = 4099 +pkg syscall (freebsd-arm), const SO_SNDTIMEO = 4101 +pkg syscall (freebsd-arm), const SO_TIMESTAMP = 1024 +pkg syscall (freebsd-arm), const SO_TYPE = 4104 +pkg syscall (freebsd-arm), const SO_USELOOPBACK = 64 +pkg syscall (freebsd-arm), const SO_USER_COOKIE = 4117 +pkg syscall (freebsd-arm), const SYS_ABORT2 = 463 +pkg syscall (freebsd-arm), const SYS_ACCEPT = 30 +pkg syscall (freebsd-arm), const SYS_ACCESS = 33 +pkg syscall (freebsd-arm), const SYS_ACCT = 51 +pkg syscall (freebsd-arm), const SYS_ADJTIME = 140 +pkg syscall (freebsd-arm), const SYS_AUDIT = 445 +pkg syscall (freebsd-arm), const SYS_AUDITCTL = 453 +pkg syscall (freebsd-arm), const SYS_AUDITON = 446 +pkg syscall (freebsd-arm), const SYS_BIND = 104 +pkg syscall (freebsd-arm), const SYS_CAP_ENTER = 516 +pkg syscall (freebsd-arm), const SYS_CAP_FCNTLS_GET = 537 +pkg syscall (freebsd-arm), const SYS_CAP_FCNTLS_LIMIT = 536 +pkg syscall (freebsd-arm), const SYS_CAP_GETMODE = 517 +pkg syscall (freebsd-arm), const SYS_CAP_IOCTLS_GET = 535 +pkg syscall (freebsd-arm), const SYS_CAP_IOCTLS_LIMIT = 534 +pkg syscall (freebsd-arm), const SYS_CAP_NEW = 514 +pkg syscall (freebsd-arm), const SYS_CAP_RIGHTS_GET = 515 +pkg syscall (freebsd-arm), const SYS_CAP_RIGHTS_LIMIT = 533 +pkg syscall (freebsd-arm), const SYS_CHDIR = 12 +pkg syscall (freebsd-arm), const SYS_CHFLAGS = 34 +pkg syscall (freebsd-arm), const SYS_CHMOD = 15 +pkg syscall (freebsd-arm), const SYS_CHOWN = 16 +pkg syscall (freebsd-arm), const SYS_CHROOT = 61 +pkg syscall (freebsd-arm), const SYS_CLOCK_GETCPUCLOCKID2 = 247 +pkg syscall (freebsd-arm), const SYS_CLOCK_GETRES = 234 +pkg syscall (freebsd-arm), const SYS_CLOCK_GETTIME = 232 +pkg syscall (freebsd-arm), const SYS_CLOCK_SETTIME = 233 +pkg syscall (freebsd-arm), const SYS_CLOSE = 6 +pkg syscall (freebsd-arm), const SYS_CLOSEFROM = 509 +pkg syscall (freebsd-arm), const SYS_CONNECT = 98 +pkg syscall (freebsd-arm), const SYS_CPUSET = 484 +pkg syscall (freebsd-arm), const SYS_CPUSET_GETAFFINITY = 487 +pkg syscall (freebsd-arm), const SYS_CPUSET_GETID = 486 +pkg syscall (freebsd-arm), const SYS_CPUSET_SETAFFINITY = 488 +pkg syscall (freebsd-arm), const SYS_CPUSET_SETID = 485 +pkg syscall (freebsd-arm), const SYS_DUP = 41 +pkg syscall (freebsd-arm), const SYS_DUP2 = 90 +pkg syscall (freebsd-arm), const SYS_EACCESS = 376 +pkg syscall (freebsd-arm), const SYS_EXECVE = 59 +pkg syscall (freebsd-arm), const SYS_EXIT = 1 +pkg syscall (freebsd-arm), const SYS_EXTATTRCTL = 355 +pkg syscall (freebsd-arm), const SYS_EXTATTR_DELETE_FD = 373 +pkg syscall (freebsd-arm), const SYS_EXTATTR_DELETE_FILE = 358 +pkg syscall (freebsd-arm), const SYS_EXTATTR_DELETE_LINK = 414 +pkg syscall (freebsd-arm), const SYS_EXTATTR_GET_FD = 372 +pkg syscall (freebsd-arm), const SYS_EXTATTR_GET_FILE = 357 +pkg syscall (freebsd-arm), const SYS_EXTATTR_GET_LINK = 413 +pkg syscall (freebsd-arm), const SYS_EXTATTR_LIST_FD = 437 +pkg syscall (freebsd-arm), const SYS_EXTATTR_LIST_FILE = 438 +pkg syscall (freebsd-arm), const SYS_EXTATTR_LIST_LINK = 439 +pkg syscall (freebsd-arm), const SYS_EXTATTR_SET_FD = 371 +pkg syscall (freebsd-arm), const SYS_EXTATTR_SET_FILE = 356 +pkg syscall (freebsd-arm), const SYS_EXTATTR_SET_LINK = 412 +pkg syscall (freebsd-arm), const SYS_FACCESSAT = 489 +pkg syscall (freebsd-arm), const SYS_FCHDIR = 13 +pkg syscall (freebsd-arm), const SYS_FCHFLAGS = 35 +pkg syscall (freebsd-arm), const SYS_FCHMOD = 124 +pkg syscall (freebsd-arm), const SYS_FCHMODAT = 490 +pkg syscall (freebsd-arm), const SYS_FCHOWN = 123 +pkg syscall (freebsd-arm), const SYS_FCHOWNAT = 491 +pkg syscall (freebsd-arm), const SYS_FCNTL = 92 +pkg syscall (freebsd-arm), const SYS_FEXECVE = 492 +pkg syscall (freebsd-arm), const SYS_FFCLOCK_GETCOUNTER = 241 +pkg syscall (freebsd-arm), const SYS_FFCLOCK_GETESTIMATE = 243 +pkg syscall (freebsd-arm), const SYS_FFCLOCK_SETESTIMATE = 242 +pkg syscall (freebsd-arm), const SYS_FHOPEN = 298 +pkg syscall (freebsd-arm), const SYS_FHSTAT = 299 +pkg syscall (freebsd-arm), const SYS_FHSTATFS = 398 +pkg syscall (freebsd-arm), const SYS_FLOCK = 131 +pkg syscall (freebsd-arm), const SYS_FORK = 2 +pkg syscall (freebsd-arm), const SYS_FPATHCONF = 192 +pkg syscall (freebsd-arm), const SYS_FREEBSD6_FTRUNCATE = 201 +pkg syscall (freebsd-arm), const SYS_FREEBSD6_LSEEK = 199 +pkg syscall (freebsd-arm), const SYS_FREEBSD6_MMAP = 197 +pkg syscall (freebsd-arm), const SYS_FREEBSD6_PREAD = 173 +pkg syscall (freebsd-arm), const SYS_FREEBSD6_PWRITE = 174 +pkg syscall (freebsd-arm), const SYS_FREEBSD6_TRUNCATE = 200 +pkg syscall (freebsd-arm), const SYS_FSTAT = 189 +pkg syscall (freebsd-arm), const SYS_FSTATAT = 493 +pkg syscall (freebsd-arm), const SYS_FSTATFS = 397 +pkg syscall (freebsd-arm), const SYS_FSYNC = 95 +pkg syscall (freebsd-arm), const SYS_FTRUNCATE = 480 +pkg syscall (freebsd-arm), const SYS_FUTIMES = 206 +pkg syscall (freebsd-arm), const SYS_FUTIMESAT = 494 +pkg syscall (freebsd-arm), const SYS_GETAUDIT = 449 +pkg syscall (freebsd-arm), const SYS_GETAUDIT_ADDR = 451 +pkg syscall (freebsd-arm), const SYS_GETAUID = 447 +pkg syscall (freebsd-arm), const SYS_GETCONTEXT = 421 +pkg syscall (freebsd-arm), const SYS_GETDENTS = 272 +pkg syscall (freebsd-arm), const SYS_GETDIRENTRIES = 196 +pkg syscall (freebsd-arm), const SYS_GETDTABLESIZE = 89 +pkg syscall (freebsd-arm), const SYS_GETEGID = 43 +pkg syscall (freebsd-arm), const SYS_GETEUID = 25 +pkg syscall (freebsd-arm), const SYS_GETFH = 161 +pkg syscall (freebsd-arm), const SYS_GETFSSTAT = 395 +pkg syscall (freebsd-arm), const SYS_GETGID = 47 +pkg syscall (freebsd-arm), const SYS_GETGROUPS = 79 +pkg syscall (freebsd-arm), const SYS_GETITIMER = 86 +pkg syscall (freebsd-arm), const SYS_GETLOGIN = 49 +pkg syscall (freebsd-arm), const SYS_GETLOGINCLASS = 523 +pkg syscall (freebsd-arm), const SYS_GETPEERNAME = 31 +pkg syscall (freebsd-arm), const SYS_GETPGID = 207 +pkg syscall (freebsd-arm), const SYS_GETPGRP = 81 +pkg syscall (freebsd-arm), const SYS_GETPID = 20 +pkg syscall (freebsd-arm), const SYS_GETPPID = 39 +pkg syscall (freebsd-arm), const SYS_GETPRIORITY = 100 +pkg syscall (freebsd-arm), const SYS_GETRESGID = 361 +pkg syscall (freebsd-arm), const SYS_GETRESUID = 360 +pkg syscall (freebsd-arm), const SYS_GETRLIMIT = 194 +pkg syscall (freebsd-arm), const SYS_GETRUSAGE = 117 +pkg syscall (freebsd-arm), const SYS_GETSID = 310 +pkg syscall (freebsd-arm), const SYS_GETSOCKNAME = 32 +pkg syscall (freebsd-arm), const SYS_GETSOCKOPT = 118 +pkg syscall (freebsd-arm), const SYS_GETTIMEOFDAY = 116 +pkg syscall (freebsd-arm), const SYS_GETUID = 24 +pkg syscall (freebsd-arm), const SYS_IOCTL = 54 +pkg syscall (freebsd-arm), const SYS_ISSETUGID = 253 +pkg syscall (freebsd-arm), const SYS_JAIL = 338 +pkg syscall (freebsd-arm), const SYS_JAIL_ATTACH = 436 +pkg syscall (freebsd-arm), const SYS_JAIL_GET = 506 +pkg syscall (freebsd-arm), const SYS_JAIL_REMOVE = 508 +pkg syscall (freebsd-arm), const SYS_JAIL_SET = 507 +pkg syscall (freebsd-arm), const SYS_KENV = 390 +pkg syscall (freebsd-arm), const SYS_KEVENT = 363 +pkg syscall (freebsd-arm), const SYS_KILL = 37 +pkg syscall (freebsd-arm), const SYS_KLDFIND = 306 +pkg syscall (freebsd-arm), const SYS_KLDFIRSTMOD = 309 +pkg syscall (freebsd-arm), const SYS_KLDLOAD = 304 +pkg syscall (freebsd-arm), const SYS_KLDNEXT = 307 +pkg syscall (freebsd-arm), const SYS_KLDSTAT = 308 +pkg syscall (freebsd-arm), const SYS_KLDSYM = 337 +pkg syscall (freebsd-arm), const SYS_KLDUNLOAD = 305 +pkg syscall (freebsd-arm), const SYS_KLDUNLOADF = 444 +pkg syscall (freebsd-arm), const SYS_KQUEUE = 362 +pkg syscall (freebsd-arm), const SYS_KTIMER_CREATE = 235 +pkg syscall (freebsd-arm), const SYS_KTIMER_DELETE = 236 +pkg syscall (freebsd-arm), const SYS_KTIMER_GETOVERRUN = 239 +pkg syscall (freebsd-arm), const SYS_KTIMER_GETTIME = 238 +pkg syscall (freebsd-arm), const SYS_KTIMER_SETTIME = 237 +pkg syscall (freebsd-arm), const SYS_KTRACE = 45 +pkg syscall (freebsd-arm), const SYS_LCHFLAGS = 391 +pkg syscall (freebsd-arm), const SYS_LCHMOD = 274 +pkg syscall (freebsd-arm), const SYS_LCHOWN = 254 +pkg syscall (freebsd-arm), const SYS_LGETFH = 160 +pkg syscall (freebsd-arm), const SYS_LINK = 9 +pkg syscall (freebsd-arm), const SYS_LINKAT = 495 +pkg syscall (freebsd-arm), const SYS_LISTEN = 106 +pkg syscall (freebsd-arm), const SYS_LPATHCONF = 513 +pkg syscall (freebsd-arm), const SYS_LSEEK = 478 +pkg syscall (freebsd-arm), const SYS_LSTAT = 190 +pkg syscall (freebsd-arm), const SYS_LUTIMES = 276 +pkg syscall (freebsd-arm), const SYS_MAC_SYSCALL = 394 +pkg syscall (freebsd-arm), const SYS_MADVISE = 75 +pkg syscall (freebsd-arm), const SYS_MINCORE = 78 +pkg syscall (freebsd-arm), const SYS_MINHERIT = 250 +pkg syscall (freebsd-arm), const SYS_MKDIR = 136 +pkg syscall (freebsd-arm), const SYS_MKDIRAT = 496 +pkg syscall (freebsd-arm), const SYS_MKFIFO = 132 +pkg syscall (freebsd-arm), const SYS_MKFIFOAT = 497 +pkg syscall (freebsd-arm), const SYS_MKNOD = 14 +pkg syscall (freebsd-arm), const SYS_MKNODAT = 498 +pkg syscall (freebsd-arm), const SYS_MLOCK = 203 +pkg syscall (freebsd-arm), const SYS_MLOCKALL = 324 +pkg syscall (freebsd-arm), const SYS_MMAP = 477 +pkg syscall (freebsd-arm), const SYS_MODFIND = 303 +pkg syscall (freebsd-arm), const SYS_MODFNEXT = 302 +pkg syscall (freebsd-arm), const SYS_MODNEXT = 300 +pkg syscall (freebsd-arm), const SYS_MODSTAT = 301 +pkg syscall (freebsd-arm), const SYS_MOUNT = 21 +pkg syscall (freebsd-arm), const SYS_MPROTECT = 74 +pkg syscall (freebsd-arm), const SYS_MSYNC = 65 +pkg syscall (freebsd-arm), const SYS_MUNLOCK = 204 +pkg syscall (freebsd-arm), const SYS_MUNLOCKALL = 325 +pkg syscall (freebsd-arm), const SYS_MUNMAP = 73 +pkg syscall (freebsd-arm), const SYS_NANOSLEEP = 240 +pkg syscall (freebsd-arm), const SYS_NFSTAT = 279 +pkg syscall (freebsd-arm), const SYS_NLSTAT = 280 +pkg syscall (freebsd-arm), const SYS_NMOUNT = 378 +pkg syscall (freebsd-arm), const SYS_NSTAT = 278 +pkg syscall (freebsd-arm), const SYS_NTP_ADJTIME = 176 +pkg syscall (freebsd-arm), const SYS_NTP_GETTIME = 248 +pkg syscall (freebsd-arm), const SYS_OBREAK = 17 +pkg syscall (freebsd-arm), const SYS_OPEN = 5 +pkg syscall (freebsd-arm), const SYS_OPENAT = 499 +pkg syscall (freebsd-arm), const SYS_OPENBSD_POLL = 252 +pkg syscall (freebsd-arm), const SYS_OVADVISE = 72 +pkg syscall (freebsd-arm), const SYS_PATHCONF = 191 +pkg syscall (freebsd-arm), const SYS_PDFORK = 518 +pkg syscall (freebsd-arm), const SYS_PDGETPID = 520 +pkg syscall (freebsd-arm), const SYS_PDKILL = 519 +pkg syscall (freebsd-arm), const SYS_PIPE = 42 +pkg syscall (freebsd-arm), const SYS_POLL = 209 +pkg syscall (freebsd-arm), const SYS_POSIX_FADVISE = 531 +pkg syscall (freebsd-arm), const SYS_POSIX_FALLOCATE = 530 +pkg syscall (freebsd-arm), const SYS_POSIX_OPENPT = 504 +pkg syscall (freebsd-arm), const SYS_PREAD = 475 +pkg syscall (freebsd-arm), const SYS_PREADV = 289 +pkg syscall (freebsd-arm), const SYS_PROFIL = 44 +pkg syscall (freebsd-arm), const SYS_PSELECT = 522 +pkg syscall (freebsd-arm), const SYS_PTRACE = 26 +pkg syscall (freebsd-arm), const SYS_PWRITE = 476 +pkg syscall (freebsd-arm), const SYS_PWRITEV = 290 +pkg syscall (freebsd-arm), const SYS_QUOTACTL = 148 +pkg syscall (freebsd-arm), const SYS_RCTL_ADD_RULE = 528 +pkg syscall (freebsd-arm), const SYS_RCTL_GET_LIMITS = 527 +pkg syscall (freebsd-arm), const SYS_RCTL_GET_RACCT = 525 +pkg syscall (freebsd-arm), const SYS_RCTL_GET_RULES = 526 +pkg syscall (freebsd-arm), const SYS_RCTL_REMOVE_RULE = 529 +pkg syscall (freebsd-arm), const SYS_READ = 3 +pkg syscall (freebsd-arm), const SYS_READLINK = 58 +pkg syscall (freebsd-arm), const SYS_READLINKAT = 500 +pkg syscall (freebsd-arm), const SYS_READV = 120 +pkg syscall (freebsd-arm), const SYS_REBOOT = 55 +pkg syscall (freebsd-arm), const SYS_RECVFROM = 29 +pkg syscall (freebsd-arm), const SYS_RECVMSG = 27 +pkg syscall (freebsd-arm), const SYS_RENAME = 128 +pkg syscall (freebsd-arm), const SYS_RENAMEAT = 501 +pkg syscall (freebsd-arm), const SYS_REVOKE = 56 +pkg syscall (freebsd-arm), const SYS_RFORK = 251 +pkg syscall (freebsd-arm), const SYS_RMDIR = 137 +pkg syscall (freebsd-arm), const SYS_RTPRIO = 166 +pkg syscall (freebsd-arm), const SYS_RTPRIO_THREAD = 466 +pkg syscall (freebsd-arm), const SYS_SBRK = 69 +pkg syscall (freebsd-arm), const SYS_SCHED_GETPARAM = 328 +pkg syscall (freebsd-arm), const SYS_SCHED_GETSCHEDULER = 330 +pkg syscall (freebsd-arm), const SYS_SCHED_GET_PRIORITY_MAX = 332 +pkg syscall (freebsd-arm), const SYS_SCHED_GET_PRIORITY_MIN = 333 +pkg syscall (freebsd-arm), const SYS_SCHED_RR_GET_INTERVAL = 334 +pkg syscall (freebsd-arm), const SYS_SCHED_SETPARAM = 327 +pkg syscall (freebsd-arm), const SYS_SCHED_SETSCHEDULER = 329 +pkg syscall (freebsd-arm), const SYS_SCHED_YIELD = 331 +pkg syscall (freebsd-arm), const SYS_SCTP_GENERIC_RECVMSG = 474 +pkg syscall (freebsd-arm), const SYS_SCTP_GENERIC_SENDMSG = 472 +pkg syscall (freebsd-arm), const SYS_SCTP_GENERIC_SENDMSG_IOV = 473 +pkg syscall (freebsd-arm), const SYS_SCTP_PEELOFF = 471 +pkg syscall (freebsd-arm), const SYS_SELECT = 93 +pkg syscall (freebsd-arm), const SYS_SENDFILE = 393 +pkg syscall (freebsd-arm), const SYS_SENDMSG = 28 +pkg syscall (freebsd-arm), const SYS_SENDTO = 133 +pkg syscall (freebsd-arm), const SYS_SETAUDIT = 450 +pkg syscall (freebsd-arm), const SYS_SETAUDIT_ADDR = 452 +pkg syscall (freebsd-arm), const SYS_SETAUID = 448 +pkg syscall (freebsd-arm), const SYS_SETCONTEXT = 422 +pkg syscall (freebsd-arm), const SYS_SETEGID = 182 +pkg syscall (freebsd-arm), const SYS_SETEUID = 183 +pkg syscall (freebsd-arm), const SYS_SETFIB = 175 +pkg syscall (freebsd-arm), const SYS_SETGID = 181 +pkg syscall (freebsd-arm), const SYS_SETGROUPS = 80 +pkg syscall (freebsd-arm), const SYS_SETITIMER = 83 +pkg syscall (freebsd-arm), const SYS_SETLOGIN = 50 +pkg syscall (freebsd-arm), const SYS_SETLOGINCLASS = 524 +pkg syscall (freebsd-arm), const SYS_SETPGID = 82 +pkg syscall (freebsd-arm), const SYS_SETPRIORITY = 96 +pkg syscall (freebsd-arm), const SYS_SETREGID = 127 +pkg syscall (freebsd-arm), const SYS_SETRESGID = 312 +pkg syscall (freebsd-arm), const SYS_SETRESUID = 311 +pkg syscall (freebsd-arm), const SYS_SETREUID = 126 +pkg syscall (freebsd-arm), const SYS_SETRLIMIT = 195 +pkg syscall (freebsd-arm), const SYS_SETSID = 147 +pkg syscall (freebsd-arm), const SYS_SETSOCKOPT = 105 +pkg syscall (freebsd-arm), const SYS_SETTIMEOFDAY = 122 +pkg syscall (freebsd-arm), const SYS_SETUID = 23 +pkg syscall (freebsd-arm), const SYS_SHM_OPEN = 482 +pkg syscall (freebsd-arm), const SYS_SHM_UNLINK = 483 +pkg syscall (freebsd-arm), const SYS_SHUTDOWN = 134 +pkg syscall (freebsd-arm), const SYS_SIGACTION = 416 +pkg syscall (freebsd-arm), const SYS_SIGALTSTACK = 53 +pkg syscall (freebsd-arm), const SYS_SIGPENDING = 343 +pkg syscall (freebsd-arm), const SYS_SIGPROCMASK = 340 +pkg syscall (freebsd-arm), const SYS_SIGQUEUE = 456 +pkg syscall (freebsd-arm), const SYS_SIGRETURN = 417 +pkg syscall (freebsd-arm), const SYS_SIGSUSPEND = 341 +pkg syscall (freebsd-arm), const SYS_SIGTIMEDWAIT = 345 +pkg syscall (freebsd-arm), const SYS_SIGWAIT = 429 +pkg syscall (freebsd-arm), const SYS_SIGWAITINFO = 346 +pkg syscall (freebsd-arm), const SYS_SOCKET = 97 +pkg syscall (freebsd-arm), const SYS_SOCKETPAIR = 135 +pkg syscall (freebsd-arm), const SYS_SSTK = 70 +pkg syscall (freebsd-arm), const SYS_STAT = 188 +pkg syscall (freebsd-arm), const SYS_STATFS = 396 +pkg syscall (freebsd-arm), const SYS_SWAPCONTEXT = 423 +pkg syscall (freebsd-arm), const SYS_SWAPOFF = 424 +pkg syscall (freebsd-arm), const SYS_SWAPON = 85 +pkg syscall (freebsd-arm), const SYS_SYMLINK = 57 +pkg syscall (freebsd-arm), const SYS_SYMLINKAT = 502 +pkg syscall (freebsd-arm), const SYS_SYNC = 36 +pkg syscall (freebsd-arm), const SYS_SYSARCH = 165 +pkg syscall (freebsd-arm), const SYS_THR_CREATE = 430 +pkg syscall (freebsd-arm), const SYS_THR_EXIT = 431 +pkg syscall (freebsd-arm), const SYS_THR_KILL = 433 +pkg syscall (freebsd-arm), const SYS_THR_KILL2 = 481 +pkg syscall (freebsd-arm), const SYS_THR_NEW = 455 +pkg syscall (freebsd-arm), const SYS_THR_SELF = 432 +pkg syscall (freebsd-arm), const SYS_THR_SET_NAME = 464 +pkg syscall (freebsd-arm), const SYS_THR_SUSPEND = 442 +pkg syscall (freebsd-arm), const SYS_THR_WAKE = 443 +pkg syscall (freebsd-arm), const SYS_TRUNCATE = 479 +pkg syscall (freebsd-arm), const SYS_UMASK = 60 +pkg syscall (freebsd-arm), const SYS_UNDELETE = 205 +pkg syscall (freebsd-arm), const SYS_UNLINK = 10 +pkg syscall (freebsd-arm), const SYS_UNLINKAT = 503 +pkg syscall (freebsd-arm), const SYS_UNMOUNT = 22 +pkg syscall (freebsd-arm), const SYS_UTIMES = 138 +pkg syscall (freebsd-arm), const SYS_UTRACE = 335 +pkg syscall (freebsd-arm), const SYS_UUIDGEN = 392 +pkg syscall (freebsd-arm), const SYS_VFORK = 66 +pkg syscall (freebsd-arm), const SYS_WAIT4 = 7 +pkg syscall (freebsd-arm), const SYS_WAIT6 = 532 +pkg syscall (freebsd-arm), const SYS_WRITE = 4 +pkg syscall (freebsd-arm), const SYS_WRITEV = 121 +pkg syscall (freebsd-arm), const SYS_YIELD = 321 +pkg syscall (freebsd-arm), const SYS__UMTX_LOCK = 434 +pkg syscall (freebsd-arm), const SYS__UMTX_OP = 454 +pkg syscall (freebsd-arm), const SYS__UMTX_UNLOCK = 435 +pkg syscall (freebsd-arm), const SYS___ACL_ACLCHECK_FD = 354 +pkg syscall (freebsd-arm), const SYS___ACL_ACLCHECK_FILE = 353 +pkg syscall (freebsd-arm), const SYS___ACL_ACLCHECK_LINK = 428 +pkg syscall (freebsd-arm), const SYS___ACL_DELETE_FD = 352 +pkg syscall (freebsd-arm), const SYS___ACL_DELETE_FILE = 351 +pkg syscall (freebsd-arm), const SYS___ACL_DELETE_LINK = 427 +pkg syscall (freebsd-arm), const SYS___ACL_GET_FD = 349 +pkg syscall (freebsd-arm), const SYS___ACL_GET_FILE = 347 +pkg syscall (freebsd-arm), const SYS___ACL_GET_LINK = 425 +pkg syscall (freebsd-arm), const SYS___ACL_SET_FD = 350 +pkg syscall (freebsd-arm), const SYS___ACL_SET_FILE = 348 +pkg syscall (freebsd-arm), const SYS___ACL_SET_LINK = 426 +pkg syscall (freebsd-arm), const SYS___GETCWD = 326 +pkg syscall (freebsd-arm), const SYS___MAC_EXECVE = 415 +pkg syscall (freebsd-arm), const SYS___MAC_GET_FD = 386 +pkg syscall (freebsd-arm), const SYS___MAC_GET_FILE = 387 +pkg syscall (freebsd-arm), const SYS___MAC_GET_LINK = 410 +pkg syscall (freebsd-arm), const SYS___MAC_GET_PID = 409 +pkg syscall (freebsd-arm), const SYS___MAC_GET_PROC = 384 +pkg syscall (freebsd-arm), const SYS___MAC_SET_FD = 388 +pkg syscall (freebsd-arm), const SYS___MAC_SET_FILE = 389 +pkg syscall (freebsd-arm), const SYS___MAC_SET_LINK = 411 +pkg syscall (freebsd-arm), const SYS___MAC_SET_PROC = 385 +pkg syscall (freebsd-arm), const SYS___SETUGID = 374 +pkg syscall (freebsd-arm), const SYS___SYSCTL = 202 +pkg syscall (freebsd-arm), const S_IFMT = 61440 +pkg syscall (freebsd-arm), const SizeofBpfHdr = 24 +pkg syscall (freebsd-arm), const SizeofBpfInsn = 8 +pkg syscall (freebsd-arm), const SizeofBpfProgram = 8 +pkg syscall (freebsd-arm), const SizeofBpfStat = 8 +pkg syscall (freebsd-arm), const SizeofBpfVersion = 4 +pkg syscall (freebsd-arm), const SizeofBpfZbuf = 12 +pkg syscall (freebsd-arm), const SizeofBpfZbufHeader = 32 +pkg syscall (freebsd-arm), const SizeofCmsghdr = 12 +pkg syscall (freebsd-arm), const SizeofIPMreq = 8 +pkg syscall (freebsd-arm), const SizeofIPMreqn = 12 +pkg syscall (freebsd-arm), const SizeofIPv6Mreq = 20 +pkg syscall (freebsd-arm), const SizeofIfAnnounceMsghdr = 24 +pkg syscall (freebsd-arm), const SizeofIfData = 88 +pkg syscall (freebsd-arm), const SizeofIfMsghdr = 104 +pkg syscall (freebsd-arm), const SizeofIfaMsghdr = 20 +pkg syscall (freebsd-arm), const SizeofIfmaMsghdr = 16 +pkg syscall (freebsd-arm), const SizeofInet6Pktinfo = 20 +pkg syscall (freebsd-arm), const SizeofLinger = 8 +pkg syscall (freebsd-arm), const SizeofMsghdr = 28 +pkg syscall (freebsd-arm), const SizeofRtMetrics = 56 +pkg syscall (freebsd-arm), const SizeofRtMsghdr = 92 +pkg syscall (freebsd-arm), const SizeofSockaddrAny = 108 +pkg syscall (freebsd-arm), const SizeofSockaddrDatalink = 56 +pkg syscall (freebsd-arm), const SizeofSockaddrInet4 = 16 +pkg syscall (freebsd-arm), const SizeofSockaddrInet6 = 28 +pkg syscall (freebsd-arm), const SizeofSockaddrUnix = 108 +pkg syscall (freebsd-arm), const TCIFLUSH = 1 +pkg syscall (freebsd-arm), const TCIOFLUSH = 3 +pkg syscall (freebsd-arm), const TCOFLUSH = 2 +pkg syscall (freebsd-arm), const TCP_CA_NAME_MAX = 16 +pkg syscall (freebsd-arm), const TCP_CONGESTION = 64 +pkg syscall (freebsd-arm), const TCP_INFO = 32 +pkg syscall (freebsd-arm), const TCP_KEEPCNT = 1024 +pkg syscall (freebsd-arm), const TCP_KEEPIDLE = 256 +pkg syscall (freebsd-arm), const TCP_KEEPINIT = 128 +pkg syscall (freebsd-arm), const TCP_KEEPINTVL = 512 +pkg syscall (freebsd-arm), const TCP_MAXBURST = 4 +pkg syscall (freebsd-arm), const TCP_MAXHLEN = 60 +pkg syscall (freebsd-arm), const TCP_MAXOLEN = 40 +pkg syscall (freebsd-arm), const TCP_MAXSEG = 2 +pkg syscall (freebsd-arm), const TCP_MAXWIN = 65535 +pkg syscall (freebsd-arm), const TCP_MAX_SACK = 4 +pkg syscall (freebsd-arm), const TCP_MAX_WINSHIFT = 14 +pkg syscall (freebsd-arm), const TCP_MD5SIG = 16 +pkg syscall (freebsd-arm), const TCP_MINMSS = 216 +pkg syscall (freebsd-arm), const TCP_MSS = 536 +pkg syscall (freebsd-arm), const TCP_NOOPT = 8 +pkg syscall (freebsd-arm), const TCP_NOPUSH = 4 +pkg syscall (freebsd-arm), const TCSAFLUSH = 2 +pkg syscall (freebsd-arm), const TIOCCBRK = 536900730 +pkg syscall (freebsd-arm), const TIOCCDTR = 536900728 +pkg syscall (freebsd-arm), const TIOCCONS = 2147775586 +pkg syscall (freebsd-arm), const TIOCDRAIN = 536900702 +pkg syscall (freebsd-arm), const TIOCEXCL = 536900621 +pkg syscall (freebsd-arm), const TIOCEXT = 2147775584 +pkg syscall (freebsd-arm), const TIOCFLUSH = 2147775504 +pkg syscall (freebsd-arm), const TIOCGDRAINWAIT = 1074033750 +pkg syscall (freebsd-arm), const TIOCGETA = 1076655123 +pkg syscall (freebsd-arm), const TIOCGETD = 1074033690 +pkg syscall (freebsd-arm), const TIOCGPGRP = 1074033783 +pkg syscall (freebsd-arm), const TIOCGPTN = 1074033679 +pkg syscall (freebsd-arm), const TIOCGSID = 1074033763 +pkg syscall (freebsd-arm), const TIOCGWINSZ = 1074295912 +pkg syscall (freebsd-arm), const TIOCMBIC = 2147775595 +pkg syscall (freebsd-arm), const TIOCMBIS = 2147775596 +pkg syscall (freebsd-arm), const TIOCMGDTRWAIT = 1074033754 +pkg syscall (freebsd-arm), const TIOCMGET = 1074033770 +pkg syscall (freebsd-arm), const TIOCMSDTRWAIT = 2147775579 +pkg syscall (freebsd-arm), const TIOCMSET = 2147775597 +pkg syscall (freebsd-arm), const TIOCM_CAR = 64 +pkg syscall (freebsd-arm), const TIOCM_CD = 64 +pkg syscall (freebsd-arm), const TIOCM_CTS = 32 +pkg syscall (freebsd-arm), const TIOCM_DCD = 64 +pkg syscall (freebsd-arm), const TIOCM_DSR = 256 +pkg syscall (freebsd-arm), const TIOCM_DTR = 2 +pkg syscall (freebsd-arm), const TIOCM_LE = 1 +pkg syscall (freebsd-arm), const TIOCM_RI = 128 +pkg syscall (freebsd-arm), const TIOCM_RNG = 128 +pkg syscall (freebsd-arm), const TIOCM_RTS = 4 +pkg syscall (freebsd-arm), const TIOCM_SR = 16 +pkg syscall (freebsd-arm), const TIOCM_ST = 8 +pkg syscall (freebsd-arm), const TIOCNOTTY = 536900721 +pkg syscall (freebsd-arm), const TIOCNXCL = 536900622 +pkg syscall (freebsd-arm), const TIOCOUTQ = 1074033779 +pkg syscall (freebsd-arm), const TIOCPKT = 2147775600 +pkg syscall (freebsd-arm), const TIOCPKT_DATA = 0 +pkg syscall (freebsd-arm), const TIOCPKT_DOSTOP = 32 +pkg syscall (freebsd-arm), const TIOCPKT_FLUSHREAD = 1 +pkg syscall (freebsd-arm), const TIOCPKT_FLUSHWRITE = 2 +pkg syscall (freebsd-arm), const TIOCPKT_IOCTL = 64 +pkg syscall (freebsd-arm), const TIOCPKT_NOSTOP = 16 +pkg syscall (freebsd-arm), const TIOCPKT_START = 8 +pkg syscall (freebsd-arm), const TIOCPKT_STOP = 4 +pkg syscall (freebsd-arm), const TIOCPTMASTER = 536900636 +pkg syscall (freebsd-arm), const TIOCSBRK = 536900731 +pkg syscall (freebsd-arm), const TIOCSCTTY = 536900705 +pkg syscall (freebsd-arm), const TIOCSDRAINWAIT = 2147775575 +pkg syscall (freebsd-arm), const TIOCSDTR = 536900729 +pkg syscall (freebsd-arm), const TIOCSETA = 2150396948 +pkg syscall (freebsd-arm), const TIOCSETAF = 2150396950 +pkg syscall (freebsd-arm), const TIOCSETAW = 2150396949 +pkg syscall (freebsd-arm), const TIOCSETD = 2147775515 +pkg syscall (freebsd-arm), const TIOCSIG = 537162847 +pkg syscall (freebsd-arm), const TIOCSPGRP = 2147775606 +pkg syscall (freebsd-arm), const TIOCSTART = 536900718 +pkg syscall (freebsd-arm), const TIOCSTAT = 536900709 +pkg syscall (freebsd-arm), const TIOCSTI = 2147578994 +pkg syscall (freebsd-arm), const TIOCSTOP = 536900719 +pkg syscall (freebsd-arm), const TIOCSWINSZ = 2148037735 +pkg syscall (freebsd-arm), const TIOCTIMESTAMP = 1074558041 +pkg syscall (freebsd-arm), const TIOCUCNTL = 2147775590 +pkg syscall (freebsd-arm), const TOSTOP = 4194304 +pkg syscall (freebsd-arm), const VDISCARD = 15 +pkg syscall (freebsd-arm), const VDSUSP = 11 +pkg syscall (freebsd-arm), const VEOF = 0 +pkg syscall (freebsd-arm), const VEOL = 1 +pkg syscall (freebsd-arm), const VEOL2 = 2 +pkg syscall (freebsd-arm), const VERASE = 3 +pkg syscall (freebsd-arm), const VERASE2 = 7 +pkg syscall (freebsd-arm), const VINTR = 8 +pkg syscall (freebsd-arm), const VKILL = 5 +pkg syscall (freebsd-arm), const VLNEXT = 14 +pkg syscall (freebsd-arm), const VMIN = 16 +pkg syscall (freebsd-arm), const VQUIT = 9 +pkg syscall (freebsd-arm), const VREPRINT = 6 +pkg syscall (freebsd-arm), const VSTART = 12 +pkg syscall (freebsd-arm), const VSTATUS = 18 +pkg syscall (freebsd-arm), const VSTOP = 13 +pkg syscall (freebsd-arm), const VSUSP = 10 +pkg syscall (freebsd-arm), const VTIME = 17 +pkg syscall (freebsd-arm), const VWERASE = 4 +pkg syscall (freebsd-arm), const WCONTINUED = 4 +pkg syscall (freebsd-arm), const WCOREFLAG = 128 +pkg syscall (freebsd-arm), const WEXITED = 16 +pkg syscall (freebsd-arm), const WLINUXCLONE = 2147483648 +pkg syscall (freebsd-arm), const WNOHANG = 1 +pkg syscall (freebsd-arm), const WNOWAIT = 8 +pkg syscall (freebsd-arm), const WSTOPPED = 2 +pkg syscall (freebsd-arm), const WTRAPPED = 32 +pkg syscall (freebsd-arm), const WUNTRACED = 2 +pkg syscall (freebsd-arm-cgo), const AF_APPLETALK = 16 +pkg syscall (freebsd-arm-cgo), const AF_ARP = 35 +pkg syscall (freebsd-arm-cgo), const AF_ATM = 30 +pkg syscall (freebsd-arm-cgo), const AF_BLUETOOTH = 36 +pkg syscall (freebsd-arm-cgo), const AF_CCITT = 10 +pkg syscall (freebsd-arm-cgo), const AF_CHAOS = 5 +pkg syscall (freebsd-arm-cgo), const AF_CNT = 21 +pkg syscall (freebsd-arm-cgo), const AF_COIP = 20 +pkg syscall (freebsd-arm-cgo), const AF_DATAKIT = 9 +pkg syscall (freebsd-arm-cgo), const AF_DECnet = 12 +pkg syscall (freebsd-arm-cgo), const AF_DLI = 13 +pkg syscall (freebsd-arm-cgo), const AF_E164 = 26 +pkg syscall (freebsd-arm-cgo), const AF_ECMA = 8 +pkg syscall (freebsd-arm-cgo), const AF_HYLINK = 15 +pkg syscall (freebsd-arm-cgo), const AF_IEEE80211 = 37 +pkg syscall (freebsd-arm-cgo), const AF_IMPLINK = 3 +pkg syscall (freebsd-arm-cgo), const AF_INET6 = 28 +pkg syscall (freebsd-arm-cgo), const AF_IPX = 23 +pkg syscall (freebsd-arm-cgo), const AF_ISDN = 26 +pkg syscall (freebsd-arm-cgo), const AF_ISO = 7 +pkg syscall (freebsd-arm-cgo), const AF_LAT = 14 +pkg syscall (freebsd-arm-cgo), const AF_LINK = 18 +pkg syscall (freebsd-arm-cgo), const AF_LOCAL = 1 +pkg syscall (freebsd-arm-cgo), const AF_MAX = 38 +pkg syscall (freebsd-arm-cgo), const AF_NATM = 29 +pkg syscall (freebsd-arm-cgo), const AF_NETBIOS = 6 +pkg syscall (freebsd-arm-cgo), const AF_NETGRAPH = 32 +pkg syscall (freebsd-arm-cgo), const AF_OSI = 7 +pkg syscall (freebsd-arm-cgo), const AF_PUP = 4 +pkg syscall (freebsd-arm-cgo), const AF_ROUTE = 17 +pkg syscall (freebsd-arm-cgo), const AF_SCLUSTER = 34 +pkg syscall (freebsd-arm-cgo), const AF_SIP = 24 +pkg syscall (freebsd-arm-cgo), const AF_SLOW = 33 +pkg syscall (freebsd-arm-cgo), const AF_SNA = 11 +pkg syscall (freebsd-arm-cgo), const AF_VENDOR00 = 39 +pkg syscall (freebsd-arm-cgo), const AF_VENDOR01 = 41 +pkg syscall (freebsd-arm-cgo), const AF_VENDOR02 = 43 +pkg syscall (freebsd-arm-cgo), const AF_VENDOR03 = 45 +pkg syscall (freebsd-arm-cgo), const AF_VENDOR04 = 47 +pkg syscall (freebsd-arm-cgo), const AF_VENDOR05 = 49 +pkg syscall (freebsd-arm-cgo), const AF_VENDOR06 = 51 +pkg syscall (freebsd-arm-cgo), const AF_VENDOR07 = 53 +pkg syscall (freebsd-arm-cgo), const AF_VENDOR08 = 55 +pkg syscall (freebsd-arm-cgo), const AF_VENDOR09 = 57 +pkg syscall (freebsd-arm-cgo), const AF_VENDOR10 = 59 +pkg syscall (freebsd-arm-cgo), const AF_VENDOR11 = 61 +pkg syscall (freebsd-arm-cgo), const AF_VENDOR12 = 63 +pkg syscall (freebsd-arm-cgo), const AF_VENDOR13 = 65 +pkg syscall (freebsd-arm-cgo), const AF_VENDOR14 = 67 +pkg syscall (freebsd-arm-cgo), const AF_VENDOR15 = 69 +pkg syscall (freebsd-arm-cgo), const AF_VENDOR16 = 71 +pkg syscall (freebsd-arm-cgo), const AF_VENDOR17 = 73 +pkg syscall (freebsd-arm-cgo), const AF_VENDOR18 = 75 +pkg syscall (freebsd-arm-cgo), const AF_VENDOR19 = 77 +pkg syscall (freebsd-arm-cgo), const AF_VENDOR20 = 79 +pkg syscall (freebsd-arm-cgo), const AF_VENDOR21 = 81 +pkg syscall (freebsd-arm-cgo), const AF_VENDOR22 = 83 +pkg syscall (freebsd-arm-cgo), const AF_VENDOR23 = 85 +pkg syscall (freebsd-arm-cgo), const AF_VENDOR24 = 87 +pkg syscall (freebsd-arm-cgo), const AF_VENDOR25 = 89 +pkg syscall (freebsd-arm-cgo), const AF_VENDOR26 = 91 +pkg syscall (freebsd-arm-cgo), const AF_VENDOR27 = 93 +pkg syscall (freebsd-arm-cgo), const AF_VENDOR28 = 95 +pkg syscall (freebsd-arm-cgo), const AF_VENDOR29 = 97 +pkg syscall (freebsd-arm-cgo), const AF_VENDOR30 = 99 +pkg syscall (freebsd-arm-cgo), const AF_VENDOR31 = 101 +pkg syscall (freebsd-arm-cgo), const AF_VENDOR32 = 103 +pkg syscall (freebsd-arm-cgo), const AF_VENDOR33 = 105 +pkg syscall (freebsd-arm-cgo), const AF_VENDOR34 = 107 +pkg syscall (freebsd-arm-cgo), const AF_VENDOR35 = 109 +pkg syscall (freebsd-arm-cgo), const AF_VENDOR36 = 111 +pkg syscall (freebsd-arm-cgo), const AF_VENDOR37 = 113 +pkg syscall (freebsd-arm-cgo), const AF_VENDOR38 = 115 +pkg syscall (freebsd-arm-cgo), const AF_VENDOR39 = 117 +pkg syscall (freebsd-arm-cgo), const AF_VENDOR40 = 119 +pkg syscall (freebsd-arm-cgo), const AF_VENDOR41 = 121 +pkg syscall (freebsd-arm-cgo), const AF_VENDOR42 = 123 +pkg syscall (freebsd-arm-cgo), const AF_VENDOR43 = 125 +pkg syscall (freebsd-arm-cgo), const AF_VENDOR44 = 127 +pkg syscall (freebsd-arm-cgo), const AF_VENDOR45 = 129 +pkg syscall (freebsd-arm-cgo), const AF_VENDOR46 = 131 +pkg syscall (freebsd-arm-cgo), const AF_VENDOR47 = 133 +pkg syscall (freebsd-arm-cgo), const B0 = 0 +pkg syscall (freebsd-arm-cgo), const B110 = 110 +pkg syscall (freebsd-arm-cgo), const B115200 = 115200 +pkg syscall (freebsd-arm-cgo), const B1200 = 1200 +pkg syscall (freebsd-arm-cgo), const B134 = 134 +pkg syscall (freebsd-arm-cgo), const B14400 = 14400 +pkg syscall (freebsd-arm-cgo), const B150 = 150 +pkg syscall (freebsd-arm-cgo), const B1800 = 1800 +pkg syscall (freebsd-arm-cgo), const B19200 = 19200 +pkg syscall (freebsd-arm-cgo), const B200 = 200 +pkg syscall (freebsd-arm-cgo), const B230400 = 230400 +pkg syscall (freebsd-arm-cgo), const B2400 = 2400 +pkg syscall (freebsd-arm-cgo), const B28800 = 28800 +pkg syscall (freebsd-arm-cgo), const B300 = 300 +pkg syscall (freebsd-arm-cgo), const B38400 = 38400 +pkg syscall (freebsd-arm-cgo), const B460800 = 460800 +pkg syscall (freebsd-arm-cgo), const B4800 = 4800 +pkg syscall (freebsd-arm-cgo), const B50 = 50 +pkg syscall (freebsd-arm-cgo), const B57600 = 57600 +pkg syscall (freebsd-arm-cgo), const B600 = 600 +pkg syscall (freebsd-arm-cgo), const B7200 = 7200 +pkg syscall (freebsd-arm-cgo), const B75 = 75 +pkg syscall (freebsd-arm-cgo), const B76800 = 76800 +pkg syscall (freebsd-arm-cgo), const B921600 = 921600 +pkg syscall (freebsd-arm-cgo), const B9600 = 9600 +pkg syscall (freebsd-arm-cgo), const BIOCFEEDBACK = 2147762812 +pkg syscall (freebsd-arm-cgo), const BIOCFLUSH = 536887912 +pkg syscall (freebsd-arm-cgo), const BIOCGBLEN = 1074020966 +pkg syscall (freebsd-arm-cgo), const BIOCGDIRECTION = 1074020982 +pkg syscall (freebsd-arm-cgo), const BIOCGDLT = 1074020970 +pkg syscall (freebsd-arm-cgo), const BIOCGDLTLIST = 3221766777 +pkg syscall (freebsd-arm-cgo), const BIOCGETBUFMODE = 1074020989 +pkg syscall (freebsd-arm-cgo), const BIOCGETIF = 1075855979 +pkg syscall (freebsd-arm-cgo), const BIOCGETZMAX = 1074020991 +pkg syscall (freebsd-arm-cgo), const BIOCGHDRCMPLT = 1074020980 +pkg syscall (freebsd-arm-cgo), const BIOCGRSIG = 1074020978 +pkg syscall (freebsd-arm-cgo), const BIOCGRTIMEOUT = 1074545262 +pkg syscall (freebsd-arm-cgo), const BIOCGSEESENT = 1074020982 +pkg syscall (freebsd-arm-cgo), const BIOCGSTATS = 1074283119 +pkg syscall (freebsd-arm-cgo), const BIOCGTSTAMP = 1074020995 +pkg syscall (freebsd-arm-cgo), const BIOCIMMEDIATE = 2147762800 +pkg syscall (freebsd-arm-cgo), const BIOCLOCK = 536887930 +pkg syscall (freebsd-arm-cgo), const BIOCPROMISC = 536887913 +pkg syscall (freebsd-arm-cgo), const BIOCROTZBUF = 1074545280 +pkg syscall (freebsd-arm-cgo), const BIOCSBLEN = 3221504614 +pkg syscall (freebsd-arm-cgo), const BIOCSDIRECTION = 2147762807 +pkg syscall (freebsd-arm-cgo), const BIOCSDLT = 2147762808 +pkg syscall (freebsd-arm-cgo), const BIOCSETBUFMODE = 2147762814 +pkg syscall (freebsd-arm-cgo), const BIOCSETF = 2148024935 +pkg syscall (freebsd-arm-cgo), const BIOCSETFNR = 2148024962 +pkg syscall (freebsd-arm-cgo), const BIOCSETIF = 2149597804 +pkg syscall (freebsd-arm-cgo), const BIOCSETWF = 2148024955 +pkg syscall (freebsd-arm-cgo), const BIOCSETZBUF = 2148287105 +pkg syscall (freebsd-arm-cgo), const BIOCSHDRCMPLT = 2147762805 +pkg syscall (freebsd-arm-cgo), const BIOCSRSIG = 2147762803 +pkg syscall (freebsd-arm-cgo), const BIOCSRTIMEOUT = 2148287085 +pkg syscall (freebsd-arm-cgo), const BIOCSSEESENT = 2147762807 +pkg syscall (freebsd-arm-cgo), const BIOCSTSTAMP = 2147762820 +pkg syscall (freebsd-arm-cgo), const BIOCVERSION = 1074020977 +pkg syscall (freebsd-arm-cgo), const BPF_A = 16 +pkg syscall (freebsd-arm-cgo), const BPF_ABS = 32 +pkg syscall (freebsd-arm-cgo), const BPF_ADD = 0 +pkg syscall (freebsd-arm-cgo), const BPF_ALIGNMENT = 4 +pkg syscall (freebsd-arm-cgo), const BPF_ALU = 4 +pkg syscall (freebsd-arm-cgo), const BPF_AND = 80 +pkg syscall (freebsd-arm-cgo), const BPF_B = 16 +pkg syscall (freebsd-arm-cgo), const BPF_BUFMODE_BUFFER = 1 +pkg syscall (freebsd-arm-cgo), const BPF_BUFMODE_ZBUF = 2 +pkg syscall (freebsd-arm-cgo), const BPF_DIV = 48 +pkg syscall (freebsd-arm-cgo), const BPF_H = 8 +pkg syscall (freebsd-arm-cgo), const BPF_IMM = 0 +pkg syscall (freebsd-arm-cgo), const BPF_IND = 64 +pkg syscall (freebsd-arm-cgo), const BPF_JA = 0 +pkg syscall (freebsd-arm-cgo), const BPF_JEQ = 16 +pkg syscall (freebsd-arm-cgo), const BPF_JGE = 48 +pkg syscall (freebsd-arm-cgo), const BPF_JGT = 32 +pkg syscall (freebsd-arm-cgo), const BPF_JMP = 5 +pkg syscall (freebsd-arm-cgo), const BPF_JSET = 64 +pkg syscall (freebsd-arm-cgo), const BPF_K = 0 +pkg syscall (freebsd-arm-cgo), const BPF_LD = 0 +pkg syscall (freebsd-arm-cgo), const BPF_LDX = 1 +pkg syscall (freebsd-arm-cgo), const BPF_LEN = 128 +pkg syscall (freebsd-arm-cgo), const BPF_LSH = 96 +pkg syscall (freebsd-arm-cgo), const BPF_MAJOR_VERSION = 1 +pkg syscall (freebsd-arm-cgo), const BPF_MAXBUFSIZE = 524288 +pkg syscall (freebsd-arm-cgo), const BPF_MAXINSNS = 512 +pkg syscall (freebsd-arm-cgo), const BPF_MEM = 96 +pkg syscall (freebsd-arm-cgo), const BPF_MEMWORDS = 16 +pkg syscall (freebsd-arm-cgo), const BPF_MINBUFSIZE = 32 +pkg syscall (freebsd-arm-cgo), const BPF_MINOR_VERSION = 1 +pkg syscall (freebsd-arm-cgo), const BPF_MISC = 7 +pkg syscall (freebsd-arm-cgo), const BPF_MSH = 160 +pkg syscall (freebsd-arm-cgo), const BPF_MUL = 32 +pkg syscall (freebsd-arm-cgo), const BPF_NEG = 128 +pkg syscall (freebsd-arm-cgo), const BPF_OR = 64 +pkg syscall (freebsd-arm-cgo), const BPF_RELEASE = 199606 +pkg syscall (freebsd-arm-cgo), const BPF_RET = 6 +pkg syscall (freebsd-arm-cgo), const BPF_RSH = 112 +pkg syscall (freebsd-arm-cgo), const BPF_ST = 2 +pkg syscall (freebsd-arm-cgo), const BPF_STX = 3 +pkg syscall (freebsd-arm-cgo), const BPF_SUB = 16 +pkg syscall (freebsd-arm-cgo), const BPF_TAX = 0 +pkg syscall (freebsd-arm-cgo), const BPF_TXA = 128 +pkg syscall (freebsd-arm-cgo), const BPF_T_BINTIME = 2 +pkg syscall (freebsd-arm-cgo), const BPF_T_BINTIME_FAST = 258 +pkg syscall (freebsd-arm-cgo), const BPF_T_BINTIME_MONOTONIC = 514 +pkg syscall (freebsd-arm-cgo), const BPF_T_BINTIME_MONOTONIC_FAST = 770 +pkg syscall (freebsd-arm-cgo), const BPF_T_FAST = 256 +pkg syscall (freebsd-arm-cgo), const BPF_T_FLAG_MASK = 768 +pkg syscall (freebsd-arm-cgo), const BPF_T_FORMAT_MASK = 3 +pkg syscall (freebsd-arm-cgo), const BPF_T_MICROTIME = 0 +pkg syscall (freebsd-arm-cgo), const BPF_T_MICROTIME_FAST = 256 +pkg syscall (freebsd-arm-cgo), const BPF_T_MICROTIME_MONOTONIC = 512 +pkg syscall (freebsd-arm-cgo), const BPF_T_MICROTIME_MONOTONIC_FAST = 768 +pkg syscall (freebsd-arm-cgo), const BPF_T_MONOTONIC = 512 +pkg syscall (freebsd-arm-cgo), const BPF_T_MONOTONIC_FAST = 768 +pkg syscall (freebsd-arm-cgo), const BPF_T_NANOTIME = 1 +pkg syscall (freebsd-arm-cgo), const BPF_T_NANOTIME_FAST = 257 +pkg syscall (freebsd-arm-cgo), const BPF_T_NANOTIME_MONOTONIC = 513 +pkg syscall (freebsd-arm-cgo), const BPF_T_NANOTIME_MONOTONIC_FAST = 769 +pkg syscall (freebsd-arm-cgo), const BPF_T_NONE = 3 +pkg syscall (freebsd-arm-cgo), const BPF_T_NORMAL = 0 +pkg syscall (freebsd-arm-cgo), const BPF_W = 0 +pkg syscall (freebsd-arm-cgo), const BPF_X = 8 +pkg syscall (freebsd-arm-cgo), const BRKINT = 2 +pkg syscall (freebsd-arm-cgo), const CFLUSH = 15 +pkg syscall (freebsd-arm-cgo), const CLOCAL = 32768 +pkg syscall (freebsd-arm-cgo), const CREAD = 2048 +pkg syscall (freebsd-arm-cgo), const CS5 = 0 +pkg syscall (freebsd-arm-cgo), const CS6 = 256 +pkg syscall (freebsd-arm-cgo), const CS7 = 512 +pkg syscall (freebsd-arm-cgo), const CS8 = 768 +pkg syscall (freebsd-arm-cgo), const CSIZE = 768 +pkg syscall (freebsd-arm-cgo), const CSTART = 17 +pkg syscall (freebsd-arm-cgo), const CSTATUS = 20 +pkg syscall (freebsd-arm-cgo), const CSTOP = 19 +pkg syscall (freebsd-arm-cgo), const CSTOPB = 1024 +pkg syscall (freebsd-arm-cgo), const CSUSP = 26 +pkg syscall (freebsd-arm-cgo), const CTL_MAXNAME = 24 +pkg syscall (freebsd-arm-cgo), const CTL_NET = 4 +pkg syscall (freebsd-arm-cgo), const DLT_A429 = 184 +pkg syscall (freebsd-arm-cgo), const DLT_A653_ICM = 185 +pkg syscall (freebsd-arm-cgo), const DLT_AIRONET_HEADER = 120 +pkg syscall (freebsd-arm-cgo), const DLT_AOS = 222 +pkg syscall (freebsd-arm-cgo), const DLT_APPLE_IP_OVER_IEEE1394 = 138 +pkg syscall (freebsd-arm-cgo), const DLT_ARCNET = 7 +pkg syscall (freebsd-arm-cgo), const DLT_ARCNET_LINUX = 129 +pkg syscall (freebsd-arm-cgo), const DLT_ATM_CLIP = 19 +pkg syscall (freebsd-arm-cgo), const DLT_ATM_RFC1483 = 11 +pkg syscall (freebsd-arm-cgo), const DLT_AURORA = 126 +pkg syscall (freebsd-arm-cgo), const DLT_AX25 = 3 +pkg syscall (freebsd-arm-cgo), const DLT_AX25_KISS = 202 +pkg syscall (freebsd-arm-cgo), const DLT_BACNET_MS_TP = 165 +pkg syscall (freebsd-arm-cgo), const DLT_BLUETOOTH_HCI_H4 = 187 +pkg syscall (freebsd-arm-cgo), const DLT_BLUETOOTH_HCI_H4_WITH_PHDR = 201 +pkg syscall (freebsd-arm-cgo), const DLT_CAN20B = 190 +pkg syscall (freebsd-arm-cgo), const DLT_CAN_SOCKETCAN = 227 +pkg syscall (freebsd-arm-cgo), const DLT_CHAOS = 5 +pkg syscall (freebsd-arm-cgo), const DLT_CHDLC = 104 +pkg syscall (freebsd-arm-cgo), const DLT_CISCO_IOS = 118 +pkg syscall (freebsd-arm-cgo), const DLT_C_HDLC = 104 +pkg syscall (freebsd-arm-cgo), const DLT_C_HDLC_WITH_DIR = 205 +pkg syscall (freebsd-arm-cgo), const DLT_DBUS = 231 +pkg syscall (freebsd-arm-cgo), const DLT_DECT = 221 +pkg syscall (freebsd-arm-cgo), const DLT_DOCSIS = 143 +pkg syscall (freebsd-arm-cgo), const DLT_DVB_CI = 235 +pkg syscall (freebsd-arm-cgo), const DLT_ECONET = 115 +pkg syscall (freebsd-arm-cgo), const DLT_EN10MB = 1 +pkg syscall (freebsd-arm-cgo), const DLT_EN3MB = 2 +pkg syscall (freebsd-arm-cgo), const DLT_ENC = 109 +pkg syscall (freebsd-arm-cgo), const DLT_ERF = 197 +pkg syscall (freebsd-arm-cgo), const DLT_ERF_ETH = 175 +pkg syscall (freebsd-arm-cgo), const DLT_ERF_POS = 176 +pkg syscall (freebsd-arm-cgo), const DLT_FC_2 = 224 +pkg syscall (freebsd-arm-cgo), const DLT_FC_2_WITH_FRAME_DELIMS = 225 +pkg syscall (freebsd-arm-cgo), const DLT_FDDI = 10 +pkg syscall (freebsd-arm-cgo), const DLT_FLEXRAY = 210 +pkg syscall (freebsd-arm-cgo), const DLT_FRELAY = 107 +pkg syscall (freebsd-arm-cgo), const DLT_FRELAY_WITH_DIR = 206 +pkg syscall (freebsd-arm-cgo), const DLT_GCOM_SERIAL = 173 +pkg syscall (freebsd-arm-cgo), const DLT_GCOM_T1E1 = 172 +pkg syscall (freebsd-arm-cgo), const DLT_GPF_F = 171 +pkg syscall (freebsd-arm-cgo), const DLT_GPF_T = 170 +pkg syscall (freebsd-arm-cgo), const DLT_GPRS_LLC = 169 +pkg syscall (freebsd-arm-cgo), const DLT_GSMTAP_ABIS = 218 +pkg syscall (freebsd-arm-cgo), const DLT_GSMTAP_UM = 217 +pkg syscall (freebsd-arm-cgo), const DLT_HHDLC = 121 +pkg syscall (freebsd-arm-cgo), const DLT_IBM_SN = 146 +pkg syscall (freebsd-arm-cgo), const DLT_IBM_SP = 145 +pkg syscall (freebsd-arm-cgo), const DLT_IEEE802 = 6 +pkg syscall (freebsd-arm-cgo), const DLT_IEEE802_11 = 105 +pkg syscall (freebsd-arm-cgo), const DLT_IEEE802_11_RADIO = 127 +pkg syscall (freebsd-arm-cgo), const DLT_IEEE802_11_RADIO_AVS = 163 +pkg syscall (freebsd-arm-cgo), const DLT_IEEE802_15_4 = 195 +pkg syscall (freebsd-arm-cgo), const DLT_IEEE802_15_4_LINUX = 191 +pkg syscall (freebsd-arm-cgo), const DLT_IEEE802_15_4_NOFCS = 230 +pkg syscall (freebsd-arm-cgo), const DLT_IEEE802_15_4_NONASK_PHY = 215 +pkg syscall (freebsd-arm-cgo), const DLT_IEEE802_16_MAC_CPS = 188 +pkg syscall (freebsd-arm-cgo), const DLT_IEEE802_16_MAC_CPS_RADIO = 193 +pkg syscall (freebsd-arm-cgo), const DLT_IPFILTER = 116 +pkg syscall (freebsd-arm-cgo), const DLT_IPMB = 199 +pkg syscall (freebsd-arm-cgo), const DLT_IPMB_LINUX = 209 +pkg syscall (freebsd-arm-cgo), const DLT_IPNET = 226 +pkg syscall (freebsd-arm-cgo), const DLT_IPOIB = 242 +pkg syscall (freebsd-arm-cgo), const DLT_IPV4 = 228 +pkg syscall (freebsd-arm-cgo), const DLT_IPV6 = 229 +pkg syscall (freebsd-arm-cgo), const DLT_IP_OVER_FC = 122 +pkg syscall (freebsd-arm-cgo), const DLT_JUNIPER_ATM1 = 137 +pkg syscall (freebsd-arm-cgo), const DLT_JUNIPER_ATM2 = 135 +pkg syscall (freebsd-arm-cgo), const DLT_JUNIPER_ATM_CEMIC = 238 +pkg syscall (freebsd-arm-cgo), const DLT_JUNIPER_CHDLC = 181 +pkg syscall (freebsd-arm-cgo), const DLT_JUNIPER_ES = 132 +pkg syscall (freebsd-arm-cgo), const DLT_JUNIPER_ETHER = 178 +pkg syscall (freebsd-arm-cgo), const DLT_JUNIPER_FIBRECHANNEL = 234 +pkg syscall (freebsd-arm-cgo), const DLT_JUNIPER_FRELAY = 180 +pkg syscall (freebsd-arm-cgo), const DLT_JUNIPER_GGSN = 133 +pkg syscall (freebsd-arm-cgo), const DLT_JUNIPER_ISM = 194 +pkg syscall (freebsd-arm-cgo), const DLT_JUNIPER_MFR = 134 +pkg syscall (freebsd-arm-cgo), const DLT_JUNIPER_MLFR = 131 +pkg syscall (freebsd-arm-cgo), const DLT_JUNIPER_MLPPP = 130 +pkg syscall (freebsd-arm-cgo), const DLT_JUNIPER_MONITOR = 164 +pkg syscall (freebsd-arm-cgo), const DLT_JUNIPER_PIC_PEER = 174 +pkg syscall (freebsd-arm-cgo), const DLT_JUNIPER_PPP = 179 +pkg syscall (freebsd-arm-cgo), const DLT_JUNIPER_PPPOE = 167 +pkg syscall (freebsd-arm-cgo), const DLT_JUNIPER_PPPOE_ATM = 168 +pkg syscall (freebsd-arm-cgo), const DLT_JUNIPER_SERVICES = 136 +pkg syscall (freebsd-arm-cgo), const DLT_JUNIPER_SRX_E2E = 233 +pkg syscall (freebsd-arm-cgo), const DLT_JUNIPER_ST = 200 +pkg syscall (freebsd-arm-cgo), const DLT_JUNIPER_VP = 183 +pkg syscall (freebsd-arm-cgo), const DLT_JUNIPER_VS = 232 +pkg syscall (freebsd-arm-cgo), const DLT_LAPB_WITH_DIR = 207 +pkg syscall (freebsd-arm-cgo), const DLT_LAPD = 203 +pkg syscall (freebsd-arm-cgo), const DLT_LIN = 212 +pkg syscall (freebsd-arm-cgo), const DLT_LINUX_EVDEV = 216 +pkg syscall (freebsd-arm-cgo), const DLT_LINUX_IRDA = 144 +pkg syscall (freebsd-arm-cgo), const DLT_LINUX_LAPD = 177 +pkg syscall (freebsd-arm-cgo), const DLT_LINUX_PPP_WITHDIRECTION = 166 +pkg syscall (freebsd-arm-cgo), const DLT_LINUX_SLL = 113 +pkg syscall (freebsd-arm-cgo), const DLT_LOOP = 108 +pkg syscall (freebsd-arm-cgo), const DLT_LTALK = 114 +pkg syscall (freebsd-arm-cgo), const DLT_MATCHING_MAX = 246 +pkg syscall (freebsd-arm-cgo), const DLT_MATCHING_MIN = 104 +pkg syscall (freebsd-arm-cgo), const DLT_MFR = 182 +pkg syscall (freebsd-arm-cgo), const DLT_MOST = 211 +pkg syscall (freebsd-arm-cgo), const DLT_MPEG_2_TS = 243 +pkg syscall (freebsd-arm-cgo), const DLT_MPLS = 219 +pkg syscall (freebsd-arm-cgo), const DLT_MTP2 = 140 +pkg syscall (freebsd-arm-cgo), const DLT_MTP2_WITH_PHDR = 139 +pkg syscall (freebsd-arm-cgo), const DLT_MTP3 = 141 +pkg syscall (freebsd-arm-cgo), const DLT_MUX27010 = 236 +pkg syscall (freebsd-arm-cgo), const DLT_NETANALYZER = 240 +pkg syscall (freebsd-arm-cgo), const DLT_NETANALYZER_TRANSPARENT = 241 +pkg syscall (freebsd-arm-cgo), const DLT_NFC_LLCP = 245 +pkg syscall (freebsd-arm-cgo), const DLT_NFLOG = 239 +pkg syscall (freebsd-arm-cgo), const DLT_NG40 = 244 +pkg syscall (freebsd-arm-cgo), const DLT_NULL = 0 +pkg syscall (freebsd-arm-cgo), const DLT_PCI_EXP = 125 +pkg syscall (freebsd-arm-cgo), const DLT_PFLOG = 117 +pkg syscall (freebsd-arm-cgo), const DLT_PFSYNC = 121 +pkg syscall (freebsd-arm-cgo), const DLT_PPI = 192 +pkg syscall (freebsd-arm-cgo), const DLT_PPP = 9 +pkg syscall (freebsd-arm-cgo), const DLT_PPP_BSDOS = 16 +pkg syscall (freebsd-arm-cgo), const DLT_PPP_ETHER = 51 +pkg syscall (freebsd-arm-cgo), const DLT_PPP_PPPD = 166 +pkg syscall (freebsd-arm-cgo), const DLT_PPP_SERIAL = 50 +pkg syscall (freebsd-arm-cgo), const DLT_PPP_WITH_DIR = 204 +pkg syscall (freebsd-arm-cgo), const DLT_PPP_WITH_DIRECTION = 166 +pkg syscall (freebsd-arm-cgo), const DLT_PRISM_HEADER = 119 +pkg syscall (freebsd-arm-cgo), const DLT_PRONET = 4 +pkg syscall (freebsd-arm-cgo), const DLT_RAIF1 = 198 +pkg syscall (freebsd-arm-cgo), const DLT_RAW = 12 +pkg syscall (freebsd-arm-cgo), const DLT_RIO = 124 +pkg syscall (freebsd-arm-cgo), const DLT_SCCP = 142 +pkg syscall (freebsd-arm-cgo), const DLT_SITA = 196 +pkg syscall (freebsd-arm-cgo), const DLT_SLIP = 8 +pkg syscall (freebsd-arm-cgo), const DLT_SLIP_BSDOS = 15 +pkg syscall (freebsd-arm-cgo), const DLT_STANAG_5066_D_PDU = 237 +pkg syscall (freebsd-arm-cgo), const DLT_SUNATM = 123 +pkg syscall (freebsd-arm-cgo), const DLT_SYMANTEC_FIREWALL = 99 +pkg syscall (freebsd-arm-cgo), const DLT_TZSP = 128 +pkg syscall (freebsd-arm-cgo), const DLT_USB = 186 +pkg syscall (freebsd-arm-cgo), const DLT_USB_LINUX = 189 +pkg syscall (freebsd-arm-cgo), const DLT_USB_LINUX_MMAPPED = 220 +pkg syscall (freebsd-arm-cgo), const DLT_USER0 = 147 +pkg syscall (freebsd-arm-cgo), const DLT_USER1 = 148 +pkg syscall (freebsd-arm-cgo), const DLT_USER10 = 157 +pkg syscall (freebsd-arm-cgo), const DLT_USER11 = 158 +pkg syscall (freebsd-arm-cgo), const DLT_USER12 = 159 +pkg syscall (freebsd-arm-cgo), const DLT_USER13 = 160 +pkg syscall (freebsd-arm-cgo), const DLT_USER14 = 161 +pkg syscall (freebsd-arm-cgo), const DLT_USER15 = 162 +pkg syscall (freebsd-arm-cgo), const DLT_USER2 = 149 +pkg syscall (freebsd-arm-cgo), const DLT_USER3 = 150 +pkg syscall (freebsd-arm-cgo), const DLT_USER4 = 151 +pkg syscall (freebsd-arm-cgo), const DLT_USER5 = 152 +pkg syscall (freebsd-arm-cgo), const DLT_USER6 = 153 +pkg syscall (freebsd-arm-cgo), const DLT_USER7 = 154 +pkg syscall (freebsd-arm-cgo), const DLT_USER8 = 155 +pkg syscall (freebsd-arm-cgo), const DLT_USER9 = 156 +pkg syscall (freebsd-arm-cgo), const DLT_WIHART = 223 +pkg syscall (freebsd-arm-cgo), const DLT_X2E_SERIAL = 213 +pkg syscall (freebsd-arm-cgo), const DLT_X2E_XORAYA = 214 +pkg syscall (freebsd-arm-cgo), const DT_BLK = 6 +pkg syscall (freebsd-arm-cgo), const DT_CHR = 2 +pkg syscall (freebsd-arm-cgo), const DT_DIR = 4 +pkg syscall (freebsd-arm-cgo), const DT_FIFO = 1 +pkg syscall (freebsd-arm-cgo), const DT_LNK = 10 +pkg syscall (freebsd-arm-cgo), const DT_REG = 8 +pkg syscall (freebsd-arm-cgo), const DT_SOCK = 12 +pkg syscall (freebsd-arm-cgo), const DT_UNKNOWN = 0 +pkg syscall (freebsd-arm-cgo), const DT_WHT = 14 +pkg syscall (freebsd-arm-cgo), const E2BIG = 7 +pkg syscall (freebsd-arm-cgo), const EACCES = 13 +pkg syscall (freebsd-arm-cgo), const EADDRINUSE = 48 +pkg syscall (freebsd-arm-cgo), const EADDRNOTAVAIL = 49 +pkg syscall (freebsd-arm-cgo), const EAFNOSUPPORT = 47 +pkg syscall (freebsd-arm-cgo), const EAGAIN = 35 +pkg syscall (freebsd-arm-cgo), const EALREADY = 37 +pkg syscall (freebsd-arm-cgo), const EAUTH = 80 +pkg syscall (freebsd-arm-cgo), const EBADF = 9 +pkg syscall (freebsd-arm-cgo), const EBADMSG = 89 +pkg syscall (freebsd-arm-cgo), const EBADRPC = 72 +pkg syscall (freebsd-arm-cgo), const EBUSY = 16 +pkg syscall (freebsd-arm-cgo), const ECANCELED = 85 +pkg syscall (freebsd-arm-cgo), const ECAPMODE = 94 +pkg syscall (freebsd-arm-cgo), const ECHILD = 10 +pkg syscall (freebsd-arm-cgo), const ECHO = 8 +pkg syscall (freebsd-arm-cgo), const ECHOCTL = 64 +pkg syscall (freebsd-arm-cgo), const ECHOE = 2 +pkg syscall (freebsd-arm-cgo), const ECHOK = 4 +pkg syscall (freebsd-arm-cgo), const ECHOKE = 1 +pkg syscall (freebsd-arm-cgo), const ECHONL = 16 +pkg syscall (freebsd-arm-cgo), const ECHOPRT = 32 +pkg syscall (freebsd-arm-cgo), const ECONNABORTED = 53 +pkg syscall (freebsd-arm-cgo), const ECONNREFUSED = 61 +pkg syscall (freebsd-arm-cgo), const ECONNRESET = 54 +pkg syscall (freebsd-arm-cgo), const EDEADLK = 11 +pkg syscall (freebsd-arm-cgo), const EDESTADDRREQ = 39 +pkg syscall (freebsd-arm-cgo), const EDOM = 33 +pkg syscall (freebsd-arm-cgo), const EDOOFUS = 88 +pkg syscall (freebsd-arm-cgo), const EDQUOT = 69 +pkg syscall (freebsd-arm-cgo), const EEXIST = 17 +pkg syscall (freebsd-arm-cgo), const EFAULT = 14 +pkg syscall (freebsd-arm-cgo), const EFBIG = 27 +pkg syscall (freebsd-arm-cgo), const EFTYPE = 79 +pkg syscall (freebsd-arm-cgo), const EHOSTDOWN = 64 +pkg syscall (freebsd-arm-cgo), const EHOSTUNREACH = 65 +pkg syscall (freebsd-arm-cgo), const EIDRM = 82 +pkg syscall (freebsd-arm-cgo), const EILSEQ = 86 +pkg syscall (freebsd-arm-cgo), const EINPROGRESS = 36 +pkg syscall (freebsd-arm-cgo), const EINTR = 4 +pkg syscall (freebsd-arm-cgo), const EINVAL = 22 +pkg syscall (freebsd-arm-cgo), const EIO = 5 +pkg syscall (freebsd-arm-cgo), const EISCONN = 56 +pkg syscall (freebsd-arm-cgo), const EISDIR = 21 +pkg syscall (freebsd-arm-cgo), const ELAST = 94 +pkg syscall (freebsd-arm-cgo), const ELOOP = 62 +pkg syscall (freebsd-arm-cgo), const EMFILE = 24 +pkg syscall (freebsd-arm-cgo), const EMLINK = 31 +pkg syscall (freebsd-arm-cgo), const EMSGSIZE = 40 +pkg syscall (freebsd-arm-cgo), const EMULTIHOP = 90 +pkg syscall (freebsd-arm-cgo), const ENAMETOOLONG = 63 +pkg syscall (freebsd-arm-cgo), const ENEEDAUTH = 81 +pkg syscall (freebsd-arm-cgo), const ENETDOWN = 50 +pkg syscall (freebsd-arm-cgo), const ENETRESET = 52 +pkg syscall (freebsd-arm-cgo), const ENETUNREACH = 51 +pkg syscall (freebsd-arm-cgo), const ENFILE = 23 +pkg syscall (freebsd-arm-cgo), const ENOATTR = 87 +pkg syscall (freebsd-arm-cgo), const ENOBUFS = 55 +pkg syscall (freebsd-arm-cgo), const ENODEV = 19 +pkg syscall (freebsd-arm-cgo), const ENOEXEC = 8 +pkg syscall (freebsd-arm-cgo), const ENOLCK = 77 +pkg syscall (freebsd-arm-cgo), const ENOLINK = 91 +pkg syscall (freebsd-arm-cgo), const ENOMEM = 12 +pkg syscall (freebsd-arm-cgo), const ENOMSG = 83 +pkg syscall (freebsd-arm-cgo), const ENOPROTOOPT = 42 +pkg syscall (freebsd-arm-cgo), const ENOSPC = 28 +pkg syscall (freebsd-arm-cgo), const ENOSYS = 78 +pkg syscall (freebsd-arm-cgo), const ENOTBLK = 15 +pkg syscall (freebsd-arm-cgo), const ENOTCAPABLE = 93 +pkg syscall (freebsd-arm-cgo), const ENOTCONN = 57 +pkg syscall (freebsd-arm-cgo), const ENOTDIR = 20 +pkg syscall (freebsd-arm-cgo), const ENOTEMPTY = 66 +pkg syscall (freebsd-arm-cgo), const ENOTSOCK = 38 +pkg syscall (freebsd-arm-cgo), const ENOTSUP = 45 +pkg syscall (freebsd-arm-cgo), const ENOTTY = 25 +pkg syscall (freebsd-arm-cgo), const ENXIO = 6 +pkg syscall (freebsd-arm-cgo), const EOPNOTSUPP = 45 +pkg syscall (freebsd-arm-cgo), const EOVERFLOW = 84 +pkg syscall (freebsd-arm-cgo), const EPERM = 1 +pkg syscall (freebsd-arm-cgo), const EPFNOSUPPORT = 46 +pkg syscall (freebsd-arm-cgo), const EPIPE = 32 +pkg syscall (freebsd-arm-cgo), const EPROCLIM = 67 +pkg syscall (freebsd-arm-cgo), const EPROCUNAVAIL = 76 +pkg syscall (freebsd-arm-cgo), const EPROGMISMATCH = 75 +pkg syscall (freebsd-arm-cgo), const EPROGUNAVAIL = 74 +pkg syscall (freebsd-arm-cgo), const EPROTO = 92 +pkg syscall (freebsd-arm-cgo), const EPROTONOSUPPORT = 43 +pkg syscall (freebsd-arm-cgo), const EPROTOTYPE = 41 +pkg syscall (freebsd-arm-cgo), const ERANGE = 34 +pkg syscall (freebsd-arm-cgo), const EREMOTE = 71 +pkg syscall (freebsd-arm-cgo), const EROFS = 30 +pkg syscall (freebsd-arm-cgo), const ERPCMISMATCH = 73 +pkg syscall (freebsd-arm-cgo), const ESHUTDOWN = 58 +pkg syscall (freebsd-arm-cgo), const ESOCKTNOSUPPORT = 44 +pkg syscall (freebsd-arm-cgo), const ESPIPE = 29 +pkg syscall (freebsd-arm-cgo), const ESRCH = 3 +pkg syscall (freebsd-arm-cgo), const ESTALE = 70 +pkg syscall (freebsd-arm-cgo), const ETIMEDOUT = 60 +pkg syscall (freebsd-arm-cgo), const ETOOMANYREFS = 59 +pkg syscall (freebsd-arm-cgo), const ETXTBSY = 26 +pkg syscall (freebsd-arm-cgo), const EUSERS = 68 +pkg syscall (freebsd-arm-cgo), const EVFILT_AIO = -3 +pkg syscall (freebsd-arm-cgo), const EVFILT_FS = -9 +pkg syscall (freebsd-arm-cgo), const EVFILT_LIO = -10 +pkg syscall (freebsd-arm-cgo), const EVFILT_PROC = -5 +pkg syscall (freebsd-arm-cgo), const EVFILT_READ = -1 +pkg syscall (freebsd-arm-cgo), const EVFILT_SIGNAL = -6 +pkg syscall (freebsd-arm-cgo), const EVFILT_SYSCOUNT = 11 +pkg syscall (freebsd-arm-cgo), const EVFILT_TIMER = -7 +pkg syscall (freebsd-arm-cgo), const EVFILT_USER = -11 +pkg syscall (freebsd-arm-cgo), const EVFILT_VNODE = -4 +pkg syscall (freebsd-arm-cgo), const EVFILT_WRITE = -2 +pkg syscall (freebsd-arm-cgo), const EV_ADD = 1 +pkg syscall (freebsd-arm-cgo), const EV_CLEAR = 32 +pkg syscall (freebsd-arm-cgo), const EV_DELETE = 2 +pkg syscall (freebsd-arm-cgo), const EV_DISABLE = 8 +pkg syscall (freebsd-arm-cgo), const EV_DISPATCH = 128 +pkg syscall (freebsd-arm-cgo), const EV_ENABLE = 4 +pkg syscall (freebsd-arm-cgo), const EV_EOF = 32768 +pkg syscall (freebsd-arm-cgo), const EV_ERROR = 16384 +pkg syscall (freebsd-arm-cgo), const EV_FLAG1 = 8192 +pkg syscall (freebsd-arm-cgo), const EV_ONESHOT = 16 +pkg syscall (freebsd-arm-cgo), const EV_RECEIPT = 64 +pkg syscall (freebsd-arm-cgo), const EV_SYSFLAGS = 61440 +pkg syscall (freebsd-arm-cgo), const EWOULDBLOCK = 35 +pkg syscall (freebsd-arm-cgo), const EXDEV = 18 +pkg syscall (freebsd-arm-cgo), const EXTA = 19200 +pkg syscall (freebsd-arm-cgo), const EXTB = 38400 +pkg syscall (freebsd-arm-cgo), const EXTPROC = 2048 +pkg syscall (freebsd-arm-cgo), const FD_CLOEXEC = 1 +pkg syscall (freebsd-arm-cgo), const FD_SETSIZE = 1024 +pkg syscall (freebsd-arm-cgo), const FLUSHO = 8388608 +pkg syscall (freebsd-arm-cgo), const F_CANCEL = 5 +pkg syscall (freebsd-arm-cgo), const F_DUP2FD = 10 +pkg syscall (freebsd-arm-cgo), const F_DUP2FD_CLOEXEC = 18 +pkg syscall (freebsd-arm-cgo), const F_DUPFD = 0 +pkg syscall (freebsd-arm-cgo), const F_DUPFD_CLOEXEC = 17 +pkg syscall (freebsd-arm-cgo), const F_GETFD = 1 +pkg syscall (freebsd-arm-cgo), const F_GETFL = 3 +pkg syscall (freebsd-arm-cgo), const F_GETLK = 11 +pkg syscall (freebsd-arm-cgo), const F_GETOWN = 5 +pkg syscall (freebsd-arm-cgo), const F_OGETLK = 7 +pkg syscall (freebsd-arm-cgo), const F_OK = 0 +pkg syscall (freebsd-arm-cgo), const F_OSETLK = 8 +pkg syscall (freebsd-arm-cgo), const F_OSETLKW = 9 +pkg syscall (freebsd-arm-cgo), const F_RDAHEAD = 16 +pkg syscall (freebsd-arm-cgo), const F_RDLCK = 1 +pkg syscall (freebsd-arm-cgo), const F_READAHEAD = 15 +pkg syscall (freebsd-arm-cgo), const F_SETFD = 2 +pkg syscall (freebsd-arm-cgo), const F_SETFL = 4 +pkg syscall (freebsd-arm-cgo), const F_SETLK = 12 +pkg syscall (freebsd-arm-cgo), const F_SETLKW = 13 +pkg syscall (freebsd-arm-cgo), const F_SETLK_REMOTE = 14 +pkg syscall (freebsd-arm-cgo), const F_SETOWN = 6 +pkg syscall (freebsd-arm-cgo), const F_UNLCK = 2 +pkg syscall (freebsd-arm-cgo), const F_UNLCKSYS = 4 +pkg syscall (freebsd-arm-cgo), const F_WRLCK = 3 +pkg syscall (freebsd-arm-cgo), const HUPCL = 16384 +pkg syscall (freebsd-arm-cgo), const ICANON = 256 +pkg syscall (freebsd-arm-cgo), const ICRNL = 256 +pkg syscall (freebsd-arm-cgo), const IEXTEN = 1024 +pkg syscall (freebsd-arm-cgo), const IFAN_ARRIVAL = 0 +pkg syscall (freebsd-arm-cgo), const IFAN_DEPARTURE = 1 +pkg syscall (freebsd-arm-cgo), const IFF_ALLMULTI = 512 +pkg syscall (freebsd-arm-cgo), const IFF_ALTPHYS = 16384 +pkg syscall (freebsd-arm-cgo), const IFF_CANTCHANGE = 2199410 +pkg syscall (freebsd-arm-cgo), const IFF_CANTCONFIG = 65536 +pkg syscall (freebsd-arm-cgo), const IFF_DEBUG = 4 +pkg syscall (freebsd-arm-cgo), const IFF_DRV_OACTIVE = 1024 +pkg syscall (freebsd-arm-cgo), const IFF_DRV_RUNNING = 64 +pkg syscall (freebsd-arm-cgo), const IFF_DYING = 2097152 +pkg syscall (freebsd-arm-cgo), const IFF_LINK0 = 4096 +pkg syscall (freebsd-arm-cgo), const IFF_LINK1 = 8192 +pkg syscall (freebsd-arm-cgo), const IFF_LINK2 = 16384 +pkg syscall (freebsd-arm-cgo), const IFF_LOOPBACK = 8 +pkg syscall (freebsd-arm-cgo), const IFF_MONITOR = 262144 +pkg syscall (freebsd-arm-cgo), const IFF_MULTICAST = 32768 +pkg syscall (freebsd-arm-cgo), const IFF_NOARP = 128 +pkg syscall (freebsd-arm-cgo), const IFF_OACTIVE = 1024 +pkg syscall (freebsd-arm-cgo), const IFF_POINTOPOINT = 16 +pkg syscall (freebsd-arm-cgo), const IFF_PPROMISC = 131072 +pkg syscall (freebsd-arm-cgo), const IFF_PROMISC = 256 +pkg syscall (freebsd-arm-cgo), const IFF_RENAMING = 4194304 +pkg syscall (freebsd-arm-cgo), const IFF_RUNNING = 64 +pkg syscall (freebsd-arm-cgo), const IFF_SIMPLEX = 2048 +pkg syscall (freebsd-arm-cgo), const IFF_SMART = 32 +pkg syscall (freebsd-arm-cgo), const IFF_STATICARP = 524288 +pkg syscall (freebsd-arm-cgo), const IFNAMSIZ = 16 +pkg syscall (freebsd-arm-cgo), const IFT_1822 = 2 +pkg syscall (freebsd-arm-cgo), const IFT_A12MPPSWITCH = 130 +pkg syscall (freebsd-arm-cgo), const IFT_AAL2 = 187 +pkg syscall (freebsd-arm-cgo), const IFT_AAL5 = 49 +pkg syscall (freebsd-arm-cgo), const IFT_ADSL = 94 +pkg syscall (freebsd-arm-cgo), const IFT_AFLANE8023 = 59 +pkg syscall (freebsd-arm-cgo), const IFT_AFLANE8025 = 60 +pkg syscall (freebsd-arm-cgo), const IFT_ARAP = 88 +pkg syscall (freebsd-arm-cgo), const IFT_ARCNET = 35 +pkg syscall (freebsd-arm-cgo), const IFT_ARCNETPLUS = 36 +pkg syscall (freebsd-arm-cgo), const IFT_ASYNC = 84 +pkg syscall (freebsd-arm-cgo), const IFT_ATM = 37 +pkg syscall (freebsd-arm-cgo), const IFT_ATMDXI = 105 +pkg syscall (freebsd-arm-cgo), const IFT_ATMFUNI = 106 +pkg syscall (freebsd-arm-cgo), const IFT_ATMIMA = 107 +pkg syscall (freebsd-arm-cgo), const IFT_ATMLOGICAL = 80 +pkg syscall (freebsd-arm-cgo), const IFT_ATMRADIO = 189 +pkg syscall (freebsd-arm-cgo), const IFT_ATMSUBINTERFACE = 134 +pkg syscall (freebsd-arm-cgo), const IFT_ATMVCIENDPT = 194 +pkg syscall (freebsd-arm-cgo), const IFT_ATMVIRTUAL = 149 +pkg syscall (freebsd-arm-cgo), const IFT_BGPPOLICYACCOUNTING = 162 +pkg syscall (freebsd-arm-cgo), const IFT_BRIDGE = 209 +pkg syscall (freebsd-arm-cgo), const IFT_BSC = 83 +pkg syscall (freebsd-arm-cgo), const IFT_CCTEMUL = 61 +pkg syscall (freebsd-arm-cgo), const IFT_CEPT = 19 +pkg syscall (freebsd-arm-cgo), const IFT_CES = 133 +pkg syscall (freebsd-arm-cgo), const IFT_CHANNEL = 70 +pkg syscall (freebsd-arm-cgo), const IFT_CNR = 85 +pkg syscall (freebsd-arm-cgo), const IFT_COFFEE = 132 +pkg syscall (freebsd-arm-cgo), const IFT_COMPOSITELINK = 155 +pkg syscall (freebsd-arm-cgo), const IFT_DCN = 141 +pkg syscall (freebsd-arm-cgo), const IFT_DIGITALPOWERLINE = 138 +pkg syscall (freebsd-arm-cgo), const IFT_DIGITALWRAPPEROVERHEADCHANNEL = 186 +pkg syscall (freebsd-arm-cgo), const IFT_DLSW = 74 +pkg syscall (freebsd-arm-cgo), const IFT_DOCSCABLEDOWNSTREAM = 128 +pkg syscall (freebsd-arm-cgo), const IFT_DOCSCABLEMACLAYER = 127 +pkg syscall (freebsd-arm-cgo), const IFT_DOCSCABLEUPSTREAM = 129 +pkg syscall (freebsd-arm-cgo), const IFT_DS0 = 81 +pkg syscall (freebsd-arm-cgo), const IFT_DS0BUNDLE = 82 +pkg syscall (freebsd-arm-cgo), const IFT_DS1FDL = 170 +pkg syscall (freebsd-arm-cgo), const IFT_DS3 = 30 +pkg syscall (freebsd-arm-cgo), const IFT_DTM = 140 +pkg syscall (freebsd-arm-cgo), const IFT_DVBASILN = 172 +pkg syscall (freebsd-arm-cgo), const IFT_DVBASIOUT = 173 +pkg syscall (freebsd-arm-cgo), const IFT_DVBRCCDOWNSTREAM = 147 +pkg syscall (freebsd-arm-cgo), const IFT_DVBRCCMACLAYER = 146 +pkg syscall (freebsd-arm-cgo), const IFT_DVBRCCUPSTREAM = 148 +pkg syscall (freebsd-arm-cgo), const IFT_ENC = 244 +pkg syscall (freebsd-arm-cgo), const IFT_EON = 25 +pkg syscall (freebsd-arm-cgo), const IFT_EPLRS = 87 +pkg syscall (freebsd-arm-cgo), const IFT_ESCON = 73 +pkg syscall (freebsd-arm-cgo), const IFT_ETHER = 6 +pkg syscall (freebsd-arm-cgo), const IFT_FAITH = 242 +pkg syscall (freebsd-arm-cgo), const IFT_FAST = 125 +pkg syscall (freebsd-arm-cgo), const IFT_FASTETHER = 62 +pkg syscall (freebsd-arm-cgo), const IFT_FASTETHERFX = 69 +pkg syscall (freebsd-arm-cgo), const IFT_FDDI = 15 +pkg syscall (freebsd-arm-cgo), const IFT_FIBRECHANNEL = 56 +pkg syscall (freebsd-arm-cgo), const IFT_FRAMERELAYINTERCONNECT = 58 +pkg syscall (freebsd-arm-cgo), const IFT_FRAMERELAYMPI = 92 +pkg syscall (freebsd-arm-cgo), const IFT_FRDLCIENDPT = 193 +pkg syscall (freebsd-arm-cgo), const IFT_FRELAY = 32 +pkg syscall (freebsd-arm-cgo), const IFT_FRELAYDCE = 44 +pkg syscall (freebsd-arm-cgo), const IFT_FRF16MFRBUNDLE = 163 +pkg syscall (freebsd-arm-cgo), const IFT_FRFORWARD = 158 +pkg syscall (freebsd-arm-cgo), const IFT_G703AT2MB = 67 +pkg syscall (freebsd-arm-cgo), const IFT_G703AT64K = 66 +pkg syscall (freebsd-arm-cgo), const IFT_GIF = 240 +pkg syscall (freebsd-arm-cgo), const IFT_GIGABITETHERNET = 117 +pkg syscall (freebsd-arm-cgo), const IFT_GR303IDT = 178 +pkg syscall (freebsd-arm-cgo), const IFT_GR303RDT = 177 +pkg syscall (freebsd-arm-cgo), const IFT_H323GATEKEEPER = 164 +pkg syscall (freebsd-arm-cgo), const IFT_H323PROXY = 165 +pkg syscall (freebsd-arm-cgo), const IFT_HDH1822 = 3 +pkg syscall (freebsd-arm-cgo), const IFT_HDLC = 118 +pkg syscall (freebsd-arm-cgo), const IFT_HDSL2 = 168 +pkg syscall (freebsd-arm-cgo), const IFT_HIPERLAN2 = 183 +pkg syscall (freebsd-arm-cgo), const IFT_HIPPI = 47 +pkg syscall (freebsd-arm-cgo), const IFT_HIPPIINTERFACE = 57 +pkg syscall (freebsd-arm-cgo), const IFT_HOSTPAD = 90 +pkg syscall (freebsd-arm-cgo), const IFT_HSSI = 46 +pkg syscall (freebsd-arm-cgo), const IFT_HY = 14 +pkg syscall (freebsd-arm-cgo), const IFT_IBM370PARCHAN = 72 +pkg syscall (freebsd-arm-cgo), const IFT_IDSL = 154 +pkg syscall (freebsd-arm-cgo), const IFT_IEEE1394 = 144 +pkg syscall (freebsd-arm-cgo), const IFT_IEEE80211 = 71 +pkg syscall (freebsd-arm-cgo), const IFT_IEEE80212 = 55 +pkg syscall (freebsd-arm-cgo), const IFT_IEEE8023ADLAG = 161 +pkg syscall (freebsd-arm-cgo), const IFT_IFGSN = 145 +pkg syscall (freebsd-arm-cgo), const IFT_IMT = 190 +pkg syscall (freebsd-arm-cgo), const IFT_INFINIBAND = 199 +pkg syscall (freebsd-arm-cgo), const IFT_INTERLEAVE = 124 +pkg syscall (freebsd-arm-cgo), const IFT_IP = 126 +pkg syscall (freebsd-arm-cgo), const IFT_IPFORWARD = 142 +pkg syscall (freebsd-arm-cgo), const IFT_IPOVERATM = 114 +pkg syscall (freebsd-arm-cgo), const IFT_IPOVERCDLC = 109 +pkg syscall (freebsd-arm-cgo), const IFT_IPOVERCLAW = 110 +pkg syscall (freebsd-arm-cgo), const IFT_IPSWITCH = 78 +pkg syscall (freebsd-arm-cgo), const IFT_IPXIP = 249 +pkg syscall (freebsd-arm-cgo), const IFT_ISDN = 63 +pkg syscall (freebsd-arm-cgo), const IFT_ISDNBASIC = 20 +pkg syscall (freebsd-arm-cgo), const IFT_ISDNPRIMARY = 21 +pkg syscall (freebsd-arm-cgo), const IFT_ISDNS = 75 +pkg syscall (freebsd-arm-cgo), const IFT_ISDNU = 76 +pkg syscall (freebsd-arm-cgo), const IFT_ISO88022LLC = 41 +pkg syscall (freebsd-arm-cgo), const IFT_ISO88023 = 7 +pkg syscall (freebsd-arm-cgo), const IFT_ISO88024 = 8 +pkg syscall (freebsd-arm-cgo), const IFT_ISO88025 = 9 +pkg syscall (freebsd-arm-cgo), const IFT_ISO88025CRFPINT = 98 +pkg syscall (freebsd-arm-cgo), const IFT_ISO88025DTR = 86 +pkg syscall (freebsd-arm-cgo), const IFT_ISO88025FIBER = 115 +pkg syscall (freebsd-arm-cgo), const IFT_ISO88026 = 10 +pkg syscall (freebsd-arm-cgo), const IFT_ISUP = 179 +pkg syscall (freebsd-arm-cgo), const IFT_L2VLAN = 135 +pkg syscall (freebsd-arm-cgo), const IFT_L3IPVLAN = 136 +pkg syscall (freebsd-arm-cgo), const IFT_L3IPXVLAN = 137 +pkg syscall (freebsd-arm-cgo), const IFT_LAPB = 16 +pkg syscall (freebsd-arm-cgo), const IFT_LAPD = 77 +pkg syscall (freebsd-arm-cgo), const IFT_LAPF = 119 +pkg syscall (freebsd-arm-cgo), const IFT_LOCALTALK = 42 +pkg syscall (freebsd-arm-cgo), const IFT_LOOP = 24 +pkg syscall (freebsd-arm-cgo), const IFT_MEDIAMAILOVERIP = 139 +pkg syscall (freebsd-arm-cgo), const IFT_MFSIGLINK = 167 +pkg syscall (freebsd-arm-cgo), const IFT_MIOX25 = 38 +pkg syscall (freebsd-arm-cgo), const IFT_MODEM = 48 +pkg syscall (freebsd-arm-cgo), const IFT_MPC = 113 +pkg syscall (freebsd-arm-cgo), const IFT_MPLS = 166 +pkg syscall (freebsd-arm-cgo), const IFT_MPLSTUNNEL = 150 +pkg syscall (freebsd-arm-cgo), const IFT_MSDSL = 143 +pkg syscall (freebsd-arm-cgo), const IFT_MVL = 191 +pkg syscall (freebsd-arm-cgo), const IFT_MYRINET = 99 +pkg syscall (freebsd-arm-cgo), const IFT_NFAS = 175 +pkg syscall (freebsd-arm-cgo), const IFT_NSIP = 27 +pkg syscall (freebsd-arm-cgo), const IFT_OPTICALCHANNEL = 195 +pkg syscall (freebsd-arm-cgo), const IFT_OPTICALTRANSPORT = 196 +pkg syscall (freebsd-arm-cgo), const IFT_OTHER = 1 +pkg syscall (freebsd-arm-cgo), const IFT_P10 = 12 +pkg syscall (freebsd-arm-cgo), const IFT_P80 = 13 +pkg syscall (freebsd-arm-cgo), const IFT_PARA = 34 +pkg syscall (freebsd-arm-cgo), const IFT_PFLOG = 246 +pkg syscall (freebsd-arm-cgo), const IFT_PFSYNC = 247 +pkg syscall (freebsd-arm-cgo), const IFT_PLC = 174 +pkg syscall (freebsd-arm-cgo), const IFT_POS = 171 +pkg syscall (freebsd-arm-cgo), const IFT_PPP = 23 +pkg syscall (freebsd-arm-cgo), const IFT_PPPMULTILINKBUNDLE = 108 +pkg syscall (freebsd-arm-cgo), const IFT_PROPBWAP2MP = 184 +pkg syscall (freebsd-arm-cgo), const IFT_PROPCNLS = 89 +pkg syscall (freebsd-arm-cgo), const IFT_PROPDOCSWIRELESSDOWNSTREAM = 181 +pkg syscall (freebsd-arm-cgo), const IFT_PROPDOCSWIRELESSMACLAYER = 180 +pkg syscall (freebsd-arm-cgo), const IFT_PROPDOCSWIRELESSUPSTREAM = 182 +pkg syscall (freebsd-arm-cgo), const IFT_PROPMUX = 54 +pkg syscall (freebsd-arm-cgo), const IFT_PROPVIRTUAL = 53 +pkg syscall (freebsd-arm-cgo), const IFT_PROPWIRELESSP2P = 157 +pkg syscall (freebsd-arm-cgo), const IFT_PTPSERIAL = 22 +pkg syscall (freebsd-arm-cgo), const IFT_PVC = 241 +pkg syscall (freebsd-arm-cgo), const IFT_QLLC = 68 +pkg syscall (freebsd-arm-cgo), const IFT_RADIOMAC = 188 +pkg syscall (freebsd-arm-cgo), const IFT_RADSL = 95 +pkg syscall (freebsd-arm-cgo), const IFT_REACHDSL = 192 +pkg syscall (freebsd-arm-cgo), const IFT_RFC1483 = 159 +pkg syscall (freebsd-arm-cgo), const IFT_RS232 = 33 +pkg syscall (freebsd-arm-cgo), const IFT_RSRB = 79 +pkg syscall (freebsd-arm-cgo), const IFT_SDLC = 17 +pkg syscall (freebsd-arm-cgo), const IFT_SDSL = 96 +pkg syscall (freebsd-arm-cgo), const IFT_SHDSL = 169 +pkg syscall (freebsd-arm-cgo), const IFT_SIP = 31 +pkg syscall (freebsd-arm-cgo), const IFT_SLIP = 28 +pkg syscall (freebsd-arm-cgo), const IFT_SMDSDXI = 43 +pkg syscall (freebsd-arm-cgo), const IFT_SMDSICIP = 52 +pkg syscall (freebsd-arm-cgo), const IFT_SONET = 39 +pkg syscall (freebsd-arm-cgo), const IFT_SONETOVERHEADCHANNEL = 185 +pkg syscall (freebsd-arm-cgo), const IFT_SONETPATH = 50 +pkg syscall (freebsd-arm-cgo), const IFT_SONETVT = 51 +pkg syscall (freebsd-arm-cgo), const IFT_SRP = 151 +pkg syscall (freebsd-arm-cgo), const IFT_SS7SIGLINK = 156 +pkg syscall (freebsd-arm-cgo), const IFT_STACKTOSTACK = 111 +pkg syscall (freebsd-arm-cgo), const IFT_STARLAN = 11 +pkg syscall (freebsd-arm-cgo), const IFT_STF = 215 +pkg syscall (freebsd-arm-cgo), const IFT_T1 = 18 +pkg syscall (freebsd-arm-cgo), const IFT_TDLC = 116 +pkg syscall (freebsd-arm-cgo), const IFT_TERMPAD = 91 +pkg syscall (freebsd-arm-cgo), const IFT_TR008 = 176 +pkg syscall (freebsd-arm-cgo), const IFT_TRANSPHDLC = 123 +pkg syscall (freebsd-arm-cgo), const IFT_TUNNEL = 131 +pkg syscall (freebsd-arm-cgo), const IFT_ULTRA = 29 +pkg syscall (freebsd-arm-cgo), const IFT_USB = 160 +pkg syscall (freebsd-arm-cgo), const IFT_V11 = 64 +pkg syscall (freebsd-arm-cgo), const IFT_V35 = 45 +pkg syscall (freebsd-arm-cgo), const IFT_V36 = 65 +pkg syscall (freebsd-arm-cgo), const IFT_V37 = 120 +pkg syscall (freebsd-arm-cgo), const IFT_VDSL = 97 +pkg syscall (freebsd-arm-cgo), const IFT_VIRTUALIPADDRESS = 112 +pkg syscall (freebsd-arm-cgo), const IFT_VOICEEM = 100 +pkg syscall (freebsd-arm-cgo), const IFT_VOICEENCAP = 103 +pkg syscall (freebsd-arm-cgo), const IFT_VOICEFXO = 101 +pkg syscall (freebsd-arm-cgo), const IFT_VOICEFXS = 102 +pkg syscall (freebsd-arm-cgo), const IFT_VOICEOVERATM = 152 +pkg syscall (freebsd-arm-cgo), const IFT_VOICEOVERFRAMERELAY = 153 +pkg syscall (freebsd-arm-cgo), const IFT_VOICEOVERIP = 104 +pkg syscall (freebsd-arm-cgo), const IFT_X213 = 93 +pkg syscall (freebsd-arm-cgo), const IFT_X25 = 5 +pkg syscall (freebsd-arm-cgo), const IFT_X25DDN = 4 +pkg syscall (freebsd-arm-cgo), const IFT_X25HUNTGROUP = 122 +pkg syscall (freebsd-arm-cgo), const IFT_X25MLP = 121 +pkg syscall (freebsd-arm-cgo), const IFT_X25PLE = 40 +pkg syscall (freebsd-arm-cgo), const IFT_XETHER = 26 +pkg syscall (freebsd-arm-cgo), const IGNBRK = 1 +pkg syscall (freebsd-arm-cgo), const IGNCR = 128 +pkg syscall (freebsd-arm-cgo), const IGNPAR = 4 +pkg syscall (freebsd-arm-cgo), const IMAXBEL = 8192 +pkg syscall (freebsd-arm-cgo), const INLCR = 64 +pkg syscall (freebsd-arm-cgo), const INPCK = 16 +pkg syscall (freebsd-arm-cgo), const IN_CLASSA_HOST = 16777215 +pkg syscall (freebsd-arm-cgo), const IN_CLASSA_MAX = 128 +pkg syscall (freebsd-arm-cgo), const IN_CLASSA_NET = 4278190080 +pkg syscall (freebsd-arm-cgo), const IN_CLASSA_NSHIFT = 24 +pkg syscall (freebsd-arm-cgo), const IN_CLASSB_HOST = 65535 +pkg syscall (freebsd-arm-cgo), const IN_CLASSB_MAX = 65536 +pkg syscall (freebsd-arm-cgo), const IN_CLASSB_NET = 4294901760 +pkg syscall (freebsd-arm-cgo), const IN_CLASSB_NSHIFT = 16 +pkg syscall (freebsd-arm-cgo), const IN_CLASSC_HOST = 255 +pkg syscall (freebsd-arm-cgo), const IN_CLASSC_NET = 4294967040 +pkg syscall (freebsd-arm-cgo), const IN_CLASSC_NSHIFT = 8 +pkg syscall (freebsd-arm-cgo), const IN_CLASSD_HOST = 268435455 +pkg syscall (freebsd-arm-cgo), const IN_CLASSD_NET = 4026531840 +pkg syscall (freebsd-arm-cgo), const IN_CLASSD_NSHIFT = 28 +pkg syscall (freebsd-arm-cgo), const IN_LOOPBACKNET = 127 +pkg syscall (freebsd-arm-cgo), const IN_RFC3021_MASK = 4294967294 +pkg syscall (freebsd-arm-cgo), const IPPROTO_3PC = 34 +pkg syscall (freebsd-arm-cgo), const IPPROTO_ADFS = 68 +pkg syscall (freebsd-arm-cgo), const IPPROTO_AH = 51 +pkg syscall (freebsd-arm-cgo), const IPPROTO_AHIP = 61 +pkg syscall (freebsd-arm-cgo), const IPPROTO_APES = 99 +pkg syscall (freebsd-arm-cgo), const IPPROTO_ARGUS = 13 +pkg syscall (freebsd-arm-cgo), const IPPROTO_AX25 = 93 +pkg syscall (freebsd-arm-cgo), const IPPROTO_BHA = 49 +pkg syscall (freebsd-arm-cgo), const IPPROTO_BLT = 30 +pkg syscall (freebsd-arm-cgo), const IPPROTO_BRSATMON = 76 +pkg syscall (freebsd-arm-cgo), const IPPROTO_CARP = 112 +pkg syscall (freebsd-arm-cgo), const IPPROTO_CFTP = 62 +pkg syscall (freebsd-arm-cgo), const IPPROTO_CHAOS = 16 +pkg syscall (freebsd-arm-cgo), const IPPROTO_CMTP = 38 +pkg syscall (freebsd-arm-cgo), const IPPROTO_CPHB = 73 +pkg syscall (freebsd-arm-cgo), const IPPROTO_CPNX = 72 +pkg syscall (freebsd-arm-cgo), const IPPROTO_DDP = 37 +pkg syscall (freebsd-arm-cgo), const IPPROTO_DGP = 86 +pkg syscall (freebsd-arm-cgo), const IPPROTO_DIVERT = 258 +pkg syscall (freebsd-arm-cgo), const IPPROTO_DONE = 257 +pkg syscall (freebsd-arm-cgo), const IPPROTO_DSTOPTS = 60 +pkg syscall (freebsd-arm-cgo), const IPPROTO_EGP = 8 +pkg syscall (freebsd-arm-cgo), const IPPROTO_EMCON = 14 +pkg syscall (freebsd-arm-cgo), const IPPROTO_ENCAP = 98 +pkg syscall (freebsd-arm-cgo), const IPPROTO_EON = 80 +pkg syscall (freebsd-arm-cgo), const IPPROTO_ESP = 50 +pkg syscall (freebsd-arm-cgo), const IPPROTO_ETHERIP = 97 +pkg syscall (freebsd-arm-cgo), const IPPROTO_FRAGMENT = 44 +pkg syscall (freebsd-arm-cgo), const IPPROTO_GGP = 3 +pkg syscall (freebsd-arm-cgo), const IPPROTO_GMTP = 100 +pkg syscall (freebsd-arm-cgo), const IPPROTO_GRE = 47 +pkg syscall (freebsd-arm-cgo), const IPPROTO_HELLO = 63 +pkg syscall (freebsd-arm-cgo), const IPPROTO_HMP = 20 +pkg syscall (freebsd-arm-cgo), const IPPROTO_HOPOPTS = 0 +pkg syscall (freebsd-arm-cgo), const IPPROTO_ICMP = 1 +pkg syscall (freebsd-arm-cgo), const IPPROTO_ICMPV6 = 58 +pkg syscall (freebsd-arm-cgo), const IPPROTO_IDP = 22 +pkg syscall (freebsd-arm-cgo), const IPPROTO_IDPR = 35 +pkg syscall (freebsd-arm-cgo), const IPPROTO_IDRP = 45 +pkg syscall (freebsd-arm-cgo), const IPPROTO_IGMP = 2 +pkg syscall (freebsd-arm-cgo), const IPPROTO_IGP = 85 +pkg syscall (freebsd-arm-cgo), const IPPROTO_IGRP = 88 +pkg syscall (freebsd-arm-cgo), const IPPROTO_IL = 40 +pkg syscall (freebsd-arm-cgo), const IPPROTO_INLSP = 52 +pkg syscall (freebsd-arm-cgo), const IPPROTO_INP = 32 +pkg syscall (freebsd-arm-cgo), const IPPROTO_IPCOMP = 108 +pkg syscall (freebsd-arm-cgo), const IPPROTO_IPCV = 71 +pkg syscall (freebsd-arm-cgo), const IPPROTO_IPEIP = 94 +pkg syscall (freebsd-arm-cgo), const IPPROTO_IPIP = 4 +pkg syscall (freebsd-arm-cgo), const IPPROTO_IPPC = 67 +pkg syscall (freebsd-arm-cgo), const IPPROTO_IPV4 = 4 +pkg syscall (freebsd-arm-cgo), const IPPROTO_IRTP = 28 +pkg syscall (freebsd-arm-cgo), const IPPROTO_KRYPTOLAN = 65 +pkg syscall (freebsd-arm-cgo), const IPPROTO_LARP = 91 +pkg syscall (freebsd-arm-cgo), const IPPROTO_LEAF1 = 25 +pkg syscall (freebsd-arm-cgo), const IPPROTO_LEAF2 = 26 +pkg syscall (freebsd-arm-cgo), const IPPROTO_MAX = 256 +pkg syscall (freebsd-arm-cgo), const IPPROTO_MAXID = 52 +pkg syscall (freebsd-arm-cgo), const IPPROTO_MEAS = 19 +pkg syscall (freebsd-arm-cgo), const IPPROTO_MH = 135 +pkg syscall (freebsd-arm-cgo), const IPPROTO_MHRP = 48 +pkg syscall (freebsd-arm-cgo), const IPPROTO_MICP = 95 +pkg syscall (freebsd-arm-cgo), const IPPROTO_MOBILE = 55 +pkg syscall (freebsd-arm-cgo), const IPPROTO_MPLS = 137 +pkg syscall (freebsd-arm-cgo), const IPPROTO_MTP = 92 +pkg syscall (freebsd-arm-cgo), const IPPROTO_MUX = 18 +pkg syscall (freebsd-arm-cgo), const IPPROTO_ND = 77 +pkg syscall (freebsd-arm-cgo), const IPPROTO_NHRP = 54 +pkg syscall (freebsd-arm-cgo), const IPPROTO_NONE = 59 +pkg syscall (freebsd-arm-cgo), const IPPROTO_NSP = 31 +pkg syscall (freebsd-arm-cgo), const IPPROTO_NVPII = 11 +pkg syscall (freebsd-arm-cgo), const IPPROTO_OLD_DIVERT = 254 +pkg syscall (freebsd-arm-cgo), const IPPROTO_OSPFIGP = 89 +pkg syscall (freebsd-arm-cgo), const IPPROTO_PFSYNC = 240 +pkg syscall (freebsd-arm-cgo), const IPPROTO_PGM = 113 +pkg syscall (freebsd-arm-cgo), const IPPROTO_PIGP = 9 +pkg syscall (freebsd-arm-cgo), const IPPROTO_PIM = 103 +pkg syscall (freebsd-arm-cgo), const IPPROTO_PRM = 21 +pkg syscall (freebsd-arm-cgo), const IPPROTO_PUP = 12 +pkg syscall (freebsd-arm-cgo), const IPPROTO_PVP = 75 +pkg syscall (freebsd-arm-cgo), const IPPROTO_RAW = 255 +pkg syscall (freebsd-arm-cgo), const IPPROTO_RCCMON = 10 +pkg syscall (freebsd-arm-cgo), const IPPROTO_RDP = 27 +pkg syscall (freebsd-arm-cgo), const IPPROTO_ROUTING = 43 +pkg syscall (freebsd-arm-cgo), const IPPROTO_RSVP = 46 +pkg syscall (freebsd-arm-cgo), const IPPROTO_RVD = 66 +pkg syscall (freebsd-arm-cgo), const IPPROTO_SATEXPAK = 64 +pkg syscall (freebsd-arm-cgo), const IPPROTO_SATMON = 69 +pkg syscall (freebsd-arm-cgo), const IPPROTO_SCCSP = 96 +pkg syscall (freebsd-arm-cgo), const IPPROTO_SCTP = 132 +pkg syscall (freebsd-arm-cgo), const IPPROTO_SDRP = 42 +pkg syscall (freebsd-arm-cgo), const IPPROTO_SEND = 259 +pkg syscall (freebsd-arm-cgo), const IPPROTO_SEP = 33 +pkg syscall (freebsd-arm-cgo), const IPPROTO_SKIP = 57 +pkg syscall (freebsd-arm-cgo), const IPPROTO_SPACER = 32767 +pkg syscall (freebsd-arm-cgo), const IPPROTO_SRPC = 90 +pkg syscall (freebsd-arm-cgo), const IPPROTO_ST = 7 +pkg syscall (freebsd-arm-cgo), const IPPROTO_SVMTP = 82 +pkg syscall (freebsd-arm-cgo), const IPPROTO_SWIPE = 53 +pkg syscall (freebsd-arm-cgo), const IPPROTO_TCF = 87 +pkg syscall (freebsd-arm-cgo), const IPPROTO_TLSP = 56 +pkg syscall (freebsd-arm-cgo), const IPPROTO_TP = 29 +pkg syscall (freebsd-arm-cgo), const IPPROTO_TPXX = 39 +pkg syscall (freebsd-arm-cgo), const IPPROTO_TRUNK1 = 23 +pkg syscall (freebsd-arm-cgo), const IPPROTO_TRUNK2 = 24 +pkg syscall (freebsd-arm-cgo), const IPPROTO_TTP = 84 +pkg syscall (freebsd-arm-cgo), const IPPROTO_VINES = 83 +pkg syscall (freebsd-arm-cgo), const IPPROTO_VISA = 70 +pkg syscall (freebsd-arm-cgo), const IPPROTO_VMTP = 81 +pkg syscall (freebsd-arm-cgo), const IPPROTO_WBEXPAK = 79 +pkg syscall (freebsd-arm-cgo), const IPPROTO_WBMON = 78 +pkg syscall (freebsd-arm-cgo), const IPPROTO_WSN = 74 +pkg syscall (freebsd-arm-cgo), const IPPROTO_XNET = 15 +pkg syscall (freebsd-arm-cgo), const IPPROTO_XTP = 36 +pkg syscall (freebsd-arm-cgo), const IPV6_AUTOFLOWLABEL = 59 +pkg syscall (freebsd-arm-cgo), const IPV6_BINDANY = 64 +pkg syscall (freebsd-arm-cgo), const IPV6_BINDV6ONLY = 27 +pkg syscall (freebsd-arm-cgo), const IPV6_CHECKSUM = 26 +pkg syscall (freebsd-arm-cgo), const IPV6_DEFAULT_MULTICAST_HOPS = 1 +pkg syscall (freebsd-arm-cgo), const IPV6_DEFAULT_MULTICAST_LOOP = 1 +pkg syscall (freebsd-arm-cgo), const IPV6_DEFHLIM = 64 +pkg syscall (freebsd-arm-cgo), const IPV6_DONTFRAG = 62 +pkg syscall (freebsd-arm-cgo), const IPV6_DSTOPTS = 50 +pkg syscall (freebsd-arm-cgo), const IPV6_FAITH = 29 +pkg syscall (freebsd-arm-cgo), const IPV6_FLOWINFO_MASK = 4294967055 +pkg syscall (freebsd-arm-cgo), const IPV6_FLOWLABEL_MASK = 4294905600 +pkg syscall (freebsd-arm-cgo), const IPV6_FRAGTTL = 120 +pkg syscall (freebsd-arm-cgo), const IPV6_FW_ADD = 30 +pkg syscall (freebsd-arm-cgo), const IPV6_FW_DEL = 31 +pkg syscall (freebsd-arm-cgo), const IPV6_FW_FLUSH = 32 +pkg syscall (freebsd-arm-cgo), const IPV6_FW_GET = 34 +pkg syscall (freebsd-arm-cgo), const IPV6_FW_ZERO = 33 +pkg syscall (freebsd-arm-cgo), const IPV6_HLIMDEC = 1 +pkg syscall (freebsd-arm-cgo), const IPV6_HOPLIMIT = 47 +pkg syscall (freebsd-arm-cgo), const IPV6_HOPOPTS = 49 +pkg syscall (freebsd-arm-cgo), const IPV6_IPSEC_POLICY = 28 +pkg syscall (freebsd-arm-cgo), const IPV6_JOIN_GROUP = 12 +pkg syscall (freebsd-arm-cgo), const IPV6_LEAVE_GROUP = 13 +pkg syscall (freebsd-arm-cgo), const IPV6_MAXHLIM = 255 +pkg syscall (freebsd-arm-cgo), const IPV6_MAXOPTHDR = 2048 +pkg syscall (freebsd-arm-cgo), const IPV6_MAXPACKET = 65535 +pkg syscall (freebsd-arm-cgo), const IPV6_MAX_GROUP_SRC_FILTER = 512 +pkg syscall (freebsd-arm-cgo), const IPV6_MAX_MEMBERSHIPS = 4095 +pkg syscall (freebsd-arm-cgo), const IPV6_MAX_SOCK_SRC_FILTER = 128 +pkg syscall (freebsd-arm-cgo), const IPV6_MIN_MEMBERSHIPS = 31 +pkg syscall (freebsd-arm-cgo), const IPV6_MMTU = 1280 +pkg syscall (freebsd-arm-cgo), const IPV6_MSFILTER = 74 +pkg syscall (freebsd-arm-cgo), const IPV6_MULTICAST_HOPS = 10 +pkg syscall (freebsd-arm-cgo), const IPV6_MULTICAST_IF = 9 +pkg syscall (freebsd-arm-cgo), const IPV6_MULTICAST_LOOP = 11 +pkg syscall (freebsd-arm-cgo), const IPV6_NEXTHOP = 48 +pkg syscall (freebsd-arm-cgo), const IPV6_PATHMTU = 44 +pkg syscall (freebsd-arm-cgo), const IPV6_PKTINFO = 46 +pkg syscall (freebsd-arm-cgo), const IPV6_PORTRANGE = 14 +pkg syscall (freebsd-arm-cgo), const IPV6_PORTRANGE_DEFAULT = 0 +pkg syscall (freebsd-arm-cgo), const IPV6_PORTRANGE_HIGH = 1 +pkg syscall (freebsd-arm-cgo), const IPV6_PORTRANGE_LOW = 2 +pkg syscall (freebsd-arm-cgo), const IPV6_PREFER_TEMPADDR = 63 +pkg syscall (freebsd-arm-cgo), const IPV6_RECVDSTOPTS = 40 +pkg syscall (freebsd-arm-cgo), const IPV6_RECVHOPLIMIT = 37 +pkg syscall (freebsd-arm-cgo), const IPV6_RECVHOPOPTS = 39 +pkg syscall (freebsd-arm-cgo), const IPV6_RECVPATHMTU = 43 +pkg syscall (freebsd-arm-cgo), const IPV6_RECVPKTINFO = 36 +pkg syscall (freebsd-arm-cgo), const IPV6_RECVRTHDR = 38 +pkg syscall (freebsd-arm-cgo), const IPV6_RECVTCLASS = 57 +pkg syscall (freebsd-arm-cgo), const IPV6_RTHDR = 51 +pkg syscall (freebsd-arm-cgo), const IPV6_RTHDRDSTOPTS = 35 +pkg syscall (freebsd-arm-cgo), const IPV6_RTHDR_LOOSE = 0 +pkg syscall (freebsd-arm-cgo), const IPV6_RTHDR_STRICT = 1 +pkg syscall (freebsd-arm-cgo), const IPV6_RTHDR_TYPE_0 = 0 +pkg syscall (freebsd-arm-cgo), const IPV6_SOCKOPT_RESERVED1 = 3 +pkg syscall (freebsd-arm-cgo), const IPV6_TCLASS = 61 +pkg syscall (freebsd-arm-cgo), const IPV6_UNICAST_HOPS = 4 +pkg syscall (freebsd-arm-cgo), const IPV6_USE_MIN_MTU = 42 +pkg syscall (freebsd-arm-cgo), const IPV6_V6ONLY = 27 +pkg syscall (freebsd-arm-cgo), const IPV6_VERSION = 96 +pkg syscall (freebsd-arm-cgo), const IPV6_VERSION_MASK = 240 +pkg syscall (freebsd-arm-cgo), const IP_ADD_MEMBERSHIP = 12 +pkg syscall (freebsd-arm-cgo), const IP_ADD_SOURCE_MEMBERSHIP = 70 +pkg syscall (freebsd-arm-cgo), const IP_BINDANY = 24 +pkg syscall (freebsd-arm-cgo), const IP_BLOCK_SOURCE = 72 +pkg syscall (freebsd-arm-cgo), const IP_DEFAULT_MULTICAST_LOOP = 1 +pkg syscall (freebsd-arm-cgo), const IP_DEFAULT_MULTICAST_TTL = 1 +pkg syscall (freebsd-arm-cgo), const IP_DF = 16384 +pkg syscall (freebsd-arm-cgo), const IP_DONTFRAG = 67 +pkg syscall (freebsd-arm-cgo), const IP_DROP_MEMBERSHIP = 13 +pkg syscall (freebsd-arm-cgo), const IP_DROP_SOURCE_MEMBERSHIP = 71 +pkg syscall (freebsd-arm-cgo), const IP_DUMMYNET3 = 49 +pkg syscall (freebsd-arm-cgo), const IP_DUMMYNET_CONFIGURE = 60 +pkg syscall (freebsd-arm-cgo), const IP_DUMMYNET_DEL = 61 +pkg syscall (freebsd-arm-cgo), const IP_DUMMYNET_FLUSH = 62 +pkg syscall (freebsd-arm-cgo), const IP_DUMMYNET_GET = 64 +pkg syscall (freebsd-arm-cgo), const IP_FAITH = 22 +pkg syscall (freebsd-arm-cgo), const IP_FW3 = 48 +pkg syscall (freebsd-arm-cgo), const IP_FW_ADD = 50 +pkg syscall (freebsd-arm-cgo), const IP_FW_DEL = 51 +pkg syscall (freebsd-arm-cgo), const IP_FW_FLUSH = 52 +pkg syscall (freebsd-arm-cgo), const IP_FW_GET = 54 +pkg syscall (freebsd-arm-cgo), const IP_FW_NAT_CFG = 56 +pkg syscall (freebsd-arm-cgo), const IP_FW_NAT_DEL = 57 +pkg syscall (freebsd-arm-cgo), const IP_FW_NAT_GET_CONFIG = 58 +pkg syscall (freebsd-arm-cgo), const IP_FW_NAT_GET_LOG = 59 +pkg syscall (freebsd-arm-cgo), const IP_FW_RESETLOG = 55 +pkg syscall (freebsd-arm-cgo), const IP_FW_TABLE_ADD = 40 +pkg syscall (freebsd-arm-cgo), const IP_FW_TABLE_DEL = 41 +pkg syscall (freebsd-arm-cgo), const IP_FW_TABLE_FLUSH = 42 +pkg syscall (freebsd-arm-cgo), const IP_FW_TABLE_GETSIZE = 43 +pkg syscall (freebsd-arm-cgo), const IP_FW_TABLE_LIST = 44 +pkg syscall (freebsd-arm-cgo), const IP_FW_ZERO = 53 +pkg syscall (freebsd-arm-cgo), const IP_HDRINCL = 2 +pkg syscall (freebsd-arm-cgo), const IP_IPSEC_POLICY = 21 +pkg syscall (freebsd-arm-cgo), const IP_MAXPACKET = 65535 +pkg syscall (freebsd-arm-cgo), const IP_MAX_GROUP_SRC_FILTER = 512 +pkg syscall (freebsd-arm-cgo), const IP_MAX_MEMBERSHIPS = 4095 +pkg syscall (freebsd-arm-cgo), const IP_MAX_SOCK_MUTE_FILTER = 128 +pkg syscall (freebsd-arm-cgo), const IP_MAX_SOCK_SRC_FILTER = 128 +pkg syscall (freebsd-arm-cgo), const IP_MAX_SOURCE_FILTER = 1024 +pkg syscall (freebsd-arm-cgo), const IP_MF = 8192 +pkg syscall (freebsd-arm-cgo), const IP_MINTTL = 66 +pkg syscall (freebsd-arm-cgo), const IP_MIN_MEMBERSHIPS = 31 +pkg syscall (freebsd-arm-cgo), const IP_MSFILTER = 74 +pkg syscall (freebsd-arm-cgo), const IP_MSS = 576 +pkg syscall (freebsd-arm-cgo), const IP_MULTICAST_IF = 9 +pkg syscall (freebsd-arm-cgo), const IP_MULTICAST_LOOP = 11 +pkg syscall (freebsd-arm-cgo), const IP_MULTICAST_TTL = 10 +pkg syscall (freebsd-arm-cgo), const IP_MULTICAST_VIF = 14 +pkg syscall (freebsd-arm-cgo), const IP_OFFMASK = 8191 +pkg syscall (freebsd-arm-cgo), const IP_ONESBCAST = 23 +pkg syscall (freebsd-arm-cgo), const IP_OPTIONS = 1 +pkg syscall (freebsd-arm-cgo), const IP_PORTRANGE = 19 +pkg syscall (freebsd-arm-cgo), const IP_PORTRANGE_DEFAULT = 0 +pkg syscall (freebsd-arm-cgo), const IP_PORTRANGE_HIGH = 1 +pkg syscall (freebsd-arm-cgo), const IP_PORTRANGE_LOW = 2 +pkg syscall (freebsd-arm-cgo), const IP_RECVDSTADDR = 7 +pkg syscall (freebsd-arm-cgo), const IP_RECVIF = 20 +pkg syscall (freebsd-arm-cgo), const IP_RECVOPTS = 5 +pkg syscall (freebsd-arm-cgo), const IP_RECVRETOPTS = 6 +pkg syscall (freebsd-arm-cgo), const IP_RECVTOS = 68 +pkg syscall (freebsd-arm-cgo), const IP_RECVTTL = 65 +pkg syscall (freebsd-arm-cgo), const IP_RETOPTS = 8 +pkg syscall (freebsd-arm-cgo), const IP_RF = 32768 +pkg syscall (freebsd-arm-cgo), const IP_RSVP_OFF = 16 +pkg syscall (freebsd-arm-cgo), const IP_RSVP_ON = 15 +pkg syscall (freebsd-arm-cgo), const IP_RSVP_VIF_OFF = 18 +pkg syscall (freebsd-arm-cgo), const IP_RSVP_VIF_ON = 17 +pkg syscall (freebsd-arm-cgo), const IP_SENDSRCADDR = 7 +pkg syscall (freebsd-arm-cgo), const IP_TOS = 3 +pkg syscall (freebsd-arm-cgo), const IP_TTL = 4 +pkg syscall (freebsd-arm-cgo), const IP_UNBLOCK_SOURCE = 73 +pkg syscall (freebsd-arm-cgo), const ISIG = 128 +pkg syscall (freebsd-arm-cgo), const ISTRIP = 32 +pkg syscall (freebsd-arm-cgo), const IXANY = 2048 +pkg syscall (freebsd-arm-cgo), const IXOFF = 1024 +pkg syscall (freebsd-arm-cgo), const IXON = 512 +pkg syscall (freebsd-arm-cgo), const ImplementsGetwd = false +pkg syscall (freebsd-arm-cgo), const LOCK_EX = 2 +pkg syscall (freebsd-arm-cgo), const LOCK_NB = 4 +pkg syscall (freebsd-arm-cgo), const LOCK_SH = 1 +pkg syscall (freebsd-arm-cgo), const LOCK_UN = 8 +pkg syscall (freebsd-arm-cgo), const MADV_AUTOSYNC = 7 +pkg syscall (freebsd-arm-cgo), const MADV_CORE = 9 +pkg syscall (freebsd-arm-cgo), const MADV_DONTNEED = 4 +pkg syscall (freebsd-arm-cgo), const MADV_FREE = 5 +pkg syscall (freebsd-arm-cgo), const MADV_NOCORE = 8 +pkg syscall (freebsd-arm-cgo), const MADV_NORMAL = 0 +pkg syscall (freebsd-arm-cgo), const MADV_NOSYNC = 6 +pkg syscall (freebsd-arm-cgo), const MADV_PROTECT = 10 +pkg syscall (freebsd-arm-cgo), const MADV_RANDOM = 1 +pkg syscall (freebsd-arm-cgo), const MADV_SEQUENTIAL = 2 +pkg syscall (freebsd-arm-cgo), const MADV_WILLNEED = 3 +pkg syscall (freebsd-arm-cgo), const MAP_ANON = 4096 +pkg syscall (freebsd-arm-cgo), const MAP_ANONYMOUS = 4096 +pkg syscall (freebsd-arm-cgo), const MAP_COPY = 2 +pkg syscall (freebsd-arm-cgo), const MAP_FILE = 0 +pkg syscall (freebsd-arm-cgo), const MAP_FIXED = 16 +pkg syscall (freebsd-arm-cgo), const MAP_HASSEMAPHORE = 512 +pkg syscall (freebsd-arm-cgo), const MAP_NOCORE = 131072 +pkg syscall (freebsd-arm-cgo), const MAP_NORESERVE = 64 +pkg syscall (freebsd-arm-cgo), const MAP_NOSYNC = 2048 +pkg syscall (freebsd-arm-cgo), const MAP_PREFAULT_READ = 262144 +pkg syscall (freebsd-arm-cgo), const MAP_PRIVATE = 2 +pkg syscall (freebsd-arm-cgo), const MAP_RENAME = 32 +pkg syscall (freebsd-arm-cgo), const MAP_RESERVED0080 = 128 +pkg syscall (freebsd-arm-cgo), const MAP_RESERVED0100 = 256 +pkg syscall (freebsd-arm-cgo), const MAP_SHARED = 1 +pkg syscall (freebsd-arm-cgo), const MAP_STACK = 1024 +pkg syscall (freebsd-arm-cgo), const MCL_CURRENT = 1 +pkg syscall (freebsd-arm-cgo), const MCL_FUTURE = 2 +pkg syscall (freebsd-arm-cgo), const MSG_COMPAT = 32768 +pkg syscall (freebsd-arm-cgo), const MSG_CTRUNC = 32 +pkg syscall (freebsd-arm-cgo), const MSG_DONTROUTE = 4 +pkg syscall (freebsd-arm-cgo), const MSG_DONTWAIT = 128 +pkg syscall (freebsd-arm-cgo), const MSG_EOF = 256 +pkg syscall (freebsd-arm-cgo), const MSG_EOR = 8 +pkg syscall (freebsd-arm-cgo), const MSG_NBIO = 16384 +pkg syscall (freebsd-arm-cgo), const MSG_NOSIGNAL = 131072 +pkg syscall (freebsd-arm-cgo), const MSG_NOTIFICATION = 8192 +pkg syscall (freebsd-arm-cgo), const MSG_OOB = 1 +pkg syscall (freebsd-arm-cgo), const MSG_PEEK = 2 +pkg syscall (freebsd-arm-cgo), const MSG_TRUNC = 16 +pkg syscall (freebsd-arm-cgo), const MSG_WAITALL = 64 +pkg syscall (freebsd-arm-cgo), const MS_ASYNC = 1 +pkg syscall (freebsd-arm-cgo), const MS_INVALIDATE = 2 +pkg syscall (freebsd-arm-cgo), const MS_SYNC = 0 +pkg syscall (freebsd-arm-cgo), const NET_RT_DUMP = 1 +pkg syscall (freebsd-arm-cgo), const NET_RT_FLAGS = 2 +pkg syscall (freebsd-arm-cgo), const NET_RT_IFLIST = 3 +pkg syscall (freebsd-arm-cgo), const NET_RT_IFLISTL = 5 +pkg syscall (freebsd-arm-cgo), const NET_RT_IFMALIST = 4 +pkg syscall (freebsd-arm-cgo), const NET_RT_MAXID = 6 +pkg syscall (freebsd-arm-cgo), const NOFLSH = 2147483648 +pkg syscall (freebsd-arm-cgo), const NOTE_ATTRIB = 8 +pkg syscall (freebsd-arm-cgo), const NOTE_CHILD = 4 +pkg syscall (freebsd-arm-cgo), const NOTE_DELETE = 1 +pkg syscall (freebsd-arm-cgo), const NOTE_EXEC = 536870912 +pkg syscall (freebsd-arm-cgo), const NOTE_EXIT = 2147483648 +pkg syscall (freebsd-arm-cgo), const NOTE_EXTEND = 4 +pkg syscall (freebsd-arm-cgo), const NOTE_FFAND = 1073741824 +pkg syscall (freebsd-arm-cgo), const NOTE_FFCOPY = 3221225472 +pkg syscall (freebsd-arm-cgo), const NOTE_FFCTRLMASK = 3221225472 +pkg syscall (freebsd-arm-cgo), const NOTE_FFLAGSMASK = 16777215 +pkg syscall (freebsd-arm-cgo), const NOTE_FFNOP = 0 +pkg syscall (freebsd-arm-cgo), const NOTE_FFOR = 2147483648 +pkg syscall (freebsd-arm-cgo), const NOTE_FORK = 1073741824 +pkg syscall (freebsd-arm-cgo), const NOTE_LINK = 16 +pkg syscall (freebsd-arm-cgo), const NOTE_LOWAT = 1 +pkg syscall (freebsd-arm-cgo), const NOTE_PCTRLMASK = 4026531840 +pkg syscall (freebsd-arm-cgo), const NOTE_PDATAMASK = 1048575 +pkg syscall (freebsd-arm-cgo), const NOTE_RENAME = 32 +pkg syscall (freebsd-arm-cgo), const NOTE_REVOKE = 64 +pkg syscall (freebsd-arm-cgo), const NOTE_TRACK = 1 +pkg syscall (freebsd-arm-cgo), const NOTE_TRACKERR = 2 +pkg syscall (freebsd-arm-cgo), const NOTE_TRIGGER = 16777216 +pkg syscall (freebsd-arm-cgo), const NOTE_WRITE = 2 +pkg syscall (freebsd-arm-cgo), const OCRNL = 16 +pkg syscall (freebsd-arm-cgo), const ONLCR = 2 +pkg syscall (freebsd-arm-cgo), const ONLRET = 64 +pkg syscall (freebsd-arm-cgo), const ONOCR = 32 +pkg syscall (freebsd-arm-cgo), const ONOEOT = 8 +pkg syscall (freebsd-arm-cgo), const OPOST = 1 +pkg syscall (freebsd-arm-cgo), const O_ACCMODE = 3 +pkg syscall (freebsd-arm-cgo), const O_APPEND = 8 +pkg syscall (freebsd-arm-cgo), const O_ASYNC = 64 +pkg syscall (freebsd-arm-cgo), const O_CLOEXEC = 0 +pkg syscall (freebsd-arm-cgo), const O_CREAT = 512 +pkg syscall (freebsd-arm-cgo), const O_DIRECT = 65536 +pkg syscall (freebsd-arm-cgo), const O_DIRECTORY = 131072 +pkg syscall (freebsd-arm-cgo), const O_EXCL = 2048 +pkg syscall (freebsd-arm-cgo), const O_EXEC = 262144 +pkg syscall (freebsd-arm-cgo), const O_EXLOCK = 32 +pkg syscall (freebsd-arm-cgo), const O_FSYNC = 128 +pkg syscall (freebsd-arm-cgo), const O_NDELAY = 4 +pkg syscall (freebsd-arm-cgo), const O_NOCTTY = 32768 +pkg syscall (freebsd-arm-cgo), const O_NOFOLLOW = 256 +pkg syscall (freebsd-arm-cgo), const O_NONBLOCK = 4 +pkg syscall (freebsd-arm-cgo), const O_SHLOCK = 16 +pkg syscall (freebsd-arm-cgo), const O_SYNC = 128 +pkg syscall (freebsd-arm-cgo), const O_TRUNC = 1024 +pkg syscall (freebsd-arm-cgo), const O_TTY_INIT = 524288 +pkg syscall (freebsd-arm-cgo), const PARENB = 4096 +pkg syscall (freebsd-arm-cgo), const PARMRK = 8 +pkg syscall (freebsd-arm-cgo), const PARODD = 8192 +pkg syscall (freebsd-arm-cgo), const PENDIN = 536870912 +pkg syscall (freebsd-arm-cgo), const PROT_EXEC = 4 +pkg syscall (freebsd-arm-cgo), const PROT_NONE = 0 +pkg syscall (freebsd-arm-cgo), const PROT_READ = 1 +pkg syscall (freebsd-arm-cgo), const PROT_WRITE = 2 +pkg syscall (freebsd-arm-cgo), const PTRACE_CONT = 7 +pkg syscall (freebsd-arm-cgo), const PTRACE_KILL = 8 +pkg syscall (freebsd-arm-cgo), const PTRACE_TRACEME = 0 +pkg syscall (freebsd-arm-cgo), const RLIMIT_AS = 10 +pkg syscall (freebsd-arm-cgo), const RLIMIT_CORE = 4 +pkg syscall (freebsd-arm-cgo), const RLIMIT_CPU = 0 +pkg syscall (freebsd-arm-cgo), const RLIMIT_DATA = 2 +pkg syscall (freebsd-arm-cgo), const RLIMIT_FSIZE = 1 +pkg syscall (freebsd-arm-cgo), const RLIMIT_NOFILE = 8 +pkg syscall (freebsd-arm-cgo), const RLIMIT_STACK = 3 +pkg syscall (freebsd-arm-cgo), const RLIM_INFINITY = 9223372036854775807 +pkg syscall (freebsd-arm-cgo), const RTAX_AUTHOR = 6 +pkg syscall (freebsd-arm-cgo), const RTAX_BRD = 7 +pkg syscall (freebsd-arm-cgo), const RTAX_DST = 0 +pkg syscall (freebsd-arm-cgo), const RTAX_GATEWAY = 1 +pkg syscall (freebsd-arm-cgo), const RTAX_GENMASK = 3 +pkg syscall (freebsd-arm-cgo), const RTAX_IFA = 5 +pkg syscall (freebsd-arm-cgo), const RTAX_IFP = 4 +pkg syscall (freebsd-arm-cgo), const RTAX_MAX = 8 +pkg syscall (freebsd-arm-cgo), const RTAX_NETMASK = 2 +pkg syscall (freebsd-arm-cgo), const RTA_AUTHOR = 64 +pkg syscall (freebsd-arm-cgo), const RTA_BRD = 128 +pkg syscall (freebsd-arm-cgo), const RTA_DST = 1 +pkg syscall (freebsd-arm-cgo), const RTA_GATEWAY = 2 +pkg syscall (freebsd-arm-cgo), const RTA_GENMASK = 8 +pkg syscall (freebsd-arm-cgo), const RTA_IFA = 32 +pkg syscall (freebsd-arm-cgo), const RTA_IFP = 16 +pkg syscall (freebsd-arm-cgo), const RTA_NETMASK = 4 +pkg syscall (freebsd-arm-cgo), const RTF_BLACKHOLE = 4096 +pkg syscall (freebsd-arm-cgo), const RTF_BROADCAST = 4194304 +pkg syscall (freebsd-arm-cgo), const RTF_DONE = 64 +pkg syscall (freebsd-arm-cgo), const RTF_DYNAMIC = 16 +pkg syscall (freebsd-arm-cgo), const RTF_FMASK = 268752904 +pkg syscall (freebsd-arm-cgo), const RTF_GATEWAY = 2 +pkg syscall (freebsd-arm-cgo), const RTF_HOST = 4 +pkg syscall (freebsd-arm-cgo), const RTF_LLDATA = 1024 +pkg syscall (freebsd-arm-cgo), const RTF_LLINFO = 1024 +pkg syscall (freebsd-arm-cgo), const RTF_LOCAL = 2097152 +pkg syscall (freebsd-arm-cgo), const RTF_MODIFIED = 32 +pkg syscall (freebsd-arm-cgo), const RTF_MULTICAST = 8388608 +pkg syscall (freebsd-arm-cgo), const RTF_PINNED = 1048576 +pkg syscall (freebsd-arm-cgo), const RTF_PRCLONING = 65536 +pkg syscall (freebsd-arm-cgo), const RTF_PROTO1 = 32768 +pkg syscall (freebsd-arm-cgo), const RTF_PROTO2 = 16384 +pkg syscall (freebsd-arm-cgo), const RTF_PROTO3 = 262144 +pkg syscall (freebsd-arm-cgo), const RTF_REJECT = 8 +pkg syscall (freebsd-arm-cgo), const RTF_RNH_LOCKED = 1073741824 +pkg syscall (freebsd-arm-cgo), const RTF_STATIC = 2048 +pkg syscall (freebsd-arm-cgo), const RTF_STICKY = 268435456 +pkg syscall (freebsd-arm-cgo), const RTF_UP = 1 +pkg syscall (freebsd-arm-cgo), const RTF_XRESOLVE = 512 +pkg syscall (freebsd-arm-cgo), const RTM_ADD = 1 +pkg syscall (freebsd-arm-cgo), const RTM_CHANGE = 3 +pkg syscall (freebsd-arm-cgo), const RTM_DELADDR = 13 +pkg syscall (freebsd-arm-cgo), const RTM_DELETE = 2 +pkg syscall (freebsd-arm-cgo), const RTM_DELMADDR = 16 +pkg syscall (freebsd-arm-cgo), const RTM_GET = 4 +pkg syscall (freebsd-arm-cgo), const RTM_IEEE80211 = 18 +pkg syscall (freebsd-arm-cgo), const RTM_IFANNOUNCE = 17 +pkg syscall (freebsd-arm-cgo), const RTM_IFINFO = 14 +pkg syscall (freebsd-arm-cgo), const RTM_LOCK = 8 +pkg syscall (freebsd-arm-cgo), const RTM_LOSING = 5 +pkg syscall (freebsd-arm-cgo), const RTM_MISS = 7 +pkg syscall (freebsd-arm-cgo), const RTM_NEWADDR = 12 +pkg syscall (freebsd-arm-cgo), const RTM_NEWMADDR = 15 +pkg syscall (freebsd-arm-cgo), const RTM_OLDADD = 9 +pkg syscall (freebsd-arm-cgo), const RTM_OLDDEL = 10 +pkg syscall (freebsd-arm-cgo), const RTM_REDIRECT = 6 +pkg syscall (freebsd-arm-cgo), const RTM_RESOLVE = 11 +pkg syscall (freebsd-arm-cgo), const RTM_RTTUNIT = 1000000 +pkg syscall (freebsd-arm-cgo), const RTM_VERSION = 5 +pkg syscall (freebsd-arm-cgo), const RTV_EXPIRE = 4 +pkg syscall (freebsd-arm-cgo), const RTV_HOPCOUNT = 2 +pkg syscall (freebsd-arm-cgo), const RTV_MTU = 1 +pkg syscall (freebsd-arm-cgo), const RTV_RPIPE = 8 +pkg syscall (freebsd-arm-cgo), const RTV_RTT = 64 +pkg syscall (freebsd-arm-cgo), const RTV_RTTVAR = 128 +pkg syscall (freebsd-arm-cgo), const RTV_SPIPE = 16 +pkg syscall (freebsd-arm-cgo), const RTV_SSTHRESH = 32 +pkg syscall (freebsd-arm-cgo), const RTV_WEIGHT = 256 +pkg syscall (freebsd-arm-cgo), const RT_CACHING_CONTEXT = 1 +pkg syscall (freebsd-arm-cgo), const RT_DEFAULT_FIB = 0 +pkg syscall (freebsd-arm-cgo), const RT_NORTREF = 2 +pkg syscall (freebsd-arm-cgo), const RUSAGE_CHILDREN = -1 +pkg syscall (freebsd-arm-cgo), const RUSAGE_SELF = 0 +pkg syscall (freebsd-arm-cgo), const RUSAGE_THREAD = 1 +pkg syscall (freebsd-arm-cgo), const SCM_BINTIME = 4 +pkg syscall (freebsd-arm-cgo), const SCM_CREDS = 3 +pkg syscall (freebsd-arm-cgo), const SCM_RIGHTS = 1 +pkg syscall (freebsd-arm-cgo), const SCM_TIMESTAMP = 2 +pkg syscall (freebsd-arm-cgo), const SIGBUS = 10 +pkg syscall (freebsd-arm-cgo), const SIGCHLD = 20 +pkg syscall (freebsd-arm-cgo), const SIGCONT = 19 +pkg syscall (freebsd-arm-cgo), const SIGEMT = 7 +pkg syscall (freebsd-arm-cgo), const SIGINFO = 29 +pkg syscall (freebsd-arm-cgo), const SIGIO = 23 +pkg syscall (freebsd-arm-cgo), const SIGIOT = 6 +pkg syscall (freebsd-arm-cgo), const SIGLIBRT = 33 +pkg syscall (freebsd-arm-cgo), const SIGLWP = 32 +pkg syscall (freebsd-arm-cgo), const SIGPROF = 27 +pkg syscall (freebsd-arm-cgo), const SIGSTOP = 17 +pkg syscall (freebsd-arm-cgo), const SIGSYS = 12 +pkg syscall (freebsd-arm-cgo), const SIGTHR = 32 +pkg syscall (freebsd-arm-cgo), const SIGTSTP = 18 +pkg syscall (freebsd-arm-cgo), const SIGTTIN = 21 +pkg syscall (freebsd-arm-cgo), const SIGTTOU = 22 +pkg syscall (freebsd-arm-cgo), const SIGURG = 16 +pkg syscall (freebsd-arm-cgo), const SIGUSR1 = 30 +pkg syscall (freebsd-arm-cgo), const SIGUSR2 = 31 +pkg syscall (freebsd-arm-cgo), const SIGVTALRM = 26 +pkg syscall (freebsd-arm-cgo), const SIGWINCH = 28 +pkg syscall (freebsd-arm-cgo), const SIGXCPU = 24 +pkg syscall (freebsd-arm-cgo), const SIGXFSZ = 25 +pkg syscall (freebsd-arm-cgo), const SIOCADDMULTI = 2149607729 +pkg syscall (freebsd-arm-cgo), const SIOCADDRT = 2150658570 +pkg syscall (freebsd-arm-cgo), const SIOCAIFADDR = 2151967019 +pkg syscall (freebsd-arm-cgo), const SIOCAIFGROUP = 2149869959 +pkg syscall (freebsd-arm-cgo), const SIOCALIFADDR = 2165860635 +pkg syscall (freebsd-arm-cgo), const SIOCATMARK = 1074033415 +pkg syscall (freebsd-arm-cgo), const SIOCDELMULTI = 2149607730 +pkg syscall (freebsd-arm-cgo), const SIOCDELRT = 2150658571 +pkg syscall (freebsd-arm-cgo), const SIOCDIFADDR = 2149607705 +pkg syscall (freebsd-arm-cgo), const SIOCDIFGROUP = 2149869961 +pkg syscall (freebsd-arm-cgo), const SIOCDIFPHYADDR = 2149607753 +pkg syscall (freebsd-arm-cgo), const SIOCDLIFADDR = 2165860637 +pkg syscall (freebsd-arm-cgo), const SIOCGDRVSPEC = 3223087483 +pkg syscall (freebsd-arm-cgo), const SIOCGETSGCNT = 3222565392 +pkg syscall (freebsd-arm-cgo), const SIOCGETVIFCNT = 3222565391 +pkg syscall (freebsd-arm-cgo), const SIOCGHIWAT = 1074033409 +pkg syscall (freebsd-arm-cgo), const SIOCGIFADDR = 3223349537 +pkg syscall (freebsd-arm-cgo), const SIOCGIFBRDADDR = 3223349539 +pkg syscall (freebsd-arm-cgo), const SIOCGIFCAP = 3223349535 +pkg syscall (freebsd-arm-cgo), const SIOCGIFCONF = 3221776676 +pkg syscall (freebsd-arm-cgo), const SIOCGIFDESCR = 3223349546 +pkg syscall (freebsd-arm-cgo), const SIOCGIFDSTADDR = 3223349538 +pkg syscall (freebsd-arm-cgo), const SIOCGIFFIB = 3223349596 +pkg syscall (freebsd-arm-cgo), const SIOCGIFFLAGS = 3223349521 +pkg syscall (freebsd-arm-cgo), const SIOCGIFGENERIC = 3223349562 +pkg syscall (freebsd-arm-cgo), const SIOCGIFGMEMB = 3223611786 +pkg syscall (freebsd-arm-cgo), const SIOCGIFGROUP = 3223611784 +pkg syscall (freebsd-arm-cgo), const SIOCGIFINDEX = 3223349536 +pkg syscall (freebsd-arm-cgo), const SIOCGIFMAC = 3223349542 +pkg syscall (freebsd-arm-cgo), const SIOCGIFMEDIA = 3223873848 +pkg syscall (freebsd-arm-cgo), const SIOCGIFMETRIC = 3223349527 +pkg syscall (freebsd-arm-cgo), const SIOCGIFMTU = 3223349555 +pkg syscall (freebsd-arm-cgo), const SIOCGIFNETMASK = 3223349541 +pkg syscall (freebsd-arm-cgo), const SIOCGIFPDSTADDR = 3223349576 +pkg syscall (freebsd-arm-cgo), const SIOCGIFPHYS = 3223349557 +pkg syscall (freebsd-arm-cgo), const SIOCGIFPSRCADDR = 3223349575 +pkg syscall (freebsd-arm-cgo), const SIOCGIFSTATUS = 3274991931 +pkg syscall (freebsd-arm-cgo), const SIOCGLIFADDR = 3239602460 +pkg syscall (freebsd-arm-cgo), const SIOCGLIFPHYADDR = 3239602507 +pkg syscall (freebsd-arm-cgo), const SIOCGLOWAT = 1074033411 +pkg syscall (freebsd-arm-cgo), const SIOCGPGRP = 1074033417 +pkg syscall (freebsd-arm-cgo), const SIOCGPRIVATE_0 = 3223349584 +pkg syscall (freebsd-arm-cgo), const SIOCGPRIVATE_1 = 3223349585 +pkg syscall (freebsd-arm-cgo), const SIOCIFCREATE = 3223349626 +pkg syscall (freebsd-arm-cgo), const SIOCIFCREATE2 = 3223349628 +pkg syscall (freebsd-arm-cgo), const SIOCIFDESTROY = 2149607801 +pkg syscall (freebsd-arm-cgo), const SIOCIFGCLONERS = 3222038904 +pkg syscall (freebsd-arm-cgo), const SIOCSDRVSPEC = 2149345659 +pkg syscall (freebsd-arm-cgo), const SIOCSHIWAT = 2147775232 +pkg syscall (freebsd-arm-cgo), const SIOCSIFADDR = 2149607692 +pkg syscall (freebsd-arm-cgo), const SIOCSIFBRDADDR = 2149607699 +pkg syscall (freebsd-arm-cgo), const SIOCSIFCAP = 2149607710 +pkg syscall (freebsd-arm-cgo), const SIOCSIFDESCR = 2149607721 +pkg syscall (freebsd-arm-cgo), const SIOCSIFDSTADDR = 2149607694 +pkg syscall (freebsd-arm-cgo), const SIOCSIFFIB = 2149607773 +pkg syscall (freebsd-arm-cgo), const SIOCSIFFLAGS = 2149607696 +pkg syscall (freebsd-arm-cgo), const SIOCSIFGENERIC = 2149607737 +pkg syscall (freebsd-arm-cgo), const SIOCSIFLLADDR = 2149607740 +pkg syscall (freebsd-arm-cgo), const SIOCSIFMAC = 2149607719 +pkg syscall (freebsd-arm-cgo), const SIOCSIFMEDIA = 3223349559 +pkg syscall (freebsd-arm-cgo), const SIOCSIFMETRIC = 2149607704 +pkg syscall (freebsd-arm-cgo), const SIOCSIFMTU = 2149607732 +pkg syscall (freebsd-arm-cgo), const SIOCSIFNAME = 2149607720 +pkg syscall (freebsd-arm-cgo), const SIOCSIFNETMASK = 2149607702 +pkg syscall (freebsd-arm-cgo), const SIOCSIFPHYADDR = 2151967046 +pkg syscall (freebsd-arm-cgo), const SIOCSIFPHYS = 2149607734 +pkg syscall (freebsd-arm-cgo), const SIOCSIFRVNET = 3223349595 +pkg syscall (freebsd-arm-cgo), const SIOCSIFVNET = 3223349594 +pkg syscall (freebsd-arm-cgo), const SIOCSLIFPHYADDR = 2165860682 +pkg syscall (freebsd-arm-cgo), const SIOCSLOWAT = 2147775234 +pkg syscall (freebsd-arm-cgo), const SIOCSPGRP = 2147775240 +pkg syscall (freebsd-arm-cgo), const SOCK_MAXADDRLEN = 255 +pkg syscall (freebsd-arm-cgo), const SOCK_RDM = 4 +pkg syscall (freebsd-arm-cgo), const SOL_SOCKET = 65535 +pkg syscall (freebsd-arm-cgo), const SOMAXCONN = 128 +pkg syscall (freebsd-arm-cgo), const SO_ACCEPTCONN = 2 +pkg syscall (freebsd-arm-cgo), const SO_ACCEPTFILTER = 4096 +pkg syscall (freebsd-arm-cgo), const SO_BINTIME = 8192 +pkg syscall (freebsd-arm-cgo), const SO_BROADCAST = 32 +pkg syscall (freebsd-arm-cgo), const SO_DEBUG = 1 +pkg syscall (freebsd-arm-cgo), const SO_DONTROUTE = 16 +pkg syscall (freebsd-arm-cgo), const SO_ERROR = 4103 +pkg syscall (freebsd-arm-cgo), const SO_KEEPALIVE = 8 +pkg syscall (freebsd-arm-cgo), const SO_LABEL = 4105 +pkg syscall (freebsd-arm-cgo), const SO_LINGER = 128 +pkg syscall (freebsd-arm-cgo), const SO_LISTENINCQLEN = 4115 +pkg syscall (freebsd-arm-cgo), const SO_LISTENQLEN = 4114 +pkg syscall (freebsd-arm-cgo), const SO_LISTENQLIMIT = 4113 +pkg syscall (freebsd-arm-cgo), const SO_NOSIGPIPE = 2048 +pkg syscall (freebsd-arm-cgo), const SO_NO_DDP = 32768 +pkg syscall (freebsd-arm-cgo), const SO_NO_OFFLOAD = 16384 +pkg syscall (freebsd-arm-cgo), const SO_OOBINLINE = 256 +pkg syscall (freebsd-arm-cgo), const SO_PEERLABEL = 4112 +pkg syscall (freebsd-arm-cgo), const SO_PROTOCOL = 4118 +pkg syscall (freebsd-arm-cgo), const SO_PROTOTYPE = 4118 +pkg syscall (freebsd-arm-cgo), const SO_RCVBUF = 4098 +pkg syscall (freebsd-arm-cgo), const SO_RCVLOWAT = 4100 +pkg syscall (freebsd-arm-cgo), const SO_RCVTIMEO = 4102 +pkg syscall (freebsd-arm-cgo), const SO_REUSEADDR = 4 +pkg syscall (freebsd-arm-cgo), const SO_REUSEPORT = 512 +pkg syscall (freebsd-arm-cgo), const SO_SETFIB = 4116 +pkg syscall (freebsd-arm-cgo), const SO_SNDBUF = 4097 +pkg syscall (freebsd-arm-cgo), const SO_SNDLOWAT = 4099 +pkg syscall (freebsd-arm-cgo), const SO_SNDTIMEO = 4101 +pkg syscall (freebsd-arm-cgo), const SO_TIMESTAMP = 1024 +pkg syscall (freebsd-arm-cgo), const SO_TYPE = 4104 +pkg syscall (freebsd-arm-cgo), const SO_USELOOPBACK = 64 +pkg syscall (freebsd-arm-cgo), const SO_USER_COOKIE = 4117 +pkg syscall (freebsd-arm-cgo), const SYS_ABORT2 = 463 +pkg syscall (freebsd-arm-cgo), const SYS_ACCEPT = 30 +pkg syscall (freebsd-arm-cgo), const SYS_ACCESS = 33 +pkg syscall (freebsd-arm-cgo), const SYS_ACCT = 51 +pkg syscall (freebsd-arm-cgo), const SYS_ADJTIME = 140 +pkg syscall (freebsd-arm-cgo), const SYS_AUDIT = 445 +pkg syscall (freebsd-arm-cgo), const SYS_AUDITCTL = 453 +pkg syscall (freebsd-arm-cgo), const SYS_AUDITON = 446 +pkg syscall (freebsd-arm-cgo), const SYS_BIND = 104 +pkg syscall (freebsd-arm-cgo), const SYS_CAP_ENTER = 516 +pkg syscall (freebsd-arm-cgo), const SYS_CAP_FCNTLS_GET = 537 +pkg syscall (freebsd-arm-cgo), const SYS_CAP_FCNTLS_LIMIT = 536 +pkg syscall (freebsd-arm-cgo), const SYS_CAP_GETMODE = 517 +pkg syscall (freebsd-arm-cgo), const SYS_CAP_IOCTLS_GET = 535 +pkg syscall (freebsd-arm-cgo), const SYS_CAP_IOCTLS_LIMIT = 534 +pkg syscall (freebsd-arm-cgo), const SYS_CAP_NEW = 514 +pkg syscall (freebsd-arm-cgo), const SYS_CAP_RIGHTS_GET = 515 +pkg syscall (freebsd-arm-cgo), const SYS_CAP_RIGHTS_LIMIT = 533 +pkg syscall (freebsd-arm-cgo), const SYS_CHDIR = 12 +pkg syscall (freebsd-arm-cgo), const SYS_CHFLAGS = 34 +pkg syscall (freebsd-arm-cgo), const SYS_CHMOD = 15 +pkg syscall (freebsd-arm-cgo), const SYS_CHOWN = 16 +pkg syscall (freebsd-arm-cgo), const SYS_CHROOT = 61 +pkg syscall (freebsd-arm-cgo), const SYS_CLOCK_GETCPUCLOCKID2 = 247 +pkg syscall (freebsd-arm-cgo), const SYS_CLOCK_GETRES = 234 +pkg syscall (freebsd-arm-cgo), const SYS_CLOCK_GETTIME = 232 +pkg syscall (freebsd-arm-cgo), const SYS_CLOCK_SETTIME = 233 +pkg syscall (freebsd-arm-cgo), const SYS_CLOSE = 6 +pkg syscall (freebsd-arm-cgo), const SYS_CLOSEFROM = 509 +pkg syscall (freebsd-arm-cgo), const SYS_CONNECT = 98 +pkg syscall (freebsd-arm-cgo), const SYS_CPUSET = 484 +pkg syscall (freebsd-arm-cgo), const SYS_CPUSET_GETAFFINITY = 487 +pkg syscall (freebsd-arm-cgo), const SYS_CPUSET_GETID = 486 +pkg syscall (freebsd-arm-cgo), const SYS_CPUSET_SETAFFINITY = 488 +pkg syscall (freebsd-arm-cgo), const SYS_CPUSET_SETID = 485 +pkg syscall (freebsd-arm-cgo), const SYS_DUP = 41 +pkg syscall (freebsd-arm-cgo), const SYS_DUP2 = 90 +pkg syscall (freebsd-arm-cgo), const SYS_EACCESS = 376 +pkg syscall (freebsd-arm-cgo), const SYS_EXECVE = 59 +pkg syscall (freebsd-arm-cgo), const SYS_EXIT = 1 +pkg syscall (freebsd-arm-cgo), const SYS_EXTATTRCTL = 355 +pkg syscall (freebsd-arm-cgo), const SYS_EXTATTR_DELETE_FD = 373 +pkg syscall (freebsd-arm-cgo), const SYS_EXTATTR_DELETE_FILE = 358 +pkg syscall (freebsd-arm-cgo), const SYS_EXTATTR_DELETE_LINK = 414 +pkg syscall (freebsd-arm-cgo), const SYS_EXTATTR_GET_FD = 372 +pkg syscall (freebsd-arm-cgo), const SYS_EXTATTR_GET_FILE = 357 +pkg syscall (freebsd-arm-cgo), const SYS_EXTATTR_GET_LINK = 413 +pkg syscall (freebsd-arm-cgo), const SYS_EXTATTR_LIST_FD = 437 +pkg syscall (freebsd-arm-cgo), const SYS_EXTATTR_LIST_FILE = 438 +pkg syscall (freebsd-arm-cgo), const SYS_EXTATTR_LIST_LINK = 439 +pkg syscall (freebsd-arm-cgo), const SYS_EXTATTR_SET_FD = 371 +pkg syscall (freebsd-arm-cgo), const SYS_EXTATTR_SET_FILE = 356 +pkg syscall (freebsd-arm-cgo), const SYS_EXTATTR_SET_LINK = 412 +pkg syscall (freebsd-arm-cgo), const SYS_FACCESSAT = 489 +pkg syscall (freebsd-arm-cgo), const SYS_FCHDIR = 13 +pkg syscall (freebsd-arm-cgo), const SYS_FCHFLAGS = 35 +pkg syscall (freebsd-arm-cgo), const SYS_FCHMOD = 124 +pkg syscall (freebsd-arm-cgo), const SYS_FCHMODAT = 490 +pkg syscall (freebsd-arm-cgo), const SYS_FCHOWN = 123 +pkg syscall (freebsd-arm-cgo), const SYS_FCHOWNAT = 491 +pkg syscall (freebsd-arm-cgo), const SYS_FCNTL = 92 +pkg syscall (freebsd-arm-cgo), const SYS_FEXECVE = 492 +pkg syscall (freebsd-arm-cgo), const SYS_FFCLOCK_GETCOUNTER = 241 +pkg syscall (freebsd-arm-cgo), const SYS_FFCLOCK_GETESTIMATE = 243 +pkg syscall (freebsd-arm-cgo), const SYS_FFCLOCK_SETESTIMATE = 242 +pkg syscall (freebsd-arm-cgo), const SYS_FHOPEN = 298 +pkg syscall (freebsd-arm-cgo), const SYS_FHSTAT = 299 +pkg syscall (freebsd-arm-cgo), const SYS_FHSTATFS = 398 +pkg syscall (freebsd-arm-cgo), const SYS_FLOCK = 131 +pkg syscall (freebsd-arm-cgo), const SYS_FORK = 2 +pkg syscall (freebsd-arm-cgo), const SYS_FPATHCONF = 192 +pkg syscall (freebsd-arm-cgo), const SYS_FREEBSD6_FTRUNCATE = 201 +pkg syscall (freebsd-arm-cgo), const SYS_FREEBSD6_LSEEK = 199 +pkg syscall (freebsd-arm-cgo), const SYS_FREEBSD6_MMAP = 197 +pkg syscall (freebsd-arm-cgo), const SYS_FREEBSD6_PREAD = 173 +pkg syscall (freebsd-arm-cgo), const SYS_FREEBSD6_PWRITE = 174 +pkg syscall (freebsd-arm-cgo), const SYS_FREEBSD6_TRUNCATE = 200 +pkg syscall (freebsd-arm-cgo), const SYS_FSTAT = 189 +pkg syscall (freebsd-arm-cgo), const SYS_FSTATAT = 493 +pkg syscall (freebsd-arm-cgo), const SYS_FSTATFS = 397 +pkg syscall (freebsd-arm-cgo), const SYS_FSYNC = 95 +pkg syscall (freebsd-arm-cgo), const SYS_FTRUNCATE = 480 +pkg syscall (freebsd-arm-cgo), const SYS_FUTIMES = 206 +pkg syscall (freebsd-arm-cgo), const SYS_FUTIMESAT = 494 +pkg syscall (freebsd-arm-cgo), const SYS_GETAUDIT = 449 +pkg syscall (freebsd-arm-cgo), const SYS_GETAUDIT_ADDR = 451 +pkg syscall (freebsd-arm-cgo), const SYS_GETAUID = 447 +pkg syscall (freebsd-arm-cgo), const SYS_GETCONTEXT = 421 +pkg syscall (freebsd-arm-cgo), const SYS_GETDENTS = 272 +pkg syscall (freebsd-arm-cgo), const SYS_GETDIRENTRIES = 196 +pkg syscall (freebsd-arm-cgo), const SYS_GETDTABLESIZE = 89 +pkg syscall (freebsd-arm-cgo), const SYS_GETEGID = 43 +pkg syscall (freebsd-arm-cgo), const SYS_GETEUID = 25 +pkg syscall (freebsd-arm-cgo), const SYS_GETFH = 161 +pkg syscall (freebsd-arm-cgo), const SYS_GETFSSTAT = 395 +pkg syscall (freebsd-arm-cgo), const SYS_GETGID = 47 +pkg syscall (freebsd-arm-cgo), const SYS_GETGROUPS = 79 +pkg syscall (freebsd-arm-cgo), const SYS_GETITIMER = 86 +pkg syscall (freebsd-arm-cgo), const SYS_GETLOGIN = 49 +pkg syscall (freebsd-arm-cgo), const SYS_GETLOGINCLASS = 523 +pkg syscall (freebsd-arm-cgo), const SYS_GETPEERNAME = 31 +pkg syscall (freebsd-arm-cgo), const SYS_GETPGID = 207 +pkg syscall (freebsd-arm-cgo), const SYS_GETPGRP = 81 +pkg syscall (freebsd-arm-cgo), const SYS_GETPID = 20 +pkg syscall (freebsd-arm-cgo), const SYS_GETPPID = 39 +pkg syscall (freebsd-arm-cgo), const SYS_GETPRIORITY = 100 +pkg syscall (freebsd-arm-cgo), const SYS_GETRESGID = 361 +pkg syscall (freebsd-arm-cgo), const SYS_GETRESUID = 360 +pkg syscall (freebsd-arm-cgo), const SYS_GETRLIMIT = 194 +pkg syscall (freebsd-arm-cgo), const SYS_GETRUSAGE = 117 +pkg syscall (freebsd-arm-cgo), const SYS_GETSID = 310 +pkg syscall (freebsd-arm-cgo), const SYS_GETSOCKNAME = 32 +pkg syscall (freebsd-arm-cgo), const SYS_GETSOCKOPT = 118 +pkg syscall (freebsd-arm-cgo), const SYS_GETTIMEOFDAY = 116 +pkg syscall (freebsd-arm-cgo), const SYS_GETUID = 24 +pkg syscall (freebsd-arm-cgo), const SYS_IOCTL = 54 +pkg syscall (freebsd-arm-cgo), const SYS_ISSETUGID = 253 +pkg syscall (freebsd-arm-cgo), const SYS_JAIL = 338 +pkg syscall (freebsd-arm-cgo), const SYS_JAIL_ATTACH = 436 +pkg syscall (freebsd-arm-cgo), const SYS_JAIL_GET = 506 +pkg syscall (freebsd-arm-cgo), const SYS_JAIL_REMOVE = 508 +pkg syscall (freebsd-arm-cgo), const SYS_JAIL_SET = 507 +pkg syscall (freebsd-arm-cgo), const SYS_KENV = 390 +pkg syscall (freebsd-arm-cgo), const SYS_KEVENT = 363 +pkg syscall (freebsd-arm-cgo), const SYS_KILL = 37 +pkg syscall (freebsd-arm-cgo), const SYS_KLDFIND = 306 +pkg syscall (freebsd-arm-cgo), const SYS_KLDFIRSTMOD = 309 +pkg syscall (freebsd-arm-cgo), const SYS_KLDLOAD = 304 +pkg syscall (freebsd-arm-cgo), const SYS_KLDNEXT = 307 +pkg syscall (freebsd-arm-cgo), const SYS_KLDSTAT = 308 +pkg syscall (freebsd-arm-cgo), const SYS_KLDSYM = 337 +pkg syscall (freebsd-arm-cgo), const SYS_KLDUNLOAD = 305 +pkg syscall (freebsd-arm-cgo), const SYS_KLDUNLOADF = 444 +pkg syscall (freebsd-arm-cgo), const SYS_KQUEUE = 362 +pkg syscall (freebsd-arm-cgo), const SYS_KTIMER_CREATE = 235 +pkg syscall (freebsd-arm-cgo), const SYS_KTIMER_DELETE = 236 +pkg syscall (freebsd-arm-cgo), const SYS_KTIMER_GETOVERRUN = 239 +pkg syscall (freebsd-arm-cgo), const SYS_KTIMER_GETTIME = 238 +pkg syscall (freebsd-arm-cgo), const SYS_KTIMER_SETTIME = 237 +pkg syscall (freebsd-arm-cgo), const SYS_KTRACE = 45 +pkg syscall (freebsd-arm-cgo), const SYS_LCHFLAGS = 391 +pkg syscall (freebsd-arm-cgo), const SYS_LCHMOD = 274 +pkg syscall (freebsd-arm-cgo), const SYS_LCHOWN = 254 +pkg syscall (freebsd-arm-cgo), const SYS_LGETFH = 160 +pkg syscall (freebsd-arm-cgo), const SYS_LINK = 9 +pkg syscall (freebsd-arm-cgo), const SYS_LINKAT = 495 +pkg syscall (freebsd-arm-cgo), const SYS_LISTEN = 106 +pkg syscall (freebsd-arm-cgo), const SYS_LPATHCONF = 513 +pkg syscall (freebsd-arm-cgo), const SYS_LSEEK = 478 +pkg syscall (freebsd-arm-cgo), const SYS_LSTAT = 190 +pkg syscall (freebsd-arm-cgo), const SYS_LUTIMES = 276 +pkg syscall (freebsd-arm-cgo), const SYS_MAC_SYSCALL = 394 +pkg syscall (freebsd-arm-cgo), const SYS_MADVISE = 75 +pkg syscall (freebsd-arm-cgo), const SYS_MINCORE = 78 +pkg syscall (freebsd-arm-cgo), const SYS_MINHERIT = 250 +pkg syscall (freebsd-arm-cgo), const SYS_MKDIR = 136 +pkg syscall (freebsd-arm-cgo), const SYS_MKDIRAT = 496 +pkg syscall (freebsd-arm-cgo), const SYS_MKFIFO = 132 +pkg syscall (freebsd-arm-cgo), const SYS_MKFIFOAT = 497 +pkg syscall (freebsd-arm-cgo), const SYS_MKNOD = 14 +pkg syscall (freebsd-arm-cgo), const SYS_MKNODAT = 498 +pkg syscall (freebsd-arm-cgo), const SYS_MLOCK = 203 +pkg syscall (freebsd-arm-cgo), const SYS_MLOCKALL = 324 +pkg syscall (freebsd-arm-cgo), const SYS_MMAP = 477 +pkg syscall (freebsd-arm-cgo), const SYS_MODFIND = 303 +pkg syscall (freebsd-arm-cgo), const SYS_MODFNEXT = 302 +pkg syscall (freebsd-arm-cgo), const SYS_MODNEXT = 300 +pkg syscall (freebsd-arm-cgo), const SYS_MODSTAT = 301 +pkg syscall (freebsd-arm-cgo), const SYS_MOUNT = 21 +pkg syscall (freebsd-arm-cgo), const SYS_MPROTECT = 74 +pkg syscall (freebsd-arm-cgo), const SYS_MSYNC = 65 +pkg syscall (freebsd-arm-cgo), const SYS_MUNLOCK = 204 +pkg syscall (freebsd-arm-cgo), const SYS_MUNLOCKALL = 325 +pkg syscall (freebsd-arm-cgo), const SYS_MUNMAP = 73 +pkg syscall (freebsd-arm-cgo), const SYS_NANOSLEEP = 240 +pkg syscall (freebsd-arm-cgo), const SYS_NFSTAT = 279 +pkg syscall (freebsd-arm-cgo), const SYS_NLSTAT = 280 +pkg syscall (freebsd-arm-cgo), const SYS_NMOUNT = 378 +pkg syscall (freebsd-arm-cgo), const SYS_NSTAT = 278 +pkg syscall (freebsd-arm-cgo), const SYS_NTP_ADJTIME = 176 +pkg syscall (freebsd-arm-cgo), const SYS_NTP_GETTIME = 248 +pkg syscall (freebsd-arm-cgo), const SYS_OBREAK = 17 +pkg syscall (freebsd-arm-cgo), const SYS_OPEN = 5 +pkg syscall (freebsd-arm-cgo), const SYS_OPENAT = 499 +pkg syscall (freebsd-arm-cgo), const SYS_OPENBSD_POLL = 252 +pkg syscall (freebsd-arm-cgo), const SYS_OVADVISE = 72 +pkg syscall (freebsd-arm-cgo), const SYS_PATHCONF = 191 +pkg syscall (freebsd-arm-cgo), const SYS_PDFORK = 518 +pkg syscall (freebsd-arm-cgo), const SYS_PDGETPID = 520 +pkg syscall (freebsd-arm-cgo), const SYS_PDKILL = 519 +pkg syscall (freebsd-arm-cgo), const SYS_PIPE = 42 +pkg syscall (freebsd-arm-cgo), const SYS_POLL = 209 +pkg syscall (freebsd-arm-cgo), const SYS_POSIX_FADVISE = 531 +pkg syscall (freebsd-arm-cgo), const SYS_POSIX_FALLOCATE = 530 +pkg syscall (freebsd-arm-cgo), const SYS_POSIX_OPENPT = 504 +pkg syscall (freebsd-arm-cgo), const SYS_PREAD = 475 +pkg syscall (freebsd-arm-cgo), const SYS_PREADV = 289 +pkg syscall (freebsd-arm-cgo), const SYS_PROFIL = 44 +pkg syscall (freebsd-arm-cgo), const SYS_PSELECT = 522 +pkg syscall (freebsd-arm-cgo), const SYS_PTRACE = 26 +pkg syscall (freebsd-arm-cgo), const SYS_PWRITE = 476 +pkg syscall (freebsd-arm-cgo), const SYS_PWRITEV = 290 +pkg syscall (freebsd-arm-cgo), const SYS_QUOTACTL = 148 +pkg syscall (freebsd-arm-cgo), const SYS_RCTL_ADD_RULE = 528 +pkg syscall (freebsd-arm-cgo), const SYS_RCTL_GET_LIMITS = 527 +pkg syscall (freebsd-arm-cgo), const SYS_RCTL_GET_RACCT = 525 +pkg syscall (freebsd-arm-cgo), const SYS_RCTL_GET_RULES = 526 +pkg syscall (freebsd-arm-cgo), const SYS_RCTL_REMOVE_RULE = 529 +pkg syscall (freebsd-arm-cgo), const SYS_READ = 3 +pkg syscall (freebsd-arm-cgo), const SYS_READLINK = 58 +pkg syscall (freebsd-arm-cgo), const SYS_READLINKAT = 500 +pkg syscall (freebsd-arm-cgo), const SYS_READV = 120 +pkg syscall (freebsd-arm-cgo), const SYS_REBOOT = 55 +pkg syscall (freebsd-arm-cgo), const SYS_RECVFROM = 29 +pkg syscall (freebsd-arm-cgo), const SYS_RECVMSG = 27 +pkg syscall (freebsd-arm-cgo), const SYS_RENAME = 128 +pkg syscall (freebsd-arm-cgo), const SYS_RENAMEAT = 501 +pkg syscall (freebsd-arm-cgo), const SYS_REVOKE = 56 +pkg syscall (freebsd-arm-cgo), const SYS_RFORK = 251 +pkg syscall (freebsd-arm-cgo), const SYS_RMDIR = 137 +pkg syscall (freebsd-arm-cgo), const SYS_RTPRIO = 166 +pkg syscall (freebsd-arm-cgo), const SYS_RTPRIO_THREAD = 466 +pkg syscall (freebsd-arm-cgo), const SYS_SBRK = 69 +pkg syscall (freebsd-arm-cgo), const SYS_SCHED_GETPARAM = 328 +pkg syscall (freebsd-arm-cgo), const SYS_SCHED_GETSCHEDULER = 330 +pkg syscall (freebsd-arm-cgo), const SYS_SCHED_GET_PRIORITY_MAX = 332 +pkg syscall (freebsd-arm-cgo), const SYS_SCHED_GET_PRIORITY_MIN = 333 +pkg syscall (freebsd-arm-cgo), const SYS_SCHED_RR_GET_INTERVAL = 334 +pkg syscall (freebsd-arm-cgo), const SYS_SCHED_SETPARAM = 327 +pkg syscall (freebsd-arm-cgo), const SYS_SCHED_SETSCHEDULER = 329 +pkg syscall (freebsd-arm-cgo), const SYS_SCHED_YIELD = 331 +pkg syscall (freebsd-arm-cgo), const SYS_SCTP_GENERIC_RECVMSG = 474 +pkg syscall (freebsd-arm-cgo), const SYS_SCTP_GENERIC_SENDMSG = 472 +pkg syscall (freebsd-arm-cgo), const SYS_SCTP_GENERIC_SENDMSG_IOV = 473 +pkg syscall (freebsd-arm-cgo), const SYS_SCTP_PEELOFF = 471 +pkg syscall (freebsd-arm-cgo), const SYS_SELECT = 93 +pkg syscall (freebsd-arm-cgo), const SYS_SENDFILE = 393 +pkg syscall (freebsd-arm-cgo), const SYS_SENDMSG = 28 +pkg syscall (freebsd-arm-cgo), const SYS_SENDTO = 133 +pkg syscall (freebsd-arm-cgo), const SYS_SETAUDIT = 450 +pkg syscall (freebsd-arm-cgo), const SYS_SETAUDIT_ADDR = 452 +pkg syscall (freebsd-arm-cgo), const SYS_SETAUID = 448 +pkg syscall (freebsd-arm-cgo), const SYS_SETCONTEXT = 422 +pkg syscall (freebsd-arm-cgo), const SYS_SETEGID = 182 +pkg syscall (freebsd-arm-cgo), const SYS_SETEUID = 183 +pkg syscall (freebsd-arm-cgo), const SYS_SETFIB = 175 +pkg syscall (freebsd-arm-cgo), const SYS_SETGID = 181 +pkg syscall (freebsd-arm-cgo), const SYS_SETGROUPS = 80 +pkg syscall (freebsd-arm-cgo), const SYS_SETITIMER = 83 +pkg syscall (freebsd-arm-cgo), const SYS_SETLOGIN = 50 +pkg syscall (freebsd-arm-cgo), const SYS_SETLOGINCLASS = 524 +pkg syscall (freebsd-arm-cgo), const SYS_SETPGID = 82 +pkg syscall (freebsd-arm-cgo), const SYS_SETPRIORITY = 96 +pkg syscall (freebsd-arm-cgo), const SYS_SETREGID = 127 +pkg syscall (freebsd-arm-cgo), const SYS_SETRESGID = 312 +pkg syscall (freebsd-arm-cgo), const SYS_SETRESUID = 311 +pkg syscall (freebsd-arm-cgo), const SYS_SETREUID = 126 +pkg syscall (freebsd-arm-cgo), const SYS_SETRLIMIT = 195 +pkg syscall (freebsd-arm-cgo), const SYS_SETSID = 147 +pkg syscall (freebsd-arm-cgo), const SYS_SETSOCKOPT = 105 +pkg syscall (freebsd-arm-cgo), const SYS_SETTIMEOFDAY = 122 +pkg syscall (freebsd-arm-cgo), const SYS_SETUID = 23 +pkg syscall (freebsd-arm-cgo), const SYS_SHM_OPEN = 482 +pkg syscall (freebsd-arm-cgo), const SYS_SHM_UNLINK = 483 +pkg syscall (freebsd-arm-cgo), const SYS_SHUTDOWN = 134 +pkg syscall (freebsd-arm-cgo), const SYS_SIGACTION = 416 +pkg syscall (freebsd-arm-cgo), const SYS_SIGALTSTACK = 53 +pkg syscall (freebsd-arm-cgo), const SYS_SIGPENDING = 343 +pkg syscall (freebsd-arm-cgo), const SYS_SIGPROCMASK = 340 +pkg syscall (freebsd-arm-cgo), const SYS_SIGQUEUE = 456 +pkg syscall (freebsd-arm-cgo), const SYS_SIGRETURN = 417 +pkg syscall (freebsd-arm-cgo), const SYS_SIGSUSPEND = 341 +pkg syscall (freebsd-arm-cgo), const SYS_SIGTIMEDWAIT = 345 +pkg syscall (freebsd-arm-cgo), const SYS_SIGWAIT = 429 +pkg syscall (freebsd-arm-cgo), const SYS_SIGWAITINFO = 346 +pkg syscall (freebsd-arm-cgo), const SYS_SOCKET = 97 +pkg syscall (freebsd-arm-cgo), const SYS_SOCKETPAIR = 135 +pkg syscall (freebsd-arm-cgo), const SYS_SSTK = 70 +pkg syscall (freebsd-arm-cgo), const SYS_STAT = 188 +pkg syscall (freebsd-arm-cgo), const SYS_STATFS = 396 +pkg syscall (freebsd-arm-cgo), const SYS_SWAPCONTEXT = 423 +pkg syscall (freebsd-arm-cgo), const SYS_SWAPOFF = 424 +pkg syscall (freebsd-arm-cgo), const SYS_SWAPON = 85 +pkg syscall (freebsd-arm-cgo), const SYS_SYMLINK = 57 +pkg syscall (freebsd-arm-cgo), const SYS_SYMLINKAT = 502 +pkg syscall (freebsd-arm-cgo), const SYS_SYNC = 36 +pkg syscall (freebsd-arm-cgo), const SYS_SYSARCH = 165 +pkg syscall (freebsd-arm-cgo), const SYS_THR_CREATE = 430 +pkg syscall (freebsd-arm-cgo), const SYS_THR_EXIT = 431 +pkg syscall (freebsd-arm-cgo), const SYS_THR_KILL = 433 +pkg syscall (freebsd-arm-cgo), const SYS_THR_KILL2 = 481 +pkg syscall (freebsd-arm-cgo), const SYS_THR_NEW = 455 +pkg syscall (freebsd-arm-cgo), const SYS_THR_SELF = 432 +pkg syscall (freebsd-arm-cgo), const SYS_THR_SET_NAME = 464 +pkg syscall (freebsd-arm-cgo), const SYS_THR_SUSPEND = 442 +pkg syscall (freebsd-arm-cgo), const SYS_THR_WAKE = 443 +pkg syscall (freebsd-arm-cgo), const SYS_TRUNCATE = 479 +pkg syscall (freebsd-arm-cgo), const SYS_UMASK = 60 +pkg syscall (freebsd-arm-cgo), const SYS_UNDELETE = 205 +pkg syscall (freebsd-arm-cgo), const SYS_UNLINK = 10 +pkg syscall (freebsd-arm-cgo), const SYS_UNLINKAT = 503 +pkg syscall (freebsd-arm-cgo), const SYS_UNMOUNT = 22 +pkg syscall (freebsd-arm-cgo), const SYS_UTIMES = 138 +pkg syscall (freebsd-arm-cgo), const SYS_UTRACE = 335 +pkg syscall (freebsd-arm-cgo), const SYS_UUIDGEN = 392 +pkg syscall (freebsd-arm-cgo), const SYS_VFORK = 66 +pkg syscall (freebsd-arm-cgo), const SYS_WAIT4 = 7 +pkg syscall (freebsd-arm-cgo), const SYS_WAIT6 = 532 +pkg syscall (freebsd-arm-cgo), const SYS_WRITE = 4 +pkg syscall (freebsd-arm-cgo), const SYS_WRITEV = 121 +pkg syscall (freebsd-arm-cgo), const SYS_YIELD = 321 +pkg syscall (freebsd-arm-cgo), const SYS__UMTX_LOCK = 434 +pkg syscall (freebsd-arm-cgo), const SYS__UMTX_OP = 454 +pkg syscall (freebsd-arm-cgo), const SYS__UMTX_UNLOCK = 435 +pkg syscall (freebsd-arm-cgo), const SYS___ACL_ACLCHECK_FD = 354 +pkg syscall (freebsd-arm-cgo), const SYS___ACL_ACLCHECK_FILE = 353 +pkg syscall (freebsd-arm-cgo), const SYS___ACL_ACLCHECK_LINK = 428 +pkg syscall (freebsd-arm-cgo), const SYS___ACL_DELETE_FD = 352 +pkg syscall (freebsd-arm-cgo), const SYS___ACL_DELETE_FILE = 351 +pkg syscall (freebsd-arm-cgo), const SYS___ACL_DELETE_LINK = 427 +pkg syscall (freebsd-arm-cgo), const SYS___ACL_GET_FD = 349 +pkg syscall (freebsd-arm-cgo), const SYS___ACL_GET_FILE = 347 +pkg syscall (freebsd-arm-cgo), const SYS___ACL_GET_LINK = 425 +pkg syscall (freebsd-arm-cgo), const SYS___ACL_SET_FD = 350 +pkg syscall (freebsd-arm-cgo), const SYS___ACL_SET_FILE = 348 +pkg syscall (freebsd-arm-cgo), const SYS___ACL_SET_LINK = 426 +pkg syscall (freebsd-arm-cgo), const SYS___GETCWD = 326 +pkg syscall (freebsd-arm-cgo), const SYS___MAC_EXECVE = 415 +pkg syscall (freebsd-arm-cgo), const SYS___MAC_GET_FD = 386 +pkg syscall (freebsd-arm-cgo), const SYS___MAC_GET_FILE = 387 +pkg syscall (freebsd-arm-cgo), const SYS___MAC_GET_LINK = 410 +pkg syscall (freebsd-arm-cgo), const SYS___MAC_GET_PID = 409 +pkg syscall (freebsd-arm-cgo), const SYS___MAC_GET_PROC = 384 +pkg syscall (freebsd-arm-cgo), const SYS___MAC_SET_FD = 388 +pkg syscall (freebsd-arm-cgo), const SYS___MAC_SET_FILE = 389 +pkg syscall (freebsd-arm-cgo), const SYS___MAC_SET_LINK = 411 +pkg syscall (freebsd-arm-cgo), const SYS___MAC_SET_PROC = 385 +pkg syscall (freebsd-arm-cgo), const SYS___SETUGID = 374 +pkg syscall (freebsd-arm-cgo), const SYS___SYSCTL = 202 +pkg syscall (freebsd-arm-cgo), const S_IFMT = 61440 +pkg syscall (freebsd-arm-cgo), const SizeofBpfHdr = 24 +pkg syscall (freebsd-arm-cgo), const SizeofBpfInsn = 8 +pkg syscall (freebsd-arm-cgo), const SizeofBpfProgram = 8 +pkg syscall (freebsd-arm-cgo), const SizeofBpfStat = 8 +pkg syscall (freebsd-arm-cgo), const SizeofBpfVersion = 4 +pkg syscall (freebsd-arm-cgo), const SizeofBpfZbuf = 12 +pkg syscall (freebsd-arm-cgo), const SizeofBpfZbufHeader = 32 +pkg syscall (freebsd-arm-cgo), const SizeofCmsghdr = 12 +pkg syscall (freebsd-arm-cgo), const SizeofIPMreq = 8 +pkg syscall (freebsd-arm-cgo), const SizeofIPMreqn = 12 +pkg syscall (freebsd-arm-cgo), const SizeofIPv6Mreq = 20 +pkg syscall (freebsd-arm-cgo), const SizeofIfAnnounceMsghdr = 24 +pkg syscall (freebsd-arm-cgo), const SizeofIfData = 88 +pkg syscall (freebsd-arm-cgo), const SizeofIfMsghdr = 104 +pkg syscall (freebsd-arm-cgo), const SizeofIfaMsghdr = 20 +pkg syscall (freebsd-arm-cgo), const SizeofIfmaMsghdr = 16 +pkg syscall (freebsd-arm-cgo), const SizeofInet6Pktinfo = 20 +pkg syscall (freebsd-arm-cgo), const SizeofLinger = 8 +pkg syscall (freebsd-arm-cgo), const SizeofMsghdr = 28 +pkg syscall (freebsd-arm-cgo), const SizeofRtMetrics = 56 +pkg syscall (freebsd-arm-cgo), const SizeofRtMsghdr = 92 +pkg syscall (freebsd-arm-cgo), const SizeofSockaddrAny = 108 +pkg syscall (freebsd-arm-cgo), const SizeofSockaddrDatalink = 56 +pkg syscall (freebsd-arm-cgo), const SizeofSockaddrInet4 = 16 +pkg syscall (freebsd-arm-cgo), const SizeofSockaddrInet6 = 28 +pkg syscall (freebsd-arm-cgo), const SizeofSockaddrUnix = 108 +pkg syscall (freebsd-arm-cgo), const TCIFLUSH = 1 +pkg syscall (freebsd-arm-cgo), const TCIOFLUSH = 3 +pkg syscall (freebsd-arm-cgo), const TCOFLUSH = 2 +pkg syscall (freebsd-arm-cgo), const TCP_CA_NAME_MAX = 16 +pkg syscall (freebsd-arm-cgo), const TCP_CONGESTION = 64 +pkg syscall (freebsd-arm-cgo), const TCP_INFO = 32 +pkg syscall (freebsd-arm-cgo), const TCP_KEEPCNT = 1024 +pkg syscall (freebsd-arm-cgo), const TCP_KEEPIDLE = 256 +pkg syscall (freebsd-arm-cgo), const TCP_KEEPINIT = 128 +pkg syscall (freebsd-arm-cgo), const TCP_KEEPINTVL = 512 +pkg syscall (freebsd-arm-cgo), const TCP_MAXBURST = 4 +pkg syscall (freebsd-arm-cgo), const TCP_MAXHLEN = 60 +pkg syscall (freebsd-arm-cgo), const TCP_MAXOLEN = 40 +pkg syscall (freebsd-arm-cgo), const TCP_MAXSEG = 2 +pkg syscall (freebsd-arm-cgo), const TCP_MAXWIN = 65535 +pkg syscall (freebsd-arm-cgo), const TCP_MAX_SACK = 4 +pkg syscall (freebsd-arm-cgo), const TCP_MAX_WINSHIFT = 14 +pkg syscall (freebsd-arm-cgo), const TCP_MD5SIG = 16 +pkg syscall (freebsd-arm-cgo), const TCP_MINMSS = 216 +pkg syscall (freebsd-arm-cgo), const TCP_MSS = 536 +pkg syscall (freebsd-arm-cgo), const TCP_NOOPT = 8 +pkg syscall (freebsd-arm-cgo), const TCP_NOPUSH = 4 +pkg syscall (freebsd-arm-cgo), const TCSAFLUSH = 2 +pkg syscall (freebsd-arm-cgo), const TIOCCBRK = 536900730 +pkg syscall (freebsd-arm-cgo), const TIOCCDTR = 536900728 +pkg syscall (freebsd-arm-cgo), const TIOCCONS = 2147775586 +pkg syscall (freebsd-arm-cgo), const TIOCDRAIN = 536900702 +pkg syscall (freebsd-arm-cgo), const TIOCEXCL = 536900621 +pkg syscall (freebsd-arm-cgo), const TIOCEXT = 2147775584 +pkg syscall (freebsd-arm-cgo), const TIOCFLUSH = 2147775504 +pkg syscall (freebsd-arm-cgo), const TIOCGDRAINWAIT = 1074033750 +pkg syscall (freebsd-arm-cgo), const TIOCGETA = 1076655123 +pkg syscall (freebsd-arm-cgo), const TIOCGETD = 1074033690 +pkg syscall (freebsd-arm-cgo), const TIOCGPGRP = 1074033783 +pkg syscall (freebsd-arm-cgo), const TIOCGPTN = 1074033679 +pkg syscall (freebsd-arm-cgo), const TIOCGSID = 1074033763 +pkg syscall (freebsd-arm-cgo), const TIOCGWINSZ = 1074295912 +pkg syscall (freebsd-arm-cgo), const TIOCMBIC = 2147775595 +pkg syscall (freebsd-arm-cgo), const TIOCMBIS = 2147775596 +pkg syscall (freebsd-arm-cgo), const TIOCMGDTRWAIT = 1074033754 +pkg syscall (freebsd-arm-cgo), const TIOCMGET = 1074033770 +pkg syscall (freebsd-arm-cgo), const TIOCMSDTRWAIT = 2147775579 +pkg syscall (freebsd-arm-cgo), const TIOCMSET = 2147775597 +pkg syscall (freebsd-arm-cgo), const TIOCM_CAR = 64 +pkg syscall (freebsd-arm-cgo), const TIOCM_CD = 64 +pkg syscall (freebsd-arm-cgo), const TIOCM_CTS = 32 +pkg syscall (freebsd-arm-cgo), const TIOCM_DCD = 64 +pkg syscall (freebsd-arm-cgo), const TIOCM_DSR = 256 +pkg syscall (freebsd-arm-cgo), const TIOCM_DTR = 2 +pkg syscall (freebsd-arm-cgo), const TIOCM_LE = 1 +pkg syscall (freebsd-arm-cgo), const TIOCM_RI = 128 +pkg syscall (freebsd-arm-cgo), const TIOCM_RNG = 128 +pkg syscall (freebsd-arm-cgo), const TIOCM_RTS = 4 +pkg syscall (freebsd-arm-cgo), const TIOCM_SR = 16 +pkg syscall (freebsd-arm-cgo), const TIOCM_ST = 8 +pkg syscall (freebsd-arm-cgo), const TIOCNOTTY = 536900721 +pkg syscall (freebsd-arm-cgo), const TIOCNXCL = 536900622 +pkg syscall (freebsd-arm-cgo), const TIOCOUTQ = 1074033779 +pkg syscall (freebsd-arm-cgo), const TIOCPKT = 2147775600 +pkg syscall (freebsd-arm-cgo), const TIOCPKT_DATA = 0 +pkg syscall (freebsd-arm-cgo), const TIOCPKT_DOSTOP = 32 +pkg syscall (freebsd-arm-cgo), const TIOCPKT_FLUSHREAD = 1 +pkg syscall (freebsd-arm-cgo), const TIOCPKT_FLUSHWRITE = 2 +pkg syscall (freebsd-arm-cgo), const TIOCPKT_IOCTL = 64 +pkg syscall (freebsd-arm-cgo), const TIOCPKT_NOSTOP = 16 +pkg syscall (freebsd-arm-cgo), const TIOCPKT_START = 8 +pkg syscall (freebsd-arm-cgo), const TIOCPKT_STOP = 4 +pkg syscall (freebsd-arm-cgo), const TIOCPTMASTER = 536900636 +pkg syscall (freebsd-arm-cgo), const TIOCSBRK = 536900731 +pkg syscall (freebsd-arm-cgo), const TIOCSCTTY = 536900705 +pkg syscall (freebsd-arm-cgo), const TIOCSDRAINWAIT = 2147775575 +pkg syscall (freebsd-arm-cgo), const TIOCSDTR = 536900729 +pkg syscall (freebsd-arm-cgo), const TIOCSETA = 2150396948 +pkg syscall (freebsd-arm-cgo), const TIOCSETAF = 2150396950 +pkg syscall (freebsd-arm-cgo), const TIOCSETAW = 2150396949 +pkg syscall (freebsd-arm-cgo), const TIOCSETD = 2147775515 +pkg syscall (freebsd-arm-cgo), const TIOCSIG = 537162847 +pkg syscall (freebsd-arm-cgo), const TIOCSPGRP = 2147775606 +pkg syscall (freebsd-arm-cgo), const TIOCSTART = 536900718 +pkg syscall (freebsd-arm-cgo), const TIOCSTAT = 536900709 +pkg syscall (freebsd-arm-cgo), const TIOCSTI = 2147578994 +pkg syscall (freebsd-arm-cgo), const TIOCSTOP = 536900719 +pkg syscall (freebsd-arm-cgo), const TIOCSWINSZ = 2148037735 +pkg syscall (freebsd-arm-cgo), const TIOCTIMESTAMP = 1074558041 +pkg syscall (freebsd-arm-cgo), const TIOCUCNTL = 2147775590 +pkg syscall (freebsd-arm-cgo), const TOSTOP = 4194304 +pkg syscall (freebsd-arm-cgo), const VDISCARD = 15 +pkg syscall (freebsd-arm-cgo), const VDSUSP = 11 +pkg syscall (freebsd-arm-cgo), const VEOF = 0 +pkg syscall (freebsd-arm-cgo), const VEOL = 1 +pkg syscall (freebsd-arm-cgo), const VEOL2 = 2 +pkg syscall (freebsd-arm-cgo), const VERASE = 3 +pkg syscall (freebsd-arm-cgo), const VERASE2 = 7 +pkg syscall (freebsd-arm-cgo), const VINTR = 8 +pkg syscall (freebsd-arm-cgo), const VKILL = 5 +pkg syscall (freebsd-arm-cgo), const VLNEXT = 14 +pkg syscall (freebsd-arm-cgo), const VMIN = 16 +pkg syscall (freebsd-arm-cgo), const VQUIT = 9 +pkg syscall (freebsd-arm-cgo), const VREPRINT = 6 +pkg syscall (freebsd-arm-cgo), const VSTART = 12 +pkg syscall (freebsd-arm-cgo), const VSTATUS = 18 +pkg syscall (freebsd-arm-cgo), const VSTOP = 13 +pkg syscall (freebsd-arm-cgo), const VSUSP = 10 +pkg syscall (freebsd-arm-cgo), const VTIME = 17 +pkg syscall (freebsd-arm-cgo), const VWERASE = 4 +pkg syscall (freebsd-arm-cgo), const WCONTINUED = 4 +pkg syscall (freebsd-arm-cgo), const WCOREFLAG = 128 +pkg syscall (freebsd-arm-cgo), const WEXITED = 16 +pkg syscall (freebsd-arm-cgo), const WLINUXCLONE = 2147483648 +pkg syscall (freebsd-arm-cgo), const WNOHANG = 1 +pkg syscall (freebsd-arm-cgo), const WNOWAIT = 8 +pkg syscall (freebsd-arm-cgo), const WSTOPPED = 2 +pkg syscall (freebsd-arm-cgo), const WTRAPPED = 32 +pkg syscall (freebsd-arm-cgo), const WUNTRACED = 2 +pkg syscall (linux-386), const AF_ALG = 38 +pkg syscall (linux-386), const AF_APPLETALK = 5 +pkg syscall (linux-386), const AF_ASH = 18 +pkg syscall (linux-386), const AF_ATMPVC = 8 +pkg syscall (linux-386), const AF_ATMSVC = 20 +pkg syscall (linux-386), const AF_AX25 = 3 +pkg syscall (linux-386), const AF_BLUETOOTH = 31 +pkg syscall (linux-386), const AF_BRIDGE = 7 +pkg syscall (linux-386), const AF_CAIF = 37 +pkg syscall (linux-386), const AF_CAN = 29 +pkg syscall (linux-386), const AF_DECnet = 12 +pkg syscall (linux-386), const AF_ECONET = 19 +pkg syscall (linux-386), const AF_FILE = 1 +pkg syscall (linux-386), const AF_IEEE802154 = 36 +pkg syscall (linux-386), const AF_INET6 = 10 +pkg syscall (linux-386), const AF_IPX = 4 +pkg syscall (linux-386), const AF_IRDA = 23 +pkg syscall (linux-386), const AF_ISDN = 34 +pkg syscall (linux-386), const AF_IUCV = 32 +pkg syscall (linux-386), const AF_KEY = 15 +pkg syscall (linux-386), const AF_LLC = 26 +pkg syscall (linux-386), const AF_LOCAL = 1 +pkg syscall (linux-386), const AF_MAX = 39 +pkg syscall (linux-386), const AF_NETBEUI = 13 +pkg syscall (linux-386), const AF_NETLINK = 16 +pkg syscall (linux-386), const AF_NETROM = 6 +pkg syscall (linux-386), const AF_PACKET = 17 +pkg syscall (linux-386), const AF_PHONET = 35 +pkg syscall (linux-386), const AF_PPPOX = 24 +pkg syscall (linux-386), const AF_RDS = 21 +pkg syscall (linux-386), const AF_ROSE = 11 +pkg syscall (linux-386), const AF_ROUTE = 16 +pkg syscall (linux-386), const AF_RXRPC = 33 +pkg syscall (linux-386), const AF_SECURITY = 14 +pkg syscall (linux-386), const AF_SNA = 22 +pkg syscall (linux-386), const AF_TIPC = 30 +pkg syscall (linux-386), const AF_WANPIPE = 25 +pkg syscall (linux-386), const AF_X25 = 9 +pkg syscall (linux-386), const ARPHRD_ADAPT = 264 +pkg syscall (linux-386), const ARPHRD_APPLETLK = 8 +pkg syscall (linux-386), const ARPHRD_ARCNET = 7 +pkg syscall (linux-386), const ARPHRD_ASH = 781 +pkg syscall (linux-386), const ARPHRD_ATM = 19 +pkg syscall (linux-386), const ARPHRD_AX25 = 3 +pkg syscall (linux-386), const ARPHRD_BIF = 775 +pkg syscall (linux-386), const ARPHRD_CHAOS = 5 +pkg syscall (linux-386), const ARPHRD_CISCO = 513 +pkg syscall (linux-386), const ARPHRD_CSLIP = 257 +pkg syscall (linux-386), const ARPHRD_CSLIP6 = 259 +pkg syscall (linux-386), const ARPHRD_DDCMP = 517 +pkg syscall (linux-386), const ARPHRD_DLCI = 15 +pkg syscall (linux-386), const ARPHRD_ECONET = 782 +pkg syscall (linux-386), const ARPHRD_EETHER = 2 +pkg syscall (linux-386), const ARPHRD_ETHER = 1 +pkg syscall (linux-386), const ARPHRD_EUI64 = 27 +pkg syscall (linux-386), const ARPHRD_FCAL = 785 +pkg syscall (linux-386), const ARPHRD_FCFABRIC = 787 +pkg syscall (linux-386), const ARPHRD_FCPL = 786 +pkg syscall (linux-386), const ARPHRD_FCPP = 784 +pkg syscall (linux-386), const ARPHRD_FDDI = 774 +pkg syscall (linux-386), const ARPHRD_FRAD = 770 +pkg syscall (linux-386), const ARPHRD_HDLC = 513 +pkg syscall (linux-386), const ARPHRD_HIPPI = 780 +pkg syscall (linux-386), const ARPHRD_HWX25 = 272 +pkg syscall (linux-386), const ARPHRD_IEEE1394 = 24 +pkg syscall (linux-386), const ARPHRD_IEEE802 = 6 +pkg syscall (linux-386), const ARPHRD_IEEE80211 = 801 +pkg syscall (linux-386), const ARPHRD_IEEE80211_PRISM = 802 +pkg syscall (linux-386), const ARPHRD_IEEE80211_RADIOTAP = 803 +pkg syscall (linux-386), const ARPHRD_IEEE802154 = 804 +pkg syscall (linux-386), const ARPHRD_IEEE802154_PHY = 805 +pkg syscall (linux-386), const ARPHRD_IEEE802_TR = 800 +pkg syscall (linux-386), const ARPHRD_INFINIBAND = 32 +pkg syscall (linux-386), const ARPHRD_IPDDP = 777 +pkg syscall (linux-386), const ARPHRD_IPGRE = 778 +pkg syscall (linux-386), const ARPHRD_IRDA = 783 +pkg syscall (linux-386), const ARPHRD_LAPB = 516 +pkg syscall (linux-386), const ARPHRD_LOCALTLK = 773 +pkg syscall (linux-386), const ARPHRD_LOOPBACK = 772 +pkg syscall (linux-386), const ARPHRD_METRICOM = 23 +pkg syscall (linux-386), const ARPHRD_NETROM = 0 +pkg syscall (linux-386), const ARPHRD_NONE = 65534 +pkg syscall (linux-386), const ARPHRD_PIMREG = 779 +pkg syscall (linux-386), const ARPHRD_PPP = 512 +pkg syscall (linux-386), const ARPHRD_PRONET = 4 +pkg syscall (linux-386), const ARPHRD_RAWHDLC = 518 +pkg syscall (linux-386), const ARPHRD_ROSE = 270 +pkg syscall (linux-386), const ARPHRD_RSRVD = 260 +pkg syscall (linux-386), const ARPHRD_SIT = 776 +pkg syscall (linux-386), const ARPHRD_SKIP = 771 +pkg syscall (linux-386), const ARPHRD_SLIP = 256 +pkg syscall (linux-386), const ARPHRD_SLIP6 = 258 +pkg syscall (linux-386), const ARPHRD_TUNNEL = 768 +pkg syscall (linux-386), const ARPHRD_TUNNEL6 = 769 +pkg syscall (linux-386), const ARPHRD_VOID = 65535 +pkg syscall (linux-386), const ARPHRD_X25 = 271 +pkg syscall (linux-386), const B0 = 0 +pkg syscall (linux-386), const B1000000 = 4104 +pkg syscall (linux-386), const B110 = 3 +pkg syscall (linux-386), const B115200 = 4098 +pkg syscall (linux-386), const B1152000 = 4105 +pkg syscall (linux-386), const B1200 = 9 +pkg syscall (linux-386), const B134 = 4 +pkg syscall (linux-386), const B150 = 5 +pkg syscall (linux-386), const B1500000 = 4106 +pkg syscall (linux-386), const B1800 = 10 +pkg syscall (linux-386), const B19200 = 14 +pkg syscall (linux-386), const B200 = 6 +pkg syscall (linux-386), const B2000000 = 4107 +pkg syscall (linux-386), const B230400 = 4099 +pkg syscall (linux-386), const B2400 = 11 +pkg syscall (linux-386), const B2500000 = 4108 +pkg syscall (linux-386), const B300 = 7 +pkg syscall (linux-386), const B3000000 = 4109 +pkg syscall (linux-386), const B3500000 = 4110 +pkg syscall (linux-386), const B38400 = 15 +pkg syscall (linux-386), const B4000000 = 4111 +pkg syscall (linux-386), const B460800 = 4100 +pkg syscall (linux-386), const B4800 = 12 +pkg syscall (linux-386), const B50 = 1 +pkg syscall (linux-386), const B500000 = 4101 +pkg syscall (linux-386), const B57600 = 4097 +pkg syscall (linux-386), const B576000 = 4102 +pkg syscall (linux-386), const B600 = 8 +pkg syscall (linux-386), const B75 = 2 +pkg syscall (linux-386), const B921600 = 4103 +pkg syscall (linux-386), const B9600 = 13 +pkg syscall (linux-386), const BPF_A = 16 +pkg syscall (linux-386), const BPF_ABS = 32 +pkg syscall (linux-386), const BPF_ADD = 0 +pkg syscall (linux-386), const BPF_ALU = 4 +pkg syscall (linux-386), const BPF_AND = 80 +pkg syscall (linux-386), const BPF_B = 16 +pkg syscall (linux-386), const BPF_DIV = 48 +pkg syscall (linux-386), const BPF_H = 8 +pkg syscall (linux-386), const BPF_IMM = 0 +pkg syscall (linux-386), const BPF_IND = 64 +pkg syscall (linux-386), const BPF_JA = 0 +pkg syscall (linux-386), const BPF_JEQ = 16 +pkg syscall (linux-386), const BPF_JGE = 48 +pkg syscall (linux-386), const BPF_JGT = 32 +pkg syscall (linux-386), const BPF_JMP = 5 +pkg syscall (linux-386), const BPF_JSET = 64 +pkg syscall (linux-386), const BPF_K = 0 +pkg syscall (linux-386), const BPF_LD = 0 +pkg syscall (linux-386), const BPF_LDX = 1 +pkg syscall (linux-386), const BPF_LEN = 128 +pkg syscall (linux-386), const BPF_LSH = 96 +pkg syscall (linux-386), const BPF_MAJOR_VERSION = 1 +pkg syscall (linux-386), const BPF_MAXINSNS = 4096 +pkg syscall (linux-386), const BPF_MEM = 96 +pkg syscall (linux-386), const BPF_MEMWORDS = 16 +pkg syscall (linux-386), const BPF_MINOR_VERSION = 1 +pkg syscall (linux-386), const BPF_MISC = 7 +pkg syscall (linux-386), const BPF_MSH = 160 +pkg syscall (linux-386), const BPF_MUL = 32 +pkg syscall (linux-386), const BPF_NEG = 128 +pkg syscall (linux-386), const BPF_OR = 64 +pkg syscall (linux-386), const BPF_RET = 6 +pkg syscall (linux-386), const BPF_RSH = 112 +pkg syscall (linux-386), const BPF_ST = 2 +pkg syscall (linux-386), const BPF_STX = 3 +pkg syscall (linux-386), const BPF_SUB = 16 +pkg syscall (linux-386), const BPF_TAX = 0 +pkg syscall (linux-386), const BPF_TXA = 128 +pkg syscall (linux-386), const BPF_W = 0 +pkg syscall (linux-386), const BPF_X = 8 +pkg syscall (linux-386), const BRKINT = 2 +pkg syscall (linux-386), const CLOCAL = 2048 +pkg syscall (linux-386), const CREAD = 128 +pkg syscall (linux-386), const CS5 = 0 +pkg syscall (linux-386), const CS6 = 16 +pkg syscall (linux-386), const CS7 = 32 +pkg syscall (linux-386), const CS8 = 48 +pkg syscall (linux-386), const CSIZE = 48 +pkg syscall (linux-386), const CSTOPB = 64 +pkg syscall (linux-386), const DT_BLK = 6 +pkg syscall (linux-386), const DT_CHR = 2 +pkg syscall (linux-386), const DT_DIR = 4 +pkg syscall (linux-386), const DT_FIFO = 1 +pkg syscall (linux-386), const DT_LNK = 10 +pkg syscall (linux-386), const DT_REG = 8 +pkg syscall (linux-386), const DT_SOCK = 12 +pkg syscall (linux-386), const DT_UNKNOWN = 0 +pkg syscall (linux-386), const DT_WHT = 14 +pkg syscall (linux-386), const E2BIG = 7 +pkg syscall (linux-386), const EACCES = 13 +pkg syscall (linux-386), const EADDRINUSE = 98 +pkg syscall (linux-386), const EADDRNOTAVAIL = 99 +pkg syscall (linux-386), const EADV = 68 +pkg syscall (linux-386), const EAFNOSUPPORT = 97 +pkg syscall (linux-386), const EAGAIN = 11 +pkg syscall (linux-386), const EALREADY = 114 +pkg syscall (linux-386), const EBADE = 52 +pkg syscall (linux-386), const EBADF = 9 +pkg syscall (linux-386), const EBADFD = 77 +pkg syscall (linux-386), const EBADMSG = 74 +pkg syscall (linux-386), const EBADR = 53 +pkg syscall (linux-386), const EBADRQC = 56 +pkg syscall (linux-386), const EBADSLT = 57 +pkg syscall (linux-386), const EBFONT = 59 +pkg syscall (linux-386), const EBUSY = 16 +pkg syscall (linux-386), const ECANCELED = 125 +pkg syscall (linux-386), const ECHILD = 10 +pkg syscall (linux-386), const ECHO = 8 +pkg syscall (linux-386), const ECHOCTL = 512 +pkg syscall (linux-386), const ECHOE = 16 +pkg syscall (linux-386), const ECHOK = 32 +pkg syscall (linux-386), const ECHOKE = 2048 +pkg syscall (linux-386), const ECHONL = 64 +pkg syscall (linux-386), const ECHOPRT = 1024 +pkg syscall (linux-386), const ECHRNG = 44 +pkg syscall (linux-386), const ECOMM = 70 +pkg syscall (linux-386), const ECONNABORTED = 103 +pkg syscall (linux-386), const ECONNREFUSED = 111 +pkg syscall (linux-386), const ECONNRESET = 104 +pkg syscall (linux-386), const EDEADLK = 35 +pkg syscall (linux-386), const EDEADLOCK = 35 +pkg syscall (linux-386), const EDESTADDRREQ = 89 +pkg syscall (linux-386), const EDOM = 33 +pkg syscall (linux-386), const EDOTDOT = 73 +pkg syscall (linux-386), const EDQUOT = 122 +pkg syscall (linux-386), const EEXIST = 17 +pkg syscall (linux-386), const EFAULT = 14 +pkg syscall (linux-386), const EFBIG = 27 +pkg syscall (linux-386), const EHOSTDOWN = 112 +pkg syscall (linux-386), const EHOSTUNREACH = 113 +pkg syscall (linux-386), const EIDRM = 43 +pkg syscall (linux-386), const EILSEQ = 84 +pkg syscall (linux-386), const EINPROGRESS = 115 +pkg syscall (linux-386), const EINTR = 4 +pkg syscall (linux-386), const EINVAL = 22 +pkg syscall (linux-386), const EIO = 5 +pkg syscall (linux-386), const EISCONN = 106 +pkg syscall (linux-386), const EISDIR = 21 +pkg syscall (linux-386), const EISNAM = 120 +pkg syscall (linux-386), const EKEYEXPIRED = 127 +pkg syscall (linux-386), const EKEYREJECTED = 129 +pkg syscall (linux-386), const EKEYREVOKED = 128 +pkg syscall (linux-386), const EL2HLT = 51 +pkg syscall (linux-386), const EL2NSYNC = 45 +pkg syscall (linux-386), const EL3HLT = 46 +pkg syscall (linux-386), const EL3RST = 47 +pkg syscall (linux-386), const ELIBACC = 79 +pkg syscall (linux-386), const ELIBBAD = 80 +pkg syscall (linux-386), const ELIBEXEC = 83 +pkg syscall (linux-386), const ELIBMAX = 82 +pkg syscall (linux-386), const ELIBSCN = 81 +pkg syscall (linux-386), const ELNRNG = 48 +pkg syscall (linux-386), const ELOOP = 40 +pkg syscall (linux-386), const EMEDIUMTYPE = 124 +pkg syscall (linux-386), const EMFILE = 24 +pkg syscall (linux-386), const EMLINK = 31 +pkg syscall (linux-386), const EMSGSIZE = 90 +pkg syscall (linux-386), const EMULTIHOP = 72 +pkg syscall (linux-386), const ENAMETOOLONG = 36 +pkg syscall (linux-386), const ENAVAIL = 119 +pkg syscall (linux-386), const ENETDOWN = 100 +pkg syscall (linux-386), const ENETRESET = 102 +pkg syscall (linux-386), const ENETUNREACH = 101 +pkg syscall (linux-386), const ENFILE = 23 +pkg syscall (linux-386), const ENOANO = 55 +pkg syscall (linux-386), const ENOBUFS = 105 +pkg syscall (linux-386), const ENOCSI = 50 +pkg syscall (linux-386), const ENODATA = 61 +pkg syscall (linux-386), const ENODEV = 19 +pkg syscall (linux-386), const ENOEXEC = 8 +pkg syscall (linux-386), const ENOKEY = 126 +pkg syscall (linux-386), const ENOLCK = 37 +pkg syscall (linux-386), const ENOLINK = 67 +pkg syscall (linux-386), const ENOMEDIUM = 123 +pkg syscall (linux-386), const ENOMEM = 12 +pkg syscall (linux-386), const ENOMSG = 42 +pkg syscall (linux-386), const ENONET = 64 +pkg syscall (linux-386), const ENOPKG = 65 +pkg syscall (linux-386), const ENOPROTOOPT = 92 +pkg syscall (linux-386), const ENOSPC = 28 +pkg syscall (linux-386), const ENOSR = 63 +pkg syscall (linux-386), const ENOSTR = 60 +pkg syscall (linux-386), const ENOSYS = 38 +pkg syscall (linux-386), const ENOTBLK = 15 +pkg syscall (linux-386), const ENOTCONN = 107 +pkg syscall (linux-386), const ENOTDIR = 20 +pkg syscall (linux-386), const ENOTEMPTY = 39 +pkg syscall (linux-386), const ENOTNAM = 118 +pkg syscall (linux-386), const ENOTRECOVERABLE = 131 +pkg syscall (linux-386), const ENOTSOCK = 88 +pkg syscall (linux-386), const ENOTSUP = 95 +pkg syscall (linux-386), const ENOTTY = 25 +pkg syscall (linux-386), const ENOTUNIQ = 76 +pkg syscall (linux-386), const ENXIO = 6 +pkg syscall (linux-386), const EOPNOTSUPP = 95 +pkg syscall (linux-386), const EOVERFLOW = 75 +pkg syscall (linux-386), const EOWNERDEAD = 130 +pkg syscall (linux-386), const EPERM = 1 +pkg syscall (linux-386), const EPFNOSUPPORT = 96 +pkg syscall (linux-386), const EPIPE = 32 +pkg syscall (linux-386), const EPOLLERR = 8 +pkg syscall (linux-386), const EPOLLET = -2147483648 +pkg syscall (linux-386), const EPOLLHUP = 16 +pkg syscall (linux-386), const EPOLLIN = 1 +pkg syscall (linux-386), const EPOLLMSG = 1024 +pkg syscall (linux-386), const EPOLLONESHOT = 1073741824 +pkg syscall (linux-386), const EPOLLOUT = 4 +pkg syscall (linux-386), const EPOLLPRI = 2 +pkg syscall (linux-386), const EPOLLRDBAND = 128 +pkg syscall (linux-386), const EPOLLRDHUP = 8192 +pkg syscall (linux-386), const EPOLLRDNORM = 64 +pkg syscall (linux-386), const EPOLLWRBAND = 512 +pkg syscall (linux-386), const EPOLLWRNORM = 256 +pkg syscall (linux-386), const EPOLL_CLOEXEC = 524288 +pkg syscall (linux-386), const EPOLL_CTL_ADD = 1 +pkg syscall (linux-386), const EPOLL_CTL_DEL = 2 +pkg syscall (linux-386), const EPOLL_CTL_MOD = 3 +pkg syscall (linux-386), const EPOLL_NONBLOCK = 2048 +pkg syscall (linux-386), const EPROTO = 71 +pkg syscall (linux-386), const EPROTONOSUPPORT = 93 +pkg syscall (linux-386), const EPROTOTYPE = 91 +pkg syscall (linux-386), const ERANGE = 34 +pkg syscall (linux-386), const EREMCHG = 78 +pkg syscall (linux-386), const EREMOTE = 66 +pkg syscall (linux-386), const EREMOTEIO = 121 +pkg syscall (linux-386), const ERESTART = 85 +pkg syscall (linux-386), const ERFKILL = 132 +pkg syscall (linux-386), const EROFS = 30 +pkg syscall (linux-386), const ESHUTDOWN = 108 +pkg syscall (linux-386), const ESOCKTNOSUPPORT = 94 +pkg syscall (linux-386), const ESPIPE = 29 +pkg syscall (linux-386), const ESRCH = 3 +pkg syscall (linux-386), const ESRMNT = 69 +pkg syscall (linux-386), const ESTALE = 116 +pkg syscall (linux-386), const ESTRPIPE = 86 +pkg syscall (linux-386), const ETH_P_1588 = 35063 +pkg syscall (linux-386), const ETH_P_8021Q = 33024 +pkg syscall (linux-386), const ETH_P_802_2 = 4 +pkg syscall (linux-386), const ETH_P_802_3 = 1 +pkg syscall (linux-386), const ETH_P_AARP = 33011 +pkg syscall (linux-386), const ETH_P_ALL = 3 +pkg syscall (linux-386), const ETH_P_AOE = 34978 +pkg syscall (linux-386), const ETH_P_ARCNET = 26 +pkg syscall (linux-386), const ETH_P_ARP = 2054 +pkg syscall (linux-386), const ETH_P_ATALK = 32923 +pkg syscall (linux-386), const ETH_P_ATMFATE = 34948 +pkg syscall (linux-386), const ETH_P_ATMMPOA = 34892 +pkg syscall (linux-386), const ETH_P_AX25 = 2 +pkg syscall (linux-386), const ETH_P_BPQ = 2303 +pkg syscall (linux-386), const ETH_P_CAIF = 247 +pkg syscall (linux-386), const ETH_P_CAN = 12 +pkg syscall (linux-386), const ETH_P_CONTROL = 22 +pkg syscall (linux-386), const ETH_P_CUST = 24582 +pkg syscall (linux-386), const ETH_P_DDCMP = 6 +pkg syscall (linux-386), const ETH_P_DEC = 24576 +pkg syscall (linux-386), const ETH_P_DIAG = 24581 +pkg syscall (linux-386), const ETH_P_DNA_DL = 24577 +pkg syscall (linux-386), const ETH_P_DNA_RC = 24578 +pkg syscall (linux-386), const ETH_P_DNA_RT = 24579 +pkg syscall (linux-386), const ETH_P_DSA = 27 +pkg syscall (linux-386), const ETH_P_ECONET = 24 +pkg syscall (linux-386), const ETH_P_EDSA = 56026 +pkg syscall (linux-386), const ETH_P_FCOE = 35078 +pkg syscall (linux-386), const ETH_P_FIP = 35092 +pkg syscall (linux-386), const ETH_P_HDLC = 25 +pkg syscall (linux-386), const ETH_P_IEEE802154 = 246 +pkg syscall (linux-386), const ETH_P_IEEEPUP = 2560 +pkg syscall (linux-386), const ETH_P_IEEEPUPAT = 2561 +pkg syscall (linux-386), const ETH_P_IP = 2048 +pkg syscall (linux-386), const ETH_P_IPV6 = 34525 +pkg syscall (linux-386), const ETH_P_IPX = 33079 +pkg syscall (linux-386), const ETH_P_IRDA = 23 +pkg syscall (linux-386), const ETH_P_LAT = 24580 +pkg syscall (linux-386), const ETH_P_LINK_CTL = 34924 +pkg syscall (linux-386), const ETH_P_LOCALTALK = 9 +pkg syscall (linux-386), const ETH_P_LOOP = 96 +pkg syscall (linux-386), const ETH_P_MOBITEX = 21 +pkg syscall (linux-386), const ETH_P_MPLS_MC = 34888 +pkg syscall (linux-386), const ETH_P_MPLS_UC = 34887 +pkg syscall (linux-386), const ETH_P_PAE = 34958 +pkg syscall (linux-386), const ETH_P_PAUSE = 34824 +pkg syscall (linux-386), const ETH_P_PHONET = 245 +pkg syscall (linux-386), const ETH_P_PPPTALK = 16 +pkg syscall (linux-386), const ETH_P_PPP_DISC = 34915 +pkg syscall (linux-386), const ETH_P_PPP_MP = 8 +pkg syscall (linux-386), const ETH_P_PPP_SES = 34916 +pkg syscall (linux-386), const ETH_P_PUP = 512 +pkg syscall (linux-386), const ETH_P_PUPAT = 513 +pkg syscall (linux-386), const ETH_P_RARP = 32821 +pkg syscall (linux-386), const ETH_P_SCA = 24583 +pkg syscall (linux-386), const ETH_P_SLOW = 34825 +pkg syscall (linux-386), const ETH_P_SNAP = 5 +pkg syscall (linux-386), const ETH_P_TEB = 25944 +pkg syscall (linux-386), const ETH_P_TIPC = 35018 +pkg syscall (linux-386), const ETH_P_TRAILER = 28 +pkg syscall (linux-386), const ETH_P_TR_802_2 = 17 +pkg syscall (linux-386), const ETH_P_WAN_PPP = 7 +pkg syscall (linux-386), const ETH_P_WCCP = 34878 +pkg syscall (linux-386), const ETH_P_X25 = 2053 +pkg syscall (linux-386), const ETIME = 62 +pkg syscall (linux-386), const ETIMEDOUT = 110 +pkg syscall (linux-386), const ETOOMANYREFS = 109 +pkg syscall (linux-386), const ETXTBSY = 26 +pkg syscall (linux-386), const EUCLEAN = 117 +pkg syscall (linux-386), const EUNATCH = 49 +pkg syscall (linux-386), const EUSERS = 87 +pkg syscall (linux-386), const EWOULDBLOCK = 11 +pkg syscall (linux-386), const EXDEV = 18 +pkg syscall (linux-386), const EXFULL = 54 +pkg syscall (linux-386), const FD_CLOEXEC = 1 +pkg syscall (linux-386), const FD_SETSIZE = 1024 +pkg syscall (linux-386), const FLUSHO = 4096 +pkg syscall (linux-386), const F_DUPFD = 0 +pkg syscall (linux-386), const F_DUPFD_CLOEXEC = 1030 +pkg syscall (linux-386), const F_EXLCK = 4 +pkg syscall (linux-386), const F_GETFD = 1 +pkg syscall (linux-386), const F_GETFL = 3 +pkg syscall (linux-386), const F_GETLEASE = 1025 +pkg syscall (linux-386), const F_GETLK = 12 +pkg syscall (linux-386), const F_GETLK64 = 12 +pkg syscall (linux-386), const F_GETOWN = 9 +pkg syscall (linux-386), const F_GETOWN_EX = 16 +pkg syscall (linux-386), const F_GETPIPE_SZ = 1032 +pkg syscall (linux-386), const F_GETSIG = 11 +pkg syscall (linux-386), const F_LOCK = 1 +pkg syscall (linux-386), const F_NOTIFY = 1026 +pkg syscall (linux-386), const F_OK = 0 +pkg syscall (linux-386), const F_RDLCK = 0 +pkg syscall (linux-386), const F_SETFD = 2 +pkg syscall (linux-386), const F_SETFL = 4 +pkg syscall (linux-386), const F_SETLEASE = 1024 +pkg syscall (linux-386), const F_SETLK = 13 +pkg syscall (linux-386), const F_SETLK64 = 13 +pkg syscall (linux-386), const F_SETLKW = 14 +pkg syscall (linux-386), const F_SETLKW64 = 14 +pkg syscall (linux-386), const F_SETOWN = 8 +pkg syscall (linux-386), const F_SETOWN_EX = 15 +pkg syscall (linux-386), const F_SETPIPE_SZ = 1031 +pkg syscall (linux-386), const F_SETSIG = 10 +pkg syscall (linux-386), const F_SHLCK = 8 +pkg syscall (linux-386), const F_TEST = 3 +pkg syscall (linux-386), const F_TLOCK = 2 +pkg syscall (linux-386), const F_ULOCK = 0 +pkg syscall (linux-386), const F_UNLCK = 2 +pkg syscall (linux-386), const F_WRLCK = 1 +pkg syscall (linux-386), const HUPCL = 1024 +pkg syscall (linux-386), const ICANON = 2 +pkg syscall (linux-386), const ICRNL = 256 +pkg syscall (linux-386), const IEXTEN = 32768 +pkg syscall (linux-386), const IFA_ADDRESS = 1 +pkg syscall (linux-386), const IFA_ANYCAST = 5 +pkg syscall (linux-386), const IFA_BROADCAST = 4 +pkg syscall (linux-386), const IFA_CACHEINFO = 6 +pkg syscall (linux-386), const IFA_F_DADFAILED = 8 +pkg syscall (linux-386), const IFA_F_DEPRECATED = 32 +pkg syscall (linux-386), const IFA_F_HOMEADDRESS = 16 +pkg syscall (linux-386), const IFA_F_NODAD = 2 +pkg syscall (linux-386), const IFA_F_OPTIMISTIC = 4 +pkg syscall (linux-386), const IFA_F_PERMANENT = 128 +pkg syscall (linux-386), const IFA_F_SECONDARY = 1 +pkg syscall (linux-386), const IFA_F_TEMPORARY = 1 +pkg syscall (linux-386), const IFA_F_TENTATIVE = 64 +pkg syscall (linux-386), const IFA_LABEL = 3 +pkg syscall (linux-386), const IFA_LOCAL = 2 +pkg syscall (linux-386), const IFA_MAX = 7 +pkg syscall (linux-386), const IFA_MULTICAST = 7 +pkg syscall (linux-386), const IFA_UNSPEC = 0 +pkg syscall (linux-386), const IFF_ALLMULTI = 512 +pkg syscall (linux-386), const IFF_AUTOMEDIA = 16384 +pkg syscall (linux-386), const IFF_DEBUG = 4 +pkg syscall (linux-386), const IFF_DYNAMIC = 32768 +pkg syscall (linux-386), const IFF_LOOPBACK = 8 +pkg syscall (linux-386), const IFF_MASTER = 1024 +pkg syscall (linux-386), const IFF_MULTICAST = 4096 +pkg syscall (linux-386), const IFF_NOARP = 128 +pkg syscall (linux-386), const IFF_NOTRAILERS = 32 +pkg syscall (linux-386), const IFF_NO_PI = 4096 +pkg syscall (linux-386), const IFF_ONE_QUEUE = 8192 +pkg syscall (linux-386), const IFF_POINTOPOINT = 16 +pkg syscall (linux-386), const IFF_PORTSEL = 8192 +pkg syscall (linux-386), const IFF_PROMISC = 256 +pkg syscall (linux-386), const IFF_RUNNING = 64 +pkg syscall (linux-386), const IFF_SLAVE = 2048 +pkg syscall (linux-386), const IFF_TAP = 2 +pkg syscall (linux-386), const IFF_TUN = 1 +pkg syscall (linux-386), const IFF_TUN_EXCL = 32768 +pkg syscall (linux-386), const IFF_VNET_HDR = 16384 +pkg syscall (linux-386), const IFLA_ADDRESS = 1 +pkg syscall (linux-386), const IFLA_BROADCAST = 2 +pkg syscall (linux-386), const IFLA_COST = 8 +pkg syscall (linux-386), const IFLA_IFALIAS = 20 +pkg syscall (linux-386), const IFLA_IFNAME = 3 +pkg syscall (linux-386), const IFLA_LINK = 5 +pkg syscall (linux-386), const IFLA_LINKINFO = 18 +pkg syscall (linux-386), const IFLA_LINKMODE = 17 +pkg syscall (linux-386), const IFLA_MAP = 14 +pkg syscall (linux-386), const IFLA_MASTER = 10 +pkg syscall (linux-386), const IFLA_MAX = 29 +pkg syscall (linux-386), const IFLA_MTU = 4 +pkg syscall (linux-386), const IFLA_NET_NS_PID = 19 +pkg syscall (linux-386), const IFLA_OPERSTATE = 16 +pkg syscall (linux-386), const IFLA_PRIORITY = 9 +pkg syscall (linux-386), const IFLA_PROTINFO = 12 +pkg syscall (linux-386), const IFLA_QDISC = 6 +pkg syscall (linux-386), const IFLA_STATS = 7 +pkg syscall (linux-386), const IFLA_TXQLEN = 13 +pkg syscall (linux-386), const IFLA_UNSPEC = 0 +pkg syscall (linux-386), const IFLA_WEIGHT = 15 +pkg syscall (linux-386), const IFLA_WIRELESS = 11 +pkg syscall (linux-386), const IFNAMSIZ = 16 +pkg syscall (linux-386), const IGNBRK = 1 +pkg syscall (linux-386), const IGNCR = 128 +pkg syscall (linux-386), const IGNPAR = 4 +pkg syscall (linux-386), const IMAXBEL = 8192 +pkg syscall (linux-386), const INLCR = 64 +pkg syscall (linux-386), const INPCK = 16 +pkg syscall (linux-386), const IN_ACCESS = 1 +pkg syscall (linux-386), const IN_ALL_EVENTS = 4095 +pkg syscall (linux-386), const IN_ATTRIB = 4 +pkg syscall (linux-386), const IN_CLASSA_HOST = 16777215 +pkg syscall (linux-386), const IN_CLASSA_MAX = 128 +pkg syscall (linux-386), const IN_CLASSA_NET = 4278190080 +pkg syscall (linux-386), const IN_CLASSA_NSHIFT = 24 +pkg syscall (linux-386), const IN_CLASSB_HOST = 65535 +pkg syscall (linux-386), const IN_CLASSB_MAX = 65536 +pkg syscall (linux-386), const IN_CLASSB_NET = 4294901760 +pkg syscall (linux-386), const IN_CLASSB_NSHIFT = 16 +pkg syscall (linux-386), const IN_CLASSC_HOST = 255 +pkg syscall (linux-386), const IN_CLASSC_NET = 4294967040 +pkg syscall (linux-386), const IN_CLASSC_NSHIFT = 8 +pkg syscall (linux-386), const IN_CLOEXEC = 524288 +pkg syscall (linux-386), const IN_CLOSE = 24 +pkg syscall (linux-386), const IN_CLOSE_NOWRITE = 16 +pkg syscall (linux-386), const IN_CLOSE_WRITE = 8 +pkg syscall (linux-386), const IN_CREATE = 256 +pkg syscall (linux-386), const IN_DELETE = 512 +pkg syscall (linux-386), const IN_DELETE_SELF = 1024 +pkg syscall (linux-386), const IN_DONT_FOLLOW = 33554432 +pkg syscall (linux-386), const IN_EXCL_UNLINK = 67108864 +pkg syscall (linux-386), const IN_IGNORED = 32768 +pkg syscall (linux-386), const IN_ISDIR = 1073741824 +pkg syscall (linux-386), const IN_LOOPBACKNET = 127 +pkg syscall (linux-386), const IN_MASK_ADD = 536870912 +pkg syscall (linux-386), const IN_MODIFY = 2 +pkg syscall (linux-386), const IN_MOVE = 192 +pkg syscall (linux-386), const IN_MOVED_FROM = 64 +pkg syscall (linux-386), const IN_MOVED_TO = 128 +pkg syscall (linux-386), const IN_MOVE_SELF = 2048 +pkg syscall (linux-386), const IN_NONBLOCK = 2048 +pkg syscall (linux-386), const IN_ONESHOT = 2147483648 +pkg syscall (linux-386), const IN_ONLYDIR = 16777216 +pkg syscall (linux-386), const IN_OPEN = 32 +pkg syscall (linux-386), const IN_Q_OVERFLOW = 16384 +pkg syscall (linux-386), const IN_UNMOUNT = 8192 +pkg syscall (linux-386), const IPPROTO_AH = 51 +pkg syscall (linux-386), const IPPROTO_COMP = 108 +pkg syscall (linux-386), const IPPROTO_DCCP = 33 +pkg syscall (linux-386), const IPPROTO_DSTOPTS = 60 +pkg syscall (linux-386), const IPPROTO_EGP = 8 +pkg syscall (linux-386), const IPPROTO_ENCAP = 98 +pkg syscall (linux-386), const IPPROTO_ESP = 50 +pkg syscall (linux-386), const IPPROTO_FRAGMENT = 44 +pkg syscall (linux-386), const IPPROTO_GRE = 47 +pkg syscall (linux-386), const IPPROTO_HOPOPTS = 0 +pkg syscall (linux-386), const IPPROTO_ICMP = 1 +pkg syscall (linux-386), const IPPROTO_ICMPV6 = 58 +pkg syscall (linux-386), const IPPROTO_IDP = 22 +pkg syscall (linux-386), const IPPROTO_IGMP = 2 +pkg syscall (linux-386), const IPPROTO_IPIP = 4 +pkg syscall (linux-386), const IPPROTO_MTP = 92 +pkg syscall (linux-386), const IPPROTO_NONE = 59 +pkg syscall (linux-386), const IPPROTO_PIM = 103 +pkg syscall (linux-386), const IPPROTO_PUP = 12 +pkg syscall (linux-386), const IPPROTO_RAW = 255 +pkg syscall (linux-386), const IPPROTO_ROUTING = 43 +pkg syscall (linux-386), const IPPROTO_RSVP = 46 +pkg syscall (linux-386), const IPPROTO_SCTP = 132 +pkg syscall (linux-386), const IPPROTO_TP = 29 +pkg syscall (linux-386), const IPPROTO_UDPLITE = 136 +pkg syscall (linux-386), const IPV6_2292DSTOPTS = 4 +pkg syscall (linux-386), const IPV6_2292HOPLIMIT = 8 +pkg syscall (linux-386), const IPV6_2292HOPOPTS = 3 +pkg syscall (linux-386), const IPV6_2292PKTINFO = 2 +pkg syscall (linux-386), const IPV6_2292PKTOPTIONS = 6 +pkg syscall (linux-386), const IPV6_2292RTHDR = 5 +pkg syscall (linux-386), const IPV6_ADDRFORM = 1 +pkg syscall (linux-386), const IPV6_ADD_MEMBERSHIP = 20 +pkg syscall (linux-386), const IPV6_AUTHHDR = 10 +pkg syscall (linux-386), const IPV6_CHECKSUM = 7 +pkg syscall (linux-386), const IPV6_DROP_MEMBERSHIP = 21 +pkg syscall (linux-386), const IPV6_DSTOPTS = 59 +pkg syscall (linux-386), const IPV6_HOPLIMIT = 52 +pkg syscall (linux-386), const IPV6_HOPOPTS = 54 +pkg syscall (linux-386), const IPV6_IPSEC_POLICY = 34 +pkg syscall (linux-386), const IPV6_JOIN_ANYCAST = 27 +pkg syscall (linux-386), const IPV6_JOIN_GROUP = 20 +pkg syscall (linux-386), const IPV6_LEAVE_ANYCAST = 28 +pkg syscall (linux-386), const IPV6_LEAVE_GROUP = 21 +pkg syscall (linux-386), const IPV6_MTU = 24 +pkg syscall (linux-386), const IPV6_MTU_DISCOVER = 23 +pkg syscall (linux-386), const IPV6_MULTICAST_HOPS = 18 +pkg syscall (linux-386), const IPV6_MULTICAST_IF = 17 +pkg syscall (linux-386), const IPV6_MULTICAST_LOOP = 19 +pkg syscall (linux-386), const IPV6_NEXTHOP = 9 +pkg syscall (linux-386), const IPV6_PKTINFO = 50 +pkg syscall (linux-386), const IPV6_PMTUDISC_DO = 2 +pkg syscall (linux-386), const IPV6_PMTUDISC_DONT = 0 +pkg syscall (linux-386), const IPV6_PMTUDISC_PROBE = 3 +pkg syscall (linux-386), const IPV6_PMTUDISC_WANT = 1 +pkg syscall (linux-386), const IPV6_RECVDSTOPTS = 58 +pkg syscall (linux-386), const IPV6_RECVERR = 25 +pkg syscall (linux-386), const IPV6_RECVHOPLIMIT = 51 +pkg syscall (linux-386), const IPV6_RECVHOPOPTS = 53 +pkg syscall (linux-386), const IPV6_RECVPKTINFO = 49 +pkg syscall (linux-386), const IPV6_RECVRTHDR = 56 +pkg syscall (linux-386), const IPV6_RECVTCLASS = 66 +pkg syscall (linux-386), const IPV6_ROUTER_ALERT = 22 +pkg syscall (linux-386), const IPV6_RTHDR = 57 +pkg syscall (linux-386), const IPV6_RTHDRDSTOPTS = 55 +pkg syscall (linux-386), const IPV6_RTHDR_LOOSE = 0 +pkg syscall (linux-386), const IPV6_RTHDR_STRICT = 1 +pkg syscall (linux-386), const IPV6_RTHDR_TYPE_0 = 0 +pkg syscall (linux-386), const IPV6_RXDSTOPTS = 59 +pkg syscall (linux-386), const IPV6_RXHOPOPTS = 54 +pkg syscall (linux-386), const IPV6_TCLASS = 67 +pkg syscall (linux-386), const IPV6_UNICAST_HOPS = 16 +pkg syscall (linux-386), const IPV6_V6ONLY = 26 +pkg syscall (linux-386), const IPV6_XFRM_POLICY = 35 +pkg syscall (linux-386), const IP_ADD_MEMBERSHIP = 35 +pkg syscall (linux-386), const IP_ADD_SOURCE_MEMBERSHIP = 39 +pkg syscall (linux-386), const IP_BLOCK_SOURCE = 38 +pkg syscall (linux-386), const IP_DEFAULT_MULTICAST_LOOP = 1 +pkg syscall (linux-386), const IP_DEFAULT_MULTICAST_TTL = 1 +pkg syscall (linux-386), const IP_DF = 16384 +pkg syscall (linux-386), const IP_DROP_MEMBERSHIP = 36 +pkg syscall (linux-386), const IP_DROP_SOURCE_MEMBERSHIP = 40 +pkg syscall (linux-386), const IP_FREEBIND = 15 +pkg syscall (linux-386), const IP_HDRINCL = 3 +pkg syscall (linux-386), const IP_IPSEC_POLICY = 16 +pkg syscall (linux-386), const IP_MAXPACKET = 65535 +pkg syscall (linux-386), const IP_MAX_MEMBERSHIPS = 20 +pkg syscall (linux-386), const IP_MF = 8192 +pkg syscall (linux-386), const IP_MINTTL = 21 +pkg syscall (linux-386), const IP_MSFILTER = 41 +pkg syscall (linux-386), const IP_MSS = 576 +pkg syscall (linux-386), const IP_MTU = 14 +pkg syscall (linux-386), const IP_MTU_DISCOVER = 10 +pkg syscall (linux-386), const IP_MULTICAST_IF = 32 +pkg syscall (linux-386), const IP_MULTICAST_LOOP = 34 +pkg syscall (linux-386), const IP_MULTICAST_TTL = 33 +pkg syscall (linux-386), const IP_OFFMASK = 8191 +pkg syscall (linux-386), const IP_OPTIONS = 4 +pkg syscall (linux-386), const IP_ORIGDSTADDR = 20 +pkg syscall (linux-386), const IP_PASSSEC = 18 +pkg syscall (linux-386), const IP_PKTINFO = 8 +pkg syscall (linux-386), const IP_PKTOPTIONS = 9 +pkg syscall (linux-386), const IP_PMTUDISC = 10 +pkg syscall (linux-386), const IP_PMTUDISC_DO = 2 +pkg syscall (linux-386), const IP_PMTUDISC_DONT = 0 +pkg syscall (linux-386), const IP_PMTUDISC_PROBE = 3 +pkg syscall (linux-386), const IP_PMTUDISC_WANT = 1 +pkg syscall (linux-386), const IP_RECVERR = 11 +pkg syscall (linux-386), const IP_RECVOPTS = 6 +pkg syscall (linux-386), const IP_RECVORIGDSTADDR = 20 +pkg syscall (linux-386), const IP_RECVRETOPTS = 7 +pkg syscall (linux-386), const IP_RECVTOS = 13 +pkg syscall (linux-386), const IP_RECVTTL = 12 +pkg syscall (linux-386), const IP_RETOPTS = 7 +pkg syscall (linux-386), const IP_RF = 32768 +pkg syscall (linux-386), const IP_ROUTER_ALERT = 5 +pkg syscall (linux-386), const IP_TOS = 1 +pkg syscall (linux-386), const IP_TRANSPARENT = 19 +pkg syscall (linux-386), const IP_TTL = 2 +pkg syscall (linux-386), const IP_UNBLOCK_SOURCE = 37 +pkg syscall (linux-386), const IP_XFRM_POLICY = 17 +pkg syscall (linux-386), const ISIG = 1 +pkg syscall (linux-386), const ISTRIP = 32 +pkg syscall (linux-386), const IUCLC = 512 +pkg syscall (linux-386), const IUTF8 = 16384 +pkg syscall (linux-386), const IXANY = 2048 +pkg syscall (linux-386), const IXOFF = 4096 +pkg syscall (linux-386), const IXON = 1024 +pkg syscall (linux-386), const ImplementsGetwd = true +pkg syscall (linux-386), const LINUX_REBOOT_CMD_CAD_OFF = 0 +pkg syscall (linux-386), const LINUX_REBOOT_CMD_CAD_ON = 2309737967 +pkg syscall (linux-386), const LINUX_REBOOT_CMD_HALT = 3454992675 +pkg syscall (linux-386), const LINUX_REBOOT_CMD_KEXEC = 1163412803 +pkg syscall (linux-386), const LINUX_REBOOT_CMD_POWER_OFF = 1126301404 +pkg syscall (linux-386), const LINUX_REBOOT_CMD_RESTART = 19088743 +pkg syscall (linux-386), const LINUX_REBOOT_CMD_RESTART2 = 2712847316 +pkg syscall (linux-386), const LINUX_REBOOT_CMD_SW_SUSPEND = 3489725666 +pkg syscall (linux-386), const LINUX_REBOOT_MAGIC1 = 4276215469 +pkg syscall (linux-386), const LINUX_REBOOT_MAGIC2 = 672274793 +pkg syscall (linux-386), const LOCK_EX = 2 +pkg syscall (linux-386), const LOCK_NB = 4 +pkg syscall (linux-386), const LOCK_SH = 1 +pkg syscall (linux-386), const LOCK_UN = 8 +pkg syscall (linux-386), const MADV_DOFORK = 11 +pkg syscall (linux-386), const MADV_DONTFORK = 10 +pkg syscall (linux-386), const MADV_DONTNEED = 4 +pkg syscall (linux-386), const MADV_HUGEPAGE = 14 +pkg syscall (linux-386), const MADV_HWPOISON = 100 +pkg syscall (linux-386), const MADV_MERGEABLE = 12 +pkg syscall (linux-386), const MADV_NOHUGEPAGE = 15 +pkg syscall (linux-386), const MADV_NORMAL = 0 +pkg syscall (linux-386), const MADV_RANDOM = 1 +pkg syscall (linux-386), const MADV_REMOVE = 9 +pkg syscall (linux-386), const MADV_SEQUENTIAL = 2 +pkg syscall (linux-386), const MADV_UNMERGEABLE = 13 +pkg syscall (linux-386), const MADV_WILLNEED = 3 +pkg syscall (linux-386), const MAP_32BIT = 64 +pkg syscall (linux-386), const MAP_ANON = 32 +pkg syscall (linux-386), const MAP_ANONYMOUS = 32 +pkg syscall (linux-386), const MAP_DENYWRITE = 2048 +pkg syscall (linux-386), const MAP_EXECUTABLE = 4096 +pkg syscall (linux-386), const MAP_FILE = 0 +pkg syscall (linux-386), const MAP_FIXED = 16 +pkg syscall (linux-386), const MAP_GROWSDOWN = 256 +pkg syscall (linux-386), const MAP_HUGETLB = 262144 +pkg syscall (linux-386), const MAP_LOCKED = 8192 +pkg syscall (linux-386), const MAP_NONBLOCK = 65536 +pkg syscall (linux-386), const MAP_NORESERVE = 16384 +pkg syscall (linux-386), const MAP_POPULATE = 32768 +pkg syscall (linux-386), const MAP_PRIVATE = 2 +pkg syscall (linux-386), const MAP_SHARED = 1 +pkg syscall (linux-386), const MAP_STACK = 131072 +pkg syscall (linux-386), const MAP_TYPE = 15 +pkg syscall (linux-386), const MCL_CURRENT = 1 +pkg syscall (linux-386), const MCL_FUTURE = 2 +pkg syscall (linux-386), const MNT_DETACH = 2 +pkg syscall (linux-386), const MNT_EXPIRE = 4 +pkg syscall (linux-386), const MNT_FORCE = 1 +pkg syscall (linux-386), const MSG_CMSG_CLOEXEC = 1073741824 +pkg syscall (linux-386), const MSG_CONFIRM = 2048 +pkg syscall (linux-386), const MSG_CTRUNC = 8 +pkg syscall (linux-386), const MSG_DONTROUTE = 4 +pkg syscall (linux-386), const MSG_DONTWAIT = 64 +pkg syscall (linux-386), const MSG_EOR = 128 +pkg syscall (linux-386), const MSG_ERRQUEUE = 8192 +pkg syscall (linux-386), const MSG_FASTOPEN = 536870912 +pkg syscall (linux-386), const MSG_FASTOPEN ideal-int +pkg syscall (linux-386), const MSG_FIN = 512 +pkg syscall (linux-386), const MSG_MORE = 32768 +pkg syscall (linux-386), const MSG_NOSIGNAL = 16384 +pkg syscall (linux-386), const MSG_OOB = 1 +pkg syscall (linux-386), const MSG_PEEK = 2 +pkg syscall (linux-386), const MSG_PROXY = 16 +pkg syscall (linux-386), const MSG_RST = 4096 +pkg syscall (linux-386), const MSG_SYN = 1024 +pkg syscall (linux-386), const MSG_TRUNC = 32 +pkg syscall (linux-386), const MSG_TRYHARD = 4 +pkg syscall (linux-386), const MSG_WAITALL = 256 +pkg syscall (linux-386), const MSG_WAITFORONE = 65536 +pkg syscall (linux-386), const MS_ACTIVE = 1073741824 +pkg syscall (linux-386), const MS_ASYNC = 1 +pkg syscall (linux-386), const MS_BIND = 4096 +pkg syscall (linux-386), const MS_DIRSYNC = 128 +pkg syscall (linux-386), const MS_INVALIDATE = 2 +pkg syscall (linux-386), const MS_I_VERSION = 8388608 +pkg syscall (linux-386), const MS_KERNMOUNT = 4194304 +pkg syscall (linux-386), const MS_MANDLOCK = 64 +pkg syscall (linux-386), const MS_MGC_MSK = 4294901760 +pkg syscall (linux-386), const MS_MGC_VAL = 3236757504 +pkg syscall (linux-386), const MS_MOVE = 8192 +pkg syscall (linux-386), const MS_NOATIME = 1024 +pkg syscall (linux-386), const MS_NODEV = 4 +pkg syscall (linux-386), const MS_NODIRATIME = 2048 +pkg syscall (linux-386), const MS_NOEXEC = 8 +pkg syscall (linux-386), const MS_NOSUID = 2 +pkg syscall (linux-386), const MS_NOUSER = -2147483648 +pkg syscall (linux-386), const MS_POSIXACL = 65536 +pkg syscall (linux-386), const MS_PRIVATE = 262144 +pkg syscall (linux-386), const MS_RDONLY = 1 +pkg syscall (linux-386), const MS_REC = 16384 +pkg syscall (linux-386), const MS_RELATIME = 2097152 +pkg syscall (linux-386), const MS_REMOUNT = 32 +pkg syscall (linux-386), const MS_RMT_MASK = 8388689 +pkg syscall (linux-386), const MS_SHARED = 1048576 +pkg syscall (linux-386), const MS_SILENT = 32768 +pkg syscall (linux-386), const MS_SLAVE = 524288 +pkg syscall (linux-386), const MS_STRICTATIME = 16777216 +pkg syscall (linux-386), const MS_SYNC = 4 +pkg syscall (linux-386), const MS_SYNCHRONOUS = 16 +pkg syscall (linux-386), const MS_UNBINDABLE = 131072 +pkg syscall (linux-386), const NAME_MAX = 255 +pkg syscall (linux-386), const NETLINK_ADD_MEMBERSHIP = 1 +pkg syscall (linux-386), const NETLINK_AUDIT = 9 +pkg syscall (linux-386), const NETLINK_BROADCAST_ERROR = 4 +pkg syscall (linux-386), const NETLINK_CONNECTOR = 11 +pkg syscall (linux-386), const NETLINK_DNRTMSG = 14 +pkg syscall (linux-386), const NETLINK_DROP_MEMBERSHIP = 2 +pkg syscall (linux-386), const NETLINK_ECRYPTFS = 19 +pkg syscall (linux-386), const NETLINK_FIB_LOOKUP = 10 +pkg syscall (linux-386), const NETLINK_FIREWALL = 3 +pkg syscall (linux-386), const NETLINK_GENERIC = 16 +pkg syscall (linux-386), const NETLINK_INET_DIAG = 4 +pkg syscall (linux-386), const NETLINK_IP6_FW = 13 +pkg syscall (linux-386), const NETLINK_ISCSI = 8 +pkg syscall (linux-386), const NETLINK_KOBJECT_UEVENT = 15 +pkg syscall (linux-386), const NETLINK_NETFILTER = 12 +pkg syscall (linux-386), const NETLINK_NFLOG = 5 +pkg syscall (linux-386), const NETLINK_NO_ENOBUFS = 5 +pkg syscall (linux-386), const NETLINK_PKTINFO = 3 +pkg syscall (linux-386), const NETLINK_ROUTE = 0 +pkg syscall (linux-386), const NETLINK_SCSITRANSPORT = 18 +pkg syscall (linux-386), const NETLINK_SELINUX = 7 +pkg syscall (linux-386), const NETLINK_UNUSED = 1 +pkg syscall (linux-386), const NETLINK_USERSOCK = 2 +pkg syscall (linux-386), const NETLINK_XFRM = 6 +pkg syscall (linux-386), const NLA_ALIGNTO = 4 +pkg syscall (linux-386), const NLA_F_NESTED = 32768 +pkg syscall (linux-386), const NLA_F_NET_BYTEORDER = 16384 +pkg syscall (linux-386), const NLA_HDRLEN = 4 +pkg syscall (linux-386), const NLMSG_ALIGNTO = 4 +pkg syscall (linux-386), const NLMSG_DONE = 3 +pkg syscall (linux-386), const NLMSG_ERROR = 2 +pkg syscall (linux-386), const NLMSG_HDRLEN = 16 +pkg syscall (linux-386), const NLMSG_MIN_TYPE = 16 +pkg syscall (linux-386), const NLMSG_NOOP = 1 +pkg syscall (linux-386), const NLMSG_OVERRUN = 4 +pkg syscall (linux-386), const NLM_F_ACK = 4 +pkg syscall (linux-386), const NLM_F_APPEND = 2048 +pkg syscall (linux-386), const NLM_F_ATOMIC = 1024 +pkg syscall (linux-386), const NLM_F_CREATE = 1024 +pkg syscall (linux-386), const NLM_F_DUMP = 768 +pkg syscall (linux-386), const NLM_F_ECHO = 8 +pkg syscall (linux-386), const NLM_F_EXCL = 512 +pkg syscall (linux-386), const NLM_F_MATCH = 512 +pkg syscall (linux-386), const NLM_F_MULTI = 2 +pkg syscall (linux-386), const NLM_F_REPLACE = 256 +pkg syscall (linux-386), const NLM_F_REQUEST = 1 +pkg syscall (linux-386), const NLM_F_ROOT = 256 +pkg syscall (linux-386), const NOFLSH = 128 +pkg syscall (linux-386), const OCRNL = 8 +pkg syscall (linux-386), const OFDEL = 128 +pkg syscall (linux-386), const OFILL = 64 +pkg syscall (linux-386), const OLCUC = 2 +pkg syscall (linux-386), const ONLCR = 4 +pkg syscall (linux-386), const ONLRET = 32 +pkg syscall (linux-386), const ONOCR = 16 +pkg syscall (linux-386), const OPOST = 1 +pkg syscall (linux-386), const O_ACCMODE = 3 +pkg syscall (linux-386), const O_APPEND = 1024 +pkg syscall (linux-386), const O_ASYNC = 8192 +pkg syscall (linux-386), const O_CLOEXEC = 524288 +pkg syscall (linux-386), const O_CREAT = 64 +pkg syscall (linux-386), const O_DIRECT = 16384 +pkg syscall (linux-386), const O_DIRECTORY = 65536 +pkg syscall (linux-386), const O_DSYNC = 4096 +pkg syscall (linux-386), const O_EXCL = 128 +pkg syscall (linux-386), const O_FSYNC = 1052672 +pkg syscall (linux-386), const O_LARGEFILE = 32768 +pkg syscall (linux-386), const O_NDELAY = 2048 +pkg syscall (linux-386), const O_NOATIME = 262144 +pkg syscall (linux-386), const O_NOCTTY = 256 +pkg syscall (linux-386), const O_NOFOLLOW = 131072 +pkg syscall (linux-386), const O_NONBLOCK = 2048 +pkg syscall (linux-386), const O_RSYNC = 1052672 +pkg syscall (linux-386), const O_SYNC = 1052672 +pkg syscall (linux-386), const O_TRUNC = 512 +pkg syscall (linux-386), const PACKET_ADD_MEMBERSHIP = 1 +pkg syscall (linux-386), const PACKET_BROADCAST = 1 +pkg syscall (linux-386), const PACKET_DROP_MEMBERSHIP = 2 +pkg syscall (linux-386), const PACKET_FASTROUTE = 6 +pkg syscall (linux-386), const PACKET_HOST = 0 +pkg syscall (linux-386), const PACKET_LOOPBACK = 5 +pkg syscall (linux-386), const PACKET_MR_ALLMULTI = 2 +pkg syscall (linux-386), const PACKET_MR_MULTICAST = 0 +pkg syscall (linux-386), const PACKET_MR_PROMISC = 1 +pkg syscall (linux-386), const PACKET_MULTICAST = 2 +pkg syscall (linux-386), const PACKET_OTHERHOST = 3 +pkg syscall (linux-386), const PACKET_OUTGOING = 4 +pkg syscall (linux-386), const PACKET_RECV_OUTPUT = 3 +pkg syscall (linux-386), const PACKET_RX_RING = 5 +pkg syscall (linux-386), const PACKET_STATISTICS = 6 +pkg syscall (linux-386), const PARENB = 256 +pkg syscall (linux-386), const PARMRK = 8 +pkg syscall (linux-386), const PARODD = 512 +pkg syscall (linux-386), const PENDIN = 16384 +pkg syscall (linux-386), const PROT_EXEC = 4 +pkg syscall (linux-386), const PROT_GROWSDOWN = 16777216 +pkg syscall (linux-386), const PROT_GROWSUP = 33554432 +pkg syscall (linux-386), const PROT_NONE = 0 +pkg syscall (linux-386), const PROT_READ = 1 +pkg syscall (linux-386), const PROT_WRITE = 2 +pkg syscall (linux-386), const PR_CAPBSET_DROP = 24 +pkg syscall (linux-386), const PR_CAPBSET_READ = 23 +pkg syscall (linux-386), const PR_ENDIAN_BIG = 0 +pkg syscall (linux-386), const PR_ENDIAN_LITTLE = 1 +pkg syscall (linux-386), const PR_ENDIAN_PPC_LITTLE = 2 +pkg syscall (linux-386), const PR_FPEMU_NOPRINT = 1 +pkg syscall (linux-386), const PR_FPEMU_SIGFPE = 2 +pkg syscall (linux-386), const PR_FP_EXC_ASYNC = 2 +pkg syscall (linux-386), const PR_FP_EXC_DISABLED = 0 +pkg syscall (linux-386), const PR_FP_EXC_DIV = 65536 +pkg syscall (linux-386), const PR_FP_EXC_INV = 1048576 +pkg syscall (linux-386), const PR_FP_EXC_NONRECOV = 1 +pkg syscall (linux-386), const PR_FP_EXC_OVF = 131072 +pkg syscall (linux-386), const PR_FP_EXC_PRECISE = 3 +pkg syscall (linux-386), const PR_FP_EXC_RES = 524288 +pkg syscall (linux-386), const PR_FP_EXC_SW_ENABLE = 128 +pkg syscall (linux-386), const PR_FP_EXC_UND = 262144 +pkg syscall (linux-386), const PR_GET_DUMPABLE = 3 +pkg syscall (linux-386), const PR_GET_ENDIAN = 19 +pkg syscall (linux-386), const PR_GET_FPEMU = 9 +pkg syscall (linux-386), const PR_GET_FPEXC = 11 +pkg syscall (linux-386), const PR_GET_KEEPCAPS = 7 +pkg syscall (linux-386), const PR_GET_NAME = 16 +pkg syscall (linux-386), const PR_GET_PDEATHSIG = 2 +pkg syscall (linux-386), const PR_GET_SECCOMP = 21 +pkg syscall (linux-386), const PR_GET_SECUREBITS = 27 +pkg syscall (linux-386), const PR_GET_TIMERSLACK = 30 +pkg syscall (linux-386), const PR_GET_TIMING = 13 +pkg syscall (linux-386), const PR_GET_TSC = 25 +pkg syscall (linux-386), const PR_GET_UNALIGN = 5 +pkg syscall (linux-386), const PR_MCE_KILL = 33 +pkg syscall (linux-386), const PR_MCE_KILL_CLEAR = 0 +pkg syscall (linux-386), const PR_MCE_KILL_DEFAULT = 2 +pkg syscall (linux-386), const PR_MCE_KILL_EARLY = 1 +pkg syscall (linux-386), const PR_MCE_KILL_GET = 34 +pkg syscall (linux-386), const PR_MCE_KILL_LATE = 0 +pkg syscall (linux-386), const PR_MCE_KILL_SET = 1 +pkg syscall (linux-386), const PR_SET_DUMPABLE = 4 +pkg syscall (linux-386), const PR_SET_ENDIAN = 20 +pkg syscall (linux-386), const PR_SET_FPEMU = 10 +pkg syscall (linux-386), const PR_SET_FPEXC = 12 +pkg syscall (linux-386), const PR_SET_KEEPCAPS = 8 +pkg syscall (linux-386), const PR_SET_NAME = 15 +pkg syscall (linux-386), const PR_SET_PDEATHSIG = 1 +pkg syscall (linux-386), const PR_SET_PTRACER = 1499557217 +pkg syscall (linux-386), const PR_SET_SECCOMP = 22 +pkg syscall (linux-386), const PR_SET_SECUREBITS = 28 +pkg syscall (linux-386), const PR_SET_TIMERSLACK = 29 +pkg syscall (linux-386), const PR_SET_TIMING = 14 +pkg syscall (linux-386), const PR_SET_TSC = 26 +pkg syscall (linux-386), const PR_SET_UNALIGN = 6 +pkg syscall (linux-386), const PR_TASK_PERF_EVENTS_DISABLE = 31 +pkg syscall (linux-386), const PR_TASK_PERF_EVENTS_ENABLE = 32 +pkg syscall (linux-386), const PR_TIMING_STATISTICAL = 0 +pkg syscall (linux-386), const PR_TIMING_TIMESTAMP = 1 +pkg syscall (linux-386), const PR_TSC_ENABLE = 1 +pkg syscall (linux-386), const PR_TSC_SIGSEGV = 2 +pkg syscall (linux-386), const PR_UNALIGN_NOPRINT = 1 +pkg syscall (linux-386), const PR_UNALIGN_SIGBUS = 2 +pkg syscall (linux-386), const PTRACE_ATTACH = 16 +pkg syscall (linux-386), const PTRACE_CONT = 7 +pkg syscall (linux-386), const PTRACE_DETACH = 17 +pkg syscall (linux-386), const PTRACE_EVENT_CLONE = 3 +pkg syscall (linux-386), const PTRACE_EVENT_EXEC = 4 +pkg syscall (linux-386), const PTRACE_EVENT_EXIT = 6 +pkg syscall (linux-386), const PTRACE_EVENT_FORK = 1 +pkg syscall (linux-386), const PTRACE_EVENT_VFORK = 2 +pkg syscall (linux-386), const PTRACE_EVENT_VFORK_DONE = 5 +pkg syscall (linux-386), const PTRACE_GETEVENTMSG = 16897 +pkg syscall (linux-386), const PTRACE_GETFPREGS = 14 +pkg syscall (linux-386), const PTRACE_GETFPXREGS = 18 +pkg syscall (linux-386), const PTRACE_GETREGS = 12 +pkg syscall (linux-386), const PTRACE_GETREGSET = 16900 +pkg syscall (linux-386), const PTRACE_GETSIGINFO = 16898 +pkg syscall (linux-386), const PTRACE_GET_THREAD_AREA = 25 +pkg syscall (linux-386), const PTRACE_KILL = 8 +pkg syscall (linux-386), const PTRACE_OLDSETOPTIONS = 21 +pkg syscall (linux-386), const PTRACE_O_MASK = 127 +pkg syscall (linux-386), const PTRACE_O_TRACECLONE = 8 +pkg syscall (linux-386), const PTRACE_O_TRACEEXEC = 16 +pkg syscall (linux-386), const PTRACE_O_TRACEEXIT = 64 +pkg syscall (linux-386), const PTRACE_O_TRACEFORK = 2 +pkg syscall (linux-386), const PTRACE_O_TRACESYSGOOD = 1 +pkg syscall (linux-386), const PTRACE_O_TRACEVFORK = 4 +pkg syscall (linux-386), const PTRACE_O_TRACEVFORKDONE = 32 +pkg syscall (linux-386), const PTRACE_PEEKDATA = 2 +pkg syscall (linux-386), const PTRACE_PEEKTEXT = 1 +pkg syscall (linux-386), const PTRACE_PEEKUSR = 3 +pkg syscall (linux-386), const PTRACE_POKEDATA = 5 +pkg syscall (linux-386), const PTRACE_POKETEXT = 4 +pkg syscall (linux-386), const PTRACE_POKEUSR = 6 +pkg syscall (linux-386), const PTRACE_SETFPREGS = 15 +pkg syscall (linux-386), const PTRACE_SETFPXREGS = 19 +pkg syscall (linux-386), const PTRACE_SETOPTIONS = 16896 +pkg syscall (linux-386), const PTRACE_SETREGS = 13 +pkg syscall (linux-386), const PTRACE_SETREGSET = 16901 +pkg syscall (linux-386), const PTRACE_SETSIGINFO = 16899 +pkg syscall (linux-386), const PTRACE_SET_THREAD_AREA = 26 +pkg syscall (linux-386), const PTRACE_SINGLEBLOCK = 33 +pkg syscall (linux-386), const PTRACE_SINGLESTEP = 9 +pkg syscall (linux-386), const PTRACE_SYSCALL = 24 +pkg syscall (linux-386), const PTRACE_SYSEMU = 31 +pkg syscall (linux-386), const PTRACE_SYSEMU_SINGLESTEP = 32 +pkg syscall (linux-386), const PTRACE_TRACEME = 0 +pkg syscall (linux-386), const PathMax = 4096 +pkg syscall (linux-386), const RLIMIT_AS = 9 +pkg syscall (linux-386), const RLIMIT_CORE = 4 +pkg syscall (linux-386), const RLIMIT_CPU = 0 +pkg syscall (linux-386), const RLIMIT_DATA = 2 +pkg syscall (linux-386), const RLIMIT_FSIZE = 1 +pkg syscall (linux-386), const RLIMIT_NOFILE = 7 +pkg syscall (linux-386), const RLIMIT_STACK = 3 +pkg syscall (linux-386), const RLIM_INFINITY = -1 +pkg syscall (linux-386), const RTAX_ADVMSS = 8 +pkg syscall (linux-386), const RTAX_CWND = 7 +pkg syscall (linux-386), const RTAX_FEATURES = 12 +pkg syscall (linux-386), const RTAX_FEATURE_ALLFRAG = 8 +pkg syscall (linux-386), const RTAX_FEATURE_ECN = 1 +pkg syscall (linux-386), const RTAX_FEATURE_SACK = 2 +pkg syscall (linux-386), const RTAX_FEATURE_TIMESTAMP = 4 +pkg syscall (linux-386), const RTAX_HOPLIMIT = 10 +pkg syscall (linux-386), const RTAX_INITCWND = 11 +pkg syscall (linux-386), const RTAX_INITRWND = 14 +pkg syscall (linux-386), const RTAX_LOCK = 1 +pkg syscall (linux-386), const RTAX_MAX = 14 +pkg syscall (linux-386), const RTAX_MTU = 2 +pkg syscall (linux-386), const RTAX_REORDERING = 9 +pkg syscall (linux-386), const RTAX_RTO_MIN = 13 +pkg syscall (linux-386), const RTAX_RTT = 4 +pkg syscall (linux-386), const RTAX_RTTVAR = 5 +pkg syscall (linux-386), const RTAX_SSTHRESH = 6 +pkg syscall (linux-386), const RTAX_UNSPEC = 0 +pkg syscall (linux-386), const RTAX_WINDOW = 3 +pkg syscall (linux-386), const RTA_ALIGNTO = 4 +pkg syscall (linux-386), const RTA_CACHEINFO = 12 +pkg syscall (linux-386), const RTA_DST = 1 +pkg syscall (linux-386), const RTA_FLOW = 11 +pkg syscall (linux-386), const RTA_GATEWAY = 5 +pkg syscall (linux-386), const RTA_IIF = 3 +pkg syscall (linux-386), const RTA_MAX = 16 +pkg syscall (linux-386), const RTA_METRICS = 8 +pkg syscall (linux-386), const RTA_MULTIPATH = 9 +pkg syscall (linux-386), const RTA_OIF = 4 +pkg syscall (linux-386), const RTA_PREFSRC = 7 +pkg syscall (linux-386), const RTA_PRIORITY = 6 +pkg syscall (linux-386), const RTA_SRC = 2 +pkg syscall (linux-386), const RTA_TABLE = 15 +pkg syscall (linux-386), const RTA_UNSPEC = 0 +pkg syscall (linux-386), const RTCF_DIRECTSRC = 67108864 +pkg syscall (linux-386), const RTCF_DOREDIRECT = 16777216 +pkg syscall (linux-386), const RTCF_LOG = 33554432 +pkg syscall (linux-386), const RTCF_MASQ = 4194304 +pkg syscall (linux-386), const RTCF_NAT = 8388608 +pkg syscall (linux-386), const RTCF_VALVE = 2097152 +pkg syscall (linux-386), const RTF_ADDRCLASSMASK = 4160749568 +pkg syscall (linux-386), const RTF_ADDRCONF = 262144 +pkg syscall (linux-386), const RTF_ALLONLINK = 131072 +pkg syscall (linux-386), const RTF_BROADCAST = 268435456 +pkg syscall (linux-386), const RTF_CACHE = 16777216 +pkg syscall (linux-386), const RTF_DEFAULT = 65536 +pkg syscall (linux-386), const RTF_DYNAMIC = 16 +pkg syscall (linux-386), const RTF_FLOW = 33554432 +pkg syscall (linux-386), const RTF_GATEWAY = 2 +pkg syscall (linux-386), const RTF_HOST = 4 +pkg syscall (linux-386), const RTF_INTERFACE = 1073741824 +pkg syscall (linux-386), const RTF_IRTT = 256 +pkg syscall (linux-386), const RTF_LINKRT = 1048576 +pkg syscall (linux-386), const RTF_LOCAL = 2147483648 +pkg syscall (linux-386), const RTF_MODIFIED = 32 +pkg syscall (linux-386), const RTF_MSS = 64 +pkg syscall (linux-386), const RTF_MTU = 64 +pkg syscall (linux-386), const RTF_MULTICAST = 536870912 +pkg syscall (linux-386), const RTF_NAT = 134217728 +pkg syscall (linux-386), const RTF_NOFORWARD = 4096 +pkg syscall (linux-386), const RTF_NONEXTHOP = 2097152 +pkg syscall (linux-386), const RTF_NOPMTUDISC = 16384 +pkg syscall (linux-386), const RTF_POLICY = 67108864 +pkg syscall (linux-386), const RTF_REINSTATE = 8 +pkg syscall (linux-386), const RTF_REJECT = 512 +pkg syscall (linux-386), const RTF_STATIC = 1024 +pkg syscall (linux-386), const RTF_THROW = 8192 +pkg syscall (linux-386), const RTF_UP = 1 +pkg syscall (linux-386), const RTF_WINDOW = 128 +pkg syscall (linux-386), const RTF_XRESOLVE = 2048 +pkg syscall (linux-386), const RTM_BASE = 16 +pkg syscall (linux-386), const RTM_DELACTION = 49 +pkg syscall (linux-386), const RTM_DELADDR = 21 +pkg syscall (linux-386), const RTM_DELADDRLABEL = 73 +pkg syscall (linux-386), const RTM_DELLINK = 17 +pkg syscall (linux-386), const RTM_DELNEIGH = 29 +pkg syscall (linux-386), const RTM_DELQDISC = 37 +pkg syscall (linux-386), const RTM_DELROUTE = 25 +pkg syscall (linux-386), const RTM_DELRULE = 33 +pkg syscall (linux-386), const RTM_DELTCLASS = 41 +pkg syscall (linux-386), const RTM_DELTFILTER = 45 +pkg syscall (linux-386), const RTM_F_CLONED = 512 +pkg syscall (linux-386), const RTM_F_EQUALIZE = 1024 +pkg syscall (linux-386), const RTM_F_NOTIFY = 256 +pkg syscall (linux-386), const RTM_F_PREFIX = 2048 +pkg syscall (linux-386), const RTM_GETACTION = 50 +pkg syscall (linux-386), const RTM_GETADDR = 22 +pkg syscall (linux-386), const RTM_GETADDRLABEL = 74 +pkg syscall (linux-386), const RTM_GETANYCAST = 62 +pkg syscall (linux-386), const RTM_GETDCB = 78 +pkg syscall (linux-386), const RTM_GETLINK = 18 +pkg syscall (linux-386), const RTM_GETMULTICAST = 58 +pkg syscall (linux-386), const RTM_GETNEIGH = 30 +pkg syscall (linux-386), const RTM_GETNEIGHTBL = 66 +pkg syscall (linux-386), const RTM_GETQDISC = 38 +pkg syscall (linux-386), const RTM_GETROUTE = 26 +pkg syscall (linux-386), const RTM_GETRULE = 34 +pkg syscall (linux-386), const RTM_GETTCLASS = 42 +pkg syscall (linux-386), const RTM_GETTFILTER = 46 +pkg syscall (linux-386), const RTM_MAX = 79 +pkg syscall (linux-386), const RTM_NEWACTION = 48 +pkg syscall (linux-386), const RTM_NEWADDR = 20 +pkg syscall (linux-386), const RTM_NEWADDRLABEL = 72 +pkg syscall (linux-386), const RTM_NEWLINK = 16 +pkg syscall (linux-386), const RTM_NEWNDUSEROPT = 68 +pkg syscall (linux-386), const RTM_NEWNEIGH = 28 +pkg syscall (linux-386), const RTM_NEWNEIGHTBL = 64 +pkg syscall (linux-386), const RTM_NEWPREFIX = 52 +pkg syscall (linux-386), const RTM_NEWQDISC = 36 +pkg syscall (linux-386), const RTM_NEWROUTE = 24 +pkg syscall (linux-386), const RTM_NEWRULE = 32 +pkg syscall (linux-386), const RTM_NEWTCLASS = 40 +pkg syscall (linux-386), const RTM_NEWTFILTER = 44 +pkg syscall (linux-386), const RTM_NR_FAMILIES = 16 +pkg syscall (linux-386), const RTM_NR_MSGTYPES = 64 +pkg syscall (linux-386), const RTM_SETDCB = 79 +pkg syscall (linux-386), const RTM_SETLINK = 19 +pkg syscall (linux-386), const RTM_SETNEIGHTBL = 67 +pkg syscall (linux-386), const RTNH_ALIGNTO = 4 +pkg syscall (linux-386), const RTNH_F_DEAD = 1 +pkg syscall (linux-386), const RTNH_F_ONLINK = 4 +pkg syscall (linux-386), const RTNH_F_PERVASIVE = 2 +pkg syscall (linux-386), const RTNLGRP_IPV4_IFADDR = 5 +pkg syscall (linux-386), const RTNLGRP_IPV4_IFADDR ideal-int +pkg syscall (linux-386), const RTNLGRP_IPV4_MROUTE = 6 +pkg syscall (linux-386), const RTNLGRP_IPV4_MROUTE ideal-int +pkg syscall (linux-386), const RTNLGRP_IPV4_ROUTE = 7 +pkg syscall (linux-386), const RTNLGRP_IPV4_ROUTE ideal-int +pkg syscall (linux-386), const RTNLGRP_IPV4_RULE = 8 +pkg syscall (linux-386), const RTNLGRP_IPV4_RULE ideal-int +pkg syscall (linux-386), const RTNLGRP_IPV6_IFADDR = 9 +pkg syscall (linux-386), const RTNLGRP_IPV6_IFADDR ideal-int +pkg syscall (linux-386), const RTNLGRP_IPV6_IFINFO = 12 +pkg syscall (linux-386), const RTNLGRP_IPV6_IFINFO ideal-int +pkg syscall (linux-386), const RTNLGRP_IPV6_MROUTE = 10 +pkg syscall (linux-386), const RTNLGRP_IPV6_MROUTE ideal-int +pkg syscall (linux-386), const RTNLGRP_IPV6_PREFIX = 18 +pkg syscall (linux-386), const RTNLGRP_IPV6_PREFIX ideal-int +pkg syscall (linux-386), const RTNLGRP_IPV6_ROUTE = 11 +pkg syscall (linux-386), const RTNLGRP_IPV6_ROUTE ideal-int +pkg syscall (linux-386), const RTNLGRP_IPV6_RULE = 19 +pkg syscall (linux-386), const RTNLGRP_IPV6_RULE ideal-int +pkg syscall (linux-386), const RTNLGRP_LINK = 1 +pkg syscall (linux-386), const RTNLGRP_LINK ideal-int +pkg syscall (linux-386), const RTNLGRP_ND_USEROPT = 20 +pkg syscall (linux-386), const RTNLGRP_ND_USEROPT ideal-int +pkg syscall (linux-386), const RTNLGRP_NEIGH = 3 +pkg syscall (linux-386), const RTNLGRP_NEIGH ideal-int +pkg syscall (linux-386), const RTNLGRP_NONE = 0 +pkg syscall (linux-386), const RTNLGRP_NONE ideal-int +pkg syscall (linux-386), const RTNLGRP_NOTIFY = 2 +pkg syscall (linux-386), const RTNLGRP_NOTIFY ideal-int +pkg syscall (linux-386), const RTNLGRP_TC = 4 +pkg syscall (linux-386), const RTNLGRP_TC ideal-int +pkg syscall (linux-386), const RTN_ANYCAST = 4 +pkg syscall (linux-386), const RTN_BLACKHOLE = 6 +pkg syscall (linux-386), const RTN_BROADCAST = 3 +pkg syscall (linux-386), const RTN_LOCAL = 2 +pkg syscall (linux-386), const RTN_MAX = 11 +pkg syscall (linux-386), const RTN_MULTICAST = 5 +pkg syscall (linux-386), const RTN_NAT = 10 +pkg syscall (linux-386), const RTN_PROHIBIT = 8 +pkg syscall (linux-386), const RTN_THROW = 9 +pkg syscall (linux-386), const RTN_UNICAST = 1 +pkg syscall (linux-386), const RTN_UNREACHABLE = 7 +pkg syscall (linux-386), const RTN_UNSPEC = 0 +pkg syscall (linux-386), const RTN_XRESOLVE = 11 +pkg syscall (linux-386), const RTPROT_BIRD = 12 +pkg syscall (linux-386), const RTPROT_BOOT = 3 +pkg syscall (linux-386), const RTPROT_DHCP = 16 +pkg syscall (linux-386), const RTPROT_DNROUTED = 13 +pkg syscall (linux-386), const RTPROT_GATED = 8 +pkg syscall (linux-386), const RTPROT_KERNEL = 2 +pkg syscall (linux-386), const RTPROT_MRT = 10 +pkg syscall (linux-386), const RTPROT_NTK = 15 +pkg syscall (linux-386), const RTPROT_RA = 9 +pkg syscall (linux-386), const RTPROT_REDIRECT = 1 +pkg syscall (linux-386), const RTPROT_STATIC = 4 +pkg syscall (linux-386), const RTPROT_UNSPEC = 0 +pkg syscall (linux-386), const RTPROT_XORP = 14 +pkg syscall (linux-386), const RTPROT_ZEBRA = 11 +pkg syscall (linux-386), const RT_CLASS_DEFAULT = 253 +pkg syscall (linux-386), const RT_CLASS_LOCAL = 255 +pkg syscall (linux-386), const RT_CLASS_MAIN = 254 +pkg syscall (linux-386), const RT_CLASS_MAX = 255 +pkg syscall (linux-386), const RT_CLASS_UNSPEC = 0 +pkg syscall (linux-386), const RT_SCOPE_HOST = 254 +pkg syscall (linux-386), const RT_SCOPE_LINK = 253 +pkg syscall (linux-386), const RT_SCOPE_NOWHERE = 255 +pkg syscall (linux-386), const RT_SCOPE_SITE = 200 +pkg syscall (linux-386), const RT_SCOPE_UNIVERSE = 0 +pkg syscall (linux-386), const RT_TABLE_COMPAT = 252 +pkg syscall (linux-386), const RT_TABLE_DEFAULT = 253 +pkg syscall (linux-386), const RT_TABLE_LOCAL = 255 +pkg syscall (linux-386), const RT_TABLE_MAIN = 254 +pkg syscall (linux-386), const RT_TABLE_MAX = 4294967295 +pkg syscall (linux-386), const RT_TABLE_UNSPEC = 0 +pkg syscall (linux-386), const RUSAGE_CHILDREN = -1 +pkg syscall (linux-386), const RUSAGE_SELF = 0 +pkg syscall (linux-386), const RUSAGE_THREAD = 1 +pkg syscall (linux-386), const SCM_CREDENTIALS = 2 +pkg syscall (linux-386), const SCM_RIGHTS = 1 +pkg syscall (linux-386), const SCM_TIMESTAMP = 29 +pkg syscall (linux-386), const SCM_TIMESTAMPING = 37 +pkg syscall (linux-386), const SCM_TIMESTAMPNS = 35 +pkg syscall (linux-386), const SIGBUS = 7 +pkg syscall (linux-386), const SIGCHLD = 17 +pkg syscall (linux-386), const SIGCLD = 17 +pkg syscall (linux-386), const SIGCONT = 18 +pkg syscall (linux-386), const SIGIO = 29 +pkg syscall (linux-386), const SIGIOT = 6 +pkg syscall (linux-386), const SIGPOLL = 29 +pkg syscall (linux-386), const SIGPROF = 27 +pkg syscall (linux-386), const SIGPWR = 30 +pkg syscall (linux-386), const SIGSTKFLT = 16 +pkg syscall (linux-386), const SIGSTOP = 19 +pkg syscall (linux-386), const SIGSYS = 31 +pkg syscall (linux-386), const SIGTSTP = 20 +pkg syscall (linux-386), const SIGTTIN = 21 +pkg syscall (linux-386), const SIGTTOU = 22 +pkg syscall (linux-386), const SIGUNUSED = 31 +pkg syscall (linux-386), const SIGURG = 23 +pkg syscall (linux-386), const SIGUSR1 = 10 +pkg syscall (linux-386), const SIGUSR2 = 12 +pkg syscall (linux-386), const SIGVTALRM = 26 +pkg syscall (linux-386), const SIGWINCH = 28 +pkg syscall (linux-386), const SIGXCPU = 24 +pkg syscall (linux-386), const SIGXFSZ = 25 +pkg syscall (linux-386), const SIOCADDDLCI = 35200 +pkg syscall (linux-386), const SIOCADDMULTI = 35121 +pkg syscall (linux-386), const SIOCADDRT = 35083 +pkg syscall (linux-386), const SIOCATMARK = 35077 +pkg syscall (linux-386), const SIOCDARP = 35155 +pkg syscall (linux-386), const SIOCDELDLCI = 35201 +pkg syscall (linux-386), const SIOCDELMULTI = 35122 +pkg syscall (linux-386), const SIOCDELRT = 35084 +pkg syscall (linux-386), const SIOCDEVPRIVATE = 35312 +pkg syscall (linux-386), const SIOCDIFADDR = 35126 +pkg syscall (linux-386), const SIOCDRARP = 35168 +pkg syscall (linux-386), const SIOCGARP = 35156 +pkg syscall (linux-386), const SIOCGIFADDR = 35093 +pkg syscall (linux-386), const SIOCGIFBR = 35136 +pkg syscall (linux-386), const SIOCGIFBRDADDR = 35097 +pkg syscall (linux-386), const SIOCGIFCONF = 35090 +pkg syscall (linux-386), const SIOCGIFCOUNT = 35128 +pkg syscall (linux-386), const SIOCGIFDSTADDR = 35095 +pkg syscall (linux-386), const SIOCGIFENCAP = 35109 +pkg syscall (linux-386), const SIOCGIFFLAGS = 35091 +pkg syscall (linux-386), const SIOCGIFHWADDR = 35111 +pkg syscall (linux-386), const SIOCGIFINDEX = 35123 +pkg syscall (linux-386), const SIOCGIFMAP = 35184 +pkg syscall (linux-386), const SIOCGIFMEM = 35103 +pkg syscall (linux-386), const SIOCGIFMETRIC = 35101 +pkg syscall (linux-386), const SIOCGIFMTU = 35105 +pkg syscall (linux-386), const SIOCGIFNAME = 35088 +pkg syscall (linux-386), const SIOCGIFNETMASK = 35099 +pkg syscall (linux-386), const SIOCGIFPFLAGS = 35125 +pkg syscall (linux-386), const SIOCGIFSLAVE = 35113 +pkg syscall (linux-386), const SIOCGIFTXQLEN = 35138 +pkg syscall (linux-386), const SIOCGPGRP = 35076 +pkg syscall (linux-386), const SIOCGRARP = 35169 +pkg syscall (linux-386), const SIOCGSTAMP = 35078 +pkg syscall (linux-386), const SIOCGSTAMPNS = 35079 +pkg syscall (linux-386), const SIOCPROTOPRIVATE = 35296 +pkg syscall (linux-386), const SIOCRTMSG = 35085 +pkg syscall (linux-386), const SIOCSARP = 35157 +pkg syscall (linux-386), const SIOCSIFADDR = 35094 +pkg syscall (linux-386), const SIOCSIFBR = 35137 +pkg syscall (linux-386), const SIOCSIFBRDADDR = 35098 +pkg syscall (linux-386), const SIOCSIFDSTADDR = 35096 +pkg syscall (linux-386), const SIOCSIFENCAP = 35110 +pkg syscall (linux-386), const SIOCSIFFLAGS = 35092 +pkg syscall (linux-386), const SIOCSIFHWADDR = 35108 +pkg syscall (linux-386), const SIOCSIFHWBROADCAST = 35127 +pkg syscall (linux-386), const SIOCSIFLINK = 35089 +pkg syscall (linux-386), const SIOCSIFMAP = 35185 +pkg syscall (linux-386), const SIOCSIFMEM = 35104 +pkg syscall (linux-386), const SIOCSIFMETRIC = 35102 +pkg syscall (linux-386), const SIOCSIFMTU = 35106 +pkg syscall (linux-386), const SIOCSIFNAME = 35107 +pkg syscall (linux-386), const SIOCSIFNETMASK = 35100 +pkg syscall (linux-386), const SIOCSIFPFLAGS = 35124 +pkg syscall (linux-386), const SIOCSIFSLAVE = 35120 +pkg syscall (linux-386), const SIOCSIFTXQLEN = 35139 +pkg syscall (linux-386), const SIOCSPGRP = 35074 +pkg syscall (linux-386), const SIOCSRARP = 35170 +pkg syscall (linux-386), const SOCK_CLOEXEC = 524288 +pkg syscall (linux-386), const SOCK_DCCP = 6 +pkg syscall (linux-386), const SOCK_NONBLOCK = 2048 +pkg syscall (linux-386), const SOCK_PACKET = 10 +pkg syscall (linux-386), const SOCK_RDM = 4 +pkg syscall (linux-386), const SOL_AAL = 265 +pkg syscall (linux-386), const SOL_ATM = 264 +pkg syscall (linux-386), const SOL_DECNET = 261 +pkg syscall (linux-386), const SOL_ICMPV6 = 58 +pkg syscall (linux-386), const SOL_IP = 0 +pkg syscall (linux-386), const SOL_IPV6 = 41 +pkg syscall (linux-386), const SOL_IRDA = 266 +pkg syscall (linux-386), const SOL_PACKET = 263 +pkg syscall (linux-386), const SOL_RAW = 255 +pkg syscall (linux-386), const SOL_SOCKET = 1 +pkg syscall (linux-386), const SOL_TCP = 6 +pkg syscall (linux-386), const SOL_X25 = 262 +pkg syscall (linux-386), const SOMAXCONN = 128 +pkg syscall (linux-386), const SO_ACCEPTCONN = 30 +pkg syscall (linux-386), const SO_ATTACH_FILTER = 26 +pkg syscall (linux-386), const SO_BINDTODEVICE = 25 +pkg syscall (linux-386), const SO_BROADCAST = 6 +pkg syscall (linux-386), const SO_BSDCOMPAT = 14 +pkg syscall (linux-386), const SO_DEBUG = 1 +pkg syscall (linux-386), const SO_DETACH_FILTER = 27 +pkg syscall (linux-386), const SO_DOMAIN = 39 +pkg syscall (linux-386), const SO_DONTROUTE = 5 +pkg syscall (linux-386), const SO_ERROR = 4 +pkg syscall (linux-386), const SO_KEEPALIVE = 9 +pkg syscall (linux-386), const SO_LINGER = 13 +pkg syscall (linux-386), const SO_MARK = 36 +pkg syscall (linux-386), const SO_NO_CHECK = 11 +pkg syscall (linux-386), const SO_OOBINLINE = 10 +pkg syscall (linux-386), const SO_PASSCRED = 16 +pkg syscall (linux-386), const SO_PASSSEC = 34 +pkg syscall (linux-386), const SO_PEERCRED = 17 +pkg syscall (linux-386), const SO_PEERNAME = 28 +pkg syscall (linux-386), const SO_PEERSEC = 31 +pkg syscall (linux-386), const SO_PRIORITY = 12 +pkg syscall (linux-386), const SO_PROTOCOL = 38 +pkg syscall (linux-386), const SO_RCVBUF = 8 +pkg syscall (linux-386), const SO_RCVBUFFORCE = 33 +pkg syscall (linux-386), const SO_RCVLOWAT = 18 +pkg syscall (linux-386), const SO_RCVTIMEO = 20 +pkg syscall (linux-386), const SO_REUSEADDR = 2 +pkg syscall (linux-386), const SO_RXQ_OVFL = 40 +pkg syscall (linux-386), const SO_SECURITY_AUTHENTICATION = 22 +pkg syscall (linux-386), const SO_SECURITY_ENCRYPTION_NETWORK = 24 +pkg syscall (linux-386), const SO_SECURITY_ENCRYPTION_TRANSPORT = 23 +pkg syscall (linux-386), const SO_SNDBUF = 7 +pkg syscall (linux-386), const SO_SNDBUFFORCE = 32 +pkg syscall (linux-386), const SO_SNDLOWAT = 19 +pkg syscall (linux-386), const SO_SNDTIMEO = 21 +pkg syscall (linux-386), const SO_TIMESTAMP = 29 +pkg syscall (linux-386), const SO_TIMESTAMPING = 37 +pkg syscall (linux-386), const SO_TIMESTAMPNS = 35 +pkg syscall (linux-386), const SO_TYPE = 3 +pkg syscall (linux-386), const SYS_ACCESS = 33 +pkg syscall (linux-386), const SYS_ACCT = 51 +pkg syscall (linux-386), const SYS_ADD_KEY = 286 +pkg syscall (linux-386), const SYS_ADJTIMEX = 124 +pkg syscall (linux-386), const SYS_AFS_SYSCALL = 137 +pkg syscall (linux-386), const SYS_ALARM = 27 +pkg syscall (linux-386), const SYS_BDFLUSH = 134 +pkg syscall (linux-386), const SYS_BREAK = 17 +pkg syscall (linux-386), const SYS_BRK = 45 +pkg syscall (linux-386), const SYS_CAPGET = 184 +pkg syscall (linux-386), const SYS_CAPSET = 185 +pkg syscall (linux-386), const SYS_CHDIR = 12 +pkg syscall (linux-386), const SYS_CHMOD = 15 +pkg syscall (linux-386), const SYS_CHOWN = 182 +pkg syscall (linux-386), const SYS_CHOWN32 = 212 +pkg syscall (linux-386), const SYS_CHROOT = 61 +pkg syscall (linux-386), const SYS_CLOCK_GETRES = 266 +pkg syscall (linux-386), const SYS_CLOCK_GETTIME = 265 +pkg syscall (linux-386), const SYS_CLOCK_NANOSLEEP = 267 +pkg syscall (linux-386), const SYS_CLOCK_SETTIME = 264 +pkg syscall (linux-386), const SYS_CLONE = 120 +pkg syscall (linux-386), const SYS_CLOSE = 6 +pkg syscall (linux-386), const SYS_CREAT = 8 +pkg syscall (linux-386), const SYS_CREATE_MODULE = 127 +pkg syscall (linux-386), const SYS_DELETE_MODULE = 129 +pkg syscall (linux-386), const SYS_DUP = 41 +pkg syscall (linux-386), const SYS_DUP2 = 63 +pkg syscall (linux-386), const SYS_DUP3 = 330 +pkg syscall (linux-386), const SYS_EPOLL_CREATE = 254 +pkg syscall (linux-386), const SYS_EPOLL_CREATE1 = 329 +pkg syscall (linux-386), const SYS_EPOLL_CTL = 255 +pkg syscall (linux-386), const SYS_EPOLL_PWAIT = 319 +pkg syscall (linux-386), const SYS_EPOLL_WAIT = 256 +pkg syscall (linux-386), const SYS_EVENTFD = 323 +pkg syscall (linux-386), const SYS_EVENTFD2 = 328 +pkg syscall (linux-386), const SYS_EXECVE = 11 +pkg syscall (linux-386), const SYS_EXIT = 1 +pkg syscall (linux-386), const SYS_EXIT_GROUP = 252 +pkg syscall (linux-386), const SYS_FACCESSAT = 307 +pkg syscall (linux-386), const SYS_FADVISE64 = 250 +pkg syscall (linux-386), const SYS_FADVISE64_64 = 272 +pkg syscall (linux-386), const SYS_FALLOCATE = 324 +pkg syscall (linux-386), const SYS_FANOTIFY_INIT = 338 +pkg syscall (linux-386), const SYS_FANOTIFY_MARK = 339 +pkg syscall (linux-386), const SYS_FCHDIR = 133 +pkg syscall (linux-386), const SYS_FCHMOD = 94 +pkg syscall (linux-386), const SYS_FCHMODAT = 306 +pkg syscall (linux-386), const SYS_FCHOWN = 95 +pkg syscall (linux-386), const SYS_FCHOWN32 = 207 +pkg syscall (linux-386), const SYS_FCHOWNAT = 298 +pkg syscall (linux-386), const SYS_FCNTL = 55 +pkg syscall (linux-386), const SYS_FCNTL64 = 221 +pkg syscall (linux-386), const SYS_FDATASYNC = 148 +pkg syscall (linux-386), const SYS_FGETXATTR = 231 +pkg syscall (linux-386), const SYS_FLISTXATTR = 234 +pkg syscall (linux-386), const SYS_FLOCK = 143 +pkg syscall (linux-386), const SYS_FORK = 2 +pkg syscall (linux-386), const SYS_FREMOVEXATTR = 237 +pkg syscall (linux-386), const SYS_FSETXATTR = 228 +pkg syscall (linux-386), const SYS_FSTAT = 108 +pkg syscall (linux-386), const SYS_FSTAT64 = 197 +pkg syscall (linux-386), const SYS_FSTATAT64 = 300 +pkg syscall (linux-386), const SYS_FSTATFS = 100 +pkg syscall (linux-386), const SYS_FSTATFS64 = 269 +pkg syscall (linux-386), const SYS_FSYNC = 118 +pkg syscall (linux-386), const SYS_FTIME = 35 +pkg syscall (linux-386), const SYS_FTRUNCATE = 93 +pkg syscall (linux-386), const SYS_FTRUNCATE64 = 194 +pkg syscall (linux-386), const SYS_FUTEX = 240 +pkg syscall (linux-386), const SYS_FUTIMESAT = 299 +pkg syscall (linux-386), const SYS_GETCPU = 318 +pkg syscall (linux-386), const SYS_GETCWD = 183 +pkg syscall (linux-386), const SYS_GETDENTS = 141 +pkg syscall (linux-386), const SYS_GETDENTS64 = 220 +pkg syscall (linux-386), const SYS_GETEGID = 50 +pkg syscall (linux-386), const SYS_GETEGID32 = 202 +pkg syscall (linux-386), const SYS_GETEUID = 49 +pkg syscall (linux-386), const SYS_GETEUID32 = 201 +pkg syscall (linux-386), const SYS_GETGID = 47 +pkg syscall (linux-386), const SYS_GETGID32 = 200 +pkg syscall (linux-386), const SYS_GETGROUPS = 80 +pkg syscall (linux-386), const SYS_GETGROUPS32 = 205 +pkg syscall (linux-386), const SYS_GETITIMER = 105 +pkg syscall (linux-386), const SYS_GETPGID = 132 +pkg syscall (linux-386), const SYS_GETPGRP = 65 +pkg syscall (linux-386), const SYS_GETPID = 20 +pkg syscall (linux-386), const SYS_GETPMSG = 188 +pkg syscall (linux-386), const SYS_GETPPID = 64 +pkg syscall (linux-386), const SYS_GETPRIORITY = 96 +pkg syscall (linux-386), const SYS_GETRESGID = 171 +pkg syscall (linux-386), const SYS_GETRESGID32 = 211 +pkg syscall (linux-386), const SYS_GETRESUID = 165 +pkg syscall (linux-386), const SYS_GETRESUID32 = 209 +pkg syscall (linux-386), const SYS_GETRLIMIT = 76 +pkg syscall (linux-386), const SYS_GETRUSAGE = 77 +pkg syscall (linux-386), const SYS_GETSID = 147 +pkg syscall (linux-386), const SYS_GETTID = 224 +pkg syscall (linux-386), const SYS_GETTIMEOFDAY = 78 +pkg syscall (linux-386), const SYS_GETUID = 24 +pkg syscall (linux-386), const SYS_GETUID32 = 199 +pkg syscall (linux-386), const SYS_GETXATTR = 229 +pkg syscall (linux-386), const SYS_GET_KERNEL_SYMS = 130 +pkg syscall (linux-386), const SYS_GET_MEMPOLICY = 275 +pkg syscall (linux-386), const SYS_GET_ROBUST_LIST = 312 +pkg syscall (linux-386), const SYS_GET_THREAD_AREA = 244 +pkg syscall (linux-386), const SYS_GTTY = 32 +pkg syscall (linux-386), const SYS_IDLE = 112 +pkg syscall (linux-386), const SYS_INIT_MODULE = 128 +pkg syscall (linux-386), const SYS_INOTIFY_ADD_WATCH = 292 +pkg syscall (linux-386), const SYS_INOTIFY_INIT = 291 +pkg syscall (linux-386), const SYS_INOTIFY_INIT1 = 332 +pkg syscall (linux-386), const SYS_INOTIFY_RM_WATCH = 293 +pkg syscall (linux-386), const SYS_IOCTL = 54 +pkg syscall (linux-386), const SYS_IOPERM = 101 +pkg syscall (linux-386), const SYS_IOPL = 110 +pkg syscall (linux-386), const SYS_IOPRIO_GET = 290 +pkg syscall (linux-386), const SYS_IOPRIO_SET = 289 +pkg syscall (linux-386), const SYS_IO_CANCEL = 249 +pkg syscall (linux-386), const SYS_IO_DESTROY = 246 +pkg syscall (linux-386), const SYS_IO_GETEVENTS = 247 +pkg syscall (linux-386), const SYS_IO_SETUP = 245 +pkg syscall (linux-386), const SYS_IO_SUBMIT = 248 +pkg syscall (linux-386), const SYS_IPC = 117 +pkg syscall (linux-386), const SYS_KEXEC_LOAD = 283 +pkg syscall (linux-386), const SYS_KEYCTL = 288 +pkg syscall (linux-386), const SYS_KILL = 37 +pkg syscall (linux-386), const SYS_LCHOWN = 16 +pkg syscall (linux-386), const SYS_LCHOWN32 = 198 +pkg syscall (linux-386), const SYS_LGETXATTR = 230 +pkg syscall (linux-386), const SYS_LINK = 9 +pkg syscall (linux-386), const SYS_LINKAT = 303 +pkg syscall (linux-386), const SYS_LISTXATTR = 232 +pkg syscall (linux-386), const SYS_LLISTXATTR = 233 +pkg syscall (linux-386), const SYS_LOCK = 53 +pkg syscall (linux-386), const SYS_LOOKUP_DCOOKIE = 253 +pkg syscall (linux-386), const SYS_LREMOVEXATTR = 236 +pkg syscall (linux-386), const SYS_LSEEK = 19 +pkg syscall (linux-386), const SYS_LSETXATTR = 227 +pkg syscall (linux-386), const SYS_LSTAT = 107 +pkg syscall (linux-386), const SYS_LSTAT64 = 196 +pkg syscall (linux-386), const SYS_MADVISE = 219 +pkg syscall (linux-386), const SYS_MADVISE1 = 219 +pkg syscall (linux-386), const SYS_MBIND = 274 +pkg syscall (linux-386), const SYS_MIGRATE_PAGES = 294 +pkg syscall (linux-386), const SYS_MINCORE = 218 +pkg syscall (linux-386), const SYS_MKDIR = 39 +pkg syscall (linux-386), const SYS_MKDIRAT = 296 +pkg syscall (linux-386), const SYS_MKNOD = 14 +pkg syscall (linux-386), const SYS_MKNODAT = 297 +pkg syscall (linux-386), const SYS_MLOCK = 150 +pkg syscall (linux-386), const SYS_MLOCKALL = 152 +pkg syscall (linux-386), const SYS_MMAP = 90 +pkg syscall (linux-386), const SYS_MMAP2 = 192 +pkg syscall (linux-386), const SYS_MODIFY_LDT = 123 +pkg syscall (linux-386), const SYS_MOUNT = 21 +pkg syscall (linux-386), const SYS_MOVE_PAGES = 317 +pkg syscall (linux-386), const SYS_MPROTECT = 125 +pkg syscall (linux-386), const SYS_MPX = 56 +pkg syscall (linux-386), const SYS_MQ_GETSETATTR = 282 +pkg syscall (linux-386), const SYS_MQ_NOTIFY = 281 +pkg syscall (linux-386), const SYS_MQ_OPEN = 277 +pkg syscall (linux-386), const SYS_MQ_TIMEDRECEIVE = 280 +pkg syscall (linux-386), const SYS_MQ_TIMEDSEND = 279 +pkg syscall (linux-386), const SYS_MQ_UNLINK = 278 +pkg syscall (linux-386), const SYS_MREMAP = 163 +pkg syscall (linux-386), const SYS_MSYNC = 144 +pkg syscall (linux-386), const SYS_MUNLOCK = 151 +pkg syscall (linux-386), const SYS_MUNLOCKALL = 153 +pkg syscall (linux-386), const SYS_MUNMAP = 91 +pkg syscall (linux-386), const SYS_NANOSLEEP = 162 +pkg syscall (linux-386), const SYS_NFSSERVCTL = 169 +pkg syscall (linux-386), const SYS_NICE = 34 +pkg syscall (linux-386), const SYS_OLDFSTAT = 28 +pkg syscall (linux-386), const SYS_OLDLSTAT = 84 +pkg syscall (linux-386), const SYS_OLDOLDUNAME = 59 +pkg syscall (linux-386), const SYS_OLDSTAT = 18 +pkg syscall (linux-386), const SYS_OLDUNAME = 109 +pkg syscall (linux-386), const SYS_OPEN = 5 +pkg syscall (linux-386), const SYS_OPENAT = 295 +pkg syscall (linux-386), const SYS_PAUSE = 29 +pkg syscall (linux-386), const SYS_PERF_EVENT_OPEN = 336 +pkg syscall (linux-386), const SYS_PERSONALITY = 136 +pkg syscall (linux-386), const SYS_PIPE = 42 +pkg syscall (linux-386), const SYS_PIPE2 = 331 +pkg syscall (linux-386), const SYS_PIVOT_ROOT = 217 +pkg syscall (linux-386), const SYS_POLL = 168 +pkg syscall (linux-386), const SYS_PPOLL = 309 +pkg syscall (linux-386), const SYS_PRCTL = 172 +pkg syscall (linux-386), const SYS_PREAD64 = 180 +pkg syscall (linux-386), const SYS_PREADV = 333 +pkg syscall (linux-386), const SYS_PRLIMIT64 = 340 +pkg syscall (linux-386), const SYS_PROF = 44 +pkg syscall (linux-386), const SYS_PROFIL = 98 +pkg syscall (linux-386), const SYS_PSELECT6 = 308 +pkg syscall (linux-386), const SYS_PTRACE = 26 +pkg syscall (linux-386), const SYS_PUTPMSG = 189 +pkg syscall (linux-386), const SYS_PWRITE64 = 181 +pkg syscall (linux-386), const SYS_PWRITEV = 334 +pkg syscall (linux-386), const SYS_QUERY_MODULE = 167 +pkg syscall (linux-386), const SYS_QUOTACTL = 131 +pkg syscall (linux-386), const SYS_READ = 3 +pkg syscall (linux-386), const SYS_READAHEAD = 225 +pkg syscall (linux-386), const SYS_READDIR = 89 +pkg syscall (linux-386), const SYS_READLINK = 85 +pkg syscall (linux-386), const SYS_READLINKAT = 305 +pkg syscall (linux-386), const SYS_READV = 145 +pkg syscall (linux-386), const SYS_REBOOT = 88 +pkg syscall (linux-386), const SYS_RECVMMSG = 337 +pkg syscall (linux-386), const SYS_REMAP_FILE_PAGES = 257 +pkg syscall (linux-386), const SYS_REMOVEXATTR = 235 +pkg syscall (linux-386), const SYS_RENAME = 38 +pkg syscall (linux-386), const SYS_RENAMEAT = 302 +pkg syscall (linux-386), const SYS_REQUEST_KEY = 287 +pkg syscall (linux-386), const SYS_RESTART_SYSCALL = 0 +pkg syscall (linux-386), const SYS_RMDIR = 40 +pkg syscall (linux-386), const SYS_RT_SIGACTION = 174 +pkg syscall (linux-386), const SYS_RT_SIGPENDING = 176 +pkg syscall (linux-386), const SYS_RT_SIGPROCMASK = 175 +pkg syscall (linux-386), const SYS_RT_SIGQUEUEINFO = 178 +pkg syscall (linux-386), const SYS_RT_SIGRETURN = 173 +pkg syscall (linux-386), const SYS_RT_SIGSUSPEND = 179 +pkg syscall (linux-386), const SYS_RT_SIGTIMEDWAIT = 177 +pkg syscall (linux-386), const SYS_RT_TGSIGQUEUEINFO = 335 +pkg syscall (linux-386), const SYS_SCHED_GETAFFINITY = 242 +pkg syscall (linux-386), const SYS_SCHED_GETPARAM = 155 +pkg syscall (linux-386), const SYS_SCHED_GETSCHEDULER = 157 +pkg syscall (linux-386), const SYS_SCHED_GET_PRIORITY_MAX = 159 +pkg syscall (linux-386), const SYS_SCHED_GET_PRIORITY_MIN = 160 +pkg syscall (linux-386), const SYS_SCHED_RR_GET_INTERVAL = 161 +pkg syscall (linux-386), const SYS_SCHED_SETAFFINITY = 241 +pkg syscall (linux-386), const SYS_SCHED_SETPARAM = 154 +pkg syscall (linux-386), const SYS_SCHED_SETSCHEDULER = 156 +pkg syscall (linux-386), const SYS_SCHED_YIELD = 158 +pkg syscall (linux-386), const SYS_SELECT = 82 +pkg syscall (linux-386), const SYS_SENDFILE = 187 +pkg syscall (linux-386), const SYS_SENDFILE64 = 239 +pkg syscall (linux-386), const SYS_SETDOMAINNAME = 121 +pkg syscall (linux-386), const SYS_SETFSGID = 139 +pkg syscall (linux-386), const SYS_SETFSGID32 = 216 +pkg syscall (linux-386), const SYS_SETFSUID = 138 +pkg syscall (linux-386), const SYS_SETFSUID32 = 215 +pkg syscall (linux-386), const SYS_SETGID = 46 +pkg syscall (linux-386), const SYS_SETGID32 = 214 +pkg syscall (linux-386), const SYS_SETGROUPS = 81 +pkg syscall (linux-386), const SYS_SETGROUPS32 = 206 +pkg syscall (linux-386), const SYS_SETHOSTNAME = 74 +pkg syscall (linux-386), const SYS_SETITIMER = 104 +pkg syscall (linux-386), const SYS_SETPGID = 57 +pkg syscall (linux-386), const SYS_SETPRIORITY = 97 +pkg syscall (linux-386), const SYS_SETREGID = 71 +pkg syscall (linux-386), const SYS_SETREGID32 = 204 +pkg syscall (linux-386), const SYS_SETRESGID = 170 +pkg syscall (linux-386), const SYS_SETRESGID32 = 210 +pkg syscall (linux-386), const SYS_SETRESUID = 164 +pkg syscall (linux-386), const SYS_SETRESUID32 = 208 +pkg syscall (linux-386), const SYS_SETREUID = 70 +pkg syscall (linux-386), const SYS_SETREUID32 = 203 +pkg syscall (linux-386), const SYS_SETRLIMIT = 75 +pkg syscall (linux-386), const SYS_SETSID = 66 +pkg syscall (linux-386), const SYS_SETTIMEOFDAY = 79 +pkg syscall (linux-386), const SYS_SETUID = 23 +pkg syscall (linux-386), const SYS_SETUID32 = 213 +pkg syscall (linux-386), const SYS_SETXATTR = 226 +pkg syscall (linux-386), const SYS_SET_MEMPOLICY = 276 +pkg syscall (linux-386), const SYS_SET_ROBUST_LIST = 311 +pkg syscall (linux-386), const SYS_SET_THREAD_AREA = 243 +pkg syscall (linux-386), const SYS_SET_TID_ADDRESS = 258 +pkg syscall (linux-386), const SYS_SGETMASK = 68 +pkg syscall (linux-386), const SYS_SIGACTION = 67 +pkg syscall (linux-386), const SYS_SIGALTSTACK = 186 +pkg syscall (linux-386), const SYS_SIGNAL = 48 +pkg syscall (linux-386), const SYS_SIGNALFD = 321 +pkg syscall (linux-386), const SYS_SIGNALFD4 = 327 +pkg syscall (linux-386), const SYS_SIGPENDING = 73 +pkg syscall (linux-386), const SYS_SIGPROCMASK = 126 +pkg syscall (linux-386), const SYS_SIGRETURN = 119 +pkg syscall (linux-386), const SYS_SIGSUSPEND = 72 +pkg syscall (linux-386), const SYS_SOCKETCALL = 102 +pkg syscall (linux-386), const SYS_SPLICE = 313 +pkg syscall (linux-386), const SYS_SSETMASK = 69 +pkg syscall (linux-386), const SYS_STAT = 106 +pkg syscall (linux-386), const SYS_STAT64 = 195 +pkg syscall (linux-386), const SYS_STATFS = 99 +pkg syscall (linux-386), const SYS_STATFS64 = 268 +pkg syscall (linux-386), const SYS_STIME = 25 +pkg syscall (linux-386), const SYS_STTY = 31 +pkg syscall (linux-386), const SYS_SWAPOFF = 115 +pkg syscall (linux-386), const SYS_SWAPON = 87 +pkg syscall (linux-386), const SYS_SYMLINK = 83 +pkg syscall (linux-386), const SYS_SYMLINKAT = 304 +pkg syscall (linux-386), const SYS_SYNC = 36 +pkg syscall (linux-386), const SYS_SYNC_FILE_RANGE = 314 +pkg syscall (linux-386), const SYS_SYSFS = 135 +pkg syscall (linux-386), const SYS_SYSINFO = 116 +pkg syscall (linux-386), const SYS_SYSLOG = 103 +pkg syscall (linux-386), const SYS_TEE = 315 +pkg syscall (linux-386), const SYS_TGKILL = 270 +pkg syscall (linux-386), const SYS_TIME = 13 +pkg syscall (linux-386), const SYS_TIMERFD_CREATE = 322 +pkg syscall (linux-386), const SYS_TIMERFD_GETTIME = 326 +pkg syscall (linux-386), const SYS_TIMERFD_SETTIME = 325 +pkg syscall (linux-386), const SYS_TIMER_CREATE = 259 +pkg syscall (linux-386), const SYS_TIMER_DELETE = 263 +pkg syscall (linux-386), const SYS_TIMER_GETOVERRUN = 262 +pkg syscall (linux-386), const SYS_TIMER_GETTIME = 261 +pkg syscall (linux-386), const SYS_TIMER_SETTIME = 260 +pkg syscall (linux-386), const SYS_TIMES = 43 +pkg syscall (linux-386), const SYS_TKILL = 238 +pkg syscall (linux-386), const SYS_TRUNCATE = 92 +pkg syscall (linux-386), const SYS_TRUNCATE64 = 193 +pkg syscall (linux-386), const SYS_UGETRLIMIT = 191 +pkg syscall (linux-386), const SYS_ULIMIT = 58 +pkg syscall (linux-386), const SYS_UMASK = 60 +pkg syscall (linux-386), const SYS_UMOUNT = 22 +pkg syscall (linux-386), const SYS_UMOUNT2 = 52 +pkg syscall (linux-386), const SYS_UNAME = 122 +pkg syscall (linux-386), const SYS_UNLINK = 10 +pkg syscall (linux-386), const SYS_UNLINKAT = 301 +pkg syscall (linux-386), const SYS_UNSHARE = 310 +pkg syscall (linux-386), const SYS_USELIB = 86 +pkg syscall (linux-386), const SYS_USTAT = 62 +pkg syscall (linux-386), const SYS_UTIME = 30 +pkg syscall (linux-386), const SYS_UTIMENSAT = 320 +pkg syscall (linux-386), const SYS_UTIMES = 271 +pkg syscall (linux-386), const SYS_VFORK = 190 +pkg syscall (linux-386), const SYS_VHANGUP = 111 +pkg syscall (linux-386), const SYS_VM86 = 166 +pkg syscall (linux-386), const SYS_VM86OLD = 113 +pkg syscall (linux-386), const SYS_VMSPLICE = 316 +pkg syscall (linux-386), const SYS_VSERVER = 273 +pkg syscall (linux-386), const SYS_WAIT4 = 114 +pkg syscall (linux-386), const SYS_WAITID = 284 +pkg syscall (linux-386), const SYS_WAITPID = 7 +pkg syscall (linux-386), const SYS_WRITE = 4 +pkg syscall (linux-386), const SYS_WRITEV = 146 +pkg syscall (linux-386), const SYS__LLSEEK = 140 +pkg syscall (linux-386), const SYS__NEWSELECT = 142 +pkg syscall (linux-386), const SYS__SYSCTL = 149 +pkg syscall (linux-386), const S_BLKSIZE = 512 +pkg syscall (linux-386), const S_IEXEC = 64 +pkg syscall (linux-386), const S_IFMT = 61440 +pkg syscall (linux-386), const S_IREAD = 256 +pkg syscall (linux-386), const S_IRGRP = 32 +pkg syscall (linux-386), const S_IROTH = 4 +pkg syscall (linux-386), const S_IRWXG = 56 +pkg syscall (linux-386), const S_IRWXO = 7 +pkg syscall (linux-386), const S_IRWXU = 448 +pkg syscall (linux-386), const S_IWGRP = 16 +pkg syscall (linux-386), const S_IWOTH = 2 +pkg syscall (linux-386), const S_IWRITE = 128 +pkg syscall (linux-386), const S_IXGRP = 8 +pkg syscall (linux-386), const S_IXOTH = 1 +pkg syscall (linux-386), const SizeofCmsghdr = 12 +pkg syscall (linux-386), const SizeofIPMreq = 8 +pkg syscall (linux-386), const SizeofIPMreqn = 12 +pkg syscall (linux-386), const SizeofIPv6Mreq = 20 +pkg syscall (linux-386), const SizeofIfAddrmsg = 8 +pkg syscall (linux-386), const SizeofIfInfomsg = 16 +pkg syscall (linux-386), const SizeofInet4Pktinfo = 12 +pkg syscall (linux-386), const SizeofInet6Pktinfo = 20 +pkg syscall (linux-386), const SizeofInotifyEvent = 16 +pkg syscall (linux-386), const SizeofLinger = 8 +pkg syscall (linux-386), const SizeofMsghdr = 28 +pkg syscall (linux-386), const SizeofNlAttr = 4 +pkg syscall (linux-386), const SizeofNlMsgerr = 20 +pkg syscall (linux-386), const SizeofNlMsghdr = 16 +pkg syscall (linux-386), const SizeofRtAttr = 4 +pkg syscall (linux-386), const SizeofRtGenmsg = 1 +pkg syscall (linux-386), const SizeofRtMsg = 12 +pkg syscall (linux-386), const SizeofRtNexthop = 8 +pkg syscall (linux-386), const SizeofSockFilter = 8 +pkg syscall (linux-386), const SizeofSockFprog = 8 +pkg syscall (linux-386), const SizeofSockaddrAny = 112 +pkg syscall (linux-386), const SizeofSockaddrInet4 = 16 +pkg syscall (linux-386), const SizeofSockaddrInet6 = 28 +pkg syscall (linux-386), const SizeofSockaddrLinklayer = 20 +pkg syscall (linux-386), const SizeofSockaddrNetlink = 12 +pkg syscall (linux-386), const SizeofSockaddrUnix = 110 +pkg syscall (linux-386), const SizeofTCPInfo = 104 +pkg syscall (linux-386), const SizeofTCPInfo ideal-int +pkg syscall (linux-386), const SizeofUcred = 12 +pkg syscall (linux-386), const TCGETS = 21505 +pkg syscall (linux-386), const TCP_CONGESTION = 13 +pkg syscall (linux-386), const TCP_CORK = 3 +pkg syscall (linux-386), const TCP_DEFER_ACCEPT = 9 +pkg syscall (linux-386), const TCP_INFO = 11 +pkg syscall (linux-386), const TCP_KEEPCNT = 6 +pkg syscall (linux-386), const TCP_KEEPIDLE = 4 +pkg syscall (linux-386), const TCP_KEEPINTVL = 5 +pkg syscall (linux-386), const TCP_LINGER2 = 8 +pkg syscall (linux-386), const TCP_MAXSEG = 2 +pkg syscall (linux-386), const TCP_MAXWIN = 65535 +pkg syscall (linux-386), const TCP_MAX_WINSHIFT = 14 +pkg syscall (linux-386), const TCP_MD5SIG = 14 +pkg syscall (linux-386), const TCP_MD5SIG_MAXKEYLEN = 80 +pkg syscall (linux-386), const TCP_MSS = 512 +pkg syscall (linux-386), const TCP_QUICKACK = 12 +pkg syscall (linux-386), const TCP_SYNCNT = 7 +pkg syscall (linux-386), const TCP_WINDOW_CLAMP = 10 +pkg syscall (linux-386), const TCSETS = 21506 +pkg syscall (linux-386), const TIOCCBRK = 21544 +pkg syscall (linux-386), const TIOCCONS = 21533 +pkg syscall (linux-386), const TIOCEXCL = 21516 +pkg syscall (linux-386), const TIOCGDEV = 2147767346 +pkg syscall (linux-386), const TIOCGETD = 21540 +pkg syscall (linux-386), const TIOCGICOUNT = 21597 +pkg syscall (linux-386), const TIOCGLCKTRMIOS = 21590 +pkg syscall (linux-386), const TIOCGPGRP = 21519 +pkg syscall (linux-386), const TIOCGPTN = 2147767344 +pkg syscall (linux-386), const TIOCGRS485 = 21550 +pkg syscall (linux-386), const TIOCGSERIAL = 21534 +pkg syscall (linux-386), const TIOCGSID = 21545 +pkg syscall (linux-386), const TIOCGSOFTCAR = 21529 +pkg syscall (linux-386), const TIOCGWINSZ = 21523 +pkg syscall (linux-386), const TIOCINQ = 21531 +pkg syscall (linux-386), const TIOCLINUX = 21532 +pkg syscall (linux-386), const TIOCMBIC = 21527 +pkg syscall (linux-386), const TIOCMBIS = 21526 +pkg syscall (linux-386), const TIOCMGET = 21525 +pkg syscall (linux-386), const TIOCMIWAIT = 21596 +pkg syscall (linux-386), const TIOCMSET = 21528 +pkg syscall (linux-386), const TIOCM_CAR = 64 +pkg syscall (linux-386), const TIOCM_CD = 64 +pkg syscall (linux-386), const TIOCM_CTS = 32 +pkg syscall (linux-386), const TIOCM_DSR = 256 +pkg syscall (linux-386), const TIOCM_DTR = 2 +pkg syscall (linux-386), const TIOCM_LE = 1 +pkg syscall (linux-386), const TIOCM_RI = 128 +pkg syscall (linux-386), const TIOCM_RNG = 128 +pkg syscall (linux-386), const TIOCM_RTS = 4 +pkg syscall (linux-386), const TIOCM_SR = 16 +pkg syscall (linux-386), const TIOCM_ST = 8 +pkg syscall (linux-386), const TIOCNOTTY = 21538 +pkg syscall (linux-386), const TIOCNXCL = 21517 +pkg syscall (linux-386), const TIOCOUTQ = 21521 +pkg syscall (linux-386), const TIOCPKT = 21536 +pkg syscall (linux-386), const TIOCPKT_DATA = 0 +pkg syscall (linux-386), const TIOCPKT_DOSTOP = 32 +pkg syscall (linux-386), const TIOCPKT_FLUSHREAD = 1 +pkg syscall (linux-386), const TIOCPKT_FLUSHWRITE = 2 +pkg syscall (linux-386), const TIOCPKT_IOCTL = 64 +pkg syscall (linux-386), const TIOCPKT_NOSTOP = 16 +pkg syscall (linux-386), const TIOCPKT_START = 8 +pkg syscall (linux-386), const TIOCPKT_STOP = 4 +pkg syscall (linux-386), const TIOCSBRK = 21543 +pkg syscall (linux-386), const TIOCSCTTY = 21518 +pkg syscall (linux-386), const TIOCSERCONFIG = 21587 +pkg syscall (linux-386), const TIOCSERGETLSR = 21593 +pkg syscall (linux-386), const TIOCSERGETMULTI = 21594 +pkg syscall (linux-386), const TIOCSERGSTRUCT = 21592 +pkg syscall (linux-386), const TIOCSERGWILD = 21588 +pkg syscall (linux-386), const TIOCSERSETMULTI = 21595 +pkg syscall (linux-386), const TIOCSERSWILD = 21589 +pkg syscall (linux-386), const TIOCSER_TEMT = 1 +pkg syscall (linux-386), const TIOCSETD = 21539 +pkg syscall (linux-386), const TIOCSIG = 1074025526 +pkg syscall (linux-386), const TIOCSLCKTRMIOS = 21591 +pkg syscall (linux-386), const TIOCSPGRP = 21520 +pkg syscall (linux-386), const TIOCSPTLCK = 1074025521 +pkg syscall (linux-386), const TIOCSRS485 = 21551 +pkg syscall (linux-386), const TIOCSSERIAL = 21535 +pkg syscall (linux-386), const TIOCSSOFTCAR = 21530 +pkg syscall (linux-386), const TIOCSTI = 21522 +pkg syscall (linux-386), const TIOCSWINSZ = 21524 +pkg syscall (linux-386), const TOSTOP = 256 +pkg syscall (linux-386), const TUNATTACHFILTER = 1074287829 +pkg syscall (linux-386), const TUNDETACHFILTER = 1074287830 +pkg syscall (linux-386), const TUNGETFEATURES = 2147767503 +pkg syscall (linux-386), const TUNGETIFF = 2147767506 +pkg syscall (linux-386), const TUNGETSNDBUF = 2147767507 +pkg syscall (linux-386), const TUNGETVNETHDRSZ = 2147767511 +pkg syscall (linux-386), const TUNSETDEBUG = 1074025673 +pkg syscall (linux-386), const TUNSETGROUP = 1074025678 +pkg syscall (linux-386), const TUNSETIFF = 1074025674 +pkg syscall (linux-386), const TUNSETLINK = 1074025677 +pkg syscall (linux-386), const TUNSETNOCSUM = 1074025672 +pkg syscall (linux-386), const TUNSETOFFLOAD = 1074025680 +pkg syscall (linux-386), const TUNSETOWNER = 1074025676 +pkg syscall (linux-386), const TUNSETPERSIST = 1074025675 +pkg syscall (linux-386), const TUNSETSNDBUF = 1074025684 +pkg syscall (linux-386), const TUNSETTXFILTER = 1074025681 +pkg syscall (linux-386), const TUNSETVNETHDRSZ = 1074025688 +pkg syscall (linux-386), const VDISCARD = 13 +pkg syscall (linux-386), const VEOF = 4 +pkg syscall (linux-386), const VEOL = 11 +pkg syscall (linux-386), const VEOL2 = 16 +pkg syscall (linux-386), const VERASE = 2 +pkg syscall (linux-386), const VINTR = 0 +pkg syscall (linux-386), const VKILL = 3 +pkg syscall (linux-386), const VLNEXT = 15 +pkg syscall (linux-386), const VMIN = 6 +pkg syscall (linux-386), const VQUIT = 1 +pkg syscall (linux-386), const VREPRINT = 12 +pkg syscall (linux-386), const VSTART = 8 +pkg syscall (linux-386), const VSTOP = 9 +pkg syscall (linux-386), const VSUSP = 10 +pkg syscall (linux-386), const VSWTC = 7 +pkg syscall (linux-386), const VTIME = 5 +pkg syscall (linux-386), const VWERASE = 14 +pkg syscall (linux-386), const WALL = 1073741824 +pkg syscall (linux-386), const WCLONE = 2147483648 +pkg syscall (linux-386), const WCONTINUED = 8 +pkg syscall (linux-386), const WEXITED = 4 +pkg syscall (linux-386), const WNOHANG = 1 +pkg syscall (linux-386), const WNOTHREAD = 536870912 +pkg syscall (linux-386), const WNOWAIT = 16777216 +pkg syscall (linux-386), const WORDSIZE = 32 +pkg syscall (linux-386), const WSTOPPED = 2 +pkg syscall (linux-386), const WUNTRACED = 2 +pkg syscall (linux-386), const XCASE = 4 +pkg syscall (linux-386), func Accept4(int, int) (int, Sockaddr, error) +pkg syscall (linux-386), func GetsockoptUcred(int, int, int) (*Ucred, error) +pkg syscall (linux-386), func Getxattr(string, string, []uint8) (int, error) +pkg syscall (linux-386), func Listxattr(string, []uint8) (int, error) +pkg syscall (linux-386), func Pipe2([]int, int) error +pkg syscall (linux-386), func PtraceSyscall(int, int) error +pkg syscall (linux-386), func Removexattr(string, string) error +pkg syscall (linux-386), func Setxattr(string, string, []uint8, int) error +pkg syscall (linux-386), func SlicePtrFromStrings([]string) ([]*uint8, error) +pkg syscall (linux-386), type SysProcAttr struct, Ctty int +pkg syscall (linux-386), type TCPInfo struct +pkg syscall (linux-386), type TCPInfo struct, Advmss uint32 +pkg syscall (linux-386), type TCPInfo struct, Ato uint32 +pkg syscall (linux-386), type TCPInfo struct, Backoff uint8 +pkg syscall (linux-386), type TCPInfo struct, Ca_state uint8 +pkg syscall (linux-386), type TCPInfo struct, Fackets uint32 +pkg syscall (linux-386), type TCPInfo struct, Last_ack_recv uint32 +pkg syscall (linux-386), type TCPInfo struct, Last_ack_sent uint32 +pkg syscall (linux-386), type TCPInfo struct, Last_data_recv uint32 +pkg syscall (linux-386), type TCPInfo struct, Last_data_sent uint32 +pkg syscall (linux-386), type TCPInfo struct, Lost uint32 +pkg syscall (linux-386), type TCPInfo struct, Options uint8 +pkg syscall (linux-386), type TCPInfo struct, Pad_cgo_0 [2]uint8 +pkg syscall (linux-386), type TCPInfo struct, Pmtu uint32 +pkg syscall (linux-386), type TCPInfo struct, Probes uint8 +pkg syscall (linux-386), type TCPInfo struct, Rcv_mss uint32 +pkg syscall (linux-386), type TCPInfo struct, Rcv_rtt uint32 +pkg syscall (linux-386), type TCPInfo struct, Rcv_space uint32 +pkg syscall (linux-386), type TCPInfo struct, Rcv_ssthresh uint32 +pkg syscall (linux-386), type TCPInfo struct, Reordering uint32 +pkg syscall (linux-386), type TCPInfo struct, Retrans uint32 +pkg syscall (linux-386), type TCPInfo struct, Retransmits uint8 +pkg syscall (linux-386), type TCPInfo struct, Rto uint32 +pkg syscall (linux-386), type TCPInfo struct, Rtt uint32 +pkg syscall (linux-386), type TCPInfo struct, Rttvar uint32 +pkg syscall (linux-386), type TCPInfo struct, Sacked uint32 +pkg syscall (linux-386), type TCPInfo struct, Snd_cwnd uint32 +pkg syscall (linux-386), type TCPInfo struct, Snd_mss uint32 +pkg syscall (linux-386), type TCPInfo struct, Snd_ssthresh uint32 +pkg syscall (linux-386), type TCPInfo struct, State uint8 +pkg syscall (linux-386), type TCPInfo struct, Total_retrans uint32 +pkg syscall (linux-386), type TCPInfo struct, Unacked uint32 +pkg syscall (linux-386-cgo), const AF_ALG = 38 +pkg syscall (linux-386-cgo), const AF_APPLETALK = 5 +pkg syscall (linux-386-cgo), const AF_ASH = 18 +pkg syscall (linux-386-cgo), const AF_ATMPVC = 8 +pkg syscall (linux-386-cgo), const AF_ATMSVC = 20 +pkg syscall (linux-386-cgo), const AF_AX25 = 3 +pkg syscall (linux-386-cgo), const AF_BLUETOOTH = 31 +pkg syscall (linux-386-cgo), const AF_BRIDGE = 7 +pkg syscall (linux-386-cgo), const AF_CAIF = 37 +pkg syscall (linux-386-cgo), const AF_CAN = 29 +pkg syscall (linux-386-cgo), const AF_DECnet = 12 +pkg syscall (linux-386-cgo), const AF_ECONET = 19 +pkg syscall (linux-386-cgo), const AF_FILE = 1 +pkg syscall (linux-386-cgo), const AF_IEEE802154 = 36 +pkg syscall (linux-386-cgo), const AF_INET6 = 10 +pkg syscall (linux-386-cgo), const AF_IPX = 4 +pkg syscall (linux-386-cgo), const AF_IRDA = 23 +pkg syscall (linux-386-cgo), const AF_ISDN = 34 +pkg syscall (linux-386-cgo), const AF_IUCV = 32 +pkg syscall (linux-386-cgo), const AF_KEY = 15 +pkg syscall (linux-386-cgo), const AF_LLC = 26 +pkg syscall (linux-386-cgo), const AF_LOCAL = 1 +pkg syscall (linux-386-cgo), const AF_MAX = 39 +pkg syscall (linux-386-cgo), const AF_NETBEUI = 13 +pkg syscall (linux-386-cgo), const AF_NETLINK = 16 +pkg syscall (linux-386-cgo), const AF_NETROM = 6 +pkg syscall (linux-386-cgo), const AF_PACKET = 17 +pkg syscall (linux-386-cgo), const AF_PHONET = 35 +pkg syscall (linux-386-cgo), const AF_PPPOX = 24 +pkg syscall (linux-386-cgo), const AF_RDS = 21 +pkg syscall (linux-386-cgo), const AF_ROSE = 11 +pkg syscall (linux-386-cgo), const AF_ROUTE = 16 +pkg syscall (linux-386-cgo), const AF_RXRPC = 33 +pkg syscall (linux-386-cgo), const AF_SECURITY = 14 +pkg syscall (linux-386-cgo), const AF_SNA = 22 +pkg syscall (linux-386-cgo), const AF_TIPC = 30 +pkg syscall (linux-386-cgo), const AF_WANPIPE = 25 +pkg syscall (linux-386-cgo), const AF_X25 = 9 +pkg syscall (linux-386-cgo), const ARPHRD_ADAPT = 264 +pkg syscall (linux-386-cgo), const ARPHRD_APPLETLK = 8 +pkg syscall (linux-386-cgo), const ARPHRD_ARCNET = 7 +pkg syscall (linux-386-cgo), const ARPHRD_ASH = 781 +pkg syscall (linux-386-cgo), const ARPHRD_ATM = 19 +pkg syscall (linux-386-cgo), const ARPHRD_AX25 = 3 +pkg syscall (linux-386-cgo), const ARPHRD_BIF = 775 +pkg syscall (linux-386-cgo), const ARPHRD_CHAOS = 5 +pkg syscall (linux-386-cgo), const ARPHRD_CISCO = 513 +pkg syscall (linux-386-cgo), const ARPHRD_CSLIP = 257 +pkg syscall (linux-386-cgo), const ARPHRD_CSLIP6 = 259 +pkg syscall (linux-386-cgo), const ARPHRD_DDCMP = 517 +pkg syscall (linux-386-cgo), const ARPHRD_DLCI = 15 +pkg syscall (linux-386-cgo), const ARPHRD_ECONET = 782 +pkg syscall (linux-386-cgo), const ARPHRD_EETHER = 2 +pkg syscall (linux-386-cgo), const ARPHRD_ETHER = 1 +pkg syscall (linux-386-cgo), const ARPHRD_EUI64 = 27 +pkg syscall (linux-386-cgo), const ARPHRD_FCAL = 785 +pkg syscall (linux-386-cgo), const ARPHRD_FCFABRIC = 787 +pkg syscall (linux-386-cgo), const ARPHRD_FCPL = 786 +pkg syscall (linux-386-cgo), const ARPHRD_FCPP = 784 +pkg syscall (linux-386-cgo), const ARPHRD_FDDI = 774 +pkg syscall (linux-386-cgo), const ARPHRD_FRAD = 770 +pkg syscall (linux-386-cgo), const ARPHRD_HDLC = 513 +pkg syscall (linux-386-cgo), const ARPHRD_HIPPI = 780 +pkg syscall (linux-386-cgo), const ARPHRD_HWX25 = 272 +pkg syscall (linux-386-cgo), const ARPHRD_IEEE1394 = 24 +pkg syscall (linux-386-cgo), const ARPHRD_IEEE802 = 6 +pkg syscall (linux-386-cgo), const ARPHRD_IEEE80211 = 801 +pkg syscall (linux-386-cgo), const ARPHRD_IEEE80211_PRISM = 802 +pkg syscall (linux-386-cgo), const ARPHRD_IEEE80211_RADIOTAP = 803 +pkg syscall (linux-386-cgo), const ARPHRD_IEEE802154 = 804 +pkg syscall (linux-386-cgo), const ARPHRD_IEEE802154_PHY = 805 +pkg syscall (linux-386-cgo), const ARPHRD_IEEE802_TR = 800 +pkg syscall (linux-386-cgo), const ARPHRD_INFINIBAND = 32 +pkg syscall (linux-386-cgo), const ARPHRD_IPDDP = 777 +pkg syscall (linux-386-cgo), const ARPHRD_IPGRE = 778 +pkg syscall (linux-386-cgo), const ARPHRD_IRDA = 783 +pkg syscall (linux-386-cgo), const ARPHRD_LAPB = 516 +pkg syscall (linux-386-cgo), const ARPHRD_LOCALTLK = 773 +pkg syscall (linux-386-cgo), const ARPHRD_LOOPBACK = 772 +pkg syscall (linux-386-cgo), const ARPHRD_METRICOM = 23 +pkg syscall (linux-386-cgo), const ARPHRD_NETROM = 0 +pkg syscall (linux-386-cgo), const ARPHRD_NONE = 65534 +pkg syscall (linux-386-cgo), const ARPHRD_PIMREG = 779 +pkg syscall (linux-386-cgo), const ARPHRD_PPP = 512 +pkg syscall (linux-386-cgo), const ARPHRD_PRONET = 4 +pkg syscall (linux-386-cgo), const ARPHRD_RAWHDLC = 518 +pkg syscall (linux-386-cgo), const ARPHRD_ROSE = 270 +pkg syscall (linux-386-cgo), const ARPHRD_RSRVD = 260 +pkg syscall (linux-386-cgo), const ARPHRD_SIT = 776 +pkg syscall (linux-386-cgo), const ARPHRD_SKIP = 771 +pkg syscall (linux-386-cgo), const ARPHRD_SLIP = 256 +pkg syscall (linux-386-cgo), const ARPHRD_SLIP6 = 258 +pkg syscall (linux-386-cgo), const ARPHRD_TUNNEL = 768 +pkg syscall (linux-386-cgo), const ARPHRD_TUNNEL6 = 769 +pkg syscall (linux-386-cgo), const ARPHRD_VOID = 65535 +pkg syscall (linux-386-cgo), const ARPHRD_X25 = 271 +pkg syscall (linux-386-cgo), const B0 = 0 +pkg syscall (linux-386-cgo), const B1000000 = 4104 +pkg syscall (linux-386-cgo), const B110 = 3 +pkg syscall (linux-386-cgo), const B115200 = 4098 +pkg syscall (linux-386-cgo), const B1152000 = 4105 +pkg syscall (linux-386-cgo), const B1200 = 9 +pkg syscall (linux-386-cgo), const B134 = 4 +pkg syscall (linux-386-cgo), const B150 = 5 +pkg syscall (linux-386-cgo), const B1500000 = 4106 +pkg syscall (linux-386-cgo), const B1800 = 10 +pkg syscall (linux-386-cgo), const B19200 = 14 +pkg syscall (linux-386-cgo), const B200 = 6 +pkg syscall (linux-386-cgo), const B2000000 = 4107 +pkg syscall (linux-386-cgo), const B230400 = 4099 +pkg syscall (linux-386-cgo), const B2400 = 11 +pkg syscall (linux-386-cgo), const B2500000 = 4108 +pkg syscall (linux-386-cgo), const B300 = 7 +pkg syscall (linux-386-cgo), const B3000000 = 4109 +pkg syscall (linux-386-cgo), const B3500000 = 4110 +pkg syscall (linux-386-cgo), const B38400 = 15 +pkg syscall (linux-386-cgo), const B4000000 = 4111 +pkg syscall (linux-386-cgo), const B460800 = 4100 +pkg syscall (linux-386-cgo), const B4800 = 12 +pkg syscall (linux-386-cgo), const B50 = 1 +pkg syscall (linux-386-cgo), const B500000 = 4101 +pkg syscall (linux-386-cgo), const B57600 = 4097 +pkg syscall (linux-386-cgo), const B576000 = 4102 +pkg syscall (linux-386-cgo), const B600 = 8 +pkg syscall (linux-386-cgo), const B75 = 2 +pkg syscall (linux-386-cgo), const B921600 = 4103 +pkg syscall (linux-386-cgo), const B9600 = 13 +pkg syscall (linux-386-cgo), const BPF_A = 16 +pkg syscall (linux-386-cgo), const BPF_ABS = 32 +pkg syscall (linux-386-cgo), const BPF_ADD = 0 +pkg syscall (linux-386-cgo), const BPF_ALU = 4 +pkg syscall (linux-386-cgo), const BPF_AND = 80 +pkg syscall (linux-386-cgo), const BPF_B = 16 +pkg syscall (linux-386-cgo), const BPF_DIV = 48 +pkg syscall (linux-386-cgo), const BPF_H = 8 +pkg syscall (linux-386-cgo), const BPF_IMM = 0 +pkg syscall (linux-386-cgo), const BPF_IND = 64 +pkg syscall (linux-386-cgo), const BPF_JA = 0 +pkg syscall (linux-386-cgo), const BPF_JEQ = 16 +pkg syscall (linux-386-cgo), const BPF_JGE = 48 +pkg syscall (linux-386-cgo), const BPF_JGT = 32 +pkg syscall (linux-386-cgo), const BPF_JMP = 5 +pkg syscall (linux-386-cgo), const BPF_JSET = 64 +pkg syscall (linux-386-cgo), const BPF_K = 0 +pkg syscall (linux-386-cgo), const BPF_LD = 0 +pkg syscall (linux-386-cgo), const BPF_LDX = 1 +pkg syscall (linux-386-cgo), const BPF_LEN = 128 +pkg syscall (linux-386-cgo), const BPF_LSH = 96 +pkg syscall (linux-386-cgo), const BPF_MAJOR_VERSION = 1 +pkg syscall (linux-386-cgo), const BPF_MAXINSNS = 4096 +pkg syscall (linux-386-cgo), const BPF_MEM = 96 +pkg syscall (linux-386-cgo), const BPF_MEMWORDS = 16 +pkg syscall (linux-386-cgo), const BPF_MINOR_VERSION = 1 +pkg syscall (linux-386-cgo), const BPF_MISC = 7 +pkg syscall (linux-386-cgo), const BPF_MSH = 160 +pkg syscall (linux-386-cgo), const BPF_MUL = 32 +pkg syscall (linux-386-cgo), const BPF_NEG = 128 +pkg syscall (linux-386-cgo), const BPF_OR = 64 +pkg syscall (linux-386-cgo), const BPF_RET = 6 +pkg syscall (linux-386-cgo), const BPF_RSH = 112 +pkg syscall (linux-386-cgo), const BPF_ST = 2 +pkg syscall (linux-386-cgo), const BPF_STX = 3 +pkg syscall (linux-386-cgo), const BPF_SUB = 16 +pkg syscall (linux-386-cgo), const BPF_TAX = 0 +pkg syscall (linux-386-cgo), const BPF_TXA = 128 +pkg syscall (linux-386-cgo), const BPF_W = 0 +pkg syscall (linux-386-cgo), const BPF_X = 8 +pkg syscall (linux-386-cgo), const BRKINT = 2 +pkg syscall (linux-386-cgo), const CLOCAL = 2048 +pkg syscall (linux-386-cgo), const CREAD = 128 +pkg syscall (linux-386-cgo), const CS5 = 0 +pkg syscall (linux-386-cgo), const CS6 = 16 +pkg syscall (linux-386-cgo), const CS7 = 32 +pkg syscall (linux-386-cgo), const CS8 = 48 +pkg syscall (linux-386-cgo), const CSIZE = 48 +pkg syscall (linux-386-cgo), const CSTOPB = 64 +pkg syscall (linux-386-cgo), const DT_BLK = 6 +pkg syscall (linux-386-cgo), const DT_CHR = 2 +pkg syscall (linux-386-cgo), const DT_DIR = 4 +pkg syscall (linux-386-cgo), const DT_FIFO = 1 +pkg syscall (linux-386-cgo), const DT_LNK = 10 +pkg syscall (linux-386-cgo), const DT_REG = 8 +pkg syscall (linux-386-cgo), const DT_SOCK = 12 +pkg syscall (linux-386-cgo), const DT_UNKNOWN = 0 +pkg syscall (linux-386-cgo), const DT_WHT = 14 +pkg syscall (linux-386-cgo), const E2BIG = 7 +pkg syscall (linux-386-cgo), const EACCES = 13 +pkg syscall (linux-386-cgo), const EADDRINUSE = 98 +pkg syscall (linux-386-cgo), const EADDRNOTAVAIL = 99 +pkg syscall (linux-386-cgo), const EADV = 68 +pkg syscall (linux-386-cgo), const EAFNOSUPPORT = 97 +pkg syscall (linux-386-cgo), const EAGAIN = 11 +pkg syscall (linux-386-cgo), const EALREADY = 114 +pkg syscall (linux-386-cgo), const EBADE = 52 +pkg syscall (linux-386-cgo), const EBADF = 9 +pkg syscall (linux-386-cgo), const EBADFD = 77 +pkg syscall (linux-386-cgo), const EBADMSG = 74 +pkg syscall (linux-386-cgo), const EBADR = 53 +pkg syscall (linux-386-cgo), const EBADRQC = 56 +pkg syscall (linux-386-cgo), const EBADSLT = 57 +pkg syscall (linux-386-cgo), const EBFONT = 59 +pkg syscall (linux-386-cgo), const EBUSY = 16 +pkg syscall (linux-386-cgo), const ECANCELED = 125 +pkg syscall (linux-386-cgo), const ECHILD = 10 +pkg syscall (linux-386-cgo), const ECHO = 8 +pkg syscall (linux-386-cgo), const ECHOCTL = 512 +pkg syscall (linux-386-cgo), const ECHOE = 16 +pkg syscall (linux-386-cgo), const ECHOK = 32 +pkg syscall (linux-386-cgo), const ECHOKE = 2048 +pkg syscall (linux-386-cgo), const ECHONL = 64 +pkg syscall (linux-386-cgo), const ECHOPRT = 1024 +pkg syscall (linux-386-cgo), const ECHRNG = 44 +pkg syscall (linux-386-cgo), const ECOMM = 70 +pkg syscall (linux-386-cgo), const ECONNABORTED = 103 +pkg syscall (linux-386-cgo), const ECONNREFUSED = 111 +pkg syscall (linux-386-cgo), const ECONNRESET = 104 +pkg syscall (linux-386-cgo), const EDEADLK = 35 +pkg syscall (linux-386-cgo), const EDEADLOCK = 35 +pkg syscall (linux-386-cgo), const EDESTADDRREQ = 89 +pkg syscall (linux-386-cgo), const EDOM = 33 +pkg syscall (linux-386-cgo), const EDOTDOT = 73 +pkg syscall (linux-386-cgo), const EDQUOT = 122 +pkg syscall (linux-386-cgo), const EEXIST = 17 +pkg syscall (linux-386-cgo), const EFAULT = 14 +pkg syscall (linux-386-cgo), const EFBIG = 27 +pkg syscall (linux-386-cgo), const EHOSTDOWN = 112 +pkg syscall (linux-386-cgo), const EHOSTUNREACH = 113 +pkg syscall (linux-386-cgo), const EIDRM = 43 +pkg syscall (linux-386-cgo), const EILSEQ = 84 +pkg syscall (linux-386-cgo), const EINPROGRESS = 115 +pkg syscall (linux-386-cgo), const EINTR = 4 +pkg syscall (linux-386-cgo), const EINVAL = 22 +pkg syscall (linux-386-cgo), const EIO = 5 +pkg syscall (linux-386-cgo), const EISCONN = 106 +pkg syscall (linux-386-cgo), const EISDIR = 21 +pkg syscall (linux-386-cgo), const EISNAM = 120 +pkg syscall (linux-386-cgo), const EKEYEXPIRED = 127 +pkg syscall (linux-386-cgo), const EKEYREJECTED = 129 +pkg syscall (linux-386-cgo), const EKEYREVOKED = 128 +pkg syscall (linux-386-cgo), const EL2HLT = 51 +pkg syscall (linux-386-cgo), const EL2NSYNC = 45 +pkg syscall (linux-386-cgo), const EL3HLT = 46 +pkg syscall (linux-386-cgo), const EL3RST = 47 +pkg syscall (linux-386-cgo), const ELIBACC = 79 +pkg syscall (linux-386-cgo), const ELIBBAD = 80 +pkg syscall (linux-386-cgo), const ELIBEXEC = 83 +pkg syscall (linux-386-cgo), const ELIBMAX = 82 +pkg syscall (linux-386-cgo), const ELIBSCN = 81 +pkg syscall (linux-386-cgo), const ELNRNG = 48 +pkg syscall (linux-386-cgo), const ELOOP = 40 +pkg syscall (linux-386-cgo), const EMEDIUMTYPE = 124 +pkg syscall (linux-386-cgo), const EMFILE = 24 +pkg syscall (linux-386-cgo), const EMLINK = 31 +pkg syscall (linux-386-cgo), const EMSGSIZE = 90 +pkg syscall (linux-386-cgo), const EMULTIHOP = 72 +pkg syscall (linux-386-cgo), const ENAMETOOLONG = 36 +pkg syscall (linux-386-cgo), const ENAVAIL = 119 +pkg syscall (linux-386-cgo), const ENETDOWN = 100 +pkg syscall (linux-386-cgo), const ENETRESET = 102 +pkg syscall (linux-386-cgo), const ENETUNREACH = 101 +pkg syscall (linux-386-cgo), const ENFILE = 23 +pkg syscall (linux-386-cgo), const ENOANO = 55 +pkg syscall (linux-386-cgo), const ENOBUFS = 105 +pkg syscall (linux-386-cgo), const ENOCSI = 50 +pkg syscall (linux-386-cgo), const ENODATA = 61 +pkg syscall (linux-386-cgo), const ENODEV = 19 +pkg syscall (linux-386-cgo), const ENOEXEC = 8 +pkg syscall (linux-386-cgo), const ENOKEY = 126 +pkg syscall (linux-386-cgo), const ENOLCK = 37 +pkg syscall (linux-386-cgo), const ENOLINK = 67 +pkg syscall (linux-386-cgo), const ENOMEDIUM = 123 +pkg syscall (linux-386-cgo), const ENOMEM = 12 +pkg syscall (linux-386-cgo), const ENOMSG = 42 +pkg syscall (linux-386-cgo), const ENONET = 64 +pkg syscall (linux-386-cgo), const ENOPKG = 65 +pkg syscall (linux-386-cgo), const ENOPROTOOPT = 92 +pkg syscall (linux-386-cgo), const ENOSPC = 28 +pkg syscall (linux-386-cgo), const ENOSR = 63 +pkg syscall (linux-386-cgo), const ENOSTR = 60 +pkg syscall (linux-386-cgo), const ENOSYS = 38 +pkg syscall (linux-386-cgo), const ENOTBLK = 15 +pkg syscall (linux-386-cgo), const ENOTCONN = 107 +pkg syscall (linux-386-cgo), const ENOTDIR = 20 +pkg syscall (linux-386-cgo), const ENOTEMPTY = 39 +pkg syscall (linux-386-cgo), const ENOTNAM = 118 +pkg syscall (linux-386-cgo), const ENOTRECOVERABLE = 131 +pkg syscall (linux-386-cgo), const ENOTSOCK = 88 +pkg syscall (linux-386-cgo), const ENOTSUP = 95 +pkg syscall (linux-386-cgo), const ENOTTY = 25 +pkg syscall (linux-386-cgo), const ENOTUNIQ = 76 +pkg syscall (linux-386-cgo), const ENXIO = 6 +pkg syscall (linux-386-cgo), const EOPNOTSUPP = 95 +pkg syscall (linux-386-cgo), const EOVERFLOW = 75 +pkg syscall (linux-386-cgo), const EOWNERDEAD = 130 +pkg syscall (linux-386-cgo), const EPERM = 1 +pkg syscall (linux-386-cgo), const EPFNOSUPPORT = 96 +pkg syscall (linux-386-cgo), const EPIPE = 32 +pkg syscall (linux-386-cgo), const EPOLLERR = 8 +pkg syscall (linux-386-cgo), const EPOLLET = -2147483648 +pkg syscall (linux-386-cgo), const EPOLLHUP = 16 +pkg syscall (linux-386-cgo), const EPOLLIN = 1 +pkg syscall (linux-386-cgo), const EPOLLMSG = 1024 +pkg syscall (linux-386-cgo), const EPOLLONESHOT = 1073741824 +pkg syscall (linux-386-cgo), const EPOLLOUT = 4 +pkg syscall (linux-386-cgo), const EPOLLPRI = 2 +pkg syscall (linux-386-cgo), const EPOLLRDBAND = 128 +pkg syscall (linux-386-cgo), const EPOLLRDHUP = 8192 +pkg syscall (linux-386-cgo), const EPOLLRDNORM = 64 +pkg syscall (linux-386-cgo), const EPOLLWRBAND = 512 +pkg syscall (linux-386-cgo), const EPOLLWRNORM = 256 +pkg syscall (linux-386-cgo), const EPOLL_CLOEXEC = 524288 +pkg syscall (linux-386-cgo), const EPOLL_CTL_ADD = 1 +pkg syscall (linux-386-cgo), const EPOLL_CTL_DEL = 2 +pkg syscall (linux-386-cgo), const EPOLL_CTL_MOD = 3 +pkg syscall (linux-386-cgo), const EPOLL_NONBLOCK = 2048 +pkg syscall (linux-386-cgo), const EPROTO = 71 +pkg syscall (linux-386-cgo), const EPROTONOSUPPORT = 93 +pkg syscall (linux-386-cgo), const EPROTOTYPE = 91 +pkg syscall (linux-386-cgo), const ERANGE = 34 +pkg syscall (linux-386-cgo), const EREMCHG = 78 +pkg syscall (linux-386-cgo), const EREMOTE = 66 +pkg syscall (linux-386-cgo), const EREMOTEIO = 121 +pkg syscall (linux-386-cgo), const ERESTART = 85 +pkg syscall (linux-386-cgo), const ERFKILL = 132 +pkg syscall (linux-386-cgo), const EROFS = 30 +pkg syscall (linux-386-cgo), const ESHUTDOWN = 108 +pkg syscall (linux-386-cgo), const ESOCKTNOSUPPORT = 94 +pkg syscall (linux-386-cgo), const ESPIPE = 29 +pkg syscall (linux-386-cgo), const ESRCH = 3 +pkg syscall (linux-386-cgo), const ESRMNT = 69 +pkg syscall (linux-386-cgo), const ESTALE = 116 +pkg syscall (linux-386-cgo), const ESTRPIPE = 86 +pkg syscall (linux-386-cgo), const ETH_P_1588 = 35063 +pkg syscall (linux-386-cgo), const ETH_P_8021Q = 33024 +pkg syscall (linux-386-cgo), const ETH_P_802_2 = 4 +pkg syscall (linux-386-cgo), const ETH_P_802_3 = 1 +pkg syscall (linux-386-cgo), const ETH_P_AARP = 33011 +pkg syscall (linux-386-cgo), const ETH_P_ALL = 3 +pkg syscall (linux-386-cgo), const ETH_P_AOE = 34978 +pkg syscall (linux-386-cgo), const ETH_P_ARCNET = 26 +pkg syscall (linux-386-cgo), const ETH_P_ARP = 2054 +pkg syscall (linux-386-cgo), const ETH_P_ATALK = 32923 +pkg syscall (linux-386-cgo), const ETH_P_ATMFATE = 34948 +pkg syscall (linux-386-cgo), const ETH_P_ATMMPOA = 34892 +pkg syscall (linux-386-cgo), const ETH_P_AX25 = 2 +pkg syscall (linux-386-cgo), const ETH_P_BPQ = 2303 +pkg syscall (linux-386-cgo), const ETH_P_CAIF = 247 +pkg syscall (linux-386-cgo), const ETH_P_CAN = 12 +pkg syscall (linux-386-cgo), const ETH_P_CONTROL = 22 +pkg syscall (linux-386-cgo), const ETH_P_CUST = 24582 +pkg syscall (linux-386-cgo), const ETH_P_DDCMP = 6 +pkg syscall (linux-386-cgo), const ETH_P_DEC = 24576 +pkg syscall (linux-386-cgo), const ETH_P_DIAG = 24581 +pkg syscall (linux-386-cgo), const ETH_P_DNA_DL = 24577 +pkg syscall (linux-386-cgo), const ETH_P_DNA_RC = 24578 +pkg syscall (linux-386-cgo), const ETH_P_DNA_RT = 24579 +pkg syscall (linux-386-cgo), const ETH_P_DSA = 27 +pkg syscall (linux-386-cgo), const ETH_P_ECONET = 24 +pkg syscall (linux-386-cgo), const ETH_P_EDSA = 56026 +pkg syscall (linux-386-cgo), const ETH_P_FCOE = 35078 +pkg syscall (linux-386-cgo), const ETH_P_FIP = 35092 +pkg syscall (linux-386-cgo), const ETH_P_HDLC = 25 +pkg syscall (linux-386-cgo), const ETH_P_IEEE802154 = 246 +pkg syscall (linux-386-cgo), const ETH_P_IEEEPUP = 2560 +pkg syscall (linux-386-cgo), const ETH_P_IEEEPUPAT = 2561 +pkg syscall (linux-386-cgo), const ETH_P_IP = 2048 +pkg syscall (linux-386-cgo), const ETH_P_IPV6 = 34525 +pkg syscall (linux-386-cgo), const ETH_P_IPX = 33079 +pkg syscall (linux-386-cgo), const ETH_P_IRDA = 23 +pkg syscall (linux-386-cgo), const ETH_P_LAT = 24580 +pkg syscall (linux-386-cgo), const ETH_P_LINK_CTL = 34924 +pkg syscall (linux-386-cgo), const ETH_P_LOCALTALK = 9 +pkg syscall (linux-386-cgo), const ETH_P_LOOP = 96 +pkg syscall (linux-386-cgo), const ETH_P_MOBITEX = 21 +pkg syscall (linux-386-cgo), const ETH_P_MPLS_MC = 34888 +pkg syscall (linux-386-cgo), const ETH_P_MPLS_UC = 34887 +pkg syscall (linux-386-cgo), const ETH_P_PAE = 34958 +pkg syscall (linux-386-cgo), const ETH_P_PAUSE = 34824 +pkg syscall (linux-386-cgo), const ETH_P_PHONET = 245 +pkg syscall (linux-386-cgo), const ETH_P_PPPTALK = 16 +pkg syscall (linux-386-cgo), const ETH_P_PPP_DISC = 34915 +pkg syscall (linux-386-cgo), const ETH_P_PPP_MP = 8 +pkg syscall (linux-386-cgo), const ETH_P_PPP_SES = 34916 +pkg syscall (linux-386-cgo), const ETH_P_PUP = 512 +pkg syscall (linux-386-cgo), const ETH_P_PUPAT = 513 +pkg syscall (linux-386-cgo), const ETH_P_RARP = 32821 +pkg syscall (linux-386-cgo), const ETH_P_SCA = 24583 +pkg syscall (linux-386-cgo), const ETH_P_SLOW = 34825 +pkg syscall (linux-386-cgo), const ETH_P_SNAP = 5 +pkg syscall (linux-386-cgo), const ETH_P_TEB = 25944 +pkg syscall (linux-386-cgo), const ETH_P_TIPC = 35018 +pkg syscall (linux-386-cgo), const ETH_P_TRAILER = 28 +pkg syscall (linux-386-cgo), const ETH_P_TR_802_2 = 17 +pkg syscall (linux-386-cgo), const ETH_P_WAN_PPP = 7 +pkg syscall (linux-386-cgo), const ETH_P_WCCP = 34878 +pkg syscall (linux-386-cgo), const ETH_P_X25 = 2053 +pkg syscall (linux-386-cgo), const ETIME = 62 +pkg syscall (linux-386-cgo), const ETIMEDOUT = 110 +pkg syscall (linux-386-cgo), const ETOOMANYREFS = 109 +pkg syscall (linux-386-cgo), const ETXTBSY = 26 +pkg syscall (linux-386-cgo), const EUCLEAN = 117 +pkg syscall (linux-386-cgo), const EUNATCH = 49 +pkg syscall (linux-386-cgo), const EUSERS = 87 +pkg syscall (linux-386-cgo), const EWOULDBLOCK = 11 +pkg syscall (linux-386-cgo), const EXDEV = 18 +pkg syscall (linux-386-cgo), const EXFULL = 54 +pkg syscall (linux-386-cgo), const FD_CLOEXEC = 1 +pkg syscall (linux-386-cgo), const FD_SETSIZE = 1024 +pkg syscall (linux-386-cgo), const FLUSHO = 4096 +pkg syscall (linux-386-cgo), const F_DUPFD = 0 +pkg syscall (linux-386-cgo), const F_DUPFD_CLOEXEC = 1030 +pkg syscall (linux-386-cgo), const F_EXLCK = 4 +pkg syscall (linux-386-cgo), const F_GETFD = 1 +pkg syscall (linux-386-cgo), const F_GETFL = 3 +pkg syscall (linux-386-cgo), const F_GETLEASE = 1025 +pkg syscall (linux-386-cgo), const F_GETLK = 12 +pkg syscall (linux-386-cgo), const F_GETLK64 = 12 +pkg syscall (linux-386-cgo), const F_GETOWN = 9 +pkg syscall (linux-386-cgo), const F_GETOWN_EX = 16 +pkg syscall (linux-386-cgo), const F_GETPIPE_SZ = 1032 +pkg syscall (linux-386-cgo), const F_GETSIG = 11 +pkg syscall (linux-386-cgo), const F_LOCK = 1 +pkg syscall (linux-386-cgo), const F_NOTIFY = 1026 +pkg syscall (linux-386-cgo), const F_OK = 0 +pkg syscall (linux-386-cgo), const F_RDLCK = 0 +pkg syscall (linux-386-cgo), const F_SETFD = 2 +pkg syscall (linux-386-cgo), const F_SETFL = 4 +pkg syscall (linux-386-cgo), const F_SETLEASE = 1024 +pkg syscall (linux-386-cgo), const F_SETLK = 13 +pkg syscall (linux-386-cgo), const F_SETLK64 = 13 +pkg syscall (linux-386-cgo), const F_SETLKW = 14 +pkg syscall (linux-386-cgo), const F_SETLKW64 = 14 +pkg syscall (linux-386-cgo), const F_SETOWN = 8 +pkg syscall (linux-386-cgo), const F_SETOWN_EX = 15 +pkg syscall (linux-386-cgo), const F_SETPIPE_SZ = 1031 +pkg syscall (linux-386-cgo), const F_SETSIG = 10 +pkg syscall (linux-386-cgo), const F_SHLCK = 8 +pkg syscall (linux-386-cgo), const F_TEST = 3 +pkg syscall (linux-386-cgo), const F_TLOCK = 2 +pkg syscall (linux-386-cgo), const F_ULOCK = 0 +pkg syscall (linux-386-cgo), const F_UNLCK = 2 +pkg syscall (linux-386-cgo), const F_WRLCK = 1 +pkg syscall (linux-386-cgo), const HUPCL = 1024 +pkg syscall (linux-386-cgo), const ICANON = 2 +pkg syscall (linux-386-cgo), const ICRNL = 256 +pkg syscall (linux-386-cgo), const IEXTEN = 32768 +pkg syscall (linux-386-cgo), const IFA_ADDRESS = 1 +pkg syscall (linux-386-cgo), const IFA_ANYCAST = 5 +pkg syscall (linux-386-cgo), const IFA_BROADCAST = 4 +pkg syscall (linux-386-cgo), const IFA_CACHEINFO = 6 +pkg syscall (linux-386-cgo), const IFA_F_DADFAILED = 8 +pkg syscall (linux-386-cgo), const IFA_F_DEPRECATED = 32 +pkg syscall (linux-386-cgo), const IFA_F_HOMEADDRESS = 16 +pkg syscall (linux-386-cgo), const IFA_F_NODAD = 2 +pkg syscall (linux-386-cgo), const IFA_F_OPTIMISTIC = 4 +pkg syscall (linux-386-cgo), const IFA_F_PERMANENT = 128 +pkg syscall (linux-386-cgo), const IFA_F_SECONDARY = 1 +pkg syscall (linux-386-cgo), const IFA_F_TEMPORARY = 1 +pkg syscall (linux-386-cgo), const IFA_F_TENTATIVE = 64 +pkg syscall (linux-386-cgo), const IFA_LABEL = 3 +pkg syscall (linux-386-cgo), const IFA_LOCAL = 2 +pkg syscall (linux-386-cgo), const IFA_MAX = 7 +pkg syscall (linux-386-cgo), const IFA_MULTICAST = 7 +pkg syscall (linux-386-cgo), const IFA_UNSPEC = 0 +pkg syscall (linux-386-cgo), const IFF_ALLMULTI = 512 +pkg syscall (linux-386-cgo), const IFF_AUTOMEDIA = 16384 +pkg syscall (linux-386-cgo), const IFF_DEBUG = 4 +pkg syscall (linux-386-cgo), const IFF_DYNAMIC = 32768 +pkg syscall (linux-386-cgo), const IFF_LOOPBACK = 8 +pkg syscall (linux-386-cgo), const IFF_MASTER = 1024 +pkg syscall (linux-386-cgo), const IFF_MULTICAST = 4096 +pkg syscall (linux-386-cgo), const IFF_NOARP = 128 +pkg syscall (linux-386-cgo), const IFF_NOTRAILERS = 32 +pkg syscall (linux-386-cgo), const IFF_NO_PI = 4096 +pkg syscall (linux-386-cgo), const IFF_ONE_QUEUE = 8192 +pkg syscall (linux-386-cgo), const IFF_POINTOPOINT = 16 +pkg syscall (linux-386-cgo), const IFF_PORTSEL = 8192 +pkg syscall (linux-386-cgo), const IFF_PROMISC = 256 +pkg syscall (linux-386-cgo), const IFF_RUNNING = 64 +pkg syscall (linux-386-cgo), const IFF_SLAVE = 2048 +pkg syscall (linux-386-cgo), const IFF_TAP = 2 +pkg syscall (linux-386-cgo), const IFF_TUN = 1 +pkg syscall (linux-386-cgo), const IFF_TUN_EXCL = 32768 +pkg syscall (linux-386-cgo), const IFF_VNET_HDR = 16384 +pkg syscall (linux-386-cgo), const IFLA_ADDRESS = 1 +pkg syscall (linux-386-cgo), const IFLA_BROADCAST = 2 +pkg syscall (linux-386-cgo), const IFLA_COST = 8 +pkg syscall (linux-386-cgo), const IFLA_IFALIAS = 20 +pkg syscall (linux-386-cgo), const IFLA_IFNAME = 3 +pkg syscall (linux-386-cgo), const IFLA_LINK = 5 +pkg syscall (linux-386-cgo), const IFLA_LINKINFO = 18 +pkg syscall (linux-386-cgo), const IFLA_LINKMODE = 17 +pkg syscall (linux-386-cgo), const IFLA_MAP = 14 +pkg syscall (linux-386-cgo), const IFLA_MASTER = 10 +pkg syscall (linux-386-cgo), const IFLA_MAX = 29 +pkg syscall (linux-386-cgo), const IFLA_MTU = 4 +pkg syscall (linux-386-cgo), const IFLA_NET_NS_PID = 19 +pkg syscall (linux-386-cgo), const IFLA_OPERSTATE = 16 +pkg syscall (linux-386-cgo), const IFLA_PRIORITY = 9 +pkg syscall (linux-386-cgo), const IFLA_PROTINFO = 12 +pkg syscall (linux-386-cgo), const IFLA_QDISC = 6 +pkg syscall (linux-386-cgo), const IFLA_STATS = 7 +pkg syscall (linux-386-cgo), const IFLA_TXQLEN = 13 +pkg syscall (linux-386-cgo), const IFLA_UNSPEC = 0 +pkg syscall (linux-386-cgo), const IFLA_WEIGHT = 15 +pkg syscall (linux-386-cgo), const IFLA_WIRELESS = 11 +pkg syscall (linux-386-cgo), const IFNAMSIZ = 16 +pkg syscall (linux-386-cgo), const IGNBRK = 1 +pkg syscall (linux-386-cgo), const IGNCR = 128 +pkg syscall (linux-386-cgo), const IGNPAR = 4 +pkg syscall (linux-386-cgo), const IMAXBEL = 8192 +pkg syscall (linux-386-cgo), const INLCR = 64 +pkg syscall (linux-386-cgo), const INPCK = 16 +pkg syscall (linux-386-cgo), const IN_ACCESS = 1 +pkg syscall (linux-386-cgo), const IN_ALL_EVENTS = 4095 +pkg syscall (linux-386-cgo), const IN_ATTRIB = 4 +pkg syscall (linux-386-cgo), const IN_CLASSA_HOST = 16777215 +pkg syscall (linux-386-cgo), const IN_CLASSA_MAX = 128 +pkg syscall (linux-386-cgo), const IN_CLASSA_NET = 4278190080 +pkg syscall (linux-386-cgo), const IN_CLASSA_NSHIFT = 24 +pkg syscall (linux-386-cgo), const IN_CLASSB_HOST = 65535 +pkg syscall (linux-386-cgo), const IN_CLASSB_MAX = 65536 +pkg syscall (linux-386-cgo), const IN_CLASSB_NET = 4294901760 +pkg syscall (linux-386-cgo), const IN_CLASSB_NSHIFT = 16 +pkg syscall (linux-386-cgo), const IN_CLASSC_HOST = 255 +pkg syscall (linux-386-cgo), const IN_CLASSC_NET = 4294967040 +pkg syscall (linux-386-cgo), const IN_CLASSC_NSHIFT = 8 +pkg syscall (linux-386-cgo), const IN_CLOEXEC = 524288 +pkg syscall (linux-386-cgo), const IN_CLOSE = 24 +pkg syscall (linux-386-cgo), const IN_CLOSE_NOWRITE = 16 +pkg syscall (linux-386-cgo), const IN_CLOSE_WRITE = 8 +pkg syscall (linux-386-cgo), const IN_CREATE = 256 +pkg syscall (linux-386-cgo), const IN_DELETE = 512 +pkg syscall (linux-386-cgo), const IN_DELETE_SELF = 1024 +pkg syscall (linux-386-cgo), const IN_DONT_FOLLOW = 33554432 +pkg syscall (linux-386-cgo), const IN_EXCL_UNLINK = 67108864 +pkg syscall (linux-386-cgo), const IN_IGNORED = 32768 +pkg syscall (linux-386-cgo), const IN_ISDIR = 1073741824 +pkg syscall (linux-386-cgo), const IN_LOOPBACKNET = 127 +pkg syscall (linux-386-cgo), const IN_MASK_ADD = 536870912 +pkg syscall (linux-386-cgo), const IN_MODIFY = 2 +pkg syscall (linux-386-cgo), const IN_MOVE = 192 +pkg syscall (linux-386-cgo), const IN_MOVED_FROM = 64 +pkg syscall (linux-386-cgo), const IN_MOVED_TO = 128 +pkg syscall (linux-386-cgo), const IN_MOVE_SELF = 2048 +pkg syscall (linux-386-cgo), const IN_NONBLOCK = 2048 +pkg syscall (linux-386-cgo), const IN_ONESHOT = 2147483648 +pkg syscall (linux-386-cgo), const IN_ONLYDIR = 16777216 +pkg syscall (linux-386-cgo), const IN_OPEN = 32 +pkg syscall (linux-386-cgo), const IN_Q_OVERFLOW = 16384 +pkg syscall (linux-386-cgo), const IN_UNMOUNT = 8192 +pkg syscall (linux-386-cgo), const IPPROTO_AH = 51 +pkg syscall (linux-386-cgo), const IPPROTO_COMP = 108 +pkg syscall (linux-386-cgo), const IPPROTO_DCCP = 33 +pkg syscall (linux-386-cgo), const IPPROTO_DSTOPTS = 60 +pkg syscall (linux-386-cgo), const IPPROTO_EGP = 8 +pkg syscall (linux-386-cgo), const IPPROTO_ENCAP = 98 +pkg syscall (linux-386-cgo), const IPPROTO_ESP = 50 +pkg syscall (linux-386-cgo), const IPPROTO_FRAGMENT = 44 +pkg syscall (linux-386-cgo), const IPPROTO_GRE = 47 +pkg syscall (linux-386-cgo), const IPPROTO_HOPOPTS = 0 +pkg syscall (linux-386-cgo), const IPPROTO_ICMP = 1 +pkg syscall (linux-386-cgo), const IPPROTO_ICMPV6 = 58 +pkg syscall (linux-386-cgo), const IPPROTO_IDP = 22 +pkg syscall (linux-386-cgo), const IPPROTO_IGMP = 2 +pkg syscall (linux-386-cgo), const IPPROTO_IPIP = 4 +pkg syscall (linux-386-cgo), const IPPROTO_MTP = 92 +pkg syscall (linux-386-cgo), const IPPROTO_NONE = 59 +pkg syscall (linux-386-cgo), const IPPROTO_PIM = 103 +pkg syscall (linux-386-cgo), const IPPROTO_PUP = 12 +pkg syscall (linux-386-cgo), const IPPROTO_RAW = 255 +pkg syscall (linux-386-cgo), const IPPROTO_ROUTING = 43 +pkg syscall (linux-386-cgo), const IPPROTO_RSVP = 46 +pkg syscall (linux-386-cgo), const IPPROTO_SCTP = 132 +pkg syscall (linux-386-cgo), const IPPROTO_TP = 29 +pkg syscall (linux-386-cgo), const IPPROTO_UDPLITE = 136 +pkg syscall (linux-386-cgo), const IPV6_2292DSTOPTS = 4 +pkg syscall (linux-386-cgo), const IPV6_2292HOPLIMIT = 8 +pkg syscall (linux-386-cgo), const IPV6_2292HOPOPTS = 3 +pkg syscall (linux-386-cgo), const IPV6_2292PKTINFO = 2 +pkg syscall (linux-386-cgo), const IPV6_2292PKTOPTIONS = 6 +pkg syscall (linux-386-cgo), const IPV6_2292RTHDR = 5 +pkg syscall (linux-386-cgo), const IPV6_ADDRFORM = 1 +pkg syscall (linux-386-cgo), const IPV6_ADD_MEMBERSHIP = 20 +pkg syscall (linux-386-cgo), const IPV6_AUTHHDR = 10 +pkg syscall (linux-386-cgo), const IPV6_CHECKSUM = 7 +pkg syscall (linux-386-cgo), const IPV6_DROP_MEMBERSHIP = 21 +pkg syscall (linux-386-cgo), const IPV6_DSTOPTS = 59 +pkg syscall (linux-386-cgo), const IPV6_HOPLIMIT = 52 +pkg syscall (linux-386-cgo), const IPV6_HOPOPTS = 54 +pkg syscall (linux-386-cgo), const IPV6_IPSEC_POLICY = 34 +pkg syscall (linux-386-cgo), const IPV6_JOIN_ANYCAST = 27 +pkg syscall (linux-386-cgo), const IPV6_JOIN_GROUP = 20 +pkg syscall (linux-386-cgo), const IPV6_LEAVE_ANYCAST = 28 +pkg syscall (linux-386-cgo), const IPV6_LEAVE_GROUP = 21 +pkg syscall (linux-386-cgo), const IPV6_MTU = 24 +pkg syscall (linux-386-cgo), const IPV6_MTU_DISCOVER = 23 +pkg syscall (linux-386-cgo), const IPV6_MULTICAST_HOPS = 18 +pkg syscall (linux-386-cgo), const IPV6_MULTICAST_IF = 17 +pkg syscall (linux-386-cgo), const IPV6_MULTICAST_LOOP = 19 +pkg syscall (linux-386-cgo), const IPV6_NEXTHOP = 9 +pkg syscall (linux-386-cgo), const IPV6_PKTINFO = 50 +pkg syscall (linux-386-cgo), const IPV6_PMTUDISC_DO = 2 +pkg syscall (linux-386-cgo), const IPV6_PMTUDISC_DONT = 0 +pkg syscall (linux-386-cgo), const IPV6_PMTUDISC_PROBE = 3 +pkg syscall (linux-386-cgo), const IPV6_PMTUDISC_WANT = 1 +pkg syscall (linux-386-cgo), const IPV6_RECVDSTOPTS = 58 +pkg syscall (linux-386-cgo), const IPV6_RECVERR = 25 +pkg syscall (linux-386-cgo), const IPV6_RECVHOPLIMIT = 51 +pkg syscall (linux-386-cgo), const IPV6_RECVHOPOPTS = 53 +pkg syscall (linux-386-cgo), const IPV6_RECVPKTINFO = 49 +pkg syscall (linux-386-cgo), const IPV6_RECVRTHDR = 56 +pkg syscall (linux-386-cgo), const IPV6_RECVTCLASS = 66 +pkg syscall (linux-386-cgo), const IPV6_ROUTER_ALERT = 22 +pkg syscall (linux-386-cgo), const IPV6_RTHDR = 57 +pkg syscall (linux-386-cgo), const IPV6_RTHDRDSTOPTS = 55 +pkg syscall (linux-386-cgo), const IPV6_RTHDR_LOOSE = 0 +pkg syscall (linux-386-cgo), const IPV6_RTHDR_STRICT = 1 +pkg syscall (linux-386-cgo), const IPV6_RTHDR_TYPE_0 = 0 +pkg syscall (linux-386-cgo), const IPV6_RXDSTOPTS = 59 +pkg syscall (linux-386-cgo), const IPV6_RXHOPOPTS = 54 +pkg syscall (linux-386-cgo), const IPV6_TCLASS = 67 +pkg syscall (linux-386-cgo), const IPV6_UNICAST_HOPS = 16 +pkg syscall (linux-386-cgo), const IPV6_V6ONLY = 26 +pkg syscall (linux-386-cgo), const IPV6_XFRM_POLICY = 35 +pkg syscall (linux-386-cgo), const IP_ADD_MEMBERSHIP = 35 +pkg syscall (linux-386-cgo), const IP_ADD_SOURCE_MEMBERSHIP = 39 +pkg syscall (linux-386-cgo), const IP_BLOCK_SOURCE = 38 +pkg syscall (linux-386-cgo), const IP_DEFAULT_MULTICAST_LOOP = 1 +pkg syscall (linux-386-cgo), const IP_DEFAULT_MULTICAST_TTL = 1 +pkg syscall (linux-386-cgo), const IP_DF = 16384 +pkg syscall (linux-386-cgo), const IP_DROP_MEMBERSHIP = 36 +pkg syscall (linux-386-cgo), const IP_DROP_SOURCE_MEMBERSHIP = 40 +pkg syscall (linux-386-cgo), const IP_FREEBIND = 15 +pkg syscall (linux-386-cgo), const IP_HDRINCL = 3 +pkg syscall (linux-386-cgo), const IP_IPSEC_POLICY = 16 +pkg syscall (linux-386-cgo), const IP_MAXPACKET = 65535 +pkg syscall (linux-386-cgo), const IP_MAX_MEMBERSHIPS = 20 +pkg syscall (linux-386-cgo), const IP_MF = 8192 +pkg syscall (linux-386-cgo), const IP_MINTTL = 21 +pkg syscall (linux-386-cgo), const IP_MSFILTER = 41 +pkg syscall (linux-386-cgo), const IP_MSS = 576 +pkg syscall (linux-386-cgo), const IP_MTU = 14 +pkg syscall (linux-386-cgo), const IP_MTU_DISCOVER = 10 +pkg syscall (linux-386-cgo), const IP_MULTICAST_IF = 32 +pkg syscall (linux-386-cgo), const IP_MULTICAST_LOOP = 34 +pkg syscall (linux-386-cgo), const IP_MULTICAST_TTL = 33 +pkg syscall (linux-386-cgo), const IP_OFFMASK = 8191 +pkg syscall (linux-386-cgo), const IP_OPTIONS = 4 +pkg syscall (linux-386-cgo), const IP_ORIGDSTADDR = 20 +pkg syscall (linux-386-cgo), const IP_PASSSEC = 18 +pkg syscall (linux-386-cgo), const IP_PKTINFO = 8 +pkg syscall (linux-386-cgo), const IP_PKTOPTIONS = 9 +pkg syscall (linux-386-cgo), const IP_PMTUDISC = 10 +pkg syscall (linux-386-cgo), const IP_PMTUDISC_DO = 2 +pkg syscall (linux-386-cgo), const IP_PMTUDISC_DONT = 0 +pkg syscall (linux-386-cgo), const IP_PMTUDISC_PROBE = 3 +pkg syscall (linux-386-cgo), const IP_PMTUDISC_WANT = 1 +pkg syscall (linux-386-cgo), const IP_RECVERR = 11 +pkg syscall (linux-386-cgo), const IP_RECVOPTS = 6 +pkg syscall (linux-386-cgo), const IP_RECVORIGDSTADDR = 20 +pkg syscall (linux-386-cgo), const IP_RECVRETOPTS = 7 +pkg syscall (linux-386-cgo), const IP_RECVTOS = 13 +pkg syscall (linux-386-cgo), const IP_RECVTTL = 12 +pkg syscall (linux-386-cgo), const IP_RETOPTS = 7 +pkg syscall (linux-386-cgo), const IP_RF = 32768 +pkg syscall (linux-386-cgo), const IP_ROUTER_ALERT = 5 +pkg syscall (linux-386-cgo), const IP_TOS = 1 +pkg syscall (linux-386-cgo), const IP_TRANSPARENT = 19 +pkg syscall (linux-386-cgo), const IP_TTL = 2 +pkg syscall (linux-386-cgo), const IP_UNBLOCK_SOURCE = 37 +pkg syscall (linux-386-cgo), const IP_XFRM_POLICY = 17 +pkg syscall (linux-386-cgo), const ISIG = 1 +pkg syscall (linux-386-cgo), const ISTRIP = 32 +pkg syscall (linux-386-cgo), const IUCLC = 512 +pkg syscall (linux-386-cgo), const IUTF8 = 16384 +pkg syscall (linux-386-cgo), const IXANY = 2048 +pkg syscall (linux-386-cgo), const IXOFF = 4096 +pkg syscall (linux-386-cgo), const IXON = 1024 +pkg syscall (linux-386-cgo), const ImplementsGetwd = true +pkg syscall (linux-386-cgo), const LINUX_REBOOT_CMD_CAD_OFF = 0 +pkg syscall (linux-386-cgo), const LINUX_REBOOT_CMD_CAD_ON = 2309737967 +pkg syscall (linux-386-cgo), const LINUX_REBOOT_CMD_HALT = 3454992675 +pkg syscall (linux-386-cgo), const LINUX_REBOOT_CMD_KEXEC = 1163412803 +pkg syscall (linux-386-cgo), const LINUX_REBOOT_CMD_POWER_OFF = 1126301404 +pkg syscall (linux-386-cgo), const LINUX_REBOOT_CMD_RESTART = 19088743 +pkg syscall (linux-386-cgo), const LINUX_REBOOT_CMD_RESTART2 = 2712847316 +pkg syscall (linux-386-cgo), const LINUX_REBOOT_CMD_SW_SUSPEND = 3489725666 +pkg syscall (linux-386-cgo), const LINUX_REBOOT_MAGIC1 = 4276215469 +pkg syscall (linux-386-cgo), const LINUX_REBOOT_MAGIC2 = 672274793 +pkg syscall (linux-386-cgo), const LOCK_EX = 2 +pkg syscall (linux-386-cgo), const LOCK_NB = 4 +pkg syscall (linux-386-cgo), const LOCK_SH = 1 +pkg syscall (linux-386-cgo), const LOCK_UN = 8 +pkg syscall (linux-386-cgo), const MADV_DOFORK = 11 +pkg syscall (linux-386-cgo), const MADV_DONTFORK = 10 +pkg syscall (linux-386-cgo), const MADV_DONTNEED = 4 +pkg syscall (linux-386-cgo), const MADV_HUGEPAGE = 14 +pkg syscall (linux-386-cgo), const MADV_HWPOISON = 100 +pkg syscall (linux-386-cgo), const MADV_MERGEABLE = 12 +pkg syscall (linux-386-cgo), const MADV_NOHUGEPAGE = 15 +pkg syscall (linux-386-cgo), const MADV_NORMAL = 0 +pkg syscall (linux-386-cgo), const MADV_RANDOM = 1 +pkg syscall (linux-386-cgo), const MADV_REMOVE = 9 +pkg syscall (linux-386-cgo), const MADV_SEQUENTIAL = 2 +pkg syscall (linux-386-cgo), const MADV_UNMERGEABLE = 13 +pkg syscall (linux-386-cgo), const MADV_WILLNEED = 3 +pkg syscall (linux-386-cgo), const MAP_32BIT = 64 +pkg syscall (linux-386-cgo), const MAP_ANON = 32 +pkg syscall (linux-386-cgo), const MAP_ANONYMOUS = 32 +pkg syscall (linux-386-cgo), const MAP_DENYWRITE = 2048 +pkg syscall (linux-386-cgo), const MAP_EXECUTABLE = 4096 +pkg syscall (linux-386-cgo), const MAP_FILE = 0 +pkg syscall (linux-386-cgo), const MAP_FIXED = 16 +pkg syscall (linux-386-cgo), const MAP_GROWSDOWN = 256 +pkg syscall (linux-386-cgo), const MAP_HUGETLB = 262144 +pkg syscall (linux-386-cgo), const MAP_LOCKED = 8192 +pkg syscall (linux-386-cgo), const MAP_NONBLOCK = 65536 +pkg syscall (linux-386-cgo), const MAP_NORESERVE = 16384 +pkg syscall (linux-386-cgo), const MAP_POPULATE = 32768 +pkg syscall (linux-386-cgo), const MAP_PRIVATE = 2 +pkg syscall (linux-386-cgo), const MAP_SHARED = 1 +pkg syscall (linux-386-cgo), const MAP_STACK = 131072 +pkg syscall (linux-386-cgo), const MAP_TYPE = 15 +pkg syscall (linux-386-cgo), const MCL_CURRENT = 1 +pkg syscall (linux-386-cgo), const MCL_FUTURE = 2 +pkg syscall (linux-386-cgo), const MNT_DETACH = 2 +pkg syscall (linux-386-cgo), const MNT_EXPIRE = 4 +pkg syscall (linux-386-cgo), const MNT_FORCE = 1 +pkg syscall (linux-386-cgo), const MSG_CMSG_CLOEXEC = 1073741824 +pkg syscall (linux-386-cgo), const MSG_CONFIRM = 2048 +pkg syscall (linux-386-cgo), const MSG_CTRUNC = 8 +pkg syscall (linux-386-cgo), const MSG_DONTROUTE = 4 +pkg syscall (linux-386-cgo), const MSG_DONTWAIT = 64 +pkg syscall (linux-386-cgo), const MSG_EOR = 128 +pkg syscall (linux-386-cgo), const MSG_ERRQUEUE = 8192 +pkg syscall (linux-386-cgo), const MSG_FASTOPEN = 536870912 +pkg syscall (linux-386-cgo), const MSG_FASTOPEN ideal-int +pkg syscall (linux-386-cgo), const MSG_FIN = 512 +pkg syscall (linux-386-cgo), const MSG_MORE = 32768 +pkg syscall (linux-386-cgo), const MSG_NOSIGNAL = 16384 +pkg syscall (linux-386-cgo), const MSG_OOB = 1 +pkg syscall (linux-386-cgo), const MSG_PEEK = 2 +pkg syscall (linux-386-cgo), const MSG_PROXY = 16 +pkg syscall (linux-386-cgo), const MSG_RST = 4096 +pkg syscall (linux-386-cgo), const MSG_SYN = 1024 +pkg syscall (linux-386-cgo), const MSG_TRUNC = 32 +pkg syscall (linux-386-cgo), const MSG_TRYHARD = 4 +pkg syscall (linux-386-cgo), const MSG_WAITALL = 256 +pkg syscall (linux-386-cgo), const MSG_WAITFORONE = 65536 +pkg syscall (linux-386-cgo), const MS_ACTIVE = 1073741824 +pkg syscall (linux-386-cgo), const MS_ASYNC = 1 +pkg syscall (linux-386-cgo), const MS_BIND = 4096 +pkg syscall (linux-386-cgo), const MS_DIRSYNC = 128 +pkg syscall (linux-386-cgo), const MS_INVALIDATE = 2 +pkg syscall (linux-386-cgo), const MS_I_VERSION = 8388608 +pkg syscall (linux-386-cgo), const MS_KERNMOUNT = 4194304 +pkg syscall (linux-386-cgo), const MS_MANDLOCK = 64 +pkg syscall (linux-386-cgo), const MS_MGC_MSK = 4294901760 +pkg syscall (linux-386-cgo), const MS_MGC_VAL = 3236757504 +pkg syscall (linux-386-cgo), const MS_MOVE = 8192 +pkg syscall (linux-386-cgo), const MS_NOATIME = 1024 +pkg syscall (linux-386-cgo), const MS_NODEV = 4 +pkg syscall (linux-386-cgo), const MS_NODIRATIME = 2048 +pkg syscall (linux-386-cgo), const MS_NOEXEC = 8 +pkg syscall (linux-386-cgo), const MS_NOSUID = 2 +pkg syscall (linux-386-cgo), const MS_NOUSER = -2147483648 +pkg syscall (linux-386-cgo), const MS_POSIXACL = 65536 +pkg syscall (linux-386-cgo), const MS_PRIVATE = 262144 +pkg syscall (linux-386-cgo), const MS_RDONLY = 1 +pkg syscall (linux-386-cgo), const MS_REC = 16384 +pkg syscall (linux-386-cgo), const MS_RELATIME = 2097152 +pkg syscall (linux-386-cgo), const MS_REMOUNT = 32 +pkg syscall (linux-386-cgo), const MS_RMT_MASK = 8388689 +pkg syscall (linux-386-cgo), const MS_SHARED = 1048576 +pkg syscall (linux-386-cgo), const MS_SILENT = 32768 +pkg syscall (linux-386-cgo), const MS_SLAVE = 524288 +pkg syscall (linux-386-cgo), const MS_STRICTATIME = 16777216 +pkg syscall (linux-386-cgo), const MS_SYNC = 4 +pkg syscall (linux-386-cgo), const MS_SYNCHRONOUS = 16 +pkg syscall (linux-386-cgo), const MS_UNBINDABLE = 131072 +pkg syscall (linux-386-cgo), const NAME_MAX = 255 +pkg syscall (linux-386-cgo), const NETLINK_ADD_MEMBERSHIP = 1 +pkg syscall (linux-386-cgo), const NETLINK_AUDIT = 9 +pkg syscall (linux-386-cgo), const NETLINK_BROADCAST_ERROR = 4 +pkg syscall (linux-386-cgo), const NETLINK_CONNECTOR = 11 +pkg syscall (linux-386-cgo), const NETLINK_DNRTMSG = 14 +pkg syscall (linux-386-cgo), const NETLINK_DROP_MEMBERSHIP = 2 +pkg syscall (linux-386-cgo), const NETLINK_ECRYPTFS = 19 +pkg syscall (linux-386-cgo), const NETLINK_FIB_LOOKUP = 10 +pkg syscall (linux-386-cgo), const NETLINK_FIREWALL = 3 +pkg syscall (linux-386-cgo), const NETLINK_GENERIC = 16 +pkg syscall (linux-386-cgo), const NETLINK_INET_DIAG = 4 +pkg syscall (linux-386-cgo), const NETLINK_IP6_FW = 13 +pkg syscall (linux-386-cgo), const NETLINK_ISCSI = 8 +pkg syscall (linux-386-cgo), const NETLINK_KOBJECT_UEVENT = 15 +pkg syscall (linux-386-cgo), const NETLINK_NETFILTER = 12 +pkg syscall (linux-386-cgo), const NETLINK_NFLOG = 5 +pkg syscall (linux-386-cgo), const NETLINK_NO_ENOBUFS = 5 +pkg syscall (linux-386-cgo), const NETLINK_PKTINFO = 3 +pkg syscall (linux-386-cgo), const NETLINK_ROUTE = 0 +pkg syscall (linux-386-cgo), const NETLINK_SCSITRANSPORT = 18 +pkg syscall (linux-386-cgo), const NETLINK_SELINUX = 7 +pkg syscall (linux-386-cgo), const NETLINK_UNUSED = 1 +pkg syscall (linux-386-cgo), const NETLINK_USERSOCK = 2 +pkg syscall (linux-386-cgo), const NETLINK_XFRM = 6 +pkg syscall (linux-386-cgo), const NLA_ALIGNTO = 4 +pkg syscall (linux-386-cgo), const NLA_F_NESTED = 32768 +pkg syscall (linux-386-cgo), const NLA_F_NET_BYTEORDER = 16384 +pkg syscall (linux-386-cgo), const NLA_HDRLEN = 4 +pkg syscall (linux-386-cgo), const NLMSG_ALIGNTO = 4 +pkg syscall (linux-386-cgo), const NLMSG_DONE = 3 +pkg syscall (linux-386-cgo), const NLMSG_ERROR = 2 +pkg syscall (linux-386-cgo), const NLMSG_HDRLEN = 16 +pkg syscall (linux-386-cgo), const NLMSG_MIN_TYPE = 16 +pkg syscall (linux-386-cgo), const NLMSG_NOOP = 1 +pkg syscall (linux-386-cgo), const NLMSG_OVERRUN = 4 +pkg syscall (linux-386-cgo), const NLM_F_ACK = 4 +pkg syscall (linux-386-cgo), const NLM_F_APPEND = 2048 +pkg syscall (linux-386-cgo), const NLM_F_ATOMIC = 1024 +pkg syscall (linux-386-cgo), const NLM_F_CREATE = 1024 +pkg syscall (linux-386-cgo), const NLM_F_DUMP = 768 +pkg syscall (linux-386-cgo), const NLM_F_ECHO = 8 +pkg syscall (linux-386-cgo), const NLM_F_EXCL = 512 +pkg syscall (linux-386-cgo), const NLM_F_MATCH = 512 +pkg syscall (linux-386-cgo), const NLM_F_MULTI = 2 +pkg syscall (linux-386-cgo), const NLM_F_REPLACE = 256 +pkg syscall (linux-386-cgo), const NLM_F_REQUEST = 1 +pkg syscall (linux-386-cgo), const NLM_F_ROOT = 256 +pkg syscall (linux-386-cgo), const NOFLSH = 128 +pkg syscall (linux-386-cgo), const OCRNL = 8 +pkg syscall (linux-386-cgo), const OFDEL = 128 +pkg syscall (linux-386-cgo), const OFILL = 64 +pkg syscall (linux-386-cgo), const OLCUC = 2 +pkg syscall (linux-386-cgo), const ONLCR = 4 +pkg syscall (linux-386-cgo), const ONLRET = 32 +pkg syscall (linux-386-cgo), const ONOCR = 16 +pkg syscall (linux-386-cgo), const OPOST = 1 +pkg syscall (linux-386-cgo), const O_ACCMODE = 3 +pkg syscall (linux-386-cgo), const O_APPEND = 1024 +pkg syscall (linux-386-cgo), const O_ASYNC = 8192 +pkg syscall (linux-386-cgo), const O_CLOEXEC = 524288 +pkg syscall (linux-386-cgo), const O_CREAT = 64 +pkg syscall (linux-386-cgo), const O_DIRECT = 16384 +pkg syscall (linux-386-cgo), const O_DIRECTORY = 65536 +pkg syscall (linux-386-cgo), const O_DSYNC = 4096 +pkg syscall (linux-386-cgo), const O_EXCL = 128 +pkg syscall (linux-386-cgo), const O_FSYNC = 1052672 +pkg syscall (linux-386-cgo), const O_LARGEFILE = 32768 +pkg syscall (linux-386-cgo), const O_NDELAY = 2048 +pkg syscall (linux-386-cgo), const O_NOATIME = 262144 +pkg syscall (linux-386-cgo), const O_NOCTTY = 256 +pkg syscall (linux-386-cgo), const O_NOFOLLOW = 131072 +pkg syscall (linux-386-cgo), const O_NONBLOCK = 2048 +pkg syscall (linux-386-cgo), const O_RSYNC = 1052672 +pkg syscall (linux-386-cgo), const O_SYNC = 1052672 +pkg syscall (linux-386-cgo), const O_TRUNC = 512 +pkg syscall (linux-386-cgo), const PACKET_ADD_MEMBERSHIP = 1 +pkg syscall (linux-386-cgo), const PACKET_BROADCAST = 1 +pkg syscall (linux-386-cgo), const PACKET_DROP_MEMBERSHIP = 2 +pkg syscall (linux-386-cgo), const PACKET_FASTROUTE = 6 +pkg syscall (linux-386-cgo), const PACKET_HOST = 0 +pkg syscall (linux-386-cgo), const PACKET_LOOPBACK = 5 +pkg syscall (linux-386-cgo), const PACKET_MR_ALLMULTI = 2 +pkg syscall (linux-386-cgo), const PACKET_MR_MULTICAST = 0 +pkg syscall (linux-386-cgo), const PACKET_MR_PROMISC = 1 +pkg syscall (linux-386-cgo), const PACKET_MULTICAST = 2 +pkg syscall (linux-386-cgo), const PACKET_OTHERHOST = 3 +pkg syscall (linux-386-cgo), const PACKET_OUTGOING = 4 +pkg syscall (linux-386-cgo), const PACKET_RECV_OUTPUT = 3 +pkg syscall (linux-386-cgo), const PACKET_RX_RING = 5 +pkg syscall (linux-386-cgo), const PACKET_STATISTICS = 6 +pkg syscall (linux-386-cgo), const PARENB = 256 +pkg syscall (linux-386-cgo), const PARMRK = 8 +pkg syscall (linux-386-cgo), const PARODD = 512 +pkg syscall (linux-386-cgo), const PENDIN = 16384 +pkg syscall (linux-386-cgo), const PROT_EXEC = 4 +pkg syscall (linux-386-cgo), const PROT_GROWSDOWN = 16777216 +pkg syscall (linux-386-cgo), const PROT_GROWSUP = 33554432 +pkg syscall (linux-386-cgo), const PROT_NONE = 0 +pkg syscall (linux-386-cgo), const PROT_READ = 1 +pkg syscall (linux-386-cgo), const PROT_WRITE = 2 +pkg syscall (linux-386-cgo), const PR_CAPBSET_DROP = 24 +pkg syscall (linux-386-cgo), const PR_CAPBSET_READ = 23 +pkg syscall (linux-386-cgo), const PR_ENDIAN_BIG = 0 +pkg syscall (linux-386-cgo), const PR_ENDIAN_LITTLE = 1 +pkg syscall (linux-386-cgo), const PR_ENDIAN_PPC_LITTLE = 2 +pkg syscall (linux-386-cgo), const PR_FPEMU_NOPRINT = 1 +pkg syscall (linux-386-cgo), const PR_FPEMU_SIGFPE = 2 +pkg syscall (linux-386-cgo), const PR_FP_EXC_ASYNC = 2 +pkg syscall (linux-386-cgo), const PR_FP_EXC_DISABLED = 0 +pkg syscall (linux-386-cgo), const PR_FP_EXC_DIV = 65536 +pkg syscall (linux-386-cgo), const PR_FP_EXC_INV = 1048576 +pkg syscall (linux-386-cgo), const PR_FP_EXC_NONRECOV = 1 +pkg syscall (linux-386-cgo), const PR_FP_EXC_OVF = 131072 +pkg syscall (linux-386-cgo), const PR_FP_EXC_PRECISE = 3 +pkg syscall (linux-386-cgo), const PR_FP_EXC_RES = 524288 +pkg syscall (linux-386-cgo), const PR_FP_EXC_SW_ENABLE = 128 +pkg syscall (linux-386-cgo), const PR_FP_EXC_UND = 262144 +pkg syscall (linux-386-cgo), const PR_GET_DUMPABLE = 3 +pkg syscall (linux-386-cgo), const PR_GET_ENDIAN = 19 +pkg syscall (linux-386-cgo), const PR_GET_FPEMU = 9 +pkg syscall (linux-386-cgo), const PR_GET_FPEXC = 11 +pkg syscall (linux-386-cgo), const PR_GET_KEEPCAPS = 7 +pkg syscall (linux-386-cgo), const PR_GET_NAME = 16 +pkg syscall (linux-386-cgo), const PR_GET_PDEATHSIG = 2 +pkg syscall (linux-386-cgo), const PR_GET_SECCOMP = 21 +pkg syscall (linux-386-cgo), const PR_GET_SECUREBITS = 27 +pkg syscall (linux-386-cgo), const PR_GET_TIMERSLACK = 30 +pkg syscall (linux-386-cgo), const PR_GET_TIMING = 13 +pkg syscall (linux-386-cgo), const PR_GET_TSC = 25 +pkg syscall (linux-386-cgo), const PR_GET_UNALIGN = 5 +pkg syscall (linux-386-cgo), const PR_MCE_KILL = 33 +pkg syscall (linux-386-cgo), const PR_MCE_KILL_CLEAR = 0 +pkg syscall (linux-386-cgo), const PR_MCE_KILL_DEFAULT = 2 +pkg syscall (linux-386-cgo), const PR_MCE_KILL_EARLY = 1 +pkg syscall (linux-386-cgo), const PR_MCE_KILL_GET = 34 +pkg syscall (linux-386-cgo), const PR_MCE_KILL_LATE = 0 +pkg syscall (linux-386-cgo), const PR_MCE_KILL_SET = 1 +pkg syscall (linux-386-cgo), const PR_SET_DUMPABLE = 4 +pkg syscall (linux-386-cgo), const PR_SET_ENDIAN = 20 +pkg syscall (linux-386-cgo), const PR_SET_FPEMU = 10 +pkg syscall (linux-386-cgo), const PR_SET_FPEXC = 12 +pkg syscall (linux-386-cgo), const PR_SET_KEEPCAPS = 8 +pkg syscall (linux-386-cgo), const PR_SET_NAME = 15 +pkg syscall (linux-386-cgo), const PR_SET_PDEATHSIG = 1 +pkg syscall (linux-386-cgo), const PR_SET_PTRACER = 1499557217 +pkg syscall (linux-386-cgo), const PR_SET_SECCOMP = 22 +pkg syscall (linux-386-cgo), const PR_SET_SECUREBITS = 28 +pkg syscall (linux-386-cgo), const PR_SET_TIMERSLACK = 29 +pkg syscall (linux-386-cgo), const PR_SET_TIMING = 14 +pkg syscall (linux-386-cgo), const PR_SET_TSC = 26 +pkg syscall (linux-386-cgo), const PR_SET_UNALIGN = 6 +pkg syscall (linux-386-cgo), const PR_TASK_PERF_EVENTS_DISABLE = 31 +pkg syscall (linux-386-cgo), const PR_TASK_PERF_EVENTS_ENABLE = 32 +pkg syscall (linux-386-cgo), const PR_TIMING_STATISTICAL = 0 +pkg syscall (linux-386-cgo), const PR_TIMING_TIMESTAMP = 1 +pkg syscall (linux-386-cgo), const PR_TSC_ENABLE = 1 +pkg syscall (linux-386-cgo), const PR_TSC_SIGSEGV = 2 +pkg syscall (linux-386-cgo), const PR_UNALIGN_NOPRINT = 1 +pkg syscall (linux-386-cgo), const PR_UNALIGN_SIGBUS = 2 +pkg syscall (linux-386-cgo), const PTRACE_ATTACH = 16 +pkg syscall (linux-386-cgo), const PTRACE_CONT = 7 +pkg syscall (linux-386-cgo), const PTRACE_DETACH = 17 +pkg syscall (linux-386-cgo), const PTRACE_EVENT_CLONE = 3 +pkg syscall (linux-386-cgo), const PTRACE_EVENT_EXEC = 4 +pkg syscall (linux-386-cgo), const PTRACE_EVENT_EXIT = 6 +pkg syscall (linux-386-cgo), const PTRACE_EVENT_FORK = 1 +pkg syscall (linux-386-cgo), const PTRACE_EVENT_VFORK = 2 +pkg syscall (linux-386-cgo), const PTRACE_EVENT_VFORK_DONE = 5 +pkg syscall (linux-386-cgo), const PTRACE_GETEVENTMSG = 16897 +pkg syscall (linux-386-cgo), const PTRACE_GETFPREGS = 14 +pkg syscall (linux-386-cgo), const PTRACE_GETFPXREGS = 18 +pkg syscall (linux-386-cgo), const PTRACE_GETREGS = 12 +pkg syscall (linux-386-cgo), const PTRACE_GETREGSET = 16900 +pkg syscall (linux-386-cgo), const PTRACE_GETSIGINFO = 16898 +pkg syscall (linux-386-cgo), const PTRACE_GET_THREAD_AREA = 25 +pkg syscall (linux-386-cgo), const PTRACE_KILL = 8 +pkg syscall (linux-386-cgo), const PTRACE_OLDSETOPTIONS = 21 +pkg syscall (linux-386-cgo), const PTRACE_O_MASK = 127 +pkg syscall (linux-386-cgo), const PTRACE_O_TRACECLONE = 8 +pkg syscall (linux-386-cgo), const PTRACE_O_TRACEEXEC = 16 +pkg syscall (linux-386-cgo), const PTRACE_O_TRACEEXIT = 64 +pkg syscall (linux-386-cgo), const PTRACE_O_TRACEFORK = 2 +pkg syscall (linux-386-cgo), const PTRACE_O_TRACESYSGOOD = 1 +pkg syscall (linux-386-cgo), const PTRACE_O_TRACEVFORK = 4 +pkg syscall (linux-386-cgo), const PTRACE_O_TRACEVFORKDONE = 32 +pkg syscall (linux-386-cgo), const PTRACE_PEEKDATA = 2 +pkg syscall (linux-386-cgo), const PTRACE_PEEKTEXT = 1 +pkg syscall (linux-386-cgo), const PTRACE_PEEKUSR = 3 +pkg syscall (linux-386-cgo), const PTRACE_POKEDATA = 5 +pkg syscall (linux-386-cgo), const PTRACE_POKETEXT = 4 +pkg syscall (linux-386-cgo), const PTRACE_POKEUSR = 6 +pkg syscall (linux-386-cgo), const PTRACE_SETFPREGS = 15 +pkg syscall (linux-386-cgo), const PTRACE_SETFPXREGS = 19 +pkg syscall (linux-386-cgo), const PTRACE_SETOPTIONS = 16896 +pkg syscall (linux-386-cgo), const PTRACE_SETREGS = 13 +pkg syscall (linux-386-cgo), const PTRACE_SETREGSET = 16901 +pkg syscall (linux-386-cgo), const PTRACE_SETSIGINFO = 16899 +pkg syscall (linux-386-cgo), const PTRACE_SET_THREAD_AREA = 26 +pkg syscall (linux-386-cgo), const PTRACE_SINGLEBLOCK = 33 +pkg syscall (linux-386-cgo), const PTRACE_SINGLESTEP = 9 +pkg syscall (linux-386-cgo), const PTRACE_SYSCALL = 24 +pkg syscall (linux-386-cgo), const PTRACE_SYSEMU = 31 +pkg syscall (linux-386-cgo), const PTRACE_SYSEMU_SINGLESTEP = 32 +pkg syscall (linux-386-cgo), const PTRACE_TRACEME = 0 +pkg syscall (linux-386-cgo), const PathMax = 4096 +pkg syscall (linux-386-cgo), const RLIMIT_AS = 9 +pkg syscall (linux-386-cgo), const RLIMIT_CORE = 4 +pkg syscall (linux-386-cgo), const RLIMIT_CPU = 0 +pkg syscall (linux-386-cgo), const RLIMIT_DATA = 2 +pkg syscall (linux-386-cgo), const RLIMIT_FSIZE = 1 +pkg syscall (linux-386-cgo), const RLIMIT_NOFILE = 7 +pkg syscall (linux-386-cgo), const RLIMIT_STACK = 3 +pkg syscall (linux-386-cgo), const RLIM_INFINITY = -1 +pkg syscall (linux-386-cgo), const RTAX_ADVMSS = 8 +pkg syscall (linux-386-cgo), const RTAX_CWND = 7 +pkg syscall (linux-386-cgo), const RTAX_FEATURES = 12 +pkg syscall (linux-386-cgo), const RTAX_FEATURE_ALLFRAG = 8 +pkg syscall (linux-386-cgo), const RTAX_FEATURE_ECN = 1 +pkg syscall (linux-386-cgo), const RTAX_FEATURE_SACK = 2 +pkg syscall (linux-386-cgo), const RTAX_FEATURE_TIMESTAMP = 4 +pkg syscall (linux-386-cgo), const RTAX_HOPLIMIT = 10 +pkg syscall (linux-386-cgo), const RTAX_INITCWND = 11 +pkg syscall (linux-386-cgo), const RTAX_INITRWND = 14 +pkg syscall (linux-386-cgo), const RTAX_LOCK = 1 +pkg syscall (linux-386-cgo), const RTAX_MAX = 14 +pkg syscall (linux-386-cgo), const RTAX_MTU = 2 +pkg syscall (linux-386-cgo), const RTAX_REORDERING = 9 +pkg syscall (linux-386-cgo), const RTAX_RTO_MIN = 13 +pkg syscall (linux-386-cgo), const RTAX_RTT = 4 +pkg syscall (linux-386-cgo), const RTAX_RTTVAR = 5 +pkg syscall (linux-386-cgo), const RTAX_SSTHRESH = 6 +pkg syscall (linux-386-cgo), const RTAX_UNSPEC = 0 +pkg syscall (linux-386-cgo), const RTAX_WINDOW = 3 +pkg syscall (linux-386-cgo), const RTA_ALIGNTO = 4 +pkg syscall (linux-386-cgo), const RTA_CACHEINFO = 12 +pkg syscall (linux-386-cgo), const RTA_DST = 1 +pkg syscall (linux-386-cgo), const RTA_FLOW = 11 +pkg syscall (linux-386-cgo), const RTA_GATEWAY = 5 +pkg syscall (linux-386-cgo), const RTA_IIF = 3 +pkg syscall (linux-386-cgo), const RTA_MAX = 16 +pkg syscall (linux-386-cgo), const RTA_METRICS = 8 +pkg syscall (linux-386-cgo), const RTA_MULTIPATH = 9 +pkg syscall (linux-386-cgo), const RTA_OIF = 4 +pkg syscall (linux-386-cgo), const RTA_PREFSRC = 7 +pkg syscall (linux-386-cgo), const RTA_PRIORITY = 6 +pkg syscall (linux-386-cgo), const RTA_SRC = 2 +pkg syscall (linux-386-cgo), const RTA_TABLE = 15 +pkg syscall (linux-386-cgo), const RTA_UNSPEC = 0 +pkg syscall (linux-386-cgo), const RTCF_DIRECTSRC = 67108864 +pkg syscall (linux-386-cgo), const RTCF_DOREDIRECT = 16777216 +pkg syscall (linux-386-cgo), const RTCF_LOG = 33554432 +pkg syscall (linux-386-cgo), const RTCF_MASQ = 4194304 +pkg syscall (linux-386-cgo), const RTCF_NAT = 8388608 +pkg syscall (linux-386-cgo), const RTCF_VALVE = 2097152 +pkg syscall (linux-386-cgo), const RTF_ADDRCLASSMASK = 4160749568 +pkg syscall (linux-386-cgo), const RTF_ADDRCONF = 262144 +pkg syscall (linux-386-cgo), const RTF_ALLONLINK = 131072 +pkg syscall (linux-386-cgo), const RTF_BROADCAST = 268435456 +pkg syscall (linux-386-cgo), const RTF_CACHE = 16777216 +pkg syscall (linux-386-cgo), const RTF_DEFAULT = 65536 +pkg syscall (linux-386-cgo), const RTF_DYNAMIC = 16 +pkg syscall (linux-386-cgo), const RTF_FLOW = 33554432 +pkg syscall (linux-386-cgo), const RTF_GATEWAY = 2 +pkg syscall (linux-386-cgo), const RTF_HOST = 4 +pkg syscall (linux-386-cgo), const RTF_INTERFACE = 1073741824 +pkg syscall (linux-386-cgo), const RTF_IRTT = 256 +pkg syscall (linux-386-cgo), const RTF_LINKRT = 1048576 +pkg syscall (linux-386-cgo), const RTF_LOCAL = 2147483648 +pkg syscall (linux-386-cgo), const RTF_MODIFIED = 32 +pkg syscall (linux-386-cgo), const RTF_MSS = 64 +pkg syscall (linux-386-cgo), const RTF_MTU = 64 +pkg syscall (linux-386-cgo), const RTF_MULTICAST = 536870912 +pkg syscall (linux-386-cgo), const RTF_NAT = 134217728 +pkg syscall (linux-386-cgo), const RTF_NOFORWARD = 4096 +pkg syscall (linux-386-cgo), const RTF_NONEXTHOP = 2097152 +pkg syscall (linux-386-cgo), const RTF_NOPMTUDISC = 16384 +pkg syscall (linux-386-cgo), const RTF_POLICY = 67108864 +pkg syscall (linux-386-cgo), const RTF_REINSTATE = 8 +pkg syscall (linux-386-cgo), const RTF_REJECT = 512 +pkg syscall (linux-386-cgo), const RTF_STATIC = 1024 +pkg syscall (linux-386-cgo), const RTF_THROW = 8192 +pkg syscall (linux-386-cgo), const RTF_UP = 1 +pkg syscall (linux-386-cgo), const RTF_WINDOW = 128 +pkg syscall (linux-386-cgo), const RTF_XRESOLVE = 2048 +pkg syscall (linux-386-cgo), const RTM_BASE = 16 +pkg syscall (linux-386-cgo), const RTM_DELACTION = 49 +pkg syscall (linux-386-cgo), const RTM_DELADDR = 21 +pkg syscall (linux-386-cgo), const RTM_DELADDRLABEL = 73 +pkg syscall (linux-386-cgo), const RTM_DELLINK = 17 +pkg syscall (linux-386-cgo), const RTM_DELNEIGH = 29 +pkg syscall (linux-386-cgo), const RTM_DELQDISC = 37 +pkg syscall (linux-386-cgo), const RTM_DELROUTE = 25 +pkg syscall (linux-386-cgo), const RTM_DELRULE = 33 +pkg syscall (linux-386-cgo), const RTM_DELTCLASS = 41 +pkg syscall (linux-386-cgo), const RTM_DELTFILTER = 45 +pkg syscall (linux-386-cgo), const RTM_F_CLONED = 512 +pkg syscall (linux-386-cgo), const RTM_F_EQUALIZE = 1024 +pkg syscall (linux-386-cgo), const RTM_F_NOTIFY = 256 +pkg syscall (linux-386-cgo), const RTM_F_PREFIX = 2048 +pkg syscall (linux-386-cgo), const RTM_GETACTION = 50 +pkg syscall (linux-386-cgo), const RTM_GETADDR = 22 +pkg syscall (linux-386-cgo), const RTM_GETADDRLABEL = 74 +pkg syscall (linux-386-cgo), const RTM_GETANYCAST = 62 +pkg syscall (linux-386-cgo), const RTM_GETDCB = 78 +pkg syscall (linux-386-cgo), const RTM_GETLINK = 18 +pkg syscall (linux-386-cgo), const RTM_GETMULTICAST = 58 +pkg syscall (linux-386-cgo), const RTM_GETNEIGH = 30 +pkg syscall (linux-386-cgo), const RTM_GETNEIGHTBL = 66 +pkg syscall (linux-386-cgo), const RTM_GETQDISC = 38 +pkg syscall (linux-386-cgo), const RTM_GETROUTE = 26 +pkg syscall (linux-386-cgo), const RTM_GETRULE = 34 +pkg syscall (linux-386-cgo), const RTM_GETTCLASS = 42 +pkg syscall (linux-386-cgo), const RTM_GETTFILTER = 46 +pkg syscall (linux-386-cgo), const RTM_MAX = 79 +pkg syscall (linux-386-cgo), const RTM_NEWACTION = 48 +pkg syscall (linux-386-cgo), const RTM_NEWADDR = 20 +pkg syscall (linux-386-cgo), const RTM_NEWADDRLABEL = 72 +pkg syscall (linux-386-cgo), const RTM_NEWLINK = 16 +pkg syscall (linux-386-cgo), const RTM_NEWNDUSEROPT = 68 +pkg syscall (linux-386-cgo), const RTM_NEWNEIGH = 28 +pkg syscall (linux-386-cgo), const RTM_NEWNEIGHTBL = 64 +pkg syscall (linux-386-cgo), const RTM_NEWPREFIX = 52 +pkg syscall (linux-386-cgo), const RTM_NEWQDISC = 36 +pkg syscall (linux-386-cgo), const RTM_NEWROUTE = 24 +pkg syscall (linux-386-cgo), const RTM_NEWRULE = 32 +pkg syscall (linux-386-cgo), const RTM_NEWTCLASS = 40 +pkg syscall (linux-386-cgo), const RTM_NEWTFILTER = 44 +pkg syscall (linux-386-cgo), const RTM_NR_FAMILIES = 16 +pkg syscall (linux-386-cgo), const RTM_NR_MSGTYPES = 64 +pkg syscall (linux-386-cgo), const RTM_SETDCB = 79 +pkg syscall (linux-386-cgo), const RTM_SETLINK = 19 +pkg syscall (linux-386-cgo), const RTM_SETNEIGHTBL = 67 +pkg syscall (linux-386-cgo), const RTNH_ALIGNTO = 4 +pkg syscall (linux-386-cgo), const RTNH_F_DEAD = 1 +pkg syscall (linux-386-cgo), const RTNH_F_ONLINK = 4 +pkg syscall (linux-386-cgo), const RTNH_F_PERVASIVE = 2 +pkg syscall (linux-386-cgo), const RTNLGRP_IPV4_IFADDR = 5 +pkg syscall (linux-386-cgo), const RTNLGRP_IPV4_IFADDR ideal-int +pkg syscall (linux-386-cgo), const RTNLGRP_IPV4_MROUTE = 6 +pkg syscall (linux-386-cgo), const RTNLGRP_IPV4_MROUTE ideal-int +pkg syscall (linux-386-cgo), const RTNLGRP_IPV4_ROUTE = 7 +pkg syscall (linux-386-cgo), const RTNLGRP_IPV4_ROUTE ideal-int +pkg syscall (linux-386-cgo), const RTNLGRP_IPV4_RULE = 8 +pkg syscall (linux-386-cgo), const RTNLGRP_IPV4_RULE ideal-int +pkg syscall (linux-386-cgo), const RTNLGRP_IPV6_IFADDR = 9 +pkg syscall (linux-386-cgo), const RTNLGRP_IPV6_IFADDR ideal-int +pkg syscall (linux-386-cgo), const RTNLGRP_IPV6_IFINFO = 12 +pkg syscall (linux-386-cgo), const RTNLGRP_IPV6_IFINFO ideal-int +pkg syscall (linux-386-cgo), const RTNLGRP_IPV6_MROUTE = 10 +pkg syscall (linux-386-cgo), const RTNLGRP_IPV6_MROUTE ideal-int +pkg syscall (linux-386-cgo), const RTNLGRP_IPV6_PREFIX = 18 +pkg syscall (linux-386-cgo), const RTNLGRP_IPV6_PREFIX ideal-int +pkg syscall (linux-386-cgo), const RTNLGRP_IPV6_ROUTE = 11 +pkg syscall (linux-386-cgo), const RTNLGRP_IPV6_ROUTE ideal-int +pkg syscall (linux-386-cgo), const RTNLGRP_IPV6_RULE = 19 +pkg syscall (linux-386-cgo), const RTNLGRP_IPV6_RULE ideal-int +pkg syscall (linux-386-cgo), const RTNLGRP_LINK = 1 +pkg syscall (linux-386-cgo), const RTNLGRP_LINK ideal-int +pkg syscall (linux-386-cgo), const RTNLGRP_ND_USEROPT = 20 +pkg syscall (linux-386-cgo), const RTNLGRP_ND_USEROPT ideal-int +pkg syscall (linux-386-cgo), const RTNLGRP_NEIGH = 3 +pkg syscall (linux-386-cgo), const RTNLGRP_NEIGH ideal-int +pkg syscall (linux-386-cgo), const RTNLGRP_NONE = 0 +pkg syscall (linux-386-cgo), const RTNLGRP_NONE ideal-int +pkg syscall (linux-386-cgo), const RTNLGRP_NOTIFY = 2 +pkg syscall (linux-386-cgo), const RTNLGRP_NOTIFY ideal-int +pkg syscall (linux-386-cgo), const RTNLGRP_TC = 4 +pkg syscall (linux-386-cgo), const RTNLGRP_TC ideal-int +pkg syscall (linux-386-cgo), const RTN_ANYCAST = 4 +pkg syscall (linux-386-cgo), const RTN_BLACKHOLE = 6 +pkg syscall (linux-386-cgo), const RTN_BROADCAST = 3 +pkg syscall (linux-386-cgo), const RTN_LOCAL = 2 +pkg syscall (linux-386-cgo), const RTN_MAX = 11 +pkg syscall (linux-386-cgo), const RTN_MULTICAST = 5 +pkg syscall (linux-386-cgo), const RTN_NAT = 10 +pkg syscall (linux-386-cgo), const RTN_PROHIBIT = 8 +pkg syscall (linux-386-cgo), const RTN_THROW = 9 +pkg syscall (linux-386-cgo), const RTN_UNICAST = 1 +pkg syscall (linux-386-cgo), const RTN_UNREACHABLE = 7 +pkg syscall (linux-386-cgo), const RTN_UNSPEC = 0 +pkg syscall (linux-386-cgo), const RTN_XRESOLVE = 11 +pkg syscall (linux-386-cgo), const RTPROT_BIRD = 12 +pkg syscall (linux-386-cgo), const RTPROT_BOOT = 3 +pkg syscall (linux-386-cgo), const RTPROT_DHCP = 16 +pkg syscall (linux-386-cgo), const RTPROT_DNROUTED = 13 +pkg syscall (linux-386-cgo), const RTPROT_GATED = 8 +pkg syscall (linux-386-cgo), const RTPROT_KERNEL = 2 +pkg syscall (linux-386-cgo), const RTPROT_MRT = 10 +pkg syscall (linux-386-cgo), const RTPROT_NTK = 15 +pkg syscall (linux-386-cgo), const RTPROT_RA = 9 +pkg syscall (linux-386-cgo), const RTPROT_REDIRECT = 1 +pkg syscall (linux-386-cgo), const RTPROT_STATIC = 4 +pkg syscall (linux-386-cgo), const RTPROT_UNSPEC = 0 +pkg syscall (linux-386-cgo), const RTPROT_XORP = 14 +pkg syscall (linux-386-cgo), const RTPROT_ZEBRA = 11 +pkg syscall (linux-386-cgo), const RT_CLASS_DEFAULT = 253 +pkg syscall (linux-386-cgo), const RT_CLASS_LOCAL = 255 +pkg syscall (linux-386-cgo), const RT_CLASS_MAIN = 254 +pkg syscall (linux-386-cgo), const RT_CLASS_MAX = 255 +pkg syscall (linux-386-cgo), const RT_CLASS_UNSPEC = 0 +pkg syscall (linux-386-cgo), const RT_SCOPE_HOST = 254 +pkg syscall (linux-386-cgo), const RT_SCOPE_LINK = 253 +pkg syscall (linux-386-cgo), const RT_SCOPE_NOWHERE = 255 +pkg syscall (linux-386-cgo), const RT_SCOPE_SITE = 200 +pkg syscall (linux-386-cgo), const RT_SCOPE_UNIVERSE = 0 +pkg syscall (linux-386-cgo), const RT_TABLE_COMPAT = 252 +pkg syscall (linux-386-cgo), const RT_TABLE_DEFAULT = 253 +pkg syscall (linux-386-cgo), const RT_TABLE_LOCAL = 255 +pkg syscall (linux-386-cgo), const RT_TABLE_MAIN = 254 +pkg syscall (linux-386-cgo), const RT_TABLE_MAX = 4294967295 +pkg syscall (linux-386-cgo), const RT_TABLE_UNSPEC = 0 +pkg syscall (linux-386-cgo), const RUSAGE_CHILDREN = -1 +pkg syscall (linux-386-cgo), const RUSAGE_SELF = 0 +pkg syscall (linux-386-cgo), const RUSAGE_THREAD = 1 +pkg syscall (linux-386-cgo), const SCM_CREDENTIALS = 2 +pkg syscall (linux-386-cgo), const SCM_RIGHTS = 1 +pkg syscall (linux-386-cgo), const SCM_TIMESTAMP = 29 +pkg syscall (linux-386-cgo), const SCM_TIMESTAMPING = 37 +pkg syscall (linux-386-cgo), const SCM_TIMESTAMPNS = 35 +pkg syscall (linux-386-cgo), const SIGBUS = 7 +pkg syscall (linux-386-cgo), const SIGCHLD = 17 +pkg syscall (linux-386-cgo), const SIGCLD = 17 +pkg syscall (linux-386-cgo), const SIGCONT = 18 +pkg syscall (linux-386-cgo), const SIGIO = 29 +pkg syscall (linux-386-cgo), const SIGIOT = 6 +pkg syscall (linux-386-cgo), const SIGPOLL = 29 +pkg syscall (linux-386-cgo), const SIGPROF = 27 +pkg syscall (linux-386-cgo), const SIGPWR = 30 +pkg syscall (linux-386-cgo), const SIGSTKFLT = 16 +pkg syscall (linux-386-cgo), const SIGSTOP = 19 +pkg syscall (linux-386-cgo), const SIGSYS = 31 +pkg syscall (linux-386-cgo), const SIGTSTP = 20 +pkg syscall (linux-386-cgo), const SIGTTIN = 21 +pkg syscall (linux-386-cgo), const SIGTTOU = 22 +pkg syscall (linux-386-cgo), const SIGUNUSED = 31 +pkg syscall (linux-386-cgo), const SIGURG = 23 +pkg syscall (linux-386-cgo), const SIGUSR1 = 10 +pkg syscall (linux-386-cgo), const SIGUSR2 = 12 +pkg syscall (linux-386-cgo), const SIGVTALRM = 26 +pkg syscall (linux-386-cgo), const SIGWINCH = 28 +pkg syscall (linux-386-cgo), const SIGXCPU = 24 +pkg syscall (linux-386-cgo), const SIGXFSZ = 25 +pkg syscall (linux-386-cgo), const SIOCADDDLCI = 35200 +pkg syscall (linux-386-cgo), const SIOCADDMULTI = 35121 +pkg syscall (linux-386-cgo), const SIOCADDRT = 35083 +pkg syscall (linux-386-cgo), const SIOCATMARK = 35077 +pkg syscall (linux-386-cgo), const SIOCDARP = 35155 +pkg syscall (linux-386-cgo), const SIOCDELDLCI = 35201 +pkg syscall (linux-386-cgo), const SIOCDELMULTI = 35122 +pkg syscall (linux-386-cgo), const SIOCDELRT = 35084 +pkg syscall (linux-386-cgo), const SIOCDEVPRIVATE = 35312 +pkg syscall (linux-386-cgo), const SIOCDIFADDR = 35126 +pkg syscall (linux-386-cgo), const SIOCDRARP = 35168 +pkg syscall (linux-386-cgo), const SIOCGARP = 35156 +pkg syscall (linux-386-cgo), const SIOCGIFADDR = 35093 +pkg syscall (linux-386-cgo), const SIOCGIFBR = 35136 +pkg syscall (linux-386-cgo), const SIOCGIFBRDADDR = 35097 +pkg syscall (linux-386-cgo), const SIOCGIFCONF = 35090 +pkg syscall (linux-386-cgo), const SIOCGIFCOUNT = 35128 +pkg syscall (linux-386-cgo), const SIOCGIFDSTADDR = 35095 +pkg syscall (linux-386-cgo), const SIOCGIFENCAP = 35109 +pkg syscall (linux-386-cgo), const SIOCGIFFLAGS = 35091 +pkg syscall (linux-386-cgo), const SIOCGIFHWADDR = 35111 +pkg syscall (linux-386-cgo), const SIOCGIFINDEX = 35123 +pkg syscall (linux-386-cgo), const SIOCGIFMAP = 35184 +pkg syscall (linux-386-cgo), const SIOCGIFMEM = 35103 +pkg syscall (linux-386-cgo), const SIOCGIFMETRIC = 35101 +pkg syscall (linux-386-cgo), const SIOCGIFMTU = 35105 +pkg syscall (linux-386-cgo), const SIOCGIFNAME = 35088 +pkg syscall (linux-386-cgo), const SIOCGIFNETMASK = 35099 +pkg syscall (linux-386-cgo), const SIOCGIFPFLAGS = 35125 +pkg syscall (linux-386-cgo), const SIOCGIFSLAVE = 35113 +pkg syscall (linux-386-cgo), const SIOCGIFTXQLEN = 35138 +pkg syscall (linux-386-cgo), const SIOCGPGRP = 35076 +pkg syscall (linux-386-cgo), const SIOCGRARP = 35169 +pkg syscall (linux-386-cgo), const SIOCGSTAMP = 35078 +pkg syscall (linux-386-cgo), const SIOCGSTAMPNS = 35079 +pkg syscall (linux-386-cgo), const SIOCPROTOPRIVATE = 35296 +pkg syscall (linux-386-cgo), const SIOCRTMSG = 35085 +pkg syscall (linux-386-cgo), const SIOCSARP = 35157 +pkg syscall (linux-386-cgo), const SIOCSIFADDR = 35094 +pkg syscall (linux-386-cgo), const SIOCSIFBR = 35137 +pkg syscall (linux-386-cgo), const SIOCSIFBRDADDR = 35098 +pkg syscall (linux-386-cgo), const SIOCSIFDSTADDR = 35096 +pkg syscall (linux-386-cgo), const SIOCSIFENCAP = 35110 +pkg syscall (linux-386-cgo), const SIOCSIFFLAGS = 35092 +pkg syscall (linux-386-cgo), const SIOCSIFHWADDR = 35108 +pkg syscall (linux-386-cgo), const SIOCSIFHWBROADCAST = 35127 +pkg syscall (linux-386-cgo), const SIOCSIFLINK = 35089 +pkg syscall (linux-386-cgo), const SIOCSIFMAP = 35185 +pkg syscall (linux-386-cgo), const SIOCSIFMEM = 35104 +pkg syscall (linux-386-cgo), const SIOCSIFMETRIC = 35102 +pkg syscall (linux-386-cgo), const SIOCSIFMTU = 35106 +pkg syscall (linux-386-cgo), const SIOCSIFNAME = 35107 +pkg syscall (linux-386-cgo), const SIOCSIFNETMASK = 35100 +pkg syscall (linux-386-cgo), const SIOCSIFPFLAGS = 35124 +pkg syscall (linux-386-cgo), const SIOCSIFSLAVE = 35120 +pkg syscall (linux-386-cgo), const SIOCSIFTXQLEN = 35139 +pkg syscall (linux-386-cgo), const SIOCSPGRP = 35074 +pkg syscall (linux-386-cgo), const SIOCSRARP = 35170 +pkg syscall (linux-386-cgo), const SOCK_CLOEXEC = 524288 +pkg syscall (linux-386-cgo), const SOCK_DCCP = 6 +pkg syscall (linux-386-cgo), const SOCK_NONBLOCK = 2048 +pkg syscall (linux-386-cgo), const SOCK_PACKET = 10 +pkg syscall (linux-386-cgo), const SOCK_RDM = 4 +pkg syscall (linux-386-cgo), const SOL_AAL = 265 +pkg syscall (linux-386-cgo), const SOL_ATM = 264 +pkg syscall (linux-386-cgo), const SOL_DECNET = 261 +pkg syscall (linux-386-cgo), const SOL_ICMPV6 = 58 +pkg syscall (linux-386-cgo), const SOL_IP = 0 +pkg syscall (linux-386-cgo), const SOL_IPV6 = 41 +pkg syscall (linux-386-cgo), const SOL_IRDA = 266 +pkg syscall (linux-386-cgo), const SOL_PACKET = 263 +pkg syscall (linux-386-cgo), const SOL_RAW = 255 +pkg syscall (linux-386-cgo), const SOL_SOCKET = 1 +pkg syscall (linux-386-cgo), const SOL_TCP = 6 +pkg syscall (linux-386-cgo), const SOL_X25 = 262 +pkg syscall (linux-386-cgo), const SOMAXCONN = 128 +pkg syscall (linux-386-cgo), const SO_ACCEPTCONN = 30 +pkg syscall (linux-386-cgo), const SO_ATTACH_FILTER = 26 +pkg syscall (linux-386-cgo), const SO_BINDTODEVICE = 25 +pkg syscall (linux-386-cgo), const SO_BROADCAST = 6 +pkg syscall (linux-386-cgo), const SO_BSDCOMPAT = 14 +pkg syscall (linux-386-cgo), const SO_DEBUG = 1 +pkg syscall (linux-386-cgo), const SO_DETACH_FILTER = 27 +pkg syscall (linux-386-cgo), const SO_DOMAIN = 39 +pkg syscall (linux-386-cgo), const SO_DONTROUTE = 5 +pkg syscall (linux-386-cgo), const SO_ERROR = 4 +pkg syscall (linux-386-cgo), const SO_KEEPALIVE = 9 +pkg syscall (linux-386-cgo), const SO_LINGER = 13 +pkg syscall (linux-386-cgo), const SO_MARK = 36 +pkg syscall (linux-386-cgo), const SO_NO_CHECK = 11 +pkg syscall (linux-386-cgo), const SO_OOBINLINE = 10 +pkg syscall (linux-386-cgo), const SO_PASSCRED = 16 +pkg syscall (linux-386-cgo), const SO_PASSSEC = 34 +pkg syscall (linux-386-cgo), const SO_PEERCRED = 17 +pkg syscall (linux-386-cgo), const SO_PEERNAME = 28 +pkg syscall (linux-386-cgo), const SO_PEERSEC = 31 +pkg syscall (linux-386-cgo), const SO_PRIORITY = 12 +pkg syscall (linux-386-cgo), const SO_PROTOCOL = 38 +pkg syscall (linux-386-cgo), const SO_RCVBUF = 8 +pkg syscall (linux-386-cgo), const SO_RCVBUFFORCE = 33 +pkg syscall (linux-386-cgo), const SO_RCVLOWAT = 18 +pkg syscall (linux-386-cgo), const SO_RCVTIMEO = 20 +pkg syscall (linux-386-cgo), const SO_REUSEADDR = 2 +pkg syscall (linux-386-cgo), const SO_RXQ_OVFL = 40 +pkg syscall (linux-386-cgo), const SO_SECURITY_AUTHENTICATION = 22 +pkg syscall (linux-386-cgo), const SO_SECURITY_ENCRYPTION_NETWORK = 24 +pkg syscall (linux-386-cgo), const SO_SECURITY_ENCRYPTION_TRANSPORT = 23 +pkg syscall (linux-386-cgo), const SO_SNDBUF = 7 +pkg syscall (linux-386-cgo), const SO_SNDBUFFORCE = 32 +pkg syscall (linux-386-cgo), const SO_SNDLOWAT = 19 +pkg syscall (linux-386-cgo), const SO_SNDTIMEO = 21 +pkg syscall (linux-386-cgo), const SO_TIMESTAMP = 29 +pkg syscall (linux-386-cgo), const SO_TIMESTAMPING = 37 +pkg syscall (linux-386-cgo), const SO_TIMESTAMPNS = 35 +pkg syscall (linux-386-cgo), const SO_TYPE = 3 +pkg syscall (linux-386-cgo), const SYS_ACCESS = 33 +pkg syscall (linux-386-cgo), const SYS_ACCT = 51 +pkg syscall (linux-386-cgo), const SYS_ADD_KEY = 286 +pkg syscall (linux-386-cgo), const SYS_ADJTIMEX = 124 +pkg syscall (linux-386-cgo), const SYS_AFS_SYSCALL = 137 +pkg syscall (linux-386-cgo), const SYS_ALARM = 27 +pkg syscall (linux-386-cgo), const SYS_BDFLUSH = 134 +pkg syscall (linux-386-cgo), const SYS_BREAK = 17 +pkg syscall (linux-386-cgo), const SYS_BRK = 45 +pkg syscall (linux-386-cgo), const SYS_CAPGET = 184 +pkg syscall (linux-386-cgo), const SYS_CAPSET = 185 +pkg syscall (linux-386-cgo), const SYS_CHDIR = 12 +pkg syscall (linux-386-cgo), const SYS_CHMOD = 15 +pkg syscall (linux-386-cgo), const SYS_CHOWN = 182 +pkg syscall (linux-386-cgo), const SYS_CHOWN32 = 212 +pkg syscall (linux-386-cgo), const SYS_CHROOT = 61 +pkg syscall (linux-386-cgo), const SYS_CLOCK_GETRES = 266 +pkg syscall (linux-386-cgo), const SYS_CLOCK_GETTIME = 265 +pkg syscall (linux-386-cgo), const SYS_CLOCK_NANOSLEEP = 267 +pkg syscall (linux-386-cgo), const SYS_CLOCK_SETTIME = 264 +pkg syscall (linux-386-cgo), const SYS_CLONE = 120 +pkg syscall (linux-386-cgo), const SYS_CLOSE = 6 +pkg syscall (linux-386-cgo), const SYS_CREAT = 8 +pkg syscall (linux-386-cgo), const SYS_CREATE_MODULE = 127 +pkg syscall (linux-386-cgo), const SYS_DELETE_MODULE = 129 +pkg syscall (linux-386-cgo), const SYS_DUP = 41 +pkg syscall (linux-386-cgo), const SYS_DUP2 = 63 +pkg syscall (linux-386-cgo), const SYS_DUP3 = 330 +pkg syscall (linux-386-cgo), const SYS_EPOLL_CREATE = 254 +pkg syscall (linux-386-cgo), const SYS_EPOLL_CREATE1 = 329 +pkg syscall (linux-386-cgo), const SYS_EPOLL_CTL = 255 +pkg syscall (linux-386-cgo), const SYS_EPOLL_PWAIT = 319 +pkg syscall (linux-386-cgo), const SYS_EPOLL_WAIT = 256 +pkg syscall (linux-386-cgo), const SYS_EVENTFD = 323 +pkg syscall (linux-386-cgo), const SYS_EVENTFD2 = 328 +pkg syscall (linux-386-cgo), const SYS_EXECVE = 11 +pkg syscall (linux-386-cgo), const SYS_EXIT = 1 +pkg syscall (linux-386-cgo), const SYS_EXIT_GROUP = 252 +pkg syscall (linux-386-cgo), const SYS_FACCESSAT = 307 +pkg syscall (linux-386-cgo), const SYS_FADVISE64 = 250 +pkg syscall (linux-386-cgo), const SYS_FADVISE64_64 = 272 +pkg syscall (linux-386-cgo), const SYS_FALLOCATE = 324 +pkg syscall (linux-386-cgo), const SYS_FANOTIFY_INIT = 338 +pkg syscall (linux-386-cgo), const SYS_FANOTIFY_MARK = 339 +pkg syscall (linux-386-cgo), const SYS_FCHDIR = 133 +pkg syscall (linux-386-cgo), const SYS_FCHMOD = 94 +pkg syscall (linux-386-cgo), const SYS_FCHMODAT = 306 +pkg syscall (linux-386-cgo), const SYS_FCHOWN = 95 +pkg syscall (linux-386-cgo), const SYS_FCHOWN32 = 207 +pkg syscall (linux-386-cgo), const SYS_FCHOWNAT = 298 +pkg syscall (linux-386-cgo), const SYS_FCNTL = 55 +pkg syscall (linux-386-cgo), const SYS_FCNTL64 = 221 +pkg syscall (linux-386-cgo), const SYS_FDATASYNC = 148 +pkg syscall (linux-386-cgo), const SYS_FGETXATTR = 231 +pkg syscall (linux-386-cgo), const SYS_FLISTXATTR = 234 +pkg syscall (linux-386-cgo), const SYS_FLOCK = 143 +pkg syscall (linux-386-cgo), const SYS_FORK = 2 +pkg syscall (linux-386-cgo), const SYS_FREMOVEXATTR = 237 +pkg syscall (linux-386-cgo), const SYS_FSETXATTR = 228 +pkg syscall (linux-386-cgo), const SYS_FSTAT = 108 +pkg syscall (linux-386-cgo), const SYS_FSTAT64 = 197 +pkg syscall (linux-386-cgo), const SYS_FSTATAT64 = 300 +pkg syscall (linux-386-cgo), const SYS_FSTATFS = 100 +pkg syscall (linux-386-cgo), const SYS_FSTATFS64 = 269 +pkg syscall (linux-386-cgo), const SYS_FSYNC = 118 +pkg syscall (linux-386-cgo), const SYS_FTIME = 35 +pkg syscall (linux-386-cgo), const SYS_FTRUNCATE = 93 +pkg syscall (linux-386-cgo), const SYS_FTRUNCATE64 = 194 +pkg syscall (linux-386-cgo), const SYS_FUTEX = 240 +pkg syscall (linux-386-cgo), const SYS_FUTIMESAT = 299 +pkg syscall (linux-386-cgo), const SYS_GETCPU = 318 +pkg syscall (linux-386-cgo), const SYS_GETCWD = 183 +pkg syscall (linux-386-cgo), const SYS_GETDENTS = 141 +pkg syscall (linux-386-cgo), const SYS_GETDENTS64 = 220 +pkg syscall (linux-386-cgo), const SYS_GETEGID = 50 +pkg syscall (linux-386-cgo), const SYS_GETEGID32 = 202 +pkg syscall (linux-386-cgo), const SYS_GETEUID = 49 +pkg syscall (linux-386-cgo), const SYS_GETEUID32 = 201 +pkg syscall (linux-386-cgo), const SYS_GETGID = 47 +pkg syscall (linux-386-cgo), const SYS_GETGID32 = 200 +pkg syscall (linux-386-cgo), const SYS_GETGROUPS = 80 +pkg syscall (linux-386-cgo), const SYS_GETGROUPS32 = 205 +pkg syscall (linux-386-cgo), const SYS_GETITIMER = 105 +pkg syscall (linux-386-cgo), const SYS_GETPGID = 132 +pkg syscall (linux-386-cgo), const SYS_GETPGRP = 65 +pkg syscall (linux-386-cgo), const SYS_GETPID = 20 +pkg syscall (linux-386-cgo), const SYS_GETPMSG = 188 +pkg syscall (linux-386-cgo), const SYS_GETPPID = 64 +pkg syscall (linux-386-cgo), const SYS_GETPRIORITY = 96 +pkg syscall (linux-386-cgo), const SYS_GETRESGID = 171 +pkg syscall (linux-386-cgo), const SYS_GETRESGID32 = 211 +pkg syscall (linux-386-cgo), const SYS_GETRESUID = 165 +pkg syscall (linux-386-cgo), const SYS_GETRESUID32 = 209 +pkg syscall (linux-386-cgo), const SYS_GETRLIMIT = 76 +pkg syscall (linux-386-cgo), const SYS_GETRUSAGE = 77 +pkg syscall (linux-386-cgo), const SYS_GETSID = 147 +pkg syscall (linux-386-cgo), const SYS_GETTID = 224 +pkg syscall (linux-386-cgo), const SYS_GETTIMEOFDAY = 78 +pkg syscall (linux-386-cgo), const SYS_GETUID = 24 +pkg syscall (linux-386-cgo), const SYS_GETUID32 = 199 +pkg syscall (linux-386-cgo), const SYS_GETXATTR = 229 +pkg syscall (linux-386-cgo), const SYS_GET_KERNEL_SYMS = 130 +pkg syscall (linux-386-cgo), const SYS_GET_MEMPOLICY = 275 +pkg syscall (linux-386-cgo), const SYS_GET_ROBUST_LIST = 312 +pkg syscall (linux-386-cgo), const SYS_GET_THREAD_AREA = 244 +pkg syscall (linux-386-cgo), const SYS_GTTY = 32 +pkg syscall (linux-386-cgo), const SYS_IDLE = 112 +pkg syscall (linux-386-cgo), const SYS_INIT_MODULE = 128 +pkg syscall (linux-386-cgo), const SYS_INOTIFY_ADD_WATCH = 292 +pkg syscall (linux-386-cgo), const SYS_INOTIFY_INIT = 291 +pkg syscall (linux-386-cgo), const SYS_INOTIFY_INIT1 = 332 +pkg syscall (linux-386-cgo), const SYS_INOTIFY_RM_WATCH = 293 +pkg syscall (linux-386-cgo), const SYS_IOCTL = 54 +pkg syscall (linux-386-cgo), const SYS_IOPERM = 101 +pkg syscall (linux-386-cgo), const SYS_IOPL = 110 +pkg syscall (linux-386-cgo), const SYS_IOPRIO_GET = 290 +pkg syscall (linux-386-cgo), const SYS_IOPRIO_SET = 289 +pkg syscall (linux-386-cgo), const SYS_IO_CANCEL = 249 +pkg syscall (linux-386-cgo), const SYS_IO_DESTROY = 246 +pkg syscall (linux-386-cgo), const SYS_IO_GETEVENTS = 247 +pkg syscall (linux-386-cgo), const SYS_IO_SETUP = 245 +pkg syscall (linux-386-cgo), const SYS_IO_SUBMIT = 248 +pkg syscall (linux-386-cgo), const SYS_IPC = 117 +pkg syscall (linux-386-cgo), const SYS_KEXEC_LOAD = 283 +pkg syscall (linux-386-cgo), const SYS_KEYCTL = 288 +pkg syscall (linux-386-cgo), const SYS_KILL = 37 +pkg syscall (linux-386-cgo), const SYS_LCHOWN = 16 +pkg syscall (linux-386-cgo), const SYS_LCHOWN32 = 198 +pkg syscall (linux-386-cgo), const SYS_LGETXATTR = 230 +pkg syscall (linux-386-cgo), const SYS_LINK = 9 +pkg syscall (linux-386-cgo), const SYS_LINKAT = 303 +pkg syscall (linux-386-cgo), const SYS_LISTXATTR = 232 +pkg syscall (linux-386-cgo), const SYS_LLISTXATTR = 233 +pkg syscall (linux-386-cgo), const SYS_LOCK = 53 +pkg syscall (linux-386-cgo), const SYS_LOOKUP_DCOOKIE = 253 +pkg syscall (linux-386-cgo), const SYS_LREMOVEXATTR = 236 +pkg syscall (linux-386-cgo), const SYS_LSEEK = 19 +pkg syscall (linux-386-cgo), const SYS_LSETXATTR = 227 +pkg syscall (linux-386-cgo), const SYS_LSTAT = 107 +pkg syscall (linux-386-cgo), const SYS_LSTAT64 = 196 +pkg syscall (linux-386-cgo), const SYS_MADVISE = 219 +pkg syscall (linux-386-cgo), const SYS_MADVISE1 = 219 +pkg syscall (linux-386-cgo), const SYS_MBIND = 274 +pkg syscall (linux-386-cgo), const SYS_MIGRATE_PAGES = 294 +pkg syscall (linux-386-cgo), const SYS_MINCORE = 218 +pkg syscall (linux-386-cgo), const SYS_MKDIR = 39 +pkg syscall (linux-386-cgo), const SYS_MKDIRAT = 296 +pkg syscall (linux-386-cgo), const SYS_MKNOD = 14 +pkg syscall (linux-386-cgo), const SYS_MKNODAT = 297 +pkg syscall (linux-386-cgo), const SYS_MLOCK = 150 +pkg syscall (linux-386-cgo), const SYS_MLOCKALL = 152 +pkg syscall (linux-386-cgo), const SYS_MMAP = 90 +pkg syscall (linux-386-cgo), const SYS_MMAP2 = 192 +pkg syscall (linux-386-cgo), const SYS_MODIFY_LDT = 123 +pkg syscall (linux-386-cgo), const SYS_MOUNT = 21 +pkg syscall (linux-386-cgo), const SYS_MOVE_PAGES = 317 +pkg syscall (linux-386-cgo), const SYS_MPROTECT = 125 +pkg syscall (linux-386-cgo), const SYS_MPX = 56 +pkg syscall (linux-386-cgo), const SYS_MQ_GETSETATTR = 282 +pkg syscall (linux-386-cgo), const SYS_MQ_NOTIFY = 281 +pkg syscall (linux-386-cgo), const SYS_MQ_OPEN = 277 +pkg syscall (linux-386-cgo), const SYS_MQ_TIMEDRECEIVE = 280 +pkg syscall (linux-386-cgo), const SYS_MQ_TIMEDSEND = 279 +pkg syscall (linux-386-cgo), const SYS_MQ_UNLINK = 278 +pkg syscall (linux-386-cgo), const SYS_MREMAP = 163 +pkg syscall (linux-386-cgo), const SYS_MSYNC = 144 +pkg syscall (linux-386-cgo), const SYS_MUNLOCK = 151 +pkg syscall (linux-386-cgo), const SYS_MUNLOCKALL = 153 +pkg syscall (linux-386-cgo), const SYS_MUNMAP = 91 +pkg syscall (linux-386-cgo), const SYS_NANOSLEEP = 162 +pkg syscall (linux-386-cgo), const SYS_NFSSERVCTL = 169 +pkg syscall (linux-386-cgo), const SYS_NICE = 34 +pkg syscall (linux-386-cgo), const SYS_OLDFSTAT = 28 +pkg syscall (linux-386-cgo), const SYS_OLDLSTAT = 84 +pkg syscall (linux-386-cgo), const SYS_OLDOLDUNAME = 59 +pkg syscall (linux-386-cgo), const SYS_OLDSTAT = 18 +pkg syscall (linux-386-cgo), const SYS_OLDUNAME = 109 +pkg syscall (linux-386-cgo), const SYS_OPEN = 5 +pkg syscall (linux-386-cgo), const SYS_OPENAT = 295 +pkg syscall (linux-386-cgo), const SYS_PAUSE = 29 +pkg syscall (linux-386-cgo), const SYS_PERF_EVENT_OPEN = 336 +pkg syscall (linux-386-cgo), const SYS_PERSONALITY = 136 +pkg syscall (linux-386-cgo), const SYS_PIPE = 42 +pkg syscall (linux-386-cgo), const SYS_PIPE2 = 331 +pkg syscall (linux-386-cgo), const SYS_PIVOT_ROOT = 217 +pkg syscall (linux-386-cgo), const SYS_POLL = 168 +pkg syscall (linux-386-cgo), const SYS_PPOLL = 309 +pkg syscall (linux-386-cgo), const SYS_PRCTL = 172 +pkg syscall (linux-386-cgo), const SYS_PREAD64 = 180 +pkg syscall (linux-386-cgo), const SYS_PREADV = 333 +pkg syscall (linux-386-cgo), const SYS_PRLIMIT64 = 340 +pkg syscall (linux-386-cgo), const SYS_PROF = 44 +pkg syscall (linux-386-cgo), const SYS_PROFIL = 98 +pkg syscall (linux-386-cgo), const SYS_PSELECT6 = 308 +pkg syscall (linux-386-cgo), const SYS_PTRACE = 26 +pkg syscall (linux-386-cgo), const SYS_PUTPMSG = 189 +pkg syscall (linux-386-cgo), const SYS_PWRITE64 = 181 +pkg syscall (linux-386-cgo), const SYS_PWRITEV = 334 +pkg syscall (linux-386-cgo), const SYS_QUERY_MODULE = 167 +pkg syscall (linux-386-cgo), const SYS_QUOTACTL = 131 +pkg syscall (linux-386-cgo), const SYS_READ = 3 +pkg syscall (linux-386-cgo), const SYS_READAHEAD = 225 +pkg syscall (linux-386-cgo), const SYS_READDIR = 89 +pkg syscall (linux-386-cgo), const SYS_READLINK = 85 +pkg syscall (linux-386-cgo), const SYS_READLINKAT = 305 +pkg syscall (linux-386-cgo), const SYS_READV = 145 +pkg syscall (linux-386-cgo), const SYS_REBOOT = 88 +pkg syscall (linux-386-cgo), const SYS_RECVMMSG = 337 +pkg syscall (linux-386-cgo), const SYS_REMAP_FILE_PAGES = 257 +pkg syscall (linux-386-cgo), const SYS_REMOVEXATTR = 235 +pkg syscall (linux-386-cgo), const SYS_RENAME = 38 +pkg syscall (linux-386-cgo), const SYS_RENAMEAT = 302 +pkg syscall (linux-386-cgo), const SYS_REQUEST_KEY = 287 +pkg syscall (linux-386-cgo), const SYS_RESTART_SYSCALL = 0 +pkg syscall (linux-386-cgo), const SYS_RMDIR = 40 +pkg syscall (linux-386-cgo), const SYS_RT_SIGACTION = 174 +pkg syscall (linux-386-cgo), const SYS_RT_SIGPENDING = 176 +pkg syscall (linux-386-cgo), const SYS_RT_SIGPROCMASK = 175 +pkg syscall (linux-386-cgo), const SYS_RT_SIGQUEUEINFO = 178 +pkg syscall (linux-386-cgo), const SYS_RT_SIGRETURN = 173 +pkg syscall (linux-386-cgo), const SYS_RT_SIGSUSPEND = 179 +pkg syscall (linux-386-cgo), const SYS_RT_SIGTIMEDWAIT = 177 +pkg syscall (linux-386-cgo), const SYS_RT_TGSIGQUEUEINFO = 335 +pkg syscall (linux-386-cgo), const SYS_SCHED_GETAFFINITY = 242 +pkg syscall (linux-386-cgo), const SYS_SCHED_GETPARAM = 155 +pkg syscall (linux-386-cgo), const SYS_SCHED_GETSCHEDULER = 157 +pkg syscall (linux-386-cgo), const SYS_SCHED_GET_PRIORITY_MAX = 159 +pkg syscall (linux-386-cgo), const SYS_SCHED_GET_PRIORITY_MIN = 160 +pkg syscall (linux-386-cgo), const SYS_SCHED_RR_GET_INTERVAL = 161 +pkg syscall (linux-386-cgo), const SYS_SCHED_SETAFFINITY = 241 +pkg syscall (linux-386-cgo), const SYS_SCHED_SETPARAM = 154 +pkg syscall (linux-386-cgo), const SYS_SCHED_SETSCHEDULER = 156 +pkg syscall (linux-386-cgo), const SYS_SCHED_YIELD = 158 +pkg syscall (linux-386-cgo), const SYS_SELECT = 82 +pkg syscall (linux-386-cgo), const SYS_SENDFILE = 187 +pkg syscall (linux-386-cgo), const SYS_SENDFILE64 = 239 +pkg syscall (linux-386-cgo), const SYS_SETDOMAINNAME = 121 +pkg syscall (linux-386-cgo), const SYS_SETFSGID = 139 +pkg syscall (linux-386-cgo), const SYS_SETFSGID32 = 216 +pkg syscall (linux-386-cgo), const SYS_SETFSUID = 138 +pkg syscall (linux-386-cgo), const SYS_SETFSUID32 = 215 +pkg syscall (linux-386-cgo), const SYS_SETGID = 46 +pkg syscall (linux-386-cgo), const SYS_SETGID32 = 214 +pkg syscall (linux-386-cgo), const SYS_SETGROUPS = 81 +pkg syscall (linux-386-cgo), const SYS_SETGROUPS32 = 206 +pkg syscall (linux-386-cgo), const SYS_SETHOSTNAME = 74 +pkg syscall (linux-386-cgo), const SYS_SETITIMER = 104 +pkg syscall (linux-386-cgo), const SYS_SETPGID = 57 +pkg syscall (linux-386-cgo), const SYS_SETPRIORITY = 97 +pkg syscall (linux-386-cgo), const SYS_SETREGID = 71 +pkg syscall (linux-386-cgo), const SYS_SETREGID32 = 204 +pkg syscall (linux-386-cgo), const SYS_SETRESGID = 170 +pkg syscall (linux-386-cgo), const SYS_SETRESGID32 = 210 +pkg syscall (linux-386-cgo), const SYS_SETRESUID = 164 +pkg syscall (linux-386-cgo), const SYS_SETRESUID32 = 208 +pkg syscall (linux-386-cgo), const SYS_SETREUID = 70 +pkg syscall (linux-386-cgo), const SYS_SETREUID32 = 203 +pkg syscall (linux-386-cgo), const SYS_SETRLIMIT = 75 +pkg syscall (linux-386-cgo), const SYS_SETSID = 66 +pkg syscall (linux-386-cgo), const SYS_SETTIMEOFDAY = 79 +pkg syscall (linux-386-cgo), const SYS_SETUID = 23 +pkg syscall (linux-386-cgo), const SYS_SETUID32 = 213 +pkg syscall (linux-386-cgo), const SYS_SETXATTR = 226 +pkg syscall (linux-386-cgo), const SYS_SET_MEMPOLICY = 276 +pkg syscall (linux-386-cgo), const SYS_SET_ROBUST_LIST = 311 +pkg syscall (linux-386-cgo), const SYS_SET_THREAD_AREA = 243 +pkg syscall (linux-386-cgo), const SYS_SET_TID_ADDRESS = 258 +pkg syscall (linux-386-cgo), const SYS_SGETMASK = 68 +pkg syscall (linux-386-cgo), const SYS_SIGACTION = 67 +pkg syscall (linux-386-cgo), const SYS_SIGALTSTACK = 186 +pkg syscall (linux-386-cgo), const SYS_SIGNAL = 48 +pkg syscall (linux-386-cgo), const SYS_SIGNALFD = 321 +pkg syscall (linux-386-cgo), const SYS_SIGNALFD4 = 327 +pkg syscall (linux-386-cgo), const SYS_SIGPENDING = 73 +pkg syscall (linux-386-cgo), const SYS_SIGPROCMASK = 126 +pkg syscall (linux-386-cgo), const SYS_SIGRETURN = 119 +pkg syscall (linux-386-cgo), const SYS_SIGSUSPEND = 72 +pkg syscall (linux-386-cgo), const SYS_SOCKETCALL = 102 +pkg syscall (linux-386-cgo), const SYS_SPLICE = 313 +pkg syscall (linux-386-cgo), const SYS_SSETMASK = 69 +pkg syscall (linux-386-cgo), const SYS_STAT = 106 +pkg syscall (linux-386-cgo), const SYS_STAT64 = 195 +pkg syscall (linux-386-cgo), const SYS_STATFS = 99 +pkg syscall (linux-386-cgo), const SYS_STATFS64 = 268 +pkg syscall (linux-386-cgo), const SYS_STIME = 25 +pkg syscall (linux-386-cgo), const SYS_STTY = 31 +pkg syscall (linux-386-cgo), const SYS_SWAPOFF = 115 +pkg syscall (linux-386-cgo), const SYS_SWAPON = 87 +pkg syscall (linux-386-cgo), const SYS_SYMLINK = 83 +pkg syscall (linux-386-cgo), const SYS_SYMLINKAT = 304 +pkg syscall (linux-386-cgo), const SYS_SYNC = 36 +pkg syscall (linux-386-cgo), const SYS_SYNC_FILE_RANGE = 314 +pkg syscall (linux-386-cgo), const SYS_SYSFS = 135 +pkg syscall (linux-386-cgo), const SYS_SYSINFO = 116 +pkg syscall (linux-386-cgo), const SYS_SYSLOG = 103 +pkg syscall (linux-386-cgo), const SYS_TEE = 315 +pkg syscall (linux-386-cgo), const SYS_TGKILL = 270 +pkg syscall (linux-386-cgo), const SYS_TIME = 13 +pkg syscall (linux-386-cgo), const SYS_TIMERFD_CREATE = 322 +pkg syscall (linux-386-cgo), const SYS_TIMERFD_GETTIME = 326 +pkg syscall (linux-386-cgo), const SYS_TIMERFD_SETTIME = 325 +pkg syscall (linux-386-cgo), const SYS_TIMER_CREATE = 259 +pkg syscall (linux-386-cgo), const SYS_TIMER_DELETE = 263 +pkg syscall (linux-386-cgo), const SYS_TIMER_GETOVERRUN = 262 +pkg syscall (linux-386-cgo), const SYS_TIMER_GETTIME = 261 +pkg syscall (linux-386-cgo), const SYS_TIMER_SETTIME = 260 +pkg syscall (linux-386-cgo), const SYS_TIMES = 43 +pkg syscall (linux-386-cgo), const SYS_TKILL = 238 +pkg syscall (linux-386-cgo), const SYS_TRUNCATE = 92 +pkg syscall (linux-386-cgo), const SYS_TRUNCATE64 = 193 +pkg syscall (linux-386-cgo), const SYS_UGETRLIMIT = 191 +pkg syscall (linux-386-cgo), const SYS_ULIMIT = 58 +pkg syscall (linux-386-cgo), const SYS_UMASK = 60 +pkg syscall (linux-386-cgo), const SYS_UMOUNT = 22 +pkg syscall (linux-386-cgo), const SYS_UMOUNT2 = 52 +pkg syscall (linux-386-cgo), const SYS_UNAME = 122 +pkg syscall (linux-386-cgo), const SYS_UNLINK = 10 +pkg syscall (linux-386-cgo), const SYS_UNLINKAT = 301 +pkg syscall (linux-386-cgo), const SYS_UNSHARE = 310 +pkg syscall (linux-386-cgo), const SYS_USELIB = 86 +pkg syscall (linux-386-cgo), const SYS_USTAT = 62 +pkg syscall (linux-386-cgo), const SYS_UTIME = 30 +pkg syscall (linux-386-cgo), const SYS_UTIMENSAT = 320 +pkg syscall (linux-386-cgo), const SYS_UTIMES = 271 +pkg syscall (linux-386-cgo), const SYS_VFORK = 190 +pkg syscall (linux-386-cgo), const SYS_VHANGUP = 111 +pkg syscall (linux-386-cgo), const SYS_VM86 = 166 +pkg syscall (linux-386-cgo), const SYS_VM86OLD = 113 +pkg syscall (linux-386-cgo), const SYS_VMSPLICE = 316 +pkg syscall (linux-386-cgo), const SYS_VSERVER = 273 +pkg syscall (linux-386-cgo), const SYS_WAIT4 = 114 +pkg syscall (linux-386-cgo), const SYS_WAITID = 284 +pkg syscall (linux-386-cgo), const SYS_WAITPID = 7 +pkg syscall (linux-386-cgo), const SYS_WRITE = 4 +pkg syscall (linux-386-cgo), const SYS_WRITEV = 146 +pkg syscall (linux-386-cgo), const SYS__LLSEEK = 140 +pkg syscall (linux-386-cgo), const SYS__NEWSELECT = 142 +pkg syscall (linux-386-cgo), const SYS__SYSCTL = 149 +pkg syscall (linux-386-cgo), const S_BLKSIZE = 512 +pkg syscall (linux-386-cgo), const S_IEXEC = 64 +pkg syscall (linux-386-cgo), const S_IFMT = 61440 +pkg syscall (linux-386-cgo), const S_IREAD = 256 +pkg syscall (linux-386-cgo), const S_IRGRP = 32 +pkg syscall (linux-386-cgo), const S_IROTH = 4 +pkg syscall (linux-386-cgo), const S_IRWXG = 56 +pkg syscall (linux-386-cgo), const S_IRWXO = 7 +pkg syscall (linux-386-cgo), const S_IRWXU = 448 +pkg syscall (linux-386-cgo), const S_IWGRP = 16 +pkg syscall (linux-386-cgo), const S_IWOTH = 2 +pkg syscall (linux-386-cgo), const S_IWRITE = 128 +pkg syscall (linux-386-cgo), const S_IXGRP = 8 +pkg syscall (linux-386-cgo), const S_IXOTH = 1 +pkg syscall (linux-386-cgo), const SizeofCmsghdr = 12 +pkg syscall (linux-386-cgo), const SizeofIPMreq = 8 +pkg syscall (linux-386-cgo), const SizeofIPMreqn = 12 +pkg syscall (linux-386-cgo), const SizeofIPv6Mreq = 20 +pkg syscall (linux-386-cgo), const SizeofIfAddrmsg = 8 +pkg syscall (linux-386-cgo), const SizeofIfInfomsg = 16 +pkg syscall (linux-386-cgo), const SizeofInet4Pktinfo = 12 +pkg syscall (linux-386-cgo), const SizeofInet6Pktinfo = 20 +pkg syscall (linux-386-cgo), const SizeofInotifyEvent = 16 +pkg syscall (linux-386-cgo), const SizeofLinger = 8 +pkg syscall (linux-386-cgo), const SizeofMsghdr = 28 +pkg syscall (linux-386-cgo), const SizeofNlAttr = 4 +pkg syscall (linux-386-cgo), const SizeofNlMsgerr = 20 +pkg syscall (linux-386-cgo), const SizeofNlMsghdr = 16 +pkg syscall (linux-386-cgo), const SizeofRtAttr = 4 +pkg syscall (linux-386-cgo), const SizeofRtGenmsg = 1 +pkg syscall (linux-386-cgo), const SizeofRtMsg = 12 +pkg syscall (linux-386-cgo), const SizeofRtNexthop = 8 +pkg syscall (linux-386-cgo), const SizeofSockFilter = 8 +pkg syscall (linux-386-cgo), const SizeofSockFprog = 8 +pkg syscall (linux-386-cgo), const SizeofSockaddrAny = 112 +pkg syscall (linux-386-cgo), const SizeofSockaddrInet4 = 16 +pkg syscall (linux-386-cgo), const SizeofSockaddrInet6 = 28 +pkg syscall (linux-386-cgo), const SizeofSockaddrLinklayer = 20 +pkg syscall (linux-386-cgo), const SizeofSockaddrNetlink = 12 +pkg syscall (linux-386-cgo), const SizeofSockaddrUnix = 110 +pkg syscall (linux-386-cgo), const SizeofTCPInfo = 104 +pkg syscall (linux-386-cgo), const SizeofTCPInfo ideal-int +pkg syscall (linux-386-cgo), const SizeofUcred = 12 +pkg syscall (linux-386-cgo), const TCGETS = 21505 +pkg syscall (linux-386-cgo), const TCP_CONGESTION = 13 +pkg syscall (linux-386-cgo), const TCP_CORK = 3 +pkg syscall (linux-386-cgo), const TCP_DEFER_ACCEPT = 9 +pkg syscall (linux-386-cgo), const TCP_INFO = 11 +pkg syscall (linux-386-cgo), const TCP_KEEPCNT = 6 +pkg syscall (linux-386-cgo), const TCP_KEEPIDLE = 4 +pkg syscall (linux-386-cgo), const TCP_KEEPINTVL = 5 +pkg syscall (linux-386-cgo), const TCP_LINGER2 = 8 +pkg syscall (linux-386-cgo), const TCP_MAXSEG = 2 +pkg syscall (linux-386-cgo), const TCP_MAXWIN = 65535 +pkg syscall (linux-386-cgo), const TCP_MAX_WINSHIFT = 14 +pkg syscall (linux-386-cgo), const TCP_MD5SIG = 14 +pkg syscall (linux-386-cgo), const TCP_MD5SIG_MAXKEYLEN = 80 +pkg syscall (linux-386-cgo), const TCP_MSS = 512 +pkg syscall (linux-386-cgo), const TCP_QUICKACK = 12 +pkg syscall (linux-386-cgo), const TCP_SYNCNT = 7 +pkg syscall (linux-386-cgo), const TCP_WINDOW_CLAMP = 10 +pkg syscall (linux-386-cgo), const TCSETS = 21506 +pkg syscall (linux-386-cgo), const TIOCCBRK = 21544 +pkg syscall (linux-386-cgo), const TIOCCONS = 21533 +pkg syscall (linux-386-cgo), const TIOCEXCL = 21516 +pkg syscall (linux-386-cgo), const TIOCGDEV = 2147767346 +pkg syscall (linux-386-cgo), const TIOCGETD = 21540 +pkg syscall (linux-386-cgo), const TIOCGICOUNT = 21597 +pkg syscall (linux-386-cgo), const TIOCGLCKTRMIOS = 21590 +pkg syscall (linux-386-cgo), const TIOCGPGRP = 21519 +pkg syscall (linux-386-cgo), const TIOCGPTN = 2147767344 +pkg syscall (linux-386-cgo), const TIOCGRS485 = 21550 +pkg syscall (linux-386-cgo), const TIOCGSERIAL = 21534 +pkg syscall (linux-386-cgo), const TIOCGSID = 21545 +pkg syscall (linux-386-cgo), const TIOCGSOFTCAR = 21529 +pkg syscall (linux-386-cgo), const TIOCGWINSZ = 21523 +pkg syscall (linux-386-cgo), const TIOCINQ = 21531 +pkg syscall (linux-386-cgo), const TIOCLINUX = 21532 +pkg syscall (linux-386-cgo), const TIOCMBIC = 21527 +pkg syscall (linux-386-cgo), const TIOCMBIS = 21526 +pkg syscall (linux-386-cgo), const TIOCMGET = 21525 +pkg syscall (linux-386-cgo), const TIOCMIWAIT = 21596 +pkg syscall (linux-386-cgo), const TIOCMSET = 21528 +pkg syscall (linux-386-cgo), const TIOCM_CAR = 64 +pkg syscall (linux-386-cgo), const TIOCM_CD = 64 +pkg syscall (linux-386-cgo), const TIOCM_CTS = 32 +pkg syscall (linux-386-cgo), const TIOCM_DSR = 256 +pkg syscall (linux-386-cgo), const TIOCM_DTR = 2 +pkg syscall (linux-386-cgo), const TIOCM_LE = 1 +pkg syscall (linux-386-cgo), const TIOCM_RI = 128 +pkg syscall (linux-386-cgo), const TIOCM_RNG = 128 +pkg syscall (linux-386-cgo), const TIOCM_RTS = 4 +pkg syscall (linux-386-cgo), const TIOCM_SR = 16 +pkg syscall (linux-386-cgo), const TIOCM_ST = 8 +pkg syscall (linux-386-cgo), const TIOCNOTTY = 21538 +pkg syscall (linux-386-cgo), const TIOCNXCL = 21517 +pkg syscall (linux-386-cgo), const TIOCOUTQ = 21521 +pkg syscall (linux-386-cgo), const TIOCPKT = 21536 +pkg syscall (linux-386-cgo), const TIOCPKT_DATA = 0 +pkg syscall (linux-386-cgo), const TIOCPKT_DOSTOP = 32 +pkg syscall (linux-386-cgo), const TIOCPKT_FLUSHREAD = 1 +pkg syscall (linux-386-cgo), const TIOCPKT_FLUSHWRITE = 2 +pkg syscall (linux-386-cgo), const TIOCPKT_IOCTL = 64 +pkg syscall (linux-386-cgo), const TIOCPKT_NOSTOP = 16 +pkg syscall (linux-386-cgo), const TIOCPKT_START = 8 +pkg syscall (linux-386-cgo), const TIOCPKT_STOP = 4 +pkg syscall (linux-386-cgo), const TIOCSBRK = 21543 +pkg syscall (linux-386-cgo), const TIOCSCTTY = 21518 +pkg syscall (linux-386-cgo), const TIOCSERCONFIG = 21587 +pkg syscall (linux-386-cgo), const TIOCSERGETLSR = 21593 +pkg syscall (linux-386-cgo), const TIOCSERGETMULTI = 21594 +pkg syscall (linux-386-cgo), const TIOCSERGSTRUCT = 21592 +pkg syscall (linux-386-cgo), const TIOCSERGWILD = 21588 +pkg syscall (linux-386-cgo), const TIOCSERSETMULTI = 21595 +pkg syscall (linux-386-cgo), const TIOCSERSWILD = 21589 +pkg syscall (linux-386-cgo), const TIOCSER_TEMT = 1 +pkg syscall (linux-386-cgo), const TIOCSETD = 21539 +pkg syscall (linux-386-cgo), const TIOCSIG = 1074025526 +pkg syscall (linux-386-cgo), const TIOCSLCKTRMIOS = 21591 +pkg syscall (linux-386-cgo), const TIOCSPGRP = 21520 +pkg syscall (linux-386-cgo), const TIOCSPTLCK = 1074025521 +pkg syscall (linux-386-cgo), const TIOCSRS485 = 21551 +pkg syscall (linux-386-cgo), const TIOCSSERIAL = 21535 +pkg syscall (linux-386-cgo), const TIOCSSOFTCAR = 21530 +pkg syscall (linux-386-cgo), const TIOCSTI = 21522 +pkg syscall (linux-386-cgo), const TIOCSWINSZ = 21524 +pkg syscall (linux-386-cgo), const TOSTOP = 256 +pkg syscall (linux-386-cgo), const TUNATTACHFILTER = 1074287829 +pkg syscall (linux-386-cgo), const TUNDETACHFILTER = 1074287830 +pkg syscall (linux-386-cgo), const TUNGETFEATURES = 2147767503 +pkg syscall (linux-386-cgo), const TUNGETIFF = 2147767506 +pkg syscall (linux-386-cgo), const TUNGETSNDBUF = 2147767507 +pkg syscall (linux-386-cgo), const TUNGETVNETHDRSZ = 2147767511 +pkg syscall (linux-386-cgo), const TUNSETDEBUG = 1074025673 +pkg syscall (linux-386-cgo), const TUNSETGROUP = 1074025678 +pkg syscall (linux-386-cgo), const TUNSETIFF = 1074025674 +pkg syscall (linux-386-cgo), const TUNSETLINK = 1074025677 +pkg syscall (linux-386-cgo), const TUNSETNOCSUM = 1074025672 +pkg syscall (linux-386-cgo), const TUNSETOFFLOAD = 1074025680 +pkg syscall (linux-386-cgo), const TUNSETOWNER = 1074025676 +pkg syscall (linux-386-cgo), const TUNSETPERSIST = 1074025675 +pkg syscall (linux-386-cgo), const TUNSETSNDBUF = 1074025684 +pkg syscall (linux-386-cgo), const TUNSETTXFILTER = 1074025681 +pkg syscall (linux-386-cgo), const TUNSETVNETHDRSZ = 1074025688 +pkg syscall (linux-386-cgo), const VDISCARD = 13 +pkg syscall (linux-386-cgo), const VEOF = 4 +pkg syscall (linux-386-cgo), const VEOL = 11 +pkg syscall (linux-386-cgo), const VEOL2 = 16 +pkg syscall (linux-386-cgo), const VERASE = 2 +pkg syscall (linux-386-cgo), const VINTR = 0 +pkg syscall (linux-386-cgo), const VKILL = 3 +pkg syscall (linux-386-cgo), const VLNEXT = 15 +pkg syscall (linux-386-cgo), const VMIN = 6 +pkg syscall (linux-386-cgo), const VQUIT = 1 +pkg syscall (linux-386-cgo), const VREPRINT = 12 +pkg syscall (linux-386-cgo), const VSTART = 8 +pkg syscall (linux-386-cgo), const VSTOP = 9 +pkg syscall (linux-386-cgo), const VSUSP = 10 +pkg syscall (linux-386-cgo), const VSWTC = 7 +pkg syscall (linux-386-cgo), const VTIME = 5 +pkg syscall (linux-386-cgo), const VWERASE = 14 +pkg syscall (linux-386-cgo), const WALL = 1073741824 +pkg syscall (linux-386-cgo), const WCLONE = 2147483648 +pkg syscall (linux-386-cgo), const WCONTINUED = 8 +pkg syscall (linux-386-cgo), const WEXITED = 4 +pkg syscall (linux-386-cgo), const WNOHANG = 1 +pkg syscall (linux-386-cgo), const WNOTHREAD = 536870912 +pkg syscall (linux-386-cgo), const WNOWAIT = 16777216 +pkg syscall (linux-386-cgo), const WORDSIZE = 32 +pkg syscall (linux-386-cgo), const WSTOPPED = 2 +pkg syscall (linux-386-cgo), const WUNTRACED = 2 +pkg syscall (linux-386-cgo), const XCASE = 4 +pkg syscall (linux-386-cgo), func Accept4(int, int) (int, Sockaddr, error) +pkg syscall (linux-386-cgo), func GetsockoptUcred(int, int, int) (*Ucred, error) +pkg syscall (linux-386-cgo), func Getxattr(string, string, []uint8) (int, error) +pkg syscall (linux-386-cgo), func Listxattr(string, []uint8) (int, error) +pkg syscall (linux-386-cgo), func Pipe2([]int, int) error +pkg syscall (linux-386-cgo), func PtraceSyscall(int, int) error +pkg syscall (linux-386-cgo), func Removexattr(string, string) error +pkg syscall (linux-386-cgo), func Setxattr(string, string, []uint8, int) error +pkg syscall (linux-386-cgo), func SlicePtrFromStrings([]string) ([]*uint8, error) +pkg syscall (linux-386-cgo), type SysProcAttr struct, Ctty int +pkg syscall (linux-386-cgo), type TCPInfo struct +pkg syscall (linux-386-cgo), type TCPInfo struct, Advmss uint32 +pkg syscall (linux-386-cgo), type TCPInfo struct, Ato uint32 +pkg syscall (linux-386-cgo), type TCPInfo struct, Backoff uint8 +pkg syscall (linux-386-cgo), type TCPInfo struct, Ca_state uint8 +pkg syscall (linux-386-cgo), type TCPInfo struct, Fackets uint32 +pkg syscall (linux-386-cgo), type TCPInfo struct, Last_ack_recv uint32 +pkg syscall (linux-386-cgo), type TCPInfo struct, Last_ack_sent uint32 +pkg syscall (linux-386-cgo), type TCPInfo struct, Last_data_recv uint32 +pkg syscall (linux-386-cgo), type TCPInfo struct, Last_data_sent uint32 +pkg syscall (linux-386-cgo), type TCPInfo struct, Lost uint32 +pkg syscall (linux-386-cgo), type TCPInfo struct, Options uint8 +pkg syscall (linux-386-cgo), type TCPInfo struct, Pad_cgo_0 [2]uint8 +pkg syscall (linux-386-cgo), type TCPInfo struct, Pmtu uint32 +pkg syscall (linux-386-cgo), type TCPInfo struct, Probes uint8 +pkg syscall (linux-386-cgo), type TCPInfo struct, Rcv_mss uint32 +pkg syscall (linux-386-cgo), type TCPInfo struct, Rcv_rtt uint32 +pkg syscall (linux-386-cgo), type TCPInfo struct, Rcv_space uint32 +pkg syscall (linux-386-cgo), type TCPInfo struct, Rcv_ssthresh uint32 +pkg syscall (linux-386-cgo), type TCPInfo struct, Reordering uint32 +pkg syscall (linux-386-cgo), type TCPInfo struct, Retrans uint32 +pkg syscall (linux-386-cgo), type TCPInfo struct, Retransmits uint8 +pkg syscall (linux-386-cgo), type TCPInfo struct, Rto uint32 +pkg syscall (linux-386-cgo), type TCPInfo struct, Rtt uint32 +pkg syscall (linux-386-cgo), type TCPInfo struct, Rttvar uint32 +pkg syscall (linux-386-cgo), type TCPInfo struct, Sacked uint32 +pkg syscall (linux-386-cgo), type TCPInfo struct, Snd_cwnd uint32 +pkg syscall (linux-386-cgo), type TCPInfo struct, Snd_mss uint32 +pkg syscall (linux-386-cgo), type TCPInfo struct, Snd_ssthresh uint32 +pkg syscall (linux-386-cgo), type TCPInfo struct, State uint8 +pkg syscall (linux-386-cgo), type TCPInfo struct, Total_retrans uint32 +pkg syscall (linux-386-cgo), type TCPInfo struct, Unacked uint32 +pkg syscall (linux-amd64), const AF_ALG = 38 +pkg syscall (linux-amd64), const AF_APPLETALK = 5 +pkg syscall (linux-amd64), const AF_ASH = 18 +pkg syscall (linux-amd64), const AF_ATMPVC = 8 +pkg syscall (linux-amd64), const AF_ATMSVC = 20 +pkg syscall (linux-amd64), const AF_AX25 = 3 +pkg syscall (linux-amd64), const AF_BLUETOOTH = 31 +pkg syscall (linux-amd64), const AF_BRIDGE = 7 +pkg syscall (linux-amd64), const AF_CAIF = 37 +pkg syscall (linux-amd64), const AF_CAN = 29 +pkg syscall (linux-amd64), const AF_DECnet = 12 +pkg syscall (linux-amd64), const AF_ECONET = 19 +pkg syscall (linux-amd64), const AF_FILE = 1 +pkg syscall (linux-amd64), const AF_IEEE802154 = 36 +pkg syscall (linux-amd64), const AF_INET6 = 10 +pkg syscall (linux-amd64), const AF_IPX = 4 +pkg syscall (linux-amd64), const AF_IRDA = 23 +pkg syscall (linux-amd64), const AF_ISDN = 34 +pkg syscall (linux-amd64), const AF_IUCV = 32 +pkg syscall (linux-amd64), const AF_KEY = 15 +pkg syscall (linux-amd64), const AF_LLC = 26 +pkg syscall (linux-amd64), const AF_LOCAL = 1 +pkg syscall (linux-amd64), const AF_MAX = 39 +pkg syscall (linux-amd64), const AF_NETBEUI = 13 +pkg syscall (linux-amd64), const AF_NETLINK = 16 +pkg syscall (linux-amd64), const AF_NETROM = 6 +pkg syscall (linux-amd64), const AF_PACKET = 17 +pkg syscall (linux-amd64), const AF_PHONET = 35 +pkg syscall (linux-amd64), const AF_PPPOX = 24 +pkg syscall (linux-amd64), const AF_RDS = 21 +pkg syscall (linux-amd64), const AF_ROSE = 11 +pkg syscall (linux-amd64), const AF_ROUTE = 16 +pkg syscall (linux-amd64), const AF_RXRPC = 33 +pkg syscall (linux-amd64), const AF_SECURITY = 14 +pkg syscall (linux-amd64), const AF_SNA = 22 +pkg syscall (linux-amd64), const AF_TIPC = 30 +pkg syscall (linux-amd64), const AF_WANPIPE = 25 +pkg syscall (linux-amd64), const AF_X25 = 9 +pkg syscall (linux-amd64), const ARPHRD_ADAPT = 264 +pkg syscall (linux-amd64), const ARPHRD_APPLETLK = 8 +pkg syscall (linux-amd64), const ARPHRD_ARCNET = 7 +pkg syscall (linux-amd64), const ARPHRD_ASH = 781 +pkg syscall (linux-amd64), const ARPHRD_ATM = 19 +pkg syscall (linux-amd64), const ARPHRD_AX25 = 3 +pkg syscall (linux-amd64), const ARPHRD_BIF = 775 +pkg syscall (linux-amd64), const ARPHRD_CHAOS = 5 +pkg syscall (linux-amd64), const ARPHRD_CISCO = 513 +pkg syscall (linux-amd64), const ARPHRD_CSLIP = 257 +pkg syscall (linux-amd64), const ARPHRD_CSLIP6 = 259 +pkg syscall (linux-amd64), const ARPHRD_DDCMP = 517 +pkg syscall (linux-amd64), const ARPHRD_DLCI = 15 +pkg syscall (linux-amd64), const ARPHRD_ECONET = 782 +pkg syscall (linux-amd64), const ARPHRD_EETHER = 2 +pkg syscall (linux-amd64), const ARPHRD_ETHER = 1 +pkg syscall (linux-amd64), const ARPHRD_EUI64 = 27 +pkg syscall (linux-amd64), const ARPHRD_FCAL = 785 +pkg syscall (linux-amd64), const ARPHRD_FCFABRIC = 787 +pkg syscall (linux-amd64), const ARPHRD_FCPL = 786 +pkg syscall (linux-amd64), const ARPHRD_FCPP = 784 +pkg syscall (linux-amd64), const ARPHRD_FDDI = 774 +pkg syscall (linux-amd64), const ARPHRD_FRAD = 770 +pkg syscall (linux-amd64), const ARPHRD_HDLC = 513 +pkg syscall (linux-amd64), const ARPHRD_HIPPI = 780 +pkg syscall (linux-amd64), const ARPHRD_HWX25 = 272 +pkg syscall (linux-amd64), const ARPHRD_IEEE1394 = 24 +pkg syscall (linux-amd64), const ARPHRD_IEEE802 = 6 +pkg syscall (linux-amd64), const ARPHRD_IEEE80211 = 801 +pkg syscall (linux-amd64), const ARPHRD_IEEE80211_PRISM = 802 +pkg syscall (linux-amd64), const ARPHRD_IEEE80211_RADIOTAP = 803 +pkg syscall (linux-amd64), const ARPHRD_IEEE802154 = 804 +pkg syscall (linux-amd64), const ARPHRD_IEEE802154_PHY = 805 +pkg syscall (linux-amd64), const ARPHRD_IEEE802_TR = 800 +pkg syscall (linux-amd64), const ARPHRD_INFINIBAND = 32 +pkg syscall (linux-amd64), const ARPHRD_IPDDP = 777 +pkg syscall (linux-amd64), const ARPHRD_IPGRE = 778 +pkg syscall (linux-amd64), const ARPHRD_IRDA = 783 +pkg syscall (linux-amd64), const ARPHRD_LAPB = 516 +pkg syscall (linux-amd64), const ARPHRD_LOCALTLK = 773 +pkg syscall (linux-amd64), const ARPHRD_LOOPBACK = 772 +pkg syscall (linux-amd64), const ARPHRD_METRICOM = 23 +pkg syscall (linux-amd64), const ARPHRD_NETROM = 0 +pkg syscall (linux-amd64), const ARPHRD_NONE = 65534 +pkg syscall (linux-amd64), const ARPHRD_PIMREG = 779 +pkg syscall (linux-amd64), const ARPHRD_PPP = 512 +pkg syscall (linux-amd64), const ARPHRD_PRONET = 4 +pkg syscall (linux-amd64), const ARPHRD_RAWHDLC = 518 +pkg syscall (linux-amd64), const ARPHRD_ROSE = 270 +pkg syscall (linux-amd64), const ARPHRD_RSRVD = 260 +pkg syscall (linux-amd64), const ARPHRD_SIT = 776 +pkg syscall (linux-amd64), const ARPHRD_SKIP = 771 +pkg syscall (linux-amd64), const ARPHRD_SLIP = 256 +pkg syscall (linux-amd64), const ARPHRD_SLIP6 = 258 +pkg syscall (linux-amd64), const ARPHRD_TUNNEL = 768 +pkg syscall (linux-amd64), const ARPHRD_TUNNEL6 = 769 +pkg syscall (linux-amd64), const ARPHRD_VOID = 65535 +pkg syscall (linux-amd64), const ARPHRD_X25 = 271 +pkg syscall (linux-amd64), const B0 = 0 +pkg syscall (linux-amd64), const B1000000 = 4104 +pkg syscall (linux-amd64), const B110 = 3 +pkg syscall (linux-amd64), const B115200 = 4098 +pkg syscall (linux-amd64), const B1152000 = 4105 +pkg syscall (linux-amd64), const B1200 = 9 +pkg syscall (linux-amd64), const B134 = 4 +pkg syscall (linux-amd64), const B150 = 5 +pkg syscall (linux-amd64), const B1500000 = 4106 +pkg syscall (linux-amd64), const B1800 = 10 +pkg syscall (linux-amd64), const B19200 = 14 +pkg syscall (linux-amd64), const B200 = 6 +pkg syscall (linux-amd64), const B2000000 = 4107 +pkg syscall (linux-amd64), const B230400 = 4099 +pkg syscall (linux-amd64), const B2400 = 11 +pkg syscall (linux-amd64), const B2500000 = 4108 +pkg syscall (linux-amd64), const B300 = 7 +pkg syscall (linux-amd64), const B3000000 = 4109 +pkg syscall (linux-amd64), const B3500000 = 4110 +pkg syscall (linux-amd64), const B38400 = 15 +pkg syscall (linux-amd64), const B4000000 = 4111 +pkg syscall (linux-amd64), const B460800 = 4100 +pkg syscall (linux-amd64), const B4800 = 12 +pkg syscall (linux-amd64), const B50 = 1 +pkg syscall (linux-amd64), const B500000 = 4101 +pkg syscall (linux-amd64), const B57600 = 4097 +pkg syscall (linux-amd64), const B576000 = 4102 +pkg syscall (linux-amd64), const B600 = 8 +pkg syscall (linux-amd64), const B75 = 2 +pkg syscall (linux-amd64), const B921600 = 4103 +pkg syscall (linux-amd64), const B9600 = 13 +pkg syscall (linux-amd64), const BPF_A = 16 +pkg syscall (linux-amd64), const BPF_ABS = 32 +pkg syscall (linux-amd64), const BPF_ADD = 0 +pkg syscall (linux-amd64), const BPF_ALU = 4 +pkg syscall (linux-amd64), const BPF_AND = 80 +pkg syscall (linux-amd64), const BPF_B = 16 +pkg syscall (linux-amd64), const BPF_DIV = 48 +pkg syscall (linux-amd64), const BPF_H = 8 +pkg syscall (linux-amd64), const BPF_IMM = 0 +pkg syscall (linux-amd64), const BPF_IND = 64 +pkg syscall (linux-amd64), const BPF_JA = 0 +pkg syscall (linux-amd64), const BPF_JEQ = 16 +pkg syscall (linux-amd64), const BPF_JGE = 48 +pkg syscall (linux-amd64), const BPF_JGT = 32 +pkg syscall (linux-amd64), const BPF_JMP = 5 +pkg syscall (linux-amd64), const BPF_JSET = 64 +pkg syscall (linux-amd64), const BPF_K = 0 +pkg syscall (linux-amd64), const BPF_LD = 0 +pkg syscall (linux-amd64), const BPF_LDX = 1 +pkg syscall (linux-amd64), const BPF_LEN = 128 +pkg syscall (linux-amd64), const BPF_LSH = 96 +pkg syscall (linux-amd64), const BPF_MAJOR_VERSION = 1 +pkg syscall (linux-amd64), const BPF_MAXINSNS = 4096 +pkg syscall (linux-amd64), const BPF_MEM = 96 +pkg syscall (linux-amd64), const BPF_MEMWORDS = 16 +pkg syscall (linux-amd64), const BPF_MINOR_VERSION = 1 +pkg syscall (linux-amd64), const BPF_MISC = 7 +pkg syscall (linux-amd64), const BPF_MSH = 160 +pkg syscall (linux-amd64), const BPF_MUL = 32 +pkg syscall (linux-amd64), const BPF_NEG = 128 +pkg syscall (linux-amd64), const BPF_OR = 64 +pkg syscall (linux-amd64), const BPF_RET = 6 +pkg syscall (linux-amd64), const BPF_RSH = 112 +pkg syscall (linux-amd64), const BPF_ST = 2 +pkg syscall (linux-amd64), const BPF_STX = 3 +pkg syscall (linux-amd64), const BPF_SUB = 16 +pkg syscall (linux-amd64), const BPF_TAX = 0 +pkg syscall (linux-amd64), const BPF_TXA = 128 +pkg syscall (linux-amd64), const BPF_W = 0 +pkg syscall (linux-amd64), const BPF_X = 8 +pkg syscall (linux-amd64), const BRKINT = 2 +pkg syscall (linux-amd64), const CLOCAL = 2048 +pkg syscall (linux-amd64), const CREAD = 128 +pkg syscall (linux-amd64), const CS5 = 0 +pkg syscall (linux-amd64), const CS6 = 16 +pkg syscall (linux-amd64), const CS7 = 32 +pkg syscall (linux-amd64), const CS8 = 48 +pkg syscall (linux-amd64), const CSIZE = 48 +pkg syscall (linux-amd64), const CSTOPB = 64 +pkg syscall (linux-amd64), const DT_BLK = 6 +pkg syscall (linux-amd64), const DT_CHR = 2 +pkg syscall (linux-amd64), const DT_DIR = 4 +pkg syscall (linux-amd64), const DT_FIFO = 1 +pkg syscall (linux-amd64), const DT_LNK = 10 +pkg syscall (linux-amd64), const DT_REG = 8 +pkg syscall (linux-amd64), const DT_SOCK = 12 +pkg syscall (linux-amd64), const DT_UNKNOWN = 0 +pkg syscall (linux-amd64), const DT_WHT = 14 +pkg syscall (linux-amd64), const E2BIG = 7 +pkg syscall (linux-amd64), const EACCES = 13 +pkg syscall (linux-amd64), const EADDRINUSE = 98 +pkg syscall (linux-amd64), const EADDRNOTAVAIL = 99 +pkg syscall (linux-amd64), const EADV = 68 +pkg syscall (linux-amd64), const EAFNOSUPPORT = 97 +pkg syscall (linux-amd64), const EAGAIN = 11 +pkg syscall (linux-amd64), const EALREADY = 114 +pkg syscall (linux-amd64), const EBADE = 52 +pkg syscall (linux-amd64), const EBADF = 9 +pkg syscall (linux-amd64), const EBADFD = 77 +pkg syscall (linux-amd64), const EBADMSG = 74 +pkg syscall (linux-amd64), const EBADR = 53 +pkg syscall (linux-amd64), const EBADRQC = 56 +pkg syscall (linux-amd64), const EBADSLT = 57 +pkg syscall (linux-amd64), const EBFONT = 59 +pkg syscall (linux-amd64), const EBUSY = 16 +pkg syscall (linux-amd64), const ECANCELED = 125 +pkg syscall (linux-amd64), const ECHILD = 10 +pkg syscall (linux-amd64), const ECHO = 8 +pkg syscall (linux-amd64), const ECHOCTL = 512 +pkg syscall (linux-amd64), const ECHOE = 16 +pkg syscall (linux-amd64), const ECHOK = 32 +pkg syscall (linux-amd64), const ECHOKE = 2048 +pkg syscall (linux-amd64), const ECHONL = 64 +pkg syscall (linux-amd64), const ECHOPRT = 1024 +pkg syscall (linux-amd64), const ECHRNG = 44 +pkg syscall (linux-amd64), const ECOMM = 70 +pkg syscall (linux-amd64), const ECONNABORTED = 103 +pkg syscall (linux-amd64), const ECONNREFUSED = 111 +pkg syscall (linux-amd64), const ECONNRESET = 104 +pkg syscall (linux-amd64), const EDEADLK = 35 +pkg syscall (linux-amd64), const EDEADLOCK = 35 +pkg syscall (linux-amd64), const EDESTADDRREQ = 89 +pkg syscall (linux-amd64), const EDOM = 33 +pkg syscall (linux-amd64), const EDOTDOT = 73 +pkg syscall (linux-amd64), const EDQUOT = 122 +pkg syscall (linux-amd64), const EEXIST = 17 +pkg syscall (linux-amd64), const EFAULT = 14 +pkg syscall (linux-amd64), const EFBIG = 27 +pkg syscall (linux-amd64), const EHOSTDOWN = 112 +pkg syscall (linux-amd64), const EHOSTUNREACH = 113 +pkg syscall (linux-amd64), const EIDRM = 43 +pkg syscall (linux-amd64), const EILSEQ = 84 +pkg syscall (linux-amd64), const EINPROGRESS = 115 +pkg syscall (linux-amd64), const EINTR = 4 +pkg syscall (linux-amd64), const EINVAL = 22 +pkg syscall (linux-amd64), const EIO = 5 +pkg syscall (linux-amd64), const EISCONN = 106 +pkg syscall (linux-amd64), const EISDIR = 21 +pkg syscall (linux-amd64), const EISNAM = 120 +pkg syscall (linux-amd64), const EKEYEXPIRED = 127 +pkg syscall (linux-amd64), const EKEYREJECTED = 129 +pkg syscall (linux-amd64), const EKEYREVOKED = 128 +pkg syscall (linux-amd64), const EL2HLT = 51 +pkg syscall (linux-amd64), const EL2NSYNC = 45 +pkg syscall (linux-amd64), const EL3HLT = 46 +pkg syscall (linux-amd64), const EL3RST = 47 +pkg syscall (linux-amd64), const ELIBACC = 79 +pkg syscall (linux-amd64), const ELIBBAD = 80 +pkg syscall (linux-amd64), const ELIBEXEC = 83 +pkg syscall (linux-amd64), const ELIBMAX = 82 +pkg syscall (linux-amd64), const ELIBSCN = 81 +pkg syscall (linux-amd64), const ELNRNG = 48 +pkg syscall (linux-amd64), const ELOOP = 40 +pkg syscall (linux-amd64), const EMEDIUMTYPE = 124 +pkg syscall (linux-amd64), const EMFILE = 24 +pkg syscall (linux-amd64), const EMLINK = 31 +pkg syscall (linux-amd64), const EMSGSIZE = 90 +pkg syscall (linux-amd64), const EMULTIHOP = 72 +pkg syscall (linux-amd64), const ENAMETOOLONG = 36 +pkg syscall (linux-amd64), const ENAVAIL = 119 +pkg syscall (linux-amd64), const ENETDOWN = 100 +pkg syscall (linux-amd64), const ENETRESET = 102 +pkg syscall (linux-amd64), const ENETUNREACH = 101 +pkg syscall (linux-amd64), const ENFILE = 23 +pkg syscall (linux-amd64), const ENOANO = 55 +pkg syscall (linux-amd64), const ENOBUFS = 105 +pkg syscall (linux-amd64), const ENOCSI = 50 +pkg syscall (linux-amd64), const ENODATA = 61 +pkg syscall (linux-amd64), const ENODEV = 19 +pkg syscall (linux-amd64), const ENOEXEC = 8 +pkg syscall (linux-amd64), const ENOKEY = 126 +pkg syscall (linux-amd64), const ENOLCK = 37 +pkg syscall (linux-amd64), const ENOLINK = 67 +pkg syscall (linux-amd64), const ENOMEDIUM = 123 +pkg syscall (linux-amd64), const ENOMEM = 12 +pkg syscall (linux-amd64), const ENOMSG = 42 +pkg syscall (linux-amd64), const ENONET = 64 +pkg syscall (linux-amd64), const ENOPKG = 65 +pkg syscall (linux-amd64), const ENOPROTOOPT = 92 +pkg syscall (linux-amd64), const ENOSPC = 28 +pkg syscall (linux-amd64), const ENOSR = 63 +pkg syscall (linux-amd64), const ENOSTR = 60 +pkg syscall (linux-amd64), const ENOSYS = 38 +pkg syscall (linux-amd64), const ENOTBLK = 15 +pkg syscall (linux-amd64), const ENOTCONN = 107 +pkg syscall (linux-amd64), const ENOTDIR = 20 +pkg syscall (linux-amd64), const ENOTEMPTY = 39 +pkg syscall (linux-amd64), const ENOTNAM = 118 +pkg syscall (linux-amd64), const ENOTRECOVERABLE = 131 +pkg syscall (linux-amd64), const ENOTSOCK = 88 +pkg syscall (linux-amd64), const ENOTSUP = 95 +pkg syscall (linux-amd64), const ENOTTY = 25 +pkg syscall (linux-amd64), const ENOTUNIQ = 76 +pkg syscall (linux-amd64), const ENXIO = 6 +pkg syscall (linux-amd64), const EOPNOTSUPP = 95 +pkg syscall (linux-amd64), const EOVERFLOW = 75 +pkg syscall (linux-amd64), const EOWNERDEAD = 130 +pkg syscall (linux-amd64), const EPERM = 1 +pkg syscall (linux-amd64), const EPFNOSUPPORT = 96 +pkg syscall (linux-amd64), const EPIPE = 32 +pkg syscall (linux-amd64), const EPOLLERR = 8 +pkg syscall (linux-amd64), const EPOLLET = -2147483648 +pkg syscall (linux-amd64), const EPOLLHUP = 16 +pkg syscall (linux-amd64), const EPOLLIN = 1 +pkg syscall (linux-amd64), const EPOLLMSG = 1024 +pkg syscall (linux-amd64), const EPOLLONESHOT = 1073741824 +pkg syscall (linux-amd64), const EPOLLOUT = 4 +pkg syscall (linux-amd64), const EPOLLPRI = 2 +pkg syscall (linux-amd64), const EPOLLRDBAND = 128 +pkg syscall (linux-amd64), const EPOLLRDHUP = 8192 +pkg syscall (linux-amd64), const EPOLLRDNORM = 64 +pkg syscall (linux-amd64), const EPOLLWRBAND = 512 +pkg syscall (linux-amd64), const EPOLLWRNORM = 256 +pkg syscall (linux-amd64), const EPOLL_CLOEXEC = 524288 +pkg syscall (linux-amd64), const EPOLL_CTL_ADD = 1 +pkg syscall (linux-amd64), const EPOLL_CTL_DEL = 2 +pkg syscall (linux-amd64), const EPOLL_CTL_MOD = 3 +pkg syscall (linux-amd64), const EPOLL_NONBLOCK = 2048 +pkg syscall (linux-amd64), const EPROTO = 71 +pkg syscall (linux-amd64), const EPROTONOSUPPORT = 93 +pkg syscall (linux-amd64), const EPROTOTYPE = 91 +pkg syscall (linux-amd64), const ERANGE = 34 +pkg syscall (linux-amd64), const EREMCHG = 78 +pkg syscall (linux-amd64), const EREMOTE = 66 +pkg syscall (linux-amd64), const EREMOTEIO = 121 +pkg syscall (linux-amd64), const ERESTART = 85 +pkg syscall (linux-amd64), const ERFKILL = 132 +pkg syscall (linux-amd64), const EROFS = 30 +pkg syscall (linux-amd64), const ESHUTDOWN = 108 +pkg syscall (linux-amd64), const ESOCKTNOSUPPORT = 94 +pkg syscall (linux-amd64), const ESPIPE = 29 +pkg syscall (linux-amd64), const ESRCH = 3 +pkg syscall (linux-amd64), const ESRMNT = 69 +pkg syscall (linux-amd64), const ESTALE = 116 +pkg syscall (linux-amd64), const ESTRPIPE = 86 +pkg syscall (linux-amd64), const ETH_P_1588 = 35063 +pkg syscall (linux-amd64), const ETH_P_8021Q = 33024 +pkg syscall (linux-amd64), const ETH_P_802_2 = 4 +pkg syscall (linux-amd64), const ETH_P_802_3 = 1 +pkg syscall (linux-amd64), const ETH_P_AARP = 33011 +pkg syscall (linux-amd64), const ETH_P_ALL = 3 +pkg syscall (linux-amd64), const ETH_P_AOE = 34978 +pkg syscall (linux-amd64), const ETH_P_ARCNET = 26 +pkg syscall (linux-amd64), const ETH_P_ARP = 2054 +pkg syscall (linux-amd64), const ETH_P_ATALK = 32923 +pkg syscall (linux-amd64), const ETH_P_ATMFATE = 34948 +pkg syscall (linux-amd64), const ETH_P_ATMMPOA = 34892 +pkg syscall (linux-amd64), const ETH_P_AX25 = 2 +pkg syscall (linux-amd64), const ETH_P_BPQ = 2303 +pkg syscall (linux-amd64), const ETH_P_CAIF = 247 +pkg syscall (linux-amd64), const ETH_P_CAN = 12 +pkg syscall (linux-amd64), const ETH_P_CONTROL = 22 +pkg syscall (linux-amd64), const ETH_P_CUST = 24582 +pkg syscall (linux-amd64), const ETH_P_DDCMP = 6 +pkg syscall (linux-amd64), const ETH_P_DEC = 24576 +pkg syscall (linux-amd64), const ETH_P_DIAG = 24581 +pkg syscall (linux-amd64), const ETH_P_DNA_DL = 24577 +pkg syscall (linux-amd64), const ETH_P_DNA_RC = 24578 +pkg syscall (linux-amd64), const ETH_P_DNA_RT = 24579 +pkg syscall (linux-amd64), const ETH_P_DSA = 27 +pkg syscall (linux-amd64), const ETH_P_ECONET = 24 +pkg syscall (linux-amd64), const ETH_P_EDSA = 56026 +pkg syscall (linux-amd64), const ETH_P_FCOE = 35078 +pkg syscall (linux-amd64), const ETH_P_FIP = 35092 +pkg syscall (linux-amd64), const ETH_P_HDLC = 25 +pkg syscall (linux-amd64), const ETH_P_IEEE802154 = 246 +pkg syscall (linux-amd64), const ETH_P_IEEEPUP = 2560 +pkg syscall (linux-amd64), const ETH_P_IEEEPUPAT = 2561 +pkg syscall (linux-amd64), const ETH_P_IP = 2048 +pkg syscall (linux-amd64), const ETH_P_IPV6 = 34525 +pkg syscall (linux-amd64), const ETH_P_IPX = 33079 +pkg syscall (linux-amd64), const ETH_P_IRDA = 23 +pkg syscall (linux-amd64), const ETH_P_LAT = 24580 +pkg syscall (linux-amd64), const ETH_P_LINK_CTL = 34924 +pkg syscall (linux-amd64), const ETH_P_LOCALTALK = 9 +pkg syscall (linux-amd64), const ETH_P_LOOP = 96 +pkg syscall (linux-amd64), const ETH_P_MOBITEX = 21 +pkg syscall (linux-amd64), const ETH_P_MPLS_MC = 34888 +pkg syscall (linux-amd64), const ETH_P_MPLS_UC = 34887 +pkg syscall (linux-amd64), const ETH_P_PAE = 34958 +pkg syscall (linux-amd64), const ETH_P_PAUSE = 34824 +pkg syscall (linux-amd64), const ETH_P_PHONET = 245 +pkg syscall (linux-amd64), const ETH_P_PPPTALK = 16 +pkg syscall (linux-amd64), const ETH_P_PPP_DISC = 34915 +pkg syscall (linux-amd64), const ETH_P_PPP_MP = 8 +pkg syscall (linux-amd64), const ETH_P_PPP_SES = 34916 +pkg syscall (linux-amd64), const ETH_P_PUP = 512 +pkg syscall (linux-amd64), const ETH_P_PUPAT = 513 +pkg syscall (linux-amd64), const ETH_P_RARP = 32821 +pkg syscall (linux-amd64), const ETH_P_SCA = 24583 +pkg syscall (linux-amd64), const ETH_P_SLOW = 34825 +pkg syscall (linux-amd64), const ETH_P_SNAP = 5 +pkg syscall (linux-amd64), const ETH_P_TEB = 25944 +pkg syscall (linux-amd64), const ETH_P_TIPC = 35018 +pkg syscall (linux-amd64), const ETH_P_TRAILER = 28 +pkg syscall (linux-amd64), const ETH_P_TR_802_2 = 17 +pkg syscall (linux-amd64), const ETH_P_WAN_PPP = 7 +pkg syscall (linux-amd64), const ETH_P_WCCP = 34878 +pkg syscall (linux-amd64), const ETH_P_X25 = 2053 +pkg syscall (linux-amd64), const ETIME = 62 +pkg syscall (linux-amd64), const ETIMEDOUT = 110 +pkg syscall (linux-amd64), const ETOOMANYREFS = 109 +pkg syscall (linux-amd64), const ETXTBSY = 26 +pkg syscall (linux-amd64), const EUCLEAN = 117 +pkg syscall (linux-amd64), const EUNATCH = 49 +pkg syscall (linux-amd64), const EUSERS = 87 +pkg syscall (linux-amd64), const EWOULDBLOCK = 11 +pkg syscall (linux-amd64), const EXDEV = 18 +pkg syscall (linux-amd64), const EXFULL = 54 +pkg syscall (linux-amd64), const FD_CLOEXEC = 1 +pkg syscall (linux-amd64), const FD_SETSIZE = 1024 +pkg syscall (linux-amd64), const FLUSHO = 4096 +pkg syscall (linux-amd64), const F_DUPFD = 0 +pkg syscall (linux-amd64), const F_DUPFD_CLOEXEC = 1030 +pkg syscall (linux-amd64), const F_EXLCK = 4 +pkg syscall (linux-amd64), const F_GETFD = 1 +pkg syscall (linux-amd64), const F_GETFL = 3 +pkg syscall (linux-amd64), const F_GETLEASE = 1025 +pkg syscall (linux-amd64), const F_GETLK = 5 +pkg syscall (linux-amd64), const F_GETLK64 = 5 +pkg syscall (linux-amd64), const F_GETOWN = 9 +pkg syscall (linux-amd64), const F_GETOWN_EX = 16 +pkg syscall (linux-amd64), const F_GETPIPE_SZ = 1032 +pkg syscall (linux-amd64), const F_GETSIG = 11 +pkg syscall (linux-amd64), const F_LOCK = 1 +pkg syscall (linux-amd64), const F_NOTIFY = 1026 +pkg syscall (linux-amd64), const F_OK = 0 +pkg syscall (linux-amd64), const F_RDLCK = 0 +pkg syscall (linux-amd64), const F_SETFD = 2 +pkg syscall (linux-amd64), const F_SETFL = 4 +pkg syscall (linux-amd64), const F_SETLEASE = 1024 +pkg syscall (linux-amd64), const F_SETLK = 6 +pkg syscall (linux-amd64), const F_SETLK64 = 6 +pkg syscall (linux-amd64), const F_SETLKW = 7 +pkg syscall (linux-amd64), const F_SETLKW64 = 7 +pkg syscall (linux-amd64), const F_SETOWN = 8 +pkg syscall (linux-amd64), const F_SETOWN_EX = 15 +pkg syscall (linux-amd64), const F_SETPIPE_SZ = 1031 +pkg syscall (linux-amd64), const F_SETSIG = 10 +pkg syscall (linux-amd64), const F_SHLCK = 8 +pkg syscall (linux-amd64), const F_TEST = 3 +pkg syscall (linux-amd64), const F_TLOCK = 2 +pkg syscall (linux-amd64), const F_ULOCK = 0 +pkg syscall (linux-amd64), const F_UNLCK = 2 +pkg syscall (linux-amd64), const F_WRLCK = 1 +pkg syscall (linux-amd64), const HUPCL = 1024 +pkg syscall (linux-amd64), const ICANON = 2 +pkg syscall (linux-amd64), const ICRNL = 256 +pkg syscall (linux-amd64), const IEXTEN = 32768 +pkg syscall (linux-amd64), const IFA_ADDRESS = 1 +pkg syscall (linux-amd64), const IFA_ANYCAST = 5 +pkg syscall (linux-amd64), const IFA_BROADCAST = 4 +pkg syscall (linux-amd64), const IFA_CACHEINFO = 6 +pkg syscall (linux-amd64), const IFA_F_DADFAILED = 8 +pkg syscall (linux-amd64), const IFA_F_DEPRECATED = 32 +pkg syscall (linux-amd64), const IFA_F_HOMEADDRESS = 16 +pkg syscall (linux-amd64), const IFA_F_NODAD = 2 +pkg syscall (linux-amd64), const IFA_F_OPTIMISTIC = 4 +pkg syscall (linux-amd64), const IFA_F_PERMANENT = 128 +pkg syscall (linux-amd64), const IFA_F_SECONDARY = 1 +pkg syscall (linux-amd64), const IFA_F_TEMPORARY = 1 +pkg syscall (linux-amd64), const IFA_F_TENTATIVE = 64 +pkg syscall (linux-amd64), const IFA_LABEL = 3 +pkg syscall (linux-amd64), const IFA_LOCAL = 2 +pkg syscall (linux-amd64), const IFA_MAX = 7 +pkg syscall (linux-amd64), const IFA_MULTICAST = 7 +pkg syscall (linux-amd64), const IFA_UNSPEC = 0 +pkg syscall (linux-amd64), const IFF_ALLMULTI = 512 +pkg syscall (linux-amd64), const IFF_AUTOMEDIA = 16384 +pkg syscall (linux-amd64), const IFF_DEBUG = 4 +pkg syscall (linux-amd64), const IFF_DYNAMIC = 32768 +pkg syscall (linux-amd64), const IFF_LOOPBACK = 8 +pkg syscall (linux-amd64), const IFF_MASTER = 1024 +pkg syscall (linux-amd64), const IFF_MULTICAST = 4096 +pkg syscall (linux-amd64), const IFF_NOARP = 128 +pkg syscall (linux-amd64), const IFF_NOTRAILERS = 32 +pkg syscall (linux-amd64), const IFF_NO_PI = 4096 +pkg syscall (linux-amd64), const IFF_ONE_QUEUE = 8192 +pkg syscall (linux-amd64), const IFF_POINTOPOINT = 16 +pkg syscall (linux-amd64), const IFF_PORTSEL = 8192 +pkg syscall (linux-amd64), const IFF_PROMISC = 256 +pkg syscall (linux-amd64), const IFF_RUNNING = 64 +pkg syscall (linux-amd64), const IFF_SLAVE = 2048 +pkg syscall (linux-amd64), const IFF_TAP = 2 +pkg syscall (linux-amd64), const IFF_TUN = 1 +pkg syscall (linux-amd64), const IFF_TUN_EXCL = 32768 +pkg syscall (linux-amd64), const IFF_VNET_HDR = 16384 +pkg syscall (linux-amd64), const IFLA_ADDRESS = 1 +pkg syscall (linux-amd64), const IFLA_BROADCAST = 2 +pkg syscall (linux-amd64), const IFLA_COST = 8 +pkg syscall (linux-amd64), const IFLA_IFALIAS = 20 +pkg syscall (linux-amd64), const IFLA_IFNAME = 3 +pkg syscall (linux-amd64), const IFLA_LINK = 5 +pkg syscall (linux-amd64), const IFLA_LINKINFO = 18 +pkg syscall (linux-amd64), const IFLA_LINKMODE = 17 +pkg syscall (linux-amd64), const IFLA_MAP = 14 +pkg syscall (linux-amd64), const IFLA_MASTER = 10 +pkg syscall (linux-amd64), const IFLA_MAX = 29 +pkg syscall (linux-amd64), const IFLA_MTU = 4 +pkg syscall (linux-amd64), const IFLA_NET_NS_PID = 19 +pkg syscall (linux-amd64), const IFLA_OPERSTATE = 16 +pkg syscall (linux-amd64), const IFLA_PRIORITY = 9 +pkg syscall (linux-amd64), const IFLA_PROTINFO = 12 +pkg syscall (linux-amd64), const IFLA_QDISC = 6 +pkg syscall (linux-amd64), const IFLA_STATS = 7 +pkg syscall (linux-amd64), const IFLA_TXQLEN = 13 +pkg syscall (linux-amd64), const IFLA_UNSPEC = 0 +pkg syscall (linux-amd64), const IFLA_WEIGHT = 15 +pkg syscall (linux-amd64), const IFLA_WIRELESS = 11 +pkg syscall (linux-amd64), const IFNAMSIZ = 16 +pkg syscall (linux-amd64), const IGNBRK = 1 +pkg syscall (linux-amd64), const IGNCR = 128 +pkg syscall (linux-amd64), const IGNPAR = 4 +pkg syscall (linux-amd64), const IMAXBEL = 8192 +pkg syscall (linux-amd64), const INLCR = 64 +pkg syscall (linux-amd64), const INPCK = 16 +pkg syscall (linux-amd64), const IN_ACCESS = 1 +pkg syscall (linux-amd64), const IN_ALL_EVENTS = 4095 +pkg syscall (linux-amd64), const IN_ATTRIB = 4 +pkg syscall (linux-amd64), const IN_CLASSA_HOST = 16777215 +pkg syscall (linux-amd64), const IN_CLASSA_MAX = 128 +pkg syscall (linux-amd64), const IN_CLASSA_NET = 4278190080 +pkg syscall (linux-amd64), const IN_CLASSA_NSHIFT = 24 +pkg syscall (linux-amd64), const IN_CLASSB_HOST = 65535 +pkg syscall (linux-amd64), const IN_CLASSB_MAX = 65536 +pkg syscall (linux-amd64), const IN_CLASSB_NET = 4294901760 +pkg syscall (linux-amd64), const IN_CLASSB_NSHIFT = 16 +pkg syscall (linux-amd64), const IN_CLASSC_HOST = 255 +pkg syscall (linux-amd64), const IN_CLASSC_NET = 4294967040 +pkg syscall (linux-amd64), const IN_CLASSC_NSHIFT = 8 +pkg syscall (linux-amd64), const IN_CLOEXEC = 524288 +pkg syscall (linux-amd64), const IN_CLOSE = 24 +pkg syscall (linux-amd64), const IN_CLOSE_NOWRITE = 16 +pkg syscall (linux-amd64), const IN_CLOSE_WRITE = 8 +pkg syscall (linux-amd64), const IN_CREATE = 256 +pkg syscall (linux-amd64), const IN_DELETE = 512 +pkg syscall (linux-amd64), const IN_DELETE_SELF = 1024 +pkg syscall (linux-amd64), const IN_DONT_FOLLOW = 33554432 +pkg syscall (linux-amd64), const IN_EXCL_UNLINK = 67108864 +pkg syscall (linux-amd64), const IN_IGNORED = 32768 +pkg syscall (linux-amd64), const IN_ISDIR = 1073741824 +pkg syscall (linux-amd64), const IN_LOOPBACKNET = 127 +pkg syscall (linux-amd64), const IN_MASK_ADD = 536870912 +pkg syscall (linux-amd64), const IN_MODIFY = 2 +pkg syscall (linux-amd64), const IN_MOVE = 192 +pkg syscall (linux-amd64), const IN_MOVED_FROM = 64 +pkg syscall (linux-amd64), const IN_MOVED_TO = 128 +pkg syscall (linux-amd64), const IN_MOVE_SELF = 2048 +pkg syscall (linux-amd64), const IN_NONBLOCK = 2048 +pkg syscall (linux-amd64), const IN_ONESHOT = 2147483648 +pkg syscall (linux-amd64), const IN_ONLYDIR = 16777216 +pkg syscall (linux-amd64), const IN_OPEN = 32 +pkg syscall (linux-amd64), const IN_Q_OVERFLOW = 16384 +pkg syscall (linux-amd64), const IN_UNMOUNT = 8192 +pkg syscall (linux-amd64), const IPPROTO_AH = 51 +pkg syscall (linux-amd64), const IPPROTO_COMP = 108 +pkg syscall (linux-amd64), const IPPROTO_DCCP = 33 +pkg syscall (linux-amd64), const IPPROTO_DSTOPTS = 60 +pkg syscall (linux-amd64), const IPPROTO_EGP = 8 +pkg syscall (linux-amd64), const IPPROTO_ENCAP = 98 +pkg syscall (linux-amd64), const IPPROTO_ESP = 50 +pkg syscall (linux-amd64), const IPPROTO_FRAGMENT = 44 +pkg syscall (linux-amd64), const IPPROTO_GRE = 47 +pkg syscall (linux-amd64), const IPPROTO_HOPOPTS = 0 +pkg syscall (linux-amd64), const IPPROTO_ICMP = 1 +pkg syscall (linux-amd64), const IPPROTO_ICMPV6 = 58 +pkg syscall (linux-amd64), const IPPROTO_IDP = 22 +pkg syscall (linux-amd64), const IPPROTO_IGMP = 2 +pkg syscall (linux-amd64), const IPPROTO_IPIP = 4 +pkg syscall (linux-amd64), const IPPROTO_MTP = 92 +pkg syscall (linux-amd64), const IPPROTO_NONE = 59 +pkg syscall (linux-amd64), const IPPROTO_PIM = 103 +pkg syscall (linux-amd64), const IPPROTO_PUP = 12 +pkg syscall (linux-amd64), const IPPROTO_RAW = 255 +pkg syscall (linux-amd64), const IPPROTO_ROUTING = 43 +pkg syscall (linux-amd64), const IPPROTO_RSVP = 46 +pkg syscall (linux-amd64), const IPPROTO_SCTP = 132 +pkg syscall (linux-amd64), const IPPROTO_TP = 29 +pkg syscall (linux-amd64), const IPPROTO_UDPLITE = 136 +pkg syscall (linux-amd64), const IPV6_2292DSTOPTS = 4 +pkg syscall (linux-amd64), const IPV6_2292HOPLIMIT = 8 +pkg syscall (linux-amd64), const IPV6_2292HOPOPTS = 3 +pkg syscall (linux-amd64), const IPV6_2292PKTINFO = 2 +pkg syscall (linux-amd64), const IPV6_2292PKTOPTIONS = 6 +pkg syscall (linux-amd64), const IPV6_2292RTHDR = 5 +pkg syscall (linux-amd64), const IPV6_ADDRFORM = 1 +pkg syscall (linux-amd64), const IPV6_ADD_MEMBERSHIP = 20 +pkg syscall (linux-amd64), const IPV6_AUTHHDR = 10 +pkg syscall (linux-amd64), const IPV6_CHECKSUM = 7 +pkg syscall (linux-amd64), const IPV6_DROP_MEMBERSHIP = 21 +pkg syscall (linux-amd64), const IPV6_DSTOPTS = 59 +pkg syscall (linux-amd64), const IPV6_HOPLIMIT = 52 +pkg syscall (linux-amd64), const IPV6_HOPOPTS = 54 +pkg syscall (linux-amd64), const IPV6_IPSEC_POLICY = 34 +pkg syscall (linux-amd64), const IPV6_JOIN_ANYCAST = 27 +pkg syscall (linux-amd64), const IPV6_JOIN_GROUP = 20 +pkg syscall (linux-amd64), const IPV6_LEAVE_ANYCAST = 28 +pkg syscall (linux-amd64), const IPV6_LEAVE_GROUP = 21 +pkg syscall (linux-amd64), const IPV6_MTU = 24 +pkg syscall (linux-amd64), const IPV6_MTU_DISCOVER = 23 +pkg syscall (linux-amd64), const IPV6_MULTICAST_HOPS = 18 +pkg syscall (linux-amd64), const IPV6_MULTICAST_IF = 17 +pkg syscall (linux-amd64), const IPV6_MULTICAST_LOOP = 19 +pkg syscall (linux-amd64), const IPV6_NEXTHOP = 9 +pkg syscall (linux-amd64), const IPV6_PKTINFO = 50 +pkg syscall (linux-amd64), const IPV6_PMTUDISC_DO = 2 +pkg syscall (linux-amd64), const IPV6_PMTUDISC_DONT = 0 +pkg syscall (linux-amd64), const IPV6_PMTUDISC_PROBE = 3 +pkg syscall (linux-amd64), const IPV6_PMTUDISC_WANT = 1 +pkg syscall (linux-amd64), const IPV6_RECVDSTOPTS = 58 +pkg syscall (linux-amd64), const IPV6_RECVERR = 25 +pkg syscall (linux-amd64), const IPV6_RECVHOPLIMIT = 51 +pkg syscall (linux-amd64), const IPV6_RECVHOPOPTS = 53 +pkg syscall (linux-amd64), const IPV6_RECVPKTINFO = 49 +pkg syscall (linux-amd64), const IPV6_RECVRTHDR = 56 +pkg syscall (linux-amd64), const IPV6_RECVTCLASS = 66 +pkg syscall (linux-amd64), const IPV6_ROUTER_ALERT = 22 +pkg syscall (linux-amd64), const IPV6_RTHDR = 57 +pkg syscall (linux-amd64), const IPV6_RTHDRDSTOPTS = 55 +pkg syscall (linux-amd64), const IPV6_RTHDR_LOOSE = 0 +pkg syscall (linux-amd64), const IPV6_RTHDR_STRICT = 1 +pkg syscall (linux-amd64), const IPV6_RTHDR_TYPE_0 = 0 +pkg syscall (linux-amd64), const IPV6_RXDSTOPTS = 59 +pkg syscall (linux-amd64), const IPV6_RXHOPOPTS = 54 +pkg syscall (linux-amd64), const IPV6_TCLASS = 67 +pkg syscall (linux-amd64), const IPV6_UNICAST_HOPS = 16 +pkg syscall (linux-amd64), const IPV6_V6ONLY = 26 +pkg syscall (linux-amd64), const IPV6_XFRM_POLICY = 35 +pkg syscall (linux-amd64), const IP_ADD_MEMBERSHIP = 35 +pkg syscall (linux-amd64), const IP_ADD_SOURCE_MEMBERSHIP = 39 +pkg syscall (linux-amd64), const IP_BLOCK_SOURCE = 38 +pkg syscall (linux-amd64), const IP_DEFAULT_MULTICAST_LOOP = 1 +pkg syscall (linux-amd64), const IP_DEFAULT_MULTICAST_TTL = 1 +pkg syscall (linux-amd64), const IP_DF = 16384 +pkg syscall (linux-amd64), const IP_DROP_MEMBERSHIP = 36 +pkg syscall (linux-amd64), const IP_DROP_SOURCE_MEMBERSHIP = 40 +pkg syscall (linux-amd64), const IP_FREEBIND = 15 +pkg syscall (linux-amd64), const IP_HDRINCL = 3 +pkg syscall (linux-amd64), const IP_IPSEC_POLICY = 16 +pkg syscall (linux-amd64), const IP_MAXPACKET = 65535 +pkg syscall (linux-amd64), const IP_MAX_MEMBERSHIPS = 20 +pkg syscall (linux-amd64), const IP_MF = 8192 +pkg syscall (linux-amd64), const IP_MINTTL = 21 +pkg syscall (linux-amd64), const IP_MSFILTER = 41 +pkg syscall (linux-amd64), const IP_MSS = 576 +pkg syscall (linux-amd64), const IP_MTU = 14 +pkg syscall (linux-amd64), const IP_MTU_DISCOVER = 10 +pkg syscall (linux-amd64), const IP_MULTICAST_IF = 32 +pkg syscall (linux-amd64), const IP_MULTICAST_LOOP = 34 +pkg syscall (linux-amd64), const IP_MULTICAST_TTL = 33 +pkg syscall (linux-amd64), const IP_OFFMASK = 8191 +pkg syscall (linux-amd64), const IP_OPTIONS = 4 +pkg syscall (linux-amd64), const IP_ORIGDSTADDR = 20 +pkg syscall (linux-amd64), const IP_PASSSEC = 18 +pkg syscall (linux-amd64), const IP_PKTINFO = 8 +pkg syscall (linux-amd64), const IP_PKTOPTIONS = 9 +pkg syscall (linux-amd64), const IP_PMTUDISC = 10 +pkg syscall (linux-amd64), const IP_PMTUDISC_DO = 2 +pkg syscall (linux-amd64), const IP_PMTUDISC_DONT = 0 +pkg syscall (linux-amd64), const IP_PMTUDISC_PROBE = 3 +pkg syscall (linux-amd64), const IP_PMTUDISC_WANT = 1 +pkg syscall (linux-amd64), const IP_RECVERR = 11 +pkg syscall (linux-amd64), const IP_RECVOPTS = 6 +pkg syscall (linux-amd64), const IP_RECVORIGDSTADDR = 20 +pkg syscall (linux-amd64), const IP_RECVRETOPTS = 7 +pkg syscall (linux-amd64), const IP_RECVTOS = 13 +pkg syscall (linux-amd64), const IP_RECVTTL = 12 +pkg syscall (linux-amd64), const IP_RETOPTS = 7 +pkg syscall (linux-amd64), const IP_RF = 32768 +pkg syscall (linux-amd64), const IP_ROUTER_ALERT = 5 +pkg syscall (linux-amd64), const IP_TOS = 1 +pkg syscall (linux-amd64), const IP_TRANSPARENT = 19 +pkg syscall (linux-amd64), const IP_TTL = 2 +pkg syscall (linux-amd64), const IP_UNBLOCK_SOURCE = 37 +pkg syscall (linux-amd64), const IP_XFRM_POLICY = 17 +pkg syscall (linux-amd64), const ISIG = 1 +pkg syscall (linux-amd64), const ISTRIP = 32 +pkg syscall (linux-amd64), const IUCLC = 512 +pkg syscall (linux-amd64), const IUTF8 = 16384 +pkg syscall (linux-amd64), const IXANY = 2048 +pkg syscall (linux-amd64), const IXOFF = 4096 +pkg syscall (linux-amd64), const IXON = 1024 +pkg syscall (linux-amd64), const ImplementsGetwd = true +pkg syscall (linux-amd64), const LINUX_REBOOT_CMD_CAD_OFF = 0 +pkg syscall (linux-amd64), const LINUX_REBOOT_CMD_CAD_ON = 2309737967 +pkg syscall (linux-amd64), const LINUX_REBOOT_CMD_HALT = 3454992675 +pkg syscall (linux-amd64), const LINUX_REBOOT_CMD_KEXEC = 1163412803 +pkg syscall (linux-amd64), const LINUX_REBOOT_CMD_POWER_OFF = 1126301404 +pkg syscall (linux-amd64), const LINUX_REBOOT_CMD_RESTART = 19088743 +pkg syscall (linux-amd64), const LINUX_REBOOT_CMD_RESTART2 = 2712847316 +pkg syscall (linux-amd64), const LINUX_REBOOT_CMD_SW_SUSPEND = 3489725666 +pkg syscall (linux-amd64), const LINUX_REBOOT_MAGIC1 = 4276215469 +pkg syscall (linux-amd64), const LINUX_REBOOT_MAGIC2 = 672274793 +pkg syscall (linux-amd64), const LOCK_EX = 2 +pkg syscall (linux-amd64), const LOCK_NB = 4 +pkg syscall (linux-amd64), const LOCK_SH = 1 +pkg syscall (linux-amd64), const LOCK_UN = 8 +pkg syscall (linux-amd64), const MADV_DOFORK = 11 +pkg syscall (linux-amd64), const MADV_DONTFORK = 10 +pkg syscall (linux-amd64), const MADV_DONTNEED = 4 +pkg syscall (linux-amd64), const MADV_HUGEPAGE = 14 +pkg syscall (linux-amd64), const MADV_HWPOISON = 100 +pkg syscall (linux-amd64), const MADV_MERGEABLE = 12 +pkg syscall (linux-amd64), const MADV_NOHUGEPAGE = 15 +pkg syscall (linux-amd64), const MADV_NORMAL = 0 +pkg syscall (linux-amd64), const MADV_RANDOM = 1 +pkg syscall (linux-amd64), const MADV_REMOVE = 9 +pkg syscall (linux-amd64), const MADV_SEQUENTIAL = 2 +pkg syscall (linux-amd64), const MADV_UNMERGEABLE = 13 +pkg syscall (linux-amd64), const MADV_WILLNEED = 3 +pkg syscall (linux-amd64), const MAP_32BIT = 64 +pkg syscall (linux-amd64), const MAP_ANON = 32 +pkg syscall (linux-amd64), const MAP_ANONYMOUS = 32 +pkg syscall (linux-amd64), const MAP_DENYWRITE = 2048 +pkg syscall (linux-amd64), const MAP_EXECUTABLE = 4096 +pkg syscall (linux-amd64), const MAP_FILE = 0 +pkg syscall (linux-amd64), const MAP_FIXED = 16 +pkg syscall (linux-amd64), const MAP_GROWSDOWN = 256 +pkg syscall (linux-amd64), const MAP_HUGETLB = 262144 +pkg syscall (linux-amd64), const MAP_LOCKED = 8192 +pkg syscall (linux-amd64), const MAP_NONBLOCK = 65536 +pkg syscall (linux-amd64), const MAP_NORESERVE = 16384 +pkg syscall (linux-amd64), const MAP_POPULATE = 32768 +pkg syscall (linux-amd64), const MAP_PRIVATE = 2 +pkg syscall (linux-amd64), const MAP_SHARED = 1 +pkg syscall (linux-amd64), const MAP_STACK = 131072 +pkg syscall (linux-amd64), const MAP_TYPE = 15 +pkg syscall (linux-amd64), const MCL_CURRENT = 1 +pkg syscall (linux-amd64), const MCL_FUTURE = 2 +pkg syscall (linux-amd64), const MNT_DETACH = 2 +pkg syscall (linux-amd64), const MNT_EXPIRE = 4 +pkg syscall (linux-amd64), const MNT_FORCE = 1 +pkg syscall (linux-amd64), const MSG_CMSG_CLOEXEC = 1073741824 +pkg syscall (linux-amd64), const MSG_CONFIRM = 2048 +pkg syscall (linux-amd64), const MSG_CTRUNC = 8 +pkg syscall (linux-amd64), const MSG_DONTROUTE = 4 +pkg syscall (linux-amd64), const MSG_DONTWAIT = 64 +pkg syscall (linux-amd64), const MSG_EOR = 128 +pkg syscall (linux-amd64), const MSG_ERRQUEUE = 8192 +pkg syscall (linux-amd64), const MSG_FASTOPEN = 536870912 +pkg syscall (linux-amd64), const MSG_FASTOPEN ideal-int +pkg syscall (linux-amd64), const MSG_FIN = 512 +pkg syscall (linux-amd64), const MSG_MORE = 32768 +pkg syscall (linux-amd64), const MSG_NOSIGNAL = 16384 +pkg syscall (linux-amd64), const MSG_OOB = 1 +pkg syscall (linux-amd64), const MSG_PEEK = 2 +pkg syscall (linux-amd64), const MSG_PROXY = 16 +pkg syscall (linux-amd64), const MSG_RST = 4096 +pkg syscall (linux-amd64), const MSG_SYN = 1024 +pkg syscall (linux-amd64), const MSG_TRUNC = 32 +pkg syscall (linux-amd64), const MSG_TRYHARD = 4 +pkg syscall (linux-amd64), const MSG_WAITALL = 256 +pkg syscall (linux-amd64), const MSG_WAITFORONE = 65536 +pkg syscall (linux-amd64), const MS_ACTIVE = 1073741824 +pkg syscall (linux-amd64), const MS_ASYNC = 1 +pkg syscall (linux-amd64), const MS_BIND = 4096 +pkg syscall (linux-amd64), const MS_DIRSYNC = 128 +pkg syscall (linux-amd64), const MS_INVALIDATE = 2 +pkg syscall (linux-amd64), const MS_I_VERSION = 8388608 +pkg syscall (linux-amd64), const MS_KERNMOUNT = 4194304 +pkg syscall (linux-amd64), const MS_MANDLOCK = 64 +pkg syscall (linux-amd64), const MS_MGC_MSK = 4294901760 +pkg syscall (linux-amd64), const MS_MGC_VAL = 3236757504 +pkg syscall (linux-amd64), const MS_MOVE = 8192 +pkg syscall (linux-amd64), const MS_NOATIME = 1024 +pkg syscall (linux-amd64), const MS_NODEV = 4 +pkg syscall (linux-amd64), const MS_NODIRATIME = 2048 +pkg syscall (linux-amd64), const MS_NOEXEC = 8 +pkg syscall (linux-amd64), const MS_NOSUID = 2 +pkg syscall (linux-amd64), const MS_NOUSER = -2147483648 +pkg syscall (linux-amd64), const MS_POSIXACL = 65536 +pkg syscall (linux-amd64), const MS_PRIVATE = 262144 +pkg syscall (linux-amd64), const MS_RDONLY = 1 +pkg syscall (linux-amd64), const MS_REC = 16384 +pkg syscall (linux-amd64), const MS_RELATIME = 2097152 +pkg syscall (linux-amd64), const MS_REMOUNT = 32 +pkg syscall (linux-amd64), const MS_RMT_MASK = 8388689 +pkg syscall (linux-amd64), const MS_SHARED = 1048576 +pkg syscall (linux-amd64), const MS_SILENT = 32768 +pkg syscall (linux-amd64), const MS_SLAVE = 524288 +pkg syscall (linux-amd64), const MS_STRICTATIME = 16777216 +pkg syscall (linux-amd64), const MS_SYNC = 4 +pkg syscall (linux-amd64), const MS_SYNCHRONOUS = 16 +pkg syscall (linux-amd64), const MS_UNBINDABLE = 131072 +pkg syscall (linux-amd64), const NAME_MAX = 255 +pkg syscall (linux-amd64), const NETLINK_ADD_MEMBERSHIP = 1 +pkg syscall (linux-amd64), const NETLINK_AUDIT = 9 +pkg syscall (linux-amd64), const NETLINK_BROADCAST_ERROR = 4 +pkg syscall (linux-amd64), const NETLINK_CONNECTOR = 11 +pkg syscall (linux-amd64), const NETLINK_DNRTMSG = 14 +pkg syscall (linux-amd64), const NETLINK_DROP_MEMBERSHIP = 2 +pkg syscall (linux-amd64), const NETLINK_ECRYPTFS = 19 +pkg syscall (linux-amd64), const NETLINK_FIB_LOOKUP = 10 +pkg syscall (linux-amd64), const NETLINK_FIREWALL = 3 +pkg syscall (linux-amd64), const NETLINK_GENERIC = 16 +pkg syscall (linux-amd64), const NETLINK_INET_DIAG = 4 +pkg syscall (linux-amd64), const NETLINK_IP6_FW = 13 +pkg syscall (linux-amd64), const NETLINK_ISCSI = 8 +pkg syscall (linux-amd64), const NETLINK_KOBJECT_UEVENT = 15 +pkg syscall (linux-amd64), const NETLINK_NETFILTER = 12 +pkg syscall (linux-amd64), const NETLINK_NFLOG = 5 +pkg syscall (linux-amd64), const NETLINK_NO_ENOBUFS = 5 +pkg syscall (linux-amd64), const NETLINK_PKTINFO = 3 +pkg syscall (linux-amd64), const NETLINK_ROUTE = 0 +pkg syscall (linux-amd64), const NETLINK_SCSITRANSPORT = 18 +pkg syscall (linux-amd64), const NETLINK_SELINUX = 7 +pkg syscall (linux-amd64), const NETLINK_UNUSED = 1 +pkg syscall (linux-amd64), const NETLINK_USERSOCK = 2 +pkg syscall (linux-amd64), const NETLINK_XFRM = 6 +pkg syscall (linux-amd64), const NLA_ALIGNTO = 4 +pkg syscall (linux-amd64), const NLA_F_NESTED = 32768 +pkg syscall (linux-amd64), const NLA_F_NET_BYTEORDER = 16384 +pkg syscall (linux-amd64), const NLA_HDRLEN = 4 +pkg syscall (linux-amd64), const NLMSG_ALIGNTO = 4 +pkg syscall (linux-amd64), const NLMSG_DONE = 3 +pkg syscall (linux-amd64), const NLMSG_ERROR = 2 +pkg syscall (linux-amd64), const NLMSG_HDRLEN = 16 +pkg syscall (linux-amd64), const NLMSG_MIN_TYPE = 16 +pkg syscall (linux-amd64), const NLMSG_NOOP = 1 +pkg syscall (linux-amd64), const NLMSG_OVERRUN = 4 +pkg syscall (linux-amd64), const NLM_F_ACK = 4 +pkg syscall (linux-amd64), const NLM_F_APPEND = 2048 +pkg syscall (linux-amd64), const NLM_F_ATOMIC = 1024 +pkg syscall (linux-amd64), const NLM_F_CREATE = 1024 +pkg syscall (linux-amd64), const NLM_F_DUMP = 768 +pkg syscall (linux-amd64), const NLM_F_ECHO = 8 +pkg syscall (linux-amd64), const NLM_F_EXCL = 512 +pkg syscall (linux-amd64), const NLM_F_MATCH = 512 +pkg syscall (linux-amd64), const NLM_F_MULTI = 2 +pkg syscall (linux-amd64), const NLM_F_REPLACE = 256 +pkg syscall (linux-amd64), const NLM_F_REQUEST = 1 +pkg syscall (linux-amd64), const NLM_F_ROOT = 256 +pkg syscall (linux-amd64), const NOFLSH = 128 +pkg syscall (linux-amd64), const OCRNL = 8 +pkg syscall (linux-amd64), const OFDEL = 128 +pkg syscall (linux-amd64), const OFILL = 64 +pkg syscall (linux-amd64), const OLCUC = 2 +pkg syscall (linux-amd64), const ONLCR = 4 +pkg syscall (linux-amd64), const ONLRET = 32 +pkg syscall (linux-amd64), const ONOCR = 16 +pkg syscall (linux-amd64), const OPOST = 1 +pkg syscall (linux-amd64), const O_ACCMODE = 3 +pkg syscall (linux-amd64), const O_APPEND = 1024 +pkg syscall (linux-amd64), const O_ASYNC = 8192 +pkg syscall (linux-amd64), const O_CLOEXEC = 524288 +pkg syscall (linux-amd64), const O_CREAT = 64 +pkg syscall (linux-amd64), const O_DIRECT = 16384 +pkg syscall (linux-amd64), const O_DIRECTORY = 65536 +pkg syscall (linux-amd64), const O_DSYNC = 4096 +pkg syscall (linux-amd64), const O_EXCL = 128 +pkg syscall (linux-amd64), const O_FSYNC = 1052672 +pkg syscall (linux-amd64), const O_LARGEFILE = 0 +pkg syscall (linux-amd64), const O_NDELAY = 2048 +pkg syscall (linux-amd64), const O_NOATIME = 262144 +pkg syscall (linux-amd64), const O_NOCTTY = 256 +pkg syscall (linux-amd64), const O_NOFOLLOW = 131072 +pkg syscall (linux-amd64), const O_NONBLOCK = 2048 +pkg syscall (linux-amd64), const O_RSYNC = 1052672 +pkg syscall (linux-amd64), const O_SYNC = 1052672 +pkg syscall (linux-amd64), const O_TRUNC = 512 +pkg syscall (linux-amd64), const PACKET_ADD_MEMBERSHIP = 1 +pkg syscall (linux-amd64), const PACKET_BROADCAST = 1 +pkg syscall (linux-amd64), const PACKET_DROP_MEMBERSHIP = 2 +pkg syscall (linux-amd64), const PACKET_FASTROUTE = 6 +pkg syscall (linux-amd64), const PACKET_HOST = 0 +pkg syscall (linux-amd64), const PACKET_LOOPBACK = 5 +pkg syscall (linux-amd64), const PACKET_MR_ALLMULTI = 2 +pkg syscall (linux-amd64), const PACKET_MR_MULTICAST = 0 +pkg syscall (linux-amd64), const PACKET_MR_PROMISC = 1 +pkg syscall (linux-amd64), const PACKET_MULTICAST = 2 +pkg syscall (linux-amd64), const PACKET_OTHERHOST = 3 +pkg syscall (linux-amd64), const PACKET_OUTGOING = 4 +pkg syscall (linux-amd64), const PACKET_RECV_OUTPUT = 3 +pkg syscall (linux-amd64), const PACKET_RX_RING = 5 +pkg syscall (linux-amd64), const PACKET_STATISTICS = 6 +pkg syscall (linux-amd64), const PARENB = 256 +pkg syscall (linux-amd64), const PARMRK = 8 +pkg syscall (linux-amd64), const PARODD = 512 +pkg syscall (linux-amd64), const PENDIN = 16384 +pkg syscall (linux-amd64), const PROT_EXEC = 4 +pkg syscall (linux-amd64), const PROT_GROWSDOWN = 16777216 +pkg syscall (linux-amd64), const PROT_GROWSUP = 33554432 +pkg syscall (linux-amd64), const PROT_NONE = 0 +pkg syscall (linux-amd64), const PROT_READ = 1 +pkg syscall (linux-amd64), const PROT_WRITE = 2 +pkg syscall (linux-amd64), const PR_CAPBSET_DROP = 24 +pkg syscall (linux-amd64), const PR_CAPBSET_READ = 23 +pkg syscall (linux-amd64), const PR_ENDIAN_BIG = 0 +pkg syscall (linux-amd64), const PR_ENDIAN_LITTLE = 1 +pkg syscall (linux-amd64), const PR_ENDIAN_PPC_LITTLE = 2 +pkg syscall (linux-amd64), const PR_FPEMU_NOPRINT = 1 +pkg syscall (linux-amd64), const PR_FPEMU_SIGFPE = 2 +pkg syscall (linux-amd64), const PR_FP_EXC_ASYNC = 2 +pkg syscall (linux-amd64), const PR_FP_EXC_DISABLED = 0 +pkg syscall (linux-amd64), const PR_FP_EXC_DIV = 65536 +pkg syscall (linux-amd64), const PR_FP_EXC_INV = 1048576 +pkg syscall (linux-amd64), const PR_FP_EXC_NONRECOV = 1 +pkg syscall (linux-amd64), const PR_FP_EXC_OVF = 131072 +pkg syscall (linux-amd64), const PR_FP_EXC_PRECISE = 3 +pkg syscall (linux-amd64), const PR_FP_EXC_RES = 524288 +pkg syscall (linux-amd64), const PR_FP_EXC_SW_ENABLE = 128 +pkg syscall (linux-amd64), const PR_FP_EXC_UND = 262144 +pkg syscall (linux-amd64), const PR_GET_DUMPABLE = 3 +pkg syscall (linux-amd64), const PR_GET_ENDIAN = 19 +pkg syscall (linux-amd64), const PR_GET_FPEMU = 9 +pkg syscall (linux-amd64), const PR_GET_FPEXC = 11 +pkg syscall (linux-amd64), const PR_GET_KEEPCAPS = 7 +pkg syscall (linux-amd64), const PR_GET_NAME = 16 +pkg syscall (linux-amd64), const PR_GET_PDEATHSIG = 2 +pkg syscall (linux-amd64), const PR_GET_SECCOMP = 21 +pkg syscall (linux-amd64), const PR_GET_SECUREBITS = 27 +pkg syscall (linux-amd64), const PR_GET_TIMERSLACK = 30 +pkg syscall (linux-amd64), const PR_GET_TIMING = 13 +pkg syscall (linux-amd64), const PR_GET_TSC = 25 +pkg syscall (linux-amd64), const PR_GET_UNALIGN = 5 +pkg syscall (linux-amd64), const PR_MCE_KILL = 33 +pkg syscall (linux-amd64), const PR_MCE_KILL_CLEAR = 0 +pkg syscall (linux-amd64), const PR_MCE_KILL_DEFAULT = 2 +pkg syscall (linux-amd64), const PR_MCE_KILL_EARLY = 1 +pkg syscall (linux-amd64), const PR_MCE_KILL_GET = 34 +pkg syscall (linux-amd64), const PR_MCE_KILL_LATE = 0 +pkg syscall (linux-amd64), const PR_MCE_KILL_SET = 1 +pkg syscall (linux-amd64), const PR_SET_DUMPABLE = 4 +pkg syscall (linux-amd64), const PR_SET_ENDIAN = 20 +pkg syscall (linux-amd64), const PR_SET_FPEMU = 10 +pkg syscall (linux-amd64), const PR_SET_FPEXC = 12 +pkg syscall (linux-amd64), const PR_SET_KEEPCAPS = 8 +pkg syscall (linux-amd64), const PR_SET_NAME = 15 +pkg syscall (linux-amd64), const PR_SET_PDEATHSIG = 1 +pkg syscall (linux-amd64), const PR_SET_PTRACER = 1499557217 +pkg syscall (linux-amd64), const PR_SET_SECCOMP = 22 +pkg syscall (linux-amd64), const PR_SET_SECUREBITS = 28 +pkg syscall (linux-amd64), const PR_SET_TIMERSLACK = 29 +pkg syscall (linux-amd64), const PR_SET_TIMING = 14 +pkg syscall (linux-amd64), const PR_SET_TSC = 26 +pkg syscall (linux-amd64), const PR_SET_UNALIGN = 6 +pkg syscall (linux-amd64), const PR_TASK_PERF_EVENTS_DISABLE = 31 +pkg syscall (linux-amd64), const PR_TASK_PERF_EVENTS_ENABLE = 32 +pkg syscall (linux-amd64), const PR_TIMING_STATISTICAL = 0 +pkg syscall (linux-amd64), const PR_TIMING_TIMESTAMP = 1 +pkg syscall (linux-amd64), const PR_TSC_ENABLE = 1 +pkg syscall (linux-amd64), const PR_TSC_SIGSEGV = 2 +pkg syscall (linux-amd64), const PR_UNALIGN_NOPRINT = 1 +pkg syscall (linux-amd64), const PR_UNALIGN_SIGBUS = 2 +pkg syscall (linux-amd64), const PTRACE_ARCH_PRCTL = 30 +pkg syscall (linux-amd64), const PTRACE_ATTACH = 16 +pkg syscall (linux-amd64), const PTRACE_CONT = 7 +pkg syscall (linux-amd64), const PTRACE_DETACH = 17 +pkg syscall (linux-amd64), const PTRACE_EVENT_CLONE = 3 +pkg syscall (linux-amd64), const PTRACE_EVENT_EXEC = 4 +pkg syscall (linux-amd64), const PTRACE_EVENT_EXIT = 6 +pkg syscall (linux-amd64), const PTRACE_EVENT_FORK = 1 +pkg syscall (linux-amd64), const PTRACE_EVENT_VFORK = 2 +pkg syscall (linux-amd64), const PTRACE_EVENT_VFORK_DONE = 5 +pkg syscall (linux-amd64), const PTRACE_GETEVENTMSG = 16897 +pkg syscall (linux-amd64), const PTRACE_GETFPREGS = 14 +pkg syscall (linux-amd64), const PTRACE_GETFPXREGS = 18 +pkg syscall (linux-amd64), const PTRACE_GETREGS = 12 +pkg syscall (linux-amd64), const PTRACE_GETREGSET = 16900 +pkg syscall (linux-amd64), const PTRACE_GETSIGINFO = 16898 +pkg syscall (linux-amd64), const PTRACE_GET_THREAD_AREA = 25 +pkg syscall (linux-amd64), const PTRACE_KILL = 8 +pkg syscall (linux-amd64), const PTRACE_OLDSETOPTIONS = 21 +pkg syscall (linux-amd64), const PTRACE_O_MASK = 127 +pkg syscall (linux-amd64), const PTRACE_O_TRACECLONE = 8 +pkg syscall (linux-amd64), const PTRACE_O_TRACEEXEC = 16 +pkg syscall (linux-amd64), const PTRACE_O_TRACEEXIT = 64 +pkg syscall (linux-amd64), const PTRACE_O_TRACEFORK = 2 +pkg syscall (linux-amd64), const PTRACE_O_TRACESYSGOOD = 1 +pkg syscall (linux-amd64), const PTRACE_O_TRACEVFORK = 4 +pkg syscall (linux-amd64), const PTRACE_O_TRACEVFORKDONE = 32 +pkg syscall (linux-amd64), const PTRACE_PEEKDATA = 2 +pkg syscall (linux-amd64), const PTRACE_PEEKTEXT = 1 +pkg syscall (linux-amd64), const PTRACE_PEEKUSR = 3 +pkg syscall (linux-amd64), const PTRACE_POKEDATA = 5 +pkg syscall (linux-amd64), const PTRACE_POKETEXT = 4 +pkg syscall (linux-amd64), const PTRACE_POKEUSR = 6 +pkg syscall (linux-amd64), const PTRACE_SETFPREGS = 15 +pkg syscall (linux-amd64), const PTRACE_SETFPXREGS = 19 +pkg syscall (linux-amd64), const PTRACE_SETOPTIONS = 16896 +pkg syscall (linux-amd64), const PTRACE_SETREGS = 13 +pkg syscall (linux-amd64), const PTRACE_SETREGSET = 16901 +pkg syscall (linux-amd64), const PTRACE_SETSIGINFO = 16899 +pkg syscall (linux-amd64), const PTRACE_SET_THREAD_AREA = 26 +pkg syscall (linux-amd64), const PTRACE_SINGLEBLOCK = 33 +pkg syscall (linux-amd64), const PTRACE_SINGLESTEP = 9 +pkg syscall (linux-amd64), const PTRACE_SYSCALL = 24 +pkg syscall (linux-amd64), const PTRACE_SYSEMU = 31 +pkg syscall (linux-amd64), const PTRACE_SYSEMU_SINGLESTEP = 32 +pkg syscall (linux-amd64), const PTRACE_TRACEME = 0 +pkg syscall (linux-amd64), const PathMax = 4096 +pkg syscall (linux-amd64), const RLIMIT_AS = 9 +pkg syscall (linux-amd64), const RLIMIT_CORE = 4 +pkg syscall (linux-amd64), const RLIMIT_CPU = 0 +pkg syscall (linux-amd64), const RLIMIT_DATA = 2 +pkg syscall (linux-amd64), const RLIMIT_FSIZE = 1 +pkg syscall (linux-amd64), const RLIMIT_NOFILE = 7 +pkg syscall (linux-amd64), const RLIMIT_STACK = 3 +pkg syscall (linux-amd64), const RLIM_INFINITY = -1 +pkg syscall (linux-amd64), const RTAX_ADVMSS = 8 +pkg syscall (linux-amd64), const RTAX_CWND = 7 +pkg syscall (linux-amd64), const RTAX_FEATURES = 12 +pkg syscall (linux-amd64), const RTAX_FEATURE_ALLFRAG = 8 +pkg syscall (linux-amd64), const RTAX_FEATURE_ECN = 1 +pkg syscall (linux-amd64), const RTAX_FEATURE_SACK = 2 +pkg syscall (linux-amd64), const RTAX_FEATURE_TIMESTAMP = 4 +pkg syscall (linux-amd64), const RTAX_HOPLIMIT = 10 +pkg syscall (linux-amd64), const RTAX_INITCWND = 11 +pkg syscall (linux-amd64), const RTAX_INITRWND = 14 +pkg syscall (linux-amd64), const RTAX_LOCK = 1 +pkg syscall (linux-amd64), const RTAX_MAX = 14 +pkg syscall (linux-amd64), const RTAX_MTU = 2 +pkg syscall (linux-amd64), const RTAX_REORDERING = 9 +pkg syscall (linux-amd64), const RTAX_RTO_MIN = 13 +pkg syscall (linux-amd64), const RTAX_RTT = 4 +pkg syscall (linux-amd64), const RTAX_RTTVAR = 5 +pkg syscall (linux-amd64), const RTAX_SSTHRESH = 6 +pkg syscall (linux-amd64), const RTAX_UNSPEC = 0 +pkg syscall (linux-amd64), const RTAX_WINDOW = 3 +pkg syscall (linux-amd64), const RTA_ALIGNTO = 4 +pkg syscall (linux-amd64), const RTA_CACHEINFO = 12 +pkg syscall (linux-amd64), const RTA_DST = 1 +pkg syscall (linux-amd64), const RTA_FLOW = 11 +pkg syscall (linux-amd64), const RTA_GATEWAY = 5 +pkg syscall (linux-amd64), const RTA_IIF = 3 +pkg syscall (linux-amd64), const RTA_MAX = 16 +pkg syscall (linux-amd64), const RTA_METRICS = 8 +pkg syscall (linux-amd64), const RTA_MULTIPATH = 9 +pkg syscall (linux-amd64), const RTA_OIF = 4 +pkg syscall (linux-amd64), const RTA_PREFSRC = 7 +pkg syscall (linux-amd64), const RTA_PRIORITY = 6 +pkg syscall (linux-amd64), const RTA_SRC = 2 +pkg syscall (linux-amd64), const RTA_TABLE = 15 +pkg syscall (linux-amd64), const RTA_UNSPEC = 0 +pkg syscall (linux-amd64), const RTCF_DIRECTSRC = 67108864 +pkg syscall (linux-amd64), const RTCF_DOREDIRECT = 16777216 +pkg syscall (linux-amd64), const RTCF_LOG = 33554432 +pkg syscall (linux-amd64), const RTCF_MASQ = 4194304 +pkg syscall (linux-amd64), const RTCF_NAT = 8388608 +pkg syscall (linux-amd64), const RTCF_VALVE = 2097152 +pkg syscall (linux-amd64), const RTF_ADDRCLASSMASK = 4160749568 +pkg syscall (linux-amd64), const RTF_ADDRCONF = 262144 +pkg syscall (linux-amd64), const RTF_ALLONLINK = 131072 +pkg syscall (linux-amd64), const RTF_BROADCAST = 268435456 +pkg syscall (linux-amd64), const RTF_CACHE = 16777216 +pkg syscall (linux-amd64), const RTF_DEFAULT = 65536 +pkg syscall (linux-amd64), const RTF_DYNAMIC = 16 +pkg syscall (linux-amd64), const RTF_FLOW = 33554432 +pkg syscall (linux-amd64), const RTF_GATEWAY = 2 +pkg syscall (linux-amd64), const RTF_HOST = 4 +pkg syscall (linux-amd64), const RTF_INTERFACE = 1073741824 +pkg syscall (linux-amd64), const RTF_IRTT = 256 +pkg syscall (linux-amd64), const RTF_LINKRT = 1048576 +pkg syscall (linux-amd64), const RTF_LOCAL = 2147483648 +pkg syscall (linux-amd64), const RTF_MODIFIED = 32 +pkg syscall (linux-amd64), const RTF_MSS = 64 +pkg syscall (linux-amd64), const RTF_MTU = 64 +pkg syscall (linux-amd64), const RTF_MULTICAST = 536870912 +pkg syscall (linux-amd64), const RTF_NAT = 134217728 +pkg syscall (linux-amd64), const RTF_NOFORWARD = 4096 +pkg syscall (linux-amd64), const RTF_NONEXTHOP = 2097152 +pkg syscall (linux-amd64), const RTF_NOPMTUDISC = 16384 +pkg syscall (linux-amd64), const RTF_POLICY = 67108864 +pkg syscall (linux-amd64), const RTF_REINSTATE = 8 +pkg syscall (linux-amd64), const RTF_REJECT = 512 +pkg syscall (linux-amd64), const RTF_STATIC = 1024 +pkg syscall (linux-amd64), const RTF_THROW = 8192 +pkg syscall (linux-amd64), const RTF_UP = 1 +pkg syscall (linux-amd64), const RTF_WINDOW = 128 +pkg syscall (linux-amd64), const RTF_XRESOLVE = 2048 +pkg syscall (linux-amd64), const RTM_BASE = 16 +pkg syscall (linux-amd64), const RTM_DELACTION = 49 +pkg syscall (linux-amd64), const RTM_DELADDR = 21 +pkg syscall (linux-amd64), const RTM_DELADDRLABEL = 73 +pkg syscall (linux-amd64), const RTM_DELLINK = 17 +pkg syscall (linux-amd64), const RTM_DELNEIGH = 29 +pkg syscall (linux-amd64), const RTM_DELQDISC = 37 +pkg syscall (linux-amd64), const RTM_DELROUTE = 25 +pkg syscall (linux-amd64), const RTM_DELRULE = 33 +pkg syscall (linux-amd64), const RTM_DELTCLASS = 41 +pkg syscall (linux-amd64), const RTM_DELTFILTER = 45 +pkg syscall (linux-amd64), const RTM_F_CLONED = 512 +pkg syscall (linux-amd64), const RTM_F_EQUALIZE = 1024 +pkg syscall (linux-amd64), const RTM_F_NOTIFY = 256 +pkg syscall (linux-amd64), const RTM_F_PREFIX = 2048 +pkg syscall (linux-amd64), const RTM_GETACTION = 50 +pkg syscall (linux-amd64), const RTM_GETADDR = 22 +pkg syscall (linux-amd64), const RTM_GETADDRLABEL = 74 +pkg syscall (linux-amd64), const RTM_GETANYCAST = 62 +pkg syscall (linux-amd64), const RTM_GETDCB = 78 +pkg syscall (linux-amd64), const RTM_GETLINK = 18 +pkg syscall (linux-amd64), const RTM_GETMULTICAST = 58 +pkg syscall (linux-amd64), const RTM_GETNEIGH = 30 +pkg syscall (linux-amd64), const RTM_GETNEIGHTBL = 66 +pkg syscall (linux-amd64), const RTM_GETQDISC = 38 +pkg syscall (linux-amd64), const RTM_GETROUTE = 26 +pkg syscall (linux-amd64), const RTM_GETRULE = 34 +pkg syscall (linux-amd64), const RTM_GETTCLASS = 42 +pkg syscall (linux-amd64), const RTM_GETTFILTER = 46 +pkg syscall (linux-amd64), const RTM_MAX = 79 +pkg syscall (linux-amd64), const RTM_NEWACTION = 48 +pkg syscall (linux-amd64), const RTM_NEWADDR = 20 +pkg syscall (linux-amd64), const RTM_NEWADDRLABEL = 72 +pkg syscall (linux-amd64), const RTM_NEWLINK = 16 +pkg syscall (linux-amd64), const RTM_NEWNDUSEROPT = 68 +pkg syscall (linux-amd64), const RTM_NEWNEIGH = 28 +pkg syscall (linux-amd64), const RTM_NEWNEIGHTBL = 64 +pkg syscall (linux-amd64), const RTM_NEWPREFIX = 52 +pkg syscall (linux-amd64), const RTM_NEWQDISC = 36 +pkg syscall (linux-amd64), const RTM_NEWROUTE = 24 +pkg syscall (linux-amd64), const RTM_NEWRULE = 32 +pkg syscall (linux-amd64), const RTM_NEWTCLASS = 40 +pkg syscall (linux-amd64), const RTM_NEWTFILTER = 44 +pkg syscall (linux-amd64), const RTM_NR_FAMILIES = 16 +pkg syscall (linux-amd64), const RTM_NR_MSGTYPES = 64 +pkg syscall (linux-amd64), const RTM_SETDCB = 79 +pkg syscall (linux-amd64), const RTM_SETLINK = 19 +pkg syscall (linux-amd64), const RTM_SETNEIGHTBL = 67 +pkg syscall (linux-amd64), const RTNH_ALIGNTO = 4 +pkg syscall (linux-amd64), const RTNH_F_DEAD = 1 +pkg syscall (linux-amd64), const RTNH_F_ONLINK = 4 +pkg syscall (linux-amd64), const RTNH_F_PERVASIVE = 2 +pkg syscall (linux-amd64), const RTNLGRP_IPV4_IFADDR = 5 +pkg syscall (linux-amd64), const RTNLGRP_IPV4_IFADDR ideal-int +pkg syscall (linux-amd64), const RTNLGRP_IPV4_MROUTE = 6 +pkg syscall (linux-amd64), const RTNLGRP_IPV4_MROUTE ideal-int +pkg syscall (linux-amd64), const RTNLGRP_IPV4_ROUTE = 7 +pkg syscall (linux-amd64), const RTNLGRP_IPV4_ROUTE ideal-int +pkg syscall (linux-amd64), const RTNLGRP_IPV4_RULE = 8 +pkg syscall (linux-amd64), const RTNLGRP_IPV4_RULE ideal-int +pkg syscall (linux-amd64), const RTNLGRP_IPV6_IFADDR = 9 +pkg syscall (linux-amd64), const RTNLGRP_IPV6_IFADDR ideal-int +pkg syscall (linux-amd64), const RTNLGRP_IPV6_IFINFO = 12 +pkg syscall (linux-amd64), const RTNLGRP_IPV6_IFINFO ideal-int +pkg syscall (linux-amd64), const RTNLGRP_IPV6_MROUTE = 10 +pkg syscall (linux-amd64), const RTNLGRP_IPV6_MROUTE ideal-int +pkg syscall (linux-amd64), const RTNLGRP_IPV6_PREFIX = 18 +pkg syscall (linux-amd64), const RTNLGRP_IPV6_PREFIX ideal-int +pkg syscall (linux-amd64), const RTNLGRP_IPV6_ROUTE = 11 +pkg syscall (linux-amd64), const RTNLGRP_IPV6_ROUTE ideal-int +pkg syscall (linux-amd64), const RTNLGRP_IPV6_RULE = 19 +pkg syscall (linux-amd64), const RTNLGRP_IPV6_RULE ideal-int +pkg syscall (linux-amd64), const RTNLGRP_LINK = 1 +pkg syscall (linux-amd64), const RTNLGRP_LINK ideal-int +pkg syscall (linux-amd64), const RTNLGRP_ND_USEROPT = 20 +pkg syscall (linux-amd64), const RTNLGRP_ND_USEROPT ideal-int +pkg syscall (linux-amd64), const RTNLGRP_NEIGH = 3 +pkg syscall (linux-amd64), const RTNLGRP_NEIGH ideal-int +pkg syscall (linux-amd64), const RTNLGRP_NONE = 0 +pkg syscall (linux-amd64), const RTNLGRP_NONE ideal-int +pkg syscall (linux-amd64), const RTNLGRP_NOTIFY = 2 +pkg syscall (linux-amd64), const RTNLGRP_NOTIFY ideal-int +pkg syscall (linux-amd64), const RTNLGRP_TC = 4 +pkg syscall (linux-amd64), const RTNLGRP_TC ideal-int +pkg syscall (linux-amd64), const RTN_ANYCAST = 4 +pkg syscall (linux-amd64), const RTN_BLACKHOLE = 6 +pkg syscall (linux-amd64), const RTN_BROADCAST = 3 +pkg syscall (linux-amd64), const RTN_LOCAL = 2 +pkg syscall (linux-amd64), const RTN_MAX = 11 +pkg syscall (linux-amd64), const RTN_MULTICAST = 5 +pkg syscall (linux-amd64), const RTN_NAT = 10 +pkg syscall (linux-amd64), const RTN_PROHIBIT = 8 +pkg syscall (linux-amd64), const RTN_THROW = 9 +pkg syscall (linux-amd64), const RTN_UNICAST = 1 +pkg syscall (linux-amd64), const RTN_UNREACHABLE = 7 +pkg syscall (linux-amd64), const RTN_UNSPEC = 0 +pkg syscall (linux-amd64), const RTN_XRESOLVE = 11 +pkg syscall (linux-amd64), const RTPROT_BIRD = 12 +pkg syscall (linux-amd64), const RTPROT_BOOT = 3 +pkg syscall (linux-amd64), const RTPROT_DHCP = 16 +pkg syscall (linux-amd64), const RTPROT_DNROUTED = 13 +pkg syscall (linux-amd64), const RTPROT_GATED = 8 +pkg syscall (linux-amd64), const RTPROT_KERNEL = 2 +pkg syscall (linux-amd64), const RTPROT_MRT = 10 +pkg syscall (linux-amd64), const RTPROT_NTK = 15 +pkg syscall (linux-amd64), const RTPROT_RA = 9 +pkg syscall (linux-amd64), const RTPROT_REDIRECT = 1 +pkg syscall (linux-amd64), const RTPROT_STATIC = 4 +pkg syscall (linux-amd64), const RTPROT_UNSPEC = 0 +pkg syscall (linux-amd64), const RTPROT_XORP = 14 +pkg syscall (linux-amd64), const RTPROT_ZEBRA = 11 +pkg syscall (linux-amd64), const RT_CLASS_DEFAULT = 253 +pkg syscall (linux-amd64), const RT_CLASS_LOCAL = 255 +pkg syscall (linux-amd64), const RT_CLASS_MAIN = 254 +pkg syscall (linux-amd64), const RT_CLASS_MAX = 255 +pkg syscall (linux-amd64), const RT_CLASS_UNSPEC = 0 +pkg syscall (linux-amd64), const RT_SCOPE_HOST = 254 +pkg syscall (linux-amd64), const RT_SCOPE_LINK = 253 +pkg syscall (linux-amd64), const RT_SCOPE_NOWHERE = 255 +pkg syscall (linux-amd64), const RT_SCOPE_SITE = 200 +pkg syscall (linux-amd64), const RT_SCOPE_UNIVERSE = 0 +pkg syscall (linux-amd64), const RT_TABLE_COMPAT = 252 +pkg syscall (linux-amd64), const RT_TABLE_DEFAULT = 253 +pkg syscall (linux-amd64), const RT_TABLE_LOCAL = 255 +pkg syscall (linux-amd64), const RT_TABLE_MAIN = 254 +pkg syscall (linux-amd64), const RT_TABLE_MAX = 4294967295 +pkg syscall (linux-amd64), const RT_TABLE_UNSPEC = 0 +pkg syscall (linux-amd64), const RUSAGE_CHILDREN = -1 +pkg syscall (linux-amd64), const RUSAGE_SELF = 0 +pkg syscall (linux-amd64), const RUSAGE_THREAD = 1 +pkg syscall (linux-amd64), const SCM_CREDENTIALS = 2 +pkg syscall (linux-amd64), const SCM_RIGHTS = 1 +pkg syscall (linux-amd64), const SCM_TIMESTAMP = 29 +pkg syscall (linux-amd64), const SCM_TIMESTAMPING = 37 +pkg syscall (linux-amd64), const SCM_TIMESTAMPNS = 35 +pkg syscall (linux-amd64), const SIGBUS = 7 +pkg syscall (linux-amd64), const SIGCHLD = 17 +pkg syscall (linux-amd64), const SIGCLD = 17 +pkg syscall (linux-amd64), const SIGCONT = 18 +pkg syscall (linux-amd64), const SIGIO = 29 +pkg syscall (linux-amd64), const SIGIOT = 6 +pkg syscall (linux-amd64), const SIGPOLL = 29 +pkg syscall (linux-amd64), const SIGPROF = 27 +pkg syscall (linux-amd64), const SIGPWR = 30 +pkg syscall (linux-amd64), const SIGSTKFLT = 16 +pkg syscall (linux-amd64), const SIGSTOP = 19 +pkg syscall (linux-amd64), const SIGSYS = 31 +pkg syscall (linux-amd64), const SIGTSTP = 20 +pkg syscall (linux-amd64), const SIGTTIN = 21 +pkg syscall (linux-amd64), const SIGTTOU = 22 +pkg syscall (linux-amd64), const SIGUNUSED = 31 +pkg syscall (linux-amd64), const SIGURG = 23 +pkg syscall (linux-amd64), const SIGUSR1 = 10 +pkg syscall (linux-amd64), const SIGUSR2 = 12 +pkg syscall (linux-amd64), const SIGVTALRM = 26 +pkg syscall (linux-amd64), const SIGWINCH = 28 +pkg syscall (linux-amd64), const SIGXCPU = 24 +pkg syscall (linux-amd64), const SIGXFSZ = 25 +pkg syscall (linux-amd64), const SIOCADDDLCI = 35200 +pkg syscall (linux-amd64), const SIOCADDMULTI = 35121 +pkg syscall (linux-amd64), const SIOCADDRT = 35083 +pkg syscall (linux-amd64), const SIOCATMARK = 35077 +pkg syscall (linux-amd64), const SIOCDARP = 35155 +pkg syscall (linux-amd64), const SIOCDELDLCI = 35201 +pkg syscall (linux-amd64), const SIOCDELMULTI = 35122 +pkg syscall (linux-amd64), const SIOCDELRT = 35084 +pkg syscall (linux-amd64), const SIOCDEVPRIVATE = 35312 +pkg syscall (linux-amd64), const SIOCDIFADDR = 35126 +pkg syscall (linux-amd64), const SIOCDRARP = 35168 +pkg syscall (linux-amd64), const SIOCGARP = 35156 +pkg syscall (linux-amd64), const SIOCGIFADDR = 35093 +pkg syscall (linux-amd64), const SIOCGIFBR = 35136 +pkg syscall (linux-amd64), const SIOCGIFBRDADDR = 35097 +pkg syscall (linux-amd64), const SIOCGIFCONF = 35090 +pkg syscall (linux-amd64), const SIOCGIFCOUNT = 35128 +pkg syscall (linux-amd64), const SIOCGIFDSTADDR = 35095 +pkg syscall (linux-amd64), const SIOCGIFENCAP = 35109 +pkg syscall (linux-amd64), const SIOCGIFFLAGS = 35091 +pkg syscall (linux-amd64), const SIOCGIFHWADDR = 35111 +pkg syscall (linux-amd64), const SIOCGIFINDEX = 35123 +pkg syscall (linux-amd64), const SIOCGIFMAP = 35184 +pkg syscall (linux-amd64), const SIOCGIFMEM = 35103 +pkg syscall (linux-amd64), const SIOCGIFMETRIC = 35101 +pkg syscall (linux-amd64), const SIOCGIFMTU = 35105 +pkg syscall (linux-amd64), const SIOCGIFNAME = 35088 +pkg syscall (linux-amd64), const SIOCGIFNETMASK = 35099 +pkg syscall (linux-amd64), const SIOCGIFPFLAGS = 35125 +pkg syscall (linux-amd64), const SIOCGIFSLAVE = 35113 +pkg syscall (linux-amd64), const SIOCGIFTXQLEN = 35138 +pkg syscall (linux-amd64), const SIOCGPGRP = 35076 +pkg syscall (linux-amd64), const SIOCGRARP = 35169 +pkg syscall (linux-amd64), const SIOCGSTAMP = 35078 +pkg syscall (linux-amd64), const SIOCGSTAMPNS = 35079 +pkg syscall (linux-amd64), const SIOCPROTOPRIVATE = 35296 +pkg syscall (linux-amd64), const SIOCRTMSG = 35085 +pkg syscall (linux-amd64), const SIOCSARP = 35157 +pkg syscall (linux-amd64), const SIOCSIFADDR = 35094 +pkg syscall (linux-amd64), const SIOCSIFBR = 35137 +pkg syscall (linux-amd64), const SIOCSIFBRDADDR = 35098 +pkg syscall (linux-amd64), const SIOCSIFDSTADDR = 35096 +pkg syscall (linux-amd64), const SIOCSIFENCAP = 35110 +pkg syscall (linux-amd64), const SIOCSIFFLAGS = 35092 +pkg syscall (linux-amd64), const SIOCSIFHWADDR = 35108 +pkg syscall (linux-amd64), const SIOCSIFHWBROADCAST = 35127 +pkg syscall (linux-amd64), const SIOCSIFLINK = 35089 +pkg syscall (linux-amd64), const SIOCSIFMAP = 35185 +pkg syscall (linux-amd64), const SIOCSIFMEM = 35104 +pkg syscall (linux-amd64), const SIOCSIFMETRIC = 35102 +pkg syscall (linux-amd64), const SIOCSIFMTU = 35106 +pkg syscall (linux-amd64), const SIOCSIFNAME = 35107 +pkg syscall (linux-amd64), const SIOCSIFNETMASK = 35100 +pkg syscall (linux-amd64), const SIOCSIFPFLAGS = 35124 +pkg syscall (linux-amd64), const SIOCSIFSLAVE = 35120 +pkg syscall (linux-amd64), const SIOCSIFTXQLEN = 35139 +pkg syscall (linux-amd64), const SIOCSPGRP = 35074 +pkg syscall (linux-amd64), const SIOCSRARP = 35170 +pkg syscall (linux-amd64), const SOCK_CLOEXEC = 524288 +pkg syscall (linux-amd64), const SOCK_DCCP = 6 +pkg syscall (linux-amd64), const SOCK_NONBLOCK = 2048 +pkg syscall (linux-amd64), const SOCK_PACKET = 10 +pkg syscall (linux-amd64), const SOCK_RDM = 4 +pkg syscall (linux-amd64), const SOL_AAL = 265 +pkg syscall (linux-amd64), const SOL_ATM = 264 +pkg syscall (linux-amd64), const SOL_DECNET = 261 +pkg syscall (linux-amd64), const SOL_ICMPV6 = 58 +pkg syscall (linux-amd64), const SOL_IP = 0 +pkg syscall (linux-amd64), const SOL_IPV6 = 41 +pkg syscall (linux-amd64), const SOL_IRDA = 266 +pkg syscall (linux-amd64), const SOL_PACKET = 263 +pkg syscall (linux-amd64), const SOL_RAW = 255 +pkg syscall (linux-amd64), const SOL_SOCKET = 1 +pkg syscall (linux-amd64), const SOL_TCP = 6 +pkg syscall (linux-amd64), const SOL_X25 = 262 +pkg syscall (linux-amd64), const SOMAXCONN = 128 +pkg syscall (linux-amd64), const SO_ACCEPTCONN = 30 +pkg syscall (linux-amd64), const SO_ATTACH_FILTER = 26 +pkg syscall (linux-amd64), const SO_BINDTODEVICE = 25 +pkg syscall (linux-amd64), const SO_BROADCAST = 6 +pkg syscall (linux-amd64), const SO_BSDCOMPAT = 14 +pkg syscall (linux-amd64), const SO_DEBUG = 1 +pkg syscall (linux-amd64), const SO_DETACH_FILTER = 27 +pkg syscall (linux-amd64), const SO_DOMAIN = 39 +pkg syscall (linux-amd64), const SO_DONTROUTE = 5 +pkg syscall (linux-amd64), const SO_ERROR = 4 +pkg syscall (linux-amd64), const SO_KEEPALIVE = 9 +pkg syscall (linux-amd64), const SO_LINGER = 13 +pkg syscall (linux-amd64), const SO_MARK = 36 +pkg syscall (linux-amd64), const SO_NO_CHECK = 11 +pkg syscall (linux-amd64), const SO_OOBINLINE = 10 +pkg syscall (linux-amd64), const SO_PASSCRED = 16 +pkg syscall (linux-amd64), const SO_PASSSEC = 34 +pkg syscall (linux-amd64), const SO_PEERCRED = 17 +pkg syscall (linux-amd64), const SO_PEERNAME = 28 +pkg syscall (linux-amd64), const SO_PEERSEC = 31 +pkg syscall (linux-amd64), const SO_PRIORITY = 12 +pkg syscall (linux-amd64), const SO_PROTOCOL = 38 +pkg syscall (linux-amd64), const SO_RCVBUF = 8 +pkg syscall (linux-amd64), const SO_RCVBUFFORCE = 33 +pkg syscall (linux-amd64), const SO_RCVLOWAT = 18 +pkg syscall (linux-amd64), const SO_RCVTIMEO = 20 +pkg syscall (linux-amd64), const SO_REUSEADDR = 2 +pkg syscall (linux-amd64), const SO_RXQ_OVFL = 40 +pkg syscall (linux-amd64), const SO_SECURITY_AUTHENTICATION = 22 +pkg syscall (linux-amd64), const SO_SECURITY_ENCRYPTION_NETWORK = 24 +pkg syscall (linux-amd64), const SO_SECURITY_ENCRYPTION_TRANSPORT = 23 +pkg syscall (linux-amd64), const SO_SNDBUF = 7 +pkg syscall (linux-amd64), const SO_SNDBUFFORCE = 32 +pkg syscall (linux-amd64), const SO_SNDLOWAT = 19 +pkg syscall (linux-amd64), const SO_SNDTIMEO = 21 +pkg syscall (linux-amd64), const SO_TIMESTAMP = 29 +pkg syscall (linux-amd64), const SO_TIMESTAMPING = 37 +pkg syscall (linux-amd64), const SO_TIMESTAMPNS = 35 +pkg syscall (linux-amd64), const SO_TYPE = 3 +pkg syscall (linux-amd64), const SYS_ACCEPT = 43 +pkg syscall (linux-amd64), const SYS_ACCEPT4 = 288 +pkg syscall (linux-amd64), const SYS_ACCESS = 21 +pkg syscall (linux-amd64), const SYS_ACCT = 163 +pkg syscall (linux-amd64), const SYS_ADD_KEY = 248 +pkg syscall (linux-amd64), const SYS_ADJTIMEX = 159 +pkg syscall (linux-amd64), const SYS_AFS_SYSCALL = 183 +pkg syscall (linux-amd64), const SYS_ALARM = 37 +pkg syscall (linux-amd64), const SYS_ARCH_PRCTL = 158 +pkg syscall (linux-amd64), const SYS_BIND = 49 +pkg syscall (linux-amd64), const SYS_BRK = 12 +pkg syscall (linux-amd64), const SYS_CAPGET = 125 +pkg syscall (linux-amd64), const SYS_CAPSET = 126 +pkg syscall (linux-amd64), const SYS_CHDIR = 80 +pkg syscall (linux-amd64), const SYS_CHMOD = 90 +pkg syscall (linux-amd64), const SYS_CHOWN = 92 +pkg syscall (linux-amd64), const SYS_CHROOT = 161 +pkg syscall (linux-amd64), const SYS_CLOCK_GETRES = 229 +pkg syscall (linux-amd64), const SYS_CLOCK_GETTIME = 228 +pkg syscall (linux-amd64), const SYS_CLOCK_NANOSLEEP = 230 +pkg syscall (linux-amd64), const SYS_CLOCK_SETTIME = 227 +pkg syscall (linux-amd64), const SYS_CLONE = 56 +pkg syscall (linux-amd64), const SYS_CLOSE = 3 +pkg syscall (linux-amd64), const SYS_CONNECT = 42 +pkg syscall (linux-amd64), const SYS_CREAT = 85 +pkg syscall (linux-amd64), const SYS_CREATE_MODULE = 174 +pkg syscall (linux-amd64), const SYS_DELETE_MODULE = 176 +pkg syscall (linux-amd64), const SYS_DUP = 32 +pkg syscall (linux-amd64), const SYS_DUP2 = 33 +pkg syscall (linux-amd64), const SYS_DUP3 = 292 +pkg syscall (linux-amd64), const SYS_EPOLL_CREATE = 213 +pkg syscall (linux-amd64), const SYS_EPOLL_CREATE1 = 291 +pkg syscall (linux-amd64), const SYS_EPOLL_CTL = 233 +pkg syscall (linux-amd64), const SYS_EPOLL_CTL_OLD = 214 +pkg syscall (linux-amd64), const SYS_EPOLL_PWAIT = 281 +pkg syscall (linux-amd64), const SYS_EPOLL_WAIT = 232 +pkg syscall (linux-amd64), const SYS_EPOLL_WAIT_OLD = 215 +pkg syscall (linux-amd64), const SYS_EVENTFD = 284 +pkg syscall (linux-amd64), const SYS_EVENTFD2 = 290 +pkg syscall (linux-amd64), const SYS_EXECVE = 59 +pkg syscall (linux-amd64), const SYS_EXIT = 60 +pkg syscall (linux-amd64), const SYS_EXIT_GROUP = 231 +pkg syscall (linux-amd64), const SYS_FACCESSAT = 269 +pkg syscall (linux-amd64), const SYS_FADVISE64 = 221 +pkg syscall (linux-amd64), const SYS_FALLOCATE = 285 +pkg syscall (linux-amd64), const SYS_FANOTIFY_INIT = 300 +pkg syscall (linux-amd64), const SYS_FANOTIFY_MARK = 301 +pkg syscall (linux-amd64), const SYS_FCHDIR = 81 +pkg syscall (linux-amd64), const SYS_FCHMOD = 91 +pkg syscall (linux-amd64), const SYS_FCHMODAT = 268 +pkg syscall (linux-amd64), const SYS_FCHOWN = 93 +pkg syscall (linux-amd64), const SYS_FCHOWNAT = 260 +pkg syscall (linux-amd64), const SYS_FCNTL = 72 +pkg syscall (linux-amd64), const SYS_FDATASYNC = 75 +pkg syscall (linux-amd64), const SYS_FGETXATTR = 193 +pkg syscall (linux-amd64), const SYS_FLISTXATTR = 196 +pkg syscall (linux-amd64), const SYS_FLOCK = 73 +pkg syscall (linux-amd64), const SYS_FORK = 57 +pkg syscall (linux-amd64), const SYS_FREMOVEXATTR = 199 +pkg syscall (linux-amd64), const SYS_FSETXATTR = 190 +pkg syscall (linux-amd64), const SYS_FSTAT = 5 +pkg syscall (linux-amd64), const SYS_FSTATFS = 138 +pkg syscall (linux-amd64), const SYS_FSYNC = 74 +pkg syscall (linux-amd64), const SYS_FTRUNCATE = 77 +pkg syscall (linux-amd64), const SYS_FUTEX = 202 +pkg syscall (linux-amd64), const SYS_FUTIMESAT = 261 +pkg syscall (linux-amd64), const SYS_GETCWD = 79 +pkg syscall (linux-amd64), const SYS_GETDENTS = 78 +pkg syscall (linux-amd64), const SYS_GETDENTS64 = 217 +pkg syscall (linux-amd64), const SYS_GETEGID = 108 +pkg syscall (linux-amd64), const SYS_GETEUID = 107 +pkg syscall (linux-amd64), const SYS_GETGID = 104 +pkg syscall (linux-amd64), const SYS_GETGROUPS = 115 +pkg syscall (linux-amd64), const SYS_GETITIMER = 36 +pkg syscall (linux-amd64), const SYS_GETPEERNAME = 52 +pkg syscall (linux-amd64), const SYS_GETPGID = 121 +pkg syscall (linux-amd64), const SYS_GETPGRP = 111 +pkg syscall (linux-amd64), const SYS_GETPID = 39 +pkg syscall (linux-amd64), const SYS_GETPMSG = 181 +pkg syscall (linux-amd64), const SYS_GETPPID = 110 +pkg syscall (linux-amd64), const SYS_GETPRIORITY = 140 +pkg syscall (linux-amd64), const SYS_GETRESGID = 120 +pkg syscall (linux-amd64), const SYS_GETRESUID = 118 +pkg syscall (linux-amd64), const SYS_GETRLIMIT = 97 +pkg syscall (linux-amd64), const SYS_GETRUSAGE = 98 +pkg syscall (linux-amd64), const SYS_GETSID = 124 +pkg syscall (linux-amd64), const SYS_GETSOCKNAME = 51 +pkg syscall (linux-amd64), const SYS_GETSOCKOPT = 55 +pkg syscall (linux-amd64), const SYS_GETTID = 186 +pkg syscall (linux-amd64), const SYS_GETTIMEOFDAY = 96 +pkg syscall (linux-amd64), const SYS_GETUID = 102 +pkg syscall (linux-amd64), const SYS_GETXATTR = 191 +pkg syscall (linux-amd64), const SYS_GET_KERNEL_SYMS = 177 +pkg syscall (linux-amd64), const SYS_GET_MEMPOLICY = 239 +pkg syscall (linux-amd64), const SYS_GET_ROBUST_LIST = 274 +pkg syscall (linux-amd64), const SYS_GET_THREAD_AREA = 211 +pkg syscall (linux-amd64), const SYS_INIT_MODULE = 175 +pkg syscall (linux-amd64), const SYS_INOTIFY_ADD_WATCH = 254 +pkg syscall (linux-amd64), const SYS_INOTIFY_INIT = 253 +pkg syscall (linux-amd64), const SYS_INOTIFY_INIT1 = 294 +pkg syscall (linux-amd64), const SYS_INOTIFY_RM_WATCH = 255 +pkg syscall (linux-amd64), const SYS_IOCTL = 16 +pkg syscall (linux-amd64), const SYS_IOPERM = 173 +pkg syscall (linux-amd64), const SYS_IOPL = 172 +pkg syscall (linux-amd64), const SYS_IOPRIO_GET = 252 +pkg syscall (linux-amd64), const SYS_IOPRIO_SET = 251 +pkg syscall (linux-amd64), const SYS_IO_CANCEL = 210 +pkg syscall (linux-amd64), const SYS_IO_DESTROY = 207 +pkg syscall (linux-amd64), const SYS_IO_GETEVENTS = 208 +pkg syscall (linux-amd64), const SYS_IO_SETUP = 206 +pkg syscall (linux-amd64), const SYS_IO_SUBMIT = 209 +pkg syscall (linux-amd64), const SYS_KEXEC_LOAD = 246 +pkg syscall (linux-amd64), const SYS_KEYCTL = 250 +pkg syscall (linux-amd64), const SYS_KILL = 62 +pkg syscall (linux-amd64), const SYS_LCHOWN = 94 +pkg syscall (linux-amd64), const SYS_LGETXATTR = 192 +pkg syscall (linux-amd64), const SYS_LINK = 86 +pkg syscall (linux-amd64), const SYS_LINKAT = 265 +pkg syscall (linux-amd64), const SYS_LISTEN = 50 +pkg syscall (linux-amd64), const SYS_LISTXATTR = 194 +pkg syscall (linux-amd64), const SYS_LLISTXATTR = 195 +pkg syscall (linux-amd64), const SYS_LOOKUP_DCOOKIE = 212 +pkg syscall (linux-amd64), const SYS_LREMOVEXATTR = 198 +pkg syscall (linux-amd64), const SYS_LSEEK = 8 +pkg syscall (linux-amd64), const SYS_LSETXATTR = 189 +pkg syscall (linux-amd64), const SYS_LSTAT = 6 +pkg syscall (linux-amd64), const SYS_MADVISE = 28 +pkg syscall (linux-amd64), const SYS_MBIND = 237 +pkg syscall (linux-amd64), const SYS_MIGRATE_PAGES = 256 +pkg syscall (linux-amd64), const SYS_MINCORE = 27 +pkg syscall (linux-amd64), const SYS_MKDIR = 83 +pkg syscall (linux-amd64), const SYS_MKDIRAT = 258 +pkg syscall (linux-amd64), const SYS_MKNOD = 133 +pkg syscall (linux-amd64), const SYS_MKNODAT = 259 +pkg syscall (linux-amd64), const SYS_MLOCK = 149 +pkg syscall (linux-amd64), const SYS_MLOCKALL = 151 +pkg syscall (linux-amd64), const SYS_MMAP = 9 +pkg syscall (linux-amd64), const SYS_MODIFY_LDT = 154 +pkg syscall (linux-amd64), const SYS_MOUNT = 165 +pkg syscall (linux-amd64), const SYS_MOVE_PAGES = 279 +pkg syscall (linux-amd64), const SYS_MPROTECT = 10 +pkg syscall (linux-amd64), const SYS_MQ_GETSETATTR = 245 +pkg syscall (linux-amd64), const SYS_MQ_NOTIFY = 244 +pkg syscall (linux-amd64), const SYS_MQ_OPEN = 240 +pkg syscall (linux-amd64), const SYS_MQ_TIMEDRECEIVE = 243 +pkg syscall (linux-amd64), const SYS_MQ_TIMEDSEND = 242 +pkg syscall (linux-amd64), const SYS_MQ_UNLINK = 241 +pkg syscall (linux-amd64), const SYS_MREMAP = 25 +pkg syscall (linux-amd64), const SYS_MSGCTL = 71 +pkg syscall (linux-amd64), const SYS_MSGGET = 68 +pkg syscall (linux-amd64), const SYS_MSGRCV = 70 +pkg syscall (linux-amd64), const SYS_MSGSND = 69 +pkg syscall (linux-amd64), const SYS_MSYNC = 26 +pkg syscall (linux-amd64), const SYS_MUNLOCK = 150 +pkg syscall (linux-amd64), const SYS_MUNLOCKALL = 152 +pkg syscall (linux-amd64), const SYS_MUNMAP = 11 +pkg syscall (linux-amd64), const SYS_NANOSLEEP = 35 +pkg syscall (linux-amd64), const SYS_NEWFSTATAT = 262 +pkg syscall (linux-amd64), const SYS_NFSSERVCTL = 180 +pkg syscall (linux-amd64), const SYS_OPEN = 2 +pkg syscall (linux-amd64), const SYS_OPENAT = 257 +pkg syscall (linux-amd64), const SYS_PAUSE = 34 +pkg syscall (linux-amd64), const SYS_PERF_EVENT_OPEN = 298 +pkg syscall (linux-amd64), const SYS_PERSONALITY = 135 +pkg syscall (linux-amd64), const SYS_PIPE = 22 +pkg syscall (linux-amd64), const SYS_PIPE2 = 293 +pkg syscall (linux-amd64), const SYS_PIVOT_ROOT = 155 +pkg syscall (linux-amd64), const SYS_POLL = 7 +pkg syscall (linux-amd64), const SYS_PPOLL = 271 +pkg syscall (linux-amd64), const SYS_PRCTL = 157 +pkg syscall (linux-amd64), const SYS_PREAD64 = 17 +pkg syscall (linux-amd64), const SYS_PREADV = 295 +pkg syscall (linux-amd64), const SYS_PRLIMIT64 = 302 +pkg syscall (linux-amd64), const SYS_PSELECT6 = 270 +pkg syscall (linux-amd64), const SYS_PTRACE = 101 +pkg syscall (linux-amd64), const SYS_PUTPMSG = 182 +pkg syscall (linux-amd64), const SYS_PWRITE64 = 18 +pkg syscall (linux-amd64), const SYS_PWRITEV = 296 +pkg syscall (linux-amd64), const SYS_QUERY_MODULE = 178 +pkg syscall (linux-amd64), const SYS_QUOTACTL = 179 +pkg syscall (linux-amd64), const SYS_READ = 0 +pkg syscall (linux-amd64), const SYS_READAHEAD = 187 +pkg syscall (linux-amd64), const SYS_READLINK = 89 +pkg syscall (linux-amd64), const SYS_READLINKAT = 267 +pkg syscall (linux-amd64), const SYS_READV = 19 +pkg syscall (linux-amd64), const SYS_REBOOT = 169 +pkg syscall (linux-amd64), const SYS_RECVFROM = 45 +pkg syscall (linux-amd64), const SYS_RECVMMSG = 299 +pkg syscall (linux-amd64), const SYS_RECVMSG = 47 +pkg syscall (linux-amd64), const SYS_REMAP_FILE_PAGES = 216 +pkg syscall (linux-amd64), const SYS_REMOVEXATTR = 197 +pkg syscall (linux-amd64), const SYS_RENAME = 82 +pkg syscall (linux-amd64), const SYS_RENAMEAT = 264 +pkg syscall (linux-amd64), const SYS_REQUEST_KEY = 249 +pkg syscall (linux-amd64), const SYS_RESTART_SYSCALL = 219 +pkg syscall (linux-amd64), const SYS_RMDIR = 84 +pkg syscall (linux-amd64), const SYS_RT_SIGACTION = 13 +pkg syscall (linux-amd64), const SYS_RT_SIGPENDING = 127 +pkg syscall (linux-amd64), const SYS_RT_SIGPROCMASK = 14 +pkg syscall (linux-amd64), const SYS_RT_SIGQUEUEINFO = 129 +pkg syscall (linux-amd64), const SYS_RT_SIGRETURN = 15 +pkg syscall (linux-amd64), const SYS_RT_SIGSUSPEND = 130 +pkg syscall (linux-amd64), const SYS_RT_SIGTIMEDWAIT = 128 +pkg syscall (linux-amd64), const SYS_RT_TGSIGQUEUEINFO = 297 +pkg syscall (linux-amd64), const SYS_SCHED_GETAFFINITY = 204 +pkg syscall (linux-amd64), const SYS_SCHED_GETPARAM = 143 +pkg syscall (linux-amd64), const SYS_SCHED_GETSCHEDULER = 145 +pkg syscall (linux-amd64), const SYS_SCHED_GET_PRIORITY_MAX = 146 +pkg syscall (linux-amd64), const SYS_SCHED_GET_PRIORITY_MIN = 147 +pkg syscall (linux-amd64), const SYS_SCHED_RR_GET_INTERVAL = 148 +pkg syscall (linux-amd64), const SYS_SCHED_SETAFFINITY = 203 +pkg syscall (linux-amd64), const SYS_SCHED_SETPARAM = 142 +pkg syscall (linux-amd64), const SYS_SCHED_SETSCHEDULER = 144 +pkg syscall (linux-amd64), const SYS_SCHED_YIELD = 24 +pkg syscall (linux-amd64), const SYS_SECURITY = 185 +pkg syscall (linux-amd64), const SYS_SELECT = 23 +pkg syscall (linux-amd64), const SYS_SEMCTL = 66 +pkg syscall (linux-amd64), const SYS_SEMGET = 64 +pkg syscall (linux-amd64), const SYS_SEMOP = 65 +pkg syscall (linux-amd64), const SYS_SEMTIMEDOP = 220 +pkg syscall (linux-amd64), const SYS_SENDFILE = 40 +pkg syscall (linux-amd64), const SYS_SENDMSG = 46 +pkg syscall (linux-amd64), const SYS_SENDTO = 44 +pkg syscall (linux-amd64), const SYS_SETDOMAINNAME = 171 +pkg syscall (linux-amd64), const SYS_SETFSGID = 123 +pkg syscall (linux-amd64), const SYS_SETFSUID = 122 +pkg syscall (linux-amd64), const SYS_SETGID = 106 +pkg syscall (linux-amd64), const SYS_SETGROUPS = 116 +pkg syscall (linux-amd64), const SYS_SETHOSTNAME = 170 +pkg syscall (linux-amd64), const SYS_SETITIMER = 38 +pkg syscall (linux-amd64), const SYS_SETPGID = 109 +pkg syscall (linux-amd64), const SYS_SETPRIORITY = 141 +pkg syscall (linux-amd64), const SYS_SETREGID = 114 +pkg syscall (linux-amd64), const SYS_SETRESGID = 119 +pkg syscall (linux-amd64), const SYS_SETRESUID = 117 +pkg syscall (linux-amd64), const SYS_SETREUID = 113 +pkg syscall (linux-amd64), const SYS_SETRLIMIT = 160 +pkg syscall (linux-amd64), const SYS_SETSID = 112 +pkg syscall (linux-amd64), const SYS_SETSOCKOPT = 54 +pkg syscall (linux-amd64), const SYS_SETTIMEOFDAY = 164 +pkg syscall (linux-amd64), const SYS_SETUID = 105 +pkg syscall (linux-amd64), const SYS_SETXATTR = 188 +pkg syscall (linux-amd64), const SYS_SET_MEMPOLICY = 238 +pkg syscall (linux-amd64), const SYS_SET_ROBUST_LIST = 273 +pkg syscall (linux-amd64), const SYS_SET_THREAD_AREA = 205 +pkg syscall (linux-amd64), const SYS_SET_TID_ADDRESS = 218 +pkg syscall (linux-amd64), const SYS_SHMAT = 30 +pkg syscall (linux-amd64), const SYS_SHMCTL = 31 +pkg syscall (linux-amd64), const SYS_SHMDT = 67 +pkg syscall (linux-amd64), const SYS_SHMGET = 29 +pkg syscall (linux-amd64), const SYS_SHUTDOWN = 48 +pkg syscall (linux-amd64), const SYS_SIGALTSTACK = 131 +pkg syscall (linux-amd64), const SYS_SIGNALFD = 282 +pkg syscall (linux-amd64), const SYS_SIGNALFD4 = 289 +pkg syscall (linux-amd64), const SYS_SOCKET = 41 +pkg syscall (linux-amd64), const SYS_SOCKETPAIR = 53 +pkg syscall (linux-amd64), const SYS_SPLICE = 275 +pkg syscall (linux-amd64), const SYS_STAT = 4 +pkg syscall (linux-amd64), const SYS_STATFS = 137 +pkg syscall (linux-amd64), const SYS_SWAPOFF = 168 +pkg syscall (linux-amd64), const SYS_SWAPON = 167 +pkg syscall (linux-amd64), const SYS_SYMLINK = 88 +pkg syscall (linux-amd64), const SYS_SYMLINKAT = 266 +pkg syscall (linux-amd64), const SYS_SYNC = 162 +pkg syscall (linux-amd64), const SYS_SYNC_FILE_RANGE = 277 +pkg syscall (linux-amd64), const SYS_SYSFS = 139 +pkg syscall (linux-amd64), const SYS_SYSINFO = 99 +pkg syscall (linux-amd64), const SYS_SYSLOG = 103 +pkg syscall (linux-amd64), const SYS_TEE = 276 +pkg syscall (linux-amd64), const SYS_TGKILL = 234 +pkg syscall (linux-amd64), const SYS_TIME = 201 +pkg syscall (linux-amd64), const SYS_TIMERFD_CREATE = 283 +pkg syscall (linux-amd64), const SYS_TIMERFD_GETTIME = 287 +pkg syscall (linux-amd64), const SYS_TIMERFD_SETTIME = 286 +pkg syscall (linux-amd64), const SYS_TIMER_CREATE = 222 +pkg syscall (linux-amd64), const SYS_TIMER_DELETE = 226 +pkg syscall (linux-amd64), const SYS_TIMER_GETOVERRUN = 225 +pkg syscall (linux-amd64), const SYS_TIMER_GETTIME = 224 +pkg syscall (linux-amd64), const SYS_TIMER_SETTIME = 223 +pkg syscall (linux-amd64), const SYS_TIMES = 100 +pkg syscall (linux-amd64), const SYS_TKILL = 200 +pkg syscall (linux-amd64), const SYS_TRUNCATE = 76 +pkg syscall (linux-amd64), const SYS_TUXCALL = 184 +pkg syscall (linux-amd64), const SYS_UMASK = 95 +pkg syscall (linux-amd64), const SYS_UMOUNT2 = 166 +pkg syscall (linux-amd64), const SYS_UNAME = 63 +pkg syscall (linux-amd64), const SYS_UNLINK = 87 +pkg syscall (linux-amd64), const SYS_UNLINKAT = 263 +pkg syscall (linux-amd64), const SYS_UNSHARE = 272 +pkg syscall (linux-amd64), const SYS_USELIB = 134 +pkg syscall (linux-amd64), const SYS_USTAT = 136 +pkg syscall (linux-amd64), const SYS_UTIME = 132 +pkg syscall (linux-amd64), const SYS_UTIMENSAT = 280 +pkg syscall (linux-amd64), const SYS_UTIMES = 235 +pkg syscall (linux-amd64), const SYS_VFORK = 58 +pkg syscall (linux-amd64), const SYS_VHANGUP = 153 +pkg syscall (linux-amd64), const SYS_VMSPLICE = 278 +pkg syscall (linux-amd64), const SYS_VSERVER = 236 +pkg syscall (linux-amd64), const SYS_WAIT4 = 61 +pkg syscall (linux-amd64), const SYS_WAITID = 247 +pkg syscall (linux-amd64), const SYS_WRITE = 1 +pkg syscall (linux-amd64), const SYS_WRITEV = 20 +pkg syscall (linux-amd64), const SYS__SYSCTL = 156 +pkg syscall (linux-amd64), const S_BLKSIZE = 512 +pkg syscall (linux-amd64), const S_IEXEC = 64 +pkg syscall (linux-amd64), const S_IFMT = 61440 +pkg syscall (linux-amd64), const S_IREAD = 256 +pkg syscall (linux-amd64), const S_IRGRP = 32 +pkg syscall (linux-amd64), const S_IROTH = 4 +pkg syscall (linux-amd64), const S_IRWXG = 56 +pkg syscall (linux-amd64), const S_IRWXO = 7 +pkg syscall (linux-amd64), const S_IRWXU = 448 +pkg syscall (linux-amd64), const S_IWGRP = 16 +pkg syscall (linux-amd64), const S_IWOTH = 2 +pkg syscall (linux-amd64), const S_IWRITE = 128 +pkg syscall (linux-amd64), const S_IXGRP = 8 +pkg syscall (linux-amd64), const S_IXOTH = 1 +pkg syscall (linux-amd64), const SizeofCmsghdr = 16 +pkg syscall (linux-amd64), const SizeofIPMreq = 8 +pkg syscall (linux-amd64), const SizeofIPMreqn = 12 +pkg syscall (linux-amd64), const SizeofIPv6Mreq = 20 +pkg syscall (linux-amd64), const SizeofIfAddrmsg = 8 +pkg syscall (linux-amd64), const SizeofIfInfomsg = 16 +pkg syscall (linux-amd64), const SizeofInet4Pktinfo = 12 +pkg syscall (linux-amd64), const SizeofInet6Pktinfo = 20 +pkg syscall (linux-amd64), const SizeofInotifyEvent = 16 +pkg syscall (linux-amd64), const SizeofLinger = 8 +pkg syscall (linux-amd64), const SizeofMsghdr = 56 +pkg syscall (linux-amd64), const SizeofNlAttr = 4 +pkg syscall (linux-amd64), const SizeofNlMsgerr = 20 +pkg syscall (linux-amd64), const SizeofNlMsghdr = 16 +pkg syscall (linux-amd64), const SizeofRtAttr = 4 +pkg syscall (linux-amd64), const SizeofRtGenmsg = 1 +pkg syscall (linux-amd64), const SizeofRtMsg = 12 +pkg syscall (linux-amd64), const SizeofRtNexthop = 8 +pkg syscall (linux-amd64), const SizeofSockFilter = 8 +pkg syscall (linux-amd64), const SizeofSockFprog = 16 +pkg syscall (linux-amd64), const SizeofSockaddrAny = 112 +pkg syscall (linux-amd64), const SizeofSockaddrInet4 = 16 +pkg syscall (linux-amd64), const SizeofSockaddrInet6 = 28 +pkg syscall (linux-amd64), const SizeofSockaddrLinklayer = 20 +pkg syscall (linux-amd64), const SizeofSockaddrNetlink = 12 +pkg syscall (linux-amd64), const SizeofSockaddrUnix = 110 +pkg syscall (linux-amd64), const SizeofTCPInfo = 104 +pkg syscall (linux-amd64), const SizeofTCPInfo ideal-int +pkg syscall (linux-amd64), const SizeofUcred = 12 +pkg syscall (linux-amd64), const TCGETS = 21505 +pkg syscall (linux-amd64), const TCP_CONGESTION = 13 +pkg syscall (linux-amd64), const TCP_CORK = 3 +pkg syscall (linux-amd64), const TCP_DEFER_ACCEPT = 9 +pkg syscall (linux-amd64), const TCP_INFO = 11 +pkg syscall (linux-amd64), const TCP_KEEPCNT = 6 +pkg syscall (linux-amd64), const TCP_KEEPIDLE = 4 +pkg syscall (linux-amd64), const TCP_KEEPINTVL = 5 +pkg syscall (linux-amd64), const TCP_LINGER2 = 8 +pkg syscall (linux-amd64), const TCP_MAXSEG = 2 +pkg syscall (linux-amd64), const TCP_MAXWIN = 65535 +pkg syscall (linux-amd64), const TCP_MAX_WINSHIFT = 14 +pkg syscall (linux-amd64), const TCP_MD5SIG = 14 +pkg syscall (linux-amd64), const TCP_MD5SIG_MAXKEYLEN = 80 +pkg syscall (linux-amd64), const TCP_MSS = 512 +pkg syscall (linux-amd64), const TCP_QUICKACK = 12 +pkg syscall (linux-amd64), const TCP_SYNCNT = 7 +pkg syscall (linux-amd64), const TCP_WINDOW_CLAMP = 10 +pkg syscall (linux-amd64), const TCSETS = 21506 +pkg syscall (linux-amd64), const TIOCCBRK = 21544 +pkg syscall (linux-amd64), const TIOCCONS = 21533 +pkg syscall (linux-amd64), const TIOCEXCL = 21516 +pkg syscall (linux-amd64), const TIOCGDEV = 2147767346 +pkg syscall (linux-amd64), const TIOCGETD = 21540 +pkg syscall (linux-amd64), const TIOCGICOUNT = 21597 +pkg syscall (linux-amd64), const TIOCGLCKTRMIOS = 21590 +pkg syscall (linux-amd64), const TIOCGPGRP = 21519 +pkg syscall (linux-amd64), const TIOCGPTN = 2147767344 +pkg syscall (linux-amd64), const TIOCGRS485 = 21550 +pkg syscall (linux-amd64), const TIOCGSERIAL = 21534 +pkg syscall (linux-amd64), const TIOCGSID = 21545 +pkg syscall (linux-amd64), const TIOCGSOFTCAR = 21529 +pkg syscall (linux-amd64), const TIOCGWINSZ = 21523 +pkg syscall (linux-amd64), const TIOCINQ = 21531 +pkg syscall (linux-amd64), const TIOCLINUX = 21532 +pkg syscall (linux-amd64), const TIOCMBIC = 21527 +pkg syscall (linux-amd64), const TIOCMBIS = 21526 +pkg syscall (linux-amd64), const TIOCMGET = 21525 +pkg syscall (linux-amd64), const TIOCMIWAIT = 21596 +pkg syscall (linux-amd64), const TIOCMSET = 21528 +pkg syscall (linux-amd64), const TIOCM_CAR = 64 +pkg syscall (linux-amd64), const TIOCM_CD = 64 +pkg syscall (linux-amd64), const TIOCM_CTS = 32 +pkg syscall (linux-amd64), const TIOCM_DSR = 256 +pkg syscall (linux-amd64), const TIOCM_DTR = 2 +pkg syscall (linux-amd64), const TIOCM_LE = 1 +pkg syscall (linux-amd64), const TIOCM_RI = 128 +pkg syscall (linux-amd64), const TIOCM_RNG = 128 +pkg syscall (linux-amd64), const TIOCM_RTS = 4 +pkg syscall (linux-amd64), const TIOCM_SR = 16 +pkg syscall (linux-amd64), const TIOCM_ST = 8 +pkg syscall (linux-amd64), const TIOCNOTTY = 21538 +pkg syscall (linux-amd64), const TIOCNXCL = 21517 +pkg syscall (linux-amd64), const TIOCOUTQ = 21521 +pkg syscall (linux-amd64), const TIOCPKT = 21536 +pkg syscall (linux-amd64), const TIOCPKT_DATA = 0 +pkg syscall (linux-amd64), const TIOCPKT_DOSTOP = 32 +pkg syscall (linux-amd64), const TIOCPKT_FLUSHREAD = 1 +pkg syscall (linux-amd64), const TIOCPKT_FLUSHWRITE = 2 +pkg syscall (linux-amd64), const TIOCPKT_IOCTL = 64 +pkg syscall (linux-amd64), const TIOCPKT_NOSTOP = 16 +pkg syscall (linux-amd64), const TIOCPKT_START = 8 +pkg syscall (linux-amd64), const TIOCPKT_STOP = 4 +pkg syscall (linux-amd64), const TIOCSBRK = 21543 +pkg syscall (linux-amd64), const TIOCSCTTY = 21518 +pkg syscall (linux-amd64), const TIOCSERCONFIG = 21587 +pkg syscall (linux-amd64), const TIOCSERGETLSR = 21593 +pkg syscall (linux-amd64), const TIOCSERGETMULTI = 21594 +pkg syscall (linux-amd64), const TIOCSERGSTRUCT = 21592 +pkg syscall (linux-amd64), const TIOCSERGWILD = 21588 +pkg syscall (linux-amd64), const TIOCSERSETMULTI = 21595 +pkg syscall (linux-amd64), const TIOCSERSWILD = 21589 +pkg syscall (linux-amd64), const TIOCSER_TEMT = 1 +pkg syscall (linux-amd64), const TIOCSETD = 21539 +pkg syscall (linux-amd64), const TIOCSIG = 1074025526 +pkg syscall (linux-amd64), const TIOCSLCKTRMIOS = 21591 +pkg syscall (linux-amd64), const TIOCSPGRP = 21520 +pkg syscall (linux-amd64), const TIOCSPTLCK = 1074025521 +pkg syscall (linux-amd64), const TIOCSRS485 = 21551 +pkg syscall (linux-amd64), const TIOCSSERIAL = 21535 +pkg syscall (linux-amd64), const TIOCSSOFTCAR = 21530 +pkg syscall (linux-amd64), const TIOCSTI = 21522 +pkg syscall (linux-amd64), const TIOCSWINSZ = 21524 +pkg syscall (linux-amd64), const TOSTOP = 256 +pkg syscall (linux-amd64), const TUNATTACHFILTER = 1074812117 +pkg syscall (linux-amd64), const TUNDETACHFILTER = 1074812118 +pkg syscall (linux-amd64), const TUNGETFEATURES = 2147767503 +pkg syscall (linux-amd64), const TUNGETIFF = 2147767506 +pkg syscall (linux-amd64), const TUNGETSNDBUF = 2147767507 +pkg syscall (linux-amd64), const TUNGETVNETHDRSZ = 2147767511 +pkg syscall (linux-amd64), const TUNSETDEBUG = 1074025673 +pkg syscall (linux-amd64), const TUNSETGROUP = 1074025678 +pkg syscall (linux-amd64), const TUNSETIFF = 1074025674 +pkg syscall (linux-amd64), const TUNSETLINK = 1074025677 +pkg syscall (linux-amd64), const TUNSETNOCSUM = 1074025672 +pkg syscall (linux-amd64), const TUNSETOFFLOAD = 1074025680 +pkg syscall (linux-amd64), const TUNSETOWNER = 1074025676 +pkg syscall (linux-amd64), const TUNSETPERSIST = 1074025675 +pkg syscall (linux-amd64), const TUNSETSNDBUF = 1074025684 +pkg syscall (linux-amd64), const TUNSETTXFILTER = 1074025681 +pkg syscall (linux-amd64), const TUNSETVNETHDRSZ = 1074025688 +pkg syscall (linux-amd64), const VDISCARD = 13 +pkg syscall (linux-amd64), const VEOF = 4 +pkg syscall (linux-amd64), const VEOL = 11 +pkg syscall (linux-amd64), const VEOL2 = 16 +pkg syscall (linux-amd64), const VERASE = 2 +pkg syscall (linux-amd64), const VINTR = 0 +pkg syscall (linux-amd64), const VKILL = 3 +pkg syscall (linux-amd64), const VLNEXT = 15 +pkg syscall (linux-amd64), const VMIN = 6 +pkg syscall (linux-amd64), const VQUIT = 1 +pkg syscall (linux-amd64), const VREPRINT = 12 +pkg syscall (linux-amd64), const VSTART = 8 +pkg syscall (linux-amd64), const VSTOP = 9 +pkg syscall (linux-amd64), const VSUSP = 10 +pkg syscall (linux-amd64), const VSWTC = 7 +pkg syscall (linux-amd64), const VTIME = 5 +pkg syscall (linux-amd64), const VWERASE = 14 +pkg syscall (linux-amd64), const WALL = 1073741824 +pkg syscall (linux-amd64), const WCLONE = 2147483648 +pkg syscall (linux-amd64), const WCONTINUED = 8 +pkg syscall (linux-amd64), const WEXITED = 4 +pkg syscall (linux-amd64), const WNOHANG = 1 +pkg syscall (linux-amd64), const WNOTHREAD = 536870912 +pkg syscall (linux-amd64), const WNOWAIT = 16777216 +pkg syscall (linux-amd64), const WORDSIZE = 64 +pkg syscall (linux-amd64), const WSTOPPED = 2 +pkg syscall (linux-amd64), const WUNTRACED = 2 +pkg syscall (linux-amd64), const XCASE = 4 +pkg syscall (linux-amd64), func Accept4(int, int) (int, Sockaddr, error) +pkg syscall (linux-amd64), func GetsockoptUcred(int, int, int) (*Ucred, error) +pkg syscall (linux-amd64), func Getxattr(string, string, []uint8) (int, error) +pkg syscall (linux-amd64), func Listxattr(string, []uint8) (int, error) +pkg syscall (linux-amd64), func Pipe2([]int, int) error +pkg syscall (linux-amd64), func PtraceSyscall(int, int) error +pkg syscall (linux-amd64), func Removexattr(string, string) error +pkg syscall (linux-amd64), func Setxattr(string, string, []uint8, int) error +pkg syscall (linux-amd64), func SlicePtrFromStrings([]string) ([]*uint8, error) +pkg syscall (linux-amd64), type SysProcAttr struct, Ctty int +pkg syscall (linux-amd64), type TCPInfo struct +pkg syscall (linux-amd64), type TCPInfo struct, Advmss uint32 +pkg syscall (linux-amd64), type TCPInfo struct, Ato uint32 +pkg syscall (linux-amd64), type TCPInfo struct, Backoff uint8 +pkg syscall (linux-amd64), type TCPInfo struct, Ca_state uint8 +pkg syscall (linux-amd64), type TCPInfo struct, Fackets uint32 +pkg syscall (linux-amd64), type TCPInfo struct, Last_ack_recv uint32 +pkg syscall (linux-amd64), type TCPInfo struct, Last_ack_sent uint32 +pkg syscall (linux-amd64), type TCPInfo struct, Last_data_recv uint32 +pkg syscall (linux-amd64), type TCPInfo struct, Last_data_sent uint32 +pkg syscall (linux-amd64), type TCPInfo struct, Lost uint32 +pkg syscall (linux-amd64), type TCPInfo struct, Options uint8 +pkg syscall (linux-amd64), type TCPInfo struct, Pad_cgo_0 [2]uint8 +pkg syscall (linux-amd64), type TCPInfo struct, Pmtu uint32 +pkg syscall (linux-amd64), type TCPInfo struct, Probes uint8 +pkg syscall (linux-amd64), type TCPInfo struct, Rcv_mss uint32 +pkg syscall (linux-amd64), type TCPInfo struct, Rcv_rtt uint32 +pkg syscall (linux-amd64), type TCPInfo struct, Rcv_space uint32 +pkg syscall (linux-amd64), type TCPInfo struct, Rcv_ssthresh uint32 +pkg syscall (linux-amd64), type TCPInfo struct, Reordering uint32 +pkg syscall (linux-amd64), type TCPInfo struct, Retrans uint32 +pkg syscall (linux-amd64), type TCPInfo struct, Retransmits uint8 +pkg syscall (linux-amd64), type TCPInfo struct, Rto uint32 +pkg syscall (linux-amd64), type TCPInfo struct, Rtt uint32 +pkg syscall (linux-amd64), type TCPInfo struct, Rttvar uint32 +pkg syscall (linux-amd64), type TCPInfo struct, Sacked uint32 +pkg syscall (linux-amd64), type TCPInfo struct, Snd_cwnd uint32 +pkg syscall (linux-amd64), type TCPInfo struct, Snd_mss uint32 +pkg syscall (linux-amd64), type TCPInfo struct, Snd_ssthresh uint32 +pkg syscall (linux-amd64), type TCPInfo struct, State uint8 +pkg syscall (linux-amd64), type TCPInfo struct, Total_retrans uint32 +pkg syscall (linux-amd64), type TCPInfo struct, Unacked uint32 +pkg syscall (linux-amd64-cgo), const AF_ALG = 38 +pkg syscall (linux-amd64-cgo), const AF_APPLETALK = 5 +pkg syscall (linux-amd64-cgo), const AF_ASH = 18 +pkg syscall (linux-amd64-cgo), const AF_ATMPVC = 8 +pkg syscall (linux-amd64-cgo), const AF_ATMSVC = 20 +pkg syscall (linux-amd64-cgo), const AF_AX25 = 3 +pkg syscall (linux-amd64-cgo), const AF_BLUETOOTH = 31 +pkg syscall (linux-amd64-cgo), const AF_BRIDGE = 7 +pkg syscall (linux-amd64-cgo), const AF_CAIF = 37 +pkg syscall (linux-amd64-cgo), const AF_CAN = 29 +pkg syscall (linux-amd64-cgo), const AF_DECnet = 12 +pkg syscall (linux-amd64-cgo), const AF_ECONET = 19 +pkg syscall (linux-amd64-cgo), const AF_FILE = 1 +pkg syscall (linux-amd64-cgo), const AF_IEEE802154 = 36 +pkg syscall (linux-amd64-cgo), const AF_INET6 = 10 +pkg syscall (linux-amd64-cgo), const AF_IPX = 4 +pkg syscall (linux-amd64-cgo), const AF_IRDA = 23 +pkg syscall (linux-amd64-cgo), const AF_ISDN = 34 +pkg syscall (linux-amd64-cgo), const AF_IUCV = 32 +pkg syscall (linux-amd64-cgo), const AF_KEY = 15 +pkg syscall (linux-amd64-cgo), const AF_LLC = 26 +pkg syscall (linux-amd64-cgo), const AF_LOCAL = 1 +pkg syscall (linux-amd64-cgo), const AF_MAX = 39 +pkg syscall (linux-amd64-cgo), const AF_NETBEUI = 13 +pkg syscall (linux-amd64-cgo), const AF_NETLINK = 16 +pkg syscall (linux-amd64-cgo), const AF_NETROM = 6 +pkg syscall (linux-amd64-cgo), const AF_PACKET = 17 +pkg syscall (linux-amd64-cgo), const AF_PHONET = 35 +pkg syscall (linux-amd64-cgo), const AF_PPPOX = 24 +pkg syscall (linux-amd64-cgo), const AF_RDS = 21 +pkg syscall (linux-amd64-cgo), const AF_ROSE = 11 +pkg syscall (linux-amd64-cgo), const AF_ROUTE = 16 +pkg syscall (linux-amd64-cgo), const AF_RXRPC = 33 +pkg syscall (linux-amd64-cgo), const AF_SECURITY = 14 +pkg syscall (linux-amd64-cgo), const AF_SNA = 22 +pkg syscall (linux-amd64-cgo), const AF_TIPC = 30 +pkg syscall (linux-amd64-cgo), const AF_WANPIPE = 25 +pkg syscall (linux-amd64-cgo), const AF_X25 = 9 +pkg syscall (linux-amd64-cgo), const ARPHRD_ADAPT = 264 +pkg syscall (linux-amd64-cgo), const ARPHRD_APPLETLK = 8 +pkg syscall (linux-amd64-cgo), const ARPHRD_ARCNET = 7 +pkg syscall (linux-amd64-cgo), const ARPHRD_ASH = 781 +pkg syscall (linux-amd64-cgo), const ARPHRD_ATM = 19 +pkg syscall (linux-amd64-cgo), const ARPHRD_AX25 = 3 +pkg syscall (linux-amd64-cgo), const ARPHRD_BIF = 775 +pkg syscall (linux-amd64-cgo), const ARPHRD_CHAOS = 5 +pkg syscall (linux-amd64-cgo), const ARPHRD_CISCO = 513 +pkg syscall (linux-amd64-cgo), const ARPHRD_CSLIP = 257 +pkg syscall (linux-amd64-cgo), const ARPHRD_CSLIP6 = 259 +pkg syscall (linux-amd64-cgo), const ARPHRD_DDCMP = 517 +pkg syscall (linux-amd64-cgo), const ARPHRD_DLCI = 15 +pkg syscall (linux-amd64-cgo), const ARPHRD_ECONET = 782 +pkg syscall (linux-amd64-cgo), const ARPHRD_EETHER = 2 +pkg syscall (linux-amd64-cgo), const ARPHRD_ETHER = 1 +pkg syscall (linux-amd64-cgo), const ARPHRD_EUI64 = 27 +pkg syscall (linux-amd64-cgo), const ARPHRD_FCAL = 785 +pkg syscall (linux-amd64-cgo), const ARPHRD_FCFABRIC = 787 +pkg syscall (linux-amd64-cgo), const ARPHRD_FCPL = 786 +pkg syscall (linux-amd64-cgo), const ARPHRD_FCPP = 784 +pkg syscall (linux-amd64-cgo), const ARPHRD_FDDI = 774 +pkg syscall (linux-amd64-cgo), const ARPHRD_FRAD = 770 +pkg syscall (linux-amd64-cgo), const ARPHRD_HDLC = 513 +pkg syscall (linux-amd64-cgo), const ARPHRD_HIPPI = 780 +pkg syscall (linux-amd64-cgo), const ARPHRD_HWX25 = 272 +pkg syscall (linux-amd64-cgo), const ARPHRD_IEEE1394 = 24 +pkg syscall (linux-amd64-cgo), const ARPHRD_IEEE802 = 6 +pkg syscall (linux-amd64-cgo), const ARPHRD_IEEE80211 = 801 +pkg syscall (linux-amd64-cgo), const ARPHRD_IEEE80211_PRISM = 802 +pkg syscall (linux-amd64-cgo), const ARPHRD_IEEE80211_RADIOTAP = 803 +pkg syscall (linux-amd64-cgo), const ARPHRD_IEEE802154 = 804 +pkg syscall (linux-amd64-cgo), const ARPHRD_IEEE802154_PHY = 805 +pkg syscall (linux-amd64-cgo), const ARPHRD_IEEE802_TR = 800 +pkg syscall (linux-amd64-cgo), const ARPHRD_INFINIBAND = 32 +pkg syscall (linux-amd64-cgo), const ARPHRD_IPDDP = 777 +pkg syscall (linux-amd64-cgo), const ARPHRD_IPGRE = 778 +pkg syscall (linux-amd64-cgo), const ARPHRD_IRDA = 783 +pkg syscall (linux-amd64-cgo), const ARPHRD_LAPB = 516 +pkg syscall (linux-amd64-cgo), const ARPHRD_LOCALTLK = 773 +pkg syscall (linux-amd64-cgo), const ARPHRD_LOOPBACK = 772 +pkg syscall (linux-amd64-cgo), const ARPHRD_METRICOM = 23 +pkg syscall (linux-amd64-cgo), const ARPHRD_NETROM = 0 +pkg syscall (linux-amd64-cgo), const ARPHRD_NONE = 65534 +pkg syscall (linux-amd64-cgo), const ARPHRD_PIMREG = 779 +pkg syscall (linux-amd64-cgo), const ARPHRD_PPP = 512 +pkg syscall (linux-amd64-cgo), const ARPHRD_PRONET = 4 +pkg syscall (linux-amd64-cgo), const ARPHRD_RAWHDLC = 518 +pkg syscall (linux-amd64-cgo), const ARPHRD_ROSE = 270 +pkg syscall (linux-amd64-cgo), const ARPHRD_RSRVD = 260 +pkg syscall (linux-amd64-cgo), const ARPHRD_SIT = 776 +pkg syscall (linux-amd64-cgo), const ARPHRD_SKIP = 771 +pkg syscall (linux-amd64-cgo), const ARPHRD_SLIP = 256 +pkg syscall (linux-amd64-cgo), const ARPHRD_SLIP6 = 258 +pkg syscall (linux-amd64-cgo), const ARPHRD_TUNNEL = 768 +pkg syscall (linux-amd64-cgo), const ARPHRD_TUNNEL6 = 769 +pkg syscall (linux-amd64-cgo), const ARPHRD_VOID = 65535 +pkg syscall (linux-amd64-cgo), const ARPHRD_X25 = 271 +pkg syscall (linux-amd64-cgo), const B0 = 0 +pkg syscall (linux-amd64-cgo), const B1000000 = 4104 +pkg syscall (linux-amd64-cgo), const B110 = 3 +pkg syscall (linux-amd64-cgo), const B115200 = 4098 +pkg syscall (linux-amd64-cgo), const B1152000 = 4105 +pkg syscall (linux-amd64-cgo), const B1200 = 9 +pkg syscall (linux-amd64-cgo), const B134 = 4 +pkg syscall (linux-amd64-cgo), const B150 = 5 +pkg syscall (linux-amd64-cgo), const B1500000 = 4106 +pkg syscall (linux-amd64-cgo), const B1800 = 10 +pkg syscall (linux-amd64-cgo), const B19200 = 14 +pkg syscall (linux-amd64-cgo), const B200 = 6 +pkg syscall (linux-amd64-cgo), const B2000000 = 4107 +pkg syscall (linux-amd64-cgo), const B230400 = 4099 +pkg syscall (linux-amd64-cgo), const B2400 = 11 +pkg syscall (linux-amd64-cgo), const B2500000 = 4108 +pkg syscall (linux-amd64-cgo), const B300 = 7 +pkg syscall (linux-amd64-cgo), const B3000000 = 4109 +pkg syscall (linux-amd64-cgo), const B3500000 = 4110 +pkg syscall (linux-amd64-cgo), const B38400 = 15 +pkg syscall (linux-amd64-cgo), const B4000000 = 4111 +pkg syscall (linux-amd64-cgo), const B460800 = 4100 +pkg syscall (linux-amd64-cgo), const B4800 = 12 +pkg syscall (linux-amd64-cgo), const B50 = 1 +pkg syscall (linux-amd64-cgo), const B500000 = 4101 +pkg syscall (linux-amd64-cgo), const B57600 = 4097 +pkg syscall (linux-amd64-cgo), const B576000 = 4102 +pkg syscall (linux-amd64-cgo), const B600 = 8 +pkg syscall (linux-amd64-cgo), const B75 = 2 +pkg syscall (linux-amd64-cgo), const B921600 = 4103 +pkg syscall (linux-amd64-cgo), const B9600 = 13 +pkg syscall (linux-amd64-cgo), const BPF_A = 16 +pkg syscall (linux-amd64-cgo), const BPF_ABS = 32 +pkg syscall (linux-amd64-cgo), const BPF_ADD = 0 +pkg syscall (linux-amd64-cgo), const BPF_ALU = 4 +pkg syscall (linux-amd64-cgo), const BPF_AND = 80 +pkg syscall (linux-amd64-cgo), const BPF_B = 16 +pkg syscall (linux-amd64-cgo), const BPF_DIV = 48 +pkg syscall (linux-amd64-cgo), const BPF_H = 8 +pkg syscall (linux-amd64-cgo), const BPF_IMM = 0 +pkg syscall (linux-amd64-cgo), const BPF_IND = 64 +pkg syscall (linux-amd64-cgo), const BPF_JA = 0 +pkg syscall (linux-amd64-cgo), const BPF_JEQ = 16 +pkg syscall (linux-amd64-cgo), const BPF_JGE = 48 +pkg syscall (linux-amd64-cgo), const BPF_JGT = 32 +pkg syscall (linux-amd64-cgo), const BPF_JMP = 5 +pkg syscall (linux-amd64-cgo), const BPF_JSET = 64 +pkg syscall (linux-amd64-cgo), const BPF_K = 0 +pkg syscall (linux-amd64-cgo), const BPF_LD = 0 +pkg syscall (linux-amd64-cgo), const BPF_LDX = 1 +pkg syscall (linux-amd64-cgo), const BPF_LEN = 128 +pkg syscall (linux-amd64-cgo), const BPF_LSH = 96 +pkg syscall (linux-amd64-cgo), const BPF_MAJOR_VERSION = 1 +pkg syscall (linux-amd64-cgo), const BPF_MAXINSNS = 4096 +pkg syscall (linux-amd64-cgo), const BPF_MEM = 96 +pkg syscall (linux-amd64-cgo), const BPF_MEMWORDS = 16 +pkg syscall (linux-amd64-cgo), const BPF_MINOR_VERSION = 1 +pkg syscall (linux-amd64-cgo), const BPF_MISC = 7 +pkg syscall (linux-amd64-cgo), const BPF_MSH = 160 +pkg syscall (linux-amd64-cgo), const BPF_MUL = 32 +pkg syscall (linux-amd64-cgo), const BPF_NEG = 128 +pkg syscall (linux-amd64-cgo), const BPF_OR = 64 +pkg syscall (linux-amd64-cgo), const BPF_RET = 6 +pkg syscall (linux-amd64-cgo), const BPF_RSH = 112 +pkg syscall (linux-amd64-cgo), const BPF_ST = 2 +pkg syscall (linux-amd64-cgo), const BPF_STX = 3 +pkg syscall (linux-amd64-cgo), const BPF_SUB = 16 +pkg syscall (linux-amd64-cgo), const BPF_TAX = 0 +pkg syscall (linux-amd64-cgo), const BPF_TXA = 128 +pkg syscall (linux-amd64-cgo), const BPF_W = 0 +pkg syscall (linux-amd64-cgo), const BPF_X = 8 +pkg syscall (linux-amd64-cgo), const BRKINT = 2 +pkg syscall (linux-amd64-cgo), const CLOCAL = 2048 +pkg syscall (linux-amd64-cgo), const CREAD = 128 +pkg syscall (linux-amd64-cgo), const CS5 = 0 +pkg syscall (linux-amd64-cgo), const CS6 = 16 +pkg syscall (linux-amd64-cgo), const CS7 = 32 +pkg syscall (linux-amd64-cgo), const CS8 = 48 +pkg syscall (linux-amd64-cgo), const CSIZE = 48 +pkg syscall (linux-amd64-cgo), const CSTOPB = 64 +pkg syscall (linux-amd64-cgo), const DT_BLK = 6 +pkg syscall (linux-amd64-cgo), const DT_CHR = 2 +pkg syscall (linux-amd64-cgo), const DT_DIR = 4 +pkg syscall (linux-amd64-cgo), const DT_FIFO = 1 +pkg syscall (linux-amd64-cgo), const DT_LNK = 10 +pkg syscall (linux-amd64-cgo), const DT_REG = 8 +pkg syscall (linux-amd64-cgo), const DT_SOCK = 12 +pkg syscall (linux-amd64-cgo), const DT_UNKNOWN = 0 +pkg syscall (linux-amd64-cgo), const DT_WHT = 14 +pkg syscall (linux-amd64-cgo), const E2BIG = 7 +pkg syscall (linux-amd64-cgo), const EACCES = 13 +pkg syscall (linux-amd64-cgo), const EADDRINUSE = 98 +pkg syscall (linux-amd64-cgo), const EADDRNOTAVAIL = 99 +pkg syscall (linux-amd64-cgo), const EADV = 68 +pkg syscall (linux-amd64-cgo), const EAFNOSUPPORT = 97 +pkg syscall (linux-amd64-cgo), const EAGAIN = 11 +pkg syscall (linux-amd64-cgo), const EALREADY = 114 +pkg syscall (linux-amd64-cgo), const EBADE = 52 +pkg syscall (linux-amd64-cgo), const EBADF = 9 +pkg syscall (linux-amd64-cgo), const EBADFD = 77 +pkg syscall (linux-amd64-cgo), const EBADMSG = 74 +pkg syscall (linux-amd64-cgo), const EBADR = 53 +pkg syscall (linux-amd64-cgo), const EBADRQC = 56 +pkg syscall (linux-amd64-cgo), const EBADSLT = 57 +pkg syscall (linux-amd64-cgo), const EBFONT = 59 +pkg syscall (linux-amd64-cgo), const EBUSY = 16 +pkg syscall (linux-amd64-cgo), const ECANCELED = 125 +pkg syscall (linux-amd64-cgo), const ECHILD = 10 +pkg syscall (linux-amd64-cgo), const ECHO = 8 +pkg syscall (linux-amd64-cgo), const ECHOCTL = 512 +pkg syscall (linux-amd64-cgo), const ECHOE = 16 +pkg syscall (linux-amd64-cgo), const ECHOK = 32 +pkg syscall (linux-amd64-cgo), const ECHOKE = 2048 +pkg syscall (linux-amd64-cgo), const ECHONL = 64 +pkg syscall (linux-amd64-cgo), const ECHOPRT = 1024 +pkg syscall (linux-amd64-cgo), const ECHRNG = 44 +pkg syscall (linux-amd64-cgo), const ECOMM = 70 +pkg syscall (linux-amd64-cgo), const ECONNABORTED = 103 +pkg syscall (linux-amd64-cgo), const ECONNREFUSED = 111 +pkg syscall (linux-amd64-cgo), const ECONNRESET = 104 +pkg syscall (linux-amd64-cgo), const EDEADLK = 35 +pkg syscall (linux-amd64-cgo), const EDEADLOCK = 35 +pkg syscall (linux-amd64-cgo), const EDESTADDRREQ = 89 +pkg syscall (linux-amd64-cgo), const EDOM = 33 +pkg syscall (linux-amd64-cgo), const EDOTDOT = 73 +pkg syscall (linux-amd64-cgo), const EDQUOT = 122 +pkg syscall (linux-amd64-cgo), const EEXIST = 17 +pkg syscall (linux-amd64-cgo), const EFAULT = 14 +pkg syscall (linux-amd64-cgo), const EFBIG = 27 +pkg syscall (linux-amd64-cgo), const EHOSTDOWN = 112 +pkg syscall (linux-amd64-cgo), const EHOSTUNREACH = 113 +pkg syscall (linux-amd64-cgo), const EIDRM = 43 +pkg syscall (linux-amd64-cgo), const EILSEQ = 84 +pkg syscall (linux-amd64-cgo), const EINPROGRESS = 115 +pkg syscall (linux-amd64-cgo), const EINTR = 4 +pkg syscall (linux-amd64-cgo), const EINVAL = 22 +pkg syscall (linux-amd64-cgo), const EIO = 5 +pkg syscall (linux-amd64-cgo), const EISCONN = 106 +pkg syscall (linux-amd64-cgo), const EISDIR = 21 +pkg syscall (linux-amd64-cgo), const EISNAM = 120 +pkg syscall (linux-amd64-cgo), const EKEYEXPIRED = 127 +pkg syscall (linux-amd64-cgo), const EKEYREJECTED = 129 +pkg syscall (linux-amd64-cgo), const EKEYREVOKED = 128 +pkg syscall (linux-amd64-cgo), const EL2HLT = 51 +pkg syscall (linux-amd64-cgo), const EL2NSYNC = 45 +pkg syscall (linux-amd64-cgo), const EL3HLT = 46 +pkg syscall (linux-amd64-cgo), const EL3RST = 47 +pkg syscall (linux-amd64-cgo), const ELIBACC = 79 +pkg syscall (linux-amd64-cgo), const ELIBBAD = 80 +pkg syscall (linux-amd64-cgo), const ELIBEXEC = 83 +pkg syscall (linux-amd64-cgo), const ELIBMAX = 82 +pkg syscall (linux-amd64-cgo), const ELIBSCN = 81 +pkg syscall (linux-amd64-cgo), const ELNRNG = 48 +pkg syscall (linux-amd64-cgo), const ELOOP = 40 +pkg syscall (linux-amd64-cgo), const EMEDIUMTYPE = 124 +pkg syscall (linux-amd64-cgo), const EMFILE = 24 +pkg syscall (linux-amd64-cgo), const EMLINK = 31 +pkg syscall (linux-amd64-cgo), const EMSGSIZE = 90 +pkg syscall (linux-amd64-cgo), const EMULTIHOP = 72 +pkg syscall (linux-amd64-cgo), const ENAMETOOLONG = 36 +pkg syscall (linux-amd64-cgo), const ENAVAIL = 119 +pkg syscall (linux-amd64-cgo), const ENETDOWN = 100 +pkg syscall (linux-amd64-cgo), const ENETRESET = 102 +pkg syscall (linux-amd64-cgo), const ENETUNREACH = 101 +pkg syscall (linux-amd64-cgo), const ENFILE = 23 +pkg syscall (linux-amd64-cgo), const ENOANO = 55 +pkg syscall (linux-amd64-cgo), const ENOBUFS = 105 +pkg syscall (linux-amd64-cgo), const ENOCSI = 50 +pkg syscall (linux-amd64-cgo), const ENODATA = 61 +pkg syscall (linux-amd64-cgo), const ENODEV = 19 +pkg syscall (linux-amd64-cgo), const ENOEXEC = 8 +pkg syscall (linux-amd64-cgo), const ENOKEY = 126 +pkg syscall (linux-amd64-cgo), const ENOLCK = 37 +pkg syscall (linux-amd64-cgo), const ENOLINK = 67 +pkg syscall (linux-amd64-cgo), const ENOMEDIUM = 123 +pkg syscall (linux-amd64-cgo), const ENOMEM = 12 +pkg syscall (linux-amd64-cgo), const ENOMSG = 42 +pkg syscall (linux-amd64-cgo), const ENONET = 64 +pkg syscall (linux-amd64-cgo), const ENOPKG = 65 +pkg syscall (linux-amd64-cgo), const ENOPROTOOPT = 92 +pkg syscall (linux-amd64-cgo), const ENOSPC = 28 +pkg syscall (linux-amd64-cgo), const ENOSR = 63 +pkg syscall (linux-amd64-cgo), const ENOSTR = 60 +pkg syscall (linux-amd64-cgo), const ENOSYS = 38 +pkg syscall (linux-amd64-cgo), const ENOTBLK = 15 +pkg syscall (linux-amd64-cgo), const ENOTCONN = 107 +pkg syscall (linux-amd64-cgo), const ENOTDIR = 20 +pkg syscall (linux-amd64-cgo), const ENOTEMPTY = 39 +pkg syscall (linux-amd64-cgo), const ENOTNAM = 118 +pkg syscall (linux-amd64-cgo), const ENOTRECOVERABLE = 131 +pkg syscall (linux-amd64-cgo), const ENOTSOCK = 88 +pkg syscall (linux-amd64-cgo), const ENOTSUP = 95 +pkg syscall (linux-amd64-cgo), const ENOTTY = 25 +pkg syscall (linux-amd64-cgo), const ENOTUNIQ = 76 +pkg syscall (linux-amd64-cgo), const ENXIO = 6 +pkg syscall (linux-amd64-cgo), const EOPNOTSUPP = 95 +pkg syscall (linux-amd64-cgo), const EOVERFLOW = 75 +pkg syscall (linux-amd64-cgo), const EOWNERDEAD = 130 +pkg syscall (linux-amd64-cgo), const EPERM = 1 +pkg syscall (linux-amd64-cgo), const EPFNOSUPPORT = 96 +pkg syscall (linux-amd64-cgo), const EPIPE = 32 +pkg syscall (linux-amd64-cgo), const EPOLLERR = 8 +pkg syscall (linux-amd64-cgo), const EPOLLET = -2147483648 +pkg syscall (linux-amd64-cgo), const EPOLLHUP = 16 +pkg syscall (linux-amd64-cgo), const EPOLLIN = 1 +pkg syscall (linux-amd64-cgo), const EPOLLMSG = 1024 +pkg syscall (linux-amd64-cgo), const EPOLLONESHOT = 1073741824 +pkg syscall (linux-amd64-cgo), const EPOLLOUT = 4 +pkg syscall (linux-amd64-cgo), const EPOLLPRI = 2 +pkg syscall (linux-amd64-cgo), const EPOLLRDBAND = 128 +pkg syscall (linux-amd64-cgo), const EPOLLRDHUP = 8192 +pkg syscall (linux-amd64-cgo), const EPOLLRDNORM = 64 +pkg syscall (linux-amd64-cgo), const EPOLLWRBAND = 512 +pkg syscall (linux-amd64-cgo), const EPOLLWRNORM = 256 +pkg syscall (linux-amd64-cgo), const EPOLL_CLOEXEC = 524288 +pkg syscall (linux-amd64-cgo), const EPOLL_CTL_ADD = 1 +pkg syscall (linux-amd64-cgo), const EPOLL_CTL_DEL = 2 +pkg syscall (linux-amd64-cgo), const EPOLL_CTL_MOD = 3 +pkg syscall (linux-amd64-cgo), const EPOLL_NONBLOCK = 2048 +pkg syscall (linux-amd64-cgo), const EPROTO = 71 +pkg syscall (linux-amd64-cgo), const EPROTONOSUPPORT = 93 +pkg syscall (linux-amd64-cgo), const EPROTOTYPE = 91 +pkg syscall (linux-amd64-cgo), const ERANGE = 34 +pkg syscall (linux-amd64-cgo), const EREMCHG = 78 +pkg syscall (linux-amd64-cgo), const EREMOTE = 66 +pkg syscall (linux-amd64-cgo), const EREMOTEIO = 121 +pkg syscall (linux-amd64-cgo), const ERESTART = 85 +pkg syscall (linux-amd64-cgo), const ERFKILL = 132 +pkg syscall (linux-amd64-cgo), const EROFS = 30 +pkg syscall (linux-amd64-cgo), const ESHUTDOWN = 108 +pkg syscall (linux-amd64-cgo), const ESOCKTNOSUPPORT = 94 +pkg syscall (linux-amd64-cgo), const ESPIPE = 29 +pkg syscall (linux-amd64-cgo), const ESRCH = 3 +pkg syscall (linux-amd64-cgo), const ESRMNT = 69 +pkg syscall (linux-amd64-cgo), const ESTALE = 116 +pkg syscall (linux-amd64-cgo), const ESTRPIPE = 86 +pkg syscall (linux-amd64-cgo), const ETH_P_1588 = 35063 +pkg syscall (linux-amd64-cgo), const ETH_P_8021Q = 33024 +pkg syscall (linux-amd64-cgo), const ETH_P_802_2 = 4 +pkg syscall (linux-amd64-cgo), const ETH_P_802_3 = 1 +pkg syscall (linux-amd64-cgo), const ETH_P_AARP = 33011 +pkg syscall (linux-amd64-cgo), const ETH_P_ALL = 3 +pkg syscall (linux-amd64-cgo), const ETH_P_AOE = 34978 +pkg syscall (linux-amd64-cgo), const ETH_P_ARCNET = 26 +pkg syscall (linux-amd64-cgo), const ETH_P_ARP = 2054 +pkg syscall (linux-amd64-cgo), const ETH_P_ATALK = 32923 +pkg syscall (linux-amd64-cgo), const ETH_P_ATMFATE = 34948 +pkg syscall (linux-amd64-cgo), const ETH_P_ATMMPOA = 34892 +pkg syscall (linux-amd64-cgo), const ETH_P_AX25 = 2 +pkg syscall (linux-amd64-cgo), const ETH_P_BPQ = 2303 +pkg syscall (linux-amd64-cgo), const ETH_P_CAIF = 247 +pkg syscall (linux-amd64-cgo), const ETH_P_CAN = 12 +pkg syscall (linux-amd64-cgo), const ETH_P_CONTROL = 22 +pkg syscall (linux-amd64-cgo), const ETH_P_CUST = 24582 +pkg syscall (linux-amd64-cgo), const ETH_P_DDCMP = 6 +pkg syscall (linux-amd64-cgo), const ETH_P_DEC = 24576 +pkg syscall (linux-amd64-cgo), const ETH_P_DIAG = 24581 +pkg syscall (linux-amd64-cgo), const ETH_P_DNA_DL = 24577 +pkg syscall (linux-amd64-cgo), const ETH_P_DNA_RC = 24578 +pkg syscall (linux-amd64-cgo), const ETH_P_DNA_RT = 24579 +pkg syscall (linux-amd64-cgo), const ETH_P_DSA = 27 +pkg syscall (linux-amd64-cgo), const ETH_P_ECONET = 24 +pkg syscall (linux-amd64-cgo), const ETH_P_EDSA = 56026 +pkg syscall (linux-amd64-cgo), const ETH_P_FCOE = 35078 +pkg syscall (linux-amd64-cgo), const ETH_P_FIP = 35092 +pkg syscall (linux-amd64-cgo), const ETH_P_HDLC = 25 +pkg syscall (linux-amd64-cgo), const ETH_P_IEEE802154 = 246 +pkg syscall (linux-amd64-cgo), const ETH_P_IEEEPUP = 2560 +pkg syscall (linux-amd64-cgo), const ETH_P_IEEEPUPAT = 2561 +pkg syscall (linux-amd64-cgo), const ETH_P_IP = 2048 +pkg syscall (linux-amd64-cgo), const ETH_P_IPV6 = 34525 +pkg syscall (linux-amd64-cgo), const ETH_P_IPX = 33079 +pkg syscall (linux-amd64-cgo), const ETH_P_IRDA = 23 +pkg syscall (linux-amd64-cgo), const ETH_P_LAT = 24580 +pkg syscall (linux-amd64-cgo), const ETH_P_LINK_CTL = 34924 +pkg syscall (linux-amd64-cgo), const ETH_P_LOCALTALK = 9 +pkg syscall (linux-amd64-cgo), const ETH_P_LOOP = 96 +pkg syscall (linux-amd64-cgo), const ETH_P_MOBITEX = 21 +pkg syscall (linux-amd64-cgo), const ETH_P_MPLS_MC = 34888 +pkg syscall (linux-amd64-cgo), const ETH_P_MPLS_UC = 34887 +pkg syscall (linux-amd64-cgo), const ETH_P_PAE = 34958 +pkg syscall (linux-amd64-cgo), const ETH_P_PAUSE = 34824 +pkg syscall (linux-amd64-cgo), const ETH_P_PHONET = 245 +pkg syscall (linux-amd64-cgo), const ETH_P_PPPTALK = 16 +pkg syscall (linux-amd64-cgo), const ETH_P_PPP_DISC = 34915 +pkg syscall (linux-amd64-cgo), const ETH_P_PPP_MP = 8 +pkg syscall (linux-amd64-cgo), const ETH_P_PPP_SES = 34916 +pkg syscall (linux-amd64-cgo), const ETH_P_PUP = 512 +pkg syscall (linux-amd64-cgo), const ETH_P_PUPAT = 513 +pkg syscall (linux-amd64-cgo), const ETH_P_RARP = 32821 +pkg syscall (linux-amd64-cgo), const ETH_P_SCA = 24583 +pkg syscall (linux-amd64-cgo), const ETH_P_SLOW = 34825 +pkg syscall (linux-amd64-cgo), const ETH_P_SNAP = 5 +pkg syscall (linux-amd64-cgo), const ETH_P_TEB = 25944 +pkg syscall (linux-amd64-cgo), const ETH_P_TIPC = 35018 +pkg syscall (linux-amd64-cgo), const ETH_P_TRAILER = 28 +pkg syscall (linux-amd64-cgo), const ETH_P_TR_802_2 = 17 +pkg syscall (linux-amd64-cgo), const ETH_P_WAN_PPP = 7 +pkg syscall (linux-amd64-cgo), const ETH_P_WCCP = 34878 +pkg syscall (linux-amd64-cgo), const ETH_P_X25 = 2053 +pkg syscall (linux-amd64-cgo), const ETIME = 62 +pkg syscall (linux-amd64-cgo), const ETIMEDOUT = 110 +pkg syscall (linux-amd64-cgo), const ETOOMANYREFS = 109 +pkg syscall (linux-amd64-cgo), const ETXTBSY = 26 +pkg syscall (linux-amd64-cgo), const EUCLEAN = 117 +pkg syscall (linux-amd64-cgo), const EUNATCH = 49 +pkg syscall (linux-amd64-cgo), const EUSERS = 87 +pkg syscall (linux-amd64-cgo), const EWOULDBLOCK = 11 +pkg syscall (linux-amd64-cgo), const EXDEV = 18 +pkg syscall (linux-amd64-cgo), const EXFULL = 54 +pkg syscall (linux-amd64-cgo), const FD_CLOEXEC = 1 +pkg syscall (linux-amd64-cgo), const FD_SETSIZE = 1024 +pkg syscall (linux-amd64-cgo), const FLUSHO = 4096 +pkg syscall (linux-amd64-cgo), const F_DUPFD = 0 +pkg syscall (linux-amd64-cgo), const F_DUPFD_CLOEXEC = 1030 +pkg syscall (linux-amd64-cgo), const F_EXLCK = 4 +pkg syscall (linux-amd64-cgo), const F_GETFD = 1 +pkg syscall (linux-amd64-cgo), const F_GETFL = 3 +pkg syscall (linux-amd64-cgo), const F_GETLEASE = 1025 +pkg syscall (linux-amd64-cgo), const F_GETLK = 5 +pkg syscall (linux-amd64-cgo), const F_GETLK64 = 5 +pkg syscall (linux-amd64-cgo), const F_GETOWN = 9 +pkg syscall (linux-amd64-cgo), const F_GETOWN_EX = 16 +pkg syscall (linux-amd64-cgo), const F_GETPIPE_SZ = 1032 +pkg syscall (linux-amd64-cgo), const F_GETSIG = 11 +pkg syscall (linux-amd64-cgo), const F_LOCK = 1 +pkg syscall (linux-amd64-cgo), const F_NOTIFY = 1026 +pkg syscall (linux-amd64-cgo), const F_OK = 0 +pkg syscall (linux-amd64-cgo), const F_RDLCK = 0 +pkg syscall (linux-amd64-cgo), const F_SETFD = 2 +pkg syscall (linux-amd64-cgo), const F_SETFL = 4 +pkg syscall (linux-amd64-cgo), const F_SETLEASE = 1024 +pkg syscall (linux-amd64-cgo), const F_SETLK = 6 +pkg syscall (linux-amd64-cgo), const F_SETLK64 = 6 +pkg syscall (linux-amd64-cgo), const F_SETLKW = 7 +pkg syscall (linux-amd64-cgo), const F_SETLKW64 = 7 +pkg syscall (linux-amd64-cgo), const F_SETOWN = 8 +pkg syscall (linux-amd64-cgo), const F_SETOWN_EX = 15 +pkg syscall (linux-amd64-cgo), const F_SETPIPE_SZ = 1031 +pkg syscall (linux-amd64-cgo), const F_SETSIG = 10 +pkg syscall (linux-amd64-cgo), const F_SHLCK = 8 +pkg syscall (linux-amd64-cgo), const F_TEST = 3 +pkg syscall (linux-amd64-cgo), const F_TLOCK = 2 +pkg syscall (linux-amd64-cgo), const F_ULOCK = 0 +pkg syscall (linux-amd64-cgo), const F_UNLCK = 2 +pkg syscall (linux-amd64-cgo), const F_WRLCK = 1 +pkg syscall (linux-amd64-cgo), const HUPCL = 1024 +pkg syscall (linux-amd64-cgo), const ICANON = 2 +pkg syscall (linux-amd64-cgo), const ICRNL = 256 +pkg syscall (linux-amd64-cgo), const IEXTEN = 32768 +pkg syscall (linux-amd64-cgo), const IFA_ADDRESS = 1 +pkg syscall (linux-amd64-cgo), const IFA_ANYCAST = 5 +pkg syscall (linux-amd64-cgo), const IFA_BROADCAST = 4 +pkg syscall (linux-amd64-cgo), const IFA_CACHEINFO = 6 +pkg syscall (linux-amd64-cgo), const IFA_F_DADFAILED = 8 +pkg syscall (linux-amd64-cgo), const IFA_F_DEPRECATED = 32 +pkg syscall (linux-amd64-cgo), const IFA_F_HOMEADDRESS = 16 +pkg syscall (linux-amd64-cgo), const IFA_F_NODAD = 2 +pkg syscall (linux-amd64-cgo), const IFA_F_OPTIMISTIC = 4 +pkg syscall (linux-amd64-cgo), const IFA_F_PERMANENT = 128 +pkg syscall (linux-amd64-cgo), const IFA_F_SECONDARY = 1 +pkg syscall (linux-amd64-cgo), const IFA_F_TEMPORARY = 1 +pkg syscall (linux-amd64-cgo), const IFA_F_TENTATIVE = 64 +pkg syscall (linux-amd64-cgo), const IFA_LABEL = 3 +pkg syscall (linux-amd64-cgo), const IFA_LOCAL = 2 +pkg syscall (linux-amd64-cgo), const IFA_MAX = 7 +pkg syscall (linux-amd64-cgo), const IFA_MULTICAST = 7 +pkg syscall (linux-amd64-cgo), const IFA_UNSPEC = 0 +pkg syscall (linux-amd64-cgo), const IFF_ALLMULTI = 512 +pkg syscall (linux-amd64-cgo), const IFF_AUTOMEDIA = 16384 +pkg syscall (linux-amd64-cgo), const IFF_DEBUG = 4 +pkg syscall (linux-amd64-cgo), const IFF_DYNAMIC = 32768 +pkg syscall (linux-amd64-cgo), const IFF_LOOPBACK = 8 +pkg syscall (linux-amd64-cgo), const IFF_MASTER = 1024 +pkg syscall (linux-amd64-cgo), const IFF_MULTICAST = 4096 +pkg syscall (linux-amd64-cgo), const IFF_NOARP = 128 +pkg syscall (linux-amd64-cgo), const IFF_NOTRAILERS = 32 +pkg syscall (linux-amd64-cgo), const IFF_NO_PI = 4096 +pkg syscall (linux-amd64-cgo), const IFF_ONE_QUEUE = 8192 +pkg syscall (linux-amd64-cgo), const IFF_POINTOPOINT = 16 +pkg syscall (linux-amd64-cgo), const IFF_PORTSEL = 8192 +pkg syscall (linux-amd64-cgo), const IFF_PROMISC = 256 +pkg syscall (linux-amd64-cgo), const IFF_RUNNING = 64 +pkg syscall (linux-amd64-cgo), const IFF_SLAVE = 2048 +pkg syscall (linux-amd64-cgo), const IFF_TAP = 2 +pkg syscall (linux-amd64-cgo), const IFF_TUN = 1 +pkg syscall (linux-amd64-cgo), const IFF_TUN_EXCL = 32768 +pkg syscall (linux-amd64-cgo), const IFF_VNET_HDR = 16384 +pkg syscall (linux-amd64-cgo), const IFLA_ADDRESS = 1 +pkg syscall (linux-amd64-cgo), const IFLA_BROADCAST = 2 +pkg syscall (linux-amd64-cgo), const IFLA_COST = 8 +pkg syscall (linux-amd64-cgo), const IFLA_IFALIAS = 20 +pkg syscall (linux-amd64-cgo), const IFLA_IFNAME = 3 +pkg syscall (linux-amd64-cgo), const IFLA_LINK = 5 +pkg syscall (linux-amd64-cgo), const IFLA_LINKINFO = 18 +pkg syscall (linux-amd64-cgo), const IFLA_LINKMODE = 17 +pkg syscall (linux-amd64-cgo), const IFLA_MAP = 14 +pkg syscall (linux-amd64-cgo), const IFLA_MASTER = 10 +pkg syscall (linux-amd64-cgo), const IFLA_MAX = 29 +pkg syscall (linux-amd64-cgo), const IFLA_MTU = 4 +pkg syscall (linux-amd64-cgo), const IFLA_NET_NS_PID = 19 +pkg syscall (linux-amd64-cgo), const IFLA_OPERSTATE = 16 +pkg syscall (linux-amd64-cgo), const IFLA_PRIORITY = 9 +pkg syscall (linux-amd64-cgo), const IFLA_PROTINFO = 12 +pkg syscall (linux-amd64-cgo), const IFLA_QDISC = 6 +pkg syscall (linux-amd64-cgo), const IFLA_STATS = 7 +pkg syscall (linux-amd64-cgo), const IFLA_TXQLEN = 13 +pkg syscall (linux-amd64-cgo), const IFLA_UNSPEC = 0 +pkg syscall (linux-amd64-cgo), const IFLA_WEIGHT = 15 +pkg syscall (linux-amd64-cgo), const IFLA_WIRELESS = 11 +pkg syscall (linux-amd64-cgo), const IFNAMSIZ = 16 +pkg syscall (linux-amd64-cgo), const IGNBRK = 1 +pkg syscall (linux-amd64-cgo), const IGNCR = 128 +pkg syscall (linux-amd64-cgo), const IGNPAR = 4 +pkg syscall (linux-amd64-cgo), const IMAXBEL = 8192 +pkg syscall (linux-amd64-cgo), const INLCR = 64 +pkg syscall (linux-amd64-cgo), const INPCK = 16 +pkg syscall (linux-amd64-cgo), const IN_ACCESS = 1 +pkg syscall (linux-amd64-cgo), const IN_ALL_EVENTS = 4095 +pkg syscall (linux-amd64-cgo), const IN_ATTRIB = 4 +pkg syscall (linux-amd64-cgo), const IN_CLASSA_HOST = 16777215 +pkg syscall (linux-amd64-cgo), const IN_CLASSA_MAX = 128 +pkg syscall (linux-amd64-cgo), const IN_CLASSA_NET = 4278190080 +pkg syscall (linux-amd64-cgo), const IN_CLASSA_NSHIFT = 24 +pkg syscall (linux-amd64-cgo), const IN_CLASSB_HOST = 65535 +pkg syscall (linux-amd64-cgo), const IN_CLASSB_MAX = 65536 +pkg syscall (linux-amd64-cgo), const IN_CLASSB_NET = 4294901760 +pkg syscall (linux-amd64-cgo), const IN_CLASSB_NSHIFT = 16 +pkg syscall (linux-amd64-cgo), const IN_CLASSC_HOST = 255 +pkg syscall (linux-amd64-cgo), const IN_CLASSC_NET = 4294967040 +pkg syscall (linux-amd64-cgo), const IN_CLASSC_NSHIFT = 8 +pkg syscall (linux-amd64-cgo), const IN_CLOEXEC = 524288 +pkg syscall (linux-amd64-cgo), const IN_CLOSE = 24 +pkg syscall (linux-amd64-cgo), const IN_CLOSE_NOWRITE = 16 +pkg syscall (linux-amd64-cgo), const IN_CLOSE_WRITE = 8 +pkg syscall (linux-amd64-cgo), const IN_CREATE = 256 +pkg syscall (linux-amd64-cgo), const IN_DELETE = 512 +pkg syscall (linux-amd64-cgo), const IN_DELETE_SELF = 1024 +pkg syscall (linux-amd64-cgo), const IN_DONT_FOLLOW = 33554432 +pkg syscall (linux-amd64-cgo), const IN_EXCL_UNLINK = 67108864 +pkg syscall (linux-amd64-cgo), const IN_IGNORED = 32768 +pkg syscall (linux-amd64-cgo), const IN_ISDIR = 1073741824 +pkg syscall (linux-amd64-cgo), const IN_LOOPBACKNET = 127 +pkg syscall (linux-amd64-cgo), const IN_MASK_ADD = 536870912 +pkg syscall (linux-amd64-cgo), const IN_MODIFY = 2 +pkg syscall (linux-amd64-cgo), const IN_MOVE = 192 +pkg syscall (linux-amd64-cgo), const IN_MOVED_FROM = 64 +pkg syscall (linux-amd64-cgo), const IN_MOVED_TO = 128 +pkg syscall (linux-amd64-cgo), const IN_MOVE_SELF = 2048 +pkg syscall (linux-amd64-cgo), const IN_NONBLOCK = 2048 +pkg syscall (linux-amd64-cgo), const IN_ONESHOT = 2147483648 +pkg syscall (linux-amd64-cgo), const IN_ONLYDIR = 16777216 +pkg syscall (linux-amd64-cgo), const IN_OPEN = 32 +pkg syscall (linux-amd64-cgo), const IN_Q_OVERFLOW = 16384 +pkg syscall (linux-amd64-cgo), const IN_UNMOUNT = 8192 +pkg syscall (linux-amd64-cgo), const IPPROTO_AH = 51 +pkg syscall (linux-amd64-cgo), const IPPROTO_COMP = 108 +pkg syscall (linux-amd64-cgo), const IPPROTO_DCCP = 33 +pkg syscall (linux-amd64-cgo), const IPPROTO_DSTOPTS = 60 +pkg syscall (linux-amd64-cgo), const IPPROTO_EGP = 8 +pkg syscall (linux-amd64-cgo), const IPPROTO_ENCAP = 98 +pkg syscall (linux-amd64-cgo), const IPPROTO_ESP = 50 +pkg syscall (linux-amd64-cgo), const IPPROTO_FRAGMENT = 44 +pkg syscall (linux-amd64-cgo), const IPPROTO_GRE = 47 +pkg syscall (linux-amd64-cgo), const IPPROTO_HOPOPTS = 0 +pkg syscall (linux-amd64-cgo), const IPPROTO_ICMP = 1 +pkg syscall (linux-amd64-cgo), const IPPROTO_ICMPV6 = 58 +pkg syscall (linux-amd64-cgo), const IPPROTO_IDP = 22 +pkg syscall (linux-amd64-cgo), const IPPROTO_IGMP = 2 +pkg syscall (linux-amd64-cgo), const IPPROTO_IPIP = 4 +pkg syscall (linux-amd64-cgo), const IPPROTO_MTP = 92 +pkg syscall (linux-amd64-cgo), const IPPROTO_NONE = 59 +pkg syscall (linux-amd64-cgo), const IPPROTO_PIM = 103 +pkg syscall (linux-amd64-cgo), const IPPROTO_PUP = 12 +pkg syscall (linux-amd64-cgo), const IPPROTO_RAW = 255 +pkg syscall (linux-amd64-cgo), const IPPROTO_ROUTING = 43 +pkg syscall (linux-amd64-cgo), const IPPROTO_RSVP = 46 +pkg syscall (linux-amd64-cgo), const IPPROTO_SCTP = 132 +pkg syscall (linux-amd64-cgo), const IPPROTO_TP = 29 +pkg syscall (linux-amd64-cgo), const IPPROTO_UDPLITE = 136 +pkg syscall (linux-amd64-cgo), const IPV6_2292DSTOPTS = 4 +pkg syscall (linux-amd64-cgo), const IPV6_2292HOPLIMIT = 8 +pkg syscall (linux-amd64-cgo), const IPV6_2292HOPOPTS = 3 +pkg syscall (linux-amd64-cgo), const IPV6_2292PKTINFO = 2 +pkg syscall (linux-amd64-cgo), const IPV6_2292PKTOPTIONS = 6 +pkg syscall (linux-amd64-cgo), const IPV6_2292RTHDR = 5 +pkg syscall (linux-amd64-cgo), const IPV6_ADDRFORM = 1 +pkg syscall (linux-amd64-cgo), const IPV6_ADD_MEMBERSHIP = 20 +pkg syscall (linux-amd64-cgo), const IPV6_AUTHHDR = 10 +pkg syscall (linux-amd64-cgo), const IPV6_CHECKSUM = 7 +pkg syscall (linux-amd64-cgo), const IPV6_DROP_MEMBERSHIP = 21 +pkg syscall (linux-amd64-cgo), const IPV6_DSTOPTS = 59 +pkg syscall (linux-amd64-cgo), const IPV6_HOPLIMIT = 52 +pkg syscall (linux-amd64-cgo), const IPV6_HOPOPTS = 54 +pkg syscall (linux-amd64-cgo), const IPV6_IPSEC_POLICY = 34 +pkg syscall (linux-amd64-cgo), const IPV6_JOIN_ANYCAST = 27 +pkg syscall (linux-amd64-cgo), const IPV6_JOIN_GROUP = 20 +pkg syscall (linux-amd64-cgo), const IPV6_LEAVE_ANYCAST = 28 +pkg syscall (linux-amd64-cgo), const IPV6_LEAVE_GROUP = 21 +pkg syscall (linux-amd64-cgo), const IPV6_MTU = 24 +pkg syscall (linux-amd64-cgo), const IPV6_MTU_DISCOVER = 23 +pkg syscall (linux-amd64-cgo), const IPV6_MULTICAST_HOPS = 18 +pkg syscall (linux-amd64-cgo), const IPV6_MULTICAST_IF = 17 +pkg syscall (linux-amd64-cgo), const IPV6_MULTICAST_LOOP = 19 +pkg syscall (linux-amd64-cgo), const IPV6_NEXTHOP = 9 +pkg syscall (linux-amd64-cgo), const IPV6_PKTINFO = 50 +pkg syscall (linux-amd64-cgo), const IPV6_PMTUDISC_DO = 2 +pkg syscall (linux-amd64-cgo), const IPV6_PMTUDISC_DONT = 0 +pkg syscall (linux-amd64-cgo), const IPV6_PMTUDISC_PROBE = 3 +pkg syscall (linux-amd64-cgo), const IPV6_PMTUDISC_WANT = 1 +pkg syscall (linux-amd64-cgo), const IPV6_RECVDSTOPTS = 58 +pkg syscall (linux-amd64-cgo), const IPV6_RECVERR = 25 +pkg syscall (linux-amd64-cgo), const IPV6_RECVHOPLIMIT = 51 +pkg syscall (linux-amd64-cgo), const IPV6_RECVHOPOPTS = 53 +pkg syscall (linux-amd64-cgo), const IPV6_RECVPKTINFO = 49 +pkg syscall (linux-amd64-cgo), const IPV6_RECVRTHDR = 56 +pkg syscall (linux-amd64-cgo), const IPV6_RECVTCLASS = 66 +pkg syscall (linux-amd64-cgo), const IPV6_ROUTER_ALERT = 22 +pkg syscall (linux-amd64-cgo), const IPV6_RTHDR = 57 +pkg syscall (linux-amd64-cgo), const IPV6_RTHDRDSTOPTS = 55 +pkg syscall (linux-amd64-cgo), const IPV6_RTHDR_LOOSE = 0 +pkg syscall (linux-amd64-cgo), const IPV6_RTHDR_STRICT = 1 +pkg syscall (linux-amd64-cgo), const IPV6_RTHDR_TYPE_0 = 0 +pkg syscall (linux-amd64-cgo), const IPV6_RXDSTOPTS = 59 +pkg syscall (linux-amd64-cgo), const IPV6_RXHOPOPTS = 54 +pkg syscall (linux-amd64-cgo), const IPV6_TCLASS = 67 +pkg syscall (linux-amd64-cgo), const IPV6_UNICAST_HOPS = 16 +pkg syscall (linux-amd64-cgo), const IPV6_V6ONLY = 26 +pkg syscall (linux-amd64-cgo), const IPV6_XFRM_POLICY = 35 +pkg syscall (linux-amd64-cgo), const IP_ADD_MEMBERSHIP = 35 +pkg syscall (linux-amd64-cgo), const IP_ADD_SOURCE_MEMBERSHIP = 39 +pkg syscall (linux-amd64-cgo), const IP_BLOCK_SOURCE = 38 +pkg syscall (linux-amd64-cgo), const IP_DEFAULT_MULTICAST_LOOP = 1 +pkg syscall (linux-amd64-cgo), const IP_DEFAULT_MULTICAST_TTL = 1 +pkg syscall (linux-amd64-cgo), const IP_DF = 16384 +pkg syscall (linux-amd64-cgo), const IP_DROP_MEMBERSHIP = 36 +pkg syscall (linux-amd64-cgo), const IP_DROP_SOURCE_MEMBERSHIP = 40 +pkg syscall (linux-amd64-cgo), const IP_FREEBIND = 15 +pkg syscall (linux-amd64-cgo), const IP_HDRINCL = 3 +pkg syscall (linux-amd64-cgo), const IP_IPSEC_POLICY = 16 +pkg syscall (linux-amd64-cgo), const IP_MAXPACKET = 65535 +pkg syscall (linux-amd64-cgo), const IP_MAX_MEMBERSHIPS = 20 +pkg syscall (linux-amd64-cgo), const IP_MF = 8192 +pkg syscall (linux-amd64-cgo), const IP_MINTTL = 21 +pkg syscall (linux-amd64-cgo), const IP_MSFILTER = 41 +pkg syscall (linux-amd64-cgo), const IP_MSS = 576 +pkg syscall (linux-amd64-cgo), const IP_MTU = 14 +pkg syscall (linux-amd64-cgo), const IP_MTU_DISCOVER = 10 +pkg syscall (linux-amd64-cgo), const IP_MULTICAST_IF = 32 +pkg syscall (linux-amd64-cgo), const IP_MULTICAST_LOOP = 34 +pkg syscall (linux-amd64-cgo), const IP_MULTICAST_TTL = 33 +pkg syscall (linux-amd64-cgo), const IP_OFFMASK = 8191 +pkg syscall (linux-amd64-cgo), const IP_OPTIONS = 4 +pkg syscall (linux-amd64-cgo), const IP_ORIGDSTADDR = 20 +pkg syscall (linux-amd64-cgo), const IP_PASSSEC = 18 +pkg syscall (linux-amd64-cgo), const IP_PKTINFO = 8 +pkg syscall (linux-amd64-cgo), const IP_PKTOPTIONS = 9 +pkg syscall (linux-amd64-cgo), const IP_PMTUDISC = 10 +pkg syscall (linux-amd64-cgo), const IP_PMTUDISC_DO = 2 +pkg syscall (linux-amd64-cgo), const IP_PMTUDISC_DONT = 0 +pkg syscall (linux-amd64-cgo), const IP_PMTUDISC_PROBE = 3 +pkg syscall (linux-amd64-cgo), const IP_PMTUDISC_WANT = 1 +pkg syscall (linux-amd64-cgo), const IP_RECVERR = 11 +pkg syscall (linux-amd64-cgo), const IP_RECVOPTS = 6 +pkg syscall (linux-amd64-cgo), const IP_RECVORIGDSTADDR = 20 +pkg syscall (linux-amd64-cgo), const IP_RECVRETOPTS = 7 +pkg syscall (linux-amd64-cgo), const IP_RECVTOS = 13 +pkg syscall (linux-amd64-cgo), const IP_RECVTTL = 12 +pkg syscall (linux-amd64-cgo), const IP_RETOPTS = 7 +pkg syscall (linux-amd64-cgo), const IP_RF = 32768 +pkg syscall (linux-amd64-cgo), const IP_ROUTER_ALERT = 5 +pkg syscall (linux-amd64-cgo), const IP_TOS = 1 +pkg syscall (linux-amd64-cgo), const IP_TRANSPARENT = 19 +pkg syscall (linux-amd64-cgo), const IP_TTL = 2 +pkg syscall (linux-amd64-cgo), const IP_UNBLOCK_SOURCE = 37 +pkg syscall (linux-amd64-cgo), const IP_XFRM_POLICY = 17 +pkg syscall (linux-amd64-cgo), const ISIG = 1 +pkg syscall (linux-amd64-cgo), const ISTRIP = 32 +pkg syscall (linux-amd64-cgo), const IUCLC = 512 +pkg syscall (linux-amd64-cgo), const IUTF8 = 16384 +pkg syscall (linux-amd64-cgo), const IXANY = 2048 +pkg syscall (linux-amd64-cgo), const IXOFF = 4096 +pkg syscall (linux-amd64-cgo), const IXON = 1024 +pkg syscall (linux-amd64-cgo), const ImplementsGetwd = true +pkg syscall (linux-amd64-cgo), const LINUX_REBOOT_CMD_CAD_OFF = 0 +pkg syscall (linux-amd64-cgo), const LINUX_REBOOT_CMD_CAD_ON = 2309737967 +pkg syscall (linux-amd64-cgo), const LINUX_REBOOT_CMD_HALT = 3454992675 +pkg syscall (linux-amd64-cgo), const LINUX_REBOOT_CMD_KEXEC = 1163412803 +pkg syscall (linux-amd64-cgo), const LINUX_REBOOT_CMD_POWER_OFF = 1126301404 +pkg syscall (linux-amd64-cgo), const LINUX_REBOOT_CMD_RESTART = 19088743 +pkg syscall (linux-amd64-cgo), const LINUX_REBOOT_CMD_RESTART2 = 2712847316 +pkg syscall (linux-amd64-cgo), const LINUX_REBOOT_CMD_SW_SUSPEND = 3489725666 +pkg syscall (linux-amd64-cgo), const LINUX_REBOOT_MAGIC1 = 4276215469 +pkg syscall (linux-amd64-cgo), const LINUX_REBOOT_MAGIC2 = 672274793 +pkg syscall (linux-amd64-cgo), const LOCK_EX = 2 +pkg syscall (linux-amd64-cgo), const LOCK_NB = 4 +pkg syscall (linux-amd64-cgo), const LOCK_SH = 1 +pkg syscall (linux-amd64-cgo), const LOCK_UN = 8 +pkg syscall (linux-amd64-cgo), const MADV_DOFORK = 11 +pkg syscall (linux-amd64-cgo), const MADV_DONTFORK = 10 +pkg syscall (linux-amd64-cgo), const MADV_DONTNEED = 4 +pkg syscall (linux-amd64-cgo), const MADV_HUGEPAGE = 14 +pkg syscall (linux-amd64-cgo), const MADV_HWPOISON = 100 +pkg syscall (linux-amd64-cgo), const MADV_MERGEABLE = 12 +pkg syscall (linux-amd64-cgo), const MADV_NOHUGEPAGE = 15 +pkg syscall (linux-amd64-cgo), const MADV_NORMAL = 0 +pkg syscall (linux-amd64-cgo), const MADV_RANDOM = 1 +pkg syscall (linux-amd64-cgo), const MADV_REMOVE = 9 +pkg syscall (linux-amd64-cgo), const MADV_SEQUENTIAL = 2 +pkg syscall (linux-amd64-cgo), const MADV_UNMERGEABLE = 13 +pkg syscall (linux-amd64-cgo), const MADV_WILLNEED = 3 +pkg syscall (linux-amd64-cgo), const MAP_32BIT = 64 +pkg syscall (linux-amd64-cgo), const MAP_ANON = 32 +pkg syscall (linux-amd64-cgo), const MAP_ANONYMOUS = 32 +pkg syscall (linux-amd64-cgo), const MAP_DENYWRITE = 2048 +pkg syscall (linux-amd64-cgo), const MAP_EXECUTABLE = 4096 +pkg syscall (linux-amd64-cgo), const MAP_FILE = 0 +pkg syscall (linux-amd64-cgo), const MAP_FIXED = 16 +pkg syscall (linux-amd64-cgo), const MAP_GROWSDOWN = 256 +pkg syscall (linux-amd64-cgo), const MAP_HUGETLB = 262144 +pkg syscall (linux-amd64-cgo), const MAP_LOCKED = 8192 +pkg syscall (linux-amd64-cgo), const MAP_NONBLOCK = 65536 +pkg syscall (linux-amd64-cgo), const MAP_NORESERVE = 16384 +pkg syscall (linux-amd64-cgo), const MAP_POPULATE = 32768 +pkg syscall (linux-amd64-cgo), const MAP_PRIVATE = 2 +pkg syscall (linux-amd64-cgo), const MAP_SHARED = 1 +pkg syscall (linux-amd64-cgo), const MAP_STACK = 131072 +pkg syscall (linux-amd64-cgo), const MAP_TYPE = 15 +pkg syscall (linux-amd64-cgo), const MCL_CURRENT = 1 +pkg syscall (linux-amd64-cgo), const MCL_FUTURE = 2 +pkg syscall (linux-amd64-cgo), const MNT_DETACH = 2 +pkg syscall (linux-amd64-cgo), const MNT_EXPIRE = 4 +pkg syscall (linux-amd64-cgo), const MNT_FORCE = 1 +pkg syscall (linux-amd64-cgo), const MSG_CMSG_CLOEXEC = 1073741824 +pkg syscall (linux-amd64-cgo), const MSG_CONFIRM = 2048 +pkg syscall (linux-amd64-cgo), const MSG_CTRUNC = 8 +pkg syscall (linux-amd64-cgo), const MSG_DONTROUTE = 4 +pkg syscall (linux-amd64-cgo), const MSG_DONTWAIT = 64 +pkg syscall (linux-amd64-cgo), const MSG_EOR = 128 +pkg syscall (linux-amd64-cgo), const MSG_ERRQUEUE = 8192 +pkg syscall (linux-amd64-cgo), const MSG_FASTOPEN = 536870912 +pkg syscall (linux-amd64-cgo), const MSG_FASTOPEN ideal-int +pkg syscall (linux-amd64-cgo), const MSG_FIN = 512 +pkg syscall (linux-amd64-cgo), const MSG_MORE = 32768 +pkg syscall (linux-amd64-cgo), const MSG_NOSIGNAL = 16384 +pkg syscall (linux-amd64-cgo), const MSG_OOB = 1 +pkg syscall (linux-amd64-cgo), const MSG_PEEK = 2 +pkg syscall (linux-amd64-cgo), const MSG_PROXY = 16 +pkg syscall (linux-amd64-cgo), const MSG_RST = 4096 +pkg syscall (linux-amd64-cgo), const MSG_SYN = 1024 +pkg syscall (linux-amd64-cgo), const MSG_TRUNC = 32 +pkg syscall (linux-amd64-cgo), const MSG_TRYHARD = 4 +pkg syscall (linux-amd64-cgo), const MSG_WAITALL = 256 +pkg syscall (linux-amd64-cgo), const MSG_WAITFORONE = 65536 +pkg syscall (linux-amd64-cgo), const MS_ACTIVE = 1073741824 +pkg syscall (linux-amd64-cgo), const MS_ASYNC = 1 +pkg syscall (linux-amd64-cgo), const MS_BIND = 4096 +pkg syscall (linux-amd64-cgo), const MS_DIRSYNC = 128 +pkg syscall (linux-amd64-cgo), const MS_INVALIDATE = 2 +pkg syscall (linux-amd64-cgo), const MS_I_VERSION = 8388608 +pkg syscall (linux-amd64-cgo), const MS_KERNMOUNT = 4194304 +pkg syscall (linux-amd64-cgo), const MS_MANDLOCK = 64 +pkg syscall (linux-amd64-cgo), const MS_MGC_MSK = 4294901760 +pkg syscall (linux-amd64-cgo), const MS_MGC_VAL = 3236757504 +pkg syscall (linux-amd64-cgo), const MS_MOVE = 8192 +pkg syscall (linux-amd64-cgo), const MS_NOATIME = 1024 +pkg syscall (linux-amd64-cgo), const MS_NODEV = 4 +pkg syscall (linux-amd64-cgo), const MS_NODIRATIME = 2048 +pkg syscall (linux-amd64-cgo), const MS_NOEXEC = 8 +pkg syscall (linux-amd64-cgo), const MS_NOSUID = 2 +pkg syscall (linux-amd64-cgo), const MS_NOUSER = -2147483648 +pkg syscall (linux-amd64-cgo), const MS_POSIXACL = 65536 +pkg syscall (linux-amd64-cgo), const MS_PRIVATE = 262144 +pkg syscall (linux-amd64-cgo), const MS_RDONLY = 1 +pkg syscall (linux-amd64-cgo), const MS_REC = 16384 +pkg syscall (linux-amd64-cgo), const MS_RELATIME = 2097152 +pkg syscall (linux-amd64-cgo), const MS_REMOUNT = 32 +pkg syscall (linux-amd64-cgo), const MS_RMT_MASK = 8388689 +pkg syscall (linux-amd64-cgo), const MS_SHARED = 1048576 +pkg syscall (linux-amd64-cgo), const MS_SILENT = 32768 +pkg syscall (linux-amd64-cgo), const MS_SLAVE = 524288 +pkg syscall (linux-amd64-cgo), const MS_STRICTATIME = 16777216 +pkg syscall (linux-amd64-cgo), const MS_SYNC = 4 +pkg syscall (linux-amd64-cgo), const MS_SYNCHRONOUS = 16 +pkg syscall (linux-amd64-cgo), const MS_UNBINDABLE = 131072 +pkg syscall (linux-amd64-cgo), const NAME_MAX = 255 +pkg syscall (linux-amd64-cgo), const NETLINK_ADD_MEMBERSHIP = 1 +pkg syscall (linux-amd64-cgo), const NETLINK_AUDIT = 9 +pkg syscall (linux-amd64-cgo), const NETLINK_BROADCAST_ERROR = 4 +pkg syscall (linux-amd64-cgo), const NETLINK_CONNECTOR = 11 +pkg syscall (linux-amd64-cgo), const NETLINK_DNRTMSG = 14 +pkg syscall (linux-amd64-cgo), const NETLINK_DROP_MEMBERSHIP = 2 +pkg syscall (linux-amd64-cgo), const NETLINK_ECRYPTFS = 19 +pkg syscall (linux-amd64-cgo), const NETLINK_FIB_LOOKUP = 10 +pkg syscall (linux-amd64-cgo), const NETLINK_FIREWALL = 3 +pkg syscall (linux-amd64-cgo), const NETLINK_GENERIC = 16 +pkg syscall (linux-amd64-cgo), const NETLINK_INET_DIAG = 4 +pkg syscall (linux-amd64-cgo), const NETLINK_IP6_FW = 13 +pkg syscall (linux-amd64-cgo), const NETLINK_ISCSI = 8 +pkg syscall (linux-amd64-cgo), const NETLINK_KOBJECT_UEVENT = 15 +pkg syscall (linux-amd64-cgo), const NETLINK_NETFILTER = 12 +pkg syscall (linux-amd64-cgo), const NETLINK_NFLOG = 5 +pkg syscall (linux-amd64-cgo), const NETLINK_NO_ENOBUFS = 5 +pkg syscall (linux-amd64-cgo), const NETLINK_PKTINFO = 3 +pkg syscall (linux-amd64-cgo), const NETLINK_ROUTE = 0 +pkg syscall (linux-amd64-cgo), const NETLINK_SCSITRANSPORT = 18 +pkg syscall (linux-amd64-cgo), const NETLINK_SELINUX = 7 +pkg syscall (linux-amd64-cgo), const NETLINK_UNUSED = 1 +pkg syscall (linux-amd64-cgo), const NETLINK_USERSOCK = 2 +pkg syscall (linux-amd64-cgo), const NETLINK_XFRM = 6 +pkg syscall (linux-amd64-cgo), const NLA_ALIGNTO = 4 +pkg syscall (linux-amd64-cgo), const NLA_F_NESTED = 32768 +pkg syscall (linux-amd64-cgo), const NLA_F_NET_BYTEORDER = 16384 +pkg syscall (linux-amd64-cgo), const NLA_HDRLEN = 4 +pkg syscall (linux-amd64-cgo), const NLMSG_ALIGNTO = 4 +pkg syscall (linux-amd64-cgo), const NLMSG_DONE = 3 +pkg syscall (linux-amd64-cgo), const NLMSG_ERROR = 2 +pkg syscall (linux-amd64-cgo), const NLMSG_HDRLEN = 16 +pkg syscall (linux-amd64-cgo), const NLMSG_MIN_TYPE = 16 +pkg syscall (linux-amd64-cgo), const NLMSG_NOOP = 1 +pkg syscall (linux-amd64-cgo), const NLMSG_OVERRUN = 4 +pkg syscall (linux-amd64-cgo), const NLM_F_ACK = 4 +pkg syscall (linux-amd64-cgo), const NLM_F_APPEND = 2048 +pkg syscall (linux-amd64-cgo), const NLM_F_ATOMIC = 1024 +pkg syscall (linux-amd64-cgo), const NLM_F_CREATE = 1024 +pkg syscall (linux-amd64-cgo), const NLM_F_DUMP = 768 +pkg syscall (linux-amd64-cgo), const NLM_F_ECHO = 8 +pkg syscall (linux-amd64-cgo), const NLM_F_EXCL = 512 +pkg syscall (linux-amd64-cgo), const NLM_F_MATCH = 512 +pkg syscall (linux-amd64-cgo), const NLM_F_MULTI = 2 +pkg syscall (linux-amd64-cgo), const NLM_F_REPLACE = 256 +pkg syscall (linux-amd64-cgo), const NLM_F_REQUEST = 1 +pkg syscall (linux-amd64-cgo), const NLM_F_ROOT = 256 +pkg syscall (linux-amd64-cgo), const NOFLSH = 128 +pkg syscall (linux-amd64-cgo), const OCRNL = 8 +pkg syscall (linux-amd64-cgo), const OFDEL = 128 +pkg syscall (linux-amd64-cgo), const OFILL = 64 +pkg syscall (linux-amd64-cgo), const OLCUC = 2 +pkg syscall (linux-amd64-cgo), const ONLCR = 4 +pkg syscall (linux-amd64-cgo), const ONLRET = 32 +pkg syscall (linux-amd64-cgo), const ONOCR = 16 +pkg syscall (linux-amd64-cgo), const OPOST = 1 +pkg syscall (linux-amd64-cgo), const O_ACCMODE = 3 +pkg syscall (linux-amd64-cgo), const O_APPEND = 1024 +pkg syscall (linux-amd64-cgo), const O_ASYNC = 8192 +pkg syscall (linux-amd64-cgo), const O_CLOEXEC = 524288 +pkg syscall (linux-amd64-cgo), const O_CREAT = 64 +pkg syscall (linux-amd64-cgo), const O_DIRECT = 16384 +pkg syscall (linux-amd64-cgo), const O_DIRECTORY = 65536 +pkg syscall (linux-amd64-cgo), const O_DSYNC = 4096 +pkg syscall (linux-amd64-cgo), const O_EXCL = 128 +pkg syscall (linux-amd64-cgo), const O_FSYNC = 1052672 +pkg syscall (linux-amd64-cgo), const O_LARGEFILE = 0 +pkg syscall (linux-amd64-cgo), const O_NDELAY = 2048 +pkg syscall (linux-amd64-cgo), const O_NOATIME = 262144 +pkg syscall (linux-amd64-cgo), const O_NOCTTY = 256 +pkg syscall (linux-amd64-cgo), const O_NOFOLLOW = 131072 +pkg syscall (linux-amd64-cgo), const O_NONBLOCK = 2048 +pkg syscall (linux-amd64-cgo), const O_RSYNC = 1052672 +pkg syscall (linux-amd64-cgo), const O_SYNC = 1052672 +pkg syscall (linux-amd64-cgo), const O_TRUNC = 512 +pkg syscall (linux-amd64-cgo), const PACKET_ADD_MEMBERSHIP = 1 +pkg syscall (linux-amd64-cgo), const PACKET_BROADCAST = 1 +pkg syscall (linux-amd64-cgo), const PACKET_DROP_MEMBERSHIP = 2 +pkg syscall (linux-amd64-cgo), const PACKET_FASTROUTE = 6 +pkg syscall (linux-amd64-cgo), const PACKET_HOST = 0 +pkg syscall (linux-amd64-cgo), const PACKET_LOOPBACK = 5 +pkg syscall (linux-amd64-cgo), const PACKET_MR_ALLMULTI = 2 +pkg syscall (linux-amd64-cgo), const PACKET_MR_MULTICAST = 0 +pkg syscall (linux-amd64-cgo), const PACKET_MR_PROMISC = 1 +pkg syscall (linux-amd64-cgo), const PACKET_MULTICAST = 2 +pkg syscall (linux-amd64-cgo), const PACKET_OTHERHOST = 3 +pkg syscall (linux-amd64-cgo), const PACKET_OUTGOING = 4 +pkg syscall (linux-amd64-cgo), const PACKET_RECV_OUTPUT = 3 +pkg syscall (linux-amd64-cgo), const PACKET_RX_RING = 5 +pkg syscall (linux-amd64-cgo), const PACKET_STATISTICS = 6 +pkg syscall (linux-amd64-cgo), const PARENB = 256 +pkg syscall (linux-amd64-cgo), const PARMRK = 8 +pkg syscall (linux-amd64-cgo), const PARODD = 512 +pkg syscall (linux-amd64-cgo), const PENDIN = 16384 +pkg syscall (linux-amd64-cgo), const PROT_EXEC = 4 +pkg syscall (linux-amd64-cgo), const PROT_GROWSDOWN = 16777216 +pkg syscall (linux-amd64-cgo), const PROT_GROWSUP = 33554432 +pkg syscall (linux-amd64-cgo), const PROT_NONE = 0 +pkg syscall (linux-amd64-cgo), const PROT_READ = 1 +pkg syscall (linux-amd64-cgo), const PROT_WRITE = 2 +pkg syscall (linux-amd64-cgo), const PR_CAPBSET_DROP = 24 +pkg syscall (linux-amd64-cgo), const PR_CAPBSET_READ = 23 +pkg syscall (linux-amd64-cgo), const PR_ENDIAN_BIG = 0 +pkg syscall (linux-amd64-cgo), const PR_ENDIAN_LITTLE = 1 +pkg syscall (linux-amd64-cgo), const PR_ENDIAN_PPC_LITTLE = 2 +pkg syscall (linux-amd64-cgo), const PR_FPEMU_NOPRINT = 1 +pkg syscall (linux-amd64-cgo), const PR_FPEMU_SIGFPE = 2 +pkg syscall (linux-amd64-cgo), const PR_FP_EXC_ASYNC = 2 +pkg syscall (linux-amd64-cgo), const PR_FP_EXC_DISABLED = 0 +pkg syscall (linux-amd64-cgo), const PR_FP_EXC_DIV = 65536 +pkg syscall (linux-amd64-cgo), const PR_FP_EXC_INV = 1048576 +pkg syscall (linux-amd64-cgo), const PR_FP_EXC_NONRECOV = 1 +pkg syscall (linux-amd64-cgo), const PR_FP_EXC_OVF = 131072 +pkg syscall (linux-amd64-cgo), const PR_FP_EXC_PRECISE = 3 +pkg syscall (linux-amd64-cgo), const PR_FP_EXC_RES = 524288 +pkg syscall (linux-amd64-cgo), const PR_FP_EXC_SW_ENABLE = 128 +pkg syscall (linux-amd64-cgo), const PR_FP_EXC_UND = 262144 +pkg syscall (linux-amd64-cgo), const PR_GET_DUMPABLE = 3 +pkg syscall (linux-amd64-cgo), const PR_GET_ENDIAN = 19 +pkg syscall (linux-amd64-cgo), const PR_GET_FPEMU = 9 +pkg syscall (linux-amd64-cgo), const PR_GET_FPEXC = 11 +pkg syscall (linux-amd64-cgo), const PR_GET_KEEPCAPS = 7 +pkg syscall (linux-amd64-cgo), const PR_GET_NAME = 16 +pkg syscall (linux-amd64-cgo), const PR_GET_PDEATHSIG = 2 +pkg syscall (linux-amd64-cgo), const PR_GET_SECCOMP = 21 +pkg syscall (linux-amd64-cgo), const PR_GET_SECUREBITS = 27 +pkg syscall (linux-amd64-cgo), const PR_GET_TIMERSLACK = 30 +pkg syscall (linux-amd64-cgo), const PR_GET_TIMING = 13 +pkg syscall (linux-amd64-cgo), const PR_GET_TSC = 25 +pkg syscall (linux-amd64-cgo), const PR_GET_UNALIGN = 5 +pkg syscall (linux-amd64-cgo), const PR_MCE_KILL = 33 +pkg syscall (linux-amd64-cgo), const PR_MCE_KILL_CLEAR = 0 +pkg syscall (linux-amd64-cgo), const PR_MCE_KILL_DEFAULT = 2 +pkg syscall (linux-amd64-cgo), const PR_MCE_KILL_EARLY = 1 +pkg syscall (linux-amd64-cgo), const PR_MCE_KILL_GET = 34 +pkg syscall (linux-amd64-cgo), const PR_MCE_KILL_LATE = 0 +pkg syscall (linux-amd64-cgo), const PR_MCE_KILL_SET = 1 +pkg syscall (linux-amd64-cgo), const PR_SET_DUMPABLE = 4 +pkg syscall (linux-amd64-cgo), const PR_SET_ENDIAN = 20 +pkg syscall (linux-amd64-cgo), const PR_SET_FPEMU = 10 +pkg syscall (linux-amd64-cgo), const PR_SET_FPEXC = 12 +pkg syscall (linux-amd64-cgo), const PR_SET_KEEPCAPS = 8 +pkg syscall (linux-amd64-cgo), const PR_SET_NAME = 15 +pkg syscall (linux-amd64-cgo), const PR_SET_PDEATHSIG = 1 +pkg syscall (linux-amd64-cgo), const PR_SET_PTRACER = 1499557217 +pkg syscall (linux-amd64-cgo), const PR_SET_SECCOMP = 22 +pkg syscall (linux-amd64-cgo), const PR_SET_SECUREBITS = 28 +pkg syscall (linux-amd64-cgo), const PR_SET_TIMERSLACK = 29 +pkg syscall (linux-amd64-cgo), const PR_SET_TIMING = 14 +pkg syscall (linux-amd64-cgo), const PR_SET_TSC = 26 +pkg syscall (linux-amd64-cgo), const PR_SET_UNALIGN = 6 +pkg syscall (linux-amd64-cgo), const PR_TASK_PERF_EVENTS_DISABLE = 31 +pkg syscall (linux-amd64-cgo), const PR_TASK_PERF_EVENTS_ENABLE = 32 +pkg syscall (linux-amd64-cgo), const PR_TIMING_STATISTICAL = 0 +pkg syscall (linux-amd64-cgo), const PR_TIMING_TIMESTAMP = 1 +pkg syscall (linux-amd64-cgo), const PR_TSC_ENABLE = 1 +pkg syscall (linux-amd64-cgo), const PR_TSC_SIGSEGV = 2 +pkg syscall (linux-amd64-cgo), const PR_UNALIGN_NOPRINT = 1 +pkg syscall (linux-amd64-cgo), const PR_UNALIGN_SIGBUS = 2 +pkg syscall (linux-amd64-cgo), const PTRACE_ARCH_PRCTL = 30 +pkg syscall (linux-amd64-cgo), const PTRACE_ATTACH = 16 +pkg syscall (linux-amd64-cgo), const PTRACE_CONT = 7 +pkg syscall (linux-amd64-cgo), const PTRACE_DETACH = 17 +pkg syscall (linux-amd64-cgo), const PTRACE_EVENT_CLONE = 3 +pkg syscall (linux-amd64-cgo), const PTRACE_EVENT_EXEC = 4 +pkg syscall (linux-amd64-cgo), const PTRACE_EVENT_EXIT = 6 +pkg syscall (linux-amd64-cgo), const PTRACE_EVENT_FORK = 1 +pkg syscall (linux-amd64-cgo), const PTRACE_EVENT_VFORK = 2 +pkg syscall (linux-amd64-cgo), const PTRACE_EVENT_VFORK_DONE = 5 +pkg syscall (linux-amd64-cgo), const PTRACE_GETEVENTMSG = 16897 +pkg syscall (linux-amd64-cgo), const PTRACE_GETFPREGS = 14 +pkg syscall (linux-amd64-cgo), const PTRACE_GETFPXREGS = 18 +pkg syscall (linux-amd64-cgo), const PTRACE_GETREGS = 12 +pkg syscall (linux-amd64-cgo), const PTRACE_GETREGSET = 16900 +pkg syscall (linux-amd64-cgo), const PTRACE_GETSIGINFO = 16898 +pkg syscall (linux-amd64-cgo), const PTRACE_GET_THREAD_AREA = 25 +pkg syscall (linux-amd64-cgo), const PTRACE_KILL = 8 +pkg syscall (linux-amd64-cgo), const PTRACE_OLDSETOPTIONS = 21 +pkg syscall (linux-amd64-cgo), const PTRACE_O_MASK = 127 +pkg syscall (linux-amd64-cgo), const PTRACE_O_TRACECLONE = 8 +pkg syscall (linux-amd64-cgo), const PTRACE_O_TRACEEXEC = 16 +pkg syscall (linux-amd64-cgo), const PTRACE_O_TRACEEXIT = 64 +pkg syscall (linux-amd64-cgo), const PTRACE_O_TRACEFORK = 2 +pkg syscall (linux-amd64-cgo), const PTRACE_O_TRACESYSGOOD = 1 +pkg syscall (linux-amd64-cgo), const PTRACE_O_TRACEVFORK = 4 +pkg syscall (linux-amd64-cgo), const PTRACE_O_TRACEVFORKDONE = 32 +pkg syscall (linux-amd64-cgo), const PTRACE_PEEKDATA = 2 +pkg syscall (linux-amd64-cgo), const PTRACE_PEEKTEXT = 1 +pkg syscall (linux-amd64-cgo), const PTRACE_PEEKUSR = 3 +pkg syscall (linux-amd64-cgo), const PTRACE_POKEDATA = 5 +pkg syscall (linux-amd64-cgo), const PTRACE_POKETEXT = 4 +pkg syscall (linux-amd64-cgo), const PTRACE_POKEUSR = 6 +pkg syscall (linux-amd64-cgo), const PTRACE_SETFPREGS = 15 +pkg syscall (linux-amd64-cgo), const PTRACE_SETFPXREGS = 19 +pkg syscall (linux-amd64-cgo), const PTRACE_SETOPTIONS = 16896 +pkg syscall (linux-amd64-cgo), const PTRACE_SETREGS = 13 +pkg syscall (linux-amd64-cgo), const PTRACE_SETREGSET = 16901 +pkg syscall (linux-amd64-cgo), const PTRACE_SETSIGINFO = 16899 +pkg syscall (linux-amd64-cgo), const PTRACE_SET_THREAD_AREA = 26 +pkg syscall (linux-amd64-cgo), const PTRACE_SINGLEBLOCK = 33 +pkg syscall (linux-amd64-cgo), const PTRACE_SINGLESTEP = 9 +pkg syscall (linux-amd64-cgo), const PTRACE_SYSCALL = 24 +pkg syscall (linux-amd64-cgo), const PTRACE_SYSEMU = 31 +pkg syscall (linux-amd64-cgo), const PTRACE_SYSEMU_SINGLESTEP = 32 +pkg syscall (linux-amd64-cgo), const PTRACE_TRACEME = 0 +pkg syscall (linux-amd64-cgo), const PathMax = 4096 +pkg syscall (linux-amd64-cgo), const RLIMIT_AS = 9 +pkg syscall (linux-amd64-cgo), const RLIMIT_CORE = 4 +pkg syscall (linux-amd64-cgo), const RLIMIT_CPU = 0 +pkg syscall (linux-amd64-cgo), const RLIMIT_DATA = 2 +pkg syscall (linux-amd64-cgo), const RLIMIT_FSIZE = 1 +pkg syscall (linux-amd64-cgo), const RLIMIT_NOFILE = 7 +pkg syscall (linux-amd64-cgo), const RLIMIT_STACK = 3 +pkg syscall (linux-amd64-cgo), const RLIM_INFINITY = -1 +pkg syscall (linux-amd64-cgo), const RTAX_ADVMSS = 8 +pkg syscall (linux-amd64-cgo), const RTAX_CWND = 7 +pkg syscall (linux-amd64-cgo), const RTAX_FEATURES = 12 +pkg syscall (linux-amd64-cgo), const RTAX_FEATURE_ALLFRAG = 8 +pkg syscall (linux-amd64-cgo), const RTAX_FEATURE_ECN = 1 +pkg syscall (linux-amd64-cgo), const RTAX_FEATURE_SACK = 2 +pkg syscall (linux-amd64-cgo), const RTAX_FEATURE_TIMESTAMP = 4 +pkg syscall (linux-amd64-cgo), const RTAX_HOPLIMIT = 10 +pkg syscall (linux-amd64-cgo), const RTAX_INITCWND = 11 +pkg syscall (linux-amd64-cgo), const RTAX_INITRWND = 14 +pkg syscall (linux-amd64-cgo), const RTAX_LOCK = 1 +pkg syscall (linux-amd64-cgo), const RTAX_MAX = 14 +pkg syscall (linux-amd64-cgo), const RTAX_MTU = 2 +pkg syscall (linux-amd64-cgo), const RTAX_REORDERING = 9 +pkg syscall (linux-amd64-cgo), const RTAX_RTO_MIN = 13 +pkg syscall (linux-amd64-cgo), const RTAX_RTT = 4 +pkg syscall (linux-amd64-cgo), const RTAX_RTTVAR = 5 +pkg syscall (linux-amd64-cgo), const RTAX_SSTHRESH = 6 +pkg syscall (linux-amd64-cgo), const RTAX_UNSPEC = 0 +pkg syscall (linux-amd64-cgo), const RTAX_WINDOW = 3 +pkg syscall (linux-amd64-cgo), const RTA_ALIGNTO = 4 +pkg syscall (linux-amd64-cgo), const RTA_CACHEINFO = 12 +pkg syscall (linux-amd64-cgo), const RTA_DST = 1 +pkg syscall (linux-amd64-cgo), const RTA_FLOW = 11 +pkg syscall (linux-amd64-cgo), const RTA_GATEWAY = 5 +pkg syscall (linux-amd64-cgo), const RTA_IIF = 3 +pkg syscall (linux-amd64-cgo), const RTA_MAX = 16 +pkg syscall (linux-amd64-cgo), const RTA_METRICS = 8 +pkg syscall (linux-amd64-cgo), const RTA_MULTIPATH = 9 +pkg syscall (linux-amd64-cgo), const RTA_OIF = 4 +pkg syscall (linux-amd64-cgo), const RTA_PREFSRC = 7 +pkg syscall (linux-amd64-cgo), const RTA_PRIORITY = 6 +pkg syscall (linux-amd64-cgo), const RTA_SRC = 2 +pkg syscall (linux-amd64-cgo), const RTA_TABLE = 15 +pkg syscall (linux-amd64-cgo), const RTA_UNSPEC = 0 +pkg syscall (linux-amd64-cgo), const RTCF_DIRECTSRC = 67108864 +pkg syscall (linux-amd64-cgo), const RTCF_DOREDIRECT = 16777216 +pkg syscall (linux-amd64-cgo), const RTCF_LOG = 33554432 +pkg syscall (linux-amd64-cgo), const RTCF_MASQ = 4194304 +pkg syscall (linux-amd64-cgo), const RTCF_NAT = 8388608 +pkg syscall (linux-amd64-cgo), const RTCF_VALVE = 2097152 +pkg syscall (linux-amd64-cgo), const RTF_ADDRCLASSMASK = 4160749568 +pkg syscall (linux-amd64-cgo), const RTF_ADDRCONF = 262144 +pkg syscall (linux-amd64-cgo), const RTF_ALLONLINK = 131072 +pkg syscall (linux-amd64-cgo), const RTF_BROADCAST = 268435456 +pkg syscall (linux-amd64-cgo), const RTF_CACHE = 16777216 +pkg syscall (linux-amd64-cgo), const RTF_DEFAULT = 65536 +pkg syscall (linux-amd64-cgo), const RTF_DYNAMIC = 16 +pkg syscall (linux-amd64-cgo), const RTF_FLOW = 33554432 +pkg syscall (linux-amd64-cgo), const RTF_GATEWAY = 2 +pkg syscall (linux-amd64-cgo), const RTF_HOST = 4 +pkg syscall (linux-amd64-cgo), const RTF_INTERFACE = 1073741824 +pkg syscall (linux-amd64-cgo), const RTF_IRTT = 256 +pkg syscall (linux-amd64-cgo), const RTF_LINKRT = 1048576 +pkg syscall (linux-amd64-cgo), const RTF_LOCAL = 2147483648 +pkg syscall (linux-amd64-cgo), const RTF_MODIFIED = 32 +pkg syscall (linux-amd64-cgo), const RTF_MSS = 64 +pkg syscall (linux-amd64-cgo), const RTF_MTU = 64 +pkg syscall (linux-amd64-cgo), const RTF_MULTICAST = 536870912 +pkg syscall (linux-amd64-cgo), const RTF_NAT = 134217728 +pkg syscall (linux-amd64-cgo), const RTF_NOFORWARD = 4096 +pkg syscall (linux-amd64-cgo), const RTF_NONEXTHOP = 2097152 +pkg syscall (linux-amd64-cgo), const RTF_NOPMTUDISC = 16384 +pkg syscall (linux-amd64-cgo), const RTF_POLICY = 67108864 +pkg syscall (linux-amd64-cgo), const RTF_REINSTATE = 8 +pkg syscall (linux-amd64-cgo), const RTF_REJECT = 512 +pkg syscall (linux-amd64-cgo), const RTF_STATIC = 1024 +pkg syscall (linux-amd64-cgo), const RTF_THROW = 8192 +pkg syscall (linux-amd64-cgo), const RTF_UP = 1 +pkg syscall (linux-amd64-cgo), const RTF_WINDOW = 128 +pkg syscall (linux-amd64-cgo), const RTF_XRESOLVE = 2048 +pkg syscall (linux-amd64-cgo), const RTM_BASE = 16 +pkg syscall (linux-amd64-cgo), const RTM_DELACTION = 49 +pkg syscall (linux-amd64-cgo), const RTM_DELADDR = 21 +pkg syscall (linux-amd64-cgo), const RTM_DELADDRLABEL = 73 +pkg syscall (linux-amd64-cgo), const RTM_DELLINK = 17 +pkg syscall (linux-amd64-cgo), const RTM_DELNEIGH = 29 +pkg syscall (linux-amd64-cgo), const RTM_DELQDISC = 37 +pkg syscall (linux-amd64-cgo), const RTM_DELROUTE = 25 +pkg syscall (linux-amd64-cgo), const RTM_DELRULE = 33 +pkg syscall (linux-amd64-cgo), const RTM_DELTCLASS = 41 +pkg syscall (linux-amd64-cgo), const RTM_DELTFILTER = 45 +pkg syscall (linux-amd64-cgo), const RTM_F_CLONED = 512 +pkg syscall (linux-amd64-cgo), const RTM_F_EQUALIZE = 1024 +pkg syscall (linux-amd64-cgo), const RTM_F_NOTIFY = 256 +pkg syscall (linux-amd64-cgo), const RTM_F_PREFIX = 2048 +pkg syscall (linux-amd64-cgo), const RTM_GETACTION = 50 +pkg syscall (linux-amd64-cgo), const RTM_GETADDR = 22 +pkg syscall (linux-amd64-cgo), const RTM_GETADDRLABEL = 74 +pkg syscall (linux-amd64-cgo), const RTM_GETANYCAST = 62 +pkg syscall (linux-amd64-cgo), const RTM_GETDCB = 78 +pkg syscall (linux-amd64-cgo), const RTM_GETLINK = 18 +pkg syscall (linux-amd64-cgo), const RTM_GETMULTICAST = 58 +pkg syscall (linux-amd64-cgo), const RTM_GETNEIGH = 30 +pkg syscall (linux-amd64-cgo), const RTM_GETNEIGHTBL = 66 +pkg syscall (linux-amd64-cgo), const RTM_GETQDISC = 38 +pkg syscall (linux-amd64-cgo), const RTM_GETROUTE = 26 +pkg syscall (linux-amd64-cgo), const RTM_GETRULE = 34 +pkg syscall (linux-amd64-cgo), const RTM_GETTCLASS = 42 +pkg syscall (linux-amd64-cgo), const RTM_GETTFILTER = 46 +pkg syscall (linux-amd64-cgo), const RTM_MAX = 79 +pkg syscall (linux-amd64-cgo), const RTM_NEWACTION = 48 +pkg syscall (linux-amd64-cgo), const RTM_NEWADDR = 20 +pkg syscall (linux-amd64-cgo), const RTM_NEWADDRLABEL = 72 +pkg syscall (linux-amd64-cgo), const RTM_NEWLINK = 16 +pkg syscall (linux-amd64-cgo), const RTM_NEWNDUSEROPT = 68 +pkg syscall (linux-amd64-cgo), const RTM_NEWNEIGH = 28 +pkg syscall (linux-amd64-cgo), const RTM_NEWNEIGHTBL = 64 +pkg syscall (linux-amd64-cgo), const RTM_NEWPREFIX = 52 +pkg syscall (linux-amd64-cgo), const RTM_NEWQDISC = 36 +pkg syscall (linux-amd64-cgo), const RTM_NEWROUTE = 24 +pkg syscall (linux-amd64-cgo), const RTM_NEWRULE = 32 +pkg syscall (linux-amd64-cgo), const RTM_NEWTCLASS = 40 +pkg syscall (linux-amd64-cgo), const RTM_NEWTFILTER = 44 +pkg syscall (linux-amd64-cgo), const RTM_NR_FAMILIES = 16 +pkg syscall (linux-amd64-cgo), const RTM_NR_MSGTYPES = 64 +pkg syscall (linux-amd64-cgo), const RTM_SETDCB = 79 +pkg syscall (linux-amd64-cgo), const RTM_SETLINK = 19 +pkg syscall (linux-amd64-cgo), const RTM_SETNEIGHTBL = 67 +pkg syscall (linux-amd64-cgo), const RTNH_ALIGNTO = 4 +pkg syscall (linux-amd64-cgo), const RTNH_F_DEAD = 1 +pkg syscall (linux-amd64-cgo), const RTNH_F_ONLINK = 4 +pkg syscall (linux-amd64-cgo), const RTNH_F_PERVASIVE = 2 +pkg syscall (linux-amd64-cgo), const RTNLGRP_IPV4_IFADDR = 5 +pkg syscall (linux-amd64-cgo), const RTNLGRP_IPV4_IFADDR ideal-int +pkg syscall (linux-amd64-cgo), const RTNLGRP_IPV4_MROUTE = 6 +pkg syscall (linux-amd64-cgo), const RTNLGRP_IPV4_MROUTE ideal-int +pkg syscall (linux-amd64-cgo), const RTNLGRP_IPV4_ROUTE = 7 +pkg syscall (linux-amd64-cgo), const RTNLGRP_IPV4_ROUTE ideal-int +pkg syscall (linux-amd64-cgo), const RTNLGRP_IPV4_RULE = 8 +pkg syscall (linux-amd64-cgo), const RTNLGRP_IPV4_RULE ideal-int +pkg syscall (linux-amd64-cgo), const RTNLGRP_IPV6_IFADDR = 9 +pkg syscall (linux-amd64-cgo), const RTNLGRP_IPV6_IFADDR ideal-int +pkg syscall (linux-amd64-cgo), const RTNLGRP_IPV6_IFINFO = 12 +pkg syscall (linux-amd64-cgo), const RTNLGRP_IPV6_IFINFO ideal-int +pkg syscall (linux-amd64-cgo), const RTNLGRP_IPV6_MROUTE = 10 +pkg syscall (linux-amd64-cgo), const RTNLGRP_IPV6_MROUTE ideal-int +pkg syscall (linux-amd64-cgo), const RTNLGRP_IPV6_PREFIX = 18 +pkg syscall (linux-amd64-cgo), const RTNLGRP_IPV6_PREFIX ideal-int +pkg syscall (linux-amd64-cgo), const RTNLGRP_IPV6_ROUTE = 11 +pkg syscall (linux-amd64-cgo), const RTNLGRP_IPV6_ROUTE ideal-int +pkg syscall (linux-amd64-cgo), const RTNLGRP_IPV6_RULE = 19 +pkg syscall (linux-amd64-cgo), const RTNLGRP_IPV6_RULE ideal-int +pkg syscall (linux-amd64-cgo), const RTNLGRP_LINK = 1 +pkg syscall (linux-amd64-cgo), const RTNLGRP_LINK ideal-int +pkg syscall (linux-amd64-cgo), const RTNLGRP_ND_USEROPT = 20 +pkg syscall (linux-amd64-cgo), const RTNLGRP_ND_USEROPT ideal-int +pkg syscall (linux-amd64-cgo), const RTNLGRP_NEIGH = 3 +pkg syscall (linux-amd64-cgo), const RTNLGRP_NEIGH ideal-int +pkg syscall (linux-amd64-cgo), const RTNLGRP_NONE = 0 +pkg syscall (linux-amd64-cgo), const RTNLGRP_NONE ideal-int +pkg syscall (linux-amd64-cgo), const RTNLGRP_NOTIFY = 2 +pkg syscall (linux-amd64-cgo), const RTNLGRP_NOTIFY ideal-int +pkg syscall (linux-amd64-cgo), const RTNLGRP_TC = 4 +pkg syscall (linux-amd64-cgo), const RTNLGRP_TC ideal-int +pkg syscall (linux-amd64-cgo), const RTN_ANYCAST = 4 +pkg syscall (linux-amd64-cgo), const RTN_BLACKHOLE = 6 +pkg syscall (linux-amd64-cgo), const RTN_BROADCAST = 3 +pkg syscall (linux-amd64-cgo), const RTN_LOCAL = 2 +pkg syscall (linux-amd64-cgo), const RTN_MAX = 11 +pkg syscall (linux-amd64-cgo), const RTN_MULTICAST = 5 +pkg syscall (linux-amd64-cgo), const RTN_NAT = 10 +pkg syscall (linux-amd64-cgo), const RTN_PROHIBIT = 8 +pkg syscall (linux-amd64-cgo), const RTN_THROW = 9 +pkg syscall (linux-amd64-cgo), const RTN_UNICAST = 1 +pkg syscall (linux-amd64-cgo), const RTN_UNREACHABLE = 7 +pkg syscall (linux-amd64-cgo), const RTN_UNSPEC = 0 +pkg syscall (linux-amd64-cgo), const RTN_XRESOLVE = 11 +pkg syscall (linux-amd64-cgo), const RTPROT_BIRD = 12 +pkg syscall (linux-amd64-cgo), const RTPROT_BOOT = 3 +pkg syscall (linux-amd64-cgo), const RTPROT_DHCP = 16 +pkg syscall (linux-amd64-cgo), const RTPROT_DNROUTED = 13 +pkg syscall (linux-amd64-cgo), const RTPROT_GATED = 8 +pkg syscall (linux-amd64-cgo), const RTPROT_KERNEL = 2 +pkg syscall (linux-amd64-cgo), const RTPROT_MRT = 10 +pkg syscall (linux-amd64-cgo), const RTPROT_NTK = 15 +pkg syscall (linux-amd64-cgo), const RTPROT_RA = 9 +pkg syscall (linux-amd64-cgo), const RTPROT_REDIRECT = 1 +pkg syscall (linux-amd64-cgo), const RTPROT_STATIC = 4 +pkg syscall (linux-amd64-cgo), const RTPROT_UNSPEC = 0 +pkg syscall (linux-amd64-cgo), const RTPROT_XORP = 14 +pkg syscall (linux-amd64-cgo), const RTPROT_ZEBRA = 11 +pkg syscall (linux-amd64-cgo), const RT_CLASS_DEFAULT = 253 +pkg syscall (linux-amd64-cgo), const RT_CLASS_LOCAL = 255 +pkg syscall (linux-amd64-cgo), const RT_CLASS_MAIN = 254 +pkg syscall (linux-amd64-cgo), const RT_CLASS_MAX = 255 +pkg syscall (linux-amd64-cgo), const RT_CLASS_UNSPEC = 0 +pkg syscall (linux-amd64-cgo), const RT_SCOPE_HOST = 254 +pkg syscall (linux-amd64-cgo), const RT_SCOPE_LINK = 253 +pkg syscall (linux-amd64-cgo), const RT_SCOPE_NOWHERE = 255 +pkg syscall (linux-amd64-cgo), const RT_SCOPE_SITE = 200 +pkg syscall (linux-amd64-cgo), const RT_SCOPE_UNIVERSE = 0 +pkg syscall (linux-amd64-cgo), const RT_TABLE_COMPAT = 252 +pkg syscall (linux-amd64-cgo), const RT_TABLE_DEFAULT = 253 +pkg syscall (linux-amd64-cgo), const RT_TABLE_LOCAL = 255 +pkg syscall (linux-amd64-cgo), const RT_TABLE_MAIN = 254 +pkg syscall (linux-amd64-cgo), const RT_TABLE_MAX = 4294967295 +pkg syscall (linux-amd64-cgo), const RT_TABLE_UNSPEC = 0 +pkg syscall (linux-amd64-cgo), const RUSAGE_CHILDREN = -1 +pkg syscall (linux-amd64-cgo), const RUSAGE_SELF = 0 +pkg syscall (linux-amd64-cgo), const RUSAGE_THREAD = 1 +pkg syscall (linux-amd64-cgo), const SCM_CREDENTIALS = 2 +pkg syscall (linux-amd64-cgo), const SCM_RIGHTS = 1 +pkg syscall (linux-amd64-cgo), const SCM_TIMESTAMP = 29 +pkg syscall (linux-amd64-cgo), const SCM_TIMESTAMPING = 37 +pkg syscall (linux-amd64-cgo), const SCM_TIMESTAMPNS = 35 +pkg syscall (linux-amd64-cgo), const SIGBUS = 7 +pkg syscall (linux-amd64-cgo), const SIGCHLD = 17 +pkg syscall (linux-amd64-cgo), const SIGCLD = 17 +pkg syscall (linux-amd64-cgo), const SIGCONT = 18 +pkg syscall (linux-amd64-cgo), const SIGIO = 29 +pkg syscall (linux-amd64-cgo), const SIGIOT = 6 +pkg syscall (linux-amd64-cgo), const SIGPOLL = 29 +pkg syscall (linux-amd64-cgo), const SIGPROF = 27 +pkg syscall (linux-amd64-cgo), const SIGPWR = 30 +pkg syscall (linux-amd64-cgo), const SIGSTKFLT = 16 +pkg syscall (linux-amd64-cgo), const SIGSTOP = 19 +pkg syscall (linux-amd64-cgo), const SIGSYS = 31 +pkg syscall (linux-amd64-cgo), const SIGTSTP = 20 +pkg syscall (linux-amd64-cgo), const SIGTTIN = 21 +pkg syscall (linux-amd64-cgo), const SIGTTOU = 22 +pkg syscall (linux-amd64-cgo), const SIGUNUSED = 31 +pkg syscall (linux-amd64-cgo), const SIGURG = 23 +pkg syscall (linux-amd64-cgo), const SIGUSR1 = 10 +pkg syscall (linux-amd64-cgo), const SIGUSR2 = 12 +pkg syscall (linux-amd64-cgo), const SIGVTALRM = 26 +pkg syscall (linux-amd64-cgo), const SIGWINCH = 28 +pkg syscall (linux-amd64-cgo), const SIGXCPU = 24 +pkg syscall (linux-amd64-cgo), const SIGXFSZ = 25 +pkg syscall (linux-amd64-cgo), const SIOCADDDLCI = 35200 +pkg syscall (linux-amd64-cgo), const SIOCADDMULTI = 35121 +pkg syscall (linux-amd64-cgo), const SIOCADDRT = 35083 +pkg syscall (linux-amd64-cgo), const SIOCATMARK = 35077 +pkg syscall (linux-amd64-cgo), const SIOCDARP = 35155 +pkg syscall (linux-amd64-cgo), const SIOCDELDLCI = 35201 +pkg syscall (linux-amd64-cgo), const SIOCDELMULTI = 35122 +pkg syscall (linux-amd64-cgo), const SIOCDELRT = 35084 +pkg syscall (linux-amd64-cgo), const SIOCDEVPRIVATE = 35312 +pkg syscall (linux-amd64-cgo), const SIOCDIFADDR = 35126 +pkg syscall (linux-amd64-cgo), const SIOCDRARP = 35168 +pkg syscall (linux-amd64-cgo), const SIOCGARP = 35156 +pkg syscall (linux-amd64-cgo), const SIOCGIFADDR = 35093 +pkg syscall (linux-amd64-cgo), const SIOCGIFBR = 35136 +pkg syscall (linux-amd64-cgo), const SIOCGIFBRDADDR = 35097 +pkg syscall (linux-amd64-cgo), const SIOCGIFCONF = 35090 +pkg syscall (linux-amd64-cgo), const SIOCGIFCOUNT = 35128 +pkg syscall (linux-amd64-cgo), const SIOCGIFDSTADDR = 35095 +pkg syscall (linux-amd64-cgo), const SIOCGIFENCAP = 35109 +pkg syscall (linux-amd64-cgo), const SIOCGIFFLAGS = 35091 +pkg syscall (linux-amd64-cgo), const SIOCGIFHWADDR = 35111 +pkg syscall (linux-amd64-cgo), const SIOCGIFINDEX = 35123 +pkg syscall (linux-amd64-cgo), const SIOCGIFMAP = 35184 +pkg syscall (linux-amd64-cgo), const SIOCGIFMEM = 35103 +pkg syscall (linux-amd64-cgo), const SIOCGIFMETRIC = 35101 +pkg syscall (linux-amd64-cgo), const SIOCGIFMTU = 35105 +pkg syscall (linux-amd64-cgo), const SIOCGIFNAME = 35088 +pkg syscall (linux-amd64-cgo), const SIOCGIFNETMASK = 35099 +pkg syscall (linux-amd64-cgo), const SIOCGIFPFLAGS = 35125 +pkg syscall (linux-amd64-cgo), const SIOCGIFSLAVE = 35113 +pkg syscall (linux-amd64-cgo), const SIOCGIFTXQLEN = 35138 +pkg syscall (linux-amd64-cgo), const SIOCGPGRP = 35076 +pkg syscall (linux-amd64-cgo), const SIOCGRARP = 35169 +pkg syscall (linux-amd64-cgo), const SIOCGSTAMP = 35078 +pkg syscall (linux-amd64-cgo), const SIOCGSTAMPNS = 35079 +pkg syscall (linux-amd64-cgo), const SIOCPROTOPRIVATE = 35296 +pkg syscall (linux-amd64-cgo), const SIOCRTMSG = 35085 +pkg syscall (linux-amd64-cgo), const SIOCSARP = 35157 +pkg syscall (linux-amd64-cgo), const SIOCSIFADDR = 35094 +pkg syscall (linux-amd64-cgo), const SIOCSIFBR = 35137 +pkg syscall (linux-amd64-cgo), const SIOCSIFBRDADDR = 35098 +pkg syscall (linux-amd64-cgo), const SIOCSIFDSTADDR = 35096 +pkg syscall (linux-amd64-cgo), const SIOCSIFENCAP = 35110 +pkg syscall (linux-amd64-cgo), const SIOCSIFFLAGS = 35092 +pkg syscall (linux-amd64-cgo), const SIOCSIFHWADDR = 35108 +pkg syscall (linux-amd64-cgo), const SIOCSIFHWBROADCAST = 35127 +pkg syscall (linux-amd64-cgo), const SIOCSIFLINK = 35089 +pkg syscall (linux-amd64-cgo), const SIOCSIFMAP = 35185 +pkg syscall (linux-amd64-cgo), const SIOCSIFMEM = 35104 +pkg syscall (linux-amd64-cgo), const SIOCSIFMETRIC = 35102 +pkg syscall (linux-amd64-cgo), const SIOCSIFMTU = 35106 +pkg syscall (linux-amd64-cgo), const SIOCSIFNAME = 35107 +pkg syscall (linux-amd64-cgo), const SIOCSIFNETMASK = 35100 +pkg syscall (linux-amd64-cgo), const SIOCSIFPFLAGS = 35124 +pkg syscall (linux-amd64-cgo), const SIOCSIFSLAVE = 35120 +pkg syscall (linux-amd64-cgo), const SIOCSIFTXQLEN = 35139 +pkg syscall (linux-amd64-cgo), const SIOCSPGRP = 35074 +pkg syscall (linux-amd64-cgo), const SIOCSRARP = 35170 +pkg syscall (linux-amd64-cgo), const SOCK_CLOEXEC = 524288 +pkg syscall (linux-amd64-cgo), const SOCK_DCCP = 6 +pkg syscall (linux-amd64-cgo), const SOCK_NONBLOCK = 2048 +pkg syscall (linux-amd64-cgo), const SOCK_PACKET = 10 +pkg syscall (linux-amd64-cgo), const SOCK_RDM = 4 +pkg syscall (linux-amd64-cgo), const SOL_AAL = 265 +pkg syscall (linux-amd64-cgo), const SOL_ATM = 264 +pkg syscall (linux-amd64-cgo), const SOL_DECNET = 261 +pkg syscall (linux-amd64-cgo), const SOL_ICMPV6 = 58 +pkg syscall (linux-amd64-cgo), const SOL_IP = 0 +pkg syscall (linux-amd64-cgo), const SOL_IPV6 = 41 +pkg syscall (linux-amd64-cgo), const SOL_IRDA = 266 +pkg syscall (linux-amd64-cgo), const SOL_PACKET = 263 +pkg syscall (linux-amd64-cgo), const SOL_RAW = 255 +pkg syscall (linux-amd64-cgo), const SOL_SOCKET = 1 +pkg syscall (linux-amd64-cgo), const SOL_TCP = 6 +pkg syscall (linux-amd64-cgo), const SOL_X25 = 262 +pkg syscall (linux-amd64-cgo), const SOMAXCONN = 128 +pkg syscall (linux-amd64-cgo), const SO_ACCEPTCONN = 30 +pkg syscall (linux-amd64-cgo), const SO_ATTACH_FILTER = 26 +pkg syscall (linux-amd64-cgo), const SO_BINDTODEVICE = 25 +pkg syscall (linux-amd64-cgo), const SO_BROADCAST = 6 +pkg syscall (linux-amd64-cgo), const SO_BSDCOMPAT = 14 +pkg syscall (linux-amd64-cgo), const SO_DEBUG = 1 +pkg syscall (linux-amd64-cgo), const SO_DETACH_FILTER = 27 +pkg syscall (linux-amd64-cgo), const SO_DOMAIN = 39 +pkg syscall (linux-amd64-cgo), const SO_DONTROUTE = 5 +pkg syscall (linux-amd64-cgo), const SO_ERROR = 4 +pkg syscall (linux-amd64-cgo), const SO_KEEPALIVE = 9 +pkg syscall (linux-amd64-cgo), const SO_LINGER = 13 +pkg syscall (linux-amd64-cgo), const SO_MARK = 36 +pkg syscall (linux-amd64-cgo), const SO_NO_CHECK = 11 +pkg syscall (linux-amd64-cgo), const SO_OOBINLINE = 10 +pkg syscall (linux-amd64-cgo), const SO_PASSCRED = 16 +pkg syscall (linux-amd64-cgo), const SO_PASSSEC = 34 +pkg syscall (linux-amd64-cgo), const SO_PEERCRED = 17 +pkg syscall (linux-amd64-cgo), const SO_PEERNAME = 28 +pkg syscall (linux-amd64-cgo), const SO_PEERSEC = 31 +pkg syscall (linux-amd64-cgo), const SO_PRIORITY = 12 +pkg syscall (linux-amd64-cgo), const SO_PROTOCOL = 38 +pkg syscall (linux-amd64-cgo), const SO_RCVBUF = 8 +pkg syscall (linux-amd64-cgo), const SO_RCVBUFFORCE = 33 +pkg syscall (linux-amd64-cgo), const SO_RCVLOWAT = 18 +pkg syscall (linux-amd64-cgo), const SO_RCVTIMEO = 20 +pkg syscall (linux-amd64-cgo), const SO_REUSEADDR = 2 +pkg syscall (linux-amd64-cgo), const SO_RXQ_OVFL = 40 +pkg syscall (linux-amd64-cgo), const SO_SECURITY_AUTHENTICATION = 22 +pkg syscall (linux-amd64-cgo), const SO_SECURITY_ENCRYPTION_NETWORK = 24 +pkg syscall (linux-amd64-cgo), const SO_SECURITY_ENCRYPTION_TRANSPORT = 23 +pkg syscall (linux-amd64-cgo), const SO_SNDBUF = 7 +pkg syscall (linux-amd64-cgo), const SO_SNDBUFFORCE = 32 +pkg syscall (linux-amd64-cgo), const SO_SNDLOWAT = 19 +pkg syscall (linux-amd64-cgo), const SO_SNDTIMEO = 21 +pkg syscall (linux-amd64-cgo), const SO_TIMESTAMP = 29 +pkg syscall (linux-amd64-cgo), const SO_TIMESTAMPING = 37 +pkg syscall (linux-amd64-cgo), const SO_TIMESTAMPNS = 35 +pkg syscall (linux-amd64-cgo), const SO_TYPE = 3 +pkg syscall (linux-amd64-cgo), const SYS_ACCEPT = 43 +pkg syscall (linux-amd64-cgo), const SYS_ACCEPT4 = 288 +pkg syscall (linux-amd64-cgo), const SYS_ACCESS = 21 +pkg syscall (linux-amd64-cgo), const SYS_ACCT = 163 +pkg syscall (linux-amd64-cgo), const SYS_ADD_KEY = 248 +pkg syscall (linux-amd64-cgo), const SYS_ADJTIMEX = 159 +pkg syscall (linux-amd64-cgo), const SYS_AFS_SYSCALL = 183 +pkg syscall (linux-amd64-cgo), const SYS_ALARM = 37 +pkg syscall (linux-amd64-cgo), const SYS_ARCH_PRCTL = 158 +pkg syscall (linux-amd64-cgo), const SYS_BIND = 49 +pkg syscall (linux-amd64-cgo), const SYS_BRK = 12 +pkg syscall (linux-amd64-cgo), const SYS_CAPGET = 125 +pkg syscall (linux-amd64-cgo), const SYS_CAPSET = 126 +pkg syscall (linux-amd64-cgo), const SYS_CHDIR = 80 +pkg syscall (linux-amd64-cgo), const SYS_CHMOD = 90 +pkg syscall (linux-amd64-cgo), const SYS_CHOWN = 92 +pkg syscall (linux-amd64-cgo), const SYS_CHROOT = 161 +pkg syscall (linux-amd64-cgo), const SYS_CLOCK_GETRES = 229 +pkg syscall (linux-amd64-cgo), const SYS_CLOCK_GETTIME = 228 +pkg syscall (linux-amd64-cgo), const SYS_CLOCK_NANOSLEEP = 230 +pkg syscall (linux-amd64-cgo), const SYS_CLOCK_SETTIME = 227 +pkg syscall (linux-amd64-cgo), const SYS_CLONE = 56 +pkg syscall (linux-amd64-cgo), const SYS_CLOSE = 3 +pkg syscall (linux-amd64-cgo), const SYS_CONNECT = 42 +pkg syscall (linux-amd64-cgo), const SYS_CREAT = 85 +pkg syscall (linux-amd64-cgo), const SYS_CREATE_MODULE = 174 +pkg syscall (linux-amd64-cgo), const SYS_DELETE_MODULE = 176 +pkg syscall (linux-amd64-cgo), const SYS_DUP = 32 +pkg syscall (linux-amd64-cgo), const SYS_DUP2 = 33 +pkg syscall (linux-amd64-cgo), const SYS_DUP3 = 292 +pkg syscall (linux-amd64-cgo), const SYS_EPOLL_CREATE = 213 +pkg syscall (linux-amd64-cgo), const SYS_EPOLL_CREATE1 = 291 +pkg syscall (linux-amd64-cgo), const SYS_EPOLL_CTL = 233 +pkg syscall (linux-amd64-cgo), const SYS_EPOLL_CTL_OLD = 214 +pkg syscall (linux-amd64-cgo), const SYS_EPOLL_PWAIT = 281 +pkg syscall (linux-amd64-cgo), const SYS_EPOLL_WAIT = 232 +pkg syscall (linux-amd64-cgo), const SYS_EPOLL_WAIT_OLD = 215 +pkg syscall (linux-amd64-cgo), const SYS_EVENTFD = 284 +pkg syscall (linux-amd64-cgo), const SYS_EVENTFD2 = 290 +pkg syscall (linux-amd64-cgo), const SYS_EXECVE = 59 +pkg syscall (linux-amd64-cgo), const SYS_EXIT = 60 +pkg syscall (linux-amd64-cgo), const SYS_EXIT_GROUP = 231 +pkg syscall (linux-amd64-cgo), const SYS_FACCESSAT = 269 +pkg syscall (linux-amd64-cgo), const SYS_FADVISE64 = 221 +pkg syscall (linux-amd64-cgo), const SYS_FALLOCATE = 285 +pkg syscall (linux-amd64-cgo), const SYS_FANOTIFY_INIT = 300 +pkg syscall (linux-amd64-cgo), const SYS_FANOTIFY_MARK = 301 +pkg syscall (linux-amd64-cgo), const SYS_FCHDIR = 81 +pkg syscall (linux-amd64-cgo), const SYS_FCHMOD = 91 +pkg syscall (linux-amd64-cgo), const SYS_FCHMODAT = 268 +pkg syscall (linux-amd64-cgo), const SYS_FCHOWN = 93 +pkg syscall (linux-amd64-cgo), const SYS_FCHOWNAT = 260 +pkg syscall (linux-amd64-cgo), const SYS_FCNTL = 72 +pkg syscall (linux-amd64-cgo), const SYS_FDATASYNC = 75 +pkg syscall (linux-amd64-cgo), const SYS_FGETXATTR = 193 +pkg syscall (linux-amd64-cgo), const SYS_FLISTXATTR = 196 +pkg syscall (linux-amd64-cgo), const SYS_FLOCK = 73 +pkg syscall (linux-amd64-cgo), const SYS_FORK = 57 +pkg syscall (linux-amd64-cgo), const SYS_FREMOVEXATTR = 199 +pkg syscall (linux-amd64-cgo), const SYS_FSETXATTR = 190 +pkg syscall (linux-amd64-cgo), const SYS_FSTAT = 5 +pkg syscall (linux-amd64-cgo), const SYS_FSTATFS = 138 +pkg syscall (linux-amd64-cgo), const SYS_FSYNC = 74 +pkg syscall (linux-amd64-cgo), const SYS_FTRUNCATE = 77 +pkg syscall (linux-amd64-cgo), const SYS_FUTEX = 202 +pkg syscall (linux-amd64-cgo), const SYS_FUTIMESAT = 261 +pkg syscall (linux-amd64-cgo), const SYS_GETCWD = 79 +pkg syscall (linux-amd64-cgo), const SYS_GETDENTS = 78 +pkg syscall (linux-amd64-cgo), const SYS_GETDENTS64 = 217 +pkg syscall (linux-amd64-cgo), const SYS_GETEGID = 108 +pkg syscall (linux-amd64-cgo), const SYS_GETEUID = 107 +pkg syscall (linux-amd64-cgo), const SYS_GETGID = 104 +pkg syscall (linux-amd64-cgo), const SYS_GETGROUPS = 115 +pkg syscall (linux-amd64-cgo), const SYS_GETITIMER = 36 +pkg syscall (linux-amd64-cgo), const SYS_GETPEERNAME = 52 +pkg syscall (linux-amd64-cgo), const SYS_GETPGID = 121 +pkg syscall (linux-amd64-cgo), const SYS_GETPGRP = 111 +pkg syscall (linux-amd64-cgo), const SYS_GETPID = 39 +pkg syscall (linux-amd64-cgo), const SYS_GETPMSG = 181 +pkg syscall (linux-amd64-cgo), const SYS_GETPPID = 110 +pkg syscall (linux-amd64-cgo), const SYS_GETPRIORITY = 140 +pkg syscall (linux-amd64-cgo), const SYS_GETRESGID = 120 +pkg syscall (linux-amd64-cgo), const SYS_GETRESUID = 118 +pkg syscall (linux-amd64-cgo), const SYS_GETRLIMIT = 97 +pkg syscall (linux-amd64-cgo), const SYS_GETRUSAGE = 98 +pkg syscall (linux-amd64-cgo), const SYS_GETSID = 124 +pkg syscall (linux-amd64-cgo), const SYS_GETSOCKNAME = 51 +pkg syscall (linux-amd64-cgo), const SYS_GETSOCKOPT = 55 +pkg syscall (linux-amd64-cgo), const SYS_GETTID = 186 +pkg syscall (linux-amd64-cgo), const SYS_GETTIMEOFDAY = 96 +pkg syscall (linux-amd64-cgo), const SYS_GETUID = 102 +pkg syscall (linux-amd64-cgo), const SYS_GETXATTR = 191 +pkg syscall (linux-amd64-cgo), const SYS_GET_KERNEL_SYMS = 177 +pkg syscall (linux-amd64-cgo), const SYS_GET_MEMPOLICY = 239 +pkg syscall (linux-amd64-cgo), const SYS_GET_ROBUST_LIST = 274 +pkg syscall (linux-amd64-cgo), const SYS_GET_THREAD_AREA = 211 +pkg syscall (linux-amd64-cgo), const SYS_INIT_MODULE = 175 +pkg syscall (linux-amd64-cgo), const SYS_INOTIFY_ADD_WATCH = 254 +pkg syscall (linux-amd64-cgo), const SYS_INOTIFY_INIT = 253 +pkg syscall (linux-amd64-cgo), const SYS_INOTIFY_INIT1 = 294 +pkg syscall (linux-amd64-cgo), const SYS_INOTIFY_RM_WATCH = 255 +pkg syscall (linux-amd64-cgo), const SYS_IOCTL = 16 +pkg syscall (linux-amd64-cgo), const SYS_IOPERM = 173 +pkg syscall (linux-amd64-cgo), const SYS_IOPL = 172 +pkg syscall (linux-amd64-cgo), const SYS_IOPRIO_GET = 252 +pkg syscall (linux-amd64-cgo), const SYS_IOPRIO_SET = 251 +pkg syscall (linux-amd64-cgo), const SYS_IO_CANCEL = 210 +pkg syscall (linux-amd64-cgo), const SYS_IO_DESTROY = 207 +pkg syscall (linux-amd64-cgo), const SYS_IO_GETEVENTS = 208 +pkg syscall (linux-amd64-cgo), const SYS_IO_SETUP = 206 +pkg syscall (linux-amd64-cgo), const SYS_IO_SUBMIT = 209 +pkg syscall (linux-amd64-cgo), const SYS_KEXEC_LOAD = 246 +pkg syscall (linux-amd64-cgo), const SYS_KEYCTL = 250 +pkg syscall (linux-amd64-cgo), const SYS_KILL = 62 +pkg syscall (linux-amd64-cgo), const SYS_LCHOWN = 94 +pkg syscall (linux-amd64-cgo), const SYS_LGETXATTR = 192 +pkg syscall (linux-amd64-cgo), const SYS_LINK = 86 +pkg syscall (linux-amd64-cgo), const SYS_LINKAT = 265 +pkg syscall (linux-amd64-cgo), const SYS_LISTEN = 50 +pkg syscall (linux-amd64-cgo), const SYS_LISTXATTR = 194 +pkg syscall (linux-amd64-cgo), const SYS_LLISTXATTR = 195 +pkg syscall (linux-amd64-cgo), const SYS_LOOKUP_DCOOKIE = 212 +pkg syscall (linux-amd64-cgo), const SYS_LREMOVEXATTR = 198 +pkg syscall (linux-amd64-cgo), const SYS_LSEEK = 8 +pkg syscall (linux-amd64-cgo), const SYS_LSETXATTR = 189 +pkg syscall (linux-amd64-cgo), const SYS_LSTAT = 6 +pkg syscall (linux-amd64-cgo), const SYS_MADVISE = 28 +pkg syscall (linux-amd64-cgo), const SYS_MBIND = 237 +pkg syscall (linux-amd64-cgo), const SYS_MIGRATE_PAGES = 256 +pkg syscall (linux-amd64-cgo), const SYS_MINCORE = 27 +pkg syscall (linux-amd64-cgo), const SYS_MKDIR = 83 +pkg syscall (linux-amd64-cgo), const SYS_MKDIRAT = 258 +pkg syscall (linux-amd64-cgo), const SYS_MKNOD = 133 +pkg syscall (linux-amd64-cgo), const SYS_MKNODAT = 259 +pkg syscall (linux-amd64-cgo), const SYS_MLOCK = 149 +pkg syscall (linux-amd64-cgo), const SYS_MLOCKALL = 151 +pkg syscall (linux-amd64-cgo), const SYS_MMAP = 9 +pkg syscall (linux-amd64-cgo), const SYS_MODIFY_LDT = 154 +pkg syscall (linux-amd64-cgo), const SYS_MOUNT = 165 +pkg syscall (linux-amd64-cgo), const SYS_MOVE_PAGES = 279 +pkg syscall (linux-amd64-cgo), const SYS_MPROTECT = 10 +pkg syscall (linux-amd64-cgo), const SYS_MQ_GETSETATTR = 245 +pkg syscall (linux-amd64-cgo), const SYS_MQ_NOTIFY = 244 +pkg syscall (linux-amd64-cgo), const SYS_MQ_OPEN = 240 +pkg syscall (linux-amd64-cgo), const SYS_MQ_TIMEDRECEIVE = 243 +pkg syscall (linux-amd64-cgo), const SYS_MQ_TIMEDSEND = 242 +pkg syscall (linux-amd64-cgo), const SYS_MQ_UNLINK = 241 +pkg syscall (linux-amd64-cgo), const SYS_MREMAP = 25 +pkg syscall (linux-amd64-cgo), const SYS_MSGCTL = 71 +pkg syscall (linux-amd64-cgo), const SYS_MSGGET = 68 +pkg syscall (linux-amd64-cgo), const SYS_MSGRCV = 70 +pkg syscall (linux-amd64-cgo), const SYS_MSGSND = 69 +pkg syscall (linux-amd64-cgo), const SYS_MSYNC = 26 +pkg syscall (linux-amd64-cgo), const SYS_MUNLOCK = 150 +pkg syscall (linux-amd64-cgo), const SYS_MUNLOCKALL = 152 +pkg syscall (linux-amd64-cgo), const SYS_MUNMAP = 11 +pkg syscall (linux-amd64-cgo), const SYS_NANOSLEEP = 35 +pkg syscall (linux-amd64-cgo), const SYS_NEWFSTATAT = 262 +pkg syscall (linux-amd64-cgo), const SYS_NFSSERVCTL = 180 +pkg syscall (linux-amd64-cgo), const SYS_OPEN = 2 +pkg syscall (linux-amd64-cgo), const SYS_OPENAT = 257 +pkg syscall (linux-amd64-cgo), const SYS_PAUSE = 34 +pkg syscall (linux-amd64-cgo), const SYS_PERF_EVENT_OPEN = 298 +pkg syscall (linux-amd64-cgo), const SYS_PERSONALITY = 135 +pkg syscall (linux-amd64-cgo), const SYS_PIPE = 22 +pkg syscall (linux-amd64-cgo), const SYS_PIPE2 = 293 +pkg syscall (linux-amd64-cgo), const SYS_PIVOT_ROOT = 155 +pkg syscall (linux-amd64-cgo), const SYS_POLL = 7 +pkg syscall (linux-amd64-cgo), const SYS_PPOLL = 271 +pkg syscall (linux-amd64-cgo), const SYS_PRCTL = 157 +pkg syscall (linux-amd64-cgo), const SYS_PREAD64 = 17 +pkg syscall (linux-amd64-cgo), const SYS_PREADV = 295 +pkg syscall (linux-amd64-cgo), const SYS_PRLIMIT64 = 302 +pkg syscall (linux-amd64-cgo), const SYS_PSELECT6 = 270 +pkg syscall (linux-amd64-cgo), const SYS_PTRACE = 101 +pkg syscall (linux-amd64-cgo), const SYS_PUTPMSG = 182 +pkg syscall (linux-amd64-cgo), const SYS_PWRITE64 = 18 +pkg syscall (linux-amd64-cgo), const SYS_PWRITEV = 296 +pkg syscall (linux-amd64-cgo), const SYS_QUERY_MODULE = 178 +pkg syscall (linux-amd64-cgo), const SYS_QUOTACTL = 179 +pkg syscall (linux-amd64-cgo), const SYS_READ = 0 +pkg syscall (linux-amd64-cgo), const SYS_READAHEAD = 187 +pkg syscall (linux-amd64-cgo), const SYS_READLINK = 89 +pkg syscall (linux-amd64-cgo), const SYS_READLINKAT = 267 +pkg syscall (linux-amd64-cgo), const SYS_READV = 19 +pkg syscall (linux-amd64-cgo), const SYS_REBOOT = 169 +pkg syscall (linux-amd64-cgo), const SYS_RECVFROM = 45 +pkg syscall (linux-amd64-cgo), const SYS_RECVMMSG = 299 +pkg syscall (linux-amd64-cgo), const SYS_RECVMSG = 47 +pkg syscall (linux-amd64-cgo), const SYS_REMAP_FILE_PAGES = 216 +pkg syscall (linux-amd64-cgo), const SYS_REMOVEXATTR = 197 +pkg syscall (linux-amd64-cgo), const SYS_RENAME = 82 +pkg syscall (linux-amd64-cgo), const SYS_RENAMEAT = 264 +pkg syscall (linux-amd64-cgo), const SYS_REQUEST_KEY = 249 +pkg syscall (linux-amd64-cgo), const SYS_RESTART_SYSCALL = 219 +pkg syscall (linux-amd64-cgo), const SYS_RMDIR = 84 +pkg syscall (linux-amd64-cgo), const SYS_RT_SIGACTION = 13 +pkg syscall (linux-amd64-cgo), const SYS_RT_SIGPENDING = 127 +pkg syscall (linux-amd64-cgo), const SYS_RT_SIGPROCMASK = 14 +pkg syscall (linux-amd64-cgo), const SYS_RT_SIGQUEUEINFO = 129 +pkg syscall (linux-amd64-cgo), const SYS_RT_SIGRETURN = 15 +pkg syscall (linux-amd64-cgo), const SYS_RT_SIGSUSPEND = 130 +pkg syscall (linux-amd64-cgo), const SYS_RT_SIGTIMEDWAIT = 128 +pkg syscall (linux-amd64-cgo), const SYS_RT_TGSIGQUEUEINFO = 297 +pkg syscall (linux-amd64-cgo), const SYS_SCHED_GETAFFINITY = 204 +pkg syscall (linux-amd64-cgo), const SYS_SCHED_GETPARAM = 143 +pkg syscall (linux-amd64-cgo), const SYS_SCHED_GETSCHEDULER = 145 +pkg syscall (linux-amd64-cgo), const SYS_SCHED_GET_PRIORITY_MAX = 146 +pkg syscall (linux-amd64-cgo), const SYS_SCHED_GET_PRIORITY_MIN = 147 +pkg syscall (linux-amd64-cgo), const SYS_SCHED_RR_GET_INTERVAL = 148 +pkg syscall (linux-amd64-cgo), const SYS_SCHED_SETAFFINITY = 203 +pkg syscall (linux-amd64-cgo), const SYS_SCHED_SETPARAM = 142 +pkg syscall (linux-amd64-cgo), const SYS_SCHED_SETSCHEDULER = 144 +pkg syscall (linux-amd64-cgo), const SYS_SCHED_YIELD = 24 +pkg syscall (linux-amd64-cgo), const SYS_SECURITY = 185 +pkg syscall (linux-amd64-cgo), const SYS_SELECT = 23 +pkg syscall (linux-amd64-cgo), const SYS_SEMCTL = 66 +pkg syscall (linux-amd64-cgo), const SYS_SEMGET = 64 +pkg syscall (linux-amd64-cgo), const SYS_SEMOP = 65 +pkg syscall (linux-amd64-cgo), const SYS_SEMTIMEDOP = 220 +pkg syscall (linux-amd64-cgo), const SYS_SENDFILE = 40 +pkg syscall (linux-amd64-cgo), const SYS_SENDMSG = 46 +pkg syscall (linux-amd64-cgo), const SYS_SENDTO = 44 +pkg syscall (linux-amd64-cgo), const SYS_SETDOMAINNAME = 171 +pkg syscall (linux-amd64-cgo), const SYS_SETFSGID = 123 +pkg syscall (linux-amd64-cgo), const SYS_SETFSUID = 122 +pkg syscall (linux-amd64-cgo), const SYS_SETGID = 106 +pkg syscall (linux-amd64-cgo), const SYS_SETGROUPS = 116 +pkg syscall (linux-amd64-cgo), const SYS_SETHOSTNAME = 170 +pkg syscall (linux-amd64-cgo), const SYS_SETITIMER = 38 +pkg syscall (linux-amd64-cgo), const SYS_SETPGID = 109 +pkg syscall (linux-amd64-cgo), const SYS_SETPRIORITY = 141 +pkg syscall (linux-amd64-cgo), const SYS_SETREGID = 114 +pkg syscall (linux-amd64-cgo), const SYS_SETRESGID = 119 +pkg syscall (linux-amd64-cgo), const SYS_SETRESUID = 117 +pkg syscall (linux-amd64-cgo), const SYS_SETREUID = 113 +pkg syscall (linux-amd64-cgo), const SYS_SETRLIMIT = 160 +pkg syscall (linux-amd64-cgo), const SYS_SETSID = 112 +pkg syscall (linux-amd64-cgo), const SYS_SETSOCKOPT = 54 +pkg syscall (linux-amd64-cgo), const SYS_SETTIMEOFDAY = 164 +pkg syscall (linux-amd64-cgo), const SYS_SETUID = 105 +pkg syscall (linux-amd64-cgo), const SYS_SETXATTR = 188 +pkg syscall (linux-amd64-cgo), const SYS_SET_MEMPOLICY = 238 +pkg syscall (linux-amd64-cgo), const SYS_SET_ROBUST_LIST = 273 +pkg syscall (linux-amd64-cgo), const SYS_SET_THREAD_AREA = 205 +pkg syscall (linux-amd64-cgo), const SYS_SET_TID_ADDRESS = 218 +pkg syscall (linux-amd64-cgo), const SYS_SHMAT = 30 +pkg syscall (linux-amd64-cgo), const SYS_SHMCTL = 31 +pkg syscall (linux-amd64-cgo), const SYS_SHMDT = 67 +pkg syscall (linux-amd64-cgo), const SYS_SHMGET = 29 +pkg syscall (linux-amd64-cgo), const SYS_SHUTDOWN = 48 +pkg syscall (linux-amd64-cgo), const SYS_SIGALTSTACK = 131 +pkg syscall (linux-amd64-cgo), const SYS_SIGNALFD = 282 +pkg syscall (linux-amd64-cgo), const SYS_SIGNALFD4 = 289 +pkg syscall (linux-amd64-cgo), const SYS_SOCKET = 41 +pkg syscall (linux-amd64-cgo), const SYS_SOCKETPAIR = 53 +pkg syscall (linux-amd64-cgo), const SYS_SPLICE = 275 +pkg syscall (linux-amd64-cgo), const SYS_STAT = 4 +pkg syscall (linux-amd64-cgo), const SYS_STATFS = 137 +pkg syscall (linux-amd64-cgo), const SYS_SWAPOFF = 168 +pkg syscall (linux-amd64-cgo), const SYS_SWAPON = 167 +pkg syscall (linux-amd64-cgo), const SYS_SYMLINK = 88 +pkg syscall (linux-amd64-cgo), const SYS_SYMLINKAT = 266 +pkg syscall (linux-amd64-cgo), const SYS_SYNC = 162 +pkg syscall (linux-amd64-cgo), const SYS_SYNC_FILE_RANGE = 277 +pkg syscall (linux-amd64-cgo), const SYS_SYSFS = 139 +pkg syscall (linux-amd64-cgo), const SYS_SYSINFO = 99 +pkg syscall (linux-amd64-cgo), const SYS_SYSLOG = 103 +pkg syscall (linux-amd64-cgo), const SYS_TEE = 276 +pkg syscall (linux-amd64-cgo), const SYS_TGKILL = 234 +pkg syscall (linux-amd64-cgo), const SYS_TIME = 201 +pkg syscall (linux-amd64-cgo), const SYS_TIMERFD_CREATE = 283 +pkg syscall (linux-amd64-cgo), const SYS_TIMERFD_GETTIME = 287 +pkg syscall (linux-amd64-cgo), const SYS_TIMERFD_SETTIME = 286 +pkg syscall (linux-amd64-cgo), const SYS_TIMER_CREATE = 222 +pkg syscall (linux-amd64-cgo), const SYS_TIMER_DELETE = 226 +pkg syscall (linux-amd64-cgo), const SYS_TIMER_GETOVERRUN = 225 +pkg syscall (linux-amd64-cgo), const SYS_TIMER_GETTIME = 224 +pkg syscall (linux-amd64-cgo), const SYS_TIMER_SETTIME = 223 +pkg syscall (linux-amd64-cgo), const SYS_TIMES = 100 +pkg syscall (linux-amd64-cgo), const SYS_TKILL = 200 +pkg syscall (linux-amd64-cgo), const SYS_TRUNCATE = 76 +pkg syscall (linux-amd64-cgo), const SYS_TUXCALL = 184 +pkg syscall (linux-amd64-cgo), const SYS_UMASK = 95 +pkg syscall (linux-amd64-cgo), const SYS_UMOUNT2 = 166 +pkg syscall (linux-amd64-cgo), const SYS_UNAME = 63 +pkg syscall (linux-amd64-cgo), const SYS_UNLINK = 87 +pkg syscall (linux-amd64-cgo), const SYS_UNLINKAT = 263 +pkg syscall (linux-amd64-cgo), const SYS_UNSHARE = 272 +pkg syscall (linux-amd64-cgo), const SYS_USELIB = 134 +pkg syscall (linux-amd64-cgo), const SYS_USTAT = 136 +pkg syscall (linux-amd64-cgo), const SYS_UTIME = 132 +pkg syscall (linux-amd64-cgo), const SYS_UTIMENSAT = 280 +pkg syscall (linux-amd64-cgo), const SYS_UTIMES = 235 +pkg syscall (linux-amd64-cgo), const SYS_VFORK = 58 +pkg syscall (linux-amd64-cgo), const SYS_VHANGUP = 153 +pkg syscall (linux-amd64-cgo), const SYS_VMSPLICE = 278 +pkg syscall (linux-amd64-cgo), const SYS_VSERVER = 236 +pkg syscall (linux-amd64-cgo), const SYS_WAIT4 = 61 +pkg syscall (linux-amd64-cgo), const SYS_WAITID = 247 +pkg syscall (linux-amd64-cgo), const SYS_WRITE = 1 +pkg syscall (linux-amd64-cgo), const SYS_WRITEV = 20 +pkg syscall (linux-amd64-cgo), const SYS__SYSCTL = 156 +pkg syscall (linux-amd64-cgo), const S_BLKSIZE = 512 +pkg syscall (linux-amd64-cgo), const S_IEXEC = 64 +pkg syscall (linux-amd64-cgo), const S_IFMT = 61440 +pkg syscall (linux-amd64-cgo), const S_IREAD = 256 +pkg syscall (linux-amd64-cgo), const S_IRGRP = 32 +pkg syscall (linux-amd64-cgo), const S_IROTH = 4 +pkg syscall (linux-amd64-cgo), const S_IRWXG = 56 +pkg syscall (linux-amd64-cgo), const S_IRWXO = 7 +pkg syscall (linux-amd64-cgo), const S_IRWXU = 448 +pkg syscall (linux-amd64-cgo), const S_IWGRP = 16 +pkg syscall (linux-amd64-cgo), const S_IWOTH = 2 +pkg syscall (linux-amd64-cgo), const S_IWRITE = 128 +pkg syscall (linux-amd64-cgo), const S_IXGRP = 8 +pkg syscall (linux-amd64-cgo), const S_IXOTH = 1 +pkg syscall (linux-amd64-cgo), const SizeofCmsghdr = 16 +pkg syscall (linux-amd64-cgo), const SizeofIPMreq = 8 +pkg syscall (linux-amd64-cgo), const SizeofIPMreqn = 12 +pkg syscall (linux-amd64-cgo), const SizeofIPv6Mreq = 20 +pkg syscall (linux-amd64-cgo), const SizeofIfAddrmsg = 8 +pkg syscall (linux-amd64-cgo), const SizeofIfInfomsg = 16 +pkg syscall (linux-amd64-cgo), const SizeofInet4Pktinfo = 12 +pkg syscall (linux-amd64-cgo), const SizeofInet6Pktinfo = 20 +pkg syscall (linux-amd64-cgo), const SizeofInotifyEvent = 16 +pkg syscall (linux-amd64-cgo), const SizeofLinger = 8 +pkg syscall (linux-amd64-cgo), const SizeofMsghdr = 56 +pkg syscall (linux-amd64-cgo), const SizeofNlAttr = 4 +pkg syscall (linux-amd64-cgo), const SizeofNlMsgerr = 20 +pkg syscall (linux-amd64-cgo), const SizeofNlMsghdr = 16 +pkg syscall (linux-amd64-cgo), const SizeofRtAttr = 4 +pkg syscall (linux-amd64-cgo), const SizeofRtGenmsg = 1 +pkg syscall (linux-amd64-cgo), const SizeofRtMsg = 12 +pkg syscall (linux-amd64-cgo), const SizeofRtNexthop = 8 +pkg syscall (linux-amd64-cgo), const SizeofSockFilter = 8 +pkg syscall (linux-amd64-cgo), const SizeofSockFprog = 16 +pkg syscall (linux-amd64-cgo), const SizeofSockaddrAny = 112 +pkg syscall (linux-amd64-cgo), const SizeofSockaddrInet4 = 16 +pkg syscall (linux-amd64-cgo), const SizeofSockaddrInet6 = 28 +pkg syscall (linux-amd64-cgo), const SizeofSockaddrLinklayer = 20 +pkg syscall (linux-amd64-cgo), const SizeofSockaddrNetlink = 12 +pkg syscall (linux-amd64-cgo), const SizeofSockaddrUnix = 110 +pkg syscall (linux-amd64-cgo), const SizeofTCPInfo = 104 +pkg syscall (linux-amd64-cgo), const SizeofTCPInfo ideal-int +pkg syscall (linux-amd64-cgo), const SizeofUcred = 12 +pkg syscall (linux-amd64-cgo), const TCGETS = 21505 +pkg syscall (linux-amd64-cgo), const TCP_CONGESTION = 13 +pkg syscall (linux-amd64-cgo), const TCP_CORK = 3 +pkg syscall (linux-amd64-cgo), const TCP_DEFER_ACCEPT = 9 +pkg syscall (linux-amd64-cgo), const TCP_INFO = 11 +pkg syscall (linux-amd64-cgo), const TCP_KEEPCNT = 6 +pkg syscall (linux-amd64-cgo), const TCP_KEEPIDLE = 4 +pkg syscall (linux-amd64-cgo), const TCP_KEEPINTVL = 5 +pkg syscall (linux-amd64-cgo), const TCP_LINGER2 = 8 +pkg syscall (linux-amd64-cgo), const TCP_MAXSEG = 2 +pkg syscall (linux-amd64-cgo), const TCP_MAXWIN = 65535 +pkg syscall (linux-amd64-cgo), const TCP_MAX_WINSHIFT = 14 +pkg syscall (linux-amd64-cgo), const TCP_MD5SIG = 14 +pkg syscall (linux-amd64-cgo), const TCP_MD5SIG_MAXKEYLEN = 80 +pkg syscall (linux-amd64-cgo), const TCP_MSS = 512 +pkg syscall (linux-amd64-cgo), const TCP_QUICKACK = 12 +pkg syscall (linux-amd64-cgo), const TCP_SYNCNT = 7 +pkg syscall (linux-amd64-cgo), const TCP_WINDOW_CLAMP = 10 +pkg syscall (linux-amd64-cgo), const TCSETS = 21506 +pkg syscall (linux-amd64-cgo), const TIOCCBRK = 21544 +pkg syscall (linux-amd64-cgo), const TIOCCONS = 21533 +pkg syscall (linux-amd64-cgo), const TIOCEXCL = 21516 +pkg syscall (linux-amd64-cgo), const TIOCGDEV = 2147767346 +pkg syscall (linux-amd64-cgo), const TIOCGETD = 21540 +pkg syscall (linux-amd64-cgo), const TIOCGICOUNT = 21597 +pkg syscall (linux-amd64-cgo), const TIOCGLCKTRMIOS = 21590 +pkg syscall (linux-amd64-cgo), const TIOCGPGRP = 21519 +pkg syscall (linux-amd64-cgo), const TIOCGPTN = 2147767344 +pkg syscall (linux-amd64-cgo), const TIOCGRS485 = 21550 +pkg syscall (linux-amd64-cgo), const TIOCGSERIAL = 21534 +pkg syscall (linux-amd64-cgo), const TIOCGSID = 21545 +pkg syscall (linux-amd64-cgo), const TIOCGSOFTCAR = 21529 +pkg syscall (linux-amd64-cgo), const TIOCGWINSZ = 21523 +pkg syscall (linux-amd64-cgo), const TIOCINQ = 21531 +pkg syscall (linux-amd64-cgo), const TIOCLINUX = 21532 +pkg syscall (linux-amd64-cgo), const TIOCMBIC = 21527 +pkg syscall (linux-amd64-cgo), const TIOCMBIS = 21526 +pkg syscall (linux-amd64-cgo), const TIOCMGET = 21525 +pkg syscall (linux-amd64-cgo), const TIOCMIWAIT = 21596 +pkg syscall (linux-amd64-cgo), const TIOCMSET = 21528 +pkg syscall (linux-amd64-cgo), const TIOCM_CAR = 64 +pkg syscall (linux-amd64-cgo), const TIOCM_CD = 64 +pkg syscall (linux-amd64-cgo), const TIOCM_CTS = 32 +pkg syscall (linux-amd64-cgo), const TIOCM_DSR = 256 +pkg syscall (linux-amd64-cgo), const TIOCM_DTR = 2 +pkg syscall (linux-amd64-cgo), const TIOCM_LE = 1 +pkg syscall (linux-amd64-cgo), const TIOCM_RI = 128 +pkg syscall (linux-amd64-cgo), const TIOCM_RNG = 128 +pkg syscall (linux-amd64-cgo), const TIOCM_RTS = 4 +pkg syscall (linux-amd64-cgo), const TIOCM_SR = 16 +pkg syscall (linux-amd64-cgo), const TIOCM_ST = 8 +pkg syscall (linux-amd64-cgo), const TIOCNOTTY = 21538 +pkg syscall (linux-amd64-cgo), const TIOCNXCL = 21517 +pkg syscall (linux-amd64-cgo), const TIOCOUTQ = 21521 +pkg syscall (linux-amd64-cgo), const TIOCPKT = 21536 +pkg syscall (linux-amd64-cgo), const TIOCPKT_DATA = 0 +pkg syscall (linux-amd64-cgo), const TIOCPKT_DOSTOP = 32 +pkg syscall (linux-amd64-cgo), const TIOCPKT_FLUSHREAD = 1 +pkg syscall (linux-amd64-cgo), const TIOCPKT_FLUSHWRITE = 2 +pkg syscall (linux-amd64-cgo), const TIOCPKT_IOCTL = 64 +pkg syscall (linux-amd64-cgo), const TIOCPKT_NOSTOP = 16 +pkg syscall (linux-amd64-cgo), const TIOCPKT_START = 8 +pkg syscall (linux-amd64-cgo), const TIOCPKT_STOP = 4 +pkg syscall (linux-amd64-cgo), const TIOCSBRK = 21543 +pkg syscall (linux-amd64-cgo), const TIOCSCTTY = 21518 +pkg syscall (linux-amd64-cgo), const TIOCSERCONFIG = 21587 +pkg syscall (linux-amd64-cgo), const TIOCSERGETLSR = 21593 +pkg syscall (linux-amd64-cgo), const TIOCSERGETMULTI = 21594 +pkg syscall (linux-amd64-cgo), const TIOCSERGSTRUCT = 21592 +pkg syscall (linux-amd64-cgo), const TIOCSERGWILD = 21588 +pkg syscall (linux-amd64-cgo), const TIOCSERSETMULTI = 21595 +pkg syscall (linux-amd64-cgo), const TIOCSERSWILD = 21589 +pkg syscall (linux-amd64-cgo), const TIOCSER_TEMT = 1 +pkg syscall (linux-amd64-cgo), const TIOCSETD = 21539 +pkg syscall (linux-amd64-cgo), const TIOCSIG = 1074025526 +pkg syscall (linux-amd64-cgo), const TIOCSLCKTRMIOS = 21591 +pkg syscall (linux-amd64-cgo), const TIOCSPGRP = 21520 +pkg syscall (linux-amd64-cgo), const TIOCSPTLCK = 1074025521 +pkg syscall (linux-amd64-cgo), const TIOCSRS485 = 21551 +pkg syscall (linux-amd64-cgo), const TIOCSSERIAL = 21535 +pkg syscall (linux-amd64-cgo), const TIOCSSOFTCAR = 21530 +pkg syscall (linux-amd64-cgo), const TIOCSTI = 21522 +pkg syscall (linux-amd64-cgo), const TIOCSWINSZ = 21524 +pkg syscall (linux-amd64-cgo), const TOSTOP = 256 +pkg syscall (linux-amd64-cgo), const TUNATTACHFILTER = 1074812117 +pkg syscall (linux-amd64-cgo), const TUNDETACHFILTER = 1074812118 +pkg syscall (linux-amd64-cgo), const TUNGETFEATURES = 2147767503 +pkg syscall (linux-amd64-cgo), const TUNGETIFF = 2147767506 +pkg syscall (linux-amd64-cgo), const TUNGETSNDBUF = 2147767507 +pkg syscall (linux-amd64-cgo), const TUNGETVNETHDRSZ = 2147767511 +pkg syscall (linux-amd64-cgo), const TUNSETDEBUG = 1074025673 +pkg syscall (linux-amd64-cgo), const TUNSETGROUP = 1074025678 +pkg syscall (linux-amd64-cgo), const TUNSETIFF = 1074025674 +pkg syscall (linux-amd64-cgo), const TUNSETLINK = 1074025677 +pkg syscall (linux-amd64-cgo), const TUNSETNOCSUM = 1074025672 +pkg syscall (linux-amd64-cgo), const TUNSETOFFLOAD = 1074025680 +pkg syscall (linux-amd64-cgo), const TUNSETOWNER = 1074025676 +pkg syscall (linux-amd64-cgo), const TUNSETPERSIST = 1074025675 +pkg syscall (linux-amd64-cgo), const TUNSETSNDBUF = 1074025684 +pkg syscall (linux-amd64-cgo), const TUNSETTXFILTER = 1074025681 +pkg syscall (linux-amd64-cgo), const TUNSETVNETHDRSZ = 1074025688 +pkg syscall (linux-amd64-cgo), const VDISCARD = 13 +pkg syscall (linux-amd64-cgo), const VEOF = 4 +pkg syscall (linux-amd64-cgo), const VEOL = 11 +pkg syscall (linux-amd64-cgo), const VEOL2 = 16 +pkg syscall (linux-amd64-cgo), const VERASE = 2 +pkg syscall (linux-amd64-cgo), const VINTR = 0 +pkg syscall (linux-amd64-cgo), const VKILL = 3 +pkg syscall (linux-amd64-cgo), const VLNEXT = 15 +pkg syscall (linux-amd64-cgo), const VMIN = 6 +pkg syscall (linux-amd64-cgo), const VQUIT = 1 +pkg syscall (linux-amd64-cgo), const VREPRINT = 12 +pkg syscall (linux-amd64-cgo), const VSTART = 8 +pkg syscall (linux-amd64-cgo), const VSTOP = 9 +pkg syscall (linux-amd64-cgo), const VSUSP = 10 +pkg syscall (linux-amd64-cgo), const VSWTC = 7 +pkg syscall (linux-amd64-cgo), const VTIME = 5 +pkg syscall (linux-amd64-cgo), const VWERASE = 14 +pkg syscall (linux-amd64-cgo), const WALL = 1073741824 +pkg syscall (linux-amd64-cgo), const WCLONE = 2147483648 +pkg syscall (linux-amd64-cgo), const WCONTINUED = 8 +pkg syscall (linux-amd64-cgo), const WEXITED = 4 +pkg syscall (linux-amd64-cgo), const WNOHANG = 1 +pkg syscall (linux-amd64-cgo), const WNOTHREAD = 536870912 +pkg syscall (linux-amd64-cgo), const WNOWAIT = 16777216 +pkg syscall (linux-amd64-cgo), const WORDSIZE = 64 +pkg syscall (linux-amd64-cgo), const WSTOPPED = 2 +pkg syscall (linux-amd64-cgo), const WUNTRACED = 2 +pkg syscall (linux-amd64-cgo), const XCASE = 4 +pkg syscall (linux-amd64-cgo), func Accept4(int, int) (int, Sockaddr, error) +pkg syscall (linux-amd64-cgo), func GetsockoptUcred(int, int, int) (*Ucred, error) +pkg syscall (linux-amd64-cgo), func Getxattr(string, string, []uint8) (int, error) +pkg syscall (linux-amd64-cgo), func Listxattr(string, []uint8) (int, error) +pkg syscall (linux-amd64-cgo), func Pipe2([]int, int) error +pkg syscall (linux-amd64-cgo), func PtraceSyscall(int, int) error +pkg syscall (linux-amd64-cgo), func Removexattr(string, string) error +pkg syscall (linux-amd64-cgo), func Setxattr(string, string, []uint8, int) error +pkg syscall (linux-amd64-cgo), func SlicePtrFromStrings([]string) ([]*uint8, error) +pkg syscall (linux-amd64-cgo), type SysProcAttr struct, Ctty int +pkg syscall (linux-amd64-cgo), type TCPInfo struct +pkg syscall (linux-amd64-cgo), type TCPInfo struct, Advmss uint32 +pkg syscall (linux-amd64-cgo), type TCPInfo struct, Ato uint32 +pkg syscall (linux-amd64-cgo), type TCPInfo struct, Backoff uint8 +pkg syscall (linux-amd64-cgo), type TCPInfo struct, Ca_state uint8 +pkg syscall (linux-amd64-cgo), type TCPInfo struct, Fackets uint32 +pkg syscall (linux-amd64-cgo), type TCPInfo struct, Last_ack_recv uint32 +pkg syscall (linux-amd64-cgo), type TCPInfo struct, Last_ack_sent uint32 +pkg syscall (linux-amd64-cgo), type TCPInfo struct, Last_data_recv uint32 +pkg syscall (linux-amd64-cgo), type TCPInfo struct, Last_data_sent uint32 +pkg syscall (linux-amd64-cgo), type TCPInfo struct, Lost uint32 +pkg syscall (linux-amd64-cgo), type TCPInfo struct, Options uint8 +pkg syscall (linux-amd64-cgo), type TCPInfo struct, Pad_cgo_0 [2]uint8 +pkg syscall (linux-amd64-cgo), type TCPInfo struct, Pmtu uint32 +pkg syscall (linux-amd64-cgo), type TCPInfo struct, Probes uint8 +pkg syscall (linux-amd64-cgo), type TCPInfo struct, Rcv_mss uint32 +pkg syscall (linux-amd64-cgo), type TCPInfo struct, Rcv_rtt uint32 +pkg syscall (linux-amd64-cgo), type TCPInfo struct, Rcv_space uint32 +pkg syscall (linux-amd64-cgo), type TCPInfo struct, Rcv_ssthresh uint32 +pkg syscall (linux-amd64-cgo), type TCPInfo struct, Reordering uint32 +pkg syscall (linux-amd64-cgo), type TCPInfo struct, Retrans uint32 +pkg syscall (linux-amd64-cgo), type TCPInfo struct, Retransmits uint8 +pkg syscall (linux-amd64-cgo), type TCPInfo struct, Rto uint32 +pkg syscall (linux-amd64-cgo), type TCPInfo struct, Rtt uint32 +pkg syscall (linux-amd64-cgo), type TCPInfo struct, Rttvar uint32 +pkg syscall (linux-amd64-cgo), type TCPInfo struct, Sacked uint32 +pkg syscall (linux-amd64-cgo), type TCPInfo struct, Snd_cwnd uint32 +pkg syscall (linux-amd64-cgo), type TCPInfo struct, Snd_mss uint32 +pkg syscall (linux-amd64-cgo), type TCPInfo struct, Snd_ssthresh uint32 +pkg syscall (linux-amd64-cgo), type TCPInfo struct, State uint8 +pkg syscall (linux-amd64-cgo), type TCPInfo struct, Total_retrans uint32 +pkg syscall (linux-amd64-cgo), type TCPInfo struct, Unacked uint32 +pkg syscall (linux-arm), const AF_ALG = 38 +pkg syscall (linux-arm), const AF_APPLETALK = 5 +pkg syscall (linux-arm), const AF_ASH = 18 +pkg syscall (linux-arm), const AF_ATMPVC = 8 +pkg syscall (linux-arm), const AF_ATMSVC = 20 +pkg syscall (linux-arm), const AF_AX25 = 3 +pkg syscall (linux-arm), const AF_BLUETOOTH = 31 +pkg syscall (linux-arm), const AF_BRIDGE = 7 +pkg syscall (linux-arm), const AF_CAIF = 37 +pkg syscall (linux-arm), const AF_CAN = 29 +pkg syscall (linux-arm), const AF_DECnet = 12 +pkg syscall (linux-arm), const AF_ECONET = 19 +pkg syscall (linux-arm), const AF_FILE = 1 +pkg syscall (linux-arm), const AF_IEEE802154 = 36 +pkg syscall (linux-arm), const AF_INET6 = 10 +pkg syscall (linux-arm), const AF_IPX = 4 +pkg syscall (linux-arm), const AF_IRDA = 23 +pkg syscall (linux-arm), const AF_ISDN = 34 +pkg syscall (linux-arm), const AF_IUCV = 32 +pkg syscall (linux-arm), const AF_KEY = 15 +pkg syscall (linux-arm), const AF_LLC = 26 +pkg syscall (linux-arm), const AF_LOCAL = 1 +pkg syscall (linux-arm), const AF_MAX = 39 +pkg syscall (linux-arm), const AF_NETBEUI = 13 +pkg syscall (linux-arm), const AF_NETLINK = 16 +pkg syscall (linux-arm), const AF_NETROM = 6 +pkg syscall (linux-arm), const AF_PACKET = 17 +pkg syscall (linux-arm), const AF_PHONET = 35 +pkg syscall (linux-arm), const AF_PPPOX = 24 +pkg syscall (linux-arm), const AF_RDS = 21 +pkg syscall (linux-arm), const AF_ROSE = 11 +pkg syscall (linux-arm), const AF_ROUTE = 16 +pkg syscall (linux-arm), const AF_RXRPC = 33 +pkg syscall (linux-arm), const AF_SECURITY = 14 +pkg syscall (linux-arm), const AF_SNA = 22 +pkg syscall (linux-arm), const AF_TIPC = 30 +pkg syscall (linux-arm), const AF_WANPIPE = 25 +pkg syscall (linux-arm), const AF_X25 = 9 +pkg syscall (linux-arm), const ARPHRD_ADAPT = 264 +pkg syscall (linux-arm), const ARPHRD_APPLETLK = 8 +pkg syscall (linux-arm), const ARPHRD_ARCNET = 7 +pkg syscall (linux-arm), const ARPHRD_ASH = 781 +pkg syscall (linux-arm), const ARPHRD_ATM = 19 +pkg syscall (linux-arm), const ARPHRD_AX25 = 3 +pkg syscall (linux-arm), const ARPHRD_BIF = 775 +pkg syscall (linux-arm), const ARPHRD_CHAOS = 5 +pkg syscall (linux-arm), const ARPHRD_CISCO = 513 +pkg syscall (linux-arm), const ARPHRD_CSLIP = 257 +pkg syscall (linux-arm), const ARPHRD_CSLIP6 = 259 +pkg syscall (linux-arm), const ARPHRD_DDCMP = 517 +pkg syscall (linux-arm), const ARPHRD_DLCI = 15 +pkg syscall (linux-arm), const ARPHRD_ECONET = 782 +pkg syscall (linux-arm), const ARPHRD_EETHER = 2 +pkg syscall (linux-arm), const ARPHRD_ETHER = 1 +pkg syscall (linux-arm), const ARPHRD_EUI64 = 27 +pkg syscall (linux-arm), const ARPHRD_FCAL = 785 +pkg syscall (linux-arm), const ARPHRD_FCFABRIC = 787 +pkg syscall (linux-arm), const ARPHRD_FCPL = 786 +pkg syscall (linux-arm), const ARPHRD_FCPP = 784 +pkg syscall (linux-arm), const ARPHRD_FDDI = 774 +pkg syscall (linux-arm), const ARPHRD_FRAD = 770 +pkg syscall (linux-arm), const ARPHRD_HDLC = 513 +pkg syscall (linux-arm), const ARPHRD_HIPPI = 780 +pkg syscall (linux-arm), const ARPHRD_HWX25 = 272 +pkg syscall (linux-arm), const ARPHRD_IEEE1394 = 24 +pkg syscall (linux-arm), const ARPHRD_IEEE802 = 6 +pkg syscall (linux-arm), const ARPHRD_IEEE80211 = 801 +pkg syscall (linux-arm), const ARPHRD_IEEE80211_PRISM = 802 +pkg syscall (linux-arm), const ARPHRD_IEEE80211_RADIOTAP = 803 +pkg syscall (linux-arm), const ARPHRD_IEEE802154 = 804 +pkg syscall (linux-arm), const ARPHRD_IEEE802154_PHY = 805 +pkg syscall (linux-arm), const ARPHRD_IEEE802_TR = 800 +pkg syscall (linux-arm), const ARPHRD_INFINIBAND = 32 +pkg syscall (linux-arm), const ARPHRD_IPDDP = 777 +pkg syscall (linux-arm), const ARPHRD_IPGRE = 778 +pkg syscall (linux-arm), const ARPHRD_IRDA = 783 +pkg syscall (linux-arm), const ARPHRD_LAPB = 516 +pkg syscall (linux-arm), const ARPHRD_LOCALTLK = 773 +pkg syscall (linux-arm), const ARPHRD_LOOPBACK = 772 +pkg syscall (linux-arm), const ARPHRD_METRICOM = 23 +pkg syscall (linux-arm), const ARPHRD_NETROM = 0 +pkg syscall (linux-arm), const ARPHRD_NONE = 65534 +pkg syscall (linux-arm), const ARPHRD_PIMREG = 779 +pkg syscall (linux-arm), const ARPHRD_PPP = 512 +pkg syscall (linux-arm), const ARPHRD_PRONET = 4 +pkg syscall (linux-arm), const ARPHRD_RAWHDLC = 518 +pkg syscall (linux-arm), const ARPHRD_ROSE = 270 +pkg syscall (linux-arm), const ARPHRD_RSRVD = 260 +pkg syscall (linux-arm), const ARPHRD_SIT = 776 +pkg syscall (linux-arm), const ARPHRD_SKIP = 771 +pkg syscall (linux-arm), const ARPHRD_SLIP = 256 +pkg syscall (linux-arm), const ARPHRD_SLIP6 = 258 +pkg syscall (linux-arm), const ARPHRD_TUNNEL = 768 +pkg syscall (linux-arm), const ARPHRD_TUNNEL6 = 769 +pkg syscall (linux-arm), const ARPHRD_VOID = 65535 +pkg syscall (linux-arm), const ARPHRD_X25 = 271 +pkg syscall (linux-arm), const B0 = 0 +pkg syscall (linux-arm), const B1000000 = 4104 +pkg syscall (linux-arm), const B110 = 3 +pkg syscall (linux-arm), const B115200 = 4098 +pkg syscall (linux-arm), const B1152000 = 4105 +pkg syscall (linux-arm), const B1200 = 9 +pkg syscall (linux-arm), const B134 = 4 +pkg syscall (linux-arm), const B150 = 5 +pkg syscall (linux-arm), const B1500000 = 4106 +pkg syscall (linux-arm), const B1800 = 10 +pkg syscall (linux-arm), const B19200 = 14 +pkg syscall (linux-arm), const B200 = 6 +pkg syscall (linux-arm), const B2000000 = 4107 +pkg syscall (linux-arm), const B230400 = 4099 +pkg syscall (linux-arm), const B2400 = 11 +pkg syscall (linux-arm), const B2500000 = 4108 +pkg syscall (linux-arm), const B300 = 7 +pkg syscall (linux-arm), const B3000000 = 4109 +pkg syscall (linux-arm), const B3500000 = 4110 +pkg syscall (linux-arm), const B38400 = 15 +pkg syscall (linux-arm), const B4000000 = 4111 +pkg syscall (linux-arm), const B460800 = 4100 +pkg syscall (linux-arm), const B4800 = 12 +pkg syscall (linux-arm), const B50 = 1 +pkg syscall (linux-arm), const B500000 = 4101 +pkg syscall (linux-arm), const B57600 = 4097 +pkg syscall (linux-arm), const B576000 = 4102 +pkg syscall (linux-arm), const B600 = 8 +pkg syscall (linux-arm), const B75 = 2 +pkg syscall (linux-arm), const B921600 = 4103 +pkg syscall (linux-arm), const B9600 = 13 +pkg syscall (linux-arm), const BPF_A = 16 +pkg syscall (linux-arm), const BPF_ABS = 32 +pkg syscall (linux-arm), const BPF_ADD = 0 +pkg syscall (linux-arm), const BPF_ALU = 4 +pkg syscall (linux-arm), const BPF_AND = 80 +pkg syscall (linux-arm), const BPF_B = 16 +pkg syscall (linux-arm), const BPF_DIV = 48 +pkg syscall (linux-arm), const BPF_H = 8 +pkg syscall (linux-arm), const BPF_IMM = 0 +pkg syscall (linux-arm), const BPF_IND = 64 +pkg syscall (linux-arm), const BPF_JA = 0 +pkg syscall (linux-arm), const BPF_JEQ = 16 +pkg syscall (linux-arm), const BPF_JGE = 48 +pkg syscall (linux-arm), const BPF_JGT = 32 +pkg syscall (linux-arm), const BPF_JMP = 5 +pkg syscall (linux-arm), const BPF_JSET = 64 +pkg syscall (linux-arm), const BPF_K = 0 +pkg syscall (linux-arm), const BPF_LD = 0 +pkg syscall (linux-arm), const BPF_LDX = 1 +pkg syscall (linux-arm), const BPF_LEN = 128 +pkg syscall (linux-arm), const BPF_LSH = 96 +pkg syscall (linux-arm), const BPF_MAJOR_VERSION = 1 +pkg syscall (linux-arm), const BPF_MAXINSNS = 4096 +pkg syscall (linux-arm), const BPF_MEM = 96 +pkg syscall (linux-arm), const BPF_MEMWORDS = 16 +pkg syscall (linux-arm), const BPF_MINOR_VERSION = 1 +pkg syscall (linux-arm), const BPF_MISC = 7 +pkg syscall (linux-arm), const BPF_MSH = 160 +pkg syscall (linux-arm), const BPF_MUL = 32 +pkg syscall (linux-arm), const BPF_NEG = 128 +pkg syscall (linux-arm), const BPF_OR = 64 +pkg syscall (linux-arm), const BPF_RET = 6 +pkg syscall (linux-arm), const BPF_RSH = 112 +pkg syscall (linux-arm), const BPF_ST = 2 +pkg syscall (linux-arm), const BPF_STX = 3 +pkg syscall (linux-arm), const BPF_SUB = 16 +pkg syscall (linux-arm), const BPF_TAX = 0 +pkg syscall (linux-arm), const BPF_TXA = 128 +pkg syscall (linux-arm), const BPF_W = 0 +pkg syscall (linux-arm), const BPF_X = 8 +pkg syscall (linux-arm), const BRKINT = 2 +pkg syscall (linux-arm), const CLOCAL = 2048 +pkg syscall (linux-arm), const CREAD = 128 +pkg syscall (linux-arm), const CS5 = 0 +pkg syscall (linux-arm), const CS6 = 16 +pkg syscall (linux-arm), const CS7 = 32 +pkg syscall (linux-arm), const CS8 = 48 +pkg syscall (linux-arm), const CSIZE = 48 +pkg syscall (linux-arm), const CSTOPB = 64 +pkg syscall (linux-arm), const DT_BLK = 6 +pkg syscall (linux-arm), const DT_CHR = 2 +pkg syscall (linux-arm), const DT_DIR = 4 +pkg syscall (linux-arm), const DT_FIFO = 1 +pkg syscall (linux-arm), const DT_LNK = 10 +pkg syscall (linux-arm), const DT_REG = 8 +pkg syscall (linux-arm), const DT_SOCK = 12 +pkg syscall (linux-arm), const DT_UNKNOWN = 0 +pkg syscall (linux-arm), const DT_WHT = 14 +pkg syscall (linux-arm), const E2BIG = 7 +pkg syscall (linux-arm), const EACCES = 13 +pkg syscall (linux-arm), const EADDRINUSE = 98 +pkg syscall (linux-arm), const EADDRNOTAVAIL = 99 +pkg syscall (linux-arm), const EADV = 68 +pkg syscall (linux-arm), const EAFNOSUPPORT = 97 +pkg syscall (linux-arm), const EAGAIN = 11 +pkg syscall (linux-arm), const EALREADY = 114 +pkg syscall (linux-arm), const EBADE = 52 +pkg syscall (linux-arm), const EBADF = 9 +pkg syscall (linux-arm), const EBADFD = 77 +pkg syscall (linux-arm), const EBADMSG = 74 +pkg syscall (linux-arm), const EBADR = 53 +pkg syscall (linux-arm), const EBADRQC = 56 +pkg syscall (linux-arm), const EBADSLT = 57 +pkg syscall (linux-arm), const EBFONT = 59 +pkg syscall (linux-arm), const EBUSY = 16 +pkg syscall (linux-arm), const ECANCELED = 125 +pkg syscall (linux-arm), const ECHILD = 10 +pkg syscall (linux-arm), const ECHO = 8 +pkg syscall (linux-arm), const ECHOCTL = 512 +pkg syscall (linux-arm), const ECHOE = 16 +pkg syscall (linux-arm), const ECHOK = 32 +pkg syscall (linux-arm), const ECHOKE = 2048 +pkg syscall (linux-arm), const ECHONL = 64 +pkg syscall (linux-arm), const ECHOPRT = 1024 +pkg syscall (linux-arm), const ECHRNG = 44 +pkg syscall (linux-arm), const ECOMM = 70 +pkg syscall (linux-arm), const ECONNABORTED = 103 +pkg syscall (linux-arm), const ECONNREFUSED = 111 +pkg syscall (linux-arm), const ECONNRESET = 104 +pkg syscall (linux-arm), const EDEADLK = 35 +pkg syscall (linux-arm), const EDEADLOCK = 35 +pkg syscall (linux-arm), const EDESTADDRREQ = 89 +pkg syscall (linux-arm), const EDOM = 33 +pkg syscall (linux-arm), const EDOTDOT = 73 +pkg syscall (linux-arm), const EDQUOT = 122 +pkg syscall (linux-arm), const EEXIST = 17 +pkg syscall (linux-arm), const EFAULT = 14 +pkg syscall (linux-arm), const EFBIG = 27 +pkg syscall (linux-arm), const EHOSTDOWN = 112 +pkg syscall (linux-arm), const EHOSTUNREACH = 113 +pkg syscall (linux-arm), const EHWPOISON = 133 +pkg syscall (linux-arm), const EIDRM = 43 +pkg syscall (linux-arm), const EILSEQ = 84 +pkg syscall (linux-arm), const EINPROGRESS = 115 +pkg syscall (linux-arm), const EINTR = 4 +pkg syscall (linux-arm), const EINVAL = 22 +pkg syscall (linux-arm), const EIO = 5 +pkg syscall (linux-arm), const EISCONN = 106 +pkg syscall (linux-arm), const EISDIR = 21 +pkg syscall (linux-arm), const EISNAM = 120 +pkg syscall (linux-arm), const EKEYEXPIRED = 127 +pkg syscall (linux-arm), const EKEYREJECTED = 129 +pkg syscall (linux-arm), const EKEYREVOKED = 128 +pkg syscall (linux-arm), const EL2HLT = 51 +pkg syscall (linux-arm), const EL2NSYNC = 45 +pkg syscall (linux-arm), const EL3HLT = 46 +pkg syscall (linux-arm), const EL3RST = 47 +pkg syscall (linux-arm), const ELF_NGREG = 18 +pkg syscall (linux-arm), const ELF_PRARGSZ = 80 +pkg syscall (linux-arm), const ELIBACC = 79 +pkg syscall (linux-arm), const ELIBBAD = 80 +pkg syscall (linux-arm), const ELIBEXEC = 83 +pkg syscall (linux-arm), const ELIBMAX = 82 +pkg syscall (linux-arm), const ELIBSCN = 81 +pkg syscall (linux-arm), const ELNRNG = 48 +pkg syscall (linux-arm), const ELOOP = 40 +pkg syscall (linux-arm), const EMEDIUMTYPE = 124 +pkg syscall (linux-arm), const EMFILE = 24 +pkg syscall (linux-arm), const EMLINK = 31 +pkg syscall (linux-arm), const EMSGSIZE = 90 +pkg syscall (linux-arm), const EMULTIHOP = 72 +pkg syscall (linux-arm), const ENAMETOOLONG = 36 +pkg syscall (linux-arm), const ENAVAIL = 119 +pkg syscall (linux-arm), const ENETDOWN = 100 +pkg syscall (linux-arm), const ENETRESET = 102 +pkg syscall (linux-arm), const ENETUNREACH = 101 +pkg syscall (linux-arm), const ENFILE = 23 +pkg syscall (linux-arm), const ENOANO = 55 +pkg syscall (linux-arm), const ENOBUFS = 105 +pkg syscall (linux-arm), const ENOCSI = 50 +pkg syscall (linux-arm), const ENODATA = 61 +pkg syscall (linux-arm), const ENODEV = 19 +pkg syscall (linux-arm), const ENOEXEC = 8 +pkg syscall (linux-arm), const ENOKEY = 126 +pkg syscall (linux-arm), const ENOLCK = 37 +pkg syscall (linux-arm), const ENOLINK = 67 +pkg syscall (linux-arm), const ENOMEDIUM = 123 +pkg syscall (linux-arm), const ENOMEM = 12 +pkg syscall (linux-arm), const ENOMSG = 42 +pkg syscall (linux-arm), const ENONET = 64 +pkg syscall (linux-arm), const ENOPKG = 65 +pkg syscall (linux-arm), const ENOPROTOOPT = 92 +pkg syscall (linux-arm), const ENOSPC = 28 +pkg syscall (linux-arm), const ENOSR = 63 +pkg syscall (linux-arm), const ENOSTR = 60 +pkg syscall (linux-arm), const ENOSYS = 38 +pkg syscall (linux-arm), const ENOTBLK = 15 +pkg syscall (linux-arm), const ENOTCONN = 107 +pkg syscall (linux-arm), const ENOTDIR = 20 +pkg syscall (linux-arm), const ENOTEMPTY = 39 +pkg syscall (linux-arm), const ENOTNAM = 118 +pkg syscall (linux-arm), const ENOTRECOVERABLE = 131 +pkg syscall (linux-arm), const ENOTSOCK = 88 +pkg syscall (linux-arm), const ENOTSUP = 95 +pkg syscall (linux-arm), const ENOTTY = 25 +pkg syscall (linux-arm), const ENOTUNIQ = 76 +pkg syscall (linux-arm), const ENXIO = 6 +pkg syscall (linux-arm), const EOPNOTSUPP = 95 +pkg syscall (linux-arm), const EOVERFLOW = 75 +pkg syscall (linux-arm), const EOWNERDEAD = 130 +pkg syscall (linux-arm), const EPERM = 1 +pkg syscall (linux-arm), const EPFNOSUPPORT = 96 +pkg syscall (linux-arm), const EPIPE = 32 +pkg syscall (linux-arm), const EPOLLERR = 8 +pkg syscall (linux-arm), const EPOLLET = -2147483648 +pkg syscall (linux-arm), const EPOLLHUP = 16 +pkg syscall (linux-arm), const EPOLLIN = 1 +pkg syscall (linux-arm), const EPOLLMSG = 1024 +pkg syscall (linux-arm), const EPOLLONESHOT = 1073741824 +pkg syscall (linux-arm), const EPOLLOUT = 4 +pkg syscall (linux-arm), const EPOLLPRI = 2 +pkg syscall (linux-arm), const EPOLLRDBAND = 128 +pkg syscall (linux-arm), const EPOLLRDHUP = 8192 +pkg syscall (linux-arm), const EPOLLRDNORM = 64 +pkg syscall (linux-arm), const EPOLLWRBAND = 512 +pkg syscall (linux-arm), const EPOLLWRNORM = 256 +pkg syscall (linux-arm), const EPOLL_CLOEXEC = 524288 +pkg syscall (linux-arm), const EPOLL_CTL_ADD = 1 +pkg syscall (linux-arm), const EPOLL_CTL_DEL = 2 +pkg syscall (linux-arm), const EPOLL_CTL_MOD = 3 +pkg syscall (linux-arm), const EPOLL_NONBLOCK = 2048 +pkg syscall (linux-arm), const EPROTO = 71 +pkg syscall (linux-arm), const EPROTONOSUPPORT = 93 +pkg syscall (linux-arm), const EPROTOTYPE = 91 +pkg syscall (linux-arm), const ERANGE = 34 +pkg syscall (linux-arm), const EREMCHG = 78 +pkg syscall (linux-arm), const EREMOTE = 66 +pkg syscall (linux-arm), const EREMOTEIO = 121 +pkg syscall (linux-arm), const ERESTART = 85 +pkg syscall (linux-arm), const ERFKILL = 132 +pkg syscall (linux-arm), const EROFS = 30 +pkg syscall (linux-arm), const ESHUTDOWN = 108 +pkg syscall (linux-arm), const ESOCKTNOSUPPORT = 94 +pkg syscall (linux-arm), const ESPIPE = 29 +pkg syscall (linux-arm), const ESRCH = 3 +pkg syscall (linux-arm), const ESRMNT = 69 +pkg syscall (linux-arm), const ESTALE = 116 +pkg syscall (linux-arm), const ESTRPIPE = 86 +pkg syscall (linux-arm), const ETH_P_1588 = 35063 +pkg syscall (linux-arm), const ETH_P_8021Q = 33024 +pkg syscall (linux-arm), const ETH_P_802_2 = 4 +pkg syscall (linux-arm), const ETH_P_802_3 = 1 +pkg syscall (linux-arm), const ETH_P_AARP = 33011 +pkg syscall (linux-arm), const ETH_P_ALL = 3 +pkg syscall (linux-arm), const ETH_P_AOE = 34978 +pkg syscall (linux-arm), const ETH_P_ARCNET = 26 +pkg syscall (linux-arm), const ETH_P_ARP = 2054 +pkg syscall (linux-arm), const ETH_P_ATALK = 32923 +pkg syscall (linux-arm), const ETH_P_ATMFATE = 34948 +pkg syscall (linux-arm), const ETH_P_ATMMPOA = 34892 +pkg syscall (linux-arm), const ETH_P_AX25 = 2 +pkg syscall (linux-arm), const ETH_P_BPQ = 2303 +pkg syscall (linux-arm), const ETH_P_CAIF = 247 +pkg syscall (linux-arm), const ETH_P_CAN = 12 +pkg syscall (linux-arm), const ETH_P_CONTROL = 22 +pkg syscall (linux-arm), const ETH_P_CUST = 24582 +pkg syscall (linux-arm), const ETH_P_DDCMP = 6 +pkg syscall (linux-arm), const ETH_P_DEC = 24576 +pkg syscall (linux-arm), const ETH_P_DIAG = 24581 +pkg syscall (linux-arm), const ETH_P_DNA_DL = 24577 +pkg syscall (linux-arm), const ETH_P_DNA_RC = 24578 +pkg syscall (linux-arm), const ETH_P_DNA_RT = 24579 +pkg syscall (linux-arm), const ETH_P_DSA = 27 +pkg syscall (linux-arm), const ETH_P_ECONET = 24 +pkg syscall (linux-arm), const ETH_P_EDSA = 56026 +pkg syscall (linux-arm), const ETH_P_FCOE = 35078 +pkg syscall (linux-arm), const ETH_P_FIP = 35092 +pkg syscall (linux-arm), const ETH_P_HDLC = 25 +pkg syscall (linux-arm), const ETH_P_IEEE802154 = 246 +pkg syscall (linux-arm), const ETH_P_IEEEPUP = 2560 +pkg syscall (linux-arm), const ETH_P_IEEEPUPAT = 2561 +pkg syscall (linux-arm), const ETH_P_IP = 2048 +pkg syscall (linux-arm), const ETH_P_IPV6 = 34525 +pkg syscall (linux-arm), const ETH_P_IPX = 33079 +pkg syscall (linux-arm), const ETH_P_IRDA = 23 +pkg syscall (linux-arm), const ETH_P_LAT = 24580 +pkg syscall (linux-arm), const ETH_P_LINK_CTL = 34924 +pkg syscall (linux-arm), const ETH_P_LOCALTALK = 9 +pkg syscall (linux-arm), const ETH_P_LOOP = 96 +pkg syscall (linux-arm), const ETH_P_MOBITEX = 21 +pkg syscall (linux-arm), const ETH_P_MPLS_MC = 34888 +pkg syscall (linux-arm), const ETH_P_MPLS_UC = 34887 +pkg syscall (linux-arm), const ETH_P_PAE = 34958 +pkg syscall (linux-arm), const ETH_P_PAUSE = 34824 +pkg syscall (linux-arm), const ETH_P_PHONET = 245 +pkg syscall (linux-arm), const ETH_P_PPPTALK = 16 +pkg syscall (linux-arm), const ETH_P_PPP_DISC = 34915 +pkg syscall (linux-arm), const ETH_P_PPP_MP = 8 +pkg syscall (linux-arm), const ETH_P_PPP_SES = 34916 +pkg syscall (linux-arm), const ETH_P_PUP = 512 +pkg syscall (linux-arm), const ETH_P_PUPAT = 513 +pkg syscall (linux-arm), const ETH_P_RARP = 32821 +pkg syscall (linux-arm), const ETH_P_SCA = 24583 +pkg syscall (linux-arm), const ETH_P_SLOW = 34825 +pkg syscall (linux-arm), const ETH_P_SNAP = 5 +pkg syscall (linux-arm), const ETH_P_TEB = 25944 +pkg syscall (linux-arm), const ETH_P_TIPC = 35018 +pkg syscall (linux-arm), const ETH_P_TRAILER = 28 +pkg syscall (linux-arm), const ETH_P_TR_802_2 = 17 +pkg syscall (linux-arm), const ETH_P_WAN_PPP = 7 +pkg syscall (linux-arm), const ETH_P_WCCP = 34878 +pkg syscall (linux-arm), const ETH_P_X25 = 2053 +pkg syscall (linux-arm), const ETIME = 62 +pkg syscall (linux-arm), const ETIMEDOUT = 110 +pkg syscall (linux-arm), const ETOOMANYREFS = 109 +pkg syscall (linux-arm), const ETXTBSY = 26 +pkg syscall (linux-arm), const EUCLEAN = 117 +pkg syscall (linux-arm), const EUNATCH = 49 +pkg syscall (linux-arm), const EUSERS = 87 +pkg syscall (linux-arm), const EWOULDBLOCK = 11 +pkg syscall (linux-arm), const EXDEV = 18 +pkg syscall (linux-arm), const EXFULL = 54 +pkg syscall (linux-arm), const FD_CLOEXEC = 1 +pkg syscall (linux-arm), const FD_SETSIZE = 1024 +pkg syscall (linux-arm), const FLUSHO = 4096 +pkg syscall (linux-arm), const F_DUPFD = 0 +pkg syscall (linux-arm), const F_DUPFD_CLOEXEC = 1030 +pkg syscall (linux-arm), const F_EXLCK = 4 +pkg syscall (linux-arm), const F_GETFD = 1 +pkg syscall (linux-arm), const F_GETFL = 3 +pkg syscall (linux-arm), const F_GETLEASE = 1025 +pkg syscall (linux-arm), const F_GETLK = 12 +pkg syscall (linux-arm), const F_GETLK64 = 12 +pkg syscall (linux-arm), const F_GETOWN = 9 +pkg syscall (linux-arm), const F_GETOWN_EX = 16 +pkg syscall (linux-arm), const F_GETPIPE_SZ = 1032 +pkg syscall (linux-arm), const F_GETSIG = 11 +pkg syscall (linux-arm), const F_LOCK = 1 +pkg syscall (linux-arm), const F_NOTIFY = 1026 +pkg syscall (linux-arm), const F_OK = 0 +pkg syscall (linux-arm), const F_RDLCK = 0 +pkg syscall (linux-arm), const F_SETFD = 2 +pkg syscall (linux-arm), const F_SETFL = 4 +pkg syscall (linux-arm), const F_SETLEASE = 1024 +pkg syscall (linux-arm), const F_SETLK = 13 +pkg syscall (linux-arm), const F_SETLK64 = 13 +pkg syscall (linux-arm), const F_SETLKW = 14 +pkg syscall (linux-arm), const F_SETLKW64 = 14 +pkg syscall (linux-arm), const F_SETOWN = 8 +pkg syscall (linux-arm), const F_SETOWN_EX = 15 +pkg syscall (linux-arm), const F_SETPIPE_SZ = 1031 +pkg syscall (linux-arm), const F_SETSIG = 10 +pkg syscall (linux-arm), const F_SHLCK = 8 +pkg syscall (linux-arm), const F_TEST = 3 +pkg syscall (linux-arm), const F_TLOCK = 2 +pkg syscall (linux-arm), const F_ULOCK = 0 +pkg syscall (linux-arm), const F_UNLCK = 2 +pkg syscall (linux-arm), const F_WRLCK = 1 +pkg syscall (linux-arm), const HUPCL = 1024 +pkg syscall (linux-arm), const ICANON = 2 +pkg syscall (linux-arm), const ICRNL = 256 +pkg syscall (linux-arm), const IEXTEN = 32768 +pkg syscall (linux-arm), const IFA_ADDRESS = 1 +pkg syscall (linux-arm), const IFA_ANYCAST = 5 +pkg syscall (linux-arm), const IFA_BROADCAST = 4 +pkg syscall (linux-arm), const IFA_CACHEINFO = 6 +pkg syscall (linux-arm), const IFA_F_DADFAILED = 8 +pkg syscall (linux-arm), const IFA_F_DEPRECATED = 32 +pkg syscall (linux-arm), const IFA_F_HOMEADDRESS = 16 +pkg syscall (linux-arm), const IFA_F_NODAD = 2 +pkg syscall (linux-arm), const IFA_F_OPTIMISTIC = 4 +pkg syscall (linux-arm), const IFA_F_PERMANENT = 128 +pkg syscall (linux-arm), const IFA_F_SECONDARY = 1 +pkg syscall (linux-arm), const IFA_F_TEMPORARY = 1 +pkg syscall (linux-arm), const IFA_F_TENTATIVE = 64 +pkg syscall (linux-arm), const IFA_LABEL = 3 +pkg syscall (linux-arm), const IFA_LOCAL = 2 +pkg syscall (linux-arm), const IFA_MAX = 7 +pkg syscall (linux-arm), const IFA_MULTICAST = 7 +pkg syscall (linux-arm), const IFA_UNSPEC = 0 +pkg syscall (linux-arm), const IFF_ALLMULTI = 512 +pkg syscall (linux-arm), const IFF_AUTOMEDIA = 16384 +pkg syscall (linux-arm), const IFF_DEBUG = 4 +pkg syscall (linux-arm), const IFF_DYNAMIC = 32768 +pkg syscall (linux-arm), const IFF_LOOPBACK = 8 +pkg syscall (linux-arm), const IFF_MASTER = 1024 +pkg syscall (linux-arm), const IFF_MULTICAST = 4096 +pkg syscall (linux-arm), const IFF_NOARP = 128 +pkg syscall (linux-arm), const IFF_NOTRAILERS = 32 +pkg syscall (linux-arm), const IFF_NO_PI = 4096 +pkg syscall (linux-arm), const IFF_ONE_QUEUE = 8192 +pkg syscall (linux-arm), const IFF_POINTOPOINT = 16 +pkg syscall (linux-arm), const IFF_PORTSEL = 8192 +pkg syscall (linux-arm), const IFF_PROMISC = 256 +pkg syscall (linux-arm), const IFF_RUNNING = 64 +pkg syscall (linux-arm), const IFF_SLAVE = 2048 +pkg syscall (linux-arm), const IFF_TAP = 2 +pkg syscall (linux-arm), const IFF_TUN = 1 +pkg syscall (linux-arm), const IFF_TUN_EXCL = 32768 +pkg syscall (linux-arm), const IFF_VNET_HDR = 16384 +pkg syscall (linux-arm), const IFLA_ADDRESS = 1 +pkg syscall (linux-arm), const IFLA_BROADCAST = 2 +pkg syscall (linux-arm), const IFLA_COST = 8 +pkg syscall (linux-arm), const IFLA_IFALIAS = 20 +pkg syscall (linux-arm), const IFLA_IFNAME = 3 +pkg syscall (linux-arm), const IFLA_LINK = 5 +pkg syscall (linux-arm), const IFLA_LINKINFO = 18 +pkg syscall (linux-arm), const IFLA_LINKMODE = 17 +pkg syscall (linux-arm), const IFLA_MAP = 14 +pkg syscall (linux-arm), const IFLA_MASTER = 10 +pkg syscall (linux-arm), const IFLA_MAX = 29 +pkg syscall (linux-arm), const IFLA_MTU = 4 +pkg syscall (linux-arm), const IFLA_NET_NS_PID = 19 +pkg syscall (linux-arm), const IFLA_OPERSTATE = 16 +pkg syscall (linux-arm), const IFLA_PRIORITY = 9 +pkg syscall (linux-arm), const IFLA_PROTINFO = 12 +pkg syscall (linux-arm), const IFLA_QDISC = 6 +pkg syscall (linux-arm), const IFLA_STATS = 7 +pkg syscall (linux-arm), const IFLA_TXQLEN = 13 +pkg syscall (linux-arm), const IFLA_UNSPEC = 0 +pkg syscall (linux-arm), const IFLA_WEIGHT = 15 +pkg syscall (linux-arm), const IFLA_WIRELESS = 11 +pkg syscall (linux-arm), const IFNAMSIZ = 16 +pkg syscall (linux-arm), const IGNBRK = 1 +pkg syscall (linux-arm), const IGNCR = 128 +pkg syscall (linux-arm), const IGNPAR = 4 +pkg syscall (linux-arm), const IMAXBEL = 8192 +pkg syscall (linux-arm), const INLCR = 64 +pkg syscall (linux-arm), const INPCK = 16 +pkg syscall (linux-arm), const IN_ACCESS = 1 +pkg syscall (linux-arm), const IN_ALL_EVENTS = 4095 +pkg syscall (linux-arm), const IN_ATTRIB = 4 +pkg syscall (linux-arm), const IN_CLASSA_HOST = 16777215 +pkg syscall (linux-arm), const IN_CLASSA_MAX = 128 +pkg syscall (linux-arm), const IN_CLASSA_NET = 4278190080 +pkg syscall (linux-arm), const IN_CLASSA_NSHIFT = 24 +pkg syscall (linux-arm), const IN_CLASSB_HOST = 65535 +pkg syscall (linux-arm), const IN_CLASSB_MAX = 65536 +pkg syscall (linux-arm), const IN_CLASSB_NET = 4294901760 +pkg syscall (linux-arm), const IN_CLASSB_NSHIFT = 16 +pkg syscall (linux-arm), const IN_CLASSC_HOST = 255 +pkg syscall (linux-arm), const IN_CLASSC_NET = 4294967040 +pkg syscall (linux-arm), const IN_CLASSC_NSHIFT = 8 +pkg syscall (linux-arm), const IN_CLOEXEC = 524288 +pkg syscall (linux-arm), const IN_CLOSE = 24 +pkg syscall (linux-arm), const IN_CLOSE_NOWRITE = 16 +pkg syscall (linux-arm), const IN_CLOSE_WRITE = 8 +pkg syscall (linux-arm), const IN_CREATE = 256 +pkg syscall (linux-arm), const IN_DELETE = 512 +pkg syscall (linux-arm), const IN_DELETE_SELF = 1024 +pkg syscall (linux-arm), const IN_DONT_FOLLOW = 33554432 +pkg syscall (linux-arm), const IN_EXCL_UNLINK = 67108864 +pkg syscall (linux-arm), const IN_IGNORED = 32768 +pkg syscall (linux-arm), const IN_ISDIR = 1073741824 +pkg syscall (linux-arm), const IN_LOOPBACKNET = 127 +pkg syscall (linux-arm), const IN_MASK_ADD = 536870912 +pkg syscall (linux-arm), const IN_MODIFY = 2 +pkg syscall (linux-arm), const IN_MOVE = 192 +pkg syscall (linux-arm), const IN_MOVED_FROM = 64 +pkg syscall (linux-arm), const IN_MOVED_TO = 128 +pkg syscall (linux-arm), const IN_MOVE_SELF = 2048 +pkg syscall (linux-arm), const IN_NONBLOCK = 2048 +pkg syscall (linux-arm), const IN_ONESHOT = 2147483648 +pkg syscall (linux-arm), const IN_ONLYDIR = 16777216 +pkg syscall (linux-arm), const IN_OPEN = 32 +pkg syscall (linux-arm), const IN_Q_OVERFLOW = 16384 +pkg syscall (linux-arm), const IN_UNMOUNT = 8192 +pkg syscall (linux-arm), const IPPROTO_AH = 51 +pkg syscall (linux-arm), const IPPROTO_COMP = 108 +pkg syscall (linux-arm), const IPPROTO_DCCP = 33 +pkg syscall (linux-arm), const IPPROTO_DSTOPTS = 60 +pkg syscall (linux-arm), const IPPROTO_EGP = 8 +pkg syscall (linux-arm), const IPPROTO_ENCAP = 98 +pkg syscall (linux-arm), const IPPROTO_ESP = 50 +pkg syscall (linux-arm), const IPPROTO_FRAGMENT = 44 +pkg syscall (linux-arm), const IPPROTO_GRE = 47 +pkg syscall (linux-arm), const IPPROTO_HOPOPTS = 0 +pkg syscall (linux-arm), const IPPROTO_ICMP = 1 +pkg syscall (linux-arm), const IPPROTO_ICMPV6 = 58 +pkg syscall (linux-arm), const IPPROTO_IDP = 22 +pkg syscall (linux-arm), const IPPROTO_IGMP = 2 +pkg syscall (linux-arm), const IPPROTO_IPIP = 4 +pkg syscall (linux-arm), const IPPROTO_MTP = 92 +pkg syscall (linux-arm), const IPPROTO_NONE = 59 +pkg syscall (linux-arm), const IPPROTO_PIM = 103 +pkg syscall (linux-arm), const IPPROTO_PUP = 12 +pkg syscall (linux-arm), const IPPROTO_RAW = 255 +pkg syscall (linux-arm), const IPPROTO_ROUTING = 43 +pkg syscall (linux-arm), const IPPROTO_RSVP = 46 +pkg syscall (linux-arm), const IPPROTO_SCTP = 132 +pkg syscall (linux-arm), const IPPROTO_TP = 29 +pkg syscall (linux-arm), const IPPROTO_UDPLITE = 136 +pkg syscall (linux-arm), const IPV6_2292DSTOPTS = 4 +pkg syscall (linux-arm), const IPV6_2292HOPLIMIT = 8 +pkg syscall (linux-arm), const IPV6_2292HOPOPTS = 3 +pkg syscall (linux-arm), const IPV6_2292PKTINFO = 2 +pkg syscall (linux-arm), const IPV6_2292PKTOPTIONS = 6 +pkg syscall (linux-arm), const IPV6_2292RTHDR = 5 +pkg syscall (linux-arm), const IPV6_ADDRFORM = 1 +pkg syscall (linux-arm), const IPV6_ADD_MEMBERSHIP = 20 +pkg syscall (linux-arm), const IPV6_AUTHHDR = 10 +pkg syscall (linux-arm), const IPV6_CHECKSUM = 7 +pkg syscall (linux-arm), const IPV6_DROP_MEMBERSHIP = 21 +pkg syscall (linux-arm), const IPV6_DSTOPTS = 59 +pkg syscall (linux-arm), const IPV6_HOPLIMIT = 52 +pkg syscall (linux-arm), const IPV6_HOPOPTS = 54 +pkg syscall (linux-arm), const IPV6_IPSEC_POLICY = 34 +pkg syscall (linux-arm), const IPV6_JOIN_ANYCAST = 27 +pkg syscall (linux-arm), const IPV6_JOIN_GROUP = 20 +pkg syscall (linux-arm), const IPV6_LEAVE_ANYCAST = 28 +pkg syscall (linux-arm), const IPV6_LEAVE_GROUP = 21 +pkg syscall (linux-arm), const IPV6_MTU = 24 +pkg syscall (linux-arm), const IPV6_MTU_DISCOVER = 23 +pkg syscall (linux-arm), const IPV6_MULTICAST_HOPS = 18 +pkg syscall (linux-arm), const IPV6_MULTICAST_IF = 17 +pkg syscall (linux-arm), const IPV6_MULTICAST_LOOP = 19 +pkg syscall (linux-arm), const IPV6_NEXTHOP = 9 +pkg syscall (linux-arm), const IPV6_PKTINFO = 50 +pkg syscall (linux-arm), const IPV6_PMTUDISC_DO = 2 +pkg syscall (linux-arm), const IPV6_PMTUDISC_DONT = 0 +pkg syscall (linux-arm), const IPV6_PMTUDISC_PROBE = 3 +pkg syscall (linux-arm), const IPV6_PMTUDISC_WANT = 1 +pkg syscall (linux-arm), const IPV6_RECVDSTOPTS = 58 +pkg syscall (linux-arm), const IPV6_RECVERR = 25 +pkg syscall (linux-arm), const IPV6_RECVHOPLIMIT = 51 +pkg syscall (linux-arm), const IPV6_RECVHOPOPTS = 53 +pkg syscall (linux-arm), const IPV6_RECVPKTINFO = 49 +pkg syscall (linux-arm), const IPV6_RECVRTHDR = 56 +pkg syscall (linux-arm), const IPV6_RECVTCLASS = 66 +pkg syscall (linux-arm), const IPV6_ROUTER_ALERT = 22 +pkg syscall (linux-arm), const IPV6_RTHDR = 57 +pkg syscall (linux-arm), const IPV6_RTHDRDSTOPTS = 55 +pkg syscall (linux-arm), const IPV6_RTHDR_LOOSE = 0 +pkg syscall (linux-arm), const IPV6_RTHDR_STRICT = 1 +pkg syscall (linux-arm), const IPV6_RTHDR_TYPE_0 = 0 +pkg syscall (linux-arm), const IPV6_RXDSTOPTS = 59 +pkg syscall (linux-arm), const IPV6_RXHOPOPTS = 54 +pkg syscall (linux-arm), const IPV6_TCLASS = 67 +pkg syscall (linux-arm), const IPV6_UNICAST_HOPS = 16 +pkg syscall (linux-arm), const IPV6_V6ONLY = 26 +pkg syscall (linux-arm), const IPV6_XFRM_POLICY = 35 +pkg syscall (linux-arm), const IP_ADD_MEMBERSHIP = 35 +pkg syscall (linux-arm), const IP_ADD_SOURCE_MEMBERSHIP = 39 +pkg syscall (linux-arm), const IP_BLOCK_SOURCE = 38 +pkg syscall (linux-arm), const IP_DEFAULT_MULTICAST_LOOP = 1 +pkg syscall (linux-arm), const IP_DEFAULT_MULTICAST_TTL = 1 +pkg syscall (linux-arm), const IP_DF = 16384 +pkg syscall (linux-arm), const IP_DROP_MEMBERSHIP = 36 +pkg syscall (linux-arm), const IP_DROP_SOURCE_MEMBERSHIP = 40 +pkg syscall (linux-arm), const IP_FREEBIND = 15 +pkg syscall (linux-arm), const IP_HDRINCL = 3 +pkg syscall (linux-arm), const IP_IPSEC_POLICY = 16 +pkg syscall (linux-arm), const IP_MAXPACKET = 65535 +pkg syscall (linux-arm), const IP_MAX_MEMBERSHIPS = 20 +pkg syscall (linux-arm), const IP_MF = 8192 +pkg syscall (linux-arm), const IP_MINTTL = 21 +pkg syscall (linux-arm), const IP_MSFILTER = 41 +pkg syscall (linux-arm), const IP_MSS = 576 +pkg syscall (linux-arm), const IP_MTU = 14 +pkg syscall (linux-arm), const IP_MTU_DISCOVER = 10 +pkg syscall (linux-arm), const IP_MULTICAST_IF = 32 +pkg syscall (linux-arm), const IP_MULTICAST_LOOP = 34 +pkg syscall (linux-arm), const IP_MULTICAST_TTL = 33 +pkg syscall (linux-arm), const IP_OFFMASK = 8191 +pkg syscall (linux-arm), const IP_OPTIONS = 4 +pkg syscall (linux-arm), const IP_ORIGDSTADDR = 20 +pkg syscall (linux-arm), const IP_PASSSEC = 18 +pkg syscall (linux-arm), const IP_PKTINFO = 8 +pkg syscall (linux-arm), const IP_PKTOPTIONS = 9 +pkg syscall (linux-arm), const IP_PMTUDISC = 10 +pkg syscall (linux-arm), const IP_PMTUDISC_DO = 2 +pkg syscall (linux-arm), const IP_PMTUDISC_DONT = 0 +pkg syscall (linux-arm), const IP_PMTUDISC_PROBE = 3 +pkg syscall (linux-arm), const IP_PMTUDISC_WANT = 1 +pkg syscall (linux-arm), const IP_RECVERR = 11 +pkg syscall (linux-arm), const IP_RECVOPTS = 6 +pkg syscall (linux-arm), const IP_RECVORIGDSTADDR = 20 +pkg syscall (linux-arm), const IP_RECVRETOPTS = 7 +pkg syscall (linux-arm), const IP_RECVTOS = 13 +pkg syscall (linux-arm), const IP_RECVTTL = 12 +pkg syscall (linux-arm), const IP_RETOPTS = 7 +pkg syscall (linux-arm), const IP_RF = 32768 +pkg syscall (linux-arm), const IP_ROUTER_ALERT = 5 +pkg syscall (linux-arm), const IP_TOS = 1 +pkg syscall (linux-arm), const IP_TRANSPARENT = 19 +pkg syscall (linux-arm), const IP_TTL = 2 +pkg syscall (linux-arm), const IP_UNBLOCK_SOURCE = 37 +pkg syscall (linux-arm), const IP_XFRM_POLICY = 17 +pkg syscall (linux-arm), const ISIG = 1 +pkg syscall (linux-arm), const ISTRIP = 32 +pkg syscall (linux-arm), const IUCLC = 512 +pkg syscall (linux-arm), const IUTF8 = 16384 +pkg syscall (linux-arm), const IXANY = 2048 +pkg syscall (linux-arm), const IXOFF = 4096 +pkg syscall (linux-arm), const IXON = 1024 +pkg syscall (linux-arm), const ImplementsGetwd = true +pkg syscall (linux-arm), const LINUX_REBOOT_CMD_CAD_OFF = 0 +pkg syscall (linux-arm), const LINUX_REBOOT_CMD_CAD_ON = 2309737967 +pkg syscall (linux-arm), const LINUX_REBOOT_CMD_HALT = 3454992675 +pkg syscall (linux-arm), const LINUX_REBOOT_CMD_KEXEC = 1163412803 +pkg syscall (linux-arm), const LINUX_REBOOT_CMD_POWER_OFF = 1126301404 +pkg syscall (linux-arm), const LINUX_REBOOT_CMD_RESTART = 19088743 +pkg syscall (linux-arm), const LINUX_REBOOT_CMD_RESTART2 = 2712847316 +pkg syscall (linux-arm), const LINUX_REBOOT_CMD_SW_SUSPEND = 3489725666 +pkg syscall (linux-arm), const LINUX_REBOOT_MAGIC1 = 4276215469 +pkg syscall (linux-arm), const LINUX_REBOOT_MAGIC2 = 672274793 +pkg syscall (linux-arm), const LOCK_EX = 2 +pkg syscall (linux-arm), const LOCK_NB = 4 +pkg syscall (linux-arm), const LOCK_SH = 1 +pkg syscall (linux-arm), const LOCK_UN = 8 +pkg syscall (linux-arm), const MADV_DOFORK = 11 +pkg syscall (linux-arm), const MADV_DONTFORK = 10 +pkg syscall (linux-arm), const MADV_DONTNEED = 4 +pkg syscall (linux-arm), const MADV_HUGEPAGE = 14 +pkg syscall (linux-arm), const MADV_HWPOISON = 100 +pkg syscall (linux-arm), const MADV_MERGEABLE = 12 +pkg syscall (linux-arm), const MADV_NOHUGEPAGE = 15 +pkg syscall (linux-arm), const MADV_NORMAL = 0 +pkg syscall (linux-arm), const MADV_RANDOM = 1 +pkg syscall (linux-arm), const MADV_REMOVE = 9 +pkg syscall (linux-arm), const MADV_SEQUENTIAL = 2 +pkg syscall (linux-arm), const MADV_UNMERGEABLE = 13 +pkg syscall (linux-arm), const MADV_WILLNEED = 3 +pkg syscall (linux-arm), const MAP_ANON = 32 +pkg syscall (linux-arm), const MAP_ANONYMOUS = 32 +pkg syscall (linux-arm), const MAP_DENYWRITE = 2048 +pkg syscall (linux-arm), const MAP_EXECUTABLE = 4096 +pkg syscall (linux-arm), const MAP_FILE = 0 +pkg syscall (linux-arm), const MAP_FIXED = 16 +pkg syscall (linux-arm), const MAP_GROWSDOWN = 256 +pkg syscall (linux-arm), const MAP_LOCKED = 8192 +pkg syscall (linux-arm), const MAP_NONBLOCK = 65536 +pkg syscall (linux-arm), const MAP_NORESERVE = 16384 +pkg syscall (linux-arm), const MAP_POPULATE = 32768 +pkg syscall (linux-arm), const MAP_PRIVATE = 2 +pkg syscall (linux-arm), const MAP_SHARED = 1 +pkg syscall (linux-arm), const MAP_TYPE = 15 +pkg syscall (linux-arm), const MCL_CURRENT = 1 +pkg syscall (linux-arm), const MCL_FUTURE = 2 +pkg syscall (linux-arm), const MNT_DETACH = 2 +pkg syscall (linux-arm), const MNT_EXPIRE = 4 +pkg syscall (linux-arm), const MNT_FORCE = 1 +pkg syscall (linux-arm), const MSG_CMSG_CLOEXEC = 1073741824 +pkg syscall (linux-arm), const MSG_CONFIRM = 2048 +pkg syscall (linux-arm), const MSG_CTRUNC = 8 +pkg syscall (linux-arm), const MSG_DONTROUTE = 4 +pkg syscall (linux-arm), const MSG_DONTWAIT = 64 +pkg syscall (linux-arm), const MSG_EOR = 128 +pkg syscall (linux-arm), const MSG_ERRQUEUE = 8192 +pkg syscall (linux-arm), const MSG_FASTOPEN = 536870912 +pkg syscall (linux-arm), const MSG_FASTOPEN ideal-int +pkg syscall (linux-arm), const MSG_FIN = 512 +pkg syscall (linux-arm), const MSG_MORE = 32768 +pkg syscall (linux-arm), const MSG_NOSIGNAL = 16384 +pkg syscall (linux-arm), const MSG_OOB = 1 +pkg syscall (linux-arm), const MSG_PEEK = 2 +pkg syscall (linux-arm), const MSG_PROXY = 16 +pkg syscall (linux-arm), const MSG_RST = 4096 +pkg syscall (linux-arm), const MSG_SYN = 1024 +pkg syscall (linux-arm), const MSG_TRUNC = 32 +pkg syscall (linux-arm), const MSG_TRYHARD = 4 +pkg syscall (linux-arm), const MSG_WAITALL = 256 +pkg syscall (linux-arm), const MSG_WAITFORONE = 65536 +pkg syscall (linux-arm), const MS_ACTIVE = 1073741824 +pkg syscall (linux-arm), const MS_ASYNC = 1 +pkg syscall (linux-arm), const MS_BIND = 4096 +pkg syscall (linux-arm), const MS_DIRSYNC = 128 +pkg syscall (linux-arm), const MS_INVALIDATE = 2 +pkg syscall (linux-arm), const MS_I_VERSION = 8388608 +pkg syscall (linux-arm), const MS_KERNMOUNT = 4194304 +pkg syscall (linux-arm), const MS_MANDLOCK = 64 +pkg syscall (linux-arm), const MS_MGC_MSK = 4294901760 +pkg syscall (linux-arm), const MS_MGC_VAL = 3236757504 +pkg syscall (linux-arm), const MS_MOVE = 8192 +pkg syscall (linux-arm), const MS_NOATIME = 1024 +pkg syscall (linux-arm), const MS_NODEV = 4 +pkg syscall (linux-arm), const MS_NODIRATIME = 2048 +pkg syscall (linux-arm), const MS_NOEXEC = 8 +pkg syscall (linux-arm), const MS_NOSUID = 2 +pkg syscall (linux-arm), const MS_NOUSER = -2147483648 +pkg syscall (linux-arm), const MS_POSIXACL = 65536 +pkg syscall (linux-arm), const MS_PRIVATE = 262144 +pkg syscall (linux-arm), const MS_RDONLY = 1 +pkg syscall (linux-arm), const MS_REC = 16384 +pkg syscall (linux-arm), const MS_RELATIME = 2097152 +pkg syscall (linux-arm), const MS_REMOUNT = 32 +pkg syscall (linux-arm), const MS_RMT_MASK = 8388689 +pkg syscall (linux-arm), const MS_SHARED = 1048576 +pkg syscall (linux-arm), const MS_SILENT = 32768 +pkg syscall (linux-arm), const MS_SLAVE = 524288 +pkg syscall (linux-arm), const MS_STRICTATIME = 16777216 +pkg syscall (linux-arm), const MS_SYNC = 4 +pkg syscall (linux-arm), const MS_SYNCHRONOUS = 16 +pkg syscall (linux-arm), const MS_UNBINDABLE = 131072 +pkg syscall (linux-arm), const NAME_MAX = 255 +pkg syscall (linux-arm), const NETLINK_ADD_MEMBERSHIP = 1 +pkg syscall (linux-arm), const NETLINK_AUDIT = 9 +pkg syscall (linux-arm), const NETLINK_BROADCAST_ERROR = 4 +pkg syscall (linux-arm), const NETLINK_CONNECTOR = 11 +pkg syscall (linux-arm), const NETLINK_DNRTMSG = 14 +pkg syscall (linux-arm), const NETLINK_DROP_MEMBERSHIP = 2 +pkg syscall (linux-arm), const NETLINK_ECRYPTFS = 19 +pkg syscall (linux-arm), const NETLINK_FIB_LOOKUP = 10 +pkg syscall (linux-arm), const NETLINK_FIREWALL = 3 +pkg syscall (linux-arm), const NETLINK_GENERIC = 16 +pkg syscall (linux-arm), const NETLINK_INET_DIAG = 4 +pkg syscall (linux-arm), const NETLINK_IP6_FW = 13 +pkg syscall (linux-arm), const NETLINK_ISCSI = 8 +pkg syscall (linux-arm), const NETLINK_KOBJECT_UEVENT = 15 +pkg syscall (linux-arm), const NETLINK_NETFILTER = 12 +pkg syscall (linux-arm), const NETLINK_NFLOG = 5 +pkg syscall (linux-arm), const NETLINK_NO_ENOBUFS = 5 +pkg syscall (linux-arm), const NETLINK_PKTINFO = 3 +pkg syscall (linux-arm), const NETLINK_RDMA = 20 +pkg syscall (linux-arm), const NETLINK_ROUTE = 0 +pkg syscall (linux-arm), const NETLINK_SCSITRANSPORT = 18 +pkg syscall (linux-arm), const NETLINK_SELINUX = 7 +pkg syscall (linux-arm), const NETLINK_UNUSED = 1 +pkg syscall (linux-arm), const NETLINK_USERSOCK = 2 +pkg syscall (linux-arm), const NETLINK_XFRM = 6 +pkg syscall (linux-arm), const NLA_ALIGNTO = 4 +pkg syscall (linux-arm), const NLA_F_NESTED = 32768 +pkg syscall (linux-arm), const NLA_F_NET_BYTEORDER = 16384 +pkg syscall (linux-arm), const NLA_HDRLEN = 4 +pkg syscall (linux-arm), const NLMSG_ALIGNTO = 4 +pkg syscall (linux-arm), const NLMSG_DONE = 3 +pkg syscall (linux-arm), const NLMSG_ERROR = 2 +pkg syscall (linux-arm), const NLMSG_HDRLEN = 16 +pkg syscall (linux-arm), const NLMSG_MIN_TYPE = 16 +pkg syscall (linux-arm), const NLMSG_NOOP = 1 +pkg syscall (linux-arm), const NLMSG_OVERRUN = 4 +pkg syscall (linux-arm), const NLM_F_ACK = 4 +pkg syscall (linux-arm), const NLM_F_APPEND = 2048 +pkg syscall (linux-arm), const NLM_F_ATOMIC = 1024 +pkg syscall (linux-arm), const NLM_F_CREATE = 1024 +pkg syscall (linux-arm), const NLM_F_DUMP = 768 +pkg syscall (linux-arm), const NLM_F_ECHO = 8 +pkg syscall (linux-arm), const NLM_F_EXCL = 512 +pkg syscall (linux-arm), const NLM_F_MATCH = 512 +pkg syscall (linux-arm), const NLM_F_MULTI = 2 +pkg syscall (linux-arm), const NLM_F_REPLACE = 256 +pkg syscall (linux-arm), const NLM_F_REQUEST = 1 +pkg syscall (linux-arm), const NLM_F_ROOT = 256 +pkg syscall (linux-arm), const NOFLSH = 128 +pkg syscall (linux-arm), const OCRNL = 8 +pkg syscall (linux-arm), const OFDEL = 128 +pkg syscall (linux-arm), const OFILL = 64 +pkg syscall (linux-arm), const OLCUC = 2 +pkg syscall (linux-arm), const ONLCR = 4 +pkg syscall (linux-arm), const ONLRET = 32 +pkg syscall (linux-arm), const ONOCR = 16 +pkg syscall (linux-arm), const OPOST = 1 +pkg syscall (linux-arm), const O_ACCMODE = 3 +pkg syscall (linux-arm), const O_APPEND = 1024 +pkg syscall (linux-arm), const O_ASYNC = 8192 +pkg syscall (linux-arm), const O_CLOEXEC = 524288 +pkg syscall (linux-arm), const O_CREAT = 64 +pkg syscall (linux-arm), const O_DIRECT = 65536 +pkg syscall (linux-arm), const O_DIRECTORY = 16384 +pkg syscall (linux-arm), const O_DSYNC = 4096 +pkg syscall (linux-arm), const O_EXCL = 128 +pkg syscall (linux-arm), const O_FSYNC = 4096 +pkg syscall (linux-arm), const O_LARGEFILE = 131072 +pkg syscall (linux-arm), const O_NDELAY = 2048 +pkg syscall (linux-arm), const O_NOATIME = 262144 +pkg syscall (linux-arm), const O_NOCTTY = 256 +pkg syscall (linux-arm), const O_NOFOLLOW = 32768 +pkg syscall (linux-arm), const O_NONBLOCK = 2048 +pkg syscall (linux-arm), const O_RSYNC = 4096 +pkg syscall (linux-arm), const O_SYNC = 4096 +pkg syscall (linux-arm), const O_TRUNC = 512 +pkg syscall (linux-arm), const PACKET_ADD_MEMBERSHIP = 1 +pkg syscall (linux-arm), const PACKET_BROADCAST = 1 +pkg syscall (linux-arm), const PACKET_DROP_MEMBERSHIP = 2 +pkg syscall (linux-arm), const PACKET_FASTROUTE = 6 +pkg syscall (linux-arm), const PACKET_HOST = 0 +pkg syscall (linux-arm), const PACKET_LOOPBACK = 5 +pkg syscall (linux-arm), const PACKET_MR_ALLMULTI = 2 +pkg syscall (linux-arm), const PACKET_MR_MULTICAST = 0 +pkg syscall (linux-arm), const PACKET_MR_PROMISC = 1 +pkg syscall (linux-arm), const PACKET_MULTICAST = 2 +pkg syscall (linux-arm), const PACKET_OTHERHOST = 3 +pkg syscall (linux-arm), const PACKET_OUTGOING = 4 +pkg syscall (linux-arm), const PACKET_RECV_OUTPUT = 3 +pkg syscall (linux-arm), const PACKET_RX_RING = 5 +pkg syscall (linux-arm), const PACKET_STATISTICS = 6 +pkg syscall (linux-arm), const PARENB = 256 +pkg syscall (linux-arm), const PARMRK = 8 +pkg syscall (linux-arm), const PARODD = 512 +pkg syscall (linux-arm), const PENDIN = 16384 +pkg syscall (linux-arm), const PROT_EXEC = 4 +pkg syscall (linux-arm), const PROT_GROWSDOWN = 16777216 +pkg syscall (linux-arm), const PROT_GROWSUP = 33554432 +pkg syscall (linux-arm), const PROT_NONE = 0 +pkg syscall (linux-arm), const PROT_READ = 1 +pkg syscall (linux-arm), const PROT_WRITE = 2 +pkg syscall (linux-arm), const PR_CAPBSET_DROP = 24 +pkg syscall (linux-arm), const PR_CAPBSET_READ = 23 +pkg syscall (linux-arm), const PR_CLEAR_SECCOMP_FILTER = 37 +pkg syscall (linux-arm), const PR_ENDIAN_BIG = 0 +pkg syscall (linux-arm), const PR_ENDIAN_LITTLE = 1 +pkg syscall (linux-arm), const PR_ENDIAN_PPC_LITTLE = 2 +pkg syscall (linux-arm), const PR_FPEMU_NOPRINT = 1 +pkg syscall (linux-arm), const PR_FPEMU_SIGFPE = 2 +pkg syscall (linux-arm), const PR_FP_EXC_ASYNC = 2 +pkg syscall (linux-arm), const PR_FP_EXC_DISABLED = 0 +pkg syscall (linux-arm), const PR_FP_EXC_DIV = 65536 +pkg syscall (linux-arm), const PR_FP_EXC_INV = 1048576 +pkg syscall (linux-arm), const PR_FP_EXC_NONRECOV = 1 +pkg syscall (linux-arm), const PR_FP_EXC_OVF = 131072 +pkg syscall (linux-arm), const PR_FP_EXC_PRECISE = 3 +pkg syscall (linux-arm), const PR_FP_EXC_RES = 524288 +pkg syscall (linux-arm), const PR_FP_EXC_SW_ENABLE = 128 +pkg syscall (linux-arm), const PR_FP_EXC_UND = 262144 +pkg syscall (linux-arm), const PR_GET_DUMPABLE = 3 +pkg syscall (linux-arm), const PR_GET_ENDIAN = 19 +pkg syscall (linux-arm), const PR_GET_FPEMU = 9 +pkg syscall (linux-arm), const PR_GET_FPEXC = 11 +pkg syscall (linux-arm), const PR_GET_KEEPCAPS = 7 +pkg syscall (linux-arm), const PR_GET_NAME = 16 +pkg syscall (linux-arm), const PR_GET_PDEATHSIG = 2 +pkg syscall (linux-arm), const PR_GET_SECCOMP = 21 +pkg syscall (linux-arm), const PR_GET_SECCOMP_FILTER = 35 +pkg syscall (linux-arm), const PR_GET_SECUREBITS = 27 +pkg syscall (linux-arm), const PR_GET_TIMERSLACK = 30 +pkg syscall (linux-arm), const PR_GET_TIMING = 13 +pkg syscall (linux-arm), const PR_GET_TSC = 25 +pkg syscall (linux-arm), const PR_GET_UNALIGN = 5 +pkg syscall (linux-arm), const PR_MCE_KILL = 33 +pkg syscall (linux-arm), const PR_MCE_KILL_CLEAR = 0 +pkg syscall (linux-arm), const PR_MCE_KILL_DEFAULT = 2 +pkg syscall (linux-arm), const PR_MCE_KILL_EARLY = 1 +pkg syscall (linux-arm), const PR_MCE_KILL_GET = 34 +pkg syscall (linux-arm), const PR_MCE_KILL_LATE = 0 +pkg syscall (linux-arm), const PR_MCE_KILL_SET = 1 +pkg syscall (linux-arm), const PR_SECCOMP_FILTER_EVENT = 1 +pkg syscall (linux-arm), const PR_SECCOMP_FILTER_SYSCALL = 0 +pkg syscall (linux-arm), const PR_SET_DUMPABLE = 4 +pkg syscall (linux-arm), const PR_SET_ENDIAN = 20 +pkg syscall (linux-arm), const PR_SET_FPEMU = 10 +pkg syscall (linux-arm), const PR_SET_FPEXC = 12 +pkg syscall (linux-arm), const PR_SET_KEEPCAPS = 8 +pkg syscall (linux-arm), const PR_SET_NAME = 15 +pkg syscall (linux-arm), const PR_SET_PDEATHSIG = 1 +pkg syscall (linux-arm), const PR_SET_PTRACER = 1499557217 +pkg syscall (linux-arm), const PR_SET_SECCOMP = 22 +pkg syscall (linux-arm), const PR_SET_SECCOMP_FILTER = 36 +pkg syscall (linux-arm), const PR_SET_SECUREBITS = 28 +pkg syscall (linux-arm), const PR_SET_TIMERSLACK = 29 +pkg syscall (linux-arm), const PR_SET_TIMING = 14 +pkg syscall (linux-arm), const PR_SET_TSC = 26 +pkg syscall (linux-arm), const PR_SET_UNALIGN = 6 +pkg syscall (linux-arm), const PR_TASK_PERF_EVENTS_DISABLE = 31 +pkg syscall (linux-arm), const PR_TASK_PERF_EVENTS_ENABLE = 32 +pkg syscall (linux-arm), const PR_TIMING_STATISTICAL = 0 +pkg syscall (linux-arm), const PR_TIMING_TIMESTAMP = 1 +pkg syscall (linux-arm), const PR_TSC_ENABLE = 1 +pkg syscall (linux-arm), const PR_TSC_SIGSEGV = 2 +pkg syscall (linux-arm), const PR_UNALIGN_NOPRINT = 1 +pkg syscall (linux-arm), const PR_UNALIGN_SIGBUS = 2 +pkg syscall (linux-arm), const PTRACE_ATTACH = 16 +pkg syscall (linux-arm), const PTRACE_CONT = 7 +pkg syscall (linux-arm), const PTRACE_DETACH = 17 +pkg syscall (linux-arm), const PTRACE_EVENT_CLONE = 3 +pkg syscall (linux-arm), const PTRACE_EVENT_EXEC = 4 +pkg syscall (linux-arm), const PTRACE_EVENT_EXIT = 6 +pkg syscall (linux-arm), const PTRACE_EVENT_FORK = 1 +pkg syscall (linux-arm), const PTRACE_EVENT_VFORK = 2 +pkg syscall (linux-arm), const PTRACE_EVENT_VFORK_DONE = 5 +pkg syscall (linux-arm), const PTRACE_GETCRUNCHREGS = 25 +pkg syscall (linux-arm), const PTRACE_GETEVENTMSG = 16897 +pkg syscall (linux-arm), const PTRACE_GETFPREGS = 14 +pkg syscall (linux-arm), const PTRACE_GETHBPREGS = 29 +pkg syscall (linux-arm), const PTRACE_GETREGS = 12 +pkg syscall (linux-arm), const PTRACE_GETREGSET = 16900 +pkg syscall (linux-arm), const PTRACE_GETSIGINFO = 16898 +pkg syscall (linux-arm), const PTRACE_GETVFPREGS = 27 +pkg syscall (linux-arm), const PTRACE_GETWMMXREGS = 18 +pkg syscall (linux-arm), const PTRACE_GET_THREAD_AREA = 22 +pkg syscall (linux-arm), const PTRACE_KILL = 8 +pkg syscall (linux-arm), const PTRACE_OLDSETOPTIONS = 21 +pkg syscall (linux-arm), const PTRACE_O_MASK = 127 +pkg syscall (linux-arm), const PTRACE_O_TRACECLONE = 8 +pkg syscall (linux-arm), const PTRACE_O_TRACEEXEC = 16 +pkg syscall (linux-arm), const PTRACE_O_TRACEEXIT = 64 +pkg syscall (linux-arm), const PTRACE_O_TRACEFORK = 2 +pkg syscall (linux-arm), const PTRACE_O_TRACESYSGOOD = 1 +pkg syscall (linux-arm), const PTRACE_O_TRACEVFORK = 4 +pkg syscall (linux-arm), const PTRACE_O_TRACEVFORKDONE = 32 +pkg syscall (linux-arm), const PTRACE_PEEKDATA = 2 +pkg syscall (linux-arm), const PTRACE_PEEKTEXT = 1 +pkg syscall (linux-arm), const PTRACE_PEEKUSR = 3 +pkg syscall (linux-arm), const PTRACE_POKEDATA = 5 +pkg syscall (linux-arm), const PTRACE_POKETEXT = 4 +pkg syscall (linux-arm), const PTRACE_POKEUSR = 6 +pkg syscall (linux-arm), const PTRACE_SETCRUNCHREGS = 26 +pkg syscall (linux-arm), const PTRACE_SETFPREGS = 15 +pkg syscall (linux-arm), const PTRACE_SETHBPREGS = 30 +pkg syscall (linux-arm), const PTRACE_SETOPTIONS = 16896 +pkg syscall (linux-arm), const PTRACE_SETREGS = 13 +pkg syscall (linux-arm), const PTRACE_SETREGSET = 16901 +pkg syscall (linux-arm), const PTRACE_SETSIGINFO = 16899 +pkg syscall (linux-arm), const PTRACE_SETVFPREGS = 28 +pkg syscall (linux-arm), const PTRACE_SETWMMXREGS = 19 +pkg syscall (linux-arm), const PTRACE_SET_SYSCALL = 23 +pkg syscall (linux-arm), const PTRACE_SINGLESTEP = 9 +pkg syscall (linux-arm), const PTRACE_SYSCALL = 24 +pkg syscall (linux-arm), const PTRACE_TRACEME = 0 +pkg syscall (linux-arm), const PT_DATA_ADDR = 65540 +pkg syscall (linux-arm), const PT_TEXT_ADDR = 65536 +pkg syscall (linux-arm), const PT_TEXT_END_ADDR = 65544 +pkg syscall (linux-arm), const PathMax = 4096 +pkg syscall (linux-arm), const RLIMIT_AS = 9 +pkg syscall (linux-arm), const RLIMIT_CORE = 4 +pkg syscall (linux-arm), const RLIMIT_CPU = 0 +pkg syscall (linux-arm), const RLIMIT_DATA = 2 +pkg syscall (linux-arm), const RLIMIT_FSIZE = 1 +pkg syscall (linux-arm), const RLIMIT_NOFILE = 7 +pkg syscall (linux-arm), const RLIMIT_STACK = 3 +pkg syscall (linux-arm), const RLIM_INFINITY = -1 +pkg syscall (linux-arm), const RTAX_ADVMSS = 8 +pkg syscall (linux-arm), const RTAX_CWND = 7 +pkg syscall (linux-arm), const RTAX_FEATURES = 12 +pkg syscall (linux-arm), const RTAX_FEATURE_ALLFRAG = 8 +pkg syscall (linux-arm), const RTAX_FEATURE_ECN = 1 +pkg syscall (linux-arm), const RTAX_FEATURE_SACK = 2 +pkg syscall (linux-arm), const RTAX_FEATURE_TIMESTAMP = 4 +pkg syscall (linux-arm), const RTAX_HOPLIMIT = 10 +pkg syscall (linux-arm), const RTAX_INITCWND = 11 +pkg syscall (linux-arm), const RTAX_INITRWND = 14 +pkg syscall (linux-arm), const RTAX_LOCK = 1 +pkg syscall (linux-arm), const RTAX_MAX = 14 +pkg syscall (linux-arm), const RTAX_MTU = 2 +pkg syscall (linux-arm), const RTAX_REORDERING = 9 +pkg syscall (linux-arm), const RTAX_RTO_MIN = 13 +pkg syscall (linux-arm), const RTAX_RTT = 4 +pkg syscall (linux-arm), const RTAX_RTTVAR = 5 +pkg syscall (linux-arm), const RTAX_SSTHRESH = 6 +pkg syscall (linux-arm), const RTAX_UNSPEC = 0 +pkg syscall (linux-arm), const RTAX_WINDOW = 3 +pkg syscall (linux-arm), const RTA_ALIGNTO = 4 +pkg syscall (linux-arm), const RTA_CACHEINFO = 12 +pkg syscall (linux-arm), const RTA_DST = 1 +pkg syscall (linux-arm), const RTA_FLOW = 11 +pkg syscall (linux-arm), const RTA_GATEWAY = 5 +pkg syscall (linux-arm), const RTA_IIF = 3 +pkg syscall (linux-arm), const RTA_MAX = 16 +pkg syscall (linux-arm), const RTA_METRICS = 8 +pkg syscall (linux-arm), const RTA_MULTIPATH = 9 +pkg syscall (linux-arm), const RTA_OIF = 4 +pkg syscall (linux-arm), const RTA_PREFSRC = 7 +pkg syscall (linux-arm), const RTA_PRIORITY = 6 +pkg syscall (linux-arm), const RTA_SRC = 2 +pkg syscall (linux-arm), const RTA_TABLE = 15 +pkg syscall (linux-arm), const RTA_UNSPEC = 0 +pkg syscall (linux-arm), const RTCF_DIRECTSRC = 67108864 +pkg syscall (linux-arm), const RTCF_DOREDIRECT = 16777216 +pkg syscall (linux-arm), const RTCF_LOG = 33554432 +pkg syscall (linux-arm), const RTCF_MASQ = 4194304 +pkg syscall (linux-arm), const RTCF_NAT = 8388608 +pkg syscall (linux-arm), const RTCF_VALVE = 2097152 +pkg syscall (linux-arm), const RTF_ADDRCLASSMASK = 4160749568 +pkg syscall (linux-arm), const RTF_ADDRCONF = 262144 +pkg syscall (linux-arm), const RTF_ALLONLINK = 131072 +pkg syscall (linux-arm), const RTF_BROADCAST = 268435456 +pkg syscall (linux-arm), const RTF_CACHE = 16777216 +pkg syscall (linux-arm), const RTF_DEFAULT = 65536 +pkg syscall (linux-arm), const RTF_DYNAMIC = 16 +pkg syscall (linux-arm), const RTF_FLOW = 33554432 +pkg syscall (linux-arm), const RTF_GATEWAY = 2 +pkg syscall (linux-arm), const RTF_HOST = 4 +pkg syscall (linux-arm), const RTF_INTERFACE = 1073741824 +pkg syscall (linux-arm), const RTF_IRTT = 256 +pkg syscall (linux-arm), const RTF_LINKRT = 1048576 +pkg syscall (linux-arm), const RTF_LOCAL = 2147483648 +pkg syscall (linux-arm), const RTF_MODIFIED = 32 +pkg syscall (linux-arm), const RTF_MSS = 64 +pkg syscall (linux-arm), const RTF_MTU = 64 +pkg syscall (linux-arm), const RTF_MULTICAST = 536870912 +pkg syscall (linux-arm), const RTF_NAT = 134217728 +pkg syscall (linux-arm), const RTF_NOFORWARD = 4096 +pkg syscall (linux-arm), const RTF_NONEXTHOP = 2097152 +pkg syscall (linux-arm), const RTF_NOPMTUDISC = 16384 +pkg syscall (linux-arm), const RTF_POLICY = 67108864 +pkg syscall (linux-arm), const RTF_REINSTATE = 8 +pkg syscall (linux-arm), const RTF_REJECT = 512 +pkg syscall (linux-arm), const RTF_STATIC = 1024 +pkg syscall (linux-arm), const RTF_THROW = 8192 +pkg syscall (linux-arm), const RTF_UP = 1 +pkg syscall (linux-arm), const RTF_WINDOW = 128 +pkg syscall (linux-arm), const RTF_XRESOLVE = 2048 +pkg syscall (linux-arm), const RTM_BASE = 16 +pkg syscall (linux-arm), const RTM_DELACTION = 49 +pkg syscall (linux-arm), const RTM_DELADDR = 21 +pkg syscall (linux-arm), const RTM_DELADDRLABEL = 73 +pkg syscall (linux-arm), const RTM_DELLINK = 17 +pkg syscall (linux-arm), const RTM_DELNEIGH = 29 +pkg syscall (linux-arm), const RTM_DELQDISC = 37 +pkg syscall (linux-arm), const RTM_DELROUTE = 25 +pkg syscall (linux-arm), const RTM_DELRULE = 33 +pkg syscall (linux-arm), const RTM_DELTCLASS = 41 +pkg syscall (linux-arm), const RTM_DELTFILTER = 45 +pkg syscall (linux-arm), const RTM_F_CLONED = 512 +pkg syscall (linux-arm), const RTM_F_EQUALIZE = 1024 +pkg syscall (linux-arm), const RTM_F_NOTIFY = 256 +pkg syscall (linux-arm), const RTM_F_PREFIX = 2048 +pkg syscall (linux-arm), const RTM_GETACTION = 50 +pkg syscall (linux-arm), const RTM_GETADDR = 22 +pkg syscall (linux-arm), const RTM_GETADDRLABEL = 74 +pkg syscall (linux-arm), const RTM_GETANYCAST = 62 +pkg syscall (linux-arm), const RTM_GETDCB = 78 +pkg syscall (linux-arm), const RTM_GETLINK = 18 +pkg syscall (linux-arm), const RTM_GETMULTICAST = 58 +pkg syscall (linux-arm), const RTM_GETNEIGH = 30 +pkg syscall (linux-arm), const RTM_GETNEIGHTBL = 66 +pkg syscall (linux-arm), const RTM_GETQDISC = 38 +pkg syscall (linux-arm), const RTM_GETROUTE = 26 +pkg syscall (linux-arm), const RTM_GETRULE = 34 +pkg syscall (linux-arm), const RTM_GETTCLASS = 42 +pkg syscall (linux-arm), const RTM_GETTFILTER = 46 +pkg syscall (linux-arm), const RTM_MAX = 79 +pkg syscall (linux-arm), const RTM_NEWACTION = 48 +pkg syscall (linux-arm), const RTM_NEWADDR = 20 +pkg syscall (linux-arm), const RTM_NEWADDRLABEL = 72 +pkg syscall (linux-arm), const RTM_NEWLINK = 16 +pkg syscall (linux-arm), const RTM_NEWNDUSEROPT = 68 +pkg syscall (linux-arm), const RTM_NEWNEIGH = 28 +pkg syscall (linux-arm), const RTM_NEWNEIGHTBL = 64 +pkg syscall (linux-arm), const RTM_NEWPREFIX = 52 +pkg syscall (linux-arm), const RTM_NEWQDISC = 36 +pkg syscall (linux-arm), const RTM_NEWROUTE = 24 +pkg syscall (linux-arm), const RTM_NEWRULE = 32 +pkg syscall (linux-arm), const RTM_NEWTCLASS = 40 +pkg syscall (linux-arm), const RTM_NEWTFILTER = 44 +pkg syscall (linux-arm), const RTM_NR_FAMILIES = 16 +pkg syscall (linux-arm), const RTM_NR_MSGTYPES = 64 +pkg syscall (linux-arm), const RTM_SETDCB = 79 +pkg syscall (linux-arm), const RTM_SETLINK = 19 +pkg syscall (linux-arm), const RTM_SETNEIGHTBL = 67 +pkg syscall (linux-arm), const RTNH_ALIGNTO = 4 +pkg syscall (linux-arm), const RTNH_F_DEAD = 1 +pkg syscall (linux-arm), const RTNH_F_ONLINK = 4 +pkg syscall (linux-arm), const RTNH_F_PERVASIVE = 2 +pkg syscall (linux-arm), const RTNLGRP_IPV4_IFADDR = 5 +pkg syscall (linux-arm), const RTNLGRP_IPV4_IFADDR ideal-int +pkg syscall (linux-arm), const RTNLGRP_IPV4_MROUTE = 6 +pkg syscall (linux-arm), const RTNLGRP_IPV4_MROUTE ideal-int +pkg syscall (linux-arm), const RTNLGRP_IPV4_ROUTE = 7 +pkg syscall (linux-arm), const RTNLGRP_IPV4_ROUTE ideal-int +pkg syscall (linux-arm), const RTNLGRP_IPV4_RULE = 8 +pkg syscall (linux-arm), const RTNLGRP_IPV4_RULE ideal-int +pkg syscall (linux-arm), const RTNLGRP_IPV6_IFADDR = 9 +pkg syscall (linux-arm), const RTNLGRP_IPV6_IFADDR ideal-int +pkg syscall (linux-arm), const RTNLGRP_IPV6_IFINFO = 12 +pkg syscall (linux-arm), const RTNLGRP_IPV6_IFINFO ideal-int +pkg syscall (linux-arm), const RTNLGRP_IPV6_MROUTE = 10 +pkg syscall (linux-arm), const RTNLGRP_IPV6_MROUTE ideal-int +pkg syscall (linux-arm), const RTNLGRP_IPV6_PREFIX = 18 +pkg syscall (linux-arm), const RTNLGRP_IPV6_PREFIX ideal-int +pkg syscall (linux-arm), const RTNLGRP_IPV6_ROUTE = 11 +pkg syscall (linux-arm), const RTNLGRP_IPV6_ROUTE ideal-int +pkg syscall (linux-arm), const RTNLGRP_IPV6_RULE = 19 +pkg syscall (linux-arm), const RTNLGRP_IPV6_RULE ideal-int +pkg syscall (linux-arm), const RTNLGRP_LINK = 1 +pkg syscall (linux-arm), const RTNLGRP_LINK ideal-int +pkg syscall (linux-arm), const RTNLGRP_ND_USEROPT = 20 +pkg syscall (linux-arm), const RTNLGRP_ND_USEROPT ideal-int +pkg syscall (linux-arm), const RTNLGRP_NEIGH = 3 +pkg syscall (linux-arm), const RTNLGRP_NEIGH ideal-int +pkg syscall (linux-arm), const RTNLGRP_NONE = 0 +pkg syscall (linux-arm), const RTNLGRP_NONE ideal-int +pkg syscall (linux-arm), const RTNLGRP_NOTIFY = 2 +pkg syscall (linux-arm), const RTNLGRP_NOTIFY ideal-int +pkg syscall (linux-arm), const RTNLGRP_TC = 4 +pkg syscall (linux-arm), const RTNLGRP_TC ideal-int +pkg syscall (linux-arm), const RTN_ANYCAST = 4 +pkg syscall (linux-arm), const RTN_BLACKHOLE = 6 +pkg syscall (linux-arm), const RTN_BROADCAST = 3 +pkg syscall (linux-arm), const RTN_LOCAL = 2 +pkg syscall (linux-arm), const RTN_MAX = 11 +pkg syscall (linux-arm), const RTN_MULTICAST = 5 +pkg syscall (linux-arm), const RTN_NAT = 10 +pkg syscall (linux-arm), const RTN_PROHIBIT = 8 +pkg syscall (linux-arm), const RTN_THROW = 9 +pkg syscall (linux-arm), const RTN_UNICAST = 1 +pkg syscall (linux-arm), const RTN_UNREACHABLE = 7 +pkg syscall (linux-arm), const RTN_UNSPEC = 0 +pkg syscall (linux-arm), const RTN_XRESOLVE = 11 +pkg syscall (linux-arm), const RTPROT_BIRD = 12 +pkg syscall (linux-arm), const RTPROT_BOOT = 3 +pkg syscall (linux-arm), const RTPROT_DHCP = 16 +pkg syscall (linux-arm), const RTPROT_DNROUTED = 13 +pkg syscall (linux-arm), const RTPROT_GATED = 8 +pkg syscall (linux-arm), const RTPROT_KERNEL = 2 +pkg syscall (linux-arm), const RTPROT_MRT = 10 +pkg syscall (linux-arm), const RTPROT_NTK = 15 +pkg syscall (linux-arm), const RTPROT_RA = 9 +pkg syscall (linux-arm), const RTPROT_REDIRECT = 1 +pkg syscall (linux-arm), const RTPROT_STATIC = 4 +pkg syscall (linux-arm), const RTPROT_UNSPEC = 0 +pkg syscall (linux-arm), const RTPROT_XORP = 14 +pkg syscall (linux-arm), const RTPROT_ZEBRA = 11 +pkg syscall (linux-arm), const RT_CLASS_DEFAULT = 253 +pkg syscall (linux-arm), const RT_CLASS_LOCAL = 255 +pkg syscall (linux-arm), const RT_CLASS_MAIN = 254 +pkg syscall (linux-arm), const RT_CLASS_MAX = 255 +pkg syscall (linux-arm), const RT_CLASS_UNSPEC = 0 +pkg syscall (linux-arm), const RT_SCOPE_HOST = 254 +pkg syscall (linux-arm), const RT_SCOPE_LINK = 253 +pkg syscall (linux-arm), const RT_SCOPE_NOWHERE = 255 +pkg syscall (linux-arm), const RT_SCOPE_SITE = 200 +pkg syscall (linux-arm), const RT_SCOPE_UNIVERSE = 0 +pkg syscall (linux-arm), const RT_TABLE_COMPAT = 252 +pkg syscall (linux-arm), const RT_TABLE_DEFAULT = 253 +pkg syscall (linux-arm), const RT_TABLE_LOCAL = 255 +pkg syscall (linux-arm), const RT_TABLE_MAIN = 254 +pkg syscall (linux-arm), const RT_TABLE_MAX = 4294967295 +pkg syscall (linux-arm), const RT_TABLE_UNSPEC = 0 +pkg syscall (linux-arm), const RUSAGE_CHILDREN = -1 +pkg syscall (linux-arm), const RUSAGE_SELF = 0 +pkg syscall (linux-arm), const RUSAGE_THREAD = 1 +pkg syscall (linux-arm), const SCM_CREDENTIALS = 2 +pkg syscall (linux-arm), const SCM_RIGHTS = 1 +pkg syscall (linux-arm), const SCM_TIMESTAMP = 29 +pkg syscall (linux-arm), const SCM_TIMESTAMPING = 37 +pkg syscall (linux-arm), const SCM_TIMESTAMPNS = 35 +pkg syscall (linux-arm), const SIGBUS = 7 +pkg syscall (linux-arm), const SIGCHLD = 17 +pkg syscall (linux-arm), const SIGCLD = 17 +pkg syscall (linux-arm), const SIGCONT = 18 +pkg syscall (linux-arm), const SIGIO = 29 +pkg syscall (linux-arm), const SIGIOT = 6 +pkg syscall (linux-arm), const SIGPOLL = 29 +pkg syscall (linux-arm), const SIGPROF = 27 +pkg syscall (linux-arm), const SIGPWR = 30 +pkg syscall (linux-arm), const SIGSTKFLT = 16 +pkg syscall (linux-arm), const SIGSTOP = 19 +pkg syscall (linux-arm), const SIGSYS = 31 +pkg syscall (linux-arm), const SIGTSTP = 20 +pkg syscall (linux-arm), const SIGTTIN = 21 +pkg syscall (linux-arm), const SIGTTOU = 22 +pkg syscall (linux-arm), const SIGUNUSED = 31 +pkg syscall (linux-arm), const SIGURG = 23 +pkg syscall (linux-arm), const SIGUSR1 = 10 +pkg syscall (linux-arm), const SIGUSR2 = 12 +pkg syscall (linux-arm), const SIGVTALRM = 26 +pkg syscall (linux-arm), const SIGWINCH = 28 +pkg syscall (linux-arm), const SIGXCPU = 24 +pkg syscall (linux-arm), const SIGXFSZ = 25 +pkg syscall (linux-arm), const SIOCADDDLCI = 35200 +pkg syscall (linux-arm), const SIOCADDMULTI = 35121 +pkg syscall (linux-arm), const SIOCADDRT = 35083 +pkg syscall (linux-arm), const SIOCATMARK = 35077 +pkg syscall (linux-arm), const SIOCDARP = 35155 +pkg syscall (linux-arm), const SIOCDELDLCI = 35201 +pkg syscall (linux-arm), const SIOCDELMULTI = 35122 +pkg syscall (linux-arm), const SIOCDELRT = 35084 +pkg syscall (linux-arm), const SIOCDEVPRIVATE = 35312 +pkg syscall (linux-arm), const SIOCDIFADDR = 35126 +pkg syscall (linux-arm), const SIOCDRARP = 35168 +pkg syscall (linux-arm), const SIOCGARP = 35156 +pkg syscall (linux-arm), const SIOCGIFADDR = 35093 +pkg syscall (linux-arm), const SIOCGIFBR = 35136 +pkg syscall (linux-arm), const SIOCGIFBRDADDR = 35097 +pkg syscall (linux-arm), const SIOCGIFCONF = 35090 +pkg syscall (linux-arm), const SIOCGIFCOUNT = 35128 +pkg syscall (linux-arm), const SIOCGIFDSTADDR = 35095 +pkg syscall (linux-arm), const SIOCGIFENCAP = 35109 +pkg syscall (linux-arm), const SIOCGIFFLAGS = 35091 +pkg syscall (linux-arm), const SIOCGIFHWADDR = 35111 +pkg syscall (linux-arm), const SIOCGIFINDEX = 35123 +pkg syscall (linux-arm), const SIOCGIFMAP = 35184 +pkg syscall (linux-arm), const SIOCGIFMEM = 35103 +pkg syscall (linux-arm), const SIOCGIFMETRIC = 35101 +pkg syscall (linux-arm), const SIOCGIFMTU = 35105 +pkg syscall (linux-arm), const SIOCGIFNAME = 35088 +pkg syscall (linux-arm), const SIOCGIFNETMASK = 35099 +pkg syscall (linux-arm), const SIOCGIFPFLAGS = 35125 +pkg syscall (linux-arm), const SIOCGIFSLAVE = 35113 +pkg syscall (linux-arm), const SIOCGIFTXQLEN = 35138 +pkg syscall (linux-arm), const SIOCGPGRP = 35076 +pkg syscall (linux-arm), const SIOCGRARP = 35169 +pkg syscall (linux-arm), const SIOCGSTAMP = 35078 +pkg syscall (linux-arm), const SIOCGSTAMPNS = 35079 +pkg syscall (linux-arm), const SIOCPROTOPRIVATE = 35296 +pkg syscall (linux-arm), const SIOCRTMSG = 35085 +pkg syscall (linux-arm), const SIOCSARP = 35157 +pkg syscall (linux-arm), const SIOCSIFADDR = 35094 +pkg syscall (linux-arm), const SIOCSIFBR = 35137 +pkg syscall (linux-arm), const SIOCSIFBRDADDR = 35098 +pkg syscall (linux-arm), const SIOCSIFDSTADDR = 35096 +pkg syscall (linux-arm), const SIOCSIFENCAP = 35110 +pkg syscall (linux-arm), const SIOCSIFFLAGS = 35092 +pkg syscall (linux-arm), const SIOCSIFHWADDR = 35108 +pkg syscall (linux-arm), const SIOCSIFHWBROADCAST = 35127 +pkg syscall (linux-arm), const SIOCSIFLINK = 35089 +pkg syscall (linux-arm), const SIOCSIFMAP = 35185 +pkg syscall (linux-arm), const SIOCSIFMEM = 35104 +pkg syscall (linux-arm), const SIOCSIFMETRIC = 35102 +pkg syscall (linux-arm), const SIOCSIFMTU = 35106 +pkg syscall (linux-arm), const SIOCSIFNAME = 35107 +pkg syscall (linux-arm), const SIOCSIFNETMASK = 35100 +pkg syscall (linux-arm), const SIOCSIFPFLAGS = 35124 +pkg syscall (linux-arm), const SIOCSIFSLAVE = 35120 +pkg syscall (linux-arm), const SIOCSIFTXQLEN = 35139 +pkg syscall (linux-arm), const SIOCSPGRP = 35074 +pkg syscall (linux-arm), const SIOCSRARP = 35170 +pkg syscall (linux-arm), const SOCK_CLOEXEC = 524288 +pkg syscall (linux-arm), const SOCK_DCCP = 6 +pkg syscall (linux-arm), const SOCK_NONBLOCK = 2048 +pkg syscall (linux-arm), const SOCK_PACKET = 10 +pkg syscall (linux-arm), const SOCK_RDM = 4 +pkg syscall (linux-arm), const SOL_AAL = 265 +pkg syscall (linux-arm), const SOL_ATM = 264 +pkg syscall (linux-arm), const SOL_DECNET = 261 +pkg syscall (linux-arm), const SOL_ICMPV6 = 58 +pkg syscall (linux-arm), const SOL_IP = 0 +pkg syscall (linux-arm), const SOL_IPV6 = 41 +pkg syscall (linux-arm), const SOL_IRDA = 266 +pkg syscall (linux-arm), const SOL_PACKET = 263 +pkg syscall (linux-arm), const SOL_RAW = 255 +pkg syscall (linux-arm), const SOL_SOCKET = 1 +pkg syscall (linux-arm), const SOL_TCP = 6 +pkg syscall (linux-arm), const SOL_X25 = 262 +pkg syscall (linux-arm), const SOMAXCONN = 128 +pkg syscall (linux-arm), const SO_ACCEPTCONN = 30 +pkg syscall (linux-arm), const SO_ATTACH_FILTER = 26 +pkg syscall (linux-arm), const SO_BINDTODEVICE = 25 +pkg syscall (linux-arm), const SO_BROADCAST = 6 +pkg syscall (linux-arm), const SO_BSDCOMPAT = 14 +pkg syscall (linux-arm), const SO_DEBUG = 1 +pkg syscall (linux-arm), const SO_DETACH_FILTER = 27 +pkg syscall (linux-arm), const SO_DOMAIN = 39 +pkg syscall (linux-arm), const SO_DONTROUTE = 5 +pkg syscall (linux-arm), const SO_ERROR = 4 +pkg syscall (linux-arm), const SO_KEEPALIVE = 9 +pkg syscall (linux-arm), const SO_LINGER = 13 +pkg syscall (linux-arm), const SO_MARK = 36 +pkg syscall (linux-arm), const SO_NO_CHECK = 11 +pkg syscall (linux-arm), const SO_OOBINLINE = 10 +pkg syscall (linux-arm), const SO_PASSCRED = 16 +pkg syscall (linux-arm), const SO_PASSSEC = 34 +pkg syscall (linux-arm), const SO_PEERCRED = 17 +pkg syscall (linux-arm), const SO_PEERNAME = 28 +pkg syscall (linux-arm), const SO_PEERSEC = 31 +pkg syscall (linux-arm), const SO_PRIORITY = 12 +pkg syscall (linux-arm), const SO_PROTOCOL = 38 +pkg syscall (linux-arm), const SO_RCVBUF = 8 +pkg syscall (linux-arm), const SO_RCVBUFFORCE = 33 +pkg syscall (linux-arm), const SO_RCVLOWAT = 18 +pkg syscall (linux-arm), const SO_RCVTIMEO = 20 +pkg syscall (linux-arm), const SO_REUSEADDR = 2 +pkg syscall (linux-arm), const SO_RXQ_OVFL = 40 +pkg syscall (linux-arm), const SO_SECURITY_AUTHENTICATION = 22 +pkg syscall (linux-arm), const SO_SECURITY_ENCRYPTION_NETWORK = 24 +pkg syscall (linux-arm), const SO_SECURITY_ENCRYPTION_TRANSPORT = 23 +pkg syscall (linux-arm), const SO_SNDBUF = 7 +pkg syscall (linux-arm), const SO_SNDBUFFORCE = 32 +pkg syscall (linux-arm), const SO_SNDLOWAT = 19 +pkg syscall (linux-arm), const SO_SNDTIMEO = 21 +pkg syscall (linux-arm), const SO_TIMESTAMP = 29 +pkg syscall (linux-arm), const SO_TIMESTAMPING = 37 +pkg syscall (linux-arm), const SO_TIMESTAMPNS = 35 +pkg syscall (linux-arm), const SO_TYPE = 3 +pkg syscall (linux-arm), const SYS_ACCEPT = 285 +pkg syscall (linux-arm), const SYS_ACCEPT4 = 366 +pkg syscall (linux-arm), const SYS_ACCESS = 33 +pkg syscall (linux-arm), const SYS_ACCT = 51 +pkg syscall (linux-arm), const SYS_ADD_KEY = 309 +pkg syscall (linux-arm), const SYS_ADJTIMEX = 124 +pkg syscall (linux-arm), const SYS_ALARM = 27 +pkg syscall (linux-arm), const SYS_ARM_FADVISE64_64 = 270 +pkg syscall (linux-arm), const SYS_ARM_SYNC_FILE_RANGE = 341 +pkg syscall (linux-arm), const SYS_BDFLUSH = 134 +pkg syscall (linux-arm), const SYS_BIND = 282 +pkg syscall (linux-arm), const SYS_BRK = 45 +pkg syscall (linux-arm), const SYS_CAPGET = 184 +pkg syscall (linux-arm), const SYS_CAPSET = 185 +pkg syscall (linux-arm), const SYS_CHDIR = 12 +pkg syscall (linux-arm), const SYS_CHMOD = 15 +pkg syscall (linux-arm), const SYS_CHOWN = 182 +pkg syscall (linux-arm), const SYS_CHOWN32 = 212 +pkg syscall (linux-arm), const SYS_CHROOT = 61 +pkg syscall (linux-arm), const SYS_CLOCK_ADJTIME = 372 +pkg syscall (linux-arm), const SYS_CLOCK_GETRES = 264 +pkg syscall (linux-arm), const SYS_CLOCK_GETTIME = 263 +pkg syscall (linux-arm), const SYS_CLOCK_NANOSLEEP = 265 +pkg syscall (linux-arm), const SYS_CLOCK_SETTIME = 262 +pkg syscall (linux-arm), const SYS_CLONE = 120 +pkg syscall (linux-arm), const SYS_CLOSE = 6 +pkg syscall (linux-arm), const SYS_CONNECT = 283 +pkg syscall (linux-arm), const SYS_CREAT = 8 +pkg syscall (linux-arm), const SYS_DELETE_MODULE = 129 +pkg syscall (linux-arm), const SYS_DUP = 41 +pkg syscall (linux-arm), const SYS_DUP2 = 63 +pkg syscall (linux-arm), const SYS_DUP3 = 358 +pkg syscall (linux-arm), const SYS_EPOLL_CREATE = 250 +pkg syscall (linux-arm), const SYS_EPOLL_CREATE1 = 357 +pkg syscall (linux-arm), const SYS_EPOLL_CTL = 251 +pkg syscall (linux-arm), const SYS_EPOLL_PWAIT = 346 +pkg syscall (linux-arm), const SYS_EPOLL_WAIT = 252 +pkg syscall (linux-arm), const SYS_EVENTFD = 351 +pkg syscall (linux-arm), const SYS_EVENTFD2 = 356 +pkg syscall (linux-arm), const SYS_EXECVE = 11 +pkg syscall (linux-arm), const SYS_EXIT = 1 +pkg syscall (linux-arm), const SYS_EXIT_GROUP = 248 +pkg syscall (linux-arm), const SYS_FACCESSAT = 334 +pkg syscall (linux-arm), const SYS_FALLOCATE = 352 +pkg syscall (linux-arm), const SYS_FANOTIFY_INIT = 367 +pkg syscall (linux-arm), const SYS_FANOTIFY_MARK = 368 +pkg syscall (linux-arm), const SYS_FCHDIR = 133 +pkg syscall (linux-arm), const SYS_FCHMOD = 94 +pkg syscall (linux-arm), const SYS_FCHMODAT = 333 +pkg syscall (linux-arm), const SYS_FCHOWN = 95 +pkg syscall (linux-arm), const SYS_FCHOWN32 = 207 +pkg syscall (linux-arm), const SYS_FCHOWNAT = 325 +pkg syscall (linux-arm), const SYS_FCNTL = 55 +pkg syscall (linux-arm), const SYS_FCNTL64 = 221 +pkg syscall (linux-arm), const SYS_FDATASYNC = 148 +pkg syscall (linux-arm), const SYS_FGETXATTR = 231 +pkg syscall (linux-arm), const SYS_FLISTXATTR = 234 +pkg syscall (linux-arm), const SYS_FLOCK = 143 +pkg syscall (linux-arm), const SYS_FORK = 2 +pkg syscall (linux-arm), const SYS_FREMOVEXATTR = 237 +pkg syscall (linux-arm), const SYS_FSETXATTR = 228 +pkg syscall (linux-arm), const SYS_FSTAT = 108 +pkg syscall (linux-arm), const SYS_FSTAT64 = 197 +pkg syscall (linux-arm), const SYS_FSTATAT64 = 327 +pkg syscall (linux-arm), const SYS_FSTATFS = 100 +pkg syscall (linux-arm), const SYS_FSTATFS64 = 267 +pkg syscall (linux-arm), const SYS_FSYNC = 118 +pkg syscall (linux-arm), const SYS_FTRUNCATE = 93 +pkg syscall (linux-arm), const SYS_FTRUNCATE64 = 194 +pkg syscall (linux-arm), const SYS_FUTEX = 240 +pkg syscall (linux-arm), const SYS_FUTIMESAT = 326 +pkg syscall (linux-arm), const SYS_GETCPU = 345 +pkg syscall (linux-arm), const SYS_GETCWD = 183 +pkg syscall (linux-arm), const SYS_GETDENTS = 141 +pkg syscall (linux-arm), const SYS_GETDENTS64 = 217 +pkg syscall (linux-arm), const SYS_GETEGID = 50 +pkg syscall (linux-arm), const SYS_GETEGID32 = 202 +pkg syscall (linux-arm), const SYS_GETEUID = 49 +pkg syscall (linux-arm), const SYS_GETEUID32 = 201 +pkg syscall (linux-arm), const SYS_GETGID = 47 +pkg syscall (linux-arm), const SYS_GETGID32 = 200 +pkg syscall (linux-arm), const SYS_GETGROUPS = 80 +pkg syscall (linux-arm), const SYS_GETGROUPS32 = 205 +pkg syscall (linux-arm), const SYS_GETITIMER = 105 +pkg syscall (linux-arm), const SYS_GETPEERNAME = 287 +pkg syscall (linux-arm), const SYS_GETPGID = 132 +pkg syscall (linux-arm), const SYS_GETPGRP = 65 +pkg syscall (linux-arm), const SYS_GETPID = 20 +pkg syscall (linux-arm), const SYS_GETPPID = 64 +pkg syscall (linux-arm), const SYS_GETPRIORITY = 96 +pkg syscall (linux-arm), const SYS_GETRESGID = 171 +pkg syscall (linux-arm), const SYS_GETRESGID32 = 211 +pkg syscall (linux-arm), const SYS_GETRESUID = 165 +pkg syscall (linux-arm), const SYS_GETRESUID32 = 209 +pkg syscall (linux-arm), const SYS_GETRLIMIT = 76 +pkg syscall (linux-arm), const SYS_GETRUSAGE = 77 +pkg syscall (linux-arm), const SYS_GETSID = 147 +pkg syscall (linux-arm), const SYS_GETSOCKNAME = 286 +pkg syscall (linux-arm), const SYS_GETSOCKOPT = 295 +pkg syscall (linux-arm), const SYS_GETTID = 224 +pkg syscall (linux-arm), const SYS_GETTIMEOFDAY = 78 +pkg syscall (linux-arm), const SYS_GETUID = 24 +pkg syscall (linux-arm), const SYS_GETUID32 = 199 +pkg syscall (linux-arm), const SYS_GETXATTR = 229 +pkg syscall (linux-arm), const SYS_GET_MEMPOLICY = 320 +pkg syscall (linux-arm), const SYS_GET_ROBUST_LIST = 339 +pkg syscall (linux-arm), const SYS_INIT_MODULE = 128 +pkg syscall (linux-arm), const SYS_INOTIFY_ADD_WATCH = 317 +pkg syscall (linux-arm), const SYS_INOTIFY_INIT = 316 +pkg syscall (linux-arm), const SYS_INOTIFY_INIT1 = 360 +pkg syscall (linux-arm), const SYS_INOTIFY_RM_WATCH = 318 +pkg syscall (linux-arm), const SYS_IOCTL = 54 +pkg syscall (linux-arm), const SYS_IOPRIO_GET = 315 +pkg syscall (linux-arm), const SYS_IOPRIO_SET = 314 +pkg syscall (linux-arm), const SYS_IO_CANCEL = 247 +pkg syscall (linux-arm), const SYS_IO_DESTROY = 244 +pkg syscall (linux-arm), const SYS_IO_GETEVENTS = 245 +pkg syscall (linux-arm), const SYS_IO_SETUP = 243 +pkg syscall (linux-arm), const SYS_IO_SUBMIT = 246 +pkg syscall (linux-arm), const SYS_IPC = 117 +pkg syscall (linux-arm), const SYS_KEXEC_LOAD = 347 +pkg syscall (linux-arm), const SYS_KEYCTL = 311 +pkg syscall (linux-arm), const SYS_KILL = 37 +pkg syscall (linux-arm), const SYS_LCHOWN = 16 +pkg syscall (linux-arm), const SYS_LCHOWN32 = 198 +pkg syscall (linux-arm), const SYS_LGETXATTR = 230 +pkg syscall (linux-arm), const SYS_LINK = 9 +pkg syscall (linux-arm), const SYS_LINKAT = 330 +pkg syscall (linux-arm), const SYS_LISTEN = 284 +pkg syscall (linux-arm), const SYS_LISTXATTR = 232 +pkg syscall (linux-arm), const SYS_LLISTXATTR = 233 +pkg syscall (linux-arm), const SYS_LOOKUP_DCOOKIE = 249 +pkg syscall (linux-arm), const SYS_LREMOVEXATTR = 236 +pkg syscall (linux-arm), const SYS_LSEEK = 19 +pkg syscall (linux-arm), const SYS_LSETXATTR = 227 +pkg syscall (linux-arm), const SYS_LSTAT = 107 +pkg syscall (linux-arm), const SYS_LSTAT64 = 196 +pkg syscall (linux-arm), const SYS_MADVISE = 220 +pkg syscall (linux-arm), const SYS_MBIND = 319 +pkg syscall (linux-arm), const SYS_MINCORE = 219 +pkg syscall (linux-arm), const SYS_MKDIR = 39 +pkg syscall (linux-arm), const SYS_MKDIRAT = 323 +pkg syscall (linux-arm), const SYS_MKNOD = 14 +pkg syscall (linux-arm), const SYS_MKNODAT = 324 +pkg syscall (linux-arm), const SYS_MLOCK = 150 +pkg syscall (linux-arm), const SYS_MLOCKALL = 152 +pkg syscall (linux-arm), const SYS_MMAP = 90 +pkg syscall (linux-arm), const SYS_MMAP2 = 192 +pkg syscall (linux-arm), const SYS_MOUNT = 21 +pkg syscall (linux-arm), const SYS_MOVE_PAGES = 344 +pkg syscall (linux-arm), const SYS_MPROTECT = 125 +pkg syscall (linux-arm), const SYS_MQ_GETSETATTR = 279 +pkg syscall (linux-arm), const SYS_MQ_NOTIFY = 278 +pkg syscall (linux-arm), const SYS_MQ_OPEN = 274 +pkg syscall (linux-arm), const SYS_MQ_TIMEDRECEIVE = 277 +pkg syscall (linux-arm), const SYS_MQ_TIMEDSEND = 276 +pkg syscall (linux-arm), const SYS_MQ_UNLINK = 275 +pkg syscall (linux-arm), const SYS_MREMAP = 163 +pkg syscall (linux-arm), const SYS_MSGCTL = 304 +pkg syscall (linux-arm), const SYS_MSGGET = 303 +pkg syscall (linux-arm), const SYS_MSGRCV = 302 +pkg syscall (linux-arm), const SYS_MSGSND = 301 +pkg syscall (linux-arm), const SYS_MSYNC = 144 +pkg syscall (linux-arm), const SYS_MUNLOCK = 151 +pkg syscall (linux-arm), const SYS_MUNLOCKALL = 153 +pkg syscall (linux-arm), const SYS_MUNMAP = 91 +pkg syscall (linux-arm), const SYS_NAME_TO_HANDLE_AT = 370 +pkg syscall (linux-arm), const SYS_NANOSLEEP = 162 +pkg syscall (linux-arm), const SYS_NFSSERVCTL = 169 +pkg syscall (linux-arm), const SYS_NICE = 34 +pkg syscall (linux-arm), const SYS_OABI_SYSCALL_BASE = 0 +pkg syscall (linux-arm), const SYS_OPEN = 5 +pkg syscall (linux-arm), const SYS_OPENAT = 322 +pkg syscall (linux-arm), const SYS_OPEN_BY_HANDLE_AT = 371 +pkg syscall (linux-arm), const SYS_PAUSE = 29 +pkg syscall (linux-arm), const SYS_PCICONFIG_IOBASE = 271 +pkg syscall (linux-arm), const SYS_PCICONFIG_READ = 272 +pkg syscall (linux-arm), const SYS_PCICONFIG_WRITE = 273 +pkg syscall (linux-arm), const SYS_PERF_EVENT_OPEN = 364 +pkg syscall (linux-arm), const SYS_PERSONALITY = 136 +pkg syscall (linux-arm), const SYS_PIPE = 42 +pkg syscall (linux-arm), const SYS_PIPE2 = 359 +pkg syscall (linux-arm), const SYS_PIVOT_ROOT = 218 +pkg syscall (linux-arm), const SYS_POLL = 168 +pkg syscall (linux-arm), const SYS_PPOLL = 336 +pkg syscall (linux-arm), const SYS_PRCTL = 172 +pkg syscall (linux-arm), const SYS_PREAD64 = 180 +pkg syscall (linux-arm), const SYS_PREADV = 361 +pkg syscall (linux-arm), const SYS_PRLIMIT64 = 369 +pkg syscall (linux-arm), const SYS_PROCESS_VM_READV = 376 +pkg syscall (linux-arm), const SYS_PROCESS_VM_WRITEV = 377 +pkg syscall (linux-arm), const SYS_PSELECT6 = 335 +pkg syscall (linux-arm), const SYS_PTRACE = 26 +pkg syscall (linux-arm), const SYS_PWRITE64 = 181 +pkg syscall (linux-arm), const SYS_PWRITEV = 362 +pkg syscall (linux-arm), const SYS_QUOTACTL = 131 +pkg syscall (linux-arm), const SYS_READ = 3 +pkg syscall (linux-arm), const SYS_READAHEAD = 225 +pkg syscall (linux-arm), const SYS_READDIR = 89 +pkg syscall (linux-arm), const SYS_READLINK = 85 +pkg syscall (linux-arm), const SYS_READLINKAT = 332 +pkg syscall (linux-arm), const SYS_READV = 145 +pkg syscall (linux-arm), const SYS_REBOOT = 88 +pkg syscall (linux-arm), const SYS_RECV = 291 +pkg syscall (linux-arm), const SYS_RECVFROM = 292 +pkg syscall (linux-arm), const SYS_RECVMMSG = 365 +pkg syscall (linux-arm), const SYS_RECVMSG = 297 +pkg syscall (linux-arm), const SYS_REMAP_FILE_PAGES = 253 +pkg syscall (linux-arm), const SYS_REMOVEXATTR = 235 +pkg syscall (linux-arm), const SYS_RENAME = 38 +pkg syscall (linux-arm), const SYS_RENAMEAT = 329 +pkg syscall (linux-arm), const SYS_REQUEST_KEY = 310 +pkg syscall (linux-arm), const SYS_RESTART_SYSCALL = 0 +pkg syscall (linux-arm), const SYS_RMDIR = 40 +pkg syscall (linux-arm), const SYS_RT_SIGACTION = 174 +pkg syscall (linux-arm), const SYS_RT_SIGPENDING = 176 +pkg syscall (linux-arm), const SYS_RT_SIGPROCMASK = 175 +pkg syscall (linux-arm), const SYS_RT_SIGQUEUEINFO = 178 +pkg syscall (linux-arm), const SYS_RT_SIGRETURN = 173 +pkg syscall (linux-arm), const SYS_RT_SIGSUSPEND = 179 +pkg syscall (linux-arm), const SYS_RT_SIGTIMEDWAIT = 177 +pkg syscall (linux-arm), const SYS_RT_TGSIGQUEUEINFO = 363 +pkg syscall (linux-arm), const SYS_SCHED_GETAFFINITY = 242 +pkg syscall (linux-arm), const SYS_SCHED_GETPARAM = 155 +pkg syscall (linux-arm), const SYS_SCHED_GETSCHEDULER = 157 +pkg syscall (linux-arm), const SYS_SCHED_GET_PRIORITY_MAX = 159 +pkg syscall (linux-arm), const SYS_SCHED_GET_PRIORITY_MIN = 160 +pkg syscall (linux-arm), const SYS_SCHED_RR_GET_INTERVAL = 161 +pkg syscall (linux-arm), const SYS_SCHED_SETAFFINITY = 241 +pkg syscall (linux-arm), const SYS_SCHED_SETPARAM = 154 +pkg syscall (linux-arm), const SYS_SCHED_SETSCHEDULER = 156 +pkg syscall (linux-arm), const SYS_SCHED_YIELD = 158 +pkg syscall (linux-arm), const SYS_SELECT = 82 +pkg syscall (linux-arm), const SYS_SEMCTL = 300 +pkg syscall (linux-arm), const SYS_SEMGET = 299 +pkg syscall (linux-arm), const SYS_SEMOP = 298 +pkg syscall (linux-arm), const SYS_SEMTIMEDOP = 312 +pkg syscall (linux-arm), const SYS_SEND = 289 +pkg syscall (linux-arm), const SYS_SENDFILE = 187 +pkg syscall (linux-arm), const SYS_SENDFILE64 = 239 +pkg syscall (linux-arm), const SYS_SENDMMSG = 374 +pkg syscall (linux-arm), const SYS_SENDMSG = 296 +pkg syscall (linux-arm), const SYS_SENDTO = 290 +pkg syscall (linux-arm), const SYS_SETDOMAINNAME = 121 +pkg syscall (linux-arm), const SYS_SETFSGID = 139 +pkg syscall (linux-arm), const SYS_SETFSGID32 = 216 +pkg syscall (linux-arm), const SYS_SETFSUID = 138 +pkg syscall (linux-arm), const SYS_SETFSUID32 = 215 +pkg syscall (linux-arm), const SYS_SETGID = 46 +pkg syscall (linux-arm), const SYS_SETGID32 = 214 +pkg syscall (linux-arm), const SYS_SETGROUPS = 81 +pkg syscall (linux-arm), const SYS_SETGROUPS32 = 206 +pkg syscall (linux-arm), const SYS_SETHOSTNAME = 74 +pkg syscall (linux-arm), const SYS_SETITIMER = 104 +pkg syscall (linux-arm), const SYS_SETNS = 375 +pkg syscall (linux-arm), const SYS_SETPGID = 57 +pkg syscall (linux-arm), const SYS_SETPRIORITY = 97 +pkg syscall (linux-arm), const SYS_SETREGID = 71 +pkg syscall (linux-arm), const SYS_SETREGID32 = 204 +pkg syscall (linux-arm), const SYS_SETRESGID = 170 +pkg syscall (linux-arm), const SYS_SETRESGID32 = 210 +pkg syscall (linux-arm), const SYS_SETRESUID = 164 +pkg syscall (linux-arm), const SYS_SETRESUID32 = 208 +pkg syscall (linux-arm), const SYS_SETREUID = 70 +pkg syscall (linux-arm), const SYS_SETREUID32 = 203 +pkg syscall (linux-arm), const SYS_SETRLIMIT = 75 +pkg syscall (linux-arm), const SYS_SETSID = 66 +pkg syscall (linux-arm), const SYS_SETSOCKOPT = 294 +pkg syscall (linux-arm), const SYS_SETTIMEOFDAY = 79 +pkg syscall (linux-arm), const SYS_SETUID = 23 +pkg syscall (linux-arm), const SYS_SETUID32 = 213 +pkg syscall (linux-arm), const SYS_SETXATTR = 226 +pkg syscall (linux-arm), const SYS_SET_MEMPOLICY = 321 +pkg syscall (linux-arm), const SYS_SET_ROBUST_LIST = 338 +pkg syscall (linux-arm), const SYS_SET_TID_ADDRESS = 256 +pkg syscall (linux-arm), const SYS_SHMAT = 305 +pkg syscall (linux-arm), const SYS_SHMCTL = 308 +pkg syscall (linux-arm), const SYS_SHMDT = 306 +pkg syscall (linux-arm), const SYS_SHMGET = 307 +pkg syscall (linux-arm), const SYS_SHUTDOWN = 293 +pkg syscall (linux-arm), const SYS_SIGACTION = 67 +pkg syscall (linux-arm), const SYS_SIGALTSTACK = 186 +pkg syscall (linux-arm), const SYS_SIGNALFD = 349 +pkg syscall (linux-arm), const SYS_SIGNALFD4 = 355 +pkg syscall (linux-arm), const SYS_SIGPENDING = 73 +pkg syscall (linux-arm), const SYS_SIGPROCMASK = 126 +pkg syscall (linux-arm), const SYS_SIGRETURN = 119 +pkg syscall (linux-arm), const SYS_SIGSUSPEND = 72 +pkg syscall (linux-arm), const SYS_SOCKET = 281 +pkg syscall (linux-arm), const SYS_SOCKETCALL = 102 +pkg syscall (linux-arm), const SYS_SOCKETPAIR = 288 +pkg syscall (linux-arm), const SYS_SPLICE = 340 +pkg syscall (linux-arm), const SYS_STAT = 106 +pkg syscall (linux-arm), const SYS_STAT64 = 195 +pkg syscall (linux-arm), const SYS_STATFS = 99 +pkg syscall (linux-arm), const SYS_STATFS64 = 266 +pkg syscall (linux-arm), const SYS_STIME = 25 +pkg syscall (linux-arm), const SYS_SWAPOFF = 115 +pkg syscall (linux-arm), const SYS_SWAPON = 87 +pkg syscall (linux-arm), const SYS_SYMLINK = 83 +pkg syscall (linux-arm), const SYS_SYMLINKAT = 331 +pkg syscall (linux-arm), const SYS_SYNC = 36 +pkg syscall (linux-arm), const SYS_SYNCFS = 373 +pkg syscall (linux-arm), const SYS_SYSCALL = 113 +pkg syscall (linux-arm), const SYS_SYSCALL_BASE = 0 +pkg syscall (linux-arm), const SYS_SYSFS = 135 +pkg syscall (linux-arm), const SYS_SYSINFO = 116 +pkg syscall (linux-arm), const SYS_SYSLOG = 103 +pkg syscall (linux-arm), const SYS_TEE = 342 +pkg syscall (linux-arm), const SYS_TGKILL = 268 +pkg syscall (linux-arm), const SYS_TIME = 13 +pkg syscall (linux-arm), const SYS_TIMERFD_CREATE = 350 +pkg syscall (linux-arm), const SYS_TIMERFD_GETTIME = 354 +pkg syscall (linux-arm), const SYS_TIMERFD_SETTIME = 353 +pkg syscall (linux-arm), const SYS_TIMER_CREATE = 257 +pkg syscall (linux-arm), const SYS_TIMER_DELETE = 261 +pkg syscall (linux-arm), const SYS_TIMER_GETOVERRUN = 260 +pkg syscall (linux-arm), const SYS_TIMER_GETTIME = 259 +pkg syscall (linux-arm), const SYS_TIMER_SETTIME = 258 +pkg syscall (linux-arm), const SYS_TIMES = 43 +pkg syscall (linux-arm), const SYS_TKILL = 238 +pkg syscall (linux-arm), const SYS_TRUNCATE = 92 +pkg syscall (linux-arm), const SYS_TRUNCATE64 = 193 +pkg syscall (linux-arm), const SYS_UGETRLIMIT = 191 +pkg syscall (linux-arm), const SYS_UMASK = 60 +pkg syscall (linux-arm), const SYS_UMOUNT = 22 +pkg syscall (linux-arm), const SYS_UMOUNT2 = 52 +pkg syscall (linux-arm), const SYS_UNAME = 122 +pkg syscall (linux-arm), const SYS_UNLINK = 10 +pkg syscall (linux-arm), const SYS_UNLINKAT = 328 +pkg syscall (linux-arm), const SYS_UNSHARE = 337 +pkg syscall (linux-arm), const SYS_USELIB = 86 +pkg syscall (linux-arm), const SYS_USTAT = 62 +pkg syscall (linux-arm), const SYS_UTIME = 30 +pkg syscall (linux-arm), const SYS_UTIMENSAT = 348 +pkg syscall (linux-arm), const SYS_UTIMES = 269 +pkg syscall (linux-arm), const SYS_VFORK = 190 +pkg syscall (linux-arm), const SYS_VHANGUP = 111 +pkg syscall (linux-arm), const SYS_VMSPLICE = 343 +pkg syscall (linux-arm), const SYS_VSERVER = 313 +pkg syscall (linux-arm), const SYS_WAIT4 = 114 +pkg syscall (linux-arm), const SYS_WAITID = 280 +pkg syscall (linux-arm), const SYS_WRITE = 4 +pkg syscall (linux-arm), const SYS_WRITEV = 146 +pkg syscall (linux-arm), const SYS__LLSEEK = 140 +pkg syscall (linux-arm), const SYS__NEWSELECT = 142 +pkg syscall (linux-arm), const SYS__SYSCTL = 149 +pkg syscall (linux-arm), const S_BLKSIZE = 512 +pkg syscall (linux-arm), const S_IEXEC = 64 +pkg syscall (linux-arm), const S_IFMT = 61440 +pkg syscall (linux-arm), const S_IREAD = 256 +pkg syscall (linux-arm), const S_IRGRP = 32 +pkg syscall (linux-arm), const S_IROTH = 4 +pkg syscall (linux-arm), const S_IRWXG = 56 +pkg syscall (linux-arm), const S_IRWXO = 7 +pkg syscall (linux-arm), const S_IRWXU = 448 +pkg syscall (linux-arm), const S_IWGRP = 16 +pkg syscall (linux-arm), const S_IWOTH = 2 +pkg syscall (linux-arm), const S_IWRITE = 128 +pkg syscall (linux-arm), const S_IXGRP = 8 +pkg syscall (linux-arm), const S_IXOTH = 1 +pkg syscall (linux-arm), const SizeofCmsghdr = 12 +pkg syscall (linux-arm), const SizeofIPMreq = 8 +pkg syscall (linux-arm), const SizeofIPMreqn = 12 +pkg syscall (linux-arm), const SizeofIPv6Mreq = 20 +pkg syscall (linux-arm), const SizeofIfAddrmsg = 8 +pkg syscall (linux-arm), const SizeofIfInfomsg = 16 +pkg syscall (linux-arm), const SizeofInet4Pktinfo = 12 +pkg syscall (linux-arm), const SizeofInet6Pktinfo = 20 +pkg syscall (linux-arm), const SizeofInotifyEvent = 16 +pkg syscall (linux-arm), const SizeofLinger = 8 +pkg syscall (linux-arm), const SizeofMsghdr = 28 +pkg syscall (linux-arm), const SizeofNlAttr = 4 +pkg syscall (linux-arm), const SizeofNlMsgerr = 20 +pkg syscall (linux-arm), const SizeofNlMsghdr = 16 +pkg syscall (linux-arm), const SizeofRtAttr = 4 +pkg syscall (linux-arm), const SizeofRtGenmsg = 1 +pkg syscall (linux-arm), const SizeofRtMsg = 12 +pkg syscall (linux-arm), const SizeofRtNexthop = 8 +pkg syscall (linux-arm), const SizeofSockFilter = 8 +pkg syscall (linux-arm), const SizeofSockFprog = 8 +pkg syscall (linux-arm), const SizeofSockaddrAny = 112 +pkg syscall (linux-arm), const SizeofSockaddrInet4 = 16 +pkg syscall (linux-arm), const SizeofSockaddrInet6 = 28 +pkg syscall (linux-arm), const SizeofSockaddrLinklayer = 20 +pkg syscall (linux-arm), const SizeofSockaddrNetlink = 12 +pkg syscall (linux-arm), const SizeofSockaddrUnix = 110 +pkg syscall (linux-arm), const SizeofTCPInfo = 104 +pkg syscall (linux-arm), const SizeofTCPInfo ideal-int +pkg syscall (linux-arm), const SizeofUcred = 12 +pkg syscall (linux-arm), const TCGETS = 21505 +pkg syscall (linux-arm), const TCP_CONGESTION = 13 +pkg syscall (linux-arm), const TCP_CORK = 3 +pkg syscall (linux-arm), const TCP_DEFER_ACCEPT = 9 +pkg syscall (linux-arm), const TCP_INFO = 11 +pkg syscall (linux-arm), const TCP_KEEPCNT = 6 +pkg syscall (linux-arm), const TCP_KEEPIDLE = 4 +pkg syscall (linux-arm), const TCP_KEEPINTVL = 5 +pkg syscall (linux-arm), const TCP_LINGER2 = 8 +pkg syscall (linux-arm), const TCP_MAXSEG = 2 +pkg syscall (linux-arm), const TCP_MAXWIN = 65535 +pkg syscall (linux-arm), const TCP_MAX_WINSHIFT = 14 +pkg syscall (linux-arm), const TCP_MD5SIG = 14 +pkg syscall (linux-arm), const TCP_MD5SIG_MAXKEYLEN = 80 +pkg syscall (linux-arm), const TCP_MSS = 512 +pkg syscall (linux-arm), const TCP_QUICKACK = 12 +pkg syscall (linux-arm), const TCP_SYNCNT = 7 +pkg syscall (linux-arm), const TCP_WINDOW_CLAMP = 10 +pkg syscall (linux-arm), const TCSETS = 21506 +pkg syscall (linux-arm), const TIOCCBRK = 21544 +pkg syscall (linux-arm), const TIOCCONS = 21533 +pkg syscall (linux-arm), const TIOCEXCL = 21516 +pkg syscall (linux-arm), const TIOCGDEV = 2147767346 +pkg syscall (linux-arm), const TIOCGETD = 21540 +pkg syscall (linux-arm), const TIOCGICOUNT = 21597 +pkg syscall (linux-arm), const TIOCGLCKTRMIOS = 21590 +pkg syscall (linux-arm), const TIOCGPGRP = 21519 +pkg syscall (linux-arm), const TIOCGPTN = 2147767344 +pkg syscall (linux-arm), const TIOCGRS485 = 21550 +pkg syscall (linux-arm), const TIOCGSERIAL = 21534 +pkg syscall (linux-arm), const TIOCGSID = 21545 +pkg syscall (linux-arm), const TIOCGSOFTCAR = 21529 +pkg syscall (linux-arm), const TIOCGWINSZ = 21523 +pkg syscall (linux-arm), const TIOCINQ = 21531 +pkg syscall (linux-arm), const TIOCLINUX = 21532 +pkg syscall (linux-arm), const TIOCMBIC = 21527 +pkg syscall (linux-arm), const TIOCMBIS = 21526 +pkg syscall (linux-arm), const TIOCMGET = 21525 +pkg syscall (linux-arm), const TIOCMIWAIT = 21596 +pkg syscall (linux-arm), const TIOCMSET = 21528 +pkg syscall (linux-arm), const TIOCM_CAR = 64 +pkg syscall (linux-arm), const TIOCM_CD = 64 +pkg syscall (linux-arm), const TIOCM_CTS = 32 +pkg syscall (linux-arm), const TIOCM_DSR = 256 +pkg syscall (linux-arm), const TIOCM_DTR = 2 +pkg syscall (linux-arm), const TIOCM_LE = 1 +pkg syscall (linux-arm), const TIOCM_RI = 128 +pkg syscall (linux-arm), const TIOCM_RNG = 128 +pkg syscall (linux-arm), const TIOCM_RTS = 4 +pkg syscall (linux-arm), const TIOCM_SR = 16 +pkg syscall (linux-arm), const TIOCM_ST = 8 +pkg syscall (linux-arm), const TIOCNOTTY = 21538 +pkg syscall (linux-arm), const TIOCNXCL = 21517 +pkg syscall (linux-arm), const TIOCOUTQ = 21521 +pkg syscall (linux-arm), const TIOCPKT = 21536 +pkg syscall (linux-arm), const TIOCPKT_DATA = 0 +pkg syscall (linux-arm), const TIOCPKT_DOSTOP = 32 +pkg syscall (linux-arm), const TIOCPKT_FLUSHREAD = 1 +pkg syscall (linux-arm), const TIOCPKT_FLUSHWRITE = 2 +pkg syscall (linux-arm), const TIOCPKT_IOCTL = 64 +pkg syscall (linux-arm), const TIOCPKT_NOSTOP = 16 +pkg syscall (linux-arm), const TIOCPKT_START = 8 +pkg syscall (linux-arm), const TIOCPKT_STOP = 4 +pkg syscall (linux-arm), const TIOCSBRK = 21543 +pkg syscall (linux-arm), const TIOCSCTTY = 21518 +pkg syscall (linux-arm), const TIOCSERCONFIG = 21587 +pkg syscall (linux-arm), const TIOCSERGETLSR = 21593 +pkg syscall (linux-arm), const TIOCSERGETMULTI = 21594 +pkg syscall (linux-arm), const TIOCSERGSTRUCT = 21592 +pkg syscall (linux-arm), const TIOCSERGWILD = 21588 +pkg syscall (linux-arm), const TIOCSERSETMULTI = 21595 +pkg syscall (linux-arm), const TIOCSERSWILD = 21589 +pkg syscall (linux-arm), const TIOCSER_TEMT = 1 +pkg syscall (linux-arm), const TIOCSETD = 21539 +pkg syscall (linux-arm), const TIOCSIG = 1074025526 +pkg syscall (linux-arm), const TIOCSLCKTRMIOS = 21591 +pkg syscall (linux-arm), const TIOCSPGRP = 21520 +pkg syscall (linux-arm), const TIOCSPTLCK = 1074025521 +pkg syscall (linux-arm), const TIOCSRS485 = 21551 +pkg syscall (linux-arm), const TIOCSSERIAL = 21535 +pkg syscall (linux-arm), const TIOCSSOFTCAR = 21530 +pkg syscall (linux-arm), const TIOCSTI = 21522 +pkg syscall (linux-arm), const TIOCSWINSZ = 21524 +pkg syscall (linux-arm), const TIOCVHANGUP = 21559 +pkg syscall (linux-arm), const TOSTOP = 256 +pkg syscall (linux-arm), const TUNATTACHFILTER = 1074287829 +pkg syscall (linux-arm), const TUNDETACHFILTER = 1074287830 +pkg syscall (linux-arm), const TUNGETFEATURES = 2147767503 +pkg syscall (linux-arm), const TUNGETIFF = 2147767506 +pkg syscall (linux-arm), const TUNGETSNDBUF = 2147767507 +pkg syscall (linux-arm), const TUNGETVNETHDRSZ = 2147767511 +pkg syscall (linux-arm), const TUNSETDEBUG = 1074025673 +pkg syscall (linux-arm), const TUNSETGROUP = 1074025678 +pkg syscall (linux-arm), const TUNSETIFF = 1074025674 +pkg syscall (linux-arm), const TUNSETLINK = 1074025677 +pkg syscall (linux-arm), const TUNSETNOCSUM = 1074025672 +pkg syscall (linux-arm), const TUNSETOFFLOAD = 1074025680 +pkg syscall (linux-arm), const TUNSETOWNER = 1074025676 +pkg syscall (linux-arm), const TUNSETPERSIST = 1074025675 +pkg syscall (linux-arm), const TUNSETSNDBUF = 1074025684 +pkg syscall (linux-arm), const TUNSETTXFILTER = 1074025681 +pkg syscall (linux-arm), const TUNSETVNETHDRSZ = 1074025688 +pkg syscall (linux-arm), const VDISCARD = 13 +pkg syscall (linux-arm), const VEOF = 4 +pkg syscall (linux-arm), const VEOL = 11 +pkg syscall (linux-arm), const VEOL2 = 16 +pkg syscall (linux-arm), const VERASE = 2 +pkg syscall (linux-arm), const VINTR = 0 +pkg syscall (linux-arm), const VKILL = 3 +pkg syscall (linux-arm), const VLNEXT = 15 +pkg syscall (linux-arm), const VMIN = 6 +pkg syscall (linux-arm), const VQUIT = 1 +pkg syscall (linux-arm), const VREPRINT = 12 +pkg syscall (linux-arm), const VSTART = 8 +pkg syscall (linux-arm), const VSTOP = 9 +pkg syscall (linux-arm), const VSUSP = 10 +pkg syscall (linux-arm), const VSWTC = 7 +pkg syscall (linux-arm), const VTIME = 5 +pkg syscall (linux-arm), const VWERASE = 14 +pkg syscall (linux-arm), const WALL = 1073741824 +pkg syscall (linux-arm), const WCLONE = 2147483648 +pkg syscall (linux-arm), const WCONTINUED = 8 +pkg syscall (linux-arm), const WEXITED = 4 +pkg syscall (linux-arm), const WNOHANG = 1 +pkg syscall (linux-arm), const WNOTHREAD = 536870912 +pkg syscall (linux-arm), const WNOWAIT = 16777216 +pkg syscall (linux-arm), const WORDSIZE = 32 +pkg syscall (linux-arm), const WSTOPPED = 2 +pkg syscall (linux-arm), const WUNTRACED = 2 +pkg syscall (linux-arm), const XCASE = 4 +pkg syscall (linux-arm), func Accept4(int, int) (int, Sockaddr, error) +pkg syscall (linux-arm), func GetsockoptUcred(int, int, int) (*Ucred, error) +pkg syscall (linux-arm), func Getxattr(string, string, []uint8) (int, error) +pkg syscall (linux-arm), func Listxattr(string, []uint8) (int, error) +pkg syscall (linux-arm), func Pipe2([]int, int) error +pkg syscall (linux-arm), func PtraceSyscall(int, int) error +pkg syscall (linux-arm), func Removexattr(string, string) error +pkg syscall (linux-arm), func Setxattr(string, string, []uint8, int) error +pkg syscall (linux-arm), func SlicePtrFromStrings([]string) ([]*uint8, error) +pkg syscall (linux-arm), type SysProcAttr struct, Ctty int +pkg syscall (linux-arm), type TCPInfo struct +pkg syscall (linux-arm), type TCPInfo struct, Advmss uint32 +pkg syscall (linux-arm), type TCPInfo struct, Ato uint32 +pkg syscall (linux-arm), type TCPInfo struct, Backoff uint8 +pkg syscall (linux-arm), type TCPInfo struct, Ca_state uint8 +pkg syscall (linux-arm), type TCPInfo struct, Fackets uint32 +pkg syscall (linux-arm), type TCPInfo struct, Last_ack_recv uint32 +pkg syscall (linux-arm), type TCPInfo struct, Last_ack_sent uint32 +pkg syscall (linux-arm), type TCPInfo struct, Last_data_recv uint32 +pkg syscall (linux-arm), type TCPInfo struct, Last_data_sent uint32 +pkg syscall (linux-arm), type TCPInfo struct, Lost uint32 +pkg syscall (linux-arm), type TCPInfo struct, Options uint8 +pkg syscall (linux-arm), type TCPInfo struct, Pad_cgo_0 [2]uint8 +pkg syscall (linux-arm), type TCPInfo struct, Pmtu uint32 +pkg syscall (linux-arm), type TCPInfo struct, Probes uint8 +pkg syscall (linux-arm), type TCPInfo struct, Rcv_mss uint32 +pkg syscall (linux-arm), type TCPInfo struct, Rcv_rtt uint32 +pkg syscall (linux-arm), type TCPInfo struct, Rcv_space uint32 +pkg syscall (linux-arm), type TCPInfo struct, Rcv_ssthresh uint32 +pkg syscall (linux-arm), type TCPInfo struct, Reordering uint32 +pkg syscall (linux-arm), type TCPInfo struct, Retrans uint32 +pkg syscall (linux-arm), type TCPInfo struct, Retransmits uint8 +pkg syscall (linux-arm), type TCPInfo struct, Rto uint32 +pkg syscall (linux-arm), type TCPInfo struct, Rtt uint32 +pkg syscall (linux-arm), type TCPInfo struct, Rttvar uint32 +pkg syscall (linux-arm), type TCPInfo struct, Sacked uint32 +pkg syscall (linux-arm), type TCPInfo struct, Snd_cwnd uint32 +pkg syscall (linux-arm), type TCPInfo struct, Snd_mss uint32 +pkg syscall (linux-arm), type TCPInfo struct, Snd_ssthresh uint32 +pkg syscall (linux-arm), type TCPInfo struct, State uint8 +pkg syscall (linux-arm), type TCPInfo struct, Total_retrans uint32 +pkg syscall (linux-arm), type TCPInfo struct, Unacked uint32 +pkg syscall (linux-arm-cgo), const AF_ALG = 38 +pkg syscall (linux-arm-cgo), const AF_APPLETALK = 5 +pkg syscall (linux-arm-cgo), const AF_ASH = 18 +pkg syscall (linux-arm-cgo), const AF_ATMPVC = 8 +pkg syscall (linux-arm-cgo), const AF_ATMSVC = 20 +pkg syscall (linux-arm-cgo), const AF_AX25 = 3 +pkg syscall (linux-arm-cgo), const AF_BLUETOOTH = 31 +pkg syscall (linux-arm-cgo), const AF_BRIDGE = 7 +pkg syscall (linux-arm-cgo), const AF_CAIF = 37 +pkg syscall (linux-arm-cgo), const AF_CAN = 29 +pkg syscall (linux-arm-cgo), const AF_DECnet = 12 +pkg syscall (linux-arm-cgo), const AF_ECONET = 19 +pkg syscall (linux-arm-cgo), const AF_FILE = 1 +pkg syscall (linux-arm-cgo), const AF_IEEE802154 = 36 +pkg syscall (linux-arm-cgo), const AF_INET6 = 10 +pkg syscall (linux-arm-cgo), const AF_IPX = 4 +pkg syscall (linux-arm-cgo), const AF_IRDA = 23 +pkg syscall (linux-arm-cgo), const AF_ISDN = 34 +pkg syscall (linux-arm-cgo), const AF_IUCV = 32 +pkg syscall (linux-arm-cgo), const AF_KEY = 15 +pkg syscall (linux-arm-cgo), const AF_LLC = 26 +pkg syscall (linux-arm-cgo), const AF_LOCAL = 1 +pkg syscall (linux-arm-cgo), const AF_MAX = 39 +pkg syscall (linux-arm-cgo), const AF_NETBEUI = 13 +pkg syscall (linux-arm-cgo), const AF_NETLINK = 16 +pkg syscall (linux-arm-cgo), const AF_NETROM = 6 +pkg syscall (linux-arm-cgo), const AF_PACKET = 17 +pkg syscall (linux-arm-cgo), const AF_PHONET = 35 +pkg syscall (linux-arm-cgo), const AF_PPPOX = 24 +pkg syscall (linux-arm-cgo), const AF_RDS = 21 +pkg syscall (linux-arm-cgo), const AF_ROSE = 11 +pkg syscall (linux-arm-cgo), const AF_ROUTE = 16 +pkg syscall (linux-arm-cgo), const AF_RXRPC = 33 +pkg syscall (linux-arm-cgo), const AF_SECURITY = 14 +pkg syscall (linux-arm-cgo), const AF_SNA = 22 +pkg syscall (linux-arm-cgo), const AF_TIPC = 30 +pkg syscall (linux-arm-cgo), const AF_WANPIPE = 25 +pkg syscall (linux-arm-cgo), const AF_X25 = 9 +pkg syscall (linux-arm-cgo), const ARPHRD_ADAPT = 264 +pkg syscall (linux-arm-cgo), const ARPHRD_APPLETLK = 8 +pkg syscall (linux-arm-cgo), const ARPHRD_ARCNET = 7 +pkg syscall (linux-arm-cgo), const ARPHRD_ASH = 781 +pkg syscall (linux-arm-cgo), const ARPHRD_ATM = 19 +pkg syscall (linux-arm-cgo), const ARPHRD_AX25 = 3 +pkg syscall (linux-arm-cgo), const ARPHRD_BIF = 775 +pkg syscall (linux-arm-cgo), const ARPHRD_CHAOS = 5 +pkg syscall (linux-arm-cgo), const ARPHRD_CISCO = 513 +pkg syscall (linux-arm-cgo), const ARPHRD_CSLIP = 257 +pkg syscall (linux-arm-cgo), const ARPHRD_CSLIP6 = 259 +pkg syscall (linux-arm-cgo), const ARPHRD_DDCMP = 517 +pkg syscall (linux-arm-cgo), const ARPHRD_DLCI = 15 +pkg syscall (linux-arm-cgo), const ARPHRD_ECONET = 782 +pkg syscall (linux-arm-cgo), const ARPHRD_EETHER = 2 +pkg syscall (linux-arm-cgo), const ARPHRD_ETHER = 1 +pkg syscall (linux-arm-cgo), const ARPHRD_EUI64 = 27 +pkg syscall (linux-arm-cgo), const ARPHRD_FCAL = 785 +pkg syscall (linux-arm-cgo), const ARPHRD_FCFABRIC = 787 +pkg syscall (linux-arm-cgo), const ARPHRD_FCPL = 786 +pkg syscall (linux-arm-cgo), const ARPHRD_FCPP = 784 +pkg syscall (linux-arm-cgo), const ARPHRD_FDDI = 774 +pkg syscall (linux-arm-cgo), const ARPHRD_FRAD = 770 +pkg syscall (linux-arm-cgo), const ARPHRD_HDLC = 513 +pkg syscall (linux-arm-cgo), const ARPHRD_HIPPI = 780 +pkg syscall (linux-arm-cgo), const ARPHRD_HWX25 = 272 +pkg syscall (linux-arm-cgo), const ARPHRD_IEEE1394 = 24 +pkg syscall (linux-arm-cgo), const ARPHRD_IEEE802 = 6 +pkg syscall (linux-arm-cgo), const ARPHRD_IEEE80211 = 801 +pkg syscall (linux-arm-cgo), const ARPHRD_IEEE80211_PRISM = 802 +pkg syscall (linux-arm-cgo), const ARPHRD_IEEE80211_RADIOTAP = 803 +pkg syscall (linux-arm-cgo), const ARPHRD_IEEE802154 = 804 +pkg syscall (linux-arm-cgo), const ARPHRD_IEEE802154_PHY = 805 +pkg syscall (linux-arm-cgo), const ARPHRD_IEEE802_TR = 800 +pkg syscall (linux-arm-cgo), const ARPHRD_INFINIBAND = 32 +pkg syscall (linux-arm-cgo), const ARPHRD_IPDDP = 777 +pkg syscall (linux-arm-cgo), const ARPHRD_IPGRE = 778 +pkg syscall (linux-arm-cgo), const ARPHRD_IRDA = 783 +pkg syscall (linux-arm-cgo), const ARPHRD_LAPB = 516 +pkg syscall (linux-arm-cgo), const ARPHRD_LOCALTLK = 773 +pkg syscall (linux-arm-cgo), const ARPHRD_LOOPBACK = 772 +pkg syscall (linux-arm-cgo), const ARPHRD_METRICOM = 23 +pkg syscall (linux-arm-cgo), const ARPHRD_NETROM = 0 +pkg syscall (linux-arm-cgo), const ARPHRD_NONE = 65534 +pkg syscall (linux-arm-cgo), const ARPHRD_PIMREG = 779 +pkg syscall (linux-arm-cgo), const ARPHRD_PPP = 512 +pkg syscall (linux-arm-cgo), const ARPHRD_PRONET = 4 +pkg syscall (linux-arm-cgo), const ARPHRD_RAWHDLC = 518 +pkg syscall (linux-arm-cgo), const ARPHRD_ROSE = 270 +pkg syscall (linux-arm-cgo), const ARPHRD_RSRVD = 260 +pkg syscall (linux-arm-cgo), const ARPHRD_SIT = 776 +pkg syscall (linux-arm-cgo), const ARPHRD_SKIP = 771 +pkg syscall (linux-arm-cgo), const ARPHRD_SLIP = 256 +pkg syscall (linux-arm-cgo), const ARPHRD_SLIP6 = 258 +pkg syscall (linux-arm-cgo), const ARPHRD_TUNNEL = 768 +pkg syscall (linux-arm-cgo), const ARPHRD_TUNNEL6 = 769 +pkg syscall (linux-arm-cgo), const ARPHRD_VOID = 65535 +pkg syscall (linux-arm-cgo), const ARPHRD_X25 = 271 +pkg syscall (linux-arm-cgo), const B0 = 0 +pkg syscall (linux-arm-cgo), const B1000000 = 4104 +pkg syscall (linux-arm-cgo), const B110 = 3 +pkg syscall (linux-arm-cgo), const B115200 = 4098 +pkg syscall (linux-arm-cgo), const B1152000 = 4105 +pkg syscall (linux-arm-cgo), const B1200 = 9 +pkg syscall (linux-arm-cgo), const B134 = 4 +pkg syscall (linux-arm-cgo), const B150 = 5 +pkg syscall (linux-arm-cgo), const B1500000 = 4106 +pkg syscall (linux-arm-cgo), const B1800 = 10 +pkg syscall (linux-arm-cgo), const B19200 = 14 +pkg syscall (linux-arm-cgo), const B200 = 6 +pkg syscall (linux-arm-cgo), const B2000000 = 4107 +pkg syscall (linux-arm-cgo), const B230400 = 4099 +pkg syscall (linux-arm-cgo), const B2400 = 11 +pkg syscall (linux-arm-cgo), const B2500000 = 4108 +pkg syscall (linux-arm-cgo), const B300 = 7 +pkg syscall (linux-arm-cgo), const B3000000 = 4109 +pkg syscall (linux-arm-cgo), const B3500000 = 4110 +pkg syscall (linux-arm-cgo), const B38400 = 15 +pkg syscall (linux-arm-cgo), const B4000000 = 4111 +pkg syscall (linux-arm-cgo), const B460800 = 4100 +pkg syscall (linux-arm-cgo), const B4800 = 12 +pkg syscall (linux-arm-cgo), const B50 = 1 +pkg syscall (linux-arm-cgo), const B500000 = 4101 +pkg syscall (linux-arm-cgo), const B57600 = 4097 +pkg syscall (linux-arm-cgo), const B576000 = 4102 +pkg syscall (linux-arm-cgo), const B600 = 8 +pkg syscall (linux-arm-cgo), const B75 = 2 +pkg syscall (linux-arm-cgo), const B921600 = 4103 +pkg syscall (linux-arm-cgo), const B9600 = 13 +pkg syscall (linux-arm-cgo), const BPF_A = 16 +pkg syscall (linux-arm-cgo), const BPF_ABS = 32 +pkg syscall (linux-arm-cgo), const BPF_ADD = 0 +pkg syscall (linux-arm-cgo), const BPF_ALU = 4 +pkg syscall (linux-arm-cgo), const BPF_AND = 80 +pkg syscall (linux-arm-cgo), const BPF_B = 16 +pkg syscall (linux-arm-cgo), const BPF_DIV = 48 +pkg syscall (linux-arm-cgo), const BPF_H = 8 +pkg syscall (linux-arm-cgo), const BPF_IMM = 0 +pkg syscall (linux-arm-cgo), const BPF_IND = 64 +pkg syscall (linux-arm-cgo), const BPF_JA = 0 +pkg syscall (linux-arm-cgo), const BPF_JEQ = 16 +pkg syscall (linux-arm-cgo), const BPF_JGE = 48 +pkg syscall (linux-arm-cgo), const BPF_JGT = 32 +pkg syscall (linux-arm-cgo), const BPF_JMP = 5 +pkg syscall (linux-arm-cgo), const BPF_JSET = 64 +pkg syscall (linux-arm-cgo), const BPF_K = 0 +pkg syscall (linux-arm-cgo), const BPF_LD = 0 +pkg syscall (linux-arm-cgo), const BPF_LDX = 1 +pkg syscall (linux-arm-cgo), const BPF_LEN = 128 +pkg syscall (linux-arm-cgo), const BPF_LSH = 96 +pkg syscall (linux-arm-cgo), const BPF_MAJOR_VERSION = 1 +pkg syscall (linux-arm-cgo), const BPF_MAXINSNS = 4096 +pkg syscall (linux-arm-cgo), const BPF_MEM = 96 +pkg syscall (linux-arm-cgo), const BPF_MEMWORDS = 16 +pkg syscall (linux-arm-cgo), const BPF_MINOR_VERSION = 1 +pkg syscall (linux-arm-cgo), const BPF_MISC = 7 +pkg syscall (linux-arm-cgo), const BPF_MSH = 160 +pkg syscall (linux-arm-cgo), const BPF_MUL = 32 +pkg syscall (linux-arm-cgo), const BPF_NEG = 128 +pkg syscall (linux-arm-cgo), const BPF_OR = 64 +pkg syscall (linux-arm-cgo), const BPF_RET = 6 +pkg syscall (linux-arm-cgo), const BPF_RSH = 112 +pkg syscall (linux-arm-cgo), const BPF_ST = 2 +pkg syscall (linux-arm-cgo), const BPF_STX = 3 +pkg syscall (linux-arm-cgo), const BPF_SUB = 16 +pkg syscall (linux-arm-cgo), const BPF_TAX = 0 +pkg syscall (linux-arm-cgo), const BPF_TXA = 128 +pkg syscall (linux-arm-cgo), const BPF_W = 0 +pkg syscall (linux-arm-cgo), const BPF_X = 8 +pkg syscall (linux-arm-cgo), const BRKINT = 2 +pkg syscall (linux-arm-cgo), const CLOCAL = 2048 +pkg syscall (linux-arm-cgo), const CREAD = 128 +pkg syscall (linux-arm-cgo), const CS5 = 0 +pkg syscall (linux-arm-cgo), const CS6 = 16 +pkg syscall (linux-arm-cgo), const CS7 = 32 +pkg syscall (linux-arm-cgo), const CS8 = 48 +pkg syscall (linux-arm-cgo), const CSIZE = 48 +pkg syscall (linux-arm-cgo), const CSTOPB = 64 +pkg syscall (linux-arm-cgo), const DT_BLK = 6 +pkg syscall (linux-arm-cgo), const DT_CHR = 2 +pkg syscall (linux-arm-cgo), const DT_DIR = 4 +pkg syscall (linux-arm-cgo), const DT_FIFO = 1 +pkg syscall (linux-arm-cgo), const DT_LNK = 10 +pkg syscall (linux-arm-cgo), const DT_REG = 8 +pkg syscall (linux-arm-cgo), const DT_SOCK = 12 +pkg syscall (linux-arm-cgo), const DT_UNKNOWN = 0 +pkg syscall (linux-arm-cgo), const DT_WHT = 14 +pkg syscall (linux-arm-cgo), const E2BIG = 7 +pkg syscall (linux-arm-cgo), const EACCES = 13 +pkg syscall (linux-arm-cgo), const EADDRINUSE = 98 +pkg syscall (linux-arm-cgo), const EADDRNOTAVAIL = 99 +pkg syscall (linux-arm-cgo), const EADV = 68 +pkg syscall (linux-arm-cgo), const EAFNOSUPPORT = 97 +pkg syscall (linux-arm-cgo), const EAGAIN = 11 +pkg syscall (linux-arm-cgo), const EALREADY = 114 +pkg syscall (linux-arm-cgo), const EBADE = 52 +pkg syscall (linux-arm-cgo), const EBADF = 9 +pkg syscall (linux-arm-cgo), const EBADFD = 77 +pkg syscall (linux-arm-cgo), const EBADMSG = 74 +pkg syscall (linux-arm-cgo), const EBADR = 53 +pkg syscall (linux-arm-cgo), const EBADRQC = 56 +pkg syscall (linux-arm-cgo), const EBADSLT = 57 +pkg syscall (linux-arm-cgo), const EBFONT = 59 +pkg syscall (linux-arm-cgo), const EBUSY = 16 +pkg syscall (linux-arm-cgo), const ECANCELED = 125 +pkg syscall (linux-arm-cgo), const ECHILD = 10 +pkg syscall (linux-arm-cgo), const ECHO = 8 +pkg syscall (linux-arm-cgo), const ECHOCTL = 512 +pkg syscall (linux-arm-cgo), const ECHOE = 16 +pkg syscall (linux-arm-cgo), const ECHOK = 32 +pkg syscall (linux-arm-cgo), const ECHOKE = 2048 +pkg syscall (linux-arm-cgo), const ECHONL = 64 +pkg syscall (linux-arm-cgo), const ECHOPRT = 1024 +pkg syscall (linux-arm-cgo), const ECHRNG = 44 +pkg syscall (linux-arm-cgo), const ECOMM = 70 +pkg syscall (linux-arm-cgo), const ECONNABORTED = 103 +pkg syscall (linux-arm-cgo), const ECONNREFUSED = 111 +pkg syscall (linux-arm-cgo), const ECONNRESET = 104 +pkg syscall (linux-arm-cgo), const EDEADLK = 35 +pkg syscall (linux-arm-cgo), const EDEADLOCK = 35 +pkg syscall (linux-arm-cgo), const EDESTADDRREQ = 89 +pkg syscall (linux-arm-cgo), const EDOM = 33 +pkg syscall (linux-arm-cgo), const EDOTDOT = 73 +pkg syscall (linux-arm-cgo), const EDQUOT = 122 +pkg syscall (linux-arm-cgo), const EEXIST = 17 +pkg syscall (linux-arm-cgo), const EFAULT = 14 +pkg syscall (linux-arm-cgo), const EFBIG = 27 +pkg syscall (linux-arm-cgo), const EHOSTDOWN = 112 +pkg syscall (linux-arm-cgo), const EHOSTUNREACH = 113 +pkg syscall (linux-arm-cgo), const EHWPOISON = 133 +pkg syscall (linux-arm-cgo), const EIDRM = 43 +pkg syscall (linux-arm-cgo), const EILSEQ = 84 +pkg syscall (linux-arm-cgo), const EINPROGRESS = 115 +pkg syscall (linux-arm-cgo), const EINTR = 4 +pkg syscall (linux-arm-cgo), const EINVAL = 22 +pkg syscall (linux-arm-cgo), const EIO = 5 +pkg syscall (linux-arm-cgo), const EISCONN = 106 +pkg syscall (linux-arm-cgo), const EISDIR = 21 +pkg syscall (linux-arm-cgo), const EISNAM = 120 +pkg syscall (linux-arm-cgo), const EKEYEXPIRED = 127 +pkg syscall (linux-arm-cgo), const EKEYREJECTED = 129 +pkg syscall (linux-arm-cgo), const EKEYREVOKED = 128 +pkg syscall (linux-arm-cgo), const EL2HLT = 51 +pkg syscall (linux-arm-cgo), const EL2NSYNC = 45 +pkg syscall (linux-arm-cgo), const EL3HLT = 46 +pkg syscall (linux-arm-cgo), const EL3RST = 47 +pkg syscall (linux-arm-cgo), const ELF_NGREG = 18 +pkg syscall (linux-arm-cgo), const ELF_PRARGSZ = 80 +pkg syscall (linux-arm-cgo), const ELIBACC = 79 +pkg syscall (linux-arm-cgo), const ELIBBAD = 80 +pkg syscall (linux-arm-cgo), const ELIBEXEC = 83 +pkg syscall (linux-arm-cgo), const ELIBMAX = 82 +pkg syscall (linux-arm-cgo), const ELIBSCN = 81 +pkg syscall (linux-arm-cgo), const ELNRNG = 48 +pkg syscall (linux-arm-cgo), const ELOOP = 40 +pkg syscall (linux-arm-cgo), const EMEDIUMTYPE = 124 +pkg syscall (linux-arm-cgo), const EMFILE = 24 +pkg syscall (linux-arm-cgo), const EMLINK = 31 +pkg syscall (linux-arm-cgo), const EMSGSIZE = 90 +pkg syscall (linux-arm-cgo), const EMULTIHOP = 72 +pkg syscall (linux-arm-cgo), const ENAMETOOLONG = 36 +pkg syscall (linux-arm-cgo), const ENAVAIL = 119 +pkg syscall (linux-arm-cgo), const ENETDOWN = 100 +pkg syscall (linux-arm-cgo), const ENETRESET = 102 +pkg syscall (linux-arm-cgo), const ENETUNREACH = 101 +pkg syscall (linux-arm-cgo), const ENFILE = 23 +pkg syscall (linux-arm-cgo), const ENOANO = 55 +pkg syscall (linux-arm-cgo), const ENOBUFS = 105 +pkg syscall (linux-arm-cgo), const ENOCSI = 50 +pkg syscall (linux-arm-cgo), const ENODATA = 61 +pkg syscall (linux-arm-cgo), const ENODEV = 19 +pkg syscall (linux-arm-cgo), const ENOEXEC = 8 +pkg syscall (linux-arm-cgo), const ENOKEY = 126 +pkg syscall (linux-arm-cgo), const ENOLCK = 37 +pkg syscall (linux-arm-cgo), const ENOLINK = 67 +pkg syscall (linux-arm-cgo), const ENOMEDIUM = 123 +pkg syscall (linux-arm-cgo), const ENOMEM = 12 +pkg syscall (linux-arm-cgo), const ENOMSG = 42 +pkg syscall (linux-arm-cgo), const ENONET = 64 +pkg syscall (linux-arm-cgo), const ENOPKG = 65 +pkg syscall (linux-arm-cgo), const ENOPROTOOPT = 92 +pkg syscall (linux-arm-cgo), const ENOSPC = 28 +pkg syscall (linux-arm-cgo), const ENOSR = 63 +pkg syscall (linux-arm-cgo), const ENOSTR = 60 +pkg syscall (linux-arm-cgo), const ENOSYS = 38 +pkg syscall (linux-arm-cgo), const ENOTBLK = 15 +pkg syscall (linux-arm-cgo), const ENOTCONN = 107 +pkg syscall (linux-arm-cgo), const ENOTDIR = 20 +pkg syscall (linux-arm-cgo), const ENOTEMPTY = 39 +pkg syscall (linux-arm-cgo), const ENOTNAM = 118 +pkg syscall (linux-arm-cgo), const ENOTRECOVERABLE = 131 +pkg syscall (linux-arm-cgo), const ENOTSOCK = 88 +pkg syscall (linux-arm-cgo), const ENOTSUP = 95 +pkg syscall (linux-arm-cgo), const ENOTTY = 25 +pkg syscall (linux-arm-cgo), const ENOTUNIQ = 76 +pkg syscall (linux-arm-cgo), const ENXIO = 6 +pkg syscall (linux-arm-cgo), const EOPNOTSUPP = 95 +pkg syscall (linux-arm-cgo), const EOVERFLOW = 75 +pkg syscall (linux-arm-cgo), const EOWNERDEAD = 130 +pkg syscall (linux-arm-cgo), const EPERM = 1 +pkg syscall (linux-arm-cgo), const EPFNOSUPPORT = 96 +pkg syscall (linux-arm-cgo), const EPIPE = 32 +pkg syscall (linux-arm-cgo), const EPOLLERR = 8 +pkg syscall (linux-arm-cgo), const EPOLLET = -2147483648 +pkg syscall (linux-arm-cgo), const EPOLLHUP = 16 +pkg syscall (linux-arm-cgo), const EPOLLIN = 1 +pkg syscall (linux-arm-cgo), const EPOLLMSG = 1024 +pkg syscall (linux-arm-cgo), const EPOLLONESHOT = 1073741824 +pkg syscall (linux-arm-cgo), const EPOLLOUT = 4 +pkg syscall (linux-arm-cgo), const EPOLLPRI = 2 +pkg syscall (linux-arm-cgo), const EPOLLRDBAND = 128 +pkg syscall (linux-arm-cgo), const EPOLLRDHUP = 8192 +pkg syscall (linux-arm-cgo), const EPOLLRDNORM = 64 +pkg syscall (linux-arm-cgo), const EPOLLWRBAND = 512 +pkg syscall (linux-arm-cgo), const EPOLLWRNORM = 256 +pkg syscall (linux-arm-cgo), const EPOLL_CLOEXEC = 524288 +pkg syscall (linux-arm-cgo), const EPOLL_CTL_ADD = 1 +pkg syscall (linux-arm-cgo), const EPOLL_CTL_DEL = 2 +pkg syscall (linux-arm-cgo), const EPOLL_CTL_MOD = 3 +pkg syscall (linux-arm-cgo), const EPOLL_NONBLOCK = 2048 +pkg syscall (linux-arm-cgo), const EPROTO = 71 +pkg syscall (linux-arm-cgo), const EPROTONOSUPPORT = 93 +pkg syscall (linux-arm-cgo), const EPROTOTYPE = 91 +pkg syscall (linux-arm-cgo), const ERANGE = 34 +pkg syscall (linux-arm-cgo), const EREMCHG = 78 +pkg syscall (linux-arm-cgo), const EREMOTE = 66 +pkg syscall (linux-arm-cgo), const EREMOTEIO = 121 +pkg syscall (linux-arm-cgo), const ERESTART = 85 +pkg syscall (linux-arm-cgo), const ERFKILL = 132 +pkg syscall (linux-arm-cgo), const EROFS = 30 +pkg syscall (linux-arm-cgo), const ESHUTDOWN = 108 +pkg syscall (linux-arm-cgo), const ESOCKTNOSUPPORT = 94 +pkg syscall (linux-arm-cgo), const ESPIPE = 29 +pkg syscall (linux-arm-cgo), const ESRCH = 3 +pkg syscall (linux-arm-cgo), const ESRMNT = 69 +pkg syscall (linux-arm-cgo), const ESTALE = 116 +pkg syscall (linux-arm-cgo), const ESTRPIPE = 86 +pkg syscall (linux-arm-cgo), const ETH_P_1588 = 35063 +pkg syscall (linux-arm-cgo), const ETH_P_8021Q = 33024 +pkg syscall (linux-arm-cgo), const ETH_P_802_2 = 4 +pkg syscall (linux-arm-cgo), const ETH_P_802_3 = 1 +pkg syscall (linux-arm-cgo), const ETH_P_AARP = 33011 +pkg syscall (linux-arm-cgo), const ETH_P_ALL = 3 +pkg syscall (linux-arm-cgo), const ETH_P_AOE = 34978 +pkg syscall (linux-arm-cgo), const ETH_P_ARCNET = 26 +pkg syscall (linux-arm-cgo), const ETH_P_ARP = 2054 +pkg syscall (linux-arm-cgo), const ETH_P_ATALK = 32923 +pkg syscall (linux-arm-cgo), const ETH_P_ATMFATE = 34948 +pkg syscall (linux-arm-cgo), const ETH_P_ATMMPOA = 34892 +pkg syscall (linux-arm-cgo), const ETH_P_AX25 = 2 +pkg syscall (linux-arm-cgo), const ETH_P_BPQ = 2303 +pkg syscall (linux-arm-cgo), const ETH_P_CAIF = 247 +pkg syscall (linux-arm-cgo), const ETH_P_CAN = 12 +pkg syscall (linux-arm-cgo), const ETH_P_CONTROL = 22 +pkg syscall (linux-arm-cgo), const ETH_P_CUST = 24582 +pkg syscall (linux-arm-cgo), const ETH_P_DDCMP = 6 +pkg syscall (linux-arm-cgo), const ETH_P_DEC = 24576 +pkg syscall (linux-arm-cgo), const ETH_P_DIAG = 24581 +pkg syscall (linux-arm-cgo), const ETH_P_DNA_DL = 24577 +pkg syscall (linux-arm-cgo), const ETH_P_DNA_RC = 24578 +pkg syscall (linux-arm-cgo), const ETH_P_DNA_RT = 24579 +pkg syscall (linux-arm-cgo), const ETH_P_DSA = 27 +pkg syscall (linux-arm-cgo), const ETH_P_ECONET = 24 +pkg syscall (linux-arm-cgo), const ETH_P_EDSA = 56026 +pkg syscall (linux-arm-cgo), const ETH_P_FCOE = 35078 +pkg syscall (linux-arm-cgo), const ETH_P_FIP = 35092 +pkg syscall (linux-arm-cgo), const ETH_P_HDLC = 25 +pkg syscall (linux-arm-cgo), const ETH_P_IEEE802154 = 246 +pkg syscall (linux-arm-cgo), const ETH_P_IEEEPUP = 2560 +pkg syscall (linux-arm-cgo), const ETH_P_IEEEPUPAT = 2561 +pkg syscall (linux-arm-cgo), const ETH_P_IP = 2048 +pkg syscall (linux-arm-cgo), const ETH_P_IPV6 = 34525 +pkg syscall (linux-arm-cgo), const ETH_P_IPX = 33079 +pkg syscall (linux-arm-cgo), const ETH_P_IRDA = 23 +pkg syscall (linux-arm-cgo), const ETH_P_LAT = 24580 +pkg syscall (linux-arm-cgo), const ETH_P_LINK_CTL = 34924 +pkg syscall (linux-arm-cgo), const ETH_P_LOCALTALK = 9 +pkg syscall (linux-arm-cgo), const ETH_P_LOOP = 96 +pkg syscall (linux-arm-cgo), const ETH_P_MOBITEX = 21 +pkg syscall (linux-arm-cgo), const ETH_P_MPLS_MC = 34888 +pkg syscall (linux-arm-cgo), const ETH_P_MPLS_UC = 34887 +pkg syscall (linux-arm-cgo), const ETH_P_PAE = 34958 +pkg syscall (linux-arm-cgo), const ETH_P_PAUSE = 34824 +pkg syscall (linux-arm-cgo), const ETH_P_PHONET = 245 +pkg syscall (linux-arm-cgo), const ETH_P_PPPTALK = 16 +pkg syscall (linux-arm-cgo), const ETH_P_PPP_DISC = 34915 +pkg syscall (linux-arm-cgo), const ETH_P_PPP_MP = 8 +pkg syscall (linux-arm-cgo), const ETH_P_PPP_SES = 34916 +pkg syscall (linux-arm-cgo), const ETH_P_PUP = 512 +pkg syscall (linux-arm-cgo), const ETH_P_PUPAT = 513 +pkg syscall (linux-arm-cgo), const ETH_P_RARP = 32821 +pkg syscall (linux-arm-cgo), const ETH_P_SCA = 24583 +pkg syscall (linux-arm-cgo), const ETH_P_SLOW = 34825 +pkg syscall (linux-arm-cgo), const ETH_P_SNAP = 5 +pkg syscall (linux-arm-cgo), const ETH_P_TEB = 25944 +pkg syscall (linux-arm-cgo), const ETH_P_TIPC = 35018 +pkg syscall (linux-arm-cgo), const ETH_P_TRAILER = 28 +pkg syscall (linux-arm-cgo), const ETH_P_TR_802_2 = 17 +pkg syscall (linux-arm-cgo), const ETH_P_WAN_PPP = 7 +pkg syscall (linux-arm-cgo), const ETH_P_WCCP = 34878 +pkg syscall (linux-arm-cgo), const ETH_P_X25 = 2053 +pkg syscall (linux-arm-cgo), const ETIME = 62 +pkg syscall (linux-arm-cgo), const ETIMEDOUT = 110 +pkg syscall (linux-arm-cgo), const ETOOMANYREFS = 109 +pkg syscall (linux-arm-cgo), const ETXTBSY = 26 +pkg syscall (linux-arm-cgo), const EUCLEAN = 117 +pkg syscall (linux-arm-cgo), const EUNATCH = 49 +pkg syscall (linux-arm-cgo), const EUSERS = 87 +pkg syscall (linux-arm-cgo), const EWOULDBLOCK = 11 +pkg syscall (linux-arm-cgo), const EXDEV = 18 +pkg syscall (linux-arm-cgo), const EXFULL = 54 +pkg syscall (linux-arm-cgo), const FD_CLOEXEC = 1 +pkg syscall (linux-arm-cgo), const FD_SETSIZE = 1024 +pkg syscall (linux-arm-cgo), const FLUSHO = 4096 +pkg syscall (linux-arm-cgo), const F_DUPFD = 0 +pkg syscall (linux-arm-cgo), const F_DUPFD_CLOEXEC = 1030 +pkg syscall (linux-arm-cgo), const F_EXLCK = 4 +pkg syscall (linux-arm-cgo), const F_GETFD = 1 +pkg syscall (linux-arm-cgo), const F_GETFL = 3 +pkg syscall (linux-arm-cgo), const F_GETLEASE = 1025 +pkg syscall (linux-arm-cgo), const F_GETLK = 12 +pkg syscall (linux-arm-cgo), const F_GETLK64 = 12 +pkg syscall (linux-arm-cgo), const F_GETOWN = 9 +pkg syscall (linux-arm-cgo), const F_GETOWN_EX = 16 +pkg syscall (linux-arm-cgo), const F_GETPIPE_SZ = 1032 +pkg syscall (linux-arm-cgo), const F_GETSIG = 11 +pkg syscall (linux-arm-cgo), const F_LOCK = 1 +pkg syscall (linux-arm-cgo), const F_NOTIFY = 1026 +pkg syscall (linux-arm-cgo), const F_OK = 0 +pkg syscall (linux-arm-cgo), const F_RDLCK = 0 +pkg syscall (linux-arm-cgo), const F_SETFD = 2 +pkg syscall (linux-arm-cgo), const F_SETFL = 4 +pkg syscall (linux-arm-cgo), const F_SETLEASE = 1024 +pkg syscall (linux-arm-cgo), const F_SETLK = 13 +pkg syscall (linux-arm-cgo), const F_SETLK64 = 13 +pkg syscall (linux-arm-cgo), const F_SETLKW = 14 +pkg syscall (linux-arm-cgo), const F_SETLKW64 = 14 +pkg syscall (linux-arm-cgo), const F_SETOWN = 8 +pkg syscall (linux-arm-cgo), const F_SETOWN_EX = 15 +pkg syscall (linux-arm-cgo), const F_SETPIPE_SZ = 1031 +pkg syscall (linux-arm-cgo), const F_SETSIG = 10 +pkg syscall (linux-arm-cgo), const F_SHLCK = 8 +pkg syscall (linux-arm-cgo), const F_TEST = 3 +pkg syscall (linux-arm-cgo), const F_TLOCK = 2 +pkg syscall (linux-arm-cgo), const F_ULOCK = 0 +pkg syscall (linux-arm-cgo), const F_UNLCK = 2 +pkg syscall (linux-arm-cgo), const F_WRLCK = 1 +pkg syscall (linux-arm-cgo), const HUPCL = 1024 +pkg syscall (linux-arm-cgo), const ICANON = 2 +pkg syscall (linux-arm-cgo), const ICRNL = 256 +pkg syscall (linux-arm-cgo), const IEXTEN = 32768 +pkg syscall (linux-arm-cgo), const IFA_ADDRESS = 1 +pkg syscall (linux-arm-cgo), const IFA_ANYCAST = 5 +pkg syscall (linux-arm-cgo), const IFA_BROADCAST = 4 +pkg syscall (linux-arm-cgo), const IFA_CACHEINFO = 6 +pkg syscall (linux-arm-cgo), const IFA_F_DADFAILED = 8 +pkg syscall (linux-arm-cgo), const IFA_F_DEPRECATED = 32 +pkg syscall (linux-arm-cgo), const IFA_F_HOMEADDRESS = 16 +pkg syscall (linux-arm-cgo), const IFA_F_NODAD = 2 +pkg syscall (linux-arm-cgo), const IFA_F_OPTIMISTIC = 4 +pkg syscall (linux-arm-cgo), const IFA_F_PERMANENT = 128 +pkg syscall (linux-arm-cgo), const IFA_F_SECONDARY = 1 +pkg syscall (linux-arm-cgo), const IFA_F_TEMPORARY = 1 +pkg syscall (linux-arm-cgo), const IFA_F_TENTATIVE = 64 +pkg syscall (linux-arm-cgo), const IFA_LABEL = 3 +pkg syscall (linux-arm-cgo), const IFA_LOCAL = 2 +pkg syscall (linux-arm-cgo), const IFA_MAX = 7 +pkg syscall (linux-arm-cgo), const IFA_MULTICAST = 7 +pkg syscall (linux-arm-cgo), const IFA_UNSPEC = 0 +pkg syscall (linux-arm-cgo), const IFF_ALLMULTI = 512 +pkg syscall (linux-arm-cgo), const IFF_AUTOMEDIA = 16384 +pkg syscall (linux-arm-cgo), const IFF_DEBUG = 4 +pkg syscall (linux-arm-cgo), const IFF_DYNAMIC = 32768 +pkg syscall (linux-arm-cgo), const IFF_LOOPBACK = 8 +pkg syscall (linux-arm-cgo), const IFF_MASTER = 1024 +pkg syscall (linux-arm-cgo), const IFF_MULTICAST = 4096 +pkg syscall (linux-arm-cgo), const IFF_NOARP = 128 +pkg syscall (linux-arm-cgo), const IFF_NOTRAILERS = 32 +pkg syscall (linux-arm-cgo), const IFF_NO_PI = 4096 +pkg syscall (linux-arm-cgo), const IFF_ONE_QUEUE = 8192 +pkg syscall (linux-arm-cgo), const IFF_POINTOPOINT = 16 +pkg syscall (linux-arm-cgo), const IFF_PORTSEL = 8192 +pkg syscall (linux-arm-cgo), const IFF_PROMISC = 256 +pkg syscall (linux-arm-cgo), const IFF_RUNNING = 64 +pkg syscall (linux-arm-cgo), const IFF_SLAVE = 2048 +pkg syscall (linux-arm-cgo), const IFF_TAP = 2 +pkg syscall (linux-arm-cgo), const IFF_TUN = 1 +pkg syscall (linux-arm-cgo), const IFF_TUN_EXCL = 32768 +pkg syscall (linux-arm-cgo), const IFF_VNET_HDR = 16384 +pkg syscall (linux-arm-cgo), const IFLA_ADDRESS = 1 +pkg syscall (linux-arm-cgo), const IFLA_BROADCAST = 2 +pkg syscall (linux-arm-cgo), const IFLA_COST = 8 +pkg syscall (linux-arm-cgo), const IFLA_IFALIAS = 20 +pkg syscall (linux-arm-cgo), const IFLA_IFNAME = 3 +pkg syscall (linux-arm-cgo), const IFLA_LINK = 5 +pkg syscall (linux-arm-cgo), const IFLA_LINKINFO = 18 +pkg syscall (linux-arm-cgo), const IFLA_LINKMODE = 17 +pkg syscall (linux-arm-cgo), const IFLA_MAP = 14 +pkg syscall (linux-arm-cgo), const IFLA_MASTER = 10 +pkg syscall (linux-arm-cgo), const IFLA_MAX = 29 +pkg syscall (linux-arm-cgo), const IFLA_MTU = 4 +pkg syscall (linux-arm-cgo), const IFLA_NET_NS_PID = 19 +pkg syscall (linux-arm-cgo), const IFLA_OPERSTATE = 16 +pkg syscall (linux-arm-cgo), const IFLA_PRIORITY = 9 +pkg syscall (linux-arm-cgo), const IFLA_PROTINFO = 12 +pkg syscall (linux-arm-cgo), const IFLA_QDISC = 6 +pkg syscall (linux-arm-cgo), const IFLA_STATS = 7 +pkg syscall (linux-arm-cgo), const IFLA_TXQLEN = 13 +pkg syscall (linux-arm-cgo), const IFLA_UNSPEC = 0 +pkg syscall (linux-arm-cgo), const IFLA_WEIGHT = 15 +pkg syscall (linux-arm-cgo), const IFLA_WIRELESS = 11 +pkg syscall (linux-arm-cgo), const IFNAMSIZ = 16 +pkg syscall (linux-arm-cgo), const IGNBRK = 1 +pkg syscall (linux-arm-cgo), const IGNCR = 128 +pkg syscall (linux-arm-cgo), const IGNPAR = 4 +pkg syscall (linux-arm-cgo), const IMAXBEL = 8192 +pkg syscall (linux-arm-cgo), const INLCR = 64 +pkg syscall (linux-arm-cgo), const INPCK = 16 +pkg syscall (linux-arm-cgo), const IN_ACCESS = 1 +pkg syscall (linux-arm-cgo), const IN_ALL_EVENTS = 4095 +pkg syscall (linux-arm-cgo), const IN_ATTRIB = 4 +pkg syscall (linux-arm-cgo), const IN_CLASSA_HOST = 16777215 +pkg syscall (linux-arm-cgo), const IN_CLASSA_MAX = 128 +pkg syscall (linux-arm-cgo), const IN_CLASSA_NET = 4278190080 +pkg syscall (linux-arm-cgo), const IN_CLASSA_NSHIFT = 24 +pkg syscall (linux-arm-cgo), const IN_CLASSB_HOST = 65535 +pkg syscall (linux-arm-cgo), const IN_CLASSB_MAX = 65536 +pkg syscall (linux-arm-cgo), const IN_CLASSB_NET = 4294901760 +pkg syscall (linux-arm-cgo), const IN_CLASSB_NSHIFT = 16 +pkg syscall (linux-arm-cgo), const IN_CLASSC_HOST = 255 +pkg syscall (linux-arm-cgo), const IN_CLASSC_NET = 4294967040 +pkg syscall (linux-arm-cgo), const IN_CLASSC_NSHIFT = 8 +pkg syscall (linux-arm-cgo), const IN_CLOEXEC = 524288 +pkg syscall (linux-arm-cgo), const IN_CLOSE = 24 +pkg syscall (linux-arm-cgo), const IN_CLOSE_NOWRITE = 16 +pkg syscall (linux-arm-cgo), const IN_CLOSE_WRITE = 8 +pkg syscall (linux-arm-cgo), const IN_CREATE = 256 +pkg syscall (linux-arm-cgo), const IN_DELETE = 512 +pkg syscall (linux-arm-cgo), const IN_DELETE_SELF = 1024 +pkg syscall (linux-arm-cgo), const IN_DONT_FOLLOW = 33554432 +pkg syscall (linux-arm-cgo), const IN_EXCL_UNLINK = 67108864 +pkg syscall (linux-arm-cgo), const IN_IGNORED = 32768 +pkg syscall (linux-arm-cgo), const IN_ISDIR = 1073741824 +pkg syscall (linux-arm-cgo), const IN_LOOPBACKNET = 127 +pkg syscall (linux-arm-cgo), const IN_MASK_ADD = 536870912 +pkg syscall (linux-arm-cgo), const IN_MODIFY = 2 +pkg syscall (linux-arm-cgo), const IN_MOVE = 192 +pkg syscall (linux-arm-cgo), const IN_MOVED_FROM = 64 +pkg syscall (linux-arm-cgo), const IN_MOVED_TO = 128 +pkg syscall (linux-arm-cgo), const IN_MOVE_SELF = 2048 +pkg syscall (linux-arm-cgo), const IN_NONBLOCK = 2048 +pkg syscall (linux-arm-cgo), const IN_ONESHOT = 2147483648 +pkg syscall (linux-arm-cgo), const IN_ONLYDIR = 16777216 +pkg syscall (linux-arm-cgo), const IN_OPEN = 32 +pkg syscall (linux-arm-cgo), const IN_Q_OVERFLOW = 16384 +pkg syscall (linux-arm-cgo), const IN_UNMOUNT = 8192 +pkg syscall (linux-arm-cgo), const IPPROTO_AH = 51 +pkg syscall (linux-arm-cgo), const IPPROTO_COMP = 108 +pkg syscall (linux-arm-cgo), const IPPROTO_DCCP = 33 +pkg syscall (linux-arm-cgo), const IPPROTO_DSTOPTS = 60 +pkg syscall (linux-arm-cgo), const IPPROTO_EGP = 8 +pkg syscall (linux-arm-cgo), const IPPROTO_ENCAP = 98 +pkg syscall (linux-arm-cgo), const IPPROTO_ESP = 50 +pkg syscall (linux-arm-cgo), const IPPROTO_FRAGMENT = 44 +pkg syscall (linux-arm-cgo), const IPPROTO_GRE = 47 +pkg syscall (linux-arm-cgo), const IPPROTO_HOPOPTS = 0 +pkg syscall (linux-arm-cgo), const IPPROTO_ICMP = 1 +pkg syscall (linux-arm-cgo), const IPPROTO_ICMPV6 = 58 +pkg syscall (linux-arm-cgo), const IPPROTO_IDP = 22 +pkg syscall (linux-arm-cgo), const IPPROTO_IGMP = 2 +pkg syscall (linux-arm-cgo), const IPPROTO_IPIP = 4 +pkg syscall (linux-arm-cgo), const IPPROTO_MTP = 92 +pkg syscall (linux-arm-cgo), const IPPROTO_NONE = 59 +pkg syscall (linux-arm-cgo), const IPPROTO_PIM = 103 +pkg syscall (linux-arm-cgo), const IPPROTO_PUP = 12 +pkg syscall (linux-arm-cgo), const IPPROTO_RAW = 255 +pkg syscall (linux-arm-cgo), const IPPROTO_ROUTING = 43 +pkg syscall (linux-arm-cgo), const IPPROTO_RSVP = 46 +pkg syscall (linux-arm-cgo), const IPPROTO_SCTP = 132 +pkg syscall (linux-arm-cgo), const IPPROTO_TP = 29 +pkg syscall (linux-arm-cgo), const IPPROTO_UDPLITE = 136 +pkg syscall (linux-arm-cgo), const IPV6_2292DSTOPTS = 4 +pkg syscall (linux-arm-cgo), const IPV6_2292HOPLIMIT = 8 +pkg syscall (linux-arm-cgo), const IPV6_2292HOPOPTS = 3 +pkg syscall (linux-arm-cgo), const IPV6_2292PKTINFO = 2 +pkg syscall (linux-arm-cgo), const IPV6_2292PKTOPTIONS = 6 +pkg syscall (linux-arm-cgo), const IPV6_2292RTHDR = 5 +pkg syscall (linux-arm-cgo), const IPV6_ADDRFORM = 1 +pkg syscall (linux-arm-cgo), const IPV6_ADD_MEMBERSHIP = 20 +pkg syscall (linux-arm-cgo), const IPV6_AUTHHDR = 10 +pkg syscall (linux-arm-cgo), const IPV6_CHECKSUM = 7 +pkg syscall (linux-arm-cgo), const IPV6_DROP_MEMBERSHIP = 21 +pkg syscall (linux-arm-cgo), const IPV6_DSTOPTS = 59 +pkg syscall (linux-arm-cgo), const IPV6_HOPLIMIT = 52 +pkg syscall (linux-arm-cgo), const IPV6_HOPOPTS = 54 +pkg syscall (linux-arm-cgo), const IPV6_IPSEC_POLICY = 34 +pkg syscall (linux-arm-cgo), const IPV6_JOIN_ANYCAST = 27 +pkg syscall (linux-arm-cgo), const IPV6_JOIN_GROUP = 20 +pkg syscall (linux-arm-cgo), const IPV6_LEAVE_ANYCAST = 28 +pkg syscall (linux-arm-cgo), const IPV6_LEAVE_GROUP = 21 +pkg syscall (linux-arm-cgo), const IPV6_MTU = 24 +pkg syscall (linux-arm-cgo), const IPV6_MTU_DISCOVER = 23 +pkg syscall (linux-arm-cgo), const IPV6_MULTICAST_HOPS = 18 +pkg syscall (linux-arm-cgo), const IPV6_MULTICAST_IF = 17 +pkg syscall (linux-arm-cgo), const IPV6_MULTICAST_LOOP = 19 +pkg syscall (linux-arm-cgo), const IPV6_NEXTHOP = 9 +pkg syscall (linux-arm-cgo), const IPV6_PKTINFO = 50 +pkg syscall (linux-arm-cgo), const IPV6_PMTUDISC_DO = 2 +pkg syscall (linux-arm-cgo), const IPV6_PMTUDISC_DONT = 0 +pkg syscall (linux-arm-cgo), const IPV6_PMTUDISC_PROBE = 3 +pkg syscall (linux-arm-cgo), const IPV6_PMTUDISC_WANT = 1 +pkg syscall (linux-arm-cgo), const IPV6_RECVDSTOPTS = 58 +pkg syscall (linux-arm-cgo), const IPV6_RECVERR = 25 +pkg syscall (linux-arm-cgo), const IPV6_RECVHOPLIMIT = 51 +pkg syscall (linux-arm-cgo), const IPV6_RECVHOPOPTS = 53 +pkg syscall (linux-arm-cgo), const IPV6_RECVPKTINFO = 49 +pkg syscall (linux-arm-cgo), const IPV6_RECVRTHDR = 56 +pkg syscall (linux-arm-cgo), const IPV6_RECVTCLASS = 66 +pkg syscall (linux-arm-cgo), const IPV6_ROUTER_ALERT = 22 +pkg syscall (linux-arm-cgo), const IPV6_RTHDR = 57 +pkg syscall (linux-arm-cgo), const IPV6_RTHDRDSTOPTS = 55 +pkg syscall (linux-arm-cgo), const IPV6_RTHDR_LOOSE = 0 +pkg syscall (linux-arm-cgo), const IPV6_RTHDR_STRICT = 1 +pkg syscall (linux-arm-cgo), const IPV6_RTHDR_TYPE_0 = 0 +pkg syscall (linux-arm-cgo), const IPV6_RXDSTOPTS = 59 +pkg syscall (linux-arm-cgo), const IPV6_RXHOPOPTS = 54 +pkg syscall (linux-arm-cgo), const IPV6_TCLASS = 67 +pkg syscall (linux-arm-cgo), const IPV6_UNICAST_HOPS = 16 +pkg syscall (linux-arm-cgo), const IPV6_V6ONLY = 26 +pkg syscall (linux-arm-cgo), const IPV6_XFRM_POLICY = 35 +pkg syscall (linux-arm-cgo), const IP_ADD_MEMBERSHIP = 35 +pkg syscall (linux-arm-cgo), const IP_ADD_SOURCE_MEMBERSHIP = 39 +pkg syscall (linux-arm-cgo), const IP_BLOCK_SOURCE = 38 +pkg syscall (linux-arm-cgo), const IP_DEFAULT_MULTICAST_LOOP = 1 +pkg syscall (linux-arm-cgo), const IP_DEFAULT_MULTICAST_TTL = 1 +pkg syscall (linux-arm-cgo), const IP_DF = 16384 +pkg syscall (linux-arm-cgo), const IP_DROP_MEMBERSHIP = 36 +pkg syscall (linux-arm-cgo), const IP_DROP_SOURCE_MEMBERSHIP = 40 +pkg syscall (linux-arm-cgo), const IP_FREEBIND = 15 +pkg syscall (linux-arm-cgo), const IP_HDRINCL = 3 +pkg syscall (linux-arm-cgo), const IP_IPSEC_POLICY = 16 +pkg syscall (linux-arm-cgo), const IP_MAXPACKET = 65535 +pkg syscall (linux-arm-cgo), const IP_MAX_MEMBERSHIPS = 20 +pkg syscall (linux-arm-cgo), const IP_MF = 8192 +pkg syscall (linux-arm-cgo), const IP_MINTTL = 21 +pkg syscall (linux-arm-cgo), const IP_MSFILTER = 41 +pkg syscall (linux-arm-cgo), const IP_MSS = 576 +pkg syscall (linux-arm-cgo), const IP_MTU = 14 +pkg syscall (linux-arm-cgo), const IP_MTU_DISCOVER = 10 +pkg syscall (linux-arm-cgo), const IP_MULTICAST_IF = 32 +pkg syscall (linux-arm-cgo), const IP_MULTICAST_LOOP = 34 +pkg syscall (linux-arm-cgo), const IP_MULTICAST_TTL = 33 +pkg syscall (linux-arm-cgo), const IP_OFFMASK = 8191 +pkg syscall (linux-arm-cgo), const IP_OPTIONS = 4 +pkg syscall (linux-arm-cgo), const IP_ORIGDSTADDR = 20 +pkg syscall (linux-arm-cgo), const IP_PASSSEC = 18 +pkg syscall (linux-arm-cgo), const IP_PKTINFO = 8 +pkg syscall (linux-arm-cgo), const IP_PKTOPTIONS = 9 +pkg syscall (linux-arm-cgo), const IP_PMTUDISC = 10 +pkg syscall (linux-arm-cgo), const IP_PMTUDISC_DO = 2 +pkg syscall (linux-arm-cgo), const IP_PMTUDISC_DONT = 0 +pkg syscall (linux-arm-cgo), const IP_PMTUDISC_PROBE = 3 +pkg syscall (linux-arm-cgo), const IP_PMTUDISC_WANT = 1 +pkg syscall (linux-arm-cgo), const IP_RECVERR = 11 +pkg syscall (linux-arm-cgo), const IP_RECVOPTS = 6 +pkg syscall (linux-arm-cgo), const IP_RECVORIGDSTADDR = 20 +pkg syscall (linux-arm-cgo), const IP_RECVRETOPTS = 7 +pkg syscall (linux-arm-cgo), const IP_RECVTOS = 13 +pkg syscall (linux-arm-cgo), const IP_RECVTTL = 12 +pkg syscall (linux-arm-cgo), const IP_RETOPTS = 7 +pkg syscall (linux-arm-cgo), const IP_RF = 32768 +pkg syscall (linux-arm-cgo), const IP_ROUTER_ALERT = 5 +pkg syscall (linux-arm-cgo), const IP_TOS = 1 +pkg syscall (linux-arm-cgo), const IP_TRANSPARENT = 19 +pkg syscall (linux-arm-cgo), const IP_TTL = 2 +pkg syscall (linux-arm-cgo), const IP_UNBLOCK_SOURCE = 37 +pkg syscall (linux-arm-cgo), const IP_XFRM_POLICY = 17 +pkg syscall (linux-arm-cgo), const ISIG = 1 +pkg syscall (linux-arm-cgo), const ISTRIP = 32 +pkg syscall (linux-arm-cgo), const IUCLC = 512 +pkg syscall (linux-arm-cgo), const IUTF8 = 16384 +pkg syscall (linux-arm-cgo), const IXANY = 2048 +pkg syscall (linux-arm-cgo), const IXOFF = 4096 +pkg syscall (linux-arm-cgo), const IXON = 1024 +pkg syscall (linux-arm-cgo), const ImplementsGetwd = true +pkg syscall (linux-arm-cgo), const LINUX_REBOOT_CMD_CAD_OFF = 0 +pkg syscall (linux-arm-cgo), const LINUX_REBOOT_CMD_CAD_ON = 2309737967 +pkg syscall (linux-arm-cgo), const LINUX_REBOOT_CMD_HALT = 3454992675 +pkg syscall (linux-arm-cgo), const LINUX_REBOOT_CMD_KEXEC = 1163412803 +pkg syscall (linux-arm-cgo), const LINUX_REBOOT_CMD_POWER_OFF = 1126301404 +pkg syscall (linux-arm-cgo), const LINUX_REBOOT_CMD_RESTART = 19088743 +pkg syscall (linux-arm-cgo), const LINUX_REBOOT_CMD_RESTART2 = 2712847316 +pkg syscall (linux-arm-cgo), const LINUX_REBOOT_CMD_SW_SUSPEND = 3489725666 +pkg syscall (linux-arm-cgo), const LINUX_REBOOT_MAGIC1 = 4276215469 +pkg syscall (linux-arm-cgo), const LINUX_REBOOT_MAGIC2 = 672274793 +pkg syscall (linux-arm-cgo), const LOCK_EX = 2 +pkg syscall (linux-arm-cgo), const LOCK_NB = 4 +pkg syscall (linux-arm-cgo), const LOCK_SH = 1 +pkg syscall (linux-arm-cgo), const LOCK_UN = 8 +pkg syscall (linux-arm-cgo), const MADV_DOFORK = 11 +pkg syscall (linux-arm-cgo), const MADV_DONTFORK = 10 +pkg syscall (linux-arm-cgo), const MADV_DONTNEED = 4 +pkg syscall (linux-arm-cgo), const MADV_HUGEPAGE = 14 +pkg syscall (linux-arm-cgo), const MADV_HWPOISON = 100 +pkg syscall (linux-arm-cgo), const MADV_MERGEABLE = 12 +pkg syscall (linux-arm-cgo), const MADV_NOHUGEPAGE = 15 +pkg syscall (linux-arm-cgo), const MADV_NORMAL = 0 +pkg syscall (linux-arm-cgo), const MADV_RANDOM = 1 +pkg syscall (linux-arm-cgo), const MADV_REMOVE = 9 +pkg syscall (linux-arm-cgo), const MADV_SEQUENTIAL = 2 +pkg syscall (linux-arm-cgo), const MADV_UNMERGEABLE = 13 +pkg syscall (linux-arm-cgo), const MADV_WILLNEED = 3 +pkg syscall (linux-arm-cgo), const MAP_ANON = 32 +pkg syscall (linux-arm-cgo), const MAP_ANONYMOUS = 32 +pkg syscall (linux-arm-cgo), const MAP_DENYWRITE = 2048 +pkg syscall (linux-arm-cgo), const MAP_EXECUTABLE = 4096 +pkg syscall (linux-arm-cgo), const MAP_FILE = 0 +pkg syscall (linux-arm-cgo), const MAP_FIXED = 16 +pkg syscall (linux-arm-cgo), const MAP_GROWSDOWN = 256 +pkg syscall (linux-arm-cgo), const MAP_LOCKED = 8192 +pkg syscall (linux-arm-cgo), const MAP_NONBLOCK = 65536 +pkg syscall (linux-arm-cgo), const MAP_NORESERVE = 16384 +pkg syscall (linux-arm-cgo), const MAP_POPULATE = 32768 +pkg syscall (linux-arm-cgo), const MAP_PRIVATE = 2 +pkg syscall (linux-arm-cgo), const MAP_SHARED = 1 +pkg syscall (linux-arm-cgo), const MAP_TYPE = 15 +pkg syscall (linux-arm-cgo), const MCL_CURRENT = 1 +pkg syscall (linux-arm-cgo), const MCL_FUTURE = 2 +pkg syscall (linux-arm-cgo), const MNT_DETACH = 2 +pkg syscall (linux-arm-cgo), const MNT_EXPIRE = 4 +pkg syscall (linux-arm-cgo), const MNT_FORCE = 1 +pkg syscall (linux-arm-cgo), const MSG_CMSG_CLOEXEC = 1073741824 +pkg syscall (linux-arm-cgo), const MSG_CONFIRM = 2048 +pkg syscall (linux-arm-cgo), const MSG_CTRUNC = 8 +pkg syscall (linux-arm-cgo), const MSG_DONTROUTE = 4 +pkg syscall (linux-arm-cgo), const MSG_DONTWAIT = 64 +pkg syscall (linux-arm-cgo), const MSG_EOR = 128 +pkg syscall (linux-arm-cgo), const MSG_ERRQUEUE = 8192 +pkg syscall (linux-arm-cgo), const MSG_FASTOPEN = 536870912 +pkg syscall (linux-arm-cgo), const MSG_FIN = 512 +pkg syscall (linux-arm-cgo), const MSG_MORE = 32768 +pkg syscall (linux-arm-cgo), const MSG_NOSIGNAL = 16384 +pkg syscall (linux-arm-cgo), const MSG_OOB = 1 +pkg syscall (linux-arm-cgo), const MSG_PEEK = 2 +pkg syscall (linux-arm-cgo), const MSG_PROXY = 16 +pkg syscall (linux-arm-cgo), const MSG_RST = 4096 +pkg syscall (linux-arm-cgo), const MSG_SYN = 1024 +pkg syscall (linux-arm-cgo), const MSG_TRUNC = 32 +pkg syscall (linux-arm-cgo), const MSG_TRYHARD = 4 +pkg syscall (linux-arm-cgo), const MSG_WAITALL = 256 +pkg syscall (linux-arm-cgo), const MSG_WAITFORONE = 65536 +pkg syscall (linux-arm-cgo), const MS_ACTIVE = 1073741824 +pkg syscall (linux-arm-cgo), const MS_ASYNC = 1 +pkg syscall (linux-arm-cgo), const MS_BIND = 4096 +pkg syscall (linux-arm-cgo), const MS_DIRSYNC = 128 +pkg syscall (linux-arm-cgo), const MS_INVALIDATE = 2 +pkg syscall (linux-arm-cgo), const MS_I_VERSION = 8388608 +pkg syscall (linux-arm-cgo), const MS_KERNMOUNT = 4194304 +pkg syscall (linux-arm-cgo), const MS_MANDLOCK = 64 +pkg syscall (linux-arm-cgo), const MS_MGC_MSK = 4294901760 +pkg syscall (linux-arm-cgo), const MS_MGC_VAL = 3236757504 +pkg syscall (linux-arm-cgo), const MS_MOVE = 8192 +pkg syscall (linux-arm-cgo), const MS_NOATIME = 1024 +pkg syscall (linux-arm-cgo), const MS_NODEV = 4 +pkg syscall (linux-arm-cgo), const MS_NODIRATIME = 2048 +pkg syscall (linux-arm-cgo), const MS_NOEXEC = 8 +pkg syscall (linux-arm-cgo), const MS_NOSUID = 2 +pkg syscall (linux-arm-cgo), const MS_NOUSER = -2147483648 +pkg syscall (linux-arm-cgo), const MS_POSIXACL = 65536 +pkg syscall (linux-arm-cgo), const MS_PRIVATE = 262144 +pkg syscall (linux-arm-cgo), const MS_RDONLY = 1 +pkg syscall (linux-arm-cgo), const MS_REC = 16384 +pkg syscall (linux-arm-cgo), const MS_RELATIME = 2097152 +pkg syscall (linux-arm-cgo), const MS_REMOUNT = 32 +pkg syscall (linux-arm-cgo), const MS_RMT_MASK = 8388689 +pkg syscall (linux-arm-cgo), const MS_SHARED = 1048576 +pkg syscall (linux-arm-cgo), const MS_SILENT = 32768 +pkg syscall (linux-arm-cgo), const MS_SLAVE = 524288 +pkg syscall (linux-arm-cgo), const MS_STRICTATIME = 16777216 +pkg syscall (linux-arm-cgo), const MS_SYNC = 4 +pkg syscall (linux-arm-cgo), const MS_SYNCHRONOUS = 16 +pkg syscall (linux-arm-cgo), const MS_UNBINDABLE = 131072 +pkg syscall (linux-arm-cgo), const NAME_MAX = 255 +pkg syscall (linux-arm-cgo), const NETLINK_ADD_MEMBERSHIP = 1 +pkg syscall (linux-arm-cgo), const NETLINK_AUDIT = 9 +pkg syscall (linux-arm-cgo), const NETLINK_BROADCAST_ERROR = 4 +pkg syscall (linux-arm-cgo), const NETLINK_CONNECTOR = 11 +pkg syscall (linux-arm-cgo), const NETLINK_DNRTMSG = 14 +pkg syscall (linux-arm-cgo), const NETLINK_DROP_MEMBERSHIP = 2 +pkg syscall (linux-arm-cgo), const NETLINK_ECRYPTFS = 19 +pkg syscall (linux-arm-cgo), const NETLINK_FIB_LOOKUP = 10 +pkg syscall (linux-arm-cgo), const NETLINK_FIREWALL = 3 +pkg syscall (linux-arm-cgo), const NETLINK_GENERIC = 16 +pkg syscall (linux-arm-cgo), const NETLINK_INET_DIAG = 4 +pkg syscall (linux-arm-cgo), const NETLINK_IP6_FW = 13 +pkg syscall (linux-arm-cgo), const NETLINK_ISCSI = 8 +pkg syscall (linux-arm-cgo), const NETLINK_KOBJECT_UEVENT = 15 +pkg syscall (linux-arm-cgo), const NETLINK_NETFILTER = 12 +pkg syscall (linux-arm-cgo), const NETLINK_NFLOG = 5 +pkg syscall (linux-arm-cgo), const NETLINK_NO_ENOBUFS = 5 +pkg syscall (linux-arm-cgo), const NETLINK_PKTINFO = 3 +pkg syscall (linux-arm-cgo), const NETLINK_RDMA = 20 +pkg syscall (linux-arm-cgo), const NETLINK_ROUTE = 0 +pkg syscall (linux-arm-cgo), const NETLINK_SCSITRANSPORT = 18 +pkg syscall (linux-arm-cgo), const NETLINK_SELINUX = 7 +pkg syscall (linux-arm-cgo), const NETLINK_UNUSED = 1 +pkg syscall (linux-arm-cgo), const NETLINK_USERSOCK = 2 +pkg syscall (linux-arm-cgo), const NETLINK_XFRM = 6 +pkg syscall (linux-arm-cgo), const NLA_ALIGNTO = 4 +pkg syscall (linux-arm-cgo), const NLA_F_NESTED = 32768 +pkg syscall (linux-arm-cgo), const NLA_F_NET_BYTEORDER = 16384 +pkg syscall (linux-arm-cgo), const NLA_HDRLEN = 4 +pkg syscall (linux-arm-cgo), const NLMSG_ALIGNTO = 4 +pkg syscall (linux-arm-cgo), const NLMSG_DONE = 3 +pkg syscall (linux-arm-cgo), const NLMSG_ERROR = 2 +pkg syscall (linux-arm-cgo), const NLMSG_HDRLEN = 16 +pkg syscall (linux-arm-cgo), const NLMSG_MIN_TYPE = 16 +pkg syscall (linux-arm-cgo), const NLMSG_NOOP = 1 +pkg syscall (linux-arm-cgo), const NLMSG_OVERRUN = 4 +pkg syscall (linux-arm-cgo), const NLM_F_ACK = 4 +pkg syscall (linux-arm-cgo), const NLM_F_APPEND = 2048 +pkg syscall (linux-arm-cgo), const NLM_F_ATOMIC = 1024 +pkg syscall (linux-arm-cgo), const NLM_F_CREATE = 1024 +pkg syscall (linux-arm-cgo), const NLM_F_DUMP = 768 +pkg syscall (linux-arm-cgo), const NLM_F_ECHO = 8 +pkg syscall (linux-arm-cgo), const NLM_F_EXCL = 512 +pkg syscall (linux-arm-cgo), const NLM_F_MATCH = 512 +pkg syscall (linux-arm-cgo), const NLM_F_MULTI = 2 +pkg syscall (linux-arm-cgo), const NLM_F_REPLACE = 256 +pkg syscall (linux-arm-cgo), const NLM_F_REQUEST = 1 +pkg syscall (linux-arm-cgo), const NLM_F_ROOT = 256 +pkg syscall (linux-arm-cgo), const NOFLSH = 128 +pkg syscall (linux-arm-cgo), const OCRNL = 8 +pkg syscall (linux-arm-cgo), const OFDEL = 128 +pkg syscall (linux-arm-cgo), const OFILL = 64 +pkg syscall (linux-arm-cgo), const OLCUC = 2 +pkg syscall (linux-arm-cgo), const ONLCR = 4 +pkg syscall (linux-arm-cgo), const ONLRET = 32 +pkg syscall (linux-arm-cgo), const ONOCR = 16 +pkg syscall (linux-arm-cgo), const OPOST = 1 +pkg syscall (linux-arm-cgo), const O_ACCMODE = 3 +pkg syscall (linux-arm-cgo), const O_APPEND = 1024 +pkg syscall (linux-arm-cgo), const O_ASYNC = 8192 +pkg syscall (linux-arm-cgo), const O_CLOEXEC = 524288 +pkg syscall (linux-arm-cgo), const O_CREAT = 64 +pkg syscall (linux-arm-cgo), const O_DIRECT = 65536 +pkg syscall (linux-arm-cgo), const O_DIRECTORY = 16384 +pkg syscall (linux-arm-cgo), const O_DSYNC = 4096 +pkg syscall (linux-arm-cgo), const O_EXCL = 128 +pkg syscall (linux-arm-cgo), const O_FSYNC = 4096 +pkg syscall (linux-arm-cgo), const O_LARGEFILE = 131072 +pkg syscall (linux-arm-cgo), const O_NDELAY = 2048 +pkg syscall (linux-arm-cgo), const O_NOATIME = 262144 +pkg syscall (linux-arm-cgo), const O_NOCTTY = 256 +pkg syscall (linux-arm-cgo), const O_NOFOLLOW = 32768 +pkg syscall (linux-arm-cgo), const O_NONBLOCK = 2048 +pkg syscall (linux-arm-cgo), const O_RSYNC = 4096 +pkg syscall (linux-arm-cgo), const O_SYNC = 4096 +pkg syscall (linux-arm-cgo), const O_TRUNC = 512 +pkg syscall (linux-arm-cgo), const PACKET_ADD_MEMBERSHIP = 1 +pkg syscall (linux-arm-cgo), const PACKET_BROADCAST = 1 +pkg syscall (linux-arm-cgo), const PACKET_DROP_MEMBERSHIP = 2 +pkg syscall (linux-arm-cgo), const PACKET_FASTROUTE = 6 +pkg syscall (linux-arm-cgo), const PACKET_HOST = 0 +pkg syscall (linux-arm-cgo), const PACKET_LOOPBACK = 5 +pkg syscall (linux-arm-cgo), const PACKET_MR_ALLMULTI = 2 +pkg syscall (linux-arm-cgo), const PACKET_MR_MULTICAST = 0 +pkg syscall (linux-arm-cgo), const PACKET_MR_PROMISC = 1 +pkg syscall (linux-arm-cgo), const PACKET_MULTICAST = 2 +pkg syscall (linux-arm-cgo), const PACKET_OTHERHOST = 3 +pkg syscall (linux-arm-cgo), const PACKET_OUTGOING = 4 +pkg syscall (linux-arm-cgo), const PACKET_RECV_OUTPUT = 3 +pkg syscall (linux-arm-cgo), const PACKET_RX_RING = 5 +pkg syscall (linux-arm-cgo), const PACKET_STATISTICS = 6 +pkg syscall (linux-arm-cgo), const PARENB = 256 +pkg syscall (linux-arm-cgo), const PARMRK = 8 +pkg syscall (linux-arm-cgo), const PARODD = 512 +pkg syscall (linux-arm-cgo), const PENDIN = 16384 +pkg syscall (linux-arm-cgo), const PROT_EXEC = 4 +pkg syscall (linux-arm-cgo), const PROT_GROWSDOWN = 16777216 +pkg syscall (linux-arm-cgo), const PROT_GROWSUP = 33554432 +pkg syscall (linux-arm-cgo), const PROT_NONE = 0 +pkg syscall (linux-arm-cgo), const PROT_READ = 1 +pkg syscall (linux-arm-cgo), const PROT_WRITE = 2 +pkg syscall (linux-arm-cgo), const PR_CAPBSET_DROP = 24 +pkg syscall (linux-arm-cgo), const PR_CAPBSET_READ = 23 +pkg syscall (linux-arm-cgo), const PR_CLEAR_SECCOMP_FILTER = 37 +pkg syscall (linux-arm-cgo), const PR_ENDIAN_BIG = 0 +pkg syscall (linux-arm-cgo), const PR_ENDIAN_LITTLE = 1 +pkg syscall (linux-arm-cgo), const PR_ENDIAN_PPC_LITTLE = 2 +pkg syscall (linux-arm-cgo), const PR_FPEMU_NOPRINT = 1 +pkg syscall (linux-arm-cgo), const PR_FPEMU_SIGFPE = 2 +pkg syscall (linux-arm-cgo), const PR_FP_EXC_ASYNC = 2 +pkg syscall (linux-arm-cgo), const PR_FP_EXC_DISABLED = 0 +pkg syscall (linux-arm-cgo), const PR_FP_EXC_DIV = 65536 +pkg syscall (linux-arm-cgo), const PR_FP_EXC_INV = 1048576 +pkg syscall (linux-arm-cgo), const PR_FP_EXC_NONRECOV = 1 +pkg syscall (linux-arm-cgo), const PR_FP_EXC_OVF = 131072 +pkg syscall (linux-arm-cgo), const PR_FP_EXC_PRECISE = 3 +pkg syscall (linux-arm-cgo), const PR_FP_EXC_RES = 524288 +pkg syscall (linux-arm-cgo), const PR_FP_EXC_SW_ENABLE = 128 +pkg syscall (linux-arm-cgo), const PR_FP_EXC_UND = 262144 +pkg syscall (linux-arm-cgo), const PR_GET_DUMPABLE = 3 +pkg syscall (linux-arm-cgo), const PR_GET_ENDIAN = 19 +pkg syscall (linux-arm-cgo), const PR_GET_FPEMU = 9 +pkg syscall (linux-arm-cgo), const PR_GET_FPEXC = 11 +pkg syscall (linux-arm-cgo), const PR_GET_KEEPCAPS = 7 +pkg syscall (linux-arm-cgo), const PR_GET_NAME = 16 +pkg syscall (linux-arm-cgo), const PR_GET_PDEATHSIG = 2 +pkg syscall (linux-arm-cgo), const PR_GET_SECCOMP = 21 +pkg syscall (linux-arm-cgo), const PR_GET_SECCOMP_FILTER = 35 +pkg syscall (linux-arm-cgo), const PR_GET_SECUREBITS = 27 +pkg syscall (linux-arm-cgo), const PR_GET_TIMERSLACK = 30 +pkg syscall (linux-arm-cgo), const PR_GET_TIMING = 13 +pkg syscall (linux-arm-cgo), const PR_GET_TSC = 25 +pkg syscall (linux-arm-cgo), const PR_GET_UNALIGN = 5 +pkg syscall (linux-arm-cgo), const PR_MCE_KILL = 33 +pkg syscall (linux-arm-cgo), const PR_MCE_KILL_CLEAR = 0 +pkg syscall (linux-arm-cgo), const PR_MCE_KILL_DEFAULT = 2 +pkg syscall (linux-arm-cgo), const PR_MCE_KILL_EARLY = 1 +pkg syscall (linux-arm-cgo), const PR_MCE_KILL_GET = 34 +pkg syscall (linux-arm-cgo), const PR_MCE_KILL_LATE = 0 +pkg syscall (linux-arm-cgo), const PR_MCE_KILL_SET = 1 +pkg syscall (linux-arm-cgo), const PR_SECCOMP_FILTER_EVENT = 1 +pkg syscall (linux-arm-cgo), const PR_SECCOMP_FILTER_SYSCALL = 0 +pkg syscall (linux-arm-cgo), const PR_SET_DUMPABLE = 4 +pkg syscall (linux-arm-cgo), const PR_SET_ENDIAN = 20 +pkg syscall (linux-arm-cgo), const PR_SET_FPEMU = 10 +pkg syscall (linux-arm-cgo), const PR_SET_FPEXC = 12 +pkg syscall (linux-arm-cgo), const PR_SET_KEEPCAPS = 8 +pkg syscall (linux-arm-cgo), const PR_SET_NAME = 15 +pkg syscall (linux-arm-cgo), const PR_SET_PDEATHSIG = 1 +pkg syscall (linux-arm-cgo), const PR_SET_PTRACER = 1499557217 +pkg syscall (linux-arm-cgo), const PR_SET_SECCOMP = 22 +pkg syscall (linux-arm-cgo), const PR_SET_SECCOMP_FILTER = 36 +pkg syscall (linux-arm-cgo), const PR_SET_SECUREBITS = 28 +pkg syscall (linux-arm-cgo), const PR_SET_TIMERSLACK = 29 +pkg syscall (linux-arm-cgo), const PR_SET_TIMING = 14 +pkg syscall (linux-arm-cgo), const PR_SET_TSC = 26 +pkg syscall (linux-arm-cgo), const PR_SET_UNALIGN = 6 +pkg syscall (linux-arm-cgo), const PR_TASK_PERF_EVENTS_DISABLE = 31 +pkg syscall (linux-arm-cgo), const PR_TASK_PERF_EVENTS_ENABLE = 32 +pkg syscall (linux-arm-cgo), const PR_TIMING_STATISTICAL = 0 +pkg syscall (linux-arm-cgo), const PR_TIMING_TIMESTAMP = 1 +pkg syscall (linux-arm-cgo), const PR_TSC_ENABLE = 1 +pkg syscall (linux-arm-cgo), const PR_TSC_SIGSEGV = 2 +pkg syscall (linux-arm-cgo), const PR_UNALIGN_NOPRINT = 1 +pkg syscall (linux-arm-cgo), const PR_UNALIGN_SIGBUS = 2 +pkg syscall (linux-arm-cgo), const PTRACE_ATTACH = 16 +pkg syscall (linux-arm-cgo), const PTRACE_CONT = 7 +pkg syscall (linux-arm-cgo), const PTRACE_DETACH = 17 +pkg syscall (linux-arm-cgo), const PTRACE_EVENT_CLONE = 3 +pkg syscall (linux-arm-cgo), const PTRACE_EVENT_EXEC = 4 +pkg syscall (linux-arm-cgo), const PTRACE_EVENT_EXIT = 6 +pkg syscall (linux-arm-cgo), const PTRACE_EVENT_FORK = 1 +pkg syscall (linux-arm-cgo), const PTRACE_EVENT_VFORK = 2 +pkg syscall (linux-arm-cgo), const PTRACE_EVENT_VFORK_DONE = 5 +pkg syscall (linux-arm-cgo), const PTRACE_GETCRUNCHREGS = 25 +pkg syscall (linux-arm-cgo), const PTRACE_GETEVENTMSG = 16897 +pkg syscall (linux-arm-cgo), const PTRACE_GETFPREGS = 14 +pkg syscall (linux-arm-cgo), const PTRACE_GETHBPREGS = 29 +pkg syscall (linux-arm-cgo), const PTRACE_GETREGS = 12 +pkg syscall (linux-arm-cgo), const PTRACE_GETREGSET = 16900 +pkg syscall (linux-arm-cgo), const PTRACE_GETSIGINFO = 16898 +pkg syscall (linux-arm-cgo), const PTRACE_GETVFPREGS = 27 +pkg syscall (linux-arm-cgo), const PTRACE_GETWMMXREGS = 18 +pkg syscall (linux-arm-cgo), const PTRACE_GET_THREAD_AREA = 22 +pkg syscall (linux-arm-cgo), const PTRACE_KILL = 8 +pkg syscall (linux-arm-cgo), const PTRACE_OLDSETOPTIONS = 21 +pkg syscall (linux-arm-cgo), const PTRACE_O_MASK = 127 +pkg syscall (linux-arm-cgo), const PTRACE_O_TRACECLONE = 8 +pkg syscall (linux-arm-cgo), const PTRACE_O_TRACEEXEC = 16 +pkg syscall (linux-arm-cgo), const PTRACE_O_TRACEEXIT = 64 +pkg syscall (linux-arm-cgo), const PTRACE_O_TRACEFORK = 2 +pkg syscall (linux-arm-cgo), const PTRACE_O_TRACESYSGOOD = 1 +pkg syscall (linux-arm-cgo), const PTRACE_O_TRACEVFORK = 4 +pkg syscall (linux-arm-cgo), const PTRACE_O_TRACEVFORKDONE = 32 +pkg syscall (linux-arm-cgo), const PTRACE_PEEKDATA = 2 +pkg syscall (linux-arm-cgo), const PTRACE_PEEKTEXT = 1 +pkg syscall (linux-arm-cgo), const PTRACE_PEEKUSR = 3 +pkg syscall (linux-arm-cgo), const PTRACE_POKEDATA = 5 +pkg syscall (linux-arm-cgo), const PTRACE_POKETEXT = 4 +pkg syscall (linux-arm-cgo), const PTRACE_POKEUSR = 6 +pkg syscall (linux-arm-cgo), const PTRACE_SETCRUNCHREGS = 26 +pkg syscall (linux-arm-cgo), const PTRACE_SETFPREGS = 15 +pkg syscall (linux-arm-cgo), const PTRACE_SETHBPREGS = 30 +pkg syscall (linux-arm-cgo), const PTRACE_SETOPTIONS = 16896 +pkg syscall (linux-arm-cgo), const PTRACE_SETREGS = 13 +pkg syscall (linux-arm-cgo), const PTRACE_SETREGSET = 16901 +pkg syscall (linux-arm-cgo), const PTRACE_SETSIGINFO = 16899 +pkg syscall (linux-arm-cgo), const PTRACE_SETVFPREGS = 28 +pkg syscall (linux-arm-cgo), const PTRACE_SETWMMXREGS = 19 +pkg syscall (linux-arm-cgo), const PTRACE_SET_SYSCALL = 23 +pkg syscall (linux-arm-cgo), const PTRACE_SINGLESTEP = 9 +pkg syscall (linux-arm-cgo), const PTRACE_SYSCALL = 24 +pkg syscall (linux-arm-cgo), const PTRACE_TRACEME = 0 +pkg syscall (linux-arm-cgo), const PT_DATA_ADDR = 65540 +pkg syscall (linux-arm-cgo), const PT_TEXT_ADDR = 65536 +pkg syscall (linux-arm-cgo), const PT_TEXT_END_ADDR = 65544 +pkg syscall (linux-arm-cgo), const PathMax = 4096 +pkg syscall (linux-arm-cgo), const RLIMIT_AS = 9 +pkg syscall (linux-arm-cgo), const RLIMIT_CORE = 4 +pkg syscall (linux-arm-cgo), const RLIMIT_CPU = 0 +pkg syscall (linux-arm-cgo), const RLIMIT_DATA = 2 +pkg syscall (linux-arm-cgo), const RLIMIT_FSIZE = 1 +pkg syscall (linux-arm-cgo), const RLIMIT_NOFILE = 7 +pkg syscall (linux-arm-cgo), const RLIMIT_STACK = 3 +pkg syscall (linux-arm-cgo), const RLIM_INFINITY = -1 +pkg syscall (linux-arm-cgo), const RTAX_ADVMSS = 8 +pkg syscall (linux-arm-cgo), const RTAX_CWND = 7 +pkg syscall (linux-arm-cgo), const RTAX_FEATURES = 12 +pkg syscall (linux-arm-cgo), const RTAX_FEATURE_ALLFRAG = 8 +pkg syscall (linux-arm-cgo), const RTAX_FEATURE_ECN = 1 +pkg syscall (linux-arm-cgo), const RTAX_FEATURE_SACK = 2 +pkg syscall (linux-arm-cgo), const RTAX_FEATURE_TIMESTAMP = 4 +pkg syscall (linux-arm-cgo), const RTAX_HOPLIMIT = 10 +pkg syscall (linux-arm-cgo), const RTAX_INITCWND = 11 +pkg syscall (linux-arm-cgo), const RTAX_INITRWND = 14 +pkg syscall (linux-arm-cgo), const RTAX_LOCK = 1 +pkg syscall (linux-arm-cgo), const RTAX_MAX = 14 +pkg syscall (linux-arm-cgo), const RTAX_MTU = 2 +pkg syscall (linux-arm-cgo), const RTAX_REORDERING = 9 +pkg syscall (linux-arm-cgo), const RTAX_RTO_MIN = 13 +pkg syscall (linux-arm-cgo), const RTAX_RTT = 4 +pkg syscall (linux-arm-cgo), const RTAX_RTTVAR = 5 +pkg syscall (linux-arm-cgo), const RTAX_SSTHRESH = 6 +pkg syscall (linux-arm-cgo), const RTAX_UNSPEC = 0 +pkg syscall (linux-arm-cgo), const RTAX_WINDOW = 3 +pkg syscall (linux-arm-cgo), const RTA_ALIGNTO = 4 +pkg syscall (linux-arm-cgo), const RTA_CACHEINFO = 12 +pkg syscall (linux-arm-cgo), const RTA_DST = 1 +pkg syscall (linux-arm-cgo), const RTA_FLOW = 11 +pkg syscall (linux-arm-cgo), const RTA_GATEWAY = 5 +pkg syscall (linux-arm-cgo), const RTA_IIF = 3 +pkg syscall (linux-arm-cgo), const RTA_MAX = 16 +pkg syscall (linux-arm-cgo), const RTA_METRICS = 8 +pkg syscall (linux-arm-cgo), const RTA_MULTIPATH = 9 +pkg syscall (linux-arm-cgo), const RTA_OIF = 4 +pkg syscall (linux-arm-cgo), const RTA_PREFSRC = 7 +pkg syscall (linux-arm-cgo), const RTA_PRIORITY = 6 +pkg syscall (linux-arm-cgo), const RTA_SRC = 2 +pkg syscall (linux-arm-cgo), const RTA_TABLE = 15 +pkg syscall (linux-arm-cgo), const RTA_UNSPEC = 0 +pkg syscall (linux-arm-cgo), const RTCF_DIRECTSRC = 67108864 +pkg syscall (linux-arm-cgo), const RTCF_DOREDIRECT = 16777216 +pkg syscall (linux-arm-cgo), const RTCF_LOG = 33554432 +pkg syscall (linux-arm-cgo), const RTCF_MASQ = 4194304 +pkg syscall (linux-arm-cgo), const RTCF_NAT = 8388608 +pkg syscall (linux-arm-cgo), const RTCF_VALVE = 2097152 +pkg syscall (linux-arm-cgo), const RTF_ADDRCLASSMASK = 4160749568 +pkg syscall (linux-arm-cgo), const RTF_ADDRCONF = 262144 +pkg syscall (linux-arm-cgo), const RTF_ALLONLINK = 131072 +pkg syscall (linux-arm-cgo), const RTF_BROADCAST = 268435456 +pkg syscall (linux-arm-cgo), const RTF_CACHE = 16777216 +pkg syscall (linux-arm-cgo), const RTF_DEFAULT = 65536 +pkg syscall (linux-arm-cgo), const RTF_DYNAMIC = 16 +pkg syscall (linux-arm-cgo), const RTF_FLOW = 33554432 +pkg syscall (linux-arm-cgo), const RTF_GATEWAY = 2 +pkg syscall (linux-arm-cgo), const RTF_HOST = 4 +pkg syscall (linux-arm-cgo), const RTF_INTERFACE = 1073741824 +pkg syscall (linux-arm-cgo), const RTF_IRTT = 256 +pkg syscall (linux-arm-cgo), const RTF_LINKRT = 1048576 +pkg syscall (linux-arm-cgo), const RTF_LOCAL = 2147483648 +pkg syscall (linux-arm-cgo), const RTF_MODIFIED = 32 +pkg syscall (linux-arm-cgo), const RTF_MSS = 64 +pkg syscall (linux-arm-cgo), const RTF_MTU = 64 +pkg syscall (linux-arm-cgo), const RTF_MULTICAST = 536870912 +pkg syscall (linux-arm-cgo), const RTF_NAT = 134217728 +pkg syscall (linux-arm-cgo), const RTF_NOFORWARD = 4096 +pkg syscall (linux-arm-cgo), const RTF_NONEXTHOP = 2097152 +pkg syscall (linux-arm-cgo), const RTF_NOPMTUDISC = 16384 +pkg syscall (linux-arm-cgo), const RTF_POLICY = 67108864 +pkg syscall (linux-arm-cgo), const RTF_REINSTATE = 8 +pkg syscall (linux-arm-cgo), const RTF_REJECT = 512 +pkg syscall (linux-arm-cgo), const RTF_STATIC = 1024 +pkg syscall (linux-arm-cgo), const RTF_THROW = 8192 +pkg syscall (linux-arm-cgo), const RTF_UP = 1 +pkg syscall (linux-arm-cgo), const RTF_WINDOW = 128 +pkg syscall (linux-arm-cgo), const RTF_XRESOLVE = 2048 +pkg syscall (linux-arm-cgo), const RTM_BASE = 16 +pkg syscall (linux-arm-cgo), const RTM_DELACTION = 49 +pkg syscall (linux-arm-cgo), const RTM_DELADDR = 21 +pkg syscall (linux-arm-cgo), const RTM_DELADDRLABEL = 73 +pkg syscall (linux-arm-cgo), const RTM_DELLINK = 17 +pkg syscall (linux-arm-cgo), const RTM_DELNEIGH = 29 +pkg syscall (linux-arm-cgo), const RTM_DELQDISC = 37 +pkg syscall (linux-arm-cgo), const RTM_DELROUTE = 25 +pkg syscall (linux-arm-cgo), const RTM_DELRULE = 33 +pkg syscall (linux-arm-cgo), const RTM_DELTCLASS = 41 +pkg syscall (linux-arm-cgo), const RTM_DELTFILTER = 45 +pkg syscall (linux-arm-cgo), const RTM_F_CLONED = 512 +pkg syscall (linux-arm-cgo), const RTM_F_EQUALIZE = 1024 +pkg syscall (linux-arm-cgo), const RTM_F_NOTIFY = 256 +pkg syscall (linux-arm-cgo), const RTM_F_PREFIX = 2048 +pkg syscall (linux-arm-cgo), const RTM_GETACTION = 50 +pkg syscall (linux-arm-cgo), const RTM_GETADDR = 22 +pkg syscall (linux-arm-cgo), const RTM_GETADDRLABEL = 74 +pkg syscall (linux-arm-cgo), const RTM_GETANYCAST = 62 +pkg syscall (linux-arm-cgo), const RTM_GETDCB = 78 +pkg syscall (linux-arm-cgo), const RTM_GETLINK = 18 +pkg syscall (linux-arm-cgo), const RTM_GETMULTICAST = 58 +pkg syscall (linux-arm-cgo), const RTM_GETNEIGH = 30 +pkg syscall (linux-arm-cgo), const RTM_GETNEIGHTBL = 66 +pkg syscall (linux-arm-cgo), const RTM_GETQDISC = 38 +pkg syscall (linux-arm-cgo), const RTM_GETROUTE = 26 +pkg syscall (linux-arm-cgo), const RTM_GETRULE = 34 +pkg syscall (linux-arm-cgo), const RTM_GETTCLASS = 42 +pkg syscall (linux-arm-cgo), const RTM_GETTFILTER = 46 +pkg syscall (linux-arm-cgo), const RTM_MAX = 79 +pkg syscall (linux-arm-cgo), const RTM_NEWACTION = 48 +pkg syscall (linux-arm-cgo), const RTM_NEWADDR = 20 +pkg syscall (linux-arm-cgo), const RTM_NEWADDRLABEL = 72 +pkg syscall (linux-arm-cgo), const RTM_NEWLINK = 16 +pkg syscall (linux-arm-cgo), const RTM_NEWNDUSEROPT = 68 +pkg syscall (linux-arm-cgo), const RTM_NEWNEIGH = 28 +pkg syscall (linux-arm-cgo), const RTM_NEWNEIGHTBL = 64 +pkg syscall (linux-arm-cgo), const RTM_NEWPREFIX = 52 +pkg syscall (linux-arm-cgo), const RTM_NEWQDISC = 36 +pkg syscall (linux-arm-cgo), const RTM_NEWROUTE = 24 +pkg syscall (linux-arm-cgo), const RTM_NEWRULE = 32 +pkg syscall (linux-arm-cgo), const RTM_NEWTCLASS = 40 +pkg syscall (linux-arm-cgo), const RTM_NEWTFILTER = 44 +pkg syscall (linux-arm-cgo), const RTM_NR_FAMILIES = 16 +pkg syscall (linux-arm-cgo), const RTM_NR_MSGTYPES = 64 +pkg syscall (linux-arm-cgo), const RTM_SETDCB = 79 +pkg syscall (linux-arm-cgo), const RTM_SETLINK = 19 +pkg syscall (linux-arm-cgo), const RTM_SETNEIGHTBL = 67 +pkg syscall (linux-arm-cgo), const RTNH_ALIGNTO = 4 +pkg syscall (linux-arm-cgo), const RTNH_F_DEAD = 1 +pkg syscall (linux-arm-cgo), const RTNH_F_ONLINK = 4 +pkg syscall (linux-arm-cgo), const RTNH_F_PERVASIVE = 2 +pkg syscall (linux-arm-cgo), const RTNLGRP_IPV4_IFADDR = 5 +pkg syscall (linux-arm-cgo), const RTNLGRP_IPV4_MROUTE = 6 +pkg syscall (linux-arm-cgo), const RTNLGRP_IPV4_ROUTE = 7 +pkg syscall (linux-arm-cgo), const RTNLGRP_IPV4_RULE = 8 +pkg syscall (linux-arm-cgo), const RTNLGRP_IPV6_IFADDR = 9 +pkg syscall (linux-arm-cgo), const RTNLGRP_IPV6_IFINFO = 12 +pkg syscall (linux-arm-cgo), const RTNLGRP_IPV6_MROUTE = 10 +pkg syscall (linux-arm-cgo), const RTNLGRP_IPV6_PREFIX = 18 +pkg syscall (linux-arm-cgo), const RTNLGRP_IPV6_ROUTE = 11 +pkg syscall (linux-arm-cgo), const RTNLGRP_IPV6_RULE = 19 +pkg syscall (linux-arm-cgo), const RTNLGRP_LINK = 1 +pkg syscall (linux-arm-cgo), const RTNLGRP_ND_USEROPT = 20 +pkg syscall (linux-arm-cgo), const RTNLGRP_NEIGH = 3 +pkg syscall (linux-arm-cgo), const RTNLGRP_NONE = 0 +pkg syscall (linux-arm-cgo), const RTNLGRP_NOTIFY = 2 +pkg syscall (linux-arm-cgo), const RTNLGRP_TC = 4 +pkg syscall (linux-arm-cgo), const RTN_ANYCAST = 4 +pkg syscall (linux-arm-cgo), const RTN_BLACKHOLE = 6 +pkg syscall (linux-arm-cgo), const RTN_BROADCAST = 3 +pkg syscall (linux-arm-cgo), const RTN_LOCAL = 2 +pkg syscall (linux-arm-cgo), const RTN_MAX = 11 +pkg syscall (linux-arm-cgo), const RTN_MULTICAST = 5 +pkg syscall (linux-arm-cgo), const RTN_NAT = 10 +pkg syscall (linux-arm-cgo), const RTN_PROHIBIT = 8 +pkg syscall (linux-arm-cgo), const RTN_THROW = 9 +pkg syscall (linux-arm-cgo), const RTN_UNICAST = 1 +pkg syscall (linux-arm-cgo), const RTN_UNREACHABLE = 7 +pkg syscall (linux-arm-cgo), const RTN_UNSPEC = 0 +pkg syscall (linux-arm-cgo), const RTN_XRESOLVE = 11 +pkg syscall (linux-arm-cgo), const RTPROT_BIRD = 12 +pkg syscall (linux-arm-cgo), const RTPROT_BOOT = 3 +pkg syscall (linux-arm-cgo), const RTPROT_DHCP = 16 +pkg syscall (linux-arm-cgo), const RTPROT_DNROUTED = 13 +pkg syscall (linux-arm-cgo), const RTPROT_GATED = 8 +pkg syscall (linux-arm-cgo), const RTPROT_KERNEL = 2 +pkg syscall (linux-arm-cgo), const RTPROT_MRT = 10 +pkg syscall (linux-arm-cgo), const RTPROT_NTK = 15 +pkg syscall (linux-arm-cgo), const RTPROT_RA = 9 +pkg syscall (linux-arm-cgo), const RTPROT_REDIRECT = 1 +pkg syscall (linux-arm-cgo), const RTPROT_STATIC = 4 +pkg syscall (linux-arm-cgo), const RTPROT_UNSPEC = 0 +pkg syscall (linux-arm-cgo), const RTPROT_XORP = 14 +pkg syscall (linux-arm-cgo), const RTPROT_ZEBRA = 11 +pkg syscall (linux-arm-cgo), const RT_CLASS_DEFAULT = 253 +pkg syscall (linux-arm-cgo), const RT_CLASS_LOCAL = 255 +pkg syscall (linux-arm-cgo), const RT_CLASS_MAIN = 254 +pkg syscall (linux-arm-cgo), const RT_CLASS_MAX = 255 +pkg syscall (linux-arm-cgo), const RT_CLASS_UNSPEC = 0 +pkg syscall (linux-arm-cgo), const RT_SCOPE_HOST = 254 +pkg syscall (linux-arm-cgo), const RT_SCOPE_LINK = 253 +pkg syscall (linux-arm-cgo), const RT_SCOPE_NOWHERE = 255 +pkg syscall (linux-arm-cgo), const RT_SCOPE_SITE = 200 +pkg syscall (linux-arm-cgo), const RT_SCOPE_UNIVERSE = 0 +pkg syscall (linux-arm-cgo), const RT_TABLE_COMPAT = 252 +pkg syscall (linux-arm-cgo), const RT_TABLE_DEFAULT = 253 +pkg syscall (linux-arm-cgo), const RT_TABLE_LOCAL = 255 +pkg syscall (linux-arm-cgo), const RT_TABLE_MAIN = 254 +pkg syscall (linux-arm-cgo), const RT_TABLE_MAX = 4294967295 +pkg syscall (linux-arm-cgo), const RT_TABLE_UNSPEC = 0 +pkg syscall (linux-arm-cgo), const RUSAGE_CHILDREN = -1 +pkg syscall (linux-arm-cgo), const RUSAGE_SELF = 0 +pkg syscall (linux-arm-cgo), const RUSAGE_THREAD = 1 +pkg syscall (linux-arm-cgo), const SCM_CREDENTIALS = 2 +pkg syscall (linux-arm-cgo), const SCM_RIGHTS = 1 +pkg syscall (linux-arm-cgo), const SCM_TIMESTAMP = 29 +pkg syscall (linux-arm-cgo), const SCM_TIMESTAMPING = 37 +pkg syscall (linux-arm-cgo), const SCM_TIMESTAMPNS = 35 +pkg syscall (linux-arm-cgo), const SIGBUS = 7 +pkg syscall (linux-arm-cgo), const SIGCHLD = 17 +pkg syscall (linux-arm-cgo), const SIGCLD = 17 +pkg syscall (linux-arm-cgo), const SIGCONT = 18 +pkg syscall (linux-arm-cgo), const SIGIO = 29 +pkg syscall (linux-arm-cgo), const SIGIOT = 6 +pkg syscall (linux-arm-cgo), const SIGPOLL = 29 +pkg syscall (linux-arm-cgo), const SIGPROF = 27 +pkg syscall (linux-arm-cgo), const SIGPWR = 30 +pkg syscall (linux-arm-cgo), const SIGSTKFLT = 16 +pkg syscall (linux-arm-cgo), const SIGSTOP = 19 +pkg syscall (linux-arm-cgo), const SIGSYS = 31 +pkg syscall (linux-arm-cgo), const SIGTSTP = 20 +pkg syscall (linux-arm-cgo), const SIGTTIN = 21 +pkg syscall (linux-arm-cgo), const SIGTTOU = 22 +pkg syscall (linux-arm-cgo), const SIGUNUSED = 31 +pkg syscall (linux-arm-cgo), const SIGURG = 23 +pkg syscall (linux-arm-cgo), const SIGUSR1 = 10 +pkg syscall (linux-arm-cgo), const SIGUSR2 = 12 +pkg syscall (linux-arm-cgo), const SIGVTALRM = 26 +pkg syscall (linux-arm-cgo), const SIGWINCH = 28 +pkg syscall (linux-arm-cgo), const SIGXCPU = 24 +pkg syscall (linux-arm-cgo), const SIGXFSZ = 25 +pkg syscall (linux-arm-cgo), const SIOCADDDLCI = 35200 +pkg syscall (linux-arm-cgo), const SIOCADDMULTI = 35121 +pkg syscall (linux-arm-cgo), const SIOCADDRT = 35083 +pkg syscall (linux-arm-cgo), const SIOCATMARK = 35077 +pkg syscall (linux-arm-cgo), const SIOCDARP = 35155 +pkg syscall (linux-arm-cgo), const SIOCDELDLCI = 35201 +pkg syscall (linux-arm-cgo), const SIOCDELMULTI = 35122 +pkg syscall (linux-arm-cgo), const SIOCDELRT = 35084 +pkg syscall (linux-arm-cgo), const SIOCDEVPRIVATE = 35312 +pkg syscall (linux-arm-cgo), const SIOCDIFADDR = 35126 +pkg syscall (linux-arm-cgo), const SIOCDRARP = 35168 +pkg syscall (linux-arm-cgo), const SIOCGARP = 35156 +pkg syscall (linux-arm-cgo), const SIOCGIFADDR = 35093 +pkg syscall (linux-arm-cgo), const SIOCGIFBR = 35136 +pkg syscall (linux-arm-cgo), const SIOCGIFBRDADDR = 35097 +pkg syscall (linux-arm-cgo), const SIOCGIFCONF = 35090 +pkg syscall (linux-arm-cgo), const SIOCGIFCOUNT = 35128 +pkg syscall (linux-arm-cgo), const SIOCGIFDSTADDR = 35095 +pkg syscall (linux-arm-cgo), const SIOCGIFENCAP = 35109 +pkg syscall (linux-arm-cgo), const SIOCGIFFLAGS = 35091 +pkg syscall (linux-arm-cgo), const SIOCGIFHWADDR = 35111 +pkg syscall (linux-arm-cgo), const SIOCGIFINDEX = 35123 +pkg syscall (linux-arm-cgo), const SIOCGIFMAP = 35184 +pkg syscall (linux-arm-cgo), const SIOCGIFMEM = 35103 +pkg syscall (linux-arm-cgo), const SIOCGIFMETRIC = 35101 +pkg syscall (linux-arm-cgo), const SIOCGIFMTU = 35105 +pkg syscall (linux-arm-cgo), const SIOCGIFNAME = 35088 +pkg syscall (linux-arm-cgo), const SIOCGIFNETMASK = 35099 +pkg syscall (linux-arm-cgo), const SIOCGIFPFLAGS = 35125 +pkg syscall (linux-arm-cgo), const SIOCGIFSLAVE = 35113 +pkg syscall (linux-arm-cgo), const SIOCGIFTXQLEN = 35138 +pkg syscall (linux-arm-cgo), const SIOCGPGRP = 35076 +pkg syscall (linux-arm-cgo), const SIOCGRARP = 35169 +pkg syscall (linux-arm-cgo), const SIOCGSTAMP = 35078 +pkg syscall (linux-arm-cgo), const SIOCGSTAMPNS = 35079 +pkg syscall (linux-arm-cgo), const SIOCPROTOPRIVATE = 35296 +pkg syscall (linux-arm-cgo), const SIOCRTMSG = 35085 +pkg syscall (linux-arm-cgo), const SIOCSARP = 35157 +pkg syscall (linux-arm-cgo), const SIOCSIFADDR = 35094 +pkg syscall (linux-arm-cgo), const SIOCSIFBR = 35137 +pkg syscall (linux-arm-cgo), const SIOCSIFBRDADDR = 35098 +pkg syscall (linux-arm-cgo), const SIOCSIFDSTADDR = 35096 +pkg syscall (linux-arm-cgo), const SIOCSIFENCAP = 35110 +pkg syscall (linux-arm-cgo), const SIOCSIFFLAGS = 35092 +pkg syscall (linux-arm-cgo), const SIOCSIFHWADDR = 35108 +pkg syscall (linux-arm-cgo), const SIOCSIFHWBROADCAST = 35127 +pkg syscall (linux-arm-cgo), const SIOCSIFLINK = 35089 +pkg syscall (linux-arm-cgo), const SIOCSIFMAP = 35185 +pkg syscall (linux-arm-cgo), const SIOCSIFMEM = 35104 +pkg syscall (linux-arm-cgo), const SIOCSIFMETRIC = 35102 +pkg syscall (linux-arm-cgo), const SIOCSIFMTU = 35106 +pkg syscall (linux-arm-cgo), const SIOCSIFNAME = 35107 +pkg syscall (linux-arm-cgo), const SIOCSIFNETMASK = 35100 +pkg syscall (linux-arm-cgo), const SIOCSIFPFLAGS = 35124 +pkg syscall (linux-arm-cgo), const SIOCSIFSLAVE = 35120 +pkg syscall (linux-arm-cgo), const SIOCSIFTXQLEN = 35139 +pkg syscall (linux-arm-cgo), const SIOCSPGRP = 35074 +pkg syscall (linux-arm-cgo), const SIOCSRARP = 35170 +pkg syscall (linux-arm-cgo), const SOCK_CLOEXEC = 524288 +pkg syscall (linux-arm-cgo), const SOCK_DCCP = 6 +pkg syscall (linux-arm-cgo), const SOCK_NONBLOCK = 2048 +pkg syscall (linux-arm-cgo), const SOCK_PACKET = 10 +pkg syscall (linux-arm-cgo), const SOCK_RDM = 4 +pkg syscall (linux-arm-cgo), const SOL_AAL = 265 +pkg syscall (linux-arm-cgo), const SOL_ATM = 264 +pkg syscall (linux-arm-cgo), const SOL_DECNET = 261 +pkg syscall (linux-arm-cgo), const SOL_ICMPV6 = 58 +pkg syscall (linux-arm-cgo), const SOL_IP = 0 +pkg syscall (linux-arm-cgo), const SOL_IPV6 = 41 +pkg syscall (linux-arm-cgo), const SOL_IRDA = 266 +pkg syscall (linux-arm-cgo), const SOL_PACKET = 263 +pkg syscall (linux-arm-cgo), const SOL_RAW = 255 +pkg syscall (linux-arm-cgo), const SOL_SOCKET = 1 +pkg syscall (linux-arm-cgo), const SOL_TCP = 6 +pkg syscall (linux-arm-cgo), const SOL_X25 = 262 +pkg syscall (linux-arm-cgo), const SOMAXCONN = 128 +pkg syscall (linux-arm-cgo), const SO_ACCEPTCONN = 30 +pkg syscall (linux-arm-cgo), const SO_ATTACH_FILTER = 26 +pkg syscall (linux-arm-cgo), const SO_BINDTODEVICE = 25 +pkg syscall (linux-arm-cgo), const SO_BROADCAST = 6 +pkg syscall (linux-arm-cgo), const SO_BSDCOMPAT = 14 +pkg syscall (linux-arm-cgo), const SO_DEBUG = 1 +pkg syscall (linux-arm-cgo), const SO_DETACH_FILTER = 27 +pkg syscall (linux-arm-cgo), const SO_DOMAIN = 39 +pkg syscall (linux-arm-cgo), const SO_DONTROUTE = 5 +pkg syscall (linux-arm-cgo), const SO_ERROR = 4 +pkg syscall (linux-arm-cgo), const SO_KEEPALIVE = 9 +pkg syscall (linux-arm-cgo), const SO_LINGER = 13 +pkg syscall (linux-arm-cgo), const SO_MARK = 36 +pkg syscall (linux-arm-cgo), const SO_NO_CHECK = 11 +pkg syscall (linux-arm-cgo), const SO_OOBINLINE = 10 +pkg syscall (linux-arm-cgo), const SO_PASSCRED = 16 +pkg syscall (linux-arm-cgo), const SO_PASSSEC = 34 +pkg syscall (linux-arm-cgo), const SO_PEERCRED = 17 +pkg syscall (linux-arm-cgo), const SO_PEERNAME = 28 +pkg syscall (linux-arm-cgo), const SO_PEERSEC = 31 +pkg syscall (linux-arm-cgo), const SO_PRIORITY = 12 +pkg syscall (linux-arm-cgo), const SO_PROTOCOL = 38 +pkg syscall (linux-arm-cgo), const SO_RCVBUF = 8 +pkg syscall (linux-arm-cgo), const SO_RCVBUFFORCE = 33 +pkg syscall (linux-arm-cgo), const SO_RCVLOWAT = 18 +pkg syscall (linux-arm-cgo), const SO_RCVTIMEO = 20 +pkg syscall (linux-arm-cgo), const SO_REUSEADDR = 2 +pkg syscall (linux-arm-cgo), const SO_RXQ_OVFL = 40 +pkg syscall (linux-arm-cgo), const SO_SECURITY_AUTHENTICATION = 22 +pkg syscall (linux-arm-cgo), const SO_SECURITY_ENCRYPTION_NETWORK = 24 +pkg syscall (linux-arm-cgo), const SO_SECURITY_ENCRYPTION_TRANSPORT = 23 +pkg syscall (linux-arm-cgo), const SO_SNDBUF = 7 +pkg syscall (linux-arm-cgo), const SO_SNDBUFFORCE = 32 +pkg syscall (linux-arm-cgo), const SO_SNDLOWAT = 19 +pkg syscall (linux-arm-cgo), const SO_SNDTIMEO = 21 +pkg syscall (linux-arm-cgo), const SO_TIMESTAMP = 29 +pkg syscall (linux-arm-cgo), const SO_TIMESTAMPING = 37 +pkg syscall (linux-arm-cgo), const SO_TIMESTAMPNS = 35 +pkg syscall (linux-arm-cgo), const SO_TYPE = 3 +pkg syscall (linux-arm-cgo), const SYS_ACCEPT = 285 +pkg syscall (linux-arm-cgo), const SYS_ACCEPT4 = 366 +pkg syscall (linux-arm-cgo), const SYS_ACCESS = 33 +pkg syscall (linux-arm-cgo), const SYS_ACCT = 51 +pkg syscall (linux-arm-cgo), const SYS_ADD_KEY = 309 +pkg syscall (linux-arm-cgo), const SYS_ADJTIMEX = 124 +pkg syscall (linux-arm-cgo), const SYS_ALARM = 27 +pkg syscall (linux-arm-cgo), const SYS_ARM_FADVISE64_64 = 270 +pkg syscall (linux-arm-cgo), const SYS_ARM_SYNC_FILE_RANGE = 341 +pkg syscall (linux-arm-cgo), const SYS_BDFLUSH = 134 +pkg syscall (linux-arm-cgo), const SYS_BIND = 282 +pkg syscall (linux-arm-cgo), const SYS_BRK = 45 +pkg syscall (linux-arm-cgo), const SYS_CAPGET = 184 +pkg syscall (linux-arm-cgo), const SYS_CAPSET = 185 +pkg syscall (linux-arm-cgo), const SYS_CHDIR = 12 +pkg syscall (linux-arm-cgo), const SYS_CHMOD = 15 +pkg syscall (linux-arm-cgo), const SYS_CHOWN = 182 +pkg syscall (linux-arm-cgo), const SYS_CHOWN32 = 212 +pkg syscall (linux-arm-cgo), const SYS_CHROOT = 61 +pkg syscall (linux-arm-cgo), const SYS_CLOCK_ADJTIME = 372 +pkg syscall (linux-arm-cgo), const SYS_CLOCK_GETRES = 264 +pkg syscall (linux-arm-cgo), const SYS_CLOCK_GETTIME = 263 +pkg syscall (linux-arm-cgo), const SYS_CLOCK_NANOSLEEP = 265 +pkg syscall (linux-arm-cgo), const SYS_CLOCK_SETTIME = 262 +pkg syscall (linux-arm-cgo), const SYS_CLONE = 120 +pkg syscall (linux-arm-cgo), const SYS_CLOSE = 6 +pkg syscall (linux-arm-cgo), const SYS_CONNECT = 283 +pkg syscall (linux-arm-cgo), const SYS_CREAT = 8 +pkg syscall (linux-arm-cgo), const SYS_DELETE_MODULE = 129 +pkg syscall (linux-arm-cgo), const SYS_DUP = 41 +pkg syscall (linux-arm-cgo), const SYS_DUP2 = 63 +pkg syscall (linux-arm-cgo), const SYS_DUP3 = 358 +pkg syscall (linux-arm-cgo), const SYS_EPOLL_CREATE = 250 +pkg syscall (linux-arm-cgo), const SYS_EPOLL_CREATE1 = 357 +pkg syscall (linux-arm-cgo), const SYS_EPOLL_CTL = 251 +pkg syscall (linux-arm-cgo), const SYS_EPOLL_PWAIT = 346 +pkg syscall (linux-arm-cgo), const SYS_EPOLL_WAIT = 252 +pkg syscall (linux-arm-cgo), const SYS_EVENTFD = 351 +pkg syscall (linux-arm-cgo), const SYS_EVENTFD2 = 356 +pkg syscall (linux-arm-cgo), const SYS_EXECVE = 11 +pkg syscall (linux-arm-cgo), const SYS_EXIT = 1 +pkg syscall (linux-arm-cgo), const SYS_EXIT_GROUP = 248 +pkg syscall (linux-arm-cgo), const SYS_FACCESSAT = 334 +pkg syscall (linux-arm-cgo), const SYS_FALLOCATE = 352 +pkg syscall (linux-arm-cgo), const SYS_FANOTIFY_INIT = 367 +pkg syscall (linux-arm-cgo), const SYS_FANOTIFY_MARK = 368 +pkg syscall (linux-arm-cgo), const SYS_FCHDIR = 133 +pkg syscall (linux-arm-cgo), const SYS_FCHMOD = 94 +pkg syscall (linux-arm-cgo), const SYS_FCHMODAT = 333 +pkg syscall (linux-arm-cgo), const SYS_FCHOWN = 95 +pkg syscall (linux-arm-cgo), const SYS_FCHOWN32 = 207 +pkg syscall (linux-arm-cgo), const SYS_FCHOWNAT = 325 +pkg syscall (linux-arm-cgo), const SYS_FCNTL = 55 +pkg syscall (linux-arm-cgo), const SYS_FCNTL64 = 221 +pkg syscall (linux-arm-cgo), const SYS_FDATASYNC = 148 +pkg syscall (linux-arm-cgo), const SYS_FGETXATTR = 231 +pkg syscall (linux-arm-cgo), const SYS_FLISTXATTR = 234 +pkg syscall (linux-arm-cgo), const SYS_FLOCK = 143 +pkg syscall (linux-arm-cgo), const SYS_FORK = 2 +pkg syscall (linux-arm-cgo), const SYS_FREMOVEXATTR = 237 +pkg syscall (linux-arm-cgo), const SYS_FSETXATTR = 228 +pkg syscall (linux-arm-cgo), const SYS_FSTAT = 108 +pkg syscall (linux-arm-cgo), const SYS_FSTAT64 = 197 +pkg syscall (linux-arm-cgo), const SYS_FSTATAT64 = 327 +pkg syscall (linux-arm-cgo), const SYS_FSTATFS = 100 +pkg syscall (linux-arm-cgo), const SYS_FSTATFS64 = 267 +pkg syscall (linux-arm-cgo), const SYS_FSYNC = 118 +pkg syscall (linux-arm-cgo), const SYS_FTRUNCATE = 93 +pkg syscall (linux-arm-cgo), const SYS_FTRUNCATE64 = 194 +pkg syscall (linux-arm-cgo), const SYS_FUTEX = 240 +pkg syscall (linux-arm-cgo), const SYS_FUTIMESAT = 326 +pkg syscall (linux-arm-cgo), const SYS_GETCPU = 345 +pkg syscall (linux-arm-cgo), const SYS_GETCWD = 183 +pkg syscall (linux-arm-cgo), const SYS_GETDENTS = 141 +pkg syscall (linux-arm-cgo), const SYS_GETDENTS64 = 217 +pkg syscall (linux-arm-cgo), const SYS_GETEGID = 50 +pkg syscall (linux-arm-cgo), const SYS_GETEGID32 = 202 +pkg syscall (linux-arm-cgo), const SYS_GETEUID = 49 +pkg syscall (linux-arm-cgo), const SYS_GETEUID32 = 201 +pkg syscall (linux-arm-cgo), const SYS_GETGID = 47 +pkg syscall (linux-arm-cgo), const SYS_GETGID32 = 200 +pkg syscall (linux-arm-cgo), const SYS_GETGROUPS = 80 +pkg syscall (linux-arm-cgo), const SYS_GETGROUPS32 = 205 +pkg syscall (linux-arm-cgo), const SYS_GETITIMER = 105 +pkg syscall (linux-arm-cgo), const SYS_GETPEERNAME = 287 +pkg syscall (linux-arm-cgo), const SYS_GETPGID = 132 +pkg syscall (linux-arm-cgo), const SYS_GETPGRP = 65 +pkg syscall (linux-arm-cgo), const SYS_GETPID = 20 +pkg syscall (linux-arm-cgo), const SYS_GETPPID = 64 +pkg syscall (linux-arm-cgo), const SYS_GETPRIORITY = 96 +pkg syscall (linux-arm-cgo), const SYS_GETRESGID = 171 +pkg syscall (linux-arm-cgo), const SYS_GETRESGID32 = 211 +pkg syscall (linux-arm-cgo), const SYS_GETRESUID = 165 +pkg syscall (linux-arm-cgo), const SYS_GETRESUID32 = 209 +pkg syscall (linux-arm-cgo), const SYS_GETRLIMIT = 76 +pkg syscall (linux-arm-cgo), const SYS_GETRUSAGE = 77 +pkg syscall (linux-arm-cgo), const SYS_GETSID = 147 +pkg syscall (linux-arm-cgo), const SYS_GETSOCKNAME = 286 +pkg syscall (linux-arm-cgo), const SYS_GETSOCKOPT = 295 +pkg syscall (linux-arm-cgo), const SYS_GETTID = 224 +pkg syscall (linux-arm-cgo), const SYS_GETTIMEOFDAY = 78 +pkg syscall (linux-arm-cgo), const SYS_GETUID = 24 +pkg syscall (linux-arm-cgo), const SYS_GETUID32 = 199 +pkg syscall (linux-arm-cgo), const SYS_GETXATTR = 229 +pkg syscall (linux-arm-cgo), const SYS_GET_MEMPOLICY = 320 +pkg syscall (linux-arm-cgo), const SYS_GET_ROBUST_LIST = 339 +pkg syscall (linux-arm-cgo), const SYS_INIT_MODULE = 128 +pkg syscall (linux-arm-cgo), const SYS_INOTIFY_ADD_WATCH = 317 +pkg syscall (linux-arm-cgo), const SYS_INOTIFY_INIT = 316 +pkg syscall (linux-arm-cgo), const SYS_INOTIFY_INIT1 = 360 +pkg syscall (linux-arm-cgo), const SYS_INOTIFY_RM_WATCH = 318 +pkg syscall (linux-arm-cgo), const SYS_IOCTL = 54 +pkg syscall (linux-arm-cgo), const SYS_IOPRIO_GET = 315 +pkg syscall (linux-arm-cgo), const SYS_IOPRIO_SET = 314 +pkg syscall (linux-arm-cgo), const SYS_IO_CANCEL = 247 +pkg syscall (linux-arm-cgo), const SYS_IO_DESTROY = 244 +pkg syscall (linux-arm-cgo), const SYS_IO_GETEVENTS = 245 +pkg syscall (linux-arm-cgo), const SYS_IO_SETUP = 243 +pkg syscall (linux-arm-cgo), const SYS_IO_SUBMIT = 246 +pkg syscall (linux-arm-cgo), const SYS_IPC = 117 +pkg syscall (linux-arm-cgo), const SYS_KEXEC_LOAD = 347 +pkg syscall (linux-arm-cgo), const SYS_KEYCTL = 311 +pkg syscall (linux-arm-cgo), const SYS_KILL = 37 +pkg syscall (linux-arm-cgo), const SYS_LCHOWN = 16 +pkg syscall (linux-arm-cgo), const SYS_LCHOWN32 = 198 +pkg syscall (linux-arm-cgo), const SYS_LGETXATTR = 230 +pkg syscall (linux-arm-cgo), const SYS_LINK = 9 +pkg syscall (linux-arm-cgo), const SYS_LINKAT = 330 +pkg syscall (linux-arm-cgo), const SYS_LISTEN = 284 +pkg syscall (linux-arm-cgo), const SYS_LISTXATTR = 232 +pkg syscall (linux-arm-cgo), const SYS_LLISTXATTR = 233 +pkg syscall (linux-arm-cgo), const SYS_LOOKUP_DCOOKIE = 249 +pkg syscall (linux-arm-cgo), const SYS_LREMOVEXATTR = 236 +pkg syscall (linux-arm-cgo), const SYS_LSEEK = 19 +pkg syscall (linux-arm-cgo), const SYS_LSETXATTR = 227 +pkg syscall (linux-arm-cgo), const SYS_LSTAT = 107 +pkg syscall (linux-arm-cgo), const SYS_LSTAT64 = 196 +pkg syscall (linux-arm-cgo), const SYS_MADVISE = 220 +pkg syscall (linux-arm-cgo), const SYS_MBIND = 319 +pkg syscall (linux-arm-cgo), const SYS_MINCORE = 219 +pkg syscall (linux-arm-cgo), const SYS_MKDIR = 39 +pkg syscall (linux-arm-cgo), const SYS_MKDIRAT = 323 +pkg syscall (linux-arm-cgo), const SYS_MKNOD = 14 +pkg syscall (linux-arm-cgo), const SYS_MKNODAT = 324 +pkg syscall (linux-arm-cgo), const SYS_MLOCK = 150 +pkg syscall (linux-arm-cgo), const SYS_MLOCKALL = 152 +pkg syscall (linux-arm-cgo), const SYS_MMAP = 90 +pkg syscall (linux-arm-cgo), const SYS_MMAP2 = 192 +pkg syscall (linux-arm-cgo), const SYS_MOUNT = 21 +pkg syscall (linux-arm-cgo), const SYS_MOVE_PAGES = 344 +pkg syscall (linux-arm-cgo), const SYS_MPROTECT = 125 +pkg syscall (linux-arm-cgo), const SYS_MQ_GETSETATTR = 279 +pkg syscall (linux-arm-cgo), const SYS_MQ_NOTIFY = 278 +pkg syscall (linux-arm-cgo), const SYS_MQ_OPEN = 274 +pkg syscall (linux-arm-cgo), const SYS_MQ_TIMEDRECEIVE = 277 +pkg syscall (linux-arm-cgo), const SYS_MQ_TIMEDSEND = 276 +pkg syscall (linux-arm-cgo), const SYS_MQ_UNLINK = 275 +pkg syscall (linux-arm-cgo), const SYS_MREMAP = 163 +pkg syscall (linux-arm-cgo), const SYS_MSGCTL = 304 +pkg syscall (linux-arm-cgo), const SYS_MSGGET = 303 +pkg syscall (linux-arm-cgo), const SYS_MSGRCV = 302 +pkg syscall (linux-arm-cgo), const SYS_MSGSND = 301 +pkg syscall (linux-arm-cgo), const SYS_MSYNC = 144 +pkg syscall (linux-arm-cgo), const SYS_MUNLOCK = 151 +pkg syscall (linux-arm-cgo), const SYS_MUNLOCKALL = 153 +pkg syscall (linux-arm-cgo), const SYS_MUNMAP = 91 +pkg syscall (linux-arm-cgo), const SYS_NAME_TO_HANDLE_AT = 370 +pkg syscall (linux-arm-cgo), const SYS_NANOSLEEP = 162 +pkg syscall (linux-arm-cgo), const SYS_NFSSERVCTL = 169 +pkg syscall (linux-arm-cgo), const SYS_NICE = 34 +pkg syscall (linux-arm-cgo), const SYS_OABI_SYSCALL_BASE = 0 +pkg syscall (linux-arm-cgo), const SYS_OPEN = 5 +pkg syscall (linux-arm-cgo), const SYS_OPENAT = 322 +pkg syscall (linux-arm-cgo), const SYS_OPEN_BY_HANDLE_AT = 371 +pkg syscall (linux-arm-cgo), const SYS_PAUSE = 29 +pkg syscall (linux-arm-cgo), const SYS_PCICONFIG_IOBASE = 271 +pkg syscall (linux-arm-cgo), const SYS_PCICONFIG_READ = 272 +pkg syscall (linux-arm-cgo), const SYS_PCICONFIG_WRITE = 273 +pkg syscall (linux-arm-cgo), const SYS_PERF_EVENT_OPEN = 364 +pkg syscall (linux-arm-cgo), const SYS_PERSONALITY = 136 +pkg syscall (linux-arm-cgo), const SYS_PIPE = 42 +pkg syscall (linux-arm-cgo), const SYS_PIPE2 = 359 +pkg syscall (linux-arm-cgo), const SYS_PIVOT_ROOT = 218 +pkg syscall (linux-arm-cgo), const SYS_POLL = 168 +pkg syscall (linux-arm-cgo), const SYS_PPOLL = 336 +pkg syscall (linux-arm-cgo), const SYS_PRCTL = 172 +pkg syscall (linux-arm-cgo), const SYS_PREAD64 = 180 +pkg syscall (linux-arm-cgo), const SYS_PREADV = 361 +pkg syscall (linux-arm-cgo), const SYS_PRLIMIT64 = 369 +pkg syscall (linux-arm-cgo), const SYS_PROCESS_VM_READV = 376 +pkg syscall (linux-arm-cgo), const SYS_PROCESS_VM_WRITEV = 377 +pkg syscall (linux-arm-cgo), const SYS_PSELECT6 = 335 +pkg syscall (linux-arm-cgo), const SYS_PTRACE = 26 +pkg syscall (linux-arm-cgo), const SYS_PWRITE64 = 181 +pkg syscall (linux-arm-cgo), const SYS_PWRITEV = 362 +pkg syscall (linux-arm-cgo), const SYS_QUOTACTL = 131 +pkg syscall (linux-arm-cgo), const SYS_READ = 3 +pkg syscall (linux-arm-cgo), const SYS_READAHEAD = 225 +pkg syscall (linux-arm-cgo), const SYS_READDIR = 89 +pkg syscall (linux-arm-cgo), const SYS_READLINK = 85 +pkg syscall (linux-arm-cgo), const SYS_READLINKAT = 332 +pkg syscall (linux-arm-cgo), const SYS_READV = 145 +pkg syscall (linux-arm-cgo), const SYS_REBOOT = 88 +pkg syscall (linux-arm-cgo), const SYS_RECV = 291 +pkg syscall (linux-arm-cgo), const SYS_RECVFROM = 292 +pkg syscall (linux-arm-cgo), const SYS_RECVMMSG = 365 +pkg syscall (linux-arm-cgo), const SYS_RECVMSG = 297 +pkg syscall (linux-arm-cgo), const SYS_REMAP_FILE_PAGES = 253 +pkg syscall (linux-arm-cgo), const SYS_REMOVEXATTR = 235 +pkg syscall (linux-arm-cgo), const SYS_RENAME = 38 +pkg syscall (linux-arm-cgo), const SYS_RENAMEAT = 329 +pkg syscall (linux-arm-cgo), const SYS_REQUEST_KEY = 310 +pkg syscall (linux-arm-cgo), const SYS_RESTART_SYSCALL = 0 +pkg syscall (linux-arm-cgo), const SYS_RMDIR = 40 +pkg syscall (linux-arm-cgo), const SYS_RT_SIGACTION = 174 +pkg syscall (linux-arm-cgo), const SYS_RT_SIGPENDING = 176 +pkg syscall (linux-arm-cgo), const SYS_RT_SIGPROCMASK = 175 +pkg syscall (linux-arm-cgo), const SYS_RT_SIGQUEUEINFO = 178 +pkg syscall (linux-arm-cgo), const SYS_RT_SIGRETURN = 173 +pkg syscall (linux-arm-cgo), const SYS_RT_SIGSUSPEND = 179 +pkg syscall (linux-arm-cgo), const SYS_RT_SIGTIMEDWAIT = 177 +pkg syscall (linux-arm-cgo), const SYS_RT_TGSIGQUEUEINFO = 363 +pkg syscall (linux-arm-cgo), const SYS_SCHED_GETAFFINITY = 242 +pkg syscall (linux-arm-cgo), const SYS_SCHED_GETPARAM = 155 +pkg syscall (linux-arm-cgo), const SYS_SCHED_GETSCHEDULER = 157 +pkg syscall (linux-arm-cgo), const SYS_SCHED_GET_PRIORITY_MAX = 159 +pkg syscall (linux-arm-cgo), const SYS_SCHED_GET_PRIORITY_MIN = 160 +pkg syscall (linux-arm-cgo), const SYS_SCHED_RR_GET_INTERVAL = 161 +pkg syscall (linux-arm-cgo), const SYS_SCHED_SETAFFINITY = 241 +pkg syscall (linux-arm-cgo), const SYS_SCHED_SETPARAM = 154 +pkg syscall (linux-arm-cgo), const SYS_SCHED_SETSCHEDULER = 156 +pkg syscall (linux-arm-cgo), const SYS_SCHED_YIELD = 158 +pkg syscall (linux-arm-cgo), const SYS_SELECT = 82 +pkg syscall (linux-arm-cgo), const SYS_SEMCTL = 300 +pkg syscall (linux-arm-cgo), const SYS_SEMGET = 299 +pkg syscall (linux-arm-cgo), const SYS_SEMOP = 298 +pkg syscall (linux-arm-cgo), const SYS_SEMTIMEDOP = 312 +pkg syscall (linux-arm-cgo), const SYS_SEND = 289 +pkg syscall (linux-arm-cgo), const SYS_SENDFILE = 187 +pkg syscall (linux-arm-cgo), const SYS_SENDFILE64 = 239 +pkg syscall (linux-arm-cgo), const SYS_SENDMMSG = 374 +pkg syscall (linux-arm-cgo), const SYS_SENDMSG = 296 +pkg syscall (linux-arm-cgo), const SYS_SENDTO = 290 +pkg syscall (linux-arm-cgo), const SYS_SETDOMAINNAME = 121 +pkg syscall (linux-arm-cgo), const SYS_SETFSGID = 139 +pkg syscall (linux-arm-cgo), const SYS_SETFSGID32 = 216 +pkg syscall (linux-arm-cgo), const SYS_SETFSUID = 138 +pkg syscall (linux-arm-cgo), const SYS_SETFSUID32 = 215 +pkg syscall (linux-arm-cgo), const SYS_SETGID = 46 +pkg syscall (linux-arm-cgo), const SYS_SETGID32 = 214 +pkg syscall (linux-arm-cgo), const SYS_SETGROUPS = 81 +pkg syscall (linux-arm-cgo), const SYS_SETGROUPS32 = 206 +pkg syscall (linux-arm-cgo), const SYS_SETHOSTNAME = 74 +pkg syscall (linux-arm-cgo), const SYS_SETITIMER = 104 +pkg syscall (linux-arm-cgo), const SYS_SETNS = 375 +pkg syscall (linux-arm-cgo), const SYS_SETPGID = 57 +pkg syscall (linux-arm-cgo), const SYS_SETPRIORITY = 97 +pkg syscall (linux-arm-cgo), const SYS_SETREGID = 71 +pkg syscall (linux-arm-cgo), const SYS_SETREGID32 = 204 +pkg syscall (linux-arm-cgo), const SYS_SETRESGID = 170 +pkg syscall (linux-arm-cgo), const SYS_SETRESGID32 = 210 +pkg syscall (linux-arm-cgo), const SYS_SETRESUID = 164 +pkg syscall (linux-arm-cgo), const SYS_SETRESUID32 = 208 +pkg syscall (linux-arm-cgo), const SYS_SETREUID = 70 +pkg syscall (linux-arm-cgo), const SYS_SETREUID32 = 203 +pkg syscall (linux-arm-cgo), const SYS_SETRLIMIT = 75 +pkg syscall (linux-arm-cgo), const SYS_SETSID = 66 +pkg syscall (linux-arm-cgo), const SYS_SETSOCKOPT = 294 +pkg syscall (linux-arm-cgo), const SYS_SETTIMEOFDAY = 79 +pkg syscall (linux-arm-cgo), const SYS_SETUID = 23 +pkg syscall (linux-arm-cgo), const SYS_SETUID32 = 213 +pkg syscall (linux-arm-cgo), const SYS_SETXATTR = 226 +pkg syscall (linux-arm-cgo), const SYS_SET_MEMPOLICY = 321 +pkg syscall (linux-arm-cgo), const SYS_SET_ROBUST_LIST = 338 +pkg syscall (linux-arm-cgo), const SYS_SET_TID_ADDRESS = 256 +pkg syscall (linux-arm-cgo), const SYS_SHMAT = 305 +pkg syscall (linux-arm-cgo), const SYS_SHMCTL = 308 +pkg syscall (linux-arm-cgo), const SYS_SHMDT = 306 +pkg syscall (linux-arm-cgo), const SYS_SHMGET = 307 +pkg syscall (linux-arm-cgo), const SYS_SHUTDOWN = 293 +pkg syscall (linux-arm-cgo), const SYS_SIGACTION = 67 +pkg syscall (linux-arm-cgo), const SYS_SIGALTSTACK = 186 +pkg syscall (linux-arm-cgo), const SYS_SIGNALFD = 349 +pkg syscall (linux-arm-cgo), const SYS_SIGNALFD4 = 355 +pkg syscall (linux-arm-cgo), const SYS_SIGPENDING = 73 +pkg syscall (linux-arm-cgo), const SYS_SIGPROCMASK = 126 +pkg syscall (linux-arm-cgo), const SYS_SIGRETURN = 119 +pkg syscall (linux-arm-cgo), const SYS_SIGSUSPEND = 72 +pkg syscall (linux-arm-cgo), const SYS_SOCKET = 281 +pkg syscall (linux-arm-cgo), const SYS_SOCKETCALL = 102 +pkg syscall (linux-arm-cgo), const SYS_SOCKETPAIR = 288 +pkg syscall (linux-arm-cgo), const SYS_SPLICE = 340 +pkg syscall (linux-arm-cgo), const SYS_STAT = 106 +pkg syscall (linux-arm-cgo), const SYS_STAT64 = 195 +pkg syscall (linux-arm-cgo), const SYS_STATFS = 99 +pkg syscall (linux-arm-cgo), const SYS_STATFS64 = 266 +pkg syscall (linux-arm-cgo), const SYS_STIME = 25 +pkg syscall (linux-arm-cgo), const SYS_SWAPOFF = 115 +pkg syscall (linux-arm-cgo), const SYS_SWAPON = 87 +pkg syscall (linux-arm-cgo), const SYS_SYMLINK = 83 +pkg syscall (linux-arm-cgo), const SYS_SYMLINKAT = 331 +pkg syscall (linux-arm-cgo), const SYS_SYNC = 36 +pkg syscall (linux-arm-cgo), const SYS_SYNCFS = 373 +pkg syscall (linux-arm-cgo), const SYS_SYSCALL = 113 +pkg syscall (linux-arm-cgo), const SYS_SYSCALL_BASE = 0 +pkg syscall (linux-arm-cgo), const SYS_SYSFS = 135 +pkg syscall (linux-arm-cgo), const SYS_SYSINFO = 116 +pkg syscall (linux-arm-cgo), const SYS_SYSLOG = 103 +pkg syscall (linux-arm-cgo), const SYS_TEE = 342 +pkg syscall (linux-arm-cgo), const SYS_TGKILL = 268 +pkg syscall (linux-arm-cgo), const SYS_TIME = 13 +pkg syscall (linux-arm-cgo), const SYS_TIMERFD_CREATE = 350 +pkg syscall (linux-arm-cgo), const SYS_TIMERFD_GETTIME = 354 +pkg syscall (linux-arm-cgo), const SYS_TIMERFD_SETTIME = 353 +pkg syscall (linux-arm-cgo), const SYS_TIMER_CREATE = 257 +pkg syscall (linux-arm-cgo), const SYS_TIMER_DELETE = 261 +pkg syscall (linux-arm-cgo), const SYS_TIMER_GETOVERRUN = 260 +pkg syscall (linux-arm-cgo), const SYS_TIMER_GETTIME = 259 +pkg syscall (linux-arm-cgo), const SYS_TIMER_SETTIME = 258 +pkg syscall (linux-arm-cgo), const SYS_TIMES = 43 +pkg syscall (linux-arm-cgo), const SYS_TKILL = 238 +pkg syscall (linux-arm-cgo), const SYS_TRUNCATE = 92 +pkg syscall (linux-arm-cgo), const SYS_TRUNCATE64 = 193 +pkg syscall (linux-arm-cgo), const SYS_UGETRLIMIT = 191 +pkg syscall (linux-arm-cgo), const SYS_UMASK = 60 +pkg syscall (linux-arm-cgo), const SYS_UMOUNT = 22 +pkg syscall (linux-arm-cgo), const SYS_UMOUNT2 = 52 +pkg syscall (linux-arm-cgo), const SYS_UNAME = 122 +pkg syscall (linux-arm-cgo), const SYS_UNLINK = 10 +pkg syscall (linux-arm-cgo), const SYS_UNLINKAT = 328 +pkg syscall (linux-arm-cgo), const SYS_UNSHARE = 337 +pkg syscall (linux-arm-cgo), const SYS_USELIB = 86 +pkg syscall (linux-arm-cgo), const SYS_USTAT = 62 +pkg syscall (linux-arm-cgo), const SYS_UTIME = 30 +pkg syscall (linux-arm-cgo), const SYS_UTIMENSAT = 348 +pkg syscall (linux-arm-cgo), const SYS_UTIMES = 269 +pkg syscall (linux-arm-cgo), const SYS_VFORK = 190 +pkg syscall (linux-arm-cgo), const SYS_VHANGUP = 111 +pkg syscall (linux-arm-cgo), const SYS_VMSPLICE = 343 +pkg syscall (linux-arm-cgo), const SYS_VSERVER = 313 +pkg syscall (linux-arm-cgo), const SYS_WAIT4 = 114 +pkg syscall (linux-arm-cgo), const SYS_WAITID = 280 +pkg syscall (linux-arm-cgo), const SYS_WRITE = 4 +pkg syscall (linux-arm-cgo), const SYS_WRITEV = 146 +pkg syscall (linux-arm-cgo), const SYS__LLSEEK = 140 +pkg syscall (linux-arm-cgo), const SYS__NEWSELECT = 142 +pkg syscall (linux-arm-cgo), const SYS__SYSCTL = 149 +pkg syscall (linux-arm-cgo), const S_BLKSIZE = 512 +pkg syscall (linux-arm-cgo), const S_IEXEC = 64 +pkg syscall (linux-arm-cgo), const S_IFMT = 61440 +pkg syscall (linux-arm-cgo), const S_IREAD = 256 +pkg syscall (linux-arm-cgo), const S_IRGRP = 32 +pkg syscall (linux-arm-cgo), const S_IROTH = 4 +pkg syscall (linux-arm-cgo), const S_IRWXG = 56 +pkg syscall (linux-arm-cgo), const S_IRWXO = 7 +pkg syscall (linux-arm-cgo), const S_IRWXU = 448 +pkg syscall (linux-arm-cgo), const S_IWGRP = 16 +pkg syscall (linux-arm-cgo), const S_IWOTH = 2 +pkg syscall (linux-arm-cgo), const S_IWRITE = 128 +pkg syscall (linux-arm-cgo), const S_IXGRP = 8 +pkg syscall (linux-arm-cgo), const S_IXOTH = 1 +pkg syscall (linux-arm-cgo), const SizeofCmsghdr = 12 +pkg syscall (linux-arm-cgo), const SizeofIPMreq = 8 +pkg syscall (linux-arm-cgo), const SizeofIPMreqn = 12 +pkg syscall (linux-arm-cgo), const SizeofIPv6Mreq = 20 +pkg syscall (linux-arm-cgo), const SizeofIfAddrmsg = 8 +pkg syscall (linux-arm-cgo), const SizeofIfInfomsg = 16 +pkg syscall (linux-arm-cgo), const SizeofInet4Pktinfo = 12 +pkg syscall (linux-arm-cgo), const SizeofInet6Pktinfo = 20 +pkg syscall (linux-arm-cgo), const SizeofInotifyEvent = 16 +pkg syscall (linux-arm-cgo), const SizeofLinger = 8 +pkg syscall (linux-arm-cgo), const SizeofMsghdr = 28 +pkg syscall (linux-arm-cgo), const SizeofNlAttr = 4 +pkg syscall (linux-arm-cgo), const SizeofNlMsgerr = 20 +pkg syscall (linux-arm-cgo), const SizeofNlMsghdr = 16 +pkg syscall (linux-arm-cgo), const SizeofRtAttr = 4 +pkg syscall (linux-arm-cgo), const SizeofRtGenmsg = 1 +pkg syscall (linux-arm-cgo), const SizeofRtMsg = 12 +pkg syscall (linux-arm-cgo), const SizeofRtNexthop = 8 +pkg syscall (linux-arm-cgo), const SizeofSockFilter = 8 +pkg syscall (linux-arm-cgo), const SizeofSockFprog = 8 +pkg syscall (linux-arm-cgo), const SizeofSockaddrAny = 112 +pkg syscall (linux-arm-cgo), const SizeofSockaddrInet4 = 16 +pkg syscall (linux-arm-cgo), const SizeofSockaddrInet6 = 28 +pkg syscall (linux-arm-cgo), const SizeofSockaddrLinklayer = 20 +pkg syscall (linux-arm-cgo), const SizeofSockaddrNetlink = 12 +pkg syscall (linux-arm-cgo), const SizeofSockaddrUnix = 110 +pkg syscall (linux-arm-cgo), const SizeofTCPInfo = 104 +pkg syscall (linux-arm-cgo), const SizeofUcred = 12 +pkg syscall (linux-arm-cgo), const TCGETS = 21505 +pkg syscall (linux-arm-cgo), const TCP_CONGESTION = 13 +pkg syscall (linux-arm-cgo), const TCP_CORK = 3 +pkg syscall (linux-arm-cgo), const TCP_DEFER_ACCEPT = 9 +pkg syscall (linux-arm-cgo), const TCP_INFO = 11 +pkg syscall (linux-arm-cgo), const TCP_KEEPCNT = 6 +pkg syscall (linux-arm-cgo), const TCP_KEEPIDLE = 4 +pkg syscall (linux-arm-cgo), const TCP_KEEPINTVL = 5 +pkg syscall (linux-arm-cgo), const TCP_LINGER2 = 8 +pkg syscall (linux-arm-cgo), const TCP_MAXSEG = 2 +pkg syscall (linux-arm-cgo), const TCP_MAXWIN = 65535 +pkg syscall (linux-arm-cgo), const TCP_MAX_WINSHIFT = 14 +pkg syscall (linux-arm-cgo), const TCP_MD5SIG = 14 +pkg syscall (linux-arm-cgo), const TCP_MD5SIG_MAXKEYLEN = 80 +pkg syscall (linux-arm-cgo), const TCP_MSS = 512 +pkg syscall (linux-arm-cgo), const TCP_QUICKACK = 12 +pkg syscall (linux-arm-cgo), const TCP_SYNCNT = 7 +pkg syscall (linux-arm-cgo), const TCP_WINDOW_CLAMP = 10 +pkg syscall (linux-arm-cgo), const TCSETS = 21506 +pkg syscall (linux-arm-cgo), const TIOCCBRK = 21544 +pkg syscall (linux-arm-cgo), const TIOCCONS = 21533 +pkg syscall (linux-arm-cgo), const TIOCEXCL = 21516 +pkg syscall (linux-arm-cgo), const TIOCGDEV = 2147767346 +pkg syscall (linux-arm-cgo), const TIOCGETD = 21540 +pkg syscall (linux-arm-cgo), const TIOCGICOUNT = 21597 +pkg syscall (linux-arm-cgo), const TIOCGLCKTRMIOS = 21590 +pkg syscall (linux-arm-cgo), const TIOCGPGRP = 21519 +pkg syscall (linux-arm-cgo), const TIOCGPTN = 2147767344 +pkg syscall (linux-arm-cgo), const TIOCGRS485 = 21550 +pkg syscall (linux-arm-cgo), const TIOCGSERIAL = 21534 +pkg syscall (linux-arm-cgo), const TIOCGSID = 21545 +pkg syscall (linux-arm-cgo), const TIOCGSOFTCAR = 21529 +pkg syscall (linux-arm-cgo), const TIOCGWINSZ = 21523 +pkg syscall (linux-arm-cgo), const TIOCINQ = 21531 +pkg syscall (linux-arm-cgo), const TIOCLINUX = 21532 +pkg syscall (linux-arm-cgo), const TIOCMBIC = 21527 +pkg syscall (linux-arm-cgo), const TIOCMBIS = 21526 +pkg syscall (linux-arm-cgo), const TIOCMGET = 21525 +pkg syscall (linux-arm-cgo), const TIOCMIWAIT = 21596 +pkg syscall (linux-arm-cgo), const TIOCMSET = 21528 +pkg syscall (linux-arm-cgo), const TIOCM_CAR = 64 +pkg syscall (linux-arm-cgo), const TIOCM_CD = 64 +pkg syscall (linux-arm-cgo), const TIOCM_CTS = 32 +pkg syscall (linux-arm-cgo), const TIOCM_DSR = 256 +pkg syscall (linux-arm-cgo), const TIOCM_DTR = 2 +pkg syscall (linux-arm-cgo), const TIOCM_LE = 1 +pkg syscall (linux-arm-cgo), const TIOCM_RI = 128 +pkg syscall (linux-arm-cgo), const TIOCM_RNG = 128 +pkg syscall (linux-arm-cgo), const TIOCM_RTS = 4 +pkg syscall (linux-arm-cgo), const TIOCM_SR = 16 +pkg syscall (linux-arm-cgo), const TIOCM_ST = 8 +pkg syscall (linux-arm-cgo), const TIOCNOTTY = 21538 +pkg syscall (linux-arm-cgo), const TIOCNXCL = 21517 +pkg syscall (linux-arm-cgo), const TIOCOUTQ = 21521 +pkg syscall (linux-arm-cgo), const TIOCPKT = 21536 +pkg syscall (linux-arm-cgo), const TIOCPKT_DATA = 0 +pkg syscall (linux-arm-cgo), const TIOCPKT_DOSTOP = 32 +pkg syscall (linux-arm-cgo), const TIOCPKT_FLUSHREAD = 1 +pkg syscall (linux-arm-cgo), const TIOCPKT_FLUSHWRITE = 2 +pkg syscall (linux-arm-cgo), const TIOCPKT_IOCTL = 64 +pkg syscall (linux-arm-cgo), const TIOCPKT_NOSTOP = 16 +pkg syscall (linux-arm-cgo), const TIOCPKT_START = 8 +pkg syscall (linux-arm-cgo), const TIOCPKT_STOP = 4 +pkg syscall (linux-arm-cgo), const TIOCSBRK = 21543 +pkg syscall (linux-arm-cgo), const TIOCSCTTY = 21518 +pkg syscall (linux-arm-cgo), const TIOCSERCONFIG = 21587 +pkg syscall (linux-arm-cgo), const TIOCSERGETLSR = 21593 +pkg syscall (linux-arm-cgo), const TIOCSERGETMULTI = 21594 +pkg syscall (linux-arm-cgo), const TIOCSERGSTRUCT = 21592 +pkg syscall (linux-arm-cgo), const TIOCSERGWILD = 21588 +pkg syscall (linux-arm-cgo), const TIOCSERSETMULTI = 21595 +pkg syscall (linux-arm-cgo), const TIOCSERSWILD = 21589 +pkg syscall (linux-arm-cgo), const TIOCSER_TEMT = 1 +pkg syscall (linux-arm-cgo), const TIOCSETD = 21539 +pkg syscall (linux-arm-cgo), const TIOCSIG = 1074025526 +pkg syscall (linux-arm-cgo), const TIOCSLCKTRMIOS = 21591 +pkg syscall (linux-arm-cgo), const TIOCSPGRP = 21520 +pkg syscall (linux-arm-cgo), const TIOCSPTLCK = 1074025521 +pkg syscall (linux-arm-cgo), const TIOCSRS485 = 21551 +pkg syscall (linux-arm-cgo), const TIOCSSERIAL = 21535 +pkg syscall (linux-arm-cgo), const TIOCSSOFTCAR = 21530 +pkg syscall (linux-arm-cgo), const TIOCSTI = 21522 +pkg syscall (linux-arm-cgo), const TIOCSWINSZ = 21524 +pkg syscall (linux-arm-cgo), const TIOCVHANGUP = 21559 +pkg syscall (linux-arm-cgo), const TOSTOP = 256 +pkg syscall (linux-arm-cgo), const TUNATTACHFILTER = 1074287829 +pkg syscall (linux-arm-cgo), const TUNDETACHFILTER = 1074287830 +pkg syscall (linux-arm-cgo), const TUNGETFEATURES = 2147767503 +pkg syscall (linux-arm-cgo), const TUNGETIFF = 2147767506 +pkg syscall (linux-arm-cgo), const TUNGETSNDBUF = 2147767507 +pkg syscall (linux-arm-cgo), const TUNGETVNETHDRSZ = 2147767511 +pkg syscall (linux-arm-cgo), const TUNSETDEBUG = 1074025673 +pkg syscall (linux-arm-cgo), const TUNSETGROUP = 1074025678 +pkg syscall (linux-arm-cgo), const TUNSETIFF = 1074025674 +pkg syscall (linux-arm-cgo), const TUNSETLINK = 1074025677 +pkg syscall (linux-arm-cgo), const TUNSETNOCSUM = 1074025672 +pkg syscall (linux-arm-cgo), const TUNSETOFFLOAD = 1074025680 +pkg syscall (linux-arm-cgo), const TUNSETOWNER = 1074025676 +pkg syscall (linux-arm-cgo), const TUNSETPERSIST = 1074025675 +pkg syscall (linux-arm-cgo), const TUNSETSNDBUF = 1074025684 +pkg syscall (linux-arm-cgo), const TUNSETTXFILTER = 1074025681 +pkg syscall (linux-arm-cgo), const TUNSETVNETHDRSZ = 1074025688 +pkg syscall (linux-arm-cgo), const VDISCARD = 13 +pkg syscall (linux-arm-cgo), const VEOF = 4 +pkg syscall (linux-arm-cgo), const VEOL = 11 +pkg syscall (linux-arm-cgo), const VEOL2 = 16 +pkg syscall (linux-arm-cgo), const VERASE = 2 +pkg syscall (linux-arm-cgo), const VINTR = 0 +pkg syscall (linux-arm-cgo), const VKILL = 3 +pkg syscall (linux-arm-cgo), const VLNEXT = 15 +pkg syscall (linux-arm-cgo), const VMIN = 6 +pkg syscall (linux-arm-cgo), const VQUIT = 1 +pkg syscall (linux-arm-cgo), const VREPRINT = 12 +pkg syscall (linux-arm-cgo), const VSTART = 8 +pkg syscall (linux-arm-cgo), const VSTOP = 9 +pkg syscall (linux-arm-cgo), const VSUSP = 10 +pkg syscall (linux-arm-cgo), const VSWTC = 7 +pkg syscall (linux-arm-cgo), const VTIME = 5 +pkg syscall (linux-arm-cgo), const VWERASE = 14 +pkg syscall (linux-arm-cgo), const WALL = 1073741824 +pkg syscall (linux-arm-cgo), const WCLONE = 2147483648 +pkg syscall (linux-arm-cgo), const WCONTINUED = 8 +pkg syscall (linux-arm-cgo), const WEXITED = 4 +pkg syscall (linux-arm-cgo), const WNOHANG = 1 +pkg syscall (linux-arm-cgo), const WNOTHREAD = 536870912 +pkg syscall (linux-arm-cgo), const WNOWAIT = 16777216 +pkg syscall (linux-arm-cgo), const WORDSIZE = 32 +pkg syscall (linux-arm-cgo), const WSTOPPED = 2 +pkg syscall (linux-arm-cgo), const WUNTRACED = 2 +pkg syscall (linux-arm-cgo), const XCASE = 4 +pkg syscall (netbsd-386), const AF_APPLETALK = 16 +pkg syscall (netbsd-386), const AF_ARP = 28 +pkg syscall (netbsd-386), const AF_BLUETOOTH = 31 +pkg syscall (netbsd-386), const AF_CCITT = 10 +pkg syscall (netbsd-386), const AF_CHAOS = 5 +pkg syscall (netbsd-386), const AF_CNT = 21 +pkg syscall (netbsd-386), const AF_COIP = 20 +pkg syscall (netbsd-386), const AF_DATAKIT = 9 +pkg syscall (netbsd-386), const AF_DECnet = 12 +pkg syscall (netbsd-386), const AF_DLI = 13 +pkg syscall (netbsd-386), const AF_E164 = 26 +pkg syscall (netbsd-386), const AF_ECMA = 8 +pkg syscall (netbsd-386), const AF_HYLINK = 15 +pkg syscall (netbsd-386), const AF_IEEE80211 = 32 +pkg syscall (netbsd-386), const AF_IMPLINK = 3 +pkg syscall (netbsd-386), const AF_INET6 = 24 +pkg syscall (netbsd-386), const AF_IPX = 23 +pkg syscall (netbsd-386), const AF_ISDN = 26 +pkg syscall (netbsd-386), const AF_ISO = 7 +pkg syscall (netbsd-386), const AF_LAT = 14 +pkg syscall (netbsd-386), const AF_LINK = 18 +pkg syscall (netbsd-386), const AF_LOCAL = 1 +pkg syscall (netbsd-386), const AF_MAX = 35 +pkg syscall (netbsd-386), const AF_MPLS = 33 +pkg syscall (netbsd-386), const AF_NATM = 27 +pkg syscall (netbsd-386), const AF_NS = 6 +pkg syscall (netbsd-386), const AF_OROUTE = 17 +pkg syscall (netbsd-386), const AF_OSI = 7 +pkg syscall (netbsd-386), const AF_PUP = 4 +pkg syscall (netbsd-386), const AF_ROUTE = 34 +pkg syscall (netbsd-386), const AF_SNA = 11 +pkg syscall (netbsd-386), const ARPHRD_ARCNET = 7 +pkg syscall (netbsd-386), const ARPHRD_ETHER = 1 +pkg syscall (netbsd-386), const ARPHRD_FRELAY = 15 +pkg syscall (netbsd-386), const ARPHRD_IEEE1394 = 24 +pkg syscall (netbsd-386), const ARPHRD_IEEE802 = 6 +pkg syscall (netbsd-386), const ARPHRD_STRIP = 23 +pkg syscall (netbsd-386), const B0 = 0 +pkg syscall (netbsd-386), const B110 = 110 +pkg syscall (netbsd-386), const B115200 = 115200 +pkg syscall (netbsd-386), const B1200 = 1200 +pkg syscall (netbsd-386), const B134 = 134 +pkg syscall (netbsd-386), const B14400 = 14400 +pkg syscall (netbsd-386), const B150 = 150 +pkg syscall (netbsd-386), const B1800 = 1800 +pkg syscall (netbsd-386), const B19200 = 19200 +pkg syscall (netbsd-386), const B200 = 200 +pkg syscall (netbsd-386), const B230400 = 230400 +pkg syscall (netbsd-386), const B2400 = 2400 +pkg syscall (netbsd-386), const B28800 = 28800 +pkg syscall (netbsd-386), const B300 = 300 +pkg syscall (netbsd-386), const B38400 = 38400 +pkg syscall (netbsd-386), const B460800 = 460800 +pkg syscall (netbsd-386), const B4800 = 4800 +pkg syscall (netbsd-386), const B50 = 50 +pkg syscall (netbsd-386), const B57600 = 57600 +pkg syscall (netbsd-386), const B600 = 600 +pkg syscall (netbsd-386), const B7200 = 7200 +pkg syscall (netbsd-386), const B75 = 75 +pkg syscall (netbsd-386), const B76800 = 76800 +pkg syscall (netbsd-386), const B921600 = 921600 +pkg syscall (netbsd-386), const B9600 = 9600 +pkg syscall (netbsd-386), const BIOCFEEDBACK = 2147762813 +pkg syscall (netbsd-386), const BIOCFLUSH = 536887912 +pkg syscall (netbsd-386), const BIOCGBLEN = 1074020966 +pkg syscall (netbsd-386), const BIOCGDLT = 1074020970 +pkg syscall (netbsd-386), const BIOCGDLTLIST = 3221766775 +pkg syscall (netbsd-386), const BIOCGETIF = 1083196011 +pkg syscall (netbsd-386), const BIOCGFEEDBACK = 1074020988 +pkg syscall (netbsd-386), const BIOCGHDRCMPLT = 1074020980 +pkg syscall (netbsd-386), const BIOCGRTIMEOUT = 1074545275 +pkg syscall (netbsd-386), const BIOCGSEESENT = 1074020984 +pkg syscall (netbsd-386), const BIOCGSTATS = 1082147439 +pkg syscall (netbsd-386), const BIOCGSTATSOLD = 1074283119 +pkg syscall (netbsd-386), const BIOCIMMEDIATE = 2147762800 +pkg syscall (netbsd-386), const BIOCPROMISC = 536887913 +pkg syscall (netbsd-386), const BIOCSBLEN = 3221504614 +pkg syscall (netbsd-386), const BIOCSDLT = 2147762806 +pkg syscall (netbsd-386), const BIOCSETF = 2148024935 +pkg syscall (netbsd-386), const BIOCSETIF = 2156937836 +pkg syscall (netbsd-386), const BIOCSFEEDBACK = 2147762813 +pkg syscall (netbsd-386), const BIOCSHDRCMPLT = 2147762805 +pkg syscall (netbsd-386), const BIOCSRTIMEOUT = 2148287098 +pkg syscall (netbsd-386), const BIOCSSEESENT = 2147762809 +pkg syscall (netbsd-386), const BIOCSTCPF = 2148024946 +pkg syscall (netbsd-386), const BIOCSUDPF = 2148024947 +pkg syscall (netbsd-386), const BIOCVERSION = 1074020977 +pkg syscall (netbsd-386), const BPF_A = 16 +pkg syscall (netbsd-386), const BPF_ABS = 32 +pkg syscall (netbsd-386), const BPF_ADD = 0 +pkg syscall (netbsd-386), const BPF_ALIGNMENT = 4 +pkg syscall (netbsd-386), const BPF_ALIGNMENT32 = 4 +pkg syscall (netbsd-386), const BPF_ALU = 4 +pkg syscall (netbsd-386), const BPF_AND = 80 +pkg syscall (netbsd-386), const BPF_B = 16 +pkg syscall (netbsd-386), const BPF_DFLTBUFSIZE = 1048576 +pkg syscall (netbsd-386), const BPF_DIV = 48 +pkg syscall (netbsd-386), const BPF_H = 8 +pkg syscall (netbsd-386), const BPF_IMM = 0 +pkg syscall (netbsd-386), const BPF_IND = 64 +pkg syscall (netbsd-386), const BPF_JA = 0 +pkg syscall (netbsd-386), const BPF_JEQ = 16 +pkg syscall (netbsd-386), const BPF_JGE = 48 +pkg syscall (netbsd-386), const BPF_JGT = 32 +pkg syscall (netbsd-386), const BPF_JMP = 5 +pkg syscall (netbsd-386), const BPF_JSET = 64 +pkg syscall (netbsd-386), const BPF_K = 0 +pkg syscall (netbsd-386), const BPF_LD = 0 +pkg syscall (netbsd-386), const BPF_LDX = 1 +pkg syscall (netbsd-386), const BPF_LEN = 128 +pkg syscall (netbsd-386), const BPF_LSH = 96 +pkg syscall (netbsd-386), const BPF_MAJOR_VERSION = 1 +pkg syscall (netbsd-386), const BPF_MAXBUFSIZE = 16777216 +pkg syscall (netbsd-386), const BPF_MAXINSNS = 512 +pkg syscall (netbsd-386), const BPF_MEM = 96 +pkg syscall (netbsd-386), const BPF_MEMWORDS = 16 +pkg syscall (netbsd-386), const BPF_MINBUFSIZE = 32 +pkg syscall (netbsd-386), const BPF_MINOR_VERSION = 1 +pkg syscall (netbsd-386), const BPF_MISC = 7 +pkg syscall (netbsd-386), const BPF_MSH = 160 +pkg syscall (netbsd-386), const BPF_MUL = 32 +pkg syscall (netbsd-386), const BPF_NEG = 128 +pkg syscall (netbsd-386), const BPF_OR = 64 +pkg syscall (netbsd-386), const BPF_RELEASE = 199606 +pkg syscall (netbsd-386), const BPF_RET = 6 +pkg syscall (netbsd-386), const BPF_RSH = 112 +pkg syscall (netbsd-386), const BPF_ST = 2 +pkg syscall (netbsd-386), const BPF_STX = 3 +pkg syscall (netbsd-386), const BPF_SUB = 16 +pkg syscall (netbsd-386), const BPF_TAX = 0 +pkg syscall (netbsd-386), const BPF_TXA = 128 +pkg syscall (netbsd-386), const BPF_W = 0 +pkg syscall (netbsd-386), const BPF_X = 8 +pkg syscall (netbsd-386), const BRKINT = 2 +pkg syscall (netbsd-386), const CFLUSH = 15 +pkg syscall (netbsd-386), const CLOCAL = 32768 +pkg syscall (netbsd-386), const CREAD = 2048 +pkg syscall (netbsd-386), const CS5 = 0 +pkg syscall (netbsd-386), const CS6 = 256 +pkg syscall (netbsd-386), const CS7 = 512 +pkg syscall (netbsd-386), const CS8 = 768 +pkg syscall (netbsd-386), const CSIZE = 768 +pkg syscall (netbsd-386), const CSTART = 17 +pkg syscall (netbsd-386), const CSTATUS = 20 +pkg syscall (netbsd-386), const CSTOP = 19 +pkg syscall (netbsd-386), const CSTOPB = 1024 +pkg syscall (netbsd-386), const CSUSP = 26 +pkg syscall (netbsd-386), const CTL_MAXNAME = 12 +pkg syscall (netbsd-386), const CTL_NET = 4 +pkg syscall (netbsd-386), const CTL_QUERY = -2 +pkg syscall (netbsd-386), const DIOCBSFLUSH = 536896632 +pkg syscall (netbsd-386), const DLT_A429 = 184 +pkg syscall (netbsd-386), const DLT_A653_ICM = 185 +pkg syscall (netbsd-386), const DLT_AIRONET_HEADER = 120 +pkg syscall (netbsd-386), const DLT_AOS = 222 +pkg syscall (netbsd-386), const DLT_APPLE_IP_OVER_IEEE1394 = 138 +pkg syscall (netbsd-386), const DLT_ARCNET = 7 +pkg syscall (netbsd-386), const DLT_ARCNET_LINUX = 129 +pkg syscall (netbsd-386), const DLT_ATM_CLIP = 19 +pkg syscall (netbsd-386), const DLT_ATM_RFC1483 = 11 +pkg syscall (netbsd-386), const DLT_AURORA = 126 +pkg syscall (netbsd-386), const DLT_AX25 = 3 +pkg syscall (netbsd-386), const DLT_AX25_KISS = 202 +pkg syscall (netbsd-386), const DLT_BACNET_MS_TP = 165 +pkg syscall (netbsd-386), const DLT_BLUETOOTH_HCI_H4 = 187 +pkg syscall (netbsd-386), const DLT_BLUETOOTH_HCI_H4_WITH_PHDR = 201 +pkg syscall (netbsd-386), const DLT_CAN20B = 190 +pkg syscall (netbsd-386), const DLT_CAN_SOCKETCAN = 227 +pkg syscall (netbsd-386), const DLT_CHAOS = 5 +pkg syscall (netbsd-386), const DLT_CISCO_IOS = 118 +pkg syscall (netbsd-386), const DLT_C_HDLC = 104 +pkg syscall (netbsd-386), const DLT_C_HDLC_WITH_DIR = 205 +pkg syscall (netbsd-386), const DLT_DECT = 221 +pkg syscall (netbsd-386), const DLT_DOCSIS = 143 +pkg syscall (netbsd-386), const DLT_ECONET = 115 +pkg syscall (netbsd-386), const DLT_EN10MB = 1 +pkg syscall (netbsd-386), const DLT_EN3MB = 2 +pkg syscall (netbsd-386), const DLT_ENC = 109 +pkg syscall (netbsd-386), const DLT_ERF = 197 +pkg syscall (netbsd-386), const DLT_ERF_ETH = 175 +pkg syscall (netbsd-386), const DLT_ERF_POS = 176 +pkg syscall (netbsd-386), const DLT_FC_2 = 224 +pkg syscall (netbsd-386), const DLT_FC_2_WITH_FRAME_DELIMS = 225 +pkg syscall (netbsd-386), const DLT_FDDI = 10 +pkg syscall (netbsd-386), const DLT_FLEXRAY = 210 +pkg syscall (netbsd-386), const DLT_FRELAY = 107 +pkg syscall (netbsd-386), const DLT_FRELAY_WITH_DIR = 206 +pkg syscall (netbsd-386), const DLT_GCOM_SERIAL = 173 +pkg syscall (netbsd-386), const DLT_GCOM_T1E1 = 172 +pkg syscall (netbsd-386), const DLT_GPF_F = 171 +pkg syscall (netbsd-386), const DLT_GPF_T = 170 +pkg syscall (netbsd-386), const DLT_GPRS_LLC = 169 +pkg syscall (netbsd-386), const DLT_GSMTAP_ABIS = 218 +pkg syscall (netbsd-386), const DLT_GSMTAP_UM = 217 +pkg syscall (netbsd-386), const DLT_HDLC = 16 +pkg syscall (netbsd-386), const DLT_HHDLC = 121 +pkg syscall (netbsd-386), const DLT_HIPPI = 15 +pkg syscall (netbsd-386), const DLT_IBM_SN = 146 +pkg syscall (netbsd-386), const DLT_IBM_SP = 145 +pkg syscall (netbsd-386), const DLT_IEEE802 = 6 +pkg syscall (netbsd-386), const DLT_IEEE802_11 = 105 +pkg syscall (netbsd-386), const DLT_IEEE802_11_RADIO = 127 +pkg syscall (netbsd-386), const DLT_IEEE802_11_RADIO_AVS = 163 +pkg syscall (netbsd-386), const DLT_IEEE802_15_4 = 195 +pkg syscall (netbsd-386), const DLT_IEEE802_15_4_LINUX = 191 +pkg syscall (netbsd-386), const DLT_IEEE802_15_4_NONASK_PHY = 215 +pkg syscall (netbsd-386), const DLT_IEEE802_16_MAC_CPS = 188 +pkg syscall (netbsd-386), const DLT_IEEE802_16_MAC_CPS_RADIO = 193 +pkg syscall (netbsd-386), const DLT_IPMB = 199 +pkg syscall (netbsd-386), const DLT_IPMB_LINUX = 209 +pkg syscall (netbsd-386), const DLT_IPNET = 226 +pkg syscall (netbsd-386), const DLT_IPV4 = 228 +pkg syscall (netbsd-386), const DLT_IPV6 = 229 +pkg syscall (netbsd-386), const DLT_IP_OVER_FC = 122 +pkg syscall (netbsd-386), const DLT_JUNIPER_ATM1 = 137 +pkg syscall (netbsd-386), const DLT_JUNIPER_ATM2 = 135 +pkg syscall (netbsd-386), const DLT_JUNIPER_CHDLC = 181 +pkg syscall (netbsd-386), const DLT_JUNIPER_ES = 132 +pkg syscall (netbsd-386), const DLT_JUNIPER_ETHER = 178 +pkg syscall (netbsd-386), const DLT_JUNIPER_FRELAY = 180 +pkg syscall (netbsd-386), const DLT_JUNIPER_GGSN = 133 +pkg syscall (netbsd-386), const DLT_JUNIPER_ISM = 194 +pkg syscall (netbsd-386), const DLT_JUNIPER_MFR = 134 +pkg syscall (netbsd-386), const DLT_JUNIPER_MLFR = 131 +pkg syscall (netbsd-386), const DLT_JUNIPER_MLPPP = 130 +pkg syscall (netbsd-386), const DLT_JUNIPER_MONITOR = 164 +pkg syscall (netbsd-386), const DLT_JUNIPER_PIC_PEER = 174 +pkg syscall (netbsd-386), const DLT_JUNIPER_PPP = 179 +pkg syscall (netbsd-386), const DLT_JUNIPER_PPPOE = 167 +pkg syscall (netbsd-386), const DLT_JUNIPER_PPPOE_ATM = 168 +pkg syscall (netbsd-386), const DLT_JUNIPER_SERVICES = 136 +pkg syscall (netbsd-386), const DLT_JUNIPER_ST = 200 +pkg syscall (netbsd-386), const DLT_JUNIPER_VP = 183 +pkg syscall (netbsd-386), const DLT_LAPB_WITH_DIR = 207 +pkg syscall (netbsd-386), const DLT_LAPD = 203 +pkg syscall (netbsd-386), const DLT_LIN = 212 +pkg syscall (netbsd-386), const DLT_LINUX_EVDEV = 216 +pkg syscall (netbsd-386), const DLT_LINUX_IRDA = 144 +pkg syscall (netbsd-386), const DLT_LINUX_LAPD = 177 +pkg syscall (netbsd-386), const DLT_LINUX_SLL = 113 +pkg syscall (netbsd-386), const DLT_LOOP = 108 +pkg syscall (netbsd-386), const DLT_LTALK = 114 +pkg syscall (netbsd-386), const DLT_MFR = 182 +pkg syscall (netbsd-386), const DLT_MOST = 211 +pkg syscall (netbsd-386), const DLT_MPLS = 219 +pkg syscall (netbsd-386), const DLT_MTP2 = 140 +pkg syscall (netbsd-386), const DLT_MTP2_WITH_PHDR = 139 +pkg syscall (netbsd-386), const DLT_MTP3 = 141 +pkg syscall (netbsd-386), const DLT_NULL = 0 +pkg syscall (netbsd-386), const DLT_PCI_EXP = 125 +pkg syscall (netbsd-386), const DLT_PFLOG = 117 +pkg syscall (netbsd-386), const DLT_PFSYNC = 18 +pkg syscall (netbsd-386), const DLT_PPI = 192 +pkg syscall (netbsd-386), const DLT_PPP = 9 +pkg syscall (netbsd-386), const DLT_PPP_BSDOS = 14 +pkg syscall (netbsd-386), const DLT_PPP_ETHER = 51 +pkg syscall (netbsd-386), const DLT_PPP_PPPD = 166 +pkg syscall (netbsd-386), const DLT_PPP_SERIAL = 50 +pkg syscall (netbsd-386), const DLT_PPP_WITH_DIR = 204 +pkg syscall (netbsd-386), const DLT_PRISM_HEADER = 119 +pkg syscall (netbsd-386), const DLT_PRONET = 4 +pkg syscall (netbsd-386), const DLT_RAIF1 = 198 +pkg syscall (netbsd-386), const DLT_RAW = 12 +pkg syscall (netbsd-386), const DLT_RAWAF_MASK = 35913728 +pkg syscall (netbsd-386), const DLT_RIO = 124 +pkg syscall (netbsd-386), const DLT_SCCP = 142 +pkg syscall (netbsd-386), const DLT_SITA = 196 +pkg syscall (netbsd-386), const DLT_SLIP = 8 +pkg syscall (netbsd-386), const DLT_SLIP_BSDOS = 13 +pkg syscall (netbsd-386), const DLT_SUNATM = 123 +pkg syscall (netbsd-386), const DLT_SYMANTEC_FIREWALL = 99 +pkg syscall (netbsd-386), const DLT_TZSP = 128 +pkg syscall (netbsd-386), const DLT_USB = 186 +pkg syscall (netbsd-386), const DLT_USB_LINUX = 189 +pkg syscall (netbsd-386), const DLT_USB_LINUX_MMAPPED = 220 +pkg syscall (netbsd-386), const DLT_WIHART = 223 +pkg syscall (netbsd-386), const DLT_X2E_SERIAL = 213 +pkg syscall (netbsd-386), const DLT_X2E_XORAYA = 214 +pkg syscall (netbsd-386), const DT_BLK = 6 +pkg syscall (netbsd-386), const DT_CHR = 2 +pkg syscall (netbsd-386), const DT_DIR = 4 +pkg syscall (netbsd-386), const DT_FIFO = 1 +pkg syscall (netbsd-386), const DT_LNK = 10 +pkg syscall (netbsd-386), const DT_REG = 8 +pkg syscall (netbsd-386), const DT_SOCK = 12 +pkg syscall (netbsd-386), const DT_UNKNOWN = 0 +pkg syscall (netbsd-386), const DT_WHT = 14 +pkg syscall (netbsd-386), const E2BIG = 7 +pkg syscall (netbsd-386), const EACCES = 13 +pkg syscall (netbsd-386), const EADDRINUSE = 48 +pkg syscall (netbsd-386), const EADDRNOTAVAIL = 49 +pkg syscall (netbsd-386), const EAFNOSUPPORT = 47 +pkg syscall (netbsd-386), const EAGAIN = 35 +pkg syscall (netbsd-386), const EALREADY = 37 +pkg syscall (netbsd-386), const EAUTH = 80 +pkg syscall (netbsd-386), const EBADF = 9 +pkg syscall (netbsd-386), const EBADMSG = 88 +pkg syscall (netbsd-386), const EBADRPC = 72 +pkg syscall (netbsd-386), const EBUSY = 16 +pkg syscall (netbsd-386), const ECANCELED = 87 +pkg syscall (netbsd-386), const ECHILD = 10 +pkg syscall (netbsd-386), const ECHO = 8 +pkg syscall (netbsd-386), const ECHOCTL = 64 +pkg syscall (netbsd-386), const ECHOE = 2 +pkg syscall (netbsd-386), const ECHOK = 4 +pkg syscall (netbsd-386), const ECHOKE = 1 +pkg syscall (netbsd-386), const ECHONL = 16 +pkg syscall (netbsd-386), const ECHOPRT = 32 +pkg syscall (netbsd-386), const ECONNABORTED = 53 +pkg syscall (netbsd-386), const ECONNREFUSED = 61 +pkg syscall (netbsd-386), const ECONNRESET = 54 +pkg syscall (netbsd-386), const EDEADLK = 11 +pkg syscall (netbsd-386), const EDESTADDRREQ = 39 +pkg syscall (netbsd-386), const EDOM = 33 +pkg syscall (netbsd-386), const EDQUOT = 69 +pkg syscall (netbsd-386), const EEXIST = 17 +pkg syscall (netbsd-386), const EFAULT = 14 +pkg syscall (netbsd-386), const EFBIG = 27 +pkg syscall (netbsd-386), const EFTYPE = 79 +pkg syscall (netbsd-386), const EHOSTDOWN = 64 +pkg syscall (netbsd-386), const EHOSTUNREACH = 65 +pkg syscall (netbsd-386), const EIDRM = 82 +pkg syscall (netbsd-386), const EILSEQ = 85 +pkg syscall (netbsd-386), const EINPROGRESS = 36 +pkg syscall (netbsd-386), const EINTR = 4 +pkg syscall (netbsd-386), const EINVAL = 22 +pkg syscall (netbsd-386), const EIO = 5 +pkg syscall (netbsd-386), const EISCONN = 56 +pkg syscall (netbsd-386), const EISDIR = 21 +pkg syscall (netbsd-386), const ELAST = 96 +pkg syscall (netbsd-386), const ELOOP = 62 +pkg syscall (netbsd-386), const EMFILE = 24 +pkg syscall (netbsd-386), const EMLINK = 31 +pkg syscall (netbsd-386), const EMSGSIZE = 40 +pkg syscall (netbsd-386), const EMULTIHOP = 94 +pkg syscall (netbsd-386), const EMUL_LINUX = 1 +pkg syscall (netbsd-386), const EMUL_LINUX32 = 5 +pkg syscall (netbsd-386), const EMUL_MAXID = 6 +pkg syscall (netbsd-386), const ENAMETOOLONG = 63 +pkg syscall (netbsd-386), const ENEEDAUTH = 81 +pkg syscall (netbsd-386), const ENETDOWN = 50 +pkg syscall (netbsd-386), const ENETRESET = 52 +pkg syscall (netbsd-386), const ENETUNREACH = 51 +pkg syscall (netbsd-386), const ENFILE = 23 +pkg syscall (netbsd-386), const ENOATTR = 93 +pkg syscall (netbsd-386), const ENOBUFS = 55 +pkg syscall (netbsd-386), const ENODATA = 89 +pkg syscall (netbsd-386), const ENODEV = 19 +pkg syscall (netbsd-386), const ENOEXEC = 8 +pkg syscall (netbsd-386), const ENOLCK = 77 +pkg syscall (netbsd-386), const ENOLINK = 95 +pkg syscall (netbsd-386), const ENOMEM = 12 +pkg syscall (netbsd-386), const ENOMSG = 83 +pkg syscall (netbsd-386), const ENOPROTOOPT = 42 +pkg syscall (netbsd-386), const ENOSPC = 28 +pkg syscall (netbsd-386), const ENOSR = 90 +pkg syscall (netbsd-386), const ENOSTR = 91 +pkg syscall (netbsd-386), const ENOSYS = 78 +pkg syscall (netbsd-386), const ENOTBLK = 15 +pkg syscall (netbsd-386), const ENOTCONN = 57 +pkg syscall (netbsd-386), const ENOTDIR = 20 +pkg syscall (netbsd-386), const ENOTEMPTY = 66 +pkg syscall (netbsd-386), const ENOTSOCK = 38 +pkg syscall (netbsd-386), const ENOTSUP = 86 +pkg syscall (netbsd-386), const ENOTTY = 25 +pkg syscall (netbsd-386), const ENXIO = 6 +pkg syscall (netbsd-386), const EN_SW_CTL_INF = 4096 +pkg syscall (netbsd-386), const EN_SW_CTL_PREC = 768 +pkg syscall (netbsd-386), const EN_SW_CTL_ROUND = 3072 +pkg syscall (netbsd-386), const EN_SW_DATACHAIN = 128 +pkg syscall (netbsd-386), const EN_SW_DENORM = 2 +pkg syscall (netbsd-386), const EN_SW_INVOP = 1 +pkg syscall (netbsd-386), const EN_SW_OVERFLOW = 8 +pkg syscall (netbsd-386), const EN_SW_PRECLOSS = 32 +pkg syscall (netbsd-386), const EN_SW_UNDERFLOW = 16 +pkg syscall (netbsd-386), const EN_SW_ZERODIV = 4 +pkg syscall (netbsd-386), const EOPNOTSUPP = 45 +pkg syscall (netbsd-386), const EOVERFLOW = 84 +pkg syscall (netbsd-386), const EPERM = 1 +pkg syscall (netbsd-386), const EPFNOSUPPORT = 46 +pkg syscall (netbsd-386), const EPIPE = 32 +pkg syscall (netbsd-386), const EPROCLIM = 67 +pkg syscall (netbsd-386), const EPROCUNAVAIL = 76 +pkg syscall (netbsd-386), const EPROGMISMATCH = 75 +pkg syscall (netbsd-386), const EPROGUNAVAIL = 74 +pkg syscall (netbsd-386), const EPROTO = 96 +pkg syscall (netbsd-386), const EPROTONOSUPPORT = 43 +pkg syscall (netbsd-386), const EPROTOTYPE = 41 +pkg syscall (netbsd-386), const ERANGE = 34 +pkg syscall (netbsd-386), const EREMOTE = 71 +pkg syscall (netbsd-386), const EROFS = 30 +pkg syscall (netbsd-386), const ERPCMISMATCH = 73 +pkg syscall (netbsd-386), const ESHUTDOWN = 58 +pkg syscall (netbsd-386), const ESOCKTNOSUPPORT = 44 +pkg syscall (netbsd-386), const ESPIPE = 29 +pkg syscall (netbsd-386), const ESRCH = 3 +pkg syscall (netbsd-386), const ESTALE = 70 +pkg syscall (netbsd-386), const ETHERCAP_JUMBO_MTU = 4 +pkg syscall (netbsd-386), const ETHERCAP_VLAN_HWTAGGING = 2 +pkg syscall (netbsd-386), const ETHERCAP_VLAN_MTU = 1 +pkg syscall (netbsd-386), const ETHERMIN = 46 +pkg syscall (netbsd-386), const ETHERMTU = 1500 +pkg syscall (netbsd-386), const ETHERMTU_JUMBO = 9000 +pkg syscall (netbsd-386), const ETHERTYPE_8023 = 4 +pkg syscall (netbsd-386), const ETHERTYPE_AARP = 33011 +pkg syscall (netbsd-386), const ETHERTYPE_ACCTON = 33680 +pkg syscall (netbsd-386), const ETHERTYPE_AEONIC = 32822 +pkg syscall (netbsd-386), const ETHERTYPE_ALPHA = 33098 +pkg syscall (netbsd-386), const ETHERTYPE_AMBER = 24584 +pkg syscall (netbsd-386), const ETHERTYPE_AMOEBA = 33093 +pkg syscall (netbsd-386), const ETHERTYPE_APOLLO = 33015 +pkg syscall (netbsd-386), const ETHERTYPE_APOLLODOMAIN = 32793 +pkg syscall (netbsd-386), const ETHERTYPE_APPLETALK = 32923 +pkg syscall (netbsd-386), const ETHERTYPE_APPLITEK = 32967 +pkg syscall (netbsd-386), const ETHERTYPE_ARGONAUT = 32826 +pkg syscall (netbsd-386), const ETHERTYPE_ARP = 2054 +pkg syscall (netbsd-386), const ETHERTYPE_AT = 32923 +pkg syscall (netbsd-386), const ETHERTYPE_ATALK = 32923 +pkg syscall (netbsd-386), const ETHERTYPE_ATOMIC = 34527 +pkg syscall (netbsd-386), const ETHERTYPE_ATT = 32873 +pkg syscall (netbsd-386), const ETHERTYPE_ATTSTANFORD = 32776 +pkg syscall (netbsd-386), const ETHERTYPE_AUTOPHON = 32874 +pkg syscall (netbsd-386), const ETHERTYPE_AXIS = 34902 +pkg syscall (netbsd-386), const ETHERTYPE_BCLOOP = 36867 +pkg syscall (netbsd-386), const ETHERTYPE_BOFL = 33026 +pkg syscall (netbsd-386), const ETHERTYPE_CABLETRON = 28724 +pkg syscall (netbsd-386), const ETHERTYPE_CHAOS = 2052 +pkg syscall (netbsd-386), const ETHERTYPE_COMDESIGN = 32876 +pkg syscall (netbsd-386), const ETHERTYPE_COMPUGRAPHIC = 32877 +pkg syscall (netbsd-386), const ETHERTYPE_COUNTERPOINT = 32866 +pkg syscall (netbsd-386), const ETHERTYPE_CRONUS = 32772 +pkg syscall (netbsd-386), const ETHERTYPE_CRONUSVLN = 32771 +pkg syscall (netbsd-386), const ETHERTYPE_DCA = 4660 +pkg syscall (netbsd-386), const ETHERTYPE_DDE = 32891 +pkg syscall (netbsd-386), const ETHERTYPE_DEBNI = 43690 +pkg syscall (netbsd-386), const ETHERTYPE_DECAM = 32840 +pkg syscall (netbsd-386), const ETHERTYPE_DECCUST = 24582 +pkg syscall (netbsd-386), const ETHERTYPE_DECDIAG = 24581 +pkg syscall (netbsd-386), const ETHERTYPE_DECDNS = 32828 +pkg syscall (netbsd-386), const ETHERTYPE_DECDTS = 32830 +pkg syscall (netbsd-386), const ETHERTYPE_DECEXPER = 24576 +pkg syscall (netbsd-386), const ETHERTYPE_DECLAST = 32833 +pkg syscall (netbsd-386), const ETHERTYPE_DECLTM = 32831 +pkg syscall (netbsd-386), const ETHERTYPE_DECMUMPS = 24585 +pkg syscall (netbsd-386), const ETHERTYPE_DECNETBIOS = 32832 +pkg syscall (netbsd-386), const ETHERTYPE_DELTACON = 34526 +pkg syscall (netbsd-386), const ETHERTYPE_DIDDLE = 17185 +pkg syscall (netbsd-386), const ETHERTYPE_DLOG1 = 1632 +pkg syscall (netbsd-386), const ETHERTYPE_DLOG2 = 1633 +pkg syscall (netbsd-386), const ETHERTYPE_DN = 24579 +pkg syscall (netbsd-386), const ETHERTYPE_DOGFIGHT = 6537 +pkg syscall (netbsd-386), const ETHERTYPE_DSMD = 32825 +pkg syscall (netbsd-386), const ETHERTYPE_ECMA = 2051 +pkg syscall (netbsd-386), const ETHERTYPE_ENCRYPT = 32829 +pkg syscall (netbsd-386), const ETHERTYPE_ES = 32861 +pkg syscall (netbsd-386), const ETHERTYPE_EXCELAN = 32784 +pkg syscall (netbsd-386), const ETHERTYPE_EXPERDATA = 32841 +pkg syscall (netbsd-386), const ETHERTYPE_FLIP = 33094 +pkg syscall (netbsd-386), const ETHERTYPE_FLOWCONTROL = 34824 +pkg syscall (netbsd-386), const ETHERTYPE_FRARP = 2056 +pkg syscall (netbsd-386), const ETHERTYPE_GENDYN = 32872 +pkg syscall (netbsd-386), const ETHERTYPE_HAYES = 33072 +pkg syscall (netbsd-386), const ETHERTYPE_HIPPI_FP = 33152 +pkg syscall (netbsd-386), const ETHERTYPE_HITACHI = 34848 +pkg syscall (netbsd-386), const ETHERTYPE_HP = 32773 +pkg syscall (netbsd-386), const ETHERTYPE_IEEEPUP = 2560 +pkg syscall (netbsd-386), const ETHERTYPE_IEEEPUPAT = 2561 +pkg syscall (netbsd-386), const ETHERTYPE_IMLBL = 19522 +pkg syscall (netbsd-386), const ETHERTYPE_IMLBLDIAG = 16972 +pkg syscall (netbsd-386), const ETHERTYPE_IP = 2048 +pkg syscall (netbsd-386), const ETHERTYPE_IPAS = 34668 +pkg syscall (netbsd-386), const ETHERTYPE_IPV6 = 34525 +pkg syscall (netbsd-386), const ETHERTYPE_IPX = 33079 +pkg syscall (netbsd-386), const ETHERTYPE_IPXNEW = 32823 +pkg syscall (netbsd-386), const ETHERTYPE_KALPANA = 34178 +pkg syscall (netbsd-386), const ETHERTYPE_LANBRIDGE = 32824 +pkg syscall (netbsd-386), const ETHERTYPE_LANPROBE = 34952 +pkg syscall (netbsd-386), const ETHERTYPE_LAT = 24580 +pkg syscall (netbsd-386), const ETHERTYPE_LBACK = 36864 +pkg syscall (netbsd-386), const ETHERTYPE_LITTLE = 32864 +pkg syscall (netbsd-386), const ETHERTYPE_LOGICRAFT = 33096 +pkg syscall (netbsd-386), const ETHERTYPE_LOOPBACK = 36864 +pkg syscall (netbsd-386), const ETHERTYPE_MATRA = 32890 +pkg syscall (netbsd-386), const ETHERTYPE_MAX = 65535 +pkg syscall (netbsd-386), const ETHERTYPE_MERIT = 32892 +pkg syscall (netbsd-386), const ETHERTYPE_MICP = 34618 +pkg syscall (netbsd-386), const ETHERTYPE_MOPDL = 24577 +pkg syscall (netbsd-386), const ETHERTYPE_MOPRC = 24578 +pkg syscall (netbsd-386), const ETHERTYPE_MOTOROLA = 33165 +pkg syscall (netbsd-386), const ETHERTYPE_MPLS = 34887 +pkg syscall (netbsd-386), const ETHERTYPE_MPLS_MCAST = 34888 +pkg syscall (netbsd-386), const ETHERTYPE_MUMPS = 33087 +pkg syscall (netbsd-386), const ETHERTYPE_NBPCC = 15364 +pkg syscall (netbsd-386), const ETHERTYPE_NBPCLAIM = 15369 +pkg syscall (netbsd-386), const ETHERTYPE_NBPCLREQ = 15365 +pkg syscall (netbsd-386), const ETHERTYPE_NBPCLRSP = 15366 +pkg syscall (netbsd-386), const ETHERTYPE_NBPCREQ = 15362 +pkg syscall (netbsd-386), const ETHERTYPE_NBPCRSP = 15363 +pkg syscall (netbsd-386), const ETHERTYPE_NBPDG = 15367 +pkg syscall (netbsd-386), const ETHERTYPE_NBPDGB = 15368 +pkg syscall (netbsd-386), const ETHERTYPE_NBPDLTE = 15370 +pkg syscall (netbsd-386), const ETHERTYPE_NBPRAR = 15372 +pkg syscall (netbsd-386), const ETHERTYPE_NBPRAS = 15371 +pkg syscall (netbsd-386), const ETHERTYPE_NBPRST = 15373 +pkg syscall (netbsd-386), const ETHERTYPE_NBPSCD = 15361 +pkg syscall (netbsd-386), const ETHERTYPE_NBPVCD = 15360 +pkg syscall (netbsd-386), const ETHERTYPE_NBS = 2050 +pkg syscall (netbsd-386), const ETHERTYPE_NCD = 33097 +pkg syscall (netbsd-386), const ETHERTYPE_NESTAR = 32774 +pkg syscall (netbsd-386), const ETHERTYPE_NETBEUI = 33169 +pkg syscall (netbsd-386), const ETHERTYPE_NOVELL = 33080 +pkg syscall (netbsd-386), const ETHERTYPE_NS = 1536 +pkg syscall (netbsd-386), const ETHERTYPE_NSAT = 1537 +pkg syscall (netbsd-386), const ETHERTYPE_NSCOMPAT = 2055 +pkg syscall (netbsd-386), const ETHERTYPE_NTRAILER = 16 +pkg syscall (netbsd-386), const ETHERTYPE_OS9 = 28679 +pkg syscall (netbsd-386), const ETHERTYPE_OS9NET = 28681 +pkg syscall (netbsd-386), const ETHERTYPE_PACER = 32966 +pkg syscall (netbsd-386), const ETHERTYPE_PAE = 34958 +pkg syscall (netbsd-386), const ETHERTYPE_PCS = 16962 +pkg syscall (netbsd-386), const ETHERTYPE_PLANNING = 32836 +pkg syscall (netbsd-386), const ETHERTYPE_PPP = 34827 +pkg syscall (netbsd-386), const ETHERTYPE_PPPOE = 34916 +pkg syscall (netbsd-386), const ETHERTYPE_PPPOEDISC = 34915 +pkg syscall (netbsd-386), const ETHERTYPE_PRIMENTS = 28721 +pkg syscall (netbsd-386), const ETHERTYPE_PUP = 512 +pkg syscall (netbsd-386), const ETHERTYPE_PUPAT = 512 +pkg syscall (netbsd-386), const ETHERTYPE_RACAL = 28720 +pkg syscall (netbsd-386), const ETHERTYPE_RATIONAL = 33104 +pkg syscall (netbsd-386), const ETHERTYPE_RAWFR = 25945 +pkg syscall (netbsd-386), const ETHERTYPE_RCL = 6549 +pkg syscall (netbsd-386), const ETHERTYPE_RDP = 34617 +pkg syscall (netbsd-386), const ETHERTYPE_RETIX = 33010 +pkg syscall (netbsd-386), const ETHERTYPE_REVARP = 32821 +pkg syscall (netbsd-386), const ETHERTYPE_SCA = 24583 +pkg syscall (netbsd-386), const ETHERTYPE_SECTRA = 34523 +pkg syscall (netbsd-386), const ETHERTYPE_SECUREDATA = 34669 +pkg syscall (netbsd-386), const ETHERTYPE_SGITW = 33150 +pkg syscall (netbsd-386), const ETHERTYPE_SG_BOUNCE = 32790 +pkg syscall (netbsd-386), const ETHERTYPE_SG_DIAG = 32787 +pkg syscall (netbsd-386), const ETHERTYPE_SG_NETGAMES = 32788 +pkg syscall (netbsd-386), const ETHERTYPE_SG_RESV = 32789 +pkg syscall (netbsd-386), const ETHERTYPE_SIMNET = 21000 +pkg syscall (netbsd-386), const ETHERTYPE_SLOWPROTOCOLS = 34825 +pkg syscall (netbsd-386), const ETHERTYPE_SNA = 32981 +pkg syscall (netbsd-386), const ETHERTYPE_SNMP = 33100 +pkg syscall (netbsd-386), const ETHERTYPE_SONIX = 64245 +pkg syscall (netbsd-386), const ETHERTYPE_SPIDER = 32927 +pkg syscall (netbsd-386), const ETHERTYPE_SPRITE = 1280 +pkg syscall (netbsd-386), const ETHERTYPE_STP = 33153 +pkg syscall (netbsd-386), const ETHERTYPE_TALARIS = 33067 +pkg syscall (netbsd-386), const ETHERTYPE_TALARISMC = 34091 +pkg syscall (netbsd-386), const ETHERTYPE_TCPCOMP = 34667 +pkg syscall (netbsd-386), const ETHERTYPE_TCPSM = 36866 +pkg syscall (netbsd-386), const ETHERTYPE_TEC = 33103 +pkg syscall (netbsd-386), const ETHERTYPE_TIGAN = 32815 +pkg syscall (netbsd-386), const ETHERTYPE_TRAIL = 4096 +pkg syscall (netbsd-386), const ETHERTYPE_TRANSETHER = 25944 +pkg syscall (netbsd-386), const ETHERTYPE_TYMSHARE = 32814 +pkg syscall (netbsd-386), const ETHERTYPE_UBBST = 28677 +pkg syscall (netbsd-386), const ETHERTYPE_UBDEBUG = 2304 +pkg syscall (netbsd-386), const ETHERTYPE_UBDIAGLOOP = 28674 +pkg syscall (netbsd-386), const ETHERTYPE_UBDL = 28672 +pkg syscall (netbsd-386), const ETHERTYPE_UBNIU = 28673 +pkg syscall (netbsd-386), const ETHERTYPE_UBNMC = 28675 +pkg syscall (netbsd-386), const ETHERTYPE_VALID = 5632 +pkg syscall (netbsd-386), const ETHERTYPE_VARIAN = 32989 +pkg syscall (netbsd-386), const ETHERTYPE_VAXELN = 32827 +pkg syscall (netbsd-386), const ETHERTYPE_VEECO = 32871 +pkg syscall (netbsd-386), const ETHERTYPE_VEXP = 32859 +pkg syscall (netbsd-386), const ETHERTYPE_VGLAB = 33073 +pkg syscall (netbsd-386), const ETHERTYPE_VINES = 2989 +pkg syscall (netbsd-386), const ETHERTYPE_VINESECHO = 2991 +pkg syscall (netbsd-386), const ETHERTYPE_VINESLOOP = 2990 +pkg syscall (netbsd-386), const ETHERTYPE_VITAL = 65280 +pkg syscall (netbsd-386), const ETHERTYPE_VLAN = 33024 +pkg syscall (netbsd-386), const ETHERTYPE_VLTLMAN = 32896 +pkg syscall (netbsd-386), const ETHERTYPE_VPROD = 32860 +pkg syscall (netbsd-386), const ETHERTYPE_VURESERVED = 33095 +pkg syscall (netbsd-386), const ETHERTYPE_WATERLOO = 33072 +pkg syscall (netbsd-386), const ETHERTYPE_WELLFLEET = 33027 +pkg syscall (netbsd-386), const ETHERTYPE_X25 = 2053 +pkg syscall (netbsd-386), const ETHERTYPE_X75 = 2049 +pkg syscall (netbsd-386), const ETHERTYPE_XNSSM = 36865 +pkg syscall (netbsd-386), const ETHERTYPE_XTP = 33149 +pkg syscall (netbsd-386), const ETHER_ADDR_LEN = 6 +pkg syscall (netbsd-386), const ETHER_CRC_LEN = 4 +pkg syscall (netbsd-386), const ETHER_CRC_POLY_BE = 79764918 +pkg syscall (netbsd-386), const ETHER_CRC_POLY_LE = 3988292384 +pkg syscall (netbsd-386), const ETHER_HDR_LEN = 14 +pkg syscall (netbsd-386), const ETHER_MAX_LEN = 1518 +pkg syscall (netbsd-386), const ETHER_MAX_LEN_JUMBO = 9018 +pkg syscall (netbsd-386), const ETHER_MIN_LEN = 64 +pkg syscall (netbsd-386), const ETHER_PPPOE_ENCAP_LEN = 8 +pkg syscall (netbsd-386), const ETHER_TYPE_LEN = 2 +pkg syscall (netbsd-386), const ETHER_VLAN_ENCAP_LEN = 4 +pkg syscall (netbsd-386), const ETIME = 92 +pkg syscall (netbsd-386), const ETIMEDOUT = 60 +pkg syscall (netbsd-386), const ETOOMANYREFS = 59 +pkg syscall (netbsd-386), const ETXTBSY = 26 +pkg syscall (netbsd-386), const EUSERS = 68 +pkg syscall (netbsd-386), const EVFILT_AIO = 2 +pkg syscall (netbsd-386), const EVFILT_PROC = 4 +pkg syscall (netbsd-386), const EVFILT_READ = 0 +pkg syscall (netbsd-386), const EVFILT_SIGNAL = 5 +pkg syscall (netbsd-386), const EVFILT_SYSCOUNT = 7 +pkg syscall (netbsd-386), const EVFILT_TIMER = 6 +pkg syscall (netbsd-386), const EVFILT_VNODE = 3 +pkg syscall (netbsd-386), const EVFILT_WRITE = 1 +pkg syscall (netbsd-386), const EV_ADD = 1 +pkg syscall (netbsd-386), const EV_CLEAR = 32 +pkg syscall (netbsd-386), const EV_DELETE = 2 +pkg syscall (netbsd-386), const EV_DISABLE = 8 +pkg syscall (netbsd-386), const EV_ENABLE = 4 +pkg syscall (netbsd-386), const EV_EOF = 32768 +pkg syscall (netbsd-386), const EV_ERROR = 16384 +pkg syscall (netbsd-386), const EV_FLAG1 = 8192 +pkg syscall (netbsd-386), const EV_ONESHOT = 16 +pkg syscall (netbsd-386), const EV_SYSFLAGS = 61440 +pkg syscall (netbsd-386), const EWOULDBLOCK = 35 +pkg syscall (netbsd-386), const EXDEV = 18 +pkg syscall (netbsd-386), const EXTA = 19200 +pkg syscall (netbsd-386), const EXTB = 38400 +pkg syscall (netbsd-386), const EXTPROC = 2048 +pkg syscall (netbsd-386), const FD_CLOEXEC = 1 +pkg syscall (netbsd-386), const FD_SETSIZE = 256 +pkg syscall (netbsd-386), const FLUSHO = 8388608 +pkg syscall (netbsd-386), const F_CLOSEM = 10 +pkg syscall (netbsd-386), const F_DUPFD = 0 +pkg syscall (netbsd-386), const F_DUPFD_CLOEXEC = 12 +pkg syscall (netbsd-386), const F_FSCTL = -2147483648 +pkg syscall (netbsd-386), const F_FSDIRMASK = 1879048192 +pkg syscall (netbsd-386), const F_FSIN = 268435456 +pkg syscall (netbsd-386), const F_FSINOUT = 805306368 +pkg syscall (netbsd-386), const F_FSOUT = 536870912 +pkg syscall (netbsd-386), const F_FSPRIV = 32768 +pkg syscall (netbsd-386), const F_FSVOID = 1073741824 +pkg syscall (netbsd-386), const F_GETFD = 1 +pkg syscall (netbsd-386), const F_GETFL = 3 +pkg syscall (netbsd-386), const F_GETLK = 7 +pkg syscall (netbsd-386), const F_GETNOSIGPIPE = 13 +pkg syscall (netbsd-386), const F_GETOWN = 5 +pkg syscall (netbsd-386), const F_MAXFD = 11 +pkg syscall (netbsd-386), const F_OK = 0 +pkg syscall (netbsd-386), const F_PARAM_MASK = 4095 +pkg syscall (netbsd-386), const F_PARAM_MAX = 4095 +pkg syscall (netbsd-386), const F_RDLCK = 1 +pkg syscall (netbsd-386), const F_SETFD = 2 +pkg syscall (netbsd-386), const F_SETFL = 4 +pkg syscall (netbsd-386), const F_SETLK = 8 +pkg syscall (netbsd-386), const F_SETLKW = 9 +pkg syscall (netbsd-386), const F_SETNOSIGPIPE = 14 +pkg syscall (netbsd-386), const F_SETOWN = 6 +pkg syscall (netbsd-386), const F_UNLCK = 2 +pkg syscall (netbsd-386), const F_WRLCK = 3 +pkg syscall (netbsd-386), const HUPCL = 16384 +pkg syscall (netbsd-386), const ICANON = 256 +pkg syscall (netbsd-386), const ICRNL = 256 +pkg syscall (netbsd-386), const IEXTEN = 1024 +pkg syscall (netbsd-386), const IFAN_ARRIVAL = 0 +pkg syscall (netbsd-386), const IFAN_DEPARTURE = 1 +pkg syscall (netbsd-386), const IFA_ROUTE = 1 +pkg syscall (netbsd-386), const IFF_ALLMULTI = 512 +pkg syscall (netbsd-386), const IFF_CANTCHANGE = 36690 +pkg syscall (netbsd-386), const IFF_DEBUG = 4 +pkg syscall (netbsd-386), const IFF_LINK0 = 4096 +pkg syscall (netbsd-386), const IFF_LINK1 = 8192 +pkg syscall (netbsd-386), const IFF_LINK2 = 16384 +pkg syscall (netbsd-386), const IFF_LOOPBACK = 8 +pkg syscall (netbsd-386), const IFF_MULTICAST = 32768 +pkg syscall (netbsd-386), const IFF_NOARP = 128 +pkg syscall (netbsd-386), const IFF_NOTRAILERS = 32 +pkg syscall (netbsd-386), const IFF_OACTIVE = 1024 +pkg syscall (netbsd-386), const IFF_POINTOPOINT = 16 +pkg syscall (netbsd-386), const IFF_PROMISC = 256 +pkg syscall (netbsd-386), const IFF_RUNNING = 64 +pkg syscall (netbsd-386), const IFF_SIMPLEX = 2048 +pkg syscall (netbsd-386), const IFNAMSIZ = 16 +pkg syscall (netbsd-386), const IFT_1822 = 2 +pkg syscall (netbsd-386), const IFT_A12MPPSWITCH = 130 +pkg syscall (netbsd-386), const IFT_AAL2 = 187 +pkg syscall (netbsd-386), const IFT_AAL5 = 49 +pkg syscall (netbsd-386), const IFT_ADSL = 94 +pkg syscall (netbsd-386), const IFT_AFLANE8023 = 59 +pkg syscall (netbsd-386), const IFT_AFLANE8025 = 60 +pkg syscall (netbsd-386), const IFT_ARAP = 88 +pkg syscall (netbsd-386), const IFT_ARCNET = 35 +pkg syscall (netbsd-386), const IFT_ARCNETPLUS = 36 +pkg syscall (netbsd-386), const IFT_ASYNC = 84 +pkg syscall (netbsd-386), const IFT_ATM = 37 +pkg syscall (netbsd-386), const IFT_ATMDXI = 105 +pkg syscall (netbsd-386), const IFT_ATMFUNI = 106 +pkg syscall (netbsd-386), const IFT_ATMIMA = 107 +pkg syscall (netbsd-386), const IFT_ATMLOGICAL = 80 +pkg syscall (netbsd-386), const IFT_ATMRADIO = 189 +pkg syscall (netbsd-386), const IFT_ATMSUBINTERFACE = 134 +pkg syscall (netbsd-386), const IFT_ATMVCIENDPT = 194 +pkg syscall (netbsd-386), const IFT_ATMVIRTUAL = 149 +pkg syscall (netbsd-386), const IFT_BGPPOLICYACCOUNTING = 162 +pkg syscall (netbsd-386), const IFT_BRIDGE = 209 +pkg syscall (netbsd-386), const IFT_BSC = 83 +pkg syscall (netbsd-386), const IFT_CARP = 248 +pkg syscall (netbsd-386), const IFT_CCTEMUL = 61 +pkg syscall (netbsd-386), const IFT_CEPT = 19 +pkg syscall (netbsd-386), const IFT_CES = 133 +pkg syscall (netbsd-386), const IFT_CHANNEL = 70 +pkg syscall (netbsd-386), const IFT_CNR = 85 +pkg syscall (netbsd-386), const IFT_COFFEE = 132 +pkg syscall (netbsd-386), const IFT_COMPOSITELINK = 155 +pkg syscall (netbsd-386), const IFT_DCN = 141 +pkg syscall (netbsd-386), const IFT_DIGITALPOWERLINE = 138 +pkg syscall (netbsd-386), const IFT_DIGITALWRAPPEROVERHEADCHANNEL = 186 +pkg syscall (netbsd-386), const IFT_DLSW = 74 +pkg syscall (netbsd-386), const IFT_DOCSCABLEDOWNSTREAM = 128 +pkg syscall (netbsd-386), const IFT_DOCSCABLEMACLAYER = 127 +pkg syscall (netbsd-386), const IFT_DOCSCABLEUPSTREAM = 129 +pkg syscall (netbsd-386), const IFT_DOCSCABLEUPSTREAMCHANNEL = 205 +pkg syscall (netbsd-386), const IFT_DS0 = 81 +pkg syscall (netbsd-386), const IFT_DS0BUNDLE = 82 +pkg syscall (netbsd-386), const IFT_DS1FDL = 170 +pkg syscall (netbsd-386), const IFT_DS3 = 30 +pkg syscall (netbsd-386), const IFT_DTM = 140 +pkg syscall (netbsd-386), const IFT_DVBASILN = 172 +pkg syscall (netbsd-386), const IFT_DVBASIOUT = 173 +pkg syscall (netbsd-386), const IFT_DVBRCCDOWNSTREAM = 147 +pkg syscall (netbsd-386), const IFT_DVBRCCMACLAYER = 146 +pkg syscall (netbsd-386), const IFT_DVBRCCUPSTREAM = 148 +pkg syscall (netbsd-386), const IFT_ECONET = 206 +pkg syscall (netbsd-386), const IFT_EON = 25 +pkg syscall (netbsd-386), const IFT_EPLRS = 87 +pkg syscall (netbsd-386), const IFT_ESCON = 73 +pkg syscall (netbsd-386), const IFT_ETHER = 6 +pkg syscall (netbsd-386), const IFT_FAITH = 242 +pkg syscall (netbsd-386), const IFT_FAST = 125 +pkg syscall (netbsd-386), const IFT_FASTETHER = 62 +pkg syscall (netbsd-386), const IFT_FASTETHERFX = 69 +pkg syscall (netbsd-386), const IFT_FDDI = 15 +pkg syscall (netbsd-386), const IFT_FIBRECHANNEL = 56 +pkg syscall (netbsd-386), const IFT_FRAMERELAYINTERCONNECT = 58 +pkg syscall (netbsd-386), const IFT_FRAMERELAYMPI = 92 +pkg syscall (netbsd-386), const IFT_FRDLCIENDPT = 193 +pkg syscall (netbsd-386), const IFT_FRELAY = 32 +pkg syscall (netbsd-386), const IFT_FRELAYDCE = 44 +pkg syscall (netbsd-386), const IFT_FRF16MFRBUNDLE = 163 +pkg syscall (netbsd-386), const IFT_FRFORWARD = 158 +pkg syscall (netbsd-386), const IFT_G703AT2MB = 67 +pkg syscall (netbsd-386), const IFT_G703AT64K = 66 +pkg syscall (netbsd-386), const IFT_GIF = 240 +pkg syscall (netbsd-386), const IFT_GIGABITETHERNET = 117 +pkg syscall (netbsd-386), const IFT_GR303IDT = 178 +pkg syscall (netbsd-386), const IFT_GR303RDT = 177 +pkg syscall (netbsd-386), const IFT_H323GATEKEEPER = 164 +pkg syscall (netbsd-386), const IFT_H323PROXY = 165 +pkg syscall (netbsd-386), const IFT_HDH1822 = 3 +pkg syscall (netbsd-386), const IFT_HDLC = 118 +pkg syscall (netbsd-386), const IFT_HDSL2 = 168 +pkg syscall (netbsd-386), const IFT_HIPERLAN2 = 183 +pkg syscall (netbsd-386), const IFT_HIPPI = 47 +pkg syscall (netbsd-386), const IFT_HIPPIINTERFACE = 57 +pkg syscall (netbsd-386), const IFT_HOSTPAD = 90 +pkg syscall (netbsd-386), const IFT_HSSI = 46 +pkg syscall (netbsd-386), const IFT_HY = 14 +pkg syscall (netbsd-386), const IFT_IBM370PARCHAN = 72 +pkg syscall (netbsd-386), const IFT_IDSL = 154 +pkg syscall (netbsd-386), const IFT_IEEE1394 = 144 +pkg syscall (netbsd-386), const IFT_IEEE80211 = 71 +pkg syscall (netbsd-386), const IFT_IEEE80212 = 55 +pkg syscall (netbsd-386), const IFT_IEEE8023ADLAG = 161 +pkg syscall (netbsd-386), const IFT_IFGSN = 145 +pkg syscall (netbsd-386), const IFT_IMT = 190 +pkg syscall (netbsd-386), const IFT_INFINIBAND = 199 +pkg syscall (netbsd-386), const IFT_INTERLEAVE = 124 +pkg syscall (netbsd-386), const IFT_IP = 126 +pkg syscall (netbsd-386), const IFT_IPFORWARD = 142 +pkg syscall (netbsd-386), const IFT_IPOVERATM = 114 +pkg syscall (netbsd-386), const IFT_IPOVERCDLC = 109 +pkg syscall (netbsd-386), const IFT_IPOVERCLAW = 110 +pkg syscall (netbsd-386), const IFT_IPSWITCH = 78 +pkg syscall (netbsd-386), const IFT_ISDN = 63 +pkg syscall (netbsd-386), const IFT_ISDNBASIC = 20 +pkg syscall (netbsd-386), const IFT_ISDNPRIMARY = 21 +pkg syscall (netbsd-386), const IFT_ISDNS = 75 +pkg syscall (netbsd-386), const IFT_ISDNU = 76 +pkg syscall (netbsd-386), const IFT_ISO88022LLC = 41 +pkg syscall (netbsd-386), const IFT_ISO88023 = 7 +pkg syscall (netbsd-386), const IFT_ISO88024 = 8 +pkg syscall (netbsd-386), const IFT_ISO88025 = 9 +pkg syscall (netbsd-386), const IFT_ISO88025CRFPINT = 98 +pkg syscall (netbsd-386), const IFT_ISO88025DTR = 86 +pkg syscall (netbsd-386), const IFT_ISO88025FIBER = 115 +pkg syscall (netbsd-386), const IFT_ISO88026 = 10 +pkg syscall (netbsd-386), const IFT_ISUP = 179 +pkg syscall (netbsd-386), const IFT_L2VLAN = 135 +pkg syscall (netbsd-386), const IFT_L3IPVLAN = 136 +pkg syscall (netbsd-386), const IFT_L3IPXVLAN = 137 +pkg syscall (netbsd-386), const IFT_LAPB = 16 +pkg syscall (netbsd-386), const IFT_LAPD = 77 +pkg syscall (netbsd-386), const IFT_LAPF = 119 +pkg syscall (netbsd-386), const IFT_LINEGROUP = 210 +pkg syscall (netbsd-386), const IFT_LOCALTALK = 42 +pkg syscall (netbsd-386), const IFT_LOOP = 24 +pkg syscall (netbsd-386), const IFT_MEDIAMAILOVERIP = 139 +pkg syscall (netbsd-386), const IFT_MFSIGLINK = 167 +pkg syscall (netbsd-386), const IFT_MIOX25 = 38 +pkg syscall (netbsd-386), const IFT_MODEM = 48 +pkg syscall (netbsd-386), const IFT_MPC = 113 +pkg syscall (netbsd-386), const IFT_MPLS = 166 +pkg syscall (netbsd-386), const IFT_MPLSTUNNEL = 150 +pkg syscall (netbsd-386), const IFT_MSDSL = 143 +pkg syscall (netbsd-386), const IFT_MVL = 191 +pkg syscall (netbsd-386), const IFT_MYRINET = 99 +pkg syscall (netbsd-386), const IFT_NFAS = 175 +pkg syscall (netbsd-386), const IFT_NSIP = 27 +pkg syscall (netbsd-386), const IFT_OPTICALCHANNEL = 195 +pkg syscall (netbsd-386), const IFT_OPTICALTRANSPORT = 196 +pkg syscall (netbsd-386), const IFT_OTHER = 1 +pkg syscall (netbsd-386), const IFT_P10 = 12 +pkg syscall (netbsd-386), const IFT_P80 = 13 +pkg syscall (netbsd-386), const IFT_PARA = 34 +pkg syscall (netbsd-386), const IFT_PFLOG = 245 +pkg syscall (netbsd-386), const IFT_PFSYNC = 246 +pkg syscall (netbsd-386), const IFT_PLC = 174 +pkg syscall (netbsd-386), const IFT_PON155 = 207 +pkg syscall (netbsd-386), const IFT_PON622 = 208 +pkg syscall (netbsd-386), const IFT_POS = 171 +pkg syscall (netbsd-386), const IFT_PPP = 23 +pkg syscall (netbsd-386), const IFT_PPPMULTILINKBUNDLE = 108 +pkg syscall (netbsd-386), const IFT_PROPATM = 197 +pkg syscall (netbsd-386), const IFT_PROPBWAP2MP = 184 +pkg syscall (netbsd-386), const IFT_PROPCNLS = 89 +pkg syscall (netbsd-386), const IFT_PROPDOCSWIRELESSDOWNSTREAM = 181 +pkg syscall (netbsd-386), const IFT_PROPDOCSWIRELESSMACLAYER = 180 +pkg syscall (netbsd-386), const IFT_PROPDOCSWIRELESSUPSTREAM = 182 +pkg syscall (netbsd-386), const IFT_PROPMUX = 54 +pkg syscall (netbsd-386), const IFT_PROPVIRTUAL = 53 +pkg syscall (netbsd-386), const IFT_PROPWIRELESSP2P = 157 +pkg syscall (netbsd-386), const IFT_PTPSERIAL = 22 +pkg syscall (netbsd-386), const IFT_PVC = 241 +pkg syscall (netbsd-386), const IFT_Q2931 = 201 +pkg syscall (netbsd-386), const IFT_QLLC = 68 +pkg syscall (netbsd-386), const IFT_RADIOMAC = 188 +pkg syscall (netbsd-386), const IFT_RADSL = 95 +pkg syscall (netbsd-386), const IFT_REACHDSL = 192 +pkg syscall (netbsd-386), const IFT_RFC1483 = 159 +pkg syscall (netbsd-386), const IFT_RS232 = 33 +pkg syscall (netbsd-386), const IFT_RSRB = 79 +pkg syscall (netbsd-386), const IFT_SDLC = 17 +pkg syscall (netbsd-386), const IFT_SDSL = 96 +pkg syscall (netbsd-386), const IFT_SHDSL = 169 +pkg syscall (netbsd-386), const IFT_SIP = 31 +pkg syscall (netbsd-386), const IFT_SIPSIG = 204 +pkg syscall (netbsd-386), const IFT_SIPTG = 203 +pkg syscall (netbsd-386), const IFT_SLIP = 28 +pkg syscall (netbsd-386), const IFT_SMDSDXI = 43 +pkg syscall (netbsd-386), const IFT_SMDSICIP = 52 +pkg syscall (netbsd-386), const IFT_SONET = 39 +pkg syscall (netbsd-386), const IFT_SONETOVERHEADCHANNEL = 185 +pkg syscall (netbsd-386), const IFT_SONETPATH = 50 +pkg syscall (netbsd-386), const IFT_SONETVT = 51 +pkg syscall (netbsd-386), const IFT_SRP = 151 +pkg syscall (netbsd-386), const IFT_SS7SIGLINK = 156 +pkg syscall (netbsd-386), const IFT_STACKTOSTACK = 111 +pkg syscall (netbsd-386), const IFT_STARLAN = 11 +pkg syscall (netbsd-386), const IFT_STF = 215 +pkg syscall (netbsd-386), const IFT_T1 = 18 +pkg syscall (netbsd-386), const IFT_TDLC = 116 +pkg syscall (netbsd-386), const IFT_TELINK = 200 +pkg syscall (netbsd-386), const IFT_TERMPAD = 91 +pkg syscall (netbsd-386), const IFT_TR008 = 176 +pkg syscall (netbsd-386), const IFT_TRANSPHDLC = 123 +pkg syscall (netbsd-386), const IFT_TUNNEL = 131 +pkg syscall (netbsd-386), const IFT_ULTRA = 29 +pkg syscall (netbsd-386), const IFT_USB = 160 +pkg syscall (netbsd-386), const IFT_V11 = 64 +pkg syscall (netbsd-386), const IFT_V35 = 45 +pkg syscall (netbsd-386), const IFT_V36 = 65 +pkg syscall (netbsd-386), const IFT_V37 = 120 +pkg syscall (netbsd-386), const IFT_VDSL = 97 +pkg syscall (netbsd-386), const IFT_VIRTUALIPADDRESS = 112 +pkg syscall (netbsd-386), const IFT_VIRTUALTG = 202 +pkg syscall (netbsd-386), const IFT_VOICEDID = 213 +pkg syscall (netbsd-386), const IFT_VOICEEM = 100 +pkg syscall (netbsd-386), const IFT_VOICEEMFGD = 211 +pkg syscall (netbsd-386), const IFT_VOICEENCAP = 103 +pkg syscall (netbsd-386), const IFT_VOICEFGDEANA = 212 +pkg syscall (netbsd-386), const IFT_VOICEFXO = 101 +pkg syscall (netbsd-386), const IFT_VOICEFXS = 102 +pkg syscall (netbsd-386), const IFT_VOICEOVERATM = 152 +pkg syscall (netbsd-386), const IFT_VOICEOVERCABLE = 198 +pkg syscall (netbsd-386), const IFT_VOICEOVERFRAMERELAY = 153 +pkg syscall (netbsd-386), const IFT_VOICEOVERIP = 104 +pkg syscall (netbsd-386), const IFT_X213 = 93 +pkg syscall (netbsd-386), const IFT_X25 = 5 +pkg syscall (netbsd-386), const IFT_X25DDN = 4 +pkg syscall (netbsd-386), const IFT_X25HUNTGROUP = 122 +pkg syscall (netbsd-386), const IFT_X25MLP = 121 +pkg syscall (netbsd-386), const IFT_X25PLE = 40 +pkg syscall (netbsd-386), const IFT_XETHER = 26 +pkg syscall (netbsd-386), const IGNBRK = 1 +pkg syscall (netbsd-386), const IGNCR = 128 +pkg syscall (netbsd-386), const IGNPAR = 4 +pkg syscall (netbsd-386), const IMAXBEL = 8192 +pkg syscall (netbsd-386), const INLCR = 64 +pkg syscall (netbsd-386), const INPCK = 16 +pkg syscall (netbsd-386), const IN_CLASSA_HOST = 16777215 +pkg syscall (netbsd-386), const IN_CLASSA_MAX = 128 +pkg syscall (netbsd-386), const IN_CLASSA_NET = 4278190080 +pkg syscall (netbsd-386), const IN_CLASSA_NSHIFT = 24 +pkg syscall (netbsd-386), const IN_CLASSB_HOST = 65535 +pkg syscall (netbsd-386), const IN_CLASSB_MAX = 65536 +pkg syscall (netbsd-386), const IN_CLASSB_NET = 4294901760 +pkg syscall (netbsd-386), const IN_CLASSB_NSHIFT = 16 +pkg syscall (netbsd-386), const IN_CLASSC_HOST = 255 +pkg syscall (netbsd-386), const IN_CLASSC_NET = 4294967040 +pkg syscall (netbsd-386), const IN_CLASSC_NSHIFT = 8 +pkg syscall (netbsd-386), const IN_CLASSD_HOST = 268435455 +pkg syscall (netbsd-386), const IN_CLASSD_NET = 4026531840 +pkg syscall (netbsd-386), const IN_CLASSD_NSHIFT = 28 +pkg syscall (netbsd-386), const IN_LOOPBACKNET = 127 +pkg syscall (netbsd-386), const IPPROTO_AH = 51 +pkg syscall (netbsd-386), const IPPROTO_CARP = 112 +pkg syscall (netbsd-386), const IPPROTO_DONE = 257 +pkg syscall (netbsd-386), const IPPROTO_DSTOPTS = 60 +pkg syscall (netbsd-386), const IPPROTO_EGP = 8 +pkg syscall (netbsd-386), const IPPROTO_ENCAP = 98 +pkg syscall (netbsd-386), const IPPROTO_EON = 80 +pkg syscall (netbsd-386), const IPPROTO_ESP = 50 +pkg syscall (netbsd-386), const IPPROTO_ETHERIP = 97 +pkg syscall (netbsd-386), const IPPROTO_FRAGMENT = 44 +pkg syscall (netbsd-386), const IPPROTO_GGP = 3 +pkg syscall (netbsd-386), const IPPROTO_GRE = 47 +pkg syscall (netbsd-386), const IPPROTO_HOPOPTS = 0 +pkg syscall (netbsd-386), const IPPROTO_ICMP = 1 +pkg syscall (netbsd-386), const IPPROTO_ICMPV6 = 58 +pkg syscall (netbsd-386), const IPPROTO_IDP = 22 +pkg syscall (netbsd-386), const IPPROTO_IGMP = 2 +pkg syscall (netbsd-386), const IPPROTO_IPCOMP = 108 +pkg syscall (netbsd-386), const IPPROTO_IPIP = 4 +pkg syscall (netbsd-386), const IPPROTO_IPV4 = 4 +pkg syscall (netbsd-386), const IPPROTO_IPV6_ICMP = 58 +pkg syscall (netbsd-386), const IPPROTO_MAX = 256 +pkg syscall (netbsd-386), const IPPROTO_MAXID = 52 +pkg syscall (netbsd-386), const IPPROTO_MOBILE = 55 +pkg syscall (netbsd-386), const IPPROTO_NONE = 59 +pkg syscall (netbsd-386), const IPPROTO_PFSYNC = 240 +pkg syscall (netbsd-386), const IPPROTO_PIM = 103 +pkg syscall (netbsd-386), const IPPROTO_PUP = 12 +pkg syscall (netbsd-386), const IPPROTO_RAW = 255 +pkg syscall (netbsd-386), const IPPROTO_ROUTING = 43 +pkg syscall (netbsd-386), const IPPROTO_RSVP = 46 +pkg syscall (netbsd-386), const IPPROTO_TP = 29 +pkg syscall (netbsd-386), const IPPROTO_VRRP = 112 +pkg syscall (netbsd-386), const IPV6_CHECKSUM = 26 +pkg syscall (netbsd-386), const IPV6_DEFAULT_MULTICAST_HOPS = 1 +pkg syscall (netbsd-386), const IPV6_DEFAULT_MULTICAST_LOOP = 1 +pkg syscall (netbsd-386), const IPV6_DEFHLIM = 64 +pkg syscall (netbsd-386), const IPV6_DONTFRAG = 62 +pkg syscall (netbsd-386), const IPV6_DSTOPTS = 50 +pkg syscall (netbsd-386), const IPV6_FAITH = 29 +pkg syscall (netbsd-386), const IPV6_FLOWINFO_MASK = 4294967055 +pkg syscall (netbsd-386), const IPV6_FLOWLABEL_MASK = 4294905600 +pkg syscall (netbsd-386), const IPV6_FRAGTTL = 120 +pkg syscall (netbsd-386), const IPV6_HLIMDEC = 1 +pkg syscall (netbsd-386), const IPV6_HOPLIMIT = 47 +pkg syscall (netbsd-386), const IPV6_HOPOPTS = 49 +pkg syscall (netbsd-386), const IPV6_IPSEC_POLICY = 28 +pkg syscall (netbsd-386), const IPV6_JOIN_GROUP = 12 +pkg syscall (netbsd-386), const IPV6_LEAVE_GROUP = 13 +pkg syscall (netbsd-386), const IPV6_MAXHLIM = 255 +pkg syscall (netbsd-386), const IPV6_MAXPACKET = 65535 +pkg syscall (netbsd-386), const IPV6_MMTU = 1280 +pkg syscall (netbsd-386), const IPV6_MULTICAST_HOPS = 10 +pkg syscall (netbsd-386), const IPV6_MULTICAST_IF = 9 +pkg syscall (netbsd-386), const IPV6_MULTICAST_LOOP = 11 +pkg syscall (netbsd-386), const IPV6_NEXTHOP = 48 +pkg syscall (netbsd-386), const IPV6_PATHMTU = 44 +pkg syscall (netbsd-386), const IPV6_PKTINFO = 46 +pkg syscall (netbsd-386), const IPV6_PORTRANGE = 14 +pkg syscall (netbsd-386), const IPV6_PORTRANGE_DEFAULT = 0 +pkg syscall (netbsd-386), const IPV6_PORTRANGE_HIGH = 1 +pkg syscall (netbsd-386), const IPV6_PORTRANGE_LOW = 2 +pkg syscall (netbsd-386), const IPV6_RECVDSTOPTS = 40 +pkg syscall (netbsd-386), const IPV6_RECVHOPLIMIT = 37 +pkg syscall (netbsd-386), const IPV6_RECVHOPOPTS = 39 +pkg syscall (netbsd-386), const IPV6_RECVPATHMTU = 43 +pkg syscall (netbsd-386), const IPV6_RECVPKTINFO = 36 +pkg syscall (netbsd-386), const IPV6_RECVRTHDR = 38 +pkg syscall (netbsd-386), const IPV6_RECVTCLASS = 57 +pkg syscall (netbsd-386), const IPV6_RTHDR = 51 +pkg syscall (netbsd-386), const IPV6_RTHDRDSTOPTS = 35 +pkg syscall (netbsd-386), const IPV6_RTHDR_LOOSE = 0 +pkg syscall (netbsd-386), const IPV6_RTHDR_STRICT = 1 +pkg syscall (netbsd-386), const IPV6_RTHDR_TYPE_0 = 0 +pkg syscall (netbsd-386), const IPV6_SOCKOPT_RESERVED1 = 3 +pkg syscall (netbsd-386), const IPV6_TCLASS = 61 +pkg syscall (netbsd-386), const IPV6_UNICAST_HOPS = 4 +pkg syscall (netbsd-386), const IPV6_USE_MIN_MTU = 42 +pkg syscall (netbsd-386), const IPV6_V6ONLY = 27 +pkg syscall (netbsd-386), const IPV6_VERSION = 96 +pkg syscall (netbsd-386), const IPV6_VERSION_MASK = 240 +pkg syscall (netbsd-386), const IP_ADD_MEMBERSHIP = 12 +pkg syscall (netbsd-386), const IP_DEFAULT_MULTICAST_LOOP = 1 +pkg syscall (netbsd-386), const IP_DEFAULT_MULTICAST_TTL = 1 +pkg syscall (netbsd-386), const IP_DF = 16384 +pkg syscall (netbsd-386), const IP_DROP_MEMBERSHIP = 13 +pkg syscall (netbsd-386), const IP_EF = 32768 +pkg syscall (netbsd-386), const IP_ERRORMTU = 21 +pkg syscall (netbsd-386), const IP_HDRINCL = 2 +pkg syscall (netbsd-386), const IP_IPSEC_POLICY = 22 +pkg syscall (netbsd-386), const IP_MAXPACKET = 65535 +pkg syscall (netbsd-386), const IP_MAX_MEMBERSHIPS = 20 +pkg syscall (netbsd-386), const IP_MF = 8192 +pkg syscall (netbsd-386), const IP_MINFRAGSIZE = 69 +pkg syscall (netbsd-386), const IP_MINTTL = 24 +pkg syscall (netbsd-386), const IP_MSS = 576 +pkg syscall (netbsd-386), const IP_MULTICAST_IF = 9 +pkg syscall (netbsd-386), const IP_MULTICAST_LOOP = 11 +pkg syscall (netbsd-386), const IP_MULTICAST_TTL = 10 +pkg syscall (netbsd-386), const IP_OFFMASK = 8191 +pkg syscall (netbsd-386), const IP_OPTIONS = 1 +pkg syscall (netbsd-386), const IP_PORTRANGE = 19 +pkg syscall (netbsd-386), const IP_PORTRANGE_DEFAULT = 0 +pkg syscall (netbsd-386), const IP_PORTRANGE_HIGH = 1 +pkg syscall (netbsd-386), const IP_PORTRANGE_LOW = 2 +pkg syscall (netbsd-386), const IP_RECVDSTADDR = 7 +pkg syscall (netbsd-386), const IP_RECVIF = 20 +pkg syscall (netbsd-386), const IP_RECVOPTS = 5 +pkg syscall (netbsd-386), const IP_RECVRETOPTS = 6 +pkg syscall (netbsd-386), const IP_RECVTTL = 23 +pkg syscall (netbsd-386), const IP_RETOPTS = 8 +pkg syscall (netbsd-386), const IP_RF = 32768 +pkg syscall (netbsd-386), const IP_TOS = 3 +pkg syscall (netbsd-386), const IP_TTL = 4 +pkg syscall (netbsd-386), const ISIG = 128 +pkg syscall (netbsd-386), const ISTRIP = 32 +pkg syscall (netbsd-386), const IXANY = 2048 +pkg syscall (netbsd-386), const IXOFF = 1024 +pkg syscall (netbsd-386), const IXON = 512 +pkg syscall (netbsd-386), const ImplementsGetwd = false +pkg syscall (netbsd-386), const LOCK_EX = 2 +pkg syscall (netbsd-386), const LOCK_NB = 4 +pkg syscall (netbsd-386), const LOCK_SH = 1 +pkg syscall (netbsd-386), const LOCK_UN = 8 +pkg syscall (netbsd-386), const MSG_BCAST = 256 +pkg syscall (netbsd-386), const MSG_CMSG_CLOEXEC = 2048 +pkg syscall (netbsd-386), const MSG_CONTROLMBUF = 33554432 +pkg syscall (netbsd-386), const MSG_CTRUNC = 32 +pkg syscall (netbsd-386), const MSG_DONTROUTE = 4 +pkg syscall (netbsd-386), const MSG_DONTWAIT = 128 +pkg syscall (netbsd-386), const MSG_EOR = 8 +pkg syscall (netbsd-386), const MSG_IOVUSRSPACE = 67108864 +pkg syscall (netbsd-386), const MSG_LENUSRSPACE = 134217728 +pkg syscall (netbsd-386), const MSG_MCAST = 512 +pkg syscall (netbsd-386), const MSG_NAMEMBUF = 16777216 +pkg syscall (netbsd-386), const MSG_NBIO = 4096 +pkg syscall (netbsd-386), const MSG_NOSIGNAL = 1024 +pkg syscall (netbsd-386), const MSG_OOB = 1 +pkg syscall (netbsd-386), const MSG_PEEK = 2 +pkg syscall (netbsd-386), const MSG_TRUNC = 16 +pkg syscall (netbsd-386), const MSG_USERFLAGS = 16777215 +pkg syscall (netbsd-386), const MSG_WAITALL = 64 +pkg syscall (netbsd-386), const NAME_MAX = 511 +pkg syscall (netbsd-386), const NET_RT_DUMP = 1 +pkg syscall (netbsd-386), const NET_RT_FLAGS = 2 +pkg syscall (netbsd-386), const NET_RT_IFLIST = 5 +pkg syscall (netbsd-386), const NET_RT_MAXID = 6 +pkg syscall (netbsd-386), const NET_RT_OIFLIST = 4 +pkg syscall (netbsd-386), const NET_RT_OOIFLIST = 3 +pkg syscall (netbsd-386), const NOFLSH = 2147483648 +pkg syscall (netbsd-386), const NOTE_ATTRIB = 8 +pkg syscall (netbsd-386), const NOTE_CHILD = 4 +pkg syscall (netbsd-386), const NOTE_DELETE = 1 +pkg syscall (netbsd-386), const NOTE_EXEC = 536870912 +pkg syscall (netbsd-386), const NOTE_EXIT = 2147483648 +pkg syscall (netbsd-386), const NOTE_EXTEND = 4 +pkg syscall (netbsd-386), const NOTE_FORK = 1073741824 +pkg syscall (netbsd-386), const NOTE_LINK = 16 +pkg syscall (netbsd-386), const NOTE_LOWAT = 1 +pkg syscall (netbsd-386), const NOTE_PCTRLMASK = 4026531840 +pkg syscall (netbsd-386), const NOTE_PDATAMASK = 1048575 +pkg syscall (netbsd-386), const NOTE_RENAME = 32 +pkg syscall (netbsd-386), const NOTE_REVOKE = 64 +pkg syscall (netbsd-386), const NOTE_TRACK = 1 +pkg syscall (netbsd-386), const NOTE_TRACKERR = 2 +pkg syscall (netbsd-386), const NOTE_WRITE = 2 +pkg syscall (netbsd-386), const OCRNL = 16 +pkg syscall (netbsd-386), const OFIOGETBMAP = 3221513850 +pkg syscall (netbsd-386), const ONLCR = 2 +pkg syscall (netbsd-386), const ONLRET = 64 +pkg syscall (netbsd-386), const ONOCR = 32 +pkg syscall (netbsd-386), const ONOEOT = 8 +pkg syscall (netbsd-386), const OPOST = 1 +pkg syscall (netbsd-386), const O_ACCMODE = 3 +pkg syscall (netbsd-386), const O_ALT_IO = 262144 +pkg syscall (netbsd-386), const O_APPEND = 8 +pkg syscall (netbsd-386), const O_ASYNC = 64 +pkg syscall (netbsd-386), const O_CLOEXEC = 4194304 +pkg syscall (netbsd-386), const O_CREAT = 512 +pkg syscall (netbsd-386), const O_DIRECT = 524288 +pkg syscall (netbsd-386), const O_DIRECTORY = 2097152 +pkg syscall (netbsd-386), const O_DSYNC = 65536 +pkg syscall (netbsd-386), const O_EXCL = 2048 +pkg syscall (netbsd-386), const O_EXLOCK = 32 +pkg syscall (netbsd-386), const O_FSYNC = 128 +pkg syscall (netbsd-386), const O_NDELAY = 4 +pkg syscall (netbsd-386), const O_NOCTTY = 32768 +pkg syscall (netbsd-386), const O_NOFOLLOW = 256 +pkg syscall (netbsd-386), const O_NONBLOCK = 4 +pkg syscall (netbsd-386), const O_NOSIGPIPE = 16777216 +pkg syscall (netbsd-386), const O_RSYNC = 131072 +pkg syscall (netbsd-386), const O_SHLOCK = 16 +pkg syscall (netbsd-386), const O_SYNC = 128 +pkg syscall (netbsd-386), const O_TRUNC = 1024 +pkg syscall (netbsd-386), const PARENB = 4096 +pkg syscall (netbsd-386), const PARMRK = 8 +pkg syscall (netbsd-386), const PARODD = 8192 +pkg syscall (netbsd-386), const PENDIN = 536870912 +pkg syscall (netbsd-386), const PRI_IOFLUSH = 124 +pkg syscall (netbsd-386), const PTRACE_CONT = 7 +pkg syscall (netbsd-386), const PTRACE_KILL = 8 +pkg syscall (netbsd-386), const PTRACE_TRACEME = 0 +pkg syscall (netbsd-386), const RLIMIT_AS = 10 +pkg syscall (netbsd-386), const RLIMIT_CORE = 4 +pkg syscall (netbsd-386), const RLIMIT_CPU = 0 +pkg syscall (netbsd-386), const RLIMIT_DATA = 2 +pkg syscall (netbsd-386), const RLIMIT_FSIZE = 1 +pkg syscall (netbsd-386), const RLIMIT_NOFILE = 8 +pkg syscall (netbsd-386), const RLIMIT_STACK = 3 +pkg syscall (netbsd-386), const RLIM_INFINITY = 9223372036854775807 +pkg syscall (netbsd-386), const RTAX_AUTHOR = 6 +pkg syscall (netbsd-386), const RTAX_BRD = 7 +pkg syscall (netbsd-386), const RTAX_DST = 0 +pkg syscall (netbsd-386), const RTAX_GATEWAY = 1 +pkg syscall (netbsd-386), const RTAX_GENMASK = 3 +pkg syscall (netbsd-386), const RTAX_IFA = 5 +pkg syscall (netbsd-386), const RTAX_IFP = 4 +pkg syscall (netbsd-386), const RTAX_MAX = 9 +pkg syscall (netbsd-386), const RTAX_NETMASK = 2 +pkg syscall (netbsd-386), const RTAX_TAG = 8 +pkg syscall (netbsd-386), const RTA_AUTHOR = 64 +pkg syscall (netbsd-386), const RTA_BRD = 128 +pkg syscall (netbsd-386), const RTA_DST = 1 +pkg syscall (netbsd-386), const RTA_GATEWAY = 2 +pkg syscall (netbsd-386), const RTA_GENMASK = 8 +pkg syscall (netbsd-386), const RTA_IFA = 32 +pkg syscall (netbsd-386), const RTA_IFP = 16 +pkg syscall (netbsd-386), const RTA_NETMASK = 4 +pkg syscall (netbsd-386), const RTA_TAG = 256 +pkg syscall (netbsd-386), const RTF_ANNOUNCE = 131072 +pkg syscall (netbsd-386), const RTF_BLACKHOLE = 4096 +pkg syscall (netbsd-386), const RTF_CLONED = 8192 +pkg syscall (netbsd-386), const RTF_CLONING = 256 +pkg syscall (netbsd-386), const RTF_DONE = 64 +pkg syscall (netbsd-386), const RTF_DYNAMIC = 16 +pkg syscall (netbsd-386), const RTF_GATEWAY = 2 +pkg syscall (netbsd-386), const RTF_HOST = 4 +pkg syscall (netbsd-386), const RTF_LLINFO = 1024 +pkg syscall (netbsd-386), const RTF_MASK = 128 +pkg syscall (netbsd-386), const RTF_MODIFIED = 32 +pkg syscall (netbsd-386), const RTF_PROTO1 = 32768 +pkg syscall (netbsd-386), const RTF_PROTO2 = 16384 +pkg syscall (netbsd-386), const RTF_REJECT = 8 +pkg syscall (netbsd-386), const RTF_SRC = 65536 +pkg syscall (netbsd-386), const RTF_STATIC = 2048 +pkg syscall (netbsd-386), const RTF_UP = 1 +pkg syscall (netbsd-386), const RTF_XRESOLVE = 512 +pkg syscall (netbsd-386), const RTM_ADD = 1 +pkg syscall (netbsd-386), const RTM_CHANGE = 3 +pkg syscall (netbsd-386), const RTM_CHGADDR = 21 +pkg syscall (netbsd-386), const RTM_DELADDR = 13 +pkg syscall (netbsd-386), const RTM_DELETE = 2 +pkg syscall (netbsd-386), const RTM_GET = 4 +pkg syscall (netbsd-386), const RTM_IEEE80211 = 17 +pkg syscall (netbsd-386), const RTM_IFANNOUNCE = 16 +pkg syscall (netbsd-386), const RTM_IFINFO = 20 +pkg syscall (netbsd-386), const RTM_LLINFO_UPD = 19 +pkg syscall (netbsd-386), const RTM_LOCK = 8 +pkg syscall (netbsd-386), const RTM_LOSING = 5 +pkg syscall (netbsd-386), const RTM_MISS = 7 +pkg syscall (netbsd-386), const RTM_NEWADDR = 12 +pkg syscall (netbsd-386), const RTM_OIFINFO = 15 +pkg syscall (netbsd-386), const RTM_OLDADD = 9 +pkg syscall (netbsd-386), const RTM_OLDDEL = 10 +pkg syscall (netbsd-386), const RTM_OOIFINFO = 14 +pkg syscall (netbsd-386), const RTM_REDIRECT = 6 +pkg syscall (netbsd-386), const RTM_RESOLVE = 11 +pkg syscall (netbsd-386), const RTM_RTTUNIT = 1000000 +pkg syscall (netbsd-386), const RTM_SETGATE = 18 +pkg syscall (netbsd-386), const RTM_VERSION = 4 +pkg syscall (netbsd-386), const RTV_EXPIRE = 4 +pkg syscall (netbsd-386), const RTV_HOPCOUNT = 2 +pkg syscall (netbsd-386), const RTV_MTU = 1 +pkg syscall (netbsd-386), const RTV_RPIPE = 8 +pkg syscall (netbsd-386), const RTV_RTT = 64 +pkg syscall (netbsd-386), const RTV_RTTVAR = 128 +pkg syscall (netbsd-386), const RTV_SPIPE = 16 +pkg syscall (netbsd-386), const RTV_SSTHRESH = 32 +pkg syscall (netbsd-386), const RUSAGE_CHILDREN = -1 +pkg syscall (netbsd-386), const RUSAGE_SELF = 0 +pkg syscall (netbsd-386), const SCM_CREDS = 4 +pkg syscall (netbsd-386), const SCM_RIGHTS = 1 +pkg syscall (netbsd-386), const SCM_TIMESTAMP = 8 +pkg syscall (netbsd-386), const SIGBUS = 10 +pkg syscall (netbsd-386), const SIGCHLD = 20 +pkg syscall (netbsd-386), const SIGCONT = 19 +pkg syscall (netbsd-386), const SIGEMT = 7 +pkg syscall (netbsd-386), const SIGINFO = 29 +pkg syscall (netbsd-386), const SIGIO = 23 +pkg syscall (netbsd-386), const SIGIOT = 6 +pkg syscall (netbsd-386), const SIGPROF = 27 +pkg syscall (netbsd-386), const SIGPWR = 32 +pkg syscall (netbsd-386), const SIGSTOP = 17 +pkg syscall (netbsd-386), const SIGSYS = 12 +pkg syscall (netbsd-386), const SIGTSTP = 18 +pkg syscall (netbsd-386), const SIGTTIN = 21 +pkg syscall (netbsd-386), const SIGTTOU = 22 +pkg syscall (netbsd-386), const SIGURG = 16 +pkg syscall (netbsd-386), const SIGUSR1 = 30 +pkg syscall (netbsd-386), const SIGUSR2 = 31 +pkg syscall (netbsd-386), const SIGVTALRM = 26 +pkg syscall (netbsd-386), const SIGWINCH = 28 +pkg syscall (netbsd-386), const SIGXCPU = 24 +pkg syscall (netbsd-386), const SIGXFSZ = 25 +pkg syscall (netbsd-386), const SIOCADDMULTI = 2156947761 +pkg syscall (netbsd-386), const SIOCADDRT = 2150658570 +pkg syscall (netbsd-386), const SIOCAIFADDR = 2151704858 +pkg syscall (netbsd-386), const SIOCALIFADDR = 2165860636 +pkg syscall (netbsd-386), const SIOCATMARK = 1074033415 +pkg syscall (netbsd-386), const SIOCDELMULTI = 2156947762 +pkg syscall (netbsd-386), const SIOCDELRT = 2150658571 +pkg syscall (netbsd-386), const SIOCDIFADDR = 2156947737 +pkg syscall (netbsd-386), const SIOCDIFPHYADDR = 2156947785 +pkg syscall (netbsd-386), const SIOCDLIFADDR = 2165860638 +pkg syscall (netbsd-386), const SIOCGDRVSPEC = 3223087483 +pkg syscall (netbsd-386), const SIOCGETPFSYNC = 3230689784 +pkg syscall (netbsd-386), const SIOCGETSGCNT = 3222566196 +pkg syscall (netbsd-386), const SIOCGETVIFCNT = 3222566195 +pkg syscall (netbsd-386), const SIOCGHIWAT = 1074033409 +pkg syscall (netbsd-386), const SIOCGIFADDR = 3230689569 +pkg syscall (netbsd-386), const SIOCGIFADDRPREF = 3230951712 +pkg syscall (netbsd-386), const SIOCGIFALIAS = 3225446683 +pkg syscall (netbsd-386), const SIOCGIFBRDADDR = 3230689571 +pkg syscall (netbsd-386), const SIOCGIFCAP = 3223349622 +pkg syscall (netbsd-386), const SIOCGIFCONF = 3221776678 +pkg syscall (netbsd-386), const SIOCGIFDATA = 3230951813 +pkg syscall (netbsd-386), const SIOCGIFDLT = 3230689655 +pkg syscall (netbsd-386), const SIOCGIFDSTADDR = 3230689570 +pkg syscall (netbsd-386), const SIOCGIFFLAGS = 3230689553 +pkg syscall (netbsd-386), const SIOCGIFGENERIC = 3230689594 +pkg syscall (netbsd-386), const SIOCGIFMEDIA = 3223873846 +pkg syscall (netbsd-386), const SIOCGIFMETRIC = 3230689559 +pkg syscall (netbsd-386), const SIOCGIFMTU = 3230689662 +pkg syscall (netbsd-386), const SIOCGIFNETMASK = 3230689573 +pkg syscall (netbsd-386), const SIOCGIFPDSTADDR = 3230689608 +pkg syscall (netbsd-386), const SIOCGIFPSRCADDR = 3230689607 +pkg syscall (netbsd-386), const SIOCGLIFADDR = 3239602461 +pkg syscall (netbsd-386), const SIOCGLIFPHYADDR = 3239602507 +pkg syscall (netbsd-386), const SIOCGLINKSTR = 3223087495 +pkg syscall (netbsd-386), const SIOCGLOWAT = 1074033411 +pkg syscall (netbsd-386), const SIOCGPGRP = 1074033417 +pkg syscall (netbsd-386), const SIOCGVH = 3230689667 +pkg syscall (netbsd-386), const SIOCIFCREATE = 2156947834 +pkg syscall (netbsd-386), const SIOCIFDESTROY = 2156947833 +pkg syscall (netbsd-386), const SIOCIFGCLONERS = 3222038904 +pkg syscall (netbsd-386), const SIOCINITIFADDR = 3225708932 +pkg syscall (netbsd-386), const SIOCSDRVSPEC = 2149345659 +pkg syscall (netbsd-386), const SIOCSETPFSYNC = 2156947959 +pkg syscall (netbsd-386), const SIOCSHIWAT = 2147775232 +pkg syscall (netbsd-386), const SIOCSIFADDR = 2156947724 +pkg syscall (netbsd-386), const SIOCSIFADDRPREF = 2157209887 +pkg syscall (netbsd-386), const SIOCSIFBRDADDR = 2156947731 +pkg syscall (netbsd-386), const SIOCSIFCAP = 2149607797 +pkg syscall (netbsd-386), const SIOCSIFDSTADDR = 2156947726 +pkg syscall (netbsd-386), const SIOCSIFFLAGS = 2156947728 +pkg syscall (netbsd-386), const SIOCSIFGENERIC = 2156947769 +pkg syscall (netbsd-386), const SIOCSIFMEDIA = 3230689589 +pkg syscall (netbsd-386), const SIOCSIFMETRIC = 2156947736 +pkg syscall (netbsd-386), const SIOCSIFMTU = 2156947839 +pkg syscall (netbsd-386), const SIOCSIFNETMASK = 2156947734 +pkg syscall (netbsd-386), const SIOCSIFPHYADDR = 2151704902 +pkg syscall (netbsd-386), const SIOCSLIFPHYADDR = 2165860682 +pkg syscall (netbsd-386), const SIOCSLINKSTR = 2149345672 +pkg syscall (netbsd-386), const SIOCSLOWAT = 2147775234 +pkg syscall (netbsd-386), const SIOCSPGRP = 2147775240 +pkg syscall (netbsd-386), const SIOCSVH = 3230689666 +pkg syscall (netbsd-386), const SIOCZIFDATA = 3230951814 +pkg syscall (netbsd-386), const SOCK_CLOEXEC = 268435456 +pkg syscall (netbsd-386), const SOCK_FLAGS_MASK = 4026531840 +pkg syscall (netbsd-386), const SOCK_NONBLOCK = 536870912 +pkg syscall (netbsd-386), const SOCK_NOSIGPIPE = 1073741824 +pkg syscall (netbsd-386), const SOCK_RDM = 4 +pkg syscall (netbsd-386), const SOL_SOCKET = 65535 +pkg syscall (netbsd-386), const SOMAXCONN = 128 +pkg syscall (netbsd-386), const SO_ACCEPTCONN = 2 +pkg syscall (netbsd-386), const SO_ACCEPTFILTER = 4096 +pkg syscall (netbsd-386), const SO_BROADCAST = 32 +pkg syscall (netbsd-386), const SO_DEBUG = 1 +pkg syscall (netbsd-386), const SO_DONTROUTE = 16 +pkg syscall (netbsd-386), const SO_ERROR = 4103 +pkg syscall (netbsd-386), const SO_KEEPALIVE = 8 +pkg syscall (netbsd-386), const SO_LINGER = 128 +pkg syscall (netbsd-386), const SO_NOHEADER = 4106 +pkg syscall (netbsd-386), const SO_NOSIGPIPE = 2048 +pkg syscall (netbsd-386), const SO_OOBINLINE = 256 +pkg syscall (netbsd-386), const SO_OVERFLOWED = 4105 +pkg syscall (netbsd-386), const SO_RCVBUF = 4098 +pkg syscall (netbsd-386), const SO_RCVLOWAT = 4100 +pkg syscall (netbsd-386), const SO_RCVTIMEO = 4108 +pkg syscall (netbsd-386), const SO_REUSEADDR = 4 +pkg syscall (netbsd-386), const SO_REUSEPORT = 512 +pkg syscall (netbsd-386), const SO_SNDBUF = 4097 +pkg syscall (netbsd-386), const SO_SNDLOWAT = 4099 +pkg syscall (netbsd-386), const SO_SNDTIMEO = 4107 +pkg syscall (netbsd-386), const SO_TIMESTAMP = 8192 +pkg syscall (netbsd-386), const SO_TYPE = 4104 +pkg syscall (netbsd-386), const SO_USELOOPBACK = 64 +pkg syscall (netbsd-386), const SYSCTL_VERSION = 16777216 +pkg syscall (netbsd-386), const SYSCTL_VERS_0 = 0 +pkg syscall (netbsd-386), const SYSCTL_VERS_1 = 16777216 +pkg syscall (netbsd-386), const SYSCTL_VERS_MASK = 4278190080 +pkg syscall (netbsd-386), const SYS_ACCEPT = 30 +pkg syscall (netbsd-386), const SYS_ACCESS = 33 +pkg syscall (netbsd-386), const SYS_ACCT = 51 +pkg syscall (netbsd-386), const SYS_ADJTIME = 421 +pkg syscall (netbsd-386), const SYS_BIND = 104 +pkg syscall (netbsd-386), const SYS_BREAK = 17 +pkg syscall (netbsd-386), const SYS_CHDIR = 12 +pkg syscall (netbsd-386), const SYS_CHFLAGS = 34 +pkg syscall (netbsd-386), const SYS_CHMOD = 15 +pkg syscall (netbsd-386), const SYS_CHOWN = 16 +pkg syscall (netbsd-386), const SYS_CHROOT = 61 +pkg syscall (netbsd-386), const SYS_CLOCK_GETRES = 429 +pkg syscall (netbsd-386), const SYS_CLOCK_GETTIME = 427 +pkg syscall (netbsd-386), const SYS_CLOCK_SETTIME = 428 +pkg syscall (netbsd-386), const SYS_CLOSE = 6 +pkg syscall (netbsd-386), const SYS_CONNECT = 98 +pkg syscall (netbsd-386), const SYS_DUP = 41 +pkg syscall (netbsd-386), const SYS_DUP2 = 90 +pkg syscall (netbsd-386), const SYS_DUP3 = 454 +pkg syscall (netbsd-386), const SYS_EXECVE = 59 +pkg syscall (netbsd-386), const SYS_EXIT = 1 +pkg syscall (netbsd-386), const SYS_EXTATTRCTL = 360 +pkg syscall (netbsd-386), const SYS_EXTATTR_DELETE_FD = 366 +pkg syscall (netbsd-386), const SYS_EXTATTR_DELETE_FILE = 363 +pkg syscall (netbsd-386), const SYS_EXTATTR_DELETE_LINK = 369 +pkg syscall (netbsd-386), const SYS_EXTATTR_GET_FD = 365 +pkg syscall (netbsd-386), const SYS_EXTATTR_GET_FILE = 362 +pkg syscall (netbsd-386), const SYS_EXTATTR_GET_LINK = 368 +pkg syscall (netbsd-386), const SYS_EXTATTR_LIST_FD = 370 +pkg syscall (netbsd-386), const SYS_EXTATTR_LIST_FILE = 371 +pkg syscall (netbsd-386), const SYS_EXTATTR_LIST_LINK = 372 +pkg syscall (netbsd-386), const SYS_EXTATTR_SET_FD = 364 +pkg syscall (netbsd-386), const SYS_EXTATTR_SET_FILE = 361 +pkg syscall (netbsd-386), const SYS_EXTATTR_SET_LINK = 367 +pkg syscall (netbsd-386), const SYS_FACCESSAT = 462 +pkg syscall (netbsd-386), const SYS_FCHDIR = 13 +pkg syscall (netbsd-386), const SYS_FCHFLAGS = 35 +pkg syscall (netbsd-386), const SYS_FCHMOD = 124 +pkg syscall (netbsd-386), const SYS_FCHMODAT = 463 +pkg syscall (netbsd-386), const SYS_FCHOWN = 123 +pkg syscall (netbsd-386), const SYS_FCHOWNAT = 464 +pkg syscall (netbsd-386), const SYS_FCHROOT = 297 +pkg syscall (netbsd-386), const SYS_FCNTL = 92 +pkg syscall (netbsd-386), const SYS_FDATASYNC = 241 +pkg syscall (netbsd-386), const SYS_FEXECVE = 465 +pkg syscall (netbsd-386), const SYS_FGETXATTR = 380 +pkg syscall (netbsd-386), const SYS_FHSTAT = 451 +pkg syscall (netbsd-386), const SYS_FKTRACE = 288 +pkg syscall (netbsd-386), const SYS_FLISTXATTR = 383 +pkg syscall (netbsd-386), const SYS_FLOCK = 131 +pkg syscall (netbsd-386), const SYS_FORK = 2 +pkg syscall (netbsd-386), const SYS_FPATHCONF = 192 +pkg syscall (netbsd-386), const SYS_FREMOVEXATTR = 386 +pkg syscall (netbsd-386), const SYS_FSETXATTR = 377 +pkg syscall (netbsd-386), const SYS_FSTAT = 440 +pkg syscall (netbsd-386), const SYS_FSTATAT = 466 +pkg syscall (netbsd-386), const SYS_FSTATVFS1 = 358 +pkg syscall (netbsd-386), const SYS_FSYNC = 95 +pkg syscall (netbsd-386), const SYS_FSYNC_RANGE = 354 +pkg syscall (netbsd-386), const SYS_FTRUNCATE = 201 +pkg syscall (netbsd-386), const SYS_FUTIMENS = 472 +pkg syscall (netbsd-386), const SYS_FUTIMES = 423 +pkg syscall (netbsd-386), const SYS_GETCONTEXT = 307 +pkg syscall (netbsd-386), const SYS_GETDENTS = 390 +pkg syscall (netbsd-386), const SYS_GETEGID = 43 +pkg syscall (netbsd-386), const SYS_GETEUID = 25 +pkg syscall (netbsd-386), const SYS_GETFH = 395 +pkg syscall (netbsd-386), const SYS_GETGID = 47 +pkg syscall (netbsd-386), const SYS_GETGROUPS = 79 +pkg syscall (netbsd-386), const SYS_GETITIMER = 426 +pkg syscall (netbsd-386), const SYS_GETPEERNAME = 31 +pkg syscall (netbsd-386), const SYS_GETPGID = 207 +pkg syscall (netbsd-386), const SYS_GETPGRP = 81 +pkg syscall (netbsd-386), const SYS_GETPID = 20 +pkg syscall (netbsd-386), const SYS_GETPPID = 39 +pkg syscall (netbsd-386), const SYS_GETPRIORITY = 100 +pkg syscall (netbsd-386), const SYS_GETRLIMIT = 194 +pkg syscall (netbsd-386), const SYS_GETRUSAGE = 445 +pkg syscall (netbsd-386), const SYS_GETSID = 286 +pkg syscall (netbsd-386), const SYS_GETSOCKNAME = 32 +pkg syscall (netbsd-386), const SYS_GETSOCKOPT = 118 +pkg syscall (netbsd-386), const SYS_GETTIMEOFDAY = 418 +pkg syscall (netbsd-386), const SYS_GETUID = 24 +pkg syscall (netbsd-386), const SYS_GETVFSSTAT = 356 +pkg syscall (netbsd-386), const SYS_GETXATTR = 378 +pkg syscall (netbsd-386), const SYS_IOCTL = 54 +pkg syscall (netbsd-386), const SYS_ISSETUGID = 305 +pkg syscall (netbsd-386), const SYS_KEVENT = 435 +pkg syscall (netbsd-386), const SYS_KILL = 37 +pkg syscall (netbsd-386), const SYS_KQUEUE = 344 +pkg syscall (netbsd-386), const SYS_KQUEUE1 = 455 +pkg syscall (netbsd-386), const SYS_KTRACE = 45 +pkg syscall (netbsd-386), const SYS_LCHFLAGS = 304 +pkg syscall (netbsd-386), const SYS_LCHMOD = 274 +pkg syscall (netbsd-386), const SYS_LCHOWN = 275 +pkg syscall (netbsd-386), const SYS_LGETXATTR = 379 +pkg syscall (netbsd-386), const SYS_LINK = 9 +pkg syscall (netbsd-386), const SYS_LINKAT = 457 +pkg syscall (netbsd-386), const SYS_LISTEN = 106 +pkg syscall (netbsd-386), const SYS_LISTXATTR = 381 +pkg syscall (netbsd-386), const SYS_LLISTXATTR = 382 +pkg syscall (netbsd-386), const SYS_LREMOVEXATTR = 385 +pkg syscall (netbsd-386), const SYS_LSEEK = 199 +pkg syscall (netbsd-386), const SYS_LSETXATTR = 376 +pkg syscall (netbsd-386), const SYS_LSTAT = 441 +pkg syscall (netbsd-386), const SYS_LUTIMES = 424 +pkg syscall (netbsd-386), const SYS_MADVISE = 75 +pkg syscall (netbsd-386), const SYS_MINCORE = 78 +pkg syscall (netbsd-386), const SYS_MINHERIT = 273 +pkg syscall (netbsd-386), const SYS_MKDIR = 136 +pkg syscall (netbsd-386), const SYS_MKDIRAT = 461 +pkg syscall (netbsd-386), const SYS_MKFIFO = 132 +pkg syscall (netbsd-386), const SYS_MKFIFOAT = 459 +pkg syscall (netbsd-386), const SYS_MKNOD = 450 +pkg syscall (netbsd-386), const SYS_MKNODAT = 460 +pkg syscall (netbsd-386), const SYS_MLOCK = 203 +pkg syscall (netbsd-386), const SYS_MLOCKALL = 242 +pkg syscall (netbsd-386), const SYS_MMAP = 197 +pkg syscall (netbsd-386), const SYS_MODCTL = 246 +pkg syscall (netbsd-386), const SYS_MOUNT = 410 +pkg syscall (netbsd-386), const SYS_MPROTECT = 74 +pkg syscall (netbsd-386), const SYS_MREMAP = 411 +pkg syscall (netbsd-386), const SYS_MSGCTL = 444 +pkg syscall (netbsd-386), const SYS_MSGGET = 225 +pkg syscall (netbsd-386), const SYS_MSGRCV = 227 +pkg syscall (netbsd-386), const SYS_MSGSND = 226 +pkg syscall (netbsd-386), const SYS_MUNLOCK = 204 +pkg syscall (netbsd-386), const SYS_MUNLOCKALL = 243 +pkg syscall (netbsd-386), const SYS_MUNMAP = 73 +pkg syscall (netbsd-386), const SYS_NANOSLEEP = 430 +pkg syscall (netbsd-386), const SYS_NTP_ADJTIME = 176 +pkg syscall (netbsd-386), const SYS_NTP_GETTIME = 448 +pkg syscall (netbsd-386), const SYS_OPEN = 5 +pkg syscall (netbsd-386), const SYS_OPENAT = 468 +pkg syscall (netbsd-386), const SYS_PACCEPT = 456 +pkg syscall (netbsd-386), const SYS_PATHCONF = 191 +pkg syscall (netbsd-386), const SYS_PIPE = 42 +pkg syscall (netbsd-386), const SYS_PIPE2 = 453 +pkg syscall (netbsd-386), const SYS_PMC_CONTROL = 342 +pkg syscall (netbsd-386), const SYS_PMC_GET_INFO = 341 +pkg syscall (netbsd-386), const SYS_POLL = 209 +pkg syscall (netbsd-386), const SYS_POLLTS = 437 +pkg syscall (netbsd-386), const SYS_POSIX_FADVISE = 416 +pkg syscall (netbsd-386), const SYS_POSIX_SPAWN = 474 +pkg syscall (netbsd-386), const SYS_PREAD = 173 +pkg syscall (netbsd-386), const SYS_PREADV = 289 +pkg syscall (netbsd-386), const SYS_PROFIL = 44 +pkg syscall (netbsd-386), const SYS_PSELECT = 436 +pkg syscall (netbsd-386), const SYS_PSET_ASSIGN = 414 +pkg syscall (netbsd-386), const SYS_PSET_CREATE = 412 +pkg syscall (netbsd-386), const SYS_PSET_DESTROY = 413 +pkg syscall (netbsd-386), const SYS_PTRACE = 26 +pkg syscall (netbsd-386), const SYS_PWRITE = 174 +pkg syscall (netbsd-386), const SYS_PWRITEV = 290 +pkg syscall (netbsd-386), const SYS_RASCTL = 343 +pkg syscall (netbsd-386), const SYS_READ = 3 +pkg syscall (netbsd-386), const SYS_READLINK = 58 +pkg syscall (netbsd-386), const SYS_READLINKAT = 469 +pkg syscall (netbsd-386), const SYS_READV = 120 +pkg syscall (netbsd-386), const SYS_REBOOT = 208 +pkg syscall (netbsd-386), const SYS_RECVFROM = 29 +pkg syscall (netbsd-386), const SYS_RECVMMSG = 475 +pkg syscall (netbsd-386), const SYS_RECVMSG = 27 +pkg syscall (netbsd-386), const SYS_REMOVEXATTR = 384 +pkg syscall (netbsd-386), const SYS_RENAME = 128 +pkg syscall (netbsd-386), const SYS_RENAMEAT = 458 +pkg syscall (netbsd-386), const SYS_REVOKE = 56 +pkg syscall (netbsd-386), const SYS_RMDIR = 137 +pkg syscall (netbsd-386), const SYS_SBRK = 69 +pkg syscall (netbsd-386), const SYS_SCHED_YIELD = 350 +pkg syscall (netbsd-386), const SYS_SELECT = 417 +pkg syscall (netbsd-386), const SYS_SEMCONFIG = 223 +pkg syscall (netbsd-386), const SYS_SEMGET = 221 +pkg syscall (netbsd-386), const SYS_SEMOP = 222 +pkg syscall (netbsd-386), const SYS_SENDMMSG = 476 +pkg syscall (netbsd-386), const SYS_SENDMSG = 28 +pkg syscall (netbsd-386), const SYS_SENDTO = 133 +pkg syscall (netbsd-386), const SYS_SETCONTEXT = 308 +pkg syscall (netbsd-386), const SYS_SETEGID = 182 +pkg syscall (netbsd-386), const SYS_SETEUID = 183 +pkg syscall (netbsd-386), const SYS_SETGID = 181 +pkg syscall (netbsd-386), const SYS_SETGROUPS = 80 +pkg syscall (netbsd-386), const SYS_SETITIMER = 425 +pkg syscall (netbsd-386), const SYS_SETPGID = 82 +pkg syscall (netbsd-386), const SYS_SETPRIORITY = 96 +pkg syscall (netbsd-386), const SYS_SETREGID = 127 +pkg syscall (netbsd-386), const SYS_SETREUID = 126 +pkg syscall (netbsd-386), const SYS_SETRLIMIT = 195 +pkg syscall (netbsd-386), const SYS_SETSID = 147 +pkg syscall (netbsd-386), const SYS_SETSOCKOPT = 105 +pkg syscall (netbsd-386), const SYS_SETTIMEOFDAY = 419 +pkg syscall (netbsd-386), const SYS_SETUID = 23 +pkg syscall (netbsd-386), const SYS_SETXATTR = 375 +pkg syscall (netbsd-386), const SYS_SHMAT = 228 +pkg syscall (netbsd-386), const SYS_SHMCTL = 443 +pkg syscall (netbsd-386), const SYS_SHMDT = 230 +pkg syscall (netbsd-386), const SYS_SHMGET = 231 +pkg syscall (netbsd-386), const SYS_SHUTDOWN = 134 +pkg syscall (netbsd-386), const SYS_SIGQUEUEINFO = 245 +pkg syscall (netbsd-386), const SYS_SOCKET = 394 +pkg syscall (netbsd-386), const SYS_SOCKETPAIR = 135 +pkg syscall (netbsd-386), const SYS_SSTK = 70 +pkg syscall (netbsd-386), const SYS_STAT = 439 +pkg syscall (netbsd-386), const SYS_STATVFS1 = 357 +pkg syscall (netbsd-386), const SYS_SWAPCTL = 271 +pkg syscall (netbsd-386), const SYS_SYMLINK = 57 +pkg syscall (netbsd-386), const SYS_SYMLINKAT = 470 +pkg syscall (netbsd-386), const SYS_SYNC = 36 +pkg syscall (netbsd-386), const SYS_SYSARCH = 165 +pkg syscall (netbsd-386), const SYS_TIMER_CREATE = 235 +pkg syscall (netbsd-386), const SYS_TIMER_DELETE = 236 +pkg syscall (netbsd-386), const SYS_TIMER_GETOVERRUN = 239 +pkg syscall (netbsd-386), const SYS_TIMER_GETTIME = 447 +pkg syscall (netbsd-386), const SYS_TIMER_SETTIME = 446 +pkg syscall (netbsd-386), const SYS_TRUNCATE = 200 +pkg syscall (netbsd-386), const SYS_UMASK = 60 +pkg syscall (netbsd-386), const SYS_UNDELETE = 205 +pkg syscall (netbsd-386), const SYS_UNLINK = 10 +pkg syscall (netbsd-386), const SYS_UNLINKAT = 471 +pkg syscall (netbsd-386), const SYS_UNMOUNT = 22 +pkg syscall (netbsd-386), const SYS_UTIMENSAT = 467 +pkg syscall (netbsd-386), const SYS_UTIMES = 420 +pkg syscall (netbsd-386), const SYS_UTRACE = 306 +pkg syscall (netbsd-386), const SYS_UUIDGEN = 355 +pkg syscall (netbsd-386), const SYS_VADVISE = 72 +pkg syscall (netbsd-386), const SYS_VFORK = 66 +pkg syscall (netbsd-386), const SYS_WAIT4 = 449 +pkg syscall (netbsd-386), const SYS_WRITE = 4 +pkg syscall (netbsd-386), const SYS_WRITEV = 121 +pkg syscall (netbsd-386), const SYS__LWP_CONTINUE = 314 +pkg syscall (netbsd-386), const SYS__LWP_CREATE = 309 +pkg syscall (netbsd-386), const SYS__LWP_CTL = 325 +pkg syscall (netbsd-386), const SYS__LWP_DETACH = 319 +pkg syscall (netbsd-386), const SYS__LWP_EXIT = 310 +pkg syscall (netbsd-386), const SYS__LWP_GETNAME = 324 +pkg syscall (netbsd-386), const SYS__LWP_GETPRIVATE = 316 +pkg syscall (netbsd-386), const SYS__LWP_KILL = 318 +pkg syscall (netbsd-386), const SYS__LWP_PARK = 434 +pkg syscall (netbsd-386), const SYS__LWP_SELF = 311 +pkg syscall (netbsd-386), const SYS__LWP_SETNAME = 323 +pkg syscall (netbsd-386), const SYS__LWP_SETPRIVATE = 317 +pkg syscall (netbsd-386), const SYS__LWP_SUSPEND = 313 +pkg syscall (netbsd-386), const SYS__LWP_UNPARK = 321 +pkg syscall (netbsd-386), const SYS__LWP_UNPARK_ALL = 322 +pkg syscall (netbsd-386), const SYS__LWP_WAIT = 312 +pkg syscall (netbsd-386), const SYS__LWP_WAKEUP = 315 +pkg syscall (netbsd-386), const SYS__PSET_BIND = 415 +pkg syscall (netbsd-386), const SYS__SCHED_GETAFFINITY = 349 +pkg syscall (netbsd-386), const SYS__SCHED_GETPARAM = 347 +pkg syscall (netbsd-386), const SYS__SCHED_SETAFFINITY = 348 +pkg syscall (netbsd-386), const SYS__SCHED_SETPARAM = 346 +pkg syscall (netbsd-386), const SYS___CLONE = 287 +pkg syscall (netbsd-386), const SYS___GETCWD = 296 +pkg syscall (netbsd-386), const SYS___GETLOGIN = 49 +pkg syscall (netbsd-386), const SYS___POSIX_CHOWN = 283 +pkg syscall (netbsd-386), const SYS___POSIX_FCHOWN = 284 +pkg syscall (netbsd-386), const SYS___POSIX_LCHOWN = 285 +pkg syscall (netbsd-386), const SYS___POSIX_RENAME = 270 +pkg syscall (netbsd-386), const SYS___QUOTACTL = 473 +pkg syscall (netbsd-386), const SYS___SEMCTL = 442 +pkg syscall (netbsd-386), const SYS___SETLOGIN = 50 +pkg syscall (netbsd-386), const SYS___SIGACTION_SIGTRAMP = 340 +pkg syscall (netbsd-386), const SYS___SIGTIMEDWAIT = 431 +pkg syscall (netbsd-386), const SYS___SYSCTL = 202 +pkg syscall (netbsd-386), const S_ARCH1 = 65536 +pkg syscall (netbsd-386), const S_ARCH2 = 131072 +pkg syscall (netbsd-386), const S_BLKSIZE = 512 +pkg syscall (netbsd-386), const S_IEXEC = 64 +pkg syscall (netbsd-386), const S_IFMT = 61440 +pkg syscall (netbsd-386), const S_IFWHT = 57344 +pkg syscall (netbsd-386), const S_IREAD = 256 +pkg syscall (netbsd-386), const S_IRGRP = 32 +pkg syscall (netbsd-386), const S_IROTH = 4 +pkg syscall (netbsd-386), const S_IRWXG = 56 +pkg syscall (netbsd-386), const S_IRWXO = 7 +pkg syscall (netbsd-386), const S_IRWXU = 448 +pkg syscall (netbsd-386), const S_ISTXT = 512 +pkg syscall (netbsd-386), const S_IWGRP = 16 +pkg syscall (netbsd-386), const S_IWOTH = 2 +pkg syscall (netbsd-386), const S_IWRITE = 128 +pkg syscall (netbsd-386), const S_IXGRP = 8 +pkg syscall (netbsd-386), const S_IXOTH = 1 +pkg syscall (netbsd-386), const S_LOGIN_SET = 1 +pkg syscall (netbsd-386), const SizeofBpfHdr = 20 +pkg syscall (netbsd-386), const SizeofBpfInsn = 8 +pkg syscall (netbsd-386), const SizeofBpfProgram = 8 +pkg syscall (netbsd-386), const SizeofBpfStat = 128 +pkg syscall (netbsd-386), const SizeofBpfVersion = 4 +pkg syscall (netbsd-386), const SizeofCmsghdr = 12 +pkg syscall (netbsd-386), const SizeofIPMreq = 8 +pkg syscall (netbsd-386), const SizeofIPv6Mreq = 20 +pkg syscall (netbsd-386), const SizeofIfAnnounceMsghdr = 24 +pkg syscall (netbsd-386), const SizeofIfData = 132 +pkg syscall (netbsd-386), const SizeofIfMsghdr = 152 +pkg syscall (netbsd-386), const SizeofIfaMsghdr = 24 +pkg syscall (netbsd-386), const SizeofInet6Pktinfo = 20 +pkg syscall (netbsd-386), const SizeofLinger = 8 +pkg syscall (netbsd-386), const SizeofMsghdr = 28 +pkg syscall (netbsd-386), const SizeofRtMetrics = 80 +pkg syscall (netbsd-386), const SizeofRtMsghdr = 120 +pkg syscall (netbsd-386), const SizeofSockaddrAny = 108 +pkg syscall (netbsd-386), const SizeofSockaddrDatalink = 20 +pkg syscall (netbsd-386), const SizeofSockaddrInet4 = 16 +pkg syscall (netbsd-386), const SizeofSockaddrInet6 = 28 +pkg syscall (netbsd-386), const SizeofSockaddrUnix = 106 +pkg syscall (netbsd-386), const TCIFLUSH = 1 +pkg syscall (netbsd-386), const TCIOFLUSH = 3 +pkg syscall (netbsd-386), const TCOFLUSH = 2 +pkg syscall (netbsd-386), const TCP_CONGCTL = 32 +pkg syscall (netbsd-386), const TCP_KEEPCNT = 6 +pkg syscall (netbsd-386), const TCP_KEEPIDLE = 3 +pkg syscall (netbsd-386), const TCP_KEEPINIT = 7 +pkg syscall (netbsd-386), const TCP_KEEPINTVL = 5 +pkg syscall (netbsd-386), const TCP_MAXBURST = 4 +pkg syscall (netbsd-386), const TCP_MAXSEG = 2 +pkg syscall (netbsd-386), const TCP_MAXWIN = 65535 +pkg syscall (netbsd-386), const TCP_MAX_WINSHIFT = 14 +pkg syscall (netbsd-386), const TCP_MD5SIG = 16 +pkg syscall (netbsd-386), const TCP_MINMSS = 216 +pkg syscall (netbsd-386), const TCP_MSS = 536 +pkg syscall (netbsd-386), const TCSAFLUSH = 2 +pkg syscall (netbsd-386), const TIOCCBRK = 536900730 +pkg syscall (netbsd-386), const TIOCCDTR = 536900728 +pkg syscall (netbsd-386), const TIOCCONS = 2147775586 +pkg syscall (netbsd-386), const TIOCDCDTIMESTAMP = 1074558040 +pkg syscall (netbsd-386), const TIOCDRAIN = 536900702 +pkg syscall (netbsd-386), const TIOCEXCL = 536900621 +pkg syscall (netbsd-386), const TIOCEXT = 2147775584 +pkg syscall (netbsd-386), const TIOCFLAG_CDTRCTS = 16 +pkg syscall (netbsd-386), const TIOCFLAG_CLOCAL = 2 +pkg syscall (netbsd-386), const TIOCFLAG_CRTSCTS = 4 +pkg syscall (netbsd-386), const TIOCFLAG_MDMBUF = 8 +pkg syscall (netbsd-386), const TIOCFLAG_SOFTCAR = 1 +pkg syscall (netbsd-386), const TIOCFLUSH = 2147775504 +pkg syscall (netbsd-386), const TIOCGETA = 1076655123 +pkg syscall (netbsd-386), const TIOCGETD = 1074033690 +pkg syscall (netbsd-386), const TIOCGFLAGS = 1074033757 +pkg syscall (netbsd-386), const TIOCGLINED = 1075868738 +pkg syscall (netbsd-386), const TIOCGPGRP = 1074033783 +pkg syscall (netbsd-386), const TIOCGQSIZE = 1074033793 +pkg syscall (netbsd-386), const TIOCGRANTPT = 536900679 +pkg syscall (netbsd-386), const TIOCGSID = 1074033763 +pkg syscall (netbsd-386), const TIOCGSIZE = 1074295912 +pkg syscall (netbsd-386), const TIOCGWINSZ = 1074295912 +pkg syscall (netbsd-386), const TIOCMBIC = 2147775595 +pkg syscall (netbsd-386), const TIOCMBIS = 2147775596 +pkg syscall (netbsd-386), const TIOCMGET = 1074033770 +pkg syscall (netbsd-386), const TIOCMSET = 2147775597 +pkg syscall (netbsd-386), const TIOCM_CAR = 64 +pkg syscall (netbsd-386), const TIOCM_CD = 64 +pkg syscall (netbsd-386), const TIOCM_CTS = 32 +pkg syscall (netbsd-386), const TIOCM_DSR = 256 +pkg syscall (netbsd-386), const TIOCM_DTR = 2 +pkg syscall (netbsd-386), const TIOCM_LE = 1 +pkg syscall (netbsd-386), const TIOCM_RI = 128 +pkg syscall (netbsd-386), const TIOCM_RNG = 128 +pkg syscall (netbsd-386), const TIOCM_RTS = 4 +pkg syscall (netbsd-386), const TIOCM_SR = 16 +pkg syscall (netbsd-386), const TIOCM_ST = 8 +pkg syscall (netbsd-386), const TIOCNOTTY = 536900721 +pkg syscall (netbsd-386), const TIOCNXCL = 536900622 +pkg syscall (netbsd-386), const TIOCOUTQ = 1074033779 +pkg syscall (netbsd-386), const TIOCPKT = 2147775600 +pkg syscall (netbsd-386), const TIOCPKT_DATA = 0 +pkg syscall (netbsd-386), const TIOCPKT_DOSTOP = 32 +pkg syscall (netbsd-386), const TIOCPKT_FLUSHREAD = 1 +pkg syscall (netbsd-386), const TIOCPKT_FLUSHWRITE = 2 +pkg syscall (netbsd-386), const TIOCPKT_IOCTL = 64 +pkg syscall (netbsd-386), const TIOCPKT_NOSTOP = 16 +pkg syscall (netbsd-386), const TIOCPKT_START = 8 +pkg syscall (netbsd-386), const TIOCPKT_STOP = 4 +pkg syscall (netbsd-386), const TIOCPTMGET = 1076393030 +pkg syscall (netbsd-386), const TIOCPTSNAME = 1076393032 +pkg syscall (netbsd-386), const TIOCRCVFRAME = 2147775557 +pkg syscall (netbsd-386), const TIOCREMOTE = 2147775593 +pkg syscall (netbsd-386), const TIOCSBRK = 536900731 +pkg syscall (netbsd-386), const TIOCSCTTY = 536900705 +pkg syscall (netbsd-386), const TIOCSDTR = 536900729 +pkg syscall (netbsd-386), const TIOCSETA = 2150396948 +pkg syscall (netbsd-386), const TIOCSETAF = 2150396950 +pkg syscall (netbsd-386), const TIOCSETAW = 2150396949 +pkg syscall (netbsd-386), const TIOCSETD = 2147775515 +pkg syscall (netbsd-386), const TIOCSFLAGS = 2147775580 +pkg syscall (netbsd-386), const TIOCSIG = 536900703 +pkg syscall (netbsd-386), const TIOCSLINED = 2149610563 +pkg syscall (netbsd-386), const TIOCSPGRP = 2147775606 +pkg syscall (netbsd-386), const TIOCSQSIZE = 2147775616 +pkg syscall (netbsd-386), const TIOCSSIZE = 2148037735 +pkg syscall (netbsd-386), const TIOCSTART = 536900718 +pkg syscall (netbsd-386), const TIOCSTAT = 2147775589 +pkg syscall (netbsd-386), const TIOCSTI = 2147578994 +pkg syscall (netbsd-386), const TIOCSTOP = 536900719 +pkg syscall (netbsd-386), const TIOCSWINSZ = 2148037735 +pkg syscall (netbsd-386), const TIOCUCNTL = 2147775590 +pkg syscall (netbsd-386), const TIOCXMTFRAME = 2147775556 +pkg syscall (netbsd-386), const TOSTOP = 4194304 +pkg syscall (netbsd-386), const VDISCARD = 15 +pkg syscall (netbsd-386), const VDSUSP = 11 +pkg syscall (netbsd-386), const VEOF = 0 +pkg syscall (netbsd-386), const VEOL = 1 +pkg syscall (netbsd-386), const VEOL2 = 2 +pkg syscall (netbsd-386), const VERASE = 3 +pkg syscall (netbsd-386), const VINTR = 8 +pkg syscall (netbsd-386), const VKILL = 5 +pkg syscall (netbsd-386), const VLNEXT = 14 +pkg syscall (netbsd-386), const VMIN = 16 +pkg syscall (netbsd-386), const VQUIT = 9 +pkg syscall (netbsd-386), const VREPRINT = 6 +pkg syscall (netbsd-386), const VSTART = 12 +pkg syscall (netbsd-386), const VSTATUS = 18 +pkg syscall (netbsd-386), const VSTOP = 13 +pkg syscall (netbsd-386), const VSUSP = 10 +pkg syscall (netbsd-386), const VTIME = 17 +pkg syscall (netbsd-386), const VWERASE = 4 +pkg syscall (netbsd-386), const WALL = 8 +pkg syscall (netbsd-386), const WALLSIG = 8 +pkg syscall (netbsd-386), const WALTSIG = 4 +pkg syscall (netbsd-386), const WCLONE = 4 +pkg syscall (netbsd-386), const WCOREFLAG = 128 +pkg syscall (netbsd-386), const WNOHANG = 1 +pkg syscall (netbsd-386), const WNOWAIT = 65536 +pkg syscall (netbsd-386), const WNOZOMBIE = 131072 +pkg syscall (netbsd-386), const WOPTSCHECKED = 262144 +pkg syscall (netbsd-386), const WSTOPPED = 127 +pkg syscall (netbsd-386), const WUNTRACED = 2 +pkg syscall (netbsd-386-cgo), const AF_APPLETALK = 16 +pkg syscall (netbsd-386-cgo), const AF_ARP = 28 +pkg syscall (netbsd-386-cgo), const AF_BLUETOOTH = 31 +pkg syscall (netbsd-386-cgo), const AF_CCITT = 10 +pkg syscall (netbsd-386-cgo), const AF_CHAOS = 5 +pkg syscall (netbsd-386-cgo), const AF_CNT = 21 +pkg syscall (netbsd-386-cgo), const AF_COIP = 20 +pkg syscall (netbsd-386-cgo), const AF_DATAKIT = 9 +pkg syscall (netbsd-386-cgo), const AF_DECnet = 12 +pkg syscall (netbsd-386-cgo), const AF_DLI = 13 +pkg syscall (netbsd-386-cgo), const AF_E164 = 26 +pkg syscall (netbsd-386-cgo), const AF_ECMA = 8 +pkg syscall (netbsd-386-cgo), const AF_HYLINK = 15 +pkg syscall (netbsd-386-cgo), const AF_IEEE80211 = 32 +pkg syscall (netbsd-386-cgo), const AF_IMPLINK = 3 +pkg syscall (netbsd-386-cgo), const AF_INET6 = 24 +pkg syscall (netbsd-386-cgo), const AF_IPX = 23 +pkg syscall (netbsd-386-cgo), const AF_ISDN = 26 +pkg syscall (netbsd-386-cgo), const AF_ISO = 7 +pkg syscall (netbsd-386-cgo), const AF_LAT = 14 +pkg syscall (netbsd-386-cgo), const AF_LINK = 18 +pkg syscall (netbsd-386-cgo), const AF_LOCAL = 1 +pkg syscall (netbsd-386-cgo), const AF_MAX = 35 +pkg syscall (netbsd-386-cgo), const AF_MPLS = 33 +pkg syscall (netbsd-386-cgo), const AF_NATM = 27 +pkg syscall (netbsd-386-cgo), const AF_NS = 6 +pkg syscall (netbsd-386-cgo), const AF_OROUTE = 17 +pkg syscall (netbsd-386-cgo), const AF_OSI = 7 +pkg syscall (netbsd-386-cgo), const AF_PUP = 4 +pkg syscall (netbsd-386-cgo), const AF_ROUTE = 34 +pkg syscall (netbsd-386-cgo), const AF_SNA = 11 +pkg syscall (netbsd-386-cgo), const ARPHRD_ARCNET = 7 +pkg syscall (netbsd-386-cgo), const ARPHRD_ETHER = 1 +pkg syscall (netbsd-386-cgo), const ARPHRD_FRELAY = 15 +pkg syscall (netbsd-386-cgo), const ARPHRD_IEEE1394 = 24 +pkg syscall (netbsd-386-cgo), const ARPHRD_IEEE802 = 6 +pkg syscall (netbsd-386-cgo), const ARPHRD_STRIP = 23 +pkg syscall (netbsd-386-cgo), const B0 = 0 +pkg syscall (netbsd-386-cgo), const B110 = 110 +pkg syscall (netbsd-386-cgo), const B115200 = 115200 +pkg syscall (netbsd-386-cgo), const B1200 = 1200 +pkg syscall (netbsd-386-cgo), const B134 = 134 +pkg syscall (netbsd-386-cgo), const B14400 = 14400 +pkg syscall (netbsd-386-cgo), const B150 = 150 +pkg syscall (netbsd-386-cgo), const B1800 = 1800 +pkg syscall (netbsd-386-cgo), const B19200 = 19200 +pkg syscall (netbsd-386-cgo), const B200 = 200 +pkg syscall (netbsd-386-cgo), const B230400 = 230400 +pkg syscall (netbsd-386-cgo), const B2400 = 2400 +pkg syscall (netbsd-386-cgo), const B28800 = 28800 +pkg syscall (netbsd-386-cgo), const B300 = 300 +pkg syscall (netbsd-386-cgo), const B38400 = 38400 +pkg syscall (netbsd-386-cgo), const B460800 = 460800 +pkg syscall (netbsd-386-cgo), const B4800 = 4800 +pkg syscall (netbsd-386-cgo), const B50 = 50 +pkg syscall (netbsd-386-cgo), const B57600 = 57600 +pkg syscall (netbsd-386-cgo), const B600 = 600 +pkg syscall (netbsd-386-cgo), const B7200 = 7200 +pkg syscall (netbsd-386-cgo), const B75 = 75 +pkg syscall (netbsd-386-cgo), const B76800 = 76800 +pkg syscall (netbsd-386-cgo), const B921600 = 921600 +pkg syscall (netbsd-386-cgo), const B9600 = 9600 +pkg syscall (netbsd-386-cgo), const BIOCFEEDBACK = 2147762813 +pkg syscall (netbsd-386-cgo), const BIOCFLUSH = 536887912 +pkg syscall (netbsd-386-cgo), const BIOCGBLEN = 1074020966 +pkg syscall (netbsd-386-cgo), const BIOCGDLT = 1074020970 +pkg syscall (netbsd-386-cgo), const BIOCGDLTLIST = 3221766775 +pkg syscall (netbsd-386-cgo), const BIOCGETIF = 1083196011 +pkg syscall (netbsd-386-cgo), const BIOCGFEEDBACK = 1074020988 +pkg syscall (netbsd-386-cgo), const BIOCGHDRCMPLT = 1074020980 +pkg syscall (netbsd-386-cgo), const BIOCGRTIMEOUT = 1074545275 +pkg syscall (netbsd-386-cgo), const BIOCGSEESENT = 1074020984 +pkg syscall (netbsd-386-cgo), const BIOCGSTATS = 1082147439 +pkg syscall (netbsd-386-cgo), const BIOCGSTATSOLD = 1074283119 +pkg syscall (netbsd-386-cgo), const BIOCIMMEDIATE = 2147762800 +pkg syscall (netbsd-386-cgo), const BIOCPROMISC = 536887913 +pkg syscall (netbsd-386-cgo), const BIOCSBLEN = 3221504614 +pkg syscall (netbsd-386-cgo), const BIOCSDLT = 2147762806 +pkg syscall (netbsd-386-cgo), const BIOCSETF = 2148024935 +pkg syscall (netbsd-386-cgo), const BIOCSETIF = 2156937836 +pkg syscall (netbsd-386-cgo), const BIOCSFEEDBACK = 2147762813 +pkg syscall (netbsd-386-cgo), const BIOCSHDRCMPLT = 2147762805 +pkg syscall (netbsd-386-cgo), const BIOCSRTIMEOUT = 2148287098 +pkg syscall (netbsd-386-cgo), const BIOCSSEESENT = 2147762809 +pkg syscall (netbsd-386-cgo), const BIOCSTCPF = 2148024946 +pkg syscall (netbsd-386-cgo), const BIOCSUDPF = 2148024947 +pkg syscall (netbsd-386-cgo), const BIOCVERSION = 1074020977 +pkg syscall (netbsd-386-cgo), const BPF_A = 16 +pkg syscall (netbsd-386-cgo), const BPF_ABS = 32 +pkg syscall (netbsd-386-cgo), const BPF_ADD = 0 +pkg syscall (netbsd-386-cgo), const BPF_ALIGNMENT = 4 +pkg syscall (netbsd-386-cgo), const BPF_ALIGNMENT32 = 4 +pkg syscall (netbsd-386-cgo), const BPF_ALU = 4 +pkg syscall (netbsd-386-cgo), const BPF_AND = 80 +pkg syscall (netbsd-386-cgo), const BPF_B = 16 +pkg syscall (netbsd-386-cgo), const BPF_DFLTBUFSIZE = 1048576 +pkg syscall (netbsd-386-cgo), const BPF_DIV = 48 +pkg syscall (netbsd-386-cgo), const BPF_H = 8 +pkg syscall (netbsd-386-cgo), const BPF_IMM = 0 +pkg syscall (netbsd-386-cgo), const BPF_IND = 64 +pkg syscall (netbsd-386-cgo), const BPF_JA = 0 +pkg syscall (netbsd-386-cgo), const BPF_JEQ = 16 +pkg syscall (netbsd-386-cgo), const BPF_JGE = 48 +pkg syscall (netbsd-386-cgo), const BPF_JGT = 32 +pkg syscall (netbsd-386-cgo), const BPF_JMP = 5 +pkg syscall (netbsd-386-cgo), const BPF_JSET = 64 +pkg syscall (netbsd-386-cgo), const BPF_K = 0 +pkg syscall (netbsd-386-cgo), const BPF_LD = 0 +pkg syscall (netbsd-386-cgo), const BPF_LDX = 1 +pkg syscall (netbsd-386-cgo), const BPF_LEN = 128 +pkg syscall (netbsd-386-cgo), const BPF_LSH = 96 +pkg syscall (netbsd-386-cgo), const BPF_MAJOR_VERSION = 1 +pkg syscall (netbsd-386-cgo), const BPF_MAXBUFSIZE = 16777216 +pkg syscall (netbsd-386-cgo), const BPF_MAXINSNS = 512 +pkg syscall (netbsd-386-cgo), const BPF_MEM = 96 +pkg syscall (netbsd-386-cgo), const BPF_MEMWORDS = 16 +pkg syscall (netbsd-386-cgo), const BPF_MINBUFSIZE = 32 +pkg syscall (netbsd-386-cgo), const BPF_MINOR_VERSION = 1 +pkg syscall (netbsd-386-cgo), const BPF_MISC = 7 +pkg syscall (netbsd-386-cgo), const BPF_MSH = 160 +pkg syscall (netbsd-386-cgo), const BPF_MUL = 32 +pkg syscall (netbsd-386-cgo), const BPF_NEG = 128 +pkg syscall (netbsd-386-cgo), const BPF_OR = 64 +pkg syscall (netbsd-386-cgo), const BPF_RELEASE = 199606 +pkg syscall (netbsd-386-cgo), const BPF_RET = 6 +pkg syscall (netbsd-386-cgo), const BPF_RSH = 112 +pkg syscall (netbsd-386-cgo), const BPF_ST = 2 +pkg syscall (netbsd-386-cgo), const BPF_STX = 3 +pkg syscall (netbsd-386-cgo), const BPF_SUB = 16 +pkg syscall (netbsd-386-cgo), const BPF_TAX = 0 +pkg syscall (netbsd-386-cgo), const BPF_TXA = 128 +pkg syscall (netbsd-386-cgo), const BPF_W = 0 +pkg syscall (netbsd-386-cgo), const BPF_X = 8 +pkg syscall (netbsd-386-cgo), const BRKINT = 2 +pkg syscall (netbsd-386-cgo), const CFLUSH = 15 +pkg syscall (netbsd-386-cgo), const CLOCAL = 32768 +pkg syscall (netbsd-386-cgo), const CREAD = 2048 +pkg syscall (netbsd-386-cgo), const CS5 = 0 +pkg syscall (netbsd-386-cgo), const CS6 = 256 +pkg syscall (netbsd-386-cgo), const CS7 = 512 +pkg syscall (netbsd-386-cgo), const CS8 = 768 +pkg syscall (netbsd-386-cgo), const CSIZE = 768 +pkg syscall (netbsd-386-cgo), const CSTART = 17 +pkg syscall (netbsd-386-cgo), const CSTATUS = 20 +pkg syscall (netbsd-386-cgo), const CSTOP = 19 +pkg syscall (netbsd-386-cgo), const CSTOPB = 1024 +pkg syscall (netbsd-386-cgo), const CSUSP = 26 +pkg syscall (netbsd-386-cgo), const CTL_MAXNAME = 12 +pkg syscall (netbsd-386-cgo), const CTL_NET = 4 +pkg syscall (netbsd-386-cgo), const CTL_QUERY = -2 +pkg syscall (netbsd-386-cgo), const DIOCBSFLUSH = 536896632 +pkg syscall (netbsd-386-cgo), const DLT_A429 = 184 +pkg syscall (netbsd-386-cgo), const DLT_A653_ICM = 185 +pkg syscall (netbsd-386-cgo), const DLT_AIRONET_HEADER = 120 +pkg syscall (netbsd-386-cgo), const DLT_AOS = 222 +pkg syscall (netbsd-386-cgo), const DLT_APPLE_IP_OVER_IEEE1394 = 138 +pkg syscall (netbsd-386-cgo), const DLT_ARCNET = 7 +pkg syscall (netbsd-386-cgo), const DLT_ARCNET_LINUX = 129 +pkg syscall (netbsd-386-cgo), const DLT_ATM_CLIP = 19 +pkg syscall (netbsd-386-cgo), const DLT_ATM_RFC1483 = 11 +pkg syscall (netbsd-386-cgo), const DLT_AURORA = 126 +pkg syscall (netbsd-386-cgo), const DLT_AX25 = 3 +pkg syscall (netbsd-386-cgo), const DLT_AX25_KISS = 202 +pkg syscall (netbsd-386-cgo), const DLT_BACNET_MS_TP = 165 +pkg syscall (netbsd-386-cgo), const DLT_BLUETOOTH_HCI_H4 = 187 +pkg syscall (netbsd-386-cgo), const DLT_BLUETOOTH_HCI_H4_WITH_PHDR = 201 +pkg syscall (netbsd-386-cgo), const DLT_CAN20B = 190 +pkg syscall (netbsd-386-cgo), const DLT_CAN_SOCKETCAN = 227 +pkg syscall (netbsd-386-cgo), const DLT_CHAOS = 5 +pkg syscall (netbsd-386-cgo), const DLT_CISCO_IOS = 118 +pkg syscall (netbsd-386-cgo), const DLT_C_HDLC = 104 +pkg syscall (netbsd-386-cgo), const DLT_C_HDLC_WITH_DIR = 205 +pkg syscall (netbsd-386-cgo), const DLT_DECT = 221 +pkg syscall (netbsd-386-cgo), const DLT_DOCSIS = 143 +pkg syscall (netbsd-386-cgo), const DLT_ECONET = 115 +pkg syscall (netbsd-386-cgo), const DLT_EN10MB = 1 +pkg syscall (netbsd-386-cgo), const DLT_EN3MB = 2 +pkg syscall (netbsd-386-cgo), const DLT_ENC = 109 +pkg syscall (netbsd-386-cgo), const DLT_ERF = 197 +pkg syscall (netbsd-386-cgo), const DLT_ERF_ETH = 175 +pkg syscall (netbsd-386-cgo), const DLT_ERF_POS = 176 +pkg syscall (netbsd-386-cgo), const DLT_FC_2 = 224 +pkg syscall (netbsd-386-cgo), const DLT_FC_2_WITH_FRAME_DELIMS = 225 +pkg syscall (netbsd-386-cgo), const DLT_FDDI = 10 +pkg syscall (netbsd-386-cgo), const DLT_FLEXRAY = 210 +pkg syscall (netbsd-386-cgo), const DLT_FRELAY = 107 +pkg syscall (netbsd-386-cgo), const DLT_FRELAY_WITH_DIR = 206 +pkg syscall (netbsd-386-cgo), const DLT_GCOM_SERIAL = 173 +pkg syscall (netbsd-386-cgo), const DLT_GCOM_T1E1 = 172 +pkg syscall (netbsd-386-cgo), const DLT_GPF_F = 171 +pkg syscall (netbsd-386-cgo), const DLT_GPF_T = 170 +pkg syscall (netbsd-386-cgo), const DLT_GPRS_LLC = 169 +pkg syscall (netbsd-386-cgo), const DLT_GSMTAP_ABIS = 218 +pkg syscall (netbsd-386-cgo), const DLT_GSMTAP_UM = 217 +pkg syscall (netbsd-386-cgo), const DLT_HDLC = 16 +pkg syscall (netbsd-386-cgo), const DLT_HHDLC = 121 +pkg syscall (netbsd-386-cgo), const DLT_HIPPI = 15 +pkg syscall (netbsd-386-cgo), const DLT_IBM_SN = 146 +pkg syscall (netbsd-386-cgo), const DLT_IBM_SP = 145 +pkg syscall (netbsd-386-cgo), const DLT_IEEE802 = 6 +pkg syscall (netbsd-386-cgo), const DLT_IEEE802_11 = 105 +pkg syscall (netbsd-386-cgo), const DLT_IEEE802_11_RADIO = 127 +pkg syscall (netbsd-386-cgo), const DLT_IEEE802_11_RADIO_AVS = 163 +pkg syscall (netbsd-386-cgo), const DLT_IEEE802_15_4 = 195 +pkg syscall (netbsd-386-cgo), const DLT_IEEE802_15_4_LINUX = 191 +pkg syscall (netbsd-386-cgo), const DLT_IEEE802_15_4_NONASK_PHY = 215 +pkg syscall (netbsd-386-cgo), const DLT_IEEE802_16_MAC_CPS = 188 +pkg syscall (netbsd-386-cgo), const DLT_IEEE802_16_MAC_CPS_RADIO = 193 +pkg syscall (netbsd-386-cgo), const DLT_IPMB = 199 +pkg syscall (netbsd-386-cgo), const DLT_IPMB_LINUX = 209 +pkg syscall (netbsd-386-cgo), const DLT_IPNET = 226 +pkg syscall (netbsd-386-cgo), const DLT_IPV4 = 228 +pkg syscall (netbsd-386-cgo), const DLT_IPV6 = 229 +pkg syscall (netbsd-386-cgo), const DLT_IP_OVER_FC = 122 +pkg syscall (netbsd-386-cgo), const DLT_JUNIPER_ATM1 = 137 +pkg syscall (netbsd-386-cgo), const DLT_JUNIPER_ATM2 = 135 +pkg syscall (netbsd-386-cgo), const DLT_JUNIPER_CHDLC = 181 +pkg syscall (netbsd-386-cgo), const DLT_JUNIPER_ES = 132 +pkg syscall (netbsd-386-cgo), const DLT_JUNIPER_ETHER = 178 +pkg syscall (netbsd-386-cgo), const DLT_JUNIPER_FRELAY = 180 +pkg syscall (netbsd-386-cgo), const DLT_JUNIPER_GGSN = 133 +pkg syscall (netbsd-386-cgo), const DLT_JUNIPER_ISM = 194 +pkg syscall (netbsd-386-cgo), const DLT_JUNIPER_MFR = 134 +pkg syscall (netbsd-386-cgo), const DLT_JUNIPER_MLFR = 131 +pkg syscall (netbsd-386-cgo), const DLT_JUNIPER_MLPPP = 130 +pkg syscall (netbsd-386-cgo), const DLT_JUNIPER_MONITOR = 164 +pkg syscall (netbsd-386-cgo), const DLT_JUNIPER_PIC_PEER = 174 +pkg syscall (netbsd-386-cgo), const DLT_JUNIPER_PPP = 179 +pkg syscall (netbsd-386-cgo), const DLT_JUNIPER_PPPOE = 167 +pkg syscall (netbsd-386-cgo), const DLT_JUNIPER_PPPOE_ATM = 168 +pkg syscall (netbsd-386-cgo), const DLT_JUNIPER_SERVICES = 136 +pkg syscall (netbsd-386-cgo), const DLT_JUNIPER_ST = 200 +pkg syscall (netbsd-386-cgo), const DLT_JUNIPER_VP = 183 +pkg syscall (netbsd-386-cgo), const DLT_LAPB_WITH_DIR = 207 +pkg syscall (netbsd-386-cgo), const DLT_LAPD = 203 +pkg syscall (netbsd-386-cgo), const DLT_LIN = 212 +pkg syscall (netbsd-386-cgo), const DLT_LINUX_EVDEV = 216 +pkg syscall (netbsd-386-cgo), const DLT_LINUX_IRDA = 144 +pkg syscall (netbsd-386-cgo), const DLT_LINUX_LAPD = 177 +pkg syscall (netbsd-386-cgo), const DLT_LINUX_SLL = 113 +pkg syscall (netbsd-386-cgo), const DLT_LOOP = 108 +pkg syscall (netbsd-386-cgo), const DLT_LTALK = 114 +pkg syscall (netbsd-386-cgo), const DLT_MFR = 182 +pkg syscall (netbsd-386-cgo), const DLT_MOST = 211 +pkg syscall (netbsd-386-cgo), const DLT_MPLS = 219 +pkg syscall (netbsd-386-cgo), const DLT_MTP2 = 140 +pkg syscall (netbsd-386-cgo), const DLT_MTP2_WITH_PHDR = 139 +pkg syscall (netbsd-386-cgo), const DLT_MTP3 = 141 +pkg syscall (netbsd-386-cgo), const DLT_NULL = 0 +pkg syscall (netbsd-386-cgo), const DLT_PCI_EXP = 125 +pkg syscall (netbsd-386-cgo), const DLT_PFLOG = 117 +pkg syscall (netbsd-386-cgo), const DLT_PFSYNC = 18 +pkg syscall (netbsd-386-cgo), const DLT_PPI = 192 +pkg syscall (netbsd-386-cgo), const DLT_PPP = 9 +pkg syscall (netbsd-386-cgo), const DLT_PPP_BSDOS = 14 +pkg syscall (netbsd-386-cgo), const DLT_PPP_ETHER = 51 +pkg syscall (netbsd-386-cgo), const DLT_PPP_PPPD = 166 +pkg syscall (netbsd-386-cgo), const DLT_PPP_SERIAL = 50 +pkg syscall (netbsd-386-cgo), const DLT_PPP_WITH_DIR = 204 +pkg syscall (netbsd-386-cgo), const DLT_PRISM_HEADER = 119 +pkg syscall (netbsd-386-cgo), const DLT_PRONET = 4 +pkg syscall (netbsd-386-cgo), const DLT_RAIF1 = 198 +pkg syscall (netbsd-386-cgo), const DLT_RAW = 12 +pkg syscall (netbsd-386-cgo), const DLT_RAWAF_MASK = 35913728 +pkg syscall (netbsd-386-cgo), const DLT_RIO = 124 +pkg syscall (netbsd-386-cgo), const DLT_SCCP = 142 +pkg syscall (netbsd-386-cgo), const DLT_SITA = 196 +pkg syscall (netbsd-386-cgo), const DLT_SLIP = 8 +pkg syscall (netbsd-386-cgo), const DLT_SLIP_BSDOS = 13 +pkg syscall (netbsd-386-cgo), const DLT_SUNATM = 123 +pkg syscall (netbsd-386-cgo), const DLT_SYMANTEC_FIREWALL = 99 +pkg syscall (netbsd-386-cgo), const DLT_TZSP = 128 +pkg syscall (netbsd-386-cgo), const DLT_USB = 186 +pkg syscall (netbsd-386-cgo), const DLT_USB_LINUX = 189 +pkg syscall (netbsd-386-cgo), const DLT_USB_LINUX_MMAPPED = 220 +pkg syscall (netbsd-386-cgo), const DLT_WIHART = 223 +pkg syscall (netbsd-386-cgo), const DLT_X2E_SERIAL = 213 +pkg syscall (netbsd-386-cgo), const DLT_X2E_XORAYA = 214 +pkg syscall (netbsd-386-cgo), const DT_BLK = 6 +pkg syscall (netbsd-386-cgo), const DT_CHR = 2 +pkg syscall (netbsd-386-cgo), const DT_DIR = 4 +pkg syscall (netbsd-386-cgo), const DT_FIFO = 1 +pkg syscall (netbsd-386-cgo), const DT_LNK = 10 +pkg syscall (netbsd-386-cgo), const DT_REG = 8 +pkg syscall (netbsd-386-cgo), const DT_SOCK = 12 +pkg syscall (netbsd-386-cgo), const DT_UNKNOWN = 0 +pkg syscall (netbsd-386-cgo), const DT_WHT = 14 +pkg syscall (netbsd-386-cgo), const E2BIG = 7 +pkg syscall (netbsd-386-cgo), const EACCES = 13 +pkg syscall (netbsd-386-cgo), const EADDRINUSE = 48 +pkg syscall (netbsd-386-cgo), const EADDRNOTAVAIL = 49 +pkg syscall (netbsd-386-cgo), const EAFNOSUPPORT = 47 +pkg syscall (netbsd-386-cgo), const EAGAIN = 35 +pkg syscall (netbsd-386-cgo), const EALREADY = 37 +pkg syscall (netbsd-386-cgo), const EAUTH = 80 +pkg syscall (netbsd-386-cgo), const EBADF = 9 +pkg syscall (netbsd-386-cgo), const EBADMSG = 88 +pkg syscall (netbsd-386-cgo), const EBADRPC = 72 +pkg syscall (netbsd-386-cgo), const EBUSY = 16 +pkg syscall (netbsd-386-cgo), const ECANCELED = 87 +pkg syscall (netbsd-386-cgo), const ECHILD = 10 +pkg syscall (netbsd-386-cgo), const ECHO = 8 +pkg syscall (netbsd-386-cgo), const ECHOCTL = 64 +pkg syscall (netbsd-386-cgo), const ECHOE = 2 +pkg syscall (netbsd-386-cgo), const ECHOK = 4 +pkg syscall (netbsd-386-cgo), const ECHOKE = 1 +pkg syscall (netbsd-386-cgo), const ECHONL = 16 +pkg syscall (netbsd-386-cgo), const ECHOPRT = 32 +pkg syscall (netbsd-386-cgo), const ECONNABORTED = 53 +pkg syscall (netbsd-386-cgo), const ECONNREFUSED = 61 +pkg syscall (netbsd-386-cgo), const ECONNRESET = 54 +pkg syscall (netbsd-386-cgo), const EDEADLK = 11 +pkg syscall (netbsd-386-cgo), const EDESTADDRREQ = 39 +pkg syscall (netbsd-386-cgo), const EDOM = 33 +pkg syscall (netbsd-386-cgo), const EDQUOT = 69 +pkg syscall (netbsd-386-cgo), const EEXIST = 17 +pkg syscall (netbsd-386-cgo), const EFAULT = 14 +pkg syscall (netbsd-386-cgo), const EFBIG = 27 +pkg syscall (netbsd-386-cgo), const EFTYPE = 79 +pkg syscall (netbsd-386-cgo), const EHOSTDOWN = 64 +pkg syscall (netbsd-386-cgo), const EHOSTUNREACH = 65 +pkg syscall (netbsd-386-cgo), const EIDRM = 82 +pkg syscall (netbsd-386-cgo), const EILSEQ = 85 +pkg syscall (netbsd-386-cgo), const EINPROGRESS = 36 +pkg syscall (netbsd-386-cgo), const EINTR = 4 +pkg syscall (netbsd-386-cgo), const EINVAL = 22 +pkg syscall (netbsd-386-cgo), const EIO = 5 +pkg syscall (netbsd-386-cgo), const EISCONN = 56 +pkg syscall (netbsd-386-cgo), const EISDIR = 21 +pkg syscall (netbsd-386-cgo), const ELAST = 96 +pkg syscall (netbsd-386-cgo), const ELOOP = 62 +pkg syscall (netbsd-386-cgo), const EMFILE = 24 +pkg syscall (netbsd-386-cgo), const EMLINK = 31 +pkg syscall (netbsd-386-cgo), const EMSGSIZE = 40 +pkg syscall (netbsd-386-cgo), const EMULTIHOP = 94 +pkg syscall (netbsd-386-cgo), const EMUL_LINUX = 1 +pkg syscall (netbsd-386-cgo), const EMUL_LINUX32 = 5 +pkg syscall (netbsd-386-cgo), const EMUL_MAXID = 6 +pkg syscall (netbsd-386-cgo), const ENAMETOOLONG = 63 +pkg syscall (netbsd-386-cgo), const ENEEDAUTH = 81 +pkg syscall (netbsd-386-cgo), const ENETDOWN = 50 +pkg syscall (netbsd-386-cgo), const ENETRESET = 52 +pkg syscall (netbsd-386-cgo), const ENETUNREACH = 51 +pkg syscall (netbsd-386-cgo), const ENFILE = 23 +pkg syscall (netbsd-386-cgo), const ENOATTR = 93 +pkg syscall (netbsd-386-cgo), const ENOBUFS = 55 +pkg syscall (netbsd-386-cgo), const ENODATA = 89 +pkg syscall (netbsd-386-cgo), const ENODEV = 19 +pkg syscall (netbsd-386-cgo), const ENOEXEC = 8 +pkg syscall (netbsd-386-cgo), const ENOLCK = 77 +pkg syscall (netbsd-386-cgo), const ENOLINK = 95 +pkg syscall (netbsd-386-cgo), const ENOMEM = 12 +pkg syscall (netbsd-386-cgo), const ENOMSG = 83 +pkg syscall (netbsd-386-cgo), const ENOPROTOOPT = 42 +pkg syscall (netbsd-386-cgo), const ENOSPC = 28 +pkg syscall (netbsd-386-cgo), const ENOSR = 90 +pkg syscall (netbsd-386-cgo), const ENOSTR = 91 +pkg syscall (netbsd-386-cgo), const ENOSYS = 78 +pkg syscall (netbsd-386-cgo), const ENOTBLK = 15 +pkg syscall (netbsd-386-cgo), const ENOTCONN = 57 +pkg syscall (netbsd-386-cgo), const ENOTDIR = 20 +pkg syscall (netbsd-386-cgo), const ENOTEMPTY = 66 +pkg syscall (netbsd-386-cgo), const ENOTSOCK = 38 +pkg syscall (netbsd-386-cgo), const ENOTSUP = 86 +pkg syscall (netbsd-386-cgo), const ENOTTY = 25 +pkg syscall (netbsd-386-cgo), const ENXIO = 6 +pkg syscall (netbsd-386-cgo), const EN_SW_CTL_INF = 4096 +pkg syscall (netbsd-386-cgo), const EN_SW_CTL_PREC = 768 +pkg syscall (netbsd-386-cgo), const EN_SW_CTL_ROUND = 3072 +pkg syscall (netbsd-386-cgo), const EN_SW_DATACHAIN = 128 +pkg syscall (netbsd-386-cgo), const EN_SW_DENORM = 2 +pkg syscall (netbsd-386-cgo), const EN_SW_INVOP = 1 +pkg syscall (netbsd-386-cgo), const EN_SW_OVERFLOW = 8 +pkg syscall (netbsd-386-cgo), const EN_SW_PRECLOSS = 32 +pkg syscall (netbsd-386-cgo), const EN_SW_UNDERFLOW = 16 +pkg syscall (netbsd-386-cgo), const EN_SW_ZERODIV = 4 +pkg syscall (netbsd-386-cgo), const EOPNOTSUPP = 45 +pkg syscall (netbsd-386-cgo), const EOVERFLOW = 84 +pkg syscall (netbsd-386-cgo), const EPERM = 1 +pkg syscall (netbsd-386-cgo), const EPFNOSUPPORT = 46 +pkg syscall (netbsd-386-cgo), const EPIPE = 32 +pkg syscall (netbsd-386-cgo), const EPROCLIM = 67 +pkg syscall (netbsd-386-cgo), const EPROCUNAVAIL = 76 +pkg syscall (netbsd-386-cgo), const EPROGMISMATCH = 75 +pkg syscall (netbsd-386-cgo), const EPROGUNAVAIL = 74 +pkg syscall (netbsd-386-cgo), const EPROTO = 96 +pkg syscall (netbsd-386-cgo), const EPROTONOSUPPORT = 43 +pkg syscall (netbsd-386-cgo), const EPROTOTYPE = 41 +pkg syscall (netbsd-386-cgo), const ERANGE = 34 +pkg syscall (netbsd-386-cgo), const EREMOTE = 71 +pkg syscall (netbsd-386-cgo), const EROFS = 30 +pkg syscall (netbsd-386-cgo), const ERPCMISMATCH = 73 +pkg syscall (netbsd-386-cgo), const ESHUTDOWN = 58 +pkg syscall (netbsd-386-cgo), const ESOCKTNOSUPPORT = 44 +pkg syscall (netbsd-386-cgo), const ESPIPE = 29 +pkg syscall (netbsd-386-cgo), const ESRCH = 3 +pkg syscall (netbsd-386-cgo), const ESTALE = 70 +pkg syscall (netbsd-386-cgo), const ETHERCAP_JUMBO_MTU = 4 +pkg syscall (netbsd-386-cgo), const ETHERCAP_VLAN_HWTAGGING = 2 +pkg syscall (netbsd-386-cgo), const ETHERCAP_VLAN_MTU = 1 +pkg syscall (netbsd-386-cgo), const ETHERMIN = 46 +pkg syscall (netbsd-386-cgo), const ETHERMTU = 1500 +pkg syscall (netbsd-386-cgo), const ETHERMTU_JUMBO = 9000 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_8023 = 4 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_AARP = 33011 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_ACCTON = 33680 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_AEONIC = 32822 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_ALPHA = 33098 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_AMBER = 24584 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_AMOEBA = 33093 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_APOLLO = 33015 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_APOLLODOMAIN = 32793 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_APPLETALK = 32923 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_APPLITEK = 32967 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_ARGONAUT = 32826 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_ARP = 2054 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_AT = 32923 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_ATALK = 32923 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_ATOMIC = 34527 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_ATT = 32873 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_ATTSTANFORD = 32776 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_AUTOPHON = 32874 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_AXIS = 34902 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_BCLOOP = 36867 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_BOFL = 33026 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_CABLETRON = 28724 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_CHAOS = 2052 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_COMDESIGN = 32876 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_COMPUGRAPHIC = 32877 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_COUNTERPOINT = 32866 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_CRONUS = 32772 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_CRONUSVLN = 32771 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_DCA = 4660 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_DDE = 32891 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_DEBNI = 43690 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_DECAM = 32840 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_DECCUST = 24582 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_DECDIAG = 24581 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_DECDNS = 32828 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_DECDTS = 32830 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_DECEXPER = 24576 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_DECLAST = 32833 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_DECLTM = 32831 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_DECMUMPS = 24585 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_DECNETBIOS = 32832 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_DELTACON = 34526 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_DIDDLE = 17185 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_DLOG1 = 1632 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_DLOG2 = 1633 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_DN = 24579 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_DOGFIGHT = 6537 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_DSMD = 32825 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_ECMA = 2051 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_ENCRYPT = 32829 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_ES = 32861 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_EXCELAN = 32784 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_EXPERDATA = 32841 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_FLIP = 33094 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_FLOWCONTROL = 34824 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_FRARP = 2056 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_GENDYN = 32872 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_HAYES = 33072 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_HIPPI_FP = 33152 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_HITACHI = 34848 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_HP = 32773 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_IEEEPUP = 2560 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_IEEEPUPAT = 2561 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_IMLBL = 19522 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_IMLBLDIAG = 16972 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_IP = 2048 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_IPAS = 34668 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_IPV6 = 34525 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_IPX = 33079 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_IPXNEW = 32823 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_KALPANA = 34178 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_LANBRIDGE = 32824 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_LANPROBE = 34952 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_LAT = 24580 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_LBACK = 36864 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_LITTLE = 32864 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_LOGICRAFT = 33096 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_LOOPBACK = 36864 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_MATRA = 32890 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_MAX = 65535 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_MERIT = 32892 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_MICP = 34618 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_MOPDL = 24577 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_MOPRC = 24578 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_MOTOROLA = 33165 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_MPLS = 34887 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_MPLS_MCAST = 34888 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_MUMPS = 33087 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_NBPCC = 15364 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_NBPCLAIM = 15369 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_NBPCLREQ = 15365 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_NBPCLRSP = 15366 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_NBPCREQ = 15362 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_NBPCRSP = 15363 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_NBPDG = 15367 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_NBPDGB = 15368 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_NBPDLTE = 15370 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_NBPRAR = 15372 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_NBPRAS = 15371 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_NBPRST = 15373 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_NBPSCD = 15361 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_NBPVCD = 15360 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_NBS = 2050 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_NCD = 33097 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_NESTAR = 32774 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_NETBEUI = 33169 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_NOVELL = 33080 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_NS = 1536 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_NSAT = 1537 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_NSCOMPAT = 2055 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_NTRAILER = 16 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_OS9 = 28679 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_OS9NET = 28681 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_PACER = 32966 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_PAE = 34958 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_PCS = 16962 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_PLANNING = 32836 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_PPP = 34827 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_PPPOE = 34916 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_PPPOEDISC = 34915 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_PRIMENTS = 28721 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_PUP = 512 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_PUPAT = 512 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_RACAL = 28720 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_RATIONAL = 33104 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_RAWFR = 25945 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_RCL = 6549 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_RDP = 34617 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_RETIX = 33010 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_REVARP = 32821 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_SCA = 24583 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_SECTRA = 34523 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_SECUREDATA = 34669 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_SGITW = 33150 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_SG_BOUNCE = 32790 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_SG_DIAG = 32787 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_SG_NETGAMES = 32788 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_SG_RESV = 32789 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_SIMNET = 21000 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_SLOWPROTOCOLS = 34825 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_SNA = 32981 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_SNMP = 33100 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_SONIX = 64245 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_SPIDER = 32927 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_SPRITE = 1280 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_STP = 33153 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_TALARIS = 33067 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_TALARISMC = 34091 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_TCPCOMP = 34667 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_TCPSM = 36866 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_TEC = 33103 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_TIGAN = 32815 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_TRAIL = 4096 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_TRANSETHER = 25944 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_TYMSHARE = 32814 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_UBBST = 28677 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_UBDEBUG = 2304 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_UBDIAGLOOP = 28674 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_UBDL = 28672 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_UBNIU = 28673 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_UBNMC = 28675 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_VALID = 5632 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_VARIAN = 32989 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_VAXELN = 32827 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_VEECO = 32871 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_VEXP = 32859 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_VGLAB = 33073 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_VINES = 2989 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_VINESECHO = 2991 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_VINESLOOP = 2990 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_VITAL = 65280 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_VLAN = 33024 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_VLTLMAN = 32896 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_VPROD = 32860 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_VURESERVED = 33095 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_WATERLOO = 33072 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_WELLFLEET = 33027 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_X25 = 2053 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_X75 = 2049 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_XNSSM = 36865 +pkg syscall (netbsd-386-cgo), const ETHERTYPE_XTP = 33149 +pkg syscall (netbsd-386-cgo), const ETHER_ADDR_LEN = 6 +pkg syscall (netbsd-386-cgo), const ETHER_CRC_LEN = 4 +pkg syscall (netbsd-386-cgo), const ETHER_CRC_POLY_BE = 79764918 +pkg syscall (netbsd-386-cgo), const ETHER_CRC_POLY_LE = 3988292384 +pkg syscall (netbsd-386-cgo), const ETHER_HDR_LEN = 14 +pkg syscall (netbsd-386-cgo), const ETHER_MAX_LEN = 1518 +pkg syscall (netbsd-386-cgo), const ETHER_MAX_LEN_JUMBO = 9018 +pkg syscall (netbsd-386-cgo), const ETHER_MIN_LEN = 64 +pkg syscall (netbsd-386-cgo), const ETHER_PPPOE_ENCAP_LEN = 8 +pkg syscall (netbsd-386-cgo), const ETHER_TYPE_LEN = 2 +pkg syscall (netbsd-386-cgo), const ETHER_VLAN_ENCAP_LEN = 4 +pkg syscall (netbsd-386-cgo), const ETIME = 92 +pkg syscall (netbsd-386-cgo), const ETIMEDOUT = 60 +pkg syscall (netbsd-386-cgo), const ETOOMANYREFS = 59 +pkg syscall (netbsd-386-cgo), const ETXTBSY = 26 +pkg syscall (netbsd-386-cgo), const EUSERS = 68 +pkg syscall (netbsd-386-cgo), const EVFILT_AIO = 2 +pkg syscall (netbsd-386-cgo), const EVFILT_PROC = 4 +pkg syscall (netbsd-386-cgo), const EVFILT_READ = 0 +pkg syscall (netbsd-386-cgo), const EVFILT_SIGNAL = 5 +pkg syscall (netbsd-386-cgo), const EVFILT_SYSCOUNT = 7 +pkg syscall (netbsd-386-cgo), const EVFILT_TIMER = 6 +pkg syscall (netbsd-386-cgo), const EVFILT_VNODE = 3 +pkg syscall (netbsd-386-cgo), const EVFILT_WRITE = 1 +pkg syscall (netbsd-386-cgo), const EV_ADD = 1 +pkg syscall (netbsd-386-cgo), const EV_CLEAR = 32 +pkg syscall (netbsd-386-cgo), const EV_DELETE = 2 +pkg syscall (netbsd-386-cgo), const EV_DISABLE = 8 +pkg syscall (netbsd-386-cgo), const EV_ENABLE = 4 +pkg syscall (netbsd-386-cgo), const EV_EOF = 32768 +pkg syscall (netbsd-386-cgo), const EV_ERROR = 16384 +pkg syscall (netbsd-386-cgo), const EV_FLAG1 = 8192 +pkg syscall (netbsd-386-cgo), const EV_ONESHOT = 16 +pkg syscall (netbsd-386-cgo), const EV_SYSFLAGS = 61440 +pkg syscall (netbsd-386-cgo), const EWOULDBLOCK = 35 +pkg syscall (netbsd-386-cgo), const EXDEV = 18 +pkg syscall (netbsd-386-cgo), const EXTA = 19200 +pkg syscall (netbsd-386-cgo), const EXTB = 38400 +pkg syscall (netbsd-386-cgo), const EXTPROC = 2048 +pkg syscall (netbsd-386-cgo), const FD_CLOEXEC = 1 +pkg syscall (netbsd-386-cgo), const FD_SETSIZE = 256 +pkg syscall (netbsd-386-cgo), const FLUSHO = 8388608 +pkg syscall (netbsd-386-cgo), const F_CLOSEM = 10 +pkg syscall (netbsd-386-cgo), const F_DUPFD = 0 +pkg syscall (netbsd-386-cgo), const F_DUPFD_CLOEXEC = 12 +pkg syscall (netbsd-386-cgo), const F_FSCTL = -2147483648 +pkg syscall (netbsd-386-cgo), const F_FSDIRMASK = 1879048192 +pkg syscall (netbsd-386-cgo), const F_FSIN = 268435456 +pkg syscall (netbsd-386-cgo), const F_FSINOUT = 805306368 +pkg syscall (netbsd-386-cgo), const F_FSOUT = 536870912 +pkg syscall (netbsd-386-cgo), const F_FSPRIV = 32768 +pkg syscall (netbsd-386-cgo), const F_FSVOID = 1073741824 +pkg syscall (netbsd-386-cgo), const F_GETFD = 1 +pkg syscall (netbsd-386-cgo), const F_GETFL = 3 +pkg syscall (netbsd-386-cgo), const F_GETLK = 7 +pkg syscall (netbsd-386-cgo), const F_GETNOSIGPIPE = 13 +pkg syscall (netbsd-386-cgo), const F_GETOWN = 5 +pkg syscall (netbsd-386-cgo), const F_MAXFD = 11 +pkg syscall (netbsd-386-cgo), const F_OK = 0 +pkg syscall (netbsd-386-cgo), const F_PARAM_MASK = 4095 +pkg syscall (netbsd-386-cgo), const F_PARAM_MAX = 4095 +pkg syscall (netbsd-386-cgo), const F_RDLCK = 1 +pkg syscall (netbsd-386-cgo), const F_SETFD = 2 +pkg syscall (netbsd-386-cgo), const F_SETFL = 4 +pkg syscall (netbsd-386-cgo), const F_SETLK = 8 +pkg syscall (netbsd-386-cgo), const F_SETLKW = 9 +pkg syscall (netbsd-386-cgo), const F_SETNOSIGPIPE = 14 +pkg syscall (netbsd-386-cgo), const F_SETOWN = 6 +pkg syscall (netbsd-386-cgo), const F_UNLCK = 2 +pkg syscall (netbsd-386-cgo), const F_WRLCK = 3 +pkg syscall (netbsd-386-cgo), const HUPCL = 16384 +pkg syscall (netbsd-386-cgo), const ICANON = 256 +pkg syscall (netbsd-386-cgo), const ICRNL = 256 +pkg syscall (netbsd-386-cgo), const IEXTEN = 1024 +pkg syscall (netbsd-386-cgo), const IFAN_ARRIVAL = 0 +pkg syscall (netbsd-386-cgo), const IFAN_DEPARTURE = 1 +pkg syscall (netbsd-386-cgo), const IFA_ROUTE = 1 +pkg syscall (netbsd-386-cgo), const IFF_ALLMULTI = 512 +pkg syscall (netbsd-386-cgo), const IFF_CANTCHANGE = 36690 +pkg syscall (netbsd-386-cgo), const IFF_DEBUG = 4 +pkg syscall (netbsd-386-cgo), const IFF_LINK0 = 4096 +pkg syscall (netbsd-386-cgo), const IFF_LINK1 = 8192 +pkg syscall (netbsd-386-cgo), const IFF_LINK2 = 16384 +pkg syscall (netbsd-386-cgo), const IFF_LOOPBACK = 8 +pkg syscall (netbsd-386-cgo), const IFF_MULTICAST = 32768 +pkg syscall (netbsd-386-cgo), const IFF_NOARP = 128 +pkg syscall (netbsd-386-cgo), const IFF_NOTRAILERS = 32 +pkg syscall (netbsd-386-cgo), const IFF_OACTIVE = 1024 +pkg syscall (netbsd-386-cgo), const IFF_POINTOPOINT = 16 +pkg syscall (netbsd-386-cgo), const IFF_PROMISC = 256 +pkg syscall (netbsd-386-cgo), const IFF_RUNNING = 64 +pkg syscall (netbsd-386-cgo), const IFF_SIMPLEX = 2048 +pkg syscall (netbsd-386-cgo), const IFNAMSIZ = 16 +pkg syscall (netbsd-386-cgo), const IFT_1822 = 2 +pkg syscall (netbsd-386-cgo), const IFT_A12MPPSWITCH = 130 +pkg syscall (netbsd-386-cgo), const IFT_AAL2 = 187 +pkg syscall (netbsd-386-cgo), const IFT_AAL5 = 49 +pkg syscall (netbsd-386-cgo), const IFT_ADSL = 94 +pkg syscall (netbsd-386-cgo), const IFT_AFLANE8023 = 59 +pkg syscall (netbsd-386-cgo), const IFT_AFLANE8025 = 60 +pkg syscall (netbsd-386-cgo), const IFT_ARAP = 88 +pkg syscall (netbsd-386-cgo), const IFT_ARCNET = 35 +pkg syscall (netbsd-386-cgo), const IFT_ARCNETPLUS = 36 +pkg syscall (netbsd-386-cgo), const IFT_ASYNC = 84 +pkg syscall (netbsd-386-cgo), const IFT_ATM = 37 +pkg syscall (netbsd-386-cgo), const IFT_ATMDXI = 105 +pkg syscall (netbsd-386-cgo), const IFT_ATMFUNI = 106 +pkg syscall (netbsd-386-cgo), const IFT_ATMIMA = 107 +pkg syscall (netbsd-386-cgo), const IFT_ATMLOGICAL = 80 +pkg syscall (netbsd-386-cgo), const IFT_ATMRADIO = 189 +pkg syscall (netbsd-386-cgo), const IFT_ATMSUBINTERFACE = 134 +pkg syscall (netbsd-386-cgo), const IFT_ATMVCIENDPT = 194 +pkg syscall (netbsd-386-cgo), const IFT_ATMVIRTUAL = 149 +pkg syscall (netbsd-386-cgo), const IFT_BGPPOLICYACCOUNTING = 162 +pkg syscall (netbsd-386-cgo), const IFT_BRIDGE = 209 +pkg syscall (netbsd-386-cgo), const IFT_BSC = 83 +pkg syscall (netbsd-386-cgo), const IFT_CARP = 248 +pkg syscall (netbsd-386-cgo), const IFT_CCTEMUL = 61 +pkg syscall (netbsd-386-cgo), const IFT_CEPT = 19 +pkg syscall (netbsd-386-cgo), const IFT_CES = 133 +pkg syscall (netbsd-386-cgo), const IFT_CHANNEL = 70 +pkg syscall (netbsd-386-cgo), const IFT_CNR = 85 +pkg syscall (netbsd-386-cgo), const IFT_COFFEE = 132 +pkg syscall (netbsd-386-cgo), const IFT_COMPOSITELINK = 155 +pkg syscall (netbsd-386-cgo), const IFT_DCN = 141 +pkg syscall (netbsd-386-cgo), const IFT_DIGITALPOWERLINE = 138 +pkg syscall (netbsd-386-cgo), const IFT_DIGITALWRAPPEROVERHEADCHANNEL = 186 +pkg syscall (netbsd-386-cgo), const IFT_DLSW = 74 +pkg syscall (netbsd-386-cgo), const IFT_DOCSCABLEDOWNSTREAM = 128 +pkg syscall (netbsd-386-cgo), const IFT_DOCSCABLEMACLAYER = 127 +pkg syscall (netbsd-386-cgo), const IFT_DOCSCABLEUPSTREAM = 129 +pkg syscall (netbsd-386-cgo), const IFT_DOCSCABLEUPSTREAMCHANNEL = 205 +pkg syscall (netbsd-386-cgo), const IFT_DS0 = 81 +pkg syscall (netbsd-386-cgo), const IFT_DS0BUNDLE = 82 +pkg syscall (netbsd-386-cgo), const IFT_DS1FDL = 170 +pkg syscall (netbsd-386-cgo), const IFT_DS3 = 30 +pkg syscall (netbsd-386-cgo), const IFT_DTM = 140 +pkg syscall (netbsd-386-cgo), const IFT_DVBASILN = 172 +pkg syscall (netbsd-386-cgo), const IFT_DVBASIOUT = 173 +pkg syscall (netbsd-386-cgo), const IFT_DVBRCCDOWNSTREAM = 147 +pkg syscall (netbsd-386-cgo), const IFT_DVBRCCMACLAYER = 146 +pkg syscall (netbsd-386-cgo), const IFT_DVBRCCUPSTREAM = 148 +pkg syscall (netbsd-386-cgo), const IFT_ECONET = 206 +pkg syscall (netbsd-386-cgo), const IFT_EON = 25 +pkg syscall (netbsd-386-cgo), const IFT_EPLRS = 87 +pkg syscall (netbsd-386-cgo), const IFT_ESCON = 73 +pkg syscall (netbsd-386-cgo), const IFT_ETHER = 6 +pkg syscall (netbsd-386-cgo), const IFT_FAITH = 242 +pkg syscall (netbsd-386-cgo), const IFT_FAST = 125 +pkg syscall (netbsd-386-cgo), const IFT_FASTETHER = 62 +pkg syscall (netbsd-386-cgo), const IFT_FASTETHERFX = 69 +pkg syscall (netbsd-386-cgo), const IFT_FDDI = 15 +pkg syscall (netbsd-386-cgo), const IFT_FIBRECHANNEL = 56 +pkg syscall (netbsd-386-cgo), const IFT_FRAMERELAYINTERCONNECT = 58 +pkg syscall (netbsd-386-cgo), const IFT_FRAMERELAYMPI = 92 +pkg syscall (netbsd-386-cgo), const IFT_FRDLCIENDPT = 193 +pkg syscall (netbsd-386-cgo), const IFT_FRELAY = 32 +pkg syscall (netbsd-386-cgo), const IFT_FRELAYDCE = 44 +pkg syscall (netbsd-386-cgo), const IFT_FRF16MFRBUNDLE = 163 +pkg syscall (netbsd-386-cgo), const IFT_FRFORWARD = 158 +pkg syscall (netbsd-386-cgo), const IFT_G703AT2MB = 67 +pkg syscall (netbsd-386-cgo), const IFT_G703AT64K = 66 +pkg syscall (netbsd-386-cgo), const IFT_GIF = 240 +pkg syscall (netbsd-386-cgo), const IFT_GIGABITETHERNET = 117 +pkg syscall (netbsd-386-cgo), const IFT_GR303IDT = 178 +pkg syscall (netbsd-386-cgo), const IFT_GR303RDT = 177 +pkg syscall (netbsd-386-cgo), const IFT_H323GATEKEEPER = 164 +pkg syscall (netbsd-386-cgo), const IFT_H323PROXY = 165 +pkg syscall (netbsd-386-cgo), const IFT_HDH1822 = 3 +pkg syscall (netbsd-386-cgo), const IFT_HDLC = 118 +pkg syscall (netbsd-386-cgo), const IFT_HDSL2 = 168 +pkg syscall (netbsd-386-cgo), const IFT_HIPERLAN2 = 183 +pkg syscall (netbsd-386-cgo), const IFT_HIPPI = 47 +pkg syscall (netbsd-386-cgo), const IFT_HIPPIINTERFACE = 57 +pkg syscall (netbsd-386-cgo), const IFT_HOSTPAD = 90 +pkg syscall (netbsd-386-cgo), const IFT_HSSI = 46 +pkg syscall (netbsd-386-cgo), const IFT_HY = 14 +pkg syscall (netbsd-386-cgo), const IFT_IBM370PARCHAN = 72 +pkg syscall (netbsd-386-cgo), const IFT_IDSL = 154 +pkg syscall (netbsd-386-cgo), const IFT_IEEE1394 = 144 +pkg syscall (netbsd-386-cgo), const IFT_IEEE80211 = 71 +pkg syscall (netbsd-386-cgo), const IFT_IEEE80212 = 55 +pkg syscall (netbsd-386-cgo), const IFT_IEEE8023ADLAG = 161 +pkg syscall (netbsd-386-cgo), const IFT_IFGSN = 145 +pkg syscall (netbsd-386-cgo), const IFT_IMT = 190 +pkg syscall (netbsd-386-cgo), const IFT_INFINIBAND = 199 +pkg syscall (netbsd-386-cgo), const IFT_INTERLEAVE = 124 +pkg syscall (netbsd-386-cgo), const IFT_IP = 126 +pkg syscall (netbsd-386-cgo), const IFT_IPFORWARD = 142 +pkg syscall (netbsd-386-cgo), const IFT_IPOVERATM = 114 +pkg syscall (netbsd-386-cgo), const IFT_IPOVERCDLC = 109 +pkg syscall (netbsd-386-cgo), const IFT_IPOVERCLAW = 110 +pkg syscall (netbsd-386-cgo), const IFT_IPSWITCH = 78 +pkg syscall (netbsd-386-cgo), const IFT_ISDN = 63 +pkg syscall (netbsd-386-cgo), const IFT_ISDNBASIC = 20 +pkg syscall (netbsd-386-cgo), const IFT_ISDNPRIMARY = 21 +pkg syscall (netbsd-386-cgo), const IFT_ISDNS = 75 +pkg syscall (netbsd-386-cgo), const IFT_ISDNU = 76 +pkg syscall (netbsd-386-cgo), const IFT_ISO88022LLC = 41 +pkg syscall (netbsd-386-cgo), const IFT_ISO88023 = 7 +pkg syscall (netbsd-386-cgo), const IFT_ISO88024 = 8 +pkg syscall (netbsd-386-cgo), const IFT_ISO88025 = 9 +pkg syscall (netbsd-386-cgo), const IFT_ISO88025CRFPINT = 98 +pkg syscall (netbsd-386-cgo), const IFT_ISO88025DTR = 86 +pkg syscall (netbsd-386-cgo), const IFT_ISO88025FIBER = 115 +pkg syscall (netbsd-386-cgo), const IFT_ISO88026 = 10 +pkg syscall (netbsd-386-cgo), const IFT_ISUP = 179 +pkg syscall (netbsd-386-cgo), const IFT_L2VLAN = 135 +pkg syscall (netbsd-386-cgo), const IFT_L3IPVLAN = 136 +pkg syscall (netbsd-386-cgo), const IFT_L3IPXVLAN = 137 +pkg syscall (netbsd-386-cgo), const IFT_LAPB = 16 +pkg syscall (netbsd-386-cgo), const IFT_LAPD = 77 +pkg syscall (netbsd-386-cgo), const IFT_LAPF = 119 +pkg syscall (netbsd-386-cgo), const IFT_LINEGROUP = 210 +pkg syscall (netbsd-386-cgo), const IFT_LOCALTALK = 42 +pkg syscall (netbsd-386-cgo), const IFT_LOOP = 24 +pkg syscall (netbsd-386-cgo), const IFT_MEDIAMAILOVERIP = 139 +pkg syscall (netbsd-386-cgo), const IFT_MFSIGLINK = 167 +pkg syscall (netbsd-386-cgo), const IFT_MIOX25 = 38 +pkg syscall (netbsd-386-cgo), const IFT_MODEM = 48 +pkg syscall (netbsd-386-cgo), const IFT_MPC = 113 +pkg syscall (netbsd-386-cgo), const IFT_MPLS = 166 +pkg syscall (netbsd-386-cgo), const IFT_MPLSTUNNEL = 150 +pkg syscall (netbsd-386-cgo), const IFT_MSDSL = 143 +pkg syscall (netbsd-386-cgo), const IFT_MVL = 191 +pkg syscall (netbsd-386-cgo), const IFT_MYRINET = 99 +pkg syscall (netbsd-386-cgo), const IFT_NFAS = 175 +pkg syscall (netbsd-386-cgo), const IFT_NSIP = 27 +pkg syscall (netbsd-386-cgo), const IFT_OPTICALCHANNEL = 195 +pkg syscall (netbsd-386-cgo), const IFT_OPTICALTRANSPORT = 196 +pkg syscall (netbsd-386-cgo), const IFT_OTHER = 1 +pkg syscall (netbsd-386-cgo), const IFT_P10 = 12 +pkg syscall (netbsd-386-cgo), const IFT_P80 = 13 +pkg syscall (netbsd-386-cgo), const IFT_PARA = 34 +pkg syscall (netbsd-386-cgo), const IFT_PFLOG = 245 +pkg syscall (netbsd-386-cgo), const IFT_PFSYNC = 246 +pkg syscall (netbsd-386-cgo), const IFT_PLC = 174 +pkg syscall (netbsd-386-cgo), const IFT_PON155 = 207 +pkg syscall (netbsd-386-cgo), const IFT_PON622 = 208 +pkg syscall (netbsd-386-cgo), const IFT_POS = 171 +pkg syscall (netbsd-386-cgo), const IFT_PPP = 23 +pkg syscall (netbsd-386-cgo), const IFT_PPPMULTILINKBUNDLE = 108 +pkg syscall (netbsd-386-cgo), const IFT_PROPATM = 197 +pkg syscall (netbsd-386-cgo), const IFT_PROPBWAP2MP = 184 +pkg syscall (netbsd-386-cgo), const IFT_PROPCNLS = 89 +pkg syscall (netbsd-386-cgo), const IFT_PROPDOCSWIRELESSDOWNSTREAM = 181 +pkg syscall (netbsd-386-cgo), const IFT_PROPDOCSWIRELESSMACLAYER = 180 +pkg syscall (netbsd-386-cgo), const IFT_PROPDOCSWIRELESSUPSTREAM = 182 +pkg syscall (netbsd-386-cgo), const IFT_PROPMUX = 54 +pkg syscall (netbsd-386-cgo), const IFT_PROPVIRTUAL = 53 +pkg syscall (netbsd-386-cgo), const IFT_PROPWIRELESSP2P = 157 +pkg syscall (netbsd-386-cgo), const IFT_PTPSERIAL = 22 +pkg syscall (netbsd-386-cgo), const IFT_PVC = 241 +pkg syscall (netbsd-386-cgo), const IFT_Q2931 = 201 +pkg syscall (netbsd-386-cgo), const IFT_QLLC = 68 +pkg syscall (netbsd-386-cgo), const IFT_RADIOMAC = 188 +pkg syscall (netbsd-386-cgo), const IFT_RADSL = 95 +pkg syscall (netbsd-386-cgo), const IFT_REACHDSL = 192 +pkg syscall (netbsd-386-cgo), const IFT_RFC1483 = 159 +pkg syscall (netbsd-386-cgo), const IFT_RS232 = 33 +pkg syscall (netbsd-386-cgo), const IFT_RSRB = 79 +pkg syscall (netbsd-386-cgo), const IFT_SDLC = 17 +pkg syscall (netbsd-386-cgo), const IFT_SDSL = 96 +pkg syscall (netbsd-386-cgo), const IFT_SHDSL = 169 +pkg syscall (netbsd-386-cgo), const IFT_SIP = 31 +pkg syscall (netbsd-386-cgo), const IFT_SIPSIG = 204 +pkg syscall (netbsd-386-cgo), const IFT_SIPTG = 203 +pkg syscall (netbsd-386-cgo), const IFT_SLIP = 28 +pkg syscall (netbsd-386-cgo), const IFT_SMDSDXI = 43 +pkg syscall (netbsd-386-cgo), const IFT_SMDSICIP = 52 +pkg syscall (netbsd-386-cgo), const IFT_SONET = 39 +pkg syscall (netbsd-386-cgo), const IFT_SONETOVERHEADCHANNEL = 185 +pkg syscall (netbsd-386-cgo), const IFT_SONETPATH = 50 +pkg syscall (netbsd-386-cgo), const IFT_SONETVT = 51 +pkg syscall (netbsd-386-cgo), const IFT_SRP = 151 +pkg syscall (netbsd-386-cgo), const IFT_SS7SIGLINK = 156 +pkg syscall (netbsd-386-cgo), const IFT_STACKTOSTACK = 111 +pkg syscall (netbsd-386-cgo), const IFT_STARLAN = 11 +pkg syscall (netbsd-386-cgo), const IFT_STF = 215 +pkg syscall (netbsd-386-cgo), const IFT_T1 = 18 +pkg syscall (netbsd-386-cgo), const IFT_TDLC = 116 +pkg syscall (netbsd-386-cgo), const IFT_TELINK = 200 +pkg syscall (netbsd-386-cgo), const IFT_TERMPAD = 91 +pkg syscall (netbsd-386-cgo), const IFT_TR008 = 176 +pkg syscall (netbsd-386-cgo), const IFT_TRANSPHDLC = 123 +pkg syscall (netbsd-386-cgo), const IFT_TUNNEL = 131 +pkg syscall (netbsd-386-cgo), const IFT_ULTRA = 29 +pkg syscall (netbsd-386-cgo), const IFT_USB = 160 +pkg syscall (netbsd-386-cgo), const IFT_V11 = 64 +pkg syscall (netbsd-386-cgo), const IFT_V35 = 45 +pkg syscall (netbsd-386-cgo), const IFT_V36 = 65 +pkg syscall (netbsd-386-cgo), const IFT_V37 = 120 +pkg syscall (netbsd-386-cgo), const IFT_VDSL = 97 +pkg syscall (netbsd-386-cgo), const IFT_VIRTUALIPADDRESS = 112 +pkg syscall (netbsd-386-cgo), const IFT_VIRTUALTG = 202 +pkg syscall (netbsd-386-cgo), const IFT_VOICEDID = 213 +pkg syscall (netbsd-386-cgo), const IFT_VOICEEM = 100 +pkg syscall (netbsd-386-cgo), const IFT_VOICEEMFGD = 211 +pkg syscall (netbsd-386-cgo), const IFT_VOICEENCAP = 103 +pkg syscall (netbsd-386-cgo), const IFT_VOICEFGDEANA = 212 +pkg syscall (netbsd-386-cgo), const IFT_VOICEFXO = 101 +pkg syscall (netbsd-386-cgo), const IFT_VOICEFXS = 102 +pkg syscall (netbsd-386-cgo), const IFT_VOICEOVERATM = 152 +pkg syscall (netbsd-386-cgo), const IFT_VOICEOVERCABLE = 198 +pkg syscall (netbsd-386-cgo), const IFT_VOICEOVERFRAMERELAY = 153 +pkg syscall (netbsd-386-cgo), const IFT_VOICEOVERIP = 104 +pkg syscall (netbsd-386-cgo), const IFT_X213 = 93 +pkg syscall (netbsd-386-cgo), const IFT_X25 = 5 +pkg syscall (netbsd-386-cgo), const IFT_X25DDN = 4 +pkg syscall (netbsd-386-cgo), const IFT_X25HUNTGROUP = 122 +pkg syscall (netbsd-386-cgo), const IFT_X25MLP = 121 +pkg syscall (netbsd-386-cgo), const IFT_X25PLE = 40 +pkg syscall (netbsd-386-cgo), const IFT_XETHER = 26 +pkg syscall (netbsd-386-cgo), const IGNBRK = 1 +pkg syscall (netbsd-386-cgo), const IGNCR = 128 +pkg syscall (netbsd-386-cgo), const IGNPAR = 4 +pkg syscall (netbsd-386-cgo), const IMAXBEL = 8192 +pkg syscall (netbsd-386-cgo), const INLCR = 64 +pkg syscall (netbsd-386-cgo), const INPCK = 16 +pkg syscall (netbsd-386-cgo), const IN_CLASSA_HOST = 16777215 +pkg syscall (netbsd-386-cgo), const IN_CLASSA_MAX = 128 +pkg syscall (netbsd-386-cgo), const IN_CLASSA_NET = 4278190080 +pkg syscall (netbsd-386-cgo), const IN_CLASSA_NSHIFT = 24 +pkg syscall (netbsd-386-cgo), const IN_CLASSB_HOST = 65535 +pkg syscall (netbsd-386-cgo), const IN_CLASSB_MAX = 65536 +pkg syscall (netbsd-386-cgo), const IN_CLASSB_NET = 4294901760 +pkg syscall (netbsd-386-cgo), const IN_CLASSB_NSHIFT = 16 +pkg syscall (netbsd-386-cgo), const IN_CLASSC_HOST = 255 +pkg syscall (netbsd-386-cgo), const IN_CLASSC_NET = 4294967040 +pkg syscall (netbsd-386-cgo), const IN_CLASSC_NSHIFT = 8 +pkg syscall (netbsd-386-cgo), const IN_CLASSD_HOST = 268435455 +pkg syscall (netbsd-386-cgo), const IN_CLASSD_NET = 4026531840 +pkg syscall (netbsd-386-cgo), const IN_CLASSD_NSHIFT = 28 +pkg syscall (netbsd-386-cgo), const IN_LOOPBACKNET = 127 +pkg syscall (netbsd-386-cgo), const IPPROTO_AH = 51 +pkg syscall (netbsd-386-cgo), const IPPROTO_CARP = 112 +pkg syscall (netbsd-386-cgo), const IPPROTO_DONE = 257 +pkg syscall (netbsd-386-cgo), const IPPROTO_DSTOPTS = 60 +pkg syscall (netbsd-386-cgo), const IPPROTO_EGP = 8 +pkg syscall (netbsd-386-cgo), const IPPROTO_ENCAP = 98 +pkg syscall (netbsd-386-cgo), const IPPROTO_EON = 80 +pkg syscall (netbsd-386-cgo), const IPPROTO_ESP = 50 +pkg syscall (netbsd-386-cgo), const IPPROTO_ETHERIP = 97 +pkg syscall (netbsd-386-cgo), const IPPROTO_FRAGMENT = 44 +pkg syscall (netbsd-386-cgo), const IPPROTO_GGP = 3 +pkg syscall (netbsd-386-cgo), const IPPROTO_GRE = 47 +pkg syscall (netbsd-386-cgo), const IPPROTO_HOPOPTS = 0 +pkg syscall (netbsd-386-cgo), const IPPROTO_ICMP = 1 +pkg syscall (netbsd-386-cgo), const IPPROTO_ICMPV6 = 58 +pkg syscall (netbsd-386-cgo), const IPPROTO_IDP = 22 +pkg syscall (netbsd-386-cgo), const IPPROTO_IGMP = 2 +pkg syscall (netbsd-386-cgo), const IPPROTO_IPCOMP = 108 +pkg syscall (netbsd-386-cgo), const IPPROTO_IPIP = 4 +pkg syscall (netbsd-386-cgo), const IPPROTO_IPV4 = 4 +pkg syscall (netbsd-386-cgo), const IPPROTO_IPV6_ICMP = 58 +pkg syscall (netbsd-386-cgo), const IPPROTO_MAX = 256 +pkg syscall (netbsd-386-cgo), const IPPROTO_MAXID = 52 +pkg syscall (netbsd-386-cgo), const IPPROTO_MOBILE = 55 +pkg syscall (netbsd-386-cgo), const IPPROTO_NONE = 59 +pkg syscall (netbsd-386-cgo), const IPPROTO_PFSYNC = 240 +pkg syscall (netbsd-386-cgo), const IPPROTO_PIM = 103 +pkg syscall (netbsd-386-cgo), const IPPROTO_PUP = 12 +pkg syscall (netbsd-386-cgo), const IPPROTO_RAW = 255 +pkg syscall (netbsd-386-cgo), const IPPROTO_ROUTING = 43 +pkg syscall (netbsd-386-cgo), const IPPROTO_RSVP = 46 +pkg syscall (netbsd-386-cgo), const IPPROTO_TP = 29 +pkg syscall (netbsd-386-cgo), const IPPROTO_VRRP = 112 +pkg syscall (netbsd-386-cgo), const IPV6_CHECKSUM = 26 +pkg syscall (netbsd-386-cgo), const IPV6_DEFAULT_MULTICAST_HOPS = 1 +pkg syscall (netbsd-386-cgo), const IPV6_DEFAULT_MULTICAST_LOOP = 1 +pkg syscall (netbsd-386-cgo), const IPV6_DEFHLIM = 64 +pkg syscall (netbsd-386-cgo), const IPV6_DONTFRAG = 62 +pkg syscall (netbsd-386-cgo), const IPV6_DSTOPTS = 50 +pkg syscall (netbsd-386-cgo), const IPV6_FAITH = 29 +pkg syscall (netbsd-386-cgo), const IPV6_FLOWINFO_MASK = 4294967055 +pkg syscall (netbsd-386-cgo), const IPV6_FLOWLABEL_MASK = 4294905600 +pkg syscall (netbsd-386-cgo), const IPV6_FRAGTTL = 120 +pkg syscall (netbsd-386-cgo), const IPV6_HLIMDEC = 1 +pkg syscall (netbsd-386-cgo), const IPV6_HOPLIMIT = 47 +pkg syscall (netbsd-386-cgo), const IPV6_HOPOPTS = 49 +pkg syscall (netbsd-386-cgo), const IPV6_IPSEC_POLICY = 28 +pkg syscall (netbsd-386-cgo), const IPV6_JOIN_GROUP = 12 +pkg syscall (netbsd-386-cgo), const IPV6_LEAVE_GROUP = 13 +pkg syscall (netbsd-386-cgo), const IPV6_MAXHLIM = 255 +pkg syscall (netbsd-386-cgo), const IPV6_MAXPACKET = 65535 +pkg syscall (netbsd-386-cgo), const IPV6_MMTU = 1280 +pkg syscall (netbsd-386-cgo), const IPV6_MULTICAST_HOPS = 10 +pkg syscall (netbsd-386-cgo), const IPV6_MULTICAST_IF = 9 +pkg syscall (netbsd-386-cgo), const IPV6_MULTICAST_LOOP = 11 +pkg syscall (netbsd-386-cgo), const IPV6_NEXTHOP = 48 +pkg syscall (netbsd-386-cgo), const IPV6_PATHMTU = 44 +pkg syscall (netbsd-386-cgo), const IPV6_PKTINFO = 46 +pkg syscall (netbsd-386-cgo), const IPV6_PORTRANGE = 14 +pkg syscall (netbsd-386-cgo), const IPV6_PORTRANGE_DEFAULT = 0 +pkg syscall (netbsd-386-cgo), const IPV6_PORTRANGE_HIGH = 1 +pkg syscall (netbsd-386-cgo), const IPV6_PORTRANGE_LOW = 2 +pkg syscall (netbsd-386-cgo), const IPV6_RECVDSTOPTS = 40 +pkg syscall (netbsd-386-cgo), const IPV6_RECVHOPLIMIT = 37 +pkg syscall (netbsd-386-cgo), const IPV6_RECVHOPOPTS = 39 +pkg syscall (netbsd-386-cgo), const IPV6_RECVPATHMTU = 43 +pkg syscall (netbsd-386-cgo), const IPV6_RECVPKTINFO = 36 +pkg syscall (netbsd-386-cgo), const IPV6_RECVRTHDR = 38 +pkg syscall (netbsd-386-cgo), const IPV6_RECVTCLASS = 57 +pkg syscall (netbsd-386-cgo), const IPV6_RTHDR = 51 +pkg syscall (netbsd-386-cgo), const IPV6_RTHDRDSTOPTS = 35 +pkg syscall (netbsd-386-cgo), const IPV6_RTHDR_LOOSE = 0 +pkg syscall (netbsd-386-cgo), const IPV6_RTHDR_STRICT = 1 +pkg syscall (netbsd-386-cgo), const IPV6_RTHDR_TYPE_0 = 0 +pkg syscall (netbsd-386-cgo), const IPV6_SOCKOPT_RESERVED1 = 3 +pkg syscall (netbsd-386-cgo), const IPV6_TCLASS = 61 +pkg syscall (netbsd-386-cgo), const IPV6_UNICAST_HOPS = 4 +pkg syscall (netbsd-386-cgo), const IPV6_USE_MIN_MTU = 42 +pkg syscall (netbsd-386-cgo), const IPV6_V6ONLY = 27 +pkg syscall (netbsd-386-cgo), const IPV6_VERSION = 96 +pkg syscall (netbsd-386-cgo), const IPV6_VERSION_MASK = 240 +pkg syscall (netbsd-386-cgo), const IP_ADD_MEMBERSHIP = 12 +pkg syscall (netbsd-386-cgo), const IP_DEFAULT_MULTICAST_LOOP = 1 +pkg syscall (netbsd-386-cgo), const IP_DEFAULT_MULTICAST_TTL = 1 +pkg syscall (netbsd-386-cgo), const IP_DF = 16384 +pkg syscall (netbsd-386-cgo), const IP_DROP_MEMBERSHIP = 13 +pkg syscall (netbsd-386-cgo), const IP_EF = 32768 +pkg syscall (netbsd-386-cgo), const IP_ERRORMTU = 21 +pkg syscall (netbsd-386-cgo), const IP_HDRINCL = 2 +pkg syscall (netbsd-386-cgo), const IP_IPSEC_POLICY = 22 +pkg syscall (netbsd-386-cgo), const IP_MAXPACKET = 65535 +pkg syscall (netbsd-386-cgo), const IP_MAX_MEMBERSHIPS = 20 +pkg syscall (netbsd-386-cgo), const IP_MF = 8192 +pkg syscall (netbsd-386-cgo), const IP_MINFRAGSIZE = 69 +pkg syscall (netbsd-386-cgo), const IP_MINTTL = 24 +pkg syscall (netbsd-386-cgo), const IP_MSS = 576 +pkg syscall (netbsd-386-cgo), const IP_MULTICAST_IF = 9 +pkg syscall (netbsd-386-cgo), const IP_MULTICAST_LOOP = 11 +pkg syscall (netbsd-386-cgo), const IP_MULTICAST_TTL = 10 +pkg syscall (netbsd-386-cgo), const IP_OFFMASK = 8191 +pkg syscall (netbsd-386-cgo), const IP_OPTIONS = 1 +pkg syscall (netbsd-386-cgo), const IP_PORTRANGE = 19 +pkg syscall (netbsd-386-cgo), const IP_PORTRANGE_DEFAULT = 0 +pkg syscall (netbsd-386-cgo), const IP_PORTRANGE_HIGH = 1 +pkg syscall (netbsd-386-cgo), const IP_PORTRANGE_LOW = 2 +pkg syscall (netbsd-386-cgo), const IP_RECVDSTADDR = 7 +pkg syscall (netbsd-386-cgo), const IP_RECVIF = 20 +pkg syscall (netbsd-386-cgo), const IP_RECVOPTS = 5 +pkg syscall (netbsd-386-cgo), const IP_RECVRETOPTS = 6 +pkg syscall (netbsd-386-cgo), const IP_RECVTTL = 23 +pkg syscall (netbsd-386-cgo), const IP_RETOPTS = 8 +pkg syscall (netbsd-386-cgo), const IP_RF = 32768 +pkg syscall (netbsd-386-cgo), const IP_TOS = 3 +pkg syscall (netbsd-386-cgo), const IP_TTL = 4 +pkg syscall (netbsd-386-cgo), const ISIG = 128 +pkg syscall (netbsd-386-cgo), const ISTRIP = 32 +pkg syscall (netbsd-386-cgo), const IXANY = 2048 +pkg syscall (netbsd-386-cgo), const IXOFF = 1024 +pkg syscall (netbsd-386-cgo), const IXON = 512 +pkg syscall (netbsd-386-cgo), const ImplementsGetwd = false +pkg syscall (netbsd-386-cgo), const LOCK_EX = 2 +pkg syscall (netbsd-386-cgo), const LOCK_NB = 4 +pkg syscall (netbsd-386-cgo), const LOCK_SH = 1 +pkg syscall (netbsd-386-cgo), const LOCK_UN = 8 +pkg syscall (netbsd-386-cgo), const MSG_BCAST = 256 +pkg syscall (netbsd-386-cgo), const MSG_CMSG_CLOEXEC = 2048 +pkg syscall (netbsd-386-cgo), const MSG_CONTROLMBUF = 33554432 +pkg syscall (netbsd-386-cgo), const MSG_CTRUNC = 32 +pkg syscall (netbsd-386-cgo), const MSG_DONTROUTE = 4 +pkg syscall (netbsd-386-cgo), const MSG_DONTWAIT = 128 +pkg syscall (netbsd-386-cgo), const MSG_EOR = 8 +pkg syscall (netbsd-386-cgo), const MSG_IOVUSRSPACE = 67108864 +pkg syscall (netbsd-386-cgo), const MSG_LENUSRSPACE = 134217728 +pkg syscall (netbsd-386-cgo), const MSG_MCAST = 512 +pkg syscall (netbsd-386-cgo), const MSG_NAMEMBUF = 16777216 +pkg syscall (netbsd-386-cgo), const MSG_NBIO = 4096 +pkg syscall (netbsd-386-cgo), const MSG_NOSIGNAL = 1024 +pkg syscall (netbsd-386-cgo), const MSG_OOB = 1 +pkg syscall (netbsd-386-cgo), const MSG_PEEK = 2 +pkg syscall (netbsd-386-cgo), const MSG_TRUNC = 16 +pkg syscall (netbsd-386-cgo), const MSG_USERFLAGS = 16777215 +pkg syscall (netbsd-386-cgo), const MSG_WAITALL = 64 +pkg syscall (netbsd-386-cgo), const NAME_MAX = 511 +pkg syscall (netbsd-386-cgo), const NET_RT_DUMP = 1 +pkg syscall (netbsd-386-cgo), const NET_RT_FLAGS = 2 +pkg syscall (netbsd-386-cgo), const NET_RT_IFLIST = 5 +pkg syscall (netbsd-386-cgo), const NET_RT_MAXID = 6 +pkg syscall (netbsd-386-cgo), const NET_RT_OIFLIST = 4 +pkg syscall (netbsd-386-cgo), const NET_RT_OOIFLIST = 3 +pkg syscall (netbsd-386-cgo), const NOFLSH = 2147483648 +pkg syscall (netbsd-386-cgo), const NOTE_ATTRIB = 8 +pkg syscall (netbsd-386-cgo), const NOTE_CHILD = 4 +pkg syscall (netbsd-386-cgo), const NOTE_DELETE = 1 +pkg syscall (netbsd-386-cgo), const NOTE_EXEC = 536870912 +pkg syscall (netbsd-386-cgo), const NOTE_EXIT = 2147483648 +pkg syscall (netbsd-386-cgo), const NOTE_EXTEND = 4 +pkg syscall (netbsd-386-cgo), const NOTE_FORK = 1073741824 +pkg syscall (netbsd-386-cgo), const NOTE_LINK = 16 +pkg syscall (netbsd-386-cgo), const NOTE_LOWAT = 1 +pkg syscall (netbsd-386-cgo), const NOTE_PCTRLMASK = 4026531840 +pkg syscall (netbsd-386-cgo), const NOTE_PDATAMASK = 1048575 +pkg syscall (netbsd-386-cgo), const NOTE_RENAME = 32 +pkg syscall (netbsd-386-cgo), const NOTE_REVOKE = 64 +pkg syscall (netbsd-386-cgo), const NOTE_TRACK = 1 +pkg syscall (netbsd-386-cgo), const NOTE_TRACKERR = 2 +pkg syscall (netbsd-386-cgo), const NOTE_WRITE = 2 +pkg syscall (netbsd-386-cgo), const OCRNL = 16 +pkg syscall (netbsd-386-cgo), const OFIOGETBMAP = 3221513850 +pkg syscall (netbsd-386-cgo), const ONLCR = 2 +pkg syscall (netbsd-386-cgo), const ONLRET = 64 +pkg syscall (netbsd-386-cgo), const ONOCR = 32 +pkg syscall (netbsd-386-cgo), const ONOEOT = 8 +pkg syscall (netbsd-386-cgo), const OPOST = 1 +pkg syscall (netbsd-386-cgo), const O_ACCMODE = 3 +pkg syscall (netbsd-386-cgo), const O_ALT_IO = 262144 +pkg syscall (netbsd-386-cgo), const O_APPEND = 8 +pkg syscall (netbsd-386-cgo), const O_ASYNC = 64 +pkg syscall (netbsd-386-cgo), const O_CLOEXEC = 4194304 +pkg syscall (netbsd-386-cgo), const O_CREAT = 512 +pkg syscall (netbsd-386-cgo), const O_DIRECT = 524288 +pkg syscall (netbsd-386-cgo), const O_DIRECTORY = 2097152 +pkg syscall (netbsd-386-cgo), const O_DSYNC = 65536 +pkg syscall (netbsd-386-cgo), const O_EXCL = 2048 +pkg syscall (netbsd-386-cgo), const O_EXLOCK = 32 +pkg syscall (netbsd-386-cgo), const O_FSYNC = 128 +pkg syscall (netbsd-386-cgo), const O_NDELAY = 4 +pkg syscall (netbsd-386-cgo), const O_NOCTTY = 32768 +pkg syscall (netbsd-386-cgo), const O_NOFOLLOW = 256 +pkg syscall (netbsd-386-cgo), const O_NONBLOCK = 4 +pkg syscall (netbsd-386-cgo), const O_NOSIGPIPE = 16777216 +pkg syscall (netbsd-386-cgo), const O_RSYNC = 131072 +pkg syscall (netbsd-386-cgo), const O_SHLOCK = 16 +pkg syscall (netbsd-386-cgo), const O_SYNC = 128 +pkg syscall (netbsd-386-cgo), const O_TRUNC = 1024 +pkg syscall (netbsd-386-cgo), const PARENB = 4096 +pkg syscall (netbsd-386-cgo), const PARMRK = 8 +pkg syscall (netbsd-386-cgo), const PARODD = 8192 +pkg syscall (netbsd-386-cgo), const PENDIN = 536870912 +pkg syscall (netbsd-386-cgo), const PRI_IOFLUSH = 124 +pkg syscall (netbsd-386-cgo), const PTRACE_CONT = 7 +pkg syscall (netbsd-386-cgo), const PTRACE_KILL = 8 +pkg syscall (netbsd-386-cgo), const PTRACE_TRACEME = 0 +pkg syscall (netbsd-386-cgo), const RLIMIT_AS = 10 +pkg syscall (netbsd-386-cgo), const RLIMIT_CORE = 4 +pkg syscall (netbsd-386-cgo), const RLIMIT_CPU = 0 +pkg syscall (netbsd-386-cgo), const RLIMIT_DATA = 2 +pkg syscall (netbsd-386-cgo), const RLIMIT_FSIZE = 1 +pkg syscall (netbsd-386-cgo), const RLIMIT_NOFILE = 8 +pkg syscall (netbsd-386-cgo), const RLIMIT_STACK = 3 +pkg syscall (netbsd-386-cgo), const RLIM_INFINITY = 9223372036854775807 +pkg syscall (netbsd-386-cgo), const RTAX_AUTHOR = 6 +pkg syscall (netbsd-386-cgo), const RTAX_BRD = 7 +pkg syscall (netbsd-386-cgo), const RTAX_DST = 0 +pkg syscall (netbsd-386-cgo), const RTAX_GATEWAY = 1 +pkg syscall (netbsd-386-cgo), const RTAX_GENMASK = 3 +pkg syscall (netbsd-386-cgo), const RTAX_IFA = 5 +pkg syscall (netbsd-386-cgo), const RTAX_IFP = 4 +pkg syscall (netbsd-386-cgo), const RTAX_MAX = 9 +pkg syscall (netbsd-386-cgo), const RTAX_NETMASK = 2 +pkg syscall (netbsd-386-cgo), const RTAX_TAG = 8 +pkg syscall (netbsd-386-cgo), const RTA_AUTHOR = 64 +pkg syscall (netbsd-386-cgo), const RTA_BRD = 128 +pkg syscall (netbsd-386-cgo), const RTA_DST = 1 +pkg syscall (netbsd-386-cgo), const RTA_GATEWAY = 2 +pkg syscall (netbsd-386-cgo), const RTA_GENMASK = 8 +pkg syscall (netbsd-386-cgo), const RTA_IFA = 32 +pkg syscall (netbsd-386-cgo), const RTA_IFP = 16 +pkg syscall (netbsd-386-cgo), const RTA_NETMASK = 4 +pkg syscall (netbsd-386-cgo), const RTA_TAG = 256 +pkg syscall (netbsd-386-cgo), const RTF_ANNOUNCE = 131072 +pkg syscall (netbsd-386-cgo), const RTF_BLACKHOLE = 4096 +pkg syscall (netbsd-386-cgo), const RTF_CLONED = 8192 +pkg syscall (netbsd-386-cgo), const RTF_CLONING = 256 +pkg syscall (netbsd-386-cgo), const RTF_DONE = 64 +pkg syscall (netbsd-386-cgo), const RTF_DYNAMIC = 16 +pkg syscall (netbsd-386-cgo), const RTF_GATEWAY = 2 +pkg syscall (netbsd-386-cgo), const RTF_HOST = 4 +pkg syscall (netbsd-386-cgo), const RTF_LLINFO = 1024 +pkg syscall (netbsd-386-cgo), const RTF_MASK = 128 +pkg syscall (netbsd-386-cgo), const RTF_MODIFIED = 32 +pkg syscall (netbsd-386-cgo), const RTF_PROTO1 = 32768 +pkg syscall (netbsd-386-cgo), const RTF_PROTO2 = 16384 +pkg syscall (netbsd-386-cgo), const RTF_REJECT = 8 +pkg syscall (netbsd-386-cgo), const RTF_SRC = 65536 +pkg syscall (netbsd-386-cgo), const RTF_STATIC = 2048 +pkg syscall (netbsd-386-cgo), const RTF_UP = 1 +pkg syscall (netbsd-386-cgo), const RTF_XRESOLVE = 512 +pkg syscall (netbsd-386-cgo), const RTM_ADD = 1 +pkg syscall (netbsd-386-cgo), const RTM_CHANGE = 3 +pkg syscall (netbsd-386-cgo), const RTM_CHGADDR = 21 +pkg syscall (netbsd-386-cgo), const RTM_DELADDR = 13 +pkg syscall (netbsd-386-cgo), const RTM_DELETE = 2 +pkg syscall (netbsd-386-cgo), const RTM_GET = 4 +pkg syscall (netbsd-386-cgo), const RTM_IEEE80211 = 17 +pkg syscall (netbsd-386-cgo), const RTM_IFANNOUNCE = 16 +pkg syscall (netbsd-386-cgo), const RTM_IFINFO = 20 +pkg syscall (netbsd-386-cgo), const RTM_LLINFO_UPD = 19 +pkg syscall (netbsd-386-cgo), const RTM_LOCK = 8 +pkg syscall (netbsd-386-cgo), const RTM_LOSING = 5 +pkg syscall (netbsd-386-cgo), const RTM_MISS = 7 +pkg syscall (netbsd-386-cgo), const RTM_NEWADDR = 12 +pkg syscall (netbsd-386-cgo), const RTM_OIFINFO = 15 +pkg syscall (netbsd-386-cgo), const RTM_OLDADD = 9 +pkg syscall (netbsd-386-cgo), const RTM_OLDDEL = 10 +pkg syscall (netbsd-386-cgo), const RTM_OOIFINFO = 14 +pkg syscall (netbsd-386-cgo), const RTM_REDIRECT = 6 +pkg syscall (netbsd-386-cgo), const RTM_RESOLVE = 11 +pkg syscall (netbsd-386-cgo), const RTM_RTTUNIT = 1000000 +pkg syscall (netbsd-386-cgo), const RTM_SETGATE = 18 +pkg syscall (netbsd-386-cgo), const RTM_VERSION = 4 +pkg syscall (netbsd-386-cgo), const RTV_EXPIRE = 4 +pkg syscall (netbsd-386-cgo), const RTV_HOPCOUNT = 2 +pkg syscall (netbsd-386-cgo), const RTV_MTU = 1 +pkg syscall (netbsd-386-cgo), const RTV_RPIPE = 8 +pkg syscall (netbsd-386-cgo), const RTV_RTT = 64 +pkg syscall (netbsd-386-cgo), const RTV_RTTVAR = 128 +pkg syscall (netbsd-386-cgo), const RTV_SPIPE = 16 +pkg syscall (netbsd-386-cgo), const RTV_SSTHRESH = 32 +pkg syscall (netbsd-386-cgo), const RUSAGE_CHILDREN = -1 +pkg syscall (netbsd-386-cgo), const RUSAGE_SELF = 0 +pkg syscall (netbsd-386-cgo), const SCM_CREDS = 4 +pkg syscall (netbsd-386-cgo), const SCM_RIGHTS = 1 +pkg syscall (netbsd-386-cgo), const SCM_TIMESTAMP = 8 +pkg syscall (netbsd-386-cgo), const SIGBUS = 10 +pkg syscall (netbsd-386-cgo), const SIGCHLD = 20 +pkg syscall (netbsd-386-cgo), const SIGCONT = 19 +pkg syscall (netbsd-386-cgo), const SIGEMT = 7 +pkg syscall (netbsd-386-cgo), const SIGINFO = 29 +pkg syscall (netbsd-386-cgo), const SIGIO = 23 +pkg syscall (netbsd-386-cgo), const SIGIOT = 6 +pkg syscall (netbsd-386-cgo), const SIGPROF = 27 +pkg syscall (netbsd-386-cgo), const SIGPWR = 32 +pkg syscall (netbsd-386-cgo), const SIGSTOP = 17 +pkg syscall (netbsd-386-cgo), const SIGSYS = 12 +pkg syscall (netbsd-386-cgo), const SIGTSTP = 18 +pkg syscall (netbsd-386-cgo), const SIGTTIN = 21 +pkg syscall (netbsd-386-cgo), const SIGTTOU = 22 +pkg syscall (netbsd-386-cgo), const SIGURG = 16 +pkg syscall (netbsd-386-cgo), const SIGUSR1 = 30 +pkg syscall (netbsd-386-cgo), const SIGUSR2 = 31 +pkg syscall (netbsd-386-cgo), const SIGVTALRM = 26 +pkg syscall (netbsd-386-cgo), const SIGWINCH = 28 +pkg syscall (netbsd-386-cgo), const SIGXCPU = 24 +pkg syscall (netbsd-386-cgo), const SIGXFSZ = 25 +pkg syscall (netbsd-386-cgo), const SIOCADDMULTI = 2156947761 +pkg syscall (netbsd-386-cgo), const SIOCADDRT = 2150658570 +pkg syscall (netbsd-386-cgo), const SIOCAIFADDR = 2151704858 +pkg syscall (netbsd-386-cgo), const SIOCALIFADDR = 2165860636 +pkg syscall (netbsd-386-cgo), const SIOCATMARK = 1074033415 +pkg syscall (netbsd-386-cgo), const SIOCDELMULTI = 2156947762 +pkg syscall (netbsd-386-cgo), const SIOCDELRT = 2150658571 +pkg syscall (netbsd-386-cgo), const SIOCDIFADDR = 2156947737 +pkg syscall (netbsd-386-cgo), const SIOCDIFPHYADDR = 2156947785 +pkg syscall (netbsd-386-cgo), const SIOCDLIFADDR = 2165860638 +pkg syscall (netbsd-386-cgo), const SIOCGDRVSPEC = 3223087483 +pkg syscall (netbsd-386-cgo), const SIOCGETPFSYNC = 3230689784 +pkg syscall (netbsd-386-cgo), const SIOCGETSGCNT = 3222566196 +pkg syscall (netbsd-386-cgo), const SIOCGETVIFCNT = 3222566195 +pkg syscall (netbsd-386-cgo), const SIOCGHIWAT = 1074033409 +pkg syscall (netbsd-386-cgo), const SIOCGIFADDR = 3230689569 +pkg syscall (netbsd-386-cgo), const SIOCGIFADDRPREF = 3230951712 +pkg syscall (netbsd-386-cgo), const SIOCGIFALIAS = 3225446683 +pkg syscall (netbsd-386-cgo), const SIOCGIFBRDADDR = 3230689571 +pkg syscall (netbsd-386-cgo), const SIOCGIFCAP = 3223349622 +pkg syscall (netbsd-386-cgo), const SIOCGIFCONF = 3221776678 +pkg syscall (netbsd-386-cgo), const SIOCGIFDATA = 3230951813 +pkg syscall (netbsd-386-cgo), const SIOCGIFDLT = 3230689655 +pkg syscall (netbsd-386-cgo), const SIOCGIFDSTADDR = 3230689570 +pkg syscall (netbsd-386-cgo), const SIOCGIFFLAGS = 3230689553 +pkg syscall (netbsd-386-cgo), const SIOCGIFGENERIC = 3230689594 +pkg syscall (netbsd-386-cgo), const SIOCGIFMEDIA = 3223873846 +pkg syscall (netbsd-386-cgo), const SIOCGIFMETRIC = 3230689559 +pkg syscall (netbsd-386-cgo), const SIOCGIFMTU = 3230689662 +pkg syscall (netbsd-386-cgo), const SIOCGIFNETMASK = 3230689573 +pkg syscall (netbsd-386-cgo), const SIOCGIFPDSTADDR = 3230689608 +pkg syscall (netbsd-386-cgo), const SIOCGIFPSRCADDR = 3230689607 +pkg syscall (netbsd-386-cgo), const SIOCGLIFADDR = 3239602461 +pkg syscall (netbsd-386-cgo), const SIOCGLIFPHYADDR = 3239602507 +pkg syscall (netbsd-386-cgo), const SIOCGLINKSTR = 3223087495 +pkg syscall (netbsd-386-cgo), const SIOCGLOWAT = 1074033411 +pkg syscall (netbsd-386-cgo), const SIOCGPGRP = 1074033417 +pkg syscall (netbsd-386-cgo), const SIOCGVH = 3230689667 +pkg syscall (netbsd-386-cgo), const SIOCIFCREATE = 2156947834 +pkg syscall (netbsd-386-cgo), const SIOCIFDESTROY = 2156947833 +pkg syscall (netbsd-386-cgo), const SIOCIFGCLONERS = 3222038904 +pkg syscall (netbsd-386-cgo), const SIOCINITIFADDR = 3225708932 +pkg syscall (netbsd-386-cgo), const SIOCSDRVSPEC = 2149345659 +pkg syscall (netbsd-386-cgo), const SIOCSETPFSYNC = 2156947959 +pkg syscall (netbsd-386-cgo), const SIOCSHIWAT = 2147775232 +pkg syscall (netbsd-386-cgo), const SIOCSIFADDR = 2156947724 +pkg syscall (netbsd-386-cgo), const SIOCSIFADDRPREF = 2157209887 +pkg syscall (netbsd-386-cgo), const SIOCSIFBRDADDR = 2156947731 +pkg syscall (netbsd-386-cgo), const SIOCSIFCAP = 2149607797 +pkg syscall (netbsd-386-cgo), const SIOCSIFDSTADDR = 2156947726 +pkg syscall (netbsd-386-cgo), const SIOCSIFFLAGS = 2156947728 +pkg syscall (netbsd-386-cgo), const SIOCSIFGENERIC = 2156947769 +pkg syscall (netbsd-386-cgo), const SIOCSIFMEDIA = 3230689589 +pkg syscall (netbsd-386-cgo), const SIOCSIFMETRIC = 2156947736 +pkg syscall (netbsd-386-cgo), const SIOCSIFMTU = 2156947839 +pkg syscall (netbsd-386-cgo), const SIOCSIFNETMASK = 2156947734 +pkg syscall (netbsd-386-cgo), const SIOCSIFPHYADDR = 2151704902 +pkg syscall (netbsd-386-cgo), const SIOCSLIFPHYADDR = 2165860682 +pkg syscall (netbsd-386-cgo), const SIOCSLINKSTR = 2149345672 +pkg syscall (netbsd-386-cgo), const SIOCSLOWAT = 2147775234 +pkg syscall (netbsd-386-cgo), const SIOCSPGRP = 2147775240 +pkg syscall (netbsd-386-cgo), const SIOCSVH = 3230689666 +pkg syscall (netbsd-386-cgo), const SIOCZIFDATA = 3230951814 +pkg syscall (netbsd-386-cgo), const SOCK_CLOEXEC = 268435456 +pkg syscall (netbsd-386-cgo), const SOCK_FLAGS_MASK = 4026531840 +pkg syscall (netbsd-386-cgo), const SOCK_NONBLOCK = 536870912 +pkg syscall (netbsd-386-cgo), const SOCK_NOSIGPIPE = 1073741824 +pkg syscall (netbsd-386-cgo), const SOCK_RDM = 4 +pkg syscall (netbsd-386-cgo), const SOL_SOCKET = 65535 +pkg syscall (netbsd-386-cgo), const SOMAXCONN = 128 +pkg syscall (netbsd-386-cgo), const SO_ACCEPTCONN = 2 +pkg syscall (netbsd-386-cgo), const SO_ACCEPTFILTER = 4096 +pkg syscall (netbsd-386-cgo), const SO_BROADCAST = 32 +pkg syscall (netbsd-386-cgo), const SO_DEBUG = 1 +pkg syscall (netbsd-386-cgo), const SO_DONTROUTE = 16 +pkg syscall (netbsd-386-cgo), const SO_ERROR = 4103 +pkg syscall (netbsd-386-cgo), const SO_KEEPALIVE = 8 +pkg syscall (netbsd-386-cgo), const SO_LINGER = 128 +pkg syscall (netbsd-386-cgo), const SO_NOHEADER = 4106 +pkg syscall (netbsd-386-cgo), const SO_NOSIGPIPE = 2048 +pkg syscall (netbsd-386-cgo), const SO_OOBINLINE = 256 +pkg syscall (netbsd-386-cgo), const SO_OVERFLOWED = 4105 +pkg syscall (netbsd-386-cgo), const SO_RCVBUF = 4098 +pkg syscall (netbsd-386-cgo), const SO_RCVLOWAT = 4100 +pkg syscall (netbsd-386-cgo), const SO_RCVTIMEO = 4108 +pkg syscall (netbsd-386-cgo), const SO_REUSEADDR = 4 +pkg syscall (netbsd-386-cgo), const SO_REUSEPORT = 512 +pkg syscall (netbsd-386-cgo), const SO_SNDBUF = 4097 +pkg syscall (netbsd-386-cgo), const SO_SNDLOWAT = 4099 +pkg syscall (netbsd-386-cgo), const SO_SNDTIMEO = 4107 +pkg syscall (netbsd-386-cgo), const SO_TIMESTAMP = 8192 +pkg syscall (netbsd-386-cgo), const SO_TYPE = 4104 +pkg syscall (netbsd-386-cgo), const SO_USELOOPBACK = 64 +pkg syscall (netbsd-386-cgo), const SYSCTL_VERSION = 16777216 +pkg syscall (netbsd-386-cgo), const SYSCTL_VERS_0 = 0 +pkg syscall (netbsd-386-cgo), const SYSCTL_VERS_1 = 16777216 +pkg syscall (netbsd-386-cgo), const SYSCTL_VERS_MASK = 4278190080 +pkg syscall (netbsd-386-cgo), const SYS_ACCEPT = 30 +pkg syscall (netbsd-386-cgo), const SYS_ACCESS = 33 +pkg syscall (netbsd-386-cgo), const SYS_ACCT = 51 +pkg syscall (netbsd-386-cgo), const SYS_ADJTIME = 421 +pkg syscall (netbsd-386-cgo), const SYS_BIND = 104 +pkg syscall (netbsd-386-cgo), const SYS_BREAK = 17 +pkg syscall (netbsd-386-cgo), const SYS_CHDIR = 12 +pkg syscall (netbsd-386-cgo), const SYS_CHFLAGS = 34 +pkg syscall (netbsd-386-cgo), const SYS_CHMOD = 15 +pkg syscall (netbsd-386-cgo), const SYS_CHOWN = 16 +pkg syscall (netbsd-386-cgo), const SYS_CHROOT = 61 +pkg syscall (netbsd-386-cgo), const SYS_CLOCK_GETRES = 429 +pkg syscall (netbsd-386-cgo), const SYS_CLOCK_GETTIME = 427 +pkg syscall (netbsd-386-cgo), const SYS_CLOCK_SETTIME = 428 +pkg syscall (netbsd-386-cgo), const SYS_CLOSE = 6 +pkg syscall (netbsd-386-cgo), const SYS_CONNECT = 98 +pkg syscall (netbsd-386-cgo), const SYS_DUP = 41 +pkg syscall (netbsd-386-cgo), const SYS_DUP2 = 90 +pkg syscall (netbsd-386-cgo), const SYS_DUP3 = 454 +pkg syscall (netbsd-386-cgo), const SYS_EXECVE = 59 +pkg syscall (netbsd-386-cgo), const SYS_EXIT = 1 +pkg syscall (netbsd-386-cgo), const SYS_EXTATTRCTL = 360 +pkg syscall (netbsd-386-cgo), const SYS_EXTATTR_DELETE_FD = 366 +pkg syscall (netbsd-386-cgo), const SYS_EXTATTR_DELETE_FILE = 363 +pkg syscall (netbsd-386-cgo), const SYS_EXTATTR_DELETE_LINK = 369 +pkg syscall (netbsd-386-cgo), const SYS_EXTATTR_GET_FD = 365 +pkg syscall (netbsd-386-cgo), const SYS_EXTATTR_GET_FILE = 362 +pkg syscall (netbsd-386-cgo), const SYS_EXTATTR_GET_LINK = 368 +pkg syscall (netbsd-386-cgo), const SYS_EXTATTR_LIST_FD = 370 +pkg syscall (netbsd-386-cgo), const SYS_EXTATTR_LIST_FILE = 371 +pkg syscall (netbsd-386-cgo), const SYS_EXTATTR_LIST_LINK = 372 +pkg syscall (netbsd-386-cgo), const SYS_EXTATTR_SET_FD = 364 +pkg syscall (netbsd-386-cgo), const SYS_EXTATTR_SET_FILE = 361 +pkg syscall (netbsd-386-cgo), const SYS_EXTATTR_SET_LINK = 367 +pkg syscall (netbsd-386-cgo), const SYS_FACCESSAT = 462 +pkg syscall (netbsd-386-cgo), const SYS_FCHDIR = 13 +pkg syscall (netbsd-386-cgo), const SYS_FCHFLAGS = 35 +pkg syscall (netbsd-386-cgo), const SYS_FCHMOD = 124 +pkg syscall (netbsd-386-cgo), const SYS_FCHMODAT = 463 +pkg syscall (netbsd-386-cgo), const SYS_FCHOWN = 123 +pkg syscall (netbsd-386-cgo), const SYS_FCHOWNAT = 464 +pkg syscall (netbsd-386-cgo), const SYS_FCHROOT = 297 +pkg syscall (netbsd-386-cgo), const SYS_FCNTL = 92 +pkg syscall (netbsd-386-cgo), const SYS_FDATASYNC = 241 +pkg syscall (netbsd-386-cgo), const SYS_FEXECVE = 465 +pkg syscall (netbsd-386-cgo), const SYS_FGETXATTR = 380 +pkg syscall (netbsd-386-cgo), const SYS_FHSTAT = 451 +pkg syscall (netbsd-386-cgo), const SYS_FKTRACE = 288 +pkg syscall (netbsd-386-cgo), const SYS_FLISTXATTR = 383 +pkg syscall (netbsd-386-cgo), const SYS_FLOCK = 131 +pkg syscall (netbsd-386-cgo), const SYS_FORK = 2 +pkg syscall (netbsd-386-cgo), const SYS_FPATHCONF = 192 +pkg syscall (netbsd-386-cgo), const SYS_FREMOVEXATTR = 386 +pkg syscall (netbsd-386-cgo), const SYS_FSETXATTR = 377 +pkg syscall (netbsd-386-cgo), const SYS_FSTAT = 440 +pkg syscall (netbsd-386-cgo), const SYS_FSTATAT = 466 +pkg syscall (netbsd-386-cgo), const SYS_FSTATVFS1 = 358 +pkg syscall (netbsd-386-cgo), const SYS_FSYNC = 95 +pkg syscall (netbsd-386-cgo), const SYS_FSYNC_RANGE = 354 +pkg syscall (netbsd-386-cgo), const SYS_FTRUNCATE = 201 +pkg syscall (netbsd-386-cgo), const SYS_FUTIMENS = 472 +pkg syscall (netbsd-386-cgo), const SYS_FUTIMES = 423 +pkg syscall (netbsd-386-cgo), const SYS_GETCONTEXT = 307 +pkg syscall (netbsd-386-cgo), const SYS_GETDENTS = 390 +pkg syscall (netbsd-386-cgo), const SYS_GETEGID = 43 +pkg syscall (netbsd-386-cgo), const SYS_GETEUID = 25 +pkg syscall (netbsd-386-cgo), const SYS_GETFH = 395 +pkg syscall (netbsd-386-cgo), const SYS_GETGID = 47 +pkg syscall (netbsd-386-cgo), const SYS_GETGROUPS = 79 +pkg syscall (netbsd-386-cgo), const SYS_GETITIMER = 426 +pkg syscall (netbsd-386-cgo), const SYS_GETPEERNAME = 31 +pkg syscall (netbsd-386-cgo), const SYS_GETPGID = 207 +pkg syscall (netbsd-386-cgo), const SYS_GETPGRP = 81 +pkg syscall (netbsd-386-cgo), const SYS_GETPID = 20 +pkg syscall (netbsd-386-cgo), const SYS_GETPPID = 39 +pkg syscall (netbsd-386-cgo), const SYS_GETPRIORITY = 100 +pkg syscall (netbsd-386-cgo), const SYS_GETRLIMIT = 194 +pkg syscall (netbsd-386-cgo), const SYS_GETRUSAGE = 445 +pkg syscall (netbsd-386-cgo), const SYS_GETSID = 286 +pkg syscall (netbsd-386-cgo), const SYS_GETSOCKNAME = 32 +pkg syscall (netbsd-386-cgo), const SYS_GETSOCKOPT = 118 +pkg syscall (netbsd-386-cgo), const SYS_GETTIMEOFDAY = 418 +pkg syscall (netbsd-386-cgo), const SYS_GETUID = 24 +pkg syscall (netbsd-386-cgo), const SYS_GETVFSSTAT = 356 +pkg syscall (netbsd-386-cgo), const SYS_GETXATTR = 378 +pkg syscall (netbsd-386-cgo), const SYS_IOCTL = 54 +pkg syscall (netbsd-386-cgo), const SYS_ISSETUGID = 305 +pkg syscall (netbsd-386-cgo), const SYS_KEVENT = 435 +pkg syscall (netbsd-386-cgo), const SYS_KILL = 37 +pkg syscall (netbsd-386-cgo), const SYS_KQUEUE = 344 +pkg syscall (netbsd-386-cgo), const SYS_KQUEUE1 = 455 +pkg syscall (netbsd-386-cgo), const SYS_KTRACE = 45 +pkg syscall (netbsd-386-cgo), const SYS_LCHFLAGS = 304 +pkg syscall (netbsd-386-cgo), const SYS_LCHMOD = 274 +pkg syscall (netbsd-386-cgo), const SYS_LCHOWN = 275 +pkg syscall (netbsd-386-cgo), const SYS_LGETXATTR = 379 +pkg syscall (netbsd-386-cgo), const SYS_LINK = 9 +pkg syscall (netbsd-386-cgo), const SYS_LINKAT = 457 +pkg syscall (netbsd-386-cgo), const SYS_LISTEN = 106 +pkg syscall (netbsd-386-cgo), const SYS_LISTXATTR = 381 +pkg syscall (netbsd-386-cgo), const SYS_LLISTXATTR = 382 +pkg syscall (netbsd-386-cgo), const SYS_LREMOVEXATTR = 385 +pkg syscall (netbsd-386-cgo), const SYS_LSEEK = 199 +pkg syscall (netbsd-386-cgo), const SYS_LSETXATTR = 376 +pkg syscall (netbsd-386-cgo), const SYS_LSTAT = 441 +pkg syscall (netbsd-386-cgo), const SYS_LUTIMES = 424 +pkg syscall (netbsd-386-cgo), const SYS_MADVISE = 75 +pkg syscall (netbsd-386-cgo), const SYS_MINCORE = 78 +pkg syscall (netbsd-386-cgo), const SYS_MINHERIT = 273 +pkg syscall (netbsd-386-cgo), const SYS_MKDIR = 136 +pkg syscall (netbsd-386-cgo), const SYS_MKDIRAT = 461 +pkg syscall (netbsd-386-cgo), const SYS_MKFIFO = 132 +pkg syscall (netbsd-386-cgo), const SYS_MKFIFOAT = 459 +pkg syscall (netbsd-386-cgo), const SYS_MKNOD = 450 +pkg syscall (netbsd-386-cgo), const SYS_MKNODAT = 460 +pkg syscall (netbsd-386-cgo), const SYS_MLOCK = 203 +pkg syscall (netbsd-386-cgo), const SYS_MLOCKALL = 242 +pkg syscall (netbsd-386-cgo), const SYS_MMAP = 197 +pkg syscall (netbsd-386-cgo), const SYS_MODCTL = 246 +pkg syscall (netbsd-386-cgo), const SYS_MOUNT = 410 +pkg syscall (netbsd-386-cgo), const SYS_MPROTECT = 74 +pkg syscall (netbsd-386-cgo), const SYS_MREMAP = 411 +pkg syscall (netbsd-386-cgo), const SYS_MSGCTL = 444 +pkg syscall (netbsd-386-cgo), const SYS_MSGGET = 225 +pkg syscall (netbsd-386-cgo), const SYS_MSGRCV = 227 +pkg syscall (netbsd-386-cgo), const SYS_MSGSND = 226 +pkg syscall (netbsd-386-cgo), const SYS_MUNLOCK = 204 +pkg syscall (netbsd-386-cgo), const SYS_MUNLOCKALL = 243 +pkg syscall (netbsd-386-cgo), const SYS_MUNMAP = 73 +pkg syscall (netbsd-386-cgo), const SYS_NANOSLEEP = 430 +pkg syscall (netbsd-386-cgo), const SYS_NTP_ADJTIME = 176 +pkg syscall (netbsd-386-cgo), const SYS_NTP_GETTIME = 448 +pkg syscall (netbsd-386-cgo), const SYS_OPEN = 5 +pkg syscall (netbsd-386-cgo), const SYS_OPENAT = 468 +pkg syscall (netbsd-386-cgo), const SYS_PACCEPT = 456 +pkg syscall (netbsd-386-cgo), const SYS_PATHCONF = 191 +pkg syscall (netbsd-386-cgo), const SYS_PIPE = 42 +pkg syscall (netbsd-386-cgo), const SYS_PIPE2 = 453 +pkg syscall (netbsd-386-cgo), const SYS_PMC_CONTROL = 342 +pkg syscall (netbsd-386-cgo), const SYS_PMC_GET_INFO = 341 +pkg syscall (netbsd-386-cgo), const SYS_POLL = 209 +pkg syscall (netbsd-386-cgo), const SYS_POLLTS = 437 +pkg syscall (netbsd-386-cgo), const SYS_POSIX_FADVISE = 416 +pkg syscall (netbsd-386-cgo), const SYS_POSIX_SPAWN = 474 +pkg syscall (netbsd-386-cgo), const SYS_PREAD = 173 +pkg syscall (netbsd-386-cgo), const SYS_PREADV = 289 +pkg syscall (netbsd-386-cgo), const SYS_PROFIL = 44 +pkg syscall (netbsd-386-cgo), const SYS_PSELECT = 436 +pkg syscall (netbsd-386-cgo), const SYS_PSET_ASSIGN = 414 +pkg syscall (netbsd-386-cgo), const SYS_PSET_CREATE = 412 +pkg syscall (netbsd-386-cgo), const SYS_PSET_DESTROY = 413 +pkg syscall (netbsd-386-cgo), const SYS_PTRACE = 26 +pkg syscall (netbsd-386-cgo), const SYS_PWRITE = 174 +pkg syscall (netbsd-386-cgo), const SYS_PWRITEV = 290 +pkg syscall (netbsd-386-cgo), const SYS_RASCTL = 343 +pkg syscall (netbsd-386-cgo), const SYS_READ = 3 +pkg syscall (netbsd-386-cgo), const SYS_READLINK = 58 +pkg syscall (netbsd-386-cgo), const SYS_READLINKAT = 469 +pkg syscall (netbsd-386-cgo), const SYS_READV = 120 +pkg syscall (netbsd-386-cgo), const SYS_REBOOT = 208 +pkg syscall (netbsd-386-cgo), const SYS_RECVFROM = 29 +pkg syscall (netbsd-386-cgo), const SYS_RECVMMSG = 475 +pkg syscall (netbsd-386-cgo), const SYS_RECVMSG = 27 +pkg syscall (netbsd-386-cgo), const SYS_REMOVEXATTR = 384 +pkg syscall (netbsd-386-cgo), const SYS_RENAME = 128 +pkg syscall (netbsd-386-cgo), const SYS_RENAMEAT = 458 +pkg syscall (netbsd-386-cgo), const SYS_REVOKE = 56 +pkg syscall (netbsd-386-cgo), const SYS_RMDIR = 137 +pkg syscall (netbsd-386-cgo), const SYS_SBRK = 69 +pkg syscall (netbsd-386-cgo), const SYS_SCHED_YIELD = 350 +pkg syscall (netbsd-386-cgo), const SYS_SELECT = 417 +pkg syscall (netbsd-386-cgo), const SYS_SEMCONFIG = 223 +pkg syscall (netbsd-386-cgo), const SYS_SEMGET = 221 +pkg syscall (netbsd-386-cgo), const SYS_SEMOP = 222 +pkg syscall (netbsd-386-cgo), const SYS_SENDMMSG = 476 +pkg syscall (netbsd-386-cgo), const SYS_SENDMSG = 28 +pkg syscall (netbsd-386-cgo), const SYS_SENDTO = 133 +pkg syscall (netbsd-386-cgo), const SYS_SETCONTEXT = 308 +pkg syscall (netbsd-386-cgo), const SYS_SETEGID = 182 +pkg syscall (netbsd-386-cgo), const SYS_SETEUID = 183 +pkg syscall (netbsd-386-cgo), const SYS_SETGID = 181 +pkg syscall (netbsd-386-cgo), const SYS_SETGROUPS = 80 +pkg syscall (netbsd-386-cgo), const SYS_SETITIMER = 425 +pkg syscall (netbsd-386-cgo), const SYS_SETPGID = 82 +pkg syscall (netbsd-386-cgo), const SYS_SETPRIORITY = 96 +pkg syscall (netbsd-386-cgo), const SYS_SETREGID = 127 +pkg syscall (netbsd-386-cgo), const SYS_SETREUID = 126 +pkg syscall (netbsd-386-cgo), const SYS_SETRLIMIT = 195 +pkg syscall (netbsd-386-cgo), const SYS_SETSID = 147 +pkg syscall (netbsd-386-cgo), const SYS_SETSOCKOPT = 105 +pkg syscall (netbsd-386-cgo), const SYS_SETTIMEOFDAY = 419 +pkg syscall (netbsd-386-cgo), const SYS_SETUID = 23 +pkg syscall (netbsd-386-cgo), const SYS_SETXATTR = 375 +pkg syscall (netbsd-386-cgo), const SYS_SHMAT = 228 +pkg syscall (netbsd-386-cgo), const SYS_SHMCTL = 443 +pkg syscall (netbsd-386-cgo), const SYS_SHMDT = 230 +pkg syscall (netbsd-386-cgo), const SYS_SHMGET = 231 +pkg syscall (netbsd-386-cgo), const SYS_SHUTDOWN = 134 +pkg syscall (netbsd-386-cgo), const SYS_SIGQUEUEINFO = 245 +pkg syscall (netbsd-386-cgo), const SYS_SOCKET = 394 +pkg syscall (netbsd-386-cgo), const SYS_SOCKETPAIR = 135 +pkg syscall (netbsd-386-cgo), const SYS_SSTK = 70 +pkg syscall (netbsd-386-cgo), const SYS_STAT = 439 +pkg syscall (netbsd-386-cgo), const SYS_STATVFS1 = 357 +pkg syscall (netbsd-386-cgo), const SYS_SWAPCTL = 271 +pkg syscall (netbsd-386-cgo), const SYS_SYMLINK = 57 +pkg syscall (netbsd-386-cgo), const SYS_SYMLINKAT = 470 +pkg syscall (netbsd-386-cgo), const SYS_SYNC = 36 +pkg syscall (netbsd-386-cgo), const SYS_SYSARCH = 165 +pkg syscall (netbsd-386-cgo), const SYS_TIMER_CREATE = 235 +pkg syscall (netbsd-386-cgo), const SYS_TIMER_DELETE = 236 +pkg syscall (netbsd-386-cgo), const SYS_TIMER_GETOVERRUN = 239 +pkg syscall (netbsd-386-cgo), const SYS_TIMER_GETTIME = 447 +pkg syscall (netbsd-386-cgo), const SYS_TIMER_SETTIME = 446 +pkg syscall (netbsd-386-cgo), const SYS_TRUNCATE = 200 +pkg syscall (netbsd-386-cgo), const SYS_UMASK = 60 +pkg syscall (netbsd-386-cgo), const SYS_UNDELETE = 205 +pkg syscall (netbsd-386-cgo), const SYS_UNLINK = 10 +pkg syscall (netbsd-386-cgo), const SYS_UNLINKAT = 471 +pkg syscall (netbsd-386-cgo), const SYS_UNMOUNT = 22 +pkg syscall (netbsd-386-cgo), const SYS_UTIMENSAT = 467 +pkg syscall (netbsd-386-cgo), const SYS_UTIMES = 420 +pkg syscall (netbsd-386-cgo), const SYS_UTRACE = 306 +pkg syscall (netbsd-386-cgo), const SYS_UUIDGEN = 355 +pkg syscall (netbsd-386-cgo), const SYS_VADVISE = 72 +pkg syscall (netbsd-386-cgo), const SYS_VFORK = 66 +pkg syscall (netbsd-386-cgo), const SYS_WAIT4 = 449 +pkg syscall (netbsd-386-cgo), const SYS_WRITE = 4 +pkg syscall (netbsd-386-cgo), const SYS_WRITEV = 121 +pkg syscall (netbsd-386-cgo), const SYS__LWP_CONTINUE = 314 +pkg syscall (netbsd-386-cgo), const SYS__LWP_CREATE = 309 +pkg syscall (netbsd-386-cgo), const SYS__LWP_CTL = 325 +pkg syscall (netbsd-386-cgo), const SYS__LWP_DETACH = 319 +pkg syscall (netbsd-386-cgo), const SYS__LWP_EXIT = 310 +pkg syscall (netbsd-386-cgo), const SYS__LWP_GETNAME = 324 +pkg syscall (netbsd-386-cgo), const SYS__LWP_GETPRIVATE = 316 +pkg syscall (netbsd-386-cgo), const SYS__LWP_KILL = 318 +pkg syscall (netbsd-386-cgo), const SYS__LWP_PARK = 434 +pkg syscall (netbsd-386-cgo), const SYS__LWP_SELF = 311 +pkg syscall (netbsd-386-cgo), const SYS__LWP_SETNAME = 323 +pkg syscall (netbsd-386-cgo), const SYS__LWP_SETPRIVATE = 317 +pkg syscall (netbsd-386-cgo), const SYS__LWP_SUSPEND = 313 +pkg syscall (netbsd-386-cgo), const SYS__LWP_UNPARK = 321 +pkg syscall (netbsd-386-cgo), const SYS__LWP_UNPARK_ALL = 322 +pkg syscall (netbsd-386-cgo), const SYS__LWP_WAIT = 312 +pkg syscall (netbsd-386-cgo), const SYS__LWP_WAKEUP = 315 +pkg syscall (netbsd-386-cgo), const SYS__PSET_BIND = 415 +pkg syscall (netbsd-386-cgo), const SYS__SCHED_GETAFFINITY = 349 +pkg syscall (netbsd-386-cgo), const SYS__SCHED_GETPARAM = 347 +pkg syscall (netbsd-386-cgo), const SYS__SCHED_SETAFFINITY = 348 +pkg syscall (netbsd-386-cgo), const SYS__SCHED_SETPARAM = 346 +pkg syscall (netbsd-386-cgo), const SYS___CLONE = 287 +pkg syscall (netbsd-386-cgo), const SYS___GETCWD = 296 +pkg syscall (netbsd-386-cgo), const SYS___GETLOGIN = 49 +pkg syscall (netbsd-386-cgo), const SYS___POSIX_CHOWN = 283 +pkg syscall (netbsd-386-cgo), const SYS___POSIX_FCHOWN = 284 +pkg syscall (netbsd-386-cgo), const SYS___POSIX_LCHOWN = 285 +pkg syscall (netbsd-386-cgo), const SYS___POSIX_RENAME = 270 +pkg syscall (netbsd-386-cgo), const SYS___QUOTACTL = 473 +pkg syscall (netbsd-386-cgo), const SYS___SEMCTL = 442 +pkg syscall (netbsd-386-cgo), const SYS___SETLOGIN = 50 +pkg syscall (netbsd-386-cgo), const SYS___SIGACTION_SIGTRAMP = 340 +pkg syscall (netbsd-386-cgo), const SYS___SIGTIMEDWAIT = 431 +pkg syscall (netbsd-386-cgo), const SYS___SYSCTL = 202 +pkg syscall (netbsd-386-cgo), const S_ARCH1 = 65536 +pkg syscall (netbsd-386-cgo), const S_ARCH2 = 131072 +pkg syscall (netbsd-386-cgo), const S_BLKSIZE = 512 +pkg syscall (netbsd-386-cgo), const S_IEXEC = 64 +pkg syscall (netbsd-386-cgo), const S_IFMT = 61440 +pkg syscall (netbsd-386-cgo), const S_IFWHT = 57344 +pkg syscall (netbsd-386-cgo), const S_IREAD = 256 +pkg syscall (netbsd-386-cgo), const S_IRGRP = 32 +pkg syscall (netbsd-386-cgo), const S_IROTH = 4 +pkg syscall (netbsd-386-cgo), const S_IRWXG = 56 +pkg syscall (netbsd-386-cgo), const S_IRWXO = 7 +pkg syscall (netbsd-386-cgo), const S_IRWXU = 448 +pkg syscall (netbsd-386-cgo), const S_ISTXT = 512 +pkg syscall (netbsd-386-cgo), const S_IWGRP = 16 +pkg syscall (netbsd-386-cgo), const S_IWOTH = 2 +pkg syscall (netbsd-386-cgo), const S_IWRITE = 128 +pkg syscall (netbsd-386-cgo), const S_IXGRP = 8 +pkg syscall (netbsd-386-cgo), const S_IXOTH = 1 +pkg syscall (netbsd-386-cgo), const S_LOGIN_SET = 1 +pkg syscall (netbsd-386-cgo), const SizeofBpfHdr = 20 +pkg syscall (netbsd-386-cgo), const SizeofBpfInsn = 8 +pkg syscall (netbsd-386-cgo), const SizeofBpfProgram = 8 +pkg syscall (netbsd-386-cgo), const SizeofBpfStat = 128 +pkg syscall (netbsd-386-cgo), const SizeofBpfVersion = 4 +pkg syscall (netbsd-386-cgo), const SizeofCmsghdr = 12 +pkg syscall (netbsd-386-cgo), const SizeofIPMreq = 8 +pkg syscall (netbsd-386-cgo), const SizeofIPv6Mreq = 20 +pkg syscall (netbsd-386-cgo), const SizeofIfAnnounceMsghdr = 24 +pkg syscall (netbsd-386-cgo), const SizeofIfData = 132 +pkg syscall (netbsd-386-cgo), const SizeofIfMsghdr = 152 +pkg syscall (netbsd-386-cgo), const SizeofIfaMsghdr = 24 +pkg syscall (netbsd-386-cgo), const SizeofInet6Pktinfo = 20 +pkg syscall (netbsd-386-cgo), const SizeofLinger = 8 +pkg syscall (netbsd-386-cgo), const SizeofMsghdr = 28 +pkg syscall (netbsd-386-cgo), const SizeofRtMetrics = 80 +pkg syscall (netbsd-386-cgo), const SizeofRtMsghdr = 120 +pkg syscall (netbsd-386-cgo), const SizeofSockaddrAny = 108 +pkg syscall (netbsd-386-cgo), const SizeofSockaddrDatalink = 20 +pkg syscall (netbsd-386-cgo), const SizeofSockaddrInet4 = 16 +pkg syscall (netbsd-386-cgo), const SizeofSockaddrInet6 = 28 +pkg syscall (netbsd-386-cgo), const SizeofSockaddrUnix = 106 +pkg syscall (netbsd-386-cgo), const TCIFLUSH = 1 +pkg syscall (netbsd-386-cgo), const TCIOFLUSH = 3 +pkg syscall (netbsd-386-cgo), const TCOFLUSH = 2 +pkg syscall (netbsd-386-cgo), const TCP_CONGCTL = 32 +pkg syscall (netbsd-386-cgo), const TCP_KEEPCNT = 6 +pkg syscall (netbsd-386-cgo), const TCP_KEEPIDLE = 3 +pkg syscall (netbsd-386-cgo), const TCP_KEEPINIT = 7 +pkg syscall (netbsd-386-cgo), const TCP_KEEPINTVL = 5 +pkg syscall (netbsd-386-cgo), const TCP_MAXBURST = 4 +pkg syscall (netbsd-386-cgo), const TCP_MAXSEG = 2 +pkg syscall (netbsd-386-cgo), const TCP_MAXWIN = 65535 +pkg syscall (netbsd-386-cgo), const TCP_MAX_WINSHIFT = 14 +pkg syscall (netbsd-386-cgo), const TCP_MD5SIG = 16 +pkg syscall (netbsd-386-cgo), const TCP_MINMSS = 216 +pkg syscall (netbsd-386-cgo), const TCP_MSS = 536 +pkg syscall (netbsd-386-cgo), const TCSAFLUSH = 2 +pkg syscall (netbsd-386-cgo), const TIOCCBRK = 536900730 +pkg syscall (netbsd-386-cgo), const TIOCCDTR = 536900728 +pkg syscall (netbsd-386-cgo), const TIOCCONS = 2147775586 +pkg syscall (netbsd-386-cgo), const TIOCDCDTIMESTAMP = 1074558040 +pkg syscall (netbsd-386-cgo), const TIOCDRAIN = 536900702 +pkg syscall (netbsd-386-cgo), const TIOCEXCL = 536900621 +pkg syscall (netbsd-386-cgo), const TIOCEXT = 2147775584 +pkg syscall (netbsd-386-cgo), const TIOCFLAG_CDTRCTS = 16 +pkg syscall (netbsd-386-cgo), const TIOCFLAG_CLOCAL = 2 +pkg syscall (netbsd-386-cgo), const TIOCFLAG_CRTSCTS = 4 +pkg syscall (netbsd-386-cgo), const TIOCFLAG_MDMBUF = 8 +pkg syscall (netbsd-386-cgo), const TIOCFLAG_SOFTCAR = 1 +pkg syscall (netbsd-386-cgo), const TIOCFLUSH = 2147775504 +pkg syscall (netbsd-386-cgo), const TIOCGETA = 1076655123 +pkg syscall (netbsd-386-cgo), const TIOCGETD = 1074033690 +pkg syscall (netbsd-386-cgo), const TIOCGFLAGS = 1074033757 +pkg syscall (netbsd-386-cgo), const TIOCGLINED = 1075868738 +pkg syscall (netbsd-386-cgo), const TIOCGPGRP = 1074033783 +pkg syscall (netbsd-386-cgo), const TIOCGQSIZE = 1074033793 +pkg syscall (netbsd-386-cgo), const TIOCGRANTPT = 536900679 +pkg syscall (netbsd-386-cgo), const TIOCGSID = 1074033763 +pkg syscall (netbsd-386-cgo), const TIOCGSIZE = 1074295912 +pkg syscall (netbsd-386-cgo), const TIOCGWINSZ = 1074295912 +pkg syscall (netbsd-386-cgo), const TIOCMBIC = 2147775595 +pkg syscall (netbsd-386-cgo), const TIOCMBIS = 2147775596 +pkg syscall (netbsd-386-cgo), const TIOCMGET = 1074033770 +pkg syscall (netbsd-386-cgo), const TIOCMSET = 2147775597 +pkg syscall (netbsd-386-cgo), const TIOCM_CAR = 64 +pkg syscall (netbsd-386-cgo), const TIOCM_CD = 64 +pkg syscall (netbsd-386-cgo), const TIOCM_CTS = 32 +pkg syscall (netbsd-386-cgo), const TIOCM_DSR = 256 +pkg syscall (netbsd-386-cgo), const TIOCM_DTR = 2 +pkg syscall (netbsd-386-cgo), const TIOCM_LE = 1 +pkg syscall (netbsd-386-cgo), const TIOCM_RI = 128 +pkg syscall (netbsd-386-cgo), const TIOCM_RNG = 128 +pkg syscall (netbsd-386-cgo), const TIOCM_RTS = 4 +pkg syscall (netbsd-386-cgo), const TIOCM_SR = 16 +pkg syscall (netbsd-386-cgo), const TIOCM_ST = 8 +pkg syscall (netbsd-386-cgo), const TIOCNOTTY = 536900721 +pkg syscall (netbsd-386-cgo), const TIOCNXCL = 536900622 +pkg syscall (netbsd-386-cgo), const TIOCOUTQ = 1074033779 +pkg syscall (netbsd-386-cgo), const TIOCPKT = 2147775600 +pkg syscall (netbsd-386-cgo), const TIOCPKT_DATA = 0 +pkg syscall (netbsd-386-cgo), const TIOCPKT_DOSTOP = 32 +pkg syscall (netbsd-386-cgo), const TIOCPKT_FLUSHREAD = 1 +pkg syscall (netbsd-386-cgo), const TIOCPKT_FLUSHWRITE = 2 +pkg syscall (netbsd-386-cgo), const TIOCPKT_IOCTL = 64 +pkg syscall (netbsd-386-cgo), const TIOCPKT_NOSTOP = 16 +pkg syscall (netbsd-386-cgo), const TIOCPKT_START = 8 +pkg syscall (netbsd-386-cgo), const TIOCPKT_STOP = 4 +pkg syscall (netbsd-386-cgo), const TIOCPTMGET = 1076393030 +pkg syscall (netbsd-386-cgo), const TIOCPTSNAME = 1076393032 +pkg syscall (netbsd-386-cgo), const TIOCRCVFRAME = 2147775557 +pkg syscall (netbsd-386-cgo), const TIOCREMOTE = 2147775593 +pkg syscall (netbsd-386-cgo), const TIOCSBRK = 536900731 +pkg syscall (netbsd-386-cgo), const TIOCSCTTY = 536900705 +pkg syscall (netbsd-386-cgo), const TIOCSDTR = 536900729 +pkg syscall (netbsd-386-cgo), const TIOCSETA = 2150396948 +pkg syscall (netbsd-386-cgo), const TIOCSETAF = 2150396950 +pkg syscall (netbsd-386-cgo), const TIOCSETAW = 2150396949 +pkg syscall (netbsd-386-cgo), const TIOCSETD = 2147775515 +pkg syscall (netbsd-386-cgo), const TIOCSFLAGS = 2147775580 +pkg syscall (netbsd-386-cgo), const TIOCSIG = 536900703 +pkg syscall (netbsd-386-cgo), const TIOCSLINED = 2149610563 +pkg syscall (netbsd-386-cgo), const TIOCSPGRP = 2147775606 +pkg syscall (netbsd-386-cgo), const TIOCSQSIZE = 2147775616 +pkg syscall (netbsd-386-cgo), const TIOCSSIZE = 2148037735 +pkg syscall (netbsd-386-cgo), const TIOCSTART = 536900718 +pkg syscall (netbsd-386-cgo), const TIOCSTAT = 2147775589 +pkg syscall (netbsd-386-cgo), const TIOCSTI = 2147578994 +pkg syscall (netbsd-386-cgo), const TIOCSTOP = 536900719 +pkg syscall (netbsd-386-cgo), const TIOCSWINSZ = 2148037735 +pkg syscall (netbsd-386-cgo), const TIOCUCNTL = 2147775590 +pkg syscall (netbsd-386-cgo), const TIOCXMTFRAME = 2147775556 +pkg syscall (netbsd-386-cgo), const TOSTOP = 4194304 +pkg syscall (netbsd-386-cgo), const VDISCARD = 15 +pkg syscall (netbsd-386-cgo), const VDSUSP = 11 +pkg syscall (netbsd-386-cgo), const VEOF = 0 +pkg syscall (netbsd-386-cgo), const VEOL = 1 +pkg syscall (netbsd-386-cgo), const VEOL2 = 2 +pkg syscall (netbsd-386-cgo), const VERASE = 3 +pkg syscall (netbsd-386-cgo), const VINTR = 8 +pkg syscall (netbsd-386-cgo), const VKILL = 5 +pkg syscall (netbsd-386-cgo), const VLNEXT = 14 +pkg syscall (netbsd-386-cgo), const VMIN = 16 +pkg syscall (netbsd-386-cgo), const VQUIT = 9 +pkg syscall (netbsd-386-cgo), const VREPRINT = 6 +pkg syscall (netbsd-386-cgo), const VSTART = 12 +pkg syscall (netbsd-386-cgo), const VSTATUS = 18 +pkg syscall (netbsd-386-cgo), const VSTOP = 13 +pkg syscall (netbsd-386-cgo), const VSUSP = 10 +pkg syscall (netbsd-386-cgo), const VTIME = 17 +pkg syscall (netbsd-386-cgo), const VWERASE = 4 +pkg syscall (netbsd-386-cgo), const WALL = 8 +pkg syscall (netbsd-386-cgo), const WALLSIG = 8 +pkg syscall (netbsd-386-cgo), const WALTSIG = 4 +pkg syscall (netbsd-386-cgo), const WCLONE = 4 +pkg syscall (netbsd-386-cgo), const WCOREFLAG = 128 +pkg syscall (netbsd-386-cgo), const WNOHANG = 1 +pkg syscall (netbsd-386-cgo), const WNOWAIT = 65536 +pkg syscall (netbsd-386-cgo), const WNOZOMBIE = 131072 +pkg syscall (netbsd-386-cgo), const WOPTSCHECKED = 262144 +pkg syscall (netbsd-386-cgo), const WSTOPPED = 127 +pkg syscall (netbsd-386-cgo), const WUNTRACED = 2 +pkg syscall (netbsd-amd64), const AF_APPLETALK = 16 +pkg syscall (netbsd-amd64), const AF_ARP = 28 +pkg syscall (netbsd-amd64), const AF_BLUETOOTH = 31 +pkg syscall (netbsd-amd64), const AF_CCITT = 10 +pkg syscall (netbsd-amd64), const AF_CHAOS = 5 +pkg syscall (netbsd-amd64), const AF_CNT = 21 +pkg syscall (netbsd-amd64), const AF_COIP = 20 +pkg syscall (netbsd-amd64), const AF_DATAKIT = 9 +pkg syscall (netbsd-amd64), const AF_DECnet = 12 +pkg syscall (netbsd-amd64), const AF_DLI = 13 +pkg syscall (netbsd-amd64), const AF_E164 = 26 +pkg syscall (netbsd-amd64), const AF_ECMA = 8 +pkg syscall (netbsd-amd64), const AF_HYLINK = 15 +pkg syscall (netbsd-amd64), const AF_IEEE80211 = 32 +pkg syscall (netbsd-amd64), const AF_IMPLINK = 3 +pkg syscall (netbsd-amd64), const AF_INET6 = 24 +pkg syscall (netbsd-amd64), const AF_IPX = 23 +pkg syscall (netbsd-amd64), const AF_ISDN = 26 +pkg syscall (netbsd-amd64), const AF_ISO = 7 +pkg syscall (netbsd-amd64), const AF_LAT = 14 +pkg syscall (netbsd-amd64), const AF_LINK = 18 +pkg syscall (netbsd-amd64), const AF_LOCAL = 1 +pkg syscall (netbsd-amd64), const AF_MAX = 35 +pkg syscall (netbsd-amd64), const AF_MPLS = 33 +pkg syscall (netbsd-amd64), const AF_NATM = 27 +pkg syscall (netbsd-amd64), const AF_NS = 6 +pkg syscall (netbsd-amd64), const AF_OROUTE = 17 +pkg syscall (netbsd-amd64), const AF_OSI = 7 +pkg syscall (netbsd-amd64), const AF_PUP = 4 +pkg syscall (netbsd-amd64), const AF_ROUTE = 34 +pkg syscall (netbsd-amd64), const AF_SNA = 11 +pkg syscall (netbsd-amd64), const ARPHRD_ARCNET = 7 +pkg syscall (netbsd-amd64), const ARPHRD_ETHER = 1 +pkg syscall (netbsd-amd64), const ARPHRD_FRELAY = 15 +pkg syscall (netbsd-amd64), const ARPHRD_IEEE1394 = 24 +pkg syscall (netbsd-amd64), const ARPHRD_IEEE802 = 6 +pkg syscall (netbsd-amd64), const ARPHRD_STRIP = 23 +pkg syscall (netbsd-amd64), const B0 = 0 +pkg syscall (netbsd-amd64), const B110 = 110 +pkg syscall (netbsd-amd64), const B115200 = 115200 +pkg syscall (netbsd-amd64), const B1200 = 1200 +pkg syscall (netbsd-amd64), const B134 = 134 +pkg syscall (netbsd-amd64), const B14400 = 14400 +pkg syscall (netbsd-amd64), const B150 = 150 +pkg syscall (netbsd-amd64), const B1800 = 1800 +pkg syscall (netbsd-amd64), const B19200 = 19200 +pkg syscall (netbsd-amd64), const B200 = 200 +pkg syscall (netbsd-amd64), const B230400 = 230400 +pkg syscall (netbsd-amd64), const B2400 = 2400 +pkg syscall (netbsd-amd64), const B28800 = 28800 +pkg syscall (netbsd-amd64), const B300 = 300 +pkg syscall (netbsd-amd64), const B38400 = 38400 +pkg syscall (netbsd-amd64), const B460800 = 460800 +pkg syscall (netbsd-amd64), const B4800 = 4800 +pkg syscall (netbsd-amd64), const B50 = 50 +pkg syscall (netbsd-amd64), const B57600 = 57600 +pkg syscall (netbsd-amd64), const B600 = 600 +pkg syscall (netbsd-amd64), const B7200 = 7200 +pkg syscall (netbsd-amd64), const B75 = 75 +pkg syscall (netbsd-amd64), const B76800 = 76800 +pkg syscall (netbsd-amd64), const B921600 = 921600 +pkg syscall (netbsd-amd64), const B9600 = 9600 +pkg syscall (netbsd-amd64), const BIOCFEEDBACK = 2147762813 +pkg syscall (netbsd-amd64), const BIOCFLUSH = 536887912 +pkg syscall (netbsd-amd64), const BIOCGBLEN = 1074020966 +pkg syscall (netbsd-amd64), const BIOCGDLT = 1074020970 +pkg syscall (netbsd-amd64), const BIOCGDLTLIST = 3222291063 +pkg syscall (netbsd-amd64), const BIOCGETIF = 1083196011 +pkg syscall (netbsd-amd64), const BIOCGFEEDBACK = 1074020988 +pkg syscall (netbsd-amd64), const BIOCGHDRCMPLT = 1074020980 +pkg syscall (netbsd-amd64), const BIOCGRTIMEOUT = 1074807419 +pkg syscall (netbsd-amd64), const BIOCGSEESENT = 1074020984 +pkg syscall (netbsd-amd64), const BIOCGSTATS = 1082147439 +pkg syscall (netbsd-amd64), const BIOCGSTATSOLD = 1074283119 +pkg syscall (netbsd-amd64), const BIOCIMMEDIATE = 2147762800 +pkg syscall (netbsd-amd64), const BIOCPROMISC = 536887913 +pkg syscall (netbsd-amd64), const BIOCSBLEN = 3221504614 +pkg syscall (netbsd-amd64), const BIOCSDLT = 2147762806 +pkg syscall (netbsd-amd64), const BIOCSETF = 2148549223 +pkg syscall (netbsd-amd64), const BIOCSETIF = 2156937836 +pkg syscall (netbsd-amd64), const BIOCSFEEDBACK = 2147762813 +pkg syscall (netbsd-amd64), const BIOCSHDRCMPLT = 2147762805 +pkg syscall (netbsd-amd64), const BIOCSRTIMEOUT = 2148549242 +pkg syscall (netbsd-amd64), const BIOCSSEESENT = 2147762809 +pkg syscall (netbsd-amd64), const BIOCSTCPF = 2148549234 +pkg syscall (netbsd-amd64), const BIOCSUDPF = 2148549235 +pkg syscall (netbsd-amd64), const BIOCVERSION = 1074020977 +pkg syscall (netbsd-amd64), const BPF_A = 16 +pkg syscall (netbsd-amd64), const BPF_ABS = 32 +pkg syscall (netbsd-amd64), const BPF_ADD = 0 +pkg syscall (netbsd-amd64), const BPF_ALIGNMENT = 8 +pkg syscall (netbsd-amd64), const BPF_ALIGNMENT32 = 4 +pkg syscall (netbsd-amd64), const BPF_ALU = 4 +pkg syscall (netbsd-amd64), const BPF_AND = 80 +pkg syscall (netbsd-amd64), const BPF_B = 16 +pkg syscall (netbsd-amd64), const BPF_DFLTBUFSIZE = 1048576 +pkg syscall (netbsd-amd64), const BPF_DIV = 48 +pkg syscall (netbsd-amd64), const BPF_H = 8 +pkg syscall (netbsd-amd64), const BPF_IMM = 0 +pkg syscall (netbsd-amd64), const BPF_IND = 64 +pkg syscall (netbsd-amd64), const BPF_JA = 0 +pkg syscall (netbsd-amd64), const BPF_JEQ = 16 +pkg syscall (netbsd-amd64), const BPF_JGE = 48 +pkg syscall (netbsd-amd64), const BPF_JGT = 32 +pkg syscall (netbsd-amd64), const BPF_JMP = 5 +pkg syscall (netbsd-amd64), const BPF_JSET = 64 +pkg syscall (netbsd-amd64), const BPF_K = 0 +pkg syscall (netbsd-amd64), const BPF_LD = 0 +pkg syscall (netbsd-amd64), const BPF_LDX = 1 +pkg syscall (netbsd-amd64), const BPF_LEN = 128 +pkg syscall (netbsd-amd64), const BPF_LSH = 96 +pkg syscall (netbsd-amd64), const BPF_MAJOR_VERSION = 1 +pkg syscall (netbsd-amd64), const BPF_MAXBUFSIZE = 16777216 +pkg syscall (netbsd-amd64), const BPF_MAXINSNS = 512 +pkg syscall (netbsd-amd64), const BPF_MEM = 96 +pkg syscall (netbsd-amd64), const BPF_MEMWORDS = 16 +pkg syscall (netbsd-amd64), const BPF_MINBUFSIZE = 32 +pkg syscall (netbsd-amd64), const BPF_MINOR_VERSION = 1 +pkg syscall (netbsd-amd64), const BPF_MISC = 7 +pkg syscall (netbsd-amd64), const BPF_MSH = 160 +pkg syscall (netbsd-amd64), const BPF_MUL = 32 +pkg syscall (netbsd-amd64), const BPF_NEG = 128 +pkg syscall (netbsd-amd64), const BPF_OR = 64 +pkg syscall (netbsd-amd64), const BPF_RELEASE = 199606 +pkg syscall (netbsd-amd64), const BPF_RET = 6 +pkg syscall (netbsd-amd64), const BPF_RSH = 112 +pkg syscall (netbsd-amd64), const BPF_ST = 2 +pkg syscall (netbsd-amd64), const BPF_STX = 3 +pkg syscall (netbsd-amd64), const BPF_SUB = 16 +pkg syscall (netbsd-amd64), const BPF_TAX = 0 +pkg syscall (netbsd-amd64), const BPF_TXA = 128 +pkg syscall (netbsd-amd64), const BPF_W = 0 +pkg syscall (netbsd-amd64), const BPF_X = 8 +pkg syscall (netbsd-amd64), const BRKINT = 2 +pkg syscall (netbsd-amd64), const CFLUSH = 15 +pkg syscall (netbsd-amd64), const CLOCAL = 32768 +pkg syscall (netbsd-amd64), const CREAD = 2048 +pkg syscall (netbsd-amd64), const CS5 = 0 +pkg syscall (netbsd-amd64), const CS6 = 256 +pkg syscall (netbsd-amd64), const CS7 = 512 +pkg syscall (netbsd-amd64), const CS8 = 768 +pkg syscall (netbsd-amd64), const CSIZE = 768 +pkg syscall (netbsd-amd64), const CSTART = 17 +pkg syscall (netbsd-amd64), const CSTATUS = 20 +pkg syscall (netbsd-amd64), const CSTOP = 19 +pkg syscall (netbsd-amd64), const CSTOPB = 1024 +pkg syscall (netbsd-amd64), const CSUSP = 26 +pkg syscall (netbsd-amd64), const CTL_MAXNAME = 12 +pkg syscall (netbsd-amd64), const CTL_NET = 4 +pkg syscall (netbsd-amd64), const CTL_QUERY = -2 +pkg syscall (netbsd-amd64), const DIOCBSFLUSH = 536896632 +pkg syscall (netbsd-amd64), const DLT_A429 = 184 +pkg syscall (netbsd-amd64), const DLT_A653_ICM = 185 +pkg syscall (netbsd-amd64), const DLT_AIRONET_HEADER = 120 +pkg syscall (netbsd-amd64), const DLT_AOS = 222 +pkg syscall (netbsd-amd64), const DLT_APPLE_IP_OVER_IEEE1394 = 138 +pkg syscall (netbsd-amd64), const DLT_ARCNET = 7 +pkg syscall (netbsd-amd64), const DLT_ARCNET_LINUX = 129 +pkg syscall (netbsd-amd64), const DLT_ATM_CLIP = 19 +pkg syscall (netbsd-amd64), const DLT_ATM_RFC1483 = 11 +pkg syscall (netbsd-amd64), const DLT_AURORA = 126 +pkg syscall (netbsd-amd64), const DLT_AX25 = 3 +pkg syscall (netbsd-amd64), const DLT_AX25_KISS = 202 +pkg syscall (netbsd-amd64), const DLT_BACNET_MS_TP = 165 +pkg syscall (netbsd-amd64), const DLT_BLUETOOTH_HCI_H4 = 187 +pkg syscall (netbsd-amd64), const DLT_BLUETOOTH_HCI_H4_WITH_PHDR = 201 +pkg syscall (netbsd-amd64), const DLT_CAN20B = 190 +pkg syscall (netbsd-amd64), const DLT_CAN_SOCKETCAN = 227 +pkg syscall (netbsd-amd64), const DLT_CHAOS = 5 +pkg syscall (netbsd-amd64), const DLT_CISCO_IOS = 118 +pkg syscall (netbsd-amd64), const DLT_C_HDLC = 104 +pkg syscall (netbsd-amd64), const DLT_C_HDLC_WITH_DIR = 205 +pkg syscall (netbsd-amd64), const DLT_DECT = 221 +pkg syscall (netbsd-amd64), const DLT_DOCSIS = 143 +pkg syscall (netbsd-amd64), const DLT_ECONET = 115 +pkg syscall (netbsd-amd64), const DLT_EN10MB = 1 +pkg syscall (netbsd-amd64), const DLT_EN3MB = 2 +pkg syscall (netbsd-amd64), const DLT_ENC = 109 +pkg syscall (netbsd-amd64), const DLT_ERF = 197 +pkg syscall (netbsd-amd64), const DLT_ERF_ETH = 175 +pkg syscall (netbsd-amd64), const DLT_ERF_POS = 176 +pkg syscall (netbsd-amd64), const DLT_FC_2 = 224 +pkg syscall (netbsd-amd64), const DLT_FC_2_WITH_FRAME_DELIMS = 225 +pkg syscall (netbsd-amd64), const DLT_FDDI = 10 +pkg syscall (netbsd-amd64), const DLT_FLEXRAY = 210 +pkg syscall (netbsd-amd64), const DLT_FRELAY = 107 +pkg syscall (netbsd-amd64), const DLT_FRELAY_WITH_DIR = 206 +pkg syscall (netbsd-amd64), const DLT_GCOM_SERIAL = 173 +pkg syscall (netbsd-amd64), const DLT_GCOM_T1E1 = 172 +pkg syscall (netbsd-amd64), const DLT_GPF_F = 171 +pkg syscall (netbsd-amd64), const DLT_GPF_T = 170 +pkg syscall (netbsd-amd64), const DLT_GPRS_LLC = 169 +pkg syscall (netbsd-amd64), const DLT_GSMTAP_ABIS = 218 +pkg syscall (netbsd-amd64), const DLT_GSMTAP_UM = 217 +pkg syscall (netbsd-amd64), const DLT_HDLC = 16 +pkg syscall (netbsd-amd64), const DLT_HHDLC = 121 +pkg syscall (netbsd-amd64), const DLT_HIPPI = 15 +pkg syscall (netbsd-amd64), const DLT_IBM_SN = 146 +pkg syscall (netbsd-amd64), const DLT_IBM_SP = 145 +pkg syscall (netbsd-amd64), const DLT_IEEE802 = 6 +pkg syscall (netbsd-amd64), const DLT_IEEE802_11 = 105 +pkg syscall (netbsd-amd64), const DLT_IEEE802_11_RADIO = 127 +pkg syscall (netbsd-amd64), const DLT_IEEE802_11_RADIO_AVS = 163 +pkg syscall (netbsd-amd64), const DLT_IEEE802_15_4 = 195 +pkg syscall (netbsd-amd64), const DLT_IEEE802_15_4_LINUX = 191 +pkg syscall (netbsd-amd64), const DLT_IEEE802_15_4_NONASK_PHY = 215 +pkg syscall (netbsd-amd64), const DLT_IEEE802_16_MAC_CPS = 188 +pkg syscall (netbsd-amd64), const DLT_IEEE802_16_MAC_CPS_RADIO = 193 +pkg syscall (netbsd-amd64), const DLT_IPMB = 199 +pkg syscall (netbsd-amd64), const DLT_IPMB_LINUX = 209 +pkg syscall (netbsd-amd64), const DLT_IPNET = 226 +pkg syscall (netbsd-amd64), const DLT_IPV4 = 228 +pkg syscall (netbsd-amd64), const DLT_IPV6 = 229 +pkg syscall (netbsd-amd64), const DLT_IP_OVER_FC = 122 +pkg syscall (netbsd-amd64), const DLT_JUNIPER_ATM1 = 137 +pkg syscall (netbsd-amd64), const DLT_JUNIPER_ATM2 = 135 +pkg syscall (netbsd-amd64), const DLT_JUNIPER_CHDLC = 181 +pkg syscall (netbsd-amd64), const DLT_JUNIPER_ES = 132 +pkg syscall (netbsd-amd64), const DLT_JUNIPER_ETHER = 178 +pkg syscall (netbsd-amd64), const DLT_JUNIPER_FRELAY = 180 +pkg syscall (netbsd-amd64), const DLT_JUNIPER_GGSN = 133 +pkg syscall (netbsd-amd64), const DLT_JUNIPER_ISM = 194 +pkg syscall (netbsd-amd64), const DLT_JUNIPER_MFR = 134 +pkg syscall (netbsd-amd64), const DLT_JUNIPER_MLFR = 131 +pkg syscall (netbsd-amd64), const DLT_JUNIPER_MLPPP = 130 +pkg syscall (netbsd-amd64), const DLT_JUNIPER_MONITOR = 164 +pkg syscall (netbsd-amd64), const DLT_JUNIPER_PIC_PEER = 174 +pkg syscall (netbsd-amd64), const DLT_JUNIPER_PPP = 179 +pkg syscall (netbsd-amd64), const DLT_JUNIPER_PPPOE = 167 +pkg syscall (netbsd-amd64), const DLT_JUNIPER_PPPOE_ATM = 168 +pkg syscall (netbsd-amd64), const DLT_JUNIPER_SERVICES = 136 +pkg syscall (netbsd-amd64), const DLT_JUNIPER_ST = 200 +pkg syscall (netbsd-amd64), const DLT_JUNIPER_VP = 183 +pkg syscall (netbsd-amd64), const DLT_LAPB_WITH_DIR = 207 +pkg syscall (netbsd-amd64), const DLT_LAPD = 203 +pkg syscall (netbsd-amd64), const DLT_LIN = 212 +pkg syscall (netbsd-amd64), const DLT_LINUX_EVDEV = 216 +pkg syscall (netbsd-amd64), const DLT_LINUX_IRDA = 144 +pkg syscall (netbsd-amd64), const DLT_LINUX_LAPD = 177 +pkg syscall (netbsd-amd64), const DLT_LINUX_SLL = 113 +pkg syscall (netbsd-amd64), const DLT_LOOP = 108 +pkg syscall (netbsd-amd64), const DLT_LTALK = 114 +pkg syscall (netbsd-amd64), const DLT_MFR = 182 +pkg syscall (netbsd-amd64), const DLT_MOST = 211 +pkg syscall (netbsd-amd64), const DLT_MPLS = 219 +pkg syscall (netbsd-amd64), const DLT_MTP2 = 140 +pkg syscall (netbsd-amd64), const DLT_MTP2_WITH_PHDR = 139 +pkg syscall (netbsd-amd64), const DLT_MTP3 = 141 +pkg syscall (netbsd-amd64), const DLT_NULL = 0 +pkg syscall (netbsd-amd64), const DLT_PCI_EXP = 125 +pkg syscall (netbsd-amd64), const DLT_PFLOG = 117 +pkg syscall (netbsd-amd64), const DLT_PFSYNC = 18 +pkg syscall (netbsd-amd64), const DLT_PPI = 192 +pkg syscall (netbsd-amd64), const DLT_PPP = 9 +pkg syscall (netbsd-amd64), const DLT_PPP_BSDOS = 14 +pkg syscall (netbsd-amd64), const DLT_PPP_ETHER = 51 +pkg syscall (netbsd-amd64), const DLT_PPP_PPPD = 166 +pkg syscall (netbsd-amd64), const DLT_PPP_SERIAL = 50 +pkg syscall (netbsd-amd64), const DLT_PPP_WITH_DIR = 204 +pkg syscall (netbsd-amd64), const DLT_PRISM_HEADER = 119 +pkg syscall (netbsd-amd64), const DLT_PRONET = 4 +pkg syscall (netbsd-amd64), const DLT_RAIF1 = 198 +pkg syscall (netbsd-amd64), const DLT_RAW = 12 +pkg syscall (netbsd-amd64), const DLT_RAWAF_MASK = 35913728 +pkg syscall (netbsd-amd64), const DLT_RIO = 124 +pkg syscall (netbsd-amd64), const DLT_SCCP = 142 +pkg syscall (netbsd-amd64), const DLT_SITA = 196 +pkg syscall (netbsd-amd64), const DLT_SLIP = 8 +pkg syscall (netbsd-amd64), const DLT_SLIP_BSDOS = 13 +pkg syscall (netbsd-amd64), const DLT_SUNATM = 123 +pkg syscall (netbsd-amd64), const DLT_SYMANTEC_FIREWALL = 99 +pkg syscall (netbsd-amd64), const DLT_TZSP = 128 +pkg syscall (netbsd-amd64), const DLT_USB = 186 +pkg syscall (netbsd-amd64), const DLT_USB_LINUX = 189 +pkg syscall (netbsd-amd64), const DLT_USB_LINUX_MMAPPED = 220 +pkg syscall (netbsd-amd64), const DLT_WIHART = 223 +pkg syscall (netbsd-amd64), const DLT_X2E_SERIAL = 213 +pkg syscall (netbsd-amd64), const DLT_X2E_XORAYA = 214 +pkg syscall (netbsd-amd64), const DT_BLK = 6 +pkg syscall (netbsd-amd64), const DT_CHR = 2 +pkg syscall (netbsd-amd64), const DT_DIR = 4 +pkg syscall (netbsd-amd64), const DT_FIFO = 1 +pkg syscall (netbsd-amd64), const DT_LNK = 10 +pkg syscall (netbsd-amd64), const DT_REG = 8 +pkg syscall (netbsd-amd64), const DT_SOCK = 12 +pkg syscall (netbsd-amd64), const DT_UNKNOWN = 0 +pkg syscall (netbsd-amd64), const DT_WHT = 14 +pkg syscall (netbsd-amd64), const E2BIG = 7 +pkg syscall (netbsd-amd64), const EACCES = 13 +pkg syscall (netbsd-amd64), const EADDRINUSE = 48 +pkg syscall (netbsd-amd64), const EADDRNOTAVAIL = 49 +pkg syscall (netbsd-amd64), const EAFNOSUPPORT = 47 +pkg syscall (netbsd-amd64), const EAGAIN = 35 +pkg syscall (netbsd-amd64), const EALREADY = 37 +pkg syscall (netbsd-amd64), const EAUTH = 80 +pkg syscall (netbsd-amd64), const EBADF = 9 +pkg syscall (netbsd-amd64), const EBADMSG = 88 +pkg syscall (netbsd-amd64), const EBADRPC = 72 +pkg syscall (netbsd-amd64), const EBUSY = 16 +pkg syscall (netbsd-amd64), const ECANCELED = 87 +pkg syscall (netbsd-amd64), const ECHILD = 10 +pkg syscall (netbsd-amd64), const ECHO = 8 +pkg syscall (netbsd-amd64), const ECHOCTL = 64 +pkg syscall (netbsd-amd64), const ECHOE = 2 +pkg syscall (netbsd-amd64), const ECHOK = 4 +pkg syscall (netbsd-amd64), const ECHOKE = 1 +pkg syscall (netbsd-amd64), const ECHONL = 16 +pkg syscall (netbsd-amd64), const ECHOPRT = 32 +pkg syscall (netbsd-amd64), const ECONNABORTED = 53 +pkg syscall (netbsd-amd64), const ECONNREFUSED = 61 +pkg syscall (netbsd-amd64), const ECONNRESET = 54 +pkg syscall (netbsd-amd64), const EDEADLK = 11 +pkg syscall (netbsd-amd64), const EDESTADDRREQ = 39 +pkg syscall (netbsd-amd64), const EDOM = 33 +pkg syscall (netbsd-amd64), const EDQUOT = 69 +pkg syscall (netbsd-amd64), const EEXIST = 17 +pkg syscall (netbsd-amd64), const EFAULT = 14 +pkg syscall (netbsd-amd64), const EFBIG = 27 +pkg syscall (netbsd-amd64), const EFTYPE = 79 +pkg syscall (netbsd-amd64), const EHOSTDOWN = 64 +pkg syscall (netbsd-amd64), const EHOSTUNREACH = 65 +pkg syscall (netbsd-amd64), const EIDRM = 82 +pkg syscall (netbsd-amd64), const EILSEQ = 85 +pkg syscall (netbsd-amd64), const EINPROGRESS = 36 +pkg syscall (netbsd-amd64), const EINTR = 4 +pkg syscall (netbsd-amd64), const EINVAL = 22 +pkg syscall (netbsd-amd64), const EIO = 5 +pkg syscall (netbsd-amd64), const EISCONN = 56 +pkg syscall (netbsd-amd64), const EISDIR = 21 +pkg syscall (netbsd-amd64), const ELAST = 96 +pkg syscall (netbsd-amd64), const ELOOP = 62 +pkg syscall (netbsd-amd64), const EMFILE = 24 +pkg syscall (netbsd-amd64), const EMLINK = 31 +pkg syscall (netbsd-amd64), const EMSGSIZE = 40 +pkg syscall (netbsd-amd64), const EMULTIHOP = 94 +pkg syscall (netbsd-amd64), const EMUL_LINUX = 1 +pkg syscall (netbsd-amd64), const EMUL_LINUX32 = 5 +pkg syscall (netbsd-amd64), const EMUL_MAXID = 6 +pkg syscall (netbsd-amd64), const ENAMETOOLONG = 63 +pkg syscall (netbsd-amd64), const ENEEDAUTH = 81 +pkg syscall (netbsd-amd64), const ENETDOWN = 50 +pkg syscall (netbsd-amd64), const ENETRESET = 52 +pkg syscall (netbsd-amd64), const ENETUNREACH = 51 +pkg syscall (netbsd-amd64), const ENFILE = 23 +pkg syscall (netbsd-amd64), const ENOATTR = 93 +pkg syscall (netbsd-amd64), const ENOBUFS = 55 +pkg syscall (netbsd-amd64), const ENODATA = 89 +pkg syscall (netbsd-amd64), const ENODEV = 19 +pkg syscall (netbsd-amd64), const ENOEXEC = 8 +pkg syscall (netbsd-amd64), const ENOLCK = 77 +pkg syscall (netbsd-amd64), const ENOLINK = 95 +pkg syscall (netbsd-amd64), const ENOMEM = 12 +pkg syscall (netbsd-amd64), const ENOMSG = 83 +pkg syscall (netbsd-amd64), const ENOPROTOOPT = 42 +pkg syscall (netbsd-amd64), const ENOSPC = 28 +pkg syscall (netbsd-amd64), const ENOSR = 90 +pkg syscall (netbsd-amd64), const ENOSTR = 91 +pkg syscall (netbsd-amd64), const ENOSYS = 78 +pkg syscall (netbsd-amd64), const ENOTBLK = 15 +pkg syscall (netbsd-amd64), const ENOTCONN = 57 +pkg syscall (netbsd-amd64), const ENOTDIR = 20 +pkg syscall (netbsd-amd64), const ENOTEMPTY = 66 +pkg syscall (netbsd-amd64), const ENOTSOCK = 38 +pkg syscall (netbsd-amd64), const ENOTSUP = 86 +pkg syscall (netbsd-amd64), const ENOTTY = 25 +pkg syscall (netbsd-amd64), const ENXIO = 6 +pkg syscall (netbsd-amd64), const EOPNOTSUPP = 45 +pkg syscall (netbsd-amd64), const EOVERFLOW = 84 +pkg syscall (netbsd-amd64), const EPERM = 1 +pkg syscall (netbsd-amd64), const EPFNOSUPPORT = 46 +pkg syscall (netbsd-amd64), const EPIPE = 32 +pkg syscall (netbsd-amd64), const EPROCLIM = 67 +pkg syscall (netbsd-amd64), const EPROCUNAVAIL = 76 +pkg syscall (netbsd-amd64), const EPROGMISMATCH = 75 +pkg syscall (netbsd-amd64), const EPROGUNAVAIL = 74 +pkg syscall (netbsd-amd64), const EPROTO = 96 +pkg syscall (netbsd-amd64), const EPROTONOSUPPORT = 43 +pkg syscall (netbsd-amd64), const EPROTOTYPE = 41 +pkg syscall (netbsd-amd64), const ERANGE = 34 +pkg syscall (netbsd-amd64), const EREMOTE = 71 +pkg syscall (netbsd-amd64), const EROFS = 30 +pkg syscall (netbsd-amd64), const ERPCMISMATCH = 73 +pkg syscall (netbsd-amd64), const ESHUTDOWN = 58 +pkg syscall (netbsd-amd64), const ESOCKTNOSUPPORT = 44 +pkg syscall (netbsd-amd64), const ESPIPE = 29 +pkg syscall (netbsd-amd64), const ESRCH = 3 +pkg syscall (netbsd-amd64), const ESTALE = 70 +pkg syscall (netbsd-amd64), const ETHERCAP_JUMBO_MTU = 4 +pkg syscall (netbsd-amd64), const ETHERCAP_VLAN_HWTAGGING = 2 +pkg syscall (netbsd-amd64), const ETHERCAP_VLAN_MTU = 1 +pkg syscall (netbsd-amd64), const ETHERMIN = 46 +pkg syscall (netbsd-amd64), const ETHERMTU = 1500 +pkg syscall (netbsd-amd64), const ETHERMTU_JUMBO = 9000 +pkg syscall (netbsd-amd64), const ETHERTYPE_8023 = 4 +pkg syscall (netbsd-amd64), const ETHERTYPE_AARP = 33011 +pkg syscall (netbsd-amd64), const ETHERTYPE_ACCTON = 33680 +pkg syscall (netbsd-amd64), const ETHERTYPE_AEONIC = 32822 +pkg syscall (netbsd-amd64), const ETHERTYPE_ALPHA = 33098 +pkg syscall (netbsd-amd64), const ETHERTYPE_AMBER = 24584 +pkg syscall (netbsd-amd64), const ETHERTYPE_AMOEBA = 33093 +pkg syscall (netbsd-amd64), const ETHERTYPE_APOLLO = 33015 +pkg syscall (netbsd-amd64), const ETHERTYPE_APOLLODOMAIN = 32793 +pkg syscall (netbsd-amd64), const ETHERTYPE_APPLETALK = 32923 +pkg syscall (netbsd-amd64), const ETHERTYPE_APPLITEK = 32967 +pkg syscall (netbsd-amd64), const ETHERTYPE_ARGONAUT = 32826 +pkg syscall (netbsd-amd64), const ETHERTYPE_ARP = 2054 +pkg syscall (netbsd-amd64), const ETHERTYPE_AT = 32923 +pkg syscall (netbsd-amd64), const ETHERTYPE_ATALK = 32923 +pkg syscall (netbsd-amd64), const ETHERTYPE_ATOMIC = 34527 +pkg syscall (netbsd-amd64), const ETHERTYPE_ATT = 32873 +pkg syscall (netbsd-amd64), const ETHERTYPE_ATTSTANFORD = 32776 +pkg syscall (netbsd-amd64), const ETHERTYPE_AUTOPHON = 32874 +pkg syscall (netbsd-amd64), const ETHERTYPE_AXIS = 34902 +pkg syscall (netbsd-amd64), const ETHERTYPE_BCLOOP = 36867 +pkg syscall (netbsd-amd64), const ETHERTYPE_BOFL = 33026 +pkg syscall (netbsd-amd64), const ETHERTYPE_CABLETRON = 28724 +pkg syscall (netbsd-amd64), const ETHERTYPE_CHAOS = 2052 +pkg syscall (netbsd-amd64), const ETHERTYPE_COMDESIGN = 32876 +pkg syscall (netbsd-amd64), const ETHERTYPE_COMPUGRAPHIC = 32877 +pkg syscall (netbsd-amd64), const ETHERTYPE_COUNTERPOINT = 32866 +pkg syscall (netbsd-amd64), const ETHERTYPE_CRONUS = 32772 +pkg syscall (netbsd-amd64), const ETHERTYPE_CRONUSVLN = 32771 +pkg syscall (netbsd-amd64), const ETHERTYPE_DCA = 4660 +pkg syscall (netbsd-amd64), const ETHERTYPE_DDE = 32891 +pkg syscall (netbsd-amd64), const ETHERTYPE_DEBNI = 43690 +pkg syscall (netbsd-amd64), const ETHERTYPE_DECAM = 32840 +pkg syscall (netbsd-amd64), const ETHERTYPE_DECCUST = 24582 +pkg syscall (netbsd-amd64), const ETHERTYPE_DECDIAG = 24581 +pkg syscall (netbsd-amd64), const ETHERTYPE_DECDNS = 32828 +pkg syscall (netbsd-amd64), const ETHERTYPE_DECDTS = 32830 +pkg syscall (netbsd-amd64), const ETHERTYPE_DECEXPER = 24576 +pkg syscall (netbsd-amd64), const ETHERTYPE_DECLAST = 32833 +pkg syscall (netbsd-amd64), const ETHERTYPE_DECLTM = 32831 +pkg syscall (netbsd-amd64), const ETHERTYPE_DECMUMPS = 24585 +pkg syscall (netbsd-amd64), const ETHERTYPE_DECNETBIOS = 32832 +pkg syscall (netbsd-amd64), const ETHERTYPE_DELTACON = 34526 +pkg syscall (netbsd-amd64), const ETHERTYPE_DIDDLE = 17185 +pkg syscall (netbsd-amd64), const ETHERTYPE_DLOG1 = 1632 +pkg syscall (netbsd-amd64), const ETHERTYPE_DLOG2 = 1633 +pkg syscall (netbsd-amd64), const ETHERTYPE_DN = 24579 +pkg syscall (netbsd-amd64), const ETHERTYPE_DOGFIGHT = 6537 +pkg syscall (netbsd-amd64), const ETHERTYPE_DSMD = 32825 +pkg syscall (netbsd-amd64), const ETHERTYPE_ECMA = 2051 +pkg syscall (netbsd-amd64), const ETHERTYPE_ENCRYPT = 32829 +pkg syscall (netbsd-amd64), const ETHERTYPE_ES = 32861 +pkg syscall (netbsd-amd64), const ETHERTYPE_EXCELAN = 32784 +pkg syscall (netbsd-amd64), const ETHERTYPE_EXPERDATA = 32841 +pkg syscall (netbsd-amd64), const ETHERTYPE_FLIP = 33094 +pkg syscall (netbsd-amd64), const ETHERTYPE_FLOWCONTROL = 34824 +pkg syscall (netbsd-amd64), const ETHERTYPE_FRARP = 2056 +pkg syscall (netbsd-amd64), const ETHERTYPE_GENDYN = 32872 +pkg syscall (netbsd-amd64), const ETHERTYPE_HAYES = 33072 +pkg syscall (netbsd-amd64), const ETHERTYPE_HIPPI_FP = 33152 +pkg syscall (netbsd-amd64), const ETHERTYPE_HITACHI = 34848 +pkg syscall (netbsd-amd64), const ETHERTYPE_HP = 32773 +pkg syscall (netbsd-amd64), const ETHERTYPE_IEEEPUP = 2560 +pkg syscall (netbsd-amd64), const ETHERTYPE_IEEEPUPAT = 2561 +pkg syscall (netbsd-amd64), const ETHERTYPE_IMLBL = 19522 +pkg syscall (netbsd-amd64), const ETHERTYPE_IMLBLDIAG = 16972 +pkg syscall (netbsd-amd64), const ETHERTYPE_IP = 2048 +pkg syscall (netbsd-amd64), const ETHERTYPE_IPAS = 34668 +pkg syscall (netbsd-amd64), const ETHERTYPE_IPV6 = 34525 +pkg syscall (netbsd-amd64), const ETHERTYPE_IPX = 33079 +pkg syscall (netbsd-amd64), const ETHERTYPE_IPXNEW = 32823 +pkg syscall (netbsd-amd64), const ETHERTYPE_KALPANA = 34178 +pkg syscall (netbsd-amd64), const ETHERTYPE_LANBRIDGE = 32824 +pkg syscall (netbsd-amd64), const ETHERTYPE_LANPROBE = 34952 +pkg syscall (netbsd-amd64), const ETHERTYPE_LAT = 24580 +pkg syscall (netbsd-amd64), const ETHERTYPE_LBACK = 36864 +pkg syscall (netbsd-amd64), const ETHERTYPE_LITTLE = 32864 +pkg syscall (netbsd-amd64), const ETHERTYPE_LOGICRAFT = 33096 +pkg syscall (netbsd-amd64), const ETHERTYPE_LOOPBACK = 36864 +pkg syscall (netbsd-amd64), const ETHERTYPE_MATRA = 32890 +pkg syscall (netbsd-amd64), const ETHERTYPE_MAX = 65535 +pkg syscall (netbsd-amd64), const ETHERTYPE_MERIT = 32892 +pkg syscall (netbsd-amd64), const ETHERTYPE_MICP = 34618 +pkg syscall (netbsd-amd64), const ETHERTYPE_MOPDL = 24577 +pkg syscall (netbsd-amd64), const ETHERTYPE_MOPRC = 24578 +pkg syscall (netbsd-amd64), const ETHERTYPE_MOTOROLA = 33165 +pkg syscall (netbsd-amd64), const ETHERTYPE_MPLS = 34887 +pkg syscall (netbsd-amd64), const ETHERTYPE_MPLS_MCAST = 34888 +pkg syscall (netbsd-amd64), const ETHERTYPE_MUMPS = 33087 +pkg syscall (netbsd-amd64), const ETHERTYPE_NBPCC = 15364 +pkg syscall (netbsd-amd64), const ETHERTYPE_NBPCLAIM = 15369 +pkg syscall (netbsd-amd64), const ETHERTYPE_NBPCLREQ = 15365 +pkg syscall (netbsd-amd64), const ETHERTYPE_NBPCLRSP = 15366 +pkg syscall (netbsd-amd64), const ETHERTYPE_NBPCREQ = 15362 +pkg syscall (netbsd-amd64), const ETHERTYPE_NBPCRSP = 15363 +pkg syscall (netbsd-amd64), const ETHERTYPE_NBPDG = 15367 +pkg syscall (netbsd-amd64), const ETHERTYPE_NBPDGB = 15368 +pkg syscall (netbsd-amd64), const ETHERTYPE_NBPDLTE = 15370 +pkg syscall (netbsd-amd64), const ETHERTYPE_NBPRAR = 15372 +pkg syscall (netbsd-amd64), const ETHERTYPE_NBPRAS = 15371 +pkg syscall (netbsd-amd64), const ETHERTYPE_NBPRST = 15373 +pkg syscall (netbsd-amd64), const ETHERTYPE_NBPSCD = 15361 +pkg syscall (netbsd-amd64), const ETHERTYPE_NBPVCD = 15360 +pkg syscall (netbsd-amd64), const ETHERTYPE_NBS = 2050 +pkg syscall (netbsd-amd64), const ETHERTYPE_NCD = 33097 +pkg syscall (netbsd-amd64), const ETHERTYPE_NESTAR = 32774 +pkg syscall (netbsd-amd64), const ETHERTYPE_NETBEUI = 33169 +pkg syscall (netbsd-amd64), const ETHERTYPE_NOVELL = 33080 +pkg syscall (netbsd-amd64), const ETHERTYPE_NS = 1536 +pkg syscall (netbsd-amd64), const ETHERTYPE_NSAT = 1537 +pkg syscall (netbsd-amd64), const ETHERTYPE_NSCOMPAT = 2055 +pkg syscall (netbsd-amd64), const ETHERTYPE_NTRAILER = 16 +pkg syscall (netbsd-amd64), const ETHERTYPE_OS9 = 28679 +pkg syscall (netbsd-amd64), const ETHERTYPE_OS9NET = 28681 +pkg syscall (netbsd-amd64), const ETHERTYPE_PACER = 32966 +pkg syscall (netbsd-amd64), const ETHERTYPE_PAE = 34958 +pkg syscall (netbsd-amd64), const ETHERTYPE_PCS = 16962 +pkg syscall (netbsd-amd64), const ETHERTYPE_PLANNING = 32836 +pkg syscall (netbsd-amd64), const ETHERTYPE_PPP = 34827 +pkg syscall (netbsd-amd64), const ETHERTYPE_PPPOE = 34916 +pkg syscall (netbsd-amd64), const ETHERTYPE_PPPOEDISC = 34915 +pkg syscall (netbsd-amd64), const ETHERTYPE_PRIMENTS = 28721 +pkg syscall (netbsd-amd64), const ETHERTYPE_PUP = 512 +pkg syscall (netbsd-amd64), const ETHERTYPE_PUPAT = 512 +pkg syscall (netbsd-amd64), const ETHERTYPE_RACAL = 28720 +pkg syscall (netbsd-amd64), const ETHERTYPE_RATIONAL = 33104 +pkg syscall (netbsd-amd64), const ETHERTYPE_RAWFR = 25945 +pkg syscall (netbsd-amd64), const ETHERTYPE_RCL = 6549 +pkg syscall (netbsd-amd64), const ETHERTYPE_RDP = 34617 +pkg syscall (netbsd-amd64), const ETHERTYPE_RETIX = 33010 +pkg syscall (netbsd-amd64), const ETHERTYPE_REVARP = 32821 +pkg syscall (netbsd-amd64), const ETHERTYPE_SCA = 24583 +pkg syscall (netbsd-amd64), const ETHERTYPE_SECTRA = 34523 +pkg syscall (netbsd-amd64), const ETHERTYPE_SECUREDATA = 34669 +pkg syscall (netbsd-amd64), const ETHERTYPE_SGITW = 33150 +pkg syscall (netbsd-amd64), const ETHERTYPE_SG_BOUNCE = 32790 +pkg syscall (netbsd-amd64), const ETHERTYPE_SG_DIAG = 32787 +pkg syscall (netbsd-amd64), const ETHERTYPE_SG_NETGAMES = 32788 +pkg syscall (netbsd-amd64), const ETHERTYPE_SG_RESV = 32789 +pkg syscall (netbsd-amd64), const ETHERTYPE_SIMNET = 21000 +pkg syscall (netbsd-amd64), const ETHERTYPE_SLOWPROTOCOLS = 34825 +pkg syscall (netbsd-amd64), const ETHERTYPE_SNA = 32981 +pkg syscall (netbsd-amd64), const ETHERTYPE_SNMP = 33100 +pkg syscall (netbsd-amd64), const ETHERTYPE_SONIX = 64245 +pkg syscall (netbsd-amd64), const ETHERTYPE_SPIDER = 32927 +pkg syscall (netbsd-amd64), const ETHERTYPE_SPRITE = 1280 +pkg syscall (netbsd-amd64), const ETHERTYPE_STP = 33153 +pkg syscall (netbsd-amd64), const ETHERTYPE_TALARIS = 33067 +pkg syscall (netbsd-amd64), const ETHERTYPE_TALARISMC = 34091 +pkg syscall (netbsd-amd64), const ETHERTYPE_TCPCOMP = 34667 +pkg syscall (netbsd-amd64), const ETHERTYPE_TCPSM = 36866 +pkg syscall (netbsd-amd64), const ETHERTYPE_TEC = 33103 +pkg syscall (netbsd-amd64), const ETHERTYPE_TIGAN = 32815 +pkg syscall (netbsd-amd64), const ETHERTYPE_TRAIL = 4096 +pkg syscall (netbsd-amd64), const ETHERTYPE_TRANSETHER = 25944 +pkg syscall (netbsd-amd64), const ETHERTYPE_TYMSHARE = 32814 +pkg syscall (netbsd-amd64), const ETHERTYPE_UBBST = 28677 +pkg syscall (netbsd-amd64), const ETHERTYPE_UBDEBUG = 2304 +pkg syscall (netbsd-amd64), const ETHERTYPE_UBDIAGLOOP = 28674 +pkg syscall (netbsd-amd64), const ETHERTYPE_UBDL = 28672 +pkg syscall (netbsd-amd64), const ETHERTYPE_UBNIU = 28673 +pkg syscall (netbsd-amd64), const ETHERTYPE_UBNMC = 28675 +pkg syscall (netbsd-amd64), const ETHERTYPE_VALID = 5632 +pkg syscall (netbsd-amd64), const ETHERTYPE_VARIAN = 32989 +pkg syscall (netbsd-amd64), const ETHERTYPE_VAXELN = 32827 +pkg syscall (netbsd-amd64), const ETHERTYPE_VEECO = 32871 +pkg syscall (netbsd-amd64), const ETHERTYPE_VEXP = 32859 +pkg syscall (netbsd-amd64), const ETHERTYPE_VGLAB = 33073 +pkg syscall (netbsd-amd64), const ETHERTYPE_VINES = 2989 +pkg syscall (netbsd-amd64), const ETHERTYPE_VINESECHO = 2991 +pkg syscall (netbsd-amd64), const ETHERTYPE_VINESLOOP = 2990 +pkg syscall (netbsd-amd64), const ETHERTYPE_VITAL = 65280 +pkg syscall (netbsd-amd64), const ETHERTYPE_VLAN = 33024 +pkg syscall (netbsd-amd64), const ETHERTYPE_VLTLMAN = 32896 +pkg syscall (netbsd-amd64), const ETHERTYPE_VPROD = 32860 +pkg syscall (netbsd-amd64), const ETHERTYPE_VURESERVED = 33095 +pkg syscall (netbsd-amd64), const ETHERTYPE_WATERLOO = 33072 +pkg syscall (netbsd-amd64), const ETHERTYPE_WELLFLEET = 33027 +pkg syscall (netbsd-amd64), const ETHERTYPE_X25 = 2053 +pkg syscall (netbsd-amd64), const ETHERTYPE_X75 = 2049 +pkg syscall (netbsd-amd64), const ETHERTYPE_XNSSM = 36865 +pkg syscall (netbsd-amd64), const ETHERTYPE_XTP = 33149 +pkg syscall (netbsd-amd64), const ETHER_ADDR_LEN = 6 +pkg syscall (netbsd-amd64), const ETHER_CRC_LEN = 4 +pkg syscall (netbsd-amd64), const ETHER_CRC_POLY_BE = 79764918 +pkg syscall (netbsd-amd64), const ETHER_CRC_POLY_LE = 3988292384 +pkg syscall (netbsd-amd64), const ETHER_HDR_LEN = 14 +pkg syscall (netbsd-amd64), const ETHER_MAX_LEN = 1518 +pkg syscall (netbsd-amd64), const ETHER_MAX_LEN_JUMBO = 9018 +pkg syscall (netbsd-amd64), const ETHER_MIN_LEN = 64 +pkg syscall (netbsd-amd64), const ETHER_PPPOE_ENCAP_LEN = 8 +pkg syscall (netbsd-amd64), const ETHER_TYPE_LEN = 2 +pkg syscall (netbsd-amd64), const ETHER_VLAN_ENCAP_LEN = 4 +pkg syscall (netbsd-amd64), const ETIME = 92 +pkg syscall (netbsd-amd64), const ETIMEDOUT = 60 +pkg syscall (netbsd-amd64), const ETOOMANYREFS = 59 +pkg syscall (netbsd-amd64), const ETXTBSY = 26 +pkg syscall (netbsd-amd64), const EUSERS = 68 +pkg syscall (netbsd-amd64), const EVFILT_AIO = 2 +pkg syscall (netbsd-amd64), const EVFILT_PROC = 4 +pkg syscall (netbsd-amd64), const EVFILT_READ = 0 +pkg syscall (netbsd-amd64), const EVFILT_SIGNAL = 5 +pkg syscall (netbsd-amd64), const EVFILT_SYSCOUNT = 7 +pkg syscall (netbsd-amd64), const EVFILT_TIMER = 6 +pkg syscall (netbsd-amd64), const EVFILT_VNODE = 3 +pkg syscall (netbsd-amd64), const EVFILT_WRITE = 1 +pkg syscall (netbsd-amd64), const EV_ADD = 1 +pkg syscall (netbsd-amd64), const EV_CLEAR = 32 +pkg syscall (netbsd-amd64), const EV_DELETE = 2 +pkg syscall (netbsd-amd64), const EV_DISABLE = 8 +pkg syscall (netbsd-amd64), const EV_ENABLE = 4 +pkg syscall (netbsd-amd64), const EV_EOF = 32768 +pkg syscall (netbsd-amd64), const EV_ERROR = 16384 +pkg syscall (netbsd-amd64), const EV_FLAG1 = 8192 +pkg syscall (netbsd-amd64), const EV_ONESHOT = 16 +pkg syscall (netbsd-amd64), const EV_SYSFLAGS = 61440 +pkg syscall (netbsd-amd64), const EWOULDBLOCK = 35 +pkg syscall (netbsd-amd64), const EXDEV = 18 +pkg syscall (netbsd-amd64), const EXTA = 19200 +pkg syscall (netbsd-amd64), const EXTB = 38400 +pkg syscall (netbsd-amd64), const EXTPROC = 2048 +pkg syscall (netbsd-amd64), const FD_CLOEXEC = 1 +pkg syscall (netbsd-amd64), const FD_SETSIZE = 256 +pkg syscall (netbsd-amd64), const FLUSHO = 8388608 +pkg syscall (netbsd-amd64), const F_CLOSEM = 10 +pkg syscall (netbsd-amd64), const F_DUPFD = 0 +pkg syscall (netbsd-amd64), const F_DUPFD_CLOEXEC = 12 +pkg syscall (netbsd-amd64), const F_FSCTL = -2147483648 +pkg syscall (netbsd-amd64), const F_FSDIRMASK = 1879048192 +pkg syscall (netbsd-amd64), const F_FSIN = 268435456 +pkg syscall (netbsd-amd64), const F_FSINOUT = 805306368 +pkg syscall (netbsd-amd64), const F_FSOUT = 536870912 +pkg syscall (netbsd-amd64), const F_FSPRIV = 32768 +pkg syscall (netbsd-amd64), const F_FSVOID = 1073741824 +pkg syscall (netbsd-amd64), const F_GETFD = 1 +pkg syscall (netbsd-amd64), const F_GETFL = 3 +pkg syscall (netbsd-amd64), const F_GETLK = 7 +pkg syscall (netbsd-amd64), const F_GETNOSIGPIPE = 13 +pkg syscall (netbsd-amd64), const F_GETOWN = 5 +pkg syscall (netbsd-amd64), const F_MAXFD = 11 +pkg syscall (netbsd-amd64), const F_OK = 0 +pkg syscall (netbsd-amd64), const F_PARAM_MASK = 4095 +pkg syscall (netbsd-amd64), const F_PARAM_MAX = 4095 +pkg syscall (netbsd-amd64), const F_RDLCK = 1 +pkg syscall (netbsd-amd64), const F_SETFD = 2 +pkg syscall (netbsd-amd64), const F_SETFL = 4 +pkg syscall (netbsd-amd64), const F_SETLK = 8 +pkg syscall (netbsd-amd64), const F_SETLKW = 9 +pkg syscall (netbsd-amd64), const F_SETNOSIGPIPE = 14 +pkg syscall (netbsd-amd64), const F_SETOWN = 6 +pkg syscall (netbsd-amd64), const F_UNLCK = 2 +pkg syscall (netbsd-amd64), const F_WRLCK = 3 +pkg syscall (netbsd-amd64), const HUPCL = 16384 +pkg syscall (netbsd-amd64), const ICANON = 256 +pkg syscall (netbsd-amd64), const ICRNL = 256 +pkg syscall (netbsd-amd64), const IEXTEN = 1024 +pkg syscall (netbsd-amd64), const IFAN_ARRIVAL = 0 +pkg syscall (netbsd-amd64), const IFAN_DEPARTURE = 1 +pkg syscall (netbsd-amd64), const IFA_ROUTE = 1 +pkg syscall (netbsd-amd64), const IFF_ALLMULTI = 512 +pkg syscall (netbsd-amd64), const IFF_CANTCHANGE = 36690 +pkg syscall (netbsd-amd64), const IFF_DEBUG = 4 +pkg syscall (netbsd-amd64), const IFF_LINK0 = 4096 +pkg syscall (netbsd-amd64), const IFF_LINK1 = 8192 +pkg syscall (netbsd-amd64), const IFF_LINK2 = 16384 +pkg syscall (netbsd-amd64), const IFF_LOOPBACK = 8 +pkg syscall (netbsd-amd64), const IFF_MULTICAST = 32768 +pkg syscall (netbsd-amd64), const IFF_NOARP = 128 +pkg syscall (netbsd-amd64), const IFF_NOTRAILERS = 32 +pkg syscall (netbsd-amd64), const IFF_OACTIVE = 1024 +pkg syscall (netbsd-amd64), const IFF_POINTOPOINT = 16 +pkg syscall (netbsd-amd64), const IFF_PROMISC = 256 +pkg syscall (netbsd-amd64), const IFF_RUNNING = 64 +pkg syscall (netbsd-amd64), const IFF_SIMPLEX = 2048 +pkg syscall (netbsd-amd64), const IFNAMSIZ = 16 +pkg syscall (netbsd-amd64), const IFT_1822 = 2 +pkg syscall (netbsd-amd64), const IFT_A12MPPSWITCH = 130 +pkg syscall (netbsd-amd64), const IFT_AAL2 = 187 +pkg syscall (netbsd-amd64), const IFT_AAL5 = 49 +pkg syscall (netbsd-amd64), const IFT_ADSL = 94 +pkg syscall (netbsd-amd64), const IFT_AFLANE8023 = 59 +pkg syscall (netbsd-amd64), const IFT_AFLANE8025 = 60 +pkg syscall (netbsd-amd64), const IFT_ARAP = 88 +pkg syscall (netbsd-amd64), const IFT_ARCNET = 35 +pkg syscall (netbsd-amd64), const IFT_ARCNETPLUS = 36 +pkg syscall (netbsd-amd64), const IFT_ASYNC = 84 +pkg syscall (netbsd-amd64), const IFT_ATM = 37 +pkg syscall (netbsd-amd64), const IFT_ATMDXI = 105 +pkg syscall (netbsd-amd64), const IFT_ATMFUNI = 106 +pkg syscall (netbsd-amd64), const IFT_ATMIMA = 107 +pkg syscall (netbsd-amd64), const IFT_ATMLOGICAL = 80 +pkg syscall (netbsd-amd64), const IFT_ATMRADIO = 189 +pkg syscall (netbsd-amd64), const IFT_ATMSUBINTERFACE = 134 +pkg syscall (netbsd-amd64), const IFT_ATMVCIENDPT = 194 +pkg syscall (netbsd-amd64), const IFT_ATMVIRTUAL = 149 +pkg syscall (netbsd-amd64), const IFT_BGPPOLICYACCOUNTING = 162 +pkg syscall (netbsd-amd64), const IFT_BRIDGE = 209 +pkg syscall (netbsd-amd64), const IFT_BSC = 83 +pkg syscall (netbsd-amd64), const IFT_CARP = 248 +pkg syscall (netbsd-amd64), const IFT_CCTEMUL = 61 +pkg syscall (netbsd-amd64), const IFT_CEPT = 19 +pkg syscall (netbsd-amd64), const IFT_CES = 133 +pkg syscall (netbsd-amd64), const IFT_CHANNEL = 70 +pkg syscall (netbsd-amd64), const IFT_CNR = 85 +pkg syscall (netbsd-amd64), const IFT_COFFEE = 132 +pkg syscall (netbsd-amd64), const IFT_COMPOSITELINK = 155 +pkg syscall (netbsd-amd64), const IFT_DCN = 141 +pkg syscall (netbsd-amd64), const IFT_DIGITALPOWERLINE = 138 +pkg syscall (netbsd-amd64), const IFT_DIGITALWRAPPEROVERHEADCHANNEL = 186 +pkg syscall (netbsd-amd64), const IFT_DLSW = 74 +pkg syscall (netbsd-amd64), const IFT_DOCSCABLEDOWNSTREAM = 128 +pkg syscall (netbsd-amd64), const IFT_DOCSCABLEMACLAYER = 127 +pkg syscall (netbsd-amd64), const IFT_DOCSCABLEUPSTREAM = 129 +pkg syscall (netbsd-amd64), const IFT_DOCSCABLEUPSTREAMCHANNEL = 205 +pkg syscall (netbsd-amd64), const IFT_DS0 = 81 +pkg syscall (netbsd-amd64), const IFT_DS0BUNDLE = 82 +pkg syscall (netbsd-amd64), const IFT_DS1FDL = 170 +pkg syscall (netbsd-amd64), const IFT_DS3 = 30 +pkg syscall (netbsd-amd64), const IFT_DTM = 140 +pkg syscall (netbsd-amd64), const IFT_DVBASILN = 172 +pkg syscall (netbsd-amd64), const IFT_DVBASIOUT = 173 +pkg syscall (netbsd-amd64), const IFT_DVBRCCDOWNSTREAM = 147 +pkg syscall (netbsd-amd64), const IFT_DVBRCCMACLAYER = 146 +pkg syscall (netbsd-amd64), const IFT_DVBRCCUPSTREAM = 148 +pkg syscall (netbsd-amd64), const IFT_ECONET = 206 +pkg syscall (netbsd-amd64), const IFT_EON = 25 +pkg syscall (netbsd-amd64), const IFT_EPLRS = 87 +pkg syscall (netbsd-amd64), const IFT_ESCON = 73 +pkg syscall (netbsd-amd64), const IFT_ETHER = 6 +pkg syscall (netbsd-amd64), const IFT_FAITH = 242 +pkg syscall (netbsd-amd64), const IFT_FAST = 125 +pkg syscall (netbsd-amd64), const IFT_FASTETHER = 62 +pkg syscall (netbsd-amd64), const IFT_FASTETHERFX = 69 +pkg syscall (netbsd-amd64), const IFT_FDDI = 15 +pkg syscall (netbsd-amd64), const IFT_FIBRECHANNEL = 56 +pkg syscall (netbsd-amd64), const IFT_FRAMERELAYINTERCONNECT = 58 +pkg syscall (netbsd-amd64), const IFT_FRAMERELAYMPI = 92 +pkg syscall (netbsd-amd64), const IFT_FRDLCIENDPT = 193 +pkg syscall (netbsd-amd64), const IFT_FRELAY = 32 +pkg syscall (netbsd-amd64), const IFT_FRELAYDCE = 44 +pkg syscall (netbsd-amd64), const IFT_FRF16MFRBUNDLE = 163 +pkg syscall (netbsd-amd64), const IFT_FRFORWARD = 158 +pkg syscall (netbsd-amd64), const IFT_G703AT2MB = 67 +pkg syscall (netbsd-amd64), const IFT_G703AT64K = 66 +pkg syscall (netbsd-amd64), const IFT_GIF = 240 +pkg syscall (netbsd-amd64), const IFT_GIGABITETHERNET = 117 +pkg syscall (netbsd-amd64), const IFT_GR303IDT = 178 +pkg syscall (netbsd-amd64), const IFT_GR303RDT = 177 +pkg syscall (netbsd-amd64), const IFT_H323GATEKEEPER = 164 +pkg syscall (netbsd-amd64), const IFT_H323PROXY = 165 +pkg syscall (netbsd-amd64), const IFT_HDH1822 = 3 +pkg syscall (netbsd-amd64), const IFT_HDLC = 118 +pkg syscall (netbsd-amd64), const IFT_HDSL2 = 168 +pkg syscall (netbsd-amd64), const IFT_HIPERLAN2 = 183 +pkg syscall (netbsd-amd64), const IFT_HIPPI = 47 +pkg syscall (netbsd-amd64), const IFT_HIPPIINTERFACE = 57 +pkg syscall (netbsd-amd64), const IFT_HOSTPAD = 90 +pkg syscall (netbsd-amd64), const IFT_HSSI = 46 +pkg syscall (netbsd-amd64), const IFT_HY = 14 +pkg syscall (netbsd-amd64), const IFT_IBM370PARCHAN = 72 +pkg syscall (netbsd-amd64), const IFT_IDSL = 154 +pkg syscall (netbsd-amd64), const IFT_IEEE1394 = 144 +pkg syscall (netbsd-amd64), const IFT_IEEE80211 = 71 +pkg syscall (netbsd-amd64), const IFT_IEEE80212 = 55 +pkg syscall (netbsd-amd64), const IFT_IEEE8023ADLAG = 161 +pkg syscall (netbsd-amd64), const IFT_IFGSN = 145 +pkg syscall (netbsd-amd64), const IFT_IMT = 190 +pkg syscall (netbsd-amd64), const IFT_INFINIBAND = 199 +pkg syscall (netbsd-amd64), const IFT_INTERLEAVE = 124 +pkg syscall (netbsd-amd64), const IFT_IP = 126 +pkg syscall (netbsd-amd64), const IFT_IPFORWARD = 142 +pkg syscall (netbsd-amd64), const IFT_IPOVERATM = 114 +pkg syscall (netbsd-amd64), const IFT_IPOVERCDLC = 109 +pkg syscall (netbsd-amd64), const IFT_IPOVERCLAW = 110 +pkg syscall (netbsd-amd64), const IFT_IPSWITCH = 78 +pkg syscall (netbsd-amd64), const IFT_ISDN = 63 +pkg syscall (netbsd-amd64), const IFT_ISDNBASIC = 20 +pkg syscall (netbsd-amd64), const IFT_ISDNPRIMARY = 21 +pkg syscall (netbsd-amd64), const IFT_ISDNS = 75 +pkg syscall (netbsd-amd64), const IFT_ISDNU = 76 +pkg syscall (netbsd-amd64), const IFT_ISO88022LLC = 41 +pkg syscall (netbsd-amd64), const IFT_ISO88023 = 7 +pkg syscall (netbsd-amd64), const IFT_ISO88024 = 8 +pkg syscall (netbsd-amd64), const IFT_ISO88025 = 9 +pkg syscall (netbsd-amd64), const IFT_ISO88025CRFPINT = 98 +pkg syscall (netbsd-amd64), const IFT_ISO88025DTR = 86 +pkg syscall (netbsd-amd64), const IFT_ISO88025FIBER = 115 +pkg syscall (netbsd-amd64), const IFT_ISO88026 = 10 +pkg syscall (netbsd-amd64), const IFT_ISUP = 179 +pkg syscall (netbsd-amd64), const IFT_L2VLAN = 135 +pkg syscall (netbsd-amd64), const IFT_L3IPVLAN = 136 +pkg syscall (netbsd-amd64), const IFT_L3IPXVLAN = 137 +pkg syscall (netbsd-amd64), const IFT_LAPB = 16 +pkg syscall (netbsd-amd64), const IFT_LAPD = 77 +pkg syscall (netbsd-amd64), const IFT_LAPF = 119 +pkg syscall (netbsd-amd64), const IFT_LINEGROUP = 210 +pkg syscall (netbsd-amd64), const IFT_LOCALTALK = 42 +pkg syscall (netbsd-amd64), const IFT_LOOP = 24 +pkg syscall (netbsd-amd64), const IFT_MEDIAMAILOVERIP = 139 +pkg syscall (netbsd-amd64), const IFT_MFSIGLINK = 167 +pkg syscall (netbsd-amd64), const IFT_MIOX25 = 38 +pkg syscall (netbsd-amd64), const IFT_MODEM = 48 +pkg syscall (netbsd-amd64), const IFT_MPC = 113 +pkg syscall (netbsd-amd64), const IFT_MPLS = 166 +pkg syscall (netbsd-amd64), const IFT_MPLSTUNNEL = 150 +pkg syscall (netbsd-amd64), const IFT_MSDSL = 143 +pkg syscall (netbsd-amd64), const IFT_MVL = 191 +pkg syscall (netbsd-amd64), const IFT_MYRINET = 99 +pkg syscall (netbsd-amd64), const IFT_NFAS = 175 +pkg syscall (netbsd-amd64), const IFT_NSIP = 27 +pkg syscall (netbsd-amd64), const IFT_OPTICALCHANNEL = 195 +pkg syscall (netbsd-amd64), const IFT_OPTICALTRANSPORT = 196 +pkg syscall (netbsd-amd64), const IFT_OTHER = 1 +pkg syscall (netbsd-amd64), const IFT_P10 = 12 +pkg syscall (netbsd-amd64), const IFT_P80 = 13 +pkg syscall (netbsd-amd64), const IFT_PARA = 34 +pkg syscall (netbsd-amd64), const IFT_PFLOG = 245 +pkg syscall (netbsd-amd64), const IFT_PFSYNC = 246 +pkg syscall (netbsd-amd64), const IFT_PLC = 174 +pkg syscall (netbsd-amd64), const IFT_PON155 = 207 +pkg syscall (netbsd-amd64), const IFT_PON622 = 208 +pkg syscall (netbsd-amd64), const IFT_POS = 171 +pkg syscall (netbsd-amd64), const IFT_PPP = 23 +pkg syscall (netbsd-amd64), const IFT_PPPMULTILINKBUNDLE = 108 +pkg syscall (netbsd-amd64), const IFT_PROPATM = 197 +pkg syscall (netbsd-amd64), const IFT_PROPBWAP2MP = 184 +pkg syscall (netbsd-amd64), const IFT_PROPCNLS = 89 +pkg syscall (netbsd-amd64), const IFT_PROPDOCSWIRELESSDOWNSTREAM = 181 +pkg syscall (netbsd-amd64), const IFT_PROPDOCSWIRELESSMACLAYER = 180 +pkg syscall (netbsd-amd64), const IFT_PROPDOCSWIRELESSUPSTREAM = 182 +pkg syscall (netbsd-amd64), const IFT_PROPMUX = 54 +pkg syscall (netbsd-amd64), const IFT_PROPVIRTUAL = 53 +pkg syscall (netbsd-amd64), const IFT_PROPWIRELESSP2P = 157 +pkg syscall (netbsd-amd64), const IFT_PTPSERIAL = 22 +pkg syscall (netbsd-amd64), const IFT_PVC = 241 +pkg syscall (netbsd-amd64), const IFT_Q2931 = 201 +pkg syscall (netbsd-amd64), const IFT_QLLC = 68 +pkg syscall (netbsd-amd64), const IFT_RADIOMAC = 188 +pkg syscall (netbsd-amd64), const IFT_RADSL = 95 +pkg syscall (netbsd-amd64), const IFT_REACHDSL = 192 +pkg syscall (netbsd-amd64), const IFT_RFC1483 = 159 +pkg syscall (netbsd-amd64), const IFT_RS232 = 33 +pkg syscall (netbsd-amd64), const IFT_RSRB = 79 +pkg syscall (netbsd-amd64), const IFT_SDLC = 17 +pkg syscall (netbsd-amd64), const IFT_SDSL = 96 +pkg syscall (netbsd-amd64), const IFT_SHDSL = 169 +pkg syscall (netbsd-amd64), const IFT_SIP = 31 +pkg syscall (netbsd-amd64), const IFT_SIPSIG = 204 +pkg syscall (netbsd-amd64), const IFT_SIPTG = 203 +pkg syscall (netbsd-amd64), const IFT_SLIP = 28 +pkg syscall (netbsd-amd64), const IFT_SMDSDXI = 43 +pkg syscall (netbsd-amd64), const IFT_SMDSICIP = 52 +pkg syscall (netbsd-amd64), const IFT_SONET = 39 +pkg syscall (netbsd-amd64), const IFT_SONETOVERHEADCHANNEL = 185 +pkg syscall (netbsd-amd64), const IFT_SONETPATH = 50 +pkg syscall (netbsd-amd64), const IFT_SONETVT = 51 +pkg syscall (netbsd-amd64), const IFT_SRP = 151 +pkg syscall (netbsd-amd64), const IFT_SS7SIGLINK = 156 +pkg syscall (netbsd-amd64), const IFT_STACKTOSTACK = 111 +pkg syscall (netbsd-amd64), const IFT_STARLAN = 11 +pkg syscall (netbsd-amd64), const IFT_STF = 215 +pkg syscall (netbsd-amd64), const IFT_T1 = 18 +pkg syscall (netbsd-amd64), const IFT_TDLC = 116 +pkg syscall (netbsd-amd64), const IFT_TELINK = 200 +pkg syscall (netbsd-amd64), const IFT_TERMPAD = 91 +pkg syscall (netbsd-amd64), const IFT_TR008 = 176 +pkg syscall (netbsd-amd64), const IFT_TRANSPHDLC = 123 +pkg syscall (netbsd-amd64), const IFT_TUNNEL = 131 +pkg syscall (netbsd-amd64), const IFT_ULTRA = 29 +pkg syscall (netbsd-amd64), const IFT_USB = 160 +pkg syscall (netbsd-amd64), const IFT_V11 = 64 +pkg syscall (netbsd-amd64), const IFT_V35 = 45 +pkg syscall (netbsd-amd64), const IFT_V36 = 65 +pkg syscall (netbsd-amd64), const IFT_V37 = 120 +pkg syscall (netbsd-amd64), const IFT_VDSL = 97 +pkg syscall (netbsd-amd64), const IFT_VIRTUALIPADDRESS = 112 +pkg syscall (netbsd-amd64), const IFT_VIRTUALTG = 202 +pkg syscall (netbsd-amd64), const IFT_VOICEDID = 213 +pkg syscall (netbsd-amd64), const IFT_VOICEEM = 100 +pkg syscall (netbsd-amd64), const IFT_VOICEEMFGD = 211 +pkg syscall (netbsd-amd64), const IFT_VOICEENCAP = 103 +pkg syscall (netbsd-amd64), const IFT_VOICEFGDEANA = 212 +pkg syscall (netbsd-amd64), const IFT_VOICEFXO = 101 +pkg syscall (netbsd-amd64), const IFT_VOICEFXS = 102 +pkg syscall (netbsd-amd64), const IFT_VOICEOVERATM = 152 +pkg syscall (netbsd-amd64), const IFT_VOICEOVERCABLE = 198 +pkg syscall (netbsd-amd64), const IFT_VOICEOVERFRAMERELAY = 153 +pkg syscall (netbsd-amd64), const IFT_VOICEOVERIP = 104 +pkg syscall (netbsd-amd64), const IFT_X213 = 93 +pkg syscall (netbsd-amd64), const IFT_X25 = 5 +pkg syscall (netbsd-amd64), const IFT_X25DDN = 4 +pkg syscall (netbsd-amd64), const IFT_X25HUNTGROUP = 122 +pkg syscall (netbsd-amd64), const IFT_X25MLP = 121 +pkg syscall (netbsd-amd64), const IFT_X25PLE = 40 +pkg syscall (netbsd-amd64), const IFT_XETHER = 26 +pkg syscall (netbsd-amd64), const IGNBRK = 1 +pkg syscall (netbsd-amd64), const IGNCR = 128 +pkg syscall (netbsd-amd64), const IGNPAR = 4 +pkg syscall (netbsd-amd64), const IMAXBEL = 8192 +pkg syscall (netbsd-amd64), const INLCR = 64 +pkg syscall (netbsd-amd64), const INPCK = 16 +pkg syscall (netbsd-amd64), const IN_CLASSA_HOST = 16777215 +pkg syscall (netbsd-amd64), const IN_CLASSA_MAX = 128 +pkg syscall (netbsd-amd64), const IN_CLASSA_NET = 4278190080 +pkg syscall (netbsd-amd64), const IN_CLASSA_NSHIFT = 24 +pkg syscall (netbsd-amd64), const IN_CLASSB_HOST = 65535 +pkg syscall (netbsd-amd64), const IN_CLASSB_MAX = 65536 +pkg syscall (netbsd-amd64), const IN_CLASSB_NET = 4294901760 +pkg syscall (netbsd-amd64), const IN_CLASSB_NSHIFT = 16 +pkg syscall (netbsd-amd64), const IN_CLASSC_HOST = 255 +pkg syscall (netbsd-amd64), const IN_CLASSC_NET = 4294967040 +pkg syscall (netbsd-amd64), const IN_CLASSC_NSHIFT = 8 +pkg syscall (netbsd-amd64), const IN_CLASSD_HOST = 268435455 +pkg syscall (netbsd-amd64), const IN_CLASSD_NET = 4026531840 +pkg syscall (netbsd-amd64), const IN_CLASSD_NSHIFT = 28 +pkg syscall (netbsd-amd64), const IN_LOOPBACKNET = 127 +pkg syscall (netbsd-amd64), const IPPROTO_AH = 51 +pkg syscall (netbsd-amd64), const IPPROTO_CARP = 112 +pkg syscall (netbsd-amd64), const IPPROTO_DONE = 257 +pkg syscall (netbsd-amd64), const IPPROTO_DSTOPTS = 60 +pkg syscall (netbsd-amd64), const IPPROTO_EGP = 8 +pkg syscall (netbsd-amd64), const IPPROTO_ENCAP = 98 +pkg syscall (netbsd-amd64), const IPPROTO_EON = 80 +pkg syscall (netbsd-amd64), const IPPROTO_ESP = 50 +pkg syscall (netbsd-amd64), const IPPROTO_ETHERIP = 97 +pkg syscall (netbsd-amd64), const IPPROTO_FRAGMENT = 44 +pkg syscall (netbsd-amd64), const IPPROTO_GGP = 3 +pkg syscall (netbsd-amd64), const IPPROTO_GRE = 47 +pkg syscall (netbsd-amd64), const IPPROTO_HOPOPTS = 0 +pkg syscall (netbsd-amd64), const IPPROTO_ICMP = 1 +pkg syscall (netbsd-amd64), const IPPROTO_ICMPV6 = 58 +pkg syscall (netbsd-amd64), const IPPROTO_IDP = 22 +pkg syscall (netbsd-amd64), const IPPROTO_IGMP = 2 +pkg syscall (netbsd-amd64), const IPPROTO_IPCOMP = 108 +pkg syscall (netbsd-amd64), const IPPROTO_IPIP = 4 +pkg syscall (netbsd-amd64), const IPPROTO_IPV4 = 4 +pkg syscall (netbsd-amd64), const IPPROTO_IPV6_ICMP = 58 +pkg syscall (netbsd-amd64), const IPPROTO_MAX = 256 +pkg syscall (netbsd-amd64), const IPPROTO_MAXID = 52 +pkg syscall (netbsd-amd64), const IPPROTO_MOBILE = 55 +pkg syscall (netbsd-amd64), const IPPROTO_NONE = 59 +pkg syscall (netbsd-amd64), const IPPROTO_PFSYNC = 240 +pkg syscall (netbsd-amd64), const IPPROTO_PIM = 103 +pkg syscall (netbsd-amd64), const IPPROTO_PUP = 12 +pkg syscall (netbsd-amd64), const IPPROTO_RAW = 255 +pkg syscall (netbsd-amd64), const IPPROTO_ROUTING = 43 +pkg syscall (netbsd-amd64), const IPPROTO_RSVP = 46 +pkg syscall (netbsd-amd64), const IPPROTO_TP = 29 +pkg syscall (netbsd-amd64), const IPPROTO_VRRP = 112 +pkg syscall (netbsd-amd64), const IPV6_CHECKSUM = 26 +pkg syscall (netbsd-amd64), const IPV6_DEFAULT_MULTICAST_HOPS = 1 +pkg syscall (netbsd-amd64), const IPV6_DEFAULT_MULTICAST_LOOP = 1 +pkg syscall (netbsd-amd64), const IPV6_DEFHLIM = 64 +pkg syscall (netbsd-amd64), const IPV6_DONTFRAG = 62 +pkg syscall (netbsd-amd64), const IPV6_DSTOPTS = 50 +pkg syscall (netbsd-amd64), const IPV6_FAITH = 29 +pkg syscall (netbsd-amd64), const IPV6_FLOWINFO_MASK = 4294967055 +pkg syscall (netbsd-amd64), const IPV6_FLOWLABEL_MASK = 4294905600 +pkg syscall (netbsd-amd64), const IPV6_FRAGTTL = 120 +pkg syscall (netbsd-amd64), const IPV6_HLIMDEC = 1 +pkg syscall (netbsd-amd64), const IPV6_HOPLIMIT = 47 +pkg syscall (netbsd-amd64), const IPV6_HOPOPTS = 49 +pkg syscall (netbsd-amd64), const IPV6_IPSEC_POLICY = 28 +pkg syscall (netbsd-amd64), const IPV6_JOIN_GROUP = 12 +pkg syscall (netbsd-amd64), const IPV6_LEAVE_GROUP = 13 +pkg syscall (netbsd-amd64), const IPV6_MAXHLIM = 255 +pkg syscall (netbsd-amd64), const IPV6_MAXPACKET = 65535 +pkg syscall (netbsd-amd64), const IPV6_MMTU = 1280 +pkg syscall (netbsd-amd64), const IPV6_MULTICAST_HOPS = 10 +pkg syscall (netbsd-amd64), const IPV6_MULTICAST_IF = 9 +pkg syscall (netbsd-amd64), const IPV6_MULTICAST_LOOP = 11 +pkg syscall (netbsd-amd64), const IPV6_NEXTHOP = 48 +pkg syscall (netbsd-amd64), const IPV6_PATHMTU = 44 +pkg syscall (netbsd-amd64), const IPV6_PKTINFO = 46 +pkg syscall (netbsd-amd64), const IPV6_PORTRANGE = 14 +pkg syscall (netbsd-amd64), const IPV6_PORTRANGE_DEFAULT = 0 +pkg syscall (netbsd-amd64), const IPV6_PORTRANGE_HIGH = 1 +pkg syscall (netbsd-amd64), const IPV6_PORTRANGE_LOW = 2 +pkg syscall (netbsd-amd64), const IPV6_RECVDSTOPTS = 40 +pkg syscall (netbsd-amd64), const IPV6_RECVHOPLIMIT = 37 +pkg syscall (netbsd-amd64), const IPV6_RECVHOPOPTS = 39 +pkg syscall (netbsd-amd64), const IPV6_RECVPATHMTU = 43 +pkg syscall (netbsd-amd64), const IPV6_RECVPKTINFO = 36 +pkg syscall (netbsd-amd64), const IPV6_RECVRTHDR = 38 +pkg syscall (netbsd-amd64), const IPV6_RECVTCLASS = 57 +pkg syscall (netbsd-amd64), const IPV6_RTHDR = 51 +pkg syscall (netbsd-amd64), const IPV6_RTHDRDSTOPTS = 35 +pkg syscall (netbsd-amd64), const IPV6_RTHDR_LOOSE = 0 +pkg syscall (netbsd-amd64), const IPV6_RTHDR_STRICT = 1 +pkg syscall (netbsd-amd64), const IPV6_RTHDR_TYPE_0 = 0 +pkg syscall (netbsd-amd64), const IPV6_SOCKOPT_RESERVED1 = 3 +pkg syscall (netbsd-amd64), const IPV6_TCLASS = 61 +pkg syscall (netbsd-amd64), const IPV6_UNICAST_HOPS = 4 +pkg syscall (netbsd-amd64), const IPV6_USE_MIN_MTU = 42 +pkg syscall (netbsd-amd64), const IPV6_V6ONLY = 27 +pkg syscall (netbsd-amd64), const IPV6_VERSION = 96 +pkg syscall (netbsd-amd64), const IPV6_VERSION_MASK = 240 +pkg syscall (netbsd-amd64), const IP_ADD_MEMBERSHIP = 12 +pkg syscall (netbsd-amd64), const IP_DEFAULT_MULTICAST_LOOP = 1 +pkg syscall (netbsd-amd64), const IP_DEFAULT_MULTICAST_TTL = 1 +pkg syscall (netbsd-amd64), const IP_DF = 16384 +pkg syscall (netbsd-amd64), const IP_DROP_MEMBERSHIP = 13 +pkg syscall (netbsd-amd64), const IP_EF = 32768 +pkg syscall (netbsd-amd64), const IP_ERRORMTU = 21 +pkg syscall (netbsd-amd64), const IP_HDRINCL = 2 +pkg syscall (netbsd-amd64), const IP_IPSEC_POLICY = 22 +pkg syscall (netbsd-amd64), const IP_MAXPACKET = 65535 +pkg syscall (netbsd-amd64), const IP_MAX_MEMBERSHIPS = 20 +pkg syscall (netbsd-amd64), const IP_MF = 8192 +pkg syscall (netbsd-amd64), const IP_MINFRAGSIZE = 69 +pkg syscall (netbsd-amd64), const IP_MINTTL = 24 +pkg syscall (netbsd-amd64), const IP_MSS = 576 +pkg syscall (netbsd-amd64), const IP_MULTICAST_IF = 9 +pkg syscall (netbsd-amd64), const IP_MULTICAST_LOOP = 11 +pkg syscall (netbsd-amd64), const IP_MULTICAST_TTL = 10 +pkg syscall (netbsd-amd64), const IP_OFFMASK = 8191 +pkg syscall (netbsd-amd64), const IP_OPTIONS = 1 +pkg syscall (netbsd-amd64), const IP_PORTRANGE = 19 +pkg syscall (netbsd-amd64), const IP_PORTRANGE_DEFAULT = 0 +pkg syscall (netbsd-amd64), const IP_PORTRANGE_HIGH = 1 +pkg syscall (netbsd-amd64), const IP_PORTRANGE_LOW = 2 +pkg syscall (netbsd-amd64), const IP_RECVDSTADDR = 7 +pkg syscall (netbsd-amd64), const IP_RECVIF = 20 +pkg syscall (netbsd-amd64), const IP_RECVOPTS = 5 +pkg syscall (netbsd-amd64), const IP_RECVRETOPTS = 6 +pkg syscall (netbsd-amd64), const IP_RECVTTL = 23 +pkg syscall (netbsd-amd64), const IP_RETOPTS = 8 +pkg syscall (netbsd-amd64), const IP_RF = 32768 +pkg syscall (netbsd-amd64), const IP_TOS = 3 +pkg syscall (netbsd-amd64), const IP_TTL = 4 +pkg syscall (netbsd-amd64), const ISIG = 128 +pkg syscall (netbsd-amd64), const ISTRIP = 32 +pkg syscall (netbsd-amd64), const IXANY = 2048 +pkg syscall (netbsd-amd64), const IXOFF = 1024 +pkg syscall (netbsd-amd64), const IXON = 512 +pkg syscall (netbsd-amd64), const ImplementsGetwd = false +pkg syscall (netbsd-amd64), const LOCK_EX = 2 +pkg syscall (netbsd-amd64), const LOCK_NB = 4 +pkg syscall (netbsd-amd64), const LOCK_SH = 1 +pkg syscall (netbsd-amd64), const LOCK_UN = 8 +pkg syscall (netbsd-amd64), const MSG_BCAST = 256 +pkg syscall (netbsd-amd64), const MSG_CMSG_CLOEXEC = 2048 +pkg syscall (netbsd-amd64), const MSG_CONTROLMBUF = 33554432 +pkg syscall (netbsd-amd64), const MSG_CTRUNC = 32 +pkg syscall (netbsd-amd64), const MSG_DONTROUTE = 4 +pkg syscall (netbsd-amd64), const MSG_DONTWAIT = 128 +pkg syscall (netbsd-amd64), const MSG_EOR = 8 +pkg syscall (netbsd-amd64), const MSG_IOVUSRSPACE = 67108864 +pkg syscall (netbsd-amd64), const MSG_LENUSRSPACE = 134217728 +pkg syscall (netbsd-amd64), const MSG_MCAST = 512 +pkg syscall (netbsd-amd64), const MSG_NAMEMBUF = 16777216 +pkg syscall (netbsd-amd64), const MSG_NBIO = 4096 +pkg syscall (netbsd-amd64), const MSG_NOSIGNAL = 1024 +pkg syscall (netbsd-amd64), const MSG_OOB = 1 +pkg syscall (netbsd-amd64), const MSG_PEEK = 2 +pkg syscall (netbsd-amd64), const MSG_TRUNC = 16 +pkg syscall (netbsd-amd64), const MSG_USERFLAGS = 16777215 +pkg syscall (netbsd-amd64), const MSG_WAITALL = 64 +pkg syscall (netbsd-amd64), const NAME_MAX = 511 +pkg syscall (netbsd-amd64), const NET_RT_DUMP = 1 +pkg syscall (netbsd-amd64), const NET_RT_FLAGS = 2 +pkg syscall (netbsd-amd64), const NET_RT_IFLIST = 5 +pkg syscall (netbsd-amd64), const NET_RT_MAXID = 6 +pkg syscall (netbsd-amd64), const NET_RT_OIFLIST = 4 +pkg syscall (netbsd-amd64), const NET_RT_OOIFLIST = 3 +pkg syscall (netbsd-amd64), const NOFLSH = 2147483648 +pkg syscall (netbsd-amd64), const NOTE_ATTRIB = 8 +pkg syscall (netbsd-amd64), const NOTE_CHILD = 4 +pkg syscall (netbsd-amd64), const NOTE_DELETE = 1 +pkg syscall (netbsd-amd64), const NOTE_EXEC = 536870912 +pkg syscall (netbsd-amd64), const NOTE_EXIT = 2147483648 +pkg syscall (netbsd-amd64), const NOTE_EXTEND = 4 +pkg syscall (netbsd-amd64), const NOTE_FORK = 1073741824 +pkg syscall (netbsd-amd64), const NOTE_LINK = 16 +pkg syscall (netbsd-amd64), const NOTE_LOWAT = 1 +pkg syscall (netbsd-amd64), const NOTE_PCTRLMASK = 4026531840 +pkg syscall (netbsd-amd64), const NOTE_PDATAMASK = 1048575 +pkg syscall (netbsd-amd64), const NOTE_RENAME = 32 +pkg syscall (netbsd-amd64), const NOTE_REVOKE = 64 +pkg syscall (netbsd-amd64), const NOTE_TRACK = 1 +pkg syscall (netbsd-amd64), const NOTE_TRACKERR = 2 +pkg syscall (netbsd-amd64), const NOTE_WRITE = 2 +pkg syscall (netbsd-amd64), const OCRNL = 16 +pkg syscall (netbsd-amd64), const OFIOGETBMAP = 3221513850 +pkg syscall (netbsd-amd64), const ONLCR = 2 +pkg syscall (netbsd-amd64), const ONLRET = 64 +pkg syscall (netbsd-amd64), const ONOCR = 32 +pkg syscall (netbsd-amd64), const ONOEOT = 8 +pkg syscall (netbsd-amd64), const OPOST = 1 +pkg syscall (netbsd-amd64), const O_ACCMODE = 3 +pkg syscall (netbsd-amd64), const O_ALT_IO = 262144 +pkg syscall (netbsd-amd64), const O_APPEND = 8 +pkg syscall (netbsd-amd64), const O_ASYNC = 64 +pkg syscall (netbsd-amd64), const O_CLOEXEC = 4194304 +pkg syscall (netbsd-amd64), const O_CREAT = 512 +pkg syscall (netbsd-amd64), const O_DIRECT = 524288 +pkg syscall (netbsd-amd64), const O_DIRECTORY = 2097152 +pkg syscall (netbsd-amd64), const O_DSYNC = 65536 +pkg syscall (netbsd-amd64), const O_EXCL = 2048 +pkg syscall (netbsd-amd64), const O_EXLOCK = 32 +pkg syscall (netbsd-amd64), const O_FSYNC = 128 +pkg syscall (netbsd-amd64), const O_NDELAY = 4 +pkg syscall (netbsd-amd64), const O_NOCTTY = 32768 +pkg syscall (netbsd-amd64), const O_NOFOLLOW = 256 +pkg syscall (netbsd-amd64), const O_NONBLOCK = 4 +pkg syscall (netbsd-amd64), const O_NOSIGPIPE = 16777216 +pkg syscall (netbsd-amd64), const O_RSYNC = 131072 +pkg syscall (netbsd-amd64), const O_SHLOCK = 16 +pkg syscall (netbsd-amd64), const O_SYNC = 128 +pkg syscall (netbsd-amd64), const O_TRUNC = 1024 +pkg syscall (netbsd-amd64), const PARENB = 4096 +pkg syscall (netbsd-amd64), const PARMRK = 8 +pkg syscall (netbsd-amd64), const PARODD = 8192 +pkg syscall (netbsd-amd64), const PENDIN = 536870912 +pkg syscall (netbsd-amd64), const PRI_IOFLUSH = 124 +pkg syscall (netbsd-amd64), const PTRACE_CONT = 7 +pkg syscall (netbsd-amd64), const PTRACE_KILL = 8 +pkg syscall (netbsd-amd64), const PTRACE_TRACEME = 0 +pkg syscall (netbsd-amd64), const RLIMIT_AS = 10 +pkg syscall (netbsd-amd64), const RLIMIT_CORE = 4 +pkg syscall (netbsd-amd64), const RLIMIT_CPU = 0 +pkg syscall (netbsd-amd64), const RLIMIT_DATA = 2 +pkg syscall (netbsd-amd64), const RLIMIT_FSIZE = 1 +pkg syscall (netbsd-amd64), const RLIMIT_NOFILE = 8 +pkg syscall (netbsd-amd64), const RLIMIT_STACK = 3 +pkg syscall (netbsd-amd64), const RLIM_INFINITY = 9223372036854775807 +pkg syscall (netbsd-amd64), const RTAX_AUTHOR = 6 +pkg syscall (netbsd-amd64), const RTAX_BRD = 7 +pkg syscall (netbsd-amd64), const RTAX_DST = 0 +pkg syscall (netbsd-amd64), const RTAX_GATEWAY = 1 +pkg syscall (netbsd-amd64), const RTAX_GENMASK = 3 +pkg syscall (netbsd-amd64), const RTAX_IFA = 5 +pkg syscall (netbsd-amd64), const RTAX_IFP = 4 +pkg syscall (netbsd-amd64), const RTAX_MAX = 9 +pkg syscall (netbsd-amd64), const RTAX_NETMASK = 2 +pkg syscall (netbsd-amd64), const RTAX_TAG = 8 +pkg syscall (netbsd-amd64), const RTA_AUTHOR = 64 +pkg syscall (netbsd-amd64), const RTA_BRD = 128 +pkg syscall (netbsd-amd64), const RTA_DST = 1 +pkg syscall (netbsd-amd64), const RTA_GATEWAY = 2 +pkg syscall (netbsd-amd64), const RTA_GENMASK = 8 +pkg syscall (netbsd-amd64), const RTA_IFA = 32 +pkg syscall (netbsd-amd64), const RTA_IFP = 16 +pkg syscall (netbsd-amd64), const RTA_NETMASK = 4 +pkg syscall (netbsd-amd64), const RTA_TAG = 256 +pkg syscall (netbsd-amd64), const RTF_ANNOUNCE = 131072 +pkg syscall (netbsd-amd64), const RTF_BLACKHOLE = 4096 +pkg syscall (netbsd-amd64), const RTF_CLONED = 8192 +pkg syscall (netbsd-amd64), const RTF_CLONING = 256 +pkg syscall (netbsd-amd64), const RTF_DONE = 64 +pkg syscall (netbsd-amd64), const RTF_DYNAMIC = 16 +pkg syscall (netbsd-amd64), const RTF_GATEWAY = 2 +pkg syscall (netbsd-amd64), const RTF_HOST = 4 +pkg syscall (netbsd-amd64), const RTF_LLINFO = 1024 +pkg syscall (netbsd-amd64), const RTF_MASK = 128 +pkg syscall (netbsd-amd64), const RTF_MODIFIED = 32 +pkg syscall (netbsd-amd64), const RTF_PROTO1 = 32768 +pkg syscall (netbsd-amd64), const RTF_PROTO2 = 16384 +pkg syscall (netbsd-amd64), const RTF_REJECT = 8 +pkg syscall (netbsd-amd64), const RTF_SRC = 65536 +pkg syscall (netbsd-amd64), const RTF_STATIC = 2048 +pkg syscall (netbsd-amd64), const RTF_UP = 1 +pkg syscall (netbsd-amd64), const RTF_XRESOLVE = 512 +pkg syscall (netbsd-amd64), const RTM_ADD = 1 +pkg syscall (netbsd-amd64), const RTM_CHANGE = 3 +pkg syscall (netbsd-amd64), const RTM_CHGADDR = 21 +pkg syscall (netbsd-amd64), const RTM_DELADDR = 13 +pkg syscall (netbsd-amd64), const RTM_DELETE = 2 +pkg syscall (netbsd-amd64), const RTM_GET = 4 +pkg syscall (netbsd-amd64), const RTM_IEEE80211 = 17 +pkg syscall (netbsd-amd64), const RTM_IFANNOUNCE = 16 +pkg syscall (netbsd-amd64), const RTM_IFINFO = 20 +pkg syscall (netbsd-amd64), const RTM_LLINFO_UPD = 19 +pkg syscall (netbsd-amd64), const RTM_LOCK = 8 +pkg syscall (netbsd-amd64), const RTM_LOSING = 5 +pkg syscall (netbsd-amd64), const RTM_MISS = 7 +pkg syscall (netbsd-amd64), const RTM_NEWADDR = 12 +pkg syscall (netbsd-amd64), const RTM_OIFINFO = 15 +pkg syscall (netbsd-amd64), const RTM_OLDADD = 9 +pkg syscall (netbsd-amd64), const RTM_OLDDEL = 10 +pkg syscall (netbsd-amd64), const RTM_OOIFINFO = 14 +pkg syscall (netbsd-amd64), const RTM_REDIRECT = 6 +pkg syscall (netbsd-amd64), const RTM_RESOLVE = 11 +pkg syscall (netbsd-amd64), const RTM_RTTUNIT = 1000000 +pkg syscall (netbsd-amd64), const RTM_SETGATE = 18 +pkg syscall (netbsd-amd64), const RTM_VERSION = 4 +pkg syscall (netbsd-amd64), const RTV_EXPIRE = 4 +pkg syscall (netbsd-amd64), const RTV_HOPCOUNT = 2 +pkg syscall (netbsd-amd64), const RTV_MTU = 1 +pkg syscall (netbsd-amd64), const RTV_RPIPE = 8 +pkg syscall (netbsd-amd64), const RTV_RTT = 64 +pkg syscall (netbsd-amd64), const RTV_RTTVAR = 128 +pkg syscall (netbsd-amd64), const RTV_SPIPE = 16 +pkg syscall (netbsd-amd64), const RTV_SSTHRESH = 32 +pkg syscall (netbsd-amd64), const RUSAGE_CHILDREN = -1 +pkg syscall (netbsd-amd64), const RUSAGE_SELF = 0 +pkg syscall (netbsd-amd64), const SCM_CREDS = 4 +pkg syscall (netbsd-amd64), const SCM_RIGHTS = 1 +pkg syscall (netbsd-amd64), const SCM_TIMESTAMP = 8 +pkg syscall (netbsd-amd64), const SIGBUS = 10 +pkg syscall (netbsd-amd64), const SIGCHLD = 20 +pkg syscall (netbsd-amd64), const SIGCONT = 19 +pkg syscall (netbsd-amd64), const SIGEMT = 7 +pkg syscall (netbsd-amd64), const SIGINFO = 29 +pkg syscall (netbsd-amd64), const SIGIO = 23 +pkg syscall (netbsd-amd64), const SIGIOT = 6 +pkg syscall (netbsd-amd64), const SIGPROF = 27 +pkg syscall (netbsd-amd64), const SIGPWR = 32 +pkg syscall (netbsd-amd64), const SIGSTOP = 17 +pkg syscall (netbsd-amd64), const SIGSYS = 12 +pkg syscall (netbsd-amd64), const SIGTSTP = 18 +pkg syscall (netbsd-amd64), const SIGTTIN = 21 +pkg syscall (netbsd-amd64), const SIGTTOU = 22 +pkg syscall (netbsd-amd64), const SIGURG = 16 +pkg syscall (netbsd-amd64), const SIGUSR1 = 30 +pkg syscall (netbsd-amd64), const SIGUSR2 = 31 +pkg syscall (netbsd-amd64), const SIGVTALRM = 26 +pkg syscall (netbsd-amd64), const SIGWINCH = 28 +pkg syscall (netbsd-amd64), const SIGXCPU = 24 +pkg syscall (netbsd-amd64), const SIGXFSZ = 25 +pkg syscall (netbsd-amd64), const SIOCADDMULTI = 2156947761 +pkg syscall (netbsd-amd64), const SIOCADDRT = 2151182858 +pkg syscall (netbsd-amd64), const SIOCAIFADDR = 2151704858 +pkg syscall (netbsd-amd64), const SIOCALIFADDR = 2165860636 +pkg syscall (netbsd-amd64), const SIOCATMARK = 1074033415 +pkg syscall (netbsd-amd64), const SIOCDELMULTI = 2156947762 +pkg syscall (netbsd-amd64), const SIOCDELRT = 2151182859 +pkg syscall (netbsd-amd64), const SIOCDIFADDR = 2156947737 +pkg syscall (netbsd-amd64), const SIOCDIFPHYADDR = 2156947785 +pkg syscall (netbsd-amd64), const SIOCDLIFADDR = 2165860638 +pkg syscall (netbsd-amd64), const SIOCGDRVSPEC = 3223873915 +pkg syscall (netbsd-amd64), const SIOCGETPFSYNC = 3230689784 +pkg syscall (netbsd-amd64), const SIOCGETSGCNT = 3223352628 +pkg syscall (netbsd-amd64), const SIOCGETVIFCNT = 3223876915 +pkg syscall (netbsd-amd64), const SIOCGHIWAT = 1074033409 +pkg syscall (netbsd-amd64), const SIOCGIFADDR = 3230689569 +pkg syscall (netbsd-amd64), const SIOCGIFADDRPREF = 3231213856 +pkg syscall (netbsd-amd64), const SIOCGIFALIAS = 3225446683 +pkg syscall (netbsd-amd64), const SIOCGIFBRDADDR = 3230689571 +pkg syscall (netbsd-amd64), const SIOCGIFCAP = 3223349622 +pkg syscall (netbsd-amd64), const SIOCGIFCONF = 3222300966 +pkg syscall (netbsd-amd64), const SIOCGIFDATA = 3231213957 +pkg syscall (netbsd-amd64), const SIOCGIFDLT = 3230689655 +pkg syscall (netbsd-amd64), const SIOCGIFDSTADDR = 3230689570 +pkg syscall (netbsd-amd64), const SIOCGIFFLAGS = 3230689553 +pkg syscall (netbsd-amd64), const SIOCGIFGENERIC = 3230689594 +pkg syscall (netbsd-amd64), const SIOCGIFMEDIA = 3224398134 +pkg syscall (netbsd-amd64), const SIOCGIFMETRIC = 3230689559 +pkg syscall (netbsd-amd64), const SIOCGIFMTU = 3230689662 +pkg syscall (netbsd-amd64), const SIOCGIFNETMASK = 3230689573 +pkg syscall (netbsd-amd64), const SIOCGIFPDSTADDR = 3230689608 +pkg syscall (netbsd-amd64), const SIOCGIFPSRCADDR = 3230689607 +pkg syscall (netbsd-amd64), const SIOCGLIFADDR = 3239602461 +pkg syscall (netbsd-amd64), const SIOCGLIFPHYADDR = 3239602507 +pkg syscall (netbsd-amd64), const SIOCGLINKSTR = 3223873927 +pkg syscall (netbsd-amd64), const SIOCGLOWAT = 1074033411 +pkg syscall (netbsd-amd64), const SIOCGPGRP = 1074033417 +pkg syscall (netbsd-amd64), const SIOCGVH = 3230689667 +pkg syscall (netbsd-amd64), const SIOCIFCREATE = 2156947834 +pkg syscall (netbsd-amd64), const SIOCIFDESTROY = 2156947833 +pkg syscall (netbsd-amd64), const SIOCIFGCLONERS = 3222301048 +pkg syscall (netbsd-amd64), const SIOCINITIFADDR = 3228592516 +pkg syscall (netbsd-amd64), const SIOCSDRVSPEC = 2150132091 +pkg syscall (netbsd-amd64), const SIOCSETPFSYNC = 2156947959 +pkg syscall (netbsd-amd64), const SIOCSHIWAT = 2147775232 +pkg syscall (netbsd-amd64), const SIOCSIFADDR = 2156947724 +pkg syscall (netbsd-amd64), const SIOCSIFADDRPREF = 2157472031 +pkg syscall (netbsd-amd64), const SIOCSIFBRDADDR = 2156947731 +pkg syscall (netbsd-amd64), const SIOCSIFCAP = 2149607797 +pkg syscall (netbsd-amd64), const SIOCSIFDSTADDR = 2156947726 +pkg syscall (netbsd-amd64), const SIOCSIFFLAGS = 2156947728 +pkg syscall (netbsd-amd64), const SIOCSIFGENERIC = 2156947769 +pkg syscall (netbsd-amd64), const SIOCSIFMEDIA = 3230689589 +pkg syscall (netbsd-amd64), const SIOCSIFMETRIC = 2156947736 +pkg syscall (netbsd-amd64), const SIOCSIFMTU = 2156947839 +pkg syscall (netbsd-amd64), const SIOCSIFNETMASK = 2156947734 +pkg syscall (netbsd-amd64), const SIOCSIFPHYADDR = 2151704902 +pkg syscall (netbsd-amd64), const SIOCSLIFPHYADDR = 2165860682 +pkg syscall (netbsd-amd64), const SIOCSLINKSTR = 2150132104 +pkg syscall (netbsd-amd64), const SIOCSLOWAT = 2147775234 +pkg syscall (netbsd-amd64), const SIOCSPGRP = 2147775240 +pkg syscall (netbsd-amd64), const SIOCSVH = 3230689666 +pkg syscall (netbsd-amd64), const SIOCZIFDATA = 3231213958 +pkg syscall (netbsd-amd64), const SOCK_CLOEXEC = 268435456 +pkg syscall (netbsd-amd64), const SOCK_FLAGS_MASK = 4026531840 +pkg syscall (netbsd-amd64), const SOCK_NONBLOCK = 536870912 +pkg syscall (netbsd-amd64), const SOCK_NOSIGPIPE = 1073741824 +pkg syscall (netbsd-amd64), const SOCK_RDM = 4 +pkg syscall (netbsd-amd64), const SOL_SOCKET = 65535 +pkg syscall (netbsd-amd64), const SOMAXCONN = 128 +pkg syscall (netbsd-amd64), const SO_ACCEPTCONN = 2 +pkg syscall (netbsd-amd64), const SO_ACCEPTFILTER = 4096 +pkg syscall (netbsd-amd64), const SO_BROADCAST = 32 +pkg syscall (netbsd-amd64), const SO_DEBUG = 1 +pkg syscall (netbsd-amd64), const SO_DONTROUTE = 16 +pkg syscall (netbsd-amd64), const SO_ERROR = 4103 +pkg syscall (netbsd-amd64), const SO_KEEPALIVE = 8 +pkg syscall (netbsd-amd64), const SO_LINGER = 128 +pkg syscall (netbsd-amd64), const SO_NOHEADER = 4106 +pkg syscall (netbsd-amd64), const SO_NOSIGPIPE = 2048 +pkg syscall (netbsd-amd64), const SO_OOBINLINE = 256 +pkg syscall (netbsd-amd64), const SO_OVERFLOWED = 4105 +pkg syscall (netbsd-amd64), const SO_RCVBUF = 4098 +pkg syscall (netbsd-amd64), const SO_RCVLOWAT = 4100 +pkg syscall (netbsd-amd64), const SO_RCVTIMEO = 4108 +pkg syscall (netbsd-amd64), const SO_REUSEADDR = 4 +pkg syscall (netbsd-amd64), const SO_REUSEPORT = 512 +pkg syscall (netbsd-amd64), const SO_SNDBUF = 4097 +pkg syscall (netbsd-amd64), const SO_SNDLOWAT = 4099 +pkg syscall (netbsd-amd64), const SO_SNDTIMEO = 4107 +pkg syscall (netbsd-amd64), const SO_TIMESTAMP = 8192 +pkg syscall (netbsd-amd64), const SO_TYPE = 4104 +pkg syscall (netbsd-amd64), const SO_USELOOPBACK = 64 +pkg syscall (netbsd-amd64), const SYSCTL_VERSION = 16777216 +pkg syscall (netbsd-amd64), const SYSCTL_VERS_0 = 0 +pkg syscall (netbsd-amd64), const SYSCTL_VERS_1 = 16777216 +pkg syscall (netbsd-amd64), const SYSCTL_VERS_MASK = 4278190080 +pkg syscall (netbsd-amd64), const SYS_ACCEPT = 30 +pkg syscall (netbsd-amd64), const SYS_ACCESS = 33 +pkg syscall (netbsd-amd64), const SYS_ACCT = 51 +pkg syscall (netbsd-amd64), const SYS_ADJTIME = 421 +pkg syscall (netbsd-amd64), const SYS_BIND = 104 +pkg syscall (netbsd-amd64), const SYS_BREAK = 17 +pkg syscall (netbsd-amd64), const SYS_CHDIR = 12 +pkg syscall (netbsd-amd64), const SYS_CHFLAGS = 34 +pkg syscall (netbsd-amd64), const SYS_CHMOD = 15 +pkg syscall (netbsd-amd64), const SYS_CHOWN = 16 +pkg syscall (netbsd-amd64), const SYS_CHROOT = 61 +pkg syscall (netbsd-amd64), const SYS_CLOCK_GETRES = 429 +pkg syscall (netbsd-amd64), const SYS_CLOCK_GETTIME = 427 +pkg syscall (netbsd-amd64), const SYS_CLOCK_SETTIME = 428 +pkg syscall (netbsd-amd64), const SYS_CLOSE = 6 +pkg syscall (netbsd-amd64), const SYS_CONNECT = 98 +pkg syscall (netbsd-amd64), const SYS_DUP = 41 +pkg syscall (netbsd-amd64), const SYS_DUP2 = 90 +pkg syscall (netbsd-amd64), const SYS_DUP3 = 454 +pkg syscall (netbsd-amd64), const SYS_EXECVE = 59 +pkg syscall (netbsd-amd64), const SYS_EXIT = 1 +pkg syscall (netbsd-amd64), const SYS_EXTATTRCTL = 360 +pkg syscall (netbsd-amd64), const SYS_EXTATTR_DELETE_FD = 366 +pkg syscall (netbsd-amd64), const SYS_EXTATTR_DELETE_FILE = 363 +pkg syscall (netbsd-amd64), const SYS_EXTATTR_DELETE_LINK = 369 +pkg syscall (netbsd-amd64), const SYS_EXTATTR_GET_FD = 365 +pkg syscall (netbsd-amd64), const SYS_EXTATTR_GET_FILE = 362 +pkg syscall (netbsd-amd64), const SYS_EXTATTR_GET_LINK = 368 +pkg syscall (netbsd-amd64), const SYS_EXTATTR_LIST_FD = 370 +pkg syscall (netbsd-amd64), const SYS_EXTATTR_LIST_FILE = 371 +pkg syscall (netbsd-amd64), const SYS_EXTATTR_LIST_LINK = 372 +pkg syscall (netbsd-amd64), const SYS_EXTATTR_SET_FD = 364 +pkg syscall (netbsd-amd64), const SYS_EXTATTR_SET_FILE = 361 +pkg syscall (netbsd-amd64), const SYS_EXTATTR_SET_LINK = 367 +pkg syscall (netbsd-amd64), const SYS_FACCESSAT = 462 +pkg syscall (netbsd-amd64), const SYS_FCHDIR = 13 +pkg syscall (netbsd-amd64), const SYS_FCHFLAGS = 35 +pkg syscall (netbsd-amd64), const SYS_FCHMOD = 124 +pkg syscall (netbsd-amd64), const SYS_FCHMODAT = 463 +pkg syscall (netbsd-amd64), const SYS_FCHOWN = 123 +pkg syscall (netbsd-amd64), const SYS_FCHOWNAT = 464 +pkg syscall (netbsd-amd64), const SYS_FCHROOT = 297 +pkg syscall (netbsd-amd64), const SYS_FCNTL = 92 +pkg syscall (netbsd-amd64), const SYS_FDATASYNC = 241 +pkg syscall (netbsd-amd64), const SYS_FEXECVE = 465 +pkg syscall (netbsd-amd64), const SYS_FGETXATTR = 380 +pkg syscall (netbsd-amd64), const SYS_FHSTAT = 451 +pkg syscall (netbsd-amd64), const SYS_FKTRACE = 288 +pkg syscall (netbsd-amd64), const SYS_FLISTXATTR = 383 +pkg syscall (netbsd-amd64), const SYS_FLOCK = 131 +pkg syscall (netbsd-amd64), const SYS_FORK = 2 +pkg syscall (netbsd-amd64), const SYS_FPATHCONF = 192 +pkg syscall (netbsd-amd64), const SYS_FREMOVEXATTR = 386 +pkg syscall (netbsd-amd64), const SYS_FSETXATTR = 377 +pkg syscall (netbsd-amd64), const SYS_FSTAT = 440 +pkg syscall (netbsd-amd64), const SYS_FSTATAT = 466 +pkg syscall (netbsd-amd64), const SYS_FSTATVFS1 = 358 +pkg syscall (netbsd-amd64), const SYS_FSYNC = 95 +pkg syscall (netbsd-amd64), const SYS_FSYNC_RANGE = 354 +pkg syscall (netbsd-amd64), const SYS_FTRUNCATE = 201 +pkg syscall (netbsd-amd64), const SYS_FUTIMENS = 472 +pkg syscall (netbsd-amd64), const SYS_FUTIMES = 423 +pkg syscall (netbsd-amd64), const SYS_GETCONTEXT = 307 +pkg syscall (netbsd-amd64), const SYS_GETDENTS = 390 +pkg syscall (netbsd-amd64), const SYS_GETEGID = 43 +pkg syscall (netbsd-amd64), const SYS_GETEUID = 25 +pkg syscall (netbsd-amd64), const SYS_GETFH = 395 +pkg syscall (netbsd-amd64), const SYS_GETGID = 47 +pkg syscall (netbsd-amd64), const SYS_GETGROUPS = 79 +pkg syscall (netbsd-amd64), const SYS_GETITIMER = 426 +pkg syscall (netbsd-amd64), const SYS_GETPEERNAME = 31 +pkg syscall (netbsd-amd64), const SYS_GETPGID = 207 +pkg syscall (netbsd-amd64), const SYS_GETPGRP = 81 +pkg syscall (netbsd-amd64), const SYS_GETPID = 20 +pkg syscall (netbsd-amd64), const SYS_GETPPID = 39 +pkg syscall (netbsd-amd64), const SYS_GETPRIORITY = 100 +pkg syscall (netbsd-amd64), const SYS_GETRLIMIT = 194 +pkg syscall (netbsd-amd64), const SYS_GETRUSAGE = 445 +pkg syscall (netbsd-amd64), const SYS_GETSID = 286 +pkg syscall (netbsd-amd64), const SYS_GETSOCKNAME = 32 +pkg syscall (netbsd-amd64), const SYS_GETSOCKOPT = 118 +pkg syscall (netbsd-amd64), const SYS_GETTIMEOFDAY = 418 +pkg syscall (netbsd-amd64), const SYS_GETUID = 24 +pkg syscall (netbsd-amd64), const SYS_GETVFSSTAT = 356 +pkg syscall (netbsd-amd64), const SYS_GETXATTR = 378 +pkg syscall (netbsd-amd64), const SYS_IOCTL = 54 +pkg syscall (netbsd-amd64), const SYS_ISSETUGID = 305 +pkg syscall (netbsd-amd64), const SYS_KEVENT = 435 +pkg syscall (netbsd-amd64), const SYS_KILL = 37 +pkg syscall (netbsd-amd64), const SYS_KQUEUE = 344 +pkg syscall (netbsd-amd64), const SYS_KQUEUE1 = 455 +pkg syscall (netbsd-amd64), const SYS_KTRACE = 45 +pkg syscall (netbsd-amd64), const SYS_LCHFLAGS = 304 +pkg syscall (netbsd-amd64), const SYS_LCHMOD = 274 +pkg syscall (netbsd-amd64), const SYS_LCHOWN = 275 +pkg syscall (netbsd-amd64), const SYS_LGETXATTR = 379 +pkg syscall (netbsd-amd64), const SYS_LINK = 9 +pkg syscall (netbsd-amd64), const SYS_LINKAT = 457 +pkg syscall (netbsd-amd64), const SYS_LISTEN = 106 +pkg syscall (netbsd-amd64), const SYS_LISTXATTR = 381 +pkg syscall (netbsd-amd64), const SYS_LLISTXATTR = 382 +pkg syscall (netbsd-amd64), const SYS_LREMOVEXATTR = 385 +pkg syscall (netbsd-amd64), const SYS_LSEEK = 199 +pkg syscall (netbsd-amd64), const SYS_LSETXATTR = 376 +pkg syscall (netbsd-amd64), const SYS_LSTAT = 441 +pkg syscall (netbsd-amd64), const SYS_LUTIMES = 424 +pkg syscall (netbsd-amd64), const SYS_MADVISE = 75 +pkg syscall (netbsd-amd64), const SYS_MINCORE = 78 +pkg syscall (netbsd-amd64), const SYS_MINHERIT = 273 +pkg syscall (netbsd-amd64), const SYS_MKDIR = 136 +pkg syscall (netbsd-amd64), const SYS_MKDIRAT = 461 +pkg syscall (netbsd-amd64), const SYS_MKFIFO = 132 +pkg syscall (netbsd-amd64), const SYS_MKFIFOAT = 459 +pkg syscall (netbsd-amd64), const SYS_MKNOD = 450 +pkg syscall (netbsd-amd64), const SYS_MKNODAT = 460 +pkg syscall (netbsd-amd64), const SYS_MLOCK = 203 +pkg syscall (netbsd-amd64), const SYS_MLOCKALL = 242 +pkg syscall (netbsd-amd64), const SYS_MMAP = 197 +pkg syscall (netbsd-amd64), const SYS_MODCTL = 246 +pkg syscall (netbsd-amd64), const SYS_MOUNT = 410 +pkg syscall (netbsd-amd64), const SYS_MPROTECT = 74 +pkg syscall (netbsd-amd64), const SYS_MREMAP = 411 +pkg syscall (netbsd-amd64), const SYS_MSGCTL = 444 +pkg syscall (netbsd-amd64), const SYS_MSGGET = 225 +pkg syscall (netbsd-amd64), const SYS_MSGRCV = 227 +pkg syscall (netbsd-amd64), const SYS_MSGSND = 226 +pkg syscall (netbsd-amd64), const SYS_MUNLOCK = 204 +pkg syscall (netbsd-amd64), const SYS_MUNLOCKALL = 243 +pkg syscall (netbsd-amd64), const SYS_MUNMAP = 73 +pkg syscall (netbsd-amd64), const SYS_NANOSLEEP = 430 +pkg syscall (netbsd-amd64), const SYS_NTP_ADJTIME = 176 +pkg syscall (netbsd-amd64), const SYS_NTP_GETTIME = 448 +pkg syscall (netbsd-amd64), const SYS_OPEN = 5 +pkg syscall (netbsd-amd64), const SYS_OPENAT = 468 +pkg syscall (netbsd-amd64), const SYS_PACCEPT = 456 +pkg syscall (netbsd-amd64), const SYS_PATHCONF = 191 +pkg syscall (netbsd-amd64), const SYS_PIPE = 42 +pkg syscall (netbsd-amd64), const SYS_PIPE2 = 453 +pkg syscall (netbsd-amd64), const SYS_PMC_CONTROL = 342 +pkg syscall (netbsd-amd64), const SYS_PMC_GET_INFO = 341 +pkg syscall (netbsd-amd64), const SYS_POLL = 209 +pkg syscall (netbsd-amd64), const SYS_POLLTS = 437 +pkg syscall (netbsd-amd64), const SYS_POSIX_FADVISE = 416 +pkg syscall (netbsd-amd64), const SYS_POSIX_SPAWN = 474 +pkg syscall (netbsd-amd64), const SYS_PREAD = 173 +pkg syscall (netbsd-amd64), const SYS_PREADV = 289 +pkg syscall (netbsd-amd64), const SYS_PROFIL = 44 +pkg syscall (netbsd-amd64), const SYS_PSELECT = 436 +pkg syscall (netbsd-amd64), const SYS_PSET_ASSIGN = 414 +pkg syscall (netbsd-amd64), const SYS_PSET_CREATE = 412 +pkg syscall (netbsd-amd64), const SYS_PSET_DESTROY = 413 +pkg syscall (netbsd-amd64), const SYS_PTRACE = 26 +pkg syscall (netbsd-amd64), const SYS_PWRITE = 174 +pkg syscall (netbsd-amd64), const SYS_PWRITEV = 290 +pkg syscall (netbsd-amd64), const SYS_RASCTL = 343 +pkg syscall (netbsd-amd64), const SYS_READ = 3 +pkg syscall (netbsd-amd64), const SYS_READLINK = 58 +pkg syscall (netbsd-amd64), const SYS_READLINKAT = 469 +pkg syscall (netbsd-amd64), const SYS_READV = 120 +pkg syscall (netbsd-amd64), const SYS_REBOOT = 208 +pkg syscall (netbsd-amd64), const SYS_RECVFROM = 29 +pkg syscall (netbsd-amd64), const SYS_RECVMMSG = 475 +pkg syscall (netbsd-amd64), const SYS_RECVMSG = 27 +pkg syscall (netbsd-amd64), const SYS_REMOVEXATTR = 384 +pkg syscall (netbsd-amd64), const SYS_RENAME = 128 +pkg syscall (netbsd-amd64), const SYS_RENAMEAT = 458 +pkg syscall (netbsd-amd64), const SYS_REVOKE = 56 +pkg syscall (netbsd-amd64), const SYS_RMDIR = 137 +pkg syscall (netbsd-amd64), const SYS_SBRK = 69 +pkg syscall (netbsd-amd64), const SYS_SCHED_YIELD = 350 +pkg syscall (netbsd-amd64), const SYS_SELECT = 417 +pkg syscall (netbsd-amd64), const SYS_SEMCONFIG = 223 +pkg syscall (netbsd-amd64), const SYS_SEMGET = 221 +pkg syscall (netbsd-amd64), const SYS_SEMOP = 222 +pkg syscall (netbsd-amd64), const SYS_SENDMMSG = 476 +pkg syscall (netbsd-amd64), const SYS_SENDMSG = 28 +pkg syscall (netbsd-amd64), const SYS_SENDTO = 133 +pkg syscall (netbsd-amd64), const SYS_SETCONTEXT = 308 +pkg syscall (netbsd-amd64), const SYS_SETEGID = 182 +pkg syscall (netbsd-amd64), const SYS_SETEUID = 183 +pkg syscall (netbsd-amd64), const SYS_SETGID = 181 +pkg syscall (netbsd-amd64), const SYS_SETGROUPS = 80 +pkg syscall (netbsd-amd64), const SYS_SETITIMER = 425 +pkg syscall (netbsd-amd64), const SYS_SETPGID = 82 +pkg syscall (netbsd-amd64), const SYS_SETPRIORITY = 96 +pkg syscall (netbsd-amd64), const SYS_SETREGID = 127 +pkg syscall (netbsd-amd64), const SYS_SETREUID = 126 +pkg syscall (netbsd-amd64), const SYS_SETRLIMIT = 195 +pkg syscall (netbsd-amd64), const SYS_SETSID = 147 +pkg syscall (netbsd-amd64), const SYS_SETSOCKOPT = 105 +pkg syscall (netbsd-amd64), const SYS_SETTIMEOFDAY = 419 +pkg syscall (netbsd-amd64), const SYS_SETUID = 23 +pkg syscall (netbsd-amd64), const SYS_SETXATTR = 375 +pkg syscall (netbsd-amd64), const SYS_SHMAT = 228 +pkg syscall (netbsd-amd64), const SYS_SHMCTL = 443 +pkg syscall (netbsd-amd64), const SYS_SHMDT = 230 +pkg syscall (netbsd-amd64), const SYS_SHMGET = 231 +pkg syscall (netbsd-amd64), const SYS_SHUTDOWN = 134 +pkg syscall (netbsd-amd64), const SYS_SIGQUEUEINFO = 245 +pkg syscall (netbsd-amd64), const SYS_SOCKET = 394 +pkg syscall (netbsd-amd64), const SYS_SOCKETPAIR = 135 +pkg syscall (netbsd-amd64), const SYS_SSTK = 70 +pkg syscall (netbsd-amd64), const SYS_STAT = 439 +pkg syscall (netbsd-amd64), const SYS_STATVFS1 = 357 +pkg syscall (netbsd-amd64), const SYS_SWAPCTL = 271 +pkg syscall (netbsd-amd64), const SYS_SYMLINK = 57 +pkg syscall (netbsd-amd64), const SYS_SYMLINKAT = 470 +pkg syscall (netbsd-amd64), const SYS_SYNC = 36 +pkg syscall (netbsd-amd64), const SYS_SYSARCH = 165 +pkg syscall (netbsd-amd64), const SYS_TIMER_CREATE = 235 +pkg syscall (netbsd-amd64), const SYS_TIMER_DELETE = 236 +pkg syscall (netbsd-amd64), const SYS_TIMER_GETOVERRUN = 239 +pkg syscall (netbsd-amd64), const SYS_TIMER_GETTIME = 447 +pkg syscall (netbsd-amd64), const SYS_TIMER_SETTIME = 446 +pkg syscall (netbsd-amd64), const SYS_TRUNCATE = 200 +pkg syscall (netbsd-amd64), const SYS_UMASK = 60 +pkg syscall (netbsd-amd64), const SYS_UNDELETE = 205 +pkg syscall (netbsd-amd64), const SYS_UNLINK = 10 +pkg syscall (netbsd-amd64), const SYS_UNLINKAT = 471 +pkg syscall (netbsd-amd64), const SYS_UNMOUNT = 22 +pkg syscall (netbsd-amd64), const SYS_UTIMENSAT = 467 +pkg syscall (netbsd-amd64), const SYS_UTIMES = 420 +pkg syscall (netbsd-amd64), const SYS_UTRACE = 306 +pkg syscall (netbsd-amd64), const SYS_UUIDGEN = 355 +pkg syscall (netbsd-amd64), const SYS_VADVISE = 72 +pkg syscall (netbsd-amd64), const SYS_VFORK = 66 +pkg syscall (netbsd-amd64), const SYS_WAIT4 = 449 +pkg syscall (netbsd-amd64), const SYS_WRITE = 4 +pkg syscall (netbsd-amd64), const SYS_WRITEV = 121 +pkg syscall (netbsd-amd64), const SYS__LWP_CONTINUE = 314 +pkg syscall (netbsd-amd64), const SYS__LWP_CREATE = 309 +pkg syscall (netbsd-amd64), const SYS__LWP_CTL = 325 +pkg syscall (netbsd-amd64), const SYS__LWP_DETACH = 319 +pkg syscall (netbsd-amd64), const SYS__LWP_EXIT = 310 +pkg syscall (netbsd-amd64), const SYS__LWP_GETNAME = 324 +pkg syscall (netbsd-amd64), const SYS__LWP_GETPRIVATE = 316 +pkg syscall (netbsd-amd64), const SYS__LWP_KILL = 318 +pkg syscall (netbsd-amd64), const SYS__LWP_PARK = 434 +pkg syscall (netbsd-amd64), const SYS__LWP_SELF = 311 +pkg syscall (netbsd-amd64), const SYS__LWP_SETNAME = 323 +pkg syscall (netbsd-amd64), const SYS__LWP_SETPRIVATE = 317 +pkg syscall (netbsd-amd64), const SYS__LWP_SUSPEND = 313 +pkg syscall (netbsd-amd64), const SYS__LWP_UNPARK = 321 +pkg syscall (netbsd-amd64), const SYS__LWP_UNPARK_ALL = 322 +pkg syscall (netbsd-amd64), const SYS__LWP_WAIT = 312 +pkg syscall (netbsd-amd64), const SYS__LWP_WAKEUP = 315 +pkg syscall (netbsd-amd64), const SYS__PSET_BIND = 415 +pkg syscall (netbsd-amd64), const SYS__SCHED_GETAFFINITY = 349 +pkg syscall (netbsd-amd64), const SYS__SCHED_GETPARAM = 347 +pkg syscall (netbsd-amd64), const SYS__SCHED_SETAFFINITY = 348 +pkg syscall (netbsd-amd64), const SYS__SCHED_SETPARAM = 346 +pkg syscall (netbsd-amd64), const SYS___CLONE = 287 +pkg syscall (netbsd-amd64), const SYS___GETCWD = 296 +pkg syscall (netbsd-amd64), const SYS___GETLOGIN = 49 +pkg syscall (netbsd-amd64), const SYS___POSIX_CHOWN = 283 +pkg syscall (netbsd-amd64), const SYS___POSIX_FCHOWN = 284 +pkg syscall (netbsd-amd64), const SYS___POSIX_LCHOWN = 285 +pkg syscall (netbsd-amd64), const SYS___POSIX_RENAME = 270 +pkg syscall (netbsd-amd64), const SYS___QUOTACTL = 473 +pkg syscall (netbsd-amd64), const SYS___SEMCTL = 442 +pkg syscall (netbsd-amd64), const SYS___SETLOGIN = 50 +pkg syscall (netbsd-amd64), const SYS___SIGACTION_SIGTRAMP = 340 +pkg syscall (netbsd-amd64), const SYS___SIGTIMEDWAIT = 431 +pkg syscall (netbsd-amd64), const SYS___SYSCTL = 202 +pkg syscall (netbsd-amd64), const S_ARCH1 = 65536 +pkg syscall (netbsd-amd64), const S_ARCH2 = 131072 +pkg syscall (netbsd-amd64), const S_BLKSIZE = 512 +pkg syscall (netbsd-amd64), const S_IEXEC = 64 +pkg syscall (netbsd-amd64), const S_IFMT = 61440 +pkg syscall (netbsd-amd64), const S_IFWHT = 57344 +pkg syscall (netbsd-amd64), const S_IREAD = 256 +pkg syscall (netbsd-amd64), const S_IRGRP = 32 +pkg syscall (netbsd-amd64), const S_IROTH = 4 +pkg syscall (netbsd-amd64), const S_IRWXG = 56 +pkg syscall (netbsd-amd64), const S_IRWXO = 7 +pkg syscall (netbsd-amd64), const S_IRWXU = 448 +pkg syscall (netbsd-amd64), const S_ISTXT = 512 +pkg syscall (netbsd-amd64), const S_IWGRP = 16 +pkg syscall (netbsd-amd64), const S_IWOTH = 2 +pkg syscall (netbsd-amd64), const S_IWRITE = 128 +pkg syscall (netbsd-amd64), const S_IXGRP = 8 +pkg syscall (netbsd-amd64), const S_IXOTH = 1 +pkg syscall (netbsd-amd64), const S_LOGIN_SET = 1 +pkg syscall (netbsd-amd64), const SizeofBpfHdr = 32 +pkg syscall (netbsd-amd64), const SizeofBpfInsn = 8 +pkg syscall (netbsd-amd64), const SizeofBpfProgram = 16 +pkg syscall (netbsd-amd64), const SizeofBpfStat = 128 +pkg syscall (netbsd-amd64), const SizeofBpfVersion = 4 +pkg syscall (netbsd-amd64), const SizeofCmsghdr = 12 +pkg syscall (netbsd-amd64), const SizeofIPMreq = 8 +pkg syscall (netbsd-amd64), const SizeofIPv6Mreq = 20 +pkg syscall (netbsd-amd64), const SizeofIfAnnounceMsghdr = 24 +pkg syscall (netbsd-amd64), const SizeofIfData = 136 +pkg syscall (netbsd-amd64), const SizeofIfMsghdr = 152 +pkg syscall (netbsd-amd64), const SizeofIfaMsghdr = 24 +pkg syscall (netbsd-amd64), const SizeofInet6Pktinfo = 20 +pkg syscall (netbsd-amd64), const SizeofLinger = 8 +pkg syscall (netbsd-amd64), const SizeofMsghdr = 48 +pkg syscall (netbsd-amd64), const SizeofRtMetrics = 80 +pkg syscall (netbsd-amd64), const SizeofRtMsghdr = 120 +pkg syscall (netbsd-amd64), const SizeofSockaddrAny = 108 +pkg syscall (netbsd-amd64), const SizeofSockaddrDatalink = 20 +pkg syscall (netbsd-amd64), const SizeofSockaddrInet4 = 16 +pkg syscall (netbsd-amd64), const SizeofSockaddrInet6 = 28 +pkg syscall (netbsd-amd64), const SizeofSockaddrUnix = 106 +pkg syscall (netbsd-amd64), const TCIFLUSH = 1 +pkg syscall (netbsd-amd64), const TCIOFLUSH = 3 +pkg syscall (netbsd-amd64), const TCOFLUSH = 2 +pkg syscall (netbsd-amd64), const TCP_CONGCTL = 32 +pkg syscall (netbsd-amd64), const TCP_KEEPCNT = 6 +pkg syscall (netbsd-amd64), const TCP_KEEPIDLE = 3 +pkg syscall (netbsd-amd64), const TCP_KEEPINIT = 7 +pkg syscall (netbsd-amd64), const TCP_KEEPINTVL = 5 +pkg syscall (netbsd-amd64), const TCP_MAXBURST = 4 +pkg syscall (netbsd-amd64), const TCP_MAXSEG = 2 +pkg syscall (netbsd-amd64), const TCP_MAXWIN = 65535 +pkg syscall (netbsd-amd64), const TCP_MAX_WINSHIFT = 14 +pkg syscall (netbsd-amd64), const TCP_MD5SIG = 16 +pkg syscall (netbsd-amd64), const TCP_MINMSS = 216 +pkg syscall (netbsd-amd64), const TCP_MSS = 536 +pkg syscall (netbsd-amd64), const TCSAFLUSH = 2 +pkg syscall (netbsd-amd64), const TIOCCBRK = 536900730 +pkg syscall (netbsd-amd64), const TIOCCDTR = 536900728 +pkg syscall (netbsd-amd64), const TIOCCONS = 2147775586 +pkg syscall (netbsd-amd64), const TIOCDCDTIMESTAMP = 1074820184 +pkg syscall (netbsd-amd64), const TIOCDRAIN = 536900702 +pkg syscall (netbsd-amd64), const TIOCEXCL = 536900621 +pkg syscall (netbsd-amd64), const TIOCEXT = 2147775584 +pkg syscall (netbsd-amd64), const TIOCFLAG_CDTRCTS = 16 +pkg syscall (netbsd-amd64), const TIOCFLAG_CLOCAL = 2 +pkg syscall (netbsd-amd64), const TIOCFLAG_CRTSCTS = 4 +pkg syscall (netbsd-amd64), const TIOCFLAG_MDMBUF = 8 +pkg syscall (netbsd-amd64), const TIOCFLAG_SOFTCAR = 1 +pkg syscall (netbsd-amd64), const TIOCFLUSH = 2147775504 +pkg syscall (netbsd-amd64), const TIOCGETA = 1076655123 +pkg syscall (netbsd-amd64), const TIOCGETD = 1074033690 +pkg syscall (netbsd-amd64), const TIOCGFLAGS = 1074033757 +pkg syscall (netbsd-amd64), const TIOCGLINED = 1075868738 +pkg syscall (netbsd-amd64), const TIOCGPGRP = 1074033783 +pkg syscall (netbsd-amd64), const TIOCGQSIZE = 1074033793 +pkg syscall (netbsd-amd64), const TIOCGRANTPT = 536900679 +pkg syscall (netbsd-amd64), const TIOCGSID = 1074033763 +pkg syscall (netbsd-amd64), const TIOCGSIZE = 1074295912 +pkg syscall (netbsd-amd64), const TIOCGWINSZ = 1074295912 +pkg syscall (netbsd-amd64), const TIOCMBIC = 2147775595 +pkg syscall (netbsd-amd64), const TIOCMBIS = 2147775596 +pkg syscall (netbsd-amd64), const TIOCMGET = 1074033770 +pkg syscall (netbsd-amd64), const TIOCMSET = 2147775597 +pkg syscall (netbsd-amd64), const TIOCM_CAR = 64 +pkg syscall (netbsd-amd64), const TIOCM_CD = 64 +pkg syscall (netbsd-amd64), const TIOCM_CTS = 32 +pkg syscall (netbsd-amd64), const TIOCM_DSR = 256 +pkg syscall (netbsd-amd64), const TIOCM_DTR = 2 +pkg syscall (netbsd-amd64), const TIOCM_LE = 1 +pkg syscall (netbsd-amd64), const TIOCM_RI = 128 +pkg syscall (netbsd-amd64), const TIOCM_RNG = 128 +pkg syscall (netbsd-amd64), const TIOCM_RTS = 4 +pkg syscall (netbsd-amd64), const TIOCM_SR = 16 +pkg syscall (netbsd-amd64), const TIOCM_ST = 8 +pkg syscall (netbsd-amd64), const TIOCNOTTY = 536900721 +pkg syscall (netbsd-amd64), const TIOCNXCL = 536900622 +pkg syscall (netbsd-amd64), const TIOCOUTQ = 1074033779 +pkg syscall (netbsd-amd64), const TIOCPKT = 2147775600 +pkg syscall (netbsd-amd64), const TIOCPKT_DATA = 0 +pkg syscall (netbsd-amd64), const TIOCPKT_DOSTOP = 32 +pkg syscall (netbsd-amd64), const TIOCPKT_FLUSHREAD = 1 +pkg syscall (netbsd-amd64), const TIOCPKT_FLUSHWRITE = 2 +pkg syscall (netbsd-amd64), const TIOCPKT_IOCTL = 64 +pkg syscall (netbsd-amd64), const TIOCPKT_NOSTOP = 16 +pkg syscall (netbsd-amd64), const TIOCPKT_START = 8 +pkg syscall (netbsd-amd64), const TIOCPKT_STOP = 4 +pkg syscall (netbsd-amd64), const TIOCPTMGET = 1076393030 +pkg syscall (netbsd-amd64), const TIOCPTSNAME = 1076393032 +pkg syscall (netbsd-amd64), const TIOCRCVFRAME = 2148037701 +pkg syscall (netbsd-amd64), const TIOCREMOTE = 2147775593 +pkg syscall (netbsd-amd64), const TIOCSBRK = 536900731 +pkg syscall (netbsd-amd64), const TIOCSCTTY = 536900705 +pkg syscall (netbsd-amd64), const TIOCSDTR = 536900729 +pkg syscall (netbsd-amd64), const TIOCSETA = 2150396948 +pkg syscall (netbsd-amd64), const TIOCSETAF = 2150396950 +pkg syscall (netbsd-amd64), const TIOCSETAW = 2150396949 +pkg syscall (netbsd-amd64), const TIOCSETD = 2147775515 +pkg syscall (netbsd-amd64), const TIOCSFLAGS = 2147775580 +pkg syscall (netbsd-amd64), const TIOCSIG = 536900703 +pkg syscall (netbsd-amd64), const TIOCSLINED = 2149610563 +pkg syscall (netbsd-amd64), const TIOCSPGRP = 2147775606 +pkg syscall (netbsd-amd64), const TIOCSQSIZE = 2147775616 +pkg syscall (netbsd-amd64), const TIOCSSIZE = 2148037735 +pkg syscall (netbsd-amd64), const TIOCSTART = 536900718 +pkg syscall (netbsd-amd64), const TIOCSTAT = 2147775589 +pkg syscall (netbsd-amd64), const TIOCSTI = 2147578994 +pkg syscall (netbsd-amd64), const TIOCSTOP = 536900719 +pkg syscall (netbsd-amd64), const TIOCSWINSZ = 2148037735 +pkg syscall (netbsd-amd64), const TIOCUCNTL = 2147775590 +pkg syscall (netbsd-amd64), const TIOCXMTFRAME = 2148037700 +pkg syscall (netbsd-amd64), const TOSTOP = 4194304 +pkg syscall (netbsd-amd64), const VDISCARD = 15 +pkg syscall (netbsd-amd64), const VDSUSP = 11 +pkg syscall (netbsd-amd64), const VEOF = 0 +pkg syscall (netbsd-amd64), const VEOL = 1 +pkg syscall (netbsd-amd64), const VEOL2 = 2 +pkg syscall (netbsd-amd64), const VERASE = 3 +pkg syscall (netbsd-amd64), const VINTR = 8 +pkg syscall (netbsd-amd64), const VKILL = 5 +pkg syscall (netbsd-amd64), const VLNEXT = 14 +pkg syscall (netbsd-amd64), const VMIN = 16 +pkg syscall (netbsd-amd64), const VQUIT = 9 +pkg syscall (netbsd-amd64), const VREPRINT = 6 +pkg syscall (netbsd-amd64), const VSTART = 12 +pkg syscall (netbsd-amd64), const VSTATUS = 18 +pkg syscall (netbsd-amd64), const VSTOP = 13 +pkg syscall (netbsd-amd64), const VSUSP = 10 +pkg syscall (netbsd-amd64), const VTIME = 17 +pkg syscall (netbsd-amd64), const VWERASE = 4 +pkg syscall (netbsd-amd64), const WALL = 8 +pkg syscall (netbsd-amd64), const WALLSIG = 8 +pkg syscall (netbsd-amd64), const WALTSIG = 4 +pkg syscall (netbsd-amd64), const WCLONE = 4 +pkg syscall (netbsd-amd64), const WCOREFLAG = 128 +pkg syscall (netbsd-amd64), const WNOHANG = 1 +pkg syscall (netbsd-amd64), const WNOWAIT = 65536 +pkg syscall (netbsd-amd64), const WNOZOMBIE = 131072 +pkg syscall (netbsd-amd64), const WOPTSCHECKED = 262144 +pkg syscall (netbsd-amd64), const WSTOPPED = 127 +pkg syscall (netbsd-amd64), const WUNTRACED = 2 +pkg syscall (netbsd-amd64-cgo), const AF_APPLETALK = 16 +pkg syscall (netbsd-amd64-cgo), const AF_ARP = 28 +pkg syscall (netbsd-amd64-cgo), const AF_BLUETOOTH = 31 +pkg syscall (netbsd-amd64-cgo), const AF_CCITT = 10 +pkg syscall (netbsd-amd64-cgo), const AF_CHAOS = 5 +pkg syscall (netbsd-amd64-cgo), const AF_CNT = 21 +pkg syscall (netbsd-amd64-cgo), const AF_COIP = 20 +pkg syscall (netbsd-amd64-cgo), const AF_DATAKIT = 9 +pkg syscall (netbsd-amd64-cgo), const AF_DECnet = 12 +pkg syscall (netbsd-amd64-cgo), const AF_DLI = 13 +pkg syscall (netbsd-amd64-cgo), const AF_E164 = 26 +pkg syscall (netbsd-amd64-cgo), const AF_ECMA = 8 +pkg syscall (netbsd-amd64-cgo), const AF_HYLINK = 15 +pkg syscall (netbsd-amd64-cgo), const AF_IEEE80211 = 32 +pkg syscall (netbsd-amd64-cgo), const AF_IMPLINK = 3 +pkg syscall (netbsd-amd64-cgo), const AF_INET6 = 24 +pkg syscall (netbsd-amd64-cgo), const AF_IPX = 23 +pkg syscall (netbsd-amd64-cgo), const AF_ISDN = 26 +pkg syscall (netbsd-amd64-cgo), const AF_ISO = 7 +pkg syscall (netbsd-amd64-cgo), const AF_LAT = 14 +pkg syscall (netbsd-amd64-cgo), const AF_LINK = 18 +pkg syscall (netbsd-amd64-cgo), const AF_LOCAL = 1 +pkg syscall (netbsd-amd64-cgo), const AF_MAX = 35 +pkg syscall (netbsd-amd64-cgo), const AF_MPLS = 33 +pkg syscall (netbsd-amd64-cgo), const AF_NATM = 27 +pkg syscall (netbsd-amd64-cgo), const AF_NS = 6 +pkg syscall (netbsd-amd64-cgo), const AF_OROUTE = 17 +pkg syscall (netbsd-amd64-cgo), const AF_OSI = 7 +pkg syscall (netbsd-amd64-cgo), const AF_PUP = 4 +pkg syscall (netbsd-amd64-cgo), const AF_ROUTE = 34 +pkg syscall (netbsd-amd64-cgo), const AF_SNA = 11 +pkg syscall (netbsd-amd64-cgo), const ARPHRD_ARCNET = 7 +pkg syscall (netbsd-amd64-cgo), const ARPHRD_ETHER = 1 +pkg syscall (netbsd-amd64-cgo), const ARPHRD_FRELAY = 15 +pkg syscall (netbsd-amd64-cgo), const ARPHRD_IEEE1394 = 24 +pkg syscall (netbsd-amd64-cgo), const ARPHRD_IEEE802 = 6 +pkg syscall (netbsd-amd64-cgo), const ARPHRD_STRIP = 23 +pkg syscall (netbsd-amd64-cgo), const B0 = 0 +pkg syscall (netbsd-amd64-cgo), const B110 = 110 +pkg syscall (netbsd-amd64-cgo), const B115200 = 115200 +pkg syscall (netbsd-amd64-cgo), const B1200 = 1200 +pkg syscall (netbsd-amd64-cgo), const B134 = 134 +pkg syscall (netbsd-amd64-cgo), const B14400 = 14400 +pkg syscall (netbsd-amd64-cgo), const B150 = 150 +pkg syscall (netbsd-amd64-cgo), const B1800 = 1800 +pkg syscall (netbsd-amd64-cgo), const B19200 = 19200 +pkg syscall (netbsd-amd64-cgo), const B200 = 200 +pkg syscall (netbsd-amd64-cgo), const B230400 = 230400 +pkg syscall (netbsd-amd64-cgo), const B2400 = 2400 +pkg syscall (netbsd-amd64-cgo), const B28800 = 28800 +pkg syscall (netbsd-amd64-cgo), const B300 = 300 +pkg syscall (netbsd-amd64-cgo), const B38400 = 38400 +pkg syscall (netbsd-amd64-cgo), const B460800 = 460800 +pkg syscall (netbsd-amd64-cgo), const B4800 = 4800 +pkg syscall (netbsd-amd64-cgo), const B50 = 50 +pkg syscall (netbsd-amd64-cgo), const B57600 = 57600 +pkg syscall (netbsd-amd64-cgo), const B600 = 600 +pkg syscall (netbsd-amd64-cgo), const B7200 = 7200 +pkg syscall (netbsd-amd64-cgo), const B75 = 75 +pkg syscall (netbsd-amd64-cgo), const B76800 = 76800 +pkg syscall (netbsd-amd64-cgo), const B921600 = 921600 +pkg syscall (netbsd-amd64-cgo), const B9600 = 9600 +pkg syscall (netbsd-amd64-cgo), const BIOCFEEDBACK = 2147762813 +pkg syscall (netbsd-amd64-cgo), const BIOCFLUSH = 536887912 +pkg syscall (netbsd-amd64-cgo), const BIOCGBLEN = 1074020966 +pkg syscall (netbsd-amd64-cgo), const BIOCGDLT = 1074020970 +pkg syscall (netbsd-amd64-cgo), const BIOCGDLTLIST = 3222291063 +pkg syscall (netbsd-amd64-cgo), const BIOCGETIF = 1083196011 +pkg syscall (netbsd-amd64-cgo), const BIOCGFEEDBACK = 1074020988 +pkg syscall (netbsd-amd64-cgo), const BIOCGHDRCMPLT = 1074020980 +pkg syscall (netbsd-amd64-cgo), const BIOCGRTIMEOUT = 1074807419 +pkg syscall (netbsd-amd64-cgo), const BIOCGSEESENT = 1074020984 +pkg syscall (netbsd-amd64-cgo), const BIOCGSTATS = 1082147439 +pkg syscall (netbsd-amd64-cgo), const BIOCGSTATSOLD = 1074283119 +pkg syscall (netbsd-amd64-cgo), const BIOCIMMEDIATE = 2147762800 +pkg syscall (netbsd-amd64-cgo), const BIOCPROMISC = 536887913 +pkg syscall (netbsd-amd64-cgo), const BIOCSBLEN = 3221504614 +pkg syscall (netbsd-amd64-cgo), const BIOCSDLT = 2147762806 +pkg syscall (netbsd-amd64-cgo), const BIOCSETF = 2148549223 +pkg syscall (netbsd-amd64-cgo), const BIOCSETIF = 2156937836 +pkg syscall (netbsd-amd64-cgo), const BIOCSFEEDBACK = 2147762813 +pkg syscall (netbsd-amd64-cgo), const BIOCSHDRCMPLT = 2147762805 +pkg syscall (netbsd-amd64-cgo), const BIOCSRTIMEOUT = 2148549242 +pkg syscall (netbsd-amd64-cgo), const BIOCSSEESENT = 2147762809 +pkg syscall (netbsd-amd64-cgo), const BIOCSTCPF = 2148549234 +pkg syscall (netbsd-amd64-cgo), const BIOCSUDPF = 2148549235 +pkg syscall (netbsd-amd64-cgo), const BIOCVERSION = 1074020977 +pkg syscall (netbsd-amd64-cgo), const BPF_A = 16 +pkg syscall (netbsd-amd64-cgo), const BPF_ABS = 32 +pkg syscall (netbsd-amd64-cgo), const BPF_ADD = 0 +pkg syscall (netbsd-amd64-cgo), const BPF_ALIGNMENT = 8 +pkg syscall (netbsd-amd64-cgo), const BPF_ALIGNMENT32 = 4 +pkg syscall (netbsd-amd64-cgo), const BPF_ALU = 4 +pkg syscall (netbsd-amd64-cgo), const BPF_AND = 80 +pkg syscall (netbsd-amd64-cgo), const BPF_B = 16 +pkg syscall (netbsd-amd64-cgo), const BPF_DFLTBUFSIZE = 1048576 +pkg syscall (netbsd-amd64-cgo), const BPF_DIV = 48 +pkg syscall (netbsd-amd64-cgo), const BPF_H = 8 +pkg syscall (netbsd-amd64-cgo), const BPF_IMM = 0 +pkg syscall (netbsd-amd64-cgo), const BPF_IND = 64 +pkg syscall (netbsd-amd64-cgo), const BPF_JA = 0 +pkg syscall (netbsd-amd64-cgo), const BPF_JEQ = 16 +pkg syscall (netbsd-amd64-cgo), const BPF_JGE = 48 +pkg syscall (netbsd-amd64-cgo), const BPF_JGT = 32 +pkg syscall (netbsd-amd64-cgo), const BPF_JMP = 5 +pkg syscall (netbsd-amd64-cgo), const BPF_JSET = 64 +pkg syscall (netbsd-amd64-cgo), const BPF_K = 0 +pkg syscall (netbsd-amd64-cgo), const BPF_LD = 0 +pkg syscall (netbsd-amd64-cgo), const BPF_LDX = 1 +pkg syscall (netbsd-amd64-cgo), const BPF_LEN = 128 +pkg syscall (netbsd-amd64-cgo), const BPF_LSH = 96 +pkg syscall (netbsd-amd64-cgo), const BPF_MAJOR_VERSION = 1 +pkg syscall (netbsd-amd64-cgo), const BPF_MAXBUFSIZE = 16777216 +pkg syscall (netbsd-amd64-cgo), const BPF_MAXINSNS = 512 +pkg syscall (netbsd-amd64-cgo), const BPF_MEM = 96 +pkg syscall (netbsd-amd64-cgo), const BPF_MEMWORDS = 16 +pkg syscall (netbsd-amd64-cgo), const BPF_MINBUFSIZE = 32 +pkg syscall (netbsd-amd64-cgo), const BPF_MINOR_VERSION = 1 +pkg syscall (netbsd-amd64-cgo), const BPF_MISC = 7 +pkg syscall (netbsd-amd64-cgo), const BPF_MSH = 160 +pkg syscall (netbsd-amd64-cgo), const BPF_MUL = 32 +pkg syscall (netbsd-amd64-cgo), const BPF_NEG = 128 +pkg syscall (netbsd-amd64-cgo), const BPF_OR = 64 +pkg syscall (netbsd-amd64-cgo), const BPF_RELEASE = 199606 +pkg syscall (netbsd-amd64-cgo), const BPF_RET = 6 +pkg syscall (netbsd-amd64-cgo), const BPF_RSH = 112 +pkg syscall (netbsd-amd64-cgo), const BPF_ST = 2 +pkg syscall (netbsd-amd64-cgo), const BPF_STX = 3 +pkg syscall (netbsd-amd64-cgo), const BPF_SUB = 16 +pkg syscall (netbsd-amd64-cgo), const BPF_TAX = 0 +pkg syscall (netbsd-amd64-cgo), const BPF_TXA = 128 +pkg syscall (netbsd-amd64-cgo), const BPF_W = 0 +pkg syscall (netbsd-amd64-cgo), const BPF_X = 8 +pkg syscall (netbsd-amd64-cgo), const BRKINT = 2 +pkg syscall (netbsd-amd64-cgo), const CFLUSH = 15 +pkg syscall (netbsd-amd64-cgo), const CLOCAL = 32768 +pkg syscall (netbsd-amd64-cgo), const CREAD = 2048 +pkg syscall (netbsd-amd64-cgo), const CS5 = 0 +pkg syscall (netbsd-amd64-cgo), const CS6 = 256 +pkg syscall (netbsd-amd64-cgo), const CS7 = 512 +pkg syscall (netbsd-amd64-cgo), const CS8 = 768 +pkg syscall (netbsd-amd64-cgo), const CSIZE = 768 +pkg syscall (netbsd-amd64-cgo), const CSTART = 17 +pkg syscall (netbsd-amd64-cgo), const CSTATUS = 20 +pkg syscall (netbsd-amd64-cgo), const CSTOP = 19 +pkg syscall (netbsd-amd64-cgo), const CSTOPB = 1024 +pkg syscall (netbsd-amd64-cgo), const CSUSP = 26 +pkg syscall (netbsd-amd64-cgo), const CTL_MAXNAME = 12 +pkg syscall (netbsd-amd64-cgo), const CTL_NET = 4 +pkg syscall (netbsd-amd64-cgo), const CTL_QUERY = -2 +pkg syscall (netbsd-amd64-cgo), const DIOCBSFLUSH = 536896632 +pkg syscall (netbsd-amd64-cgo), const DLT_A429 = 184 +pkg syscall (netbsd-amd64-cgo), const DLT_A653_ICM = 185 +pkg syscall (netbsd-amd64-cgo), const DLT_AIRONET_HEADER = 120 +pkg syscall (netbsd-amd64-cgo), const DLT_AOS = 222 +pkg syscall (netbsd-amd64-cgo), const DLT_APPLE_IP_OVER_IEEE1394 = 138 +pkg syscall (netbsd-amd64-cgo), const DLT_ARCNET = 7 +pkg syscall (netbsd-amd64-cgo), const DLT_ARCNET_LINUX = 129 +pkg syscall (netbsd-amd64-cgo), const DLT_ATM_CLIP = 19 +pkg syscall (netbsd-amd64-cgo), const DLT_ATM_RFC1483 = 11 +pkg syscall (netbsd-amd64-cgo), const DLT_AURORA = 126 +pkg syscall (netbsd-amd64-cgo), const DLT_AX25 = 3 +pkg syscall (netbsd-amd64-cgo), const DLT_AX25_KISS = 202 +pkg syscall (netbsd-amd64-cgo), const DLT_BACNET_MS_TP = 165 +pkg syscall (netbsd-amd64-cgo), const DLT_BLUETOOTH_HCI_H4 = 187 +pkg syscall (netbsd-amd64-cgo), const DLT_BLUETOOTH_HCI_H4_WITH_PHDR = 201 +pkg syscall (netbsd-amd64-cgo), const DLT_CAN20B = 190 +pkg syscall (netbsd-amd64-cgo), const DLT_CAN_SOCKETCAN = 227 +pkg syscall (netbsd-amd64-cgo), const DLT_CHAOS = 5 +pkg syscall (netbsd-amd64-cgo), const DLT_CISCO_IOS = 118 +pkg syscall (netbsd-amd64-cgo), const DLT_C_HDLC = 104 +pkg syscall (netbsd-amd64-cgo), const DLT_C_HDLC_WITH_DIR = 205 +pkg syscall (netbsd-amd64-cgo), const DLT_DECT = 221 +pkg syscall (netbsd-amd64-cgo), const DLT_DOCSIS = 143 +pkg syscall (netbsd-amd64-cgo), const DLT_ECONET = 115 +pkg syscall (netbsd-amd64-cgo), const DLT_EN10MB = 1 +pkg syscall (netbsd-amd64-cgo), const DLT_EN3MB = 2 +pkg syscall (netbsd-amd64-cgo), const DLT_ENC = 109 +pkg syscall (netbsd-amd64-cgo), const DLT_ERF = 197 +pkg syscall (netbsd-amd64-cgo), const DLT_ERF_ETH = 175 +pkg syscall (netbsd-amd64-cgo), const DLT_ERF_POS = 176 +pkg syscall (netbsd-amd64-cgo), const DLT_FC_2 = 224 +pkg syscall (netbsd-amd64-cgo), const DLT_FC_2_WITH_FRAME_DELIMS = 225 +pkg syscall (netbsd-amd64-cgo), const DLT_FDDI = 10 +pkg syscall (netbsd-amd64-cgo), const DLT_FLEXRAY = 210 +pkg syscall (netbsd-amd64-cgo), const DLT_FRELAY = 107 +pkg syscall (netbsd-amd64-cgo), const DLT_FRELAY_WITH_DIR = 206 +pkg syscall (netbsd-amd64-cgo), const DLT_GCOM_SERIAL = 173 +pkg syscall (netbsd-amd64-cgo), const DLT_GCOM_T1E1 = 172 +pkg syscall (netbsd-amd64-cgo), const DLT_GPF_F = 171 +pkg syscall (netbsd-amd64-cgo), const DLT_GPF_T = 170 +pkg syscall (netbsd-amd64-cgo), const DLT_GPRS_LLC = 169 +pkg syscall (netbsd-amd64-cgo), const DLT_GSMTAP_ABIS = 218 +pkg syscall (netbsd-amd64-cgo), const DLT_GSMTAP_UM = 217 +pkg syscall (netbsd-amd64-cgo), const DLT_HDLC = 16 +pkg syscall (netbsd-amd64-cgo), const DLT_HHDLC = 121 +pkg syscall (netbsd-amd64-cgo), const DLT_HIPPI = 15 +pkg syscall (netbsd-amd64-cgo), const DLT_IBM_SN = 146 +pkg syscall (netbsd-amd64-cgo), const DLT_IBM_SP = 145 +pkg syscall (netbsd-amd64-cgo), const DLT_IEEE802 = 6 +pkg syscall (netbsd-amd64-cgo), const DLT_IEEE802_11 = 105 +pkg syscall (netbsd-amd64-cgo), const DLT_IEEE802_11_RADIO = 127 +pkg syscall (netbsd-amd64-cgo), const DLT_IEEE802_11_RADIO_AVS = 163 +pkg syscall (netbsd-amd64-cgo), const DLT_IEEE802_15_4 = 195 +pkg syscall (netbsd-amd64-cgo), const DLT_IEEE802_15_4_LINUX = 191 +pkg syscall (netbsd-amd64-cgo), const DLT_IEEE802_15_4_NONASK_PHY = 215 +pkg syscall (netbsd-amd64-cgo), const DLT_IEEE802_16_MAC_CPS = 188 +pkg syscall (netbsd-amd64-cgo), const DLT_IEEE802_16_MAC_CPS_RADIO = 193 +pkg syscall (netbsd-amd64-cgo), const DLT_IPMB = 199 +pkg syscall (netbsd-amd64-cgo), const DLT_IPMB_LINUX = 209 +pkg syscall (netbsd-amd64-cgo), const DLT_IPNET = 226 +pkg syscall (netbsd-amd64-cgo), const DLT_IPV4 = 228 +pkg syscall (netbsd-amd64-cgo), const DLT_IPV6 = 229 +pkg syscall (netbsd-amd64-cgo), const DLT_IP_OVER_FC = 122 +pkg syscall (netbsd-amd64-cgo), const DLT_JUNIPER_ATM1 = 137 +pkg syscall (netbsd-amd64-cgo), const DLT_JUNIPER_ATM2 = 135 +pkg syscall (netbsd-amd64-cgo), const DLT_JUNIPER_CHDLC = 181 +pkg syscall (netbsd-amd64-cgo), const DLT_JUNIPER_ES = 132 +pkg syscall (netbsd-amd64-cgo), const DLT_JUNIPER_ETHER = 178 +pkg syscall (netbsd-amd64-cgo), const DLT_JUNIPER_FRELAY = 180 +pkg syscall (netbsd-amd64-cgo), const DLT_JUNIPER_GGSN = 133 +pkg syscall (netbsd-amd64-cgo), const DLT_JUNIPER_ISM = 194 +pkg syscall (netbsd-amd64-cgo), const DLT_JUNIPER_MFR = 134 +pkg syscall (netbsd-amd64-cgo), const DLT_JUNIPER_MLFR = 131 +pkg syscall (netbsd-amd64-cgo), const DLT_JUNIPER_MLPPP = 130 +pkg syscall (netbsd-amd64-cgo), const DLT_JUNIPER_MONITOR = 164 +pkg syscall (netbsd-amd64-cgo), const DLT_JUNIPER_PIC_PEER = 174 +pkg syscall (netbsd-amd64-cgo), const DLT_JUNIPER_PPP = 179 +pkg syscall (netbsd-amd64-cgo), const DLT_JUNIPER_PPPOE = 167 +pkg syscall (netbsd-amd64-cgo), const DLT_JUNIPER_PPPOE_ATM = 168 +pkg syscall (netbsd-amd64-cgo), const DLT_JUNIPER_SERVICES = 136 +pkg syscall (netbsd-amd64-cgo), const DLT_JUNIPER_ST = 200 +pkg syscall (netbsd-amd64-cgo), const DLT_JUNIPER_VP = 183 +pkg syscall (netbsd-amd64-cgo), const DLT_LAPB_WITH_DIR = 207 +pkg syscall (netbsd-amd64-cgo), const DLT_LAPD = 203 +pkg syscall (netbsd-amd64-cgo), const DLT_LIN = 212 +pkg syscall (netbsd-amd64-cgo), const DLT_LINUX_EVDEV = 216 +pkg syscall (netbsd-amd64-cgo), const DLT_LINUX_IRDA = 144 +pkg syscall (netbsd-amd64-cgo), const DLT_LINUX_LAPD = 177 +pkg syscall (netbsd-amd64-cgo), const DLT_LINUX_SLL = 113 +pkg syscall (netbsd-amd64-cgo), const DLT_LOOP = 108 +pkg syscall (netbsd-amd64-cgo), const DLT_LTALK = 114 +pkg syscall (netbsd-amd64-cgo), const DLT_MFR = 182 +pkg syscall (netbsd-amd64-cgo), const DLT_MOST = 211 +pkg syscall (netbsd-amd64-cgo), const DLT_MPLS = 219 +pkg syscall (netbsd-amd64-cgo), const DLT_MTP2 = 140 +pkg syscall (netbsd-amd64-cgo), const DLT_MTP2_WITH_PHDR = 139 +pkg syscall (netbsd-amd64-cgo), const DLT_MTP3 = 141 +pkg syscall (netbsd-amd64-cgo), const DLT_NULL = 0 +pkg syscall (netbsd-amd64-cgo), const DLT_PCI_EXP = 125 +pkg syscall (netbsd-amd64-cgo), const DLT_PFLOG = 117 +pkg syscall (netbsd-amd64-cgo), const DLT_PFSYNC = 18 +pkg syscall (netbsd-amd64-cgo), const DLT_PPI = 192 +pkg syscall (netbsd-amd64-cgo), const DLT_PPP = 9 +pkg syscall (netbsd-amd64-cgo), const DLT_PPP_BSDOS = 14 +pkg syscall (netbsd-amd64-cgo), const DLT_PPP_ETHER = 51 +pkg syscall (netbsd-amd64-cgo), const DLT_PPP_PPPD = 166 +pkg syscall (netbsd-amd64-cgo), const DLT_PPP_SERIAL = 50 +pkg syscall (netbsd-amd64-cgo), const DLT_PPP_WITH_DIR = 204 +pkg syscall (netbsd-amd64-cgo), const DLT_PRISM_HEADER = 119 +pkg syscall (netbsd-amd64-cgo), const DLT_PRONET = 4 +pkg syscall (netbsd-amd64-cgo), const DLT_RAIF1 = 198 +pkg syscall (netbsd-amd64-cgo), const DLT_RAW = 12 +pkg syscall (netbsd-amd64-cgo), const DLT_RAWAF_MASK = 35913728 +pkg syscall (netbsd-amd64-cgo), const DLT_RIO = 124 +pkg syscall (netbsd-amd64-cgo), const DLT_SCCP = 142 +pkg syscall (netbsd-amd64-cgo), const DLT_SITA = 196 +pkg syscall (netbsd-amd64-cgo), const DLT_SLIP = 8 +pkg syscall (netbsd-amd64-cgo), const DLT_SLIP_BSDOS = 13 +pkg syscall (netbsd-amd64-cgo), const DLT_SUNATM = 123 +pkg syscall (netbsd-amd64-cgo), const DLT_SYMANTEC_FIREWALL = 99 +pkg syscall (netbsd-amd64-cgo), const DLT_TZSP = 128 +pkg syscall (netbsd-amd64-cgo), const DLT_USB = 186 +pkg syscall (netbsd-amd64-cgo), const DLT_USB_LINUX = 189 +pkg syscall (netbsd-amd64-cgo), const DLT_USB_LINUX_MMAPPED = 220 +pkg syscall (netbsd-amd64-cgo), const DLT_WIHART = 223 +pkg syscall (netbsd-amd64-cgo), const DLT_X2E_SERIAL = 213 +pkg syscall (netbsd-amd64-cgo), const DLT_X2E_XORAYA = 214 +pkg syscall (netbsd-amd64-cgo), const DT_BLK = 6 +pkg syscall (netbsd-amd64-cgo), const DT_CHR = 2 +pkg syscall (netbsd-amd64-cgo), const DT_DIR = 4 +pkg syscall (netbsd-amd64-cgo), const DT_FIFO = 1 +pkg syscall (netbsd-amd64-cgo), const DT_LNK = 10 +pkg syscall (netbsd-amd64-cgo), const DT_REG = 8 +pkg syscall (netbsd-amd64-cgo), const DT_SOCK = 12 +pkg syscall (netbsd-amd64-cgo), const DT_UNKNOWN = 0 +pkg syscall (netbsd-amd64-cgo), const DT_WHT = 14 +pkg syscall (netbsd-amd64-cgo), const E2BIG = 7 +pkg syscall (netbsd-amd64-cgo), const EACCES = 13 +pkg syscall (netbsd-amd64-cgo), const EADDRINUSE = 48 +pkg syscall (netbsd-amd64-cgo), const EADDRNOTAVAIL = 49 +pkg syscall (netbsd-amd64-cgo), const EAFNOSUPPORT = 47 +pkg syscall (netbsd-amd64-cgo), const EAGAIN = 35 +pkg syscall (netbsd-amd64-cgo), const EALREADY = 37 +pkg syscall (netbsd-amd64-cgo), const EAUTH = 80 +pkg syscall (netbsd-amd64-cgo), const EBADF = 9 +pkg syscall (netbsd-amd64-cgo), const EBADMSG = 88 +pkg syscall (netbsd-amd64-cgo), const EBADRPC = 72 +pkg syscall (netbsd-amd64-cgo), const EBUSY = 16 +pkg syscall (netbsd-amd64-cgo), const ECANCELED = 87 +pkg syscall (netbsd-amd64-cgo), const ECHILD = 10 +pkg syscall (netbsd-amd64-cgo), const ECHO = 8 +pkg syscall (netbsd-amd64-cgo), const ECHOCTL = 64 +pkg syscall (netbsd-amd64-cgo), const ECHOE = 2 +pkg syscall (netbsd-amd64-cgo), const ECHOK = 4 +pkg syscall (netbsd-amd64-cgo), const ECHOKE = 1 +pkg syscall (netbsd-amd64-cgo), const ECHONL = 16 +pkg syscall (netbsd-amd64-cgo), const ECHOPRT = 32 +pkg syscall (netbsd-amd64-cgo), const ECONNABORTED = 53 +pkg syscall (netbsd-amd64-cgo), const ECONNREFUSED = 61 +pkg syscall (netbsd-amd64-cgo), const ECONNRESET = 54 +pkg syscall (netbsd-amd64-cgo), const EDEADLK = 11 +pkg syscall (netbsd-amd64-cgo), const EDESTADDRREQ = 39 +pkg syscall (netbsd-amd64-cgo), const EDOM = 33 +pkg syscall (netbsd-amd64-cgo), const EDQUOT = 69 +pkg syscall (netbsd-amd64-cgo), const EEXIST = 17 +pkg syscall (netbsd-amd64-cgo), const EFAULT = 14 +pkg syscall (netbsd-amd64-cgo), const EFBIG = 27 +pkg syscall (netbsd-amd64-cgo), const EFTYPE = 79 +pkg syscall (netbsd-amd64-cgo), const EHOSTDOWN = 64 +pkg syscall (netbsd-amd64-cgo), const EHOSTUNREACH = 65 +pkg syscall (netbsd-amd64-cgo), const EIDRM = 82 +pkg syscall (netbsd-amd64-cgo), const EILSEQ = 85 +pkg syscall (netbsd-amd64-cgo), const EINPROGRESS = 36 +pkg syscall (netbsd-amd64-cgo), const EINTR = 4 +pkg syscall (netbsd-amd64-cgo), const EINVAL = 22 +pkg syscall (netbsd-amd64-cgo), const EIO = 5 +pkg syscall (netbsd-amd64-cgo), const EISCONN = 56 +pkg syscall (netbsd-amd64-cgo), const EISDIR = 21 +pkg syscall (netbsd-amd64-cgo), const ELAST = 96 +pkg syscall (netbsd-amd64-cgo), const ELOOP = 62 +pkg syscall (netbsd-amd64-cgo), const EMFILE = 24 +pkg syscall (netbsd-amd64-cgo), const EMLINK = 31 +pkg syscall (netbsd-amd64-cgo), const EMSGSIZE = 40 +pkg syscall (netbsd-amd64-cgo), const EMULTIHOP = 94 +pkg syscall (netbsd-amd64-cgo), const EMUL_LINUX = 1 +pkg syscall (netbsd-amd64-cgo), const EMUL_LINUX32 = 5 +pkg syscall (netbsd-amd64-cgo), const EMUL_MAXID = 6 +pkg syscall (netbsd-amd64-cgo), const ENAMETOOLONG = 63 +pkg syscall (netbsd-amd64-cgo), const ENEEDAUTH = 81 +pkg syscall (netbsd-amd64-cgo), const ENETDOWN = 50 +pkg syscall (netbsd-amd64-cgo), const ENETRESET = 52 +pkg syscall (netbsd-amd64-cgo), const ENETUNREACH = 51 +pkg syscall (netbsd-amd64-cgo), const ENFILE = 23 +pkg syscall (netbsd-amd64-cgo), const ENOATTR = 93 +pkg syscall (netbsd-amd64-cgo), const ENOBUFS = 55 +pkg syscall (netbsd-amd64-cgo), const ENODATA = 89 +pkg syscall (netbsd-amd64-cgo), const ENODEV = 19 +pkg syscall (netbsd-amd64-cgo), const ENOEXEC = 8 +pkg syscall (netbsd-amd64-cgo), const ENOLCK = 77 +pkg syscall (netbsd-amd64-cgo), const ENOLINK = 95 +pkg syscall (netbsd-amd64-cgo), const ENOMEM = 12 +pkg syscall (netbsd-amd64-cgo), const ENOMSG = 83 +pkg syscall (netbsd-amd64-cgo), const ENOPROTOOPT = 42 +pkg syscall (netbsd-amd64-cgo), const ENOSPC = 28 +pkg syscall (netbsd-amd64-cgo), const ENOSR = 90 +pkg syscall (netbsd-amd64-cgo), const ENOSTR = 91 +pkg syscall (netbsd-amd64-cgo), const ENOSYS = 78 +pkg syscall (netbsd-amd64-cgo), const ENOTBLK = 15 +pkg syscall (netbsd-amd64-cgo), const ENOTCONN = 57 +pkg syscall (netbsd-amd64-cgo), const ENOTDIR = 20 +pkg syscall (netbsd-amd64-cgo), const ENOTEMPTY = 66 +pkg syscall (netbsd-amd64-cgo), const ENOTSOCK = 38 +pkg syscall (netbsd-amd64-cgo), const ENOTSUP = 86 +pkg syscall (netbsd-amd64-cgo), const ENOTTY = 25 +pkg syscall (netbsd-amd64-cgo), const ENXIO = 6 +pkg syscall (netbsd-amd64-cgo), const EOPNOTSUPP = 45 +pkg syscall (netbsd-amd64-cgo), const EOVERFLOW = 84 +pkg syscall (netbsd-amd64-cgo), const EPERM = 1 +pkg syscall (netbsd-amd64-cgo), const EPFNOSUPPORT = 46 +pkg syscall (netbsd-amd64-cgo), const EPIPE = 32 +pkg syscall (netbsd-amd64-cgo), const EPROCLIM = 67 +pkg syscall (netbsd-amd64-cgo), const EPROCUNAVAIL = 76 +pkg syscall (netbsd-amd64-cgo), const EPROGMISMATCH = 75 +pkg syscall (netbsd-amd64-cgo), const EPROGUNAVAIL = 74 +pkg syscall (netbsd-amd64-cgo), const EPROTO = 96 +pkg syscall (netbsd-amd64-cgo), const EPROTONOSUPPORT = 43 +pkg syscall (netbsd-amd64-cgo), const EPROTOTYPE = 41 +pkg syscall (netbsd-amd64-cgo), const ERANGE = 34 +pkg syscall (netbsd-amd64-cgo), const EREMOTE = 71 +pkg syscall (netbsd-amd64-cgo), const EROFS = 30 +pkg syscall (netbsd-amd64-cgo), const ERPCMISMATCH = 73 +pkg syscall (netbsd-amd64-cgo), const ESHUTDOWN = 58 +pkg syscall (netbsd-amd64-cgo), const ESOCKTNOSUPPORT = 44 +pkg syscall (netbsd-amd64-cgo), const ESPIPE = 29 +pkg syscall (netbsd-amd64-cgo), const ESRCH = 3 +pkg syscall (netbsd-amd64-cgo), const ESTALE = 70 +pkg syscall (netbsd-amd64-cgo), const ETHERCAP_JUMBO_MTU = 4 +pkg syscall (netbsd-amd64-cgo), const ETHERCAP_VLAN_HWTAGGING = 2 +pkg syscall (netbsd-amd64-cgo), const ETHERCAP_VLAN_MTU = 1 +pkg syscall (netbsd-amd64-cgo), const ETHERMIN = 46 +pkg syscall (netbsd-amd64-cgo), const ETHERMTU = 1500 +pkg syscall (netbsd-amd64-cgo), const ETHERMTU_JUMBO = 9000 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_8023 = 4 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_AARP = 33011 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_ACCTON = 33680 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_AEONIC = 32822 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_ALPHA = 33098 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_AMBER = 24584 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_AMOEBA = 33093 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_APOLLO = 33015 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_APOLLODOMAIN = 32793 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_APPLETALK = 32923 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_APPLITEK = 32967 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_ARGONAUT = 32826 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_ARP = 2054 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_AT = 32923 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_ATALK = 32923 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_ATOMIC = 34527 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_ATT = 32873 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_ATTSTANFORD = 32776 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_AUTOPHON = 32874 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_AXIS = 34902 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_BCLOOP = 36867 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_BOFL = 33026 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_CABLETRON = 28724 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_CHAOS = 2052 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_COMDESIGN = 32876 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_COMPUGRAPHIC = 32877 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_COUNTERPOINT = 32866 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_CRONUS = 32772 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_CRONUSVLN = 32771 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_DCA = 4660 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_DDE = 32891 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_DEBNI = 43690 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_DECAM = 32840 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_DECCUST = 24582 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_DECDIAG = 24581 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_DECDNS = 32828 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_DECDTS = 32830 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_DECEXPER = 24576 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_DECLAST = 32833 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_DECLTM = 32831 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_DECMUMPS = 24585 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_DECNETBIOS = 32832 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_DELTACON = 34526 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_DIDDLE = 17185 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_DLOG1 = 1632 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_DLOG2 = 1633 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_DN = 24579 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_DOGFIGHT = 6537 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_DSMD = 32825 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_ECMA = 2051 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_ENCRYPT = 32829 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_ES = 32861 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_EXCELAN = 32784 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_EXPERDATA = 32841 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_FLIP = 33094 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_FLOWCONTROL = 34824 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_FRARP = 2056 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_GENDYN = 32872 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_HAYES = 33072 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_HIPPI_FP = 33152 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_HITACHI = 34848 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_HP = 32773 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_IEEEPUP = 2560 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_IEEEPUPAT = 2561 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_IMLBL = 19522 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_IMLBLDIAG = 16972 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_IP = 2048 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_IPAS = 34668 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_IPV6 = 34525 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_IPX = 33079 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_IPXNEW = 32823 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_KALPANA = 34178 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_LANBRIDGE = 32824 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_LANPROBE = 34952 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_LAT = 24580 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_LBACK = 36864 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_LITTLE = 32864 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_LOGICRAFT = 33096 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_LOOPBACK = 36864 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_MATRA = 32890 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_MAX = 65535 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_MERIT = 32892 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_MICP = 34618 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_MOPDL = 24577 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_MOPRC = 24578 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_MOTOROLA = 33165 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_MPLS = 34887 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_MPLS_MCAST = 34888 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_MUMPS = 33087 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_NBPCC = 15364 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_NBPCLAIM = 15369 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_NBPCLREQ = 15365 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_NBPCLRSP = 15366 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_NBPCREQ = 15362 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_NBPCRSP = 15363 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_NBPDG = 15367 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_NBPDGB = 15368 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_NBPDLTE = 15370 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_NBPRAR = 15372 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_NBPRAS = 15371 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_NBPRST = 15373 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_NBPSCD = 15361 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_NBPVCD = 15360 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_NBS = 2050 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_NCD = 33097 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_NESTAR = 32774 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_NETBEUI = 33169 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_NOVELL = 33080 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_NS = 1536 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_NSAT = 1537 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_NSCOMPAT = 2055 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_NTRAILER = 16 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_OS9 = 28679 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_OS9NET = 28681 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_PACER = 32966 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_PAE = 34958 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_PCS = 16962 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_PLANNING = 32836 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_PPP = 34827 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_PPPOE = 34916 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_PPPOEDISC = 34915 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_PRIMENTS = 28721 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_PUP = 512 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_PUPAT = 512 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_RACAL = 28720 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_RATIONAL = 33104 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_RAWFR = 25945 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_RCL = 6549 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_RDP = 34617 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_RETIX = 33010 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_REVARP = 32821 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_SCA = 24583 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_SECTRA = 34523 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_SECUREDATA = 34669 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_SGITW = 33150 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_SG_BOUNCE = 32790 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_SG_DIAG = 32787 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_SG_NETGAMES = 32788 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_SG_RESV = 32789 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_SIMNET = 21000 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_SLOWPROTOCOLS = 34825 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_SNA = 32981 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_SNMP = 33100 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_SONIX = 64245 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_SPIDER = 32927 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_SPRITE = 1280 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_STP = 33153 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_TALARIS = 33067 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_TALARISMC = 34091 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_TCPCOMP = 34667 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_TCPSM = 36866 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_TEC = 33103 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_TIGAN = 32815 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_TRAIL = 4096 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_TRANSETHER = 25944 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_TYMSHARE = 32814 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_UBBST = 28677 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_UBDEBUG = 2304 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_UBDIAGLOOP = 28674 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_UBDL = 28672 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_UBNIU = 28673 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_UBNMC = 28675 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_VALID = 5632 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_VARIAN = 32989 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_VAXELN = 32827 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_VEECO = 32871 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_VEXP = 32859 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_VGLAB = 33073 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_VINES = 2989 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_VINESECHO = 2991 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_VINESLOOP = 2990 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_VITAL = 65280 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_VLAN = 33024 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_VLTLMAN = 32896 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_VPROD = 32860 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_VURESERVED = 33095 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_WATERLOO = 33072 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_WELLFLEET = 33027 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_X25 = 2053 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_X75 = 2049 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_XNSSM = 36865 +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_XTP = 33149 +pkg syscall (netbsd-amd64-cgo), const ETHER_ADDR_LEN = 6 +pkg syscall (netbsd-amd64-cgo), const ETHER_CRC_LEN = 4 +pkg syscall (netbsd-amd64-cgo), const ETHER_CRC_POLY_BE = 79764918 +pkg syscall (netbsd-amd64-cgo), const ETHER_CRC_POLY_LE = 3988292384 +pkg syscall (netbsd-amd64-cgo), const ETHER_HDR_LEN = 14 +pkg syscall (netbsd-amd64-cgo), const ETHER_MAX_LEN = 1518 +pkg syscall (netbsd-amd64-cgo), const ETHER_MAX_LEN_JUMBO = 9018 +pkg syscall (netbsd-amd64-cgo), const ETHER_MIN_LEN = 64 +pkg syscall (netbsd-amd64-cgo), const ETHER_PPPOE_ENCAP_LEN = 8 +pkg syscall (netbsd-amd64-cgo), const ETHER_TYPE_LEN = 2 +pkg syscall (netbsd-amd64-cgo), const ETHER_VLAN_ENCAP_LEN = 4 +pkg syscall (netbsd-amd64-cgo), const ETIME = 92 +pkg syscall (netbsd-amd64-cgo), const ETIMEDOUT = 60 +pkg syscall (netbsd-amd64-cgo), const ETOOMANYREFS = 59 +pkg syscall (netbsd-amd64-cgo), const ETXTBSY = 26 +pkg syscall (netbsd-amd64-cgo), const EUSERS = 68 +pkg syscall (netbsd-amd64-cgo), const EVFILT_AIO = 2 +pkg syscall (netbsd-amd64-cgo), const EVFILT_PROC = 4 +pkg syscall (netbsd-amd64-cgo), const EVFILT_READ = 0 +pkg syscall (netbsd-amd64-cgo), const EVFILT_SIGNAL = 5 +pkg syscall (netbsd-amd64-cgo), const EVFILT_SYSCOUNT = 7 +pkg syscall (netbsd-amd64-cgo), const EVFILT_TIMER = 6 +pkg syscall (netbsd-amd64-cgo), const EVFILT_VNODE = 3 +pkg syscall (netbsd-amd64-cgo), const EVFILT_WRITE = 1 +pkg syscall (netbsd-amd64-cgo), const EV_ADD = 1 +pkg syscall (netbsd-amd64-cgo), const EV_CLEAR = 32 +pkg syscall (netbsd-amd64-cgo), const EV_DELETE = 2 +pkg syscall (netbsd-amd64-cgo), const EV_DISABLE = 8 +pkg syscall (netbsd-amd64-cgo), const EV_ENABLE = 4 +pkg syscall (netbsd-amd64-cgo), const EV_EOF = 32768 +pkg syscall (netbsd-amd64-cgo), const EV_ERROR = 16384 +pkg syscall (netbsd-amd64-cgo), const EV_FLAG1 = 8192 +pkg syscall (netbsd-amd64-cgo), const EV_ONESHOT = 16 +pkg syscall (netbsd-amd64-cgo), const EV_SYSFLAGS = 61440 +pkg syscall (netbsd-amd64-cgo), const EWOULDBLOCK = 35 +pkg syscall (netbsd-amd64-cgo), const EXDEV = 18 +pkg syscall (netbsd-amd64-cgo), const EXTA = 19200 +pkg syscall (netbsd-amd64-cgo), const EXTB = 38400 +pkg syscall (netbsd-amd64-cgo), const EXTPROC = 2048 +pkg syscall (netbsd-amd64-cgo), const FD_CLOEXEC = 1 +pkg syscall (netbsd-amd64-cgo), const FD_SETSIZE = 256 +pkg syscall (netbsd-amd64-cgo), const FLUSHO = 8388608 +pkg syscall (netbsd-amd64-cgo), const F_CLOSEM = 10 +pkg syscall (netbsd-amd64-cgo), const F_DUPFD = 0 +pkg syscall (netbsd-amd64-cgo), const F_DUPFD_CLOEXEC = 12 +pkg syscall (netbsd-amd64-cgo), const F_FSCTL = -2147483648 +pkg syscall (netbsd-amd64-cgo), const F_FSDIRMASK = 1879048192 +pkg syscall (netbsd-amd64-cgo), const F_FSIN = 268435456 +pkg syscall (netbsd-amd64-cgo), const F_FSINOUT = 805306368 +pkg syscall (netbsd-amd64-cgo), const F_FSOUT = 536870912 +pkg syscall (netbsd-amd64-cgo), const F_FSPRIV = 32768 +pkg syscall (netbsd-amd64-cgo), const F_FSVOID = 1073741824 +pkg syscall (netbsd-amd64-cgo), const F_GETFD = 1 +pkg syscall (netbsd-amd64-cgo), const F_GETFL = 3 +pkg syscall (netbsd-amd64-cgo), const F_GETLK = 7 +pkg syscall (netbsd-amd64-cgo), const F_GETNOSIGPIPE = 13 +pkg syscall (netbsd-amd64-cgo), const F_GETOWN = 5 +pkg syscall (netbsd-amd64-cgo), const F_MAXFD = 11 +pkg syscall (netbsd-amd64-cgo), const F_OK = 0 +pkg syscall (netbsd-amd64-cgo), const F_PARAM_MASK = 4095 +pkg syscall (netbsd-amd64-cgo), const F_PARAM_MAX = 4095 +pkg syscall (netbsd-amd64-cgo), const F_RDLCK = 1 +pkg syscall (netbsd-amd64-cgo), const F_SETFD = 2 +pkg syscall (netbsd-amd64-cgo), const F_SETFL = 4 +pkg syscall (netbsd-amd64-cgo), const F_SETLK = 8 +pkg syscall (netbsd-amd64-cgo), const F_SETLKW = 9 +pkg syscall (netbsd-amd64-cgo), const F_SETNOSIGPIPE = 14 +pkg syscall (netbsd-amd64-cgo), const F_SETOWN = 6 +pkg syscall (netbsd-amd64-cgo), const F_UNLCK = 2 +pkg syscall (netbsd-amd64-cgo), const F_WRLCK = 3 +pkg syscall (netbsd-amd64-cgo), const HUPCL = 16384 +pkg syscall (netbsd-amd64-cgo), const ICANON = 256 +pkg syscall (netbsd-amd64-cgo), const ICRNL = 256 +pkg syscall (netbsd-amd64-cgo), const IEXTEN = 1024 +pkg syscall (netbsd-amd64-cgo), const IFAN_ARRIVAL = 0 +pkg syscall (netbsd-amd64-cgo), const IFAN_DEPARTURE = 1 +pkg syscall (netbsd-amd64-cgo), const IFA_ROUTE = 1 +pkg syscall (netbsd-amd64-cgo), const IFF_ALLMULTI = 512 +pkg syscall (netbsd-amd64-cgo), const IFF_CANTCHANGE = 36690 +pkg syscall (netbsd-amd64-cgo), const IFF_DEBUG = 4 +pkg syscall (netbsd-amd64-cgo), const IFF_LINK0 = 4096 +pkg syscall (netbsd-amd64-cgo), const IFF_LINK1 = 8192 +pkg syscall (netbsd-amd64-cgo), const IFF_LINK2 = 16384 +pkg syscall (netbsd-amd64-cgo), const IFF_LOOPBACK = 8 +pkg syscall (netbsd-amd64-cgo), const IFF_MULTICAST = 32768 +pkg syscall (netbsd-amd64-cgo), const IFF_NOARP = 128 +pkg syscall (netbsd-amd64-cgo), const IFF_NOTRAILERS = 32 +pkg syscall (netbsd-amd64-cgo), const IFF_OACTIVE = 1024 +pkg syscall (netbsd-amd64-cgo), const IFF_POINTOPOINT = 16 +pkg syscall (netbsd-amd64-cgo), const IFF_PROMISC = 256 +pkg syscall (netbsd-amd64-cgo), const IFF_RUNNING = 64 +pkg syscall (netbsd-amd64-cgo), const IFF_SIMPLEX = 2048 +pkg syscall (netbsd-amd64-cgo), const IFNAMSIZ = 16 +pkg syscall (netbsd-amd64-cgo), const IFT_1822 = 2 +pkg syscall (netbsd-amd64-cgo), const IFT_A12MPPSWITCH = 130 +pkg syscall (netbsd-amd64-cgo), const IFT_AAL2 = 187 +pkg syscall (netbsd-amd64-cgo), const IFT_AAL5 = 49 +pkg syscall (netbsd-amd64-cgo), const IFT_ADSL = 94 +pkg syscall (netbsd-amd64-cgo), const IFT_AFLANE8023 = 59 +pkg syscall (netbsd-amd64-cgo), const IFT_AFLANE8025 = 60 +pkg syscall (netbsd-amd64-cgo), const IFT_ARAP = 88 +pkg syscall (netbsd-amd64-cgo), const IFT_ARCNET = 35 +pkg syscall (netbsd-amd64-cgo), const IFT_ARCNETPLUS = 36 +pkg syscall (netbsd-amd64-cgo), const IFT_ASYNC = 84 +pkg syscall (netbsd-amd64-cgo), const IFT_ATM = 37 +pkg syscall (netbsd-amd64-cgo), const IFT_ATMDXI = 105 +pkg syscall (netbsd-amd64-cgo), const IFT_ATMFUNI = 106 +pkg syscall (netbsd-amd64-cgo), const IFT_ATMIMA = 107 +pkg syscall (netbsd-amd64-cgo), const IFT_ATMLOGICAL = 80 +pkg syscall (netbsd-amd64-cgo), const IFT_ATMRADIO = 189 +pkg syscall (netbsd-amd64-cgo), const IFT_ATMSUBINTERFACE = 134 +pkg syscall (netbsd-amd64-cgo), const IFT_ATMVCIENDPT = 194 +pkg syscall (netbsd-amd64-cgo), const IFT_ATMVIRTUAL = 149 +pkg syscall (netbsd-amd64-cgo), const IFT_BGPPOLICYACCOUNTING = 162 +pkg syscall (netbsd-amd64-cgo), const IFT_BRIDGE = 209 +pkg syscall (netbsd-amd64-cgo), const IFT_BSC = 83 +pkg syscall (netbsd-amd64-cgo), const IFT_CARP = 248 +pkg syscall (netbsd-amd64-cgo), const IFT_CCTEMUL = 61 +pkg syscall (netbsd-amd64-cgo), const IFT_CEPT = 19 +pkg syscall (netbsd-amd64-cgo), const IFT_CES = 133 +pkg syscall (netbsd-amd64-cgo), const IFT_CHANNEL = 70 +pkg syscall (netbsd-amd64-cgo), const IFT_CNR = 85 +pkg syscall (netbsd-amd64-cgo), const IFT_COFFEE = 132 +pkg syscall (netbsd-amd64-cgo), const IFT_COMPOSITELINK = 155 +pkg syscall (netbsd-amd64-cgo), const IFT_DCN = 141 +pkg syscall (netbsd-amd64-cgo), const IFT_DIGITALPOWERLINE = 138 +pkg syscall (netbsd-amd64-cgo), const IFT_DIGITALWRAPPEROVERHEADCHANNEL = 186 +pkg syscall (netbsd-amd64-cgo), const IFT_DLSW = 74 +pkg syscall (netbsd-amd64-cgo), const IFT_DOCSCABLEDOWNSTREAM = 128 +pkg syscall (netbsd-amd64-cgo), const IFT_DOCSCABLEMACLAYER = 127 +pkg syscall (netbsd-amd64-cgo), const IFT_DOCSCABLEUPSTREAM = 129 +pkg syscall (netbsd-amd64-cgo), const IFT_DOCSCABLEUPSTREAMCHANNEL = 205 +pkg syscall (netbsd-amd64-cgo), const IFT_DS0 = 81 +pkg syscall (netbsd-amd64-cgo), const IFT_DS0BUNDLE = 82 +pkg syscall (netbsd-amd64-cgo), const IFT_DS1FDL = 170 +pkg syscall (netbsd-amd64-cgo), const IFT_DS3 = 30 +pkg syscall (netbsd-amd64-cgo), const IFT_DTM = 140 +pkg syscall (netbsd-amd64-cgo), const IFT_DVBASILN = 172 +pkg syscall (netbsd-amd64-cgo), const IFT_DVBASIOUT = 173 +pkg syscall (netbsd-amd64-cgo), const IFT_DVBRCCDOWNSTREAM = 147 +pkg syscall (netbsd-amd64-cgo), const IFT_DVBRCCMACLAYER = 146 +pkg syscall (netbsd-amd64-cgo), const IFT_DVBRCCUPSTREAM = 148 +pkg syscall (netbsd-amd64-cgo), const IFT_ECONET = 206 +pkg syscall (netbsd-amd64-cgo), const IFT_EON = 25 +pkg syscall (netbsd-amd64-cgo), const IFT_EPLRS = 87 +pkg syscall (netbsd-amd64-cgo), const IFT_ESCON = 73 +pkg syscall (netbsd-amd64-cgo), const IFT_ETHER = 6 +pkg syscall (netbsd-amd64-cgo), const IFT_FAITH = 242 +pkg syscall (netbsd-amd64-cgo), const IFT_FAST = 125 +pkg syscall (netbsd-amd64-cgo), const IFT_FASTETHER = 62 +pkg syscall (netbsd-amd64-cgo), const IFT_FASTETHERFX = 69 +pkg syscall (netbsd-amd64-cgo), const IFT_FDDI = 15 +pkg syscall (netbsd-amd64-cgo), const IFT_FIBRECHANNEL = 56 +pkg syscall (netbsd-amd64-cgo), const IFT_FRAMERELAYINTERCONNECT = 58 +pkg syscall (netbsd-amd64-cgo), const IFT_FRAMERELAYMPI = 92 +pkg syscall (netbsd-amd64-cgo), const IFT_FRDLCIENDPT = 193 +pkg syscall (netbsd-amd64-cgo), const IFT_FRELAY = 32 +pkg syscall (netbsd-amd64-cgo), const IFT_FRELAYDCE = 44 +pkg syscall (netbsd-amd64-cgo), const IFT_FRF16MFRBUNDLE = 163 +pkg syscall (netbsd-amd64-cgo), const IFT_FRFORWARD = 158 +pkg syscall (netbsd-amd64-cgo), const IFT_G703AT2MB = 67 +pkg syscall (netbsd-amd64-cgo), const IFT_G703AT64K = 66 +pkg syscall (netbsd-amd64-cgo), const IFT_GIF = 240 +pkg syscall (netbsd-amd64-cgo), const IFT_GIGABITETHERNET = 117 +pkg syscall (netbsd-amd64-cgo), const IFT_GR303IDT = 178 +pkg syscall (netbsd-amd64-cgo), const IFT_GR303RDT = 177 +pkg syscall (netbsd-amd64-cgo), const IFT_H323GATEKEEPER = 164 +pkg syscall (netbsd-amd64-cgo), const IFT_H323PROXY = 165 +pkg syscall (netbsd-amd64-cgo), const IFT_HDH1822 = 3 +pkg syscall (netbsd-amd64-cgo), const IFT_HDLC = 118 +pkg syscall (netbsd-amd64-cgo), const IFT_HDSL2 = 168 +pkg syscall (netbsd-amd64-cgo), const IFT_HIPERLAN2 = 183 +pkg syscall (netbsd-amd64-cgo), const IFT_HIPPI = 47 +pkg syscall (netbsd-amd64-cgo), const IFT_HIPPIINTERFACE = 57 +pkg syscall (netbsd-amd64-cgo), const IFT_HOSTPAD = 90 +pkg syscall (netbsd-amd64-cgo), const IFT_HSSI = 46 +pkg syscall (netbsd-amd64-cgo), const IFT_HY = 14 +pkg syscall (netbsd-amd64-cgo), const IFT_IBM370PARCHAN = 72 +pkg syscall (netbsd-amd64-cgo), const IFT_IDSL = 154 +pkg syscall (netbsd-amd64-cgo), const IFT_IEEE1394 = 144 +pkg syscall (netbsd-amd64-cgo), const IFT_IEEE80211 = 71 +pkg syscall (netbsd-amd64-cgo), const IFT_IEEE80212 = 55 +pkg syscall (netbsd-amd64-cgo), const IFT_IEEE8023ADLAG = 161 +pkg syscall (netbsd-amd64-cgo), const IFT_IFGSN = 145 +pkg syscall (netbsd-amd64-cgo), const IFT_IMT = 190 +pkg syscall (netbsd-amd64-cgo), const IFT_INFINIBAND = 199 +pkg syscall (netbsd-amd64-cgo), const IFT_INTERLEAVE = 124 +pkg syscall (netbsd-amd64-cgo), const IFT_IP = 126 +pkg syscall (netbsd-amd64-cgo), const IFT_IPFORWARD = 142 +pkg syscall (netbsd-amd64-cgo), const IFT_IPOVERATM = 114 +pkg syscall (netbsd-amd64-cgo), const IFT_IPOVERCDLC = 109 +pkg syscall (netbsd-amd64-cgo), const IFT_IPOVERCLAW = 110 +pkg syscall (netbsd-amd64-cgo), const IFT_IPSWITCH = 78 +pkg syscall (netbsd-amd64-cgo), const IFT_ISDN = 63 +pkg syscall (netbsd-amd64-cgo), const IFT_ISDNBASIC = 20 +pkg syscall (netbsd-amd64-cgo), const IFT_ISDNPRIMARY = 21 +pkg syscall (netbsd-amd64-cgo), const IFT_ISDNS = 75 +pkg syscall (netbsd-amd64-cgo), const IFT_ISDNU = 76 +pkg syscall (netbsd-amd64-cgo), const IFT_ISO88022LLC = 41 +pkg syscall (netbsd-amd64-cgo), const IFT_ISO88023 = 7 +pkg syscall (netbsd-amd64-cgo), const IFT_ISO88024 = 8 +pkg syscall (netbsd-amd64-cgo), const IFT_ISO88025 = 9 +pkg syscall (netbsd-amd64-cgo), const IFT_ISO88025CRFPINT = 98 +pkg syscall (netbsd-amd64-cgo), const IFT_ISO88025DTR = 86 +pkg syscall (netbsd-amd64-cgo), const IFT_ISO88025FIBER = 115 +pkg syscall (netbsd-amd64-cgo), const IFT_ISO88026 = 10 +pkg syscall (netbsd-amd64-cgo), const IFT_ISUP = 179 +pkg syscall (netbsd-amd64-cgo), const IFT_L2VLAN = 135 +pkg syscall (netbsd-amd64-cgo), const IFT_L3IPVLAN = 136 +pkg syscall (netbsd-amd64-cgo), const IFT_L3IPXVLAN = 137 +pkg syscall (netbsd-amd64-cgo), const IFT_LAPB = 16 +pkg syscall (netbsd-amd64-cgo), const IFT_LAPD = 77 +pkg syscall (netbsd-amd64-cgo), const IFT_LAPF = 119 +pkg syscall (netbsd-amd64-cgo), const IFT_LINEGROUP = 210 +pkg syscall (netbsd-amd64-cgo), const IFT_LOCALTALK = 42 +pkg syscall (netbsd-amd64-cgo), const IFT_LOOP = 24 +pkg syscall (netbsd-amd64-cgo), const IFT_MEDIAMAILOVERIP = 139 +pkg syscall (netbsd-amd64-cgo), const IFT_MFSIGLINK = 167 +pkg syscall (netbsd-amd64-cgo), const IFT_MIOX25 = 38 +pkg syscall (netbsd-amd64-cgo), const IFT_MODEM = 48 +pkg syscall (netbsd-amd64-cgo), const IFT_MPC = 113 +pkg syscall (netbsd-amd64-cgo), const IFT_MPLS = 166 +pkg syscall (netbsd-amd64-cgo), const IFT_MPLSTUNNEL = 150 +pkg syscall (netbsd-amd64-cgo), const IFT_MSDSL = 143 +pkg syscall (netbsd-amd64-cgo), const IFT_MVL = 191 +pkg syscall (netbsd-amd64-cgo), const IFT_MYRINET = 99 +pkg syscall (netbsd-amd64-cgo), const IFT_NFAS = 175 +pkg syscall (netbsd-amd64-cgo), const IFT_NSIP = 27 +pkg syscall (netbsd-amd64-cgo), const IFT_OPTICALCHANNEL = 195 +pkg syscall (netbsd-amd64-cgo), const IFT_OPTICALTRANSPORT = 196 +pkg syscall (netbsd-amd64-cgo), const IFT_OTHER = 1 +pkg syscall (netbsd-amd64-cgo), const IFT_P10 = 12 +pkg syscall (netbsd-amd64-cgo), const IFT_P80 = 13 +pkg syscall (netbsd-amd64-cgo), const IFT_PARA = 34 +pkg syscall (netbsd-amd64-cgo), const IFT_PFLOG = 245 +pkg syscall (netbsd-amd64-cgo), const IFT_PFSYNC = 246 +pkg syscall (netbsd-amd64-cgo), const IFT_PLC = 174 +pkg syscall (netbsd-amd64-cgo), const IFT_PON155 = 207 +pkg syscall (netbsd-amd64-cgo), const IFT_PON622 = 208 +pkg syscall (netbsd-amd64-cgo), const IFT_POS = 171 +pkg syscall (netbsd-amd64-cgo), const IFT_PPP = 23 +pkg syscall (netbsd-amd64-cgo), const IFT_PPPMULTILINKBUNDLE = 108 +pkg syscall (netbsd-amd64-cgo), const IFT_PROPATM = 197 +pkg syscall (netbsd-amd64-cgo), const IFT_PROPBWAP2MP = 184 +pkg syscall (netbsd-amd64-cgo), const IFT_PROPCNLS = 89 +pkg syscall (netbsd-amd64-cgo), const IFT_PROPDOCSWIRELESSDOWNSTREAM = 181 +pkg syscall (netbsd-amd64-cgo), const IFT_PROPDOCSWIRELESSMACLAYER = 180 +pkg syscall (netbsd-amd64-cgo), const IFT_PROPDOCSWIRELESSUPSTREAM = 182 +pkg syscall (netbsd-amd64-cgo), const IFT_PROPMUX = 54 +pkg syscall (netbsd-amd64-cgo), const IFT_PROPVIRTUAL = 53 +pkg syscall (netbsd-amd64-cgo), const IFT_PROPWIRELESSP2P = 157 +pkg syscall (netbsd-amd64-cgo), const IFT_PTPSERIAL = 22 +pkg syscall (netbsd-amd64-cgo), const IFT_PVC = 241 +pkg syscall (netbsd-amd64-cgo), const IFT_Q2931 = 201 +pkg syscall (netbsd-amd64-cgo), const IFT_QLLC = 68 +pkg syscall (netbsd-amd64-cgo), const IFT_RADIOMAC = 188 +pkg syscall (netbsd-amd64-cgo), const IFT_RADSL = 95 +pkg syscall (netbsd-amd64-cgo), const IFT_REACHDSL = 192 +pkg syscall (netbsd-amd64-cgo), const IFT_RFC1483 = 159 +pkg syscall (netbsd-amd64-cgo), const IFT_RS232 = 33 +pkg syscall (netbsd-amd64-cgo), const IFT_RSRB = 79 +pkg syscall (netbsd-amd64-cgo), const IFT_SDLC = 17 +pkg syscall (netbsd-amd64-cgo), const IFT_SDSL = 96 +pkg syscall (netbsd-amd64-cgo), const IFT_SHDSL = 169 +pkg syscall (netbsd-amd64-cgo), const IFT_SIP = 31 +pkg syscall (netbsd-amd64-cgo), const IFT_SIPSIG = 204 +pkg syscall (netbsd-amd64-cgo), const IFT_SIPTG = 203 +pkg syscall (netbsd-amd64-cgo), const IFT_SLIP = 28 +pkg syscall (netbsd-amd64-cgo), const IFT_SMDSDXI = 43 +pkg syscall (netbsd-amd64-cgo), const IFT_SMDSICIP = 52 +pkg syscall (netbsd-amd64-cgo), const IFT_SONET = 39 +pkg syscall (netbsd-amd64-cgo), const IFT_SONETOVERHEADCHANNEL = 185 +pkg syscall (netbsd-amd64-cgo), const IFT_SONETPATH = 50 +pkg syscall (netbsd-amd64-cgo), const IFT_SONETVT = 51 +pkg syscall (netbsd-amd64-cgo), const IFT_SRP = 151 +pkg syscall (netbsd-amd64-cgo), const IFT_SS7SIGLINK = 156 +pkg syscall (netbsd-amd64-cgo), const IFT_STACKTOSTACK = 111 +pkg syscall (netbsd-amd64-cgo), const IFT_STARLAN = 11 +pkg syscall (netbsd-amd64-cgo), const IFT_STF = 215 +pkg syscall (netbsd-amd64-cgo), const IFT_T1 = 18 +pkg syscall (netbsd-amd64-cgo), const IFT_TDLC = 116 +pkg syscall (netbsd-amd64-cgo), const IFT_TELINK = 200 +pkg syscall (netbsd-amd64-cgo), const IFT_TERMPAD = 91 +pkg syscall (netbsd-amd64-cgo), const IFT_TR008 = 176 +pkg syscall (netbsd-amd64-cgo), const IFT_TRANSPHDLC = 123 +pkg syscall (netbsd-amd64-cgo), const IFT_TUNNEL = 131 +pkg syscall (netbsd-amd64-cgo), const IFT_ULTRA = 29 +pkg syscall (netbsd-amd64-cgo), const IFT_USB = 160 +pkg syscall (netbsd-amd64-cgo), const IFT_V11 = 64 +pkg syscall (netbsd-amd64-cgo), const IFT_V35 = 45 +pkg syscall (netbsd-amd64-cgo), const IFT_V36 = 65 +pkg syscall (netbsd-amd64-cgo), const IFT_V37 = 120 +pkg syscall (netbsd-amd64-cgo), const IFT_VDSL = 97 +pkg syscall (netbsd-amd64-cgo), const IFT_VIRTUALIPADDRESS = 112 +pkg syscall (netbsd-amd64-cgo), const IFT_VIRTUALTG = 202 +pkg syscall (netbsd-amd64-cgo), const IFT_VOICEDID = 213 +pkg syscall (netbsd-amd64-cgo), const IFT_VOICEEM = 100 +pkg syscall (netbsd-amd64-cgo), const IFT_VOICEEMFGD = 211 +pkg syscall (netbsd-amd64-cgo), const IFT_VOICEENCAP = 103 +pkg syscall (netbsd-amd64-cgo), const IFT_VOICEFGDEANA = 212 +pkg syscall (netbsd-amd64-cgo), const IFT_VOICEFXO = 101 +pkg syscall (netbsd-amd64-cgo), const IFT_VOICEFXS = 102 +pkg syscall (netbsd-amd64-cgo), const IFT_VOICEOVERATM = 152 +pkg syscall (netbsd-amd64-cgo), const IFT_VOICEOVERCABLE = 198 +pkg syscall (netbsd-amd64-cgo), const IFT_VOICEOVERFRAMERELAY = 153 +pkg syscall (netbsd-amd64-cgo), const IFT_VOICEOVERIP = 104 +pkg syscall (netbsd-amd64-cgo), const IFT_X213 = 93 +pkg syscall (netbsd-amd64-cgo), const IFT_X25 = 5 +pkg syscall (netbsd-amd64-cgo), const IFT_X25DDN = 4 +pkg syscall (netbsd-amd64-cgo), const IFT_X25HUNTGROUP = 122 +pkg syscall (netbsd-amd64-cgo), const IFT_X25MLP = 121 +pkg syscall (netbsd-amd64-cgo), const IFT_X25PLE = 40 +pkg syscall (netbsd-amd64-cgo), const IFT_XETHER = 26 +pkg syscall (netbsd-amd64-cgo), const IGNBRK = 1 +pkg syscall (netbsd-amd64-cgo), const IGNCR = 128 +pkg syscall (netbsd-amd64-cgo), const IGNPAR = 4 +pkg syscall (netbsd-amd64-cgo), const IMAXBEL = 8192 +pkg syscall (netbsd-amd64-cgo), const INLCR = 64 +pkg syscall (netbsd-amd64-cgo), const INPCK = 16 +pkg syscall (netbsd-amd64-cgo), const IN_CLASSA_HOST = 16777215 +pkg syscall (netbsd-amd64-cgo), const IN_CLASSA_MAX = 128 +pkg syscall (netbsd-amd64-cgo), const IN_CLASSA_NET = 4278190080 +pkg syscall (netbsd-amd64-cgo), const IN_CLASSA_NSHIFT = 24 +pkg syscall (netbsd-amd64-cgo), const IN_CLASSB_HOST = 65535 +pkg syscall (netbsd-amd64-cgo), const IN_CLASSB_MAX = 65536 +pkg syscall (netbsd-amd64-cgo), const IN_CLASSB_NET = 4294901760 +pkg syscall (netbsd-amd64-cgo), const IN_CLASSB_NSHIFT = 16 +pkg syscall (netbsd-amd64-cgo), const IN_CLASSC_HOST = 255 +pkg syscall (netbsd-amd64-cgo), const IN_CLASSC_NET = 4294967040 +pkg syscall (netbsd-amd64-cgo), const IN_CLASSC_NSHIFT = 8 +pkg syscall (netbsd-amd64-cgo), const IN_CLASSD_HOST = 268435455 +pkg syscall (netbsd-amd64-cgo), const IN_CLASSD_NET = 4026531840 +pkg syscall (netbsd-amd64-cgo), const IN_CLASSD_NSHIFT = 28 +pkg syscall (netbsd-amd64-cgo), const IN_LOOPBACKNET = 127 +pkg syscall (netbsd-amd64-cgo), const IPPROTO_AH = 51 +pkg syscall (netbsd-amd64-cgo), const IPPROTO_CARP = 112 +pkg syscall (netbsd-amd64-cgo), const IPPROTO_DONE = 257 +pkg syscall (netbsd-amd64-cgo), const IPPROTO_DSTOPTS = 60 +pkg syscall (netbsd-amd64-cgo), const IPPROTO_EGP = 8 +pkg syscall (netbsd-amd64-cgo), const IPPROTO_ENCAP = 98 +pkg syscall (netbsd-amd64-cgo), const IPPROTO_EON = 80 +pkg syscall (netbsd-amd64-cgo), const IPPROTO_ESP = 50 +pkg syscall (netbsd-amd64-cgo), const IPPROTO_ETHERIP = 97 +pkg syscall (netbsd-amd64-cgo), const IPPROTO_FRAGMENT = 44 +pkg syscall (netbsd-amd64-cgo), const IPPROTO_GGP = 3 +pkg syscall (netbsd-amd64-cgo), const IPPROTO_GRE = 47 +pkg syscall (netbsd-amd64-cgo), const IPPROTO_HOPOPTS = 0 +pkg syscall (netbsd-amd64-cgo), const IPPROTO_ICMP = 1 +pkg syscall (netbsd-amd64-cgo), const IPPROTO_ICMPV6 = 58 +pkg syscall (netbsd-amd64-cgo), const IPPROTO_IDP = 22 +pkg syscall (netbsd-amd64-cgo), const IPPROTO_IGMP = 2 +pkg syscall (netbsd-amd64-cgo), const IPPROTO_IPCOMP = 108 +pkg syscall (netbsd-amd64-cgo), const IPPROTO_IPIP = 4 +pkg syscall (netbsd-amd64-cgo), const IPPROTO_IPV4 = 4 +pkg syscall (netbsd-amd64-cgo), const IPPROTO_IPV6_ICMP = 58 +pkg syscall (netbsd-amd64-cgo), const IPPROTO_MAX = 256 +pkg syscall (netbsd-amd64-cgo), const IPPROTO_MAXID = 52 +pkg syscall (netbsd-amd64-cgo), const IPPROTO_MOBILE = 55 +pkg syscall (netbsd-amd64-cgo), const IPPROTO_NONE = 59 +pkg syscall (netbsd-amd64-cgo), const IPPROTO_PFSYNC = 240 +pkg syscall (netbsd-amd64-cgo), const IPPROTO_PIM = 103 +pkg syscall (netbsd-amd64-cgo), const IPPROTO_PUP = 12 +pkg syscall (netbsd-amd64-cgo), const IPPROTO_RAW = 255 +pkg syscall (netbsd-amd64-cgo), const IPPROTO_ROUTING = 43 +pkg syscall (netbsd-amd64-cgo), const IPPROTO_RSVP = 46 +pkg syscall (netbsd-amd64-cgo), const IPPROTO_TP = 29 +pkg syscall (netbsd-amd64-cgo), const IPPROTO_VRRP = 112 +pkg syscall (netbsd-amd64-cgo), const IPV6_CHECKSUM = 26 +pkg syscall (netbsd-amd64-cgo), const IPV6_DEFAULT_MULTICAST_HOPS = 1 +pkg syscall (netbsd-amd64-cgo), const IPV6_DEFAULT_MULTICAST_LOOP = 1 +pkg syscall (netbsd-amd64-cgo), const IPV6_DEFHLIM = 64 +pkg syscall (netbsd-amd64-cgo), const IPV6_DONTFRAG = 62 +pkg syscall (netbsd-amd64-cgo), const IPV6_DSTOPTS = 50 +pkg syscall (netbsd-amd64-cgo), const IPV6_FAITH = 29 +pkg syscall (netbsd-amd64-cgo), const IPV6_FLOWINFO_MASK = 4294967055 +pkg syscall (netbsd-amd64-cgo), const IPV6_FLOWLABEL_MASK = 4294905600 +pkg syscall (netbsd-amd64-cgo), const IPV6_FRAGTTL = 120 +pkg syscall (netbsd-amd64-cgo), const IPV6_HLIMDEC = 1 +pkg syscall (netbsd-amd64-cgo), const IPV6_HOPLIMIT = 47 +pkg syscall (netbsd-amd64-cgo), const IPV6_HOPOPTS = 49 +pkg syscall (netbsd-amd64-cgo), const IPV6_IPSEC_POLICY = 28 +pkg syscall (netbsd-amd64-cgo), const IPV6_JOIN_GROUP = 12 +pkg syscall (netbsd-amd64-cgo), const IPV6_LEAVE_GROUP = 13 +pkg syscall (netbsd-amd64-cgo), const IPV6_MAXHLIM = 255 +pkg syscall (netbsd-amd64-cgo), const IPV6_MAXPACKET = 65535 +pkg syscall (netbsd-amd64-cgo), const IPV6_MMTU = 1280 +pkg syscall (netbsd-amd64-cgo), const IPV6_MULTICAST_HOPS = 10 +pkg syscall (netbsd-amd64-cgo), const IPV6_MULTICAST_IF = 9 +pkg syscall (netbsd-amd64-cgo), const IPV6_MULTICAST_LOOP = 11 +pkg syscall (netbsd-amd64-cgo), const IPV6_NEXTHOP = 48 +pkg syscall (netbsd-amd64-cgo), const IPV6_PATHMTU = 44 +pkg syscall (netbsd-amd64-cgo), const IPV6_PKTINFO = 46 +pkg syscall (netbsd-amd64-cgo), const IPV6_PORTRANGE = 14 +pkg syscall (netbsd-amd64-cgo), const IPV6_PORTRANGE_DEFAULT = 0 +pkg syscall (netbsd-amd64-cgo), const IPV6_PORTRANGE_HIGH = 1 +pkg syscall (netbsd-amd64-cgo), const IPV6_PORTRANGE_LOW = 2 +pkg syscall (netbsd-amd64-cgo), const IPV6_RECVDSTOPTS = 40 +pkg syscall (netbsd-amd64-cgo), const IPV6_RECVHOPLIMIT = 37 +pkg syscall (netbsd-amd64-cgo), const IPV6_RECVHOPOPTS = 39 +pkg syscall (netbsd-amd64-cgo), const IPV6_RECVPATHMTU = 43 +pkg syscall (netbsd-amd64-cgo), const IPV6_RECVPKTINFO = 36 +pkg syscall (netbsd-amd64-cgo), const IPV6_RECVRTHDR = 38 +pkg syscall (netbsd-amd64-cgo), const IPV6_RECVTCLASS = 57 +pkg syscall (netbsd-amd64-cgo), const IPV6_RTHDR = 51 +pkg syscall (netbsd-amd64-cgo), const IPV6_RTHDRDSTOPTS = 35 +pkg syscall (netbsd-amd64-cgo), const IPV6_RTHDR_LOOSE = 0 +pkg syscall (netbsd-amd64-cgo), const IPV6_RTHDR_STRICT = 1 +pkg syscall (netbsd-amd64-cgo), const IPV6_RTHDR_TYPE_0 = 0 +pkg syscall (netbsd-amd64-cgo), const IPV6_SOCKOPT_RESERVED1 = 3 +pkg syscall (netbsd-amd64-cgo), const IPV6_TCLASS = 61 +pkg syscall (netbsd-amd64-cgo), const IPV6_UNICAST_HOPS = 4 +pkg syscall (netbsd-amd64-cgo), const IPV6_USE_MIN_MTU = 42 +pkg syscall (netbsd-amd64-cgo), const IPV6_V6ONLY = 27 +pkg syscall (netbsd-amd64-cgo), const IPV6_VERSION = 96 +pkg syscall (netbsd-amd64-cgo), const IPV6_VERSION_MASK = 240 +pkg syscall (netbsd-amd64-cgo), const IP_ADD_MEMBERSHIP = 12 +pkg syscall (netbsd-amd64-cgo), const IP_DEFAULT_MULTICAST_LOOP = 1 +pkg syscall (netbsd-amd64-cgo), const IP_DEFAULT_MULTICAST_TTL = 1 +pkg syscall (netbsd-amd64-cgo), const IP_DF = 16384 +pkg syscall (netbsd-amd64-cgo), const IP_DROP_MEMBERSHIP = 13 +pkg syscall (netbsd-amd64-cgo), const IP_EF = 32768 +pkg syscall (netbsd-amd64-cgo), const IP_ERRORMTU = 21 +pkg syscall (netbsd-amd64-cgo), const IP_HDRINCL = 2 +pkg syscall (netbsd-amd64-cgo), const IP_IPSEC_POLICY = 22 +pkg syscall (netbsd-amd64-cgo), const IP_MAXPACKET = 65535 +pkg syscall (netbsd-amd64-cgo), const IP_MAX_MEMBERSHIPS = 20 +pkg syscall (netbsd-amd64-cgo), const IP_MF = 8192 +pkg syscall (netbsd-amd64-cgo), const IP_MINFRAGSIZE = 69 +pkg syscall (netbsd-amd64-cgo), const IP_MINTTL = 24 +pkg syscall (netbsd-amd64-cgo), const IP_MSS = 576 +pkg syscall (netbsd-amd64-cgo), const IP_MULTICAST_IF = 9 +pkg syscall (netbsd-amd64-cgo), const IP_MULTICAST_LOOP = 11 +pkg syscall (netbsd-amd64-cgo), const IP_MULTICAST_TTL = 10 +pkg syscall (netbsd-amd64-cgo), const IP_OFFMASK = 8191 +pkg syscall (netbsd-amd64-cgo), const IP_OPTIONS = 1 +pkg syscall (netbsd-amd64-cgo), const IP_PORTRANGE = 19 +pkg syscall (netbsd-amd64-cgo), const IP_PORTRANGE_DEFAULT = 0 +pkg syscall (netbsd-amd64-cgo), const IP_PORTRANGE_HIGH = 1 +pkg syscall (netbsd-amd64-cgo), const IP_PORTRANGE_LOW = 2 +pkg syscall (netbsd-amd64-cgo), const IP_RECVDSTADDR = 7 +pkg syscall (netbsd-amd64-cgo), const IP_RECVIF = 20 +pkg syscall (netbsd-amd64-cgo), const IP_RECVOPTS = 5 +pkg syscall (netbsd-amd64-cgo), const IP_RECVRETOPTS = 6 +pkg syscall (netbsd-amd64-cgo), const IP_RECVTTL = 23 +pkg syscall (netbsd-amd64-cgo), const IP_RETOPTS = 8 +pkg syscall (netbsd-amd64-cgo), const IP_RF = 32768 +pkg syscall (netbsd-amd64-cgo), const IP_TOS = 3 +pkg syscall (netbsd-amd64-cgo), const IP_TTL = 4 +pkg syscall (netbsd-amd64-cgo), const ISIG = 128 +pkg syscall (netbsd-amd64-cgo), const ISTRIP = 32 +pkg syscall (netbsd-amd64-cgo), const IXANY = 2048 +pkg syscall (netbsd-amd64-cgo), const IXOFF = 1024 +pkg syscall (netbsd-amd64-cgo), const IXON = 512 +pkg syscall (netbsd-amd64-cgo), const ImplementsGetwd = false +pkg syscall (netbsd-amd64-cgo), const LOCK_EX = 2 +pkg syscall (netbsd-amd64-cgo), const LOCK_NB = 4 +pkg syscall (netbsd-amd64-cgo), const LOCK_SH = 1 +pkg syscall (netbsd-amd64-cgo), const LOCK_UN = 8 +pkg syscall (netbsd-amd64-cgo), const MSG_BCAST = 256 +pkg syscall (netbsd-amd64-cgo), const MSG_CMSG_CLOEXEC = 2048 +pkg syscall (netbsd-amd64-cgo), const MSG_CONTROLMBUF = 33554432 +pkg syscall (netbsd-amd64-cgo), const MSG_CTRUNC = 32 +pkg syscall (netbsd-amd64-cgo), const MSG_DONTROUTE = 4 +pkg syscall (netbsd-amd64-cgo), const MSG_DONTWAIT = 128 +pkg syscall (netbsd-amd64-cgo), const MSG_EOR = 8 +pkg syscall (netbsd-amd64-cgo), const MSG_IOVUSRSPACE = 67108864 +pkg syscall (netbsd-amd64-cgo), const MSG_LENUSRSPACE = 134217728 +pkg syscall (netbsd-amd64-cgo), const MSG_MCAST = 512 +pkg syscall (netbsd-amd64-cgo), const MSG_NAMEMBUF = 16777216 +pkg syscall (netbsd-amd64-cgo), const MSG_NBIO = 4096 +pkg syscall (netbsd-amd64-cgo), const MSG_NOSIGNAL = 1024 +pkg syscall (netbsd-amd64-cgo), const MSG_OOB = 1 +pkg syscall (netbsd-amd64-cgo), const MSG_PEEK = 2 +pkg syscall (netbsd-amd64-cgo), const MSG_TRUNC = 16 +pkg syscall (netbsd-amd64-cgo), const MSG_USERFLAGS = 16777215 +pkg syscall (netbsd-amd64-cgo), const MSG_WAITALL = 64 +pkg syscall (netbsd-amd64-cgo), const NAME_MAX = 511 +pkg syscall (netbsd-amd64-cgo), const NET_RT_DUMP = 1 +pkg syscall (netbsd-amd64-cgo), const NET_RT_FLAGS = 2 +pkg syscall (netbsd-amd64-cgo), const NET_RT_IFLIST = 5 +pkg syscall (netbsd-amd64-cgo), const NET_RT_MAXID = 6 +pkg syscall (netbsd-amd64-cgo), const NET_RT_OIFLIST = 4 +pkg syscall (netbsd-amd64-cgo), const NET_RT_OOIFLIST = 3 +pkg syscall (netbsd-amd64-cgo), const NOFLSH = 2147483648 +pkg syscall (netbsd-amd64-cgo), const NOTE_ATTRIB = 8 +pkg syscall (netbsd-amd64-cgo), const NOTE_CHILD = 4 +pkg syscall (netbsd-amd64-cgo), const NOTE_DELETE = 1 +pkg syscall (netbsd-amd64-cgo), const NOTE_EXEC = 536870912 +pkg syscall (netbsd-amd64-cgo), const NOTE_EXIT = 2147483648 +pkg syscall (netbsd-amd64-cgo), const NOTE_EXTEND = 4 +pkg syscall (netbsd-amd64-cgo), const NOTE_FORK = 1073741824 +pkg syscall (netbsd-amd64-cgo), const NOTE_LINK = 16 +pkg syscall (netbsd-amd64-cgo), const NOTE_LOWAT = 1 +pkg syscall (netbsd-amd64-cgo), const NOTE_PCTRLMASK = 4026531840 +pkg syscall (netbsd-amd64-cgo), const NOTE_PDATAMASK = 1048575 +pkg syscall (netbsd-amd64-cgo), const NOTE_RENAME = 32 +pkg syscall (netbsd-amd64-cgo), const NOTE_REVOKE = 64 +pkg syscall (netbsd-amd64-cgo), const NOTE_TRACK = 1 +pkg syscall (netbsd-amd64-cgo), const NOTE_TRACKERR = 2 +pkg syscall (netbsd-amd64-cgo), const NOTE_WRITE = 2 +pkg syscall (netbsd-amd64-cgo), const OCRNL = 16 +pkg syscall (netbsd-amd64-cgo), const OFIOGETBMAP = 3221513850 +pkg syscall (netbsd-amd64-cgo), const ONLCR = 2 +pkg syscall (netbsd-amd64-cgo), const ONLRET = 64 +pkg syscall (netbsd-amd64-cgo), const ONOCR = 32 +pkg syscall (netbsd-amd64-cgo), const ONOEOT = 8 +pkg syscall (netbsd-amd64-cgo), const OPOST = 1 +pkg syscall (netbsd-amd64-cgo), const O_ACCMODE = 3 +pkg syscall (netbsd-amd64-cgo), const O_ALT_IO = 262144 +pkg syscall (netbsd-amd64-cgo), const O_APPEND = 8 +pkg syscall (netbsd-amd64-cgo), const O_ASYNC = 64 +pkg syscall (netbsd-amd64-cgo), const O_CLOEXEC = 4194304 +pkg syscall (netbsd-amd64-cgo), const O_CREAT = 512 +pkg syscall (netbsd-amd64-cgo), const O_DIRECT = 524288 +pkg syscall (netbsd-amd64-cgo), const O_DIRECTORY = 2097152 +pkg syscall (netbsd-amd64-cgo), const O_DSYNC = 65536 +pkg syscall (netbsd-amd64-cgo), const O_EXCL = 2048 +pkg syscall (netbsd-amd64-cgo), const O_EXLOCK = 32 +pkg syscall (netbsd-amd64-cgo), const O_FSYNC = 128 +pkg syscall (netbsd-amd64-cgo), const O_NDELAY = 4 +pkg syscall (netbsd-amd64-cgo), const O_NOCTTY = 32768 +pkg syscall (netbsd-amd64-cgo), const O_NOFOLLOW = 256 +pkg syscall (netbsd-amd64-cgo), const O_NONBLOCK = 4 +pkg syscall (netbsd-amd64-cgo), const O_NOSIGPIPE = 16777216 +pkg syscall (netbsd-amd64-cgo), const O_RSYNC = 131072 +pkg syscall (netbsd-amd64-cgo), const O_SHLOCK = 16 +pkg syscall (netbsd-amd64-cgo), const O_SYNC = 128 +pkg syscall (netbsd-amd64-cgo), const O_TRUNC = 1024 +pkg syscall (netbsd-amd64-cgo), const PARENB = 4096 +pkg syscall (netbsd-amd64-cgo), const PARMRK = 8 +pkg syscall (netbsd-amd64-cgo), const PARODD = 8192 +pkg syscall (netbsd-amd64-cgo), const PENDIN = 536870912 +pkg syscall (netbsd-amd64-cgo), const PRI_IOFLUSH = 124 +pkg syscall (netbsd-amd64-cgo), const PTRACE_CONT = 7 +pkg syscall (netbsd-amd64-cgo), const PTRACE_KILL = 8 +pkg syscall (netbsd-amd64-cgo), const PTRACE_TRACEME = 0 +pkg syscall (netbsd-amd64-cgo), const RLIMIT_AS = 10 +pkg syscall (netbsd-amd64-cgo), const RLIMIT_CORE = 4 +pkg syscall (netbsd-amd64-cgo), const RLIMIT_CPU = 0 +pkg syscall (netbsd-amd64-cgo), const RLIMIT_DATA = 2 +pkg syscall (netbsd-amd64-cgo), const RLIMIT_FSIZE = 1 +pkg syscall (netbsd-amd64-cgo), const RLIMIT_NOFILE = 8 +pkg syscall (netbsd-amd64-cgo), const RLIMIT_STACK = 3 +pkg syscall (netbsd-amd64-cgo), const RLIM_INFINITY = 9223372036854775807 +pkg syscall (netbsd-amd64-cgo), const RTAX_AUTHOR = 6 +pkg syscall (netbsd-amd64-cgo), const RTAX_BRD = 7 +pkg syscall (netbsd-amd64-cgo), const RTAX_DST = 0 +pkg syscall (netbsd-amd64-cgo), const RTAX_GATEWAY = 1 +pkg syscall (netbsd-amd64-cgo), const RTAX_GENMASK = 3 +pkg syscall (netbsd-amd64-cgo), const RTAX_IFA = 5 +pkg syscall (netbsd-amd64-cgo), const RTAX_IFP = 4 +pkg syscall (netbsd-amd64-cgo), const RTAX_MAX = 9 +pkg syscall (netbsd-amd64-cgo), const RTAX_NETMASK = 2 +pkg syscall (netbsd-amd64-cgo), const RTAX_TAG = 8 +pkg syscall (netbsd-amd64-cgo), const RTA_AUTHOR = 64 +pkg syscall (netbsd-amd64-cgo), const RTA_BRD = 128 +pkg syscall (netbsd-amd64-cgo), const RTA_DST = 1 +pkg syscall (netbsd-amd64-cgo), const RTA_GATEWAY = 2 +pkg syscall (netbsd-amd64-cgo), const RTA_GENMASK = 8 +pkg syscall (netbsd-amd64-cgo), const RTA_IFA = 32 +pkg syscall (netbsd-amd64-cgo), const RTA_IFP = 16 +pkg syscall (netbsd-amd64-cgo), const RTA_NETMASK = 4 +pkg syscall (netbsd-amd64-cgo), const RTA_TAG = 256 +pkg syscall (netbsd-amd64-cgo), const RTF_ANNOUNCE = 131072 +pkg syscall (netbsd-amd64-cgo), const RTF_BLACKHOLE = 4096 +pkg syscall (netbsd-amd64-cgo), const RTF_CLONED = 8192 +pkg syscall (netbsd-amd64-cgo), const RTF_CLONING = 256 +pkg syscall (netbsd-amd64-cgo), const RTF_DONE = 64 +pkg syscall (netbsd-amd64-cgo), const RTF_DYNAMIC = 16 +pkg syscall (netbsd-amd64-cgo), const RTF_GATEWAY = 2 +pkg syscall (netbsd-amd64-cgo), const RTF_HOST = 4 +pkg syscall (netbsd-amd64-cgo), const RTF_LLINFO = 1024 +pkg syscall (netbsd-amd64-cgo), const RTF_MASK = 128 +pkg syscall (netbsd-amd64-cgo), const RTF_MODIFIED = 32 +pkg syscall (netbsd-amd64-cgo), const RTF_PROTO1 = 32768 +pkg syscall (netbsd-amd64-cgo), const RTF_PROTO2 = 16384 +pkg syscall (netbsd-amd64-cgo), const RTF_REJECT = 8 +pkg syscall (netbsd-amd64-cgo), const RTF_SRC = 65536 +pkg syscall (netbsd-amd64-cgo), const RTF_STATIC = 2048 +pkg syscall (netbsd-amd64-cgo), const RTF_UP = 1 +pkg syscall (netbsd-amd64-cgo), const RTF_XRESOLVE = 512 +pkg syscall (netbsd-amd64-cgo), const RTM_ADD = 1 +pkg syscall (netbsd-amd64-cgo), const RTM_CHANGE = 3 +pkg syscall (netbsd-amd64-cgo), const RTM_CHGADDR = 21 +pkg syscall (netbsd-amd64-cgo), const RTM_DELADDR = 13 +pkg syscall (netbsd-amd64-cgo), const RTM_DELETE = 2 +pkg syscall (netbsd-amd64-cgo), const RTM_GET = 4 +pkg syscall (netbsd-amd64-cgo), const RTM_IEEE80211 = 17 +pkg syscall (netbsd-amd64-cgo), const RTM_IFANNOUNCE = 16 +pkg syscall (netbsd-amd64-cgo), const RTM_IFINFO = 20 +pkg syscall (netbsd-amd64-cgo), const RTM_LLINFO_UPD = 19 +pkg syscall (netbsd-amd64-cgo), const RTM_LOCK = 8 +pkg syscall (netbsd-amd64-cgo), const RTM_LOSING = 5 +pkg syscall (netbsd-amd64-cgo), const RTM_MISS = 7 +pkg syscall (netbsd-amd64-cgo), const RTM_NEWADDR = 12 +pkg syscall (netbsd-amd64-cgo), const RTM_OIFINFO = 15 +pkg syscall (netbsd-amd64-cgo), const RTM_OLDADD = 9 +pkg syscall (netbsd-amd64-cgo), const RTM_OLDDEL = 10 +pkg syscall (netbsd-amd64-cgo), const RTM_OOIFINFO = 14 +pkg syscall (netbsd-amd64-cgo), const RTM_REDIRECT = 6 +pkg syscall (netbsd-amd64-cgo), const RTM_RESOLVE = 11 +pkg syscall (netbsd-amd64-cgo), const RTM_RTTUNIT = 1000000 +pkg syscall (netbsd-amd64-cgo), const RTM_SETGATE = 18 +pkg syscall (netbsd-amd64-cgo), const RTM_VERSION = 4 +pkg syscall (netbsd-amd64-cgo), const RTV_EXPIRE = 4 +pkg syscall (netbsd-amd64-cgo), const RTV_HOPCOUNT = 2 +pkg syscall (netbsd-amd64-cgo), const RTV_MTU = 1 +pkg syscall (netbsd-amd64-cgo), const RTV_RPIPE = 8 +pkg syscall (netbsd-amd64-cgo), const RTV_RTT = 64 +pkg syscall (netbsd-amd64-cgo), const RTV_RTTVAR = 128 +pkg syscall (netbsd-amd64-cgo), const RTV_SPIPE = 16 +pkg syscall (netbsd-amd64-cgo), const RTV_SSTHRESH = 32 +pkg syscall (netbsd-amd64-cgo), const RUSAGE_CHILDREN = -1 +pkg syscall (netbsd-amd64-cgo), const RUSAGE_SELF = 0 +pkg syscall (netbsd-amd64-cgo), const SCM_CREDS = 4 +pkg syscall (netbsd-amd64-cgo), const SCM_RIGHTS = 1 +pkg syscall (netbsd-amd64-cgo), const SCM_TIMESTAMP = 8 +pkg syscall (netbsd-amd64-cgo), const SIGBUS = 10 +pkg syscall (netbsd-amd64-cgo), const SIGCHLD = 20 +pkg syscall (netbsd-amd64-cgo), const SIGCONT = 19 +pkg syscall (netbsd-amd64-cgo), const SIGEMT = 7 +pkg syscall (netbsd-amd64-cgo), const SIGINFO = 29 +pkg syscall (netbsd-amd64-cgo), const SIGIO = 23 +pkg syscall (netbsd-amd64-cgo), const SIGIOT = 6 +pkg syscall (netbsd-amd64-cgo), const SIGPROF = 27 +pkg syscall (netbsd-amd64-cgo), const SIGPWR = 32 +pkg syscall (netbsd-amd64-cgo), const SIGSTOP = 17 +pkg syscall (netbsd-amd64-cgo), const SIGSYS = 12 +pkg syscall (netbsd-amd64-cgo), const SIGTSTP = 18 +pkg syscall (netbsd-amd64-cgo), const SIGTTIN = 21 +pkg syscall (netbsd-amd64-cgo), const SIGTTOU = 22 +pkg syscall (netbsd-amd64-cgo), const SIGURG = 16 +pkg syscall (netbsd-amd64-cgo), const SIGUSR1 = 30 +pkg syscall (netbsd-amd64-cgo), const SIGUSR2 = 31 +pkg syscall (netbsd-amd64-cgo), const SIGVTALRM = 26 +pkg syscall (netbsd-amd64-cgo), const SIGWINCH = 28 +pkg syscall (netbsd-amd64-cgo), const SIGXCPU = 24 +pkg syscall (netbsd-amd64-cgo), const SIGXFSZ = 25 +pkg syscall (netbsd-amd64-cgo), const SIOCADDMULTI = 2156947761 +pkg syscall (netbsd-amd64-cgo), const SIOCADDRT = 2151182858 +pkg syscall (netbsd-amd64-cgo), const SIOCAIFADDR = 2151704858 +pkg syscall (netbsd-amd64-cgo), const SIOCALIFADDR = 2165860636 +pkg syscall (netbsd-amd64-cgo), const SIOCATMARK = 1074033415 +pkg syscall (netbsd-amd64-cgo), const SIOCDELMULTI = 2156947762 +pkg syscall (netbsd-amd64-cgo), const SIOCDELRT = 2151182859 +pkg syscall (netbsd-amd64-cgo), const SIOCDIFADDR = 2156947737 +pkg syscall (netbsd-amd64-cgo), const SIOCDIFPHYADDR = 2156947785 +pkg syscall (netbsd-amd64-cgo), const SIOCDLIFADDR = 2165860638 +pkg syscall (netbsd-amd64-cgo), const SIOCGDRVSPEC = 3223873915 +pkg syscall (netbsd-amd64-cgo), const SIOCGETPFSYNC = 3230689784 +pkg syscall (netbsd-amd64-cgo), const SIOCGETSGCNT = 3223352628 +pkg syscall (netbsd-amd64-cgo), const SIOCGETVIFCNT = 3223876915 +pkg syscall (netbsd-amd64-cgo), const SIOCGHIWAT = 1074033409 +pkg syscall (netbsd-amd64-cgo), const SIOCGIFADDR = 3230689569 +pkg syscall (netbsd-amd64-cgo), const SIOCGIFADDRPREF = 3231213856 +pkg syscall (netbsd-amd64-cgo), const SIOCGIFALIAS = 3225446683 +pkg syscall (netbsd-amd64-cgo), const SIOCGIFBRDADDR = 3230689571 +pkg syscall (netbsd-amd64-cgo), const SIOCGIFCAP = 3223349622 +pkg syscall (netbsd-amd64-cgo), const SIOCGIFCONF = 3222300966 +pkg syscall (netbsd-amd64-cgo), const SIOCGIFDATA = 3231213957 +pkg syscall (netbsd-amd64-cgo), const SIOCGIFDLT = 3230689655 +pkg syscall (netbsd-amd64-cgo), const SIOCGIFDSTADDR = 3230689570 +pkg syscall (netbsd-amd64-cgo), const SIOCGIFFLAGS = 3230689553 +pkg syscall (netbsd-amd64-cgo), const SIOCGIFGENERIC = 3230689594 +pkg syscall (netbsd-amd64-cgo), const SIOCGIFMEDIA = 3224398134 +pkg syscall (netbsd-amd64-cgo), const SIOCGIFMETRIC = 3230689559 +pkg syscall (netbsd-amd64-cgo), const SIOCGIFMTU = 3230689662 +pkg syscall (netbsd-amd64-cgo), const SIOCGIFNETMASK = 3230689573 +pkg syscall (netbsd-amd64-cgo), const SIOCGIFPDSTADDR = 3230689608 +pkg syscall (netbsd-amd64-cgo), const SIOCGIFPSRCADDR = 3230689607 +pkg syscall (netbsd-amd64-cgo), const SIOCGLIFADDR = 3239602461 +pkg syscall (netbsd-amd64-cgo), const SIOCGLIFPHYADDR = 3239602507 +pkg syscall (netbsd-amd64-cgo), const SIOCGLINKSTR = 3223873927 +pkg syscall (netbsd-amd64-cgo), const SIOCGLOWAT = 1074033411 +pkg syscall (netbsd-amd64-cgo), const SIOCGPGRP = 1074033417 +pkg syscall (netbsd-amd64-cgo), const SIOCGVH = 3230689667 +pkg syscall (netbsd-amd64-cgo), const SIOCIFCREATE = 2156947834 +pkg syscall (netbsd-amd64-cgo), const SIOCIFDESTROY = 2156947833 +pkg syscall (netbsd-amd64-cgo), const SIOCIFGCLONERS = 3222301048 +pkg syscall (netbsd-amd64-cgo), const SIOCINITIFADDR = 3228592516 +pkg syscall (netbsd-amd64-cgo), const SIOCSDRVSPEC = 2150132091 +pkg syscall (netbsd-amd64-cgo), const SIOCSETPFSYNC = 2156947959 +pkg syscall (netbsd-amd64-cgo), const SIOCSHIWAT = 2147775232 +pkg syscall (netbsd-amd64-cgo), const SIOCSIFADDR = 2156947724 +pkg syscall (netbsd-amd64-cgo), const SIOCSIFADDRPREF = 2157472031 +pkg syscall (netbsd-amd64-cgo), const SIOCSIFBRDADDR = 2156947731 +pkg syscall (netbsd-amd64-cgo), const SIOCSIFCAP = 2149607797 +pkg syscall (netbsd-amd64-cgo), const SIOCSIFDSTADDR = 2156947726 +pkg syscall (netbsd-amd64-cgo), const SIOCSIFFLAGS = 2156947728 +pkg syscall (netbsd-amd64-cgo), const SIOCSIFGENERIC = 2156947769 +pkg syscall (netbsd-amd64-cgo), const SIOCSIFMEDIA = 3230689589 +pkg syscall (netbsd-amd64-cgo), const SIOCSIFMETRIC = 2156947736 +pkg syscall (netbsd-amd64-cgo), const SIOCSIFMTU = 2156947839 +pkg syscall (netbsd-amd64-cgo), const SIOCSIFNETMASK = 2156947734 +pkg syscall (netbsd-amd64-cgo), const SIOCSIFPHYADDR = 2151704902 +pkg syscall (netbsd-amd64-cgo), const SIOCSLIFPHYADDR = 2165860682 +pkg syscall (netbsd-amd64-cgo), const SIOCSLINKSTR = 2150132104 +pkg syscall (netbsd-amd64-cgo), const SIOCSLOWAT = 2147775234 +pkg syscall (netbsd-amd64-cgo), const SIOCSPGRP = 2147775240 +pkg syscall (netbsd-amd64-cgo), const SIOCSVH = 3230689666 +pkg syscall (netbsd-amd64-cgo), const SIOCZIFDATA = 3231213958 +pkg syscall (netbsd-amd64-cgo), const SOCK_CLOEXEC = 268435456 +pkg syscall (netbsd-amd64-cgo), const SOCK_FLAGS_MASK = 4026531840 +pkg syscall (netbsd-amd64-cgo), const SOCK_NONBLOCK = 536870912 +pkg syscall (netbsd-amd64-cgo), const SOCK_NOSIGPIPE = 1073741824 +pkg syscall (netbsd-amd64-cgo), const SOCK_RDM = 4 +pkg syscall (netbsd-amd64-cgo), const SOL_SOCKET = 65535 +pkg syscall (netbsd-amd64-cgo), const SOMAXCONN = 128 +pkg syscall (netbsd-amd64-cgo), const SO_ACCEPTCONN = 2 +pkg syscall (netbsd-amd64-cgo), const SO_ACCEPTFILTER = 4096 +pkg syscall (netbsd-amd64-cgo), const SO_BROADCAST = 32 +pkg syscall (netbsd-amd64-cgo), const SO_DEBUG = 1 +pkg syscall (netbsd-amd64-cgo), const SO_DONTROUTE = 16 +pkg syscall (netbsd-amd64-cgo), const SO_ERROR = 4103 +pkg syscall (netbsd-amd64-cgo), const SO_KEEPALIVE = 8 +pkg syscall (netbsd-amd64-cgo), const SO_LINGER = 128 +pkg syscall (netbsd-amd64-cgo), const SO_NOHEADER = 4106 +pkg syscall (netbsd-amd64-cgo), const SO_NOSIGPIPE = 2048 +pkg syscall (netbsd-amd64-cgo), const SO_OOBINLINE = 256 +pkg syscall (netbsd-amd64-cgo), const SO_OVERFLOWED = 4105 +pkg syscall (netbsd-amd64-cgo), const SO_RCVBUF = 4098 +pkg syscall (netbsd-amd64-cgo), const SO_RCVLOWAT = 4100 +pkg syscall (netbsd-amd64-cgo), const SO_RCVTIMEO = 4108 +pkg syscall (netbsd-amd64-cgo), const SO_REUSEADDR = 4 +pkg syscall (netbsd-amd64-cgo), const SO_REUSEPORT = 512 +pkg syscall (netbsd-amd64-cgo), const SO_SNDBUF = 4097 +pkg syscall (netbsd-amd64-cgo), const SO_SNDLOWAT = 4099 +pkg syscall (netbsd-amd64-cgo), const SO_SNDTIMEO = 4107 +pkg syscall (netbsd-amd64-cgo), const SO_TIMESTAMP = 8192 +pkg syscall (netbsd-amd64-cgo), const SO_TYPE = 4104 +pkg syscall (netbsd-amd64-cgo), const SO_USELOOPBACK = 64 +pkg syscall (netbsd-amd64-cgo), const SYSCTL_VERSION = 16777216 +pkg syscall (netbsd-amd64-cgo), const SYSCTL_VERS_0 = 0 +pkg syscall (netbsd-amd64-cgo), const SYSCTL_VERS_1 = 16777216 +pkg syscall (netbsd-amd64-cgo), const SYSCTL_VERS_MASK = 4278190080 +pkg syscall (netbsd-amd64-cgo), const SYS_ACCEPT = 30 +pkg syscall (netbsd-amd64-cgo), const SYS_ACCESS = 33 +pkg syscall (netbsd-amd64-cgo), const SYS_ACCT = 51 +pkg syscall (netbsd-amd64-cgo), const SYS_ADJTIME = 421 +pkg syscall (netbsd-amd64-cgo), const SYS_BIND = 104 +pkg syscall (netbsd-amd64-cgo), const SYS_BREAK = 17 +pkg syscall (netbsd-amd64-cgo), const SYS_CHDIR = 12 +pkg syscall (netbsd-amd64-cgo), const SYS_CHFLAGS = 34 +pkg syscall (netbsd-amd64-cgo), const SYS_CHMOD = 15 +pkg syscall (netbsd-amd64-cgo), const SYS_CHOWN = 16 +pkg syscall (netbsd-amd64-cgo), const SYS_CHROOT = 61 +pkg syscall (netbsd-amd64-cgo), const SYS_CLOCK_GETRES = 429 +pkg syscall (netbsd-amd64-cgo), const SYS_CLOCK_GETTIME = 427 +pkg syscall (netbsd-amd64-cgo), const SYS_CLOCK_SETTIME = 428 +pkg syscall (netbsd-amd64-cgo), const SYS_CLOSE = 6 +pkg syscall (netbsd-amd64-cgo), const SYS_CONNECT = 98 +pkg syscall (netbsd-amd64-cgo), const SYS_DUP = 41 +pkg syscall (netbsd-amd64-cgo), const SYS_DUP2 = 90 +pkg syscall (netbsd-amd64-cgo), const SYS_DUP3 = 454 +pkg syscall (netbsd-amd64-cgo), const SYS_EXECVE = 59 +pkg syscall (netbsd-amd64-cgo), const SYS_EXIT = 1 +pkg syscall (netbsd-amd64-cgo), const SYS_EXTATTRCTL = 360 +pkg syscall (netbsd-amd64-cgo), const SYS_EXTATTR_DELETE_FD = 366 +pkg syscall (netbsd-amd64-cgo), const SYS_EXTATTR_DELETE_FILE = 363 +pkg syscall (netbsd-amd64-cgo), const SYS_EXTATTR_DELETE_LINK = 369 +pkg syscall (netbsd-amd64-cgo), const SYS_EXTATTR_GET_FD = 365 +pkg syscall (netbsd-amd64-cgo), const SYS_EXTATTR_GET_FILE = 362 +pkg syscall (netbsd-amd64-cgo), const SYS_EXTATTR_GET_LINK = 368 +pkg syscall (netbsd-amd64-cgo), const SYS_EXTATTR_LIST_FD = 370 +pkg syscall (netbsd-amd64-cgo), const SYS_EXTATTR_LIST_FILE = 371 +pkg syscall (netbsd-amd64-cgo), const SYS_EXTATTR_LIST_LINK = 372 +pkg syscall (netbsd-amd64-cgo), const SYS_EXTATTR_SET_FD = 364 +pkg syscall (netbsd-amd64-cgo), const SYS_EXTATTR_SET_FILE = 361 +pkg syscall (netbsd-amd64-cgo), const SYS_EXTATTR_SET_LINK = 367 +pkg syscall (netbsd-amd64-cgo), const SYS_FACCESSAT = 462 +pkg syscall (netbsd-amd64-cgo), const SYS_FCHDIR = 13 +pkg syscall (netbsd-amd64-cgo), const SYS_FCHFLAGS = 35 +pkg syscall (netbsd-amd64-cgo), const SYS_FCHMOD = 124 +pkg syscall (netbsd-amd64-cgo), const SYS_FCHMODAT = 463 +pkg syscall (netbsd-amd64-cgo), const SYS_FCHOWN = 123 +pkg syscall (netbsd-amd64-cgo), const SYS_FCHOWNAT = 464 +pkg syscall (netbsd-amd64-cgo), const SYS_FCHROOT = 297 +pkg syscall (netbsd-amd64-cgo), const SYS_FCNTL = 92 +pkg syscall (netbsd-amd64-cgo), const SYS_FDATASYNC = 241 +pkg syscall (netbsd-amd64-cgo), const SYS_FEXECVE = 465 +pkg syscall (netbsd-amd64-cgo), const SYS_FGETXATTR = 380 +pkg syscall (netbsd-amd64-cgo), const SYS_FHSTAT = 451 +pkg syscall (netbsd-amd64-cgo), const SYS_FKTRACE = 288 +pkg syscall (netbsd-amd64-cgo), const SYS_FLISTXATTR = 383 +pkg syscall (netbsd-amd64-cgo), const SYS_FLOCK = 131 +pkg syscall (netbsd-amd64-cgo), const SYS_FORK = 2 +pkg syscall (netbsd-amd64-cgo), const SYS_FPATHCONF = 192 +pkg syscall (netbsd-amd64-cgo), const SYS_FREMOVEXATTR = 386 +pkg syscall (netbsd-amd64-cgo), const SYS_FSETXATTR = 377 +pkg syscall (netbsd-amd64-cgo), const SYS_FSTAT = 440 +pkg syscall (netbsd-amd64-cgo), const SYS_FSTATAT = 466 +pkg syscall (netbsd-amd64-cgo), const SYS_FSTATVFS1 = 358 +pkg syscall (netbsd-amd64-cgo), const SYS_FSYNC = 95 +pkg syscall (netbsd-amd64-cgo), const SYS_FSYNC_RANGE = 354 +pkg syscall (netbsd-amd64-cgo), const SYS_FTRUNCATE = 201 +pkg syscall (netbsd-amd64-cgo), const SYS_FUTIMENS = 472 +pkg syscall (netbsd-amd64-cgo), const SYS_FUTIMES = 423 +pkg syscall (netbsd-amd64-cgo), const SYS_GETCONTEXT = 307 +pkg syscall (netbsd-amd64-cgo), const SYS_GETDENTS = 390 +pkg syscall (netbsd-amd64-cgo), const SYS_GETEGID = 43 +pkg syscall (netbsd-amd64-cgo), const SYS_GETEUID = 25 +pkg syscall (netbsd-amd64-cgo), const SYS_GETFH = 395 +pkg syscall (netbsd-amd64-cgo), const SYS_GETGID = 47 +pkg syscall (netbsd-amd64-cgo), const SYS_GETGROUPS = 79 +pkg syscall (netbsd-amd64-cgo), const SYS_GETITIMER = 426 +pkg syscall (netbsd-amd64-cgo), const SYS_GETPEERNAME = 31 +pkg syscall (netbsd-amd64-cgo), const SYS_GETPGID = 207 +pkg syscall (netbsd-amd64-cgo), const SYS_GETPGRP = 81 +pkg syscall (netbsd-amd64-cgo), const SYS_GETPID = 20 +pkg syscall (netbsd-amd64-cgo), const SYS_GETPPID = 39 +pkg syscall (netbsd-amd64-cgo), const SYS_GETPRIORITY = 100 +pkg syscall (netbsd-amd64-cgo), const SYS_GETRLIMIT = 194 +pkg syscall (netbsd-amd64-cgo), const SYS_GETRUSAGE = 445 +pkg syscall (netbsd-amd64-cgo), const SYS_GETSID = 286 +pkg syscall (netbsd-amd64-cgo), const SYS_GETSOCKNAME = 32 +pkg syscall (netbsd-amd64-cgo), const SYS_GETSOCKOPT = 118 +pkg syscall (netbsd-amd64-cgo), const SYS_GETTIMEOFDAY = 418 +pkg syscall (netbsd-amd64-cgo), const SYS_GETUID = 24 +pkg syscall (netbsd-amd64-cgo), const SYS_GETVFSSTAT = 356 +pkg syscall (netbsd-amd64-cgo), const SYS_GETXATTR = 378 +pkg syscall (netbsd-amd64-cgo), const SYS_IOCTL = 54 +pkg syscall (netbsd-amd64-cgo), const SYS_ISSETUGID = 305 +pkg syscall (netbsd-amd64-cgo), const SYS_KEVENT = 435 +pkg syscall (netbsd-amd64-cgo), const SYS_KILL = 37 +pkg syscall (netbsd-amd64-cgo), const SYS_KQUEUE = 344 +pkg syscall (netbsd-amd64-cgo), const SYS_KQUEUE1 = 455 +pkg syscall (netbsd-amd64-cgo), const SYS_KTRACE = 45 +pkg syscall (netbsd-amd64-cgo), const SYS_LCHFLAGS = 304 +pkg syscall (netbsd-amd64-cgo), const SYS_LCHMOD = 274 +pkg syscall (netbsd-amd64-cgo), const SYS_LCHOWN = 275 +pkg syscall (netbsd-amd64-cgo), const SYS_LGETXATTR = 379 +pkg syscall (netbsd-amd64-cgo), const SYS_LINK = 9 +pkg syscall (netbsd-amd64-cgo), const SYS_LINKAT = 457 +pkg syscall (netbsd-amd64-cgo), const SYS_LISTEN = 106 +pkg syscall (netbsd-amd64-cgo), const SYS_LISTXATTR = 381 +pkg syscall (netbsd-amd64-cgo), const SYS_LLISTXATTR = 382 +pkg syscall (netbsd-amd64-cgo), const SYS_LREMOVEXATTR = 385 +pkg syscall (netbsd-amd64-cgo), const SYS_LSEEK = 199 +pkg syscall (netbsd-amd64-cgo), const SYS_LSETXATTR = 376 +pkg syscall (netbsd-amd64-cgo), const SYS_LSTAT = 441 +pkg syscall (netbsd-amd64-cgo), const SYS_LUTIMES = 424 +pkg syscall (netbsd-amd64-cgo), const SYS_MADVISE = 75 +pkg syscall (netbsd-amd64-cgo), const SYS_MINCORE = 78 +pkg syscall (netbsd-amd64-cgo), const SYS_MINHERIT = 273 +pkg syscall (netbsd-amd64-cgo), const SYS_MKDIR = 136 +pkg syscall (netbsd-amd64-cgo), const SYS_MKDIRAT = 461 +pkg syscall (netbsd-amd64-cgo), const SYS_MKFIFO = 132 +pkg syscall (netbsd-amd64-cgo), const SYS_MKFIFOAT = 459 +pkg syscall (netbsd-amd64-cgo), const SYS_MKNOD = 450 +pkg syscall (netbsd-amd64-cgo), const SYS_MKNODAT = 460 +pkg syscall (netbsd-amd64-cgo), const SYS_MLOCK = 203 +pkg syscall (netbsd-amd64-cgo), const SYS_MLOCKALL = 242 +pkg syscall (netbsd-amd64-cgo), const SYS_MMAP = 197 +pkg syscall (netbsd-amd64-cgo), const SYS_MODCTL = 246 +pkg syscall (netbsd-amd64-cgo), const SYS_MOUNT = 410 +pkg syscall (netbsd-amd64-cgo), const SYS_MPROTECT = 74 +pkg syscall (netbsd-amd64-cgo), const SYS_MREMAP = 411 +pkg syscall (netbsd-amd64-cgo), const SYS_MSGCTL = 444 +pkg syscall (netbsd-amd64-cgo), const SYS_MSGGET = 225 +pkg syscall (netbsd-amd64-cgo), const SYS_MSGRCV = 227 +pkg syscall (netbsd-amd64-cgo), const SYS_MSGSND = 226 +pkg syscall (netbsd-amd64-cgo), const SYS_MUNLOCK = 204 +pkg syscall (netbsd-amd64-cgo), const SYS_MUNLOCKALL = 243 +pkg syscall (netbsd-amd64-cgo), const SYS_MUNMAP = 73 +pkg syscall (netbsd-amd64-cgo), const SYS_NANOSLEEP = 430 +pkg syscall (netbsd-amd64-cgo), const SYS_NTP_ADJTIME = 176 +pkg syscall (netbsd-amd64-cgo), const SYS_NTP_GETTIME = 448 +pkg syscall (netbsd-amd64-cgo), const SYS_OPEN = 5 +pkg syscall (netbsd-amd64-cgo), const SYS_OPENAT = 468 +pkg syscall (netbsd-amd64-cgo), const SYS_PACCEPT = 456 +pkg syscall (netbsd-amd64-cgo), const SYS_PATHCONF = 191 +pkg syscall (netbsd-amd64-cgo), const SYS_PIPE = 42 +pkg syscall (netbsd-amd64-cgo), const SYS_PIPE2 = 453 +pkg syscall (netbsd-amd64-cgo), const SYS_PMC_CONTROL = 342 +pkg syscall (netbsd-amd64-cgo), const SYS_PMC_GET_INFO = 341 +pkg syscall (netbsd-amd64-cgo), const SYS_POLL = 209 +pkg syscall (netbsd-amd64-cgo), const SYS_POLLTS = 437 +pkg syscall (netbsd-amd64-cgo), const SYS_POSIX_FADVISE = 416 +pkg syscall (netbsd-amd64-cgo), const SYS_POSIX_SPAWN = 474 +pkg syscall (netbsd-amd64-cgo), const SYS_PREAD = 173 +pkg syscall (netbsd-amd64-cgo), const SYS_PREADV = 289 +pkg syscall (netbsd-amd64-cgo), const SYS_PROFIL = 44 +pkg syscall (netbsd-amd64-cgo), const SYS_PSELECT = 436 +pkg syscall (netbsd-amd64-cgo), const SYS_PSET_ASSIGN = 414 +pkg syscall (netbsd-amd64-cgo), const SYS_PSET_CREATE = 412 +pkg syscall (netbsd-amd64-cgo), const SYS_PSET_DESTROY = 413 +pkg syscall (netbsd-amd64-cgo), const SYS_PTRACE = 26 +pkg syscall (netbsd-amd64-cgo), const SYS_PWRITE = 174 +pkg syscall (netbsd-amd64-cgo), const SYS_PWRITEV = 290 +pkg syscall (netbsd-amd64-cgo), const SYS_RASCTL = 343 +pkg syscall (netbsd-amd64-cgo), const SYS_READ = 3 +pkg syscall (netbsd-amd64-cgo), const SYS_READLINK = 58 +pkg syscall (netbsd-amd64-cgo), const SYS_READLINKAT = 469 +pkg syscall (netbsd-amd64-cgo), const SYS_READV = 120 +pkg syscall (netbsd-amd64-cgo), const SYS_REBOOT = 208 +pkg syscall (netbsd-amd64-cgo), const SYS_RECVFROM = 29 +pkg syscall (netbsd-amd64-cgo), const SYS_RECVMMSG = 475 +pkg syscall (netbsd-amd64-cgo), const SYS_RECVMSG = 27 +pkg syscall (netbsd-amd64-cgo), const SYS_REMOVEXATTR = 384 +pkg syscall (netbsd-amd64-cgo), const SYS_RENAME = 128 +pkg syscall (netbsd-amd64-cgo), const SYS_RENAMEAT = 458 +pkg syscall (netbsd-amd64-cgo), const SYS_REVOKE = 56 +pkg syscall (netbsd-amd64-cgo), const SYS_RMDIR = 137 +pkg syscall (netbsd-amd64-cgo), const SYS_SBRK = 69 +pkg syscall (netbsd-amd64-cgo), const SYS_SCHED_YIELD = 350 +pkg syscall (netbsd-amd64-cgo), const SYS_SELECT = 417 +pkg syscall (netbsd-amd64-cgo), const SYS_SEMCONFIG = 223 +pkg syscall (netbsd-amd64-cgo), const SYS_SEMGET = 221 +pkg syscall (netbsd-amd64-cgo), const SYS_SEMOP = 222 +pkg syscall (netbsd-amd64-cgo), const SYS_SENDMMSG = 476 +pkg syscall (netbsd-amd64-cgo), const SYS_SENDMSG = 28 +pkg syscall (netbsd-amd64-cgo), const SYS_SENDTO = 133 +pkg syscall (netbsd-amd64-cgo), const SYS_SETCONTEXT = 308 +pkg syscall (netbsd-amd64-cgo), const SYS_SETEGID = 182 +pkg syscall (netbsd-amd64-cgo), const SYS_SETEUID = 183 +pkg syscall (netbsd-amd64-cgo), const SYS_SETGID = 181 +pkg syscall (netbsd-amd64-cgo), const SYS_SETGROUPS = 80 +pkg syscall (netbsd-amd64-cgo), const SYS_SETITIMER = 425 +pkg syscall (netbsd-amd64-cgo), const SYS_SETPGID = 82 +pkg syscall (netbsd-amd64-cgo), const SYS_SETPRIORITY = 96 +pkg syscall (netbsd-amd64-cgo), const SYS_SETREGID = 127 +pkg syscall (netbsd-amd64-cgo), const SYS_SETREUID = 126 +pkg syscall (netbsd-amd64-cgo), const SYS_SETRLIMIT = 195 +pkg syscall (netbsd-amd64-cgo), const SYS_SETSID = 147 +pkg syscall (netbsd-amd64-cgo), const SYS_SETSOCKOPT = 105 +pkg syscall (netbsd-amd64-cgo), const SYS_SETTIMEOFDAY = 419 +pkg syscall (netbsd-amd64-cgo), const SYS_SETUID = 23 +pkg syscall (netbsd-amd64-cgo), const SYS_SETXATTR = 375 +pkg syscall (netbsd-amd64-cgo), const SYS_SHMAT = 228 +pkg syscall (netbsd-amd64-cgo), const SYS_SHMCTL = 443 +pkg syscall (netbsd-amd64-cgo), const SYS_SHMDT = 230 +pkg syscall (netbsd-amd64-cgo), const SYS_SHMGET = 231 +pkg syscall (netbsd-amd64-cgo), const SYS_SHUTDOWN = 134 +pkg syscall (netbsd-amd64-cgo), const SYS_SIGQUEUEINFO = 245 +pkg syscall (netbsd-amd64-cgo), const SYS_SOCKET = 394 +pkg syscall (netbsd-amd64-cgo), const SYS_SOCKETPAIR = 135 +pkg syscall (netbsd-amd64-cgo), const SYS_SSTK = 70 +pkg syscall (netbsd-amd64-cgo), const SYS_STAT = 439 +pkg syscall (netbsd-amd64-cgo), const SYS_STATVFS1 = 357 +pkg syscall (netbsd-amd64-cgo), const SYS_SWAPCTL = 271 +pkg syscall (netbsd-amd64-cgo), const SYS_SYMLINK = 57 +pkg syscall (netbsd-amd64-cgo), const SYS_SYMLINKAT = 470 +pkg syscall (netbsd-amd64-cgo), const SYS_SYNC = 36 +pkg syscall (netbsd-amd64-cgo), const SYS_SYSARCH = 165 +pkg syscall (netbsd-amd64-cgo), const SYS_TIMER_CREATE = 235 +pkg syscall (netbsd-amd64-cgo), const SYS_TIMER_DELETE = 236 +pkg syscall (netbsd-amd64-cgo), const SYS_TIMER_GETOVERRUN = 239 +pkg syscall (netbsd-amd64-cgo), const SYS_TIMER_GETTIME = 447 +pkg syscall (netbsd-amd64-cgo), const SYS_TIMER_SETTIME = 446 +pkg syscall (netbsd-amd64-cgo), const SYS_TRUNCATE = 200 +pkg syscall (netbsd-amd64-cgo), const SYS_UMASK = 60 +pkg syscall (netbsd-amd64-cgo), const SYS_UNDELETE = 205 +pkg syscall (netbsd-amd64-cgo), const SYS_UNLINK = 10 +pkg syscall (netbsd-amd64-cgo), const SYS_UNLINKAT = 471 +pkg syscall (netbsd-amd64-cgo), const SYS_UNMOUNT = 22 +pkg syscall (netbsd-amd64-cgo), const SYS_UTIMENSAT = 467 +pkg syscall (netbsd-amd64-cgo), const SYS_UTIMES = 420 +pkg syscall (netbsd-amd64-cgo), const SYS_UTRACE = 306 +pkg syscall (netbsd-amd64-cgo), const SYS_UUIDGEN = 355 +pkg syscall (netbsd-amd64-cgo), const SYS_VADVISE = 72 +pkg syscall (netbsd-amd64-cgo), const SYS_VFORK = 66 +pkg syscall (netbsd-amd64-cgo), const SYS_WAIT4 = 449 +pkg syscall (netbsd-amd64-cgo), const SYS_WRITE = 4 +pkg syscall (netbsd-amd64-cgo), const SYS_WRITEV = 121 +pkg syscall (netbsd-amd64-cgo), const SYS__LWP_CONTINUE = 314 +pkg syscall (netbsd-amd64-cgo), const SYS__LWP_CREATE = 309 +pkg syscall (netbsd-amd64-cgo), const SYS__LWP_CTL = 325 +pkg syscall (netbsd-amd64-cgo), const SYS__LWP_DETACH = 319 +pkg syscall (netbsd-amd64-cgo), const SYS__LWP_EXIT = 310 +pkg syscall (netbsd-amd64-cgo), const SYS__LWP_GETNAME = 324 +pkg syscall (netbsd-amd64-cgo), const SYS__LWP_GETPRIVATE = 316 +pkg syscall (netbsd-amd64-cgo), const SYS__LWP_KILL = 318 +pkg syscall (netbsd-amd64-cgo), const SYS__LWP_PARK = 434 +pkg syscall (netbsd-amd64-cgo), const SYS__LWP_SELF = 311 +pkg syscall (netbsd-amd64-cgo), const SYS__LWP_SETNAME = 323 +pkg syscall (netbsd-amd64-cgo), const SYS__LWP_SETPRIVATE = 317 +pkg syscall (netbsd-amd64-cgo), const SYS__LWP_SUSPEND = 313 +pkg syscall (netbsd-amd64-cgo), const SYS__LWP_UNPARK = 321 +pkg syscall (netbsd-amd64-cgo), const SYS__LWP_UNPARK_ALL = 322 +pkg syscall (netbsd-amd64-cgo), const SYS__LWP_WAIT = 312 +pkg syscall (netbsd-amd64-cgo), const SYS__LWP_WAKEUP = 315 +pkg syscall (netbsd-amd64-cgo), const SYS__PSET_BIND = 415 +pkg syscall (netbsd-amd64-cgo), const SYS__SCHED_GETAFFINITY = 349 +pkg syscall (netbsd-amd64-cgo), const SYS__SCHED_GETPARAM = 347 +pkg syscall (netbsd-amd64-cgo), const SYS__SCHED_SETAFFINITY = 348 +pkg syscall (netbsd-amd64-cgo), const SYS__SCHED_SETPARAM = 346 +pkg syscall (netbsd-amd64-cgo), const SYS___CLONE = 287 +pkg syscall (netbsd-amd64-cgo), const SYS___GETCWD = 296 +pkg syscall (netbsd-amd64-cgo), const SYS___GETLOGIN = 49 +pkg syscall (netbsd-amd64-cgo), const SYS___POSIX_CHOWN = 283 +pkg syscall (netbsd-amd64-cgo), const SYS___POSIX_FCHOWN = 284 +pkg syscall (netbsd-amd64-cgo), const SYS___POSIX_LCHOWN = 285 +pkg syscall (netbsd-amd64-cgo), const SYS___POSIX_RENAME = 270 +pkg syscall (netbsd-amd64-cgo), const SYS___QUOTACTL = 473 +pkg syscall (netbsd-amd64-cgo), const SYS___SEMCTL = 442 +pkg syscall (netbsd-amd64-cgo), const SYS___SETLOGIN = 50 +pkg syscall (netbsd-amd64-cgo), const SYS___SIGACTION_SIGTRAMP = 340 +pkg syscall (netbsd-amd64-cgo), const SYS___SIGTIMEDWAIT = 431 +pkg syscall (netbsd-amd64-cgo), const SYS___SYSCTL = 202 +pkg syscall (netbsd-amd64-cgo), const S_ARCH1 = 65536 +pkg syscall (netbsd-amd64-cgo), const S_ARCH2 = 131072 +pkg syscall (netbsd-amd64-cgo), const S_BLKSIZE = 512 +pkg syscall (netbsd-amd64-cgo), const S_IEXEC = 64 +pkg syscall (netbsd-amd64-cgo), const S_IFMT = 61440 +pkg syscall (netbsd-amd64-cgo), const S_IFWHT = 57344 +pkg syscall (netbsd-amd64-cgo), const S_IREAD = 256 +pkg syscall (netbsd-amd64-cgo), const S_IRGRP = 32 +pkg syscall (netbsd-amd64-cgo), const S_IROTH = 4 +pkg syscall (netbsd-amd64-cgo), const S_IRWXG = 56 +pkg syscall (netbsd-amd64-cgo), const S_IRWXO = 7 +pkg syscall (netbsd-amd64-cgo), const S_IRWXU = 448 +pkg syscall (netbsd-amd64-cgo), const S_ISTXT = 512 +pkg syscall (netbsd-amd64-cgo), const S_IWGRP = 16 +pkg syscall (netbsd-amd64-cgo), const S_IWOTH = 2 +pkg syscall (netbsd-amd64-cgo), const S_IWRITE = 128 +pkg syscall (netbsd-amd64-cgo), const S_IXGRP = 8 +pkg syscall (netbsd-amd64-cgo), const S_IXOTH = 1 +pkg syscall (netbsd-amd64-cgo), const S_LOGIN_SET = 1 +pkg syscall (netbsd-amd64-cgo), const SizeofBpfHdr = 32 +pkg syscall (netbsd-amd64-cgo), const SizeofBpfInsn = 8 +pkg syscall (netbsd-amd64-cgo), const SizeofBpfProgram = 16 +pkg syscall (netbsd-amd64-cgo), const SizeofBpfStat = 128 +pkg syscall (netbsd-amd64-cgo), const SizeofBpfVersion = 4 +pkg syscall (netbsd-amd64-cgo), const SizeofCmsghdr = 12 +pkg syscall (netbsd-amd64-cgo), const SizeofIPMreq = 8 +pkg syscall (netbsd-amd64-cgo), const SizeofIPv6Mreq = 20 +pkg syscall (netbsd-amd64-cgo), const SizeofIfAnnounceMsghdr = 24 +pkg syscall (netbsd-amd64-cgo), const SizeofIfData = 136 +pkg syscall (netbsd-amd64-cgo), const SizeofIfMsghdr = 152 +pkg syscall (netbsd-amd64-cgo), const SizeofIfaMsghdr = 24 +pkg syscall (netbsd-amd64-cgo), const SizeofInet6Pktinfo = 20 +pkg syscall (netbsd-amd64-cgo), const SizeofLinger = 8 +pkg syscall (netbsd-amd64-cgo), const SizeofMsghdr = 48 +pkg syscall (netbsd-amd64-cgo), const SizeofRtMetrics = 80 +pkg syscall (netbsd-amd64-cgo), const SizeofRtMsghdr = 120 +pkg syscall (netbsd-amd64-cgo), const SizeofSockaddrAny = 108 +pkg syscall (netbsd-amd64-cgo), const SizeofSockaddrDatalink = 20 +pkg syscall (netbsd-amd64-cgo), const SizeofSockaddrInet4 = 16 +pkg syscall (netbsd-amd64-cgo), const SizeofSockaddrInet6 = 28 +pkg syscall (netbsd-amd64-cgo), const SizeofSockaddrUnix = 106 +pkg syscall (netbsd-amd64-cgo), const TCIFLUSH = 1 +pkg syscall (netbsd-amd64-cgo), const TCIOFLUSH = 3 +pkg syscall (netbsd-amd64-cgo), const TCOFLUSH = 2 +pkg syscall (netbsd-amd64-cgo), const TCP_CONGCTL = 32 +pkg syscall (netbsd-amd64-cgo), const TCP_KEEPCNT = 6 +pkg syscall (netbsd-amd64-cgo), const TCP_KEEPIDLE = 3 +pkg syscall (netbsd-amd64-cgo), const TCP_KEEPINIT = 7 +pkg syscall (netbsd-amd64-cgo), const TCP_KEEPINTVL = 5 +pkg syscall (netbsd-amd64-cgo), const TCP_MAXBURST = 4 +pkg syscall (netbsd-amd64-cgo), const TCP_MAXSEG = 2 +pkg syscall (netbsd-amd64-cgo), const TCP_MAXWIN = 65535 +pkg syscall (netbsd-amd64-cgo), const TCP_MAX_WINSHIFT = 14 +pkg syscall (netbsd-amd64-cgo), const TCP_MD5SIG = 16 +pkg syscall (netbsd-amd64-cgo), const TCP_MINMSS = 216 +pkg syscall (netbsd-amd64-cgo), const TCP_MSS = 536 +pkg syscall (netbsd-amd64-cgo), const TCSAFLUSH = 2 +pkg syscall (netbsd-amd64-cgo), const TIOCCBRK = 536900730 +pkg syscall (netbsd-amd64-cgo), const TIOCCDTR = 536900728 +pkg syscall (netbsd-amd64-cgo), const TIOCCONS = 2147775586 +pkg syscall (netbsd-amd64-cgo), const TIOCDCDTIMESTAMP = 1074820184 +pkg syscall (netbsd-amd64-cgo), const TIOCDRAIN = 536900702 +pkg syscall (netbsd-amd64-cgo), const TIOCEXCL = 536900621 +pkg syscall (netbsd-amd64-cgo), const TIOCEXT = 2147775584 +pkg syscall (netbsd-amd64-cgo), const TIOCFLAG_CDTRCTS = 16 +pkg syscall (netbsd-amd64-cgo), const TIOCFLAG_CLOCAL = 2 +pkg syscall (netbsd-amd64-cgo), const TIOCFLAG_CRTSCTS = 4 +pkg syscall (netbsd-amd64-cgo), const TIOCFLAG_MDMBUF = 8 +pkg syscall (netbsd-amd64-cgo), const TIOCFLAG_SOFTCAR = 1 +pkg syscall (netbsd-amd64-cgo), const TIOCFLUSH = 2147775504 +pkg syscall (netbsd-amd64-cgo), const TIOCGETA = 1076655123 +pkg syscall (netbsd-amd64-cgo), const TIOCGETD = 1074033690 +pkg syscall (netbsd-amd64-cgo), const TIOCGFLAGS = 1074033757 +pkg syscall (netbsd-amd64-cgo), const TIOCGLINED = 1075868738 +pkg syscall (netbsd-amd64-cgo), const TIOCGPGRP = 1074033783 +pkg syscall (netbsd-amd64-cgo), const TIOCGQSIZE = 1074033793 +pkg syscall (netbsd-amd64-cgo), const TIOCGRANTPT = 536900679 +pkg syscall (netbsd-amd64-cgo), const TIOCGSID = 1074033763 +pkg syscall (netbsd-amd64-cgo), const TIOCGSIZE = 1074295912 +pkg syscall (netbsd-amd64-cgo), const TIOCGWINSZ = 1074295912 +pkg syscall (netbsd-amd64-cgo), const TIOCMBIC = 2147775595 +pkg syscall (netbsd-amd64-cgo), const TIOCMBIS = 2147775596 +pkg syscall (netbsd-amd64-cgo), const TIOCMGET = 1074033770 +pkg syscall (netbsd-amd64-cgo), const TIOCMSET = 2147775597 +pkg syscall (netbsd-amd64-cgo), const TIOCM_CAR = 64 +pkg syscall (netbsd-amd64-cgo), const TIOCM_CD = 64 +pkg syscall (netbsd-amd64-cgo), const TIOCM_CTS = 32 +pkg syscall (netbsd-amd64-cgo), const TIOCM_DSR = 256 +pkg syscall (netbsd-amd64-cgo), const TIOCM_DTR = 2 +pkg syscall (netbsd-amd64-cgo), const TIOCM_LE = 1 +pkg syscall (netbsd-amd64-cgo), const TIOCM_RI = 128 +pkg syscall (netbsd-amd64-cgo), const TIOCM_RNG = 128 +pkg syscall (netbsd-amd64-cgo), const TIOCM_RTS = 4 +pkg syscall (netbsd-amd64-cgo), const TIOCM_SR = 16 +pkg syscall (netbsd-amd64-cgo), const TIOCM_ST = 8 +pkg syscall (netbsd-amd64-cgo), const TIOCNOTTY = 536900721 +pkg syscall (netbsd-amd64-cgo), const TIOCNXCL = 536900622 +pkg syscall (netbsd-amd64-cgo), const TIOCOUTQ = 1074033779 +pkg syscall (netbsd-amd64-cgo), const TIOCPKT = 2147775600 +pkg syscall (netbsd-amd64-cgo), const TIOCPKT_DATA = 0 +pkg syscall (netbsd-amd64-cgo), const TIOCPKT_DOSTOP = 32 +pkg syscall (netbsd-amd64-cgo), const TIOCPKT_FLUSHREAD = 1 +pkg syscall (netbsd-amd64-cgo), const TIOCPKT_FLUSHWRITE = 2 +pkg syscall (netbsd-amd64-cgo), const TIOCPKT_IOCTL = 64 +pkg syscall (netbsd-amd64-cgo), const TIOCPKT_NOSTOP = 16 +pkg syscall (netbsd-amd64-cgo), const TIOCPKT_START = 8 +pkg syscall (netbsd-amd64-cgo), const TIOCPKT_STOP = 4 +pkg syscall (netbsd-amd64-cgo), const TIOCPTMGET = 1076393030 +pkg syscall (netbsd-amd64-cgo), const TIOCPTSNAME = 1076393032 +pkg syscall (netbsd-amd64-cgo), const TIOCRCVFRAME = 2148037701 +pkg syscall (netbsd-amd64-cgo), const TIOCREMOTE = 2147775593 +pkg syscall (netbsd-amd64-cgo), const TIOCSBRK = 536900731 +pkg syscall (netbsd-amd64-cgo), const TIOCSCTTY = 536900705 +pkg syscall (netbsd-amd64-cgo), const TIOCSDTR = 536900729 +pkg syscall (netbsd-amd64-cgo), const TIOCSETA = 2150396948 +pkg syscall (netbsd-amd64-cgo), const TIOCSETAF = 2150396950 +pkg syscall (netbsd-amd64-cgo), const TIOCSETAW = 2150396949 +pkg syscall (netbsd-amd64-cgo), const TIOCSETD = 2147775515 +pkg syscall (netbsd-amd64-cgo), const TIOCSFLAGS = 2147775580 +pkg syscall (netbsd-amd64-cgo), const TIOCSIG = 536900703 +pkg syscall (netbsd-amd64-cgo), const TIOCSLINED = 2149610563 +pkg syscall (netbsd-amd64-cgo), const TIOCSPGRP = 2147775606 +pkg syscall (netbsd-amd64-cgo), const TIOCSQSIZE = 2147775616 +pkg syscall (netbsd-amd64-cgo), const TIOCSSIZE = 2148037735 +pkg syscall (netbsd-amd64-cgo), const TIOCSTART = 536900718 +pkg syscall (netbsd-amd64-cgo), const TIOCSTAT = 2147775589 +pkg syscall (netbsd-amd64-cgo), const TIOCSTI = 2147578994 +pkg syscall (netbsd-amd64-cgo), const TIOCSTOP = 536900719 +pkg syscall (netbsd-amd64-cgo), const TIOCSWINSZ = 2148037735 +pkg syscall (netbsd-amd64-cgo), const TIOCUCNTL = 2147775590 +pkg syscall (netbsd-amd64-cgo), const TIOCXMTFRAME = 2148037700 +pkg syscall (netbsd-amd64-cgo), const TOSTOP = 4194304 +pkg syscall (netbsd-amd64-cgo), const VDISCARD = 15 +pkg syscall (netbsd-amd64-cgo), const VDSUSP = 11 +pkg syscall (netbsd-amd64-cgo), const VEOF = 0 +pkg syscall (netbsd-amd64-cgo), const VEOL = 1 +pkg syscall (netbsd-amd64-cgo), const VEOL2 = 2 +pkg syscall (netbsd-amd64-cgo), const VERASE = 3 +pkg syscall (netbsd-amd64-cgo), const VINTR = 8 +pkg syscall (netbsd-amd64-cgo), const VKILL = 5 +pkg syscall (netbsd-amd64-cgo), const VLNEXT = 14 +pkg syscall (netbsd-amd64-cgo), const VMIN = 16 +pkg syscall (netbsd-amd64-cgo), const VQUIT = 9 +pkg syscall (netbsd-amd64-cgo), const VREPRINT = 6 +pkg syscall (netbsd-amd64-cgo), const VSTART = 12 +pkg syscall (netbsd-amd64-cgo), const VSTATUS = 18 +pkg syscall (netbsd-amd64-cgo), const VSTOP = 13 +pkg syscall (netbsd-amd64-cgo), const VSUSP = 10 +pkg syscall (netbsd-amd64-cgo), const VTIME = 17 +pkg syscall (netbsd-amd64-cgo), const VWERASE = 4 +pkg syscall (netbsd-amd64-cgo), const WALL = 8 +pkg syscall (netbsd-amd64-cgo), const WALLSIG = 8 +pkg syscall (netbsd-amd64-cgo), const WALTSIG = 4 +pkg syscall (netbsd-amd64-cgo), const WCLONE = 4 +pkg syscall (netbsd-amd64-cgo), const WCOREFLAG = 128 +pkg syscall (netbsd-amd64-cgo), const WNOHANG = 1 +pkg syscall (netbsd-amd64-cgo), const WNOWAIT = 65536 +pkg syscall (netbsd-amd64-cgo), const WNOZOMBIE = 131072 +pkg syscall (netbsd-amd64-cgo), const WOPTSCHECKED = 262144 +pkg syscall (netbsd-amd64-cgo), const WSTOPPED = 127 +pkg syscall (netbsd-amd64-cgo), const WUNTRACED = 2 +pkg syscall (netbsd-arm), const AF_APPLETALK = 16 +pkg syscall (netbsd-arm), const AF_ARP = 28 +pkg syscall (netbsd-arm), const AF_BLUETOOTH = 31 +pkg syscall (netbsd-arm), const AF_CCITT = 10 +pkg syscall (netbsd-arm), const AF_CHAOS = 5 +pkg syscall (netbsd-arm), const AF_CNT = 21 +pkg syscall (netbsd-arm), const AF_COIP = 20 +pkg syscall (netbsd-arm), const AF_DATAKIT = 9 +pkg syscall (netbsd-arm), const AF_DECnet = 12 +pkg syscall (netbsd-arm), const AF_DLI = 13 +pkg syscall (netbsd-arm), const AF_E164 = 26 +pkg syscall (netbsd-arm), const AF_ECMA = 8 +pkg syscall (netbsd-arm), const AF_HYLINK = 15 +pkg syscall (netbsd-arm), const AF_IEEE80211 = 32 +pkg syscall (netbsd-arm), const AF_IMPLINK = 3 +pkg syscall (netbsd-arm), const AF_INET6 = 24 +pkg syscall (netbsd-arm), const AF_IPX = 23 +pkg syscall (netbsd-arm), const AF_ISDN = 26 +pkg syscall (netbsd-arm), const AF_ISO = 7 +pkg syscall (netbsd-arm), const AF_LAT = 14 +pkg syscall (netbsd-arm), const AF_LINK = 18 +pkg syscall (netbsd-arm), const AF_LOCAL = 1 +pkg syscall (netbsd-arm), const AF_MAX = 35 +pkg syscall (netbsd-arm), const AF_MPLS = 33 +pkg syscall (netbsd-arm), const AF_NATM = 27 +pkg syscall (netbsd-arm), const AF_NS = 6 +pkg syscall (netbsd-arm), const AF_OROUTE = 17 +pkg syscall (netbsd-arm), const AF_OSI = 7 +pkg syscall (netbsd-arm), const AF_PUP = 4 +pkg syscall (netbsd-arm), const AF_ROUTE = 34 +pkg syscall (netbsd-arm), const AF_SNA = 11 +pkg syscall (netbsd-arm), const ARPHRD_ARCNET = 7 +pkg syscall (netbsd-arm), const ARPHRD_ETHER = 1 +pkg syscall (netbsd-arm), const ARPHRD_FRELAY = 15 +pkg syscall (netbsd-arm), const ARPHRD_IEEE1394 = 24 +pkg syscall (netbsd-arm), const ARPHRD_IEEE802 = 6 +pkg syscall (netbsd-arm), const ARPHRD_STRIP = 23 +pkg syscall (netbsd-arm), const B0 = 0 +pkg syscall (netbsd-arm), const B110 = 110 +pkg syscall (netbsd-arm), const B115200 = 115200 +pkg syscall (netbsd-arm), const B1200 = 1200 +pkg syscall (netbsd-arm), const B134 = 134 +pkg syscall (netbsd-arm), const B14400 = 14400 +pkg syscall (netbsd-arm), const B150 = 150 +pkg syscall (netbsd-arm), const B1800 = 1800 +pkg syscall (netbsd-arm), const B19200 = 19200 +pkg syscall (netbsd-arm), const B200 = 200 +pkg syscall (netbsd-arm), const B230400 = 230400 +pkg syscall (netbsd-arm), const B2400 = 2400 +pkg syscall (netbsd-arm), const B28800 = 28800 +pkg syscall (netbsd-arm), const B300 = 300 +pkg syscall (netbsd-arm), const B38400 = 38400 +pkg syscall (netbsd-arm), const B460800 = 460800 +pkg syscall (netbsd-arm), const B4800 = 4800 +pkg syscall (netbsd-arm), const B50 = 50 +pkg syscall (netbsd-arm), const B57600 = 57600 +pkg syscall (netbsd-arm), const B600 = 600 +pkg syscall (netbsd-arm), const B7200 = 7200 +pkg syscall (netbsd-arm), const B75 = 75 +pkg syscall (netbsd-arm), const B76800 = 76800 +pkg syscall (netbsd-arm), const B921600 = 921600 +pkg syscall (netbsd-arm), const B9600 = 9600 +pkg syscall (netbsd-arm), const BIOCFEEDBACK = 2147762813 +pkg syscall (netbsd-arm), const BIOCFLUSH = 536887912 +pkg syscall (netbsd-arm), const BIOCGBLEN = 1074020966 +pkg syscall (netbsd-arm), const BIOCGDLT = 1074020970 +pkg syscall (netbsd-arm), const BIOCGDLTLIST = 3221766775 +pkg syscall (netbsd-arm), const BIOCGETIF = 1083196011 +pkg syscall (netbsd-arm), const BIOCGFEEDBACK = 1074020988 +pkg syscall (netbsd-arm), const BIOCGHDRCMPLT = 1074020980 +pkg syscall (netbsd-arm), const BIOCGRTIMEOUT = 1074545275 +pkg syscall (netbsd-arm), const BIOCGSEESENT = 1074020984 +pkg syscall (netbsd-arm), const BIOCGSTATS = 1082147439 +pkg syscall (netbsd-arm), const BIOCGSTATSOLD = 1074283119 +pkg syscall (netbsd-arm), const BIOCIMMEDIATE = 2147762800 +pkg syscall (netbsd-arm), const BIOCPROMISC = 536887913 +pkg syscall (netbsd-arm), const BIOCSBLEN = 3221504614 +pkg syscall (netbsd-arm), const BIOCSDLT = 2147762806 +pkg syscall (netbsd-arm), const BIOCSETF = 2148024935 +pkg syscall (netbsd-arm), const BIOCSETIF = 2156937836 +pkg syscall (netbsd-arm), const BIOCSFEEDBACK = 2147762813 +pkg syscall (netbsd-arm), const BIOCSHDRCMPLT = 2147762805 +pkg syscall (netbsd-arm), const BIOCSRTIMEOUT = 2148287098 +pkg syscall (netbsd-arm), const BIOCSSEESENT = 2147762809 +pkg syscall (netbsd-arm), const BIOCSTCPF = 2148024946 +pkg syscall (netbsd-arm), const BIOCSUDPF = 2148024947 +pkg syscall (netbsd-arm), const BIOCVERSION = 1074020977 +pkg syscall (netbsd-arm), const BPF_A = 16 +pkg syscall (netbsd-arm), const BPF_ABS = 32 +pkg syscall (netbsd-arm), const BPF_ADD = 0 +pkg syscall (netbsd-arm), const BPF_ALIGNMENT = 4 +pkg syscall (netbsd-arm), const BPF_ALIGNMENT32 = 4 +pkg syscall (netbsd-arm), const BPF_ALU = 4 +pkg syscall (netbsd-arm), const BPF_AND = 80 +pkg syscall (netbsd-arm), const BPF_B = 16 +pkg syscall (netbsd-arm), const BPF_DFLTBUFSIZE = 1048576 +pkg syscall (netbsd-arm), const BPF_DIV = 48 +pkg syscall (netbsd-arm), const BPF_H = 8 +pkg syscall (netbsd-arm), const BPF_IMM = 0 +pkg syscall (netbsd-arm), const BPF_IND = 64 +pkg syscall (netbsd-arm), const BPF_JA = 0 +pkg syscall (netbsd-arm), const BPF_JEQ = 16 +pkg syscall (netbsd-arm), const BPF_JGE = 48 +pkg syscall (netbsd-arm), const BPF_JGT = 32 +pkg syscall (netbsd-arm), const BPF_JMP = 5 +pkg syscall (netbsd-arm), const BPF_JSET = 64 +pkg syscall (netbsd-arm), const BPF_K = 0 +pkg syscall (netbsd-arm), const BPF_LD = 0 +pkg syscall (netbsd-arm), const BPF_LDX = 1 +pkg syscall (netbsd-arm), const BPF_LEN = 128 +pkg syscall (netbsd-arm), const BPF_LSH = 96 +pkg syscall (netbsd-arm), const BPF_MAJOR_VERSION = 1 +pkg syscall (netbsd-arm), const BPF_MAXBUFSIZE = 16777216 +pkg syscall (netbsd-arm), const BPF_MAXINSNS = 512 +pkg syscall (netbsd-arm), const BPF_MEM = 96 +pkg syscall (netbsd-arm), const BPF_MEMWORDS = 16 +pkg syscall (netbsd-arm), const BPF_MINBUFSIZE = 32 +pkg syscall (netbsd-arm), const BPF_MINOR_VERSION = 1 +pkg syscall (netbsd-arm), const BPF_MISC = 7 +pkg syscall (netbsd-arm), const BPF_MSH = 160 +pkg syscall (netbsd-arm), const BPF_MUL = 32 +pkg syscall (netbsd-arm), const BPF_NEG = 128 +pkg syscall (netbsd-arm), const BPF_OR = 64 +pkg syscall (netbsd-arm), const BPF_RELEASE = 199606 +pkg syscall (netbsd-arm), const BPF_RET = 6 +pkg syscall (netbsd-arm), const BPF_RSH = 112 +pkg syscall (netbsd-arm), const BPF_ST = 2 +pkg syscall (netbsd-arm), const BPF_STX = 3 +pkg syscall (netbsd-arm), const BPF_SUB = 16 +pkg syscall (netbsd-arm), const BPF_TAX = 0 +pkg syscall (netbsd-arm), const BPF_TXA = 128 +pkg syscall (netbsd-arm), const BPF_W = 0 +pkg syscall (netbsd-arm), const BPF_X = 8 +pkg syscall (netbsd-arm), const BRKINT = 2 +pkg syscall (netbsd-arm), const CFLUSH = 15 +pkg syscall (netbsd-arm), const CLOCAL = 32768 +pkg syscall (netbsd-arm), const CREAD = 2048 +pkg syscall (netbsd-arm), const CS5 = 0 +pkg syscall (netbsd-arm), const CS6 = 256 +pkg syscall (netbsd-arm), const CS7 = 512 +pkg syscall (netbsd-arm), const CS8 = 768 +pkg syscall (netbsd-arm), const CSIZE = 768 +pkg syscall (netbsd-arm), const CSTART = 17 +pkg syscall (netbsd-arm), const CSTATUS = 20 +pkg syscall (netbsd-arm), const CSTOP = 19 +pkg syscall (netbsd-arm), const CSTOPB = 1024 +pkg syscall (netbsd-arm), const CSUSP = 26 +pkg syscall (netbsd-arm), const CTL_MAXNAME = 12 +pkg syscall (netbsd-arm), const CTL_NET = 4 +pkg syscall (netbsd-arm), const CTL_QUERY = -2 +pkg syscall (netbsd-arm), const DIOCBSFLUSH = 536896632 +pkg syscall (netbsd-arm), const DLT_A429 = 184 +pkg syscall (netbsd-arm), const DLT_A653_ICM = 185 +pkg syscall (netbsd-arm), const DLT_AIRONET_HEADER = 120 +pkg syscall (netbsd-arm), const DLT_AOS = 222 +pkg syscall (netbsd-arm), const DLT_APPLE_IP_OVER_IEEE1394 = 138 +pkg syscall (netbsd-arm), const DLT_ARCNET = 7 +pkg syscall (netbsd-arm), const DLT_ARCNET_LINUX = 129 +pkg syscall (netbsd-arm), const DLT_ATM_CLIP = 19 +pkg syscall (netbsd-arm), const DLT_ATM_RFC1483 = 11 +pkg syscall (netbsd-arm), const DLT_AURORA = 126 +pkg syscall (netbsd-arm), const DLT_AX25 = 3 +pkg syscall (netbsd-arm), const DLT_AX25_KISS = 202 +pkg syscall (netbsd-arm), const DLT_BACNET_MS_TP = 165 +pkg syscall (netbsd-arm), const DLT_BLUETOOTH_HCI_H4 = 187 +pkg syscall (netbsd-arm), const DLT_BLUETOOTH_HCI_H4_WITH_PHDR = 201 +pkg syscall (netbsd-arm), const DLT_CAN20B = 190 +pkg syscall (netbsd-arm), const DLT_CAN_SOCKETCAN = 227 +pkg syscall (netbsd-arm), const DLT_CHAOS = 5 +pkg syscall (netbsd-arm), const DLT_CISCO_IOS = 118 +pkg syscall (netbsd-arm), const DLT_C_HDLC = 104 +pkg syscall (netbsd-arm), const DLT_C_HDLC_WITH_DIR = 205 +pkg syscall (netbsd-arm), const DLT_DECT = 221 +pkg syscall (netbsd-arm), const DLT_DOCSIS = 143 +pkg syscall (netbsd-arm), const DLT_ECONET = 115 +pkg syscall (netbsd-arm), const DLT_EN10MB = 1 +pkg syscall (netbsd-arm), const DLT_EN3MB = 2 +pkg syscall (netbsd-arm), const DLT_ENC = 109 +pkg syscall (netbsd-arm), const DLT_ERF = 197 +pkg syscall (netbsd-arm), const DLT_ERF_ETH = 175 +pkg syscall (netbsd-arm), const DLT_ERF_POS = 176 +pkg syscall (netbsd-arm), const DLT_FC_2 = 224 +pkg syscall (netbsd-arm), const DLT_FC_2_WITH_FRAME_DELIMS = 225 +pkg syscall (netbsd-arm), const DLT_FDDI = 10 +pkg syscall (netbsd-arm), const DLT_FLEXRAY = 210 +pkg syscall (netbsd-arm), const DLT_FRELAY = 107 +pkg syscall (netbsd-arm), const DLT_FRELAY_WITH_DIR = 206 +pkg syscall (netbsd-arm), const DLT_GCOM_SERIAL = 173 +pkg syscall (netbsd-arm), const DLT_GCOM_T1E1 = 172 +pkg syscall (netbsd-arm), const DLT_GPF_F = 171 +pkg syscall (netbsd-arm), const DLT_GPF_T = 170 +pkg syscall (netbsd-arm), const DLT_GPRS_LLC = 169 +pkg syscall (netbsd-arm), const DLT_GSMTAP_ABIS = 218 +pkg syscall (netbsd-arm), const DLT_GSMTAP_UM = 217 +pkg syscall (netbsd-arm), const DLT_HDLC = 16 +pkg syscall (netbsd-arm), const DLT_HHDLC = 121 +pkg syscall (netbsd-arm), const DLT_HIPPI = 15 +pkg syscall (netbsd-arm), const DLT_IBM_SN = 146 +pkg syscall (netbsd-arm), const DLT_IBM_SP = 145 +pkg syscall (netbsd-arm), const DLT_IEEE802 = 6 +pkg syscall (netbsd-arm), const DLT_IEEE802_11 = 105 +pkg syscall (netbsd-arm), const DLT_IEEE802_11_RADIO = 127 +pkg syscall (netbsd-arm), const DLT_IEEE802_11_RADIO_AVS = 163 +pkg syscall (netbsd-arm), const DLT_IEEE802_15_4 = 195 +pkg syscall (netbsd-arm), const DLT_IEEE802_15_4_LINUX = 191 +pkg syscall (netbsd-arm), const DLT_IEEE802_15_4_NONASK_PHY = 215 +pkg syscall (netbsd-arm), const DLT_IEEE802_16_MAC_CPS = 188 +pkg syscall (netbsd-arm), const DLT_IEEE802_16_MAC_CPS_RADIO = 193 +pkg syscall (netbsd-arm), const DLT_IPMB = 199 +pkg syscall (netbsd-arm), const DLT_IPMB_LINUX = 209 +pkg syscall (netbsd-arm), const DLT_IPNET = 226 +pkg syscall (netbsd-arm), const DLT_IPV4 = 228 +pkg syscall (netbsd-arm), const DLT_IPV6 = 229 +pkg syscall (netbsd-arm), const DLT_IP_OVER_FC = 122 +pkg syscall (netbsd-arm), const DLT_JUNIPER_ATM1 = 137 +pkg syscall (netbsd-arm), const DLT_JUNIPER_ATM2 = 135 +pkg syscall (netbsd-arm), const DLT_JUNIPER_CHDLC = 181 +pkg syscall (netbsd-arm), const DLT_JUNIPER_ES = 132 +pkg syscall (netbsd-arm), const DLT_JUNIPER_ETHER = 178 +pkg syscall (netbsd-arm), const DLT_JUNIPER_FRELAY = 180 +pkg syscall (netbsd-arm), const DLT_JUNIPER_GGSN = 133 +pkg syscall (netbsd-arm), const DLT_JUNIPER_ISM = 194 +pkg syscall (netbsd-arm), const DLT_JUNIPER_MFR = 134 +pkg syscall (netbsd-arm), const DLT_JUNIPER_MLFR = 131 +pkg syscall (netbsd-arm), const DLT_JUNIPER_MLPPP = 130 +pkg syscall (netbsd-arm), const DLT_JUNIPER_MONITOR = 164 +pkg syscall (netbsd-arm), const DLT_JUNIPER_PIC_PEER = 174 +pkg syscall (netbsd-arm), const DLT_JUNIPER_PPP = 179 +pkg syscall (netbsd-arm), const DLT_JUNIPER_PPPOE = 167 +pkg syscall (netbsd-arm), const DLT_JUNIPER_PPPOE_ATM = 168 +pkg syscall (netbsd-arm), const DLT_JUNIPER_SERVICES = 136 +pkg syscall (netbsd-arm), const DLT_JUNIPER_ST = 200 +pkg syscall (netbsd-arm), const DLT_JUNIPER_VP = 183 +pkg syscall (netbsd-arm), const DLT_LAPB_WITH_DIR = 207 +pkg syscall (netbsd-arm), const DLT_LAPD = 203 +pkg syscall (netbsd-arm), const DLT_LIN = 212 +pkg syscall (netbsd-arm), const DLT_LINUX_EVDEV = 216 +pkg syscall (netbsd-arm), const DLT_LINUX_IRDA = 144 +pkg syscall (netbsd-arm), const DLT_LINUX_LAPD = 177 +pkg syscall (netbsd-arm), const DLT_LINUX_SLL = 113 +pkg syscall (netbsd-arm), const DLT_LOOP = 108 +pkg syscall (netbsd-arm), const DLT_LTALK = 114 +pkg syscall (netbsd-arm), const DLT_MFR = 182 +pkg syscall (netbsd-arm), const DLT_MOST = 211 +pkg syscall (netbsd-arm), const DLT_MPLS = 219 +pkg syscall (netbsd-arm), const DLT_MTP2 = 140 +pkg syscall (netbsd-arm), const DLT_MTP2_WITH_PHDR = 139 +pkg syscall (netbsd-arm), const DLT_MTP3 = 141 +pkg syscall (netbsd-arm), const DLT_NULL = 0 +pkg syscall (netbsd-arm), const DLT_PCI_EXP = 125 +pkg syscall (netbsd-arm), const DLT_PFLOG = 117 +pkg syscall (netbsd-arm), const DLT_PFSYNC = 18 +pkg syscall (netbsd-arm), const DLT_PPI = 192 +pkg syscall (netbsd-arm), const DLT_PPP = 9 +pkg syscall (netbsd-arm), const DLT_PPP_BSDOS = 14 +pkg syscall (netbsd-arm), const DLT_PPP_ETHER = 51 +pkg syscall (netbsd-arm), const DLT_PPP_PPPD = 166 +pkg syscall (netbsd-arm), const DLT_PPP_SERIAL = 50 +pkg syscall (netbsd-arm), const DLT_PPP_WITH_DIR = 204 +pkg syscall (netbsd-arm), const DLT_PRISM_HEADER = 119 +pkg syscall (netbsd-arm), const DLT_PRONET = 4 +pkg syscall (netbsd-arm), const DLT_RAIF1 = 198 +pkg syscall (netbsd-arm), const DLT_RAW = 12 +pkg syscall (netbsd-arm), const DLT_RAWAF_MASK = 35913728 +pkg syscall (netbsd-arm), const DLT_RIO = 124 +pkg syscall (netbsd-arm), const DLT_SCCP = 142 +pkg syscall (netbsd-arm), const DLT_SITA = 196 +pkg syscall (netbsd-arm), const DLT_SLIP = 8 +pkg syscall (netbsd-arm), const DLT_SLIP_BSDOS = 13 +pkg syscall (netbsd-arm), const DLT_SUNATM = 123 +pkg syscall (netbsd-arm), const DLT_SYMANTEC_FIREWALL = 99 +pkg syscall (netbsd-arm), const DLT_TZSP = 128 +pkg syscall (netbsd-arm), const DLT_USB = 186 +pkg syscall (netbsd-arm), const DLT_USB_LINUX = 189 +pkg syscall (netbsd-arm), const DLT_USB_LINUX_MMAPPED = 220 +pkg syscall (netbsd-arm), const DLT_WIHART = 223 +pkg syscall (netbsd-arm), const DLT_X2E_SERIAL = 213 +pkg syscall (netbsd-arm), const DLT_X2E_XORAYA = 214 +pkg syscall (netbsd-arm), const DT_BLK = 6 +pkg syscall (netbsd-arm), const DT_CHR = 2 +pkg syscall (netbsd-arm), const DT_DIR = 4 +pkg syscall (netbsd-arm), const DT_FIFO = 1 +pkg syscall (netbsd-arm), const DT_LNK = 10 +pkg syscall (netbsd-arm), const DT_REG = 8 +pkg syscall (netbsd-arm), const DT_SOCK = 12 +pkg syscall (netbsd-arm), const DT_UNKNOWN = 0 +pkg syscall (netbsd-arm), const DT_WHT = 14 +pkg syscall (netbsd-arm), const E2BIG = 7 +pkg syscall (netbsd-arm), const EACCES = 13 +pkg syscall (netbsd-arm), const EADDRINUSE = 48 +pkg syscall (netbsd-arm), const EADDRNOTAVAIL = 49 +pkg syscall (netbsd-arm), const EAFNOSUPPORT = 47 +pkg syscall (netbsd-arm), const EAGAIN = 35 +pkg syscall (netbsd-arm), const EALREADY = 37 +pkg syscall (netbsd-arm), const EAUTH = 80 +pkg syscall (netbsd-arm), const EBADF = 9 +pkg syscall (netbsd-arm), const EBADMSG = 88 +pkg syscall (netbsd-arm), const EBADRPC = 72 +pkg syscall (netbsd-arm), const EBUSY = 16 +pkg syscall (netbsd-arm), const ECANCELED = 87 +pkg syscall (netbsd-arm), const ECHILD = 10 +pkg syscall (netbsd-arm), const ECHO = 8 +pkg syscall (netbsd-arm), const ECHOCTL = 64 +pkg syscall (netbsd-arm), const ECHOE = 2 +pkg syscall (netbsd-arm), const ECHOK = 4 +pkg syscall (netbsd-arm), const ECHOKE = 1 +pkg syscall (netbsd-arm), const ECHONL = 16 +pkg syscall (netbsd-arm), const ECHOPRT = 32 +pkg syscall (netbsd-arm), const ECONNABORTED = 53 +pkg syscall (netbsd-arm), const ECONNREFUSED = 61 +pkg syscall (netbsd-arm), const ECONNRESET = 54 +pkg syscall (netbsd-arm), const EDEADLK = 11 +pkg syscall (netbsd-arm), const EDESTADDRREQ = 39 +pkg syscall (netbsd-arm), const EDOM = 33 +pkg syscall (netbsd-arm), const EDQUOT = 69 +pkg syscall (netbsd-arm), const EEXIST = 17 +pkg syscall (netbsd-arm), const EFAULT = 14 +pkg syscall (netbsd-arm), const EFBIG = 27 +pkg syscall (netbsd-arm), const EFTYPE = 79 +pkg syscall (netbsd-arm), const EHOSTDOWN = 64 +pkg syscall (netbsd-arm), const EHOSTUNREACH = 65 +pkg syscall (netbsd-arm), const EIDRM = 82 +pkg syscall (netbsd-arm), const EILSEQ = 85 +pkg syscall (netbsd-arm), const EINPROGRESS = 36 +pkg syscall (netbsd-arm), const EINTR = 4 +pkg syscall (netbsd-arm), const EINVAL = 22 +pkg syscall (netbsd-arm), const EIO = 5 +pkg syscall (netbsd-arm), const EISCONN = 56 +pkg syscall (netbsd-arm), const EISDIR = 21 +pkg syscall (netbsd-arm), const ELAST = 96 +pkg syscall (netbsd-arm), const ELOOP = 62 +pkg syscall (netbsd-arm), const EMFILE = 24 +pkg syscall (netbsd-arm), const EMLINK = 31 +pkg syscall (netbsd-arm), const EMSGSIZE = 40 +pkg syscall (netbsd-arm), const EMULTIHOP = 94 +pkg syscall (netbsd-arm), const EMUL_LINUX = 1 +pkg syscall (netbsd-arm), const EMUL_LINUX32 = 5 +pkg syscall (netbsd-arm), const EMUL_MAXID = 6 +pkg syscall (netbsd-arm), const ENAMETOOLONG = 63 +pkg syscall (netbsd-arm), const ENEEDAUTH = 81 +pkg syscall (netbsd-arm), const ENETDOWN = 50 +pkg syscall (netbsd-arm), const ENETRESET = 52 +pkg syscall (netbsd-arm), const ENETUNREACH = 51 +pkg syscall (netbsd-arm), const ENFILE = 23 +pkg syscall (netbsd-arm), const ENOATTR = 93 +pkg syscall (netbsd-arm), const ENOBUFS = 55 +pkg syscall (netbsd-arm), const ENODATA = 89 +pkg syscall (netbsd-arm), const ENODEV = 19 +pkg syscall (netbsd-arm), const ENOEXEC = 8 +pkg syscall (netbsd-arm), const ENOLCK = 77 +pkg syscall (netbsd-arm), const ENOLINK = 95 +pkg syscall (netbsd-arm), const ENOMEM = 12 +pkg syscall (netbsd-arm), const ENOMSG = 83 +pkg syscall (netbsd-arm), const ENOPROTOOPT = 42 +pkg syscall (netbsd-arm), const ENOSPC = 28 +pkg syscall (netbsd-arm), const ENOSR = 90 +pkg syscall (netbsd-arm), const ENOSTR = 91 +pkg syscall (netbsd-arm), const ENOSYS = 78 +pkg syscall (netbsd-arm), const ENOTBLK = 15 +pkg syscall (netbsd-arm), const ENOTCONN = 57 +pkg syscall (netbsd-arm), const ENOTDIR = 20 +pkg syscall (netbsd-arm), const ENOTEMPTY = 66 +pkg syscall (netbsd-arm), const ENOTSOCK = 38 +pkg syscall (netbsd-arm), const ENOTSUP = 86 +pkg syscall (netbsd-arm), const ENOTTY = 25 +pkg syscall (netbsd-arm), const ENXIO = 6 +pkg syscall (netbsd-arm), const EOPNOTSUPP = 45 +pkg syscall (netbsd-arm), const EOVERFLOW = 84 +pkg syscall (netbsd-arm), const EPERM = 1 +pkg syscall (netbsd-arm), const EPFNOSUPPORT = 46 +pkg syscall (netbsd-arm), const EPIPE = 32 +pkg syscall (netbsd-arm), const EPROCLIM = 67 +pkg syscall (netbsd-arm), const EPROCUNAVAIL = 76 +pkg syscall (netbsd-arm), const EPROGMISMATCH = 75 +pkg syscall (netbsd-arm), const EPROGUNAVAIL = 74 +pkg syscall (netbsd-arm), const EPROTO = 96 +pkg syscall (netbsd-arm), const EPROTONOSUPPORT = 43 +pkg syscall (netbsd-arm), const EPROTOTYPE = 41 +pkg syscall (netbsd-arm), const ERANGE = 34 +pkg syscall (netbsd-arm), const EREMOTE = 71 +pkg syscall (netbsd-arm), const EROFS = 30 +pkg syscall (netbsd-arm), const ERPCMISMATCH = 73 +pkg syscall (netbsd-arm), const ESHUTDOWN = 58 +pkg syscall (netbsd-arm), const ESOCKTNOSUPPORT = 44 +pkg syscall (netbsd-arm), const ESPIPE = 29 +pkg syscall (netbsd-arm), const ESRCH = 3 +pkg syscall (netbsd-arm), const ESTALE = 70 +pkg syscall (netbsd-arm), const ETHERCAP_JUMBO_MTU = 4 +pkg syscall (netbsd-arm), const ETHERCAP_VLAN_HWTAGGING = 2 +pkg syscall (netbsd-arm), const ETHERCAP_VLAN_MTU = 1 +pkg syscall (netbsd-arm), const ETHERMIN = 46 +pkg syscall (netbsd-arm), const ETHERMTU = 1500 +pkg syscall (netbsd-arm), const ETHERMTU_JUMBO = 9000 +pkg syscall (netbsd-arm), const ETHERTYPE_8023 = 4 +pkg syscall (netbsd-arm), const ETHERTYPE_AARP = 33011 +pkg syscall (netbsd-arm), const ETHERTYPE_ACCTON = 33680 +pkg syscall (netbsd-arm), const ETHERTYPE_AEONIC = 32822 +pkg syscall (netbsd-arm), const ETHERTYPE_ALPHA = 33098 +pkg syscall (netbsd-arm), const ETHERTYPE_AMBER = 24584 +pkg syscall (netbsd-arm), const ETHERTYPE_AMOEBA = 33093 +pkg syscall (netbsd-arm), const ETHERTYPE_APOLLO = 33015 +pkg syscall (netbsd-arm), const ETHERTYPE_APOLLODOMAIN = 32793 +pkg syscall (netbsd-arm), const ETHERTYPE_APPLETALK = 32923 +pkg syscall (netbsd-arm), const ETHERTYPE_APPLITEK = 32967 +pkg syscall (netbsd-arm), const ETHERTYPE_ARGONAUT = 32826 +pkg syscall (netbsd-arm), const ETHERTYPE_ARP = 2054 +pkg syscall (netbsd-arm), const ETHERTYPE_AT = 32923 +pkg syscall (netbsd-arm), const ETHERTYPE_ATALK = 32923 +pkg syscall (netbsd-arm), const ETHERTYPE_ATOMIC = 34527 +pkg syscall (netbsd-arm), const ETHERTYPE_ATT = 32873 +pkg syscall (netbsd-arm), const ETHERTYPE_ATTSTANFORD = 32776 +pkg syscall (netbsd-arm), const ETHERTYPE_AUTOPHON = 32874 +pkg syscall (netbsd-arm), const ETHERTYPE_AXIS = 34902 +pkg syscall (netbsd-arm), const ETHERTYPE_BCLOOP = 36867 +pkg syscall (netbsd-arm), const ETHERTYPE_BOFL = 33026 +pkg syscall (netbsd-arm), const ETHERTYPE_CABLETRON = 28724 +pkg syscall (netbsd-arm), const ETHERTYPE_CHAOS = 2052 +pkg syscall (netbsd-arm), const ETHERTYPE_COMDESIGN = 32876 +pkg syscall (netbsd-arm), const ETHERTYPE_COMPUGRAPHIC = 32877 +pkg syscall (netbsd-arm), const ETHERTYPE_COUNTERPOINT = 32866 +pkg syscall (netbsd-arm), const ETHERTYPE_CRONUS = 32772 +pkg syscall (netbsd-arm), const ETHERTYPE_CRONUSVLN = 32771 +pkg syscall (netbsd-arm), const ETHERTYPE_DCA = 4660 +pkg syscall (netbsd-arm), const ETHERTYPE_DDE = 32891 +pkg syscall (netbsd-arm), const ETHERTYPE_DEBNI = 43690 +pkg syscall (netbsd-arm), const ETHERTYPE_DECAM = 32840 +pkg syscall (netbsd-arm), const ETHERTYPE_DECCUST = 24582 +pkg syscall (netbsd-arm), const ETHERTYPE_DECDIAG = 24581 +pkg syscall (netbsd-arm), const ETHERTYPE_DECDNS = 32828 +pkg syscall (netbsd-arm), const ETHERTYPE_DECDTS = 32830 +pkg syscall (netbsd-arm), const ETHERTYPE_DECEXPER = 24576 +pkg syscall (netbsd-arm), const ETHERTYPE_DECLAST = 32833 +pkg syscall (netbsd-arm), const ETHERTYPE_DECLTM = 32831 +pkg syscall (netbsd-arm), const ETHERTYPE_DECMUMPS = 24585 +pkg syscall (netbsd-arm), const ETHERTYPE_DECNETBIOS = 32832 +pkg syscall (netbsd-arm), const ETHERTYPE_DELTACON = 34526 +pkg syscall (netbsd-arm), const ETHERTYPE_DIDDLE = 17185 +pkg syscall (netbsd-arm), const ETHERTYPE_DLOG1 = 1632 +pkg syscall (netbsd-arm), const ETHERTYPE_DLOG2 = 1633 +pkg syscall (netbsd-arm), const ETHERTYPE_DN = 24579 +pkg syscall (netbsd-arm), const ETHERTYPE_DOGFIGHT = 6537 +pkg syscall (netbsd-arm), const ETHERTYPE_DSMD = 32825 +pkg syscall (netbsd-arm), const ETHERTYPE_ECMA = 2051 +pkg syscall (netbsd-arm), const ETHERTYPE_ENCRYPT = 32829 +pkg syscall (netbsd-arm), const ETHERTYPE_ES = 32861 +pkg syscall (netbsd-arm), const ETHERTYPE_EXCELAN = 32784 +pkg syscall (netbsd-arm), const ETHERTYPE_EXPERDATA = 32841 +pkg syscall (netbsd-arm), const ETHERTYPE_FLIP = 33094 +pkg syscall (netbsd-arm), const ETHERTYPE_FLOWCONTROL = 34824 +pkg syscall (netbsd-arm), const ETHERTYPE_FRARP = 2056 +pkg syscall (netbsd-arm), const ETHERTYPE_GENDYN = 32872 +pkg syscall (netbsd-arm), const ETHERTYPE_HAYES = 33072 +pkg syscall (netbsd-arm), const ETHERTYPE_HIPPI_FP = 33152 +pkg syscall (netbsd-arm), const ETHERTYPE_HITACHI = 34848 +pkg syscall (netbsd-arm), const ETHERTYPE_HP = 32773 +pkg syscall (netbsd-arm), const ETHERTYPE_IEEEPUP = 2560 +pkg syscall (netbsd-arm), const ETHERTYPE_IEEEPUPAT = 2561 +pkg syscall (netbsd-arm), const ETHERTYPE_IMLBL = 19522 +pkg syscall (netbsd-arm), const ETHERTYPE_IMLBLDIAG = 16972 +pkg syscall (netbsd-arm), const ETHERTYPE_IP = 2048 +pkg syscall (netbsd-arm), const ETHERTYPE_IPAS = 34668 +pkg syscall (netbsd-arm), const ETHERTYPE_IPV6 = 34525 +pkg syscall (netbsd-arm), const ETHERTYPE_IPX = 33079 +pkg syscall (netbsd-arm), const ETHERTYPE_IPXNEW = 32823 +pkg syscall (netbsd-arm), const ETHERTYPE_KALPANA = 34178 +pkg syscall (netbsd-arm), const ETHERTYPE_LANBRIDGE = 32824 +pkg syscall (netbsd-arm), const ETHERTYPE_LANPROBE = 34952 +pkg syscall (netbsd-arm), const ETHERTYPE_LAT = 24580 +pkg syscall (netbsd-arm), const ETHERTYPE_LBACK = 36864 +pkg syscall (netbsd-arm), const ETHERTYPE_LITTLE = 32864 +pkg syscall (netbsd-arm), const ETHERTYPE_LOGICRAFT = 33096 +pkg syscall (netbsd-arm), const ETHERTYPE_LOOPBACK = 36864 +pkg syscall (netbsd-arm), const ETHERTYPE_MATRA = 32890 +pkg syscall (netbsd-arm), const ETHERTYPE_MAX = 65535 +pkg syscall (netbsd-arm), const ETHERTYPE_MERIT = 32892 +pkg syscall (netbsd-arm), const ETHERTYPE_MICP = 34618 +pkg syscall (netbsd-arm), const ETHERTYPE_MOPDL = 24577 +pkg syscall (netbsd-arm), const ETHERTYPE_MOPRC = 24578 +pkg syscall (netbsd-arm), const ETHERTYPE_MOTOROLA = 33165 +pkg syscall (netbsd-arm), const ETHERTYPE_MPLS = 34887 +pkg syscall (netbsd-arm), const ETHERTYPE_MPLS_MCAST = 34888 +pkg syscall (netbsd-arm), const ETHERTYPE_MUMPS = 33087 +pkg syscall (netbsd-arm), const ETHERTYPE_NBPCC = 15364 +pkg syscall (netbsd-arm), const ETHERTYPE_NBPCLAIM = 15369 +pkg syscall (netbsd-arm), const ETHERTYPE_NBPCLREQ = 15365 +pkg syscall (netbsd-arm), const ETHERTYPE_NBPCLRSP = 15366 +pkg syscall (netbsd-arm), const ETHERTYPE_NBPCREQ = 15362 +pkg syscall (netbsd-arm), const ETHERTYPE_NBPCRSP = 15363 +pkg syscall (netbsd-arm), const ETHERTYPE_NBPDG = 15367 +pkg syscall (netbsd-arm), const ETHERTYPE_NBPDGB = 15368 +pkg syscall (netbsd-arm), const ETHERTYPE_NBPDLTE = 15370 +pkg syscall (netbsd-arm), const ETHERTYPE_NBPRAR = 15372 +pkg syscall (netbsd-arm), const ETHERTYPE_NBPRAS = 15371 +pkg syscall (netbsd-arm), const ETHERTYPE_NBPRST = 15373 +pkg syscall (netbsd-arm), const ETHERTYPE_NBPSCD = 15361 +pkg syscall (netbsd-arm), const ETHERTYPE_NBPVCD = 15360 +pkg syscall (netbsd-arm), const ETHERTYPE_NBS = 2050 +pkg syscall (netbsd-arm), const ETHERTYPE_NCD = 33097 +pkg syscall (netbsd-arm), const ETHERTYPE_NESTAR = 32774 +pkg syscall (netbsd-arm), const ETHERTYPE_NETBEUI = 33169 +pkg syscall (netbsd-arm), const ETHERTYPE_NOVELL = 33080 +pkg syscall (netbsd-arm), const ETHERTYPE_NS = 1536 +pkg syscall (netbsd-arm), const ETHERTYPE_NSAT = 1537 +pkg syscall (netbsd-arm), const ETHERTYPE_NSCOMPAT = 2055 +pkg syscall (netbsd-arm), const ETHERTYPE_NTRAILER = 16 +pkg syscall (netbsd-arm), const ETHERTYPE_OS9 = 28679 +pkg syscall (netbsd-arm), const ETHERTYPE_OS9NET = 28681 +pkg syscall (netbsd-arm), const ETHERTYPE_PACER = 32966 +pkg syscall (netbsd-arm), const ETHERTYPE_PAE = 34958 +pkg syscall (netbsd-arm), const ETHERTYPE_PCS = 16962 +pkg syscall (netbsd-arm), const ETHERTYPE_PLANNING = 32836 +pkg syscall (netbsd-arm), const ETHERTYPE_PPP = 34827 +pkg syscall (netbsd-arm), const ETHERTYPE_PPPOE = 34916 +pkg syscall (netbsd-arm), const ETHERTYPE_PPPOEDISC = 34915 +pkg syscall (netbsd-arm), const ETHERTYPE_PRIMENTS = 28721 +pkg syscall (netbsd-arm), const ETHERTYPE_PUP = 512 +pkg syscall (netbsd-arm), const ETHERTYPE_PUPAT = 512 +pkg syscall (netbsd-arm), const ETHERTYPE_RACAL = 28720 +pkg syscall (netbsd-arm), const ETHERTYPE_RATIONAL = 33104 +pkg syscall (netbsd-arm), const ETHERTYPE_RAWFR = 25945 +pkg syscall (netbsd-arm), const ETHERTYPE_RCL = 6549 +pkg syscall (netbsd-arm), const ETHERTYPE_RDP = 34617 +pkg syscall (netbsd-arm), const ETHERTYPE_RETIX = 33010 +pkg syscall (netbsd-arm), const ETHERTYPE_REVARP = 32821 +pkg syscall (netbsd-arm), const ETHERTYPE_SCA = 24583 +pkg syscall (netbsd-arm), const ETHERTYPE_SECTRA = 34523 +pkg syscall (netbsd-arm), const ETHERTYPE_SECUREDATA = 34669 +pkg syscall (netbsd-arm), const ETHERTYPE_SGITW = 33150 +pkg syscall (netbsd-arm), const ETHERTYPE_SG_BOUNCE = 32790 +pkg syscall (netbsd-arm), const ETHERTYPE_SG_DIAG = 32787 +pkg syscall (netbsd-arm), const ETHERTYPE_SG_NETGAMES = 32788 +pkg syscall (netbsd-arm), const ETHERTYPE_SG_RESV = 32789 +pkg syscall (netbsd-arm), const ETHERTYPE_SIMNET = 21000 +pkg syscall (netbsd-arm), const ETHERTYPE_SLOWPROTOCOLS = 34825 +pkg syscall (netbsd-arm), const ETHERTYPE_SNA = 32981 +pkg syscall (netbsd-arm), const ETHERTYPE_SNMP = 33100 +pkg syscall (netbsd-arm), const ETHERTYPE_SONIX = 64245 +pkg syscall (netbsd-arm), const ETHERTYPE_SPIDER = 32927 +pkg syscall (netbsd-arm), const ETHERTYPE_SPRITE = 1280 +pkg syscall (netbsd-arm), const ETHERTYPE_STP = 33153 +pkg syscall (netbsd-arm), const ETHERTYPE_TALARIS = 33067 +pkg syscall (netbsd-arm), const ETHERTYPE_TALARISMC = 34091 +pkg syscall (netbsd-arm), const ETHERTYPE_TCPCOMP = 34667 +pkg syscall (netbsd-arm), const ETHERTYPE_TCPSM = 36866 +pkg syscall (netbsd-arm), const ETHERTYPE_TEC = 33103 +pkg syscall (netbsd-arm), const ETHERTYPE_TIGAN = 32815 +pkg syscall (netbsd-arm), const ETHERTYPE_TRAIL = 4096 +pkg syscall (netbsd-arm), const ETHERTYPE_TRANSETHER = 25944 +pkg syscall (netbsd-arm), const ETHERTYPE_TYMSHARE = 32814 +pkg syscall (netbsd-arm), const ETHERTYPE_UBBST = 28677 +pkg syscall (netbsd-arm), const ETHERTYPE_UBDEBUG = 2304 +pkg syscall (netbsd-arm), const ETHERTYPE_UBDIAGLOOP = 28674 +pkg syscall (netbsd-arm), const ETHERTYPE_UBDL = 28672 +pkg syscall (netbsd-arm), const ETHERTYPE_UBNIU = 28673 +pkg syscall (netbsd-arm), const ETHERTYPE_UBNMC = 28675 +pkg syscall (netbsd-arm), const ETHERTYPE_VALID = 5632 +pkg syscall (netbsd-arm), const ETHERTYPE_VARIAN = 32989 +pkg syscall (netbsd-arm), const ETHERTYPE_VAXELN = 32827 +pkg syscall (netbsd-arm), const ETHERTYPE_VEECO = 32871 +pkg syscall (netbsd-arm), const ETHERTYPE_VEXP = 32859 +pkg syscall (netbsd-arm), const ETHERTYPE_VGLAB = 33073 +pkg syscall (netbsd-arm), const ETHERTYPE_VINES = 2989 +pkg syscall (netbsd-arm), const ETHERTYPE_VINESECHO = 2991 +pkg syscall (netbsd-arm), const ETHERTYPE_VINESLOOP = 2990 +pkg syscall (netbsd-arm), const ETHERTYPE_VITAL = 65280 +pkg syscall (netbsd-arm), const ETHERTYPE_VLAN = 33024 +pkg syscall (netbsd-arm), const ETHERTYPE_VLTLMAN = 32896 +pkg syscall (netbsd-arm), const ETHERTYPE_VPROD = 32860 +pkg syscall (netbsd-arm), const ETHERTYPE_VURESERVED = 33095 +pkg syscall (netbsd-arm), const ETHERTYPE_WATERLOO = 33072 +pkg syscall (netbsd-arm), const ETHERTYPE_WELLFLEET = 33027 +pkg syscall (netbsd-arm), const ETHERTYPE_X25 = 2053 +pkg syscall (netbsd-arm), const ETHERTYPE_X75 = 2049 +pkg syscall (netbsd-arm), const ETHERTYPE_XNSSM = 36865 +pkg syscall (netbsd-arm), const ETHERTYPE_XTP = 33149 +pkg syscall (netbsd-arm), const ETHER_ADDR_LEN = 6 +pkg syscall (netbsd-arm), const ETHER_CRC_LEN = 4 +pkg syscall (netbsd-arm), const ETHER_CRC_POLY_BE = 79764918 +pkg syscall (netbsd-arm), const ETHER_CRC_POLY_LE = 3988292384 +pkg syscall (netbsd-arm), const ETHER_HDR_LEN = 14 +pkg syscall (netbsd-arm), const ETHER_MAX_LEN = 1518 +pkg syscall (netbsd-arm), const ETHER_MAX_LEN_JUMBO = 9018 +pkg syscall (netbsd-arm), const ETHER_MIN_LEN = 64 +pkg syscall (netbsd-arm), const ETHER_PPPOE_ENCAP_LEN = 8 +pkg syscall (netbsd-arm), const ETHER_TYPE_LEN = 2 +pkg syscall (netbsd-arm), const ETHER_VLAN_ENCAP_LEN = 4 +pkg syscall (netbsd-arm), const ETIME = 92 +pkg syscall (netbsd-arm), const ETIMEDOUT = 60 +pkg syscall (netbsd-arm), const ETOOMANYREFS = 59 +pkg syscall (netbsd-arm), const ETXTBSY = 26 +pkg syscall (netbsd-arm), const EUSERS = 68 +pkg syscall (netbsd-arm), const EVFILT_AIO = 2 +pkg syscall (netbsd-arm), const EVFILT_PROC = 4 +pkg syscall (netbsd-arm), const EVFILT_READ = 0 +pkg syscall (netbsd-arm), const EVFILT_SIGNAL = 5 +pkg syscall (netbsd-arm), const EVFILT_SYSCOUNT = 7 +pkg syscall (netbsd-arm), const EVFILT_TIMER = 6 +pkg syscall (netbsd-arm), const EVFILT_VNODE = 3 +pkg syscall (netbsd-arm), const EVFILT_WRITE = 1 +pkg syscall (netbsd-arm), const EV_ADD = 1 +pkg syscall (netbsd-arm), const EV_CLEAR = 32 +pkg syscall (netbsd-arm), const EV_DELETE = 2 +pkg syscall (netbsd-arm), const EV_DISABLE = 8 +pkg syscall (netbsd-arm), const EV_ENABLE = 4 +pkg syscall (netbsd-arm), const EV_EOF = 32768 +pkg syscall (netbsd-arm), const EV_ERROR = 16384 +pkg syscall (netbsd-arm), const EV_FLAG1 = 8192 +pkg syscall (netbsd-arm), const EV_ONESHOT = 16 +pkg syscall (netbsd-arm), const EV_SYSFLAGS = 61440 +pkg syscall (netbsd-arm), const EWOULDBLOCK = 35 +pkg syscall (netbsd-arm), const EXDEV = 18 +pkg syscall (netbsd-arm), const EXTA = 19200 +pkg syscall (netbsd-arm), const EXTB = 38400 +pkg syscall (netbsd-arm), const EXTPROC = 2048 +pkg syscall (netbsd-arm), const FD_CLOEXEC = 1 +pkg syscall (netbsd-arm), const FD_SETSIZE = 256 +pkg syscall (netbsd-arm), const FLUSHO = 8388608 +pkg syscall (netbsd-arm), const F_CLOSEM = 10 +pkg syscall (netbsd-arm), const F_DUPFD = 0 +pkg syscall (netbsd-arm), const F_DUPFD_CLOEXEC = 12 +pkg syscall (netbsd-arm), const F_FSCTL = -2147483648 +pkg syscall (netbsd-arm), const F_FSDIRMASK = 1879048192 +pkg syscall (netbsd-arm), const F_FSIN = 268435456 +pkg syscall (netbsd-arm), const F_FSINOUT = 805306368 +pkg syscall (netbsd-arm), const F_FSOUT = 536870912 +pkg syscall (netbsd-arm), const F_FSPRIV = 32768 +pkg syscall (netbsd-arm), const F_FSVOID = 1073741824 +pkg syscall (netbsd-arm), const F_GETFD = 1 +pkg syscall (netbsd-arm), const F_GETFL = 3 +pkg syscall (netbsd-arm), const F_GETLK = 7 +pkg syscall (netbsd-arm), const F_GETNOSIGPIPE = 13 +pkg syscall (netbsd-arm), const F_GETOWN = 5 +pkg syscall (netbsd-arm), const F_MAXFD = 11 +pkg syscall (netbsd-arm), const F_OK = 0 +pkg syscall (netbsd-arm), const F_PARAM_MASK = 4095 +pkg syscall (netbsd-arm), const F_PARAM_MAX = 4095 +pkg syscall (netbsd-arm), const F_RDLCK = 1 +pkg syscall (netbsd-arm), const F_SETFD = 2 +pkg syscall (netbsd-arm), const F_SETFL = 4 +pkg syscall (netbsd-arm), const F_SETLK = 8 +pkg syscall (netbsd-arm), const F_SETLKW = 9 +pkg syscall (netbsd-arm), const F_SETNOSIGPIPE = 14 +pkg syscall (netbsd-arm), const F_SETOWN = 6 +pkg syscall (netbsd-arm), const F_UNLCK = 2 +pkg syscall (netbsd-arm), const F_WRLCK = 3 +pkg syscall (netbsd-arm), const HUPCL = 16384 +pkg syscall (netbsd-arm), const ICANON = 256 +pkg syscall (netbsd-arm), const ICRNL = 256 +pkg syscall (netbsd-arm), const IEXTEN = 1024 +pkg syscall (netbsd-arm), const IFAN_ARRIVAL = 0 +pkg syscall (netbsd-arm), const IFAN_DEPARTURE = 1 +pkg syscall (netbsd-arm), const IFA_ROUTE = 1 +pkg syscall (netbsd-arm), const IFF_ALLMULTI = 512 +pkg syscall (netbsd-arm), const IFF_CANTCHANGE = 36690 +pkg syscall (netbsd-arm), const IFF_DEBUG = 4 +pkg syscall (netbsd-arm), const IFF_LINK0 = 4096 +pkg syscall (netbsd-arm), const IFF_LINK1 = 8192 +pkg syscall (netbsd-arm), const IFF_LINK2 = 16384 +pkg syscall (netbsd-arm), const IFF_LOOPBACK = 8 +pkg syscall (netbsd-arm), const IFF_MULTICAST = 32768 +pkg syscall (netbsd-arm), const IFF_NOARP = 128 +pkg syscall (netbsd-arm), const IFF_NOTRAILERS = 32 +pkg syscall (netbsd-arm), const IFF_OACTIVE = 1024 +pkg syscall (netbsd-arm), const IFF_POINTOPOINT = 16 +pkg syscall (netbsd-arm), const IFF_PROMISC = 256 +pkg syscall (netbsd-arm), const IFF_RUNNING = 64 +pkg syscall (netbsd-arm), const IFF_SIMPLEX = 2048 +pkg syscall (netbsd-arm), const IFNAMSIZ = 16 +pkg syscall (netbsd-arm), const IFT_1822 = 2 +pkg syscall (netbsd-arm), const IFT_A12MPPSWITCH = 130 +pkg syscall (netbsd-arm), const IFT_AAL2 = 187 +pkg syscall (netbsd-arm), const IFT_AAL5 = 49 +pkg syscall (netbsd-arm), const IFT_ADSL = 94 +pkg syscall (netbsd-arm), const IFT_AFLANE8023 = 59 +pkg syscall (netbsd-arm), const IFT_AFLANE8025 = 60 +pkg syscall (netbsd-arm), const IFT_ARAP = 88 +pkg syscall (netbsd-arm), const IFT_ARCNET = 35 +pkg syscall (netbsd-arm), const IFT_ARCNETPLUS = 36 +pkg syscall (netbsd-arm), const IFT_ASYNC = 84 +pkg syscall (netbsd-arm), const IFT_ATM = 37 +pkg syscall (netbsd-arm), const IFT_ATMDXI = 105 +pkg syscall (netbsd-arm), const IFT_ATMFUNI = 106 +pkg syscall (netbsd-arm), const IFT_ATMIMA = 107 +pkg syscall (netbsd-arm), const IFT_ATMLOGICAL = 80 +pkg syscall (netbsd-arm), const IFT_ATMRADIO = 189 +pkg syscall (netbsd-arm), const IFT_ATMSUBINTERFACE = 134 +pkg syscall (netbsd-arm), const IFT_ATMVCIENDPT = 194 +pkg syscall (netbsd-arm), const IFT_ATMVIRTUAL = 149 +pkg syscall (netbsd-arm), const IFT_BGPPOLICYACCOUNTING = 162 +pkg syscall (netbsd-arm), const IFT_BRIDGE = 209 +pkg syscall (netbsd-arm), const IFT_BSC = 83 +pkg syscall (netbsd-arm), const IFT_CARP = 248 +pkg syscall (netbsd-arm), const IFT_CCTEMUL = 61 +pkg syscall (netbsd-arm), const IFT_CEPT = 19 +pkg syscall (netbsd-arm), const IFT_CES = 133 +pkg syscall (netbsd-arm), const IFT_CHANNEL = 70 +pkg syscall (netbsd-arm), const IFT_CNR = 85 +pkg syscall (netbsd-arm), const IFT_COFFEE = 132 +pkg syscall (netbsd-arm), const IFT_COMPOSITELINK = 155 +pkg syscall (netbsd-arm), const IFT_DCN = 141 +pkg syscall (netbsd-arm), const IFT_DIGITALPOWERLINE = 138 +pkg syscall (netbsd-arm), const IFT_DIGITALWRAPPEROVERHEADCHANNEL = 186 +pkg syscall (netbsd-arm), const IFT_DLSW = 74 +pkg syscall (netbsd-arm), const IFT_DOCSCABLEDOWNSTREAM = 128 +pkg syscall (netbsd-arm), const IFT_DOCSCABLEMACLAYER = 127 +pkg syscall (netbsd-arm), const IFT_DOCSCABLEUPSTREAM = 129 +pkg syscall (netbsd-arm), const IFT_DOCSCABLEUPSTREAMCHANNEL = 205 +pkg syscall (netbsd-arm), const IFT_DS0 = 81 +pkg syscall (netbsd-arm), const IFT_DS0BUNDLE = 82 +pkg syscall (netbsd-arm), const IFT_DS1FDL = 170 +pkg syscall (netbsd-arm), const IFT_DS3 = 30 +pkg syscall (netbsd-arm), const IFT_DTM = 140 +pkg syscall (netbsd-arm), const IFT_DVBASILN = 172 +pkg syscall (netbsd-arm), const IFT_DVBASIOUT = 173 +pkg syscall (netbsd-arm), const IFT_DVBRCCDOWNSTREAM = 147 +pkg syscall (netbsd-arm), const IFT_DVBRCCMACLAYER = 146 +pkg syscall (netbsd-arm), const IFT_DVBRCCUPSTREAM = 148 +pkg syscall (netbsd-arm), const IFT_ECONET = 206 +pkg syscall (netbsd-arm), const IFT_EON = 25 +pkg syscall (netbsd-arm), const IFT_EPLRS = 87 +pkg syscall (netbsd-arm), const IFT_ESCON = 73 +pkg syscall (netbsd-arm), const IFT_ETHER = 6 +pkg syscall (netbsd-arm), const IFT_FAITH = 242 +pkg syscall (netbsd-arm), const IFT_FAST = 125 +pkg syscall (netbsd-arm), const IFT_FASTETHER = 62 +pkg syscall (netbsd-arm), const IFT_FASTETHERFX = 69 +pkg syscall (netbsd-arm), const IFT_FDDI = 15 +pkg syscall (netbsd-arm), const IFT_FIBRECHANNEL = 56 +pkg syscall (netbsd-arm), const IFT_FRAMERELAYINTERCONNECT = 58 +pkg syscall (netbsd-arm), const IFT_FRAMERELAYMPI = 92 +pkg syscall (netbsd-arm), const IFT_FRDLCIENDPT = 193 +pkg syscall (netbsd-arm), const IFT_FRELAY = 32 +pkg syscall (netbsd-arm), const IFT_FRELAYDCE = 44 +pkg syscall (netbsd-arm), const IFT_FRF16MFRBUNDLE = 163 +pkg syscall (netbsd-arm), const IFT_FRFORWARD = 158 +pkg syscall (netbsd-arm), const IFT_G703AT2MB = 67 +pkg syscall (netbsd-arm), const IFT_G703AT64K = 66 +pkg syscall (netbsd-arm), const IFT_GIF = 240 +pkg syscall (netbsd-arm), const IFT_GIGABITETHERNET = 117 +pkg syscall (netbsd-arm), const IFT_GR303IDT = 178 +pkg syscall (netbsd-arm), const IFT_GR303RDT = 177 +pkg syscall (netbsd-arm), const IFT_H323GATEKEEPER = 164 +pkg syscall (netbsd-arm), const IFT_H323PROXY = 165 +pkg syscall (netbsd-arm), const IFT_HDH1822 = 3 +pkg syscall (netbsd-arm), const IFT_HDLC = 118 +pkg syscall (netbsd-arm), const IFT_HDSL2 = 168 +pkg syscall (netbsd-arm), const IFT_HIPERLAN2 = 183 +pkg syscall (netbsd-arm), const IFT_HIPPI = 47 +pkg syscall (netbsd-arm), const IFT_HIPPIINTERFACE = 57 +pkg syscall (netbsd-arm), const IFT_HOSTPAD = 90 +pkg syscall (netbsd-arm), const IFT_HSSI = 46 +pkg syscall (netbsd-arm), const IFT_HY = 14 +pkg syscall (netbsd-arm), const IFT_IBM370PARCHAN = 72 +pkg syscall (netbsd-arm), const IFT_IDSL = 154 +pkg syscall (netbsd-arm), const IFT_IEEE1394 = 144 +pkg syscall (netbsd-arm), const IFT_IEEE80211 = 71 +pkg syscall (netbsd-arm), const IFT_IEEE80212 = 55 +pkg syscall (netbsd-arm), const IFT_IEEE8023ADLAG = 161 +pkg syscall (netbsd-arm), const IFT_IFGSN = 145 +pkg syscall (netbsd-arm), const IFT_IMT = 190 +pkg syscall (netbsd-arm), const IFT_INFINIBAND = 199 +pkg syscall (netbsd-arm), const IFT_INTERLEAVE = 124 +pkg syscall (netbsd-arm), const IFT_IP = 126 +pkg syscall (netbsd-arm), const IFT_IPFORWARD = 142 +pkg syscall (netbsd-arm), const IFT_IPOVERATM = 114 +pkg syscall (netbsd-arm), const IFT_IPOVERCDLC = 109 +pkg syscall (netbsd-arm), const IFT_IPOVERCLAW = 110 +pkg syscall (netbsd-arm), const IFT_IPSWITCH = 78 +pkg syscall (netbsd-arm), const IFT_ISDN = 63 +pkg syscall (netbsd-arm), const IFT_ISDNBASIC = 20 +pkg syscall (netbsd-arm), const IFT_ISDNPRIMARY = 21 +pkg syscall (netbsd-arm), const IFT_ISDNS = 75 +pkg syscall (netbsd-arm), const IFT_ISDNU = 76 +pkg syscall (netbsd-arm), const IFT_ISO88022LLC = 41 +pkg syscall (netbsd-arm), const IFT_ISO88023 = 7 +pkg syscall (netbsd-arm), const IFT_ISO88024 = 8 +pkg syscall (netbsd-arm), const IFT_ISO88025 = 9 +pkg syscall (netbsd-arm), const IFT_ISO88025CRFPINT = 98 +pkg syscall (netbsd-arm), const IFT_ISO88025DTR = 86 +pkg syscall (netbsd-arm), const IFT_ISO88025FIBER = 115 +pkg syscall (netbsd-arm), const IFT_ISO88026 = 10 +pkg syscall (netbsd-arm), const IFT_ISUP = 179 +pkg syscall (netbsd-arm), const IFT_L2VLAN = 135 +pkg syscall (netbsd-arm), const IFT_L3IPVLAN = 136 +pkg syscall (netbsd-arm), const IFT_L3IPXVLAN = 137 +pkg syscall (netbsd-arm), const IFT_LAPB = 16 +pkg syscall (netbsd-arm), const IFT_LAPD = 77 +pkg syscall (netbsd-arm), const IFT_LAPF = 119 +pkg syscall (netbsd-arm), const IFT_LINEGROUP = 210 +pkg syscall (netbsd-arm), const IFT_LOCALTALK = 42 +pkg syscall (netbsd-arm), const IFT_LOOP = 24 +pkg syscall (netbsd-arm), const IFT_MEDIAMAILOVERIP = 139 +pkg syscall (netbsd-arm), const IFT_MFSIGLINK = 167 +pkg syscall (netbsd-arm), const IFT_MIOX25 = 38 +pkg syscall (netbsd-arm), const IFT_MODEM = 48 +pkg syscall (netbsd-arm), const IFT_MPC = 113 +pkg syscall (netbsd-arm), const IFT_MPLS = 166 +pkg syscall (netbsd-arm), const IFT_MPLSTUNNEL = 150 +pkg syscall (netbsd-arm), const IFT_MSDSL = 143 +pkg syscall (netbsd-arm), const IFT_MVL = 191 +pkg syscall (netbsd-arm), const IFT_MYRINET = 99 +pkg syscall (netbsd-arm), const IFT_NFAS = 175 +pkg syscall (netbsd-arm), const IFT_NSIP = 27 +pkg syscall (netbsd-arm), const IFT_OPTICALCHANNEL = 195 +pkg syscall (netbsd-arm), const IFT_OPTICALTRANSPORT = 196 +pkg syscall (netbsd-arm), const IFT_OTHER = 1 +pkg syscall (netbsd-arm), const IFT_P10 = 12 +pkg syscall (netbsd-arm), const IFT_P80 = 13 +pkg syscall (netbsd-arm), const IFT_PARA = 34 +pkg syscall (netbsd-arm), const IFT_PFLOG = 245 +pkg syscall (netbsd-arm), const IFT_PFSYNC = 246 +pkg syscall (netbsd-arm), const IFT_PLC = 174 +pkg syscall (netbsd-arm), const IFT_PON155 = 207 +pkg syscall (netbsd-arm), const IFT_PON622 = 208 +pkg syscall (netbsd-arm), const IFT_POS = 171 +pkg syscall (netbsd-arm), const IFT_PPP = 23 +pkg syscall (netbsd-arm), const IFT_PPPMULTILINKBUNDLE = 108 +pkg syscall (netbsd-arm), const IFT_PROPATM = 197 +pkg syscall (netbsd-arm), const IFT_PROPBWAP2MP = 184 +pkg syscall (netbsd-arm), const IFT_PROPCNLS = 89 +pkg syscall (netbsd-arm), const IFT_PROPDOCSWIRELESSDOWNSTREAM = 181 +pkg syscall (netbsd-arm), const IFT_PROPDOCSWIRELESSMACLAYER = 180 +pkg syscall (netbsd-arm), const IFT_PROPDOCSWIRELESSUPSTREAM = 182 +pkg syscall (netbsd-arm), const IFT_PROPMUX = 54 +pkg syscall (netbsd-arm), const IFT_PROPVIRTUAL = 53 +pkg syscall (netbsd-arm), const IFT_PROPWIRELESSP2P = 157 +pkg syscall (netbsd-arm), const IFT_PTPSERIAL = 22 +pkg syscall (netbsd-arm), const IFT_PVC = 241 +pkg syscall (netbsd-arm), const IFT_Q2931 = 201 +pkg syscall (netbsd-arm), const IFT_QLLC = 68 +pkg syscall (netbsd-arm), const IFT_RADIOMAC = 188 +pkg syscall (netbsd-arm), const IFT_RADSL = 95 +pkg syscall (netbsd-arm), const IFT_REACHDSL = 192 +pkg syscall (netbsd-arm), const IFT_RFC1483 = 159 +pkg syscall (netbsd-arm), const IFT_RS232 = 33 +pkg syscall (netbsd-arm), const IFT_RSRB = 79 +pkg syscall (netbsd-arm), const IFT_SDLC = 17 +pkg syscall (netbsd-arm), const IFT_SDSL = 96 +pkg syscall (netbsd-arm), const IFT_SHDSL = 169 +pkg syscall (netbsd-arm), const IFT_SIP = 31 +pkg syscall (netbsd-arm), const IFT_SIPSIG = 204 +pkg syscall (netbsd-arm), const IFT_SIPTG = 203 +pkg syscall (netbsd-arm), const IFT_SLIP = 28 +pkg syscall (netbsd-arm), const IFT_SMDSDXI = 43 +pkg syscall (netbsd-arm), const IFT_SMDSICIP = 52 +pkg syscall (netbsd-arm), const IFT_SONET = 39 +pkg syscall (netbsd-arm), const IFT_SONETOVERHEADCHANNEL = 185 +pkg syscall (netbsd-arm), const IFT_SONETPATH = 50 +pkg syscall (netbsd-arm), const IFT_SONETVT = 51 +pkg syscall (netbsd-arm), const IFT_SRP = 151 +pkg syscall (netbsd-arm), const IFT_SS7SIGLINK = 156 +pkg syscall (netbsd-arm), const IFT_STACKTOSTACK = 111 +pkg syscall (netbsd-arm), const IFT_STARLAN = 11 +pkg syscall (netbsd-arm), const IFT_STF = 215 +pkg syscall (netbsd-arm), const IFT_T1 = 18 +pkg syscall (netbsd-arm), const IFT_TDLC = 116 +pkg syscall (netbsd-arm), const IFT_TELINK = 200 +pkg syscall (netbsd-arm), const IFT_TERMPAD = 91 +pkg syscall (netbsd-arm), const IFT_TR008 = 176 +pkg syscall (netbsd-arm), const IFT_TRANSPHDLC = 123 +pkg syscall (netbsd-arm), const IFT_TUNNEL = 131 +pkg syscall (netbsd-arm), const IFT_ULTRA = 29 +pkg syscall (netbsd-arm), const IFT_USB = 160 +pkg syscall (netbsd-arm), const IFT_V11 = 64 +pkg syscall (netbsd-arm), const IFT_V35 = 45 +pkg syscall (netbsd-arm), const IFT_V36 = 65 +pkg syscall (netbsd-arm), const IFT_V37 = 120 +pkg syscall (netbsd-arm), const IFT_VDSL = 97 +pkg syscall (netbsd-arm), const IFT_VIRTUALIPADDRESS = 112 +pkg syscall (netbsd-arm), const IFT_VIRTUALTG = 202 +pkg syscall (netbsd-arm), const IFT_VOICEDID = 213 +pkg syscall (netbsd-arm), const IFT_VOICEEM = 100 +pkg syscall (netbsd-arm), const IFT_VOICEEMFGD = 211 +pkg syscall (netbsd-arm), const IFT_VOICEENCAP = 103 +pkg syscall (netbsd-arm), const IFT_VOICEFGDEANA = 212 +pkg syscall (netbsd-arm), const IFT_VOICEFXO = 101 +pkg syscall (netbsd-arm), const IFT_VOICEFXS = 102 +pkg syscall (netbsd-arm), const IFT_VOICEOVERATM = 152 +pkg syscall (netbsd-arm), const IFT_VOICEOVERCABLE = 198 +pkg syscall (netbsd-arm), const IFT_VOICEOVERFRAMERELAY = 153 +pkg syscall (netbsd-arm), const IFT_VOICEOVERIP = 104 +pkg syscall (netbsd-arm), const IFT_X213 = 93 +pkg syscall (netbsd-arm), const IFT_X25 = 5 +pkg syscall (netbsd-arm), const IFT_X25DDN = 4 +pkg syscall (netbsd-arm), const IFT_X25HUNTGROUP = 122 +pkg syscall (netbsd-arm), const IFT_X25MLP = 121 +pkg syscall (netbsd-arm), const IFT_X25PLE = 40 +pkg syscall (netbsd-arm), const IFT_XETHER = 26 +pkg syscall (netbsd-arm), const IGNBRK = 1 +pkg syscall (netbsd-arm), const IGNCR = 128 +pkg syscall (netbsd-arm), const IGNPAR = 4 +pkg syscall (netbsd-arm), const IMAXBEL = 8192 +pkg syscall (netbsd-arm), const INLCR = 64 +pkg syscall (netbsd-arm), const INPCK = 16 +pkg syscall (netbsd-arm), const IN_CLASSA_HOST = 16777215 +pkg syscall (netbsd-arm), const IN_CLASSA_MAX = 128 +pkg syscall (netbsd-arm), const IN_CLASSA_NET = 4278190080 +pkg syscall (netbsd-arm), const IN_CLASSA_NSHIFT = 24 +pkg syscall (netbsd-arm), const IN_CLASSB_HOST = 65535 +pkg syscall (netbsd-arm), const IN_CLASSB_MAX = 65536 +pkg syscall (netbsd-arm), const IN_CLASSB_NET = 4294901760 +pkg syscall (netbsd-arm), const IN_CLASSB_NSHIFT = 16 +pkg syscall (netbsd-arm), const IN_CLASSC_HOST = 255 +pkg syscall (netbsd-arm), const IN_CLASSC_NET = 4294967040 +pkg syscall (netbsd-arm), const IN_CLASSC_NSHIFT = 8 +pkg syscall (netbsd-arm), const IN_CLASSD_HOST = 268435455 +pkg syscall (netbsd-arm), const IN_CLASSD_NET = 4026531840 +pkg syscall (netbsd-arm), const IN_CLASSD_NSHIFT = 28 +pkg syscall (netbsd-arm), const IN_LOOPBACKNET = 127 +pkg syscall (netbsd-arm), const IPPROTO_AH = 51 +pkg syscall (netbsd-arm), const IPPROTO_CARP = 112 +pkg syscall (netbsd-arm), const IPPROTO_DONE = 257 +pkg syscall (netbsd-arm), const IPPROTO_DSTOPTS = 60 +pkg syscall (netbsd-arm), const IPPROTO_EGP = 8 +pkg syscall (netbsd-arm), const IPPROTO_ENCAP = 98 +pkg syscall (netbsd-arm), const IPPROTO_EON = 80 +pkg syscall (netbsd-arm), const IPPROTO_ESP = 50 +pkg syscall (netbsd-arm), const IPPROTO_ETHERIP = 97 +pkg syscall (netbsd-arm), const IPPROTO_FRAGMENT = 44 +pkg syscall (netbsd-arm), const IPPROTO_GGP = 3 +pkg syscall (netbsd-arm), const IPPROTO_GRE = 47 +pkg syscall (netbsd-arm), const IPPROTO_HOPOPTS = 0 +pkg syscall (netbsd-arm), const IPPROTO_ICMP = 1 +pkg syscall (netbsd-arm), const IPPROTO_ICMPV6 = 58 +pkg syscall (netbsd-arm), const IPPROTO_IDP = 22 +pkg syscall (netbsd-arm), const IPPROTO_IGMP = 2 +pkg syscall (netbsd-arm), const IPPROTO_IPCOMP = 108 +pkg syscall (netbsd-arm), const IPPROTO_IPIP = 4 +pkg syscall (netbsd-arm), const IPPROTO_IPV4 = 4 +pkg syscall (netbsd-arm), const IPPROTO_IPV6_ICMP = 58 +pkg syscall (netbsd-arm), const IPPROTO_MAX = 256 +pkg syscall (netbsd-arm), const IPPROTO_MAXID = 52 +pkg syscall (netbsd-arm), const IPPROTO_MOBILE = 55 +pkg syscall (netbsd-arm), const IPPROTO_NONE = 59 +pkg syscall (netbsd-arm), const IPPROTO_PFSYNC = 240 +pkg syscall (netbsd-arm), const IPPROTO_PIM = 103 +pkg syscall (netbsd-arm), const IPPROTO_PUP = 12 +pkg syscall (netbsd-arm), const IPPROTO_RAW = 255 +pkg syscall (netbsd-arm), const IPPROTO_ROUTING = 43 +pkg syscall (netbsd-arm), const IPPROTO_RSVP = 46 +pkg syscall (netbsd-arm), const IPPROTO_TP = 29 +pkg syscall (netbsd-arm), const IPPROTO_VRRP = 112 +pkg syscall (netbsd-arm), const IPV6_CHECKSUM = 26 +pkg syscall (netbsd-arm), const IPV6_DEFAULT_MULTICAST_HOPS = 1 +pkg syscall (netbsd-arm), const IPV6_DEFAULT_MULTICAST_LOOP = 1 +pkg syscall (netbsd-arm), const IPV6_DEFHLIM = 64 +pkg syscall (netbsd-arm), const IPV6_DONTFRAG = 62 +pkg syscall (netbsd-arm), const IPV6_DSTOPTS = 50 +pkg syscall (netbsd-arm), const IPV6_FAITH = 29 +pkg syscall (netbsd-arm), const IPV6_FLOWINFO_MASK = 4294967055 +pkg syscall (netbsd-arm), const IPV6_FLOWLABEL_MASK = 4294905600 +pkg syscall (netbsd-arm), const IPV6_FRAGTTL = 120 +pkg syscall (netbsd-arm), const IPV6_HLIMDEC = 1 +pkg syscall (netbsd-arm), const IPV6_HOPLIMIT = 47 +pkg syscall (netbsd-arm), const IPV6_HOPOPTS = 49 +pkg syscall (netbsd-arm), const IPV6_IPSEC_POLICY = 28 +pkg syscall (netbsd-arm), const IPV6_JOIN_GROUP = 12 +pkg syscall (netbsd-arm), const IPV6_LEAVE_GROUP = 13 +pkg syscall (netbsd-arm), const IPV6_MAXHLIM = 255 +pkg syscall (netbsd-arm), const IPV6_MAXPACKET = 65535 +pkg syscall (netbsd-arm), const IPV6_MMTU = 1280 +pkg syscall (netbsd-arm), const IPV6_MULTICAST_HOPS = 10 +pkg syscall (netbsd-arm), const IPV6_MULTICAST_IF = 9 +pkg syscall (netbsd-arm), const IPV6_MULTICAST_LOOP = 11 +pkg syscall (netbsd-arm), const IPV6_NEXTHOP = 48 +pkg syscall (netbsd-arm), const IPV6_PATHMTU = 44 +pkg syscall (netbsd-arm), const IPV6_PKTINFO = 46 +pkg syscall (netbsd-arm), const IPV6_PORTRANGE = 14 +pkg syscall (netbsd-arm), const IPV6_PORTRANGE_DEFAULT = 0 +pkg syscall (netbsd-arm), const IPV6_PORTRANGE_HIGH = 1 +pkg syscall (netbsd-arm), const IPV6_PORTRANGE_LOW = 2 +pkg syscall (netbsd-arm), const IPV6_RECVDSTOPTS = 40 +pkg syscall (netbsd-arm), const IPV6_RECVHOPLIMIT = 37 +pkg syscall (netbsd-arm), const IPV6_RECVHOPOPTS = 39 +pkg syscall (netbsd-arm), const IPV6_RECVPATHMTU = 43 +pkg syscall (netbsd-arm), const IPV6_RECVPKTINFO = 36 +pkg syscall (netbsd-arm), const IPV6_RECVRTHDR = 38 +pkg syscall (netbsd-arm), const IPV6_RECVTCLASS = 57 +pkg syscall (netbsd-arm), const IPV6_RTHDR = 51 +pkg syscall (netbsd-arm), const IPV6_RTHDRDSTOPTS = 35 +pkg syscall (netbsd-arm), const IPV6_RTHDR_LOOSE = 0 +pkg syscall (netbsd-arm), const IPV6_RTHDR_STRICT = 1 +pkg syscall (netbsd-arm), const IPV6_RTHDR_TYPE_0 = 0 +pkg syscall (netbsd-arm), const IPV6_SOCKOPT_RESERVED1 = 3 +pkg syscall (netbsd-arm), const IPV6_TCLASS = 61 +pkg syscall (netbsd-arm), const IPV6_UNICAST_HOPS = 4 +pkg syscall (netbsd-arm), const IPV6_USE_MIN_MTU = 42 +pkg syscall (netbsd-arm), const IPV6_V6ONLY = 27 +pkg syscall (netbsd-arm), const IPV6_VERSION = 96 +pkg syscall (netbsd-arm), const IPV6_VERSION_MASK = 240 +pkg syscall (netbsd-arm), const IP_ADD_MEMBERSHIP = 12 +pkg syscall (netbsd-arm), const IP_DEFAULT_MULTICAST_LOOP = 1 +pkg syscall (netbsd-arm), const IP_DEFAULT_MULTICAST_TTL = 1 +pkg syscall (netbsd-arm), const IP_DF = 16384 +pkg syscall (netbsd-arm), const IP_DROP_MEMBERSHIP = 13 +pkg syscall (netbsd-arm), const IP_EF = 32768 +pkg syscall (netbsd-arm), const IP_ERRORMTU = 21 +pkg syscall (netbsd-arm), const IP_HDRINCL = 2 +pkg syscall (netbsd-arm), const IP_IPSEC_POLICY = 22 +pkg syscall (netbsd-arm), const IP_MAXPACKET = 65535 +pkg syscall (netbsd-arm), const IP_MAX_MEMBERSHIPS = 20 +pkg syscall (netbsd-arm), const IP_MF = 8192 +pkg syscall (netbsd-arm), const IP_MINFRAGSIZE = 69 +pkg syscall (netbsd-arm), const IP_MINTTL = 24 +pkg syscall (netbsd-arm), const IP_MSS = 576 +pkg syscall (netbsd-arm), const IP_MULTICAST_IF = 9 +pkg syscall (netbsd-arm), const IP_MULTICAST_LOOP = 11 +pkg syscall (netbsd-arm), const IP_MULTICAST_TTL = 10 +pkg syscall (netbsd-arm), const IP_OFFMASK = 8191 +pkg syscall (netbsd-arm), const IP_OPTIONS = 1 +pkg syscall (netbsd-arm), const IP_PORTRANGE = 19 +pkg syscall (netbsd-arm), const IP_PORTRANGE_DEFAULT = 0 +pkg syscall (netbsd-arm), const IP_PORTRANGE_HIGH = 1 +pkg syscall (netbsd-arm), const IP_PORTRANGE_LOW = 2 +pkg syscall (netbsd-arm), const IP_RECVDSTADDR = 7 +pkg syscall (netbsd-arm), const IP_RECVIF = 20 +pkg syscall (netbsd-arm), const IP_RECVOPTS = 5 +pkg syscall (netbsd-arm), const IP_RECVRETOPTS = 6 +pkg syscall (netbsd-arm), const IP_RECVTTL = 23 +pkg syscall (netbsd-arm), const IP_RETOPTS = 8 +pkg syscall (netbsd-arm), const IP_RF = 32768 +pkg syscall (netbsd-arm), const IP_TOS = 3 +pkg syscall (netbsd-arm), const IP_TTL = 4 +pkg syscall (netbsd-arm), const ISIG = 128 +pkg syscall (netbsd-arm), const ISTRIP = 32 +pkg syscall (netbsd-arm), const IXANY = 2048 +pkg syscall (netbsd-arm), const IXOFF = 1024 +pkg syscall (netbsd-arm), const IXON = 512 +pkg syscall (netbsd-arm), const ImplementsGetwd = false +pkg syscall (netbsd-arm), const LOCK_EX = 2 +pkg syscall (netbsd-arm), const LOCK_NB = 4 +pkg syscall (netbsd-arm), const LOCK_SH = 1 +pkg syscall (netbsd-arm), const LOCK_UN = 8 +pkg syscall (netbsd-arm), const MSG_BCAST = 256 +pkg syscall (netbsd-arm), const MSG_CMSG_CLOEXEC = 2048 +pkg syscall (netbsd-arm), const MSG_CONTROLMBUF = 33554432 +pkg syscall (netbsd-arm), const MSG_CTRUNC = 32 +pkg syscall (netbsd-arm), const MSG_DONTROUTE = 4 +pkg syscall (netbsd-arm), const MSG_DONTWAIT = 128 +pkg syscall (netbsd-arm), const MSG_EOR = 8 +pkg syscall (netbsd-arm), const MSG_IOVUSRSPACE = 67108864 +pkg syscall (netbsd-arm), const MSG_LENUSRSPACE = 134217728 +pkg syscall (netbsd-arm), const MSG_MCAST = 512 +pkg syscall (netbsd-arm), const MSG_NAMEMBUF = 16777216 +pkg syscall (netbsd-arm), const MSG_NBIO = 4096 +pkg syscall (netbsd-arm), const MSG_NOSIGNAL = 1024 +pkg syscall (netbsd-arm), const MSG_OOB = 1 +pkg syscall (netbsd-arm), const MSG_PEEK = 2 +pkg syscall (netbsd-arm), const MSG_TRUNC = 16 +pkg syscall (netbsd-arm), const MSG_USERFLAGS = 16777215 +pkg syscall (netbsd-arm), const MSG_WAITALL = 64 +pkg syscall (netbsd-arm), const NAME_MAX = 511 +pkg syscall (netbsd-arm), const NET_RT_DUMP = 1 +pkg syscall (netbsd-arm), const NET_RT_FLAGS = 2 +pkg syscall (netbsd-arm), const NET_RT_IFLIST = 5 +pkg syscall (netbsd-arm), const NET_RT_MAXID = 6 +pkg syscall (netbsd-arm), const NET_RT_OIFLIST = 4 +pkg syscall (netbsd-arm), const NET_RT_OOIFLIST = 3 +pkg syscall (netbsd-arm), const NOFLSH = 2147483648 +pkg syscall (netbsd-arm), const NOTE_ATTRIB = 8 +pkg syscall (netbsd-arm), const NOTE_CHILD = 4 +pkg syscall (netbsd-arm), const NOTE_DELETE = 1 +pkg syscall (netbsd-arm), const NOTE_EXEC = 536870912 +pkg syscall (netbsd-arm), const NOTE_EXIT = 2147483648 +pkg syscall (netbsd-arm), const NOTE_EXTEND = 4 +pkg syscall (netbsd-arm), const NOTE_FORK = 1073741824 +pkg syscall (netbsd-arm), const NOTE_LINK = 16 +pkg syscall (netbsd-arm), const NOTE_LOWAT = 1 +pkg syscall (netbsd-arm), const NOTE_PCTRLMASK = 4026531840 +pkg syscall (netbsd-arm), const NOTE_PDATAMASK = 1048575 +pkg syscall (netbsd-arm), const NOTE_RENAME = 32 +pkg syscall (netbsd-arm), const NOTE_REVOKE = 64 +pkg syscall (netbsd-arm), const NOTE_TRACK = 1 +pkg syscall (netbsd-arm), const NOTE_TRACKERR = 2 +pkg syscall (netbsd-arm), const NOTE_WRITE = 2 +pkg syscall (netbsd-arm), const OCRNL = 16 +pkg syscall (netbsd-arm), const OFIOGETBMAP = 3221513850 +pkg syscall (netbsd-arm), const ONLCR = 2 +pkg syscall (netbsd-arm), const ONLRET = 64 +pkg syscall (netbsd-arm), const ONOCR = 32 +pkg syscall (netbsd-arm), const ONOEOT = 8 +pkg syscall (netbsd-arm), const OPOST = 1 +pkg syscall (netbsd-arm), const O_ACCMODE = 3 +pkg syscall (netbsd-arm), const O_ALT_IO = 262144 +pkg syscall (netbsd-arm), const O_APPEND = 8 +pkg syscall (netbsd-arm), const O_ASYNC = 64 +pkg syscall (netbsd-arm), const O_CLOEXEC = 4194304 +pkg syscall (netbsd-arm), const O_CREAT = 512 +pkg syscall (netbsd-arm), const O_DIRECT = 524288 +pkg syscall (netbsd-arm), const O_DIRECTORY = 2097152 +pkg syscall (netbsd-arm), const O_DSYNC = 65536 +pkg syscall (netbsd-arm), const O_EXCL = 2048 +pkg syscall (netbsd-arm), const O_EXLOCK = 32 +pkg syscall (netbsd-arm), const O_FSYNC = 128 +pkg syscall (netbsd-arm), const O_NDELAY = 4 +pkg syscall (netbsd-arm), const O_NOCTTY = 32768 +pkg syscall (netbsd-arm), const O_NOFOLLOW = 256 +pkg syscall (netbsd-arm), const O_NONBLOCK = 4 +pkg syscall (netbsd-arm), const O_NOSIGPIPE = 16777216 +pkg syscall (netbsd-arm), const O_RSYNC = 131072 +pkg syscall (netbsd-arm), const O_SHLOCK = 16 +pkg syscall (netbsd-arm), const O_SYNC = 128 +pkg syscall (netbsd-arm), const O_TRUNC = 1024 +pkg syscall (netbsd-arm), const PARENB = 4096 +pkg syscall (netbsd-arm), const PARMRK = 8 +pkg syscall (netbsd-arm), const PARODD = 8192 +pkg syscall (netbsd-arm), const PENDIN = 536870912 +pkg syscall (netbsd-arm), const PRI_IOFLUSH = 124 +pkg syscall (netbsd-arm), const PTRACE_CONT = 7 +pkg syscall (netbsd-arm), const PTRACE_KILL = 8 +pkg syscall (netbsd-arm), const PTRACE_TRACEME = 0 +pkg syscall (netbsd-arm), const RLIMIT_AS = 10 +pkg syscall (netbsd-arm), const RLIMIT_CORE = 4 +pkg syscall (netbsd-arm), const RLIMIT_CPU = 0 +pkg syscall (netbsd-arm), const RLIMIT_DATA = 2 +pkg syscall (netbsd-arm), const RLIMIT_FSIZE = 1 +pkg syscall (netbsd-arm), const RLIMIT_NOFILE = 8 +pkg syscall (netbsd-arm), const RLIMIT_STACK = 3 +pkg syscall (netbsd-arm), const RLIM_INFINITY = 9223372036854775807 +pkg syscall (netbsd-arm), const RTAX_AUTHOR = 6 +pkg syscall (netbsd-arm), const RTAX_BRD = 7 +pkg syscall (netbsd-arm), const RTAX_DST = 0 +pkg syscall (netbsd-arm), const RTAX_GATEWAY = 1 +pkg syscall (netbsd-arm), const RTAX_GENMASK = 3 +pkg syscall (netbsd-arm), const RTAX_IFA = 5 +pkg syscall (netbsd-arm), const RTAX_IFP = 4 +pkg syscall (netbsd-arm), const RTAX_MAX = 9 +pkg syscall (netbsd-arm), const RTAX_NETMASK = 2 +pkg syscall (netbsd-arm), const RTAX_TAG = 8 +pkg syscall (netbsd-arm), const RTA_AUTHOR = 64 +pkg syscall (netbsd-arm), const RTA_BRD = 128 +pkg syscall (netbsd-arm), const RTA_DST = 1 +pkg syscall (netbsd-arm), const RTA_GATEWAY = 2 +pkg syscall (netbsd-arm), const RTA_GENMASK = 8 +pkg syscall (netbsd-arm), const RTA_IFA = 32 +pkg syscall (netbsd-arm), const RTA_IFP = 16 +pkg syscall (netbsd-arm), const RTA_NETMASK = 4 +pkg syscall (netbsd-arm), const RTA_TAG = 256 +pkg syscall (netbsd-arm), const RTF_ANNOUNCE = 131072 +pkg syscall (netbsd-arm), const RTF_BLACKHOLE = 4096 +pkg syscall (netbsd-arm), const RTF_CLONED = 8192 +pkg syscall (netbsd-arm), const RTF_CLONING = 256 +pkg syscall (netbsd-arm), const RTF_DONE = 64 +pkg syscall (netbsd-arm), const RTF_DYNAMIC = 16 +pkg syscall (netbsd-arm), const RTF_GATEWAY = 2 +pkg syscall (netbsd-arm), const RTF_HOST = 4 +pkg syscall (netbsd-arm), const RTF_LLINFO = 1024 +pkg syscall (netbsd-arm), const RTF_MASK = 128 +pkg syscall (netbsd-arm), const RTF_MODIFIED = 32 +pkg syscall (netbsd-arm), const RTF_PROTO1 = 32768 +pkg syscall (netbsd-arm), const RTF_PROTO2 = 16384 +pkg syscall (netbsd-arm), const RTF_REJECT = 8 +pkg syscall (netbsd-arm), const RTF_SRC = 65536 +pkg syscall (netbsd-arm), const RTF_STATIC = 2048 +pkg syscall (netbsd-arm), const RTF_UP = 1 +pkg syscall (netbsd-arm), const RTF_XRESOLVE = 512 +pkg syscall (netbsd-arm), const RTM_ADD = 1 +pkg syscall (netbsd-arm), const RTM_CHANGE = 3 +pkg syscall (netbsd-arm), const RTM_CHGADDR = 21 +pkg syscall (netbsd-arm), const RTM_DELADDR = 13 +pkg syscall (netbsd-arm), const RTM_DELETE = 2 +pkg syscall (netbsd-arm), const RTM_GET = 4 +pkg syscall (netbsd-arm), const RTM_IEEE80211 = 17 +pkg syscall (netbsd-arm), const RTM_IFANNOUNCE = 16 +pkg syscall (netbsd-arm), const RTM_IFINFO = 20 +pkg syscall (netbsd-arm), const RTM_LLINFO_UPD = 19 +pkg syscall (netbsd-arm), const RTM_LOCK = 8 +pkg syscall (netbsd-arm), const RTM_LOSING = 5 +pkg syscall (netbsd-arm), const RTM_MISS = 7 +pkg syscall (netbsd-arm), const RTM_NEWADDR = 12 +pkg syscall (netbsd-arm), const RTM_OIFINFO = 15 +pkg syscall (netbsd-arm), const RTM_OLDADD = 9 +pkg syscall (netbsd-arm), const RTM_OLDDEL = 10 +pkg syscall (netbsd-arm), const RTM_OOIFINFO = 14 +pkg syscall (netbsd-arm), const RTM_REDIRECT = 6 +pkg syscall (netbsd-arm), const RTM_RESOLVE = 11 +pkg syscall (netbsd-arm), const RTM_RTTUNIT = 1000000 +pkg syscall (netbsd-arm), const RTM_SETGATE = 18 +pkg syscall (netbsd-arm), const RTM_VERSION = 4 +pkg syscall (netbsd-arm), const RTV_EXPIRE = 4 +pkg syscall (netbsd-arm), const RTV_HOPCOUNT = 2 +pkg syscall (netbsd-arm), const RTV_MTU = 1 +pkg syscall (netbsd-arm), const RTV_RPIPE = 8 +pkg syscall (netbsd-arm), const RTV_RTT = 64 +pkg syscall (netbsd-arm), const RTV_RTTVAR = 128 +pkg syscall (netbsd-arm), const RTV_SPIPE = 16 +pkg syscall (netbsd-arm), const RTV_SSTHRESH = 32 +pkg syscall (netbsd-arm), const RUSAGE_CHILDREN = -1 +pkg syscall (netbsd-arm), const RUSAGE_SELF = 0 +pkg syscall (netbsd-arm), const SCM_CREDS = 4 +pkg syscall (netbsd-arm), const SCM_RIGHTS = 1 +pkg syscall (netbsd-arm), const SCM_TIMESTAMP = 8 +pkg syscall (netbsd-arm), const SIGBUS = 10 +pkg syscall (netbsd-arm), const SIGCHLD = 20 +pkg syscall (netbsd-arm), const SIGCONT = 19 +pkg syscall (netbsd-arm), const SIGEMT = 7 +pkg syscall (netbsd-arm), const SIGINFO = 29 +pkg syscall (netbsd-arm), const SIGIO = 23 +pkg syscall (netbsd-arm), const SIGIOT = 6 +pkg syscall (netbsd-arm), const SIGPROF = 27 +pkg syscall (netbsd-arm), const SIGPWR = 32 +pkg syscall (netbsd-arm), const SIGSTOP = 17 +pkg syscall (netbsd-arm), const SIGSYS = 12 +pkg syscall (netbsd-arm), const SIGTSTP = 18 +pkg syscall (netbsd-arm), const SIGTTIN = 21 +pkg syscall (netbsd-arm), const SIGTTOU = 22 +pkg syscall (netbsd-arm), const SIGURG = 16 +pkg syscall (netbsd-arm), const SIGUSR1 = 30 +pkg syscall (netbsd-arm), const SIGUSR2 = 31 +pkg syscall (netbsd-arm), const SIGVTALRM = 26 +pkg syscall (netbsd-arm), const SIGWINCH = 28 +pkg syscall (netbsd-arm), const SIGXCPU = 24 +pkg syscall (netbsd-arm), const SIGXFSZ = 25 +pkg syscall (netbsd-arm), const SIOCADDMULTI = 2156947761 +pkg syscall (netbsd-arm), const SIOCADDRT = 2150658570 +pkg syscall (netbsd-arm), const SIOCAIFADDR = 2151704858 +pkg syscall (netbsd-arm), const SIOCALIFADDR = 2165860636 +pkg syscall (netbsd-arm), const SIOCATMARK = 1074033415 +pkg syscall (netbsd-arm), const SIOCDELMULTI = 2156947762 +pkg syscall (netbsd-arm), const SIOCDELRT = 2150658571 +pkg syscall (netbsd-arm), const SIOCDIFADDR = 2156947737 +pkg syscall (netbsd-arm), const SIOCDIFPHYADDR = 2156947785 +pkg syscall (netbsd-arm), const SIOCDLIFADDR = 2165860638 +pkg syscall (netbsd-arm), const SIOCGDRVSPEC = 3223087483 +pkg syscall (netbsd-arm), const SIOCGETPFSYNC = 3230689784 +pkg syscall (netbsd-arm), const SIOCGETSGCNT = 3222566196 +pkg syscall (netbsd-arm), const SIOCGETVIFCNT = 3222566195 +pkg syscall (netbsd-arm), const SIOCGHIWAT = 1074033409 +pkg syscall (netbsd-arm), const SIOCGIFADDR = 3230689569 +pkg syscall (netbsd-arm), const SIOCGIFADDRPREF = 3230951712 +pkg syscall (netbsd-arm), const SIOCGIFALIAS = 3225446683 +pkg syscall (netbsd-arm), const SIOCGIFBRDADDR = 3230689571 +pkg syscall (netbsd-arm), const SIOCGIFCAP = 3223349622 +pkg syscall (netbsd-arm), const SIOCGIFCONF = 3221776678 +pkg syscall (netbsd-arm), const SIOCGIFDATA = 3230951813 +pkg syscall (netbsd-arm), const SIOCGIFDLT = 3230689655 +pkg syscall (netbsd-arm), const SIOCGIFDSTADDR = 3230689570 +pkg syscall (netbsd-arm), const SIOCGIFFLAGS = 3230689553 +pkg syscall (netbsd-arm), const SIOCGIFGENERIC = 3230689594 +pkg syscall (netbsd-arm), const SIOCGIFMEDIA = 3223873846 +pkg syscall (netbsd-arm), const SIOCGIFMETRIC = 3230689559 +pkg syscall (netbsd-arm), const SIOCGIFMTU = 3230689662 +pkg syscall (netbsd-arm), const SIOCGIFNETMASK = 3230689573 +pkg syscall (netbsd-arm), const SIOCGIFPDSTADDR = 3230689608 +pkg syscall (netbsd-arm), const SIOCGIFPSRCADDR = 3230689607 +pkg syscall (netbsd-arm), const SIOCGLIFADDR = 3239602461 +pkg syscall (netbsd-arm), const SIOCGLIFPHYADDR = 3239602507 +pkg syscall (netbsd-arm), const SIOCGLINKSTR = 3223087495 +pkg syscall (netbsd-arm), const SIOCGLOWAT = 1074033411 +pkg syscall (netbsd-arm), const SIOCGPGRP = 1074033417 +pkg syscall (netbsd-arm), const SIOCGVH = 3230689667 +pkg syscall (netbsd-arm), const SIOCIFCREATE = 2156947834 +pkg syscall (netbsd-arm), const SIOCIFDESTROY = 2156947833 +pkg syscall (netbsd-arm), const SIOCIFGCLONERS = 3222038904 +pkg syscall (netbsd-arm), const SIOCINITIFADDR = 3225708932 +pkg syscall (netbsd-arm), const SIOCSDRVSPEC = 2149345659 +pkg syscall (netbsd-arm), const SIOCSETPFSYNC = 2156947959 +pkg syscall (netbsd-arm), const SIOCSHIWAT = 2147775232 +pkg syscall (netbsd-arm), const SIOCSIFADDR = 2156947724 +pkg syscall (netbsd-arm), const SIOCSIFADDRPREF = 2157209887 +pkg syscall (netbsd-arm), const SIOCSIFBRDADDR = 2156947731 +pkg syscall (netbsd-arm), const SIOCSIFCAP = 2149607797 +pkg syscall (netbsd-arm), const SIOCSIFDSTADDR = 2156947726 +pkg syscall (netbsd-arm), const SIOCSIFFLAGS = 2156947728 +pkg syscall (netbsd-arm), const SIOCSIFGENERIC = 2156947769 +pkg syscall (netbsd-arm), const SIOCSIFMEDIA = 3230689589 +pkg syscall (netbsd-arm), const SIOCSIFMETRIC = 2156947736 +pkg syscall (netbsd-arm), const SIOCSIFMTU = 2156947839 +pkg syscall (netbsd-arm), const SIOCSIFNETMASK = 2156947734 +pkg syscall (netbsd-arm), const SIOCSIFPHYADDR = 2151704902 +pkg syscall (netbsd-arm), const SIOCSLIFPHYADDR = 2165860682 +pkg syscall (netbsd-arm), const SIOCSLINKSTR = 2149345672 +pkg syscall (netbsd-arm), const SIOCSLOWAT = 2147775234 +pkg syscall (netbsd-arm), const SIOCSPGRP = 2147775240 +pkg syscall (netbsd-arm), const SIOCSVH = 3230689666 +pkg syscall (netbsd-arm), const SIOCZIFDATA = 3230951814 +pkg syscall (netbsd-arm), const SOCK_CLOEXEC = 268435456 +pkg syscall (netbsd-arm), const SOCK_FLAGS_MASK = 4026531840 +pkg syscall (netbsd-arm), const SOCK_NONBLOCK = 536870912 +pkg syscall (netbsd-arm), const SOCK_NOSIGPIPE = 1073741824 +pkg syscall (netbsd-arm), const SOCK_RDM = 4 +pkg syscall (netbsd-arm), const SOL_SOCKET = 65535 +pkg syscall (netbsd-arm), const SOMAXCONN = 128 +pkg syscall (netbsd-arm), const SO_ACCEPTCONN = 2 +pkg syscall (netbsd-arm), const SO_ACCEPTFILTER = 4096 +pkg syscall (netbsd-arm), const SO_BROADCAST = 32 +pkg syscall (netbsd-arm), const SO_DEBUG = 1 +pkg syscall (netbsd-arm), const SO_DONTROUTE = 16 +pkg syscall (netbsd-arm), const SO_ERROR = 4103 +pkg syscall (netbsd-arm), const SO_KEEPALIVE = 8 +pkg syscall (netbsd-arm), const SO_LINGER = 128 +pkg syscall (netbsd-arm), const SO_NOHEADER = 4106 +pkg syscall (netbsd-arm), const SO_NOSIGPIPE = 2048 +pkg syscall (netbsd-arm), const SO_OOBINLINE = 256 +pkg syscall (netbsd-arm), const SO_OVERFLOWED = 4105 +pkg syscall (netbsd-arm), const SO_RCVBUF = 4098 +pkg syscall (netbsd-arm), const SO_RCVLOWAT = 4100 +pkg syscall (netbsd-arm), const SO_RCVTIMEO = 4108 +pkg syscall (netbsd-arm), const SO_REUSEADDR = 4 +pkg syscall (netbsd-arm), const SO_REUSEPORT = 512 +pkg syscall (netbsd-arm), const SO_SNDBUF = 4097 +pkg syscall (netbsd-arm), const SO_SNDLOWAT = 4099 +pkg syscall (netbsd-arm), const SO_SNDTIMEO = 4107 +pkg syscall (netbsd-arm), const SO_TIMESTAMP = 8192 +pkg syscall (netbsd-arm), const SO_TYPE = 4104 +pkg syscall (netbsd-arm), const SO_USELOOPBACK = 64 +pkg syscall (netbsd-arm), const SYSCTL_VERSION = 16777216 +pkg syscall (netbsd-arm), const SYSCTL_VERS_0 = 0 +pkg syscall (netbsd-arm), const SYSCTL_VERS_1 = 16777216 +pkg syscall (netbsd-arm), const SYSCTL_VERS_MASK = 4278190080 +pkg syscall (netbsd-arm), const SYS_ACCEPT = 30 +pkg syscall (netbsd-arm), const SYS_ACCESS = 33 +pkg syscall (netbsd-arm), const SYS_ACCT = 51 +pkg syscall (netbsd-arm), const SYS_ADJTIME = 421 +pkg syscall (netbsd-arm), const SYS_BIND = 104 +pkg syscall (netbsd-arm), const SYS_BREAK = 17 +pkg syscall (netbsd-arm), const SYS_CHDIR = 12 +pkg syscall (netbsd-arm), const SYS_CHFLAGS = 34 +pkg syscall (netbsd-arm), const SYS_CHMOD = 15 +pkg syscall (netbsd-arm), const SYS_CHOWN = 16 +pkg syscall (netbsd-arm), const SYS_CHROOT = 61 +pkg syscall (netbsd-arm), const SYS_CLOCK_GETRES = 429 +pkg syscall (netbsd-arm), const SYS_CLOCK_GETTIME = 427 +pkg syscall (netbsd-arm), const SYS_CLOCK_SETTIME = 428 +pkg syscall (netbsd-arm), const SYS_CLOSE = 6 +pkg syscall (netbsd-arm), const SYS_CONNECT = 98 +pkg syscall (netbsd-arm), const SYS_DUP = 41 +pkg syscall (netbsd-arm), const SYS_DUP2 = 90 +pkg syscall (netbsd-arm), const SYS_DUP3 = 454 +pkg syscall (netbsd-arm), const SYS_EXECVE = 59 +pkg syscall (netbsd-arm), const SYS_EXIT = 1 +pkg syscall (netbsd-arm), const SYS_EXTATTRCTL = 360 +pkg syscall (netbsd-arm), const SYS_EXTATTR_DELETE_FD = 366 +pkg syscall (netbsd-arm), const SYS_EXTATTR_DELETE_FILE = 363 +pkg syscall (netbsd-arm), const SYS_EXTATTR_DELETE_LINK = 369 +pkg syscall (netbsd-arm), const SYS_EXTATTR_GET_FD = 365 +pkg syscall (netbsd-arm), const SYS_EXTATTR_GET_FILE = 362 +pkg syscall (netbsd-arm), const SYS_EXTATTR_GET_LINK = 368 +pkg syscall (netbsd-arm), const SYS_EXTATTR_LIST_FD = 370 +pkg syscall (netbsd-arm), const SYS_EXTATTR_LIST_FILE = 371 +pkg syscall (netbsd-arm), const SYS_EXTATTR_LIST_LINK = 372 +pkg syscall (netbsd-arm), const SYS_EXTATTR_SET_FD = 364 +pkg syscall (netbsd-arm), const SYS_EXTATTR_SET_FILE = 361 +pkg syscall (netbsd-arm), const SYS_EXTATTR_SET_LINK = 367 +pkg syscall (netbsd-arm), const SYS_FACCESSAT = 462 +pkg syscall (netbsd-arm), const SYS_FCHDIR = 13 +pkg syscall (netbsd-arm), const SYS_FCHFLAGS = 35 +pkg syscall (netbsd-arm), const SYS_FCHMOD = 124 +pkg syscall (netbsd-arm), const SYS_FCHMODAT = 463 +pkg syscall (netbsd-arm), const SYS_FCHOWN = 123 +pkg syscall (netbsd-arm), const SYS_FCHOWNAT = 464 +pkg syscall (netbsd-arm), const SYS_FCHROOT = 297 +pkg syscall (netbsd-arm), const SYS_FCNTL = 92 +pkg syscall (netbsd-arm), const SYS_FDATASYNC = 241 +pkg syscall (netbsd-arm), const SYS_FEXECVE = 465 +pkg syscall (netbsd-arm), const SYS_FGETXATTR = 380 +pkg syscall (netbsd-arm), const SYS_FHSTAT = 451 +pkg syscall (netbsd-arm), const SYS_FKTRACE = 288 +pkg syscall (netbsd-arm), const SYS_FLISTXATTR = 383 +pkg syscall (netbsd-arm), const SYS_FLOCK = 131 +pkg syscall (netbsd-arm), const SYS_FORK = 2 +pkg syscall (netbsd-arm), const SYS_FPATHCONF = 192 +pkg syscall (netbsd-arm), const SYS_FREMOVEXATTR = 386 +pkg syscall (netbsd-arm), const SYS_FSETXATTR = 377 +pkg syscall (netbsd-arm), const SYS_FSTAT = 440 +pkg syscall (netbsd-arm), const SYS_FSTATAT = 466 +pkg syscall (netbsd-arm), const SYS_FSTATVFS1 = 358 +pkg syscall (netbsd-arm), const SYS_FSYNC = 95 +pkg syscall (netbsd-arm), const SYS_FSYNC_RANGE = 354 +pkg syscall (netbsd-arm), const SYS_FTRUNCATE = 201 +pkg syscall (netbsd-arm), const SYS_FUTIMENS = 472 +pkg syscall (netbsd-arm), const SYS_FUTIMES = 423 +pkg syscall (netbsd-arm), const SYS_GETCONTEXT = 307 +pkg syscall (netbsd-arm), const SYS_GETDENTS = 390 +pkg syscall (netbsd-arm), const SYS_GETEGID = 43 +pkg syscall (netbsd-arm), const SYS_GETEUID = 25 +pkg syscall (netbsd-arm), const SYS_GETFH = 395 +pkg syscall (netbsd-arm), const SYS_GETGID = 47 +pkg syscall (netbsd-arm), const SYS_GETGROUPS = 79 +pkg syscall (netbsd-arm), const SYS_GETITIMER = 426 +pkg syscall (netbsd-arm), const SYS_GETPEERNAME = 31 +pkg syscall (netbsd-arm), const SYS_GETPGID = 207 +pkg syscall (netbsd-arm), const SYS_GETPGRP = 81 +pkg syscall (netbsd-arm), const SYS_GETPID = 20 +pkg syscall (netbsd-arm), const SYS_GETPPID = 39 +pkg syscall (netbsd-arm), const SYS_GETPRIORITY = 100 +pkg syscall (netbsd-arm), const SYS_GETRLIMIT = 194 +pkg syscall (netbsd-arm), const SYS_GETRUSAGE = 445 +pkg syscall (netbsd-arm), const SYS_GETSID = 286 +pkg syscall (netbsd-arm), const SYS_GETSOCKNAME = 32 +pkg syscall (netbsd-arm), const SYS_GETSOCKOPT = 118 +pkg syscall (netbsd-arm), const SYS_GETTIMEOFDAY = 418 +pkg syscall (netbsd-arm), const SYS_GETUID = 24 +pkg syscall (netbsd-arm), const SYS_GETVFSSTAT = 356 +pkg syscall (netbsd-arm), const SYS_GETXATTR = 378 +pkg syscall (netbsd-arm), const SYS_IOCTL = 54 +pkg syscall (netbsd-arm), const SYS_ISSETUGID = 305 +pkg syscall (netbsd-arm), const SYS_KEVENT = 435 +pkg syscall (netbsd-arm), const SYS_KILL = 37 +pkg syscall (netbsd-arm), const SYS_KQUEUE = 344 +pkg syscall (netbsd-arm), const SYS_KQUEUE1 = 455 +pkg syscall (netbsd-arm), const SYS_KTRACE = 45 +pkg syscall (netbsd-arm), const SYS_LCHFLAGS = 304 +pkg syscall (netbsd-arm), const SYS_LCHMOD = 274 +pkg syscall (netbsd-arm), const SYS_LCHOWN = 275 +pkg syscall (netbsd-arm), const SYS_LGETXATTR = 379 +pkg syscall (netbsd-arm), const SYS_LINK = 9 +pkg syscall (netbsd-arm), const SYS_LINKAT = 457 +pkg syscall (netbsd-arm), const SYS_LISTEN = 106 +pkg syscall (netbsd-arm), const SYS_LISTXATTR = 381 +pkg syscall (netbsd-arm), const SYS_LLISTXATTR = 382 +pkg syscall (netbsd-arm), const SYS_LREMOVEXATTR = 385 +pkg syscall (netbsd-arm), const SYS_LSEEK = 199 +pkg syscall (netbsd-arm), const SYS_LSETXATTR = 376 +pkg syscall (netbsd-arm), const SYS_LSTAT = 441 +pkg syscall (netbsd-arm), const SYS_LUTIMES = 424 +pkg syscall (netbsd-arm), const SYS_MADVISE = 75 +pkg syscall (netbsd-arm), const SYS_MINCORE = 78 +pkg syscall (netbsd-arm), const SYS_MINHERIT = 273 +pkg syscall (netbsd-arm), const SYS_MKDIR = 136 +pkg syscall (netbsd-arm), const SYS_MKDIRAT = 461 +pkg syscall (netbsd-arm), const SYS_MKFIFO = 132 +pkg syscall (netbsd-arm), const SYS_MKFIFOAT = 459 +pkg syscall (netbsd-arm), const SYS_MKNOD = 450 +pkg syscall (netbsd-arm), const SYS_MKNODAT = 460 +pkg syscall (netbsd-arm), const SYS_MLOCK = 203 +pkg syscall (netbsd-arm), const SYS_MLOCKALL = 242 +pkg syscall (netbsd-arm), const SYS_MMAP = 197 +pkg syscall (netbsd-arm), const SYS_MODCTL = 246 +pkg syscall (netbsd-arm), const SYS_MOUNT = 410 +pkg syscall (netbsd-arm), const SYS_MPROTECT = 74 +pkg syscall (netbsd-arm), const SYS_MREMAP = 411 +pkg syscall (netbsd-arm), const SYS_MSGCTL = 444 +pkg syscall (netbsd-arm), const SYS_MSGGET = 225 +pkg syscall (netbsd-arm), const SYS_MSGRCV = 227 +pkg syscall (netbsd-arm), const SYS_MSGSND = 226 +pkg syscall (netbsd-arm), const SYS_MUNLOCK = 204 +pkg syscall (netbsd-arm), const SYS_MUNLOCKALL = 243 +pkg syscall (netbsd-arm), const SYS_MUNMAP = 73 +pkg syscall (netbsd-arm), const SYS_NANOSLEEP = 430 +pkg syscall (netbsd-arm), const SYS_NTP_ADJTIME = 176 +pkg syscall (netbsd-arm), const SYS_NTP_GETTIME = 448 +pkg syscall (netbsd-arm), const SYS_OPEN = 5 +pkg syscall (netbsd-arm), const SYS_OPENAT = 468 +pkg syscall (netbsd-arm), const SYS_PACCEPT = 456 +pkg syscall (netbsd-arm), const SYS_PATHCONF = 191 +pkg syscall (netbsd-arm), const SYS_PIPE = 42 +pkg syscall (netbsd-arm), const SYS_PIPE2 = 453 +pkg syscall (netbsd-arm), const SYS_PMC_CONTROL = 342 +pkg syscall (netbsd-arm), const SYS_PMC_GET_INFO = 341 +pkg syscall (netbsd-arm), const SYS_POLL = 209 +pkg syscall (netbsd-arm), const SYS_POLLTS = 437 +pkg syscall (netbsd-arm), const SYS_POSIX_FADVISE = 416 +pkg syscall (netbsd-arm), const SYS_POSIX_SPAWN = 474 +pkg syscall (netbsd-arm), const SYS_PREAD = 173 +pkg syscall (netbsd-arm), const SYS_PREADV = 289 +pkg syscall (netbsd-arm), const SYS_PROFIL = 44 +pkg syscall (netbsd-arm), const SYS_PSELECT = 436 +pkg syscall (netbsd-arm), const SYS_PSET_ASSIGN = 414 +pkg syscall (netbsd-arm), const SYS_PSET_CREATE = 412 +pkg syscall (netbsd-arm), const SYS_PSET_DESTROY = 413 +pkg syscall (netbsd-arm), const SYS_PTRACE = 26 +pkg syscall (netbsd-arm), const SYS_PWRITE = 174 +pkg syscall (netbsd-arm), const SYS_PWRITEV = 290 +pkg syscall (netbsd-arm), const SYS_RASCTL = 343 +pkg syscall (netbsd-arm), const SYS_READ = 3 +pkg syscall (netbsd-arm), const SYS_READLINK = 58 +pkg syscall (netbsd-arm), const SYS_READLINKAT = 469 +pkg syscall (netbsd-arm), const SYS_READV = 120 +pkg syscall (netbsd-arm), const SYS_REBOOT = 208 +pkg syscall (netbsd-arm), const SYS_RECVFROM = 29 +pkg syscall (netbsd-arm), const SYS_RECVMMSG = 475 +pkg syscall (netbsd-arm), const SYS_RECVMSG = 27 +pkg syscall (netbsd-arm), const SYS_REMOVEXATTR = 384 +pkg syscall (netbsd-arm), const SYS_RENAME = 128 +pkg syscall (netbsd-arm), const SYS_RENAMEAT = 458 +pkg syscall (netbsd-arm), const SYS_REVOKE = 56 +pkg syscall (netbsd-arm), const SYS_RMDIR = 137 +pkg syscall (netbsd-arm), const SYS_SBRK = 69 +pkg syscall (netbsd-arm), const SYS_SCHED_YIELD = 350 +pkg syscall (netbsd-arm), const SYS_SELECT = 417 +pkg syscall (netbsd-arm), const SYS_SEMCONFIG = 223 +pkg syscall (netbsd-arm), const SYS_SEMGET = 221 +pkg syscall (netbsd-arm), const SYS_SEMOP = 222 +pkg syscall (netbsd-arm), const SYS_SENDMMSG = 476 +pkg syscall (netbsd-arm), const SYS_SENDMSG = 28 +pkg syscall (netbsd-arm), const SYS_SENDTO = 133 +pkg syscall (netbsd-arm), const SYS_SETCONTEXT = 308 +pkg syscall (netbsd-arm), const SYS_SETEGID = 182 +pkg syscall (netbsd-arm), const SYS_SETEUID = 183 +pkg syscall (netbsd-arm), const SYS_SETGID = 181 +pkg syscall (netbsd-arm), const SYS_SETGROUPS = 80 +pkg syscall (netbsd-arm), const SYS_SETITIMER = 425 +pkg syscall (netbsd-arm), const SYS_SETPGID = 82 +pkg syscall (netbsd-arm), const SYS_SETPRIORITY = 96 +pkg syscall (netbsd-arm), const SYS_SETREGID = 127 +pkg syscall (netbsd-arm), const SYS_SETREUID = 126 +pkg syscall (netbsd-arm), const SYS_SETRLIMIT = 195 +pkg syscall (netbsd-arm), const SYS_SETSID = 147 +pkg syscall (netbsd-arm), const SYS_SETSOCKOPT = 105 +pkg syscall (netbsd-arm), const SYS_SETTIMEOFDAY = 419 +pkg syscall (netbsd-arm), const SYS_SETUID = 23 +pkg syscall (netbsd-arm), const SYS_SETXATTR = 375 +pkg syscall (netbsd-arm), const SYS_SHMAT = 228 +pkg syscall (netbsd-arm), const SYS_SHMCTL = 443 +pkg syscall (netbsd-arm), const SYS_SHMDT = 230 +pkg syscall (netbsd-arm), const SYS_SHMGET = 231 +pkg syscall (netbsd-arm), const SYS_SHUTDOWN = 134 +pkg syscall (netbsd-arm), const SYS_SIGQUEUEINFO = 245 +pkg syscall (netbsd-arm), const SYS_SOCKET = 394 +pkg syscall (netbsd-arm), const SYS_SOCKETPAIR = 135 +pkg syscall (netbsd-arm), const SYS_SSTK = 70 +pkg syscall (netbsd-arm), const SYS_STAT = 439 +pkg syscall (netbsd-arm), const SYS_STATVFS1 = 357 +pkg syscall (netbsd-arm), const SYS_SWAPCTL = 271 +pkg syscall (netbsd-arm), const SYS_SYMLINK = 57 +pkg syscall (netbsd-arm), const SYS_SYMLINKAT = 470 +pkg syscall (netbsd-arm), const SYS_SYNC = 36 +pkg syscall (netbsd-arm), const SYS_SYSARCH = 165 +pkg syscall (netbsd-arm), const SYS_TIMER_CREATE = 235 +pkg syscall (netbsd-arm), const SYS_TIMER_DELETE = 236 +pkg syscall (netbsd-arm), const SYS_TIMER_GETOVERRUN = 239 +pkg syscall (netbsd-arm), const SYS_TIMER_GETTIME = 447 +pkg syscall (netbsd-arm), const SYS_TIMER_SETTIME = 446 +pkg syscall (netbsd-arm), const SYS_TRUNCATE = 200 +pkg syscall (netbsd-arm), const SYS_UMASK = 60 +pkg syscall (netbsd-arm), const SYS_UNDELETE = 205 +pkg syscall (netbsd-arm), const SYS_UNLINK = 10 +pkg syscall (netbsd-arm), const SYS_UNLINKAT = 471 +pkg syscall (netbsd-arm), const SYS_UNMOUNT = 22 +pkg syscall (netbsd-arm), const SYS_UTIMENSAT = 467 +pkg syscall (netbsd-arm), const SYS_UTIMES = 420 +pkg syscall (netbsd-arm), const SYS_UTRACE = 306 +pkg syscall (netbsd-arm), const SYS_UUIDGEN = 355 +pkg syscall (netbsd-arm), const SYS_VADVISE = 72 +pkg syscall (netbsd-arm), const SYS_VFORK = 66 +pkg syscall (netbsd-arm), const SYS_WAIT4 = 449 +pkg syscall (netbsd-arm), const SYS_WRITE = 4 +pkg syscall (netbsd-arm), const SYS_WRITEV = 121 +pkg syscall (netbsd-arm), const SYS__LWP_CONTINUE = 314 +pkg syscall (netbsd-arm), const SYS__LWP_CREATE = 309 +pkg syscall (netbsd-arm), const SYS__LWP_CTL = 325 +pkg syscall (netbsd-arm), const SYS__LWP_DETACH = 319 +pkg syscall (netbsd-arm), const SYS__LWP_EXIT = 310 +pkg syscall (netbsd-arm), const SYS__LWP_GETNAME = 324 +pkg syscall (netbsd-arm), const SYS__LWP_GETPRIVATE = 316 +pkg syscall (netbsd-arm), const SYS__LWP_KILL = 318 +pkg syscall (netbsd-arm), const SYS__LWP_PARK = 434 +pkg syscall (netbsd-arm), const SYS__LWP_SELF = 311 +pkg syscall (netbsd-arm), const SYS__LWP_SETNAME = 323 +pkg syscall (netbsd-arm), const SYS__LWP_SETPRIVATE = 317 +pkg syscall (netbsd-arm), const SYS__LWP_SUSPEND = 313 +pkg syscall (netbsd-arm), const SYS__LWP_UNPARK = 321 +pkg syscall (netbsd-arm), const SYS__LWP_UNPARK_ALL = 322 +pkg syscall (netbsd-arm), const SYS__LWP_WAIT = 312 +pkg syscall (netbsd-arm), const SYS__LWP_WAKEUP = 315 +pkg syscall (netbsd-arm), const SYS__PSET_BIND = 415 +pkg syscall (netbsd-arm), const SYS__SCHED_GETAFFINITY = 349 +pkg syscall (netbsd-arm), const SYS__SCHED_GETPARAM = 347 +pkg syscall (netbsd-arm), const SYS__SCHED_SETAFFINITY = 348 +pkg syscall (netbsd-arm), const SYS__SCHED_SETPARAM = 346 +pkg syscall (netbsd-arm), const SYS___CLONE = 287 +pkg syscall (netbsd-arm), const SYS___GETCWD = 296 +pkg syscall (netbsd-arm), const SYS___GETLOGIN = 49 +pkg syscall (netbsd-arm), const SYS___POSIX_CHOWN = 283 +pkg syscall (netbsd-arm), const SYS___POSIX_FCHOWN = 284 +pkg syscall (netbsd-arm), const SYS___POSIX_LCHOWN = 285 +pkg syscall (netbsd-arm), const SYS___POSIX_RENAME = 270 +pkg syscall (netbsd-arm), const SYS___QUOTACTL = 473 +pkg syscall (netbsd-arm), const SYS___SEMCTL = 442 +pkg syscall (netbsd-arm), const SYS___SETLOGIN = 50 +pkg syscall (netbsd-arm), const SYS___SIGACTION_SIGTRAMP = 340 +pkg syscall (netbsd-arm), const SYS___SIGTIMEDWAIT = 431 +pkg syscall (netbsd-arm), const SYS___SYSCTL = 202 +pkg syscall (netbsd-arm), const S_ARCH1 = 65536 +pkg syscall (netbsd-arm), const S_ARCH2 = 131072 +pkg syscall (netbsd-arm), const S_BLKSIZE = 512 +pkg syscall (netbsd-arm), const S_IEXEC = 64 +pkg syscall (netbsd-arm), const S_IFMT = 61440 +pkg syscall (netbsd-arm), const S_IFWHT = 57344 +pkg syscall (netbsd-arm), const S_IREAD = 256 +pkg syscall (netbsd-arm), const S_IRGRP = 32 +pkg syscall (netbsd-arm), const S_IROTH = 4 +pkg syscall (netbsd-arm), const S_IRWXG = 56 +pkg syscall (netbsd-arm), const S_IRWXO = 7 +pkg syscall (netbsd-arm), const S_IRWXU = 448 +pkg syscall (netbsd-arm), const S_ISTXT = 512 +pkg syscall (netbsd-arm), const S_IWGRP = 16 +pkg syscall (netbsd-arm), const S_IWOTH = 2 +pkg syscall (netbsd-arm), const S_IWRITE = 128 +pkg syscall (netbsd-arm), const S_IXGRP = 8 +pkg syscall (netbsd-arm), const S_IXOTH = 1 +pkg syscall (netbsd-arm), const SizeofBpfHdr = 20 +pkg syscall (netbsd-arm), const SizeofBpfInsn = 8 +pkg syscall (netbsd-arm), const SizeofBpfProgram = 8 +pkg syscall (netbsd-arm), const SizeofBpfStat = 128 +pkg syscall (netbsd-arm), const SizeofBpfVersion = 4 +pkg syscall (netbsd-arm), const SizeofCmsghdr = 12 +pkg syscall (netbsd-arm), const SizeofIPMreq = 8 +pkg syscall (netbsd-arm), const SizeofIPv6Mreq = 20 +pkg syscall (netbsd-arm), const SizeofIfAnnounceMsghdr = 24 +pkg syscall (netbsd-arm), const SizeofIfData = 132 +pkg syscall (netbsd-arm), const SizeofIfMsghdr = 152 +pkg syscall (netbsd-arm), const SizeofIfaMsghdr = 24 +pkg syscall (netbsd-arm), const SizeofInet6Pktinfo = 20 +pkg syscall (netbsd-arm), const SizeofLinger = 8 +pkg syscall (netbsd-arm), const SizeofMsghdr = 28 +pkg syscall (netbsd-arm), const SizeofRtMetrics = 80 +pkg syscall (netbsd-arm), const SizeofRtMsghdr = 120 +pkg syscall (netbsd-arm), const SizeofSockaddrAny = 108 +pkg syscall (netbsd-arm), const SizeofSockaddrDatalink = 20 +pkg syscall (netbsd-arm), const SizeofSockaddrInet4 = 16 +pkg syscall (netbsd-arm), const SizeofSockaddrInet6 = 28 +pkg syscall (netbsd-arm), const SizeofSockaddrUnix = 106 +pkg syscall (netbsd-arm), const TCIFLUSH = 1 +pkg syscall (netbsd-arm), const TCIOFLUSH = 3 +pkg syscall (netbsd-arm), const TCOFLUSH = 2 +pkg syscall (netbsd-arm), const TCP_CONGCTL = 32 +pkg syscall (netbsd-arm), const TCP_KEEPCNT = 6 +pkg syscall (netbsd-arm), const TCP_KEEPIDLE = 3 +pkg syscall (netbsd-arm), const TCP_KEEPINIT = 7 +pkg syscall (netbsd-arm), const TCP_KEEPINTVL = 5 +pkg syscall (netbsd-arm), const TCP_MAXBURST = 4 +pkg syscall (netbsd-arm), const TCP_MAXSEG = 2 +pkg syscall (netbsd-arm), const TCP_MAXWIN = 65535 +pkg syscall (netbsd-arm), const TCP_MAX_WINSHIFT = 14 +pkg syscall (netbsd-arm), const TCP_MD5SIG = 16 +pkg syscall (netbsd-arm), const TCP_MINMSS = 216 +pkg syscall (netbsd-arm), const TCP_MSS = 536 +pkg syscall (netbsd-arm), const TCSAFLUSH = 2 +pkg syscall (netbsd-arm), const TIOCCBRK = 536900730 +pkg syscall (netbsd-arm), const TIOCCDTR = 536900728 +pkg syscall (netbsd-arm), const TIOCCONS = 2147775586 +pkg syscall (netbsd-arm), const TIOCDCDTIMESTAMP = 1074558040 +pkg syscall (netbsd-arm), const TIOCDRAIN = 536900702 +pkg syscall (netbsd-arm), const TIOCEXCL = 536900621 +pkg syscall (netbsd-arm), const TIOCEXT = 2147775584 +pkg syscall (netbsd-arm), const TIOCFLAG_CDTRCTS = 16 +pkg syscall (netbsd-arm), const TIOCFLAG_CLOCAL = 2 +pkg syscall (netbsd-arm), const TIOCFLAG_CRTSCTS = 4 +pkg syscall (netbsd-arm), const TIOCFLAG_MDMBUF = 8 +pkg syscall (netbsd-arm), const TIOCFLAG_SOFTCAR = 1 +pkg syscall (netbsd-arm), const TIOCFLUSH = 2147775504 +pkg syscall (netbsd-arm), const TIOCGETA = 1076655123 +pkg syscall (netbsd-arm), const TIOCGETD = 1074033690 +pkg syscall (netbsd-arm), const TIOCGFLAGS = 1074033757 +pkg syscall (netbsd-arm), const TIOCGLINED = 1075868738 +pkg syscall (netbsd-arm), const TIOCGPGRP = 1074033783 +pkg syscall (netbsd-arm), const TIOCGQSIZE = 1074033793 +pkg syscall (netbsd-arm), const TIOCGRANTPT = 536900679 +pkg syscall (netbsd-arm), const TIOCGSID = 1074033763 +pkg syscall (netbsd-arm), const TIOCGSIZE = 1074295912 +pkg syscall (netbsd-arm), const TIOCGWINSZ = 1074295912 +pkg syscall (netbsd-arm), const TIOCMBIC = 2147775595 +pkg syscall (netbsd-arm), const TIOCMBIS = 2147775596 +pkg syscall (netbsd-arm), const TIOCMGET = 1074033770 +pkg syscall (netbsd-arm), const TIOCMSET = 2147775597 +pkg syscall (netbsd-arm), const TIOCM_CAR = 64 +pkg syscall (netbsd-arm), const TIOCM_CD = 64 +pkg syscall (netbsd-arm), const TIOCM_CTS = 32 +pkg syscall (netbsd-arm), const TIOCM_DSR = 256 +pkg syscall (netbsd-arm), const TIOCM_DTR = 2 +pkg syscall (netbsd-arm), const TIOCM_LE = 1 +pkg syscall (netbsd-arm), const TIOCM_RI = 128 +pkg syscall (netbsd-arm), const TIOCM_RNG = 128 +pkg syscall (netbsd-arm), const TIOCM_RTS = 4 +pkg syscall (netbsd-arm), const TIOCM_SR = 16 +pkg syscall (netbsd-arm), const TIOCM_ST = 8 +pkg syscall (netbsd-arm), const TIOCNOTTY = 536900721 +pkg syscall (netbsd-arm), const TIOCNXCL = 536900622 +pkg syscall (netbsd-arm), const TIOCOUTQ = 1074033779 +pkg syscall (netbsd-arm), const TIOCPKT = 2147775600 +pkg syscall (netbsd-arm), const TIOCPKT_DATA = 0 +pkg syscall (netbsd-arm), const TIOCPKT_DOSTOP = 32 +pkg syscall (netbsd-arm), const TIOCPKT_FLUSHREAD = 1 +pkg syscall (netbsd-arm), const TIOCPKT_FLUSHWRITE = 2 +pkg syscall (netbsd-arm), const TIOCPKT_IOCTL = 64 +pkg syscall (netbsd-arm), const TIOCPKT_NOSTOP = 16 +pkg syscall (netbsd-arm), const TIOCPKT_START = 8 +pkg syscall (netbsd-arm), const TIOCPKT_STOP = 4 +pkg syscall (netbsd-arm), const TIOCPTMGET = 1208513606 +pkg syscall (netbsd-arm), const TIOCPTSNAME = 1208513608 +pkg syscall (netbsd-arm), const TIOCRCVFRAME = 2147775557 +pkg syscall (netbsd-arm), const TIOCREMOTE = 2147775593 +pkg syscall (netbsd-arm), const TIOCSBRK = 536900731 +pkg syscall (netbsd-arm), const TIOCSCTTY = 536900705 +pkg syscall (netbsd-arm), const TIOCSDTR = 536900729 +pkg syscall (netbsd-arm), const TIOCSETA = 2150396948 +pkg syscall (netbsd-arm), const TIOCSETAF = 2150396950 +pkg syscall (netbsd-arm), const TIOCSETAW = 2150396949 +pkg syscall (netbsd-arm), const TIOCSETD = 2147775515 +pkg syscall (netbsd-arm), const TIOCSFLAGS = 2147775580 +pkg syscall (netbsd-arm), const TIOCSIG = 536900703 +pkg syscall (netbsd-arm), const TIOCSLINED = 2149610563 +pkg syscall (netbsd-arm), const TIOCSPGRP = 2147775606 +pkg syscall (netbsd-arm), const TIOCSQSIZE = 2147775616 +pkg syscall (netbsd-arm), const TIOCSSIZE = 2148037735 +pkg syscall (netbsd-arm), const TIOCSTART = 536900718 +pkg syscall (netbsd-arm), const TIOCSTAT = 2147775589 +pkg syscall (netbsd-arm), const TIOCSTI = 2147578994 +pkg syscall (netbsd-arm), const TIOCSTOP = 536900719 +pkg syscall (netbsd-arm), const TIOCSWINSZ = 2148037735 +pkg syscall (netbsd-arm), const TIOCUCNTL = 2147775590 +pkg syscall (netbsd-arm), const TIOCXMTFRAME = 2147775556 +pkg syscall (netbsd-arm), const TOSTOP = 4194304 +pkg syscall (netbsd-arm), const VDISCARD = 15 +pkg syscall (netbsd-arm), const VDSUSP = 11 +pkg syscall (netbsd-arm), const VEOF = 0 +pkg syscall (netbsd-arm), const VEOL = 1 +pkg syscall (netbsd-arm), const VEOL2 = 2 +pkg syscall (netbsd-arm), const VERASE = 3 +pkg syscall (netbsd-arm), const VINTR = 8 +pkg syscall (netbsd-arm), const VKILL = 5 +pkg syscall (netbsd-arm), const VLNEXT = 14 +pkg syscall (netbsd-arm), const VMIN = 16 +pkg syscall (netbsd-arm), const VQUIT = 9 +pkg syscall (netbsd-arm), const VREPRINT = 6 +pkg syscall (netbsd-arm), const VSTART = 12 +pkg syscall (netbsd-arm), const VSTATUS = 18 +pkg syscall (netbsd-arm), const VSTOP = 13 +pkg syscall (netbsd-arm), const VSUSP = 10 +pkg syscall (netbsd-arm), const VTIME = 17 +pkg syscall (netbsd-arm), const VWERASE = 4 +pkg syscall (netbsd-arm), const WALL = 8 +pkg syscall (netbsd-arm), const WALLSIG = 8 +pkg syscall (netbsd-arm), const WALTSIG = 4 +pkg syscall (netbsd-arm), const WCLONE = 4 +pkg syscall (netbsd-arm), const WCOREFLAG = 128 +pkg syscall (netbsd-arm), const WNOHANG = 1 +pkg syscall (netbsd-arm), const WNOWAIT = 65536 +pkg syscall (netbsd-arm), const WNOZOMBIE = 131072 +pkg syscall (netbsd-arm), const WOPTSCHECKED = 262144 +pkg syscall (netbsd-arm), const WSTOPPED = 127 +pkg syscall (netbsd-arm), const WUNTRACED = 2 +pkg syscall (netbsd-arm-cgo), const AF_APPLETALK = 16 +pkg syscall (netbsd-arm-cgo), const AF_ARP = 28 +pkg syscall (netbsd-arm-cgo), const AF_BLUETOOTH = 31 +pkg syscall (netbsd-arm-cgo), const AF_CCITT = 10 +pkg syscall (netbsd-arm-cgo), const AF_CHAOS = 5 +pkg syscall (netbsd-arm-cgo), const AF_CNT = 21 +pkg syscall (netbsd-arm-cgo), const AF_COIP = 20 +pkg syscall (netbsd-arm-cgo), const AF_DATAKIT = 9 +pkg syscall (netbsd-arm-cgo), const AF_DECnet = 12 +pkg syscall (netbsd-arm-cgo), const AF_DLI = 13 +pkg syscall (netbsd-arm-cgo), const AF_E164 = 26 +pkg syscall (netbsd-arm-cgo), const AF_ECMA = 8 +pkg syscall (netbsd-arm-cgo), const AF_HYLINK = 15 +pkg syscall (netbsd-arm-cgo), const AF_IEEE80211 = 32 +pkg syscall (netbsd-arm-cgo), const AF_IMPLINK = 3 +pkg syscall (netbsd-arm-cgo), const AF_INET6 = 24 +pkg syscall (netbsd-arm-cgo), const AF_IPX = 23 +pkg syscall (netbsd-arm-cgo), const AF_ISDN = 26 +pkg syscall (netbsd-arm-cgo), const AF_ISO = 7 +pkg syscall (netbsd-arm-cgo), const AF_LAT = 14 +pkg syscall (netbsd-arm-cgo), const AF_LINK = 18 +pkg syscall (netbsd-arm-cgo), const AF_LOCAL = 1 +pkg syscall (netbsd-arm-cgo), const AF_MAX = 35 +pkg syscall (netbsd-arm-cgo), const AF_MPLS = 33 +pkg syscall (netbsd-arm-cgo), const AF_NATM = 27 +pkg syscall (netbsd-arm-cgo), const AF_NS = 6 +pkg syscall (netbsd-arm-cgo), const AF_OROUTE = 17 +pkg syscall (netbsd-arm-cgo), const AF_OSI = 7 +pkg syscall (netbsd-arm-cgo), const AF_PUP = 4 +pkg syscall (netbsd-arm-cgo), const AF_ROUTE = 34 +pkg syscall (netbsd-arm-cgo), const AF_SNA = 11 +pkg syscall (netbsd-arm-cgo), const ARPHRD_ARCNET = 7 +pkg syscall (netbsd-arm-cgo), const ARPHRD_ETHER = 1 +pkg syscall (netbsd-arm-cgo), const ARPHRD_FRELAY = 15 +pkg syscall (netbsd-arm-cgo), const ARPHRD_IEEE1394 = 24 +pkg syscall (netbsd-arm-cgo), const ARPHRD_IEEE802 = 6 +pkg syscall (netbsd-arm-cgo), const ARPHRD_STRIP = 23 +pkg syscall (netbsd-arm-cgo), const B0 = 0 +pkg syscall (netbsd-arm-cgo), const B110 = 110 +pkg syscall (netbsd-arm-cgo), const B115200 = 115200 +pkg syscall (netbsd-arm-cgo), const B1200 = 1200 +pkg syscall (netbsd-arm-cgo), const B134 = 134 +pkg syscall (netbsd-arm-cgo), const B14400 = 14400 +pkg syscall (netbsd-arm-cgo), const B150 = 150 +pkg syscall (netbsd-arm-cgo), const B1800 = 1800 +pkg syscall (netbsd-arm-cgo), const B19200 = 19200 +pkg syscall (netbsd-arm-cgo), const B200 = 200 +pkg syscall (netbsd-arm-cgo), const B230400 = 230400 +pkg syscall (netbsd-arm-cgo), const B2400 = 2400 +pkg syscall (netbsd-arm-cgo), const B28800 = 28800 +pkg syscall (netbsd-arm-cgo), const B300 = 300 +pkg syscall (netbsd-arm-cgo), const B38400 = 38400 +pkg syscall (netbsd-arm-cgo), const B460800 = 460800 +pkg syscall (netbsd-arm-cgo), const B4800 = 4800 +pkg syscall (netbsd-arm-cgo), const B50 = 50 +pkg syscall (netbsd-arm-cgo), const B57600 = 57600 +pkg syscall (netbsd-arm-cgo), const B600 = 600 +pkg syscall (netbsd-arm-cgo), const B7200 = 7200 +pkg syscall (netbsd-arm-cgo), const B75 = 75 +pkg syscall (netbsd-arm-cgo), const B76800 = 76800 +pkg syscall (netbsd-arm-cgo), const B921600 = 921600 +pkg syscall (netbsd-arm-cgo), const B9600 = 9600 +pkg syscall (netbsd-arm-cgo), const BIOCFEEDBACK = 2147762813 +pkg syscall (netbsd-arm-cgo), const BIOCFLUSH = 536887912 +pkg syscall (netbsd-arm-cgo), const BIOCGBLEN = 1074020966 +pkg syscall (netbsd-arm-cgo), const BIOCGDLT = 1074020970 +pkg syscall (netbsd-arm-cgo), const BIOCGDLTLIST = 3221766775 +pkg syscall (netbsd-arm-cgo), const BIOCGETIF = 1083196011 +pkg syscall (netbsd-arm-cgo), const BIOCGFEEDBACK = 1074020988 +pkg syscall (netbsd-arm-cgo), const BIOCGHDRCMPLT = 1074020980 +pkg syscall (netbsd-arm-cgo), const BIOCGRTIMEOUT = 1074545275 +pkg syscall (netbsd-arm-cgo), const BIOCGSEESENT = 1074020984 +pkg syscall (netbsd-arm-cgo), const BIOCGSTATS = 1082147439 +pkg syscall (netbsd-arm-cgo), const BIOCGSTATSOLD = 1074283119 +pkg syscall (netbsd-arm-cgo), const BIOCIMMEDIATE = 2147762800 +pkg syscall (netbsd-arm-cgo), const BIOCPROMISC = 536887913 +pkg syscall (netbsd-arm-cgo), const BIOCSBLEN = 3221504614 +pkg syscall (netbsd-arm-cgo), const BIOCSDLT = 2147762806 +pkg syscall (netbsd-arm-cgo), const BIOCSETF = 2148024935 +pkg syscall (netbsd-arm-cgo), const BIOCSETIF = 2156937836 +pkg syscall (netbsd-arm-cgo), const BIOCSFEEDBACK = 2147762813 +pkg syscall (netbsd-arm-cgo), const BIOCSHDRCMPLT = 2147762805 +pkg syscall (netbsd-arm-cgo), const BIOCSRTIMEOUT = 2148287098 +pkg syscall (netbsd-arm-cgo), const BIOCSSEESENT = 2147762809 +pkg syscall (netbsd-arm-cgo), const BIOCSTCPF = 2148024946 +pkg syscall (netbsd-arm-cgo), const BIOCSUDPF = 2148024947 +pkg syscall (netbsd-arm-cgo), const BIOCVERSION = 1074020977 +pkg syscall (netbsd-arm-cgo), const BPF_A = 16 +pkg syscall (netbsd-arm-cgo), const BPF_ABS = 32 +pkg syscall (netbsd-arm-cgo), const BPF_ADD = 0 +pkg syscall (netbsd-arm-cgo), const BPF_ALIGNMENT = 4 +pkg syscall (netbsd-arm-cgo), const BPF_ALIGNMENT32 = 4 +pkg syscall (netbsd-arm-cgo), const BPF_ALU = 4 +pkg syscall (netbsd-arm-cgo), const BPF_AND = 80 +pkg syscall (netbsd-arm-cgo), const BPF_B = 16 +pkg syscall (netbsd-arm-cgo), const BPF_DFLTBUFSIZE = 1048576 +pkg syscall (netbsd-arm-cgo), const BPF_DIV = 48 +pkg syscall (netbsd-arm-cgo), const BPF_H = 8 +pkg syscall (netbsd-arm-cgo), const BPF_IMM = 0 +pkg syscall (netbsd-arm-cgo), const BPF_IND = 64 +pkg syscall (netbsd-arm-cgo), const BPF_JA = 0 +pkg syscall (netbsd-arm-cgo), const BPF_JEQ = 16 +pkg syscall (netbsd-arm-cgo), const BPF_JGE = 48 +pkg syscall (netbsd-arm-cgo), const BPF_JGT = 32 +pkg syscall (netbsd-arm-cgo), const BPF_JMP = 5 +pkg syscall (netbsd-arm-cgo), const BPF_JSET = 64 +pkg syscall (netbsd-arm-cgo), const BPF_K = 0 +pkg syscall (netbsd-arm-cgo), const BPF_LD = 0 +pkg syscall (netbsd-arm-cgo), const BPF_LDX = 1 +pkg syscall (netbsd-arm-cgo), const BPF_LEN = 128 +pkg syscall (netbsd-arm-cgo), const BPF_LSH = 96 +pkg syscall (netbsd-arm-cgo), const BPF_MAJOR_VERSION = 1 +pkg syscall (netbsd-arm-cgo), const BPF_MAXBUFSIZE = 16777216 +pkg syscall (netbsd-arm-cgo), const BPF_MAXINSNS = 512 +pkg syscall (netbsd-arm-cgo), const BPF_MEM = 96 +pkg syscall (netbsd-arm-cgo), const BPF_MEMWORDS = 16 +pkg syscall (netbsd-arm-cgo), const BPF_MINBUFSIZE = 32 +pkg syscall (netbsd-arm-cgo), const BPF_MINOR_VERSION = 1 +pkg syscall (netbsd-arm-cgo), const BPF_MISC = 7 +pkg syscall (netbsd-arm-cgo), const BPF_MSH = 160 +pkg syscall (netbsd-arm-cgo), const BPF_MUL = 32 +pkg syscall (netbsd-arm-cgo), const BPF_NEG = 128 +pkg syscall (netbsd-arm-cgo), const BPF_OR = 64 +pkg syscall (netbsd-arm-cgo), const BPF_RELEASE = 199606 +pkg syscall (netbsd-arm-cgo), const BPF_RET = 6 +pkg syscall (netbsd-arm-cgo), const BPF_RSH = 112 +pkg syscall (netbsd-arm-cgo), const BPF_ST = 2 +pkg syscall (netbsd-arm-cgo), const BPF_STX = 3 +pkg syscall (netbsd-arm-cgo), const BPF_SUB = 16 +pkg syscall (netbsd-arm-cgo), const BPF_TAX = 0 +pkg syscall (netbsd-arm-cgo), const BPF_TXA = 128 +pkg syscall (netbsd-arm-cgo), const BPF_W = 0 +pkg syscall (netbsd-arm-cgo), const BPF_X = 8 +pkg syscall (netbsd-arm-cgo), const BRKINT = 2 +pkg syscall (netbsd-arm-cgo), const CFLUSH = 15 +pkg syscall (netbsd-arm-cgo), const CLOCAL = 32768 +pkg syscall (netbsd-arm-cgo), const CREAD = 2048 +pkg syscall (netbsd-arm-cgo), const CS5 = 0 +pkg syscall (netbsd-arm-cgo), const CS6 = 256 +pkg syscall (netbsd-arm-cgo), const CS7 = 512 +pkg syscall (netbsd-arm-cgo), const CS8 = 768 +pkg syscall (netbsd-arm-cgo), const CSIZE = 768 +pkg syscall (netbsd-arm-cgo), const CSTART = 17 +pkg syscall (netbsd-arm-cgo), const CSTATUS = 20 +pkg syscall (netbsd-arm-cgo), const CSTOP = 19 +pkg syscall (netbsd-arm-cgo), const CSTOPB = 1024 +pkg syscall (netbsd-arm-cgo), const CSUSP = 26 +pkg syscall (netbsd-arm-cgo), const CTL_MAXNAME = 12 +pkg syscall (netbsd-arm-cgo), const CTL_NET = 4 +pkg syscall (netbsd-arm-cgo), const CTL_QUERY = -2 +pkg syscall (netbsd-arm-cgo), const DIOCBSFLUSH = 536896632 +pkg syscall (netbsd-arm-cgo), const DLT_A429 = 184 +pkg syscall (netbsd-arm-cgo), const DLT_A653_ICM = 185 +pkg syscall (netbsd-arm-cgo), const DLT_AIRONET_HEADER = 120 +pkg syscall (netbsd-arm-cgo), const DLT_AOS = 222 +pkg syscall (netbsd-arm-cgo), const DLT_APPLE_IP_OVER_IEEE1394 = 138 +pkg syscall (netbsd-arm-cgo), const DLT_ARCNET = 7 +pkg syscall (netbsd-arm-cgo), const DLT_ARCNET_LINUX = 129 +pkg syscall (netbsd-arm-cgo), const DLT_ATM_CLIP = 19 +pkg syscall (netbsd-arm-cgo), const DLT_ATM_RFC1483 = 11 +pkg syscall (netbsd-arm-cgo), const DLT_AURORA = 126 +pkg syscall (netbsd-arm-cgo), const DLT_AX25 = 3 +pkg syscall (netbsd-arm-cgo), const DLT_AX25_KISS = 202 +pkg syscall (netbsd-arm-cgo), const DLT_BACNET_MS_TP = 165 +pkg syscall (netbsd-arm-cgo), const DLT_BLUETOOTH_HCI_H4 = 187 +pkg syscall (netbsd-arm-cgo), const DLT_BLUETOOTH_HCI_H4_WITH_PHDR = 201 +pkg syscall (netbsd-arm-cgo), const DLT_CAN20B = 190 +pkg syscall (netbsd-arm-cgo), const DLT_CAN_SOCKETCAN = 227 +pkg syscall (netbsd-arm-cgo), const DLT_CHAOS = 5 +pkg syscall (netbsd-arm-cgo), const DLT_CISCO_IOS = 118 +pkg syscall (netbsd-arm-cgo), const DLT_C_HDLC = 104 +pkg syscall (netbsd-arm-cgo), const DLT_C_HDLC_WITH_DIR = 205 +pkg syscall (netbsd-arm-cgo), const DLT_DECT = 221 +pkg syscall (netbsd-arm-cgo), const DLT_DOCSIS = 143 +pkg syscall (netbsd-arm-cgo), const DLT_ECONET = 115 +pkg syscall (netbsd-arm-cgo), const DLT_EN10MB = 1 +pkg syscall (netbsd-arm-cgo), const DLT_EN3MB = 2 +pkg syscall (netbsd-arm-cgo), const DLT_ENC = 109 +pkg syscall (netbsd-arm-cgo), const DLT_ERF = 197 +pkg syscall (netbsd-arm-cgo), const DLT_ERF_ETH = 175 +pkg syscall (netbsd-arm-cgo), const DLT_ERF_POS = 176 +pkg syscall (netbsd-arm-cgo), const DLT_FC_2 = 224 +pkg syscall (netbsd-arm-cgo), const DLT_FC_2_WITH_FRAME_DELIMS = 225 +pkg syscall (netbsd-arm-cgo), const DLT_FDDI = 10 +pkg syscall (netbsd-arm-cgo), const DLT_FLEXRAY = 210 +pkg syscall (netbsd-arm-cgo), const DLT_FRELAY = 107 +pkg syscall (netbsd-arm-cgo), const DLT_FRELAY_WITH_DIR = 206 +pkg syscall (netbsd-arm-cgo), const DLT_GCOM_SERIAL = 173 +pkg syscall (netbsd-arm-cgo), const DLT_GCOM_T1E1 = 172 +pkg syscall (netbsd-arm-cgo), const DLT_GPF_F = 171 +pkg syscall (netbsd-arm-cgo), const DLT_GPF_T = 170 +pkg syscall (netbsd-arm-cgo), const DLT_GPRS_LLC = 169 +pkg syscall (netbsd-arm-cgo), const DLT_GSMTAP_ABIS = 218 +pkg syscall (netbsd-arm-cgo), const DLT_GSMTAP_UM = 217 +pkg syscall (netbsd-arm-cgo), const DLT_HDLC = 16 +pkg syscall (netbsd-arm-cgo), const DLT_HHDLC = 121 +pkg syscall (netbsd-arm-cgo), const DLT_HIPPI = 15 +pkg syscall (netbsd-arm-cgo), const DLT_IBM_SN = 146 +pkg syscall (netbsd-arm-cgo), const DLT_IBM_SP = 145 +pkg syscall (netbsd-arm-cgo), const DLT_IEEE802 = 6 +pkg syscall (netbsd-arm-cgo), const DLT_IEEE802_11 = 105 +pkg syscall (netbsd-arm-cgo), const DLT_IEEE802_11_RADIO = 127 +pkg syscall (netbsd-arm-cgo), const DLT_IEEE802_11_RADIO_AVS = 163 +pkg syscall (netbsd-arm-cgo), const DLT_IEEE802_15_4 = 195 +pkg syscall (netbsd-arm-cgo), const DLT_IEEE802_15_4_LINUX = 191 +pkg syscall (netbsd-arm-cgo), const DLT_IEEE802_15_4_NONASK_PHY = 215 +pkg syscall (netbsd-arm-cgo), const DLT_IEEE802_16_MAC_CPS = 188 +pkg syscall (netbsd-arm-cgo), const DLT_IEEE802_16_MAC_CPS_RADIO = 193 +pkg syscall (netbsd-arm-cgo), const DLT_IPMB = 199 +pkg syscall (netbsd-arm-cgo), const DLT_IPMB_LINUX = 209 +pkg syscall (netbsd-arm-cgo), const DLT_IPNET = 226 +pkg syscall (netbsd-arm-cgo), const DLT_IPV4 = 228 +pkg syscall (netbsd-arm-cgo), const DLT_IPV6 = 229 +pkg syscall (netbsd-arm-cgo), const DLT_IP_OVER_FC = 122 +pkg syscall (netbsd-arm-cgo), const DLT_JUNIPER_ATM1 = 137 +pkg syscall (netbsd-arm-cgo), const DLT_JUNIPER_ATM2 = 135 +pkg syscall (netbsd-arm-cgo), const DLT_JUNIPER_CHDLC = 181 +pkg syscall (netbsd-arm-cgo), const DLT_JUNIPER_ES = 132 +pkg syscall (netbsd-arm-cgo), const DLT_JUNIPER_ETHER = 178 +pkg syscall (netbsd-arm-cgo), const DLT_JUNIPER_FRELAY = 180 +pkg syscall (netbsd-arm-cgo), const DLT_JUNIPER_GGSN = 133 +pkg syscall (netbsd-arm-cgo), const DLT_JUNIPER_ISM = 194 +pkg syscall (netbsd-arm-cgo), const DLT_JUNIPER_MFR = 134 +pkg syscall (netbsd-arm-cgo), const DLT_JUNIPER_MLFR = 131 +pkg syscall (netbsd-arm-cgo), const DLT_JUNIPER_MLPPP = 130 +pkg syscall (netbsd-arm-cgo), const DLT_JUNIPER_MONITOR = 164 +pkg syscall (netbsd-arm-cgo), const DLT_JUNIPER_PIC_PEER = 174 +pkg syscall (netbsd-arm-cgo), const DLT_JUNIPER_PPP = 179 +pkg syscall (netbsd-arm-cgo), const DLT_JUNIPER_PPPOE = 167 +pkg syscall (netbsd-arm-cgo), const DLT_JUNIPER_PPPOE_ATM = 168 +pkg syscall (netbsd-arm-cgo), const DLT_JUNIPER_SERVICES = 136 +pkg syscall (netbsd-arm-cgo), const DLT_JUNIPER_ST = 200 +pkg syscall (netbsd-arm-cgo), const DLT_JUNIPER_VP = 183 +pkg syscall (netbsd-arm-cgo), const DLT_LAPB_WITH_DIR = 207 +pkg syscall (netbsd-arm-cgo), const DLT_LAPD = 203 +pkg syscall (netbsd-arm-cgo), const DLT_LIN = 212 +pkg syscall (netbsd-arm-cgo), const DLT_LINUX_EVDEV = 216 +pkg syscall (netbsd-arm-cgo), const DLT_LINUX_IRDA = 144 +pkg syscall (netbsd-arm-cgo), const DLT_LINUX_LAPD = 177 +pkg syscall (netbsd-arm-cgo), const DLT_LINUX_SLL = 113 +pkg syscall (netbsd-arm-cgo), const DLT_LOOP = 108 +pkg syscall (netbsd-arm-cgo), const DLT_LTALK = 114 +pkg syscall (netbsd-arm-cgo), const DLT_MFR = 182 +pkg syscall (netbsd-arm-cgo), const DLT_MOST = 211 +pkg syscall (netbsd-arm-cgo), const DLT_MPLS = 219 +pkg syscall (netbsd-arm-cgo), const DLT_MTP2 = 140 +pkg syscall (netbsd-arm-cgo), const DLT_MTP2_WITH_PHDR = 139 +pkg syscall (netbsd-arm-cgo), const DLT_MTP3 = 141 +pkg syscall (netbsd-arm-cgo), const DLT_NULL = 0 +pkg syscall (netbsd-arm-cgo), const DLT_PCI_EXP = 125 +pkg syscall (netbsd-arm-cgo), const DLT_PFLOG = 117 +pkg syscall (netbsd-arm-cgo), const DLT_PFSYNC = 18 +pkg syscall (netbsd-arm-cgo), const DLT_PPI = 192 +pkg syscall (netbsd-arm-cgo), const DLT_PPP = 9 +pkg syscall (netbsd-arm-cgo), const DLT_PPP_BSDOS = 14 +pkg syscall (netbsd-arm-cgo), const DLT_PPP_ETHER = 51 +pkg syscall (netbsd-arm-cgo), const DLT_PPP_PPPD = 166 +pkg syscall (netbsd-arm-cgo), const DLT_PPP_SERIAL = 50 +pkg syscall (netbsd-arm-cgo), const DLT_PPP_WITH_DIR = 204 +pkg syscall (netbsd-arm-cgo), const DLT_PRISM_HEADER = 119 +pkg syscall (netbsd-arm-cgo), const DLT_PRONET = 4 +pkg syscall (netbsd-arm-cgo), const DLT_RAIF1 = 198 +pkg syscall (netbsd-arm-cgo), const DLT_RAW = 12 +pkg syscall (netbsd-arm-cgo), const DLT_RAWAF_MASK = 35913728 +pkg syscall (netbsd-arm-cgo), const DLT_RIO = 124 +pkg syscall (netbsd-arm-cgo), const DLT_SCCP = 142 +pkg syscall (netbsd-arm-cgo), const DLT_SITA = 196 +pkg syscall (netbsd-arm-cgo), const DLT_SLIP = 8 +pkg syscall (netbsd-arm-cgo), const DLT_SLIP_BSDOS = 13 +pkg syscall (netbsd-arm-cgo), const DLT_SUNATM = 123 +pkg syscall (netbsd-arm-cgo), const DLT_SYMANTEC_FIREWALL = 99 +pkg syscall (netbsd-arm-cgo), const DLT_TZSP = 128 +pkg syscall (netbsd-arm-cgo), const DLT_USB = 186 +pkg syscall (netbsd-arm-cgo), const DLT_USB_LINUX = 189 +pkg syscall (netbsd-arm-cgo), const DLT_USB_LINUX_MMAPPED = 220 +pkg syscall (netbsd-arm-cgo), const DLT_WIHART = 223 +pkg syscall (netbsd-arm-cgo), const DLT_X2E_SERIAL = 213 +pkg syscall (netbsd-arm-cgo), const DLT_X2E_XORAYA = 214 +pkg syscall (netbsd-arm-cgo), const DT_BLK = 6 +pkg syscall (netbsd-arm-cgo), const DT_CHR = 2 +pkg syscall (netbsd-arm-cgo), const DT_DIR = 4 +pkg syscall (netbsd-arm-cgo), const DT_FIFO = 1 +pkg syscall (netbsd-arm-cgo), const DT_LNK = 10 +pkg syscall (netbsd-arm-cgo), const DT_REG = 8 +pkg syscall (netbsd-arm-cgo), const DT_SOCK = 12 +pkg syscall (netbsd-arm-cgo), const DT_UNKNOWN = 0 +pkg syscall (netbsd-arm-cgo), const DT_WHT = 14 +pkg syscall (netbsd-arm-cgo), const E2BIG = 7 +pkg syscall (netbsd-arm-cgo), const EACCES = 13 +pkg syscall (netbsd-arm-cgo), const EADDRINUSE = 48 +pkg syscall (netbsd-arm-cgo), const EADDRNOTAVAIL = 49 +pkg syscall (netbsd-arm-cgo), const EAFNOSUPPORT = 47 +pkg syscall (netbsd-arm-cgo), const EAGAIN = 35 +pkg syscall (netbsd-arm-cgo), const EALREADY = 37 +pkg syscall (netbsd-arm-cgo), const EAUTH = 80 +pkg syscall (netbsd-arm-cgo), const EBADF = 9 +pkg syscall (netbsd-arm-cgo), const EBADMSG = 88 +pkg syscall (netbsd-arm-cgo), const EBADRPC = 72 +pkg syscall (netbsd-arm-cgo), const EBUSY = 16 +pkg syscall (netbsd-arm-cgo), const ECANCELED = 87 +pkg syscall (netbsd-arm-cgo), const ECHILD = 10 +pkg syscall (netbsd-arm-cgo), const ECHO = 8 +pkg syscall (netbsd-arm-cgo), const ECHOCTL = 64 +pkg syscall (netbsd-arm-cgo), const ECHOE = 2 +pkg syscall (netbsd-arm-cgo), const ECHOK = 4 +pkg syscall (netbsd-arm-cgo), const ECHOKE = 1 +pkg syscall (netbsd-arm-cgo), const ECHONL = 16 +pkg syscall (netbsd-arm-cgo), const ECHOPRT = 32 +pkg syscall (netbsd-arm-cgo), const ECONNABORTED = 53 +pkg syscall (netbsd-arm-cgo), const ECONNREFUSED = 61 +pkg syscall (netbsd-arm-cgo), const ECONNRESET = 54 +pkg syscall (netbsd-arm-cgo), const EDEADLK = 11 +pkg syscall (netbsd-arm-cgo), const EDESTADDRREQ = 39 +pkg syscall (netbsd-arm-cgo), const EDOM = 33 +pkg syscall (netbsd-arm-cgo), const EDQUOT = 69 +pkg syscall (netbsd-arm-cgo), const EEXIST = 17 +pkg syscall (netbsd-arm-cgo), const EFAULT = 14 +pkg syscall (netbsd-arm-cgo), const EFBIG = 27 +pkg syscall (netbsd-arm-cgo), const EFTYPE = 79 +pkg syscall (netbsd-arm-cgo), const EHOSTDOWN = 64 +pkg syscall (netbsd-arm-cgo), const EHOSTUNREACH = 65 +pkg syscall (netbsd-arm-cgo), const EIDRM = 82 +pkg syscall (netbsd-arm-cgo), const EILSEQ = 85 +pkg syscall (netbsd-arm-cgo), const EINPROGRESS = 36 +pkg syscall (netbsd-arm-cgo), const EINTR = 4 +pkg syscall (netbsd-arm-cgo), const EINVAL = 22 +pkg syscall (netbsd-arm-cgo), const EIO = 5 +pkg syscall (netbsd-arm-cgo), const EISCONN = 56 +pkg syscall (netbsd-arm-cgo), const EISDIR = 21 +pkg syscall (netbsd-arm-cgo), const ELAST = 96 +pkg syscall (netbsd-arm-cgo), const ELOOP = 62 +pkg syscall (netbsd-arm-cgo), const EMFILE = 24 +pkg syscall (netbsd-arm-cgo), const EMLINK = 31 +pkg syscall (netbsd-arm-cgo), const EMSGSIZE = 40 +pkg syscall (netbsd-arm-cgo), const EMULTIHOP = 94 +pkg syscall (netbsd-arm-cgo), const EMUL_LINUX = 1 +pkg syscall (netbsd-arm-cgo), const EMUL_LINUX32 = 5 +pkg syscall (netbsd-arm-cgo), const EMUL_MAXID = 6 +pkg syscall (netbsd-arm-cgo), const ENAMETOOLONG = 63 +pkg syscall (netbsd-arm-cgo), const ENEEDAUTH = 81 +pkg syscall (netbsd-arm-cgo), const ENETDOWN = 50 +pkg syscall (netbsd-arm-cgo), const ENETRESET = 52 +pkg syscall (netbsd-arm-cgo), const ENETUNREACH = 51 +pkg syscall (netbsd-arm-cgo), const ENFILE = 23 +pkg syscall (netbsd-arm-cgo), const ENOATTR = 93 +pkg syscall (netbsd-arm-cgo), const ENOBUFS = 55 +pkg syscall (netbsd-arm-cgo), const ENODATA = 89 +pkg syscall (netbsd-arm-cgo), const ENODEV = 19 +pkg syscall (netbsd-arm-cgo), const ENOEXEC = 8 +pkg syscall (netbsd-arm-cgo), const ENOLCK = 77 +pkg syscall (netbsd-arm-cgo), const ENOLINK = 95 +pkg syscall (netbsd-arm-cgo), const ENOMEM = 12 +pkg syscall (netbsd-arm-cgo), const ENOMSG = 83 +pkg syscall (netbsd-arm-cgo), const ENOPROTOOPT = 42 +pkg syscall (netbsd-arm-cgo), const ENOSPC = 28 +pkg syscall (netbsd-arm-cgo), const ENOSR = 90 +pkg syscall (netbsd-arm-cgo), const ENOSTR = 91 +pkg syscall (netbsd-arm-cgo), const ENOSYS = 78 +pkg syscall (netbsd-arm-cgo), const ENOTBLK = 15 +pkg syscall (netbsd-arm-cgo), const ENOTCONN = 57 +pkg syscall (netbsd-arm-cgo), const ENOTDIR = 20 +pkg syscall (netbsd-arm-cgo), const ENOTEMPTY = 66 +pkg syscall (netbsd-arm-cgo), const ENOTSOCK = 38 +pkg syscall (netbsd-arm-cgo), const ENOTSUP = 86 +pkg syscall (netbsd-arm-cgo), const ENOTTY = 25 +pkg syscall (netbsd-arm-cgo), const ENXIO = 6 +pkg syscall (netbsd-arm-cgo), const EOPNOTSUPP = 45 +pkg syscall (netbsd-arm-cgo), const EOVERFLOW = 84 +pkg syscall (netbsd-arm-cgo), const EPERM = 1 +pkg syscall (netbsd-arm-cgo), const EPFNOSUPPORT = 46 +pkg syscall (netbsd-arm-cgo), const EPIPE = 32 +pkg syscall (netbsd-arm-cgo), const EPROCLIM = 67 +pkg syscall (netbsd-arm-cgo), const EPROCUNAVAIL = 76 +pkg syscall (netbsd-arm-cgo), const EPROGMISMATCH = 75 +pkg syscall (netbsd-arm-cgo), const EPROGUNAVAIL = 74 +pkg syscall (netbsd-arm-cgo), const EPROTO = 96 +pkg syscall (netbsd-arm-cgo), const EPROTONOSUPPORT = 43 +pkg syscall (netbsd-arm-cgo), const EPROTOTYPE = 41 +pkg syscall (netbsd-arm-cgo), const ERANGE = 34 +pkg syscall (netbsd-arm-cgo), const EREMOTE = 71 +pkg syscall (netbsd-arm-cgo), const EROFS = 30 +pkg syscall (netbsd-arm-cgo), const ERPCMISMATCH = 73 +pkg syscall (netbsd-arm-cgo), const ESHUTDOWN = 58 +pkg syscall (netbsd-arm-cgo), const ESOCKTNOSUPPORT = 44 +pkg syscall (netbsd-arm-cgo), const ESPIPE = 29 +pkg syscall (netbsd-arm-cgo), const ESRCH = 3 +pkg syscall (netbsd-arm-cgo), const ESTALE = 70 +pkg syscall (netbsd-arm-cgo), const ETHERCAP_JUMBO_MTU = 4 +pkg syscall (netbsd-arm-cgo), const ETHERCAP_VLAN_HWTAGGING = 2 +pkg syscall (netbsd-arm-cgo), const ETHERCAP_VLAN_MTU = 1 +pkg syscall (netbsd-arm-cgo), const ETHERMIN = 46 +pkg syscall (netbsd-arm-cgo), const ETHERMTU = 1500 +pkg syscall (netbsd-arm-cgo), const ETHERMTU_JUMBO = 9000 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_8023 = 4 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_AARP = 33011 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_ACCTON = 33680 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_AEONIC = 32822 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_ALPHA = 33098 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_AMBER = 24584 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_AMOEBA = 33093 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_APOLLO = 33015 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_APOLLODOMAIN = 32793 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_APPLETALK = 32923 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_APPLITEK = 32967 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_ARGONAUT = 32826 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_ARP = 2054 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_AT = 32923 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_ATALK = 32923 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_ATOMIC = 34527 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_ATT = 32873 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_ATTSTANFORD = 32776 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_AUTOPHON = 32874 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_AXIS = 34902 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_BCLOOP = 36867 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_BOFL = 33026 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_CABLETRON = 28724 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_CHAOS = 2052 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_COMDESIGN = 32876 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_COMPUGRAPHIC = 32877 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_COUNTERPOINT = 32866 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_CRONUS = 32772 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_CRONUSVLN = 32771 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_DCA = 4660 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_DDE = 32891 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_DEBNI = 43690 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_DECAM = 32840 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_DECCUST = 24582 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_DECDIAG = 24581 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_DECDNS = 32828 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_DECDTS = 32830 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_DECEXPER = 24576 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_DECLAST = 32833 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_DECLTM = 32831 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_DECMUMPS = 24585 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_DECNETBIOS = 32832 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_DELTACON = 34526 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_DIDDLE = 17185 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_DLOG1 = 1632 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_DLOG2 = 1633 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_DN = 24579 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_DOGFIGHT = 6537 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_DSMD = 32825 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_ECMA = 2051 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_ENCRYPT = 32829 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_ES = 32861 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_EXCELAN = 32784 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_EXPERDATA = 32841 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_FLIP = 33094 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_FLOWCONTROL = 34824 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_FRARP = 2056 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_GENDYN = 32872 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_HAYES = 33072 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_HIPPI_FP = 33152 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_HITACHI = 34848 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_HP = 32773 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_IEEEPUP = 2560 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_IEEEPUPAT = 2561 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_IMLBL = 19522 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_IMLBLDIAG = 16972 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_IP = 2048 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_IPAS = 34668 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_IPV6 = 34525 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_IPX = 33079 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_IPXNEW = 32823 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_KALPANA = 34178 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_LANBRIDGE = 32824 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_LANPROBE = 34952 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_LAT = 24580 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_LBACK = 36864 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_LITTLE = 32864 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_LOGICRAFT = 33096 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_LOOPBACK = 36864 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_MATRA = 32890 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_MAX = 65535 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_MERIT = 32892 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_MICP = 34618 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_MOPDL = 24577 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_MOPRC = 24578 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_MOTOROLA = 33165 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_MPLS = 34887 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_MPLS_MCAST = 34888 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_MUMPS = 33087 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_NBPCC = 15364 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_NBPCLAIM = 15369 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_NBPCLREQ = 15365 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_NBPCLRSP = 15366 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_NBPCREQ = 15362 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_NBPCRSP = 15363 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_NBPDG = 15367 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_NBPDGB = 15368 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_NBPDLTE = 15370 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_NBPRAR = 15372 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_NBPRAS = 15371 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_NBPRST = 15373 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_NBPSCD = 15361 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_NBPVCD = 15360 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_NBS = 2050 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_NCD = 33097 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_NESTAR = 32774 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_NETBEUI = 33169 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_NOVELL = 33080 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_NS = 1536 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_NSAT = 1537 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_NSCOMPAT = 2055 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_NTRAILER = 16 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_OS9 = 28679 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_OS9NET = 28681 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_PACER = 32966 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_PAE = 34958 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_PCS = 16962 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_PLANNING = 32836 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_PPP = 34827 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_PPPOE = 34916 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_PPPOEDISC = 34915 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_PRIMENTS = 28721 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_PUP = 512 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_PUPAT = 512 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_RACAL = 28720 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_RATIONAL = 33104 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_RAWFR = 25945 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_RCL = 6549 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_RDP = 34617 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_RETIX = 33010 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_REVARP = 32821 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_SCA = 24583 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_SECTRA = 34523 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_SECUREDATA = 34669 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_SGITW = 33150 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_SG_BOUNCE = 32790 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_SG_DIAG = 32787 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_SG_NETGAMES = 32788 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_SG_RESV = 32789 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_SIMNET = 21000 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_SLOWPROTOCOLS = 34825 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_SNA = 32981 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_SNMP = 33100 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_SONIX = 64245 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_SPIDER = 32927 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_SPRITE = 1280 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_STP = 33153 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_TALARIS = 33067 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_TALARISMC = 34091 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_TCPCOMP = 34667 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_TCPSM = 36866 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_TEC = 33103 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_TIGAN = 32815 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_TRAIL = 4096 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_TRANSETHER = 25944 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_TYMSHARE = 32814 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_UBBST = 28677 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_UBDEBUG = 2304 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_UBDIAGLOOP = 28674 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_UBDL = 28672 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_UBNIU = 28673 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_UBNMC = 28675 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_VALID = 5632 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_VARIAN = 32989 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_VAXELN = 32827 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_VEECO = 32871 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_VEXP = 32859 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_VGLAB = 33073 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_VINES = 2989 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_VINESECHO = 2991 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_VINESLOOP = 2990 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_VITAL = 65280 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_VLAN = 33024 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_VLTLMAN = 32896 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_VPROD = 32860 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_VURESERVED = 33095 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_WATERLOO = 33072 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_WELLFLEET = 33027 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_X25 = 2053 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_X75 = 2049 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_XNSSM = 36865 +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_XTP = 33149 +pkg syscall (netbsd-arm-cgo), const ETHER_ADDR_LEN = 6 +pkg syscall (netbsd-arm-cgo), const ETHER_CRC_LEN = 4 +pkg syscall (netbsd-arm-cgo), const ETHER_CRC_POLY_BE = 79764918 +pkg syscall (netbsd-arm-cgo), const ETHER_CRC_POLY_LE = 3988292384 +pkg syscall (netbsd-arm-cgo), const ETHER_HDR_LEN = 14 +pkg syscall (netbsd-arm-cgo), const ETHER_MAX_LEN = 1518 +pkg syscall (netbsd-arm-cgo), const ETHER_MAX_LEN_JUMBO = 9018 +pkg syscall (netbsd-arm-cgo), const ETHER_MIN_LEN = 64 +pkg syscall (netbsd-arm-cgo), const ETHER_PPPOE_ENCAP_LEN = 8 +pkg syscall (netbsd-arm-cgo), const ETHER_TYPE_LEN = 2 +pkg syscall (netbsd-arm-cgo), const ETHER_VLAN_ENCAP_LEN = 4 +pkg syscall (netbsd-arm-cgo), const ETIME = 92 +pkg syscall (netbsd-arm-cgo), const ETIMEDOUT = 60 +pkg syscall (netbsd-arm-cgo), const ETOOMANYREFS = 59 +pkg syscall (netbsd-arm-cgo), const ETXTBSY = 26 +pkg syscall (netbsd-arm-cgo), const EUSERS = 68 +pkg syscall (netbsd-arm-cgo), const EVFILT_AIO = 2 +pkg syscall (netbsd-arm-cgo), const EVFILT_PROC = 4 +pkg syscall (netbsd-arm-cgo), const EVFILT_READ = 0 +pkg syscall (netbsd-arm-cgo), const EVFILT_SIGNAL = 5 +pkg syscall (netbsd-arm-cgo), const EVFILT_SYSCOUNT = 7 +pkg syscall (netbsd-arm-cgo), const EVFILT_TIMER = 6 +pkg syscall (netbsd-arm-cgo), const EVFILT_VNODE = 3 +pkg syscall (netbsd-arm-cgo), const EVFILT_WRITE = 1 +pkg syscall (netbsd-arm-cgo), const EV_ADD = 1 +pkg syscall (netbsd-arm-cgo), const EV_CLEAR = 32 +pkg syscall (netbsd-arm-cgo), const EV_DELETE = 2 +pkg syscall (netbsd-arm-cgo), const EV_DISABLE = 8 +pkg syscall (netbsd-arm-cgo), const EV_ENABLE = 4 +pkg syscall (netbsd-arm-cgo), const EV_EOF = 32768 +pkg syscall (netbsd-arm-cgo), const EV_ERROR = 16384 +pkg syscall (netbsd-arm-cgo), const EV_FLAG1 = 8192 +pkg syscall (netbsd-arm-cgo), const EV_ONESHOT = 16 +pkg syscall (netbsd-arm-cgo), const EV_SYSFLAGS = 61440 +pkg syscall (netbsd-arm-cgo), const EWOULDBLOCK = 35 +pkg syscall (netbsd-arm-cgo), const EXDEV = 18 +pkg syscall (netbsd-arm-cgo), const EXTA = 19200 +pkg syscall (netbsd-arm-cgo), const EXTB = 38400 +pkg syscall (netbsd-arm-cgo), const EXTPROC = 2048 +pkg syscall (netbsd-arm-cgo), const FD_CLOEXEC = 1 +pkg syscall (netbsd-arm-cgo), const FD_SETSIZE = 256 +pkg syscall (netbsd-arm-cgo), const FLUSHO = 8388608 +pkg syscall (netbsd-arm-cgo), const F_CLOSEM = 10 +pkg syscall (netbsd-arm-cgo), const F_DUPFD = 0 +pkg syscall (netbsd-arm-cgo), const F_DUPFD_CLOEXEC = 12 +pkg syscall (netbsd-arm-cgo), const F_FSCTL = -2147483648 +pkg syscall (netbsd-arm-cgo), const F_FSDIRMASK = 1879048192 +pkg syscall (netbsd-arm-cgo), const F_FSIN = 268435456 +pkg syscall (netbsd-arm-cgo), const F_FSINOUT = 805306368 +pkg syscall (netbsd-arm-cgo), const F_FSOUT = 536870912 +pkg syscall (netbsd-arm-cgo), const F_FSPRIV = 32768 +pkg syscall (netbsd-arm-cgo), const F_FSVOID = 1073741824 +pkg syscall (netbsd-arm-cgo), const F_GETFD = 1 +pkg syscall (netbsd-arm-cgo), const F_GETFL = 3 +pkg syscall (netbsd-arm-cgo), const F_GETLK = 7 +pkg syscall (netbsd-arm-cgo), const F_GETNOSIGPIPE = 13 +pkg syscall (netbsd-arm-cgo), const F_GETOWN = 5 +pkg syscall (netbsd-arm-cgo), const F_MAXFD = 11 +pkg syscall (netbsd-arm-cgo), const F_OK = 0 +pkg syscall (netbsd-arm-cgo), const F_PARAM_MASK = 4095 +pkg syscall (netbsd-arm-cgo), const F_PARAM_MAX = 4095 +pkg syscall (netbsd-arm-cgo), const F_RDLCK = 1 +pkg syscall (netbsd-arm-cgo), const F_SETFD = 2 +pkg syscall (netbsd-arm-cgo), const F_SETFL = 4 +pkg syscall (netbsd-arm-cgo), const F_SETLK = 8 +pkg syscall (netbsd-arm-cgo), const F_SETLKW = 9 +pkg syscall (netbsd-arm-cgo), const F_SETNOSIGPIPE = 14 +pkg syscall (netbsd-arm-cgo), const F_SETOWN = 6 +pkg syscall (netbsd-arm-cgo), const F_UNLCK = 2 +pkg syscall (netbsd-arm-cgo), const F_WRLCK = 3 +pkg syscall (netbsd-arm-cgo), const HUPCL = 16384 +pkg syscall (netbsd-arm-cgo), const ICANON = 256 +pkg syscall (netbsd-arm-cgo), const ICRNL = 256 +pkg syscall (netbsd-arm-cgo), const IEXTEN = 1024 +pkg syscall (netbsd-arm-cgo), const IFAN_ARRIVAL = 0 +pkg syscall (netbsd-arm-cgo), const IFAN_DEPARTURE = 1 +pkg syscall (netbsd-arm-cgo), const IFA_ROUTE = 1 +pkg syscall (netbsd-arm-cgo), const IFF_ALLMULTI = 512 +pkg syscall (netbsd-arm-cgo), const IFF_CANTCHANGE = 36690 +pkg syscall (netbsd-arm-cgo), const IFF_DEBUG = 4 +pkg syscall (netbsd-arm-cgo), const IFF_LINK0 = 4096 +pkg syscall (netbsd-arm-cgo), const IFF_LINK1 = 8192 +pkg syscall (netbsd-arm-cgo), const IFF_LINK2 = 16384 +pkg syscall (netbsd-arm-cgo), const IFF_LOOPBACK = 8 +pkg syscall (netbsd-arm-cgo), const IFF_MULTICAST = 32768 +pkg syscall (netbsd-arm-cgo), const IFF_NOARP = 128 +pkg syscall (netbsd-arm-cgo), const IFF_NOTRAILERS = 32 +pkg syscall (netbsd-arm-cgo), const IFF_OACTIVE = 1024 +pkg syscall (netbsd-arm-cgo), const IFF_POINTOPOINT = 16 +pkg syscall (netbsd-arm-cgo), const IFF_PROMISC = 256 +pkg syscall (netbsd-arm-cgo), const IFF_RUNNING = 64 +pkg syscall (netbsd-arm-cgo), const IFF_SIMPLEX = 2048 +pkg syscall (netbsd-arm-cgo), const IFNAMSIZ = 16 +pkg syscall (netbsd-arm-cgo), const IFT_1822 = 2 +pkg syscall (netbsd-arm-cgo), const IFT_A12MPPSWITCH = 130 +pkg syscall (netbsd-arm-cgo), const IFT_AAL2 = 187 +pkg syscall (netbsd-arm-cgo), const IFT_AAL5 = 49 +pkg syscall (netbsd-arm-cgo), const IFT_ADSL = 94 +pkg syscall (netbsd-arm-cgo), const IFT_AFLANE8023 = 59 +pkg syscall (netbsd-arm-cgo), const IFT_AFLANE8025 = 60 +pkg syscall (netbsd-arm-cgo), const IFT_ARAP = 88 +pkg syscall (netbsd-arm-cgo), const IFT_ARCNET = 35 +pkg syscall (netbsd-arm-cgo), const IFT_ARCNETPLUS = 36 +pkg syscall (netbsd-arm-cgo), const IFT_ASYNC = 84 +pkg syscall (netbsd-arm-cgo), const IFT_ATM = 37 +pkg syscall (netbsd-arm-cgo), const IFT_ATMDXI = 105 +pkg syscall (netbsd-arm-cgo), const IFT_ATMFUNI = 106 +pkg syscall (netbsd-arm-cgo), const IFT_ATMIMA = 107 +pkg syscall (netbsd-arm-cgo), const IFT_ATMLOGICAL = 80 +pkg syscall (netbsd-arm-cgo), const IFT_ATMRADIO = 189 +pkg syscall (netbsd-arm-cgo), const IFT_ATMSUBINTERFACE = 134 +pkg syscall (netbsd-arm-cgo), const IFT_ATMVCIENDPT = 194 +pkg syscall (netbsd-arm-cgo), const IFT_ATMVIRTUAL = 149 +pkg syscall (netbsd-arm-cgo), const IFT_BGPPOLICYACCOUNTING = 162 +pkg syscall (netbsd-arm-cgo), const IFT_BRIDGE = 209 +pkg syscall (netbsd-arm-cgo), const IFT_BSC = 83 +pkg syscall (netbsd-arm-cgo), const IFT_CARP = 248 +pkg syscall (netbsd-arm-cgo), const IFT_CCTEMUL = 61 +pkg syscall (netbsd-arm-cgo), const IFT_CEPT = 19 +pkg syscall (netbsd-arm-cgo), const IFT_CES = 133 +pkg syscall (netbsd-arm-cgo), const IFT_CHANNEL = 70 +pkg syscall (netbsd-arm-cgo), const IFT_CNR = 85 +pkg syscall (netbsd-arm-cgo), const IFT_COFFEE = 132 +pkg syscall (netbsd-arm-cgo), const IFT_COMPOSITELINK = 155 +pkg syscall (netbsd-arm-cgo), const IFT_DCN = 141 +pkg syscall (netbsd-arm-cgo), const IFT_DIGITALPOWERLINE = 138 +pkg syscall (netbsd-arm-cgo), const IFT_DIGITALWRAPPEROVERHEADCHANNEL = 186 +pkg syscall (netbsd-arm-cgo), const IFT_DLSW = 74 +pkg syscall (netbsd-arm-cgo), const IFT_DOCSCABLEDOWNSTREAM = 128 +pkg syscall (netbsd-arm-cgo), const IFT_DOCSCABLEMACLAYER = 127 +pkg syscall (netbsd-arm-cgo), const IFT_DOCSCABLEUPSTREAM = 129 +pkg syscall (netbsd-arm-cgo), const IFT_DOCSCABLEUPSTREAMCHANNEL = 205 +pkg syscall (netbsd-arm-cgo), const IFT_DS0 = 81 +pkg syscall (netbsd-arm-cgo), const IFT_DS0BUNDLE = 82 +pkg syscall (netbsd-arm-cgo), const IFT_DS1FDL = 170 +pkg syscall (netbsd-arm-cgo), const IFT_DS3 = 30 +pkg syscall (netbsd-arm-cgo), const IFT_DTM = 140 +pkg syscall (netbsd-arm-cgo), const IFT_DVBASILN = 172 +pkg syscall (netbsd-arm-cgo), const IFT_DVBASIOUT = 173 +pkg syscall (netbsd-arm-cgo), const IFT_DVBRCCDOWNSTREAM = 147 +pkg syscall (netbsd-arm-cgo), const IFT_DVBRCCMACLAYER = 146 +pkg syscall (netbsd-arm-cgo), const IFT_DVBRCCUPSTREAM = 148 +pkg syscall (netbsd-arm-cgo), const IFT_ECONET = 206 +pkg syscall (netbsd-arm-cgo), const IFT_EON = 25 +pkg syscall (netbsd-arm-cgo), const IFT_EPLRS = 87 +pkg syscall (netbsd-arm-cgo), const IFT_ESCON = 73 +pkg syscall (netbsd-arm-cgo), const IFT_ETHER = 6 +pkg syscall (netbsd-arm-cgo), const IFT_FAITH = 242 +pkg syscall (netbsd-arm-cgo), const IFT_FAST = 125 +pkg syscall (netbsd-arm-cgo), const IFT_FASTETHER = 62 +pkg syscall (netbsd-arm-cgo), const IFT_FASTETHERFX = 69 +pkg syscall (netbsd-arm-cgo), const IFT_FDDI = 15 +pkg syscall (netbsd-arm-cgo), const IFT_FIBRECHANNEL = 56 +pkg syscall (netbsd-arm-cgo), const IFT_FRAMERELAYINTERCONNECT = 58 +pkg syscall (netbsd-arm-cgo), const IFT_FRAMERELAYMPI = 92 +pkg syscall (netbsd-arm-cgo), const IFT_FRDLCIENDPT = 193 +pkg syscall (netbsd-arm-cgo), const IFT_FRELAY = 32 +pkg syscall (netbsd-arm-cgo), const IFT_FRELAYDCE = 44 +pkg syscall (netbsd-arm-cgo), const IFT_FRF16MFRBUNDLE = 163 +pkg syscall (netbsd-arm-cgo), const IFT_FRFORWARD = 158 +pkg syscall (netbsd-arm-cgo), const IFT_G703AT2MB = 67 +pkg syscall (netbsd-arm-cgo), const IFT_G703AT64K = 66 +pkg syscall (netbsd-arm-cgo), const IFT_GIF = 240 +pkg syscall (netbsd-arm-cgo), const IFT_GIGABITETHERNET = 117 +pkg syscall (netbsd-arm-cgo), const IFT_GR303IDT = 178 +pkg syscall (netbsd-arm-cgo), const IFT_GR303RDT = 177 +pkg syscall (netbsd-arm-cgo), const IFT_H323GATEKEEPER = 164 +pkg syscall (netbsd-arm-cgo), const IFT_H323PROXY = 165 +pkg syscall (netbsd-arm-cgo), const IFT_HDH1822 = 3 +pkg syscall (netbsd-arm-cgo), const IFT_HDLC = 118 +pkg syscall (netbsd-arm-cgo), const IFT_HDSL2 = 168 +pkg syscall (netbsd-arm-cgo), const IFT_HIPERLAN2 = 183 +pkg syscall (netbsd-arm-cgo), const IFT_HIPPI = 47 +pkg syscall (netbsd-arm-cgo), const IFT_HIPPIINTERFACE = 57 +pkg syscall (netbsd-arm-cgo), const IFT_HOSTPAD = 90 +pkg syscall (netbsd-arm-cgo), const IFT_HSSI = 46 +pkg syscall (netbsd-arm-cgo), const IFT_HY = 14 +pkg syscall (netbsd-arm-cgo), const IFT_IBM370PARCHAN = 72 +pkg syscall (netbsd-arm-cgo), const IFT_IDSL = 154 +pkg syscall (netbsd-arm-cgo), const IFT_IEEE1394 = 144 +pkg syscall (netbsd-arm-cgo), const IFT_IEEE80211 = 71 +pkg syscall (netbsd-arm-cgo), const IFT_IEEE80212 = 55 +pkg syscall (netbsd-arm-cgo), const IFT_IEEE8023ADLAG = 161 +pkg syscall (netbsd-arm-cgo), const IFT_IFGSN = 145 +pkg syscall (netbsd-arm-cgo), const IFT_IMT = 190 +pkg syscall (netbsd-arm-cgo), const IFT_INFINIBAND = 199 +pkg syscall (netbsd-arm-cgo), const IFT_INTERLEAVE = 124 +pkg syscall (netbsd-arm-cgo), const IFT_IP = 126 +pkg syscall (netbsd-arm-cgo), const IFT_IPFORWARD = 142 +pkg syscall (netbsd-arm-cgo), const IFT_IPOVERATM = 114 +pkg syscall (netbsd-arm-cgo), const IFT_IPOVERCDLC = 109 +pkg syscall (netbsd-arm-cgo), const IFT_IPOVERCLAW = 110 +pkg syscall (netbsd-arm-cgo), const IFT_IPSWITCH = 78 +pkg syscall (netbsd-arm-cgo), const IFT_ISDN = 63 +pkg syscall (netbsd-arm-cgo), const IFT_ISDNBASIC = 20 +pkg syscall (netbsd-arm-cgo), const IFT_ISDNPRIMARY = 21 +pkg syscall (netbsd-arm-cgo), const IFT_ISDNS = 75 +pkg syscall (netbsd-arm-cgo), const IFT_ISDNU = 76 +pkg syscall (netbsd-arm-cgo), const IFT_ISO88022LLC = 41 +pkg syscall (netbsd-arm-cgo), const IFT_ISO88023 = 7 +pkg syscall (netbsd-arm-cgo), const IFT_ISO88024 = 8 +pkg syscall (netbsd-arm-cgo), const IFT_ISO88025 = 9 +pkg syscall (netbsd-arm-cgo), const IFT_ISO88025CRFPINT = 98 +pkg syscall (netbsd-arm-cgo), const IFT_ISO88025DTR = 86 +pkg syscall (netbsd-arm-cgo), const IFT_ISO88025FIBER = 115 +pkg syscall (netbsd-arm-cgo), const IFT_ISO88026 = 10 +pkg syscall (netbsd-arm-cgo), const IFT_ISUP = 179 +pkg syscall (netbsd-arm-cgo), const IFT_L2VLAN = 135 +pkg syscall (netbsd-arm-cgo), const IFT_L3IPVLAN = 136 +pkg syscall (netbsd-arm-cgo), const IFT_L3IPXVLAN = 137 +pkg syscall (netbsd-arm-cgo), const IFT_LAPB = 16 +pkg syscall (netbsd-arm-cgo), const IFT_LAPD = 77 +pkg syscall (netbsd-arm-cgo), const IFT_LAPF = 119 +pkg syscall (netbsd-arm-cgo), const IFT_LINEGROUP = 210 +pkg syscall (netbsd-arm-cgo), const IFT_LOCALTALK = 42 +pkg syscall (netbsd-arm-cgo), const IFT_LOOP = 24 +pkg syscall (netbsd-arm-cgo), const IFT_MEDIAMAILOVERIP = 139 +pkg syscall (netbsd-arm-cgo), const IFT_MFSIGLINK = 167 +pkg syscall (netbsd-arm-cgo), const IFT_MIOX25 = 38 +pkg syscall (netbsd-arm-cgo), const IFT_MODEM = 48 +pkg syscall (netbsd-arm-cgo), const IFT_MPC = 113 +pkg syscall (netbsd-arm-cgo), const IFT_MPLS = 166 +pkg syscall (netbsd-arm-cgo), const IFT_MPLSTUNNEL = 150 +pkg syscall (netbsd-arm-cgo), const IFT_MSDSL = 143 +pkg syscall (netbsd-arm-cgo), const IFT_MVL = 191 +pkg syscall (netbsd-arm-cgo), const IFT_MYRINET = 99 +pkg syscall (netbsd-arm-cgo), const IFT_NFAS = 175 +pkg syscall (netbsd-arm-cgo), const IFT_NSIP = 27 +pkg syscall (netbsd-arm-cgo), const IFT_OPTICALCHANNEL = 195 +pkg syscall (netbsd-arm-cgo), const IFT_OPTICALTRANSPORT = 196 +pkg syscall (netbsd-arm-cgo), const IFT_OTHER = 1 +pkg syscall (netbsd-arm-cgo), const IFT_P10 = 12 +pkg syscall (netbsd-arm-cgo), const IFT_P80 = 13 +pkg syscall (netbsd-arm-cgo), const IFT_PARA = 34 +pkg syscall (netbsd-arm-cgo), const IFT_PFLOG = 245 +pkg syscall (netbsd-arm-cgo), const IFT_PFSYNC = 246 +pkg syscall (netbsd-arm-cgo), const IFT_PLC = 174 +pkg syscall (netbsd-arm-cgo), const IFT_PON155 = 207 +pkg syscall (netbsd-arm-cgo), const IFT_PON622 = 208 +pkg syscall (netbsd-arm-cgo), const IFT_POS = 171 +pkg syscall (netbsd-arm-cgo), const IFT_PPP = 23 +pkg syscall (netbsd-arm-cgo), const IFT_PPPMULTILINKBUNDLE = 108 +pkg syscall (netbsd-arm-cgo), const IFT_PROPATM = 197 +pkg syscall (netbsd-arm-cgo), const IFT_PROPBWAP2MP = 184 +pkg syscall (netbsd-arm-cgo), const IFT_PROPCNLS = 89 +pkg syscall (netbsd-arm-cgo), const IFT_PROPDOCSWIRELESSDOWNSTREAM = 181 +pkg syscall (netbsd-arm-cgo), const IFT_PROPDOCSWIRELESSMACLAYER = 180 +pkg syscall (netbsd-arm-cgo), const IFT_PROPDOCSWIRELESSUPSTREAM = 182 +pkg syscall (netbsd-arm-cgo), const IFT_PROPMUX = 54 +pkg syscall (netbsd-arm-cgo), const IFT_PROPVIRTUAL = 53 +pkg syscall (netbsd-arm-cgo), const IFT_PROPWIRELESSP2P = 157 +pkg syscall (netbsd-arm-cgo), const IFT_PTPSERIAL = 22 +pkg syscall (netbsd-arm-cgo), const IFT_PVC = 241 +pkg syscall (netbsd-arm-cgo), const IFT_Q2931 = 201 +pkg syscall (netbsd-arm-cgo), const IFT_QLLC = 68 +pkg syscall (netbsd-arm-cgo), const IFT_RADIOMAC = 188 +pkg syscall (netbsd-arm-cgo), const IFT_RADSL = 95 +pkg syscall (netbsd-arm-cgo), const IFT_REACHDSL = 192 +pkg syscall (netbsd-arm-cgo), const IFT_RFC1483 = 159 +pkg syscall (netbsd-arm-cgo), const IFT_RS232 = 33 +pkg syscall (netbsd-arm-cgo), const IFT_RSRB = 79 +pkg syscall (netbsd-arm-cgo), const IFT_SDLC = 17 +pkg syscall (netbsd-arm-cgo), const IFT_SDSL = 96 +pkg syscall (netbsd-arm-cgo), const IFT_SHDSL = 169 +pkg syscall (netbsd-arm-cgo), const IFT_SIP = 31 +pkg syscall (netbsd-arm-cgo), const IFT_SIPSIG = 204 +pkg syscall (netbsd-arm-cgo), const IFT_SIPTG = 203 +pkg syscall (netbsd-arm-cgo), const IFT_SLIP = 28 +pkg syscall (netbsd-arm-cgo), const IFT_SMDSDXI = 43 +pkg syscall (netbsd-arm-cgo), const IFT_SMDSICIP = 52 +pkg syscall (netbsd-arm-cgo), const IFT_SONET = 39 +pkg syscall (netbsd-arm-cgo), const IFT_SONETOVERHEADCHANNEL = 185 +pkg syscall (netbsd-arm-cgo), const IFT_SONETPATH = 50 +pkg syscall (netbsd-arm-cgo), const IFT_SONETVT = 51 +pkg syscall (netbsd-arm-cgo), const IFT_SRP = 151 +pkg syscall (netbsd-arm-cgo), const IFT_SS7SIGLINK = 156 +pkg syscall (netbsd-arm-cgo), const IFT_STACKTOSTACK = 111 +pkg syscall (netbsd-arm-cgo), const IFT_STARLAN = 11 +pkg syscall (netbsd-arm-cgo), const IFT_STF = 215 +pkg syscall (netbsd-arm-cgo), const IFT_T1 = 18 +pkg syscall (netbsd-arm-cgo), const IFT_TDLC = 116 +pkg syscall (netbsd-arm-cgo), const IFT_TELINK = 200 +pkg syscall (netbsd-arm-cgo), const IFT_TERMPAD = 91 +pkg syscall (netbsd-arm-cgo), const IFT_TR008 = 176 +pkg syscall (netbsd-arm-cgo), const IFT_TRANSPHDLC = 123 +pkg syscall (netbsd-arm-cgo), const IFT_TUNNEL = 131 +pkg syscall (netbsd-arm-cgo), const IFT_ULTRA = 29 +pkg syscall (netbsd-arm-cgo), const IFT_USB = 160 +pkg syscall (netbsd-arm-cgo), const IFT_V11 = 64 +pkg syscall (netbsd-arm-cgo), const IFT_V35 = 45 +pkg syscall (netbsd-arm-cgo), const IFT_V36 = 65 +pkg syscall (netbsd-arm-cgo), const IFT_V37 = 120 +pkg syscall (netbsd-arm-cgo), const IFT_VDSL = 97 +pkg syscall (netbsd-arm-cgo), const IFT_VIRTUALIPADDRESS = 112 +pkg syscall (netbsd-arm-cgo), const IFT_VIRTUALTG = 202 +pkg syscall (netbsd-arm-cgo), const IFT_VOICEDID = 213 +pkg syscall (netbsd-arm-cgo), const IFT_VOICEEM = 100 +pkg syscall (netbsd-arm-cgo), const IFT_VOICEEMFGD = 211 +pkg syscall (netbsd-arm-cgo), const IFT_VOICEENCAP = 103 +pkg syscall (netbsd-arm-cgo), const IFT_VOICEFGDEANA = 212 +pkg syscall (netbsd-arm-cgo), const IFT_VOICEFXO = 101 +pkg syscall (netbsd-arm-cgo), const IFT_VOICEFXS = 102 +pkg syscall (netbsd-arm-cgo), const IFT_VOICEOVERATM = 152 +pkg syscall (netbsd-arm-cgo), const IFT_VOICEOVERCABLE = 198 +pkg syscall (netbsd-arm-cgo), const IFT_VOICEOVERFRAMERELAY = 153 +pkg syscall (netbsd-arm-cgo), const IFT_VOICEOVERIP = 104 +pkg syscall (netbsd-arm-cgo), const IFT_X213 = 93 +pkg syscall (netbsd-arm-cgo), const IFT_X25 = 5 +pkg syscall (netbsd-arm-cgo), const IFT_X25DDN = 4 +pkg syscall (netbsd-arm-cgo), const IFT_X25HUNTGROUP = 122 +pkg syscall (netbsd-arm-cgo), const IFT_X25MLP = 121 +pkg syscall (netbsd-arm-cgo), const IFT_X25PLE = 40 +pkg syscall (netbsd-arm-cgo), const IFT_XETHER = 26 +pkg syscall (netbsd-arm-cgo), const IGNBRK = 1 +pkg syscall (netbsd-arm-cgo), const IGNCR = 128 +pkg syscall (netbsd-arm-cgo), const IGNPAR = 4 +pkg syscall (netbsd-arm-cgo), const IMAXBEL = 8192 +pkg syscall (netbsd-arm-cgo), const INLCR = 64 +pkg syscall (netbsd-arm-cgo), const INPCK = 16 +pkg syscall (netbsd-arm-cgo), const IN_CLASSA_HOST = 16777215 +pkg syscall (netbsd-arm-cgo), const IN_CLASSA_MAX = 128 +pkg syscall (netbsd-arm-cgo), const IN_CLASSA_NET = 4278190080 +pkg syscall (netbsd-arm-cgo), const IN_CLASSA_NSHIFT = 24 +pkg syscall (netbsd-arm-cgo), const IN_CLASSB_HOST = 65535 +pkg syscall (netbsd-arm-cgo), const IN_CLASSB_MAX = 65536 +pkg syscall (netbsd-arm-cgo), const IN_CLASSB_NET = 4294901760 +pkg syscall (netbsd-arm-cgo), const IN_CLASSB_NSHIFT = 16 +pkg syscall (netbsd-arm-cgo), const IN_CLASSC_HOST = 255 +pkg syscall (netbsd-arm-cgo), const IN_CLASSC_NET = 4294967040 +pkg syscall (netbsd-arm-cgo), const IN_CLASSC_NSHIFT = 8 +pkg syscall (netbsd-arm-cgo), const IN_CLASSD_HOST = 268435455 +pkg syscall (netbsd-arm-cgo), const IN_CLASSD_NET = 4026531840 +pkg syscall (netbsd-arm-cgo), const IN_CLASSD_NSHIFT = 28 +pkg syscall (netbsd-arm-cgo), const IN_LOOPBACKNET = 127 +pkg syscall (netbsd-arm-cgo), const IPPROTO_AH = 51 +pkg syscall (netbsd-arm-cgo), const IPPROTO_CARP = 112 +pkg syscall (netbsd-arm-cgo), const IPPROTO_DONE = 257 +pkg syscall (netbsd-arm-cgo), const IPPROTO_DSTOPTS = 60 +pkg syscall (netbsd-arm-cgo), const IPPROTO_EGP = 8 +pkg syscall (netbsd-arm-cgo), const IPPROTO_ENCAP = 98 +pkg syscall (netbsd-arm-cgo), const IPPROTO_EON = 80 +pkg syscall (netbsd-arm-cgo), const IPPROTO_ESP = 50 +pkg syscall (netbsd-arm-cgo), const IPPROTO_ETHERIP = 97 +pkg syscall (netbsd-arm-cgo), const IPPROTO_FRAGMENT = 44 +pkg syscall (netbsd-arm-cgo), const IPPROTO_GGP = 3 +pkg syscall (netbsd-arm-cgo), const IPPROTO_GRE = 47 +pkg syscall (netbsd-arm-cgo), const IPPROTO_HOPOPTS = 0 +pkg syscall (netbsd-arm-cgo), const IPPROTO_ICMP = 1 +pkg syscall (netbsd-arm-cgo), const IPPROTO_ICMPV6 = 58 +pkg syscall (netbsd-arm-cgo), const IPPROTO_IDP = 22 +pkg syscall (netbsd-arm-cgo), const IPPROTO_IGMP = 2 +pkg syscall (netbsd-arm-cgo), const IPPROTO_IPCOMP = 108 +pkg syscall (netbsd-arm-cgo), const IPPROTO_IPIP = 4 +pkg syscall (netbsd-arm-cgo), const IPPROTO_IPV4 = 4 +pkg syscall (netbsd-arm-cgo), const IPPROTO_IPV6_ICMP = 58 +pkg syscall (netbsd-arm-cgo), const IPPROTO_MAX = 256 +pkg syscall (netbsd-arm-cgo), const IPPROTO_MAXID = 52 +pkg syscall (netbsd-arm-cgo), const IPPROTO_MOBILE = 55 +pkg syscall (netbsd-arm-cgo), const IPPROTO_NONE = 59 +pkg syscall (netbsd-arm-cgo), const IPPROTO_PFSYNC = 240 +pkg syscall (netbsd-arm-cgo), const IPPROTO_PIM = 103 +pkg syscall (netbsd-arm-cgo), const IPPROTO_PUP = 12 +pkg syscall (netbsd-arm-cgo), const IPPROTO_RAW = 255 +pkg syscall (netbsd-arm-cgo), const IPPROTO_ROUTING = 43 +pkg syscall (netbsd-arm-cgo), const IPPROTO_RSVP = 46 +pkg syscall (netbsd-arm-cgo), const IPPROTO_TP = 29 +pkg syscall (netbsd-arm-cgo), const IPPROTO_VRRP = 112 +pkg syscall (netbsd-arm-cgo), const IPV6_CHECKSUM = 26 +pkg syscall (netbsd-arm-cgo), const IPV6_DEFAULT_MULTICAST_HOPS = 1 +pkg syscall (netbsd-arm-cgo), const IPV6_DEFAULT_MULTICAST_LOOP = 1 +pkg syscall (netbsd-arm-cgo), const IPV6_DEFHLIM = 64 +pkg syscall (netbsd-arm-cgo), const IPV6_DONTFRAG = 62 +pkg syscall (netbsd-arm-cgo), const IPV6_DSTOPTS = 50 +pkg syscall (netbsd-arm-cgo), const IPV6_FAITH = 29 +pkg syscall (netbsd-arm-cgo), const IPV6_FLOWINFO_MASK = 4294967055 +pkg syscall (netbsd-arm-cgo), const IPV6_FLOWLABEL_MASK = 4294905600 +pkg syscall (netbsd-arm-cgo), const IPV6_FRAGTTL = 120 +pkg syscall (netbsd-arm-cgo), const IPV6_HLIMDEC = 1 +pkg syscall (netbsd-arm-cgo), const IPV6_HOPLIMIT = 47 +pkg syscall (netbsd-arm-cgo), const IPV6_HOPOPTS = 49 +pkg syscall (netbsd-arm-cgo), const IPV6_IPSEC_POLICY = 28 +pkg syscall (netbsd-arm-cgo), const IPV6_JOIN_GROUP = 12 +pkg syscall (netbsd-arm-cgo), const IPV6_LEAVE_GROUP = 13 +pkg syscall (netbsd-arm-cgo), const IPV6_MAXHLIM = 255 +pkg syscall (netbsd-arm-cgo), const IPV6_MAXPACKET = 65535 +pkg syscall (netbsd-arm-cgo), const IPV6_MMTU = 1280 +pkg syscall (netbsd-arm-cgo), const IPV6_MULTICAST_HOPS = 10 +pkg syscall (netbsd-arm-cgo), const IPV6_MULTICAST_IF = 9 +pkg syscall (netbsd-arm-cgo), const IPV6_MULTICAST_LOOP = 11 +pkg syscall (netbsd-arm-cgo), const IPV6_NEXTHOP = 48 +pkg syscall (netbsd-arm-cgo), const IPV6_PATHMTU = 44 +pkg syscall (netbsd-arm-cgo), const IPV6_PKTINFO = 46 +pkg syscall (netbsd-arm-cgo), const IPV6_PORTRANGE = 14 +pkg syscall (netbsd-arm-cgo), const IPV6_PORTRANGE_DEFAULT = 0 +pkg syscall (netbsd-arm-cgo), const IPV6_PORTRANGE_HIGH = 1 +pkg syscall (netbsd-arm-cgo), const IPV6_PORTRANGE_LOW = 2 +pkg syscall (netbsd-arm-cgo), const IPV6_RECVDSTOPTS = 40 +pkg syscall (netbsd-arm-cgo), const IPV6_RECVHOPLIMIT = 37 +pkg syscall (netbsd-arm-cgo), const IPV6_RECVHOPOPTS = 39 +pkg syscall (netbsd-arm-cgo), const IPV6_RECVPATHMTU = 43 +pkg syscall (netbsd-arm-cgo), const IPV6_RECVPKTINFO = 36 +pkg syscall (netbsd-arm-cgo), const IPV6_RECVRTHDR = 38 +pkg syscall (netbsd-arm-cgo), const IPV6_RECVTCLASS = 57 +pkg syscall (netbsd-arm-cgo), const IPV6_RTHDR = 51 +pkg syscall (netbsd-arm-cgo), const IPV6_RTHDRDSTOPTS = 35 +pkg syscall (netbsd-arm-cgo), const IPV6_RTHDR_LOOSE = 0 +pkg syscall (netbsd-arm-cgo), const IPV6_RTHDR_STRICT = 1 +pkg syscall (netbsd-arm-cgo), const IPV6_RTHDR_TYPE_0 = 0 +pkg syscall (netbsd-arm-cgo), const IPV6_SOCKOPT_RESERVED1 = 3 +pkg syscall (netbsd-arm-cgo), const IPV6_TCLASS = 61 +pkg syscall (netbsd-arm-cgo), const IPV6_UNICAST_HOPS = 4 +pkg syscall (netbsd-arm-cgo), const IPV6_USE_MIN_MTU = 42 +pkg syscall (netbsd-arm-cgo), const IPV6_V6ONLY = 27 +pkg syscall (netbsd-arm-cgo), const IPV6_VERSION = 96 +pkg syscall (netbsd-arm-cgo), const IPV6_VERSION_MASK = 240 +pkg syscall (netbsd-arm-cgo), const IP_ADD_MEMBERSHIP = 12 +pkg syscall (netbsd-arm-cgo), const IP_DEFAULT_MULTICAST_LOOP = 1 +pkg syscall (netbsd-arm-cgo), const IP_DEFAULT_MULTICAST_TTL = 1 +pkg syscall (netbsd-arm-cgo), const IP_DF = 16384 +pkg syscall (netbsd-arm-cgo), const IP_DROP_MEMBERSHIP = 13 +pkg syscall (netbsd-arm-cgo), const IP_EF = 32768 +pkg syscall (netbsd-arm-cgo), const IP_ERRORMTU = 21 +pkg syscall (netbsd-arm-cgo), const IP_HDRINCL = 2 +pkg syscall (netbsd-arm-cgo), const IP_IPSEC_POLICY = 22 +pkg syscall (netbsd-arm-cgo), const IP_MAXPACKET = 65535 +pkg syscall (netbsd-arm-cgo), const IP_MAX_MEMBERSHIPS = 20 +pkg syscall (netbsd-arm-cgo), const IP_MF = 8192 +pkg syscall (netbsd-arm-cgo), const IP_MINFRAGSIZE = 69 +pkg syscall (netbsd-arm-cgo), const IP_MINTTL = 24 +pkg syscall (netbsd-arm-cgo), const IP_MSS = 576 +pkg syscall (netbsd-arm-cgo), const IP_MULTICAST_IF = 9 +pkg syscall (netbsd-arm-cgo), const IP_MULTICAST_LOOP = 11 +pkg syscall (netbsd-arm-cgo), const IP_MULTICAST_TTL = 10 +pkg syscall (netbsd-arm-cgo), const IP_OFFMASK = 8191 +pkg syscall (netbsd-arm-cgo), const IP_OPTIONS = 1 +pkg syscall (netbsd-arm-cgo), const IP_PORTRANGE = 19 +pkg syscall (netbsd-arm-cgo), const IP_PORTRANGE_DEFAULT = 0 +pkg syscall (netbsd-arm-cgo), const IP_PORTRANGE_HIGH = 1 +pkg syscall (netbsd-arm-cgo), const IP_PORTRANGE_LOW = 2 +pkg syscall (netbsd-arm-cgo), const IP_RECVDSTADDR = 7 +pkg syscall (netbsd-arm-cgo), const IP_RECVIF = 20 +pkg syscall (netbsd-arm-cgo), const IP_RECVOPTS = 5 +pkg syscall (netbsd-arm-cgo), const IP_RECVRETOPTS = 6 +pkg syscall (netbsd-arm-cgo), const IP_RECVTTL = 23 +pkg syscall (netbsd-arm-cgo), const IP_RETOPTS = 8 +pkg syscall (netbsd-arm-cgo), const IP_RF = 32768 +pkg syscall (netbsd-arm-cgo), const IP_TOS = 3 +pkg syscall (netbsd-arm-cgo), const IP_TTL = 4 +pkg syscall (netbsd-arm-cgo), const ISIG = 128 +pkg syscall (netbsd-arm-cgo), const ISTRIP = 32 +pkg syscall (netbsd-arm-cgo), const IXANY = 2048 +pkg syscall (netbsd-arm-cgo), const IXOFF = 1024 +pkg syscall (netbsd-arm-cgo), const IXON = 512 +pkg syscall (netbsd-arm-cgo), const ImplementsGetwd = false +pkg syscall (netbsd-arm-cgo), const LOCK_EX = 2 +pkg syscall (netbsd-arm-cgo), const LOCK_NB = 4 +pkg syscall (netbsd-arm-cgo), const LOCK_SH = 1 +pkg syscall (netbsd-arm-cgo), const LOCK_UN = 8 +pkg syscall (netbsd-arm-cgo), const MSG_BCAST = 256 +pkg syscall (netbsd-arm-cgo), const MSG_CMSG_CLOEXEC = 2048 +pkg syscall (netbsd-arm-cgo), const MSG_CONTROLMBUF = 33554432 +pkg syscall (netbsd-arm-cgo), const MSG_CTRUNC = 32 +pkg syscall (netbsd-arm-cgo), const MSG_DONTROUTE = 4 +pkg syscall (netbsd-arm-cgo), const MSG_DONTWAIT = 128 +pkg syscall (netbsd-arm-cgo), const MSG_EOR = 8 +pkg syscall (netbsd-arm-cgo), const MSG_IOVUSRSPACE = 67108864 +pkg syscall (netbsd-arm-cgo), const MSG_LENUSRSPACE = 134217728 +pkg syscall (netbsd-arm-cgo), const MSG_MCAST = 512 +pkg syscall (netbsd-arm-cgo), const MSG_NAMEMBUF = 16777216 +pkg syscall (netbsd-arm-cgo), const MSG_NBIO = 4096 +pkg syscall (netbsd-arm-cgo), const MSG_NOSIGNAL = 1024 +pkg syscall (netbsd-arm-cgo), const MSG_OOB = 1 +pkg syscall (netbsd-arm-cgo), const MSG_PEEK = 2 +pkg syscall (netbsd-arm-cgo), const MSG_TRUNC = 16 +pkg syscall (netbsd-arm-cgo), const MSG_USERFLAGS = 16777215 +pkg syscall (netbsd-arm-cgo), const MSG_WAITALL = 64 +pkg syscall (netbsd-arm-cgo), const NAME_MAX = 511 +pkg syscall (netbsd-arm-cgo), const NET_RT_DUMP = 1 +pkg syscall (netbsd-arm-cgo), const NET_RT_FLAGS = 2 +pkg syscall (netbsd-arm-cgo), const NET_RT_IFLIST = 5 +pkg syscall (netbsd-arm-cgo), const NET_RT_MAXID = 6 +pkg syscall (netbsd-arm-cgo), const NET_RT_OIFLIST = 4 +pkg syscall (netbsd-arm-cgo), const NET_RT_OOIFLIST = 3 +pkg syscall (netbsd-arm-cgo), const NOFLSH = 2147483648 +pkg syscall (netbsd-arm-cgo), const NOTE_ATTRIB = 8 +pkg syscall (netbsd-arm-cgo), const NOTE_CHILD = 4 +pkg syscall (netbsd-arm-cgo), const NOTE_DELETE = 1 +pkg syscall (netbsd-arm-cgo), const NOTE_EXEC = 536870912 +pkg syscall (netbsd-arm-cgo), const NOTE_EXIT = 2147483648 +pkg syscall (netbsd-arm-cgo), const NOTE_EXTEND = 4 +pkg syscall (netbsd-arm-cgo), const NOTE_FORK = 1073741824 +pkg syscall (netbsd-arm-cgo), const NOTE_LINK = 16 +pkg syscall (netbsd-arm-cgo), const NOTE_LOWAT = 1 +pkg syscall (netbsd-arm-cgo), const NOTE_PCTRLMASK = 4026531840 +pkg syscall (netbsd-arm-cgo), const NOTE_PDATAMASK = 1048575 +pkg syscall (netbsd-arm-cgo), const NOTE_RENAME = 32 +pkg syscall (netbsd-arm-cgo), const NOTE_REVOKE = 64 +pkg syscall (netbsd-arm-cgo), const NOTE_TRACK = 1 +pkg syscall (netbsd-arm-cgo), const NOTE_TRACKERR = 2 +pkg syscall (netbsd-arm-cgo), const NOTE_WRITE = 2 +pkg syscall (netbsd-arm-cgo), const OCRNL = 16 +pkg syscall (netbsd-arm-cgo), const OFIOGETBMAP = 3221513850 +pkg syscall (netbsd-arm-cgo), const ONLCR = 2 +pkg syscall (netbsd-arm-cgo), const ONLRET = 64 +pkg syscall (netbsd-arm-cgo), const ONOCR = 32 +pkg syscall (netbsd-arm-cgo), const ONOEOT = 8 +pkg syscall (netbsd-arm-cgo), const OPOST = 1 +pkg syscall (netbsd-arm-cgo), const O_ACCMODE = 3 +pkg syscall (netbsd-arm-cgo), const O_ALT_IO = 262144 +pkg syscall (netbsd-arm-cgo), const O_APPEND = 8 +pkg syscall (netbsd-arm-cgo), const O_ASYNC = 64 +pkg syscall (netbsd-arm-cgo), const O_CLOEXEC = 4194304 +pkg syscall (netbsd-arm-cgo), const O_CREAT = 512 +pkg syscall (netbsd-arm-cgo), const O_DIRECT = 524288 +pkg syscall (netbsd-arm-cgo), const O_DIRECTORY = 2097152 +pkg syscall (netbsd-arm-cgo), const O_DSYNC = 65536 +pkg syscall (netbsd-arm-cgo), const O_EXCL = 2048 +pkg syscall (netbsd-arm-cgo), const O_EXLOCK = 32 +pkg syscall (netbsd-arm-cgo), const O_FSYNC = 128 +pkg syscall (netbsd-arm-cgo), const O_NDELAY = 4 +pkg syscall (netbsd-arm-cgo), const O_NOCTTY = 32768 +pkg syscall (netbsd-arm-cgo), const O_NOFOLLOW = 256 +pkg syscall (netbsd-arm-cgo), const O_NONBLOCK = 4 +pkg syscall (netbsd-arm-cgo), const O_NOSIGPIPE = 16777216 +pkg syscall (netbsd-arm-cgo), const O_RSYNC = 131072 +pkg syscall (netbsd-arm-cgo), const O_SHLOCK = 16 +pkg syscall (netbsd-arm-cgo), const O_SYNC = 128 +pkg syscall (netbsd-arm-cgo), const O_TRUNC = 1024 +pkg syscall (netbsd-arm-cgo), const PARENB = 4096 +pkg syscall (netbsd-arm-cgo), const PARMRK = 8 +pkg syscall (netbsd-arm-cgo), const PARODD = 8192 +pkg syscall (netbsd-arm-cgo), const PENDIN = 536870912 +pkg syscall (netbsd-arm-cgo), const PRI_IOFLUSH = 124 +pkg syscall (netbsd-arm-cgo), const PTRACE_CONT = 7 +pkg syscall (netbsd-arm-cgo), const PTRACE_KILL = 8 +pkg syscall (netbsd-arm-cgo), const PTRACE_TRACEME = 0 +pkg syscall (netbsd-arm-cgo), const RLIMIT_AS = 10 +pkg syscall (netbsd-arm-cgo), const RLIMIT_CORE = 4 +pkg syscall (netbsd-arm-cgo), const RLIMIT_CPU = 0 +pkg syscall (netbsd-arm-cgo), const RLIMIT_DATA = 2 +pkg syscall (netbsd-arm-cgo), const RLIMIT_FSIZE = 1 +pkg syscall (netbsd-arm-cgo), const RLIMIT_NOFILE = 8 +pkg syscall (netbsd-arm-cgo), const RLIMIT_STACK = 3 +pkg syscall (netbsd-arm-cgo), const RLIM_INFINITY = 9223372036854775807 +pkg syscall (netbsd-arm-cgo), const RTAX_AUTHOR = 6 +pkg syscall (netbsd-arm-cgo), const RTAX_BRD = 7 +pkg syscall (netbsd-arm-cgo), const RTAX_DST = 0 +pkg syscall (netbsd-arm-cgo), const RTAX_GATEWAY = 1 +pkg syscall (netbsd-arm-cgo), const RTAX_GENMASK = 3 +pkg syscall (netbsd-arm-cgo), const RTAX_IFA = 5 +pkg syscall (netbsd-arm-cgo), const RTAX_IFP = 4 +pkg syscall (netbsd-arm-cgo), const RTAX_MAX = 9 +pkg syscall (netbsd-arm-cgo), const RTAX_NETMASK = 2 +pkg syscall (netbsd-arm-cgo), const RTAX_TAG = 8 +pkg syscall (netbsd-arm-cgo), const RTA_AUTHOR = 64 +pkg syscall (netbsd-arm-cgo), const RTA_BRD = 128 +pkg syscall (netbsd-arm-cgo), const RTA_DST = 1 +pkg syscall (netbsd-arm-cgo), const RTA_GATEWAY = 2 +pkg syscall (netbsd-arm-cgo), const RTA_GENMASK = 8 +pkg syscall (netbsd-arm-cgo), const RTA_IFA = 32 +pkg syscall (netbsd-arm-cgo), const RTA_IFP = 16 +pkg syscall (netbsd-arm-cgo), const RTA_NETMASK = 4 +pkg syscall (netbsd-arm-cgo), const RTA_TAG = 256 +pkg syscall (netbsd-arm-cgo), const RTF_ANNOUNCE = 131072 +pkg syscall (netbsd-arm-cgo), const RTF_BLACKHOLE = 4096 +pkg syscall (netbsd-arm-cgo), const RTF_CLONED = 8192 +pkg syscall (netbsd-arm-cgo), const RTF_CLONING = 256 +pkg syscall (netbsd-arm-cgo), const RTF_DONE = 64 +pkg syscall (netbsd-arm-cgo), const RTF_DYNAMIC = 16 +pkg syscall (netbsd-arm-cgo), const RTF_GATEWAY = 2 +pkg syscall (netbsd-arm-cgo), const RTF_HOST = 4 +pkg syscall (netbsd-arm-cgo), const RTF_LLINFO = 1024 +pkg syscall (netbsd-arm-cgo), const RTF_MASK = 128 +pkg syscall (netbsd-arm-cgo), const RTF_MODIFIED = 32 +pkg syscall (netbsd-arm-cgo), const RTF_PROTO1 = 32768 +pkg syscall (netbsd-arm-cgo), const RTF_PROTO2 = 16384 +pkg syscall (netbsd-arm-cgo), const RTF_REJECT = 8 +pkg syscall (netbsd-arm-cgo), const RTF_SRC = 65536 +pkg syscall (netbsd-arm-cgo), const RTF_STATIC = 2048 +pkg syscall (netbsd-arm-cgo), const RTF_UP = 1 +pkg syscall (netbsd-arm-cgo), const RTF_XRESOLVE = 512 +pkg syscall (netbsd-arm-cgo), const RTM_ADD = 1 +pkg syscall (netbsd-arm-cgo), const RTM_CHANGE = 3 +pkg syscall (netbsd-arm-cgo), const RTM_CHGADDR = 21 +pkg syscall (netbsd-arm-cgo), const RTM_DELADDR = 13 +pkg syscall (netbsd-arm-cgo), const RTM_DELETE = 2 +pkg syscall (netbsd-arm-cgo), const RTM_GET = 4 +pkg syscall (netbsd-arm-cgo), const RTM_IEEE80211 = 17 +pkg syscall (netbsd-arm-cgo), const RTM_IFANNOUNCE = 16 +pkg syscall (netbsd-arm-cgo), const RTM_IFINFO = 20 +pkg syscall (netbsd-arm-cgo), const RTM_LLINFO_UPD = 19 +pkg syscall (netbsd-arm-cgo), const RTM_LOCK = 8 +pkg syscall (netbsd-arm-cgo), const RTM_LOSING = 5 +pkg syscall (netbsd-arm-cgo), const RTM_MISS = 7 +pkg syscall (netbsd-arm-cgo), const RTM_NEWADDR = 12 +pkg syscall (netbsd-arm-cgo), const RTM_OIFINFO = 15 +pkg syscall (netbsd-arm-cgo), const RTM_OLDADD = 9 +pkg syscall (netbsd-arm-cgo), const RTM_OLDDEL = 10 +pkg syscall (netbsd-arm-cgo), const RTM_OOIFINFO = 14 +pkg syscall (netbsd-arm-cgo), const RTM_REDIRECT = 6 +pkg syscall (netbsd-arm-cgo), const RTM_RESOLVE = 11 +pkg syscall (netbsd-arm-cgo), const RTM_RTTUNIT = 1000000 +pkg syscall (netbsd-arm-cgo), const RTM_SETGATE = 18 +pkg syscall (netbsd-arm-cgo), const RTM_VERSION = 4 +pkg syscall (netbsd-arm-cgo), const RTV_EXPIRE = 4 +pkg syscall (netbsd-arm-cgo), const RTV_HOPCOUNT = 2 +pkg syscall (netbsd-arm-cgo), const RTV_MTU = 1 +pkg syscall (netbsd-arm-cgo), const RTV_RPIPE = 8 +pkg syscall (netbsd-arm-cgo), const RTV_RTT = 64 +pkg syscall (netbsd-arm-cgo), const RTV_RTTVAR = 128 +pkg syscall (netbsd-arm-cgo), const RTV_SPIPE = 16 +pkg syscall (netbsd-arm-cgo), const RTV_SSTHRESH = 32 +pkg syscall (netbsd-arm-cgo), const RUSAGE_CHILDREN = -1 +pkg syscall (netbsd-arm-cgo), const RUSAGE_SELF = 0 +pkg syscall (netbsd-arm-cgo), const SCM_CREDS = 4 +pkg syscall (netbsd-arm-cgo), const SCM_RIGHTS = 1 +pkg syscall (netbsd-arm-cgo), const SCM_TIMESTAMP = 8 +pkg syscall (netbsd-arm-cgo), const SIGBUS = 10 +pkg syscall (netbsd-arm-cgo), const SIGCHLD = 20 +pkg syscall (netbsd-arm-cgo), const SIGCONT = 19 +pkg syscall (netbsd-arm-cgo), const SIGEMT = 7 +pkg syscall (netbsd-arm-cgo), const SIGINFO = 29 +pkg syscall (netbsd-arm-cgo), const SIGIO = 23 +pkg syscall (netbsd-arm-cgo), const SIGIOT = 6 +pkg syscall (netbsd-arm-cgo), const SIGPROF = 27 +pkg syscall (netbsd-arm-cgo), const SIGPWR = 32 +pkg syscall (netbsd-arm-cgo), const SIGSTOP = 17 +pkg syscall (netbsd-arm-cgo), const SIGSYS = 12 +pkg syscall (netbsd-arm-cgo), const SIGTSTP = 18 +pkg syscall (netbsd-arm-cgo), const SIGTTIN = 21 +pkg syscall (netbsd-arm-cgo), const SIGTTOU = 22 +pkg syscall (netbsd-arm-cgo), const SIGURG = 16 +pkg syscall (netbsd-arm-cgo), const SIGUSR1 = 30 +pkg syscall (netbsd-arm-cgo), const SIGUSR2 = 31 +pkg syscall (netbsd-arm-cgo), const SIGVTALRM = 26 +pkg syscall (netbsd-arm-cgo), const SIGWINCH = 28 +pkg syscall (netbsd-arm-cgo), const SIGXCPU = 24 +pkg syscall (netbsd-arm-cgo), const SIGXFSZ = 25 +pkg syscall (netbsd-arm-cgo), const SIOCADDMULTI = 2156947761 +pkg syscall (netbsd-arm-cgo), const SIOCADDRT = 2150658570 +pkg syscall (netbsd-arm-cgo), const SIOCAIFADDR = 2151704858 +pkg syscall (netbsd-arm-cgo), const SIOCALIFADDR = 2165860636 +pkg syscall (netbsd-arm-cgo), const SIOCATMARK = 1074033415 +pkg syscall (netbsd-arm-cgo), const SIOCDELMULTI = 2156947762 +pkg syscall (netbsd-arm-cgo), const SIOCDELRT = 2150658571 +pkg syscall (netbsd-arm-cgo), const SIOCDIFADDR = 2156947737 +pkg syscall (netbsd-arm-cgo), const SIOCDIFPHYADDR = 2156947785 +pkg syscall (netbsd-arm-cgo), const SIOCDLIFADDR = 2165860638 +pkg syscall (netbsd-arm-cgo), const SIOCGDRVSPEC = 3223087483 +pkg syscall (netbsd-arm-cgo), const SIOCGETPFSYNC = 3230689784 +pkg syscall (netbsd-arm-cgo), const SIOCGETSGCNT = 3222566196 +pkg syscall (netbsd-arm-cgo), const SIOCGETVIFCNT = 3222566195 +pkg syscall (netbsd-arm-cgo), const SIOCGHIWAT = 1074033409 +pkg syscall (netbsd-arm-cgo), const SIOCGIFADDR = 3230689569 +pkg syscall (netbsd-arm-cgo), const SIOCGIFADDRPREF = 3230951712 +pkg syscall (netbsd-arm-cgo), const SIOCGIFALIAS = 3225446683 +pkg syscall (netbsd-arm-cgo), const SIOCGIFBRDADDR = 3230689571 +pkg syscall (netbsd-arm-cgo), const SIOCGIFCAP = 3223349622 +pkg syscall (netbsd-arm-cgo), const SIOCGIFCONF = 3221776678 +pkg syscall (netbsd-arm-cgo), const SIOCGIFDATA = 3230951813 +pkg syscall (netbsd-arm-cgo), const SIOCGIFDLT = 3230689655 +pkg syscall (netbsd-arm-cgo), const SIOCGIFDSTADDR = 3230689570 +pkg syscall (netbsd-arm-cgo), const SIOCGIFFLAGS = 3230689553 +pkg syscall (netbsd-arm-cgo), const SIOCGIFGENERIC = 3230689594 +pkg syscall (netbsd-arm-cgo), const SIOCGIFMEDIA = 3223873846 +pkg syscall (netbsd-arm-cgo), const SIOCGIFMETRIC = 3230689559 +pkg syscall (netbsd-arm-cgo), const SIOCGIFMTU = 3230689662 +pkg syscall (netbsd-arm-cgo), const SIOCGIFNETMASK = 3230689573 +pkg syscall (netbsd-arm-cgo), const SIOCGIFPDSTADDR = 3230689608 +pkg syscall (netbsd-arm-cgo), const SIOCGIFPSRCADDR = 3230689607 +pkg syscall (netbsd-arm-cgo), const SIOCGLIFADDR = 3239602461 +pkg syscall (netbsd-arm-cgo), const SIOCGLIFPHYADDR = 3239602507 +pkg syscall (netbsd-arm-cgo), const SIOCGLINKSTR = 3223087495 +pkg syscall (netbsd-arm-cgo), const SIOCGLOWAT = 1074033411 +pkg syscall (netbsd-arm-cgo), const SIOCGPGRP = 1074033417 +pkg syscall (netbsd-arm-cgo), const SIOCGVH = 3230689667 +pkg syscall (netbsd-arm-cgo), const SIOCIFCREATE = 2156947834 +pkg syscall (netbsd-arm-cgo), const SIOCIFDESTROY = 2156947833 +pkg syscall (netbsd-arm-cgo), const SIOCIFGCLONERS = 3222038904 +pkg syscall (netbsd-arm-cgo), const SIOCINITIFADDR = 3225708932 +pkg syscall (netbsd-arm-cgo), const SIOCSDRVSPEC = 2149345659 +pkg syscall (netbsd-arm-cgo), const SIOCSETPFSYNC = 2156947959 +pkg syscall (netbsd-arm-cgo), const SIOCSHIWAT = 2147775232 +pkg syscall (netbsd-arm-cgo), const SIOCSIFADDR = 2156947724 +pkg syscall (netbsd-arm-cgo), const SIOCSIFADDRPREF = 2157209887 +pkg syscall (netbsd-arm-cgo), const SIOCSIFBRDADDR = 2156947731 +pkg syscall (netbsd-arm-cgo), const SIOCSIFCAP = 2149607797 +pkg syscall (netbsd-arm-cgo), const SIOCSIFDSTADDR = 2156947726 +pkg syscall (netbsd-arm-cgo), const SIOCSIFFLAGS = 2156947728 +pkg syscall (netbsd-arm-cgo), const SIOCSIFGENERIC = 2156947769 +pkg syscall (netbsd-arm-cgo), const SIOCSIFMEDIA = 3230689589 +pkg syscall (netbsd-arm-cgo), const SIOCSIFMETRIC = 2156947736 +pkg syscall (netbsd-arm-cgo), const SIOCSIFMTU = 2156947839 +pkg syscall (netbsd-arm-cgo), const SIOCSIFNETMASK = 2156947734 +pkg syscall (netbsd-arm-cgo), const SIOCSIFPHYADDR = 2151704902 +pkg syscall (netbsd-arm-cgo), const SIOCSLIFPHYADDR = 2165860682 +pkg syscall (netbsd-arm-cgo), const SIOCSLINKSTR = 2149345672 +pkg syscall (netbsd-arm-cgo), const SIOCSLOWAT = 2147775234 +pkg syscall (netbsd-arm-cgo), const SIOCSPGRP = 2147775240 +pkg syscall (netbsd-arm-cgo), const SIOCSVH = 3230689666 +pkg syscall (netbsd-arm-cgo), const SIOCZIFDATA = 3230951814 +pkg syscall (netbsd-arm-cgo), const SOCK_CLOEXEC = 268435456 +pkg syscall (netbsd-arm-cgo), const SOCK_FLAGS_MASK = 4026531840 +pkg syscall (netbsd-arm-cgo), const SOCK_NONBLOCK = 536870912 +pkg syscall (netbsd-arm-cgo), const SOCK_NOSIGPIPE = 1073741824 +pkg syscall (netbsd-arm-cgo), const SOCK_RDM = 4 +pkg syscall (netbsd-arm-cgo), const SOL_SOCKET = 65535 +pkg syscall (netbsd-arm-cgo), const SOMAXCONN = 128 +pkg syscall (netbsd-arm-cgo), const SO_ACCEPTCONN = 2 +pkg syscall (netbsd-arm-cgo), const SO_ACCEPTFILTER = 4096 +pkg syscall (netbsd-arm-cgo), const SO_BROADCAST = 32 +pkg syscall (netbsd-arm-cgo), const SO_DEBUG = 1 +pkg syscall (netbsd-arm-cgo), const SO_DONTROUTE = 16 +pkg syscall (netbsd-arm-cgo), const SO_ERROR = 4103 +pkg syscall (netbsd-arm-cgo), const SO_KEEPALIVE = 8 +pkg syscall (netbsd-arm-cgo), const SO_LINGER = 128 +pkg syscall (netbsd-arm-cgo), const SO_NOHEADER = 4106 +pkg syscall (netbsd-arm-cgo), const SO_NOSIGPIPE = 2048 +pkg syscall (netbsd-arm-cgo), const SO_OOBINLINE = 256 +pkg syscall (netbsd-arm-cgo), const SO_OVERFLOWED = 4105 +pkg syscall (netbsd-arm-cgo), const SO_RCVBUF = 4098 +pkg syscall (netbsd-arm-cgo), const SO_RCVLOWAT = 4100 +pkg syscall (netbsd-arm-cgo), const SO_RCVTIMEO = 4108 +pkg syscall (netbsd-arm-cgo), const SO_REUSEADDR = 4 +pkg syscall (netbsd-arm-cgo), const SO_REUSEPORT = 512 +pkg syscall (netbsd-arm-cgo), const SO_SNDBUF = 4097 +pkg syscall (netbsd-arm-cgo), const SO_SNDLOWAT = 4099 +pkg syscall (netbsd-arm-cgo), const SO_SNDTIMEO = 4107 +pkg syscall (netbsd-arm-cgo), const SO_TIMESTAMP = 8192 +pkg syscall (netbsd-arm-cgo), const SO_TYPE = 4104 +pkg syscall (netbsd-arm-cgo), const SO_USELOOPBACK = 64 +pkg syscall (netbsd-arm-cgo), const SYSCTL_VERSION = 16777216 +pkg syscall (netbsd-arm-cgo), const SYSCTL_VERS_0 = 0 +pkg syscall (netbsd-arm-cgo), const SYSCTL_VERS_1 = 16777216 +pkg syscall (netbsd-arm-cgo), const SYSCTL_VERS_MASK = 4278190080 +pkg syscall (netbsd-arm-cgo), const SYS_ACCEPT = 30 +pkg syscall (netbsd-arm-cgo), const SYS_ACCESS = 33 +pkg syscall (netbsd-arm-cgo), const SYS_ACCT = 51 +pkg syscall (netbsd-arm-cgo), const SYS_ADJTIME = 421 +pkg syscall (netbsd-arm-cgo), const SYS_BIND = 104 +pkg syscall (netbsd-arm-cgo), const SYS_BREAK = 17 +pkg syscall (netbsd-arm-cgo), const SYS_CHDIR = 12 +pkg syscall (netbsd-arm-cgo), const SYS_CHFLAGS = 34 +pkg syscall (netbsd-arm-cgo), const SYS_CHMOD = 15 +pkg syscall (netbsd-arm-cgo), const SYS_CHOWN = 16 +pkg syscall (netbsd-arm-cgo), const SYS_CHROOT = 61 +pkg syscall (netbsd-arm-cgo), const SYS_CLOCK_GETRES = 429 +pkg syscall (netbsd-arm-cgo), const SYS_CLOCK_GETTIME = 427 +pkg syscall (netbsd-arm-cgo), const SYS_CLOCK_SETTIME = 428 +pkg syscall (netbsd-arm-cgo), const SYS_CLOSE = 6 +pkg syscall (netbsd-arm-cgo), const SYS_CONNECT = 98 +pkg syscall (netbsd-arm-cgo), const SYS_DUP = 41 +pkg syscall (netbsd-arm-cgo), const SYS_DUP2 = 90 +pkg syscall (netbsd-arm-cgo), const SYS_DUP3 = 454 +pkg syscall (netbsd-arm-cgo), const SYS_EXECVE = 59 +pkg syscall (netbsd-arm-cgo), const SYS_EXIT = 1 +pkg syscall (netbsd-arm-cgo), const SYS_EXTATTRCTL = 360 +pkg syscall (netbsd-arm-cgo), const SYS_EXTATTR_DELETE_FD = 366 +pkg syscall (netbsd-arm-cgo), const SYS_EXTATTR_DELETE_FILE = 363 +pkg syscall (netbsd-arm-cgo), const SYS_EXTATTR_DELETE_LINK = 369 +pkg syscall (netbsd-arm-cgo), const SYS_EXTATTR_GET_FD = 365 +pkg syscall (netbsd-arm-cgo), const SYS_EXTATTR_GET_FILE = 362 +pkg syscall (netbsd-arm-cgo), const SYS_EXTATTR_GET_LINK = 368 +pkg syscall (netbsd-arm-cgo), const SYS_EXTATTR_LIST_FD = 370 +pkg syscall (netbsd-arm-cgo), const SYS_EXTATTR_LIST_FILE = 371 +pkg syscall (netbsd-arm-cgo), const SYS_EXTATTR_LIST_LINK = 372 +pkg syscall (netbsd-arm-cgo), const SYS_EXTATTR_SET_FD = 364 +pkg syscall (netbsd-arm-cgo), const SYS_EXTATTR_SET_FILE = 361 +pkg syscall (netbsd-arm-cgo), const SYS_EXTATTR_SET_LINK = 367 +pkg syscall (netbsd-arm-cgo), const SYS_FACCESSAT = 462 +pkg syscall (netbsd-arm-cgo), const SYS_FCHDIR = 13 +pkg syscall (netbsd-arm-cgo), const SYS_FCHFLAGS = 35 +pkg syscall (netbsd-arm-cgo), const SYS_FCHMOD = 124 +pkg syscall (netbsd-arm-cgo), const SYS_FCHMODAT = 463 +pkg syscall (netbsd-arm-cgo), const SYS_FCHOWN = 123 +pkg syscall (netbsd-arm-cgo), const SYS_FCHOWNAT = 464 +pkg syscall (netbsd-arm-cgo), const SYS_FCHROOT = 297 +pkg syscall (netbsd-arm-cgo), const SYS_FCNTL = 92 +pkg syscall (netbsd-arm-cgo), const SYS_FDATASYNC = 241 +pkg syscall (netbsd-arm-cgo), const SYS_FEXECVE = 465 +pkg syscall (netbsd-arm-cgo), const SYS_FGETXATTR = 380 +pkg syscall (netbsd-arm-cgo), const SYS_FHSTAT = 451 +pkg syscall (netbsd-arm-cgo), const SYS_FKTRACE = 288 +pkg syscall (netbsd-arm-cgo), const SYS_FLISTXATTR = 383 +pkg syscall (netbsd-arm-cgo), const SYS_FLOCK = 131 +pkg syscall (netbsd-arm-cgo), const SYS_FORK = 2 +pkg syscall (netbsd-arm-cgo), const SYS_FPATHCONF = 192 +pkg syscall (netbsd-arm-cgo), const SYS_FREMOVEXATTR = 386 +pkg syscall (netbsd-arm-cgo), const SYS_FSETXATTR = 377 +pkg syscall (netbsd-arm-cgo), const SYS_FSTAT = 440 +pkg syscall (netbsd-arm-cgo), const SYS_FSTATAT = 466 +pkg syscall (netbsd-arm-cgo), const SYS_FSTATVFS1 = 358 +pkg syscall (netbsd-arm-cgo), const SYS_FSYNC = 95 +pkg syscall (netbsd-arm-cgo), const SYS_FSYNC_RANGE = 354 +pkg syscall (netbsd-arm-cgo), const SYS_FTRUNCATE = 201 +pkg syscall (netbsd-arm-cgo), const SYS_FUTIMENS = 472 +pkg syscall (netbsd-arm-cgo), const SYS_FUTIMES = 423 +pkg syscall (netbsd-arm-cgo), const SYS_GETCONTEXT = 307 +pkg syscall (netbsd-arm-cgo), const SYS_GETDENTS = 390 +pkg syscall (netbsd-arm-cgo), const SYS_GETEGID = 43 +pkg syscall (netbsd-arm-cgo), const SYS_GETEUID = 25 +pkg syscall (netbsd-arm-cgo), const SYS_GETFH = 395 +pkg syscall (netbsd-arm-cgo), const SYS_GETGID = 47 +pkg syscall (netbsd-arm-cgo), const SYS_GETGROUPS = 79 +pkg syscall (netbsd-arm-cgo), const SYS_GETITIMER = 426 +pkg syscall (netbsd-arm-cgo), const SYS_GETPEERNAME = 31 +pkg syscall (netbsd-arm-cgo), const SYS_GETPGID = 207 +pkg syscall (netbsd-arm-cgo), const SYS_GETPGRP = 81 +pkg syscall (netbsd-arm-cgo), const SYS_GETPID = 20 +pkg syscall (netbsd-arm-cgo), const SYS_GETPPID = 39 +pkg syscall (netbsd-arm-cgo), const SYS_GETPRIORITY = 100 +pkg syscall (netbsd-arm-cgo), const SYS_GETRLIMIT = 194 +pkg syscall (netbsd-arm-cgo), const SYS_GETRUSAGE = 445 +pkg syscall (netbsd-arm-cgo), const SYS_GETSID = 286 +pkg syscall (netbsd-arm-cgo), const SYS_GETSOCKNAME = 32 +pkg syscall (netbsd-arm-cgo), const SYS_GETSOCKOPT = 118 +pkg syscall (netbsd-arm-cgo), const SYS_GETTIMEOFDAY = 418 +pkg syscall (netbsd-arm-cgo), const SYS_GETUID = 24 +pkg syscall (netbsd-arm-cgo), const SYS_GETVFSSTAT = 356 +pkg syscall (netbsd-arm-cgo), const SYS_GETXATTR = 378 +pkg syscall (netbsd-arm-cgo), const SYS_IOCTL = 54 +pkg syscall (netbsd-arm-cgo), const SYS_ISSETUGID = 305 +pkg syscall (netbsd-arm-cgo), const SYS_KEVENT = 435 +pkg syscall (netbsd-arm-cgo), const SYS_KILL = 37 +pkg syscall (netbsd-arm-cgo), const SYS_KQUEUE = 344 +pkg syscall (netbsd-arm-cgo), const SYS_KQUEUE1 = 455 +pkg syscall (netbsd-arm-cgo), const SYS_KTRACE = 45 +pkg syscall (netbsd-arm-cgo), const SYS_LCHFLAGS = 304 +pkg syscall (netbsd-arm-cgo), const SYS_LCHMOD = 274 +pkg syscall (netbsd-arm-cgo), const SYS_LCHOWN = 275 +pkg syscall (netbsd-arm-cgo), const SYS_LGETXATTR = 379 +pkg syscall (netbsd-arm-cgo), const SYS_LINK = 9 +pkg syscall (netbsd-arm-cgo), const SYS_LINKAT = 457 +pkg syscall (netbsd-arm-cgo), const SYS_LISTEN = 106 +pkg syscall (netbsd-arm-cgo), const SYS_LISTXATTR = 381 +pkg syscall (netbsd-arm-cgo), const SYS_LLISTXATTR = 382 +pkg syscall (netbsd-arm-cgo), const SYS_LREMOVEXATTR = 385 +pkg syscall (netbsd-arm-cgo), const SYS_LSEEK = 199 +pkg syscall (netbsd-arm-cgo), const SYS_LSETXATTR = 376 +pkg syscall (netbsd-arm-cgo), const SYS_LSTAT = 441 +pkg syscall (netbsd-arm-cgo), const SYS_LUTIMES = 424 +pkg syscall (netbsd-arm-cgo), const SYS_MADVISE = 75 +pkg syscall (netbsd-arm-cgo), const SYS_MINCORE = 78 +pkg syscall (netbsd-arm-cgo), const SYS_MINHERIT = 273 +pkg syscall (netbsd-arm-cgo), const SYS_MKDIR = 136 +pkg syscall (netbsd-arm-cgo), const SYS_MKDIRAT = 461 +pkg syscall (netbsd-arm-cgo), const SYS_MKFIFO = 132 +pkg syscall (netbsd-arm-cgo), const SYS_MKFIFOAT = 459 +pkg syscall (netbsd-arm-cgo), const SYS_MKNOD = 450 +pkg syscall (netbsd-arm-cgo), const SYS_MKNODAT = 460 +pkg syscall (netbsd-arm-cgo), const SYS_MLOCK = 203 +pkg syscall (netbsd-arm-cgo), const SYS_MLOCKALL = 242 +pkg syscall (netbsd-arm-cgo), const SYS_MMAP = 197 +pkg syscall (netbsd-arm-cgo), const SYS_MODCTL = 246 +pkg syscall (netbsd-arm-cgo), const SYS_MOUNT = 410 +pkg syscall (netbsd-arm-cgo), const SYS_MPROTECT = 74 +pkg syscall (netbsd-arm-cgo), const SYS_MREMAP = 411 +pkg syscall (netbsd-arm-cgo), const SYS_MSGCTL = 444 +pkg syscall (netbsd-arm-cgo), const SYS_MSGGET = 225 +pkg syscall (netbsd-arm-cgo), const SYS_MSGRCV = 227 +pkg syscall (netbsd-arm-cgo), const SYS_MSGSND = 226 +pkg syscall (netbsd-arm-cgo), const SYS_MUNLOCK = 204 +pkg syscall (netbsd-arm-cgo), const SYS_MUNLOCKALL = 243 +pkg syscall (netbsd-arm-cgo), const SYS_MUNMAP = 73 +pkg syscall (netbsd-arm-cgo), const SYS_NANOSLEEP = 430 +pkg syscall (netbsd-arm-cgo), const SYS_NTP_ADJTIME = 176 +pkg syscall (netbsd-arm-cgo), const SYS_NTP_GETTIME = 448 +pkg syscall (netbsd-arm-cgo), const SYS_OPEN = 5 +pkg syscall (netbsd-arm-cgo), const SYS_OPENAT = 468 +pkg syscall (netbsd-arm-cgo), const SYS_PACCEPT = 456 +pkg syscall (netbsd-arm-cgo), const SYS_PATHCONF = 191 +pkg syscall (netbsd-arm-cgo), const SYS_PIPE = 42 +pkg syscall (netbsd-arm-cgo), const SYS_PIPE2 = 453 +pkg syscall (netbsd-arm-cgo), const SYS_PMC_CONTROL = 342 +pkg syscall (netbsd-arm-cgo), const SYS_PMC_GET_INFO = 341 +pkg syscall (netbsd-arm-cgo), const SYS_POLL = 209 +pkg syscall (netbsd-arm-cgo), const SYS_POLLTS = 437 +pkg syscall (netbsd-arm-cgo), const SYS_POSIX_FADVISE = 416 +pkg syscall (netbsd-arm-cgo), const SYS_POSIX_SPAWN = 474 +pkg syscall (netbsd-arm-cgo), const SYS_PREAD = 173 +pkg syscall (netbsd-arm-cgo), const SYS_PREADV = 289 +pkg syscall (netbsd-arm-cgo), const SYS_PROFIL = 44 +pkg syscall (netbsd-arm-cgo), const SYS_PSELECT = 436 +pkg syscall (netbsd-arm-cgo), const SYS_PSET_ASSIGN = 414 +pkg syscall (netbsd-arm-cgo), const SYS_PSET_CREATE = 412 +pkg syscall (netbsd-arm-cgo), const SYS_PSET_DESTROY = 413 +pkg syscall (netbsd-arm-cgo), const SYS_PTRACE = 26 +pkg syscall (netbsd-arm-cgo), const SYS_PWRITE = 174 +pkg syscall (netbsd-arm-cgo), const SYS_PWRITEV = 290 +pkg syscall (netbsd-arm-cgo), const SYS_RASCTL = 343 +pkg syscall (netbsd-arm-cgo), const SYS_READ = 3 +pkg syscall (netbsd-arm-cgo), const SYS_READLINK = 58 +pkg syscall (netbsd-arm-cgo), const SYS_READLINKAT = 469 +pkg syscall (netbsd-arm-cgo), const SYS_READV = 120 +pkg syscall (netbsd-arm-cgo), const SYS_REBOOT = 208 +pkg syscall (netbsd-arm-cgo), const SYS_RECVFROM = 29 +pkg syscall (netbsd-arm-cgo), const SYS_RECVMMSG = 475 +pkg syscall (netbsd-arm-cgo), const SYS_RECVMSG = 27 +pkg syscall (netbsd-arm-cgo), const SYS_REMOVEXATTR = 384 +pkg syscall (netbsd-arm-cgo), const SYS_RENAME = 128 +pkg syscall (netbsd-arm-cgo), const SYS_RENAMEAT = 458 +pkg syscall (netbsd-arm-cgo), const SYS_REVOKE = 56 +pkg syscall (netbsd-arm-cgo), const SYS_RMDIR = 137 +pkg syscall (netbsd-arm-cgo), const SYS_SBRK = 69 +pkg syscall (netbsd-arm-cgo), const SYS_SCHED_YIELD = 350 +pkg syscall (netbsd-arm-cgo), const SYS_SELECT = 417 +pkg syscall (netbsd-arm-cgo), const SYS_SEMCONFIG = 223 +pkg syscall (netbsd-arm-cgo), const SYS_SEMGET = 221 +pkg syscall (netbsd-arm-cgo), const SYS_SEMOP = 222 +pkg syscall (netbsd-arm-cgo), const SYS_SENDMMSG = 476 +pkg syscall (netbsd-arm-cgo), const SYS_SENDMSG = 28 +pkg syscall (netbsd-arm-cgo), const SYS_SENDTO = 133 +pkg syscall (netbsd-arm-cgo), const SYS_SETCONTEXT = 308 +pkg syscall (netbsd-arm-cgo), const SYS_SETEGID = 182 +pkg syscall (netbsd-arm-cgo), const SYS_SETEUID = 183 +pkg syscall (netbsd-arm-cgo), const SYS_SETGID = 181 +pkg syscall (netbsd-arm-cgo), const SYS_SETGROUPS = 80 +pkg syscall (netbsd-arm-cgo), const SYS_SETITIMER = 425 +pkg syscall (netbsd-arm-cgo), const SYS_SETPGID = 82 +pkg syscall (netbsd-arm-cgo), const SYS_SETPRIORITY = 96 +pkg syscall (netbsd-arm-cgo), const SYS_SETREGID = 127 +pkg syscall (netbsd-arm-cgo), const SYS_SETREUID = 126 +pkg syscall (netbsd-arm-cgo), const SYS_SETRLIMIT = 195 +pkg syscall (netbsd-arm-cgo), const SYS_SETSID = 147 +pkg syscall (netbsd-arm-cgo), const SYS_SETSOCKOPT = 105 +pkg syscall (netbsd-arm-cgo), const SYS_SETTIMEOFDAY = 419 +pkg syscall (netbsd-arm-cgo), const SYS_SETUID = 23 +pkg syscall (netbsd-arm-cgo), const SYS_SETXATTR = 375 +pkg syscall (netbsd-arm-cgo), const SYS_SHMAT = 228 +pkg syscall (netbsd-arm-cgo), const SYS_SHMCTL = 443 +pkg syscall (netbsd-arm-cgo), const SYS_SHMDT = 230 +pkg syscall (netbsd-arm-cgo), const SYS_SHMGET = 231 +pkg syscall (netbsd-arm-cgo), const SYS_SHUTDOWN = 134 +pkg syscall (netbsd-arm-cgo), const SYS_SIGQUEUEINFO = 245 +pkg syscall (netbsd-arm-cgo), const SYS_SOCKET = 394 +pkg syscall (netbsd-arm-cgo), const SYS_SOCKETPAIR = 135 +pkg syscall (netbsd-arm-cgo), const SYS_SSTK = 70 +pkg syscall (netbsd-arm-cgo), const SYS_STAT = 439 +pkg syscall (netbsd-arm-cgo), const SYS_STATVFS1 = 357 +pkg syscall (netbsd-arm-cgo), const SYS_SWAPCTL = 271 +pkg syscall (netbsd-arm-cgo), const SYS_SYMLINK = 57 +pkg syscall (netbsd-arm-cgo), const SYS_SYMLINKAT = 470 +pkg syscall (netbsd-arm-cgo), const SYS_SYNC = 36 +pkg syscall (netbsd-arm-cgo), const SYS_SYSARCH = 165 +pkg syscall (netbsd-arm-cgo), const SYS_TIMER_CREATE = 235 +pkg syscall (netbsd-arm-cgo), const SYS_TIMER_DELETE = 236 +pkg syscall (netbsd-arm-cgo), const SYS_TIMER_GETOVERRUN = 239 +pkg syscall (netbsd-arm-cgo), const SYS_TIMER_GETTIME = 447 +pkg syscall (netbsd-arm-cgo), const SYS_TIMER_SETTIME = 446 +pkg syscall (netbsd-arm-cgo), const SYS_TRUNCATE = 200 +pkg syscall (netbsd-arm-cgo), const SYS_UMASK = 60 +pkg syscall (netbsd-arm-cgo), const SYS_UNDELETE = 205 +pkg syscall (netbsd-arm-cgo), const SYS_UNLINK = 10 +pkg syscall (netbsd-arm-cgo), const SYS_UNLINKAT = 471 +pkg syscall (netbsd-arm-cgo), const SYS_UNMOUNT = 22 +pkg syscall (netbsd-arm-cgo), const SYS_UTIMENSAT = 467 +pkg syscall (netbsd-arm-cgo), const SYS_UTIMES = 420 +pkg syscall (netbsd-arm-cgo), const SYS_UTRACE = 306 +pkg syscall (netbsd-arm-cgo), const SYS_UUIDGEN = 355 +pkg syscall (netbsd-arm-cgo), const SYS_VADVISE = 72 +pkg syscall (netbsd-arm-cgo), const SYS_VFORK = 66 +pkg syscall (netbsd-arm-cgo), const SYS_WAIT4 = 449 +pkg syscall (netbsd-arm-cgo), const SYS_WRITE = 4 +pkg syscall (netbsd-arm-cgo), const SYS_WRITEV = 121 +pkg syscall (netbsd-arm-cgo), const SYS__LWP_CONTINUE = 314 +pkg syscall (netbsd-arm-cgo), const SYS__LWP_CREATE = 309 +pkg syscall (netbsd-arm-cgo), const SYS__LWP_CTL = 325 +pkg syscall (netbsd-arm-cgo), const SYS__LWP_DETACH = 319 +pkg syscall (netbsd-arm-cgo), const SYS__LWP_EXIT = 310 +pkg syscall (netbsd-arm-cgo), const SYS__LWP_GETNAME = 324 +pkg syscall (netbsd-arm-cgo), const SYS__LWP_GETPRIVATE = 316 +pkg syscall (netbsd-arm-cgo), const SYS__LWP_KILL = 318 +pkg syscall (netbsd-arm-cgo), const SYS__LWP_PARK = 434 +pkg syscall (netbsd-arm-cgo), const SYS__LWP_SELF = 311 +pkg syscall (netbsd-arm-cgo), const SYS__LWP_SETNAME = 323 +pkg syscall (netbsd-arm-cgo), const SYS__LWP_SETPRIVATE = 317 +pkg syscall (netbsd-arm-cgo), const SYS__LWP_SUSPEND = 313 +pkg syscall (netbsd-arm-cgo), const SYS__LWP_UNPARK = 321 +pkg syscall (netbsd-arm-cgo), const SYS__LWP_UNPARK_ALL = 322 +pkg syscall (netbsd-arm-cgo), const SYS__LWP_WAIT = 312 +pkg syscall (netbsd-arm-cgo), const SYS__LWP_WAKEUP = 315 +pkg syscall (netbsd-arm-cgo), const SYS__PSET_BIND = 415 +pkg syscall (netbsd-arm-cgo), const SYS__SCHED_GETAFFINITY = 349 +pkg syscall (netbsd-arm-cgo), const SYS__SCHED_GETPARAM = 347 +pkg syscall (netbsd-arm-cgo), const SYS__SCHED_SETAFFINITY = 348 +pkg syscall (netbsd-arm-cgo), const SYS__SCHED_SETPARAM = 346 +pkg syscall (netbsd-arm-cgo), const SYS___CLONE = 287 +pkg syscall (netbsd-arm-cgo), const SYS___GETCWD = 296 +pkg syscall (netbsd-arm-cgo), const SYS___GETLOGIN = 49 +pkg syscall (netbsd-arm-cgo), const SYS___POSIX_CHOWN = 283 +pkg syscall (netbsd-arm-cgo), const SYS___POSIX_FCHOWN = 284 +pkg syscall (netbsd-arm-cgo), const SYS___POSIX_LCHOWN = 285 +pkg syscall (netbsd-arm-cgo), const SYS___POSIX_RENAME = 270 +pkg syscall (netbsd-arm-cgo), const SYS___QUOTACTL = 473 +pkg syscall (netbsd-arm-cgo), const SYS___SEMCTL = 442 +pkg syscall (netbsd-arm-cgo), const SYS___SETLOGIN = 50 +pkg syscall (netbsd-arm-cgo), const SYS___SIGACTION_SIGTRAMP = 340 +pkg syscall (netbsd-arm-cgo), const SYS___SIGTIMEDWAIT = 431 +pkg syscall (netbsd-arm-cgo), const SYS___SYSCTL = 202 +pkg syscall (netbsd-arm-cgo), const S_ARCH1 = 65536 +pkg syscall (netbsd-arm-cgo), const S_ARCH2 = 131072 +pkg syscall (netbsd-arm-cgo), const S_BLKSIZE = 512 +pkg syscall (netbsd-arm-cgo), const S_IEXEC = 64 +pkg syscall (netbsd-arm-cgo), const S_IFMT = 61440 +pkg syscall (netbsd-arm-cgo), const S_IFWHT = 57344 +pkg syscall (netbsd-arm-cgo), const S_IREAD = 256 +pkg syscall (netbsd-arm-cgo), const S_IRGRP = 32 +pkg syscall (netbsd-arm-cgo), const S_IROTH = 4 +pkg syscall (netbsd-arm-cgo), const S_IRWXG = 56 +pkg syscall (netbsd-arm-cgo), const S_IRWXO = 7 +pkg syscall (netbsd-arm-cgo), const S_IRWXU = 448 +pkg syscall (netbsd-arm-cgo), const S_ISTXT = 512 +pkg syscall (netbsd-arm-cgo), const S_IWGRP = 16 +pkg syscall (netbsd-arm-cgo), const S_IWOTH = 2 +pkg syscall (netbsd-arm-cgo), const S_IWRITE = 128 +pkg syscall (netbsd-arm-cgo), const S_IXGRP = 8 +pkg syscall (netbsd-arm-cgo), const S_IXOTH = 1 +pkg syscall (netbsd-arm-cgo), const SizeofBpfHdr = 20 +pkg syscall (netbsd-arm-cgo), const SizeofBpfInsn = 8 +pkg syscall (netbsd-arm-cgo), const SizeofBpfProgram = 8 +pkg syscall (netbsd-arm-cgo), const SizeofBpfStat = 128 +pkg syscall (netbsd-arm-cgo), const SizeofBpfVersion = 4 +pkg syscall (netbsd-arm-cgo), const SizeofCmsghdr = 12 +pkg syscall (netbsd-arm-cgo), const SizeofIPMreq = 8 +pkg syscall (netbsd-arm-cgo), const SizeofIPv6Mreq = 20 +pkg syscall (netbsd-arm-cgo), const SizeofIfAnnounceMsghdr = 24 +pkg syscall (netbsd-arm-cgo), const SizeofIfData = 132 +pkg syscall (netbsd-arm-cgo), const SizeofIfMsghdr = 152 +pkg syscall (netbsd-arm-cgo), const SizeofIfaMsghdr = 24 +pkg syscall (netbsd-arm-cgo), const SizeofInet6Pktinfo = 20 +pkg syscall (netbsd-arm-cgo), const SizeofLinger = 8 +pkg syscall (netbsd-arm-cgo), const SizeofMsghdr = 28 +pkg syscall (netbsd-arm-cgo), const SizeofRtMetrics = 80 +pkg syscall (netbsd-arm-cgo), const SizeofRtMsghdr = 120 +pkg syscall (netbsd-arm-cgo), const SizeofSockaddrAny = 108 +pkg syscall (netbsd-arm-cgo), const SizeofSockaddrDatalink = 20 +pkg syscall (netbsd-arm-cgo), const SizeofSockaddrInet4 = 16 +pkg syscall (netbsd-arm-cgo), const SizeofSockaddrInet6 = 28 +pkg syscall (netbsd-arm-cgo), const SizeofSockaddrUnix = 106 +pkg syscall (netbsd-arm-cgo), const TCIFLUSH = 1 +pkg syscall (netbsd-arm-cgo), const TCIOFLUSH = 3 +pkg syscall (netbsd-arm-cgo), const TCOFLUSH = 2 +pkg syscall (netbsd-arm-cgo), const TCP_CONGCTL = 32 +pkg syscall (netbsd-arm-cgo), const TCP_KEEPCNT = 6 +pkg syscall (netbsd-arm-cgo), const TCP_KEEPIDLE = 3 +pkg syscall (netbsd-arm-cgo), const TCP_KEEPINIT = 7 +pkg syscall (netbsd-arm-cgo), const TCP_KEEPINTVL = 5 +pkg syscall (netbsd-arm-cgo), const TCP_MAXBURST = 4 +pkg syscall (netbsd-arm-cgo), const TCP_MAXSEG = 2 +pkg syscall (netbsd-arm-cgo), const TCP_MAXWIN = 65535 +pkg syscall (netbsd-arm-cgo), const TCP_MAX_WINSHIFT = 14 +pkg syscall (netbsd-arm-cgo), const TCP_MD5SIG = 16 +pkg syscall (netbsd-arm-cgo), const TCP_MINMSS = 216 +pkg syscall (netbsd-arm-cgo), const TCP_MSS = 536 +pkg syscall (netbsd-arm-cgo), const TCSAFLUSH = 2 +pkg syscall (netbsd-arm-cgo), const TIOCCBRK = 536900730 +pkg syscall (netbsd-arm-cgo), const TIOCCDTR = 536900728 +pkg syscall (netbsd-arm-cgo), const TIOCCONS = 2147775586 +pkg syscall (netbsd-arm-cgo), const TIOCDCDTIMESTAMP = 1074558040 +pkg syscall (netbsd-arm-cgo), const TIOCDRAIN = 536900702 +pkg syscall (netbsd-arm-cgo), const TIOCEXCL = 536900621 +pkg syscall (netbsd-arm-cgo), const TIOCEXT = 2147775584 +pkg syscall (netbsd-arm-cgo), const TIOCFLAG_CDTRCTS = 16 +pkg syscall (netbsd-arm-cgo), const TIOCFLAG_CLOCAL = 2 +pkg syscall (netbsd-arm-cgo), const TIOCFLAG_CRTSCTS = 4 +pkg syscall (netbsd-arm-cgo), const TIOCFLAG_MDMBUF = 8 +pkg syscall (netbsd-arm-cgo), const TIOCFLAG_SOFTCAR = 1 +pkg syscall (netbsd-arm-cgo), const TIOCFLUSH = 2147775504 +pkg syscall (netbsd-arm-cgo), const TIOCGETA = 1076655123 +pkg syscall (netbsd-arm-cgo), const TIOCGETD = 1074033690 +pkg syscall (netbsd-arm-cgo), const TIOCGFLAGS = 1074033757 +pkg syscall (netbsd-arm-cgo), const TIOCGLINED = 1075868738 +pkg syscall (netbsd-arm-cgo), const TIOCGPGRP = 1074033783 +pkg syscall (netbsd-arm-cgo), const TIOCGQSIZE = 1074033793 +pkg syscall (netbsd-arm-cgo), const TIOCGRANTPT = 536900679 +pkg syscall (netbsd-arm-cgo), const TIOCGSID = 1074033763 +pkg syscall (netbsd-arm-cgo), const TIOCGSIZE = 1074295912 +pkg syscall (netbsd-arm-cgo), const TIOCGWINSZ = 1074295912 +pkg syscall (netbsd-arm-cgo), const TIOCMBIC = 2147775595 +pkg syscall (netbsd-arm-cgo), const TIOCMBIS = 2147775596 +pkg syscall (netbsd-arm-cgo), const TIOCMGET = 1074033770 +pkg syscall (netbsd-arm-cgo), const TIOCMSET = 2147775597 +pkg syscall (netbsd-arm-cgo), const TIOCM_CAR = 64 +pkg syscall (netbsd-arm-cgo), const TIOCM_CD = 64 +pkg syscall (netbsd-arm-cgo), const TIOCM_CTS = 32 +pkg syscall (netbsd-arm-cgo), const TIOCM_DSR = 256 +pkg syscall (netbsd-arm-cgo), const TIOCM_DTR = 2 +pkg syscall (netbsd-arm-cgo), const TIOCM_LE = 1 +pkg syscall (netbsd-arm-cgo), const TIOCM_RI = 128 +pkg syscall (netbsd-arm-cgo), const TIOCM_RNG = 128 +pkg syscall (netbsd-arm-cgo), const TIOCM_RTS = 4 +pkg syscall (netbsd-arm-cgo), const TIOCM_SR = 16 +pkg syscall (netbsd-arm-cgo), const TIOCM_ST = 8 +pkg syscall (netbsd-arm-cgo), const TIOCNOTTY = 536900721 +pkg syscall (netbsd-arm-cgo), const TIOCNXCL = 536900622 +pkg syscall (netbsd-arm-cgo), const TIOCOUTQ = 1074033779 +pkg syscall (netbsd-arm-cgo), const TIOCPKT = 2147775600 +pkg syscall (netbsd-arm-cgo), const TIOCPKT_DATA = 0 +pkg syscall (netbsd-arm-cgo), const TIOCPKT_DOSTOP = 32 +pkg syscall (netbsd-arm-cgo), const TIOCPKT_FLUSHREAD = 1 +pkg syscall (netbsd-arm-cgo), const TIOCPKT_FLUSHWRITE = 2 +pkg syscall (netbsd-arm-cgo), const TIOCPKT_IOCTL = 64 +pkg syscall (netbsd-arm-cgo), const TIOCPKT_NOSTOP = 16 +pkg syscall (netbsd-arm-cgo), const TIOCPKT_START = 8 +pkg syscall (netbsd-arm-cgo), const TIOCPKT_STOP = 4 +pkg syscall (netbsd-arm-cgo), const TIOCPTMGET = 1208513606 +pkg syscall (netbsd-arm-cgo), const TIOCPTSNAME = 1208513608 +pkg syscall (netbsd-arm-cgo), const TIOCRCVFRAME = 2147775557 +pkg syscall (netbsd-arm-cgo), const TIOCREMOTE = 2147775593 +pkg syscall (netbsd-arm-cgo), const TIOCSBRK = 536900731 +pkg syscall (netbsd-arm-cgo), const TIOCSCTTY = 536900705 +pkg syscall (netbsd-arm-cgo), const TIOCSDTR = 536900729 +pkg syscall (netbsd-arm-cgo), const TIOCSETA = 2150396948 +pkg syscall (netbsd-arm-cgo), const TIOCSETAF = 2150396950 +pkg syscall (netbsd-arm-cgo), const TIOCSETAW = 2150396949 +pkg syscall (netbsd-arm-cgo), const TIOCSETD = 2147775515 +pkg syscall (netbsd-arm-cgo), const TIOCSFLAGS = 2147775580 +pkg syscall (netbsd-arm-cgo), const TIOCSIG = 536900703 +pkg syscall (netbsd-arm-cgo), const TIOCSLINED = 2149610563 +pkg syscall (netbsd-arm-cgo), const TIOCSPGRP = 2147775606 +pkg syscall (netbsd-arm-cgo), const TIOCSQSIZE = 2147775616 +pkg syscall (netbsd-arm-cgo), const TIOCSSIZE = 2148037735 +pkg syscall (netbsd-arm-cgo), const TIOCSTART = 536900718 +pkg syscall (netbsd-arm-cgo), const TIOCSTAT = 2147775589 +pkg syscall (netbsd-arm-cgo), const TIOCSTI = 2147578994 +pkg syscall (netbsd-arm-cgo), const TIOCSTOP = 536900719 +pkg syscall (netbsd-arm-cgo), const TIOCSWINSZ = 2148037735 +pkg syscall (netbsd-arm-cgo), const TIOCUCNTL = 2147775590 +pkg syscall (netbsd-arm-cgo), const TIOCXMTFRAME = 2147775556 +pkg syscall (netbsd-arm-cgo), const TOSTOP = 4194304 +pkg syscall (netbsd-arm-cgo), const VDISCARD = 15 +pkg syscall (netbsd-arm-cgo), const VDSUSP = 11 +pkg syscall (netbsd-arm-cgo), const VEOF = 0 +pkg syscall (netbsd-arm-cgo), const VEOL = 1 +pkg syscall (netbsd-arm-cgo), const VEOL2 = 2 +pkg syscall (netbsd-arm-cgo), const VERASE = 3 +pkg syscall (netbsd-arm-cgo), const VINTR = 8 +pkg syscall (netbsd-arm-cgo), const VKILL = 5 +pkg syscall (netbsd-arm-cgo), const VLNEXT = 14 +pkg syscall (netbsd-arm-cgo), const VMIN = 16 +pkg syscall (netbsd-arm-cgo), const VQUIT = 9 +pkg syscall (netbsd-arm-cgo), const VREPRINT = 6 +pkg syscall (netbsd-arm-cgo), const VSTART = 12 +pkg syscall (netbsd-arm-cgo), const VSTATUS = 18 +pkg syscall (netbsd-arm-cgo), const VSTOP = 13 +pkg syscall (netbsd-arm-cgo), const VSUSP = 10 +pkg syscall (netbsd-arm-cgo), const VTIME = 17 +pkg syscall (netbsd-arm-cgo), const VWERASE = 4 +pkg syscall (netbsd-arm-cgo), const WALL = 8 +pkg syscall (netbsd-arm-cgo), const WALLSIG = 8 +pkg syscall (netbsd-arm-cgo), const WALTSIG = 4 +pkg syscall (netbsd-arm-cgo), const WCLONE = 4 +pkg syscall (netbsd-arm-cgo), const WCOREFLAG = 128 +pkg syscall (netbsd-arm-cgo), const WNOHANG = 1 +pkg syscall (netbsd-arm-cgo), const WNOWAIT = 65536 +pkg syscall (netbsd-arm-cgo), const WNOZOMBIE = 131072 +pkg syscall (netbsd-arm-cgo), const WOPTSCHECKED = 262144 +pkg syscall (netbsd-arm-cgo), const WSTOPPED = 127 +pkg syscall (netbsd-arm-cgo), const WUNTRACED = 2 +pkg syscall (openbsd-386), const AF_APPLETALK = 16 +pkg syscall (openbsd-386), const AF_BLUETOOTH = 32 +pkg syscall (openbsd-386), const AF_CCITT = 10 +pkg syscall (openbsd-386), const AF_CHAOS = 5 +pkg syscall (openbsd-386), const AF_CNT = 21 +pkg syscall (openbsd-386), const AF_COIP = 20 +pkg syscall (openbsd-386), const AF_DATAKIT = 9 +pkg syscall (openbsd-386), const AF_DECnet = 12 +pkg syscall (openbsd-386), const AF_DLI = 13 +pkg syscall (openbsd-386), const AF_E164 = 26 +pkg syscall (openbsd-386), const AF_ECMA = 8 +pkg syscall (openbsd-386), const AF_ENCAP = 28 +pkg syscall (openbsd-386), const AF_HYLINK = 15 +pkg syscall (openbsd-386), const AF_IMPLINK = 3 +pkg syscall (openbsd-386), const AF_INET6 = 24 +pkg syscall (openbsd-386), const AF_IPX = 23 +pkg syscall (openbsd-386), const AF_ISDN = 26 +pkg syscall (openbsd-386), const AF_ISO = 7 +pkg syscall (openbsd-386), const AF_KEY = 30 +pkg syscall (openbsd-386), const AF_LAT = 14 +pkg syscall (openbsd-386), const AF_LINK = 18 +pkg syscall (openbsd-386), const AF_LOCAL = 1 +pkg syscall (openbsd-386), const AF_MAX = 36 +pkg syscall (openbsd-386), const AF_MPLS = 33 +pkg syscall (openbsd-386), const AF_NATM = 27 +pkg syscall (openbsd-386), const AF_NS = 6 +pkg syscall (openbsd-386), const AF_OSI = 7 +pkg syscall (openbsd-386), const AF_PUP = 4 +pkg syscall (openbsd-386), const AF_ROUTE = 17 +pkg syscall (openbsd-386), const AF_SIP = 29 +pkg syscall (openbsd-386), const AF_SNA = 11 +pkg syscall (openbsd-386), const ARPHRD_ETHER = 1 +pkg syscall (openbsd-386), const ARPHRD_FRELAY = 15 +pkg syscall (openbsd-386), const ARPHRD_IEEE1394 = 24 +pkg syscall (openbsd-386), const ARPHRD_IEEE802 = 6 +pkg syscall (openbsd-386), const B0 = 0 +pkg syscall (openbsd-386), const B110 = 110 +pkg syscall (openbsd-386), const B115200 = 115200 +pkg syscall (openbsd-386), const B1200 = 1200 +pkg syscall (openbsd-386), const B134 = 134 +pkg syscall (openbsd-386), const B14400 = 14400 +pkg syscall (openbsd-386), const B150 = 150 +pkg syscall (openbsd-386), const B1800 = 1800 +pkg syscall (openbsd-386), const B19200 = 19200 +pkg syscall (openbsd-386), const B200 = 200 +pkg syscall (openbsd-386), const B230400 = 230400 +pkg syscall (openbsd-386), const B2400 = 2400 +pkg syscall (openbsd-386), const B28800 = 28800 +pkg syscall (openbsd-386), const B300 = 300 +pkg syscall (openbsd-386), const B38400 = 38400 +pkg syscall (openbsd-386), const B4800 = 4800 +pkg syscall (openbsd-386), const B50 = 50 +pkg syscall (openbsd-386), const B57600 = 57600 +pkg syscall (openbsd-386), const B600 = 600 +pkg syscall (openbsd-386), const B7200 = 7200 +pkg syscall (openbsd-386), const B75 = 75 +pkg syscall (openbsd-386), const B76800 = 76800 +pkg syscall (openbsd-386), const B9600 = 9600 +pkg syscall (openbsd-386), const BIOCFLUSH = 536887912 +pkg syscall (openbsd-386), const BIOCGBLEN = 1074020966 +pkg syscall (openbsd-386), const BIOCGDIRFILT = 1074020988 +pkg syscall (openbsd-386), const BIOCGDLT = 1074020970 +pkg syscall (openbsd-386), const BIOCGDLTLIST = 3221766779 +pkg syscall (openbsd-386), const BIOCGETIF = 1075855979 +pkg syscall (openbsd-386), const BIOCGFILDROP = 1074020984 +pkg syscall (openbsd-386), const BIOCGHDRCMPLT = 1074020980 +pkg syscall (openbsd-386), const BIOCGRSIG = 1074020979 +pkg syscall (openbsd-386), const BIOCGRTIMEOUT = 1074283118 +pkg syscall (openbsd-386), const BIOCGSTATS = 1074283119 +pkg syscall (openbsd-386), const BIOCIMMEDIATE = 2147762800 +pkg syscall (openbsd-386), const BIOCLOCK = 536887926 +pkg syscall (openbsd-386), const BIOCPROMISC = 536887913 +pkg syscall (openbsd-386), const BIOCSBLEN = 3221504614 +pkg syscall (openbsd-386), const BIOCSDIRFILT = 2147762813 +pkg syscall (openbsd-386), const BIOCSDLT = 2147762810 +pkg syscall (openbsd-386), const BIOCSETF = 2148024935 +pkg syscall (openbsd-386), const BIOCSETIF = 2149597804 +pkg syscall (openbsd-386), const BIOCSETWF = 2148024951 +pkg syscall (openbsd-386), const BIOCSFILDROP = 2147762809 +pkg syscall (openbsd-386), const BIOCSHDRCMPLT = 2147762805 +pkg syscall (openbsd-386), const BIOCSRSIG = 2147762802 +pkg syscall (openbsd-386), const BIOCSRTIMEOUT = 2148024941 +pkg syscall (openbsd-386), const BIOCVERSION = 1074020977 +pkg syscall (openbsd-386), const BPF_A = 16 +pkg syscall (openbsd-386), const BPF_ABS = 32 +pkg syscall (openbsd-386), const BPF_ADD = 0 +pkg syscall (openbsd-386), const BPF_ALIGNMENT = 4 +pkg syscall (openbsd-386), const BPF_ALU = 4 +pkg syscall (openbsd-386), const BPF_AND = 80 +pkg syscall (openbsd-386), const BPF_B = 16 +pkg syscall (openbsd-386), const BPF_DIRECTION_IN = 1 +pkg syscall (openbsd-386), const BPF_DIRECTION_OUT = 2 +pkg syscall (openbsd-386), const BPF_DIV = 48 +pkg syscall (openbsd-386), const BPF_H = 8 +pkg syscall (openbsd-386), const BPF_IMM = 0 +pkg syscall (openbsd-386), const BPF_IND = 64 +pkg syscall (openbsd-386), const BPF_JA = 0 +pkg syscall (openbsd-386), const BPF_JEQ = 16 +pkg syscall (openbsd-386), const BPF_JGE = 48 +pkg syscall (openbsd-386), const BPF_JGT = 32 +pkg syscall (openbsd-386), const BPF_JMP = 5 +pkg syscall (openbsd-386), const BPF_JSET = 64 +pkg syscall (openbsd-386), const BPF_K = 0 +pkg syscall (openbsd-386), const BPF_LD = 0 +pkg syscall (openbsd-386), const BPF_LDX = 1 +pkg syscall (openbsd-386), const BPF_LEN = 128 +pkg syscall (openbsd-386), const BPF_LSH = 96 +pkg syscall (openbsd-386), const BPF_MAJOR_VERSION = 1 +pkg syscall (openbsd-386), const BPF_MAXBUFSIZE = 2097152 +pkg syscall (openbsd-386), const BPF_MAXINSNS = 512 +pkg syscall (openbsd-386), const BPF_MEM = 96 +pkg syscall (openbsd-386), const BPF_MEMWORDS = 16 +pkg syscall (openbsd-386), const BPF_MINBUFSIZE = 32 +pkg syscall (openbsd-386), const BPF_MINOR_VERSION = 1 +pkg syscall (openbsd-386), const BPF_MISC = 7 +pkg syscall (openbsd-386), const BPF_MSH = 160 +pkg syscall (openbsd-386), const BPF_MUL = 32 +pkg syscall (openbsd-386), const BPF_NEG = 128 +pkg syscall (openbsd-386), const BPF_OR = 64 +pkg syscall (openbsd-386), const BPF_RELEASE = 199606 +pkg syscall (openbsd-386), const BPF_RET = 6 +pkg syscall (openbsd-386), const BPF_RSH = 112 +pkg syscall (openbsd-386), const BPF_ST = 2 +pkg syscall (openbsd-386), const BPF_STX = 3 +pkg syscall (openbsd-386), const BPF_SUB = 16 +pkg syscall (openbsd-386), const BPF_TAX = 0 +pkg syscall (openbsd-386), const BPF_TXA = 128 +pkg syscall (openbsd-386), const BPF_W = 0 +pkg syscall (openbsd-386), const BPF_X = 8 +pkg syscall (openbsd-386), const BRKINT = 2 +pkg syscall (openbsd-386), const CFLUSH = 15 +pkg syscall (openbsd-386), const CLOCAL = 32768 +pkg syscall (openbsd-386), const CREAD = 2048 +pkg syscall (openbsd-386), const CS5 = 0 +pkg syscall (openbsd-386), const CS6 = 256 +pkg syscall (openbsd-386), const CS7 = 512 +pkg syscall (openbsd-386), const CS8 = 768 +pkg syscall (openbsd-386), const CSIZE = 768 +pkg syscall (openbsd-386), const CSTART = 17 +pkg syscall (openbsd-386), const CSTATUS = 255 +pkg syscall (openbsd-386), const CSTOP = 19 +pkg syscall (openbsd-386), const CSTOPB = 1024 +pkg syscall (openbsd-386), const CSUSP = 26 +pkg syscall (openbsd-386), const CTL_MAXNAME = 12 +pkg syscall (openbsd-386), const CTL_NET = 4 +pkg syscall (openbsd-386), const DIOCOSFPFLUSH = 536888398 +pkg syscall (openbsd-386), const DLT_ARCNET = 7 +pkg syscall (openbsd-386), const DLT_ATM_RFC1483 = 11 +pkg syscall (openbsd-386), const DLT_AX25 = 3 +pkg syscall (openbsd-386), const DLT_CHAOS = 5 +pkg syscall (openbsd-386), const DLT_C_HDLC = 104 +pkg syscall (openbsd-386), const DLT_EN10MB = 1 +pkg syscall (openbsd-386), const DLT_EN3MB = 2 +pkg syscall (openbsd-386), const DLT_ENC = 13 +pkg syscall (openbsd-386), const DLT_FDDI = 10 +pkg syscall (openbsd-386), const DLT_IEEE802 = 6 +pkg syscall (openbsd-386), const DLT_IEEE802_11 = 105 +pkg syscall (openbsd-386), const DLT_IEEE802_11_RADIO = 127 +pkg syscall (openbsd-386), const DLT_LOOP = 12 +pkg syscall (openbsd-386), const DLT_MPLS = 219 +pkg syscall (openbsd-386), const DLT_NULL = 0 +pkg syscall (openbsd-386), const DLT_PFLOG = 117 +pkg syscall (openbsd-386), const DLT_PFSYNC = 18 +pkg syscall (openbsd-386), const DLT_PPP = 9 +pkg syscall (openbsd-386), const DLT_PPP_BSDOS = 16 +pkg syscall (openbsd-386), const DLT_PPP_ETHER = 51 +pkg syscall (openbsd-386), const DLT_PPP_SERIAL = 50 +pkg syscall (openbsd-386), const DLT_PRONET = 4 +pkg syscall (openbsd-386), const DLT_RAW = 14 +pkg syscall (openbsd-386), const DLT_SLIP = 8 +pkg syscall (openbsd-386), const DLT_SLIP_BSDOS = 15 +pkg syscall (openbsd-386), const DT_BLK = 6 +pkg syscall (openbsd-386), const DT_CHR = 2 +pkg syscall (openbsd-386), const DT_DIR = 4 +pkg syscall (openbsd-386), const DT_FIFO = 1 +pkg syscall (openbsd-386), const DT_LNK = 10 +pkg syscall (openbsd-386), const DT_REG = 8 +pkg syscall (openbsd-386), const DT_SOCK = 12 +pkg syscall (openbsd-386), const DT_UNKNOWN = 0 +pkg syscall (openbsd-386), const E2BIG = 7 +pkg syscall (openbsd-386), const EACCES = 13 +pkg syscall (openbsd-386), const EADDRINUSE = 48 +pkg syscall (openbsd-386), const EADDRNOTAVAIL = 49 +pkg syscall (openbsd-386), const EAFNOSUPPORT = 47 +pkg syscall (openbsd-386), const EAGAIN = 35 +pkg syscall (openbsd-386), const EALREADY = 37 +pkg syscall (openbsd-386), const EAUTH = 80 +pkg syscall (openbsd-386), const EBADF = 9 +pkg syscall (openbsd-386), const EBADRPC = 72 +pkg syscall (openbsd-386), const EBUSY = 16 +pkg syscall (openbsd-386), const ECANCELED = 88 +pkg syscall (openbsd-386), const ECHILD = 10 +pkg syscall (openbsd-386), const ECHO = 8 +pkg syscall (openbsd-386), const ECHOCTL = 64 +pkg syscall (openbsd-386), const ECHOE = 2 +pkg syscall (openbsd-386), const ECHOK = 4 +pkg syscall (openbsd-386), const ECHOKE = 1 +pkg syscall (openbsd-386), const ECHONL = 16 +pkg syscall (openbsd-386), const ECHOPRT = 32 +pkg syscall (openbsd-386), const ECONNABORTED = 53 +pkg syscall (openbsd-386), const ECONNREFUSED = 61 +pkg syscall (openbsd-386), const ECONNRESET = 54 +pkg syscall (openbsd-386), const EDEADLK = 11 +pkg syscall (openbsd-386), const EDESTADDRREQ = 39 +pkg syscall (openbsd-386), const EDOM = 33 +pkg syscall (openbsd-386), const EDQUOT = 69 +pkg syscall (openbsd-386), const EEXIST = 17 +pkg syscall (openbsd-386), const EFAULT = 14 +pkg syscall (openbsd-386), const EFBIG = 27 +pkg syscall (openbsd-386), const EFTYPE = 79 +pkg syscall (openbsd-386), const EHOSTDOWN = 64 +pkg syscall (openbsd-386), const EHOSTUNREACH = 65 +pkg syscall (openbsd-386), const EIDRM = 89 +pkg syscall (openbsd-386), const EILSEQ = 84 +pkg syscall (openbsd-386), const EINPROGRESS = 36 +pkg syscall (openbsd-386), const EINTR = 4 +pkg syscall (openbsd-386), const EINVAL = 22 +pkg syscall (openbsd-386), const EIO = 5 +pkg syscall (openbsd-386), const EIPSEC = 82 +pkg syscall (openbsd-386), const EISCONN = 56 +pkg syscall (openbsd-386), const EISDIR = 21 +pkg syscall (openbsd-386), const ELAST = 91 +pkg syscall (openbsd-386), const ELOOP = 62 +pkg syscall (openbsd-386), const EMEDIUMTYPE = 86 +pkg syscall (openbsd-386), const EMFILE = 24 +pkg syscall (openbsd-386), const EMLINK = 31 +pkg syscall (openbsd-386), const EMSGSIZE = 40 +pkg syscall (openbsd-386), const EMT_TAGOVF = 1 +pkg syscall (openbsd-386), const EMUL_ENABLED = 1 +pkg syscall (openbsd-386), const EMUL_NATIVE = 2 +pkg syscall (openbsd-386), const ENAMETOOLONG = 63 +pkg syscall (openbsd-386), const ENDRUNDISC = 9 +pkg syscall (openbsd-386), const ENEEDAUTH = 81 +pkg syscall (openbsd-386), const ENETDOWN = 50 +pkg syscall (openbsd-386), const ENETRESET = 52 +pkg syscall (openbsd-386), const ENETUNREACH = 51 +pkg syscall (openbsd-386), const ENFILE = 23 +pkg syscall (openbsd-386), const ENOATTR = 83 +pkg syscall (openbsd-386), const ENOBUFS = 55 +pkg syscall (openbsd-386), const ENODEV = 19 +pkg syscall (openbsd-386), const ENOEXEC = 8 +pkg syscall (openbsd-386), const ENOLCK = 77 +pkg syscall (openbsd-386), const ENOMEDIUM = 85 +pkg syscall (openbsd-386), const ENOMEM = 12 +pkg syscall (openbsd-386), const ENOMSG = 90 +pkg syscall (openbsd-386), const ENOPROTOOPT = 42 +pkg syscall (openbsd-386), const ENOSPC = 28 +pkg syscall (openbsd-386), const ENOSYS = 78 +pkg syscall (openbsd-386), const ENOTBLK = 15 +pkg syscall (openbsd-386), const ENOTCONN = 57 +pkg syscall (openbsd-386), const ENOTDIR = 20 +pkg syscall (openbsd-386), const ENOTEMPTY = 66 +pkg syscall (openbsd-386), const ENOTSOCK = 38 +pkg syscall (openbsd-386), const ENOTSUP = 91 +pkg syscall (openbsd-386), const ENOTTY = 25 +pkg syscall (openbsd-386), const ENXIO = 6 +pkg syscall (openbsd-386), const EOPNOTSUPP = 45 +pkg syscall (openbsd-386), const EOVERFLOW = 87 +pkg syscall (openbsd-386), const EPERM = 1 +pkg syscall (openbsd-386), const EPFNOSUPPORT = 46 +pkg syscall (openbsd-386), const EPIPE = 32 +pkg syscall (openbsd-386), const EPROCLIM = 67 +pkg syscall (openbsd-386), const EPROCUNAVAIL = 76 +pkg syscall (openbsd-386), const EPROGMISMATCH = 75 +pkg syscall (openbsd-386), const EPROGUNAVAIL = 74 +pkg syscall (openbsd-386), const EPROTONOSUPPORT = 43 +pkg syscall (openbsd-386), const EPROTOTYPE = 41 +pkg syscall (openbsd-386), const ERANGE = 34 +pkg syscall (openbsd-386), const EREMOTE = 71 +pkg syscall (openbsd-386), const EROFS = 30 +pkg syscall (openbsd-386), const ERPCMISMATCH = 73 +pkg syscall (openbsd-386), const ESHUTDOWN = 58 +pkg syscall (openbsd-386), const ESOCKTNOSUPPORT = 44 +pkg syscall (openbsd-386), const ESPIPE = 29 +pkg syscall (openbsd-386), const ESRCH = 3 +pkg syscall (openbsd-386), const ESTALE = 70 +pkg syscall (openbsd-386), const ETHERMIN = 46 +pkg syscall (openbsd-386), const ETHERMTU = 1500 +pkg syscall (openbsd-386), const ETHERTYPE_8023 = 4 +pkg syscall (openbsd-386), const ETHERTYPE_AARP = 33011 +pkg syscall (openbsd-386), const ETHERTYPE_ACCTON = 33680 +pkg syscall (openbsd-386), const ETHERTYPE_AEONIC = 32822 +pkg syscall (openbsd-386), const ETHERTYPE_ALPHA = 33098 +pkg syscall (openbsd-386), const ETHERTYPE_AMBER = 24584 +pkg syscall (openbsd-386), const ETHERTYPE_AMOEBA = 33093 +pkg syscall (openbsd-386), const ETHERTYPE_AOE = 34978 +pkg syscall (openbsd-386), const ETHERTYPE_APOLLO = 33015 +pkg syscall (openbsd-386), const ETHERTYPE_APOLLODOMAIN = 32793 +pkg syscall (openbsd-386), const ETHERTYPE_APPLETALK = 32923 +pkg syscall (openbsd-386), const ETHERTYPE_APPLITEK = 32967 +pkg syscall (openbsd-386), const ETHERTYPE_ARGONAUT = 32826 +pkg syscall (openbsd-386), const ETHERTYPE_ARP = 2054 +pkg syscall (openbsd-386), const ETHERTYPE_AT = 32923 +pkg syscall (openbsd-386), const ETHERTYPE_ATALK = 32923 +pkg syscall (openbsd-386), const ETHERTYPE_ATOMIC = 34527 +pkg syscall (openbsd-386), const ETHERTYPE_ATT = 32873 +pkg syscall (openbsd-386), const ETHERTYPE_ATTSTANFORD = 32776 +pkg syscall (openbsd-386), const ETHERTYPE_AUTOPHON = 32874 +pkg syscall (openbsd-386), const ETHERTYPE_AXIS = 34902 +pkg syscall (openbsd-386), const ETHERTYPE_BCLOOP = 36867 +pkg syscall (openbsd-386), const ETHERTYPE_BOFL = 33026 +pkg syscall (openbsd-386), const ETHERTYPE_CABLETRON = 28724 +pkg syscall (openbsd-386), const ETHERTYPE_CHAOS = 2052 +pkg syscall (openbsd-386), const ETHERTYPE_COMDESIGN = 32876 +pkg syscall (openbsd-386), const ETHERTYPE_COMPUGRAPHIC = 32877 +pkg syscall (openbsd-386), const ETHERTYPE_COUNTERPOINT = 32866 +pkg syscall (openbsd-386), const ETHERTYPE_CRONUS = 32772 +pkg syscall (openbsd-386), const ETHERTYPE_CRONUSVLN = 32771 +pkg syscall (openbsd-386), const ETHERTYPE_DCA = 4660 +pkg syscall (openbsd-386), const ETHERTYPE_DDE = 32891 +pkg syscall (openbsd-386), const ETHERTYPE_DEBNI = 43690 +pkg syscall (openbsd-386), const ETHERTYPE_DECAM = 32840 +pkg syscall (openbsd-386), const ETHERTYPE_DECCUST = 24582 +pkg syscall (openbsd-386), const ETHERTYPE_DECDIAG = 24581 +pkg syscall (openbsd-386), const ETHERTYPE_DECDNS = 32828 +pkg syscall (openbsd-386), const ETHERTYPE_DECDTS = 32830 +pkg syscall (openbsd-386), const ETHERTYPE_DECEXPER = 24576 +pkg syscall (openbsd-386), const ETHERTYPE_DECLAST = 32833 +pkg syscall (openbsd-386), const ETHERTYPE_DECLTM = 32831 +pkg syscall (openbsd-386), const ETHERTYPE_DECMUMPS = 24585 +pkg syscall (openbsd-386), const ETHERTYPE_DECNETBIOS = 32832 +pkg syscall (openbsd-386), const ETHERTYPE_DELTACON = 34526 +pkg syscall (openbsd-386), const ETHERTYPE_DIDDLE = 17185 +pkg syscall (openbsd-386), const ETHERTYPE_DLOG1 = 1632 +pkg syscall (openbsd-386), const ETHERTYPE_DLOG2 = 1633 +pkg syscall (openbsd-386), const ETHERTYPE_DN = 24579 +pkg syscall (openbsd-386), const ETHERTYPE_DOGFIGHT = 6537 +pkg syscall (openbsd-386), const ETHERTYPE_DSMD = 32825 +pkg syscall (openbsd-386), const ETHERTYPE_ECMA = 2051 +pkg syscall (openbsd-386), const ETHERTYPE_ENCRYPT = 32829 +pkg syscall (openbsd-386), const ETHERTYPE_ES = 32861 +pkg syscall (openbsd-386), const ETHERTYPE_EXCELAN = 32784 +pkg syscall (openbsd-386), const ETHERTYPE_EXPERDATA = 32841 +pkg syscall (openbsd-386), const ETHERTYPE_FLIP = 33094 +pkg syscall (openbsd-386), const ETHERTYPE_FLOWCONTROL = 34824 +pkg syscall (openbsd-386), const ETHERTYPE_FRARP = 2056 +pkg syscall (openbsd-386), const ETHERTYPE_GENDYN = 32872 +pkg syscall (openbsd-386), const ETHERTYPE_HAYES = 33072 +pkg syscall (openbsd-386), const ETHERTYPE_HIPPI_FP = 33152 +pkg syscall (openbsd-386), const ETHERTYPE_HITACHI = 34848 +pkg syscall (openbsd-386), const ETHERTYPE_HP = 32773 +pkg syscall (openbsd-386), const ETHERTYPE_IEEEPUP = 2560 +pkg syscall (openbsd-386), const ETHERTYPE_IEEEPUPAT = 2561 +pkg syscall (openbsd-386), const ETHERTYPE_IMLBL = 19522 +pkg syscall (openbsd-386), const ETHERTYPE_IMLBLDIAG = 16972 +pkg syscall (openbsd-386), const ETHERTYPE_IP = 2048 +pkg syscall (openbsd-386), const ETHERTYPE_IPAS = 34668 +pkg syscall (openbsd-386), const ETHERTYPE_IPV6 = 34525 +pkg syscall (openbsd-386), const ETHERTYPE_IPX = 33079 +pkg syscall (openbsd-386), const ETHERTYPE_IPXNEW = 32823 +pkg syscall (openbsd-386), const ETHERTYPE_KALPANA = 34178 +pkg syscall (openbsd-386), const ETHERTYPE_LANBRIDGE = 32824 +pkg syscall (openbsd-386), const ETHERTYPE_LANPROBE = 34952 +pkg syscall (openbsd-386), const ETHERTYPE_LAT = 24580 +pkg syscall (openbsd-386), const ETHERTYPE_LBACK = 36864 +pkg syscall (openbsd-386), const ETHERTYPE_LITTLE = 32864 +pkg syscall (openbsd-386), const ETHERTYPE_LLDP = 35020 +pkg syscall (openbsd-386), const ETHERTYPE_LOGICRAFT = 33096 +pkg syscall (openbsd-386), const ETHERTYPE_LOOPBACK = 36864 +pkg syscall (openbsd-386), const ETHERTYPE_MATRA = 32890 +pkg syscall (openbsd-386), const ETHERTYPE_MAX = 65535 +pkg syscall (openbsd-386), const ETHERTYPE_MERIT = 32892 +pkg syscall (openbsd-386), const ETHERTYPE_MICP = 34618 +pkg syscall (openbsd-386), const ETHERTYPE_MOPDL = 24577 +pkg syscall (openbsd-386), const ETHERTYPE_MOPRC = 24578 +pkg syscall (openbsd-386), const ETHERTYPE_MOTOROLA = 33165 +pkg syscall (openbsd-386), const ETHERTYPE_MPLS = 34887 +pkg syscall (openbsd-386), const ETHERTYPE_MPLS_MCAST = 34888 +pkg syscall (openbsd-386), const ETHERTYPE_MUMPS = 33087 +pkg syscall (openbsd-386), const ETHERTYPE_NBPCC = 15364 +pkg syscall (openbsd-386), const ETHERTYPE_NBPCLAIM = 15369 +pkg syscall (openbsd-386), const ETHERTYPE_NBPCLREQ = 15365 +pkg syscall (openbsd-386), const ETHERTYPE_NBPCLRSP = 15366 +pkg syscall (openbsd-386), const ETHERTYPE_NBPCREQ = 15362 +pkg syscall (openbsd-386), const ETHERTYPE_NBPCRSP = 15363 +pkg syscall (openbsd-386), const ETHERTYPE_NBPDG = 15367 +pkg syscall (openbsd-386), const ETHERTYPE_NBPDGB = 15368 +pkg syscall (openbsd-386), const ETHERTYPE_NBPDLTE = 15370 +pkg syscall (openbsd-386), const ETHERTYPE_NBPRAR = 15372 +pkg syscall (openbsd-386), const ETHERTYPE_NBPRAS = 15371 +pkg syscall (openbsd-386), const ETHERTYPE_NBPRST = 15373 +pkg syscall (openbsd-386), const ETHERTYPE_NBPSCD = 15361 +pkg syscall (openbsd-386), const ETHERTYPE_NBPVCD = 15360 +pkg syscall (openbsd-386), const ETHERTYPE_NBS = 2050 +pkg syscall (openbsd-386), const ETHERTYPE_NCD = 33097 +pkg syscall (openbsd-386), const ETHERTYPE_NESTAR = 32774 +pkg syscall (openbsd-386), const ETHERTYPE_NETBEUI = 33169 +pkg syscall (openbsd-386), const ETHERTYPE_NOVELL = 33080 +pkg syscall (openbsd-386), const ETHERTYPE_NS = 1536 +pkg syscall (openbsd-386), const ETHERTYPE_NSAT = 1537 +pkg syscall (openbsd-386), const ETHERTYPE_NSCOMPAT = 2055 +pkg syscall (openbsd-386), const ETHERTYPE_NTRAILER = 16 +pkg syscall (openbsd-386), const ETHERTYPE_OS9 = 28679 +pkg syscall (openbsd-386), const ETHERTYPE_OS9NET = 28681 +pkg syscall (openbsd-386), const ETHERTYPE_PACER = 32966 +pkg syscall (openbsd-386), const ETHERTYPE_PAE = 34958 +pkg syscall (openbsd-386), const ETHERTYPE_PCS = 16962 +pkg syscall (openbsd-386), const ETHERTYPE_PLANNING = 32836 +pkg syscall (openbsd-386), const ETHERTYPE_PPP = 34827 +pkg syscall (openbsd-386), const ETHERTYPE_PPPOE = 34916 +pkg syscall (openbsd-386), const ETHERTYPE_PPPOEDISC = 34915 +pkg syscall (openbsd-386), const ETHERTYPE_PRIMENTS = 28721 +pkg syscall (openbsd-386), const ETHERTYPE_PUP = 512 +pkg syscall (openbsd-386), const ETHERTYPE_PUPAT = 512 +pkg syscall (openbsd-386), const ETHERTYPE_QINQ = 34984 +pkg syscall (openbsd-386), const ETHERTYPE_RACAL = 28720 +pkg syscall (openbsd-386), const ETHERTYPE_RATIONAL = 33104 +pkg syscall (openbsd-386), const ETHERTYPE_RAWFR = 25945 +pkg syscall (openbsd-386), const ETHERTYPE_RCL = 6549 +pkg syscall (openbsd-386), const ETHERTYPE_RDP = 34617 +pkg syscall (openbsd-386), const ETHERTYPE_RETIX = 33010 +pkg syscall (openbsd-386), const ETHERTYPE_REVARP = 32821 +pkg syscall (openbsd-386), const ETHERTYPE_SCA = 24583 +pkg syscall (openbsd-386), const ETHERTYPE_SECTRA = 34523 +pkg syscall (openbsd-386), const ETHERTYPE_SECUREDATA = 34669 +pkg syscall (openbsd-386), const ETHERTYPE_SGITW = 33150 +pkg syscall (openbsd-386), const ETHERTYPE_SG_BOUNCE = 32790 +pkg syscall (openbsd-386), const ETHERTYPE_SG_DIAG = 32787 +pkg syscall (openbsd-386), const ETHERTYPE_SG_NETGAMES = 32788 +pkg syscall (openbsd-386), const ETHERTYPE_SG_RESV = 32789 +pkg syscall (openbsd-386), const ETHERTYPE_SIMNET = 21000 +pkg syscall (openbsd-386), const ETHERTYPE_SLOW = 34825 +pkg syscall (openbsd-386), const ETHERTYPE_SNA = 32981 +pkg syscall (openbsd-386), const ETHERTYPE_SNMP = 33100 +pkg syscall (openbsd-386), const ETHERTYPE_SONIX = 64245 +pkg syscall (openbsd-386), const ETHERTYPE_SPIDER = 32927 +pkg syscall (openbsd-386), const ETHERTYPE_SPRITE = 1280 +pkg syscall (openbsd-386), const ETHERTYPE_STP = 33153 +pkg syscall (openbsd-386), const ETHERTYPE_TALARIS = 33067 +pkg syscall (openbsd-386), const ETHERTYPE_TALARISMC = 34091 +pkg syscall (openbsd-386), const ETHERTYPE_TCPCOMP = 34667 +pkg syscall (openbsd-386), const ETHERTYPE_TCPSM = 36866 +pkg syscall (openbsd-386), const ETHERTYPE_TEC = 33103 +pkg syscall (openbsd-386), const ETHERTYPE_TIGAN = 32815 +pkg syscall (openbsd-386), const ETHERTYPE_TRAIL = 4096 +pkg syscall (openbsd-386), const ETHERTYPE_TRANSETHER = 25944 +pkg syscall (openbsd-386), const ETHERTYPE_TYMSHARE = 32814 +pkg syscall (openbsd-386), const ETHERTYPE_UBBST = 28677 +pkg syscall (openbsd-386), const ETHERTYPE_UBDEBUG = 2304 +pkg syscall (openbsd-386), const ETHERTYPE_UBDIAGLOOP = 28674 +pkg syscall (openbsd-386), const ETHERTYPE_UBDL = 28672 +pkg syscall (openbsd-386), const ETHERTYPE_UBNIU = 28673 +pkg syscall (openbsd-386), const ETHERTYPE_UBNMC = 28675 +pkg syscall (openbsd-386), const ETHERTYPE_VALID = 5632 +pkg syscall (openbsd-386), const ETHERTYPE_VARIAN = 32989 +pkg syscall (openbsd-386), const ETHERTYPE_VAXELN = 32827 +pkg syscall (openbsd-386), const ETHERTYPE_VEECO = 32871 +pkg syscall (openbsd-386), const ETHERTYPE_VEXP = 32859 +pkg syscall (openbsd-386), const ETHERTYPE_VGLAB = 33073 +pkg syscall (openbsd-386), const ETHERTYPE_VINES = 2989 +pkg syscall (openbsd-386), const ETHERTYPE_VINESECHO = 2991 +pkg syscall (openbsd-386), const ETHERTYPE_VINESLOOP = 2990 +pkg syscall (openbsd-386), const ETHERTYPE_VITAL = 65280 +pkg syscall (openbsd-386), const ETHERTYPE_VLAN = 33024 +pkg syscall (openbsd-386), const ETHERTYPE_VLTLMAN = 32896 +pkg syscall (openbsd-386), const ETHERTYPE_VPROD = 32860 +pkg syscall (openbsd-386), const ETHERTYPE_VURESERVED = 33095 +pkg syscall (openbsd-386), const ETHERTYPE_WATERLOO = 33072 +pkg syscall (openbsd-386), const ETHERTYPE_WELLFLEET = 33027 +pkg syscall (openbsd-386), const ETHERTYPE_X25 = 2053 +pkg syscall (openbsd-386), const ETHERTYPE_X75 = 2049 +pkg syscall (openbsd-386), const ETHERTYPE_XNSSM = 36865 +pkg syscall (openbsd-386), const ETHERTYPE_XTP = 33149 +pkg syscall (openbsd-386), const ETHER_ADDR_LEN = 6 +pkg syscall (openbsd-386), const ETHER_ALIGN = 2 +pkg syscall (openbsd-386), const ETHER_CRC_LEN = 4 +pkg syscall (openbsd-386), const ETHER_CRC_POLY_BE = 79764918 +pkg syscall (openbsd-386), const ETHER_CRC_POLY_LE = 3988292384 +pkg syscall (openbsd-386), const ETHER_HDR_LEN = 14 +pkg syscall (openbsd-386), const ETHER_MAX_DIX_LEN = 1536 +pkg syscall (openbsd-386), const ETHER_MAX_LEN = 1518 +pkg syscall (openbsd-386), const ETHER_MIN_LEN = 64 +pkg syscall (openbsd-386), const ETHER_TYPE_LEN = 2 +pkg syscall (openbsd-386), const ETHER_VLAN_ENCAP_LEN = 4 +pkg syscall (openbsd-386), const ETIMEDOUT = 60 +pkg syscall (openbsd-386), const ETOOMANYREFS = 59 +pkg syscall (openbsd-386), const ETXTBSY = 26 +pkg syscall (openbsd-386), const EUSERS = 68 +pkg syscall (openbsd-386), const EVFILT_AIO = -3 +pkg syscall (openbsd-386), const EVFILT_PROC = -5 +pkg syscall (openbsd-386), const EVFILT_READ = -1 +pkg syscall (openbsd-386), const EVFILT_SIGNAL = -6 +pkg syscall (openbsd-386), const EVFILT_SYSCOUNT = 7 +pkg syscall (openbsd-386), const EVFILT_TIMER = -7 +pkg syscall (openbsd-386), const EVFILT_VNODE = -4 +pkg syscall (openbsd-386), const EVFILT_WRITE = -2 +pkg syscall (openbsd-386), const EV_ADD = 1 +pkg syscall (openbsd-386), const EV_CLEAR = 32 +pkg syscall (openbsd-386), const EV_DELETE = 2 +pkg syscall (openbsd-386), const EV_DISABLE = 8 +pkg syscall (openbsd-386), const EV_ENABLE = 4 +pkg syscall (openbsd-386), const EV_EOF = 32768 +pkg syscall (openbsd-386), const EV_ERROR = 16384 +pkg syscall (openbsd-386), const EV_FLAG1 = 8192 +pkg syscall (openbsd-386), const EV_ONESHOT = 16 +pkg syscall (openbsd-386), const EV_SYSFLAGS = 61440 +pkg syscall (openbsd-386), const EWOULDBLOCK = 35 +pkg syscall (openbsd-386), const EXDEV = 18 +pkg syscall (openbsd-386), const EXTA = 19200 +pkg syscall (openbsd-386), const EXTB = 38400 +pkg syscall (openbsd-386), const EXTPROC = 2048 +pkg syscall (openbsd-386), const FD_CLOEXEC = 1 +pkg syscall (openbsd-386), const FD_SETSIZE = 1024 +pkg syscall (openbsd-386), const FLUSHO = 8388608 +pkg syscall (openbsd-386), const F_DUPFD = 0 +pkg syscall (openbsd-386), const F_DUPFD_CLOEXEC = 10 +pkg syscall (openbsd-386), const F_GETFD = 1 +pkg syscall (openbsd-386), const F_GETFL = 3 +pkg syscall (openbsd-386), const F_GETLK = 7 +pkg syscall (openbsd-386), const F_GETOWN = 5 +pkg syscall (openbsd-386), const F_OK = 0 +pkg syscall (openbsd-386), const F_RDLCK = 1 +pkg syscall (openbsd-386), const F_SETFD = 2 +pkg syscall (openbsd-386), const F_SETFL = 4 +pkg syscall (openbsd-386), const F_SETLK = 8 +pkg syscall (openbsd-386), const F_SETLKW = 9 +pkg syscall (openbsd-386), const F_SETOWN = 6 +pkg syscall (openbsd-386), const F_UNLCK = 2 +pkg syscall (openbsd-386), const F_WRLCK = 3 +pkg syscall (openbsd-386), const HUPCL = 16384 +pkg syscall (openbsd-386), const ICANON = 256 +pkg syscall (openbsd-386), const ICRNL = 256 +pkg syscall (openbsd-386), const IEXTEN = 1024 +pkg syscall (openbsd-386), const IFAN_ARRIVAL = 0 +pkg syscall (openbsd-386), const IFAN_DEPARTURE = 1 +pkg syscall (openbsd-386), const IFA_ROUTE = 1 +pkg syscall (openbsd-386), const IFF_ALLMULTI = 512 +pkg syscall (openbsd-386), const IFF_CANTCHANGE = 36434 +pkg syscall (openbsd-386), const IFF_DEBUG = 4 +pkg syscall (openbsd-386), const IFF_LINK0 = 4096 +pkg syscall (openbsd-386), const IFF_LINK1 = 8192 +pkg syscall (openbsd-386), const IFF_LINK2 = 16384 +pkg syscall (openbsd-386), const IFF_LOOPBACK = 8 +pkg syscall (openbsd-386), const IFF_MULTICAST = 32768 +pkg syscall (openbsd-386), const IFF_NOARP = 128 +pkg syscall (openbsd-386), const IFF_NOTRAILERS = 32 +pkg syscall (openbsd-386), const IFF_OACTIVE = 1024 +pkg syscall (openbsd-386), const IFF_POINTOPOINT = 16 +pkg syscall (openbsd-386), const IFF_PROMISC = 256 +pkg syscall (openbsd-386), const IFF_RUNNING = 64 +pkg syscall (openbsd-386), const IFF_SIMPLEX = 2048 +pkg syscall (openbsd-386), const IFNAMSIZ = 16 +pkg syscall (openbsd-386), const IFT_1822 = 2 +pkg syscall (openbsd-386), const IFT_A12MPPSWITCH = 130 +pkg syscall (openbsd-386), const IFT_AAL2 = 187 +pkg syscall (openbsd-386), const IFT_AAL5 = 49 +pkg syscall (openbsd-386), const IFT_ADSL = 94 +pkg syscall (openbsd-386), const IFT_AFLANE8023 = 59 +pkg syscall (openbsd-386), const IFT_AFLANE8025 = 60 +pkg syscall (openbsd-386), const IFT_ARAP = 88 +pkg syscall (openbsd-386), const IFT_ARCNET = 35 +pkg syscall (openbsd-386), const IFT_ARCNETPLUS = 36 +pkg syscall (openbsd-386), const IFT_ASYNC = 84 +pkg syscall (openbsd-386), const IFT_ATM = 37 +pkg syscall (openbsd-386), const IFT_ATMDXI = 105 +pkg syscall (openbsd-386), const IFT_ATMFUNI = 106 +pkg syscall (openbsd-386), const IFT_ATMIMA = 107 +pkg syscall (openbsd-386), const IFT_ATMLOGICAL = 80 +pkg syscall (openbsd-386), const IFT_ATMRADIO = 189 +pkg syscall (openbsd-386), const IFT_ATMSUBINTERFACE = 134 +pkg syscall (openbsd-386), const IFT_ATMVCIENDPT = 194 +pkg syscall (openbsd-386), const IFT_ATMVIRTUAL = 149 +pkg syscall (openbsd-386), const IFT_BGPPOLICYACCOUNTING = 162 +pkg syscall (openbsd-386), const IFT_BLUETOOTH = 248 +pkg syscall (openbsd-386), const IFT_BRIDGE = 209 +pkg syscall (openbsd-386), const IFT_BSC = 83 +pkg syscall (openbsd-386), const IFT_CARP = 247 +pkg syscall (openbsd-386), const IFT_CCTEMUL = 61 +pkg syscall (openbsd-386), const IFT_CEPT = 19 +pkg syscall (openbsd-386), const IFT_CES = 133 +pkg syscall (openbsd-386), const IFT_CHANNEL = 70 +pkg syscall (openbsd-386), const IFT_CNR = 85 +pkg syscall (openbsd-386), const IFT_COFFEE = 132 +pkg syscall (openbsd-386), const IFT_COMPOSITELINK = 155 +pkg syscall (openbsd-386), const IFT_DCN = 141 +pkg syscall (openbsd-386), const IFT_DIGITALPOWERLINE = 138 +pkg syscall (openbsd-386), const IFT_DIGITALWRAPPEROVERHEADCHANNEL = 186 +pkg syscall (openbsd-386), const IFT_DLSW = 74 +pkg syscall (openbsd-386), const IFT_DOCSCABLEDOWNSTREAM = 128 +pkg syscall (openbsd-386), const IFT_DOCSCABLEMACLAYER = 127 +pkg syscall (openbsd-386), const IFT_DOCSCABLEUPSTREAM = 129 +pkg syscall (openbsd-386), const IFT_DOCSCABLEUPSTREAMCHANNEL = 205 +pkg syscall (openbsd-386), const IFT_DS0 = 81 +pkg syscall (openbsd-386), const IFT_DS0BUNDLE = 82 +pkg syscall (openbsd-386), const IFT_DS1FDL = 170 +pkg syscall (openbsd-386), const IFT_DS3 = 30 +pkg syscall (openbsd-386), const IFT_DTM = 140 +pkg syscall (openbsd-386), const IFT_DUMMY = 241 +pkg syscall (openbsd-386), const IFT_DVBASILN = 172 +pkg syscall (openbsd-386), const IFT_DVBASIOUT = 173 +pkg syscall (openbsd-386), const IFT_DVBRCCDOWNSTREAM = 147 +pkg syscall (openbsd-386), const IFT_DVBRCCMACLAYER = 146 +pkg syscall (openbsd-386), const IFT_DVBRCCUPSTREAM = 148 +pkg syscall (openbsd-386), const IFT_ECONET = 206 +pkg syscall (openbsd-386), const IFT_ENC = 244 +pkg syscall (openbsd-386), const IFT_EON = 25 +pkg syscall (openbsd-386), const IFT_EPLRS = 87 +pkg syscall (openbsd-386), const IFT_ESCON = 73 +pkg syscall (openbsd-386), const IFT_ETHER = 6 +pkg syscall (openbsd-386), const IFT_FAITH = 243 +pkg syscall (openbsd-386), const IFT_FAST = 125 +pkg syscall (openbsd-386), const IFT_FASTETHER = 62 +pkg syscall (openbsd-386), const IFT_FASTETHERFX = 69 +pkg syscall (openbsd-386), const IFT_FDDI = 15 +pkg syscall (openbsd-386), const IFT_FIBRECHANNEL = 56 +pkg syscall (openbsd-386), const IFT_FRAMERELAYINTERCONNECT = 58 +pkg syscall (openbsd-386), const IFT_FRAMERELAYMPI = 92 +pkg syscall (openbsd-386), const IFT_FRDLCIENDPT = 193 +pkg syscall (openbsd-386), const IFT_FRELAY = 32 +pkg syscall (openbsd-386), const IFT_FRELAYDCE = 44 +pkg syscall (openbsd-386), const IFT_FRF16MFRBUNDLE = 163 +pkg syscall (openbsd-386), const IFT_FRFORWARD = 158 +pkg syscall (openbsd-386), const IFT_G703AT2MB = 67 +pkg syscall (openbsd-386), const IFT_G703AT64K = 66 +pkg syscall (openbsd-386), const IFT_GIF = 240 +pkg syscall (openbsd-386), const IFT_GIGABITETHERNET = 117 +pkg syscall (openbsd-386), const IFT_GR303IDT = 178 +pkg syscall (openbsd-386), const IFT_GR303RDT = 177 +pkg syscall (openbsd-386), const IFT_H323GATEKEEPER = 164 +pkg syscall (openbsd-386), const IFT_H323PROXY = 165 +pkg syscall (openbsd-386), const IFT_HDH1822 = 3 +pkg syscall (openbsd-386), const IFT_HDLC = 118 +pkg syscall (openbsd-386), const IFT_HDSL2 = 168 +pkg syscall (openbsd-386), const IFT_HIPERLAN2 = 183 +pkg syscall (openbsd-386), const IFT_HIPPI = 47 +pkg syscall (openbsd-386), const IFT_HIPPIINTERFACE = 57 +pkg syscall (openbsd-386), const IFT_HOSTPAD = 90 +pkg syscall (openbsd-386), const IFT_HSSI = 46 +pkg syscall (openbsd-386), const IFT_HY = 14 +pkg syscall (openbsd-386), const IFT_IBM370PARCHAN = 72 +pkg syscall (openbsd-386), const IFT_IDSL = 154 +pkg syscall (openbsd-386), const IFT_IEEE1394 = 144 +pkg syscall (openbsd-386), const IFT_IEEE80211 = 71 +pkg syscall (openbsd-386), const IFT_IEEE80212 = 55 +pkg syscall (openbsd-386), const IFT_IEEE8023ADLAG = 161 +pkg syscall (openbsd-386), const IFT_IFGSN = 145 +pkg syscall (openbsd-386), const IFT_IMT = 190 +pkg syscall (openbsd-386), const IFT_INFINIBAND = 199 +pkg syscall (openbsd-386), const IFT_INTERLEAVE = 124 +pkg syscall (openbsd-386), const IFT_IP = 126 +pkg syscall (openbsd-386), const IFT_IPFORWARD = 142 +pkg syscall (openbsd-386), const IFT_IPOVERATM = 114 +pkg syscall (openbsd-386), const IFT_IPOVERCDLC = 109 +pkg syscall (openbsd-386), const IFT_IPOVERCLAW = 110 +pkg syscall (openbsd-386), const IFT_IPSWITCH = 78 +pkg syscall (openbsd-386), const IFT_ISDN = 63 +pkg syscall (openbsd-386), const IFT_ISDNBASIC = 20 +pkg syscall (openbsd-386), const IFT_ISDNPRIMARY = 21 +pkg syscall (openbsd-386), const IFT_ISDNS = 75 +pkg syscall (openbsd-386), const IFT_ISDNU = 76 +pkg syscall (openbsd-386), const IFT_ISO88022LLC = 41 +pkg syscall (openbsd-386), const IFT_ISO88023 = 7 +pkg syscall (openbsd-386), const IFT_ISO88024 = 8 +pkg syscall (openbsd-386), const IFT_ISO88025 = 9 +pkg syscall (openbsd-386), const IFT_ISO88025CRFPINT = 98 +pkg syscall (openbsd-386), const IFT_ISO88025DTR = 86 +pkg syscall (openbsd-386), const IFT_ISO88025FIBER = 115 +pkg syscall (openbsd-386), const IFT_ISO88026 = 10 +pkg syscall (openbsd-386), const IFT_ISUP = 179 +pkg syscall (openbsd-386), const IFT_L2VLAN = 135 +pkg syscall (openbsd-386), const IFT_L3IPVLAN = 136 +pkg syscall (openbsd-386), const IFT_L3IPXVLAN = 137 +pkg syscall (openbsd-386), const IFT_LAPB = 16 +pkg syscall (openbsd-386), const IFT_LAPD = 77 +pkg syscall (openbsd-386), const IFT_LAPF = 119 +pkg syscall (openbsd-386), const IFT_LINEGROUP = 210 +pkg syscall (openbsd-386), const IFT_LOCALTALK = 42 +pkg syscall (openbsd-386), const IFT_LOOP = 24 +pkg syscall (openbsd-386), const IFT_MEDIAMAILOVERIP = 139 +pkg syscall (openbsd-386), const IFT_MFSIGLINK = 167 +pkg syscall (openbsd-386), const IFT_MIOX25 = 38 +pkg syscall (openbsd-386), const IFT_MODEM = 48 +pkg syscall (openbsd-386), const IFT_MPC = 113 +pkg syscall (openbsd-386), const IFT_MPLS = 166 +pkg syscall (openbsd-386), const IFT_MPLSTUNNEL = 150 +pkg syscall (openbsd-386), const IFT_MSDSL = 143 +pkg syscall (openbsd-386), const IFT_MVL = 191 +pkg syscall (openbsd-386), const IFT_MYRINET = 99 +pkg syscall (openbsd-386), const IFT_NFAS = 175 +pkg syscall (openbsd-386), const IFT_NSIP = 27 +pkg syscall (openbsd-386), const IFT_OPTICALCHANNEL = 195 +pkg syscall (openbsd-386), const IFT_OPTICALTRANSPORT = 196 +pkg syscall (openbsd-386), const IFT_OTHER = 1 +pkg syscall (openbsd-386), const IFT_P10 = 12 +pkg syscall (openbsd-386), const IFT_P80 = 13 +pkg syscall (openbsd-386), const IFT_PARA = 34 +pkg syscall (openbsd-386), const IFT_PFLOG = 245 +pkg syscall (openbsd-386), const IFT_PFLOW = 249 +pkg syscall (openbsd-386), const IFT_PFSYNC = 246 +pkg syscall (openbsd-386), const IFT_PLC = 174 +pkg syscall (openbsd-386), const IFT_PON155 = 207 +pkg syscall (openbsd-386), const IFT_PON622 = 208 +pkg syscall (openbsd-386), const IFT_POS = 171 +pkg syscall (openbsd-386), const IFT_PPP = 23 +pkg syscall (openbsd-386), const IFT_PPPMULTILINKBUNDLE = 108 +pkg syscall (openbsd-386), const IFT_PROPATM = 197 +pkg syscall (openbsd-386), const IFT_PROPBWAP2MP = 184 +pkg syscall (openbsd-386), const IFT_PROPCNLS = 89 +pkg syscall (openbsd-386), const IFT_PROPDOCSWIRELESSDOWNSTREAM = 181 +pkg syscall (openbsd-386), const IFT_PROPDOCSWIRELESSMACLAYER = 180 +pkg syscall (openbsd-386), const IFT_PROPDOCSWIRELESSUPSTREAM = 182 +pkg syscall (openbsd-386), const IFT_PROPMUX = 54 +pkg syscall (openbsd-386), const IFT_PROPVIRTUAL = 53 +pkg syscall (openbsd-386), const IFT_PROPWIRELESSP2P = 157 +pkg syscall (openbsd-386), const IFT_PTPSERIAL = 22 +pkg syscall (openbsd-386), const IFT_PVC = 242 +pkg syscall (openbsd-386), const IFT_Q2931 = 201 +pkg syscall (openbsd-386), const IFT_QLLC = 68 +pkg syscall (openbsd-386), const IFT_RADIOMAC = 188 +pkg syscall (openbsd-386), const IFT_RADSL = 95 +pkg syscall (openbsd-386), const IFT_REACHDSL = 192 +pkg syscall (openbsd-386), const IFT_RFC1483 = 159 +pkg syscall (openbsd-386), const IFT_RS232 = 33 +pkg syscall (openbsd-386), const IFT_RSRB = 79 +pkg syscall (openbsd-386), const IFT_SDLC = 17 +pkg syscall (openbsd-386), const IFT_SDSL = 96 +pkg syscall (openbsd-386), const IFT_SHDSL = 169 +pkg syscall (openbsd-386), const IFT_SIP = 31 +pkg syscall (openbsd-386), const IFT_SIPSIG = 204 +pkg syscall (openbsd-386), const IFT_SIPTG = 203 +pkg syscall (openbsd-386), const IFT_SLIP = 28 +pkg syscall (openbsd-386), const IFT_SMDSDXI = 43 +pkg syscall (openbsd-386), const IFT_SMDSICIP = 52 +pkg syscall (openbsd-386), const IFT_SONET = 39 +pkg syscall (openbsd-386), const IFT_SONETOVERHEADCHANNEL = 185 +pkg syscall (openbsd-386), const IFT_SONETPATH = 50 +pkg syscall (openbsd-386), const IFT_SONETVT = 51 +pkg syscall (openbsd-386), const IFT_SRP = 151 +pkg syscall (openbsd-386), const IFT_SS7SIGLINK = 156 +pkg syscall (openbsd-386), const IFT_STACKTOSTACK = 111 +pkg syscall (openbsd-386), const IFT_STARLAN = 11 +pkg syscall (openbsd-386), const IFT_T1 = 18 +pkg syscall (openbsd-386), const IFT_TDLC = 116 +pkg syscall (openbsd-386), const IFT_TELINK = 200 +pkg syscall (openbsd-386), const IFT_TERMPAD = 91 +pkg syscall (openbsd-386), const IFT_TR008 = 176 +pkg syscall (openbsd-386), const IFT_TRANSPHDLC = 123 +pkg syscall (openbsd-386), const IFT_TUNNEL = 131 +pkg syscall (openbsd-386), const IFT_ULTRA = 29 +pkg syscall (openbsd-386), const IFT_USB = 160 +pkg syscall (openbsd-386), const IFT_V11 = 64 +pkg syscall (openbsd-386), const IFT_V35 = 45 +pkg syscall (openbsd-386), const IFT_V36 = 65 +pkg syscall (openbsd-386), const IFT_V37 = 120 +pkg syscall (openbsd-386), const IFT_VDSL = 97 +pkg syscall (openbsd-386), const IFT_VIRTUALIPADDRESS = 112 +pkg syscall (openbsd-386), const IFT_VIRTUALTG = 202 +pkg syscall (openbsd-386), const IFT_VOICEDID = 213 +pkg syscall (openbsd-386), const IFT_VOICEEM = 100 +pkg syscall (openbsd-386), const IFT_VOICEEMFGD = 211 +pkg syscall (openbsd-386), const IFT_VOICEENCAP = 103 +pkg syscall (openbsd-386), const IFT_VOICEFGDEANA = 212 +pkg syscall (openbsd-386), const IFT_VOICEFXO = 101 +pkg syscall (openbsd-386), const IFT_VOICEFXS = 102 +pkg syscall (openbsd-386), const IFT_VOICEOVERATM = 152 +pkg syscall (openbsd-386), const IFT_VOICEOVERCABLE = 198 +pkg syscall (openbsd-386), const IFT_VOICEOVERFRAMERELAY = 153 +pkg syscall (openbsd-386), const IFT_VOICEOVERIP = 104 +pkg syscall (openbsd-386), const IFT_X213 = 93 +pkg syscall (openbsd-386), const IFT_X25 = 5 +pkg syscall (openbsd-386), const IFT_X25DDN = 4 +pkg syscall (openbsd-386), const IFT_X25HUNTGROUP = 122 +pkg syscall (openbsd-386), const IFT_X25MLP = 121 +pkg syscall (openbsd-386), const IFT_X25PLE = 40 +pkg syscall (openbsd-386), const IFT_XETHER = 26 +pkg syscall (openbsd-386), const IGNBRK = 1 +pkg syscall (openbsd-386), const IGNCR = 128 +pkg syscall (openbsd-386), const IGNPAR = 4 +pkg syscall (openbsd-386), const IMAXBEL = 8192 +pkg syscall (openbsd-386), const INLCR = 64 +pkg syscall (openbsd-386), const INPCK = 16 +pkg syscall (openbsd-386), const IN_CLASSA_HOST = 16777215 +pkg syscall (openbsd-386), const IN_CLASSA_MAX = 128 +pkg syscall (openbsd-386), const IN_CLASSA_NET = 4278190080 +pkg syscall (openbsd-386), const IN_CLASSA_NSHIFT = 24 +pkg syscall (openbsd-386), const IN_CLASSB_HOST = 65535 +pkg syscall (openbsd-386), const IN_CLASSB_MAX = 65536 +pkg syscall (openbsd-386), const IN_CLASSB_NET = 4294901760 +pkg syscall (openbsd-386), const IN_CLASSB_NSHIFT = 16 +pkg syscall (openbsd-386), const IN_CLASSC_HOST = 255 +pkg syscall (openbsd-386), const IN_CLASSC_NET = 4294967040 +pkg syscall (openbsd-386), const IN_CLASSC_NSHIFT = 8 +pkg syscall (openbsd-386), const IN_CLASSD_HOST = 268435455 +pkg syscall (openbsd-386), const IN_CLASSD_NET = 4026531840 +pkg syscall (openbsd-386), const IN_CLASSD_NSHIFT = 28 +pkg syscall (openbsd-386), const IN_LOOPBACKNET = 127 +pkg syscall (openbsd-386), const IN_RFC3021_HOST = 1 +pkg syscall (openbsd-386), const IN_RFC3021_NET = 4294967294 +pkg syscall (openbsd-386), const IN_RFC3021_NSHIFT = 31 +pkg syscall (openbsd-386), const IPPROTO_AH = 51 +pkg syscall (openbsd-386), const IPPROTO_CARP = 112 +pkg syscall (openbsd-386), const IPPROTO_DIVERT = 258 +pkg syscall (openbsd-386), const IPPROTO_DONE = 257 +pkg syscall (openbsd-386), const IPPROTO_DSTOPTS = 60 +pkg syscall (openbsd-386), const IPPROTO_EGP = 8 +pkg syscall (openbsd-386), const IPPROTO_ENCAP = 98 +pkg syscall (openbsd-386), const IPPROTO_EON = 80 +pkg syscall (openbsd-386), const IPPROTO_ESP = 50 +pkg syscall (openbsd-386), const IPPROTO_ETHERIP = 97 +pkg syscall (openbsd-386), const IPPROTO_FRAGMENT = 44 +pkg syscall (openbsd-386), const IPPROTO_GGP = 3 +pkg syscall (openbsd-386), const IPPROTO_GRE = 47 +pkg syscall (openbsd-386), const IPPROTO_HOPOPTS = 0 +pkg syscall (openbsd-386), const IPPROTO_ICMP = 1 +pkg syscall (openbsd-386), const IPPROTO_ICMPV6 = 58 +pkg syscall (openbsd-386), const IPPROTO_IDP = 22 +pkg syscall (openbsd-386), const IPPROTO_IGMP = 2 +pkg syscall (openbsd-386), const IPPROTO_IPCOMP = 108 +pkg syscall (openbsd-386), const IPPROTO_IPIP = 4 +pkg syscall (openbsd-386), const IPPROTO_IPV4 = 4 +pkg syscall (openbsd-386), const IPPROTO_MAX = 256 +pkg syscall (openbsd-386), const IPPROTO_MAXID = 259 +pkg syscall (openbsd-386), const IPPROTO_MOBILE = 55 +pkg syscall (openbsd-386), const IPPROTO_MPLS = 137 +pkg syscall (openbsd-386), const IPPROTO_NONE = 59 +pkg syscall (openbsd-386), const IPPROTO_PFSYNC = 240 +pkg syscall (openbsd-386), const IPPROTO_PIM = 103 +pkg syscall (openbsd-386), const IPPROTO_PUP = 12 +pkg syscall (openbsd-386), const IPPROTO_RAW = 255 +pkg syscall (openbsd-386), const IPPROTO_ROUTING = 43 +pkg syscall (openbsd-386), const IPPROTO_RSVP = 46 +pkg syscall (openbsd-386), const IPPROTO_TP = 29 +pkg syscall (openbsd-386), const IPV6_AUTH_LEVEL = 53 +pkg syscall (openbsd-386), const IPV6_AUTOFLOWLABEL = 59 +pkg syscall (openbsd-386), const IPV6_CHECKSUM = 26 +pkg syscall (openbsd-386), const IPV6_DEFAULT_MULTICAST_HOPS = 1 +pkg syscall (openbsd-386), const IPV6_DEFAULT_MULTICAST_LOOP = 1 +pkg syscall (openbsd-386), const IPV6_DEFHLIM = 64 +pkg syscall (openbsd-386), const IPV6_DONTFRAG = 62 +pkg syscall (openbsd-386), const IPV6_DSTOPTS = 50 +pkg syscall (openbsd-386), const IPV6_ESP_NETWORK_LEVEL = 55 +pkg syscall (openbsd-386), const IPV6_ESP_TRANS_LEVEL = 54 +pkg syscall (openbsd-386), const IPV6_FAITH = 29 +pkg syscall (openbsd-386), const IPV6_FLOWINFO_MASK = 4294967055 +pkg syscall (openbsd-386), const IPV6_FLOWLABEL_MASK = 4294905600 +pkg syscall (openbsd-386), const IPV6_FRAGTTL = 120 +pkg syscall (openbsd-386), const IPV6_HLIMDEC = 1 +pkg syscall (openbsd-386), const IPV6_HOPLIMIT = 47 +pkg syscall (openbsd-386), const IPV6_HOPOPTS = 49 +pkg syscall (openbsd-386), const IPV6_IPCOMP_LEVEL = 60 +pkg syscall (openbsd-386), const IPV6_JOIN_GROUP = 12 +pkg syscall (openbsd-386), const IPV6_LEAVE_GROUP = 13 +pkg syscall (openbsd-386), const IPV6_MAXHLIM = 255 +pkg syscall (openbsd-386), const IPV6_MAXPACKET = 65535 +pkg syscall (openbsd-386), const IPV6_MMTU = 1280 +pkg syscall (openbsd-386), const IPV6_MULTICAST_HOPS = 10 +pkg syscall (openbsd-386), const IPV6_MULTICAST_IF = 9 +pkg syscall (openbsd-386), const IPV6_MULTICAST_LOOP = 11 +pkg syscall (openbsd-386), const IPV6_NEXTHOP = 48 +pkg syscall (openbsd-386), const IPV6_OPTIONS = 1 +pkg syscall (openbsd-386), const IPV6_PATHMTU = 44 +pkg syscall (openbsd-386), const IPV6_PIPEX = 63 +pkg syscall (openbsd-386), const IPV6_PKTINFO = 46 +pkg syscall (openbsd-386), const IPV6_PORTRANGE = 14 +pkg syscall (openbsd-386), const IPV6_PORTRANGE_DEFAULT = 0 +pkg syscall (openbsd-386), const IPV6_PORTRANGE_HIGH = 1 +pkg syscall (openbsd-386), const IPV6_PORTRANGE_LOW = 2 +pkg syscall (openbsd-386), const IPV6_RECVDSTOPTS = 40 +pkg syscall (openbsd-386), const IPV6_RECVHOPLIMIT = 37 +pkg syscall (openbsd-386), const IPV6_RECVHOPOPTS = 39 +pkg syscall (openbsd-386), const IPV6_RECVPATHMTU = 43 +pkg syscall (openbsd-386), const IPV6_RECVPKTINFO = 36 +pkg syscall (openbsd-386), const IPV6_RECVRTHDR = 38 +pkg syscall (openbsd-386), const IPV6_RECVTCLASS = 57 +pkg syscall (openbsd-386), const IPV6_RTABLE = 4129 +pkg syscall (openbsd-386), const IPV6_RTHDR = 51 +pkg syscall (openbsd-386), const IPV6_RTHDRDSTOPTS = 35 +pkg syscall (openbsd-386), const IPV6_RTHDR_LOOSE = 0 +pkg syscall (openbsd-386), const IPV6_RTHDR_STRICT = 1 +pkg syscall (openbsd-386), const IPV6_RTHDR_TYPE_0 = 0 +pkg syscall (openbsd-386), const IPV6_SOCKOPT_RESERVED1 = 3 +pkg syscall (openbsd-386), const IPV6_TCLASS = 61 +pkg syscall (openbsd-386), const IPV6_UNICAST_HOPS = 4 +pkg syscall (openbsd-386), const IPV6_USE_MIN_MTU = 42 +pkg syscall (openbsd-386), const IPV6_V6ONLY = 27 +pkg syscall (openbsd-386), const IPV6_VERSION = 96 +pkg syscall (openbsd-386), const IPV6_VERSION_MASK = 240 +pkg syscall (openbsd-386), const IP_ADD_MEMBERSHIP = 12 +pkg syscall (openbsd-386), const IP_AUTH_LEVEL = 20 +pkg syscall (openbsd-386), const IP_DEFAULT_MULTICAST_LOOP = 1 +pkg syscall (openbsd-386), const IP_DEFAULT_MULTICAST_TTL = 1 +pkg syscall (openbsd-386), const IP_DF = 16384 +pkg syscall (openbsd-386), const IP_DROP_MEMBERSHIP = 13 +pkg syscall (openbsd-386), const IP_ESP_NETWORK_LEVEL = 22 +pkg syscall (openbsd-386), const IP_ESP_TRANS_LEVEL = 21 +pkg syscall (openbsd-386), const IP_HDRINCL = 2 +pkg syscall (openbsd-386), const IP_IPCOMP_LEVEL = 29 +pkg syscall (openbsd-386), const IP_IPSECFLOWINFO = 36 +pkg syscall (openbsd-386), const IP_IPSEC_LOCAL_AUTH = 27 +pkg syscall (openbsd-386), const IP_IPSEC_LOCAL_CRED = 25 +pkg syscall (openbsd-386), const IP_IPSEC_LOCAL_ID = 23 +pkg syscall (openbsd-386), const IP_IPSEC_REMOTE_AUTH = 28 +pkg syscall (openbsd-386), const IP_IPSEC_REMOTE_CRED = 26 +pkg syscall (openbsd-386), const IP_IPSEC_REMOTE_ID = 24 +pkg syscall (openbsd-386), const IP_MAXPACKET = 65535 +pkg syscall (openbsd-386), const IP_MAX_MEMBERSHIPS = 4095 +pkg syscall (openbsd-386), const IP_MF = 8192 +pkg syscall (openbsd-386), const IP_MINTTL = 32 +pkg syscall (openbsd-386), const IP_MIN_MEMBERSHIPS = 15 +pkg syscall (openbsd-386), const IP_MSS = 576 +pkg syscall (openbsd-386), const IP_MULTICAST_IF = 9 +pkg syscall (openbsd-386), const IP_MULTICAST_LOOP = 11 +pkg syscall (openbsd-386), const IP_MULTICAST_TTL = 10 +pkg syscall (openbsd-386), const IP_OFFMASK = 8191 +pkg syscall (openbsd-386), const IP_OPTIONS = 1 +pkg syscall (openbsd-386), const IP_PIPEX = 34 +pkg syscall (openbsd-386), const IP_PORTRANGE = 19 +pkg syscall (openbsd-386), const IP_PORTRANGE_DEFAULT = 0 +pkg syscall (openbsd-386), const IP_PORTRANGE_HIGH = 1 +pkg syscall (openbsd-386), const IP_PORTRANGE_LOW = 2 +pkg syscall (openbsd-386), const IP_RECVDSTADDR = 7 +pkg syscall (openbsd-386), const IP_RECVDSTPORT = 33 +pkg syscall (openbsd-386), const IP_RECVIF = 30 +pkg syscall (openbsd-386), const IP_RECVOPTS = 5 +pkg syscall (openbsd-386), const IP_RECVRETOPTS = 6 +pkg syscall (openbsd-386), const IP_RECVRTABLE = 35 +pkg syscall (openbsd-386), const IP_RECVTTL = 31 +pkg syscall (openbsd-386), const IP_RETOPTS = 8 +pkg syscall (openbsd-386), const IP_RF = 32768 +pkg syscall (openbsd-386), const IP_RTABLE = 4129 +pkg syscall (openbsd-386), const IP_TOS = 3 +pkg syscall (openbsd-386), const IP_TTL = 4 +pkg syscall (openbsd-386), const ISIG = 128 +pkg syscall (openbsd-386), const ISTRIP = 32 +pkg syscall (openbsd-386), const IXANY = 2048 +pkg syscall (openbsd-386), const IXOFF = 1024 +pkg syscall (openbsd-386), const IXON = 512 +pkg syscall (openbsd-386), const ImplementsGetwd = false +pkg syscall (openbsd-386), const LCNT_OVERLOAD_FLUSH = 6 +pkg syscall (openbsd-386), const LOCK_EX = 2 +pkg syscall (openbsd-386), const LOCK_NB = 4 +pkg syscall (openbsd-386), const LOCK_SH = 1 +pkg syscall (openbsd-386), const LOCK_UN = 8 +pkg syscall (openbsd-386), const MSG_BCAST = 256 +pkg syscall (openbsd-386), const MSG_CTRUNC = 32 +pkg syscall (openbsd-386), const MSG_DONTROUTE = 4 +pkg syscall (openbsd-386), const MSG_DONTWAIT = 128 +pkg syscall (openbsd-386), const MSG_EOR = 8 +pkg syscall (openbsd-386), const MSG_MCAST = 512 +pkg syscall (openbsd-386), const MSG_NOSIGNAL = 1024 +pkg syscall (openbsd-386), const MSG_OOB = 1 +pkg syscall (openbsd-386), const MSG_PEEK = 2 +pkg syscall (openbsd-386), const MSG_TRUNC = 16 +pkg syscall (openbsd-386), const MSG_WAITALL = 64 +pkg syscall (openbsd-386), const NAME_MAX = 255 +pkg syscall (openbsd-386), const NET_RT_DUMP = 1 +pkg syscall (openbsd-386), const NET_RT_FLAGS = 2 +pkg syscall (openbsd-386), const NET_RT_IFLIST = 3 +pkg syscall (openbsd-386), const NET_RT_MAXID = 6 +pkg syscall (openbsd-386), const NET_RT_STATS = 4 +pkg syscall (openbsd-386), const NET_RT_TABLE = 5 +pkg syscall (openbsd-386), const NOFLSH = 2147483648 +pkg syscall (openbsd-386), const NOTE_ATTRIB = 8 +pkg syscall (openbsd-386), const NOTE_CHILD = 4 +pkg syscall (openbsd-386), const NOTE_DELETE = 1 +pkg syscall (openbsd-386), const NOTE_EOF = 2 +pkg syscall (openbsd-386), const NOTE_EXEC = 536870912 +pkg syscall (openbsd-386), const NOTE_EXIT = 2147483648 +pkg syscall (openbsd-386), const NOTE_EXTEND = 4 +pkg syscall (openbsd-386), const NOTE_FORK = 1073741824 +pkg syscall (openbsd-386), const NOTE_LINK = 16 +pkg syscall (openbsd-386), const NOTE_LOWAT = 1 +pkg syscall (openbsd-386), const NOTE_PCTRLMASK = 4026531840 +pkg syscall (openbsd-386), const NOTE_PDATAMASK = 1048575 +pkg syscall (openbsd-386), const NOTE_RENAME = 32 +pkg syscall (openbsd-386), const NOTE_REVOKE = 64 +pkg syscall (openbsd-386), const NOTE_TRACK = 1 +pkg syscall (openbsd-386), const NOTE_TRACKERR = 2 +pkg syscall (openbsd-386), const NOTE_TRUNCATE = 128 +pkg syscall (openbsd-386), const NOTE_WRITE = 2 +pkg syscall (openbsd-386), const OCRNL = 16 +pkg syscall (openbsd-386), const ONLCR = 2 +pkg syscall (openbsd-386), const ONLRET = 128 +pkg syscall (openbsd-386), const ONOCR = 64 +pkg syscall (openbsd-386), const ONOEOT = 8 +pkg syscall (openbsd-386), const OPOST = 1 +pkg syscall (openbsd-386), const O_ACCMODE = 3 +pkg syscall (openbsd-386), const O_APPEND = 8 +pkg syscall (openbsd-386), const O_ASYNC = 64 +pkg syscall (openbsd-386), const O_CLOEXEC = 65536 +pkg syscall (openbsd-386), const O_CREAT = 512 +pkg syscall (openbsd-386), const O_DIRECTORY = 131072 +pkg syscall (openbsd-386), const O_DSYNC = 128 +pkg syscall (openbsd-386), const O_EXCL = 2048 +pkg syscall (openbsd-386), const O_EXLOCK = 32 +pkg syscall (openbsd-386), const O_FSYNC = 128 +pkg syscall (openbsd-386), const O_NDELAY = 4 +pkg syscall (openbsd-386), const O_NOCTTY = 32768 +pkg syscall (openbsd-386), const O_NOFOLLOW = 256 +pkg syscall (openbsd-386), const O_NONBLOCK = 4 +pkg syscall (openbsd-386), const O_RSYNC = 128 +pkg syscall (openbsd-386), const O_SHLOCK = 16 +pkg syscall (openbsd-386), const O_SYNC = 128 +pkg syscall (openbsd-386), const O_TRUNC = 1024 +pkg syscall (openbsd-386), const PARENB = 4096 +pkg syscall (openbsd-386), const PARMRK = 8 +pkg syscall (openbsd-386), const PARODD = 8192 +pkg syscall (openbsd-386), const PENDIN = 536870912 +pkg syscall (openbsd-386), const PF_FLUSH = 1 +pkg syscall (openbsd-386), const PTRACE_CONT = 7 +pkg syscall (openbsd-386), const PTRACE_KILL = 8 +pkg syscall (openbsd-386), const PTRACE_TRACEME = 0 +pkg syscall (openbsd-386), const PT_MASK = 4190208 +pkg syscall (openbsd-386), const RLIMIT_CORE = 4 +pkg syscall (openbsd-386), const RLIMIT_CPU = 0 +pkg syscall (openbsd-386), const RLIMIT_DATA = 2 +pkg syscall (openbsd-386), const RLIMIT_FSIZE = 1 +pkg syscall (openbsd-386), const RLIMIT_NOFILE = 8 +pkg syscall (openbsd-386), const RLIMIT_STACK = 3 +pkg syscall (openbsd-386), const RLIM_INFINITY = 9223372036854775807 +pkg syscall (openbsd-386), const RTAX_AUTHOR = 6 +pkg syscall (openbsd-386), const RTAX_BRD = 7 +pkg syscall (openbsd-386), const RTAX_DST = 0 +pkg syscall (openbsd-386), const RTAX_GATEWAY = 1 +pkg syscall (openbsd-386), const RTAX_GENMASK = 3 +pkg syscall (openbsd-386), const RTAX_IFA = 5 +pkg syscall (openbsd-386), const RTAX_IFP = 4 +pkg syscall (openbsd-386), const RTAX_LABEL = 10 +pkg syscall (openbsd-386), const RTAX_MAX = 11 +pkg syscall (openbsd-386), const RTAX_NETMASK = 2 +pkg syscall (openbsd-386), const RTAX_SRC = 8 +pkg syscall (openbsd-386), const RTAX_SRCMASK = 9 +pkg syscall (openbsd-386), const RTA_AUTHOR = 64 +pkg syscall (openbsd-386), const RTA_BRD = 128 +pkg syscall (openbsd-386), const RTA_DST = 1 +pkg syscall (openbsd-386), const RTA_GATEWAY = 2 +pkg syscall (openbsd-386), const RTA_GENMASK = 8 +pkg syscall (openbsd-386), const RTA_IFA = 32 +pkg syscall (openbsd-386), const RTA_IFP = 16 +pkg syscall (openbsd-386), const RTA_LABEL = 1024 +pkg syscall (openbsd-386), const RTA_NETMASK = 4 +pkg syscall (openbsd-386), const RTA_SRC = 256 +pkg syscall (openbsd-386), const RTA_SRCMASK = 512 +pkg syscall (openbsd-386), const RTF_ANNOUNCE = 16384 +pkg syscall (openbsd-386), const RTF_BLACKHOLE = 4096 +pkg syscall (openbsd-386), const RTF_CLONED = 65536 +pkg syscall (openbsd-386), const RTF_CLONING = 256 +pkg syscall (openbsd-386), const RTF_DONE = 64 +pkg syscall (openbsd-386), const RTF_DYNAMIC = 16 +pkg syscall (openbsd-386), const RTF_FMASK = 63496 +pkg syscall (openbsd-386), const RTF_GATEWAY = 2 +pkg syscall (openbsd-386), const RTF_HOST = 4 +pkg syscall (openbsd-386), const RTF_LLINFO = 1024 +pkg syscall (openbsd-386), const RTF_MASK = 128 +pkg syscall (openbsd-386), const RTF_MODIFIED = 32 +pkg syscall (openbsd-386), const RTF_MPATH = 262144 +pkg syscall (openbsd-386), const RTF_MPLS = 1048576 +pkg syscall (openbsd-386), const RTF_PERMANENT_ARP = 8192 +pkg syscall (openbsd-386), const RTF_PROTO1 = 32768 +pkg syscall (openbsd-386), const RTF_PROTO2 = 16384 +pkg syscall (openbsd-386), const RTF_PROTO3 = 8192 +pkg syscall (openbsd-386), const RTF_REJECT = 8 +pkg syscall (openbsd-386), const RTF_SOURCE = 131072 +pkg syscall (openbsd-386), const RTF_STATIC = 2048 +pkg syscall (openbsd-386), const RTF_TUNNEL = 1048576 +pkg syscall (openbsd-386), const RTF_UP = 1 +pkg syscall (openbsd-386), const RTF_USETRAILERS = 32768 +pkg syscall (openbsd-386), const RTF_XRESOLVE = 512 +pkg syscall (openbsd-386), const RTM_ADD = 1 +pkg syscall (openbsd-386), const RTM_CHANGE = 3 +pkg syscall (openbsd-386), const RTM_DELADDR = 13 +pkg syscall (openbsd-386), const RTM_DELETE = 2 +pkg syscall (openbsd-386), const RTM_DESYNC = 16 +pkg syscall (openbsd-386), const RTM_GET = 4 +pkg syscall (openbsd-386), const RTM_IFANNOUNCE = 15 +pkg syscall (openbsd-386), const RTM_IFINFO = 14 +pkg syscall (openbsd-386), const RTM_LOCK = 8 +pkg syscall (openbsd-386), const RTM_LOSING = 5 +pkg syscall (openbsd-386), const RTM_MAXSIZE = 2048 +pkg syscall (openbsd-386), const RTM_MISS = 7 +pkg syscall (openbsd-386), const RTM_NEWADDR = 12 +pkg syscall (openbsd-386), const RTM_REDIRECT = 6 +pkg syscall (openbsd-386), const RTM_RESOLVE = 11 +pkg syscall (openbsd-386), const RTM_RTTUNIT = 1000000 +pkg syscall (openbsd-386), const RTM_VERSION = 4 +pkg syscall (openbsd-386), const RTV_EXPIRE = 4 +pkg syscall (openbsd-386), const RTV_HOPCOUNT = 2 +pkg syscall (openbsd-386), const RTV_MTU = 1 +pkg syscall (openbsd-386), const RTV_RPIPE = 8 +pkg syscall (openbsd-386), const RTV_RTT = 64 +pkg syscall (openbsd-386), const RTV_RTTVAR = 128 +pkg syscall (openbsd-386), const RTV_SPIPE = 16 +pkg syscall (openbsd-386), const RTV_SSTHRESH = 32 +pkg syscall (openbsd-386), const RT_TABLEID_MAX = 255 +pkg syscall (openbsd-386), const RUSAGE_CHILDREN = -1 +pkg syscall (openbsd-386), const RUSAGE_SELF = 0 +pkg syscall (openbsd-386), const RUSAGE_THREAD = 1 +pkg syscall (openbsd-386), const SCM_RIGHTS = 1 +pkg syscall (openbsd-386), const SCM_TIMESTAMP = 4 +pkg syscall (openbsd-386), const SIGBUS = 10 +pkg syscall (openbsd-386), const SIGCHLD = 20 +pkg syscall (openbsd-386), const SIGCONT = 19 +pkg syscall (openbsd-386), const SIGEMT = 7 +pkg syscall (openbsd-386), const SIGINFO = 29 +pkg syscall (openbsd-386), const SIGIO = 23 +pkg syscall (openbsd-386), const SIGIOT = 6 +pkg syscall (openbsd-386), const SIGPROF = 27 +pkg syscall (openbsd-386), const SIGSTOP = 17 +pkg syscall (openbsd-386), const SIGSYS = 12 +pkg syscall (openbsd-386), const SIGTHR = 32 +pkg syscall (openbsd-386), const SIGTSTP = 18 +pkg syscall (openbsd-386), const SIGTTIN = 21 +pkg syscall (openbsd-386), const SIGTTOU = 22 +pkg syscall (openbsd-386), const SIGURG = 16 +pkg syscall (openbsd-386), const SIGUSR1 = 30 +pkg syscall (openbsd-386), const SIGUSR2 = 31 +pkg syscall (openbsd-386), const SIGVTALRM = 26 +pkg syscall (openbsd-386), const SIGWINCH = 28 +pkg syscall (openbsd-386), const SIGXCPU = 24 +pkg syscall (openbsd-386), const SIGXFSZ = 25 +pkg syscall (openbsd-386), const SIOCADDMULTI = 2149607729 +pkg syscall (openbsd-386), const SIOCAIFADDR = 2151704858 +pkg syscall (openbsd-386), const SIOCAIFGROUP = 2149869959 +pkg syscall (openbsd-386), const SIOCALIFADDR = 2182637852 +pkg syscall (openbsd-386), const SIOCATMARK = 1074033415 +pkg syscall (openbsd-386), const SIOCBRDGADD = 2153015612 +pkg syscall (openbsd-386), const SIOCBRDGADDS = 2153015617 +pkg syscall (openbsd-386), const SIOCBRDGARL = 2154719565 +pkg syscall (openbsd-386), const SIOCBRDGDADDR = 2150132039 +pkg syscall (openbsd-386), const SIOCBRDGDEL = 2153015613 +pkg syscall (openbsd-386), const SIOCBRDGDELS = 2153015618 +pkg syscall (openbsd-386), const SIOCBRDGFLUSH = 2153015624 +pkg syscall (openbsd-386), const SIOCBRDGFRL = 2154719566 +pkg syscall (openbsd-386), const SIOCBRDGGCACHE = 3222563137 +pkg syscall (openbsd-386), const SIOCBRDGGFD = 3222563154 +pkg syscall (openbsd-386), const SIOCBRDGGHT = 3222563153 +pkg syscall (openbsd-386), const SIOCBRDGGIFFLGS = 3226757438 +pkg syscall (openbsd-386), const SIOCBRDGGMA = 3222563155 +pkg syscall (openbsd-386), const SIOCBRDGGPARAM = 3224922456 +pkg syscall (openbsd-386), const SIOCBRDGGPRI = 3222563152 +pkg syscall (openbsd-386), const SIOCBRDGGRL = 3223873871 +pkg syscall (openbsd-386), const SIOCBRDGGSIFS = 3226757436 +pkg syscall (openbsd-386), const SIOCBRDGGTO = 3222563142 +pkg syscall (openbsd-386), const SIOCBRDGIFS = 3226757442 +pkg syscall (openbsd-386), const SIOCBRDGRTS = 3222825283 +pkg syscall (openbsd-386), const SIOCBRDGSADDR = 3223873860 +pkg syscall (openbsd-386), const SIOCBRDGSCACHE = 2148821312 +pkg syscall (openbsd-386), const SIOCBRDGSFD = 2148821330 +pkg syscall (openbsd-386), const SIOCBRDGSHT = 2148821329 +pkg syscall (openbsd-386), const SIOCBRDGSIFCOST = 2153015637 +pkg syscall (openbsd-386), const SIOCBRDGSIFFLGS = 2153015615 +pkg syscall (openbsd-386), const SIOCBRDGSIFPRIO = 2153015636 +pkg syscall (openbsd-386), const SIOCBRDGSMA = 2148821331 +pkg syscall (openbsd-386), const SIOCBRDGSPRI = 2148821328 +pkg syscall (openbsd-386), const SIOCBRDGSPROTO = 2148821338 +pkg syscall (openbsd-386), const SIOCBRDGSTO = 2148821317 +pkg syscall (openbsd-386), const SIOCBRDGSTXHC = 2148821337 +pkg syscall (openbsd-386), const SIOCDELMULTI = 2149607730 +pkg syscall (openbsd-386), const SIOCDIFADDR = 2149607705 +pkg syscall (openbsd-386), const SIOCDIFGROUP = 2149869961 +pkg syscall (openbsd-386), const SIOCDIFPHYADDR = 2149607753 +pkg syscall (openbsd-386), const SIOCDLIFADDR = 2182637854 +pkg syscall (openbsd-386), const SIOCGETKALIVE = 3222825380 +pkg syscall (openbsd-386), const SIOCGETLABEL = 2149607834 +pkg syscall (openbsd-386), const SIOCGETPFLOW = 3223349758 +pkg syscall (openbsd-386), const SIOCGETPFSYNC = 3223349752 +pkg syscall (openbsd-386), const SIOCGETSGCNT = 3222566196 +pkg syscall (openbsd-386), const SIOCGETVIFCNT = 3222566195 +pkg syscall (openbsd-386), const SIOCGHIWAT = 1074033409 +pkg syscall (openbsd-386), const SIOCGIFADDR = 3223349537 +pkg syscall (openbsd-386), const SIOCGIFASYNCMAP = 3223349628 +pkg syscall (openbsd-386), const SIOCGIFBRDADDR = 3223349539 +pkg syscall (openbsd-386), const SIOCGIFCONF = 3221776676 +pkg syscall (openbsd-386), const SIOCGIFDATA = 3223349531 +pkg syscall (openbsd-386), const SIOCGIFDESCR = 3223349633 +pkg syscall (openbsd-386), const SIOCGIFDSTADDR = 3223349538 +pkg syscall (openbsd-386), const SIOCGIFFLAGS = 3223349521 +pkg syscall (openbsd-386), const SIOCGIFGATTR = 3223611787 +pkg syscall (openbsd-386), const SIOCGIFGENERIC = 3223349562 +pkg syscall (openbsd-386), const SIOCGIFGMEMB = 3223611786 +pkg syscall (openbsd-386), const SIOCGIFGROUP = 3223611784 +pkg syscall (openbsd-386), const SIOCGIFMEDIA = 3223873846 +pkg syscall (openbsd-386), const SIOCGIFMETRIC = 3223349527 +pkg syscall (openbsd-386), const SIOCGIFMTU = 3223349630 +pkg syscall (openbsd-386), const SIOCGIFNETMASK = 3223349541 +pkg syscall (openbsd-386), const SIOCGIFPDSTADDR = 3223349576 +pkg syscall (openbsd-386), const SIOCGIFPRIORITY = 3223349660 +pkg syscall (openbsd-386), const SIOCGIFPSRCADDR = 3223349575 +pkg syscall (openbsd-386), const SIOCGIFRDOMAIN = 3223349664 +pkg syscall (openbsd-386), const SIOCGIFRTLABEL = 3223349635 +pkg syscall (openbsd-386), const SIOCGIFTIMESLOT = 3223349638 +pkg syscall (openbsd-386), const SIOCGIFXFLAGS = 3223349662 +pkg syscall (openbsd-386), const SIOCGLIFADDR = 3256379677 +pkg syscall (openbsd-386), const SIOCGLIFPHYADDR = 3256379723 +pkg syscall (openbsd-386), const SIOCGLIFPHYRTABLE = 3223349666 +pkg syscall (openbsd-386), const SIOCGLOWAT = 1074033411 +pkg syscall (openbsd-386), const SIOCGPGRP = 1074033417 +pkg syscall (openbsd-386), const SIOCGVH = 3223349750 +pkg syscall (openbsd-386), const SIOCIFCREATE = 2149607802 +pkg syscall (openbsd-386), const SIOCIFDESTROY = 2149607801 +pkg syscall (openbsd-386), const SIOCIFGCLONERS = 3222038904 +pkg syscall (openbsd-386), const SIOCSETKALIVE = 2149083555 +pkg syscall (openbsd-386), const SIOCSETLABEL = 2149607833 +pkg syscall (openbsd-386), const SIOCSETPFLOW = 2149607933 +pkg syscall (openbsd-386), const SIOCSETPFSYNC = 2149607927 +pkg syscall (openbsd-386), const SIOCSHIWAT = 2147775232 +pkg syscall (openbsd-386), const SIOCSIFADDR = 2149607692 +pkg syscall (openbsd-386), const SIOCSIFASYNCMAP = 2149607805 +pkg syscall (openbsd-386), const SIOCSIFBRDADDR = 2149607699 +pkg syscall (openbsd-386), const SIOCSIFDESCR = 2149607808 +pkg syscall (openbsd-386), const SIOCSIFDSTADDR = 2149607694 +pkg syscall (openbsd-386), const SIOCSIFFLAGS = 2149607696 +pkg syscall (openbsd-386), const SIOCSIFGATTR = 2149869964 +pkg syscall (openbsd-386), const SIOCSIFGENERIC = 2149607737 +pkg syscall (openbsd-386), const SIOCSIFLLADDR = 2149607711 +pkg syscall (openbsd-386), const SIOCSIFMEDIA = 3223349557 +pkg syscall (openbsd-386), const SIOCSIFMETRIC = 2149607704 +pkg syscall (openbsd-386), const SIOCSIFMTU = 2149607807 +pkg syscall (openbsd-386), const SIOCSIFNETMASK = 2149607702 +pkg syscall (openbsd-386), const SIOCSIFPHYADDR = 2151704902 +pkg syscall (openbsd-386), const SIOCSIFPRIORITY = 2149607835 +pkg syscall (openbsd-386), const SIOCSIFRDOMAIN = 2149607839 +pkg syscall (openbsd-386), const SIOCSIFRTLABEL = 2149607810 +pkg syscall (openbsd-386), const SIOCSIFTIMESLOT = 2149607813 +pkg syscall (openbsd-386), const SIOCSIFXFLAGS = 2149607837 +pkg syscall (openbsd-386), const SIOCSLIFPHYADDR = 2182637898 +pkg syscall (openbsd-386), const SIOCSLIFPHYRTABLE = 2149607841 +pkg syscall (openbsd-386), const SIOCSLOWAT = 2147775234 +pkg syscall (openbsd-386), const SIOCSPGRP = 2147775240 +pkg syscall (openbsd-386), const SIOCSVH = 3223349749 +pkg syscall (openbsd-386), const SOCK_RDM = 4 +pkg syscall (openbsd-386), const SOL_SOCKET = 65535 +pkg syscall (openbsd-386), const SOMAXCONN = 128 +pkg syscall (openbsd-386), const SO_ACCEPTCONN = 2 +pkg syscall (openbsd-386), const SO_BINDANY = 4096 +pkg syscall (openbsd-386), const SO_BROADCAST = 32 +pkg syscall (openbsd-386), const SO_DEBUG = 1 +pkg syscall (openbsd-386), const SO_DONTROUTE = 16 +pkg syscall (openbsd-386), const SO_ERROR = 4103 +pkg syscall (openbsd-386), const SO_KEEPALIVE = 8 +pkg syscall (openbsd-386), const SO_LINGER = 128 +pkg syscall (openbsd-386), const SO_NETPROC = 4128 +pkg syscall (openbsd-386), const SO_OOBINLINE = 256 +pkg syscall (openbsd-386), const SO_PEERCRED = 4130 +pkg syscall (openbsd-386), const SO_RCVBUF = 4098 +pkg syscall (openbsd-386), const SO_RCVLOWAT = 4100 +pkg syscall (openbsd-386), const SO_RCVTIMEO = 4102 +pkg syscall (openbsd-386), const SO_REUSEADDR = 4 +pkg syscall (openbsd-386), const SO_REUSEPORT = 512 +pkg syscall (openbsd-386), const SO_RTABLE = 4129 +pkg syscall (openbsd-386), const SO_SNDBUF = 4097 +pkg syscall (openbsd-386), const SO_SNDLOWAT = 4099 +pkg syscall (openbsd-386), const SO_SNDTIMEO = 4101 +pkg syscall (openbsd-386), const SO_SPLICE = 4131 +pkg syscall (openbsd-386), const SO_TIMESTAMP = 2048 +pkg syscall (openbsd-386), const SO_TYPE = 4104 +pkg syscall (openbsd-386), const SO_USELOOPBACK = 64 +pkg syscall (openbsd-386), const SYS_ACCEPT = 30 +pkg syscall (openbsd-386), const SYS_ACCESS = 33 +pkg syscall (openbsd-386), const SYS_ACCT = 51 +pkg syscall (openbsd-386), const SYS_ADJFREQ = 305 +pkg syscall (openbsd-386), const SYS_ADJTIME = 140 +pkg syscall (openbsd-386), const SYS_BIND = 104 +pkg syscall (openbsd-386), const SYS_CHDIR = 12 +pkg syscall (openbsd-386), const SYS_CHFLAGS = 34 +pkg syscall (openbsd-386), const SYS_CHMOD = 15 +pkg syscall (openbsd-386), const SYS_CHOWN = 16 +pkg syscall (openbsd-386), const SYS_CHROOT = 61 +pkg syscall (openbsd-386), const SYS_CLOCK_GETRES = 234 +pkg syscall (openbsd-386), const SYS_CLOCK_GETTIME = 232 +pkg syscall (openbsd-386), const SYS_CLOCK_SETTIME = 233 +pkg syscall (openbsd-386), const SYS_CLOSE = 6 +pkg syscall (openbsd-386), const SYS_CLOSEFROM = 287 +pkg syscall (openbsd-386), const SYS_CONNECT = 98 +pkg syscall (openbsd-386), const SYS_DUP = 41 +pkg syscall (openbsd-386), const SYS_DUP2 = 90 +pkg syscall (openbsd-386), const SYS_EXECVE = 59 +pkg syscall (openbsd-386), const SYS_EXIT = 1 +pkg syscall (openbsd-386), const SYS_FACCESSAT = 313 +pkg syscall (openbsd-386), const SYS_FCHDIR = 13 +pkg syscall (openbsd-386), const SYS_FCHFLAGS = 35 +pkg syscall (openbsd-386), const SYS_FCHMOD = 124 +pkg syscall (openbsd-386), const SYS_FCHMODAT = 314 +pkg syscall (openbsd-386), const SYS_FCHOWN = 123 +pkg syscall (openbsd-386), const SYS_FCHOWNAT = 315 +pkg syscall (openbsd-386), const SYS_FCNTL = 92 +pkg syscall (openbsd-386), const SYS_FHOPEN = 264 +pkg syscall (openbsd-386), const SYS_FHSTAT = 294 +pkg syscall (openbsd-386), const SYS_FHSTATFS = 309 +pkg syscall (openbsd-386), const SYS_FLOCK = 131 +pkg syscall (openbsd-386), const SYS_FORK = 2 +pkg syscall (openbsd-386), const SYS_FPATHCONF = 192 +pkg syscall (openbsd-386), const SYS_FSTAT = 292 +pkg syscall (openbsd-386), const SYS_FSTATAT = 316 +pkg syscall (openbsd-386), const SYS_FSTATFS = 308 +pkg syscall (openbsd-386), const SYS_FSYNC = 95 +pkg syscall (openbsd-386), const SYS_FTRUNCATE = 201 +pkg syscall (openbsd-386), const SYS_FUTIMENS = 327 +pkg syscall (openbsd-386), const SYS_FUTIMES = 206 +pkg syscall (openbsd-386), const SYS_GETDIRENTRIES = 312 +pkg syscall (openbsd-386), const SYS_GETDTABLECOUNT = 18 +pkg syscall (openbsd-386), const SYS_GETEGID = 43 +pkg syscall (openbsd-386), const SYS_GETEUID = 25 +pkg syscall (openbsd-386), const SYS_GETFH = 161 +pkg syscall (openbsd-386), const SYS_GETFSSTAT = 306 +pkg syscall (openbsd-386), const SYS_GETGID = 47 +pkg syscall (openbsd-386), const SYS_GETGROUPS = 79 +pkg syscall (openbsd-386), const SYS_GETITIMER = 86 +pkg syscall (openbsd-386), const SYS_GETLOGIN = 49 +pkg syscall (openbsd-386), const SYS_GETPEERNAME = 31 +pkg syscall (openbsd-386), const SYS_GETPGID = 207 +pkg syscall (openbsd-386), const SYS_GETPGRP = 81 +pkg syscall (openbsd-386), const SYS_GETPID = 20 +pkg syscall (openbsd-386), const SYS_GETPPID = 39 +pkg syscall (openbsd-386), const SYS_GETPRIORITY = 100 +pkg syscall (openbsd-386), const SYS_GETRESGID = 283 +pkg syscall (openbsd-386), const SYS_GETRESUID = 281 +pkg syscall (openbsd-386), const SYS_GETRLIMIT = 194 +pkg syscall (openbsd-386), const SYS_GETRTABLE = 311 +pkg syscall (openbsd-386), const SYS_GETRUSAGE = 117 +pkg syscall (openbsd-386), const SYS_GETSID = 255 +pkg syscall (openbsd-386), const SYS_GETSOCKNAME = 32 +pkg syscall (openbsd-386), const SYS_GETSOCKOPT = 118 +pkg syscall (openbsd-386), const SYS_GETTHRID = 299 +pkg syscall (openbsd-386), const SYS_GETTIMEOFDAY = 116 +pkg syscall (openbsd-386), const SYS_GETUID = 24 +pkg syscall (openbsd-386), const SYS_IOCTL = 54 +pkg syscall (openbsd-386), const SYS_ISSETUGID = 253 +pkg syscall (openbsd-386), const SYS_KEVENT = 270 +pkg syscall (openbsd-386), const SYS_KILL = 37 +pkg syscall (openbsd-386), const SYS_KQUEUE = 269 +pkg syscall (openbsd-386), const SYS_KTRACE = 45 +pkg syscall (openbsd-386), const SYS_LCHOWN = 254 +pkg syscall (openbsd-386), const SYS_LINK = 9 +pkg syscall (openbsd-386), const SYS_LINKAT = 317 +pkg syscall (openbsd-386), const SYS_LISTEN = 106 +pkg syscall (openbsd-386), const SYS_LSEEK = 199 +pkg syscall (openbsd-386), const SYS_LSTAT = 293 +pkg syscall (openbsd-386), const SYS_MADVISE = 75 +pkg syscall (openbsd-386), const SYS_MINCORE = 78 +pkg syscall (openbsd-386), const SYS_MINHERIT = 250 +pkg syscall (openbsd-386), const SYS_MKDIR = 136 +pkg syscall (openbsd-386), const SYS_MKDIRAT = 318 +pkg syscall (openbsd-386), const SYS_MKFIFO = 132 +pkg syscall (openbsd-386), const SYS_MKFIFOAT = 319 +pkg syscall (openbsd-386), const SYS_MKNOD = 14 +pkg syscall (openbsd-386), const SYS_MKNODAT = 320 +pkg syscall (openbsd-386), const SYS_MLOCK = 203 +pkg syscall (openbsd-386), const SYS_MLOCKALL = 271 +pkg syscall (openbsd-386), const SYS_MMAP = 197 +pkg syscall (openbsd-386), const SYS_MOUNT = 21 +pkg syscall (openbsd-386), const SYS_MPROTECT = 74 +pkg syscall (openbsd-386), const SYS_MQUERY = 286 +pkg syscall (openbsd-386), const SYS_MSGCTL = 297 +pkg syscall (openbsd-386), const SYS_MSGGET = 225 +pkg syscall (openbsd-386), const SYS_MSGRCV = 227 +pkg syscall (openbsd-386), const SYS_MSGSND = 226 +pkg syscall (openbsd-386), const SYS_MSYNC = 256 +pkg syscall (openbsd-386), const SYS_MUNLOCK = 204 +pkg syscall (openbsd-386), const SYS_MUNLOCKALL = 272 +pkg syscall (openbsd-386), const SYS_MUNMAP = 73 +pkg syscall (openbsd-386), const SYS_NANOSLEEP = 240 +pkg syscall (openbsd-386), const SYS_NFSSVC = 155 +pkg syscall (openbsd-386), const SYS_OBREAK = 17 +pkg syscall (openbsd-386), const SYS_OPEN = 5 +pkg syscall (openbsd-386), const SYS_OPENAT = 321 +pkg syscall (openbsd-386), const SYS_PATHCONF = 191 +pkg syscall (openbsd-386), const SYS_PIPE = 263 +pkg syscall (openbsd-386), const SYS_POLL = 252 +pkg syscall (openbsd-386), const SYS_PREAD = 173 +pkg syscall (openbsd-386), const SYS_PREADV = 267 +pkg syscall (openbsd-386), const SYS_PROFIL = 44 +pkg syscall (openbsd-386), const SYS_PTRACE = 26 +pkg syscall (openbsd-386), const SYS_PWRITE = 174 +pkg syscall (openbsd-386), const SYS_PWRITEV = 268 +pkg syscall (openbsd-386), const SYS_QUOTACTL = 148 +pkg syscall (openbsd-386), const SYS_READ = 3 +pkg syscall (openbsd-386), const SYS_READLINK = 58 +pkg syscall (openbsd-386), const SYS_READLINKAT = 322 +pkg syscall (openbsd-386), const SYS_READV = 120 +pkg syscall (openbsd-386), const SYS_REBOOT = 55 +pkg syscall (openbsd-386), const SYS_RECVFROM = 29 +pkg syscall (openbsd-386), const SYS_RECVMSG = 27 +pkg syscall (openbsd-386), const SYS_RENAME = 128 +pkg syscall (openbsd-386), const SYS_RENAMEAT = 323 +pkg syscall (openbsd-386), const SYS_REVOKE = 56 +pkg syscall (openbsd-386), const SYS_RMDIR = 137 +pkg syscall (openbsd-386), const SYS_SCHED_YIELD = 298 +pkg syscall (openbsd-386), const SYS_SELECT = 93 +pkg syscall (openbsd-386), const SYS_SEMGET = 221 +pkg syscall (openbsd-386), const SYS_SEMOP = 290 +pkg syscall (openbsd-386), const SYS_SENDMSG = 28 +pkg syscall (openbsd-386), const SYS_SENDTO = 133 +pkg syscall (openbsd-386), const SYS_SETEGID = 182 +pkg syscall (openbsd-386), const SYS_SETEUID = 183 +pkg syscall (openbsd-386), const SYS_SETGID = 181 +pkg syscall (openbsd-386), const SYS_SETGROUPS = 80 +pkg syscall (openbsd-386), const SYS_SETITIMER = 83 +pkg syscall (openbsd-386), const SYS_SETLOGIN = 50 +pkg syscall (openbsd-386), const SYS_SETPGID = 82 +pkg syscall (openbsd-386), const SYS_SETPRIORITY = 96 +pkg syscall (openbsd-386), const SYS_SETREGID = 127 +pkg syscall (openbsd-386), const SYS_SETRESGID = 284 +pkg syscall (openbsd-386), const SYS_SETRESUID = 282 +pkg syscall (openbsd-386), const SYS_SETREUID = 126 +pkg syscall (openbsd-386), const SYS_SETRLIMIT = 195 +pkg syscall (openbsd-386), const SYS_SETRTABLE = 310 +pkg syscall (openbsd-386), const SYS_SETSID = 147 +pkg syscall (openbsd-386), const SYS_SETSOCKOPT = 105 +pkg syscall (openbsd-386), const SYS_SETTIMEOFDAY = 122 +pkg syscall (openbsd-386), const SYS_SETUID = 23 +pkg syscall (openbsd-386), const SYS_SHMAT = 228 +pkg syscall (openbsd-386), const SYS_SHMCTL = 296 +pkg syscall (openbsd-386), const SYS_SHMDT = 230 +pkg syscall (openbsd-386), const SYS_SHMGET = 289 +pkg syscall (openbsd-386), const SYS_SHUTDOWN = 134 +pkg syscall (openbsd-386), const SYS_SIGACTION = 46 +pkg syscall (openbsd-386), const SYS_SIGALTSTACK = 288 +pkg syscall (openbsd-386), const SYS_SIGPENDING = 52 +pkg syscall (openbsd-386), const SYS_SIGPROCMASK = 48 +pkg syscall (openbsd-386), const SYS_SIGRETURN = 103 +pkg syscall (openbsd-386), const SYS_SIGSUSPEND = 111 +pkg syscall (openbsd-386), const SYS_SOCKET = 97 +pkg syscall (openbsd-386), const SYS_SOCKETPAIR = 135 +pkg syscall (openbsd-386), const SYS_STAT = 291 +pkg syscall (openbsd-386), const SYS_STATFS = 307 +pkg syscall (openbsd-386), const SYS_SWAPCTL = 193 +pkg syscall (openbsd-386), const SYS_SYMLINK = 57 +pkg syscall (openbsd-386), const SYS_SYMLINKAT = 324 +pkg syscall (openbsd-386), const SYS_SYNC = 36 +pkg syscall (openbsd-386), const SYS_SYSARCH = 165 +pkg syscall (openbsd-386), const SYS_TRUNCATE = 200 +pkg syscall (openbsd-386), const SYS_UMASK = 60 +pkg syscall (openbsd-386), const SYS_UNLINK = 10 +pkg syscall (openbsd-386), const SYS_UNLINKAT = 325 +pkg syscall (openbsd-386), const SYS_UNMOUNT = 22 +pkg syscall (openbsd-386), const SYS_UTIMENSAT = 326 +pkg syscall (openbsd-386), const SYS_UTIMES = 138 +pkg syscall (openbsd-386), const SYS_VFORK = 66 +pkg syscall (openbsd-386), const SYS_WAIT4 = 7 +pkg syscall (openbsd-386), const SYS_WRITE = 4 +pkg syscall (openbsd-386), const SYS_WRITEV = 121 +pkg syscall (openbsd-386), const SYS___GETCWD = 304 +pkg syscall (openbsd-386), const SYS___GET_TCB = 330 +pkg syscall (openbsd-386), const SYS___SEMCTL = 295 +pkg syscall (openbsd-386), const SYS___SET_TCB = 329 +pkg syscall (openbsd-386), const SYS___SYSCTL = 202 +pkg syscall (openbsd-386), const SYS___TFORK = 8 +pkg syscall (openbsd-386), const SYS___THREXIT = 302 +pkg syscall (openbsd-386), const SYS___THRSIGDIVERT = 303 +pkg syscall (openbsd-386), const SYS___THRSLEEP = 300 +pkg syscall (openbsd-386), const SYS___THRWAKEUP = 301 +pkg syscall (openbsd-386), const S_IFMT = 61440 +pkg syscall (openbsd-386), const SizeofBpfHdr = 20 +pkg syscall (openbsd-386), const SizeofBpfInsn = 8 +pkg syscall (openbsd-386), const SizeofBpfProgram = 8 +pkg syscall (openbsd-386), const SizeofBpfStat = 8 +pkg syscall (openbsd-386), const SizeofBpfVersion = 4 +pkg syscall (openbsd-386), const SizeofCmsghdr = 12 +pkg syscall (openbsd-386), const SizeofIPMreq = 8 +pkg syscall (openbsd-386), const SizeofIPv6Mreq = 20 +pkg syscall (openbsd-386), const SizeofIfAnnounceMsghdr = 26 +pkg syscall (openbsd-386), const SizeofIfData = 208 +pkg syscall (openbsd-386), const SizeofIfMsghdr = 232 +pkg syscall (openbsd-386), const SizeofIfaMsghdr = 24 +pkg syscall (openbsd-386), const SizeofInet6Pktinfo = 20 +pkg syscall (openbsd-386), const SizeofLinger = 8 +pkg syscall (openbsd-386), const SizeofMsghdr = 28 +pkg syscall (openbsd-386), const SizeofRtMetrics = 48 +pkg syscall (openbsd-386), const SizeofRtMsghdr = 88 +pkg syscall (openbsd-386), const SizeofSockaddrAny = 108 +pkg syscall (openbsd-386), const SizeofSockaddrDatalink = 32 +pkg syscall (openbsd-386), const SizeofSockaddrInet4 = 16 +pkg syscall (openbsd-386), const SizeofSockaddrInet6 = 28 +pkg syscall (openbsd-386), const SizeofSockaddrUnix = 106 +pkg syscall (openbsd-386), const TCIFLUSH = 1 +pkg syscall (openbsd-386), const TCIOFLUSH = 3 +pkg syscall (openbsd-386), const TCOFLUSH = 2 +pkg syscall (openbsd-386), const TCP_MAXBURST = 4 +pkg syscall (openbsd-386), const TCP_MAXSEG = 2 +pkg syscall (openbsd-386), const TCP_MAXWIN = 65535 +pkg syscall (openbsd-386), const TCP_MAX_SACK = 3 +pkg syscall (openbsd-386), const TCP_MAX_WINSHIFT = 14 +pkg syscall (openbsd-386), const TCP_MD5SIG = 4 +pkg syscall (openbsd-386), const TCP_MSS = 512 +pkg syscall (openbsd-386), const TCP_NSTATES = 11 +pkg syscall (openbsd-386), const TCP_SACK_ENABLE = 8 +pkg syscall (openbsd-386), const TCSAFLUSH = 2 +pkg syscall (openbsd-386), const TIOCCBRK = 536900730 +pkg syscall (openbsd-386), const TIOCCDTR = 536900728 +pkg syscall (openbsd-386), const TIOCCONS = 2147775586 +pkg syscall (openbsd-386), const TIOCDRAIN = 536900702 +pkg syscall (openbsd-386), const TIOCEXCL = 536900621 +pkg syscall (openbsd-386), const TIOCEXT = 2147775584 +pkg syscall (openbsd-386), const TIOCFLAG_CLOCAL = 2 +pkg syscall (openbsd-386), const TIOCFLAG_CRTSCTS = 4 +pkg syscall (openbsd-386), const TIOCFLAG_MDMBUF = 8 +pkg syscall (openbsd-386), const TIOCFLAG_PPS = 16 +pkg syscall (openbsd-386), const TIOCFLAG_SOFTCAR = 1 +pkg syscall (openbsd-386), const TIOCFLUSH = 2147775504 +pkg syscall (openbsd-386), const TIOCGETA = 1076655123 +pkg syscall (openbsd-386), const TIOCGETD = 1074033690 +pkg syscall (openbsd-386), const TIOCGFLAGS = 1074033757 +pkg syscall (openbsd-386), const TIOCGPGRP = 1074033783 +pkg syscall (openbsd-386), const TIOCGTSTAMP = 1074295899 +pkg syscall (openbsd-386), const TIOCGWINSZ = 1074295912 +pkg syscall (openbsd-386), const TIOCMBIC = 2147775595 +pkg syscall (openbsd-386), const TIOCMBIS = 2147775596 +pkg syscall (openbsd-386), const TIOCMGET = 1074033770 +pkg syscall (openbsd-386), const TIOCMODG = 1074033770 +pkg syscall (openbsd-386), const TIOCMODS = 2147775597 +pkg syscall (openbsd-386), const TIOCMSET = 2147775597 +pkg syscall (openbsd-386), const TIOCM_CAR = 64 +pkg syscall (openbsd-386), const TIOCM_CD = 64 +pkg syscall (openbsd-386), const TIOCM_CTS = 32 +pkg syscall (openbsd-386), const TIOCM_DSR = 256 +pkg syscall (openbsd-386), const TIOCM_DTR = 2 +pkg syscall (openbsd-386), const TIOCM_LE = 1 +pkg syscall (openbsd-386), const TIOCM_RI = 128 +pkg syscall (openbsd-386), const TIOCM_RNG = 128 +pkg syscall (openbsd-386), const TIOCM_RTS = 4 +pkg syscall (openbsd-386), const TIOCM_SR = 16 +pkg syscall (openbsd-386), const TIOCM_ST = 8 +pkg syscall (openbsd-386), const TIOCNOTTY = 536900721 +pkg syscall (openbsd-386), const TIOCNXCL = 536900622 +pkg syscall (openbsd-386), const TIOCOUTQ = 1074033779 +pkg syscall (openbsd-386), const TIOCPKT = 2147775600 +pkg syscall (openbsd-386), const TIOCPKT_DATA = 0 +pkg syscall (openbsd-386), const TIOCPKT_DOSTOP = 32 +pkg syscall (openbsd-386), const TIOCPKT_FLUSHREAD = 1 +pkg syscall (openbsd-386), const TIOCPKT_FLUSHWRITE = 2 +pkg syscall (openbsd-386), const TIOCPKT_IOCTL = 64 +pkg syscall (openbsd-386), const TIOCPKT_NOSTOP = 16 +pkg syscall (openbsd-386), const TIOCPKT_START = 8 +pkg syscall (openbsd-386), const TIOCPKT_STOP = 4 +pkg syscall (openbsd-386), const TIOCREMOTE = 2147775593 +pkg syscall (openbsd-386), const TIOCSBRK = 536900731 +pkg syscall (openbsd-386), const TIOCSCTTY = 536900705 +pkg syscall (openbsd-386), const TIOCSDTR = 536900729 +pkg syscall (openbsd-386), const TIOCSETA = 2150396948 +pkg syscall (openbsd-386), const TIOCSETAF = 2150396950 +pkg syscall (openbsd-386), const TIOCSETAW = 2150396949 +pkg syscall (openbsd-386), const TIOCSETD = 2147775515 +pkg syscall (openbsd-386), const TIOCSFLAGS = 2147775580 +pkg syscall (openbsd-386), const TIOCSIG = 2147775583 +pkg syscall (openbsd-386), const TIOCSPGRP = 2147775606 +pkg syscall (openbsd-386), const TIOCSTART = 536900718 +pkg syscall (openbsd-386), const TIOCSTAT = 2147775589 +pkg syscall (openbsd-386), const TIOCSTI = 2147578994 +pkg syscall (openbsd-386), const TIOCSTOP = 536900719 +pkg syscall (openbsd-386), const TIOCSTSTAMP = 2148037722 +pkg syscall (openbsd-386), const TIOCSWINSZ = 2148037735 +pkg syscall (openbsd-386), const TIOCUCNTL = 2147775590 +pkg syscall (openbsd-386), const TOSTOP = 4194304 +pkg syscall (openbsd-386), const VDISCARD = 15 +pkg syscall (openbsd-386), const VDSUSP = 11 +pkg syscall (openbsd-386), const VEOF = 0 +pkg syscall (openbsd-386), const VEOL = 1 +pkg syscall (openbsd-386), const VEOL2 = 2 +pkg syscall (openbsd-386), const VERASE = 3 +pkg syscall (openbsd-386), const VINTR = 8 +pkg syscall (openbsd-386), const VKILL = 5 +pkg syscall (openbsd-386), const VLNEXT = 14 +pkg syscall (openbsd-386), const VMIN = 16 +pkg syscall (openbsd-386), const VQUIT = 9 +pkg syscall (openbsd-386), const VREPRINT = 6 +pkg syscall (openbsd-386), const VSTART = 12 +pkg syscall (openbsd-386), const VSTATUS = 18 +pkg syscall (openbsd-386), const VSTOP = 13 +pkg syscall (openbsd-386), const VSUSP = 10 +pkg syscall (openbsd-386), const VTIME = 17 +pkg syscall (openbsd-386), const VWERASE = 4 +pkg syscall (openbsd-386), const WALTSIG = 4 +pkg syscall (openbsd-386), const WCONTINUED = 8 +pkg syscall (openbsd-386), const WCOREFLAG = 128 +pkg syscall (openbsd-386), const WNOHANG = 1 +pkg syscall (openbsd-386), const WSTOPPED = 127 +pkg syscall (openbsd-386), const WUNTRACED = 2 +pkg syscall (openbsd-386-cgo), const AF_APPLETALK = 16 +pkg syscall (openbsd-386-cgo), const AF_BLUETOOTH = 32 +pkg syscall (openbsd-386-cgo), const AF_CCITT = 10 +pkg syscall (openbsd-386-cgo), const AF_CHAOS = 5 +pkg syscall (openbsd-386-cgo), const AF_CNT = 21 +pkg syscall (openbsd-386-cgo), const AF_COIP = 20 +pkg syscall (openbsd-386-cgo), const AF_DATAKIT = 9 +pkg syscall (openbsd-386-cgo), const AF_DECnet = 12 +pkg syscall (openbsd-386-cgo), const AF_DLI = 13 +pkg syscall (openbsd-386-cgo), const AF_E164 = 26 +pkg syscall (openbsd-386-cgo), const AF_ECMA = 8 +pkg syscall (openbsd-386-cgo), const AF_ENCAP = 28 +pkg syscall (openbsd-386-cgo), const AF_HYLINK = 15 +pkg syscall (openbsd-386-cgo), const AF_IMPLINK = 3 +pkg syscall (openbsd-386-cgo), const AF_INET6 = 24 +pkg syscall (openbsd-386-cgo), const AF_IPX = 23 +pkg syscall (openbsd-386-cgo), const AF_ISDN = 26 +pkg syscall (openbsd-386-cgo), const AF_ISO = 7 +pkg syscall (openbsd-386-cgo), const AF_KEY = 30 +pkg syscall (openbsd-386-cgo), const AF_LAT = 14 +pkg syscall (openbsd-386-cgo), const AF_LINK = 18 +pkg syscall (openbsd-386-cgo), const AF_LOCAL = 1 +pkg syscall (openbsd-386-cgo), const AF_MAX = 36 +pkg syscall (openbsd-386-cgo), const AF_MPLS = 33 +pkg syscall (openbsd-386-cgo), const AF_NATM = 27 +pkg syscall (openbsd-386-cgo), const AF_NS = 6 +pkg syscall (openbsd-386-cgo), const AF_OSI = 7 +pkg syscall (openbsd-386-cgo), const AF_PUP = 4 +pkg syscall (openbsd-386-cgo), const AF_ROUTE = 17 +pkg syscall (openbsd-386-cgo), const AF_SIP = 29 +pkg syscall (openbsd-386-cgo), const AF_SNA = 11 +pkg syscall (openbsd-386-cgo), const ARPHRD_ETHER = 1 +pkg syscall (openbsd-386-cgo), const ARPHRD_FRELAY = 15 +pkg syscall (openbsd-386-cgo), const ARPHRD_IEEE1394 = 24 +pkg syscall (openbsd-386-cgo), const ARPHRD_IEEE802 = 6 +pkg syscall (openbsd-386-cgo), const B0 = 0 +pkg syscall (openbsd-386-cgo), const B110 = 110 +pkg syscall (openbsd-386-cgo), const B115200 = 115200 +pkg syscall (openbsd-386-cgo), const B1200 = 1200 +pkg syscall (openbsd-386-cgo), const B134 = 134 +pkg syscall (openbsd-386-cgo), const B14400 = 14400 +pkg syscall (openbsd-386-cgo), const B150 = 150 +pkg syscall (openbsd-386-cgo), const B1800 = 1800 +pkg syscall (openbsd-386-cgo), const B19200 = 19200 +pkg syscall (openbsd-386-cgo), const B200 = 200 +pkg syscall (openbsd-386-cgo), const B230400 = 230400 +pkg syscall (openbsd-386-cgo), const B2400 = 2400 +pkg syscall (openbsd-386-cgo), const B28800 = 28800 +pkg syscall (openbsd-386-cgo), const B300 = 300 +pkg syscall (openbsd-386-cgo), const B38400 = 38400 +pkg syscall (openbsd-386-cgo), const B4800 = 4800 +pkg syscall (openbsd-386-cgo), const B50 = 50 +pkg syscall (openbsd-386-cgo), const B57600 = 57600 +pkg syscall (openbsd-386-cgo), const B600 = 600 +pkg syscall (openbsd-386-cgo), const B7200 = 7200 +pkg syscall (openbsd-386-cgo), const B75 = 75 +pkg syscall (openbsd-386-cgo), const B76800 = 76800 +pkg syscall (openbsd-386-cgo), const B9600 = 9600 +pkg syscall (openbsd-386-cgo), const BIOCFLUSH = 536887912 +pkg syscall (openbsd-386-cgo), const BIOCGBLEN = 1074020966 +pkg syscall (openbsd-386-cgo), const BIOCGDIRFILT = 1074020988 +pkg syscall (openbsd-386-cgo), const BIOCGDLT = 1074020970 +pkg syscall (openbsd-386-cgo), const BIOCGDLTLIST = 3221766779 +pkg syscall (openbsd-386-cgo), const BIOCGETIF = 1075855979 +pkg syscall (openbsd-386-cgo), const BIOCGFILDROP = 1074020984 +pkg syscall (openbsd-386-cgo), const BIOCGHDRCMPLT = 1074020980 +pkg syscall (openbsd-386-cgo), const BIOCGRSIG = 1074020979 +pkg syscall (openbsd-386-cgo), const BIOCGRTIMEOUT = 1074283118 +pkg syscall (openbsd-386-cgo), const BIOCGSTATS = 1074283119 +pkg syscall (openbsd-386-cgo), const BIOCIMMEDIATE = 2147762800 +pkg syscall (openbsd-386-cgo), const BIOCLOCK = 536887926 +pkg syscall (openbsd-386-cgo), const BIOCPROMISC = 536887913 +pkg syscall (openbsd-386-cgo), const BIOCSBLEN = 3221504614 +pkg syscall (openbsd-386-cgo), const BIOCSDIRFILT = 2147762813 +pkg syscall (openbsd-386-cgo), const BIOCSDLT = 2147762810 +pkg syscall (openbsd-386-cgo), const BIOCSETF = 2148024935 +pkg syscall (openbsd-386-cgo), const BIOCSETIF = 2149597804 +pkg syscall (openbsd-386-cgo), const BIOCSETWF = 2148024951 +pkg syscall (openbsd-386-cgo), const BIOCSFILDROP = 2147762809 +pkg syscall (openbsd-386-cgo), const BIOCSHDRCMPLT = 2147762805 +pkg syscall (openbsd-386-cgo), const BIOCSRSIG = 2147762802 +pkg syscall (openbsd-386-cgo), const BIOCSRTIMEOUT = 2148024941 +pkg syscall (openbsd-386-cgo), const BIOCVERSION = 1074020977 +pkg syscall (openbsd-386-cgo), const BPF_A = 16 +pkg syscall (openbsd-386-cgo), const BPF_ABS = 32 +pkg syscall (openbsd-386-cgo), const BPF_ADD = 0 +pkg syscall (openbsd-386-cgo), const BPF_ALIGNMENT = 4 +pkg syscall (openbsd-386-cgo), const BPF_ALU = 4 +pkg syscall (openbsd-386-cgo), const BPF_AND = 80 +pkg syscall (openbsd-386-cgo), const BPF_B = 16 +pkg syscall (openbsd-386-cgo), const BPF_DIRECTION_IN = 1 +pkg syscall (openbsd-386-cgo), const BPF_DIRECTION_OUT = 2 +pkg syscall (openbsd-386-cgo), const BPF_DIV = 48 +pkg syscall (openbsd-386-cgo), const BPF_H = 8 +pkg syscall (openbsd-386-cgo), const BPF_IMM = 0 +pkg syscall (openbsd-386-cgo), const BPF_IND = 64 +pkg syscall (openbsd-386-cgo), const BPF_JA = 0 +pkg syscall (openbsd-386-cgo), const BPF_JEQ = 16 +pkg syscall (openbsd-386-cgo), const BPF_JGE = 48 +pkg syscall (openbsd-386-cgo), const BPF_JGT = 32 +pkg syscall (openbsd-386-cgo), const BPF_JMP = 5 +pkg syscall (openbsd-386-cgo), const BPF_JSET = 64 +pkg syscall (openbsd-386-cgo), const BPF_K = 0 +pkg syscall (openbsd-386-cgo), const BPF_LD = 0 +pkg syscall (openbsd-386-cgo), const BPF_LDX = 1 +pkg syscall (openbsd-386-cgo), const BPF_LEN = 128 +pkg syscall (openbsd-386-cgo), const BPF_LSH = 96 +pkg syscall (openbsd-386-cgo), const BPF_MAJOR_VERSION = 1 +pkg syscall (openbsd-386-cgo), const BPF_MAXBUFSIZE = 2097152 +pkg syscall (openbsd-386-cgo), const BPF_MAXINSNS = 512 +pkg syscall (openbsd-386-cgo), const BPF_MEM = 96 +pkg syscall (openbsd-386-cgo), const BPF_MEMWORDS = 16 +pkg syscall (openbsd-386-cgo), const BPF_MINBUFSIZE = 32 +pkg syscall (openbsd-386-cgo), const BPF_MINOR_VERSION = 1 +pkg syscall (openbsd-386-cgo), const BPF_MISC = 7 +pkg syscall (openbsd-386-cgo), const BPF_MSH = 160 +pkg syscall (openbsd-386-cgo), const BPF_MUL = 32 +pkg syscall (openbsd-386-cgo), const BPF_NEG = 128 +pkg syscall (openbsd-386-cgo), const BPF_OR = 64 +pkg syscall (openbsd-386-cgo), const BPF_RELEASE = 199606 +pkg syscall (openbsd-386-cgo), const BPF_RET = 6 +pkg syscall (openbsd-386-cgo), const BPF_RSH = 112 +pkg syscall (openbsd-386-cgo), const BPF_ST = 2 +pkg syscall (openbsd-386-cgo), const BPF_STX = 3 +pkg syscall (openbsd-386-cgo), const BPF_SUB = 16 +pkg syscall (openbsd-386-cgo), const BPF_TAX = 0 +pkg syscall (openbsd-386-cgo), const BPF_TXA = 128 +pkg syscall (openbsd-386-cgo), const BPF_W = 0 +pkg syscall (openbsd-386-cgo), const BPF_X = 8 +pkg syscall (openbsd-386-cgo), const BRKINT = 2 +pkg syscall (openbsd-386-cgo), const CFLUSH = 15 +pkg syscall (openbsd-386-cgo), const CLOCAL = 32768 +pkg syscall (openbsd-386-cgo), const CREAD = 2048 +pkg syscall (openbsd-386-cgo), const CS5 = 0 +pkg syscall (openbsd-386-cgo), const CS6 = 256 +pkg syscall (openbsd-386-cgo), const CS7 = 512 +pkg syscall (openbsd-386-cgo), const CS8 = 768 +pkg syscall (openbsd-386-cgo), const CSIZE = 768 +pkg syscall (openbsd-386-cgo), const CSTART = 17 +pkg syscall (openbsd-386-cgo), const CSTATUS = 255 +pkg syscall (openbsd-386-cgo), const CSTOP = 19 +pkg syscall (openbsd-386-cgo), const CSTOPB = 1024 +pkg syscall (openbsd-386-cgo), const CSUSP = 26 +pkg syscall (openbsd-386-cgo), const CTL_MAXNAME = 12 +pkg syscall (openbsd-386-cgo), const CTL_NET = 4 +pkg syscall (openbsd-386-cgo), const DIOCOSFPFLUSH = 536888398 +pkg syscall (openbsd-386-cgo), const DLT_ARCNET = 7 +pkg syscall (openbsd-386-cgo), const DLT_ATM_RFC1483 = 11 +pkg syscall (openbsd-386-cgo), const DLT_AX25 = 3 +pkg syscall (openbsd-386-cgo), const DLT_CHAOS = 5 +pkg syscall (openbsd-386-cgo), const DLT_C_HDLC = 104 +pkg syscall (openbsd-386-cgo), const DLT_EN10MB = 1 +pkg syscall (openbsd-386-cgo), const DLT_EN3MB = 2 +pkg syscall (openbsd-386-cgo), const DLT_ENC = 13 +pkg syscall (openbsd-386-cgo), const DLT_FDDI = 10 +pkg syscall (openbsd-386-cgo), const DLT_IEEE802 = 6 +pkg syscall (openbsd-386-cgo), const DLT_IEEE802_11 = 105 +pkg syscall (openbsd-386-cgo), const DLT_IEEE802_11_RADIO = 127 +pkg syscall (openbsd-386-cgo), const DLT_LOOP = 12 +pkg syscall (openbsd-386-cgo), const DLT_MPLS = 219 +pkg syscall (openbsd-386-cgo), const DLT_NULL = 0 +pkg syscall (openbsd-386-cgo), const DLT_PFLOG = 117 +pkg syscall (openbsd-386-cgo), const DLT_PFSYNC = 18 +pkg syscall (openbsd-386-cgo), const DLT_PPP = 9 +pkg syscall (openbsd-386-cgo), const DLT_PPP_BSDOS = 16 +pkg syscall (openbsd-386-cgo), const DLT_PPP_ETHER = 51 +pkg syscall (openbsd-386-cgo), const DLT_PPP_SERIAL = 50 +pkg syscall (openbsd-386-cgo), const DLT_PRONET = 4 +pkg syscall (openbsd-386-cgo), const DLT_RAW = 14 +pkg syscall (openbsd-386-cgo), const DLT_SLIP = 8 +pkg syscall (openbsd-386-cgo), const DLT_SLIP_BSDOS = 15 +pkg syscall (openbsd-386-cgo), const DT_BLK = 6 +pkg syscall (openbsd-386-cgo), const DT_CHR = 2 +pkg syscall (openbsd-386-cgo), const DT_DIR = 4 +pkg syscall (openbsd-386-cgo), const DT_FIFO = 1 +pkg syscall (openbsd-386-cgo), const DT_LNK = 10 +pkg syscall (openbsd-386-cgo), const DT_REG = 8 +pkg syscall (openbsd-386-cgo), const DT_SOCK = 12 +pkg syscall (openbsd-386-cgo), const DT_UNKNOWN = 0 +pkg syscall (openbsd-386-cgo), const E2BIG = 7 +pkg syscall (openbsd-386-cgo), const EACCES = 13 +pkg syscall (openbsd-386-cgo), const EADDRINUSE = 48 +pkg syscall (openbsd-386-cgo), const EADDRNOTAVAIL = 49 +pkg syscall (openbsd-386-cgo), const EAFNOSUPPORT = 47 +pkg syscall (openbsd-386-cgo), const EAGAIN = 35 +pkg syscall (openbsd-386-cgo), const EALREADY = 37 +pkg syscall (openbsd-386-cgo), const EAUTH = 80 +pkg syscall (openbsd-386-cgo), const EBADF = 9 +pkg syscall (openbsd-386-cgo), const EBADRPC = 72 +pkg syscall (openbsd-386-cgo), const EBUSY = 16 +pkg syscall (openbsd-386-cgo), const ECANCELED = 88 +pkg syscall (openbsd-386-cgo), const ECHILD = 10 +pkg syscall (openbsd-386-cgo), const ECHO = 8 +pkg syscall (openbsd-386-cgo), const ECHOCTL = 64 +pkg syscall (openbsd-386-cgo), const ECHOE = 2 +pkg syscall (openbsd-386-cgo), const ECHOK = 4 +pkg syscall (openbsd-386-cgo), const ECHOKE = 1 +pkg syscall (openbsd-386-cgo), const ECHONL = 16 +pkg syscall (openbsd-386-cgo), const ECHOPRT = 32 +pkg syscall (openbsd-386-cgo), const ECONNABORTED = 53 +pkg syscall (openbsd-386-cgo), const ECONNREFUSED = 61 +pkg syscall (openbsd-386-cgo), const ECONNRESET = 54 +pkg syscall (openbsd-386-cgo), const EDEADLK = 11 +pkg syscall (openbsd-386-cgo), const EDESTADDRREQ = 39 +pkg syscall (openbsd-386-cgo), const EDOM = 33 +pkg syscall (openbsd-386-cgo), const EDQUOT = 69 +pkg syscall (openbsd-386-cgo), const EEXIST = 17 +pkg syscall (openbsd-386-cgo), const EFAULT = 14 +pkg syscall (openbsd-386-cgo), const EFBIG = 27 +pkg syscall (openbsd-386-cgo), const EFTYPE = 79 +pkg syscall (openbsd-386-cgo), const EHOSTDOWN = 64 +pkg syscall (openbsd-386-cgo), const EHOSTUNREACH = 65 +pkg syscall (openbsd-386-cgo), const EIDRM = 89 +pkg syscall (openbsd-386-cgo), const EILSEQ = 84 +pkg syscall (openbsd-386-cgo), const EINPROGRESS = 36 +pkg syscall (openbsd-386-cgo), const EINTR = 4 +pkg syscall (openbsd-386-cgo), const EINVAL = 22 +pkg syscall (openbsd-386-cgo), const EIO = 5 +pkg syscall (openbsd-386-cgo), const EIPSEC = 82 +pkg syscall (openbsd-386-cgo), const EISCONN = 56 +pkg syscall (openbsd-386-cgo), const EISDIR = 21 +pkg syscall (openbsd-386-cgo), const ELAST = 91 +pkg syscall (openbsd-386-cgo), const ELOOP = 62 +pkg syscall (openbsd-386-cgo), const EMEDIUMTYPE = 86 +pkg syscall (openbsd-386-cgo), const EMFILE = 24 +pkg syscall (openbsd-386-cgo), const EMLINK = 31 +pkg syscall (openbsd-386-cgo), const EMSGSIZE = 40 +pkg syscall (openbsd-386-cgo), const EMT_TAGOVF = 1 +pkg syscall (openbsd-386-cgo), const EMUL_ENABLED = 1 +pkg syscall (openbsd-386-cgo), const EMUL_NATIVE = 2 +pkg syscall (openbsd-386-cgo), const ENAMETOOLONG = 63 +pkg syscall (openbsd-386-cgo), const ENDRUNDISC = 9 +pkg syscall (openbsd-386-cgo), const ENEEDAUTH = 81 +pkg syscall (openbsd-386-cgo), const ENETDOWN = 50 +pkg syscall (openbsd-386-cgo), const ENETRESET = 52 +pkg syscall (openbsd-386-cgo), const ENETUNREACH = 51 +pkg syscall (openbsd-386-cgo), const ENFILE = 23 +pkg syscall (openbsd-386-cgo), const ENOATTR = 83 +pkg syscall (openbsd-386-cgo), const ENOBUFS = 55 +pkg syscall (openbsd-386-cgo), const ENODEV = 19 +pkg syscall (openbsd-386-cgo), const ENOEXEC = 8 +pkg syscall (openbsd-386-cgo), const ENOLCK = 77 +pkg syscall (openbsd-386-cgo), const ENOMEDIUM = 85 +pkg syscall (openbsd-386-cgo), const ENOMEM = 12 +pkg syscall (openbsd-386-cgo), const ENOMSG = 90 +pkg syscall (openbsd-386-cgo), const ENOPROTOOPT = 42 +pkg syscall (openbsd-386-cgo), const ENOSPC = 28 +pkg syscall (openbsd-386-cgo), const ENOSYS = 78 +pkg syscall (openbsd-386-cgo), const ENOTBLK = 15 +pkg syscall (openbsd-386-cgo), const ENOTCONN = 57 +pkg syscall (openbsd-386-cgo), const ENOTDIR = 20 +pkg syscall (openbsd-386-cgo), const ENOTEMPTY = 66 +pkg syscall (openbsd-386-cgo), const ENOTSOCK = 38 +pkg syscall (openbsd-386-cgo), const ENOTSUP = 91 +pkg syscall (openbsd-386-cgo), const ENOTTY = 25 +pkg syscall (openbsd-386-cgo), const ENXIO = 6 +pkg syscall (openbsd-386-cgo), const EOPNOTSUPP = 45 +pkg syscall (openbsd-386-cgo), const EOVERFLOW = 87 +pkg syscall (openbsd-386-cgo), const EPERM = 1 +pkg syscall (openbsd-386-cgo), const EPFNOSUPPORT = 46 +pkg syscall (openbsd-386-cgo), const EPIPE = 32 +pkg syscall (openbsd-386-cgo), const EPROCLIM = 67 +pkg syscall (openbsd-386-cgo), const EPROCUNAVAIL = 76 +pkg syscall (openbsd-386-cgo), const EPROGMISMATCH = 75 +pkg syscall (openbsd-386-cgo), const EPROGUNAVAIL = 74 +pkg syscall (openbsd-386-cgo), const EPROTONOSUPPORT = 43 +pkg syscall (openbsd-386-cgo), const EPROTOTYPE = 41 +pkg syscall (openbsd-386-cgo), const ERANGE = 34 +pkg syscall (openbsd-386-cgo), const EREMOTE = 71 +pkg syscall (openbsd-386-cgo), const EROFS = 30 +pkg syscall (openbsd-386-cgo), const ERPCMISMATCH = 73 +pkg syscall (openbsd-386-cgo), const ESHUTDOWN = 58 +pkg syscall (openbsd-386-cgo), const ESOCKTNOSUPPORT = 44 +pkg syscall (openbsd-386-cgo), const ESPIPE = 29 +pkg syscall (openbsd-386-cgo), const ESRCH = 3 +pkg syscall (openbsd-386-cgo), const ESTALE = 70 +pkg syscall (openbsd-386-cgo), const ETHERMIN = 46 +pkg syscall (openbsd-386-cgo), const ETHERMTU = 1500 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_8023 = 4 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_AARP = 33011 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_ACCTON = 33680 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_AEONIC = 32822 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_ALPHA = 33098 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_AMBER = 24584 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_AMOEBA = 33093 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_AOE = 34978 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_APOLLO = 33015 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_APOLLODOMAIN = 32793 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_APPLETALK = 32923 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_APPLITEK = 32967 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_ARGONAUT = 32826 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_ARP = 2054 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_AT = 32923 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_ATALK = 32923 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_ATOMIC = 34527 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_ATT = 32873 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_ATTSTANFORD = 32776 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_AUTOPHON = 32874 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_AXIS = 34902 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_BCLOOP = 36867 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_BOFL = 33026 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_CABLETRON = 28724 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_CHAOS = 2052 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_COMDESIGN = 32876 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_COMPUGRAPHIC = 32877 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_COUNTERPOINT = 32866 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_CRONUS = 32772 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_CRONUSVLN = 32771 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_DCA = 4660 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_DDE = 32891 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_DEBNI = 43690 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_DECAM = 32840 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_DECCUST = 24582 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_DECDIAG = 24581 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_DECDNS = 32828 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_DECDTS = 32830 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_DECEXPER = 24576 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_DECLAST = 32833 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_DECLTM = 32831 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_DECMUMPS = 24585 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_DECNETBIOS = 32832 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_DELTACON = 34526 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_DIDDLE = 17185 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_DLOG1 = 1632 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_DLOG2 = 1633 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_DN = 24579 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_DOGFIGHT = 6537 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_DSMD = 32825 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_ECMA = 2051 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_ENCRYPT = 32829 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_ES = 32861 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_EXCELAN = 32784 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_EXPERDATA = 32841 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_FLIP = 33094 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_FLOWCONTROL = 34824 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_FRARP = 2056 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_GENDYN = 32872 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_HAYES = 33072 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_HIPPI_FP = 33152 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_HITACHI = 34848 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_HP = 32773 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_IEEEPUP = 2560 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_IEEEPUPAT = 2561 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_IMLBL = 19522 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_IMLBLDIAG = 16972 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_IP = 2048 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_IPAS = 34668 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_IPV6 = 34525 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_IPX = 33079 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_IPXNEW = 32823 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_KALPANA = 34178 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_LANBRIDGE = 32824 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_LANPROBE = 34952 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_LAT = 24580 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_LBACK = 36864 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_LITTLE = 32864 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_LLDP = 35020 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_LOGICRAFT = 33096 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_LOOPBACK = 36864 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_MATRA = 32890 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_MAX = 65535 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_MERIT = 32892 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_MICP = 34618 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_MOPDL = 24577 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_MOPRC = 24578 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_MOTOROLA = 33165 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_MPLS = 34887 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_MPLS_MCAST = 34888 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_MUMPS = 33087 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_NBPCC = 15364 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_NBPCLAIM = 15369 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_NBPCLREQ = 15365 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_NBPCLRSP = 15366 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_NBPCREQ = 15362 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_NBPCRSP = 15363 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_NBPDG = 15367 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_NBPDGB = 15368 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_NBPDLTE = 15370 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_NBPRAR = 15372 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_NBPRAS = 15371 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_NBPRST = 15373 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_NBPSCD = 15361 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_NBPVCD = 15360 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_NBS = 2050 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_NCD = 33097 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_NESTAR = 32774 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_NETBEUI = 33169 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_NOVELL = 33080 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_NS = 1536 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_NSAT = 1537 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_NSCOMPAT = 2055 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_NTRAILER = 16 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_OS9 = 28679 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_OS9NET = 28681 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_PACER = 32966 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_PAE = 34958 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_PCS = 16962 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_PLANNING = 32836 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_PPP = 34827 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_PPPOE = 34916 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_PPPOEDISC = 34915 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_PRIMENTS = 28721 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_PUP = 512 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_PUPAT = 512 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_QINQ = 34984 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_RACAL = 28720 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_RATIONAL = 33104 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_RAWFR = 25945 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_RCL = 6549 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_RDP = 34617 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_RETIX = 33010 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_REVARP = 32821 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_SCA = 24583 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_SECTRA = 34523 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_SECUREDATA = 34669 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_SGITW = 33150 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_SG_BOUNCE = 32790 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_SG_DIAG = 32787 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_SG_NETGAMES = 32788 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_SG_RESV = 32789 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_SIMNET = 21000 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_SLOW = 34825 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_SNA = 32981 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_SNMP = 33100 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_SONIX = 64245 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_SPIDER = 32927 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_SPRITE = 1280 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_STP = 33153 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_TALARIS = 33067 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_TALARISMC = 34091 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_TCPCOMP = 34667 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_TCPSM = 36866 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_TEC = 33103 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_TIGAN = 32815 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_TRAIL = 4096 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_TRANSETHER = 25944 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_TYMSHARE = 32814 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_UBBST = 28677 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_UBDEBUG = 2304 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_UBDIAGLOOP = 28674 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_UBDL = 28672 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_UBNIU = 28673 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_UBNMC = 28675 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_VALID = 5632 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_VARIAN = 32989 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_VAXELN = 32827 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_VEECO = 32871 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_VEXP = 32859 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_VGLAB = 33073 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_VINES = 2989 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_VINESECHO = 2991 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_VINESLOOP = 2990 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_VITAL = 65280 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_VLAN = 33024 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_VLTLMAN = 32896 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_VPROD = 32860 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_VURESERVED = 33095 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_WATERLOO = 33072 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_WELLFLEET = 33027 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_X25 = 2053 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_X75 = 2049 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_XNSSM = 36865 +pkg syscall (openbsd-386-cgo), const ETHERTYPE_XTP = 33149 +pkg syscall (openbsd-386-cgo), const ETHER_ADDR_LEN = 6 +pkg syscall (openbsd-386-cgo), const ETHER_ALIGN = 2 +pkg syscall (openbsd-386-cgo), const ETHER_CRC_LEN = 4 +pkg syscall (openbsd-386-cgo), const ETHER_CRC_POLY_BE = 79764918 +pkg syscall (openbsd-386-cgo), const ETHER_CRC_POLY_LE = 3988292384 +pkg syscall (openbsd-386-cgo), const ETHER_HDR_LEN = 14 +pkg syscall (openbsd-386-cgo), const ETHER_MAX_DIX_LEN = 1536 +pkg syscall (openbsd-386-cgo), const ETHER_MAX_LEN = 1518 +pkg syscall (openbsd-386-cgo), const ETHER_MIN_LEN = 64 +pkg syscall (openbsd-386-cgo), const ETHER_TYPE_LEN = 2 +pkg syscall (openbsd-386-cgo), const ETHER_VLAN_ENCAP_LEN = 4 +pkg syscall (openbsd-386-cgo), const ETIMEDOUT = 60 +pkg syscall (openbsd-386-cgo), const ETOOMANYREFS = 59 +pkg syscall (openbsd-386-cgo), const ETXTBSY = 26 +pkg syscall (openbsd-386-cgo), const EUSERS = 68 +pkg syscall (openbsd-386-cgo), const EVFILT_AIO = -3 +pkg syscall (openbsd-386-cgo), const EVFILT_PROC = -5 +pkg syscall (openbsd-386-cgo), const EVFILT_READ = -1 +pkg syscall (openbsd-386-cgo), const EVFILT_SIGNAL = -6 +pkg syscall (openbsd-386-cgo), const EVFILT_SYSCOUNT = 7 +pkg syscall (openbsd-386-cgo), const EVFILT_TIMER = -7 +pkg syscall (openbsd-386-cgo), const EVFILT_VNODE = -4 +pkg syscall (openbsd-386-cgo), const EVFILT_WRITE = -2 +pkg syscall (openbsd-386-cgo), const EV_ADD = 1 +pkg syscall (openbsd-386-cgo), const EV_CLEAR = 32 +pkg syscall (openbsd-386-cgo), const EV_DELETE = 2 +pkg syscall (openbsd-386-cgo), const EV_DISABLE = 8 +pkg syscall (openbsd-386-cgo), const EV_ENABLE = 4 +pkg syscall (openbsd-386-cgo), const EV_EOF = 32768 +pkg syscall (openbsd-386-cgo), const EV_ERROR = 16384 +pkg syscall (openbsd-386-cgo), const EV_FLAG1 = 8192 +pkg syscall (openbsd-386-cgo), const EV_ONESHOT = 16 +pkg syscall (openbsd-386-cgo), const EV_SYSFLAGS = 61440 +pkg syscall (openbsd-386-cgo), const EWOULDBLOCK = 35 +pkg syscall (openbsd-386-cgo), const EXDEV = 18 +pkg syscall (openbsd-386-cgo), const EXTA = 19200 +pkg syscall (openbsd-386-cgo), const EXTB = 38400 +pkg syscall (openbsd-386-cgo), const EXTPROC = 2048 +pkg syscall (openbsd-386-cgo), const FD_CLOEXEC = 1 +pkg syscall (openbsd-386-cgo), const FD_SETSIZE = 1024 +pkg syscall (openbsd-386-cgo), const FLUSHO = 8388608 +pkg syscall (openbsd-386-cgo), const F_DUPFD = 0 +pkg syscall (openbsd-386-cgo), const F_DUPFD_CLOEXEC = 10 +pkg syscall (openbsd-386-cgo), const F_GETFD = 1 +pkg syscall (openbsd-386-cgo), const F_GETFL = 3 +pkg syscall (openbsd-386-cgo), const F_GETLK = 7 +pkg syscall (openbsd-386-cgo), const F_GETOWN = 5 +pkg syscall (openbsd-386-cgo), const F_OK = 0 +pkg syscall (openbsd-386-cgo), const F_RDLCK = 1 +pkg syscall (openbsd-386-cgo), const F_SETFD = 2 +pkg syscall (openbsd-386-cgo), const F_SETFL = 4 +pkg syscall (openbsd-386-cgo), const F_SETLK = 8 +pkg syscall (openbsd-386-cgo), const F_SETLKW = 9 +pkg syscall (openbsd-386-cgo), const F_SETOWN = 6 +pkg syscall (openbsd-386-cgo), const F_UNLCK = 2 +pkg syscall (openbsd-386-cgo), const F_WRLCK = 3 +pkg syscall (openbsd-386-cgo), const HUPCL = 16384 +pkg syscall (openbsd-386-cgo), const ICANON = 256 +pkg syscall (openbsd-386-cgo), const ICRNL = 256 +pkg syscall (openbsd-386-cgo), const IEXTEN = 1024 +pkg syscall (openbsd-386-cgo), const IFAN_ARRIVAL = 0 +pkg syscall (openbsd-386-cgo), const IFAN_DEPARTURE = 1 +pkg syscall (openbsd-386-cgo), const IFA_ROUTE = 1 +pkg syscall (openbsd-386-cgo), const IFF_ALLMULTI = 512 +pkg syscall (openbsd-386-cgo), const IFF_CANTCHANGE = 36434 +pkg syscall (openbsd-386-cgo), const IFF_DEBUG = 4 +pkg syscall (openbsd-386-cgo), const IFF_LINK0 = 4096 +pkg syscall (openbsd-386-cgo), const IFF_LINK1 = 8192 +pkg syscall (openbsd-386-cgo), const IFF_LINK2 = 16384 +pkg syscall (openbsd-386-cgo), const IFF_LOOPBACK = 8 +pkg syscall (openbsd-386-cgo), const IFF_MULTICAST = 32768 +pkg syscall (openbsd-386-cgo), const IFF_NOARP = 128 +pkg syscall (openbsd-386-cgo), const IFF_NOTRAILERS = 32 +pkg syscall (openbsd-386-cgo), const IFF_OACTIVE = 1024 +pkg syscall (openbsd-386-cgo), const IFF_POINTOPOINT = 16 +pkg syscall (openbsd-386-cgo), const IFF_PROMISC = 256 +pkg syscall (openbsd-386-cgo), const IFF_RUNNING = 64 +pkg syscall (openbsd-386-cgo), const IFF_SIMPLEX = 2048 +pkg syscall (openbsd-386-cgo), const IFNAMSIZ = 16 +pkg syscall (openbsd-386-cgo), const IFT_1822 = 2 +pkg syscall (openbsd-386-cgo), const IFT_A12MPPSWITCH = 130 +pkg syscall (openbsd-386-cgo), const IFT_AAL2 = 187 +pkg syscall (openbsd-386-cgo), const IFT_AAL5 = 49 +pkg syscall (openbsd-386-cgo), const IFT_ADSL = 94 +pkg syscall (openbsd-386-cgo), const IFT_AFLANE8023 = 59 +pkg syscall (openbsd-386-cgo), const IFT_AFLANE8025 = 60 +pkg syscall (openbsd-386-cgo), const IFT_ARAP = 88 +pkg syscall (openbsd-386-cgo), const IFT_ARCNET = 35 +pkg syscall (openbsd-386-cgo), const IFT_ARCNETPLUS = 36 +pkg syscall (openbsd-386-cgo), const IFT_ASYNC = 84 +pkg syscall (openbsd-386-cgo), const IFT_ATM = 37 +pkg syscall (openbsd-386-cgo), const IFT_ATMDXI = 105 +pkg syscall (openbsd-386-cgo), const IFT_ATMFUNI = 106 +pkg syscall (openbsd-386-cgo), const IFT_ATMIMA = 107 +pkg syscall (openbsd-386-cgo), const IFT_ATMLOGICAL = 80 +pkg syscall (openbsd-386-cgo), const IFT_ATMRADIO = 189 +pkg syscall (openbsd-386-cgo), const IFT_ATMSUBINTERFACE = 134 +pkg syscall (openbsd-386-cgo), const IFT_ATMVCIENDPT = 194 +pkg syscall (openbsd-386-cgo), const IFT_ATMVIRTUAL = 149 +pkg syscall (openbsd-386-cgo), const IFT_BGPPOLICYACCOUNTING = 162 +pkg syscall (openbsd-386-cgo), const IFT_BLUETOOTH = 248 +pkg syscall (openbsd-386-cgo), const IFT_BRIDGE = 209 +pkg syscall (openbsd-386-cgo), const IFT_BSC = 83 +pkg syscall (openbsd-386-cgo), const IFT_CARP = 247 +pkg syscall (openbsd-386-cgo), const IFT_CCTEMUL = 61 +pkg syscall (openbsd-386-cgo), const IFT_CEPT = 19 +pkg syscall (openbsd-386-cgo), const IFT_CES = 133 +pkg syscall (openbsd-386-cgo), const IFT_CHANNEL = 70 +pkg syscall (openbsd-386-cgo), const IFT_CNR = 85 +pkg syscall (openbsd-386-cgo), const IFT_COFFEE = 132 +pkg syscall (openbsd-386-cgo), const IFT_COMPOSITELINK = 155 +pkg syscall (openbsd-386-cgo), const IFT_DCN = 141 +pkg syscall (openbsd-386-cgo), const IFT_DIGITALPOWERLINE = 138 +pkg syscall (openbsd-386-cgo), const IFT_DIGITALWRAPPEROVERHEADCHANNEL = 186 +pkg syscall (openbsd-386-cgo), const IFT_DLSW = 74 +pkg syscall (openbsd-386-cgo), const IFT_DOCSCABLEDOWNSTREAM = 128 +pkg syscall (openbsd-386-cgo), const IFT_DOCSCABLEMACLAYER = 127 +pkg syscall (openbsd-386-cgo), const IFT_DOCSCABLEUPSTREAM = 129 +pkg syscall (openbsd-386-cgo), const IFT_DOCSCABLEUPSTREAMCHANNEL = 205 +pkg syscall (openbsd-386-cgo), const IFT_DS0 = 81 +pkg syscall (openbsd-386-cgo), const IFT_DS0BUNDLE = 82 +pkg syscall (openbsd-386-cgo), const IFT_DS1FDL = 170 +pkg syscall (openbsd-386-cgo), const IFT_DS3 = 30 +pkg syscall (openbsd-386-cgo), const IFT_DTM = 140 +pkg syscall (openbsd-386-cgo), const IFT_DUMMY = 241 +pkg syscall (openbsd-386-cgo), const IFT_DVBASILN = 172 +pkg syscall (openbsd-386-cgo), const IFT_DVBASIOUT = 173 +pkg syscall (openbsd-386-cgo), const IFT_DVBRCCDOWNSTREAM = 147 +pkg syscall (openbsd-386-cgo), const IFT_DVBRCCMACLAYER = 146 +pkg syscall (openbsd-386-cgo), const IFT_DVBRCCUPSTREAM = 148 +pkg syscall (openbsd-386-cgo), const IFT_ECONET = 206 +pkg syscall (openbsd-386-cgo), const IFT_ENC = 244 +pkg syscall (openbsd-386-cgo), const IFT_EON = 25 +pkg syscall (openbsd-386-cgo), const IFT_EPLRS = 87 +pkg syscall (openbsd-386-cgo), const IFT_ESCON = 73 +pkg syscall (openbsd-386-cgo), const IFT_ETHER = 6 +pkg syscall (openbsd-386-cgo), const IFT_FAITH = 243 +pkg syscall (openbsd-386-cgo), const IFT_FAST = 125 +pkg syscall (openbsd-386-cgo), const IFT_FASTETHER = 62 +pkg syscall (openbsd-386-cgo), const IFT_FASTETHERFX = 69 +pkg syscall (openbsd-386-cgo), const IFT_FDDI = 15 +pkg syscall (openbsd-386-cgo), const IFT_FIBRECHANNEL = 56 +pkg syscall (openbsd-386-cgo), const IFT_FRAMERELAYINTERCONNECT = 58 +pkg syscall (openbsd-386-cgo), const IFT_FRAMERELAYMPI = 92 +pkg syscall (openbsd-386-cgo), const IFT_FRDLCIENDPT = 193 +pkg syscall (openbsd-386-cgo), const IFT_FRELAY = 32 +pkg syscall (openbsd-386-cgo), const IFT_FRELAYDCE = 44 +pkg syscall (openbsd-386-cgo), const IFT_FRF16MFRBUNDLE = 163 +pkg syscall (openbsd-386-cgo), const IFT_FRFORWARD = 158 +pkg syscall (openbsd-386-cgo), const IFT_G703AT2MB = 67 +pkg syscall (openbsd-386-cgo), const IFT_G703AT64K = 66 +pkg syscall (openbsd-386-cgo), const IFT_GIF = 240 +pkg syscall (openbsd-386-cgo), const IFT_GIGABITETHERNET = 117 +pkg syscall (openbsd-386-cgo), const IFT_GR303IDT = 178 +pkg syscall (openbsd-386-cgo), const IFT_GR303RDT = 177 +pkg syscall (openbsd-386-cgo), const IFT_H323GATEKEEPER = 164 +pkg syscall (openbsd-386-cgo), const IFT_H323PROXY = 165 +pkg syscall (openbsd-386-cgo), const IFT_HDH1822 = 3 +pkg syscall (openbsd-386-cgo), const IFT_HDLC = 118 +pkg syscall (openbsd-386-cgo), const IFT_HDSL2 = 168 +pkg syscall (openbsd-386-cgo), const IFT_HIPERLAN2 = 183 +pkg syscall (openbsd-386-cgo), const IFT_HIPPI = 47 +pkg syscall (openbsd-386-cgo), const IFT_HIPPIINTERFACE = 57 +pkg syscall (openbsd-386-cgo), const IFT_HOSTPAD = 90 +pkg syscall (openbsd-386-cgo), const IFT_HSSI = 46 +pkg syscall (openbsd-386-cgo), const IFT_HY = 14 +pkg syscall (openbsd-386-cgo), const IFT_IBM370PARCHAN = 72 +pkg syscall (openbsd-386-cgo), const IFT_IDSL = 154 +pkg syscall (openbsd-386-cgo), const IFT_IEEE1394 = 144 +pkg syscall (openbsd-386-cgo), const IFT_IEEE80211 = 71 +pkg syscall (openbsd-386-cgo), const IFT_IEEE80212 = 55 +pkg syscall (openbsd-386-cgo), const IFT_IEEE8023ADLAG = 161 +pkg syscall (openbsd-386-cgo), const IFT_IFGSN = 145 +pkg syscall (openbsd-386-cgo), const IFT_IMT = 190 +pkg syscall (openbsd-386-cgo), const IFT_INFINIBAND = 199 +pkg syscall (openbsd-386-cgo), const IFT_INTERLEAVE = 124 +pkg syscall (openbsd-386-cgo), const IFT_IP = 126 +pkg syscall (openbsd-386-cgo), const IFT_IPFORWARD = 142 +pkg syscall (openbsd-386-cgo), const IFT_IPOVERATM = 114 +pkg syscall (openbsd-386-cgo), const IFT_IPOVERCDLC = 109 +pkg syscall (openbsd-386-cgo), const IFT_IPOVERCLAW = 110 +pkg syscall (openbsd-386-cgo), const IFT_IPSWITCH = 78 +pkg syscall (openbsd-386-cgo), const IFT_ISDN = 63 +pkg syscall (openbsd-386-cgo), const IFT_ISDNBASIC = 20 +pkg syscall (openbsd-386-cgo), const IFT_ISDNPRIMARY = 21 +pkg syscall (openbsd-386-cgo), const IFT_ISDNS = 75 +pkg syscall (openbsd-386-cgo), const IFT_ISDNU = 76 +pkg syscall (openbsd-386-cgo), const IFT_ISO88022LLC = 41 +pkg syscall (openbsd-386-cgo), const IFT_ISO88023 = 7 +pkg syscall (openbsd-386-cgo), const IFT_ISO88024 = 8 +pkg syscall (openbsd-386-cgo), const IFT_ISO88025 = 9 +pkg syscall (openbsd-386-cgo), const IFT_ISO88025CRFPINT = 98 +pkg syscall (openbsd-386-cgo), const IFT_ISO88025DTR = 86 +pkg syscall (openbsd-386-cgo), const IFT_ISO88025FIBER = 115 +pkg syscall (openbsd-386-cgo), const IFT_ISO88026 = 10 +pkg syscall (openbsd-386-cgo), const IFT_ISUP = 179 +pkg syscall (openbsd-386-cgo), const IFT_L2VLAN = 135 +pkg syscall (openbsd-386-cgo), const IFT_L3IPVLAN = 136 +pkg syscall (openbsd-386-cgo), const IFT_L3IPXVLAN = 137 +pkg syscall (openbsd-386-cgo), const IFT_LAPB = 16 +pkg syscall (openbsd-386-cgo), const IFT_LAPD = 77 +pkg syscall (openbsd-386-cgo), const IFT_LAPF = 119 +pkg syscall (openbsd-386-cgo), const IFT_LINEGROUP = 210 +pkg syscall (openbsd-386-cgo), const IFT_LOCALTALK = 42 +pkg syscall (openbsd-386-cgo), const IFT_LOOP = 24 +pkg syscall (openbsd-386-cgo), const IFT_MEDIAMAILOVERIP = 139 +pkg syscall (openbsd-386-cgo), const IFT_MFSIGLINK = 167 +pkg syscall (openbsd-386-cgo), const IFT_MIOX25 = 38 +pkg syscall (openbsd-386-cgo), const IFT_MODEM = 48 +pkg syscall (openbsd-386-cgo), const IFT_MPC = 113 +pkg syscall (openbsd-386-cgo), const IFT_MPLS = 166 +pkg syscall (openbsd-386-cgo), const IFT_MPLSTUNNEL = 150 +pkg syscall (openbsd-386-cgo), const IFT_MSDSL = 143 +pkg syscall (openbsd-386-cgo), const IFT_MVL = 191 +pkg syscall (openbsd-386-cgo), const IFT_MYRINET = 99 +pkg syscall (openbsd-386-cgo), const IFT_NFAS = 175 +pkg syscall (openbsd-386-cgo), const IFT_NSIP = 27 +pkg syscall (openbsd-386-cgo), const IFT_OPTICALCHANNEL = 195 +pkg syscall (openbsd-386-cgo), const IFT_OPTICALTRANSPORT = 196 +pkg syscall (openbsd-386-cgo), const IFT_OTHER = 1 +pkg syscall (openbsd-386-cgo), const IFT_P10 = 12 +pkg syscall (openbsd-386-cgo), const IFT_P80 = 13 +pkg syscall (openbsd-386-cgo), const IFT_PARA = 34 +pkg syscall (openbsd-386-cgo), const IFT_PFLOG = 245 +pkg syscall (openbsd-386-cgo), const IFT_PFLOW = 249 +pkg syscall (openbsd-386-cgo), const IFT_PFSYNC = 246 +pkg syscall (openbsd-386-cgo), const IFT_PLC = 174 +pkg syscall (openbsd-386-cgo), const IFT_PON155 = 207 +pkg syscall (openbsd-386-cgo), const IFT_PON622 = 208 +pkg syscall (openbsd-386-cgo), const IFT_POS = 171 +pkg syscall (openbsd-386-cgo), const IFT_PPP = 23 +pkg syscall (openbsd-386-cgo), const IFT_PPPMULTILINKBUNDLE = 108 +pkg syscall (openbsd-386-cgo), const IFT_PROPATM = 197 +pkg syscall (openbsd-386-cgo), const IFT_PROPBWAP2MP = 184 +pkg syscall (openbsd-386-cgo), const IFT_PROPCNLS = 89 +pkg syscall (openbsd-386-cgo), const IFT_PROPDOCSWIRELESSDOWNSTREAM = 181 +pkg syscall (openbsd-386-cgo), const IFT_PROPDOCSWIRELESSMACLAYER = 180 +pkg syscall (openbsd-386-cgo), const IFT_PROPDOCSWIRELESSUPSTREAM = 182 +pkg syscall (openbsd-386-cgo), const IFT_PROPMUX = 54 +pkg syscall (openbsd-386-cgo), const IFT_PROPVIRTUAL = 53 +pkg syscall (openbsd-386-cgo), const IFT_PROPWIRELESSP2P = 157 +pkg syscall (openbsd-386-cgo), const IFT_PTPSERIAL = 22 +pkg syscall (openbsd-386-cgo), const IFT_PVC = 242 +pkg syscall (openbsd-386-cgo), const IFT_Q2931 = 201 +pkg syscall (openbsd-386-cgo), const IFT_QLLC = 68 +pkg syscall (openbsd-386-cgo), const IFT_RADIOMAC = 188 +pkg syscall (openbsd-386-cgo), const IFT_RADSL = 95 +pkg syscall (openbsd-386-cgo), const IFT_REACHDSL = 192 +pkg syscall (openbsd-386-cgo), const IFT_RFC1483 = 159 +pkg syscall (openbsd-386-cgo), const IFT_RS232 = 33 +pkg syscall (openbsd-386-cgo), const IFT_RSRB = 79 +pkg syscall (openbsd-386-cgo), const IFT_SDLC = 17 +pkg syscall (openbsd-386-cgo), const IFT_SDSL = 96 +pkg syscall (openbsd-386-cgo), const IFT_SHDSL = 169 +pkg syscall (openbsd-386-cgo), const IFT_SIP = 31 +pkg syscall (openbsd-386-cgo), const IFT_SIPSIG = 204 +pkg syscall (openbsd-386-cgo), const IFT_SIPTG = 203 +pkg syscall (openbsd-386-cgo), const IFT_SLIP = 28 +pkg syscall (openbsd-386-cgo), const IFT_SMDSDXI = 43 +pkg syscall (openbsd-386-cgo), const IFT_SMDSICIP = 52 +pkg syscall (openbsd-386-cgo), const IFT_SONET = 39 +pkg syscall (openbsd-386-cgo), const IFT_SONETOVERHEADCHANNEL = 185 +pkg syscall (openbsd-386-cgo), const IFT_SONETPATH = 50 +pkg syscall (openbsd-386-cgo), const IFT_SONETVT = 51 +pkg syscall (openbsd-386-cgo), const IFT_SRP = 151 +pkg syscall (openbsd-386-cgo), const IFT_SS7SIGLINK = 156 +pkg syscall (openbsd-386-cgo), const IFT_STACKTOSTACK = 111 +pkg syscall (openbsd-386-cgo), const IFT_STARLAN = 11 +pkg syscall (openbsd-386-cgo), const IFT_T1 = 18 +pkg syscall (openbsd-386-cgo), const IFT_TDLC = 116 +pkg syscall (openbsd-386-cgo), const IFT_TELINK = 200 +pkg syscall (openbsd-386-cgo), const IFT_TERMPAD = 91 +pkg syscall (openbsd-386-cgo), const IFT_TR008 = 176 +pkg syscall (openbsd-386-cgo), const IFT_TRANSPHDLC = 123 +pkg syscall (openbsd-386-cgo), const IFT_TUNNEL = 131 +pkg syscall (openbsd-386-cgo), const IFT_ULTRA = 29 +pkg syscall (openbsd-386-cgo), const IFT_USB = 160 +pkg syscall (openbsd-386-cgo), const IFT_V11 = 64 +pkg syscall (openbsd-386-cgo), const IFT_V35 = 45 +pkg syscall (openbsd-386-cgo), const IFT_V36 = 65 +pkg syscall (openbsd-386-cgo), const IFT_V37 = 120 +pkg syscall (openbsd-386-cgo), const IFT_VDSL = 97 +pkg syscall (openbsd-386-cgo), const IFT_VIRTUALIPADDRESS = 112 +pkg syscall (openbsd-386-cgo), const IFT_VIRTUALTG = 202 +pkg syscall (openbsd-386-cgo), const IFT_VOICEDID = 213 +pkg syscall (openbsd-386-cgo), const IFT_VOICEEM = 100 +pkg syscall (openbsd-386-cgo), const IFT_VOICEEMFGD = 211 +pkg syscall (openbsd-386-cgo), const IFT_VOICEENCAP = 103 +pkg syscall (openbsd-386-cgo), const IFT_VOICEFGDEANA = 212 +pkg syscall (openbsd-386-cgo), const IFT_VOICEFXO = 101 +pkg syscall (openbsd-386-cgo), const IFT_VOICEFXS = 102 +pkg syscall (openbsd-386-cgo), const IFT_VOICEOVERATM = 152 +pkg syscall (openbsd-386-cgo), const IFT_VOICEOVERCABLE = 198 +pkg syscall (openbsd-386-cgo), const IFT_VOICEOVERFRAMERELAY = 153 +pkg syscall (openbsd-386-cgo), const IFT_VOICEOVERIP = 104 +pkg syscall (openbsd-386-cgo), const IFT_X213 = 93 +pkg syscall (openbsd-386-cgo), const IFT_X25 = 5 +pkg syscall (openbsd-386-cgo), const IFT_X25DDN = 4 +pkg syscall (openbsd-386-cgo), const IFT_X25HUNTGROUP = 122 +pkg syscall (openbsd-386-cgo), const IFT_X25MLP = 121 +pkg syscall (openbsd-386-cgo), const IFT_X25PLE = 40 +pkg syscall (openbsd-386-cgo), const IFT_XETHER = 26 +pkg syscall (openbsd-386-cgo), const IGNBRK = 1 +pkg syscall (openbsd-386-cgo), const IGNCR = 128 +pkg syscall (openbsd-386-cgo), const IGNPAR = 4 +pkg syscall (openbsd-386-cgo), const IMAXBEL = 8192 +pkg syscall (openbsd-386-cgo), const INLCR = 64 +pkg syscall (openbsd-386-cgo), const INPCK = 16 +pkg syscall (openbsd-386-cgo), const IN_CLASSA_HOST = 16777215 +pkg syscall (openbsd-386-cgo), const IN_CLASSA_MAX = 128 +pkg syscall (openbsd-386-cgo), const IN_CLASSA_NET = 4278190080 +pkg syscall (openbsd-386-cgo), const IN_CLASSA_NSHIFT = 24 +pkg syscall (openbsd-386-cgo), const IN_CLASSB_HOST = 65535 +pkg syscall (openbsd-386-cgo), const IN_CLASSB_MAX = 65536 +pkg syscall (openbsd-386-cgo), const IN_CLASSB_NET = 4294901760 +pkg syscall (openbsd-386-cgo), const IN_CLASSB_NSHIFT = 16 +pkg syscall (openbsd-386-cgo), const IN_CLASSC_HOST = 255 +pkg syscall (openbsd-386-cgo), const IN_CLASSC_NET = 4294967040 +pkg syscall (openbsd-386-cgo), const IN_CLASSC_NSHIFT = 8 +pkg syscall (openbsd-386-cgo), const IN_CLASSD_HOST = 268435455 +pkg syscall (openbsd-386-cgo), const IN_CLASSD_NET = 4026531840 +pkg syscall (openbsd-386-cgo), const IN_CLASSD_NSHIFT = 28 +pkg syscall (openbsd-386-cgo), const IN_LOOPBACKNET = 127 +pkg syscall (openbsd-386-cgo), const IN_RFC3021_HOST = 1 +pkg syscall (openbsd-386-cgo), const IN_RFC3021_NET = 4294967294 +pkg syscall (openbsd-386-cgo), const IN_RFC3021_NSHIFT = 31 +pkg syscall (openbsd-386-cgo), const IPPROTO_AH = 51 +pkg syscall (openbsd-386-cgo), const IPPROTO_CARP = 112 +pkg syscall (openbsd-386-cgo), const IPPROTO_DIVERT = 258 +pkg syscall (openbsd-386-cgo), const IPPROTO_DONE = 257 +pkg syscall (openbsd-386-cgo), const IPPROTO_DSTOPTS = 60 +pkg syscall (openbsd-386-cgo), const IPPROTO_EGP = 8 +pkg syscall (openbsd-386-cgo), const IPPROTO_ENCAP = 98 +pkg syscall (openbsd-386-cgo), const IPPROTO_EON = 80 +pkg syscall (openbsd-386-cgo), const IPPROTO_ESP = 50 +pkg syscall (openbsd-386-cgo), const IPPROTO_ETHERIP = 97 +pkg syscall (openbsd-386-cgo), const IPPROTO_FRAGMENT = 44 +pkg syscall (openbsd-386-cgo), const IPPROTO_GGP = 3 +pkg syscall (openbsd-386-cgo), const IPPROTO_GRE = 47 +pkg syscall (openbsd-386-cgo), const IPPROTO_HOPOPTS = 0 +pkg syscall (openbsd-386-cgo), const IPPROTO_ICMP = 1 +pkg syscall (openbsd-386-cgo), const IPPROTO_ICMPV6 = 58 +pkg syscall (openbsd-386-cgo), const IPPROTO_IDP = 22 +pkg syscall (openbsd-386-cgo), const IPPROTO_IGMP = 2 +pkg syscall (openbsd-386-cgo), const IPPROTO_IPCOMP = 108 +pkg syscall (openbsd-386-cgo), const IPPROTO_IPIP = 4 +pkg syscall (openbsd-386-cgo), const IPPROTO_IPV4 = 4 +pkg syscall (openbsd-386-cgo), const IPPROTO_MAX = 256 +pkg syscall (openbsd-386-cgo), const IPPROTO_MAXID = 259 +pkg syscall (openbsd-386-cgo), const IPPROTO_MOBILE = 55 +pkg syscall (openbsd-386-cgo), const IPPROTO_MPLS = 137 +pkg syscall (openbsd-386-cgo), const IPPROTO_NONE = 59 +pkg syscall (openbsd-386-cgo), const IPPROTO_PFSYNC = 240 +pkg syscall (openbsd-386-cgo), const IPPROTO_PIM = 103 +pkg syscall (openbsd-386-cgo), const IPPROTO_PUP = 12 +pkg syscall (openbsd-386-cgo), const IPPROTO_RAW = 255 +pkg syscall (openbsd-386-cgo), const IPPROTO_ROUTING = 43 +pkg syscall (openbsd-386-cgo), const IPPROTO_RSVP = 46 +pkg syscall (openbsd-386-cgo), const IPPROTO_TP = 29 +pkg syscall (openbsd-386-cgo), const IPV6_AUTH_LEVEL = 53 +pkg syscall (openbsd-386-cgo), const IPV6_AUTOFLOWLABEL = 59 +pkg syscall (openbsd-386-cgo), const IPV6_CHECKSUM = 26 +pkg syscall (openbsd-386-cgo), const IPV6_DEFAULT_MULTICAST_HOPS = 1 +pkg syscall (openbsd-386-cgo), const IPV6_DEFAULT_MULTICAST_LOOP = 1 +pkg syscall (openbsd-386-cgo), const IPV6_DEFHLIM = 64 +pkg syscall (openbsd-386-cgo), const IPV6_DONTFRAG = 62 +pkg syscall (openbsd-386-cgo), const IPV6_DSTOPTS = 50 +pkg syscall (openbsd-386-cgo), const IPV6_ESP_NETWORK_LEVEL = 55 +pkg syscall (openbsd-386-cgo), const IPV6_ESP_TRANS_LEVEL = 54 +pkg syscall (openbsd-386-cgo), const IPV6_FAITH = 29 +pkg syscall (openbsd-386-cgo), const IPV6_FLOWINFO_MASK = 4294967055 +pkg syscall (openbsd-386-cgo), const IPV6_FLOWLABEL_MASK = 4294905600 +pkg syscall (openbsd-386-cgo), const IPV6_FRAGTTL = 120 +pkg syscall (openbsd-386-cgo), const IPV6_HLIMDEC = 1 +pkg syscall (openbsd-386-cgo), const IPV6_HOPLIMIT = 47 +pkg syscall (openbsd-386-cgo), const IPV6_HOPOPTS = 49 +pkg syscall (openbsd-386-cgo), const IPV6_IPCOMP_LEVEL = 60 +pkg syscall (openbsd-386-cgo), const IPV6_JOIN_GROUP = 12 +pkg syscall (openbsd-386-cgo), const IPV6_LEAVE_GROUP = 13 +pkg syscall (openbsd-386-cgo), const IPV6_MAXHLIM = 255 +pkg syscall (openbsd-386-cgo), const IPV6_MAXPACKET = 65535 +pkg syscall (openbsd-386-cgo), const IPV6_MMTU = 1280 +pkg syscall (openbsd-386-cgo), const IPV6_MULTICAST_HOPS = 10 +pkg syscall (openbsd-386-cgo), const IPV6_MULTICAST_IF = 9 +pkg syscall (openbsd-386-cgo), const IPV6_MULTICAST_LOOP = 11 +pkg syscall (openbsd-386-cgo), const IPV6_NEXTHOP = 48 +pkg syscall (openbsd-386-cgo), const IPV6_OPTIONS = 1 +pkg syscall (openbsd-386-cgo), const IPV6_PATHMTU = 44 +pkg syscall (openbsd-386-cgo), const IPV6_PIPEX = 63 +pkg syscall (openbsd-386-cgo), const IPV6_PKTINFO = 46 +pkg syscall (openbsd-386-cgo), const IPV6_PORTRANGE = 14 +pkg syscall (openbsd-386-cgo), const IPV6_PORTRANGE_DEFAULT = 0 +pkg syscall (openbsd-386-cgo), const IPV6_PORTRANGE_HIGH = 1 +pkg syscall (openbsd-386-cgo), const IPV6_PORTRANGE_LOW = 2 +pkg syscall (openbsd-386-cgo), const IPV6_RECVDSTOPTS = 40 +pkg syscall (openbsd-386-cgo), const IPV6_RECVHOPLIMIT = 37 +pkg syscall (openbsd-386-cgo), const IPV6_RECVHOPOPTS = 39 +pkg syscall (openbsd-386-cgo), const IPV6_RECVPATHMTU = 43 +pkg syscall (openbsd-386-cgo), const IPV6_RECVPKTINFO = 36 +pkg syscall (openbsd-386-cgo), const IPV6_RECVRTHDR = 38 +pkg syscall (openbsd-386-cgo), const IPV6_RECVTCLASS = 57 +pkg syscall (openbsd-386-cgo), const IPV6_RTABLE = 4129 +pkg syscall (openbsd-386-cgo), const IPV6_RTHDR = 51 +pkg syscall (openbsd-386-cgo), const IPV6_RTHDRDSTOPTS = 35 +pkg syscall (openbsd-386-cgo), const IPV6_RTHDR_LOOSE = 0 +pkg syscall (openbsd-386-cgo), const IPV6_RTHDR_STRICT = 1 +pkg syscall (openbsd-386-cgo), const IPV6_RTHDR_TYPE_0 = 0 +pkg syscall (openbsd-386-cgo), const IPV6_SOCKOPT_RESERVED1 = 3 +pkg syscall (openbsd-386-cgo), const IPV6_TCLASS = 61 +pkg syscall (openbsd-386-cgo), const IPV6_UNICAST_HOPS = 4 +pkg syscall (openbsd-386-cgo), const IPV6_USE_MIN_MTU = 42 +pkg syscall (openbsd-386-cgo), const IPV6_V6ONLY = 27 +pkg syscall (openbsd-386-cgo), const IPV6_VERSION = 96 +pkg syscall (openbsd-386-cgo), const IPV6_VERSION_MASK = 240 +pkg syscall (openbsd-386-cgo), const IP_ADD_MEMBERSHIP = 12 +pkg syscall (openbsd-386-cgo), const IP_AUTH_LEVEL = 20 +pkg syscall (openbsd-386-cgo), const IP_DEFAULT_MULTICAST_LOOP = 1 +pkg syscall (openbsd-386-cgo), const IP_DEFAULT_MULTICAST_TTL = 1 +pkg syscall (openbsd-386-cgo), const IP_DF = 16384 +pkg syscall (openbsd-386-cgo), const IP_DROP_MEMBERSHIP = 13 +pkg syscall (openbsd-386-cgo), const IP_ESP_NETWORK_LEVEL = 22 +pkg syscall (openbsd-386-cgo), const IP_ESP_TRANS_LEVEL = 21 +pkg syscall (openbsd-386-cgo), const IP_HDRINCL = 2 +pkg syscall (openbsd-386-cgo), const IP_IPCOMP_LEVEL = 29 +pkg syscall (openbsd-386-cgo), const IP_IPSECFLOWINFO = 36 +pkg syscall (openbsd-386-cgo), const IP_IPSEC_LOCAL_AUTH = 27 +pkg syscall (openbsd-386-cgo), const IP_IPSEC_LOCAL_CRED = 25 +pkg syscall (openbsd-386-cgo), const IP_IPSEC_LOCAL_ID = 23 +pkg syscall (openbsd-386-cgo), const IP_IPSEC_REMOTE_AUTH = 28 +pkg syscall (openbsd-386-cgo), const IP_IPSEC_REMOTE_CRED = 26 +pkg syscall (openbsd-386-cgo), const IP_IPSEC_REMOTE_ID = 24 +pkg syscall (openbsd-386-cgo), const IP_MAXPACKET = 65535 +pkg syscall (openbsd-386-cgo), const IP_MAX_MEMBERSHIPS = 4095 +pkg syscall (openbsd-386-cgo), const IP_MF = 8192 +pkg syscall (openbsd-386-cgo), const IP_MINTTL = 32 +pkg syscall (openbsd-386-cgo), const IP_MIN_MEMBERSHIPS = 15 +pkg syscall (openbsd-386-cgo), const IP_MSS = 576 +pkg syscall (openbsd-386-cgo), const IP_MULTICAST_IF = 9 +pkg syscall (openbsd-386-cgo), const IP_MULTICAST_LOOP = 11 +pkg syscall (openbsd-386-cgo), const IP_MULTICAST_TTL = 10 +pkg syscall (openbsd-386-cgo), const IP_OFFMASK = 8191 +pkg syscall (openbsd-386-cgo), const IP_OPTIONS = 1 +pkg syscall (openbsd-386-cgo), const IP_PIPEX = 34 +pkg syscall (openbsd-386-cgo), const IP_PORTRANGE = 19 +pkg syscall (openbsd-386-cgo), const IP_PORTRANGE_DEFAULT = 0 +pkg syscall (openbsd-386-cgo), const IP_PORTRANGE_HIGH = 1 +pkg syscall (openbsd-386-cgo), const IP_PORTRANGE_LOW = 2 +pkg syscall (openbsd-386-cgo), const IP_RECVDSTADDR = 7 +pkg syscall (openbsd-386-cgo), const IP_RECVDSTPORT = 33 +pkg syscall (openbsd-386-cgo), const IP_RECVIF = 30 +pkg syscall (openbsd-386-cgo), const IP_RECVOPTS = 5 +pkg syscall (openbsd-386-cgo), const IP_RECVRETOPTS = 6 +pkg syscall (openbsd-386-cgo), const IP_RECVRTABLE = 35 +pkg syscall (openbsd-386-cgo), const IP_RECVTTL = 31 +pkg syscall (openbsd-386-cgo), const IP_RETOPTS = 8 +pkg syscall (openbsd-386-cgo), const IP_RF = 32768 +pkg syscall (openbsd-386-cgo), const IP_RTABLE = 4129 +pkg syscall (openbsd-386-cgo), const IP_TOS = 3 +pkg syscall (openbsd-386-cgo), const IP_TTL = 4 +pkg syscall (openbsd-386-cgo), const ISIG = 128 +pkg syscall (openbsd-386-cgo), const ISTRIP = 32 +pkg syscall (openbsd-386-cgo), const IXANY = 2048 +pkg syscall (openbsd-386-cgo), const IXOFF = 1024 +pkg syscall (openbsd-386-cgo), const IXON = 512 +pkg syscall (openbsd-386-cgo), const ImplementsGetwd = false +pkg syscall (openbsd-386-cgo), const LCNT_OVERLOAD_FLUSH = 6 +pkg syscall (openbsd-386-cgo), const LOCK_EX = 2 +pkg syscall (openbsd-386-cgo), const LOCK_NB = 4 +pkg syscall (openbsd-386-cgo), const LOCK_SH = 1 +pkg syscall (openbsd-386-cgo), const LOCK_UN = 8 +pkg syscall (openbsd-386-cgo), const MSG_BCAST = 256 +pkg syscall (openbsd-386-cgo), const MSG_CTRUNC = 32 +pkg syscall (openbsd-386-cgo), const MSG_DONTROUTE = 4 +pkg syscall (openbsd-386-cgo), const MSG_DONTWAIT = 128 +pkg syscall (openbsd-386-cgo), const MSG_EOR = 8 +pkg syscall (openbsd-386-cgo), const MSG_MCAST = 512 +pkg syscall (openbsd-386-cgo), const MSG_NOSIGNAL = 1024 +pkg syscall (openbsd-386-cgo), const MSG_OOB = 1 +pkg syscall (openbsd-386-cgo), const MSG_PEEK = 2 +pkg syscall (openbsd-386-cgo), const MSG_TRUNC = 16 +pkg syscall (openbsd-386-cgo), const MSG_WAITALL = 64 +pkg syscall (openbsd-386-cgo), const NAME_MAX = 255 +pkg syscall (openbsd-386-cgo), const NET_RT_DUMP = 1 +pkg syscall (openbsd-386-cgo), const NET_RT_FLAGS = 2 +pkg syscall (openbsd-386-cgo), const NET_RT_IFLIST = 3 +pkg syscall (openbsd-386-cgo), const NET_RT_MAXID = 6 +pkg syscall (openbsd-386-cgo), const NET_RT_STATS = 4 +pkg syscall (openbsd-386-cgo), const NET_RT_TABLE = 5 +pkg syscall (openbsd-386-cgo), const NOFLSH = 2147483648 +pkg syscall (openbsd-386-cgo), const NOTE_ATTRIB = 8 +pkg syscall (openbsd-386-cgo), const NOTE_CHILD = 4 +pkg syscall (openbsd-386-cgo), const NOTE_DELETE = 1 +pkg syscall (openbsd-386-cgo), const NOTE_EOF = 2 +pkg syscall (openbsd-386-cgo), const NOTE_EXEC = 536870912 +pkg syscall (openbsd-386-cgo), const NOTE_EXIT = 2147483648 +pkg syscall (openbsd-386-cgo), const NOTE_EXTEND = 4 +pkg syscall (openbsd-386-cgo), const NOTE_FORK = 1073741824 +pkg syscall (openbsd-386-cgo), const NOTE_LINK = 16 +pkg syscall (openbsd-386-cgo), const NOTE_LOWAT = 1 +pkg syscall (openbsd-386-cgo), const NOTE_PCTRLMASK = 4026531840 +pkg syscall (openbsd-386-cgo), const NOTE_PDATAMASK = 1048575 +pkg syscall (openbsd-386-cgo), const NOTE_RENAME = 32 +pkg syscall (openbsd-386-cgo), const NOTE_REVOKE = 64 +pkg syscall (openbsd-386-cgo), const NOTE_TRACK = 1 +pkg syscall (openbsd-386-cgo), const NOTE_TRACKERR = 2 +pkg syscall (openbsd-386-cgo), const NOTE_TRUNCATE = 128 +pkg syscall (openbsd-386-cgo), const NOTE_WRITE = 2 +pkg syscall (openbsd-386-cgo), const OCRNL = 16 +pkg syscall (openbsd-386-cgo), const ONLCR = 2 +pkg syscall (openbsd-386-cgo), const ONLRET = 128 +pkg syscall (openbsd-386-cgo), const ONOCR = 64 +pkg syscall (openbsd-386-cgo), const ONOEOT = 8 +pkg syscall (openbsd-386-cgo), const OPOST = 1 +pkg syscall (openbsd-386-cgo), const O_ACCMODE = 3 +pkg syscall (openbsd-386-cgo), const O_APPEND = 8 +pkg syscall (openbsd-386-cgo), const O_ASYNC = 64 +pkg syscall (openbsd-386-cgo), const O_CLOEXEC = 65536 +pkg syscall (openbsd-386-cgo), const O_CREAT = 512 +pkg syscall (openbsd-386-cgo), const O_DIRECTORY = 131072 +pkg syscall (openbsd-386-cgo), const O_DSYNC = 128 +pkg syscall (openbsd-386-cgo), const O_EXCL = 2048 +pkg syscall (openbsd-386-cgo), const O_EXLOCK = 32 +pkg syscall (openbsd-386-cgo), const O_FSYNC = 128 +pkg syscall (openbsd-386-cgo), const O_NDELAY = 4 +pkg syscall (openbsd-386-cgo), const O_NOCTTY = 32768 +pkg syscall (openbsd-386-cgo), const O_NOFOLLOW = 256 +pkg syscall (openbsd-386-cgo), const O_NONBLOCK = 4 +pkg syscall (openbsd-386-cgo), const O_RSYNC = 128 +pkg syscall (openbsd-386-cgo), const O_SHLOCK = 16 +pkg syscall (openbsd-386-cgo), const O_SYNC = 128 +pkg syscall (openbsd-386-cgo), const O_TRUNC = 1024 +pkg syscall (openbsd-386-cgo), const PARENB = 4096 +pkg syscall (openbsd-386-cgo), const PARMRK = 8 +pkg syscall (openbsd-386-cgo), const PARODD = 8192 +pkg syscall (openbsd-386-cgo), const PENDIN = 536870912 +pkg syscall (openbsd-386-cgo), const PF_FLUSH = 1 +pkg syscall (openbsd-386-cgo), const PTRACE_CONT = 7 +pkg syscall (openbsd-386-cgo), const PTRACE_KILL = 8 +pkg syscall (openbsd-386-cgo), const PTRACE_TRACEME = 0 +pkg syscall (openbsd-386-cgo), const PT_MASK = 4190208 +pkg syscall (openbsd-386-cgo), const RLIMIT_CORE = 4 +pkg syscall (openbsd-386-cgo), const RLIMIT_CPU = 0 +pkg syscall (openbsd-386-cgo), const RLIMIT_DATA = 2 +pkg syscall (openbsd-386-cgo), const RLIMIT_FSIZE = 1 +pkg syscall (openbsd-386-cgo), const RLIMIT_NOFILE = 8 +pkg syscall (openbsd-386-cgo), const RLIMIT_STACK = 3 +pkg syscall (openbsd-386-cgo), const RLIM_INFINITY = 9223372036854775807 +pkg syscall (openbsd-386-cgo), const RTAX_AUTHOR = 6 +pkg syscall (openbsd-386-cgo), const RTAX_BRD = 7 +pkg syscall (openbsd-386-cgo), const RTAX_DST = 0 +pkg syscall (openbsd-386-cgo), const RTAX_GATEWAY = 1 +pkg syscall (openbsd-386-cgo), const RTAX_GENMASK = 3 +pkg syscall (openbsd-386-cgo), const RTAX_IFA = 5 +pkg syscall (openbsd-386-cgo), const RTAX_IFP = 4 +pkg syscall (openbsd-386-cgo), const RTAX_LABEL = 10 +pkg syscall (openbsd-386-cgo), const RTAX_MAX = 11 +pkg syscall (openbsd-386-cgo), const RTAX_NETMASK = 2 +pkg syscall (openbsd-386-cgo), const RTAX_SRC = 8 +pkg syscall (openbsd-386-cgo), const RTAX_SRCMASK = 9 +pkg syscall (openbsd-386-cgo), const RTA_AUTHOR = 64 +pkg syscall (openbsd-386-cgo), const RTA_BRD = 128 +pkg syscall (openbsd-386-cgo), const RTA_DST = 1 +pkg syscall (openbsd-386-cgo), const RTA_GATEWAY = 2 +pkg syscall (openbsd-386-cgo), const RTA_GENMASK = 8 +pkg syscall (openbsd-386-cgo), const RTA_IFA = 32 +pkg syscall (openbsd-386-cgo), const RTA_IFP = 16 +pkg syscall (openbsd-386-cgo), const RTA_LABEL = 1024 +pkg syscall (openbsd-386-cgo), const RTA_NETMASK = 4 +pkg syscall (openbsd-386-cgo), const RTA_SRC = 256 +pkg syscall (openbsd-386-cgo), const RTA_SRCMASK = 512 +pkg syscall (openbsd-386-cgo), const RTF_ANNOUNCE = 16384 +pkg syscall (openbsd-386-cgo), const RTF_BLACKHOLE = 4096 +pkg syscall (openbsd-386-cgo), const RTF_CLONED = 65536 +pkg syscall (openbsd-386-cgo), const RTF_CLONING = 256 +pkg syscall (openbsd-386-cgo), const RTF_DONE = 64 +pkg syscall (openbsd-386-cgo), const RTF_DYNAMIC = 16 +pkg syscall (openbsd-386-cgo), const RTF_FMASK = 63496 +pkg syscall (openbsd-386-cgo), const RTF_GATEWAY = 2 +pkg syscall (openbsd-386-cgo), const RTF_HOST = 4 +pkg syscall (openbsd-386-cgo), const RTF_LLINFO = 1024 +pkg syscall (openbsd-386-cgo), const RTF_MASK = 128 +pkg syscall (openbsd-386-cgo), const RTF_MODIFIED = 32 +pkg syscall (openbsd-386-cgo), const RTF_MPATH = 262144 +pkg syscall (openbsd-386-cgo), const RTF_MPLS = 1048576 +pkg syscall (openbsd-386-cgo), const RTF_PERMANENT_ARP = 8192 +pkg syscall (openbsd-386-cgo), const RTF_PROTO1 = 32768 +pkg syscall (openbsd-386-cgo), const RTF_PROTO2 = 16384 +pkg syscall (openbsd-386-cgo), const RTF_PROTO3 = 8192 +pkg syscall (openbsd-386-cgo), const RTF_REJECT = 8 +pkg syscall (openbsd-386-cgo), const RTF_SOURCE = 131072 +pkg syscall (openbsd-386-cgo), const RTF_STATIC = 2048 +pkg syscall (openbsd-386-cgo), const RTF_TUNNEL = 1048576 +pkg syscall (openbsd-386-cgo), const RTF_UP = 1 +pkg syscall (openbsd-386-cgo), const RTF_USETRAILERS = 32768 +pkg syscall (openbsd-386-cgo), const RTF_XRESOLVE = 512 +pkg syscall (openbsd-386-cgo), const RTM_ADD = 1 +pkg syscall (openbsd-386-cgo), const RTM_CHANGE = 3 +pkg syscall (openbsd-386-cgo), const RTM_DELADDR = 13 +pkg syscall (openbsd-386-cgo), const RTM_DELETE = 2 +pkg syscall (openbsd-386-cgo), const RTM_DESYNC = 16 +pkg syscall (openbsd-386-cgo), const RTM_GET = 4 +pkg syscall (openbsd-386-cgo), const RTM_IFANNOUNCE = 15 +pkg syscall (openbsd-386-cgo), const RTM_IFINFO = 14 +pkg syscall (openbsd-386-cgo), const RTM_LOCK = 8 +pkg syscall (openbsd-386-cgo), const RTM_LOSING = 5 +pkg syscall (openbsd-386-cgo), const RTM_MAXSIZE = 2048 +pkg syscall (openbsd-386-cgo), const RTM_MISS = 7 +pkg syscall (openbsd-386-cgo), const RTM_NEWADDR = 12 +pkg syscall (openbsd-386-cgo), const RTM_REDIRECT = 6 +pkg syscall (openbsd-386-cgo), const RTM_RESOLVE = 11 +pkg syscall (openbsd-386-cgo), const RTM_RTTUNIT = 1000000 +pkg syscall (openbsd-386-cgo), const RTM_VERSION = 4 +pkg syscall (openbsd-386-cgo), const RTV_EXPIRE = 4 +pkg syscall (openbsd-386-cgo), const RTV_HOPCOUNT = 2 +pkg syscall (openbsd-386-cgo), const RTV_MTU = 1 +pkg syscall (openbsd-386-cgo), const RTV_RPIPE = 8 +pkg syscall (openbsd-386-cgo), const RTV_RTT = 64 +pkg syscall (openbsd-386-cgo), const RTV_RTTVAR = 128 +pkg syscall (openbsd-386-cgo), const RTV_SPIPE = 16 +pkg syscall (openbsd-386-cgo), const RTV_SSTHRESH = 32 +pkg syscall (openbsd-386-cgo), const RT_TABLEID_MAX = 255 +pkg syscall (openbsd-386-cgo), const RUSAGE_CHILDREN = -1 +pkg syscall (openbsd-386-cgo), const RUSAGE_SELF = 0 +pkg syscall (openbsd-386-cgo), const RUSAGE_THREAD = 1 +pkg syscall (openbsd-386-cgo), const SCM_RIGHTS = 1 +pkg syscall (openbsd-386-cgo), const SCM_TIMESTAMP = 4 +pkg syscall (openbsd-386-cgo), const SIGBUS = 10 +pkg syscall (openbsd-386-cgo), const SIGCHLD = 20 +pkg syscall (openbsd-386-cgo), const SIGCONT = 19 +pkg syscall (openbsd-386-cgo), const SIGEMT = 7 +pkg syscall (openbsd-386-cgo), const SIGINFO = 29 +pkg syscall (openbsd-386-cgo), const SIGIO = 23 +pkg syscall (openbsd-386-cgo), const SIGIOT = 6 +pkg syscall (openbsd-386-cgo), const SIGPROF = 27 +pkg syscall (openbsd-386-cgo), const SIGSTOP = 17 +pkg syscall (openbsd-386-cgo), const SIGSYS = 12 +pkg syscall (openbsd-386-cgo), const SIGTHR = 32 +pkg syscall (openbsd-386-cgo), const SIGTSTP = 18 +pkg syscall (openbsd-386-cgo), const SIGTTIN = 21 +pkg syscall (openbsd-386-cgo), const SIGTTOU = 22 +pkg syscall (openbsd-386-cgo), const SIGURG = 16 +pkg syscall (openbsd-386-cgo), const SIGUSR1 = 30 +pkg syscall (openbsd-386-cgo), const SIGUSR2 = 31 +pkg syscall (openbsd-386-cgo), const SIGVTALRM = 26 +pkg syscall (openbsd-386-cgo), const SIGWINCH = 28 +pkg syscall (openbsd-386-cgo), const SIGXCPU = 24 +pkg syscall (openbsd-386-cgo), const SIGXFSZ = 25 +pkg syscall (openbsd-386-cgo), const SIOCADDMULTI = 2149607729 +pkg syscall (openbsd-386-cgo), const SIOCAIFADDR = 2151704858 +pkg syscall (openbsd-386-cgo), const SIOCAIFGROUP = 2149869959 +pkg syscall (openbsd-386-cgo), const SIOCALIFADDR = 2182637852 +pkg syscall (openbsd-386-cgo), const SIOCATMARK = 1074033415 +pkg syscall (openbsd-386-cgo), const SIOCBRDGADD = 2153015612 +pkg syscall (openbsd-386-cgo), const SIOCBRDGADDS = 2153015617 +pkg syscall (openbsd-386-cgo), const SIOCBRDGARL = 2154719565 +pkg syscall (openbsd-386-cgo), const SIOCBRDGDADDR = 2150132039 +pkg syscall (openbsd-386-cgo), const SIOCBRDGDEL = 2153015613 +pkg syscall (openbsd-386-cgo), const SIOCBRDGDELS = 2153015618 +pkg syscall (openbsd-386-cgo), const SIOCBRDGFLUSH = 2153015624 +pkg syscall (openbsd-386-cgo), const SIOCBRDGFRL = 2154719566 +pkg syscall (openbsd-386-cgo), const SIOCBRDGGCACHE = 3222563137 +pkg syscall (openbsd-386-cgo), const SIOCBRDGGFD = 3222563154 +pkg syscall (openbsd-386-cgo), const SIOCBRDGGHT = 3222563153 +pkg syscall (openbsd-386-cgo), const SIOCBRDGGIFFLGS = 3226757438 +pkg syscall (openbsd-386-cgo), const SIOCBRDGGMA = 3222563155 +pkg syscall (openbsd-386-cgo), const SIOCBRDGGPARAM = 3224922456 +pkg syscall (openbsd-386-cgo), const SIOCBRDGGPRI = 3222563152 +pkg syscall (openbsd-386-cgo), const SIOCBRDGGRL = 3223873871 +pkg syscall (openbsd-386-cgo), const SIOCBRDGGSIFS = 3226757436 +pkg syscall (openbsd-386-cgo), const SIOCBRDGGTO = 3222563142 +pkg syscall (openbsd-386-cgo), const SIOCBRDGIFS = 3226757442 +pkg syscall (openbsd-386-cgo), const SIOCBRDGRTS = 3222825283 +pkg syscall (openbsd-386-cgo), const SIOCBRDGSADDR = 3223873860 +pkg syscall (openbsd-386-cgo), const SIOCBRDGSCACHE = 2148821312 +pkg syscall (openbsd-386-cgo), const SIOCBRDGSFD = 2148821330 +pkg syscall (openbsd-386-cgo), const SIOCBRDGSHT = 2148821329 +pkg syscall (openbsd-386-cgo), const SIOCBRDGSIFCOST = 2153015637 +pkg syscall (openbsd-386-cgo), const SIOCBRDGSIFFLGS = 2153015615 +pkg syscall (openbsd-386-cgo), const SIOCBRDGSIFPRIO = 2153015636 +pkg syscall (openbsd-386-cgo), const SIOCBRDGSMA = 2148821331 +pkg syscall (openbsd-386-cgo), const SIOCBRDGSPRI = 2148821328 +pkg syscall (openbsd-386-cgo), const SIOCBRDGSPROTO = 2148821338 +pkg syscall (openbsd-386-cgo), const SIOCBRDGSTO = 2148821317 +pkg syscall (openbsd-386-cgo), const SIOCBRDGSTXHC = 2148821337 +pkg syscall (openbsd-386-cgo), const SIOCDELMULTI = 2149607730 +pkg syscall (openbsd-386-cgo), const SIOCDIFADDR = 2149607705 +pkg syscall (openbsd-386-cgo), const SIOCDIFGROUP = 2149869961 +pkg syscall (openbsd-386-cgo), const SIOCDIFPHYADDR = 2149607753 +pkg syscall (openbsd-386-cgo), const SIOCDLIFADDR = 2182637854 +pkg syscall (openbsd-386-cgo), const SIOCGETKALIVE = 3222825380 +pkg syscall (openbsd-386-cgo), const SIOCGETLABEL = 2149607834 +pkg syscall (openbsd-386-cgo), const SIOCGETPFLOW = 3223349758 +pkg syscall (openbsd-386-cgo), const SIOCGETPFSYNC = 3223349752 +pkg syscall (openbsd-386-cgo), const SIOCGETSGCNT = 3222566196 +pkg syscall (openbsd-386-cgo), const SIOCGETVIFCNT = 3222566195 +pkg syscall (openbsd-386-cgo), const SIOCGHIWAT = 1074033409 +pkg syscall (openbsd-386-cgo), const SIOCGIFADDR = 3223349537 +pkg syscall (openbsd-386-cgo), const SIOCGIFASYNCMAP = 3223349628 +pkg syscall (openbsd-386-cgo), const SIOCGIFBRDADDR = 3223349539 +pkg syscall (openbsd-386-cgo), const SIOCGIFCONF = 3221776676 +pkg syscall (openbsd-386-cgo), const SIOCGIFDATA = 3223349531 +pkg syscall (openbsd-386-cgo), const SIOCGIFDESCR = 3223349633 +pkg syscall (openbsd-386-cgo), const SIOCGIFDSTADDR = 3223349538 +pkg syscall (openbsd-386-cgo), const SIOCGIFFLAGS = 3223349521 +pkg syscall (openbsd-386-cgo), const SIOCGIFGATTR = 3223611787 +pkg syscall (openbsd-386-cgo), const SIOCGIFGENERIC = 3223349562 +pkg syscall (openbsd-386-cgo), const SIOCGIFGMEMB = 3223611786 +pkg syscall (openbsd-386-cgo), const SIOCGIFGROUP = 3223611784 +pkg syscall (openbsd-386-cgo), const SIOCGIFMEDIA = 3223873846 +pkg syscall (openbsd-386-cgo), const SIOCGIFMETRIC = 3223349527 +pkg syscall (openbsd-386-cgo), const SIOCGIFMTU = 3223349630 +pkg syscall (openbsd-386-cgo), const SIOCGIFNETMASK = 3223349541 +pkg syscall (openbsd-386-cgo), const SIOCGIFPDSTADDR = 3223349576 +pkg syscall (openbsd-386-cgo), const SIOCGIFPRIORITY = 3223349660 +pkg syscall (openbsd-386-cgo), const SIOCGIFPSRCADDR = 3223349575 +pkg syscall (openbsd-386-cgo), const SIOCGIFRDOMAIN = 3223349664 +pkg syscall (openbsd-386-cgo), const SIOCGIFRTLABEL = 3223349635 +pkg syscall (openbsd-386-cgo), const SIOCGIFTIMESLOT = 3223349638 +pkg syscall (openbsd-386-cgo), const SIOCGIFXFLAGS = 3223349662 +pkg syscall (openbsd-386-cgo), const SIOCGLIFADDR = 3256379677 +pkg syscall (openbsd-386-cgo), const SIOCGLIFPHYADDR = 3256379723 +pkg syscall (openbsd-386-cgo), const SIOCGLIFPHYRTABLE = 3223349666 +pkg syscall (openbsd-386-cgo), const SIOCGLOWAT = 1074033411 +pkg syscall (openbsd-386-cgo), const SIOCGPGRP = 1074033417 +pkg syscall (openbsd-386-cgo), const SIOCGVH = 3223349750 +pkg syscall (openbsd-386-cgo), const SIOCIFCREATE = 2149607802 +pkg syscall (openbsd-386-cgo), const SIOCIFDESTROY = 2149607801 +pkg syscall (openbsd-386-cgo), const SIOCIFGCLONERS = 3222038904 +pkg syscall (openbsd-386-cgo), const SIOCSETKALIVE = 2149083555 +pkg syscall (openbsd-386-cgo), const SIOCSETLABEL = 2149607833 +pkg syscall (openbsd-386-cgo), const SIOCSETPFLOW = 2149607933 +pkg syscall (openbsd-386-cgo), const SIOCSETPFSYNC = 2149607927 +pkg syscall (openbsd-386-cgo), const SIOCSHIWAT = 2147775232 +pkg syscall (openbsd-386-cgo), const SIOCSIFADDR = 2149607692 +pkg syscall (openbsd-386-cgo), const SIOCSIFASYNCMAP = 2149607805 +pkg syscall (openbsd-386-cgo), const SIOCSIFBRDADDR = 2149607699 +pkg syscall (openbsd-386-cgo), const SIOCSIFDESCR = 2149607808 +pkg syscall (openbsd-386-cgo), const SIOCSIFDSTADDR = 2149607694 +pkg syscall (openbsd-386-cgo), const SIOCSIFFLAGS = 2149607696 +pkg syscall (openbsd-386-cgo), const SIOCSIFGATTR = 2149869964 +pkg syscall (openbsd-386-cgo), const SIOCSIFGENERIC = 2149607737 +pkg syscall (openbsd-386-cgo), const SIOCSIFLLADDR = 2149607711 +pkg syscall (openbsd-386-cgo), const SIOCSIFMEDIA = 3223349557 +pkg syscall (openbsd-386-cgo), const SIOCSIFMETRIC = 2149607704 +pkg syscall (openbsd-386-cgo), const SIOCSIFMTU = 2149607807 +pkg syscall (openbsd-386-cgo), const SIOCSIFNETMASK = 2149607702 +pkg syscall (openbsd-386-cgo), const SIOCSIFPHYADDR = 2151704902 +pkg syscall (openbsd-386-cgo), const SIOCSIFPRIORITY = 2149607835 +pkg syscall (openbsd-386-cgo), const SIOCSIFRDOMAIN = 2149607839 +pkg syscall (openbsd-386-cgo), const SIOCSIFRTLABEL = 2149607810 +pkg syscall (openbsd-386-cgo), const SIOCSIFTIMESLOT = 2149607813 +pkg syscall (openbsd-386-cgo), const SIOCSIFXFLAGS = 2149607837 +pkg syscall (openbsd-386-cgo), const SIOCSLIFPHYADDR = 2182637898 +pkg syscall (openbsd-386-cgo), const SIOCSLIFPHYRTABLE = 2149607841 +pkg syscall (openbsd-386-cgo), const SIOCSLOWAT = 2147775234 +pkg syscall (openbsd-386-cgo), const SIOCSPGRP = 2147775240 +pkg syscall (openbsd-386-cgo), const SIOCSVH = 3223349749 +pkg syscall (openbsd-386-cgo), const SOCK_RDM = 4 +pkg syscall (openbsd-386-cgo), const SOL_SOCKET = 65535 +pkg syscall (openbsd-386-cgo), const SOMAXCONN = 128 +pkg syscall (openbsd-386-cgo), const SO_ACCEPTCONN = 2 +pkg syscall (openbsd-386-cgo), const SO_BINDANY = 4096 +pkg syscall (openbsd-386-cgo), const SO_BROADCAST = 32 +pkg syscall (openbsd-386-cgo), const SO_DEBUG = 1 +pkg syscall (openbsd-386-cgo), const SO_DONTROUTE = 16 +pkg syscall (openbsd-386-cgo), const SO_ERROR = 4103 +pkg syscall (openbsd-386-cgo), const SO_KEEPALIVE = 8 +pkg syscall (openbsd-386-cgo), const SO_LINGER = 128 +pkg syscall (openbsd-386-cgo), const SO_NETPROC = 4128 +pkg syscall (openbsd-386-cgo), const SO_OOBINLINE = 256 +pkg syscall (openbsd-386-cgo), const SO_PEERCRED = 4130 +pkg syscall (openbsd-386-cgo), const SO_RCVBUF = 4098 +pkg syscall (openbsd-386-cgo), const SO_RCVLOWAT = 4100 +pkg syscall (openbsd-386-cgo), const SO_RCVTIMEO = 4102 +pkg syscall (openbsd-386-cgo), const SO_REUSEADDR = 4 +pkg syscall (openbsd-386-cgo), const SO_REUSEPORT = 512 +pkg syscall (openbsd-386-cgo), const SO_RTABLE = 4129 +pkg syscall (openbsd-386-cgo), const SO_SNDBUF = 4097 +pkg syscall (openbsd-386-cgo), const SO_SNDLOWAT = 4099 +pkg syscall (openbsd-386-cgo), const SO_SNDTIMEO = 4101 +pkg syscall (openbsd-386-cgo), const SO_SPLICE = 4131 +pkg syscall (openbsd-386-cgo), const SO_TIMESTAMP = 2048 +pkg syscall (openbsd-386-cgo), const SO_TYPE = 4104 +pkg syscall (openbsd-386-cgo), const SO_USELOOPBACK = 64 +pkg syscall (openbsd-386-cgo), const SYS_ACCEPT = 30 +pkg syscall (openbsd-386-cgo), const SYS_ACCESS = 33 +pkg syscall (openbsd-386-cgo), const SYS_ACCT = 51 +pkg syscall (openbsd-386-cgo), const SYS_ADJFREQ = 305 +pkg syscall (openbsd-386-cgo), const SYS_ADJTIME = 140 +pkg syscall (openbsd-386-cgo), const SYS_BIND = 104 +pkg syscall (openbsd-386-cgo), const SYS_CHDIR = 12 +pkg syscall (openbsd-386-cgo), const SYS_CHFLAGS = 34 +pkg syscall (openbsd-386-cgo), const SYS_CHMOD = 15 +pkg syscall (openbsd-386-cgo), const SYS_CHOWN = 16 +pkg syscall (openbsd-386-cgo), const SYS_CHROOT = 61 +pkg syscall (openbsd-386-cgo), const SYS_CLOCK_GETRES = 234 +pkg syscall (openbsd-386-cgo), const SYS_CLOCK_GETTIME = 232 +pkg syscall (openbsd-386-cgo), const SYS_CLOCK_SETTIME = 233 +pkg syscall (openbsd-386-cgo), const SYS_CLOSE = 6 +pkg syscall (openbsd-386-cgo), const SYS_CLOSEFROM = 287 +pkg syscall (openbsd-386-cgo), const SYS_CONNECT = 98 +pkg syscall (openbsd-386-cgo), const SYS_DUP = 41 +pkg syscall (openbsd-386-cgo), const SYS_DUP2 = 90 +pkg syscall (openbsd-386-cgo), const SYS_EXECVE = 59 +pkg syscall (openbsd-386-cgo), const SYS_EXIT = 1 +pkg syscall (openbsd-386-cgo), const SYS_FACCESSAT = 313 +pkg syscall (openbsd-386-cgo), const SYS_FCHDIR = 13 +pkg syscall (openbsd-386-cgo), const SYS_FCHFLAGS = 35 +pkg syscall (openbsd-386-cgo), const SYS_FCHMOD = 124 +pkg syscall (openbsd-386-cgo), const SYS_FCHMODAT = 314 +pkg syscall (openbsd-386-cgo), const SYS_FCHOWN = 123 +pkg syscall (openbsd-386-cgo), const SYS_FCHOWNAT = 315 +pkg syscall (openbsd-386-cgo), const SYS_FCNTL = 92 +pkg syscall (openbsd-386-cgo), const SYS_FHOPEN = 264 +pkg syscall (openbsd-386-cgo), const SYS_FHSTAT = 294 +pkg syscall (openbsd-386-cgo), const SYS_FHSTATFS = 309 +pkg syscall (openbsd-386-cgo), const SYS_FLOCK = 131 +pkg syscall (openbsd-386-cgo), const SYS_FORK = 2 +pkg syscall (openbsd-386-cgo), const SYS_FPATHCONF = 192 +pkg syscall (openbsd-386-cgo), const SYS_FSTAT = 292 +pkg syscall (openbsd-386-cgo), const SYS_FSTATAT = 316 +pkg syscall (openbsd-386-cgo), const SYS_FSTATFS = 308 +pkg syscall (openbsd-386-cgo), const SYS_FSYNC = 95 +pkg syscall (openbsd-386-cgo), const SYS_FTRUNCATE = 201 +pkg syscall (openbsd-386-cgo), const SYS_FUTIMENS = 327 +pkg syscall (openbsd-386-cgo), const SYS_FUTIMES = 206 +pkg syscall (openbsd-386-cgo), const SYS_GETDIRENTRIES = 312 +pkg syscall (openbsd-386-cgo), const SYS_GETDTABLECOUNT = 18 +pkg syscall (openbsd-386-cgo), const SYS_GETEGID = 43 +pkg syscall (openbsd-386-cgo), const SYS_GETEUID = 25 +pkg syscall (openbsd-386-cgo), const SYS_GETFH = 161 +pkg syscall (openbsd-386-cgo), const SYS_GETFSSTAT = 306 +pkg syscall (openbsd-386-cgo), const SYS_GETGID = 47 +pkg syscall (openbsd-386-cgo), const SYS_GETGROUPS = 79 +pkg syscall (openbsd-386-cgo), const SYS_GETITIMER = 86 +pkg syscall (openbsd-386-cgo), const SYS_GETLOGIN = 49 +pkg syscall (openbsd-386-cgo), const SYS_GETPEERNAME = 31 +pkg syscall (openbsd-386-cgo), const SYS_GETPGID = 207 +pkg syscall (openbsd-386-cgo), const SYS_GETPGRP = 81 +pkg syscall (openbsd-386-cgo), const SYS_GETPID = 20 +pkg syscall (openbsd-386-cgo), const SYS_GETPPID = 39 +pkg syscall (openbsd-386-cgo), const SYS_GETPRIORITY = 100 +pkg syscall (openbsd-386-cgo), const SYS_GETRESGID = 283 +pkg syscall (openbsd-386-cgo), const SYS_GETRESUID = 281 +pkg syscall (openbsd-386-cgo), const SYS_GETRLIMIT = 194 +pkg syscall (openbsd-386-cgo), const SYS_GETRTABLE = 311 +pkg syscall (openbsd-386-cgo), const SYS_GETRUSAGE = 117 +pkg syscall (openbsd-386-cgo), const SYS_GETSID = 255 +pkg syscall (openbsd-386-cgo), const SYS_GETSOCKNAME = 32 +pkg syscall (openbsd-386-cgo), const SYS_GETSOCKOPT = 118 +pkg syscall (openbsd-386-cgo), const SYS_GETTHRID = 299 +pkg syscall (openbsd-386-cgo), const SYS_GETTIMEOFDAY = 116 +pkg syscall (openbsd-386-cgo), const SYS_GETUID = 24 +pkg syscall (openbsd-386-cgo), const SYS_IOCTL = 54 +pkg syscall (openbsd-386-cgo), const SYS_ISSETUGID = 253 +pkg syscall (openbsd-386-cgo), const SYS_KEVENT = 270 +pkg syscall (openbsd-386-cgo), const SYS_KILL = 37 +pkg syscall (openbsd-386-cgo), const SYS_KQUEUE = 269 +pkg syscall (openbsd-386-cgo), const SYS_KTRACE = 45 +pkg syscall (openbsd-386-cgo), const SYS_LCHOWN = 254 +pkg syscall (openbsd-386-cgo), const SYS_LINK = 9 +pkg syscall (openbsd-386-cgo), const SYS_LINKAT = 317 +pkg syscall (openbsd-386-cgo), const SYS_LISTEN = 106 +pkg syscall (openbsd-386-cgo), const SYS_LSEEK = 199 +pkg syscall (openbsd-386-cgo), const SYS_LSTAT = 293 +pkg syscall (openbsd-386-cgo), const SYS_MADVISE = 75 +pkg syscall (openbsd-386-cgo), const SYS_MINCORE = 78 +pkg syscall (openbsd-386-cgo), const SYS_MINHERIT = 250 +pkg syscall (openbsd-386-cgo), const SYS_MKDIR = 136 +pkg syscall (openbsd-386-cgo), const SYS_MKDIRAT = 318 +pkg syscall (openbsd-386-cgo), const SYS_MKFIFO = 132 +pkg syscall (openbsd-386-cgo), const SYS_MKFIFOAT = 319 +pkg syscall (openbsd-386-cgo), const SYS_MKNOD = 14 +pkg syscall (openbsd-386-cgo), const SYS_MKNODAT = 320 +pkg syscall (openbsd-386-cgo), const SYS_MLOCK = 203 +pkg syscall (openbsd-386-cgo), const SYS_MLOCKALL = 271 +pkg syscall (openbsd-386-cgo), const SYS_MMAP = 197 +pkg syscall (openbsd-386-cgo), const SYS_MOUNT = 21 +pkg syscall (openbsd-386-cgo), const SYS_MPROTECT = 74 +pkg syscall (openbsd-386-cgo), const SYS_MQUERY = 286 +pkg syscall (openbsd-386-cgo), const SYS_MSGCTL = 297 +pkg syscall (openbsd-386-cgo), const SYS_MSGGET = 225 +pkg syscall (openbsd-386-cgo), const SYS_MSGRCV = 227 +pkg syscall (openbsd-386-cgo), const SYS_MSGSND = 226 +pkg syscall (openbsd-386-cgo), const SYS_MSYNC = 256 +pkg syscall (openbsd-386-cgo), const SYS_MUNLOCK = 204 +pkg syscall (openbsd-386-cgo), const SYS_MUNLOCKALL = 272 +pkg syscall (openbsd-386-cgo), const SYS_MUNMAP = 73 +pkg syscall (openbsd-386-cgo), const SYS_NANOSLEEP = 240 +pkg syscall (openbsd-386-cgo), const SYS_NFSSVC = 155 +pkg syscall (openbsd-386-cgo), const SYS_OBREAK = 17 +pkg syscall (openbsd-386-cgo), const SYS_OPEN = 5 +pkg syscall (openbsd-386-cgo), const SYS_OPENAT = 321 +pkg syscall (openbsd-386-cgo), const SYS_PATHCONF = 191 +pkg syscall (openbsd-386-cgo), const SYS_PIPE = 263 +pkg syscall (openbsd-386-cgo), const SYS_POLL = 252 +pkg syscall (openbsd-386-cgo), const SYS_PREAD = 173 +pkg syscall (openbsd-386-cgo), const SYS_PREADV = 267 +pkg syscall (openbsd-386-cgo), const SYS_PROFIL = 44 +pkg syscall (openbsd-386-cgo), const SYS_PTRACE = 26 +pkg syscall (openbsd-386-cgo), const SYS_PWRITE = 174 +pkg syscall (openbsd-386-cgo), const SYS_PWRITEV = 268 +pkg syscall (openbsd-386-cgo), const SYS_QUOTACTL = 148 +pkg syscall (openbsd-386-cgo), const SYS_READ = 3 +pkg syscall (openbsd-386-cgo), const SYS_READLINK = 58 +pkg syscall (openbsd-386-cgo), const SYS_READLINKAT = 322 +pkg syscall (openbsd-386-cgo), const SYS_READV = 120 +pkg syscall (openbsd-386-cgo), const SYS_REBOOT = 55 +pkg syscall (openbsd-386-cgo), const SYS_RECVFROM = 29 +pkg syscall (openbsd-386-cgo), const SYS_RECVMSG = 27 +pkg syscall (openbsd-386-cgo), const SYS_RENAME = 128 +pkg syscall (openbsd-386-cgo), const SYS_RENAMEAT = 323 +pkg syscall (openbsd-386-cgo), const SYS_REVOKE = 56 +pkg syscall (openbsd-386-cgo), const SYS_RMDIR = 137 +pkg syscall (openbsd-386-cgo), const SYS_SCHED_YIELD = 298 +pkg syscall (openbsd-386-cgo), const SYS_SELECT = 93 +pkg syscall (openbsd-386-cgo), const SYS_SEMGET = 221 +pkg syscall (openbsd-386-cgo), const SYS_SEMOP = 290 +pkg syscall (openbsd-386-cgo), const SYS_SENDMSG = 28 +pkg syscall (openbsd-386-cgo), const SYS_SENDTO = 133 +pkg syscall (openbsd-386-cgo), const SYS_SETEGID = 182 +pkg syscall (openbsd-386-cgo), const SYS_SETEUID = 183 +pkg syscall (openbsd-386-cgo), const SYS_SETGID = 181 +pkg syscall (openbsd-386-cgo), const SYS_SETGROUPS = 80 +pkg syscall (openbsd-386-cgo), const SYS_SETITIMER = 83 +pkg syscall (openbsd-386-cgo), const SYS_SETLOGIN = 50 +pkg syscall (openbsd-386-cgo), const SYS_SETPGID = 82 +pkg syscall (openbsd-386-cgo), const SYS_SETPRIORITY = 96 +pkg syscall (openbsd-386-cgo), const SYS_SETREGID = 127 +pkg syscall (openbsd-386-cgo), const SYS_SETRESGID = 284 +pkg syscall (openbsd-386-cgo), const SYS_SETRESUID = 282 +pkg syscall (openbsd-386-cgo), const SYS_SETREUID = 126 +pkg syscall (openbsd-386-cgo), const SYS_SETRLIMIT = 195 +pkg syscall (openbsd-386-cgo), const SYS_SETRTABLE = 310 +pkg syscall (openbsd-386-cgo), const SYS_SETSID = 147 +pkg syscall (openbsd-386-cgo), const SYS_SETSOCKOPT = 105 +pkg syscall (openbsd-386-cgo), const SYS_SETTIMEOFDAY = 122 +pkg syscall (openbsd-386-cgo), const SYS_SETUID = 23 +pkg syscall (openbsd-386-cgo), const SYS_SHMAT = 228 +pkg syscall (openbsd-386-cgo), const SYS_SHMCTL = 296 +pkg syscall (openbsd-386-cgo), const SYS_SHMDT = 230 +pkg syscall (openbsd-386-cgo), const SYS_SHMGET = 289 +pkg syscall (openbsd-386-cgo), const SYS_SHUTDOWN = 134 +pkg syscall (openbsd-386-cgo), const SYS_SIGACTION = 46 +pkg syscall (openbsd-386-cgo), const SYS_SIGALTSTACK = 288 +pkg syscall (openbsd-386-cgo), const SYS_SIGPENDING = 52 +pkg syscall (openbsd-386-cgo), const SYS_SIGPROCMASK = 48 +pkg syscall (openbsd-386-cgo), const SYS_SIGRETURN = 103 +pkg syscall (openbsd-386-cgo), const SYS_SIGSUSPEND = 111 +pkg syscall (openbsd-386-cgo), const SYS_SOCKET = 97 +pkg syscall (openbsd-386-cgo), const SYS_SOCKETPAIR = 135 +pkg syscall (openbsd-386-cgo), const SYS_STAT = 291 +pkg syscall (openbsd-386-cgo), const SYS_STATFS = 307 +pkg syscall (openbsd-386-cgo), const SYS_SWAPCTL = 193 +pkg syscall (openbsd-386-cgo), const SYS_SYMLINK = 57 +pkg syscall (openbsd-386-cgo), const SYS_SYMLINKAT = 324 +pkg syscall (openbsd-386-cgo), const SYS_SYNC = 36 +pkg syscall (openbsd-386-cgo), const SYS_SYSARCH = 165 +pkg syscall (openbsd-386-cgo), const SYS_TRUNCATE = 200 +pkg syscall (openbsd-386-cgo), const SYS_UMASK = 60 +pkg syscall (openbsd-386-cgo), const SYS_UNLINK = 10 +pkg syscall (openbsd-386-cgo), const SYS_UNLINKAT = 325 +pkg syscall (openbsd-386-cgo), const SYS_UNMOUNT = 22 +pkg syscall (openbsd-386-cgo), const SYS_UTIMENSAT = 326 +pkg syscall (openbsd-386-cgo), const SYS_UTIMES = 138 +pkg syscall (openbsd-386-cgo), const SYS_VFORK = 66 +pkg syscall (openbsd-386-cgo), const SYS_WAIT4 = 7 +pkg syscall (openbsd-386-cgo), const SYS_WRITE = 4 +pkg syscall (openbsd-386-cgo), const SYS_WRITEV = 121 +pkg syscall (openbsd-386-cgo), const SYS___GETCWD = 304 +pkg syscall (openbsd-386-cgo), const SYS___GET_TCB = 330 +pkg syscall (openbsd-386-cgo), const SYS___SEMCTL = 295 +pkg syscall (openbsd-386-cgo), const SYS___SET_TCB = 329 +pkg syscall (openbsd-386-cgo), const SYS___SYSCTL = 202 +pkg syscall (openbsd-386-cgo), const SYS___TFORK = 8 +pkg syscall (openbsd-386-cgo), const SYS___THREXIT = 302 +pkg syscall (openbsd-386-cgo), const SYS___THRSIGDIVERT = 303 +pkg syscall (openbsd-386-cgo), const SYS___THRSLEEP = 300 +pkg syscall (openbsd-386-cgo), const SYS___THRWAKEUP = 301 +pkg syscall (openbsd-386-cgo), const S_IFMT = 61440 +pkg syscall (openbsd-386-cgo), const SizeofBpfHdr = 20 +pkg syscall (openbsd-386-cgo), const SizeofBpfInsn = 8 +pkg syscall (openbsd-386-cgo), const SizeofBpfProgram = 8 +pkg syscall (openbsd-386-cgo), const SizeofBpfStat = 8 +pkg syscall (openbsd-386-cgo), const SizeofBpfVersion = 4 +pkg syscall (openbsd-386-cgo), const SizeofCmsghdr = 12 +pkg syscall (openbsd-386-cgo), const SizeofIPMreq = 8 +pkg syscall (openbsd-386-cgo), const SizeofIPv6Mreq = 20 +pkg syscall (openbsd-386-cgo), const SizeofIfAnnounceMsghdr = 26 +pkg syscall (openbsd-386-cgo), const SizeofIfData = 208 +pkg syscall (openbsd-386-cgo), const SizeofIfMsghdr = 232 +pkg syscall (openbsd-386-cgo), const SizeofIfaMsghdr = 24 +pkg syscall (openbsd-386-cgo), const SizeofInet6Pktinfo = 20 +pkg syscall (openbsd-386-cgo), const SizeofLinger = 8 +pkg syscall (openbsd-386-cgo), const SizeofMsghdr = 28 +pkg syscall (openbsd-386-cgo), const SizeofRtMetrics = 48 +pkg syscall (openbsd-386-cgo), const SizeofRtMsghdr = 88 +pkg syscall (openbsd-386-cgo), const SizeofSockaddrAny = 108 +pkg syscall (openbsd-386-cgo), const SizeofSockaddrDatalink = 32 +pkg syscall (openbsd-386-cgo), const SizeofSockaddrInet4 = 16 +pkg syscall (openbsd-386-cgo), const SizeofSockaddrInet6 = 28 +pkg syscall (openbsd-386-cgo), const SizeofSockaddrUnix = 106 +pkg syscall (openbsd-386-cgo), const TCIFLUSH = 1 +pkg syscall (openbsd-386-cgo), const TCIOFLUSH = 3 +pkg syscall (openbsd-386-cgo), const TCOFLUSH = 2 +pkg syscall (openbsd-386-cgo), const TCP_MAXBURST = 4 +pkg syscall (openbsd-386-cgo), const TCP_MAXSEG = 2 +pkg syscall (openbsd-386-cgo), const TCP_MAXWIN = 65535 +pkg syscall (openbsd-386-cgo), const TCP_MAX_SACK = 3 +pkg syscall (openbsd-386-cgo), const TCP_MAX_WINSHIFT = 14 +pkg syscall (openbsd-386-cgo), const TCP_MD5SIG = 4 +pkg syscall (openbsd-386-cgo), const TCP_MSS = 512 +pkg syscall (openbsd-386-cgo), const TCP_NSTATES = 11 +pkg syscall (openbsd-386-cgo), const TCP_SACK_ENABLE = 8 +pkg syscall (openbsd-386-cgo), const TCSAFLUSH = 2 +pkg syscall (openbsd-386-cgo), const TIOCCBRK = 536900730 +pkg syscall (openbsd-386-cgo), const TIOCCDTR = 536900728 +pkg syscall (openbsd-386-cgo), const TIOCCONS = 2147775586 +pkg syscall (openbsd-386-cgo), const TIOCDRAIN = 536900702 +pkg syscall (openbsd-386-cgo), const TIOCEXCL = 536900621 +pkg syscall (openbsd-386-cgo), const TIOCEXT = 2147775584 +pkg syscall (openbsd-386-cgo), const TIOCFLAG_CLOCAL = 2 +pkg syscall (openbsd-386-cgo), const TIOCFLAG_CRTSCTS = 4 +pkg syscall (openbsd-386-cgo), const TIOCFLAG_MDMBUF = 8 +pkg syscall (openbsd-386-cgo), const TIOCFLAG_PPS = 16 +pkg syscall (openbsd-386-cgo), const TIOCFLAG_SOFTCAR = 1 +pkg syscall (openbsd-386-cgo), const TIOCFLUSH = 2147775504 +pkg syscall (openbsd-386-cgo), const TIOCGETA = 1076655123 +pkg syscall (openbsd-386-cgo), const TIOCGETD = 1074033690 +pkg syscall (openbsd-386-cgo), const TIOCGFLAGS = 1074033757 +pkg syscall (openbsd-386-cgo), const TIOCGPGRP = 1074033783 +pkg syscall (openbsd-386-cgo), const TIOCGTSTAMP = 1074295899 +pkg syscall (openbsd-386-cgo), const TIOCGWINSZ = 1074295912 +pkg syscall (openbsd-386-cgo), const TIOCMBIC = 2147775595 +pkg syscall (openbsd-386-cgo), const TIOCMBIS = 2147775596 +pkg syscall (openbsd-386-cgo), const TIOCMGET = 1074033770 +pkg syscall (openbsd-386-cgo), const TIOCMODG = 1074033770 +pkg syscall (openbsd-386-cgo), const TIOCMODS = 2147775597 +pkg syscall (openbsd-386-cgo), const TIOCMSET = 2147775597 +pkg syscall (openbsd-386-cgo), const TIOCM_CAR = 64 +pkg syscall (openbsd-386-cgo), const TIOCM_CD = 64 +pkg syscall (openbsd-386-cgo), const TIOCM_CTS = 32 +pkg syscall (openbsd-386-cgo), const TIOCM_DSR = 256 +pkg syscall (openbsd-386-cgo), const TIOCM_DTR = 2 +pkg syscall (openbsd-386-cgo), const TIOCM_LE = 1 +pkg syscall (openbsd-386-cgo), const TIOCM_RI = 128 +pkg syscall (openbsd-386-cgo), const TIOCM_RNG = 128 +pkg syscall (openbsd-386-cgo), const TIOCM_RTS = 4 +pkg syscall (openbsd-386-cgo), const TIOCM_SR = 16 +pkg syscall (openbsd-386-cgo), const TIOCM_ST = 8 +pkg syscall (openbsd-386-cgo), const TIOCNOTTY = 536900721 +pkg syscall (openbsd-386-cgo), const TIOCNXCL = 536900622 +pkg syscall (openbsd-386-cgo), const TIOCOUTQ = 1074033779 +pkg syscall (openbsd-386-cgo), const TIOCPKT = 2147775600 +pkg syscall (openbsd-386-cgo), const TIOCPKT_DATA = 0 +pkg syscall (openbsd-386-cgo), const TIOCPKT_DOSTOP = 32 +pkg syscall (openbsd-386-cgo), const TIOCPKT_FLUSHREAD = 1 +pkg syscall (openbsd-386-cgo), const TIOCPKT_FLUSHWRITE = 2 +pkg syscall (openbsd-386-cgo), const TIOCPKT_IOCTL = 64 +pkg syscall (openbsd-386-cgo), const TIOCPKT_NOSTOP = 16 +pkg syscall (openbsd-386-cgo), const TIOCPKT_START = 8 +pkg syscall (openbsd-386-cgo), const TIOCPKT_STOP = 4 +pkg syscall (openbsd-386-cgo), const TIOCREMOTE = 2147775593 +pkg syscall (openbsd-386-cgo), const TIOCSBRK = 536900731 +pkg syscall (openbsd-386-cgo), const TIOCSCTTY = 536900705 +pkg syscall (openbsd-386-cgo), const TIOCSDTR = 536900729 +pkg syscall (openbsd-386-cgo), const TIOCSETA = 2150396948 +pkg syscall (openbsd-386-cgo), const TIOCSETAF = 2150396950 +pkg syscall (openbsd-386-cgo), const TIOCSETAW = 2150396949 +pkg syscall (openbsd-386-cgo), const TIOCSETD = 2147775515 +pkg syscall (openbsd-386-cgo), const TIOCSFLAGS = 2147775580 +pkg syscall (openbsd-386-cgo), const TIOCSIG = 2147775583 +pkg syscall (openbsd-386-cgo), const TIOCSPGRP = 2147775606 +pkg syscall (openbsd-386-cgo), const TIOCSTART = 536900718 +pkg syscall (openbsd-386-cgo), const TIOCSTAT = 2147775589 +pkg syscall (openbsd-386-cgo), const TIOCSTI = 2147578994 +pkg syscall (openbsd-386-cgo), const TIOCSTOP = 536900719 +pkg syscall (openbsd-386-cgo), const TIOCSTSTAMP = 2148037722 +pkg syscall (openbsd-386-cgo), const TIOCSWINSZ = 2148037735 +pkg syscall (openbsd-386-cgo), const TIOCUCNTL = 2147775590 +pkg syscall (openbsd-386-cgo), const TOSTOP = 4194304 +pkg syscall (openbsd-386-cgo), const VDISCARD = 15 +pkg syscall (openbsd-386-cgo), const VDSUSP = 11 +pkg syscall (openbsd-386-cgo), const VEOF = 0 +pkg syscall (openbsd-386-cgo), const VEOL = 1 +pkg syscall (openbsd-386-cgo), const VEOL2 = 2 +pkg syscall (openbsd-386-cgo), const VERASE = 3 +pkg syscall (openbsd-386-cgo), const VINTR = 8 +pkg syscall (openbsd-386-cgo), const VKILL = 5 +pkg syscall (openbsd-386-cgo), const VLNEXT = 14 +pkg syscall (openbsd-386-cgo), const VMIN = 16 +pkg syscall (openbsd-386-cgo), const VQUIT = 9 +pkg syscall (openbsd-386-cgo), const VREPRINT = 6 +pkg syscall (openbsd-386-cgo), const VSTART = 12 +pkg syscall (openbsd-386-cgo), const VSTATUS = 18 +pkg syscall (openbsd-386-cgo), const VSTOP = 13 +pkg syscall (openbsd-386-cgo), const VSUSP = 10 +pkg syscall (openbsd-386-cgo), const VTIME = 17 +pkg syscall (openbsd-386-cgo), const VWERASE = 4 +pkg syscall (openbsd-386-cgo), const WALTSIG = 4 +pkg syscall (openbsd-386-cgo), const WCONTINUED = 8 +pkg syscall (openbsd-386-cgo), const WCOREFLAG = 128 +pkg syscall (openbsd-386-cgo), const WNOHANG = 1 +pkg syscall (openbsd-386-cgo), const WSTOPPED = 127 +pkg syscall (openbsd-386-cgo), const WUNTRACED = 2 +pkg syscall (openbsd-amd64), const AF_APPLETALK = 16 +pkg syscall (openbsd-amd64), const AF_BLUETOOTH = 32 +pkg syscall (openbsd-amd64), const AF_CCITT = 10 +pkg syscall (openbsd-amd64), const AF_CHAOS = 5 +pkg syscall (openbsd-amd64), const AF_CNT = 21 +pkg syscall (openbsd-amd64), const AF_COIP = 20 +pkg syscall (openbsd-amd64), const AF_DATAKIT = 9 +pkg syscall (openbsd-amd64), const AF_DECnet = 12 +pkg syscall (openbsd-amd64), const AF_DLI = 13 +pkg syscall (openbsd-amd64), const AF_E164 = 26 +pkg syscall (openbsd-amd64), const AF_ECMA = 8 +pkg syscall (openbsd-amd64), const AF_ENCAP = 28 +pkg syscall (openbsd-amd64), const AF_HYLINK = 15 +pkg syscall (openbsd-amd64), const AF_IMPLINK = 3 +pkg syscall (openbsd-amd64), const AF_INET6 = 24 +pkg syscall (openbsd-amd64), const AF_IPX = 23 +pkg syscall (openbsd-amd64), const AF_ISDN = 26 +pkg syscall (openbsd-amd64), const AF_ISO = 7 +pkg syscall (openbsd-amd64), const AF_KEY = 30 +pkg syscall (openbsd-amd64), const AF_LAT = 14 +pkg syscall (openbsd-amd64), const AF_LINK = 18 +pkg syscall (openbsd-amd64), const AF_LOCAL = 1 +pkg syscall (openbsd-amd64), const AF_MAX = 36 +pkg syscall (openbsd-amd64), const AF_MPLS = 33 +pkg syscall (openbsd-amd64), const AF_NATM = 27 +pkg syscall (openbsd-amd64), const AF_NS = 6 +pkg syscall (openbsd-amd64), const AF_OSI = 7 +pkg syscall (openbsd-amd64), const AF_PUP = 4 +pkg syscall (openbsd-amd64), const AF_ROUTE = 17 +pkg syscall (openbsd-amd64), const AF_SIP = 29 +pkg syscall (openbsd-amd64), const AF_SNA = 11 +pkg syscall (openbsd-amd64), const ARPHRD_ETHER = 1 +pkg syscall (openbsd-amd64), const ARPHRD_FRELAY = 15 +pkg syscall (openbsd-amd64), const ARPHRD_IEEE1394 = 24 +pkg syscall (openbsd-amd64), const ARPHRD_IEEE802 = 6 +pkg syscall (openbsd-amd64), const B0 = 0 +pkg syscall (openbsd-amd64), const B110 = 110 +pkg syscall (openbsd-amd64), const B115200 = 115200 +pkg syscall (openbsd-amd64), const B1200 = 1200 +pkg syscall (openbsd-amd64), const B134 = 134 +pkg syscall (openbsd-amd64), const B14400 = 14400 +pkg syscall (openbsd-amd64), const B150 = 150 +pkg syscall (openbsd-amd64), const B1800 = 1800 +pkg syscall (openbsd-amd64), const B19200 = 19200 +pkg syscall (openbsd-amd64), const B200 = 200 +pkg syscall (openbsd-amd64), const B230400 = 230400 +pkg syscall (openbsd-amd64), const B2400 = 2400 +pkg syscall (openbsd-amd64), const B28800 = 28800 +pkg syscall (openbsd-amd64), const B300 = 300 +pkg syscall (openbsd-amd64), const B38400 = 38400 +pkg syscall (openbsd-amd64), const B4800 = 4800 +pkg syscall (openbsd-amd64), const B50 = 50 +pkg syscall (openbsd-amd64), const B57600 = 57600 +pkg syscall (openbsd-amd64), const B600 = 600 +pkg syscall (openbsd-amd64), const B7200 = 7200 +pkg syscall (openbsd-amd64), const B75 = 75 +pkg syscall (openbsd-amd64), const B76800 = 76800 +pkg syscall (openbsd-amd64), const B9600 = 9600 +pkg syscall (openbsd-amd64), const BIOCFLUSH = 536887912 +pkg syscall (openbsd-amd64), const BIOCGBLEN = 1074020966 +pkg syscall (openbsd-amd64), const BIOCGDIRFILT = 1074020988 +pkg syscall (openbsd-amd64), const BIOCGDLT = 1074020970 +pkg syscall (openbsd-amd64), const BIOCGDLTLIST = 3222291067 +pkg syscall (openbsd-amd64), const BIOCGETIF = 1075855979 +pkg syscall (openbsd-amd64), const BIOCGFILDROP = 1074020984 +pkg syscall (openbsd-amd64), const BIOCGHDRCMPLT = 1074020980 +pkg syscall (openbsd-amd64), const BIOCGRSIG = 1074020979 +pkg syscall (openbsd-amd64), const BIOCGRTIMEOUT = 1074807406 +pkg syscall (openbsd-amd64), const BIOCGSTATS = 1074283119 +pkg syscall (openbsd-amd64), const BIOCIMMEDIATE = 2147762800 +pkg syscall (openbsd-amd64), const BIOCLOCK = 536887926 +pkg syscall (openbsd-amd64), const BIOCPROMISC = 536887913 +pkg syscall (openbsd-amd64), const BIOCSBLEN = 3221504614 +pkg syscall (openbsd-amd64), const BIOCSDIRFILT = 2147762813 +pkg syscall (openbsd-amd64), const BIOCSDLT = 2147762810 +pkg syscall (openbsd-amd64), const BIOCSETF = 2148549223 +pkg syscall (openbsd-amd64), const BIOCSETIF = 2149597804 +pkg syscall (openbsd-amd64), const BIOCSETWF = 2148549239 +pkg syscall (openbsd-amd64), const BIOCSFILDROP = 2147762809 +pkg syscall (openbsd-amd64), const BIOCSHDRCMPLT = 2147762805 +pkg syscall (openbsd-amd64), const BIOCSRSIG = 2147762802 +pkg syscall (openbsd-amd64), const BIOCSRTIMEOUT = 2148549229 +pkg syscall (openbsd-amd64), const BIOCVERSION = 1074020977 +pkg syscall (openbsd-amd64), const BPF_A = 16 +pkg syscall (openbsd-amd64), const BPF_ABS = 32 +pkg syscall (openbsd-amd64), const BPF_ADD = 0 +pkg syscall (openbsd-amd64), const BPF_ALIGNMENT = 4 +pkg syscall (openbsd-amd64), const BPF_ALU = 4 +pkg syscall (openbsd-amd64), const BPF_AND = 80 +pkg syscall (openbsd-amd64), const BPF_B = 16 +pkg syscall (openbsd-amd64), const BPF_DIRECTION_IN = 1 +pkg syscall (openbsd-amd64), const BPF_DIRECTION_OUT = 2 +pkg syscall (openbsd-amd64), const BPF_DIV = 48 +pkg syscall (openbsd-amd64), const BPF_H = 8 +pkg syscall (openbsd-amd64), const BPF_IMM = 0 +pkg syscall (openbsd-amd64), const BPF_IND = 64 +pkg syscall (openbsd-amd64), const BPF_JA = 0 +pkg syscall (openbsd-amd64), const BPF_JEQ = 16 +pkg syscall (openbsd-amd64), const BPF_JGE = 48 +pkg syscall (openbsd-amd64), const BPF_JGT = 32 +pkg syscall (openbsd-amd64), const BPF_JMP = 5 +pkg syscall (openbsd-amd64), const BPF_JSET = 64 +pkg syscall (openbsd-amd64), const BPF_K = 0 +pkg syscall (openbsd-amd64), const BPF_LD = 0 +pkg syscall (openbsd-amd64), const BPF_LDX = 1 +pkg syscall (openbsd-amd64), const BPF_LEN = 128 +pkg syscall (openbsd-amd64), const BPF_LSH = 96 +pkg syscall (openbsd-amd64), const BPF_MAJOR_VERSION = 1 +pkg syscall (openbsd-amd64), const BPF_MAXBUFSIZE = 2097152 +pkg syscall (openbsd-amd64), const BPF_MAXINSNS = 512 +pkg syscall (openbsd-amd64), const BPF_MEM = 96 +pkg syscall (openbsd-amd64), const BPF_MEMWORDS = 16 +pkg syscall (openbsd-amd64), const BPF_MINBUFSIZE = 32 +pkg syscall (openbsd-amd64), const BPF_MINOR_VERSION = 1 +pkg syscall (openbsd-amd64), const BPF_MISC = 7 +pkg syscall (openbsd-amd64), const BPF_MSH = 160 +pkg syscall (openbsd-amd64), const BPF_MUL = 32 +pkg syscall (openbsd-amd64), const BPF_NEG = 128 +pkg syscall (openbsd-amd64), const BPF_OR = 64 +pkg syscall (openbsd-amd64), const BPF_RELEASE = 199606 +pkg syscall (openbsd-amd64), const BPF_RET = 6 +pkg syscall (openbsd-amd64), const BPF_RSH = 112 +pkg syscall (openbsd-amd64), const BPF_ST = 2 +pkg syscall (openbsd-amd64), const BPF_STX = 3 +pkg syscall (openbsd-amd64), const BPF_SUB = 16 +pkg syscall (openbsd-amd64), const BPF_TAX = 0 +pkg syscall (openbsd-amd64), const BPF_TXA = 128 +pkg syscall (openbsd-amd64), const BPF_W = 0 +pkg syscall (openbsd-amd64), const BPF_X = 8 +pkg syscall (openbsd-amd64), const BRKINT = 2 +pkg syscall (openbsd-amd64), const CCR0_FLUSH = 16 +pkg syscall (openbsd-amd64), const CFLUSH = 15 +pkg syscall (openbsd-amd64), const CLOCAL = 32768 +pkg syscall (openbsd-amd64), const CPUID_CFLUSH = 524288 +pkg syscall (openbsd-amd64), const CREAD = 2048 +pkg syscall (openbsd-amd64), const CS5 = 0 +pkg syscall (openbsd-amd64), const CS6 = 256 +pkg syscall (openbsd-amd64), const CS7 = 512 +pkg syscall (openbsd-amd64), const CS8 = 768 +pkg syscall (openbsd-amd64), const CSIZE = 768 +pkg syscall (openbsd-amd64), const CSTART = 17 +pkg syscall (openbsd-amd64), const CSTATUS = 255 +pkg syscall (openbsd-amd64), const CSTOP = 19 +pkg syscall (openbsd-amd64), const CSTOPB = 1024 +pkg syscall (openbsd-amd64), const CSUSP = 26 +pkg syscall (openbsd-amd64), const CTL_MAXNAME = 12 +pkg syscall (openbsd-amd64), const CTL_NET = 4 +pkg syscall (openbsd-amd64), const DIOCOSFPFLUSH = 536888398 +pkg syscall (openbsd-amd64), const DLT_ARCNET = 7 +pkg syscall (openbsd-amd64), const DLT_ATM_RFC1483 = 11 +pkg syscall (openbsd-amd64), const DLT_AX25 = 3 +pkg syscall (openbsd-amd64), const DLT_CHAOS = 5 +pkg syscall (openbsd-amd64), const DLT_C_HDLC = 104 +pkg syscall (openbsd-amd64), const DLT_EN10MB = 1 +pkg syscall (openbsd-amd64), const DLT_EN3MB = 2 +pkg syscall (openbsd-amd64), const DLT_ENC = 13 +pkg syscall (openbsd-amd64), const DLT_FDDI = 10 +pkg syscall (openbsd-amd64), const DLT_IEEE802 = 6 +pkg syscall (openbsd-amd64), const DLT_IEEE802_11 = 105 +pkg syscall (openbsd-amd64), const DLT_IEEE802_11_RADIO = 127 +pkg syscall (openbsd-amd64), const DLT_LOOP = 12 +pkg syscall (openbsd-amd64), const DLT_MPLS = 219 +pkg syscall (openbsd-amd64), const DLT_NULL = 0 +pkg syscall (openbsd-amd64), const DLT_PFLOG = 117 +pkg syscall (openbsd-amd64), const DLT_PFSYNC = 18 +pkg syscall (openbsd-amd64), const DLT_PPP = 9 +pkg syscall (openbsd-amd64), const DLT_PPP_BSDOS = 16 +pkg syscall (openbsd-amd64), const DLT_PPP_ETHER = 51 +pkg syscall (openbsd-amd64), const DLT_PPP_SERIAL = 50 +pkg syscall (openbsd-amd64), const DLT_PRONET = 4 +pkg syscall (openbsd-amd64), const DLT_RAW = 14 +pkg syscall (openbsd-amd64), const DLT_SLIP = 8 +pkg syscall (openbsd-amd64), const DLT_SLIP_BSDOS = 15 +pkg syscall (openbsd-amd64), const DT_BLK = 6 +pkg syscall (openbsd-amd64), const DT_CHR = 2 +pkg syscall (openbsd-amd64), const DT_DIR = 4 +pkg syscall (openbsd-amd64), const DT_FIFO = 1 +pkg syscall (openbsd-amd64), const DT_LNK = 10 +pkg syscall (openbsd-amd64), const DT_REG = 8 +pkg syscall (openbsd-amd64), const DT_SOCK = 12 +pkg syscall (openbsd-amd64), const DT_UNKNOWN = 0 +pkg syscall (openbsd-amd64), const E2BIG = 7 +pkg syscall (openbsd-amd64), const EACCES = 13 +pkg syscall (openbsd-amd64), const EADDRINUSE = 48 +pkg syscall (openbsd-amd64), const EADDRNOTAVAIL = 49 +pkg syscall (openbsd-amd64), const EAFNOSUPPORT = 47 +pkg syscall (openbsd-amd64), const EAGAIN = 35 +pkg syscall (openbsd-amd64), const EALREADY = 37 +pkg syscall (openbsd-amd64), const EAUTH = 80 +pkg syscall (openbsd-amd64), const EBADF = 9 +pkg syscall (openbsd-amd64), const EBADRPC = 72 +pkg syscall (openbsd-amd64), const EBUSY = 16 +pkg syscall (openbsd-amd64), const ECANCELED = 88 +pkg syscall (openbsd-amd64), const ECHILD = 10 +pkg syscall (openbsd-amd64), const ECHO = 8 +pkg syscall (openbsd-amd64), const ECHOCTL = 64 +pkg syscall (openbsd-amd64), const ECHOE = 2 +pkg syscall (openbsd-amd64), const ECHOK = 4 +pkg syscall (openbsd-amd64), const ECHOKE = 1 +pkg syscall (openbsd-amd64), const ECHONL = 16 +pkg syscall (openbsd-amd64), const ECHOPRT = 32 +pkg syscall (openbsd-amd64), const ECONNABORTED = 53 +pkg syscall (openbsd-amd64), const ECONNREFUSED = 61 +pkg syscall (openbsd-amd64), const ECONNRESET = 54 +pkg syscall (openbsd-amd64), const EDEADLK = 11 +pkg syscall (openbsd-amd64), const EDESTADDRREQ = 39 +pkg syscall (openbsd-amd64), const EDOM = 33 +pkg syscall (openbsd-amd64), const EDQUOT = 69 +pkg syscall (openbsd-amd64), const EEXIST = 17 +pkg syscall (openbsd-amd64), const EFAULT = 14 +pkg syscall (openbsd-amd64), const EFBIG = 27 +pkg syscall (openbsd-amd64), const EFER_LMA = 1024 +pkg syscall (openbsd-amd64), const EFER_LME = 256 +pkg syscall (openbsd-amd64), const EFER_NXE = 2048 +pkg syscall (openbsd-amd64), const EFER_SCE = 1 +pkg syscall (openbsd-amd64), const EFTYPE = 79 +pkg syscall (openbsd-amd64), const EHOSTDOWN = 64 +pkg syscall (openbsd-amd64), const EHOSTUNREACH = 65 +pkg syscall (openbsd-amd64), const EIDRM = 89 +pkg syscall (openbsd-amd64), const EILSEQ = 84 +pkg syscall (openbsd-amd64), const EINPROGRESS = 36 +pkg syscall (openbsd-amd64), const EINTR = 4 +pkg syscall (openbsd-amd64), const EINVAL = 22 +pkg syscall (openbsd-amd64), const EIO = 5 +pkg syscall (openbsd-amd64), const EIPSEC = 82 +pkg syscall (openbsd-amd64), const EISCONN = 56 +pkg syscall (openbsd-amd64), const EISDIR = 21 +pkg syscall (openbsd-amd64), const ELAST = 91 +pkg syscall (openbsd-amd64), const ELOOP = 62 +pkg syscall (openbsd-amd64), const EMEDIUMTYPE = 86 +pkg syscall (openbsd-amd64), const EMFILE = 24 +pkg syscall (openbsd-amd64), const EMLINK = 31 +pkg syscall (openbsd-amd64), const EMSGSIZE = 40 +pkg syscall (openbsd-amd64), const EMT_TAGOVF = 1 +pkg syscall (openbsd-amd64), const EMUL_ENABLED = 1 +pkg syscall (openbsd-amd64), const EMUL_NATIVE = 2 +pkg syscall (openbsd-amd64), const ENAMETOOLONG = 63 +pkg syscall (openbsd-amd64), const ENDRUNDISC = 9 +pkg syscall (openbsd-amd64), const ENEEDAUTH = 81 +pkg syscall (openbsd-amd64), const ENETDOWN = 50 +pkg syscall (openbsd-amd64), const ENETRESET = 52 +pkg syscall (openbsd-amd64), const ENETUNREACH = 51 +pkg syscall (openbsd-amd64), const ENFILE = 23 +pkg syscall (openbsd-amd64), const ENOATTR = 83 +pkg syscall (openbsd-amd64), const ENOBUFS = 55 +pkg syscall (openbsd-amd64), const ENODEV = 19 +pkg syscall (openbsd-amd64), const ENOEXEC = 8 +pkg syscall (openbsd-amd64), const ENOLCK = 77 +pkg syscall (openbsd-amd64), const ENOMEDIUM = 85 +pkg syscall (openbsd-amd64), const ENOMEM = 12 +pkg syscall (openbsd-amd64), const ENOMSG = 90 +pkg syscall (openbsd-amd64), const ENOPROTOOPT = 42 +pkg syscall (openbsd-amd64), const ENOSPC = 28 +pkg syscall (openbsd-amd64), const ENOSYS = 78 +pkg syscall (openbsd-amd64), const ENOTBLK = 15 +pkg syscall (openbsd-amd64), const ENOTCONN = 57 +pkg syscall (openbsd-amd64), const ENOTDIR = 20 +pkg syscall (openbsd-amd64), const ENOTEMPTY = 66 +pkg syscall (openbsd-amd64), const ENOTSOCK = 38 +pkg syscall (openbsd-amd64), const ENOTSUP = 91 +pkg syscall (openbsd-amd64), const ENOTTY = 25 +pkg syscall (openbsd-amd64), const ENXIO = 6 +pkg syscall (openbsd-amd64), const EOPNOTSUPP = 45 +pkg syscall (openbsd-amd64), const EOVERFLOW = 87 +pkg syscall (openbsd-amd64), const EPERM = 1 +pkg syscall (openbsd-amd64), const EPFNOSUPPORT = 46 +pkg syscall (openbsd-amd64), const EPIPE = 32 +pkg syscall (openbsd-amd64), const EPROCLIM = 67 +pkg syscall (openbsd-amd64), const EPROCUNAVAIL = 76 +pkg syscall (openbsd-amd64), const EPROGMISMATCH = 75 +pkg syscall (openbsd-amd64), const EPROGUNAVAIL = 74 +pkg syscall (openbsd-amd64), const EPROTONOSUPPORT = 43 +pkg syscall (openbsd-amd64), const EPROTOTYPE = 41 +pkg syscall (openbsd-amd64), const ERANGE = 34 +pkg syscall (openbsd-amd64), const EREMOTE = 71 +pkg syscall (openbsd-amd64), const EROFS = 30 +pkg syscall (openbsd-amd64), const ERPCMISMATCH = 73 +pkg syscall (openbsd-amd64), const ESHUTDOWN = 58 +pkg syscall (openbsd-amd64), const ESOCKTNOSUPPORT = 44 +pkg syscall (openbsd-amd64), const ESPIPE = 29 +pkg syscall (openbsd-amd64), const ESRCH = 3 +pkg syscall (openbsd-amd64), const ESTALE = 70 +pkg syscall (openbsd-amd64), const ETHERMIN = 46 +pkg syscall (openbsd-amd64), const ETHERMTU = 1500 +pkg syscall (openbsd-amd64), const ETHERTYPE_8023 = 4 +pkg syscall (openbsd-amd64), const ETHERTYPE_AARP = 33011 +pkg syscall (openbsd-amd64), const ETHERTYPE_ACCTON = 33680 +pkg syscall (openbsd-amd64), const ETHERTYPE_AEONIC = 32822 +pkg syscall (openbsd-amd64), const ETHERTYPE_ALPHA = 33098 +pkg syscall (openbsd-amd64), const ETHERTYPE_AMBER = 24584 +pkg syscall (openbsd-amd64), const ETHERTYPE_AMOEBA = 33093 +pkg syscall (openbsd-amd64), const ETHERTYPE_AOE = 34978 +pkg syscall (openbsd-amd64), const ETHERTYPE_APOLLO = 33015 +pkg syscall (openbsd-amd64), const ETHERTYPE_APOLLODOMAIN = 32793 +pkg syscall (openbsd-amd64), const ETHERTYPE_APPLETALK = 32923 +pkg syscall (openbsd-amd64), const ETHERTYPE_APPLITEK = 32967 +pkg syscall (openbsd-amd64), const ETHERTYPE_ARGONAUT = 32826 +pkg syscall (openbsd-amd64), const ETHERTYPE_ARP = 2054 +pkg syscall (openbsd-amd64), const ETHERTYPE_AT = 32923 +pkg syscall (openbsd-amd64), const ETHERTYPE_ATALK = 32923 +pkg syscall (openbsd-amd64), const ETHERTYPE_ATOMIC = 34527 +pkg syscall (openbsd-amd64), const ETHERTYPE_ATT = 32873 +pkg syscall (openbsd-amd64), const ETHERTYPE_ATTSTANFORD = 32776 +pkg syscall (openbsd-amd64), const ETHERTYPE_AUTOPHON = 32874 +pkg syscall (openbsd-amd64), const ETHERTYPE_AXIS = 34902 +pkg syscall (openbsd-amd64), const ETHERTYPE_BCLOOP = 36867 +pkg syscall (openbsd-amd64), const ETHERTYPE_BOFL = 33026 +pkg syscall (openbsd-amd64), const ETHERTYPE_CABLETRON = 28724 +pkg syscall (openbsd-amd64), const ETHERTYPE_CHAOS = 2052 +pkg syscall (openbsd-amd64), const ETHERTYPE_COMDESIGN = 32876 +pkg syscall (openbsd-amd64), const ETHERTYPE_COMPUGRAPHIC = 32877 +pkg syscall (openbsd-amd64), const ETHERTYPE_COUNTERPOINT = 32866 +pkg syscall (openbsd-amd64), const ETHERTYPE_CRONUS = 32772 +pkg syscall (openbsd-amd64), const ETHERTYPE_CRONUSVLN = 32771 +pkg syscall (openbsd-amd64), const ETHERTYPE_DCA = 4660 +pkg syscall (openbsd-amd64), const ETHERTYPE_DDE = 32891 +pkg syscall (openbsd-amd64), const ETHERTYPE_DEBNI = 43690 +pkg syscall (openbsd-amd64), const ETHERTYPE_DECAM = 32840 +pkg syscall (openbsd-amd64), const ETHERTYPE_DECCUST = 24582 +pkg syscall (openbsd-amd64), const ETHERTYPE_DECDIAG = 24581 +pkg syscall (openbsd-amd64), const ETHERTYPE_DECDNS = 32828 +pkg syscall (openbsd-amd64), const ETHERTYPE_DECDTS = 32830 +pkg syscall (openbsd-amd64), const ETHERTYPE_DECEXPER = 24576 +pkg syscall (openbsd-amd64), const ETHERTYPE_DECLAST = 32833 +pkg syscall (openbsd-amd64), const ETHERTYPE_DECLTM = 32831 +pkg syscall (openbsd-amd64), const ETHERTYPE_DECMUMPS = 24585 +pkg syscall (openbsd-amd64), const ETHERTYPE_DECNETBIOS = 32832 +pkg syscall (openbsd-amd64), const ETHERTYPE_DELTACON = 34526 +pkg syscall (openbsd-amd64), const ETHERTYPE_DIDDLE = 17185 +pkg syscall (openbsd-amd64), const ETHERTYPE_DLOG1 = 1632 +pkg syscall (openbsd-amd64), const ETHERTYPE_DLOG2 = 1633 +pkg syscall (openbsd-amd64), const ETHERTYPE_DN = 24579 +pkg syscall (openbsd-amd64), const ETHERTYPE_DOGFIGHT = 6537 +pkg syscall (openbsd-amd64), const ETHERTYPE_DSMD = 32825 +pkg syscall (openbsd-amd64), const ETHERTYPE_ECMA = 2051 +pkg syscall (openbsd-amd64), const ETHERTYPE_ENCRYPT = 32829 +pkg syscall (openbsd-amd64), const ETHERTYPE_ES = 32861 +pkg syscall (openbsd-amd64), const ETHERTYPE_EXCELAN = 32784 +pkg syscall (openbsd-amd64), const ETHERTYPE_EXPERDATA = 32841 +pkg syscall (openbsd-amd64), const ETHERTYPE_FLIP = 33094 +pkg syscall (openbsd-amd64), const ETHERTYPE_FLOWCONTROL = 34824 +pkg syscall (openbsd-amd64), const ETHERTYPE_FRARP = 2056 +pkg syscall (openbsd-amd64), const ETHERTYPE_GENDYN = 32872 +pkg syscall (openbsd-amd64), const ETHERTYPE_HAYES = 33072 +pkg syscall (openbsd-amd64), const ETHERTYPE_HIPPI_FP = 33152 +pkg syscall (openbsd-amd64), const ETHERTYPE_HITACHI = 34848 +pkg syscall (openbsd-amd64), const ETHERTYPE_HP = 32773 +pkg syscall (openbsd-amd64), const ETHERTYPE_IEEEPUP = 2560 +pkg syscall (openbsd-amd64), const ETHERTYPE_IEEEPUPAT = 2561 +pkg syscall (openbsd-amd64), const ETHERTYPE_IMLBL = 19522 +pkg syscall (openbsd-amd64), const ETHERTYPE_IMLBLDIAG = 16972 +pkg syscall (openbsd-amd64), const ETHERTYPE_IP = 2048 +pkg syscall (openbsd-amd64), const ETHERTYPE_IPAS = 34668 +pkg syscall (openbsd-amd64), const ETHERTYPE_IPV6 = 34525 +pkg syscall (openbsd-amd64), const ETHERTYPE_IPX = 33079 +pkg syscall (openbsd-amd64), const ETHERTYPE_IPXNEW = 32823 +pkg syscall (openbsd-amd64), const ETHERTYPE_KALPANA = 34178 +pkg syscall (openbsd-amd64), const ETHERTYPE_LANBRIDGE = 32824 +pkg syscall (openbsd-amd64), const ETHERTYPE_LANPROBE = 34952 +pkg syscall (openbsd-amd64), const ETHERTYPE_LAT = 24580 +pkg syscall (openbsd-amd64), const ETHERTYPE_LBACK = 36864 +pkg syscall (openbsd-amd64), const ETHERTYPE_LITTLE = 32864 +pkg syscall (openbsd-amd64), const ETHERTYPE_LLDP = 35020 +pkg syscall (openbsd-amd64), const ETHERTYPE_LOGICRAFT = 33096 +pkg syscall (openbsd-amd64), const ETHERTYPE_LOOPBACK = 36864 +pkg syscall (openbsd-amd64), const ETHERTYPE_MATRA = 32890 +pkg syscall (openbsd-amd64), const ETHERTYPE_MAX = 65535 +pkg syscall (openbsd-amd64), const ETHERTYPE_MERIT = 32892 +pkg syscall (openbsd-amd64), const ETHERTYPE_MICP = 34618 +pkg syscall (openbsd-amd64), const ETHERTYPE_MOPDL = 24577 +pkg syscall (openbsd-amd64), const ETHERTYPE_MOPRC = 24578 +pkg syscall (openbsd-amd64), const ETHERTYPE_MOTOROLA = 33165 +pkg syscall (openbsd-amd64), const ETHERTYPE_MPLS = 34887 +pkg syscall (openbsd-amd64), const ETHERTYPE_MPLS_MCAST = 34888 +pkg syscall (openbsd-amd64), const ETHERTYPE_MUMPS = 33087 +pkg syscall (openbsd-amd64), const ETHERTYPE_NBPCC = 15364 +pkg syscall (openbsd-amd64), const ETHERTYPE_NBPCLAIM = 15369 +pkg syscall (openbsd-amd64), const ETHERTYPE_NBPCLREQ = 15365 +pkg syscall (openbsd-amd64), const ETHERTYPE_NBPCLRSP = 15366 +pkg syscall (openbsd-amd64), const ETHERTYPE_NBPCREQ = 15362 +pkg syscall (openbsd-amd64), const ETHERTYPE_NBPCRSP = 15363 +pkg syscall (openbsd-amd64), const ETHERTYPE_NBPDG = 15367 +pkg syscall (openbsd-amd64), const ETHERTYPE_NBPDGB = 15368 +pkg syscall (openbsd-amd64), const ETHERTYPE_NBPDLTE = 15370 +pkg syscall (openbsd-amd64), const ETHERTYPE_NBPRAR = 15372 +pkg syscall (openbsd-amd64), const ETHERTYPE_NBPRAS = 15371 +pkg syscall (openbsd-amd64), const ETHERTYPE_NBPRST = 15373 +pkg syscall (openbsd-amd64), const ETHERTYPE_NBPSCD = 15361 +pkg syscall (openbsd-amd64), const ETHERTYPE_NBPVCD = 15360 +pkg syscall (openbsd-amd64), const ETHERTYPE_NBS = 2050 +pkg syscall (openbsd-amd64), const ETHERTYPE_NCD = 33097 +pkg syscall (openbsd-amd64), const ETHERTYPE_NESTAR = 32774 +pkg syscall (openbsd-amd64), const ETHERTYPE_NETBEUI = 33169 +pkg syscall (openbsd-amd64), const ETHERTYPE_NOVELL = 33080 +pkg syscall (openbsd-amd64), const ETHERTYPE_NS = 1536 +pkg syscall (openbsd-amd64), const ETHERTYPE_NSAT = 1537 +pkg syscall (openbsd-amd64), const ETHERTYPE_NSCOMPAT = 2055 +pkg syscall (openbsd-amd64), const ETHERTYPE_NTRAILER = 16 +pkg syscall (openbsd-amd64), const ETHERTYPE_OS9 = 28679 +pkg syscall (openbsd-amd64), const ETHERTYPE_OS9NET = 28681 +pkg syscall (openbsd-amd64), const ETHERTYPE_PACER = 32966 +pkg syscall (openbsd-amd64), const ETHERTYPE_PAE = 34958 +pkg syscall (openbsd-amd64), const ETHERTYPE_PCS = 16962 +pkg syscall (openbsd-amd64), const ETHERTYPE_PLANNING = 32836 +pkg syscall (openbsd-amd64), const ETHERTYPE_PPP = 34827 +pkg syscall (openbsd-amd64), const ETHERTYPE_PPPOE = 34916 +pkg syscall (openbsd-amd64), const ETHERTYPE_PPPOEDISC = 34915 +pkg syscall (openbsd-amd64), const ETHERTYPE_PRIMENTS = 28721 +pkg syscall (openbsd-amd64), const ETHERTYPE_PUP = 512 +pkg syscall (openbsd-amd64), const ETHERTYPE_PUPAT = 512 +pkg syscall (openbsd-amd64), const ETHERTYPE_QINQ = 34984 +pkg syscall (openbsd-amd64), const ETHERTYPE_RACAL = 28720 +pkg syscall (openbsd-amd64), const ETHERTYPE_RATIONAL = 33104 +pkg syscall (openbsd-amd64), const ETHERTYPE_RAWFR = 25945 +pkg syscall (openbsd-amd64), const ETHERTYPE_RCL = 6549 +pkg syscall (openbsd-amd64), const ETHERTYPE_RDP = 34617 +pkg syscall (openbsd-amd64), const ETHERTYPE_RETIX = 33010 +pkg syscall (openbsd-amd64), const ETHERTYPE_REVARP = 32821 +pkg syscall (openbsd-amd64), const ETHERTYPE_SCA = 24583 +pkg syscall (openbsd-amd64), const ETHERTYPE_SECTRA = 34523 +pkg syscall (openbsd-amd64), const ETHERTYPE_SECUREDATA = 34669 +pkg syscall (openbsd-amd64), const ETHERTYPE_SGITW = 33150 +pkg syscall (openbsd-amd64), const ETHERTYPE_SG_BOUNCE = 32790 +pkg syscall (openbsd-amd64), const ETHERTYPE_SG_DIAG = 32787 +pkg syscall (openbsd-amd64), const ETHERTYPE_SG_NETGAMES = 32788 +pkg syscall (openbsd-amd64), const ETHERTYPE_SG_RESV = 32789 +pkg syscall (openbsd-amd64), const ETHERTYPE_SIMNET = 21000 +pkg syscall (openbsd-amd64), const ETHERTYPE_SLOW = 34825 +pkg syscall (openbsd-amd64), const ETHERTYPE_SNA = 32981 +pkg syscall (openbsd-amd64), const ETHERTYPE_SNMP = 33100 +pkg syscall (openbsd-amd64), const ETHERTYPE_SONIX = 64245 +pkg syscall (openbsd-amd64), const ETHERTYPE_SPIDER = 32927 +pkg syscall (openbsd-amd64), const ETHERTYPE_SPRITE = 1280 +pkg syscall (openbsd-amd64), const ETHERTYPE_STP = 33153 +pkg syscall (openbsd-amd64), const ETHERTYPE_TALARIS = 33067 +pkg syscall (openbsd-amd64), const ETHERTYPE_TALARISMC = 34091 +pkg syscall (openbsd-amd64), const ETHERTYPE_TCPCOMP = 34667 +pkg syscall (openbsd-amd64), const ETHERTYPE_TCPSM = 36866 +pkg syscall (openbsd-amd64), const ETHERTYPE_TEC = 33103 +pkg syscall (openbsd-amd64), const ETHERTYPE_TIGAN = 32815 +pkg syscall (openbsd-amd64), const ETHERTYPE_TRAIL = 4096 +pkg syscall (openbsd-amd64), const ETHERTYPE_TRANSETHER = 25944 +pkg syscall (openbsd-amd64), const ETHERTYPE_TYMSHARE = 32814 +pkg syscall (openbsd-amd64), const ETHERTYPE_UBBST = 28677 +pkg syscall (openbsd-amd64), const ETHERTYPE_UBDEBUG = 2304 +pkg syscall (openbsd-amd64), const ETHERTYPE_UBDIAGLOOP = 28674 +pkg syscall (openbsd-amd64), const ETHERTYPE_UBDL = 28672 +pkg syscall (openbsd-amd64), const ETHERTYPE_UBNIU = 28673 +pkg syscall (openbsd-amd64), const ETHERTYPE_UBNMC = 28675 +pkg syscall (openbsd-amd64), const ETHERTYPE_VALID = 5632 +pkg syscall (openbsd-amd64), const ETHERTYPE_VARIAN = 32989 +pkg syscall (openbsd-amd64), const ETHERTYPE_VAXELN = 32827 +pkg syscall (openbsd-amd64), const ETHERTYPE_VEECO = 32871 +pkg syscall (openbsd-amd64), const ETHERTYPE_VEXP = 32859 +pkg syscall (openbsd-amd64), const ETHERTYPE_VGLAB = 33073 +pkg syscall (openbsd-amd64), const ETHERTYPE_VINES = 2989 +pkg syscall (openbsd-amd64), const ETHERTYPE_VINESECHO = 2991 +pkg syscall (openbsd-amd64), const ETHERTYPE_VINESLOOP = 2990 +pkg syscall (openbsd-amd64), const ETHERTYPE_VITAL = 65280 +pkg syscall (openbsd-amd64), const ETHERTYPE_VLAN = 33024 +pkg syscall (openbsd-amd64), const ETHERTYPE_VLTLMAN = 32896 +pkg syscall (openbsd-amd64), const ETHERTYPE_VPROD = 32860 +pkg syscall (openbsd-amd64), const ETHERTYPE_VURESERVED = 33095 +pkg syscall (openbsd-amd64), const ETHERTYPE_WATERLOO = 33072 +pkg syscall (openbsd-amd64), const ETHERTYPE_WELLFLEET = 33027 +pkg syscall (openbsd-amd64), const ETHERTYPE_X25 = 2053 +pkg syscall (openbsd-amd64), const ETHERTYPE_X75 = 2049 +pkg syscall (openbsd-amd64), const ETHERTYPE_XNSSM = 36865 +pkg syscall (openbsd-amd64), const ETHERTYPE_XTP = 33149 +pkg syscall (openbsd-amd64), const ETHER_ADDR_LEN = 6 +pkg syscall (openbsd-amd64), const ETHER_ALIGN = 2 +pkg syscall (openbsd-amd64), const ETHER_CRC_LEN = 4 +pkg syscall (openbsd-amd64), const ETHER_CRC_POLY_BE = 79764918 +pkg syscall (openbsd-amd64), const ETHER_CRC_POLY_LE = 3988292384 +pkg syscall (openbsd-amd64), const ETHER_HDR_LEN = 14 +pkg syscall (openbsd-amd64), const ETHER_MAX_DIX_LEN = 1536 +pkg syscall (openbsd-amd64), const ETHER_MAX_LEN = 1518 +pkg syscall (openbsd-amd64), const ETHER_MIN_LEN = 64 +pkg syscall (openbsd-amd64), const ETHER_TYPE_LEN = 2 +pkg syscall (openbsd-amd64), const ETHER_VLAN_ENCAP_LEN = 4 +pkg syscall (openbsd-amd64), const ETIMEDOUT = 60 +pkg syscall (openbsd-amd64), const ETOOMANYREFS = 59 +pkg syscall (openbsd-amd64), const ETXTBSY = 26 +pkg syscall (openbsd-amd64), const EUSERS = 68 +pkg syscall (openbsd-amd64), const EVFILT_AIO = -3 +pkg syscall (openbsd-amd64), const EVFILT_PROC = -5 +pkg syscall (openbsd-amd64), const EVFILT_READ = -1 +pkg syscall (openbsd-amd64), const EVFILT_SIGNAL = -6 +pkg syscall (openbsd-amd64), const EVFILT_SYSCOUNT = 7 +pkg syscall (openbsd-amd64), const EVFILT_TIMER = -7 +pkg syscall (openbsd-amd64), const EVFILT_VNODE = -4 +pkg syscall (openbsd-amd64), const EVFILT_WRITE = -2 +pkg syscall (openbsd-amd64), const EV_ADD = 1 +pkg syscall (openbsd-amd64), const EV_CLEAR = 32 +pkg syscall (openbsd-amd64), const EV_DELETE = 2 +pkg syscall (openbsd-amd64), const EV_DISABLE = 8 +pkg syscall (openbsd-amd64), const EV_ENABLE = 4 +pkg syscall (openbsd-amd64), const EV_EOF = 32768 +pkg syscall (openbsd-amd64), const EV_ERROR = 16384 +pkg syscall (openbsd-amd64), const EV_FLAG1 = 8192 +pkg syscall (openbsd-amd64), const EV_ONESHOT = 16 +pkg syscall (openbsd-amd64), const EV_SYSFLAGS = 61440 +pkg syscall (openbsd-amd64), const EWOULDBLOCK = 35 +pkg syscall (openbsd-amd64), const EXDEV = 18 +pkg syscall (openbsd-amd64), const EXTA = 19200 +pkg syscall (openbsd-amd64), const EXTB = 38400 +pkg syscall (openbsd-amd64), const EXTPROC = 2048 +pkg syscall (openbsd-amd64), const FD_CLOEXEC = 1 +pkg syscall (openbsd-amd64), const FD_SETSIZE = 1024 +pkg syscall (openbsd-amd64), const FLUSHO = 8388608 +pkg syscall (openbsd-amd64), const F_DUPFD = 0 +pkg syscall (openbsd-amd64), const F_DUPFD_CLOEXEC = 10 +pkg syscall (openbsd-amd64), const F_GETFD = 1 +pkg syscall (openbsd-amd64), const F_GETFL = 3 +pkg syscall (openbsd-amd64), const F_GETLK = 7 +pkg syscall (openbsd-amd64), const F_GETOWN = 5 +pkg syscall (openbsd-amd64), const F_OK = 0 +pkg syscall (openbsd-amd64), const F_RDLCK = 1 +pkg syscall (openbsd-amd64), const F_SETFD = 2 +pkg syscall (openbsd-amd64), const F_SETFL = 4 +pkg syscall (openbsd-amd64), const F_SETLK = 8 +pkg syscall (openbsd-amd64), const F_SETLKW = 9 +pkg syscall (openbsd-amd64), const F_SETOWN = 6 +pkg syscall (openbsd-amd64), const F_UNLCK = 2 +pkg syscall (openbsd-amd64), const F_WRLCK = 3 +pkg syscall (openbsd-amd64), const HUPCL = 16384 +pkg syscall (openbsd-amd64), const ICANON = 256 +pkg syscall (openbsd-amd64), const ICRNL = 256 +pkg syscall (openbsd-amd64), const IEXTEN = 1024 +pkg syscall (openbsd-amd64), const IFAN_ARRIVAL = 0 +pkg syscall (openbsd-amd64), const IFAN_DEPARTURE = 1 +pkg syscall (openbsd-amd64), const IFA_ROUTE = 1 +pkg syscall (openbsd-amd64), const IFF_ALLMULTI = 512 +pkg syscall (openbsd-amd64), const IFF_CANTCHANGE = 36434 +pkg syscall (openbsd-amd64), const IFF_DEBUG = 4 +pkg syscall (openbsd-amd64), const IFF_LINK0 = 4096 +pkg syscall (openbsd-amd64), const IFF_LINK1 = 8192 +pkg syscall (openbsd-amd64), const IFF_LINK2 = 16384 +pkg syscall (openbsd-amd64), const IFF_LOOPBACK = 8 +pkg syscall (openbsd-amd64), const IFF_MULTICAST = 32768 +pkg syscall (openbsd-amd64), const IFF_NOARP = 128 +pkg syscall (openbsd-amd64), const IFF_NOTRAILERS = 32 +pkg syscall (openbsd-amd64), const IFF_OACTIVE = 1024 +pkg syscall (openbsd-amd64), const IFF_POINTOPOINT = 16 +pkg syscall (openbsd-amd64), const IFF_PROMISC = 256 +pkg syscall (openbsd-amd64), const IFF_RUNNING = 64 +pkg syscall (openbsd-amd64), const IFF_SIMPLEX = 2048 +pkg syscall (openbsd-amd64), const IFNAMSIZ = 16 +pkg syscall (openbsd-amd64), const IFT_1822 = 2 +pkg syscall (openbsd-amd64), const IFT_A12MPPSWITCH = 130 +pkg syscall (openbsd-amd64), const IFT_AAL2 = 187 +pkg syscall (openbsd-amd64), const IFT_AAL5 = 49 +pkg syscall (openbsd-amd64), const IFT_ADSL = 94 +pkg syscall (openbsd-amd64), const IFT_AFLANE8023 = 59 +pkg syscall (openbsd-amd64), const IFT_AFLANE8025 = 60 +pkg syscall (openbsd-amd64), const IFT_ARAP = 88 +pkg syscall (openbsd-amd64), const IFT_ARCNET = 35 +pkg syscall (openbsd-amd64), const IFT_ARCNETPLUS = 36 +pkg syscall (openbsd-amd64), const IFT_ASYNC = 84 +pkg syscall (openbsd-amd64), const IFT_ATM = 37 +pkg syscall (openbsd-amd64), const IFT_ATMDXI = 105 +pkg syscall (openbsd-amd64), const IFT_ATMFUNI = 106 +pkg syscall (openbsd-amd64), const IFT_ATMIMA = 107 +pkg syscall (openbsd-amd64), const IFT_ATMLOGICAL = 80 +pkg syscall (openbsd-amd64), const IFT_ATMRADIO = 189 +pkg syscall (openbsd-amd64), const IFT_ATMSUBINTERFACE = 134 +pkg syscall (openbsd-amd64), const IFT_ATMVCIENDPT = 194 +pkg syscall (openbsd-amd64), const IFT_ATMVIRTUAL = 149 +pkg syscall (openbsd-amd64), const IFT_BGPPOLICYACCOUNTING = 162 +pkg syscall (openbsd-amd64), const IFT_BLUETOOTH = 248 +pkg syscall (openbsd-amd64), const IFT_BRIDGE = 209 +pkg syscall (openbsd-amd64), const IFT_BSC = 83 +pkg syscall (openbsd-amd64), const IFT_CARP = 247 +pkg syscall (openbsd-amd64), const IFT_CCTEMUL = 61 +pkg syscall (openbsd-amd64), const IFT_CEPT = 19 +pkg syscall (openbsd-amd64), const IFT_CES = 133 +pkg syscall (openbsd-amd64), const IFT_CHANNEL = 70 +pkg syscall (openbsd-amd64), const IFT_CNR = 85 +pkg syscall (openbsd-amd64), const IFT_COFFEE = 132 +pkg syscall (openbsd-amd64), const IFT_COMPOSITELINK = 155 +pkg syscall (openbsd-amd64), const IFT_DCN = 141 +pkg syscall (openbsd-amd64), const IFT_DIGITALPOWERLINE = 138 +pkg syscall (openbsd-amd64), const IFT_DIGITALWRAPPEROVERHEADCHANNEL = 186 +pkg syscall (openbsd-amd64), const IFT_DLSW = 74 +pkg syscall (openbsd-amd64), const IFT_DOCSCABLEDOWNSTREAM = 128 +pkg syscall (openbsd-amd64), const IFT_DOCSCABLEMACLAYER = 127 +pkg syscall (openbsd-amd64), const IFT_DOCSCABLEUPSTREAM = 129 +pkg syscall (openbsd-amd64), const IFT_DOCSCABLEUPSTREAMCHANNEL = 205 +pkg syscall (openbsd-amd64), const IFT_DS0 = 81 +pkg syscall (openbsd-amd64), const IFT_DS0BUNDLE = 82 +pkg syscall (openbsd-amd64), const IFT_DS1FDL = 170 +pkg syscall (openbsd-amd64), const IFT_DS3 = 30 +pkg syscall (openbsd-amd64), const IFT_DTM = 140 +pkg syscall (openbsd-amd64), const IFT_DUMMY = 241 +pkg syscall (openbsd-amd64), const IFT_DVBASILN = 172 +pkg syscall (openbsd-amd64), const IFT_DVBASIOUT = 173 +pkg syscall (openbsd-amd64), const IFT_DVBRCCDOWNSTREAM = 147 +pkg syscall (openbsd-amd64), const IFT_DVBRCCMACLAYER = 146 +pkg syscall (openbsd-amd64), const IFT_DVBRCCUPSTREAM = 148 +pkg syscall (openbsd-amd64), const IFT_ECONET = 206 +pkg syscall (openbsd-amd64), const IFT_ENC = 244 +pkg syscall (openbsd-amd64), const IFT_EON = 25 +pkg syscall (openbsd-amd64), const IFT_EPLRS = 87 +pkg syscall (openbsd-amd64), const IFT_ESCON = 73 +pkg syscall (openbsd-amd64), const IFT_ETHER = 6 +pkg syscall (openbsd-amd64), const IFT_FAITH = 243 +pkg syscall (openbsd-amd64), const IFT_FAST = 125 +pkg syscall (openbsd-amd64), const IFT_FASTETHER = 62 +pkg syscall (openbsd-amd64), const IFT_FASTETHERFX = 69 +pkg syscall (openbsd-amd64), const IFT_FDDI = 15 +pkg syscall (openbsd-amd64), const IFT_FIBRECHANNEL = 56 +pkg syscall (openbsd-amd64), const IFT_FRAMERELAYINTERCONNECT = 58 +pkg syscall (openbsd-amd64), const IFT_FRAMERELAYMPI = 92 +pkg syscall (openbsd-amd64), const IFT_FRDLCIENDPT = 193 +pkg syscall (openbsd-amd64), const IFT_FRELAY = 32 +pkg syscall (openbsd-amd64), const IFT_FRELAYDCE = 44 +pkg syscall (openbsd-amd64), const IFT_FRF16MFRBUNDLE = 163 +pkg syscall (openbsd-amd64), const IFT_FRFORWARD = 158 +pkg syscall (openbsd-amd64), const IFT_G703AT2MB = 67 +pkg syscall (openbsd-amd64), const IFT_G703AT64K = 66 +pkg syscall (openbsd-amd64), const IFT_GIF = 240 +pkg syscall (openbsd-amd64), const IFT_GIGABITETHERNET = 117 +pkg syscall (openbsd-amd64), const IFT_GR303IDT = 178 +pkg syscall (openbsd-amd64), const IFT_GR303RDT = 177 +pkg syscall (openbsd-amd64), const IFT_H323GATEKEEPER = 164 +pkg syscall (openbsd-amd64), const IFT_H323PROXY = 165 +pkg syscall (openbsd-amd64), const IFT_HDH1822 = 3 +pkg syscall (openbsd-amd64), const IFT_HDLC = 118 +pkg syscall (openbsd-amd64), const IFT_HDSL2 = 168 +pkg syscall (openbsd-amd64), const IFT_HIPERLAN2 = 183 +pkg syscall (openbsd-amd64), const IFT_HIPPI = 47 +pkg syscall (openbsd-amd64), const IFT_HIPPIINTERFACE = 57 +pkg syscall (openbsd-amd64), const IFT_HOSTPAD = 90 +pkg syscall (openbsd-amd64), const IFT_HSSI = 46 +pkg syscall (openbsd-amd64), const IFT_HY = 14 +pkg syscall (openbsd-amd64), const IFT_IBM370PARCHAN = 72 +pkg syscall (openbsd-amd64), const IFT_IDSL = 154 +pkg syscall (openbsd-amd64), const IFT_IEEE1394 = 144 +pkg syscall (openbsd-amd64), const IFT_IEEE80211 = 71 +pkg syscall (openbsd-amd64), const IFT_IEEE80212 = 55 +pkg syscall (openbsd-amd64), const IFT_IEEE8023ADLAG = 161 +pkg syscall (openbsd-amd64), const IFT_IFGSN = 145 +pkg syscall (openbsd-amd64), const IFT_IMT = 190 +pkg syscall (openbsd-amd64), const IFT_INFINIBAND = 199 +pkg syscall (openbsd-amd64), const IFT_INTERLEAVE = 124 +pkg syscall (openbsd-amd64), const IFT_IP = 126 +pkg syscall (openbsd-amd64), const IFT_IPFORWARD = 142 +pkg syscall (openbsd-amd64), const IFT_IPOVERATM = 114 +pkg syscall (openbsd-amd64), const IFT_IPOVERCDLC = 109 +pkg syscall (openbsd-amd64), const IFT_IPOVERCLAW = 110 +pkg syscall (openbsd-amd64), const IFT_IPSWITCH = 78 +pkg syscall (openbsd-amd64), const IFT_ISDN = 63 +pkg syscall (openbsd-amd64), const IFT_ISDNBASIC = 20 +pkg syscall (openbsd-amd64), const IFT_ISDNPRIMARY = 21 +pkg syscall (openbsd-amd64), const IFT_ISDNS = 75 +pkg syscall (openbsd-amd64), const IFT_ISDNU = 76 +pkg syscall (openbsd-amd64), const IFT_ISO88022LLC = 41 +pkg syscall (openbsd-amd64), const IFT_ISO88023 = 7 +pkg syscall (openbsd-amd64), const IFT_ISO88024 = 8 +pkg syscall (openbsd-amd64), const IFT_ISO88025 = 9 +pkg syscall (openbsd-amd64), const IFT_ISO88025CRFPINT = 98 +pkg syscall (openbsd-amd64), const IFT_ISO88025DTR = 86 +pkg syscall (openbsd-amd64), const IFT_ISO88025FIBER = 115 +pkg syscall (openbsd-amd64), const IFT_ISO88026 = 10 +pkg syscall (openbsd-amd64), const IFT_ISUP = 179 +pkg syscall (openbsd-amd64), const IFT_L2VLAN = 135 +pkg syscall (openbsd-amd64), const IFT_L3IPVLAN = 136 +pkg syscall (openbsd-amd64), const IFT_L3IPXVLAN = 137 +pkg syscall (openbsd-amd64), const IFT_LAPB = 16 +pkg syscall (openbsd-amd64), const IFT_LAPD = 77 +pkg syscall (openbsd-amd64), const IFT_LAPF = 119 +pkg syscall (openbsd-amd64), const IFT_LINEGROUP = 210 +pkg syscall (openbsd-amd64), const IFT_LOCALTALK = 42 +pkg syscall (openbsd-amd64), const IFT_LOOP = 24 +pkg syscall (openbsd-amd64), const IFT_MEDIAMAILOVERIP = 139 +pkg syscall (openbsd-amd64), const IFT_MFSIGLINK = 167 +pkg syscall (openbsd-amd64), const IFT_MIOX25 = 38 +pkg syscall (openbsd-amd64), const IFT_MODEM = 48 +pkg syscall (openbsd-amd64), const IFT_MPC = 113 +pkg syscall (openbsd-amd64), const IFT_MPLS = 166 +pkg syscall (openbsd-amd64), const IFT_MPLSTUNNEL = 150 +pkg syscall (openbsd-amd64), const IFT_MSDSL = 143 +pkg syscall (openbsd-amd64), const IFT_MVL = 191 +pkg syscall (openbsd-amd64), const IFT_MYRINET = 99 +pkg syscall (openbsd-amd64), const IFT_NFAS = 175 +pkg syscall (openbsd-amd64), const IFT_NSIP = 27 +pkg syscall (openbsd-amd64), const IFT_OPTICALCHANNEL = 195 +pkg syscall (openbsd-amd64), const IFT_OPTICALTRANSPORT = 196 +pkg syscall (openbsd-amd64), const IFT_OTHER = 1 +pkg syscall (openbsd-amd64), const IFT_P10 = 12 +pkg syscall (openbsd-amd64), const IFT_P80 = 13 +pkg syscall (openbsd-amd64), const IFT_PARA = 34 +pkg syscall (openbsd-amd64), const IFT_PFLOG = 245 +pkg syscall (openbsd-amd64), const IFT_PFLOW = 249 +pkg syscall (openbsd-amd64), const IFT_PFSYNC = 246 +pkg syscall (openbsd-amd64), const IFT_PLC = 174 +pkg syscall (openbsd-amd64), const IFT_PON155 = 207 +pkg syscall (openbsd-amd64), const IFT_PON622 = 208 +pkg syscall (openbsd-amd64), const IFT_POS = 171 +pkg syscall (openbsd-amd64), const IFT_PPP = 23 +pkg syscall (openbsd-amd64), const IFT_PPPMULTILINKBUNDLE = 108 +pkg syscall (openbsd-amd64), const IFT_PROPATM = 197 +pkg syscall (openbsd-amd64), const IFT_PROPBWAP2MP = 184 +pkg syscall (openbsd-amd64), const IFT_PROPCNLS = 89 +pkg syscall (openbsd-amd64), const IFT_PROPDOCSWIRELESSDOWNSTREAM = 181 +pkg syscall (openbsd-amd64), const IFT_PROPDOCSWIRELESSMACLAYER = 180 +pkg syscall (openbsd-amd64), const IFT_PROPDOCSWIRELESSUPSTREAM = 182 +pkg syscall (openbsd-amd64), const IFT_PROPMUX = 54 +pkg syscall (openbsd-amd64), const IFT_PROPVIRTUAL = 53 +pkg syscall (openbsd-amd64), const IFT_PROPWIRELESSP2P = 157 +pkg syscall (openbsd-amd64), const IFT_PTPSERIAL = 22 +pkg syscall (openbsd-amd64), const IFT_PVC = 242 +pkg syscall (openbsd-amd64), const IFT_Q2931 = 201 +pkg syscall (openbsd-amd64), const IFT_QLLC = 68 +pkg syscall (openbsd-amd64), const IFT_RADIOMAC = 188 +pkg syscall (openbsd-amd64), const IFT_RADSL = 95 +pkg syscall (openbsd-amd64), const IFT_REACHDSL = 192 +pkg syscall (openbsd-amd64), const IFT_RFC1483 = 159 +pkg syscall (openbsd-amd64), const IFT_RS232 = 33 +pkg syscall (openbsd-amd64), const IFT_RSRB = 79 +pkg syscall (openbsd-amd64), const IFT_SDLC = 17 +pkg syscall (openbsd-amd64), const IFT_SDSL = 96 +pkg syscall (openbsd-amd64), const IFT_SHDSL = 169 +pkg syscall (openbsd-amd64), const IFT_SIP = 31 +pkg syscall (openbsd-amd64), const IFT_SIPSIG = 204 +pkg syscall (openbsd-amd64), const IFT_SIPTG = 203 +pkg syscall (openbsd-amd64), const IFT_SLIP = 28 +pkg syscall (openbsd-amd64), const IFT_SMDSDXI = 43 +pkg syscall (openbsd-amd64), const IFT_SMDSICIP = 52 +pkg syscall (openbsd-amd64), const IFT_SONET = 39 +pkg syscall (openbsd-amd64), const IFT_SONETOVERHEADCHANNEL = 185 +pkg syscall (openbsd-amd64), const IFT_SONETPATH = 50 +pkg syscall (openbsd-amd64), const IFT_SONETVT = 51 +pkg syscall (openbsd-amd64), const IFT_SRP = 151 +pkg syscall (openbsd-amd64), const IFT_SS7SIGLINK = 156 +pkg syscall (openbsd-amd64), const IFT_STACKTOSTACK = 111 +pkg syscall (openbsd-amd64), const IFT_STARLAN = 11 +pkg syscall (openbsd-amd64), const IFT_T1 = 18 +pkg syscall (openbsd-amd64), const IFT_TDLC = 116 +pkg syscall (openbsd-amd64), const IFT_TELINK = 200 +pkg syscall (openbsd-amd64), const IFT_TERMPAD = 91 +pkg syscall (openbsd-amd64), const IFT_TR008 = 176 +pkg syscall (openbsd-amd64), const IFT_TRANSPHDLC = 123 +pkg syscall (openbsd-amd64), const IFT_TUNNEL = 131 +pkg syscall (openbsd-amd64), const IFT_ULTRA = 29 +pkg syscall (openbsd-amd64), const IFT_USB = 160 +pkg syscall (openbsd-amd64), const IFT_V11 = 64 +pkg syscall (openbsd-amd64), const IFT_V35 = 45 +pkg syscall (openbsd-amd64), const IFT_V36 = 65 +pkg syscall (openbsd-amd64), const IFT_V37 = 120 +pkg syscall (openbsd-amd64), const IFT_VDSL = 97 +pkg syscall (openbsd-amd64), const IFT_VIRTUALIPADDRESS = 112 +pkg syscall (openbsd-amd64), const IFT_VIRTUALTG = 202 +pkg syscall (openbsd-amd64), const IFT_VOICEDID = 213 +pkg syscall (openbsd-amd64), const IFT_VOICEEM = 100 +pkg syscall (openbsd-amd64), const IFT_VOICEEMFGD = 211 +pkg syscall (openbsd-amd64), const IFT_VOICEENCAP = 103 +pkg syscall (openbsd-amd64), const IFT_VOICEFGDEANA = 212 +pkg syscall (openbsd-amd64), const IFT_VOICEFXO = 101 +pkg syscall (openbsd-amd64), const IFT_VOICEFXS = 102 +pkg syscall (openbsd-amd64), const IFT_VOICEOVERATM = 152 +pkg syscall (openbsd-amd64), const IFT_VOICEOVERCABLE = 198 +pkg syscall (openbsd-amd64), const IFT_VOICEOVERFRAMERELAY = 153 +pkg syscall (openbsd-amd64), const IFT_VOICEOVERIP = 104 +pkg syscall (openbsd-amd64), const IFT_X213 = 93 +pkg syscall (openbsd-amd64), const IFT_X25 = 5 +pkg syscall (openbsd-amd64), const IFT_X25DDN = 4 +pkg syscall (openbsd-amd64), const IFT_X25HUNTGROUP = 122 +pkg syscall (openbsd-amd64), const IFT_X25MLP = 121 +pkg syscall (openbsd-amd64), const IFT_X25PLE = 40 +pkg syscall (openbsd-amd64), const IFT_XETHER = 26 +pkg syscall (openbsd-amd64), const IGNBRK = 1 +pkg syscall (openbsd-amd64), const IGNCR = 128 +pkg syscall (openbsd-amd64), const IGNPAR = 4 +pkg syscall (openbsd-amd64), const IMAXBEL = 8192 +pkg syscall (openbsd-amd64), const INLCR = 64 +pkg syscall (openbsd-amd64), const INPCK = 16 +pkg syscall (openbsd-amd64), const IN_CLASSA_HOST = 16777215 +pkg syscall (openbsd-amd64), const IN_CLASSA_MAX = 128 +pkg syscall (openbsd-amd64), const IN_CLASSA_NET = 4278190080 +pkg syscall (openbsd-amd64), const IN_CLASSA_NSHIFT = 24 +pkg syscall (openbsd-amd64), const IN_CLASSB_HOST = 65535 +pkg syscall (openbsd-amd64), const IN_CLASSB_MAX = 65536 +pkg syscall (openbsd-amd64), const IN_CLASSB_NET = 4294901760 +pkg syscall (openbsd-amd64), const IN_CLASSB_NSHIFT = 16 +pkg syscall (openbsd-amd64), const IN_CLASSC_HOST = 255 +pkg syscall (openbsd-amd64), const IN_CLASSC_NET = 4294967040 +pkg syscall (openbsd-amd64), const IN_CLASSC_NSHIFT = 8 +pkg syscall (openbsd-amd64), const IN_CLASSD_HOST = 268435455 +pkg syscall (openbsd-amd64), const IN_CLASSD_NET = 4026531840 +pkg syscall (openbsd-amd64), const IN_CLASSD_NSHIFT = 28 +pkg syscall (openbsd-amd64), const IN_LOOPBACKNET = 127 +pkg syscall (openbsd-amd64), const IN_RFC3021_HOST = 1 +pkg syscall (openbsd-amd64), const IN_RFC3021_NET = 4294967294 +pkg syscall (openbsd-amd64), const IN_RFC3021_NSHIFT = 31 +pkg syscall (openbsd-amd64), const IPPROTO_AH = 51 +pkg syscall (openbsd-amd64), const IPPROTO_CARP = 112 +pkg syscall (openbsd-amd64), const IPPROTO_DIVERT = 258 +pkg syscall (openbsd-amd64), const IPPROTO_DONE = 257 +pkg syscall (openbsd-amd64), const IPPROTO_DSTOPTS = 60 +pkg syscall (openbsd-amd64), const IPPROTO_EGP = 8 +pkg syscall (openbsd-amd64), const IPPROTO_ENCAP = 98 +pkg syscall (openbsd-amd64), const IPPROTO_EON = 80 +pkg syscall (openbsd-amd64), const IPPROTO_ESP = 50 +pkg syscall (openbsd-amd64), const IPPROTO_ETHERIP = 97 +pkg syscall (openbsd-amd64), const IPPROTO_FRAGMENT = 44 +pkg syscall (openbsd-amd64), const IPPROTO_GGP = 3 +pkg syscall (openbsd-amd64), const IPPROTO_GRE = 47 +pkg syscall (openbsd-amd64), const IPPROTO_HOPOPTS = 0 +pkg syscall (openbsd-amd64), const IPPROTO_ICMP = 1 +pkg syscall (openbsd-amd64), const IPPROTO_ICMPV6 = 58 +pkg syscall (openbsd-amd64), const IPPROTO_IDP = 22 +pkg syscall (openbsd-amd64), const IPPROTO_IGMP = 2 +pkg syscall (openbsd-amd64), const IPPROTO_IPCOMP = 108 +pkg syscall (openbsd-amd64), const IPPROTO_IPIP = 4 +pkg syscall (openbsd-amd64), const IPPROTO_IPV4 = 4 +pkg syscall (openbsd-amd64), const IPPROTO_MAX = 256 +pkg syscall (openbsd-amd64), const IPPROTO_MAXID = 259 +pkg syscall (openbsd-amd64), const IPPROTO_MOBILE = 55 +pkg syscall (openbsd-amd64), const IPPROTO_MPLS = 137 +pkg syscall (openbsd-amd64), const IPPROTO_NONE = 59 +pkg syscall (openbsd-amd64), const IPPROTO_PFSYNC = 240 +pkg syscall (openbsd-amd64), const IPPROTO_PIM = 103 +pkg syscall (openbsd-amd64), const IPPROTO_PUP = 12 +pkg syscall (openbsd-amd64), const IPPROTO_RAW = 255 +pkg syscall (openbsd-amd64), const IPPROTO_ROUTING = 43 +pkg syscall (openbsd-amd64), const IPPROTO_RSVP = 46 +pkg syscall (openbsd-amd64), const IPPROTO_TP = 29 +pkg syscall (openbsd-amd64), const IPV6_AUTH_LEVEL = 53 +pkg syscall (openbsd-amd64), const IPV6_AUTOFLOWLABEL = 59 +pkg syscall (openbsd-amd64), const IPV6_CHECKSUM = 26 +pkg syscall (openbsd-amd64), const IPV6_DEFAULT_MULTICAST_HOPS = 1 +pkg syscall (openbsd-amd64), const IPV6_DEFAULT_MULTICAST_LOOP = 1 +pkg syscall (openbsd-amd64), const IPV6_DEFHLIM = 64 +pkg syscall (openbsd-amd64), const IPV6_DONTFRAG = 62 +pkg syscall (openbsd-amd64), const IPV6_DSTOPTS = 50 +pkg syscall (openbsd-amd64), const IPV6_ESP_NETWORK_LEVEL = 55 +pkg syscall (openbsd-amd64), const IPV6_ESP_TRANS_LEVEL = 54 +pkg syscall (openbsd-amd64), const IPV6_FAITH = 29 +pkg syscall (openbsd-amd64), const IPV6_FLOWINFO_MASK = 4294967055 +pkg syscall (openbsd-amd64), const IPV6_FLOWLABEL_MASK = 4294905600 +pkg syscall (openbsd-amd64), const IPV6_FRAGTTL = 120 +pkg syscall (openbsd-amd64), const IPV6_HLIMDEC = 1 +pkg syscall (openbsd-amd64), const IPV6_HOPLIMIT = 47 +pkg syscall (openbsd-amd64), const IPV6_HOPOPTS = 49 +pkg syscall (openbsd-amd64), const IPV6_IPCOMP_LEVEL = 60 +pkg syscall (openbsd-amd64), const IPV6_JOIN_GROUP = 12 +pkg syscall (openbsd-amd64), const IPV6_LEAVE_GROUP = 13 +pkg syscall (openbsd-amd64), const IPV6_MAXHLIM = 255 +pkg syscall (openbsd-amd64), const IPV6_MAXPACKET = 65535 +pkg syscall (openbsd-amd64), const IPV6_MMTU = 1280 +pkg syscall (openbsd-amd64), const IPV6_MULTICAST_HOPS = 10 +pkg syscall (openbsd-amd64), const IPV6_MULTICAST_IF = 9 +pkg syscall (openbsd-amd64), const IPV6_MULTICAST_LOOP = 11 +pkg syscall (openbsd-amd64), const IPV6_NEXTHOP = 48 +pkg syscall (openbsd-amd64), const IPV6_OPTIONS = 1 +pkg syscall (openbsd-amd64), const IPV6_PATHMTU = 44 +pkg syscall (openbsd-amd64), const IPV6_PIPEX = 63 +pkg syscall (openbsd-amd64), const IPV6_PKTINFO = 46 +pkg syscall (openbsd-amd64), const IPV6_PORTRANGE = 14 +pkg syscall (openbsd-amd64), const IPV6_PORTRANGE_DEFAULT = 0 +pkg syscall (openbsd-amd64), const IPV6_PORTRANGE_HIGH = 1 +pkg syscall (openbsd-amd64), const IPV6_PORTRANGE_LOW = 2 +pkg syscall (openbsd-amd64), const IPV6_RECVDSTOPTS = 40 +pkg syscall (openbsd-amd64), const IPV6_RECVHOPLIMIT = 37 +pkg syscall (openbsd-amd64), const IPV6_RECVHOPOPTS = 39 +pkg syscall (openbsd-amd64), const IPV6_RECVPATHMTU = 43 +pkg syscall (openbsd-amd64), const IPV6_RECVPKTINFO = 36 +pkg syscall (openbsd-amd64), const IPV6_RECVRTHDR = 38 +pkg syscall (openbsd-amd64), const IPV6_RECVTCLASS = 57 +pkg syscall (openbsd-amd64), const IPV6_RTABLE = 4129 +pkg syscall (openbsd-amd64), const IPV6_RTHDR = 51 +pkg syscall (openbsd-amd64), const IPV6_RTHDRDSTOPTS = 35 +pkg syscall (openbsd-amd64), const IPV6_RTHDR_LOOSE = 0 +pkg syscall (openbsd-amd64), const IPV6_RTHDR_STRICT = 1 +pkg syscall (openbsd-amd64), const IPV6_RTHDR_TYPE_0 = 0 +pkg syscall (openbsd-amd64), const IPV6_SOCKOPT_RESERVED1 = 3 +pkg syscall (openbsd-amd64), const IPV6_TCLASS = 61 +pkg syscall (openbsd-amd64), const IPV6_UNICAST_HOPS = 4 +pkg syscall (openbsd-amd64), const IPV6_USE_MIN_MTU = 42 +pkg syscall (openbsd-amd64), const IPV6_V6ONLY = 27 +pkg syscall (openbsd-amd64), const IPV6_VERSION = 96 +pkg syscall (openbsd-amd64), const IPV6_VERSION_MASK = 240 +pkg syscall (openbsd-amd64), const IP_ADD_MEMBERSHIP = 12 +pkg syscall (openbsd-amd64), const IP_AUTH_LEVEL = 20 +pkg syscall (openbsd-amd64), const IP_DEFAULT_MULTICAST_LOOP = 1 +pkg syscall (openbsd-amd64), const IP_DEFAULT_MULTICAST_TTL = 1 +pkg syscall (openbsd-amd64), const IP_DF = 16384 +pkg syscall (openbsd-amd64), const IP_DROP_MEMBERSHIP = 13 +pkg syscall (openbsd-amd64), const IP_ESP_NETWORK_LEVEL = 22 +pkg syscall (openbsd-amd64), const IP_ESP_TRANS_LEVEL = 21 +pkg syscall (openbsd-amd64), const IP_HDRINCL = 2 +pkg syscall (openbsd-amd64), const IP_IPCOMP_LEVEL = 29 +pkg syscall (openbsd-amd64), const IP_IPSECFLOWINFO = 36 +pkg syscall (openbsd-amd64), const IP_IPSEC_LOCAL_AUTH = 27 +pkg syscall (openbsd-amd64), const IP_IPSEC_LOCAL_CRED = 25 +pkg syscall (openbsd-amd64), const IP_IPSEC_LOCAL_ID = 23 +pkg syscall (openbsd-amd64), const IP_IPSEC_REMOTE_AUTH = 28 +pkg syscall (openbsd-amd64), const IP_IPSEC_REMOTE_CRED = 26 +pkg syscall (openbsd-amd64), const IP_IPSEC_REMOTE_ID = 24 +pkg syscall (openbsd-amd64), const IP_MAXPACKET = 65535 +pkg syscall (openbsd-amd64), const IP_MAX_MEMBERSHIPS = 4095 +pkg syscall (openbsd-amd64), const IP_MF = 8192 +pkg syscall (openbsd-amd64), const IP_MINTTL = 32 +pkg syscall (openbsd-amd64), const IP_MIN_MEMBERSHIPS = 15 +pkg syscall (openbsd-amd64), const IP_MSS = 576 +pkg syscall (openbsd-amd64), const IP_MULTICAST_IF = 9 +pkg syscall (openbsd-amd64), const IP_MULTICAST_LOOP = 11 +pkg syscall (openbsd-amd64), const IP_MULTICAST_TTL = 10 +pkg syscall (openbsd-amd64), const IP_OFFMASK = 8191 +pkg syscall (openbsd-amd64), const IP_OPTIONS = 1 +pkg syscall (openbsd-amd64), const IP_PIPEX = 34 +pkg syscall (openbsd-amd64), const IP_PORTRANGE = 19 +pkg syscall (openbsd-amd64), const IP_PORTRANGE_DEFAULT = 0 +pkg syscall (openbsd-amd64), const IP_PORTRANGE_HIGH = 1 +pkg syscall (openbsd-amd64), const IP_PORTRANGE_LOW = 2 +pkg syscall (openbsd-amd64), const IP_RECVDSTADDR = 7 +pkg syscall (openbsd-amd64), const IP_RECVDSTPORT = 33 +pkg syscall (openbsd-amd64), const IP_RECVIF = 30 +pkg syscall (openbsd-amd64), const IP_RECVOPTS = 5 +pkg syscall (openbsd-amd64), const IP_RECVRETOPTS = 6 +pkg syscall (openbsd-amd64), const IP_RECVRTABLE = 35 +pkg syscall (openbsd-amd64), const IP_RECVTTL = 31 +pkg syscall (openbsd-amd64), const IP_RETOPTS = 8 +pkg syscall (openbsd-amd64), const IP_RF = 32768 +pkg syscall (openbsd-amd64), const IP_RTABLE = 4129 +pkg syscall (openbsd-amd64), const IP_TOS = 3 +pkg syscall (openbsd-amd64), const IP_TTL = 4 +pkg syscall (openbsd-amd64), const ISIG = 128 +pkg syscall (openbsd-amd64), const ISTRIP = 32 +pkg syscall (openbsd-amd64), const IXANY = 2048 +pkg syscall (openbsd-amd64), const IXOFF = 1024 +pkg syscall (openbsd-amd64), const IXON = 512 +pkg syscall (openbsd-amd64), const ImplementsGetwd = false +pkg syscall (openbsd-amd64), const LCNT_OVERLOAD_FLUSH = 6 +pkg syscall (openbsd-amd64), const LOCK_EX = 2 +pkg syscall (openbsd-amd64), const LOCK_NB = 4 +pkg syscall (openbsd-amd64), const LOCK_SH = 1 +pkg syscall (openbsd-amd64), const LOCK_UN = 8 +pkg syscall (openbsd-amd64), const MSG_BCAST = 256 +pkg syscall (openbsd-amd64), const MSG_CTRUNC = 32 +pkg syscall (openbsd-amd64), const MSG_DONTROUTE = 4 +pkg syscall (openbsd-amd64), const MSG_DONTWAIT = 128 +pkg syscall (openbsd-amd64), const MSG_EOR = 8 +pkg syscall (openbsd-amd64), const MSG_MCAST = 512 +pkg syscall (openbsd-amd64), const MSG_NOSIGNAL = 1024 +pkg syscall (openbsd-amd64), const MSG_OOB = 1 +pkg syscall (openbsd-amd64), const MSG_PEEK = 2 +pkg syscall (openbsd-amd64), const MSG_TRUNC = 16 +pkg syscall (openbsd-amd64), const MSG_WAITALL = 64 +pkg syscall (openbsd-amd64), const NAME_MAX = 255 +pkg syscall (openbsd-amd64), const NET_RT_DUMP = 1 +pkg syscall (openbsd-amd64), const NET_RT_FLAGS = 2 +pkg syscall (openbsd-amd64), const NET_RT_IFLIST = 3 +pkg syscall (openbsd-amd64), const NET_RT_MAXID = 6 +pkg syscall (openbsd-amd64), const NET_RT_STATS = 4 +pkg syscall (openbsd-amd64), const NET_RT_TABLE = 5 +pkg syscall (openbsd-amd64), const NOFLSH = 2147483648 +pkg syscall (openbsd-amd64), const NOTE_ATTRIB = 8 +pkg syscall (openbsd-amd64), const NOTE_CHILD = 4 +pkg syscall (openbsd-amd64), const NOTE_DELETE = 1 +pkg syscall (openbsd-amd64), const NOTE_EOF = 2 +pkg syscall (openbsd-amd64), const NOTE_EXEC = 536870912 +pkg syscall (openbsd-amd64), const NOTE_EXIT = 2147483648 +pkg syscall (openbsd-amd64), const NOTE_EXTEND = 4 +pkg syscall (openbsd-amd64), const NOTE_FORK = 1073741824 +pkg syscall (openbsd-amd64), const NOTE_LINK = 16 +pkg syscall (openbsd-amd64), const NOTE_LOWAT = 1 +pkg syscall (openbsd-amd64), const NOTE_PCTRLMASK = 4026531840 +pkg syscall (openbsd-amd64), const NOTE_PDATAMASK = 1048575 +pkg syscall (openbsd-amd64), const NOTE_RENAME = 32 +pkg syscall (openbsd-amd64), const NOTE_REVOKE = 64 +pkg syscall (openbsd-amd64), const NOTE_TRACK = 1 +pkg syscall (openbsd-amd64), const NOTE_TRACKERR = 2 +pkg syscall (openbsd-amd64), const NOTE_TRUNCATE = 128 +pkg syscall (openbsd-amd64), const NOTE_WRITE = 2 +pkg syscall (openbsd-amd64), const OCRNL = 16 +pkg syscall (openbsd-amd64), const ONLCR = 2 +pkg syscall (openbsd-amd64), const ONLRET = 128 +pkg syscall (openbsd-amd64), const ONOCR = 64 +pkg syscall (openbsd-amd64), const ONOEOT = 8 +pkg syscall (openbsd-amd64), const OPOST = 1 +pkg syscall (openbsd-amd64), const O_ACCMODE = 3 +pkg syscall (openbsd-amd64), const O_APPEND = 8 +pkg syscall (openbsd-amd64), const O_ASYNC = 64 +pkg syscall (openbsd-amd64), const O_CLOEXEC = 65536 +pkg syscall (openbsd-amd64), const O_CREAT = 512 +pkg syscall (openbsd-amd64), const O_DIRECTORY = 131072 +pkg syscall (openbsd-amd64), const O_DSYNC = 128 +pkg syscall (openbsd-amd64), const O_EXCL = 2048 +pkg syscall (openbsd-amd64), const O_EXLOCK = 32 +pkg syscall (openbsd-amd64), const O_FSYNC = 128 +pkg syscall (openbsd-amd64), const O_NDELAY = 4 +pkg syscall (openbsd-amd64), const O_NOCTTY = 32768 +pkg syscall (openbsd-amd64), const O_NOFOLLOW = 256 +pkg syscall (openbsd-amd64), const O_NONBLOCK = 4 +pkg syscall (openbsd-amd64), const O_RSYNC = 128 +pkg syscall (openbsd-amd64), const O_SHLOCK = 16 +pkg syscall (openbsd-amd64), const O_SYNC = 128 +pkg syscall (openbsd-amd64), const O_TRUNC = 1024 +pkg syscall (openbsd-amd64), const PARENB = 4096 +pkg syscall (openbsd-amd64), const PARMRK = 8 +pkg syscall (openbsd-amd64), const PARODD = 8192 +pkg syscall (openbsd-amd64), const PENDIN = 536870912 +pkg syscall (openbsd-amd64), const PF_FLUSH = 1 +pkg syscall (openbsd-amd64), const PMC5_PIPELINE_FLUSH = 21 +pkg syscall (openbsd-amd64), const PTRACE_CONT = 7 +pkg syscall (openbsd-amd64), const PTRACE_KILL = 8 +pkg syscall (openbsd-amd64), const PTRACE_TRACEME = 0 +pkg syscall (openbsd-amd64), const RLIMIT_CORE = 4 +pkg syscall (openbsd-amd64), const RLIMIT_CPU = 0 +pkg syscall (openbsd-amd64), const RLIMIT_DATA = 2 +pkg syscall (openbsd-amd64), const RLIMIT_FSIZE = 1 +pkg syscall (openbsd-amd64), const RLIMIT_NOFILE = 8 +pkg syscall (openbsd-amd64), const RLIMIT_STACK = 3 +pkg syscall (openbsd-amd64), const RLIM_INFINITY = 9223372036854775807 +pkg syscall (openbsd-amd64), const RTAX_AUTHOR = 6 +pkg syscall (openbsd-amd64), const RTAX_BRD = 7 +pkg syscall (openbsd-amd64), const RTAX_DST = 0 +pkg syscall (openbsd-amd64), const RTAX_GATEWAY = 1 +pkg syscall (openbsd-amd64), const RTAX_GENMASK = 3 +pkg syscall (openbsd-amd64), const RTAX_IFA = 5 +pkg syscall (openbsd-amd64), const RTAX_IFP = 4 +pkg syscall (openbsd-amd64), const RTAX_LABEL = 10 +pkg syscall (openbsd-amd64), const RTAX_MAX = 11 +pkg syscall (openbsd-amd64), const RTAX_NETMASK = 2 +pkg syscall (openbsd-amd64), const RTAX_SRC = 8 +pkg syscall (openbsd-amd64), const RTAX_SRCMASK = 9 +pkg syscall (openbsd-amd64), const RTA_AUTHOR = 64 +pkg syscall (openbsd-amd64), const RTA_BRD = 128 +pkg syscall (openbsd-amd64), const RTA_DST = 1 +pkg syscall (openbsd-amd64), const RTA_GATEWAY = 2 +pkg syscall (openbsd-amd64), const RTA_GENMASK = 8 +pkg syscall (openbsd-amd64), const RTA_IFA = 32 +pkg syscall (openbsd-amd64), const RTA_IFP = 16 +pkg syscall (openbsd-amd64), const RTA_LABEL = 1024 +pkg syscall (openbsd-amd64), const RTA_NETMASK = 4 +pkg syscall (openbsd-amd64), const RTA_SRC = 256 +pkg syscall (openbsd-amd64), const RTA_SRCMASK = 512 +pkg syscall (openbsd-amd64), const RTF_ANNOUNCE = 16384 +pkg syscall (openbsd-amd64), const RTF_BLACKHOLE = 4096 +pkg syscall (openbsd-amd64), const RTF_CLONED = 65536 +pkg syscall (openbsd-amd64), const RTF_CLONING = 256 +pkg syscall (openbsd-amd64), const RTF_DONE = 64 +pkg syscall (openbsd-amd64), const RTF_DYNAMIC = 16 +pkg syscall (openbsd-amd64), const RTF_FMASK = 63496 +pkg syscall (openbsd-amd64), const RTF_GATEWAY = 2 +pkg syscall (openbsd-amd64), const RTF_HOST = 4 +pkg syscall (openbsd-amd64), const RTF_LLINFO = 1024 +pkg syscall (openbsd-amd64), const RTF_MASK = 128 +pkg syscall (openbsd-amd64), const RTF_MODIFIED = 32 +pkg syscall (openbsd-amd64), const RTF_MPATH = 262144 +pkg syscall (openbsd-amd64), const RTF_MPLS = 1048576 +pkg syscall (openbsd-amd64), const RTF_PERMANENT_ARP = 8192 +pkg syscall (openbsd-amd64), const RTF_PROTO1 = 32768 +pkg syscall (openbsd-amd64), const RTF_PROTO2 = 16384 +pkg syscall (openbsd-amd64), const RTF_PROTO3 = 8192 +pkg syscall (openbsd-amd64), const RTF_REJECT = 8 +pkg syscall (openbsd-amd64), const RTF_SOURCE = 131072 +pkg syscall (openbsd-amd64), const RTF_STATIC = 2048 +pkg syscall (openbsd-amd64), const RTF_TUNNEL = 1048576 +pkg syscall (openbsd-amd64), const RTF_UP = 1 +pkg syscall (openbsd-amd64), const RTF_USETRAILERS = 32768 +pkg syscall (openbsd-amd64), const RTF_XRESOLVE = 512 +pkg syscall (openbsd-amd64), const RTM_ADD = 1 +pkg syscall (openbsd-amd64), const RTM_CHANGE = 3 +pkg syscall (openbsd-amd64), const RTM_DELADDR = 13 +pkg syscall (openbsd-amd64), const RTM_DELETE = 2 +pkg syscall (openbsd-amd64), const RTM_DESYNC = 16 +pkg syscall (openbsd-amd64), const RTM_GET = 4 +pkg syscall (openbsd-amd64), const RTM_IFANNOUNCE = 15 +pkg syscall (openbsd-amd64), const RTM_IFINFO = 14 +pkg syscall (openbsd-amd64), const RTM_LOCK = 8 +pkg syscall (openbsd-amd64), const RTM_LOSING = 5 +pkg syscall (openbsd-amd64), const RTM_MAXSIZE = 2048 +pkg syscall (openbsd-amd64), const RTM_MISS = 7 +pkg syscall (openbsd-amd64), const RTM_NEWADDR = 12 +pkg syscall (openbsd-amd64), const RTM_REDIRECT = 6 +pkg syscall (openbsd-amd64), const RTM_RESOLVE = 11 +pkg syscall (openbsd-amd64), const RTM_RTTUNIT = 1000000 +pkg syscall (openbsd-amd64), const RTM_VERSION = 4 +pkg syscall (openbsd-amd64), const RTV_EXPIRE = 4 +pkg syscall (openbsd-amd64), const RTV_HOPCOUNT = 2 +pkg syscall (openbsd-amd64), const RTV_MTU = 1 +pkg syscall (openbsd-amd64), const RTV_RPIPE = 8 +pkg syscall (openbsd-amd64), const RTV_RTT = 64 +pkg syscall (openbsd-amd64), const RTV_RTTVAR = 128 +pkg syscall (openbsd-amd64), const RTV_SPIPE = 16 +pkg syscall (openbsd-amd64), const RTV_SSTHRESH = 32 +pkg syscall (openbsd-amd64), const RT_TABLEID_MAX = 255 +pkg syscall (openbsd-amd64), const RUSAGE_CHILDREN = -1 +pkg syscall (openbsd-amd64), const RUSAGE_SELF = 0 +pkg syscall (openbsd-amd64), const RUSAGE_THREAD = 1 +pkg syscall (openbsd-amd64), const SCM_RIGHTS = 1 +pkg syscall (openbsd-amd64), const SCM_TIMESTAMP = 4 +pkg syscall (openbsd-amd64), const SIGBUS = 10 +pkg syscall (openbsd-amd64), const SIGCHLD = 20 +pkg syscall (openbsd-amd64), const SIGCONT = 19 +pkg syscall (openbsd-amd64), const SIGEMT = 7 +pkg syscall (openbsd-amd64), const SIGINFO = 29 +pkg syscall (openbsd-amd64), const SIGIO = 23 +pkg syscall (openbsd-amd64), const SIGIOT = 6 +pkg syscall (openbsd-amd64), const SIGPROF = 27 +pkg syscall (openbsd-amd64), const SIGSTOP = 17 +pkg syscall (openbsd-amd64), const SIGSYS = 12 +pkg syscall (openbsd-amd64), const SIGTHR = 32 +pkg syscall (openbsd-amd64), const SIGTSTP = 18 +pkg syscall (openbsd-amd64), const SIGTTIN = 21 +pkg syscall (openbsd-amd64), const SIGTTOU = 22 +pkg syscall (openbsd-amd64), const SIGURG = 16 +pkg syscall (openbsd-amd64), const SIGUSR1 = 30 +pkg syscall (openbsd-amd64), const SIGUSR2 = 31 +pkg syscall (openbsd-amd64), const SIGVTALRM = 26 +pkg syscall (openbsd-amd64), const SIGWINCH = 28 +pkg syscall (openbsd-amd64), const SIGXCPU = 24 +pkg syscall (openbsd-amd64), const SIGXFSZ = 25 +pkg syscall (openbsd-amd64), const SIOCADDMULTI = 2149607729 +pkg syscall (openbsd-amd64), const SIOCAIFADDR = 2151704858 +pkg syscall (openbsd-amd64), const SIOCAIFGROUP = 2150132103 +pkg syscall (openbsd-amd64), const SIOCALIFADDR = 2182637852 +pkg syscall (openbsd-amd64), const SIOCATMARK = 1074033415 +pkg syscall (openbsd-amd64), const SIOCBRDGADD = 2153277756 +pkg syscall (openbsd-amd64), const SIOCBRDGADDS = 2153277761 +pkg syscall (openbsd-amd64), const SIOCBRDGARL = 2154719565 +pkg syscall (openbsd-amd64), const SIOCBRDGDADDR = 2150132039 +pkg syscall (openbsd-amd64), const SIOCBRDGDEL = 2153277757 +pkg syscall (openbsd-amd64), const SIOCBRDGDELS = 2153277762 +pkg syscall (openbsd-amd64), const SIOCBRDGFLUSH = 2153277768 +pkg syscall (openbsd-amd64), const SIOCBRDGFRL = 2154719566 +pkg syscall (openbsd-amd64), const SIOCBRDGGCACHE = 3222563137 +pkg syscall (openbsd-amd64), const SIOCBRDGGFD = 3222563154 +pkg syscall (openbsd-amd64), const SIOCBRDGGHT = 3222563153 +pkg syscall (openbsd-amd64), const SIOCBRDGGIFFLGS = 3227019582 +pkg syscall (openbsd-amd64), const SIOCBRDGGMA = 3222563155 +pkg syscall (openbsd-amd64), const SIOCBRDGGPARAM = 3225446744 +pkg syscall (openbsd-amd64), const SIOCBRDGGPRI = 3222563152 +pkg syscall (openbsd-amd64), const SIOCBRDGGRL = 3224398159 +pkg syscall (openbsd-amd64), const SIOCBRDGGSIFS = 3227019580 +pkg syscall (openbsd-amd64), const SIOCBRDGGTO = 3222563142 +pkg syscall (openbsd-amd64), const SIOCBRDGIFS = 3227019586 +pkg syscall (openbsd-amd64), const SIOCBRDGRTS = 3223349571 +pkg syscall (openbsd-amd64), const SIOCBRDGSADDR = 3223873860 +pkg syscall (openbsd-amd64), const SIOCBRDGSCACHE = 2148821312 +pkg syscall (openbsd-amd64), const SIOCBRDGSFD = 2148821330 +pkg syscall (openbsd-amd64), const SIOCBRDGSHT = 2148821329 +pkg syscall (openbsd-amd64), const SIOCBRDGSIFCOST = 2153277781 +pkg syscall (openbsd-amd64), const SIOCBRDGSIFFLGS = 2153277759 +pkg syscall (openbsd-amd64), const SIOCBRDGSIFPRIO = 2153277780 +pkg syscall (openbsd-amd64), const SIOCBRDGSMA = 2148821331 +pkg syscall (openbsd-amd64), const SIOCBRDGSPRI = 2148821328 +pkg syscall (openbsd-amd64), const SIOCBRDGSPROTO = 2148821338 +pkg syscall (openbsd-amd64), const SIOCBRDGSTO = 2148821317 +pkg syscall (openbsd-amd64), const SIOCBRDGSTXHC = 2148821337 +pkg syscall (openbsd-amd64), const SIOCDELMULTI = 2149607730 +pkg syscall (openbsd-amd64), const SIOCDIFADDR = 2149607705 +pkg syscall (openbsd-amd64), const SIOCDIFGROUP = 2150132105 +pkg syscall (openbsd-amd64), const SIOCDIFPHYADDR = 2149607753 +pkg syscall (openbsd-amd64), const SIOCDLIFADDR = 2182637854 +pkg syscall (openbsd-amd64), const SIOCGETKALIVE = 3222825380 +pkg syscall (openbsd-amd64), const SIOCGETLABEL = 2149607834 +pkg syscall (openbsd-amd64), const SIOCGETPFLOW = 3223349758 +pkg syscall (openbsd-amd64), const SIOCGETPFSYNC = 3223349752 +pkg syscall (openbsd-amd64), const SIOCGETSGCNT = 3223352628 +pkg syscall (openbsd-amd64), const SIOCGETVIFCNT = 3223876915 +pkg syscall (openbsd-amd64), const SIOCGHIWAT = 1074033409 +pkg syscall (openbsd-amd64), const SIOCGIFADDR = 3223349537 +pkg syscall (openbsd-amd64), const SIOCGIFASYNCMAP = 3223349628 +pkg syscall (openbsd-amd64), const SIOCGIFBRDADDR = 3223349539 +pkg syscall (openbsd-amd64), const SIOCGIFCONF = 3222300964 +pkg syscall (openbsd-amd64), const SIOCGIFDATA = 3223349531 +pkg syscall (openbsd-amd64), const SIOCGIFDESCR = 3223349633 +pkg syscall (openbsd-amd64), const SIOCGIFDSTADDR = 3223349538 +pkg syscall (openbsd-amd64), const SIOCGIFFLAGS = 3223349521 +pkg syscall (openbsd-amd64), const SIOCGIFGATTR = 3223873931 +pkg syscall (openbsd-amd64), const SIOCGIFGENERIC = 3223349562 +pkg syscall (openbsd-amd64), const SIOCGIFGMEMB = 3223873930 +pkg syscall (openbsd-amd64), const SIOCGIFGROUP = 3223873928 +pkg syscall (openbsd-amd64), const SIOCGIFMEDIA = 3224398134 +pkg syscall (openbsd-amd64), const SIOCGIFMETRIC = 3223349527 +pkg syscall (openbsd-amd64), const SIOCGIFMTU = 3223349630 +pkg syscall (openbsd-amd64), const SIOCGIFNETMASK = 3223349541 +pkg syscall (openbsd-amd64), const SIOCGIFPDSTADDR = 3223349576 +pkg syscall (openbsd-amd64), const SIOCGIFPRIORITY = 3223349660 +pkg syscall (openbsd-amd64), const SIOCGIFPSRCADDR = 3223349575 +pkg syscall (openbsd-amd64), const SIOCGIFRDOMAIN = 3223349664 +pkg syscall (openbsd-amd64), const SIOCGIFRTLABEL = 3223349635 +pkg syscall (openbsd-amd64), const SIOCGIFTIMESLOT = 3223349638 +pkg syscall (openbsd-amd64), const SIOCGIFXFLAGS = 3223349662 +pkg syscall (openbsd-amd64), const SIOCGLIFADDR = 3256379677 +pkg syscall (openbsd-amd64), const SIOCGLIFPHYADDR = 3256379723 +pkg syscall (openbsd-amd64), const SIOCGLIFPHYRTABLE = 3223349666 +pkg syscall (openbsd-amd64), const SIOCGLOWAT = 1074033411 +pkg syscall (openbsd-amd64), const SIOCGPGRP = 1074033417 +pkg syscall (openbsd-amd64), const SIOCGVH = 3223349750 +pkg syscall (openbsd-amd64), const SIOCIFCREATE = 2149607802 +pkg syscall (openbsd-amd64), const SIOCIFDESTROY = 2149607801 +pkg syscall (openbsd-amd64), const SIOCIFGCLONERS = 3222301048 +pkg syscall (openbsd-amd64), const SIOCSETKALIVE = 2149083555 +pkg syscall (openbsd-amd64), const SIOCSETLABEL = 2149607833 +pkg syscall (openbsd-amd64), const SIOCSETPFLOW = 2149607933 +pkg syscall (openbsd-amd64), const SIOCSETPFSYNC = 2149607927 +pkg syscall (openbsd-amd64), const SIOCSHIWAT = 2147775232 +pkg syscall (openbsd-amd64), const SIOCSIFADDR = 2149607692 +pkg syscall (openbsd-amd64), const SIOCSIFASYNCMAP = 2149607805 +pkg syscall (openbsd-amd64), const SIOCSIFBRDADDR = 2149607699 +pkg syscall (openbsd-amd64), const SIOCSIFDESCR = 2149607808 +pkg syscall (openbsd-amd64), const SIOCSIFDSTADDR = 2149607694 +pkg syscall (openbsd-amd64), const SIOCSIFFLAGS = 2149607696 +pkg syscall (openbsd-amd64), const SIOCSIFGATTR = 2150132108 +pkg syscall (openbsd-amd64), const SIOCSIFGENERIC = 2149607737 +pkg syscall (openbsd-amd64), const SIOCSIFLLADDR = 2149607711 +pkg syscall (openbsd-amd64), const SIOCSIFMEDIA = 3223349557 +pkg syscall (openbsd-amd64), const SIOCSIFMETRIC = 2149607704 +pkg syscall (openbsd-amd64), const SIOCSIFMTU = 2149607807 +pkg syscall (openbsd-amd64), const SIOCSIFNETMASK = 2149607702 +pkg syscall (openbsd-amd64), const SIOCSIFPHYADDR = 2151704902 +pkg syscall (openbsd-amd64), const SIOCSIFPRIORITY = 2149607835 +pkg syscall (openbsd-amd64), const SIOCSIFRDOMAIN = 2149607839 +pkg syscall (openbsd-amd64), const SIOCSIFRTLABEL = 2149607810 +pkg syscall (openbsd-amd64), const SIOCSIFTIMESLOT = 2149607813 +pkg syscall (openbsd-amd64), const SIOCSIFXFLAGS = 2149607837 +pkg syscall (openbsd-amd64), const SIOCSLIFPHYADDR = 2182637898 +pkg syscall (openbsd-amd64), const SIOCSLIFPHYRTABLE = 2149607841 +pkg syscall (openbsd-amd64), const SIOCSLOWAT = 2147775234 +pkg syscall (openbsd-amd64), const SIOCSPGRP = 2147775240 +pkg syscall (openbsd-amd64), const SIOCSVH = 3223349749 +pkg syscall (openbsd-amd64), const SOCK_RDM = 4 +pkg syscall (openbsd-amd64), const SOL_SOCKET = 65535 +pkg syscall (openbsd-amd64), const SOMAXCONN = 128 +pkg syscall (openbsd-amd64), const SO_ACCEPTCONN = 2 +pkg syscall (openbsd-amd64), const SO_BINDANY = 4096 +pkg syscall (openbsd-amd64), const SO_BROADCAST = 32 +pkg syscall (openbsd-amd64), const SO_DEBUG = 1 +pkg syscall (openbsd-amd64), const SO_DONTROUTE = 16 +pkg syscall (openbsd-amd64), const SO_ERROR = 4103 +pkg syscall (openbsd-amd64), const SO_KEEPALIVE = 8 +pkg syscall (openbsd-amd64), const SO_LINGER = 128 +pkg syscall (openbsd-amd64), const SO_NETPROC = 4128 +pkg syscall (openbsd-amd64), const SO_OOBINLINE = 256 +pkg syscall (openbsd-amd64), const SO_PEERCRED = 4130 +pkg syscall (openbsd-amd64), const SO_RCVBUF = 4098 +pkg syscall (openbsd-amd64), const SO_RCVLOWAT = 4100 +pkg syscall (openbsd-amd64), const SO_RCVTIMEO = 4102 +pkg syscall (openbsd-amd64), const SO_REUSEADDR = 4 +pkg syscall (openbsd-amd64), const SO_REUSEPORT = 512 +pkg syscall (openbsd-amd64), const SO_RTABLE = 4129 +pkg syscall (openbsd-amd64), const SO_SNDBUF = 4097 +pkg syscall (openbsd-amd64), const SO_SNDLOWAT = 4099 +pkg syscall (openbsd-amd64), const SO_SNDTIMEO = 4101 +pkg syscall (openbsd-amd64), const SO_SPLICE = 4131 +pkg syscall (openbsd-amd64), const SO_TIMESTAMP = 2048 +pkg syscall (openbsd-amd64), const SO_TYPE = 4104 +pkg syscall (openbsd-amd64), const SO_USELOOPBACK = 64 +pkg syscall (openbsd-amd64), const SYS_ACCEPT = 30 +pkg syscall (openbsd-amd64), const SYS_ACCESS = 33 +pkg syscall (openbsd-amd64), const SYS_ACCT = 51 +pkg syscall (openbsd-amd64), const SYS_ADJFREQ = 305 +pkg syscall (openbsd-amd64), const SYS_ADJTIME = 140 +pkg syscall (openbsd-amd64), const SYS_BIND = 104 +pkg syscall (openbsd-amd64), const SYS_CHDIR = 12 +pkg syscall (openbsd-amd64), const SYS_CHFLAGS = 34 +pkg syscall (openbsd-amd64), const SYS_CHMOD = 15 +pkg syscall (openbsd-amd64), const SYS_CHOWN = 16 +pkg syscall (openbsd-amd64), const SYS_CHROOT = 61 +pkg syscall (openbsd-amd64), const SYS_CLOCK_GETRES = 234 +pkg syscall (openbsd-amd64), const SYS_CLOCK_GETTIME = 232 +pkg syscall (openbsd-amd64), const SYS_CLOCK_SETTIME = 233 +pkg syscall (openbsd-amd64), const SYS_CLOSE = 6 +pkg syscall (openbsd-amd64), const SYS_CLOSEFROM = 287 +pkg syscall (openbsd-amd64), const SYS_CONNECT = 98 +pkg syscall (openbsd-amd64), const SYS_DUP = 41 +pkg syscall (openbsd-amd64), const SYS_DUP2 = 90 +pkg syscall (openbsd-amd64), const SYS_EXECVE = 59 +pkg syscall (openbsd-amd64), const SYS_EXIT = 1 +pkg syscall (openbsd-amd64), const SYS_FACCESSAT = 313 +pkg syscall (openbsd-amd64), const SYS_FCHDIR = 13 +pkg syscall (openbsd-amd64), const SYS_FCHFLAGS = 35 +pkg syscall (openbsd-amd64), const SYS_FCHMOD = 124 +pkg syscall (openbsd-amd64), const SYS_FCHMODAT = 314 +pkg syscall (openbsd-amd64), const SYS_FCHOWN = 123 +pkg syscall (openbsd-amd64), const SYS_FCHOWNAT = 315 +pkg syscall (openbsd-amd64), const SYS_FCNTL = 92 +pkg syscall (openbsd-amd64), const SYS_FHOPEN = 264 +pkg syscall (openbsd-amd64), const SYS_FHSTAT = 294 +pkg syscall (openbsd-amd64), const SYS_FHSTATFS = 309 +pkg syscall (openbsd-amd64), const SYS_FLOCK = 131 +pkg syscall (openbsd-amd64), const SYS_FORK = 2 +pkg syscall (openbsd-amd64), const SYS_FPATHCONF = 192 +pkg syscall (openbsd-amd64), const SYS_FSTAT = 292 +pkg syscall (openbsd-amd64), const SYS_FSTATAT = 316 +pkg syscall (openbsd-amd64), const SYS_FSTATFS = 308 +pkg syscall (openbsd-amd64), const SYS_FSYNC = 95 +pkg syscall (openbsd-amd64), const SYS_FTRUNCATE = 201 +pkg syscall (openbsd-amd64), const SYS_FUTIMENS = 327 +pkg syscall (openbsd-amd64), const SYS_FUTIMES = 206 +pkg syscall (openbsd-amd64), const SYS_GETDIRENTRIES = 312 +pkg syscall (openbsd-amd64), const SYS_GETDTABLECOUNT = 18 +pkg syscall (openbsd-amd64), const SYS_GETEGID = 43 +pkg syscall (openbsd-amd64), const SYS_GETEUID = 25 +pkg syscall (openbsd-amd64), const SYS_GETFH = 161 +pkg syscall (openbsd-amd64), const SYS_GETFSSTAT = 306 +pkg syscall (openbsd-amd64), const SYS_GETGID = 47 +pkg syscall (openbsd-amd64), const SYS_GETGROUPS = 79 +pkg syscall (openbsd-amd64), const SYS_GETITIMER = 86 +pkg syscall (openbsd-amd64), const SYS_GETLOGIN = 49 +pkg syscall (openbsd-amd64), const SYS_GETPEERNAME = 31 +pkg syscall (openbsd-amd64), const SYS_GETPGID = 207 +pkg syscall (openbsd-amd64), const SYS_GETPGRP = 81 +pkg syscall (openbsd-amd64), const SYS_GETPID = 20 +pkg syscall (openbsd-amd64), const SYS_GETPPID = 39 +pkg syscall (openbsd-amd64), const SYS_GETPRIORITY = 100 +pkg syscall (openbsd-amd64), const SYS_GETRESGID = 283 +pkg syscall (openbsd-amd64), const SYS_GETRESUID = 281 +pkg syscall (openbsd-amd64), const SYS_GETRLIMIT = 194 +pkg syscall (openbsd-amd64), const SYS_GETRTABLE = 311 +pkg syscall (openbsd-amd64), const SYS_GETRUSAGE = 117 +pkg syscall (openbsd-amd64), const SYS_GETSID = 255 +pkg syscall (openbsd-amd64), const SYS_GETSOCKNAME = 32 +pkg syscall (openbsd-amd64), const SYS_GETSOCKOPT = 118 +pkg syscall (openbsd-amd64), const SYS_GETTHRID = 299 +pkg syscall (openbsd-amd64), const SYS_GETTIMEOFDAY = 116 +pkg syscall (openbsd-amd64), const SYS_GETUID = 24 +pkg syscall (openbsd-amd64), const SYS_IOCTL = 54 +pkg syscall (openbsd-amd64), const SYS_ISSETUGID = 253 +pkg syscall (openbsd-amd64), const SYS_KEVENT = 270 +pkg syscall (openbsd-amd64), const SYS_KILL = 37 +pkg syscall (openbsd-amd64), const SYS_KQUEUE = 269 +pkg syscall (openbsd-amd64), const SYS_KTRACE = 45 +pkg syscall (openbsd-amd64), const SYS_LCHOWN = 254 +pkg syscall (openbsd-amd64), const SYS_LINK = 9 +pkg syscall (openbsd-amd64), const SYS_LINKAT = 317 +pkg syscall (openbsd-amd64), const SYS_LISTEN = 106 +pkg syscall (openbsd-amd64), const SYS_LSEEK = 199 +pkg syscall (openbsd-amd64), const SYS_LSTAT = 293 +pkg syscall (openbsd-amd64), const SYS_MADVISE = 75 +pkg syscall (openbsd-amd64), const SYS_MINCORE = 78 +pkg syscall (openbsd-amd64), const SYS_MINHERIT = 250 +pkg syscall (openbsd-amd64), const SYS_MKDIR = 136 +pkg syscall (openbsd-amd64), const SYS_MKDIRAT = 318 +pkg syscall (openbsd-amd64), const SYS_MKFIFO = 132 +pkg syscall (openbsd-amd64), const SYS_MKFIFOAT = 319 +pkg syscall (openbsd-amd64), const SYS_MKNOD = 14 +pkg syscall (openbsd-amd64), const SYS_MKNODAT = 320 +pkg syscall (openbsd-amd64), const SYS_MLOCK = 203 +pkg syscall (openbsd-amd64), const SYS_MLOCKALL = 271 +pkg syscall (openbsd-amd64), const SYS_MMAP = 197 +pkg syscall (openbsd-amd64), const SYS_MOUNT = 21 +pkg syscall (openbsd-amd64), const SYS_MPROTECT = 74 +pkg syscall (openbsd-amd64), const SYS_MQUERY = 286 +pkg syscall (openbsd-amd64), const SYS_MSGCTL = 297 +pkg syscall (openbsd-amd64), const SYS_MSGGET = 225 +pkg syscall (openbsd-amd64), const SYS_MSGRCV = 227 +pkg syscall (openbsd-amd64), const SYS_MSGSND = 226 +pkg syscall (openbsd-amd64), const SYS_MSYNC = 256 +pkg syscall (openbsd-amd64), const SYS_MUNLOCK = 204 +pkg syscall (openbsd-amd64), const SYS_MUNLOCKALL = 272 +pkg syscall (openbsd-amd64), const SYS_MUNMAP = 73 +pkg syscall (openbsd-amd64), const SYS_NANOSLEEP = 240 +pkg syscall (openbsd-amd64), const SYS_NFSSVC = 155 +pkg syscall (openbsd-amd64), const SYS_OBREAK = 17 +pkg syscall (openbsd-amd64), const SYS_OPEN = 5 +pkg syscall (openbsd-amd64), const SYS_OPENAT = 321 +pkg syscall (openbsd-amd64), const SYS_PATHCONF = 191 +pkg syscall (openbsd-amd64), const SYS_PIPE = 263 +pkg syscall (openbsd-amd64), const SYS_POLL = 252 +pkg syscall (openbsd-amd64), const SYS_PREAD = 173 +pkg syscall (openbsd-amd64), const SYS_PREADV = 267 +pkg syscall (openbsd-amd64), const SYS_PROFIL = 44 +pkg syscall (openbsd-amd64), const SYS_PTRACE = 26 +pkg syscall (openbsd-amd64), const SYS_PWRITE = 174 +pkg syscall (openbsd-amd64), const SYS_PWRITEV = 268 +pkg syscall (openbsd-amd64), const SYS_QUOTACTL = 148 +pkg syscall (openbsd-amd64), const SYS_READ = 3 +pkg syscall (openbsd-amd64), const SYS_READLINK = 58 +pkg syscall (openbsd-amd64), const SYS_READLINKAT = 322 +pkg syscall (openbsd-amd64), const SYS_READV = 120 +pkg syscall (openbsd-amd64), const SYS_REBOOT = 55 +pkg syscall (openbsd-amd64), const SYS_RECVFROM = 29 +pkg syscall (openbsd-amd64), const SYS_RECVMSG = 27 +pkg syscall (openbsd-amd64), const SYS_RENAME = 128 +pkg syscall (openbsd-amd64), const SYS_RENAMEAT = 323 +pkg syscall (openbsd-amd64), const SYS_REVOKE = 56 +pkg syscall (openbsd-amd64), const SYS_RMDIR = 137 +pkg syscall (openbsd-amd64), const SYS_SCHED_YIELD = 298 +pkg syscall (openbsd-amd64), const SYS_SELECT = 93 +pkg syscall (openbsd-amd64), const SYS_SEMGET = 221 +pkg syscall (openbsd-amd64), const SYS_SEMOP = 290 +pkg syscall (openbsd-amd64), const SYS_SENDMSG = 28 +pkg syscall (openbsd-amd64), const SYS_SENDTO = 133 +pkg syscall (openbsd-amd64), const SYS_SETEGID = 182 +pkg syscall (openbsd-amd64), const SYS_SETEUID = 183 +pkg syscall (openbsd-amd64), const SYS_SETGID = 181 +pkg syscall (openbsd-amd64), const SYS_SETGROUPS = 80 +pkg syscall (openbsd-amd64), const SYS_SETITIMER = 83 +pkg syscall (openbsd-amd64), const SYS_SETLOGIN = 50 +pkg syscall (openbsd-amd64), const SYS_SETPGID = 82 +pkg syscall (openbsd-amd64), const SYS_SETPRIORITY = 96 +pkg syscall (openbsd-amd64), const SYS_SETREGID = 127 +pkg syscall (openbsd-amd64), const SYS_SETRESGID = 284 +pkg syscall (openbsd-amd64), const SYS_SETRESUID = 282 +pkg syscall (openbsd-amd64), const SYS_SETREUID = 126 +pkg syscall (openbsd-amd64), const SYS_SETRLIMIT = 195 +pkg syscall (openbsd-amd64), const SYS_SETRTABLE = 310 +pkg syscall (openbsd-amd64), const SYS_SETSID = 147 +pkg syscall (openbsd-amd64), const SYS_SETSOCKOPT = 105 +pkg syscall (openbsd-amd64), const SYS_SETTIMEOFDAY = 122 +pkg syscall (openbsd-amd64), const SYS_SETUID = 23 +pkg syscall (openbsd-amd64), const SYS_SHMAT = 228 +pkg syscall (openbsd-amd64), const SYS_SHMCTL = 296 +pkg syscall (openbsd-amd64), const SYS_SHMDT = 230 +pkg syscall (openbsd-amd64), const SYS_SHMGET = 289 +pkg syscall (openbsd-amd64), const SYS_SHUTDOWN = 134 +pkg syscall (openbsd-amd64), const SYS_SIGACTION = 46 +pkg syscall (openbsd-amd64), const SYS_SIGALTSTACK = 288 +pkg syscall (openbsd-amd64), const SYS_SIGPENDING = 52 +pkg syscall (openbsd-amd64), const SYS_SIGPROCMASK = 48 +pkg syscall (openbsd-amd64), const SYS_SIGRETURN = 103 +pkg syscall (openbsd-amd64), const SYS_SIGSUSPEND = 111 +pkg syscall (openbsd-amd64), const SYS_SOCKET = 97 +pkg syscall (openbsd-amd64), const SYS_SOCKETPAIR = 135 +pkg syscall (openbsd-amd64), const SYS_STAT = 291 +pkg syscall (openbsd-amd64), const SYS_STATFS = 307 +pkg syscall (openbsd-amd64), const SYS_SWAPCTL = 193 +pkg syscall (openbsd-amd64), const SYS_SYMLINK = 57 +pkg syscall (openbsd-amd64), const SYS_SYMLINKAT = 324 +pkg syscall (openbsd-amd64), const SYS_SYNC = 36 +pkg syscall (openbsd-amd64), const SYS_SYSARCH = 165 +pkg syscall (openbsd-amd64), const SYS_TRUNCATE = 200 +pkg syscall (openbsd-amd64), const SYS_UMASK = 60 +pkg syscall (openbsd-amd64), const SYS_UNLINK = 10 +pkg syscall (openbsd-amd64), const SYS_UNLINKAT = 325 +pkg syscall (openbsd-amd64), const SYS_UNMOUNT = 22 +pkg syscall (openbsd-amd64), const SYS_UTIMENSAT = 326 +pkg syscall (openbsd-amd64), const SYS_UTIMES = 138 +pkg syscall (openbsd-amd64), const SYS_VFORK = 66 +pkg syscall (openbsd-amd64), const SYS_WAIT4 = 7 +pkg syscall (openbsd-amd64), const SYS_WRITE = 4 +pkg syscall (openbsd-amd64), const SYS_WRITEV = 121 +pkg syscall (openbsd-amd64), const SYS___GETCWD = 304 +pkg syscall (openbsd-amd64), const SYS___GET_TCB = 330 +pkg syscall (openbsd-amd64), const SYS___SEMCTL = 295 +pkg syscall (openbsd-amd64), const SYS___SET_TCB = 329 +pkg syscall (openbsd-amd64), const SYS___SYSCTL = 202 +pkg syscall (openbsd-amd64), const SYS___TFORK = 8 +pkg syscall (openbsd-amd64), const SYS___THREXIT = 302 +pkg syscall (openbsd-amd64), const SYS___THRSIGDIVERT = 303 +pkg syscall (openbsd-amd64), const SYS___THRSLEEP = 300 +pkg syscall (openbsd-amd64), const SYS___THRWAKEUP = 301 +pkg syscall (openbsd-amd64), const S_IFMT = 61440 +pkg syscall (openbsd-amd64), const SizeofBpfHdr = 20 +pkg syscall (openbsd-amd64), const SizeofBpfInsn = 8 +pkg syscall (openbsd-amd64), const SizeofBpfProgram = 16 +pkg syscall (openbsd-amd64), const SizeofBpfStat = 8 +pkg syscall (openbsd-amd64), const SizeofBpfVersion = 4 +pkg syscall (openbsd-amd64), const SizeofCmsghdr = 12 +pkg syscall (openbsd-amd64), const SizeofIPMreq = 8 +pkg syscall (openbsd-amd64), const SizeofIPv6Mreq = 20 +pkg syscall (openbsd-amd64), const SizeofIfAnnounceMsghdr = 26 +pkg syscall (openbsd-amd64), const SizeofIfData = 224 +pkg syscall (openbsd-amd64), const SizeofIfMsghdr = 248 +pkg syscall (openbsd-amd64), const SizeofIfaMsghdr = 24 +pkg syscall (openbsd-amd64), const SizeofInet6Pktinfo = 20 +pkg syscall (openbsd-amd64), const SizeofLinger = 8 +pkg syscall (openbsd-amd64), const SizeofMsghdr = 48 +pkg syscall (openbsd-amd64), const SizeofRtMetrics = 48 +pkg syscall (openbsd-amd64), const SizeofRtMsghdr = 88 +pkg syscall (openbsd-amd64), const SizeofSockaddrAny = 108 +pkg syscall (openbsd-amd64), const SizeofSockaddrDatalink = 32 +pkg syscall (openbsd-amd64), const SizeofSockaddrInet4 = 16 +pkg syscall (openbsd-amd64), const SizeofSockaddrInet6 = 28 +pkg syscall (openbsd-amd64), const SizeofSockaddrUnix = 106 +pkg syscall (openbsd-amd64), const TCIFLUSH = 1 +pkg syscall (openbsd-amd64), const TCIOFLUSH = 3 +pkg syscall (openbsd-amd64), const TCOFLUSH = 2 +pkg syscall (openbsd-amd64), const TCP_MAXBURST = 4 +pkg syscall (openbsd-amd64), const TCP_MAXSEG = 2 +pkg syscall (openbsd-amd64), const TCP_MAXWIN = 65535 +pkg syscall (openbsd-amd64), const TCP_MAX_SACK = 3 +pkg syscall (openbsd-amd64), const TCP_MAX_WINSHIFT = 14 +pkg syscall (openbsd-amd64), const TCP_MD5SIG = 4 +pkg syscall (openbsd-amd64), const TCP_MSS = 512 +pkg syscall (openbsd-amd64), const TCP_NSTATES = 11 +pkg syscall (openbsd-amd64), const TCP_SACK_ENABLE = 8 +pkg syscall (openbsd-amd64), const TCSAFLUSH = 2 +pkg syscall (openbsd-amd64), const TIOCCBRK = 536900730 +pkg syscall (openbsd-amd64), const TIOCCDTR = 536900728 +pkg syscall (openbsd-amd64), const TIOCCONS = 2147775586 +pkg syscall (openbsd-amd64), const TIOCDRAIN = 536900702 +pkg syscall (openbsd-amd64), const TIOCEXCL = 536900621 +pkg syscall (openbsd-amd64), const TIOCEXT = 2147775584 +pkg syscall (openbsd-amd64), const TIOCFLAG_CLOCAL = 2 +pkg syscall (openbsd-amd64), const TIOCFLAG_CRTSCTS = 4 +pkg syscall (openbsd-amd64), const TIOCFLAG_MDMBUF = 8 +pkg syscall (openbsd-amd64), const TIOCFLAG_PPS = 16 +pkg syscall (openbsd-amd64), const TIOCFLAG_SOFTCAR = 1 +pkg syscall (openbsd-amd64), const TIOCFLUSH = 2147775504 +pkg syscall (openbsd-amd64), const TIOCGETA = 1076655123 +pkg syscall (openbsd-amd64), const TIOCGETD = 1074033690 +pkg syscall (openbsd-amd64), const TIOCGFLAGS = 1074033757 +pkg syscall (openbsd-amd64), const TIOCGPGRP = 1074033783 +pkg syscall (openbsd-amd64), const TIOCGTSTAMP = 1074820187 +pkg syscall (openbsd-amd64), const TIOCGWINSZ = 1074295912 +pkg syscall (openbsd-amd64), const TIOCMBIC = 2147775595 +pkg syscall (openbsd-amd64), const TIOCMBIS = 2147775596 +pkg syscall (openbsd-amd64), const TIOCMGET = 1074033770 +pkg syscall (openbsd-amd64), const TIOCMODG = 1074033770 +pkg syscall (openbsd-amd64), const TIOCMODS = 2147775597 +pkg syscall (openbsd-amd64), const TIOCMSET = 2147775597 +pkg syscall (openbsd-amd64), const TIOCM_CAR = 64 +pkg syscall (openbsd-amd64), const TIOCM_CD = 64 +pkg syscall (openbsd-amd64), const TIOCM_CTS = 32 +pkg syscall (openbsd-amd64), const TIOCM_DSR = 256 +pkg syscall (openbsd-amd64), const TIOCM_DTR = 2 +pkg syscall (openbsd-amd64), const TIOCM_LE = 1 +pkg syscall (openbsd-amd64), const TIOCM_RI = 128 +pkg syscall (openbsd-amd64), const TIOCM_RNG = 128 +pkg syscall (openbsd-amd64), const TIOCM_RTS = 4 +pkg syscall (openbsd-amd64), const TIOCM_SR = 16 +pkg syscall (openbsd-amd64), const TIOCM_ST = 8 +pkg syscall (openbsd-amd64), const TIOCNOTTY = 536900721 +pkg syscall (openbsd-amd64), const TIOCNXCL = 536900622 +pkg syscall (openbsd-amd64), const TIOCOUTQ = 1074033779 +pkg syscall (openbsd-amd64), const TIOCPKT = 2147775600 +pkg syscall (openbsd-amd64), const TIOCPKT_DATA = 0 +pkg syscall (openbsd-amd64), const TIOCPKT_DOSTOP = 32 +pkg syscall (openbsd-amd64), const TIOCPKT_FLUSHREAD = 1 +pkg syscall (openbsd-amd64), const TIOCPKT_FLUSHWRITE = 2 +pkg syscall (openbsd-amd64), const TIOCPKT_IOCTL = 64 +pkg syscall (openbsd-amd64), const TIOCPKT_NOSTOP = 16 +pkg syscall (openbsd-amd64), const TIOCPKT_START = 8 +pkg syscall (openbsd-amd64), const TIOCPKT_STOP = 4 +pkg syscall (openbsd-amd64), const TIOCREMOTE = 2147775593 +pkg syscall (openbsd-amd64), const TIOCSBRK = 536900731 +pkg syscall (openbsd-amd64), const TIOCSCTTY = 536900705 +pkg syscall (openbsd-amd64), const TIOCSDTR = 536900729 +pkg syscall (openbsd-amd64), const TIOCSETA = 2150396948 +pkg syscall (openbsd-amd64), const TIOCSETAF = 2150396950 +pkg syscall (openbsd-amd64), const TIOCSETAW = 2150396949 +pkg syscall (openbsd-amd64), const TIOCSETD = 2147775515 +pkg syscall (openbsd-amd64), const TIOCSFLAGS = 2147775580 +pkg syscall (openbsd-amd64), const TIOCSIG = 2147775583 +pkg syscall (openbsd-amd64), const TIOCSPGRP = 2147775606 +pkg syscall (openbsd-amd64), const TIOCSTART = 536900718 +pkg syscall (openbsd-amd64), const TIOCSTAT = 2147775589 +pkg syscall (openbsd-amd64), const TIOCSTI = 2147578994 +pkg syscall (openbsd-amd64), const TIOCSTOP = 536900719 +pkg syscall (openbsd-amd64), const TIOCSTSTAMP = 2148037722 +pkg syscall (openbsd-amd64), const TIOCSWINSZ = 2148037735 +pkg syscall (openbsd-amd64), const TIOCUCNTL = 2147775590 +pkg syscall (openbsd-amd64), const TOSTOP = 4194304 +pkg syscall (openbsd-amd64), const VDISCARD = 15 +pkg syscall (openbsd-amd64), const VDSUSP = 11 +pkg syscall (openbsd-amd64), const VEOF = 0 +pkg syscall (openbsd-amd64), const VEOL = 1 +pkg syscall (openbsd-amd64), const VEOL2 = 2 +pkg syscall (openbsd-amd64), const VERASE = 3 +pkg syscall (openbsd-amd64), const VINTR = 8 +pkg syscall (openbsd-amd64), const VKILL = 5 +pkg syscall (openbsd-amd64), const VLNEXT = 14 +pkg syscall (openbsd-amd64), const VMIN = 16 +pkg syscall (openbsd-amd64), const VQUIT = 9 +pkg syscall (openbsd-amd64), const VREPRINT = 6 +pkg syscall (openbsd-amd64), const VSTART = 12 +pkg syscall (openbsd-amd64), const VSTATUS = 18 +pkg syscall (openbsd-amd64), const VSTOP = 13 +pkg syscall (openbsd-amd64), const VSUSP = 10 +pkg syscall (openbsd-amd64), const VTIME = 17 +pkg syscall (openbsd-amd64), const VWERASE = 4 +pkg syscall (openbsd-amd64), const WALTSIG = 4 +pkg syscall (openbsd-amd64), const WCONTINUED = 8 +pkg syscall (openbsd-amd64), const WCOREFLAG = 128 +pkg syscall (openbsd-amd64), const WNOHANG = 1 +pkg syscall (openbsd-amd64), const WSTOPPED = 127 +pkg syscall (openbsd-amd64), const WUNTRACED = 2 +pkg syscall (openbsd-amd64-cgo), const AF_APPLETALK = 16 +pkg syscall (openbsd-amd64-cgo), const AF_BLUETOOTH = 32 +pkg syscall (openbsd-amd64-cgo), const AF_CCITT = 10 +pkg syscall (openbsd-amd64-cgo), const AF_CHAOS = 5 +pkg syscall (openbsd-amd64-cgo), const AF_CNT = 21 +pkg syscall (openbsd-amd64-cgo), const AF_COIP = 20 +pkg syscall (openbsd-amd64-cgo), const AF_DATAKIT = 9 +pkg syscall (openbsd-amd64-cgo), const AF_DECnet = 12 +pkg syscall (openbsd-amd64-cgo), const AF_DLI = 13 +pkg syscall (openbsd-amd64-cgo), const AF_E164 = 26 +pkg syscall (openbsd-amd64-cgo), const AF_ECMA = 8 +pkg syscall (openbsd-amd64-cgo), const AF_ENCAP = 28 +pkg syscall (openbsd-amd64-cgo), const AF_HYLINK = 15 +pkg syscall (openbsd-amd64-cgo), const AF_IMPLINK = 3 +pkg syscall (openbsd-amd64-cgo), const AF_INET6 = 24 +pkg syscall (openbsd-amd64-cgo), const AF_IPX = 23 +pkg syscall (openbsd-amd64-cgo), const AF_ISDN = 26 +pkg syscall (openbsd-amd64-cgo), const AF_ISO = 7 +pkg syscall (openbsd-amd64-cgo), const AF_KEY = 30 +pkg syscall (openbsd-amd64-cgo), const AF_LAT = 14 +pkg syscall (openbsd-amd64-cgo), const AF_LINK = 18 +pkg syscall (openbsd-amd64-cgo), const AF_LOCAL = 1 +pkg syscall (openbsd-amd64-cgo), const AF_MAX = 36 +pkg syscall (openbsd-amd64-cgo), const AF_MPLS = 33 +pkg syscall (openbsd-amd64-cgo), const AF_NATM = 27 +pkg syscall (openbsd-amd64-cgo), const AF_NS = 6 +pkg syscall (openbsd-amd64-cgo), const AF_OSI = 7 +pkg syscall (openbsd-amd64-cgo), const AF_PUP = 4 +pkg syscall (openbsd-amd64-cgo), const AF_ROUTE = 17 +pkg syscall (openbsd-amd64-cgo), const AF_SIP = 29 +pkg syscall (openbsd-amd64-cgo), const AF_SNA = 11 +pkg syscall (openbsd-amd64-cgo), const ARPHRD_ETHER = 1 +pkg syscall (openbsd-amd64-cgo), const ARPHRD_FRELAY = 15 +pkg syscall (openbsd-amd64-cgo), const ARPHRD_IEEE1394 = 24 +pkg syscall (openbsd-amd64-cgo), const ARPHRD_IEEE802 = 6 +pkg syscall (openbsd-amd64-cgo), const B0 = 0 +pkg syscall (openbsd-amd64-cgo), const B110 = 110 +pkg syscall (openbsd-amd64-cgo), const B115200 = 115200 +pkg syscall (openbsd-amd64-cgo), const B1200 = 1200 +pkg syscall (openbsd-amd64-cgo), const B134 = 134 +pkg syscall (openbsd-amd64-cgo), const B14400 = 14400 +pkg syscall (openbsd-amd64-cgo), const B150 = 150 +pkg syscall (openbsd-amd64-cgo), const B1800 = 1800 +pkg syscall (openbsd-amd64-cgo), const B19200 = 19200 +pkg syscall (openbsd-amd64-cgo), const B200 = 200 +pkg syscall (openbsd-amd64-cgo), const B230400 = 230400 +pkg syscall (openbsd-amd64-cgo), const B2400 = 2400 +pkg syscall (openbsd-amd64-cgo), const B28800 = 28800 +pkg syscall (openbsd-amd64-cgo), const B300 = 300 +pkg syscall (openbsd-amd64-cgo), const B38400 = 38400 +pkg syscall (openbsd-amd64-cgo), const B4800 = 4800 +pkg syscall (openbsd-amd64-cgo), const B50 = 50 +pkg syscall (openbsd-amd64-cgo), const B57600 = 57600 +pkg syscall (openbsd-amd64-cgo), const B600 = 600 +pkg syscall (openbsd-amd64-cgo), const B7200 = 7200 +pkg syscall (openbsd-amd64-cgo), const B75 = 75 +pkg syscall (openbsd-amd64-cgo), const B76800 = 76800 +pkg syscall (openbsd-amd64-cgo), const B9600 = 9600 +pkg syscall (openbsd-amd64-cgo), const BIOCFLUSH = 536887912 +pkg syscall (openbsd-amd64-cgo), const BIOCGBLEN = 1074020966 +pkg syscall (openbsd-amd64-cgo), const BIOCGDIRFILT = 1074020988 +pkg syscall (openbsd-amd64-cgo), const BIOCGDLT = 1074020970 +pkg syscall (openbsd-amd64-cgo), const BIOCGDLTLIST = 3222291067 +pkg syscall (openbsd-amd64-cgo), const BIOCGETIF = 1075855979 +pkg syscall (openbsd-amd64-cgo), const BIOCGFILDROP = 1074020984 +pkg syscall (openbsd-amd64-cgo), const BIOCGHDRCMPLT = 1074020980 +pkg syscall (openbsd-amd64-cgo), const BIOCGRSIG = 1074020979 +pkg syscall (openbsd-amd64-cgo), const BIOCGRTIMEOUT = 1074807406 +pkg syscall (openbsd-amd64-cgo), const BIOCGSTATS = 1074283119 +pkg syscall (openbsd-amd64-cgo), const BIOCIMMEDIATE = 2147762800 +pkg syscall (openbsd-amd64-cgo), const BIOCLOCK = 536887926 +pkg syscall (openbsd-amd64-cgo), const BIOCPROMISC = 536887913 +pkg syscall (openbsd-amd64-cgo), const BIOCSBLEN = 3221504614 +pkg syscall (openbsd-amd64-cgo), const BIOCSDIRFILT = 2147762813 +pkg syscall (openbsd-amd64-cgo), const BIOCSDLT = 2147762810 +pkg syscall (openbsd-amd64-cgo), const BIOCSETF = 2148549223 +pkg syscall (openbsd-amd64-cgo), const BIOCSETIF = 2149597804 +pkg syscall (openbsd-amd64-cgo), const BIOCSETWF = 2148549239 +pkg syscall (openbsd-amd64-cgo), const BIOCSFILDROP = 2147762809 +pkg syscall (openbsd-amd64-cgo), const BIOCSHDRCMPLT = 2147762805 +pkg syscall (openbsd-amd64-cgo), const BIOCSRSIG = 2147762802 +pkg syscall (openbsd-amd64-cgo), const BIOCSRTIMEOUT = 2148549229 +pkg syscall (openbsd-amd64-cgo), const BIOCVERSION = 1074020977 +pkg syscall (openbsd-amd64-cgo), const BPF_A = 16 +pkg syscall (openbsd-amd64-cgo), const BPF_ABS = 32 +pkg syscall (openbsd-amd64-cgo), const BPF_ADD = 0 +pkg syscall (openbsd-amd64-cgo), const BPF_ALIGNMENT = 4 +pkg syscall (openbsd-amd64-cgo), const BPF_ALU = 4 +pkg syscall (openbsd-amd64-cgo), const BPF_AND = 80 +pkg syscall (openbsd-amd64-cgo), const BPF_B = 16 +pkg syscall (openbsd-amd64-cgo), const BPF_DIRECTION_IN = 1 +pkg syscall (openbsd-amd64-cgo), const BPF_DIRECTION_OUT = 2 +pkg syscall (openbsd-amd64-cgo), const BPF_DIV = 48 +pkg syscall (openbsd-amd64-cgo), const BPF_H = 8 +pkg syscall (openbsd-amd64-cgo), const BPF_IMM = 0 +pkg syscall (openbsd-amd64-cgo), const BPF_IND = 64 +pkg syscall (openbsd-amd64-cgo), const BPF_JA = 0 +pkg syscall (openbsd-amd64-cgo), const BPF_JEQ = 16 +pkg syscall (openbsd-amd64-cgo), const BPF_JGE = 48 +pkg syscall (openbsd-amd64-cgo), const BPF_JGT = 32 +pkg syscall (openbsd-amd64-cgo), const BPF_JMP = 5 +pkg syscall (openbsd-amd64-cgo), const BPF_JSET = 64 +pkg syscall (openbsd-amd64-cgo), const BPF_K = 0 +pkg syscall (openbsd-amd64-cgo), const BPF_LD = 0 +pkg syscall (openbsd-amd64-cgo), const BPF_LDX = 1 +pkg syscall (openbsd-amd64-cgo), const BPF_LEN = 128 +pkg syscall (openbsd-amd64-cgo), const BPF_LSH = 96 +pkg syscall (openbsd-amd64-cgo), const BPF_MAJOR_VERSION = 1 +pkg syscall (openbsd-amd64-cgo), const BPF_MAXBUFSIZE = 2097152 +pkg syscall (openbsd-amd64-cgo), const BPF_MAXINSNS = 512 +pkg syscall (openbsd-amd64-cgo), const BPF_MEM = 96 +pkg syscall (openbsd-amd64-cgo), const BPF_MEMWORDS = 16 +pkg syscall (openbsd-amd64-cgo), const BPF_MINBUFSIZE = 32 +pkg syscall (openbsd-amd64-cgo), const BPF_MINOR_VERSION = 1 +pkg syscall (openbsd-amd64-cgo), const BPF_MISC = 7 +pkg syscall (openbsd-amd64-cgo), const BPF_MSH = 160 +pkg syscall (openbsd-amd64-cgo), const BPF_MUL = 32 +pkg syscall (openbsd-amd64-cgo), const BPF_NEG = 128 +pkg syscall (openbsd-amd64-cgo), const BPF_OR = 64 +pkg syscall (openbsd-amd64-cgo), const BPF_RELEASE = 199606 +pkg syscall (openbsd-amd64-cgo), const BPF_RET = 6 +pkg syscall (openbsd-amd64-cgo), const BPF_RSH = 112 +pkg syscall (openbsd-amd64-cgo), const BPF_ST = 2 +pkg syscall (openbsd-amd64-cgo), const BPF_STX = 3 +pkg syscall (openbsd-amd64-cgo), const BPF_SUB = 16 +pkg syscall (openbsd-amd64-cgo), const BPF_TAX = 0 +pkg syscall (openbsd-amd64-cgo), const BPF_TXA = 128 +pkg syscall (openbsd-amd64-cgo), const BPF_W = 0 +pkg syscall (openbsd-amd64-cgo), const BPF_X = 8 +pkg syscall (openbsd-amd64-cgo), const BRKINT = 2 +pkg syscall (openbsd-amd64-cgo), const CCR0_FLUSH = 16 +pkg syscall (openbsd-amd64-cgo), const CFLUSH = 15 +pkg syscall (openbsd-amd64-cgo), const CLOCAL = 32768 +pkg syscall (openbsd-amd64-cgo), const CPUID_CFLUSH = 524288 +pkg syscall (openbsd-amd64-cgo), const CREAD = 2048 +pkg syscall (openbsd-amd64-cgo), const CS5 = 0 +pkg syscall (openbsd-amd64-cgo), const CS6 = 256 +pkg syscall (openbsd-amd64-cgo), const CS7 = 512 +pkg syscall (openbsd-amd64-cgo), const CS8 = 768 +pkg syscall (openbsd-amd64-cgo), const CSIZE = 768 +pkg syscall (openbsd-amd64-cgo), const CSTART = 17 +pkg syscall (openbsd-amd64-cgo), const CSTATUS = 255 +pkg syscall (openbsd-amd64-cgo), const CSTOP = 19 +pkg syscall (openbsd-amd64-cgo), const CSTOPB = 1024 +pkg syscall (openbsd-amd64-cgo), const CSUSP = 26 +pkg syscall (openbsd-amd64-cgo), const CTL_MAXNAME = 12 +pkg syscall (openbsd-amd64-cgo), const CTL_NET = 4 +pkg syscall (openbsd-amd64-cgo), const DIOCOSFPFLUSH = 536888398 +pkg syscall (openbsd-amd64-cgo), const DLT_ARCNET = 7 +pkg syscall (openbsd-amd64-cgo), const DLT_ATM_RFC1483 = 11 +pkg syscall (openbsd-amd64-cgo), const DLT_AX25 = 3 +pkg syscall (openbsd-amd64-cgo), const DLT_CHAOS = 5 +pkg syscall (openbsd-amd64-cgo), const DLT_C_HDLC = 104 +pkg syscall (openbsd-amd64-cgo), const DLT_EN10MB = 1 +pkg syscall (openbsd-amd64-cgo), const DLT_EN3MB = 2 +pkg syscall (openbsd-amd64-cgo), const DLT_ENC = 13 +pkg syscall (openbsd-amd64-cgo), const DLT_FDDI = 10 +pkg syscall (openbsd-amd64-cgo), const DLT_IEEE802 = 6 +pkg syscall (openbsd-amd64-cgo), const DLT_IEEE802_11 = 105 +pkg syscall (openbsd-amd64-cgo), const DLT_IEEE802_11_RADIO = 127 +pkg syscall (openbsd-amd64-cgo), const DLT_LOOP = 12 +pkg syscall (openbsd-amd64-cgo), const DLT_MPLS = 219 +pkg syscall (openbsd-amd64-cgo), const DLT_NULL = 0 +pkg syscall (openbsd-amd64-cgo), const DLT_PFLOG = 117 +pkg syscall (openbsd-amd64-cgo), const DLT_PFSYNC = 18 +pkg syscall (openbsd-amd64-cgo), const DLT_PPP = 9 +pkg syscall (openbsd-amd64-cgo), const DLT_PPP_BSDOS = 16 +pkg syscall (openbsd-amd64-cgo), const DLT_PPP_ETHER = 51 +pkg syscall (openbsd-amd64-cgo), const DLT_PPP_SERIAL = 50 +pkg syscall (openbsd-amd64-cgo), const DLT_PRONET = 4 +pkg syscall (openbsd-amd64-cgo), const DLT_RAW = 14 +pkg syscall (openbsd-amd64-cgo), const DLT_SLIP = 8 +pkg syscall (openbsd-amd64-cgo), const DLT_SLIP_BSDOS = 15 +pkg syscall (openbsd-amd64-cgo), const DT_BLK = 6 +pkg syscall (openbsd-amd64-cgo), const DT_CHR = 2 +pkg syscall (openbsd-amd64-cgo), const DT_DIR = 4 +pkg syscall (openbsd-amd64-cgo), const DT_FIFO = 1 +pkg syscall (openbsd-amd64-cgo), const DT_LNK = 10 +pkg syscall (openbsd-amd64-cgo), const DT_REG = 8 +pkg syscall (openbsd-amd64-cgo), const DT_SOCK = 12 +pkg syscall (openbsd-amd64-cgo), const DT_UNKNOWN = 0 +pkg syscall (openbsd-amd64-cgo), const E2BIG = 7 +pkg syscall (openbsd-amd64-cgo), const EACCES = 13 +pkg syscall (openbsd-amd64-cgo), const EADDRINUSE = 48 +pkg syscall (openbsd-amd64-cgo), const EADDRNOTAVAIL = 49 +pkg syscall (openbsd-amd64-cgo), const EAFNOSUPPORT = 47 +pkg syscall (openbsd-amd64-cgo), const EAGAIN = 35 +pkg syscall (openbsd-amd64-cgo), const EALREADY = 37 +pkg syscall (openbsd-amd64-cgo), const EAUTH = 80 +pkg syscall (openbsd-amd64-cgo), const EBADF = 9 +pkg syscall (openbsd-amd64-cgo), const EBADRPC = 72 +pkg syscall (openbsd-amd64-cgo), const EBUSY = 16 +pkg syscall (openbsd-amd64-cgo), const ECANCELED = 88 +pkg syscall (openbsd-amd64-cgo), const ECHILD = 10 +pkg syscall (openbsd-amd64-cgo), const ECHO = 8 +pkg syscall (openbsd-amd64-cgo), const ECHOCTL = 64 +pkg syscall (openbsd-amd64-cgo), const ECHOE = 2 +pkg syscall (openbsd-amd64-cgo), const ECHOK = 4 +pkg syscall (openbsd-amd64-cgo), const ECHOKE = 1 +pkg syscall (openbsd-amd64-cgo), const ECHONL = 16 +pkg syscall (openbsd-amd64-cgo), const ECHOPRT = 32 +pkg syscall (openbsd-amd64-cgo), const ECONNABORTED = 53 +pkg syscall (openbsd-amd64-cgo), const ECONNREFUSED = 61 +pkg syscall (openbsd-amd64-cgo), const ECONNRESET = 54 +pkg syscall (openbsd-amd64-cgo), const EDEADLK = 11 +pkg syscall (openbsd-amd64-cgo), const EDESTADDRREQ = 39 +pkg syscall (openbsd-amd64-cgo), const EDOM = 33 +pkg syscall (openbsd-amd64-cgo), const EDQUOT = 69 +pkg syscall (openbsd-amd64-cgo), const EEXIST = 17 +pkg syscall (openbsd-amd64-cgo), const EFAULT = 14 +pkg syscall (openbsd-amd64-cgo), const EFBIG = 27 +pkg syscall (openbsd-amd64-cgo), const EFER_LMA = 1024 +pkg syscall (openbsd-amd64-cgo), const EFER_LME = 256 +pkg syscall (openbsd-amd64-cgo), const EFER_NXE = 2048 +pkg syscall (openbsd-amd64-cgo), const EFER_SCE = 1 +pkg syscall (openbsd-amd64-cgo), const EFTYPE = 79 +pkg syscall (openbsd-amd64-cgo), const EHOSTDOWN = 64 +pkg syscall (openbsd-amd64-cgo), const EHOSTUNREACH = 65 +pkg syscall (openbsd-amd64-cgo), const EIDRM = 89 +pkg syscall (openbsd-amd64-cgo), const EILSEQ = 84 +pkg syscall (openbsd-amd64-cgo), const EINPROGRESS = 36 +pkg syscall (openbsd-amd64-cgo), const EINTR = 4 +pkg syscall (openbsd-amd64-cgo), const EINVAL = 22 +pkg syscall (openbsd-amd64-cgo), const EIO = 5 +pkg syscall (openbsd-amd64-cgo), const EIPSEC = 82 +pkg syscall (openbsd-amd64-cgo), const EISCONN = 56 +pkg syscall (openbsd-amd64-cgo), const EISDIR = 21 +pkg syscall (openbsd-amd64-cgo), const ELAST = 91 +pkg syscall (openbsd-amd64-cgo), const ELOOP = 62 +pkg syscall (openbsd-amd64-cgo), const EMEDIUMTYPE = 86 +pkg syscall (openbsd-amd64-cgo), const EMFILE = 24 +pkg syscall (openbsd-amd64-cgo), const EMLINK = 31 +pkg syscall (openbsd-amd64-cgo), const EMSGSIZE = 40 +pkg syscall (openbsd-amd64-cgo), const EMT_TAGOVF = 1 +pkg syscall (openbsd-amd64-cgo), const EMUL_ENABLED = 1 +pkg syscall (openbsd-amd64-cgo), const EMUL_NATIVE = 2 +pkg syscall (openbsd-amd64-cgo), const ENAMETOOLONG = 63 +pkg syscall (openbsd-amd64-cgo), const ENDRUNDISC = 9 +pkg syscall (openbsd-amd64-cgo), const ENEEDAUTH = 81 +pkg syscall (openbsd-amd64-cgo), const ENETDOWN = 50 +pkg syscall (openbsd-amd64-cgo), const ENETRESET = 52 +pkg syscall (openbsd-amd64-cgo), const ENETUNREACH = 51 +pkg syscall (openbsd-amd64-cgo), const ENFILE = 23 +pkg syscall (openbsd-amd64-cgo), const ENOATTR = 83 +pkg syscall (openbsd-amd64-cgo), const ENOBUFS = 55 +pkg syscall (openbsd-amd64-cgo), const ENODEV = 19 +pkg syscall (openbsd-amd64-cgo), const ENOEXEC = 8 +pkg syscall (openbsd-amd64-cgo), const ENOLCK = 77 +pkg syscall (openbsd-amd64-cgo), const ENOMEDIUM = 85 +pkg syscall (openbsd-amd64-cgo), const ENOMEM = 12 +pkg syscall (openbsd-amd64-cgo), const ENOMSG = 90 +pkg syscall (openbsd-amd64-cgo), const ENOPROTOOPT = 42 +pkg syscall (openbsd-amd64-cgo), const ENOSPC = 28 +pkg syscall (openbsd-amd64-cgo), const ENOSYS = 78 +pkg syscall (openbsd-amd64-cgo), const ENOTBLK = 15 +pkg syscall (openbsd-amd64-cgo), const ENOTCONN = 57 +pkg syscall (openbsd-amd64-cgo), const ENOTDIR = 20 +pkg syscall (openbsd-amd64-cgo), const ENOTEMPTY = 66 +pkg syscall (openbsd-amd64-cgo), const ENOTSOCK = 38 +pkg syscall (openbsd-amd64-cgo), const ENOTSUP = 91 +pkg syscall (openbsd-amd64-cgo), const ENOTTY = 25 +pkg syscall (openbsd-amd64-cgo), const ENXIO = 6 +pkg syscall (openbsd-amd64-cgo), const EOPNOTSUPP = 45 +pkg syscall (openbsd-amd64-cgo), const EOVERFLOW = 87 +pkg syscall (openbsd-amd64-cgo), const EPERM = 1 +pkg syscall (openbsd-amd64-cgo), const EPFNOSUPPORT = 46 +pkg syscall (openbsd-amd64-cgo), const EPIPE = 32 +pkg syscall (openbsd-amd64-cgo), const EPROCLIM = 67 +pkg syscall (openbsd-amd64-cgo), const EPROCUNAVAIL = 76 +pkg syscall (openbsd-amd64-cgo), const EPROGMISMATCH = 75 +pkg syscall (openbsd-amd64-cgo), const EPROGUNAVAIL = 74 +pkg syscall (openbsd-amd64-cgo), const EPROTONOSUPPORT = 43 +pkg syscall (openbsd-amd64-cgo), const EPROTOTYPE = 41 +pkg syscall (openbsd-amd64-cgo), const ERANGE = 34 +pkg syscall (openbsd-amd64-cgo), const EREMOTE = 71 +pkg syscall (openbsd-amd64-cgo), const EROFS = 30 +pkg syscall (openbsd-amd64-cgo), const ERPCMISMATCH = 73 +pkg syscall (openbsd-amd64-cgo), const ESHUTDOWN = 58 +pkg syscall (openbsd-amd64-cgo), const ESOCKTNOSUPPORT = 44 +pkg syscall (openbsd-amd64-cgo), const ESPIPE = 29 +pkg syscall (openbsd-amd64-cgo), const ESRCH = 3 +pkg syscall (openbsd-amd64-cgo), const ESTALE = 70 +pkg syscall (openbsd-amd64-cgo), const ETHERMIN = 46 +pkg syscall (openbsd-amd64-cgo), const ETHERMTU = 1500 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_8023 = 4 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_AARP = 33011 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_ACCTON = 33680 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_AEONIC = 32822 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_ALPHA = 33098 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_AMBER = 24584 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_AMOEBA = 33093 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_AOE = 34978 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_APOLLO = 33015 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_APOLLODOMAIN = 32793 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_APPLETALK = 32923 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_APPLITEK = 32967 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_ARGONAUT = 32826 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_ARP = 2054 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_AT = 32923 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_ATALK = 32923 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_ATOMIC = 34527 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_ATT = 32873 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_ATTSTANFORD = 32776 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_AUTOPHON = 32874 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_AXIS = 34902 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_BCLOOP = 36867 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_BOFL = 33026 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_CABLETRON = 28724 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_CHAOS = 2052 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_COMDESIGN = 32876 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_COMPUGRAPHIC = 32877 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_COUNTERPOINT = 32866 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_CRONUS = 32772 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_CRONUSVLN = 32771 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_DCA = 4660 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_DDE = 32891 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_DEBNI = 43690 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_DECAM = 32840 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_DECCUST = 24582 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_DECDIAG = 24581 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_DECDNS = 32828 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_DECDTS = 32830 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_DECEXPER = 24576 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_DECLAST = 32833 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_DECLTM = 32831 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_DECMUMPS = 24585 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_DECNETBIOS = 32832 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_DELTACON = 34526 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_DIDDLE = 17185 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_DLOG1 = 1632 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_DLOG2 = 1633 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_DN = 24579 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_DOGFIGHT = 6537 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_DSMD = 32825 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_ECMA = 2051 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_ENCRYPT = 32829 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_ES = 32861 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_EXCELAN = 32784 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_EXPERDATA = 32841 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_FLIP = 33094 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_FLOWCONTROL = 34824 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_FRARP = 2056 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_GENDYN = 32872 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_HAYES = 33072 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_HIPPI_FP = 33152 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_HITACHI = 34848 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_HP = 32773 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_IEEEPUP = 2560 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_IEEEPUPAT = 2561 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_IMLBL = 19522 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_IMLBLDIAG = 16972 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_IP = 2048 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_IPAS = 34668 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_IPV6 = 34525 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_IPX = 33079 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_IPXNEW = 32823 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_KALPANA = 34178 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_LANBRIDGE = 32824 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_LANPROBE = 34952 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_LAT = 24580 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_LBACK = 36864 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_LITTLE = 32864 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_LLDP = 35020 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_LOGICRAFT = 33096 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_LOOPBACK = 36864 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_MATRA = 32890 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_MAX = 65535 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_MERIT = 32892 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_MICP = 34618 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_MOPDL = 24577 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_MOPRC = 24578 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_MOTOROLA = 33165 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_MPLS = 34887 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_MPLS_MCAST = 34888 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_MUMPS = 33087 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_NBPCC = 15364 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_NBPCLAIM = 15369 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_NBPCLREQ = 15365 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_NBPCLRSP = 15366 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_NBPCREQ = 15362 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_NBPCRSP = 15363 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_NBPDG = 15367 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_NBPDGB = 15368 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_NBPDLTE = 15370 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_NBPRAR = 15372 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_NBPRAS = 15371 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_NBPRST = 15373 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_NBPSCD = 15361 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_NBPVCD = 15360 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_NBS = 2050 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_NCD = 33097 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_NESTAR = 32774 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_NETBEUI = 33169 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_NOVELL = 33080 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_NS = 1536 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_NSAT = 1537 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_NSCOMPAT = 2055 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_NTRAILER = 16 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_OS9 = 28679 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_OS9NET = 28681 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_PACER = 32966 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_PAE = 34958 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_PCS = 16962 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_PLANNING = 32836 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_PPP = 34827 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_PPPOE = 34916 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_PPPOEDISC = 34915 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_PRIMENTS = 28721 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_PUP = 512 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_PUPAT = 512 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_QINQ = 34984 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_RACAL = 28720 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_RATIONAL = 33104 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_RAWFR = 25945 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_RCL = 6549 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_RDP = 34617 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_RETIX = 33010 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_REVARP = 32821 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_SCA = 24583 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_SECTRA = 34523 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_SECUREDATA = 34669 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_SGITW = 33150 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_SG_BOUNCE = 32790 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_SG_DIAG = 32787 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_SG_NETGAMES = 32788 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_SG_RESV = 32789 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_SIMNET = 21000 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_SLOW = 34825 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_SNA = 32981 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_SNMP = 33100 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_SONIX = 64245 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_SPIDER = 32927 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_SPRITE = 1280 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_STP = 33153 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_TALARIS = 33067 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_TALARISMC = 34091 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_TCPCOMP = 34667 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_TCPSM = 36866 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_TEC = 33103 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_TIGAN = 32815 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_TRAIL = 4096 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_TRANSETHER = 25944 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_TYMSHARE = 32814 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_UBBST = 28677 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_UBDEBUG = 2304 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_UBDIAGLOOP = 28674 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_UBDL = 28672 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_UBNIU = 28673 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_UBNMC = 28675 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_VALID = 5632 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_VARIAN = 32989 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_VAXELN = 32827 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_VEECO = 32871 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_VEXP = 32859 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_VGLAB = 33073 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_VINES = 2989 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_VINESECHO = 2991 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_VINESLOOP = 2990 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_VITAL = 65280 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_VLAN = 33024 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_VLTLMAN = 32896 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_VPROD = 32860 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_VURESERVED = 33095 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_WATERLOO = 33072 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_WELLFLEET = 33027 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_X25 = 2053 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_X75 = 2049 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_XNSSM = 36865 +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_XTP = 33149 +pkg syscall (openbsd-amd64-cgo), const ETHER_ADDR_LEN = 6 +pkg syscall (openbsd-amd64-cgo), const ETHER_ALIGN = 2 +pkg syscall (openbsd-amd64-cgo), const ETHER_CRC_LEN = 4 +pkg syscall (openbsd-amd64-cgo), const ETHER_CRC_POLY_BE = 79764918 +pkg syscall (openbsd-amd64-cgo), const ETHER_CRC_POLY_LE = 3988292384 +pkg syscall (openbsd-amd64-cgo), const ETHER_HDR_LEN = 14 +pkg syscall (openbsd-amd64-cgo), const ETHER_MAX_DIX_LEN = 1536 +pkg syscall (openbsd-amd64-cgo), const ETHER_MAX_LEN = 1518 +pkg syscall (openbsd-amd64-cgo), const ETHER_MIN_LEN = 64 +pkg syscall (openbsd-amd64-cgo), const ETHER_TYPE_LEN = 2 +pkg syscall (openbsd-amd64-cgo), const ETHER_VLAN_ENCAP_LEN = 4 +pkg syscall (openbsd-amd64-cgo), const ETIMEDOUT = 60 +pkg syscall (openbsd-amd64-cgo), const ETOOMANYREFS = 59 +pkg syscall (openbsd-amd64-cgo), const ETXTBSY = 26 +pkg syscall (openbsd-amd64-cgo), const EUSERS = 68 +pkg syscall (openbsd-amd64-cgo), const EVFILT_AIO = -3 +pkg syscall (openbsd-amd64-cgo), const EVFILT_PROC = -5 +pkg syscall (openbsd-amd64-cgo), const EVFILT_READ = -1 +pkg syscall (openbsd-amd64-cgo), const EVFILT_SIGNAL = -6 +pkg syscall (openbsd-amd64-cgo), const EVFILT_SYSCOUNT = 7 +pkg syscall (openbsd-amd64-cgo), const EVFILT_TIMER = -7 +pkg syscall (openbsd-amd64-cgo), const EVFILT_VNODE = -4 +pkg syscall (openbsd-amd64-cgo), const EVFILT_WRITE = -2 +pkg syscall (openbsd-amd64-cgo), const EV_ADD = 1 +pkg syscall (openbsd-amd64-cgo), const EV_CLEAR = 32 +pkg syscall (openbsd-amd64-cgo), const EV_DELETE = 2 +pkg syscall (openbsd-amd64-cgo), const EV_DISABLE = 8 +pkg syscall (openbsd-amd64-cgo), const EV_ENABLE = 4 +pkg syscall (openbsd-amd64-cgo), const EV_EOF = 32768 +pkg syscall (openbsd-amd64-cgo), const EV_ERROR = 16384 +pkg syscall (openbsd-amd64-cgo), const EV_FLAG1 = 8192 +pkg syscall (openbsd-amd64-cgo), const EV_ONESHOT = 16 +pkg syscall (openbsd-amd64-cgo), const EV_SYSFLAGS = 61440 +pkg syscall (openbsd-amd64-cgo), const EWOULDBLOCK = 35 +pkg syscall (openbsd-amd64-cgo), const EXDEV = 18 +pkg syscall (openbsd-amd64-cgo), const EXTA = 19200 +pkg syscall (openbsd-amd64-cgo), const EXTB = 38400 +pkg syscall (openbsd-amd64-cgo), const EXTPROC = 2048 +pkg syscall (openbsd-amd64-cgo), const FD_CLOEXEC = 1 +pkg syscall (openbsd-amd64-cgo), const FD_SETSIZE = 1024 +pkg syscall (openbsd-amd64-cgo), const FLUSHO = 8388608 +pkg syscall (openbsd-amd64-cgo), const F_DUPFD = 0 +pkg syscall (openbsd-amd64-cgo), const F_DUPFD_CLOEXEC = 10 +pkg syscall (openbsd-amd64-cgo), const F_GETFD = 1 +pkg syscall (openbsd-amd64-cgo), const F_GETFL = 3 +pkg syscall (openbsd-amd64-cgo), const F_GETLK = 7 +pkg syscall (openbsd-amd64-cgo), const F_GETOWN = 5 +pkg syscall (openbsd-amd64-cgo), const F_OK = 0 +pkg syscall (openbsd-amd64-cgo), const F_RDLCK = 1 +pkg syscall (openbsd-amd64-cgo), const F_SETFD = 2 +pkg syscall (openbsd-amd64-cgo), const F_SETFL = 4 +pkg syscall (openbsd-amd64-cgo), const F_SETLK = 8 +pkg syscall (openbsd-amd64-cgo), const F_SETLKW = 9 +pkg syscall (openbsd-amd64-cgo), const F_SETOWN = 6 +pkg syscall (openbsd-amd64-cgo), const F_UNLCK = 2 +pkg syscall (openbsd-amd64-cgo), const F_WRLCK = 3 +pkg syscall (openbsd-amd64-cgo), const HUPCL = 16384 +pkg syscall (openbsd-amd64-cgo), const ICANON = 256 +pkg syscall (openbsd-amd64-cgo), const ICRNL = 256 +pkg syscall (openbsd-amd64-cgo), const IEXTEN = 1024 +pkg syscall (openbsd-amd64-cgo), const IFAN_ARRIVAL = 0 +pkg syscall (openbsd-amd64-cgo), const IFAN_DEPARTURE = 1 +pkg syscall (openbsd-amd64-cgo), const IFA_ROUTE = 1 +pkg syscall (openbsd-amd64-cgo), const IFF_ALLMULTI = 512 +pkg syscall (openbsd-amd64-cgo), const IFF_CANTCHANGE = 36434 +pkg syscall (openbsd-amd64-cgo), const IFF_DEBUG = 4 +pkg syscall (openbsd-amd64-cgo), const IFF_LINK0 = 4096 +pkg syscall (openbsd-amd64-cgo), const IFF_LINK1 = 8192 +pkg syscall (openbsd-amd64-cgo), const IFF_LINK2 = 16384 +pkg syscall (openbsd-amd64-cgo), const IFF_LOOPBACK = 8 +pkg syscall (openbsd-amd64-cgo), const IFF_MULTICAST = 32768 +pkg syscall (openbsd-amd64-cgo), const IFF_NOARP = 128 +pkg syscall (openbsd-amd64-cgo), const IFF_NOTRAILERS = 32 +pkg syscall (openbsd-amd64-cgo), const IFF_OACTIVE = 1024 +pkg syscall (openbsd-amd64-cgo), const IFF_POINTOPOINT = 16 +pkg syscall (openbsd-amd64-cgo), const IFF_PROMISC = 256 +pkg syscall (openbsd-amd64-cgo), const IFF_RUNNING = 64 +pkg syscall (openbsd-amd64-cgo), const IFF_SIMPLEX = 2048 +pkg syscall (openbsd-amd64-cgo), const IFNAMSIZ = 16 +pkg syscall (openbsd-amd64-cgo), const IFT_1822 = 2 +pkg syscall (openbsd-amd64-cgo), const IFT_A12MPPSWITCH = 130 +pkg syscall (openbsd-amd64-cgo), const IFT_AAL2 = 187 +pkg syscall (openbsd-amd64-cgo), const IFT_AAL5 = 49 +pkg syscall (openbsd-amd64-cgo), const IFT_ADSL = 94 +pkg syscall (openbsd-amd64-cgo), const IFT_AFLANE8023 = 59 +pkg syscall (openbsd-amd64-cgo), const IFT_AFLANE8025 = 60 +pkg syscall (openbsd-amd64-cgo), const IFT_ARAP = 88 +pkg syscall (openbsd-amd64-cgo), const IFT_ARCNET = 35 +pkg syscall (openbsd-amd64-cgo), const IFT_ARCNETPLUS = 36 +pkg syscall (openbsd-amd64-cgo), const IFT_ASYNC = 84 +pkg syscall (openbsd-amd64-cgo), const IFT_ATM = 37 +pkg syscall (openbsd-amd64-cgo), const IFT_ATMDXI = 105 +pkg syscall (openbsd-amd64-cgo), const IFT_ATMFUNI = 106 +pkg syscall (openbsd-amd64-cgo), const IFT_ATMIMA = 107 +pkg syscall (openbsd-amd64-cgo), const IFT_ATMLOGICAL = 80 +pkg syscall (openbsd-amd64-cgo), const IFT_ATMRADIO = 189 +pkg syscall (openbsd-amd64-cgo), const IFT_ATMSUBINTERFACE = 134 +pkg syscall (openbsd-amd64-cgo), const IFT_ATMVCIENDPT = 194 +pkg syscall (openbsd-amd64-cgo), const IFT_ATMVIRTUAL = 149 +pkg syscall (openbsd-amd64-cgo), const IFT_BGPPOLICYACCOUNTING = 162 +pkg syscall (openbsd-amd64-cgo), const IFT_BLUETOOTH = 248 +pkg syscall (openbsd-amd64-cgo), const IFT_BRIDGE = 209 +pkg syscall (openbsd-amd64-cgo), const IFT_BSC = 83 +pkg syscall (openbsd-amd64-cgo), const IFT_CARP = 247 +pkg syscall (openbsd-amd64-cgo), const IFT_CCTEMUL = 61 +pkg syscall (openbsd-amd64-cgo), const IFT_CEPT = 19 +pkg syscall (openbsd-amd64-cgo), const IFT_CES = 133 +pkg syscall (openbsd-amd64-cgo), const IFT_CHANNEL = 70 +pkg syscall (openbsd-amd64-cgo), const IFT_CNR = 85 +pkg syscall (openbsd-amd64-cgo), const IFT_COFFEE = 132 +pkg syscall (openbsd-amd64-cgo), const IFT_COMPOSITELINK = 155 +pkg syscall (openbsd-amd64-cgo), const IFT_DCN = 141 +pkg syscall (openbsd-amd64-cgo), const IFT_DIGITALPOWERLINE = 138 +pkg syscall (openbsd-amd64-cgo), const IFT_DIGITALWRAPPEROVERHEADCHANNEL = 186 +pkg syscall (openbsd-amd64-cgo), const IFT_DLSW = 74 +pkg syscall (openbsd-amd64-cgo), const IFT_DOCSCABLEDOWNSTREAM = 128 +pkg syscall (openbsd-amd64-cgo), const IFT_DOCSCABLEMACLAYER = 127 +pkg syscall (openbsd-amd64-cgo), const IFT_DOCSCABLEUPSTREAM = 129 +pkg syscall (openbsd-amd64-cgo), const IFT_DOCSCABLEUPSTREAMCHANNEL = 205 +pkg syscall (openbsd-amd64-cgo), const IFT_DS0 = 81 +pkg syscall (openbsd-amd64-cgo), const IFT_DS0BUNDLE = 82 +pkg syscall (openbsd-amd64-cgo), const IFT_DS1FDL = 170 +pkg syscall (openbsd-amd64-cgo), const IFT_DS3 = 30 +pkg syscall (openbsd-amd64-cgo), const IFT_DTM = 140 +pkg syscall (openbsd-amd64-cgo), const IFT_DUMMY = 241 +pkg syscall (openbsd-amd64-cgo), const IFT_DVBASILN = 172 +pkg syscall (openbsd-amd64-cgo), const IFT_DVBASIOUT = 173 +pkg syscall (openbsd-amd64-cgo), const IFT_DVBRCCDOWNSTREAM = 147 +pkg syscall (openbsd-amd64-cgo), const IFT_DVBRCCMACLAYER = 146 +pkg syscall (openbsd-amd64-cgo), const IFT_DVBRCCUPSTREAM = 148 +pkg syscall (openbsd-amd64-cgo), const IFT_ECONET = 206 +pkg syscall (openbsd-amd64-cgo), const IFT_ENC = 244 +pkg syscall (openbsd-amd64-cgo), const IFT_EON = 25 +pkg syscall (openbsd-amd64-cgo), const IFT_EPLRS = 87 +pkg syscall (openbsd-amd64-cgo), const IFT_ESCON = 73 +pkg syscall (openbsd-amd64-cgo), const IFT_ETHER = 6 +pkg syscall (openbsd-amd64-cgo), const IFT_FAITH = 243 +pkg syscall (openbsd-amd64-cgo), const IFT_FAST = 125 +pkg syscall (openbsd-amd64-cgo), const IFT_FASTETHER = 62 +pkg syscall (openbsd-amd64-cgo), const IFT_FASTETHERFX = 69 +pkg syscall (openbsd-amd64-cgo), const IFT_FDDI = 15 +pkg syscall (openbsd-amd64-cgo), const IFT_FIBRECHANNEL = 56 +pkg syscall (openbsd-amd64-cgo), const IFT_FRAMERELAYINTERCONNECT = 58 +pkg syscall (openbsd-amd64-cgo), const IFT_FRAMERELAYMPI = 92 +pkg syscall (openbsd-amd64-cgo), const IFT_FRDLCIENDPT = 193 +pkg syscall (openbsd-amd64-cgo), const IFT_FRELAY = 32 +pkg syscall (openbsd-amd64-cgo), const IFT_FRELAYDCE = 44 +pkg syscall (openbsd-amd64-cgo), const IFT_FRF16MFRBUNDLE = 163 +pkg syscall (openbsd-amd64-cgo), const IFT_FRFORWARD = 158 +pkg syscall (openbsd-amd64-cgo), const IFT_G703AT2MB = 67 +pkg syscall (openbsd-amd64-cgo), const IFT_G703AT64K = 66 +pkg syscall (openbsd-amd64-cgo), const IFT_GIF = 240 +pkg syscall (openbsd-amd64-cgo), const IFT_GIGABITETHERNET = 117 +pkg syscall (openbsd-amd64-cgo), const IFT_GR303IDT = 178 +pkg syscall (openbsd-amd64-cgo), const IFT_GR303RDT = 177 +pkg syscall (openbsd-amd64-cgo), const IFT_H323GATEKEEPER = 164 +pkg syscall (openbsd-amd64-cgo), const IFT_H323PROXY = 165 +pkg syscall (openbsd-amd64-cgo), const IFT_HDH1822 = 3 +pkg syscall (openbsd-amd64-cgo), const IFT_HDLC = 118 +pkg syscall (openbsd-amd64-cgo), const IFT_HDSL2 = 168 +pkg syscall (openbsd-amd64-cgo), const IFT_HIPERLAN2 = 183 +pkg syscall (openbsd-amd64-cgo), const IFT_HIPPI = 47 +pkg syscall (openbsd-amd64-cgo), const IFT_HIPPIINTERFACE = 57 +pkg syscall (openbsd-amd64-cgo), const IFT_HOSTPAD = 90 +pkg syscall (openbsd-amd64-cgo), const IFT_HSSI = 46 +pkg syscall (openbsd-amd64-cgo), const IFT_HY = 14 +pkg syscall (openbsd-amd64-cgo), const IFT_IBM370PARCHAN = 72 +pkg syscall (openbsd-amd64-cgo), const IFT_IDSL = 154 +pkg syscall (openbsd-amd64-cgo), const IFT_IEEE1394 = 144 +pkg syscall (openbsd-amd64-cgo), const IFT_IEEE80211 = 71 +pkg syscall (openbsd-amd64-cgo), const IFT_IEEE80212 = 55 +pkg syscall (openbsd-amd64-cgo), const IFT_IEEE8023ADLAG = 161 +pkg syscall (openbsd-amd64-cgo), const IFT_IFGSN = 145 +pkg syscall (openbsd-amd64-cgo), const IFT_IMT = 190 +pkg syscall (openbsd-amd64-cgo), const IFT_INFINIBAND = 199 +pkg syscall (openbsd-amd64-cgo), const IFT_INTERLEAVE = 124 +pkg syscall (openbsd-amd64-cgo), const IFT_IP = 126 +pkg syscall (openbsd-amd64-cgo), const IFT_IPFORWARD = 142 +pkg syscall (openbsd-amd64-cgo), const IFT_IPOVERATM = 114 +pkg syscall (openbsd-amd64-cgo), const IFT_IPOVERCDLC = 109 +pkg syscall (openbsd-amd64-cgo), const IFT_IPOVERCLAW = 110 +pkg syscall (openbsd-amd64-cgo), const IFT_IPSWITCH = 78 +pkg syscall (openbsd-amd64-cgo), const IFT_ISDN = 63 +pkg syscall (openbsd-amd64-cgo), const IFT_ISDNBASIC = 20 +pkg syscall (openbsd-amd64-cgo), const IFT_ISDNPRIMARY = 21 +pkg syscall (openbsd-amd64-cgo), const IFT_ISDNS = 75 +pkg syscall (openbsd-amd64-cgo), const IFT_ISDNU = 76 +pkg syscall (openbsd-amd64-cgo), const IFT_ISO88022LLC = 41 +pkg syscall (openbsd-amd64-cgo), const IFT_ISO88023 = 7 +pkg syscall (openbsd-amd64-cgo), const IFT_ISO88024 = 8 +pkg syscall (openbsd-amd64-cgo), const IFT_ISO88025 = 9 +pkg syscall (openbsd-amd64-cgo), const IFT_ISO88025CRFPINT = 98 +pkg syscall (openbsd-amd64-cgo), const IFT_ISO88025DTR = 86 +pkg syscall (openbsd-amd64-cgo), const IFT_ISO88025FIBER = 115 +pkg syscall (openbsd-amd64-cgo), const IFT_ISO88026 = 10 +pkg syscall (openbsd-amd64-cgo), const IFT_ISUP = 179 +pkg syscall (openbsd-amd64-cgo), const IFT_L2VLAN = 135 +pkg syscall (openbsd-amd64-cgo), const IFT_L3IPVLAN = 136 +pkg syscall (openbsd-amd64-cgo), const IFT_L3IPXVLAN = 137 +pkg syscall (openbsd-amd64-cgo), const IFT_LAPB = 16 +pkg syscall (openbsd-amd64-cgo), const IFT_LAPD = 77 +pkg syscall (openbsd-amd64-cgo), const IFT_LAPF = 119 +pkg syscall (openbsd-amd64-cgo), const IFT_LINEGROUP = 210 +pkg syscall (openbsd-amd64-cgo), const IFT_LOCALTALK = 42 +pkg syscall (openbsd-amd64-cgo), const IFT_LOOP = 24 +pkg syscall (openbsd-amd64-cgo), const IFT_MEDIAMAILOVERIP = 139 +pkg syscall (openbsd-amd64-cgo), const IFT_MFSIGLINK = 167 +pkg syscall (openbsd-amd64-cgo), const IFT_MIOX25 = 38 +pkg syscall (openbsd-amd64-cgo), const IFT_MODEM = 48 +pkg syscall (openbsd-amd64-cgo), const IFT_MPC = 113 +pkg syscall (openbsd-amd64-cgo), const IFT_MPLS = 166 +pkg syscall (openbsd-amd64-cgo), const IFT_MPLSTUNNEL = 150 +pkg syscall (openbsd-amd64-cgo), const IFT_MSDSL = 143 +pkg syscall (openbsd-amd64-cgo), const IFT_MVL = 191 +pkg syscall (openbsd-amd64-cgo), const IFT_MYRINET = 99 +pkg syscall (openbsd-amd64-cgo), const IFT_NFAS = 175 +pkg syscall (openbsd-amd64-cgo), const IFT_NSIP = 27 +pkg syscall (openbsd-amd64-cgo), const IFT_OPTICALCHANNEL = 195 +pkg syscall (openbsd-amd64-cgo), const IFT_OPTICALTRANSPORT = 196 +pkg syscall (openbsd-amd64-cgo), const IFT_OTHER = 1 +pkg syscall (openbsd-amd64-cgo), const IFT_P10 = 12 +pkg syscall (openbsd-amd64-cgo), const IFT_P80 = 13 +pkg syscall (openbsd-amd64-cgo), const IFT_PARA = 34 +pkg syscall (openbsd-amd64-cgo), const IFT_PFLOG = 245 +pkg syscall (openbsd-amd64-cgo), const IFT_PFLOW = 249 +pkg syscall (openbsd-amd64-cgo), const IFT_PFSYNC = 246 +pkg syscall (openbsd-amd64-cgo), const IFT_PLC = 174 +pkg syscall (openbsd-amd64-cgo), const IFT_PON155 = 207 +pkg syscall (openbsd-amd64-cgo), const IFT_PON622 = 208 +pkg syscall (openbsd-amd64-cgo), const IFT_POS = 171 +pkg syscall (openbsd-amd64-cgo), const IFT_PPP = 23 +pkg syscall (openbsd-amd64-cgo), const IFT_PPPMULTILINKBUNDLE = 108 +pkg syscall (openbsd-amd64-cgo), const IFT_PROPATM = 197 +pkg syscall (openbsd-amd64-cgo), const IFT_PROPBWAP2MP = 184 +pkg syscall (openbsd-amd64-cgo), const IFT_PROPCNLS = 89 +pkg syscall (openbsd-amd64-cgo), const IFT_PROPDOCSWIRELESSDOWNSTREAM = 181 +pkg syscall (openbsd-amd64-cgo), const IFT_PROPDOCSWIRELESSMACLAYER = 180 +pkg syscall (openbsd-amd64-cgo), const IFT_PROPDOCSWIRELESSUPSTREAM = 182 +pkg syscall (openbsd-amd64-cgo), const IFT_PROPMUX = 54 +pkg syscall (openbsd-amd64-cgo), const IFT_PROPVIRTUAL = 53 +pkg syscall (openbsd-amd64-cgo), const IFT_PROPWIRELESSP2P = 157 +pkg syscall (openbsd-amd64-cgo), const IFT_PTPSERIAL = 22 +pkg syscall (openbsd-amd64-cgo), const IFT_PVC = 242 +pkg syscall (openbsd-amd64-cgo), const IFT_Q2931 = 201 +pkg syscall (openbsd-amd64-cgo), const IFT_QLLC = 68 +pkg syscall (openbsd-amd64-cgo), const IFT_RADIOMAC = 188 +pkg syscall (openbsd-amd64-cgo), const IFT_RADSL = 95 +pkg syscall (openbsd-amd64-cgo), const IFT_REACHDSL = 192 +pkg syscall (openbsd-amd64-cgo), const IFT_RFC1483 = 159 +pkg syscall (openbsd-amd64-cgo), const IFT_RS232 = 33 +pkg syscall (openbsd-amd64-cgo), const IFT_RSRB = 79 +pkg syscall (openbsd-amd64-cgo), const IFT_SDLC = 17 +pkg syscall (openbsd-amd64-cgo), const IFT_SDSL = 96 +pkg syscall (openbsd-amd64-cgo), const IFT_SHDSL = 169 +pkg syscall (openbsd-amd64-cgo), const IFT_SIP = 31 +pkg syscall (openbsd-amd64-cgo), const IFT_SIPSIG = 204 +pkg syscall (openbsd-amd64-cgo), const IFT_SIPTG = 203 +pkg syscall (openbsd-amd64-cgo), const IFT_SLIP = 28 +pkg syscall (openbsd-amd64-cgo), const IFT_SMDSDXI = 43 +pkg syscall (openbsd-amd64-cgo), const IFT_SMDSICIP = 52 +pkg syscall (openbsd-amd64-cgo), const IFT_SONET = 39 +pkg syscall (openbsd-amd64-cgo), const IFT_SONETOVERHEADCHANNEL = 185 +pkg syscall (openbsd-amd64-cgo), const IFT_SONETPATH = 50 +pkg syscall (openbsd-amd64-cgo), const IFT_SONETVT = 51 +pkg syscall (openbsd-amd64-cgo), const IFT_SRP = 151 +pkg syscall (openbsd-amd64-cgo), const IFT_SS7SIGLINK = 156 +pkg syscall (openbsd-amd64-cgo), const IFT_STACKTOSTACK = 111 +pkg syscall (openbsd-amd64-cgo), const IFT_STARLAN = 11 +pkg syscall (openbsd-amd64-cgo), const IFT_T1 = 18 +pkg syscall (openbsd-amd64-cgo), const IFT_TDLC = 116 +pkg syscall (openbsd-amd64-cgo), const IFT_TELINK = 200 +pkg syscall (openbsd-amd64-cgo), const IFT_TERMPAD = 91 +pkg syscall (openbsd-amd64-cgo), const IFT_TR008 = 176 +pkg syscall (openbsd-amd64-cgo), const IFT_TRANSPHDLC = 123 +pkg syscall (openbsd-amd64-cgo), const IFT_TUNNEL = 131 +pkg syscall (openbsd-amd64-cgo), const IFT_ULTRA = 29 +pkg syscall (openbsd-amd64-cgo), const IFT_USB = 160 +pkg syscall (openbsd-amd64-cgo), const IFT_V11 = 64 +pkg syscall (openbsd-amd64-cgo), const IFT_V35 = 45 +pkg syscall (openbsd-amd64-cgo), const IFT_V36 = 65 +pkg syscall (openbsd-amd64-cgo), const IFT_V37 = 120 +pkg syscall (openbsd-amd64-cgo), const IFT_VDSL = 97 +pkg syscall (openbsd-amd64-cgo), const IFT_VIRTUALIPADDRESS = 112 +pkg syscall (openbsd-amd64-cgo), const IFT_VIRTUALTG = 202 +pkg syscall (openbsd-amd64-cgo), const IFT_VOICEDID = 213 +pkg syscall (openbsd-amd64-cgo), const IFT_VOICEEM = 100 +pkg syscall (openbsd-amd64-cgo), const IFT_VOICEEMFGD = 211 +pkg syscall (openbsd-amd64-cgo), const IFT_VOICEENCAP = 103 +pkg syscall (openbsd-amd64-cgo), const IFT_VOICEFGDEANA = 212 +pkg syscall (openbsd-amd64-cgo), const IFT_VOICEFXO = 101 +pkg syscall (openbsd-amd64-cgo), const IFT_VOICEFXS = 102 +pkg syscall (openbsd-amd64-cgo), const IFT_VOICEOVERATM = 152 +pkg syscall (openbsd-amd64-cgo), const IFT_VOICEOVERCABLE = 198 +pkg syscall (openbsd-amd64-cgo), const IFT_VOICEOVERFRAMERELAY = 153 +pkg syscall (openbsd-amd64-cgo), const IFT_VOICEOVERIP = 104 +pkg syscall (openbsd-amd64-cgo), const IFT_X213 = 93 +pkg syscall (openbsd-amd64-cgo), const IFT_X25 = 5 +pkg syscall (openbsd-amd64-cgo), const IFT_X25DDN = 4 +pkg syscall (openbsd-amd64-cgo), const IFT_X25HUNTGROUP = 122 +pkg syscall (openbsd-amd64-cgo), const IFT_X25MLP = 121 +pkg syscall (openbsd-amd64-cgo), const IFT_X25PLE = 40 +pkg syscall (openbsd-amd64-cgo), const IFT_XETHER = 26 +pkg syscall (openbsd-amd64-cgo), const IGNBRK = 1 +pkg syscall (openbsd-amd64-cgo), const IGNCR = 128 +pkg syscall (openbsd-amd64-cgo), const IGNPAR = 4 +pkg syscall (openbsd-amd64-cgo), const IMAXBEL = 8192 +pkg syscall (openbsd-amd64-cgo), const INLCR = 64 +pkg syscall (openbsd-amd64-cgo), const INPCK = 16 +pkg syscall (openbsd-amd64-cgo), const IN_CLASSA_HOST = 16777215 +pkg syscall (openbsd-amd64-cgo), const IN_CLASSA_MAX = 128 +pkg syscall (openbsd-amd64-cgo), const IN_CLASSA_NET = 4278190080 +pkg syscall (openbsd-amd64-cgo), const IN_CLASSA_NSHIFT = 24 +pkg syscall (openbsd-amd64-cgo), const IN_CLASSB_HOST = 65535 +pkg syscall (openbsd-amd64-cgo), const IN_CLASSB_MAX = 65536 +pkg syscall (openbsd-amd64-cgo), const IN_CLASSB_NET = 4294901760 +pkg syscall (openbsd-amd64-cgo), const IN_CLASSB_NSHIFT = 16 +pkg syscall (openbsd-amd64-cgo), const IN_CLASSC_HOST = 255 +pkg syscall (openbsd-amd64-cgo), const IN_CLASSC_NET = 4294967040 +pkg syscall (openbsd-amd64-cgo), const IN_CLASSC_NSHIFT = 8 +pkg syscall (openbsd-amd64-cgo), const IN_CLASSD_HOST = 268435455 +pkg syscall (openbsd-amd64-cgo), const IN_CLASSD_NET = 4026531840 +pkg syscall (openbsd-amd64-cgo), const IN_CLASSD_NSHIFT = 28 +pkg syscall (openbsd-amd64-cgo), const IN_LOOPBACKNET = 127 +pkg syscall (openbsd-amd64-cgo), const IN_RFC3021_HOST = 1 +pkg syscall (openbsd-amd64-cgo), const IN_RFC3021_NET = 4294967294 +pkg syscall (openbsd-amd64-cgo), const IN_RFC3021_NSHIFT = 31 +pkg syscall (openbsd-amd64-cgo), const IPPROTO_AH = 51 +pkg syscall (openbsd-amd64-cgo), const IPPROTO_CARP = 112 +pkg syscall (openbsd-amd64-cgo), const IPPROTO_DIVERT = 258 +pkg syscall (openbsd-amd64-cgo), const IPPROTO_DONE = 257 +pkg syscall (openbsd-amd64-cgo), const IPPROTO_DSTOPTS = 60 +pkg syscall (openbsd-amd64-cgo), const IPPROTO_EGP = 8 +pkg syscall (openbsd-amd64-cgo), const IPPROTO_ENCAP = 98 +pkg syscall (openbsd-amd64-cgo), const IPPROTO_EON = 80 +pkg syscall (openbsd-amd64-cgo), const IPPROTO_ESP = 50 +pkg syscall (openbsd-amd64-cgo), const IPPROTO_ETHERIP = 97 +pkg syscall (openbsd-amd64-cgo), const IPPROTO_FRAGMENT = 44 +pkg syscall (openbsd-amd64-cgo), const IPPROTO_GGP = 3 +pkg syscall (openbsd-amd64-cgo), const IPPROTO_GRE = 47 +pkg syscall (openbsd-amd64-cgo), const IPPROTO_HOPOPTS = 0 +pkg syscall (openbsd-amd64-cgo), const IPPROTO_ICMP = 1 +pkg syscall (openbsd-amd64-cgo), const IPPROTO_ICMPV6 = 58 +pkg syscall (openbsd-amd64-cgo), const IPPROTO_IDP = 22 +pkg syscall (openbsd-amd64-cgo), const IPPROTO_IGMP = 2 +pkg syscall (openbsd-amd64-cgo), const IPPROTO_IPCOMP = 108 +pkg syscall (openbsd-amd64-cgo), const IPPROTO_IPIP = 4 +pkg syscall (openbsd-amd64-cgo), const IPPROTO_IPV4 = 4 +pkg syscall (openbsd-amd64-cgo), const IPPROTO_MAX = 256 +pkg syscall (openbsd-amd64-cgo), const IPPROTO_MAXID = 259 +pkg syscall (openbsd-amd64-cgo), const IPPROTO_MOBILE = 55 +pkg syscall (openbsd-amd64-cgo), const IPPROTO_MPLS = 137 +pkg syscall (openbsd-amd64-cgo), const IPPROTO_NONE = 59 +pkg syscall (openbsd-amd64-cgo), const IPPROTO_PFSYNC = 240 +pkg syscall (openbsd-amd64-cgo), const IPPROTO_PIM = 103 +pkg syscall (openbsd-amd64-cgo), const IPPROTO_PUP = 12 +pkg syscall (openbsd-amd64-cgo), const IPPROTO_RAW = 255 +pkg syscall (openbsd-amd64-cgo), const IPPROTO_ROUTING = 43 +pkg syscall (openbsd-amd64-cgo), const IPPROTO_RSVP = 46 +pkg syscall (openbsd-amd64-cgo), const IPPROTO_TP = 29 +pkg syscall (openbsd-amd64-cgo), const IPV6_AUTH_LEVEL = 53 +pkg syscall (openbsd-amd64-cgo), const IPV6_AUTOFLOWLABEL = 59 +pkg syscall (openbsd-amd64-cgo), const IPV6_CHECKSUM = 26 +pkg syscall (openbsd-amd64-cgo), const IPV6_DEFAULT_MULTICAST_HOPS = 1 +pkg syscall (openbsd-amd64-cgo), const IPV6_DEFAULT_MULTICAST_LOOP = 1 +pkg syscall (openbsd-amd64-cgo), const IPV6_DEFHLIM = 64 +pkg syscall (openbsd-amd64-cgo), const IPV6_DONTFRAG = 62 +pkg syscall (openbsd-amd64-cgo), const IPV6_DSTOPTS = 50 +pkg syscall (openbsd-amd64-cgo), const IPV6_ESP_NETWORK_LEVEL = 55 +pkg syscall (openbsd-amd64-cgo), const IPV6_ESP_TRANS_LEVEL = 54 +pkg syscall (openbsd-amd64-cgo), const IPV6_FAITH = 29 +pkg syscall (openbsd-amd64-cgo), const IPV6_FLOWINFO_MASK = 4294967055 +pkg syscall (openbsd-amd64-cgo), const IPV6_FLOWLABEL_MASK = 4294905600 +pkg syscall (openbsd-amd64-cgo), const IPV6_FRAGTTL = 120 +pkg syscall (openbsd-amd64-cgo), const IPV6_HLIMDEC = 1 +pkg syscall (openbsd-amd64-cgo), const IPV6_HOPLIMIT = 47 +pkg syscall (openbsd-amd64-cgo), const IPV6_HOPOPTS = 49 +pkg syscall (openbsd-amd64-cgo), const IPV6_IPCOMP_LEVEL = 60 +pkg syscall (openbsd-amd64-cgo), const IPV6_JOIN_GROUP = 12 +pkg syscall (openbsd-amd64-cgo), const IPV6_LEAVE_GROUP = 13 +pkg syscall (openbsd-amd64-cgo), const IPV6_MAXHLIM = 255 +pkg syscall (openbsd-amd64-cgo), const IPV6_MAXPACKET = 65535 +pkg syscall (openbsd-amd64-cgo), const IPV6_MMTU = 1280 +pkg syscall (openbsd-amd64-cgo), const IPV6_MULTICAST_HOPS = 10 +pkg syscall (openbsd-amd64-cgo), const IPV6_MULTICAST_IF = 9 +pkg syscall (openbsd-amd64-cgo), const IPV6_MULTICAST_LOOP = 11 +pkg syscall (openbsd-amd64-cgo), const IPV6_NEXTHOP = 48 +pkg syscall (openbsd-amd64-cgo), const IPV6_OPTIONS = 1 +pkg syscall (openbsd-amd64-cgo), const IPV6_PATHMTU = 44 +pkg syscall (openbsd-amd64-cgo), const IPV6_PIPEX = 63 +pkg syscall (openbsd-amd64-cgo), const IPV6_PKTINFO = 46 +pkg syscall (openbsd-amd64-cgo), const IPV6_PORTRANGE = 14 +pkg syscall (openbsd-amd64-cgo), const IPV6_PORTRANGE_DEFAULT = 0 +pkg syscall (openbsd-amd64-cgo), const IPV6_PORTRANGE_HIGH = 1 +pkg syscall (openbsd-amd64-cgo), const IPV6_PORTRANGE_LOW = 2 +pkg syscall (openbsd-amd64-cgo), const IPV6_RECVDSTOPTS = 40 +pkg syscall (openbsd-amd64-cgo), const IPV6_RECVHOPLIMIT = 37 +pkg syscall (openbsd-amd64-cgo), const IPV6_RECVHOPOPTS = 39 +pkg syscall (openbsd-amd64-cgo), const IPV6_RECVPATHMTU = 43 +pkg syscall (openbsd-amd64-cgo), const IPV6_RECVPKTINFO = 36 +pkg syscall (openbsd-amd64-cgo), const IPV6_RECVRTHDR = 38 +pkg syscall (openbsd-amd64-cgo), const IPV6_RECVTCLASS = 57 +pkg syscall (openbsd-amd64-cgo), const IPV6_RTABLE = 4129 +pkg syscall (openbsd-amd64-cgo), const IPV6_RTHDR = 51 +pkg syscall (openbsd-amd64-cgo), const IPV6_RTHDRDSTOPTS = 35 +pkg syscall (openbsd-amd64-cgo), const IPV6_RTHDR_LOOSE = 0 +pkg syscall (openbsd-amd64-cgo), const IPV6_RTHDR_STRICT = 1 +pkg syscall (openbsd-amd64-cgo), const IPV6_RTHDR_TYPE_0 = 0 +pkg syscall (openbsd-amd64-cgo), const IPV6_SOCKOPT_RESERVED1 = 3 +pkg syscall (openbsd-amd64-cgo), const IPV6_TCLASS = 61 +pkg syscall (openbsd-amd64-cgo), const IPV6_UNICAST_HOPS = 4 +pkg syscall (openbsd-amd64-cgo), const IPV6_USE_MIN_MTU = 42 +pkg syscall (openbsd-amd64-cgo), const IPV6_V6ONLY = 27 +pkg syscall (openbsd-amd64-cgo), const IPV6_VERSION = 96 +pkg syscall (openbsd-amd64-cgo), const IPV6_VERSION_MASK = 240 +pkg syscall (openbsd-amd64-cgo), const IP_ADD_MEMBERSHIP = 12 +pkg syscall (openbsd-amd64-cgo), const IP_AUTH_LEVEL = 20 +pkg syscall (openbsd-amd64-cgo), const IP_DEFAULT_MULTICAST_LOOP = 1 +pkg syscall (openbsd-amd64-cgo), const IP_DEFAULT_MULTICAST_TTL = 1 +pkg syscall (openbsd-amd64-cgo), const IP_DF = 16384 +pkg syscall (openbsd-amd64-cgo), const IP_DROP_MEMBERSHIP = 13 +pkg syscall (openbsd-amd64-cgo), const IP_ESP_NETWORK_LEVEL = 22 +pkg syscall (openbsd-amd64-cgo), const IP_ESP_TRANS_LEVEL = 21 +pkg syscall (openbsd-amd64-cgo), const IP_HDRINCL = 2 +pkg syscall (openbsd-amd64-cgo), const IP_IPCOMP_LEVEL = 29 +pkg syscall (openbsd-amd64-cgo), const IP_IPSECFLOWINFO = 36 +pkg syscall (openbsd-amd64-cgo), const IP_IPSEC_LOCAL_AUTH = 27 +pkg syscall (openbsd-amd64-cgo), const IP_IPSEC_LOCAL_CRED = 25 +pkg syscall (openbsd-amd64-cgo), const IP_IPSEC_LOCAL_ID = 23 +pkg syscall (openbsd-amd64-cgo), const IP_IPSEC_REMOTE_AUTH = 28 +pkg syscall (openbsd-amd64-cgo), const IP_IPSEC_REMOTE_CRED = 26 +pkg syscall (openbsd-amd64-cgo), const IP_IPSEC_REMOTE_ID = 24 +pkg syscall (openbsd-amd64-cgo), const IP_MAXPACKET = 65535 +pkg syscall (openbsd-amd64-cgo), const IP_MAX_MEMBERSHIPS = 4095 +pkg syscall (openbsd-amd64-cgo), const IP_MF = 8192 +pkg syscall (openbsd-amd64-cgo), const IP_MINTTL = 32 +pkg syscall (openbsd-amd64-cgo), const IP_MIN_MEMBERSHIPS = 15 +pkg syscall (openbsd-amd64-cgo), const IP_MSS = 576 +pkg syscall (openbsd-amd64-cgo), const IP_MULTICAST_IF = 9 +pkg syscall (openbsd-amd64-cgo), const IP_MULTICAST_LOOP = 11 +pkg syscall (openbsd-amd64-cgo), const IP_MULTICAST_TTL = 10 +pkg syscall (openbsd-amd64-cgo), const IP_OFFMASK = 8191 +pkg syscall (openbsd-amd64-cgo), const IP_OPTIONS = 1 +pkg syscall (openbsd-amd64-cgo), const IP_PIPEX = 34 +pkg syscall (openbsd-amd64-cgo), const IP_PORTRANGE = 19 +pkg syscall (openbsd-amd64-cgo), const IP_PORTRANGE_DEFAULT = 0 +pkg syscall (openbsd-amd64-cgo), const IP_PORTRANGE_HIGH = 1 +pkg syscall (openbsd-amd64-cgo), const IP_PORTRANGE_LOW = 2 +pkg syscall (openbsd-amd64-cgo), const IP_RECVDSTADDR = 7 +pkg syscall (openbsd-amd64-cgo), const IP_RECVDSTPORT = 33 +pkg syscall (openbsd-amd64-cgo), const IP_RECVIF = 30 +pkg syscall (openbsd-amd64-cgo), const IP_RECVOPTS = 5 +pkg syscall (openbsd-amd64-cgo), const IP_RECVRETOPTS = 6 +pkg syscall (openbsd-amd64-cgo), const IP_RECVRTABLE = 35 +pkg syscall (openbsd-amd64-cgo), const IP_RECVTTL = 31 +pkg syscall (openbsd-amd64-cgo), const IP_RETOPTS = 8 +pkg syscall (openbsd-amd64-cgo), const IP_RF = 32768 +pkg syscall (openbsd-amd64-cgo), const IP_RTABLE = 4129 +pkg syscall (openbsd-amd64-cgo), const IP_TOS = 3 +pkg syscall (openbsd-amd64-cgo), const IP_TTL = 4 +pkg syscall (openbsd-amd64-cgo), const ISIG = 128 +pkg syscall (openbsd-amd64-cgo), const ISTRIP = 32 +pkg syscall (openbsd-amd64-cgo), const IXANY = 2048 +pkg syscall (openbsd-amd64-cgo), const IXOFF = 1024 +pkg syscall (openbsd-amd64-cgo), const IXON = 512 +pkg syscall (openbsd-amd64-cgo), const ImplementsGetwd = false +pkg syscall (openbsd-amd64-cgo), const LCNT_OVERLOAD_FLUSH = 6 +pkg syscall (openbsd-amd64-cgo), const LOCK_EX = 2 +pkg syscall (openbsd-amd64-cgo), const LOCK_NB = 4 +pkg syscall (openbsd-amd64-cgo), const LOCK_SH = 1 +pkg syscall (openbsd-amd64-cgo), const LOCK_UN = 8 +pkg syscall (openbsd-amd64-cgo), const MSG_BCAST = 256 +pkg syscall (openbsd-amd64-cgo), const MSG_CTRUNC = 32 +pkg syscall (openbsd-amd64-cgo), const MSG_DONTROUTE = 4 +pkg syscall (openbsd-amd64-cgo), const MSG_DONTWAIT = 128 +pkg syscall (openbsd-amd64-cgo), const MSG_EOR = 8 +pkg syscall (openbsd-amd64-cgo), const MSG_MCAST = 512 +pkg syscall (openbsd-amd64-cgo), const MSG_NOSIGNAL = 1024 +pkg syscall (openbsd-amd64-cgo), const MSG_OOB = 1 +pkg syscall (openbsd-amd64-cgo), const MSG_PEEK = 2 +pkg syscall (openbsd-amd64-cgo), const MSG_TRUNC = 16 +pkg syscall (openbsd-amd64-cgo), const MSG_WAITALL = 64 +pkg syscall (openbsd-amd64-cgo), const NAME_MAX = 255 +pkg syscall (openbsd-amd64-cgo), const NET_RT_DUMP = 1 +pkg syscall (openbsd-amd64-cgo), const NET_RT_FLAGS = 2 +pkg syscall (openbsd-amd64-cgo), const NET_RT_IFLIST = 3 +pkg syscall (openbsd-amd64-cgo), const NET_RT_MAXID = 6 +pkg syscall (openbsd-amd64-cgo), const NET_RT_STATS = 4 +pkg syscall (openbsd-amd64-cgo), const NET_RT_TABLE = 5 +pkg syscall (openbsd-amd64-cgo), const NOFLSH = 2147483648 +pkg syscall (openbsd-amd64-cgo), const NOTE_ATTRIB = 8 +pkg syscall (openbsd-amd64-cgo), const NOTE_CHILD = 4 +pkg syscall (openbsd-amd64-cgo), const NOTE_DELETE = 1 +pkg syscall (openbsd-amd64-cgo), const NOTE_EOF = 2 +pkg syscall (openbsd-amd64-cgo), const NOTE_EXEC = 536870912 +pkg syscall (openbsd-amd64-cgo), const NOTE_EXIT = 2147483648 +pkg syscall (openbsd-amd64-cgo), const NOTE_EXTEND = 4 +pkg syscall (openbsd-amd64-cgo), const NOTE_FORK = 1073741824 +pkg syscall (openbsd-amd64-cgo), const NOTE_LINK = 16 +pkg syscall (openbsd-amd64-cgo), const NOTE_LOWAT = 1 +pkg syscall (openbsd-amd64-cgo), const NOTE_PCTRLMASK = 4026531840 +pkg syscall (openbsd-amd64-cgo), const NOTE_PDATAMASK = 1048575 +pkg syscall (openbsd-amd64-cgo), const NOTE_RENAME = 32 +pkg syscall (openbsd-amd64-cgo), const NOTE_REVOKE = 64 +pkg syscall (openbsd-amd64-cgo), const NOTE_TRACK = 1 +pkg syscall (openbsd-amd64-cgo), const NOTE_TRACKERR = 2 +pkg syscall (openbsd-amd64-cgo), const NOTE_TRUNCATE = 128 +pkg syscall (openbsd-amd64-cgo), const NOTE_WRITE = 2 +pkg syscall (openbsd-amd64-cgo), const OCRNL = 16 +pkg syscall (openbsd-amd64-cgo), const ONLCR = 2 +pkg syscall (openbsd-amd64-cgo), const ONLRET = 128 +pkg syscall (openbsd-amd64-cgo), const ONOCR = 64 +pkg syscall (openbsd-amd64-cgo), const ONOEOT = 8 +pkg syscall (openbsd-amd64-cgo), const OPOST = 1 +pkg syscall (openbsd-amd64-cgo), const O_ACCMODE = 3 +pkg syscall (openbsd-amd64-cgo), const O_APPEND = 8 +pkg syscall (openbsd-amd64-cgo), const O_ASYNC = 64 +pkg syscall (openbsd-amd64-cgo), const O_CLOEXEC = 65536 +pkg syscall (openbsd-amd64-cgo), const O_CREAT = 512 +pkg syscall (openbsd-amd64-cgo), const O_DIRECTORY = 131072 +pkg syscall (openbsd-amd64-cgo), const O_DSYNC = 128 +pkg syscall (openbsd-amd64-cgo), const O_EXCL = 2048 +pkg syscall (openbsd-amd64-cgo), const O_EXLOCK = 32 +pkg syscall (openbsd-amd64-cgo), const O_FSYNC = 128 +pkg syscall (openbsd-amd64-cgo), const O_NDELAY = 4 +pkg syscall (openbsd-amd64-cgo), const O_NOCTTY = 32768 +pkg syscall (openbsd-amd64-cgo), const O_NOFOLLOW = 256 +pkg syscall (openbsd-amd64-cgo), const O_NONBLOCK = 4 +pkg syscall (openbsd-amd64-cgo), const O_RSYNC = 128 +pkg syscall (openbsd-amd64-cgo), const O_SHLOCK = 16 +pkg syscall (openbsd-amd64-cgo), const O_SYNC = 128 +pkg syscall (openbsd-amd64-cgo), const O_TRUNC = 1024 +pkg syscall (openbsd-amd64-cgo), const PARENB = 4096 +pkg syscall (openbsd-amd64-cgo), const PARMRK = 8 +pkg syscall (openbsd-amd64-cgo), const PARODD = 8192 +pkg syscall (openbsd-amd64-cgo), const PENDIN = 536870912 +pkg syscall (openbsd-amd64-cgo), const PF_FLUSH = 1 +pkg syscall (openbsd-amd64-cgo), const PMC5_PIPELINE_FLUSH = 21 +pkg syscall (openbsd-amd64-cgo), const PTRACE_CONT = 7 +pkg syscall (openbsd-amd64-cgo), const PTRACE_KILL = 8 +pkg syscall (openbsd-amd64-cgo), const PTRACE_TRACEME = 0 +pkg syscall (openbsd-amd64-cgo), const RLIMIT_CORE = 4 +pkg syscall (openbsd-amd64-cgo), const RLIMIT_CPU = 0 +pkg syscall (openbsd-amd64-cgo), const RLIMIT_DATA = 2 +pkg syscall (openbsd-amd64-cgo), const RLIMIT_FSIZE = 1 +pkg syscall (openbsd-amd64-cgo), const RLIMIT_NOFILE = 8 +pkg syscall (openbsd-amd64-cgo), const RLIMIT_STACK = 3 +pkg syscall (openbsd-amd64-cgo), const RLIM_INFINITY = 9223372036854775807 +pkg syscall (openbsd-amd64-cgo), const RTAX_AUTHOR = 6 +pkg syscall (openbsd-amd64-cgo), const RTAX_BRD = 7 +pkg syscall (openbsd-amd64-cgo), const RTAX_DST = 0 +pkg syscall (openbsd-amd64-cgo), const RTAX_GATEWAY = 1 +pkg syscall (openbsd-amd64-cgo), const RTAX_GENMASK = 3 +pkg syscall (openbsd-amd64-cgo), const RTAX_IFA = 5 +pkg syscall (openbsd-amd64-cgo), const RTAX_IFP = 4 +pkg syscall (openbsd-amd64-cgo), const RTAX_LABEL = 10 +pkg syscall (openbsd-amd64-cgo), const RTAX_MAX = 11 +pkg syscall (openbsd-amd64-cgo), const RTAX_NETMASK = 2 +pkg syscall (openbsd-amd64-cgo), const RTAX_SRC = 8 +pkg syscall (openbsd-amd64-cgo), const RTAX_SRCMASK = 9 +pkg syscall (openbsd-amd64-cgo), const RTA_AUTHOR = 64 +pkg syscall (openbsd-amd64-cgo), const RTA_BRD = 128 +pkg syscall (openbsd-amd64-cgo), const RTA_DST = 1 +pkg syscall (openbsd-amd64-cgo), const RTA_GATEWAY = 2 +pkg syscall (openbsd-amd64-cgo), const RTA_GENMASK = 8 +pkg syscall (openbsd-amd64-cgo), const RTA_IFA = 32 +pkg syscall (openbsd-amd64-cgo), const RTA_IFP = 16 +pkg syscall (openbsd-amd64-cgo), const RTA_LABEL = 1024 +pkg syscall (openbsd-amd64-cgo), const RTA_NETMASK = 4 +pkg syscall (openbsd-amd64-cgo), const RTA_SRC = 256 +pkg syscall (openbsd-amd64-cgo), const RTA_SRCMASK = 512 +pkg syscall (openbsd-amd64-cgo), const RTF_ANNOUNCE = 16384 +pkg syscall (openbsd-amd64-cgo), const RTF_BLACKHOLE = 4096 +pkg syscall (openbsd-amd64-cgo), const RTF_CLONED = 65536 +pkg syscall (openbsd-amd64-cgo), const RTF_CLONING = 256 +pkg syscall (openbsd-amd64-cgo), const RTF_DONE = 64 +pkg syscall (openbsd-amd64-cgo), const RTF_DYNAMIC = 16 +pkg syscall (openbsd-amd64-cgo), const RTF_FMASK = 63496 +pkg syscall (openbsd-amd64-cgo), const RTF_GATEWAY = 2 +pkg syscall (openbsd-amd64-cgo), const RTF_HOST = 4 +pkg syscall (openbsd-amd64-cgo), const RTF_LLINFO = 1024 +pkg syscall (openbsd-amd64-cgo), const RTF_MASK = 128 +pkg syscall (openbsd-amd64-cgo), const RTF_MODIFIED = 32 +pkg syscall (openbsd-amd64-cgo), const RTF_MPATH = 262144 +pkg syscall (openbsd-amd64-cgo), const RTF_MPLS = 1048576 +pkg syscall (openbsd-amd64-cgo), const RTF_PERMANENT_ARP = 8192 +pkg syscall (openbsd-amd64-cgo), const RTF_PROTO1 = 32768 +pkg syscall (openbsd-amd64-cgo), const RTF_PROTO2 = 16384 +pkg syscall (openbsd-amd64-cgo), const RTF_PROTO3 = 8192 +pkg syscall (openbsd-amd64-cgo), const RTF_REJECT = 8 +pkg syscall (openbsd-amd64-cgo), const RTF_SOURCE = 131072 +pkg syscall (openbsd-amd64-cgo), const RTF_STATIC = 2048 +pkg syscall (openbsd-amd64-cgo), const RTF_TUNNEL = 1048576 +pkg syscall (openbsd-amd64-cgo), const RTF_UP = 1 +pkg syscall (openbsd-amd64-cgo), const RTF_USETRAILERS = 32768 +pkg syscall (openbsd-amd64-cgo), const RTF_XRESOLVE = 512 +pkg syscall (openbsd-amd64-cgo), const RTM_ADD = 1 +pkg syscall (openbsd-amd64-cgo), const RTM_CHANGE = 3 +pkg syscall (openbsd-amd64-cgo), const RTM_DELADDR = 13 +pkg syscall (openbsd-amd64-cgo), const RTM_DELETE = 2 +pkg syscall (openbsd-amd64-cgo), const RTM_DESYNC = 16 +pkg syscall (openbsd-amd64-cgo), const RTM_GET = 4 +pkg syscall (openbsd-amd64-cgo), const RTM_IFANNOUNCE = 15 +pkg syscall (openbsd-amd64-cgo), const RTM_IFINFO = 14 +pkg syscall (openbsd-amd64-cgo), const RTM_LOCK = 8 +pkg syscall (openbsd-amd64-cgo), const RTM_LOSING = 5 +pkg syscall (openbsd-amd64-cgo), const RTM_MAXSIZE = 2048 +pkg syscall (openbsd-amd64-cgo), const RTM_MISS = 7 +pkg syscall (openbsd-amd64-cgo), const RTM_NEWADDR = 12 +pkg syscall (openbsd-amd64-cgo), const RTM_REDIRECT = 6 +pkg syscall (openbsd-amd64-cgo), const RTM_RESOLVE = 11 +pkg syscall (openbsd-amd64-cgo), const RTM_RTTUNIT = 1000000 +pkg syscall (openbsd-amd64-cgo), const RTM_VERSION = 4 +pkg syscall (openbsd-amd64-cgo), const RTV_EXPIRE = 4 +pkg syscall (openbsd-amd64-cgo), const RTV_HOPCOUNT = 2 +pkg syscall (openbsd-amd64-cgo), const RTV_MTU = 1 +pkg syscall (openbsd-amd64-cgo), const RTV_RPIPE = 8 +pkg syscall (openbsd-amd64-cgo), const RTV_RTT = 64 +pkg syscall (openbsd-amd64-cgo), const RTV_RTTVAR = 128 +pkg syscall (openbsd-amd64-cgo), const RTV_SPIPE = 16 +pkg syscall (openbsd-amd64-cgo), const RTV_SSTHRESH = 32 +pkg syscall (openbsd-amd64-cgo), const RT_TABLEID_MAX = 255 +pkg syscall (openbsd-amd64-cgo), const RUSAGE_CHILDREN = -1 +pkg syscall (openbsd-amd64-cgo), const RUSAGE_SELF = 0 +pkg syscall (openbsd-amd64-cgo), const RUSAGE_THREAD = 1 +pkg syscall (openbsd-amd64-cgo), const SCM_RIGHTS = 1 +pkg syscall (openbsd-amd64-cgo), const SCM_TIMESTAMP = 4 +pkg syscall (openbsd-amd64-cgo), const SIGBUS = 10 +pkg syscall (openbsd-amd64-cgo), const SIGCHLD = 20 +pkg syscall (openbsd-amd64-cgo), const SIGCONT = 19 +pkg syscall (openbsd-amd64-cgo), const SIGEMT = 7 +pkg syscall (openbsd-amd64-cgo), const SIGINFO = 29 +pkg syscall (openbsd-amd64-cgo), const SIGIO = 23 +pkg syscall (openbsd-amd64-cgo), const SIGIOT = 6 +pkg syscall (openbsd-amd64-cgo), const SIGPROF = 27 +pkg syscall (openbsd-amd64-cgo), const SIGSTOP = 17 +pkg syscall (openbsd-amd64-cgo), const SIGSYS = 12 +pkg syscall (openbsd-amd64-cgo), const SIGTHR = 32 +pkg syscall (openbsd-amd64-cgo), const SIGTSTP = 18 +pkg syscall (openbsd-amd64-cgo), const SIGTTIN = 21 +pkg syscall (openbsd-amd64-cgo), const SIGTTOU = 22 +pkg syscall (openbsd-amd64-cgo), const SIGURG = 16 +pkg syscall (openbsd-amd64-cgo), const SIGUSR1 = 30 +pkg syscall (openbsd-amd64-cgo), const SIGUSR2 = 31 +pkg syscall (openbsd-amd64-cgo), const SIGVTALRM = 26 +pkg syscall (openbsd-amd64-cgo), const SIGWINCH = 28 +pkg syscall (openbsd-amd64-cgo), const SIGXCPU = 24 +pkg syscall (openbsd-amd64-cgo), const SIGXFSZ = 25 +pkg syscall (openbsd-amd64-cgo), const SIOCADDMULTI = 2149607729 +pkg syscall (openbsd-amd64-cgo), const SIOCAIFADDR = 2151704858 +pkg syscall (openbsd-amd64-cgo), const SIOCAIFGROUP = 2150132103 +pkg syscall (openbsd-amd64-cgo), const SIOCALIFADDR = 2182637852 +pkg syscall (openbsd-amd64-cgo), const SIOCATMARK = 1074033415 +pkg syscall (openbsd-amd64-cgo), const SIOCBRDGADD = 2153277756 +pkg syscall (openbsd-amd64-cgo), const SIOCBRDGADDS = 2153277761 +pkg syscall (openbsd-amd64-cgo), const SIOCBRDGARL = 2154719565 +pkg syscall (openbsd-amd64-cgo), const SIOCBRDGDADDR = 2150132039 +pkg syscall (openbsd-amd64-cgo), const SIOCBRDGDEL = 2153277757 +pkg syscall (openbsd-amd64-cgo), const SIOCBRDGDELS = 2153277762 +pkg syscall (openbsd-amd64-cgo), const SIOCBRDGFLUSH = 2153277768 +pkg syscall (openbsd-amd64-cgo), const SIOCBRDGFRL = 2154719566 +pkg syscall (openbsd-amd64-cgo), const SIOCBRDGGCACHE = 3222563137 +pkg syscall (openbsd-amd64-cgo), const SIOCBRDGGFD = 3222563154 +pkg syscall (openbsd-amd64-cgo), const SIOCBRDGGHT = 3222563153 +pkg syscall (openbsd-amd64-cgo), const SIOCBRDGGIFFLGS = 3227019582 +pkg syscall (openbsd-amd64-cgo), const SIOCBRDGGMA = 3222563155 +pkg syscall (openbsd-amd64-cgo), const SIOCBRDGGPARAM = 3225446744 +pkg syscall (openbsd-amd64-cgo), const SIOCBRDGGPRI = 3222563152 +pkg syscall (openbsd-amd64-cgo), const SIOCBRDGGRL = 3224398159 +pkg syscall (openbsd-amd64-cgo), const SIOCBRDGGSIFS = 3227019580 +pkg syscall (openbsd-amd64-cgo), const SIOCBRDGGTO = 3222563142 +pkg syscall (openbsd-amd64-cgo), const SIOCBRDGIFS = 3227019586 +pkg syscall (openbsd-amd64-cgo), const SIOCBRDGRTS = 3223349571 +pkg syscall (openbsd-amd64-cgo), const SIOCBRDGSADDR = 3223873860 +pkg syscall (openbsd-amd64-cgo), const SIOCBRDGSCACHE = 2148821312 +pkg syscall (openbsd-amd64-cgo), const SIOCBRDGSFD = 2148821330 +pkg syscall (openbsd-amd64-cgo), const SIOCBRDGSHT = 2148821329 +pkg syscall (openbsd-amd64-cgo), const SIOCBRDGSIFCOST = 2153277781 +pkg syscall (openbsd-amd64-cgo), const SIOCBRDGSIFFLGS = 2153277759 +pkg syscall (openbsd-amd64-cgo), const SIOCBRDGSIFPRIO = 2153277780 +pkg syscall (openbsd-amd64-cgo), const SIOCBRDGSMA = 2148821331 +pkg syscall (openbsd-amd64-cgo), const SIOCBRDGSPRI = 2148821328 +pkg syscall (openbsd-amd64-cgo), const SIOCBRDGSPROTO = 2148821338 +pkg syscall (openbsd-amd64-cgo), const SIOCBRDGSTO = 2148821317 +pkg syscall (openbsd-amd64-cgo), const SIOCBRDGSTXHC = 2148821337 +pkg syscall (openbsd-amd64-cgo), const SIOCDELMULTI = 2149607730 +pkg syscall (openbsd-amd64-cgo), const SIOCDIFADDR = 2149607705 +pkg syscall (openbsd-amd64-cgo), const SIOCDIFGROUP = 2150132105 +pkg syscall (openbsd-amd64-cgo), const SIOCDIFPHYADDR = 2149607753 +pkg syscall (openbsd-amd64-cgo), const SIOCDLIFADDR = 2182637854 +pkg syscall (openbsd-amd64-cgo), const SIOCGETKALIVE = 3222825380 +pkg syscall (openbsd-amd64-cgo), const SIOCGETLABEL = 2149607834 +pkg syscall (openbsd-amd64-cgo), const SIOCGETPFLOW = 3223349758 +pkg syscall (openbsd-amd64-cgo), const SIOCGETPFSYNC = 3223349752 +pkg syscall (openbsd-amd64-cgo), const SIOCGETSGCNT = 3223352628 +pkg syscall (openbsd-amd64-cgo), const SIOCGETVIFCNT = 3223876915 +pkg syscall (openbsd-amd64-cgo), const SIOCGHIWAT = 1074033409 +pkg syscall (openbsd-amd64-cgo), const SIOCGIFADDR = 3223349537 +pkg syscall (openbsd-amd64-cgo), const SIOCGIFASYNCMAP = 3223349628 +pkg syscall (openbsd-amd64-cgo), const SIOCGIFBRDADDR = 3223349539 +pkg syscall (openbsd-amd64-cgo), const SIOCGIFCONF = 3222300964 +pkg syscall (openbsd-amd64-cgo), const SIOCGIFDATA = 3223349531 +pkg syscall (openbsd-amd64-cgo), const SIOCGIFDESCR = 3223349633 +pkg syscall (openbsd-amd64-cgo), const SIOCGIFDSTADDR = 3223349538 +pkg syscall (openbsd-amd64-cgo), const SIOCGIFFLAGS = 3223349521 +pkg syscall (openbsd-amd64-cgo), const SIOCGIFGATTR = 3223873931 +pkg syscall (openbsd-amd64-cgo), const SIOCGIFGENERIC = 3223349562 +pkg syscall (openbsd-amd64-cgo), const SIOCGIFGMEMB = 3223873930 +pkg syscall (openbsd-amd64-cgo), const SIOCGIFGROUP = 3223873928 +pkg syscall (openbsd-amd64-cgo), const SIOCGIFMEDIA = 3224398134 +pkg syscall (openbsd-amd64-cgo), const SIOCGIFMETRIC = 3223349527 +pkg syscall (openbsd-amd64-cgo), const SIOCGIFMTU = 3223349630 +pkg syscall (openbsd-amd64-cgo), const SIOCGIFNETMASK = 3223349541 +pkg syscall (openbsd-amd64-cgo), const SIOCGIFPDSTADDR = 3223349576 +pkg syscall (openbsd-amd64-cgo), const SIOCGIFPRIORITY = 3223349660 +pkg syscall (openbsd-amd64-cgo), const SIOCGIFPSRCADDR = 3223349575 +pkg syscall (openbsd-amd64-cgo), const SIOCGIFRDOMAIN = 3223349664 +pkg syscall (openbsd-amd64-cgo), const SIOCGIFRTLABEL = 3223349635 +pkg syscall (openbsd-amd64-cgo), const SIOCGIFTIMESLOT = 3223349638 +pkg syscall (openbsd-amd64-cgo), const SIOCGIFXFLAGS = 3223349662 +pkg syscall (openbsd-amd64-cgo), const SIOCGLIFADDR = 3256379677 +pkg syscall (openbsd-amd64-cgo), const SIOCGLIFPHYADDR = 3256379723 +pkg syscall (openbsd-amd64-cgo), const SIOCGLIFPHYRTABLE = 3223349666 +pkg syscall (openbsd-amd64-cgo), const SIOCGLOWAT = 1074033411 +pkg syscall (openbsd-amd64-cgo), const SIOCGPGRP = 1074033417 +pkg syscall (openbsd-amd64-cgo), const SIOCGVH = 3223349750 +pkg syscall (openbsd-amd64-cgo), const SIOCIFCREATE = 2149607802 +pkg syscall (openbsd-amd64-cgo), const SIOCIFDESTROY = 2149607801 +pkg syscall (openbsd-amd64-cgo), const SIOCIFGCLONERS = 3222301048 +pkg syscall (openbsd-amd64-cgo), const SIOCSETKALIVE = 2149083555 +pkg syscall (openbsd-amd64-cgo), const SIOCSETLABEL = 2149607833 +pkg syscall (openbsd-amd64-cgo), const SIOCSETPFLOW = 2149607933 +pkg syscall (openbsd-amd64-cgo), const SIOCSETPFSYNC = 2149607927 +pkg syscall (openbsd-amd64-cgo), const SIOCSHIWAT = 2147775232 +pkg syscall (openbsd-amd64-cgo), const SIOCSIFADDR = 2149607692 +pkg syscall (openbsd-amd64-cgo), const SIOCSIFASYNCMAP = 2149607805 +pkg syscall (openbsd-amd64-cgo), const SIOCSIFBRDADDR = 2149607699 +pkg syscall (openbsd-amd64-cgo), const SIOCSIFDESCR = 2149607808 +pkg syscall (openbsd-amd64-cgo), const SIOCSIFDSTADDR = 2149607694 +pkg syscall (openbsd-amd64-cgo), const SIOCSIFFLAGS = 2149607696 +pkg syscall (openbsd-amd64-cgo), const SIOCSIFGATTR = 2150132108 +pkg syscall (openbsd-amd64-cgo), const SIOCSIFGENERIC = 2149607737 +pkg syscall (openbsd-amd64-cgo), const SIOCSIFLLADDR = 2149607711 +pkg syscall (openbsd-amd64-cgo), const SIOCSIFMEDIA = 3223349557 +pkg syscall (openbsd-amd64-cgo), const SIOCSIFMETRIC = 2149607704 +pkg syscall (openbsd-amd64-cgo), const SIOCSIFMTU = 2149607807 +pkg syscall (openbsd-amd64-cgo), const SIOCSIFNETMASK = 2149607702 +pkg syscall (openbsd-amd64-cgo), const SIOCSIFPHYADDR = 2151704902 +pkg syscall (openbsd-amd64-cgo), const SIOCSIFPRIORITY = 2149607835 +pkg syscall (openbsd-amd64-cgo), const SIOCSIFRDOMAIN = 2149607839 +pkg syscall (openbsd-amd64-cgo), const SIOCSIFRTLABEL = 2149607810 +pkg syscall (openbsd-amd64-cgo), const SIOCSIFTIMESLOT = 2149607813 +pkg syscall (openbsd-amd64-cgo), const SIOCSIFXFLAGS = 2149607837 +pkg syscall (openbsd-amd64-cgo), const SIOCSLIFPHYADDR = 2182637898 +pkg syscall (openbsd-amd64-cgo), const SIOCSLIFPHYRTABLE = 2149607841 +pkg syscall (openbsd-amd64-cgo), const SIOCSLOWAT = 2147775234 +pkg syscall (openbsd-amd64-cgo), const SIOCSPGRP = 2147775240 +pkg syscall (openbsd-amd64-cgo), const SIOCSVH = 3223349749 +pkg syscall (openbsd-amd64-cgo), const SOCK_RDM = 4 +pkg syscall (openbsd-amd64-cgo), const SOL_SOCKET = 65535 +pkg syscall (openbsd-amd64-cgo), const SOMAXCONN = 128 +pkg syscall (openbsd-amd64-cgo), const SO_ACCEPTCONN = 2 +pkg syscall (openbsd-amd64-cgo), const SO_BINDANY = 4096 +pkg syscall (openbsd-amd64-cgo), const SO_BROADCAST = 32 +pkg syscall (openbsd-amd64-cgo), const SO_DEBUG = 1 +pkg syscall (openbsd-amd64-cgo), const SO_DONTROUTE = 16 +pkg syscall (openbsd-amd64-cgo), const SO_ERROR = 4103 +pkg syscall (openbsd-amd64-cgo), const SO_KEEPALIVE = 8 +pkg syscall (openbsd-amd64-cgo), const SO_LINGER = 128 +pkg syscall (openbsd-amd64-cgo), const SO_NETPROC = 4128 +pkg syscall (openbsd-amd64-cgo), const SO_OOBINLINE = 256 +pkg syscall (openbsd-amd64-cgo), const SO_PEERCRED = 4130 +pkg syscall (openbsd-amd64-cgo), const SO_RCVBUF = 4098 +pkg syscall (openbsd-amd64-cgo), const SO_RCVLOWAT = 4100 +pkg syscall (openbsd-amd64-cgo), const SO_RCVTIMEO = 4102 +pkg syscall (openbsd-amd64-cgo), const SO_REUSEADDR = 4 +pkg syscall (openbsd-amd64-cgo), const SO_REUSEPORT = 512 +pkg syscall (openbsd-amd64-cgo), const SO_RTABLE = 4129 +pkg syscall (openbsd-amd64-cgo), const SO_SNDBUF = 4097 +pkg syscall (openbsd-amd64-cgo), const SO_SNDLOWAT = 4099 +pkg syscall (openbsd-amd64-cgo), const SO_SNDTIMEO = 4101 +pkg syscall (openbsd-amd64-cgo), const SO_SPLICE = 4131 +pkg syscall (openbsd-amd64-cgo), const SO_TIMESTAMP = 2048 +pkg syscall (openbsd-amd64-cgo), const SO_TYPE = 4104 +pkg syscall (openbsd-amd64-cgo), const SO_USELOOPBACK = 64 +pkg syscall (openbsd-amd64-cgo), const SYS_ACCEPT = 30 +pkg syscall (openbsd-amd64-cgo), const SYS_ACCESS = 33 +pkg syscall (openbsd-amd64-cgo), const SYS_ACCT = 51 +pkg syscall (openbsd-amd64-cgo), const SYS_ADJFREQ = 305 +pkg syscall (openbsd-amd64-cgo), const SYS_ADJTIME = 140 +pkg syscall (openbsd-amd64-cgo), const SYS_BIND = 104 +pkg syscall (openbsd-amd64-cgo), const SYS_CHDIR = 12 +pkg syscall (openbsd-amd64-cgo), const SYS_CHFLAGS = 34 +pkg syscall (openbsd-amd64-cgo), const SYS_CHMOD = 15 +pkg syscall (openbsd-amd64-cgo), const SYS_CHOWN = 16 +pkg syscall (openbsd-amd64-cgo), const SYS_CHROOT = 61 +pkg syscall (openbsd-amd64-cgo), const SYS_CLOCK_GETRES = 234 +pkg syscall (openbsd-amd64-cgo), const SYS_CLOCK_GETTIME = 232 +pkg syscall (openbsd-amd64-cgo), const SYS_CLOCK_SETTIME = 233 +pkg syscall (openbsd-amd64-cgo), const SYS_CLOSE = 6 +pkg syscall (openbsd-amd64-cgo), const SYS_CLOSEFROM = 287 +pkg syscall (openbsd-amd64-cgo), const SYS_CONNECT = 98 +pkg syscall (openbsd-amd64-cgo), const SYS_DUP = 41 +pkg syscall (openbsd-amd64-cgo), const SYS_DUP2 = 90 +pkg syscall (openbsd-amd64-cgo), const SYS_EXECVE = 59 +pkg syscall (openbsd-amd64-cgo), const SYS_EXIT = 1 +pkg syscall (openbsd-amd64-cgo), const SYS_FACCESSAT = 313 +pkg syscall (openbsd-amd64-cgo), const SYS_FCHDIR = 13 +pkg syscall (openbsd-amd64-cgo), const SYS_FCHFLAGS = 35 +pkg syscall (openbsd-amd64-cgo), const SYS_FCHMOD = 124 +pkg syscall (openbsd-amd64-cgo), const SYS_FCHMODAT = 314 +pkg syscall (openbsd-amd64-cgo), const SYS_FCHOWN = 123 +pkg syscall (openbsd-amd64-cgo), const SYS_FCHOWNAT = 315 +pkg syscall (openbsd-amd64-cgo), const SYS_FCNTL = 92 +pkg syscall (openbsd-amd64-cgo), const SYS_FHOPEN = 264 +pkg syscall (openbsd-amd64-cgo), const SYS_FHSTAT = 294 +pkg syscall (openbsd-amd64-cgo), const SYS_FHSTATFS = 309 +pkg syscall (openbsd-amd64-cgo), const SYS_FLOCK = 131 +pkg syscall (openbsd-amd64-cgo), const SYS_FORK = 2 +pkg syscall (openbsd-amd64-cgo), const SYS_FPATHCONF = 192 +pkg syscall (openbsd-amd64-cgo), const SYS_FSTAT = 292 +pkg syscall (openbsd-amd64-cgo), const SYS_FSTATAT = 316 +pkg syscall (openbsd-amd64-cgo), const SYS_FSTATFS = 308 +pkg syscall (openbsd-amd64-cgo), const SYS_FSYNC = 95 +pkg syscall (openbsd-amd64-cgo), const SYS_FTRUNCATE = 201 +pkg syscall (openbsd-amd64-cgo), const SYS_FUTIMENS = 327 +pkg syscall (openbsd-amd64-cgo), const SYS_FUTIMES = 206 +pkg syscall (openbsd-amd64-cgo), const SYS_GETDIRENTRIES = 312 +pkg syscall (openbsd-amd64-cgo), const SYS_GETDTABLECOUNT = 18 +pkg syscall (openbsd-amd64-cgo), const SYS_GETEGID = 43 +pkg syscall (openbsd-amd64-cgo), const SYS_GETEUID = 25 +pkg syscall (openbsd-amd64-cgo), const SYS_GETFH = 161 +pkg syscall (openbsd-amd64-cgo), const SYS_GETFSSTAT = 306 +pkg syscall (openbsd-amd64-cgo), const SYS_GETGID = 47 +pkg syscall (openbsd-amd64-cgo), const SYS_GETGROUPS = 79 +pkg syscall (openbsd-amd64-cgo), const SYS_GETITIMER = 86 +pkg syscall (openbsd-amd64-cgo), const SYS_GETLOGIN = 49 +pkg syscall (openbsd-amd64-cgo), const SYS_GETPEERNAME = 31 +pkg syscall (openbsd-amd64-cgo), const SYS_GETPGID = 207 +pkg syscall (openbsd-amd64-cgo), const SYS_GETPGRP = 81 +pkg syscall (openbsd-amd64-cgo), const SYS_GETPID = 20 +pkg syscall (openbsd-amd64-cgo), const SYS_GETPPID = 39 +pkg syscall (openbsd-amd64-cgo), const SYS_GETPRIORITY = 100 +pkg syscall (openbsd-amd64-cgo), const SYS_GETRESGID = 283 +pkg syscall (openbsd-amd64-cgo), const SYS_GETRESUID = 281 +pkg syscall (openbsd-amd64-cgo), const SYS_GETRLIMIT = 194 +pkg syscall (openbsd-amd64-cgo), const SYS_GETRTABLE = 311 +pkg syscall (openbsd-amd64-cgo), const SYS_GETRUSAGE = 117 +pkg syscall (openbsd-amd64-cgo), const SYS_GETSID = 255 +pkg syscall (openbsd-amd64-cgo), const SYS_GETSOCKNAME = 32 +pkg syscall (openbsd-amd64-cgo), const SYS_GETSOCKOPT = 118 +pkg syscall (openbsd-amd64-cgo), const SYS_GETTHRID = 299 +pkg syscall (openbsd-amd64-cgo), const SYS_GETTIMEOFDAY = 116 +pkg syscall (openbsd-amd64-cgo), const SYS_GETUID = 24 +pkg syscall (openbsd-amd64-cgo), const SYS_IOCTL = 54 +pkg syscall (openbsd-amd64-cgo), const SYS_ISSETUGID = 253 +pkg syscall (openbsd-amd64-cgo), const SYS_KEVENT = 270 +pkg syscall (openbsd-amd64-cgo), const SYS_KILL = 37 +pkg syscall (openbsd-amd64-cgo), const SYS_KQUEUE = 269 +pkg syscall (openbsd-amd64-cgo), const SYS_KTRACE = 45 +pkg syscall (openbsd-amd64-cgo), const SYS_LCHOWN = 254 +pkg syscall (openbsd-amd64-cgo), const SYS_LINK = 9 +pkg syscall (openbsd-amd64-cgo), const SYS_LINKAT = 317 +pkg syscall (openbsd-amd64-cgo), const SYS_LISTEN = 106 +pkg syscall (openbsd-amd64-cgo), const SYS_LSEEK = 199 +pkg syscall (openbsd-amd64-cgo), const SYS_LSTAT = 293 +pkg syscall (openbsd-amd64-cgo), const SYS_MADVISE = 75 +pkg syscall (openbsd-amd64-cgo), const SYS_MINCORE = 78 +pkg syscall (openbsd-amd64-cgo), const SYS_MINHERIT = 250 +pkg syscall (openbsd-amd64-cgo), const SYS_MKDIR = 136 +pkg syscall (openbsd-amd64-cgo), const SYS_MKDIRAT = 318 +pkg syscall (openbsd-amd64-cgo), const SYS_MKFIFO = 132 +pkg syscall (openbsd-amd64-cgo), const SYS_MKFIFOAT = 319 +pkg syscall (openbsd-amd64-cgo), const SYS_MKNOD = 14 +pkg syscall (openbsd-amd64-cgo), const SYS_MKNODAT = 320 +pkg syscall (openbsd-amd64-cgo), const SYS_MLOCK = 203 +pkg syscall (openbsd-amd64-cgo), const SYS_MLOCKALL = 271 +pkg syscall (openbsd-amd64-cgo), const SYS_MMAP = 197 +pkg syscall (openbsd-amd64-cgo), const SYS_MOUNT = 21 +pkg syscall (openbsd-amd64-cgo), const SYS_MPROTECT = 74 +pkg syscall (openbsd-amd64-cgo), const SYS_MQUERY = 286 +pkg syscall (openbsd-amd64-cgo), const SYS_MSGCTL = 297 +pkg syscall (openbsd-amd64-cgo), const SYS_MSGGET = 225 +pkg syscall (openbsd-amd64-cgo), const SYS_MSGRCV = 227 +pkg syscall (openbsd-amd64-cgo), const SYS_MSGSND = 226 +pkg syscall (openbsd-amd64-cgo), const SYS_MSYNC = 256 +pkg syscall (openbsd-amd64-cgo), const SYS_MUNLOCK = 204 +pkg syscall (openbsd-amd64-cgo), const SYS_MUNLOCKALL = 272 +pkg syscall (openbsd-amd64-cgo), const SYS_MUNMAP = 73 +pkg syscall (openbsd-amd64-cgo), const SYS_NANOSLEEP = 240 +pkg syscall (openbsd-amd64-cgo), const SYS_NFSSVC = 155 +pkg syscall (openbsd-amd64-cgo), const SYS_OBREAK = 17 +pkg syscall (openbsd-amd64-cgo), const SYS_OPEN = 5 +pkg syscall (openbsd-amd64-cgo), const SYS_OPENAT = 321 +pkg syscall (openbsd-amd64-cgo), const SYS_PATHCONF = 191 +pkg syscall (openbsd-amd64-cgo), const SYS_PIPE = 263 +pkg syscall (openbsd-amd64-cgo), const SYS_POLL = 252 +pkg syscall (openbsd-amd64-cgo), const SYS_PREAD = 173 +pkg syscall (openbsd-amd64-cgo), const SYS_PREADV = 267 +pkg syscall (openbsd-amd64-cgo), const SYS_PROFIL = 44 +pkg syscall (openbsd-amd64-cgo), const SYS_PTRACE = 26 +pkg syscall (openbsd-amd64-cgo), const SYS_PWRITE = 174 +pkg syscall (openbsd-amd64-cgo), const SYS_PWRITEV = 268 +pkg syscall (openbsd-amd64-cgo), const SYS_QUOTACTL = 148 +pkg syscall (openbsd-amd64-cgo), const SYS_READ = 3 +pkg syscall (openbsd-amd64-cgo), const SYS_READLINK = 58 +pkg syscall (openbsd-amd64-cgo), const SYS_READLINKAT = 322 +pkg syscall (openbsd-amd64-cgo), const SYS_READV = 120 +pkg syscall (openbsd-amd64-cgo), const SYS_REBOOT = 55 +pkg syscall (openbsd-amd64-cgo), const SYS_RECVFROM = 29 +pkg syscall (openbsd-amd64-cgo), const SYS_RECVMSG = 27 +pkg syscall (openbsd-amd64-cgo), const SYS_RENAME = 128 +pkg syscall (openbsd-amd64-cgo), const SYS_RENAMEAT = 323 +pkg syscall (openbsd-amd64-cgo), const SYS_REVOKE = 56 +pkg syscall (openbsd-amd64-cgo), const SYS_RMDIR = 137 +pkg syscall (openbsd-amd64-cgo), const SYS_SCHED_YIELD = 298 +pkg syscall (openbsd-amd64-cgo), const SYS_SELECT = 93 +pkg syscall (openbsd-amd64-cgo), const SYS_SEMGET = 221 +pkg syscall (openbsd-amd64-cgo), const SYS_SEMOP = 290 +pkg syscall (openbsd-amd64-cgo), const SYS_SENDMSG = 28 +pkg syscall (openbsd-amd64-cgo), const SYS_SENDTO = 133 +pkg syscall (openbsd-amd64-cgo), const SYS_SETEGID = 182 +pkg syscall (openbsd-amd64-cgo), const SYS_SETEUID = 183 +pkg syscall (openbsd-amd64-cgo), const SYS_SETGID = 181 +pkg syscall (openbsd-amd64-cgo), const SYS_SETGROUPS = 80 +pkg syscall (openbsd-amd64-cgo), const SYS_SETITIMER = 83 +pkg syscall (openbsd-amd64-cgo), const SYS_SETLOGIN = 50 +pkg syscall (openbsd-amd64-cgo), const SYS_SETPGID = 82 +pkg syscall (openbsd-amd64-cgo), const SYS_SETPRIORITY = 96 +pkg syscall (openbsd-amd64-cgo), const SYS_SETREGID = 127 +pkg syscall (openbsd-amd64-cgo), const SYS_SETRESGID = 284 +pkg syscall (openbsd-amd64-cgo), const SYS_SETRESUID = 282 +pkg syscall (openbsd-amd64-cgo), const SYS_SETREUID = 126 +pkg syscall (openbsd-amd64-cgo), const SYS_SETRLIMIT = 195 +pkg syscall (openbsd-amd64-cgo), const SYS_SETRTABLE = 310 +pkg syscall (openbsd-amd64-cgo), const SYS_SETSID = 147 +pkg syscall (openbsd-amd64-cgo), const SYS_SETSOCKOPT = 105 +pkg syscall (openbsd-amd64-cgo), const SYS_SETTIMEOFDAY = 122 +pkg syscall (openbsd-amd64-cgo), const SYS_SETUID = 23 +pkg syscall (openbsd-amd64-cgo), const SYS_SHMAT = 228 +pkg syscall (openbsd-amd64-cgo), const SYS_SHMCTL = 296 +pkg syscall (openbsd-amd64-cgo), const SYS_SHMDT = 230 +pkg syscall (openbsd-amd64-cgo), const SYS_SHMGET = 289 +pkg syscall (openbsd-amd64-cgo), const SYS_SHUTDOWN = 134 +pkg syscall (openbsd-amd64-cgo), const SYS_SIGACTION = 46 +pkg syscall (openbsd-amd64-cgo), const SYS_SIGALTSTACK = 288 +pkg syscall (openbsd-amd64-cgo), const SYS_SIGPENDING = 52 +pkg syscall (openbsd-amd64-cgo), const SYS_SIGPROCMASK = 48 +pkg syscall (openbsd-amd64-cgo), const SYS_SIGRETURN = 103 +pkg syscall (openbsd-amd64-cgo), const SYS_SIGSUSPEND = 111 +pkg syscall (openbsd-amd64-cgo), const SYS_SOCKET = 97 +pkg syscall (openbsd-amd64-cgo), const SYS_SOCKETPAIR = 135 +pkg syscall (openbsd-amd64-cgo), const SYS_STAT = 291 +pkg syscall (openbsd-amd64-cgo), const SYS_STATFS = 307 +pkg syscall (openbsd-amd64-cgo), const SYS_SWAPCTL = 193 +pkg syscall (openbsd-amd64-cgo), const SYS_SYMLINK = 57 +pkg syscall (openbsd-amd64-cgo), const SYS_SYMLINKAT = 324 +pkg syscall (openbsd-amd64-cgo), const SYS_SYNC = 36 +pkg syscall (openbsd-amd64-cgo), const SYS_SYSARCH = 165 +pkg syscall (openbsd-amd64-cgo), const SYS_TRUNCATE = 200 +pkg syscall (openbsd-amd64-cgo), const SYS_UMASK = 60 +pkg syscall (openbsd-amd64-cgo), const SYS_UNLINK = 10 +pkg syscall (openbsd-amd64-cgo), const SYS_UNLINKAT = 325 +pkg syscall (openbsd-amd64-cgo), const SYS_UNMOUNT = 22 +pkg syscall (openbsd-amd64-cgo), const SYS_UTIMENSAT = 326 +pkg syscall (openbsd-amd64-cgo), const SYS_UTIMES = 138 +pkg syscall (openbsd-amd64-cgo), const SYS_VFORK = 66 +pkg syscall (openbsd-amd64-cgo), const SYS_WAIT4 = 7 +pkg syscall (openbsd-amd64-cgo), const SYS_WRITE = 4 +pkg syscall (openbsd-amd64-cgo), const SYS_WRITEV = 121 +pkg syscall (openbsd-amd64-cgo), const SYS___GETCWD = 304 +pkg syscall (openbsd-amd64-cgo), const SYS___GET_TCB = 330 +pkg syscall (openbsd-amd64-cgo), const SYS___SEMCTL = 295 +pkg syscall (openbsd-amd64-cgo), const SYS___SET_TCB = 329 +pkg syscall (openbsd-amd64-cgo), const SYS___SYSCTL = 202 +pkg syscall (openbsd-amd64-cgo), const SYS___TFORK = 8 +pkg syscall (openbsd-amd64-cgo), const SYS___THREXIT = 302 +pkg syscall (openbsd-amd64-cgo), const SYS___THRSIGDIVERT = 303 +pkg syscall (openbsd-amd64-cgo), const SYS___THRSLEEP = 300 +pkg syscall (openbsd-amd64-cgo), const SYS___THRWAKEUP = 301 +pkg syscall (openbsd-amd64-cgo), const S_IFMT = 61440 +pkg syscall (openbsd-amd64-cgo), const SizeofBpfHdr = 20 +pkg syscall (openbsd-amd64-cgo), const SizeofBpfInsn = 8 +pkg syscall (openbsd-amd64-cgo), const SizeofBpfProgram = 16 +pkg syscall (openbsd-amd64-cgo), const SizeofBpfStat = 8 +pkg syscall (openbsd-amd64-cgo), const SizeofBpfVersion = 4 +pkg syscall (openbsd-amd64-cgo), const SizeofCmsghdr = 12 +pkg syscall (openbsd-amd64-cgo), const SizeofIPMreq = 8 +pkg syscall (openbsd-amd64-cgo), const SizeofIPv6Mreq = 20 +pkg syscall (openbsd-amd64-cgo), const SizeofIfAnnounceMsghdr = 26 +pkg syscall (openbsd-amd64-cgo), const SizeofIfData = 224 +pkg syscall (openbsd-amd64-cgo), const SizeofIfMsghdr = 248 +pkg syscall (openbsd-amd64-cgo), const SizeofIfaMsghdr = 24 +pkg syscall (openbsd-amd64-cgo), const SizeofInet6Pktinfo = 20 +pkg syscall (openbsd-amd64-cgo), const SizeofLinger = 8 +pkg syscall (openbsd-amd64-cgo), const SizeofMsghdr = 48 +pkg syscall (openbsd-amd64-cgo), const SizeofRtMetrics = 48 +pkg syscall (openbsd-amd64-cgo), const SizeofRtMsghdr = 88 +pkg syscall (openbsd-amd64-cgo), const SizeofSockaddrAny = 108 +pkg syscall (openbsd-amd64-cgo), const SizeofSockaddrDatalink = 32 +pkg syscall (openbsd-amd64-cgo), const SizeofSockaddrInet4 = 16 +pkg syscall (openbsd-amd64-cgo), const SizeofSockaddrInet6 = 28 +pkg syscall (openbsd-amd64-cgo), const SizeofSockaddrUnix = 106 +pkg syscall (openbsd-amd64-cgo), const TCIFLUSH = 1 +pkg syscall (openbsd-amd64-cgo), const TCIOFLUSH = 3 +pkg syscall (openbsd-amd64-cgo), const TCOFLUSH = 2 +pkg syscall (openbsd-amd64-cgo), const TCP_MAXBURST = 4 +pkg syscall (openbsd-amd64-cgo), const TCP_MAXSEG = 2 +pkg syscall (openbsd-amd64-cgo), const TCP_MAXWIN = 65535 +pkg syscall (openbsd-amd64-cgo), const TCP_MAX_SACK = 3 +pkg syscall (openbsd-amd64-cgo), const TCP_MAX_WINSHIFT = 14 +pkg syscall (openbsd-amd64-cgo), const TCP_MD5SIG = 4 +pkg syscall (openbsd-amd64-cgo), const TCP_MSS = 512 +pkg syscall (openbsd-amd64-cgo), const TCP_NSTATES = 11 +pkg syscall (openbsd-amd64-cgo), const TCP_SACK_ENABLE = 8 +pkg syscall (openbsd-amd64-cgo), const TCSAFLUSH = 2 +pkg syscall (openbsd-amd64-cgo), const TIOCCBRK = 536900730 +pkg syscall (openbsd-amd64-cgo), const TIOCCDTR = 536900728 +pkg syscall (openbsd-amd64-cgo), const TIOCCONS = 2147775586 +pkg syscall (openbsd-amd64-cgo), const TIOCDRAIN = 536900702 +pkg syscall (openbsd-amd64-cgo), const TIOCEXCL = 536900621 +pkg syscall (openbsd-amd64-cgo), const TIOCEXT = 2147775584 +pkg syscall (openbsd-amd64-cgo), const TIOCFLAG_CLOCAL = 2 +pkg syscall (openbsd-amd64-cgo), const TIOCFLAG_CRTSCTS = 4 +pkg syscall (openbsd-amd64-cgo), const TIOCFLAG_MDMBUF = 8 +pkg syscall (openbsd-amd64-cgo), const TIOCFLAG_PPS = 16 +pkg syscall (openbsd-amd64-cgo), const TIOCFLAG_SOFTCAR = 1 +pkg syscall (openbsd-amd64-cgo), const TIOCFLUSH = 2147775504 +pkg syscall (openbsd-amd64-cgo), const TIOCGETA = 1076655123 +pkg syscall (openbsd-amd64-cgo), const TIOCGETD = 1074033690 +pkg syscall (openbsd-amd64-cgo), const TIOCGFLAGS = 1074033757 +pkg syscall (openbsd-amd64-cgo), const TIOCGPGRP = 1074033783 +pkg syscall (openbsd-amd64-cgo), const TIOCGTSTAMP = 1074820187 +pkg syscall (openbsd-amd64-cgo), const TIOCGWINSZ = 1074295912 +pkg syscall (openbsd-amd64-cgo), const TIOCMBIC = 2147775595 +pkg syscall (openbsd-amd64-cgo), const TIOCMBIS = 2147775596 +pkg syscall (openbsd-amd64-cgo), const TIOCMGET = 1074033770 +pkg syscall (openbsd-amd64-cgo), const TIOCMODG = 1074033770 +pkg syscall (openbsd-amd64-cgo), const TIOCMODS = 2147775597 +pkg syscall (openbsd-amd64-cgo), const TIOCMSET = 2147775597 +pkg syscall (openbsd-amd64-cgo), const TIOCM_CAR = 64 +pkg syscall (openbsd-amd64-cgo), const TIOCM_CD = 64 +pkg syscall (openbsd-amd64-cgo), const TIOCM_CTS = 32 +pkg syscall (openbsd-amd64-cgo), const TIOCM_DSR = 256 +pkg syscall (openbsd-amd64-cgo), const TIOCM_DTR = 2 +pkg syscall (openbsd-amd64-cgo), const TIOCM_LE = 1 +pkg syscall (openbsd-amd64-cgo), const TIOCM_RI = 128 +pkg syscall (openbsd-amd64-cgo), const TIOCM_RNG = 128 +pkg syscall (openbsd-amd64-cgo), const TIOCM_RTS = 4 +pkg syscall (openbsd-amd64-cgo), const TIOCM_SR = 16 +pkg syscall (openbsd-amd64-cgo), const TIOCM_ST = 8 +pkg syscall (openbsd-amd64-cgo), const TIOCNOTTY = 536900721 +pkg syscall (openbsd-amd64-cgo), const TIOCNXCL = 536900622 +pkg syscall (openbsd-amd64-cgo), const TIOCOUTQ = 1074033779 +pkg syscall (openbsd-amd64-cgo), const TIOCPKT = 2147775600 +pkg syscall (openbsd-amd64-cgo), const TIOCPKT_DATA = 0 +pkg syscall (openbsd-amd64-cgo), const TIOCPKT_DOSTOP = 32 +pkg syscall (openbsd-amd64-cgo), const TIOCPKT_FLUSHREAD = 1 +pkg syscall (openbsd-amd64-cgo), const TIOCPKT_FLUSHWRITE = 2 +pkg syscall (openbsd-amd64-cgo), const TIOCPKT_IOCTL = 64 +pkg syscall (openbsd-amd64-cgo), const TIOCPKT_NOSTOP = 16 +pkg syscall (openbsd-amd64-cgo), const TIOCPKT_START = 8 +pkg syscall (openbsd-amd64-cgo), const TIOCPKT_STOP = 4 +pkg syscall (openbsd-amd64-cgo), const TIOCREMOTE = 2147775593 +pkg syscall (openbsd-amd64-cgo), const TIOCSBRK = 536900731 +pkg syscall (openbsd-amd64-cgo), const TIOCSCTTY = 536900705 +pkg syscall (openbsd-amd64-cgo), const TIOCSDTR = 536900729 +pkg syscall (openbsd-amd64-cgo), const TIOCSETA = 2150396948 +pkg syscall (openbsd-amd64-cgo), const TIOCSETAF = 2150396950 +pkg syscall (openbsd-amd64-cgo), const TIOCSETAW = 2150396949 +pkg syscall (openbsd-amd64-cgo), const TIOCSETD = 2147775515 +pkg syscall (openbsd-amd64-cgo), const TIOCSFLAGS = 2147775580 +pkg syscall (openbsd-amd64-cgo), const TIOCSIG = 2147775583 +pkg syscall (openbsd-amd64-cgo), const TIOCSPGRP = 2147775606 +pkg syscall (openbsd-amd64-cgo), const TIOCSTART = 536900718 +pkg syscall (openbsd-amd64-cgo), const TIOCSTAT = 2147775589 +pkg syscall (openbsd-amd64-cgo), const TIOCSTI = 2147578994 +pkg syscall (openbsd-amd64-cgo), const TIOCSTOP = 536900719 +pkg syscall (openbsd-amd64-cgo), const TIOCSTSTAMP = 2148037722 +pkg syscall (openbsd-amd64-cgo), const TIOCSWINSZ = 2148037735 +pkg syscall (openbsd-amd64-cgo), const TIOCUCNTL = 2147775590 +pkg syscall (openbsd-amd64-cgo), const TOSTOP = 4194304 +pkg syscall (openbsd-amd64-cgo), const VDISCARD = 15 +pkg syscall (openbsd-amd64-cgo), const VDSUSP = 11 +pkg syscall (openbsd-amd64-cgo), const VEOF = 0 +pkg syscall (openbsd-amd64-cgo), const VEOL = 1 +pkg syscall (openbsd-amd64-cgo), const VEOL2 = 2 +pkg syscall (openbsd-amd64-cgo), const VERASE = 3 +pkg syscall (openbsd-amd64-cgo), const VINTR = 8 +pkg syscall (openbsd-amd64-cgo), const VKILL = 5 +pkg syscall (openbsd-amd64-cgo), const VLNEXT = 14 +pkg syscall (openbsd-amd64-cgo), const VMIN = 16 +pkg syscall (openbsd-amd64-cgo), const VQUIT = 9 +pkg syscall (openbsd-amd64-cgo), const VREPRINT = 6 +pkg syscall (openbsd-amd64-cgo), const VSTART = 12 +pkg syscall (openbsd-amd64-cgo), const VSTATUS = 18 +pkg syscall (openbsd-amd64-cgo), const VSTOP = 13 +pkg syscall (openbsd-amd64-cgo), const VSUSP = 10 +pkg syscall (openbsd-amd64-cgo), const VTIME = 17 +pkg syscall (openbsd-amd64-cgo), const VWERASE = 4 +pkg syscall (openbsd-amd64-cgo), const WALTSIG = 4 +pkg syscall (openbsd-amd64-cgo), const WCONTINUED = 8 +pkg syscall (openbsd-amd64-cgo), const WCOREFLAG = 128 +pkg syscall (openbsd-amd64-cgo), const WNOHANG = 1 +pkg syscall (openbsd-amd64-cgo), const WSTOPPED = 127 +pkg syscall (openbsd-amd64-cgo), const WUNTRACED = 2 +pkg syscall (windows-386), const AF_INET6 = 23 +pkg syscall (windows-386), const AF_NETBIOS = 17 +pkg syscall (windows-386), const AI_CANONNAME = 2 +pkg syscall (windows-386), const AI_CANONNAME ideal-int +pkg syscall (windows-386), const AI_NUMERICHOST = 4 +pkg syscall (windows-386), const AI_NUMERICHOST ideal-int +pkg syscall (windows-386), const AI_PASSIVE = 1 +pkg syscall (windows-386), const AI_PASSIVE ideal-int +pkg syscall (windows-386), const APPLICATION_ERROR = 536870912 +pkg syscall (windows-386), const AUTHTYPE_CLIENT = 1 +pkg syscall (windows-386), const AUTHTYPE_SERVER = 2 +pkg syscall (windows-386), const CERT_CHAIN_POLICY_AUTHENTICODE = 2 +pkg syscall (windows-386), const CERT_CHAIN_POLICY_AUTHENTICODE_TS = 3 +pkg syscall (windows-386), const CERT_CHAIN_POLICY_BASE = 1 +pkg syscall (windows-386), const CERT_CHAIN_POLICY_BASIC_CONSTRAINTS = 5 +pkg syscall (windows-386), const CERT_CHAIN_POLICY_EV = 8 +pkg syscall (windows-386), const CERT_CHAIN_POLICY_MICROSOFT_ROOT = 7 +pkg syscall (windows-386), const CERT_CHAIN_POLICY_NT_AUTH = 6 +pkg syscall (windows-386), const CERT_CHAIN_POLICY_SSL = 4 +pkg syscall (windows-386), const CERT_E_CN_NO_MATCH = 2148204815 +pkg syscall (windows-386), const CERT_E_EXPIRED = 2148204801 +pkg syscall (windows-386), const CERT_E_PURPOSE = 2148204806 +pkg syscall (windows-386), const CERT_E_ROLE = 2148204803 +pkg syscall (windows-386), const CERT_E_UNTRUSTEDROOT = 2148204809 +pkg syscall (windows-386), const CERT_STORE_ADD_ALWAYS = 4 +pkg syscall (windows-386), const CERT_STORE_DEFER_CLOSE_UNTIL_LAST_FREE_FLAG = 4 +pkg syscall (windows-386), const CERT_STORE_PROV_MEMORY = 2 +pkg syscall (windows-386), const CERT_TRUST_HAS_EXCLUDED_NAME_CONSTRAINT = 32768 +pkg syscall (windows-386), const CERT_TRUST_HAS_NOT_DEFINED_NAME_CONSTRAINT = 8192 +pkg syscall (windows-386), const CERT_TRUST_HAS_NOT_PERMITTED_NAME_CONSTRAINT = 16384 +pkg syscall (windows-386), const CERT_TRUST_HAS_NOT_SUPPORTED_CRITICAL_EXT = 134217728 +pkg syscall (windows-386), const CERT_TRUST_HAS_NOT_SUPPORTED_NAME_CONSTRAINT = 4096 +pkg syscall (windows-386), const CERT_TRUST_INVALID_BASIC_CONSTRAINTS = 1024 +pkg syscall (windows-386), const CERT_TRUST_INVALID_EXTENSION = 256 +pkg syscall (windows-386), const CERT_TRUST_INVALID_NAME_CONSTRAINTS = 2048 +pkg syscall (windows-386), const CERT_TRUST_INVALID_POLICY_CONSTRAINTS = 512 +pkg syscall (windows-386), const CERT_TRUST_IS_CYCLIC = 128 +pkg syscall (windows-386), const CERT_TRUST_IS_EXPLICIT_DISTRUST = 67108864 +pkg syscall (windows-386), const CERT_TRUST_IS_NOT_SIGNATURE_VALID = 8 +pkg syscall (windows-386), const CERT_TRUST_IS_NOT_TIME_VALID = 1 +pkg syscall (windows-386), const CERT_TRUST_IS_NOT_VALID_FOR_USAGE = 16 +pkg syscall (windows-386), const CERT_TRUST_IS_OFFLINE_REVOCATION = 16777216 +pkg syscall (windows-386), const CERT_TRUST_IS_REVOKED = 4 +pkg syscall (windows-386), const CERT_TRUST_IS_UNTRUSTED_ROOT = 32 +pkg syscall (windows-386), const CERT_TRUST_NO_ERROR = 0 +pkg syscall (windows-386), const CERT_TRUST_NO_ISSUANCE_CHAIN_POLICY = 33554432 +pkg syscall (windows-386), const CERT_TRUST_REVOCATION_STATUS_UNKNOWN = 64 +pkg syscall (windows-386), const CREATE_ALWAYS = 2 +pkg syscall (windows-386), const CREATE_NEW = 1 +pkg syscall (windows-386), const CREATE_NEW_PROCESS_GROUP = 512 +pkg syscall (windows-386), const CREATE_NEW_PROCESS_GROUP ideal-int +pkg syscall (windows-386), const CREATE_UNICODE_ENVIRONMENT = 1024 +pkg syscall (windows-386), const CRYPT_DEFAULT_CONTAINER_OPTIONAL = 128 +pkg syscall (windows-386), const CRYPT_DELETEKEYSET = 16 +pkg syscall (windows-386), const CRYPT_MACHINE_KEYSET = 32 +pkg syscall (windows-386), const CRYPT_NEWKEYSET = 8 +pkg syscall (windows-386), const CRYPT_SILENT = 64 +pkg syscall (windows-386), const CRYPT_VERIFYCONTEXT = 4026531840 +pkg syscall (windows-386), const CTRL_BREAK_EVENT = 1 +pkg syscall (windows-386), const CTRL_BREAK_EVENT ideal-int +pkg syscall (windows-386), const CTRL_C_EVENT = 0 +pkg syscall (windows-386), const CTRL_C_EVENT ideal-int +pkg syscall (windows-386), const DNS_TYPE_A = 1 +pkg syscall (windows-386), const DNS_TYPE_A6 = 38 +pkg syscall (windows-386), const DNS_TYPE_AAAA = 28 +pkg syscall (windows-386), const DNS_TYPE_ADDRS = 248 +pkg syscall (windows-386), const DNS_TYPE_AFSDB = 18 +pkg syscall (windows-386), const DNS_TYPE_ALL = 255 +pkg syscall (windows-386), const DNS_TYPE_ANY = 255 +pkg syscall (windows-386), const DNS_TYPE_ATMA = 34 +pkg syscall (windows-386), const DNS_TYPE_AXFR = 252 +pkg syscall (windows-386), const DNS_TYPE_CERT = 37 +pkg syscall (windows-386), const DNS_TYPE_CNAME = 5 +pkg syscall (windows-386), const DNS_TYPE_DHCID = 49 +pkg syscall (windows-386), const DNS_TYPE_DNAME = 39 +pkg syscall (windows-386), const DNS_TYPE_DNSKEY = 48 +pkg syscall (windows-386), const DNS_TYPE_DS = 43 +pkg syscall (windows-386), const DNS_TYPE_EID = 31 +pkg syscall (windows-386), const DNS_TYPE_GID = 102 +pkg syscall (windows-386), const DNS_TYPE_GPOS = 27 +pkg syscall (windows-386), const DNS_TYPE_HINFO = 13 +pkg syscall (windows-386), const DNS_TYPE_ISDN = 20 +pkg syscall (windows-386), const DNS_TYPE_IXFR = 251 +pkg syscall (windows-386), const DNS_TYPE_KEY = 25 +pkg syscall (windows-386), const DNS_TYPE_KX = 36 +pkg syscall (windows-386), const DNS_TYPE_LOC = 29 +pkg syscall (windows-386), const DNS_TYPE_MAILA = 254 +pkg syscall (windows-386), const DNS_TYPE_MAILB = 253 +pkg syscall (windows-386), const DNS_TYPE_MB = 7 +pkg syscall (windows-386), const DNS_TYPE_MD = 3 +pkg syscall (windows-386), const DNS_TYPE_MF = 4 +pkg syscall (windows-386), const DNS_TYPE_MG = 8 +pkg syscall (windows-386), const DNS_TYPE_MINFO = 14 +pkg syscall (windows-386), const DNS_TYPE_MR = 9 +pkg syscall (windows-386), const DNS_TYPE_MX = 15 +pkg syscall (windows-386), const DNS_TYPE_NAPTR = 35 +pkg syscall (windows-386), const DNS_TYPE_NBSTAT = 65281 +pkg syscall (windows-386), const DNS_TYPE_NIMLOC = 32 +pkg syscall (windows-386), const DNS_TYPE_NS = 2 +pkg syscall (windows-386), const DNS_TYPE_NSAP = 22 +pkg syscall (windows-386), const DNS_TYPE_NSAPPTR = 23 +pkg syscall (windows-386), const DNS_TYPE_NSEC = 47 +pkg syscall (windows-386), const DNS_TYPE_NULL = 10 +pkg syscall (windows-386), const DNS_TYPE_NXT = 30 +pkg syscall (windows-386), const DNS_TYPE_OPT = 41 +pkg syscall (windows-386), const DNS_TYPE_PTR = 12 +pkg syscall (windows-386), const DNS_TYPE_PX = 26 +pkg syscall (windows-386), const DNS_TYPE_RP = 17 +pkg syscall (windows-386), const DNS_TYPE_RRSIG = 46 +pkg syscall (windows-386), const DNS_TYPE_RT = 21 +pkg syscall (windows-386), const DNS_TYPE_SIG = 24 +pkg syscall (windows-386), const DNS_TYPE_SINK = 40 +pkg syscall (windows-386), const DNS_TYPE_SOA = 6 +pkg syscall (windows-386), const DNS_TYPE_SRV = 33 +pkg syscall (windows-386), const DNS_TYPE_TEXT = 16 +pkg syscall (windows-386), const DNS_TYPE_TKEY = 249 +pkg syscall (windows-386), const DNS_TYPE_TSIG = 250 +pkg syscall (windows-386), const DNS_TYPE_UID = 101 +pkg syscall (windows-386), const DNS_TYPE_UINFO = 100 +pkg syscall (windows-386), const DNS_TYPE_UNSPEC = 103 +pkg syscall (windows-386), const DNS_TYPE_WINS = 65281 +pkg syscall (windows-386), const DNS_TYPE_WINSR = 65282 +pkg syscall (windows-386), const DNS_TYPE_WKS = 11 +pkg syscall (windows-386), const DNS_TYPE_X25 = 19 +pkg syscall (windows-386), const DUPLICATE_CLOSE_SOURCE = 1 +pkg syscall (windows-386), const DUPLICATE_SAME_ACCESS = 2 +pkg syscall (windows-386), const E2BIG = 536870912 +pkg syscall (windows-386), const EACCES = 536870913 +pkg syscall (windows-386), const EADDRINUSE = 536870914 +pkg syscall (windows-386), const EADDRNOTAVAIL = 536870915 +pkg syscall (windows-386), const EADV = 536870916 +pkg syscall (windows-386), const EAFNOSUPPORT = 536870917 +pkg syscall (windows-386), const EAGAIN = 536870918 +pkg syscall (windows-386), const EALREADY = 536870919 +pkg syscall (windows-386), const EBADE = 536870920 +pkg syscall (windows-386), const EBADF = 536870921 +pkg syscall (windows-386), const EBADFD = 536870922 +pkg syscall (windows-386), const EBADMSG = 536870923 +pkg syscall (windows-386), const EBADR = 536870924 +pkg syscall (windows-386), const EBADRQC = 536870925 +pkg syscall (windows-386), const EBADSLT = 536870926 +pkg syscall (windows-386), const EBFONT = 536870927 +pkg syscall (windows-386), const EBUSY = 536870928 +pkg syscall (windows-386), const ECANCELED = 536870929 +pkg syscall (windows-386), const ECHILD = 536870930 +pkg syscall (windows-386), const ECHRNG = 536870931 +pkg syscall (windows-386), const ECOMM = 536870932 +pkg syscall (windows-386), const ECONNABORTED = 536870933 +pkg syscall (windows-386), const ECONNREFUSED = 536870934 +pkg syscall (windows-386), const ECONNRESET = 536870935 +pkg syscall (windows-386), const EDEADLK = 536870936 +pkg syscall (windows-386), const EDEADLOCK = 536870937 +pkg syscall (windows-386), const EDESTADDRREQ = 536870938 +pkg syscall (windows-386), const EDOM = 536870939 +pkg syscall (windows-386), const EDOTDOT = 536870940 +pkg syscall (windows-386), const EDQUOT = 536870941 +pkg syscall (windows-386), const EEXIST = 536870942 +pkg syscall (windows-386), const EFAULT = 536870943 +pkg syscall (windows-386), const EFBIG = 536870944 +pkg syscall (windows-386), const EHOSTDOWN = 536870945 +pkg syscall (windows-386), const EHOSTUNREACH = 536870946 +pkg syscall (windows-386), const EIDRM = 536870947 +pkg syscall (windows-386), const EILSEQ = 536870948 +pkg syscall (windows-386), const EINPROGRESS = 536870949 +pkg syscall (windows-386), const EINTR = 536870950 +pkg syscall (windows-386), const EINVAL = 536870951 +pkg syscall (windows-386), const EIO = 536870952 +pkg syscall (windows-386), const EISCONN = 536870953 +pkg syscall (windows-386), const EISDIR = 536870954 +pkg syscall (windows-386), const EISNAM = 536870955 +pkg syscall (windows-386), const EKEYEXPIRED = 536870956 +pkg syscall (windows-386), const EKEYREJECTED = 536870957 +pkg syscall (windows-386), const EKEYREVOKED = 536870958 +pkg syscall (windows-386), const EL2HLT = 536870959 +pkg syscall (windows-386), const EL2NSYNC = 536870960 +pkg syscall (windows-386), const EL3HLT = 536870961 +pkg syscall (windows-386), const EL3RST = 536870962 +pkg syscall (windows-386), const ELIBACC = 536870963 +pkg syscall (windows-386), const ELIBBAD = 536870964 +pkg syscall (windows-386), const ELIBEXEC = 536870965 +pkg syscall (windows-386), const ELIBMAX = 536870966 +pkg syscall (windows-386), const ELIBSCN = 536870967 +pkg syscall (windows-386), const ELNRNG = 536870968 +pkg syscall (windows-386), const ELOOP = 536870969 +pkg syscall (windows-386), const EMEDIUMTYPE = 536870970 +pkg syscall (windows-386), const EMFILE = 536870971 +pkg syscall (windows-386), const EMLINK = 536870972 +pkg syscall (windows-386), const EMSGSIZE = 536870973 +pkg syscall (windows-386), const EMULTIHOP = 536870974 +pkg syscall (windows-386), const ENAMETOOLONG = 536870975 +pkg syscall (windows-386), const ENAVAIL = 536870976 +pkg syscall (windows-386), const ENETDOWN = 536870977 +pkg syscall (windows-386), const ENETRESET = 536870978 +pkg syscall (windows-386), const ENETUNREACH = 536870979 +pkg syscall (windows-386), const ENFILE = 536870980 +pkg syscall (windows-386), const ENOANO = 536870981 +pkg syscall (windows-386), const ENOBUFS = 536870982 +pkg syscall (windows-386), const ENOCSI = 536870983 +pkg syscall (windows-386), const ENODATA = 536870984 +pkg syscall (windows-386), const ENODEV = 536870985 +pkg syscall (windows-386), const ENOEXEC = 536870986 +pkg syscall (windows-386), const ENOKEY = 536870987 +pkg syscall (windows-386), const ENOLCK = 536870988 +pkg syscall (windows-386), const ENOLINK = 536870989 +pkg syscall (windows-386), const ENOMEDIUM = 536870990 +pkg syscall (windows-386), const ENOMEM = 536870991 +pkg syscall (windows-386), const ENOMSG = 536870992 +pkg syscall (windows-386), const ENONET = 536870993 +pkg syscall (windows-386), const ENOPKG = 536870994 +pkg syscall (windows-386), const ENOPROTOOPT = 536870995 +pkg syscall (windows-386), const ENOSPC = 536870996 +pkg syscall (windows-386), const ENOSR = 536870997 +pkg syscall (windows-386), const ENOSTR = 536870998 +pkg syscall (windows-386), const ENOSYS = 536870999 +pkg syscall (windows-386), const ENOTBLK = 536871000 +pkg syscall (windows-386), const ENOTCONN = 536871001 +pkg syscall (windows-386), const ENOTDIR = 3 +pkg syscall (windows-386), const ENOTEMPTY = 536871002 +pkg syscall (windows-386), const ENOTNAM = 536871003 +pkg syscall (windows-386), const ENOTRECOVERABLE = 536871004 +pkg syscall (windows-386), const ENOTSOCK = 536871005 +pkg syscall (windows-386), const ENOTSUP = 536871006 +pkg syscall (windows-386), const ENOTTY = 536871007 +pkg syscall (windows-386), const ENOTUNIQ = 536871008 +pkg syscall (windows-386), const ENXIO = 536871009 +pkg syscall (windows-386), const EOPNOTSUPP = 536871010 +pkg syscall (windows-386), const EOVERFLOW = 536871011 +pkg syscall (windows-386), const EOWNERDEAD = 536871012 +pkg syscall (windows-386), const EPERM = 536871013 +pkg syscall (windows-386), const EPFNOSUPPORT = 536871014 +pkg syscall (windows-386), const EPIPE = 536871015 +pkg syscall (windows-386), const EPROTO = 536871016 +pkg syscall (windows-386), const EPROTONOSUPPORT = 536871017 +pkg syscall (windows-386), const EPROTOTYPE = 536871018 +pkg syscall (windows-386), const ERANGE = 536871019 +pkg syscall (windows-386), const EREMCHG = 536871020 +pkg syscall (windows-386), const EREMOTE = 536871021 +pkg syscall (windows-386), const EREMOTEIO = 536871022 +pkg syscall (windows-386), const ERESTART = 536871023 +pkg syscall (windows-386), const EROFS = 536871024 +pkg syscall (windows-386), const ERROR_ACCESS_DENIED = 5 +pkg syscall (windows-386), const ERROR_ALREADY_EXISTS = 183 +pkg syscall (windows-386), const ERROR_BROKEN_PIPE = 109 +pkg syscall (windows-386), const ERROR_BUFFER_OVERFLOW = 111 +pkg syscall (windows-386), const ERROR_ENVVAR_NOT_FOUND = 203 +pkg syscall (windows-386), const ERROR_FILE_EXISTS = 80 +pkg syscall (windows-386), const ERROR_FILE_NOT_FOUND = 2 +pkg syscall (windows-386), const ERROR_INSUFFICIENT_BUFFER = 122 +pkg syscall (windows-386), const ERROR_IO_PENDING = 997 +pkg syscall (windows-386), const ERROR_MOD_NOT_FOUND = 126 +pkg syscall (windows-386), const ERROR_NOT_FOUND = 1168 +pkg syscall (windows-386), const ERROR_NOT_FOUND Errno +pkg syscall (windows-386), const ERROR_NO_MORE_FILES = 18 +pkg syscall (windows-386), const ERROR_OPERATION_ABORTED = 995 +pkg syscall (windows-386), const ERROR_PATH_NOT_FOUND = 3 +pkg syscall (windows-386), const ERROR_PROC_NOT_FOUND = 127 +pkg syscall (windows-386), const ESHUTDOWN = 536871025 +pkg syscall (windows-386), const ESOCKTNOSUPPORT = 536871026 +pkg syscall (windows-386), const ESPIPE = 536871027 +pkg syscall (windows-386), const ESRCH = 536871028 +pkg syscall (windows-386), const ESRMNT = 536871029 +pkg syscall (windows-386), const ESTALE = 536871030 +pkg syscall (windows-386), const ESTRPIPE = 536871031 +pkg syscall (windows-386), const ETIME = 536871032 +pkg syscall (windows-386), const ETIMEDOUT = 536871033 +pkg syscall (windows-386), const ETOOMANYREFS = 536871034 +pkg syscall (windows-386), const ETXTBSY = 536871035 +pkg syscall (windows-386), const EUCLEAN = 536871036 +pkg syscall (windows-386), const EUNATCH = 536871037 +pkg syscall (windows-386), const EUSERS = 536871038 +pkg syscall (windows-386), const EWINDOWS = 536871042 +pkg syscall (windows-386), const EWOULDBLOCK = 536871039 +pkg syscall (windows-386), const EXDEV = 536871040 +pkg syscall (windows-386), const EXFULL = 536871041 +pkg syscall (windows-386), const FILE_ACTION_ADDED = 1 +pkg syscall (windows-386), const FILE_ACTION_MODIFIED = 3 +pkg syscall (windows-386), const FILE_ACTION_REMOVED = 2 +pkg syscall (windows-386), const FILE_ACTION_RENAMED_NEW_NAME = 5 +pkg syscall (windows-386), const FILE_ACTION_RENAMED_OLD_NAME = 4 +pkg syscall (windows-386), const FILE_APPEND_DATA = 4 +pkg syscall (windows-386), const FILE_ATTRIBUTE_ARCHIVE = 32 +pkg syscall (windows-386), const FILE_ATTRIBUTE_DIRECTORY = 16 +pkg syscall (windows-386), const FILE_ATTRIBUTE_HIDDEN = 2 +pkg syscall (windows-386), const FILE_ATTRIBUTE_NORMAL = 128 +pkg syscall (windows-386), const FILE_ATTRIBUTE_READONLY = 1 +pkg syscall (windows-386), const FILE_ATTRIBUTE_SYSTEM = 4 +pkg syscall (windows-386), const FILE_BEGIN = 0 +pkg syscall (windows-386), const FILE_CURRENT = 1 +pkg syscall (windows-386), const FILE_END = 2 +pkg syscall (windows-386), const FILE_FLAG_BACKUP_SEMANTICS = 33554432 +pkg syscall (windows-386), const FILE_FLAG_OVERLAPPED = 1073741824 +pkg syscall (windows-386), const FILE_LIST_DIRECTORY = 1 +pkg syscall (windows-386), const FILE_MAP_COPY = 1 +pkg syscall (windows-386), const FILE_MAP_EXECUTE = 32 +pkg syscall (windows-386), const FILE_MAP_READ = 4 +pkg syscall (windows-386), const FILE_MAP_WRITE = 2 +pkg syscall (windows-386), const FILE_NOTIFY_CHANGE_ATTRIBUTES = 4 +pkg syscall (windows-386), const FILE_NOTIFY_CHANGE_CREATION = 64 +pkg syscall (windows-386), const FILE_NOTIFY_CHANGE_DIR_NAME = 2 +pkg syscall (windows-386), const FILE_NOTIFY_CHANGE_FILE_NAME = 1 +pkg syscall (windows-386), const FILE_NOTIFY_CHANGE_LAST_ACCESS = 32 +pkg syscall (windows-386), const FILE_NOTIFY_CHANGE_LAST_WRITE = 16 +pkg syscall (windows-386), const FILE_NOTIFY_CHANGE_SIZE = 8 +pkg syscall (windows-386), const FILE_SHARE_DELETE = 4 +pkg syscall (windows-386), const FILE_SHARE_READ = 1 +pkg syscall (windows-386), const FILE_SHARE_WRITE = 2 +pkg syscall (windows-386), const FILE_TYPE_CHAR = 2 +pkg syscall (windows-386), const FILE_TYPE_DISK = 1 +pkg syscall (windows-386), const FILE_TYPE_PIPE = 3 +pkg syscall (windows-386), const FILE_TYPE_REMOTE = 32768 +pkg syscall (windows-386), const FILE_TYPE_UNKNOWN = 0 +pkg syscall (windows-386), const FILE_WRITE_ATTRIBUTES = 256 +pkg syscall (windows-386), const FORMAT_MESSAGE_ALLOCATE_BUFFER = 256 +pkg syscall (windows-386), const FORMAT_MESSAGE_ARGUMENT_ARRAY = 8192 +pkg syscall (windows-386), const FORMAT_MESSAGE_FROM_HMODULE = 2048 +pkg syscall (windows-386), const FORMAT_MESSAGE_FROM_STRING = 1024 +pkg syscall (windows-386), const FORMAT_MESSAGE_FROM_SYSTEM = 4096 +pkg syscall (windows-386), const FORMAT_MESSAGE_IGNORE_INSERTS = 512 +pkg syscall (windows-386), const FORMAT_MESSAGE_MAX_WIDTH_MASK = 255 +pkg syscall (windows-386), const GENERIC_ALL = 268435456 +pkg syscall (windows-386), const GENERIC_EXECUTE = 536870912 +pkg syscall (windows-386), const GENERIC_READ = 2147483648 +pkg syscall (windows-386), const GENERIC_WRITE = 1073741824 +pkg syscall (windows-386), const GetFileExInfoStandard = 0 +pkg syscall (windows-386), const GetFileExMaxInfoLevel = 1 +pkg syscall (windows-386), const HANDLE_FLAG_INHERIT = 1 +pkg syscall (windows-386), const HKEY_CLASSES_ROOT = 2147483648 +pkg syscall (windows-386), const HKEY_CURRENT_CONFIG = 2147483653 +pkg syscall (windows-386), const HKEY_CURRENT_USER = 2147483649 +pkg syscall (windows-386), const HKEY_DYN_DATA = 2147483654 +pkg syscall (windows-386), const HKEY_LOCAL_MACHINE = 2147483650 +pkg syscall (windows-386), const HKEY_PERFORMANCE_DATA = 2147483652 +pkg syscall (windows-386), const HKEY_USERS = 2147483651 +pkg syscall (windows-386), const IFF_LOOPBACK = 4 +pkg syscall (windows-386), const IFF_MULTICAST = 16 +pkg syscall (windows-386), const IFF_POINTTOPOINT = 8 +pkg syscall (windows-386), const IGNORE = 0 +pkg syscall (windows-386), const INFINITE = 4294967295 +pkg syscall (windows-386), const INVALID_FILE_ATTRIBUTES = 4294967295 +pkg syscall (windows-386), const IOC_IN = 2147483648 +pkg syscall (windows-386), const IOC_IN ideal-int +pkg syscall (windows-386), const IOC_INOUT = 3221225472 +pkg syscall (windows-386), const IOC_INOUT ideal-int +pkg syscall (windows-386), const IOC_OUT = 1073741824 +pkg syscall (windows-386), const IOC_OUT ideal-int +pkg syscall (windows-386), const IOC_WS2 = 134217728 +pkg syscall (windows-386), const IOC_WS2 ideal-int +pkg syscall (windows-386), const IPV6_JOIN_GROUP = 12 +pkg syscall (windows-386), const IPV6_LEAVE_GROUP = 13 +pkg syscall (windows-386), const IPV6_MULTICAST_HOPS = 10 +pkg syscall (windows-386), const IPV6_MULTICAST_IF = 9 +pkg syscall (windows-386), const IPV6_MULTICAST_LOOP = 11 +pkg syscall (windows-386), const IPV6_UNICAST_HOPS = 4 +pkg syscall (windows-386), const IPV6_V6ONLY = 27 +pkg syscall (windows-386), const IP_ADD_MEMBERSHIP = 12 +pkg syscall (windows-386), const IP_DROP_MEMBERSHIP = 13 +pkg syscall (windows-386), const IP_MULTICAST_IF = 9 +pkg syscall (windows-386), const IP_MULTICAST_LOOP = 11 +pkg syscall (windows-386), const IP_MULTICAST_TTL = 10 +pkg syscall (windows-386), const IP_TOS = 3 +pkg syscall (windows-386), const IP_TTL = 4 +pkg syscall (windows-386), const ImplementsGetwd = true +pkg syscall (windows-386), const InvalidHandle = 18446744073709551615 +pkg syscall (windows-386), const KEY_ALL_ACCESS = 983103 +pkg syscall (windows-386), const KEY_CREATE_LINK = 32 +pkg syscall (windows-386), const KEY_CREATE_SUB_KEY = 4 +pkg syscall (windows-386), const KEY_ENUMERATE_SUB_KEYS = 8 +pkg syscall (windows-386), const KEY_EXECUTE = 131097 +pkg syscall (windows-386), const KEY_NOTIFY = 16 +pkg syscall (windows-386), const KEY_QUERY_VALUE = 1 +pkg syscall (windows-386), const KEY_READ = 131097 +pkg syscall (windows-386), const KEY_SET_VALUE = 2 +pkg syscall (windows-386), const KEY_WOW64_32KEY = 512 +pkg syscall (windows-386), const KEY_WOW64_64KEY = 256 +pkg syscall (windows-386), const KEY_WRITE = 131078 +pkg syscall (windows-386), const LANG_ENGLISH = 9 +pkg syscall (windows-386), const MAXLEN_IFDESCR = 256 +pkg syscall (windows-386), const MAXLEN_PHYSADDR = 8 +pkg syscall (windows-386), const MAX_ADAPTER_ADDRESS_LENGTH = 8 +pkg syscall (windows-386), const MAX_ADAPTER_DESCRIPTION_LENGTH = 128 +pkg syscall (windows-386), const MAX_ADAPTER_NAME_LENGTH = 256 +pkg syscall (windows-386), const MAX_COMPUTERNAME_LENGTH = 15 +pkg syscall (windows-386), const MAX_INTERFACE_NAME_LEN = 256 +pkg syscall (windows-386), const MAX_LONG_PATH = 32768 +pkg syscall (windows-386), const MAX_PATH = 260 +pkg syscall (windows-386), const MaxTokenInfoClass = 29 +pkg syscall (windows-386), const NameCanonical = 7 +pkg syscall (windows-386), const NameCanonicalEx = 9 +pkg syscall (windows-386), const NameDisplay = 3 +pkg syscall (windows-386), const NameDnsDomain = 12 +pkg syscall (windows-386), const NameFullyQualifiedDN = 1 +pkg syscall (windows-386), const NameSamCompatible = 2 +pkg syscall (windows-386), const NameServicePrincipal = 10 +pkg syscall (windows-386), const NameUniqueId = 6 +pkg syscall (windows-386), const NameUnknown = 0 +pkg syscall (windows-386), const NameUserPrincipal = 8 +pkg syscall (windows-386), const OPEN_ALWAYS = 4 +pkg syscall (windows-386), const OPEN_EXISTING = 3 +pkg syscall (windows-386), const O_APPEND = 1024 +pkg syscall (windows-386), const O_ASYNC = 8192 +pkg syscall (windows-386), const O_CLOEXEC = 524288 +pkg syscall (windows-386), const O_CREAT = 64 +pkg syscall (windows-386), const O_EXCL = 128 +pkg syscall (windows-386), const O_NOCTTY = 256 +pkg syscall (windows-386), const O_NONBLOCK = 2048 +pkg syscall (windows-386), const O_SYNC = 4096 +pkg syscall (windows-386), const O_TRUNC = 512 +pkg syscall (windows-386), const PAGE_EXECUTE_READ = 32 +pkg syscall (windows-386), const PAGE_EXECUTE_READWRITE = 64 +pkg syscall (windows-386), const PAGE_EXECUTE_WRITECOPY = 128 +pkg syscall (windows-386), const PAGE_READONLY = 2 +pkg syscall (windows-386), const PAGE_READWRITE = 4 +pkg syscall (windows-386), const PAGE_WRITECOPY = 8 +pkg syscall (windows-386), const PKCS_7_ASN_ENCODING = 65536 +pkg syscall (windows-386), const PROCESS_QUERY_INFORMATION = 1024 +pkg syscall (windows-386), const PROV_DH_SCHANNEL = 18 +pkg syscall (windows-386), const PROV_DSS = 3 +pkg syscall (windows-386), const PROV_DSS_DH = 13 +pkg syscall (windows-386), const PROV_EC_ECDSA_FULL = 16 +pkg syscall (windows-386), const PROV_EC_ECDSA_SIG = 14 +pkg syscall (windows-386), const PROV_EC_ECNRA_FULL = 17 +pkg syscall (windows-386), const PROV_EC_ECNRA_SIG = 15 +pkg syscall (windows-386), const PROV_FORTEZZA = 4 +pkg syscall (windows-386), const PROV_INTEL_SEC = 22 +pkg syscall (windows-386), const PROV_MS_EXCHANGE = 5 +pkg syscall (windows-386), const PROV_REPLACE_OWF = 23 +pkg syscall (windows-386), const PROV_RNG = 21 +pkg syscall (windows-386), const PROV_RSA_AES = 24 +pkg syscall (windows-386), const PROV_RSA_FULL = 1 +pkg syscall (windows-386), const PROV_RSA_SCHANNEL = 12 +pkg syscall (windows-386), const PROV_RSA_SIG = 2 +pkg syscall (windows-386), const PROV_SPYRUS_LYNKS = 20 +pkg syscall (windows-386), const PROV_SSL = 6 +pkg syscall (windows-386), const REG_BINARY = 3 +pkg syscall (windows-386), const REG_DWORD = 4 +pkg syscall (windows-386), const REG_DWORD_BIG_ENDIAN = 5 +pkg syscall (windows-386), const REG_DWORD_LITTLE_ENDIAN = 4 +pkg syscall (windows-386), const REG_EXPAND_SZ = 2 +pkg syscall (windows-386), const REG_FULL_RESOURCE_DESCRIPTOR = 9 +pkg syscall (windows-386), const REG_LINK = 6 +pkg syscall (windows-386), const REG_MULTI_SZ = 7 +pkg syscall (windows-386), const REG_NONE = 0 +pkg syscall (windows-386), const REG_QWORD = 11 +pkg syscall (windows-386), const REG_QWORD_LITTLE_ENDIAN = 11 +pkg syscall (windows-386), const REG_RESOURCE_LIST = 8 +pkg syscall (windows-386), const REG_RESOURCE_REQUIREMENTS_LIST = 10 +pkg syscall (windows-386), const REG_SZ = 1 +pkg syscall (windows-386), const SIGBUS = 7 +pkg syscall (windows-386), const SIO_GET_EXTENSION_FUNCTION_POINTER = 3355443206 +pkg syscall (windows-386), const SIO_GET_EXTENSION_FUNCTION_POINTER ideal-int +pkg syscall (windows-386), const SIO_GET_INTERFACE_LIST = 1074033791 +pkg syscall (windows-386), const SOL_SOCKET = 65535 +pkg syscall (windows-386), const SOMAXCONN = 2147483647 +pkg syscall (windows-386), const SO_BROADCAST = 32 +pkg syscall (windows-386), const SO_DONTROUTE = 16 +pkg syscall (windows-386), const SO_KEEPALIVE = 8 +pkg syscall (windows-386), const SO_LINGER = 128 +pkg syscall (windows-386), const SO_RCVBUF = 4098 +pkg syscall (windows-386), const SO_REUSEADDR = 4 +pkg syscall (windows-386), const SO_SNDBUF = 4097 +pkg syscall (windows-386), const SO_UPDATE_ACCEPT_CONTEXT = 28683 +pkg syscall (windows-386), const SO_UPDATE_CONNECT_CONTEXT = 28688 +pkg syscall (windows-386), const SO_UPDATE_CONNECT_CONTEXT ideal-int +pkg syscall (windows-386), const STANDARD_RIGHTS_ALL = 2031616 +pkg syscall (windows-386), const STANDARD_RIGHTS_EXECUTE = 131072 +pkg syscall (windows-386), const STANDARD_RIGHTS_READ = 131072 +pkg syscall (windows-386), const STANDARD_RIGHTS_REQUIRED = 983040 +pkg syscall (windows-386), const STANDARD_RIGHTS_WRITE = 131072 +pkg syscall (windows-386), const STARTF_USESHOWWINDOW = 1 +pkg syscall (windows-386), const STARTF_USESTDHANDLES = 256 +pkg syscall (windows-386), const STD_ERROR_HANDLE = -12 +pkg syscall (windows-386), const STD_INPUT_HANDLE = -10 +pkg syscall (windows-386), const STD_OUTPUT_HANDLE = -11 +pkg syscall (windows-386), const SUBLANG_ENGLISH_US = 1 +pkg syscall (windows-386), const SW_FORCEMINIMIZE = 11 +pkg syscall (windows-386), const SW_HIDE = 0 +pkg syscall (windows-386), const SW_MAXIMIZE = 3 +pkg syscall (windows-386), const SW_MINIMIZE = 6 +pkg syscall (windows-386), const SW_NORMAL = 1 +pkg syscall (windows-386), const SW_RESTORE = 9 +pkg syscall (windows-386), const SW_SHOW = 5 +pkg syscall (windows-386), const SW_SHOWDEFAULT = 10 +pkg syscall (windows-386), const SW_SHOWMAXIMIZED = 3 +pkg syscall (windows-386), const SW_SHOWMINIMIZED = 2 +pkg syscall (windows-386), const SW_SHOWMINNOACTIVE = 7 +pkg syscall (windows-386), const SW_SHOWNA = 8 +pkg syscall (windows-386), const SW_SHOWNOACTIVATE = 4 +pkg syscall (windows-386), const SW_SHOWNORMAL = 1 +pkg syscall (windows-386), const SYNCHRONIZE = 1048576 +pkg syscall (windows-386), const S_IFMT = 126976 +pkg syscall (windows-386), const S_IWRITE = 128 +pkg syscall (windows-386), const SidTypeAlias = 4 +pkg syscall (windows-386), const SidTypeComputer = 9 +pkg syscall (windows-386), const SidTypeDeletedAccount = 6 +pkg syscall (windows-386), const SidTypeDomain = 3 +pkg syscall (windows-386), const SidTypeGroup = 2 +pkg syscall (windows-386), const SidTypeInvalid = 7 +pkg syscall (windows-386), const SidTypeLabel = 10 +pkg syscall (windows-386), const SidTypeUnknown = 8 +pkg syscall (windows-386), const SidTypeUser = 1 +pkg syscall (windows-386), const SidTypeWellKnownGroup = 5 +pkg syscall (windows-386), const TF_DISCONNECT = 1 +pkg syscall (windows-386), const TF_REUSE_SOCKET = 2 +pkg syscall (windows-386), const TF_USE_DEFAULT_WORKER = 0 +pkg syscall (windows-386), const TF_USE_KERNEL_APC = 32 +pkg syscall (windows-386), const TF_USE_SYSTEM_THREAD = 16 +pkg syscall (windows-386), const TF_WRITE_BEHIND = 4 +pkg syscall (windows-386), const TIME_ZONE_ID_DAYLIGHT = 2 +pkg syscall (windows-386), const TIME_ZONE_ID_STANDARD = 1 +pkg syscall (windows-386), const TIME_ZONE_ID_UNKNOWN = 0 +pkg syscall (windows-386), const TOKEN_ADJUST_DEFAULT = 128 +pkg syscall (windows-386), const TOKEN_ADJUST_GROUPS = 64 +pkg syscall (windows-386), const TOKEN_ADJUST_PRIVILEGES = 32 +pkg syscall (windows-386), const TOKEN_ALL_ACCESS = 983295 +pkg syscall (windows-386), const TOKEN_ASSIGN_PRIMARY = 1 +pkg syscall (windows-386), const TOKEN_DUPLICATE = 2 +pkg syscall (windows-386), const TOKEN_EXECUTE = 131072 +pkg syscall (windows-386), const TOKEN_IMPERSONATE = 4 +pkg syscall (windows-386), const TOKEN_QUERY = 8 +pkg syscall (windows-386), const TOKEN_QUERY_SOURCE = 16 +pkg syscall (windows-386), const TOKEN_READ = 131080 +pkg syscall (windows-386), const TOKEN_WRITE = 131296 +pkg syscall (windows-386), const TRUNCATE_EXISTING = 5 +pkg syscall (windows-386), const TokenAccessInformation = 22 +pkg syscall (windows-386), const TokenAuditPolicy = 16 +pkg syscall (windows-386), const TokenDefaultDacl = 6 +pkg syscall (windows-386), const TokenElevation = 20 +pkg syscall (windows-386), const TokenElevationType = 18 +pkg syscall (windows-386), const TokenGroups = 2 +pkg syscall (windows-386), const TokenGroupsAndPrivileges = 13 +pkg syscall (windows-386), const TokenHasRestrictions = 21 +pkg syscall (windows-386), const TokenImpersonationLevel = 9 +pkg syscall (windows-386), const TokenIntegrityLevel = 25 +pkg syscall (windows-386), const TokenLinkedToken = 19 +pkg syscall (windows-386), const TokenLogonSid = 28 +pkg syscall (windows-386), const TokenMandatoryPolicy = 27 +pkg syscall (windows-386), const TokenOrigin = 17 +pkg syscall (windows-386), const TokenOwner = 4 +pkg syscall (windows-386), const TokenPrimaryGroup = 5 +pkg syscall (windows-386), const TokenPrivileges = 3 +pkg syscall (windows-386), const TokenRestrictedSids = 11 +pkg syscall (windows-386), const TokenSandBoxInert = 15 +pkg syscall (windows-386), const TokenSessionId = 12 +pkg syscall (windows-386), const TokenSessionReference = 14 +pkg syscall (windows-386), const TokenSource = 7 +pkg syscall (windows-386), const TokenStatistics = 10 +pkg syscall (windows-386), const TokenType = 8 +pkg syscall (windows-386), const TokenUIAccess = 26 +pkg syscall (windows-386), const TokenUser = 1 +pkg syscall (windows-386), const TokenVirtualizationAllowed = 23 +pkg syscall (windows-386), const TokenVirtualizationEnabled = 24 +pkg syscall (windows-386), const USAGE_MATCH_TYPE_AND = 0 +pkg syscall (windows-386), const USAGE_MATCH_TYPE_OR = 1 +pkg syscall (windows-386), const WAIT_ABANDONED = 128 +pkg syscall (windows-386), const WAIT_FAILED = 4294967295 +pkg syscall (windows-386), const WAIT_OBJECT_0 = 0 +pkg syscall (windows-386), const WAIT_TIMEOUT = 258 +pkg syscall (windows-386), const WSADESCRIPTION_LEN = 256 +pkg syscall (windows-386), const WSASYS_STATUS_LEN = 128 +pkg syscall (windows-386), const X509_ASN_ENCODING = 1 +pkg syscall (windows-386), func CancelIoEx(Handle, *Overlapped) error +pkg syscall (windows-386), func ConnectEx(Handle, Sockaddr, *uint8, uint32, *uint32, *Overlapped) error +pkg syscall (windows-386), func FreeAddrInfoW(*AddrinfoW) +pkg syscall (windows-386), func GetAddrInfoW(*uint16, *uint16, *AddrinfoW, **AddrinfoW) error +pkg syscall (windows-386), func GetConsoleMode(Handle, *uint32) error +pkg syscall (windows-386), func Getsockopt(Handle, int32, int32, *uint8, *int32) error +pkg syscall (windows-386), func LoadCancelIoEx() error +pkg syscall (windows-386), func LoadConnectEx() error +pkg syscall (windows-386), func LoadGetAddrInfo() error +pkg syscall (windows-386), func ReadConsole(Handle, *uint16, uint32, *uint32, *uint8) error +pkg syscall (windows-386), func UTF16FromString(string) ([]uint16, error) +pkg syscall (windows-386), func UTF16PtrFromString(string) (*uint16, error) +pkg syscall (windows-386), func WriteConsole(Handle, *uint16, uint32, *uint32, *uint8) error +pkg syscall (windows-386), type AddrinfoW struct +pkg syscall (windows-386), type AddrinfoW struct, Addr uintptr +pkg syscall (windows-386), type AddrinfoW struct, Addrlen uintptr +pkg syscall (windows-386), type AddrinfoW struct, Canonname *uint16 +pkg syscall (windows-386), type AddrinfoW struct, Family int32 +pkg syscall (windows-386), type AddrinfoW struct, Flags int32 +pkg syscall (windows-386), type AddrinfoW struct, Next *AddrinfoW +pkg syscall (windows-386), type AddrinfoW struct, Protocol int32 +pkg syscall (windows-386), type AddrinfoW struct, Socktype int32 +pkg syscall (windows-386), type GUID struct +pkg syscall (windows-386), type GUID struct, Data1 uint32 +pkg syscall (windows-386), type GUID struct, Data2 uint16 +pkg syscall (windows-386), type GUID struct, Data3 uint16 +pkg syscall (windows-386), type GUID struct, Data4 [8]uint8 +pkg syscall (windows-386), type RawSockaddrInet6 struct, Family uint16 +pkg syscall (windows-386), type SysProcAttr struct, CreationFlags uint32 +pkg syscall (windows-386), var WSAID_CONNECTEX GUID +pkg syscall (windows-amd64), const AF_INET6 = 23 +pkg syscall (windows-amd64), const AF_NETBIOS = 17 +pkg syscall (windows-amd64), const AI_CANONNAME = 2 +pkg syscall (windows-amd64), const AI_CANONNAME ideal-int +pkg syscall (windows-amd64), const AI_NUMERICHOST = 4 +pkg syscall (windows-amd64), const AI_NUMERICHOST ideal-int +pkg syscall (windows-amd64), const AI_PASSIVE = 1 +pkg syscall (windows-amd64), const AI_PASSIVE ideal-int +pkg syscall (windows-amd64), const APPLICATION_ERROR = 536870912 +pkg syscall (windows-amd64), const AUTHTYPE_CLIENT = 1 +pkg syscall (windows-amd64), const AUTHTYPE_SERVER = 2 +pkg syscall (windows-amd64), const CERT_CHAIN_POLICY_AUTHENTICODE = 2 +pkg syscall (windows-amd64), const CERT_CHAIN_POLICY_AUTHENTICODE_TS = 3 +pkg syscall (windows-amd64), const CERT_CHAIN_POLICY_BASE = 1 +pkg syscall (windows-amd64), const CERT_CHAIN_POLICY_BASIC_CONSTRAINTS = 5 +pkg syscall (windows-amd64), const CERT_CHAIN_POLICY_EV = 8 +pkg syscall (windows-amd64), const CERT_CHAIN_POLICY_MICROSOFT_ROOT = 7 +pkg syscall (windows-amd64), const CERT_CHAIN_POLICY_NT_AUTH = 6 +pkg syscall (windows-amd64), const CERT_CHAIN_POLICY_SSL = 4 +pkg syscall (windows-amd64), const CERT_E_CN_NO_MATCH = 2148204815 +pkg syscall (windows-amd64), const CERT_E_EXPIRED = 2148204801 +pkg syscall (windows-amd64), const CERT_E_PURPOSE = 2148204806 +pkg syscall (windows-amd64), const CERT_E_ROLE = 2148204803 +pkg syscall (windows-amd64), const CERT_E_UNTRUSTEDROOT = 2148204809 +pkg syscall (windows-amd64), const CERT_STORE_ADD_ALWAYS = 4 +pkg syscall (windows-amd64), const CERT_STORE_DEFER_CLOSE_UNTIL_LAST_FREE_FLAG = 4 +pkg syscall (windows-amd64), const CERT_STORE_PROV_MEMORY = 2 +pkg syscall (windows-amd64), const CERT_TRUST_HAS_EXCLUDED_NAME_CONSTRAINT = 32768 +pkg syscall (windows-amd64), const CERT_TRUST_HAS_NOT_DEFINED_NAME_CONSTRAINT = 8192 +pkg syscall (windows-amd64), const CERT_TRUST_HAS_NOT_PERMITTED_NAME_CONSTRAINT = 16384 +pkg syscall (windows-amd64), const CERT_TRUST_HAS_NOT_SUPPORTED_CRITICAL_EXT = 134217728 +pkg syscall (windows-amd64), const CERT_TRUST_HAS_NOT_SUPPORTED_NAME_CONSTRAINT = 4096 +pkg syscall (windows-amd64), const CERT_TRUST_INVALID_BASIC_CONSTRAINTS = 1024 +pkg syscall (windows-amd64), const CERT_TRUST_INVALID_EXTENSION = 256 +pkg syscall (windows-amd64), const CERT_TRUST_INVALID_NAME_CONSTRAINTS = 2048 +pkg syscall (windows-amd64), const CERT_TRUST_INVALID_POLICY_CONSTRAINTS = 512 +pkg syscall (windows-amd64), const CERT_TRUST_IS_CYCLIC = 128 +pkg syscall (windows-amd64), const CERT_TRUST_IS_EXPLICIT_DISTRUST = 67108864 +pkg syscall (windows-amd64), const CERT_TRUST_IS_NOT_SIGNATURE_VALID = 8 +pkg syscall (windows-amd64), const CERT_TRUST_IS_NOT_TIME_VALID = 1 +pkg syscall (windows-amd64), const CERT_TRUST_IS_NOT_VALID_FOR_USAGE = 16 +pkg syscall (windows-amd64), const CERT_TRUST_IS_OFFLINE_REVOCATION = 16777216 +pkg syscall (windows-amd64), const CERT_TRUST_IS_REVOKED = 4 +pkg syscall (windows-amd64), const CERT_TRUST_IS_UNTRUSTED_ROOT = 32 +pkg syscall (windows-amd64), const CERT_TRUST_NO_ERROR = 0 +pkg syscall (windows-amd64), const CERT_TRUST_NO_ISSUANCE_CHAIN_POLICY = 33554432 +pkg syscall (windows-amd64), const CERT_TRUST_REVOCATION_STATUS_UNKNOWN = 64 +pkg syscall (windows-amd64), const CREATE_ALWAYS = 2 +pkg syscall (windows-amd64), const CREATE_NEW = 1 +pkg syscall (windows-amd64), const CREATE_NEW_PROCESS_GROUP = 512 +pkg syscall (windows-amd64), const CREATE_NEW_PROCESS_GROUP ideal-int +pkg syscall (windows-amd64), const CREATE_UNICODE_ENVIRONMENT = 1024 +pkg syscall (windows-amd64), const CRYPT_DEFAULT_CONTAINER_OPTIONAL = 128 +pkg syscall (windows-amd64), const CRYPT_DELETEKEYSET = 16 +pkg syscall (windows-amd64), const CRYPT_MACHINE_KEYSET = 32 +pkg syscall (windows-amd64), const CRYPT_NEWKEYSET = 8 +pkg syscall (windows-amd64), const CRYPT_SILENT = 64 +pkg syscall (windows-amd64), const CRYPT_VERIFYCONTEXT = 4026531840 +pkg syscall (windows-amd64), const CTRL_BREAK_EVENT = 1 +pkg syscall (windows-amd64), const CTRL_BREAK_EVENT ideal-int +pkg syscall (windows-amd64), const CTRL_C_EVENT = 0 +pkg syscall (windows-amd64), const CTRL_C_EVENT ideal-int +pkg syscall (windows-amd64), const DNS_TYPE_A = 1 +pkg syscall (windows-amd64), const DNS_TYPE_A6 = 38 +pkg syscall (windows-amd64), const DNS_TYPE_AAAA = 28 +pkg syscall (windows-amd64), const DNS_TYPE_ADDRS = 248 +pkg syscall (windows-amd64), const DNS_TYPE_AFSDB = 18 +pkg syscall (windows-amd64), const DNS_TYPE_ALL = 255 +pkg syscall (windows-amd64), const DNS_TYPE_ANY = 255 +pkg syscall (windows-amd64), const DNS_TYPE_ATMA = 34 +pkg syscall (windows-amd64), const DNS_TYPE_AXFR = 252 +pkg syscall (windows-amd64), const DNS_TYPE_CERT = 37 +pkg syscall (windows-amd64), const DNS_TYPE_CNAME = 5 +pkg syscall (windows-amd64), const DNS_TYPE_DHCID = 49 +pkg syscall (windows-amd64), const DNS_TYPE_DNAME = 39 +pkg syscall (windows-amd64), const DNS_TYPE_DNSKEY = 48 +pkg syscall (windows-amd64), const DNS_TYPE_DS = 43 +pkg syscall (windows-amd64), const DNS_TYPE_EID = 31 +pkg syscall (windows-amd64), const DNS_TYPE_GID = 102 +pkg syscall (windows-amd64), const DNS_TYPE_GPOS = 27 +pkg syscall (windows-amd64), const DNS_TYPE_HINFO = 13 +pkg syscall (windows-amd64), const DNS_TYPE_ISDN = 20 +pkg syscall (windows-amd64), const DNS_TYPE_IXFR = 251 +pkg syscall (windows-amd64), const DNS_TYPE_KEY = 25 +pkg syscall (windows-amd64), const DNS_TYPE_KX = 36 +pkg syscall (windows-amd64), const DNS_TYPE_LOC = 29 +pkg syscall (windows-amd64), const DNS_TYPE_MAILA = 254 +pkg syscall (windows-amd64), const DNS_TYPE_MAILB = 253 +pkg syscall (windows-amd64), const DNS_TYPE_MB = 7 +pkg syscall (windows-amd64), const DNS_TYPE_MD = 3 +pkg syscall (windows-amd64), const DNS_TYPE_MF = 4 +pkg syscall (windows-amd64), const DNS_TYPE_MG = 8 +pkg syscall (windows-amd64), const DNS_TYPE_MINFO = 14 +pkg syscall (windows-amd64), const DNS_TYPE_MR = 9 +pkg syscall (windows-amd64), const DNS_TYPE_MX = 15 +pkg syscall (windows-amd64), const DNS_TYPE_NAPTR = 35 +pkg syscall (windows-amd64), const DNS_TYPE_NBSTAT = 65281 +pkg syscall (windows-amd64), const DNS_TYPE_NIMLOC = 32 +pkg syscall (windows-amd64), const DNS_TYPE_NS = 2 +pkg syscall (windows-amd64), const DNS_TYPE_NSAP = 22 +pkg syscall (windows-amd64), const DNS_TYPE_NSAPPTR = 23 +pkg syscall (windows-amd64), const DNS_TYPE_NSEC = 47 +pkg syscall (windows-amd64), const DNS_TYPE_NULL = 10 +pkg syscall (windows-amd64), const DNS_TYPE_NXT = 30 +pkg syscall (windows-amd64), const DNS_TYPE_OPT = 41 +pkg syscall (windows-amd64), const DNS_TYPE_PTR = 12 +pkg syscall (windows-amd64), const DNS_TYPE_PX = 26 +pkg syscall (windows-amd64), const DNS_TYPE_RP = 17 +pkg syscall (windows-amd64), const DNS_TYPE_RRSIG = 46 +pkg syscall (windows-amd64), const DNS_TYPE_RT = 21 +pkg syscall (windows-amd64), const DNS_TYPE_SIG = 24 +pkg syscall (windows-amd64), const DNS_TYPE_SINK = 40 +pkg syscall (windows-amd64), const DNS_TYPE_SOA = 6 +pkg syscall (windows-amd64), const DNS_TYPE_SRV = 33 +pkg syscall (windows-amd64), const DNS_TYPE_TEXT = 16 +pkg syscall (windows-amd64), const DNS_TYPE_TKEY = 249 +pkg syscall (windows-amd64), const DNS_TYPE_TSIG = 250 +pkg syscall (windows-amd64), const DNS_TYPE_UID = 101 +pkg syscall (windows-amd64), const DNS_TYPE_UINFO = 100 +pkg syscall (windows-amd64), const DNS_TYPE_UNSPEC = 103 +pkg syscall (windows-amd64), const DNS_TYPE_WINS = 65281 +pkg syscall (windows-amd64), const DNS_TYPE_WINSR = 65282 +pkg syscall (windows-amd64), const DNS_TYPE_WKS = 11 +pkg syscall (windows-amd64), const DNS_TYPE_X25 = 19 +pkg syscall (windows-amd64), const DUPLICATE_CLOSE_SOURCE = 1 +pkg syscall (windows-amd64), const DUPLICATE_SAME_ACCESS = 2 +pkg syscall (windows-amd64), const E2BIG = 536870912 +pkg syscall (windows-amd64), const EACCES = 536870913 +pkg syscall (windows-amd64), const EADDRINUSE = 536870914 +pkg syscall (windows-amd64), const EADDRNOTAVAIL = 536870915 +pkg syscall (windows-amd64), const EADV = 536870916 +pkg syscall (windows-amd64), const EAFNOSUPPORT = 536870917 +pkg syscall (windows-amd64), const EAGAIN = 536870918 +pkg syscall (windows-amd64), const EALREADY = 536870919 +pkg syscall (windows-amd64), const EBADE = 536870920 +pkg syscall (windows-amd64), const EBADF = 536870921 +pkg syscall (windows-amd64), const EBADFD = 536870922 +pkg syscall (windows-amd64), const EBADMSG = 536870923 +pkg syscall (windows-amd64), const EBADR = 536870924 +pkg syscall (windows-amd64), const EBADRQC = 536870925 +pkg syscall (windows-amd64), const EBADSLT = 536870926 +pkg syscall (windows-amd64), const EBFONT = 536870927 +pkg syscall (windows-amd64), const EBUSY = 536870928 +pkg syscall (windows-amd64), const ECANCELED = 536870929 +pkg syscall (windows-amd64), const ECHILD = 536870930 +pkg syscall (windows-amd64), const ECHRNG = 536870931 +pkg syscall (windows-amd64), const ECOMM = 536870932 +pkg syscall (windows-amd64), const ECONNABORTED = 536870933 +pkg syscall (windows-amd64), const ECONNREFUSED = 536870934 +pkg syscall (windows-amd64), const ECONNRESET = 536870935 +pkg syscall (windows-amd64), const EDEADLK = 536870936 +pkg syscall (windows-amd64), const EDEADLOCK = 536870937 +pkg syscall (windows-amd64), const EDESTADDRREQ = 536870938 +pkg syscall (windows-amd64), const EDOM = 536870939 +pkg syscall (windows-amd64), const EDOTDOT = 536870940 +pkg syscall (windows-amd64), const EDQUOT = 536870941 +pkg syscall (windows-amd64), const EEXIST = 536870942 +pkg syscall (windows-amd64), const EFAULT = 536870943 +pkg syscall (windows-amd64), const EFBIG = 536870944 +pkg syscall (windows-amd64), const EHOSTDOWN = 536870945 +pkg syscall (windows-amd64), const EHOSTUNREACH = 536870946 +pkg syscall (windows-amd64), const EIDRM = 536870947 +pkg syscall (windows-amd64), const EILSEQ = 536870948 +pkg syscall (windows-amd64), const EINPROGRESS = 536870949 +pkg syscall (windows-amd64), const EINTR = 536870950 +pkg syscall (windows-amd64), const EINVAL = 536870951 +pkg syscall (windows-amd64), const EIO = 536870952 +pkg syscall (windows-amd64), const EISCONN = 536870953 +pkg syscall (windows-amd64), const EISDIR = 536870954 +pkg syscall (windows-amd64), const EISNAM = 536870955 +pkg syscall (windows-amd64), const EKEYEXPIRED = 536870956 +pkg syscall (windows-amd64), const EKEYREJECTED = 536870957 +pkg syscall (windows-amd64), const EKEYREVOKED = 536870958 +pkg syscall (windows-amd64), const EL2HLT = 536870959 +pkg syscall (windows-amd64), const EL2NSYNC = 536870960 +pkg syscall (windows-amd64), const EL3HLT = 536870961 +pkg syscall (windows-amd64), const EL3RST = 536870962 +pkg syscall (windows-amd64), const ELIBACC = 536870963 +pkg syscall (windows-amd64), const ELIBBAD = 536870964 +pkg syscall (windows-amd64), const ELIBEXEC = 536870965 +pkg syscall (windows-amd64), const ELIBMAX = 536870966 +pkg syscall (windows-amd64), const ELIBSCN = 536870967 +pkg syscall (windows-amd64), const ELNRNG = 536870968 +pkg syscall (windows-amd64), const ELOOP = 536870969 +pkg syscall (windows-amd64), const EMEDIUMTYPE = 536870970 +pkg syscall (windows-amd64), const EMFILE = 536870971 +pkg syscall (windows-amd64), const EMLINK = 536870972 +pkg syscall (windows-amd64), const EMSGSIZE = 536870973 +pkg syscall (windows-amd64), const EMULTIHOP = 536870974 +pkg syscall (windows-amd64), const ENAMETOOLONG = 536870975 +pkg syscall (windows-amd64), const ENAVAIL = 536870976 +pkg syscall (windows-amd64), const ENETDOWN = 536870977 +pkg syscall (windows-amd64), const ENETRESET = 536870978 +pkg syscall (windows-amd64), const ENETUNREACH = 536870979 +pkg syscall (windows-amd64), const ENFILE = 536870980 +pkg syscall (windows-amd64), const ENOANO = 536870981 +pkg syscall (windows-amd64), const ENOBUFS = 536870982 +pkg syscall (windows-amd64), const ENOCSI = 536870983 +pkg syscall (windows-amd64), const ENODATA = 536870984 +pkg syscall (windows-amd64), const ENODEV = 536870985 +pkg syscall (windows-amd64), const ENOEXEC = 536870986 +pkg syscall (windows-amd64), const ENOKEY = 536870987 +pkg syscall (windows-amd64), const ENOLCK = 536870988 +pkg syscall (windows-amd64), const ENOLINK = 536870989 +pkg syscall (windows-amd64), const ENOMEDIUM = 536870990 +pkg syscall (windows-amd64), const ENOMEM = 536870991 +pkg syscall (windows-amd64), const ENOMSG = 536870992 +pkg syscall (windows-amd64), const ENONET = 536870993 +pkg syscall (windows-amd64), const ENOPKG = 536870994 +pkg syscall (windows-amd64), const ENOPROTOOPT = 536870995 +pkg syscall (windows-amd64), const ENOSPC = 536870996 +pkg syscall (windows-amd64), const ENOSR = 536870997 +pkg syscall (windows-amd64), const ENOSTR = 536870998 +pkg syscall (windows-amd64), const ENOSYS = 536870999 +pkg syscall (windows-amd64), const ENOTBLK = 536871000 +pkg syscall (windows-amd64), const ENOTCONN = 536871001 +pkg syscall (windows-amd64), const ENOTDIR = 3 +pkg syscall (windows-amd64), const ENOTEMPTY = 536871002 +pkg syscall (windows-amd64), const ENOTNAM = 536871003 +pkg syscall (windows-amd64), const ENOTRECOVERABLE = 536871004 +pkg syscall (windows-amd64), const ENOTSOCK = 536871005 +pkg syscall (windows-amd64), const ENOTSUP = 536871006 +pkg syscall (windows-amd64), const ENOTTY = 536871007 +pkg syscall (windows-amd64), const ENOTUNIQ = 536871008 +pkg syscall (windows-amd64), const ENXIO = 536871009 +pkg syscall (windows-amd64), const EOPNOTSUPP = 536871010 +pkg syscall (windows-amd64), const EOVERFLOW = 536871011 +pkg syscall (windows-amd64), const EOWNERDEAD = 536871012 +pkg syscall (windows-amd64), const EPERM = 536871013 +pkg syscall (windows-amd64), const EPFNOSUPPORT = 536871014 +pkg syscall (windows-amd64), const EPIPE = 536871015 +pkg syscall (windows-amd64), const EPROTO = 536871016 +pkg syscall (windows-amd64), const EPROTONOSUPPORT = 536871017 +pkg syscall (windows-amd64), const EPROTOTYPE = 536871018 +pkg syscall (windows-amd64), const ERANGE = 536871019 +pkg syscall (windows-amd64), const EREMCHG = 536871020 +pkg syscall (windows-amd64), const EREMOTE = 536871021 +pkg syscall (windows-amd64), const EREMOTEIO = 536871022 +pkg syscall (windows-amd64), const ERESTART = 536871023 +pkg syscall (windows-amd64), const EROFS = 536871024 +pkg syscall (windows-amd64), const ERROR_ACCESS_DENIED = 5 +pkg syscall (windows-amd64), const ERROR_ALREADY_EXISTS = 183 +pkg syscall (windows-amd64), const ERROR_BROKEN_PIPE = 109 +pkg syscall (windows-amd64), const ERROR_BUFFER_OVERFLOW = 111 +pkg syscall (windows-amd64), const ERROR_ENVVAR_NOT_FOUND = 203 +pkg syscall (windows-amd64), const ERROR_FILE_EXISTS = 80 +pkg syscall (windows-amd64), const ERROR_FILE_NOT_FOUND = 2 +pkg syscall (windows-amd64), const ERROR_INSUFFICIENT_BUFFER = 122 +pkg syscall (windows-amd64), const ERROR_IO_PENDING = 997 +pkg syscall (windows-amd64), const ERROR_MOD_NOT_FOUND = 126 +pkg syscall (windows-amd64), const ERROR_NOT_FOUND = 1168 +pkg syscall (windows-amd64), const ERROR_NOT_FOUND Errno +pkg syscall (windows-amd64), const ERROR_NO_MORE_FILES = 18 +pkg syscall (windows-amd64), const ERROR_OPERATION_ABORTED = 995 +pkg syscall (windows-amd64), const ERROR_PATH_NOT_FOUND = 3 +pkg syscall (windows-amd64), const ERROR_PROC_NOT_FOUND = 127 +pkg syscall (windows-amd64), const ESHUTDOWN = 536871025 +pkg syscall (windows-amd64), const ESOCKTNOSUPPORT = 536871026 +pkg syscall (windows-amd64), const ESPIPE = 536871027 +pkg syscall (windows-amd64), const ESRCH = 536871028 +pkg syscall (windows-amd64), const ESRMNT = 536871029 +pkg syscall (windows-amd64), const ESTALE = 536871030 +pkg syscall (windows-amd64), const ESTRPIPE = 536871031 +pkg syscall (windows-amd64), const ETIME = 536871032 +pkg syscall (windows-amd64), const ETIMEDOUT = 536871033 +pkg syscall (windows-amd64), const ETOOMANYREFS = 536871034 +pkg syscall (windows-amd64), const ETXTBSY = 536871035 +pkg syscall (windows-amd64), const EUCLEAN = 536871036 +pkg syscall (windows-amd64), const EUNATCH = 536871037 +pkg syscall (windows-amd64), const EUSERS = 536871038 +pkg syscall (windows-amd64), const EWINDOWS = 536871042 +pkg syscall (windows-amd64), const EWOULDBLOCK = 536871039 +pkg syscall (windows-amd64), const EXDEV = 536871040 +pkg syscall (windows-amd64), const EXFULL = 536871041 +pkg syscall (windows-amd64), const FILE_ACTION_ADDED = 1 +pkg syscall (windows-amd64), const FILE_ACTION_MODIFIED = 3 +pkg syscall (windows-amd64), const FILE_ACTION_REMOVED = 2 +pkg syscall (windows-amd64), const FILE_ACTION_RENAMED_NEW_NAME = 5 +pkg syscall (windows-amd64), const FILE_ACTION_RENAMED_OLD_NAME = 4 +pkg syscall (windows-amd64), const FILE_APPEND_DATA = 4 +pkg syscall (windows-amd64), const FILE_ATTRIBUTE_ARCHIVE = 32 +pkg syscall (windows-amd64), const FILE_ATTRIBUTE_DIRECTORY = 16 +pkg syscall (windows-amd64), const FILE_ATTRIBUTE_HIDDEN = 2 +pkg syscall (windows-amd64), const FILE_ATTRIBUTE_NORMAL = 128 +pkg syscall (windows-amd64), const FILE_ATTRIBUTE_READONLY = 1 +pkg syscall (windows-amd64), const FILE_ATTRIBUTE_SYSTEM = 4 +pkg syscall (windows-amd64), const FILE_BEGIN = 0 +pkg syscall (windows-amd64), const FILE_CURRENT = 1 +pkg syscall (windows-amd64), const FILE_END = 2 +pkg syscall (windows-amd64), const FILE_FLAG_BACKUP_SEMANTICS = 33554432 +pkg syscall (windows-amd64), const FILE_FLAG_OVERLAPPED = 1073741824 +pkg syscall (windows-amd64), const FILE_LIST_DIRECTORY = 1 +pkg syscall (windows-amd64), const FILE_MAP_COPY = 1 +pkg syscall (windows-amd64), const FILE_MAP_EXECUTE = 32 +pkg syscall (windows-amd64), const FILE_MAP_READ = 4 +pkg syscall (windows-amd64), const FILE_MAP_WRITE = 2 +pkg syscall (windows-amd64), const FILE_NOTIFY_CHANGE_ATTRIBUTES = 4 +pkg syscall (windows-amd64), const FILE_NOTIFY_CHANGE_CREATION = 64 +pkg syscall (windows-amd64), const FILE_NOTIFY_CHANGE_DIR_NAME = 2 +pkg syscall (windows-amd64), const FILE_NOTIFY_CHANGE_FILE_NAME = 1 +pkg syscall (windows-amd64), const FILE_NOTIFY_CHANGE_LAST_ACCESS = 32 +pkg syscall (windows-amd64), const FILE_NOTIFY_CHANGE_LAST_WRITE = 16 +pkg syscall (windows-amd64), const FILE_NOTIFY_CHANGE_SIZE = 8 +pkg syscall (windows-amd64), const FILE_SHARE_DELETE = 4 +pkg syscall (windows-amd64), const FILE_SHARE_READ = 1 +pkg syscall (windows-amd64), const FILE_SHARE_WRITE = 2 +pkg syscall (windows-amd64), const FILE_TYPE_CHAR = 2 +pkg syscall (windows-amd64), const FILE_TYPE_DISK = 1 +pkg syscall (windows-amd64), const FILE_TYPE_PIPE = 3 +pkg syscall (windows-amd64), const FILE_TYPE_REMOTE = 32768 +pkg syscall (windows-amd64), const FILE_TYPE_UNKNOWN = 0 +pkg syscall (windows-amd64), const FILE_WRITE_ATTRIBUTES = 256 +pkg syscall (windows-amd64), const FORMAT_MESSAGE_ALLOCATE_BUFFER = 256 +pkg syscall (windows-amd64), const FORMAT_MESSAGE_ARGUMENT_ARRAY = 8192 +pkg syscall (windows-amd64), const FORMAT_MESSAGE_FROM_HMODULE = 2048 +pkg syscall (windows-amd64), const FORMAT_MESSAGE_FROM_STRING = 1024 +pkg syscall (windows-amd64), const FORMAT_MESSAGE_FROM_SYSTEM = 4096 +pkg syscall (windows-amd64), const FORMAT_MESSAGE_IGNORE_INSERTS = 512 +pkg syscall (windows-amd64), const FORMAT_MESSAGE_MAX_WIDTH_MASK = 255 +pkg syscall (windows-amd64), const GENERIC_ALL = 268435456 +pkg syscall (windows-amd64), const GENERIC_EXECUTE = 536870912 +pkg syscall (windows-amd64), const GENERIC_READ = 2147483648 +pkg syscall (windows-amd64), const GENERIC_WRITE = 1073741824 +pkg syscall (windows-amd64), const GetFileExInfoStandard = 0 +pkg syscall (windows-amd64), const GetFileExMaxInfoLevel = 1 +pkg syscall (windows-amd64), const HANDLE_FLAG_INHERIT = 1 +pkg syscall (windows-amd64), const HKEY_CLASSES_ROOT = 2147483648 +pkg syscall (windows-amd64), const HKEY_CURRENT_CONFIG = 2147483653 +pkg syscall (windows-amd64), const HKEY_CURRENT_USER = 2147483649 +pkg syscall (windows-amd64), const HKEY_DYN_DATA = 2147483654 +pkg syscall (windows-amd64), const HKEY_LOCAL_MACHINE = 2147483650 +pkg syscall (windows-amd64), const HKEY_PERFORMANCE_DATA = 2147483652 +pkg syscall (windows-amd64), const HKEY_USERS = 2147483651 +pkg syscall (windows-amd64), const IFF_LOOPBACK = 4 +pkg syscall (windows-amd64), const IFF_MULTICAST = 16 +pkg syscall (windows-amd64), const IFF_POINTTOPOINT = 8 +pkg syscall (windows-amd64), const IGNORE = 0 +pkg syscall (windows-amd64), const INFINITE = 4294967295 +pkg syscall (windows-amd64), const INVALID_FILE_ATTRIBUTES = 4294967295 +pkg syscall (windows-amd64), const IOC_IN = 2147483648 +pkg syscall (windows-amd64), const IOC_IN ideal-int +pkg syscall (windows-amd64), const IOC_INOUT = 3221225472 +pkg syscall (windows-amd64), const IOC_INOUT ideal-int +pkg syscall (windows-amd64), const IOC_OUT = 1073741824 +pkg syscall (windows-amd64), const IOC_OUT ideal-int +pkg syscall (windows-amd64), const IOC_WS2 = 134217728 +pkg syscall (windows-amd64), const IOC_WS2 ideal-int +pkg syscall (windows-amd64), const IPV6_JOIN_GROUP = 12 +pkg syscall (windows-amd64), const IPV6_LEAVE_GROUP = 13 +pkg syscall (windows-amd64), const IPV6_MULTICAST_HOPS = 10 +pkg syscall (windows-amd64), const IPV6_MULTICAST_IF = 9 +pkg syscall (windows-amd64), const IPV6_MULTICAST_LOOP = 11 +pkg syscall (windows-amd64), const IPV6_UNICAST_HOPS = 4 +pkg syscall (windows-amd64), const IPV6_V6ONLY = 27 +pkg syscall (windows-amd64), const IP_ADD_MEMBERSHIP = 12 +pkg syscall (windows-amd64), const IP_DROP_MEMBERSHIP = 13 +pkg syscall (windows-amd64), const IP_MULTICAST_IF = 9 +pkg syscall (windows-amd64), const IP_MULTICAST_LOOP = 11 +pkg syscall (windows-amd64), const IP_MULTICAST_TTL = 10 +pkg syscall (windows-amd64), const IP_TOS = 3 +pkg syscall (windows-amd64), const IP_TTL = 4 +pkg syscall (windows-amd64), const ImplementsGetwd = true +pkg syscall (windows-amd64), const InvalidHandle = 18446744073709551615 +pkg syscall (windows-amd64), const KEY_ALL_ACCESS = 983103 +pkg syscall (windows-amd64), const KEY_CREATE_LINK = 32 +pkg syscall (windows-amd64), const KEY_CREATE_SUB_KEY = 4 +pkg syscall (windows-amd64), const KEY_ENUMERATE_SUB_KEYS = 8 +pkg syscall (windows-amd64), const KEY_EXECUTE = 131097 +pkg syscall (windows-amd64), const KEY_NOTIFY = 16 +pkg syscall (windows-amd64), const KEY_QUERY_VALUE = 1 +pkg syscall (windows-amd64), const KEY_READ = 131097 +pkg syscall (windows-amd64), const KEY_SET_VALUE = 2 +pkg syscall (windows-amd64), const KEY_WOW64_32KEY = 512 +pkg syscall (windows-amd64), const KEY_WOW64_64KEY = 256 +pkg syscall (windows-amd64), const KEY_WRITE = 131078 +pkg syscall (windows-amd64), const LANG_ENGLISH = 9 +pkg syscall (windows-amd64), const MAXLEN_IFDESCR = 256 +pkg syscall (windows-amd64), const MAXLEN_PHYSADDR = 8 +pkg syscall (windows-amd64), const MAX_ADAPTER_ADDRESS_LENGTH = 8 +pkg syscall (windows-amd64), const MAX_ADAPTER_DESCRIPTION_LENGTH = 128 +pkg syscall (windows-amd64), const MAX_ADAPTER_NAME_LENGTH = 256 +pkg syscall (windows-amd64), const MAX_COMPUTERNAME_LENGTH = 15 +pkg syscall (windows-amd64), const MAX_INTERFACE_NAME_LEN = 256 +pkg syscall (windows-amd64), const MAX_LONG_PATH = 32768 +pkg syscall (windows-amd64), const MAX_PATH = 260 +pkg syscall (windows-amd64), const MaxTokenInfoClass = 29 +pkg syscall (windows-amd64), const NameCanonical = 7 +pkg syscall (windows-amd64), const NameCanonicalEx = 9 +pkg syscall (windows-amd64), const NameDisplay = 3 +pkg syscall (windows-amd64), const NameDnsDomain = 12 +pkg syscall (windows-amd64), const NameFullyQualifiedDN = 1 +pkg syscall (windows-amd64), const NameSamCompatible = 2 +pkg syscall (windows-amd64), const NameServicePrincipal = 10 +pkg syscall (windows-amd64), const NameUniqueId = 6 +pkg syscall (windows-amd64), const NameUnknown = 0 +pkg syscall (windows-amd64), const NameUserPrincipal = 8 +pkg syscall (windows-amd64), const OPEN_ALWAYS = 4 +pkg syscall (windows-amd64), const OPEN_EXISTING = 3 +pkg syscall (windows-amd64), const O_APPEND = 1024 +pkg syscall (windows-amd64), const O_ASYNC = 8192 +pkg syscall (windows-amd64), const O_CLOEXEC = 524288 +pkg syscall (windows-amd64), const O_CREAT = 64 +pkg syscall (windows-amd64), const O_EXCL = 128 +pkg syscall (windows-amd64), const O_NOCTTY = 256 +pkg syscall (windows-amd64), const O_NONBLOCK = 2048 +pkg syscall (windows-amd64), const O_SYNC = 4096 +pkg syscall (windows-amd64), const O_TRUNC = 512 +pkg syscall (windows-amd64), const PAGE_EXECUTE_READ = 32 +pkg syscall (windows-amd64), const PAGE_EXECUTE_READWRITE = 64 +pkg syscall (windows-amd64), const PAGE_EXECUTE_WRITECOPY = 128 +pkg syscall (windows-amd64), const PAGE_READONLY = 2 +pkg syscall (windows-amd64), const PAGE_READWRITE = 4 +pkg syscall (windows-amd64), const PAGE_WRITECOPY = 8 +pkg syscall (windows-amd64), const PKCS_7_ASN_ENCODING = 65536 +pkg syscall (windows-amd64), const PROCESS_QUERY_INFORMATION = 1024 +pkg syscall (windows-amd64), const PROV_DH_SCHANNEL = 18 +pkg syscall (windows-amd64), const PROV_DSS = 3 +pkg syscall (windows-amd64), const PROV_DSS_DH = 13 +pkg syscall (windows-amd64), const PROV_EC_ECDSA_FULL = 16 +pkg syscall (windows-amd64), const PROV_EC_ECDSA_SIG = 14 +pkg syscall (windows-amd64), const PROV_EC_ECNRA_FULL = 17 +pkg syscall (windows-amd64), const PROV_EC_ECNRA_SIG = 15 +pkg syscall (windows-amd64), const PROV_FORTEZZA = 4 +pkg syscall (windows-amd64), const PROV_INTEL_SEC = 22 +pkg syscall (windows-amd64), const PROV_MS_EXCHANGE = 5 +pkg syscall (windows-amd64), const PROV_REPLACE_OWF = 23 +pkg syscall (windows-amd64), const PROV_RNG = 21 +pkg syscall (windows-amd64), const PROV_RSA_AES = 24 +pkg syscall (windows-amd64), const PROV_RSA_FULL = 1 +pkg syscall (windows-amd64), const PROV_RSA_SCHANNEL = 12 +pkg syscall (windows-amd64), const PROV_RSA_SIG = 2 +pkg syscall (windows-amd64), const PROV_SPYRUS_LYNKS = 20 +pkg syscall (windows-amd64), const PROV_SSL = 6 +pkg syscall (windows-amd64), const REG_BINARY = 3 +pkg syscall (windows-amd64), const REG_DWORD = 4 +pkg syscall (windows-amd64), const REG_DWORD_BIG_ENDIAN = 5 +pkg syscall (windows-amd64), const REG_DWORD_LITTLE_ENDIAN = 4 +pkg syscall (windows-amd64), const REG_EXPAND_SZ = 2 +pkg syscall (windows-amd64), const REG_FULL_RESOURCE_DESCRIPTOR = 9 +pkg syscall (windows-amd64), const REG_LINK = 6 +pkg syscall (windows-amd64), const REG_MULTI_SZ = 7 +pkg syscall (windows-amd64), const REG_NONE = 0 +pkg syscall (windows-amd64), const REG_QWORD = 11 +pkg syscall (windows-amd64), const REG_QWORD_LITTLE_ENDIAN = 11 +pkg syscall (windows-amd64), const REG_RESOURCE_LIST = 8 +pkg syscall (windows-amd64), const REG_RESOURCE_REQUIREMENTS_LIST = 10 +pkg syscall (windows-amd64), const REG_SZ = 1 +pkg syscall (windows-amd64), const SIGBUS = 7 +pkg syscall (windows-amd64), const SIO_GET_EXTENSION_FUNCTION_POINTER = 3355443206 +pkg syscall (windows-amd64), const SIO_GET_EXTENSION_FUNCTION_POINTER ideal-int +pkg syscall (windows-amd64), const SIO_GET_INTERFACE_LIST = 1074033791 +pkg syscall (windows-amd64), const SOL_SOCKET = 65535 +pkg syscall (windows-amd64), const SOMAXCONN = 2147483647 +pkg syscall (windows-amd64), const SO_BROADCAST = 32 +pkg syscall (windows-amd64), const SO_DONTROUTE = 16 +pkg syscall (windows-amd64), const SO_KEEPALIVE = 8 +pkg syscall (windows-amd64), const SO_LINGER = 128 +pkg syscall (windows-amd64), const SO_RCVBUF = 4098 +pkg syscall (windows-amd64), const SO_REUSEADDR = 4 +pkg syscall (windows-amd64), const SO_SNDBUF = 4097 +pkg syscall (windows-amd64), const SO_UPDATE_ACCEPT_CONTEXT = 28683 +pkg syscall (windows-amd64), const SO_UPDATE_CONNECT_CONTEXT = 28688 +pkg syscall (windows-amd64), const SO_UPDATE_CONNECT_CONTEXT ideal-int +pkg syscall (windows-amd64), const STANDARD_RIGHTS_ALL = 2031616 +pkg syscall (windows-amd64), const STANDARD_RIGHTS_EXECUTE = 131072 +pkg syscall (windows-amd64), const STANDARD_RIGHTS_READ = 131072 +pkg syscall (windows-amd64), const STANDARD_RIGHTS_REQUIRED = 983040 +pkg syscall (windows-amd64), const STANDARD_RIGHTS_WRITE = 131072 +pkg syscall (windows-amd64), const STARTF_USESHOWWINDOW = 1 +pkg syscall (windows-amd64), const STARTF_USESTDHANDLES = 256 +pkg syscall (windows-amd64), const STD_ERROR_HANDLE = -12 +pkg syscall (windows-amd64), const STD_INPUT_HANDLE = -10 +pkg syscall (windows-amd64), const STD_OUTPUT_HANDLE = -11 +pkg syscall (windows-amd64), const SUBLANG_ENGLISH_US = 1 +pkg syscall (windows-amd64), const SW_FORCEMINIMIZE = 11 +pkg syscall (windows-amd64), const SW_HIDE = 0 +pkg syscall (windows-amd64), const SW_MAXIMIZE = 3 +pkg syscall (windows-amd64), const SW_MINIMIZE = 6 +pkg syscall (windows-amd64), const SW_NORMAL = 1 +pkg syscall (windows-amd64), const SW_RESTORE = 9 +pkg syscall (windows-amd64), const SW_SHOW = 5 +pkg syscall (windows-amd64), const SW_SHOWDEFAULT = 10 +pkg syscall (windows-amd64), const SW_SHOWMAXIMIZED = 3 +pkg syscall (windows-amd64), const SW_SHOWMINIMIZED = 2 +pkg syscall (windows-amd64), const SW_SHOWMINNOACTIVE = 7 +pkg syscall (windows-amd64), const SW_SHOWNA = 8 +pkg syscall (windows-amd64), const SW_SHOWNOACTIVATE = 4 +pkg syscall (windows-amd64), const SW_SHOWNORMAL = 1 +pkg syscall (windows-amd64), const SYNCHRONIZE = 1048576 +pkg syscall (windows-amd64), const S_IFMT = 126976 +pkg syscall (windows-amd64), const S_IWRITE = 128 +pkg syscall (windows-amd64), const SidTypeAlias = 4 +pkg syscall (windows-amd64), const SidTypeComputer = 9 +pkg syscall (windows-amd64), const SidTypeDeletedAccount = 6 +pkg syscall (windows-amd64), const SidTypeDomain = 3 +pkg syscall (windows-amd64), const SidTypeGroup = 2 +pkg syscall (windows-amd64), const SidTypeInvalid = 7 +pkg syscall (windows-amd64), const SidTypeLabel = 10 +pkg syscall (windows-amd64), const SidTypeUnknown = 8 +pkg syscall (windows-amd64), const SidTypeUser = 1 +pkg syscall (windows-amd64), const SidTypeWellKnownGroup = 5 +pkg syscall (windows-amd64), const TF_DISCONNECT = 1 +pkg syscall (windows-amd64), const TF_REUSE_SOCKET = 2 +pkg syscall (windows-amd64), const TF_USE_DEFAULT_WORKER = 0 +pkg syscall (windows-amd64), const TF_USE_KERNEL_APC = 32 +pkg syscall (windows-amd64), const TF_USE_SYSTEM_THREAD = 16 +pkg syscall (windows-amd64), const TF_WRITE_BEHIND = 4 +pkg syscall (windows-amd64), const TIME_ZONE_ID_DAYLIGHT = 2 +pkg syscall (windows-amd64), const TIME_ZONE_ID_STANDARD = 1 +pkg syscall (windows-amd64), const TIME_ZONE_ID_UNKNOWN = 0 +pkg syscall (windows-amd64), const TOKEN_ADJUST_DEFAULT = 128 +pkg syscall (windows-amd64), const TOKEN_ADJUST_GROUPS = 64 +pkg syscall (windows-amd64), const TOKEN_ADJUST_PRIVILEGES = 32 +pkg syscall (windows-amd64), const TOKEN_ALL_ACCESS = 983295 +pkg syscall (windows-amd64), const TOKEN_ASSIGN_PRIMARY = 1 +pkg syscall (windows-amd64), const TOKEN_DUPLICATE = 2 +pkg syscall (windows-amd64), const TOKEN_EXECUTE = 131072 +pkg syscall (windows-amd64), const TOKEN_IMPERSONATE = 4 +pkg syscall (windows-amd64), const TOKEN_QUERY = 8 +pkg syscall (windows-amd64), const TOKEN_QUERY_SOURCE = 16 +pkg syscall (windows-amd64), const TOKEN_READ = 131080 +pkg syscall (windows-amd64), const TOKEN_WRITE = 131296 +pkg syscall (windows-amd64), const TRUNCATE_EXISTING = 5 +pkg syscall (windows-amd64), const TokenAccessInformation = 22 +pkg syscall (windows-amd64), const TokenAuditPolicy = 16 +pkg syscall (windows-amd64), const TokenDefaultDacl = 6 +pkg syscall (windows-amd64), const TokenElevation = 20 +pkg syscall (windows-amd64), const TokenElevationType = 18 +pkg syscall (windows-amd64), const TokenGroups = 2 +pkg syscall (windows-amd64), const TokenGroupsAndPrivileges = 13 +pkg syscall (windows-amd64), const TokenHasRestrictions = 21 +pkg syscall (windows-amd64), const TokenImpersonationLevel = 9 +pkg syscall (windows-amd64), const TokenIntegrityLevel = 25 +pkg syscall (windows-amd64), const TokenLinkedToken = 19 +pkg syscall (windows-amd64), const TokenLogonSid = 28 +pkg syscall (windows-amd64), const TokenMandatoryPolicy = 27 +pkg syscall (windows-amd64), const TokenOrigin = 17 +pkg syscall (windows-amd64), const TokenOwner = 4 +pkg syscall (windows-amd64), const TokenPrimaryGroup = 5 +pkg syscall (windows-amd64), const TokenPrivileges = 3 +pkg syscall (windows-amd64), const TokenRestrictedSids = 11 +pkg syscall (windows-amd64), const TokenSandBoxInert = 15 +pkg syscall (windows-amd64), const TokenSessionId = 12 +pkg syscall (windows-amd64), const TokenSessionReference = 14 +pkg syscall (windows-amd64), const TokenSource = 7 +pkg syscall (windows-amd64), const TokenStatistics = 10 +pkg syscall (windows-amd64), const TokenType = 8 +pkg syscall (windows-amd64), const TokenUIAccess = 26 +pkg syscall (windows-amd64), const TokenUser = 1 +pkg syscall (windows-amd64), const TokenVirtualizationAllowed = 23 +pkg syscall (windows-amd64), const TokenVirtualizationEnabled = 24 +pkg syscall (windows-amd64), const USAGE_MATCH_TYPE_AND = 0 +pkg syscall (windows-amd64), const USAGE_MATCH_TYPE_OR = 1 +pkg syscall (windows-amd64), const WAIT_ABANDONED = 128 +pkg syscall (windows-amd64), const WAIT_FAILED = 4294967295 +pkg syscall (windows-amd64), const WAIT_OBJECT_0 = 0 +pkg syscall (windows-amd64), const WAIT_TIMEOUT = 258 +pkg syscall (windows-amd64), const WSADESCRIPTION_LEN = 256 +pkg syscall (windows-amd64), const WSASYS_STATUS_LEN = 128 +pkg syscall (windows-amd64), const X509_ASN_ENCODING = 1 +pkg syscall (windows-amd64), func CancelIoEx(Handle, *Overlapped) error +pkg syscall (windows-amd64), func ConnectEx(Handle, Sockaddr, *uint8, uint32, *uint32, *Overlapped) error +pkg syscall (windows-amd64), func FreeAddrInfoW(*AddrinfoW) +pkg syscall (windows-amd64), func GetAddrInfoW(*uint16, *uint16, *AddrinfoW, **AddrinfoW) error +pkg syscall (windows-amd64), func GetConsoleMode(Handle, *uint32) error +pkg syscall (windows-amd64), func Getsockopt(Handle, int32, int32, *uint8, *int32) error +pkg syscall (windows-amd64), func LoadCancelIoEx() error +pkg syscall (windows-amd64), func LoadConnectEx() error +pkg syscall (windows-amd64), func LoadGetAddrInfo() error +pkg syscall (windows-amd64), func ReadConsole(Handle, *uint16, uint32, *uint32, *uint8) error +pkg syscall (windows-amd64), func UTF16FromString(string) ([]uint16, error) +pkg syscall (windows-amd64), func UTF16PtrFromString(string) (*uint16, error) +pkg syscall (windows-amd64), func WriteConsole(Handle, *uint16, uint32, *uint32, *uint8) error +pkg syscall (windows-amd64), type AddrinfoW struct +pkg syscall (windows-amd64), type AddrinfoW struct, Addr uintptr +pkg syscall (windows-amd64), type AddrinfoW struct, Addrlen uintptr +pkg syscall (windows-amd64), type AddrinfoW struct, Canonname *uint16 +pkg syscall (windows-amd64), type AddrinfoW struct, Family int32 +pkg syscall (windows-amd64), type AddrinfoW struct, Flags int32 +pkg syscall (windows-amd64), type AddrinfoW struct, Next *AddrinfoW +pkg syscall (windows-amd64), type AddrinfoW struct, Protocol int32 +pkg syscall (windows-amd64), type AddrinfoW struct, Socktype int32 +pkg syscall (windows-amd64), type GUID struct +pkg syscall (windows-amd64), type GUID struct, Data1 uint32 +pkg syscall (windows-amd64), type GUID struct, Data2 uint16 +pkg syscall (windows-amd64), type GUID struct, Data3 uint16 +pkg syscall (windows-amd64), type GUID struct, Data4 [8]uint8 +pkg syscall (windows-amd64), type RawSockaddrInet6 struct, Family uint16 +pkg syscall (windows-amd64), type SysProcAttr struct, CreationFlags uint32 +pkg syscall (windows-amd64), var WSAID_CONNECTEX GUID +pkg syscall, const AF_INET = 2 +pkg syscall, const AF_UNIX = 1 +pkg syscall, const AF_UNSPEC = 0 +pkg syscall, const ENOENT = 2 +pkg syscall, const IFF_BROADCAST = 2 +pkg syscall, const IFF_UP = 1 +pkg syscall, const IPPROTO_IP = 0 +pkg syscall, const IPPROTO_IPV6 = 41 +pkg syscall, const IPPROTO_TCP = 6 +pkg syscall, const IPPROTO_UDP = 17 +pkg syscall, const O_RDONLY = 0 +pkg syscall, const O_RDWR = 2 +pkg syscall, const O_WRONLY = 1 +pkg syscall, const SHUT_RD = 0 +pkg syscall, const SHUT_RDWR = 2 +pkg syscall, const SHUT_WR = 1 +pkg syscall, const SIGABRT = 6 +pkg syscall, const SIGALRM = 14 +pkg syscall, const SIGFPE = 8 +pkg syscall, const SIGHUP = 1 +pkg syscall, const SIGILL = 4 +pkg syscall, const SIGINT = 2 +pkg syscall, const SIGKILL = 9 +pkg syscall, const SIGPIPE = 13 +pkg syscall, const SIGQUIT = 3 +pkg syscall, const SIGSEGV = 11 +pkg syscall, const SIGTERM = 15 +pkg syscall, const SIGTRAP = 5 +pkg syscall, const SOCK_DGRAM = 2 +pkg syscall, const SOCK_RAW = 3 +pkg syscall, const SOCK_SEQPACKET = 5 +pkg syscall, const SOCK_STREAM = 1 +pkg syscall, const S_IFBLK = 24576 +pkg syscall, const S_IFCHR = 8192 +pkg syscall, const S_IFDIR = 16384 +pkg syscall, const S_IFIFO = 4096 +pkg syscall, const S_IFLNK = 40960 +pkg syscall, const S_IFREG = 32768 +pkg syscall, const S_IFSOCK = 49152 +pkg syscall, const S_IRUSR = 256 +pkg syscall, const S_ISGID = 1024 +pkg syscall, const S_ISUID = 2048 +pkg syscall, const S_ISVTX = 512 +pkg syscall, const S_IWUSR = 128 +pkg syscall, const S_IXUSR = 64 +pkg syscall, const TCP_NODELAY = 1 +pkg syscall, func BytePtrFromString(string) (*uint8, error) +pkg syscall, func ByteSliceFromString(string) ([]uint8, error) +pkg syscall, func NsecToTimespec(int64) Timespec +pkg syscall, func TimespecToNsec(Timespec) int64 +pkg syscall, func UtimesNano(string, []Timespec) error +pkg syscall, type RawSockaddrInet6 struct +pkg syscall, type RawSockaddrInet6 struct, Addr [16]uint8 +pkg syscall, type RawSockaddrInet6 struct, Flowinfo uint32 +pkg syscall, type RawSockaddrInet6 struct, Port uint16 +pkg syscall, type RawSockaddrInet6 struct, Scope_id uint32 +pkg testing, func AllocsPerRun(int, func()) float64 +pkg testing, func Verbose() bool +pkg testing, method (*B) ReportAllocs() +pkg testing, method (*B) Skip(...interface{}) +pkg testing, method (*B) SkipNow() +pkg testing, method (*B) Skipf(string, ...interface{}) +pkg testing, method (*B) Skipped() bool +pkg testing, method (*T) Skip(...interface{}) +pkg testing, method (*T) SkipNow() +pkg testing, method (*T) Skipf(string, ...interface{}) +pkg testing, method (*T) Skipped() bool +pkg testing, method (BenchmarkResult) AllocedBytesPerOp() int64 +pkg testing, method (BenchmarkResult) AllocsPerOp() int64 +pkg testing, method (BenchmarkResult) MemString() string +pkg testing, type BenchmarkResult struct, MemAllocs uint64 +pkg testing, type BenchmarkResult struct, MemBytes uint64 +pkg text/scanner, const Char = -5 +pkg text/scanner, const Comment = -8 +pkg text/scanner, const EOF = -1 +pkg text/scanner, const Float = -4 +pkg text/scanner, const GoTokens = 1012 +pkg text/scanner, const GoWhitespace = 4294977024 +pkg text/scanner, const Ident = -2 +pkg text/scanner, const Int = -3 +pkg text/scanner, const RawString = -7 +pkg text/scanner, const ScanChars = 32 +pkg text/scanner, const ScanComments = 256 +pkg text/scanner, const ScanFloats = 16 +pkg text/scanner, const ScanIdents = 4 +pkg text/scanner, const ScanInts = 8 +pkg text/scanner, const ScanRawStrings = 128 +pkg text/scanner, const ScanStrings = 64 +pkg text/scanner, const SkipComments = 512 +pkg text/scanner, const String = -6 +pkg text/tabwriter, const AlignRight = 4 +pkg text/tabwriter, const Debug = 32 +pkg text/tabwriter, const DiscardEmptyColumns = 8 +pkg text/tabwriter, const Escape = 255 +pkg text/tabwriter, const FilterHTML = 1 +pkg text/tabwriter, const StripEscape = 2 +pkg text/tabwriter, const TabIndent = 16 +pkg text/template, method (Template) ErrorContext(parse.Node) (string, string) +pkg text/template/parse, const NodeAction = 1 +pkg text/template/parse, const NodeBool = 2 +pkg text/template/parse, const NodeChain = 3 +pkg text/template/parse, const NodeChain NodeType +pkg text/template/parse, const NodeCommand = 4 +pkg text/template/parse, const NodeDot = 5 +pkg text/template/parse, const NodeField = 8 +pkg text/template/parse, const NodeIdentifier = 9 +pkg text/template/parse, const NodeIf = 10 +pkg text/template/parse, const NodeList = 11 +pkg text/template/parse, const NodeNil = 12 +pkg text/template/parse, const NodeNil NodeType +pkg text/template/parse, const NodeNumber = 13 +pkg text/template/parse, const NodePipe = 14 +pkg text/template/parse, const NodeRange = 15 +pkg text/template/parse, const NodeString = 16 +pkg text/template/parse, const NodeTemplate = 17 +pkg text/template/parse, const NodeText = 0 +pkg text/template/parse, const NodeVariable = 18 +pkg text/template/parse, const NodeWith = 19 +pkg text/template/parse, method (*ChainNode) Add(string) +pkg text/template/parse, method (*ChainNode) Copy() Node +pkg text/template/parse, method (*ChainNode) String() string +pkg text/template/parse, method (*IdentifierNode) SetPos(Pos) *IdentifierNode +pkg text/template/parse, method (*NilNode) Copy() Node +pkg text/template/parse, method (*NilNode) String() string +pkg text/template/parse, method (*NilNode) Type() NodeType +pkg text/template/parse, method (*Tree) ErrorContext(Node) (string, string) +pkg text/template/parse, method (ActionNode) Position() Pos +pkg text/template/parse, method (BoolNode) Position() Pos +pkg text/template/parse, method (BranchNode) Position() Pos +pkg text/template/parse, method (ChainNode) Position() Pos +pkg text/template/parse, method (ChainNode) Type() NodeType +pkg text/template/parse, method (CommandNode) Position() Pos +pkg text/template/parse, method (DotNode) Position() Pos +pkg text/template/parse, method (FieldNode) Position() Pos +pkg text/template/parse, method (IdentifierNode) Position() Pos +pkg text/template/parse, method (IfNode) Position() Pos +pkg text/template/parse, method (ListNode) Position() Pos +pkg text/template/parse, method (NilNode) Position() Pos +pkg text/template/parse, method (NumberNode) Position() Pos +pkg text/template/parse, method (PipeNode) Position() Pos +pkg text/template/parse, method (Pos) Position() Pos +pkg text/template/parse, method (RangeNode) Position() Pos +pkg text/template/parse, method (StringNode) Position() Pos +pkg text/template/parse, method (TemplateNode) Position() Pos +pkg text/template/parse, method (TextNode) Position() Pos +pkg text/template/parse, method (VariableNode) Position() Pos +pkg text/template/parse, method (WithNode) Position() Pos +pkg text/template/parse, type ActionNode struct, embedded Pos +pkg text/template/parse, type BoolNode struct, embedded Pos +pkg text/template/parse, type BranchNode struct, embedded Pos +pkg text/template/parse, type ChainNode struct +pkg text/template/parse, type ChainNode struct, Field []string +pkg text/template/parse, type ChainNode struct, Node Node +pkg text/template/parse, type ChainNode struct, embedded NodeType +pkg text/template/parse, type ChainNode struct, embedded Pos +pkg text/template/parse, type CommandNode struct, embedded Pos +pkg text/template/parse, type DotNode struct +pkg text/template/parse, type DotNode struct, embedded Pos +pkg text/template/parse, type FieldNode struct, embedded Pos +pkg text/template/parse, type IdentifierNode struct, embedded Pos +pkg text/template/parse, type ListNode struct, embedded Pos +pkg text/template/parse, type NilNode struct +pkg text/template/parse, type NilNode struct, embedded Pos +pkg text/template/parse, type Node interface, Position() Pos +pkg text/template/parse, type Node interface, unexported methods +pkg text/template/parse, type NumberNode struct, embedded Pos +pkg text/template/parse, type PipeNode struct, embedded Pos +pkg text/template/parse, type Pos int +pkg text/template/parse, type StringNode struct, embedded Pos +pkg text/template/parse, type TemplateNode struct, embedded Pos +pkg text/template/parse, type TextNode struct, embedded Pos +pkg text/template/parse, type Tree struct, ParseName string +pkg text/template/parse, type VariableNode struct, embedded Pos +pkg time, const ANSIC = "Mon Jan _2 15:04:05 2006" +pkg time, const April = 4 +pkg time, const August = 8 +pkg time, const December = 12 +pkg time, const February = 2 +pkg time, const Friday = 5 +pkg time, const Hour = 3600000000000 +pkg time, const January = 1 +pkg time, const July = 7 +pkg time, const June = 6 +pkg time, const Kitchen = "3:04PM" +pkg time, const March = 3 +pkg time, const May = 5 +pkg time, const Microsecond = 1000 +pkg time, const Millisecond = 1000000 +pkg time, const Minute = 60000000000 +pkg time, const Monday = 1 +pkg time, const Nanosecond = 1 +pkg time, const November = 11 +pkg time, const October = 10 +pkg time, const RFC1123 = "Mon, 02 Jan 2006 15:04:05 MST" +pkg time, const RFC1123Z = "Mon, 02 Jan 2006 15:04:05 -0700" +pkg time, const RFC3339 = "2006-01-02T15:04:05Z07:00" +pkg time, const RFC3339Nano = "2006-01-02T15:04:05.999999999Z07:00" +pkg time, const RFC822 = "02 Jan 06 15:04 MST" +pkg time, const RFC822Z = "02 Jan 06 15:04 -0700" +pkg time, const RFC850 = "Monday, 02-Jan-06 15:04:05 MST" +pkg time, const RubyDate = "Mon Jan 02 15:04:05 -0700 2006" +pkg time, const Saturday = 6 +pkg time, const Second = 1000000000 +pkg time, const September = 9 +pkg time, const Stamp = "Jan _2 15:04:05" +pkg time, const StampMicro = "Jan _2 15:04:05.000000" +pkg time, const StampMilli = "Jan _2 15:04:05.000" +pkg time, const StampNano = "Jan _2 15:04:05.000000000" +pkg time, const Sunday = 0 +pkg time, const Thursday = 4 +pkg time, const Tuesday = 2 +pkg time, const UnixDate = "Mon Jan _2 15:04:05 MST 2006" +pkg time, const Wednesday = 3 +pkg time, func ParseInLocation(string, string, *Location) (Time, error) +pkg time, method (*Timer) Reset(Duration) bool +pkg time, method (Time) Round(Duration) Time +pkg time, method (Time) Truncate(Duration) Time +pkg time, method (Time) YearDay() int +pkg unicode, const LowerCase = 1 +pkg unicode, const MaxASCII = 127 +pkg unicode, const MaxCase = 3 +pkg unicode, const MaxLatin1 = 255 +pkg unicode, const MaxRune = 1114111 +pkg unicode, const ReplacementChar = 65533 +pkg unicode, const TitleCase = 2 +pkg unicode, const UpperCase = 0 +pkg unicode, const UpperLower = 1114112 +pkg unicode, const Version = "6.2.0" +pkg unicode, type RangeTable struct, LatinOffset int +pkg unicode, var Chakma *RangeTable +pkg unicode, var Meroitic_Cursive *RangeTable +pkg unicode, var Meroitic_Hieroglyphs *RangeTable +pkg unicode, var Miao *RangeTable +pkg unicode, var Sharada *RangeTable +pkg unicode, var Sora_Sompeng *RangeTable +pkg unicode, var Takri *RangeTable +pkg unicode/utf8, const MaxRune = 1114111 +pkg unicode/utf8, const RuneError = 65533 +pkg unicode/utf8, const RuneSelf = 128 +pkg unicode/utf8, const UTFMax = 4 +pkg unicode/utf8, func ValidRune(int32) bool diff --git a/api/go1.2.txt b/api/go1.2.txt new file mode 100644 index 0000000000000000000000000000000000000000..d6835e608b141c47aeb38fcbafa43d2a8d2985e4 --- /dev/null +++ b/api/go1.2.txt @@ -0,0 +1,32484 @@ +pkg archive/zip, func RegisterCompressor(uint16, Compressor) +pkg archive/zip, func RegisterDecompressor(uint16, Decompressor) +pkg archive/zip, method (*File) DataOffset() (int64, error) +pkg archive/zip, type Compressor func(io.Writer) (io.WriteCloser, error) +pkg archive/zip, type Decompressor func(io.Reader) io.ReadCloser +pkg bufio, method (*Reader) Reset(io.Reader) +pkg bufio, method (*Writer) Reset(io.Writer) +pkg compress/flate, method (*Writer) Reset(io.Writer) +pkg compress/gzip, method (*Writer) Reset(io.Writer) +pkg compress/zlib, method (*Writer) Reset(io.Writer) +pkg container/heap, func Fix(Interface, int) +pkg container/list, method (*List) MoveAfter(*Element, *Element) +pkg container/list, method (*List) MoveBefore(*Element, *Element) +pkg crypto, type PublicKey interface {} +pkg crypto/cipher, func NewGCM(Block) (AEAD, error) +pkg crypto/cipher, type AEAD interface { NonceSize, Open, Overhead, Seal } +pkg crypto/cipher, type AEAD interface, NonceSize() int +pkg crypto/cipher, type AEAD interface, Open([]uint8, []uint8, []uint8, []uint8) ([]uint8, error) +pkg crypto/cipher, type AEAD interface, Overhead() int +pkg crypto/cipher, type AEAD interface, Seal([]uint8, []uint8, []uint8, []uint8) []uint8 +pkg crypto/md5, func Sum([]uint8) [16]uint8 +pkg crypto/rsa, const PSSSaltLengthAuto = 0 +pkg crypto/rsa, const PSSSaltLengthAuto ideal-int +pkg crypto/rsa, const PSSSaltLengthEqualsHash = -1 +pkg crypto/rsa, const PSSSaltLengthEqualsHash ideal-int +pkg crypto/rsa, func SignPSS(io.Reader, *PrivateKey, crypto.Hash, []uint8, *PSSOptions) ([]uint8, error) +pkg crypto/rsa, func VerifyPSS(*PublicKey, crypto.Hash, []uint8, []uint8, *PSSOptions) error +pkg crypto/rsa, type PSSOptions struct +pkg crypto/rsa, type PSSOptions struct, SaltLength int +pkg crypto/sha1, func Sum([]uint8) [20]uint8 +pkg crypto/sha256, func Sum224([]uint8) [28]uint8 +pkg crypto/sha256, func Sum256([]uint8) [32]uint8 +pkg crypto/sha512, func Sum384([]uint8) [48]uint8 +pkg crypto/sha512, func Sum512([]uint8) [64]uint8 +pkg crypto/subtle, func ConstantTimeLessOrEq(int, int) int +pkg crypto/tls, const TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA = 49161 +pkg crypto/tls, const TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA uint16 +pkg crypto/tls, const TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 = 49195 +pkg crypto/tls, const TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 uint16 +pkg crypto/tls, const TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA = 49162 +pkg crypto/tls, const TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA uint16 +pkg crypto/tls, const TLS_ECDHE_ECDSA_WITH_RC4_128_SHA = 49159 +pkg crypto/tls, const TLS_ECDHE_ECDSA_WITH_RC4_128_SHA uint16 +pkg crypto/tls, const TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 = 49199 +pkg crypto/tls, const TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 uint16 +pkg crypto/tls, const VersionSSL30 = 768 +pkg crypto/tls, const VersionSSL30 ideal-int +pkg crypto/tls, const VersionTLS10 = 769 +pkg crypto/tls, const VersionTLS10 ideal-int +pkg crypto/tls, const VersionTLS11 = 770 +pkg crypto/tls, const VersionTLS11 ideal-int +pkg crypto/tls, const VersionTLS12 = 771 +pkg crypto/tls, const VersionTLS12 ideal-int +pkg crypto/tls, type Config struct, MaxVersion uint16 +pkg crypto/tls, type Config struct, MinVersion uint16 +pkg crypto/x509, func MarshalECPrivateKey(*ecdsa.PrivateKey) ([]uint8, error) +pkg crypto/x509, type Certificate struct, CRLDistributionPoints []string +pkg crypto/x509, type Certificate struct, Extensions []pkix.Extension +pkg crypto/x509, type Certificate struct, ExtraExtensions []pkix.Extension +pkg crypto/x509, type Certificate struct, IssuingCertificateURL []string +pkg crypto/x509, type Certificate struct, OCSPServer []string +pkg database/sql, method (*DB) SetMaxOpenConns(int) +pkg encoding, type BinaryMarshaler interface { MarshalBinary } +pkg encoding, type BinaryMarshaler interface, MarshalBinary() ([]uint8, error) +pkg encoding, type BinaryUnmarshaler interface { UnmarshalBinary } +pkg encoding, type BinaryUnmarshaler interface, UnmarshalBinary([]uint8) error +pkg encoding, type TextMarshaler interface { MarshalText } +pkg encoding, type TextMarshaler interface, MarshalText() ([]uint8, error) +pkg encoding, type TextUnmarshaler interface { UnmarshalText } +pkg encoding, type TextUnmarshaler interface, UnmarshalText([]uint8) error +pkg encoding/xml, method (*Encoder) EncodeElement(interface{}, StartElement) error +pkg encoding/xml, method (*Encoder) EncodeToken(Token) error +pkg encoding/xml, method (*Encoder) Flush() error +pkg encoding/xml, method (StartElement) End() EndElement +pkg encoding/xml, type Marshaler interface { MarshalXML } +pkg encoding/xml, type Marshaler interface, MarshalXML(*Encoder, StartElement) error +pkg encoding/xml, type MarshalerAttr interface { MarshalXMLAttr } +pkg encoding/xml, type MarshalerAttr interface, MarshalXMLAttr(Name) (Attr, error) +pkg encoding/xml, type Unmarshaler interface { UnmarshalXML } +pkg encoding/xml, type Unmarshaler interface, UnmarshalXML(*Decoder, StartElement) error +pkg encoding/xml, type UnmarshalerAttr interface { UnmarshalXMLAttr } +pkg encoding/xml, type UnmarshalerAttr interface, UnmarshalXMLAttr(Attr) error +pkg flag, type Getter interface { Get, Set, String } +pkg flag, type Getter interface, Get() interface{} +pkg flag, type Getter interface, Set(string) error +pkg flag, type Getter interface, String() string +pkg flag, var CommandLine *FlagSet +pkg go/ast, type SliceExpr struct, Max Expr +pkg go/ast, type SliceExpr struct, Slice3 bool +pkg go/ast, type TypeAssertExpr struct, Lparen token.Pos +pkg go/ast, type TypeAssertExpr struct, Rparen token.Pos +pkg go/build, method (*Context) MatchFile(string, string) (bool, error) +pkg go/build, type Package struct, AllTags []string +pkg go/build, type Package struct, CXXFiles []string +pkg go/build, type Package struct, CgoCPPFLAGS []string +pkg go/build, type Package struct, CgoCXXFLAGS []string +pkg go/build, type Package struct, ConflictDir string +pkg go/token, method (*File) MergeLine(int) +pkg html/template, type Template struct, Tree *parse.Tree +pkg image/color/palette, var Plan9 []color.Color +pkg image/color/palette, var WebSafe []color.Color +pkg image/draw, method (Op) Draw(Image, image.Rectangle, image.Image, image.Point) +pkg image/draw, type Drawer interface { Draw } +pkg image/draw, type Drawer interface, Draw(Image, image.Rectangle, image.Image, image.Point) +pkg image/draw, type Quantizer interface { Quantize } +pkg image/draw, type Quantizer interface, Quantize(color.Palette, image.Image) color.Palette +pkg image/draw, var FloydSteinberg Drawer +pkg image/gif, func Encode(io.Writer, image.Image, *Options) error +pkg image/gif, func EncodeAll(io.Writer, *GIF) error +pkg image/gif, type Options struct +pkg image/gif, type Options struct, Drawer draw.Drawer +pkg image/gif, type Options struct, NumColors int +pkg image/gif, type Options struct, Quantizer draw.Quantizer +pkg log/syslog (freebsd-386-cgo), const LOG_ALERT Priority +pkg log/syslog (freebsd-386-cgo), const LOG_AUTH Priority +pkg log/syslog (freebsd-386-cgo), const LOG_AUTHPRIV Priority +pkg log/syslog (freebsd-386-cgo), const LOG_CRIT Priority +pkg log/syslog (freebsd-386-cgo), const LOG_CRON Priority +pkg log/syslog (freebsd-386-cgo), const LOG_DAEMON Priority +pkg log/syslog (freebsd-386-cgo), const LOG_DEBUG Priority +pkg log/syslog (freebsd-386-cgo), const LOG_EMERG Priority +pkg log/syslog (freebsd-386-cgo), const LOG_ERR Priority +pkg log/syslog (freebsd-386-cgo), const LOG_FTP Priority +pkg log/syslog (freebsd-386-cgo), const LOG_INFO Priority +pkg log/syslog (freebsd-386-cgo), const LOG_KERN Priority +pkg log/syslog (freebsd-386-cgo), const LOG_LOCAL0 Priority +pkg log/syslog (freebsd-386-cgo), const LOG_LOCAL1 Priority +pkg log/syslog (freebsd-386-cgo), const LOG_LOCAL2 Priority +pkg log/syslog (freebsd-386-cgo), const LOG_LOCAL3 Priority +pkg log/syslog (freebsd-386-cgo), const LOG_LOCAL4 Priority +pkg log/syslog (freebsd-386-cgo), const LOG_LOCAL5 Priority +pkg log/syslog (freebsd-386-cgo), const LOG_LOCAL6 Priority +pkg log/syslog (freebsd-386-cgo), const LOG_LOCAL7 Priority +pkg log/syslog (freebsd-386-cgo), const LOG_LPR Priority +pkg log/syslog (freebsd-386-cgo), const LOG_MAIL Priority +pkg log/syslog (freebsd-386-cgo), const LOG_NEWS Priority +pkg log/syslog (freebsd-386-cgo), const LOG_NOTICE Priority +pkg log/syslog (freebsd-386-cgo), const LOG_SYSLOG Priority +pkg log/syslog (freebsd-386-cgo), const LOG_USER Priority +pkg log/syslog (freebsd-386-cgo), const LOG_UUCP Priority +pkg log/syslog (freebsd-386-cgo), const LOG_WARNING Priority +pkg log/syslog (freebsd-386-cgo), func Dial(string, string, Priority, string) (*Writer, error) +pkg log/syslog (freebsd-386-cgo), func New(Priority, string) (*Writer, error) +pkg log/syslog (freebsd-386-cgo), func NewLogger(Priority, int) (*log.Logger, error) +pkg log/syslog (freebsd-386-cgo), method (*Writer) Alert(string) error +pkg log/syslog (freebsd-386-cgo), method (*Writer) Close() error +pkg log/syslog (freebsd-386-cgo), method (*Writer) Crit(string) error +pkg log/syslog (freebsd-386-cgo), method (*Writer) Debug(string) error +pkg log/syslog (freebsd-386-cgo), method (*Writer) Emerg(string) error +pkg log/syslog (freebsd-386-cgo), method (*Writer) Err(string) error +pkg log/syslog (freebsd-386-cgo), method (*Writer) Info(string) error +pkg log/syslog (freebsd-386-cgo), method (*Writer) Notice(string) error +pkg log/syslog (freebsd-386-cgo), method (*Writer) Warning(string) error +pkg log/syslog (freebsd-386-cgo), method (*Writer) Write([]uint8) (int, error) +pkg log/syslog (freebsd-386-cgo), type Priority int +pkg log/syslog (freebsd-386-cgo), type Writer struct +pkg log/syslog (freebsd-amd64-cgo), const LOG_ALERT Priority +pkg log/syslog (freebsd-amd64-cgo), const LOG_AUTH Priority +pkg log/syslog (freebsd-amd64-cgo), const LOG_AUTHPRIV Priority +pkg log/syslog (freebsd-amd64-cgo), const LOG_CRIT Priority +pkg log/syslog (freebsd-amd64-cgo), const LOG_CRON Priority +pkg log/syslog (freebsd-amd64-cgo), const LOG_DAEMON Priority +pkg log/syslog (freebsd-amd64-cgo), const LOG_DEBUG Priority +pkg log/syslog (freebsd-amd64-cgo), const LOG_EMERG Priority +pkg log/syslog (freebsd-amd64-cgo), const LOG_ERR Priority +pkg log/syslog (freebsd-amd64-cgo), const LOG_FTP Priority +pkg log/syslog (freebsd-amd64-cgo), const LOG_INFO Priority +pkg log/syslog (freebsd-amd64-cgo), const LOG_KERN Priority +pkg log/syslog (freebsd-amd64-cgo), const LOG_LOCAL0 Priority +pkg log/syslog (freebsd-amd64-cgo), const LOG_LOCAL1 Priority +pkg log/syslog (freebsd-amd64-cgo), const LOG_LOCAL2 Priority +pkg log/syslog (freebsd-amd64-cgo), const LOG_LOCAL3 Priority +pkg log/syslog (freebsd-amd64-cgo), const LOG_LOCAL4 Priority +pkg log/syslog (freebsd-amd64-cgo), const LOG_LOCAL5 Priority +pkg log/syslog (freebsd-amd64-cgo), const LOG_LOCAL6 Priority +pkg log/syslog (freebsd-amd64-cgo), const LOG_LOCAL7 Priority +pkg log/syslog (freebsd-amd64-cgo), const LOG_LPR Priority +pkg log/syslog (freebsd-amd64-cgo), const LOG_MAIL Priority +pkg log/syslog (freebsd-amd64-cgo), const LOG_NEWS Priority +pkg log/syslog (freebsd-amd64-cgo), const LOG_NOTICE Priority +pkg log/syslog (freebsd-amd64-cgo), const LOG_SYSLOG Priority +pkg log/syslog (freebsd-amd64-cgo), const LOG_USER Priority +pkg log/syslog (freebsd-amd64-cgo), const LOG_UUCP Priority +pkg log/syslog (freebsd-amd64-cgo), const LOG_WARNING Priority +pkg log/syslog (freebsd-amd64-cgo), func Dial(string, string, Priority, string) (*Writer, error) +pkg log/syslog (freebsd-amd64-cgo), func New(Priority, string) (*Writer, error) +pkg log/syslog (freebsd-amd64-cgo), func NewLogger(Priority, int) (*log.Logger, error) +pkg log/syslog (freebsd-amd64-cgo), method (*Writer) Alert(string) error +pkg log/syslog (freebsd-amd64-cgo), method (*Writer) Close() error +pkg log/syslog (freebsd-amd64-cgo), method (*Writer) Crit(string) error +pkg log/syslog (freebsd-amd64-cgo), method (*Writer) Debug(string) error +pkg log/syslog (freebsd-amd64-cgo), method (*Writer) Emerg(string) error +pkg log/syslog (freebsd-amd64-cgo), method (*Writer) Err(string) error +pkg log/syslog (freebsd-amd64-cgo), method (*Writer) Info(string) error +pkg log/syslog (freebsd-amd64-cgo), method (*Writer) Notice(string) error +pkg log/syslog (freebsd-amd64-cgo), method (*Writer) Warning(string) error +pkg log/syslog (freebsd-amd64-cgo), method (*Writer) Write([]uint8) (int, error) +pkg log/syslog (freebsd-amd64-cgo), type Priority int +pkg log/syslog (freebsd-amd64-cgo), type Writer struct +pkg log/syslog (freebsd-arm), const LOG_ALERT Priority +pkg log/syslog (freebsd-arm), const LOG_AUTH Priority +pkg log/syslog (freebsd-arm), const LOG_AUTHPRIV Priority +pkg log/syslog (freebsd-arm), const LOG_CRIT Priority +pkg log/syslog (freebsd-arm), const LOG_CRON Priority +pkg log/syslog (freebsd-arm), const LOG_DAEMON Priority +pkg log/syslog (freebsd-arm), const LOG_DEBUG Priority +pkg log/syslog (freebsd-arm), const LOG_EMERG Priority +pkg log/syslog (freebsd-arm), const LOG_ERR Priority +pkg log/syslog (freebsd-arm), const LOG_FTP Priority +pkg log/syslog (freebsd-arm), const LOG_INFO Priority +pkg log/syslog (freebsd-arm), const LOG_KERN Priority +pkg log/syslog (freebsd-arm), const LOG_LOCAL0 Priority +pkg log/syslog (freebsd-arm), const LOG_LOCAL1 Priority +pkg log/syslog (freebsd-arm), const LOG_LOCAL2 Priority +pkg log/syslog (freebsd-arm), const LOG_LOCAL3 Priority +pkg log/syslog (freebsd-arm), const LOG_LOCAL4 Priority +pkg log/syslog (freebsd-arm), const LOG_LOCAL5 Priority +pkg log/syslog (freebsd-arm), const LOG_LOCAL6 Priority +pkg log/syslog (freebsd-arm), const LOG_LOCAL7 Priority +pkg log/syslog (freebsd-arm), const LOG_LPR Priority +pkg log/syslog (freebsd-arm), const LOG_MAIL Priority +pkg log/syslog (freebsd-arm), const LOG_NEWS Priority +pkg log/syslog (freebsd-arm), const LOG_NOTICE Priority +pkg log/syslog (freebsd-arm), const LOG_SYSLOG Priority +pkg log/syslog (freebsd-arm), const LOG_USER Priority +pkg log/syslog (freebsd-arm), const LOG_UUCP Priority +pkg log/syslog (freebsd-arm), const LOG_WARNING Priority +pkg log/syslog (freebsd-arm), func Dial(string, string, Priority, string) (*Writer, error) +pkg log/syslog (freebsd-arm), func New(Priority, string) (*Writer, error) +pkg log/syslog (freebsd-arm), func NewLogger(Priority, int) (*log.Logger, error) +pkg log/syslog (freebsd-arm), method (*Writer) Alert(string) error +pkg log/syslog (freebsd-arm), method (*Writer) Close() error +pkg log/syslog (freebsd-arm), method (*Writer) Crit(string) error +pkg log/syslog (freebsd-arm), method (*Writer) Debug(string) error +pkg log/syslog (freebsd-arm), method (*Writer) Emerg(string) error +pkg log/syslog (freebsd-arm), method (*Writer) Err(string) error +pkg log/syslog (freebsd-arm), method (*Writer) Info(string) error +pkg log/syslog (freebsd-arm), method (*Writer) Notice(string) error +pkg log/syslog (freebsd-arm), method (*Writer) Warning(string) error +pkg log/syslog (freebsd-arm), method (*Writer) Write([]uint8) (int, error) +pkg log/syslog (freebsd-arm), type Priority int +pkg log/syslog (freebsd-arm), type Writer struct +pkg log/syslog (freebsd-arm-cgo), const LOG_ALERT Priority +pkg log/syslog (freebsd-arm-cgo), const LOG_AUTH Priority +pkg log/syslog (freebsd-arm-cgo), const LOG_AUTHPRIV Priority +pkg log/syslog (freebsd-arm-cgo), const LOG_CRIT Priority +pkg log/syslog (freebsd-arm-cgo), const LOG_CRON Priority +pkg log/syslog (freebsd-arm-cgo), const LOG_DAEMON Priority +pkg log/syslog (freebsd-arm-cgo), const LOG_DEBUG Priority +pkg log/syslog (freebsd-arm-cgo), const LOG_EMERG Priority +pkg log/syslog (freebsd-arm-cgo), const LOG_ERR Priority +pkg log/syslog (freebsd-arm-cgo), const LOG_FTP Priority +pkg log/syslog (freebsd-arm-cgo), const LOG_INFO Priority +pkg log/syslog (freebsd-arm-cgo), const LOG_KERN Priority +pkg log/syslog (freebsd-arm-cgo), const LOG_LOCAL0 Priority +pkg log/syslog (freebsd-arm-cgo), const LOG_LOCAL1 Priority +pkg log/syslog (freebsd-arm-cgo), const LOG_LOCAL2 Priority +pkg log/syslog (freebsd-arm-cgo), const LOG_LOCAL3 Priority +pkg log/syslog (freebsd-arm-cgo), const LOG_LOCAL4 Priority +pkg log/syslog (freebsd-arm-cgo), const LOG_LOCAL5 Priority +pkg log/syslog (freebsd-arm-cgo), const LOG_LOCAL6 Priority +pkg log/syslog (freebsd-arm-cgo), const LOG_LOCAL7 Priority +pkg log/syslog (freebsd-arm-cgo), const LOG_LPR Priority +pkg log/syslog (freebsd-arm-cgo), const LOG_MAIL Priority +pkg log/syslog (freebsd-arm-cgo), const LOG_NEWS Priority +pkg log/syslog (freebsd-arm-cgo), const LOG_NOTICE Priority +pkg log/syslog (freebsd-arm-cgo), const LOG_SYSLOG Priority +pkg log/syslog (freebsd-arm-cgo), const LOG_USER Priority +pkg log/syslog (freebsd-arm-cgo), const LOG_UUCP Priority +pkg log/syslog (freebsd-arm-cgo), const LOG_WARNING Priority +pkg log/syslog (freebsd-arm-cgo), func Dial(string, string, Priority, string) (*Writer, error) +pkg log/syslog (freebsd-arm-cgo), func New(Priority, string) (*Writer, error) +pkg log/syslog (freebsd-arm-cgo), func NewLogger(Priority, int) (*log.Logger, error) +pkg log/syslog (freebsd-arm-cgo), method (*Writer) Alert(string) error +pkg log/syslog (freebsd-arm-cgo), method (*Writer) Close() error +pkg log/syslog (freebsd-arm-cgo), method (*Writer) Crit(string) error +pkg log/syslog (freebsd-arm-cgo), method (*Writer) Debug(string) error +pkg log/syslog (freebsd-arm-cgo), method (*Writer) Emerg(string) error +pkg log/syslog (freebsd-arm-cgo), method (*Writer) Err(string) error +pkg log/syslog (freebsd-arm-cgo), method (*Writer) Info(string) error +pkg log/syslog (freebsd-arm-cgo), method (*Writer) Notice(string) error +pkg log/syslog (freebsd-arm-cgo), method (*Writer) Warning(string) error +pkg log/syslog (freebsd-arm-cgo), method (*Writer) Write([]uint8) (int, error) +pkg log/syslog (freebsd-arm-cgo), type Priority int +pkg log/syslog (freebsd-arm-cgo), type Writer struct +pkg log/syslog (linux-arm-cgo), const LOG_ALERT Priority +pkg log/syslog (linux-arm-cgo), const LOG_AUTH Priority +pkg log/syslog (linux-arm-cgo), const LOG_AUTHPRIV Priority +pkg log/syslog (linux-arm-cgo), const LOG_CRIT Priority +pkg log/syslog (linux-arm-cgo), const LOG_CRON Priority +pkg log/syslog (linux-arm-cgo), const LOG_DAEMON Priority +pkg log/syslog (linux-arm-cgo), const LOG_DEBUG Priority +pkg log/syslog (linux-arm-cgo), const LOG_EMERG Priority +pkg log/syslog (linux-arm-cgo), const LOG_ERR Priority +pkg log/syslog (linux-arm-cgo), const LOG_FTP Priority +pkg log/syslog (linux-arm-cgo), const LOG_INFO Priority +pkg log/syslog (linux-arm-cgo), const LOG_KERN Priority +pkg log/syslog (linux-arm-cgo), const LOG_LOCAL0 Priority +pkg log/syslog (linux-arm-cgo), const LOG_LOCAL1 Priority +pkg log/syslog (linux-arm-cgo), const LOG_LOCAL2 Priority +pkg log/syslog (linux-arm-cgo), const LOG_LOCAL3 Priority +pkg log/syslog (linux-arm-cgo), const LOG_LOCAL4 Priority +pkg log/syslog (linux-arm-cgo), const LOG_LOCAL5 Priority +pkg log/syslog (linux-arm-cgo), const LOG_LOCAL6 Priority +pkg log/syslog (linux-arm-cgo), const LOG_LOCAL7 Priority +pkg log/syslog (linux-arm-cgo), const LOG_LPR Priority +pkg log/syslog (linux-arm-cgo), const LOG_MAIL Priority +pkg log/syslog (linux-arm-cgo), const LOG_NEWS Priority +pkg log/syslog (linux-arm-cgo), const LOG_NOTICE Priority +pkg log/syslog (linux-arm-cgo), const LOG_SYSLOG Priority +pkg log/syslog (linux-arm-cgo), const LOG_USER Priority +pkg log/syslog (linux-arm-cgo), const LOG_UUCP Priority +pkg log/syslog (linux-arm-cgo), const LOG_WARNING Priority +pkg log/syslog (linux-arm-cgo), func Dial(string, string, Priority, string) (*Writer, error) +pkg log/syslog (linux-arm-cgo), func New(Priority, string) (*Writer, error) +pkg log/syslog (linux-arm-cgo), func NewLogger(Priority, int) (*log.Logger, error) +pkg log/syslog (linux-arm-cgo), method (*Writer) Alert(string) error +pkg log/syslog (linux-arm-cgo), method (*Writer) Close() error +pkg log/syslog (linux-arm-cgo), method (*Writer) Crit(string) error +pkg log/syslog (linux-arm-cgo), method (*Writer) Debug(string) error +pkg log/syslog (linux-arm-cgo), method (*Writer) Emerg(string) error +pkg log/syslog (linux-arm-cgo), method (*Writer) Err(string) error +pkg log/syslog (linux-arm-cgo), method (*Writer) Info(string) error +pkg log/syslog (linux-arm-cgo), method (*Writer) Notice(string) error +pkg log/syslog (linux-arm-cgo), method (*Writer) Warning(string) error +pkg log/syslog (linux-arm-cgo), method (*Writer) Write([]uint8) (int, error) +pkg log/syslog (linux-arm-cgo), type Priority int +pkg log/syslog (linux-arm-cgo), type Writer struct +pkg log/syslog (netbsd-386), const LOG_ALERT Priority +pkg log/syslog (netbsd-386), const LOG_AUTH Priority +pkg log/syslog (netbsd-386), const LOG_AUTHPRIV Priority +pkg log/syslog (netbsd-386), const LOG_CRIT Priority +pkg log/syslog (netbsd-386), const LOG_CRON Priority +pkg log/syslog (netbsd-386), const LOG_DAEMON Priority +pkg log/syslog (netbsd-386), const LOG_DEBUG Priority +pkg log/syslog (netbsd-386), const LOG_EMERG Priority +pkg log/syslog (netbsd-386), const LOG_ERR Priority +pkg log/syslog (netbsd-386), const LOG_FTP Priority +pkg log/syslog (netbsd-386), const LOG_INFO Priority +pkg log/syslog (netbsd-386), const LOG_KERN Priority +pkg log/syslog (netbsd-386), const LOG_LOCAL0 Priority +pkg log/syslog (netbsd-386), const LOG_LOCAL1 Priority +pkg log/syslog (netbsd-386), const LOG_LOCAL2 Priority +pkg log/syslog (netbsd-386), const LOG_LOCAL3 Priority +pkg log/syslog (netbsd-386), const LOG_LOCAL4 Priority +pkg log/syslog (netbsd-386), const LOG_LOCAL5 Priority +pkg log/syslog (netbsd-386), const LOG_LOCAL6 Priority +pkg log/syslog (netbsd-386), const LOG_LOCAL7 Priority +pkg log/syslog (netbsd-386), const LOG_LPR Priority +pkg log/syslog (netbsd-386), const LOG_MAIL Priority +pkg log/syslog (netbsd-386), const LOG_NEWS Priority +pkg log/syslog (netbsd-386), const LOG_NOTICE Priority +pkg log/syslog (netbsd-386), const LOG_SYSLOG Priority +pkg log/syslog (netbsd-386), const LOG_USER Priority +pkg log/syslog (netbsd-386), const LOG_UUCP Priority +pkg log/syslog (netbsd-386), const LOG_WARNING Priority +pkg log/syslog (netbsd-386), func Dial(string, string, Priority, string) (*Writer, error) +pkg log/syslog (netbsd-386), func New(Priority, string) (*Writer, error) +pkg log/syslog (netbsd-386), func NewLogger(Priority, int) (*log.Logger, error) +pkg log/syslog (netbsd-386), method (*Writer) Alert(string) error +pkg log/syslog (netbsd-386), method (*Writer) Close() error +pkg log/syslog (netbsd-386), method (*Writer) Crit(string) error +pkg log/syslog (netbsd-386), method (*Writer) Debug(string) error +pkg log/syslog (netbsd-386), method (*Writer) Emerg(string) error +pkg log/syslog (netbsd-386), method (*Writer) Err(string) error +pkg log/syslog (netbsd-386), method (*Writer) Info(string) error +pkg log/syslog (netbsd-386), method (*Writer) Notice(string) error +pkg log/syslog (netbsd-386), method (*Writer) Warning(string) error +pkg log/syslog (netbsd-386), method (*Writer) Write([]uint8) (int, error) +pkg log/syslog (netbsd-386), type Priority int +pkg log/syslog (netbsd-386), type Writer struct +pkg log/syslog (netbsd-386-cgo), const LOG_ALERT Priority +pkg log/syslog (netbsd-386-cgo), const LOG_AUTH Priority +pkg log/syslog (netbsd-386-cgo), const LOG_AUTHPRIV Priority +pkg log/syslog (netbsd-386-cgo), const LOG_CRIT Priority +pkg log/syslog (netbsd-386-cgo), const LOG_CRON Priority +pkg log/syslog (netbsd-386-cgo), const LOG_DAEMON Priority +pkg log/syslog (netbsd-386-cgo), const LOG_DEBUG Priority +pkg log/syslog (netbsd-386-cgo), const LOG_EMERG Priority +pkg log/syslog (netbsd-386-cgo), const LOG_ERR Priority +pkg log/syslog (netbsd-386-cgo), const LOG_FTP Priority +pkg log/syslog (netbsd-386-cgo), const LOG_INFO Priority +pkg log/syslog (netbsd-386-cgo), const LOG_KERN Priority +pkg log/syslog (netbsd-386-cgo), const LOG_LOCAL0 Priority +pkg log/syslog (netbsd-386-cgo), const LOG_LOCAL1 Priority +pkg log/syslog (netbsd-386-cgo), const LOG_LOCAL2 Priority +pkg log/syslog (netbsd-386-cgo), const LOG_LOCAL3 Priority +pkg log/syslog (netbsd-386-cgo), const LOG_LOCAL4 Priority +pkg log/syslog (netbsd-386-cgo), const LOG_LOCAL5 Priority +pkg log/syslog (netbsd-386-cgo), const LOG_LOCAL6 Priority +pkg log/syslog (netbsd-386-cgo), const LOG_LOCAL7 Priority +pkg log/syslog (netbsd-386-cgo), const LOG_LPR Priority +pkg log/syslog (netbsd-386-cgo), const LOG_MAIL Priority +pkg log/syslog (netbsd-386-cgo), const LOG_NEWS Priority +pkg log/syslog (netbsd-386-cgo), const LOG_NOTICE Priority +pkg log/syslog (netbsd-386-cgo), const LOG_SYSLOG Priority +pkg log/syslog (netbsd-386-cgo), const LOG_USER Priority +pkg log/syslog (netbsd-386-cgo), const LOG_UUCP Priority +pkg log/syslog (netbsd-386-cgo), const LOG_WARNING Priority +pkg log/syslog (netbsd-386-cgo), func Dial(string, string, Priority, string) (*Writer, error) +pkg log/syslog (netbsd-386-cgo), func New(Priority, string) (*Writer, error) +pkg log/syslog (netbsd-386-cgo), func NewLogger(Priority, int) (*log.Logger, error) +pkg log/syslog (netbsd-386-cgo), method (*Writer) Alert(string) error +pkg log/syslog (netbsd-386-cgo), method (*Writer) Close() error +pkg log/syslog (netbsd-386-cgo), method (*Writer) Crit(string) error +pkg log/syslog (netbsd-386-cgo), method (*Writer) Debug(string) error +pkg log/syslog (netbsd-386-cgo), method (*Writer) Emerg(string) error +pkg log/syslog (netbsd-386-cgo), method (*Writer) Err(string) error +pkg log/syslog (netbsd-386-cgo), method (*Writer) Info(string) error +pkg log/syslog (netbsd-386-cgo), method (*Writer) Notice(string) error +pkg log/syslog (netbsd-386-cgo), method (*Writer) Warning(string) error +pkg log/syslog (netbsd-386-cgo), method (*Writer) Write([]uint8) (int, error) +pkg log/syslog (netbsd-386-cgo), type Priority int +pkg log/syslog (netbsd-386-cgo), type Writer struct +pkg log/syslog (netbsd-amd64), const LOG_ALERT Priority +pkg log/syslog (netbsd-amd64), const LOG_AUTH Priority +pkg log/syslog (netbsd-amd64), const LOG_AUTHPRIV Priority +pkg log/syslog (netbsd-amd64), const LOG_CRIT Priority +pkg log/syslog (netbsd-amd64), const LOG_CRON Priority +pkg log/syslog (netbsd-amd64), const LOG_DAEMON Priority +pkg log/syslog (netbsd-amd64), const LOG_DEBUG Priority +pkg log/syslog (netbsd-amd64), const LOG_EMERG Priority +pkg log/syslog (netbsd-amd64), const LOG_ERR Priority +pkg log/syslog (netbsd-amd64), const LOG_FTP Priority +pkg log/syslog (netbsd-amd64), const LOG_INFO Priority +pkg log/syslog (netbsd-amd64), const LOG_KERN Priority +pkg log/syslog (netbsd-amd64), const LOG_LOCAL0 Priority +pkg log/syslog (netbsd-amd64), const LOG_LOCAL1 Priority +pkg log/syslog (netbsd-amd64), const LOG_LOCAL2 Priority +pkg log/syslog (netbsd-amd64), const LOG_LOCAL3 Priority +pkg log/syslog (netbsd-amd64), const LOG_LOCAL4 Priority +pkg log/syslog (netbsd-amd64), const LOG_LOCAL5 Priority +pkg log/syslog (netbsd-amd64), const LOG_LOCAL6 Priority +pkg log/syslog (netbsd-amd64), const LOG_LOCAL7 Priority +pkg log/syslog (netbsd-amd64), const LOG_LPR Priority +pkg log/syslog (netbsd-amd64), const LOG_MAIL Priority +pkg log/syslog (netbsd-amd64), const LOG_NEWS Priority +pkg log/syslog (netbsd-amd64), const LOG_NOTICE Priority +pkg log/syslog (netbsd-amd64), const LOG_SYSLOG Priority +pkg log/syslog (netbsd-amd64), const LOG_USER Priority +pkg log/syslog (netbsd-amd64), const LOG_UUCP Priority +pkg log/syslog (netbsd-amd64), const LOG_WARNING Priority +pkg log/syslog (netbsd-amd64), func Dial(string, string, Priority, string) (*Writer, error) +pkg log/syslog (netbsd-amd64), func New(Priority, string) (*Writer, error) +pkg log/syslog (netbsd-amd64), func NewLogger(Priority, int) (*log.Logger, error) +pkg log/syslog (netbsd-amd64), method (*Writer) Alert(string) error +pkg log/syslog (netbsd-amd64), method (*Writer) Close() error +pkg log/syslog (netbsd-amd64), method (*Writer) Crit(string) error +pkg log/syslog (netbsd-amd64), method (*Writer) Debug(string) error +pkg log/syslog (netbsd-amd64), method (*Writer) Emerg(string) error +pkg log/syslog (netbsd-amd64), method (*Writer) Err(string) error +pkg log/syslog (netbsd-amd64), method (*Writer) Info(string) error +pkg log/syslog (netbsd-amd64), method (*Writer) Notice(string) error +pkg log/syslog (netbsd-amd64), method (*Writer) Warning(string) error +pkg log/syslog (netbsd-amd64), method (*Writer) Write([]uint8) (int, error) +pkg log/syslog (netbsd-amd64), type Priority int +pkg log/syslog (netbsd-amd64), type Writer struct +pkg log/syslog (netbsd-amd64-cgo), const LOG_ALERT Priority +pkg log/syslog (netbsd-amd64-cgo), const LOG_AUTH Priority +pkg log/syslog (netbsd-amd64-cgo), const LOG_AUTHPRIV Priority +pkg log/syslog (netbsd-amd64-cgo), const LOG_CRIT Priority +pkg log/syslog (netbsd-amd64-cgo), const LOG_CRON Priority +pkg log/syslog (netbsd-amd64-cgo), const LOG_DAEMON Priority +pkg log/syslog (netbsd-amd64-cgo), const LOG_DEBUG Priority +pkg log/syslog (netbsd-amd64-cgo), const LOG_EMERG Priority +pkg log/syslog (netbsd-amd64-cgo), const LOG_ERR Priority +pkg log/syslog (netbsd-amd64-cgo), const LOG_FTP Priority +pkg log/syslog (netbsd-amd64-cgo), const LOG_INFO Priority +pkg log/syslog (netbsd-amd64-cgo), const LOG_KERN Priority +pkg log/syslog (netbsd-amd64-cgo), const LOG_LOCAL0 Priority +pkg log/syslog (netbsd-amd64-cgo), const LOG_LOCAL1 Priority +pkg log/syslog (netbsd-amd64-cgo), const LOG_LOCAL2 Priority +pkg log/syslog (netbsd-amd64-cgo), const LOG_LOCAL3 Priority +pkg log/syslog (netbsd-amd64-cgo), const LOG_LOCAL4 Priority +pkg log/syslog (netbsd-amd64-cgo), const LOG_LOCAL5 Priority +pkg log/syslog (netbsd-amd64-cgo), const LOG_LOCAL6 Priority +pkg log/syslog (netbsd-amd64-cgo), const LOG_LOCAL7 Priority +pkg log/syslog (netbsd-amd64-cgo), const LOG_LPR Priority +pkg log/syslog (netbsd-amd64-cgo), const LOG_MAIL Priority +pkg log/syslog (netbsd-amd64-cgo), const LOG_NEWS Priority +pkg log/syslog (netbsd-amd64-cgo), const LOG_NOTICE Priority +pkg log/syslog (netbsd-amd64-cgo), const LOG_SYSLOG Priority +pkg log/syslog (netbsd-amd64-cgo), const LOG_USER Priority +pkg log/syslog (netbsd-amd64-cgo), const LOG_UUCP Priority +pkg log/syslog (netbsd-amd64-cgo), const LOG_WARNING Priority +pkg log/syslog (netbsd-amd64-cgo), func Dial(string, string, Priority, string) (*Writer, error) +pkg log/syslog (netbsd-amd64-cgo), func New(Priority, string) (*Writer, error) +pkg log/syslog (netbsd-amd64-cgo), func NewLogger(Priority, int) (*log.Logger, error) +pkg log/syslog (netbsd-amd64-cgo), method (*Writer) Alert(string) error +pkg log/syslog (netbsd-amd64-cgo), method (*Writer) Close() error +pkg log/syslog (netbsd-amd64-cgo), method (*Writer) Crit(string) error +pkg log/syslog (netbsd-amd64-cgo), method (*Writer) Debug(string) error +pkg log/syslog (netbsd-amd64-cgo), method (*Writer) Emerg(string) error +pkg log/syslog (netbsd-amd64-cgo), method (*Writer) Err(string) error +pkg log/syslog (netbsd-amd64-cgo), method (*Writer) Info(string) error +pkg log/syslog (netbsd-amd64-cgo), method (*Writer) Notice(string) error +pkg log/syslog (netbsd-amd64-cgo), method (*Writer) Warning(string) error +pkg log/syslog (netbsd-amd64-cgo), method (*Writer) Write([]uint8) (int, error) +pkg log/syslog (netbsd-amd64-cgo), type Priority int +pkg log/syslog (netbsd-amd64-cgo), type Writer struct +pkg log/syslog (netbsd-arm), const LOG_ALERT Priority +pkg log/syslog (netbsd-arm), const LOG_AUTH Priority +pkg log/syslog (netbsd-arm), const LOG_AUTHPRIV Priority +pkg log/syslog (netbsd-arm), const LOG_CRIT Priority +pkg log/syslog (netbsd-arm), const LOG_CRON Priority +pkg log/syslog (netbsd-arm), const LOG_DAEMON Priority +pkg log/syslog (netbsd-arm), const LOG_DEBUG Priority +pkg log/syslog (netbsd-arm), const LOG_EMERG Priority +pkg log/syslog (netbsd-arm), const LOG_ERR Priority +pkg log/syslog (netbsd-arm), const LOG_FTP Priority +pkg log/syslog (netbsd-arm), const LOG_INFO Priority +pkg log/syslog (netbsd-arm), const LOG_KERN Priority +pkg log/syslog (netbsd-arm), const LOG_LOCAL0 Priority +pkg log/syslog (netbsd-arm), const LOG_LOCAL1 Priority +pkg log/syslog (netbsd-arm), const LOG_LOCAL2 Priority +pkg log/syslog (netbsd-arm), const LOG_LOCAL3 Priority +pkg log/syslog (netbsd-arm), const LOG_LOCAL4 Priority +pkg log/syslog (netbsd-arm), const LOG_LOCAL5 Priority +pkg log/syslog (netbsd-arm), const LOG_LOCAL6 Priority +pkg log/syslog (netbsd-arm), const LOG_LOCAL7 Priority +pkg log/syslog (netbsd-arm), const LOG_LPR Priority +pkg log/syslog (netbsd-arm), const LOG_MAIL Priority +pkg log/syslog (netbsd-arm), const LOG_NEWS Priority +pkg log/syslog (netbsd-arm), const LOG_NOTICE Priority +pkg log/syslog (netbsd-arm), const LOG_SYSLOG Priority +pkg log/syslog (netbsd-arm), const LOG_USER Priority +pkg log/syslog (netbsd-arm), const LOG_UUCP Priority +pkg log/syslog (netbsd-arm), const LOG_WARNING Priority +pkg log/syslog (netbsd-arm), func Dial(string, string, Priority, string) (*Writer, error) +pkg log/syslog (netbsd-arm), func New(Priority, string) (*Writer, error) +pkg log/syslog (netbsd-arm), func NewLogger(Priority, int) (*log.Logger, error) +pkg log/syslog (netbsd-arm), method (*Writer) Alert(string) error +pkg log/syslog (netbsd-arm), method (*Writer) Close() error +pkg log/syslog (netbsd-arm), method (*Writer) Crit(string) error +pkg log/syslog (netbsd-arm), method (*Writer) Debug(string) error +pkg log/syslog (netbsd-arm), method (*Writer) Emerg(string) error +pkg log/syslog (netbsd-arm), method (*Writer) Err(string) error +pkg log/syslog (netbsd-arm), method (*Writer) Info(string) error +pkg log/syslog (netbsd-arm), method (*Writer) Notice(string) error +pkg log/syslog (netbsd-arm), method (*Writer) Warning(string) error +pkg log/syslog (netbsd-arm), method (*Writer) Write([]uint8) (int, error) +pkg log/syslog (netbsd-arm), type Priority int +pkg log/syslog (netbsd-arm), type Writer struct +pkg log/syslog (netbsd-arm-cgo), const LOG_ALERT Priority +pkg log/syslog (netbsd-arm-cgo), const LOG_AUTH Priority +pkg log/syslog (netbsd-arm-cgo), const LOG_AUTHPRIV Priority +pkg log/syslog (netbsd-arm-cgo), const LOG_CRIT Priority +pkg log/syslog (netbsd-arm-cgo), const LOG_CRON Priority +pkg log/syslog (netbsd-arm-cgo), const LOG_DAEMON Priority +pkg log/syslog (netbsd-arm-cgo), const LOG_DEBUG Priority +pkg log/syslog (netbsd-arm-cgo), const LOG_EMERG Priority +pkg log/syslog (netbsd-arm-cgo), const LOG_ERR Priority +pkg log/syslog (netbsd-arm-cgo), const LOG_FTP Priority +pkg log/syslog (netbsd-arm-cgo), const LOG_INFO Priority +pkg log/syslog (netbsd-arm-cgo), const LOG_KERN Priority +pkg log/syslog (netbsd-arm-cgo), const LOG_LOCAL0 Priority +pkg log/syslog (netbsd-arm-cgo), const LOG_LOCAL1 Priority +pkg log/syslog (netbsd-arm-cgo), const LOG_LOCAL2 Priority +pkg log/syslog (netbsd-arm-cgo), const LOG_LOCAL3 Priority +pkg log/syslog (netbsd-arm-cgo), const LOG_LOCAL4 Priority +pkg log/syslog (netbsd-arm-cgo), const LOG_LOCAL5 Priority +pkg log/syslog (netbsd-arm-cgo), const LOG_LOCAL6 Priority +pkg log/syslog (netbsd-arm-cgo), const LOG_LOCAL7 Priority +pkg log/syslog (netbsd-arm-cgo), const LOG_LPR Priority +pkg log/syslog (netbsd-arm-cgo), const LOG_MAIL Priority +pkg log/syslog (netbsd-arm-cgo), const LOG_NEWS Priority +pkg log/syslog (netbsd-arm-cgo), const LOG_NOTICE Priority +pkg log/syslog (netbsd-arm-cgo), const LOG_SYSLOG Priority +pkg log/syslog (netbsd-arm-cgo), const LOG_USER Priority +pkg log/syslog (netbsd-arm-cgo), const LOG_UUCP Priority +pkg log/syslog (netbsd-arm-cgo), const LOG_WARNING Priority +pkg log/syslog (netbsd-arm-cgo), func Dial(string, string, Priority, string) (*Writer, error) +pkg log/syslog (netbsd-arm-cgo), func New(Priority, string) (*Writer, error) +pkg log/syslog (netbsd-arm-cgo), func NewLogger(Priority, int) (*log.Logger, error) +pkg log/syslog (netbsd-arm-cgo), method (*Writer) Alert(string) error +pkg log/syslog (netbsd-arm-cgo), method (*Writer) Close() error +pkg log/syslog (netbsd-arm-cgo), method (*Writer) Crit(string) error +pkg log/syslog (netbsd-arm-cgo), method (*Writer) Debug(string) error +pkg log/syslog (netbsd-arm-cgo), method (*Writer) Emerg(string) error +pkg log/syslog (netbsd-arm-cgo), method (*Writer) Err(string) error +pkg log/syslog (netbsd-arm-cgo), method (*Writer) Info(string) error +pkg log/syslog (netbsd-arm-cgo), method (*Writer) Notice(string) error +pkg log/syslog (netbsd-arm-cgo), method (*Writer) Warning(string) error +pkg log/syslog (netbsd-arm-cgo), method (*Writer) Write([]uint8) (int, error) +pkg log/syslog (netbsd-arm-cgo), type Priority int +pkg log/syslog (netbsd-arm-cgo), type Writer struct +pkg log/syslog (openbsd-386), const LOG_ALERT Priority +pkg log/syslog (openbsd-386), const LOG_AUTH Priority +pkg log/syslog (openbsd-386), const LOG_AUTHPRIV Priority +pkg log/syslog (openbsd-386), const LOG_CRIT Priority +pkg log/syslog (openbsd-386), const LOG_CRON Priority +pkg log/syslog (openbsd-386), const LOG_DAEMON Priority +pkg log/syslog (openbsd-386), const LOG_DEBUG Priority +pkg log/syslog (openbsd-386), const LOG_EMERG Priority +pkg log/syslog (openbsd-386), const LOG_ERR Priority +pkg log/syslog (openbsd-386), const LOG_FTP Priority +pkg log/syslog (openbsd-386), const LOG_INFO Priority +pkg log/syslog (openbsd-386), const LOG_KERN Priority +pkg log/syslog (openbsd-386), const LOG_LOCAL0 Priority +pkg log/syslog (openbsd-386), const LOG_LOCAL1 Priority +pkg log/syslog (openbsd-386), const LOG_LOCAL2 Priority +pkg log/syslog (openbsd-386), const LOG_LOCAL3 Priority +pkg log/syslog (openbsd-386), const LOG_LOCAL4 Priority +pkg log/syslog (openbsd-386), const LOG_LOCAL5 Priority +pkg log/syslog (openbsd-386), const LOG_LOCAL6 Priority +pkg log/syslog (openbsd-386), const LOG_LOCAL7 Priority +pkg log/syslog (openbsd-386), const LOG_LPR Priority +pkg log/syslog (openbsd-386), const LOG_MAIL Priority +pkg log/syslog (openbsd-386), const LOG_NEWS Priority +pkg log/syslog (openbsd-386), const LOG_NOTICE Priority +pkg log/syslog (openbsd-386), const LOG_SYSLOG Priority +pkg log/syslog (openbsd-386), const LOG_USER Priority +pkg log/syslog (openbsd-386), const LOG_UUCP Priority +pkg log/syslog (openbsd-386), const LOG_WARNING Priority +pkg log/syslog (openbsd-386), func Dial(string, string, Priority, string) (*Writer, error) +pkg log/syslog (openbsd-386), func New(Priority, string) (*Writer, error) +pkg log/syslog (openbsd-386), func NewLogger(Priority, int) (*log.Logger, error) +pkg log/syslog (openbsd-386), method (*Writer) Alert(string) error +pkg log/syslog (openbsd-386), method (*Writer) Close() error +pkg log/syslog (openbsd-386), method (*Writer) Crit(string) error +pkg log/syslog (openbsd-386), method (*Writer) Debug(string) error +pkg log/syslog (openbsd-386), method (*Writer) Emerg(string) error +pkg log/syslog (openbsd-386), method (*Writer) Err(string) error +pkg log/syslog (openbsd-386), method (*Writer) Info(string) error +pkg log/syslog (openbsd-386), method (*Writer) Notice(string) error +pkg log/syslog (openbsd-386), method (*Writer) Warning(string) error +pkg log/syslog (openbsd-386), method (*Writer) Write([]uint8) (int, error) +pkg log/syslog (openbsd-386), type Priority int +pkg log/syslog (openbsd-386), type Writer struct +pkg log/syslog (openbsd-386-cgo), const LOG_ALERT Priority +pkg log/syslog (openbsd-386-cgo), const LOG_AUTH Priority +pkg log/syslog (openbsd-386-cgo), const LOG_AUTHPRIV Priority +pkg log/syslog (openbsd-386-cgo), const LOG_CRIT Priority +pkg log/syslog (openbsd-386-cgo), const LOG_CRON Priority +pkg log/syslog (openbsd-386-cgo), const LOG_DAEMON Priority +pkg log/syslog (openbsd-386-cgo), const LOG_DEBUG Priority +pkg log/syslog (openbsd-386-cgo), const LOG_EMERG Priority +pkg log/syslog (openbsd-386-cgo), const LOG_ERR Priority +pkg log/syslog (openbsd-386-cgo), const LOG_FTP Priority +pkg log/syslog (openbsd-386-cgo), const LOG_INFO Priority +pkg log/syslog (openbsd-386-cgo), const LOG_KERN Priority +pkg log/syslog (openbsd-386-cgo), const LOG_LOCAL0 Priority +pkg log/syslog (openbsd-386-cgo), const LOG_LOCAL1 Priority +pkg log/syslog (openbsd-386-cgo), const LOG_LOCAL2 Priority +pkg log/syslog (openbsd-386-cgo), const LOG_LOCAL3 Priority +pkg log/syslog (openbsd-386-cgo), const LOG_LOCAL4 Priority +pkg log/syslog (openbsd-386-cgo), const LOG_LOCAL5 Priority +pkg log/syslog (openbsd-386-cgo), const LOG_LOCAL6 Priority +pkg log/syslog (openbsd-386-cgo), const LOG_LOCAL7 Priority +pkg log/syslog (openbsd-386-cgo), const LOG_LPR Priority +pkg log/syslog (openbsd-386-cgo), const LOG_MAIL Priority +pkg log/syslog (openbsd-386-cgo), const LOG_NEWS Priority +pkg log/syslog (openbsd-386-cgo), const LOG_NOTICE Priority +pkg log/syslog (openbsd-386-cgo), const LOG_SYSLOG Priority +pkg log/syslog (openbsd-386-cgo), const LOG_USER Priority +pkg log/syslog (openbsd-386-cgo), const LOG_UUCP Priority +pkg log/syslog (openbsd-386-cgo), const LOG_WARNING Priority +pkg log/syslog (openbsd-386-cgo), func Dial(string, string, Priority, string) (*Writer, error) +pkg log/syslog (openbsd-386-cgo), func New(Priority, string) (*Writer, error) +pkg log/syslog (openbsd-386-cgo), func NewLogger(Priority, int) (*log.Logger, error) +pkg log/syslog (openbsd-386-cgo), method (*Writer) Alert(string) error +pkg log/syslog (openbsd-386-cgo), method (*Writer) Close() error +pkg log/syslog (openbsd-386-cgo), method (*Writer) Crit(string) error +pkg log/syslog (openbsd-386-cgo), method (*Writer) Debug(string) error +pkg log/syslog (openbsd-386-cgo), method (*Writer) Emerg(string) error +pkg log/syslog (openbsd-386-cgo), method (*Writer) Err(string) error +pkg log/syslog (openbsd-386-cgo), method (*Writer) Info(string) error +pkg log/syslog (openbsd-386-cgo), method (*Writer) Notice(string) error +pkg log/syslog (openbsd-386-cgo), method (*Writer) Warning(string) error +pkg log/syslog (openbsd-386-cgo), method (*Writer) Write([]uint8) (int, error) +pkg log/syslog (openbsd-386-cgo), type Priority int +pkg log/syslog (openbsd-386-cgo), type Writer struct +pkg log/syslog (openbsd-amd64), const LOG_ALERT Priority +pkg log/syslog (openbsd-amd64), const LOG_AUTH Priority +pkg log/syslog (openbsd-amd64), const LOG_AUTHPRIV Priority +pkg log/syslog (openbsd-amd64), const LOG_CRIT Priority +pkg log/syslog (openbsd-amd64), const LOG_CRON Priority +pkg log/syslog (openbsd-amd64), const LOG_DAEMON Priority +pkg log/syslog (openbsd-amd64), const LOG_DEBUG Priority +pkg log/syslog (openbsd-amd64), const LOG_EMERG Priority +pkg log/syslog (openbsd-amd64), const LOG_ERR Priority +pkg log/syslog (openbsd-amd64), const LOG_FTP Priority +pkg log/syslog (openbsd-amd64), const LOG_INFO Priority +pkg log/syslog (openbsd-amd64), const LOG_KERN Priority +pkg log/syslog (openbsd-amd64), const LOG_LOCAL0 Priority +pkg log/syslog (openbsd-amd64), const LOG_LOCAL1 Priority +pkg log/syslog (openbsd-amd64), const LOG_LOCAL2 Priority +pkg log/syslog (openbsd-amd64), const LOG_LOCAL3 Priority +pkg log/syslog (openbsd-amd64), const LOG_LOCAL4 Priority +pkg log/syslog (openbsd-amd64), const LOG_LOCAL5 Priority +pkg log/syslog (openbsd-amd64), const LOG_LOCAL6 Priority +pkg log/syslog (openbsd-amd64), const LOG_LOCAL7 Priority +pkg log/syslog (openbsd-amd64), const LOG_LPR Priority +pkg log/syslog (openbsd-amd64), const LOG_MAIL Priority +pkg log/syslog (openbsd-amd64), const LOG_NEWS Priority +pkg log/syslog (openbsd-amd64), const LOG_NOTICE Priority +pkg log/syslog (openbsd-amd64), const LOG_SYSLOG Priority +pkg log/syslog (openbsd-amd64), const LOG_USER Priority +pkg log/syslog (openbsd-amd64), const LOG_UUCP Priority +pkg log/syslog (openbsd-amd64), const LOG_WARNING Priority +pkg log/syslog (openbsd-amd64), func Dial(string, string, Priority, string) (*Writer, error) +pkg log/syslog (openbsd-amd64), func New(Priority, string) (*Writer, error) +pkg log/syslog (openbsd-amd64), func NewLogger(Priority, int) (*log.Logger, error) +pkg log/syslog (openbsd-amd64), method (*Writer) Alert(string) error +pkg log/syslog (openbsd-amd64), method (*Writer) Close() error +pkg log/syslog (openbsd-amd64), method (*Writer) Crit(string) error +pkg log/syslog (openbsd-amd64), method (*Writer) Debug(string) error +pkg log/syslog (openbsd-amd64), method (*Writer) Emerg(string) error +pkg log/syslog (openbsd-amd64), method (*Writer) Err(string) error +pkg log/syslog (openbsd-amd64), method (*Writer) Info(string) error +pkg log/syslog (openbsd-amd64), method (*Writer) Notice(string) error +pkg log/syslog (openbsd-amd64), method (*Writer) Warning(string) error +pkg log/syslog (openbsd-amd64), method (*Writer) Write([]uint8) (int, error) +pkg log/syslog (openbsd-amd64), type Priority int +pkg log/syslog (openbsd-amd64), type Writer struct +pkg log/syslog (openbsd-amd64-cgo), const LOG_ALERT Priority +pkg log/syslog (openbsd-amd64-cgo), const LOG_AUTH Priority +pkg log/syslog (openbsd-amd64-cgo), const LOG_AUTHPRIV Priority +pkg log/syslog (openbsd-amd64-cgo), const LOG_CRIT Priority +pkg log/syslog (openbsd-amd64-cgo), const LOG_CRON Priority +pkg log/syslog (openbsd-amd64-cgo), const LOG_DAEMON Priority +pkg log/syslog (openbsd-amd64-cgo), const LOG_DEBUG Priority +pkg log/syslog (openbsd-amd64-cgo), const LOG_EMERG Priority +pkg log/syslog (openbsd-amd64-cgo), const LOG_ERR Priority +pkg log/syslog (openbsd-amd64-cgo), const LOG_FTP Priority +pkg log/syslog (openbsd-amd64-cgo), const LOG_INFO Priority +pkg log/syslog (openbsd-amd64-cgo), const LOG_KERN Priority +pkg log/syslog (openbsd-amd64-cgo), const LOG_LOCAL0 Priority +pkg log/syslog (openbsd-amd64-cgo), const LOG_LOCAL1 Priority +pkg log/syslog (openbsd-amd64-cgo), const LOG_LOCAL2 Priority +pkg log/syslog (openbsd-amd64-cgo), const LOG_LOCAL3 Priority +pkg log/syslog (openbsd-amd64-cgo), const LOG_LOCAL4 Priority +pkg log/syslog (openbsd-amd64-cgo), const LOG_LOCAL5 Priority +pkg log/syslog (openbsd-amd64-cgo), const LOG_LOCAL6 Priority +pkg log/syslog (openbsd-amd64-cgo), const LOG_LOCAL7 Priority +pkg log/syslog (openbsd-amd64-cgo), const LOG_LPR Priority +pkg log/syslog (openbsd-amd64-cgo), const LOG_MAIL Priority +pkg log/syslog (openbsd-amd64-cgo), const LOG_NEWS Priority +pkg log/syslog (openbsd-amd64-cgo), const LOG_NOTICE Priority +pkg log/syslog (openbsd-amd64-cgo), const LOG_SYSLOG Priority +pkg log/syslog (openbsd-amd64-cgo), const LOG_USER Priority +pkg log/syslog (openbsd-amd64-cgo), const LOG_UUCP Priority +pkg log/syslog (openbsd-amd64-cgo), const LOG_WARNING Priority +pkg log/syslog (openbsd-amd64-cgo), func Dial(string, string, Priority, string) (*Writer, error) +pkg log/syslog (openbsd-amd64-cgo), func New(Priority, string) (*Writer, error) +pkg log/syslog (openbsd-amd64-cgo), func NewLogger(Priority, int) (*log.Logger, error) +pkg log/syslog (openbsd-amd64-cgo), method (*Writer) Alert(string) error +pkg log/syslog (openbsd-amd64-cgo), method (*Writer) Close() error +pkg log/syslog (openbsd-amd64-cgo), method (*Writer) Crit(string) error +pkg log/syslog (openbsd-amd64-cgo), method (*Writer) Debug(string) error +pkg log/syslog (openbsd-amd64-cgo), method (*Writer) Emerg(string) error +pkg log/syslog (openbsd-amd64-cgo), method (*Writer) Err(string) error +pkg log/syslog (openbsd-amd64-cgo), method (*Writer) Info(string) error +pkg log/syslog (openbsd-amd64-cgo), method (*Writer) Notice(string) error +pkg log/syslog (openbsd-amd64-cgo), method (*Writer) Warning(string) error +pkg log/syslog (openbsd-amd64-cgo), method (*Writer) Write([]uint8) (int, error) +pkg log/syslog (openbsd-amd64-cgo), type Priority int +pkg log/syslog (openbsd-amd64-cgo), type Writer struct +pkg net, method (*IP) UnmarshalText([]uint8) error +pkg net, method (*TCPConn) SetKeepAlivePeriod(time.Duration) error +pkg net, method (IP) MarshalText() ([]uint8, error) +pkg net, type Dialer struct, DualStack bool +pkg net/smtp, method (*Client) Close() error +pkg os (linux-arm), const O_SYNC = 1052672 +pkg os (linux-arm-cgo), const O_SYNC = 1052672 +pkg reflect, method (Value) SetCap(int) +pkg reflect, method (Value) Slice3(int, int, int) Value +pkg runtime, type MemStats struct, GCSys uint64 +pkg runtime, type MemStats struct, OtherSys uint64 +pkg runtime/debug, func SetMaxStack(int) int +pkg runtime/debug, func SetMaxThreads(int) int +pkg sort, func Stable(Interface) +pkg strings, func IndexByte(string, uint8) int +pkg sync/atomic, func SwapInt32(*int32, int32) int32 +pkg sync/atomic, func SwapInt64(*int64, int64) int64 +pkg sync/atomic, func SwapPointer(*unsafe.Pointer, unsafe.Pointer) unsafe.Pointer +pkg sync/atomic, func SwapUint32(*uint32, uint32) uint32 +pkg sync/atomic, func SwapUint64(*uint64, uint64) uint64 +pkg sync/atomic, func SwapUintptr(*uintptr, uintptr) uintptr +pkg syscall (darwin-386), const ICMP6_FILTER = 18 +pkg syscall (darwin-386), const ICMP6_FILTER ideal-int +pkg syscall (darwin-386), const ImplementsGetwd = true +pkg syscall (darwin-386), const PRIO_PGRP = 1 +pkg syscall (darwin-386), const PRIO_PGRP ideal-int +pkg syscall (darwin-386), const PRIO_PROCESS = 0 +pkg syscall (darwin-386), const PRIO_PROCESS ideal-int +pkg syscall (darwin-386), const PRIO_USER = 2 +pkg syscall (darwin-386), const PRIO_USER ideal-int +pkg syscall (darwin-386), const SizeofICMPv6Filter = 32 +pkg syscall (darwin-386), const SizeofICMPv6Filter ideal-int +pkg syscall (darwin-386), const SizeofIPv6MTUInfo = 32 +pkg syscall (darwin-386), const SizeofIPv6MTUInfo ideal-int +pkg syscall (darwin-386), func GetsockoptICMPv6Filter(int, int, int) (*ICMPv6Filter, error) +pkg syscall (darwin-386), func GetsockoptIPv6MTUInfo(int, int, int) (*IPv6MTUInfo, error) +pkg syscall (darwin-386), func SetsockoptICMPv6Filter(int, int, int, *ICMPv6Filter) error +pkg syscall (darwin-386), type ICMPv6Filter struct +pkg syscall (darwin-386), type ICMPv6Filter struct, Filt [8]uint32 +pkg syscall (darwin-386), type IPv6MTUInfo struct +pkg syscall (darwin-386), type IPv6MTUInfo struct, Addr RawSockaddrInet6 +pkg syscall (darwin-386), type IPv6MTUInfo struct, Mtu uint32 +pkg syscall (darwin-386-cgo), const ICMP6_FILTER = 18 +pkg syscall (darwin-386-cgo), const ICMP6_FILTER ideal-int +pkg syscall (darwin-386-cgo), const ImplementsGetwd = true +pkg syscall (darwin-386-cgo), const PRIO_PGRP = 1 +pkg syscall (darwin-386-cgo), const PRIO_PGRP ideal-int +pkg syscall (darwin-386-cgo), const PRIO_PROCESS = 0 +pkg syscall (darwin-386-cgo), const PRIO_PROCESS ideal-int +pkg syscall (darwin-386-cgo), const PRIO_USER = 2 +pkg syscall (darwin-386-cgo), const PRIO_USER ideal-int +pkg syscall (darwin-386-cgo), const SizeofICMPv6Filter = 32 +pkg syscall (darwin-386-cgo), const SizeofICMPv6Filter ideal-int +pkg syscall (darwin-386-cgo), const SizeofIPv6MTUInfo = 32 +pkg syscall (darwin-386-cgo), const SizeofIPv6MTUInfo ideal-int +pkg syscall (darwin-386-cgo), func GetsockoptICMPv6Filter(int, int, int) (*ICMPv6Filter, error) +pkg syscall (darwin-386-cgo), func GetsockoptIPv6MTUInfo(int, int, int) (*IPv6MTUInfo, error) +pkg syscall (darwin-386-cgo), func SetsockoptICMPv6Filter(int, int, int, *ICMPv6Filter) error +pkg syscall (darwin-386-cgo), type ICMPv6Filter struct +pkg syscall (darwin-386-cgo), type ICMPv6Filter struct, Filt [8]uint32 +pkg syscall (darwin-386-cgo), type IPv6MTUInfo struct +pkg syscall (darwin-386-cgo), type IPv6MTUInfo struct, Addr RawSockaddrInet6 +pkg syscall (darwin-386-cgo), type IPv6MTUInfo struct, Mtu uint32 +pkg syscall (darwin-amd64), const ICMP6_FILTER = 18 +pkg syscall (darwin-amd64), const ICMP6_FILTER ideal-int +pkg syscall (darwin-amd64), const ImplementsGetwd = true +pkg syscall (darwin-amd64), const PRIO_PGRP = 1 +pkg syscall (darwin-amd64), const PRIO_PGRP ideal-int +pkg syscall (darwin-amd64), const PRIO_PROCESS = 0 +pkg syscall (darwin-amd64), const PRIO_PROCESS ideal-int +pkg syscall (darwin-amd64), const PRIO_USER = 2 +pkg syscall (darwin-amd64), const PRIO_USER ideal-int +pkg syscall (darwin-amd64), const SizeofICMPv6Filter = 32 +pkg syscall (darwin-amd64), const SizeofICMPv6Filter ideal-int +pkg syscall (darwin-amd64), const SizeofIPv6MTUInfo = 32 +pkg syscall (darwin-amd64), const SizeofIPv6MTUInfo ideal-int +pkg syscall (darwin-amd64), func GetsockoptICMPv6Filter(int, int, int) (*ICMPv6Filter, error) +pkg syscall (darwin-amd64), func GetsockoptIPv6MTUInfo(int, int, int) (*IPv6MTUInfo, error) +pkg syscall (darwin-amd64), func SetsockoptICMPv6Filter(int, int, int, *ICMPv6Filter) error +pkg syscall (darwin-amd64), func Syscall9(uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno) +pkg syscall (darwin-amd64), type ICMPv6Filter struct +pkg syscall (darwin-amd64), type ICMPv6Filter struct, Filt [8]uint32 +pkg syscall (darwin-amd64), type IPv6MTUInfo struct +pkg syscall (darwin-amd64), type IPv6MTUInfo struct, Addr RawSockaddrInet6 +pkg syscall (darwin-amd64), type IPv6MTUInfo struct, Mtu uint32 +pkg syscall (darwin-amd64-cgo), const ICMP6_FILTER = 18 +pkg syscall (darwin-amd64-cgo), const ICMP6_FILTER ideal-int +pkg syscall (darwin-amd64-cgo), const ImplementsGetwd = true +pkg syscall (darwin-amd64-cgo), const PRIO_PGRP = 1 +pkg syscall (darwin-amd64-cgo), const PRIO_PGRP ideal-int +pkg syscall (darwin-amd64-cgo), const PRIO_PROCESS = 0 +pkg syscall (darwin-amd64-cgo), const PRIO_PROCESS ideal-int +pkg syscall (darwin-amd64-cgo), const PRIO_USER = 2 +pkg syscall (darwin-amd64-cgo), const PRIO_USER ideal-int +pkg syscall (darwin-amd64-cgo), const SizeofICMPv6Filter = 32 +pkg syscall (darwin-amd64-cgo), const SizeofICMPv6Filter ideal-int +pkg syscall (darwin-amd64-cgo), const SizeofIPv6MTUInfo = 32 +pkg syscall (darwin-amd64-cgo), const SizeofIPv6MTUInfo ideal-int +pkg syscall (darwin-amd64-cgo), func GetsockoptICMPv6Filter(int, int, int) (*ICMPv6Filter, error) +pkg syscall (darwin-amd64-cgo), func GetsockoptIPv6MTUInfo(int, int, int) (*IPv6MTUInfo, error) +pkg syscall (darwin-amd64-cgo), func SetsockoptICMPv6Filter(int, int, int, *ICMPv6Filter) error +pkg syscall (darwin-amd64-cgo), func Syscall9(uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno) +pkg syscall (darwin-amd64-cgo), type ICMPv6Filter struct +pkg syscall (darwin-amd64-cgo), type ICMPv6Filter struct, Filt [8]uint32 +pkg syscall (darwin-amd64-cgo), type IPv6MTUInfo struct +pkg syscall (darwin-amd64-cgo), type IPv6MTUInfo struct, Addr RawSockaddrInet6 +pkg syscall (darwin-amd64-cgo), type IPv6MTUInfo struct, Mtu uint32 +pkg syscall (freebsd-386), const F_DUP2FD_CLOEXEC = 18 +pkg syscall (freebsd-386), const F_DUP2FD_CLOEXEC ideal-int +pkg syscall (freebsd-386), const F_DUPFD_CLOEXEC = 17 +pkg syscall (freebsd-386), const F_DUPFD_CLOEXEC ideal-int +pkg syscall (freebsd-386), const ICMP6_FILTER = 18 +pkg syscall (freebsd-386), const ICMP6_FILTER ideal-int +pkg syscall (freebsd-386), const PRIO_PGRP = 1 +pkg syscall (freebsd-386), const PRIO_PGRP ideal-int +pkg syscall (freebsd-386), const PRIO_PROCESS = 0 +pkg syscall (freebsd-386), const PRIO_PROCESS ideal-int +pkg syscall (freebsd-386), const PRIO_USER = 2 +pkg syscall (freebsd-386), const PRIO_USER ideal-int +pkg syscall (freebsd-386), const SizeofICMPv6Filter = 32 +pkg syscall (freebsd-386), const SizeofICMPv6Filter ideal-int +pkg syscall (freebsd-386), const SizeofIPv6MTUInfo = 32 +pkg syscall (freebsd-386), const SizeofIPv6MTUInfo ideal-int +pkg syscall (freebsd-386), func GetsockoptICMPv6Filter(int, int, int) (*ICMPv6Filter, error) +pkg syscall (freebsd-386), func GetsockoptIPv6MTUInfo(int, int, int) (*IPv6MTUInfo, error) +pkg syscall (freebsd-386), func SetsockoptICMPv6Filter(int, int, int, *ICMPv6Filter) error +pkg syscall (freebsd-386), type ICMPv6Filter struct +pkg syscall (freebsd-386), type ICMPv6Filter struct, Filt [8]uint32 +pkg syscall (freebsd-386), type IPv6MTUInfo struct +pkg syscall (freebsd-386), type IPv6MTUInfo struct, Addr RawSockaddrInet6 +pkg syscall (freebsd-386), type IPv6MTUInfo struct, Mtu uint32 +pkg syscall (freebsd-386-cgo), const AF_APPLETALK ideal-int +pkg syscall (freebsd-386-cgo), const AF_ARP ideal-int +pkg syscall (freebsd-386-cgo), const AF_ATM ideal-int +pkg syscall (freebsd-386-cgo), const AF_BLUETOOTH ideal-int +pkg syscall (freebsd-386-cgo), const AF_CCITT ideal-int +pkg syscall (freebsd-386-cgo), const AF_CHAOS ideal-int +pkg syscall (freebsd-386-cgo), const AF_CNT ideal-int +pkg syscall (freebsd-386-cgo), const AF_COIP ideal-int +pkg syscall (freebsd-386-cgo), const AF_DATAKIT ideal-int +pkg syscall (freebsd-386-cgo), const AF_DECnet ideal-int +pkg syscall (freebsd-386-cgo), const AF_DLI ideal-int +pkg syscall (freebsd-386-cgo), const AF_E164 ideal-int +pkg syscall (freebsd-386-cgo), const AF_ECMA ideal-int +pkg syscall (freebsd-386-cgo), const AF_HYLINK ideal-int +pkg syscall (freebsd-386-cgo), const AF_IEEE80211 ideal-int +pkg syscall (freebsd-386-cgo), const AF_IMPLINK ideal-int +pkg syscall (freebsd-386-cgo), const AF_IPX ideal-int +pkg syscall (freebsd-386-cgo), const AF_ISDN ideal-int +pkg syscall (freebsd-386-cgo), const AF_ISO ideal-int +pkg syscall (freebsd-386-cgo), const AF_LAT ideal-int +pkg syscall (freebsd-386-cgo), const AF_LINK ideal-int +pkg syscall (freebsd-386-cgo), const AF_LOCAL ideal-int +pkg syscall (freebsd-386-cgo), const AF_MAX ideal-int +pkg syscall (freebsd-386-cgo), const AF_NATM ideal-int +pkg syscall (freebsd-386-cgo), const AF_NETBIOS ideal-int +pkg syscall (freebsd-386-cgo), const AF_NETGRAPH ideal-int +pkg syscall (freebsd-386-cgo), const AF_OSI ideal-int +pkg syscall (freebsd-386-cgo), const AF_PUP ideal-int +pkg syscall (freebsd-386-cgo), const AF_ROUTE ideal-int +pkg syscall (freebsd-386-cgo), const AF_SCLUSTER ideal-int +pkg syscall (freebsd-386-cgo), const AF_SIP ideal-int +pkg syscall (freebsd-386-cgo), const AF_SLOW ideal-int +pkg syscall (freebsd-386-cgo), const AF_SNA ideal-int +pkg syscall (freebsd-386-cgo), const AF_VENDOR00 ideal-int +pkg syscall (freebsd-386-cgo), const AF_VENDOR01 ideal-int +pkg syscall (freebsd-386-cgo), const AF_VENDOR02 ideal-int +pkg syscall (freebsd-386-cgo), const AF_VENDOR03 ideal-int +pkg syscall (freebsd-386-cgo), const AF_VENDOR04 ideal-int +pkg syscall (freebsd-386-cgo), const AF_VENDOR05 ideal-int +pkg syscall (freebsd-386-cgo), const AF_VENDOR06 ideal-int +pkg syscall (freebsd-386-cgo), const AF_VENDOR07 ideal-int +pkg syscall (freebsd-386-cgo), const AF_VENDOR08 ideal-int +pkg syscall (freebsd-386-cgo), const AF_VENDOR09 ideal-int +pkg syscall (freebsd-386-cgo), const AF_VENDOR10 ideal-int +pkg syscall (freebsd-386-cgo), const AF_VENDOR11 ideal-int +pkg syscall (freebsd-386-cgo), const AF_VENDOR12 ideal-int +pkg syscall (freebsd-386-cgo), const AF_VENDOR13 ideal-int +pkg syscall (freebsd-386-cgo), const AF_VENDOR14 ideal-int +pkg syscall (freebsd-386-cgo), const AF_VENDOR15 ideal-int +pkg syscall (freebsd-386-cgo), const AF_VENDOR16 ideal-int +pkg syscall (freebsd-386-cgo), const AF_VENDOR17 ideal-int +pkg syscall (freebsd-386-cgo), const AF_VENDOR18 ideal-int +pkg syscall (freebsd-386-cgo), const AF_VENDOR19 ideal-int +pkg syscall (freebsd-386-cgo), const AF_VENDOR20 ideal-int +pkg syscall (freebsd-386-cgo), const AF_VENDOR21 ideal-int +pkg syscall (freebsd-386-cgo), const AF_VENDOR22 ideal-int +pkg syscall (freebsd-386-cgo), const AF_VENDOR23 ideal-int +pkg syscall (freebsd-386-cgo), const AF_VENDOR24 ideal-int +pkg syscall (freebsd-386-cgo), const AF_VENDOR25 ideal-int +pkg syscall (freebsd-386-cgo), const AF_VENDOR26 ideal-int +pkg syscall (freebsd-386-cgo), const AF_VENDOR27 ideal-int +pkg syscall (freebsd-386-cgo), const AF_VENDOR28 ideal-int +pkg syscall (freebsd-386-cgo), const AF_VENDOR29 ideal-int +pkg syscall (freebsd-386-cgo), const AF_VENDOR30 ideal-int +pkg syscall (freebsd-386-cgo), const AF_VENDOR31 ideal-int +pkg syscall (freebsd-386-cgo), const AF_VENDOR32 ideal-int +pkg syscall (freebsd-386-cgo), const AF_VENDOR33 ideal-int +pkg syscall (freebsd-386-cgo), const AF_VENDOR34 ideal-int +pkg syscall (freebsd-386-cgo), const AF_VENDOR35 ideal-int +pkg syscall (freebsd-386-cgo), const AF_VENDOR36 ideal-int +pkg syscall (freebsd-386-cgo), const AF_VENDOR37 ideal-int +pkg syscall (freebsd-386-cgo), const AF_VENDOR38 ideal-int +pkg syscall (freebsd-386-cgo), const AF_VENDOR39 ideal-int +pkg syscall (freebsd-386-cgo), const AF_VENDOR40 ideal-int +pkg syscall (freebsd-386-cgo), const AF_VENDOR41 ideal-int +pkg syscall (freebsd-386-cgo), const AF_VENDOR42 ideal-int +pkg syscall (freebsd-386-cgo), const AF_VENDOR43 ideal-int +pkg syscall (freebsd-386-cgo), const AF_VENDOR44 ideal-int +pkg syscall (freebsd-386-cgo), const AF_VENDOR45 ideal-int +pkg syscall (freebsd-386-cgo), const AF_VENDOR46 ideal-int +pkg syscall (freebsd-386-cgo), const AF_VENDOR47 ideal-int +pkg syscall (freebsd-386-cgo), const B0 ideal-int +pkg syscall (freebsd-386-cgo), const B110 ideal-int +pkg syscall (freebsd-386-cgo), const B115200 ideal-int +pkg syscall (freebsd-386-cgo), const B1200 ideal-int +pkg syscall (freebsd-386-cgo), const B134 ideal-int +pkg syscall (freebsd-386-cgo), const B14400 ideal-int +pkg syscall (freebsd-386-cgo), const B150 ideal-int +pkg syscall (freebsd-386-cgo), const B1800 ideal-int +pkg syscall (freebsd-386-cgo), const B19200 ideal-int +pkg syscall (freebsd-386-cgo), const B200 ideal-int +pkg syscall (freebsd-386-cgo), const B230400 ideal-int +pkg syscall (freebsd-386-cgo), const B2400 ideal-int +pkg syscall (freebsd-386-cgo), const B28800 ideal-int +pkg syscall (freebsd-386-cgo), const B300 ideal-int +pkg syscall (freebsd-386-cgo), const B38400 ideal-int +pkg syscall (freebsd-386-cgo), const B460800 ideal-int +pkg syscall (freebsd-386-cgo), const B4800 ideal-int +pkg syscall (freebsd-386-cgo), const B50 ideal-int +pkg syscall (freebsd-386-cgo), const B57600 ideal-int +pkg syscall (freebsd-386-cgo), const B600 ideal-int +pkg syscall (freebsd-386-cgo), const B7200 ideal-int +pkg syscall (freebsd-386-cgo), const B75 ideal-int +pkg syscall (freebsd-386-cgo), const B76800 ideal-int +pkg syscall (freebsd-386-cgo), const B921600 ideal-int +pkg syscall (freebsd-386-cgo), const B9600 ideal-int +pkg syscall (freebsd-386-cgo), const BIOCFEEDBACK ideal-int +pkg syscall (freebsd-386-cgo), const BIOCFLUSH ideal-int +pkg syscall (freebsd-386-cgo), const BIOCGBLEN ideal-int +pkg syscall (freebsd-386-cgo), const BIOCGDIRECTION ideal-int +pkg syscall (freebsd-386-cgo), const BIOCGDLT ideal-int +pkg syscall (freebsd-386-cgo), const BIOCGDLTLIST ideal-int +pkg syscall (freebsd-386-cgo), const BIOCGETBUFMODE ideal-int +pkg syscall (freebsd-386-cgo), const BIOCGETIF ideal-int +pkg syscall (freebsd-386-cgo), const BIOCGETZMAX ideal-int +pkg syscall (freebsd-386-cgo), const BIOCGHDRCMPLT ideal-int +pkg syscall (freebsd-386-cgo), const BIOCGRSIG ideal-int +pkg syscall (freebsd-386-cgo), const BIOCGRTIMEOUT ideal-int +pkg syscall (freebsd-386-cgo), const BIOCGSEESENT ideal-int +pkg syscall (freebsd-386-cgo), const BIOCGSTATS ideal-int +pkg syscall (freebsd-386-cgo), const BIOCGTSTAMP ideal-int +pkg syscall (freebsd-386-cgo), const BIOCIMMEDIATE ideal-int +pkg syscall (freebsd-386-cgo), const BIOCLOCK ideal-int +pkg syscall (freebsd-386-cgo), const BIOCPROMISC ideal-int +pkg syscall (freebsd-386-cgo), const BIOCROTZBUF ideal-int +pkg syscall (freebsd-386-cgo), const BIOCSBLEN ideal-int +pkg syscall (freebsd-386-cgo), const BIOCSDIRECTION ideal-int +pkg syscall (freebsd-386-cgo), const BIOCSDLT ideal-int +pkg syscall (freebsd-386-cgo), const BIOCSETBUFMODE ideal-int +pkg syscall (freebsd-386-cgo), const BIOCSETF ideal-int +pkg syscall (freebsd-386-cgo), const BIOCSETFNR ideal-int +pkg syscall (freebsd-386-cgo), const BIOCSETIF ideal-int +pkg syscall (freebsd-386-cgo), const BIOCSETWF ideal-int +pkg syscall (freebsd-386-cgo), const BIOCSETZBUF ideal-int +pkg syscall (freebsd-386-cgo), const BIOCSHDRCMPLT ideal-int +pkg syscall (freebsd-386-cgo), const BIOCSRSIG ideal-int +pkg syscall (freebsd-386-cgo), const BIOCSRTIMEOUT ideal-int +pkg syscall (freebsd-386-cgo), const BIOCSSEESENT ideal-int +pkg syscall (freebsd-386-cgo), const BIOCSTSTAMP ideal-int +pkg syscall (freebsd-386-cgo), const BIOCVERSION ideal-int +pkg syscall (freebsd-386-cgo), const BPF_A ideal-int +pkg syscall (freebsd-386-cgo), const BPF_ABS ideal-int +pkg syscall (freebsd-386-cgo), const BPF_ADD ideal-int +pkg syscall (freebsd-386-cgo), const BPF_ALIGNMENT ideal-int +pkg syscall (freebsd-386-cgo), const BPF_ALU ideal-int +pkg syscall (freebsd-386-cgo), const BPF_AND ideal-int +pkg syscall (freebsd-386-cgo), const BPF_B ideal-int +pkg syscall (freebsd-386-cgo), const BPF_BUFMODE_BUFFER ideal-int +pkg syscall (freebsd-386-cgo), const BPF_BUFMODE_ZBUF ideal-int +pkg syscall (freebsd-386-cgo), const BPF_DIV ideal-int +pkg syscall (freebsd-386-cgo), const BPF_H ideal-int +pkg syscall (freebsd-386-cgo), const BPF_IMM ideal-int +pkg syscall (freebsd-386-cgo), const BPF_IND ideal-int +pkg syscall (freebsd-386-cgo), const BPF_JA ideal-int +pkg syscall (freebsd-386-cgo), const BPF_JEQ ideal-int +pkg syscall (freebsd-386-cgo), const BPF_JGE ideal-int +pkg syscall (freebsd-386-cgo), const BPF_JGT ideal-int +pkg syscall (freebsd-386-cgo), const BPF_JMP ideal-int +pkg syscall (freebsd-386-cgo), const BPF_JSET ideal-int +pkg syscall (freebsd-386-cgo), const BPF_K ideal-int +pkg syscall (freebsd-386-cgo), const BPF_LD ideal-int +pkg syscall (freebsd-386-cgo), const BPF_LDX ideal-int +pkg syscall (freebsd-386-cgo), const BPF_LEN ideal-int +pkg syscall (freebsd-386-cgo), const BPF_LSH ideal-int +pkg syscall (freebsd-386-cgo), const BPF_MAJOR_VERSION ideal-int +pkg syscall (freebsd-386-cgo), const BPF_MAXBUFSIZE ideal-int +pkg syscall (freebsd-386-cgo), const BPF_MAXINSNS ideal-int +pkg syscall (freebsd-386-cgo), const BPF_MEM ideal-int +pkg syscall (freebsd-386-cgo), const BPF_MEMWORDS ideal-int +pkg syscall (freebsd-386-cgo), const BPF_MINBUFSIZE ideal-int +pkg syscall (freebsd-386-cgo), const BPF_MINOR_VERSION ideal-int +pkg syscall (freebsd-386-cgo), const BPF_MISC ideal-int +pkg syscall (freebsd-386-cgo), const BPF_MSH ideal-int +pkg syscall (freebsd-386-cgo), const BPF_MUL ideal-int +pkg syscall (freebsd-386-cgo), const BPF_NEG ideal-int +pkg syscall (freebsd-386-cgo), const BPF_OR ideal-int +pkg syscall (freebsd-386-cgo), const BPF_RELEASE ideal-int +pkg syscall (freebsd-386-cgo), const BPF_RET ideal-int +pkg syscall (freebsd-386-cgo), const BPF_RSH ideal-int +pkg syscall (freebsd-386-cgo), const BPF_ST ideal-int +pkg syscall (freebsd-386-cgo), const BPF_STX ideal-int +pkg syscall (freebsd-386-cgo), const BPF_SUB ideal-int +pkg syscall (freebsd-386-cgo), const BPF_TAX ideal-int +pkg syscall (freebsd-386-cgo), const BPF_TXA ideal-int +pkg syscall (freebsd-386-cgo), const BPF_T_BINTIME ideal-int +pkg syscall (freebsd-386-cgo), const BPF_T_BINTIME_FAST ideal-int +pkg syscall (freebsd-386-cgo), const BPF_T_BINTIME_MONOTONIC ideal-int +pkg syscall (freebsd-386-cgo), const BPF_T_BINTIME_MONOTONIC_FAST ideal-int +pkg syscall (freebsd-386-cgo), const BPF_T_FAST ideal-int +pkg syscall (freebsd-386-cgo), const BPF_T_FLAG_MASK ideal-int +pkg syscall (freebsd-386-cgo), const BPF_T_FORMAT_MASK ideal-int +pkg syscall (freebsd-386-cgo), const BPF_T_MICROTIME ideal-int +pkg syscall (freebsd-386-cgo), const BPF_T_MICROTIME_FAST ideal-int +pkg syscall (freebsd-386-cgo), const BPF_T_MICROTIME_MONOTONIC ideal-int +pkg syscall (freebsd-386-cgo), const BPF_T_MICROTIME_MONOTONIC_FAST ideal-int +pkg syscall (freebsd-386-cgo), const BPF_T_MONOTONIC ideal-int +pkg syscall (freebsd-386-cgo), const BPF_T_MONOTONIC_FAST ideal-int +pkg syscall (freebsd-386-cgo), const BPF_T_NANOTIME ideal-int +pkg syscall (freebsd-386-cgo), const BPF_T_NANOTIME_FAST ideal-int +pkg syscall (freebsd-386-cgo), const BPF_T_NANOTIME_MONOTONIC ideal-int +pkg syscall (freebsd-386-cgo), const BPF_T_NANOTIME_MONOTONIC_FAST ideal-int +pkg syscall (freebsd-386-cgo), const BPF_T_NONE ideal-int +pkg syscall (freebsd-386-cgo), const BPF_T_NORMAL ideal-int +pkg syscall (freebsd-386-cgo), const BPF_W ideal-int +pkg syscall (freebsd-386-cgo), const BPF_X ideal-int +pkg syscall (freebsd-386-cgo), const BRKINT ideal-int +pkg syscall (freebsd-386-cgo), const CFLUSH ideal-int +pkg syscall (freebsd-386-cgo), const CLOCAL ideal-int +pkg syscall (freebsd-386-cgo), const CREAD ideal-int +pkg syscall (freebsd-386-cgo), const CS5 ideal-int +pkg syscall (freebsd-386-cgo), const CS6 ideal-int +pkg syscall (freebsd-386-cgo), const CS7 ideal-int +pkg syscall (freebsd-386-cgo), const CS8 ideal-int +pkg syscall (freebsd-386-cgo), const CSIZE ideal-int +pkg syscall (freebsd-386-cgo), const CSTART ideal-int +pkg syscall (freebsd-386-cgo), const CSTATUS ideal-int +pkg syscall (freebsd-386-cgo), const CSTOP ideal-int +pkg syscall (freebsd-386-cgo), const CSTOPB ideal-int +pkg syscall (freebsd-386-cgo), const CSUSP ideal-int +pkg syscall (freebsd-386-cgo), const CTL_MAXNAME ideal-int +pkg syscall (freebsd-386-cgo), const CTL_NET ideal-int +pkg syscall (freebsd-386-cgo), const DLT_A429 ideal-int +pkg syscall (freebsd-386-cgo), const DLT_A653_ICM ideal-int +pkg syscall (freebsd-386-cgo), const DLT_AIRONET_HEADER ideal-int +pkg syscall (freebsd-386-cgo), const DLT_AOS ideal-int +pkg syscall (freebsd-386-cgo), const DLT_APPLE_IP_OVER_IEEE1394 ideal-int +pkg syscall (freebsd-386-cgo), const DLT_ARCNET ideal-int +pkg syscall (freebsd-386-cgo), const DLT_ARCNET_LINUX ideal-int +pkg syscall (freebsd-386-cgo), const DLT_ATM_CLIP ideal-int +pkg syscall (freebsd-386-cgo), const DLT_ATM_RFC1483 ideal-int +pkg syscall (freebsd-386-cgo), const DLT_AURORA ideal-int +pkg syscall (freebsd-386-cgo), const DLT_AX25 ideal-int +pkg syscall (freebsd-386-cgo), const DLT_AX25_KISS ideal-int +pkg syscall (freebsd-386-cgo), const DLT_BACNET_MS_TP ideal-int +pkg syscall (freebsd-386-cgo), const DLT_BLUETOOTH_HCI_H4 ideal-int +pkg syscall (freebsd-386-cgo), const DLT_BLUETOOTH_HCI_H4_WITH_PHDR ideal-int +pkg syscall (freebsd-386-cgo), const DLT_CAN20B ideal-int +pkg syscall (freebsd-386-cgo), const DLT_CAN_SOCKETCAN ideal-int +pkg syscall (freebsd-386-cgo), const DLT_CHAOS ideal-int +pkg syscall (freebsd-386-cgo), const DLT_CHDLC ideal-int +pkg syscall (freebsd-386-cgo), const DLT_CISCO_IOS ideal-int +pkg syscall (freebsd-386-cgo), const DLT_C_HDLC ideal-int +pkg syscall (freebsd-386-cgo), const DLT_C_HDLC_WITH_DIR ideal-int +pkg syscall (freebsd-386-cgo), const DLT_DBUS ideal-int +pkg syscall (freebsd-386-cgo), const DLT_DECT ideal-int +pkg syscall (freebsd-386-cgo), const DLT_DOCSIS ideal-int +pkg syscall (freebsd-386-cgo), const DLT_DVB_CI ideal-int +pkg syscall (freebsd-386-cgo), const DLT_ECONET ideal-int +pkg syscall (freebsd-386-cgo), const DLT_EN10MB ideal-int +pkg syscall (freebsd-386-cgo), const DLT_EN3MB ideal-int +pkg syscall (freebsd-386-cgo), const DLT_ENC ideal-int +pkg syscall (freebsd-386-cgo), const DLT_ERF ideal-int +pkg syscall (freebsd-386-cgo), const DLT_ERF_ETH ideal-int +pkg syscall (freebsd-386-cgo), const DLT_ERF_POS ideal-int +pkg syscall (freebsd-386-cgo), const DLT_FC_2 ideal-int +pkg syscall (freebsd-386-cgo), const DLT_FC_2_WITH_FRAME_DELIMS ideal-int +pkg syscall (freebsd-386-cgo), const DLT_FDDI ideal-int +pkg syscall (freebsd-386-cgo), const DLT_FLEXRAY ideal-int +pkg syscall (freebsd-386-cgo), const DLT_FRELAY ideal-int +pkg syscall (freebsd-386-cgo), const DLT_FRELAY_WITH_DIR ideal-int +pkg syscall (freebsd-386-cgo), const DLT_GCOM_SERIAL ideal-int +pkg syscall (freebsd-386-cgo), const DLT_GCOM_T1E1 ideal-int +pkg syscall (freebsd-386-cgo), const DLT_GPF_F ideal-int +pkg syscall (freebsd-386-cgo), const DLT_GPF_T ideal-int +pkg syscall (freebsd-386-cgo), const DLT_GPRS_LLC ideal-int +pkg syscall (freebsd-386-cgo), const DLT_GSMTAP_ABIS ideal-int +pkg syscall (freebsd-386-cgo), const DLT_GSMTAP_UM ideal-int +pkg syscall (freebsd-386-cgo), const DLT_HHDLC ideal-int +pkg syscall (freebsd-386-cgo), const DLT_IBM_SN ideal-int +pkg syscall (freebsd-386-cgo), const DLT_IBM_SP ideal-int +pkg syscall (freebsd-386-cgo), const DLT_IEEE802 ideal-int +pkg syscall (freebsd-386-cgo), const DLT_IEEE802_11 ideal-int +pkg syscall (freebsd-386-cgo), const DLT_IEEE802_11_RADIO ideal-int +pkg syscall (freebsd-386-cgo), const DLT_IEEE802_11_RADIO_AVS ideal-int +pkg syscall (freebsd-386-cgo), const DLT_IEEE802_15_4 ideal-int +pkg syscall (freebsd-386-cgo), const DLT_IEEE802_15_4_LINUX ideal-int +pkg syscall (freebsd-386-cgo), const DLT_IEEE802_15_4_NOFCS ideal-int +pkg syscall (freebsd-386-cgo), const DLT_IEEE802_15_4_NONASK_PHY ideal-int +pkg syscall (freebsd-386-cgo), const DLT_IEEE802_16_MAC_CPS ideal-int +pkg syscall (freebsd-386-cgo), const DLT_IEEE802_16_MAC_CPS_RADIO ideal-int +pkg syscall (freebsd-386-cgo), const DLT_IPFILTER ideal-int +pkg syscall (freebsd-386-cgo), const DLT_IPMB ideal-int +pkg syscall (freebsd-386-cgo), const DLT_IPMB_LINUX ideal-int +pkg syscall (freebsd-386-cgo), const DLT_IPNET ideal-int +pkg syscall (freebsd-386-cgo), const DLT_IPOIB ideal-int +pkg syscall (freebsd-386-cgo), const DLT_IPV4 ideal-int +pkg syscall (freebsd-386-cgo), const DLT_IPV6 ideal-int +pkg syscall (freebsd-386-cgo), const DLT_IP_OVER_FC ideal-int +pkg syscall (freebsd-386-cgo), const DLT_JUNIPER_ATM1 ideal-int +pkg syscall (freebsd-386-cgo), const DLT_JUNIPER_ATM2 ideal-int +pkg syscall (freebsd-386-cgo), const DLT_JUNIPER_ATM_CEMIC ideal-int +pkg syscall (freebsd-386-cgo), const DLT_JUNIPER_CHDLC ideal-int +pkg syscall (freebsd-386-cgo), const DLT_JUNIPER_ES ideal-int +pkg syscall (freebsd-386-cgo), const DLT_JUNIPER_ETHER ideal-int +pkg syscall (freebsd-386-cgo), const DLT_JUNIPER_FIBRECHANNEL ideal-int +pkg syscall (freebsd-386-cgo), const DLT_JUNIPER_FRELAY ideal-int +pkg syscall (freebsd-386-cgo), const DLT_JUNIPER_GGSN ideal-int +pkg syscall (freebsd-386-cgo), const DLT_JUNIPER_ISM ideal-int +pkg syscall (freebsd-386-cgo), const DLT_JUNIPER_MFR ideal-int +pkg syscall (freebsd-386-cgo), const DLT_JUNIPER_MLFR ideal-int +pkg syscall (freebsd-386-cgo), const DLT_JUNIPER_MLPPP ideal-int +pkg syscall (freebsd-386-cgo), const DLT_JUNIPER_MONITOR ideal-int +pkg syscall (freebsd-386-cgo), const DLT_JUNIPER_PIC_PEER ideal-int +pkg syscall (freebsd-386-cgo), const DLT_JUNIPER_PPP ideal-int +pkg syscall (freebsd-386-cgo), const DLT_JUNIPER_PPPOE ideal-int +pkg syscall (freebsd-386-cgo), const DLT_JUNIPER_PPPOE_ATM ideal-int +pkg syscall (freebsd-386-cgo), const DLT_JUNIPER_SERVICES ideal-int +pkg syscall (freebsd-386-cgo), const DLT_JUNIPER_SRX_E2E ideal-int +pkg syscall (freebsd-386-cgo), const DLT_JUNIPER_ST ideal-int +pkg syscall (freebsd-386-cgo), const DLT_JUNIPER_VP ideal-int +pkg syscall (freebsd-386-cgo), const DLT_JUNIPER_VS ideal-int +pkg syscall (freebsd-386-cgo), const DLT_LAPB_WITH_DIR ideal-int +pkg syscall (freebsd-386-cgo), const DLT_LAPD ideal-int +pkg syscall (freebsd-386-cgo), const DLT_LIN ideal-int +pkg syscall (freebsd-386-cgo), const DLT_LINUX_EVDEV ideal-int +pkg syscall (freebsd-386-cgo), const DLT_LINUX_IRDA ideal-int +pkg syscall (freebsd-386-cgo), const DLT_LINUX_LAPD ideal-int +pkg syscall (freebsd-386-cgo), const DLT_LINUX_PPP_WITHDIRECTION ideal-int +pkg syscall (freebsd-386-cgo), const DLT_LINUX_SLL ideal-int +pkg syscall (freebsd-386-cgo), const DLT_LOOP ideal-int +pkg syscall (freebsd-386-cgo), const DLT_LTALK ideal-int +pkg syscall (freebsd-386-cgo), const DLT_MATCHING_MAX ideal-int +pkg syscall (freebsd-386-cgo), const DLT_MATCHING_MIN ideal-int +pkg syscall (freebsd-386-cgo), const DLT_MFR ideal-int +pkg syscall (freebsd-386-cgo), const DLT_MOST ideal-int +pkg syscall (freebsd-386-cgo), const DLT_MPLS ideal-int +pkg syscall (freebsd-386-cgo), const DLT_MTP2 ideal-int +pkg syscall (freebsd-386-cgo), const DLT_MTP2_WITH_PHDR ideal-int +pkg syscall (freebsd-386-cgo), const DLT_MTP3 ideal-int +pkg syscall (freebsd-386-cgo), const DLT_MUX27010 ideal-int +pkg syscall (freebsd-386-cgo), const DLT_NETANALYZER ideal-int +pkg syscall (freebsd-386-cgo), const DLT_NETANALYZER_TRANSPARENT ideal-int +pkg syscall (freebsd-386-cgo), const DLT_NFLOG ideal-int +pkg syscall (freebsd-386-cgo), const DLT_NULL ideal-int +pkg syscall (freebsd-386-cgo), const DLT_PCI_EXP ideal-int +pkg syscall (freebsd-386-cgo), const DLT_PFLOG ideal-int +pkg syscall (freebsd-386-cgo), const DLT_PFSYNC ideal-int +pkg syscall (freebsd-386-cgo), const DLT_PPI ideal-int +pkg syscall (freebsd-386-cgo), const DLT_PPP ideal-int +pkg syscall (freebsd-386-cgo), const DLT_PPP_BSDOS ideal-int +pkg syscall (freebsd-386-cgo), const DLT_PPP_ETHER ideal-int +pkg syscall (freebsd-386-cgo), const DLT_PPP_PPPD ideal-int +pkg syscall (freebsd-386-cgo), const DLT_PPP_SERIAL ideal-int +pkg syscall (freebsd-386-cgo), const DLT_PPP_WITH_DIR ideal-int +pkg syscall (freebsd-386-cgo), const DLT_PPP_WITH_DIRECTION ideal-int +pkg syscall (freebsd-386-cgo), const DLT_PRISM_HEADER ideal-int +pkg syscall (freebsd-386-cgo), const DLT_PRONET ideal-int +pkg syscall (freebsd-386-cgo), const DLT_RAIF1 ideal-int +pkg syscall (freebsd-386-cgo), const DLT_RAW ideal-int +pkg syscall (freebsd-386-cgo), const DLT_RIO ideal-int +pkg syscall (freebsd-386-cgo), const DLT_SCCP ideal-int +pkg syscall (freebsd-386-cgo), const DLT_SITA ideal-int +pkg syscall (freebsd-386-cgo), const DLT_SLIP ideal-int +pkg syscall (freebsd-386-cgo), const DLT_SLIP_BSDOS ideal-int +pkg syscall (freebsd-386-cgo), const DLT_STANAG_5066_D_PDU ideal-int +pkg syscall (freebsd-386-cgo), const DLT_SUNATM ideal-int +pkg syscall (freebsd-386-cgo), const DLT_SYMANTEC_FIREWALL ideal-int +pkg syscall (freebsd-386-cgo), const DLT_TZSP ideal-int +pkg syscall (freebsd-386-cgo), const DLT_USB ideal-int +pkg syscall (freebsd-386-cgo), const DLT_USB_LINUX ideal-int +pkg syscall (freebsd-386-cgo), const DLT_USB_LINUX_MMAPPED ideal-int +pkg syscall (freebsd-386-cgo), const DLT_USER0 ideal-int +pkg syscall (freebsd-386-cgo), const DLT_USER1 ideal-int +pkg syscall (freebsd-386-cgo), const DLT_USER10 ideal-int +pkg syscall (freebsd-386-cgo), const DLT_USER11 ideal-int +pkg syscall (freebsd-386-cgo), const DLT_USER12 ideal-int +pkg syscall (freebsd-386-cgo), const DLT_USER13 ideal-int +pkg syscall (freebsd-386-cgo), const DLT_USER14 ideal-int +pkg syscall (freebsd-386-cgo), const DLT_USER15 ideal-int +pkg syscall (freebsd-386-cgo), const DLT_USER2 ideal-int +pkg syscall (freebsd-386-cgo), const DLT_USER3 ideal-int +pkg syscall (freebsd-386-cgo), const DLT_USER4 ideal-int +pkg syscall (freebsd-386-cgo), const DLT_USER5 ideal-int +pkg syscall (freebsd-386-cgo), const DLT_USER6 ideal-int +pkg syscall (freebsd-386-cgo), const DLT_USER7 ideal-int +pkg syscall (freebsd-386-cgo), const DLT_USER8 ideal-int +pkg syscall (freebsd-386-cgo), const DLT_USER9 ideal-int +pkg syscall (freebsd-386-cgo), const DLT_WIHART ideal-int +pkg syscall (freebsd-386-cgo), const DLT_X2E_SERIAL ideal-int +pkg syscall (freebsd-386-cgo), const DLT_X2E_XORAYA ideal-int +pkg syscall (freebsd-386-cgo), const DT_BLK ideal-int +pkg syscall (freebsd-386-cgo), const DT_CHR ideal-int +pkg syscall (freebsd-386-cgo), const DT_DIR ideal-int +pkg syscall (freebsd-386-cgo), const DT_FIFO ideal-int +pkg syscall (freebsd-386-cgo), const DT_LNK ideal-int +pkg syscall (freebsd-386-cgo), const DT_REG ideal-int +pkg syscall (freebsd-386-cgo), const DT_SOCK ideal-int +pkg syscall (freebsd-386-cgo), const DT_UNKNOWN ideal-int +pkg syscall (freebsd-386-cgo), const DT_WHT ideal-int +pkg syscall (freebsd-386-cgo), const EAUTH Errno +pkg syscall (freebsd-386-cgo), const EBADMSG Errno +pkg syscall (freebsd-386-cgo), const EBADRPC Errno +pkg syscall (freebsd-386-cgo), const ECAPMODE Errno +pkg syscall (freebsd-386-cgo), const ECHO ideal-int +pkg syscall (freebsd-386-cgo), const ECHOCTL ideal-int +pkg syscall (freebsd-386-cgo), const ECHOE ideal-int +pkg syscall (freebsd-386-cgo), const ECHOK ideal-int +pkg syscall (freebsd-386-cgo), const ECHOKE ideal-int +pkg syscall (freebsd-386-cgo), const ECHONL ideal-int +pkg syscall (freebsd-386-cgo), const ECHOPRT ideal-int +pkg syscall (freebsd-386-cgo), const EDOOFUS Errno +pkg syscall (freebsd-386-cgo), const EFTYPE Errno +pkg syscall (freebsd-386-cgo), const ELAST Errno +pkg syscall (freebsd-386-cgo), const EMULTIHOP Errno +pkg syscall (freebsd-386-cgo), const ENEEDAUTH Errno +pkg syscall (freebsd-386-cgo), const ENOATTR Errno +pkg syscall (freebsd-386-cgo), const ENOLINK Errno +pkg syscall (freebsd-386-cgo), const ENOTCAPABLE Errno +pkg syscall (freebsd-386-cgo), const EPROCLIM Errno +pkg syscall (freebsd-386-cgo), const EPROCUNAVAIL Errno +pkg syscall (freebsd-386-cgo), const EPROGMISMATCH Errno +pkg syscall (freebsd-386-cgo), const EPROGUNAVAIL Errno +pkg syscall (freebsd-386-cgo), const EPROTO Errno +pkg syscall (freebsd-386-cgo), const ERPCMISMATCH Errno +pkg syscall (freebsd-386-cgo), const EVFILT_AIO ideal-int +pkg syscall (freebsd-386-cgo), const EVFILT_FS ideal-int +pkg syscall (freebsd-386-cgo), const EVFILT_LIO ideal-int +pkg syscall (freebsd-386-cgo), const EVFILT_PROC ideal-int +pkg syscall (freebsd-386-cgo), const EVFILT_READ ideal-int +pkg syscall (freebsd-386-cgo), const EVFILT_SIGNAL ideal-int +pkg syscall (freebsd-386-cgo), const EVFILT_SYSCOUNT ideal-int +pkg syscall (freebsd-386-cgo), const EVFILT_TIMER ideal-int +pkg syscall (freebsd-386-cgo), const EVFILT_USER ideal-int +pkg syscall (freebsd-386-cgo), const EVFILT_VNODE ideal-int +pkg syscall (freebsd-386-cgo), const EVFILT_WRITE ideal-int +pkg syscall (freebsd-386-cgo), const EV_ADD ideal-int +pkg syscall (freebsd-386-cgo), const EV_CLEAR ideal-int +pkg syscall (freebsd-386-cgo), const EV_DELETE ideal-int +pkg syscall (freebsd-386-cgo), const EV_DISABLE ideal-int +pkg syscall (freebsd-386-cgo), const EV_DISPATCH ideal-int +pkg syscall (freebsd-386-cgo), const EV_ENABLE ideal-int +pkg syscall (freebsd-386-cgo), const EV_EOF ideal-int +pkg syscall (freebsd-386-cgo), const EV_ERROR ideal-int +pkg syscall (freebsd-386-cgo), const EV_FLAG1 ideal-int +pkg syscall (freebsd-386-cgo), const EV_ONESHOT ideal-int +pkg syscall (freebsd-386-cgo), const EV_RECEIPT ideal-int +pkg syscall (freebsd-386-cgo), const EV_SYSFLAGS ideal-int +pkg syscall (freebsd-386-cgo), const EXTA ideal-int +pkg syscall (freebsd-386-cgo), const EXTB ideal-int +pkg syscall (freebsd-386-cgo), const EXTPROC ideal-int +pkg syscall (freebsd-386-cgo), const FD_CLOEXEC ideal-int +pkg syscall (freebsd-386-cgo), const FD_SETSIZE ideal-int +pkg syscall (freebsd-386-cgo), const FLUSHO ideal-int +pkg syscall (freebsd-386-cgo), const F_CANCEL ideal-int +pkg syscall (freebsd-386-cgo), const F_DUP2FD ideal-int +pkg syscall (freebsd-386-cgo), const F_DUP2FD_CLOEXEC = 18 +pkg syscall (freebsd-386-cgo), const F_DUP2FD_CLOEXEC ideal-int +pkg syscall (freebsd-386-cgo), const F_DUPFD ideal-int +pkg syscall (freebsd-386-cgo), const F_DUPFD_CLOEXEC = 17 +pkg syscall (freebsd-386-cgo), const F_DUPFD_CLOEXEC ideal-int +pkg syscall (freebsd-386-cgo), const F_GETFD ideal-int +pkg syscall (freebsd-386-cgo), const F_GETFL ideal-int +pkg syscall (freebsd-386-cgo), const F_GETLK ideal-int +pkg syscall (freebsd-386-cgo), const F_GETOWN ideal-int +pkg syscall (freebsd-386-cgo), const F_OGETLK ideal-int +pkg syscall (freebsd-386-cgo), const F_OK ideal-int +pkg syscall (freebsd-386-cgo), const F_OSETLK ideal-int +pkg syscall (freebsd-386-cgo), const F_OSETLKW ideal-int +pkg syscall (freebsd-386-cgo), const F_RDAHEAD ideal-int +pkg syscall (freebsd-386-cgo), const F_RDLCK ideal-int +pkg syscall (freebsd-386-cgo), const F_READAHEAD ideal-int +pkg syscall (freebsd-386-cgo), const F_SETFD ideal-int +pkg syscall (freebsd-386-cgo), const F_SETFL ideal-int +pkg syscall (freebsd-386-cgo), const F_SETLK ideal-int +pkg syscall (freebsd-386-cgo), const F_SETLKW ideal-int +pkg syscall (freebsd-386-cgo), const F_SETLK_REMOTE ideal-int +pkg syscall (freebsd-386-cgo), const F_SETOWN ideal-int +pkg syscall (freebsd-386-cgo), const F_UNLCK ideal-int +pkg syscall (freebsd-386-cgo), const F_UNLCKSYS ideal-int +pkg syscall (freebsd-386-cgo), const F_WRLCK ideal-int +pkg syscall (freebsd-386-cgo), const HUPCL ideal-int +pkg syscall (freebsd-386-cgo), const ICANON ideal-int +pkg syscall (freebsd-386-cgo), const ICMP6_FILTER = 18 +pkg syscall (freebsd-386-cgo), const ICMP6_FILTER ideal-int +pkg syscall (freebsd-386-cgo), const ICRNL ideal-int +pkg syscall (freebsd-386-cgo), const IEXTEN ideal-int +pkg syscall (freebsd-386-cgo), const IFAN_ARRIVAL ideal-int +pkg syscall (freebsd-386-cgo), const IFAN_DEPARTURE ideal-int +pkg syscall (freebsd-386-cgo), const IFF_ALLMULTI ideal-int +pkg syscall (freebsd-386-cgo), const IFF_ALTPHYS ideal-int +pkg syscall (freebsd-386-cgo), const IFF_CANTCHANGE ideal-int +pkg syscall (freebsd-386-cgo), const IFF_CANTCONFIG ideal-int +pkg syscall (freebsd-386-cgo), const IFF_DEBUG ideal-int +pkg syscall (freebsd-386-cgo), const IFF_DRV_OACTIVE ideal-int +pkg syscall (freebsd-386-cgo), const IFF_DRV_RUNNING ideal-int +pkg syscall (freebsd-386-cgo), const IFF_DYING ideal-int +pkg syscall (freebsd-386-cgo), const IFF_LINK0 ideal-int +pkg syscall (freebsd-386-cgo), const IFF_LINK1 ideal-int +pkg syscall (freebsd-386-cgo), const IFF_LINK2 ideal-int +pkg syscall (freebsd-386-cgo), const IFF_MONITOR ideal-int +pkg syscall (freebsd-386-cgo), const IFF_NOARP ideal-int +pkg syscall (freebsd-386-cgo), const IFF_OACTIVE ideal-int +pkg syscall (freebsd-386-cgo), const IFF_POINTOPOINT ideal-int +pkg syscall (freebsd-386-cgo), const IFF_PPROMISC ideal-int +pkg syscall (freebsd-386-cgo), const IFF_PROMISC ideal-int +pkg syscall (freebsd-386-cgo), const IFF_RENAMING ideal-int +pkg syscall (freebsd-386-cgo), const IFF_RUNNING ideal-int +pkg syscall (freebsd-386-cgo), const IFF_SIMPLEX ideal-int +pkg syscall (freebsd-386-cgo), const IFF_SMART ideal-int +pkg syscall (freebsd-386-cgo), const IFF_STATICARP ideal-int +pkg syscall (freebsd-386-cgo), const IFNAMSIZ ideal-int +pkg syscall (freebsd-386-cgo), const IFT_1822 ideal-int +pkg syscall (freebsd-386-cgo), const IFT_A12MPPSWITCH ideal-int +pkg syscall (freebsd-386-cgo), const IFT_AAL2 ideal-int +pkg syscall (freebsd-386-cgo), const IFT_AAL5 ideal-int +pkg syscall (freebsd-386-cgo), const IFT_ADSL ideal-int +pkg syscall (freebsd-386-cgo), const IFT_AFLANE8023 ideal-int +pkg syscall (freebsd-386-cgo), const IFT_AFLANE8025 ideal-int +pkg syscall (freebsd-386-cgo), const IFT_ARAP ideal-int +pkg syscall (freebsd-386-cgo), const IFT_ARCNET ideal-int +pkg syscall (freebsd-386-cgo), const IFT_ARCNETPLUS ideal-int +pkg syscall (freebsd-386-cgo), const IFT_ASYNC ideal-int +pkg syscall (freebsd-386-cgo), const IFT_ATM ideal-int +pkg syscall (freebsd-386-cgo), const IFT_ATMDXI ideal-int +pkg syscall (freebsd-386-cgo), const IFT_ATMFUNI ideal-int +pkg syscall (freebsd-386-cgo), const IFT_ATMIMA ideal-int +pkg syscall (freebsd-386-cgo), const IFT_ATMLOGICAL ideal-int +pkg syscall (freebsd-386-cgo), const IFT_ATMRADIO ideal-int +pkg syscall (freebsd-386-cgo), const IFT_ATMSUBINTERFACE ideal-int +pkg syscall (freebsd-386-cgo), const IFT_ATMVCIENDPT ideal-int +pkg syscall (freebsd-386-cgo), const IFT_ATMVIRTUAL ideal-int +pkg syscall (freebsd-386-cgo), const IFT_BGPPOLICYACCOUNTING ideal-int +pkg syscall (freebsd-386-cgo), const IFT_BRIDGE ideal-int +pkg syscall (freebsd-386-cgo), const IFT_BSC ideal-int +pkg syscall (freebsd-386-cgo), const IFT_CARP ideal-int +pkg syscall (freebsd-386-cgo), const IFT_CCTEMUL ideal-int +pkg syscall (freebsd-386-cgo), const IFT_CEPT ideal-int +pkg syscall (freebsd-386-cgo), const IFT_CES ideal-int +pkg syscall (freebsd-386-cgo), const IFT_CHANNEL ideal-int +pkg syscall (freebsd-386-cgo), const IFT_CNR ideal-int +pkg syscall (freebsd-386-cgo), const IFT_COFFEE ideal-int +pkg syscall (freebsd-386-cgo), const IFT_COMPOSITELINK ideal-int +pkg syscall (freebsd-386-cgo), const IFT_DCN ideal-int +pkg syscall (freebsd-386-cgo), const IFT_DIGITALPOWERLINE ideal-int +pkg syscall (freebsd-386-cgo), const IFT_DIGITALWRAPPEROVERHEADCHANNEL ideal-int +pkg syscall (freebsd-386-cgo), const IFT_DLSW ideal-int +pkg syscall (freebsd-386-cgo), const IFT_DOCSCABLEDOWNSTREAM ideal-int +pkg syscall (freebsd-386-cgo), const IFT_DOCSCABLEMACLAYER ideal-int +pkg syscall (freebsd-386-cgo), const IFT_DOCSCABLEUPSTREAM ideal-int +pkg syscall (freebsd-386-cgo), const IFT_DS0 ideal-int +pkg syscall (freebsd-386-cgo), const IFT_DS0BUNDLE ideal-int +pkg syscall (freebsd-386-cgo), const IFT_DS1FDL ideal-int +pkg syscall (freebsd-386-cgo), const IFT_DS3 ideal-int +pkg syscall (freebsd-386-cgo), const IFT_DTM ideal-int +pkg syscall (freebsd-386-cgo), const IFT_DVBASILN ideal-int +pkg syscall (freebsd-386-cgo), const IFT_DVBASIOUT ideal-int +pkg syscall (freebsd-386-cgo), const IFT_DVBRCCDOWNSTREAM ideal-int +pkg syscall (freebsd-386-cgo), const IFT_DVBRCCMACLAYER ideal-int +pkg syscall (freebsd-386-cgo), const IFT_DVBRCCUPSTREAM ideal-int +pkg syscall (freebsd-386-cgo), const IFT_ENC ideal-int +pkg syscall (freebsd-386-cgo), const IFT_EON ideal-int +pkg syscall (freebsd-386-cgo), const IFT_EPLRS ideal-int +pkg syscall (freebsd-386-cgo), const IFT_ESCON ideal-int +pkg syscall (freebsd-386-cgo), const IFT_ETHER ideal-int +pkg syscall (freebsd-386-cgo), const IFT_FAITH ideal-int +pkg syscall (freebsd-386-cgo), const IFT_FAST ideal-int +pkg syscall (freebsd-386-cgo), const IFT_FASTETHER ideal-int +pkg syscall (freebsd-386-cgo), const IFT_FASTETHERFX ideal-int +pkg syscall (freebsd-386-cgo), const IFT_FDDI ideal-int +pkg syscall (freebsd-386-cgo), const IFT_FIBRECHANNEL ideal-int +pkg syscall (freebsd-386-cgo), const IFT_FRAMERELAYINTERCONNECT ideal-int +pkg syscall (freebsd-386-cgo), const IFT_FRAMERELAYMPI ideal-int +pkg syscall (freebsd-386-cgo), const IFT_FRDLCIENDPT ideal-int +pkg syscall (freebsd-386-cgo), const IFT_FRELAY ideal-int +pkg syscall (freebsd-386-cgo), const IFT_FRELAYDCE ideal-int +pkg syscall (freebsd-386-cgo), const IFT_FRF16MFRBUNDLE ideal-int +pkg syscall (freebsd-386-cgo), const IFT_FRFORWARD ideal-int +pkg syscall (freebsd-386-cgo), const IFT_G703AT2MB ideal-int +pkg syscall (freebsd-386-cgo), const IFT_G703AT64K ideal-int +pkg syscall (freebsd-386-cgo), const IFT_GIF ideal-int +pkg syscall (freebsd-386-cgo), const IFT_GIGABITETHERNET ideal-int +pkg syscall (freebsd-386-cgo), const IFT_GR303IDT ideal-int +pkg syscall (freebsd-386-cgo), const IFT_GR303RDT ideal-int +pkg syscall (freebsd-386-cgo), const IFT_H323GATEKEEPER ideal-int +pkg syscall (freebsd-386-cgo), const IFT_H323PROXY ideal-int +pkg syscall (freebsd-386-cgo), const IFT_HDH1822 ideal-int +pkg syscall (freebsd-386-cgo), const IFT_HDLC ideal-int +pkg syscall (freebsd-386-cgo), const IFT_HDSL2 ideal-int +pkg syscall (freebsd-386-cgo), const IFT_HIPERLAN2 ideal-int +pkg syscall (freebsd-386-cgo), const IFT_HIPPI ideal-int +pkg syscall (freebsd-386-cgo), const IFT_HIPPIINTERFACE ideal-int +pkg syscall (freebsd-386-cgo), const IFT_HOSTPAD ideal-int +pkg syscall (freebsd-386-cgo), const IFT_HSSI ideal-int +pkg syscall (freebsd-386-cgo), const IFT_HY ideal-int +pkg syscall (freebsd-386-cgo), const IFT_IBM370PARCHAN ideal-int +pkg syscall (freebsd-386-cgo), const IFT_IDSL ideal-int +pkg syscall (freebsd-386-cgo), const IFT_IEEE1394 ideal-int +pkg syscall (freebsd-386-cgo), const IFT_IEEE80211 ideal-int +pkg syscall (freebsd-386-cgo), const IFT_IEEE80212 ideal-int +pkg syscall (freebsd-386-cgo), const IFT_IEEE8023ADLAG ideal-int +pkg syscall (freebsd-386-cgo), const IFT_IFGSN ideal-int +pkg syscall (freebsd-386-cgo), const IFT_IMT ideal-int +pkg syscall (freebsd-386-cgo), const IFT_INFINIBAND ideal-int +pkg syscall (freebsd-386-cgo), const IFT_INTERLEAVE ideal-int +pkg syscall (freebsd-386-cgo), const IFT_IP ideal-int +pkg syscall (freebsd-386-cgo), const IFT_IPFORWARD ideal-int +pkg syscall (freebsd-386-cgo), const IFT_IPOVERATM ideal-int +pkg syscall (freebsd-386-cgo), const IFT_IPOVERCDLC ideal-int +pkg syscall (freebsd-386-cgo), const IFT_IPOVERCLAW ideal-int +pkg syscall (freebsd-386-cgo), const IFT_IPSWITCH ideal-int +pkg syscall (freebsd-386-cgo), const IFT_IPXIP ideal-int +pkg syscall (freebsd-386-cgo), const IFT_ISDN ideal-int +pkg syscall (freebsd-386-cgo), const IFT_ISDNBASIC ideal-int +pkg syscall (freebsd-386-cgo), const IFT_ISDNPRIMARY ideal-int +pkg syscall (freebsd-386-cgo), const IFT_ISDNS ideal-int +pkg syscall (freebsd-386-cgo), const IFT_ISDNU ideal-int +pkg syscall (freebsd-386-cgo), const IFT_ISO88022LLC ideal-int +pkg syscall (freebsd-386-cgo), const IFT_ISO88023 ideal-int +pkg syscall (freebsd-386-cgo), const IFT_ISO88024 ideal-int +pkg syscall (freebsd-386-cgo), const IFT_ISO88025 ideal-int +pkg syscall (freebsd-386-cgo), const IFT_ISO88025CRFPINT ideal-int +pkg syscall (freebsd-386-cgo), const IFT_ISO88025DTR ideal-int +pkg syscall (freebsd-386-cgo), const IFT_ISO88025FIBER ideal-int +pkg syscall (freebsd-386-cgo), const IFT_ISO88026 ideal-int +pkg syscall (freebsd-386-cgo), const IFT_ISUP ideal-int +pkg syscall (freebsd-386-cgo), const IFT_L2VLAN ideal-int +pkg syscall (freebsd-386-cgo), const IFT_L3IPVLAN ideal-int +pkg syscall (freebsd-386-cgo), const IFT_L3IPXVLAN ideal-int +pkg syscall (freebsd-386-cgo), const IFT_LAPB ideal-int +pkg syscall (freebsd-386-cgo), const IFT_LAPD ideal-int +pkg syscall (freebsd-386-cgo), const IFT_LAPF ideal-int +pkg syscall (freebsd-386-cgo), const IFT_LOCALTALK ideal-int +pkg syscall (freebsd-386-cgo), const IFT_LOOP ideal-int +pkg syscall (freebsd-386-cgo), const IFT_MEDIAMAILOVERIP ideal-int +pkg syscall (freebsd-386-cgo), const IFT_MFSIGLINK ideal-int +pkg syscall (freebsd-386-cgo), const IFT_MIOX25 ideal-int +pkg syscall (freebsd-386-cgo), const IFT_MODEM ideal-int +pkg syscall (freebsd-386-cgo), const IFT_MPC ideal-int +pkg syscall (freebsd-386-cgo), const IFT_MPLS ideal-int +pkg syscall (freebsd-386-cgo), const IFT_MPLSTUNNEL ideal-int +pkg syscall (freebsd-386-cgo), const IFT_MSDSL ideal-int +pkg syscall (freebsd-386-cgo), const IFT_MVL ideal-int +pkg syscall (freebsd-386-cgo), const IFT_MYRINET ideal-int +pkg syscall (freebsd-386-cgo), const IFT_NFAS ideal-int +pkg syscall (freebsd-386-cgo), const IFT_NSIP ideal-int +pkg syscall (freebsd-386-cgo), const IFT_OPTICALCHANNEL ideal-int +pkg syscall (freebsd-386-cgo), const IFT_OPTICALTRANSPORT ideal-int +pkg syscall (freebsd-386-cgo), const IFT_OTHER ideal-int +pkg syscall (freebsd-386-cgo), const IFT_P10 ideal-int +pkg syscall (freebsd-386-cgo), const IFT_P80 ideal-int +pkg syscall (freebsd-386-cgo), const IFT_PARA ideal-int +pkg syscall (freebsd-386-cgo), const IFT_PFLOG ideal-int +pkg syscall (freebsd-386-cgo), const IFT_PFSYNC ideal-int +pkg syscall (freebsd-386-cgo), const IFT_PLC ideal-int +pkg syscall (freebsd-386-cgo), const IFT_POS ideal-int +pkg syscall (freebsd-386-cgo), const IFT_PPP ideal-int +pkg syscall (freebsd-386-cgo), const IFT_PPPMULTILINKBUNDLE ideal-int +pkg syscall (freebsd-386-cgo), const IFT_PROPBWAP2MP ideal-int +pkg syscall (freebsd-386-cgo), const IFT_PROPCNLS ideal-int +pkg syscall (freebsd-386-cgo), const IFT_PROPDOCSWIRELESSDOWNSTREAM ideal-int +pkg syscall (freebsd-386-cgo), const IFT_PROPDOCSWIRELESSMACLAYER ideal-int +pkg syscall (freebsd-386-cgo), const IFT_PROPDOCSWIRELESSUPSTREAM ideal-int +pkg syscall (freebsd-386-cgo), const IFT_PROPMUX ideal-int +pkg syscall (freebsd-386-cgo), const IFT_PROPVIRTUAL ideal-int +pkg syscall (freebsd-386-cgo), const IFT_PROPWIRELESSP2P ideal-int +pkg syscall (freebsd-386-cgo), const IFT_PTPSERIAL ideal-int +pkg syscall (freebsd-386-cgo), const IFT_PVC ideal-int +pkg syscall (freebsd-386-cgo), const IFT_QLLC ideal-int +pkg syscall (freebsd-386-cgo), const IFT_RADIOMAC ideal-int +pkg syscall (freebsd-386-cgo), const IFT_RADSL ideal-int +pkg syscall (freebsd-386-cgo), const IFT_REACHDSL ideal-int +pkg syscall (freebsd-386-cgo), const IFT_RFC1483 ideal-int +pkg syscall (freebsd-386-cgo), const IFT_RS232 ideal-int +pkg syscall (freebsd-386-cgo), const IFT_RSRB ideal-int +pkg syscall (freebsd-386-cgo), const IFT_SDLC ideal-int +pkg syscall (freebsd-386-cgo), const IFT_SDSL ideal-int +pkg syscall (freebsd-386-cgo), const IFT_SHDSL ideal-int +pkg syscall (freebsd-386-cgo), const IFT_SIP ideal-int +pkg syscall (freebsd-386-cgo), const IFT_SLIP ideal-int +pkg syscall (freebsd-386-cgo), const IFT_SMDSDXI ideal-int +pkg syscall (freebsd-386-cgo), const IFT_SMDSICIP ideal-int +pkg syscall (freebsd-386-cgo), const IFT_SONET ideal-int +pkg syscall (freebsd-386-cgo), const IFT_SONETOVERHEADCHANNEL ideal-int +pkg syscall (freebsd-386-cgo), const IFT_SONETPATH ideal-int +pkg syscall (freebsd-386-cgo), const IFT_SONETVT ideal-int +pkg syscall (freebsd-386-cgo), const IFT_SRP ideal-int +pkg syscall (freebsd-386-cgo), const IFT_SS7SIGLINK ideal-int +pkg syscall (freebsd-386-cgo), const IFT_STACKTOSTACK ideal-int +pkg syscall (freebsd-386-cgo), const IFT_STARLAN ideal-int +pkg syscall (freebsd-386-cgo), const IFT_STF ideal-int +pkg syscall (freebsd-386-cgo), const IFT_T1 ideal-int +pkg syscall (freebsd-386-cgo), const IFT_TDLC ideal-int +pkg syscall (freebsd-386-cgo), const IFT_TERMPAD ideal-int +pkg syscall (freebsd-386-cgo), const IFT_TR008 ideal-int +pkg syscall (freebsd-386-cgo), const IFT_TRANSPHDLC ideal-int +pkg syscall (freebsd-386-cgo), const IFT_TUNNEL ideal-int +pkg syscall (freebsd-386-cgo), const IFT_ULTRA ideal-int +pkg syscall (freebsd-386-cgo), const IFT_USB ideal-int +pkg syscall (freebsd-386-cgo), const IFT_V11 ideal-int +pkg syscall (freebsd-386-cgo), const IFT_V35 ideal-int +pkg syscall (freebsd-386-cgo), const IFT_V36 ideal-int +pkg syscall (freebsd-386-cgo), const IFT_V37 ideal-int +pkg syscall (freebsd-386-cgo), const IFT_VDSL ideal-int +pkg syscall (freebsd-386-cgo), const IFT_VIRTUALIPADDRESS ideal-int +pkg syscall (freebsd-386-cgo), const IFT_VOICEEM ideal-int +pkg syscall (freebsd-386-cgo), const IFT_VOICEENCAP ideal-int +pkg syscall (freebsd-386-cgo), const IFT_VOICEFXO ideal-int +pkg syscall (freebsd-386-cgo), const IFT_VOICEFXS ideal-int +pkg syscall (freebsd-386-cgo), const IFT_VOICEOVERATM ideal-int +pkg syscall (freebsd-386-cgo), const IFT_VOICEOVERFRAMERELAY ideal-int +pkg syscall (freebsd-386-cgo), const IFT_VOICEOVERIP ideal-int +pkg syscall (freebsd-386-cgo), const IFT_X213 ideal-int +pkg syscall (freebsd-386-cgo), const IFT_X25 ideal-int +pkg syscall (freebsd-386-cgo), const IFT_X25DDN ideal-int +pkg syscall (freebsd-386-cgo), const IFT_X25HUNTGROUP ideal-int +pkg syscall (freebsd-386-cgo), const IFT_X25MLP ideal-int +pkg syscall (freebsd-386-cgo), const IFT_X25PLE ideal-int +pkg syscall (freebsd-386-cgo), const IFT_XETHER ideal-int +pkg syscall (freebsd-386-cgo), const IGNBRK ideal-int +pkg syscall (freebsd-386-cgo), const IGNCR ideal-int +pkg syscall (freebsd-386-cgo), const IGNPAR ideal-int +pkg syscall (freebsd-386-cgo), const IMAXBEL ideal-int +pkg syscall (freebsd-386-cgo), const INLCR ideal-int +pkg syscall (freebsd-386-cgo), const INPCK ideal-int +pkg syscall (freebsd-386-cgo), const IN_CLASSA_HOST ideal-int +pkg syscall (freebsd-386-cgo), const IN_CLASSA_MAX ideal-int +pkg syscall (freebsd-386-cgo), const IN_CLASSA_NET ideal-int +pkg syscall (freebsd-386-cgo), const IN_CLASSA_NSHIFT ideal-int +pkg syscall (freebsd-386-cgo), const IN_CLASSB_HOST ideal-int +pkg syscall (freebsd-386-cgo), const IN_CLASSB_MAX ideal-int +pkg syscall (freebsd-386-cgo), const IN_CLASSB_NET ideal-int +pkg syscall (freebsd-386-cgo), const IN_CLASSB_NSHIFT ideal-int +pkg syscall (freebsd-386-cgo), const IN_CLASSC_HOST ideal-int +pkg syscall (freebsd-386-cgo), const IN_CLASSC_NET ideal-int +pkg syscall (freebsd-386-cgo), const IN_CLASSC_NSHIFT ideal-int +pkg syscall (freebsd-386-cgo), const IN_CLASSD_HOST ideal-int +pkg syscall (freebsd-386-cgo), const IN_CLASSD_NET ideal-int +pkg syscall (freebsd-386-cgo), const IN_CLASSD_NSHIFT ideal-int +pkg syscall (freebsd-386-cgo), const IN_LOOPBACKNET ideal-int +pkg syscall (freebsd-386-cgo), const IN_RFC3021_MASK ideal-int +pkg syscall (freebsd-386-cgo), const IPPROTO_3PC ideal-int +pkg syscall (freebsd-386-cgo), const IPPROTO_ADFS ideal-int +pkg syscall (freebsd-386-cgo), const IPPROTO_AH ideal-int +pkg syscall (freebsd-386-cgo), const IPPROTO_AHIP ideal-int +pkg syscall (freebsd-386-cgo), const IPPROTO_APES ideal-int +pkg syscall (freebsd-386-cgo), const IPPROTO_ARGUS ideal-int +pkg syscall (freebsd-386-cgo), const IPPROTO_AX25 ideal-int +pkg syscall (freebsd-386-cgo), const IPPROTO_BHA ideal-int +pkg syscall (freebsd-386-cgo), const IPPROTO_BLT ideal-int +pkg syscall (freebsd-386-cgo), const IPPROTO_BRSATMON ideal-int +pkg syscall (freebsd-386-cgo), const IPPROTO_CARP ideal-int +pkg syscall (freebsd-386-cgo), const IPPROTO_CFTP ideal-int +pkg syscall (freebsd-386-cgo), const IPPROTO_CHAOS ideal-int +pkg syscall (freebsd-386-cgo), const IPPROTO_CMTP ideal-int +pkg syscall (freebsd-386-cgo), const IPPROTO_CPHB ideal-int +pkg syscall (freebsd-386-cgo), const IPPROTO_CPNX ideal-int +pkg syscall (freebsd-386-cgo), const IPPROTO_DDP ideal-int +pkg syscall (freebsd-386-cgo), const IPPROTO_DGP ideal-int +pkg syscall (freebsd-386-cgo), const IPPROTO_DIVERT ideal-int +pkg syscall (freebsd-386-cgo), const IPPROTO_DONE ideal-int +pkg syscall (freebsd-386-cgo), const IPPROTO_DSTOPTS ideal-int +pkg syscall (freebsd-386-cgo), const IPPROTO_EGP ideal-int +pkg syscall (freebsd-386-cgo), const IPPROTO_EMCON ideal-int +pkg syscall (freebsd-386-cgo), const IPPROTO_ENCAP ideal-int +pkg syscall (freebsd-386-cgo), const IPPROTO_EON ideal-int +pkg syscall (freebsd-386-cgo), const IPPROTO_ESP ideal-int +pkg syscall (freebsd-386-cgo), const IPPROTO_ETHERIP ideal-int +pkg syscall (freebsd-386-cgo), const IPPROTO_FRAGMENT ideal-int +pkg syscall (freebsd-386-cgo), const IPPROTO_GGP ideal-int +pkg syscall (freebsd-386-cgo), const IPPROTO_GMTP ideal-int +pkg syscall (freebsd-386-cgo), const IPPROTO_GRE ideal-int +pkg syscall (freebsd-386-cgo), const IPPROTO_HELLO ideal-int +pkg syscall (freebsd-386-cgo), const IPPROTO_HMP ideal-int +pkg syscall (freebsd-386-cgo), const IPPROTO_HOPOPTS ideal-int +pkg syscall (freebsd-386-cgo), const IPPROTO_ICMP ideal-int +pkg syscall (freebsd-386-cgo), const IPPROTO_ICMPV6 ideal-int +pkg syscall (freebsd-386-cgo), const IPPROTO_IDP ideal-int +pkg syscall (freebsd-386-cgo), const IPPROTO_IDPR ideal-int +pkg syscall (freebsd-386-cgo), const IPPROTO_IDRP ideal-int +pkg syscall (freebsd-386-cgo), const IPPROTO_IGMP ideal-int +pkg syscall (freebsd-386-cgo), const IPPROTO_IGP ideal-int +pkg syscall (freebsd-386-cgo), const IPPROTO_IGRP ideal-int +pkg syscall (freebsd-386-cgo), const IPPROTO_IL ideal-int +pkg syscall (freebsd-386-cgo), const IPPROTO_INLSP ideal-int +pkg syscall (freebsd-386-cgo), const IPPROTO_INP ideal-int +pkg syscall (freebsd-386-cgo), const IPPROTO_IPCOMP ideal-int +pkg syscall (freebsd-386-cgo), const IPPROTO_IPCV ideal-int +pkg syscall (freebsd-386-cgo), const IPPROTO_IPEIP ideal-int +pkg syscall (freebsd-386-cgo), const IPPROTO_IPIP ideal-int +pkg syscall (freebsd-386-cgo), const IPPROTO_IPPC ideal-int +pkg syscall (freebsd-386-cgo), const IPPROTO_IPV4 ideal-int +pkg syscall (freebsd-386-cgo), const IPPROTO_IRTP ideal-int +pkg syscall (freebsd-386-cgo), const IPPROTO_KRYPTOLAN ideal-int +pkg syscall (freebsd-386-cgo), const IPPROTO_LARP ideal-int +pkg syscall (freebsd-386-cgo), const IPPROTO_LEAF1 ideal-int +pkg syscall (freebsd-386-cgo), const IPPROTO_LEAF2 ideal-int +pkg syscall (freebsd-386-cgo), const IPPROTO_MAX ideal-int +pkg syscall (freebsd-386-cgo), const IPPROTO_MAXID ideal-int +pkg syscall (freebsd-386-cgo), const IPPROTO_MEAS ideal-int +pkg syscall (freebsd-386-cgo), const IPPROTO_MH ideal-int +pkg syscall (freebsd-386-cgo), const IPPROTO_MHRP ideal-int +pkg syscall (freebsd-386-cgo), const IPPROTO_MICP ideal-int +pkg syscall (freebsd-386-cgo), const IPPROTO_MOBILE ideal-int +pkg syscall (freebsd-386-cgo), const IPPROTO_MTP ideal-int +pkg syscall (freebsd-386-cgo), const IPPROTO_MUX ideal-int +pkg syscall (freebsd-386-cgo), const IPPROTO_ND ideal-int +pkg syscall (freebsd-386-cgo), const IPPROTO_NHRP ideal-int +pkg syscall (freebsd-386-cgo), const IPPROTO_NONE ideal-int +pkg syscall (freebsd-386-cgo), const IPPROTO_NSP ideal-int +pkg syscall (freebsd-386-cgo), const IPPROTO_NVPII ideal-int +pkg syscall (freebsd-386-cgo), const IPPROTO_OLD_DIVERT ideal-int +pkg syscall (freebsd-386-cgo), const IPPROTO_OSPFIGP ideal-int +pkg syscall (freebsd-386-cgo), const IPPROTO_PFSYNC ideal-int +pkg syscall (freebsd-386-cgo), const IPPROTO_PGM ideal-int +pkg syscall (freebsd-386-cgo), const IPPROTO_PIGP ideal-int +pkg syscall (freebsd-386-cgo), const IPPROTO_PIM ideal-int +pkg syscall (freebsd-386-cgo), const IPPROTO_PRM ideal-int +pkg syscall (freebsd-386-cgo), const IPPROTO_PUP ideal-int +pkg syscall (freebsd-386-cgo), const IPPROTO_PVP ideal-int +pkg syscall (freebsd-386-cgo), const IPPROTO_RAW ideal-int +pkg syscall (freebsd-386-cgo), const IPPROTO_RCCMON ideal-int +pkg syscall (freebsd-386-cgo), const IPPROTO_RDP ideal-int +pkg syscall (freebsd-386-cgo), const IPPROTO_ROUTING ideal-int +pkg syscall (freebsd-386-cgo), const IPPROTO_RSVP ideal-int +pkg syscall (freebsd-386-cgo), const IPPROTO_RVD ideal-int +pkg syscall (freebsd-386-cgo), const IPPROTO_SATEXPAK ideal-int +pkg syscall (freebsd-386-cgo), const IPPROTO_SATMON ideal-int +pkg syscall (freebsd-386-cgo), const IPPROTO_SCCSP ideal-int +pkg syscall (freebsd-386-cgo), const IPPROTO_SCTP ideal-int +pkg syscall (freebsd-386-cgo), const IPPROTO_SDRP ideal-int +pkg syscall (freebsd-386-cgo), const IPPROTO_SEND ideal-int +pkg syscall (freebsd-386-cgo), const IPPROTO_SEP ideal-int +pkg syscall (freebsd-386-cgo), const IPPROTO_SKIP ideal-int +pkg syscall (freebsd-386-cgo), const IPPROTO_SPACER ideal-int +pkg syscall (freebsd-386-cgo), const IPPROTO_SRPC ideal-int +pkg syscall (freebsd-386-cgo), const IPPROTO_ST ideal-int +pkg syscall (freebsd-386-cgo), const IPPROTO_SVMTP ideal-int +pkg syscall (freebsd-386-cgo), const IPPROTO_SWIPE ideal-int +pkg syscall (freebsd-386-cgo), const IPPROTO_TCF ideal-int +pkg syscall (freebsd-386-cgo), const IPPROTO_TLSP ideal-int +pkg syscall (freebsd-386-cgo), const IPPROTO_TP ideal-int +pkg syscall (freebsd-386-cgo), const IPPROTO_TPXX ideal-int +pkg syscall (freebsd-386-cgo), const IPPROTO_TRUNK1 ideal-int +pkg syscall (freebsd-386-cgo), const IPPROTO_TRUNK2 ideal-int +pkg syscall (freebsd-386-cgo), const IPPROTO_TTP ideal-int +pkg syscall (freebsd-386-cgo), const IPPROTO_VINES ideal-int +pkg syscall (freebsd-386-cgo), const IPPROTO_VISA ideal-int +pkg syscall (freebsd-386-cgo), const IPPROTO_VMTP ideal-int +pkg syscall (freebsd-386-cgo), const IPPROTO_WBEXPAK ideal-int +pkg syscall (freebsd-386-cgo), const IPPROTO_WBMON ideal-int +pkg syscall (freebsd-386-cgo), const IPPROTO_WSN ideal-int +pkg syscall (freebsd-386-cgo), const IPPROTO_XNET ideal-int +pkg syscall (freebsd-386-cgo), const IPPROTO_XTP ideal-int +pkg syscall (freebsd-386-cgo), const IPV6_AUTOFLOWLABEL ideal-int +pkg syscall (freebsd-386-cgo), const IPV6_BINDANY ideal-int +pkg syscall (freebsd-386-cgo), const IPV6_BINDV6ONLY ideal-int +pkg syscall (freebsd-386-cgo), const IPV6_CHECKSUM ideal-int +pkg syscall (freebsd-386-cgo), const IPV6_DEFAULT_MULTICAST_HOPS ideal-int +pkg syscall (freebsd-386-cgo), const IPV6_DEFAULT_MULTICAST_LOOP ideal-int +pkg syscall (freebsd-386-cgo), const IPV6_DEFHLIM ideal-int +pkg syscall (freebsd-386-cgo), const IPV6_DONTFRAG ideal-int +pkg syscall (freebsd-386-cgo), const IPV6_DSTOPTS ideal-int +pkg syscall (freebsd-386-cgo), const IPV6_FAITH ideal-int +pkg syscall (freebsd-386-cgo), const IPV6_FLOWINFO_MASK ideal-int +pkg syscall (freebsd-386-cgo), const IPV6_FLOWLABEL_MASK ideal-int +pkg syscall (freebsd-386-cgo), const IPV6_FRAGTTL ideal-int +pkg syscall (freebsd-386-cgo), const IPV6_FW_ADD ideal-int +pkg syscall (freebsd-386-cgo), const IPV6_FW_DEL ideal-int +pkg syscall (freebsd-386-cgo), const IPV6_FW_FLUSH ideal-int +pkg syscall (freebsd-386-cgo), const IPV6_FW_GET ideal-int +pkg syscall (freebsd-386-cgo), const IPV6_FW_ZERO ideal-int +pkg syscall (freebsd-386-cgo), const IPV6_HLIMDEC ideal-int +pkg syscall (freebsd-386-cgo), const IPV6_HOPLIMIT ideal-int +pkg syscall (freebsd-386-cgo), const IPV6_HOPOPTS ideal-int +pkg syscall (freebsd-386-cgo), const IPV6_IPSEC_POLICY ideal-int +pkg syscall (freebsd-386-cgo), const IPV6_MAXHLIM ideal-int +pkg syscall (freebsd-386-cgo), const IPV6_MAXOPTHDR ideal-int +pkg syscall (freebsd-386-cgo), const IPV6_MAXPACKET ideal-int +pkg syscall (freebsd-386-cgo), const IPV6_MAX_GROUP_SRC_FILTER ideal-int +pkg syscall (freebsd-386-cgo), const IPV6_MAX_MEMBERSHIPS ideal-int +pkg syscall (freebsd-386-cgo), const IPV6_MAX_SOCK_SRC_FILTER ideal-int +pkg syscall (freebsd-386-cgo), const IPV6_MIN_MEMBERSHIPS ideal-int +pkg syscall (freebsd-386-cgo), const IPV6_MMTU ideal-int +pkg syscall (freebsd-386-cgo), const IPV6_MSFILTER ideal-int +pkg syscall (freebsd-386-cgo), const IPV6_NEXTHOP ideal-int +pkg syscall (freebsd-386-cgo), const IPV6_PATHMTU ideal-int +pkg syscall (freebsd-386-cgo), const IPV6_PKTINFO ideal-int +pkg syscall (freebsd-386-cgo), const IPV6_PORTRANGE ideal-int +pkg syscall (freebsd-386-cgo), const IPV6_PORTRANGE_DEFAULT ideal-int +pkg syscall (freebsd-386-cgo), const IPV6_PORTRANGE_HIGH ideal-int +pkg syscall (freebsd-386-cgo), const IPV6_PORTRANGE_LOW ideal-int +pkg syscall (freebsd-386-cgo), const IPV6_PREFER_TEMPADDR ideal-int +pkg syscall (freebsd-386-cgo), const IPV6_RECVDSTOPTS ideal-int +pkg syscall (freebsd-386-cgo), const IPV6_RECVHOPLIMIT ideal-int +pkg syscall (freebsd-386-cgo), const IPV6_RECVHOPOPTS ideal-int +pkg syscall (freebsd-386-cgo), const IPV6_RECVPATHMTU ideal-int +pkg syscall (freebsd-386-cgo), const IPV6_RECVPKTINFO ideal-int +pkg syscall (freebsd-386-cgo), const IPV6_RECVRTHDR ideal-int +pkg syscall (freebsd-386-cgo), const IPV6_RECVTCLASS ideal-int +pkg syscall (freebsd-386-cgo), const IPV6_RTHDR ideal-int +pkg syscall (freebsd-386-cgo), const IPV6_RTHDRDSTOPTS ideal-int +pkg syscall (freebsd-386-cgo), const IPV6_RTHDR_LOOSE ideal-int +pkg syscall (freebsd-386-cgo), const IPV6_RTHDR_STRICT ideal-int +pkg syscall (freebsd-386-cgo), const IPV6_RTHDR_TYPE_0 ideal-int +pkg syscall (freebsd-386-cgo), const IPV6_SOCKOPT_RESERVED1 ideal-int +pkg syscall (freebsd-386-cgo), const IPV6_TCLASS ideal-int +pkg syscall (freebsd-386-cgo), const IPV6_USE_MIN_MTU ideal-int +pkg syscall (freebsd-386-cgo), const IPV6_VERSION ideal-int +pkg syscall (freebsd-386-cgo), const IPV6_VERSION_MASK ideal-int +pkg syscall (freebsd-386-cgo), const IP_ADD_SOURCE_MEMBERSHIP ideal-int +pkg syscall (freebsd-386-cgo), const IP_BINDANY ideal-int +pkg syscall (freebsd-386-cgo), const IP_BLOCK_SOURCE ideal-int +pkg syscall (freebsd-386-cgo), const IP_DEFAULT_MULTICAST_LOOP ideal-int +pkg syscall (freebsd-386-cgo), const IP_DEFAULT_MULTICAST_TTL ideal-int +pkg syscall (freebsd-386-cgo), const IP_DF ideal-int +pkg syscall (freebsd-386-cgo), const IP_DONTFRAG ideal-int +pkg syscall (freebsd-386-cgo), const IP_DROP_SOURCE_MEMBERSHIP ideal-int +pkg syscall (freebsd-386-cgo), const IP_DUMMYNET3 ideal-int +pkg syscall (freebsd-386-cgo), const IP_DUMMYNET_CONFIGURE ideal-int +pkg syscall (freebsd-386-cgo), const IP_DUMMYNET_DEL ideal-int +pkg syscall (freebsd-386-cgo), const IP_DUMMYNET_FLUSH ideal-int +pkg syscall (freebsd-386-cgo), const IP_DUMMYNET_GET ideal-int +pkg syscall (freebsd-386-cgo), const IP_FAITH ideal-int +pkg syscall (freebsd-386-cgo), const IP_FW3 ideal-int +pkg syscall (freebsd-386-cgo), const IP_FW_ADD ideal-int +pkg syscall (freebsd-386-cgo), const IP_FW_DEL ideal-int +pkg syscall (freebsd-386-cgo), const IP_FW_FLUSH ideal-int +pkg syscall (freebsd-386-cgo), const IP_FW_GET ideal-int +pkg syscall (freebsd-386-cgo), const IP_FW_NAT_CFG ideal-int +pkg syscall (freebsd-386-cgo), const IP_FW_NAT_DEL ideal-int +pkg syscall (freebsd-386-cgo), const IP_FW_NAT_GET_CONFIG ideal-int +pkg syscall (freebsd-386-cgo), const IP_FW_NAT_GET_LOG ideal-int +pkg syscall (freebsd-386-cgo), const IP_FW_RESETLOG ideal-int +pkg syscall (freebsd-386-cgo), const IP_FW_TABLE_ADD ideal-int +pkg syscall (freebsd-386-cgo), const IP_FW_TABLE_DEL ideal-int +pkg syscall (freebsd-386-cgo), const IP_FW_TABLE_FLUSH ideal-int +pkg syscall (freebsd-386-cgo), const IP_FW_TABLE_GETSIZE ideal-int +pkg syscall (freebsd-386-cgo), const IP_FW_TABLE_LIST ideal-int +pkg syscall (freebsd-386-cgo), const IP_FW_ZERO ideal-int +pkg syscall (freebsd-386-cgo), const IP_HDRINCL ideal-int +pkg syscall (freebsd-386-cgo), const IP_IPSEC_POLICY ideal-int +pkg syscall (freebsd-386-cgo), const IP_MAXPACKET ideal-int +pkg syscall (freebsd-386-cgo), const IP_MAX_GROUP_SRC_FILTER ideal-int +pkg syscall (freebsd-386-cgo), const IP_MAX_MEMBERSHIPS ideal-int +pkg syscall (freebsd-386-cgo), const IP_MAX_SOCK_MUTE_FILTER ideal-int +pkg syscall (freebsd-386-cgo), const IP_MAX_SOCK_SRC_FILTER ideal-int +pkg syscall (freebsd-386-cgo), const IP_MAX_SOURCE_FILTER ideal-int +pkg syscall (freebsd-386-cgo), const IP_MF ideal-int +pkg syscall (freebsd-386-cgo), const IP_MINTTL ideal-int +pkg syscall (freebsd-386-cgo), const IP_MIN_MEMBERSHIPS ideal-int +pkg syscall (freebsd-386-cgo), const IP_MSFILTER ideal-int +pkg syscall (freebsd-386-cgo), const IP_MSS ideal-int +pkg syscall (freebsd-386-cgo), const IP_MULTICAST_VIF ideal-int +pkg syscall (freebsd-386-cgo), const IP_OFFMASK ideal-int +pkg syscall (freebsd-386-cgo), const IP_ONESBCAST ideal-int +pkg syscall (freebsd-386-cgo), const IP_OPTIONS ideal-int +pkg syscall (freebsd-386-cgo), const IP_PORTRANGE ideal-int +pkg syscall (freebsd-386-cgo), const IP_PORTRANGE_DEFAULT ideal-int +pkg syscall (freebsd-386-cgo), const IP_PORTRANGE_HIGH ideal-int +pkg syscall (freebsd-386-cgo), const IP_PORTRANGE_LOW ideal-int +pkg syscall (freebsd-386-cgo), const IP_RECVDSTADDR ideal-int +pkg syscall (freebsd-386-cgo), const IP_RECVIF ideal-int +pkg syscall (freebsd-386-cgo), const IP_RECVOPTS ideal-int +pkg syscall (freebsd-386-cgo), const IP_RECVRETOPTS ideal-int +pkg syscall (freebsd-386-cgo), const IP_RECVTOS ideal-int +pkg syscall (freebsd-386-cgo), const IP_RECVTTL ideal-int +pkg syscall (freebsd-386-cgo), const IP_RETOPTS ideal-int +pkg syscall (freebsd-386-cgo), const IP_RF ideal-int +pkg syscall (freebsd-386-cgo), const IP_RSVP_OFF ideal-int +pkg syscall (freebsd-386-cgo), const IP_RSVP_ON ideal-int +pkg syscall (freebsd-386-cgo), const IP_RSVP_VIF_OFF ideal-int +pkg syscall (freebsd-386-cgo), const IP_RSVP_VIF_ON ideal-int +pkg syscall (freebsd-386-cgo), const IP_SENDSRCADDR ideal-int +pkg syscall (freebsd-386-cgo), const IP_UNBLOCK_SOURCE ideal-int +pkg syscall (freebsd-386-cgo), const ISIG ideal-int +pkg syscall (freebsd-386-cgo), const ISTRIP ideal-int +pkg syscall (freebsd-386-cgo), const IXANY ideal-int +pkg syscall (freebsd-386-cgo), const IXOFF ideal-int +pkg syscall (freebsd-386-cgo), const IXON ideal-int +pkg syscall (freebsd-386-cgo), const LOCK_EX ideal-int +pkg syscall (freebsd-386-cgo), const LOCK_NB ideal-int +pkg syscall (freebsd-386-cgo), const LOCK_SH ideal-int +pkg syscall (freebsd-386-cgo), const LOCK_UN ideal-int +pkg syscall (freebsd-386-cgo), const MADV_AUTOSYNC ideal-int +pkg syscall (freebsd-386-cgo), const MADV_CORE ideal-int +pkg syscall (freebsd-386-cgo), const MADV_DONTNEED ideal-int +pkg syscall (freebsd-386-cgo), const MADV_FREE ideal-int +pkg syscall (freebsd-386-cgo), const MADV_NOCORE ideal-int +pkg syscall (freebsd-386-cgo), const MADV_NORMAL ideal-int +pkg syscall (freebsd-386-cgo), const MADV_NOSYNC ideal-int +pkg syscall (freebsd-386-cgo), const MADV_PROTECT ideal-int +pkg syscall (freebsd-386-cgo), const MADV_RANDOM ideal-int +pkg syscall (freebsd-386-cgo), const MADV_SEQUENTIAL ideal-int +pkg syscall (freebsd-386-cgo), const MADV_WILLNEED ideal-int +pkg syscall (freebsd-386-cgo), const MAP_ANON ideal-int +pkg syscall (freebsd-386-cgo), const MAP_ANONYMOUS ideal-int +pkg syscall (freebsd-386-cgo), const MAP_COPY ideal-int +pkg syscall (freebsd-386-cgo), const MAP_FILE ideal-int +pkg syscall (freebsd-386-cgo), const MAP_FIXED ideal-int +pkg syscall (freebsd-386-cgo), const MAP_HASSEMAPHORE ideal-int +pkg syscall (freebsd-386-cgo), const MAP_NOCORE ideal-int +pkg syscall (freebsd-386-cgo), const MAP_NORESERVE ideal-int +pkg syscall (freebsd-386-cgo), const MAP_NOSYNC ideal-int +pkg syscall (freebsd-386-cgo), const MAP_PREFAULT_READ ideal-int +pkg syscall (freebsd-386-cgo), const MAP_PRIVATE ideal-int +pkg syscall (freebsd-386-cgo), const MAP_RENAME ideal-int +pkg syscall (freebsd-386-cgo), const MAP_RESERVED0080 ideal-int +pkg syscall (freebsd-386-cgo), const MAP_RESERVED0100 ideal-int +pkg syscall (freebsd-386-cgo), const MAP_SHARED ideal-int +pkg syscall (freebsd-386-cgo), const MAP_STACK ideal-int +pkg syscall (freebsd-386-cgo), const MCL_CURRENT ideal-int +pkg syscall (freebsd-386-cgo), const MCL_FUTURE ideal-int +pkg syscall (freebsd-386-cgo), const MSG_COMPAT ideal-int +pkg syscall (freebsd-386-cgo), const MSG_CTRUNC ideal-int +pkg syscall (freebsd-386-cgo), const MSG_DONTROUTE ideal-int +pkg syscall (freebsd-386-cgo), const MSG_DONTWAIT ideal-int +pkg syscall (freebsd-386-cgo), const MSG_EOF ideal-int +pkg syscall (freebsd-386-cgo), const MSG_EOR ideal-int +pkg syscall (freebsd-386-cgo), const MSG_NBIO ideal-int +pkg syscall (freebsd-386-cgo), const MSG_NOSIGNAL ideal-int +pkg syscall (freebsd-386-cgo), const MSG_NOTIFICATION ideal-int +pkg syscall (freebsd-386-cgo), const MSG_OOB ideal-int +pkg syscall (freebsd-386-cgo), const MSG_PEEK ideal-int +pkg syscall (freebsd-386-cgo), const MSG_TRUNC ideal-int +pkg syscall (freebsd-386-cgo), const MSG_WAITALL ideal-int +pkg syscall (freebsd-386-cgo), const MS_ASYNC ideal-int +pkg syscall (freebsd-386-cgo), const MS_INVALIDATE ideal-int +pkg syscall (freebsd-386-cgo), const MS_SYNC ideal-int +pkg syscall (freebsd-386-cgo), const NET_RT_DUMP ideal-int +pkg syscall (freebsd-386-cgo), const NET_RT_FLAGS ideal-int +pkg syscall (freebsd-386-cgo), const NET_RT_IFLIST ideal-int +pkg syscall (freebsd-386-cgo), const NET_RT_IFLISTL ideal-int +pkg syscall (freebsd-386-cgo), const NET_RT_IFMALIST ideal-int +pkg syscall (freebsd-386-cgo), const NET_RT_MAXID ideal-int +pkg syscall (freebsd-386-cgo), const NOFLSH ideal-int +pkg syscall (freebsd-386-cgo), const NOTE_ATTRIB ideal-int +pkg syscall (freebsd-386-cgo), const NOTE_CHILD ideal-int +pkg syscall (freebsd-386-cgo), const NOTE_DELETE ideal-int +pkg syscall (freebsd-386-cgo), const NOTE_EXEC ideal-int +pkg syscall (freebsd-386-cgo), const NOTE_EXIT ideal-int +pkg syscall (freebsd-386-cgo), const NOTE_EXTEND ideal-int +pkg syscall (freebsd-386-cgo), const NOTE_FFAND ideal-int +pkg syscall (freebsd-386-cgo), const NOTE_FFCOPY ideal-int +pkg syscall (freebsd-386-cgo), const NOTE_FFCTRLMASK ideal-int +pkg syscall (freebsd-386-cgo), const NOTE_FFLAGSMASK ideal-int +pkg syscall (freebsd-386-cgo), const NOTE_FFNOP ideal-int +pkg syscall (freebsd-386-cgo), const NOTE_FFOR ideal-int +pkg syscall (freebsd-386-cgo), const NOTE_FORK ideal-int +pkg syscall (freebsd-386-cgo), const NOTE_LINK ideal-int +pkg syscall (freebsd-386-cgo), const NOTE_LOWAT ideal-int +pkg syscall (freebsd-386-cgo), const NOTE_PCTRLMASK ideal-int +pkg syscall (freebsd-386-cgo), const NOTE_PDATAMASK ideal-int +pkg syscall (freebsd-386-cgo), const NOTE_RENAME ideal-int +pkg syscall (freebsd-386-cgo), const NOTE_REVOKE ideal-int +pkg syscall (freebsd-386-cgo), const NOTE_TRACK ideal-int +pkg syscall (freebsd-386-cgo), const NOTE_TRACKERR ideal-int +pkg syscall (freebsd-386-cgo), const NOTE_TRIGGER ideal-int +pkg syscall (freebsd-386-cgo), const NOTE_WRITE ideal-int +pkg syscall (freebsd-386-cgo), const OCRNL ideal-int +pkg syscall (freebsd-386-cgo), const ONLCR ideal-int +pkg syscall (freebsd-386-cgo), const ONLRET ideal-int +pkg syscall (freebsd-386-cgo), const ONOCR ideal-int +pkg syscall (freebsd-386-cgo), const ONOEOT ideal-int +pkg syscall (freebsd-386-cgo), const OPOST ideal-int +pkg syscall (freebsd-386-cgo), const O_ACCMODE ideal-int +pkg syscall (freebsd-386-cgo), const O_DIRECT ideal-int +pkg syscall (freebsd-386-cgo), const O_DIRECTORY ideal-int +pkg syscall (freebsd-386-cgo), const O_EXEC ideal-int +pkg syscall (freebsd-386-cgo), const O_EXLOCK ideal-int +pkg syscall (freebsd-386-cgo), const O_FSYNC ideal-int +pkg syscall (freebsd-386-cgo), const O_NDELAY ideal-int +pkg syscall (freebsd-386-cgo), const O_NOFOLLOW ideal-int +pkg syscall (freebsd-386-cgo), const O_SHLOCK ideal-int +pkg syscall (freebsd-386-cgo), const O_TTY_INIT ideal-int +pkg syscall (freebsd-386-cgo), const PARENB ideal-int +pkg syscall (freebsd-386-cgo), const PARMRK ideal-int +pkg syscall (freebsd-386-cgo), const PARODD ideal-int +pkg syscall (freebsd-386-cgo), const PENDIN ideal-int +pkg syscall (freebsd-386-cgo), const PRIO_PGRP = 1 +pkg syscall (freebsd-386-cgo), const PRIO_PGRP ideal-int +pkg syscall (freebsd-386-cgo), const PRIO_PROCESS = 0 +pkg syscall (freebsd-386-cgo), const PRIO_PROCESS ideal-int +pkg syscall (freebsd-386-cgo), const PRIO_USER = 2 +pkg syscall (freebsd-386-cgo), const PRIO_USER ideal-int +pkg syscall (freebsd-386-cgo), const PROT_EXEC ideal-int +pkg syscall (freebsd-386-cgo), const PROT_NONE ideal-int +pkg syscall (freebsd-386-cgo), const PROT_READ ideal-int +pkg syscall (freebsd-386-cgo), const PROT_WRITE ideal-int +pkg syscall (freebsd-386-cgo), const PTRACE_CONT ideal-int +pkg syscall (freebsd-386-cgo), const PTRACE_KILL ideal-int +pkg syscall (freebsd-386-cgo), const PTRACE_TRACEME ideal-int +pkg syscall (freebsd-386-cgo), const RLIMIT_AS ideal-int +pkg syscall (freebsd-386-cgo), const RLIMIT_CORE ideal-int +pkg syscall (freebsd-386-cgo), const RLIMIT_CPU ideal-int +pkg syscall (freebsd-386-cgo), const RLIMIT_DATA ideal-int +pkg syscall (freebsd-386-cgo), const RLIMIT_FSIZE ideal-int +pkg syscall (freebsd-386-cgo), const RLIMIT_NOFILE ideal-int +pkg syscall (freebsd-386-cgo), const RLIMIT_STACK ideal-int +pkg syscall (freebsd-386-cgo), const RLIM_INFINITY ideal-int +pkg syscall (freebsd-386-cgo), const RTAX_AUTHOR ideal-int +pkg syscall (freebsd-386-cgo), const RTAX_BRD ideal-int +pkg syscall (freebsd-386-cgo), const RTAX_DST ideal-int +pkg syscall (freebsd-386-cgo), const RTAX_GATEWAY ideal-int +pkg syscall (freebsd-386-cgo), const RTAX_GENMASK ideal-int +pkg syscall (freebsd-386-cgo), const RTAX_IFA ideal-int +pkg syscall (freebsd-386-cgo), const RTAX_IFP ideal-int +pkg syscall (freebsd-386-cgo), const RTAX_MAX ideal-int +pkg syscall (freebsd-386-cgo), const RTAX_NETMASK ideal-int +pkg syscall (freebsd-386-cgo), const RTA_AUTHOR ideal-int +pkg syscall (freebsd-386-cgo), const RTA_BRD ideal-int +pkg syscall (freebsd-386-cgo), const RTA_DST ideal-int +pkg syscall (freebsd-386-cgo), const RTA_GATEWAY ideal-int +pkg syscall (freebsd-386-cgo), const RTA_GENMASK ideal-int +pkg syscall (freebsd-386-cgo), const RTA_IFA ideal-int +pkg syscall (freebsd-386-cgo), const RTA_IFP ideal-int +pkg syscall (freebsd-386-cgo), const RTA_NETMASK ideal-int +pkg syscall (freebsd-386-cgo), const RTF_BLACKHOLE ideal-int +pkg syscall (freebsd-386-cgo), const RTF_BROADCAST ideal-int +pkg syscall (freebsd-386-cgo), const RTF_DONE ideal-int +pkg syscall (freebsd-386-cgo), const RTF_DYNAMIC ideal-int +pkg syscall (freebsd-386-cgo), const RTF_FMASK ideal-int +pkg syscall (freebsd-386-cgo), const RTF_GATEWAY ideal-int +pkg syscall (freebsd-386-cgo), const RTF_HOST ideal-int +pkg syscall (freebsd-386-cgo), const RTF_LLDATA ideal-int +pkg syscall (freebsd-386-cgo), const RTF_LLINFO ideal-int +pkg syscall (freebsd-386-cgo), const RTF_LOCAL ideal-int +pkg syscall (freebsd-386-cgo), const RTF_MODIFIED ideal-int +pkg syscall (freebsd-386-cgo), const RTF_MULTICAST ideal-int +pkg syscall (freebsd-386-cgo), const RTF_PINNED ideal-int +pkg syscall (freebsd-386-cgo), const RTF_PRCLONING ideal-int +pkg syscall (freebsd-386-cgo), const RTF_PROTO1 ideal-int +pkg syscall (freebsd-386-cgo), const RTF_PROTO2 ideal-int +pkg syscall (freebsd-386-cgo), const RTF_PROTO3 ideal-int +pkg syscall (freebsd-386-cgo), const RTF_REJECT ideal-int +pkg syscall (freebsd-386-cgo), const RTF_RNH_LOCKED ideal-int +pkg syscall (freebsd-386-cgo), const RTF_STATIC ideal-int +pkg syscall (freebsd-386-cgo), const RTF_STICKY ideal-int +pkg syscall (freebsd-386-cgo), const RTF_UP ideal-int +pkg syscall (freebsd-386-cgo), const RTF_XRESOLVE ideal-int +pkg syscall (freebsd-386-cgo), const RTM_ADD ideal-int +pkg syscall (freebsd-386-cgo), const RTM_CHANGE ideal-int +pkg syscall (freebsd-386-cgo), const RTM_DELADDR ideal-int +pkg syscall (freebsd-386-cgo), const RTM_DELETE ideal-int +pkg syscall (freebsd-386-cgo), const RTM_DELMADDR ideal-int +pkg syscall (freebsd-386-cgo), const RTM_GET ideal-int +pkg syscall (freebsd-386-cgo), const RTM_IEEE80211 ideal-int +pkg syscall (freebsd-386-cgo), const RTM_IFANNOUNCE ideal-int +pkg syscall (freebsd-386-cgo), const RTM_IFINFO ideal-int +pkg syscall (freebsd-386-cgo), const RTM_LOCK ideal-int +pkg syscall (freebsd-386-cgo), const RTM_LOSING ideal-int +pkg syscall (freebsd-386-cgo), const RTM_MISS ideal-int +pkg syscall (freebsd-386-cgo), const RTM_NEWADDR ideal-int +pkg syscall (freebsd-386-cgo), const RTM_NEWMADDR ideal-int +pkg syscall (freebsd-386-cgo), const RTM_OLDADD ideal-int +pkg syscall (freebsd-386-cgo), const RTM_OLDDEL ideal-int +pkg syscall (freebsd-386-cgo), const RTM_REDIRECT ideal-int +pkg syscall (freebsd-386-cgo), const RTM_RESOLVE ideal-int +pkg syscall (freebsd-386-cgo), const RTM_RTTUNIT ideal-int +pkg syscall (freebsd-386-cgo), const RTM_VERSION ideal-int +pkg syscall (freebsd-386-cgo), const RTV_EXPIRE ideal-int +pkg syscall (freebsd-386-cgo), const RTV_HOPCOUNT ideal-int +pkg syscall (freebsd-386-cgo), const RTV_MTU ideal-int +pkg syscall (freebsd-386-cgo), const RTV_RPIPE ideal-int +pkg syscall (freebsd-386-cgo), const RTV_RTT ideal-int +pkg syscall (freebsd-386-cgo), const RTV_RTTVAR ideal-int +pkg syscall (freebsd-386-cgo), const RTV_SPIPE ideal-int +pkg syscall (freebsd-386-cgo), const RTV_SSTHRESH ideal-int +pkg syscall (freebsd-386-cgo), const RTV_WEIGHT ideal-int +pkg syscall (freebsd-386-cgo), const RT_CACHING_CONTEXT ideal-int +pkg syscall (freebsd-386-cgo), const RT_DEFAULT_FIB ideal-int +pkg syscall (freebsd-386-cgo), const RUSAGE_CHILDREN ideal-int +pkg syscall (freebsd-386-cgo), const RUSAGE_SELF ideal-int +pkg syscall (freebsd-386-cgo), const RUSAGE_THREAD ideal-int +pkg syscall (freebsd-386-cgo), const SCM_BINTIME ideal-int +pkg syscall (freebsd-386-cgo), const SCM_CREDS ideal-int +pkg syscall (freebsd-386-cgo), const SCM_RIGHTS ideal-int +pkg syscall (freebsd-386-cgo), const SCM_TIMESTAMP ideal-int +pkg syscall (freebsd-386-cgo), const SIGCHLD Signal +pkg syscall (freebsd-386-cgo), const SIGCONT Signal +pkg syscall (freebsd-386-cgo), const SIGEMT Signal +pkg syscall (freebsd-386-cgo), const SIGINFO Signal +pkg syscall (freebsd-386-cgo), const SIGIO Signal +pkg syscall (freebsd-386-cgo), const SIGIOT Signal +pkg syscall (freebsd-386-cgo), const SIGLWP Signal +pkg syscall (freebsd-386-cgo), const SIGPROF Signal +pkg syscall (freebsd-386-cgo), const SIGSTOP Signal +pkg syscall (freebsd-386-cgo), const SIGSYS Signal +pkg syscall (freebsd-386-cgo), const SIGTHR Signal +pkg syscall (freebsd-386-cgo), const SIGTSTP Signal +pkg syscall (freebsd-386-cgo), const SIGTTIN Signal +pkg syscall (freebsd-386-cgo), const SIGTTOU Signal +pkg syscall (freebsd-386-cgo), const SIGURG Signal +pkg syscall (freebsd-386-cgo), const SIGUSR1 Signal +pkg syscall (freebsd-386-cgo), const SIGUSR2 Signal +pkg syscall (freebsd-386-cgo), const SIGVTALRM Signal +pkg syscall (freebsd-386-cgo), const SIGWINCH Signal +pkg syscall (freebsd-386-cgo), const SIGXCPU Signal +pkg syscall (freebsd-386-cgo), const SIGXFSZ Signal +pkg syscall (freebsd-386-cgo), const SIOCADDMULTI ideal-int +pkg syscall (freebsd-386-cgo), const SIOCADDRT ideal-int +pkg syscall (freebsd-386-cgo), const SIOCAIFADDR ideal-int +pkg syscall (freebsd-386-cgo), const SIOCAIFGROUP ideal-int +pkg syscall (freebsd-386-cgo), const SIOCALIFADDR ideal-int +pkg syscall (freebsd-386-cgo), const SIOCATMARK ideal-int +pkg syscall (freebsd-386-cgo), const SIOCDELMULTI ideal-int +pkg syscall (freebsd-386-cgo), const SIOCDELRT ideal-int +pkg syscall (freebsd-386-cgo), const SIOCDIFADDR ideal-int +pkg syscall (freebsd-386-cgo), const SIOCDIFGROUP ideal-int +pkg syscall (freebsd-386-cgo), const SIOCDIFPHYADDR ideal-int +pkg syscall (freebsd-386-cgo), const SIOCDLIFADDR ideal-int +pkg syscall (freebsd-386-cgo), const SIOCGDRVSPEC ideal-int +pkg syscall (freebsd-386-cgo), const SIOCGETSGCNT ideal-int +pkg syscall (freebsd-386-cgo), const SIOCGETVIFCNT ideal-int +pkg syscall (freebsd-386-cgo), const SIOCGHIWAT ideal-int +pkg syscall (freebsd-386-cgo), const SIOCGIFADDR ideal-int +pkg syscall (freebsd-386-cgo), const SIOCGIFBRDADDR ideal-int +pkg syscall (freebsd-386-cgo), const SIOCGIFCAP ideal-int +pkg syscall (freebsd-386-cgo), const SIOCGIFCONF ideal-int +pkg syscall (freebsd-386-cgo), const SIOCGIFDESCR ideal-int +pkg syscall (freebsd-386-cgo), const SIOCGIFDSTADDR ideal-int +pkg syscall (freebsd-386-cgo), const SIOCGIFFIB ideal-int +pkg syscall (freebsd-386-cgo), const SIOCGIFFLAGS ideal-int +pkg syscall (freebsd-386-cgo), const SIOCGIFGENERIC ideal-int +pkg syscall (freebsd-386-cgo), const SIOCGIFGMEMB ideal-int +pkg syscall (freebsd-386-cgo), const SIOCGIFGROUP ideal-int +pkg syscall (freebsd-386-cgo), const SIOCGIFINDEX ideal-int +pkg syscall (freebsd-386-cgo), const SIOCGIFMAC ideal-int +pkg syscall (freebsd-386-cgo), const SIOCGIFMEDIA ideal-int +pkg syscall (freebsd-386-cgo), const SIOCGIFMETRIC ideal-int +pkg syscall (freebsd-386-cgo), const SIOCGIFMTU ideal-int +pkg syscall (freebsd-386-cgo), const SIOCGIFNETMASK ideal-int +pkg syscall (freebsd-386-cgo), const SIOCGIFPDSTADDR ideal-int +pkg syscall (freebsd-386-cgo), const SIOCGIFPHYS ideal-int +pkg syscall (freebsd-386-cgo), const SIOCGIFPSRCADDR ideal-int +pkg syscall (freebsd-386-cgo), const SIOCGIFSTATUS ideal-int +pkg syscall (freebsd-386-cgo), const SIOCGLIFADDR ideal-int +pkg syscall (freebsd-386-cgo), const SIOCGLIFPHYADDR ideal-int +pkg syscall (freebsd-386-cgo), const SIOCGLOWAT ideal-int +pkg syscall (freebsd-386-cgo), const SIOCGPGRP ideal-int +pkg syscall (freebsd-386-cgo), const SIOCGPRIVATE_0 ideal-int +pkg syscall (freebsd-386-cgo), const SIOCGPRIVATE_1 ideal-int +pkg syscall (freebsd-386-cgo), const SIOCIFCREATE ideal-int +pkg syscall (freebsd-386-cgo), const SIOCIFCREATE2 ideal-int +pkg syscall (freebsd-386-cgo), const SIOCIFDESTROY ideal-int +pkg syscall (freebsd-386-cgo), const SIOCIFGCLONERS ideal-int +pkg syscall (freebsd-386-cgo), const SIOCSDRVSPEC ideal-int +pkg syscall (freebsd-386-cgo), const SIOCSHIWAT ideal-int +pkg syscall (freebsd-386-cgo), const SIOCSIFADDR ideal-int +pkg syscall (freebsd-386-cgo), const SIOCSIFBRDADDR ideal-int +pkg syscall (freebsd-386-cgo), const SIOCSIFCAP ideal-int +pkg syscall (freebsd-386-cgo), const SIOCSIFDESCR ideal-int +pkg syscall (freebsd-386-cgo), const SIOCSIFDSTADDR ideal-int +pkg syscall (freebsd-386-cgo), const SIOCSIFFIB ideal-int +pkg syscall (freebsd-386-cgo), const SIOCSIFFLAGS ideal-int +pkg syscall (freebsd-386-cgo), const SIOCSIFGENERIC ideal-int +pkg syscall (freebsd-386-cgo), const SIOCSIFLLADDR ideal-int +pkg syscall (freebsd-386-cgo), const SIOCSIFMAC ideal-int +pkg syscall (freebsd-386-cgo), const SIOCSIFMEDIA ideal-int +pkg syscall (freebsd-386-cgo), const SIOCSIFMETRIC ideal-int +pkg syscall (freebsd-386-cgo), const SIOCSIFMTU ideal-int +pkg syscall (freebsd-386-cgo), const SIOCSIFNAME ideal-int +pkg syscall (freebsd-386-cgo), const SIOCSIFNETMASK ideal-int +pkg syscall (freebsd-386-cgo), const SIOCSIFPHYADDR ideal-int +pkg syscall (freebsd-386-cgo), const SIOCSIFPHYS ideal-int +pkg syscall (freebsd-386-cgo), const SIOCSIFRVNET ideal-int +pkg syscall (freebsd-386-cgo), const SIOCSIFVNET ideal-int +pkg syscall (freebsd-386-cgo), const SIOCSLIFPHYADDR ideal-int +pkg syscall (freebsd-386-cgo), const SIOCSLOWAT ideal-int +pkg syscall (freebsd-386-cgo), const SIOCSPGRP ideal-int +pkg syscall (freebsd-386-cgo), const SOCK_MAXADDRLEN ideal-int +pkg syscall (freebsd-386-cgo), const SOCK_RDM ideal-int +pkg syscall (freebsd-386-cgo), const SO_ACCEPTCONN ideal-int +pkg syscall (freebsd-386-cgo), const SO_ACCEPTFILTER ideal-int +pkg syscall (freebsd-386-cgo), const SO_BINTIME ideal-int +pkg syscall (freebsd-386-cgo), const SO_DEBUG ideal-int +pkg syscall (freebsd-386-cgo), const SO_ERROR ideal-int +pkg syscall (freebsd-386-cgo), const SO_LABEL ideal-int +pkg syscall (freebsd-386-cgo), const SO_LISTENINCQLEN ideal-int +pkg syscall (freebsd-386-cgo), const SO_LISTENQLEN ideal-int +pkg syscall (freebsd-386-cgo), const SO_LISTENQLIMIT ideal-int +pkg syscall (freebsd-386-cgo), const SO_NOSIGPIPE ideal-int +pkg syscall (freebsd-386-cgo), const SO_NO_DDP ideal-int +pkg syscall (freebsd-386-cgo), const SO_NO_OFFLOAD ideal-int +pkg syscall (freebsd-386-cgo), const SO_OOBINLINE ideal-int +pkg syscall (freebsd-386-cgo), const SO_PEERLABEL ideal-int +pkg syscall (freebsd-386-cgo), const SO_PROTOCOL ideal-int +pkg syscall (freebsd-386-cgo), const SO_PROTOTYPE ideal-int +pkg syscall (freebsd-386-cgo), const SO_RCVLOWAT ideal-int +pkg syscall (freebsd-386-cgo), const SO_RCVTIMEO ideal-int +pkg syscall (freebsd-386-cgo), const SO_REUSEPORT ideal-int +pkg syscall (freebsd-386-cgo), const SO_SETFIB ideal-int +pkg syscall (freebsd-386-cgo), const SO_SNDLOWAT ideal-int +pkg syscall (freebsd-386-cgo), const SO_SNDTIMEO ideal-int +pkg syscall (freebsd-386-cgo), const SO_TIMESTAMP ideal-int +pkg syscall (freebsd-386-cgo), const SO_TYPE ideal-int +pkg syscall (freebsd-386-cgo), const SO_USELOOPBACK ideal-int +pkg syscall (freebsd-386-cgo), const SO_USER_COOKIE ideal-int +pkg syscall (freebsd-386-cgo), const SYS_ABORT2 ideal-int +pkg syscall (freebsd-386-cgo), const SYS_ACCEPT ideal-int +pkg syscall (freebsd-386-cgo), const SYS_ACCESS ideal-int +pkg syscall (freebsd-386-cgo), const SYS_ACCT ideal-int +pkg syscall (freebsd-386-cgo), const SYS_ADJTIME ideal-int +pkg syscall (freebsd-386-cgo), const SYS_AUDIT ideal-int +pkg syscall (freebsd-386-cgo), const SYS_AUDITCTL ideal-int +pkg syscall (freebsd-386-cgo), const SYS_AUDITON ideal-int +pkg syscall (freebsd-386-cgo), const SYS_BIND ideal-int +pkg syscall (freebsd-386-cgo), const SYS_CAP_ENTER ideal-int +pkg syscall (freebsd-386-cgo), const SYS_CAP_GETMODE ideal-int +pkg syscall (freebsd-386-cgo), const SYS_CAP_GETRIGHTS ideal-int +pkg syscall (freebsd-386-cgo), const SYS_CAP_NEW ideal-int +pkg syscall (freebsd-386-cgo), const SYS_CHDIR ideal-int +pkg syscall (freebsd-386-cgo), const SYS_CHFLAGS ideal-int +pkg syscall (freebsd-386-cgo), const SYS_CHMOD ideal-int +pkg syscall (freebsd-386-cgo), const SYS_CHOWN ideal-int +pkg syscall (freebsd-386-cgo), const SYS_CHROOT ideal-int +pkg syscall (freebsd-386-cgo), const SYS_CLOCK_GETCPUCLOCKID2 ideal-int +pkg syscall (freebsd-386-cgo), const SYS_CLOCK_GETRES ideal-int +pkg syscall (freebsd-386-cgo), const SYS_CLOCK_GETTIME ideal-int +pkg syscall (freebsd-386-cgo), const SYS_CLOCK_SETTIME ideal-int +pkg syscall (freebsd-386-cgo), const SYS_CLOSE ideal-int +pkg syscall (freebsd-386-cgo), const SYS_CLOSEFROM ideal-int +pkg syscall (freebsd-386-cgo), const SYS_CONNECT ideal-int +pkg syscall (freebsd-386-cgo), const SYS_CPUSET ideal-int +pkg syscall (freebsd-386-cgo), const SYS_CPUSET_GETAFFINITY ideal-int +pkg syscall (freebsd-386-cgo), const SYS_CPUSET_GETID ideal-int +pkg syscall (freebsd-386-cgo), const SYS_CPUSET_SETAFFINITY ideal-int +pkg syscall (freebsd-386-cgo), const SYS_CPUSET_SETID ideal-int +pkg syscall (freebsd-386-cgo), const SYS_DUP ideal-int +pkg syscall (freebsd-386-cgo), const SYS_DUP2 ideal-int +pkg syscall (freebsd-386-cgo), const SYS_EACCESS ideal-int +pkg syscall (freebsd-386-cgo), const SYS_EXECVE ideal-int +pkg syscall (freebsd-386-cgo), const SYS_EXIT ideal-int +pkg syscall (freebsd-386-cgo), const SYS_EXTATTRCTL ideal-int +pkg syscall (freebsd-386-cgo), const SYS_EXTATTR_DELETE_FD ideal-int +pkg syscall (freebsd-386-cgo), const SYS_EXTATTR_DELETE_FILE ideal-int +pkg syscall (freebsd-386-cgo), const SYS_EXTATTR_DELETE_LINK ideal-int +pkg syscall (freebsd-386-cgo), const SYS_EXTATTR_GET_FD ideal-int +pkg syscall (freebsd-386-cgo), const SYS_EXTATTR_GET_FILE ideal-int +pkg syscall (freebsd-386-cgo), const SYS_EXTATTR_GET_LINK ideal-int +pkg syscall (freebsd-386-cgo), const SYS_EXTATTR_LIST_FD ideal-int +pkg syscall (freebsd-386-cgo), const SYS_EXTATTR_LIST_FILE ideal-int +pkg syscall (freebsd-386-cgo), const SYS_EXTATTR_LIST_LINK ideal-int +pkg syscall (freebsd-386-cgo), const SYS_EXTATTR_SET_FD ideal-int +pkg syscall (freebsd-386-cgo), const SYS_EXTATTR_SET_FILE ideal-int +pkg syscall (freebsd-386-cgo), const SYS_EXTATTR_SET_LINK ideal-int +pkg syscall (freebsd-386-cgo), const SYS_FACCESSAT ideal-int +pkg syscall (freebsd-386-cgo), const SYS_FCHDIR ideal-int +pkg syscall (freebsd-386-cgo), const SYS_FCHFLAGS ideal-int +pkg syscall (freebsd-386-cgo), const SYS_FCHMOD ideal-int +pkg syscall (freebsd-386-cgo), const SYS_FCHMODAT ideal-int +pkg syscall (freebsd-386-cgo), const SYS_FCHOWN ideal-int +pkg syscall (freebsd-386-cgo), const SYS_FCHOWNAT ideal-int +pkg syscall (freebsd-386-cgo), const SYS_FCNTL ideal-int +pkg syscall (freebsd-386-cgo), const SYS_FEXECVE ideal-int +pkg syscall (freebsd-386-cgo), const SYS_FFCLOCK_GETCOUNTER ideal-int +pkg syscall (freebsd-386-cgo), const SYS_FFCLOCK_GETESTIMATE ideal-int +pkg syscall (freebsd-386-cgo), const SYS_FFCLOCK_SETESTIMATE ideal-int +pkg syscall (freebsd-386-cgo), const SYS_FHOPEN ideal-int +pkg syscall (freebsd-386-cgo), const SYS_FHSTAT ideal-int +pkg syscall (freebsd-386-cgo), const SYS_FHSTATFS ideal-int +pkg syscall (freebsd-386-cgo), const SYS_FLOCK ideal-int +pkg syscall (freebsd-386-cgo), const SYS_FORK ideal-int +pkg syscall (freebsd-386-cgo), const SYS_FPATHCONF ideal-int +pkg syscall (freebsd-386-cgo), const SYS_FREEBSD6_FTRUNCATE ideal-int +pkg syscall (freebsd-386-cgo), const SYS_FREEBSD6_LSEEK ideal-int +pkg syscall (freebsd-386-cgo), const SYS_FREEBSD6_MMAP ideal-int +pkg syscall (freebsd-386-cgo), const SYS_FREEBSD6_PREAD ideal-int +pkg syscall (freebsd-386-cgo), const SYS_FREEBSD6_PWRITE ideal-int +pkg syscall (freebsd-386-cgo), const SYS_FREEBSD6_TRUNCATE ideal-int +pkg syscall (freebsd-386-cgo), const SYS_FSTAT ideal-int +pkg syscall (freebsd-386-cgo), const SYS_FSTATAT ideal-int +pkg syscall (freebsd-386-cgo), const SYS_FSTATFS ideal-int +pkg syscall (freebsd-386-cgo), const SYS_FSYNC ideal-int +pkg syscall (freebsd-386-cgo), const SYS_FTRUNCATE ideal-int +pkg syscall (freebsd-386-cgo), const SYS_FUTIMES ideal-int +pkg syscall (freebsd-386-cgo), const SYS_FUTIMESAT ideal-int +pkg syscall (freebsd-386-cgo), const SYS_GETAUDIT ideal-int +pkg syscall (freebsd-386-cgo), const SYS_GETAUDIT_ADDR ideal-int +pkg syscall (freebsd-386-cgo), const SYS_GETAUID ideal-int +pkg syscall (freebsd-386-cgo), const SYS_GETCONTEXT ideal-int +pkg syscall (freebsd-386-cgo), const SYS_GETDENTS ideal-int +pkg syscall (freebsd-386-cgo), const SYS_GETDIRENTRIES ideal-int +pkg syscall (freebsd-386-cgo), const SYS_GETDTABLESIZE ideal-int +pkg syscall (freebsd-386-cgo), const SYS_GETEGID ideal-int +pkg syscall (freebsd-386-cgo), const SYS_GETEUID ideal-int +pkg syscall (freebsd-386-cgo), const SYS_GETFH ideal-int +pkg syscall (freebsd-386-cgo), const SYS_GETFSSTAT ideal-int +pkg syscall (freebsd-386-cgo), const SYS_GETGID ideal-int +pkg syscall (freebsd-386-cgo), const SYS_GETGROUPS ideal-int +pkg syscall (freebsd-386-cgo), const SYS_GETITIMER ideal-int +pkg syscall (freebsd-386-cgo), const SYS_GETLOGIN ideal-int +pkg syscall (freebsd-386-cgo), const SYS_GETLOGINCLASS ideal-int +pkg syscall (freebsd-386-cgo), const SYS_GETPEERNAME ideal-int +pkg syscall (freebsd-386-cgo), const SYS_GETPGID ideal-int +pkg syscall (freebsd-386-cgo), const SYS_GETPGRP ideal-int +pkg syscall (freebsd-386-cgo), const SYS_GETPID ideal-int +pkg syscall (freebsd-386-cgo), const SYS_GETPPID ideal-int +pkg syscall (freebsd-386-cgo), const SYS_GETPRIORITY ideal-int +pkg syscall (freebsd-386-cgo), const SYS_GETRESGID ideal-int +pkg syscall (freebsd-386-cgo), const SYS_GETRESUID ideal-int +pkg syscall (freebsd-386-cgo), const SYS_GETRLIMIT ideal-int +pkg syscall (freebsd-386-cgo), const SYS_GETRUSAGE ideal-int +pkg syscall (freebsd-386-cgo), const SYS_GETSID ideal-int +pkg syscall (freebsd-386-cgo), const SYS_GETSOCKNAME ideal-int +pkg syscall (freebsd-386-cgo), const SYS_GETSOCKOPT ideal-int +pkg syscall (freebsd-386-cgo), const SYS_GETTIMEOFDAY ideal-int +pkg syscall (freebsd-386-cgo), const SYS_GETUID ideal-int +pkg syscall (freebsd-386-cgo), const SYS_IOCTL ideal-int +pkg syscall (freebsd-386-cgo), const SYS_ISSETUGID ideal-int +pkg syscall (freebsd-386-cgo), const SYS_JAIL ideal-int +pkg syscall (freebsd-386-cgo), const SYS_JAIL_ATTACH ideal-int +pkg syscall (freebsd-386-cgo), const SYS_JAIL_GET ideal-int +pkg syscall (freebsd-386-cgo), const SYS_JAIL_REMOVE ideal-int +pkg syscall (freebsd-386-cgo), const SYS_JAIL_SET ideal-int +pkg syscall (freebsd-386-cgo), const SYS_KENV ideal-int +pkg syscall (freebsd-386-cgo), const SYS_KEVENT ideal-int +pkg syscall (freebsd-386-cgo), const SYS_KILL ideal-int +pkg syscall (freebsd-386-cgo), const SYS_KLDFIND ideal-int +pkg syscall (freebsd-386-cgo), const SYS_KLDFIRSTMOD ideal-int +pkg syscall (freebsd-386-cgo), const SYS_KLDLOAD ideal-int +pkg syscall (freebsd-386-cgo), const SYS_KLDNEXT ideal-int +pkg syscall (freebsd-386-cgo), const SYS_KLDSTAT ideal-int +pkg syscall (freebsd-386-cgo), const SYS_KLDSYM ideal-int +pkg syscall (freebsd-386-cgo), const SYS_KLDUNLOAD ideal-int +pkg syscall (freebsd-386-cgo), const SYS_KLDUNLOADF ideal-int +pkg syscall (freebsd-386-cgo), const SYS_KQUEUE ideal-int +pkg syscall (freebsd-386-cgo), const SYS_KTIMER_CREATE ideal-int +pkg syscall (freebsd-386-cgo), const SYS_KTIMER_DELETE ideal-int +pkg syscall (freebsd-386-cgo), const SYS_KTIMER_GETOVERRUN ideal-int +pkg syscall (freebsd-386-cgo), const SYS_KTIMER_GETTIME ideal-int +pkg syscall (freebsd-386-cgo), const SYS_KTIMER_SETTIME ideal-int +pkg syscall (freebsd-386-cgo), const SYS_KTRACE ideal-int +pkg syscall (freebsd-386-cgo), const SYS_LCHFLAGS ideal-int +pkg syscall (freebsd-386-cgo), const SYS_LCHMOD ideal-int +pkg syscall (freebsd-386-cgo), const SYS_LCHOWN ideal-int +pkg syscall (freebsd-386-cgo), const SYS_LGETFH ideal-int +pkg syscall (freebsd-386-cgo), const SYS_LINK ideal-int +pkg syscall (freebsd-386-cgo), const SYS_LINKAT ideal-int +pkg syscall (freebsd-386-cgo), const SYS_LISTEN ideal-int +pkg syscall (freebsd-386-cgo), const SYS_LPATHCONF ideal-int +pkg syscall (freebsd-386-cgo), const SYS_LSEEK ideal-int +pkg syscall (freebsd-386-cgo), const SYS_LSTAT ideal-int +pkg syscall (freebsd-386-cgo), const SYS_LUTIMES ideal-int +pkg syscall (freebsd-386-cgo), const SYS_MAC_SYSCALL ideal-int +pkg syscall (freebsd-386-cgo), const SYS_MADVISE ideal-int +pkg syscall (freebsd-386-cgo), const SYS_MINCORE ideal-int +pkg syscall (freebsd-386-cgo), const SYS_MINHERIT ideal-int +pkg syscall (freebsd-386-cgo), const SYS_MKDIR ideal-int +pkg syscall (freebsd-386-cgo), const SYS_MKDIRAT ideal-int +pkg syscall (freebsd-386-cgo), const SYS_MKFIFO ideal-int +pkg syscall (freebsd-386-cgo), const SYS_MKFIFOAT ideal-int +pkg syscall (freebsd-386-cgo), const SYS_MKNOD ideal-int +pkg syscall (freebsd-386-cgo), const SYS_MKNODAT ideal-int +pkg syscall (freebsd-386-cgo), const SYS_MLOCK ideal-int +pkg syscall (freebsd-386-cgo), const SYS_MLOCKALL ideal-int +pkg syscall (freebsd-386-cgo), const SYS_MMAP ideal-int +pkg syscall (freebsd-386-cgo), const SYS_MODFIND ideal-int +pkg syscall (freebsd-386-cgo), const SYS_MODFNEXT ideal-int +pkg syscall (freebsd-386-cgo), const SYS_MODNEXT ideal-int +pkg syscall (freebsd-386-cgo), const SYS_MODSTAT ideal-int +pkg syscall (freebsd-386-cgo), const SYS_MOUNT ideal-int +pkg syscall (freebsd-386-cgo), const SYS_MPROTECT ideal-int +pkg syscall (freebsd-386-cgo), const SYS_MSYNC ideal-int +pkg syscall (freebsd-386-cgo), const SYS_MUNLOCK ideal-int +pkg syscall (freebsd-386-cgo), const SYS_MUNLOCKALL ideal-int +pkg syscall (freebsd-386-cgo), const SYS_MUNMAP ideal-int +pkg syscall (freebsd-386-cgo), const SYS_NANOSLEEP ideal-int +pkg syscall (freebsd-386-cgo), const SYS_NFSTAT ideal-int +pkg syscall (freebsd-386-cgo), const SYS_NLSTAT ideal-int +pkg syscall (freebsd-386-cgo), const SYS_NMOUNT ideal-int +pkg syscall (freebsd-386-cgo), const SYS_NSTAT ideal-int +pkg syscall (freebsd-386-cgo), const SYS_NTP_ADJTIME ideal-int +pkg syscall (freebsd-386-cgo), const SYS_NTP_GETTIME ideal-int +pkg syscall (freebsd-386-cgo), const SYS_OBREAK ideal-int +pkg syscall (freebsd-386-cgo), const SYS_OPEN ideal-int +pkg syscall (freebsd-386-cgo), const SYS_OPENAT ideal-int +pkg syscall (freebsd-386-cgo), const SYS_OPENBSD_POLL ideal-int +pkg syscall (freebsd-386-cgo), const SYS_OVADVISE ideal-int +pkg syscall (freebsd-386-cgo), const SYS_PATHCONF ideal-int +pkg syscall (freebsd-386-cgo), const SYS_PDFORK ideal-int +pkg syscall (freebsd-386-cgo), const SYS_PDGETPID ideal-int +pkg syscall (freebsd-386-cgo), const SYS_PDKILL ideal-int +pkg syscall (freebsd-386-cgo), const SYS_PIPE ideal-int +pkg syscall (freebsd-386-cgo), const SYS_POLL ideal-int +pkg syscall (freebsd-386-cgo), const SYS_POSIX_FADVISE ideal-int +pkg syscall (freebsd-386-cgo), const SYS_POSIX_FALLOCATE ideal-int +pkg syscall (freebsd-386-cgo), const SYS_POSIX_OPENPT ideal-int +pkg syscall (freebsd-386-cgo), const SYS_PREAD ideal-int +pkg syscall (freebsd-386-cgo), const SYS_PREADV ideal-int +pkg syscall (freebsd-386-cgo), const SYS_PROFIL ideal-int +pkg syscall (freebsd-386-cgo), const SYS_PSELECT ideal-int +pkg syscall (freebsd-386-cgo), const SYS_PTRACE ideal-int +pkg syscall (freebsd-386-cgo), const SYS_PWRITE ideal-int +pkg syscall (freebsd-386-cgo), const SYS_PWRITEV ideal-int +pkg syscall (freebsd-386-cgo), const SYS_QUOTACTL ideal-int +pkg syscall (freebsd-386-cgo), const SYS_RCTL_ADD_RULE ideal-int +pkg syscall (freebsd-386-cgo), const SYS_RCTL_GET_LIMITS ideal-int +pkg syscall (freebsd-386-cgo), const SYS_RCTL_GET_RACCT ideal-int +pkg syscall (freebsd-386-cgo), const SYS_RCTL_GET_RULES ideal-int +pkg syscall (freebsd-386-cgo), const SYS_RCTL_REMOVE_RULE ideal-int +pkg syscall (freebsd-386-cgo), const SYS_READ ideal-int +pkg syscall (freebsd-386-cgo), const SYS_READLINK ideal-int +pkg syscall (freebsd-386-cgo), const SYS_READLINKAT ideal-int +pkg syscall (freebsd-386-cgo), const SYS_READV ideal-int +pkg syscall (freebsd-386-cgo), const SYS_REBOOT ideal-int +pkg syscall (freebsd-386-cgo), const SYS_RECVFROM ideal-int +pkg syscall (freebsd-386-cgo), const SYS_RECVMSG ideal-int +pkg syscall (freebsd-386-cgo), const SYS_RENAME ideal-int +pkg syscall (freebsd-386-cgo), const SYS_RENAMEAT ideal-int +pkg syscall (freebsd-386-cgo), const SYS_REVOKE ideal-int +pkg syscall (freebsd-386-cgo), const SYS_RFORK ideal-int +pkg syscall (freebsd-386-cgo), const SYS_RMDIR ideal-int +pkg syscall (freebsd-386-cgo), const SYS_RTPRIO ideal-int +pkg syscall (freebsd-386-cgo), const SYS_RTPRIO_THREAD ideal-int +pkg syscall (freebsd-386-cgo), const SYS_SBRK ideal-int +pkg syscall (freebsd-386-cgo), const SYS_SCHED_GETPARAM ideal-int +pkg syscall (freebsd-386-cgo), const SYS_SCHED_GETSCHEDULER ideal-int +pkg syscall (freebsd-386-cgo), const SYS_SCHED_GET_PRIORITY_MAX ideal-int +pkg syscall (freebsd-386-cgo), const SYS_SCHED_GET_PRIORITY_MIN ideal-int +pkg syscall (freebsd-386-cgo), const SYS_SCHED_RR_GET_INTERVAL ideal-int +pkg syscall (freebsd-386-cgo), const SYS_SCHED_SETPARAM ideal-int +pkg syscall (freebsd-386-cgo), const SYS_SCHED_SETSCHEDULER ideal-int +pkg syscall (freebsd-386-cgo), const SYS_SCHED_YIELD ideal-int +pkg syscall (freebsd-386-cgo), const SYS_SCTP_GENERIC_RECVMSG ideal-int +pkg syscall (freebsd-386-cgo), const SYS_SCTP_GENERIC_SENDMSG ideal-int +pkg syscall (freebsd-386-cgo), const SYS_SCTP_GENERIC_SENDMSG_IOV ideal-int +pkg syscall (freebsd-386-cgo), const SYS_SCTP_PEELOFF ideal-int +pkg syscall (freebsd-386-cgo), const SYS_SELECT ideal-int +pkg syscall (freebsd-386-cgo), const SYS_SENDFILE ideal-int +pkg syscall (freebsd-386-cgo), const SYS_SENDMSG ideal-int +pkg syscall (freebsd-386-cgo), const SYS_SENDTO ideal-int +pkg syscall (freebsd-386-cgo), const SYS_SETAUDIT ideal-int +pkg syscall (freebsd-386-cgo), const SYS_SETAUDIT_ADDR ideal-int +pkg syscall (freebsd-386-cgo), const SYS_SETAUID ideal-int +pkg syscall (freebsd-386-cgo), const SYS_SETCONTEXT ideal-int +pkg syscall (freebsd-386-cgo), const SYS_SETEGID ideal-int +pkg syscall (freebsd-386-cgo), const SYS_SETEUID ideal-int +pkg syscall (freebsd-386-cgo), const SYS_SETFIB ideal-int +pkg syscall (freebsd-386-cgo), const SYS_SETGID ideal-int +pkg syscall (freebsd-386-cgo), const SYS_SETGROUPS ideal-int +pkg syscall (freebsd-386-cgo), const SYS_SETITIMER ideal-int +pkg syscall (freebsd-386-cgo), const SYS_SETLOGIN ideal-int +pkg syscall (freebsd-386-cgo), const SYS_SETLOGINCLASS ideal-int +pkg syscall (freebsd-386-cgo), const SYS_SETPGID ideal-int +pkg syscall (freebsd-386-cgo), const SYS_SETPRIORITY ideal-int +pkg syscall (freebsd-386-cgo), const SYS_SETREGID ideal-int +pkg syscall (freebsd-386-cgo), const SYS_SETRESGID ideal-int +pkg syscall (freebsd-386-cgo), const SYS_SETRESUID ideal-int +pkg syscall (freebsd-386-cgo), const SYS_SETREUID ideal-int +pkg syscall (freebsd-386-cgo), const SYS_SETRLIMIT ideal-int +pkg syscall (freebsd-386-cgo), const SYS_SETSID ideal-int +pkg syscall (freebsd-386-cgo), const SYS_SETSOCKOPT ideal-int +pkg syscall (freebsd-386-cgo), const SYS_SETTIMEOFDAY ideal-int +pkg syscall (freebsd-386-cgo), const SYS_SETUID ideal-int +pkg syscall (freebsd-386-cgo), const SYS_SHM_OPEN ideal-int +pkg syscall (freebsd-386-cgo), const SYS_SHM_UNLINK ideal-int +pkg syscall (freebsd-386-cgo), const SYS_SHUTDOWN ideal-int +pkg syscall (freebsd-386-cgo), const SYS_SIGACTION ideal-int +pkg syscall (freebsd-386-cgo), const SYS_SIGALTSTACK ideal-int +pkg syscall (freebsd-386-cgo), const SYS_SIGPENDING ideal-int +pkg syscall (freebsd-386-cgo), const SYS_SIGPROCMASK ideal-int +pkg syscall (freebsd-386-cgo), const SYS_SIGQUEUE ideal-int +pkg syscall (freebsd-386-cgo), const SYS_SIGRETURN ideal-int +pkg syscall (freebsd-386-cgo), const SYS_SIGSUSPEND ideal-int +pkg syscall (freebsd-386-cgo), const SYS_SIGTIMEDWAIT ideal-int +pkg syscall (freebsd-386-cgo), const SYS_SIGWAIT ideal-int +pkg syscall (freebsd-386-cgo), const SYS_SIGWAITINFO ideal-int +pkg syscall (freebsd-386-cgo), const SYS_SOCKET ideal-int +pkg syscall (freebsd-386-cgo), const SYS_SOCKETPAIR ideal-int +pkg syscall (freebsd-386-cgo), const SYS_SSTK ideal-int +pkg syscall (freebsd-386-cgo), const SYS_STAT ideal-int +pkg syscall (freebsd-386-cgo), const SYS_STATFS ideal-int +pkg syscall (freebsd-386-cgo), const SYS_SWAPCONTEXT ideal-int +pkg syscall (freebsd-386-cgo), const SYS_SWAPOFF ideal-int +pkg syscall (freebsd-386-cgo), const SYS_SWAPON ideal-int +pkg syscall (freebsd-386-cgo), const SYS_SYMLINK ideal-int +pkg syscall (freebsd-386-cgo), const SYS_SYMLINKAT ideal-int +pkg syscall (freebsd-386-cgo), const SYS_SYNC ideal-int +pkg syscall (freebsd-386-cgo), const SYS_SYSARCH ideal-int +pkg syscall (freebsd-386-cgo), const SYS_THR_CREATE ideal-int +pkg syscall (freebsd-386-cgo), const SYS_THR_EXIT ideal-int +pkg syscall (freebsd-386-cgo), const SYS_THR_KILL ideal-int +pkg syscall (freebsd-386-cgo), const SYS_THR_KILL2 ideal-int +pkg syscall (freebsd-386-cgo), const SYS_THR_NEW ideal-int +pkg syscall (freebsd-386-cgo), const SYS_THR_SELF ideal-int +pkg syscall (freebsd-386-cgo), const SYS_THR_SET_NAME ideal-int +pkg syscall (freebsd-386-cgo), const SYS_THR_SUSPEND ideal-int +pkg syscall (freebsd-386-cgo), const SYS_THR_WAKE ideal-int +pkg syscall (freebsd-386-cgo), const SYS_TRUNCATE ideal-int +pkg syscall (freebsd-386-cgo), const SYS_UMASK ideal-int +pkg syscall (freebsd-386-cgo), const SYS_UNDELETE ideal-int +pkg syscall (freebsd-386-cgo), const SYS_UNLINK ideal-int +pkg syscall (freebsd-386-cgo), const SYS_UNLINKAT ideal-int +pkg syscall (freebsd-386-cgo), const SYS_UNMOUNT ideal-int +pkg syscall (freebsd-386-cgo), const SYS_UTIMES ideal-int +pkg syscall (freebsd-386-cgo), const SYS_UTRACE ideal-int +pkg syscall (freebsd-386-cgo), const SYS_UUIDGEN ideal-int +pkg syscall (freebsd-386-cgo), const SYS_VFORK ideal-int +pkg syscall (freebsd-386-cgo), const SYS_WAIT4 ideal-int +pkg syscall (freebsd-386-cgo), const SYS_WAIT6 ideal-int +pkg syscall (freebsd-386-cgo), const SYS_WRITE ideal-int +pkg syscall (freebsd-386-cgo), const SYS_WRITEV ideal-int +pkg syscall (freebsd-386-cgo), const SYS_YIELD ideal-int +pkg syscall (freebsd-386-cgo), const SYS__UMTX_LOCK ideal-int +pkg syscall (freebsd-386-cgo), const SYS__UMTX_OP ideal-int +pkg syscall (freebsd-386-cgo), const SYS__UMTX_UNLOCK ideal-int +pkg syscall (freebsd-386-cgo), const SYS___ACL_ACLCHECK_FD ideal-int +pkg syscall (freebsd-386-cgo), const SYS___ACL_ACLCHECK_FILE ideal-int +pkg syscall (freebsd-386-cgo), const SYS___ACL_ACLCHECK_LINK ideal-int +pkg syscall (freebsd-386-cgo), const SYS___ACL_DELETE_FD ideal-int +pkg syscall (freebsd-386-cgo), const SYS___ACL_DELETE_FILE ideal-int +pkg syscall (freebsd-386-cgo), const SYS___ACL_DELETE_LINK ideal-int +pkg syscall (freebsd-386-cgo), const SYS___ACL_GET_FD ideal-int +pkg syscall (freebsd-386-cgo), const SYS___ACL_GET_FILE ideal-int +pkg syscall (freebsd-386-cgo), const SYS___ACL_GET_LINK ideal-int +pkg syscall (freebsd-386-cgo), const SYS___ACL_SET_FD ideal-int +pkg syscall (freebsd-386-cgo), const SYS___ACL_SET_FILE ideal-int +pkg syscall (freebsd-386-cgo), const SYS___ACL_SET_LINK ideal-int +pkg syscall (freebsd-386-cgo), const SYS___GETCWD ideal-int +pkg syscall (freebsd-386-cgo), const SYS___MAC_EXECVE ideal-int +pkg syscall (freebsd-386-cgo), const SYS___MAC_GET_FD ideal-int +pkg syscall (freebsd-386-cgo), const SYS___MAC_GET_FILE ideal-int +pkg syscall (freebsd-386-cgo), const SYS___MAC_GET_LINK ideal-int +pkg syscall (freebsd-386-cgo), const SYS___MAC_GET_PID ideal-int +pkg syscall (freebsd-386-cgo), const SYS___MAC_GET_PROC ideal-int +pkg syscall (freebsd-386-cgo), const SYS___MAC_SET_FD ideal-int +pkg syscall (freebsd-386-cgo), const SYS___MAC_SET_FILE ideal-int +pkg syscall (freebsd-386-cgo), const SYS___MAC_SET_LINK ideal-int +pkg syscall (freebsd-386-cgo), const SYS___MAC_SET_PROC ideal-int +pkg syscall (freebsd-386-cgo), const SYS___SETUGID ideal-int +pkg syscall (freebsd-386-cgo), const SYS___SYSCTL ideal-int +pkg syscall (freebsd-386-cgo), const SizeofBpfHdr ideal-int +pkg syscall (freebsd-386-cgo), const SizeofBpfInsn ideal-int +pkg syscall (freebsd-386-cgo), const SizeofBpfProgram ideal-int +pkg syscall (freebsd-386-cgo), const SizeofBpfStat ideal-int +pkg syscall (freebsd-386-cgo), const SizeofBpfVersion ideal-int +pkg syscall (freebsd-386-cgo), const SizeofBpfZbuf ideal-int +pkg syscall (freebsd-386-cgo), const SizeofBpfZbufHeader ideal-int +pkg syscall (freebsd-386-cgo), const SizeofCmsghdr ideal-int +pkg syscall (freebsd-386-cgo), const SizeofICMPv6Filter = 32 +pkg syscall (freebsd-386-cgo), const SizeofICMPv6Filter ideal-int +pkg syscall (freebsd-386-cgo), const SizeofIPMreq ideal-int +pkg syscall (freebsd-386-cgo), const SizeofIPMreqn ideal-int +pkg syscall (freebsd-386-cgo), const SizeofIPv6MTUInfo = 32 +pkg syscall (freebsd-386-cgo), const SizeofIPv6MTUInfo ideal-int +pkg syscall (freebsd-386-cgo), const SizeofIPv6Mreq ideal-int +pkg syscall (freebsd-386-cgo), const SizeofIfAnnounceMsghdr ideal-int +pkg syscall (freebsd-386-cgo), const SizeofIfData ideal-int +pkg syscall (freebsd-386-cgo), const SizeofIfMsghdr ideal-int +pkg syscall (freebsd-386-cgo), const SizeofIfaMsghdr ideal-int +pkg syscall (freebsd-386-cgo), const SizeofIfmaMsghdr ideal-int +pkg syscall (freebsd-386-cgo), const SizeofInet6Pktinfo ideal-int +pkg syscall (freebsd-386-cgo), const SizeofLinger ideal-int +pkg syscall (freebsd-386-cgo), const SizeofMsghdr ideal-int +pkg syscall (freebsd-386-cgo), const SizeofRtMetrics ideal-int +pkg syscall (freebsd-386-cgo), const SizeofRtMsghdr ideal-int +pkg syscall (freebsd-386-cgo), const SizeofSockaddrAny ideal-int +pkg syscall (freebsd-386-cgo), const SizeofSockaddrDatalink ideal-int +pkg syscall (freebsd-386-cgo), const SizeofSockaddrInet4 ideal-int +pkg syscall (freebsd-386-cgo), const SizeofSockaddrInet6 ideal-int +pkg syscall (freebsd-386-cgo), const SizeofSockaddrUnix ideal-int +pkg syscall (freebsd-386-cgo), const TCIFLUSH ideal-int +pkg syscall (freebsd-386-cgo), const TCIOFLUSH ideal-int +pkg syscall (freebsd-386-cgo), const TCOFLUSH ideal-int +pkg syscall (freebsd-386-cgo), const TCP_CA_NAME_MAX ideal-int +pkg syscall (freebsd-386-cgo), const TCP_CONGESTION ideal-int +pkg syscall (freebsd-386-cgo), const TCP_INFO ideal-int +pkg syscall (freebsd-386-cgo), const TCP_KEEPCNT ideal-int +pkg syscall (freebsd-386-cgo), const TCP_KEEPIDLE ideal-int +pkg syscall (freebsd-386-cgo), const TCP_KEEPINIT ideal-int +pkg syscall (freebsd-386-cgo), const TCP_KEEPINTVL ideal-int +pkg syscall (freebsd-386-cgo), const TCP_MAXBURST ideal-int +pkg syscall (freebsd-386-cgo), const TCP_MAXHLEN ideal-int +pkg syscall (freebsd-386-cgo), const TCP_MAXOLEN ideal-int +pkg syscall (freebsd-386-cgo), const TCP_MAXSEG ideal-int +pkg syscall (freebsd-386-cgo), const TCP_MAXWIN ideal-int +pkg syscall (freebsd-386-cgo), const TCP_MAX_SACK ideal-int +pkg syscall (freebsd-386-cgo), const TCP_MAX_WINSHIFT ideal-int +pkg syscall (freebsd-386-cgo), const TCP_MD5SIG ideal-int +pkg syscall (freebsd-386-cgo), const TCP_MINMSS ideal-int +pkg syscall (freebsd-386-cgo), const TCP_MSS ideal-int +pkg syscall (freebsd-386-cgo), const TCP_NOOPT ideal-int +pkg syscall (freebsd-386-cgo), const TCP_NOPUSH ideal-int +pkg syscall (freebsd-386-cgo), const TCSAFLUSH ideal-int +pkg syscall (freebsd-386-cgo), const TIOCCBRK ideal-int +pkg syscall (freebsd-386-cgo), const TIOCCDTR ideal-int +pkg syscall (freebsd-386-cgo), const TIOCCONS ideal-int +pkg syscall (freebsd-386-cgo), const TIOCDRAIN ideal-int +pkg syscall (freebsd-386-cgo), const TIOCEXCL ideal-int +pkg syscall (freebsd-386-cgo), const TIOCEXT ideal-int +pkg syscall (freebsd-386-cgo), const TIOCFLUSH ideal-int +pkg syscall (freebsd-386-cgo), const TIOCGDRAINWAIT ideal-int +pkg syscall (freebsd-386-cgo), const TIOCGETA ideal-int +pkg syscall (freebsd-386-cgo), const TIOCGETD ideal-int +pkg syscall (freebsd-386-cgo), const TIOCGPGRP ideal-int +pkg syscall (freebsd-386-cgo), const TIOCGPTN ideal-int +pkg syscall (freebsd-386-cgo), const TIOCGSID ideal-int +pkg syscall (freebsd-386-cgo), const TIOCGWINSZ ideal-int +pkg syscall (freebsd-386-cgo), const TIOCMBIC ideal-int +pkg syscall (freebsd-386-cgo), const TIOCMBIS ideal-int +pkg syscall (freebsd-386-cgo), const TIOCMGDTRWAIT ideal-int +pkg syscall (freebsd-386-cgo), const TIOCMGET ideal-int +pkg syscall (freebsd-386-cgo), const TIOCMSDTRWAIT ideal-int +pkg syscall (freebsd-386-cgo), const TIOCMSET ideal-int +pkg syscall (freebsd-386-cgo), const TIOCM_CAR ideal-int +pkg syscall (freebsd-386-cgo), const TIOCM_CD ideal-int +pkg syscall (freebsd-386-cgo), const TIOCM_CTS ideal-int +pkg syscall (freebsd-386-cgo), const TIOCM_DCD ideal-int +pkg syscall (freebsd-386-cgo), const TIOCM_DSR ideal-int +pkg syscall (freebsd-386-cgo), const TIOCM_DTR ideal-int +pkg syscall (freebsd-386-cgo), const TIOCM_LE ideal-int +pkg syscall (freebsd-386-cgo), const TIOCM_RI ideal-int +pkg syscall (freebsd-386-cgo), const TIOCM_RNG ideal-int +pkg syscall (freebsd-386-cgo), const TIOCM_RTS ideal-int +pkg syscall (freebsd-386-cgo), const TIOCM_SR ideal-int +pkg syscall (freebsd-386-cgo), const TIOCM_ST ideal-int +pkg syscall (freebsd-386-cgo), const TIOCNOTTY ideal-int +pkg syscall (freebsd-386-cgo), const TIOCNXCL ideal-int +pkg syscall (freebsd-386-cgo), const TIOCOUTQ ideal-int +pkg syscall (freebsd-386-cgo), const TIOCPKT ideal-int +pkg syscall (freebsd-386-cgo), const TIOCPKT_DATA ideal-int +pkg syscall (freebsd-386-cgo), const TIOCPKT_DOSTOP ideal-int +pkg syscall (freebsd-386-cgo), const TIOCPKT_FLUSHREAD ideal-int +pkg syscall (freebsd-386-cgo), const TIOCPKT_FLUSHWRITE ideal-int +pkg syscall (freebsd-386-cgo), const TIOCPKT_IOCTL ideal-int +pkg syscall (freebsd-386-cgo), const TIOCPKT_NOSTOP ideal-int +pkg syscall (freebsd-386-cgo), const TIOCPKT_START ideal-int +pkg syscall (freebsd-386-cgo), const TIOCPKT_STOP ideal-int +pkg syscall (freebsd-386-cgo), const TIOCPTMASTER ideal-int +pkg syscall (freebsd-386-cgo), const TIOCSBRK ideal-int +pkg syscall (freebsd-386-cgo), const TIOCSCTTY ideal-int +pkg syscall (freebsd-386-cgo), const TIOCSDRAINWAIT ideal-int +pkg syscall (freebsd-386-cgo), const TIOCSDTR ideal-int +pkg syscall (freebsd-386-cgo), const TIOCSETA ideal-int +pkg syscall (freebsd-386-cgo), const TIOCSETAF ideal-int +pkg syscall (freebsd-386-cgo), const TIOCSETAW ideal-int +pkg syscall (freebsd-386-cgo), const TIOCSETD ideal-int +pkg syscall (freebsd-386-cgo), const TIOCSIG ideal-int +pkg syscall (freebsd-386-cgo), const TIOCSPGRP ideal-int +pkg syscall (freebsd-386-cgo), const TIOCSTART ideal-int +pkg syscall (freebsd-386-cgo), const TIOCSTAT ideal-int +pkg syscall (freebsd-386-cgo), const TIOCSTI ideal-int +pkg syscall (freebsd-386-cgo), const TIOCSTOP ideal-int +pkg syscall (freebsd-386-cgo), const TIOCSWINSZ ideal-int +pkg syscall (freebsd-386-cgo), const TIOCTIMESTAMP ideal-int +pkg syscall (freebsd-386-cgo), const TIOCUCNTL ideal-int +pkg syscall (freebsd-386-cgo), const TOSTOP ideal-int +pkg syscall (freebsd-386-cgo), const VDISCARD ideal-int +pkg syscall (freebsd-386-cgo), const VDSUSP ideal-int +pkg syscall (freebsd-386-cgo), const VEOF ideal-int +pkg syscall (freebsd-386-cgo), const VEOL ideal-int +pkg syscall (freebsd-386-cgo), const VEOL2 ideal-int +pkg syscall (freebsd-386-cgo), const VERASE ideal-int +pkg syscall (freebsd-386-cgo), const VERASE2 ideal-int +pkg syscall (freebsd-386-cgo), const VINTR ideal-int +pkg syscall (freebsd-386-cgo), const VKILL ideal-int +pkg syscall (freebsd-386-cgo), const VLNEXT ideal-int +pkg syscall (freebsd-386-cgo), const VMIN ideal-int +pkg syscall (freebsd-386-cgo), const VQUIT ideal-int +pkg syscall (freebsd-386-cgo), const VREPRINT ideal-int +pkg syscall (freebsd-386-cgo), const VSTART ideal-int +pkg syscall (freebsd-386-cgo), const VSTATUS ideal-int +pkg syscall (freebsd-386-cgo), const VSTOP ideal-int +pkg syscall (freebsd-386-cgo), const VSUSP ideal-int +pkg syscall (freebsd-386-cgo), const VTIME ideal-int +pkg syscall (freebsd-386-cgo), const VWERASE ideal-int +pkg syscall (freebsd-386-cgo), const WCONTINUED ideal-int +pkg syscall (freebsd-386-cgo), const WCOREFLAG ideal-int +pkg syscall (freebsd-386-cgo), const WLINUXCLONE ideal-int +pkg syscall (freebsd-386-cgo), const WNOHANG ideal-int +pkg syscall (freebsd-386-cgo), const WNOWAIT ideal-int +pkg syscall (freebsd-386-cgo), const WSTOPPED ideal-int +pkg syscall (freebsd-386-cgo), const WUNTRACED ideal-int +pkg syscall (freebsd-386-cgo), func Accept(int) (int, Sockaddr, error) +pkg syscall (freebsd-386-cgo), func Access(string, uint32) error +pkg syscall (freebsd-386-cgo), func Adjtime(*Timeval, *Timeval) error +pkg syscall (freebsd-386-cgo), func Bind(int, Sockaddr) error +pkg syscall (freebsd-386-cgo), func BpfBuflen(int) (int, error) +pkg syscall (freebsd-386-cgo), func BpfDatalink(int) (int, error) +pkg syscall (freebsd-386-cgo), func BpfHeadercmpl(int) (int, error) +pkg syscall (freebsd-386-cgo), func BpfInterface(int, string) (string, error) +pkg syscall (freebsd-386-cgo), func BpfJump(int, int, int, int) *BpfInsn +pkg syscall (freebsd-386-cgo), func BpfStats(int) (*BpfStat, error) +pkg syscall (freebsd-386-cgo), func BpfStmt(int, int) *BpfInsn +pkg syscall (freebsd-386-cgo), func BpfTimeout(int) (*Timeval, error) +pkg syscall (freebsd-386-cgo), func CheckBpfVersion(int) error +pkg syscall (freebsd-386-cgo), func Chflags(string, int) error +pkg syscall (freebsd-386-cgo), func Chroot(string) error +pkg syscall (freebsd-386-cgo), func Close(int) error +pkg syscall (freebsd-386-cgo), func CloseOnExec(int) +pkg syscall (freebsd-386-cgo), func CmsgLen(int) int +pkg syscall (freebsd-386-cgo), func CmsgSpace(int) int +pkg syscall (freebsd-386-cgo), func Connect(int, Sockaddr) error +pkg syscall (freebsd-386-cgo), func Dup(int) (int, error) +pkg syscall (freebsd-386-cgo), func Dup2(int, int) error +pkg syscall (freebsd-386-cgo), func Fchdir(int) error +pkg syscall (freebsd-386-cgo), func Fchflags(int, int) error +pkg syscall (freebsd-386-cgo), func Fchmod(int, uint32) error +pkg syscall (freebsd-386-cgo), func Fchown(int, int, int) error +pkg syscall (freebsd-386-cgo), func Flock(int, int) error +pkg syscall (freebsd-386-cgo), func FlushBpf(int) error +pkg syscall (freebsd-386-cgo), func ForkExec(string, []string, *ProcAttr) (int, error) +pkg syscall (freebsd-386-cgo), func Fpathconf(int, int) (int, error) +pkg syscall (freebsd-386-cgo), func Fstat(int, *Stat_t) error +pkg syscall (freebsd-386-cgo), func Fstatfs(int, *Statfs_t) error +pkg syscall (freebsd-386-cgo), func Fsync(int) error +pkg syscall (freebsd-386-cgo), func Ftruncate(int, int64) error +pkg syscall (freebsd-386-cgo), func Futimes(int, []Timeval) error +pkg syscall (freebsd-386-cgo), func Getdirentries(int, []uint8, *uintptr) (int, error) +pkg syscall (freebsd-386-cgo), func Getdtablesize() int +pkg syscall (freebsd-386-cgo), func Getfsstat([]Statfs_t, int) (int, error) +pkg syscall (freebsd-386-cgo), func Getpeername(int) (Sockaddr, error) +pkg syscall (freebsd-386-cgo), func Getpgid(int) (int, error) +pkg syscall (freebsd-386-cgo), func Getpgrp() int +pkg syscall (freebsd-386-cgo), func Getpriority(int, int) (int, error) +pkg syscall (freebsd-386-cgo), func Getrlimit(int, *Rlimit) error +pkg syscall (freebsd-386-cgo), func Getrusage(int, *Rusage) error +pkg syscall (freebsd-386-cgo), func Getsid(int) (int, error) +pkg syscall (freebsd-386-cgo), func Getsockname(int) (Sockaddr, error) +pkg syscall (freebsd-386-cgo), func GetsockoptByte(int, int, int) (uint8, error) +pkg syscall (freebsd-386-cgo), func GetsockoptICMPv6Filter(int, int, int) (*ICMPv6Filter, error) +pkg syscall (freebsd-386-cgo), func GetsockoptIPMreq(int, int, int) (*IPMreq, error) +pkg syscall (freebsd-386-cgo), func GetsockoptIPMreqn(int, int, int) (*IPMreqn, error) +pkg syscall (freebsd-386-cgo), func GetsockoptIPv6MTUInfo(int, int, int) (*IPv6MTUInfo, error) +pkg syscall (freebsd-386-cgo), func GetsockoptIPv6Mreq(int, int, int) (*IPv6Mreq, error) +pkg syscall (freebsd-386-cgo), func GetsockoptInet4Addr(int, int, int) ([4]uint8, error) +pkg syscall (freebsd-386-cgo), func GetsockoptInt(int, int, int) (int, error) +pkg syscall (freebsd-386-cgo), func Issetugid() bool +pkg syscall (freebsd-386-cgo), func Kevent(int, []Kevent_t, []Kevent_t, *Timespec) (int, error) +pkg syscall (freebsd-386-cgo), func Kill(int, Signal) error +pkg syscall (freebsd-386-cgo), func Kqueue() (int, error) +pkg syscall (freebsd-386-cgo), func Listen(int, int) error +pkg syscall (freebsd-386-cgo), func Lstat(string, *Stat_t) error +pkg syscall (freebsd-386-cgo), func Mkfifo(string, uint32) error +pkg syscall (freebsd-386-cgo), func Mknod(string, uint32, int) error +pkg syscall (freebsd-386-cgo), func Mmap(int, int64, int, int, int) ([]uint8, error) +pkg syscall (freebsd-386-cgo), func Munmap([]uint8) error +pkg syscall (freebsd-386-cgo), func Nanosleep(*Timespec, *Timespec) error +pkg syscall (freebsd-386-cgo), func Open(string, int, uint32) (int, error) +pkg syscall (freebsd-386-cgo), func ParseDirent([]uint8, int, []string) (int, int, []string) +pkg syscall (freebsd-386-cgo), func ParseRoutingMessage([]uint8) ([]RoutingMessage, error) +pkg syscall (freebsd-386-cgo), func ParseRoutingSockaddr(RoutingMessage) ([]Sockaddr, error) +pkg syscall (freebsd-386-cgo), func ParseSocketControlMessage([]uint8) ([]SocketControlMessage, error) +pkg syscall (freebsd-386-cgo), func ParseUnixRights(*SocketControlMessage) ([]int, error) +pkg syscall (freebsd-386-cgo), func Pathconf(string, int) (int, error) +pkg syscall (freebsd-386-cgo), func Pipe([]int) error +pkg syscall (freebsd-386-cgo), func Pread(int, []uint8, int64) (int, error) +pkg syscall (freebsd-386-cgo), func Pwrite(int, []uint8, int64) (int, error) +pkg syscall (freebsd-386-cgo), func RawSyscall(uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno) +pkg syscall (freebsd-386-cgo), func RawSyscall6(uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno) +pkg syscall (freebsd-386-cgo), func Read(int, []uint8) (int, error) +pkg syscall (freebsd-386-cgo), func ReadDirent(int, []uint8) (int, error) +pkg syscall (freebsd-386-cgo), func Recvfrom(int, []uint8, int) (int, Sockaddr, error) +pkg syscall (freebsd-386-cgo), func Recvmsg(int, []uint8, []uint8, int) (int, int, int, Sockaddr, error) +pkg syscall (freebsd-386-cgo), func Revoke(string) error +pkg syscall (freebsd-386-cgo), func RouteRIB(int, int) ([]uint8, error) +pkg syscall (freebsd-386-cgo), func Seek(int, int64, int) (int64, error) +pkg syscall (freebsd-386-cgo), func Select(int, *FdSet, *FdSet, *FdSet, *Timeval) error +pkg syscall (freebsd-386-cgo), func Sendfile(int, int, *int64, int) (int, error) +pkg syscall (freebsd-386-cgo), func Sendmsg(int, []uint8, []uint8, Sockaddr, int) error +pkg syscall (freebsd-386-cgo), func Sendto(int, []uint8, int, Sockaddr) error +pkg syscall (freebsd-386-cgo), func SetBpf(int, []BpfInsn) error +pkg syscall (freebsd-386-cgo), func SetBpfBuflen(int, int) (int, error) +pkg syscall (freebsd-386-cgo), func SetBpfDatalink(int, int) (int, error) +pkg syscall (freebsd-386-cgo), func SetBpfHeadercmpl(int, int) error +pkg syscall (freebsd-386-cgo), func SetBpfImmediate(int, int) error +pkg syscall (freebsd-386-cgo), func SetBpfInterface(int, string) error +pkg syscall (freebsd-386-cgo), func SetBpfPromisc(int, int) error +pkg syscall (freebsd-386-cgo), func SetBpfTimeout(int, *Timeval) error +pkg syscall (freebsd-386-cgo), func SetKevent(*Kevent_t, int, int, int) +pkg syscall (freebsd-386-cgo), func SetNonblock(int, bool) error +pkg syscall (freebsd-386-cgo), func Setegid(int) error +pkg syscall (freebsd-386-cgo), func Seteuid(int) error +pkg syscall (freebsd-386-cgo), func Setgid(int) error +pkg syscall (freebsd-386-cgo), func Setgroups([]int) error +pkg syscall (freebsd-386-cgo), func Setlogin(string) error +pkg syscall (freebsd-386-cgo), func Setpgid(int, int) error +pkg syscall (freebsd-386-cgo), func Setpriority(int, int, int) error +pkg syscall (freebsd-386-cgo), func Setregid(int, int) error +pkg syscall (freebsd-386-cgo), func Setreuid(int, int) error +pkg syscall (freebsd-386-cgo), func Setrlimit(int, *Rlimit) error +pkg syscall (freebsd-386-cgo), func Setsid() (int, error) +pkg syscall (freebsd-386-cgo), func SetsockoptByte(int, int, int, uint8) error +pkg syscall (freebsd-386-cgo), func SetsockoptICMPv6Filter(int, int, int, *ICMPv6Filter) error +pkg syscall (freebsd-386-cgo), func SetsockoptIPMreq(int, int, int, *IPMreq) error +pkg syscall (freebsd-386-cgo), func SetsockoptIPMreqn(int, int, int, *IPMreqn) error +pkg syscall (freebsd-386-cgo), func SetsockoptIPv6Mreq(int, int, int, *IPv6Mreq) error +pkg syscall (freebsd-386-cgo), func SetsockoptInet4Addr(int, int, int, [4]uint8) error +pkg syscall (freebsd-386-cgo), func SetsockoptInt(int, int, int, int) error +pkg syscall (freebsd-386-cgo), func SetsockoptLinger(int, int, int, *Linger) error +pkg syscall (freebsd-386-cgo), func SetsockoptString(int, int, int, string) error +pkg syscall (freebsd-386-cgo), func SetsockoptTimeval(int, int, int, *Timeval) error +pkg syscall (freebsd-386-cgo), func Settimeofday(*Timeval) error +pkg syscall (freebsd-386-cgo), func Setuid(int) error +pkg syscall (freebsd-386-cgo), func Shutdown(int, int) error +pkg syscall (freebsd-386-cgo), func SlicePtrFromStrings([]string) ([]*uint8, error) +pkg syscall (freebsd-386-cgo), func Socket(int, int, int) (int, error) +pkg syscall (freebsd-386-cgo), func Socketpair(int, int, int) ([2]int, error) +pkg syscall (freebsd-386-cgo), func Stat(string, *Stat_t) error +pkg syscall (freebsd-386-cgo), func Statfs(string, *Statfs_t) error +pkg syscall (freebsd-386-cgo), func StringSlicePtr([]string) []*uint8 +pkg syscall (freebsd-386-cgo), func Sync() error +pkg syscall (freebsd-386-cgo), func Syscall(uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno) +pkg syscall (freebsd-386-cgo), func Syscall6(uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno) +pkg syscall (freebsd-386-cgo), func Syscall9(uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno) +pkg syscall (freebsd-386-cgo), func Sysctl(string) (string, error) +pkg syscall (freebsd-386-cgo), func SysctlUint32(string) (uint32, error) +pkg syscall (freebsd-386-cgo), func TimevalToNsec(Timeval) int64 +pkg syscall (freebsd-386-cgo), func Truncate(string, int64) error +pkg syscall (freebsd-386-cgo), func Umask(int) int +pkg syscall (freebsd-386-cgo), func Undelete(string) error +pkg syscall (freebsd-386-cgo), func UnixRights(...int) []uint8 +pkg syscall (freebsd-386-cgo), func Unmount(string, int) error +pkg syscall (freebsd-386-cgo), func Wait4(int, *WaitStatus, int, *Rusage) (int, error) +pkg syscall (freebsd-386-cgo), func Write(int, []uint8) (int, error) +pkg syscall (freebsd-386-cgo), method (*Cmsghdr) SetLen(int) +pkg syscall (freebsd-386-cgo), method (*Iovec) SetLen(int) +pkg syscall (freebsd-386-cgo), method (*Msghdr) SetControllen(int) +pkg syscall (freebsd-386-cgo), type BpfHdr struct +pkg syscall (freebsd-386-cgo), type BpfHdr struct, Caplen uint32 +pkg syscall (freebsd-386-cgo), type BpfHdr struct, Datalen uint32 +pkg syscall (freebsd-386-cgo), type BpfHdr struct, Hdrlen uint16 +pkg syscall (freebsd-386-cgo), type BpfHdr struct, Pad_cgo_0 [2]uint8 +pkg syscall (freebsd-386-cgo), type BpfHdr struct, Tstamp Timeval +pkg syscall (freebsd-386-cgo), type BpfInsn struct +pkg syscall (freebsd-386-cgo), type BpfInsn struct, Code uint16 +pkg syscall (freebsd-386-cgo), type BpfInsn struct, Jf uint8 +pkg syscall (freebsd-386-cgo), type BpfInsn struct, Jt uint8 +pkg syscall (freebsd-386-cgo), type BpfInsn struct, K uint32 +pkg syscall (freebsd-386-cgo), type BpfProgram struct +pkg syscall (freebsd-386-cgo), type BpfProgram struct, Insns *BpfInsn +pkg syscall (freebsd-386-cgo), type BpfProgram struct, Len uint32 +pkg syscall (freebsd-386-cgo), type BpfStat struct +pkg syscall (freebsd-386-cgo), type BpfStat struct, Drop uint32 +pkg syscall (freebsd-386-cgo), type BpfStat struct, Recv uint32 +pkg syscall (freebsd-386-cgo), type BpfVersion struct +pkg syscall (freebsd-386-cgo), type BpfVersion struct, Major uint16 +pkg syscall (freebsd-386-cgo), type BpfVersion struct, Minor uint16 +pkg syscall (freebsd-386-cgo), type BpfZbuf struct +pkg syscall (freebsd-386-cgo), type BpfZbuf struct, Bufa *uint8 +pkg syscall (freebsd-386-cgo), type BpfZbuf struct, Bufb *uint8 +pkg syscall (freebsd-386-cgo), type BpfZbuf struct, Buflen uint32 +pkg syscall (freebsd-386-cgo), type BpfZbufHeader struct +pkg syscall (freebsd-386-cgo), type BpfZbufHeader struct, Kernel_gen uint32 +pkg syscall (freebsd-386-cgo), type BpfZbufHeader struct, Kernel_len uint32 +pkg syscall (freebsd-386-cgo), type BpfZbufHeader struct, User_gen uint32 +pkg syscall (freebsd-386-cgo), type BpfZbufHeader struct, X_bzh_pad [5]uint32 +pkg syscall (freebsd-386-cgo), type Cmsghdr struct +pkg syscall (freebsd-386-cgo), type Cmsghdr struct, Len uint32 +pkg syscall (freebsd-386-cgo), type Cmsghdr struct, Level int32 +pkg syscall (freebsd-386-cgo), type Cmsghdr struct, Type int32 +pkg syscall (freebsd-386-cgo), type Credential struct +pkg syscall (freebsd-386-cgo), type Credential struct, Gid uint32 +pkg syscall (freebsd-386-cgo), type Credential struct, Groups []uint32 +pkg syscall (freebsd-386-cgo), type Credential struct, Uid uint32 +pkg syscall (freebsd-386-cgo), type Dirent struct +pkg syscall (freebsd-386-cgo), type Dirent struct, Fileno uint32 +pkg syscall (freebsd-386-cgo), type Dirent struct, Name [256]int8 +pkg syscall (freebsd-386-cgo), type Dirent struct, Namlen uint8 +pkg syscall (freebsd-386-cgo), type Dirent struct, Reclen uint16 +pkg syscall (freebsd-386-cgo), type Dirent struct, Type uint8 +pkg syscall (freebsd-386-cgo), type FdSet struct +pkg syscall (freebsd-386-cgo), type FdSet struct, X__fds_bits [32]uint32 +pkg syscall (freebsd-386-cgo), type Flock_t struct +pkg syscall (freebsd-386-cgo), type Flock_t struct, Len int64 +pkg syscall (freebsd-386-cgo), type Flock_t struct, Pid int32 +pkg syscall (freebsd-386-cgo), type Flock_t struct, Start int64 +pkg syscall (freebsd-386-cgo), type Flock_t struct, Sysid int32 +pkg syscall (freebsd-386-cgo), type Flock_t struct, Type int16 +pkg syscall (freebsd-386-cgo), type Flock_t struct, Whence int16 +pkg syscall (freebsd-386-cgo), type Fsid struct +pkg syscall (freebsd-386-cgo), type Fsid struct, Val [2]int32 +pkg syscall (freebsd-386-cgo), type ICMPv6Filter struct +pkg syscall (freebsd-386-cgo), type ICMPv6Filter struct, Filt [8]uint32 +pkg syscall (freebsd-386-cgo), type IPMreqn struct +pkg syscall (freebsd-386-cgo), type IPMreqn struct, Address [4]uint8 +pkg syscall (freebsd-386-cgo), type IPMreqn struct, Ifindex int32 +pkg syscall (freebsd-386-cgo), type IPMreqn struct, Multiaddr [4]uint8 +pkg syscall (freebsd-386-cgo), type IPv6MTUInfo struct +pkg syscall (freebsd-386-cgo), type IPv6MTUInfo struct, Addr RawSockaddrInet6 +pkg syscall (freebsd-386-cgo), type IPv6MTUInfo struct, Mtu uint32 +pkg syscall (freebsd-386-cgo), type IfAnnounceMsghdr struct +pkg syscall (freebsd-386-cgo), type IfAnnounceMsghdr struct, Index uint16 +pkg syscall (freebsd-386-cgo), type IfAnnounceMsghdr struct, Msglen uint16 +pkg syscall (freebsd-386-cgo), type IfAnnounceMsghdr struct, Name [16]int8 +pkg syscall (freebsd-386-cgo), type IfAnnounceMsghdr struct, Type uint8 +pkg syscall (freebsd-386-cgo), type IfAnnounceMsghdr struct, Version uint8 +pkg syscall (freebsd-386-cgo), type IfAnnounceMsghdr struct, What uint16 +pkg syscall (freebsd-386-cgo), type IfData struct +pkg syscall (freebsd-386-cgo), type IfData struct, Addrlen uint8 +pkg syscall (freebsd-386-cgo), type IfData struct, Baudrate uint32 +pkg syscall (freebsd-386-cgo), type IfData struct, Collisions uint32 +pkg syscall (freebsd-386-cgo), type IfData struct, Datalen uint8 +pkg syscall (freebsd-386-cgo), type IfData struct, Epoch int32 +pkg syscall (freebsd-386-cgo), type IfData struct, Hdrlen uint8 +pkg syscall (freebsd-386-cgo), type IfData struct, Hwassist uint32 +pkg syscall (freebsd-386-cgo), type IfData struct, Ibytes uint32 +pkg syscall (freebsd-386-cgo), type IfData struct, Ierrors uint32 +pkg syscall (freebsd-386-cgo), type IfData struct, Imcasts uint32 +pkg syscall (freebsd-386-cgo), type IfData struct, Ipackets uint32 +pkg syscall (freebsd-386-cgo), type IfData struct, Iqdrops uint32 +pkg syscall (freebsd-386-cgo), type IfData struct, Lastchange Timeval +pkg syscall (freebsd-386-cgo), type IfData struct, Link_state uint8 +pkg syscall (freebsd-386-cgo), type IfData struct, Metric uint32 +pkg syscall (freebsd-386-cgo), type IfData struct, Mtu uint32 +pkg syscall (freebsd-386-cgo), type IfData struct, Noproto uint32 +pkg syscall (freebsd-386-cgo), type IfData struct, Obytes uint32 +pkg syscall (freebsd-386-cgo), type IfData struct, Oerrors uint32 +pkg syscall (freebsd-386-cgo), type IfData struct, Omcasts uint32 +pkg syscall (freebsd-386-cgo), type IfData struct, Opackets uint32 +pkg syscall (freebsd-386-cgo), type IfData struct, Physical uint8 +pkg syscall (freebsd-386-cgo), type IfData struct, Spare_char1 uint8 +pkg syscall (freebsd-386-cgo), type IfData struct, Spare_char2 uint8 +pkg syscall (freebsd-386-cgo), type IfData struct, Type uint8 +pkg syscall (freebsd-386-cgo), type IfMsghdr struct +pkg syscall (freebsd-386-cgo), type IfMsghdr struct, Addrs int32 +pkg syscall (freebsd-386-cgo), type IfMsghdr struct, Data IfData +pkg syscall (freebsd-386-cgo), type IfMsghdr struct, Flags int32 +pkg syscall (freebsd-386-cgo), type IfMsghdr struct, Index uint16 +pkg syscall (freebsd-386-cgo), type IfMsghdr struct, Msglen uint16 +pkg syscall (freebsd-386-cgo), type IfMsghdr struct, Pad_cgo_0 [2]uint8 +pkg syscall (freebsd-386-cgo), type IfMsghdr struct, Type uint8 +pkg syscall (freebsd-386-cgo), type IfMsghdr struct, Version uint8 +pkg syscall (freebsd-386-cgo), type IfaMsghdr struct +pkg syscall (freebsd-386-cgo), type IfaMsghdr struct, Addrs int32 +pkg syscall (freebsd-386-cgo), type IfaMsghdr struct, Flags int32 +pkg syscall (freebsd-386-cgo), type IfaMsghdr struct, Index uint16 +pkg syscall (freebsd-386-cgo), type IfaMsghdr struct, Metric int32 +pkg syscall (freebsd-386-cgo), type IfaMsghdr struct, Msglen uint16 +pkg syscall (freebsd-386-cgo), type IfaMsghdr struct, Pad_cgo_0 [2]uint8 +pkg syscall (freebsd-386-cgo), type IfaMsghdr struct, Type uint8 +pkg syscall (freebsd-386-cgo), type IfaMsghdr struct, Version uint8 +pkg syscall (freebsd-386-cgo), type IfmaMsghdr struct +pkg syscall (freebsd-386-cgo), type IfmaMsghdr struct, Addrs int32 +pkg syscall (freebsd-386-cgo), type IfmaMsghdr struct, Flags int32 +pkg syscall (freebsd-386-cgo), type IfmaMsghdr struct, Index uint16 +pkg syscall (freebsd-386-cgo), type IfmaMsghdr struct, Msglen uint16 +pkg syscall (freebsd-386-cgo), type IfmaMsghdr struct, Pad_cgo_0 [2]uint8 +pkg syscall (freebsd-386-cgo), type IfmaMsghdr struct, Type uint8 +pkg syscall (freebsd-386-cgo), type IfmaMsghdr struct, Version uint8 +pkg syscall (freebsd-386-cgo), type Inet6Pktinfo struct +pkg syscall (freebsd-386-cgo), type Inet6Pktinfo struct, Addr [16]uint8 +pkg syscall (freebsd-386-cgo), type Inet6Pktinfo struct, Ifindex uint32 +pkg syscall (freebsd-386-cgo), type InterfaceAddrMessage struct +pkg syscall (freebsd-386-cgo), type InterfaceAddrMessage struct, Data []uint8 +pkg syscall (freebsd-386-cgo), type InterfaceAddrMessage struct, Header IfaMsghdr +pkg syscall (freebsd-386-cgo), type InterfaceAnnounceMessage struct +pkg syscall (freebsd-386-cgo), type InterfaceAnnounceMessage struct, Header IfAnnounceMsghdr +pkg syscall (freebsd-386-cgo), type InterfaceMessage struct +pkg syscall (freebsd-386-cgo), type InterfaceMessage struct, Data []uint8 +pkg syscall (freebsd-386-cgo), type InterfaceMessage struct, Header IfMsghdr +pkg syscall (freebsd-386-cgo), type InterfaceMulticastAddrMessage struct +pkg syscall (freebsd-386-cgo), type InterfaceMulticastAddrMessage struct, Data []uint8 +pkg syscall (freebsd-386-cgo), type InterfaceMulticastAddrMessage struct, Header IfmaMsghdr +pkg syscall (freebsd-386-cgo), type Iovec struct +pkg syscall (freebsd-386-cgo), type Iovec struct, Base *uint8 +pkg syscall (freebsd-386-cgo), type Iovec struct, Len uint32 +pkg syscall (freebsd-386-cgo), type Kevent_t struct +pkg syscall (freebsd-386-cgo), type Kevent_t struct, Data int32 +pkg syscall (freebsd-386-cgo), type Kevent_t struct, Fflags uint32 +pkg syscall (freebsd-386-cgo), type Kevent_t struct, Filter int16 +pkg syscall (freebsd-386-cgo), type Kevent_t struct, Flags uint16 +pkg syscall (freebsd-386-cgo), type Kevent_t struct, Ident uint32 +pkg syscall (freebsd-386-cgo), type Kevent_t struct, Udata *uint8 +pkg syscall (freebsd-386-cgo), type Msghdr struct +pkg syscall (freebsd-386-cgo), type Msghdr struct, Control *uint8 +pkg syscall (freebsd-386-cgo), type Msghdr struct, Controllen uint32 +pkg syscall (freebsd-386-cgo), type Msghdr struct, Flags int32 +pkg syscall (freebsd-386-cgo), type Msghdr struct, Iov *Iovec +pkg syscall (freebsd-386-cgo), type Msghdr struct, Iovlen int32 +pkg syscall (freebsd-386-cgo), type Msghdr struct, Name *uint8 +pkg syscall (freebsd-386-cgo), type Msghdr struct, Namelen uint32 +pkg syscall (freebsd-386-cgo), type RawSockaddr struct, Data [14]int8 +pkg syscall (freebsd-386-cgo), type RawSockaddr struct, Family uint8 +pkg syscall (freebsd-386-cgo), type RawSockaddr struct, Len uint8 +pkg syscall (freebsd-386-cgo), type RawSockaddrAny struct, Pad [92]int8 +pkg syscall (freebsd-386-cgo), type RawSockaddrDatalink struct +pkg syscall (freebsd-386-cgo), type RawSockaddrDatalink struct, Alen uint8 +pkg syscall (freebsd-386-cgo), type RawSockaddrDatalink struct, Data [46]int8 +pkg syscall (freebsd-386-cgo), type RawSockaddrDatalink struct, Family uint8 +pkg syscall (freebsd-386-cgo), type RawSockaddrDatalink struct, Index uint16 +pkg syscall (freebsd-386-cgo), type RawSockaddrDatalink struct, Len uint8 +pkg syscall (freebsd-386-cgo), type RawSockaddrDatalink struct, Nlen uint8 +pkg syscall (freebsd-386-cgo), type RawSockaddrDatalink struct, Slen uint8 +pkg syscall (freebsd-386-cgo), type RawSockaddrDatalink struct, Type uint8 +pkg syscall (freebsd-386-cgo), type RawSockaddrInet4 struct, Family uint8 +pkg syscall (freebsd-386-cgo), type RawSockaddrInet4 struct, Len uint8 +pkg syscall (freebsd-386-cgo), type RawSockaddrInet4 struct, Zero [8]int8 +pkg syscall (freebsd-386-cgo), type RawSockaddrInet6 struct, Family uint8 +pkg syscall (freebsd-386-cgo), type RawSockaddrInet6 struct, Len uint8 +pkg syscall (freebsd-386-cgo), type RawSockaddrUnix struct +pkg syscall (freebsd-386-cgo), type RawSockaddrUnix struct, Family uint8 +pkg syscall (freebsd-386-cgo), type RawSockaddrUnix struct, Len uint8 +pkg syscall (freebsd-386-cgo), type RawSockaddrUnix struct, Path [104]int8 +pkg syscall (freebsd-386-cgo), type Rlimit struct +pkg syscall (freebsd-386-cgo), type Rlimit struct, Cur int64 +pkg syscall (freebsd-386-cgo), type Rlimit struct, Max int64 +pkg syscall (freebsd-386-cgo), type RouteMessage struct +pkg syscall (freebsd-386-cgo), type RouteMessage struct, Data []uint8 +pkg syscall (freebsd-386-cgo), type RouteMessage struct, Header RtMsghdr +pkg syscall (freebsd-386-cgo), type RoutingMessage interface, unexported methods +pkg syscall (freebsd-386-cgo), type RtMetrics struct +pkg syscall (freebsd-386-cgo), type RtMetrics struct, Expire uint32 +pkg syscall (freebsd-386-cgo), type RtMetrics struct, Filler [3]uint32 +pkg syscall (freebsd-386-cgo), type RtMetrics struct, Hopcount uint32 +pkg syscall (freebsd-386-cgo), type RtMetrics struct, Locks uint32 +pkg syscall (freebsd-386-cgo), type RtMetrics struct, Mtu uint32 +pkg syscall (freebsd-386-cgo), type RtMetrics struct, Pksent uint32 +pkg syscall (freebsd-386-cgo), type RtMetrics struct, Recvpipe uint32 +pkg syscall (freebsd-386-cgo), type RtMetrics struct, Rtt uint32 +pkg syscall (freebsd-386-cgo), type RtMetrics struct, Rttvar uint32 +pkg syscall (freebsd-386-cgo), type RtMetrics struct, Sendpipe uint32 +pkg syscall (freebsd-386-cgo), type RtMetrics struct, Ssthresh uint32 +pkg syscall (freebsd-386-cgo), type RtMetrics struct, Weight uint32 +pkg syscall (freebsd-386-cgo), type RtMsghdr struct +pkg syscall (freebsd-386-cgo), type RtMsghdr struct, Addrs int32 +pkg syscall (freebsd-386-cgo), type RtMsghdr struct, Errno int32 +pkg syscall (freebsd-386-cgo), type RtMsghdr struct, Flags int32 +pkg syscall (freebsd-386-cgo), type RtMsghdr struct, Fmask int32 +pkg syscall (freebsd-386-cgo), type RtMsghdr struct, Index uint16 +pkg syscall (freebsd-386-cgo), type RtMsghdr struct, Inits uint32 +pkg syscall (freebsd-386-cgo), type RtMsghdr struct, Msglen uint16 +pkg syscall (freebsd-386-cgo), type RtMsghdr struct, Pad_cgo_0 [2]uint8 +pkg syscall (freebsd-386-cgo), type RtMsghdr struct, Pid int32 +pkg syscall (freebsd-386-cgo), type RtMsghdr struct, Rmx RtMetrics +pkg syscall (freebsd-386-cgo), type RtMsghdr struct, Seq int32 +pkg syscall (freebsd-386-cgo), type RtMsghdr struct, Type uint8 +pkg syscall (freebsd-386-cgo), type RtMsghdr struct, Version uint8 +pkg syscall (freebsd-386-cgo), type Rusage struct, Idrss int32 +pkg syscall (freebsd-386-cgo), type Rusage struct, Inblock int32 +pkg syscall (freebsd-386-cgo), type Rusage struct, Isrss int32 +pkg syscall (freebsd-386-cgo), type Rusage struct, Ixrss int32 +pkg syscall (freebsd-386-cgo), type Rusage struct, Majflt int32 +pkg syscall (freebsd-386-cgo), type Rusage struct, Maxrss int32 +pkg syscall (freebsd-386-cgo), type Rusage struct, Minflt int32 +pkg syscall (freebsd-386-cgo), type Rusage struct, Msgrcv int32 +pkg syscall (freebsd-386-cgo), type Rusage struct, Msgsnd int32 +pkg syscall (freebsd-386-cgo), type Rusage struct, Nivcsw int32 +pkg syscall (freebsd-386-cgo), type Rusage struct, Nsignals int32 +pkg syscall (freebsd-386-cgo), type Rusage struct, Nswap int32 +pkg syscall (freebsd-386-cgo), type Rusage struct, Nvcsw int32 +pkg syscall (freebsd-386-cgo), type Rusage struct, Oublock int32 +pkg syscall (freebsd-386-cgo), type Rusage struct, Stime Timeval +pkg syscall (freebsd-386-cgo), type Rusage struct, Utime Timeval +pkg syscall (freebsd-386-cgo), type SockaddrDatalink struct +pkg syscall (freebsd-386-cgo), type SockaddrDatalink struct, Alen uint8 +pkg syscall (freebsd-386-cgo), type SockaddrDatalink struct, Data [46]int8 +pkg syscall (freebsd-386-cgo), type SockaddrDatalink struct, Family uint8 +pkg syscall (freebsd-386-cgo), type SockaddrDatalink struct, Index uint16 +pkg syscall (freebsd-386-cgo), type SockaddrDatalink struct, Len uint8 +pkg syscall (freebsd-386-cgo), type SockaddrDatalink struct, Nlen uint8 +pkg syscall (freebsd-386-cgo), type SockaddrDatalink struct, Slen uint8 +pkg syscall (freebsd-386-cgo), type SockaddrDatalink struct, Type uint8 +pkg syscall (freebsd-386-cgo), type SocketControlMessage struct +pkg syscall (freebsd-386-cgo), type SocketControlMessage struct, Data []uint8 +pkg syscall (freebsd-386-cgo), type SocketControlMessage struct, Header Cmsghdr +pkg syscall (freebsd-386-cgo), type Stat_t struct +pkg syscall (freebsd-386-cgo), type Stat_t struct, Atimespec Timespec +pkg syscall (freebsd-386-cgo), type Stat_t struct, Birthtimespec Timespec +pkg syscall (freebsd-386-cgo), type Stat_t struct, Blksize uint32 +pkg syscall (freebsd-386-cgo), type Stat_t struct, Blocks int64 +pkg syscall (freebsd-386-cgo), type Stat_t struct, Ctimespec Timespec +pkg syscall (freebsd-386-cgo), type Stat_t struct, Dev uint32 +pkg syscall (freebsd-386-cgo), type Stat_t struct, Flags uint32 +pkg syscall (freebsd-386-cgo), type Stat_t struct, Gen uint32 +pkg syscall (freebsd-386-cgo), type Stat_t struct, Gid uint32 +pkg syscall (freebsd-386-cgo), type Stat_t struct, Ino uint32 +pkg syscall (freebsd-386-cgo), type Stat_t struct, Lspare int32 +pkg syscall (freebsd-386-cgo), type Stat_t struct, Mode uint16 +pkg syscall (freebsd-386-cgo), type Stat_t struct, Mtimespec Timespec +pkg syscall (freebsd-386-cgo), type Stat_t struct, Nlink uint16 +pkg syscall (freebsd-386-cgo), type Stat_t struct, Pad_cgo_0 [8]uint8 +pkg syscall (freebsd-386-cgo), type Stat_t struct, Rdev uint32 +pkg syscall (freebsd-386-cgo), type Stat_t struct, Size int64 +pkg syscall (freebsd-386-cgo), type Stat_t struct, Uid uint32 +pkg syscall (freebsd-386-cgo), type Statfs_t struct +pkg syscall (freebsd-386-cgo), type Statfs_t struct, Asyncreads uint64 +pkg syscall (freebsd-386-cgo), type Statfs_t struct, Asyncwrites uint64 +pkg syscall (freebsd-386-cgo), type Statfs_t struct, Bavail int64 +pkg syscall (freebsd-386-cgo), type Statfs_t struct, Bfree uint64 +pkg syscall (freebsd-386-cgo), type Statfs_t struct, Blocks uint64 +pkg syscall (freebsd-386-cgo), type Statfs_t struct, Bsize uint64 +pkg syscall (freebsd-386-cgo), type Statfs_t struct, Charspare [80]int8 +pkg syscall (freebsd-386-cgo), type Statfs_t struct, Ffree int64 +pkg syscall (freebsd-386-cgo), type Statfs_t struct, Files uint64 +pkg syscall (freebsd-386-cgo), type Statfs_t struct, Flags uint64 +pkg syscall (freebsd-386-cgo), type Statfs_t struct, Fsid Fsid +pkg syscall (freebsd-386-cgo), type Statfs_t struct, Fstypename [16]int8 +pkg syscall (freebsd-386-cgo), type Statfs_t struct, Iosize uint64 +pkg syscall (freebsd-386-cgo), type Statfs_t struct, Mntfromname [88]int8 +pkg syscall (freebsd-386-cgo), type Statfs_t struct, Mntonname [88]int8 +pkg syscall (freebsd-386-cgo), type Statfs_t struct, Namemax uint32 +pkg syscall (freebsd-386-cgo), type Statfs_t struct, Owner uint32 +pkg syscall (freebsd-386-cgo), type Statfs_t struct, Spare [10]uint64 +pkg syscall (freebsd-386-cgo), type Statfs_t struct, Syncreads uint64 +pkg syscall (freebsd-386-cgo), type Statfs_t struct, Syncwrites uint64 +pkg syscall (freebsd-386-cgo), type Statfs_t struct, Type uint32 +pkg syscall (freebsd-386-cgo), type Statfs_t struct, Version uint32 +pkg syscall (freebsd-386-cgo), type SysProcAttr struct, Chroot string +pkg syscall (freebsd-386-cgo), type SysProcAttr struct, Credential *Credential +pkg syscall (freebsd-386-cgo), type SysProcAttr struct, Noctty bool +pkg syscall (freebsd-386-cgo), type SysProcAttr struct, Ptrace bool +pkg syscall (freebsd-386-cgo), type SysProcAttr struct, Setctty bool +pkg syscall (freebsd-386-cgo), type SysProcAttr struct, Setpgid bool +pkg syscall (freebsd-386-cgo), type SysProcAttr struct, Setsid bool +pkg syscall (freebsd-386-cgo), type Timespec struct, Nsec int32 +pkg syscall (freebsd-386-cgo), type Timespec struct, Sec int32 +pkg syscall (freebsd-386-cgo), type Timeval struct, Sec int32 +pkg syscall (freebsd-386-cgo), type Timeval struct, Usec int32 +pkg syscall (freebsd-386-cgo), type WaitStatus uint32 +pkg syscall (freebsd-386-cgo), var Stderr int +pkg syscall (freebsd-386-cgo), var Stdin int +pkg syscall (freebsd-386-cgo), var Stdout int +pkg syscall (freebsd-amd64), const F_DUP2FD_CLOEXEC = 18 +pkg syscall (freebsd-amd64), const F_DUP2FD_CLOEXEC ideal-int +pkg syscall (freebsd-amd64), const F_DUPFD_CLOEXEC = 17 +pkg syscall (freebsd-amd64), const F_DUPFD_CLOEXEC ideal-int +pkg syscall (freebsd-amd64), const ICMP6_FILTER = 18 +pkg syscall (freebsd-amd64), const ICMP6_FILTER ideal-int +pkg syscall (freebsd-amd64), const PRIO_PGRP = 1 +pkg syscall (freebsd-amd64), const PRIO_PGRP ideal-int +pkg syscall (freebsd-amd64), const PRIO_PROCESS = 0 +pkg syscall (freebsd-amd64), const PRIO_PROCESS ideal-int +pkg syscall (freebsd-amd64), const PRIO_USER = 2 +pkg syscall (freebsd-amd64), const PRIO_USER ideal-int +pkg syscall (freebsd-amd64), const SizeofICMPv6Filter = 32 +pkg syscall (freebsd-amd64), const SizeofICMPv6Filter ideal-int +pkg syscall (freebsd-amd64), const SizeofIPv6MTUInfo = 32 +pkg syscall (freebsd-amd64), const SizeofIPv6MTUInfo ideal-int +pkg syscall (freebsd-amd64), func GetsockoptICMPv6Filter(int, int, int) (*ICMPv6Filter, error) +pkg syscall (freebsd-amd64), func GetsockoptIPv6MTUInfo(int, int, int) (*IPv6MTUInfo, error) +pkg syscall (freebsd-amd64), func SetsockoptICMPv6Filter(int, int, int, *ICMPv6Filter) error +pkg syscall (freebsd-amd64), type ICMPv6Filter struct +pkg syscall (freebsd-amd64), type ICMPv6Filter struct, Filt [8]uint32 +pkg syscall (freebsd-amd64), type IPv6MTUInfo struct +pkg syscall (freebsd-amd64), type IPv6MTUInfo struct, Addr RawSockaddrInet6 +pkg syscall (freebsd-amd64), type IPv6MTUInfo struct, Mtu uint32 +pkg syscall (freebsd-amd64-cgo), const AF_APPLETALK ideal-int +pkg syscall (freebsd-amd64-cgo), const AF_ARP ideal-int +pkg syscall (freebsd-amd64-cgo), const AF_ATM ideal-int +pkg syscall (freebsd-amd64-cgo), const AF_BLUETOOTH ideal-int +pkg syscall (freebsd-amd64-cgo), const AF_CCITT ideal-int +pkg syscall (freebsd-amd64-cgo), const AF_CHAOS ideal-int +pkg syscall (freebsd-amd64-cgo), const AF_CNT ideal-int +pkg syscall (freebsd-amd64-cgo), const AF_COIP ideal-int +pkg syscall (freebsd-amd64-cgo), const AF_DATAKIT ideal-int +pkg syscall (freebsd-amd64-cgo), const AF_DECnet ideal-int +pkg syscall (freebsd-amd64-cgo), const AF_DLI ideal-int +pkg syscall (freebsd-amd64-cgo), const AF_E164 ideal-int +pkg syscall (freebsd-amd64-cgo), const AF_ECMA ideal-int +pkg syscall (freebsd-amd64-cgo), const AF_HYLINK ideal-int +pkg syscall (freebsd-amd64-cgo), const AF_IEEE80211 ideal-int +pkg syscall (freebsd-amd64-cgo), const AF_IMPLINK ideal-int +pkg syscall (freebsd-amd64-cgo), const AF_IPX ideal-int +pkg syscall (freebsd-amd64-cgo), const AF_ISDN ideal-int +pkg syscall (freebsd-amd64-cgo), const AF_ISO ideal-int +pkg syscall (freebsd-amd64-cgo), const AF_LAT ideal-int +pkg syscall (freebsd-amd64-cgo), const AF_LINK ideal-int +pkg syscall (freebsd-amd64-cgo), const AF_LOCAL ideal-int +pkg syscall (freebsd-amd64-cgo), const AF_MAX ideal-int +pkg syscall (freebsd-amd64-cgo), const AF_NATM ideal-int +pkg syscall (freebsd-amd64-cgo), const AF_NETBIOS ideal-int +pkg syscall (freebsd-amd64-cgo), const AF_NETGRAPH ideal-int +pkg syscall (freebsd-amd64-cgo), const AF_OSI ideal-int +pkg syscall (freebsd-amd64-cgo), const AF_PUP ideal-int +pkg syscall (freebsd-amd64-cgo), const AF_ROUTE ideal-int +pkg syscall (freebsd-amd64-cgo), const AF_SCLUSTER ideal-int +pkg syscall (freebsd-amd64-cgo), const AF_SIP ideal-int +pkg syscall (freebsd-amd64-cgo), const AF_SLOW ideal-int +pkg syscall (freebsd-amd64-cgo), const AF_SNA ideal-int +pkg syscall (freebsd-amd64-cgo), const AF_VENDOR00 ideal-int +pkg syscall (freebsd-amd64-cgo), const AF_VENDOR01 ideal-int +pkg syscall (freebsd-amd64-cgo), const AF_VENDOR02 ideal-int +pkg syscall (freebsd-amd64-cgo), const AF_VENDOR03 ideal-int +pkg syscall (freebsd-amd64-cgo), const AF_VENDOR04 ideal-int +pkg syscall (freebsd-amd64-cgo), const AF_VENDOR05 ideal-int +pkg syscall (freebsd-amd64-cgo), const AF_VENDOR06 ideal-int +pkg syscall (freebsd-amd64-cgo), const AF_VENDOR07 ideal-int +pkg syscall (freebsd-amd64-cgo), const AF_VENDOR08 ideal-int +pkg syscall (freebsd-amd64-cgo), const AF_VENDOR09 ideal-int +pkg syscall (freebsd-amd64-cgo), const AF_VENDOR10 ideal-int +pkg syscall (freebsd-amd64-cgo), const AF_VENDOR11 ideal-int +pkg syscall (freebsd-amd64-cgo), const AF_VENDOR12 ideal-int +pkg syscall (freebsd-amd64-cgo), const AF_VENDOR13 ideal-int +pkg syscall (freebsd-amd64-cgo), const AF_VENDOR14 ideal-int +pkg syscall (freebsd-amd64-cgo), const AF_VENDOR15 ideal-int +pkg syscall (freebsd-amd64-cgo), const AF_VENDOR16 ideal-int +pkg syscall (freebsd-amd64-cgo), const AF_VENDOR17 ideal-int +pkg syscall (freebsd-amd64-cgo), const AF_VENDOR18 ideal-int +pkg syscall (freebsd-amd64-cgo), const AF_VENDOR19 ideal-int +pkg syscall (freebsd-amd64-cgo), const AF_VENDOR20 ideal-int +pkg syscall (freebsd-amd64-cgo), const AF_VENDOR21 ideal-int +pkg syscall (freebsd-amd64-cgo), const AF_VENDOR22 ideal-int +pkg syscall (freebsd-amd64-cgo), const AF_VENDOR23 ideal-int +pkg syscall (freebsd-amd64-cgo), const AF_VENDOR24 ideal-int +pkg syscall (freebsd-amd64-cgo), const AF_VENDOR25 ideal-int +pkg syscall (freebsd-amd64-cgo), const AF_VENDOR26 ideal-int +pkg syscall (freebsd-amd64-cgo), const AF_VENDOR27 ideal-int +pkg syscall (freebsd-amd64-cgo), const AF_VENDOR28 ideal-int +pkg syscall (freebsd-amd64-cgo), const AF_VENDOR29 ideal-int +pkg syscall (freebsd-amd64-cgo), const AF_VENDOR30 ideal-int +pkg syscall (freebsd-amd64-cgo), const AF_VENDOR31 ideal-int +pkg syscall (freebsd-amd64-cgo), const AF_VENDOR32 ideal-int +pkg syscall (freebsd-amd64-cgo), const AF_VENDOR33 ideal-int +pkg syscall (freebsd-amd64-cgo), const AF_VENDOR34 ideal-int +pkg syscall (freebsd-amd64-cgo), const AF_VENDOR35 ideal-int +pkg syscall (freebsd-amd64-cgo), const AF_VENDOR36 ideal-int +pkg syscall (freebsd-amd64-cgo), const AF_VENDOR37 ideal-int +pkg syscall (freebsd-amd64-cgo), const AF_VENDOR38 ideal-int +pkg syscall (freebsd-amd64-cgo), const AF_VENDOR39 ideal-int +pkg syscall (freebsd-amd64-cgo), const AF_VENDOR40 ideal-int +pkg syscall (freebsd-amd64-cgo), const AF_VENDOR41 ideal-int +pkg syscall (freebsd-amd64-cgo), const AF_VENDOR42 ideal-int +pkg syscall (freebsd-amd64-cgo), const AF_VENDOR43 ideal-int +pkg syscall (freebsd-amd64-cgo), const AF_VENDOR44 ideal-int +pkg syscall (freebsd-amd64-cgo), const AF_VENDOR45 ideal-int +pkg syscall (freebsd-amd64-cgo), const AF_VENDOR46 ideal-int +pkg syscall (freebsd-amd64-cgo), const AF_VENDOR47 ideal-int +pkg syscall (freebsd-amd64-cgo), const B0 ideal-int +pkg syscall (freebsd-amd64-cgo), const B110 ideal-int +pkg syscall (freebsd-amd64-cgo), const B115200 ideal-int +pkg syscall (freebsd-amd64-cgo), const B1200 ideal-int +pkg syscall (freebsd-amd64-cgo), const B134 ideal-int +pkg syscall (freebsd-amd64-cgo), const B14400 ideal-int +pkg syscall (freebsd-amd64-cgo), const B150 ideal-int +pkg syscall (freebsd-amd64-cgo), const B1800 ideal-int +pkg syscall (freebsd-amd64-cgo), const B19200 ideal-int +pkg syscall (freebsd-amd64-cgo), const B200 ideal-int +pkg syscall (freebsd-amd64-cgo), const B230400 ideal-int +pkg syscall (freebsd-amd64-cgo), const B2400 ideal-int +pkg syscall (freebsd-amd64-cgo), const B28800 ideal-int +pkg syscall (freebsd-amd64-cgo), const B300 ideal-int +pkg syscall (freebsd-amd64-cgo), const B38400 ideal-int +pkg syscall (freebsd-amd64-cgo), const B460800 ideal-int +pkg syscall (freebsd-amd64-cgo), const B4800 ideal-int +pkg syscall (freebsd-amd64-cgo), const B50 ideal-int +pkg syscall (freebsd-amd64-cgo), const B57600 ideal-int +pkg syscall (freebsd-amd64-cgo), const B600 ideal-int +pkg syscall (freebsd-amd64-cgo), const B7200 ideal-int +pkg syscall (freebsd-amd64-cgo), const B75 ideal-int +pkg syscall (freebsd-amd64-cgo), const B76800 ideal-int +pkg syscall (freebsd-amd64-cgo), const B921600 ideal-int +pkg syscall (freebsd-amd64-cgo), const B9600 ideal-int +pkg syscall (freebsd-amd64-cgo), const BIOCFEEDBACK ideal-int +pkg syscall (freebsd-amd64-cgo), const BIOCFLUSH ideal-int +pkg syscall (freebsd-amd64-cgo), const BIOCGBLEN ideal-int +pkg syscall (freebsd-amd64-cgo), const BIOCGDIRECTION ideal-int +pkg syscall (freebsd-amd64-cgo), const BIOCGDLT ideal-int +pkg syscall (freebsd-amd64-cgo), const BIOCGDLTLIST ideal-int +pkg syscall (freebsd-amd64-cgo), const BIOCGETBUFMODE ideal-int +pkg syscall (freebsd-amd64-cgo), const BIOCGETIF ideal-int +pkg syscall (freebsd-amd64-cgo), const BIOCGETZMAX ideal-int +pkg syscall (freebsd-amd64-cgo), const BIOCGHDRCMPLT ideal-int +pkg syscall (freebsd-amd64-cgo), const BIOCGRSIG ideal-int +pkg syscall (freebsd-amd64-cgo), const BIOCGRTIMEOUT ideal-int +pkg syscall (freebsd-amd64-cgo), const BIOCGSEESENT ideal-int +pkg syscall (freebsd-amd64-cgo), const BIOCGSTATS ideal-int +pkg syscall (freebsd-amd64-cgo), const BIOCGTSTAMP ideal-int +pkg syscall (freebsd-amd64-cgo), const BIOCIMMEDIATE ideal-int +pkg syscall (freebsd-amd64-cgo), const BIOCLOCK ideal-int +pkg syscall (freebsd-amd64-cgo), const BIOCPROMISC ideal-int +pkg syscall (freebsd-amd64-cgo), const BIOCROTZBUF ideal-int +pkg syscall (freebsd-amd64-cgo), const BIOCSBLEN ideal-int +pkg syscall (freebsd-amd64-cgo), const BIOCSDIRECTION ideal-int +pkg syscall (freebsd-amd64-cgo), const BIOCSDLT ideal-int +pkg syscall (freebsd-amd64-cgo), const BIOCSETBUFMODE ideal-int +pkg syscall (freebsd-amd64-cgo), const BIOCSETF ideal-int +pkg syscall (freebsd-amd64-cgo), const BIOCSETFNR ideal-int +pkg syscall (freebsd-amd64-cgo), const BIOCSETIF ideal-int +pkg syscall (freebsd-amd64-cgo), const BIOCSETWF ideal-int +pkg syscall (freebsd-amd64-cgo), const BIOCSETZBUF ideal-int +pkg syscall (freebsd-amd64-cgo), const BIOCSHDRCMPLT ideal-int +pkg syscall (freebsd-amd64-cgo), const BIOCSRSIG ideal-int +pkg syscall (freebsd-amd64-cgo), const BIOCSRTIMEOUT ideal-int +pkg syscall (freebsd-amd64-cgo), const BIOCSSEESENT ideal-int +pkg syscall (freebsd-amd64-cgo), const BIOCSTSTAMP ideal-int +pkg syscall (freebsd-amd64-cgo), const BIOCVERSION ideal-int +pkg syscall (freebsd-amd64-cgo), const BPF_A ideal-int +pkg syscall (freebsd-amd64-cgo), const BPF_ABS ideal-int +pkg syscall (freebsd-amd64-cgo), const BPF_ADD ideal-int +pkg syscall (freebsd-amd64-cgo), const BPF_ALIGNMENT ideal-int +pkg syscall (freebsd-amd64-cgo), const BPF_ALU ideal-int +pkg syscall (freebsd-amd64-cgo), const BPF_AND ideal-int +pkg syscall (freebsd-amd64-cgo), const BPF_B ideal-int +pkg syscall (freebsd-amd64-cgo), const BPF_BUFMODE_BUFFER ideal-int +pkg syscall (freebsd-amd64-cgo), const BPF_BUFMODE_ZBUF ideal-int +pkg syscall (freebsd-amd64-cgo), const BPF_DIV ideal-int +pkg syscall (freebsd-amd64-cgo), const BPF_H ideal-int +pkg syscall (freebsd-amd64-cgo), const BPF_IMM ideal-int +pkg syscall (freebsd-amd64-cgo), const BPF_IND ideal-int +pkg syscall (freebsd-amd64-cgo), const BPF_JA ideal-int +pkg syscall (freebsd-amd64-cgo), const BPF_JEQ ideal-int +pkg syscall (freebsd-amd64-cgo), const BPF_JGE ideal-int +pkg syscall (freebsd-amd64-cgo), const BPF_JGT ideal-int +pkg syscall (freebsd-amd64-cgo), const BPF_JMP ideal-int +pkg syscall (freebsd-amd64-cgo), const BPF_JSET ideal-int +pkg syscall (freebsd-amd64-cgo), const BPF_K ideal-int +pkg syscall (freebsd-amd64-cgo), const BPF_LD ideal-int +pkg syscall (freebsd-amd64-cgo), const BPF_LDX ideal-int +pkg syscall (freebsd-amd64-cgo), const BPF_LEN ideal-int +pkg syscall (freebsd-amd64-cgo), const BPF_LSH ideal-int +pkg syscall (freebsd-amd64-cgo), const BPF_MAJOR_VERSION ideal-int +pkg syscall (freebsd-amd64-cgo), const BPF_MAXBUFSIZE ideal-int +pkg syscall (freebsd-amd64-cgo), const BPF_MAXINSNS ideal-int +pkg syscall (freebsd-amd64-cgo), const BPF_MEM ideal-int +pkg syscall (freebsd-amd64-cgo), const BPF_MEMWORDS ideal-int +pkg syscall (freebsd-amd64-cgo), const BPF_MINBUFSIZE ideal-int +pkg syscall (freebsd-amd64-cgo), const BPF_MINOR_VERSION ideal-int +pkg syscall (freebsd-amd64-cgo), const BPF_MISC ideal-int +pkg syscall (freebsd-amd64-cgo), const BPF_MSH ideal-int +pkg syscall (freebsd-amd64-cgo), const BPF_MUL ideal-int +pkg syscall (freebsd-amd64-cgo), const BPF_NEG ideal-int +pkg syscall (freebsd-amd64-cgo), const BPF_OR ideal-int +pkg syscall (freebsd-amd64-cgo), const BPF_RELEASE ideal-int +pkg syscall (freebsd-amd64-cgo), const BPF_RET ideal-int +pkg syscall (freebsd-amd64-cgo), const BPF_RSH ideal-int +pkg syscall (freebsd-amd64-cgo), const BPF_ST ideal-int +pkg syscall (freebsd-amd64-cgo), const BPF_STX ideal-int +pkg syscall (freebsd-amd64-cgo), const BPF_SUB ideal-int +pkg syscall (freebsd-amd64-cgo), const BPF_TAX ideal-int +pkg syscall (freebsd-amd64-cgo), const BPF_TXA ideal-int +pkg syscall (freebsd-amd64-cgo), const BPF_T_BINTIME ideal-int +pkg syscall (freebsd-amd64-cgo), const BPF_T_BINTIME_FAST ideal-int +pkg syscall (freebsd-amd64-cgo), const BPF_T_BINTIME_MONOTONIC ideal-int +pkg syscall (freebsd-amd64-cgo), const BPF_T_BINTIME_MONOTONIC_FAST ideal-int +pkg syscall (freebsd-amd64-cgo), const BPF_T_FAST ideal-int +pkg syscall (freebsd-amd64-cgo), const BPF_T_FLAG_MASK ideal-int +pkg syscall (freebsd-amd64-cgo), const BPF_T_FORMAT_MASK ideal-int +pkg syscall (freebsd-amd64-cgo), const BPF_T_MICROTIME ideal-int +pkg syscall (freebsd-amd64-cgo), const BPF_T_MICROTIME_FAST ideal-int +pkg syscall (freebsd-amd64-cgo), const BPF_T_MICROTIME_MONOTONIC ideal-int +pkg syscall (freebsd-amd64-cgo), const BPF_T_MICROTIME_MONOTONIC_FAST ideal-int +pkg syscall (freebsd-amd64-cgo), const BPF_T_MONOTONIC ideal-int +pkg syscall (freebsd-amd64-cgo), const BPF_T_MONOTONIC_FAST ideal-int +pkg syscall (freebsd-amd64-cgo), const BPF_T_NANOTIME ideal-int +pkg syscall (freebsd-amd64-cgo), const BPF_T_NANOTIME_FAST ideal-int +pkg syscall (freebsd-amd64-cgo), const BPF_T_NANOTIME_MONOTONIC ideal-int +pkg syscall (freebsd-amd64-cgo), const BPF_T_NANOTIME_MONOTONIC_FAST ideal-int +pkg syscall (freebsd-amd64-cgo), const BPF_T_NONE ideal-int +pkg syscall (freebsd-amd64-cgo), const BPF_T_NORMAL ideal-int +pkg syscall (freebsd-amd64-cgo), const BPF_W ideal-int +pkg syscall (freebsd-amd64-cgo), const BPF_X ideal-int +pkg syscall (freebsd-amd64-cgo), const BRKINT ideal-int +pkg syscall (freebsd-amd64-cgo), const CFLUSH ideal-int +pkg syscall (freebsd-amd64-cgo), const CLOCAL ideal-int +pkg syscall (freebsd-amd64-cgo), const CREAD ideal-int +pkg syscall (freebsd-amd64-cgo), const CS5 ideal-int +pkg syscall (freebsd-amd64-cgo), const CS6 ideal-int +pkg syscall (freebsd-amd64-cgo), const CS7 ideal-int +pkg syscall (freebsd-amd64-cgo), const CS8 ideal-int +pkg syscall (freebsd-amd64-cgo), const CSIZE ideal-int +pkg syscall (freebsd-amd64-cgo), const CSTART ideal-int +pkg syscall (freebsd-amd64-cgo), const CSTATUS ideal-int +pkg syscall (freebsd-amd64-cgo), const CSTOP ideal-int +pkg syscall (freebsd-amd64-cgo), const CSTOPB ideal-int +pkg syscall (freebsd-amd64-cgo), const CSUSP ideal-int +pkg syscall (freebsd-amd64-cgo), const CTL_MAXNAME ideal-int +pkg syscall (freebsd-amd64-cgo), const CTL_NET ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_A429 ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_A653_ICM ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_AIRONET_HEADER ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_AOS ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_APPLE_IP_OVER_IEEE1394 ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_ARCNET ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_ARCNET_LINUX ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_ATM_CLIP ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_ATM_RFC1483 ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_AURORA ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_AX25 ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_AX25_KISS ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_BACNET_MS_TP ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_BLUETOOTH_HCI_H4 ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_BLUETOOTH_HCI_H4_WITH_PHDR ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_CAN20B ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_CAN_SOCKETCAN ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_CHAOS ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_CHDLC ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_CISCO_IOS ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_C_HDLC ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_C_HDLC_WITH_DIR ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_DBUS ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_DECT ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_DOCSIS ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_DVB_CI ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_ECONET ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_EN10MB ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_EN3MB ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_ENC ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_ERF ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_ERF_ETH ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_ERF_POS ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_FC_2 ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_FC_2_WITH_FRAME_DELIMS ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_FDDI ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_FLEXRAY ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_FRELAY ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_FRELAY_WITH_DIR ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_GCOM_SERIAL ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_GCOM_T1E1 ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_GPF_F ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_GPF_T ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_GPRS_LLC ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_GSMTAP_ABIS ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_GSMTAP_UM ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_HHDLC ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_IBM_SN ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_IBM_SP ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_IEEE802 ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_IEEE802_11 ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_IEEE802_11_RADIO ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_IEEE802_11_RADIO_AVS ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_IEEE802_15_4 ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_IEEE802_15_4_LINUX ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_IEEE802_15_4_NOFCS ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_IEEE802_15_4_NONASK_PHY ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_IEEE802_16_MAC_CPS ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_IEEE802_16_MAC_CPS_RADIO ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_IPFILTER ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_IPMB ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_IPMB_LINUX ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_IPNET ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_IPOIB ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_IPV4 ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_IPV6 ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_IP_OVER_FC ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_JUNIPER_ATM1 ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_JUNIPER_ATM2 ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_JUNIPER_ATM_CEMIC ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_JUNIPER_CHDLC ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_JUNIPER_ES ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_JUNIPER_ETHER ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_JUNIPER_FIBRECHANNEL ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_JUNIPER_FRELAY ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_JUNIPER_GGSN ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_JUNIPER_ISM ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_JUNIPER_MFR ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_JUNIPER_MLFR ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_JUNIPER_MLPPP ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_JUNIPER_MONITOR ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_JUNIPER_PIC_PEER ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_JUNIPER_PPP ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_JUNIPER_PPPOE ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_JUNIPER_PPPOE_ATM ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_JUNIPER_SERVICES ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_JUNIPER_SRX_E2E ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_JUNIPER_ST ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_JUNIPER_VP ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_JUNIPER_VS ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_LAPB_WITH_DIR ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_LAPD ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_LIN ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_LINUX_EVDEV ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_LINUX_IRDA ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_LINUX_LAPD ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_LINUX_PPP_WITHDIRECTION ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_LINUX_SLL ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_LOOP ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_LTALK ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_MATCHING_MAX ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_MATCHING_MIN ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_MFR ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_MOST ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_MPLS ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_MTP2 ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_MTP2_WITH_PHDR ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_MTP3 ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_MUX27010 ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_NETANALYZER ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_NETANALYZER_TRANSPARENT ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_NFLOG ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_NULL ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_PCI_EXP ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_PFLOG ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_PFSYNC ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_PPI ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_PPP ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_PPP_BSDOS ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_PPP_ETHER ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_PPP_PPPD ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_PPP_SERIAL ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_PPP_WITH_DIR ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_PPP_WITH_DIRECTION ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_PRISM_HEADER ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_PRONET ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_RAIF1 ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_RAW ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_RIO ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_SCCP ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_SITA ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_SLIP ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_SLIP_BSDOS ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_STANAG_5066_D_PDU ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_SUNATM ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_SYMANTEC_FIREWALL ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_TZSP ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_USB ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_USB_LINUX ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_USB_LINUX_MMAPPED ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_USER0 ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_USER1 ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_USER10 ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_USER11 ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_USER12 ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_USER13 ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_USER14 ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_USER15 ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_USER2 ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_USER3 ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_USER4 ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_USER5 ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_USER6 ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_USER7 ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_USER8 ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_USER9 ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_WIHART ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_X2E_SERIAL ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_X2E_XORAYA ideal-int +pkg syscall (freebsd-amd64-cgo), const DT_BLK ideal-int +pkg syscall (freebsd-amd64-cgo), const DT_CHR ideal-int +pkg syscall (freebsd-amd64-cgo), const DT_DIR ideal-int +pkg syscall (freebsd-amd64-cgo), const DT_FIFO ideal-int +pkg syscall (freebsd-amd64-cgo), const DT_LNK ideal-int +pkg syscall (freebsd-amd64-cgo), const DT_REG ideal-int +pkg syscall (freebsd-amd64-cgo), const DT_SOCK ideal-int +pkg syscall (freebsd-amd64-cgo), const DT_UNKNOWN ideal-int +pkg syscall (freebsd-amd64-cgo), const DT_WHT ideal-int +pkg syscall (freebsd-amd64-cgo), const EAUTH Errno +pkg syscall (freebsd-amd64-cgo), const EBADMSG Errno +pkg syscall (freebsd-amd64-cgo), const EBADRPC Errno +pkg syscall (freebsd-amd64-cgo), const ECAPMODE Errno +pkg syscall (freebsd-amd64-cgo), const ECHO ideal-int +pkg syscall (freebsd-amd64-cgo), const ECHOCTL ideal-int +pkg syscall (freebsd-amd64-cgo), const ECHOE ideal-int +pkg syscall (freebsd-amd64-cgo), const ECHOK ideal-int +pkg syscall (freebsd-amd64-cgo), const ECHOKE ideal-int +pkg syscall (freebsd-amd64-cgo), const ECHONL ideal-int +pkg syscall (freebsd-amd64-cgo), const ECHOPRT ideal-int +pkg syscall (freebsd-amd64-cgo), const EDOOFUS Errno +pkg syscall (freebsd-amd64-cgo), const EFTYPE Errno +pkg syscall (freebsd-amd64-cgo), const ELAST Errno +pkg syscall (freebsd-amd64-cgo), const EMULTIHOP Errno +pkg syscall (freebsd-amd64-cgo), const ENEEDAUTH Errno +pkg syscall (freebsd-amd64-cgo), const ENOATTR Errno +pkg syscall (freebsd-amd64-cgo), const ENOLINK Errno +pkg syscall (freebsd-amd64-cgo), const ENOTCAPABLE Errno +pkg syscall (freebsd-amd64-cgo), const EPROCLIM Errno +pkg syscall (freebsd-amd64-cgo), const EPROCUNAVAIL Errno +pkg syscall (freebsd-amd64-cgo), const EPROGMISMATCH Errno +pkg syscall (freebsd-amd64-cgo), const EPROGUNAVAIL Errno +pkg syscall (freebsd-amd64-cgo), const EPROTO Errno +pkg syscall (freebsd-amd64-cgo), const ERPCMISMATCH Errno +pkg syscall (freebsd-amd64-cgo), const EVFILT_AIO ideal-int +pkg syscall (freebsd-amd64-cgo), const EVFILT_FS ideal-int +pkg syscall (freebsd-amd64-cgo), const EVFILT_LIO ideal-int +pkg syscall (freebsd-amd64-cgo), const EVFILT_PROC ideal-int +pkg syscall (freebsd-amd64-cgo), const EVFILT_READ ideal-int +pkg syscall (freebsd-amd64-cgo), const EVFILT_SIGNAL ideal-int +pkg syscall (freebsd-amd64-cgo), const EVFILT_SYSCOUNT ideal-int +pkg syscall (freebsd-amd64-cgo), const EVFILT_TIMER ideal-int +pkg syscall (freebsd-amd64-cgo), const EVFILT_USER ideal-int +pkg syscall (freebsd-amd64-cgo), const EVFILT_VNODE ideal-int +pkg syscall (freebsd-amd64-cgo), const EVFILT_WRITE ideal-int +pkg syscall (freebsd-amd64-cgo), const EV_ADD ideal-int +pkg syscall (freebsd-amd64-cgo), const EV_CLEAR ideal-int +pkg syscall (freebsd-amd64-cgo), const EV_DELETE ideal-int +pkg syscall (freebsd-amd64-cgo), const EV_DISABLE ideal-int +pkg syscall (freebsd-amd64-cgo), const EV_DISPATCH ideal-int +pkg syscall (freebsd-amd64-cgo), const EV_ENABLE ideal-int +pkg syscall (freebsd-amd64-cgo), const EV_EOF ideal-int +pkg syscall (freebsd-amd64-cgo), const EV_ERROR ideal-int +pkg syscall (freebsd-amd64-cgo), const EV_FLAG1 ideal-int +pkg syscall (freebsd-amd64-cgo), const EV_ONESHOT ideal-int +pkg syscall (freebsd-amd64-cgo), const EV_RECEIPT ideal-int +pkg syscall (freebsd-amd64-cgo), const EV_SYSFLAGS ideal-int +pkg syscall (freebsd-amd64-cgo), const EXTA ideal-int +pkg syscall (freebsd-amd64-cgo), const EXTB ideal-int +pkg syscall (freebsd-amd64-cgo), const EXTPROC ideal-int +pkg syscall (freebsd-amd64-cgo), const FD_CLOEXEC ideal-int +pkg syscall (freebsd-amd64-cgo), const FD_SETSIZE ideal-int +pkg syscall (freebsd-amd64-cgo), const FLUSHO ideal-int +pkg syscall (freebsd-amd64-cgo), const F_CANCEL ideal-int +pkg syscall (freebsd-amd64-cgo), const F_DUP2FD ideal-int +pkg syscall (freebsd-amd64-cgo), const F_DUP2FD_CLOEXEC = 18 +pkg syscall (freebsd-amd64-cgo), const F_DUP2FD_CLOEXEC ideal-int +pkg syscall (freebsd-amd64-cgo), const F_DUPFD ideal-int +pkg syscall (freebsd-amd64-cgo), const F_DUPFD_CLOEXEC = 17 +pkg syscall (freebsd-amd64-cgo), const F_DUPFD_CLOEXEC ideal-int +pkg syscall (freebsd-amd64-cgo), const F_GETFD ideal-int +pkg syscall (freebsd-amd64-cgo), const F_GETFL ideal-int +pkg syscall (freebsd-amd64-cgo), const F_GETLK ideal-int +pkg syscall (freebsd-amd64-cgo), const F_GETOWN ideal-int +pkg syscall (freebsd-amd64-cgo), const F_OGETLK ideal-int +pkg syscall (freebsd-amd64-cgo), const F_OK ideal-int +pkg syscall (freebsd-amd64-cgo), const F_OSETLK ideal-int +pkg syscall (freebsd-amd64-cgo), const F_OSETLKW ideal-int +pkg syscall (freebsd-amd64-cgo), const F_RDAHEAD ideal-int +pkg syscall (freebsd-amd64-cgo), const F_RDLCK ideal-int +pkg syscall (freebsd-amd64-cgo), const F_READAHEAD ideal-int +pkg syscall (freebsd-amd64-cgo), const F_SETFD ideal-int +pkg syscall (freebsd-amd64-cgo), const F_SETFL ideal-int +pkg syscall (freebsd-amd64-cgo), const F_SETLK ideal-int +pkg syscall (freebsd-amd64-cgo), const F_SETLKW ideal-int +pkg syscall (freebsd-amd64-cgo), const F_SETLK_REMOTE ideal-int +pkg syscall (freebsd-amd64-cgo), const F_SETOWN ideal-int +pkg syscall (freebsd-amd64-cgo), const F_UNLCK ideal-int +pkg syscall (freebsd-amd64-cgo), const F_UNLCKSYS ideal-int +pkg syscall (freebsd-amd64-cgo), const F_WRLCK ideal-int +pkg syscall (freebsd-amd64-cgo), const HUPCL ideal-int +pkg syscall (freebsd-amd64-cgo), const ICANON ideal-int +pkg syscall (freebsd-amd64-cgo), const ICMP6_FILTER = 18 +pkg syscall (freebsd-amd64-cgo), const ICMP6_FILTER ideal-int +pkg syscall (freebsd-amd64-cgo), const ICRNL ideal-int +pkg syscall (freebsd-amd64-cgo), const IEXTEN ideal-int +pkg syscall (freebsd-amd64-cgo), const IFAN_ARRIVAL ideal-int +pkg syscall (freebsd-amd64-cgo), const IFAN_DEPARTURE ideal-int +pkg syscall (freebsd-amd64-cgo), const IFF_ALLMULTI ideal-int +pkg syscall (freebsd-amd64-cgo), const IFF_ALTPHYS ideal-int +pkg syscall (freebsd-amd64-cgo), const IFF_CANTCHANGE ideal-int +pkg syscall (freebsd-amd64-cgo), const IFF_CANTCONFIG ideal-int +pkg syscall (freebsd-amd64-cgo), const IFF_DEBUG ideal-int +pkg syscall (freebsd-amd64-cgo), const IFF_DRV_OACTIVE ideal-int +pkg syscall (freebsd-amd64-cgo), const IFF_DRV_RUNNING ideal-int +pkg syscall (freebsd-amd64-cgo), const IFF_DYING ideal-int +pkg syscall (freebsd-amd64-cgo), const IFF_LINK0 ideal-int +pkg syscall (freebsd-amd64-cgo), const IFF_LINK1 ideal-int +pkg syscall (freebsd-amd64-cgo), const IFF_LINK2 ideal-int +pkg syscall (freebsd-amd64-cgo), const IFF_MONITOR ideal-int +pkg syscall (freebsd-amd64-cgo), const IFF_NOARP ideal-int +pkg syscall (freebsd-amd64-cgo), const IFF_OACTIVE ideal-int +pkg syscall (freebsd-amd64-cgo), const IFF_POINTOPOINT ideal-int +pkg syscall (freebsd-amd64-cgo), const IFF_PPROMISC ideal-int +pkg syscall (freebsd-amd64-cgo), const IFF_PROMISC ideal-int +pkg syscall (freebsd-amd64-cgo), const IFF_RENAMING ideal-int +pkg syscall (freebsd-amd64-cgo), const IFF_RUNNING ideal-int +pkg syscall (freebsd-amd64-cgo), const IFF_SIMPLEX ideal-int +pkg syscall (freebsd-amd64-cgo), const IFF_SMART ideal-int +pkg syscall (freebsd-amd64-cgo), const IFF_STATICARP ideal-int +pkg syscall (freebsd-amd64-cgo), const IFNAMSIZ ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_1822 ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_A12MPPSWITCH ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_AAL2 ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_AAL5 ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_ADSL ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_AFLANE8023 ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_AFLANE8025 ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_ARAP ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_ARCNET ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_ARCNETPLUS ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_ASYNC ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_ATM ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_ATMDXI ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_ATMFUNI ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_ATMIMA ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_ATMLOGICAL ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_ATMRADIO ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_ATMSUBINTERFACE ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_ATMVCIENDPT ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_ATMVIRTUAL ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_BGPPOLICYACCOUNTING ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_BRIDGE ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_BSC ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_CARP ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_CCTEMUL ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_CEPT ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_CES ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_CHANNEL ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_CNR ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_COFFEE ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_COMPOSITELINK ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_DCN ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_DIGITALPOWERLINE ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_DIGITALWRAPPEROVERHEADCHANNEL ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_DLSW ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_DOCSCABLEDOWNSTREAM ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_DOCSCABLEMACLAYER ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_DOCSCABLEUPSTREAM ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_DS0 ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_DS0BUNDLE ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_DS1FDL ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_DS3 ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_DTM ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_DVBASILN ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_DVBASIOUT ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_DVBRCCDOWNSTREAM ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_DVBRCCMACLAYER ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_DVBRCCUPSTREAM ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_ENC ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_EON ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_EPLRS ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_ESCON ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_ETHER ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_FAITH ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_FAST ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_FASTETHER ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_FASTETHERFX ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_FDDI ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_FIBRECHANNEL ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_FRAMERELAYINTERCONNECT ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_FRAMERELAYMPI ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_FRDLCIENDPT ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_FRELAY ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_FRELAYDCE ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_FRF16MFRBUNDLE ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_FRFORWARD ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_G703AT2MB ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_G703AT64K ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_GIF ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_GIGABITETHERNET ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_GR303IDT ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_GR303RDT ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_H323GATEKEEPER ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_H323PROXY ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_HDH1822 ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_HDLC ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_HDSL2 ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_HIPERLAN2 ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_HIPPI ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_HIPPIINTERFACE ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_HOSTPAD ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_HSSI ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_HY ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_IBM370PARCHAN ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_IDSL ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_IEEE1394 ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_IEEE80211 ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_IEEE80212 ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_IEEE8023ADLAG ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_IFGSN ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_IMT ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_INFINIBAND ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_INTERLEAVE ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_IP ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_IPFORWARD ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_IPOVERATM ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_IPOVERCDLC ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_IPOVERCLAW ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_IPSWITCH ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_IPXIP ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_ISDN ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_ISDNBASIC ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_ISDNPRIMARY ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_ISDNS ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_ISDNU ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_ISO88022LLC ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_ISO88023 ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_ISO88024 ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_ISO88025 ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_ISO88025CRFPINT ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_ISO88025DTR ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_ISO88025FIBER ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_ISO88026 ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_ISUP ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_L2VLAN ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_L3IPVLAN ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_L3IPXVLAN ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_LAPB ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_LAPD ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_LAPF ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_LOCALTALK ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_LOOP ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_MEDIAMAILOVERIP ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_MFSIGLINK ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_MIOX25 ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_MODEM ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_MPC ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_MPLS ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_MPLSTUNNEL ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_MSDSL ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_MVL ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_MYRINET ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_NFAS ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_NSIP ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_OPTICALCHANNEL ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_OPTICALTRANSPORT ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_OTHER ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_P10 ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_P80 ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_PARA ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_PFLOG ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_PFSYNC ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_PLC ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_POS ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_PPP ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_PPPMULTILINKBUNDLE ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_PROPBWAP2MP ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_PROPCNLS ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_PROPDOCSWIRELESSDOWNSTREAM ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_PROPDOCSWIRELESSMACLAYER ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_PROPDOCSWIRELESSUPSTREAM ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_PROPMUX ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_PROPVIRTUAL ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_PROPWIRELESSP2P ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_PTPSERIAL ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_PVC ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_QLLC ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_RADIOMAC ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_RADSL ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_REACHDSL ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_RFC1483 ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_RS232 ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_RSRB ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_SDLC ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_SDSL ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_SHDSL ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_SIP ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_SLIP ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_SMDSDXI ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_SMDSICIP ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_SONET ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_SONETOVERHEADCHANNEL ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_SONETPATH ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_SONETVT ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_SRP ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_SS7SIGLINK ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_STACKTOSTACK ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_STARLAN ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_STF ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_T1 ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_TDLC ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_TERMPAD ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_TR008 ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_TRANSPHDLC ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_TUNNEL ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_ULTRA ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_USB ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_V11 ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_V35 ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_V36 ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_V37 ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_VDSL ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_VIRTUALIPADDRESS ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_VOICEEM ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_VOICEENCAP ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_VOICEFXO ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_VOICEFXS ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_VOICEOVERATM ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_VOICEOVERFRAMERELAY ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_VOICEOVERIP ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_X213 ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_X25 ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_X25DDN ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_X25HUNTGROUP ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_X25MLP ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_X25PLE ideal-int +pkg syscall (freebsd-amd64-cgo), const IFT_XETHER ideal-int +pkg syscall (freebsd-amd64-cgo), const IGNBRK ideal-int +pkg syscall (freebsd-amd64-cgo), const IGNCR ideal-int +pkg syscall (freebsd-amd64-cgo), const IGNPAR ideal-int +pkg syscall (freebsd-amd64-cgo), const IMAXBEL ideal-int +pkg syscall (freebsd-amd64-cgo), const INLCR ideal-int +pkg syscall (freebsd-amd64-cgo), const INPCK ideal-int +pkg syscall (freebsd-amd64-cgo), const IN_CLASSA_HOST ideal-int +pkg syscall (freebsd-amd64-cgo), const IN_CLASSA_MAX ideal-int +pkg syscall (freebsd-amd64-cgo), const IN_CLASSA_NET ideal-int +pkg syscall (freebsd-amd64-cgo), const IN_CLASSA_NSHIFT ideal-int +pkg syscall (freebsd-amd64-cgo), const IN_CLASSB_HOST ideal-int +pkg syscall (freebsd-amd64-cgo), const IN_CLASSB_MAX ideal-int +pkg syscall (freebsd-amd64-cgo), const IN_CLASSB_NET ideal-int +pkg syscall (freebsd-amd64-cgo), const IN_CLASSB_NSHIFT ideal-int +pkg syscall (freebsd-amd64-cgo), const IN_CLASSC_HOST ideal-int +pkg syscall (freebsd-amd64-cgo), const IN_CLASSC_NET ideal-int +pkg syscall (freebsd-amd64-cgo), const IN_CLASSC_NSHIFT ideal-int +pkg syscall (freebsd-amd64-cgo), const IN_CLASSD_HOST ideal-int +pkg syscall (freebsd-amd64-cgo), const IN_CLASSD_NET ideal-int +pkg syscall (freebsd-amd64-cgo), const IN_CLASSD_NSHIFT ideal-int +pkg syscall (freebsd-amd64-cgo), const IN_LOOPBACKNET ideal-int +pkg syscall (freebsd-amd64-cgo), const IN_RFC3021_MASK ideal-int +pkg syscall (freebsd-amd64-cgo), const IPPROTO_3PC ideal-int +pkg syscall (freebsd-amd64-cgo), const IPPROTO_ADFS ideal-int +pkg syscall (freebsd-amd64-cgo), const IPPROTO_AH ideal-int +pkg syscall (freebsd-amd64-cgo), const IPPROTO_AHIP ideal-int +pkg syscall (freebsd-amd64-cgo), const IPPROTO_APES ideal-int +pkg syscall (freebsd-amd64-cgo), const IPPROTO_ARGUS ideal-int +pkg syscall (freebsd-amd64-cgo), const IPPROTO_AX25 ideal-int +pkg syscall (freebsd-amd64-cgo), const IPPROTO_BHA ideal-int +pkg syscall (freebsd-amd64-cgo), const IPPROTO_BLT ideal-int +pkg syscall (freebsd-amd64-cgo), const IPPROTO_BRSATMON ideal-int +pkg syscall (freebsd-amd64-cgo), const IPPROTO_CARP ideal-int +pkg syscall (freebsd-amd64-cgo), const IPPROTO_CFTP ideal-int +pkg syscall (freebsd-amd64-cgo), const IPPROTO_CHAOS ideal-int +pkg syscall (freebsd-amd64-cgo), const IPPROTO_CMTP ideal-int +pkg syscall (freebsd-amd64-cgo), const IPPROTO_CPHB ideal-int +pkg syscall (freebsd-amd64-cgo), const IPPROTO_CPNX ideal-int +pkg syscall (freebsd-amd64-cgo), const IPPROTO_DDP ideal-int +pkg syscall (freebsd-amd64-cgo), const IPPROTO_DGP ideal-int +pkg syscall (freebsd-amd64-cgo), const IPPROTO_DIVERT ideal-int +pkg syscall (freebsd-amd64-cgo), const IPPROTO_DONE ideal-int +pkg syscall (freebsd-amd64-cgo), const IPPROTO_DSTOPTS ideal-int +pkg syscall (freebsd-amd64-cgo), const IPPROTO_EGP ideal-int +pkg syscall (freebsd-amd64-cgo), const IPPROTO_EMCON ideal-int +pkg syscall (freebsd-amd64-cgo), const IPPROTO_ENCAP ideal-int +pkg syscall (freebsd-amd64-cgo), const IPPROTO_EON ideal-int +pkg syscall (freebsd-amd64-cgo), const IPPROTO_ESP ideal-int +pkg syscall (freebsd-amd64-cgo), const IPPROTO_ETHERIP ideal-int +pkg syscall (freebsd-amd64-cgo), const IPPROTO_FRAGMENT ideal-int +pkg syscall (freebsd-amd64-cgo), const IPPROTO_GGP ideal-int +pkg syscall (freebsd-amd64-cgo), const IPPROTO_GMTP ideal-int +pkg syscall (freebsd-amd64-cgo), const IPPROTO_GRE ideal-int +pkg syscall (freebsd-amd64-cgo), const IPPROTO_HELLO ideal-int +pkg syscall (freebsd-amd64-cgo), const IPPROTO_HMP ideal-int +pkg syscall (freebsd-amd64-cgo), const IPPROTO_HOPOPTS ideal-int +pkg syscall (freebsd-amd64-cgo), const IPPROTO_ICMP ideal-int +pkg syscall (freebsd-amd64-cgo), const IPPROTO_ICMPV6 ideal-int +pkg syscall (freebsd-amd64-cgo), const IPPROTO_IDP ideal-int +pkg syscall (freebsd-amd64-cgo), const IPPROTO_IDPR ideal-int +pkg syscall (freebsd-amd64-cgo), const IPPROTO_IDRP ideal-int +pkg syscall (freebsd-amd64-cgo), const IPPROTO_IGMP ideal-int +pkg syscall (freebsd-amd64-cgo), const IPPROTO_IGP ideal-int +pkg syscall (freebsd-amd64-cgo), const IPPROTO_IGRP ideal-int +pkg syscall (freebsd-amd64-cgo), const IPPROTO_IL ideal-int +pkg syscall (freebsd-amd64-cgo), const IPPROTO_INLSP ideal-int +pkg syscall (freebsd-amd64-cgo), const IPPROTO_INP ideal-int +pkg syscall (freebsd-amd64-cgo), const IPPROTO_IPCOMP ideal-int +pkg syscall (freebsd-amd64-cgo), const IPPROTO_IPCV ideal-int +pkg syscall (freebsd-amd64-cgo), const IPPROTO_IPEIP ideal-int +pkg syscall (freebsd-amd64-cgo), const IPPROTO_IPIP ideal-int +pkg syscall (freebsd-amd64-cgo), const IPPROTO_IPPC ideal-int +pkg syscall (freebsd-amd64-cgo), const IPPROTO_IPV4 ideal-int +pkg syscall (freebsd-amd64-cgo), const IPPROTO_IRTP ideal-int +pkg syscall (freebsd-amd64-cgo), const IPPROTO_KRYPTOLAN ideal-int +pkg syscall (freebsd-amd64-cgo), const IPPROTO_LARP ideal-int +pkg syscall (freebsd-amd64-cgo), const IPPROTO_LEAF1 ideal-int +pkg syscall (freebsd-amd64-cgo), const IPPROTO_LEAF2 ideal-int +pkg syscall (freebsd-amd64-cgo), const IPPROTO_MAX ideal-int +pkg syscall (freebsd-amd64-cgo), const IPPROTO_MAXID ideal-int +pkg syscall (freebsd-amd64-cgo), const IPPROTO_MEAS ideal-int +pkg syscall (freebsd-amd64-cgo), const IPPROTO_MH ideal-int +pkg syscall (freebsd-amd64-cgo), const IPPROTO_MHRP ideal-int +pkg syscall (freebsd-amd64-cgo), const IPPROTO_MICP ideal-int +pkg syscall (freebsd-amd64-cgo), const IPPROTO_MOBILE ideal-int +pkg syscall (freebsd-amd64-cgo), const IPPROTO_MTP ideal-int +pkg syscall (freebsd-amd64-cgo), const IPPROTO_MUX ideal-int +pkg syscall (freebsd-amd64-cgo), const IPPROTO_ND ideal-int +pkg syscall (freebsd-amd64-cgo), const IPPROTO_NHRP ideal-int +pkg syscall (freebsd-amd64-cgo), const IPPROTO_NONE ideal-int +pkg syscall (freebsd-amd64-cgo), const IPPROTO_NSP ideal-int +pkg syscall (freebsd-amd64-cgo), const IPPROTO_NVPII ideal-int +pkg syscall (freebsd-amd64-cgo), const IPPROTO_OLD_DIVERT ideal-int +pkg syscall (freebsd-amd64-cgo), const IPPROTO_OSPFIGP ideal-int +pkg syscall (freebsd-amd64-cgo), const IPPROTO_PFSYNC ideal-int +pkg syscall (freebsd-amd64-cgo), const IPPROTO_PGM ideal-int +pkg syscall (freebsd-amd64-cgo), const IPPROTO_PIGP ideal-int +pkg syscall (freebsd-amd64-cgo), const IPPROTO_PIM ideal-int +pkg syscall (freebsd-amd64-cgo), const IPPROTO_PRM ideal-int +pkg syscall (freebsd-amd64-cgo), const IPPROTO_PUP ideal-int +pkg syscall (freebsd-amd64-cgo), const IPPROTO_PVP ideal-int +pkg syscall (freebsd-amd64-cgo), const IPPROTO_RAW ideal-int +pkg syscall (freebsd-amd64-cgo), const IPPROTO_RCCMON ideal-int +pkg syscall (freebsd-amd64-cgo), const IPPROTO_RDP ideal-int +pkg syscall (freebsd-amd64-cgo), const IPPROTO_ROUTING ideal-int +pkg syscall (freebsd-amd64-cgo), const IPPROTO_RSVP ideal-int +pkg syscall (freebsd-amd64-cgo), const IPPROTO_RVD ideal-int +pkg syscall (freebsd-amd64-cgo), const IPPROTO_SATEXPAK ideal-int +pkg syscall (freebsd-amd64-cgo), const IPPROTO_SATMON ideal-int +pkg syscall (freebsd-amd64-cgo), const IPPROTO_SCCSP ideal-int +pkg syscall (freebsd-amd64-cgo), const IPPROTO_SCTP ideal-int +pkg syscall (freebsd-amd64-cgo), const IPPROTO_SDRP ideal-int +pkg syscall (freebsd-amd64-cgo), const IPPROTO_SEND ideal-int +pkg syscall (freebsd-amd64-cgo), const IPPROTO_SEP ideal-int +pkg syscall (freebsd-amd64-cgo), const IPPROTO_SKIP ideal-int +pkg syscall (freebsd-amd64-cgo), const IPPROTO_SPACER ideal-int +pkg syscall (freebsd-amd64-cgo), const IPPROTO_SRPC ideal-int +pkg syscall (freebsd-amd64-cgo), const IPPROTO_ST ideal-int +pkg syscall (freebsd-amd64-cgo), const IPPROTO_SVMTP ideal-int +pkg syscall (freebsd-amd64-cgo), const IPPROTO_SWIPE ideal-int +pkg syscall (freebsd-amd64-cgo), const IPPROTO_TCF ideal-int +pkg syscall (freebsd-amd64-cgo), const IPPROTO_TLSP ideal-int +pkg syscall (freebsd-amd64-cgo), const IPPROTO_TP ideal-int +pkg syscall (freebsd-amd64-cgo), const IPPROTO_TPXX ideal-int +pkg syscall (freebsd-amd64-cgo), const IPPROTO_TRUNK1 ideal-int +pkg syscall (freebsd-amd64-cgo), const IPPROTO_TRUNK2 ideal-int +pkg syscall (freebsd-amd64-cgo), const IPPROTO_TTP ideal-int +pkg syscall (freebsd-amd64-cgo), const IPPROTO_VINES ideal-int +pkg syscall (freebsd-amd64-cgo), const IPPROTO_VISA ideal-int +pkg syscall (freebsd-amd64-cgo), const IPPROTO_VMTP ideal-int +pkg syscall (freebsd-amd64-cgo), const IPPROTO_WBEXPAK ideal-int +pkg syscall (freebsd-amd64-cgo), const IPPROTO_WBMON ideal-int +pkg syscall (freebsd-amd64-cgo), const IPPROTO_WSN ideal-int +pkg syscall (freebsd-amd64-cgo), const IPPROTO_XNET ideal-int +pkg syscall (freebsd-amd64-cgo), const IPPROTO_XTP ideal-int +pkg syscall (freebsd-amd64-cgo), const IPV6_AUTOFLOWLABEL ideal-int +pkg syscall (freebsd-amd64-cgo), const IPV6_BINDANY ideal-int +pkg syscall (freebsd-amd64-cgo), const IPV6_BINDV6ONLY ideal-int +pkg syscall (freebsd-amd64-cgo), const IPV6_CHECKSUM ideal-int +pkg syscall (freebsd-amd64-cgo), const IPV6_DEFAULT_MULTICAST_HOPS ideal-int +pkg syscall (freebsd-amd64-cgo), const IPV6_DEFAULT_MULTICAST_LOOP ideal-int +pkg syscall (freebsd-amd64-cgo), const IPV6_DEFHLIM ideal-int +pkg syscall (freebsd-amd64-cgo), const IPV6_DONTFRAG ideal-int +pkg syscall (freebsd-amd64-cgo), const IPV6_DSTOPTS ideal-int +pkg syscall (freebsd-amd64-cgo), const IPV6_FAITH ideal-int +pkg syscall (freebsd-amd64-cgo), const IPV6_FLOWINFO_MASK ideal-int +pkg syscall (freebsd-amd64-cgo), const IPV6_FLOWLABEL_MASK ideal-int +pkg syscall (freebsd-amd64-cgo), const IPV6_FRAGTTL ideal-int +pkg syscall (freebsd-amd64-cgo), const IPV6_FW_ADD ideal-int +pkg syscall (freebsd-amd64-cgo), const IPV6_FW_DEL ideal-int +pkg syscall (freebsd-amd64-cgo), const IPV6_FW_FLUSH ideal-int +pkg syscall (freebsd-amd64-cgo), const IPV6_FW_GET ideal-int +pkg syscall (freebsd-amd64-cgo), const IPV6_FW_ZERO ideal-int +pkg syscall (freebsd-amd64-cgo), const IPV6_HLIMDEC ideal-int +pkg syscall (freebsd-amd64-cgo), const IPV6_HOPLIMIT ideal-int +pkg syscall (freebsd-amd64-cgo), const IPV6_HOPOPTS ideal-int +pkg syscall (freebsd-amd64-cgo), const IPV6_IPSEC_POLICY ideal-int +pkg syscall (freebsd-amd64-cgo), const IPV6_MAXHLIM ideal-int +pkg syscall (freebsd-amd64-cgo), const IPV6_MAXOPTHDR ideal-int +pkg syscall (freebsd-amd64-cgo), const IPV6_MAXPACKET ideal-int +pkg syscall (freebsd-amd64-cgo), const IPV6_MAX_GROUP_SRC_FILTER ideal-int +pkg syscall (freebsd-amd64-cgo), const IPV6_MAX_MEMBERSHIPS ideal-int +pkg syscall (freebsd-amd64-cgo), const IPV6_MAX_SOCK_SRC_FILTER ideal-int +pkg syscall (freebsd-amd64-cgo), const IPV6_MIN_MEMBERSHIPS ideal-int +pkg syscall (freebsd-amd64-cgo), const IPV6_MMTU ideal-int +pkg syscall (freebsd-amd64-cgo), const IPV6_MSFILTER ideal-int +pkg syscall (freebsd-amd64-cgo), const IPV6_NEXTHOP ideal-int +pkg syscall (freebsd-amd64-cgo), const IPV6_PATHMTU ideal-int +pkg syscall (freebsd-amd64-cgo), const IPV6_PKTINFO ideal-int +pkg syscall (freebsd-amd64-cgo), const IPV6_PORTRANGE ideal-int +pkg syscall (freebsd-amd64-cgo), const IPV6_PORTRANGE_DEFAULT ideal-int +pkg syscall (freebsd-amd64-cgo), const IPV6_PORTRANGE_HIGH ideal-int +pkg syscall (freebsd-amd64-cgo), const IPV6_PORTRANGE_LOW ideal-int +pkg syscall (freebsd-amd64-cgo), const IPV6_PREFER_TEMPADDR ideal-int +pkg syscall (freebsd-amd64-cgo), const IPV6_RECVDSTOPTS ideal-int +pkg syscall (freebsd-amd64-cgo), const IPV6_RECVHOPLIMIT ideal-int +pkg syscall (freebsd-amd64-cgo), const IPV6_RECVHOPOPTS ideal-int +pkg syscall (freebsd-amd64-cgo), const IPV6_RECVPATHMTU ideal-int +pkg syscall (freebsd-amd64-cgo), const IPV6_RECVPKTINFO ideal-int +pkg syscall (freebsd-amd64-cgo), const IPV6_RECVRTHDR ideal-int +pkg syscall (freebsd-amd64-cgo), const IPV6_RECVTCLASS ideal-int +pkg syscall (freebsd-amd64-cgo), const IPV6_RTHDR ideal-int +pkg syscall (freebsd-amd64-cgo), const IPV6_RTHDRDSTOPTS ideal-int +pkg syscall (freebsd-amd64-cgo), const IPV6_RTHDR_LOOSE ideal-int +pkg syscall (freebsd-amd64-cgo), const IPV6_RTHDR_STRICT ideal-int +pkg syscall (freebsd-amd64-cgo), const IPV6_RTHDR_TYPE_0 ideal-int +pkg syscall (freebsd-amd64-cgo), const IPV6_SOCKOPT_RESERVED1 ideal-int +pkg syscall (freebsd-amd64-cgo), const IPV6_TCLASS ideal-int +pkg syscall (freebsd-amd64-cgo), const IPV6_USE_MIN_MTU ideal-int +pkg syscall (freebsd-amd64-cgo), const IPV6_VERSION ideal-int +pkg syscall (freebsd-amd64-cgo), const IPV6_VERSION_MASK ideal-int +pkg syscall (freebsd-amd64-cgo), const IP_ADD_SOURCE_MEMBERSHIP ideal-int +pkg syscall (freebsd-amd64-cgo), const IP_BINDANY ideal-int +pkg syscall (freebsd-amd64-cgo), const IP_BLOCK_SOURCE ideal-int +pkg syscall (freebsd-amd64-cgo), const IP_DEFAULT_MULTICAST_LOOP ideal-int +pkg syscall (freebsd-amd64-cgo), const IP_DEFAULT_MULTICAST_TTL ideal-int +pkg syscall (freebsd-amd64-cgo), const IP_DF ideal-int +pkg syscall (freebsd-amd64-cgo), const IP_DONTFRAG ideal-int +pkg syscall (freebsd-amd64-cgo), const IP_DROP_SOURCE_MEMBERSHIP ideal-int +pkg syscall (freebsd-amd64-cgo), const IP_DUMMYNET3 ideal-int +pkg syscall (freebsd-amd64-cgo), const IP_DUMMYNET_CONFIGURE ideal-int +pkg syscall (freebsd-amd64-cgo), const IP_DUMMYNET_DEL ideal-int +pkg syscall (freebsd-amd64-cgo), const IP_DUMMYNET_FLUSH ideal-int +pkg syscall (freebsd-amd64-cgo), const IP_DUMMYNET_GET ideal-int +pkg syscall (freebsd-amd64-cgo), const IP_FAITH ideal-int +pkg syscall (freebsd-amd64-cgo), const IP_FW3 ideal-int +pkg syscall (freebsd-amd64-cgo), const IP_FW_ADD ideal-int +pkg syscall (freebsd-amd64-cgo), const IP_FW_DEL ideal-int +pkg syscall (freebsd-amd64-cgo), const IP_FW_FLUSH ideal-int +pkg syscall (freebsd-amd64-cgo), const IP_FW_GET ideal-int +pkg syscall (freebsd-amd64-cgo), const IP_FW_NAT_CFG ideal-int +pkg syscall (freebsd-amd64-cgo), const IP_FW_NAT_DEL ideal-int +pkg syscall (freebsd-amd64-cgo), const IP_FW_NAT_GET_CONFIG ideal-int +pkg syscall (freebsd-amd64-cgo), const IP_FW_NAT_GET_LOG ideal-int +pkg syscall (freebsd-amd64-cgo), const IP_FW_RESETLOG ideal-int +pkg syscall (freebsd-amd64-cgo), const IP_FW_TABLE_ADD ideal-int +pkg syscall (freebsd-amd64-cgo), const IP_FW_TABLE_DEL ideal-int +pkg syscall (freebsd-amd64-cgo), const IP_FW_TABLE_FLUSH ideal-int +pkg syscall (freebsd-amd64-cgo), const IP_FW_TABLE_GETSIZE ideal-int +pkg syscall (freebsd-amd64-cgo), const IP_FW_TABLE_LIST ideal-int +pkg syscall (freebsd-amd64-cgo), const IP_FW_ZERO ideal-int +pkg syscall (freebsd-amd64-cgo), const IP_HDRINCL ideal-int +pkg syscall (freebsd-amd64-cgo), const IP_IPSEC_POLICY ideal-int +pkg syscall (freebsd-amd64-cgo), const IP_MAXPACKET ideal-int +pkg syscall (freebsd-amd64-cgo), const IP_MAX_GROUP_SRC_FILTER ideal-int +pkg syscall (freebsd-amd64-cgo), const IP_MAX_MEMBERSHIPS ideal-int +pkg syscall (freebsd-amd64-cgo), const IP_MAX_SOCK_MUTE_FILTER ideal-int +pkg syscall (freebsd-amd64-cgo), const IP_MAX_SOCK_SRC_FILTER ideal-int +pkg syscall (freebsd-amd64-cgo), const IP_MAX_SOURCE_FILTER ideal-int +pkg syscall (freebsd-amd64-cgo), const IP_MF ideal-int +pkg syscall (freebsd-amd64-cgo), const IP_MINTTL ideal-int +pkg syscall (freebsd-amd64-cgo), const IP_MIN_MEMBERSHIPS ideal-int +pkg syscall (freebsd-amd64-cgo), const IP_MSFILTER ideal-int +pkg syscall (freebsd-amd64-cgo), const IP_MSS ideal-int +pkg syscall (freebsd-amd64-cgo), const IP_MULTICAST_VIF ideal-int +pkg syscall (freebsd-amd64-cgo), const IP_OFFMASK ideal-int +pkg syscall (freebsd-amd64-cgo), const IP_ONESBCAST ideal-int +pkg syscall (freebsd-amd64-cgo), const IP_OPTIONS ideal-int +pkg syscall (freebsd-amd64-cgo), const IP_PORTRANGE ideal-int +pkg syscall (freebsd-amd64-cgo), const IP_PORTRANGE_DEFAULT ideal-int +pkg syscall (freebsd-amd64-cgo), const IP_PORTRANGE_HIGH ideal-int +pkg syscall (freebsd-amd64-cgo), const IP_PORTRANGE_LOW ideal-int +pkg syscall (freebsd-amd64-cgo), const IP_RECVDSTADDR ideal-int +pkg syscall (freebsd-amd64-cgo), const IP_RECVIF ideal-int +pkg syscall (freebsd-amd64-cgo), const IP_RECVOPTS ideal-int +pkg syscall (freebsd-amd64-cgo), const IP_RECVRETOPTS ideal-int +pkg syscall (freebsd-amd64-cgo), const IP_RECVTOS ideal-int +pkg syscall (freebsd-amd64-cgo), const IP_RECVTTL ideal-int +pkg syscall (freebsd-amd64-cgo), const IP_RETOPTS ideal-int +pkg syscall (freebsd-amd64-cgo), const IP_RF ideal-int +pkg syscall (freebsd-amd64-cgo), const IP_RSVP_OFF ideal-int +pkg syscall (freebsd-amd64-cgo), const IP_RSVP_ON ideal-int +pkg syscall (freebsd-amd64-cgo), const IP_RSVP_VIF_OFF ideal-int +pkg syscall (freebsd-amd64-cgo), const IP_RSVP_VIF_ON ideal-int +pkg syscall (freebsd-amd64-cgo), const IP_SENDSRCADDR ideal-int +pkg syscall (freebsd-amd64-cgo), const IP_UNBLOCK_SOURCE ideal-int +pkg syscall (freebsd-amd64-cgo), const ISIG ideal-int +pkg syscall (freebsd-amd64-cgo), const ISTRIP ideal-int +pkg syscall (freebsd-amd64-cgo), const IXANY ideal-int +pkg syscall (freebsd-amd64-cgo), const IXOFF ideal-int +pkg syscall (freebsd-amd64-cgo), const IXON ideal-int +pkg syscall (freebsd-amd64-cgo), const LOCK_EX ideal-int +pkg syscall (freebsd-amd64-cgo), const LOCK_NB ideal-int +pkg syscall (freebsd-amd64-cgo), const LOCK_SH ideal-int +pkg syscall (freebsd-amd64-cgo), const LOCK_UN ideal-int +pkg syscall (freebsd-amd64-cgo), const MADV_AUTOSYNC ideal-int +pkg syscall (freebsd-amd64-cgo), const MADV_CORE ideal-int +pkg syscall (freebsd-amd64-cgo), const MADV_DONTNEED ideal-int +pkg syscall (freebsd-amd64-cgo), const MADV_FREE ideal-int +pkg syscall (freebsd-amd64-cgo), const MADV_NOCORE ideal-int +pkg syscall (freebsd-amd64-cgo), const MADV_NORMAL ideal-int +pkg syscall (freebsd-amd64-cgo), const MADV_NOSYNC ideal-int +pkg syscall (freebsd-amd64-cgo), const MADV_PROTECT ideal-int +pkg syscall (freebsd-amd64-cgo), const MADV_RANDOM ideal-int +pkg syscall (freebsd-amd64-cgo), const MADV_SEQUENTIAL ideal-int +pkg syscall (freebsd-amd64-cgo), const MADV_WILLNEED ideal-int +pkg syscall (freebsd-amd64-cgo), const MAP_ANON ideal-int +pkg syscall (freebsd-amd64-cgo), const MAP_ANONYMOUS ideal-int +pkg syscall (freebsd-amd64-cgo), const MAP_COPY ideal-int +pkg syscall (freebsd-amd64-cgo), const MAP_FILE ideal-int +pkg syscall (freebsd-amd64-cgo), const MAP_FIXED ideal-int +pkg syscall (freebsd-amd64-cgo), const MAP_HASSEMAPHORE ideal-int +pkg syscall (freebsd-amd64-cgo), const MAP_NOCORE ideal-int +pkg syscall (freebsd-amd64-cgo), const MAP_NORESERVE ideal-int +pkg syscall (freebsd-amd64-cgo), const MAP_NOSYNC ideal-int +pkg syscall (freebsd-amd64-cgo), const MAP_PREFAULT_READ ideal-int +pkg syscall (freebsd-amd64-cgo), const MAP_PRIVATE ideal-int +pkg syscall (freebsd-amd64-cgo), const MAP_RENAME ideal-int +pkg syscall (freebsd-amd64-cgo), const MAP_RESERVED0080 ideal-int +pkg syscall (freebsd-amd64-cgo), const MAP_RESERVED0100 ideal-int +pkg syscall (freebsd-amd64-cgo), const MAP_SHARED ideal-int +pkg syscall (freebsd-amd64-cgo), const MAP_STACK ideal-int +pkg syscall (freebsd-amd64-cgo), const MCL_CURRENT ideal-int +pkg syscall (freebsd-amd64-cgo), const MCL_FUTURE ideal-int +pkg syscall (freebsd-amd64-cgo), const MSG_COMPAT ideal-int +pkg syscall (freebsd-amd64-cgo), const MSG_CTRUNC ideal-int +pkg syscall (freebsd-amd64-cgo), const MSG_DONTROUTE ideal-int +pkg syscall (freebsd-amd64-cgo), const MSG_DONTWAIT ideal-int +pkg syscall (freebsd-amd64-cgo), const MSG_EOF ideal-int +pkg syscall (freebsd-amd64-cgo), const MSG_EOR ideal-int +pkg syscall (freebsd-amd64-cgo), const MSG_NBIO ideal-int +pkg syscall (freebsd-amd64-cgo), const MSG_NOSIGNAL ideal-int +pkg syscall (freebsd-amd64-cgo), const MSG_NOTIFICATION ideal-int +pkg syscall (freebsd-amd64-cgo), const MSG_OOB ideal-int +pkg syscall (freebsd-amd64-cgo), const MSG_PEEK ideal-int +pkg syscall (freebsd-amd64-cgo), const MSG_TRUNC ideal-int +pkg syscall (freebsd-amd64-cgo), const MSG_WAITALL ideal-int +pkg syscall (freebsd-amd64-cgo), const MS_ASYNC ideal-int +pkg syscall (freebsd-amd64-cgo), const MS_INVALIDATE ideal-int +pkg syscall (freebsd-amd64-cgo), const MS_SYNC ideal-int +pkg syscall (freebsd-amd64-cgo), const NET_RT_DUMP ideal-int +pkg syscall (freebsd-amd64-cgo), const NET_RT_FLAGS ideal-int +pkg syscall (freebsd-amd64-cgo), const NET_RT_IFLIST ideal-int +pkg syscall (freebsd-amd64-cgo), const NET_RT_IFLISTL ideal-int +pkg syscall (freebsd-amd64-cgo), const NET_RT_IFMALIST ideal-int +pkg syscall (freebsd-amd64-cgo), const NET_RT_MAXID ideal-int +pkg syscall (freebsd-amd64-cgo), const NOFLSH ideal-int +pkg syscall (freebsd-amd64-cgo), const NOTE_ATTRIB ideal-int +pkg syscall (freebsd-amd64-cgo), const NOTE_CHILD ideal-int +pkg syscall (freebsd-amd64-cgo), const NOTE_DELETE ideal-int +pkg syscall (freebsd-amd64-cgo), const NOTE_EXEC ideal-int +pkg syscall (freebsd-amd64-cgo), const NOTE_EXIT ideal-int +pkg syscall (freebsd-amd64-cgo), const NOTE_EXTEND ideal-int +pkg syscall (freebsd-amd64-cgo), const NOTE_FFAND ideal-int +pkg syscall (freebsd-amd64-cgo), const NOTE_FFCOPY ideal-int +pkg syscall (freebsd-amd64-cgo), const NOTE_FFCTRLMASK ideal-int +pkg syscall (freebsd-amd64-cgo), const NOTE_FFLAGSMASK ideal-int +pkg syscall (freebsd-amd64-cgo), const NOTE_FFNOP ideal-int +pkg syscall (freebsd-amd64-cgo), const NOTE_FFOR ideal-int +pkg syscall (freebsd-amd64-cgo), const NOTE_FORK ideal-int +pkg syscall (freebsd-amd64-cgo), const NOTE_LINK ideal-int +pkg syscall (freebsd-amd64-cgo), const NOTE_LOWAT ideal-int +pkg syscall (freebsd-amd64-cgo), const NOTE_PCTRLMASK ideal-int +pkg syscall (freebsd-amd64-cgo), const NOTE_PDATAMASK ideal-int +pkg syscall (freebsd-amd64-cgo), const NOTE_RENAME ideal-int +pkg syscall (freebsd-amd64-cgo), const NOTE_REVOKE ideal-int +pkg syscall (freebsd-amd64-cgo), const NOTE_TRACK ideal-int +pkg syscall (freebsd-amd64-cgo), const NOTE_TRACKERR ideal-int +pkg syscall (freebsd-amd64-cgo), const NOTE_TRIGGER ideal-int +pkg syscall (freebsd-amd64-cgo), const NOTE_WRITE ideal-int +pkg syscall (freebsd-amd64-cgo), const OCRNL ideal-int +pkg syscall (freebsd-amd64-cgo), const ONLCR ideal-int +pkg syscall (freebsd-amd64-cgo), const ONLRET ideal-int +pkg syscall (freebsd-amd64-cgo), const ONOCR ideal-int +pkg syscall (freebsd-amd64-cgo), const ONOEOT ideal-int +pkg syscall (freebsd-amd64-cgo), const OPOST ideal-int +pkg syscall (freebsd-amd64-cgo), const O_ACCMODE ideal-int +pkg syscall (freebsd-amd64-cgo), const O_DIRECT ideal-int +pkg syscall (freebsd-amd64-cgo), const O_DIRECTORY ideal-int +pkg syscall (freebsd-amd64-cgo), const O_EXEC ideal-int +pkg syscall (freebsd-amd64-cgo), const O_EXLOCK ideal-int +pkg syscall (freebsd-amd64-cgo), const O_FSYNC ideal-int +pkg syscall (freebsd-amd64-cgo), const O_NDELAY ideal-int +pkg syscall (freebsd-amd64-cgo), const O_NOFOLLOW ideal-int +pkg syscall (freebsd-amd64-cgo), const O_SHLOCK ideal-int +pkg syscall (freebsd-amd64-cgo), const O_TTY_INIT ideal-int +pkg syscall (freebsd-amd64-cgo), const PARENB ideal-int +pkg syscall (freebsd-amd64-cgo), const PARMRK ideal-int +pkg syscall (freebsd-amd64-cgo), const PARODD ideal-int +pkg syscall (freebsd-amd64-cgo), const PENDIN ideal-int +pkg syscall (freebsd-amd64-cgo), const PRIO_PGRP = 1 +pkg syscall (freebsd-amd64-cgo), const PRIO_PGRP ideal-int +pkg syscall (freebsd-amd64-cgo), const PRIO_PROCESS = 0 +pkg syscall (freebsd-amd64-cgo), const PRIO_PROCESS ideal-int +pkg syscall (freebsd-amd64-cgo), const PRIO_USER = 2 +pkg syscall (freebsd-amd64-cgo), const PRIO_USER ideal-int +pkg syscall (freebsd-amd64-cgo), const PROT_EXEC ideal-int +pkg syscall (freebsd-amd64-cgo), const PROT_NONE ideal-int +pkg syscall (freebsd-amd64-cgo), const PROT_READ ideal-int +pkg syscall (freebsd-amd64-cgo), const PROT_WRITE ideal-int +pkg syscall (freebsd-amd64-cgo), const PTRACE_CONT ideal-int +pkg syscall (freebsd-amd64-cgo), const PTRACE_KILL ideal-int +pkg syscall (freebsd-amd64-cgo), const PTRACE_TRACEME ideal-int +pkg syscall (freebsd-amd64-cgo), const RLIMIT_AS ideal-int +pkg syscall (freebsd-amd64-cgo), const RLIMIT_CORE ideal-int +pkg syscall (freebsd-amd64-cgo), const RLIMIT_CPU ideal-int +pkg syscall (freebsd-amd64-cgo), const RLIMIT_DATA ideal-int +pkg syscall (freebsd-amd64-cgo), const RLIMIT_FSIZE ideal-int +pkg syscall (freebsd-amd64-cgo), const RLIMIT_NOFILE ideal-int +pkg syscall (freebsd-amd64-cgo), const RLIMIT_STACK ideal-int +pkg syscall (freebsd-amd64-cgo), const RLIM_INFINITY ideal-int +pkg syscall (freebsd-amd64-cgo), const RTAX_AUTHOR ideal-int +pkg syscall (freebsd-amd64-cgo), const RTAX_BRD ideal-int +pkg syscall (freebsd-amd64-cgo), const RTAX_DST ideal-int +pkg syscall (freebsd-amd64-cgo), const RTAX_GATEWAY ideal-int +pkg syscall (freebsd-amd64-cgo), const RTAX_GENMASK ideal-int +pkg syscall (freebsd-amd64-cgo), const RTAX_IFA ideal-int +pkg syscall (freebsd-amd64-cgo), const RTAX_IFP ideal-int +pkg syscall (freebsd-amd64-cgo), const RTAX_MAX ideal-int +pkg syscall (freebsd-amd64-cgo), const RTAX_NETMASK ideal-int +pkg syscall (freebsd-amd64-cgo), const RTA_AUTHOR ideal-int +pkg syscall (freebsd-amd64-cgo), const RTA_BRD ideal-int +pkg syscall (freebsd-amd64-cgo), const RTA_DST ideal-int +pkg syscall (freebsd-amd64-cgo), const RTA_GATEWAY ideal-int +pkg syscall (freebsd-amd64-cgo), const RTA_GENMASK ideal-int +pkg syscall (freebsd-amd64-cgo), const RTA_IFA ideal-int +pkg syscall (freebsd-amd64-cgo), const RTA_IFP ideal-int +pkg syscall (freebsd-amd64-cgo), const RTA_NETMASK ideal-int +pkg syscall (freebsd-amd64-cgo), const RTF_BLACKHOLE ideal-int +pkg syscall (freebsd-amd64-cgo), const RTF_BROADCAST ideal-int +pkg syscall (freebsd-amd64-cgo), const RTF_DONE ideal-int +pkg syscall (freebsd-amd64-cgo), const RTF_DYNAMIC ideal-int +pkg syscall (freebsd-amd64-cgo), const RTF_FMASK ideal-int +pkg syscall (freebsd-amd64-cgo), const RTF_GATEWAY ideal-int +pkg syscall (freebsd-amd64-cgo), const RTF_HOST ideal-int +pkg syscall (freebsd-amd64-cgo), const RTF_LLDATA ideal-int +pkg syscall (freebsd-amd64-cgo), const RTF_LLINFO ideal-int +pkg syscall (freebsd-amd64-cgo), const RTF_LOCAL ideal-int +pkg syscall (freebsd-amd64-cgo), const RTF_MODIFIED ideal-int +pkg syscall (freebsd-amd64-cgo), const RTF_MULTICAST ideal-int +pkg syscall (freebsd-amd64-cgo), const RTF_PINNED ideal-int +pkg syscall (freebsd-amd64-cgo), const RTF_PRCLONING ideal-int +pkg syscall (freebsd-amd64-cgo), const RTF_PROTO1 ideal-int +pkg syscall (freebsd-amd64-cgo), const RTF_PROTO2 ideal-int +pkg syscall (freebsd-amd64-cgo), const RTF_PROTO3 ideal-int +pkg syscall (freebsd-amd64-cgo), const RTF_REJECT ideal-int +pkg syscall (freebsd-amd64-cgo), const RTF_RNH_LOCKED ideal-int +pkg syscall (freebsd-amd64-cgo), const RTF_STATIC ideal-int +pkg syscall (freebsd-amd64-cgo), const RTF_STICKY ideal-int +pkg syscall (freebsd-amd64-cgo), const RTF_UP ideal-int +pkg syscall (freebsd-amd64-cgo), const RTF_XRESOLVE ideal-int +pkg syscall (freebsd-amd64-cgo), const RTM_ADD ideal-int +pkg syscall (freebsd-amd64-cgo), const RTM_CHANGE ideal-int +pkg syscall (freebsd-amd64-cgo), const RTM_DELADDR ideal-int +pkg syscall (freebsd-amd64-cgo), const RTM_DELETE ideal-int +pkg syscall (freebsd-amd64-cgo), const RTM_DELMADDR ideal-int +pkg syscall (freebsd-amd64-cgo), const RTM_GET ideal-int +pkg syscall (freebsd-amd64-cgo), const RTM_IEEE80211 ideal-int +pkg syscall (freebsd-amd64-cgo), const RTM_IFANNOUNCE ideal-int +pkg syscall (freebsd-amd64-cgo), const RTM_IFINFO ideal-int +pkg syscall (freebsd-amd64-cgo), const RTM_LOCK ideal-int +pkg syscall (freebsd-amd64-cgo), const RTM_LOSING ideal-int +pkg syscall (freebsd-amd64-cgo), const RTM_MISS ideal-int +pkg syscall (freebsd-amd64-cgo), const RTM_NEWADDR ideal-int +pkg syscall (freebsd-amd64-cgo), const RTM_NEWMADDR ideal-int +pkg syscall (freebsd-amd64-cgo), const RTM_OLDADD ideal-int +pkg syscall (freebsd-amd64-cgo), const RTM_OLDDEL ideal-int +pkg syscall (freebsd-amd64-cgo), const RTM_REDIRECT ideal-int +pkg syscall (freebsd-amd64-cgo), const RTM_RESOLVE ideal-int +pkg syscall (freebsd-amd64-cgo), const RTM_RTTUNIT ideal-int +pkg syscall (freebsd-amd64-cgo), const RTM_VERSION ideal-int +pkg syscall (freebsd-amd64-cgo), const RTV_EXPIRE ideal-int +pkg syscall (freebsd-amd64-cgo), const RTV_HOPCOUNT ideal-int +pkg syscall (freebsd-amd64-cgo), const RTV_MTU ideal-int +pkg syscall (freebsd-amd64-cgo), const RTV_RPIPE ideal-int +pkg syscall (freebsd-amd64-cgo), const RTV_RTT ideal-int +pkg syscall (freebsd-amd64-cgo), const RTV_RTTVAR ideal-int +pkg syscall (freebsd-amd64-cgo), const RTV_SPIPE ideal-int +pkg syscall (freebsd-amd64-cgo), const RTV_SSTHRESH ideal-int +pkg syscall (freebsd-amd64-cgo), const RTV_WEIGHT ideal-int +pkg syscall (freebsd-amd64-cgo), const RT_CACHING_CONTEXT ideal-int +pkg syscall (freebsd-amd64-cgo), const RT_DEFAULT_FIB ideal-int +pkg syscall (freebsd-amd64-cgo), const RUSAGE_CHILDREN ideal-int +pkg syscall (freebsd-amd64-cgo), const RUSAGE_SELF ideal-int +pkg syscall (freebsd-amd64-cgo), const RUSAGE_THREAD ideal-int +pkg syscall (freebsd-amd64-cgo), const SCM_BINTIME ideal-int +pkg syscall (freebsd-amd64-cgo), const SCM_CREDS ideal-int +pkg syscall (freebsd-amd64-cgo), const SCM_RIGHTS ideal-int +pkg syscall (freebsd-amd64-cgo), const SCM_TIMESTAMP ideal-int +pkg syscall (freebsd-amd64-cgo), const SIGCHLD Signal +pkg syscall (freebsd-amd64-cgo), const SIGCONT Signal +pkg syscall (freebsd-amd64-cgo), const SIGEMT Signal +pkg syscall (freebsd-amd64-cgo), const SIGINFO Signal +pkg syscall (freebsd-amd64-cgo), const SIGIO Signal +pkg syscall (freebsd-amd64-cgo), const SIGIOT Signal +pkg syscall (freebsd-amd64-cgo), const SIGLWP Signal +pkg syscall (freebsd-amd64-cgo), const SIGPROF Signal +pkg syscall (freebsd-amd64-cgo), const SIGSTOP Signal +pkg syscall (freebsd-amd64-cgo), const SIGSYS Signal +pkg syscall (freebsd-amd64-cgo), const SIGTHR Signal +pkg syscall (freebsd-amd64-cgo), const SIGTSTP Signal +pkg syscall (freebsd-amd64-cgo), const SIGTTIN Signal +pkg syscall (freebsd-amd64-cgo), const SIGTTOU Signal +pkg syscall (freebsd-amd64-cgo), const SIGURG Signal +pkg syscall (freebsd-amd64-cgo), const SIGUSR1 Signal +pkg syscall (freebsd-amd64-cgo), const SIGUSR2 Signal +pkg syscall (freebsd-amd64-cgo), const SIGVTALRM Signal +pkg syscall (freebsd-amd64-cgo), const SIGWINCH Signal +pkg syscall (freebsd-amd64-cgo), const SIGXCPU Signal +pkg syscall (freebsd-amd64-cgo), const SIGXFSZ Signal +pkg syscall (freebsd-amd64-cgo), const SIOCADDMULTI ideal-int +pkg syscall (freebsd-amd64-cgo), const SIOCADDRT ideal-int +pkg syscall (freebsd-amd64-cgo), const SIOCAIFADDR ideal-int +pkg syscall (freebsd-amd64-cgo), const SIOCAIFGROUP ideal-int +pkg syscall (freebsd-amd64-cgo), const SIOCALIFADDR ideal-int +pkg syscall (freebsd-amd64-cgo), const SIOCATMARK ideal-int +pkg syscall (freebsd-amd64-cgo), const SIOCDELMULTI ideal-int +pkg syscall (freebsd-amd64-cgo), const SIOCDELRT ideal-int +pkg syscall (freebsd-amd64-cgo), const SIOCDIFADDR ideal-int +pkg syscall (freebsd-amd64-cgo), const SIOCDIFGROUP ideal-int +pkg syscall (freebsd-amd64-cgo), const SIOCDIFPHYADDR ideal-int +pkg syscall (freebsd-amd64-cgo), const SIOCDLIFADDR ideal-int +pkg syscall (freebsd-amd64-cgo), const SIOCGDRVSPEC ideal-int +pkg syscall (freebsd-amd64-cgo), const SIOCGETSGCNT ideal-int +pkg syscall (freebsd-amd64-cgo), const SIOCGETVIFCNT ideal-int +pkg syscall (freebsd-amd64-cgo), const SIOCGHIWAT ideal-int +pkg syscall (freebsd-amd64-cgo), const SIOCGIFADDR ideal-int +pkg syscall (freebsd-amd64-cgo), const SIOCGIFBRDADDR ideal-int +pkg syscall (freebsd-amd64-cgo), const SIOCGIFCAP ideal-int +pkg syscall (freebsd-amd64-cgo), const SIOCGIFCONF ideal-int +pkg syscall (freebsd-amd64-cgo), const SIOCGIFDESCR ideal-int +pkg syscall (freebsd-amd64-cgo), const SIOCGIFDSTADDR ideal-int +pkg syscall (freebsd-amd64-cgo), const SIOCGIFFIB ideal-int +pkg syscall (freebsd-amd64-cgo), const SIOCGIFFLAGS ideal-int +pkg syscall (freebsd-amd64-cgo), const SIOCGIFGENERIC ideal-int +pkg syscall (freebsd-amd64-cgo), const SIOCGIFGMEMB ideal-int +pkg syscall (freebsd-amd64-cgo), const SIOCGIFGROUP ideal-int +pkg syscall (freebsd-amd64-cgo), const SIOCGIFINDEX ideal-int +pkg syscall (freebsd-amd64-cgo), const SIOCGIFMAC ideal-int +pkg syscall (freebsd-amd64-cgo), const SIOCGIFMEDIA ideal-int +pkg syscall (freebsd-amd64-cgo), const SIOCGIFMETRIC ideal-int +pkg syscall (freebsd-amd64-cgo), const SIOCGIFMTU ideal-int +pkg syscall (freebsd-amd64-cgo), const SIOCGIFNETMASK ideal-int +pkg syscall (freebsd-amd64-cgo), const SIOCGIFPDSTADDR ideal-int +pkg syscall (freebsd-amd64-cgo), const SIOCGIFPHYS ideal-int +pkg syscall (freebsd-amd64-cgo), const SIOCGIFPSRCADDR ideal-int +pkg syscall (freebsd-amd64-cgo), const SIOCGIFSTATUS ideal-int +pkg syscall (freebsd-amd64-cgo), const SIOCGLIFADDR ideal-int +pkg syscall (freebsd-amd64-cgo), const SIOCGLIFPHYADDR ideal-int +pkg syscall (freebsd-amd64-cgo), const SIOCGLOWAT ideal-int +pkg syscall (freebsd-amd64-cgo), const SIOCGPGRP ideal-int +pkg syscall (freebsd-amd64-cgo), const SIOCGPRIVATE_0 ideal-int +pkg syscall (freebsd-amd64-cgo), const SIOCGPRIVATE_1 ideal-int +pkg syscall (freebsd-amd64-cgo), const SIOCIFCREATE ideal-int +pkg syscall (freebsd-amd64-cgo), const SIOCIFCREATE2 ideal-int +pkg syscall (freebsd-amd64-cgo), const SIOCIFDESTROY ideal-int +pkg syscall (freebsd-amd64-cgo), const SIOCIFGCLONERS ideal-int +pkg syscall (freebsd-amd64-cgo), const SIOCSDRVSPEC ideal-int +pkg syscall (freebsd-amd64-cgo), const SIOCSHIWAT ideal-int +pkg syscall (freebsd-amd64-cgo), const SIOCSIFADDR ideal-int +pkg syscall (freebsd-amd64-cgo), const SIOCSIFBRDADDR ideal-int +pkg syscall (freebsd-amd64-cgo), const SIOCSIFCAP ideal-int +pkg syscall (freebsd-amd64-cgo), const SIOCSIFDESCR ideal-int +pkg syscall (freebsd-amd64-cgo), const SIOCSIFDSTADDR ideal-int +pkg syscall (freebsd-amd64-cgo), const SIOCSIFFIB ideal-int +pkg syscall (freebsd-amd64-cgo), const SIOCSIFFLAGS ideal-int +pkg syscall (freebsd-amd64-cgo), const SIOCSIFGENERIC ideal-int +pkg syscall (freebsd-amd64-cgo), const SIOCSIFLLADDR ideal-int +pkg syscall (freebsd-amd64-cgo), const SIOCSIFMAC ideal-int +pkg syscall (freebsd-amd64-cgo), const SIOCSIFMEDIA ideal-int +pkg syscall (freebsd-amd64-cgo), const SIOCSIFMETRIC ideal-int +pkg syscall (freebsd-amd64-cgo), const SIOCSIFMTU ideal-int +pkg syscall (freebsd-amd64-cgo), const SIOCSIFNAME ideal-int +pkg syscall (freebsd-amd64-cgo), const SIOCSIFNETMASK ideal-int +pkg syscall (freebsd-amd64-cgo), const SIOCSIFPHYADDR ideal-int +pkg syscall (freebsd-amd64-cgo), const SIOCSIFPHYS ideal-int +pkg syscall (freebsd-amd64-cgo), const SIOCSIFRVNET ideal-int +pkg syscall (freebsd-amd64-cgo), const SIOCSIFVNET ideal-int +pkg syscall (freebsd-amd64-cgo), const SIOCSLIFPHYADDR ideal-int +pkg syscall (freebsd-amd64-cgo), const SIOCSLOWAT ideal-int +pkg syscall (freebsd-amd64-cgo), const SIOCSPGRP ideal-int +pkg syscall (freebsd-amd64-cgo), const SOCK_MAXADDRLEN ideal-int +pkg syscall (freebsd-amd64-cgo), const SOCK_RDM ideal-int +pkg syscall (freebsd-amd64-cgo), const SO_ACCEPTCONN ideal-int +pkg syscall (freebsd-amd64-cgo), const SO_ACCEPTFILTER ideal-int +pkg syscall (freebsd-amd64-cgo), const SO_BINTIME ideal-int +pkg syscall (freebsd-amd64-cgo), const SO_DEBUG ideal-int +pkg syscall (freebsd-amd64-cgo), const SO_ERROR ideal-int +pkg syscall (freebsd-amd64-cgo), const SO_LABEL ideal-int +pkg syscall (freebsd-amd64-cgo), const SO_LISTENINCQLEN ideal-int +pkg syscall (freebsd-amd64-cgo), const SO_LISTENQLEN ideal-int +pkg syscall (freebsd-amd64-cgo), const SO_LISTENQLIMIT ideal-int +pkg syscall (freebsd-amd64-cgo), const SO_NOSIGPIPE ideal-int +pkg syscall (freebsd-amd64-cgo), const SO_NO_DDP ideal-int +pkg syscall (freebsd-amd64-cgo), const SO_NO_OFFLOAD ideal-int +pkg syscall (freebsd-amd64-cgo), const SO_OOBINLINE ideal-int +pkg syscall (freebsd-amd64-cgo), const SO_PEERLABEL ideal-int +pkg syscall (freebsd-amd64-cgo), const SO_PROTOCOL ideal-int +pkg syscall (freebsd-amd64-cgo), const SO_PROTOTYPE ideal-int +pkg syscall (freebsd-amd64-cgo), const SO_RCVLOWAT ideal-int +pkg syscall (freebsd-amd64-cgo), const SO_RCVTIMEO ideal-int +pkg syscall (freebsd-amd64-cgo), const SO_REUSEPORT ideal-int +pkg syscall (freebsd-amd64-cgo), const SO_SETFIB ideal-int +pkg syscall (freebsd-amd64-cgo), const SO_SNDLOWAT ideal-int +pkg syscall (freebsd-amd64-cgo), const SO_SNDTIMEO ideal-int +pkg syscall (freebsd-amd64-cgo), const SO_TIMESTAMP ideal-int +pkg syscall (freebsd-amd64-cgo), const SO_TYPE ideal-int +pkg syscall (freebsd-amd64-cgo), const SO_USELOOPBACK ideal-int +pkg syscall (freebsd-amd64-cgo), const SO_USER_COOKIE ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_ABORT2 ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_ACCEPT ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_ACCESS ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_ACCT ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_ADJTIME ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_AUDIT ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_AUDITCTL ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_AUDITON ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_BIND ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_CAP_ENTER ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_CAP_GETMODE ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_CAP_GETRIGHTS ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_CAP_NEW ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_CHDIR ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_CHFLAGS ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_CHMOD ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_CHOWN ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_CHROOT ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_CLOCK_GETCPUCLOCKID2 ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_CLOCK_GETRES ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_CLOCK_GETTIME ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_CLOCK_SETTIME ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_CLOSE ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_CLOSEFROM ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_CONNECT ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_CPUSET ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_CPUSET_GETAFFINITY ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_CPUSET_GETID ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_CPUSET_SETAFFINITY ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_CPUSET_SETID ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_DUP ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_DUP2 ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_EACCESS ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_EXECVE ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_EXIT ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_EXTATTRCTL ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_EXTATTR_DELETE_FD ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_EXTATTR_DELETE_FILE ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_EXTATTR_DELETE_LINK ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_EXTATTR_GET_FD ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_EXTATTR_GET_FILE ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_EXTATTR_GET_LINK ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_EXTATTR_LIST_FD ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_EXTATTR_LIST_FILE ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_EXTATTR_LIST_LINK ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_EXTATTR_SET_FD ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_EXTATTR_SET_FILE ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_EXTATTR_SET_LINK ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_FACCESSAT ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_FCHDIR ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_FCHFLAGS ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_FCHMOD ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_FCHMODAT ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_FCHOWN ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_FCHOWNAT ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_FCNTL ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_FEXECVE ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_FFCLOCK_GETCOUNTER ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_FFCLOCK_GETESTIMATE ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_FFCLOCK_SETESTIMATE ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_FHOPEN ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_FHSTAT ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_FHSTATFS ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_FLOCK ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_FORK ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_FPATHCONF ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_FREEBSD6_FTRUNCATE ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_FREEBSD6_LSEEK ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_FREEBSD6_MMAP ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_FREEBSD6_PREAD ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_FREEBSD6_PWRITE ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_FREEBSD6_TRUNCATE ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_FSTAT ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_FSTATAT ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_FSTATFS ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_FSYNC ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_FTRUNCATE ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_FUTIMES ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_FUTIMESAT ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_GETAUDIT ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_GETAUDIT_ADDR ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_GETAUID ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_GETCONTEXT ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_GETDENTS ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_GETDIRENTRIES ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_GETDTABLESIZE ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_GETEGID ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_GETEUID ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_GETFH ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_GETFSSTAT ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_GETGID ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_GETGROUPS ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_GETITIMER ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_GETLOGIN ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_GETLOGINCLASS ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_GETPEERNAME ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_GETPGID ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_GETPGRP ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_GETPID ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_GETPPID ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_GETPRIORITY ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_GETRESGID ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_GETRESUID ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_GETRLIMIT ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_GETRUSAGE ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_GETSID ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_GETSOCKNAME ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_GETSOCKOPT ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_GETTIMEOFDAY ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_GETUID ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_IOCTL ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_ISSETUGID ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_JAIL ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_JAIL_ATTACH ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_JAIL_GET ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_JAIL_REMOVE ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_JAIL_SET ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_KENV ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_KEVENT ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_KILL ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_KLDFIND ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_KLDFIRSTMOD ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_KLDLOAD ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_KLDNEXT ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_KLDSTAT ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_KLDSYM ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_KLDUNLOAD ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_KLDUNLOADF ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_KQUEUE ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_KTIMER_CREATE ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_KTIMER_DELETE ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_KTIMER_GETOVERRUN ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_KTIMER_GETTIME ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_KTIMER_SETTIME ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_KTRACE ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_LCHFLAGS ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_LCHMOD ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_LCHOWN ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_LGETFH ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_LINK ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_LINKAT ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_LISTEN ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_LPATHCONF ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_LSEEK ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_LSTAT ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_LUTIMES ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_MAC_SYSCALL ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_MADVISE ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_MINCORE ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_MINHERIT ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_MKDIR ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_MKDIRAT ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_MKFIFO ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_MKFIFOAT ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_MKNOD ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_MKNODAT ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_MLOCK ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_MLOCKALL ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_MMAP ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_MODFIND ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_MODFNEXT ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_MODNEXT ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_MODSTAT ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_MOUNT ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_MPROTECT ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_MSYNC ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_MUNLOCK ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_MUNLOCKALL ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_MUNMAP ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_NANOSLEEP ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_NFSTAT ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_NLSTAT ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_NMOUNT ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_NSTAT ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_NTP_ADJTIME ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_NTP_GETTIME ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_OBREAK ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_OPEN ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_OPENAT ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_OPENBSD_POLL ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_OVADVISE ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_PATHCONF ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_PDFORK ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_PDGETPID ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_PDKILL ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_PIPE ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_POLL ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_POSIX_FADVISE ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_POSIX_FALLOCATE ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_POSIX_OPENPT ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_PREAD ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_PREADV ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_PROFIL ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_PSELECT ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_PTRACE ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_PWRITE ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_PWRITEV ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_QUOTACTL ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_RCTL_ADD_RULE ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_RCTL_GET_LIMITS ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_RCTL_GET_RACCT ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_RCTL_GET_RULES ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_RCTL_REMOVE_RULE ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_READ ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_READLINK ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_READLINKAT ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_READV ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_REBOOT ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_RECVFROM ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_RECVMSG ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_RENAME ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_RENAMEAT ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_REVOKE ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_RFORK ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_RMDIR ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_RTPRIO ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_RTPRIO_THREAD ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_SBRK ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_SCHED_GETPARAM ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_SCHED_GETSCHEDULER ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_SCHED_GET_PRIORITY_MAX ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_SCHED_GET_PRIORITY_MIN ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_SCHED_RR_GET_INTERVAL ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_SCHED_SETPARAM ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_SCHED_SETSCHEDULER ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_SCHED_YIELD ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_SCTP_GENERIC_RECVMSG ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_SCTP_GENERIC_SENDMSG ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_SCTP_GENERIC_SENDMSG_IOV ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_SCTP_PEELOFF ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_SELECT ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_SENDFILE ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_SENDMSG ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_SENDTO ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_SETAUDIT ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_SETAUDIT_ADDR ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_SETAUID ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_SETCONTEXT ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_SETEGID ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_SETEUID ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_SETFIB ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_SETGID ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_SETGROUPS ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_SETITIMER ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_SETLOGIN ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_SETLOGINCLASS ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_SETPGID ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_SETPRIORITY ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_SETREGID ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_SETRESGID ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_SETRESUID ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_SETREUID ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_SETRLIMIT ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_SETSID ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_SETSOCKOPT ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_SETTIMEOFDAY ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_SETUID ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_SHM_OPEN ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_SHM_UNLINK ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_SHUTDOWN ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_SIGACTION ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_SIGALTSTACK ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_SIGPENDING ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_SIGPROCMASK ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_SIGQUEUE ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_SIGRETURN ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_SIGSUSPEND ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_SIGTIMEDWAIT ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_SIGWAIT ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_SIGWAITINFO ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_SOCKET ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_SOCKETPAIR ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_SSTK ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_STAT ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_STATFS ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_SWAPCONTEXT ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_SWAPOFF ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_SWAPON ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_SYMLINK ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_SYMLINKAT ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_SYNC ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_SYSARCH ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_THR_CREATE ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_THR_EXIT ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_THR_KILL ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_THR_KILL2 ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_THR_NEW ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_THR_SELF ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_THR_SET_NAME ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_THR_SUSPEND ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_THR_WAKE ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_TRUNCATE ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_UMASK ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_UNDELETE ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_UNLINK ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_UNLINKAT ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_UNMOUNT ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_UTIMES ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_UTRACE ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_UUIDGEN ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_VFORK ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_WAIT4 ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_WAIT6 ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_WRITE ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_WRITEV ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_YIELD ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS__UMTX_LOCK ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS__UMTX_OP ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS__UMTX_UNLOCK ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS___ACL_ACLCHECK_FD ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS___ACL_ACLCHECK_FILE ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS___ACL_ACLCHECK_LINK ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS___ACL_DELETE_FD ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS___ACL_DELETE_FILE ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS___ACL_DELETE_LINK ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS___ACL_GET_FD ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS___ACL_GET_FILE ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS___ACL_GET_LINK ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS___ACL_SET_FD ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS___ACL_SET_FILE ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS___ACL_SET_LINK ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS___GETCWD ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS___MAC_EXECVE ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS___MAC_GET_FD ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS___MAC_GET_FILE ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS___MAC_GET_LINK ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS___MAC_GET_PID ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS___MAC_GET_PROC ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS___MAC_SET_FD ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS___MAC_SET_FILE ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS___MAC_SET_LINK ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS___MAC_SET_PROC ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS___SETUGID ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS___SYSCTL ideal-int +pkg syscall (freebsd-amd64-cgo), const SizeofBpfHdr ideal-int +pkg syscall (freebsd-amd64-cgo), const SizeofBpfInsn ideal-int +pkg syscall (freebsd-amd64-cgo), const SizeofBpfProgram ideal-int +pkg syscall (freebsd-amd64-cgo), const SizeofBpfStat ideal-int +pkg syscall (freebsd-amd64-cgo), const SizeofBpfVersion ideal-int +pkg syscall (freebsd-amd64-cgo), const SizeofBpfZbuf ideal-int +pkg syscall (freebsd-amd64-cgo), const SizeofBpfZbufHeader ideal-int +pkg syscall (freebsd-amd64-cgo), const SizeofCmsghdr ideal-int +pkg syscall (freebsd-amd64-cgo), const SizeofICMPv6Filter = 32 +pkg syscall (freebsd-amd64-cgo), const SizeofICMPv6Filter ideal-int +pkg syscall (freebsd-amd64-cgo), const SizeofIPMreq ideal-int +pkg syscall (freebsd-amd64-cgo), const SizeofIPMreqn ideal-int +pkg syscall (freebsd-amd64-cgo), const SizeofIPv6MTUInfo = 32 +pkg syscall (freebsd-amd64-cgo), const SizeofIPv6MTUInfo ideal-int +pkg syscall (freebsd-amd64-cgo), const SizeofIPv6Mreq ideal-int +pkg syscall (freebsd-amd64-cgo), const SizeofIfAnnounceMsghdr ideal-int +pkg syscall (freebsd-amd64-cgo), const SizeofIfData ideal-int +pkg syscall (freebsd-amd64-cgo), const SizeofIfMsghdr ideal-int +pkg syscall (freebsd-amd64-cgo), const SizeofIfaMsghdr ideal-int +pkg syscall (freebsd-amd64-cgo), const SizeofIfmaMsghdr ideal-int +pkg syscall (freebsd-amd64-cgo), const SizeofInet6Pktinfo ideal-int +pkg syscall (freebsd-amd64-cgo), const SizeofLinger ideal-int +pkg syscall (freebsd-amd64-cgo), const SizeofMsghdr ideal-int +pkg syscall (freebsd-amd64-cgo), const SizeofRtMetrics ideal-int +pkg syscall (freebsd-amd64-cgo), const SizeofRtMsghdr ideal-int +pkg syscall (freebsd-amd64-cgo), const SizeofSockaddrAny ideal-int +pkg syscall (freebsd-amd64-cgo), const SizeofSockaddrDatalink ideal-int +pkg syscall (freebsd-amd64-cgo), const SizeofSockaddrInet4 ideal-int +pkg syscall (freebsd-amd64-cgo), const SizeofSockaddrInet6 ideal-int +pkg syscall (freebsd-amd64-cgo), const SizeofSockaddrUnix ideal-int +pkg syscall (freebsd-amd64-cgo), const TCIFLUSH ideal-int +pkg syscall (freebsd-amd64-cgo), const TCIOFLUSH ideal-int +pkg syscall (freebsd-amd64-cgo), const TCOFLUSH ideal-int +pkg syscall (freebsd-amd64-cgo), const TCP_CA_NAME_MAX ideal-int +pkg syscall (freebsd-amd64-cgo), const TCP_CONGESTION ideal-int +pkg syscall (freebsd-amd64-cgo), const TCP_INFO ideal-int +pkg syscall (freebsd-amd64-cgo), const TCP_KEEPCNT ideal-int +pkg syscall (freebsd-amd64-cgo), const TCP_KEEPIDLE ideal-int +pkg syscall (freebsd-amd64-cgo), const TCP_KEEPINIT ideal-int +pkg syscall (freebsd-amd64-cgo), const TCP_KEEPINTVL ideal-int +pkg syscall (freebsd-amd64-cgo), const TCP_MAXBURST ideal-int +pkg syscall (freebsd-amd64-cgo), const TCP_MAXHLEN ideal-int +pkg syscall (freebsd-amd64-cgo), const TCP_MAXOLEN ideal-int +pkg syscall (freebsd-amd64-cgo), const TCP_MAXSEG ideal-int +pkg syscall (freebsd-amd64-cgo), const TCP_MAXWIN ideal-int +pkg syscall (freebsd-amd64-cgo), const TCP_MAX_SACK ideal-int +pkg syscall (freebsd-amd64-cgo), const TCP_MAX_WINSHIFT ideal-int +pkg syscall (freebsd-amd64-cgo), const TCP_MD5SIG ideal-int +pkg syscall (freebsd-amd64-cgo), const TCP_MINMSS ideal-int +pkg syscall (freebsd-amd64-cgo), const TCP_MSS ideal-int +pkg syscall (freebsd-amd64-cgo), const TCP_NOOPT ideal-int +pkg syscall (freebsd-amd64-cgo), const TCP_NOPUSH ideal-int +pkg syscall (freebsd-amd64-cgo), const TCSAFLUSH ideal-int +pkg syscall (freebsd-amd64-cgo), const TIOCCBRK ideal-int +pkg syscall (freebsd-amd64-cgo), const TIOCCDTR ideal-int +pkg syscall (freebsd-amd64-cgo), const TIOCCONS ideal-int +pkg syscall (freebsd-amd64-cgo), const TIOCDRAIN ideal-int +pkg syscall (freebsd-amd64-cgo), const TIOCEXCL ideal-int +pkg syscall (freebsd-amd64-cgo), const TIOCEXT ideal-int +pkg syscall (freebsd-amd64-cgo), const TIOCFLUSH ideal-int +pkg syscall (freebsd-amd64-cgo), const TIOCGDRAINWAIT ideal-int +pkg syscall (freebsd-amd64-cgo), const TIOCGETA ideal-int +pkg syscall (freebsd-amd64-cgo), const TIOCGETD ideal-int +pkg syscall (freebsd-amd64-cgo), const TIOCGPGRP ideal-int +pkg syscall (freebsd-amd64-cgo), const TIOCGPTN ideal-int +pkg syscall (freebsd-amd64-cgo), const TIOCGSID ideal-int +pkg syscall (freebsd-amd64-cgo), const TIOCGWINSZ ideal-int +pkg syscall (freebsd-amd64-cgo), const TIOCMBIC ideal-int +pkg syscall (freebsd-amd64-cgo), const TIOCMBIS ideal-int +pkg syscall (freebsd-amd64-cgo), const TIOCMGDTRWAIT ideal-int +pkg syscall (freebsd-amd64-cgo), const TIOCMGET ideal-int +pkg syscall (freebsd-amd64-cgo), const TIOCMSDTRWAIT ideal-int +pkg syscall (freebsd-amd64-cgo), const TIOCMSET ideal-int +pkg syscall (freebsd-amd64-cgo), const TIOCM_CAR ideal-int +pkg syscall (freebsd-amd64-cgo), const TIOCM_CD ideal-int +pkg syscall (freebsd-amd64-cgo), const TIOCM_CTS ideal-int +pkg syscall (freebsd-amd64-cgo), const TIOCM_DCD ideal-int +pkg syscall (freebsd-amd64-cgo), const TIOCM_DSR ideal-int +pkg syscall (freebsd-amd64-cgo), const TIOCM_DTR ideal-int +pkg syscall (freebsd-amd64-cgo), const TIOCM_LE ideal-int +pkg syscall (freebsd-amd64-cgo), const TIOCM_RI ideal-int +pkg syscall (freebsd-amd64-cgo), const TIOCM_RNG ideal-int +pkg syscall (freebsd-amd64-cgo), const TIOCM_RTS ideal-int +pkg syscall (freebsd-amd64-cgo), const TIOCM_SR ideal-int +pkg syscall (freebsd-amd64-cgo), const TIOCM_ST ideal-int +pkg syscall (freebsd-amd64-cgo), const TIOCNOTTY ideal-int +pkg syscall (freebsd-amd64-cgo), const TIOCNXCL ideal-int +pkg syscall (freebsd-amd64-cgo), const TIOCOUTQ ideal-int +pkg syscall (freebsd-amd64-cgo), const TIOCPKT ideal-int +pkg syscall (freebsd-amd64-cgo), const TIOCPKT_DATA ideal-int +pkg syscall (freebsd-amd64-cgo), const TIOCPKT_DOSTOP ideal-int +pkg syscall (freebsd-amd64-cgo), const TIOCPKT_FLUSHREAD ideal-int +pkg syscall (freebsd-amd64-cgo), const TIOCPKT_FLUSHWRITE ideal-int +pkg syscall (freebsd-amd64-cgo), const TIOCPKT_IOCTL ideal-int +pkg syscall (freebsd-amd64-cgo), const TIOCPKT_NOSTOP ideal-int +pkg syscall (freebsd-amd64-cgo), const TIOCPKT_START ideal-int +pkg syscall (freebsd-amd64-cgo), const TIOCPKT_STOP ideal-int +pkg syscall (freebsd-amd64-cgo), const TIOCPTMASTER ideal-int +pkg syscall (freebsd-amd64-cgo), const TIOCSBRK ideal-int +pkg syscall (freebsd-amd64-cgo), const TIOCSCTTY ideal-int +pkg syscall (freebsd-amd64-cgo), const TIOCSDRAINWAIT ideal-int +pkg syscall (freebsd-amd64-cgo), const TIOCSDTR ideal-int +pkg syscall (freebsd-amd64-cgo), const TIOCSETA ideal-int +pkg syscall (freebsd-amd64-cgo), const TIOCSETAF ideal-int +pkg syscall (freebsd-amd64-cgo), const TIOCSETAW ideal-int +pkg syscall (freebsd-amd64-cgo), const TIOCSETD ideal-int +pkg syscall (freebsd-amd64-cgo), const TIOCSIG ideal-int +pkg syscall (freebsd-amd64-cgo), const TIOCSPGRP ideal-int +pkg syscall (freebsd-amd64-cgo), const TIOCSTART ideal-int +pkg syscall (freebsd-amd64-cgo), const TIOCSTAT ideal-int +pkg syscall (freebsd-amd64-cgo), const TIOCSTI ideal-int +pkg syscall (freebsd-amd64-cgo), const TIOCSTOP ideal-int +pkg syscall (freebsd-amd64-cgo), const TIOCSWINSZ ideal-int +pkg syscall (freebsd-amd64-cgo), const TIOCTIMESTAMP ideal-int +pkg syscall (freebsd-amd64-cgo), const TIOCUCNTL ideal-int +pkg syscall (freebsd-amd64-cgo), const TOSTOP ideal-int +pkg syscall (freebsd-amd64-cgo), const VDISCARD ideal-int +pkg syscall (freebsd-amd64-cgo), const VDSUSP ideal-int +pkg syscall (freebsd-amd64-cgo), const VEOF ideal-int +pkg syscall (freebsd-amd64-cgo), const VEOL ideal-int +pkg syscall (freebsd-amd64-cgo), const VEOL2 ideal-int +pkg syscall (freebsd-amd64-cgo), const VERASE ideal-int +pkg syscall (freebsd-amd64-cgo), const VERASE2 ideal-int +pkg syscall (freebsd-amd64-cgo), const VINTR ideal-int +pkg syscall (freebsd-amd64-cgo), const VKILL ideal-int +pkg syscall (freebsd-amd64-cgo), const VLNEXT ideal-int +pkg syscall (freebsd-amd64-cgo), const VMIN ideal-int +pkg syscall (freebsd-amd64-cgo), const VQUIT ideal-int +pkg syscall (freebsd-amd64-cgo), const VREPRINT ideal-int +pkg syscall (freebsd-amd64-cgo), const VSTART ideal-int +pkg syscall (freebsd-amd64-cgo), const VSTATUS ideal-int +pkg syscall (freebsd-amd64-cgo), const VSTOP ideal-int +pkg syscall (freebsd-amd64-cgo), const VSUSP ideal-int +pkg syscall (freebsd-amd64-cgo), const VTIME ideal-int +pkg syscall (freebsd-amd64-cgo), const VWERASE ideal-int +pkg syscall (freebsd-amd64-cgo), const WCONTINUED ideal-int +pkg syscall (freebsd-amd64-cgo), const WCOREFLAG ideal-int +pkg syscall (freebsd-amd64-cgo), const WLINUXCLONE ideal-int +pkg syscall (freebsd-amd64-cgo), const WNOHANG ideal-int +pkg syscall (freebsd-amd64-cgo), const WNOWAIT ideal-int +pkg syscall (freebsd-amd64-cgo), const WSTOPPED ideal-int +pkg syscall (freebsd-amd64-cgo), const WUNTRACED ideal-int +pkg syscall (freebsd-amd64-cgo), func Accept(int) (int, Sockaddr, error) +pkg syscall (freebsd-amd64-cgo), func Access(string, uint32) error +pkg syscall (freebsd-amd64-cgo), func Adjtime(*Timeval, *Timeval) error +pkg syscall (freebsd-amd64-cgo), func Bind(int, Sockaddr) error +pkg syscall (freebsd-amd64-cgo), func BpfBuflen(int) (int, error) +pkg syscall (freebsd-amd64-cgo), func BpfDatalink(int) (int, error) +pkg syscall (freebsd-amd64-cgo), func BpfHeadercmpl(int) (int, error) +pkg syscall (freebsd-amd64-cgo), func BpfInterface(int, string) (string, error) +pkg syscall (freebsd-amd64-cgo), func BpfJump(int, int, int, int) *BpfInsn +pkg syscall (freebsd-amd64-cgo), func BpfStats(int) (*BpfStat, error) +pkg syscall (freebsd-amd64-cgo), func BpfStmt(int, int) *BpfInsn +pkg syscall (freebsd-amd64-cgo), func BpfTimeout(int) (*Timeval, error) +pkg syscall (freebsd-amd64-cgo), func CheckBpfVersion(int) error +pkg syscall (freebsd-amd64-cgo), func Chflags(string, int) error +pkg syscall (freebsd-amd64-cgo), func Chroot(string) error +pkg syscall (freebsd-amd64-cgo), func Close(int) error +pkg syscall (freebsd-amd64-cgo), func CloseOnExec(int) +pkg syscall (freebsd-amd64-cgo), func CmsgLen(int) int +pkg syscall (freebsd-amd64-cgo), func CmsgSpace(int) int +pkg syscall (freebsd-amd64-cgo), func Connect(int, Sockaddr) error +pkg syscall (freebsd-amd64-cgo), func Dup(int) (int, error) +pkg syscall (freebsd-amd64-cgo), func Dup2(int, int) error +pkg syscall (freebsd-amd64-cgo), func Fchdir(int) error +pkg syscall (freebsd-amd64-cgo), func Fchflags(int, int) error +pkg syscall (freebsd-amd64-cgo), func Fchmod(int, uint32) error +pkg syscall (freebsd-amd64-cgo), func Fchown(int, int, int) error +pkg syscall (freebsd-amd64-cgo), func Flock(int, int) error +pkg syscall (freebsd-amd64-cgo), func FlushBpf(int) error +pkg syscall (freebsd-amd64-cgo), func ForkExec(string, []string, *ProcAttr) (int, error) +pkg syscall (freebsd-amd64-cgo), func Fpathconf(int, int) (int, error) +pkg syscall (freebsd-amd64-cgo), func Fstat(int, *Stat_t) error +pkg syscall (freebsd-amd64-cgo), func Fstatfs(int, *Statfs_t) error +pkg syscall (freebsd-amd64-cgo), func Fsync(int) error +pkg syscall (freebsd-amd64-cgo), func Ftruncate(int, int64) error +pkg syscall (freebsd-amd64-cgo), func Futimes(int, []Timeval) error +pkg syscall (freebsd-amd64-cgo), func Getdirentries(int, []uint8, *uintptr) (int, error) +pkg syscall (freebsd-amd64-cgo), func Getdtablesize() int +pkg syscall (freebsd-amd64-cgo), func Getfsstat([]Statfs_t, int) (int, error) +pkg syscall (freebsd-amd64-cgo), func Getpeername(int) (Sockaddr, error) +pkg syscall (freebsd-amd64-cgo), func Getpgid(int) (int, error) +pkg syscall (freebsd-amd64-cgo), func Getpgrp() int +pkg syscall (freebsd-amd64-cgo), func Getpriority(int, int) (int, error) +pkg syscall (freebsd-amd64-cgo), func Getrlimit(int, *Rlimit) error +pkg syscall (freebsd-amd64-cgo), func Getrusage(int, *Rusage) error +pkg syscall (freebsd-amd64-cgo), func Getsid(int) (int, error) +pkg syscall (freebsd-amd64-cgo), func Getsockname(int) (Sockaddr, error) +pkg syscall (freebsd-amd64-cgo), func GetsockoptByte(int, int, int) (uint8, error) +pkg syscall (freebsd-amd64-cgo), func GetsockoptICMPv6Filter(int, int, int) (*ICMPv6Filter, error) +pkg syscall (freebsd-amd64-cgo), func GetsockoptIPMreq(int, int, int) (*IPMreq, error) +pkg syscall (freebsd-amd64-cgo), func GetsockoptIPMreqn(int, int, int) (*IPMreqn, error) +pkg syscall (freebsd-amd64-cgo), func GetsockoptIPv6MTUInfo(int, int, int) (*IPv6MTUInfo, error) +pkg syscall (freebsd-amd64-cgo), func GetsockoptIPv6Mreq(int, int, int) (*IPv6Mreq, error) +pkg syscall (freebsd-amd64-cgo), func GetsockoptInet4Addr(int, int, int) ([4]uint8, error) +pkg syscall (freebsd-amd64-cgo), func GetsockoptInt(int, int, int) (int, error) +pkg syscall (freebsd-amd64-cgo), func Issetugid() bool +pkg syscall (freebsd-amd64-cgo), func Kevent(int, []Kevent_t, []Kevent_t, *Timespec) (int, error) +pkg syscall (freebsd-amd64-cgo), func Kill(int, Signal) error +pkg syscall (freebsd-amd64-cgo), func Kqueue() (int, error) +pkg syscall (freebsd-amd64-cgo), func Listen(int, int) error +pkg syscall (freebsd-amd64-cgo), func Lstat(string, *Stat_t) error +pkg syscall (freebsd-amd64-cgo), func Mkfifo(string, uint32) error +pkg syscall (freebsd-amd64-cgo), func Mknod(string, uint32, int) error +pkg syscall (freebsd-amd64-cgo), func Mmap(int, int64, int, int, int) ([]uint8, error) +pkg syscall (freebsd-amd64-cgo), func Munmap([]uint8) error +pkg syscall (freebsd-amd64-cgo), func Nanosleep(*Timespec, *Timespec) error +pkg syscall (freebsd-amd64-cgo), func Open(string, int, uint32) (int, error) +pkg syscall (freebsd-amd64-cgo), func ParseDirent([]uint8, int, []string) (int, int, []string) +pkg syscall (freebsd-amd64-cgo), func ParseRoutingMessage([]uint8) ([]RoutingMessage, error) +pkg syscall (freebsd-amd64-cgo), func ParseRoutingSockaddr(RoutingMessage) ([]Sockaddr, error) +pkg syscall (freebsd-amd64-cgo), func ParseSocketControlMessage([]uint8) ([]SocketControlMessage, error) +pkg syscall (freebsd-amd64-cgo), func ParseUnixRights(*SocketControlMessage) ([]int, error) +pkg syscall (freebsd-amd64-cgo), func Pathconf(string, int) (int, error) +pkg syscall (freebsd-amd64-cgo), func Pipe([]int) error +pkg syscall (freebsd-amd64-cgo), func Pread(int, []uint8, int64) (int, error) +pkg syscall (freebsd-amd64-cgo), func Pwrite(int, []uint8, int64) (int, error) +pkg syscall (freebsd-amd64-cgo), func RawSyscall(uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno) +pkg syscall (freebsd-amd64-cgo), func RawSyscall6(uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno) +pkg syscall (freebsd-amd64-cgo), func Read(int, []uint8) (int, error) +pkg syscall (freebsd-amd64-cgo), func ReadDirent(int, []uint8) (int, error) +pkg syscall (freebsd-amd64-cgo), func Recvfrom(int, []uint8, int) (int, Sockaddr, error) +pkg syscall (freebsd-amd64-cgo), func Recvmsg(int, []uint8, []uint8, int) (int, int, int, Sockaddr, error) +pkg syscall (freebsd-amd64-cgo), func Revoke(string) error +pkg syscall (freebsd-amd64-cgo), func RouteRIB(int, int) ([]uint8, error) +pkg syscall (freebsd-amd64-cgo), func Seek(int, int64, int) (int64, error) +pkg syscall (freebsd-amd64-cgo), func Select(int, *FdSet, *FdSet, *FdSet, *Timeval) error +pkg syscall (freebsd-amd64-cgo), func Sendfile(int, int, *int64, int) (int, error) +pkg syscall (freebsd-amd64-cgo), func Sendmsg(int, []uint8, []uint8, Sockaddr, int) error +pkg syscall (freebsd-amd64-cgo), func Sendto(int, []uint8, int, Sockaddr) error +pkg syscall (freebsd-amd64-cgo), func SetBpf(int, []BpfInsn) error +pkg syscall (freebsd-amd64-cgo), func SetBpfBuflen(int, int) (int, error) +pkg syscall (freebsd-amd64-cgo), func SetBpfDatalink(int, int) (int, error) +pkg syscall (freebsd-amd64-cgo), func SetBpfHeadercmpl(int, int) error +pkg syscall (freebsd-amd64-cgo), func SetBpfImmediate(int, int) error +pkg syscall (freebsd-amd64-cgo), func SetBpfInterface(int, string) error +pkg syscall (freebsd-amd64-cgo), func SetBpfPromisc(int, int) error +pkg syscall (freebsd-amd64-cgo), func SetBpfTimeout(int, *Timeval) error +pkg syscall (freebsd-amd64-cgo), func SetKevent(*Kevent_t, int, int, int) +pkg syscall (freebsd-amd64-cgo), func SetNonblock(int, bool) error +pkg syscall (freebsd-amd64-cgo), func Setegid(int) error +pkg syscall (freebsd-amd64-cgo), func Seteuid(int) error +pkg syscall (freebsd-amd64-cgo), func Setgid(int) error +pkg syscall (freebsd-amd64-cgo), func Setgroups([]int) error +pkg syscall (freebsd-amd64-cgo), func Setlogin(string) error +pkg syscall (freebsd-amd64-cgo), func Setpgid(int, int) error +pkg syscall (freebsd-amd64-cgo), func Setpriority(int, int, int) error +pkg syscall (freebsd-amd64-cgo), func Setregid(int, int) error +pkg syscall (freebsd-amd64-cgo), func Setreuid(int, int) error +pkg syscall (freebsd-amd64-cgo), func Setrlimit(int, *Rlimit) error +pkg syscall (freebsd-amd64-cgo), func Setsid() (int, error) +pkg syscall (freebsd-amd64-cgo), func SetsockoptByte(int, int, int, uint8) error +pkg syscall (freebsd-amd64-cgo), func SetsockoptICMPv6Filter(int, int, int, *ICMPv6Filter) error +pkg syscall (freebsd-amd64-cgo), func SetsockoptIPMreq(int, int, int, *IPMreq) error +pkg syscall (freebsd-amd64-cgo), func SetsockoptIPMreqn(int, int, int, *IPMreqn) error +pkg syscall (freebsd-amd64-cgo), func SetsockoptIPv6Mreq(int, int, int, *IPv6Mreq) error +pkg syscall (freebsd-amd64-cgo), func SetsockoptInet4Addr(int, int, int, [4]uint8) error +pkg syscall (freebsd-amd64-cgo), func SetsockoptInt(int, int, int, int) error +pkg syscall (freebsd-amd64-cgo), func SetsockoptLinger(int, int, int, *Linger) error +pkg syscall (freebsd-amd64-cgo), func SetsockoptString(int, int, int, string) error +pkg syscall (freebsd-amd64-cgo), func SetsockoptTimeval(int, int, int, *Timeval) error +pkg syscall (freebsd-amd64-cgo), func Settimeofday(*Timeval) error +pkg syscall (freebsd-amd64-cgo), func Setuid(int) error +pkg syscall (freebsd-amd64-cgo), func Shutdown(int, int) error +pkg syscall (freebsd-amd64-cgo), func SlicePtrFromStrings([]string) ([]*uint8, error) +pkg syscall (freebsd-amd64-cgo), func Socket(int, int, int) (int, error) +pkg syscall (freebsd-amd64-cgo), func Socketpair(int, int, int) ([2]int, error) +pkg syscall (freebsd-amd64-cgo), func Stat(string, *Stat_t) error +pkg syscall (freebsd-amd64-cgo), func Statfs(string, *Statfs_t) error +pkg syscall (freebsd-amd64-cgo), func StringSlicePtr([]string) []*uint8 +pkg syscall (freebsd-amd64-cgo), func Sync() error +pkg syscall (freebsd-amd64-cgo), func Syscall(uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno) +pkg syscall (freebsd-amd64-cgo), func Syscall6(uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno) +pkg syscall (freebsd-amd64-cgo), func Syscall9(uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno) +pkg syscall (freebsd-amd64-cgo), func Sysctl(string) (string, error) +pkg syscall (freebsd-amd64-cgo), func SysctlUint32(string) (uint32, error) +pkg syscall (freebsd-amd64-cgo), func TimevalToNsec(Timeval) int64 +pkg syscall (freebsd-amd64-cgo), func Truncate(string, int64) error +pkg syscall (freebsd-amd64-cgo), func Umask(int) int +pkg syscall (freebsd-amd64-cgo), func Undelete(string) error +pkg syscall (freebsd-amd64-cgo), func UnixRights(...int) []uint8 +pkg syscall (freebsd-amd64-cgo), func Unmount(string, int) error +pkg syscall (freebsd-amd64-cgo), func Wait4(int, *WaitStatus, int, *Rusage) (int, error) +pkg syscall (freebsd-amd64-cgo), func Write(int, []uint8) (int, error) +pkg syscall (freebsd-amd64-cgo), method (*Cmsghdr) SetLen(int) +pkg syscall (freebsd-amd64-cgo), method (*Iovec) SetLen(int) +pkg syscall (freebsd-amd64-cgo), method (*Msghdr) SetControllen(int) +pkg syscall (freebsd-amd64-cgo), type BpfHdr struct +pkg syscall (freebsd-amd64-cgo), type BpfHdr struct, Caplen uint32 +pkg syscall (freebsd-amd64-cgo), type BpfHdr struct, Datalen uint32 +pkg syscall (freebsd-amd64-cgo), type BpfHdr struct, Hdrlen uint16 +pkg syscall (freebsd-amd64-cgo), type BpfHdr struct, Pad_cgo_0 [6]uint8 +pkg syscall (freebsd-amd64-cgo), type BpfHdr struct, Tstamp Timeval +pkg syscall (freebsd-amd64-cgo), type BpfInsn struct +pkg syscall (freebsd-amd64-cgo), type BpfInsn struct, Code uint16 +pkg syscall (freebsd-amd64-cgo), type BpfInsn struct, Jf uint8 +pkg syscall (freebsd-amd64-cgo), type BpfInsn struct, Jt uint8 +pkg syscall (freebsd-amd64-cgo), type BpfInsn struct, K uint32 +pkg syscall (freebsd-amd64-cgo), type BpfProgram struct +pkg syscall (freebsd-amd64-cgo), type BpfProgram struct, Insns *BpfInsn +pkg syscall (freebsd-amd64-cgo), type BpfProgram struct, Len uint32 +pkg syscall (freebsd-amd64-cgo), type BpfProgram struct, Pad_cgo_0 [4]uint8 +pkg syscall (freebsd-amd64-cgo), type BpfStat struct +pkg syscall (freebsd-amd64-cgo), type BpfStat struct, Drop uint32 +pkg syscall (freebsd-amd64-cgo), type BpfStat struct, Recv uint32 +pkg syscall (freebsd-amd64-cgo), type BpfVersion struct +pkg syscall (freebsd-amd64-cgo), type BpfVersion struct, Major uint16 +pkg syscall (freebsd-amd64-cgo), type BpfVersion struct, Minor uint16 +pkg syscall (freebsd-amd64-cgo), type BpfZbuf struct +pkg syscall (freebsd-amd64-cgo), type BpfZbuf struct, Bufa *uint8 +pkg syscall (freebsd-amd64-cgo), type BpfZbuf struct, Bufb *uint8 +pkg syscall (freebsd-amd64-cgo), type BpfZbuf struct, Buflen uint64 +pkg syscall (freebsd-amd64-cgo), type BpfZbufHeader struct +pkg syscall (freebsd-amd64-cgo), type BpfZbufHeader struct, Kernel_gen uint32 +pkg syscall (freebsd-amd64-cgo), type BpfZbufHeader struct, Kernel_len uint32 +pkg syscall (freebsd-amd64-cgo), type BpfZbufHeader struct, User_gen uint32 +pkg syscall (freebsd-amd64-cgo), type BpfZbufHeader struct, X_bzh_pad [5]uint32 +pkg syscall (freebsd-amd64-cgo), type Cmsghdr struct +pkg syscall (freebsd-amd64-cgo), type Cmsghdr struct, Len uint32 +pkg syscall (freebsd-amd64-cgo), type Cmsghdr struct, Level int32 +pkg syscall (freebsd-amd64-cgo), type Cmsghdr struct, Type int32 +pkg syscall (freebsd-amd64-cgo), type Credential struct +pkg syscall (freebsd-amd64-cgo), type Credential struct, Gid uint32 +pkg syscall (freebsd-amd64-cgo), type Credential struct, Groups []uint32 +pkg syscall (freebsd-amd64-cgo), type Credential struct, Uid uint32 +pkg syscall (freebsd-amd64-cgo), type Dirent struct +pkg syscall (freebsd-amd64-cgo), type Dirent struct, Fileno uint32 +pkg syscall (freebsd-amd64-cgo), type Dirent struct, Name [256]int8 +pkg syscall (freebsd-amd64-cgo), type Dirent struct, Namlen uint8 +pkg syscall (freebsd-amd64-cgo), type Dirent struct, Reclen uint16 +pkg syscall (freebsd-amd64-cgo), type Dirent struct, Type uint8 +pkg syscall (freebsd-amd64-cgo), type FdSet struct +pkg syscall (freebsd-amd64-cgo), type FdSet struct, X__fds_bits [16]uint64 +pkg syscall (freebsd-amd64-cgo), type Flock_t struct +pkg syscall (freebsd-amd64-cgo), type Flock_t struct, Len int64 +pkg syscall (freebsd-amd64-cgo), type Flock_t struct, Pad_cgo_0 [4]uint8 +pkg syscall (freebsd-amd64-cgo), type Flock_t struct, Pid int32 +pkg syscall (freebsd-amd64-cgo), type Flock_t struct, Start int64 +pkg syscall (freebsd-amd64-cgo), type Flock_t struct, Sysid int32 +pkg syscall (freebsd-amd64-cgo), type Flock_t struct, Type int16 +pkg syscall (freebsd-amd64-cgo), type Flock_t struct, Whence int16 +pkg syscall (freebsd-amd64-cgo), type Fsid struct +pkg syscall (freebsd-amd64-cgo), type Fsid struct, Val [2]int32 +pkg syscall (freebsd-amd64-cgo), type ICMPv6Filter struct +pkg syscall (freebsd-amd64-cgo), type ICMPv6Filter struct, Filt [8]uint32 +pkg syscall (freebsd-amd64-cgo), type IPMreqn struct +pkg syscall (freebsd-amd64-cgo), type IPMreqn struct, Address [4]uint8 +pkg syscall (freebsd-amd64-cgo), type IPMreqn struct, Ifindex int32 +pkg syscall (freebsd-amd64-cgo), type IPMreqn struct, Multiaddr [4]uint8 +pkg syscall (freebsd-amd64-cgo), type IPv6MTUInfo struct +pkg syscall (freebsd-amd64-cgo), type IPv6MTUInfo struct, Addr RawSockaddrInet6 +pkg syscall (freebsd-amd64-cgo), type IPv6MTUInfo struct, Mtu uint32 +pkg syscall (freebsd-amd64-cgo), type IfAnnounceMsghdr struct +pkg syscall (freebsd-amd64-cgo), type IfAnnounceMsghdr struct, Index uint16 +pkg syscall (freebsd-amd64-cgo), type IfAnnounceMsghdr struct, Msglen uint16 +pkg syscall (freebsd-amd64-cgo), type IfAnnounceMsghdr struct, Name [16]int8 +pkg syscall (freebsd-amd64-cgo), type IfAnnounceMsghdr struct, Type uint8 +pkg syscall (freebsd-amd64-cgo), type IfAnnounceMsghdr struct, Version uint8 +pkg syscall (freebsd-amd64-cgo), type IfAnnounceMsghdr struct, What uint16 +pkg syscall (freebsd-amd64-cgo), type IfData struct +pkg syscall (freebsd-amd64-cgo), type IfData struct, Addrlen uint8 +pkg syscall (freebsd-amd64-cgo), type IfData struct, Baudrate uint64 +pkg syscall (freebsd-amd64-cgo), type IfData struct, Collisions uint64 +pkg syscall (freebsd-amd64-cgo), type IfData struct, Datalen uint8 +pkg syscall (freebsd-amd64-cgo), type IfData struct, Epoch int64 +pkg syscall (freebsd-amd64-cgo), type IfData struct, Hdrlen uint8 +pkg syscall (freebsd-amd64-cgo), type IfData struct, Hwassist uint64 +pkg syscall (freebsd-amd64-cgo), type IfData struct, Ibytes uint64 +pkg syscall (freebsd-amd64-cgo), type IfData struct, Ierrors uint64 +pkg syscall (freebsd-amd64-cgo), type IfData struct, Imcasts uint64 +pkg syscall (freebsd-amd64-cgo), type IfData struct, Ipackets uint64 +pkg syscall (freebsd-amd64-cgo), type IfData struct, Iqdrops uint64 +pkg syscall (freebsd-amd64-cgo), type IfData struct, Lastchange Timeval +pkg syscall (freebsd-amd64-cgo), type IfData struct, Link_state uint8 +pkg syscall (freebsd-amd64-cgo), type IfData struct, Metric uint64 +pkg syscall (freebsd-amd64-cgo), type IfData struct, Mtu uint64 +pkg syscall (freebsd-amd64-cgo), type IfData struct, Noproto uint64 +pkg syscall (freebsd-amd64-cgo), type IfData struct, Obytes uint64 +pkg syscall (freebsd-amd64-cgo), type IfData struct, Oerrors uint64 +pkg syscall (freebsd-amd64-cgo), type IfData struct, Omcasts uint64 +pkg syscall (freebsd-amd64-cgo), type IfData struct, Opackets uint64 +pkg syscall (freebsd-amd64-cgo), type IfData struct, Physical uint8 +pkg syscall (freebsd-amd64-cgo), type IfData struct, Spare_char1 uint8 +pkg syscall (freebsd-amd64-cgo), type IfData struct, Spare_char2 uint8 +pkg syscall (freebsd-amd64-cgo), type IfData struct, Type uint8 +pkg syscall (freebsd-amd64-cgo), type IfMsghdr struct +pkg syscall (freebsd-amd64-cgo), type IfMsghdr struct, Addrs int32 +pkg syscall (freebsd-amd64-cgo), type IfMsghdr struct, Data IfData +pkg syscall (freebsd-amd64-cgo), type IfMsghdr struct, Flags int32 +pkg syscall (freebsd-amd64-cgo), type IfMsghdr struct, Index uint16 +pkg syscall (freebsd-amd64-cgo), type IfMsghdr struct, Msglen uint16 +pkg syscall (freebsd-amd64-cgo), type IfMsghdr struct, Pad_cgo_0 [2]uint8 +pkg syscall (freebsd-amd64-cgo), type IfMsghdr struct, Type uint8 +pkg syscall (freebsd-amd64-cgo), type IfMsghdr struct, Version uint8 +pkg syscall (freebsd-amd64-cgo), type IfaMsghdr struct +pkg syscall (freebsd-amd64-cgo), type IfaMsghdr struct, Addrs int32 +pkg syscall (freebsd-amd64-cgo), type IfaMsghdr struct, Flags int32 +pkg syscall (freebsd-amd64-cgo), type IfaMsghdr struct, Index uint16 +pkg syscall (freebsd-amd64-cgo), type IfaMsghdr struct, Metric int32 +pkg syscall (freebsd-amd64-cgo), type IfaMsghdr struct, Msglen uint16 +pkg syscall (freebsd-amd64-cgo), type IfaMsghdr struct, Pad_cgo_0 [2]uint8 +pkg syscall (freebsd-amd64-cgo), type IfaMsghdr struct, Type uint8 +pkg syscall (freebsd-amd64-cgo), type IfaMsghdr struct, Version uint8 +pkg syscall (freebsd-amd64-cgo), type IfmaMsghdr struct +pkg syscall (freebsd-amd64-cgo), type IfmaMsghdr struct, Addrs int32 +pkg syscall (freebsd-amd64-cgo), type IfmaMsghdr struct, Flags int32 +pkg syscall (freebsd-amd64-cgo), type IfmaMsghdr struct, Index uint16 +pkg syscall (freebsd-amd64-cgo), type IfmaMsghdr struct, Msglen uint16 +pkg syscall (freebsd-amd64-cgo), type IfmaMsghdr struct, Pad_cgo_0 [2]uint8 +pkg syscall (freebsd-amd64-cgo), type IfmaMsghdr struct, Type uint8 +pkg syscall (freebsd-amd64-cgo), type IfmaMsghdr struct, Version uint8 +pkg syscall (freebsd-amd64-cgo), type Inet6Pktinfo struct +pkg syscall (freebsd-amd64-cgo), type Inet6Pktinfo struct, Addr [16]uint8 +pkg syscall (freebsd-amd64-cgo), type Inet6Pktinfo struct, Ifindex uint32 +pkg syscall (freebsd-amd64-cgo), type InterfaceAddrMessage struct +pkg syscall (freebsd-amd64-cgo), type InterfaceAddrMessage struct, Data []uint8 +pkg syscall (freebsd-amd64-cgo), type InterfaceAddrMessage struct, Header IfaMsghdr +pkg syscall (freebsd-amd64-cgo), type InterfaceAnnounceMessage struct +pkg syscall (freebsd-amd64-cgo), type InterfaceAnnounceMessage struct, Header IfAnnounceMsghdr +pkg syscall (freebsd-amd64-cgo), type InterfaceMessage struct +pkg syscall (freebsd-amd64-cgo), type InterfaceMessage struct, Data []uint8 +pkg syscall (freebsd-amd64-cgo), type InterfaceMessage struct, Header IfMsghdr +pkg syscall (freebsd-amd64-cgo), type InterfaceMulticastAddrMessage struct +pkg syscall (freebsd-amd64-cgo), type InterfaceMulticastAddrMessage struct, Data []uint8 +pkg syscall (freebsd-amd64-cgo), type InterfaceMulticastAddrMessage struct, Header IfmaMsghdr +pkg syscall (freebsd-amd64-cgo), type Iovec struct +pkg syscall (freebsd-amd64-cgo), type Iovec struct, Base *uint8 +pkg syscall (freebsd-amd64-cgo), type Iovec struct, Len uint64 +pkg syscall (freebsd-amd64-cgo), type Kevent_t struct +pkg syscall (freebsd-amd64-cgo), type Kevent_t struct, Data int64 +pkg syscall (freebsd-amd64-cgo), type Kevent_t struct, Fflags uint32 +pkg syscall (freebsd-amd64-cgo), type Kevent_t struct, Filter int16 +pkg syscall (freebsd-amd64-cgo), type Kevent_t struct, Flags uint16 +pkg syscall (freebsd-amd64-cgo), type Kevent_t struct, Ident uint64 +pkg syscall (freebsd-amd64-cgo), type Kevent_t struct, Udata *uint8 +pkg syscall (freebsd-amd64-cgo), type Msghdr struct +pkg syscall (freebsd-amd64-cgo), type Msghdr struct, Control *uint8 +pkg syscall (freebsd-amd64-cgo), type Msghdr struct, Controllen uint32 +pkg syscall (freebsd-amd64-cgo), type Msghdr struct, Flags int32 +pkg syscall (freebsd-amd64-cgo), type Msghdr struct, Iov *Iovec +pkg syscall (freebsd-amd64-cgo), type Msghdr struct, Iovlen int32 +pkg syscall (freebsd-amd64-cgo), type Msghdr struct, Name *uint8 +pkg syscall (freebsd-amd64-cgo), type Msghdr struct, Namelen uint32 +pkg syscall (freebsd-amd64-cgo), type Msghdr struct, Pad_cgo_0 [4]uint8 +pkg syscall (freebsd-amd64-cgo), type Msghdr struct, Pad_cgo_1 [4]uint8 +pkg syscall (freebsd-amd64-cgo), type RawSockaddr struct, Data [14]int8 +pkg syscall (freebsd-amd64-cgo), type RawSockaddr struct, Family uint8 +pkg syscall (freebsd-amd64-cgo), type RawSockaddr struct, Len uint8 +pkg syscall (freebsd-amd64-cgo), type RawSockaddrAny struct, Pad [92]int8 +pkg syscall (freebsd-amd64-cgo), type RawSockaddrDatalink struct +pkg syscall (freebsd-amd64-cgo), type RawSockaddrDatalink struct, Alen uint8 +pkg syscall (freebsd-amd64-cgo), type RawSockaddrDatalink struct, Data [46]int8 +pkg syscall (freebsd-amd64-cgo), type RawSockaddrDatalink struct, Family uint8 +pkg syscall (freebsd-amd64-cgo), type RawSockaddrDatalink struct, Index uint16 +pkg syscall (freebsd-amd64-cgo), type RawSockaddrDatalink struct, Len uint8 +pkg syscall (freebsd-amd64-cgo), type RawSockaddrDatalink struct, Nlen uint8 +pkg syscall (freebsd-amd64-cgo), type RawSockaddrDatalink struct, Slen uint8 +pkg syscall (freebsd-amd64-cgo), type RawSockaddrDatalink struct, Type uint8 +pkg syscall (freebsd-amd64-cgo), type RawSockaddrInet4 struct, Family uint8 +pkg syscall (freebsd-amd64-cgo), type RawSockaddrInet4 struct, Len uint8 +pkg syscall (freebsd-amd64-cgo), type RawSockaddrInet4 struct, Zero [8]int8 +pkg syscall (freebsd-amd64-cgo), type RawSockaddrInet6 struct, Family uint8 +pkg syscall (freebsd-amd64-cgo), type RawSockaddrInet6 struct, Len uint8 +pkg syscall (freebsd-amd64-cgo), type RawSockaddrUnix struct +pkg syscall (freebsd-amd64-cgo), type RawSockaddrUnix struct, Family uint8 +pkg syscall (freebsd-amd64-cgo), type RawSockaddrUnix struct, Len uint8 +pkg syscall (freebsd-amd64-cgo), type RawSockaddrUnix struct, Path [104]int8 +pkg syscall (freebsd-amd64-cgo), type Rlimit struct +pkg syscall (freebsd-amd64-cgo), type Rlimit struct, Cur int64 +pkg syscall (freebsd-amd64-cgo), type Rlimit struct, Max int64 +pkg syscall (freebsd-amd64-cgo), type RouteMessage struct +pkg syscall (freebsd-amd64-cgo), type RouteMessage struct, Data []uint8 +pkg syscall (freebsd-amd64-cgo), type RouteMessage struct, Header RtMsghdr +pkg syscall (freebsd-amd64-cgo), type RoutingMessage interface, unexported methods +pkg syscall (freebsd-amd64-cgo), type RtMetrics struct +pkg syscall (freebsd-amd64-cgo), type RtMetrics struct, Expire uint64 +pkg syscall (freebsd-amd64-cgo), type RtMetrics struct, Filler [3]uint64 +pkg syscall (freebsd-amd64-cgo), type RtMetrics struct, Hopcount uint64 +pkg syscall (freebsd-amd64-cgo), type RtMetrics struct, Locks uint64 +pkg syscall (freebsd-amd64-cgo), type RtMetrics struct, Mtu uint64 +pkg syscall (freebsd-amd64-cgo), type RtMetrics struct, Pksent uint64 +pkg syscall (freebsd-amd64-cgo), type RtMetrics struct, Recvpipe uint64 +pkg syscall (freebsd-amd64-cgo), type RtMetrics struct, Rtt uint64 +pkg syscall (freebsd-amd64-cgo), type RtMetrics struct, Rttvar uint64 +pkg syscall (freebsd-amd64-cgo), type RtMetrics struct, Sendpipe uint64 +pkg syscall (freebsd-amd64-cgo), type RtMetrics struct, Ssthresh uint64 +pkg syscall (freebsd-amd64-cgo), type RtMetrics struct, Weight uint64 +pkg syscall (freebsd-amd64-cgo), type RtMsghdr struct +pkg syscall (freebsd-amd64-cgo), type RtMsghdr struct, Addrs int32 +pkg syscall (freebsd-amd64-cgo), type RtMsghdr struct, Errno int32 +pkg syscall (freebsd-amd64-cgo), type RtMsghdr struct, Flags int32 +pkg syscall (freebsd-amd64-cgo), type RtMsghdr struct, Fmask int32 +pkg syscall (freebsd-amd64-cgo), type RtMsghdr struct, Index uint16 +pkg syscall (freebsd-amd64-cgo), type RtMsghdr struct, Inits uint64 +pkg syscall (freebsd-amd64-cgo), type RtMsghdr struct, Msglen uint16 +pkg syscall (freebsd-amd64-cgo), type RtMsghdr struct, Pad_cgo_0 [2]uint8 +pkg syscall (freebsd-amd64-cgo), type RtMsghdr struct, Pid int32 +pkg syscall (freebsd-amd64-cgo), type RtMsghdr struct, Rmx RtMetrics +pkg syscall (freebsd-amd64-cgo), type RtMsghdr struct, Seq int32 +pkg syscall (freebsd-amd64-cgo), type RtMsghdr struct, Type uint8 +pkg syscall (freebsd-amd64-cgo), type RtMsghdr struct, Version uint8 +pkg syscall (freebsd-amd64-cgo), type Rusage struct, Idrss int64 +pkg syscall (freebsd-amd64-cgo), type Rusage struct, Inblock int64 +pkg syscall (freebsd-amd64-cgo), type Rusage struct, Isrss int64 +pkg syscall (freebsd-amd64-cgo), type Rusage struct, Ixrss int64 +pkg syscall (freebsd-amd64-cgo), type Rusage struct, Majflt int64 +pkg syscall (freebsd-amd64-cgo), type Rusage struct, Maxrss int64 +pkg syscall (freebsd-amd64-cgo), type Rusage struct, Minflt int64 +pkg syscall (freebsd-amd64-cgo), type Rusage struct, Msgrcv int64 +pkg syscall (freebsd-amd64-cgo), type Rusage struct, Msgsnd int64 +pkg syscall (freebsd-amd64-cgo), type Rusage struct, Nivcsw int64 +pkg syscall (freebsd-amd64-cgo), type Rusage struct, Nsignals int64 +pkg syscall (freebsd-amd64-cgo), type Rusage struct, Nswap int64 +pkg syscall (freebsd-amd64-cgo), type Rusage struct, Nvcsw int64 +pkg syscall (freebsd-amd64-cgo), type Rusage struct, Oublock int64 +pkg syscall (freebsd-amd64-cgo), type Rusage struct, Stime Timeval +pkg syscall (freebsd-amd64-cgo), type Rusage struct, Utime Timeval +pkg syscall (freebsd-amd64-cgo), type SockaddrDatalink struct +pkg syscall (freebsd-amd64-cgo), type SockaddrDatalink struct, Alen uint8 +pkg syscall (freebsd-amd64-cgo), type SockaddrDatalink struct, Data [46]int8 +pkg syscall (freebsd-amd64-cgo), type SockaddrDatalink struct, Family uint8 +pkg syscall (freebsd-amd64-cgo), type SockaddrDatalink struct, Index uint16 +pkg syscall (freebsd-amd64-cgo), type SockaddrDatalink struct, Len uint8 +pkg syscall (freebsd-amd64-cgo), type SockaddrDatalink struct, Nlen uint8 +pkg syscall (freebsd-amd64-cgo), type SockaddrDatalink struct, Slen uint8 +pkg syscall (freebsd-amd64-cgo), type SockaddrDatalink struct, Type uint8 +pkg syscall (freebsd-amd64-cgo), type SocketControlMessage struct +pkg syscall (freebsd-amd64-cgo), type SocketControlMessage struct, Data []uint8 +pkg syscall (freebsd-amd64-cgo), type SocketControlMessage struct, Header Cmsghdr +pkg syscall (freebsd-amd64-cgo), type Stat_t struct +pkg syscall (freebsd-amd64-cgo), type Stat_t struct, Atimespec Timespec +pkg syscall (freebsd-amd64-cgo), type Stat_t struct, Birthtimespec Timespec +pkg syscall (freebsd-amd64-cgo), type Stat_t struct, Blksize uint32 +pkg syscall (freebsd-amd64-cgo), type Stat_t struct, Blocks int64 +pkg syscall (freebsd-amd64-cgo), type Stat_t struct, Ctimespec Timespec +pkg syscall (freebsd-amd64-cgo), type Stat_t struct, Dev uint32 +pkg syscall (freebsd-amd64-cgo), type Stat_t struct, Flags uint32 +pkg syscall (freebsd-amd64-cgo), type Stat_t struct, Gen uint32 +pkg syscall (freebsd-amd64-cgo), type Stat_t struct, Gid uint32 +pkg syscall (freebsd-amd64-cgo), type Stat_t struct, Ino uint32 +pkg syscall (freebsd-amd64-cgo), type Stat_t struct, Lspare int32 +pkg syscall (freebsd-amd64-cgo), type Stat_t struct, Mode uint16 +pkg syscall (freebsd-amd64-cgo), type Stat_t struct, Mtimespec Timespec +pkg syscall (freebsd-amd64-cgo), type Stat_t struct, Nlink uint16 +pkg syscall (freebsd-amd64-cgo), type Stat_t struct, Rdev uint32 +pkg syscall (freebsd-amd64-cgo), type Stat_t struct, Size int64 +pkg syscall (freebsd-amd64-cgo), type Stat_t struct, Uid uint32 +pkg syscall (freebsd-amd64-cgo), type Statfs_t struct +pkg syscall (freebsd-amd64-cgo), type Statfs_t struct, Asyncreads uint64 +pkg syscall (freebsd-amd64-cgo), type Statfs_t struct, Asyncwrites uint64 +pkg syscall (freebsd-amd64-cgo), type Statfs_t struct, Bavail int64 +pkg syscall (freebsd-amd64-cgo), type Statfs_t struct, Bfree uint64 +pkg syscall (freebsd-amd64-cgo), type Statfs_t struct, Blocks uint64 +pkg syscall (freebsd-amd64-cgo), type Statfs_t struct, Bsize uint64 +pkg syscall (freebsd-amd64-cgo), type Statfs_t struct, Charspare [80]int8 +pkg syscall (freebsd-amd64-cgo), type Statfs_t struct, Ffree int64 +pkg syscall (freebsd-amd64-cgo), type Statfs_t struct, Files uint64 +pkg syscall (freebsd-amd64-cgo), type Statfs_t struct, Flags uint64 +pkg syscall (freebsd-amd64-cgo), type Statfs_t struct, Fsid Fsid +pkg syscall (freebsd-amd64-cgo), type Statfs_t struct, Fstypename [16]int8 +pkg syscall (freebsd-amd64-cgo), type Statfs_t struct, Iosize uint64 +pkg syscall (freebsd-amd64-cgo), type Statfs_t struct, Mntfromname [88]int8 +pkg syscall (freebsd-amd64-cgo), type Statfs_t struct, Mntonname [88]int8 +pkg syscall (freebsd-amd64-cgo), type Statfs_t struct, Namemax uint32 +pkg syscall (freebsd-amd64-cgo), type Statfs_t struct, Owner uint32 +pkg syscall (freebsd-amd64-cgo), type Statfs_t struct, Spare [10]uint64 +pkg syscall (freebsd-amd64-cgo), type Statfs_t struct, Syncreads uint64 +pkg syscall (freebsd-amd64-cgo), type Statfs_t struct, Syncwrites uint64 +pkg syscall (freebsd-amd64-cgo), type Statfs_t struct, Type uint32 +pkg syscall (freebsd-amd64-cgo), type Statfs_t struct, Version uint32 +pkg syscall (freebsd-amd64-cgo), type SysProcAttr struct, Chroot string +pkg syscall (freebsd-amd64-cgo), type SysProcAttr struct, Credential *Credential +pkg syscall (freebsd-amd64-cgo), type SysProcAttr struct, Noctty bool +pkg syscall (freebsd-amd64-cgo), type SysProcAttr struct, Ptrace bool +pkg syscall (freebsd-amd64-cgo), type SysProcAttr struct, Setctty bool +pkg syscall (freebsd-amd64-cgo), type SysProcAttr struct, Setpgid bool +pkg syscall (freebsd-amd64-cgo), type SysProcAttr struct, Setsid bool +pkg syscall (freebsd-amd64-cgo), type Timespec struct, Nsec int64 +pkg syscall (freebsd-amd64-cgo), type Timespec struct, Sec int64 +pkg syscall (freebsd-amd64-cgo), type Timeval struct, Sec int64 +pkg syscall (freebsd-amd64-cgo), type Timeval struct, Usec int64 +pkg syscall (freebsd-amd64-cgo), type WaitStatus uint32 +pkg syscall (freebsd-amd64-cgo), var Stderr int +pkg syscall (freebsd-amd64-cgo), var Stdin int +pkg syscall (freebsd-amd64-cgo), var Stdout int +pkg syscall (freebsd-arm), const AF_APPLETALK ideal-int +pkg syscall (freebsd-arm), const AF_ARP ideal-int +pkg syscall (freebsd-arm), const AF_ATM ideal-int +pkg syscall (freebsd-arm), const AF_BLUETOOTH ideal-int +pkg syscall (freebsd-arm), const AF_CCITT ideal-int +pkg syscall (freebsd-arm), const AF_CHAOS ideal-int +pkg syscall (freebsd-arm), const AF_CNT ideal-int +pkg syscall (freebsd-arm), const AF_COIP ideal-int +pkg syscall (freebsd-arm), const AF_DATAKIT ideal-int +pkg syscall (freebsd-arm), const AF_DECnet ideal-int +pkg syscall (freebsd-arm), const AF_DLI ideal-int +pkg syscall (freebsd-arm), const AF_E164 ideal-int +pkg syscall (freebsd-arm), const AF_ECMA ideal-int +pkg syscall (freebsd-arm), const AF_HYLINK ideal-int +pkg syscall (freebsd-arm), const AF_IEEE80211 ideal-int +pkg syscall (freebsd-arm), const AF_IMPLINK ideal-int +pkg syscall (freebsd-arm), const AF_IPX ideal-int +pkg syscall (freebsd-arm), const AF_ISDN ideal-int +pkg syscall (freebsd-arm), const AF_ISO ideal-int +pkg syscall (freebsd-arm), const AF_LAT ideal-int +pkg syscall (freebsd-arm), const AF_LINK ideal-int +pkg syscall (freebsd-arm), const AF_LOCAL ideal-int +pkg syscall (freebsd-arm), const AF_MAX ideal-int +pkg syscall (freebsd-arm), const AF_NATM ideal-int +pkg syscall (freebsd-arm), const AF_NETBIOS ideal-int +pkg syscall (freebsd-arm), const AF_NETGRAPH ideal-int +pkg syscall (freebsd-arm), const AF_OSI ideal-int +pkg syscall (freebsd-arm), const AF_PUP ideal-int +pkg syscall (freebsd-arm), const AF_ROUTE ideal-int +pkg syscall (freebsd-arm), const AF_SCLUSTER ideal-int +pkg syscall (freebsd-arm), const AF_SIP ideal-int +pkg syscall (freebsd-arm), const AF_SLOW ideal-int +pkg syscall (freebsd-arm), const AF_SNA ideal-int +pkg syscall (freebsd-arm), const AF_VENDOR00 ideal-int +pkg syscall (freebsd-arm), const AF_VENDOR01 ideal-int +pkg syscall (freebsd-arm), const AF_VENDOR02 ideal-int +pkg syscall (freebsd-arm), const AF_VENDOR03 ideal-int +pkg syscall (freebsd-arm), const AF_VENDOR04 ideal-int +pkg syscall (freebsd-arm), const AF_VENDOR05 ideal-int +pkg syscall (freebsd-arm), const AF_VENDOR06 ideal-int +pkg syscall (freebsd-arm), const AF_VENDOR07 ideal-int +pkg syscall (freebsd-arm), const AF_VENDOR08 ideal-int +pkg syscall (freebsd-arm), const AF_VENDOR09 ideal-int +pkg syscall (freebsd-arm), const AF_VENDOR10 ideal-int +pkg syscall (freebsd-arm), const AF_VENDOR11 ideal-int +pkg syscall (freebsd-arm), const AF_VENDOR12 ideal-int +pkg syscall (freebsd-arm), const AF_VENDOR13 ideal-int +pkg syscall (freebsd-arm), const AF_VENDOR14 ideal-int +pkg syscall (freebsd-arm), const AF_VENDOR15 ideal-int +pkg syscall (freebsd-arm), const AF_VENDOR16 ideal-int +pkg syscall (freebsd-arm), const AF_VENDOR17 ideal-int +pkg syscall (freebsd-arm), const AF_VENDOR18 ideal-int +pkg syscall (freebsd-arm), const AF_VENDOR19 ideal-int +pkg syscall (freebsd-arm), const AF_VENDOR20 ideal-int +pkg syscall (freebsd-arm), const AF_VENDOR21 ideal-int +pkg syscall (freebsd-arm), const AF_VENDOR22 ideal-int +pkg syscall (freebsd-arm), const AF_VENDOR23 ideal-int +pkg syscall (freebsd-arm), const AF_VENDOR24 ideal-int +pkg syscall (freebsd-arm), const AF_VENDOR25 ideal-int +pkg syscall (freebsd-arm), const AF_VENDOR26 ideal-int +pkg syscall (freebsd-arm), const AF_VENDOR27 ideal-int +pkg syscall (freebsd-arm), const AF_VENDOR28 ideal-int +pkg syscall (freebsd-arm), const AF_VENDOR29 ideal-int +pkg syscall (freebsd-arm), const AF_VENDOR30 ideal-int +pkg syscall (freebsd-arm), const AF_VENDOR31 ideal-int +pkg syscall (freebsd-arm), const AF_VENDOR32 ideal-int +pkg syscall (freebsd-arm), const AF_VENDOR33 ideal-int +pkg syscall (freebsd-arm), const AF_VENDOR34 ideal-int +pkg syscall (freebsd-arm), const AF_VENDOR35 ideal-int +pkg syscall (freebsd-arm), const AF_VENDOR36 ideal-int +pkg syscall (freebsd-arm), const AF_VENDOR37 ideal-int +pkg syscall (freebsd-arm), const AF_VENDOR38 ideal-int +pkg syscall (freebsd-arm), const AF_VENDOR39 ideal-int +pkg syscall (freebsd-arm), const AF_VENDOR40 ideal-int +pkg syscall (freebsd-arm), const AF_VENDOR41 ideal-int +pkg syscall (freebsd-arm), const AF_VENDOR42 ideal-int +pkg syscall (freebsd-arm), const AF_VENDOR43 ideal-int +pkg syscall (freebsd-arm), const AF_VENDOR44 ideal-int +pkg syscall (freebsd-arm), const AF_VENDOR45 ideal-int +pkg syscall (freebsd-arm), const AF_VENDOR46 ideal-int +pkg syscall (freebsd-arm), const AF_VENDOR47 ideal-int +pkg syscall (freebsd-arm), const B0 ideal-int +pkg syscall (freebsd-arm), const B110 ideal-int +pkg syscall (freebsd-arm), const B115200 ideal-int +pkg syscall (freebsd-arm), const B1200 ideal-int +pkg syscall (freebsd-arm), const B134 ideal-int +pkg syscall (freebsd-arm), const B14400 ideal-int +pkg syscall (freebsd-arm), const B150 ideal-int +pkg syscall (freebsd-arm), const B1800 ideal-int +pkg syscall (freebsd-arm), const B19200 ideal-int +pkg syscall (freebsd-arm), const B200 ideal-int +pkg syscall (freebsd-arm), const B230400 ideal-int +pkg syscall (freebsd-arm), const B2400 ideal-int +pkg syscall (freebsd-arm), const B28800 ideal-int +pkg syscall (freebsd-arm), const B300 ideal-int +pkg syscall (freebsd-arm), const B38400 ideal-int +pkg syscall (freebsd-arm), const B460800 ideal-int +pkg syscall (freebsd-arm), const B4800 ideal-int +pkg syscall (freebsd-arm), const B50 ideal-int +pkg syscall (freebsd-arm), const B57600 ideal-int +pkg syscall (freebsd-arm), const B600 ideal-int +pkg syscall (freebsd-arm), const B7200 ideal-int +pkg syscall (freebsd-arm), const B75 ideal-int +pkg syscall (freebsd-arm), const B76800 ideal-int +pkg syscall (freebsd-arm), const B921600 ideal-int +pkg syscall (freebsd-arm), const B9600 ideal-int +pkg syscall (freebsd-arm), const BIOCFEEDBACK ideal-int +pkg syscall (freebsd-arm), const BIOCFLUSH ideal-int +pkg syscall (freebsd-arm), const BIOCGBLEN ideal-int +pkg syscall (freebsd-arm), const BIOCGDIRECTION ideal-int +pkg syscall (freebsd-arm), const BIOCGDLT ideal-int +pkg syscall (freebsd-arm), const BIOCGDLTLIST ideal-int +pkg syscall (freebsd-arm), const BIOCGETBUFMODE ideal-int +pkg syscall (freebsd-arm), const BIOCGETIF ideal-int +pkg syscall (freebsd-arm), const BIOCGETZMAX ideal-int +pkg syscall (freebsd-arm), const BIOCGHDRCMPLT ideal-int +pkg syscall (freebsd-arm), const BIOCGRSIG ideal-int +pkg syscall (freebsd-arm), const BIOCGRTIMEOUT ideal-int +pkg syscall (freebsd-arm), const BIOCGSEESENT ideal-int +pkg syscall (freebsd-arm), const BIOCGSTATS ideal-int +pkg syscall (freebsd-arm), const BIOCGTSTAMP ideal-int +pkg syscall (freebsd-arm), const BIOCIMMEDIATE ideal-int +pkg syscall (freebsd-arm), const BIOCLOCK ideal-int +pkg syscall (freebsd-arm), const BIOCPROMISC ideal-int +pkg syscall (freebsd-arm), const BIOCROTZBUF ideal-int +pkg syscall (freebsd-arm), const BIOCSBLEN ideal-int +pkg syscall (freebsd-arm), const BIOCSDIRECTION ideal-int +pkg syscall (freebsd-arm), const BIOCSDLT ideal-int +pkg syscall (freebsd-arm), const BIOCSETBUFMODE ideal-int +pkg syscall (freebsd-arm), const BIOCSETF ideal-int +pkg syscall (freebsd-arm), const BIOCSETFNR ideal-int +pkg syscall (freebsd-arm), const BIOCSETIF ideal-int +pkg syscall (freebsd-arm), const BIOCSETWF ideal-int +pkg syscall (freebsd-arm), const BIOCSETZBUF ideal-int +pkg syscall (freebsd-arm), const BIOCSHDRCMPLT ideal-int +pkg syscall (freebsd-arm), const BIOCSRSIG ideal-int +pkg syscall (freebsd-arm), const BIOCSRTIMEOUT ideal-int +pkg syscall (freebsd-arm), const BIOCSSEESENT ideal-int +pkg syscall (freebsd-arm), const BIOCSTSTAMP ideal-int +pkg syscall (freebsd-arm), const BIOCVERSION ideal-int +pkg syscall (freebsd-arm), const BPF_A ideal-int +pkg syscall (freebsd-arm), const BPF_ABS ideal-int +pkg syscall (freebsd-arm), const BPF_ADD ideal-int +pkg syscall (freebsd-arm), const BPF_ALIGNMENT ideal-int +pkg syscall (freebsd-arm), const BPF_ALU ideal-int +pkg syscall (freebsd-arm), const BPF_AND ideal-int +pkg syscall (freebsd-arm), const BPF_B ideal-int +pkg syscall (freebsd-arm), const BPF_BUFMODE_BUFFER ideal-int +pkg syscall (freebsd-arm), const BPF_BUFMODE_ZBUF ideal-int +pkg syscall (freebsd-arm), const BPF_DIV ideal-int +pkg syscall (freebsd-arm), const BPF_H ideal-int +pkg syscall (freebsd-arm), const BPF_IMM ideal-int +pkg syscall (freebsd-arm), const BPF_IND ideal-int +pkg syscall (freebsd-arm), const BPF_JA ideal-int +pkg syscall (freebsd-arm), const BPF_JEQ ideal-int +pkg syscall (freebsd-arm), const BPF_JGE ideal-int +pkg syscall (freebsd-arm), const BPF_JGT ideal-int +pkg syscall (freebsd-arm), const BPF_JMP ideal-int +pkg syscall (freebsd-arm), const BPF_JSET ideal-int +pkg syscall (freebsd-arm), const BPF_K ideal-int +pkg syscall (freebsd-arm), const BPF_LD ideal-int +pkg syscall (freebsd-arm), const BPF_LDX ideal-int +pkg syscall (freebsd-arm), const BPF_LEN ideal-int +pkg syscall (freebsd-arm), const BPF_LSH ideal-int +pkg syscall (freebsd-arm), const BPF_MAJOR_VERSION ideal-int +pkg syscall (freebsd-arm), const BPF_MAXBUFSIZE ideal-int +pkg syscall (freebsd-arm), const BPF_MAXINSNS ideal-int +pkg syscall (freebsd-arm), const BPF_MEM ideal-int +pkg syscall (freebsd-arm), const BPF_MEMWORDS ideal-int +pkg syscall (freebsd-arm), const BPF_MINBUFSIZE ideal-int +pkg syscall (freebsd-arm), const BPF_MINOR_VERSION ideal-int +pkg syscall (freebsd-arm), const BPF_MISC ideal-int +pkg syscall (freebsd-arm), const BPF_MSH ideal-int +pkg syscall (freebsd-arm), const BPF_MUL ideal-int +pkg syscall (freebsd-arm), const BPF_NEG ideal-int +pkg syscall (freebsd-arm), const BPF_OR ideal-int +pkg syscall (freebsd-arm), const BPF_RELEASE ideal-int +pkg syscall (freebsd-arm), const BPF_RET ideal-int +pkg syscall (freebsd-arm), const BPF_RSH ideal-int +pkg syscall (freebsd-arm), const BPF_ST ideal-int +pkg syscall (freebsd-arm), const BPF_STX ideal-int +pkg syscall (freebsd-arm), const BPF_SUB ideal-int +pkg syscall (freebsd-arm), const BPF_TAX ideal-int +pkg syscall (freebsd-arm), const BPF_TXA ideal-int +pkg syscall (freebsd-arm), const BPF_T_BINTIME ideal-int +pkg syscall (freebsd-arm), const BPF_T_BINTIME_FAST ideal-int +pkg syscall (freebsd-arm), const BPF_T_BINTIME_MONOTONIC ideal-int +pkg syscall (freebsd-arm), const BPF_T_BINTIME_MONOTONIC_FAST ideal-int +pkg syscall (freebsd-arm), const BPF_T_FAST ideal-int +pkg syscall (freebsd-arm), const BPF_T_FLAG_MASK ideal-int +pkg syscall (freebsd-arm), const BPF_T_FORMAT_MASK ideal-int +pkg syscall (freebsd-arm), const BPF_T_MICROTIME ideal-int +pkg syscall (freebsd-arm), const BPF_T_MICROTIME_FAST ideal-int +pkg syscall (freebsd-arm), const BPF_T_MICROTIME_MONOTONIC ideal-int +pkg syscall (freebsd-arm), const BPF_T_MICROTIME_MONOTONIC_FAST ideal-int +pkg syscall (freebsd-arm), const BPF_T_MONOTONIC ideal-int +pkg syscall (freebsd-arm), const BPF_T_MONOTONIC_FAST ideal-int +pkg syscall (freebsd-arm), const BPF_T_NANOTIME ideal-int +pkg syscall (freebsd-arm), const BPF_T_NANOTIME_FAST ideal-int +pkg syscall (freebsd-arm), const BPF_T_NANOTIME_MONOTONIC ideal-int +pkg syscall (freebsd-arm), const BPF_T_NANOTIME_MONOTONIC_FAST ideal-int +pkg syscall (freebsd-arm), const BPF_T_NONE ideal-int +pkg syscall (freebsd-arm), const BPF_T_NORMAL ideal-int +pkg syscall (freebsd-arm), const BPF_W ideal-int +pkg syscall (freebsd-arm), const BPF_X ideal-int +pkg syscall (freebsd-arm), const BRKINT ideal-int +pkg syscall (freebsd-arm), const CFLUSH ideal-int +pkg syscall (freebsd-arm), const CLOCAL ideal-int +pkg syscall (freebsd-arm), const CREAD ideal-int +pkg syscall (freebsd-arm), const CS5 ideal-int +pkg syscall (freebsd-arm), const CS6 ideal-int +pkg syscall (freebsd-arm), const CS7 ideal-int +pkg syscall (freebsd-arm), const CS8 ideal-int +pkg syscall (freebsd-arm), const CSIZE ideal-int +pkg syscall (freebsd-arm), const CSTART ideal-int +pkg syscall (freebsd-arm), const CSTATUS ideal-int +pkg syscall (freebsd-arm), const CSTOP ideal-int +pkg syscall (freebsd-arm), const CSTOPB ideal-int +pkg syscall (freebsd-arm), const CSUSP ideal-int +pkg syscall (freebsd-arm), const CTL_MAXNAME ideal-int +pkg syscall (freebsd-arm), const CTL_NET ideal-int +pkg syscall (freebsd-arm), const DLT_A429 ideal-int +pkg syscall (freebsd-arm), const DLT_A653_ICM ideal-int +pkg syscall (freebsd-arm), const DLT_AIRONET_HEADER ideal-int +pkg syscall (freebsd-arm), const DLT_AOS ideal-int +pkg syscall (freebsd-arm), const DLT_APPLE_IP_OVER_IEEE1394 ideal-int +pkg syscall (freebsd-arm), const DLT_ARCNET ideal-int +pkg syscall (freebsd-arm), const DLT_ARCNET_LINUX ideal-int +pkg syscall (freebsd-arm), const DLT_ATM_CLIP ideal-int +pkg syscall (freebsd-arm), const DLT_ATM_RFC1483 ideal-int +pkg syscall (freebsd-arm), const DLT_AURORA ideal-int +pkg syscall (freebsd-arm), const DLT_AX25 ideal-int +pkg syscall (freebsd-arm), const DLT_AX25_KISS ideal-int +pkg syscall (freebsd-arm), const DLT_BACNET_MS_TP ideal-int +pkg syscall (freebsd-arm), const DLT_BLUETOOTH_HCI_H4 ideal-int +pkg syscall (freebsd-arm), const DLT_BLUETOOTH_HCI_H4_WITH_PHDR ideal-int +pkg syscall (freebsd-arm), const DLT_CAN20B ideal-int +pkg syscall (freebsd-arm), const DLT_CAN_SOCKETCAN ideal-int +pkg syscall (freebsd-arm), const DLT_CHAOS ideal-int +pkg syscall (freebsd-arm), const DLT_CHDLC ideal-int +pkg syscall (freebsd-arm), const DLT_CISCO_IOS ideal-int +pkg syscall (freebsd-arm), const DLT_C_HDLC ideal-int +pkg syscall (freebsd-arm), const DLT_C_HDLC_WITH_DIR ideal-int +pkg syscall (freebsd-arm), const DLT_DBUS ideal-int +pkg syscall (freebsd-arm), const DLT_DECT ideal-int +pkg syscall (freebsd-arm), const DLT_DOCSIS ideal-int +pkg syscall (freebsd-arm), const DLT_DVB_CI ideal-int +pkg syscall (freebsd-arm), const DLT_ECONET ideal-int +pkg syscall (freebsd-arm), const DLT_EN10MB ideal-int +pkg syscall (freebsd-arm), const DLT_EN3MB ideal-int +pkg syscall (freebsd-arm), const DLT_ENC ideal-int +pkg syscall (freebsd-arm), const DLT_ERF ideal-int +pkg syscall (freebsd-arm), const DLT_ERF_ETH ideal-int +pkg syscall (freebsd-arm), const DLT_ERF_POS ideal-int +pkg syscall (freebsd-arm), const DLT_FC_2 ideal-int +pkg syscall (freebsd-arm), const DLT_FC_2_WITH_FRAME_DELIMS ideal-int +pkg syscall (freebsd-arm), const DLT_FDDI ideal-int +pkg syscall (freebsd-arm), const DLT_FLEXRAY ideal-int +pkg syscall (freebsd-arm), const DLT_FRELAY ideal-int +pkg syscall (freebsd-arm), const DLT_FRELAY_WITH_DIR ideal-int +pkg syscall (freebsd-arm), const DLT_GCOM_SERIAL ideal-int +pkg syscall (freebsd-arm), const DLT_GCOM_T1E1 ideal-int +pkg syscall (freebsd-arm), const DLT_GPF_F ideal-int +pkg syscall (freebsd-arm), const DLT_GPF_T ideal-int +pkg syscall (freebsd-arm), const DLT_GPRS_LLC ideal-int +pkg syscall (freebsd-arm), const DLT_GSMTAP_ABIS ideal-int +pkg syscall (freebsd-arm), const DLT_GSMTAP_UM ideal-int +pkg syscall (freebsd-arm), const DLT_HHDLC ideal-int +pkg syscall (freebsd-arm), const DLT_IBM_SN ideal-int +pkg syscall (freebsd-arm), const DLT_IBM_SP ideal-int +pkg syscall (freebsd-arm), const DLT_IEEE802 ideal-int +pkg syscall (freebsd-arm), const DLT_IEEE802_11 ideal-int +pkg syscall (freebsd-arm), const DLT_IEEE802_11_RADIO ideal-int +pkg syscall (freebsd-arm), const DLT_IEEE802_11_RADIO_AVS ideal-int +pkg syscall (freebsd-arm), const DLT_IEEE802_15_4 ideal-int +pkg syscall (freebsd-arm), const DLT_IEEE802_15_4_LINUX ideal-int +pkg syscall (freebsd-arm), const DLT_IEEE802_15_4_NOFCS ideal-int +pkg syscall (freebsd-arm), const DLT_IEEE802_15_4_NONASK_PHY ideal-int +pkg syscall (freebsd-arm), const DLT_IEEE802_16_MAC_CPS ideal-int +pkg syscall (freebsd-arm), const DLT_IEEE802_16_MAC_CPS_RADIO ideal-int +pkg syscall (freebsd-arm), const DLT_IPFILTER ideal-int +pkg syscall (freebsd-arm), const DLT_IPMB ideal-int +pkg syscall (freebsd-arm), const DLT_IPMB_LINUX ideal-int +pkg syscall (freebsd-arm), const DLT_IPNET ideal-int +pkg syscall (freebsd-arm), const DLT_IPOIB ideal-int +pkg syscall (freebsd-arm), const DLT_IPV4 ideal-int +pkg syscall (freebsd-arm), const DLT_IPV6 ideal-int +pkg syscall (freebsd-arm), const DLT_IP_OVER_FC ideal-int +pkg syscall (freebsd-arm), const DLT_JUNIPER_ATM1 ideal-int +pkg syscall (freebsd-arm), const DLT_JUNIPER_ATM2 ideal-int +pkg syscall (freebsd-arm), const DLT_JUNIPER_ATM_CEMIC ideal-int +pkg syscall (freebsd-arm), const DLT_JUNIPER_CHDLC ideal-int +pkg syscall (freebsd-arm), const DLT_JUNIPER_ES ideal-int +pkg syscall (freebsd-arm), const DLT_JUNIPER_ETHER ideal-int +pkg syscall (freebsd-arm), const DLT_JUNIPER_FIBRECHANNEL ideal-int +pkg syscall (freebsd-arm), const DLT_JUNIPER_FRELAY ideal-int +pkg syscall (freebsd-arm), const DLT_JUNIPER_GGSN ideal-int +pkg syscall (freebsd-arm), const DLT_JUNIPER_ISM ideal-int +pkg syscall (freebsd-arm), const DLT_JUNIPER_MFR ideal-int +pkg syscall (freebsd-arm), const DLT_JUNIPER_MLFR ideal-int +pkg syscall (freebsd-arm), const DLT_JUNIPER_MLPPP ideal-int +pkg syscall (freebsd-arm), const DLT_JUNIPER_MONITOR ideal-int +pkg syscall (freebsd-arm), const DLT_JUNIPER_PIC_PEER ideal-int +pkg syscall (freebsd-arm), const DLT_JUNIPER_PPP ideal-int +pkg syscall (freebsd-arm), const DLT_JUNIPER_PPPOE ideal-int +pkg syscall (freebsd-arm), const DLT_JUNIPER_PPPOE_ATM ideal-int +pkg syscall (freebsd-arm), const DLT_JUNIPER_SERVICES ideal-int +pkg syscall (freebsd-arm), const DLT_JUNIPER_SRX_E2E ideal-int +pkg syscall (freebsd-arm), const DLT_JUNIPER_ST ideal-int +pkg syscall (freebsd-arm), const DLT_JUNIPER_VP ideal-int +pkg syscall (freebsd-arm), const DLT_JUNIPER_VS ideal-int +pkg syscall (freebsd-arm), const DLT_LAPB_WITH_DIR ideal-int +pkg syscall (freebsd-arm), const DLT_LAPD ideal-int +pkg syscall (freebsd-arm), const DLT_LIN ideal-int +pkg syscall (freebsd-arm), const DLT_LINUX_EVDEV ideal-int +pkg syscall (freebsd-arm), const DLT_LINUX_IRDA ideal-int +pkg syscall (freebsd-arm), const DLT_LINUX_LAPD ideal-int +pkg syscall (freebsd-arm), const DLT_LINUX_PPP_WITHDIRECTION ideal-int +pkg syscall (freebsd-arm), const DLT_LINUX_SLL ideal-int +pkg syscall (freebsd-arm), const DLT_LOOP ideal-int +pkg syscall (freebsd-arm), const DLT_LTALK ideal-int +pkg syscall (freebsd-arm), const DLT_MATCHING_MAX ideal-int +pkg syscall (freebsd-arm), const DLT_MATCHING_MIN ideal-int +pkg syscall (freebsd-arm), const DLT_MFR ideal-int +pkg syscall (freebsd-arm), const DLT_MOST ideal-int +pkg syscall (freebsd-arm), const DLT_MPEG_2_TS ideal-int +pkg syscall (freebsd-arm), const DLT_MPLS ideal-int +pkg syscall (freebsd-arm), const DLT_MTP2 ideal-int +pkg syscall (freebsd-arm), const DLT_MTP2_WITH_PHDR ideal-int +pkg syscall (freebsd-arm), const DLT_MTP3 ideal-int +pkg syscall (freebsd-arm), const DLT_MUX27010 ideal-int +pkg syscall (freebsd-arm), const DLT_NETANALYZER ideal-int +pkg syscall (freebsd-arm), const DLT_NETANALYZER_TRANSPARENT ideal-int +pkg syscall (freebsd-arm), const DLT_NFC_LLCP ideal-int +pkg syscall (freebsd-arm), const DLT_NFLOG ideal-int +pkg syscall (freebsd-arm), const DLT_NG40 ideal-int +pkg syscall (freebsd-arm), const DLT_NULL ideal-int +pkg syscall (freebsd-arm), const DLT_PCI_EXP ideal-int +pkg syscall (freebsd-arm), const DLT_PFLOG ideal-int +pkg syscall (freebsd-arm), const DLT_PFSYNC ideal-int +pkg syscall (freebsd-arm), const DLT_PPI ideal-int +pkg syscall (freebsd-arm), const DLT_PPP ideal-int +pkg syscall (freebsd-arm), const DLT_PPP_BSDOS ideal-int +pkg syscall (freebsd-arm), const DLT_PPP_ETHER ideal-int +pkg syscall (freebsd-arm), const DLT_PPP_PPPD ideal-int +pkg syscall (freebsd-arm), const DLT_PPP_SERIAL ideal-int +pkg syscall (freebsd-arm), const DLT_PPP_WITH_DIR ideal-int +pkg syscall (freebsd-arm), const DLT_PPP_WITH_DIRECTION ideal-int +pkg syscall (freebsd-arm), const DLT_PRISM_HEADER ideal-int +pkg syscall (freebsd-arm), const DLT_PRONET ideal-int +pkg syscall (freebsd-arm), const DLT_RAIF1 ideal-int +pkg syscall (freebsd-arm), const DLT_RAW ideal-int +pkg syscall (freebsd-arm), const DLT_RIO ideal-int +pkg syscall (freebsd-arm), const DLT_SCCP ideal-int +pkg syscall (freebsd-arm), const DLT_SITA ideal-int +pkg syscall (freebsd-arm), const DLT_SLIP ideal-int +pkg syscall (freebsd-arm), const DLT_SLIP_BSDOS ideal-int +pkg syscall (freebsd-arm), const DLT_STANAG_5066_D_PDU ideal-int +pkg syscall (freebsd-arm), const DLT_SUNATM ideal-int +pkg syscall (freebsd-arm), const DLT_SYMANTEC_FIREWALL ideal-int +pkg syscall (freebsd-arm), const DLT_TZSP ideal-int +pkg syscall (freebsd-arm), const DLT_USB ideal-int +pkg syscall (freebsd-arm), const DLT_USB_LINUX ideal-int +pkg syscall (freebsd-arm), const DLT_USB_LINUX_MMAPPED ideal-int +pkg syscall (freebsd-arm), const DLT_USER0 ideal-int +pkg syscall (freebsd-arm), const DLT_USER1 ideal-int +pkg syscall (freebsd-arm), const DLT_USER10 ideal-int +pkg syscall (freebsd-arm), const DLT_USER11 ideal-int +pkg syscall (freebsd-arm), const DLT_USER12 ideal-int +pkg syscall (freebsd-arm), const DLT_USER13 ideal-int +pkg syscall (freebsd-arm), const DLT_USER14 ideal-int +pkg syscall (freebsd-arm), const DLT_USER15 ideal-int +pkg syscall (freebsd-arm), const DLT_USER2 ideal-int +pkg syscall (freebsd-arm), const DLT_USER3 ideal-int +pkg syscall (freebsd-arm), const DLT_USER4 ideal-int +pkg syscall (freebsd-arm), const DLT_USER5 ideal-int +pkg syscall (freebsd-arm), const DLT_USER6 ideal-int +pkg syscall (freebsd-arm), const DLT_USER7 ideal-int +pkg syscall (freebsd-arm), const DLT_USER8 ideal-int +pkg syscall (freebsd-arm), const DLT_USER9 ideal-int +pkg syscall (freebsd-arm), const DLT_WIHART ideal-int +pkg syscall (freebsd-arm), const DLT_X2E_SERIAL ideal-int +pkg syscall (freebsd-arm), const DLT_X2E_XORAYA ideal-int +pkg syscall (freebsd-arm), const DT_BLK ideal-int +pkg syscall (freebsd-arm), const DT_CHR ideal-int +pkg syscall (freebsd-arm), const DT_DIR ideal-int +pkg syscall (freebsd-arm), const DT_FIFO ideal-int +pkg syscall (freebsd-arm), const DT_LNK ideal-int +pkg syscall (freebsd-arm), const DT_REG ideal-int +pkg syscall (freebsd-arm), const DT_SOCK ideal-int +pkg syscall (freebsd-arm), const DT_UNKNOWN ideal-int +pkg syscall (freebsd-arm), const DT_WHT ideal-int +pkg syscall (freebsd-arm), const EAUTH Errno +pkg syscall (freebsd-arm), const EBADMSG Errno +pkg syscall (freebsd-arm), const EBADRPC Errno +pkg syscall (freebsd-arm), const ECAPMODE Errno +pkg syscall (freebsd-arm), const ECHO ideal-int +pkg syscall (freebsd-arm), const ECHOCTL ideal-int +pkg syscall (freebsd-arm), const ECHOE ideal-int +pkg syscall (freebsd-arm), const ECHOK ideal-int +pkg syscall (freebsd-arm), const ECHOKE ideal-int +pkg syscall (freebsd-arm), const ECHONL ideal-int +pkg syscall (freebsd-arm), const ECHOPRT ideal-int +pkg syscall (freebsd-arm), const EDOOFUS Errno +pkg syscall (freebsd-arm), const EFTYPE Errno +pkg syscall (freebsd-arm), const ELAST Errno +pkg syscall (freebsd-arm), const EMULTIHOP Errno +pkg syscall (freebsd-arm), const ENEEDAUTH Errno +pkg syscall (freebsd-arm), const ENOATTR Errno +pkg syscall (freebsd-arm), const ENOLINK Errno +pkg syscall (freebsd-arm), const ENOTCAPABLE Errno +pkg syscall (freebsd-arm), const EPROCLIM Errno +pkg syscall (freebsd-arm), const EPROCUNAVAIL Errno +pkg syscall (freebsd-arm), const EPROGMISMATCH Errno +pkg syscall (freebsd-arm), const EPROGUNAVAIL Errno +pkg syscall (freebsd-arm), const EPROTO Errno +pkg syscall (freebsd-arm), const ERPCMISMATCH Errno +pkg syscall (freebsd-arm), const EVFILT_AIO ideal-int +pkg syscall (freebsd-arm), const EVFILT_FS ideal-int +pkg syscall (freebsd-arm), const EVFILT_LIO ideal-int +pkg syscall (freebsd-arm), const EVFILT_PROC ideal-int +pkg syscall (freebsd-arm), const EVFILT_READ ideal-int +pkg syscall (freebsd-arm), const EVFILT_SIGNAL ideal-int +pkg syscall (freebsd-arm), const EVFILT_SYSCOUNT ideal-int +pkg syscall (freebsd-arm), const EVFILT_TIMER ideal-int +pkg syscall (freebsd-arm), const EVFILT_USER ideal-int +pkg syscall (freebsd-arm), const EVFILT_VNODE ideal-int +pkg syscall (freebsd-arm), const EVFILT_WRITE ideal-int +pkg syscall (freebsd-arm), const EV_ADD ideal-int +pkg syscall (freebsd-arm), const EV_CLEAR ideal-int +pkg syscall (freebsd-arm), const EV_DELETE ideal-int +pkg syscall (freebsd-arm), const EV_DISABLE ideal-int +pkg syscall (freebsd-arm), const EV_DISPATCH ideal-int +pkg syscall (freebsd-arm), const EV_ENABLE ideal-int +pkg syscall (freebsd-arm), const EV_EOF ideal-int +pkg syscall (freebsd-arm), const EV_ERROR ideal-int +pkg syscall (freebsd-arm), const EV_FLAG1 ideal-int +pkg syscall (freebsd-arm), const EV_ONESHOT ideal-int +pkg syscall (freebsd-arm), const EV_RECEIPT ideal-int +pkg syscall (freebsd-arm), const EV_SYSFLAGS ideal-int +pkg syscall (freebsd-arm), const EXTA ideal-int +pkg syscall (freebsd-arm), const EXTB ideal-int +pkg syscall (freebsd-arm), const EXTPROC ideal-int +pkg syscall (freebsd-arm), const FD_CLOEXEC ideal-int +pkg syscall (freebsd-arm), const FD_SETSIZE ideal-int +pkg syscall (freebsd-arm), const FLUSHO ideal-int +pkg syscall (freebsd-arm), const F_CANCEL ideal-int +pkg syscall (freebsd-arm), const F_DUP2FD ideal-int +pkg syscall (freebsd-arm), const F_DUP2FD_CLOEXEC ideal-int +pkg syscall (freebsd-arm), const F_DUPFD ideal-int +pkg syscall (freebsd-arm), const F_DUPFD_CLOEXEC ideal-int +pkg syscall (freebsd-arm), const F_GETFD ideal-int +pkg syscall (freebsd-arm), const F_GETFL ideal-int +pkg syscall (freebsd-arm), const F_GETLK ideal-int +pkg syscall (freebsd-arm), const F_GETOWN ideal-int +pkg syscall (freebsd-arm), const F_OGETLK ideal-int +pkg syscall (freebsd-arm), const F_OK ideal-int +pkg syscall (freebsd-arm), const F_OSETLK ideal-int +pkg syscall (freebsd-arm), const F_OSETLKW ideal-int +pkg syscall (freebsd-arm), const F_RDAHEAD ideal-int +pkg syscall (freebsd-arm), const F_RDLCK ideal-int +pkg syscall (freebsd-arm), const F_READAHEAD ideal-int +pkg syscall (freebsd-arm), const F_SETFD ideal-int +pkg syscall (freebsd-arm), const F_SETFL ideal-int +pkg syscall (freebsd-arm), const F_SETLK ideal-int +pkg syscall (freebsd-arm), const F_SETLKW ideal-int +pkg syscall (freebsd-arm), const F_SETLK_REMOTE ideal-int +pkg syscall (freebsd-arm), const F_SETOWN ideal-int +pkg syscall (freebsd-arm), const F_UNLCK ideal-int +pkg syscall (freebsd-arm), const F_UNLCKSYS ideal-int +pkg syscall (freebsd-arm), const F_WRLCK ideal-int +pkg syscall (freebsd-arm), const HUPCL ideal-int +pkg syscall (freebsd-arm), const ICANON ideal-int +pkg syscall (freebsd-arm), const ICMP6_FILTER = 18 +pkg syscall (freebsd-arm), const ICMP6_FILTER ideal-int +pkg syscall (freebsd-arm), const ICRNL ideal-int +pkg syscall (freebsd-arm), const IEXTEN ideal-int +pkg syscall (freebsd-arm), const IFAN_ARRIVAL ideal-int +pkg syscall (freebsd-arm), const IFAN_DEPARTURE ideal-int +pkg syscall (freebsd-arm), const IFF_ALLMULTI ideal-int +pkg syscall (freebsd-arm), const IFF_ALTPHYS ideal-int +pkg syscall (freebsd-arm), const IFF_CANTCHANGE ideal-int +pkg syscall (freebsd-arm), const IFF_CANTCONFIG ideal-int +pkg syscall (freebsd-arm), const IFF_DEBUG ideal-int +pkg syscall (freebsd-arm), const IFF_DRV_OACTIVE ideal-int +pkg syscall (freebsd-arm), const IFF_DRV_RUNNING ideal-int +pkg syscall (freebsd-arm), const IFF_DYING ideal-int +pkg syscall (freebsd-arm), const IFF_LINK0 ideal-int +pkg syscall (freebsd-arm), const IFF_LINK1 ideal-int +pkg syscall (freebsd-arm), const IFF_LINK2 ideal-int +pkg syscall (freebsd-arm), const IFF_MONITOR ideal-int +pkg syscall (freebsd-arm), const IFF_NOARP ideal-int +pkg syscall (freebsd-arm), const IFF_OACTIVE ideal-int +pkg syscall (freebsd-arm), const IFF_POINTOPOINT ideal-int +pkg syscall (freebsd-arm), const IFF_PPROMISC ideal-int +pkg syscall (freebsd-arm), const IFF_PROMISC ideal-int +pkg syscall (freebsd-arm), const IFF_RENAMING ideal-int +pkg syscall (freebsd-arm), const IFF_RUNNING ideal-int +pkg syscall (freebsd-arm), const IFF_SIMPLEX ideal-int +pkg syscall (freebsd-arm), const IFF_SMART ideal-int +pkg syscall (freebsd-arm), const IFF_STATICARP ideal-int +pkg syscall (freebsd-arm), const IFNAMSIZ ideal-int +pkg syscall (freebsd-arm), const IFT_1822 ideal-int +pkg syscall (freebsd-arm), const IFT_A12MPPSWITCH ideal-int +pkg syscall (freebsd-arm), const IFT_AAL2 ideal-int +pkg syscall (freebsd-arm), const IFT_AAL5 ideal-int +pkg syscall (freebsd-arm), const IFT_ADSL ideal-int +pkg syscall (freebsd-arm), const IFT_AFLANE8023 ideal-int +pkg syscall (freebsd-arm), const IFT_AFLANE8025 ideal-int +pkg syscall (freebsd-arm), const IFT_ARAP ideal-int +pkg syscall (freebsd-arm), const IFT_ARCNET ideal-int +pkg syscall (freebsd-arm), const IFT_ARCNETPLUS ideal-int +pkg syscall (freebsd-arm), const IFT_ASYNC ideal-int +pkg syscall (freebsd-arm), const IFT_ATM ideal-int +pkg syscall (freebsd-arm), const IFT_ATMDXI ideal-int +pkg syscall (freebsd-arm), const IFT_ATMFUNI ideal-int +pkg syscall (freebsd-arm), const IFT_ATMIMA ideal-int +pkg syscall (freebsd-arm), const IFT_ATMLOGICAL ideal-int +pkg syscall (freebsd-arm), const IFT_ATMRADIO ideal-int +pkg syscall (freebsd-arm), const IFT_ATMSUBINTERFACE ideal-int +pkg syscall (freebsd-arm), const IFT_ATMVCIENDPT ideal-int +pkg syscall (freebsd-arm), const IFT_ATMVIRTUAL ideal-int +pkg syscall (freebsd-arm), const IFT_BGPPOLICYACCOUNTING ideal-int +pkg syscall (freebsd-arm), const IFT_BRIDGE ideal-int +pkg syscall (freebsd-arm), const IFT_BSC ideal-int +pkg syscall (freebsd-arm), const IFT_CCTEMUL ideal-int +pkg syscall (freebsd-arm), const IFT_CEPT ideal-int +pkg syscall (freebsd-arm), const IFT_CES ideal-int +pkg syscall (freebsd-arm), const IFT_CHANNEL ideal-int +pkg syscall (freebsd-arm), const IFT_CNR ideal-int +pkg syscall (freebsd-arm), const IFT_COFFEE ideal-int +pkg syscall (freebsd-arm), const IFT_COMPOSITELINK ideal-int +pkg syscall (freebsd-arm), const IFT_DCN ideal-int +pkg syscall (freebsd-arm), const IFT_DIGITALPOWERLINE ideal-int +pkg syscall (freebsd-arm), const IFT_DIGITALWRAPPEROVERHEADCHANNEL ideal-int +pkg syscall (freebsd-arm), const IFT_DLSW ideal-int +pkg syscall (freebsd-arm), const IFT_DOCSCABLEDOWNSTREAM ideal-int +pkg syscall (freebsd-arm), const IFT_DOCSCABLEMACLAYER ideal-int +pkg syscall (freebsd-arm), const IFT_DOCSCABLEUPSTREAM ideal-int +pkg syscall (freebsd-arm), const IFT_DS0 ideal-int +pkg syscall (freebsd-arm), const IFT_DS0BUNDLE ideal-int +pkg syscall (freebsd-arm), const IFT_DS1FDL ideal-int +pkg syscall (freebsd-arm), const IFT_DS3 ideal-int +pkg syscall (freebsd-arm), const IFT_DTM ideal-int +pkg syscall (freebsd-arm), const IFT_DVBASILN ideal-int +pkg syscall (freebsd-arm), const IFT_DVBASIOUT ideal-int +pkg syscall (freebsd-arm), const IFT_DVBRCCDOWNSTREAM ideal-int +pkg syscall (freebsd-arm), const IFT_DVBRCCMACLAYER ideal-int +pkg syscall (freebsd-arm), const IFT_DVBRCCUPSTREAM ideal-int +pkg syscall (freebsd-arm), const IFT_ENC ideal-int +pkg syscall (freebsd-arm), const IFT_EON ideal-int +pkg syscall (freebsd-arm), const IFT_EPLRS ideal-int +pkg syscall (freebsd-arm), const IFT_ESCON ideal-int +pkg syscall (freebsd-arm), const IFT_ETHER ideal-int +pkg syscall (freebsd-arm), const IFT_FAITH ideal-int +pkg syscall (freebsd-arm), const IFT_FAST ideal-int +pkg syscall (freebsd-arm), const IFT_FASTETHER ideal-int +pkg syscall (freebsd-arm), const IFT_FASTETHERFX ideal-int +pkg syscall (freebsd-arm), const IFT_FDDI ideal-int +pkg syscall (freebsd-arm), const IFT_FIBRECHANNEL ideal-int +pkg syscall (freebsd-arm), const IFT_FRAMERELAYINTERCONNECT ideal-int +pkg syscall (freebsd-arm), const IFT_FRAMERELAYMPI ideal-int +pkg syscall (freebsd-arm), const IFT_FRDLCIENDPT ideal-int +pkg syscall (freebsd-arm), const IFT_FRELAY ideal-int +pkg syscall (freebsd-arm), const IFT_FRELAYDCE ideal-int +pkg syscall (freebsd-arm), const IFT_FRF16MFRBUNDLE ideal-int +pkg syscall (freebsd-arm), const IFT_FRFORWARD ideal-int +pkg syscall (freebsd-arm), const IFT_G703AT2MB ideal-int +pkg syscall (freebsd-arm), const IFT_G703AT64K ideal-int +pkg syscall (freebsd-arm), const IFT_GIF ideal-int +pkg syscall (freebsd-arm), const IFT_GIGABITETHERNET ideal-int +pkg syscall (freebsd-arm), const IFT_GR303IDT ideal-int +pkg syscall (freebsd-arm), const IFT_GR303RDT ideal-int +pkg syscall (freebsd-arm), const IFT_H323GATEKEEPER ideal-int +pkg syscall (freebsd-arm), const IFT_H323PROXY ideal-int +pkg syscall (freebsd-arm), const IFT_HDH1822 ideal-int +pkg syscall (freebsd-arm), const IFT_HDLC ideal-int +pkg syscall (freebsd-arm), const IFT_HDSL2 ideal-int +pkg syscall (freebsd-arm), const IFT_HIPERLAN2 ideal-int +pkg syscall (freebsd-arm), const IFT_HIPPI ideal-int +pkg syscall (freebsd-arm), const IFT_HIPPIINTERFACE ideal-int +pkg syscall (freebsd-arm), const IFT_HOSTPAD ideal-int +pkg syscall (freebsd-arm), const IFT_HSSI ideal-int +pkg syscall (freebsd-arm), const IFT_HY ideal-int +pkg syscall (freebsd-arm), const IFT_IBM370PARCHAN ideal-int +pkg syscall (freebsd-arm), const IFT_IDSL ideal-int +pkg syscall (freebsd-arm), const IFT_IEEE1394 ideal-int +pkg syscall (freebsd-arm), const IFT_IEEE80211 ideal-int +pkg syscall (freebsd-arm), const IFT_IEEE80212 ideal-int +pkg syscall (freebsd-arm), const IFT_IEEE8023ADLAG ideal-int +pkg syscall (freebsd-arm), const IFT_IFGSN ideal-int +pkg syscall (freebsd-arm), const IFT_IMT ideal-int +pkg syscall (freebsd-arm), const IFT_INFINIBAND ideal-int +pkg syscall (freebsd-arm), const IFT_INTERLEAVE ideal-int +pkg syscall (freebsd-arm), const IFT_IP ideal-int +pkg syscall (freebsd-arm), const IFT_IPFORWARD ideal-int +pkg syscall (freebsd-arm), const IFT_IPOVERATM ideal-int +pkg syscall (freebsd-arm), const IFT_IPOVERCDLC ideal-int +pkg syscall (freebsd-arm), const IFT_IPOVERCLAW ideal-int +pkg syscall (freebsd-arm), const IFT_IPSWITCH ideal-int +pkg syscall (freebsd-arm), const IFT_IPXIP ideal-int +pkg syscall (freebsd-arm), const IFT_ISDN ideal-int +pkg syscall (freebsd-arm), const IFT_ISDNBASIC ideal-int +pkg syscall (freebsd-arm), const IFT_ISDNPRIMARY ideal-int +pkg syscall (freebsd-arm), const IFT_ISDNS ideal-int +pkg syscall (freebsd-arm), const IFT_ISDNU ideal-int +pkg syscall (freebsd-arm), const IFT_ISO88022LLC ideal-int +pkg syscall (freebsd-arm), const IFT_ISO88023 ideal-int +pkg syscall (freebsd-arm), const IFT_ISO88024 ideal-int +pkg syscall (freebsd-arm), const IFT_ISO88025 ideal-int +pkg syscall (freebsd-arm), const IFT_ISO88025CRFPINT ideal-int +pkg syscall (freebsd-arm), const IFT_ISO88025DTR ideal-int +pkg syscall (freebsd-arm), const IFT_ISO88025FIBER ideal-int +pkg syscall (freebsd-arm), const IFT_ISO88026 ideal-int +pkg syscall (freebsd-arm), const IFT_ISUP ideal-int +pkg syscall (freebsd-arm), const IFT_L2VLAN ideal-int +pkg syscall (freebsd-arm), const IFT_L3IPVLAN ideal-int +pkg syscall (freebsd-arm), const IFT_L3IPXVLAN ideal-int +pkg syscall (freebsd-arm), const IFT_LAPB ideal-int +pkg syscall (freebsd-arm), const IFT_LAPD ideal-int +pkg syscall (freebsd-arm), const IFT_LAPF ideal-int +pkg syscall (freebsd-arm), const IFT_LOCALTALK ideal-int +pkg syscall (freebsd-arm), const IFT_LOOP ideal-int +pkg syscall (freebsd-arm), const IFT_MEDIAMAILOVERIP ideal-int +pkg syscall (freebsd-arm), const IFT_MFSIGLINK ideal-int +pkg syscall (freebsd-arm), const IFT_MIOX25 ideal-int +pkg syscall (freebsd-arm), const IFT_MODEM ideal-int +pkg syscall (freebsd-arm), const IFT_MPC ideal-int +pkg syscall (freebsd-arm), const IFT_MPLS ideal-int +pkg syscall (freebsd-arm), const IFT_MPLSTUNNEL ideal-int +pkg syscall (freebsd-arm), const IFT_MSDSL ideal-int +pkg syscall (freebsd-arm), const IFT_MVL ideal-int +pkg syscall (freebsd-arm), const IFT_MYRINET ideal-int +pkg syscall (freebsd-arm), const IFT_NFAS ideal-int +pkg syscall (freebsd-arm), const IFT_NSIP ideal-int +pkg syscall (freebsd-arm), const IFT_OPTICALCHANNEL ideal-int +pkg syscall (freebsd-arm), const IFT_OPTICALTRANSPORT ideal-int +pkg syscall (freebsd-arm), const IFT_OTHER ideal-int +pkg syscall (freebsd-arm), const IFT_P10 ideal-int +pkg syscall (freebsd-arm), const IFT_P80 ideal-int +pkg syscall (freebsd-arm), const IFT_PARA ideal-int +pkg syscall (freebsd-arm), const IFT_PFLOG ideal-int +pkg syscall (freebsd-arm), const IFT_PFSYNC ideal-int +pkg syscall (freebsd-arm), const IFT_PLC ideal-int +pkg syscall (freebsd-arm), const IFT_POS ideal-int +pkg syscall (freebsd-arm), const IFT_PPP ideal-int +pkg syscall (freebsd-arm), const IFT_PPPMULTILINKBUNDLE ideal-int +pkg syscall (freebsd-arm), const IFT_PROPBWAP2MP ideal-int +pkg syscall (freebsd-arm), const IFT_PROPCNLS ideal-int +pkg syscall (freebsd-arm), const IFT_PROPDOCSWIRELESSDOWNSTREAM ideal-int +pkg syscall (freebsd-arm), const IFT_PROPDOCSWIRELESSMACLAYER ideal-int +pkg syscall (freebsd-arm), const IFT_PROPDOCSWIRELESSUPSTREAM ideal-int +pkg syscall (freebsd-arm), const IFT_PROPMUX ideal-int +pkg syscall (freebsd-arm), const IFT_PROPVIRTUAL ideal-int +pkg syscall (freebsd-arm), const IFT_PROPWIRELESSP2P ideal-int +pkg syscall (freebsd-arm), const IFT_PTPSERIAL ideal-int +pkg syscall (freebsd-arm), const IFT_PVC ideal-int +pkg syscall (freebsd-arm), const IFT_QLLC ideal-int +pkg syscall (freebsd-arm), const IFT_RADIOMAC ideal-int +pkg syscall (freebsd-arm), const IFT_RADSL ideal-int +pkg syscall (freebsd-arm), const IFT_REACHDSL ideal-int +pkg syscall (freebsd-arm), const IFT_RFC1483 ideal-int +pkg syscall (freebsd-arm), const IFT_RS232 ideal-int +pkg syscall (freebsd-arm), const IFT_RSRB ideal-int +pkg syscall (freebsd-arm), const IFT_SDLC ideal-int +pkg syscall (freebsd-arm), const IFT_SDSL ideal-int +pkg syscall (freebsd-arm), const IFT_SHDSL ideal-int +pkg syscall (freebsd-arm), const IFT_SIP ideal-int +pkg syscall (freebsd-arm), const IFT_SLIP ideal-int +pkg syscall (freebsd-arm), const IFT_SMDSDXI ideal-int +pkg syscall (freebsd-arm), const IFT_SMDSICIP ideal-int +pkg syscall (freebsd-arm), const IFT_SONET ideal-int +pkg syscall (freebsd-arm), const IFT_SONETOVERHEADCHANNEL ideal-int +pkg syscall (freebsd-arm), const IFT_SONETPATH ideal-int +pkg syscall (freebsd-arm), const IFT_SONETVT ideal-int +pkg syscall (freebsd-arm), const IFT_SRP ideal-int +pkg syscall (freebsd-arm), const IFT_SS7SIGLINK ideal-int +pkg syscall (freebsd-arm), const IFT_STACKTOSTACK ideal-int +pkg syscall (freebsd-arm), const IFT_STARLAN ideal-int +pkg syscall (freebsd-arm), const IFT_STF ideal-int +pkg syscall (freebsd-arm), const IFT_T1 ideal-int +pkg syscall (freebsd-arm), const IFT_TDLC ideal-int +pkg syscall (freebsd-arm), const IFT_TERMPAD ideal-int +pkg syscall (freebsd-arm), const IFT_TR008 ideal-int +pkg syscall (freebsd-arm), const IFT_TRANSPHDLC ideal-int +pkg syscall (freebsd-arm), const IFT_TUNNEL ideal-int +pkg syscall (freebsd-arm), const IFT_ULTRA ideal-int +pkg syscall (freebsd-arm), const IFT_USB ideal-int +pkg syscall (freebsd-arm), const IFT_V11 ideal-int +pkg syscall (freebsd-arm), const IFT_V35 ideal-int +pkg syscall (freebsd-arm), const IFT_V36 ideal-int +pkg syscall (freebsd-arm), const IFT_V37 ideal-int +pkg syscall (freebsd-arm), const IFT_VDSL ideal-int +pkg syscall (freebsd-arm), const IFT_VIRTUALIPADDRESS ideal-int +pkg syscall (freebsd-arm), const IFT_VOICEEM ideal-int +pkg syscall (freebsd-arm), const IFT_VOICEENCAP ideal-int +pkg syscall (freebsd-arm), const IFT_VOICEFXO ideal-int +pkg syscall (freebsd-arm), const IFT_VOICEFXS ideal-int +pkg syscall (freebsd-arm), const IFT_VOICEOVERATM ideal-int +pkg syscall (freebsd-arm), const IFT_VOICEOVERFRAMERELAY ideal-int +pkg syscall (freebsd-arm), const IFT_VOICEOVERIP ideal-int +pkg syscall (freebsd-arm), const IFT_X213 ideal-int +pkg syscall (freebsd-arm), const IFT_X25 ideal-int +pkg syscall (freebsd-arm), const IFT_X25DDN ideal-int +pkg syscall (freebsd-arm), const IFT_X25HUNTGROUP ideal-int +pkg syscall (freebsd-arm), const IFT_X25MLP ideal-int +pkg syscall (freebsd-arm), const IFT_X25PLE ideal-int +pkg syscall (freebsd-arm), const IFT_XETHER ideal-int +pkg syscall (freebsd-arm), const IGNBRK ideal-int +pkg syscall (freebsd-arm), const IGNCR ideal-int +pkg syscall (freebsd-arm), const IGNPAR ideal-int +pkg syscall (freebsd-arm), const IMAXBEL ideal-int +pkg syscall (freebsd-arm), const INLCR ideal-int +pkg syscall (freebsd-arm), const INPCK ideal-int +pkg syscall (freebsd-arm), const IN_CLASSA_HOST ideal-int +pkg syscall (freebsd-arm), const IN_CLASSA_MAX ideal-int +pkg syscall (freebsd-arm), const IN_CLASSA_NET ideal-int +pkg syscall (freebsd-arm), const IN_CLASSA_NSHIFT ideal-int +pkg syscall (freebsd-arm), const IN_CLASSB_HOST ideal-int +pkg syscall (freebsd-arm), const IN_CLASSB_MAX ideal-int +pkg syscall (freebsd-arm), const IN_CLASSB_NET ideal-int +pkg syscall (freebsd-arm), const IN_CLASSB_NSHIFT ideal-int +pkg syscall (freebsd-arm), const IN_CLASSC_HOST ideal-int +pkg syscall (freebsd-arm), const IN_CLASSC_NET ideal-int +pkg syscall (freebsd-arm), const IN_CLASSC_NSHIFT ideal-int +pkg syscall (freebsd-arm), const IN_CLASSD_HOST ideal-int +pkg syscall (freebsd-arm), const IN_CLASSD_NET ideal-int +pkg syscall (freebsd-arm), const IN_CLASSD_NSHIFT ideal-int +pkg syscall (freebsd-arm), const IN_LOOPBACKNET ideal-int +pkg syscall (freebsd-arm), const IN_RFC3021_MASK ideal-int +pkg syscall (freebsd-arm), const IPPROTO_3PC ideal-int +pkg syscall (freebsd-arm), const IPPROTO_ADFS ideal-int +pkg syscall (freebsd-arm), const IPPROTO_AH ideal-int +pkg syscall (freebsd-arm), const IPPROTO_AHIP ideal-int +pkg syscall (freebsd-arm), const IPPROTO_APES ideal-int +pkg syscall (freebsd-arm), const IPPROTO_ARGUS ideal-int +pkg syscall (freebsd-arm), const IPPROTO_AX25 ideal-int +pkg syscall (freebsd-arm), const IPPROTO_BHA ideal-int +pkg syscall (freebsd-arm), const IPPROTO_BLT ideal-int +pkg syscall (freebsd-arm), const IPPROTO_BRSATMON ideal-int +pkg syscall (freebsd-arm), const IPPROTO_CARP ideal-int +pkg syscall (freebsd-arm), const IPPROTO_CFTP ideal-int +pkg syscall (freebsd-arm), const IPPROTO_CHAOS ideal-int +pkg syscall (freebsd-arm), const IPPROTO_CMTP ideal-int +pkg syscall (freebsd-arm), const IPPROTO_CPHB ideal-int +pkg syscall (freebsd-arm), const IPPROTO_CPNX ideal-int +pkg syscall (freebsd-arm), const IPPROTO_DDP ideal-int +pkg syscall (freebsd-arm), const IPPROTO_DGP ideal-int +pkg syscall (freebsd-arm), const IPPROTO_DIVERT ideal-int +pkg syscall (freebsd-arm), const IPPROTO_DONE ideal-int +pkg syscall (freebsd-arm), const IPPROTO_DSTOPTS ideal-int +pkg syscall (freebsd-arm), const IPPROTO_EGP ideal-int +pkg syscall (freebsd-arm), const IPPROTO_EMCON ideal-int +pkg syscall (freebsd-arm), const IPPROTO_ENCAP ideal-int +pkg syscall (freebsd-arm), const IPPROTO_EON ideal-int +pkg syscall (freebsd-arm), const IPPROTO_ESP ideal-int +pkg syscall (freebsd-arm), const IPPROTO_ETHERIP ideal-int +pkg syscall (freebsd-arm), const IPPROTO_FRAGMENT ideal-int +pkg syscall (freebsd-arm), const IPPROTO_GGP ideal-int +pkg syscall (freebsd-arm), const IPPROTO_GMTP ideal-int +pkg syscall (freebsd-arm), const IPPROTO_GRE ideal-int +pkg syscall (freebsd-arm), const IPPROTO_HELLO ideal-int +pkg syscall (freebsd-arm), const IPPROTO_HMP ideal-int +pkg syscall (freebsd-arm), const IPPROTO_HOPOPTS ideal-int +pkg syscall (freebsd-arm), const IPPROTO_ICMP ideal-int +pkg syscall (freebsd-arm), const IPPROTO_ICMPV6 ideal-int +pkg syscall (freebsd-arm), const IPPROTO_IDP ideal-int +pkg syscall (freebsd-arm), const IPPROTO_IDPR ideal-int +pkg syscall (freebsd-arm), const IPPROTO_IDRP ideal-int +pkg syscall (freebsd-arm), const IPPROTO_IGMP ideal-int +pkg syscall (freebsd-arm), const IPPROTO_IGP ideal-int +pkg syscall (freebsd-arm), const IPPROTO_IGRP ideal-int +pkg syscall (freebsd-arm), const IPPROTO_IL ideal-int +pkg syscall (freebsd-arm), const IPPROTO_INLSP ideal-int +pkg syscall (freebsd-arm), const IPPROTO_INP ideal-int +pkg syscall (freebsd-arm), const IPPROTO_IPCOMP ideal-int +pkg syscall (freebsd-arm), const IPPROTO_IPCV ideal-int +pkg syscall (freebsd-arm), const IPPROTO_IPEIP ideal-int +pkg syscall (freebsd-arm), const IPPROTO_IPIP ideal-int +pkg syscall (freebsd-arm), const IPPROTO_IPPC ideal-int +pkg syscall (freebsd-arm), const IPPROTO_IPV4 ideal-int +pkg syscall (freebsd-arm), const IPPROTO_IRTP ideal-int +pkg syscall (freebsd-arm), const IPPROTO_KRYPTOLAN ideal-int +pkg syscall (freebsd-arm), const IPPROTO_LARP ideal-int +pkg syscall (freebsd-arm), const IPPROTO_LEAF1 ideal-int +pkg syscall (freebsd-arm), const IPPROTO_LEAF2 ideal-int +pkg syscall (freebsd-arm), const IPPROTO_MAX ideal-int +pkg syscall (freebsd-arm), const IPPROTO_MAXID ideal-int +pkg syscall (freebsd-arm), const IPPROTO_MEAS ideal-int +pkg syscall (freebsd-arm), const IPPROTO_MH ideal-int +pkg syscall (freebsd-arm), const IPPROTO_MHRP ideal-int +pkg syscall (freebsd-arm), const IPPROTO_MICP ideal-int +pkg syscall (freebsd-arm), const IPPROTO_MOBILE ideal-int +pkg syscall (freebsd-arm), const IPPROTO_MPLS ideal-int +pkg syscall (freebsd-arm), const IPPROTO_MTP ideal-int +pkg syscall (freebsd-arm), const IPPROTO_MUX ideal-int +pkg syscall (freebsd-arm), const IPPROTO_ND ideal-int +pkg syscall (freebsd-arm), const IPPROTO_NHRP ideal-int +pkg syscall (freebsd-arm), const IPPROTO_NONE ideal-int +pkg syscall (freebsd-arm), const IPPROTO_NSP ideal-int +pkg syscall (freebsd-arm), const IPPROTO_NVPII ideal-int +pkg syscall (freebsd-arm), const IPPROTO_OLD_DIVERT ideal-int +pkg syscall (freebsd-arm), const IPPROTO_OSPFIGP ideal-int +pkg syscall (freebsd-arm), const IPPROTO_PFSYNC ideal-int +pkg syscall (freebsd-arm), const IPPROTO_PGM ideal-int +pkg syscall (freebsd-arm), const IPPROTO_PIGP ideal-int +pkg syscall (freebsd-arm), const IPPROTO_PIM ideal-int +pkg syscall (freebsd-arm), const IPPROTO_PRM ideal-int +pkg syscall (freebsd-arm), const IPPROTO_PUP ideal-int +pkg syscall (freebsd-arm), const IPPROTO_PVP ideal-int +pkg syscall (freebsd-arm), const IPPROTO_RAW ideal-int +pkg syscall (freebsd-arm), const IPPROTO_RCCMON ideal-int +pkg syscall (freebsd-arm), const IPPROTO_RDP ideal-int +pkg syscall (freebsd-arm), const IPPROTO_ROUTING ideal-int +pkg syscall (freebsd-arm), const IPPROTO_RSVP ideal-int +pkg syscall (freebsd-arm), const IPPROTO_RVD ideal-int +pkg syscall (freebsd-arm), const IPPROTO_SATEXPAK ideal-int +pkg syscall (freebsd-arm), const IPPROTO_SATMON ideal-int +pkg syscall (freebsd-arm), const IPPROTO_SCCSP ideal-int +pkg syscall (freebsd-arm), const IPPROTO_SCTP ideal-int +pkg syscall (freebsd-arm), const IPPROTO_SDRP ideal-int +pkg syscall (freebsd-arm), const IPPROTO_SEND ideal-int +pkg syscall (freebsd-arm), const IPPROTO_SEP ideal-int +pkg syscall (freebsd-arm), const IPPROTO_SKIP ideal-int +pkg syscall (freebsd-arm), const IPPROTO_SPACER ideal-int +pkg syscall (freebsd-arm), const IPPROTO_SRPC ideal-int +pkg syscall (freebsd-arm), const IPPROTO_ST ideal-int +pkg syscall (freebsd-arm), const IPPROTO_SVMTP ideal-int +pkg syscall (freebsd-arm), const IPPROTO_SWIPE ideal-int +pkg syscall (freebsd-arm), const IPPROTO_TCF ideal-int +pkg syscall (freebsd-arm), const IPPROTO_TLSP ideal-int +pkg syscall (freebsd-arm), const IPPROTO_TP ideal-int +pkg syscall (freebsd-arm), const IPPROTO_TPXX ideal-int +pkg syscall (freebsd-arm), const IPPROTO_TRUNK1 ideal-int +pkg syscall (freebsd-arm), const IPPROTO_TRUNK2 ideal-int +pkg syscall (freebsd-arm), const IPPROTO_TTP ideal-int +pkg syscall (freebsd-arm), const IPPROTO_VINES ideal-int +pkg syscall (freebsd-arm), const IPPROTO_VISA ideal-int +pkg syscall (freebsd-arm), const IPPROTO_VMTP ideal-int +pkg syscall (freebsd-arm), const IPPROTO_WBEXPAK ideal-int +pkg syscall (freebsd-arm), const IPPROTO_WBMON ideal-int +pkg syscall (freebsd-arm), const IPPROTO_WSN ideal-int +pkg syscall (freebsd-arm), const IPPROTO_XNET ideal-int +pkg syscall (freebsd-arm), const IPPROTO_XTP ideal-int +pkg syscall (freebsd-arm), const IPV6_AUTOFLOWLABEL ideal-int +pkg syscall (freebsd-arm), const IPV6_BINDANY ideal-int +pkg syscall (freebsd-arm), const IPV6_BINDV6ONLY ideal-int +pkg syscall (freebsd-arm), const IPV6_CHECKSUM ideal-int +pkg syscall (freebsd-arm), const IPV6_DEFAULT_MULTICAST_HOPS ideal-int +pkg syscall (freebsd-arm), const IPV6_DEFAULT_MULTICAST_LOOP ideal-int +pkg syscall (freebsd-arm), const IPV6_DEFHLIM ideal-int +pkg syscall (freebsd-arm), const IPV6_DONTFRAG ideal-int +pkg syscall (freebsd-arm), const IPV6_DSTOPTS ideal-int +pkg syscall (freebsd-arm), const IPV6_FAITH ideal-int +pkg syscall (freebsd-arm), const IPV6_FLOWINFO_MASK ideal-int +pkg syscall (freebsd-arm), const IPV6_FLOWLABEL_MASK ideal-int +pkg syscall (freebsd-arm), const IPV6_FRAGTTL ideal-int +pkg syscall (freebsd-arm), const IPV6_FW_ADD ideal-int +pkg syscall (freebsd-arm), const IPV6_FW_DEL ideal-int +pkg syscall (freebsd-arm), const IPV6_FW_FLUSH ideal-int +pkg syscall (freebsd-arm), const IPV6_FW_GET ideal-int +pkg syscall (freebsd-arm), const IPV6_FW_ZERO ideal-int +pkg syscall (freebsd-arm), const IPV6_HLIMDEC ideal-int +pkg syscall (freebsd-arm), const IPV6_HOPLIMIT ideal-int +pkg syscall (freebsd-arm), const IPV6_HOPOPTS ideal-int +pkg syscall (freebsd-arm), const IPV6_IPSEC_POLICY ideal-int +pkg syscall (freebsd-arm), const IPV6_MAXHLIM ideal-int +pkg syscall (freebsd-arm), const IPV6_MAXOPTHDR ideal-int +pkg syscall (freebsd-arm), const IPV6_MAXPACKET ideal-int +pkg syscall (freebsd-arm), const IPV6_MAX_GROUP_SRC_FILTER ideal-int +pkg syscall (freebsd-arm), const IPV6_MAX_MEMBERSHIPS ideal-int +pkg syscall (freebsd-arm), const IPV6_MAX_SOCK_SRC_FILTER ideal-int +pkg syscall (freebsd-arm), const IPV6_MIN_MEMBERSHIPS ideal-int +pkg syscall (freebsd-arm), const IPV6_MMTU ideal-int +pkg syscall (freebsd-arm), const IPV6_MSFILTER ideal-int +pkg syscall (freebsd-arm), const IPV6_NEXTHOP ideal-int +pkg syscall (freebsd-arm), const IPV6_PATHMTU ideal-int +pkg syscall (freebsd-arm), const IPV6_PKTINFO ideal-int +pkg syscall (freebsd-arm), const IPV6_PORTRANGE ideal-int +pkg syscall (freebsd-arm), const IPV6_PORTRANGE_DEFAULT ideal-int +pkg syscall (freebsd-arm), const IPV6_PORTRANGE_HIGH ideal-int +pkg syscall (freebsd-arm), const IPV6_PORTRANGE_LOW ideal-int +pkg syscall (freebsd-arm), const IPV6_PREFER_TEMPADDR ideal-int +pkg syscall (freebsd-arm), const IPV6_RECVDSTOPTS ideal-int +pkg syscall (freebsd-arm), const IPV6_RECVHOPLIMIT ideal-int +pkg syscall (freebsd-arm), const IPV6_RECVHOPOPTS ideal-int +pkg syscall (freebsd-arm), const IPV6_RECVPATHMTU ideal-int +pkg syscall (freebsd-arm), const IPV6_RECVPKTINFO ideal-int +pkg syscall (freebsd-arm), const IPV6_RECVRTHDR ideal-int +pkg syscall (freebsd-arm), const IPV6_RECVTCLASS ideal-int +pkg syscall (freebsd-arm), const IPV6_RTHDR ideal-int +pkg syscall (freebsd-arm), const IPV6_RTHDRDSTOPTS ideal-int +pkg syscall (freebsd-arm), const IPV6_RTHDR_LOOSE ideal-int +pkg syscall (freebsd-arm), const IPV6_RTHDR_STRICT ideal-int +pkg syscall (freebsd-arm), const IPV6_RTHDR_TYPE_0 ideal-int +pkg syscall (freebsd-arm), const IPV6_SOCKOPT_RESERVED1 ideal-int +pkg syscall (freebsd-arm), const IPV6_TCLASS ideal-int +pkg syscall (freebsd-arm), const IPV6_USE_MIN_MTU ideal-int +pkg syscall (freebsd-arm), const IPV6_VERSION ideal-int +pkg syscall (freebsd-arm), const IPV6_VERSION_MASK ideal-int +pkg syscall (freebsd-arm), const IP_ADD_SOURCE_MEMBERSHIP ideal-int +pkg syscall (freebsd-arm), const IP_BINDANY ideal-int +pkg syscall (freebsd-arm), const IP_BLOCK_SOURCE ideal-int +pkg syscall (freebsd-arm), const IP_DEFAULT_MULTICAST_LOOP ideal-int +pkg syscall (freebsd-arm), const IP_DEFAULT_MULTICAST_TTL ideal-int +pkg syscall (freebsd-arm), const IP_DF ideal-int +pkg syscall (freebsd-arm), const IP_DONTFRAG ideal-int +pkg syscall (freebsd-arm), const IP_DROP_SOURCE_MEMBERSHIP ideal-int +pkg syscall (freebsd-arm), const IP_DUMMYNET3 ideal-int +pkg syscall (freebsd-arm), const IP_DUMMYNET_CONFIGURE ideal-int +pkg syscall (freebsd-arm), const IP_DUMMYNET_DEL ideal-int +pkg syscall (freebsd-arm), const IP_DUMMYNET_FLUSH ideal-int +pkg syscall (freebsd-arm), const IP_DUMMYNET_GET ideal-int +pkg syscall (freebsd-arm), const IP_FAITH ideal-int +pkg syscall (freebsd-arm), const IP_FW3 ideal-int +pkg syscall (freebsd-arm), const IP_FW_ADD ideal-int +pkg syscall (freebsd-arm), const IP_FW_DEL ideal-int +pkg syscall (freebsd-arm), const IP_FW_FLUSH ideal-int +pkg syscall (freebsd-arm), const IP_FW_GET ideal-int +pkg syscall (freebsd-arm), const IP_FW_NAT_CFG ideal-int +pkg syscall (freebsd-arm), const IP_FW_NAT_DEL ideal-int +pkg syscall (freebsd-arm), const IP_FW_NAT_GET_CONFIG ideal-int +pkg syscall (freebsd-arm), const IP_FW_NAT_GET_LOG ideal-int +pkg syscall (freebsd-arm), const IP_FW_RESETLOG ideal-int +pkg syscall (freebsd-arm), const IP_FW_TABLE_ADD ideal-int +pkg syscall (freebsd-arm), const IP_FW_TABLE_DEL ideal-int +pkg syscall (freebsd-arm), const IP_FW_TABLE_FLUSH ideal-int +pkg syscall (freebsd-arm), const IP_FW_TABLE_GETSIZE ideal-int +pkg syscall (freebsd-arm), const IP_FW_TABLE_LIST ideal-int +pkg syscall (freebsd-arm), const IP_FW_ZERO ideal-int +pkg syscall (freebsd-arm), const IP_HDRINCL ideal-int +pkg syscall (freebsd-arm), const IP_IPSEC_POLICY ideal-int +pkg syscall (freebsd-arm), const IP_MAXPACKET ideal-int +pkg syscall (freebsd-arm), const IP_MAX_GROUP_SRC_FILTER ideal-int +pkg syscall (freebsd-arm), const IP_MAX_MEMBERSHIPS ideal-int +pkg syscall (freebsd-arm), const IP_MAX_SOCK_MUTE_FILTER ideal-int +pkg syscall (freebsd-arm), const IP_MAX_SOCK_SRC_FILTER ideal-int +pkg syscall (freebsd-arm), const IP_MAX_SOURCE_FILTER ideal-int +pkg syscall (freebsd-arm), const IP_MF ideal-int +pkg syscall (freebsd-arm), const IP_MINTTL ideal-int +pkg syscall (freebsd-arm), const IP_MIN_MEMBERSHIPS ideal-int +pkg syscall (freebsd-arm), const IP_MSFILTER ideal-int +pkg syscall (freebsd-arm), const IP_MSS ideal-int +pkg syscall (freebsd-arm), const IP_MULTICAST_VIF ideal-int +pkg syscall (freebsd-arm), const IP_OFFMASK ideal-int +pkg syscall (freebsd-arm), const IP_ONESBCAST ideal-int +pkg syscall (freebsd-arm), const IP_OPTIONS ideal-int +pkg syscall (freebsd-arm), const IP_PORTRANGE ideal-int +pkg syscall (freebsd-arm), const IP_PORTRANGE_DEFAULT ideal-int +pkg syscall (freebsd-arm), const IP_PORTRANGE_HIGH ideal-int +pkg syscall (freebsd-arm), const IP_PORTRANGE_LOW ideal-int +pkg syscall (freebsd-arm), const IP_RECVDSTADDR ideal-int +pkg syscall (freebsd-arm), const IP_RECVIF ideal-int +pkg syscall (freebsd-arm), const IP_RECVOPTS ideal-int +pkg syscall (freebsd-arm), const IP_RECVRETOPTS ideal-int +pkg syscall (freebsd-arm), const IP_RECVTOS ideal-int +pkg syscall (freebsd-arm), const IP_RECVTTL ideal-int +pkg syscall (freebsd-arm), const IP_RETOPTS ideal-int +pkg syscall (freebsd-arm), const IP_RF ideal-int +pkg syscall (freebsd-arm), const IP_RSVP_OFF ideal-int +pkg syscall (freebsd-arm), const IP_RSVP_ON ideal-int +pkg syscall (freebsd-arm), const IP_RSVP_VIF_OFF ideal-int +pkg syscall (freebsd-arm), const IP_RSVP_VIF_ON ideal-int +pkg syscall (freebsd-arm), const IP_SENDSRCADDR ideal-int +pkg syscall (freebsd-arm), const IP_UNBLOCK_SOURCE ideal-int +pkg syscall (freebsd-arm), const ISIG ideal-int +pkg syscall (freebsd-arm), const ISTRIP ideal-int +pkg syscall (freebsd-arm), const IXANY ideal-int +pkg syscall (freebsd-arm), const IXOFF ideal-int +pkg syscall (freebsd-arm), const IXON ideal-int +pkg syscall (freebsd-arm), const LOCK_EX ideal-int +pkg syscall (freebsd-arm), const LOCK_NB ideal-int +pkg syscall (freebsd-arm), const LOCK_SH ideal-int +pkg syscall (freebsd-arm), const LOCK_UN ideal-int +pkg syscall (freebsd-arm), const MADV_AUTOSYNC ideal-int +pkg syscall (freebsd-arm), const MADV_CORE ideal-int +pkg syscall (freebsd-arm), const MADV_DONTNEED ideal-int +pkg syscall (freebsd-arm), const MADV_FREE ideal-int +pkg syscall (freebsd-arm), const MADV_NOCORE ideal-int +pkg syscall (freebsd-arm), const MADV_NORMAL ideal-int +pkg syscall (freebsd-arm), const MADV_NOSYNC ideal-int +pkg syscall (freebsd-arm), const MADV_PROTECT ideal-int +pkg syscall (freebsd-arm), const MADV_RANDOM ideal-int +pkg syscall (freebsd-arm), const MADV_SEQUENTIAL ideal-int +pkg syscall (freebsd-arm), const MADV_WILLNEED ideal-int +pkg syscall (freebsd-arm), const MAP_ANON ideal-int +pkg syscall (freebsd-arm), const MAP_ANONYMOUS ideal-int +pkg syscall (freebsd-arm), const MAP_COPY ideal-int +pkg syscall (freebsd-arm), const MAP_FILE ideal-int +pkg syscall (freebsd-arm), const MAP_FIXED ideal-int +pkg syscall (freebsd-arm), const MAP_HASSEMAPHORE ideal-int +pkg syscall (freebsd-arm), const MAP_NOCORE ideal-int +pkg syscall (freebsd-arm), const MAP_NORESERVE ideal-int +pkg syscall (freebsd-arm), const MAP_NOSYNC ideal-int +pkg syscall (freebsd-arm), const MAP_PREFAULT_READ ideal-int +pkg syscall (freebsd-arm), const MAP_PRIVATE ideal-int +pkg syscall (freebsd-arm), const MAP_RENAME ideal-int +pkg syscall (freebsd-arm), const MAP_RESERVED0080 ideal-int +pkg syscall (freebsd-arm), const MAP_RESERVED0100 ideal-int +pkg syscall (freebsd-arm), const MAP_SHARED ideal-int +pkg syscall (freebsd-arm), const MAP_STACK ideal-int +pkg syscall (freebsd-arm), const MCL_CURRENT ideal-int +pkg syscall (freebsd-arm), const MCL_FUTURE ideal-int +pkg syscall (freebsd-arm), const MSG_COMPAT ideal-int +pkg syscall (freebsd-arm), const MSG_CTRUNC ideal-int +pkg syscall (freebsd-arm), const MSG_DONTROUTE ideal-int +pkg syscall (freebsd-arm), const MSG_DONTWAIT ideal-int +pkg syscall (freebsd-arm), const MSG_EOF ideal-int +pkg syscall (freebsd-arm), const MSG_EOR ideal-int +pkg syscall (freebsd-arm), const MSG_NBIO ideal-int +pkg syscall (freebsd-arm), const MSG_NOSIGNAL ideal-int +pkg syscall (freebsd-arm), const MSG_NOTIFICATION ideal-int +pkg syscall (freebsd-arm), const MSG_OOB ideal-int +pkg syscall (freebsd-arm), const MSG_PEEK ideal-int +pkg syscall (freebsd-arm), const MSG_TRUNC ideal-int +pkg syscall (freebsd-arm), const MSG_WAITALL ideal-int +pkg syscall (freebsd-arm), const MS_ASYNC ideal-int +pkg syscall (freebsd-arm), const MS_INVALIDATE ideal-int +pkg syscall (freebsd-arm), const MS_SYNC ideal-int +pkg syscall (freebsd-arm), const NET_RT_DUMP ideal-int +pkg syscall (freebsd-arm), const NET_RT_FLAGS ideal-int +pkg syscall (freebsd-arm), const NET_RT_IFLIST ideal-int +pkg syscall (freebsd-arm), const NET_RT_IFLISTL ideal-int +pkg syscall (freebsd-arm), const NET_RT_IFMALIST ideal-int +pkg syscall (freebsd-arm), const NET_RT_MAXID ideal-int +pkg syscall (freebsd-arm), const NOFLSH ideal-int +pkg syscall (freebsd-arm), const NOTE_ATTRIB ideal-int +pkg syscall (freebsd-arm), const NOTE_CHILD ideal-int +pkg syscall (freebsd-arm), const NOTE_DELETE ideal-int +pkg syscall (freebsd-arm), const NOTE_EXEC ideal-int +pkg syscall (freebsd-arm), const NOTE_EXIT ideal-int +pkg syscall (freebsd-arm), const NOTE_EXTEND ideal-int +pkg syscall (freebsd-arm), const NOTE_FFAND ideal-int +pkg syscall (freebsd-arm), const NOTE_FFCOPY ideal-int +pkg syscall (freebsd-arm), const NOTE_FFCTRLMASK ideal-int +pkg syscall (freebsd-arm), const NOTE_FFLAGSMASK ideal-int +pkg syscall (freebsd-arm), const NOTE_FFNOP ideal-int +pkg syscall (freebsd-arm), const NOTE_FFOR ideal-int +pkg syscall (freebsd-arm), const NOTE_FORK ideal-int +pkg syscall (freebsd-arm), const NOTE_LINK ideal-int +pkg syscall (freebsd-arm), const NOTE_LOWAT ideal-int +pkg syscall (freebsd-arm), const NOTE_PCTRLMASK ideal-int +pkg syscall (freebsd-arm), const NOTE_PDATAMASK ideal-int +pkg syscall (freebsd-arm), const NOTE_RENAME ideal-int +pkg syscall (freebsd-arm), const NOTE_REVOKE ideal-int +pkg syscall (freebsd-arm), const NOTE_TRACK ideal-int +pkg syscall (freebsd-arm), const NOTE_TRACKERR ideal-int +pkg syscall (freebsd-arm), const NOTE_TRIGGER ideal-int +pkg syscall (freebsd-arm), const NOTE_WRITE ideal-int +pkg syscall (freebsd-arm), const OCRNL ideal-int +pkg syscall (freebsd-arm), const ONLCR ideal-int +pkg syscall (freebsd-arm), const ONLRET ideal-int +pkg syscall (freebsd-arm), const ONOCR ideal-int +pkg syscall (freebsd-arm), const ONOEOT ideal-int +pkg syscall (freebsd-arm), const OPOST ideal-int +pkg syscall (freebsd-arm), const O_ACCMODE ideal-int +pkg syscall (freebsd-arm), const O_DIRECT ideal-int +pkg syscall (freebsd-arm), const O_DIRECTORY ideal-int +pkg syscall (freebsd-arm), const O_EXEC ideal-int +pkg syscall (freebsd-arm), const O_EXLOCK ideal-int +pkg syscall (freebsd-arm), const O_FSYNC ideal-int +pkg syscall (freebsd-arm), const O_NDELAY ideal-int +pkg syscall (freebsd-arm), const O_NOFOLLOW ideal-int +pkg syscall (freebsd-arm), const O_SHLOCK ideal-int +pkg syscall (freebsd-arm), const O_TTY_INIT ideal-int +pkg syscall (freebsd-arm), const PARENB ideal-int +pkg syscall (freebsd-arm), const PARMRK ideal-int +pkg syscall (freebsd-arm), const PARODD ideal-int +pkg syscall (freebsd-arm), const PENDIN ideal-int +pkg syscall (freebsd-arm), const PRIO_PGRP = 1 +pkg syscall (freebsd-arm), const PRIO_PGRP ideal-int +pkg syscall (freebsd-arm), const PRIO_PROCESS = 0 +pkg syscall (freebsd-arm), const PRIO_PROCESS ideal-int +pkg syscall (freebsd-arm), const PRIO_USER = 2 +pkg syscall (freebsd-arm), const PRIO_USER ideal-int +pkg syscall (freebsd-arm), const PROT_EXEC ideal-int +pkg syscall (freebsd-arm), const PROT_NONE ideal-int +pkg syscall (freebsd-arm), const PROT_READ ideal-int +pkg syscall (freebsd-arm), const PROT_WRITE ideal-int +pkg syscall (freebsd-arm), const PTRACE_CONT ideal-int +pkg syscall (freebsd-arm), const PTRACE_KILL ideal-int +pkg syscall (freebsd-arm), const PTRACE_TRACEME ideal-int +pkg syscall (freebsd-arm), const RLIMIT_AS ideal-int +pkg syscall (freebsd-arm), const RLIMIT_CORE ideal-int +pkg syscall (freebsd-arm), const RLIMIT_CPU ideal-int +pkg syscall (freebsd-arm), const RLIMIT_DATA ideal-int +pkg syscall (freebsd-arm), const RLIMIT_FSIZE ideal-int +pkg syscall (freebsd-arm), const RLIMIT_NOFILE ideal-int +pkg syscall (freebsd-arm), const RLIMIT_STACK ideal-int +pkg syscall (freebsd-arm), const RLIM_INFINITY ideal-int +pkg syscall (freebsd-arm), const RTAX_AUTHOR ideal-int +pkg syscall (freebsd-arm), const RTAX_BRD ideal-int +pkg syscall (freebsd-arm), const RTAX_DST ideal-int +pkg syscall (freebsd-arm), const RTAX_GATEWAY ideal-int +pkg syscall (freebsd-arm), const RTAX_GENMASK ideal-int +pkg syscall (freebsd-arm), const RTAX_IFA ideal-int +pkg syscall (freebsd-arm), const RTAX_IFP ideal-int +pkg syscall (freebsd-arm), const RTAX_MAX ideal-int +pkg syscall (freebsd-arm), const RTAX_NETMASK ideal-int +pkg syscall (freebsd-arm), const RTA_AUTHOR ideal-int +pkg syscall (freebsd-arm), const RTA_BRD ideal-int +pkg syscall (freebsd-arm), const RTA_DST ideal-int +pkg syscall (freebsd-arm), const RTA_GATEWAY ideal-int +pkg syscall (freebsd-arm), const RTA_GENMASK ideal-int +pkg syscall (freebsd-arm), const RTA_IFA ideal-int +pkg syscall (freebsd-arm), const RTA_IFP ideal-int +pkg syscall (freebsd-arm), const RTA_NETMASK ideal-int +pkg syscall (freebsd-arm), const RTF_BLACKHOLE ideal-int +pkg syscall (freebsd-arm), const RTF_BROADCAST ideal-int +pkg syscall (freebsd-arm), const RTF_DONE ideal-int +pkg syscall (freebsd-arm), const RTF_DYNAMIC ideal-int +pkg syscall (freebsd-arm), const RTF_FMASK ideal-int +pkg syscall (freebsd-arm), const RTF_GATEWAY ideal-int +pkg syscall (freebsd-arm), const RTF_HOST ideal-int +pkg syscall (freebsd-arm), const RTF_LLDATA ideal-int +pkg syscall (freebsd-arm), const RTF_LLINFO ideal-int +pkg syscall (freebsd-arm), const RTF_LOCAL ideal-int +pkg syscall (freebsd-arm), const RTF_MODIFIED ideal-int +pkg syscall (freebsd-arm), const RTF_MULTICAST ideal-int +pkg syscall (freebsd-arm), const RTF_PINNED ideal-int +pkg syscall (freebsd-arm), const RTF_PRCLONING ideal-int +pkg syscall (freebsd-arm), const RTF_PROTO1 ideal-int +pkg syscall (freebsd-arm), const RTF_PROTO2 ideal-int +pkg syscall (freebsd-arm), const RTF_PROTO3 ideal-int +pkg syscall (freebsd-arm), const RTF_REJECT ideal-int +pkg syscall (freebsd-arm), const RTF_RNH_LOCKED ideal-int +pkg syscall (freebsd-arm), const RTF_STATIC ideal-int +pkg syscall (freebsd-arm), const RTF_STICKY ideal-int +pkg syscall (freebsd-arm), const RTF_UP ideal-int +pkg syscall (freebsd-arm), const RTF_XRESOLVE ideal-int +pkg syscall (freebsd-arm), const RTM_ADD ideal-int +pkg syscall (freebsd-arm), const RTM_CHANGE ideal-int +pkg syscall (freebsd-arm), const RTM_DELADDR ideal-int +pkg syscall (freebsd-arm), const RTM_DELETE ideal-int +pkg syscall (freebsd-arm), const RTM_DELMADDR ideal-int +pkg syscall (freebsd-arm), const RTM_GET ideal-int +pkg syscall (freebsd-arm), const RTM_IEEE80211 ideal-int +pkg syscall (freebsd-arm), const RTM_IFANNOUNCE ideal-int +pkg syscall (freebsd-arm), const RTM_IFINFO ideal-int +pkg syscall (freebsd-arm), const RTM_LOCK ideal-int +pkg syscall (freebsd-arm), const RTM_LOSING ideal-int +pkg syscall (freebsd-arm), const RTM_MISS ideal-int +pkg syscall (freebsd-arm), const RTM_NEWADDR ideal-int +pkg syscall (freebsd-arm), const RTM_NEWMADDR ideal-int +pkg syscall (freebsd-arm), const RTM_OLDADD ideal-int +pkg syscall (freebsd-arm), const RTM_OLDDEL ideal-int +pkg syscall (freebsd-arm), const RTM_REDIRECT ideal-int +pkg syscall (freebsd-arm), const RTM_RESOLVE ideal-int +pkg syscall (freebsd-arm), const RTM_RTTUNIT ideal-int +pkg syscall (freebsd-arm), const RTM_VERSION ideal-int +pkg syscall (freebsd-arm), const RTV_EXPIRE ideal-int +pkg syscall (freebsd-arm), const RTV_HOPCOUNT ideal-int +pkg syscall (freebsd-arm), const RTV_MTU ideal-int +pkg syscall (freebsd-arm), const RTV_RPIPE ideal-int +pkg syscall (freebsd-arm), const RTV_RTT ideal-int +pkg syscall (freebsd-arm), const RTV_RTTVAR ideal-int +pkg syscall (freebsd-arm), const RTV_SPIPE ideal-int +pkg syscall (freebsd-arm), const RTV_SSTHRESH ideal-int +pkg syscall (freebsd-arm), const RTV_WEIGHT ideal-int +pkg syscall (freebsd-arm), const RT_CACHING_CONTEXT ideal-int +pkg syscall (freebsd-arm), const RT_DEFAULT_FIB ideal-int +pkg syscall (freebsd-arm), const RT_NORTREF ideal-int +pkg syscall (freebsd-arm), const RUSAGE_CHILDREN ideal-int +pkg syscall (freebsd-arm), const RUSAGE_SELF ideal-int +pkg syscall (freebsd-arm), const RUSAGE_THREAD ideal-int +pkg syscall (freebsd-arm), const SCM_BINTIME ideal-int +pkg syscall (freebsd-arm), const SCM_CREDS ideal-int +pkg syscall (freebsd-arm), const SCM_RIGHTS ideal-int +pkg syscall (freebsd-arm), const SCM_TIMESTAMP ideal-int +pkg syscall (freebsd-arm), const SIGCHLD Signal +pkg syscall (freebsd-arm), const SIGCONT Signal +pkg syscall (freebsd-arm), const SIGEMT Signal +pkg syscall (freebsd-arm), const SIGINFO Signal +pkg syscall (freebsd-arm), const SIGIO Signal +pkg syscall (freebsd-arm), const SIGIOT Signal +pkg syscall (freebsd-arm), const SIGLIBRT Signal +pkg syscall (freebsd-arm), const SIGLWP Signal +pkg syscall (freebsd-arm), const SIGPROF Signal +pkg syscall (freebsd-arm), const SIGSTOP Signal +pkg syscall (freebsd-arm), const SIGSYS Signal +pkg syscall (freebsd-arm), const SIGTHR Signal +pkg syscall (freebsd-arm), const SIGTSTP Signal +pkg syscall (freebsd-arm), const SIGTTIN Signal +pkg syscall (freebsd-arm), const SIGTTOU Signal +pkg syscall (freebsd-arm), const SIGURG Signal +pkg syscall (freebsd-arm), const SIGUSR1 Signal +pkg syscall (freebsd-arm), const SIGUSR2 Signal +pkg syscall (freebsd-arm), const SIGVTALRM Signal +pkg syscall (freebsd-arm), const SIGWINCH Signal +pkg syscall (freebsd-arm), const SIGXCPU Signal +pkg syscall (freebsd-arm), const SIGXFSZ Signal +pkg syscall (freebsd-arm), const SIOCADDMULTI ideal-int +pkg syscall (freebsd-arm), const SIOCADDRT ideal-int +pkg syscall (freebsd-arm), const SIOCAIFADDR ideal-int +pkg syscall (freebsd-arm), const SIOCAIFGROUP ideal-int +pkg syscall (freebsd-arm), const SIOCALIFADDR ideal-int +pkg syscall (freebsd-arm), const SIOCATMARK ideal-int +pkg syscall (freebsd-arm), const SIOCDELMULTI ideal-int +pkg syscall (freebsd-arm), const SIOCDELRT ideal-int +pkg syscall (freebsd-arm), const SIOCDIFADDR ideal-int +pkg syscall (freebsd-arm), const SIOCDIFGROUP ideal-int +pkg syscall (freebsd-arm), const SIOCDIFPHYADDR ideal-int +pkg syscall (freebsd-arm), const SIOCDLIFADDR ideal-int +pkg syscall (freebsd-arm), const SIOCGDRVSPEC ideal-int +pkg syscall (freebsd-arm), const SIOCGETSGCNT ideal-int +pkg syscall (freebsd-arm), const SIOCGETVIFCNT ideal-int +pkg syscall (freebsd-arm), const SIOCGHIWAT ideal-int +pkg syscall (freebsd-arm), const SIOCGIFADDR ideal-int +pkg syscall (freebsd-arm), const SIOCGIFBRDADDR ideal-int +pkg syscall (freebsd-arm), const SIOCGIFCAP ideal-int +pkg syscall (freebsd-arm), const SIOCGIFCONF ideal-int +pkg syscall (freebsd-arm), const SIOCGIFDESCR ideal-int +pkg syscall (freebsd-arm), const SIOCGIFDSTADDR ideal-int +pkg syscall (freebsd-arm), const SIOCGIFFIB ideal-int +pkg syscall (freebsd-arm), const SIOCGIFFLAGS ideal-int +pkg syscall (freebsd-arm), const SIOCGIFGENERIC ideal-int +pkg syscall (freebsd-arm), const SIOCGIFGMEMB ideal-int +pkg syscall (freebsd-arm), const SIOCGIFGROUP ideal-int +pkg syscall (freebsd-arm), const SIOCGIFINDEX ideal-int +pkg syscall (freebsd-arm), const SIOCGIFMAC ideal-int +pkg syscall (freebsd-arm), const SIOCGIFMEDIA ideal-int +pkg syscall (freebsd-arm), const SIOCGIFMETRIC ideal-int +pkg syscall (freebsd-arm), const SIOCGIFMTU ideal-int +pkg syscall (freebsd-arm), const SIOCGIFNETMASK ideal-int +pkg syscall (freebsd-arm), const SIOCGIFPDSTADDR ideal-int +pkg syscall (freebsd-arm), const SIOCGIFPHYS ideal-int +pkg syscall (freebsd-arm), const SIOCGIFPSRCADDR ideal-int +pkg syscall (freebsd-arm), const SIOCGIFSTATUS ideal-int +pkg syscall (freebsd-arm), const SIOCGLIFADDR ideal-int +pkg syscall (freebsd-arm), const SIOCGLIFPHYADDR ideal-int +pkg syscall (freebsd-arm), const SIOCGLOWAT ideal-int +pkg syscall (freebsd-arm), const SIOCGPGRP ideal-int +pkg syscall (freebsd-arm), const SIOCGPRIVATE_0 ideal-int +pkg syscall (freebsd-arm), const SIOCGPRIVATE_1 ideal-int +pkg syscall (freebsd-arm), const SIOCIFCREATE ideal-int +pkg syscall (freebsd-arm), const SIOCIFCREATE2 ideal-int +pkg syscall (freebsd-arm), const SIOCIFDESTROY ideal-int +pkg syscall (freebsd-arm), const SIOCIFGCLONERS ideal-int +pkg syscall (freebsd-arm), const SIOCSDRVSPEC ideal-int +pkg syscall (freebsd-arm), const SIOCSHIWAT ideal-int +pkg syscall (freebsd-arm), const SIOCSIFADDR ideal-int +pkg syscall (freebsd-arm), const SIOCSIFBRDADDR ideal-int +pkg syscall (freebsd-arm), const SIOCSIFCAP ideal-int +pkg syscall (freebsd-arm), const SIOCSIFDESCR ideal-int +pkg syscall (freebsd-arm), const SIOCSIFDSTADDR ideal-int +pkg syscall (freebsd-arm), const SIOCSIFFIB ideal-int +pkg syscall (freebsd-arm), const SIOCSIFFLAGS ideal-int +pkg syscall (freebsd-arm), const SIOCSIFGENERIC ideal-int +pkg syscall (freebsd-arm), const SIOCSIFLLADDR ideal-int +pkg syscall (freebsd-arm), const SIOCSIFMAC ideal-int +pkg syscall (freebsd-arm), const SIOCSIFMEDIA ideal-int +pkg syscall (freebsd-arm), const SIOCSIFMETRIC ideal-int +pkg syscall (freebsd-arm), const SIOCSIFMTU ideal-int +pkg syscall (freebsd-arm), const SIOCSIFNAME ideal-int +pkg syscall (freebsd-arm), const SIOCSIFNETMASK ideal-int +pkg syscall (freebsd-arm), const SIOCSIFPHYADDR ideal-int +pkg syscall (freebsd-arm), const SIOCSIFPHYS ideal-int +pkg syscall (freebsd-arm), const SIOCSIFRVNET ideal-int +pkg syscall (freebsd-arm), const SIOCSIFVNET ideal-int +pkg syscall (freebsd-arm), const SIOCSLIFPHYADDR ideal-int +pkg syscall (freebsd-arm), const SIOCSLOWAT ideal-int +pkg syscall (freebsd-arm), const SIOCSPGRP ideal-int +pkg syscall (freebsd-arm), const SOCK_MAXADDRLEN ideal-int +pkg syscall (freebsd-arm), const SOCK_RDM ideal-int +pkg syscall (freebsd-arm), const SO_ACCEPTCONN ideal-int +pkg syscall (freebsd-arm), const SO_ACCEPTFILTER ideal-int +pkg syscall (freebsd-arm), const SO_BINTIME ideal-int +pkg syscall (freebsd-arm), const SO_DEBUG ideal-int +pkg syscall (freebsd-arm), const SO_ERROR ideal-int +pkg syscall (freebsd-arm), const SO_LABEL ideal-int +pkg syscall (freebsd-arm), const SO_LISTENINCQLEN ideal-int +pkg syscall (freebsd-arm), const SO_LISTENQLEN ideal-int +pkg syscall (freebsd-arm), const SO_LISTENQLIMIT ideal-int +pkg syscall (freebsd-arm), const SO_NOSIGPIPE ideal-int +pkg syscall (freebsd-arm), const SO_NO_DDP ideal-int +pkg syscall (freebsd-arm), const SO_NO_OFFLOAD ideal-int +pkg syscall (freebsd-arm), const SO_OOBINLINE ideal-int +pkg syscall (freebsd-arm), const SO_PEERLABEL ideal-int +pkg syscall (freebsd-arm), const SO_PROTOCOL ideal-int +pkg syscall (freebsd-arm), const SO_PROTOTYPE ideal-int +pkg syscall (freebsd-arm), const SO_RCVLOWAT ideal-int +pkg syscall (freebsd-arm), const SO_RCVTIMEO ideal-int +pkg syscall (freebsd-arm), const SO_REUSEPORT ideal-int +pkg syscall (freebsd-arm), const SO_SETFIB ideal-int +pkg syscall (freebsd-arm), const SO_SNDLOWAT ideal-int +pkg syscall (freebsd-arm), const SO_SNDTIMEO ideal-int +pkg syscall (freebsd-arm), const SO_TIMESTAMP ideal-int +pkg syscall (freebsd-arm), const SO_TYPE ideal-int +pkg syscall (freebsd-arm), const SO_USELOOPBACK ideal-int +pkg syscall (freebsd-arm), const SO_USER_COOKIE ideal-int +pkg syscall (freebsd-arm), const SYS_ABORT2 ideal-int +pkg syscall (freebsd-arm), const SYS_ACCEPT ideal-int +pkg syscall (freebsd-arm), const SYS_ACCESS ideal-int +pkg syscall (freebsd-arm), const SYS_ACCT ideal-int +pkg syscall (freebsd-arm), const SYS_ADJTIME ideal-int +pkg syscall (freebsd-arm), const SYS_AUDIT ideal-int +pkg syscall (freebsd-arm), const SYS_AUDITCTL ideal-int +pkg syscall (freebsd-arm), const SYS_AUDITON ideal-int +pkg syscall (freebsd-arm), const SYS_BIND ideal-int +pkg syscall (freebsd-arm), const SYS_CAP_ENTER ideal-int +pkg syscall (freebsd-arm), const SYS_CAP_FCNTLS_GET ideal-int +pkg syscall (freebsd-arm), const SYS_CAP_FCNTLS_LIMIT ideal-int +pkg syscall (freebsd-arm), const SYS_CAP_GETMODE ideal-int +pkg syscall (freebsd-arm), const SYS_CAP_IOCTLS_GET ideal-int +pkg syscall (freebsd-arm), const SYS_CAP_IOCTLS_LIMIT ideal-int +pkg syscall (freebsd-arm), const SYS_CAP_NEW ideal-int +pkg syscall (freebsd-arm), const SYS_CAP_RIGHTS_GET ideal-int +pkg syscall (freebsd-arm), const SYS_CAP_RIGHTS_LIMIT ideal-int +pkg syscall (freebsd-arm), const SYS_CHDIR ideal-int +pkg syscall (freebsd-arm), const SYS_CHFLAGS ideal-int +pkg syscall (freebsd-arm), const SYS_CHMOD ideal-int +pkg syscall (freebsd-arm), const SYS_CHOWN ideal-int +pkg syscall (freebsd-arm), const SYS_CHROOT ideal-int +pkg syscall (freebsd-arm), const SYS_CLOCK_GETCPUCLOCKID2 ideal-int +pkg syscall (freebsd-arm), const SYS_CLOCK_GETRES ideal-int +pkg syscall (freebsd-arm), const SYS_CLOCK_GETTIME ideal-int +pkg syscall (freebsd-arm), const SYS_CLOCK_SETTIME ideal-int +pkg syscall (freebsd-arm), const SYS_CLOSE ideal-int +pkg syscall (freebsd-arm), const SYS_CLOSEFROM ideal-int +pkg syscall (freebsd-arm), const SYS_CONNECT ideal-int +pkg syscall (freebsd-arm), const SYS_CPUSET ideal-int +pkg syscall (freebsd-arm), const SYS_CPUSET_GETAFFINITY ideal-int +pkg syscall (freebsd-arm), const SYS_CPUSET_GETID ideal-int +pkg syscall (freebsd-arm), const SYS_CPUSET_SETAFFINITY ideal-int +pkg syscall (freebsd-arm), const SYS_CPUSET_SETID ideal-int +pkg syscall (freebsd-arm), const SYS_DUP ideal-int +pkg syscall (freebsd-arm), const SYS_DUP2 ideal-int +pkg syscall (freebsd-arm), const SYS_EACCESS ideal-int +pkg syscall (freebsd-arm), const SYS_EXECVE ideal-int +pkg syscall (freebsd-arm), const SYS_EXIT ideal-int +pkg syscall (freebsd-arm), const SYS_EXTATTRCTL ideal-int +pkg syscall (freebsd-arm), const SYS_EXTATTR_DELETE_FD ideal-int +pkg syscall (freebsd-arm), const SYS_EXTATTR_DELETE_FILE ideal-int +pkg syscall (freebsd-arm), const SYS_EXTATTR_DELETE_LINK ideal-int +pkg syscall (freebsd-arm), const SYS_EXTATTR_GET_FD ideal-int +pkg syscall (freebsd-arm), const SYS_EXTATTR_GET_FILE ideal-int +pkg syscall (freebsd-arm), const SYS_EXTATTR_GET_LINK ideal-int +pkg syscall (freebsd-arm), const SYS_EXTATTR_LIST_FD ideal-int +pkg syscall (freebsd-arm), const SYS_EXTATTR_LIST_FILE ideal-int +pkg syscall (freebsd-arm), const SYS_EXTATTR_LIST_LINK ideal-int +pkg syscall (freebsd-arm), const SYS_EXTATTR_SET_FD ideal-int +pkg syscall (freebsd-arm), const SYS_EXTATTR_SET_FILE ideal-int +pkg syscall (freebsd-arm), const SYS_EXTATTR_SET_LINK ideal-int +pkg syscall (freebsd-arm), const SYS_FACCESSAT ideal-int +pkg syscall (freebsd-arm), const SYS_FCHDIR ideal-int +pkg syscall (freebsd-arm), const SYS_FCHFLAGS ideal-int +pkg syscall (freebsd-arm), const SYS_FCHMOD ideal-int +pkg syscall (freebsd-arm), const SYS_FCHMODAT ideal-int +pkg syscall (freebsd-arm), const SYS_FCHOWN ideal-int +pkg syscall (freebsd-arm), const SYS_FCHOWNAT ideal-int +pkg syscall (freebsd-arm), const SYS_FCNTL ideal-int +pkg syscall (freebsd-arm), const SYS_FEXECVE ideal-int +pkg syscall (freebsd-arm), const SYS_FFCLOCK_GETCOUNTER ideal-int +pkg syscall (freebsd-arm), const SYS_FFCLOCK_GETESTIMATE ideal-int +pkg syscall (freebsd-arm), const SYS_FFCLOCK_SETESTIMATE ideal-int +pkg syscall (freebsd-arm), const SYS_FHOPEN ideal-int +pkg syscall (freebsd-arm), const SYS_FHSTAT ideal-int +pkg syscall (freebsd-arm), const SYS_FHSTATFS ideal-int +pkg syscall (freebsd-arm), const SYS_FLOCK ideal-int +pkg syscall (freebsd-arm), const SYS_FORK ideal-int +pkg syscall (freebsd-arm), const SYS_FPATHCONF ideal-int +pkg syscall (freebsd-arm), const SYS_FREEBSD6_FTRUNCATE ideal-int +pkg syscall (freebsd-arm), const SYS_FREEBSD6_LSEEK ideal-int +pkg syscall (freebsd-arm), const SYS_FREEBSD6_MMAP ideal-int +pkg syscall (freebsd-arm), const SYS_FREEBSD6_PREAD ideal-int +pkg syscall (freebsd-arm), const SYS_FREEBSD6_PWRITE ideal-int +pkg syscall (freebsd-arm), const SYS_FREEBSD6_TRUNCATE ideal-int +pkg syscall (freebsd-arm), const SYS_FSTAT ideal-int +pkg syscall (freebsd-arm), const SYS_FSTATAT ideal-int +pkg syscall (freebsd-arm), const SYS_FSTATFS ideal-int +pkg syscall (freebsd-arm), const SYS_FSYNC ideal-int +pkg syscall (freebsd-arm), const SYS_FTRUNCATE ideal-int +pkg syscall (freebsd-arm), const SYS_FUTIMES ideal-int +pkg syscall (freebsd-arm), const SYS_FUTIMESAT ideal-int +pkg syscall (freebsd-arm), const SYS_GETAUDIT ideal-int +pkg syscall (freebsd-arm), const SYS_GETAUDIT_ADDR ideal-int +pkg syscall (freebsd-arm), const SYS_GETAUID ideal-int +pkg syscall (freebsd-arm), const SYS_GETCONTEXT ideal-int +pkg syscall (freebsd-arm), const SYS_GETDENTS ideal-int +pkg syscall (freebsd-arm), const SYS_GETDIRENTRIES ideal-int +pkg syscall (freebsd-arm), const SYS_GETDTABLESIZE ideal-int +pkg syscall (freebsd-arm), const SYS_GETEGID ideal-int +pkg syscall (freebsd-arm), const SYS_GETEUID ideal-int +pkg syscall (freebsd-arm), const SYS_GETFH ideal-int +pkg syscall (freebsd-arm), const SYS_GETFSSTAT ideal-int +pkg syscall (freebsd-arm), const SYS_GETGID ideal-int +pkg syscall (freebsd-arm), const SYS_GETGROUPS ideal-int +pkg syscall (freebsd-arm), const SYS_GETITIMER ideal-int +pkg syscall (freebsd-arm), const SYS_GETLOGIN ideal-int +pkg syscall (freebsd-arm), const SYS_GETLOGINCLASS ideal-int +pkg syscall (freebsd-arm), const SYS_GETPEERNAME ideal-int +pkg syscall (freebsd-arm), const SYS_GETPGID ideal-int +pkg syscall (freebsd-arm), const SYS_GETPGRP ideal-int +pkg syscall (freebsd-arm), const SYS_GETPID ideal-int +pkg syscall (freebsd-arm), const SYS_GETPPID ideal-int +pkg syscall (freebsd-arm), const SYS_GETPRIORITY ideal-int +pkg syscall (freebsd-arm), const SYS_GETRESGID ideal-int +pkg syscall (freebsd-arm), const SYS_GETRESUID ideal-int +pkg syscall (freebsd-arm), const SYS_GETRLIMIT ideal-int +pkg syscall (freebsd-arm), const SYS_GETRUSAGE ideal-int +pkg syscall (freebsd-arm), const SYS_GETSID ideal-int +pkg syscall (freebsd-arm), const SYS_GETSOCKNAME ideal-int +pkg syscall (freebsd-arm), const SYS_GETSOCKOPT ideal-int +pkg syscall (freebsd-arm), const SYS_GETTIMEOFDAY ideal-int +pkg syscall (freebsd-arm), const SYS_GETUID ideal-int +pkg syscall (freebsd-arm), const SYS_IOCTL ideal-int +pkg syscall (freebsd-arm), const SYS_ISSETUGID ideal-int +pkg syscall (freebsd-arm), const SYS_JAIL ideal-int +pkg syscall (freebsd-arm), const SYS_JAIL_ATTACH ideal-int +pkg syscall (freebsd-arm), const SYS_JAIL_GET ideal-int +pkg syscall (freebsd-arm), const SYS_JAIL_REMOVE ideal-int +pkg syscall (freebsd-arm), const SYS_JAIL_SET ideal-int +pkg syscall (freebsd-arm), const SYS_KENV ideal-int +pkg syscall (freebsd-arm), const SYS_KEVENT ideal-int +pkg syscall (freebsd-arm), const SYS_KILL ideal-int +pkg syscall (freebsd-arm), const SYS_KLDFIND ideal-int +pkg syscall (freebsd-arm), const SYS_KLDFIRSTMOD ideal-int +pkg syscall (freebsd-arm), const SYS_KLDLOAD ideal-int +pkg syscall (freebsd-arm), const SYS_KLDNEXT ideal-int +pkg syscall (freebsd-arm), const SYS_KLDSTAT ideal-int +pkg syscall (freebsd-arm), const SYS_KLDSYM ideal-int +pkg syscall (freebsd-arm), const SYS_KLDUNLOAD ideal-int +pkg syscall (freebsd-arm), const SYS_KLDUNLOADF ideal-int +pkg syscall (freebsd-arm), const SYS_KQUEUE ideal-int +pkg syscall (freebsd-arm), const SYS_KTIMER_CREATE ideal-int +pkg syscall (freebsd-arm), const SYS_KTIMER_DELETE ideal-int +pkg syscall (freebsd-arm), const SYS_KTIMER_GETOVERRUN ideal-int +pkg syscall (freebsd-arm), const SYS_KTIMER_GETTIME ideal-int +pkg syscall (freebsd-arm), const SYS_KTIMER_SETTIME ideal-int +pkg syscall (freebsd-arm), const SYS_KTRACE ideal-int +pkg syscall (freebsd-arm), const SYS_LCHFLAGS ideal-int +pkg syscall (freebsd-arm), const SYS_LCHMOD ideal-int +pkg syscall (freebsd-arm), const SYS_LCHOWN ideal-int +pkg syscall (freebsd-arm), const SYS_LGETFH ideal-int +pkg syscall (freebsd-arm), const SYS_LINK ideal-int +pkg syscall (freebsd-arm), const SYS_LINKAT ideal-int +pkg syscall (freebsd-arm), const SYS_LISTEN ideal-int +pkg syscall (freebsd-arm), const SYS_LPATHCONF ideal-int +pkg syscall (freebsd-arm), const SYS_LSEEK ideal-int +pkg syscall (freebsd-arm), const SYS_LSTAT ideal-int +pkg syscall (freebsd-arm), const SYS_LUTIMES ideal-int +pkg syscall (freebsd-arm), const SYS_MAC_SYSCALL ideal-int +pkg syscall (freebsd-arm), const SYS_MADVISE ideal-int +pkg syscall (freebsd-arm), const SYS_MINCORE ideal-int +pkg syscall (freebsd-arm), const SYS_MINHERIT ideal-int +pkg syscall (freebsd-arm), const SYS_MKDIR ideal-int +pkg syscall (freebsd-arm), const SYS_MKDIRAT ideal-int +pkg syscall (freebsd-arm), const SYS_MKFIFO ideal-int +pkg syscall (freebsd-arm), const SYS_MKFIFOAT ideal-int +pkg syscall (freebsd-arm), const SYS_MKNOD ideal-int +pkg syscall (freebsd-arm), const SYS_MKNODAT ideal-int +pkg syscall (freebsd-arm), const SYS_MLOCK ideal-int +pkg syscall (freebsd-arm), const SYS_MLOCKALL ideal-int +pkg syscall (freebsd-arm), const SYS_MMAP ideal-int +pkg syscall (freebsd-arm), const SYS_MODFIND ideal-int +pkg syscall (freebsd-arm), const SYS_MODFNEXT ideal-int +pkg syscall (freebsd-arm), const SYS_MODNEXT ideal-int +pkg syscall (freebsd-arm), const SYS_MODSTAT ideal-int +pkg syscall (freebsd-arm), const SYS_MOUNT ideal-int +pkg syscall (freebsd-arm), const SYS_MPROTECT ideal-int +pkg syscall (freebsd-arm), const SYS_MSYNC ideal-int +pkg syscall (freebsd-arm), const SYS_MUNLOCK ideal-int +pkg syscall (freebsd-arm), const SYS_MUNLOCKALL ideal-int +pkg syscall (freebsd-arm), const SYS_MUNMAP ideal-int +pkg syscall (freebsd-arm), const SYS_NANOSLEEP ideal-int +pkg syscall (freebsd-arm), const SYS_NFSTAT ideal-int +pkg syscall (freebsd-arm), const SYS_NLSTAT ideal-int +pkg syscall (freebsd-arm), const SYS_NMOUNT ideal-int +pkg syscall (freebsd-arm), const SYS_NSTAT ideal-int +pkg syscall (freebsd-arm), const SYS_NTP_ADJTIME ideal-int +pkg syscall (freebsd-arm), const SYS_NTP_GETTIME ideal-int +pkg syscall (freebsd-arm), const SYS_OBREAK ideal-int +pkg syscall (freebsd-arm), const SYS_OPEN ideal-int +pkg syscall (freebsd-arm), const SYS_OPENAT ideal-int +pkg syscall (freebsd-arm), const SYS_OPENBSD_POLL ideal-int +pkg syscall (freebsd-arm), const SYS_OVADVISE ideal-int +pkg syscall (freebsd-arm), const SYS_PATHCONF ideal-int +pkg syscall (freebsd-arm), const SYS_PDFORK ideal-int +pkg syscall (freebsd-arm), const SYS_PDGETPID ideal-int +pkg syscall (freebsd-arm), const SYS_PDKILL ideal-int +pkg syscall (freebsd-arm), const SYS_PIPE ideal-int +pkg syscall (freebsd-arm), const SYS_POLL ideal-int +pkg syscall (freebsd-arm), const SYS_POSIX_FADVISE ideal-int +pkg syscall (freebsd-arm), const SYS_POSIX_FALLOCATE ideal-int +pkg syscall (freebsd-arm), const SYS_POSIX_OPENPT ideal-int +pkg syscall (freebsd-arm), const SYS_PREAD ideal-int +pkg syscall (freebsd-arm), const SYS_PREADV ideal-int +pkg syscall (freebsd-arm), const SYS_PROFIL ideal-int +pkg syscall (freebsd-arm), const SYS_PSELECT ideal-int +pkg syscall (freebsd-arm), const SYS_PTRACE ideal-int +pkg syscall (freebsd-arm), const SYS_PWRITE ideal-int +pkg syscall (freebsd-arm), const SYS_PWRITEV ideal-int +pkg syscall (freebsd-arm), const SYS_QUOTACTL ideal-int +pkg syscall (freebsd-arm), const SYS_RCTL_ADD_RULE ideal-int +pkg syscall (freebsd-arm), const SYS_RCTL_GET_LIMITS ideal-int +pkg syscall (freebsd-arm), const SYS_RCTL_GET_RACCT ideal-int +pkg syscall (freebsd-arm), const SYS_RCTL_GET_RULES ideal-int +pkg syscall (freebsd-arm), const SYS_RCTL_REMOVE_RULE ideal-int +pkg syscall (freebsd-arm), const SYS_READ ideal-int +pkg syscall (freebsd-arm), const SYS_READLINK ideal-int +pkg syscall (freebsd-arm), const SYS_READLINKAT ideal-int +pkg syscall (freebsd-arm), const SYS_READV ideal-int +pkg syscall (freebsd-arm), const SYS_REBOOT ideal-int +pkg syscall (freebsd-arm), const SYS_RECVFROM ideal-int +pkg syscall (freebsd-arm), const SYS_RECVMSG ideal-int +pkg syscall (freebsd-arm), const SYS_RENAME ideal-int +pkg syscall (freebsd-arm), const SYS_RENAMEAT ideal-int +pkg syscall (freebsd-arm), const SYS_REVOKE ideal-int +pkg syscall (freebsd-arm), const SYS_RFORK ideal-int +pkg syscall (freebsd-arm), const SYS_RMDIR ideal-int +pkg syscall (freebsd-arm), const SYS_RTPRIO ideal-int +pkg syscall (freebsd-arm), const SYS_RTPRIO_THREAD ideal-int +pkg syscall (freebsd-arm), const SYS_SBRK ideal-int +pkg syscall (freebsd-arm), const SYS_SCHED_GETPARAM ideal-int +pkg syscall (freebsd-arm), const SYS_SCHED_GETSCHEDULER ideal-int +pkg syscall (freebsd-arm), const SYS_SCHED_GET_PRIORITY_MAX ideal-int +pkg syscall (freebsd-arm), const SYS_SCHED_GET_PRIORITY_MIN ideal-int +pkg syscall (freebsd-arm), const SYS_SCHED_RR_GET_INTERVAL ideal-int +pkg syscall (freebsd-arm), const SYS_SCHED_SETPARAM ideal-int +pkg syscall (freebsd-arm), const SYS_SCHED_SETSCHEDULER ideal-int +pkg syscall (freebsd-arm), const SYS_SCHED_YIELD ideal-int +pkg syscall (freebsd-arm), const SYS_SCTP_GENERIC_RECVMSG ideal-int +pkg syscall (freebsd-arm), const SYS_SCTP_GENERIC_SENDMSG ideal-int +pkg syscall (freebsd-arm), const SYS_SCTP_GENERIC_SENDMSG_IOV ideal-int +pkg syscall (freebsd-arm), const SYS_SCTP_PEELOFF ideal-int +pkg syscall (freebsd-arm), const SYS_SELECT ideal-int +pkg syscall (freebsd-arm), const SYS_SENDFILE ideal-int +pkg syscall (freebsd-arm), const SYS_SENDMSG ideal-int +pkg syscall (freebsd-arm), const SYS_SENDTO ideal-int +pkg syscall (freebsd-arm), const SYS_SETAUDIT ideal-int +pkg syscall (freebsd-arm), const SYS_SETAUDIT_ADDR ideal-int +pkg syscall (freebsd-arm), const SYS_SETAUID ideal-int +pkg syscall (freebsd-arm), const SYS_SETCONTEXT ideal-int +pkg syscall (freebsd-arm), const SYS_SETEGID ideal-int +pkg syscall (freebsd-arm), const SYS_SETEUID ideal-int +pkg syscall (freebsd-arm), const SYS_SETFIB ideal-int +pkg syscall (freebsd-arm), const SYS_SETGID ideal-int +pkg syscall (freebsd-arm), const SYS_SETGROUPS ideal-int +pkg syscall (freebsd-arm), const SYS_SETITIMER ideal-int +pkg syscall (freebsd-arm), const SYS_SETLOGIN ideal-int +pkg syscall (freebsd-arm), const SYS_SETLOGINCLASS ideal-int +pkg syscall (freebsd-arm), const SYS_SETPGID ideal-int +pkg syscall (freebsd-arm), const SYS_SETPRIORITY ideal-int +pkg syscall (freebsd-arm), const SYS_SETREGID ideal-int +pkg syscall (freebsd-arm), const SYS_SETRESGID ideal-int +pkg syscall (freebsd-arm), const SYS_SETRESUID ideal-int +pkg syscall (freebsd-arm), const SYS_SETREUID ideal-int +pkg syscall (freebsd-arm), const SYS_SETRLIMIT ideal-int +pkg syscall (freebsd-arm), const SYS_SETSID ideal-int +pkg syscall (freebsd-arm), const SYS_SETSOCKOPT ideal-int +pkg syscall (freebsd-arm), const SYS_SETTIMEOFDAY ideal-int +pkg syscall (freebsd-arm), const SYS_SETUID ideal-int +pkg syscall (freebsd-arm), const SYS_SHM_OPEN ideal-int +pkg syscall (freebsd-arm), const SYS_SHM_UNLINK ideal-int +pkg syscall (freebsd-arm), const SYS_SHUTDOWN ideal-int +pkg syscall (freebsd-arm), const SYS_SIGACTION ideal-int +pkg syscall (freebsd-arm), const SYS_SIGALTSTACK ideal-int +pkg syscall (freebsd-arm), const SYS_SIGPENDING ideal-int +pkg syscall (freebsd-arm), const SYS_SIGPROCMASK ideal-int +pkg syscall (freebsd-arm), const SYS_SIGQUEUE ideal-int +pkg syscall (freebsd-arm), const SYS_SIGRETURN ideal-int +pkg syscall (freebsd-arm), const SYS_SIGSUSPEND ideal-int +pkg syscall (freebsd-arm), const SYS_SIGTIMEDWAIT ideal-int +pkg syscall (freebsd-arm), const SYS_SIGWAIT ideal-int +pkg syscall (freebsd-arm), const SYS_SIGWAITINFO ideal-int +pkg syscall (freebsd-arm), const SYS_SOCKET ideal-int +pkg syscall (freebsd-arm), const SYS_SOCKETPAIR ideal-int +pkg syscall (freebsd-arm), const SYS_SSTK ideal-int +pkg syscall (freebsd-arm), const SYS_STAT ideal-int +pkg syscall (freebsd-arm), const SYS_STATFS ideal-int +pkg syscall (freebsd-arm), const SYS_SWAPCONTEXT ideal-int +pkg syscall (freebsd-arm), const SYS_SWAPOFF ideal-int +pkg syscall (freebsd-arm), const SYS_SWAPON ideal-int +pkg syscall (freebsd-arm), const SYS_SYMLINK ideal-int +pkg syscall (freebsd-arm), const SYS_SYMLINKAT ideal-int +pkg syscall (freebsd-arm), const SYS_SYNC ideal-int +pkg syscall (freebsd-arm), const SYS_SYSARCH ideal-int +pkg syscall (freebsd-arm), const SYS_THR_CREATE ideal-int +pkg syscall (freebsd-arm), const SYS_THR_EXIT ideal-int +pkg syscall (freebsd-arm), const SYS_THR_KILL ideal-int +pkg syscall (freebsd-arm), const SYS_THR_KILL2 ideal-int +pkg syscall (freebsd-arm), const SYS_THR_NEW ideal-int +pkg syscall (freebsd-arm), const SYS_THR_SELF ideal-int +pkg syscall (freebsd-arm), const SYS_THR_SET_NAME ideal-int +pkg syscall (freebsd-arm), const SYS_THR_SUSPEND ideal-int +pkg syscall (freebsd-arm), const SYS_THR_WAKE ideal-int +pkg syscall (freebsd-arm), const SYS_TRUNCATE ideal-int +pkg syscall (freebsd-arm), const SYS_UMASK ideal-int +pkg syscall (freebsd-arm), const SYS_UNDELETE ideal-int +pkg syscall (freebsd-arm), const SYS_UNLINK ideal-int +pkg syscall (freebsd-arm), const SYS_UNLINKAT ideal-int +pkg syscall (freebsd-arm), const SYS_UNMOUNT ideal-int +pkg syscall (freebsd-arm), const SYS_UTIMES ideal-int +pkg syscall (freebsd-arm), const SYS_UTRACE ideal-int +pkg syscall (freebsd-arm), const SYS_UUIDGEN ideal-int +pkg syscall (freebsd-arm), const SYS_VFORK ideal-int +pkg syscall (freebsd-arm), const SYS_WAIT4 ideal-int +pkg syscall (freebsd-arm), const SYS_WAIT6 ideal-int +pkg syscall (freebsd-arm), const SYS_WRITE ideal-int +pkg syscall (freebsd-arm), const SYS_WRITEV ideal-int +pkg syscall (freebsd-arm), const SYS_YIELD ideal-int +pkg syscall (freebsd-arm), const SYS__UMTX_LOCK ideal-int +pkg syscall (freebsd-arm), const SYS__UMTX_OP ideal-int +pkg syscall (freebsd-arm), const SYS__UMTX_UNLOCK ideal-int +pkg syscall (freebsd-arm), const SYS___ACL_ACLCHECK_FD ideal-int +pkg syscall (freebsd-arm), const SYS___ACL_ACLCHECK_FILE ideal-int +pkg syscall (freebsd-arm), const SYS___ACL_ACLCHECK_LINK ideal-int +pkg syscall (freebsd-arm), const SYS___ACL_DELETE_FD ideal-int +pkg syscall (freebsd-arm), const SYS___ACL_DELETE_FILE ideal-int +pkg syscall (freebsd-arm), const SYS___ACL_DELETE_LINK ideal-int +pkg syscall (freebsd-arm), const SYS___ACL_GET_FD ideal-int +pkg syscall (freebsd-arm), const SYS___ACL_GET_FILE ideal-int +pkg syscall (freebsd-arm), const SYS___ACL_GET_LINK ideal-int +pkg syscall (freebsd-arm), const SYS___ACL_SET_FD ideal-int +pkg syscall (freebsd-arm), const SYS___ACL_SET_FILE ideal-int +pkg syscall (freebsd-arm), const SYS___ACL_SET_LINK ideal-int +pkg syscall (freebsd-arm), const SYS___GETCWD ideal-int +pkg syscall (freebsd-arm), const SYS___MAC_EXECVE ideal-int +pkg syscall (freebsd-arm), const SYS___MAC_GET_FD ideal-int +pkg syscall (freebsd-arm), const SYS___MAC_GET_FILE ideal-int +pkg syscall (freebsd-arm), const SYS___MAC_GET_LINK ideal-int +pkg syscall (freebsd-arm), const SYS___MAC_GET_PID ideal-int +pkg syscall (freebsd-arm), const SYS___MAC_GET_PROC ideal-int +pkg syscall (freebsd-arm), const SYS___MAC_SET_FD ideal-int +pkg syscall (freebsd-arm), const SYS___MAC_SET_FILE ideal-int +pkg syscall (freebsd-arm), const SYS___MAC_SET_LINK ideal-int +pkg syscall (freebsd-arm), const SYS___MAC_SET_PROC ideal-int +pkg syscall (freebsd-arm), const SYS___SETUGID ideal-int +pkg syscall (freebsd-arm), const SYS___SYSCTL ideal-int +pkg syscall (freebsd-arm), const SizeofBpfHdr ideal-int +pkg syscall (freebsd-arm), const SizeofBpfInsn ideal-int +pkg syscall (freebsd-arm), const SizeofBpfProgram ideal-int +pkg syscall (freebsd-arm), const SizeofBpfStat ideal-int +pkg syscall (freebsd-arm), const SizeofBpfVersion ideal-int +pkg syscall (freebsd-arm), const SizeofBpfZbuf ideal-int +pkg syscall (freebsd-arm), const SizeofBpfZbufHeader ideal-int +pkg syscall (freebsd-arm), const SizeofCmsghdr ideal-int +pkg syscall (freebsd-arm), const SizeofICMPv6Filter = 32 +pkg syscall (freebsd-arm), const SizeofICMPv6Filter ideal-int +pkg syscall (freebsd-arm), const SizeofIPMreq ideal-int +pkg syscall (freebsd-arm), const SizeofIPMreqn ideal-int +pkg syscall (freebsd-arm), const SizeofIPv6MTUInfo = 32 +pkg syscall (freebsd-arm), const SizeofIPv6MTUInfo ideal-int +pkg syscall (freebsd-arm), const SizeofIPv6Mreq ideal-int +pkg syscall (freebsd-arm), const SizeofIfAnnounceMsghdr ideal-int +pkg syscall (freebsd-arm), const SizeofIfData ideal-int +pkg syscall (freebsd-arm), const SizeofIfMsghdr ideal-int +pkg syscall (freebsd-arm), const SizeofIfaMsghdr ideal-int +pkg syscall (freebsd-arm), const SizeofIfmaMsghdr ideal-int +pkg syscall (freebsd-arm), const SizeofInet6Pktinfo ideal-int +pkg syscall (freebsd-arm), const SizeofLinger ideal-int +pkg syscall (freebsd-arm), const SizeofMsghdr ideal-int +pkg syscall (freebsd-arm), const SizeofRtMetrics ideal-int +pkg syscall (freebsd-arm), const SizeofRtMsghdr ideal-int +pkg syscall (freebsd-arm), const SizeofSockaddrAny ideal-int +pkg syscall (freebsd-arm), const SizeofSockaddrDatalink ideal-int +pkg syscall (freebsd-arm), const SizeofSockaddrInet4 ideal-int +pkg syscall (freebsd-arm), const SizeofSockaddrInet6 ideal-int +pkg syscall (freebsd-arm), const SizeofSockaddrUnix ideal-int +pkg syscall (freebsd-arm), const TCIFLUSH ideal-int +pkg syscall (freebsd-arm), const TCIOFLUSH ideal-int +pkg syscall (freebsd-arm), const TCOFLUSH ideal-int +pkg syscall (freebsd-arm), const TCP_CA_NAME_MAX ideal-int +pkg syscall (freebsd-arm), const TCP_CONGESTION ideal-int +pkg syscall (freebsd-arm), const TCP_INFO ideal-int +pkg syscall (freebsd-arm), const TCP_KEEPCNT ideal-int +pkg syscall (freebsd-arm), const TCP_KEEPIDLE ideal-int +pkg syscall (freebsd-arm), const TCP_KEEPINIT ideal-int +pkg syscall (freebsd-arm), const TCP_KEEPINTVL ideal-int +pkg syscall (freebsd-arm), const TCP_MAXBURST ideal-int +pkg syscall (freebsd-arm), const TCP_MAXHLEN ideal-int +pkg syscall (freebsd-arm), const TCP_MAXOLEN ideal-int +pkg syscall (freebsd-arm), const TCP_MAXSEG ideal-int +pkg syscall (freebsd-arm), const TCP_MAXWIN ideal-int +pkg syscall (freebsd-arm), const TCP_MAX_SACK ideal-int +pkg syscall (freebsd-arm), const TCP_MAX_WINSHIFT ideal-int +pkg syscall (freebsd-arm), const TCP_MD5SIG ideal-int +pkg syscall (freebsd-arm), const TCP_MINMSS ideal-int +pkg syscall (freebsd-arm), const TCP_MSS ideal-int +pkg syscall (freebsd-arm), const TCP_NOOPT ideal-int +pkg syscall (freebsd-arm), const TCP_NOPUSH ideal-int +pkg syscall (freebsd-arm), const TCSAFLUSH ideal-int +pkg syscall (freebsd-arm), const TIOCCBRK ideal-int +pkg syscall (freebsd-arm), const TIOCCDTR ideal-int +pkg syscall (freebsd-arm), const TIOCCONS ideal-int +pkg syscall (freebsd-arm), const TIOCDRAIN ideal-int +pkg syscall (freebsd-arm), const TIOCEXCL ideal-int +pkg syscall (freebsd-arm), const TIOCEXT ideal-int +pkg syscall (freebsd-arm), const TIOCFLUSH ideal-int +pkg syscall (freebsd-arm), const TIOCGDRAINWAIT ideal-int +pkg syscall (freebsd-arm), const TIOCGETA ideal-int +pkg syscall (freebsd-arm), const TIOCGETD ideal-int +pkg syscall (freebsd-arm), const TIOCGPGRP ideal-int +pkg syscall (freebsd-arm), const TIOCGPTN ideal-int +pkg syscall (freebsd-arm), const TIOCGSID ideal-int +pkg syscall (freebsd-arm), const TIOCGWINSZ ideal-int +pkg syscall (freebsd-arm), const TIOCMBIC ideal-int +pkg syscall (freebsd-arm), const TIOCMBIS ideal-int +pkg syscall (freebsd-arm), const TIOCMGDTRWAIT ideal-int +pkg syscall (freebsd-arm), const TIOCMGET ideal-int +pkg syscall (freebsd-arm), const TIOCMSDTRWAIT ideal-int +pkg syscall (freebsd-arm), const TIOCMSET ideal-int +pkg syscall (freebsd-arm), const TIOCM_CAR ideal-int +pkg syscall (freebsd-arm), const TIOCM_CD ideal-int +pkg syscall (freebsd-arm), const TIOCM_CTS ideal-int +pkg syscall (freebsd-arm), const TIOCM_DCD ideal-int +pkg syscall (freebsd-arm), const TIOCM_DSR ideal-int +pkg syscall (freebsd-arm), const TIOCM_DTR ideal-int +pkg syscall (freebsd-arm), const TIOCM_LE ideal-int +pkg syscall (freebsd-arm), const TIOCM_RI ideal-int +pkg syscall (freebsd-arm), const TIOCM_RNG ideal-int +pkg syscall (freebsd-arm), const TIOCM_RTS ideal-int +pkg syscall (freebsd-arm), const TIOCM_SR ideal-int +pkg syscall (freebsd-arm), const TIOCM_ST ideal-int +pkg syscall (freebsd-arm), const TIOCNOTTY ideal-int +pkg syscall (freebsd-arm), const TIOCNXCL ideal-int +pkg syscall (freebsd-arm), const TIOCOUTQ ideal-int +pkg syscall (freebsd-arm), const TIOCPKT ideal-int +pkg syscall (freebsd-arm), const TIOCPKT_DATA ideal-int +pkg syscall (freebsd-arm), const TIOCPKT_DOSTOP ideal-int +pkg syscall (freebsd-arm), const TIOCPKT_FLUSHREAD ideal-int +pkg syscall (freebsd-arm), const TIOCPKT_FLUSHWRITE ideal-int +pkg syscall (freebsd-arm), const TIOCPKT_IOCTL ideal-int +pkg syscall (freebsd-arm), const TIOCPKT_NOSTOP ideal-int +pkg syscall (freebsd-arm), const TIOCPKT_START ideal-int +pkg syscall (freebsd-arm), const TIOCPKT_STOP ideal-int +pkg syscall (freebsd-arm), const TIOCPTMASTER ideal-int +pkg syscall (freebsd-arm), const TIOCSBRK ideal-int +pkg syscall (freebsd-arm), const TIOCSCTTY ideal-int +pkg syscall (freebsd-arm), const TIOCSDRAINWAIT ideal-int +pkg syscall (freebsd-arm), const TIOCSDTR ideal-int +pkg syscall (freebsd-arm), const TIOCSETA ideal-int +pkg syscall (freebsd-arm), const TIOCSETAF ideal-int +pkg syscall (freebsd-arm), const TIOCSETAW ideal-int +pkg syscall (freebsd-arm), const TIOCSETD ideal-int +pkg syscall (freebsd-arm), const TIOCSIG ideal-int +pkg syscall (freebsd-arm), const TIOCSPGRP ideal-int +pkg syscall (freebsd-arm), const TIOCSTART ideal-int +pkg syscall (freebsd-arm), const TIOCSTAT ideal-int +pkg syscall (freebsd-arm), const TIOCSTI ideal-int +pkg syscall (freebsd-arm), const TIOCSTOP ideal-int +pkg syscall (freebsd-arm), const TIOCSWINSZ ideal-int +pkg syscall (freebsd-arm), const TIOCTIMESTAMP ideal-int +pkg syscall (freebsd-arm), const TIOCUCNTL ideal-int +pkg syscall (freebsd-arm), const TOSTOP ideal-int +pkg syscall (freebsd-arm), const VDISCARD ideal-int +pkg syscall (freebsd-arm), const VDSUSP ideal-int +pkg syscall (freebsd-arm), const VEOF ideal-int +pkg syscall (freebsd-arm), const VEOL ideal-int +pkg syscall (freebsd-arm), const VEOL2 ideal-int +pkg syscall (freebsd-arm), const VERASE ideal-int +pkg syscall (freebsd-arm), const VERASE2 ideal-int +pkg syscall (freebsd-arm), const VINTR ideal-int +pkg syscall (freebsd-arm), const VKILL ideal-int +pkg syscall (freebsd-arm), const VLNEXT ideal-int +pkg syscall (freebsd-arm), const VMIN ideal-int +pkg syscall (freebsd-arm), const VQUIT ideal-int +pkg syscall (freebsd-arm), const VREPRINT ideal-int +pkg syscall (freebsd-arm), const VSTART ideal-int +pkg syscall (freebsd-arm), const VSTATUS ideal-int +pkg syscall (freebsd-arm), const VSTOP ideal-int +pkg syscall (freebsd-arm), const VSUSP ideal-int +pkg syscall (freebsd-arm), const VTIME ideal-int +pkg syscall (freebsd-arm), const VWERASE ideal-int +pkg syscall (freebsd-arm), const WCONTINUED ideal-int +pkg syscall (freebsd-arm), const WCOREFLAG ideal-int +pkg syscall (freebsd-arm), const WEXITED ideal-int +pkg syscall (freebsd-arm), const WLINUXCLONE ideal-int +pkg syscall (freebsd-arm), const WNOHANG ideal-int +pkg syscall (freebsd-arm), const WNOWAIT ideal-int +pkg syscall (freebsd-arm), const WSTOPPED ideal-int +pkg syscall (freebsd-arm), const WTRAPPED ideal-int +pkg syscall (freebsd-arm), const WUNTRACED ideal-int +pkg syscall (freebsd-arm), func Accept(int) (int, Sockaddr, error) +pkg syscall (freebsd-arm), func Access(string, uint32) error +pkg syscall (freebsd-arm), func Adjtime(*Timeval, *Timeval) error +pkg syscall (freebsd-arm), func Bind(int, Sockaddr) error +pkg syscall (freebsd-arm), func BpfBuflen(int) (int, error) +pkg syscall (freebsd-arm), func BpfDatalink(int) (int, error) +pkg syscall (freebsd-arm), func BpfHeadercmpl(int) (int, error) +pkg syscall (freebsd-arm), func BpfInterface(int, string) (string, error) +pkg syscall (freebsd-arm), func BpfJump(int, int, int, int) *BpfInsn +pkg syscall (freebsd-arm), func BpfStats(int) (*BpfStat, error) +pkg syscall (freebsd-arm), func BpfStmt(int, int) *BpfInsn +pkg syscall (freebsd-arm), func BpfTimeout(int) (*Timeval, error) +pkg syscall (freebsd-arm), func CheckBpfVersion(int) error +pkg syscall (freebsd-arm), func Chflags(string, int) error +pkg syscall (freebsd-arm), func Chroot(string) error +pkg syscall (freebsd-arm), func Close(int) error +pkg syscall (freebsd-arm), func CloseOnExec(int) +pkg syscall (freebsd-arm), func CmsgLen(int) int +pkg syscall (freebsd-arm), func CmsgSpace(int) int +pkg syscall (freebsd-arm), func Connect(int, Sockaddr) error +pkg syscall (freebsd-arm), func Dup(int) (int, error) +pkg syscall (freebsd-arm), func Dup2(int, int) error +pkg syscall (freebsd-arm), func Fchdir(int) error +pkg syscall (freebsd-arm), func Fchflags(string, int) error +pkg syscall (freebsd-arm), func Fchmod(int, uint32) error +pkg syscall (freebsd-arm), func Fchown(int, int, int) error +pkg syscall (freebsd-arm), func Flock(int, int) error +pkg syscall (freebsd-arm), func FlushBpf(int) error +pkg syscall (freebsd-arm), func ForkExec(string, []string, *ProcAttr) (int, error) +pkg syscall (freebsd-arm), func Fpathconf(int, int) (int, error) +pkg syscall (freebsd-arm), func Fstat(int, *Stat_t) error +pkg syscall (freebsd-arm), func Fstatfs(int, *Statfs_t) error +pkg syscall (freebsd-arm), func Fsync(int) error +pkg syscall (freebsd-arm), func Ftruncate(int, int64) error +pkg syscall (freebsd-arm), func Futimes(int, []Timeval) error +pkg syscall (freebsd-arm), func Getdirentries(int, []uint8, *uintptr) (int, error) +pkg syscall (freebsd-arm), func Getdtablesize() int +pkg syscall (freebsd-arm), func Getfsstat([]Statfs_t, int) (int, error) +pkg syscall (freebsd-arm), func Getpeername(int) (Sockaddr, error) +pkg syscall (freebsd-arm), func Getpgid(int) (int, error) +pkg syscall (freebsd-arm), func Getpgrp() int +pkg syscall (freebsd-arm), func Getpriority(int, int) (int, error) +pkg syscall (freebsd-arm), func Getrlimit(int, *Rlimit) error +pkg syscall (freebsd-arm), func Getrusage(int, *Rusage) error +pkg syscall (freebsd-arm), func Getsid(int) (int, error) +pkg syscall (freebsd-arm), func Getsockname(int) (Sockaddr, error) +pkg syscall (freebsd-arm), func GetsockoptByte(int, int, int) (uint8, error) +pkg syscall (freebsd-arm), func GetsockoptICMPv6Filter(int, int, int) (*ICMPv6Filter, error) +pkg syscall (freebsd-arm), func GetsockoptIPMreq(int, int, int) (*IPMreq, error) +pkg syscall (freebsd-arm), func GetsockoptIPMreqn(int, int, int) (*IPMreqn, error) +pkg syscall (freebsd-arm), func GetsockoptIPv6MTUInfo(int, int, int) (*IPv6MTUInfo, error) +pkg syscall (freebsd-arm), func GetsockoptIPv6Mreq(int, int, int) (*IPv6Mreq, error) +pkg syscall (freebsd-arm), func GetsockoptInet4Addr(int, int, int) ([4]uint8, error) +pkg syscall (freebsd-arm), func GetsockoptInt(int, int, int) (int, error) +pkg syscall (freebsd-arm), func Issetugid() bool +pkg syscall (freebsd-arm), func Kevent(int, []Kevent_t, []Kevent_t, *Timespec) (int, error) +pkg syscall (freebsd-arm), func Kill(int, Signal) error +pkg syscall (freebsd-arm), func Kqueue() (int, error) +pkg syscall (freebsd-arm), func Listen(int, int) error +pkg syscall (freebsd-arm), func Lstat(string, *Stat_t) error +pkg syscall (freebsd-arm), func Mkfifo(string, uint32) error +pkg syscall (freebsd-arm), func Mknod(string, uint32, int) error +pkg syscall (freebsd-arm), func Mmap(int, int64, int, int, int) ([]uint8, error) +pkg syscall (freebsd-arm), func Munmap([]uint8) error +pkg syscall (freebsd-arm), func Nanosleep(*Timespec, *Timespec) error +pkg syscall (freebsd-arm), func Open(string, int, uint32) (int, error) +pkg syscall (freebsd-arm), func ParseDirent([]uint8, int, []string) (int, int, []string) +pkg syscall (freebsd-arm), func ParseRoutingMessage([]uint8) ([]RoutingMessage, error) +pkg syscall (freebsd-arm), func ParseRoutingSockaddr(RoutingMessage) ([]Sockaddr, error) +pkg syscall (freebsd-arm), func ParseSocketControlMessage([]uint8) ([]SocketControlMessage, error) +pkg syscall (freebsd-arm), func ParseUnixRights(*SocketControlMessage) ([]int, error) +pkg syscall (freebsd-arm), func Pathconf(string, int) (int, error) +pkg syscall (freebsd-arm), func Pipe([]int) error +pkg syscall (freebsd-arm), func Pread(int, []uint8, int64) (int, error) +pkg syscall (freebsd-arm), func Pwrite(int, []uint8, int64) (int, error) +pkg syscall (freebsd-arm), func RawSyscall(uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno) +pkg syscall (freebsd-arm), func RawSyscall6(uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno) +pkg syscall (freebsd-arm), func Read(int, []uint8) (int, error) +pkg syscall (freebsd-arm), func ReadDirent(int, []uint8) (int, error) +pkg syscall (freebsd-arm), func Recvfrom(int, []uint8, int) (int, Sockaddr, error) +pkg syscall (freebsd-arm), func Recvmsg(int, []uint8, []uint8, int) (int, int, int, Sockaddr, error) +pkg syscall (freebsd-arm), func Revoke(string) error +pkg syscall (freebsd-arm), func RouteRIB(int, int) ([]uint8, error) +pkg syscall (freebsd-arm), func Seek(int, int64, int) (int64, error) +pkg syscall (freebsd-arm), func Select(int, *FdSet, *FdSet, *FdSet, *Timeval) error +pkg syscall (freebsd-arm), func Sendfile(int, int, *int64, int) (int, error) +pkg syscall (freebsd-arm), func Sendmsg(int, []uint8, []uint8, Sockaddr, int) error +pkg syscall (freebsd-arm), func Sendto(int, []uint8, int, Sockaddr) error +pkg syscall (freebsd-arm), func SetBpf(int, []BpfInsn) error +pkg syscall (freebsd-arm), func SetBpfBuflen(int, int) (int, error) +pkg syscall (freebsd-arm), func SetBpfDatalink(int, int) (int, error) +pkg syscall (freebsd-arm), func SetBpfHeadercmpl(int, int) error +pkg syscall (freebsd-arm), func SetBpfImmediate(int, int) error +pkg syscall (freebsd-arm), func SetBpfInterface(int, string) error +pkg syscall (freebsd-arm), func SetBpfPromisc(int, int) error +pkg syscall (freebsd-arm), func SetBpfTimeout(int, *Timeval) error +pkg syscall (freebsd-arm), func SetKevent(*Kevent_t, int, int, int) +pkg syscall (freebsd-arm), func SetNonblock(int, bool) error +pkg syscall (freebsd-arm), func Setegid(int) error +pkg syscall (freebsd-arm), func Seteuid(int) error +pkg syscall (freebsd-arm), func Setgid(int) error +pkg syscall (freebsd-arm), func Setgroups([]int) error +pkg syscall (freebsd-arm), func Setlogin(string) error +pkg syscall (freebsd-arm), func Setpgid(int, int) error +pkg syscall (freebsd-arm), func Setpriority(int, int, int) error +pkg syscall (freebsd-arm), func Setregid(int, int) error +pkg syscall (freebsd-arm), func Setreuid(int, int) error +pkg syscall (freebsd-arm), func Setrlimit(int, *Rlimit) error +pkg syscall (freebsd-arm), func Setsid() (int, error) +pkg syscall (freebsd-arm), func SetsockoptByte(int, int, int, uint8) error +pkg syscall (freebsd-arm), func SetsockoptICMPv6Filter(int, int, int, *ICMPv6Filter) error +pkg syscall (freebsd-arm), func SetsockoptIPMreq(int, int, int, *IPMreq) error +pkg syscall (freebsd-arm), func SetsockoptIPMreqn(int, int, int, *IPMreqn) error +pkg syscall (freebsd-arm), func SetsockoptIPv6Mreq(int, int, int, *IPv6Mreq) error +pkg syscall (freebsd-arm), func SetsockoptInet4Addr(int, int, int, [4]uint8) error +pkg syscall (freebsd-arm), func SetsockoptInt(int, int, int, int) error +pkg syscall (freebsd-arm), func SetsockoptLinger(int, int, int, *Linger) error +pkg syscall (freebsd-arm), func SetsockoptString(int, int, int, string) error +pkg syscall (freebsd-arm), func SetsockoptTimeval(int, int, int, *Timeval) error +pkg syscall (freebsd-arm), func Settimeofday(*Timeval) error +pkg syscall (freebsd-arm), func Setuid(int) error +pkg syscall (freebsd-arm), func Shutdown(int, int) error +pkg syscall (freebsd-arm), func SlicePtrFromStrings([]string) ([]*uint8, error) +pkg syscall (freebsd-arm), func Socket(int, int, int) (int, error) +pkg syscall (freebsd-arm), func Socketpair(int, int, int) ([2]int, error) +pkg syscall (freebsd-arm), func Stat(string, *Stat_t) error +pkg syscall (freebsd-arm), func Statfs(string, *Statfs_t) error +pkg syscall (freebsd-arm), func StringSlicePtr([]string) []*uint8 +pkg syscall (freebsd-arm), func Sync() error +pkg syscall (freebsd-arm), func Syscall(uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno) +pkg syscall (freebsd-arm), func Syscall6(uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno) +pkg syscall (freebsd-arm), func Syscall9(uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno) +pkg syscall (freebsd-arm), func Sysctl(string) (string, error) +pkg syscall (freebsd-arm), func SysctlUint32(string) (uint32, error) +pkg syscall (freebsd-arm), func TimevalToNsec(Timeval) int64 +pkg syscall (freebsd-arm), func Truncate(string, int64) error +pkg syscall (freebsd-arm), func Umask(int) int +pkg syscall (freebsd-arm), func Undelete(string) error +pkg syscall (freebsd-arm), func UnixRights(...int) []uint8 +pkg syscall (freebsd-arm), func Unmount(string, int) error +pkg syscall (freebsd-arm), func Wait4(int, *WaitStatus, int, *Rusage) (int, error) +pkg syscall (freebsd-arm), func Write(int, []uint8) (int, error) +pkg syscall (freebsd-arm), method (*Cmsghdr) SetLen(int) +pkg syscall (freebsd-arm), method (*Iovec) SetLen(int) +pkg syscall (freebsd-arm), method (*Msghdr) SetControllen(int) +pkg syscall (freebsd-arm), type BpfHdr struct +pkg syscall (freebsd-arm), type BpfHdr struct, Caplen uint32 +pkg syscall (freebsd-arm), type BpfHdr struct, Datalen uint32 +pkg syscall (freebsd-arm), type BpfHdr struct, Hdrlen uint16 +pkg syscall (freebsd-arm), type BpfHdr struct, Pad_cgo_0 [2]uint8 +pkg syscall (freebsd-arm), type BpfHdr struct, Tstamp Timeval +pkg syscall (freebsd-arm), type BpfInsn struct +pkg syscall (freebsd-arm), type BpfInsn struct, Code uint16 +pkg syscall (freebsd-arm), type BpfInsn struct, Jf uint8 +pkg syscall (freebsd-arm), type BpfInsn struct, Jt uint8 +pkg syscall (freebsd-arm), type BpfInsn struct, K uint32 +pkg syscall (freebsd-arm), type BpfProgram struct +pkg syscall (freebsd-arm), type BpfProgram struct, Insns *BpfInsn +pkg syscall (freebsd-arm), type BpfProgram struct, Len uint32 +pkg syscall (freebsd-arm), type BpfStat struct +pkg syscall (freebsd-arm), type BpfStat struct, Drop uint32 +pkg syscall (freebsd-arm), type BpfStat struct, Recv uint32 +pkg syscall (freebsd-arm), type BpfVersion struct +pkg syscall (freebsd-arm), type BpfVersion struct, Major uint16 +pkg syscall (freebsd-arm), type BpfVersion struct, Minor uint16 +pkg syscall (freebsd-arm), type BpfZbuf struct +pkg syscall (freebsd-arm), type BpfZbuf struct, Bufa *uint8 +pkg syscall (freebsd-arm), type BpfZbuf struct, Bufb *uint8 +pkg syscall (freebsd-arm), type BpfZbuf struct, Buflen uint32 +pkg syscall (freebsd-arm), type BpfZbufHeader struct +pkg syscall (freebsd-arm), type BpfZbufHeader struct, Kernel_gen uint32 +pkg syscall (freebsd-arm), type BpfZbufHeader struct, Kernel_len uint32 +pkg syscall (freebsd-arm), type BpfZbufHeader struct, User_gen uint32 +pkg syscall (freebsd-arm), type BpfZbufHeader struct, X_bzh_pad [5]uint32 +pkg syscall (freebsd-arm), type Cmsghdr struct +pkg syscall (freebsd-arm), type Cmsghdr struct, Len uint32 +pkg syscall (freebsd-arm), type Cmsghdr struct, Level int32 +pkg syscall (freebsd-arm), type Cmsghdr struct, Type int32 +pkg syscall (freebsd-arm), type Credential struct +pkg syscall (freebsd-arm), type Credential struct, Gid uint32 +pkg syscall (freebsd-arm), type Credential struct, Groups []uint32 +pkg syscall (freebsd-arm), type Credential struct, Uid uint32 +pkg syscall (freebsd-arm), type Dirent struct +pkg syscall (freebsd-arm), type Dirent struct, Fileno uint32 +pkg syscall (freebsd-arm), type Dirent struct, Name [256]int8 +pkg syscall (freebsd-arm), type Dirent struct, Namlen uint8 +pkg syscall (freebsd-arm), type Dirent struct, Reclen uint16 +pkg syscall (freebsd-arm), type Dirent struct, Type uint8 +pkg syscall (freebsd-arm), type FdSet struct +pkg syscall (freebsd-arm), type FdSet struct, X__fds_bits [32]uint32 +pkg syscall (freebsd-arm), type Flock_t struct +pkg syscall (freebsd-arm), type Flock_t struct, Len int64 +pkg syscall (freebsd-arm), type Flock_t struct, Pid int32 +pkg syscall (freebsd-arm), type Flock_t struct, Start int64 +pkg syscall (freebsd-arm), type Flock_t struct, Sysid int32 +pkg syscall (freebsd-arm), type Flock_t struct, Type int16 +pkg syscall (freebsd-arm), type Flock_t struct, Whence int16 +pkg syscall (freebsd-arm), type Fsid struct +pkg syscall (freebsd-arm), type Fsid struct, Val [2]int32 +pkg syscall (freebsd-arm), type ICMPv6Filter struct +pkg syscall (freebsd-arm), type ICMPv6Filter struct, Filt [8]uint32 +pkg syscall (freebsd-arm), type IPMreqn struct +pkg syscall (freebsd-arm), type IPMreqn struct, Address [4]uint8 +pkg syscall (freebsd-arm), type IPMreqn struct, Ifindex int32 +pkg syscall (freebsd-arm), type IPMreqn struct, Multiaddr [4]uint8 +pkg syscall (freebsd-arm), type IPv6MTUInfo struct +pkg syscall (freebsd-arm), type IPv6MTUInfo struct, Addr RawSockaddrInet6 +pkg syscall (freebsd-arm), type IPv6MTUInfo struct, Mtu uint32 +pkg syscall (freebsd-arm), type IfAnnounceMsghdr struct +pkg syscall (freebsd-arm), type IfAnnounceMsghdr struct, Index uint16 +pkg syscall (freebsd-arm), type IfAnnounceMsghdr struct, Msglen uint16 +pkg syscall (freebsd-arm), type IfAnnounceMsghdr struct, Name [16]int8 +pkg syscall (freebsd-arm), type IfAnnounceMsghdr struct, Type uint8 +pkg syscall (freebsd-arm), type IfAnnounceMsghdr struct, Version uint8 +pkg syscall (freebsd-arm), type IfAnnounceMsghdr struct, What uint16 +pkg syscall (freebsd-arm), type IfData struct +pkg syscall (freebsd-arm), type IfData struct, Addrlen uint8 +pkg syscall (freebsd-arm), type IfData struct, Baudrate uint32 +pkg syscall (freebsd-arm), type IfData struct, Collisions uint32 +pkg syscall (freebsd-arm), type IfData struct, Datalen uint8 +pkg syscall (freebsd-arm), type IfData struct, Epoch int64 +pkg syscall (freebsd-arm), type IfData struct, Hdrlen uint8 +pkg syscall (freebsd-arm), type IfData struct, Hwassist uint32 +pkg syscall (freebsd-arm), type IfData struct, Ibytes uint32 +pkg syscall (freebsd-arm), type IfData struct, Ierrors uint32 +pkg syscall (freebsd-arm), type IfData struct, Imcasts uint32 +pkg syscall (freebsd-arm), type IfData struct, Ipackets uint32 +pkg syscall (freebsd-arm), type IfData struct, Iqdrops uint32 +pkg syscall (freebsd-arm), type IfData struct, Lastchange Timeval +pkg syscall (freebsd-arm), type IfData struct, Link_state uint8 +pkg syscall (freebsd-arm), type IfData struct, Metric uint32 +pkg syscall (freebsd-arm), type IfData struct, Mtu uint32 +pkg syscall (freebsd-arm), type IfData struct, Noproto uint32 +pkg syscall (freebsd-arm), type IfData struct, Obytes uint32 +pkg syscall (freebsd-arm), type IfData struct, Oerrors uint32 +pkg syscall (freebsd-arm), type IfData struct, Omcasts uint32 +pkg syscall (freebsd-arm), type IfData struct, Opackets uint32 +pkg syscall (freebsd-arm), type IfData struct, Physical uint8 +pkg syscall (freebsd-arm), type IfData struct, Spare_char1 uint8 +pkg syscall (freebsd-arm), type IfData struct, Spare_char2 uint8 +pkg syscall (freebsd-arm), type IfData struct, Type uint8 +pkg syscall (freebsd-arm), type IfMsghdr struct +pkg syscall (freebsd-arm), type IfMsghdr struct, Addrs int32 +pkg syscall (freebsd-arm), type IfMsghdr struct, Data IfData +pkg syscall (freebsd-arm), type IfMsghdr struct, Flags int32 +pkg syscall (freebsd-arm), type IfMsghdr struct, Index uint16 +pkg syscall (freebsd-arm), type IfMsghdr struct, Msglen uint16 +pkg syscall (freebsd-arm), type IfMsghdr struct, Pad_cgo_0 [2]uint8 +pkg syscall (freebsd-arm), type IfMsghdr struct, Type uint8 +pkg syscall (freebsd-arm), type IfMsghdr struct, Version uint8 +pkg syscall (freebsd-arm), type IfaMsghdr struct +pkg syscall (freebsd-arm), type IfaMsghdr struct, Addrs int32 +pkg syscall (freebsd-arm), type IfaMsghdr struct, Flags int32 +pkg syscall (freebsd-arm), type IfaMsghdr struct, Index uint16 +pkg syscall (freebsd-arm), type IfaMsghdr struct, Metric int32 +pkg syscall (freebsd-arm), type IfaMsghdr struct, Msglen uint16 +pkg syscall (freebsd-arm), type IfaMsghdr struct, Pad_cgo_0 [2]uint8 +pkg syscall (freebsd-arm), type IfaMsghdr struct, Type uint8 +pkg syscall (freebsd-arm), type IfaMsghdr struct, Version uint8 +pkg syscall (freebsd-arm), type IfmaMsghdr struct +pkg syscall (freebsd-arm), type IfmaMsghdr struct, Addrs int32 +pkg syscall (freebsd-arm), type IfmaMsghdr struct, Flags int32 +pkg syscall (freebsd-arm), type IfmaMsghdr struct, Index uint16 +pkg syscall (freebsd-arm), type IfmaMsghdr struct, Msglen uint16 +pkg syscall (freebsd-arm), type IfmaMsghdr struct, Pad_cgo_0 [2]uint8 +pkg syscall (freebsd-arm), type IfmaMsghdr struct, Type uint8 +pkg syscall (freebsd-arm), type IfmaMsghdr struct, Version uint8 +pkg syscall (freebsd-arm), type Inet6Pktinfo struct +pkg syscall (freebsd-arm), type Inet6Pktinfo struct, Addr [16]uint8 +pkg syscall (freebsd-arm), type Inet6Pktinfo struct, Ifindex uint32 +pkg syscall (freebsd-arm), type InterfaceAddrMessage struct +pkg syscall (freebsd-arm), type InterfaceAddrMessage struct, Data []uint8 +pkg syscall (freebsd-arm), type InterfaceAddrMessage struct, Header IfaMsghdr +pkg syscall (freebsd-arm), type InterfaceAnnounceMessage struct +pkg syscall (freebsd-arm), type InterfaceAnnounceMessage struct, Header IfAnnounceMsghdr +pkg syscall (freebsd-arm), type InterfaceMessage struct +pkg syscall (freebsd-arm), type InterfaceMessage struct, Data []uint8 +pkg syscall (freebsd-arm), type InterfaceMessage struct, Header IfMsghdr +pkg syscall (freebsd-arm), type InterfaceMulticastAddrMessage struct +pkg syscall (freebsd-arm), type InterfaceMulticastAddrMessage struct, Data []uint8 +pkg syscall (freebsd-arm), type InterfaceMulticastAddrMessage struct, Header IfmaMsghdr +pkg syscall (freebsd-arm), type Iovec struct +pkg syscall (freebsd-arm), type Iovec struct, Base *uint8 +pkg syscall (freebsd-arm), type Iovec struct, Len uint32 +pkg syscall (freebsd-arm), type Kevent_t struct +pkg syscall (freebsd-arm), type Kevent_t struct, Data int32 +pkg syscall (freebsd-arm), type Kevent_t struct, Fflags uint32 +pkg syscall (freebsd-arm), type Kevent_t struct, Filter int16 +pkg syscall (freebsd-arm), type Kevent_t struct, Flags uint16 +pkg syscall (freebsd-arm), type Kevent_t struct, Ident uint32 +pkg syscall (freebsd-arm), type Kevent_t struct, Udata *uint8 +pkg syscall (freebsd-arm), type Msghdr struct +pkg syscall (freebsd-arm), type Msghdr struct, Control *uint8 +pkg syscall (freebsd-arm), type Msghdr struct, Controllen uint32 +pkg syscall (freebsd-arm), type Msghdr struct, Flags int32 +pkg syscall (freebsd-arm), type Msghdr struct, Iov *Iovec +pkg syscall (freebsd-arm), type Msghdr struct, Iovlen int32 +pkg syscall (freebsd-arm), type Msghdr struct, Name *uint8 +pkg syscall (freebsd-arm), type Msghdr struct, Namelen uint32 +pkg syscall (freebsd-arm), type RawSockaddr struct, Data [14]int8 +pkg syscall (freebsd-arm), type RawSockaddr struct, Family uint8 +pkg syscall (freebsd-arm), type RawSockaddr struct, Len uint8 +pkg syscall (freebsd-arm), type RawSockaddrAny struct, Pad [92]int8 +pkg syscall (freebsd-arm), type RawSockaddrDatalink struct +pkg syscall (freebsd-arm), type RawSockaddrDatalink struct, Alen uint8 +pkg syscall (freebsd-arm), type RawSockaddrDatalink struct, Data [46]int8 +pkg syscall (freebsd-arm), type RawSockaddrDatalink struct, Family uint8 +pkg syscall (freebsd-arm), type RawSockaddrDatalink struct, Index uint16 +pkg syscall (freebsd-arm), type RawSockaddrDatalink struct, Len uint8 +pkg syscall (freebsd-arm), type RawSockaddrDatalink struct, Nlen uint8 +pkg syscall (freebsd-arm), type RawSockaddrDatalink struct, Pad_cgo_0 [2]uint8 +pkg syscall (freebsd-arm), type RawSockaddrDatalink struct, Slen uint8 +pkg syscall (freebsd-arm), type RawSockaddrDatalink struct, Type uint8 +pkg syscall (freebsd-arm), type RawSockaddrInet4 struct, Family uint8 +pkg syscall (freebsd-arm), type RawSockaddrInet4 struct, Len uint8 +pkg syscall (freebsd-arm), type RawSockaddrInet4 struct, Zero [8]int8 +pkg syscall (freebsd-arm), type RawSockaddrInet6 struct, Family uint8 +pkg syscall (freebsd-arm), type RawSockaddrInet6 struct, Len uint8 +pkg syscall (freebsd-arm), type RawSockaddrUnix struct +pkg syscall (freebsd-arm), type RawSockaddrUnix struct, Family uint8 +pkg syscall (freebsd-arm), type RawSockaddrUnix struct, Len uint8 +pkg syscall (freebsd-arm), type RawSockaddrUnix struct, Pad_cgo_0 [2]uint8 +pkg syscall (freebsd-arm), type RawSockaddrUnix struct, Path [104]int8 +pkg syscall (freebsd-arm), type Rlimit struct +pkg syscall (freebsd-arm), type Rlimit struct, Cur int64 +pkg syscall (freebsd-arm), type Rlimit struct, Max int64 +pkg syscall (freebsd-arm), type RouteMessage struct +pkg syscall (freebsd-arm), type RouteMessage struct, Data []uint8 +pkg syscall (freebsd-arm), type RouteMessage struct, Header RtMsghdr +pkg syscall (freebsd-arm), type RoutingMessage interface, unexported methods +pkg syscall (freebsd-arm), type RtMetrics struct +pkg syscall (freebsd-arm), type RtMetrics struct, Expire uint32 +pkg syscall (freebsd-arm), type RtMetrics struct, Filler [3]uint32 +pkg syscall (freebsd-arm), type RtMetrics struct, Hopcount uint32 +pkg syscall (freebsd-arm), type RtMetrics struct, Locks uint32 +pkg syscall (freebsd-arm), type RtMetrics struct, Mtu uint32 +pkg syscall (freebsd-arm), type RtMetrics struct, Pksent uint32 +pkg syscall (freebsd-arm), type RtMetrics struct, Recvpipe uint32 +pkg syscall (freebsd-arm), type RtMetrics struct, Rtt uint32 +pkg syscall (freebsd-arm), type RtMetrics struct, Rttvar uint32 +pkg syscall (freebsd-arm), type RtMetrics struct, Sendpipe uint32 +pkg syscall (freebsd-arm), type RtMetrics struct, Ssthresh uint32 +pkg syscall (freebsd-arm), type RtMetrics struct, Weight uint32 +pkg syscall (freebsd-arm), type RtMsghdr struct +pkg syscall (freebsd-arm), type RtMsghdr struct, Addrs int32 +pkg syscall (freebsd-arm), type RtMsghdr struct, Errno int32 +pkg syscall (freebsd-arm), type RtMsghdr struct, Flags int32 +pkg syscall (freebsd-arm), type RtMsghdr struct, Fmask int32 +pkg syscall (freebsd-arm), type RtMsghdr struct, Index uint16 +pkg syscall (freebsd-arm), type RtMsghdr struct, Inits uint32 +pkg syscall (freebsd-arm), type RtMsghdr struct, Msglen uint16 +pkg syscall (freebsd-arm), type RtMsghdr struct, Pad_cgo_0 [2]uint8 +pkg syscall (freebsd-arm), type RtMsghdr struct, Pid int32 +pkg syscall (freebsd-arm), type RtMsghdr struct, Rmx RtMetrics +pkg syscall (freebsd-arm), type RtMsghdr struct, Seq int32 +pkg syscall (freebsd-arm), type RtMsghdr struct, Type uint8 +pkg syscall (freebsd-arm), type RtMsghdr struct, Version uint8 +pkg syscall (freebsd-arm), type Rusage struct, Idrss int32 +pkg syscall (freebsd-arm), type Rusage struct, Inblock int32 +pkg syscall (freebsd-arm), type Rusage struct, Isrss int32 +pkg syscall (freebsd-arm), type Rusage struct, Ixrss int32 +pkg syscall (freebsd-arm), type Rusage struct, Majflt int32 +pkg syscall (freebsd-arm), type Rusage struct, Maxrss int32 +pkg syscall (freebsd-arm), type Rusage struct, Minflt int32 +pkg syscall (freebsd-arm), type Rusage struct, Msgrcv int32 +pkg syscall (freebsd-arm), type Rusage struct, Msgsnd int32 +pkg syscall (freebsd-arm), type Rusage struct, Nivcsw int32 +pkg syscall (freebsd-arm), type Rusage struct, Nsignals int32 +pkg syscall (freebsd-arm), type Rusage struct, Nswap int32 +pkg syscall (freebsd-arm), type Rusage struct, Nvcsw int32 +pkg syscall (freebsd-arm), type Rusage struct, Oublock int32 +pkg syscall (freebsd-arm), type Rusage struct, Stime Timeval +pkg syscall (freebsd-arm), type Rusage struct, Utime Timeval +pkg syscall (freebsd-arm), type SockaddrDatalink struct +pkg syscall (freebsd-arm), type SockaddrDatalink struct, Alen uint8 +pkg syscall (freebsd-arm), type SockaddrDatalink struct, Data [46]int8 +pkg syscall (freebsd-arm), type SockaddrDatalink struct, Family uint8 +pkg syscall (freebsd-arm), type SockaddrDatalink struct, Index uint16 +pkg syscall (freebsd-arm), type SockaddrDatalink struct, Len uint8 +pkg syscall (freebsd-arm), type SockaddrDatalink struct, Nlen uint8 +pkg syscall (freebsd-arm), type SockaddrDatalink struct, Slen uint8 +pkg syscall (freebsd-arm), type SockaddrDatalink struct, Type uint8 +pkg syscall (freebsd-arm), type SocketControlMessage struct +pkg syscall (freebsd-arm), type SocketControlMessage struct, Data []uint8 +pkg syscall (freebsd-arm), type SocketControlMessage struct, Header Cmsghdr +pkg syscall (freebsd-arm), type Stat_t struct +pkg syscall (freebsd-arm), type Stat_t struct, Atimespec Timespec +pkg syscall (freebsd-arm), type Stat_t struct, Birthtimespec Timespec +pkg syscall (freebsd-arm), type Stat_t struct, Blksize uint32 +pkg syscall (freebsd-arm), type Stat_t struct, Blocks int64 +pkg syscall (freebsd-arm), type Stat_t struct, Ctimespec Timespec +pkg syscall (freebsd-arm), type Stat_t struct, Dev uint32 +pkg syscall (freebsd-arm), type Stat_t struct, Flags uint32 +pkg syscall (freebsd-arm), type Stat_t struct, Gen uint32 +pkg syscall (freebsd-arm), type Stat_t struct, Gid uint32 +pkg syscall (freebsd-arm), type Stat_t struct, Ino uint32 +pkg syscall (freebsd-arm), type Stat_t struct, Lspare int32 +pkg syscall (freebsd-arm), type Stat_t struct, Mode uint16 +pkg syscall (freebsd-arm), type Stat_t struct, Mtimespec Timespec +pkg syscall (freebsd-arm), type Stat_t struct, Nlink uint16 +pkg syscall (freebsd-arm), type Stat_t struct, Pad_cgo_0 [4]uint8 +pkg syscall (freebsd-arm), type Stat_t struct, Rdev uint32 +pkg syscall (freebsd-arm), type Stat_t struct, Size int64 +pkg syscall (freebsd-arm), type Stat_t struct, Uid uint32 +pkg syscall (freebsd-arm), type Statfs_t struct +pkg syscall (freebsd-arm), type Statfs_t struct, Asyncreads uint64 +pkg syscall (freebsd-arm), type Statfs_t struct, Asyncwrites uint64 +pkg syscall (freebsd-arm), type Statfs_t struct, Bavail int64 +pkg syscall (freebsd-arm), type Statfs_t struct, Bfree uint64 +pkg syscall (freebsd-arm), type Statfs_t struct, Blocks uint64 +pkg syscall (freebsd-arm), type Statfs_t struct, Bsize uint64 +pkg syscall (freebsd-arm), type Statfs_t struct, Charspare [80]int8 +pkg syscall (freebsd-arm), type Statfs_t struct, Ffree int64 +pkg syscall (freebsd-arm), type Statfs_t struct, Files uint64 +pkg syscall (freebsd-arm), type Statfs_t struct, Flags uint64 +pkg syscall (freebsd-arm), type Statfs_t struct, Fsid Fsid +pkg syscall (freebsd-arm), type Statfs_t struct, Fstypename [16]int8 +pkg syscall (freebsd-arm), type Statfs_t struct, Iosize uint64 +pkg syscall (freebsd-arm), type Statfs_t struct, Mntfromname [88]int8 +pkg syscall (freebsd-arm), type Statfs_t struct, Mntonname [88]int8 +pkg syscall (freebsd-arm), type Statfs_t struct, Namemax uint32 +pkg syscall (freebsd-arm), type Statfs_t struct, Owner uint32 +pkg syscall (freebsd-arm), type Statfs_t struct, Spare [10]uint64 +pkg syscall (freebsd-arm), type Statfs_t struct, Syncreads uint64 +pkg syscall (freebsd-arm), type Statfs_t struct, Syncwrites uint64 +pkg syscall (freebsd-arm), type Statfs_t struct, Type uint32 +pkg syscall (freebsd-arm), type Statfs_t struct, Version uint32 +pkg syscall (freebsd-arm), type SysProcAttr struct, Chroot string +pkg syscall (freebsd-arm), type SysProcAttr struct, Credential *Credential +pkg syscall (freebsd-arm), type SysProcAttr struct, Noctty bool +pkg syscall (freebsd-arm), type SysProcAttr struct, Ptrace bool +pkg syscall (freebsd-arm), type SysProcAttr struct, Setctty bool +pkg syscall (freebsd-arm), type SysProcAttr struct, Setpgid bool +pkg syscall (freebsd-arm), type SysProcAttr struct, Setsid bool +pkg syscall (freebsd-arm), type Timespec struct, Nsec int32 +pkg syscall (freebsd-arm), type Timespec struct, Sec int64 +pkg syscall (freebsd-arm), type Timeval struct, Sec int64 +pkg syscall (freebsd-arm), type Timeval struct, Usec int32 +pkg syscall (freebsd-arm), type WaitStatus uint32 +pkg syscall (freebsd-arm), var Stderr int +pkg syscall (freebsd-arm), var Stdin int +pkg syscall (freebsd-arm), var Stdout int +pkg syscall (freebsd-arm-cgo), const AF_APPLETALK ideal-int +pkg syscall (freebsd-arm-cgo), const AF_ARP ideal-int +pkg syscall (freebsd-arm-cgo), const AF_ATM ideal-int +pkg syscall (freebsd-arm-cgo), const AF_BLUETOOTH ideal-int +pkg syscall (freebsd-arm-cgo), const AF_CCITT ideal-int +pkg syscall (freebsd-arm-cgo), const AF_CHAOS ideal-int +pkg syscall (freebsd-arm-cgo), const AF_CNT ideal-int +pkg syscall (freebsd-arm-cgo), const AF_COIP ideal-int +pkg syscall (freebsd-arm-cgo), const AF_DATAKIT ideal-int +pkg syscall (freebsd-arm-cgo), const AF_DECnet ideal-int +pkg syscall (freebsd-arm-cgo), const AF_DLI ideal-int +pkg syscall (freebsd-arm-cgo), const AF_E164 ideal-int +pkg syscall (freebsd-arm-cgo), const AF_ECMA ideal-int +pkg syscall (freebsd-arm-cgo), const AF_HYLINK ideal-int +pkg syscall (freebsd-arm-cgo), const AF_IEEE80211 ideal-int +pkg syscall (freebsd-arm-cgo), const AF_IMPLINK ideal-int +pkg syscall (freebsd-arm-cgo), const AF_IPX ideal-int +pkg syscall (freebsd-arm-cgo), const AF_ISDN ideal-int +pkg syscall (freebsd-arm-cgo), const AF_ISO ideal-int +pkg syscall (freebsd-arm-cgo), const AF_LAT ideal-int +pkg syscall (freebsd-arm-cgo), const AF_LINK ideal-int +pkg syscall (freebsd-arm-cgo), const AF_LOCAL ideal-int +pkg syscall (freebsd-arm-cgo), const AF_MAX ideal-int +pkg syscall (freebsd-arm-cgo), const AF_NATM ideal-int +pkg syscall (freebsd-arm-cgo), const AF_NETBIOS ideal-int +pkg syscall (freebsd-arm-cgo), const AF_NETGRAPH ideal-int +pkg syscall (freebsd-arm-cgo), const AF_OSI ideal-int +pkg syscall (freebsd-arm-cgo), const AF_PUP ideal-int +pkg syscall (freebsd-arm-cgo), const AF_ROUTE ideal-int +pkg syscall (freebsd-arm-cgo), const AF_SCLUSTER ideal-int +pkg syscall (freebsd-arm-cgo), const AF_SIP ideal-int +pkg syscall (freebsd-arm-cgo), const AF_SLOW ideal-int +pkg syscall (freebsd-arm-cgo), const AF_SNA ideal-int +pkg syscall (freebsd-arm-cgo), const AF_VENDOR00 ideal-int +pkg syscall (freebsd-arm-cgo), const AF_VENDOR01 ideal-int +pkg syscall (freebsd-arm-cgo), const AF_VENDOR02 ideal-int +pkg syscall (freebsd-arm-cgo), const AF_VENDOR03 ideal-int +pkg syscall (freebsd-arm-cgo), const AF_VENDOR04 ideal-int +pkg syscall (freebsd-arm-cgo), const AF_VENDOR05 ideal-int +pkg syscall (freebsd-arm-cgo), const AF_VENDOR06 ideal-int +pkg syscall (freebsd-arm-cgo), const AF_VENDOR07 ideal-int +pkg syscall (freebsd-arm-cgo), const AF_VENDOR08 ideal-int +pkg syscall (freebsd-arm-cgo), const AF_VENDOR09 ideal-int +pkg syscall (freebsd-arm-cgo), const AF_VENDOR10 ideal-int +pkg syscall (freebsd-arm-cgo), const AF_VENDOR11 ideal-int +pkg syscall (freebsd-arm-cgo), const AF_VENDOR12 ideal-int +pkg syscall (freebsd-arm-cgo), const AF_VENDOR13 ideal-int +pkg syscall (freebsd-arm-cgo), const AF_VENDOR14 ideal-int +pkg syscall (freebsd-arm-cgo), const AF_VENDOR15 ideal-int +pkg syscall (freebsd-arm-cgo), const AF_VENDOR16 ideal-int +pkg syscall (freebsd-arm-cgo), const AF_VENDOR17 ideal-int +pkg syscall (freebsd-arm-cgo), const AF_VENDOR18 ideal-int +pkg syscall (freebsd-arm-cgo), const AF_VENDOR19 ideal-int +pkg syscall (freebsd-arm-cgo), const AF_VENDOR20 ideal-int +pkg syscall (freebsd-arm-cgo), const AF_VENDOR21 ideal-int +pkg syscall (freebsd-arm-cgo), const AF_VENDOR22 ideal-int +pkg syscall (freebsd-arm-cgo), const AF_VENDOR23 ideal-int +pkg syscall (freebsd-arm-cgo), const AF_VENDOR24 ideal-int +pkg syscall (freebsd-arm-cgo), const AF_VENDOR25 ideal-int +pkg syscall (freebsd-arm-cgo), const AF_VENDOR26 ideal-int +pkg syscall (freebsd-arm-cgo), const AF_VENDOR27 ideal-int +pkg syscall (freebsd-arm-cgo), const AF_VENDOR28 ideal-int +pkg syscall (freebsd-arm-cgo), const AF_VENDOR29 ideal-int +pkg syscall (freebsd-arm-cgo), const AF_VENDOR30 ideal-int +pkg syscall (freebsd-arm-cgo), const AF_VENDOR31 ideal-int +pkg syscall (freebsd-arm-cgo), const AF_VENDOR32 ideal-int +pkg syscall (freebsd-arm-cgo), const AF_VENDOR33 ideal-int +pkg syscall (freebsd-arm-cgo), const AF_VENDOR34 ideal-int +pkg syscall (freebsd-arm-cgo), const AF_VENDOR35 ideal-int +pkg syscall (freebsd-arm-cgo), const AF_VENDOR36 ideal-int +pkg syscall (freebsd-arm-cgo), const AF_VENDOR37 ideal-int +pkg syscall (freebsd-arm-cgo), const AF_VENDOR38 ideal-int +pkg syscall (freebsd-arm-cgo), const AF_VENDOR39 ideal-int +pkg syscall (freebsd-arm-cgo), const AF_VENDOR40 ideal-int +pkg syscall (freebsd-arm-cgo), const AF_VENDOR41 ideal-int +pkg syscall (freebsd-arm-cgo), const AF_VENDOR42 ideal-int +pkg syscall (freebsd-arm-cgo), const AF_VENDOR43 ideal-int +pkg syscall (freebsd-arm-cgo), const AF_VENDOR44 ideal-int +pkg syscall (freebsd-arm-cgo), const AF_VENDOR45 ideal-int +pkg syscall (freebsd-arm-cgo), const AF_VENDOR46 ideal-int +pkg syscall (freebsd-arm-cgo), const AF_VENDOR47 ideal-int +pkg syscall (freebsd-arm-cgo), const B0 ideal-int +pkg syscall (freebsd-arm-cgo), const B110 ideal-int +pkg syscall (freebsd-arm-cgo), const B115200 ideal-int +pkg syscall (freebsd-arm-cgo), const B1200 ideal-int +pkg syscall (freebsd-arm-cgo), const B134 ideal-int +pkg syscall (freebsd-arm-cgo), const B14400 ideal-int +pkg syscall (freebsd-arm-cgo), const B150 ideal-int +pkg syscall (freebsd-arm-cgo), const B1800 ideal-int +pkg syscall (freebsd-arm-cgo), const B19200 ideal-int +pkg syscall (freebsd-arm-cgo), const B200 ideal-int +pkg syscall (freebsd-arm-cgo), const B230400 ideal-int +pkg syscall (freebsd-arm-cgo), const B2400 ideal-int +pkg syscall (freebsd-arm-cgo), const B28800 ideal-int +pkg syscall (freebsd-arm-cgo), const B300 ideal-int +pkg syscall (freebsd-arm-cgo), const B38400 ideal-int +pkg syscall (freebsd-arm-cgo), const B460800 ideal-int +pkg syscall (freebsd-arm-cgo), const B4800 ideal-int +pkg syscall (freebsd-arm-cgo), const B50 ideal-int +pkg syscall (freebsd-arm-cgo), const B57600 ideal-int +pkg syscall (freebsd-arm-cgo), const B600 ideal-int +pkg syscall (freebsd-arm-cgo), const B7200 ideal-int +pkg syscall (freebsd-arm-cgo), const B75 ideal-int +pkg syscall (freebsd-arm-cgo), const B76800 ideal-int +pkg syscall (freebsd-arm-cgo), const B921600 ideal-int +pkg syscall (freebsd-arm-cgo), const B9600 ideal-int +pkg syscall (freebsd-arm-cgo), const BIOCFEEDBACK ideal-int +pkg syscall (freebsd-arm-cgo), const BIOCFLUSH ideal-int +pkg syscall (freebsd-arm-cgo), const BIOCGBLEN ideal-int +pkg syscall (freebsd-arm-cgo), const BIOCGDIRECTION ideal-int +pkg syscall (freebsd-arm-cgo), const BIOCGDLT ideal-int +pkg syscall (freebsd-arm-cgo), const BIOCGDLTLIST ideal-int +pkg syscall (freebsd-arm-cgo), const BIOCGETBUFMODE ideal-int +pkg syscall (freebsd-arm-cgo), const BIOCGETIF ideal-int +pkg syscall (freebsd-arm-cgo), const BIOCGETZMAX ideal-int +pkg syscall (freebsd-arm-cgo), const BIOCGHDRCMPLT ideal-int +pkg syscall (freebsd-arm-cgo), const BIOCGRSIG ideal-int +pkg syscall (freebsd-arm-cgo), const BIOCGRTIMEOUT ideal-int +pkg syscall (freebsd-arm-cgo), const BIOCGSEESENT ideal-int +pkg syscall (freebsd-arm-cgo), const BIOCGSTATS ideal-int +pkg syscall (freebsd-arm-cgo), const BIOCGTSTAMP ideal-int +pkg syscall (freebsd-arm-cgo), const BIOCIMMEDIATE ideal-int +pkg syscall (freebsd-arm-cgo), const BIOCLOCK ideal-int +pkg syscall (freebsd-arm-cgo), const BIOCPROMISC ideal-int +pkg syscall (freebsd-arm-cgo), const BIOCROTZBUF ideal-int +pkg syscall (freebsd-arm-cgo), const BIOCSBLEN ideal-int +pkg syscall (freebsd-arm-cgo), const BIOCSDIRECTION ideal-int +pkg syscall (freebsd-arm-cgo), const BIOCSDLT ideal-int +pkg syscall (freebsd-arm-cgo), const BIOCSETBUFMODE ideal-int +pkg syscall (freebsd-arm-cgo), const BIOCSETF ideal-int +pkg syscall (freebsd-arm-cgo), const BIOCSETFNR ideal-int +pkg syscall (freebsd-arm-cgo), const BIOCSETIF ideal-int +pkg syscall (freebsd-arm-cgo), const BIOCSETWF ideal-int +pkg syscall (freebsd-arm-cgo), const BIOCSETZBUF ideal-int +pkg syscall (freebsd-arm-cgo), const BIOCSHDRCMPLT ideal-int +pkg syscall (freebsd-arm-cgo), const BIOCSRSIG ideal-int +pkg syscall (freebsd-arm-cgo), const BIOCSRTIMEOUT ideal-int +pkg syscall (freebsd-arm-cgo), const BIOCSSEESENT ideal-int +pkg syscall (freebsd-arm-cgo), const BIOCSTSTAMP ideal-int +pkg syscall (freebsd-arm-cgo), const BIOCVERSION ideal-int +pkg syscall (freebsd-arm-cgo), const BPF_A ideal-int +pkg syscall (freebsd-arm-cgo), const BPF_ABS ideal-int +pkg syscall (freebsd-arm-cgo), const BPF_ADD ideal-int +pkg syscall (freebsd-arm-cgo), const BPF_ALIGNMENT ideal-int +pkg syscall (freebsd-arm-cgo), const BPF_ALU ideal-int +pkg syscall (freebsd-arm-cgo), const BPF_AND ideal-int +pkg syscall (freebsd-arm-cgo), const BPF_B ideal-int +pkg syscall (freebsd-arm-cgo), const BPF_BUFMODE_BUFFER ideal-int +pkg syscall (freebsd-arm-cgo), const BPF_BUFMODE_ZBUF ideal-int +pkg syscall (freebsd-arm-cgo), const BPF_DIV ideal-int +pkg syscall (freebsd-arm-cgo), const BPF_H ideal-int +pkg syscall (freebsd-arm-cgo), const BPF_IMM ideal-int +pkg syscall (freebsd-arm-cgo), const BPF_IND ideal-int +pkg syscall (freebsd-arm-cgo), const BPF_JA ideal-int +pkg syscall (freebsd-arm-cgo), const BPF_JEQ ideal-int +pkg syscall (freebsd-arm-cgo), const BPF_JGE ideal-int +pkg syscall (freebsd-arm-cgo), const BPF_JGT ideal-int +pkg syscall (freebsd-arm-cgo), const BPF_JMP ideal-int +pkg syscall (freebsd-arm-cgo), const BPF_JSET ideal-int +pkg syscall (freebsd-arm-cgo), const BPF_K ideal-int +pkg syscall (freebsd-arm-cgo), const BPF_LD ideal-int +pkg syscall (freebsd-arm-cgo), const BPF_LDX ideal-int +pkg syscall (freebsd-arm-cgo), const BPF_LEN ideal-int +pkg syscall (freebsd-arm-cgo), const BPF_LSH ideal-int +pkg syscall (freebsd-arm-cgo), const BPF_MAJOR_VERSION ideal-int +pkg syscall (freebsd-arm-cgo), const BPF_MAXBUFSIZE ideal-int +pkg syscall (freebsd-arm-cgo), const BPF_MAXINSNS ideal-int +pkg syscall (freebsd-arm-cgo), const BPF_MEM ideal-int +pkg syscall (freebsd-arm-cgo), const BPF_MEMWORDS ideal-int +pkg syscall (freebsd-arm-cgo), const BPF_MINBUFSIZE ideal-int +pkg syscall (freebsd-arm-cgo), const BPF_MINOR_VERSION ideal-int +pkg syscall (freebsd-arm-cgo), const BPF_MISC ideal-int +pkg syscall (freebsd-arm-cgo), const BPF_MSH ideal-int +pkg syscall (freebsd-arm-cgo), const BPF_MUL ideal-int +pkg syscall (freebsd-arm-cgo), const BPF_NEG ideal-int +pkg syscall (freebsd-arm-cgo), const BPF_OR ideal-int +pkg syscall (freebsd-arm-cgo), const BPF_RELEASE ideal-int +pkg syscall (freebsd-arm-cgo), const BPF_RET ideal-int +pkg syscall (freebsd-arm-cgo), const BPF_RSH ideal-int +pkg syscall (freebsd-arm-cgo), const BPF_ST ideal-int +pkg syscall (freebsd-arm-cgo), const BPF_STX ideal-int +pkg syscall (freebsd-arm-cgo), const BPF_SUB ideal-int +pkg syscall (freebsd-arm-cgo), const BPF_TAX ideal-int +pkg syscall (freebsd-arm-cgo), const BPF_TXA ideal-int +pkg syscall (freebsd-arm-cgo), const BPF_T_BINTIME ideal-int +pkg syscall (freebsd-arm-cgo), const BPF_T_BINTIME_FAST ideal-int +pkg syscall (freebsd-arm-cgo), const BPF_T_BINTIME_MONOTONIC ideal-int +pkg syscall (freebsd-arm-cgo), const BPF_T_BINTIME_MONOTONIC_FAST ideal-int +pkg syscall (freebsd-arm-cgo), const BPF_T_FAST ideal-int +pkg syscall (freebsd-arm-cgo), const BPF_T_FLAG_MASK ideal-int +pkg syscall (freebsd-arm-cgo), const BPF_T_FORMAT_MASK ideal-int +pkg syscall (freebsd-arm-cgo), const BPF_T_MICROTIME ideal-int +pkg syscall (freebsd-arm-cgo), const BPF_T_MICROTIME_FAST ideal-int +pkg syscall (freebsd-arm-cgo), const BPF_T_MICROTIME_MONOTONIC ideal-int +pkg syscall (freebsd-arm-cgo), const BPF_T_MICROTIME_MONOTONIC_FAST ideal-int +pkg syscall (freebsd-arm-cgo), const BPF_T_MONOTONIC ideal-int +pkg syscall (freebsd-arm-cgo), const BPF_T_MONOTONIC_FAST ideal-int +pkg syscall (freebsd-arm-cgo), const BPF_T_NANOTIME ideal-int +pkg syscall (freebsd-arm-cgo), const BPF_T_NANOTIME_FAST ideal-int +pkg syscall (freebsd-arm-cgo), const BPF_T_NANOTIME_MONOTONIC ideal-int +pkg syscall (freebsd-arm-cgo), const BPF_T_NANOTIME_MONOTONIC_FAST ideal-int +pkg syscall (freebsd-arm-cgo), const BPF_T_NONE ideal-int +pkg syscall (freebsd-arm-cgo), const BPF_T_NORMAL ideal-int +pkg syscall (freebsd-arm-cgo), const BPF_W ideal-int +pkg syscall (freebsd-arm-cgo), const BPF_X ideal-int +pkg syscall (freebsd-arm-cgo), const BRKINT ideal-int +pkg syscall (freebsd-arm-cgo), const CFLUSH ideal-int +pkg syscall (freebsd-arm-cgo), const CLOCAL ideal-int +pkg syscall (freebsd-arm-cgo), const CREAD ideal-int +pkg syscall (freebsd-arm-cgo), const CS5 ideal-int +pkg syscall (freebsd-arm-cgo), const CS6 ideal-int +pkg syscall (freebsd-arm-cgo), const CS7 ideal-int +pkg syscall (freebsd-arm-cgo), const CS8 ideal-int +pkg syscall (freebsd-arm-cgo), const CSIZE ideal-int +pkg syscall (freebsd-arm-cgo), const CSTART ideal-int +pkg syscall (freebsd-arm-cgo), const CSTATUS ideal-int +pkg syscall (freebsd-arm-cgo), const CSTOP ideal-int +pkg syscall (freebsd-arm-cgo), const CSTOPB ideal-int +pkg syscall (freebsd-arm-cgo), const CSUSP ideal-int +pkg syscall (freebsd-arm-cgo), const CTL_MAXNAME ideal-int +pkg syscall (freebsd-arm-cgo), const CTL_NET ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_A429 ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_A653_ICM ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_AIRONET_HEADER ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_AOS ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_APPLE_IP_OVER_IEEE1394 ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_ARCNET ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_ARCNET_LINUX ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_ATM_CLIP ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_ATM_RFC1483 ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_AURORA ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_AX25 ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_AX25_KISS ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_BACNET_MS_TP ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_BLUETOOTH_HCI_H4 ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_BLUETOOTH_HCI_H4_WITH_PHDR ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_CAN20B ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_CAN_SOCKETCAN ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_CHAOS ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_CHDLC ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_CISCO_IOS ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_C_HDLC ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_C_HDLC_WITH_DIR ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_DBUS ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_DECT ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_DOCSIS ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_DVB_CI ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_ECONET ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_EN10MB ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_EN3MB ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_ENC ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_ERF ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_ERF_ETH ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_ERF_POS ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_FC_2 ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_FC_2_WITH_FRAME_DELIMS ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_FDDI ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_FLEXRAY ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_FRELAY ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_FRELAY_WITH_DIR ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_GCOM_SERIAL ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_GCOM_T1E1 ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_GPF_F ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_GPF_T ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_GPRS_LLC ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_GSMTAP_ABIS ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_GSMTAP_UM ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_HHDLC ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_IBM_SN ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_IBM_SP ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_IEEE802 ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_IEEE802_11 ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_IEEE802_11_RADIO ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_IEEE802_11_RADIO_AVS ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_IEEE802_15_4 ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_IEEE802_15_4_LINUX ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_IEEE802_15_4_NOFCS ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_IEEE802_15_4_NONASK_PHY ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_IEEE802_16_MAC_CPS ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_IEEE802_16_MAC_CPS_RADIO ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_IPFILTER ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_IPMB ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_IPMB_LINUX ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_IPNET ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_IPOIB ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_IPV4 ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_IPV6 ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_IP_OVER_FC ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_JUNIPER_ATM1 ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_JUNIPER_ATM2 ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_JUNIPER_ATM_CEMIC ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_JUNIPER_CHDLC ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_JUNIPER_ES ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_JUNIPER_ETHER ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_JUNIPER_FIBRECHANNEL ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_JUNIPER_FRELAY ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_JUNIPER_GGSN ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_JUNIPER_ISM ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_JUNIPER_MFR ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_JUNIPER_MLFR ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_JUNIPER_MLPPP ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_JUNIPER_MONITOR ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_JUNIPER_PIC_PEER ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_JUNIPER_PPP ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_JUNIPER_PPPOE ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_JUNIPER_PPPOE_ATM ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_JUNIPER_SERVICES ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_JUNIPER_SRX_E2E ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_JUNIPER_ST ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_JUNIPER_VP ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_JUNIPER_VS ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_LAPB_WITH_DIR ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_LAPD ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_LIN ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_LINUX_EVDEV ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_LINUX_IRDA ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_LINUX_LAPD ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_LINUX_PPP_WITHDIRECTION ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_LINUX_SLL ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_LOOP ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_LTALK ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_MATCHING_MAX ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_MATCHING_MIN ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_MFR ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_MOST ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_MPEG_2_TS ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_MPLS ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_MTP2 ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_MTP2_WITH_PHDR ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_MTP3 ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_MUX27010 ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_NETANALYZER ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_NETANALYZER_TRANSPARENT ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_NFC_LLCP ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_NFLOG ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_NG40 ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_NULL ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_PCI_EXP ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_PFLOG ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_PFSYNC ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_PPI ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_PPP ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_PPP_BSDOS ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_PPP_ETHER ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_PPP_PPPD ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_PPP_SERIAL ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_PPP_WITH_DIR ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_PPP_WITH_DIRECTION ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_PRISM_HEADER ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_PRONET ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_RAIF1 ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_RAW ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_RIO ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_SCCP ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_SITA ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_SLIP ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_SLIP_BSDOS ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_STANAG_5066_D_PDU ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_SUNATM ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_SYMANTEC_FIREWALL ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_TZSP ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_USB ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_USB_LINUX ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_USB_LINUX_MMAPPED ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_USER0 ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_USER1 ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_USER10 ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_USER11 ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_USER12 ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_USER13 ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_USER14 ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_USER15 ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_USER2 ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_USER3 ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_USER4 ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_USER5 ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_USER6 ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_USER7 ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_USER8 ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_USER9 ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_WIHART ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_X2E_SERIAL ideal-int +pkg syscall (freebsd-arm-cgo), const DLT_X2E_XORAYA ideal-int +pkg syscall (freebsd-arm-cgo), const DT_BLK ideal-int +pkg syscall (freebsd-arm-cgo), const DT_CHR ideal-int +pkg syscall (freebsd-arm-cgo), const DT_DIR ideal-int +pkg syscall (freebsd-arm-cgo), const DT_FIFO ideal-int +pkg syscall (freebsd-arm-cgo), const DT_LNK ideal-int +pkg syscall (freebsd-arm-cgo), const DT_REG ideal-int +pkg syscall (freebsd-arm-cgo), const DT_SOCK ideal-int +pkg syscall (freebsd-arm-cgo), const DT_UNKNOWN ideal-int +pkg syscall (freebsd-arm-cgo), const DT_WHT ideal-int +pkg syscall (freebsd-arm-cgo), const EAUTH Errno +pkg syscall (freebsd-arm-cgo), const EBADMSG Errno +pkg syscall (freebsd-arm-cgo), const EBADRPC Errno +pkg syscall (freebsd-arm-cgo), const ECAPMODE Errno +pkg syscall (freebsd-arm-cgo), const ECHO ideal-int +pkg syscall (freebsd-arm-cgo), const ECHOCTL ideal-int +pkg syscall (freebsd-arm-cgo), const ECHOE ideal-int +pkg syscall (freebsd-arm-cgo), const ECHOK ideal-int +pkg syscall (freebsd-arm-cgo), const ECHOKE ideal-int +pkg syscall (freebsd-arm-cgo), const ECHONL ideal-int +pkg syscall (freebsd-arm-cgo), const ECHOPRT ideal-int +pkg syscall (freebsd-arm-cgo), const EDOOFUS Errno +pkg syscall (freebsd-arm-cgo), const EFTYPE Errno +pkg syscall (freebsd-arm-cgo), const ELAST Errno +pkg syscall (freebsd-arm-cgo), const EMULTIHOP Errno +pkg syscall (freebsd-arm-cgo), const ENEEDAUTH Errno +pkg syscall (freebsd-arm-cgo), const ENOATTR Errno +pkg syscall (freebsd-arm-cgo), const ENOLINK Errno +pkg syscall (freebsd-arm-cgo), const ENOTCAPABLE Errno +pkg syscall (freebsd-arm-cgo), const EPROCLIM Errno +pkg syscall (freebsd-arm-cgo), const EPROCUNAVAIL Errno +pkg syscall (freebsd-arm-cgo), const EPROGMISMATCH Errno +pkg syscall (freebsd-arm-cgo), const EPROGUNAVAIL Errno +pkg syscall (freebsd-arm-cgo), const EPROTO Errno +pkg syscall (freebsd-arm-cgo), const ERPCMISMATCH Errno +pkg syscall (freebsd-arm-cgo), const EVFILT_AIO ideal-int +pkg syscall (freebsd-arm-cgo), const EVFILT_FS ideal-int +pkg syscall (freebsd-arm-cgo), const EVFILT_LIO ideal-int +pkg syscall (freebsd-arm-cgo), const EVFILT_PROC ideal-int +pkg syscall (freebsd-arm-cgo), const EVFILT_READ ideal-int +pkg syscall (freebsd-arm-cgo), const EVFILT_SIGNAL ideal-int +pkg syscall (freebsd-arm-cgo), const EVFILT_SYSCOUNT ideal-int +pkg syscall (freebsd-arm-cgo), const EVFILT_TIMER ideal-int +pkg syscall (freebsd-arm-cgo), const EVFILT_USER ideal-int +pkg syscall (freebsd-arm-cgo), const EVFILT_VNODE ideal-int +pkg syscall (freebsd-arm-cgo), const EVFILT_WRITE ideal-int +pkg syscall (freebsd-arm-cgo), const EV_ADD ideal-int +pkg syscall (freebsd-arm-cgo), const EV_CLEAR ideal-int +pkg syscall (freebsd-arm-cgo), const EV_DELETE ideal-int +pkg syscall (freebsd-arm-cgo), const EV_DISABLE ideal-int +pkg syscall (freebsd-arm-cgo), const EV_DISPATCH ideal-int +pkg syscall (freebsd-arm-cgo), const EV_ENABLE ideal-int +pkg syscall (freebsd-arm-cgo), const EV_EOF ideal-int +pkg syscall (freebsd-arm-cgo), const EV_ERROR ideal-int +pkg syscall (freebsd-arm-cgo), const EV_FLAG1 ideal-int +pkg syscall (freebsd-arm-cgo), const EV_ONESHOT ideal-int +pkg syscall (freebsd-arm-cgo), const EV_RECEIPT ideal-int +pkg syscall (freebsd-arm-cgo), const EV_SYSFLAGS ideal-int +pkg syscall (freebsd-arm-cgo), const EXTA ideal-int +pkg syscall (freebsd-arm-cgo), const EXTB ideal-int +pkg syscall (freebsd-arm-cgo), const EXTPROC ideal-int +pkg syscall (freebsd-arm-cgo), const FD_CLOEXEC ideal-int +pkg syscall (freebsd-arm-cgo), const FD_SETSIZE ideal-int +pkg syscall (freebsd-arm-cgo), const FLUSHO ideal-int +pkg syscall (freebsd-arm-cgo), const F_CANCEL ideal-int +pkg syscall (freebsd-arm-cgo), const F_DUP2FD ideal-int +pkg syscall (freebsd-arm-cgo), const F_DUP2FD_CLOEXEC ideal-int +pkg syscall (freebsd-arm-cgo), const F_DUPFD ideal-int +pkg syscall (freebsd-arm-cgo), const F_DUPFD_CLOEXEC ideal-int +pkg syscall (freebsd-arm-cgo), const F_GETFD ideal-int +pkg syscall (freebsd-arm-cgo), const F_GETFL ideal-int +pkg syscall (freebsd-arm-cgo), const F_GETLK ideal-int +pkg syscall (freebsd-arm-cgo), const F_GETOWN ideal-int +pkg syscall (freebsd-arm-cgo), const F_OGETLK ideal-int +pkg syscall (freebsd-arm-cgo), const F_OK ideal-int +pkg syscall (freebsd-arm-cgo), const F_OSETLK ideal-int +pkg syscall (freebsd-arm-cgo), const F_OSETLKW ideal-int +pkg syscall (freebsd-arm-cgo), const F_RDAHEAD ideal-int +pkg syscall (freebsd-arm-cgo), const F_RDLCK ideal-int +pkg syscall (freebsd-arm-cgo), const F_READAHEAD ideal-int +pkg syscall (freebsd-arm-cgo), const F_SETFD ideal-int +pkg syscall (freebsd-arm-cgo), const F_SETFL ideal-int +pkg syscall (freebsd-arm-cgo), const F_SETLK ideal-int +pkg syscall (freebsd-arm-cgo), const F_SETLKW ideal-int +pkg syscall (freebsd-arm-cgo), const F_SETLK_REMOTE ideal-int +pkg syscall (freebsd-arm-cgo), const F_SETOWN ideal-int +pkg syscall (freebsd-arm-cgo), const F_UNLCK ideal-int +pkg syscall (freebsd-arm-cgo), const F_UNLCKSYS ideal-int +pkg syscall (freebsd-arm-cgo), const F_WRLCK ideal-int +pkg syscall (freebsd-arm-cgo), const HUPCL ideal-int +pkg syscall (freebsd-arm-cgo), const ICANON ideal-int +pkg syscall (freebsd-arm-cgo), const ICMP6_FILTER = 18 +pkg syscall (freebsd-arm-cgo), const ICMP6_FILTER ideal-int +pkg syscall (freebsd-arm-cgo), const ICRNL ideal-int +pkg syscall (freebsd-arm-cgo), const IEXTEN ideal-int +pkg syscall (freebsd-arm-cgo), const IFAN_ARRIVAL ideal-int +pkg syscall (freebsd-arm-cgo), const IFAN_DEPARTURE ideal-int +pkg syscall (freebsd-arm-cgo), const IFF_ALLMULTI ideal-int +pkg syscall (freebsd-arm-cgo), const IFF_ALTPHYS ideal-int +pkg syscall (freebsd-arm-cgo), const IFF_CANTCHANGE ideal-int +pkg syscall (freebsd-arm-cgo), const IFF_CANTCONFIG ideal-int +pkg syscall (freebsd-arm-cgo), const IFF_DEBUG ideal-int +pkg syscall (freebsd-arm-cgo), const IFF_DRV_OACTIVE ideal-int +pkg syscall (freebsd-arm-cgo), const IFF_DRV_RUNNING ideal-int +pkg syscall (freebsd-arm-cgo), const IFF_DYING ideal-int +pkg syscall (freebsd-arm-cgo), const IFF_LINK0 ideal-int +pkg syscall (freebsd-arm-cgo), const IFF_LINK1 ideal-int +pkg syscall (freebsd-arm-cgo), const IFF_LINK2 ideal-int +pkg syscall (freebsd-arm-cgo), const IFF_MONITOR ideal-int +pkg syscall (freebsd-arm-cgo), const IFF_NOARP ideal-int +pkg syscall (freebsd-arm-cgo), const IFF_OACTIVE ideal-int +pkg syscall (freebsd-arm-cgo), const IFF_POINTOPOINT ideal-int +pkg syscall (freebsd-arm-cgo), const IFF_PPROMISC ideal-int +pkg syscall (freebsd-arm-cgo), const IFF_PROMISC ideal-int +pkg syscall (freebsd-arm-cgo), const IFF_RENAMING ideal-int +pkg syscall (freebsd-arm-cgo), const IFF_RUNNING ideal-int +pkg syscall (freebsd-arm-cgo), const IFF_SIMPLEX ideal-int +pkg syscall (freebsd-arm-cgo), const IFF_SMART ideal-int +pkg syscall (freebsd-arm-cgo), const IFF_STATICARP ideal-int +pkg syscall (freebsd-arm-cgo), const IFNAMSIZ ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_1822 ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_A12MPPSWITCH ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_AAL2 ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_AAL5 ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_ADSL ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_AFLANE8023 ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_AFLANE8025 ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_ARAP ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_ARCNET ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_ARCNETPLUS ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_ASYNC ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_ATM ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_ATMDXI ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_ATMFUNI ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_ATMIMA ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_ATMLOGICAL ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_ATMRADIO ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_ATMSUBINTERFACE ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_ATMVCIENDPT ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_ATMVIRTUAL ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_BGPPOLICYACCOUNTING ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_BRIDGE ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_BSC ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_CCTEMUL ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_CEPT ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_CES ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_CHANNEL ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_CNR ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_COFFEE ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_COMPOSITELINK ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_DCN ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_DIGITALPOWERLINE ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_DIGITALWRAPPEROVERHEADCHANNEL ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_DLSW ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_DOCSCABLEDOWNSTREAM ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_DOCSCABLEMACLAYER ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_DOCSCABLEUPSTREAM ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_DS0 ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_DS0BUNDLE ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_DS1FDL ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_DS3 ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_DTM ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_DVBASILN ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_DVBASIOUT ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_DVBRCCDOWNSTREAM ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_DVBRCCMACLAYER ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_DVBRCCUPSTREAM ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_ENC ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_EON ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_EPLRS ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_ESCON ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_ETHER ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_FAITH ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_FAST ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_FASTETHER ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_FASTETHERFX ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_FDDI ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_FIBRECHANNEL ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_FRAMERELAYINTERCONNECT ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_FRAMERELAYMPI ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_FRDLCIENDPT ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_FRELAY ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_FRELAYDCE ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_FRF16MFRBUNDLE ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_FRFORWARD ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_G703AT2MB ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_G703AT64K ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_GIF ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_GIGABITETHERNET ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_GR303IDT ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_GR303RDT ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_H323GATEKEEPER ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_H323PROXY ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_HDH1822 ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_HDLC ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_HDSL2 ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_HIPERLAN2 ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_HIPPI ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_HIPPIINTERFACE ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_HOSTPAD ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_HSSI ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_HY ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_IBM370PARCHAN ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_IDSL ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_IEEE1394 ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_IEEE80211 ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_IEEE80212 ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_IEEE8023ADLAG ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_IFGSN ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_IMT ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_INFINIBAND ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_INTERLEAVE ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_IP ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_IPFORWARD ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_IPOVERATM ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_IPOVERCDLC ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_IPOVERCLAW ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_IPSWITCH ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_IPXIP ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_ISDN ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_ISDNBASIC ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_ISDNPRIMARY ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_ISDNS ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_ISDNU ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_ISO88022LLC ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_ISO88023 ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_ISO88024 ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_ISO88025 ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_ISO88025CRFPINT ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_ISO88025DTR ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_ISO88025FIBER ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_ISO88026 ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_ISUP ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_L2VLAN ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_L3IPVLAN ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_L3IPXVLAN ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_LAPB ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_LAPD ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_LAPF ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_LOCALTALK ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_LOOP ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_MEDIAMAILOVERIP ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_MFSIGLINK ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_MIOX25 ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_MODEM ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_MPC ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_MPLS ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_MPLSTUNNEL ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_MSDSL ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_MVL ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_MYRINET ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_NFAS ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_NSIP ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_OPTICALCHANNEL ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_OPTICALTRANSPORT ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_OTHER ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_P10 ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_P80 ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_PARA ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_PFLOG ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_PFSYNC ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_PLC ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_POS ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_PPP ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_PPPMULTILINKBUNDLE ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_PROPBWAP2MP ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_PROPCNLS ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_PROPDOCSWIRELESSDOWNSTREAM ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_PROPDOCSWIRELESSMACLAYER ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_PROPDOCSWIRELESSUPSTREAM ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_PROPMUX ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_PROPVIRTUAL ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_PROPWIRELESSP2P ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_PTPSERIAL ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_PVC ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_QLLC ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_RADIOMAC ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_RADSL ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_REACHDSL ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_RFC1483 ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_RS232 ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_RSRB ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_SDLC ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_SDSL ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_SHDSL ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_SIP ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_SLIP ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_SMDSDXI ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_SMDSICIP ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_SONET ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_SONETOVERHEADCHANNEL ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_SONETPATH ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_SONETVT ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_SRP ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_SS7SIGLINK ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_STACKTOSTACK ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_STARLAN ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_STF ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_T1 ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_TDLC ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_TERMPAD ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_TR008 ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_TRANSPHDLC ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_TUNNEL ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_ULTRA ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_USB ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_V11 ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_V35 ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_V36 ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_V37 ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_VDSL ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_VIRTUALIPADDRESS ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_VOICEEM ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_VOICEENCAP ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_VOICEFXO ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_VOICEFXS ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_VOICEOVERATM ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_VOICEOVERFRAMERELAY ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_VOICEOVERIP ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_X213 ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_X25 ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_X25DDN ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_X25HUNTGROUP ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_X25MLP ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_X25PLE ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_XETHER ideal-int +pkg syscall (freebsd-arm-cgo), const IGNBRK ideal-int +pkg syscall (freebsd-arm-cgo), const IGNCR ideal-int +pkg syscall (freebsd-arm-cgo), const IGNPAR ideal-int +pkg syscall (freebsd-arm-cgo), const IMAXBEL ideal-int +pkg syscall (freebsd-arm-cgo), const INLCR ideal-int +pkg syscall (freebsd-arm-cgo), const INPCK ideal-int +pkg syscall (freebsd-arm-cgo), const IN_CLASSA_HOST ideal-int +pkg syscall (freebsd-arm-cgo), const IN_CLASSA_MAX ideal-int +pkg syscall (freebsd-arm-cgo), const IN_CLASSA_NET ideal-int +pkg syscall (freebsd-arm-cgo), const IN_CLASSA_NSHIFT ideal-int +pkg syscall (freebsd-arm-cgo), const IN_CLASSB_HOST ideal-int +pkg syscall (freebsd-arm-cgo), const IN_CLASSB_MAX ideal-int +pkg syscall (freebsd-arm-cgo), const IN_CLASSB_NET ideal-int +pkg syscall (freebsd-arm-cgo), const IN_CLASSB_NSHIFT ideal-int +pkg syscall (freebsd-arm-cgo), const IN_CLASSC_HOST ideal-int +pkg syscall (freebsd-arm-cgo), const IN_CLASSC_NET ideal-int +pkg syscall (freebsd-arm-cgo), const IN_CLASSC_NSHIFT ideal-int +pkg syscall (freebsd-arm-cgo), const IN_CLASSD_HOST ideal-int +pkg syscall (freebsd-arm-cgo), const IN_CLASSD_NET ideal-int +pkg syscall (freebsd-arm-cgo), const IN_CLASSD_NSHIFT ideal-int +pkg syscall (freebsd-arm-cgo), const IN_LOOPBACKNET ideal-int +pkg syscall (freebsd-arm-cgo), const IN_RFC3021_MASK ideal-int +pkg syscall (freebsd-arm-cgo), const IPPROTO_3PC ideal-int +pkg syscall (freebsd-arm-cgo), const IPPROTO_ADFS ideal-int +pkg syscall (freebsd-arm-cgo), const IPPROTO_AH ideal-int +pkg syscall (freebsd-arm-cgo), const IPPROTO_AHIP ideal-int +pkg syscall (freebsd-arm-cgo), const IPPROTO_APES ideal-int +pkg syscall (freebsd-arm-cgo), const IPPROTO_ARGUS ideal-int +pkg syscall (freebsd-arm-cgo), const IPPROTO_AX25 ideal-int +pkg syscall (freebsd-arm-cgo), const IPPROTO_BHA ideal-int +pkg syscall (freebsd-arm-cgo), const IPPROTO_BLT ideal-int +pkg syscall (freebsd-arm-cgo), const IPPROTO_BRSATMON ideal-int +pkg syscall (freebsd-arm-cgo), const IPPROTO_CARP ideal-int +pkg syscall (freebsd-arm-cgo), const IPPROTO_CFTP ideal-int +pkg syscall (freebsd-arm-cgo), const IPPROTO_CHAOS ideal-int +pkg syscall (freebsd-arm-cgo), const IPPROTO_CMTP ideal-int +pkg syscall (freebsd-arm-cgo), const IPPROTO_CPHB ideal-int +pkg syscall (freebsd-arm-cgo), const IPPROTO_CPNX ideal-int +pkg syscall (freebsd-arm-cgo), const IPPROTO_DDP ideal-int +pkg syscall (freebsd-arm-cgo), const IPPROTO_DGP ideal-int +pkg syscall (freebsd-arm-cgo), const IPPROTO_DIVERT ideal-int +pkg syscall (freebsd-arm-cgo), const IPPROTO_DONE ideal-int +pkg syscall (freebsd-arm-cgo), const IPPROTO_DSTOPTS ideal-int +pkg syscall (freebsd-arm-cgo), const IPPROTO_EGP ideal-int +pkg syscall (freebsd-arm-cgo), const IPPROTO_EMCON ideal-int +pkg syscall (freebsd-arm-cgo), const IPPROTO_ENCAP ideal-int +pkg syscall (freebsd-arm-cgo), const IPPROTO_EON ideal-int +pkg syscall (freebsd-arm-cgo), const IPPROTO_ESP ideal-int +pkg syscall (freebsd-arm-cgo), const IPPROTO_ETHERIP ideal-int +pkg syscall (freebsd-arm-cgo), const IPPROTO_FRAGMENT ideal-int +pkg syscall (freebsd-arm-cgo), const IPPROTO_GGP ideal-int +pkg syscall (freebsd-arm-cgo), const IPPROTO_GMTP ideal-int +pkg syscall (freebsd-arm-cgo), const IPPROTO_GRE ideal-int +pkg syscall (freebsd-arm-cgo), const IPPROTO_HELLO ideal-int +pkg syscall (freebsd-arm-cgo), const IPPROTO_HMP ideal-int +pkg syscall (freebsd-arm-cgo), const IPPROTO_HOPOPTS ideal-int +pkg syscall (freebsd-arm-cgo), const IPPROTO_ICMP ideal-int +pkg syscall (freebsd-arm-cgo), const IPPROTO_ICMPV6 ideal-int +pkg syscall (freebsd-arm-cgo), const IPPROTO_IDP ideal-int +pkg syscall (freebsd-arm-cgo), const IPPROTO_IDPR ideal-int +pkg syscall (freebsd-arm-cgo), const IPPROTO_IDRP ideal-int +pkg syscall (freebsd-arm-cgo), const IPPROTO_IGMP ideal-int +pkg syscall (freebsd-arm-cgo), const IPPROTO_IGP ideal-int +pkg syscall (freebsd-arm-cgo), const IPPROTO_IGRP ideal-int +pkg syscall (freebsd-arm-cgo), const IPPROTO_IL ideal-int +pkg syscall (freebsd-arm-cgo), const IPPROTO_INLSP ideal-int +pkg syscall (freebsd-arm-cgo), const IPPROTO_INP ideal-int +pkg syscall (freebsd-arm-cgo), const IPPROTO_IPCOMP ideal-int +pkg syscall (freebsd-arm-cgo), const IPPROTO_IPCV ideal-int +pkg syscall (freebsd-arm-cgo), const IPPROTO_IPEIP ideal-int +pkg syscall (freebsd-arm-cgo), const IPPROTO_IPIP ideal-int +pkg syscall (freebsd-arm-cgo), const IPPROTO_IPPC ideal-int +pkg syscall (freebsd-arm-cgo), const IPPROTO_IPV4 ideal-int +pkg syscall (freebsd-arm-cgo), const IPPROTO_IRTP ideal-int +pkg syscall (freebsd-arm-cgo), const IPPROTO_KRYPTOLAN ideal-int +pkg syscall (freebsd-arm-cgo), const IPPROTO_LARP ideal-int +pkg syscall (freebsd-arm-cgo), const IPPROTO_LEAF1 ideal-int +pkg syscall (freebsd-arm-cgo), const IPPROTO_LEAF2 ideal-int +pkg syscall (freebsd-arm-cgo), const IPPROTO_MAX ideal-int +pkg syscall (freebsd-arm-cgo), const IPPROTO_MAXID ideal-int +pkg syscall (freebsd-arm-cgo), const IPPROTO_MEAS ideal-int +pkg syscall (freebsd-arm-cgo), const IPPROTO_MH ideal-int +pkg syscall (freebsd-arm-cgo), const IPPROTO_MHRP ideal-int +pkg syscall (freebsd-arm-cgo), const IPPROTO_MICP ideal-int +pkg syscall (freebsd-arm-cgo), const IPPROTO_MOBILE ideal-int +pkg syscall (freebsd-arm-cgo), const IPPROTO_MPLS ideal-int +pkg syscall (freebsd-arm-cgo), const IPPROTO_MTP ideal-int +pkg syscall (freebsd-arm-cgo), const IPPROTO_MUX ideal-int +pkg syscall (freebsd-arm-cgo), const IPPROTO_ND ideal-int +pkg syscall (freebsd-arm-cgo), const IPPROTO_NHRP ideal-int +pkg syscall (freebsd-arm-cgo), const IPPROTO_NONE ideal-int +pkg syscall (freebsd-arm-cgo), const IPPROTO_NSP ideal-int +pkg syscall (freebsd-arm-cgo), const IPPROTO_NVPII ideal-int +pkg syscall (freebsd-arm-cgo), const IPPROTO_OLD_DIVERT ideal-int +pkg syscall (freebsd-arm-cgo), const IPPROTO_OSPFIGP ideal-int +pkg syscall (freebsd-arm-cgo), const IPPROTO_PFSYNC ideal-int +pkg syscall (freebsd-arm-cgo), const IPPROTO_PGM ideal-int +pkg syscall (freebsd-arm-cgo), const IPPROTO_PIGP ideal-int +pkg syscall (freebsd-arm-cgo), const IPPROTO_PIM ideal-int +pkg syscall (freebsd-arm-cgo), const IPPROTO_PRM ideal-int +pkg syscall (freebsd-arm-cgo), const IPPROTO_PUP ideal-int +pkg syscall (freebsd-arm-cgo), const IPPROTO_PVP ideal-int +pkg syscall (freebsd-arm-cgo), const IPPROTO_RAW ideal-int +pkg syscall (freebsd-arm-cgo), const IPPROTO_RCCMON ideal-int +pkg syscall (freebsd-arm-cgo), const IPPROTO_RDP ideal-int +pkg syscall (freebsd-arm-cgo), const IPPROTO_ROUTING ideal-int +pkg syscall (freebsd-arm-cgo), const IPPROTO_RSVP ideal-int +pkg syscall (freebsd-arm-cgo), const IPPROTO_RVD ideal-int +pkg syscall (freebsd-arm-cgo), const IPPROTO_SATEXPAK ideal-int +pkg syscall (freebsd-arm-cgo), const IPPROTO_SATMON ideal-int +pkg syscall (freebsd-arm-cgo), const IPPROTO_SCCSP ideal-int +pkg syscall (freebsd-arm-cgo), const IPPROTO_SCTP ideal-int +pkg syscall (freebsd-arm-cgo), const IPPROTO_SDRP ideal-int +pkg syscall (freebsd-arm-cgo), const IPPROTO_SEND ideal-int +pkg syscall (freebsd-arm-cgo), const IPPROTO_SEP ideal-int +pkg syscall (freebsd-arm-cgo), const IPPROTO_SKIP ideal-int +pkg syscall (freebsd-arm-cgo), const IPPROTO_SPACER ideal-int +pkg syscall (freebsd-arm-cgo), const IPPROTO_SRPC ideal-int +pkg syscall (freebsd-arm-cgo), const IPPROTO_ST ideal-int +pkg syscall (freebsd-arm-cgo), const IPPROTO_SVMTP ideal-int +pkg syscall (freebsd-arm-cgo), const IPPROTO_SWIPE ideal-int +pkg syscall (freebsd-arm-cgo), const IPPROTO_TCF ideal-int +pkg syscall (freebsd-arm-cgo), const IPPROTO_TLSP ideal-int +pkg syscall (freebsd-arm-cgo), const IPPROTO_TP ideal-int +pkg syscall (freebsd-arm-cgo), const IPPROTO_TPXX ideal-int +pkg syscall (freebsd-arm-cgo), const IPPROTO_TRUNK1 ideal-int +pkg syscall (freebsd-arm-cgo), const IPPROTO_TRUNK2 ideal-int +pkg syscall (freebsd-arm-cgo), const IPPROTO_TTP ideal-int +pkg syscall (freebsd-arm-cgo), const IPPROTO_VINES ideal-int +pkg syscall (freebsd-arm-cgo), const IPPROTO_VISA ideal-int +pkg syscall (freebsd-arm-cgo), const IPPROTO_VMTP ideal-int +pkg syscall (freebsd-arm-cgo), const IPPROTO_WBEXPAK ideal-int +pkg syscall (freebsd-arm-cgo), const IPPROTO_WBMON ideal-int +pkg syscall (freebsd-arm-cgo), const IPPROTO_WSN ideal-int +pkg syscall (freebsd-arm-cgo), const IPPROTO_XNET ideal-int +pkg syscall (freebsd-arm-cgo), const IPPROTO_XTP ideal-int +pkg syscall (freebsd-arm-cgo), const IPV6_AUTOFLOWLABEL ideal-int +pkg syscall (freebsd-arm-cgo), const IPV6_BINDANY ideal-int +pkg syscall (freebsd-arm-cgo), const IPV6_BINDV6ONLY ideal-int +pkg syscall (freebsd-arm-cgo), const IPV6_CHECKSUM ideal-int +pkg syscall (freebsd-arm-cgo), const IPV6_DEFAULT_MULTICAST_HOPS ideal-int +pkg syscall (freebsd-arm-cgo), const IPV6_DEFAULT_MULTICAST_LOOP ideal-int +pkg syscall (freebsd-arm-cgo), const IPV6_DEFHLIM ideal-int +pkg syscall (freebsd-arm-cgo), const IPV6_DONTFRAG ideal-int +pkg syscall (freebsd-arm-cgo), const IPV6_DSTOPTS ideal-int +pkg syscall (freebsd-arm-cgo), const IPV6_FAITH ideal-int +pkg syscall (freebsd-arm-cgo), const IPV6_FLOWINFO_MASK ideal-int +pkg syscall (freebsd-arm-cgo), const IPV6_FLOWLABEL_MASK ideal-int +pkg syscall (freebsd-arm-cgo), const IPV6_FRAGTTL ideal-int +pkg syscall (freebsd-arm-cgo), const IPV6_FW_ADD ideal-int +pkg syscall (freebsd-arm-cgo), const IPV6_FW_DEL ideal-int +pkg syscall (freebsd-arm-cgo), const IPV6_FW_FLUSH ideal-int +pkg syscall (freebsd-arm-cgo), const IPV6_FW_GET ideal-int +pkg syscall (freebsd-arm-cgo), const IPV6_FW_ZERO ideal-int +pkg syscall (freebsd-arm-cgo), const IPV6_HLIMDEC ideal-int +pkg syscall (freebsd-arm-cgo), const IPV6_HOPLIMIT ideal-int +pkg syscall (freebsd-arm-cgo), const IPV6_HOPOPTS ideal-int +pkg syscall (freebsd-arm-cgo), const IPV6_IPSEC_POLICY ideal-int +pkg syscall (freebsd-arm-cgo), const IPV6_MAXHLIM ideal-int +pkg syscall (freebsd-arm-cgo), const IPV6_MAXOPTHDR ideal-int +pkg syscall (freebsd-arm-cgo), const IPV6_MAXPACKET ideal-int +pkg syscall (freebsd-arm-cgo), const IPV6_MAX_GROUP_SRC_FILTER ideal-int +pkg syscall (freebsd-arm-cgo), const IPV6_MAX_MEMBERSHIPS ideal-int +pkg syscall (freebsd-arm-cgo), const IPV6_MAX_SOCK_SRC_FILTER ideal-int +pkg syscall (freebsd-arm-cgo), const IPV6_MIN_MEMBERSHIPS ideal-int +pkg syscall (freebsd-arm-cgo), const IPV6_MMTU ideal-int +pkg syscall (freebsd-arm-cgo), const IPV6_MSFILTER ideal-int +pkg syscall (freebsd-arm-cgo), const IPV6_NEXTHOP ideal-int +pkg syscall (freebsd-arm-cgo), const IPV6_PATHMTU ideal-int +pkg syscall (freebsd-arm-cgo), const IPV6_PKTINFO ideal-int +pkg syscall (freebsd-arm-cgo), const IPV6_PORTRANGE ideal-int +pkg syscall (freebsd-arm-cgo), const IPV6_PORTRANGE_DEFAULT ideal-int +pkg syscall (freebsd-arm-cgo), const IPV6_PORTRANGE_HIGH ideal-int +pkg syscall (freebsd-arm-cgo), const IPV6_PORTRANGE_LOW ideal-int +pkg syscall (freebsd-arm-cgo), const IPV6_PREFER_TEMPADDR ideal-int +pkg syscall (freebsd-arm-cgo), const IPV6_RECVDSTOPTS ideal-int +pkg syscall (freebsd-arm-cgo), const IPV6_RECVHOPLIMIT ideal-int +pkg syscall (freebsd-arm-cgo), const IPV6_RECVHOPOPTS ideal-int +pkg syscall (freebsd-arm-cgo), const IPV6_RECVPATHMTU ideal-int +pkg syscall (freebsd-arm-cgo), const IPV6_RECVPKTINFO ideal-int +pkg syscall (freebsd-arm-cgo), const IPV6_RECVRTHDR ideal-int +pkg syscall (freebsd-arm-cgo), const IPV6_RECVTCLASS ideal-int +pkg syscall (freebsd-arm-cgo), const IPV6_RTHDR ideal-int +pkg syscall (freebsd-arm-cgo), const IPV6_RTHDRDSTOPTS ideal-int +pkg syscall (freebsd-arm-cgo), const IPV6_RTHDR_LOOSE ideal-int +pkg syscall (freebsd-arm-cgo), const IPV6_RTHDR_STRICT ideal-int +pkg syscall (freebsd-arm-cgo), const IPV6_RTHDR_TYPE_0 ideal-int +pkg syscall (freebsd-arm-cgo), const IPV6_SOCKOPT_RESERVED1 ideal-int +pkg syscall (freebsd-arm-cgo), const IPV6_TCLASS ideal-int +pkg syscall (freebsd-arm-cgo), const IPV6_USE_MIN_MTU ideal-int +pkg syscall (freebsd-arm-cgo), const IPV6_VERSION ideal-int +pkg syscall (freebsd-arm-cgo), const IPV6_VERSION_MASK ideal-int +pkg syscall (freebsd-arm-cgo), const IP_ADD_SOURCE_MEMBERSHIP ideal-int +pkg syscall (freebsd-arm-cgo), const IP_BINDANY ideal-int +pkg syscall (freebsd-arm-cgo), const IP_BLOCK_SOURCE ideal-int +pkg syscall (freebsd-arm-cgo), const IP_DEFAULT_MULTICAST_LOOP ideal-int +pkg syscall (freebsd-arm-cgo), const IP_DEFAULT_MULTICAST_TTL ideal-int +pkg syscall (freebsd-arm-cgo), const IP_DF ideal-int +pkg syscall (freebsd-arm-cgo), const IP_DONTFRAG ideal-int +pkg syscall (freebsd-arm-cgo), const IP_DROP_SOURCE_MEMBERSHIP ideal-int +pkg syscall (freebsd-arm-cgo), const IP_DUMMYNET3 ideal-int +pkg syscall (freebsd-arm-cgo), const IP_DUMMYNET_CONFIGURE ideal-int +pkg syscall (freebsd-arm-cgo), const IP_DUMMYNET_DEL ideal-int +pkg syscall (freebsd-arm-cgo), const IP_DUMMYNET_FLUSH ideal-int +pkg syscall (freebsd-arm-cgo), const IP_DUMMYNET_GET ideal-int +pkg syscall (freebsd-arm-cgo), const IP_FAITH ideal-int +pkg syscall (freebsd-arm-cgo), const IP_FW3 ideal-int +pkg syscall (freebsd-arm-cgo), const IP_FW_ADD ideal-int +pkg syscall (freebsd-arm-cgo), const IP_FW_DEL ideal-int +pkg syscall (freebsd-arm-cgo), const IP_FW_FLUSH ideal-int +pkg syscall (freebsd-arm-cgo), const IP_FW_GET ideal-int +pkg syscall (freebsd-arm-cgo), const IP_FW_NAT_CFG ideal-int +pkg syscall (freebsd-arm-cgo), const IP_FW_NAT_DEL ideal-int +pkg syscall (freebsd-arm-cgo), const IP_FW_NAT_GET_CONFIG ideal-int +pkg syscall (freebsd-arm-cgo), const IP_FW_NAT_GET_LOG ideal-int +pkg syscall (freebsd-arm-cgo), const IP_FW_RESETLOG ideal-int +pkg syscall (freebsd-arm-cgo), const IP_FW_TABLE_ADD ideal-int +pkg syscall (freebsd-arm-cgo), const IP_FW_TABLE_DEL ideal-int +pkg syscall (freebsd-arm-cgo), const IP_FW_TABLE_FLUSH ideal-int +pkg syscall (freebsd-arm-cgo), const IP_FW_TABLE_GETSIZE ideal-int +pkg syscall (freebsd-arm-cgo), const IP_FW_TABLE_LIST ideal-int +pkg syscall (freebsd-arm-cgo), const IP_FW_ZERO ideal-int +pkg syscall (freebsd-arm-cgo), const IP_HDRINCL ideal-int +pkg syscall (freebsd-arm-cgo), const IP_IPSEC_POLICY ideal-int +pkg syscall (freebsd-arm-cgo), const IP_MAXPACKET ideal-int +pkg syscall (freebsd-arm-cgo), const IP_MAX_GROUP_SRC_FILTER ideal-int +pkg syscall (freebsd-arm-cgo), const IP_MAX_MEMBERSHIPS ideal-int +pkg syscall (freebsd-arm-cgo), const IP_MAX_SOCK_MUTE_FILTER ideal-int +pkg syscall (freebsd-arm-cgo), const IP_MAX_SOCK_SRC_FILTER ideal-int +pkg syscall (freebsd-arm-cgo), const IP_MAX_SOURCE_FILTER ideal-int +pkg syscall (freebsd-arm-cgo), const IP_MF ideal-int +pkg syscall (freebsd-arm-cgo), const IP_MINTTL ideal-int +pkg syscall (freebsd-arm-cgo), const IP_MIN_MEMBERSHIPS ideal-int +pkg syscall (freebsd-arm-cgo), const IP_MSFILTER ideal-int +pkg syscall (freebsd-arm-cgo), const IP_MSS ideal-int +pkg syscall (freebsd-arm-cgo), const IP_MULTICAST_VIF ideal-int +pkg syscall (freebsd-arm-cgo), const IP_OFFMASK ideal-int +pkg syscall (freebsd-arm-cgo), const IP_ONESBCAST ideal-int +pkg syscall (freebsd-arm-cgo), const IP_OPTIONS ideal-int +pkg syscall (freebsd-arm-cgo), const IP_PORTRANGE ideal-int +pkg syscall (freebsd-arm-cgo), const IP_PORTRANGE_DEFAULT ideal-int +pkg syscall (freebsd-arm-cgo), const IP_PORTRANGE_HIGH ideal-int +pkg syscall (freebsd-arm-cgo), const IP_PORTRANGE_LOW ideal-int +pkg syscall (freebsd-arm-cgo), const IP_RECVDSTADDR ideal-int +pkg syscall (freebsd-arm-cgo), const IP_RECVIF ideal-int +pkg syscall (freebsd-arm-cgo), const IP_RECVOPTS ideal-int +pkg syscall (freebsd-arm-cgo), const IP_RECVRETOPTS ideal-int +pkg syscall (freebsd-arm-cgo), const IP_RECVTOS ideal-int +pkg syscall (freebsd-arm-cgo), const IP_RECVTTL ideal-int +pkg syscall (freebsd-arm-cgo), const IP_RETOPTS ideal-int +pkg syscall (freebsd-arm-cgo), const IP_RF ideal-int +pkg syscall (freebsd-arm-cgo), const IP_RSVP_OFF ideal-int +pkg syscall (freebsd-arm-cgo), const IP_RSVP_ON ideal-int +pkg syscall (freebsd-arm-cgo), const IP_RSVP_VIF_OFF ideal-int +pkg syscall (freebsd-arm-cgo), const IP_RSVP_VIF_ON ideal-int +pkg syscall (freebsd-arm-cgo), const IP_SENDSRCADDR ideal-int +pkg syscall (freebsd-arm-cgo), const IP_UNBLOCK_SOURCE ideal-int +pkg syscall (freebsd-arm-cgo), const ISIG ideal-int +pkg syscall (freebsd-arm-cgo), const ISTRIP ideal-int +pkg syscall (freebsd-arm-cgo), const IXANY ideal-int +pkg syscall (freebsd-arm-cgo), const IXOFF ideal-int +pkg syscall (freebsd-arm-cgo), const IXON ideal-int +pkg syscall (freebsd-arm-cgo), const LOCK_EX ideal-int +pkg syscall (freebsd-arm-cgo), const LOCK_NB ideal-int +pkg syscall (freebsd-arm-cgo), const LOCK_SH ideal-int +pkg syscall (freebsd-arm-cgo), const LOCK_UN ideal-int +pkg syscall (freebsd-arm-cgo), const MADV_AUTOSYNC ideal-int +pkg syscall (freebsd-arm-cgo), const MADV_CORE ideal-int +pkg syscall (freebsd-arm-cgo), const MADV_DONTNEED ideal-int +pkg syscall (freebsd-arm-cgo), const MADV_FREE ideal-int +pkg syscall (freebsd-arm-cgo), const MADV_NOCORE ideal-int +pkg syscall (freebsd-arm-cgo), const MADV_NORMAL ideal-int +pkg syscall (freebsd-arm-cgo), const MADV_NOSYNC ideal-int +pkg syscall (freebsd-arm-cgo), const MADV_PROTECT ideal-int +pkg syscall (freebsd-arm-cgo), const MADV_RANDOM ideal-int +pkg syscall (freebsd-arm-cgo), const MADV_SEQUENTIAL ideal-int +pkg syscall (freebsd-arm-cgo), const MADV_WILLNEED ideal-int +pkg syscall (freebsd-arm-cgo), const MAP_ANON ideal-int +pkg syscall (freebsd-arm-cgo), const MAP_ANONYMOUS ideal-int +pkg syscall (freebsd-arm-cgo), const MAP_COPY ideal-int +pkg syscall (freebsd-arm-cgo), const MAP_FILE ideal-int +pkg syscall (freebsd-arm-cgo), const MAP_FIXED ideal-int +pkg syscall (freebsd-arm-cgo), const MAP_HASSEMAPHORE ideal-int +pkg syscall (freebsd-arm-cgo), const MAP_NOCORE ideal-int +pkg syscall (freebsd-arm-cgo), const MAP_NORESERVE ideal-int +pkg syscall (freebsd-arm-cgo), const MAP_NOSYNC ideal-int +pkg syscall (freebsd-arm-cgo), const MAP_PREFAULT_READ ideal-int +pkg syscall (freebsd-arm-cgo), const MAP_PRIVATE ideal-int +pkg syscall (freebsd-arm-cgo), const MAP_RENAME ideal-int +pkg syscall (freebsd-arm-cgo), const MAP_RESERVED0080 ideal-int +pkg syscall (freebsd-arm-cgo), const MAP_RESERVED0100 ideal-int +pkg syscall (freebsd-arm-cgo), const MAP_SHARED ideal-int +pkg syscall (freebsd-arm-cgo), const MAP_STACK ideal-int +pkg syscall (freebsd-arm-cgo), const MCL_CURRENT ideal-int +pkg syscall (freebsd-arm-cgo), const MCL_FUTURE ideal-int +pkg syscall (freebsd-arm-cgo), const MSG_COMPAT ideal-int +pkg syscall (freebsd-arm-cgo), const MSG_CTRUNC ideal-int +pkg syscall (freebsd-arm-cgo), const MSG_DONTROUTE ideal-int +pkg syscall (freebsd-arm-cgo), const MSG_DONTWAIT ideal-int +pkg syscall (freebsd-arm-cgo), const MSG_EOF ideal-int +pkg syscall (freebsd-arm-cgo), const MSG_EOR ideal-int +pkg syscall (freebsd-arm-cgo), const MSG_NBIO ideal-int +pkg syscall (freebsd-arm-cgo), const MSG_NOSIGNAL ideal-int +pkg syscall (freebsd-arm-cgo), const MSG_NOTIFICATION ideal-int +pkg syscall (freebsd-arm-cgo), const MSG_OOB ideal-int +pkg syscall (freebsd-arm-cgo), const MSG_PEEK ideal-int +pkg syscall (freebsd-arm-cgo), const MSG_TRUNC ideal-int +pkg syscall (freebsd-arm-cgo), const MSG_WAITALL ideal-int +pkg syscall (freebsd-arm-cgo), const MS_ASYNC ideal-int +pkg syscall (freebsd-arm-cgo), const MS_INVALIDATE ideal-int +pkg syscall (freebsd-arm-cgo), const MS_SYNC ideal-int +pkg syscall (freebsd-arm-cgo), const NET_RT_DUMP ideal-int +pkg syscall (freebsd-arm-cgo), const NET_RT_FLAGS ideal-int +pkg syscall (freebsd-arm-cgo), const NET_RT_IFLIST ideal-int +pkg syscall (freebsd-arm-cgo), const NET_RT_IFLISTL ideal-int +pkg syscall (freebsd-arm-cgo), const NET_RT_IFMALIST ideal-int +pkg syscall (freebsd-arm-cgo), const NET_RT_MAXID ideal-int +pkg syscall (freebsd-arm-cgo), const NOFLSH ideal-int +pkg syscall (freebsd-arm-cgo), const NOTE_ATTRIB ideal-int +pkg syscall (freebsd-arm-cgo), const NOTE_CHILD ideal-int +pkg syscall (freebsd-arm-cgo), const NOTE_DELETE ideal-int +pkg syscall (freebsd-arm-cgo), const NOTE_EXEC ideal-int +pkg syscall (freebsd-arm-cgo), const NOTE_EXIT ideal-int +pkg syscall (freebsd-arm-cgo), const NOTE_EXTEND ideal-int +pkg syscall (freebsd-arm-cgo), const NOTE_FFAND ideal-int +pkg syscall (freebsd-arm-cgo), const NOTE_FFCOPY ideal-int +pkg syscall (freebsd-arm-cgo), const NOTE_FFCTRLMASK ideal-int +pkg syscall (freebsd-arm-cgo), const NOTE_FFLAGSMASK ideal-int +pkg syscall (freebsd-arm-cgo), const NOTE_FFNOP ideal-int +pkg syscall (freebsd-arm-cgo), const NOTE_FFOR ideal-int +pkg syscall (freebsd-arm-cgo), const NOTE_FORK ideal-int +pkg syscall (freebsd-arm-cgo), const NOTE_LINK ideal-int +pkg syscall (freebsd-arm-cgo), const NOTE_LOWAT ideal-int +pkg syscall (freebsd-arm-cgo), const NOTE_PCTRLMASK ideal-int +pkg syscall (freebsd-arm-cgo), const NOTE_PDATAMASK ideal-int +pkg syscall (freebsd-arm-cgo), const NOTE_RENAME ideal-int +pkg syscall (freebsd-arm-cgo), const NOTE_REVOKE ideal-int +pkg syscall (freebsd-arm-cgo), const NOTE_TRACK ideal-int +pkg syscall (freebsd-arm-cgo), const NOTE_TRACKERR ideal-int +pkg syscall (freebsd-arm-cgo), const NOTE_TRIGGER ideal-int +pkg syscall (freebsd-arm-cgo), const NOTE_WRITE ideal-int +pkg syscall (freebsd-arm-cgo), const OCRNL ideal-int +pkg syscall (freebsd-arm-cgo), const ONLCR ideal-int +pkg syscall (freebsd-arm-cgo), const ONLRET ideal-int +pkg syscall (freebsd-arm-cgo), const ONOCR ideal-int +pkg syscall (freebsd-arm-cgo), const ONOEOT ideal-int +pkg syscall (freebsd-arm-cgo), const OPOST ideal-int +pkg syscall (freebsd-arm-cgo), const O_ACCMODE ideal-int +pkg syscall (freebsd-arm-cgo), const O_DIRECT ideal-int +pkg syscall (freebsd-arm-cgo), const O_DIRECTORY ideal-int +pkg syscall (freebsd-arm-cgo), const O_EXEC ideal-int +pkg syscall (freebsd-arm-cgo), const O_EXLOCK ideal-int +pkg syscall (freebsd-arm-cgo), const O_FSYNC ideal-int +pkg syscall (freebsd-arm-cgo), const O_NDELAY ideal-int +pkg syscall (freebsd-arm-cgo), const O_NOFOLLOW ideal-int +pkg syscall (freebsd-arm-cgo), const O_SHLOCK ideal-int +pkg syscall (freebsd-arm-cgo), const O_TTY_INIT ideal-int +pkg syscall (freebsd-arm-cgo), const PARENB ideal-int +pkg syscall (freebsd-arm-cgo), const PARMRK ideal-int +pkg syscall (freebsd-arm-cgo), const PARODD ideal-int +pkg syscall (freebsd-arm-cgo), const PENDIN ideal-int +pkg syscall (freebsd-arm-cgo), const PRIO_PGRP = 1 +pkg syscall (freebsd-arm-cgo), const PRIO_PGRP ideal-int +pkg syscall (freebsd-arm-cgo), const PRIO_PROCESS = 0 +pkg syscall (freebsd-arm-cgo), const PRIO_PROCESS ideal-int +pkg syscall (freebsd-arm-cgo), const PRIO_USER = 2 +pkg syscall (freebsd-arm-cgo), const PRIO_USER ideal-int +pkg syscall (freebsd-arm-cgo), const PROT_EXEC ideal-int +pkg syscall (freebsd-arm-cgo), const PROT_NONE ideal-int +pkg syscall (freebsd-arm-cgo), const PROT_READ ideal-int +pkg syscall (freebsd-arm-cgo), const PROT_WRITE ideal-int +pkg syscall (freebsd-arm-cgo), const PTRACE_CONT ideal-int +pkg syscall (freebsd-arm-cgo), const PTRACE_KILL ideal-int +pkg syscall (freebsd-arm-cgo), const PTRACE_TRACEME ideal-int +pkg syscall (freebsd-arm-cgo), const RLIMIT_AS ideal-int +pkg syscall (freebsd-arm-cgo), const RLIMIT_CORE ideal-int +pkg syscall (freebsd-arm-cgo), const RLIMIT_CPU ideal-int +pkg syscall (freebsd-arm-cgo), const RLIMIT_DATA ideal-int +pkg syscall (freebsd-arm-cgo), const RLIMIT_FSIZE ideal-int +pkg syscall (freebsd-arm-cgo), const RLIMIT_NOFILE ideal-int +pkg syscall (freebsd-arm-cgo), const RLIMIT_STACK ideal-int +pkg syscall (freebsd-arm-cgo), const RLIM_INFINITY ideal-int +pkg syscall (freebsd-arm-cgo), const RTAX_AUTHOR ideal-int +pkg syscall (freebsd-arm-cgo), const RTAX_BRD ideal-int +pkg syscall (freebsd-arm-cgo), const RTAX_DST ideal-int +pkg syscall (freebsd-arm-cgo), const RTAX_GATEWAY ideal-int +pkg syscall (freebsd-arm-cgo), const RTAX_GENMASK ideal-int +pkg syscall (freebsd-arm-cgo), const RTAX_IFA ideal-int +pkg syscall (freebsd-arm-cgo), const RTAX_IFP ideal-int +pkg syscall (freebsd-arm-cgo), const RTAX_MAX ideal-int +pkg syscall (freebsd-arm-cgo), const RTAX_NETMASK ideal-int +pkg syscall (freebsd-arm-cgo), const RTA_AUTHOR ideal-int +pkg syscall (freebsd-arm-cgo), const RTA_BRD ideal-int +pkg syscall (freebsd-arm-cgo), const RTA_DST ideal-int +pkg syscall (freebsd-arm-cgo), const RTA_GATEWAY ideal-int +pkg syscall (freebsd-arm-cgo), const RTA_GENMASK ideal-int +pkg syscall (freebsd-arm-cgo), const RTA_IFA ideal-int +pkg syscall (freebsd-arm-cgo), const RTA_IFP ideal-int +pkg syscall (freebsd-arm-cgo), const RTA_NETMASK ideal-int +pkg syscall (freebsd-arm-cgo), const RTF_BLACKHOLE ideal-int +pkg syscall (freebsd-arm-cgo), const RTF_BROADCAST ideal-int +pkg syscall (freebsd-arm-cgo), const RTF_DONE ideal-int +pkg syscall (freebsd-arm-cgo), const RTF_DYNAMIC ideal-int +pkg syscall (freebsd-arm-cgo), const RTF_FMASK ideal-int +pkg syscall (freebsd-arm-cgo), const RTF_GATEWAY ideal-int +pkg syscall (freebsd-arm-cgo), const RTF_HOST ideal-int +pkg syscall (freebsd-arm-cgo), const RTF_LLDATA ideal-int +pkg syscall (freebsd-arm-cgo), const RTF_LLINFO ideal-int +pkg syscall (freebsd-arm-cgo), const RTF_LOCAL ideal-int +pkg syscall (freebsd-arm-cgo), const RTF_MODIFIED ideal-int +pkg syscall (freebsd-arm-cgo), const RTF_MULTICAST ideal-int +pkg syscall (freebsd-arm-cgo), const RTF_PINNED ideal-int +pkg syscall (freebsd-arm-cgo), const RTF_PRCLONING ideal-int +pkg syscall (freebsd-arm-cgo), const RTF_PROTO1 ideal-int +pkg syscall (freebsd-arm-cgo), const RTF_PROTO2 ideal-int +pkg syscall (freebsd-arm-cgo), const RTF_PROTO3 ideal-int +pkg syscall (freebsd-arm-cgo), const RTF_REJECT ideal-int +pkg syscall (freebsd-arm-cgo), const RTF_RNH_LOCKED ideal-int +pkg syscall (freebsd-arm-cgo), const RTF_STATIC ideal-int +pkg syscall (freebsd-arm-cgo), const RTF_STICKY ideal-int +pkg syscall (freebsd-arm-cgo), const RTF_UP ideal-int +pkg syscall (freebsd-arm-cgo), const RTF_XRESOLVE ideal-int +pkg syscall (freebsd-arm-cgo), const RTM_ADD ideal-int +pkg syscall (freebsd-arm-cgo), const RTM_CHANGE ideal-int +pkg syscall (freebsd-arm-cgo), const RTM_DELADDR ideal-int +pkg syscall (freebsd-arm-cgo), const RTM_DELETE ideal-int +pkg syscall (freebsd-arm-cgo), const RTM_DELMADDR ideal-int +pkg syscall (freebsd-arm-cgo), const RTM_GET ideal-int +pkg syscall (freebsd-arm-cgo), const RTM_IEEE80211 ideal-int +pkg syscall (freebsd-arm-cgo), const RTM_IFANNOUNCE ideal-int +pkg syscall (freebsd-arm-cgo), const RTM_IFINFO ideal-int +pkg syscall (freebsd-arm-cgo), const RTM_LOCK ideal-int +pkg syscall (freebsd-arm-cgo), const RTM_LOSING ideal-int +pkg syscall (freebsd-arm-cgo), const RTM_MISS ideal-int +pkg syscall (freebsd-arm-cgo), const RTM_NEWADDR ideal-int +pkg syscall (freebsd-arm-cgo), const RTM_NEWMADDR ideal-int +pkg syscall (freebsd-arm-cgo), const RTM_OLDADD ideal-int +pkg syscall (freebsd-arm-cgo), const RTM_OLDDEL ideal-int +pkg syscall (freebsd-arm-cgo), const RTM_REDIRECT ideal-int +pkg syscall (freebsd-arm-cgo), const RTM_RESOLVE ideal-int +pkg syscall (freebsd-arm-cgo), const RTM_RTTUNIT ideal-int +pkg syscall (freebsd-arm-cgo), const RTM_VERSION ideal-int +pkg syscall (freebsd-arm-cgo), const RTV_EXPIRE ideal-int +pkg syscall (freebsd-arm-cgo), const RTV_HOPCOUNT ideal-int +pkg syscall (freebsd-arm-cgo), const RTV_MTU ideal-int +pkg syscall (freebsd-arm-cgo), const RTV_RPIPE ideal-int +pkg syscall (freebsd-arm-cgo), const RTV_RTT ideal-int +pkg syscall (freebsd-arm-cgo), const RTV_RTTVAR ideal-int +pkg syscall (freebsd-arm-cgo), const RTV_SPIPE ideal-int +pkg syscall (freebsd-arm-cgo), const RTV_SSTHRESH ideal-int +pkg syscall (freebsd-arm-cgo), const RTV_WEIGHT ideal-int +pkg syscall (freebsd-arm-cgo), const RT_CACHING_CONTEXT ideal-int +pkg syscall (freebsd-arm-cgo), const RT_DEFAULT_FIB ideal-int +pkg syscall (freebsd-arm-cgo), const RT_NORTREF ideal-int +pkg syscall (freebsd-arm-cgo), const RUSAGE_CHILDREN ideal-int +pkg syscall (freebsd-arm-cgo), const RUSAGE_SELF ideal-int +pkg syscall (freebsd-arm-cgo), const RUSAGE_THREAD ideal-int +pkg syscall (freebsd-arm-cgo), const SCM_BINTIME ideal-int +pkg syscall (freebsd-arm-cgo), const SCM_CREDS ideal-int +pkg syscall (freebsd-arm-cgo), const SCM_RIGHTS ideal-int +pkg syscall (freebsd-arm-cgo), const SCM_TIMESTAMP ideal-int +pkg syscall (freebsd-arm-cgo), const SIGCHLD Signal +pkg syscall (freebsd-arm-cgo), const SIGCONT Signal +pkg syscall (freebsd-arm-cgo), const SIGEMT Signal +pkg syscall (freebsd-arm-cgo), const SIGINFO Signal +pkg syscall (freebsd-arm-cgo), const SIGIO Signal +pkg syscall (freebsd-arm-cgo), const SIGIOT Signal +pkg syscall (freebsd-arm-cgo), const SIGLIBRT Signal +pkg syscall (freebsd-arm-cgo), const SIGLWP Signal +pkg syscall (freebsd-arm-cgo), const SIGPROF Signal +pkg syscall (freebsd-arm-cgo), const SIGSTOP Signal +pkg syscall (freebsd-arm-cgo), const SIGSYS Signal +pkg syscall (freebsd-arm-cgo), const SIGTHR Signal +pkg syscall (freebsd-arm-cgo), const SIGTSTP Signal +pkg syscall (freebsd-arm-cgo), const SIGTTIN Signal +pkg syscall (freebsd-arm-cgo), const SIGTTOU Signal +pkg syscall (freebsd-arm-cgo), const SIGURG Signal +pkg syscall (freebsd-arm-cgo), const SIGUSR1 Signal +pkg syscall (freebsd-arm-cgo), const SIGUSR2 Signal +pkg syscall (freebsd-arm-cgo), const SIGVTALRM Signal +pkg syscall (freebsd-arm-cgo), const SIGWINCH Signal +pkg syscall (freebsd-arm-cgo), const SIGXCPU Signal +pkg syscall (freebsd-arm-cgo), const SIGXFSZ Signal +pkg syscall (freebsd-arm-cgo), const SIOCADDMULTI ideal-int +pkg syscall (freebsd-arm-cgo), const SIOCADDRT ideal-int +pkg syscall (freebsd-arm-cgo), const SIOCAIFADDR ideal-int +pkg syscall (freebsd-arm-cgo), const SIOCAIFGROUP ideal-int +pkg syscall (freebsd-arm-cgo), const SIOCALIFADDR ideal-int +pkg syscall (freebsd-arm-cgo), const SIOCATMARK ideal-int +pkg syscall (freebsd-arm-cgo), const SIOCDELMULTI ideal-int +pkg syscall (freebsd-arm-cgo), const SIOCDELRT ideal-int +pkg syscall (freebsd-arm-cgo), const SIOCDIFADDR ideal-int +pkg syscall (freebsd-arm-cgo), const SIOCDIFGROUP ideal-int +pkg syscall (freebsd-arm-cgo), const SIOCDIFPHYADDR ideal-int +pkg syscall (freebsd-arm-cgo), const SIOCDLIFADDR ideal-int +pkg syscall (freebsd-arm-cgo), const SIOCGDRVSPEC ideal-int +pkg syscall (freebsd-arm-cgo), const SIOCGETSGCNT ideal-int +pkg syscall (freebsd-arm-cgo), const SIOCGETVIFCNT ideal-int +pkg syscall (freebsd-arm-cgo), const SIOCGHIWAT ideal-int +pkg syscall (freebsd-arm-cgo), const SIOCGIFADDR ideal-int +pkg syscall (freebsd-arm-cgo), const SIOCGIFBRDADDR ideal-int +pkg syscall (freebsd-arm-cgo), const SIOCGIFCAP ideal-int +pkg syscall (freebsd-arm-cgo), const SIOCGIFCONF ideal-int +pkg syscall (freebsd-arm-cgo), const SIOCGIFDESCR ideal-int +pkg syscall (freebsd-arm-cgo), const SIOCGIFDSTADDR ideal-int +pkg syscall (freebsd-arm-cgo), const SIOCGIFFIB ideal-int +pkg syscall (freebsd-arm-cgo), const SIOCGIFFLAGS ideal-int +pkg syscall (freebsd-arm-cgo), const SIOCGIFGENERIC ideal-int +pkg syscall (freebsd-arm-cgo), const SIOCGIFGMEMB ideal-int +pkg syscall (freebsd-arm-cgo), const SIOCGIFGROUP ideal-int +pkg syscall (freebsd-arm-cgo), const SIOCGIFINDEX ideal-int +pkg syscall (freebsd-arm-cgo), const SIOCGIFMAC ideal-int +pkg syscall (freebsd-arm-cgo), const SIOCGIFMEDIA ideal-int +pkg syscall (freebsd-arm-cgo), const SIOCGIFMETRIC ideal-int +pkg syscall (freebsd-arm-cgo), const SIOCGIFMTU ideal-int +pkg syscall (freebsd-arm-cgo), const SIOCGIFNETMASK ideal-int +pkg syscall (freebsd-arm-cgo), const SIOCGIFPDSTADDR ideal-int +pkg syscall (freebsd-arm-cgo), const SIOCGIFPHYS ideal-int +pkg syscall (freebsd-arm-cgo), const SIOCGIFPSRCADDR ideal-int +pkg syscall (freebsd-arm-cgo), const SIOCGIFSTATUS ideal-int +pkg syscall (freebsd-arm-cgo), const SIOCGLIFADDR ideal-int +pkg syscall (freebsd-arm-cgo), const SIOCGLIFPHYADDR ideal-int +pkg syscall (freebsd-arm-cgo), const SIOCGLOWAT ideal-int +pkg syscall (freebsd-arm-cgo), const SIOCGPGRP ideal-int +pkg syscall (freebsd-arm-cgo), const SIOCGPRIVATE_0 ideal-int +pkg syscall (freebsd-arm-cgo), const SIOCGPRIVATE_1 ideal-int +pkg syscall (freebsd-arm-cgo), const SIOCIFCREATE ideal-int +pkg syscall (freebsd-arm-cgo), const SIOCIFCREATE2 ideal-int +pkg syscall (freebsd-arm-cgo), const SIOCIFDESTROY ideal-int +pkg syscall (freebsd-arm-cgo), const SIOCIFGCLONERS ideal-int +pkg syscall (freebsd-arm-cgo), const SIOCSDRVSPEC ideal-int +pkg syscall (freebsd-arm-cgo), const SIOCSHIWAT ideal-int +pkg syscall (freebsd-arm-cgo), const SIOCSIFADDR ideal-int +pkg syscall (freebsd-arm-cgo), const SIOCSIFBRDADDR ideal-int +pkg syscall (freebsd-arm-cgo), const SIOCSIFCAP ideal-int +pkg syscall (freebsd-arm-cgo), const SIOCSIFDESCR ideal-int +pkg syscall (freebsd-arm-cgo), const SIOCSIFDSTADDR ideal-int +pkg syscall (freebsd-arm-cgo), const SIOCSIFFIB ideal-int +pkg syscall (freebsd-arm-cgo), const SIOCSIFFLAGS ideal-int +pkg syscall (freebsd-arm-cgo), const SIOCSIFGENERIC ideal-int +pkg syscall (freebsd-arm-cgo), const SIOCSIFLLADDR ideal-int +pkg syscall (freebsd-arm-cgo), const SIOCSIFMAC ideal-int +pkg syscall (freebsd-arm-cgo), const SIOCSIFMEDIA ideal-int +pkg syscall (freebsd-arm-cgo), const SIOCSIFMETRIC ideal-int +pkg syscall (freebsd-arm-cgo), const SIOCSIFMTU ideal-int +pkg syscall (freebsd-arm-cgo), const SIOCSIFNAME ideal-int +pkg syscall (freebsd-arm-cgo), const SIOCSIFNETMASK ideal-int +pkg syscall (freebsd-arm-cgo), const SIOCSIFPHYADDR ideal-int +pkg syscall (freebsd-arm-cgo), const SIOCSIFPHYS ideal-int +pkg syscall (freebsd-arm-cgo), const SIOCSIFRVNET ideal-int +pkg syscall (freebsd-arm-cgo), const SIOCSIFVNET ideal-int +pkg syscall (freebsd-arm-cgo), const SIOCSLIFPHYADDR ideal-int +pkg syscall (freebsd-arm-cgo), const SIOCSLOWAT ideal-int +pkg syscall (freebsd-arm-cgo), const SIOCSPGRP ideal-int +pkg syscall (freebsd-arm-cgo), const SOCK_MAXADDRLEN ideal-int +pkg syscall (freebsd-arm-cgo), const SOCK_RDM ideal-int +pkg syscall (freebsd-arm-cgo), const SO_ACCEPTCONN ideal-int +pkg syscall (freebsd-arm-cgo), const SO_ACCEPTFILTER ideal-int +pkg syscall (freebsd-arm-cgo), const SO_BINTIME ideal-int +pkg syscall (freebsd-arm-cgo), const SO_DEBUG ideal-int +pkg syscall (freebsd-arm-cgo), const SO_ERROR ideal-int +pkg syscall (freebsd-arm-cgo), const SO_LABEL ideal-int +pkg syscall (freebsd-arm-cgo), const SO_LISTENINCQLEN ideal-int +pkg syscall (freebsd-arm-cgo), const SO_LISTENQLEN ideal-int +pkg syscall (freebsd-arm-cgo), const SO_LISTENQLIMIT ideal-int +pkg syscall (freebsd-arm-cgo), const SO_NOSIGPIPE ideal-int +pkg syscall (freebsd-arm-cgo), const SO_NO_DDP ideal-int +pkg syscall (freebsd-arm-cgo), const SO_NO_OFFLOAD ideal-int +pkg syscall (freebsd-arm-cgo), const SO_OOBINLINE ideal-int +pkg syscall (freebsd-arm-cgo), const SO_PEERLABEL ideal-int +pkg syscall (freebsd-arm-cgo), const SO_PROTOCOL ideal-int +pkg syscall (freebsd-arm-cgo), const SO_PROTOTYPE ideal-int +pkg syscall (freebsd-arm-cgo), const SO_RCVLOWAT ideal-int +pkg syscall (freebsd-arm-cgo), const SO_RCVTIMEO ideal-int +pkg syscall (freebsd-arm-cgo), const SO_REUSEPORT ideal-int +pkg syscall (freebsd-arm-cgo), const SO_SETFIB ideal-int +pkg syscall (freebsd-arm-cgo), const SO_SNDLOWAT ideal-int +pkg syscall (freebsd-arm-cgo), const SO_SNDTIMEO ideal-int +pkg syscall (freebsd-arm-cgo), const SO_TIMESTAMP ideal-int +pkg syscall (freebsd-arm-cgo), const SO_TYPE ideal-int +pkg syscall (freebsd-arm-cgo), const SO_USELOOPBACK ideal-int +pkg syscall (freebsd-arm-cgo), const SO_USER_COOKIE ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_ABORT2 ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_ACCEPT ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_ACCESS ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_ACCT ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_ADJTIME ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_AUDIT ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_AUDITCTL ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_AUDITON ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_BIND ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_CAP_ENTER ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_CAP_FCNTLS_GET ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_CAP_FCNTLS_LIMIT ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_CAP_GETMODE ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_CAP_IOCTLS_GET ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_CAP_IOCTLS_LIMIT ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_CAP_NEW ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_CAP_RIGHTS_GET ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_CAP_RIGHTS_LIMIT ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_CHDIR ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_CHFLAGS ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_CHMOD ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_CHOWN ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_CHROOT ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_CLOCK_GETCPUCLOCKID2 ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_CLOCK_GETRES ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_CLOCK_GETTIME ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_CLOCK_SETTIME ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_CLOSE ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_CLOSEFROM ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_CONNECT ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_CPUSET ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_CPUSET_GETAFFINITY ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_CPUSET_GETID ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_CPUSET_SETAFFINITY ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_CPUSET_SETID ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_DUP ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_DUP2 ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_EACCESS ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_EXECVE ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_EXIT ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_EXTATTRCTL ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_EXTATTR_DELETE_FD ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_EXTATTR_DELETE_FILE ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_EXTATTR_DELETE_LINK ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_EXTATTR_GET_FD ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_EXTATTR_GET_FILE ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_EXTATTR_GET_LINK ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_EXTATTR_LIST_FD ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_EXTATTR_LIST_FILE ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_EXTATTR_LIST_LINK ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_EXTATTR_SET_FD ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_EXTATTR_SET_FILE ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_EXTATTR_SET_LINK ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_FACCESSAT ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_FCHDIR ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_FCHFLAGS ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_FCHMOD ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_FCHMODAT ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_FCHOWN ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_FCHOWNAT ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_FCNTL ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_FEXECVE ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_FFCLOCK_GETCOUNTER ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_FFCLOCK_GETESTIMATE ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_FFCLOCK_SETESTIMATE ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_FHOPEN ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_FHSTAT ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_FHSTATFS ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_FLOCK ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_FORK ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_FPATHCONF ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_FREEBSD6_FTRUNCATE ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_FREEBSD6_LSEEK ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_FREEBSD6_MMAP ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_FREEBSD6_PREAD ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_FREEBSD6_PWRITE ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_FREEBSD6_TRUNCATE ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_FSTAT ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_FSTATAT ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_FSTATFS ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_FSYNC ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_FTRUNCATE ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_FUTIMES ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_FUTIMESAT ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_GETAUDIT ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_GETAUDIT_ADDR ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_GETAUID ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_GETCONTEXT ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_GETDENTS ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_GETDIRENTRIES ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_GETDTABLESIZE ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_GETEGID ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_GETEUID ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_GETFH ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_GETFSSTAT ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_GETGID ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_GETGROUPS ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_GETITIMER ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_GETLOGIN ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_GETLOGINCLASS ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_GETPEERNAME ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_GETPGID ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_GETPGRP ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_GETPID ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_GETPPID ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_GETPRIORITY ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_GETRESGID ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_GETRESUID ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_GETRLIMIT ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_GETRUSAGE ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_GETSID ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_GETSOCKNAME ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_GETSOCKOPT ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_GETTIMEOFDAY ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_GETUID ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_IOCTL ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_ISSETUGID ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_JAIL ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_JAIL_ATTACH ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_JAIL_GET ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_JAIL_REMOVE ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_JAIL_SET ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_KENV ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_KEVENT ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_KILL ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_KLDFIND ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_KLDFIRSTMOD ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_KLDLOAD ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_KLDNEXT ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_KLDSTAT ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_KLDSYM ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_KLDUNLOAD ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_KLDUNLOADF ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_KQUEUE ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_KTIMER_CREATE ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_KTIMER_DELETE ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_KTIMER_GETOVERRUN ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_KTIMER_GETTIME ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_KTIMER_SETTIME ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_KTRACE ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_LCHFLAGS ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_LCHMOD ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_LCHOWN ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_LGETFH ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_LINK ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_LINKAT ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_LISTEN ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_LPATHCONF ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_LSEEK ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_LSTAT ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_LUTIMES ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_MAC_SYSCALL ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_MADVISE ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_MINCORE ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_MINHERIT ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_MKDIR ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_MKDIRAT ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_MKFIFO ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_MKFIFOAT ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_MKNOD ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_MKNODAT ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_MLOCK ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_MLOCKALL ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_MMAP ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_MODFIND ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_MODFNEXT ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_MODNEXT ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_MODSTAT ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_MOUNT ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_MPROTECT ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_MSYNC ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_MUNLOCK ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_MUNLOCKALL ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_MUNMAP ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_NANOSLEEP ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_NFSTAT ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_NLSTAT ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_NMOUNT ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_NSTAT ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_NTP_ADJTIME ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_NTP_GETTIME ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_OBREAK ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_OPEN ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_OPENAT ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_OPENBSD_POLL ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_OVADVISE ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_PATHCONF ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_PDFORK ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_PDGETPID ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_PDKILL ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_PIPE ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_POLL ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_POSIX_FADVISE ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_POSIX_FALLOCATE ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_POSIX_OPENPT ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_PREAD ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_PREADV ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_PROFIL ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_PSELECT ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_PTRACE ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_PWRITE ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_PWRITEV ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_QUOTACTL ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_RCTL_ADD_RULE ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_RCTL_GET_LIMITS ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_RCTL_GET_RACCT ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_RCTL_GET_RULES ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_RCTL_REMOVE_RULE ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_READ ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_READLINK ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_READLINKAT ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_READV ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_REBOOT ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_RECVFROM ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_RECVMSG ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_RENAME ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_RENAMEAT ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_REVOKE ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_RFORK ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_RMDIR ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_RTPRIO ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_RTPRIO_THREAD ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_SBRK ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_SCHED_GETPARAM ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_SCHED_GETSCHEDULER ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_SCHED_GET_PRIORITY_MAX ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_SCHED_GET_PRIORITY_MIN ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_SCHED_RR_GET_INTERVAL ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_SCHED_SETPARAM ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_SCHED_SETSCHEDULER ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_SCHED_YIELD ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_SCTP_GENERIC_RECVMSG ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_SCTP_GENERIC_SENDMSG ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_SCTP_GENERIC_SENDMSG_IOV ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_SCTP_PEELOFF ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_SELECT ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_SENDFILE ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_SENDMSG ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_SENDTO ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_SETAUDIT ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_SETAUDIT_ADDR ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_SETAUID ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_SETCONTEXT ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_SETEGID ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_SETEUID ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_SETFIB ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_SETGID ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_SETGROUPS ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_SETITIMER ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_SETLOGIN ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_SETLOGINCLASS ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_SETPGID ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_SETPRIORITY ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_SETREGID ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_SETRESGID ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_SETRESUID ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_SETREUID ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_SETRLIMIT ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_SETSID ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_SETSOCKOPT ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_SETTIMEOFDAY ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_SETUID ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_SHM_OPEN ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_SHM_UNLINK ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_SHUTDOWN ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_SIGACTION ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_SIGALTSTACK ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_SIGPENDING ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_SIGPROCMASK ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_SIGQUEUE ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_SIGRETURN ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_SIGSUSPEND ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_SIGTIMEDWAIT ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_SIGWAIT ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_SIGWAITINFO ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_SOCKET ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_SOCKETPAIR ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_SSTK ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_STAT ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_STATFS ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_SWAPCONTEXT ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_SWAPOFF ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_SWAPON ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_SYMLINK ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_SYMLINKAT ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_SYNC ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_SYSARCH ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_THR_CREATE ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_THR_EXIT ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_THR_KILL ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_THR_KILL2 ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_THR_NEW ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_THR_SELF ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_THR_SET_NAME ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_THR_SUSPEND ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_THR_WAKE ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_TRUNCATE ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_UMASK ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_UNDELETE ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_UNLINK ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_UNLINKAT ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_UNMOUNT ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_UTIMES ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_UTRACE ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_UUIDGEN ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_VFORK ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_WAIT4 ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_WAIT6 ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_WRITE ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_WRITEV ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_YIELD ideal-int +pkg syscall (freebsd-arm-cgo), const SYS__UMTX_LOCK ideal-int +pkg syscall (freebsd-arm-cgo), const SYS__UMTX_OP ideal-int +pkg syscall (freebsd-arm-cgo), const SYS__UMTX_UNLOCK ideal-int +pkg syscall (freebsd-arm-cgo), const SYS___ACL_ACLCHECK_FD ideal-int +pkg syscall (freebsd-arm-cgo), const SYS___ACL_ACLCHECK_FILE ideal-int +pkg syscall (freebsd-arm-cgo), const SYS___ACL_ACLCHECK_LINK ideal-int +pkg syscall (freebsd-arm-cgo), const SYS___ACL_DELETE_FD ideal-int +pkg syscall (freebsd-arm-cgo), const SYS___ACL_DELETE_FILE ideal-int +pkg syscall (freebsd-arm-cgo), const SYS___ACL_DELETE_LINK ideal-int +pkg syscall (freebsd-arm-cgo), const SYS___ACL_GET_FD ideal-int +pkg syscall (freebsd-arm-cgo), const SYS___ACL_GET_FILE ideal-int +pkg syscall (freebsd-arm-cgo), const SYS___ACL_GET_LINK ideal-int +pkg syscall (freebsd-arm-cgo), const SYS___ACL_SET_FD ideal-int +pkg syscall (freebsd-arm-cgo), const SYS___ACL_SET_FILE ideal-int +pkg syscall (freebsd-arm-cgo), const SYS___ACL_SET_LINK ideal-int +pkg syscall (freebsd-arm-cgo), const SYS___GETCWD ideal-int +pkg syscall (freebsd-arm-cgo), const SYS___MAC_EXECVE ideal-int +pkg syscall (freebsd-arm-cgo), const SYS___MAC_GET_FD ideal-int +pkg syscall (freebsd-arm-cgo), const SYS___MAC_GET_FILE ideal-int +pkg syscall (freebsd-arm-cgo), const SYS___MAC_GET_LINK ideal-int +pkg syscall (freebsd-arm-cgo), const SYS___MAC_GET_PID ideal-int +pkg syscall (freebsd-arm-cgo), const SYS___MAC_GET_PROC ideal-int +pkg syscall (freebsd-arm-cgo), const SYS___MAC_SET_FD ideal-int +pkg syscall (freebsd-arm-cgo), const SYS___MAC_SET_FILE ideal-int +pkg syscall (freebsd-arm-cgo), const SYS___MAC_SET_LINK ideal-int +pkg syscall (freebsd-arm-cgo), const SYS___MAC_SET_PROC ideal-int +pkg syscall (freebsd-arm-cgo), const SYS___SETUGID ideal-int +pkg syscall (freebsd-arm-cgo), const SYS___SYSCTL ideal-int +pkg syscall (freebsd-arm-cgo), const SizeofBpfHdr ideal-int +pkg syscall (freebsd-arm-cgo), const SizeofBpfInsn ideal-int +pkg syscall (freebsd-arm-cgo), const SizeofBpfProgram ideal-int +pkg syscall (freebsd-arm-cgo), const SizeofBpfStat ideal-int +pkg syscall (freebsd-arm-cgo), const SizeofBpfVersion ideal-int +pkg syscall (freebsd-arm-cgo), const SizeofBpfZbuf ideal-int +pkg syscall (freebsd-arm-cgo), const SizeofBpfZbufHeader ideal-int +pkg syscall (freebsd-arm-cgo), const SizeofCmsghdr ideal-int +pkg syscall (freebsd-arm-cgo), const SizeofICMPv6Filter = 32 +pkg syscall (freebsd-arm-cgo), const SizeofICMPv6Filter ideal-int +pkg syscall (freebsd-arm-cgo), const SizeofIPMreq ideal-int +pkg syscall (freebsd-arm-cgo), const SizeofIPMreqn ideal-int +pkg syscall (freebsd-arm-cgo), const SizeofIPv6MTUInfo = 32 +pkg syscall (freebsd-arm-cgo), const SizeofIPv6MTUInfo ideal-int +pkg syscall (freebsd-arm-cgo), const SizeofIPv6Mreq ideal-int +pkg syscall (freebsd-arm-cgo), const SizeofIfAnnounceMsghdr ideal-int +pkg syscall (freebsd-arm-cgo), const SizeofIfData ideal-int +pkg syscall (freebsd-arm-cgo), const SizeofIfMsghdr ideal-int +pkg syscall (freebsd-arm-cgo), const SizeofIfaMsghdr ideal-int +pkg syscall (freebsd-arm-cgo), const SizeofIfmaMsghdr ideal-int +pkg syscall (freebsd-arm-cgo), const SizeofInet6Pktinfo ideal-int +pkg syscall (freebsd-arm-cgo), const SizeofLinger ideal-int +pkg syscall (freebsd-arm-cgo), const SizeofMsghdr ideal-int +pkg syscall (freebsd-arm-cgo), const SizeofRtMetrics ideal-int +pkg syscall (freebsd-arm-cgo), const SizeofRtMsghdr ideal-int +pkg syscall (freebsd-arm-cgo), const SizeofSockaddrAny ideal-int +pkg syscall (freebsd-arm-cgo), const SizeofSockaddrDatalink ideal-int +pkg syscall (freebsd-arm-cgo), const SizeofSockaddrInet4 ideal-int +pkg syscall (freebsd-arm-cgo), const SizeofSockaddrInet6 ideal-int +pkg syscall (freebsd-arm-cgo), const SizeofSockaddrUnix ideal-int +pkg syscall (freebsd-arm-cgo), const TCIFLUSH ideal-int +pkg syscall (freebsd-arm-cgo), const TCIOFLUSH ideal-int +pkg syscall (freebsd-arm-cgo), const TCOFLUSH ideal-int +pkg syscall (freebsd-arm-cgo), const TCP_CA_NAME_MAX ideal-int +pkg syscall (freebsd-arm-cgo), const TCP_CONGESTION ideal-int +pkg syscall (freebsd-arm-cgo), const TCP_INFO ideal-int +pkg syscall (freebsd-arm-cgo), const TCP_KEEPCNT ideal-int +pkg syscall (freebsd-arm-cgo), const TCP_KEEPIDLE ideal-int +pkg syscall (freebsd-arm-cgo), const TCP_KEEPINIT ideal-int +pkg syscall (freebsd-arm-cgo), const TCP_KEEPINTVL ideal-int +pkg syscall (freebsd-arm-cgo), const TCP_MAXBURST ideal-int +pkg syscall (freebsd-arm-cgo), const TCP_MAXHLEN ideal-int +pkg syscall (freebsd-arm-cgo), const TCP_MAXOLEN ideal-int +pkg syscall (freebsd-arm-cgo), const TCP_MAXSEG ideal-int +pkg syscall (freebsd-arm-cgo), const TCP_MAXWIN ideal-int +pkg syscall (freebsd-arm-cgo), const TCP_MAX_SACK ideal-int +pkg syscall (freebsd-arm-cgo), const TCP_MAX_WINSHIFT ideal-int +pkg syscall (freebsd-arm-cgo), const TCP_MD5SIG ideal-int +pkg syscall (freebsd-arm-cgo), const TCP_MINMSS ideal-int +pkg syscall (freebsd-arm-cgo), const TCP_MSS ideal-int +pkg syscall (freebsd-arm-cgo), const TCP_NOOPT ideal-int +pkg syscall (freebsd-arm-cgo), const TCP_NOPUSH ideal-int +pkg syscall (freebsd-arm-cgo), const TCSAFLUSH ideal-int +pkg syscall (freebsd-arm-cgo), const TIOCCBRK ideal-int +pkg syscall (freebsd-arm-cgo), const TIOCCDTR ideal-int +pkg syscall (freebsd-arm-cgo), const TIOCCONS ideal-int +pkg syscall (freebsd-arm-cgo), const TIOCDRAIN ideal-int +pkg syscall (freebsd-arm-cgo), const TIOCEXCL ideal-int +pkg syscall (freebsd-arm-cgo), const TIOCEXT ideal-int +pkg syscall (freebsd-arm-cgo), const TIOCFLUSH ideal-int +pkg syscall (freebsd-arm-cgo), const TIOCGDRAINWAIT ideal-int +pkg syscall (freebsd-arm-cgo), const TIOCGETA ideal-int +pkg syscall (freebsd-arm-cgo), const TIOCGETD ideal-int +pkg syscall (freebsd-arm-cgo), const TIOCGPGRP ideal-int +pkg syscall (freebsd-arm-cgo), const TIOCGPTN ideal-int +pkg syscall (freebsd-arm-cgo), const TIOCGSID ideal-int +pkg syscall (freebsd-arm-cgo), const TIOCGWINSZ ideal-int +pkg syscall (freebsd-arm-cgo), const TIOCMBIC ideal-int +pkg syscall (freebsd-arm-cgo), const TIOCMBIS ideal-int +pkg syscall (freebsd-arm-cgo), const TIOCMGDTRWAIT ideal-int +pkg syscall (freebsd-arm-cgo), const TIOCMGET ideal-int +pkg syscall (freebsd-arm-cgo), const TIOCMSDTRWAIT ideal-int +pkg syscall (freebsd-arm-cgo), const TIOCMSET ideal-int +pkg syscall (freebsd-arm-cgo), const TIOCM_CAR ideal-int +pkg syscall (freebsd-arm-cgo), const TIOCM_CD ideal-int +pkg syscall (freebsd-arm-cgo), const TIOCM_CTS ideal-int +pkg syscall (freebsd-arm-cgo), const TIOCM_DCD ideal-int +pkg syscall (freebsd-arm-cgo), const TIOCM_DSR ideal-int +pkg syscall (freebsd-arm-cgo), const TIOCM_DTR ideal-int +pkg syscall (freebsd-arm-cgo), const TIOCM_LE ideal-int +pkg syscall (freebsd-arm-cgo), const TIOCM_RI ideal-int +pkg syscall (freebsd-arm-cgo), const TIOCM_RNG ideal-int +pkg syscall (freebsd-arm-cgo), const TIOCM_RTS ideal-int +pkg syscall (freebsd-arm-cgo), const TIOCM_SR ideal-int +pkg syscall (freebsd-arm-cgo), const TIOCM_ST ideal-int +pkg syscall (freebsd-arm-cgo), const TIOCNOTTY ideal-int +pkg syscall (freebsd-arm-cgo), const TIOCNXCL ideal-int +pkg syscall (freebsd-arm-cgo), const TIOCOUTQ ideal-int +pkg syscall (freebsd-arm-cgo), const TIOCPKT ideal-int +pkg syscall (freebsd-arm-cgo), const TIOCPKT_DATA ideal-int +pkg syscall (freebsd-arm-cgo), const TIOCPKT_DOSTOP ideal-int +pkg syscall (freebsd-arm-cgo), const TIOCPKT_FLUSHREAD ideal-int +pkg syscall (freebsd-arm-cgo), const TIOCPKT_FLUSHWRITE ideal-int +pkg syscall (freebsd-arm-cgo), const TIOCPKT_IOCTL ideal-int +pkg syscall (freebsd-arm-cgo), const TIOCPKT_NOSTOP ideal-int +pkg syscall (freebsd-arm-cgo), const TIOCPKT_START ideal-int +pkg syscall (freebsd-arm-cgo), const TIOCPKT_STOP ideal-int +pkg syscall (freebsd-arm-cgo), const TIOCPTMASTER ideal-int +pkg syscall (freebsd-arm-cgo), const TIOCSBRK ideal-int +pkg syscall (freebsd-arm-cgo), const TIOCSCTTY ideal-int +pkg syscall (freebsd-arm-cgo), const TIOCSDRAINWAIT ideal-int +pkg syscall (freebsd-arm-cgo), const TIOCSDTR ideal-int +pkg syscall (freebsd-arm-cgo), const TIOCSETA ideal-int +pkg syscall (freebsd-arm-cgo), const TIOCSETAF ideal-int +pkg syscall (freebsd-arm-cgo), const TIOCSETAW ideal-int +pkg syscall (freebsd-arm-cgo), const TIOCSETD ideal-int +pkg syscall (freebsd-arm-cgo), const TIOCSIG ideal-int +pkg syscall (freebsd-arm-cgo), const TIOCSPGRP ideal-int +pkg syscall (freebsd-arm-cgo), const TIOCSTART ideal-int +pkg syscall (freebsd-arm-cgo), const TIOCSTAT ideal-int +pkg syscall (freebsd-arm-cgo), const TIOCSTI ideal-int +pkg syscall (freebsd-arm-cgo), const TIOCSTOP ideal-int +pkg syscall (freebsd-arm-cgo), const TIOCSWINSZ ideal-int +pkg syscall (freebsd-arm-cgo), const TIOCTIMESTAMP ideal-int +pkg syscall (freebsd-arm-cgo), const TIOCUCNTL ideal-int +pkg syscall (freebsd-arm-cgo), const TOSTOP ideal-int +pkg syscall (freebsd-arm-cgo), const VDISCARD ideal-int +pkg syscall (freebsd-arm-cgo), const VDSUSP ideal-int +pkg syscall (freebsd-arm-cgo), const VEOF ideal-int +pkg syscall (freebsd-arm-cgo), const VEOL ideal-int +pkg syscall (freebsd-arm-cgo), const VEOL2 ideal-int +pkg syscall (freebsd-arm-cgo), const VERASE ideal-int +pkg syscall (freebsd-arm-cgo), const VERASE2 ideal-int +pkg syscall (freebsd-arm-cgo), const VINTR ideal-int +pkg syscall (freebsd-arm-cgo), const VKILL ideal-int +pkg syscall (freebsd-arm-cgo), const VLNEXT ideal-int +pkg syscall (freebsd-arm-cgo), const VMIN ideal-int +pkg syscall (freebsd-arm-cgo), const VQUIT ideal-int +pkg syscall (freebsd-arm-cgo), const VREPRINT ideal-int +pkg syscall (freebsd-arm-cgo), const VSTART ideal-int +pkg syscall (freebsd-arm-cgo), const VSTATUS ideal-int +pkg syscall (freebsd-arm-cgo), const VSTOP ideal-int +pkg syscall (freebsd-arm-cgo), const VSUSP ideal-int +pkg syscall (freebsd-arm-cgo), const VTIME ideal-int +pkg syscall (freebsd-arm-cgo), const VWERASE ideal-int +pkg syscall (freebsd-arm-cgo), const WCONTINUED ideal-int +pkg syscall (freebsd-arm-cgo), const WCOREFLAG ideal-int +pkg syscall (freebsd-arm-cgo), const WEXITED ideal-int +pkg syscall (freebsd-arm-cgo), const WLINUXCLONE ideal-int +pkg syscall (freebsd-arm-cgo), const WNOHANG ideal-int +pkg syscall (freebsd-arm-cgo), const WNOWAIT ideal-int +pkg syscall (freebsd-arm-cgo), const WSTOPPED ideal-int +pkg syscall (freebsd-arm-cgo), const WTRAPPED ideal-int +pkg syscall (freebsd-arm-cgo), const WUNTRACED ideal-int +pkg syscall (freebsd-arm-cgo), func Accept(int) (int, Sockaddr, error) +pkg syscall (freebsd-arm-cgo), func Access(string, uint32) error +pkg syscall (freebsd-arm-cgo), func Adjtime(*Timeval, *Timeval) error +pkg syscall (freebsd-arm-cgo), func Bind(int, Sockaddr) error +pkg syscall (freebsd-arm-cgo), func BpfBuflen(int) (int, error) +pkg syscall (freebsd-arm-cgo), func BpfDatalink(int) (int, error) +pkg syscall (freebsd-arm-cgo), func BpfHeadercmpl(int) (int, error) +pkg syscall (freebsd-arm-cgo), func BpfInterface(int, string) (string, error) +pkg syscall (freebsd-arm-cgo), func BpfJump(int, int, int, int) *BpfInsn +pkg syscall (freebsd-arm-cgo), func BpfStats(int) (*BpfStat, error) +pkg syscall (freebsd-arm-cgo), func BpfStmt(int, int) *BpfInsn +pkg syscall (freebsd-arm-cgo), func BpfTimeout(int) (*Timeval, error) +pkg syscall (freebsd-arm-cgo), func CheckBpfVersion(int) error +pkg syscall (freebsd-arm-cgo), func Chflags(string, int) error +pkg syscall (freebsd-arm-cgo), func Chroot(string) error +pkg syscall (freebsd-arm-cgo), func Close(int) error +pkg syscall (freebsd-arm-cgo), func CloseOnExec(int) +pkg syscall (freebsd-arm-cgo), func CmsgLen(int) int +pkg syscall (freebsd-arm-cgo), func CmsgSpace(int) int +pkg syscall (freebsd-arm-cgo), func Connect(int, Sockaddr) error +pkg syscall (freebsd-arm-cgo), func Dup(int) (int, error) +pkg syscall (freebsd-arm-cgo), func Dup2(int, int) error +pkg syscall (freebsd-arm-cgo), func Fchdir(int) error +pkg syscall (freebsd-arm-cgo), func Fchflags(string, int) error +pkg syscall (freebsd-arm-cgo), func Fchmod(int, uint32) error +pkg syscall (freebsd-arm-cgo), func Fchown(int, int, int) error +pkg syscall (freebsd-arm-cgo), func Flock(int, int) error +pkg syscall (freebsd-arm-cgo), func FlushBpf(int) error +pkg syscall (freebsd-arm-cgo), func ForkExec(string, []string, *ProcAttr) (int, error) +pkg syscall (freebsd-arm-cgo), func Fpathconf(int, int) (int, error) +pkg syscall (freebsd-arm-cgo), func Fstat(int, *Stat_t) error +pkg syscall (freebsd-arm-cgo), func Fstatfs(int, *Statfs_t) error +pkg syscall (freebsd-arm-cgo), func Fsync(int) error +pkg syscall (freebsd-arm-cgo), func Ftruncate(int, int64) error +pkg syscall (freebsd-arm-cgo), func Futimes(int, []Timeval) error +pkg syscall (freebsd-arm-cgo), func Getdirentries(int, []uint8, *uintptr) (int, error) +pkg syscall (freebsd-arm-cgo), func Getdtablesize() int +pkg syscall (freebsd-arm-cgo), func Getfsstat([]Statfs_t, int) (int, error) +pkg syscall (freebsd-arm-cgo), func Getpeername(int) (Sockaddr, error) +pkg syscall (freebsd-arm-cgo), func Getpgid(int) (int, error) +pkg syscall (freebsd-arm-cgo), func Getpgrp() int +pkg syscall (freebsd-arm-cgo), func Getpriority(int, int) (int, error) +pkg syscall (freebsd-arm-cgo), func Getrlimit(int, *Rlimit) error +pkg syscall (freebsd-arm-cgo), func Getrusage(int, *Rusage) error +pkg syscall (freebsd-arm-cgo), func Getsid(int) (int, error) +pkg syscall (freebsd-arm-cgo), func Getsockname(int) (Sockaddr, error) +pkg syscall (freebsd-arm-cgo), func GetsockoptByte(int, int, int) (uint8, error) +pkg syscall (freebsd-arm-cgo), func GetsockoptICMPv6Filter(int, int, int) (*ICMPv6Filter, error) +pkg syscall (freebsd-arm-cgo), func GetsockoptIPMreq(int, int, int) (*IPMreq, error) +pkg syscall (freebsd-arm-cgo), func GetsockoptIPMreqn(int, int, int) (*IPMreqn, error) +pkg syscall (freebsd-arm-cgo), func GetsockoptIPv6MTUInfo(int, int, int) (*IPv6MTUInfo, error) +pkg syscall (freebsd-arm-cgo), func GetsockoptIPv6Mreq(int, int, int) (*IPv6Mreq, error) +pkg syscall (freebsd-arm-cgo), func GetsockoptInet4Addr(int, int, int) ([4]uint8, error) +pkg syscall (freebsd-arm-cgo), func GetsockoptInt(int, int, int) (int, error) +pkg syscall (freebsd-arm-cgo), func Issetugid() bool +pkg syscall (freebsd-arm-cgo), func Kevent(int, []Kevent_t, []Kevent_t, *Timespec) (int, error) +pkg syscall (freebsd-arm-cgo), func Kill(int, Signal) error +pkg syscall (freebsd-arm-cgo), func Kqueue() (int, error) +pkg syscall (freebsd-arm-cgo), func Listen(int, int) error +pkg syscall (freebsd-arm-cgo), func Lstat(string, *Stat_t) error +pkg syscall (freebsd-arm-cgo), func Mkfifo(string, uint32) error +pkg syscall (freebsd-arm-cgo), func Mknod(string, uint32, int) error +pkg syscall (freebsd-arm-cgo), func Mmap(int, int64, int, int, int) ([]uint8, error) +pkg syscall (freebsd-arm-cgo), func Munmap([]uint8) error +pkg syscall (freebsd-arm-cgo), func Nanosleep(*Timespec, *Timespec) error +pkg syscall (freebsd-arm-cgo), func Open(string, int, uint32) (int, error) +pkg syscall (freebsd-arm-cgo), func ParseDirent([]uint8, int, []string) (int, int, []string) +pkg syscall (freebsd-arm-cgo), func ParseRoutingMessage([]uint8) ([]RoutingMessage, error) +pkg syscall (freebsd-arm-cgo), func ParseRoutingSockaddr(RoutingMessage) ([]Sockaddr, error) +pkg syscall (freebsd-arm-cgo), func ParseSocketControlMessage([]uint8) ([]SocketControlMessage, error) +pkg syscall (freebsd-arm-cgo), func ParseUnixRights(*SocketControlMessage) ([]int, error) +pkg syscall (freebsd-arm-cgo), func Pathconf(string, int) (int, error) +pkg syscall (freebsd-arm-cgo), func Pipe([]int) error +pkg syscall (freebsd-arm-cgo), func Pread(int, []uint8, int64) (int, error) +pkg syscall (freebsd-arm-cgo), func Pwrite(int, []uint8, int64) (int, error) +pkg syscall (freebsd-arm-cgo), func RawSyscall(uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno) +pkg syscall (freebsd-arm-cgo), func RawSyscall6(uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno) +pkg syscall (freebsd-arm-cgo), func Read(int, []uint8) (int, error) +pkg syscall (freebsd-arm-cgo), func ReadDirent(int, []uint8) (int, error) +pkg syscall (freebsd-arm-cgo), func Recvfrom(int, []uint8, int) (int, Sockaddr, error) +pkg syscall (freebsd-arm-cgo), func Recvmsg(int, []uint8, []uint8, int) (int, int, int, Sockaddr, error) +pkg syscall (freebsd-arm-cgo), func Revoke(string) error +pkg syscall (freebsd-arm-cgo), func RouteRIB(int, int) ([]uint8, error) +pkg syscall (freebsd-arm-cgo), func Seek(int, int64, int) (int64, error) +pkg syscall (freebsd-arm-cgo), func Select(int, *FdSet, *FdSet, *FdSet, *Timeval) error +pkg syscall (freebsd-arm-cgo), func Sendfile(int, int, *int64, int) (int, error) +pkg syscall (freebsd-arm-cgo), func Sendmsg(int, []uint8, []uint8, Sockaddr, int) error +pkg syscall (freebsd-arm-cgo), func Sendto(int, []uint8, int, Sockaddr) error +pkg syscall (freebsd-arm-cgo), func SetBpf(int, []BpfInsn) error +pkg syscall (freebsd-arm-cgo), func SetBpfBuflen(int, int) (int, error) +pkg syscall (freebsd-arm-cgo), func SetBpfDatalink(int, int) (int, error) +pkg syscall (freebsd-arm-cgo), func SetBpfHeadercmpl(int, int) error +pkg syscall (freebsd-arm-cgo), func SetBpfImmediate(int, int) error +pkg syscall (freebsd-arm-cgo), func SetBpfInterface(int, string) error +pkg syscall (freebsd-arm-cgo), func SetBpfPromisc(int, int) error +pkg syscall (freebsd-arm-cgo), func SetBpfTimeout(int, *Timeval) error +pkg syscall (freebsd-arm-cgo), func SetKevent(*Kevent_t, int, int, int) +pkg syscall (freebsd-arm-cgo), func SetNonblock(int, bool) error +pkg syscall (freebsd-arm-cgo), func Setegid(int) error +pkg syscall (freebsd-arm-cgo), func Seteuid(int) error +pkg syscall (freebsd-arm-cgo), func Setgid(int) error +pkg syscall (freebsd-arm-cgo), func Setgroups([]int) error +pkg syscall (freebsd-arm-cgo), func Setlogin(string) error +pkg syscall (freebsd-arm-cgo), func Setpgid(int, int) error +pkg syscall (freebsd-arm-cgo), func Setpriority(int, int, int) error +pkg syscall (freebsd-arm-cgo), func Setregid(int, int) error +pkg syscall (freebsd-arm-cgo), func Setreuid(int, int) error +pkg syscall (freebsd-arm-cgo), func Setrlimit(int, *Rlimit) error +pkg syscall (freebsd-arm-cgo), func Setsid() (int, error) +pkg syscall (freebsd-arm-cgo), func SetsockoptByte(int, int, int, uint8) error +pkg syscall (freebsd-arm-cgo), func SetsockoptICMPv6Filter(int, int, int, *ICMPv6Filter) error +pkg syscall (freebsd-arm-cgo), func SetsockoptIPMreq(int, int, int, *IPMreq) error +pkg syscall (freebsd-arm-cgo), func SetsockoptIPMreqn(int, int, int, *IPMreqn) error +pkg syscall (freebsd-arm-cgo), func SetsockoptIPv6Mreq(int, int, int, *IPv6Mreq) error +pkg syscall (freebsd-arm-cgo), func SetsockoptInet4Addr(int, int, int, [4]uint8) error +pkg syscall (freebsd-arm-cgo), func SetsockoptInt(int, int, int, int) error +pkg syscall (freebsd-arm-cgo), func SetsockoptLinger(int, int, int, *Linger) error +pkg syscall (freebsd-arm-cgo), func SetsockoptString(int, int, int, string) error +pkg syscall (freebsd-arm-cgo), func SetsockoptTimeval(int, int, int, *Timeval) error +pkg syscall (freebsd-arm-cgo), func Settimeofday(*Timeval) error +pkg syscall (freebsd-arm-cgo), func Setuid(int) error +pkg syscall (freebsd-arm-cgo), func Shutdown(int, int) error +pkg syscall (freebsd-arm-cgo), func SlicePtrFromStrings([]string) ([]*uint8, error) +pkg syscall (freebsd-arm-cgo), func Socket(int, int, int) (int, error) +pkg syscall (freebsd-arm-cgo), func Socketpair(int, int, int) ([2]int, error) +pkg syscall (freebsd-arm-cgo), func Stat(string, *Stat_t) error +pkg syscall (freebsd-arm-cgo), func Statfs(string, *Statfs_t) error +pkg syscall (freebsd-arm-cgo), func StringSlicePtr([]string) []*uint8 +pkg syscall (freebsd-arm-cgo), func Sync() error +pkg syscall (freebsd-arm-cgo), func Syscall(uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno) +pkg syscall (freebsd-arm-cgo), func Syscall6(uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno) +pkg syscall (freebsd-arm-cgo), func Syscall9(uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno) +pkg syscall (freebsd-arm-cgo), func Sysctl(string) (string, error) +pkg syscall (freebsd-arm-cgo), func SysctlUint32(string) (uint32, error) +pkg syscall (freebsd-arm-cgo), func TimevalToNsec(Timeval) int64 +pkg syscall (freebsd-arm-cgo), func Truncate(string, int64) error +pkg syscall (freebsd-arm-cgo), func Umask(int) int +pkg syscall (freebsd-arm-cgo), func Undelete(string) error +pkg syscall (freebsd-arm-cgo), func UnixRights(...int) []uint8 +pkg syscall (freebsd-arm-cgo), func Unmount(string, int) error +pkg syscall (freebsd-arm-cgo), func Wait4(int, *WaitStatus, int, *Rusage) (int, error) +pkg syscall (freebsd-arm-cgo), func Write(int, []uint8) (int, error) +pkg syscall (freebsd-arm-cgo), method (*Cmsghdr) SetLen(int) +pkg syscall (freebsd-arm-cgo), method (*Iovec) SetLen(int) +pkg syscall (freebsd-arm-cgo), method (*Msghdr) SetControllen(int) +pkg syscall (freebsd-arm-cgo), type BpfHdr struct +pkg syscall (freebsd-arm-cgo), type BpfHdr struct, Caplen uint32 +pkg syscall (freebsd-arm-cgo), type BpfHdr struct, Datalen uint32 +pkg syscall (freebsd-arm-cgo), type BpfHdr struct, Hdrlen uint16 +pkg syscall (freebsd-arm-cgo), type BpfHdr struct, Pad_cgo_0 [2]uint8 +pkg syscall (freebsd-arm-cgo), type BpfHdr struct, Tstamp Timeval +pkg syscall (freebsd-arm-cgo), type BpfInsn struct +pkg syscall (freebsd-arm-cgo), type BpfInsn struct, Code uint16 +pkg syscall (freebsd-arm-cgo), type BpfInsn struct, Jf uint8 +pkg syscall (freebsd-arm-cgo), type BpfInsn struct, Jt uint8 +pkg syscall (freebsd-arm-cgo), type BpfInsn struct, K uint32 +pkg syscall (freebsd-arm-cgo), type BpfProgram struct +pkg syscall (freebsd-arm-cgo), type BpfProgram struct, Insns *BpfInsn +pkg syscall (freebsd-arm-cgo), type BpfProgram struct, Len uint32 +pkg syscall (freebsd-arm-cgo), type BpfStat struct +pkg syscall (freebsd-arm-cgo), type BpfStat struct, Drop uint32 +pkg syscall (freebsd-arm-cgo), type BpfStat struct, Recv uint32 +pkg syscall (freebsd-arm-cgo), type BpfVersion struct +pkg syscall (freebsd-arm-cgo), type BpfVersion struct, Major uint16 +pkg syscall (freebsd-arm-cgo), type BpfVersion struct, Minor uint16 +pkg syscall (freebsd-arm-cgo), type BpfZbuf struct +pkg syscall (freebsd-arm-cgo), type BpfZbuf struct, Bufa *uint8 +pkg syscall (freebsd-arm-cgo), type BpfZbuf struct, Bufb *uint8 +pkg syscall (freebsd-arm-cgo), type BpfZbuf struct, Buflen uint32 +pkg syscall (freebsd-arm-cgo), type BpfZbufHeader struct +pkg syscall (freebsd-arm-cgo), type BpfZbufHeader struct, Kernel_gen uint32 +pkg syscall (freebsd-arm-cgo), type BpfZbufHeader struct, Kernel_len uint32 +pkg syscall (freebsd-arm-cgo), type BpfZbufHeader struct, User_gen uint32 +pkg syscall (freebsd-arm-cgo), type BpfZbufHeader struct, X_bzh_pad [5]uint32 +pkg syscall (freebsd-arm-cgo), type Cmsghdr struct +pkg syscall (freebsd-arm-cgo), type Cmsghdr struct, Len uint32 +pkg syscall (freebsd-arm-cgo), type Cmsghdr struct, Level int32 +pkg syscall (freebsd-arm-cgo), type Cmsghdr struct, Type int32 +pkg syscall (freebsd-arm-cgo), type Credential struct +pkg syscall (freebsd-arm-cgo), type Credential struct, Gid uint32 +pkg syscall (freebsd-arm-cgo), type Credential struct, Groups []uint32 +pkg syscall (freebsd-arm-cgo), type Credential struct, Uid uint32 +pkg syscall (freebsd-arm-cgo), type Dirent struct +pkg syscall (freebsd-arm-cgo), type Dirent struct, Fileno uint32 +pkg syscall (freebsd-arm-cgo), type Dirent struct, Name [256]int8 +pkg syscall (freebsd-arm-cgo), type Dirent struct, Namlen uint8 +pkg syscall (freebsd-arm-cgo), type Dirent struct, Reclen uint16 +pkg syscall (freebsd-arm-cgo), type Dirent struct, Type uint8 +pkg syscall (freebsd-arm-cgo), type FdSet struct +pkg syscall (freebsd-arm-cgo), type FdSet struct, X__fds_bits [32]uint32 +pkg syscall (freebsd-arm-cgo), type Flock_t struct +pkg syscall (freebsd-arm-cgo), type Flock_t struct, Len int64 +pkg syscall (freebsd-arm-cgo), type Flock_t struct, Pid int32 +pkg syscall (freebsd-arm-cgo), type Flock_t struct, Start int64 +pkg syscall (freebsd-arm-cgo), type Flock_t struct, Sysid int32 +pkg syscall (freebsd-arm-cgo), type Flock_t struct, Type int16 +pkg syscall (freebsd-arm-cgo), type Flock_t struct, Whence int16 +pkg syscall (freebsd-arm-cgo), type Fsid struct +pkg syscall (freebsd-arm-cgo), type Fsid struct, Val [2]int32 +pkg syscall (freebsd-arm-cgo), type ICMPv6Filter struct +pkg syscall (freebsd-arm-cgo), type ICMPv6Filter struct, Filt [8]uint32 +pkg syscall (freebsd-arm-cgo), type IPMreqn struct +pkg syscall (freebsd-arm-cgo), type IPMreqn struct, Address [4]uint8 +pkg syscall (freebsd-arm-cgo), type IPMreqn struct, Ifindex int32 +pkg syscall (freebsd-arm-cgo), type IPMreqn struct, Multiaddr [4]uint8 +pkg syscall (freebsd-arm-cgo), type IPv6MTUInfo struct +pkg syscall (freebsd-arm-cgo), type IPv6MTUInfo struct, Addr RawSockaddrInet6 +pkg syscall (freebsd-arm-cgo), type IPv6MTUInfo struct, Mtu uint32 +pkg syscall (freebsd-arm-cgo), type IfAnnounceMsghdr struct +pkg syscall (freebsd-arm-cgo), type IfAnnounceMsghdr struct, Index uint16 +pkg syscall (freebsd-arm-cgo), type IfAnnounceMsghdr struct, Msglen uint16 +pkg syscall (freebsd-arm-cgo), type IfAnnounceMsghdr struct, Name [16]int8 +pkg syscall (freebsd-arm-cgo), type IfAnnounceMsghdr struct, Type uint8 +pkg syscall (freebsd-arm-cgo), type IfAnnounceMsghdr struct, Version uint8 +pkg syscall (freebsd-arm-cgo), type IfAnnounceMsghdr struct, What uint16 +pkg syscall (freebsd-arm-cgo), type IfData struct +pkg syscall (freebsd-arm-cgo), type IfData struct, Addrlen uint8 +pkg syscall (freebsd-arm-cgo), type IfData struct, Baudrate uint32 +pkg syscall (freebsd-arm-cgo), type IfData struct, Collisions uint32 +pkg syscall (freebsd-arm-cgo), type IfData struct, Datalen uint8 +pkg syscall (freebsd-arm-cgo), type IfData struct, Epoch int64 +pkg syscall (freebsd-arm-cgo), type IfData struct, Hdrlen uint8 +pkg syscall (freebsd-arm-cgo), type IfData struct, Hwassist uint32 +pkg syscall (freebsd-arm-cgo), type IfData struct, Ibytes uint32 +pkg syscall (freebsd-arm-cgo), type IfData struct, Ierrors uint32 +pkg syscall (freebsd-arm-cgo), type IfData struct, Imcasts uint32 +pkg syscall (freebsd-arm-cgo), type IfData struct, Ipackets uint32 +pkg syscall (freebsd-arm-cgo), type IfData struct, Iqdrops uint32 +pkg syscall (freebsd-arm-cgo), type IfData struct, Lastchange Timeval +pkg syscall (freebsd-arm-cgo), type IfData struct, Link_state uint8 +pkg syscall (freebsd-arm-cgo), type IfData struct, Metric uint32 +pkg syscall (freebsd-arm-cgo), type IfData struct, Mtu uint32 +pkg syscall (freebsd-arm-cgo), type IfData struct, Noproto uint32 +pkg syscall (freebsd-arm-cgo), type IfData struct, Obytes uint32 +pkg syscall (freebsd-arm-cgo), type IfData struct, Oerrors uint32 +pkg syscall (freebsd-arm-cgo), type IfData struct, Omcasts uint32 +pkg syscall (freebsd-arm-cgo), type IfData struct, Opackets uint32 +pkg syscall (freebsd-arm-cgo), type IfData struct, Physical uint8 +pkg syscall (freebsd-arm-cgo), type IfData struct, Spare_char1 uint8 +pkg syscall (freebsd-arm-cgo), type IfData struct, Spare_char2 uint8 +pkg syscall (freebsd-arm-cgo), type IfData struct, Type uint8 +pkg syscall (freebsd-arm-cgo), type IfMsghdr struct +pkg syscall (freebsd-arm-cgo), type IfMsghdr struct, Addrs int32 +pkg syscall (freebsd-arm-cgo), type IfMsghdr struct, Data IfData +pkg syscall (freebsd-arm-cgo), type IfMsghdr struct, Flags int32 +pkg syscall (freebsd-arm-cgo), type IfMsghdr struct, Index uint16 +pkg syscall (freebsd-arm-cgo), type IfMsghdr struct, Msglen uint16 +pkg syscall (freebsd-arm-cgo), type IfMsghdr struct, Pad_cgo_0 [2]uint8 +pkg syscall (freebsd-arm-cgo), type IfMsghdr struct, Type uint8 +pkg syscall (freebsd-arm-cgo), type IfMsghdr struct, Version uint8 +pkg syscall (freebsd-arm-cgo), type IfaMsghdr struct +pkg syscall (freebsd-arm-cgo), type IfaMsghdr struct, Addrs int32 +pkg syscall (freebsd-arm-cgo), type IfaMsghdr struct, Flags int32 +pkg syscall (freebsd-arm-cgo), type IfaMsghdr struct, Index uint16 +pkg syscall (freebsd-arm-cgo), type IfaMsghdr struct, Metric int32 +pkg syscall (freebsd-arm-cgo), type IfaMsghdr struct, Msglen uint16 +pkg syscall (freebsd-arm-cgo), type IfaMsghdr struct, Pad_cgo_0 [2]uint8 +pkg syscall (freebsd-arm-cgo), type IfaMsghdr struct, Type uint8 +pkg syscall (freebsd-arm-cgo), type IfaMsghdr struct, Version uint8 +pkg syscall (freebsd-arm-cgo), type IfmaMsghdr struct +pkg syscall (freebsd-arm-cgo), type IfmaMsghdr struct, Addrs int32 +pkg syscall (freebsd-arm-cgo), type IfmaMsghdr struct, Flags int32 +pkg syscall (freebsd-arm-cgo), type IfmaMsghdr struct, Index uint16 +pkg syscall (freebsd-arm-cgo), type IfmaMsghdr struct, Msglen uint16 +pkg syscall (freebsd-arm-cgo), type IfmaMsghdr struct, Pad_cgo_0 [2]uint8 +pkg syscall (freebsd-arm-cgo), type IfmaMsghdr struct, Type uint8 +pkg syscall (freebsd-arm-cgo), type IfmaMsghdr struct, Version uint8 +pkg syscall (freebsd-arm-cgo), type Inet6Pktinfo struct +pkg syscall (freebsd-arm-cgo), type Inet6Pktinfo struct, Addr [16]uint8 +pkg syscall (freebsd-arm-cgo), type Inet6Pktinfo struct, Ifindex uint32 +pkg syscall (freebsd-arm-cgo), type InterfaceAddrMessage struct +pkg syscall (freebsd-arm-cgo), type InterfaceAddrMessage struct, Data []uint8 +pkg syscall (freebsd-arm-cgo), type InterfaceAddrMessage struct, Header IfaMsghdr +pkg syscall (freebsd-arm-cgo), type InterfaceAnnounceMessage struct +pkg syscall (freebsd-arm-cgo), type InterfaceAnnounceMessage struct, Header IfAnnounceMsghdr +pkg syscall (freebsd-arm-cgo), type InterfaceMessage struct +pkg syscall (freebsd-arm-cgo), type InterfaceMessage struct, Data []uint8 +pkg syscall (freebsd-arm-cgo), type InterfaceMessage struct, Header IfMsghdr +pkg syscall (freebsd-arm-cgo), type InterfaceMulticastAddrMessage struct +pkg syscall (freebsd-arm-cgo), type InterfaceMulticastAddrMessage struct, Data []uint8 +pkg syscall (freebsd-arm-cgo), type InterfaceMulticastAddrMessage struct, Header IfmaMsghdr +pkg syscall (freebsd-arm-cgo), type Iovec struct +pkg syscall (freebsd-arm-cgo), type Iovec struct, Base *uint8 +pkg syscall (freebsd-arm-cgo), type Iovec struct, Len uint32 +pkg syscall (freebsd-arm-cgo), type Kevent_t struct +pkg syscall (freebsd-arm-cgo), type Kevent_t struct, Data int32 +pkg syscall (freebsd-arm-cgo), type Kevent_t struct, Fflags uint32 +pkg syscall (freebsd-arm-cgo), type Kevent_t struct, Filter int16 +pkg syscall (freebsd-arm-cgo), type Kevent_t struct, Flags uint16 +pkg syscall (freebsd-arm-cgo), type Kevent_t struct, Ident uint32 +pkg syscall (freebsd-arm-cgo), type Kevent_t struct, Udata *uint8 +pkg syscall (freebsd-arm-cgo), type Msghdr struct +pkg syscall (freebsd-arm-cgo), type Msghdr struct, Control *uint8 +pkg syscall (freebsd-arm-cgo), type Msghdr struct, Controllen uint32 +pkg syscall (freebsd-arm-cgo), type Msghdr struct, Flags int32 +pkg syscall (freebsd-arm-cgo), type Msghdr struct, Iov *Iovec +pkg syscall (freebsd-arm-cgo), type Msghdr struct, Iovlen int32 +pkg syscall (freebsd-arm-cgo), type Msghdr struct, Name *uint8 +pkg syscall (freebsd-arm-cgo), type Msghdr struct, Namelen uint32 +pkg syscall (freebsd-arm-cgo), type RawSockaddr struct, Data [14]int8 +pkg syscall (freebsd-arm-cgo), type RawSockaddr struct, Family uint8 +pkg syscall (freebsd-arm-cgo), type RawSockaddr struct, Len uint8 +pkg syscall (freebsd-arm-cgo), type RawSockaddrAny struct, Pad [92]int8 +pkg syscall (freebsd-arm-cgo), type RawSockaddrDatalink struct +pkg syscall (freebsd-arm-cgo), type RawSockaddrDatalink struct, Alen uint8 +pkg syscall (freebsd-arm-cgo), type RawSockaddrDatalink struct, Data [46]int8 +pkg syscall (freebsd-arm-cgo), type RawSockaddrDatalink struct, Family uint8 +pkg syscall (freebsd-arm-cgo), type RawSockaddrDatalink struct, Index uint16 +pkg syscall (freebsd-arm-cgo), type RawSockaddrDatalink struct, Len uint8 +pkg syscall (freebsd-arm-cgo), type RawSockaddrDatalink struct, Nlen uint8 +pkg syscall (freebsd-arm-cgo), type RawSockaddrDatalink struct, Pad_cgo_0 [2]uint8 +pkg syscall (freebsd-arm-cgo), type RawSockaddrDatalink struct, Slen uint8 +pkg syscall (freebsd-arm-cgo), type RawSockaddrDatalink struct, Type uint8 +pkg syscall (freebsd-arm-cgo), type RawSockaddrInet4 struct, Family uint8 +pkg syscall (freebsd-arm-cgo), type RawSockaddrInet4 struct, Len uint8 +pkg syscall (freebsd-arm-cgo), type RawSockaddrInet4 struct, Zero [8]int8 +pkg syscall (freebsd-arm-cgo), type RawSockaddrInet6 struct, Family uint8 +pkg syscall (freebsd-arm-cgo), type RawSockaddrInet6 struct, Len uint8 +pkg syscall (freebsd-arm-cgo), type RawSockaddrUnix struct +pkg syscall (freebsd-arm-cgo), type RawSockaddrUnix struct, Family uint8 +pkg syscall (freebsd-arm-cgo), type RawSockaddrUnix struct, Len uint8 +pkg syscall (freebsd-arm-cgo), type RawSockaddrUnix struct, Pad_cgo_0 [2]uint8 +pkg syscall (freebsd-arm-cgo), type RawSockaddrUnix struct, Path [104]int8 +pkg syscall (freebsd-arm-cgo), type Rlimit struct +pkg syscall (freebsd-arm-cgo), type Rlimit struct, Cur int64 +pkg syscall (freebsd-arm-cgo), type Rlimit struct, Max int64 +pkg syscall (freebsd-arm-cgo), type RouteMessage struct +pkg syscall (freebsd-arm-cgo), type RouteMessage struct, Data []uint8 +pkg syscall (freebsd-arm-cgo), type RouteMessage struct, Header RtMsghdr +pkg syscall (freebsd-arm-cgo), type RoutingMessage interface, unexported methods +pkg syscall (freebsd-arm-cgo), type RtMetrics struct +pkg syscall (freebsd-arm-cgo), type RtMetrics struct, Expire uint32 +pkg syscall (freebsd-arm-cgo), type RtMetrics struct, Filler [3]uint32 +pkg syscall (freebsd-arm-cgo), type RtMetrics struct, Hopcount uint32 +pkg syscall (freebsd-arm-cgo), type RtMetrics struct, Locks uint32 +pkg syscall (freebsd-arm-cgo), type RtMetrics struct, Mtu uint32 +pkg syscall (freebsd-arm-cgo), type RtMetrics struct, Pksent uint32 +pkg syscall (freebsd-arm-cgo), type RtMetrics struct, Recvpipe uint32 +pkg syscall (freebsd-arm-cgo), type RtMetrics struct, Rtt uint32 +pkg syscall (freebsd-arm-cgo), type RtMetrics struct, Rttvar uint32 +pkg syscall (freebsd-arm-cgo), type RtMetrics struct, Sendpipe uint32 +pkg syscall (freebsd-arm-cgo), type RtMetrics struct, Ssthresh uint32 +pkg syscall (freebsd-arm-cgo), type RtMetrics struct, Weight uint32 +pkg syscall (freebsd-arm-cgo), type RtMsghdr struct +pkg syscall (freebsd-arm-cgo), type RtMsghdr struct, Addrs int32 +pkg syscall (freebsd-arm-cgo), type RtMsghdr struct, Errno int32 +pkg syscall (freebsd-arm-cgo), type RtMsghdr struct, Flags int32 +pkg syscall (freebsd-arm-cgo), type RtMsghdr struct, Fmask int32 +pkg syscall (freebsd-arm-cgo), type RtMsghdr struct, Index uint16 +pkg syscall (freebsd-arm-cgo), type RtMsghdr struct, Inits uint32 +pkg syscall (freebsd-arm-cgo), type RtMsghdr struct, Msglen uint16 +pkg syscall (freebsd-arm-cgo), type RtMsghdr struct, Pad_cgo_0 [2]uint8 +pkg syscall (freebsd-arm-cgo), type RtMsghdr struct, Pid int32 +pkg syscall (freebsd-arm-cgo), type RtMsghdr struct, Rmx RtMetrics +pkg syscall (freebsd-arm-cgo), type RtMsghdr struct, Seq int32 +pkg syscall (freebsd-arm-cgo), type RtMsghdr struct, Type uint8 +pkg syscall (freebsd-arm-cgo), type RtMsghdr struct, Version uint8 +pkg syscall (freebsd-arm-cgo), type Rusage struct, Idrss int32 +pkg syscall (freebsd-arm-cgo), type Rusage struct, Inblock int32 +pkg syscall (freebsd-arm-cgo), type Rusage struct, Isrss int32 +pkg syscall (freebsd-arm-cgo), type Rusage struct, Ixrss int32 +pkg syscall (freebsd-arm-cgo), type Rusage struct, Majflt int32 +pkg syscall (freebsd-arm-cgo), type Rusage struct, Maxrss int32 +pkg syscall (freebsd-arm-cgo), type Rusage struct, Minflt int32 +pkg syscall (freebsd-arm-cgo), type Rusage struct, Msgrcv int32 +pkg syscall (freebsd-arm-cgo), type Rusage struct, Msgsnd int32 +pkg syscall (freebsd-arm-cgo), type Rusage struct, Nivcsw int32 +pkg syscall (freebsd-arm-cgo), type Rusage struct, Nsignals int32 +pkg syscall (freebsd-arm-cgo), type Rusage struct, Nswap int32 +pkg syscall (freebsd-arm-cgo), type Rusage struct, Nvcsw int32 +pkg syscall (freebsd-arm-cgo), type Rusage struct, Oublock int32 +pkg syscall (freebsd-arm-cgo), type Rusage struct, Stime Timeval +pkg syscall (freebsd-arm-cgo), type Rusage struct, Utime Timeval +pkg syscall (freebsd-arm-cgo), type SockaddrDatalink struct +pkg syscall (freebsd-arm-cgo), type SockaddrDatalink struct, Alen uint8 +pkg syscall (freebsd-arm-cgo), type SockaddrDatalink struct, Data [46]int8 +pkg syscall (freebsd-arm-cgo), type SockaddrDatalink struct, Family uint8 +pkg syscall (freebsd-arm-cgo), type SockaddrDatalink struct, Index uint16 +pkg syscall (freebsd-arm-cgo), type SockaddrDatalink struct, Len uint8 +pkg syscall (freebsd-arm-cgo), type SockaddrDatalink struct, Nlen uint8 +pkg syscall (freebsd-arm-cgo), type SockaddrDatalink struct, Slen uint8 +pkg syscall (freebsd-arm-cgo), type SockaddrDatalink struct, Type uint8 +pkg syscall (freebsd-arm-cgo), type SocketControlMessage struct +pkg syscall (freebsd-arm-cgo), type SocketControlMessage struct, Data []uint8 +pkg syscall (freebsd-arm-cgo), type SocketControlMessage struct, Header Cmsghdr +pkg syscall (freebsd-arm-cgo), type Stat_t struct +pkg syscall (freebsd-arm-cgo), type Stat_t struct, Atimespec Timespec +pkg syscall (freebsd-arm-cgo), type Stat_t struct, Birthtimespec Timespec +pkg syscall (freebsd-arm-cgo), type Stat_t struct, Blksize uint32 +pkg syscall (freebsd-arm-cgo), type Stat_t struct, Blocks int64 +pkg syscall (freebsd-arm-cgo), type Stat_t struct, Ctimespec Timespec +pkg syscall (freebsd-arm-cgo), type Stat_t struct, Dev uint32 +pkg syscall (freebsd-arm-cgo), type Stat_t struct, Flags uint32 +pkg syscall (freebsd-arm-cgo), type Stat_t struct, Gen uint32 +pkg syscall (freebsd-arm-cgo), type Stat_t struct, Gid uint32 +pkg syscall (freebsd-arm-cgo), type Stat_t struct, Ino uint32 +pkg syscall (freebsd-arm-cgo), type Stat_t struct, Lspare int32 +pkg syscall (freebsd-arm-cgo), type Stat_t struct, Mode uint16 +pkg syscall (freebsd-arm-cgo), type Stat_t struct, Mtimespec Timespec +pkg syscall (freebsd-arm-cgo), type Stat_t struct, Nlink uint16 +pkg syscall (freebsd-arm-cgo), type Stat_t struct, Pad_cgo_0 [4]uint8 +pkg syscall (freebsd-arm-cgo), type Stat_t struct, Rdev uint32 +pkg syscall (freebsd-arm-cgo), type Stat_t struct, Size int64 +pkg syscall (freebsd-arm-cgo), type Stat_t struct, Uid uint32 +pkg syscall (freebsd-arm-cgo), type Statfs_t struct +pkg syscall (freebsd-arm-cgo), type Statfs_t struct, Asyncreads uint64 +pkg syscall (freebsd-arm-cgo), type Statfs_t struct, Asyncwrites uint64 +pkg syscall (freebsd-arm-cgo), type Statfs_t struct, Bavail int64 +pkg syscall (freebsd-arm-cgo), type Statfs_t struct, Bfree uint64 +pkg syscall (freebsd-arm-cgo), type Statfs_t struct, Blocks uint64 +pkg syscall (freebsd-arm-cgo), type Statfs_t struct, Bsize uint64 +pkg syscall (freebsd-arm-cgo), type Statfs_t struct, Charspare [80]int8 +pkg syscall (freebsd-arm-cgo), type Statfs_t struct, Ffree int64 +pkg syscall (freebsd-arm-cgo), type Statfs_t struct, Files uint64 +pkg syscall (freebsd-arm-cgo), type Statfs_t struct, Flags uint64 +pkg syscall (freebsd-arm-cgo), type Statfs_t struct, Fsid Fsid +pkg syscall (freebsd-arm-cgo), type Statfs_t struct, Fstypename [16]int8 +pkg syscall (freebsd-arm-cgo), type Statfs_t struct, Iosize uint64 +pkg syscall (freebsd-arm-cgo), type Statfs_t struct, Mntfromname [88]int8 +pkg syscall (freebsd-arm-cgo), type Statfs_t struct, Mntonname [88]int8 +pkg syscall (freebsd-arm-cgo), type Statfs_t struct, Namemax uint32 +pkg syscall (freebsd-arm-cgo), type Statfs_t struct, Owner uint32 +pkg syscall (freebsd-arm-cgo), type Statfs_t struct, Spare [10]uint64 +pkg syscall (freebsd-arm-cgo), type Statfs_t struct, Syncreads uint64 +pkg syscall (freebsd-arm-cgo), type Statfs_t struct, Syncwrites uint64 +pkg syscall (freebsd-arm-cgo), type Statfs_t struct, Type uint32 +pkg syscall (freebsd-arm-cgo), type Statfs_t struct, Version uint32 +pkg syscall (freebsd-arm-cgo), type SysProcAttr struct, Chroot string +pkg syscall (freebsd-arm-cgo), type SysProcAttr struct, Credential *Credential +pkg syscall (freebsd-arm-cgo), type SysProcAttr struct, Noctty bool +pkg syscall (freebsd-arm-cgo), type SysProcAttr struct, Ptrace bool +pkg syscall (freebsd-arm-cgo), type SysProcAttr struct, Setctty bool +pkg syscall (freebsd-arm-cgo), type SysProcAttr struct, Setpgid bool +pkg syscall (freebsd-arm-cgo), type SysProcAttr struct, Setsid bool +pkg syscall (freebsd-arm-cgo), type Timespec struct, Nsec int32 +pkg syscall (freebsd-arm-cgo), type Timespec struct, Sec int64 +pkg syscall (freebsd-arm-cgo), type Timeval struct, Sec int64 +pkg syscall (freebsd-arm-cgo), type Timeval struct, Usec int32 +pkg syscall (freebsd-arm-cgo), type WaitStatus uint32 +pkg syscall (freebsd-arm-cgo), var Stderr int +pkg syscall (freebsd-arm-cgo), var Stdin int +pkg syscall (freebsd-arm-cgo), var Stdout int +pkg syscall (linux-386), const CLONE_CHILD_CLEARTID = 2097152 +pkg syscall (linux-386), const CLONE_CHILD_CLEARTID ideal-int +pkg syscall (linux-386), const CLONE_CHILD_SETTID = 16777216 +pkg syscall (linux-386), const CLONE_CHILD_SETTID ideal-int +pkg syscall (linux-386), const CLONE_DETACHED = 4194304 +pkg syscall (linux-386), const CLONE_DETACHED ideal-int +pkg syscall (linux-386), const CLONE_FILES = 1024 +pkg syscall (linux-386), const CLONE_FILES ideal-int +pkg syscall (linux-386), const CLONE_FS = 512 +pkg syscall (linux-386), const CLONE_FS ideal-int +pkg syscall (linux-386), const CLONE_IO = 2147483648 +pkg syscall (linux-386), const CLONE_IO ideal-int +pkg syscall (linux-386), const CLONE_NEWIPC = 134217728 +pkg syscall (linux-386), const CLONE_NEWIPC ideal-int +pkg syscall (linux-386), const CLONE_NEWNET = 1073741824 +pkg syscall (linux-386), const CLONE_NEWNET ideal-int +pkg syscall (linux-386), const CLONE_NEWNS = 131072 +pkg syscall (linux-386), const CLONE_NEWNS ideal-int +pkg syscall (linux-386), const CLONE_NEWPID = 536870912 +pkg syscall (linux-386), const CLONE_NEWPID ideal-int +pkg syscall (linux-386), const CLONE_NEWUSER = 268435456 +pkg syscall (linux-386), const CLONE_NEWUSER ideal-int +pkg syscall (linux-386), const CLONE_NEWUTS = 67108864 +pkg syscall (linux-386), const CLONE_NEWUTS ideal-int +pkg syscall (linux-386), const CLONE_PARENT = 32768 +pkg syscall (linux-386), const CLONE_PARENT ideal-int +pkg syscall (linux-386), const CLONE_PARENT_SETTID = 1048576 +pkg syscall (linux-386), const CLONE_PARENT_SETTID ideal-int +pkg syscall (linux-386), const CLONE_PTRACE = 8192 +pkg syscall (linux-386), const CLONE_PTRACE ideal-int +pkg syscall (linux-386), const CLONE_SETTLS = 524288 +pkg syscall (linux-386), const CLONE_SETTLS ideal-int +pkg syscall (linux-386), const CLONE_SIGHAND = 2048 +pkg syscall (linux-386), const CLONE_SIGHAND ideal-int +pkg syscall (linux-386), const CLONE_SYSVSEM = 262144 +pkg syscall (linux-386), const CLONE_SYSVSEM ideal-int +pkg syscall (linux-386), const CLONE_THREAD = 65536 +pkg syscall (linux-386), const CLONE_THREAD ideal-int +pkg syscall (linux-386), const CLONE_UNTRACED = 8388608 +pkg syscall (linux-386), const CLONE_UNTRACED ideal-int +pkg syscall (linux-386), const CLONE_VFORK = 16384 +pkg syscall (linux-386), const CLONE_VFORK ideal-int +pkg syscall (linux-386), const CLONE_VM = 256 +pkg syscall (linux-386), const CLONE_VM ideal-int +pkg syscall (linux-386), const ICMPV6_FILTER = 1 +pkg syscall (linux-386), const ICMPV6_FILTER ideal-int +pkg syscall (linux-386), const PRIO_PGRP = 1 +pkg syscall (linux-386), const PRIO_PGRP ideal-int +pkg syscall (linux-386), const PRIO_PROCESS = 0 +pkg syscall (linux-386), const PRIO_PROCESS ideal-int +pkg syscall (linux-386), const PRIO_USER = 2 +pkg syscall (linux-386), const PRIO_USER ideal-int +pkg syscall (linux-386), const SizeofICMPv6Filter = 32 +pkg syscall (linux-386), const SizeofICMPv6Filter ideal-int +pkg syscall (linux-386), const SizeofIPv6MTUInfo = 32 +pkg syscall (linux-386), const SizeofIPv6MTUInfo ideal-int +pkg syscall (linux-386), const TCIFLUSH = 0 +pkg syscall (linux-386), const TCIFLUSH ideal-int +pkg syscall (linux-386), const TCIOFLUSH = 2 +pkg syscall (linux-386), const TCIOFLUSH ideal-int +pkg syscall (linux-386), const TCOFLUSH = 1 +pkg syscall (linux-386), const TCOFLUSH ideal-int +pkg syscall (linux-386), func Dup3(int, int, int) error +pkg syscall (linux-386), func Getpriority(int, int) (int, error) +pkg syscall (linux-386), func GetsockoptICMPv6Filter(int, int, int) (*ICMPv6Filter, error) +pkg syscall (linux-386), func GetsockoptIPv6MTUInfo(int, int, int) (*IPv6MTUInfo, error) +pkg syscall (linux-386), func Setpriority(int, int, int) error +pkg syscall (linux-386), func SetsockoptByte(int, int, int, uint8) error +pkg syscall (linux-386), func SetsockoptICMPv6Filter(int, int, int, *ICMPv6Filter) error +pkg syscall (linux-386), type ICMPv6Filter struct +pkg syscall (linux-386), type ICMPv6Filter struct, Data [8]uint32 +pkg syscall (linux-386), type IPv6MTUInfo struct +pkg syscall (linux-386), type IPv6MTUInfo struct, Addr RawSockaddrInet6 +pkg syscall (linux-386), type IPv6MTUInfo struct, Mtu uint32 +pkg syscall (linux-386), type SysProcAttr struct, Cloneflags uintptr +pkg syscall (linux-386-cgo), const CLONE_CHILD_CLEARTID = 2097152 +pkg syscall (linux-386-cgo), const CLONE_CHILD_CLEARTID ideal-int +pkg syscall (linux-386-cgo), const CLONE_CHILD_SETTID = 16777216 +pkg syscall (linux-386-cgo), const CLONE_CHILD_SETTID ideal-int +pkg syscall (linux-386-cgo), const CLONE_DETACHED = 4194304 +pkg syscall (linux-386-cgo), const CLONE_DETACHED ideal-int +pkg syscall (linux-386-cgo), const CLONE_FILES = 1024 +pkg syscall (linux-386-cgo), const CLONE_FILES ideal-int +pkg syscall (linux-386-cgo), const CLONE_FS = 512 +pkg syscall (linux-386-cgo), const CLONE_FS ideal-int +pkg syscall (linux-386-cgo), const CLONE_IO = 2147483648 +pkg syscall (linux-386-cgo), const CLONE_IO ideal-int +pkg syscall (linux-386-cgo), const CLONE_NEWIPC = 134217728 +pkg syscall (linux-386-cgo), const CLONE_NEWIPC ideal-int +pkg syscall (linux-386-cgo), const CLONE_NEWNET = 1073741824 +pkg syscall (linux-386-cgo), const CLONE_NEWNET ideal-int +pkg syscall (linux-386-cgo), const CLONE_NEWNS = 131072 +pkg syscall (linux-386-cgo), const CLONE_NEWNS ideal-int +pkg syscall (linux-386-cgo), const CLONE_NEWPID = 536870912 +pkg syscall (linux-386-cgo), const CLONE_NEWPID ideal-int +pkg syscall (linux-386-cgo), const CLONE_NEWUSER = 268435456 +pkg syscall (linux-386-cgo), const CLONE_NEWUSER ideal-int +pkg syscall (linux-386-cgo), const CLONE_NEWUTS = 67108864 +pkg syscall (linux-386-cgo), const CLONE_NEWUTS ideal-int +pkg syscall (linux-386-cgo), const CLONE_PARENT = 32768 +pkg syscall (linux-386-cgo), const CLONE_PARENT ideal-int +pkg syscall (linux-386-cgo), const CLONE_PARENT_SETTID = 1048576 +pkg syscall (linux-386-cgo), const CLONE_PARENT_SETTID ideal-int +pkg syscall (linux-386-cgo), const CLONE_PTRACE = 8192 +pkg syscall (linux-386-cgo), const CLONE_PTRACE ideal-int +pkg syscall (linux-386-cgo), const CLONE_SETTLS = 524288 +pkg syscall (linux-386-cgo), const CLONE_SETTLS ideal-int +pkg syscall (linux-386-cgo), const CLONE_SIGHAND = 2048 +pkg syscall (linux-386-cgo), const CLONE_SIGHAND ideal-int +pkg syscall (linux-386-cgo), const CLONE_SYSVSEM = 262144 +pkg syscall (linux-386-cgo), const CLONE_SYSVSEM ideal-int +pkg syscall (linux-386-cgo), const CLONE_THREAD = 65536 +pkg syscall (linux-386-cgo), const CLONE_THREAD ideal-int +pkg syscall (linux-386-cgo), const CLONE_UNTRACED = 8388608 +pkg syscall (linux-386-cgo), const CLONE_UNTRACED ideal-int +pkg syscall (linux-386-cgo), const CLONE_VFORK = 16384 +pkg syscall (linux-386-cgo), const CLONE_VFORK ideal-int +pkg syscall (linux-386-cgo), const CLONE_VM = 256 +pkg syscall (linux-386-cgo), const CLONE_VM ideal-int +pkg syscall (linux-386-cgo), const ICMPV6_FILTER = 1 +pkg syscall (linux-386-cgo), const ICMPV6_FILTER ideal-int +pkg syscall (linux-386-cgo), const PRIO_PGRP = 1 +pkg syscall (linux-386-cgo), const PRIO_PGRP ideal-int +pkg syscall (linux-386-cgo), const PRIO_PROCESS = 0 +pkg syscall (linux-386-cgo), const PRIO_PROCESS ideal-int +pkg syscall (linux-386-cgo), const PRIO_USER = 2 +pkg syscall (linux-386-cgo), const PRIO_USER ideal-int +pkg syscall (linux-386-cgo), const SizeofICMPv6Filter = 32 +pkg syscall (linux-386-cgo), const SizeofICMPv6Filter ideal-int +pkg syscall (linux-386-cgo), const SizeofIPv6MTUInfo = 32 +pkg syscall (linux-386-cgo), const SizeofIPv6MTUInfo ideal-int +pkg syscall (linux-386-cgo), const TCIFLUSH = 0 +pkg syscall (linux-386-cgo), const TCIFLUSH ideal-int +pkg syscall (linux-386-cgo), const TCIOFLUSH = 2 +pkg syscall (linux-386-cgo), const TCIOFLUSH ideal-int +pkg syscall (linux-386-cgo), const TCOFLUSH = 1 +pkg syscall (linux-386-cgo), const TCOFLUSH ideal-int +pkg syscall (linux-386-cgo), func Dup3(int, int, int) error +pkg syscall (linux-386-cgo), func Getpriority(int, int) (int, error) +pkg syscall (linux-386-cgo), func GetsockoptICMPv6Filter(int, int, int) (*ICMPv6Filter, error) +pkg syscall (linux-386-cgo), func GetsockoptIPv6MTUInfo(int, int, int) (*IPv6MTUInfo, error) +pkg syscall (linux-386-cgo), func Setpriority(int, int, int) error +pkg syscall (linux-386-cgo), func SetsockoptByte(int, int, int, uint8) error +pkg syscall (linux-386-cgo), func SetsockoptICMPv6Filter(int, int, int, *ICMPv6Filter) error +pkg syscall (linux-386-cgo), type ICMPv6Filter struct +pkg syscall (linux-386-cgo), type ICMPv6Filter struct, Data [8]uint32 +pkg syscall (linux-386-cgo), type IPv6MTUInfo struct +pkg syscall (linux-386-cgo), type IPv6MTUInfo struct, Addr RawSockaddrInet6 +pkg syscall (linux-386-cgo), type IPv6MTUInfo struct, Mtu uint32 +pkg syscall (linux-386-cgo), type SysProcAttr struct, Cloneflags uintptr +pkg syscall (linux-amd64), const CLONE_CHILD_CLEARTID = 2097152 +pkg syscall (linux-amd64), const CLONE_CHILD_CLEARTID ideal-int +pkg syscall (linux-amd64), const CLONE_CHILD_SETTID = 16777216 +pkg syscall (linux-amd64), const CLONE_CHILD_SETTID ideal-int +pkg syscall (linux-amd64), const CLONE_DETACHED = 4194304 +pkg syscall (linux-amd64), const CLONE_DETACHED ideal-int +pkg syscall (linux-amd64), const CLONE_FILES = 1024 +pkg syscall (linux-amd64), const CLONE_FILES ideal-int +pkg syscall (linux-amd64), const CLONE_FS = 512 +pkg syscall (linux-amd64), const CLONE_FS ideal-int +pkg syscall (linux-amd64), const CLONE_IO = 2147483648 +pkg syscall (linux-amd64), const CLONE_IO ideal-int +pkg syscall (linux-amd64), const CLONE_NEWIPC = 134217728 +pkg syscall (linux-amd64), const CLONE_NEWIPC ideal-int +pkg syscall (linux-amd64), const CLONE_NEWNET = 1073741824 +pkg syscall (linux-amd64), const CLONE_NEWNET ideal-int +pkg syscall (linux-amd64), const CLONE_NEWNS = 131072 +pkg syscall (linux-amd64), const CLONE_NEWNS ideal-int +pkg syscall (linux-amd64), const CLONE_NEWPID = 536870912 +pkg syscall (linux-amd64), const CLONE_NEWPID ideal-int +pkg syscall (linux-amd64), const CLONE_NEWUSER = 268435456 +pkg syscall (linux-amd64), const CLONE_NEWUSER ideal-int +pkg syscall (linux-amd64), const CLONE_NEWUTS = 67108864 +pkg syscall (linux-amd64), const CLONE_NEWUTS ideal-int +pkg syscall (linux-amd64), const CLONE_PARENT = 32768 +pkg syscall (linux-amd64), const CLONE_PARENT ideal-int +pkg syscall (linux-amd64), const CLONE_PARENT_SETTID = 1048576 +pkg syscall (linux-amd64), const CLONE_PARENT_SETTID ideal-int +pkg syscall (linux-amd64), const CLONE_PTRACE = 8192 +pkg syscall (linux-amd64), const CLONE_PTRACE ideal-int +pkg syscall (linux-amd64), const CLONE_SETTLS = 524288 +pkg syscall (linux-amd64), const CLONE_SETTLS ideal-int +pkg syscall (linux-amd64), const CLONE_SIGHAND = 2048 +pkg syscall (linux-amd64), const CLONE_SIGHAND ideal-int +pkg syscall (linux-amd64), const CLONE_SYSVSEM = 262144 +pkg syscall (linux-amd64), const CLONE_SYSVSEM ideal-int +pkg syscall (linux-amd64), const CLONE_THREAD = 65536 +pkg syscall (linux-amd64), const CLONE_THREAD ideal-int +pkg syscall (linux-amd64), const CLONE_UNTRACED = 8388608 +pkg syscall (linux-amd64), const CLONE_UNTRACED ideal-int +pkg syscall (linux-amd64), const CLONE_VFORK = 16384 +pkg syscall (linux-amd64), const CLONE_VFORK ideal-int +pkg syscall (linux-amd64), const CLONE_VM = 256 +pkg syscall (linux-amd64), const CLONE_VM ideal-int +pkg syscall (linux-amd64), const ICMPV6_FILTER = 1 +pkg syscall (linux-amd64), const ICMPV6_FILTER ideal-int +pkg syscall (linux-amd64), const PRIO_PGRP = 1 +pkg syscall (linux-amd64), const PRIO_PGRP ideal-int +pkg syscall (linux-amd64), const PRIO_PROCESS = 0 +pkg syscall (linux-amd64), const PRIO_PROCESS ideal-int +pkg syscall (linux-amd64), const PRIO_USER = 2 +pkg syscall (linux-amd64), const PRIO_USER ideal-int +pkg syscall (linux-amd64), const SizeofICMPv6Filter = 32 +pkg syscall (linux-amd64), const SizeofICMPv6Filter ideal-int +pkg syscall (linux-amd64), const SizeofIPv6MTUInfo = 32 +pkg syscall (linux-amd64), const SizeofIPv6MTUInfo ideal-int +pkg syscall (linux-amd64), const TCIFLUSH = 0 +pkg syscall (linux-amd64), const TCIFLUSH ideal-int +pkg syscall (linux-amd64), const TCIOFLUSH = 2 +pkg syscall (linux-amd64), const TCIOFLUSH ideal-int +pkg syscall (linux-amd64), const TCOFLUSH = 1 +pkg syscall (linux-amd64), const TCOFLUSH ideal-int +pkg syscall (linux-amd64), func Dup3(int, int, int) error +pkg syscall (linux-amd64), func Getpriority(int, int) (int, error) +pkg syscall (linux-amd64), func GetsockoptICMPv6Filter(int, int, int) (*ICMPv6Filter, error) +pkg syscall (linux-amd64), func GetsockoptIPv6MTUInfo(int, int, int) (*IPv6MTUInfo, error) +pkg syscall (linux-amd64), func Setpriority(int, int, int) error +pkg syscall (linux-amd64), func SetsockoptByte(int, int, int, uint8) error +pkg syscall (linux-amd64), func SetsockoptICMPv6Filter(int, int, int, *ICMPv6Filter) error +pkg syscall (linux-amd64), type ICMPv6Filter struct +pkg syscall (linux-amd64), type ICMPv6Filter struct, Data [8]uint32 +pkg syscall (linux-amd64), type IPv6MTUInfo struct +pkg syscall (linux-amd64), type IPv6MTUInfo struct, Addr RawSockaddrInet6 +pkg syscall (linux-amd64), type IPv6MTUInfo struct, Mtu uint32 +pkg syscall (linux-amd64), type SysProcAttr struct, Cloneflags uintptr +pkg syscall (linux-amd64-cgo), const CLONE_CHILD_CLEARTID = 2097152 +pkg syscall (linux-amd64-cgo), const CLONE_CHILD_CLEARTID ideal-int +pkg syscall (linux-amd64-cgo), const CLONE_CHILD_SETTID = 16777216 +pkg syscall (linux-amd64-cgo), const CLONE_CHILD_SETTID ideal-int +pkg syscall (linux-amd64-cgo), const CLONE_DETACHED = 4194304 +pkg syscall (linux-amd64-cgo), const CLONE_DETACHED ideal-int +pkg syscall (linux-amd64-cgo), const CLONE_FILES = 1024 +pkg syscall (linux-amd64-cgo), const CLONE_FILES ideal-int +pkg syscall (linux-amd64-cgo), const CLONE_FS = 512 +pkg syscall (linux-amd64-cgo), const CLONE_FS ideal-int +pkg syscall (linux-amd64-cgo), const CLONE_IO = 2147483648 +pkg syscall (linux-amd64-cgo), const CLONE_IO ideal-int +pkg syscall (linux-amd64-cgo), const CLONE_NEWIPC = 134217728 +pkg syscall (linux-amd64-cgo), const CLONE_NEWIPC ideal-int +pkg syscall (linux-amd64-cgo), const CLONE_NEWNET = 1073741824 +pkg syscall (linux-amd64-cgo), const CLONE_NEWNET ideal-int +pkg syscall (linux-amd64-cgo), const CLONE_NEWNS = 131072 +pkg syscall (linux-amd64-cgo), const CLONE_NEWNS ideal-int +pkg syscall (linux-amd64-cgo), const CLONE_NEWPID = 536870912 +pkg syscall (linux-amd64-cgo), const CLONE_NEWPID ideal-int +pkg syscall (linux-amd64-cgo), const CLONE_NEWUSER = 268435456 +pkg syscall (linux-amd64-cgo), const CLONE_NEWUSER ideal-int +pkg syscall (linux-amd64-cgo), const CLONE_NEWUTS = 67108864 +pkg syscall (linux-amd64-cgo), const CLONE_NEWUTS ideal-int +pkg syscall (linux-amd64-cgo), const CLONE_PARENT = 32768 +pkg syscall (linux-amd64-cgo), const CLONE_PARENT ideal-int +pkg syscall (linux-amd64-cgo), const CLONE_PARENT_SETTID = 1048576 +pkg syscall (linux-amd64-cgo), const CLONE_PARENT_SETTID ideal-int +pkg syscall (linux-amd64-cgo), const CLONE_PTRACE = 8192 +pkg syscall (linux-amd64-cgo), const CLONE_PTRACE ideal-int +pkg syscall (linux-amd64-cgo), const CLONE_SETTLS = 524288 +pkg syscall (linux-amd64-cgo), const CLONE_SETTLS ideal-int +pkg syscall (linux-amd64-cgo), const CLONE_SIGHAND = 2048 +pkg syscall (linux-amd64-cgo), const CLONE_SIGHAND ideal-int +pkg syscall (linux-amd64-cgo), const CLONE_SYSVSEM = 262144 +pkg syscall (linux-amd64-cgo), const CLONE_SYSVSEM ideal-int +pkg syscall (linux-amd64-cgo), const CLONE_THREAD = 65536 +pkg syscall (linux-amd64-cgo), const CLONE_THREAD ideal-int +pkg syscall (linux-amd64-cgo), const CLONE_UNTRACED = 8388608 +pkg syscall (linux-amd64-cgo), const CLONE_UNTRACED ideal-int +pkg syscall (linux-amd64-cgo), const CLONE_VFORK = 16384 +pkg syscall (linux-amd64-cgo), const CLONE_VFORK ideal-int +pkg syscall (linux-amd64-cgo), const CLONE_VM = 256 +pkg syscall (linux-amd64-cgo), const CLONE_VM ideal-int +pkg syscall (linux-amd64-cgo), const ICMPV6_FILTER = 1 +pkg syscall (linux-amd64-cgo), const ICMPV6_FILTER ideal-int +pkg syscall (linux-amd64-cgo), const PRIO_PGRP = 1 +pkg syscall (linux-amd64-cgo), const PRIO_PGRP ideal-int +pkg syscall (linux-amd64-cgo), const PRIO_PROCESS = 0 +pkg syscall (linux-amd64-cgo), const PRIO_PROCESS ideal-int +pkg syscall (linux-amd64-cgo), const PRIO_USER = 2 +pkg syscall (linux-amd64-cgo), const PRIO_USER ideal-int +pkg syscall (linux-amd64-cgo), const SizeofICMPv6Filter = 32 +pkg syscall (linux-amd64-cgo), const SizeofICMPv6Filter ideal-int +pkg syscall (linux-amd64-cgo), const SizeofIPv6MTUInfo = 32 +pkg syscall (linux-amd64-cgo), const SizeofIPv6MTUInfo ideal-int +pkg syscall (linux-amd64-cgo), const TCIFLUSH = 0 +pkg syscall (linux-amd64-cgo), const TCIFLUSH ideal-int +pkg syscall (linux-amd64-cgo), const TCIOFLUSH = 2 +pkg syscall (linux-amd64-cgo), const TCIOFLUSH ideal-int +pkg syscall (linux-amd64-cgo), const TCOFLUSH = 1 +pkg syscall (linux-amd64-cgo), const TCOFLUSH ideal-int +pkg syscall (linux-amd64-cgo), func Dup3(int, int, int) error +pkg syscall (linux-amd64-cgo), func Getpriority(int, int) (int, error) +pkg syscall (linux-amd64-cgo), func GetsockoptICMPv6Filter(int, int, int) (*ICMPv6Filter, error) +pkg syscall (linux-amd64-cgo), func GetsockoptIPv6MTUInfo(int, int, int) (*IPv6MTUInfo, error) +pkg syscall (linux-amd64-cgo), func Setpriority(int, int, int) error +pkg syscall (linux-amd64-cgo), func SetsockoptByte(int, int, int, uint8) error +pkg syscall (linux-amd64-cgo), func SetsockoptICMPv6Filter(int, int, int, *ICMPv6Filter) error +pkg syscall (linux-amd64-cgo), type ICMPv6Filter struct +pkg syscall (linux-amd64-cgo), type ICMPv6Filter struct, Data [8]uint32 +pkg syscall (linux-amd64-cgo), type IPv6MTUInfo struct +pkg syscall (linux-amd64-cgo), type IPv6MTUInfo struct, Addr RawSockaddrInet6 +pkg syscall (linux-amd64-cgo), type IPv6MTUInfo struct, Mtu uint32 +pkg syscall (linux-amd64-cgo), type SysProcAttr struct, Cloneflags uintptr +pkg syscall (linux-arm), const CLONE_CHILD_CLEARTID = 2097152 +pkg syscall (linux-arm), const CLONE_CHILD_CLEARTID ideal-int +pkg syscall (linux-arm), const CLONE_CHILD_SETTID = 16777216 +pkg syscall (linux-arm), const CLONE_CHILD_SETTID ideal-int +pkg syscall (linux-arm), const CLONE_DETACHED = 4194304 +pkg syscall (linux-arm), const CLONE_DETACHED ideal-int +pkg syscall (linux-arm), const CLONE_FILES = 1024 +pkg syscall (linux-arm), const CLONE_FILES ideal-int +pkg syscall (linux-arm), const CLONE_FS = 512 +pkg syscall (linux-arm), const CLONE_FS ideal-int +pkg syscall (linux-arm), const CLONE_IO = 2147483648 +pkg syscall (linux-arm), const CLONE_IO ideal-int +pkg syscall (linux-arm), const CLONE_NEWIPC = 134217728 +pkg syscall (linux-arm), const CLONE_NEWIPC ideal-int +pkg syscall (linux-arm), const CLONE_NEWNET = 1073741824 +pkg syscall (linux-arm), const CLONE_NEWNET ideal-int +pkg syscall (linux-arm), const CLONE_NEWNS = 131072 +pkg syscall (linux-arm), const CLONE_NEWNS ideal-int +pkg syscall (linux-arm), const CLONE_NEWPID = 536870912 +pkg syscall (linux-arm), const CLONE_NEWPID ideal-int +pkg syscall (linux-arm), const CLONE_NEWUSER = 268435456 +pkg syscall (linux-arm), const CLONE_NEWUSER ideal-int +pkg syscall (linux-arm), const CLONE_NEWUTS = 67108864 +pkg syscall (linux-arm), const CLONE_NEWUTS ideal-int +pkg syscall (linux-arm), const CLONE_PARENT = 32768 +pkg syscall (linux-arm), const CLONE_PARENT ideal-int +pkg syscall (linux-arm), const CLONE_PARENT_SETTID = 1048576 +pkg syscall (linux-arm), const CLONE_PARENT_SETTID ideal-int +pkg syscall (linux-arm), const CLONE_PTRACE = 8192 +pkg syscall (linux-arm), const CLONE_PTRACE ideal-int +pkg syscall (linux-arm), const CLONE_SETTLS = 524288 +pkg syscall (linux-arm), const CLONE_SETTLS ideal-int +pkg syscall (linux-arm), const CLONE_SIGHAND = 2048 +pkg syscall (linux-arm), const CLONE_SIGHAND ideal-int +pkg syscall (linux-arm), const CLONE_SYSVSEM = 262144 +pkg syscall (linux-arm), const CLONE_SYSVSEM ideal-int +pkg syscall (linux-arm), const CLONE_THREAD = 65536 +pkg syscall (linux-arm), const CLONE_THREAD ideal-int +pkg syscall (linux-arm), const CLONE_UNTRACED = 8388608 +pkg syscall (linux-arm), const CLONE_UNTRACED ideal-int +pkg syscall (linux-arm), const CLONE_VFORK = 16384 +pkg syscall (linux-arm), const CLONE_VFORK ideal-int +pkg syscall (linux-arm), const CLONE_VM = 256 +pkg syscall (linux-arm), const CLONE_VM ideal-int +pkg syscall (linux-arm), const ICMPV6_FILTER = 1 +pkg syscall (linux-arm), const ICMPV6_FILTER ideal-int +pkg syscall (linux-arm), const PRIO_PGRP = 1 +pkg syscall (linux-arm), const PRIO_PGRP ideal-int +pkg syscall (linux-arm), const PRIO_PROCESS = 0 +pkg syscall (linux-arm), const PRIO_PROCESS ideal-int +pkg syscall (linux-arm), const PRIO_USER = 2 +pkg syscall (linux-arm), const PRIO_USER ideal-int +pkg syscall (linux-arm), const SizeofICMPv6Filter = 32 +pkg syscall (linux-arm), const SizeofICMPv6Filter ideal-int +pkg syscall (linux-arm), const SizeofIPv6MTUInfo = 32 +pkg syscall (linux-arm), const SizeofIPv6MTUInfo ideal-int +pkg syscall (linux-arm), const TCIFLUSH = 0 +pkg syscall (linux-arm), const TCIFLUSH ideal-int +pkg syscall (linux-arm), const TCIOFLUSH = 2 +pkg syscall (linux-arm), const TCIOFLUSH ideal-int +pkg syscall (linux-arm), const TCOFLUSH = 1 +pkg syscall (linux-arm), const TCOFLUSH ideal-int +pkg syscall (linux-arm), func Dup3(int, int, int) error +pkg syscall (linux-arm), func Getpriority(int, int) (int, error) +pkg syscall (linux-arm), func GetsockoptICMPv6Filter(int, int, int) (*ICMPv6Filter, error) +pkg syscall (linux-arm), func GetsockoptIPv6MTUInfo(int, int, int) (*IPv6MTUInfo, error) +pkg syscall (linux-arm), func Setpriority(int, int, int) error +pkg syscall (linux-arm), func SetsockoptByte(int, int, int, uint8) error +pkg syscall (linux-arm), func SetsockoptICMPv6Filter(int, int, int, *ICMPv6Filter) error +pkg syscall (linux-arm), type ICMPv6Filter struct +pkg syscall (linux-arm), type ICMPv6Filter struct, Data [8]uint32 +pkg syscall (linux-arm), type IPv6MTUInfo struct +pkg syscall (linux-arm), type IPv6MTUInfo struct, Addr RawSockaddrInet6 +pkg syscall (linux-arm), type IPv6MTUInfo struct, Mtu uint32 +pkg syscall (linux-arm), type SysProcAttr struct, Cloneflags uintptr +pkg syscall (linux-arm-cgo), const AF_ALG ideal-int +pkg syscall (linux-arm-cgo), const AF_APPLETALK ideal-int +pkg syscall (linux-arm-cgo), const AF_ASH ideal-int +pkg syscall (linux-arm-cgo), const AF_ATMPVC ideal-int +pkg syscall (linux-arm-cgo), const AF_ATMSVC ideal-int +pkg syscall (linux-arm-cgo), const AF_AX25 ideal-int +pkg syscall (linux-arm-cgo), const AF_BLUETOOTH ideal-int +pkg syscall (linux-arm-cgo), const AF_BRIDGE ideal-int +pkg syscall (linux-arm-cgo), const AF_CAIF ideal-int +pkg syscall (linux-arm-cgo), const AF_CAN ideal-int +pkg syscall (linux-arm-cgo), const AF_DECnet ideal-int +pkg syscall (linux-arm-cgo), const AF_ECONET ideal-int +pkg syscall (linux-arm-cgo), const AF_FILE ideal-int +pkg syscall (linux-arm-cgo), const AF_IEEE802154 ideal-int +pkg syscall (linux-arm-cgo), const AF_IPX ideal-int +pkg syscall (linux-arm-cgo), const AF_IRDA ideal-int +pkg syscall (linux-arm-cgo), const AF_ISDN ideal-int +pkg syscall (linux-arm-cgo), const AF_IUCV ideal-int +pkg syscall (linux-arm-cgo), const AF_KEY ideal-int +pkg syscall (linux-arm-cgo), const AF_LLC ideal-int +pkg syscall (linux-arm-cgo), const AF_LOCAL ideal-int +pkg syscall (linux-arm-cgo), const AF_MAX ideal-int +pkg syscall (linux-arm-cgo), const AF_NETBEUI ideal-int +pkg syscall (linux-arm-cgo), const AF_NETLINK ideal-int +pkg syscall (linux-arm-cgo), const AF_NETROM ideal-int +pkg syscall (linux-arm-cgo), const AF_PACKET ideal-int +pkg syscall (linux-arm-cgo), const AF_PHONET ideal-int +pkg syscall (linux-arm-cgo), const AF_PPPOX ideal-int +pkg syscall (linux-arm-cgo), const AF_RDS ideal-int +pkg syscall (linux-arm-cgo), const AF_ROSE ideal-int +pkg syscall (linux-arm-cgo), const AF_ROUTE ideal-int +pkg syscall (linux-arm-cgo), const AF_RXRPC ideal-int +pkg syscall (linux-arm-cgo), const AF_SECURITY ideal-int +pkg syscall (linux-arm-cgo), const AF_SNA ideal-int +pkg syscall (linux-arm-cgo), const AF_TIPC ideal-int +pkg syscall (linux-arm-cgo), const AF_WANPIPE ideal-int +pkg syscall (linux-arm-cgo), const AF_X25 ideal-int +pkg syscall (linux-arm-cgo), const ARPHRD_ADAPT ideal-int +pkg syscall (linux-arm-cgo), const ARPHRD_APPLETLK ideal-int +pkg syscall (linux-arm-cgo), const ARPHRD_ARCNET ideal-int +pkg syscall (linux-arm-cgo), const ARPHRD_ASH ideal-int +pkg syscall (linux-arm-cgo), const ARPHRD_ATM ideal-int +pkg syscall (linux-arm-cgo), const ARPHRD_AX25 ideal-int +pkg syscall (linux-arm-cgo), const ARPHRD_BIF ideal-int +pkg syscall (linux-arm-cgo), const ARPHRD_CHAOS ideal-int +pkg syscall (linux-arm-cgo), const ARPHRD_CISCO ideal-int +pkg syscall (linux-arm-cgo), const ARPHRD_CSLIP ideal-int +pkg syscall (linux-arm-cgo), const ARPHRD_CSLIP6 ideal-int +pkg syscall (linux-arm-cgo), const ARPHRD_DDCMP ideal-int +pkg syscall (linux-arm-cgo), const ARPHRD_DLCI ideal-int +pkg syscall (linux-arm-cgo), const ARPHRD_ECONET ideal-int +pkg syscall (linux-arm-cgo), const ARPHRD_EETHER ideal-int +pkg syscall (linux-arm-cgo), const ARPHRD_ETHER ideal-int +pkg syscall (linux-arm-cgo), const ARPHRD_EUI64 ideal-int +pkg syscall (linux-arm-cgo), const ARPHRD_FCAL ideal-int +pkg syscall (linux-arm-cgo), const ARPHRD_FCFABRIC ideal-int +pkg syscall (linux-arm-cgo), const ARPHRD_FCPL ideal-int +pkg syscall (linux-arm-cgo), const ARPHRD_FCPP ideal-int +pkg syscall (linux-arm-cgo), const ARPHRD_FDDI ideal-int +pkg syscall (linux-arm-cgo), const ARPHRD_FRAD ideal-int +pkg syscall (linux-arm-cgo), const ARPHRD_HDLC ideal-int +pkg syscall (linux-arm-cgo), const ARPHRD_HIPPI ideal-int +pkg syscall (linux-arm-cgo), const ARPHRD_HWX25 ideal-int +pkg syscall (linux-arm-cgo), const ARPHRD_IEEE1394 ideal-int +pkg syscall (linux-arm-cgo), const ARPHRD_IEEE802 ideal-int +pkg syscall (linux-arm-cgo), const ARPHRD_IEEE80211 ideal-int +pkg syscall (linux-arm-cgo), const ARPHRD_IEEE80211_PRISM ideal-int +pkg syscall (linux-arm-cgo), const ARPHRD_IEEE80211_RADIOTAP ideal-int +pkg syscall (linux-arm-cgo), const ARPHRD_IEEE802154 ideal-int +pkg syscall (linux-arm-cgo), const ARPHRD_IEEE802154_PHY ideal-int +pkg syscall (linux-arm-cgo), const ARPHRD_IEEE802_TR ideal-int +pkg syscall (linux-arm-cgo), const ARPHRD_INFINIBAND ideal-int +pkg syscall (linux-arm-cgo), const ARPHRD_IPDDP ideal-int +pkg syscall (linux-arm-cgo), const ARPHRD_IPGRE ideal-int +pkg syscall (linux-arm-cgo), const ARPHRD_IRDA ideal-int +pkg syscall (linux-arm-cgo), const ARPHRD_LAPB ideal-int +pkg syscall (linux-arm-cgo), const ARPHRD_LOCALTLK ideal-int +pkg syscall (linux-arm-cgo), const ARPHRD_LOOPBACK ideal-int +pkg syscall (linux-arm-cgo), const ARPHRD_METRICOM ideal-int +pkg syscall (linux-arm-cgo), const ARPHRD_NETROM ideal-int +pkg syscall (linux-arm-cgo), const ARPHRD_NONE ideal-int +pkg syscall (linux-arm-cgo), const ARPHRD_PIMREG ideal-int +pkg syscall (linux-arm-cgo), const ARPHRD_PPP ideal-int +pkg syscall (linux-arm-cgo), const ARPHRD_PRONET ideal-int +pkg syscall (linux-arm-cgo), const ARPHRD_RAWHDLC ideal-int +pkg syscall (linux-arm-cgo), const ARPHRD_ROSE ideal-int +pkg syscall (linux-arm-cgo), const ARPHRD_RSRVD ideal-int +pkg syscall (linux-arm-cgo), const ARPHRD_SIT ideal-int +pkg syscall (linux-arm-cgo), const ARPHRD_SKIP ideal-int +pkg syscall (linux-arm-cgo), const ARPHRD_SLIP ideal-int +pkg syscall (linux-arm-cgo), const ARPHRD_SLIP6 ideal-int +pkg syscall (linux-arm-cgo), const ARPHRD_TUNNEL ideal-int +pkg syscall (linux-arm-cgo), const ARPHRD_TUNNEL6 ideal-int +pkg syscall (linux-arm-cgo), const ARPHRD_VOID ideal-int +pkg syscall (linux-arm-cgo), const ARPHRD_X25 ideal-int +pkg syscall (linux-arm-cgo), const B0 ideal-int +pkg syscall (linux-arm-cgo), const B1000000 ideal-int +pkg syscall (linux-arm-cgo), const B110 ideal-int +pkg syscall (linux-arm-cgo), const B115200 ideal-int +pkg syscall (linux-arm-cgo), const B1152000 ideal-int +pkg syscall (linux-arm-cgo), const B1200 ideal-int +pkg syscall (linux-arm-cgo), const B134 ideal-int +pkg syscall (linux-arm-cgo), const B150 ideal-int +pkg syscall (linux-arm-cgo), const B1500000 ideal-int +pkg syscall (linux-arm-cgo), const B1800 ideal-int +pkg syscall (linux-arm-cgo), const B19200 ideal-int +pkg syscall (linux-arm-cgo), const B200 ideal-int +pkg syscall (linux-arm-cgo), const B2000000 ideal-int +pkg syscall (linux-arm-cgo), const B230400 ideal-int +pkg syscall (linux-arm-cgo), const B2400 ideal-int +pkg syscall (linux-arm-cgo), const B2500000 ideal-int +pkg syscall (linux-arm-cgo), const B300 ideal-int +pkg syscall (linux-arm-cgo), const B3000000 ideal-int +pkg syscall (linux-arm-cgo), const B3500000 ideal-int +pkg syscall (linux-arm-cgo), const B38400 ideal-int +pkg syscall (linux-arm-cgo), const B4000000 ideal-int +pkg syscall (linux-arm-cgo), const B460800 ideal-int +pkg syscall (linux-arm-cgo), const B4800 ideal-int +pkg syscall (linux-arm-cgo), const B50 ideal-int +pkg syscall (linux-arm-cgo), const B500000 ideal-int +pkg syscall (linux-arm-cgo), const B57600 ideal-int +pkg syscall (linux-arm-cgo), const B576000 ideal-int +pkg syscall (linux-arm-cgo), const B600 ideal-int +pkg syscall (linux-arm-cgo), const B75 ideal-int +pkg syscall (linux-arm-cgo), const B921600 ideal-int +pkg syscall (linux-arm-cgo), const B9600 ideal-int +pkg syscall (linux-arm-cgo), const BPF_A ideal-int +pkg syscall (linux-arm-cgo), const BPF_ABS ideal-int +pkg syscall (linux-arm-cgo), const BPF_ADD ideal-int +pkg syscall (linux-arm-cgo), const BPF_ALU ideal-int +pkg syscall (linux-arm-cgo), const BPF_AND ideal-int +pkg syscall (linux-arm-cgo), const BPF_B ideal-int +pkg syscall (linux-arm-cgo), const BPF_DIV ideal-int +pkg syscall (linux-arm-cgo), const BPF_H ideal-int +pkg syscall (linux-arm-cgo), const BPF_IMM ideal-int +pkg syscall (linux-arm-cgo), const BPF_IND ideal-int +pkg syscall (linux-arm-cgo), const BPF_JA ideal-int +pkg syscall (linux-arm-cgo), const BPF_JEQ ideal-int +pkg syscall (linux-arm-cgo), const BPF_JGE ideal-int +pkg syscall (linux-arm-cgo), const BPF_JGT ideal-int +pkg syscall (linux-arm-cgo), const BPF_JMP ideal-int +pkg syscall (linux-arm-cgo), const BPF_JSET ideal-int +pkg syscall (linux-arm-cgo), const BPF_K ideal-int +pkg syscall (linux-arm-cgo), const BPF_LD ideal-int +pkg syscall (linux-arm-cgo), const BPF_LDX ideal-int +pkg syscall (linux-arm-cgo), const BPF_LEN ideal-int +pkg syscall (linux-arm-cgo), const BPF_LSH ideal-int +pkg syscall (linux-arm-cgo), const BPF_MAJOR_VERSION ideal-int +pkg syscall (linux-arm-cgo), const BPF_MAXINSNS ideal-int +pkg syscall (linux-arm-cgo), const BPF_MEM ideal-int +pkg syscall (linux-arm-cgo), const BPF_MEMWORDS ideal-int +pkg syscall (linux-arm-cgo), const BPF_MINOR_VERSION ideal-int +pkg syscall (linux-arm-cgo), const BPF_MISC ideal-int +pkg syscall (linux-arm-cgo), const BPF_MSH ideal-int +pkg syscall (linux-arm-cgo), const BPF_MUL ideal-int +pkg syscall (linux-arm-cgo), const BPF_NEG ideal-int +pkg syscall (linux-arm-cgo), const BPF_OR ideal-int +pkg syscall (linux-arm-cgo), const BPF_RET ideal-int +pkg syscall (linux-arm-cgo), const BPF_RSH ideal-int +pkg syscall (linux-arm-cgo), const BPF_ST ideal-int +pkg syscall (linux-arm-cgo), const BPF_STX ideal-int +pkg syscall (linux-arm-cgo), const BPF_SUB ideal-int +pkg syscall (linux-arm-cgo), const BPF_TAX ideal-int +pkg syscall (linux-arm-cgo), const BPF_TXA ideal-int +pkg syscall (linux-arm-cgo), const BPF_W ideal-int +pkg syscall (linux-arm-cgo), const BPF_X ideal-int +pkg syscall (linux-arm-cgo), const BRKINT ideal-int +pkg syscall (linux-arm-cgo), const CLOCAL ideal-int +pkg syscall (linux-arm-cgo), const CLONE_CHILD_CLEARTID = 2097152 +pkg syscall (linux-arm-cgo), const CLONE_CHILD_CLEARTID ideal-int +pkg syscall (linux-arm-cgo), const CLONE_CHILD_SETTID = 16777216 +pkg syscall (linux-arm-cgo), const CLONE_CHILD_SETTID ideal-int +pkg syscall (linux-arm-cgo), const CLONE_DETACHED = 4194304 +pkg syscall (linux-arm-cgo), const CLONE_DETACHED ideal-int +pkg syscall (linux-arm-cgo), const CLONE_FILES = 1024 +pkg syscall (linux-arm-cgo), const CLONE_FILES ideal-int +pkg syscall (linux-arm-cgo), const CLONE_FS = 512 +pkg syscall (linux-arm-cgo), const CLONE_FS ideal-int +pkg syscall (linux-arm-cgo), const CLONE_IO = 2147483648 +pkg syscall (linux-arm-cgo), const CLONE_IO ideal-int +pkg syscall (linux-arm-cgo), const CLONE_NEWIPC = 134217728 +pkg syscall (linux-arm-cgo), const CLONE_NEWIPC ideal-int +pkg syscall (linux-arm-cgo), const CLONE_NEWNET = 1073741824 +pkg syscall (linux-arm-cgo), const CLONE_NEWNET ideal-int +pkg syscall (linux-arm-cgo), const CLONE_NEWNS = 131072 +pkg syscall (linux-arm-cgo), const CLONE_NEWNS ideal-int +pkg syscall (linux-arm-cgo), const CLONE_NEWPID = 536870912 +pkg syscall (linux-arm-cgo), const CLONE_NEWPID ideal-int +pkg syscall (linux-arm-cgo), const CLONE_NEWUSER = 268435456 +pkg syscall (linux-arm-cgo), const CLONE_NEWUSER ideal-int +pkg syscall (linux-arm-cgo), const CLONE_NEWUTS = 67108864 +pkg syscall (linux-arm-cgo), const CLONE_NEWUTS ideal-int +pkg syscall (linux-arm-cgo), const CLONE_PARENT = 32768 +pkg syscall (linux-arm-cgo), const CLONE_PARENT ideal-int +pkg syscall (linux-arm-cgo), const CLONE_PARENT_SETTID = 1048576 +pkg syscall (linux-arm-cgo), const CLONE_PARENT_SETTID ideal-int +pkg syscall (linux-arm-cgo), const CLONE_PTRACE = 8192 +pkg syscall (linux-arm-cgo), const CLONE_PTRACE ideal-int +pkg syscall (linux-arm-cgo), const CLONE_SETTLS = 524288 +pkg syscall (linux-arm-cgo), const CLONE_SETTLS ideal-int +pkg syscall (linux-arm-cgo), const CLONE_SIGHAND = 2048 +pkg syscall (linux-arm-cgo), const CLONE_SIGHAND ideal-int +pkg syscall (linux-arm-cgo), const CLONE_SYSVSEM = 262144 +pkg syscall (linux-arm-cgo), const CLONE_SYSVSEM ideal-int +pkg syscall (linux-arm-cgo), const CLONE_THREAD = 65536 +pkg syscall (linux-arm-cgo), const CLONE_THREAD ideal-int +pkg syscall (linux-arm-cgo), const CLONE_UNTRACED = 8388608 +pkg syscall (linux-arm-cgo), const CLONE_UNTRACED ideal-int +pkg syscall (linux-arm-cgo), const CLONE_VFORK = 16384 +pkg syscall (linux-arm-cgo), const CLONE_VFORK ideal-int +pkg syscall (linux-arm-cgo), const CLONE_VM = 256 +pkg syscall (linux-arm-cgo), const CLONE_VM ideal-int +pkg syscall (linux-arm-cgo), const CREAD ideal-int +pkg syscall (linux-arm-cgo), const CS5 ideal-int +pkg syscall (linux-arm-cgo), const CS6 ideal-int +pkg syscall (linux-arm-cgo), const CS7 ideal-int +pkg syscall (linux-arm-cgo), const CS8 ideal-int +pkg syscall (linux-arm-cgo), const CSIZE ideal-int +pkg syscall (linux-arm-cgo), const CSTOPB ideal-int +pkg syscall (linux-arm-cgo), const DT_BLK ideal-int +pkg syscall (linux-arm-cgo), const DT_CHR ideal-int +pkg syscall (linux-arm-cgo), const DT_DIR ideal-int +pkg syscall (linux-arm-cgo), const DT_FIFO ideal-int +pkg syscall (linux-arm-cgo), const DT_LNK ideal-int +pkg syscall (linux-arm-cgo), const DT_REG ideal-int +pkg syscall (linux-arm-cgo), const DT_SOCK ideal-int +pkg syscall (linux-arm-cgo), const DT_UNKNOWN ideal-int +pkg syscall (linux-arm-cgo), const DT_WHT ideal-int +pkg syscall (linux-arm-cgo), const EADV Errno +pkg syscall (linux-arm-cgo), const EBADE Errno +pkg syscall (linux-arm-cgo), const EBADFD Errno +pkg syscall (linux-arm-cgo), const EBADMSG Errno +pkg syscall (linux-arm-cgo), const EBADR Errno +pkg syscall (linux-arm-cgo), const EBADRQC Errno +pkg syscall (linux-arm-cgo), const EBADSLT Errno +pkg syscall (linux-arm-cgo), const EBFONT Errno +pkg syscall (linux-arm-cgo), const ECHO ideal-int +pkg syscall (linux-arm-cgo), const ECHOCTL ideal-int +pkg syscall (linux-arm-cgo), const ECHOE ideal-int +pkg syscall (linux-arm-cgo), const ECHOK ideal-int +pkg syscall (linux-arm-cgo), const ECHOKE ideal-int +pkg syscall (linux-arm-cgo), const ECHONL ideal-int +pkg syscall (linux-arm-cgo), const ECHOPRT ideal-int +pkg syscall (linux-arm-cgo), const ECHRNG Errno +pkg syscall (linux-arm-cgo), const ECOMM Errno +pkg syscall (linux-arm-cgo), const EDEADLOCK Errno +pkg syscall (linux-arm-cgo), const EDOTDOT Errno +pkg syscall (linux-arm-cgo), const EHWPOISON Errno +pkg syscall (linux-arm-cgo), const EISNAM Errno +pkg syscall (linux-arm-cgo), const EKEYEXPIRED Errno +pkg syscall (linux-arm-cgo), const EKEYREJECTED Errno +pkg syscall (linux-arm-cgo), const EKEYREVOKED Errno +pkg syscall (linux-arm-cgo), const EL2HLT Errno +pkg syscall (linux-arm-cgo), const EL2NSYNC Errno +pkg syscall (linux-arm-cgo), const EL3HLT Errno +pkg syscall (linux-arm-cgo), const EL3RST Errno +pkg syscall (linux-arm-cgo), const ELF_NGREG ideal-int +pkg syscall (linux-arm-cgo), const ELF_PRARGSZ ideal-int +pkg syscall (linux-arm-cgo), const ELIBACC Errno +pkg syscall (linux-arm-cgo), const ELIBBAD Errno +pkg syscall (linux-arm-cgo), const ELIBEXEC Errno +pkg syscall (linux-arm-cgo), const ELIBMAX Errno +pkg syscall (linux-arm-cgo), const ELIBSCN Errno +pkg syscall (linux-arm-cgo), const ELNRNG Errno +pkg syscall (linux-arm-cgo), const EMEDIUMTYPE Errno +pkg syscall (linux-arm-cgo), const EMULTIHOP Errno +pkg syscall (linux-arm-cgo), const ENAVAIL Errno +pkg syscall (linux-arm-cgo), const ENOANO Errno +pkg syscall (linux-arm-cgo), const ENOCSI Errno +pkg syscall (linux-arm-cgo), const ENODATA Errno +pkg syscall (linux-arm-cgo), const ENOKEY Errno +pkg syscall (linux-arm-cgo), const ENOLINK Errno +pkg syscall (linux-arm-cgo), const ENOMEDIUM Errno +pkg syscall (linux-arm-cgo), const ENONET Errno +pkg syscall (linux-arm-cgo), const ENOPKG Errno +pkg syscall (linux-arm-cgo), const ENOSR Errno +pkg syscall (linux-arm-cgo), const ENOSTR Errno +pkg syscall (linux-arm-cgo), const ENOTNAM Errno +pkg syscall (linux-arm-cgo), const ENOTRECOVERABLE Errno +pkg syscall (linux-arm-cgo), const ENOTUNIQ Errno +pkg syscall (linux-arm-cgo), const EOWNERDEAD Errno +pkg syscall (linux-arm-cgo), const EPOLLERR ideal-int +pkg syscall (linux-arm-cgo), const EPOLLET ideal-int +pkg syscall (linux-arm-cgo), const EPOLLHUP ideal-int +pkg syscall (linux-arm-cgo), const EPOLLIN ideal-int +pkg syscall (linux-arm-cgo), const EPOLLMSG ideal-int +pkg syscall (linux-arm-cgo), const EPOLLONESHOT ideal-int +pkg syscall (linux-arm-cgo), const EPOLLOUT ideal-int +pkg syscall (linux-arm-cgo), const EPOLLPRI ideal-int +pkg syscall (linux-arm-cgo), const EPOLLRDBAND ideal-int +pkg syscall (linux-arm-cgo), const EPOLLRDHUP ideal-int +pkg syscall (linux-arm-cgo), const EPOLLRDNORM ideal-int +pkg syscall (linux-arm-cgo), const EPOLLWRBAND ideal-int +pkg syscall (linux-arm-cgo), const EPOLLWRNORM ideal-int +pkg syscall (linux-arm-cgo), const EPOLL_CLOEXEC ideal-int +pkg syscall (linux-arm-cgo), const EPOLL_CTL_ADD ideal-int +pkg syscall (linux-arm-cgo), const EPOLL_CTL_DEL ideal-int +pkg syscall (linux-arm-cgo), const EPOLL_CTL_MOD ideal-int +pkg syscall (linux-arm-cgo), const EPOLL_NONBLOCK ideal-int +pkg syscall (linux-arm-cgo), const EPROTO Errno +pkg syscall (linux-arm-cgo), const EREMCHG Errno +pkg syscall (linux-arm-cgo), const EREMOTEIO Errno +pkg syscall (linux-arm-cgo), const ERESTART Errno +pkg syscall (linux-arm-cgo), const ERFKILL Errno +pkg syscall (linux-arm-cgo), const ESRMNT Errno +pkg syscall (linux-arm-cgo), const ESTRPIPE Errno +pkg syscall (linux-arm-cgo), const ETH_P_1588 ideal-int +pkg syscall (linux-arm-cgo), const ETH_P_8021Q ideal-int +pkg syscall (linux-arm-cgo), const ETH_P_802_2 ideal-int +pkg syscall (linux-arm-cgo), const ETH_P_802_3 ideal-int +pkg syscall (linux-arm-cgo), const ETH_P_AARP ideal-int +pkg syscall (linux-arm-cgo), const ETH_P_ALL ideal-int +pkg syscall (linux-arm-cgo), const ETH_P_AOE ideal-int +pkg syscall (linux-arm-cgo), const ETH_P_ARCNET ideal-int +pkg syscall (linux-arm-cgo), const ETH_P_ARP ideal-int +pkg syscall (linux-arm-cgo), const ETH_P_ATALK ideal-int +pkg syscall (linux-arm-cgo), const ETH_P_ATMFATE ideal-int +pkg syscall (linux-arm-cgo), const ETH_P_ATMMPOA ideal-int +pkg syscall (linux-arm-cgo), const ETH_P_AX25 ideal-int +pkg syscall (linux-arm-cgo), const ETH_P_BPQ ideal-int +pkg syscall (linux-arm-cgo), const ETH_P_CAIF ideal-int +pkg syscall (linux-arm-cgo), const ETH_P_CAN ideal-int +pkg syscall (linux-arm-cgo), const ETH_P_CONTROL ideal-int +pkg syscall (linux-arm-cgo), const ETH_P_CUST ideal-int +pkg syscall (linux-arm-cgo), const ETH_P_DDCMP ideal-int +pkg syscall (linux-arm-cgo), const ETH_P_DEC ideal-int +pkg syscall (linux-arm-cgo), const ETH_P_DIAG ideal-int +pkg syscall (linux-arm-cgo), const ETH_P_DNA_DL ideal-int +pkg syscall (linux-arm-cgo), const ETH_P_DNA_RC ideal-int +pkg syscall (linux-arm-cgo), const ETH_P_DNA_RT ideal-int +pkg syscall (linux-arm-cgo), const ETH_P_DSA ideal-int +pkg syscall (linux-arm-cgo), const ETH_P_ECONET ideal-int +pkg syscall (linux-arm-cgo), const ETH_P_EDSA ideal-int +pkg syscall (linux-arm-cgo), const ETH_P_FCOE ideal-int +pkg syscall (linux-arm-cgo), const ETH_P_FIP ideal-int +pkg syscall (linux-arm-cgo), const ETH_P_HDLC ideal-int +pkg syscall (linux-arm-cgo), const ETH_P_IEEE802154 ideal-int +pkg syscall (linux-arm-cgo), const ETH_P_IEEEPUP ideal-int +pkg syscall (linux-arm-cgo), const ETH_P_IEEEPUPAT ideal-int +pkg syscall (linux-arm-cgo), const ETH_P_IP ideal-int +pkg syscall (linux-arm-cgo), const ETH_P_IPV6 ideal-int +pkg syscall (linux-arm-cgo), const ETH_P_IPX ideal-int +pkg syscall (linux-arm-cgo), const ETH_P_IRDA ideal-int +pkg syscall (linux-arm-cgo), const ETH_P_LAT ideal-int +pkg syscall (linux-arm-cgo), const ETH_P_LINK_CTL ideal-int +pkg syscall (linux-arm-cgo), const ETH_P_LOCALTALK ideal-int +pkg syscall (linux-arm-cgo), const ETH_P_LOOP ideal-int +pkg syscall (linux-arm-cgo), const ETH_P_MOBITEX ideal-int +pkg syscall (linux-arm-cgo), const ETH_P_MPLS_MC ideal-int +pkg syscall (linux-arm-cgo), const ETH_P_MPLS_UC ideal-int +pkg syscall (linux-arm-cgo), const ETH_P_PAE ideal-int +pkg syscall (linux-arm-cgo), const ETH_P_PAUSE ideal-int +pkg syscall (linux-arm-cgo), const ETH_P_PHONET ideal-int +pkg syscall (linux-arm-cgo), const ETH_P_PPPTALK ideal-int +pkg syscall (linux-arm-cgo), const ETH_P_PPP_DISC ideal-int +pkg syscall (linux-arm-cgo), const ETH_P_PPP_MP ideal-int +pkg syscall (linux-arm-cgo), const ETH_P_PPP_SES ideal-int +pkg syscall (linux-arm-cgo), const ETH_P_PUP ideal-int +pkg syscall (linux-arm-cgo), const ETH_P_PUPAT ideal-int +pkg syscall (linux-arm-cgo), const ETH_P_RARP ideal-int +pkg syscall (linux-arm-cgo), const ETH_P_SCA ideal-int +pkg syscall (linux-arm-cgo), const ETH_P_SLOW ideal-int +pkg syscall (linux-arm-cgo), const ETH_P_SNAP ideal-int +pkg syscall (linux-arm-cgo), const ETH_P_TEB ideal-int +pkg syscall (linux-arm-cgo), const ETH_P_TIPC ideal-int +pkg syscall (linux-arm-cgo), const ETH_P_TRAILER ideal-int +pkg syscall (linux-arm-cgo), const ETH_P_TR_802_2 ideal-int +pkg syscall (linux-arm-cgo), const ETH_P_WAN_PPP ideal-int +pkg syscall (linux-arm-cgo), const ETH_P_WCCP ideal-int +pkg syscall (linux-arm-cgo), const ETH_P_X25 ideal-int +pkg syscall (linux-arm-cgo), const ETIME Errno +pkg syscall (linux-arm-cgo), const EUCLEAN Errno +pkg syscall (linux-arm-cgo), const EUNATCH Errno +pkg syscall (linux-arm-cgo), const EXFULL Errno +pkg syscall (linux-arm-cgo), const FD_CLOEXEC ideal-int +pkg syscall (linux-arm-cgo), const FD_SETSIZE ideal-int +pkg syscall (linux-arm-cgo), const FLUSHO ideal-int +pkg syscall (linux-arm-cgo), const F_DUPFD ideal-int +pkg syscall (linux-arm-cgo), const F_DUPFD_CLOEXEC ideal-int +pkg syscall (linux-arm-cgo), const F_EXLCK ideal-int +pkg syscall (linux-arm-cgo), const F_GETFD ideal-int +pkg syscall (linux-arm-cgo), const F_GETFL ideal-int +pkg syscall (linux-arm-cgo), const F_GETLEASE ideal-int +pkg syscall (linux-arm-cgo), const F_GETLK ideal-int +pkg syscall (linux-arm-cgo), const F_GETLK64 ideal-int +pkg syscall (linux-arm-cgo), const F_GETOWN ideal-int +pkg syscall (linux-arm-cgo), const F_GETOWN_EX ideal-int +pkg syscall (linux-arm-cgo), const F_GETPIPE_SZ ideal-int +pkg syscall (linux-arm-cgo), const F_GETSIG ideal-int +pkg syscall (linux-arm-cgo), const F_LOCK ideal-int +pkg syscall (linux-arm-cgo), const F_NOTIFY ideal-int +pkg syscall (linux-arm-cgo), const F_OK ideal-int +pkg syscall (linux-arm-cgo), const F_RDLCK ideal-int +pkg syscall (linux-arm-cgo), const F_SETFD ideal-int +pkg syscall (linux-arm-cgo), const F_SETFL ideal-int +pkg syscall (linux-arm-cgo), const F_SETLEASE ideal-int +pkg syscall (linux-arm-cgo), const F_SETLK ideal-int +pkg syscall (linux-arm-cgo), const F_SETLK64 ideal-int +pkg syscall (linux-arm-cgo), const F_SETLKW ideal-int +pkg syscall (linux-arm-cgo), const F_SETLKW64 ideal-int +pkg syscall (linux-arm-cgo), const F_SETOWN ideal-int +pkg syscall (linux-arm-cgo), const F_SETOWN_EX ideal-int +pkg syscall (linux-arm-cgo), const F_SETPIPE_SZ ideal-int +pkg syscall (linux-arm-cgo), const F_SETSIG ideal-int +pkg syscall (linux-arm-cgo), const F_SHLCK ideal-int +pkg syscall (linux-arm-cgo), const F_TEST ideal-int +pkg syscall (linux-arm-cgo), const F_TLOCK ideal-int +pkg syscall (linux-arm-cgo), const F_ULOCK ideal-int +pkg syscall (linux-arm-cgo), const F_UNLCK ideal-int +pkg syscall (linux-arm-cgo), const F_WRLCK ideal-int +pkg syscall (linux-arm-cgo), const HUPCL ideal-int +pkg syscall (linux-arm-cgo), const ICANON ideal-int +pkg syscall (linux-arm-cgo), const ICMPV6_FILTER = 1 +pkg syscall (linux-arm-cgo), const ICMPV6_FILTER ideal-int +pkg syscall (linux-arm-cgo), const ICRNL ideal-int +pkg syscall (linux-arm-cgo), const IEXTEN ideal-int +pkg syscall (linux-arm-cgo), const IFA_ADDRESS ideal-int +pkg syscall (linux-arm-cgo), const IFA_ANYCAST ideal-int +pkg syscall (linux-arm-cgo), const IFA_BROADCAST ideal-int +pkg syscall (linux-arm-cgo), const IFA_CACHEINFO ideal-int +pkg syscall (linux-arm-cgo), const IFA_F_DADFAILED ideal-int +pkg syscall (linux-arm-cgo), const IFA_F_DEPRECATED ideal-int +pkg syscall (linux-arm-cgo), const IFA_F_HOMEADDRESS ideal-int +pkg syscall (linux-arm-cgo), const IFA_F_NODAD ideal-int +pkg syscall (linux-arm-cgo), const IFA_F_OPTIMISTIC ideal-int +pkg syscall (linux-arm-cgo), const IFA_F_PERMANENT ideal-int +pkg syscall (linux-arm-cgo), const IFA_F_SECONDARY ideal-int +pkg syscall (linux-arm-cgo), const IFA_F_TEMPORARY ideal-int +pkg syscall (linux-arm-cgo), const IFA_F_TENTATIVE ideal-int +pkg syscall (linux-arm-cgo), const IFA_LABEL ideal-int +pkg syscall (linux-arm-cgo), const IFA_LOCAL ideal-int +pkg syscall (linux-arm-cgo), const IFA_MAX ideal-int +pkg syscall (linux-arm-cgo), const IFA_MULTICAST ideal-int +pkg syscall (linux-arm-cgo), const IFA_UNSPEC ideal-int +pkg syscall (linux-arm-cgo), const IFF_ALLMULTI ideal-int +pkg syscall (linux-arm-cgo), const IFF_AUTOMEDIA ideal-int +pkg syscall (linux-arm-cgo), const IFF_DEBUG ideal-int +pkg syscall (linux-arm-cgo), const IFF_DYNAMIC ideal-int +pkg syscall (linux-arm-cgo), const IFF_MASTER ideal-int +pkg syscall (linux-arm-cgo), const IFF_NOARP ideal-int +pkg syscall (linux-arm-cgo), const IFF_NOTRAILERS ideal-int +pkg syscall (linux-arm-cgo), const IFF_NO_PI ideal-int +pkg syscall (linux-arm-cgo), const IFF_ONE_QUEUE ideal-int +pkg syscall (linux-arm-cgo), const IFF_POINTOPOINT ideal-int +pkg syscall (linux-arm-cgo), const IFF_PORTSEL ideal-int +pkg syscall (linux-arm-cgo), const IFF_PROMISC ideal-int +pkg syscall (linux-arm-cgo), const IFF_RUNNING ideal-int +pkg syscall (linux-arm-cgo), const IFF_SLAVE ideal-int +pkg syscall (linux-arm-cgo), const IFF_TAP ideal-int +pkg syscall (linux-arm-cgo), const IFF_TUN ideal-int +pkg syscall (linux-arm-cgo), const IFF_TUN_EXCL ideal-int +pkg syscall (linux-arm-cgo), const IFF_VNET_HDR ideal-int +pkg syscall (linux-arm-cgo), const IFLA_ADDRESS ideal-int +pkg syscall (linux-arm-cgo), const IFLA_BROADCAST ideal-int +pkg syscall (linux-arm-cgo), const IFLA_COST ideal-int +pkg syscall (linux-arm-cgo), const IFLA_IFALIAS ideal-int +pkg syscall (linux-arm-cgo), const IFLA_IFNAME ideal-int +pkg syscall (linux-arm-cgo), const IFLA_LINK ideal-int +pkg syscall (linux-arm-cgo), const IFLA_LINKINFO ideal-int +pkg syscall (linux-arm-cgo), const IFLA_LINKMODE ideal-int +pkg syscall (linux-arm-cgo), const IFLA_MAP ideal-int +pkg syscall (linux-arm-cgo), const IFLA_MASTER ideal-int +pkg syscall (linux-arm-cgo), const IFLA_MAX ideal-int +pkg syscall (linux-arm-cgo), const IFLA_MTU ideal-int +pkg syscall (linux-arm-cgo), const IFLA_NET_NS_PID ideal-int +pkg syscall (linux-arm-cgo), const IFLA_OPERSTATE ideal-int +pkg syscall (linux-arm-cgo), const IFLA_PRIORITY ideal-int +pkg syscall (linux-arm-cgo), const IFLA_PROTINFO ideal-int +pkg syscall (linux-arm-cgo), const IFLA_QDISC ideal-int +pkg syscall (linux-arm-cgo), const IFLA_STATS ideal-int +pkg syscall (linux-arm-cgo), const IFLA_TXQLEN ideal-int +pkg syscall (linux-arm-cgo), const IFLA_UNSPEC ideal-int +pkg syscall (linux-arm-cgo), const IFLA_WEIGHT ideal-int +pkg syscall (linux-arm-cgo), const IFLA_WIRELESS ideal-int +pkg syscall (linux-arm-cgo), const IFNAMSIZ ideal-int +pkg syscall (linux-arm-cgo), const IGNBRK ideal-int +pkg syscall (linux-arm-cgo), const IGNCR ideal-int +pkg syscall (linux-arm-cgo), const IGNPAR ideal-int +pkg syscall (linux-arm-cgo), const IMAXBEL ideal-int +pkg syscall (linux-arm-cgo), const INLCR ideal-int +pkg syscall (linux-arm-cgo), const INPCK ideal-int +pkg syscall (linux-arm-cgo), const IN_ACCESS ideal-int +pkg syscall (linux-arm-cgo), const IN_ALL_EVENTS ideal-int +pkg syscall (linux-arm-cgo), const IN_ATTRIB ideal-int +pkg syscall (linux-arm-cgo), const IN_CLASSA_HOST ideal-int +pkg syscall (linux-arm-cgo), const IN_CLASSA_MAX ideal-int +pkg syscall (linux-arm-cgo), const IN_CLASSA_NET ideal-int +pkg syscall (linux-arm-cgo), const IN_CLASSA_NSHIFT ideal-int +pkg syscall (linux-arm-cgo), const IN_CLASSB_HOST ideal-int +pkg syscall (linux-arm-cgo), const IN_CLASSB_MAX ideal-int +pkg syscall (linux-arm-cgo), const IN_CLASSB_NET ideal-int +pkg syscall (linux-arm-cgo), const IN_CLASSB_NSHIFT ideal-int +pkg syscall (linux-arm-cgo), const IN_CLASSC_HOST ideal-int +pkg syscall (linux-arm-cgo), const IN_CLASSC_NET ideal-int +pkg syscall (linux-arm-cgo), const IN_CLASSC_NSHIFT ideal-int +pkg syscall (linux-arm-cgo), const IN_CLOEXEC ideal-int +pkg syscall (linux-arm-cgo), const IN_CLOSE ideal-int +pkg syscall (linux-arm-cgo), const IN_CLOSE_NOWRITE ideal-int +pkg syscall (linux-arm-cgo), const IN_CLOSE_WRITE ideal-int +pkg syscall (linux-arm-cgo), const IN_CREATE ideal-int +pkg syscall (linux-arm-cgo), const IN_DELETE ideal-int +pkg syscall (linux-arm-cgo), const IN_DELETE_SELF ideal-int +pkg syscall (linux-arm-cgo), const IN_DONT_FOLLOW ideal-int +pkg syscall (linux-arm-cgo), const IN_EXCL_UNLINK ideal-int +pkg syscall (linux-arm-cgo), const IN_IGNORED ideal-int +pkg syscall (linux-arm-cgo), const IN_ISDIR ideal-int +pkg syscall (linux-arm-cgo), const IN_LOOPBACKNET ideal-int +pkg syscall (linux-arm-cgo), const IN_MASK_ADD ideal-int +pkg syscall (linux-arm-cgo), const IN_MODIFY ideal-int +pkg syscall (linux-arm-cgo), const IN_MOVE ideal-int +pkg syscall (linux-arm-cgo), const IN_MOVED_FROM ideal-int +pkg syscall (linux-arm-cgo), const IN_MOVED_TO ideal-int +pkg syscall (linux-arm-cgo), const IN_MOVE_SELF ideal-int +pkg syscall (linux-arm-cgo), const IN_NONBLOCK ideal-int +pkg syscall (linux-arm-cgo), const IN_ONESHOT ideal-int +pkg syscall (linux-arm-cgo), const IN_ONLYDIR ideal-int +pkg syscall (linux-arm-cgo), const IN_OPEN ideal-int +pkg syscall (linux-arm-cgo), const IN_Q_OVERFLOW ideal-int +pkg syscall (linux-arm-cgo), const IN_UNMOUNT ideal-int +pkg syscall (linux-arm-cgo), const IPPROTO_AH ideal-int +pkg syscall (linux-arm-cgo), const IPPROTO_COMP ideal-int +pkg syscall (linux-arm-cgo), const IPPROTO_DCCP ideal-int +pkg syscall (linux-arm-cgo), const IPPROTO_DSTOPTS ideal-int +pkg syscall (linux-arm-cgo), const IPPROTO_EGP ideal-int +pkg syscall (linux-arm-cgo), const IPPROTO_ENCAP ideal-int +pkg syscall (linux-arm-cgo), const IPPROTO_ESP ideal-int +pkg syscall (linux-arm-cgo), const IPPROTO_FRAGMENT ideal-int +pkg syscall (linux-arm-cgo), const IPPROTO_GRE ideal-int +pkg syscall (linux-arm-cgo), const IPPROTO_HOPOPTS ideal-int +pkg syscall (linux-arm-cgo), const IPPROTO_ICMP ideal-int +pkg syscall (linux-arm-cgo), const IPPROTO_ICMPV6 ideal-int +pkg syscall (linux-arm-cgo), const IPPROTO_IDP ideal-int +pkg syscall (linux-arm-cgo), const IPPROTO_IGMP ideal-int +pkg syscall (linux-arm-cgo), const IPPROTO_IPIP ideal-int +pkg syscall (linux-arm-cgo), const IPPROTO_MTP ideal-int +pkg syscall (linux-arm-cgo), const IPPROTO_NONE ideal-int +pkg syscall (linux-arm-cgo), const IPPROTO_PIM ideal-int +pkg syscall (linux-arm-cgo), const IPPROTO_PUP ideal-int +pkg syscall (linux-arm-cgo), const IPPROTO_RAW ideal-int +pkg syscall (linux-arm-cgo), const IPPROTO_ROUTING ideal-int +pkg syscall (linux-arm-cgo), const IPPROTO_RSVP ideal-int +pkg syscall (linux-arm-cgo), const IPPROTO_SCTP ideal-int +pkg syscall (linux-arm-cgo), const IPPROTO_TP ideal-int +pkg syscall (linux-arm-cgo), const IPPROTO_UDPLITE ideal-int +pkg syscall (linux-arm-cgo), const IPV6_2292DSTOPTS ideal-int +pkg syscall (linux-arm-cgo), const IPV6_2292HOPLIMIT ideal-int +pkg syscall (linux-arm-cgo), const IPV6_2292HOPOPTS ideal-int +pkg syscall (linux-arm-cgo), const IPV6_2292PKTINFO ideal-int +pkg syscall (linux-arm-cgo), const IPV6_2292PKTOPTIONS ideal-int +pkg syscall (linux-arm-cgo), const IPV6_2292RTHDR ideal-int +pkg syscall (linux-arm-cgo), const IPV6_ADDRFORM ideal-int +pkg syscall (linux-arm-cgo), const IPV6_ADD_MEMBERSHIP ideal-int +pkg syscall (linux-arm-cgo), const IPV6_AUTHHDR ideal-int +pkg syscall (linux-arm-cgo), const IPV6_CHECKSUM ideal-int +pkg syscall (linux-arm-cgo), const IPV6_DROP_MEMBERSHIP ideal-int +pkg syscall (linux-arm-cgo), const IPV6_DSTOPTS ideal-int +pkg syscall (linux-arm-cgo), const IPV6_HOPLIMIT ideal-int +pkg syscall (linux-arm-cgo), const IPV6_HOPOPTS ideal-int +pkg syscall (linux-arm-cgo), const IPV6_IPSEC_POLICY ideal-int +pkg syscall (linux-arm-cgo), const IPV6_JOIN_ANYCAST ideal-int +pkg syscall (linux-arm-cgo), const IPV6_LEAVE_ANYCAST ideal-int +pkg syscall (linux-arm-cgo), const IPV6_MTU ideal-int +pkg syscall (linux-arm-cgo), const IPV6_MTU_DISCOVER ideal-int +pkg syscall (linux-arm-cgo), const IPV6_NEXTHOP ideal-int +pkg syscall (linux-arm-cgo), const IPV6_PKTINFO ideal-int +pkg syscall (linux-arm-cgo), const IPV6_PMTUDISC_DO ideal-int +pkg syscall (linux-arm-cgo), const IPV6_PMTUDISC_DONT ideal-int +pkg syscall (linux-arm-cgo), const IPV6_PMTUDISC_PROBE ideal-int +pkg syscall (linux-arm-cgo), const IPV6_PMTUDISC_WANT ideal-int +pkg syscall (linux-arm-cgo), const IPV6_RECVDSTOPTS ideal-int +pkg syscall (linux-arm-cgo), const IPV6_RECVERR ideal-int +pkg syscall (linux-arm-cgo), const IPV6_RECVHOPLIMIT ideal-int +pkg syscall (linux-arm-cgo), const IPV6_RECVHOPOPTS ideal-int +pkg syscall (linux-arm-cgo), const IPV6_RECVPKTINFO ideal-int +pkg syscall (linux-arm-cgo), const IPV6_RECVRTHDR ideal-int +pkg syscall (linux-arm-cgo), const IPV6_RECVTCLASS ideal-int +pkg syscall (linux-arm-cgo), const IPV6_ROUTER_ALERT ideal-int +pkg syscall (linux-arm-cgo), const IPV6_RTHDR ideal-int +pkg syscall (linux-arm-cgo), const IPV6_RTHDRDSTOPTS ideal-int +pkg syscall (linux-arm-cgo), const IPV6_RTHDR_LOOSE ideal-int +pkg syscall (linux-arm-cgo), const IPV6_RTHDR_STRICT ideal-int +pkg syscall (linux-arm-cgo), const IPV6_RTHDR_TYPE_0 ideal-int +pkg syscall (linux-arm-cgo), const IPV6_RXDSTOPTS ideal-int +pkg syscall (linux-arm-cgo), const IPV6_RXHOPOPTS ideal-int +pkg syscall (linux-arm-cgo), const IPV6_TCLASS ideal-int +pkg syscall (linux-arm-cgo), const IPV6_XFRM_POLICY ideal-int +pkg syscall (linux-arm-cgo), const IP_ADD_SOURCE_MEMBERSHIP ideal-int +pkg syscall (linux-arm-cgo), const IP_BLOCK_SOURCE ideal-int +pkg syscall (linux-arm-cgo), const IP_DEFAULT_MULTICAST_LOOP ideal-int +pkg syscall (linux-arm-cgo), const IP_DEFAULT_MULTICAST_TTL ideal-int +pkg syscall (linux-arm-cgo), const IP_DF ideal-int +pkg syscall (linux-arm-cgo), const IP_DROP_SOURCE_MEMBERSHIP ideal-int +pkg syscall (linux-arm-cgo), const IP_FREEBIND ideal-int +pkg syscall (linux-arm-cgo), const IP_HDRINCL ideal-int +pkg syscall (linux-arm-cgo), const IP_IPSEC_POLICY ideal-int +pkg syscall (linux-arm-cgo), const IP_MAXPACKET ideal-int +pkg syscall (linux-arm-cgo), const IP_MAX_MEMBERSHIPS ideal-int +pkg syscall (linux-arm-cgo), const IP_MF ideal-int +pkg syscall (linux-arm-cgo), const IP_MINTTL ideal-int +pkg syscall (linux-arm-cgo), const IP_MSFILTER ideal-int +pkg syscall (linux-arm-cgo), const IP_MSS ideal-int +pkg syscall (linux-arm-cgo), const IP_MTU ideal-int +pkg syscall (linux-arm-cgo), const IP_MTU_DISCOVER ideal-int +pkg syscall (linux-arm-cgo), const IP_OFFMASK ideal-int +pkg syscall (linux-arm-cgo), const IP_OPTIONS ideal-int +pkg syscall (linux-arm-cgo), const IP_ORIGDSTADDR ideal-int +pkg syscall (linux-arm-cgo), const IP_PASSSEC ideal-int +pkg syscall (linux-arm-cgo), const IP_PKTINFO ideal-int +pkg syscall (linux-arm-cgo), const IP_PKTOPTIONS ideal-int +pkg syscall (linux-arm-cgo), const IP_PMTUDISC ideal-int +pkg syscall (linux-arm-cgo), const IP_PMTUDISC_DO ideal-int +pkg syscall (linux-arm-cgo), const IP_PMTUDISC_DONT ideal-int +pkg syscall (linux-arm-cgo), const IP_PMTUDISC_PROBE ideal-int +pkg syscall (linux-arm-cgo), const IP_PMTUDISC_WANT ideal-int +pkg syscall (linux-arm-cgo), const IP_RECVERR ideal-int +pkg syscall (linux-arm-cgo), const IP_RECVOPTS ideal-int +pkg syscall (linux-arm-cgo), const IP_RECVORIGDSTADDR ideal-int +pkg syscall (linux-arm-cgo), const IP_RECVRETOPTS ideal-int +pkg syscall (linux-arm-cgo), const IP_RECVTOS ideal-int +pkg syscall (linux-arm-cgo), const IP_RECVTTL ideal-int +pkg syscall (linux-arm-cgo), const IP_RETOPTS ideal-int +pkg syscall (linux-arm-cgo), const IP_RF ideal-int +pkg syscall (linux-arm-cgo), const IP_ROUTER_ALERT ideal-int +pkg syscall (linux-arm-cgo), const IP_TRANSPARENT ideal-int +pkg syscall (linux-arm-cgo), const IP_UNBLOCK_SOURCE ideal-int +pkg syscall (linux-arm-cgo), const IP_XFRM_POLICY ideal-int +pkg syscall (linux-arm-cgo), const ISIG ideal-int +pkg syscall (linux-arm-cgo), const ISTRIP ideal-int +pkg syscall (linux-arm-cgo), const IUCLC ideal-int +pkg syscall (linux-arm-cgo), const IUTF8 ideal-int +pkg syscall (linux-arm-cgo), const IXANY ideal-int +pkg syscall (linux-arm-cgo), const IXOFF ideal-int +pkg syscall (linux-arm-cgo), const IXON ideal-int +pkg syscall (linux-arm-cgo), const LINUX_REBOOT_CMD_CAD_OFF ideal-int +pkg syscall (linux-arm-cgo), const LINUX_REBOOT_CMD_CAD_ON ideal-int +pkg syscall (linux-arm-cgo), const LINUX_REBOOT_CMD_HALT ideal-int +pkg syscall (linux-arm-cgo), const LINUX_REBOOT_CMD_KEXEC ideal-int +pkg syscall (linux-arm-cgo), const LINUX_REBOOT_CMD_POWER_OFF ideal-int +pkg syscall (linux-arm-cgo), const LINUX_REBOOT_CMD_RESTART ideal-int +pkg syscall (linux-arm-cgo), const LINUX_REBOOT_CMD_RESTART2 ideal-int +pkg syscall (linux-arm-cgo), const LINUX_REBOOT_CMD_SW_SUSPEND ideal-int +pkg syscall (linux-arm-cgo), const LINUX_REBOOT_MAGIC1 ideal-int +pkg syscall (linux-arm-cgo), const LINUX_REBOOT_MAGIC2 ideal-int +pkg syscall (linux-arm-cgo), const LOCK_EX ideal-int +pkg syscall (linux-arm-cgo), const LOCK_NB ideal-int +pkg syscall (linux-arm-cgo), const LOCK_SH ideal-int +pkg syscall (linux-arm-cgo), const LOCK_UN ideal-int +pkg syscall (linux-arm-cgo), const MADV_DOFORK ideal-int +pkg syscall (linux-arm-cgo), const MADV_DONTFORK ideal-int +pkg syscall (linux-arm-cgo), const MADV_DONTNEED ideal-int +pkg syscall (linux-arm-cgo), const MADV_HUGEPAGE ideal-int +pkg syscall (linux-arm-cgo), const MADV_HWPOISON ideal-int +pkg syscall (linux-arm-cgo), const MADV_MERGEABLE ideal-int +pkg syscall (linux-arm-cgo), const MADV_NOHUGEPAGE ideal-int +pkg syscall (linux-arm-cgo), const MADV_NORMAL ideal-int +pkg syscall (linux-arm-cgo), const MADV_RANDOM ideal-int +pkg syscall (linux-arm-cgo), const MADV_REMOVE ideal-int +pkg syscall (linux-arm-cgo), const MADV_SEQUENTIAL ideal-int +pkg syscall (linux-arm-cgo), const MADV_UNMERGEABLE ideal-int +pkg syscall (linux-arm-cgo), const MADV_WILLNEED ideal-int +pkg syscall (linux-arm-cgo), const MAP_ANON ideal-int +pkg syscall (linux-arm-cgo), const MAP_ANONYMOUS ideal-int +pkg syscall (linux-arm-cgo), const MAP_DENYWRITE ideal-int +pkg syscall (linux-arm-cgo), const MAP_EXECUTABLE ideal-int +pkg syscall (linux-arm-cgo), const MAP_FILE ideal-int +pkg syscall (linux-arm-cgo), const MAP_FIXED ideal-int +pkg syscall (linux-arm-cgo), const MAP_GROWSDOWN ideal-int +pkg syscall (linux-arm-cgo), const MAP_LOCKED ideal-int +pkg syscall (linux-arm-cgo), const MAP_NONBLOCK ideal-int +pkg syscall (linux-arm-cgo), const MAP_NORESERVE ideal-int +pkg syscall (linux-arm-cgo), const MAP_POPULATE ideal-int +pkg syscall (linux-arm-cgo), const MAP_PRIVATE ideal-int +pkg syscall (linux-arm-cgo), const MAP_SHARED ideal-int +pkg syscall (linux-arm-cgo), const MAP_TYPE ideal-int +pkg syscall (linux-arm-cgo), const MCL_CURRENT ideal-int +pkg syscall (linux-arm-cgo), const MCL_FUTURE ideal-int +pkg syscall (linux-arm-cgo), const MNT_DETACH ideal-int +pkg syscall (linux-arm-cgo), const MNT_EXPIRE ideal-int +pkg syscall (linux-arm-cgo), const MNT_FORCE ideal-int +pkg syscall (linux-arm-cgo), const MSG_CMSG_CLOEXEC ideal-int +pkg syscall (linux-arm-cgo), const MSG_CONFIRM ideal-int +pkg syscall (linux-arm-cgo), const MSG_CTRUNC ideal-int +pkg syscall (linux-arm-cgo), const MSG_DONTROUTE ideal-int +pkg syscall (linux-arm-cgo), const MSG_DONTWAIT ideal-int +pkg syscall (linux-arm-cgo), const MSG_EOR ideal-int +pkg syscall (linux-arm-cgo), const MSG_ERRQUEUE ideal-int +pkg syscall (linux-arm-cgo), const MSG_FASTOPEN ideal-int +pkg syscall (linux-arm-cgo), const MSG_FIN ideal-int +pkg syscall (linux-arm-cgo), const MSG_MORE ideal-int +pkg syscall (linux-arm-cgo), const MSG_NOSIGNAL ideal-int +pkg syscall (linux-arm-cgo), const MSG_OOB ideal-int +pkg syscall (linux-arm-cgo), const MSG_PEEK ideal-int +pkg syscall (linux-arm-cgo), const MSG_PROXY ideal-int +pkg syscall (linux-arm-cgo), const MSG_RST ideal-int +pkg syscall (linux-arm-cgo), const MSG_SYN ideal-int +pkg syscall (linux-arm-cgo), const MSG_TRUNC ideal-int +pkg syscall (linux-arm-cgo), const MSG_TRYHARD ideal-int +pkg syscall (linux-arm-cgo), const MSG_WAITALL ideal-int +pkg syscall (linux-arm-cgo), const MSG_WAITFORONE ideal-int +pkg syscall (linux-arm-cgo), const MS_ACTIVE ideal-int +pkg syscall (linux-arm-cgo), const MS_ASYNC ideal-int +pkg syscall (linux-arm-cgo), const MS_BIND ideal-int +pkg syscall (linux-arm-cgo), const MS_DIRSYNC ideal-int +pkg syscall (linux-arm-cgo), const MS_INVALIDATE ideal-int +pkg syscall (linux-arm-cgo), const MS_I_VERSION ideal-int +pkg syscall (linux-arm-cgo), const MS_KERNMOUNT ideal-int +pkg syscall (linux-arm-cgo), const MS_MANDLOCK ideal-int +pkg syscall (linux-arm-cgo), const MS_MGC_MSK ideal-int +pkg syscall (linux-arm-cgo), const MS_MGC_VAL ideal-int +pkg syscall (linux-arm-cgo), const MS_MOVE ideal-int +pkg syscall (linux-arm-cgo), const MS_NOATIME ideal-int +pkg syscall (linux-arm-cgo), const MS_NODEV ideal-int +pkg syscall (linux-arm-cgo), const MS_NODIRATIME ideal-int +pkg syscall (linux-arm-cgo), const MS_NOEXEC ideal-int +pkg syscall (linux-arm-cgo), const MS_NOSUID ideal-int +pkg syscall (linux-arm-cgo), const MS_NOUSER ideal-int +pkg syscall (linux-arm-cgo), const MS_POSIXACL ideal-int +pkg syscall (linux-arm-cgo), const MS_PRIVATE ideal-int +pkg syscall (linux-arm-cgo), const MS_RDONLY ideal-int +pkg syscall (linux-arm-cgo), const MS_REC ideal-int +pkg syscall (linux-arm-cgo), const MS_RELATIME ideal-int +pkg syscall (linux-arm-cgo), const MS_REMOUNT ideal-int +pkg syscall (linux-arm-cgo), const MS_RMT_MASK ideal-int +pkg syscall (linux-arm-cgo), const MS_SHARED ideal-int +pkg syscall (linux-arm-cgo), const MS_SILENT ideal-int +pkg syscall (linux-arm-cgo), const MS_SLAVE ideal-int +pkg syscall (linux-arm-cgo), const MS_STRICTATIME ideal-int +pkg syscall (linux-arm-cgo), const MS_SYNC ideal-int +pkg syscall (linux-arm-cgo), const MS_SYNCHRONOUS ideal-int +pkg syscall (linux-arm-cgo), const MS_UNBINDABLE ideal-int +pkg syscall (linux-arm-cgo), const NAME_MAX ideal-int +pkg syscall (linux-arm-cgo), const NETLINK_ADD_MEMBERSHIP ideal-int +pkg syscall (linux-arm-cgo), const NETLINK_AUDIT ideal-int +pkg syscall (linux-arm-cgo), const NETLINK_BROADCAST_ERROR ideal-int +pkg syscall (linux-arm-cgo), const NETLINK_CONNECTOR ideal-int +pkg syscall (linux-arm-cgo), const NETLINK_DNRTMSG ideal-int +pkg syscall (linux-arm-cgo), const NETLINK_DROP_MEMBERSHIP ideal-int +pkg syscall (linux-arm-cgo), const NETLINK_ECRYPTFS ideal-int +pkg syscall (linux-arm-cgo), const NETLINK_FIB_LOOKUP ideal-int +pkg syscall (linux-arm-cgo), const NETLINK_FIREWALL ideal-int +pkg syscall (linux-arm-cgo), const NETLINK_GENERIC ideal-int +pkg syscall (linux-arm-cgo), const NETLINK_INET_DIAG ideal-int +pkg syscall (linux-arm-cgo), const NETLINK_IP6_FW ideal-int +pkg syscall (linux-arm-cgo), const NETLINK_ISCSI ideal-int +pkg syscall (linux-arm-cgo), const NETLINK_KOBJECT_UEVENT ideal-int +pkg syscall (linux-arm-cgo), const NETLINK_NETFILTER ideal-int +pkg syscall (linux-arm-cgo), const NETLINK_NFLOG ideal-int +pkg syscall (linux-arm-cgo), const NETLINK_NO_ENOBUFS ideal-int +pkg syscall (linux-arm-cgo), const NETLINK_PKTINFO ideal-int +pkg syscall (linux-arm-cgo), const NETLINK_RDMA ideal-int +pkg syscall (linux-arm-cgo), const NETLINK_ROUTE ideal-int +pkg syscall (linux-arm-cgo), const NETLINK_SCSITRANSPORT ideal-int +pkg syscall (linux-arm-cgo), const NETLINK_SELINUX ideal-int +pkg syscall (linux-arm-cgo), const NETLINK_UNUSED ideal-int +pkg syscall (linux-arm-cgo), const NETLINK_USERSOCK ideal-int +pkg syscall (linux-arm-cgo), const NETLINK_XFRM ideal-int +pkg syscall (linux-arm-cgo), const NLA_ALIGNTO ideal-int +pkg syscall (linux-arm-cgo), const NLA_F_NESTED ideal-int +pkg syscall (linux-arm-cgo), const NLA_F_NET_BYTEORDER ideal-int +pkg syscall (linux-arm-cgo), const NLA_HDRLEN ideal-int +pkg syscall (linux-arm-cgo), const NLMSG_ALIGNTO ideal-int +pkg syscall (linux-arm-cgo), const NLMSG_DONE ideal-int +pkg syscall (linux-arm-cgo), const NLMSG_ERROR ideal-int +pkg syscall (linux-arm-cgo), const NLMSG_HDRLEN ideal-int +pkg syscall (linux-arm-cgo), const NLMSG_MIN_TYPE ideal-int +pkg syscall (linux-arm-cgo), const NLMSG_NOOP ideal-int +pkg syscall (linux-arm-cgo), const NLMSG_OVERRUN ideal-int +pkg syscall (linux-arm-cgo), const NLM_F_ACK ideal-int +pkg syscall (linux-arm-cgo), const NLM_F_APPEND ideal-int +pkg syscall (linux-arm-cgo), const NLM_F_ATOMIC ideal-int +pkg syscall (linux-arm-cgo), const NLM_F_CREATE ideal-int +pkg syscall (linux-arm-cgo), const NLM_F_DUMP ideal-int +pkg syscall (linux-arm-cgo), const NLM_F_ECHO ideal-int +pkg syscall (linux-arm-cgo), const NLM_F_EXCL ideal-int +pkg syscall (linux-arm-cgo), const NLM_F_MATCH ideal-int +pkg syscall (linux-arm-cgo), const NLM_F_MULTI ideal-int +pkg syscall (linux-arm-cgo), const NLM_F_REPLACE ideal-int +pkg syscall (linux-arm-cgo), const NLM_F_REQUEST ideal-int +pkg syscall (linux-arm-cgo), const NLM_F_ROOT ideal-int +pkg syscall (linux-arm-cgo), const NOFLSH ideal-int +pkg syscall (linux-arm-cgo), const OCRNL ideal-int +pkg syscall (linux-arm-cgo), const OFDEL ideal-int +pkg syscall (linux-arm-cgo), const OFILL ideal-int +pkg syscall (linux-arm-cgo), const OLCUC ideal-int +pkg syscall (linux-arm-cgo), const ONLCR ideal-int +pkg syscall (linux-arm-cgo), const ONLRET ideal-int +pkg syscall (linux-arm-cgo), const ONOCR ideal-int +pkg syscall (linux-arm-cgo), const OPOST ideal-int +pkg syscall (linux-arm-cgo), const O_ACCMODE ideal-int +pkg syscall (linux-arm-cgo), const O_DIRECT ideal-int +pkg syscall (linux-arm-cgo), const O_DIRECTORY ideal-int +pkg syscall (linux-arm-cgo), const O_DSYNC ideal-int +pkg syscall (linux-arm-cgo), const O_FSYNC ideal-int +pkg syscall (linux-arm-cgo), const O_LARGEFILE ideal-int +pkg syscall (linux-arm-cgo), const O_NDELAY ideal-int +pkg syscall (linux-arm-cgo), const O_NOATIME ideal-int +pkg syscall (linux-arm-cgo), const O_NOFOLLOW ideal-int +pkg syscall (linux-arm-cgo), const O_RSYNC ideal-int +pkg syscall (linux-arm-cgo), const PACKET_ADD_MEMBERSHIP ideal-int +pkg syscall (linux-arm-cgo), const PACKET_BROADCAST ideal-int +pkg syscall (linux-arm-cgo), const PACKET_DROP_MEMBERSHIP ideal-int +pkg syscall (linux-arm-cgo), const PACKET_FASTROUTE ideal-int +pkg syscall (linux-arm-cgo), const PACKET_HOST ideal-int +pkg syscall (linux-arm-cgo), const PACKET_LOOPBACK ideal-int +pkg syscall (linux-arm-cgo), const PACKET_MR_ALLMULTI ideal-int +pkg syscall (linux-arm-cgo), const PACKET_MR_MULTICAST ideal-int +pkg syscall (linux-arm-cgo), const PACKET_MR_PROMISC ideal-int +pkg syscall (linux-arm-cgo), const PACKET_MULTICAST ideal-int +pkg syscall (linux-arm-cgo), const PACKET_OTHERHOST ideal-int +pkg syscall (linux-arm-cgo), const PACKET_OUTGOING ideal-int +pkg syscall (linux-arm-cgo), const PACKET_RECV_OUTPUT ideal-int +pkg syscall (linux-arm-cgo), const PACKET_RX_RING ideal-int +pkg syscall (linux-arm-cgo), const PACKET_STATISTICS ideal-int +pkg syscall (linux-arm-cgo), const PARENB ideal-int +pkg syscall (linux-arm-cgo), const PARMRK ideal-int +pkg syscall (linux-arm-cgo), const PARODD ideal-int +pkg syscall (linux-arm-cgo), const PENDIN ideal-int +pkg syscall (linux-arm-cgo), const PRIO_PGRP = 1 +pkg syscall (linux-arm-cgo), const PRIO_PGRP ideal-int +pkg syscall (linux-arm-cgo), const PRIO_PROCESS = 0 +pkg syscall (linux-arm-cgo), const PRIO_PROCESS ideal-int +pkg syscall (linux-arm-cgo), const PRIO_USER = 2 +pkg syscall (linux-arm-cgo), const PRIO_USER ideal-int +pkg syscall (linux-arm-cgo), const PROT_EXEC ideal-int +pkg syscall (linux-arm-cgo), const PROT_GROWSDOWN ideal-int +pkg syscall (linux-arm-cgo), const PROT_GROWSUP ideal-int +pkg syscall (linux-arm-cgo), const PROT_NONE ideal-int +pkg syscall (linux-arm-cgo), const PROT_READ ideal-int +pkg syscall (linux-arm-cgo), const PROT_WRITE ideal-int +pkg syscall (linux-arm-cgo), const PR_CAPBSET_DROP ideal-int +pkg syscall (linux-arm-cgo), const PR_CAPBSET_READ ideal-int +pkg syscall (linux-arm-cgo), const PR_CLEAR_SECCOMP_FILTER ideal-int +pkg syscall (linux-arm-cgo), const PR_ENDIAN_BIG ideal-int +pkg syscall (linux-arm-cgo), const PR_ENDIAN_LITTLE ideal-int +pkg syscall (linux-arm-cgo), const PR_ENDIAN_PPC_LITTLE ideal-int +pkg syscall (linux-arm-cgo), const PR_FPEMU_NOPRINT ideal-int +pkg syscall (linux-arm-cgo), const PR_FPEMU_SIGFPE ideal-int +pkg syscall (linux-arm-cgo), const PR_FP_EXC_ASYNC ideal-int +pkg syscall (linux-arm-cgo), const PR_FP_EXC_DISABLED ideal-int +pkg syscall (linux-arm-cgo), const PR_FP_EXC_DIV ideal-int +pkg syscall (linux-arm-cgo), const PR_FP_EXC_INV ideal-int +pkg syscall (linux-arm-cgo), const PR_FP_EXC_NONRECOV ideal-int +pkg syscall (linux-arm-cgo), const PR_FP_EXC_OVF ideal-int +pkg syscall (linux-arm-cgo), const PR_FP_EXC_PRECISE ideal-int +pkg syscall (linux-arm-cgo), const PR_FP_EXC_RES ideal-int +pkg syscall (linux-arm-cgo), const PR_FP_EXC_SW_ENABLE ideal-int +pkg syscall (linux-arm-cgo), const PR_FP_EXC_UND ideal-int +pkg syscall (linux-arm-cgo), const PR_GET_DUMPABLE ideal-int +pkg syscall (linux-arm-cgo), const PR_GET_ENDIAN ideal-int +pkg syscall (linux-arm-cgo), const PR_GET_FPEMU ideal-int +pkg syscall (linux-arm-cgo), const PR_GET_FPEXC ideal-int +pkg syscall (linux-arm-cgo), const PR_GET_KEEPCAPS ideal-int +pkg syscall (linux-arm-cgo), const PR_GET_NAME ideal-int +pkg syscall (linux-arm-cgo), const PR_GET_PDEATHSIG ideal-int +pkg syscall (linux-arm-cgo), const PR_GET_SECCOMP ideal-int +pkg syscall (linux-arm-cgo), const PR_GET_SECCOMP_FILTER ideal-int +pkg syscall (linux-arm-cgo), const PR_GET_SECUREBITS ideal-int +pkg syscall (linux-arm-cgo), const PR_GET_TIMERSLACK ideal-int +pkg syscall (linux-arm-cgo), const PR_GET_TIMING ideal-int +pkg syscall (linux-arm-cgo), const PR_GET_TSC ideal-int +pkg syscall (linux-arm-cgo), const PR_GET_UNALIGN ideal-int +pkg syscall (linux-arm-cgo), const PR_MCE_KILL ideal-int +pkg syscall (linux-arm-cgo), const PR_MCE_KILL_CLEAR ideal-int +pkg syscall (linux-arm-cgo), const PR_MCE_KILL_DEFAULT ideal-int +pkg syscall (linux-arm-cgo), const PR_MCE_KILL_EARLY ideal-int +pkg syscall (linux-arm-cgo), const PR_MCE_KILL_GET ideal-int +pkg syscall (linux-arm-cgo), const PR_MCE_KILL_LATE ideal-int +pkg syscall (linux-arm-cgo), const PR_MCE_KILL_SET ideal-int +pkg syscall (linux-arm-cgo), const PR_SECCOMP_FILTER_EVENT ideal-int +pkg syscall (linux-arm-cgo), const PR_SECCOMP_FILTER_SYSCALL ideal-int +pkg syscall (linux-arm-cgo), const PR_SET_DUMPABLE ideal-int +pkg syscall (linux-arm-cgo), const PR_SET_ENDIAN ideal-int +pkg syscall (linux-arm-cgo), const PR_SET_FPEMU ideal-int +pkg syscall (linux-arm-cgo), const PR_SET_FPEXC ideal-int +pkg syscall (linux-arm-cgo), const PR_SET_KEEPCAPS ideal-int +pkg syscall (linux-arm-cgo), const PR_SET_NAME ideal-int +pkg syscall (linux-arm-cgo), const PR_SET_PDEATHSIG ideal-int +pkg syscall (linux-arm-cgo), const PR_SET_PTRACER ideal-int +pkg syscall (linux-arm-cgo), const PR_SET_SECCOMP ideal-int +pkg syscall (linux-arm-cgo), const PR_SET_SECCOMP_FILTER ideal-int +pkg syscall (linux-arm-cgo), const PR_SET_SECUREBITS ideal-int +pkg syscall (linux-arm-cgo), const PR_SET_TIMERSLACK ideal-int +pkg syscall (linux-arm-cgo), const PR_SET_TIMING ideal-int +pkg syscall (linux-arm-cgo), const PR_SET_TSC ideal-int +pkg syscall (linux-arm-cgo), const PR_SET_UNALIGN ideal-int +pkg syscall (linux-arm-cgo), const PR_TASK_PERF_EVENTS_DISABLE ideal-int +pkg syscall (linux-arm-cgo), const PR_TASK_PERF_EVENTS_ENABLE ideal-int +pkg syscall (linux-arm-cgo), const PR_TIMING_STATISTICAL ideal-int +pkg syscall (linux-arm-cgo), const PR_TIMING_TIMESTAMP ideal-int +pkg syscall (linux-arm-cgo), const PR_TSC_ENABLE ideal-int +pkg syscall (linux-arm-cgo), const PR_TSC_SIGSEGV ideal-int +pkg syscall (linux-arm-cgo), const PR_UNALIGN_NOPRINT ideal-int +pkg syscall (linux-arm-cgo), const PR_UNALIGN_SIGBUS ideal-int +pkg syscall (linux-arm-cgo), const PTRACE_ATTACH ideal-int +pkg syscall (linux-arm-cgo), const PTRACE_CONT ideal-int +pkg syscall (linux-arm-cgo), const PTRACE_DETACH ideal-int +pkg syscall (linux-arm-cgo), const PTRACE_EVENT_CLONE ideal-int +pkg syscall (linux-arm-cgo), const PTRACE_EVENT_EXEC ideal-int +pkg syscall (linux-arm-cgo), const PTRACE_EVENT_EXIT ideal-int +pkg syscall (linux-arm-cgo), const PTRACE_EVENT_FORK ideal-int +pkg syscall (linux-arm-cgo), const PTRACE_EVENT_VFORK ideal-int +pkg syscall (linux-arm-cgo), const PTRACE_EVENT_VFORK_DONE ideal-int +pkg syscall (linux-arm-cgo), const PTRACE_GETCRUNCHREGS ideal-int +pkg syscall (linux-arm-cgo), const PTRACE_GETEVENTMSG ideal-int +pkg syscall (linux-arm-cgo), const PTRACE_GETFPREGS ideal-int +pkg syscall (linux-arm-cgo), const PTRACE_GETHBPREGS ideal-int +pkg syscall (linux-arm-cgo), const PTRACE_GETREGS ideal-int +pkg syscall (linux-arm-cgo), const PTRACE_GETREGSET ideal-int +pkg syscall (linux-arm-cgo), const PTRACE_GETSIGINFO ideal-int +pkg syscall (linux-arm-cgo), const PTRACE_GETVFPREGS ideal-int +pkg syscall (linux-arm-cgo), const PTRACE_GETWMMXREGS ideal-int +pkg syscall (linux-arm-cgo), const PTRACE_GET_THREAD_AREA ideal-int +pkg syscall (linux-arm-cgo), const PTRACE_KILL ideal-int +pkg syscall (linux-arm-cgo), const PTRACE_OLDSETOPTIONS ideal-int +pkg syscall (linux-arm-cgo), const PTRACE_O_MASK ideal-int +pkg syscall (linux-arm-cgo), const PTRACE_O_TRACECLONE ideal-int +pkg syscall (linux-arm-cgo), const PTRACE_O_TRACEEXEC ideal-int +pkg syscall (linux-arm-cgo), const PTRACE_O_TRACEEXIT ideal-int +pkg syscall (linux-arm-cgo), const PTRACE_O_TRACEFORK ideal-int +pkg syscall (linux-arm-cgo), const PTRACE_O_TRACESYSGOOD ideal-int +pkg syscall (linux-arm-cgo), const PTRACE_O_TRACEVFORK ideal-int +pkg syscall (linux-arm-cgo), const PTRACE_O_TRACEVFORKDONE ideal-int +pkg syscall (linux-arm-cgo), const PTRACE_PEEKDATA ideal-int +pkg syscall (linux-arm-cgo), const PTRACE_PEEKTEXT ideal-int +pkg syscall (linux-arm-cgo), const PTRACE_PEEKUSR ideal-int +pkg syscall (linux-arm-cgo), const PTRACE_POKEDATA ideal-int +pkg syscall (linux-arm-cgo), const PTRACE_POKETEXT ideal-int +pkg syscall (linux-arm-cgo), const PTRACE_POKEUSR ideal-int +pkg syscall (linux-arm-cgo), const PTRACE_SETCRUNCHREGS ideal-int +pkg syscall (linux-arm-cgo), const PTRACE_SETFPREGS ideal-int +pkg syscall (linux-arm-cgo), const PTRACE_SETHBPREGS ideal-int +pkg syscall (linux-arm-cgo), const PTRACE_SETOPTIONS ideal-int +pkg syscall (linux-arm-cgo), const PTRACE_SETREGS ideal-int +pkg syscall (linux-arm-cgo), const PTRACE_SETREGSET ideal-int +pkg syscall (linux-arm-cgo), const PTRACE_SETSIGINFO ideal-int +pkg syscall (linux-arm-cgo), const PTRACE_SETVFPREGS ideal-int +pkg syscall (linux-arm-cgo), const PTRACE_SETWMMXREGS ideal-int +pkg syscall (linux-arm-cgo), const PTRACE_SET_SYSCALL ideal-int +pkg syscall (linux-arm-cgo), const PTRACE_SINGLESTEP ideal-int +pkg syscall (linux-arm-cgo), const PTRACE_SYSCALL ideal-int +pkg syscall (linux-arm-cgo), const PTRACE_TRACEME ideal-int +pkg syscall (linux-arm-cgo), const PT_DATA_ADDR ideal-int +pkg syscall (linux-arm-cgo), const PT_TEXT_ADDR ideal-int +pkg syscall (linux-arm-cgo), const PT_TEXT_END_ADDR ideal-int +pkg syscall (linux-arm-cgo), const PathMax ideal-int +pkg syscall (linux-arm-cgo), const RLIMIT_AS ideal-int +pkg syscall (linux-arm-cgo), const RLIMIT_CORE ideal-int +pkg syscall (linux-arm-cgo), const RLIMIT_CPU ideal-int +pkg syscall (linux-arm-cgo), const RLIMIT_DATA ideal-int +pkg syscall (linux-arm-cgo), const RLIMIT_FSIZE ideal-int +pkg syscall (linux-arm-cgo), const RLIMIT_NOFILE ideal-int +pkg syscall (linux-arm-cgo), const RLIMIT_STACK ideal-int +pkg syscall (linux-arm-cgo), const RLIM_INFINITY ideal-int +pkg syscall (linux-arm-cgo), const RTAX_ADVMSS ideal-int +pkg syscall (linux-arm-cgo), const RTAX_CWND ideal-int +pkg syscall (linux-arm-cgo), const RTAX_FEATURES ideal-int +pkg syscall (linux-arm-cgo), const RTAX_FEATURE_ALLFRAG ideal-int +pkg syscall (linux-arm-cgo), const RTAX_FEATURE_ECN ideal-int +pkg syscall (linux-arm-cgo), const RTAX_FEATURE_SACK ideal-int +pkg syscall (linux-arm-cgo), const RTAX_FEATURE_TIMESTAMP ideal-int +pkg syscall (linux-arm-cgo), const RTAX_HOPLIMIT ideal-int +pkg syscall (linux-arm-cgo), const RTAX_INITCWND ideal-int +pkg syscall (linux-arm-cgo), const RTAX_INITRWND ideal-int +pkg syscall (linux-arm-cgo), const RTAX_LOCK ideal-int +pkg syscall (linux-arm-cgo), const RTAX_MAX ideal-int +pkg syscall (linux-arm-cgo), const RTAX_MTU ideal-int +pkg syscall (linux-arm-cgo), const RTAX_REORDERING ideal-int +pkg syscall (linux-arm-cgo), const RTAX_RTO_MIN ideal-int +pkg syscall (linux-arm-cgo), const RTAX_RTT ideal-int +pkg syscall (linux-arm-cgo), const RTAX_RTTVAR ideal-int +pkg syscall (linux-arm-cgo), const RTAX_SSTHRESH ideal-int +pkg syscall (linux-arm-cgo), const RTAX_UNSPEC ideal-int +pkg syscall (linux-arm-cgo), const RTAX_WINDOW ideal-int +pkg syscall (linux-arm-cgo), const RTA_ALIGNTO ideal-int +pkg syscall (linux-arm-cgo), const RTA_CACHEINFO ideal-int +pkg syscall (linux-arm-cgo), const RTA_DST ideal-int +pkg syscall (linux-arm-cgo), const RTA_FLOW ideal-int +pkg syscall (linux-arm-cgo), const RTA_GATEWAY ideal-int +pkg syscall (linux-arm-cgo), const RTA_IIF ideal-int +pkg syscall (linux-arm-cgo), const RTA_MAX ideal-int +pkg syscall (linux-arm-cgo), const RTA_METRICS ideal-int +pkg syscall (linux-arm-cgo), const RTA_MULTIPATH ideal-int +pkg syscall (linux-arm-cgo), const RTA_OIF ideal-int +pkg syscall (linux-arm-cgo), const RTA_PREFSRC ideal-int +pkg syscall (linux-arm-cgo), const RTA_PRIORITY ideal-int +pkg syscall (linux-arm-cgo), const RTA_SRC ideal-int +pkg syscall (linux-arm-cgo), const RTA_TABLE ideal-int +pkg syscall (linux-arm-cgo), const RTA_UNSPEC ideal-int +pkg syscall (linux-arm-cgo), const RTCF_DIRECTSRC ideal-int +pkg syscall (linux-arm-cgo), const RTCF_DOREDIRECT ideal-int +pkg syscall (linux-arm-cgo), const RTCF_LOG ideal-int +pkg syscall (linux-arm-cgo), const RTCF_MASQ ideal-int +pkg syscall (linux-arm-cgo), const RTCF_NAT ideal-int +pkg syscall (linux-arm-cgo), const RTCF_VALVE ideal-int +pkg syscall (linux-arm-cgo), const RTF_ADDRCLASSMASK ideal-int +pkg syscall (linux-arm-cgo), const RTF_ADDRCONF ideal-int +pkg syscall (linux-arm-cgo), const RTF_ALLONLINK ideal-int +pkg syscall (linux-arm-cgo), const RTF_BROADCAST ideal-int +pkg syscall (linux-arm-cgo), const RTF_CACHE ideal-int +pkg syscall (linux-arm-cgo), const RTF_DEFAULT ideal-int +pkg syscall (linux-arm-cgo), const RTF_DYNAMIC ideal-int +pkg syscall (linux-arm-cgo), const RTF_FLOW ideal-int +pkg syscall (linux-arm-cgo), const RTF_GATEWAY ideal-int +pkg syscall (linux-arm-cgo), const RTF_HOST ideal-int +pkg syscall (linux-arm-cgo), const RTF_INTERFACE ideal-int +pkg syscall (linux-arm-cgo), const RTF_IRTT ideal-int +pkg syscall (linux-arm-cgo), const RTF_LINKRT ideal-int +pkg syscall (linux-arm-cgo), const RTF_LOCAL ideal-int +pkg syscall (linux-arm-cgo), const RTF_MODIFIED ideal-int +pkg syscall (linux-arm-cgo), const RTF_MSS ideal-int +pkg syscall (linux-arm-cgo), const RTF_MTU ideal-int +pkg syscall (linux-arm-cgo), const RTF_MULTICAST ideal-int +pkg syscall (linux-arm-cgo), const RTF_NAT ideal-int +pkg syscall (linux-arm-cgo), const RTF_NOFORWARD ideal-int +pkg syscall (linux-arm-cgo), const RTF_NONEXTHOP ideal-int +pkg syscall (linux-arm-cgo), const RTF_NOPMTUDISC ideal-int +pkg syscall (linux-arm-cgo), const RTF_POLICY ideal-int +pkg syscall (linux-arm-cgo), const RTF_REINSTATE ideal-int +pkg syscall (linux-arm-cgo), const RTF_REJECT ideal-int +pkg syscall (linux-arm-cgo), const RTF_STATIC ideal-int +pkg syscall (linux-arm-cgo), const RTF_THROW ideal-int +pkg syscall (linux-arm-cgo), const RTF_UP ideal-int +pkg syscall (linux-arm-cgo), const RTF_WINDOW ideal-int +pkg syscall (linux-arm-cgo), const RTF_XRESOLVE ideal-int +pkg syscall (linux-arm-cgo), const RTM_BASE ideal-int +pkg syscall (linux-arm-cgo), const RTM_DELACTION ideal-int +pkg syscall (linux-arm-cgo), const RTM_DELADDR ideal-int +pkg syscall (linux-arm-cgo), const RTM_DELADDRLABEL ideal-int +pkg syscall (linux-arm-cgo), const RTM_DELLINK ideal-int +pkg syscall (linux-arm-cgo), const RTM_DELNEIGH ideal-int +pkg syscall (linux-arm-cgo), const RTM_DELQDISC ideal-int +pkg syscall (linux-arm-cgo), const RTM_DELROUTE ideal-int +pkg syscall (linux-arm-cgo), const RTM_DELRULE ideal-int +pkg syscall (linux-arm-cgo), const RTM_DELTCLASS ideal-int +pkg syscall (linux-arm-cgo), const RTM_DELTFILTER ideal-int +pkg syscall (linux-arm-cgo), const RTM_F_CLONED ideal-int +pkg syscall (linux-arm-cgo), const RTM_F_EQUALIZE ideal-int +pkg syscall (linux-arm-cgo), const RTM_F_NOTIFY ideal-int +pkg syscall (linux-arm-cgo), const RTM_F_PREFIX ideal-int +pkg syscall (linux-arm-cgo), const RTM_GETACTION ideal-int +pkg syscall (linux-arm-cgo), const RTM_GETADDR ideal-int +pkg syscall (linux-arm-cgo), const RTM_GETADDRLABEL ideal-int +pkg syscall (linux-arm-cgo), const RTM_GETANYCAST ideal-int +pkg syscall (linux-arm-cgo), const RTM_GETDCB ideal-int +pkg syscall (linux-arm-cgo), const RTM_GETLINK ideal-int +pkg syscall (linux-arm-cgo), const RTM_GETMULTICAST ideal-int +pkg syscall (linux-arm-cgo), const RTM_GETNEIGH ideal-int +pkg syscall (linux-arm-cgo), const RTM_GETNEIGHTBL ideal-int +pkg syscall (linux-arm-cgo), const RTM_GETQDISC ideal-int +pkg syscall (linux-arm-cgo), const RTM_GETROUTE ideal-int +pkg syscall (linux-arm-cgo), const RTM_GETRULE ideal-int +pkg syscall (linux-arm-cgo), const RTM_GETTCLASS ideal-int +pkg syscall (linux-arm-cgo), const RTM_GETTFILTER ideal-int +pkg syscall (linux-arm-cgo), const RTM_MAX ideal-int +pkg syscall (linux-arm-cgo), const RTM_NEWACTION ideal-int +pkg syscall (linux-arm-cgo), const RTM_NEWADDR ideal-int +pkg syscall (linux-arm-cgo), const RTM_NEWADDRLABEL ideal-int +pkg syscall (linux-arm-cgo), const RTM_NEWLINK ideal-int +pkg syscall (linux-arm-cgo), const RTM_NEWNDUSEROPT ideal-int +pkg syscall (linux-arm-cgo), const RTM_NEWNEIGH ideal-int +pkg syscall (linux-arm-cgo), const RTM_NEWNEIGHTBL ideal-int +pkg syscall (linux-arm-cgo), const RTM_NEWPREFIX ideal-int +pkg syscall (linux-arm-cgo), const RTM_NEWQDISC ideal-int +pkg syscall (linux-arm-cgo), const RTM_NEWROUTE ideal-int +pkg syscall (linux-arm-cgo), const RTM_NEWRULE ideal-int +pkg syscall (linux-arm-cgo), const RTM_NEWTCLASS ideal-int +pkg syscall (linux-arm-cgo), const RTM_NEWTFILTER ideal-int +pkg syscall (linux-arm-cgo), const RTM_NR_FAMILIES ideal-int +pkg syscall (linux-arm-cgo), const RTM_NR_MSGTYPES ideal-int +pkg syscall (linux-arm-cgo), const RTM_SETDCB ideal-int +pkg syscall (linux-arm-cgo), const RTM_SETLINK ideal-int +pkg syscall (linux-arm-cgo), const RTM_SETNEIGHTBL ideal-int +pkg syscall (linux-arm-cgo), const RTNH_ALIGNTO ideal-int +pkg syscall (linux-arm-cgo), const RTNH_F_DEAD ideal-int +pkg syscall (linux-arm-cgo), const RTNH_F_ONLINK ideal-int +pkg syscall (linux-arm-cgo), const RTNH_F_PERVASIVE ideal-int +pkg syscall (linux-arm-cgo), const RTNLGRP_IPV4_IFADDR ideal-int +pkg syscall (linux-arm-cgo), const RTNLGRP_IPV4_MROUTE ideal-int +pkg syscall (linux-arm-cgo), const RTNLGRP_IPV4_ROUTE ideal-int +pkg syscall (linux-arm-cgo), const RTNLGRP_IPV4_RULE ideal-int +pkg syscall (linux-arm-cgo), const RTNLGRP_IPV6_IFADDR ideal-int +pkg syscall (linux-arm-cgo), const RTNLGRP_IPV6_IFINFO ideal-int +pkg syscall (linux-arm-cgo), const RTNLGRP_IPV6_MROUTE ideal-int +pkg syscall (linux-arm-cgo), const RTNLGRP_IPV6_PREFIX ideal-int +pkg syscall (linux-arm-cgo), const RTNLGRP_IPV6_ROUTE ideal-int +pkg syscall (linux-arm-cgo), const RTNLGRP_IPV6_RULE ideal-int +pkg syscall (linux-arm-cgo), const RTNLGRP_LINK ideal-int +pkg syscall (linux-arm-cgo), const RTNLGRP_ND_USEROPT ideal-int +pkg syscall (linux-arm-cgo), const RTNLGRP_NEIGH ideal-int +pkg syscall (linux-arm-cgo), const RTNLGRP_NONE ideal-int +pkg syscall (linux-arm-cgo), const RTNLGRP_NOTIFY ideal-int +pkg syscall (linux-arm-cgo), const RTNLGRP_TC ideal-int +pkg syscall (linux-arm-cgo), const RTN_ANYCAST ideal-int +pkg syscall (linux-arm-cgo), const RTN_BLACKHOLE ideal-int +pkg syscall (linux-arm-cgo), const RTN_BROADCAST ideal-int +pkg syscall (linux-arm-cgo), const RTN_LOCAL ideal-int +pkg syscall (linux-arm-cgo), const RTN_MAX ideal-int +pkg syscall (linux-arm-cgo), const RTN_MULTICAST ideal-int +pkg syscall (linux-arm-cgo), const RTN_NAT ideal-int +pkg syscall (linux-arm-cgo), const RTN_PROHIBIT ideal-int +pkg syscall (linux-arm-cgo), const RTN_THROW ideal-int +pkg syscall (linux-arm-cgo), const RTN_UNICAST ideal-int +pkg syscall (linux-arm-cgo), const RTN_UNREACHABLE ideal-int +pkg syscall (linux-arm-cgo), const RTN_UNSPEC ideal-int +pkg syscall (linux-arm-cgo), const RTN_XRESOLVE ideal-int +pkg syscall (linux-arm-cgo), const RTPROT_BIRD ideal-int +pkg syscall (linux-arm-cgo), const RTPROT_BOOT ideal-int +pkg syscall (linux-arm-cgo), const RTPROT_DHCP ideal-int +pkg syscall (linux-arm-cgo), const RTPROT_DNROUTED ideal-int +pkg syscall (linux-arm-cgo), const RTPROT_GATED ideal-int +pkg syscall (linux-arm-cgo), const RTPROT_KERNEL ideal-int +pkg syscall (linux-arm-cgo), const RTPROT_MRT ideal-int +pkg syscall (linux-arm-cgo), const RTPROT_NTK ideal-int +pkg syscall (linux-arm-cgo), const RTPROT_RA ideal-int +pkg syscall (linux-arm-cgo), const RTPROT_REDIRECT ideal-int +pkg syscall (linux-arm-cgo), const RTPROT_STATIC ideal-int +pkg syscall (linux-arm-cgo), const RTPROT_UNSPEC ideal-int +pkg syscall (linux-arm-cgo), const RTPROT_XORP ideal-int +pkg syscall (linux-arm-cgo), const RTPROT_ZEBRA ideal-int +pkg syscall (linux-arm-cgo), const RT_CLASS_DEFAULT ideal-int +pkg syscall (linux-arm-cgo), const RT_CLASS_LOCAL ideal-int +pkg syscall (linux-arm-cgo), const RT_CLASS_MAIN ideal-int +pkg syscall (linux-arm-cgo), const RT_CLASS_MAX ideal-int +pkg syscall (linux-arm-cgo), const RT_CLASS_UNSPEC ideal-int +pkg syscall (linux-arm-cgo), const RT_SCOPE_HOST ideal-int +pkg syscall (linux-arm-cgo), const RT_SCOPE_LINK ideal-int +pkg syscall (linux-arm-cgo), const RT_SCOPE_NOWHERE ideal-int +pkg syscall (linux-arm-cgo), const RT_SCOPE_SITE ideal-int +pkg syscall (linux-arm-cgo), const RT_SCOPE_UNIVERSE ideal-int +pkg syscall (linux-arm-cgo), const RT_TABLE_COMPAT ideal-int +pkg syscall (linux-arm-cgo), const RT_TABLE_DEFAULT ideal-int +pkg syscall (linux-arm-cgo), const RT_TABLE_LOCAL ideal-int +pkg syscall (linux-arm-cgo), const RT_TABLE_MAIN ideal-int +pkg syscall (linux-arm-cgo), const RT_TABLE_MAX ideal-int +pkg syscall (linux-arm-cgo), const RT_TABLE_UNSPEC ideal-int +pkg syscall (linux-arm-cgo), const RUSAGE_CHILDREN ideal-int +pkg syscall (linux-arm-cgo), const RUSAGE_SELF ideal-int +pkg syscall (linux-arm-cgo), const RUSAGE_THREAD ideal-int +pkg syscall (linux-arm-cgo), const SCM_CREDENTIALS ideal-int +pkg syscall (linux-arm-cgo), const SCM_RIGHTS ideal-int +pkg syscall (linux-arm-cgo), const SCM_TIMESTAMP ideal-int +pkg syscall (linux-arm-cgo), const SCM_TIMESTAMPING ideal-int +pkg syscall (linux-arm-cgo), const SCM_TIMESTAMPNS ideal-int +pkg syscall (linux-arm-cgo), const SIGCHLD Signal +pkg syscall (linux-arm-cgo), const SIGCLD Signal +pkg syscall (linux-arm-cgo), const SIGCONT Signal +pkg syscall (linux-arm-cgo), const SIGIO Signal +pkg syscall (linux-arm-cgo), const SIGIOT Signal +pkg syscall (linux-arm-cgo), const SIGPOLL Signal +pkg syscall (linux-arm-cgo), const SIGPROF Signal +pkg syscall (linux-arm-cgo), const SIGPWR Signal +pkg syscall (linux-arm-cgo), const SIGSTKFLT Signal +pkg syscall (linux-arm-cgo), const SIGSTOP Signal +pkg syscall (linux-arm-cgo), const SIGSYS Signal +pkg syscall (linux-arm-cgo), const SIGTSTP Signal +pkg syscall (linux-arm-cgo), const SIGTTIN Signal +pkg syscall (linux-arm-cgo), const SIGTTOU Signal +pkg syscall (linux-arm-cgo), const SIGUNUSED Signal +pkg syscall (linux-arm-cgo), const SIGURG Signal +pkg syscall (linux-arm-cgo), const SIGUSR1 Signal +pkg syscall (linux-arm-cgo), const SIGUSR2 Signal +pkg syscall (linux-arm-cgo), const SIGVTALRM Signal +pkg syscall (linux-arm-cgo), const SIGWINCH Signal +pkg syscall (linux-arm-cgo), const SIGXCPU Signal +pkg syscall (linux-arm-cgo), const SIGXFSZ Signal +pkg syscall (linux-arm-cgo), const SIOCADDDLCI ideal-int +pkg syscall (linux-arm-cgo), const SIOCADDMULTI ideal-int +pkg syscall (linux-arm-cgo), const SIOCADDRT ideal-int +pkg syscall (linux-arm-cgo), const SIOCATMARK ideal-int +pkg syscall (linux-arm-cgo), const SIOCDARP ideal-int +pkg syscall (linux-arm-cgo), const SIOCDELDLCI ideal-int +pkg syscall (linux-arm-cgo), const SIOCDELMULTI ideal-int +pkg syscall (linux-arm-cgo), const SIOCDELRT ideal-int +pkg syscall (linux-arm-cgo), const SIOCDEVPRIVATE ideal-int +pkg syscall (linux-arm-cgo), const SIOCDIFADDR ideal-int +pkg syscall (linux-arm-cgo), const SIOCDRARP ideal-int +pkg syscall (linux-arm-cgo), const SIOCGARP ideal-int +pkg syscall (linux-arm-cgo), const SIOCGIFADDR ideal-int +pkg syscall (linux-arm-cgo), const SIOCGIFBR ideal-int +pkg syscall (linux-arm-cgo), const SIOCGIFBRDADDR ideal-int +pkg syscall (linux-arm-cgo), const SIOCGIFCONF ideal-int +pkg syscall (linux-arm-cgo), const SIOCGIFCOUNT ideal-int +pkg syscall (linux-arm-cgo), const SIOCGIFDSTADDR ideal-int +pkg syscall (linux-arm-cgo), const SIOCGIFENCAP ideal-int +pkg syscall (linux-arm-cgo), const SIOCGIFFLAGS ideal-int +pkg syscall (linux-arm-cgo), const SIOCGIFHWADDR ideal-int +pkg syscall (linux-arm-cgo), const SIOCGIFINDEX ideal-int +pkg syscall (linux-arm-cgo), const SIOCGIFMAP ideal-int +pkg syscall (linux-arm-cgo), const SIOCGIFMEM ideal-int +pkg syscall (linux-arm-cgo), const SIOCGIFMETRIC ideal-int +pkg syscall (linux-arm-cgo), const SIOCGIFMTU ideal-int +pkg syscall (linux-arm-cgo), const SIOCGIFNAME ideal-int +pkg syscall (linux-arm-cgo), const SIOCGIFNETMASK ideal-int +pkg syscall (linux-arm-cgo), const SIOCGIFPFLAGS ideal-int +pkg syscall (linux-arm-cgo), const SIOCGIFSLAVE ideal-int +pkg syscall (linux-arm-cgo), const SIOCGIFTXQLEN ideal-int +pkg syscall (linux-arm-cgo), const SIOCGPGRP ideal-int +pkg syscall (linux-arm-cgo), const SIOCGRARP ideal-int +pkg syscall (linux-arm-cgo), const SIOCGSTAMP ideal-int +pkg syscall (linux-arm-cgo), const SIOCGSTAMPNS ideal-int +pkg syscall (linux-arm-cgo), const SIOCPROTOPRIVATE ideal-int +pkg syscall (linux-arm-cgo), const SIOCRTMSG ideal-int +pkg syscall (linux-arm-cgo), const SIOCSARP ideal-int +pkg syscall (linux-arm-cgo), const SIOCSIFADDR ideal-int +pkg syscall (linux-arm-cgo), const SIOCSIFBR ideal-int +pkg syscall (linux-arm-cgo), const SIOCSIFBRDADDR ideal-int +pkg syscall (linux-arm-cgo), const SIOCSIFDSTADDR ideal-int +pkg syscall (linux-arm-cgo), const SIOCSIFENCAP ideal-int +pkg syscall (linux-arm-cgo), const SIOCSIFFLAGS ideal-int +pkg syscall (linux-arm-cgo), const SIOCSIFHWADDR ideal-int +pkg syscall (linux-arm-cgo), const SIOCSIFHWBROADCAST ideal-int +pkg syscall (linux-arm-cgo), const SIOCSIFLINK ideal-int +pkg syscall (linux-arm-cgo), const SIOCSIFMAP ideal-int +pkg syscall (linux-arm-cgo), const SIOCSIFMEM ideal-int +pkg syscall (linux-arm-cgo), const SIOCSIFMETRIC ideal-int +pkg syscall (linux-arm-cgo), const SIOCSIFMTU ideal-int +pkg syscall (linux-arm-cgo), const SIOCSIFNAME ideal-int +pkg syscall (linux-arm-cgo), const SIOCSIFNETMASK ideal-int +pkg syscall (linux-arm-cgo), const SIOCSIFPFLAGS ideal-int +pkg syscall (linux-arm-cgo), const SIOCSIFSLAVE ideal-int +pkg syscall (linux-arm-cgo), const SIOCSIFTXQLEN ideal-int +pkg syscall (linux-arm-cgo), const SIOCSPGRP ideal-int +pkg syscall (linux-arm-cgo), const SIOCSRARP ideal-int +pkg syscall (linux-arm-cgo), const SOCK_CLOEXEC ideal-int +pkg syscall (linux-arm-cgo), const SOCK_DCCP ideal-int +pkg syscall (linux-arm-cgo), const SOCK_NONBLOCK ideal-int +pkg syscall (linux-arm-cgo), const SOCK_PACKET ideal-int +pkg syscall (linux-arm-cgo), const SOCK_RDM ideal-int +pkg syscall (linux-arm-cgo), const SOL_AAL ideal-int +pkg syscall (linux-arm-cgo), const SOL_ATM ideal-int +pkg syscall (linux-arm-cgo), const SOL_DECNET ideal-int +pkg syscall (linux-arm-cgo), const SOL_ICMPV6 ideal-int +pkg syscall (linux-arm-cgo), const SOL_IP ideal-int +pkg syscall (linux-arm-cgo), const SOL_IPV6 ideal-int +pkg syscall (linux-arm-cgo), const SOL_IRDA ideal-int +pkg syscall (linux-arm-cgo), const SOL_PACKET ideal-int +pkg syscall (linux-arm-cgo), const SOL_RAW ideal-int +pkg syscall (linux-arm-cgo), const SOL_TCP ideal-int +pkg syscall (linux-arm-cgo), const SOL_X25 ideal-int +pkg syscall (linux-arm-cgo), const SO_ACCEPTCONN ideal-int +pkg syscall (linux-arm-cgo), const SO_ATTACH_FILTER ideal-int +pkg syscall (linux-arm-cgo), const SO_BINDTODEVICE ideal-int +pkg syscall (linux-arm-cgo), const SO_BSDCOMPAT ideal-int +pkg syscall (linux-arm-cgo), const SO_DEBUG ideal-int +pkg syscall (linux-arm-cgo), const SO_DETACH_FILTER ideal-int +pkg syscall (linux-arm-cgo), const SO_DOMAIN ideal-int +pkg syscall (linux-arm-cgo), const SO_ERROR ideal-int +pkg syscall (linux-arm-cgo), const SO_MARK ideal-int +pkg syscall (linux-arm-cgo), const SO_NO_CHECK ideal-int +pkg syscall (linux-arm-cgo), const SO_OOBINLINE ideal-int +pkg syscall (linux-arm-cgo), const SO_PASSCRED ideal-int +pkg syscall (linux-arm-cgo), const SO_PASSSEC ideal-int +pkg syscall (linux-arm-cgo), const SO_PEERCRED ideal-int +pkg syscall (linux-arm-cgo), const SO_PEERNAME ideal-int +pkg syscall (linux-arm-cgo), const SO_PEERSEC ideal-int +pkg syscall (linux-arm-cgo), const SO_PRIORITY ideal-int +pkg syscall (linux-arm-cgo), const SO_PROTOCOL ideal-int +pkg syscall (linux-arm-cgo), const SO_RCVBUFFORCE ideal-int +pkg syscall (linux-arm-cgo), const SO_RCVLOWAT ideal-int +pkg syscall (linux-arm-cgo), const SO_RCVTIMEO ideal-int +pkg syscall (linux-arm-cgo), const SO_RXQ_OVFL ideal-int +pkg syscall (linux-arm-cgo), const SO_SECURITY_AUTHENTICATION ideal-int +pkg syscall (linux-arm-cgo), const SO_SECURITY_ENCRYPTION_NETWORK ideal-int +pkg syscall (linux-arm-cgo), const SO_SECURITY_ENCRYPTION_TRANSPORT ideal-int +pkg syscall (linux-arm-cgo), const SO_SNDBUFFORCE ideal-int +pkg syscall (linux-arm-cgo), const SO_SNDLOWAT ideal-int +pkg syscall (linux-arm-cgo), const SO_SNDTIMEO ideal-int +pkg syscall (linux-arm-cgo), const SO_TIMESTAMP ideal-int +pkg syscall (linux-arm-cgo), const SO_TIMESTAMPING ideal-int +pkg syscall (linux-arm-cgo), const SO_TIMESTAMPNS ideal-int +pkg syscall (linux-arm-cgo), const SO_TYPE ideal-int +pkg syscall (linux-arm-cgo), const SYS_ACCEPT ideal-int +pkg syscall (linux-arm-cgo), const SYS_ACCEPT4 ideal-int +pkg syscall (linux-arm-cgo), const SYS_ACCESS ideal-int +pkg syscall (linux-arm-cgo), const SYS_ACCT ideal-int +pkg syscall (linux-arm-cgo), const SYS_ADD_KEY ideal-int +pkg syscall (linux-arm-cgo), const SYS_ADJTIMEX ideal-int +pkg syscall (linux-arm-cgo), const SYS_ALARM ideal-int +pkg syscall (linux-arm-cgo), const SYS_ARM_FADVISE64_64 ideal-int +pkg syscall (linux-arm-cgo), const SYS_ARM_SYNC_FILE_RANGE ideal-int +pkg syscall (linux-arm-cgo), const SYS_BDFLUSH ideal-int +pkg syscall (linux-arm-cgo), const SYS_BIND ideal-int +pkg syscall (linux-arm-cgo), const SYS_BRK ideal-int +pkg syscall (linux-arm-cgo), const SYS_CAPGET ideal-int +pkg syscall (linux-arm-cgo), const SYS_CAPSET ideal-int +pkg syscall (linux-arm-cgo), const SYS_CHDIR ideal-int +pkg syscall (linux-arm-cgo), const SYS_CHMOD ideal-int +pkg syscall (linux-arm-cgo), const SYS_CHOWN ideal-int +pkg syscall (linux-arm-cgo), const SYS_CHOWN32 ideal-int +pkg syscall (linux-arm-cgo), const SYS_CHROOT ideal-int +pkg syscall (linux-arm-cgo), const SYS_CLOCK_ADJTIME ideal-int +pkg syscall (linux-arm-cgo), const SYS_CLOCK_GETRES ideal-int +pkg syscall (linux-arm-cgo), const SYS_CLOCK_GETTIME ideal-int +pkg syscall (linux-arm-cgo), const SYS_CLOCK_NANOSLEEP ideal-int +pkg syscall (linux-arm-cgo), const SYS_CLOCK_SETTIME ideal-int +pkg syscall (linux-arm-cgo), const SYS_CLONE ideal-int +pkg syscall (linux-arm-cgo), const SYS_CLOSE ideal-int +pkg syscall (linux-arm-cgo), const SYS_CONNECT ideal-int +pkg syscall (linux-arm-cgo), const SYS_CREAT ideal-int +pkg syscall (linux-arm-cgo), const SYS_DELETE_MODULE ideal-int +pkg syscall (linux-arm-cgo), const SYS_DUP ideal-int +pkg syscall (linux-arm-cgo), const SYS_DUP2 ideal-int +pkg syscall (linux-arm-cgo), const SYS_DUP3 ideal-int +pkg syscall (linux-arm-cgo), const SYS_EPOLL_CREATE ideal-int +pkg syscall (linux-arm-cgo), const SYS_EPOLL_CREATE1 ideal-int +pkg syscall (linux-arm-cgo), const SYS_EPOLL_CTL ideal-int +pkg syscall (linux-arm-cgo), const SYS_EPOLL_PWAIT ideal-int +pkg syscall (linux-arm-cgo), const SYS_EPOLL_WAIT ideal-int +pkg syscall (linux-arm-cgo), const SYS_EVENTFD ideal-int +pkg syscall (linux-arm-cgo), const SYS_EVENTFD2 ideal-int +pkg syscall (linux-arm-cgo), const SYS_EXECVE ideal-int +pkg syscall (linux-arm-cgo), const SYS_EXIT ideal-int +pkg syscall (linux-arm-cgo), const SYS_EXIT_GROUP ideal-int +pkg syscall (linux-arm-cgo), const SYS_FACCESSAT ideal-int +pkg syscall (linux-arm-cgo), const SYS_FALLOCATE ideal-int +pkg syscall (linux-arm-cgo), const SYS_FANOTIFY_INIT ideal-int +pkg syscall (linux-arm-cgo), const SYS_FANOTIFY_MARK ideal-int +pkg syscall (linux-arm-cgo), const SYS_FCHDIR ideal-int +pkg syscall (linux-arm-cgo), const SYS_FCHMOD ideal-int +pkg syscall (linux-arm-cgo), const SYS_FCHMODAT ideal-int +pkg syscall (linux-arm-cgo), const SYS_FCHOWN ideal-int +pkg syscall (linux-arm-cgo), const SYS_FCHOWN32 ideal-int +pkg syscall (linux-arm-cgo), const SYS_FCHOWNAT ideal-int +pkg syscall (linux-arm-cgo), const SYS_FCNTL ideal-int +pkg syscall (linux-arm-cgo), const SYS_FCNTL64 ideal-int +pkg syscall (linux-arm-cgo), const SYS_FDATASYNC ideal-int +pkg syscall (linux-arm-cgo), const SYS_FGETXATTR ideal-int +pkg syscall (linux-arm-cgo), const SYS_FLISTXATTR ideal-int +pkg syscall (linux-arm-cgo), const SYS_FLOCK ideal-int +pkg syscall (linux-arm-cgo), const SYS_FORK ideal-int +pkg syscall (linux-arm-cgo), const SYS_FREMOVEXATTR ideal-int +pkg syscall (linux-arm-cgo), const SYS_FSETXATTR ideal-int +pkg syscall (linux-arm-cgo), const SYS_FSTAT ideal-int +pkg syscall (linux-arm-cgo), const SYS_FSTAT64 ideal-int +pkg syscall (linux-arm-cgo), const SYS_FSTATAT64 ideal-int +pkg syscall (linux-arm-cgo), const SYS_FSTATFS ideal-int +pkg syscall (linux-arm-cgo), const SYS_FSTATFS64 ideal-int +pkg syscall (linux-arm-cgo), const SYS_FSYNC ideal-int +pkg syscall (linux-arm-cgo), const SYS_FTRUNCATE ideal-int +pkg syscall (linux-arm-cgo), const SYS_FTRUNCATE64 ideal-int +pkg syscall (linux-arm-cgo), const SYS_FUTEX ideal-int +pkg syscall (linux-arm-cgo), const SYS_FUTIMESAT ideal-int +pkg syscall (linux-arm-cgo), const SYS_GETCPU ideal-int +pkg syscall (linux-arm-cgo), const SYS_GETCWD ideal-int +pkg syscall (linux-arm-cgo), const SYS_GETDENTS ideal-int +pkg syscall (linux-arm-cgo), const SYS_GETDENTS64 ideal-int +pkg syscall (linux-arm-cgo), const SYS_GETEGID ideal-int +pkg syscall (linux-arm-cgo), const SYS_GETEGID32 ideal-int +pkg syscall (linux-arm-cgo), const SYS_GETEUID ideal-int +pkg syscall (linux-arm-cgo), const SYS_GETEUID32 ideal-int +pkg syscall (linux-arm-cgo), const SYS_GETGID ideal-int +pkg syscall (linux-arm-cgo), const SYS_GETGID32 ideal-int +pkg syscall (linux-arm-cgo), const SYS_GETGROUPS ideal-int +pkg syscall (linux-arm-cgo), const SYS_GETGROUPS32 ideal-int +pkg syscall (linux-arm-cgo), const SYS_GETITIMER ideal-int +pkg syscall (linux-arm-cgo), const SYS_GETPEERNAME ideal-int +pkg syscall (linux-arm-cgo), const SYS_GETPGID ideal-int +pkg syscall (linux-arm-cgo), const SYS_GETPGRP ideal-int +pkg syscall (linux-arm-cgo), const SYS_GETPID ideal-int +pkg syscall (linux-arm-cgo), const SYS_GETPPID ideal-int +pkg syscall (linux-arm-cgo), const SYS_GETPRIORITY ideal-int +pkg syscall (linux-arm-cgo), const SYS_GETRESGID ideal-int +pkg syscall (linux-arm-cgo), const SYS_GETRESGID32 ideal-int +pkg syscall (linux-arm-cgo), const SYS_GETRESUID ideal-int +pkg syscall (linux-arm-cgo), const SYS_GETRESUID32 ideal-int +pkg syscall (linux-arm-cgo), const SYS_GETRLIMIT ideal-int +pkg syscall (linux-arm-cgo), const SYS_GETRUSAGE ideal-int +pkg syscall (linux-arm-cgo), const SYS_GETSID ideal-int +pkg syscall (linux-arm-cgo), const SYS_GETSOCKNAME ideal-int +pkg syscall (linux-arm-cgo), const SYS_GETSOCKOPT ideal-int +pkg syscall (linux-arm-cgo), const SYS_GETTID ideal-int +pkg syscall (linux-arm-cgo), const SYS_GETTIMEOFDAY ideal-int +pkg syscall (linux-arm-cgo), const SYS_GETUID ideal-int +pkg syscall (linux-arm-cgo), const SYS_GETUID32 ideal-int +pkg syscall (linux-arm-cgo), const SYS_GETXATTR ideal-int +pkg syscall (linux-arm-cgo), const SYS_GET_MEMPOLICY ideal-int +pkg syscall (linux-arm-cgo), const SYS_GET_ROBUST_LIST ideal-int +pkg syscall (linux-arm-cgo), const SYS_INIT_MODULE ideal-int +pkg syscall (linux-arm-cgo), const SYS_INOTIFY_ADD_WATCH ideal-int +pkg syscall (linux-arm-cgo), const SYS_INOTIFY_INIT ideal-int +pkg syscall (linux-arm-cgo), const SYS_INOTIFY_INIT1 ideal-int +pkg syscall (linux-arm-cgo), const SYS_INOTIFY_RM_WATCH ideal-int +pkg syscall (linux-arm-cgo), const SYS_IOCTL ideal-int +pkg syscall (linux-arm-cgo), const SYS_IOPRIO_GET ideal-int +pkg syscall (linux-arm-cgo), const SYS_IOPRIO_SET ideal-int +pkg syscall (linux-arm-cgo), const SYS_IO_CANCEL ideal-int +pkg syscall (linux-arm-cgo), const SYS_IO_DESTROY ideal-int +pkg syscall (linux-arm-cgo), const SYS_IO_GETEVENTS ideal-int +pkg syscall (linux-arm-cgo), const SYS_IO_SETUP ideal-int +pkg syscall (linux-arm-cgo), const SYS_IO_SUBMIT ideal-int +pkg syscall (linux-arm-cgo), const SYS_IPC ideal-int +pkg syscall (linux-arm-cgo), const SYS_KEXEC_LOAD ideal-int +pkg syscall (linux-arm-cgo), const SYS_KEYCTL ideal-int +pkg syscall (linux-arm-cgo), const SYS_KILL ideal-int +pkg syscall (linux-arm-cgo), const SYS_LCHOWN ideal-int +pkg syscall (linux-arm-cgo), const SYS_LCHOWN32 ideal-int +pkg syscall (linux-arm-cgo), const SYS_LGETXATTR ideal-int +pkg syscall (linux-arm-cgo), const SYS_LINK ideal-int +pkg syscall (linux-arm-cgo), const SYS_LINKAT ideal-int +pkg syscall (linux-arm-cgo), const SYS_LISTEN ideal-int +pkg syscall (linux-arm-cgo), const SYS_LISTXATTR ideal-int +pkg syscall (linux-arm-cgo), const SYS_LLISTXATTR ideal-int +pkg syscall (linux-arm-cgo), const SYS_LOOKUP_DCOOKIE ideal-int +pkg syscall (linux-arm-cgo), const SYS_LREMOVEXATTR ideal-int +pkg syscall (linux-arm-cgo), const SYS_LSEEK ideal-int +pkg syscall (linux-arm-cgo), const SYS_LSETXATTR ideal-int +pkg syscall (linux-arm-cgo), const SYS_LSTAT ideal-int +pkg syscall (linux-arm-cgo), const SYS_LSTAT64 ideal-int +pkg syscall (linux-arm-cgo), const SYS_MADVISE ideal-int +pkg syscall (linux-arm-cgo), const SYS_MBIND ideal-int +pkg syscall (linux-arm-cgo), const SYS_MINCORE ideal-int +pkg syscall (linux-arm-cgo), const SYS_MKDIR ideal-int +pkg syscall (linux-arm-cgo), const SYS_MKDIRAT ideal-int +pkg syscall (linux-arm-cgo), const SYS_MKNOD ideal-int +pkg syscall (linux-arm-cgo), const SYS_MKNODAT ideal-int +pkg syscall (linux-arm-cgo), const SYS_MLOCK ideal-int +pkg syscall (linux-arm-cgo), const SYS_MLOCKALL ideal-int +pkg syscall (linux-arm-cgo), const SYS_MMAP ideal-int +pkg syscall (linux-arm-cgo), const SYS_MMAP2 ideal-int +pkg syscall (linux-arm-cgo), const SYS_MOUNT ideal-int +pkg syscall (linux-arm-cgo), const SYS_MOVE_PAGES ideal-int +pkg syscall (linux-arm-cgo), const SYS_MPROTECT ideal-int +pkg syscall (linux-arm-cgo), const SYS_MQ_GETSETATTR ideal-int +pkg syscall (linux-arm-cgo), const SYS_MQ_NOTIFY ideal-int +pkg syscall (linux-arm-cgo), const SYS_MQ_OPEN ideal-int +pkg syscall (linux-arm-cgo), const SYS_MQ_TIMEDRECEIVE ideal-int +pkg syscall (linux-arm-cgo), const SYS_MQ_TIMEDSEND ideal-int +pkg syscall (linux-arm-cgo), const SYS_MQ_UNLINK ideal-int +pkg syscall (linux-arm-cgo), const SYS_MREMAP ideal-int +pkg syscall (linux-arm-cgo), const SYS_MSGCTL ideal-int +pkg syscall (linux-arm-cgo), const SYS_MSGGET ideal-int +pkg syscall (linux-arm-cgo), const SYS_MSGRCV ideal-int +pkg syscall (linux-arm-cgo), const SYS_MSGSND ideal-int +pkg syscall (linux-arm-cgo), const SYS_MSYNC ideal-int +pkg syscall (linux-arm-cgo), const SYS_MUNLOCK ideal-int +pkg syscall (linux-arm-cgo), const SYS_MUNLOCKALL ideal-int +pkg syscall (linux-arm-cgo), const SYS_MUNMAP ideal-int +pkg syscall (linux-arm-cgo), const SYS_NAME_TO_HANDLE_AT ideal-int +pkg syscall (linux-arm-cgo), const SYS_NANOSLEEP ideal-int +pkg syscall (linux-arm-cgo), const SYS_NFSSERVCTL ideal-int +pkg syscall (linux-arm-cgo), const SYS_NICE ideal-int +pkg syscall (linux-arm-cgo), const SYS_OABI_SYSCALL_BASE ideal-int +pkg syscall (linux-arm-cgo), const SYS_OPEN ideal-int +pkg syscall (linux-arm-cgo), const SYS_OPENAT ideal-int +pkg syscall (linux-arm-cgo), const SYS_OPEN_BY_HANDLE_AT ideal-int +pkg syscall (linux-arm-cgo), const SYS_PAUSE ideal-int +pkg syscall (linux-arm-cgo), const SYS_PCICONFIG_IOBASE ideal-int +pkg syscall (linux-arm-cgo), const SYS_PCICONFIG_READ ideal-int +pkg syscall (linux-arm-cgo), const SYS_PCICONFIG_WRITE ideal-int +pkg syscall (linux-arm-cgo), const SYS_PERF_EVENT_OPEN ideal-int +pkg syscall (linux-arm-cgo), const SYS_PERSONALITY ideal-int +pkg syscall (linux-arm-cgo), const SYS_PIPE ideal-int +pkg syscall (linux-arm-cgo), const SYS_PIPE2 ideal-int +pkg syscall (linux-arm-cgo), const SYS_PIVOT_ROOT ideal-int +pkg syscall (linux-arm-cgo), const SYS_POLL ideal-int +pkg syscall (linux-arm-cgo), const SYS_PPOLL ideal-int +pkg syscall (linux-arm-cgo), const SYS_PRCTL ideal-int +pkg syscall (linux-arm-cgo), const SYS_PREAD64 ideal-int +pkg syscall (linux-arm-cgo), const SYS_PREADV ideal-int +pkg syscall (linux-arm-cgo), const SYS_PRLIMIT64 ideal-int +pkg syscall (linux-arm-cgo), const SYS_PROCESS_VM_READV ideal-int +pkg syscall (linux-arm-cgo), const SYS_PROCESS_VM_WRITEV ideal-int +pkg syscall (linux-arm-cgo), const SYS_PSELECT6 ideal-int +pkg syscall (linux-arm-cgo), const SYS_PTRACE ideal-int +pkg syscall (linux-arm-cgo), const SYS_PWRITE64 ideal-int +pkg syscall (linux-arm-cgo), const SYS_PWRITEV ideal-int +pkg syscall (linux-arm-cgo), const SYS_QUOTACTL ideal-int +pkg syscall (linux-arm-cgo), const SYS_READ ideal-int +pkg syscall (linux-arm-cgo), const SYS_READAHEAD ideal-int +pkg syscall (linux-arm-cgo), const SYS_READDIR ideal-int +pkg syscall (linux-arm-cgo), const SYS_READLINK ideal-int +pkg syscall (linux-arm-cgo), const SYS_READLINKAT ideal-int +pkg syscall (linux-arm-cgo), const SYS_READV ideal-int +pkg syscall (linux-arm-cgo), const SYS_REBOOT ideal-int +pkg syscall (linux-arm-cgo), const SYS_RECV ideal-int +pkg syscall (linux-arm-cgo), const SYS_RECVFROM ideal-int +pkg syscall (linux-arm-cgo), const SYS_RECVMMSG ideal-int +pkg syscall (linux-arm-cgo), const SYS_RECVMSG ideal-int +pkg syscall (linux-arm-cgo), const SYS_REMAP_FILE_PAGES ideal-int +pkg syscall (linux-arm-cgo), const SYS_REMOVEXATTR ideal-int +pkg syscall (linux-arm-cgo), const SYS_RENAME ideal-int +pkg syscall (linux-arm-cgo), const SYS_RENAMEAT ideal-int +pkg syscall (linux-arm-cgo), const SYS_REQUEST_KEY ideal-int +pkg syscall (linux-arm-cgo), const SYS_RESTART_SYSCALL ideal-int +pkg syscall (linux-arm-cgo), const SYS_RMDIR ideal-int +pkg syscall (linux-arm-cgo), const SYS_RT_SIGACTION ideal-int +pkg syscall (linux-arm-cgo), const SYS_RT_SIGPENDING ideal-int +pkg syscall (linux-arm-cgo), const SYS_RT_SIGPROCMASK ideal-int +pkg syscall (linux-arm-cgo), const SYS_RT_SIGQUEUEINFO ideal-int +pkg syscall (linux-arm-cgo), const SYS_RT_SIGRETURN ideal-int +pkg syscall (linux-arm-cgo), const SYS_RT_SIGSUSPEND ideal-int +pkg syscall (linux-arm-cgo), const SYS_RT_SIGTIMEDWAIT ideal-int +pkg syscall (linux-arm-cgo), const SYS_RT_TGSIGQUEUEINFO ideal-int +pkg syscall (linux-arm-cgo), const SYS_SCHED_GETAFFINITY ideal-int +pkg syscall (linux-arm-cgo), const SYS_SCHED_GETPARAM ideal-int +pkg syscall (linux-arm-cgo), const SYS_SCHED_GETSCHEDULER ideal-int +pkg syscall (linux-arm-cgo), const SYS_SCHED_GET_PRIORITY_MAX ideal-int +pkg syscall (linux-arm-cgo), const SYS_SCHED_GET_PRIORITY_MIN ideal-int +pkg syscall (linux-arm-cgo), const SYS_SCHED_RR_GET_INTERVAL ideal-int +pkg syscall (linux-arm-cgo), const SYS_SCHED_SETAFFINITY ideal-int +pkg syscall (linux-arm-cgo), const SYS_SCHED_SETPARAM ideal-int +pkg syscall (linux-arm-cgo), const SYS_SCHED_SETSCHEDULER ideal-int +pkg syscall (linux-arm-cgo), const SYS_SCHED_YIELD ideal-int +pkg syscall (linux-arm-cgo), const SYS_SELECT ideal-int +pkg syscall (linux-arm-cgo), const SYS_SEMCTL ideal-int +pkg syscall (linux-arm-cgo), const SYS_SEMGET ideal-int +pkg syscall (linux-arm-cgo), const SYS_SEMOP ideal-int +pkg syscall (linux-arm-cgo), const SYS_SEMTIMEDOP ideal-int +pkg syscall (linux-arm-cgo), const SYS_SEND ideal-int +pkg syscall (linux-arm-cgo), const SYS_SENDFILE ideal-int +pkg syscall (linux-arm-cgo), const SYS_SENDFILE64 ideal-int +pkg syscall (linux-arm-cgo), const SYS_SENDMMSG ideal-int +pkg syscall (linux-arm-cgo), const SYS_SENDMSG ideal-int +pkg syscall (linux-arm-cgo), const SYS_SENDTO ideal-int +pkg syscall (linux-arm-cgo), const SYS_SETDOMAINNAME ideal-int +pkg syscall (linux-arm-cgo), const SYS_SETFSGID ideal-int +pkg syscall (linux-arm-cgo), const SYS_SETFSGID32 ideal-int +pkg syscall (linux-arm-cgo), const SYS_SETFSUID ideal-int +pkg syscall (linux-arm-cgo), const SYS_SETFSUID32 ideal-int +pkg syscall (linux-arm-cgo), const SYS_SETGID ideal-int +pkg syscall (linux-arm-cgo), const SYS_SETGID32 ideal-int +pkg syscall (linux-arm-cgo), const SYS_SETGROUPS ideal-int +pkg syscall (linux-arm-cgo), const SYS_SETGROUPS32 ideal-int +pkg syscall (linux-arm-cgo), const SYS_SETHOSTNAME ideal-int +pkg syscall (linux-arm-cgo), const SYS_SETITIMER ideal-int +pkg syscall (linux-arm-cgo), const SYS_SETNS ideal-int +pkg syscall (linux-arm-cgo), const SYS_SETPGID ideal-int +pkg syscall (linux-arm-cgo), const SYS_SETPRIORITY ideal-int +pkg syscall (linux-arm-cgo), const SYS_SETREGID ideal-int +pkg syscall (linux-arm-cgo), const SYS_SETREGID32 ideal-int +pkg syscall (linux-arm-cgo), const SYS_SETRESGID ideal-int +pkg syscall (linux-arm-cgo), const SYS_SETRESGID32 ideal-int +pkg syscall (linux-arm-cgo), const SYS_SETRESUID ideal-int +pkg syscall (linux-arm-cgo), const SYS_SETRESUID32 ideal-int +pkg syscall (linux-arm-cgo), const SYS_SETREUID ideal-int +pkg syscall (linux-arm-cgo), const SYS_SETREUID32 ideal-int +pkg syscall (linux-arm-cgo), const SYS_SETRLIMIT ideal-int +pkg syscall (linux-arm-cgo), const SYS_SETSID ideal-int +pkg syscall (linux-arm-cgo), const SYS_SETSOCKOPT ideal-int +pkg syscall (linux-arm-cgo), const SYS_SETTIMEOFDAY ideal-int +pkg syscall (linux-arm-cgo), const SYS_SETUID ideal-int +pkg syscall (linux-arm-cgo), const SYS_SETUID32 ideal-int +pkg syscall (linux-arm-cgo), const SYS_SETXATTR ideal-int +pkg syscall (linux-arm-cgo), const SYS_SET_MEMPOLICY ideal-int +pkg syscall (linux-arm-cgo), const SYS_SET_ROBUST_LIST ideal-int +pkg syscall (linux-arm-cgo), const SYS_SET_TID_ADDRESS ideal-int +pkg syscall (linux-arm-cgo), const SYS_SHMAT ideal-int +pkg syscall (linux-arm-cgo), const SYS_SHMCTL ideal-int +pkg syscall (linux-arm-cgo), const SYS_SHMDT ideal-int +pkg syscall (linux-arm-cgo), const SYS_SHMGET ideal-int +pkg syscall (linux-arm-cgo), const SYS_SHUTDOWN ideal-int +pkg syscall (linux-arm-cgo), const SYS_SIGACTION ideal-int +pkg syscall (linux-arm-cgo), const SYS_SIGALTSTACK ideal-int +pkg syscall (linux-arm-cgo), const SYS_SIGNALFD ideal-int +pkg syscall (linux-arm-cgo), const SYS_SIGNALFD4 ideal-int +pkg syscall (linux-arm-cgo), const SYS_SIGPENDING ideal-int +pkg syscall (linux-arm-cgo), const SYS_SIGPROCMASK ideal-int +pkg syscall (linux-arm-cgo), const SYS_SIGRETURN ideal-int +pkg syscall (linux-arm-cgo), const SYS_SIGSUSPEND ideal-int +pkg syscall (linux-arm-cgo), const SYS_SOCKET ideal-int +pkg syscall (linux-arm-cgo), const SYS_SOCKETCALL ideal-int +pkg syscall (linux-arm-cgo), const SYS_SOCKETPAIR ideal-int +pkg syscall (linux-arm-cgo), const SYS_SPLICE ideal-int +pkg syscall (linux-arm-cgo), const SYS_STAT ideal-int +pkg syscall (linux-arm-cgo), const SYS_STAT64 ideal-int +pkg syscall (linux-arm-cgo), const SYS_STATFS ideal-int +pkg syscall (linux-arm-cgo), const SYS_STATFS64 ideal-int +pkg syscall (linux-arm-cgo), const SYS_STIME ideal-int +pkg syscall (linux-arm-cgo), const SYS_SWAPOFF ideal-int +pkg syscall (linux-arm-cgo), const SYS_SWAPON ideal-int +pkg syscall (linux-arm-cgo), const SYS_SYMLINK ideal-int +pkg syscall (linux-arm-cgo), const SYS_SYMLINKAT ideal-int +pkg syscall (linux-arm-cgo), const SYS_SYNC ideal-int +pkg syscall (linux-arm-cgo), const SYS_SYNCFS ideal-int +pkg syscall (linux-arm-cgo), const SYS_SYSCALL ideal-int +pkg syscall (linux-arm-cgo), const SYS_SYSCALL_BASE ideal-int +pkg syscall (linux-arm-cgo), const SYS_SYSFS ideal-int +pkg syscall (linux-arm-cgo), const SYS_SYSINFO ideal-int +pkg syscall (linux-arm-cgo), const SYS_SYSLOG ideal-int +pkg syscall (linux-arm-cgo), const SYS_TEE ideal-int +pkg syscall (linux-arm-cgo), const SYS_TGKILL ideal-int +pkg syscall (linux-arm-cgo), const SYS_TIME ideal-int +pkg syscall (linux-arm-cgo), const SYS_TIMERFD_CREATE ideal-int +pkg syscall (linux-arm-cgo), const SYS_TIMERFD_GETTIME ideal-int +pkg syscall (linux-arm-cgo), const SYS_TIMERFD_SETTIME ideal-int +pkg syscall (linux-arm-cgo), const SYS_TIMER_CREATE ideal-int +pkg syscall (linux-arm-cgo), const SYS_TIMER_DELETE ideal-int +pkg syscall (linux-arm-cgo), const SYS_TIMER_GETOVERRUN ideal-int +pkg syscall (linux-arm-cgo), const SYS_TIMER_GETTIME ideal-int +pkg syscall (linux-arm-cgo), const SYS_TIMER_SETTIME ideal-int +pkg syscall (linux-arm-cgo), const SYS_TIMES ideal-int +pkg syscall (linux-arm-cgo), const SYS_TKILL ideal-int +pkg syscall (linux-arm-cgo), const SYS_TRUNCATE ideal-int +pkg syscall (linux-arm-cgo), const SYS_TRUNCATE64 ideal-int +pkg syscall (linux-arm-cgo), const SYS_UGETRLIMIT ideal-int +pkg syscall (linux-arm-cgo), const SYS_UMASK ideal-int +pkg syscall (linux-arm-cgo), const SYS_UMOUNT ideal-int +pkg syscall (linux-arm-cgo), const SYS_UMOUNT2 ideal-int +pkg syscall (linux-arm-cgo), const SYS_UNAME ideal-int +pkg syscall (linux-arm-cgo), const SYS_UNLINK ideal-int +pkg syscall (linux-arm-cgo), const SYS_UNLINKAT ideal-int +pkg syscall (linux-arm-cgo), const SYS_UNSHARE ideal-int +pkg syscall (linux-arm-cgo), const SYS_USELIB ideal-int +pkg syscall (linux-arm-cgo), const SYS_USTAT ideal-int +pkg syscall (linux-arm-cgo), const SYS_UTIME ideal-int +pkg syscall (linux-arm-cgo), const SYS_UTIMENSAT ideal-int +pkg syscall (linux-arm-cgo), const SYS_UTIMES ideal-int +pkg syscall (linux-arm-cgo), const SYS_VFORK ideal-int +pkg syscall (linux-arm-cgo), const SYS_VHANGUP ideal-int +pkg syscall (linux-arm-cgo), const SYS_VMSPLICE ideal-int +pkg syscall (linux-arm-cgo), const SYS_VSERVER ideal-int +pkg syscall (linux-arm-cgo), const SYS_WAIT4 ideal-int +pkg syscall (linux-arm-cgo), const SYS_WAITID ideal-int +pkg syscall (linux-arm-cgo), const SYS_WRITE ideal-int +pkg syscall (linux-arm-cgo), const SYS_WRITEV ideal-int +pkg syscall (linux-arm-cgo), const SYS__LLSEEK ideal-int +pkg syscall (linux-arm-cgo), const SYS__NEWSELECT ideal-int +pkg syscall (linux-arm-cgo), const SYS__SYSCTL ideal-int +pkg syscall (linux-arm-cgo), const S_BLKSIZE ideal-int +pkg syscall (linux-arm-cgo), const S_IEXEC ideal-int +pkg syscall (linux-arm-cgo), const S_IREAD ideal-int +pkg syscall (linux-arm-cgo), const S_IRGRP ideal-int +pkg syscall (linux-arm-cgo), const S_IROTH ideal-int +pkg syscall (linux-arm-cgo), const S_IRWXG ideal-int +pkg syscall (linux-arm-cgo), const S_IRWXO ideal-int +pkg syscall (linux-arm-cgo), const S_IRWXU ideal-int +pkg syscall (linux-arm-cgo), const S_IWGRP ideal-int +pkg syscall (linux-arm-cgo), const S_IWOTH ideal-int +pkg syscall (linux-arm-cgo), const S_IWRITE ideal-int +pkg syscall (linux-arm-cgo), const S_IXGRP ideal-int +pkg syscall (linux-arm-cgo), const S_IXOTH ideal-int +pkg syscall (linux-arm-cgo), const SizeofCmsghdr ideal-int +pkg syscall (linux-arm-cgo), const SizeofICMPv6Filter = 32 +pkg syscall (linux-arm-cgo), const SizeofICMPv6Filter ideal-int +pkg syscall (linux-arm-cgo), const SizeofIPMreq ideal-int +pkg syscall (linux-arm-cgo), const SizeofIPMreqn ideal-int +pkg syscall (linux-arm-cgo), const SizeofIPv6MTUInfo = 32 +pkg syscall (linux-arm-cgo), const SizeofIPv6MTUInfo ideal-int +pkg syscall (linux-arm-cgo), const SizeofIPv6Mreq ideal-int +pkg syscall (linux-arm-cgo), const SizeofIfAddrmsg ideal-int +pkg syscall (linux-arm-cgo), const SizeofIfInfomsg ideal-int +pkg syscall (linux-arm-cgo), const SizeofInet4Pktinfo ideal-int +pkg syscall (linux-arm-cgo), const SizeofInet6Pktinfo ideal-int +pkg syscall (linux-arm-cgo), const SizeofInotifyEvent ideal-int +pkg syscall (linux-arm-cgo), const SizeofLinger ideal-int +pkg syscall (linux-arm-cgo), const SizeofMsghdr ideal-int +pkg syscall (linux-arm-cgo), const SizeofNlAttr ideal-int +pkg syscall (linux-arm-cgo), const SizeofNlMsgerr ideal-int +pkg syscall (linux-arm-cgo), const SizeofNlMsghdr ideal-int +pkg syscall (linux-arm-cgo), const SizeofRtAttr ideal-int +pkg syscall (linux-arm-cgo), const SizeofRtGenmsg ideal-int +pkg syscall (linux-arm-cgo), const SizeofRtMsg ideal-int +pkg syscall (linux-arm-cgo), const SizeofRtNexthop ideal-int +pkg syscall (linux-arm-cgo), const SizeofSockFilter ideal-int +pkg syscall (linux-arm-cgo), const SizeofSockFprog ideal-int +pkg syscall (linux-arm-cgo), const SizeofSockaddrAny ideal-int +pkg syscall (linux-arm-cgo), const SizeofSockaddrInet4 ideal-int +pkg syscall (linux-arm-cgo), const SizeofSockaddrInet6 ideal-int +pkg syscall (linux-arm-cgo), const SizeofSockaddrLinklayer ideal-int +pkg syscall (linux-arm-cgo), const SizeofSockaddrNetlink ideal-int +pkg syscall (linux-arm-cgo), const SizeofSockaddrUnix ideal-int +pkg syscall (linux-arm-cgo), const SizeofTCPInfo ideal-int +pkg syscall (linux-arm-cgo), const SizeofUcred ideal-int +pkg syscall (linux-arm-cgo), const TCGETS ideal-int +pkg syscall (linux-arm-cgo), const TCIFLUSH = 0 +pkg syscall (linux-arm-cgo), const TCIFLUSH ideal-int +pkg syscall (linux-arm-cgo), const TCIOFLUSH = 2 +pkg syscall (linux-arm-cgo), const TCIOFLUSH ideal-int +pkg syscall (linux-arm-cgo), const TCOFLUSH = 1 +pkg syscall (linux-arm-cgo), const TCOFLUSH ideal-int +pkg syscall (linux-arm-cgo), const TCP_CONGESTION ideal-int +pkg syscall (linux-arm-cgo), const TCP_CORK ideal-int +pkg syscall (linux-arm-cgo), const TCP_DEFER_ACCEPT ideal-int +pkg syscall (linux-arm-cgo), const TCP_INFO ideal-int +pkg syscall (linux-arm-cgo), const TCP_KEEPCNT ideal-int +pkg syscall (linux-arm-cgo), const TCP_KEEPIDLE ideal-int +pkg syscall (linux-arm-cgo), const TCP_KEEPINTVL ideal-int +pkg syscall (linux-arm-cgo), const TCP_LINGER2 ideal-int +pkg syscall (linux-arm-cgo), const TCP_MAXSEG ideal-int +pkg syscall (linux-arm-cgo), const TCP_MAXWIN ideal-int +pkg syscall (linux-arm-cgo), const TCP_MAX_WINSHIFT ideal-int +pkg syscall (linux-arm-cgo), const TCP_MD5SIG ideal-int +pkg syscall (linux-arm-cgo), const TCP_MD5SIG_MAXKEYLEN ideal-int +pkg syscall (linux-arm-cgo), const TCP_MSS ideal-int +pkg syscall (linux-arm-cgo), const TCP_QUICKACK ideal-int +pkg syscall (linux-arm-cgo), const TCP_SYNCNT ideal-int +pkg syscall (linux-arm-cgo), const TCP_WINDOW_CLAMP ideal-int +pkg syscall (linux-arm-cgo), const TCSETS ideal-int +pkg syscall (linux-arm-cgo), const TIOCCBRK ideal-int +pkg syscall (linux-arm-cgo), const TIOCCONS ideal-int +pkg syscall (linux-arm-cgo), const TIOCEXCL ideal-int +pkg syscall (linux-arm-cgo), const TIOCGDEV ideal-int +pkg syscall (linux-arm-cgo), const TIOCGETD ideal-int +pkg syscall (linux-arm-cgo), const TIOCGICOUNT ideal-int +pkg syscall (linux-arm-cgo), const TIOCGLCKTRMIOS ideal-int +pkg syscall (linux-arm-cgo), const TIOCGPGRP ideal-int +pkg syscall (linux-arm-cgo), const TIOCGPTN ideal-int +pkg syscall (linux-arm-cgo), const TIOCGRS485 ideal-int +pkg syscall (linux-arm-cgo), const TIOCGSERIAL ideal-int +pkg syscall (linux-arm-cgo), const TIOCGSID ideal-int +pkg syscall (linux-arm-cgo), const TIOCGSOFTCAR ideal-int +pkg syscall (linux-arm-cgo), const TIOCGWINSZ ideal-int +pkg syscall (linux-arm-cgo), const TIOCINQ ideal-int +pkg syscall (linux-arm-cgo), const TIOCLINUX ideal-int +pkg syscall (linux-arm-cgo), const TIOCMBIC ideal-int +pkg syscall (linux-arm-cgo), const TIOCMBIS ideal-int +pkg syscall (linux-arm-cgo), const TIOCMGET ideal-int +pkg syscall (linux-arm-cgo), const TIOCMIWAIT ideal-int +pkg syscall (linux-arm-cgo), const TIOCMSET ideal-int +pkg syscall (linux-arm-cgo), const TIOCM_CAR ideal-int +pkg syscall (linux-arm-cgo), const TIOCM_CD ideal-int +pkg syscall (linux-arm-cgo), const TIOCM_CTS ideal-int +pkg syscall (linux-arm-cgo), const TIOCM_DSR ideal-int +pkg syscall (linux-arm-cgo), const TIOCM_DTR ideal-int +pkg syscall (linux-arm-cgo), const TIOCM_LE ideal-int +pkg syscall (linux-arm-cgo), const TIOCM_RI ideal-int +pkg syscall (linux-arm-cgo), const TIOCM_RNG ideal-int +pkg syscall (linux-arm-cgo), const TIOCM_RTS ideal-int +pkg syscall (linux-arm-cgo), const TIOCM_SR ideal-int +pkg syscall (linux-arm-cgo), const TIOCM_ST ideal-int +pkg syscall (linux-arm-cgo), const TIOCNOTTY ideal-int +pkg syscall (linux-arm-cgo), const TIOCNXCL ideal-int +pkg syscall (linux-arm-cgo), const TIOCOUTQ ideal-int +pkg syscall (linux-arm-cgo), const TIOCPKT ideal-int +pkg syscall (linux-arm-cgo), const TIOCPKT_DATA ideal-int +pkg syscall (linux-arm-cgo), const TIOCPKT_DOSTOP ideal-int +pkg syscall (linux-arm-cgo), const TIOCPKT_FLUSHREAD ideal-int +pkg syscall (linux-arm-cgo), const TIOCPKT_FLUSHWRITE ideal-int +pkg syscall (linux-arm-cgo), const TIOCPKT_IOCTL ideal-int +pkg syscall (linux-arm-cgo), const TIOCPKT_NOSTOP ideal-int +pkg syscall (linux-arm-cgo), const TIOCPKT_START ideal-int +pkg syscall (linux-arm-cgo), const TIOCPKT_STOP ideal-int +pkg syscall (linux-arm-cgo), const TIOCSBRK ideal-int +pkg syscall (linux-arm-cgo), const TIOCSCTTY ideal-int +pkg syscall (linux-arm-cgo), const TIOCSERCONFIG ideal-int +pkg syscall (linux-arm-cgo), const TIOCSERGETLSR ideal-int +pkg syscall (linux-arm-cgo), const TIOCSERGETMULTI ideal-int +pkg syscall (linux-arm-cgo), const TIOCSERGSTRUCT ideal-int +pkg syscall (linux-arm-cgo), const TIOCSERGWILD ideal-int +pkg syscall (linux-arm-cgo), const TIOCSERSETMULTI ideal-int +pkg syscall (linux-arm-cgo), const TIOCSERSWILD ideal-int +pkg syscall (linux-arm-cgo), const TIOCSER_TEMT ideal-int +pkg syscall (linux-arm-cgo), const TIOCSETD ideal-int +pkg syscall (linux-arm-cgo), const TIOCSIG ideal-int +pkg syscall (linux-arm-cgo), const TIOCSLCKTRMIOS ideal-int +pkg syscall (linux-arm-cgo), const TIOCSPGRP ideal-int +pkg syscall (linux-arm-cgo), const TIOCSPTLCK ideal-int +pkg syscall (linux-arm-cgo), const TIOCSRS485 ideal-int +pkg syscall (linux-arm-cgo), const TIOCSSERIAL ideal-int +pkg syscall (linux-arm-cgo), const TIOCSSOFTCAR ideal-int +pkg syscall (linux-arm-cgo), const TIOCSTI ideal-int +pkg syscall (linux-arm-cgo), const TIOCSWINSZ ideal-int +pkg syscall (linux-arm-cgo), const TIOCVHANGUP ideal-int +pkg syscall (linux-arm-cgo), const TOSTOP ideal-int +pkg syscall (linux-arm-cgo), const TUNATTACHFILTER ideal-int +pkg syscall (linux-arm-cgo), const TUNDETACHFILTER ideal-int +pkg syscall (linux-arm-cgo), const TUNGETFEATURES ideal-int +pkg syscall (linux-arm-cgo), const TUNGETIFF ideal-int +pkg syscall (linux-arm-cgo), const TUNGETSNDBUF ideal-int +pkg syscall (linux-arm-cgo), const TUNGETVNETHDRSZ ideal-int +pkg syscall (linux-arm-cgo), const TUNSETDEBUG ideal-int +pkg syscall (linux-arm-cgo), const TUNSETGROUP ideal-int +pkg syscall (linux-arm-cgo), const TUNSETIFF ideal-int +pkg syscall (linux-arm-cgo), const TUNSETLINK ideal-int +pkg syscall (linux-arm-cgo), const TUNSETNOCSUM ideal-int +pkg syscall (linux-arm-cgo), const TUNSETOFFLOAD ideal-int +pkg syscall (linux-arm-cgo), const TUNSETOWNER ideal-int +pkg syscall (linux-arm-cgo), const TUNSETPERSIST ideal-int +pkg syscall (linux-arm-cgo), const TUNSETSNDBUF ideal-int +pkg syscall (linux-arm-cgo), const TUNSETTXFILTER ideal-int +pkg syscall (linux-arm-cgo), const TUNSETVNETHDRSZ ideal-int +pkg syscall (linux-arm-cgo), const VDISCARD ideal-int +pkg syscall (linux-arm-cgo), const VEOF ideal-int +pkg syscall (linux-arm-cgo), const VEOL ideal-int +pkg syscall (linux-arm-cgo), const VEOL2 ideal-int +pkg syscall (linux-arm-cgo), const VERASE ideal-int +pkg syscall (linux-arm-cgo), const VINTR ideal-int +pkg syscall (linux-arm-cgo), const VKILL ideal-int +pkg syscall (linux-arm-cgo), const VLNEXT ideal-int +pkg syscall (linux-arm-cgo), const VMIN ideal-int +pkg syscall (linux-arm-cgo), const VQUIT ideal-int +pkg syscall (linux-arm-cgo), const VREPRINT ideal-int +pkg syscall (linux-arm-cgo), const VSTART ideal-int +pkg syscall (linux-arm-cgo), const VSTOP ideal-int +pkg syscall (linux-arm-cgo), const VSUSP ideal-int +pkg syscall (linux-arm-cgo), const VSWTC ideal-int +pkg syscall (linux-arm-cgo), const VTIME ideal-int +pkg syscall (linux-arm-cgo), const VWERASE ideal-int +pkg syscall (linux-arm-cgo), const WALL ideal-int +pkg syscall (linux-arm-cgo), const WCLONE ideal-int +pkg syscall (linux-arm-cgo), const WCONTINUED ideal-int +pkg syscall (linux-arm-cgo), const WEXITED ideal-int +pkg syscall (linux-arm-cgo), const WNOHANG ideal-int +pkg syscall (linux-arm-cgo), const WNOTHREAD ideal-int +pkg syscall (linux-arm-cgo), const WNOWAIT ideal-int +pkg syscall (linux-arm-cgo), const WORDSIZE ideal-int +pkg syscall (linux-arm-cgo), const WSTOPPED ideal-int +pkg syscall (linux-arm-cgo), const WUNTRACED ideal-int +pkg syscall (linux-arm-cgo), const XCASE ideal-int +pkg syscall (linux-arm-cgo), func Accept(int) (int, Sockaddr, error) +pkg syscall (linux-arm-cgo), func Accept4(int, int) (int, Sockaddr, error) +pkg syscall (linux-arm-cgo), func Access(string, uint32) error +pkg syscall (linux-arm-cgo), func Acct(string) error +pkg syscall (linux-arm-cgo), func Adjtimex(*Timex) (int, error) +pkg syscall (linux-arm-cgo), func AttachLsf(int, []SockFilter) error +pkg syscall (linux-arm-cgo), func Bind(int, Sockaddr) error +pkg syscall (linux-arm-cgo), func BindToDevice(int, string) error +pkg syscall (linux-arm-cgo), func Chroot(string) error +pkg syscall (linux-arm-cgo), func Close(int) error +pkg syscall (linux-arm-cgo), func CloseOnExec(int) +pkg syscall (linux-arm-cgo), func CmsgLen(int) int +pkg syscall (linux-arm-cgo), func CmsgSpace(int) int +pkg syscall (linux-arm-cgo), func Connect(int, Sockaddr) error +pkg syscall (linux-arm-cgo), func Creat(string, uint32) (int, error) +pkg syscall (linux-arm-cgo), func DetachLsf(int) error +pkg syscall (linux-arm-cgo), func Dup(int) (int, error) +pkg syscall (linux-arm-cgo), func Dup2(int, int) error +pkg syscall (linux-arm-cgo), func Dup3(int, int, int) error +pkg syscall (linux-arm-cgo), func EpollCreate(int) (int, error) +pkg syscall (linux-arm-cgo), func EpollCreate1(int) (int, error) +pkg syscall (linux-arm-cgo), func EpollCtl(int, int, int, *EpollEvent) error +pkg syscall (linux-arm-cgo), func EpollWait(int, []EpollEvent, int) (int, error) +pkg syscall (linux-arm-cgo), func Faccessat(int, string, uint32, int) error +pkg syscall (linux-arm-cgo), func Fallocate(int, uint32, int64, int64) error +pkg syscall (linux-arm-cgo), func Fchdir(int) error +pkg syscall (linux-arm-cgo), func Fchmod(int, uint32) error +pkg syscall (linux-arm-cgo), func Fchmodat(int, string, uint32, int) error +pkg syscall (linux-arm-cgo), func Fchown(int, int, int) error +pkg syscall (linux-arm-cgo), func Fchownat(int, string, int, int, int) error +pkg syscall (linux-arm-cgo), func Fdatasync(int) error +pkg syscall (linux-arm-cgo), func Flock(int, int) error +pkg syscall (linux-arm-cgo), func ForkExec(string, []string, *ProcAttr) (int, error) +pkg syscall (linux-arm-cgo), func Fstat(int, *Stat_t) error +pkg syscall (linux-arm-cgo), func Fstatfs(int, *Statfs_t) error +pkg syscall (linux-arm-cgo), func Fsync(int) error +pkg syscall (linux-arm-cgo), func Ftruncate(int, int64) error +pkg syscall (linux-arm-cgo), func Futimes(int, []Timeval) error +pkg syscall (linux-arm-cgo), func Futimesat(int, string, []Timeval) error +pkg syscall (linux-arm-cgo), func Getcwd([]uint8) (int, error) +pkg syscall (linux-arm-cgo), func Getdents(int, []uint8) (int, error) +pkg syscall (linux-arm-cgo), func Getpeername(int) (Sockaddr, error) +pkg syscall (linux-arm-cgo), func Getpgid(int) (int, error) +pkg syscall (linux-arm-cgo), func Getpgrp() int +pkg syscall (linux-arm-cgo), func Getpriority(int, int) (int, error) +pkg syscall (linux-arm-cgo), func Getrlimit(int, *Rlimit) error +pkg syscall (linux-arm-cgo), func Getrusage(int, *Rusage) error +pkg syscall (linux-arm-cgo), func Getsockname(int) (Sockaddr, error) +pkg syscall (linux-arm-cgo), func GetsockoptICMPv6Filter(int, int, int) (*ICMPv6Filter, error) +pkg syscall (linux-arm-cgo), func GetsockoptIPMreq(int, int, int) (*IPMreq, error) +pkg syscall (linux-arm-cgo), func GetsockoptIPMreqn(int, int, int) (*IPMreqn, error) +pkg syscall (linux-arm-cgo), func GetsockoptIPv6MTUInfo(int, int, int) (*IPv6MTUInfo, error) +pkg syscall (linux-arm-cgo), func GetsockoptIPv6Mreq(int, int, int) (*IPv6Mreq, error) +pkg syscall (linux-arm-cgo), func GetsockoptInet4Addr(int, int, int) ([4]uint8, error) +pkg syscall (linux-arm-cgo), func GetsockoptInt(int, int, int) (int, error) +pkg syscall (linux-arm-cgo), func GetsockoptUcred(int, int, int) (*Ucred, error) +pkg syscall (linux-arm-cgo), func Gettid() int +pkg syscall (linux-arm-cgo), func Getxattr(string, string, []uint8) (int, error) +pkg syscall (linux-arm-cgo), func InotifyAddWatch(int, string, uint32) (int, error) +pkg syscall (linux-arm-cgo), func InotifyInit() (int, error) +pkg syscall (linux-arm-cgo), func InotifyInit1(int) (int, error) +pkg syscall (linux-arm-cgo), func InotifyRmWatch(int, uint32) (int, error) +pkg syscall (linux-arm-cgo), func Kill(int, Signal) error +pkg syscall (linux-arm-cgo), func Klogctl(int, []uint8) (int, error) +pkg syscall (linux-arm-cgo), func Listen(int, int) error +pkg syscall (linux-arm-cgo), func Listxattr(string, []uint8) (int, error) +pkg syscall (linux-arm-cgo), func LsfJump(int, int, int, int) *SockFilter +pkg syscall (linux-arm-cgo), func LsfSocket(int, int) (int, error) +pkg syscall (linux-arm-cgo), func LsfStmt(int, int) *SockFilter +pkg syscall (linux-arm-cgo), func Lstat(string, *Stat_t) error +pkg syscall (linux-arm-cgo), func Madvise([]uint8, int) error +pkg syscall (linux-arm-cgo), func Mkdirat(int, string, uint32) error +pkg syscall (linux-arm-cgo), func Mkfifo(string, uint32) error +pkg syscall (linux-arm-cgo), func Mknod(string, uint32, int) error +pkg syscall (linux-arm-cgo), func Mknodat(int, string, uint32, int) error +pkg syscall (linux-arm-cgo), func Mlock([]uint8) error +pkg syscall (linux-arm-cgo), func Mlockall(int) error +pkg syscall (linux-arm-cgo), func Mmap(int, int64, int, int, int) ([]uint8, error) +pkg syscall (linux-arm-cgo), func Mount(string, string, string, uintptr, string) error +pkg syscall (linux-arm-cgo), func Mprotect([]uint8, int) error +pkg syscall (linux-arm-cgo), func Munlock([]uint8) error +pkg syscall (linux-arm-cgo), func Munlockall() error +pkg syscall (linux-arm-cgo), func Munmap([]uint8) error +pkg syscall (linux-arm-cgo), func Nanosleep(*Timespec, *Timespec) error +pkg syscall (linux-arm-cgo), func NetlinkRIB(int, int) ([]uint8, error) +pkg syscall (linux-arm-cgo), func Open(string, int, uint32) (int, error) +pkg syscall (linux-arm-cgo), func Openat(int, string, int, uint32) (int, error) +pkg syscall (linux-arm-cgo), func ParseDirent([]uint8, int, []string) (int, int, []string) +pkg syscall (linux-arm-cgo), func ParseNetlinkMessage([]uint8) ([]NetlinkMessage, error) +pkg syscall (linux-arm-cgo), func ParseNetlinkRouteAttr(*NetlinkMessage) ([]NetlinkRouteAttr, error) +pkg syscall (linux-arm-cgo), func ParseSocketControlMessage([]uint8) ([]SocketControlMessage, error) +pkg syscall (linux-arm-cgo), func ParseUnixCredentials(*SocketControlMessage) (*Ucred, error) +pkg syscall (linux-arm-cgo), func ParseUnixRights(*SocketControlMessage) ([]int, error) +pkg syscall (linux-arm-cgo), func Pause() error +pkg syscall (linux-arm-cgo), func Pipe([]int) error +pkg syscall (linux-arm-cgo), func Pipe2([]int, int) error +pkg syscall (linux-arm-cgo), func PivotRoot(string, string) error +pkg syscall (linux-arm-cgo), func Pread(int, []uint8, int64) (int, error) +pkg syscall (linux-arm-cgo), func PtraceAttach(int) error +pkg syscall (linux-arm-cgo), func PtraceCont(int, int) error +pkg syscall (linux-arm-cgo), func PtraceDetach(int) error +pkg syscall (linux-arm-cgo), func PtraceGetEventMsg(int) (uint, error) +pkg syscall (linux-arm-cgo), func PtraceGetRegs(int, *PtraceRegs) error +pkg syscall (linux-arm-cgo), func PtracePeekData(int, uintptr, []uint8) (int, error) +pkg syscall (linux-arm-cgo), func PtracePeekText(int, uintptr, []uint8) (int, error) +pkg syscall (linux-arm-cgo), func PtracePokeData(int, uintptr, []uint8) (int, error) +pkg syscall (linux-arm-cgo), func PtracePokeText(int, uintptr, []uint8) (int, error) +pkg syscall (linux-arm-cgo), func PtraceSetOptions(int, int) error +pkg syscall (linux-arm-cgo), func PtraceSetRegs(int, *PtraceRegs) error +pkg syscall (linux-arm-cgo), func PtraceSingleStep(int) error +pkg syscall (linux-arm-cgo), func PtraceSyscall(int, int) error +pkg syscall (linux-arm-cgo), func Pwrite(int, []uint8, int64) (int, error) +pkg syscall (linux-arm-cgo), func RawSyscall(uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno) +pkg syscall (linux-arm-cgo), func RawSyscall6(uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno) +pkg syscall (linux-arm-cgo), func Read(int, []uint8) (int, error) +pkg syscall (linux-arm-cgo), func ReadDirent(int, []uint8) (int, error) +pkg syscall (linux-arm-cgo), func Reboot(int) error +pkg syscall (linux-arm-cgo), func Recvfrom(int, []uint8, int) (int, Sockaddr, error) +pkg syscall (linux-arm-cgo), func Recvmsg(int, []uint8, []uint8, int) (int, int, int, Sockaddr, error) +pkg syscall (linux-arm-cgo), func Removexattr(string, string) error +pkg syscall (linux-arm-cgo), func Renameat(int, string, int, string) error +pkg syscall (linux-arm-cgo), func Seek(int, int64, int) (int64, error) +pkg syscall (linux-arm-cgo), func Select(int, *FdSet, *FdSet, *FdSet, *Timeval) (int, error) +pkg syscall (linux-arm-cgo), func Sendfile(int, int, *int64, int) (int, error) +pkg syscall (linux-arm-cgo), func Sendmsg(int, []uint8, []uint8, Sockaddr, int) error +pkg syscall (linux-arm-cgo), func Sendto(int, []uint8, int, Sockaddr) error +pkg syscall (linux-arm-cgo), func SetLsfPromisc(string, bool) error +pkg syscall (linux-arm-cgo), func SetNonblock(int, bool) error +pkg syscall (linux-arm-cgo), func Setdomainname([]uint8) error +pkg syscall (linux-arm-cgo), func Setfsgid(int) error +pkg syscall (linux-arm-cgo), func Setfsuid(int) error +pkg syscall (linux-arm-cgo), func Setgid(int) error +pkg syscall (linux-arm-cgo), func Setgroups([]int) error +pkg syscall (linux-arm-cgo), func Sethostname([]uint8) error +pkg syscall (linux-arm-cgo), func Setpgid(int, int) error +pkg syscall (linux-arm-cgo), func Setpriority(int, int, int) error +pkg syscall (linux-arm-cgo), func Setregid(int, int) error +pkg syscall (linux-arm-cgo), func Setresgid(int, int, int) error +pkg syscall (linux-arm-cgo), func Setresuid(int, int, int) error +pkg syscall (linux-arm-cgo), func Setreuid(int, int) error +pkg syscall (linux-arm-cgo), func Setrlimit(int, *Rlimit) error +pkg syscall (linux-arm-cgo), func Setsid() (int, error) +pkg syscall (linux-arm-cgo), func SetsockoptByte(int, int, int, uint8) error +pkg syscall (linux-arm-cgo), func SetsockoptICMPv6Filter(int, int, int, *ICMPv6Filter) error +pkg syscall (linux-arm-cgo), func SetsockoptIPMreq(int, int, int, *IPMreq) error +pkg syscall (linux-arm-cgo), func SetsockoptIPMreqn(int, int, int, *IPMreqn) error +pkg syscall (linux-arm-cgo), func SetsockoptIPv6Mreq(int, int, int, *IPv6Mreq) error +pkg syscall (linux-arm-cgo), func SetsockoptInet4Addr(int, int, int, [4]uint8) error +pkg syscall (linux-arm-cgo), func SetsockoptInt(int, int, int, int) error +pkg syscall (linux-arm-cgo), func SetsockoptLinger(int, int, int, *Linger) error +pkg syscall (linux-arm-cgo), func SetsockoptString(int, int, int, string) error +pkg syscall (linux-arm-cgo), func SetsockoptTimeval(int, int, int, *Timeval) error +pkg syscall (linux-arm-cgo), func Settimeofday(*Timeval) error +pkg syscall (linux-arm-cgo), func Setuid(int) error +pkg syscall (linux-arm-cgo), func Setxattr(string, string, []uint8, int) error +pkg syscall (linux-arm-cgo), func Shutdown(int, int) error +pkg syscall (linux-arm-cgo), func SlicePtrFromStrings([]string) ([]*uint8, error) +pkg syscall (linux-arm-cgo), func Socket(int, int, int) (int, error) +pkg syscall (linux-arm-cgo), func Socketpair(int, int, int) ([2]int, error) +pkg syscall (linux-arm-cgo), func Splice(int, *int64, int, *int64, int, int) (int, error) +pkg syscall (linux-arm-cgo), func Stat(string, *Stat_t) error +pkg syscall (linux-arm-cgo), func Statfs(string, *Statfs_t) error +pkg syscall (linux-arm-cgo), func StringSlicePtr([]string) []*uint8 +pkg syscall (linux-arm-cgo), func Sync() +pkg syscall (linux-arm-cgo), func Syscall(uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno) +pkg syscall (linux-arm-cgo), func Syscall6(uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno) +pkg syscall (linux-arm-cgo), func Sysinfo(*Sysinfo_t) error +pkg syscall (linux-arm-cgo), func Tee(int, int, int, int) (int64, error) +pkg syscall (linux-arm-cgo), func Tgkill(int, int, Signal) error +pkg syscall (linux-arm-cgo), func Time(*Time_t) (Time_t, error) +pkg syscall (linux-arm-cgo), func Times(*Tms) (uintptr, error) +pkg syscall (linux-arm-cgo), func Truncate(string, int64) error +pkg syscall (linux-arm-cgo), func Umask(int) int +pkg syscall (linux-arm-cgo), func Uname(*Utsname) error +pkg syscall (linux-arm-cgo), func UnixCredentials(*Ucred) []uint8 +pkg syscall (linux-arm-cgo), func UnixRights(...int) []uint8 +pkg syscall (linux-arm-cgo), func Unlinkat(int, string) error +pkg syscall (linux-arm-cgo), func Unmount(string, int) error +pkg syscall (linux-arm-cgo), func Unshare(int) error +pkg syscall (linux-arm-cgo), func Ustat(int, *Ustat_t) error +pkg syscall (linux-arm-cgo), func Utime(string, *Utimbuf) error +pkg syscall (linux-arm-cgo), func Wait4(int, *WaitStatus, int, *Rusage) (int, error) +pkg syscall (linux-arm-cgo), func Write(int, []uint8) (int, error) +pkg syscall (linux-arm-cgo), method (*Cmsghdr) SetLen(int) +pkg syscall (linux-arm-cgo), method (*Iovec) SetLen(int) +pkg syscall (linux-arm-cgo), method (*Msghdr) SetControllen(int) +pkg syscall (linux-arm-cgo), method (*PtraceRegs) PC() uint64 +pkg syscall (linux-arm-cgo), method (*PtraceRegs) SetPC(uint64) +pkg syscall (linux-arm-cgo), type Cmsghdr struct +pkg syscall (linux-arm-cgo), type Cmsghdr struct, Len uint32 +pkg syscall (linux-arm-cgo), type Cmsghdr struct, Level int32 +pkg syscall (linux-arm-cgo), type Cmsghdr struct, Type int32 +pkg syscall (linux-arm-cgo), type Cmsghdr struct, X__cmsg_data [0]uint8 +pkg syscall (linux-arm-cgo), type Credential struct +pkg syscall (linux-arm-cgo), type Credential struct, Gid uint32 +pkg syscall (linux-arm-cgo), type Credential struct, Groups []uint32 +pkg syscall (linux-arm-cgo), type Credential struct, Uid uint32 +pkg syscall (linux-arm-cgo), type Dirent struct +pkg syscall (linux-arm-cgo), type Dirent struct, Ino uint64 +pkg syscall (linux-arm-cgo), type Dirent struct, Name [256]uint8 +pkg syscall (linux-arm-cgo), type Dirent struct, Off int64 +pkg syscall (linux-arm-cgo), type Dirent struct, Pad_cgo_0 [5]uint8 +pkg syscall (linux-arm-cgo), type Dirent struct, Reclen uint16 +pkg syscall (linux-arm-cgo), type Dirent struct, Type uint8 +pkg syscall (linux-arm-cgo), type EpollEvent struct +pkg syscall (linux-arm-cgo), type EpollEvent struct, Events uint32 +pkg syscall (linux-arm-cgo), type EpollEvent struct, Fd int32 +pkg syscall (linux-arm-cgo), type EpollEvent struct, Pad int32 +pkg syscall (linux-arm-cgo), type EpollEvent struct, PadFd int32 +pkg syscall (linux-arm-cgo), type FdSet struct +pkg syscall (linux-arm-cgo), type FdSet struct, Bits [32]int32 +pkg syscall (linux-arm-cgo), type Fsid struct +pkg syscall (linux-arm-cgo), type Fsid struct, X__val [2]int32 +pkg syscall (linux-arm-cgo), type ICMPv6Filter struct +pkg syscall (linux-arm-cgo), type ICMPv6Filter struct, Data [8]uint32 +pkg syscall (linux-arm-cgo), type IPMreqn struct +pkg syscall (linux-arm-cgo), type IPMreqn struct, Address [4]uint8 +pkg syscall (linux-arm-cgo), type IPMreqn struct, Ifindex int32 +pkg syscall (linux-arm-cgo), type IPMreqn struct, Multiaddr [4]uint8 +pkg syscall (linux-arm-cgo), type IPv6MTUInfo struct +pkg syscall (linux-arm-cgo), type IPv6MTUInfo struct, Addr RawSockaddrInet6 +pkg syscall (linux-arm-cgo), type IPv6MTUInfo struct, Mtu uint32 +pkg syscall (linux-arm-cgo), type IfAddrmsg struct +pkg syscall (linux-arm-cgo), type IfAddrmsg struct, Family uint8 +pkg syscall (linux-arm-cgo), type IfAddrmsg struct, Flags uint8 +pkg syscall (linux-arm-cgo), type IfAddrmsg struct, Index uint32 +pkg syscall (linux-arm-cgo), type IfAddrmsg struct, Prefixlen uint8 +pkg syscall (linux-arm-cgo), type IfAddrmsg struct, Scope uint8 +pkg syscall (linux-arm-cgo), type IfInfomsg struct +pkg syscall (linux-arm-cgo), type IfInfomsg struct, Change uint32 +pkg syscall (linux-arm-cgo), type IfInfomsg struct, Family uint8 +pkg syscall (linux-arm-cgo), type IfInfomsg struct, Flags uint32 +pkg syscall (linux-arm-cgo), type IfInfomsg struct, Index int32 +pkg syscall (linux-arm-cgo), type IfInfomsg struct, Type uint16 +pkg syscall (linux-arm-cgo), type IfInfomsg struct, X__ifi_pad uint8 +pkg syscall (linux-arm-cgo), type Inet4Pktinfo struct +pkg syscall (linux-arm-cgo), type Inet4Pktinfo struct, Addr [4]uint8 +pkg syscall (linux-arm-cgo), type Inet4Pktinfo struct, Ifindex int32 +pkg syscall (linux-arm-cgo), type Inet4Pktinfo struct, Spec_dst [4]uint8 +pkg syscall (linux-arm-cgo), type Inet6Pktinfo struct +pkg syscall (linux-arm-cgo), type Inet6Pktinfo struct, Addr [16]uint8 +pkg syscall (linux-arm-cgo), type Inet6Pktinfo struct, Ifindex uint32 +pkg syscall (linux-arm-cgo), type InotifyEvent struct +pkg syscall (linux-arm-cgo), type InotifyEvent struct, Cookie uint32 +pkg syscall (linux-arm-cgo), type InotifyEvent struct, Len uint32 +pkg syscall (linux-arm-cgo), type InotifyEvent struct, Mask uint32 +pkg syscall (linux-arm-cgo), type InotifyEvent struct, Name [0]uint8 +pkg syscall (linux-arm-cgo), type InotifyEvent struct, Wd int32 +pkg syscall (linux-arm-cgo), type Iovec struct +pkg syscall (linux-arm-cgo), type Iovec struct, Base *uint8 +pkg syscall (linux-arm-cgo), type Iovec struct, Len uint32 +pkg syscall (linux-arm-cgo), type Msghdr struct +pkg syscall (linux-arm-cgo), type Msghdr struct, Control *uint8 +pkg syscall (linux-arm-cgo), type Msghdr struct, Controllen uint32 +pkg syscall (linux-arm-cgo), type Msghdr struct, Flags int32 +pkg syscall (linux-arm-cgo), type Msghdr struct, Iov *Iovec +pkg syscall (linux-arm-cgo), type Msghdr struct, Iovlen uint32 +pkg syscall (linux-arm-cgo), type Msghdr struct, Name *uint8 +pkg syscall (linux-arm-cgo), type Msghdr struct, Namelen uint32 +pkg syscall (linux-arm-cgo), type NetlinkMessage struct +pkg syscall (linux-arm-cgo), type NetlinkMessage struct, Data []uint8 +pkg syscall (linux-arm-cgo), type NetlinkMessage struct, Header NlMsghdr +pkg syscall (linux-arm-cgo), type NetlinkRouteAttr struct +pkg syscall (linux-arm-cgo), type NetlinkRouteAttr struct, Attr RtAttr +pkg syscall (linux-arm-cgo), type NetlinkRouteAttr struct, Value []uint8 +pkg syscall (linux-arm-cgo), type NetlinkRouteRequest struct +pkg syscall (linux-arm-cgo), type NetlinkRouteRequest struct, Data RtGenmsg +pkg syscall (linux-arm-cgo), type NetlinkRouteRequest struct, Header NlMsghdr +pkg syscall (linux-arm-cgo), type NlAttr struct +pkg syscall (linux-arm-cgo), type NlAttr struct, Len uint16 +pkg syscall (linux-arm-cgo), type NlAttr struct, Type uint16 +pkg syscall (linux-arm-cgo), type NlMsgerr struct +pkg syscall (linux-arm-cgo), type NlMsgerr struct, Error int32 +pkg syscall (linux-arm-cgo), type NlMsgerr struct, Msg NlMsghdr +pkg syscall (linux-arm-cgo), type NlMsghdr struct +pkg syscall (linux-arm-cgo), type NlMsghdr struct, Flags uint16 +pkg syscall (linux-arm-cgo), type NlMsghdr struct, Len uint32 +pkg syscall (linux-arm-cgo), type NlMsghdr struct, Pid uint32 +pkg syscall (linux-arm-cgo), type NlMsghdr struct, Seq uint32 +pkg syscall (linux-arm-cgo), type NlMsghdr struct, Type uint16 +pkg syscall (linux-arm-cgo), type PtraceRegs struct +pkg syscall (linux-arm-cgo), type PtraceRegs struct, Uregs [18]uint32 +pkg syscall (linux-arm-cgo), type RawSockaddr struct, Data [14]uint8 +pkg syscall (linux-arm-cgo), type RawSockaddr struct, Family uint16 +pkg syscall (linux-arm-cgo), type RawSockaddrAny struct, Pad [96]uint8 +pkg syscall (linux-arm-cgo), type RawSockaddrInet4 struct, Family uint16 +pkg syscall (linux-arm-cgo), type RawSockaddrInet4 struct, Zero [8]uint8 +pkg syscall (linux-arm-cgo), type RawSockaddrInet6 struct, Family uint16 +pkg syscall (linux-arm-cgo), type RawSockaddrLinklayer struct +pkg syscall (linux-arm-cgo), type RawSockaddrLinklayer struct, Addr [8]uint8 +pkg syscall (linux-arm-cgo), type RawSockaddrLinklayer struct, Family uint16 +pkg syscall (linux-arm-cgo), type RawSockaddrLinklayer struct, Halen uint8 +pkg syscall (linux-arm-cgo), type RawSockaddrLinklayer struct, Hatype uint16 +pkg syscall (linux-arm-cgo), type RawSockaddrLinklayer struct, Ifindex int32 +pkg syscall (linux-arm-cgo), type RawSockaddrLinklayer struct, Pkttype uint8 +pkg syscall (linux-arm-cgo), type RawSockaddrLinklayer struct, Protocol uint16 +pkg syscall (linux-arm-cgo), type RawSockaddrNetlink struct +pkg syscall (linux-arm-cgo), type RawSockaddrNetlink struct, Family uint16 +pkg syscall (linux-arm-cgo), type RawSockaddrNetlink struct, Groups uint32 +pkg syscall (linux-arm-cgo), type RawSockaddrNetlink struct, Pad uint16 +pkg syscall (linux-arm-cgo), type RawSockaddrNetlink struct, Pid uint32 +pkg syscall (linux-arm-cgo), type RawSockaddrUnix struct +pkg syscall (linux-arm-cgo), type RawSockaddrUnix struct, Family uint16 +pkg syscall (linux-arm-cgo), type RawSockaddrUnix struct, Path [108]int8 +pkg syscall (linux-arm-cgo), type Rlimit struct +pkg syscall (linux-arm-cgo), type Rlimit struct, Cur uint64 +pkg syscall (linux-arm-cgo), type Rlimit struct, Max uint64 +pkg syscall (linux-arm-cgo), type RtAttr struct +pkg syscall (linux-arm-cgo), type RtAttr struct, Len uint16 +pkg syscall (linux-arm-cgo), type RtAttr struct, Type uint16 +pkg syscall (linux-arm-cgo), type RtGenmsg struct +pkg syscall (linux-arm-cgo), type RtGenmsg struct, Family uint8 +pkg syscall (linux-arm-cgo), type RtMsg struct +pkg syscall (linux-arm-cgo), type RtMsg struct, Dst_len uint8 +pkg syscall (linux-arm-cgo), type RtMsg struct, Family uint8 +pkg syscall (linux-arm-cgo), type RtMsg struct, Flags uint32 +pkg syscall (linux-arm-cgo), type RtMsg struct, Protocol uint8 +pkg syscall (linux-arm-cgo), type RtMsg struct, Scope uint8 +pkg syscall (linux-arm-cgo), type RtMsg struct, Src_len uint8 +pkg syscall (linux-arm-cgo), type RtMsg struct, Table uint8 +pkg syscall (linux-arm-cgo), type RtMsg struct, Tos uint8 +pkg syscall (linux-arm-cgo), type RtMsg struct, Type uint8 +pkg syscall (linux-arm-cgo), type RtNexthop struct +pkg syscall (linux-arm-cgo), type RtNexthop struct, Flags uint8 +pkg syscall (linux-arm-cgo), type RtNexthop struct, Hops uint8 +pkg syscall (linux-arm-cgo), type RtNexthop struct, Ifindex int32 +pkg syscall (linux-arm-cgo), type RtNexthop struct, Len uint16 +pkg syscall (linux-arm-cgo), type Rusage struct, Idrss int32 +pkg syscall (linux-arm-cgo), type Rusage struct, Inblock int32 +pkg syscall (linux-arm-cgo), type Rusage struct, Isrss int32 +pkg syscall (linux-arm-cgo), type Rusage struct, Ixrss int32 +pkg syscall (linux-arm-cgo), type Rusage struct, Majflt int32 +pkg syscall (linux-arm-cgo), type Rusage struct, Maxrss int32 +pkg syscall (linux-arm-cgo), type Rusage struct, Minflt int32 +pkg syscall (linux-arm-cgo), type Rusage struct, Msgrcv int32 +pkg syscall (linux-arm-cgo), type Rusage struct, Msgsnd int32 +pkg syscall (linux-arm-cgo), type Rusage struct, Nivcsw int32 +pkg syscall (linux-arm-cgo), type Rusage struct, Nsignals int32 +pkg syscall (linux-arm-cgo), type Rusage struct, Nswap int32 +pkg syscall (linux-arm-cgo), type Rusage struct, Nvcsw int32 +pkg syscall (linux-arm-cgo), type Rusage struct, Oublock int32 +pkg syscall (linux-arm-cgo), type Rusage struct, Stime Timeval +pkg syscall (linux-arm-cgo), type Rusage struct, Utime Timeval +pkg syscall (linux-arm-cgo), type SockFilter struct +pkg syscall (linux-arm-cgo), type SockFilter struct, Code uint16 +pkg syscall (linux-arm-cgo), type SockFilter struct, Jf uint8 +pkg syscall (linux-arm-cgo), type SockFilter struct, Jt uint8 +pkg syscall (linux-arm-cgo), type SockFilter struct, K uint32 +pkg syscall (linux-arm-cgo), type SockFprog struct +pkg syscall (linux-arm-cgo), type SockFprog struct, Filter *SockFilter +pkg syscall (linux-arm-cgo), type SockFprog struct, Len uint16 +pkg syscall (linux-arm-cgo), type SockFprog struct, Pad_cgo_0 [2]uint8 +pkg syscall (linux-arm-cgo), type SockaddrLinklayer struct +pkg syscall (linux-arm-cgo), type SockaddrLinklayer struct, Addr [8]uint8 +pkg syscall (linux-arm-cgo), type SockaddrLinklayer struct, Halen uint8 +pkg syscall (linux-arm-cgo), type SockaddrLinklayer struct, Hatype uint16 +pkg syscall (linux-arm-cgo), type SockaddrLinklayer struct, Ifindex int +pkg syscall (linux-arm-cgo), type SockaddrLinklayer struct, Pkttype uint8 +pkg syscall (linux-arm-cgo), type SockaddrLinklayer struct, Protocol uint16 +pkg syscall (linux-arm-cgo), type SockaddrNetlink struct +pkg syscall (linux-arm-cgo), type SockaddrNetlink struct, Family uint16 +pkg syscall (linux-arm-cgo), type SockaddrNetlink struct, Groups uint32 +pkg syscall (linux-arm-cgo), type SockaddrNetlink struct, Pad uint16 +pkg syscall (linux-arm-cgo), type SockaddrNetlink struct, Pid uint32 +pkg syscall (linux-arm-cgo), type SocketControlMessage struct +pkg syscall (linux-arm-cgo), type SocketControlMessage struct, Data []uint8 +pkg syscall (linux-arm-cgo), type SocketControlMessage struct, Header Cmsghdr +pkg syscall (linux-arm-cgo), type Stat_t struct +pkg syscall (linux-arm-cgo), type Stat_t struct, Atim Timespec +pkg syscall (linux-arm-cgo), type Stat_t struct, Blksize int32 +pkg syscall (linux-arm-cgo), type Stat_t struct, Blocks int64 +pkg syscall (linux-arm-cgo), type Stat_t struct, Ctim Timespec +pkg syscall (linux-arm-cgo), type Stat_t struct, Dev uint64 +pkg syscall (linux-arm-cgo), type Stat_t struct, Gid uint32 +pkg syscall (linux-arm-cgo), type Stat_t struct, Ino uint64 +pkg syscall (linux-arm-cgo), type Stat_t struct, Mode uint32 +pkg syscall (linux-arm-cgo), type Stat_t struct, Mtim Timespec +pkg syscall (linux-arm-cgo), type Stat_t struct, Nlink uint32 +pkg syscall (linux-arm-cgo), type Stat_t struct, Pad_cgo_0 [2]uint8 +pkg syscall (linux-arm-cgo), type Stat_t struct, Pad_cgo_1 [6]uint8 +pkg syscall (linux-arm-cgo), type Stat_t struct, Pad_cgo_2 [4]uint8 +pkg syscall (linux-arm-cgo), type Stat_t struct, Rdev uint64 +pkg syscall (linux-arm-cgo), type Stat_t struct, Size int64 +pkg syscall (linux-arm-cgo), type Stat_t struct, Uid uint32 +pkg syscall (linux-arm-cgo), type Stat_t struct, X__pad1 uint16 +pkg syscall (linux-arm-cgo), type Stat_t struct, X__pad2 uint16 +pkg syscall (linux-arm-cgo), type Stat_t struct, X__st_ino uint32 +pkg syscall (linux-arm-cgo), type Statfs_t struct +pkg syscall (linux-arm-cgo), type Statfs_t struct, Bavail uint64 +pkg syscall (linux-arm-cgo), type Statfs_t struct, Bfree uint64 +pkg syscall (linux-arm-cgo), type Statfs_t struct, Blocks uint64 +pkg syscall (linux-arm-cgo), type Statfs_t struct, Bsize int32 +pkg syscall (linux-arm-cgo), type Statfs_t struct, Ffree uint64 +pkg syscall (linux-arm-cgo), type Statfs_t struct, Files uint64 +pkg syscall (linux-arm-cgo), type Statfs_t struct, Flags int32 +pkg syscall (linux-arm-cgo), type Statfs_t struct, Frsize int32 +pkg syscall (linux-arm-cgo), type Statfs_t struct, Fsid Fsid +pkg syscall (linux-arm-cgo), type Statfs_t struct, Namelen int32 +pkg syscall (linux-arm-cgo), type Statfs_t struct, Pad_cgo_0 [4]uint8 +pkg syscall (linux-arm-cgo), type Statfs_t struct, Spare [4]int32 +pkg syscall (linux-arm-cgo), type Statfs_t struct, Type int32 +pkg syscall (linux-arm-cgo), type SysProcAttr struct, Chroot string +pkg syscall (linux-arm-cgo), type SysProcAttr struct, Cloneflags uintptr +pkg syscall (linux-arm-cgo), type SysProcAttr struct, Credential *Credential +pkg syscall (linux-arm-cgo), type SysProcAttr struct, Ctty int +pkg syscall (linux-arm-cgo), type SysProcAttr struct, Noctty bool +pkg syscall (linux-arm-cgo), type SysProcAttr struct, Pdeathsig Signal +pkg syscall (linux-arm-cgo), type SysProcAttr struct, Ptrace bool +pkg syscall (linux-arm-cgo), type SysProcAttr struct, Setctty bool +pkg syscall (linux-arm-cgo), type SysProcAttr struct, Setpgid bool +pkg syscall (linux-arm-cgo), type SysProcAttr struct, Setsid bool +pkg syscall (linux-arm-cgo), type Sysinfo_t struct +pkg syscall (linux-arm-cgo), type Sysinfo_t struct, Bufferram uint32 +pkg syscall (linux-arm-cgo), type Sysinfo_t struct, Freehigh uint32 +pkg syscall (linux-arm-cgo), type Sysinfo_t struct, Freeram uint32 +pkg syscall (linux-arm-cgo), type Sysinfo_t struct, Freeswap uint32 +pkg syscall (linux-arm-cgo), type Sysinfo_t struct, Loads [3]uint32 +pkg syscall (linux-arm-cgo), type Sysinfo_t struct, Pad uint16 +pkg syscall (linux-arm-cgo), type Sysinfo_t struct, Procs uint16 +pkg syscall (linux-arm-cgo), type Sysinfo_t struct, Sharedram uint32 +pkg syscall (linux-arm-cgo), type Sysinfo_t struct, Totalhigh uint32 +pkg syscall (linux-arm-cgo), type Sysinfo_t struct, Totalram uint32 +pkg syscall (linux-arm-cgo), type Sysinfo_t struct, Totalswap uint32 +pkg syscall (linux-arm-cgo), type Sysinfo_t struct, Unit uint32 +pkg syscall (linux-arm-cgo), type Sysinfo_t struct, Uptime int32 +pkg syscall (linux-arm-cgo), type Sysinfo_t struct, X_f [8]uint8 +pkg syscall (linux-arm-cgo), type TCPInfo struct +pkg syscall (linux-arm-cgo), type TCPInfo struct, Advmss uint32 +pkg syscall (linux-arm-cgo), type TCPInfo struct, Ato uint32 +pkg syscall (linux-arm-cgo), type TCPInfo struct, Backoff uint8 +pkg syscall (linux-arm-cgo), type TCPInfo struct, Ca_state uint8 +pkg syscall (linux-arm-cgo), type TCPInfo struct, Fackets uint32 +pkg syscall (linux-arm-cgo), type TCPInfo struct, Last_ack_recv uint32 +pkg syscall (linux-arm-cgo), type TCPInfo struct, Last_ack_sent uint32 +pkg syscall (linux-arm-cgo), type TCPInfo struct, Last_data_recv uint32 +pkg syscall (linux-arm-cgo), type TCPInfo struct, Last_data_sent uint32 +pkg syscall (linux-arm-cgo), type TCPInfo struct, Lost uint32 +pkg syscall (linux-arm-cgo), type TCPInfo struct, Options uint8 +pkg syscall (linux-arm-cgo), type TCPInfo struct, Pad_cgo_0 [2]uint8 +pkg syscall (linux-arm-cgo), type TCPInfo struct, Pmtu uint32 +pkg syscall (linux-arm-cgo), type TCPInfo struct, Probes uint8 +pkg syscall (linux-arm-cgo), type TCPInfo struct, Rcv_mss uint32 +pkg syscall (linux-arm-cgo), type TCPInfo struct, Rcv_rtt uint32 +pkg syscall (linux-arm-cgo), type TCPInfo struct, Rcv_space uint32 +pkg syscall (linux-arm-cgo), type TCPInfo struct, Rcv_ssthresh uint32 +pkg syscall (linux-arm-cgo), type TCPInfo struct, Reordering uint32 +pkg syscall (linux-arm-cgo), type TCPInfo struct, Retrans uint32 +pkg syscall (linux-arm-cgo), type TCPInfo struct, Retransmits uint8 +pkg syscall (linux-arm-cgo), type TCPInfo struct, Rto uint32 +pkg syscall (linux-arm-cgo), type TCPInfo struct, Rtt uint32 +pkg syscall (linux-arm-cgo), type TCPInfo struct, Rttvar uint32 +pkg syscall (linux-arm-cgo), type TCPInfo struct, Sacked uint32 +pkg syscall (linux-arm-cgo), type TCPInfo struct, Snd_cwnd uint32 +pkg syscall (linux-arm-cgo), type TCPInfo struct, Snd_mss uint32 +pkg syscall (linux-arm-cgo), type TCPInfo struct, Snd_ssthresh uint32 +pkg syscall (linux-arm-cgo), type TCPInfo struct, State uint8 +pkg syscall (linux-arm-cgo), type TCPInfo struct, Total_retrans uint32 +pkg syscall (linux-arm-cgo), type TCPInfo struct, Unacked uint32 +pkg syscall (linux-arm-cgo), type Termios struct +pkg syscall (linux-arm-cgo), type Termios struct, Cc [32]uint8 +pkg syscall (linux-arm-cgo), type Termios struct, Cflag uint32 +pkg syscall (linux-arm-cgo), type Termios struct, Iflag uint32 +pkg syscall (linux-arm-cgo), type Termios struct, Ispeed uint32 +pkg syscall (linux-arm-cgo), type Termios struct, Lflag uint32 +pkg syscall (linux-arm-cgo), type Termios struct, Line uint8 +pkg syscall (linux-arm-cgo), type Termios struct, Oflag uint32 +pkg syscall (linux-arm-cgo), type Termios struct, Ospeed uint32 +pkg syscall (linux-arm-cgo), type Termios struct, Pad_cgo_0 [3]uint8 +pkg syscall (linux-arm-cgo), type Time_t int32 +pkg syscall (linux-arm-cgo), type Timespec struct, Nsec int32 +pkg syscall (linux-arm-cgo), type Timespec struct, Sec int32 +pkg syscall (linux-arm-cgo), type Timeval struct, Sec int32 +pkg syscall (linux-arm-cgo), type Timeval struct, Usec int32 +pkg syscall (linux-arm-cgo), type Timex struct +pkg syscall (linux-arm-cgo), type Timex struct, Calcnt int32 +pkg syscall (linux-arm-cgo), type Timex struct, Constant int32 +pkg syscall (linux-arm-cgo), type Timex struct, Errcnt int32 +pkg syscall (linux-arm-cgo), type Timex struct, Esterror int32 +pkg syscall (linux-arm-cgo), type Timex struct, Freq int32 +pkg syscall (linux-arm-cgo), type Timex struct, Jitcnt int32 +pkg syscall (linux-arm-cgo), type Timex struct, Jitter int32 +pkg syscall (linux-arm-cgo), type Timex struct, Maxerror int32 +pkg syscall (linux-arm-cgo), type Timex struct, Modes uint32 +pkg syscall (linux-arm-cgo), type Timex struct, Offset int32 +pkg syscall (linux-arm-cgo), type Timex struct, Pad_cgo_0 [44]uint8 +pkg syscall (linux-arm-cgo), type Timex struct, Ppsfreq int32 +pkg syscall (linux-arm-cgo), type Timex struct, Precision int32 +pkg syscall (linux-arm-cgo), type Timex struct, Shift int32 +pkg syscall (linux-arm-cgo), type Timex struct, Stabil int32 +pkg syscall (linux-arm-cgo), type Timex struct, Status int32 +pkg syscall (linux-arm-cgo), type Timex struct, Stbcnt int32 +pkg syscall (linux-arm-cgo), type Timex struct, Tai int32 +pkg syscall (linux-arm-cgo), type Timex struct, Tick int32 +pkg syscall (linux-arm-cgo), type Timex struct, Time Timeval +pkg syscall (linux-arm-cgo), type Timex struct, Tolerance int32 +pkg syscall (linux-arm-cgo), type Tms struct +pkg syscall (linux-arm-cgo), type Tms struct, Cstime int32 +pkg syscall (linux-arm-cgo), type Tms struct, Cutime int32 +pkg syscall (linux-arm-cgo), type Tms struct, Stime int32 +pkg syscall (linux-arm-cgo), type Tms struct, Utime int32 +pkg syscall (linux-arm-cgo), type Ucred struct +pkg syscall (linux-arm-cgo), type Ucred struct, Gid uint32 +pkg syscall (linux-arm-cgo), type Ucred struct, Pid int32 +pkg syscall (linux-arm-cgo), type Ucred struct, Uid uint32 +pkg syscall (linux-arm-cgo), type Ustat_t struct +pkg syscall (linux-arm-cgo), type Ustat_t struct, Fname [6]uint8 +pkg syscall (linux-arm-cgo), type Ustat_t struct, Fpack [6]uint8 +pkg syscall (linux-arm-cgo), type Ustat_t struct, Tfree int32 +pkg syscall (linux-arm-cgo), type Ustat_t struct, Tinode uint32 +pkg syscall (linux-arm-cgo), type Utimbuf struct +pkg syscall (linux-arm-cgo), type Utimbuf struct, Actime int32 +pkg syscall (linux-arm-cgo), type Utimbuf struct, Modtime int32 +pkg syscall (linux-arm-cgo), type Utsname struct +pkg syscall (linux-arm-cgo), type Utsname struct, Domainname [65]uint8 +pkg syscall (linux-arm-cgo), type Utsname struct, Machine [65]uint8 +pkg syscall (linux-arm-cgo), type Utsname struct, Nodename [65]uint8 +pkg syscall (linux-arm-cgo), type Utsname struct, Release [65]uint8 +pkg syscall (linux-arm-cgo), type Utsname struct, Sysname [65]uint8 +pkg syscall (linux-arm-cgo), type Utsname struct, Version [65]uint8 +pkg syscall (linux-arm-cgo), type WaitStatus uint32 +pkg syscall (linux-arm-cgo), var Stderr int +pkg syscall (linux-arm-cgo), var Stdin int +pkg syscall (linux-arm-cgo), var Stdout int +pkg syscall (netbsd-386), const AF_APPLETALK ideal-int +pkg syscall (netbsd-386), const AF_ARP ideal-int +pkg syscall (netbsd-386), const AF_BLUETOOTH ideal-int +pkg syscall (netbsd-386), const AF_CCITT ideal-int +pkg syscall (netbsd-386), const AF_CHAOS ideal-int +pkg syscall (netbsd-386), const AF_CNT ideal-int +pkg syscall (netbsd-386), const AF_COIP ideal-int +pkg syscall (netbsd-386), const AF_DATAKIT ideal-int +pkg syscall (netbsd-386), const AF_DECnet ideal-int +pkg syscall (netbsd-386), const AF_DLI ideal-int +pkg syscall (netbsd-386), const AF_E164 ideal-int +pkg syscall (netbsd-386), const AF_ECMA ideal-int +pkg syscall (netbsd-386), const AF_HYLINK ideal-int +pkg syscall (netbsd-386), const AF_IEEE80211 ideal-int +pkg syscall (netbsd-386), const AF_IMPLINK ideal-int +pkg syscall (netbsd-386), const AF_IPX ideal-int +pkg syscall (netbsd-386), const AF_ISDN ideal-int +pkg syscall (netbsd-386), const AF_ISO ideal-int +pkg syscall (netbsd-386), const AF_LAT ideal-int +pkg syscall (netbsd-386), const AF_LINK ideal-int +pkg syscall (netbsd-386), const AF_LOCAL ideal-int +pkg syscall (netbsd-386), const AF_MAX ideal-int +pkg syscall (netbsd-386), const AF_MPLS ideal-int +pkg syscall (netbsd-386), const AF_NATM ideal-int +pkg syscall (netbsd-386), const AF_NS ideal-int +pkg syscall (netbsd-386), const AF_OROUTE ideal-int +pkg syscall (netbsd-386), const AF_OSI ideal-int +pkg syscall (netbsd-386), const AF_PUP ideal-int +pkg syscall (netbsd-386), const AF_ROUTE ideal-int +pkg syscall (netbsd-386), const AF_SNA ideal-int +pkg syscall (netbsd-386), const ARPHRD_ARCNET ideal-int +pkg syscall (netbsd-386), const ARPHRD_ETHER ideal-int +pkg syscall (netbsd-386), const ARPHRD_FRELAY ideal-int +pkg syscall (netbsd-386), const ARPHRD_IEEE1394 ideal-int +pkg syscall (netbsd-386), const ARPHRD_IEEE802 ideal-int +pkg syscall (netbsd-386), const ARPHRD_STRIP ideal-int +pkg syscall (netbsd-386), const B0 ideal-int +pkg syscall (netbsd-386), const B110 ideal-int +pkg syscall (netbsd-386), const B115200 ideal-int +pkg syscall (netbsd-386), const B1200 ideal-int +pkg syscall (netbsd-386), const B134 ideal-int +pkg syscall (netbsd-386), const B14400 ideal-int +pkg syscall (netbsd-386), const B150 ideal-int +pkg syscall (netbsd-386), const B1800 ideal-int +pkg syscall (netbsd-386), const B19200 ideal-int +pkg syscall (netbsd-386), const B200 ideal-int +pkg syscall (netbsd-386), const B230400 ideal-int +pkg syscall (netbsd-386), const B2400 ideal-int +pkg syscall (netbsd-386), const B28800 ideal-int +pkg syscall (netbsd-386), const B300 ideal-int +pkg syscall (netbsd-386), const B38400 ideal-int +pkg syscall (netbsd-386), const B460800 ideal-int +pkg syscall (netbsd-386), const B4800 ideal-int +pkg syscall (netbsd-386), const B50 ideal-int +pkg syscall (netbsd-386), const B57600 ideal-int +pkg syscall (netbsd-386), const B600 ideal-int +pkg syscall (netbsd-386), const B7200 ideal-int +pkg syscall (netbsd-386), const B75 ideal-int +pkg syscall (netbsd-386), const B76800 ideal-int +pkg syscall (netbsd-386), const B921600 ideal-int +pkg syscall (netbsd-386), const B9600 ideal-int +pkg syscall (netbsd-386), const BIOCFEEDBACK ideal-int +pkg syscall (netbsd-386), const BIOCFLUSH ideal-int +pkg syscall (netbsd-386), const BIOCGBLEN ideal-int +pkg syscall (netbsd-386), const BIOCGDLT ideal-int +pkg syscall (netbsd-386), const BIOCGDLTLIST ideal-int +pkg syscall (netbsd-386), const BIOCGETIF ideal-int +pkg syscall (netbsd-386), const BIOCGFEEDBACK ideal-int +pkg syscall (netbsd-386), const BIOCGHDRCMPLT ideal-int +pkg syscall (netbsd-386), const BIOCGRTIMEOUT ideal-int +pkg syscall (netbsd-386), const BIOCGSEESENT ideal-int +pkg syscall (netbsd-386), const BIOCGSTATS ideal-int +pkg syscall (netbsd-386), const BIOCGSTATSOLD ideal-int +pkg syscall (netbsd-386), const BIOCIMMEDIATE ideal-int +pkg syscall (netbsd-386), const BIOCPROMISC ideal-int +pkg syscall (netbsd-386), const BIOCSBLEN ideal-int +pkg syscall (netbsd-386), const BIOCSDLT ideal-int +pkg syscall (netbsd-386), const BIOCSETF ideal-int +pkg syscall (netbsd-386), const BIOCSETIF ideal-int +pkg syscall (netbsd-386), const BIOCSFEEDBACK ideal-int +pkg syscall (netbsd-386), const BIOCSHDRCMPLT ideal-int +pkg syscall (netbsd-386), const BIOCSRTIMEOUT ideal-int +pkg syscall (netbsd-386), const BIOCSSEESENT ideal-int +pkg syscall (netbsd-386), const BIOCSTCPF ideal-int +pkg syscall (netbsd-386), const BIOCSUDPF ideal-int +pkg syscall (netbsd-386), const BIOCVERSION ideal-int +pkg syscall (netbsd-386), const BPF_A ideal-int +pkg syscall (netbsd-386), const BPF_ABS ideal-int +pkg syscall (netbsd-386), const BPF_ADD ideal-int +pkg syscall (netbsd-386), const BPF_ALIGNMENT ideal-int +pkg syscall (netbsd-386), const BPF_ALIGNMENT32 ideal-int +pkg syscall (netbsd-386), const BPF_ALU ideal-int +pkg syscall (netbsd-386), const BPF_AND ideal-int +pkg syscall (netbsd-386), const BPF_B ideal-int +pkg syscall (netbsd-386), const BPF_DFLTBUFSIZE ideal-int +pkg syscall (netbsd-386), const BPF_DIV ideal-int +pkg syscall (netbsd-386), const BPF_H ideal-int +pkg syscall (netbsd-386), const BPF_IMM ideal-int +pkg syscall (netbsd-386), const BPF_IND ideal-int +pkg syscall (netbsd-386), const BPF_JA ideal-int +pkg syscall (netbsd-386), const BPF_JEQ ideal-int +pkg syscall (netbsd-386), const BPF_JGE ideal-int +pkg syscall (netbsd-386), const BPF_JGT ideal-int +pkg syscall (netbsd-386), const BPF_JMP ideal-int +pkg syscall (netbsd-386), const BPF_JSET ideal-int +pkg syscall (netbsd-386), const BPF_K ideal-int +pkg syscall (netbsd-386), const BPF_LD ideal-int +pkg syscall (netbsd-386), const BPF_LDX ideal-int +pkg syscall (netbsd-386), const BPF_LEN ideal-int +pkg syscall (netbsd-386), const BPF_LSH ideal-int +pkg syscall (netbsd-386), const BPF_MAJOR_VERSION ideal-int +pkg syscall (netbsd-386), const BPF_MAXBUFSIZE ideal-int +pkg syscall (netbsd-386), const BPF_MAXINSNS ideal-int +pkg syscall (netbsd-386), const BPF_MEM ideal-int +pkg syscall (netbsd-386), const BPF_MEMWORDS ideal-int +pkg syscall (netbsd-386), const BPF_MINBUFSIZE ideal-int +pkg syscall (netbsd-386), const BPF_MINOR_VERSION ideal-int +pkg syscall (netbsd-386), const BPF_MISC ideal-int +pkg syscall (netbsd-386), const BPF_MSH ideal-int +pkg syscall (netbsd-386), const BPF_MUL ideal-int +pkg syscall (netbsd-386), const BPF_NEG ideal-int +pkg syscall (netbsd-386), const BPF_OR ideal-int +pkg syscall (netbsd-386), const BPF_RELEASE ideal-int +pkg syscall (netbsd-386), const BPF_RET ideal-int +pkg syscall (netbsd-386), const BPF_RSH ideal-int +pkg syscall (netbsd-386), const BPF_ST ideal-int +pkg syscall (netbsd-386), const BPF_STX ideal-int +pkg syscall (netbsd-386), const BPF_SUB ideal-int +pkg syscall (netbsd-386), const BPF_TAX ideal-int +pkg syscall (netbsd-386), const BPF_TXA ideal-int +pkg syscall (netbsd-386), const BPF_W ideal-int +pkg syscall (netbsd-386), const BPF_X ideal-int +pkg syscall (netbsd-386), const BRKINT ideal-int +pkg syscall (netbsd-386), const CFLUSH ideal-int +pkg syscall (netbsd-386), const CLOCAL ideal-int +pkg syscall (netbsd-386), const CREAD ideal-int +pkg syscall (netbsd-386), const CS5 ideal-int +pkg syscall (netbsd-386), const CS6 ideal-int +pkg syscall (netbsd-386), const CS7 ideal-int +pkg syscall (netbsd-386), const CS8 ideal-int +pkg syscall (netbsd-386), const CSIZE ideal-int +pkg syscall (netbsd-386), const CSTART ideal-int +pkg syscall (netbsd-386), const CSTATUS ideal-int +pkg syscall (netbsd-386), const CSTOP ideal-int +pkg syscall (netbsd-386), const CSTOPB ideal-int +pkg syscall (netbsd-386), const CSUSP ideal-int +pkg syscall (netbsd-386), const CTL_MAXNAME ideal-int +pkg syscall (netbsd-386), const CTL_NET ideal-int +pkg syscall (netbsd-386), const CTL_QUERY ideal-int +pkg syscall (netbsd-386), const DIOCBSFLUSH ideal-int +pkg syscall (netbsd-386), const DLT_A429 ideal-int +pkg syscall (netbsd-386), const DLT_A653_ICM ideal-int +pkg syscall (netbsd-386), const DLT_AIRONET_HEADER ideal-int +pkg syscall (netbsd-386), const DLT_AOS ideal-int +pkg syscall (netbsd-386), const DLT_APPLE_IP_OVER_IEEE1394 ideal-int +pkg syscall (netbsd-386), const DLT_ARCNET ideal-int +pkg syscall (netbsd-386), const DLT_ARCNET_LINUX ideal-int +pkg syscall (netbsd-386), const DLT_ATM_CLIP ideal-int +pkg syscall (netbsd-386), const DLT_ATM_RFC1483 ideal-int +pkg syscall (netbsd-386), const DLT_AURORA ideal-int +pkg syscall (netbsd-386), const DLT_AX25 ideal-int +pkg syscall (netbsd-386), const DLT_AX25_KISS ideal-int +pkg syscall (netbsd-386), const DLT_BACNET_MS_TP ideal-int +pkg syscall (netbsd-386), const DLT_BLUETOOTH_HCI_H4 ideal-int +pkg syscall (netbsd-386), const DLT_BLUETOOTH_HCI_H4_WITH_PHDR ideal-int +pkg syscall (netbsd-386), const DLT_CAN20B ideal-int +pkg syscall (netbsd-386), const DLT_CAN_SOCKETCAN ideal-int +pkg syscall (netbsd-386), const DLT_CHAOS ideal-int +pkg syscall (netbsd-386), const DLT_CISCO_IOS ideal-int +pkg syscall (netbsd-386), const DLT_C_HDLC ideal-int +pkg syscall (netbsd-386), const DLT_C_HDLC_WITH_DIR ideal-int +pkg syscall (netbsd-386), const DLT_DECT ideal-int +pkg syscall (netbsd-386), const DLT_DOCSIS ideal-int +pkg syscall (netbsd-386), const DLT_ECONET ideal-int +pkg syscall (netbsd-386), const DLT_EN10MB ideal-int +pkg syscall (netbsd-386), const DLT_EN3MB ideal-int +pkg syscall (netbsd-386), const DLT_ENC ideal-int +pkg syscall (netbsd-386), const DLT_ERF ideal-int +pkg syscall (netbsd-386), const DLT_ERF_ETH ideal-int +pkg syscall (netbsd-386), const DLT_ERF_POS ideal-int +pkg syscall (netbsd-386), const DLT_FC_2 ideal-int +pkg syscall (netbsd-386), const DLT_FC_2_WITH_FRAME_DELIMS ideal-int +pkg syscall (netbsd-386), const DLT_FDDI ideal-int +pkg syscall (netbsd-386), const DLT_FLEXRAY ideal-int +pkg syscall (netbsd-386), const DLT_FRELAY ideal-int +pkg syscall (netbsd-386), const DLT_FRELAY_WITH_DIR ideal-int +pkg syscall (netbsd-386), const DLT_GCOM_SERIAL ideal-int +pkg syscall (netbsd-386), const DLT_GCOM_T1E1 ideal-int +pkg syscall (netbsd-386), const DLT_GPF_F ideal-int +pkg syscall (netbsd-386), const DLT_GPF_T ideal-int +pkg syscall (netbsd-386), const DLT_GPRS_LLC ideal-int +pkg syscall (netbsd-386), const DLT_GSMTAP_ABIS ideal-int +pkg syscall (netbsd-386), const DLT_GSMTAP_UM ideal-int +pkg syscall (netbsd-386), const DLT_HDLC ideal-int +pkg syscall (netbsd-386), const DLT_HHDLC ideal-int +pkg syscall (netbsd-386), const DLT_HIPPI ideal-int +pkg syscall (netbsd-386), const DLT_IBM_SN ideal-int +pkg syscall (netbsd-386), const DLT_IBM_SP ideal-int +pkg syscall (netbsd-386), const DLT_IEEE802 ideal-int +pkg syscall (netbsd-386), const DLT_IEEE802_11 ideal-int +pkg syscall (netbsd-386), const DLT_IEEE802_11_RADIO ideal-int +pkg syscall (netbsd-386), const DLT_IEEE802_11_RADIO_AVS ideal-int +pkg syscall (netbsd-386), const DLT_IEEE802_15_4 ideal-int +pkg syscall (netbsd-386), const DLT_IEEE802_15_4_LINUX ideal-int +pkg syscall (netbsd-386), const DLT_IEEE802_15_4_NONASK_PHY ideal-int +pkg syscall (netbsd-386), const DLT_IEEE802_16_MAC_CPS ideal-int +pkg syscall (netbsd-386), const DLT_IEEE802_16_MAC_CPS_RADIO ideal-int +pkg syscall (netbsd-386), const DLT_IPMB ideal-int +pkg syscall (netbsd-386), const DLT_IPMB_LINUX ideal-int +pkg syscall (netbsd-386), const DLT_IPNET ideal-int +pkg syscall (netbsd-386), const DLT_IPV4 ideal-int +pkg syscall (netbsd-386), const DLT_IPV6 ideal-int +pkg syscall (netbsd-386), const DLT_IP_OVER_FC ideal-int +pkg syscall (netbsd-386), const DLT_JUNIPER_ATM1 ideal-int +pkg syscall (netbsd-386), const DLT_JUNIPER_ATM2 ideal-int +pkg syscall (netbsd-386), const DLT_JUNIPER_CHDLC ideal-int +pkg syscall (netbsd-386), const DLT_JUNIPER_ES ideal-int +pkg syscall (netbsd-386), const DLT_JUNIPER_ETHER ideal-int +pkg syscall (netbsd-386), const DLT_JUNIPER_FRELAY ideal-int +pkg syscall (netbsd-386), const DLT_JUNIPER_GGSN ideal-int +pkg syscall (netbsd-386), const DLT_JUNIPER_ISM ideal-int +pkg syscall (netbsd-386), const DLT_JUNIPER_MFR ideal-int +pkg syscall (netbsd-386), const DLT_JUNIPER_MLFR ideal-int +pkg syscall (netbsd-386), const DLT_JUNIPER_MLPPP ideal-int +pkg syscall (netbsd-386), const DLT_JUNIPER_MONITOR ideal-int +pkg syscall (netbsd-386), const DLT_JUNIPER_PIC_PEER ideal-int +pkg syscall (netbsd-386), const DLT_JUNIPER_PPP ideal-int +pkg syscall (netbsd-386), const DLT_JUNIPER_PPPOE ideal-int +pkg syscall (netbsd-386), const DLT_JUNIPER_PPPOE_ATM ideal-int +pkg syscall (netbsd-386), const DLT_JUNIPER_SERVICES ideal-int +pkg syscall (netbsd-386), const DLT_JUNIPER_ST ideal-int +pkg syscall (netbsd-386), const DLT_JUNIPER_VP ideal-int +pkg syscall (netbsd-386), const DLT_LAPB_WITH_DIR ideal-int +pkg syscall (netbsd-386), const DLT_LAPD ideal-int +pkg syscall (netbsd-386), const DLT_LIN ideal-int +pkg syscall (netbsd-386), const DLT_LINUX_EVDEV ideal-int +pkg syscall (netbsd-386), const DLT_LINUX_IRDA ideal-int +pkg syscall (netbsd-386), const DLT_LINUX_LAPD ideal-int +pkg syscall (netbsd-386), const DLT_LINUX_SLL ideal-int +pkg syscall (netbsd-386), const DLT_LOOP ideal-int +pkg syscall (netbsd-386), const DLT_LTALK ideal-int +pkg syscall (netbsd-386), const DLT_MFR ideal-int +pkg syscall (netbsd-386), const DLT_MOST ideal-int +pkg syscall (netbsd-386), const DLT_MPLS ideal-int +pkg syscall (netbsd-386), const DLT_MTP2 ideal-int +pkg syscall (netbsd-386), const DLT_MTP2_WITH_PHDR ideal-int +pkg syscall (netbsd-386), const DLT_MTP3 ideal-int +pkg syscall (netbsd-386), const DLT_NULL ideal-int +pkg syscall (netbsd-386), const DLT_PCI_EXP ideal-int +pkg syscall (netbsd-386), const DLT_PFLOG ideal-int +pkg syscall (netbsd-386), const DLT_PFSYNC ideal-int +pkg syscall (netbsd-386), const DLT_PPI ideal-int +pkg syscall (netbsd-386), const DLT_PPP ideal-int +pkg syscall (netbsd-386), const DLT_PPP_BSDOS ideal-int +pkg syscall (netbsd-386), const DLT_PPP_ETHER ideal-int +pkg syscall (netbsd-386), const DLT_PPP_PPPD ideal-int +pkg syscall (netbsd-386), const DLT_PPP_SERIAL ideal-int +pkg syscall (netbsd-386), const DLT_PPP_WITH_DIR ideal-int +pkg syscall (netbsd-386), const DLT_PRISM_HEADER ideal-int +pkg syscall (netbsd-386), const DLT_PRONET ideal-int +pkg syscall (netbsd-386), const DLT_RAIF1 ideal-int +pkg syscall (netbsd-386), const DLT_RAW ideal-int +pkg syscall (netbsd-386), const DLT_RAWAF_MASK ideal-int +pkg syscall (netbsd-386), const DLT_RIO ideal-int +pkg syscall (netbsd-386), const DLT_SCCP ideal-int +pkg syscall (netbsd-386), const DLT_SITA ideal-int +pkg syscall (netbsd-386), const DLT_SLIP ideal-int +pkg syscall (netbsd-386), const DLT_SLIP_BSDOS ideal-int +pkg syscall (netbsd-386), const DLT_SUNATM ideal-int +pkg syscall (netbsd-386), const DLT_SYMANTEC_FIREWALL ideal-int +pkg syscall (netbsd-386), const DLT_TZSP ideal-int +pkg syscall (netbsd-386), const DLT_USB ideal-int +pkg syscall (netbsd-386), const DLT_USB_LINUX ideal-int +pkg syscall (netbsd-386), const DLT_USB_LINUX_MMAPPED ideal-int +pkg syscall (netbsd-386), const DLT_WIHART ideal-int +pkg syscall (netbsd-386), const DLT_X2E_SERIAL ideal-int +pkg syscall (netbsd-386), const DLT_X2E_XORAYA ideal-int +pkg syscall (netbsd-386), const DT_BLK ideal-int +pkg syscall (netbsd-386), const DT_CHR ideal-int +pkg syscall (netbsd-386), const DT_DIR ideal-int +pkg syscall (netbsd-386), const DT_FIFO ideal-int +pkg syscall (netbsd-386), const DT_LNK ideal-int +pkg syscall (netbsd-386), const DT_REG ideal-int +pkg syscall (netbsd-386), const DT_SOCK ideal-int +pkg syscall (netbsd-386), const DT_UNKNOWN ideal-int +pkg syscall (netbsd-386), const DT_WHT ideal-int +pkg syscall (netbsd-386), const EAUTH Errno +pkg syscall (netbsd-386), const EBADMSG Errno +pkg syscall (netbsd-386), const EBADRPC Errno +pkg syscall (netbsd-386), const ECHO ideal-int +pkg syscall (netbsd-386), const ECHOCTL ideal-int +pkg syscall (netbsd-386), const ECHOE ideal-int +pkg syscall (netbsd-386), const ECHOK ideal-int +pkg syscall (netbsd-386), const ECHOKE ideal-int +pkg syscall (netbsd-386), const ECHONL ideal-int +pkg syscall (netbsd-386), const ECHOPRT ideal-int +pkg syscall (netbsd-386), const EFTYPE Errno +pkg syscall (netbsd-386), const ELAST Errno +pkg syscall (netbsd-386), const EMULTIHOP Errno +pkg syscall (netbsd-386), const EMUL_LINUX ideal-int +pkg syscall (netbsd-386), const EMUL_LINUX32 ideal-int +pkg syscall (netbsd-386), const EMUL_MAXID ideal-int +pkg syscall (netbsd-386), const ENEEDAUTH Errno +pkg syscall (netbsd-386), const ENOATTR Errno +pkg syscall (netbsd-386), const ENODATA Errno +pkg syscall (netbsd-386), const ENOLINK Errno +pkg syscall (netbsd-386), const ENOSR Errno +pkg syscall (netbsd-386), const ENOSTR Errno +pkg syscall (netbsd-386), const EN_SW_CTL_INF ideal-int +pkg syscall (netbsd-386), const EN_SW_CTL_PREC ideal-int +pkg syscall (netbsd-386), const EN_SW_CTL_ROUND ideal-int +pkg syscall (netbsd-386), const EN_SW_DATACHAIN ideal-int +pkg syscall (netbsd-386), const EN_SW_DENORM ideal-int +pkg syscall (netbsd-386), const EN_SW_INVOP ideal-int +pkg syscall (netbsd-386), const EN_SW_OVERFLOW ideal-int +pkg syscall (netbsd-386), const EN_SW_PRECLOSS ideal-int +pkg syscall (netbsd-386), const EN_SW_UNDERFLOW ideal-int +pkg syscall (netbsd-386), const EN_SW_ZERODIV ideal-int +pkg syscall (netbsd-386), const EPROCLIM Errno +pkg syscall (netbsd-386), const EPROCUNAVAIL Errno +pkg syscall (netbsd-386), const EPROGMISMATCH Errno +pkg syscall (netbsd-386), const EPROGUNAVAIL Errno +pkg syscall (netbsd-386), const EPROTO Errno +pkg syscall (netbsd-386), const ERPCMISMATCH Errno +pkg syscall (netbsd-386), const ETHERCAP_JUMBO_MTU ideal-int +pkg syscall (netbsd-386), const ETHERCAP_VLAN_HWTAGGING ideal-int +pkg syscall (netbsd-386), const ETHERCAP_VLAN_MTU ideal-int +pkg syscall (netbsd-386), const ETHERMIN ideal-int +pkg syscall (netbsd-386), const ETHERMTU ideal-int +pkg syscall (netbsd-386), const ETHERMTU_JUMBO ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_8023 ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_AARP ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_ACCTON ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_AEONIC ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_ALPHA ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_AMBER ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_AMOEBA ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_APOLLO ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_APOLLODOMAIN ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_APPLETALK ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_APPLITEK ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_ARGONAUT ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_ARP ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_AT ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_ATALK ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_ATOMIC ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_ATT ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_ATTSTANFORD ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_AUTOPHON ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_AXIS ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_BCLOOP ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_BOFL ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_CABLETRON ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_CHAOS ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_COMDESIGN ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_COMPUGRAPHIC ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_COUNTERPOINT ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_CRONUS ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_CRONUSVLN ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_DCA ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_DDE ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_DEBNI ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_DECAM ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_DECCUST ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_DECDIAG ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_DECDNS ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_DECDTS ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_DECEXPER ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_DECLAST ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_DECLTM ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_DECMUMPS ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_DECNETBIOS ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_DELTACON ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_DIDDLE ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_DLOG1 ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_DLOG2 ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_DN ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_DOGFIGHT ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_DSMD ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_ECMA ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_ENCRYPT ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_ES ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_EXCELAN ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_EXPERDATA ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_FLIP ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_FLOWCONTROL ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_FRARP ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_GENDYN ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_HAYES ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_HIPPI_FP ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_HITACHI ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_HP ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_IEEEPUP ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_IEEEPUPAT ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_IMLBL ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_IMLBLDIAG ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_IP ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_IPAS ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_IPV6 ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_IPX ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_IPXNEW ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_KALPANA ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_LANBRIDGE ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_LANPROBE ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_LAT ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_LBACK ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_LITTLE ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_LOGICRAFT ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_LOOPBACK ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_MATRA ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_MAX ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_MERIT ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_MICP ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_MOPDL ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_MOPRC ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_MOTOROLA ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_MPLS ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_MPLS_MCAST ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_MUMPS ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_NBPCC ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_NBPCLAIM ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_NBPCLREQ ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_NBPCLRSP ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_NBPCREQ ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_NBPCRSP ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_NBPDG ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_NBPDGB ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_NBPDLTE ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_NBPRAR ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_NBPRAS ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_NBPRST ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_NBPSCD ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_NBPVCD ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_NBS ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_NCD ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_NESTAR ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_NETBEUI ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_NOVELL ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_NS ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_NSAT ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_NSCOMPAT ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_NTRAILER ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_OS9 ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_OS9NET ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_PACER ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_PAE ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_PCS ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_PLANNING ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_PPP ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_PPPOE ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_PPPOEDISC ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_PRIMENTS ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_PUP ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_PUPAT ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_RACAL ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_RATIONAL ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_RAWFR ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_RCL ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_RDP ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_RETIX ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_REVARP ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_SCA ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_SECTRA ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_SECUREDATA ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_SGITW ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_SG_BOUNCE ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_SG_DIAG ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_SG_NETGAMES ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_SG_RESV ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_SIMNET ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_SLOWPROTOCOLS ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_SNA ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_SNMP ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_SONIX ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_SPIDER ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_SPRITE ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_STP ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_TALARIS ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_TALARISMC ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_TCPCOMP ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_TCPSM ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_TEC ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_TIGAN ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_TRAIL ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_TRANSETHER ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_TYMSHARE ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_UBBST ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_UBDEBUG ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_UBDIAGLOOP ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_UBDL ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_UBNIU ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_UBNMC ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_VALID ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_VARIAN ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_VAXELN ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_VEECO ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_VEXP ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_VGLAB ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_VINES ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_VINESECHO ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_VINESLOOP ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_VITAL ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_VLAN ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_VLTLMAN ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_VPROD ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_VURESERVED ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_WATERLOO ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_WELLFLEET ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_X25 ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_X75 ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_XNSSM ideal-int +pkg syscall (netbsd-386), const ETHERTYPE_XTP ideal-int +pkg syscall (netbsd-386), const ETHER_ADDR_LEN ideal-int +pkg syscall (netbsd-386), const ETHER_CRC_LEN ideal-int +pkg syscall (netbsd-386), const ETHER_CRC_POLY_BE ideal-int +pkg syscall (netbsd-386), const ETHER_CRC_POLY_LE ideal-int +pkg syscall (netbsd-386), const ETHER_HDR_LEN ideal-int +pkg syscall (netbsd-386), const ETHER_MAX_LEN ideal-int +pkg syscall (netbsd-386), const ETHER_MAX_LEN_JUMBO ideal-int +pkg syscall (netbsd-386), const ETHER_MIN_LEN ideal-int +pkg syscall (netbsd-386), const ETHER_PPPOE_ENCAP_LEN ideal-int +pkg syscall (netbsd-386), const ETHER_TYPE_LEN ideal-int +pkg syscall (netbsd-386), const ETHER_VLAN_ENCAP_LEN ideal-int +pkg syscall (netbsd-386), const ETIME Errno +pkg syscall (netbsd-386), const EVFILT_AIO ideal-int +pkg syscall (netbsd-386), const EVFILT_PROC ideal-int +pkg syscall (netbsd-386), const EVFILT_READ ideal-int +pkg syscall (netbsd-386), const EVFILT_SIGNAL ideal-int +pkg syscall (netbsd-386), const EVFILT_SYSCOUNT ideal-int +pkg syscall (netbsd-386), const EVFILT_TIMER ideal-int +pkg syscall (netbsd-386), const EVFILT_VNODE ideal-int +pkg syscall (netbsd-386), const EVFILT_WRITE ideal-int +pkg syscall (netbsd-386), const EV_ADD ideal-int +pkg syscall (netbsd-386), const EV_CLEAR ideal-int +pkg syscall (netbsd-386), const EV_DELETE ideal-int +pkg syscall (netbsd-386), const EV_DISABLE ideal-int +pkg syscall (netbsd-386), const EV_ENABLE ideal-int +pkg syscall (netbsd-386), const EV_EOF ideal-int +pkg syscall (netbsd-386), const EV_ERROR ideal-int +pkg syscall (netbsd-386), const EV_FLAG1 ideal-int +pkg syscall (netbsd-386), const EV_ONESHOT ideal-int +pkg syscall (netbsd-386), const EV_SYSFLAGS ideal-int +pkg syscall (netbsd-386), const EXTA ideal-int +pkg syscall (netbsd-386), const EXTB ideal-int +pkg syscall (netbsd-386), const EXTPROC ideal-int +pkg syscall (netbsd-386), const FD_CLOEXEC ideal-int +pkg syscall (netbsd-386), const FD_SETSIZE ideal-int +pkg syscall (netbsd-386), const FLUSHO ideal-int +pkg syscall (netbsd-386), const F_CLOSEM ideal-int +pkg syscall (netbsd-386), const F_DUPFD ideal-int +pkg syscall (netbsd-386), const F_DUPFD_CLOEXEC ideal-int +pkg syscall (netbsd-386), const F_FSCTL ideal-int +pkg syscall (netbsd-386), const F_FSDIRMASK ideal-int +pkg syscall (netbsd-386), const F_FSIN ideal-int +pkg syscall (netbsd-386), const F_FSINOUT ideal-int +pkg syscall (netbsd-386), const F_FSOUT ideal-int +pkg syscall (netbsd-386), const F_FSPRIV ideal-int +pkg syscall (netbsd-386), const F_FSVOID ideal-int +pkg syscall (netbsd-386), const F_GETFD ideal-int +pkg syscall (netbsd-386), const F_GETFL ideal-int +pkg syscall (netbsd-386), const F_GETLK ideal-int +pkg syscall (netbsd-386), const F_GETNOSIGPIPE ideal-int +pkg syscall (netbsd-386), const F_GETOWN ideal-int +pkg syscall (netbsd-386), const F_MAXFD ideal-int +pkg syscall (netbsd-386), const F_OK ideal-int +pkg syscall (netbsd-386), const F_PARAM_MASK ideal-int +pkg syscall (netbsd-386), const F_PARAM_MAX ideal-int +pkg syscall (netbsd-386), const F_RDLCK ideal-int +pkg syscall (netbsd-386), const F_SETFD ideal-int +pkg syscall (netbsd-386), const F_SETFL ideal-int +pkg syscall (netbsd-386), const F_SETLK ideal-int +pkg syscall (netbsd-386), const F_SETLKW ideal-int +pkg syscall (netbsd-386), const F_SETNOSIGPIPE ideal-int +pkg syscall (netbsd-386), const F_SETOWN ideal-int +pkg syscall (netbsd-386), const F_UNLCK ideal-int +pkg syscall (netbsd-386), const F_WRLCK ideal-int +pkg syscall (netbsd-386), const HUPCL ideal-int +pkg syscall (netbsd-386), const ICANON ideal-int +pkg syscall (netbsd-386), const ICMP6_FILTER = 18 +pkg syscall (netbsd-386), const ICMP6_FILTER ideal-int +pkg syscall (netbsd-386), const ICRNL ideal-int +pkg syscall (netbsd-386), const IEXTEN ideal-int +pkg syscall (netbsd-386), const IFAN_ARRIVAL ideal-int +pkg syscall (netbsd-386), const IFAN_DEPARTURE ideal-int +pkg syscall (netbsd-386), const IFA_ROUTE ideal-int +pkg syscall (netbsd-386), const IFF_ALLMULTI ideal-int +pkg syscall (netbsd-386), const IFF_CANTCHANGE ideal-int +pkg syscall (netbsd-386), const IFF_DEBUG ideal-int +pkg syscall (netbsd-386), const IFF_LINK0 ideal-int +pkg syscall (netbsd-386), const IFF_LINK1 ideal-int +pkg syscall (netbsd-386), const IFF_LINK2 ideal-int +pkg syscall (netbsd-386), const IFF_NOARP ideal-int +pkg syscall (netbsd-386), const IFF_NOTRAILERS ideal-int +pkg syscall (netbsd-386), const IFF_OACTIVE ideal-int +pkg syscall (netbsd-386), const IFF_POINTOPOINT ideal-int +pkg syscall (netbsd-386), const IFF_PROMISC ideal-int +pkg syscall (netbsd-386), const IFF_RUNNING ideal-int +pkg syscall (netbsd-386), const IFF_SIMPLEX ideal-int +pkg syscall (netbsd-386), const IFNAMSIZ ideal-int +pkg syscall (netbsd-386), const IFT_1822 ideal-int +pkg syscall (netbsd-386), const IFT_A12MPPSWITCH ideal-int +pkg syscall (netbsd-386), const IFT_AAL2 ideal-int +pkg syscall (netbsd-386), const IFT_AAL5 ideal-int +pkg syscall (netbsd-386), const IFT_ADSL ideal-int +pkg syscall (netbsd-386), const IFT_AFLANE8023 ideal-int +pkg syscall (netbsd-386), const IFT_AFLANE8025 ideal-int +pkg syscall (netbsd-386), const IFT_ARAP ideal-int +pkg syscall (netbsd-386), const IFT_ARCNET ideal-int +pkg syscall (netbsd-386), const IFT_ARCNETPLUS ideal-int +pkg syscall (netbsd-386), const IFT_ASYNC ideal-int +pkg syscall (netbsd-386), const IFT_ATM ideal-int +pkg syscall (netbsd-386), const IFT_ATMDXI ideal-int +pkg syscall (netbsd-386), const IFT_ATMFUNI ideal-int +pkg syscall (netbsd-386), const IFT_ATMIMA ideal-int +pkg syscall (netbsd-386), const IFT_ATMLOGICAL ideal-int +pkg syscall (netbsd-386), const IFT_ATMRADIO ideal-int +pkg syscall (netbsd-386), const IFT_ATMSUBINTERFACE ideal-int +pkg syscall (netbsd-386), const IFT_ATMVCIENDPT ideal-int +pkg syscall (netbsd-386), const IFT_ATMVIRTUAL ideal-int +pkg syscall (netbsd-386), const IFT_BGPPOLICYACCOUNTING ideal-int +pkg syscall (netbsd-386), const IFT_BRIDGE ideal-int +pkg syscall (netbsd-386), const IFT_BSC ideal-int +pkg syscall (netbsd-386), const IFT_CARP ideal-int +pkg syscall (netbsd-386), const IFT_CCTEMUL ideal-int +pkg syscall (netbsd-386), const IFT_CEPT ideal-int +pkg syscall (netbsd-386), const IFT_CES ideal-int +pkg syscall (netbsd-386), const IFT_CHANNEL ideal-int +pkg syscall (netbsd-386), const IFT_CNR ideal-int +pkg syscall (netbsd-386), const IFT_COFFEE ideal-int +pkg syscall (netbsd-386), const IFT_COMPOSITELINK ideal-int +pkg syscall (netbsd-386), const IFT_DCN ideal-int +pkg syscall (netbsd-386), const IFT_DIGITALPOWERLINE ideal-int +pkg syscall (netbsd-386), const IFT_DIGITALWRAPPEROVERHEADCHANNEL ideal-int +pkg syscall (netbsd-386), const IFT_DLSW ideal-int +pkg syscall (netbsd-386), const IFT_DOCSCABLEDOWNSTREAM ideal-int +pkg syscall (netbsd-386), const IFT_DOCSCABLEMACLAYER ideal-int +pkg syscall (netbsd-386), const IFT_DOCSCABLEUPSTREAM ideal-int +pkg syscall (netbsd-386), const IFT_DOCSCABLEUPSTREAMCHANNEL ideal-int +pkg syscall (netbsd-386), const IFT_DS0 ideal-int +pkg syscall (netbsd-386), const IFT_DS0BUNDLE ideal-int +pkg syscall (netbsd-386), const IFT_DS1FDL ideal-int +pkg syscall (netbsd-386), const IFT_DS3 ideal-int +pkg syscall (netbsd-386), const IFT_DTM ideal-int +pkg syscall (netbsd-386), const IFT_DVBASILN ideal-int +pkg syscall (netbsd-386), const IFT_DVBASIOUT ideal-int +pkg syscall (netbsd-386), const IFT_DVBRCCDOWNSTREAM ideal-int +pkg syscall (netbsd-386), const IFT_DVBRCCMACLAYER ideal-int +pkg syscall (netbsd-386), const IFT_DVBRCCUPSTREAM ideal-int +pkg syscall (netbsd-386), const IFT_ECONET ideal-int +pkg syscall (netbsd-386), const IFT_EON ideal-int +pkg syscall (netbsd-386), const IFT_EPLRS ideal-int +pkg syscall (netbsd-386), const IFT_ESCON ideal-int +pkg syscall (netbsd-386), const IFT_ETHER ideal-int +pkg syscall (netbsd-386), const IFT_FAITH ideal-int +pkg syscall (netbsd-386), const IFT_FAST ideal-int +pkg syscall (netbsd-386), const IFT_FASTETHER ideal-int +pkg syscall (netbsd-386), const IFT_FASTETHERFX ideal-int +pkg syscall (netbsd-386), const IFT_FDDI ideal-int +pkg syscall (netbsd-386), const IFT_FIBRECHANNEL ideal-int +pkg syscall (netbsd-386), const IFT_FRAMERELAYINTERCONNECT ideal-int +pkg syscall (netbsd-386), const IFT_FRAMERELAYMPI ideal-int +pkg syscall (netbsd-386), const IFT_FRDLCIENDPT ideal-int +pkg syscall (netbsd-386), const IFT_FRELAY ideal-int +pkg syscall (netbsd-386), const IFT_FRELAYDCE ideal-int +pkg syscall (netbsd-386), const IFT_FRF16MFRBUNDLE ideal-int +pkg syscall (netbsd-386), const IFT_FRFORWARD ideal-int +pkg syscall (netbsd-386), const IFT_G703AT2MB ideal-int +pkg syscall (netbsd-386), const IFT_G703AT64K ideal-int +pkg syscall (netbsd-386), const IFT_GIF ideal-int +pkg syscall (netbsd-386), const IFT_GIGABITETHERNET ideal-int +pkg syscall (netbsd-386), const IFT_GR303IDT ideal-int +pkg syscall (netbsd-386), const IFT_GR303RDT ideal-int +pkg syscall (netbsd-386), const IFT_H323GATEKEEPER ideal-int +pkg syscall (netbsd-386), const IFT_H323PROXY ideal-int +pkg syscall (netbsd-386), const IFT_HDH1822 ideal-int +pkg syscall (netbsd-386), const IFT_HDLC ideal-int +pkg syscall (netbsd-386), const IFT_HDSL2 ideal-int +pkg syscall (netbsd-386), const IFT_HIPERLAN2 ideal-int +pkg syscall (netbsd-386), const IFT_HIPPI ideal-int +pkg syscall (netbsd-386), const IFT_HIPPIINTERFACE ideal-int +pkg syscall (netbsd-386), const IFT_HOSTPAD ideal-int +pkg syscall (netbsd-386), const IFT_HSSI ideal-int +pkg syscall (netbsd-386), const IFT_HY ideal-int +pkg syscall (netbsd-386), const IFT_IBM370PARCHAN ideal-int +pkg syscall (netbsd-386), const IFT_IDSL ideal-int +pkg syscall (netbsd-386), const IFT_IEEE1394 ideal-int +pkg syscall (netbsd-386), const IFT_IEEE80211 ideal-int +pkg syscall (netbsd-386), const IFT_IEEE80212 ideal-int +pkg syscall (netbsd-386), const IFT_IEEE8023ADLAG ideal-int +pkg syscall (netbsd-386), const IFT_IFGSN ideal-int +pkg syscall (netbsd-386), const IFT_IMT ideal-int +pkg syscall (netbsd-386), const IFT_INFINIBAND ideal-int +pkg syscall (netbsd-386), const IFT_INTERLEAVE ideal-int +pkg syscall (netbsd-386), const IFT_IP ideal-int +pkg syscall (netbsd-386), const IFT_IPFORWARD ideal-int +pkg syscall (netbsd-386), const IFT_IPOVERATM ideal-int +pkg syscall (netbsd-386), const IFT_IPOVERCDLC ideal-int +pkg syscall (netbsd-386), const IFT_IPOVERCLAW ideal-int +pkg syscall (netbsd-386), const IFT_IPSWITCH ideal-int +pkg syscall (netbsd-386), const IFT_ISDN ideal-int +pkg syscall (netbsd-386), const IFT_ISDNBASIC ideal-int +pkg syscall (netbsd-386), const IFT_ISDNPRIMARY ideal-int +pkg syscall (netbsd-386), const IFT_ISDNS ideal-int +pkg syscall (netbsd-386), const IFT_ISDNU ideal-int +pkg syscall (netbsd-386), const IFT_ISO88022LLC ideal-int +pkg syscall (netbsd-386), const IFT_ISO88023 ideal-int +pkg syscall (netbsd-386), const IFT_ISO88024 ideal-int +pkg syscall (netbsd-386), const IFT_ISO88025 ideal-int +pkg syscall (netbsd-386), const IFT_ISO88025CRFPINT ideal-int +pkg syscall (netbsd-386), const IFT_ISO88025DTR ideal-int +pkg syscall (netbsd-386), const IFT_ISO88025FIBER ideal-int +pkg syscall (netbsd-386), const IFT_ISO88026 ideal-int +pkg syscall (netbsd-386), const IFT_ISUP ideal-int +pkg syscall (netbsd-386), const IFT_L2VLAN ideal-int +pkg syscall (netbsd-386), const IFT_L3IPVLAN ideal-int +pkg syscall (netbsd-386), const IFT_L3IPXVLAN ideal-int +pkg syscall (netbsd-386), const IFT_LAPB ideal-int +pkg syscall (netbsd-386), const IFT_LAPD ideal-int +pkg syscall (netbsd-386), const IFT_LAPF ideal-int +pkg syscall (netbsd-386), const IFT_LINEGROUP ideal-int +pkg syscall (netbsd-386), const IFT_LOCALTALK ideal-int +pkg syscall (netbsd-386), const IFT_LOOP ideal-int +pkg syscall (netbsd-386), const IFT_MEDIAMAILOVERIP ideal-int +pkg syscall (netbsd-386), const IFT_MFSIGLINK ideal-int +pkg syscall (netbsd-386), const IFT_MIOX25 ideal-int +pkg syscall (netbsd-386), const IFT_MODEM ideal-int +pkg syscall (netbsd-386), const IFT_MPC ideal-int +pkg syscall (netbsd-386), const IFT_MPLS ideal-int +pkg syscall (netbsd-386), const IFT_MPLSTUNNEL ideal-int +pkg syscall (netbsd-386), const IFT_MSDSL ideal-int +pkg syscall (netbsd-386), const IFT_MVL ideal-int +pkg syscall (netbsd-386), const IFT_MYRINET ideal-int +pkg syscall (netbsd-386), const IFT_NFAS ideal-int +pkg syscall (netbsd-386), const IFT_NSIP ideal-int +pkg syscall (netbsd-386), const IFT_OPTICALCHANNEL ideal-int +pkg syscall (netbsd-386), const IFT_OPTICALTRANSPORT ideal-int +pkg syscall (netbsd-386), const IFT_OTHER ideal-int +pkg syscall (netbsd-386), const IFT_P10 ideal-int +pkg syscall (netbsd-386), const IFT_P80 ideal-int +pkg syscall (netbsd-386), const IFT_PARA ideal-int +pkg syscall (netbsd-386), const IFT_PFLOG ideal-int +pkg syscall (netbsd-386), const IFT_PFSYNC ideal-int +pkg syscall (netbsd-386), const IFT_PLC ideal-int +pkg syscall (netbsd-386), const IFT_PON155 ideal-int +pkg syscall (netbsd-386), const IFT_PON622 ideal-int +pkg syscall (netbsd-386), const IFT_POS ideal-int +pkg syscall (netbsd-386), const IFT_PPP ideal-int +pkg syscall (netbsd-386), const IFT_PPPMULTILINKBUNDLE ideal-int +pkg syscall (netbsd-386), const IFT_PROPATM ideal-int +pkg syscall (netbsd-386), const IFT_PROPBWAP2MP ideal-int +pkg syscall (netbsd-386), const IFT_PROPCNLS ideal-int +pkg syscall (netbsd-386), const IFT_PROPDOCSWIRELESSDOWNSTREAM ideal-int +pkg syscall (netbsd-386), const IFT_PROPDOCSWIRELESSMACLAYER ideal-int +pkg syscall (netbsd-386), const IFT_PROPDOCSWIRELESSUPSTREAM ideal-int +pkg syscall (netbsd-386), const IFT_PROPMUX ideal-int +pkg syscall (netbsd-386), const IFT_PROPVIRTUAL ideal-int +pkg syscall (netbsd-386), const IFT_PROPWIRELESSP2P ideal-int +pkg syscall (netbsd-386), const IFT_PTPSERIAL ideal-int +pkg syscall (netbsd-386), const IFT_PVC ideal-int +pkg syscall (netbsd-386), const IFT_Q2931 ideal-int +pkg syscall (netbsd-386), const IFT_QLLC ideal-int +pkg syscall (netbsd-386), const IFT_RADIOMAC ideal-int +pkg syscall (netbsd-386), const IFT_RADSL ideal-int +pkg syscall (netbsd-386), const IFT_REACHDSL ideal-int +pkg syscall (netbsd-386), const IFT_RFC1483 ideal-int +pkg syscall (netbsd-386), const IFT_RS232 ideal-int +pkg syscall (netbsd-386), const IFT_RSRB ideal-int +pkg syscall (netbsd-386), const IFT_SDLC ideal-int +pkg syscall (netbsd-386), const IFT_SDSL ideal-int +pkg syscall (netbsd-386), const IFT_SHDSL ideal-int +pkg syscall (netbsd-386), const IFT_SIP ideal-int +pkg syscall (netbsd-386), const IFT_SIPSIG ideal-int +pkg syscall (netbsd-386), const IFT_SIPTG ideal-int +pkg syscall (netbsd-386), const IFT_SLIP ideal-int +pkg syscall (netbsd-386), const IFT_SMDSDXI ideal-int +pkg syscall (netbsd-386), const IFT_SMDSICIP ideal-int +pkg syscall (netbsd-386), const IFT_SONET ideal-int +pkg syscall (netbsd-386), const IFT_SONETOVERHEADCHANNEL ideal-int +pkg syscall (netbsd-386), const IFT_SONETPATH ideal-int +pkg syscall (netbsd-386), const IFT_SONETVT ideal-int +pkg syscall (netbsd-386), const IFT_SRP ideal-int +pkg syscall (netbsd-386), const IFT_SS7SIGLINK ideal-int +pkg syscall (netbsd-386), const IFT_STACKTOSTACK ideal-int +pkg syscall (netbsd-386), const IFT_STARLAN ideal-int +pkg syscall (netbsd-386), const IFT_STF ideal-int +pkg syscall (netbsd-386), const IFT_T1 ideal-int +pkg syscall (netbsd-386), const IFT_TDLC ideal-int +pkg syscall (netbsd-386), const IFT_TELINK ideal-int +pkg syscall (netbsd-386), const IFT_TERMPAD ideal-int +pkg syscall (netbsd-386), const IFT_TR008 ideal-int +pkg syscall (netbsd-386), const IFT_TRANSPHDLC ideal-int +pkg syscall (netbsd-386), const IFT_TUNNEL ideal-int +pkg syscall (netbsd-386), const IFT_ULTRA ideal-int +pkg syscall (netbsd-386), const IFT_USB ideal-int +pkg syscall (netbsd-386), const IFT_V11 ideal-int +pkg syscall (netbsd-386), const IFT_V35 ideal-int +pkg syscall (netbsd-386), const IFT_V36 ideal-int +pkg syscall (netbsd-386), const IFT_V37 ideal-int +pkg syscall (netbsd-386), const IFT_VDSL ideal-int +pkg syscall (netbsd-386), const IFT_VIRTUALIPADDRESS ideal-int +pkg syscall (netbsd-386), const IFT_VIRTUALTG ideal-int +pkg syscall (netbsd-386), const IFT_VOICEDID ideal-int +pkg syscall (netbsd-386), const IFT_VOICEEM ideal-int +pkg syscall (netbsd-386), const IFT_VOICEEMFGD ideal-int +pkg syscall (netbsd-386), const IFT_VOICEENCAP ideal-int +pkg syscall (netbsd-386), const IFT_VOICEFGDEANA ideal-int +pkg syscall (netbsd-386), const IFT_VOICEFXO ideal-int +pkg syscall (netbsd-386), const IFT_VOICEFXS ideal-int +pkg syscall (netbsd-386), const IFT_VOICEOVERATM ideal-int +pkg syscall (netbsd-386), const IFT_VOICEOVERCABLE ideal-int +pkg syscall (netbsd-386), const IFT_VOICEOVERFRAMERELAY ideal-int +pkg syscall (netbsd-386), const IFT_VOICEOVERIP ideal-int +pkg syscall (netbsd-386), const IFT_X213 ideal-int +pkg syscall (netbsd-386), const IFT_X25 ideal-int +pkg syscall (netbsd-386), const IFT_X25DDN ideal-int +pkg syscall (netbsd-386), const IFT_X25HUNTGROUP ideal-int +pkg syscall (netbsd-386), const IFT_X25MLP ideal-int +pkg syscall (netbsd-386), const IFT_X25PLE ideal-int +pkg syscall (netbsd-386), const IFT_XETHER ideal-int +pkg syscall (netbsd-386), const IGNBRK ideal-int +pkg syscall (netbsd-386), const IGNCR ideal-int +pkg syscall (netbsd-386), const IGNPAR ideal-int +pkg syscall (netbsd-386), const IMAXBEL ideal-int +pkg syscall (netbsd-386), const INLCR ideal-int +pkg syscall (netbsd-386), const INPCK ideal-int +pkg syscall (netbsd-386), const IN_CLASSA_HOST ideal-int +pkg syscall (netbsd-386), const IN_CLASSA_MAX ideal-int +pkg syscall (netbsd-386), const IN_CLASSA_NET ideal-int +pkg syscall (netbsd-386), const IN_CLASSA_NSHIFT ideal-int +pkg syscall (netbsd-386), const IN_CLASSB_HOST ideal-int +pkg syscall (netbsd-386), const IN_CLASSB_MAX ideal-int +pkg syscall (netbsd-386), const IN_CLASSB_NET ideal-int +pkg syscall (netbsd-386), const IN_CLASSB_NSHIFT ideal-int +pkg syscall (netbsd-386), const IN_CLASSC_HOST ideal-int +pkg syscall (netbsd-386), const IN_CLASSC_NET ideal-int +pkg syscall (netbsd-386), const IN_CLASSC_NSHIFT ideal-int +pkg syscall (netbsd-386), const IN_CLASSD_HOST ideal-int +pkg syscall (netbsd-386), const IN_CLASSD_NET ideal-int +pkg syscall (netbsd-386), const IN_CLASSD_NSHIFT ideal-int +pkg syscall (netbsd-386), const IN_LOOPBACKNET ideal-int +pkg syscall (netbsd-386), const IPPROTO_AH ideal-int +pkg syscall (netbsd-386), const IPPROTO_CARP ideal-int +pkg syscall (netbsd-386), const IPPROTO_DONE ideal-int +pkg syscall (netbsd-386), const IPPROTO_DSTOPTS ideal-int +pkg syscall (netbsd-386), const IPPROTO_EGP ideal-int +pkg syscall (netbsd-386), const IPPROTO_ENCAP ideal-int +pkg syscall (netbsd-386), const IPPROTO_EON ideal-int +pkg syscall (netbsd-386), const IPPROTO_ESP ideal-int +pkg syscall (netbsd-386), const IPPROTO_ETHERIP ideal-int +pkg syscall (netbsd-386), const IPPROTO_FRAGMENT ideal-int +pkg syscall (netbsd-386), const IPPROTO_GGP ideal-int +pkg syscall (netbsd-386), const IPPROTO_GRE ideal-int +pkg syscall (netbsd-386), const IPPROTO_HOPOPTS ideal-int +pkg syscall (netbsd-386), const IPPROTO_ICMP ideal-int +pkg syscall (netbsd-386), const IPPROTO_ICMPV6 ideal-int +pkg syscall (netbsd-386), const IPPROTO_IDP ideal-int +pkg syscall (netbsd-386), const IPPROTO_IGMP ideal-int +pkg syscall (netbsd-386), const IPPROTO_IPCOMP ideal-int +pkg syscall (netbsd-386), const IPPROTO_IPIP ideal-int +pkg syscall (netbsd-386), const IPPROTO_IPV4 ideal-int +pkg syscall (netbsd-386), const IPPROTO_IPV6_ICMP ideal-int +pkg syscall (netbsd-386), const IPPROTO_MAX ideal-int +pkg syscall (netbsd-386), const IPPROTO_MAXID ideal-int +pkg syscall (netbsd-386), const IPPROTO_MOBILE ideal-int +pkg syscall (netbsd-386), const IPPROTO_NONE ideal-int +pkg syscall (netbsd-386), const IPPROTO_PFSYNC ideal-int +pkg syscall (netbsd-386), const IPPROTO_PIM ideal-int +pkg syscall (netbsd-386), const IPPROTO_PUP ideal-int +pkg syscall (netbsd-386), const IPPROTO_RAW ideal-int +pkg syscall (netbsd-386), const IPPROTO_ROUTING ideal-int +pkg syscall (netbsd-386), const IPPROTO_RSVP ideal-int +pkg syscall (netbsd-386), const IPPROTO_TP ideal-int +pkg syscall (netbsd-386), const IPPROTO_VRRP ideal-int +pkg syscall (netbsd-386), const IPV6_CHECKSUM ideal-int +pkg syscall (netbsd-386), const IPV6_DEFAULT_MULTICAST_HOPS ideal-int +pkg syscall (netbsd-386), const IPV6_DEFAULT_MULTICAST_LOOP ideal-int +pkg syscall (netbsd-386), const IPV6_DEFHLIM ideal-int +pkg syscall (netbsd-386), const IPV6_DONTFRAG ideal-int +pkg syscall (netbsd-386), const IPV6_DSTOPTS ideal-int +pkg syscall (netbsd-386), const IPV6_FAITH ideal-int +pkg syscall (netbsd-386), const IPV6_FLOWINFO_MASK ideal-int +pkg syscall (netbsd-386), const IPV6_FLOWLABEL_MASK ideal-int +pkg syscall (netbsd-386), const IPV6_FRAGTTL ideal-int +pkg syscall (netbsd-386), const IPV6_HLIMDEC ideal-int +pkg syscall (netbsd-386), const IPV6_HOPLIMIT ideal-int +pkg syscall (netbsd-386), const IPV6_HOPOPTS ideal-int +pkg syscall (netbsd-386), const IPV6_IPSEC_POLICY ideal-int +pkg syscall (netbsd-386), const IPV6_MAXHLIM ideal-int +pkg syscall (netbsd-386), const IPV6_MAXPACKET ideal-int +pkg syscall (netbsd-386), const IPV6_MMTU ideal-int +pkg syscall (netbsd-386), const IPV6_NEXTHOP ideal-int +pkg syscall (netbsd-386), const IPV6_PATHMTU ideal-int +pkg syscall (netbsd-386), const IPV6_PKTINFO ideal-int +pkg syscall (netbsd-386), const IPV6_PORTRANGE ideal-int +pkg syscall (netbsd-386), const IPV6_PORTRANGE_DEFAULT ideal-int +pkg syscall (netbsd-386), const IPV6_PORTRANGE_HIGH ideal-int +pkg syscall (netbsd-386), const IPV6_PORTRANGE_LOW ideal-int +pkg syscall (netbsd-386), const IPV6_RECVDSTOPTS ideal-int +pkg syscall (netbsd-386), const IPV6_RECVHOPLIMIT ideal-int +pkg syscall (netbsd-386), const IPV6_RECVHOPOPTS ideal-int +pkg syscall (netbsd-386), const IPV6_RECVPATHMTU ideal-int +pkg syscall (netbsd-386), const IPV6_RECVPKTINFO ideal-int +pkg syscall (netbsd-386), const IPV6_RECVRTHDR ideal-int +pkg syscall (netbsd-386), const IPV6_RECVTCLASS ideal-int +pkg syscall (netbsd-386), const IPV6_RTHDR ideal-int +pkg syscall (netbsd-386), const IPV6_RTHDRDSTOPTS ideal-int +pkg syscall (netbsd-386), const IPV6_RTHDR_LOOSE ideal-int +pkg syscall (netbsd-386), const IPV6_RTHDR_STRICT ideal-int +pkg syscall (netbsd-386), const IPV6_RTHDR_TYPE_0 ideal-int +pkg syscall (netbsd-386), const IPV6_SOCKOPT_RESERVED1 ideal-int +pkg syscall (netbsd-386), const IPV6_TCLASS ideal-int +pkg syscall (netbsd-386), const IPV6_USE_MIN_MTU ideal-int +pkg syscall (netbsd-386), const IPV6_VERSION ideal-int +pkg syscall (netbsd-386), const IPV6_VERSION_MASK ideal-int +pkg syscall (netbsd-386), const IP_DEFAULT_MULTICAST_LOOP ideal-int +pkg syscall (netbsd-386), const IP_DEFAULT_MULTICAST_TTL ideal-int +pkg syscall (netbsd-386), const IP_DF ideal-int +pkg syscall (netbsd-386), const IP_EF ideal-int +pkg syscall (netbsd-386), const IP_ERRORMTU ideal-int +pkg syscall (netbsd-386), const IP_HDRINCL ideal-int +pkg syscall (netbsd-386), const IP_IPSEC_POLICY ideal-int +pkg syscall (netbsd-386), const IP_MAXPACKET ideal-int +pkg syscall (netbsd-386), const IP_MAX_MEMBERSHIPS ideal-int +pkg syscall (netbsd-386), const IP_MF ideal-int +pkg syscall (netbsd-386), const IP_MINFRAGSIZE ideal-int +pkg syscall (netbsd-386), const IP_MINTTL ideal-int +pkg syscall (netbsd-386), const IP_MSS ideal-int +pkg syscall (netbsd-386), const IP_OFFMASK ideal-int +pkg syscall (netbsd-386), const IP_OPTIONS ideal-int +pkg syscall (netbsd-386), const IP_PORTRANGE ideal-int +pkg syscall (netbsd-386), const IP_PORTRANGE_DEFAULT ideal-int +pkg syscall (netbsd-386), const IP_PORTRANGE_HIGH ideal-int +pkg syscall (netbsd-386), const IP_PORTRANGE_LOW ideal-int +pkg syscall (netbsd-386), const IP_RECVDSTADDR ideal-int +pkg syscall (netbsd-386), const IP_RECVIF ideal-int +pkg syscall (netbsd-386), const IP_RECVOPTS ideal-int +pkg syscall (netbsd-386), const IP_RECVRETOPTS ideal-int +pkg syscall (netbsd-386), const IP_RECVTTL ideal-int +pkg syscall (netbsd-386), const IP_RETOPTS ideal-int +pkg syscall (netbsd-386), const IP_RF ideal-int +pkg syscall (netbsd-386), const ISIG ideal-int +pkg syscall (netbsd-386), const ISTRIP ideal-int +pkg syscall (netbsd-386), const IXANY ideal-int +pkg syscall (netbsd-386), const IXOFF ideal-int +pkg syscall (netbsd-386), const IXON ideal-int +pkg syscall (netbsd-386), const LOCK_EX ideal-int +pkg syscall (netbsd-386), const LOCK_NB ideal-int +pkg syscall (netbsd-386), const LOCK_SH ideal-int +pkg syscall (netbsd-386), const LOCK_UN ideal-int +pkg syscall (netbsd-386), const MSG_BCAST ideal-int +pkg syscall (netbsd-386), const MSG_CMSG_CLOEXEC ideal-int +pkg syscall (netbsd-386), const MSG_CONTROLMBUF ideal-int +pkg syscall (netbsd-386), const MSG_CTRUNC ideal-int +pkg syscall (netbsd-386), const MSG_DONTROUTE ideal-int +pkg syscall (netbsd-386), const MSG_DONTWAIT ideal-int +pkg syscall (netbsd-386), const MSG_EOR ideal-int +pkg syscall (netbsd-386), const MSG_IOVUSRSPACE ideal-int +pkg syscall (netbsd-386), const MSG_LENUSRSPACE ideal-int +pkg syscall (netbsd-386), const MSG_MCAST ideal-int +pkg syscall (netbsd-386), const MSG_NAMEMBUF ideal-int +pkg syscall (netbsd-386), const MSG_NBIO ideal-int +pkg syscall (netbsd-386), const MSG_NOSIGNAL ideal-int +pkg syscall (netbsd-386), const MSG_OOB ideal-int +pkg syscall (netbsd-386), const MSG_PEEK ideal-int +pkg syscall (netbsd-386), const MSG_TRUNC ideal-int +pkg syscall (netbsd-386), const MSG_USERFLAGS ideal-int +pkg syscall (netbsd-386), const MSG_WAITALL ideal-int +pkg syscall (netbsd-386), const NAME_MAX ideal-int +pkg syscall (netbsd-386), const NET_RT_DUMP ideal-int +pkg syscall (netbsd-386), const NET_RT_FLAGS ideal-int +pkg syscall (netbsd-386), const NET_RT_IFLIST ideal-int +pkg syscall (netbsd-386), const NET_RT_MAXID ideal-int +pkg syscall (netbsd-386), const NET_RT_OIFLIST ideal-int +pkg syscall (netbsd-386), const NET_RT_OOIFLIST ideal-int +pkg syscall (netbsd-386), const NOFLSH ideal-int +pkg syscall (netbsd-386), const NOTE_ATTRIB ideal-int +pkg syscall (netbsd-386), const NOTE_CHILD ideal-int +pkg syscall (netbsd-386), const NOTE_DELETE ideal-int +pkg syscall (netbsd-386), const NOTE_EXEC ideal-int +pkg syscall (netbsd-386), const NOTE_EXIT ideal-int +pkg syscall (netbsd-386), const NOTE_EXTEND ideal-int +pkg syscall (netbsd-386), const NOTE_FORK ideal-int +pkg syscall (netbsd-386), const NOTE_LINK ideal-int +pkg syscall (netbsd-386), const NOTE_LOWAT ideal-int +pkg syscall (netbsd-386), const NOTE_PCTRLMASK ideal-int +pkg syscall (netbsd-386), const NOTE_PDATAMASK ideal-int +pkg syscall (netbsd-386), const NOTE_RENAME ideal-int +pkg syscall (netbsd-386), const NOTE_REVOKE ideal-int +pkg syscall (netbsd-386), const NOTE_TRACK ideal-int +pkg syscall (netbsd-386), const NOTE_TRACKERR ideal-int +pkg syscall (netbsd-386), const NOTE_WRITE ideal-int +pkg syscall (netbsd-386), const OCRNL ideal-int +pkg syscall (netbsd-386), const OFIOGETBMAP ideal-int +pkg syscall (netbsd-386), const ONLCR ideal-int +pkg syscall (netbsd-386), const ONLRET ideal-int +pkg syscall (netbsd-386), const ONOCR ideal-int +pkg syscall (netbsd-386), const ONOEOT ideal-int +pkg syscall (netbsd-386), const OPOST ideal-int +pkg syscall (netbsd-386), const O_ACCMODE ideal-int +pkg syscall (netbsd-386), const O_ALT_IO ideal-int +pkg syscall (netbsd-386), const O_DIRECT ideal-int +pkg syscall (netbsd-386), const O_DIRECTORY ideal-int +pkg syscall (netbsd-386), const O_DSYNC ideal-int +pkg syscall (netbsd-386), const O_EXLOCK ideal-int +pkg syscall (netbsd-386), const O_FSYNC ideal-int +pkg syscall (netbsd-386), const O_NDELAY ideal-int +pkg syscall (netbsd-386), const O_NOFOLLOW ideal-int +pkg syscall (netbsd-386), const O_NOSIGPIPE ideal-int +pkg syscall (netbsd-386), const O_RSYNC ideal-int +pkg syscall (netbsd-386), const O_SHLOCK ideal-int +pkg syscall (netbsd-386), const PARENB ideal-int +pkg syscall (netbsd-386), const PARMRK ideal-int +pkg syscall (netbsd-386), const PARODD ideal-int +pkg syscall (netbsd-386), const PENDIN ideal-int +pkg syscall (netbsd-386), const PRIO_PGRP = 1 +pkg syscall (netbsd-386), const PRIO_PGRP ideal-int +pkg syscall (netbsd-386), const PRIO_PROCESS = 0 +pkg syscall (netbsd-386), const PRIO_PROCESS ideal-int +pkg syscall (netbsd-386), const PRIO_USER = 2 +pkg syscall (netbsd-386), const PRIO_USER ideal-int +pkg syscall (netbsd-386), const PRI_IOFLUSH ideal-int +pkg syscall (netbsd-386), const PTRACE_CONT ideal-int +pkg syscall (netbsd-386), const PTRACE_KILL ideal-int +pkg syscall (netbsd-386), const PTRACE_TRACEME ideal-int +pkg syscall (netbsd-386), const RLIMIT_AS ideal-int +pkg syscall (netbsd-386), const RLIMIT_CORE ideal-int +pkg syscall (netbsd-386), const RLIMIT_CPU ideal-int +pkg syscall (netbsd-386), const RLIMIT_DATA ideal-int +pkg syscall (netbsd-386), const RLIMIT_FSIZE ideal-int +pkg syscall (netbsd-386), const RLIMIT_NOFILE ideal-int +pkg syscall (netbsd-386), const RLIMIT_STACK ideal-int +pkg syscall (netbsd-386), const RLIM_INFINITY ideal-int +pkg syscall (netbsd-386), const RTAX_AUTHOR ideal-int +pkg syscall (netbsd-386), const RTAX_BRD ideal-int +pkg syscall (netbsd-386), const RTAX_DST ideal-int +pkg syscall (netbsd-386), const RTAX_GATEWAY ideal-int +pkg syscall (netbsd-386), const RTAX_GENMASK ideal-int +pkg syscall (netbsd-386), const RTAX_IFA ideal-int +pkg syscall (netbsd-386), const RTAX_IFP ideal-int +pkg syscall (netbsd-386), const RTAX_MAX ideal-int +pkg syscall (netbsd-386), const RTAX_NETMASK ideal-int +pkg syscall (netbsd-386), const RTAX_TAG ideal-int +pkg syscall (netbsd-386), const RTA_AUTHOR ideal-int +pkg syscall (netbsd-386), const RTA_BRD ideal-int +pkg syscall (netbsd-386), const RTA_DST ideal-int +pkg syscall (netbsd-386), const RTA_GATEWAY ideal-int +pkg syscall (netbsd-386), const RTA_GENMASK ideal-int +pkg syscall (netbsd-386), const RTA_IFA ideal-int +pkg syscall (netbsd-386), const RTA_IFP ideal-int +pkg syscall (netbsd-386), const RTA_NETMASK ideal-int +pkg syscall (netbsd-386), const RTA_TAG ideal-int +pkg syscall (netbsd-386), const RTF_ANNOUNCE ideal-int +pkg syscall (netbsd-386), const RTF_BLACKHOLE ideal-int +pkg syscall (netbsd-386), const RTF_CLONED ideal-int +pkg syscall (netbsd-386), const RTF_CLONING ideal-int +pkg syscall (netbsd-386), const RTF_DONE ideal-int +pkg syscall (netbsd-386), const RTF_DYNAMIC ideal-int +pkg syscall (netbsd-386), const RTF_GATEWAY ideal-int +pkg syscall (netbsd-386), const RTF_HOST ideal-int +pkg syscall (netbsd-386), const RTF_LLINFO ideal-int +pkg syscall (netbsd-386), const RTF_MASK ideal-int +pkg syscall (netbsd-386), const RTF_MODIFIED ideal-int +pkg syscall (netbsd-386), const RTF_PROTO1 ideal-int +pkg syscall (netbsd-386), const RTF_PROTO2 ideal-int +pkg syscall (netbsd-386), const RTF_REJECT ideal-int +pkg syscall (netbsd-386), const RTF_SRC ideal-int +pkg syscall (netbsd-386), const RTF_STATIC ideal-int +pkg syscall (netbsd-386), const RTF_UP ideal-int +pkg syscall (netbsd-386), const RTF_XRESOLVE ideal-int +pkg syscall (netbsd-386), const RTM_ADD ideal-int +pkg syscall (netbsd-386), const RTM_CHANGE ideal-int +pkg syscall (netbsd-386), const RTM_CHGADDR ideal-int +pkg syscall (netbsd-386), const RTM_DELADDR ideal-int +pkg syscall (netbsd-386), const RTM_DELETE ideal-int +pkg syscall (netbsd-386), const RTM_GET ideal-int +pkg syscall (netbsd-386), const RTM_IEEE80211 ideal-int +pkg syscall (netbsd-386), const RTM_IFANNOUNCE ideal-int +pkg syscall (netbsd-386), const RTM_IFINFO ideal-int +pkg syscall (netbsd-386), const RTM_LLINFO_UPD ideal-int +pkg syscall (netbsd-386), const RTM_LOCK ideal-int +pkg syscall (netbsd-386), const RTM_LOSING ideal-int +pkg syscall (netbsd-386), const RTM_MISS ideal-int +pkg syscall (netbsd-386), const RTM_NEWADDR ideal-int +pkg syscall (netbsd-386), const RTM_OIFINFO ideal-int +pkg syscall (netbsd-386), const RTM_OLDADD ideal-int +pkg syscall (netbsd-386), const RTM_OLDDEL ideal-int +pkg syscall (netbsd-386), const RTM_OOIFINFO ideal-int +pkg syscall (netbsd-386), const RTM_REDIRECT ideal-int +pkg syscall (netbsd-386), const RTM_RESOLVE ideal-int +pkg syscall (netbsd-386), const RTM_RTTUNIT ideal-int +pkg syscall (netbsd-386), const RTM_SETGATE ideal-int +pkg syscall (netbsd-386), const RTM_VERSION ideal-int +pkg syscall (netbsd-386), const RTV_EXPIRE ideal-int +pkg syscall (netbsd-386), const RTV_HOPCOUNT ideal-int +pkg syscall (netbsd-386), const RTV_MTU ideal-int +pkg syscall (netbsd-386), const RTV_RPIPE ideal-int +pkg syscall (netbsd-386), const RTV_RTT ideal-int +pkg syscall (netbsd-386), const RTV_RTTVAR ideal-int +pkg syscall (netbsd-386), const RTV_SPIPE ideal-int +pkg syscall (netbsd-386), const RTV_SSTHRESH ideal-int +pkg syscall (netbsd-386), const RUSAGE_CHILDREN ideal-int +pkg syscall (netbsd-386), const RUSAGE_SELF ideal-int +pkg syscall (netbsd-386), const SCM_CREDS ideal-int +pkg syscall (netbsd-386), const SCM_RIGHTS ideal-int +pkg syscall (netbsd-386), const SCM_TIMESTAMP ideal-int +pkg syscall (netbsd-386), const SIGCHLD Signal +pkg syscall (netbsd-386), const SIGCONT Signal +pkg syscall (netbsd-386), const SIGEMT Signal +pkg syscall (netbsd-386), const SIGINFO Signal +pkg syscall (netbsd-386), const SIGIO Signal +pkg syscall (netbsd-386), const SIGIOT Signal +pkg syscall (netbsd-386), const SIGPROF Signal +pkg syscall (netbsd-386), const SIGPWR Signal +pkg syscall (netbsd-386), const SIGSTOP Signal +pkg syscall (netbsd-386), const SIGSYS Signal +pkg syscall (netbsd-386), const SIGTSTP Signal +pkg syscall (netbsd-386), const SIGTTIN Signal +pkg syscall (netbsd-386), const SIGTTOU Signal +pkg syscall (netbsd-386), const SIGURG Signal +pkg syscall (netbsd-386), const SIGUSR1 Signal +pkg syscall (netbsd-386), const SIGUSR2 Signal +pkg syscall (netbsd-386), const SIGVTALRM Signal +pkg syscall (netbsd-386), const SIGWINCH Signal +pkg syscall (netbsd-386), const SIGXCPU Signal +pkg syscall (netbsd-386), const SIGXFSZ Signal +pkg syscall (netbsd-386), const SIOCADDMULTI ideal-int +pkg syscall (netbsd-386), const SIOCADDRT ideal-int +pkg syscall (netbsd-386), const SIOCAIFADDR ideal-int +pkg syscall (netbsd-386), const SIOCALIFADDR ideal-int +pkg syscall (netbsd-386), const SIOCATMARK ideal-int +pkg syscall (netbsd-386), const SIOCDELMULTI ideal-int +pkg syscall (netbsd-386), const SIOCDELRT ideal-int +pkg syscall (netbsd-386), const SIOCDIFADDR ideal-int +pkg syscall (netbsd-386), const SIOCDIFPHYADDR ideal-int +pkg syscall (netbsd-386), const SIOCDLIFADDR ideal-int +pkg syscall (netbsd-386), const SIOCGDRVSPEC ideal-int +pkg syscall (netbsd-386), const SIOCGETPFSYNC ideal-int +pkg syscall (netbsd-386), const SIOCGETSGCNT ideal-int +pkg syscall (netbsd-386), const SIOCGETVIFCNT ideal-int +pkg syscall (netbsd-386), const SIOCGHIWAT ideal-int +pkg syscall (netbsd-386), const SIOCGIFADDR ideal-int +pkg syscall (netbsd-386), const SIOCGIFADDRPREF ideal-int +pkg syscall (netbsd-386), const SIOCGIFALIAS ideal-int +pkg syscall (netbsd-386), const SIOCGIFBRDADDR ideal-int +pkg syscall (netbsd-386), const SIOCGIFCAP ideal-int +pkg syscall (netbsd-386), const SIOCGIFCONF ideal-int +pkg syscall (netbsd-386), const SIOCGIFDATA ideal-int +pkg syscall (netbsd-386), const SIOCGIFDLT ideal-int +pkg syscall (netbsd-386), const SIOCGIFDSTADDR ideal-int +pkg syscall (netbsd-386), const SIOCGIFFLAGS ideal-int +pkg syscall (netbsd-386), const SIOCGIFGENERIC ideal-int +pkg syscall (netbsd-386), const SIOCGIFMEDIA ideal-int +pkg syscall (netbsd-386), const SIOCGIFMETRIC ideal-int +pkg syscall (netbsd-386), const SIOCGIFMTU ideal-int +pkg syscall (netbsd-386), const SIOCGIFNETMASK ideal-int +pkg syscall (netbsd-386), const SIOCGIFPDSTADDR ideal-int +pkg syscall (netbsd-386), const SIOCGIFPSRCADDR ideal-int +pkg syscall (netbsd-386), const SIOCGLIFADDR ideal-int +pkg syscall (netbsd-386), const SIOCGLIFPHYADDR ideal-int +pkg syscall (netbsd-386), const SIOCGLINKSTR ideal-int +pkg syscall (netbsd-386), const SIOCGLOWAT ideal-int +pkg syscall (netbsd-386), const SIOCGPGRP ideal-int +pkg syscall (netbsd-386), const SIOCGVH ideal-int +pkg syscall (netbsd-386), const SIOCIFCREATE ideal-int +pkg syscall (netbsd-386), const SIOCIFDESTROY ideal-int +pkg syscall (netbsd-386), const SIOCIFGCLONERS ideal-int +pkg syscall (netbsd-386), const SIOCINITIFADDR ideal-int +pkg syscall (netbsd-386), const SIOCSDRVSPEC ideal-int +pkg syscall (netbsd-386), const SIOCSETPFSYNC ideal-int +pkg syscall (netbsd-386), const SIOCSHIWAT ideal-int +pkg syscall (netbsd-386), const SIOCSIFADDR ideal-int +pkg syscall (netbsd-386), const SIOCSIFADDRPREF ideal-int +pkg syscall (netbsd-386), const SIOCSIFBRDADDR ideal-int +pkg syscall (netbsd-386), const SIOCSIFCAP ideal-int +pkg syscall (netbsd-386), const SIOCSIFDSTADDR ideal-int +pkg syscall (netbsd-386), const SIOCSIFFLAGS ideal-int +pkg syscall (netbsd-386), const SIOCSIFGENERIC ideal-int +pkg syscall (netbsd-386), const SIOCSIFMEDIA ideal-int +pkg syscall (netbsd-386), const SIOCSIFMETRIC ideal-int +pkg syscall (netbsd-386), const SIOCSIFMTU ideal-int +pkg syscall (netbsd-386), const SIOCSIFNETMASK ideal-int +pkg syscall (netbsd-386), const SIOCSIFPHYADDR ideal-int +pkg syscall (netbsd-386), const SIOCSLIFPHYADDR ideal-int +pkg syscall (netbsd-386), const SIOCSLINKSTR ideal-int +pkg syscall (netbsd-386), const SIOCSLOWAT ideal-int +pkg syscall (netbsd-386), const SIOCSPGRP ideal-int +pkg syscall (netbsd-386), const SIOCSVH ideal-int +pkg syscall (netbsd-386), const SIOCZIFDATA ideal-int +pkg syscall (netbsd-386), const SOCK_CLOEXEC ideal-int +pkg syscall (netbsd-386), const SOCK_FLAGS_MASK ideal-int +pkg syscall (netbsd-386), const SOCK_NONBLOCK ideal-int +pkg syscall (netbsd-386), const SOCK_NOSIGPIPE ideal-int +pkg syscall (netbsd-386), const SOCK_RDM ideal-int +pkg syscall (netbsd-386), const SO_ACCEPTCONN ideal-int +pkg syscall (netbsd-386), const SO_ACCEPTFILTER ideal-int +pkg syscall (netbsd-386), const SO_DEBUG ideal-int +pkg syscall (netbsd-386), const SO_ERROR ideal-int +pkg syscall (netbsd-386), const SO_NOHEADER ideal-int +pkg syscall (netbsd-386), const SO_NOSIGPIPE ideal-int +pkg syscall (netbsd-386), const SO_OOBINLINE ideal-int +pkg syscall (netbsd-386), const SO_OVERFLOWED ideal-int +pkg syscall (netbsd-386), const SO_RCVLOWAT ideal-int +pkg syscall (netbsd-386), const SO_RCVTIMEO ideal-int +pkg syscall (netbsd-386), const SO_REUSEPORT ideal-int +pkg syscall (netbsd-386), const SO_SNDLOWAT ideal-int +pkg syscall (netbsd-386), const SO_SNDTIMEO ideal-int +pkg syscall (netbsd-386), const SO_TIMESTAMP ideal-int +pkg syscall (netbsd-386), const SO_TYPE ideal-int +pkg syscall (netbsd-386), const SO_USELOOPBACK ideal-int +pkg syscall (netbsd-386), const SYSCTL_VERSION ideal-int +pkg syscall (netbsd-386), const SYSCTL_VERS_0 ideal-int +pkg syscall (netbsd-386), const SYSCTL_VERS_1 ideal-int +pkg syscall (netbsd-386), const SYSCTL_VERS_MASK ideal-int +pkg syscall (netbsd-386), const SYS_ACCEPT ideal-int +pkg syscall (netbsd-386), const SYS_ACCESS ideal-int +pkg syscall (netbsd-386), const SYS_ACCT ideal-int +pkg syscall (netbsd-386), const SYS_ADJTIME ideal-int +pkg syscall (netbsd-386), const SYS_BIND ideal-int +pkg syscall (netbsd-386), const SYS_BREAK ideal-int +pkg syscall (netbsd-386), const SYS_CHDIR ideal-int +pkg syscall (netbsd-386), const SYS_CHFLAGS ideal-int +pkg syscall (netbsd-386), const SYS_CHMOD ideal-int +pkg syscall (netbsd-386), const SYS_CHOWN ideal-int +pkg syscall (netbsd-386), const SYS_CHROOT ideal-int +pkg syscall (netbsd-386), const SYS_CLOCK_GETRES ideal-int +pkg syscall (netbsd-386), const SYS_CLOCK_GETTIME ideal-int +pkg syscall (netbsd-386), const SYS_CLOCK_SETTIME ideal-int +pkg syscall (netbsd-386), const SYS_CLOSE ideal-int +pkg syscall (netbsd-386), const SYS_CONNECT ideal-int +pkg syscall (netbsd-386), const SYS_DUP ideal-int +pkg syscall (netbsd-386), const SYS_DUP2 ideal-int +pkg syscall (netbsd-386), const SYS_DUP3 ideal-int +pkg syscall (netbsd-386), const SYS_EXECVE ideal-int +pkg syscall (netbsd-386), const SYS_EXIT ideal-int +pkg syscall (netbsd-386), const SYS_EXTATTRCTL ideal-int +pkg syscall (netbsd-386), const SYS_EXTATTR_DELETE_FD ideal-int +pkg syscall (netbsd-386), const SYS_EXTATTR_DELETE_FILE ideal-int +pkg syscall (netbsd-386), const SYS_EXTATTR_DELETE_LINK ideal-int +pkg syscall (netbsd-386), const SYS_EXTATTR_GET_FD ideal-int +pkg syscall (netbsd-386), const SYS_EXTATTR_GET_FILE ideal-int +pkg syscall (netbsd-386), const SYS_EXTATTR_GET_LINK ideal-int +pkg syscall (netbsd-386), const SYS_EXTATTR_LIST_FD ideal-int +pkg syscall (netbsd-386), const SYS_EXTATTR_LIST_FILE ideal-int +pkg syscall (netbsd-386), const SYS_EXTATTR_LIST_LINK ideal-int +pkg syscall (netbsd-386), const SYS_EXTATTR_SET_FD ideal-int +pkg syscall (netbsd-386), const SYS_EXTATTR_SET_FILE ideal-int +pkg syscall (netbsd-386), const SYS_EXTATTR_SET_LINK ideal-int +pkg syscall (netbsd-386), const SYS_FACCESSAT ideal-int +pkg syscall (netbsd-386), const SYS_FCHDIR ideal-int +pkg syscall (netbsd-386), const SYS_FCHFLAGS ideal-int +pkg syscall (netbsd-386), const SYS_FCHMOD ideal-int +pkg syscall (netbsd-386), const SYS_FCHMODAT ideal-int +pkg syscall (netbsd-386), const SYS_FCHOWN ideal-int +pkg syscall (netbsd-386), const SYS_FCHOWNAT ideal-int +pkg syscall (netbsd-386), const SYS_FCHROOT ideal-int +pkg syscall (netbsd-386), const SYS_FCNTL ideal-int +pkg syscall (netbsd-386), const SYS_FDATASYNC ideal-int +pkg syscall (netbsd-386), const SYS_FEXECVE ideal-int +pkg syscall (netbsd-386), const SYS_FGETXATTR ideal-int +pkg syscall (netbsd-386), const SYS_FHSTAT ideal-int +pkg syscall (netbsd-386), const SYS_FKTRACE ideal-int +pkg syscall (netbsd-386), const SYS_FLISTXATTR ideal-int +pkg syscall (netbsd-386), const SYS_FLOCK ideal-int +pkg syscall (netbsd-386), const SYS_FORK ideal-int +pkg syscall (netbsd-386), const SYS_FPATHCONF ideal-int +pkg syscall (netbsd-386), const SYS_FREMOVEXATTR ideal-int +pkg syscall (netbsd-386), const SYS_FSETXATTR ideal-int +pkg syscall (netbsd-386), const SYS_FSTAT ideal-int +pkg syscall (netbsd-386), const SYS_FSTATAT ideal-int +pkg syscall (netbsd-386), const SYS_FSTATVFS1 ideal-int +pkg syscall (netbsd-386), const SYS_FSYNC ideal-int +pkg syscall (netbsd-386), const SYS_FSYNC_RANGE ideal-int +pkg syscall (netbsd-386), const SYS_FTRUNCATE ideal-int +pkg syscall (netbsd-386), const SYS_FUTIMENS ideal-int +pkg syscall (netbsd-386), const SYS_FUTIMES ideal-int +pkg syscall (netbsd-386), const SYS_GETCONTEXT ideal-int +pkg syscall (netbsd-386), const SYS_GETDENTS ideal-int +pkg syscall (netbsd-386), const SYS_GETEGID ideal-int +pkg syscall (netbsd-386), const SYS_GETEUID ideal-int +pkg syscall (netbsd-386), const SYS_GETFH ideal-int +pkg syscall (netbsd-386), const SYS_GETGID ideal-int +pkg syscall (netbsd-386), const SYS_GETGROUPS ideal-int +pkg syscall (netbsd-386), const SYS_GETITIMER ideal-int +pkg syscall (netbsd-386), const SYS_GETPEERNAME ideal-int +pkg syscall (netbsd-386), const SYS_GETPGID ideal-int +pkg syscall (netbsd-386), const SYS_GETPGRP ideal-int +pkg syscall (netbsd-386), const SYS_GETPID ideal-int +pkg syscall (netbsd-386), const SYS_GETPPID ideal-int +pkg syscall (netbsd-386), const SYS_GETPRIORITY ideal-int +pkg syscall (netbsd-386), const SYS_GETRLIMIT ideal-int +pkg syscall (netbsd-386), const SYS_GETRUSAGE ideal-int +pkg syscall (netbsd-386), const SYS_GETSID ideal-int +pkg syscall (netbsd-386), const SYS_GETSOCKNAME ideal-int +pkg syscall (netbsd-386), const SYS_GETSOCKOPT ideal-int +pkg syscall (netbsd-386), const SYS_GETTIMEOFDAY ideal-int +pkg syscall (netbsd-386), const SYS_GETUID ideal-int +pkg syscall (netbsd-386), const SYS_GETVFSSTAT ideal-int +pkg syscall (netbsd-386), const SYS_GETXATTR ideal-int +pkg syscall (netbsd-386), const SYS_IOCTL ideal-int +pkg syscall (netbsd-386), const SYS_ISSETUGID ideal-int +pkg syscall (netbsd-386), const SYS_KEVENT ideal-int +pkg syscall (netbsd-386), const SYS_KILL ideal-int +pkg syscall (netbsd-386), const SYS_KQUEUE ideal-int +pkg syscall (netbsd-386), const SYS_KQUEUE1 ideal-int +pkg syscall (netbsd-386), const SYS_KTRACE ideal-int +pkg syscall (netbsd-386), const SYS_LCHFLAGS ideal-int +pkg syscall (netbsd-386), const SYS_LCHMOD ideal-int +pkg syscall (netbsd-386), const SYS_LCHOWN ideal-int +pkg syscall (netbsd-386), const SYS_LGETXATTR ideal-int +pkg syscall (netbsd-386), const SYS_LINK ideal-int +pkg syscall (netbsd-386), const SYS_LINKAT ideal-int +pkg syscall (netbsd-386), const SYS_LISTEN ideal-int +pkg syscall (netbsd-386), const SYS_LISTXATTR ideal-int +pkg syscall (netbsd-386), const SYS_LLISTXATTR ideal-int +pkg syscall (netbsd-386), const SYS_LREMOVEXATTR ideal-int +pkg syscall (netbsd-386), const SYS_LSEEK ideal-int +pkg syscall (netbsd-386), const SYS_LSETXATTR ideal-int +pkg syscall (netbsd-386), const SYS_LSTAT ideal-int +pkg syscall (netbsd-386), const SYS_LUTIMES ideal-int +pkg syscall (netbsd-386), const SYS_MADVISE ideal-int +pkg syscall (netbsd-386), const SYS_MINCORE ideal-int +pkg syscall (netbsd-386), const SYS_MINHERIT ideal-int +pkg syscall (netbsd-386), const SYS_MKDIR ideal-int +pkg syscall (netbsd-386), const SYS_MKDIRAT ideal-int +pkg syscall (netbsd-386), const SYS_MKFIFO ideal-int +pkg syscall (netbsd-386), const SYS_MKFIFOAT ideal-int +pkg syscall (netbsd-386), const SYS_MKNOD ideal-int +pkg syscall (netbsd-386), const SYS_MKNODAT ideal-int +pkg syscall (netbsd-386), const SYS_MLOCK ideal-int +pkg syscall (netbsd-386), const SYS_MLOCKALL ideal-int +pkg syscall (netbsd-386), const SYS_MMAP ideal-int +pkg syscall (netbsd-386), const SYS_MODCTL ideal-int +pkg syscall (netbsd-386), const SYS_MOUNT ideal-int +pkg syscall (netbsd-386), const SYS_MPROTECT ideal-int +pkg syscall (netbsd-386), const SYS_MREMAP ideal-int +pkg syscall (netbsd-386), const SYS_MSGCTL ideal-int +pkg syscall (netbsd-386), const SYS_MSGGET ideal-int +pkg syscall (netbsd-386), const SYS_MSGRCV ideal-int +pkg syscall (netbsd-386), const SYS_MSGSND ideal-int +pkg syscall (netbsd-386), const SYS_MUNLOCK ideal-int +pkg syscall (netbsd-386), const SYS_MUNLOCKALL ideal-int +pkg syscall (netbsd-386), const SYS_MUNMAP ideal-int +pkg syscall (netbsd-386), const SYS_NANOSLEEP ideal-int +pkg syscall (netbsd-386), const SYS_NTP_ADJTIME ideal-int +pkg syscall (netbsd-386), const SYS_NTP_GETTIME ideal-int +pkg syscall (netbsd-386), const SYS_OPEN ideal-int +pkg syscall (netbsd-386), const SYS_OPENAT ideal-int +pkg syscall (netbsd-386), const SYS_PACCEPT ideal-int +pkg syscall (netbsd-386), const SYS_PATHCONF ideal-int +pkg syscall (netbsd-386), const SYS_PIPE ideal-int +pkg syscall (netbsd-386), const SYS_PIPE2 ideal-int +pkg syscall (netbsd-386), const SYS_PMC_CONTROL ideal-int +pkg syscall (netbsd-386), const SYS_PMC_GET_INFO ideal-int +pkg syscall (netbsd-386), const SYS_POLL ideal-int +pkg syscall (netbsd-386), const SYS_POLLTS ideal-int +pkg syscall (netbsd-386), const SYS_POSIX_FADVISE ideal-int +pkg syscall (netbsd-386), const SYS_POSIX_SPAWN ideal-int +pkg syscall (netbsd-386), const SYS_PREAD ideal-int +pkg syscall (netbsd-386), const SYS_PREADV ideal-int +pkg syscall (netbsd-386), const SYS_PROFIL ideal-int +pkg syscall (netbsd-386), const SYS_PSELECT ideal-int +pkg syscall (netbsd-386), const SYS_PSET_ASSIGN ideal-int +pkg syscall (netbsd-386), const SYS_PSET_CREATE ideal-int +pkg syscall (netbsd-386), const SYS_PSET_DESTROY ideal-int +pkg syscall (netbsd-386), const SYS_PTRACE ideal-int +pkg syscall (netbsd-386), const SYS_PWRITE ideal-int +pkg syscall (netbsd-386), const SYS_PWRITEV ideal-int +pkg syscall (netbsd-386), const SYS_RASCTL ideal-int +pkg syscall (netbsd-386), const SYS_READ ideal-int +pkg syscall (netbsd-386), const SYS_READLINK ideal-int +pkg syscall (netbsd-386), const SYS_READLINKAT ideal-int +pkg syscall (netbsd-386), const SYS_READV ideal-int +pkg syscall (netbsd-386), const SYS_REBOOT ideal-int +pkg syscall (netbsd-386), const SYS_RECVFROM ideal-int +pkg syscall (netbsd-386), const SYS_RECVMMSG ideal-int +pkg syscall (netbsd-386), const SYS_RECVMSG ideal-int +pkg syscall (netbsd-386), const SYS_REMOVEXATTR ideal-int +pkg syscall (netbsd-386), const SYS_RENAME ideal-int +pkg syscall (netbsd-386), const SYS_RENAMEAT ideal-int +pkg syscall (netbsd-386), const SYS_REVOKE ideal-int +pkg syscall (netbsd-386), const SYS_RMDIR ideal-int +pkg syscall (netbsd-386), const SYS_SBRK ideal-int +pkg syscall (netbsd-386), const SYS_SCHED_YIELD ideal-int +pkg syscall (netbsd-386), const SYS_SELECT ideal-int +pkg syscall (netbsd-386), const SYS_SEMCONFIG ideal-int +pkg syscall (netbsd-386), const SYS_SEMGET ideal-int +pkg syscall (netbsd-386), const SYS_SEMOP ideal-int +pkg syscall (netbsd-386), const SYS_SENDMMSG ideal-int +pkg syscall (netbsd-386), const SYS_SENDMSG ideal-int +pkg syscall (netbsd-386), const SYS_SENDTO ideal-int +pkg syscall (netbsd-386), const SYS_SETCONTEXT ideal-int +pkg syscall (netbsd-386), const SYS_SETEGID ideal-int +pkg syscall (netbsd-386), const SYS_SETEUID ideal-int +pkg syscall (netbsd-386), const SYS_SETGID ideal-int +pkg syscall (netbsd-386), const SYS_SETGROUPS ideal-int +pkg syscall (netbsd-386), const SYS_SETITIMER ideal-int +pkg syscall (netbsd-386), const SYS_SETPGID ideal-int +pkg syscall (netbsd-386), const SYS_SETPRIORITY ideal-int +pkg syscall (netbsd-386), const SYS_SETREGID ideal-int +pkg syscall (netbsd-386), const SYS_SETREUID ideal-int +pkg syscall (netbsd-386), const SYS_SETRLIMIT ideal-int +pkg syscall (netbsd-386), const SYS_SETSID ideal-int +pkg syscall (netbsd-386), const SYS_SETSOCKOPT ideal-int +pkg syscall (netbsd-386), const SYS_SETTIMEOFDAY ideal-int +pkg syscall (netbsd-386), const SYS_SETUID ideal-int +pkg syscall (netbsd-386), const SYS_SETXATTR ideal-int +pkg syscall (netbsd-386), const SYS_SHMAT ideal-int +pkg syscall (netbsd-386), const SYS_SHMCTL ideal-int +pkg syscall (netbsd-386), const SYS_SHMDT ideal-int +pkg syscall (netbsd-386), const SYS_SHMGET ideal-int +pkg syscall (netbsd-386), const SYS_SHUTDOWN ideal-int +pkg syscall (netbsd-386), const SYS_SIGQUEUEINFO ideal-int +pkg syscall (netbsd-386), const SYS_SOCKET ideal-int +pkg syscall (netbsd-386), const SYS_SOCKETPAIR ideal-int +pkg syscall (netbsd-386), const SYS_SSTK ideal-int +pkg syscall (netbsd-386), const SYS_STAT ideal-int +pkg syscall (netbsd-386), const SYS_STATVFS1 ideal-int +pkg syscall (netbsd-386), const SYS_SWAPCTL ideal-int +pkg syscall (netbsd-386), const SYS_SYMLINK ideal-int +pkg syscall (netbsd-386), const SYS_SYMLINKAT ideal-int +pkg syscall (netbsd-386), const SYS_SYNC ideal-int +pkg syscall (netbsd-386), const SYS_SYSARCH ideal-int +pkg syscall (netbsd-386), const SYS_TIMER_CREATE ideal-int +pkg syscall (netbsd-386), const SYS_TIMER_DELETE ideal-int +pkg syscall (netbsd-386), const SYS_TIMER_GETOVERRUN ideal-int +pkg syscall (netbsd-386), const SYS_TIMER_GETTIME ideal-int +pkg syscall (netbsd-386), const SYS_TIMER_SETTIME ideal-int +pkg syscall (netbsd-386), const SYS_TRUNCATE ideal-int +pkg syscall (netbsd-386), const SYS_UMASK ideal-int +pkg syscall (netbsd-386), const SYS_UNDELETE ideal-int +pkg syscall (netbsd-386), const SYS_UNLINK ideal-int +pkg syscall (netbsd-386), const SYS_UNLINKAT ideal-int +pkg syscall (netbsd-386), const SYS_UNMOUNT ideal-int +pkg syscall (netbsd-386), const SYS_UTIMENSAT ideal-int +pkg syscall (netbsd-386), const SYS_UTIMES ideal-int +pkg syscall (netbsd-386), const SYS_UTRACE ideal-int +pkg syscall (netbsd-386), const SYS_UUIDGEN ideal-int +pkg syscall (netbsd-386), const SYS_VADVISE ideal-int +pkg syscall (netbsd-386), const SYS_VFORK ideal-int +pkg syscall (netbsd-386), const SYS_WAIT4 ideal-int +pkg syscall (netbsd-386), const SYS_WRITE ideal-int +pkg syscall (netbsd-386), const SYS_WRITEV ideal-int +pkg syscall (netbsd-386), const SYS__LWP_CONTINUE ideal-int +pkg syscall (netbsd-386), const SYS__LWP_CREATE ideal-int +pkg syscall (netbsd-386), const SYS__LWP_CTL ideal-int +pkg syscall (netbsd-386), const SYS__LWP_DETACH ideal-int +pkg syscall (netbsd-386), const SYS__LWP_EXIT ideal-int +pkg syscall (netbsd-386), const SYS__LWP_GETNAME ideal-int +pkg syscall (netbsd-386), const SYS__LWP_GETPRIVATE ideal-int +pkg syscall (netbsd-386), const SYS__LWP_KILL ideal-int +pkg syscall (netbsd-386), const SYS__LWP_PARK ideal-int +pkg syscall (netbsd-386), const SYS__LWP_SELF ideal-int +pkg syscall (netbsd-386), const SYS__LWP_SETNAME ideal-int +pkg syscall (netbsd-386), const SYS__LWP_SETPRIVATE ideal-int +pkg syscall (netbsd-386), const SYS__LWP_SUSPEND ideal-int +pkg syscall (netbsd-386), const SYS__LWP_UNPARK ideal-int +pkg syscall (netbsd-386), const SYS__LWP_UNPARK_ALL ideal-int +pkg syscall (netbsd-386), const SYS__LWP_WAIT ideal-int +pkg syscall (netbsd-386), const SYS__LWP_WAKEUP ideal-int +pkg syscall (netbsd-386), const SYS__PSET_BIND ideal-int +pkg syscall (netbsd-386), const SYS__SCHED_GETAFFINITY ideal-int +pkg syscall (netbsd-386), const SYS__SCHED_GETPARAM ideal-int +pkg syscall (netbsd-386), const SYS__SCHED_SETAFFINITY ideal-int +pkg syscall (netbsd-386), const SYS__SCHED_SETPARAM ideal-int +pkg syscall (netbsd-386), const SYS___CLONE ideal-int +pkg syscall (netbsd-386), const SYS___GETCWD ideal-int +pkg syscall (netbsd-386), const SYS___GETLOGIN ideal-int +pkg syscall (netbsd-386), const SYS___POSIX_CHOWN ideal-int +pkg syscall (netbsd-386), const SYS___POSIX_FCHOWN ideal-int +pkg syscall (netbsd-386), const SYS___POSIX_LCHOWN ideal-int +pkg syscall (netbsd-386), const SYS___POSIX_RENAME ideal-int +pkg syscall (netbsd-386), const SYS___QUOTACTL ideal-int +pkg syscall (netbsd-386), const SYS___SEMCTL ideal-int +pkg syscall (netbsd-386), const SYS___SETLOGIN ideal-int +pkg syscall (netbsd-386), const SYS___SIGACTION_SIGTRAMP ideal-int +pkg syscall (netbsd-386), const SYS___SIGTIMEDWAIT ideal-int +pkg syscall (netbsd-386), const SYS___SYSCTL ideal-int +pkg syscall (netbsd-386), const S_ARCH1 ideal-int +pkg syscall (netbsd-386), const S_ARCH2 ideal-int +pkg syscall (netbsd-386), const S_BLKSIZE ideal-int +pkg syscall (netbsd-386), const S_IEXEC ideal-int +pkg syscall (netbsd-386), const S_IFWHT ideal-int +pkg syscall (netbsd-386), const S_IREAD ideal-int +pkg syscall (netbsd-386), const S_IRGRP ideal-int +pkg syscall (netbsd-386), const S_IROTH ideal-int +pkg syscall (netbsd-386), const S_IRWXG ideal-int +pkg syscall (netbsd-386), const S_IRWXO ideal-int +pkg syscall (netbsd-386), const S_IRWXU ideal-int +pkg syscall (netbsd-386), const S_ISTXT ideal-int +pkg syscall (netbsd-386), const S_IWGRP ideal-int +pkg syscall (netbsd-386), const S_IWOTH ideal-int +pkg syscall (netbsd-386), const S_IWRITE ideal-int +pkg syscall (netbsd-386), const S_IXGRP ideal-int +pkg syscall (netbsd-386), const S_IXOTH ideal-int +pkg syscall (netbsd-386), const S_LOGIN_SET ideal-int +pkg syscall (netbsd-386), const SizeofBpfHdr ideal-int +pkg syscall (netbsd-386), const SizeofBpfInsn ideal-int +pkg syscall (netbsd-386), const SizeofBpfProgram ideal-int +pkg syscall (netbsd-386), const SizeofBpfStat ideal-int +pkg syscall (netbsd-386), const SizeofBpfVersion ideal-int +pkg syscall (netbsd-386), const SizeofCmsghdr ideal-int +pkg syscall (netbsd-386), const SizeofICMPv6Filter = 32 +pkg syscall (netbsd-386), const SizeofICMPv6Filter ideal-int +pkg syscall (netbsd-386), const SizeofIPMreq ideal-int +pkg syscall (netbsd-386), const SizeofIPv6MTUInfo = 32 +pkg syscall (netbsd-386), const SizeofIPv6MTUInfo ideal-int +pkg syscall (netbsd-386), const SizeofIPv6Mreq ideal-int +pkg syscall (netbsd-386), const SizeofIfAnnounceMsghdr ideal-int +pkg syscall (netbsd-386), const SizeofIfData ideal-int +pkg syscall (netbsd-386), const SizeofIfMsghdr ideal-int +pkg syscall (netbsd-386), const SizeofIfaMsghdr ideal-int +pkg syscall (netbsd-386), const SizeofInet6Pktinfo ideal-int +pkg syscall (netbsd-386), const SizeofLinger ideal-int +pkg syscall (netbsd-386), const SizeofMsghdr ideal-int +pkg syscall (netbsd-386), const SizeofRtMetrics ideal-int +pkg syscall (netbsd-386), const SizeofRtMsghdr ideal-int +pkg syscall (netbsd-386), const SizeofSockaddrAny ideal-int +pkg syscall (netbsd-386), const SizeofSockaddrDatalink ideal-int +pkg syscall (netbsd-386), const SizeofSockaddrInet4 ideal-int +pkg syscall (netbsd-386), const SizeofSockaddrInet6 ideal-int +pkg syscall (netbsd-386), const SizeofSockaddrUnix ideal-int +pkg syscall (netbsd-386), const TCIFLUSH ideal-int +pkg syscall (netbsd-386), const TCIOFLUSH ideal-int +pkg syscall (netbsd-386), const TCOFLUSH ideal-int +pkg syscall (netbsd-386), const TCP_CONGCTL ideal-int +pkg syscall (netbsd-386), const TCP_KEEPCNT ideal-int +pkg syscall (netbsd-386), const TCP_KEEPIDLE ideal-int +pkg syscall (netbsd-386), const TCP_KEEPINIT ideal-int +pkg syscall (netbsd-386), const TCP_KEEPINTVL ideal-int +pkg syscall (netbsd-386), const TCP_MAXBURST ideal-int +pkg syscall (netbsd-386), const TCP_MAXSEG ideal-int +pkg syscall (netbsd-386), const TCP_MAXWIN ideal-int +pkg syscall (netbsd-386), const TCP_MAX_WINSHIFT ideal-int +pkg syscall (netbsd-386), const TCP_MD5SIG ideal-int +pkg syscall (netbsd-386), const TCP_MINMSS ideal-int +pkg syscall (netbsd-386), const TCP_MSS ideal-int +pkg syscall (netbsd-386), const TCSAFLUSH ideal-int +pkg syscall (netbsd-386), const TIOCCBRK ideal-int +pkg syscall (netbsd-386), const TIOCCDTR ideal-int +pkg syscall (netbsd-386), const TIOCCONS ideal-int +pkg syscall (netbsd-386), const TIOCDCDTIMESTAMP ideal-int +pkg syscall (netbsd-386), const TIOCDRAIN ideal-int +pkg syscall (netbsd-386), const TIOCEXCL ideal-int +pkg syscall (netbsd-386), const TIOCEXT ideal-int +pkg syscall (netbsd-386), const TIOCFLAG_CDTRCTS ideal-int +pkg syscall (netbsd-386), const TIOCFLAG_CLOCAL ideal-int +pkg syscall (netbsd-386), const TIOCFLAG_CRTSCTS ideal-int +pkg syscall (netbsd-386), const TIOCFLAG_MDMBUF ideal-int +pkg syscall (netbsd-386), const TIOCFLAG_SOFTCAR ideal-int +pkg syscall (netbsd-386), const TIOCFLUSH ideal-int +pkg syscall (netbsd-386), const TIOCGETA ideal-int +pkg syscall (netbsd-386), const TIOCGETD ideal-int +pkg syscall (netbsd-386), const TIOCGFLAGS ideal-int +pkg syscall (netbsd-386), const TIOCGLINED ideal-int +pkg syscall (netbsd-386), const TIOCGPGRP ideal-int +pkg syscall (netbsd-386), const TIOCGQSIZE ideal-int +pkg syscall (netbsd-386), const TIOCGRANTPT ideal-int +pkg syscall (netbsd-386), const TIOCGSID ideal-int +pkg syscall (netbsd-386), const TIOCGSIZE ideal-int +pkg syscall (netbsd-386), const TIOCGWINSZ ideal-int +pkg syscall (netbsd-386), const TIOCMBIC ideal-int +pkg syscall (netbsd-386), const TIOCMBIS ideal-int +pkg syscall (netbsd-386), const TIOCMGET ideal-int +pkg syscall (netbsd-386), const TIOCMSET ideal-int +pkg syscall (netbsd-386), const TIOCM_CAR ideal-int +pkg syscall (netbsd-386), const TIOCM_CD ideal-int +pkg syscall (netbsd-386), const TIOCM_CTS ideal-int +pkg syscall (netbsd-386), const TIOCM_DSR ideal-int +pkg syscall (netbsd-386), const TIOCM_DTR ideal-int +pkg syscall (netbsd-386), const TIOCM_LE ideal-int +pkg syscall (netbsd-386), const TIOCM_RI ideal-int +pkg syscall (netbsd-386), const TIOCM_RNG ideal-int +pkg syscall (netbsd-386), const TIOCM_RTS ideal-int +pkg syscall (netbsd-386), const TIOCM_SR ideal-int +pkg syscall (netbsd-386), const TIOCM_ST ideal-int +pkg syscall (netbsd-386), const TIOCNOTTY ideal-int +pkg syscall (netbsd-386), const TIOCNXCL ideal-int +pkg syscall (netbsd-386), const TIOCOUTQ ideal-int +pkg syscall (netbsd-386), const TIOCPKT ideal-int +pkg syscall (netbsd-386), const TIOCPKT_DATA ideal-int +pkg syscall (netbsd-386), const TIOCPKT_DOSTOP ideal-int +pkg syscall (netbsd-386), const TIOCPKT_FLUSHREAD ideal-int +pkg syscall (netbsd-386), const TIOCPKT_FLUSHWRITE ideal-int +pkg syscall (netbsd-386), const TIOCPKT_IOCTL ideal-int +pkg syscall (netbsd-386), const TIOCPKT_NOSTOP ideal-int +pkg syscall (netbsd-386), const TIOCPKT_START ideal-int +pkg syscall (netbsd-386), const TIOCPKT_STOP ideal-int +pkg syscall (netbsd-386), const TIOCPTMGET ideal-int +pkg syscall (netbsd-386), const TIOCPTSNAME ideal-int +pkg syscall (netbsd-386), const TIOCRCVFRAME ideal-int +pkg syscall (netbsd-386), const TIOCREMOTE ideal-int +pkg syscall (netbsd-386), const TIOCSBRK ideal-int +pkg syscall (netbsd-386), const TIOCSCTTY ideal-int +pkg syscall (netbsd-386), const TIOCSDTR ideal-int +pkg syscall (netbsd-386), const TIOCSETA ideal-int +pkg syscall (netbsd-386), const TIOCSETAF ideal-int +pkg syscall (netbsd-386), const TIOCSETAW ideal-int +pkg syscall (netbsd-386), const TIOCSETD ideal-int +pkg syscall (netbsd-386), const TIOCSFLAGS ideal-int +pkg syscall (netbsd-386), const TIOCSIG ideal-int +pkg syscall (netbsd-386), const TIOCSLINED ideal-int +pkg syscall (netbsd-386), const TIOCSPGRP ideal-int +pkg syscall (netbsd-386), const TIOCSQSIZE ideal-int +pkg syscall (netbsd-386), const TIOCSSIZE ideal-int +pkg syscall (netbsd-386), const TIOCSTART ideal-int +pkg syscall (netbsd-386), const TIOCSTAT ideal-int +pkg syscall (netbsd-386), const TIOCSTI ideal-int +pkg syscall (netbsd-386), const TIOCSTOP ideal-int +pkg syscall (netbsd-386), const TIOCSWINSZ ideal-int +pkg syscall (netbsd-386), const TIOCUCNTL ideal-int +pkg syscall (netbsd-386), const TIOCXMTFRAME ideal-int +pkg syscall (netbsd-386), const TOSTOP ideal-int +pkg syscall (netbsd-386), const VDISCARD ideal-int +pkg syscall (netbsd-386), const VDSUSP ideal-int +pkg syscall (netbsd-386), const VEOF ideal-int +pkg syscall (netbsd-386), const VEOL ideal-int +pkg syscall (netbsd-386), const VEOL2 ideal-int +pkg syscall (netbsd-386), const VERASE ideal-int +pkg syscall (netbsd-386), const VINTR ideal-int +pkg syscall (netbsd-386), const VKILL ideal-int +pkg syscall (netbsd-386), const VLNEXT ideal-int +pkg syscall (netbsd-386), const VMIN ideal-int +pkg syscall (netbsd-386), const VQUIT ideal-int +pkg syscall (netbsd-386), const VREPRINT ideal-int +pkg syscall (netbsd-386), const VSTART ideal-int +pkg syscall (netbsd-386), const VSTATUS ideal-int +pkg syscall (netbsd-386), const VSTOP ideal-int +pkg syscall (netbsd-386), const VSUSP ideal-int +pkg syscall (netbsd-386), const VTIME ideal-int +pkg syscall (netbsd-386), const VWERASE ideal-int +pkg syscall (netbsd-386), const WALL ideal-int +pkg syscall (netbsd-386), const WALLSIG ideal-int +pkg syscall (netbsd-386), const WALTSIG ideal-int +pkg syscall (netbsd-386), const WCLONE ideal-int +pkg syscall (netbsd-386), const WCOREFLAG ideal-int +pkg syscall (netbsd-386), const WNOHANG ideal-int +pkg syscall (netbsd-386), const WNOWAIT ideal-int +pkg syscall (netbsd-386), const WNOZOMBIE ideal-int +pkg syscall (netbsd-386), const WOPTSCHECKED ideal-int +pkg syscall (netbsd-386), const WSTOPPED ideal-int +pkg syscall (netbsd-386), const WUNTRACED ideal-int +pkg syscall (netbsd-386), func Accept(int) (int, Sockaddr, error) +pkg syscall (netbsd-386), func Access(string, uint32) error +pkg syscall (netbsd-386), func Adjtime(*Timeval, *Timeval) error +pkg syscall (netbsd-386), func Bind(int, Sockaddr) error +pkg syscall (netbsd-386), func BpfBuflen(int) (int, error) +pkg syscall (netbsd-386), func BpfDatalink(int) (int, error) +pkg syscall (netbsd-386), func BpfHeadercmpl(int) (int, error) +pkg syscall (netbsd-386), func BpfInterface(int, string) (string, error) +pkg syscall (netbsd-386), func BpfJump(int, int, int, int) *BpfInsn +pkg syscall (netbsd-386), func BpfStats(int) (*BpfStat, error) +pkg syscall (netbsd-386), func BpfStmt(int, int) *BpfInsn +pkg syscall (netbsd-386), func BpfTimeout(int) (*Timeval, error) +pkg syscall (netbsd-386), func CheckBpfVersion(int) error +pkg syscall (netbsd-386), func Chflags(string, int) error +pkg syscall (netbsd-386), func Chroot(string) error +pkg syscall (netbsd-386), func Close(int) error +pkg syscall (netbsd-386), func CloseOnExec(int) +pkg syscall (netbsd-386), func CmsgLen(int) int +pkg syscall (netbsd-386), func CmsgSpace(int) int +pkg syscall (netbsd-386), func Connect(int, Sockaddr) error +pkg syscall (netbsd-386), func Dup(int) (int, error) +pkg syscall (netbsd-386), func Dup2(int, int) error +pkg syscall (netbsd-386), func Fchdir(int) error +pkg syscall (netbsd-386), func Fchflags(int, int) error +pkg syscall (netbsd-386), func Fchmod(int, uint32) error +pkg syscall (netbsd-386), func Fchown(int, int, int) error +pkg syscall (netbsd-386), func Flock(int, int) error +pkg syscall (netbsd-386), func FlushBpf(int) error +pkg syscall (netbsd-386), func ForkExec(string, []string, *ProcAttr) (int, error) +pkg syscall (netbsd-386), func Fpathconf(int, int) (int, error) +pkg syscall (netbsd-386), func Fstat(int, *Stat_t) error +pkg syscall (netbsd-386), func Fsync(int) error +pkg syscall (netbsd-386), func Ftruncate(int, int64) error +pkg syscall (netbsd-386), func Futimes(int, []Timeval) error +pkg syscall (netbsd-386), func Getdirentries(int, []uint8, *uintptr) (int, error) +pkg syscall (netbsd-386), func Getpeername(int) (Sockaddr, error) +pkg syscall (netbsd-386), func Getpgid(int) (int, error) +pkg syscall (netbsd-386), func Getpgrp() int +pkg syscall (netbsd-386), func Getpriority(int, int) (int, error) +pkg syscall (netbsd-386), func Getrlimit(int, *Rlimit) error +pkg syscall (netbsd-386), func Getrusage(int, *Rusage) error +pkg syscall (netbsd-386), func Getsid(int) (int, error) +pkg syscall (netbsd-386), func Getsockname(int) (Sockaddr, error) +pkg syscall (netbsd-386), func GetsockoptByte(int, int, int) (uint8, error) +pkg syscall (netbsd-386), func GetsockoptICMPv6Filter(int, int, int) (*ICMPv6Filter, error) +pkg syscall (netbsd-386), func GetsockoptIPMreq(int, int, int) (*IPMreq, error) +pkg syscall (netbsd-386), func GetsockoptIPv6MTUInfo(int, int, int) (*IPv6MTUInfo, error) +pkg syscall (netbsd-386), func GetsockoptIPv6Mreq(int, int, int) (*IPv6Mreq, error) +pkg syscall (netbsd-386), func GetsockoptInet4Addr(int, int, int) ([4]uint8, error) +pkg syscall (netbsd-386), func GetsockoptInt(int, int, int) (int, error) +pkg syscall (netbsd-386), func Issetugid() bool +pkg syscall (netbsd-386), func Kevent(int, []Kevent_t, []Kevent_t, *Timespec) (int, error) +pkg syscall (netbsd-386), func Kill(int, Signal) error +pkg syscall (netbsd-386), func Kqueue() (int, error) +pkg syscall (netbsd-386), func Listen(int, int) error +pkg syscall (netbsd-386), func Lstat(string, *Stat_t) error +pkg syscall (netbsd-386), func Mkfifo(string, uint32) error +pkg syscall (netbsd-386), func Mknod(string, uint32, int) error +pkg syscall (netbsd-386), func Mmap(int, int64, int, int, int) ([]uint8, error) +pkg syscall (netbsd-386), func Munmap([]uint8) error +pkg syscall (netbsd-386), func Nanosleep(*Timespec, *Timespec) error +pkg syscall (netbsd-386), func Open(string, int, uint32) (int, error) +pkg syscall (netbsd-386), func ParseDirent([]uint8, int, []string) (int, int, []string) +pkg syscall (netbsd-386), func ParseRoutingMessage([]uint8) ([]RoutingMessage, error) +pkg syscall (netbsd-386), func ParseRoutingSockaddr(RoutingMessage) ([]Sockaddr, error) +pkg syscall (netbsd-386), func ParseSocketControlMessage([]uint8) ([]SocketControlMessage, error) +pkg syscall (netbsd-386), func ParseUnixRights(*SocketControlMessage) ([]int, error) +pkg syscall (netbsd-386), func Pathconf(string, int) (int, error) +pkg syscall (netbsd-386), func Pipe([]int) error +pkg syscall (netbsd-386), func Pread(int, []uint8, int64) (int, error) +pkg syscall (netbsd-386), func Pwrite(int, []uint8, int64) (int, error) +pkg syscall (netbsd-386), func RawSyscall(uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno) +pkg syscall (netbsd-386), func RawSyscall6(uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno) +pkg syscall (netbsd-386), func Read(int, []uint8) (int, error) +pkg syscall (netbsd-386), func ReadDirent(int, []uint8) (int, error) +pkg syscall (netbsd-386), func Recvfrom(int, []uint8, int) (int, Sockaddr, error) +pkg syscall (netbsd-386), func Recvmsg(int, []uint8, []uint8, int) (int, int, int, Sockaddr, error) +pkg syscall (netbsd-386), func Revoke(string) error +pkg syscall (netbsd-386), func RouteRIB(int, int) ([]uint8, error) +pkg syscall (netbsd-386), func Seek(int, int64, int) (int64, error) +pkg syscall (netbsd-386), func Select(int, *FdSet, *FdSet, *FdSet, *Timeval) error +pkg syscall (netbsd-386), func Sendfile(int, int, *int64, int) (int, error) +pkg syscall (netbsd-386), func Sendmsg(int, []uint8, []uint8, Sockaddr, int) error +pkg syscall (netbsd-386), func Sendto(int, []uint8, int, Sockaddr) error +pkg syscall (netbsd-386), func SetBpf(int, []BpfInsn) error +pkg syscall (netbsd-386), func SetBpfBuflen(int, int) (int, error) +pkg syscall (netbsd-386), func SetBpfDatalink(int, int) (int, error) +pkg syscall (netbsd-386), func SetBpfHeadercmpl(int, int) error +pkg syscall (netbsd-386), func SetBpfImmediate(int, int) error +pkg syscall (netbsd-386), func SetBpfInterface(int, string) error +pkg syscall (netbsd-386), func SetBpfPromisc(int, int) error +pkg syscall (netbsd-386), func SetBpfTimeout(int, *Timeval) error +pkg syscall (netbsd-386), func SetKevent(*Kevent_t, int, int, int) +pkg syscall (netbsd-386), func SetNonblock(int, bool) error +pkg syscall (netbsd-386), func Setegid(int) error +pkg syscall (netbsd-386), func Seteuid(int) error +pkg syscall (netbsd-386), func Setgid(int) error +pkg syscall (netbsd-386), func Setgroups([]int) error +pkg syscall (netbsd-386), func Setpgid(int, int) error +pkg syscall (netbsd-386), func Setpriority(int, int, int) error +pkg syscall (netbsd-386), func Setregid(int, int) error +pkg syscall (netbsd-386), func Setreuid(int, int) error +pkg syscall (netbsd-386), func Setrlimit(int, *Rlimit) error +pkg syscall (netbsd-386), func Setsid() (int, error) +pkg syscall (netbsd-386), func SetsockoptByte(int, int, int, uint8) error +pkg syscall (netbsd-386), func SetsockoptICMPv6Filter(int, int, int, *ICMPv6Filter) error +pkg syscall (netbsd-386), func SetsockoptIPMreq(int, int, int, *IPMreq) error +pkg syscall (netbsd-386), func SetsockoptIPv6Mreq(int, int, int, *IPv6Mreq) error +pkg syscall (netbsd-386), func SetsockoptInet4Addr(int, int, int, [4]uint8) error +pkg syscall (netbsd-386), func SetsockoptInt(int, int, int, int) error +pkg syscall (netbsd-386), func SetsockoptLinger(int, int, int, *Linger) error +pkg syscall (netbsd-386), func SetsockoptString(int, int, int, string) error +pkg syscall (netbsd-386), func SetsockoptTimeval(int, int, int, *Timeval) error +pkg syscall (netbsd-386), func Settimeofday(*Timeval) error +pkg syscall (netbsd-386), func Setuid(int) error +pkg syscall (netbsd-386), func Shutdown(int, int) error +pkg syscall (netbsd-386), func SlicePtrFromStrings([]string) ([]*uint8, error) +pkg syscall (netbsd-386), func Socket(int, int, int) (int, error) +pkg syscall (netbsd-386), func Socketpair(int, int, int) ([2]int, error) +pkg syscall (netbsd-386), func Stat(string, *Stat_t) error +pkg syscall (netbsd-386), func StringSlicePtr([]string) []*uint8 +pkg syscall (netbsd-386), func Sync() error +pkg syscall (netbsd-386), func Syscall(uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno) +pkg syscall (netbsd-386), func Syscall6(uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno) +pkg syscall (netbsd-386), func Syscall9(uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno) +pkg syscall (netbsd-386), func Sysctl(string) (string, error) +pkg syscall (netbsd-386), func SysctlUint32(string) (uint32, error) +pkg syscall (netbsd-386), func TimevalToNsec(Timeval) int64 +pkg syscall (netbsd-386), func Truncate(string, int64) error +pkg syscall (netbsd-386), func Umask(int) int +pkg syscall (netbsd-386), func UnixRights(...int) []uint8 +pkg syscall (netbsd-386), func Unmount(string, int) error +pkg syscall (netbsd-386), func Wait4(int, *WaitStatus, int, *Rusage) (int, error) +pkg syscall (netbsd-386), func Write(int, []uint8) (int, error) +pkg syscall (netbsd-386), method (*Cmsghdr) SetLen(int) +pkg syscall (netbsd-386), method (*Iovec) SetLen(int) +pkg syscall (netbsd-386), method (*Msghdr) SetControllen(int) +pkg syscall (netbsd-386), type BpfHdr struct +pkg syscall (netbsd-386), type BpfHdr struct, Caplen uint32 +pkg syscall (netbsd-386), type BpfHdr struct, Datalen uint32 +pkg syscall (netbsd-386), type BpfHdr struct, Hdrlen uint16 +pkg syscall (netbsd-386), type BpfHdr struct, Pad_cgo_0 [2]uint8 +pkg syscall (netbsd-386), type BpfHdr struct, Tstamp BpfTimeval +pkg syscall (netbsd-386), type BpfInsn struct +pkg syscall (netbsd-386), type BpfInsn struct, Code uint16 +pkg syscall (netbsd-386), type BpfInsn struct, Jf uint8 +pkg syscall (netbsd-386), type BpfInsn struct, Jt uint8 +pkg syscall (netbsd-386), type BpfInsn struct, K uint32 +pkg syscall (netbsd-386), type BpfProgram struct +pkg syscall (netbsd-386), type BpfProgram struct, Insns *BpfInsn +pkg syscall (netbsd-386), type BpfProgram struct, Len uint32 +pkg syscall (netbsd-386), type BpfStat struct +pkg syscall (netbsd-386), type BpfStat struct, Capt uint64 +pkg syscall (netbsd-386), type BpfStat struct, Drop uint64 +pkg syscall (netbsd-386), type BpfStat struct, Padding [13]uint64 +pkg syscall (netbsd-386), type BpfStat struct, Recv uint64 +pkg syscall (netbsd-386), type BpfTimeval struct +pkg syscall (netbsd-386), type BpfTimeval struct, Sec int32 +pkg syscall (netbsd-386), type BpfTimeval struct, Usec int32 +pkg syscall (netbsd-386), type BpfVersion struct +pkg syscall (netbsd-386), type BpfVersion struct, Major uint16 +pkg syscall (netbsd-386), type BpfVersion struct, Minor uint16 +pkg syscall (netbsd-386), type Cmsghdr struct +pkg syscall (netbsd-386), type Cmsghdr struct, Len uint32 +pkg syscall (netbsd-386), type Cmsghdr struct, Level int32 +pkg syscall (netbsd-386), type Cmsghdr struct, Type int32 +pkg syscall (netbsd-386), type Credential struct +pkg syscall (netbsd-386), type Credential struct, Gid uint32 +pkg syscall (netbsd-386), type Credential struct, Groups []uint32 +pkg syscall (netbsd-386), type Credential struct, Uid uint32 +pkg syscall (netbsd-386), type Dirent struct +pkg syscall (netbsd-386), type Dirent struct, Fileno uint64 +pkg syscall (netbsd-386), type Dirent struct, Name [512]int8 +pkg syscall (netbsd-386), type Dirent struct, Namlen uint16 +pkg syscall (netbsd-386), type Dirent struct, Pad_cgo_0 [3]uint8 +pkg syscall (netbsd-386), type Dirent struct, Reclen uint16 +pkg syscall (netbsd-386), type Dirent struct, Type uint8 +pkg syscall (netbsd-386), type FdSet struct +pkg syscall (netbsd-386), type FdSet struct, Bits [8]uint32 +pkg syscall (netbsd-386), type Flock_t struct +pkg syscall (netbsd-386), type Flock_t struct, Len int64 +pkg syscall (netbsd-386), type Flock_t struct, Pid int32 +pkg syscall (netbsd-386), type Flock_t struct, Start int64 +pkg syscall (netbsd-386), type Flock_t struct, Type int16 +pkg syscall (netbsd-386), type Flock_t struct, Whence int16 +pkg syscall (netbsd-386), type Fsid struct +pkg syscall (netbsd-386), type Fsid struct, X__fsid_val [2]int32 +pkg syscall (netbsd-386), type ICMPv6Filter struct +pkg syscall (netbsd-386), type ICMPv6Filter struct, Filt [8]uint32 +pkg syscall (netbsd-386), type IPv6MTUInfo struct +pkg syscall (netbsd-386), type IPv6MTUInfo struct, Addr RawSockaddrInet6 +pkg syscall (netbsd-386), type IPv6MTUInfo struct, Mtu uint32 +pkg syscall (netbsd-386), type IfAnnounceMsghdr struct +pkg syscall (netbsd-386), type IfAnnounceMsghdr struct, Index uint16 +pkg syscall (netbsd-386), type IfAnnounceMsghdr struct, Msglen uint16 +pkg syscall (netbsd-386), type IfAnnounceMsghdr struct, Name [16]int8 +pkg syscall (netbsd-386), type IfAnnounceMsghdr struct, Type uint8 +pkg syscall (netbsd-386), type IfAnnounceMsghdr struct, Version uint8 +pkg syscall (netbsd-386), type IfAnnounceMsghdr struct, What uint16 +pkg syscall (netbsd-386), type IfData struct +pkg syscall (netbsd-386), type IfData struct, Addrlen uint8 +pkg syscall (netbsd-386), type IfData struct, Baudrate uint64 +pkg syscall (netbsd-386), type IfData struct, Collisions uint64 +pkg syscall (netbsd-386), type IfData struct, Hdrlen uint8 +pkg syscall (netbsd-386), type IfData struct, Ibytes uint64 +pkg syscall (netbsd-386), type IfData struct, Ierrors uint64 +pkg syscall (netbsd-386), type IfData struct, Imcasts uint64 +pkg syscall (netbsd-386), type IfData struct, Ipackets uint64 +pkg syscall (netbsd-386), type IfData struct, Iqdrops uint64 +pkg syscall (netbsd-386), type IfData struct, Lastchange Timespec +pkg syscall (netbsd-386), type IfData struct, Link_state int32 +pkg syscall (netbsd-386), type IfData struct, Metric uint64 +pkg syscall (netbsd-386), type IfData struct, Mtu uint64 +pkg syscall (netbsd-386), type IfData struct, Noproto uint64 +pkg syscall (netbsd-386), type IfData struct, Obytes uint64 +pkg syscall (netbsd-386), type IfData struct, Oerrors uint64 +pkg syscall (netbsd-386), type IfData struct, Omcasts uint64 +pkg syscall (netbsd-386), type IfData struct, Opackets uint64 +pkg syscall (netbsd-386), type IfData struct, Pad_cgo_0 [1]uint8 +pkg syscall (netbsd-386), type IfData struct, Type uint8 +pkg syscall (netbsd-386), type IfMsghdr struct +pkg syscall (netbsd-386), type IfMsghdr struct, Addrs int32 +pkg syscall (netbsd-386), type IfMsghdr struct, Data IfData +pkg syscall (netbsd-386), type IfMsghdr struct, Flags int32 +pkg syscall (netbsd-386), type IfMsghdr struct, Index uint16 +pkg syscall (netbsd-386), type IfMsghdr struct, Msglen uint16 +pkg syscall (netbsd-386), type IfMsghdr struct, Pad_cgo_0 [2]uint8 +pkg syscall (netbsd-386), type IfMsghdr struct, Pad_cgo_1 [4]uint8 +pkg syscall (netbsd-386), type IfMsghdr struct, Type uint8 +pkg syscall (netbsd-386), type IfMsghdr struct, Version uint8 +pkg syscall (netbsd-386), type IfaMsghdr struct +pkg syscall (netbsd-386), type IfaMsghdr struct, Addrs int32 +pkg syscall (netbsd-386), type IfaMsghdr struct, Flags int32 +pkg syscall (netbsd-386), type IfaMsghdr struct, Index uint16 +pkg syscall (netbsd-386), type IfaMsghdr struct, Metric int32 +pkg syscall (netbsd-386), type IfaMsghdr struct, Msglen uint16 +pkg syscall (netbsd-386), type IfaMsghdr struct, Pad_cgo_0 [6]uint8 +pkg syscall (netbsd-386), type IfaMsghdr struct, Type uint8 +pkg syscall (netbsd-386), type IfaMsghdr struct, Version uint8 +pkg syscall (netbsd-386), type Inet6Pktinfo struct +pkg syscall (netbsd-386), type Inet6Pktinfo struct, Addr [16]uint8 +pkg syscall (netbsd-386), type Inet6Pktinfo struct, Ifindex uint32 +pkg syscall (netbsd-386), type InterfaceAddrMessage struct +pkg syscall (netbsd-386), type InterfaceAddrMessage struct, Data []uint8 +pkg syscall (netbsd-386), type InterfaceAddrMessage struct, Header IfaMsghdr +pkg syscall (netbsd-386), type InterfaceAnnounceMessage struct +pkg syscall (netbsd-386), type InterfaceAnnounceMessage struct, Header IfAnnounceMsghdr +pkg syscall (netbsd-386), type InterfaceMessage struct +pkg syscall (netbsd-386), type InterfaceMessage struct, Data []uint8 +pkg syscall (netbsd-386), type InterfaceMessage struct, Header IfMsghdr +pkg syscall (netbsd-386), type Iovec struct +pkg syscall (netbsd-386), type Iovec struct, Base *uint8 +pkg syscall (netbsd-386), type Iovec struct, Len uint32 +pkg syscall (netbsd-386), type Kevent_t struct +pkg syscall (netbsd-386), type Kevent_t struct, Data int64 +pkg syscall (netbsd-386), type Kevent_t struct, Fflags uint32 +pkg syscall (netbsd-386), type Kevent_t struct, Filter uint32 +pkg syscall (netbsd-386), type Kevent_t struct, Flags uint32 +pkg syscall (netbsd-386), type Kevent_t struct, Ident uint32 +pkg syscall (netbsd-386), type Kevent_t struct, Udata int32 +pkg syscall (netbsd-386), type Mclpool [0]uint8 +pkg syscall (netbsd-386), type Msghdr struct +pkg syscall (netbsd-386), type Msghdr struct, Control *uint8 +pkg syscall (netbsd-386), type Msghdr struct, Controllen uint32 +pkg syscall (netbsd-386), type Msghdr struct, Flags int32 +pkg syscall (netbsd-386), type Msghdr struct, Iov *Iovec +pkg syscall (netbsd-386), type Msghdr struct, Iovlen int32 +pkg syscall (netbsd-386), type Msghdr struct, Name *uint8 +pkg syscall (netbsd-386), type Msghdr struct, Namelen uint32 +pkg syscall (netbsd-386), type RawSockaddr struct, Data [14]int8 +pkg syscall (netbsd-386), type RawSockaddr struct, Family uint8 +pkg syscall (netbsd-386), type RawSockaddr struct, Len uint8 +pkg syscall (netbsd-386), type RawSockaddrAny struct, Pad [92]int8 +pkg syscall (netbsd-386), type RawSockaddrDatalink struct +pkg syscall (netbsd-386), type RawSockaddrDatalink struct, Alen uint8 +pkg syscall (netbsd-386), type RawSockaddrDatalink struct, Data [12]int8 +pkg syscall (netbsd-386), type RawSockaddrDatalink struct, Family uint8 +pkg syscall (netbsd-386), type RawSockaddrDatalink struct, Index uint16 +pkg syscall (netbsd-386), type RawSockaddrDatalink struct, Len uint8 +pkg syscall (netbsd-386), type RawSockaddrDatalink struct, Nlen uint8 +pkg syscall (netbsd-386), type RawSockaddrDatalink struct, Slen uint8 +pkg syscall (netbsd-386), type RawSockaddrDatalink struct, Type uint8 +pkg syscall (netbsd-386), type RawSockaddrInet4 struct, Family uint8 +pkg syscall (netbsd-386), type RawSockaddrInet4 struct, Len uint8 +pkg syscall (netbsd-386), type RawSockaddrInet4 struct, Zero [8]int8 +pkg syscall (netbsd-386), type RawSockaddrInet6 struct, Family uint8 +pkg syscall (netbsd-386), type RawSockaddrInet6 struct, Len uint8 +pkg syscall (netbsd-386), type RawSockaddrUnix struct +pkg syscall (netbsd-386), type RawSockaddrUnix struct, Family uint8 +pkg syscall (netbsd-386), type RawSockaddrUnix struct, Len uint8 +pkg syscall (netbsd-386), type RawSockaddrUnix struct, Path [104]int8 +pkg syscall (netbsd-386), type Rlimit struct +pkg syscall (netbsd-386), type Rlimit struct, Cur uint64 +pkg syscall (netbsd-386), type Rlimit struct, Max uint64 +pkg syscall (netbsd-386), type RouteMessage struct +pkg syscall (netbsd-386), type RouteMessage struct, Data []uint8 +pkg syscall (netbsd-386), type RouteMessage struct, Header RtMsghdr +pkg syscall (netbsd-386), type RoutingMessage interface, unexported methods +pkg syscall (netbsd-386), type RtMetrics struct +pkg syscall (netbsd-386), type RtMetrics struct, Expire int64 +pkg syscall (netbsd-386), type RtMetrics struct, Hopcount uint64 +pkg syscall (netbsd-386), type RtMetrics struct, Locks uint64 +pkg syscall (netbsd-386), type RtMetrics struct, Mtu uint64 +pkg syscall (netbsd-386), type RtMetrics struct, Pksent int64 +pkg syscall (netbsd-386), type RtMetrics struct, Recvpipe uint64 +pkg syscall (netbsd-386), type RtMetrics struct, Rtt uint64 +pkg syscall (netbsd-386), type RtMetrics struct, Rttvar uint64 +pkg syscall (netbsd-386), type RtMetrics struct, Sendpipe uint64 +pkg syscall (netbsd-386), type RtMetrics struct, Ssthresh uint64 +pkg syscall (netbsd-386), type RtMsghdr struct +pkg syscall (netbsd-386), type RtMsghdr struct, Addrs int32 +pkg syscall (netbsd-386), type RtMsghdr struct, Errno int32 +pkg syscall (netbsd-386), type RtMsghdr struct, Flags int32 +pkg syscall (netbsd-386), type RtMsghdr struct, Index uint16 +pkg syscall (netbsd-386), type RtMsghdr struct, Inits int32 +pkg syscall (netbsd-386), type RtMsghdr struct, Msglen uint16 +pkg syscall (netbsd-386), type RtMsghdr struct, Pad_cgo_0 [2]uint8 +pkg syscall (netbsd-386), type RtMsghdr struct, Pad_cgo_1 [4]uint8 +pkg syscall (netbsd-386), type RtMsghdr struct, Pid int32 +pkg syscall (netbsd-386), type RtMsghdr struct, Rmx RtMetrics +pkg syscall (netbsd-386), type RtMsghdr struct, Seq int32 +pkg syscall (netbsd-386), type RtMsghdr struct, Type uint8 +pkg syscall (netbsd-386), type RtMsghdr struct, Use int32 +pkg syscall (netbsd-386), type RtMsghdr struct, Version uint8 +pkg syscall (netbsd-386), type Rusage struct, Idrss int32 +pkg syscall (netbsd-386), type Rusage struct, Inblock int32 +pkg syscall (netbsd-386), type Rusage struct, Isrss int32 +pkg syscall (netbsd-386), type Rusage struct, Ixrss int32 +pkg syscall (netbsd-386), type Rusage struct, Majflt int32 +pkg syscall (netbsd-386), type Rusage struct, Maxrss int32 +pkg syscall (netbsd-386), type Rusage struct, Minflt int32 +pkg syscall (netbsd-386), type Rusage struct, Msgrcv int32 +pkg syscall (netbsd-386), type Rusage struct, Msgsnd int32 +pkg syscall (netbsd-386), type Rusage struct, Nivcsw int32 +pkg syscall (netbsd-386), type Rusage struct, Nsignals int32 +pkg syscall (netbsd-386), type Rusage struct, Nswap int32 +pkg syscall (netbsd-386), type Rusage struct, Nvcsw int32 +pkg syscall (netbsd-386), type Rusage struct, Oublock int32 +pkg syscall (netbsd-386), type Rusage struct, Stime Timeval +pkg syscall (netbsd-386), type Rusage struct, Utime Timeval +pkg syscall (netbsd-386), type SockaddrDatalink struct +pkg syscall (netbsd-386), type SockaddrDatalink struct, Alen uint8 +pkg syscall (netbsd-386), type SockaddrDatalink struct, Data [12]int8 +pkg syscall (netbsd-386), type SockaddrDatalink struct, Family uint8 +pkg syscall (netbsd-386), type SockaddrDatalink struct, Index uint16 +pkg syscall (netbsd-386), type SockaddrDatalink struct, Len uint8 +pkg syscall (netbsd-386), type SockaddrDatalink struct, Nlen uint8 +pkg syscall (netbsd-386), type SockaddrDatalink struct, Slen uint8 +pkg syscall (netbsd-386), type SockaddrDatalink struct, Type uint8 +pkg syscall (netbsd-386), type SocketControlMessage struct +pkg syscall (netbsd-386), type SocketControlMessage struct, Data []uint8 +pkg syscall (netbsd-386), type SocketControlMessage struct, Header Cmsghdr +pkg syscall (netbsd-386), type Stat_t struct +pkg syscall (netbsd-386), type Stat_t struct, Atimespec Timespec +pkg syscall (netbsd-386), type Stat_t struct, Birthtimespec Timespec +pkg syscall (netbsd-386), type Stat_t struct, Blksize uint32 +pkg syscall (netbsd-386), type Stat_t struct, Blocks int64 +pkg syscall (netbsd-386), type Stat_t struct, Ctimespec Timespec +pkg syscall (netbsd-386), type Stat_t struct, Dev uint64 +pkg syscall (netbsd-386), type Stat_t struct, Flags uint32 +pkg syscall (netbsd-386), type Stat_t struct, Gen uint32 +pkg syscall (netbsd-386), type Stat_t struct, Gid uint32 +pkg syscall (netbsd-386), type Stat_t struct, Ino uint64 +pkg syscall (netbsd-386), type Stat_t struct, Mode uint32 +pkg syscall (netbsd-386), type Stat_t struct, Mtimespec Timespec +pkg syscall (netbsd-386), type Stat_t struct, Nlink uint32 +pkg syscall (netbsd-386), type Stat_t struct, Rdev uint64 +pkg syscall (netbsd-386), type Stat_t struct, Size int64 +pkg syscall (netbsd-386), type Stat_t struct, Spare [2]uint32 +pkg syscall (netbsd-386), type Stat_t struct, Uid uint32 +pkg syscall (netbsd-386), type Statfs_t [0]uint8 +pkg syscall (netbsd-386), type SysProcAttr struct, Chroot string +pkg syscall (netbsd-386), type SysProcAttr struct, Credential *Credential +pkg syscall (netbsd-386), type SysProcAttr struct, Noctty bool +pkg syscall (netbsd-386), type SysProcAttr struct, Ptrace bool +pkg syscall (netbsd-386), type SysProcAttr struct, Setctty bool +pkg syscall (netbsd-386), type SysProcAttr struct, Setpgid bool +pkg syscall (netbsd-386), type SysProcAttr struct, Setsid bool +pkg syscall (netbsd-386), type Sysctlnode struct +pkg syscall (netbsd-386), type Sysctlnode struct, Flags uint32 +pkg syscall (netbsd-386), type Sysctlnode struct, Name [32]int8 +pkg syscall (netbsd-386), type Sysctlnode struct, Num int32 +pkg syscall (netbsd-386), type Sysctlnode struct, Un [16]uint8 +pkg syscall (netbsd-386), type Sysctlnode struct, Ver uint32 +pkg syscall (netbsd-386), type Sysctlnode struct, X__rsvd uint32 +pkg syscall (netbsd-386), type Sysctlnode struct, X_sysctl_desc [8]uint8 +pkg syscall (netbsd-386), type Sysctlnode struct, X_sysctl_func [8]uint8 +pkg syscall (netbsd-386), type Sysctlnode struct, X_sysctl_parent [8]uint8 +pkg syscall (netbsd-386), type Sysctlnode struct, X_sysctl_size [8]uint8 +pkg syscall (netbsd-386), type Timespec struct, Nsec int32 +pkg syscall (netbsd-386), type Timespec struct, Sec int64 +pkg syscall (netbsd-386), type Timeval struct, Sec int64 +pkg syscall (netbsd-386), type Timeval struct, Usec int32 +pkg syscall (netbsd-386), type WaitStatus uint32 +pkg syscall (netbsd-386), var Stderr int +pkg syscall (netbsd-386), var Stdin int +pkg syscall (netbsd-386), var Stdout int +pkg syscall (netbsd-386-cgo), const AF_APPLETALK ideal-int +pkg syscall (netbsd-386-cgo), const AF_ARP ideal-int +pkg syscall (netbsd-386-cgo), const AF_BLUETOOTH ideal-int +pkg syscall (netbsd-386-cgo), const AF_CCITT ideal-int +pkg syscall (netbsd-386-cgo), const AF_CHAOS ideal-int +pkg syscall (netbsd-386-cgo), const AF_CNT ideal-int +pkg syscall (netbsd-386-cgo), const AF_COIP ideal-int +pkg syscall (netbsd-386-cgo), const AF_DATAKIT ideal-int +pkg syscall (netbsd-386-cgo), const AF_DECnet ideal-int +pkg syscall (netbsd-386-cgo), const AF_DLI ideal-int +pkg syscall (netbsd-386-cgo), const AF_E164 ideal-int +pkg syscall (netbsd-386-cgo), const AF_ECMA ideal-int +pkg syscall (netbsd-386-cgo), const AF_HYLINK ideal-int +pkg syscall (netbsd-386-cgo), const AF_IEEE80211 ideal-int +pkg syscall (netbsd-386-cgo), const AF_IMPLINK ideal-int +pkg syscall (netbsd-386-cgo), const AF_IPX ideal-int +pkg syscall (netbsd-386-cgo), const AF_ISDN ideal-int +pkg syscall (netbsd-386-cgo), const AF_ISO ideal-int +pkg syscall (netbsd-386-cgo), const AF_LAT ideal-int +pkg syscall (netbsd-386-cgo), const AF_LINK ideal-int +pkg syscall (netbsd-386-cgo), const AF_LOCAL ideal-int +pkg syscall (netbsd-386-cgo), const AF_MAX ideal-int +pkg syscall (netbsd-386-cgo), const AF_MPLS ideal-int +pkg syscall (netbsd-386-cgo), const AF_NATM ideal-int +pkg syscall (netbsd-386-cgo), const AF_NS ideal-int +pkg syscall (netbsd-386-cgo), const AF_OROUTE ideal-int +pkg syscall (netbsd-386-cgo), const AF_OSI ideal-int +pkg syscall (netbsd-386-cgo), const AF_PUP ideal-int +pkg syscall (netbsd-386-cgo), const AF_ROUTE ideal-int +pkg syscall (netbsd-386-cgo), const AF_SNA ideal-int +pkg syscall (netbsd-386-cgo), const ARPHRD_ARCNET ideal-int +pkg syscall (netbsd-386-cgo), const ARPHRD_ETHER ideal-int +pkg syscall (netbsd-386-cgo), const ARPHRD_FRELAY ideal-int +pkg syscall (netbsd-386-cgo), const ARPHRD_IEEE1394 ideal-int +pkg syscall (netbsd-386-cgo), const ARPHRD_IEEE802 ideal-int +pkg syscall (netbsd-386-cgo), const ARPHRD_STRIP ideal-int +pkg syscall (netbsd-386-cgo), const B0 ideal-int +pkg syscall (netbsd-386-cgo), const B110 ideal-int +pkg syscall (netbsd-386-cgo), const B115200 ideal-int +pkg syscall (netbsd-386-cgo), const B1200 ideal-int +pkg syscall (netbsd-386-cgo), const B134 ideal-int +pkg syscall (netbsd-386-cgo), const B14400 ideal-int +pkg syscall (netbsd-386-cgo), const B150 ideal-int +pkg syscall (netbsd-386-cgo), const B1800 ideal-int +pkg syscall (netbsd-386-cgo), const B19200 ideal-int +pkg syscall (netbsd-386-cgo), const B200 ideal-int +pkg syscall (netbsd-386-cgo), const B230400 ideal-int +pkg syscall (netbsd-386-cgo), const B2400 ideal-int +pkg syscall (netbsd-386-cgo), const B28800 ideal-int +pkg syscall (netbsd-386-cgo), const B300 ideal-int +pkg syscall (netbsd-386-cgo), const B38400 ideal-int +pkg syscall (netbsd-386-cgo), const B460800 ideal-int +pkg syscall (netbsd-386-cgo), const B4800 ideal-int +pkg syscall (netbsd-386-cgo), const B50 ideal-int +pkg syscall (netbsd-386-cgo), const B57600 ideal-int +pkg syscall (netbsd-386-cgo), const B600 ideal-int +pkg syscall (netbsd-386-cgo), const B7200 ideal-int +pkg syscall (netbsd-386-cgo), const B75 ideal-int +pkg syscall (netbsd-386-cgo), const B76800 ideal-int +pkg syscall (netbsd-386-cgo), const B921600 ideal-int +pkg syscall (netbsd-386-cgo), const B9600 ideal-int +pkg syscall (netbsd-386-cgo), const BIOCFEEDBACK ideal-int +pkg syscall (netbsd-386-cgo), const BIOCFLUSH ideal-int +pkg syscall (netbsd-386-cgo), const BIOCGBLEN ideal-int +pkg syscall (netbsd-386-cgo), const BIOCGDLT ideal-int +pkg syscall (netbsd-386-cgo), const BIOCGDLTLIST ideal-int +pkg syscall (netbsd-386-cgo), const BIOCGETIF ideal-int +pkg syscall (netbsd-386-cgo), const BIOCGFEEDBACK ideal-int +pkg syscall (netbsd-386-cgo), const BIOCGHDRCMPLT ideal-int +pkg syscall (netbsd-386-cgo), const BIOCGRTIMEOUT ideal-int +pkg syscall (netbsd-386-cgo), const BIOCGSEESENT ideal-int +pkg syscall (netbsd-386-cgo), const BIOCGSTATS ideal-int +pkg syscall (netbsd-386-cgo), const BIOCGSTATSOLD ideal-int +pkg syscall (netbsd-386-cgo), const BIOCIMMEDIATE ideal-int +pkg syscall (netbsd-386-cgo), const BIOCPROMISC ideal-int +pkg syscall (netbsd-386-cgo), const BIOCSBLEN ideal-int +pkg syscall (netbsd-386-cgo), const BIOCSDLT ideal-int +pkg syscall (netbsd-386-cgo), const BIOCSETF ideal-int +pkg syscall (netbsd-386-cgo), const BIOCSETIF ideal-int +pkg syscall (netbsd-386-cgo), const BIOCSFEEDBACK ideal-int +pkg syscall (netbsd-386-cgo), const BIOCSHDRCMPLT ideal-int +pkg syscall (netbsd-386-cgo), const BIOCSRTIMEOUT ideal-int +pkg syscall (netbsd-386-cgo), const BIOCSSEESENT ideal-int +pkg syscall (netbsd-386-cgo), const BIOCSTCPF ideal-int +pkg syscall (netbsd-386-cgo), const BIOCSUDPF ideal-int +pkg syscall (netbsd-386-cgo), const BIOCVERSION ideal-int +pkg syscall (netbsd-386-cgo), const BPF_A ideal-int +pkg syscall (netbsd-386-cgo), const BPF_ABS ideal-int +pkg syscall (netbsd-386-cgo), const BPF_ADD ideal-int +pkg syscall (netbsd-386-cgo), const BPF_ALIGNMENT ideal-int +pkg syscall (netbsd-386-cgo), const BPF_ALIGNMENT32 ideal-int +pkg syscall (netbsd-386-cgo), const BPF_ALU ideal-int +pkg syscall (netbsd-386-cgo), const BPF_AND ideal-int +pkg syscall (netbsd-386-cgo), const BPF_B ideal-int +pkg syscall (netbsd-386-cgo), const BPF_DFLTBUFSIZE ideal-int +pkg syscall (netbsd-386-cgo), const BPF_DIV ideal-int +pkg syscall (netbsd-386-cgo), const BPF_H ideal-int +pkg syscall (netbsd-386-cgo), const BPF_IMM ideal-int +pkg syscall (netbsd-386-cgo), const BPF_IND ideal-int +pkg syscall (netbsd-386-cgo), const BPF_JA ideal-int +pkg syscall (netbsd-386-cgo), const BPF_JEQ ideal-int +pkg syscall (netbsd-386-cgo), const BPF_JGE ideal-int +pkg syscall (netbsd-386-cgo), const BPF_JGT ideal-int +pkg syscall (netbsd-386-cgo), const BPF_JMP ideal-int +pkg syscall (netbsd-386-cgo), const BPF_JSET ideal-int +pkg syscall (netbsd-386-cgo), const BPF_K ideal-int +pkg syscall (netbsd-386-cgo), const BPF_LD ideal-int +pkg syscall (netbsd-386-cgo), const BPF_LDX ideal-int +pkg syscall (netbsd-386-cgo), const BPF_LEN ideal-int +pkg syscall (netbsd-386-cgo), const BPF_LSH ideal-int +pkg syscall (netbsd-386-cgo), const BPF_MAJOR_VERSION ideal-int +pkg syscall (netbsd-386-cgo), const BPF_MAXBUFSIZE ideal-int +pkg syscall (netbsd-386-cgo), const BPF_MAXINSNS ideal-int +pkg syscall (netbsd-386-cgo), const BPF_MEM ideal-int +pkg syscall (netbsd-386-cgo), const BPF_MEMWORDS ideal-int +pkg syscall (netbsd-386-cgo), const BPF_MINBUFSIZE ideal-int +pkg syscall (netbsd-386-cgo), const BPF_MINOR_VERSION ideal-int +pkg syscall (netbsd-386-cgo), const BPF_MISC ideal-int +pkg syscall (netbsd-386-cgo), const BPF_MSH ideal-int +pkg syscall (netbsd-386-cgo), const BPF_MUL ideal-int +pkg syscall (netbsd-386-cgo), const BPF_NEG ideal-int +pkg syscall (netbsd-386-cgo), const BPF_OR ideal-int +pkg syscall (netbsd-386-cgo), const BPF_RELEASE ideal-int +pkg syscall (netbsd-386-cgo), const BPF_RET ideal-int +pkg syscall (netbsd-386-cgo), const BPF_RSH ideal-int +pkg syscall (netbsd-386-cgo), const BPF_ST ideal-int +pkg syscall (netbsd-386-cgo), const BPF_STX ideal-int +pkg syscall (netbsd-386-cgo), const BPF_SUB ideal-int +pkg syscall (netbsd-386-cgo), const BPF_TAX ideal-int +pkg syscall (netbsd-386-cgo), const BPF_TXA ideal-int +pkg syscall (netbsd-386-cgo), const BPF_W ideal-int +pkg syscall (netbsd-386-cgo), const BPF_X ideal-int +pkg syscall (netbsd-386-cgo), const BRKINT ideal-int +pkg syscall (netbsd-386-cgo), const CFLUSH ideal-int +pkg syscall (netbsd-386-cgo), const CLOCAL ideal-int +pkg syscall (netbsd-386-cgo), const CREAD ideal-int +pkg syscall (netbsd-386-cgo), const CS5 ideal-int +pkg syscall (netbsd-386-cgo), const CS6 ideal-int +pkg syscall (netbsd-386-cgo), const CS7 ideal-int +pkg syscall (netbsd-386-cgo), const CS8 ideal-int +pkg syscall (netbsd-386-cgo), const CSIZE ideal-int +pkg syscall (netbsd-386-cgo), const CSTART ideal-int +pkg syscall (netbsd-386-cgo), const CSTATUS ideal-int +pkg syscall (netbsd-386-cgo), const CSTOP ideal-int +pkg syscall (netbsd-386-cgo), const CSTOPB ideal-int +pkg syscall (netbsd-386-cgo), const CSUSP ideal-int +pkg syscall (netbsd-386-cgo), const CTL_MAXNAME ideal-int +pkg syscall (netbsd-386-cgo), const CTL_NET ideal-int +pkg syscall (netbsd-386-cgo), const CTL_QUERY ideal-int +pkg syscall (netbsd-386-cgo), const DIOCBSFLUSH ideal-int +pkg syscall (netbsd-386-cgo), const DLT_A429 ideal-int +pkg syscall (netbsd-386-cgo), const DLT_A653_ICM ideal-int +pkg syscall (netbsd-386-cgo), const DLT_AIRONET_HEADER ideal-int +pkg syscall (netbsd-386-cgo), const DLT_AOS ideal-int +pkg syscall (netbsd-386-cgo), const DLT_APPLE_IP_OVER_IEEE1394 ideal-int +pkg syscall (netbsd-386-cgo), const DLT_ARCNET ideal-int +pkg syscall (netbsd-386-cgo), const DLT_ARCNET_LINUX ideal-int +pkg syscall (netbsd-386-cgo), const DLT_ATM_CLIP ideal-int +pkg syscall (netbsd-386-cgo), const DLT_ATM_RFC1483 ideal-int +pkg syscall (netbsd-386-cgo), const DLT_AURORA ideal-int +pkg syscall (netbsd-386-cgo), const DLT_AX25 ideal-int +pkg syscall (netbsd-386-cgo), const DLT_AX25_KISS ideal-int +pkg syscall (netbsd-386-cgo), const DLT_BACNET_MS_TP ideal-int +pkg syscall (netbsd-386-cgo), const DLT_BLUETOOTH_HCI_H4 ideal-int +pkg syscall (netbsd-386-cgo), const DLT_BLUETOOTH_HCI_H4_WITH_PHDR ideal-int +pkg syscall (netbsd-386-cgo), const DLT_CAN20B ideal-int +pkg syscall (netbsd-386-cgo), const DLT_CAN_SOCKETCAN ideal-int +pkg syscall (netbsd-386-cgo), const DLT_CHAOS ideal-int +pkg syscall (netbsd-386-cgo), const DLT_CISCO_IOS ideal-int +pkg syscall (netbsd-386-cgo), const DLT_C_HDLC ideal-int +pkg syscall (netbsd-386-cgo), const DLT_C_HDLC_WITH_DIR ideal-int +pkg syscall (netbsd-386-cgo), const DLT_DECT ideal-int +pkg syscall (netbsd-386-cgo), const DLT_DOCSIS ideal-int +pkg syscall (netbsd-386-cgo), const DLT_ECONET ideal-int +pkg syscall (netbsd-386-cgo), const DLT_EN10MB ideal-int +pkg syscall (netbsd-386-cgo), const DLT_EN3MB ideal-int +pkg syscall (netbsd-386-cgo), const DLT_ENC ideal-int +pkg syscall (netbsd-386-cgo), const DLT_ERF ideal-int +pkg syscall (netbsd-386-cgo), const DLT_ERF_ETH ideal-int +pkg syscall (netbsd-386-cgo), const DLT_ERF_POS ideal-int +pkg syscall (netbsd-386-cgo), const DLT_FC_2 ideal-int +pkg syscall (netbsd-386-cgo), const DLT_FC_2_WITH_FRAME_DELIMS ideal-int +pkg syscall (netbsd-386-cgo), const DLT_FDDI ideal-int +pkg syscall (netbsd-386-cgo), const DLT_FLEXRAY ideal-int +pkg syscall (netbsd-386-cgo), const DLT_FRELAY ideal-int +pkg syscall (netbsd-386-cgo), const DLT_FRELAY_WITH_DIR ideal-int +pkg syscall (netbsd-386-cgo), const DLT_GCOM_SERIAL ideal-int +pkg syscall (netbsd-386-cgo), const DLT_GCOM_T1E1 ideal-int +pkg syscall (netbsd-386-cgo), const DLT_GPF_F ideal-int +pkg syscall (netbsd-386-cgo), const DLT_GPF_T ideal-int +pkg syscall (netbsd-386-cgo), const DLT_GPRS_LLC ideal-int +pkg syscall (netbsd-386-cgo), const DLT_GSMTAP_ABIS ideal-int +pkg syscall (netbsd-386-cgo), const DLT_GSMTAP_UM ideal-int +pkg syscall (netbsd-386-cgo), const DLT_HDLC ideal-int +pkg syscall (netbsd-386-cgo), const DLT_HHDLC ideal-int +pkg syscall (netbsd-386-cgo), const DLT_HIPPI ideal-int +pkg syscall (netbsd-386-cgo), const DLT_IBM_SN ideal-int +pkg syscall (netbsd-386-cgo), const DLT_IBM_SP ideal-int +pkg syscall (netbsd-386-cgo), const DLT_IEEE802 ideal-int +pkg syscall (netbsd-386-cgo), const DLT_IEEE802_11 ideal-int +pkg syscall (netbsd-386-cgo), const DLT_IEEE802_11_RADIO ideal-int +pkg syscall (netbsd-386-cgo), const DLT_IEEE802_11_RADIO_AVS ideal-int +pkg syscall (netbsd-386-cgo), const DLT_IEEE802_15_4 ideal-int +pkg syscall (netbsd-386-cgo), const DLT_IEEE802_15_4_LINUX ideal-int +pkg syscall (netbsd-386-cgo), const DLT_IEEE802_15_4_NONASK_PHY ideal-int +pkg syscall (netbsd-386-cgo), const DLT_IEEE802_16_MAC_CPS ideal-int +pkg syscall (netbsd-386-cgo), const DLT_IEEE802_16_MAC_CPS_RADIO ideal-int +pkg syscall (netbsd-386-cgo), const DLT_IPMB ideal-int +pkg syscall (netbsd-386-cgo), const DLT_IPMB_LINUX ideal-int +pkg syscall (netbsd-386-cgo), const DLT_IPNET ideal-int +pkg syscall (netbsd-386-cgo), const DLT_IPV4 ideal-int +pkg syscall (netbsd-386-cgo), const DLT_IPV6 ideal-int +pkg syscall (netbsd-386-cgo), const DLT_IP_OVER_FC ideal-int +pkg syscall (netbsd-386-cgo), const DLT_JUNIPER_ATM1 ideal-int +pkg syscall (netbsd-386-cgo), const DLT_JUNIPER_ATM2 ideal-int +pkg syscall (netbsd-386-cgo), const DLT_JUNIPER_CHDLC ideal-int +pkg syscall (netbsd-386-cgo), const DLT_JUNIPER_ES ideal-int +pkg syscall (netbsd-386-cgo), const DLT_JUNIPER_ETHER ideal-int +pkg syscall (netbsd-386-cgo), const DLT_JUNIPER_FRELAY ideal-int +pkg syscall (netbsd-386-cgo), const DLT_JUNIPER_GGSN ideal-int +pkg syscall (netbsd-386-cgo), const DLT_JUNIPER_ISM ideal-int +pkg syscall (netbsd-386-cgo), const DLT_JUNIPER_MFR ideal-int +pkg syscall (netbsd-386-cgo), const DLT_JUNIPER_MLFR ideal-int +pkg syscall (netbsd-386-cgo), const DLT_JUNIPER_MLPPP ideal-int +pkg syscall (netbsd-386-cgo), const DLT_JUNIPER_MONITOR ideal-int +pkg syscall (netbsd-386-cgo), const DLT_JUNIPER_PIC_PEER ideal-int +pkg syscall (netbsd-386-cgo), const DLT_JUNIPER_PPP ideal-int +pkg syscall (netbsd-386-cgo), const DLT_JUNIPER_PPPOE ideal-int +pkg syscall (netbsd-386-cgo), const DLT_JUNIPER_PPPOE_ATM ideal-int +pkg syscall (netbsd-386-cgo), const DLT_JUNIPER_SERVICES ideal-int +pkg syscall (netbsd-386-cgo), const DLT_JUNIPER_ST ideal-int +pkg syscall (netbsd-386-cgo), const DLT_JUNIPER_VP ideal-int +pkg syscall (netbsd-386-cgo), const DLT_LAPB_WITH_DIR ideal-int +pkg syscall (netbsd-386-cgo), const DLT_LAPD ideal-int +pkg syscall (netbsd-386-cgo), const DLT_LIN ideal-int +pkg syscall (netbsd-386-cgo), const DLT_LINUX_EVDEV ideal-int +pkg syscall (netbsd-386-cgo), const DLT_LINUX_IRDA ideal-int +pkg syscall (netbsd-386-cgo), const DLT_LINUX_LAPD ideal-int +pkg syscall (netbsd-386-cgo), const DLT_LINUX_SLL ideal-int +pkg syscall (netbsd-386-cgo), const DLT_LOOP ideal-int +pkg syscall (netbsd-386-cgo), const DLT_LTALK ideal-int +pkg syscall (netbsd-386-cgo), const DLT_MFR ideal-int +pkg syscall (netbsd-386-cgo), const DLT_MOST ideal-int +pkg syscall (netbsd-386-cgo), const DLT_MPLS ideal-int +pkg syscall (netbsd-386-cgo), const DLT_MTP2 ideal-int +pkg syscall (netbsd-386-cgo), const DLT_MTP2_WITH_PHDR ideal-int +pkg syscall (netbsd-386-cgo), const DLT_MTP3 ideal-int +pkg syscall (netbsd-386-cgo), const DLT_NULL ideal-int +pkg syscall (netbsd-386-cgo), const DLT_PCI_EXP ideal-int +pkg syscall (netbsd-386-cgo), const DLT_PFLOG ideal-int +pkg syscall (netbsd-386-cgo), const DLT_PFSYNC ideal-int +pkg syscall (netbsd-386-cgo), const DLT_PPI ideal-int +pkg syscall (netbsd-386-cgo), const DLT_PPP ideal-int +pkg syscall (netbsd-386-cgo), const DLT_PPP_BSDOS ideal-int +pkg syscall (netbsd-386-cgo), const DLT_PPP_ETHER ideal-int +pkg syscall (netbsd-386-cgo), const DLT_PPP_PPPD ideal-int +pkg syscall (netbsd-386-cgo), const DLT_PPP_SERIAL ideal-int +pkg syscall (netbsd-386-cgo), const DLT_PPP_WITH_DIR ideal-int +pkg syscall (netbsd-386-cgo), const DLT_PRISM_HEADER ideal-int +pkg syscall (netbsd-386-cgo), const DLT_PRONET ideal-int +pkg syscall (netbsd-386-cgo), const DLT_RAIF1 ideal-int +pkg syscall (netbsd-386-cgo), const DLT_RAW ideal-int +pkg syscall (netbsd-386-cgo), const DLT_RAWAF_MASK ideal-int +pkg syscall (netbsd-386-cgo), const DLT_RIO ideal-int +pkg syscall (netbsd-386-cgo), const DLT_SCCP ideal-int +pkg syscall (netbsd-386-cgo), const DLT_SITA ideal-int +pkg syscall (netbsd-386-cgo), const DLT_SLIP ideal-int +pkg syscall (netbsd-386-cgo), const DLT_SLIP_BSDOS ideal-int +pkg syscall (netbsd-386-cgo), const DLT_SUNATM ideal-int +pkg syscall (netbsd-386-cgo), const DLT_SYMANTEC_FIREWALL ideal-int +pkg syscall (netbsd-386-cgo), const DLT_TZSP ideal-int +pkg syscall (netbsd-386-cgo), const DLT_USB ideal-int +pkg syscall (netbsd-386-cgo), const DLT_USB_LINUX ideal-int +pkg syscall (netbsd-386-cgo), const DLT_USB_LINUX_MMAPPED ideal-int +pkg syscall (netbsd-386-cgo), const DLT_WIHART ideal-int +pkg syscall (netbsd-386-cgo), const DLT_X2E_SERIAL ideal-int +pkg syscall (netbsd-386-cgo), const DLT_X2E_XORAYA ideal-int +pkg syscall (netbsd-386-cgo), const DT_BLK ideal-int +pkg syscall (netbsd-386-cgo), const DT_CHR ideal-int +pkg syscall (netbsd-386-cgo), const DT_DIR ideal-int +pkg syscall (netbsd-386-cgo), const DT_FIFO ideal-int +pkg syscall (netbsd-386-cgo), const DT_LNK ideal-int +pkg syscall (netbsd-386-cgo), const DT_REG ideal-int +pkg syscall (netbsd-386-cgo), const DT_SOCK ideal-int +pkg syscall (netbsd-386-cgo), const DT_UNKNOWN ideal-int +pkg syscall (netbsd-386-cgo), const DT_WHT ideal-int +pkg syscall (netbsd-386-cgo), const EAUTH Errno +pkg syscall (netbsd-386-cgo), const EBADMSG Errno +pkg syscall (netbsd-386-cgo), const EBADRPC Errno +pkg syscall (netbsd-386-cgo), const ECHO ideal-int +pkg syscall (netbsd-386-cgo), const ECHOCTL ideal-int +pkg syscall (netbsd-386-cgo), const ECHOE ideal-int +pkg syscall (netbsd-386-cgo), const ECHOK ideal-int +pkg syscall (netbsd-386-cgo), const ECHOKE ideal-int +pkg syscall (netbsd-386-cgo), const ECHONL ideal-int +pkg syscall (netbsd-386-cgo), const ECHOPRT ideal-int +pkg syscall (netbsd-386-cgo), const EFTYPE Errno +pkg syscall (netbsd-386-cgo), const ELAST Errno +pkg syscall (netbsd-386-cgo), const EMULTIHOP Errno +pkg syscall (netbsd-386-cgo), const EMUL_LINUX ideal-int +pkg syscall (netbsd-386-cgo), const EMUL_LINUX32 ideal-int +pkg syscall (netbsd-386-cgo), const EMUL_MAXID ideal-int +pkg syscall (netbsd-386-cgo), const ENEEDAUTH Errno +pkg syscall (netbsd-386-cgo), const ENOATTR Errno +pkg syscall (netbsd-386-cgo), const ENODATA Errno +pkg syscall (netbsd-386-cgo), const ENOLINK Errno +pkg syscall (netbsd-386-cgo), const ENOSR Errno +pkg syscall (netbsd-386-cgo), const ENOSTR Errno +pkg syscall (netbsd-386-cgo), const EN_SW_CTL_INF ideal-int +pkg syscall (netbsd-386-cgo), const EN_SW_CTL_PREC ideal-int +pkg syscall (netbsd-386-cgo), const EN_SW_CTL_ROUND ideal-int +pkg syscall (netbsd-386-cgo), const EN_SW_DATACHAIN ideal-int +pkg syscall (netbsd-386-cgo), const EN_SW_DENORM ideal-int +pkg syscall (netbsd-386-cgo), const EN_SW_INVOP ideal-int +pkg syscall (netbsd-386-cgo), const EN_SW_OVERFLOW ideal-int +pkg syscall (netbsd-386-cgo), const EN_SW_PRECLOSS ideal-int +pkg syscall (netbsd-386-cgo), const EN_SW_UNDERFLOW ideal-int +pkg syscall (netbsd-386-cgo), const EN_SW_ZERODIV ideal-int +pkg syscall (netbsd-386-cgo), const EPROCLIM Errno +pkg syscall (netbsd-386-cgo), const EPROCUNAVAIL Errno +pkg syscall (netbsd-386-cgo), const EPROGMISMATCH Errno +pkg syscall (netbsd-386-cgo), const EPROGUNAVAIL Errno +pkg syscall (netbsd-386-cgo), const EPROTO Errno +pkg syscall (netbsd-386-cgo), const ERPCMISMATCH Errno +pkg syscall (netbsd-386-cgo), const ETHERCAP_JUMBO_MTU ideal-int +pkg syscall (netbsd-386-cgo), const ETHERCAP_VLAN_HWTAGGING ideal-int +pkg syscall (netbsd-386-cgo), const ETHERCAP_VLAN_MTU ideal-int +pkg syscall (netbsd-386-cgo), const ETHERMIN ideal-int +pkg syscall (netbsd-386-cgo), const ETHERMTU ideal-int +pkg syscall (netbsd-386-cgo), const ETHERMTU_JUMBO ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_8023 ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_AARP ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_ACCTON ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_AEONIC ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_ALPHA ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_AMBER ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_AMOEBA ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_APOLLO ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_APOLLODOMAIN ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_APPLETALK ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_APPLITEK ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_ARGONAUT ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_ARP ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_AT ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_ATALK ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_ATOMIC ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_ATT ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_ATTSTANFORD ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_AUTOPHON ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_AXIS ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_BCLOOP ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_BOFL ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_CABLETRON ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_CHAOS ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_COMDESIGN ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_COMPUGRAPHIC ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_COUNTERPOINT ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_CRONUS ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_CRONUSVLN ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_DCA ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_DDE ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_DEBNI ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_DECAM ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_DECCUST ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_DECDIAG ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_DECDNS ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_DECDTS ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_DECEXPER ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_DECLAST ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_DECLTM ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_DECMUMPS ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_DECNETBIOS ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_DELTACON ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_DIDDLE ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_DLOG1 ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_DLOG2 ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_DN ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_DOGFIGHT ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_DSMD ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_ECMA ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_ENCRYPT ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_ES ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_EXCELAN ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_EXPERDATA ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_FLIP ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_FLOWCONTROL ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_FRARP ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_GENDYN ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_HAYES ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_HIPPI_FP ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_HITACHI ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_HP ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_IEEEPUP ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_IEEEPUPAT ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_IMLBL ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_IMLBLDIAG ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_IP ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_IPAS ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_IPV6 ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_IPX ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_IPXNEW ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_KALPANA ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_LANBRIDGE ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_LANPROBE ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_LAT ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_LBACK ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_LITTLE ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_LOGICRAFT ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_LOOPBACK ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_MATRA ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_MAX ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_MERIT ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_MICP ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_MOPDL ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_MOPRC ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_MOTOROLA ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_MPLS ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_MPLS_MCAST ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_MUMPS ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_NBPCC ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_NBPCLAIM ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_NBPCLREQ ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_NBPCLRSP ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_NBPCREQ ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_NBPCRSP ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_NBPDG ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_NBPDGB ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_NBPDLTE ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_NBPRAR ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_NBPRAS ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_NBPRST ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_NBPSCD ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_NBPVCD ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_NBS ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_NCD ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_NESTAR ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_NETBEUI ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_NOVELL ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_NS ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_NSAT ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_NSCOMPAT ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_NTRAILER ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_OS9 ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_OS9NET ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_PACER ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_PAE ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_PCS ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_PLANNING ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_PPP ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_PPPOE ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_PPPOEDISC ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_PRIMENTS ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_PUP ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_PUPAT ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_RACAL ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_RATIONAL ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_RAWFR ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_RCL ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_RDP ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_RETIX ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_REVARP ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_SCA ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_SECTRA ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_SECUREDATA ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_SGITW ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_SG_BOUNCE ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_SG_DIAG ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_SG_NETGAMES ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_SG_RESV ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_SIMNET ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_SLOWPROTOCOLS ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_SNA ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_SNMP ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_SONIX ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_SPIDER ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_SPRITE ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_STP ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_TALARIS ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_TALARISMC ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_TCPCOMP ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_TCPSM ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_TEC ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_TIGAN ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_TRAIL ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_TRANSETHER ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_TYMSHARE ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_UBBST ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_UBDEBUG ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_UBDIAGLOOP ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_UBDL ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_UBNIU ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_UBNMC ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_VALID ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_VARIAN ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_VAXELN ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_VEECO ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_VEXP ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_VGLAB ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_VINES ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_VINESECHO ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_VINESLOOP ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_VITAL ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_VLAN ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_VLTLMAN ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_VPROD ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_VURESERVED ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_WATERLOO ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_WELLFLEET ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_X25 ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_X75 ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_XNSSM ideal-int +pkg syscall (netbsd-386-cgo), const ETHERTYPE_XTP ideal-int +pkg syscall (netbsd-386-cgo), const ETHER_ADDR_LEN ideal-int +pkg syscall (netbsd-386-cgo), const ETHER_CRC_LEN ideal-int +pkg syscall (netbsd-386-cgo), const ETHER_CRC_POLY_BE ideal-int +pkg syscall (netbsd-386-cgo), const ETHER_CRC_POLY_LE ideal-int +pkg syscall (netbsd-386-cgo), const ETHER_HDR_LEN ideal-int +pkg syscall (netbsd-386-cgo), const ETHER_MAX_LEN ideal-int +pkg syscall (netbsd-386-cgo), const ETHER_MAX_LEN_JUMBO ideal-int +pkg syscall (netbsd-386-cgo), const ETHER_MIN_LEN ideal-int +pkg syscall (netbsd-386-cgo), const ETHER_PPPOE_ENCAP_LEN ideal-int +pkg syscall (netbsd-386-cgo), const ETHER_TYPE_LEN ideal-int +pkg syscall (netbsd-386-cgo), const ETHER_VLAN_ENCAP_LEN ideal-int +pkg syscall (netbsd-386-cgo), const ETIME Errno +pkg syscall (netbsd-386-cgo), const EVFILT_AIO ideal-int +pkg syscall (netbsd-386-cgo), const EVFILT_PROC ideal-int +pkg syscall (netbsd-386-cgo), const EVFILT_READ ideal-int +pkg syscall (netbsd-386-cgo), const EVFILT_SIGNAL ideal-int +pkg syscall (netbsd-386-cgo), const EVFILT_SYSCOUNT ideal-int +pkg syscall (netbsd-386-cgo), const EVFILT_TIMER ideal-int +pkg syscall (netbsd-386-cgo), const EVFILT_VNODE ideal-int +pkg syscall (netbsd-386-cgo), const EVFILT_WRITE ideal-int +pkg syscall (netbsd-386-cgo), const EV_ADD ideal-int +pkg syscall (netbsd-386-cgo), const EV_CLEAR ideal-int +pkg syscall (netbsd-386-cgo), const EV_DELETE ideal-int +pkg syscall (netbsd-386-cgo), const EV_DISABLE ideal-int +pkg syscall (netbsd-386-cgo), const EV_ENABLE ideal-int +pkg syscall (netbsd-386-cgo), const EV_EOF ideal-int +pkg syscall (netbsd-386-cgo), const EV_ERROR ideal-int +pkg syscall (netbsd-386-cgo), const EV_FLAG1 ideal-int +pkg syscall (netbsd-386-cgo), const EV_ONESHOT ideal-int +pkg syscall (netbsd-386-cgo), const EV_SYSFLAGS ideal-int +pkg syscall (netbsd-386-cgo), const EXTA ideal-int +pkg syscall (netbsd-386-cgo), const EXTB ideal-int +pkg syscall (netbsd-386-cgo), const EXTPROC ideal-int +pkg syscall (netbsd-386-cgo), const FD_CLOEXEC ideal-int +pkg syscall (netbsd-386-cgo), const FD_SETSIZE ideal-int +pkg syscall (netbsd-386-cgo), const FLUSHO ideal-int +pkg syscall (netbsd-386-cgo), const F_CLOSEM ideal-int +pkg syscall (netbsd-386-cgo), const F_DUPFD ideal-int +pkg syscall (netbsd-386-cgo), const F_DUPFD_CLOEXEC ideal-int +pkg syscall (netbsd-386-cgo), const F_FSCTL ideal-int +pkg syscall (netbsd-386-cgo), const F_FSDIRMASK ideal-int +pkg syscall (netbsd-386-cgo), const F_FSIN ideal-int +pkg syscall (netbsd-386-cgo), const F_FSINOUT ideal-int +pkg syscall (netbsd-386-cgo), const F_FSOUT ideal-int +pkg syscall (netbsd-386-cgo), const F_FSPRIV ideal-int +pkg syscall (netbsd-386-cgo), const F_FSVOID ideal-int +pkg syscall (netbsd-386-cgo), const F_GETFD ideal-int +pkg syscall (netbsd-386-cgo), const F_GETFL ideal-int +pkg syscall (netbsd-386-cgo), const F_GETLK ideal-int +pkg syscall (netbsd-386-cgo), const F_GETNOSIGPIPE ideal-int +pkg syscall (netbsd-386-cgo), const F_GETOWN ideal-int +pkg syscall (netbsd-386-cgo), const F_MAXFD ideal-int +pkg syscall (netbsd-386-cgo), const F_OK ideal-int +pkg syscall (netbsd-386-cgo), const F_PARAM_MASK ideal-int +pkg syscall (netbsd-386-cgo), const F_PARAM_MAX ideal-int +pkg syscall (netbsd-386-cgo), const F_RDLCK ideal-int +pkg syscall (netbsd-386-cgo), const F_SETFD ideal-int +pkg syscall (netbsd-386-cgo), const F_SETFL ideal-int +pkg syscall (netbsd-386-cgo), const F_SETLK ideal-int +pkg syscall (netbsd-386-cgo), const F_SETLKW ideal-int +pkg syscall (netbsd-386-cgo), const F_SETNOSIGPIPE ideal-int +pkg syscall (netbsd-386-cgo), const F_SETOWN ideal-int +pkg syscall (netbsd-386-cgo), const F_UNLCK ideal-int +pkg syscall (netbsd-386-cgo), const F_WRLCK ideal-int +pkg syscall (netbsd-386-cgo), const HUPCL ideal-int +pkg syscall (netbsd-386-cgo), const ICANON ideal-int +pkg syscall (netbsd-386-cgo), const ICMP6_FILTER = 18 +pkg syscall (netbsd-386-cgo), const ICMP6_FILTER ideal-int +pkg syscall (netbsd-386-cgo), const ICRNL ideal-int +pkg syscall (netbsd-386-cgo), const IEXTEN ideal-int +pkg syscall (netbsd-386-cgo), const IFAN_ARRIVAL ideal-int +pkg syscall (netbsd-386-cgo), const IFAN_DEPARTURE ideal-int +pkg syscall (netbsd-386-cgo), const IFA_ROUTE ideal-int +pkg syscall (netbsd-386-cgo), const IFF_ALLMULTI ideal-int +pkg syscall (netbsd-386-cgo), const IFF_CANTCHANGE ideal-int +pkg syscall (netbsd-386-cgo), const IFF_DEBUG ideal-int +pkg syscall (netbsd-386-cgo), const IFF_LINK0 ideal-int +pkg syscall (netbsd-386-cgo), const IFF_LINK1 ideal-int +pkg syscall (netbsd-386-cgo), const IFF_LINK2 ideal-int +pkg syscall (netbsd-386-cgo), const IFF_NOARP ideal-int +pkg syscall (netbsd-386-cgo), const IFF_NOTRAILERS ideal-int +pkg syscall (netbsd-386-cgo), const IFF_OACTIVE ideal-int +pkg syscall (netbsd-386-cgo), const IFF_POINTOPOINT ideal-int +pkg syscall (netbsd-386-cgo), const IFF_PROMISC ideal-int +pkg syscall (netbsd-386-cgo), const IFF_RUNNING ideal-int +pkg syscall (netbsd-386-cgo), const IFF_SIMPLEX ideal-int +pkg syscall (netbsd-386-cgo), const IFNAMSIZ ideal-int +pkg syscall (netbsd-386-cgo), const IFT_1822 ideal-int +pkg syscall (netbsd-386-cgo), const IFT_A12MPPSWITCH ideal-int +pkg syscall (netbsd-386-cgo), const IFT_AAL2 ideal-int +pkg syscall (netbsd-386-cgo), const IFT_AAL5 ideal-int +pkg syscall (netbsd-386-cgo), const IFT_ADSL ideal-int +pkg syscall (netbsd-386-cgo), const IFT_AFLANE8023 ideal-int +pkg syscall (netbsd-386-cgo), const IFT_AFLANE8025 ideal-int +pkg syscall (netbsd-386-cgo), const IFT_ARAP ideal-int +pkg syscall (netbsd-386-cgo), const IFT_ARCNET ideal-int +pkg syscall (netbsd-386-cgo), const IFT_ARCNETPLUS ideal-int +pkg syscall (netbsd-386-cgo), const IFT_ASYNC ideal-int +pkg syscall (netbsd-386-cgo), const IFT_ATM ideal-int +pkg syscall (netbsd-386-cgo), const IFT_ATMDXI ideal-int +pkg syscall (netbsd-386-cgo), const IFT_ATMFUNI ideal-int +pkg syscall (netbsd-386-cgo), const IFT_ATMIMA ideal-int +pkg syscall (netbsd-386-cgo), const IFT_ATMLOGICAL ideal-int +pkg syscall (netbsd-386-cgo), const IFT_ATMRADIO ideal-int +pkg syscall (netbsd-386-cgo), const IFT_ATMSUBINTERFACE ideal-int +pkg syscall (netbsd-386-cgo), const IFT_ATMVCIENDPT ideal-int +pkg syscall (netbsd-386-cgo), const IFT_ATMVIRTUAL ideal-int +pkg syscall (netbsd-386-cgo), const IFT_BGPPOLICYACCOUNTING ideal-int +pkg syscall (netbsd-386-cgo), const IFT_BRIDGE ideal-int +pkg syscall (netbsd-386-cgo), const IFT_BSC ideal-int +pkg syscall (netbsd-386-cgo), const IFT_CARP ideal-int +pkg syscall (netbsd-386-cgo), const IFT_CCTEMUL ideal-int +pkg syscall (netbsd-386-cgo), const IFT_CEPT ideal-int +pkg syscall (netbsd-386-cgo), const IFT_CES ideal-int +pkg syscall (netbsd-386-cgo), const IFT_CHANNEL ideal-int +pkg syscall (netbsd-386-cgo), const IFT_CNR ideal-int +pkg syscall (netbsd-386-cgo), const IFT_COFFEE ideal-int +pkg syscall (netbsd-386-cgo), const IFT_COMPOSITELINK ideal-int +pkg syscall (netbsd-386-cgo), const IFT_DCN ideal-int +pkg syscall (netbsd-386-cgo), const IFT_DIGITALPOWERLINE ideal-int +pkg syscall (netbsd-386-cgo), const IFT_DIGITALWRAPPEROVERHEADCHANNEL ideal-int +pkg syscall (netbsd-386-cgo), const IFT_DLSW ideal-int +pkg syscall (netbsd-386-cgo), const IFT_DOCSCABLEDOWNSTREAM ideal-int +pkg syscall (netbsd-386-cgo), const IFT_DOCSCABLEMACLAYER ideal-int +pkg syscall (netbsd-386-cgo), const IFT_DOCSCABLEUPSTREAM ideal-int +pkg syscall (netbsd-386-cgo), const IFT_DOCSCABLEUPSTREAMCHANNEL ideal-int +pkg syscall (netbsd-386-cgo), const IFT_DS0 ideal-int +pkg syscall (netbsd-386-cgo), const IFT_DS0BUNDLE ideal-int +pkg syscall (netbsd-386-cgo), const IFT_DS1FDL ideal-int +pkg syscall (netbsd-386-cgo), const IFT_DS3 ideal-int +pkg syscall (netbsd-386-cgo), const IFT_DTM ideal-int +pkg syscall (netbsd-386-cgo), const IFT_DVBASILN ideal-int +pkg syscall (netbsd-386-cgo), const IFT_DVBASIOUT ideal-int +pkg syscall (netbsd-386-cgo), const IFT_DVBRCCDOWNSTREAM ideal-int +pkg syscall (netbsd-386-cgo), const IFT_DVBRCCMACLAYER ideal-int +pkg syscall (netbsd-386-cgo), const IFT_DVBRCCUPSTREAM ideal-int +pkg syscall (netbsd-386-cgo), const IFT_ECONET ideal-int +pkg syscall (netbsd-386-cgo), const IFT_EON ideal-int +pkg syscall (netbsd-386-cgo), const IFT_EPLRS ideal-int +pkg syscall (netbsd-386-cgo), const IFT_ESCON ideal-int +pkg syscall (netbsd-386-cgo), const IFT_ETHER ideal-int +pkg syscall (netbsd-386-cgo), const IFT_FAITH ideal-int +pkg syscall (netbsd-386-cgo), const IFT_FAST ideal-int +pkg syscall (netbsd-386-cgo), const IFT_FASTETHER ideal-int +pkg syscall (netbsd-386-cgo), const IFT_FASTETHERFX ideal-int +pkg syscall (netbsd-386-cgo), const IFT_FDDI ideal-int +pkg syscall (netbsd-386-cgo), const IFT_FIBRECHANNEL ideal-int +pkg syscall (netbsd-386-cgo), const IFT_FRAMERELAYINTERCONNECT ideal-int +pkg syscall (netbsd-386-cgo), const IFT_FRAMERELAYMPI ideal-int +pkg syscall (netbsd-386-cgo), const IFT_FRDLCIENDPT ideal-int +pkg syscall (netbsd-386-cgo), const IFT_FRELAY ideal-int +pkg syscall (netbsd-386-cgo), const IFT_FRELAYDCE ideal-int +pkg syscall (netbsd-386-cgo), const IFT_FRF16MFRBUNDLE ideal-int +pkg syscall (netbsd-386-cgo), const IFT_FRFORWARD ideal-int +pkg syscall (netbsd-386-cgo), const IFT_G703AT2MB ideal-int +pkg syscall (netbsd-386-cgo), const IFT_G703AT64K ideal-int +pkg syscall (netbsd-386-cgo), const IFT_GIF ideal-int +pkg syscall (netbsd-386-cgo), const IFT_GIGABITETHERNET ideal-int +pkg syscall (netbsd-386-cgo), const IFT_GR303IDT ideal-int +pkg syscall (netbsd-386-cgo), const IFT_GR303RDT ideal-int +pkg syscall (netbsd-386-cgo), const IFT_H323GATEKEEPER ideal-int +pkg syscall (netbsd-386-cgo), const IFT_H323PROXY ideal-int +pkg syscall (netbsd-386-cgo), const IFT_HDH1822 ideal-int +pkg syscall (netbsd-386-cgo), const IFT_HDLC ideal-int +pkg syscall (netbsd-386-cgo), const IFT_HDSL2 ideal-int +pkg syscall (netbsd-386-cgo), const IFT_HIPERLAN2 ideal-int +pkg syscall (netbsd-386-cgo), const IFT_HIPPI ideal-int +pkg syscall (netbsd-386-cgo), const IFT_HIPPIINTERFACE ideal-int +pkg syscall (netbsd-386-cgo), const IFT_HOSTPAD ideal-int +pkg syscall (netbsd-386-cgo), const IFT_HSSI ideal-int +pkg syscall (netbsd-386-cgo), const IFT_HY ideal-int +pkg syscall (netbsd-386-cgo), const IFT_IBM370PARCHAN ideal-int +pkg syscall (netbsd-386-cgo), const IFT_IDSL ideal-int +pkg syscall (netbsd-386-cgo), const IFT_IEEE1394 ideal-int +pkg syscall (netbsd-386-cgo), const IFT_IEEE80211 ideal-int +pkg syscall (netbsd-386-cgo), const IFT_IEEE80212 ideal-int +pkg syscall (netbsd-386-cgo), const IFT_IEEE8023ADLAG ideal-int +pkg syscall (netbsd-386-cgo), const IFT_IFGSN ideal-int +pkg syscall (netbsd-386-cgo), const IFT_IMT ideal-int +pkg syscall (netbsd-386-cgo), const IFT_INFINIBAND ideal-int +pkg syscall (netbsd-386-cgo), const IFT_INTERLEAVE ideal-int +pkg syscall (netbsd-386-cgo), const IFT_IP ideal-int +pkg syscall (netbsd-386-cgo), const IFT_IPFORWARD ideal-int +pkg syscall (netbsd-386-cgo), const IFT_IPOVERATM ideal-int +pkg syscall (netbsd-386-cgo), const IFT_IPOVERCDLC ideal-int +pkg syscall (netbsd-386-cgo), const IFT_IPOVERCLAW ideal-int +pkg syscall (netbsd-386-cgo), const IFT_IPSWITCH ideal-int +pkg syscall (netbsd-386-cgo), const IFT_ISDN ideal-int +pkg syscall (netbsd-386-cgo), const IFT_ISDNBASIC ideal-int +pkg syscall (netbsd-386-cgo), const IFT_ISDNPRIMARY ideal-int +pkg syscall (netbsd-386-cgo), const IFT_ISDNS ideal-int +pkg syscall (netbsd-386-cgo), const IFT_ISDNU ideal-int +pkg syscall (netbsd-386-cgo), const IFT_ISO88022LLC ideal-int +pkg syscall (netbsd-386-cgo), const IFT_ISO88023 ideal-int +pkg syscall (netbsd-386-cgo), const IFT_ISO88024 ideal-int +pkg syscall (netbsd-386-cgo), const IFT_ISO88025 ideal-int +pkg syscall (netbsd-386-cgo), const IFT_ISO88025CRFPINT ideal-int +pkg syscall (netbsd-386-cgo), const IFT_ISO88025DTR ideal-int +pkg syscall (netbsd-386-cgo), const IFT_ISO88025FIBER ideal-int +pkg syscall (netbsd-386-cgo), const IFT_ISO88026 ideal-int +pkg syscall (netbsd-386-cgo), const IFT_ISUP ideal-int +pkg syscall (netbsd-386-cgo), const IFT_L2VLAN ideal-int +pkg syscall (netbsd-386-cgo), const IFT_L3IPVLAN ideal-int +pkg syscall (netbsd-386-cgo), const IFT_L3IPXVLAN ideal-int +pkg syscall (netbsd-386-cgo), const IFT_LAPB ideal-int +pkg syscall (netbsd-386-cgo), const IFT_LAPD ideal-int +pkg syscall (netbsd-386-cgo), const IFT_LAPF ideal-int +pkg syscall (netbsd-386-cgo), const IFT_LINEGROUP ideal-int +pkg syscall (netbsd-386-cgo), const IFT_LOCALTALK ideal-int +pkg syscall (netbsd-386-cgo), const IFT_LOOP ideal-int +pkg syscall (netbsd-386-cgo), const IFT_MEDIAMAILOVERIP ideal-int +pkg syscall (netbsd-386-cgo), const IFT_MFSIGLINK ideal-int +pkg syscall (netbsd-386-cgo), const IFT_MIOX25 ideal-int +pkg syscall (netbsd-386-cgo), const IFT_MODEM ideal-int +pkg syscall (netbsd-386-cgo), const IFT_MPC ideal-int +pkg syscall (netbsd-386-cgo), const IFT_MPLS ideal-int +pkg syscall (netbsd-386-cgo), const IFT_MPLSTUNNEL ideal-int +pkg syscall (netbsd-386-cgo), const IFT_MSDSL ideal-int +pkg syscall (netbsd-386-cgo), const IFT_MVL ideal-int +pkg syscall (netbsd-386-cgo), const IFT_MYRINET ideal-int +pkg syscall (netbsd-386-cgo), const IFT_NFAS ideal-int +pkg syscall (netbsd-386-cgo), const IFT_NSIP ideal-int +pkg syscall (netbsd-386-cgo), const IFT_OPTICALCHANNEL ideal-int +pkg syscall (netbsd-386-cgo), const IFT_OPTICALTRANSPORT ideal-int +pkg syscall (netbsd-386-cgo), const IFT_OTHER ideal-int +pkg syscall (netbsd-386-cgo), const IFT_P10 ideal-int +pkg syscall (netbsd-386-cgo), const IFT_P80 ideal-int +pkg syscall (netbsd-386-cgo), const IFT_PARA ideal-int +pkg syscall (netbsd-386-cgo), const IFT_PFLOG ideal-int +pkg syscall (netbsd-386-cgo), const IFT_PFSYNC ideal-int +pkg syscall (netbsd-386-cgo), const IFT_PLC ideal-int +pkg syscall (netbsd-386-cgo), const IFT_PON155 ideal-int +pkg syscall (netbsd-386-cgo), const IFT_PON622 ideal-int +pkg syscall (netbsd-386-cgo), const IFT_POS ideal-int +pkg syscall (netbsd-386-cgo), const IFT_PPP ideal-int +pkg syscall (netbsd-386-cgo), const IFT_PPPMULTILINKBUNDLE ideal-int +pkg syscall (netbsd-386-cgo), const IFT_PROPATM ideal-int +pkg syscall (netbsd-386-cgo), const IFT_PROPBWAP2MP ideal-int +pkg syscall (netbsd-386-cgo), const IFT_PROPCNLS ideal-int +pkg syscall (netbsd-386-cgo), const IFT_PROPDOCSWIRELESSDOWNSTREAM ideal-int +pkg syscall (netbsd-386-cgo), const IFT_PROPDOCSWIRELESSMACLAYER ideal-int +pkg syscall (netbsd-386-cgo), const IFT_PROPDOCSWIRELESSUPSTREAM ideal-int +pkg syscall (netbsd-386-cgo), const IFT_PROPMUX ideal-int +pkg syscall (netbsd-386-cgo), const IFT_PROPVIRTUAL ideal-int +pkg syscall (netbsd-386-cgo), const IFT_PROPWIRELESSP2P ideal-int +pkg syscall (netbsd-386-cgo), const IFT_PTPSERIAL ideal-int +pkg syscall (netbsd-386-cgo), const IFT_PVC ideal-int +pkg syscall (netbsd-386-cgo), const IFT_Q2931 ideal-int +pkg syscall (netbsd-386-cgo), const IFT_QLLC ideal-int +pkg syscall (netbsd-386-cgo), const IFT_RADIOMAC ideal-int +pkg syscall (netbsd-386-cgo), const IFT_RADSL ideal-int +pkg syscall (netbsd-386-cgo), const IFT_REACHDSL ideal-int +pkg syscall (netbsd-386-cgo), const IFT_RFC1483 ideal-int +pkg syscall (netbsd-386-cgo), const IFT_RS232 ideal-int +pkg syscall (netbsd-386-cgo), const IFT_RSRB ideal-int +pkg syscall (netbsd-386-cgo), const IFT_SDLC ideal-int +pkg syscall (netbsd-386-cgo), const IFT_SDSL ideal-int +pkg syscall (netbsd-386-cgo), const IFT_SHDSL ideal-int +pkg syscall (netbsd-386-cgo), const IFT_SIP ideal-int +pkg syscall (netbsd-386-cgo), const IFT_SIPSIG ideal-int +pkg syscall (netbsd-386-cgo), const IFT_SIPTG ideal-int +pkg syscall (netbsd-386-cgo), const IFT_SLIP ideal-int +pkg syscall (netbsd-386-cgo), const IFT_SMDSDXI ideal-int +pkg syscall (netbsd-386-cgo), const IFT_SMDSICIP ideal-int +pkg syscall (netbsd-386-cgo), const IFT_SONET ideal-int +pkg syscall (netbsd-386-cgo), const IFT_SONETOVERHEADCHANNEL ideal-int +pkg syscall (netbsd-386-cgo), const IFT_SONETPATH ideal-int +pkg syscall (netbsd-386-cgo), const IFT_SONETVT ideal-int +pkg syscall (netbsd-386-cgo), const IFT_SRP ideal-int +pkg syscall (netbsd-386-cgo), const IFT_SS7SIGLINK ideal-int +pkg syscall (netbsd-386-cgo), const IFT_STACKTOSTACK ideal-int +pkg syscall (netbsd-386-cgo), const IFT_STARLAN ideal-int +pkg syscall (netbsd-386-cgo), const IFT_STF ideal-int +pkg syscall (netbsd-386-cgo), const IFT_T1 ideal-int +pkg syscall (netbsd-386-cgo), const IFT_TDLC ideal-int +pkg syscall (netbsd-386-cgo), const IFT_TELINK ideal-int +pkg syscall (netbsd-386-cgo), const IFT_TERMPAD ideal-int +pkg syscall (netbsd-386-cgo), const IFT_TR008 ideal-int +pkg syscall (netbsd-386-cgo), const IFT_TRANSPHDLC ideal-int +pkg syscall (netbsd-386-cgo), const IFT_TUNNEL ideal-int +pkg syscall (netbsd-386-cgo), const IFT_ULTRA ideal-int +pkg syscall (netbsd-386-cgo), const IFT_USB ideal-int +pkg syscall (netbsd-386-cgo), const IFT_V11 ideal-int +pkg syscall (netbsd-386-cgo), const IFT_V35 ideal-int +pkg syscall (netbsd-386-cgo), const IFT_V36 ideal-int +pkg syscall (netbsd-386-cgo), const IFT_V37 ideal-int +pkg syscall (netbsd-386-cgo), const IFT_VDSL ideal-int +pkg syscall (netbsd-386-cgo), const IFT_VIRTUALIPADDRESS ideal-int +pkg syscall (netbsd-386-cgo), const IFT_VIRTUALTG ideal-int +pkg syscall (netbsd-386-cgo), const IFT_VOICEDID ideal-int +pkg syscall (netbsd-386-cgo), const IFT_VOICEEM ideal-int +pkg syscall (netbsd-386-cgo), const IFT_VOICEEMFGD ideal-int +pkg syscall (netbsd-386-cgo), const IFT_VOICEENCAP ideal-int +pkg syscall (netbsd-386-cgo), const IFT_VOICEFGDEANA ideal-int +pkg syscall (netbsd-386-cgo), const IFT_VOICEFXO ideal-int +pkg syscall (netbsd-386-cgo), const IFT_VOICEFXS ideal-int +pkg syscall (netbsd-386-cgo), const IFT_VOICEOVERATM ideal-int +pkg syscall (netbsd-386-cgo), const IFT_VOICEOVERCABLE ideal-int +pkg syscall (netbsd-386-cgo), const IFT_VOICEOVERFRAMERELAY ideal-int +pkg syscall (netbsd-386-cgo), const IFT_VOICEOVERIP ideal-int +pkg syscall (netbsd-386-cgo), const IFT_X213 ideal-int +pkg syscall (netbsd-386-cgo), const IFT_X25 ideal-int +pkg syscall (netbsd-386-cgo), const IFT_X25DDN ideal-int +pkg syscall (netbsd-386-cgo), const IFT_X25HUNTGROUP ideal-int +pkg syscall (netbsd-386-cgo), const IFT_X25MLP ideal-int +pkg syscall (netbsd-386-cgo), const IFT_X25PLE ideal-int +pkg syscall (netbsd-386-cgo), const IFT_XETHER ideal-int +pkg syscall (netbsd-386-cgo), const IGNBRK ideal-int +pkg syscall (netbsd-386-cgo), const IGNCR ideal-int +pkg syscall (netbsd-386-cgo), const IGNPAR ideal-int +pkg syscall (netbsd-386-cgo), const IMAXBEL ideal-int +pkg syscall (netbsd-386-cgo), const INLCR ideal-int +pkg syscall (netbsd-386-cgo), const INPCK ideal-int +pkg syscall (netbsd-386-cgo), const IN_CLASSA_HOST ideal-int +pkg syscall (netbsd-386-cgo), const IN_CLASSA_MAX ideal-int +pkg syscall (netbsd-386-cgo), const IN_CLASSA_NET ideal-int +pkg syscall (netbsd-386-cgo), const IN_CLASSA_NSHIFT ideal-int +pkg syscall (netbsd-386-cgo), const IN_CLASSB_HOST ideal-int +pkg syscall (netbsd-386-cgo), const IN_CLASSB_MAX ideal-int +pkg syscall (netbsd-386-cgo), const IN_CLASSB_NET ideal-int +pkg syscall (netbsd-386-cgo), const IN_CLASSB_NSHIFT ideal-int +pkg syscall (netbsd-386-cgo), const IN_CLASSC_HOST ideal-int +pkg syscall (netbsd-386-cgo), const IN_CLASSC_NET ideal-int +pkg syscall (netbsd-386-cgo), const IN_CLASSC_NSHIFT ideal-int +pkg syscall (netbsd-386-cgo), const IN_CLASSD_HOST ideal-int +pkg syscall (netbsd-386-cgo), const IN_CLASSD_NET ideal-int +pkg syscall (netbsd-386-cgo), const IN_CLASSD_NSHIFT ideal-int +pkg syscall (netbsd-386-cgo), const IN_LOOPBACKNET ideal-int +pkg syscall (netbsd-386-cgo), const IPPROTO_AH ideal-int +pkg syscall (netbsd-386-cgo), const IPPROTO_CARP ideal-int +pkg syscall (netbsd-386-cgo), const IPPROTO_DONE ideal-int +pkg syscall (netbsd-386-cgo), const IPPROTO_DSTOPTS ideal-int +pkg syscall (netbsd-386-cgo), const IPPROTO_EGP ideal-int +pkg syscall (netbsd-386-cgo), const IPPROTO_ENCAP ideal-int +pkg syscall (netbsd-386-cgo), const IPPROTO_EON ideal-int +pkg syscall (netbsd-386-cgo), const IPPROTO_ESP ideal-int +pkg syscall (netbsd-386-cgo), const IPPROTO_ETHERIP ideal-int +pkg syscall (netbsd-386-cgo), const IPPROTO_FRAGMENT ideal-int +pkg syscall (netbsd-386-cgo), const IPPROTO_GGP ideal-int +pkg syscall (netbsd-386-cgo), const IPPROTO_GRE ideal-int +pkg syscall (netbsd-386-cgo), const IPPROTO_HOPOPTS ideal-int +pkg syscall (netbsd-386-cgo), const IPPROTO_ICMP ideal-int +pkg syscall (netbsd-386-cgo), const IPPROTO_ICMPV6 ideal-int +pkg syscall (netbsd-386-cgo), const IPPROTO_IDP ideal-int +pkg syscall (netbsd-386-cgo), const IPPROTO_IGMP ideal-int +pkg syscall (netbsd-386-cgo), const IPPROTO_IPCOMP ideal-int +pkg syscall (netbsd-386-cgo), const IPPROTO_IPIP ideal-int +pkg syscall (netbsd-386-cgo), const IPPROTO_IPV4 ideal-int +pkg syscall (netbsd-386-cgo), const IPPROTO_IPV6_ICMP ideal-int +pkg syscall (netbsd-386-cgo), const IPPROTO_MAX ideal-int +pkg syscall (netbsd-386-cgo), const IPPROTO_MAXID ideal-int +pkg syscall (netbsd-386-cgo), const IPPROTO_MOBILE ideal-int +pkg syscall (netbsd-386-cgo), const IPPROTO_NONE ideal-int +pkg syscall (netbsd-386-cgo), const IPPROTO_PFSYNC ideal-int +pkg syscall (netbsd-386-cgo), const IPPROTO_PIM ideal-int +pkg syscall (netbsd-386-cgo), const IPPROTO_PUP ideal-int +pkg syscall (netbsd-386-cgo), const IPPROTO_RAW ideal-int +pkg syscall (netbsd-386-cgo), const IPPROTO_ROUTING ideal-int +pkg syscall (netbsd-386-cgo), const IPPROTO_RSVP ideal-int +pkg syscall (netbsd-386-cgo), const IPPROTO_TP ideal-int +pkg syscall (netbsd-386-cgo), const IPPROTO_VRRP ideal-int +pkg syscall (netbsd-386-cgo), const IPV6_CHECKSUM ideal-int +pkg syscall (netbsd-386-cgo), const IPV6_DEFAULT_MULTICAST_HOPS ideal-int +pkg syscall (netbsd-386-cgo), const IPV6_DEFAULT_MULTICAST_LOOP ideal-int +pkg syscall (netbsd-386-cgo), const IPV6_DEFHLIM ideal-int +pkg syscall (netbsd-386-cgo), const IPV6_DONTFRAG ideal-int +pkg syscall (netbsd-386-cgo), const IPV6_DSTOPTS ideal-int +pkg syscall (netbsd-386-cgo), const IPV6_FAITH ideal-int +pkg syscall (netbsd-386-cgo), const IPV6_FLOWINFO_MASK ideal-int +pkg syscall (netbsd-386-cgo), const IPV6_FLOWLABEL_MASK ideal-int +pkg syscall (netbsd-386-cgo), const IPV6_FRAGTTL ideal-int +pkg syscall (netbsd-386-cgo), const IPV6_HLIMDEC ideal-int +pkg syscall (netbsd-386-cgo), const IPV6_HOPLIMIT ideal-int +pkg syscall (netbsd-386-cgo), const IPV6_HOPOPTS ideal-int +pkg syscall (netbsd-386-cgo), const IPV6_IPSEC_POLICY ideal-int +pkg syscall (netbsd-386-cgo), const IPV6_MAXHLIM ideal-int +pkg syscall (netbsd-386-cgo), const IPV6_MAXPACKET ideal-int +pkg syscall (netbsd-386-cgo), const IPV6_MMTU ideal-int +pkg syscall (netbsd-386-cgo), const IPV6_NEXTHOP ideal-int +pkg syscall (netbsd-386-cgo), const IPV6_PATHMTU ideal-int +pkg syscall (netbsd-386-cgo), const IPV6_PKTINFO ideal-int +pkg syscall (netbsd-386-cgo), const IPV6_PORTRANGE ideal-int +pkg syscall (netbsd-386-cgo), const IPV6_PORTRANGE_DEFAULT ideal-int +pkg syscall (netbsd-386-cgo), const IPV6_PORTRANGE_HIGH ideal-int +pkg syscall (netbsd-386-cgo), const IPV6_PORTRANGE_LOW ideal-int +pkg syscall (netbsd-386-cgo), const IPV6_RECVDSTOPTS ideal-int +pkg syscall (netbsd-386-cgo), const IPV6_RECVHOPLIMIT ideal-int +pkg syscall (netbsd-386-cgo), const IPV6_RECVHOPOPTS ideal-int +pkg syscall (netbsd-386-cgo), const IPV6_RECVPATHMTU ideal-int +pkg syscall (netbsd-386-cgo), const IPV6_RECVPKTINFO ideal-int +pkg syscall (netbsd-386-cgo), const IPV6_RECVRTHDR ideal-int +pkg syscall (netbsd-386-cgo), const IPV6_RECVTCLASS ideal-int +pkg syscall (netbsd-386-cgo), const IPV6_RTHDR ideal-int +pkg syscall (netbsd-386-cgo), const IPV6_RTHDRDSTOPTS ideal-int +pkg syscall (netbsd-386-cgo), const IPV6_RTHDR_LOOSE ideal-int +pkg syscall (netbsd-386-cgo), const IPV6_RTHDR_STRICT ideal-int +pkg syscall (netbsd-386-cgo), const IPV6_RTHDR_TYPE_0 ideal-int +pkg syscall (netbsd-386-cgo), const IPV6_SOCKOPT_RESERVED1 ideal-int +pkg syscall (netbsd-386-cgo), const IPV6_TCLASS ideal-int +pkg syscall (netbsd-386-cgo), const IPV6_USE_MIN_MTU ideal-int +pkg syscall (netbsd-386-cgo), const IPV6_VERSION ideal-int +pkg syscall (netbsd-386-cgo), const IPV6_VERSION_MASK ideal-int +pkg syscall (netbsd-386-cgo), const IP_DEFAULT_MULTICAST_LOOP ideal-int +pkg syscall (netbsd-386-cgo), const IP_DEFAULT_MULTICAST_TTL ideal-int +pkg syscall (netbsd-386-cgo), const IP_DF ideal-int +pkg syscall (netbsd-386-cgo), const IP_EF ideal-int +pkg syscall (netbsd-386-cgo), const IP_ERRORMTU ideal-int +pkg syscall (netbsd-386-cgo), const IP_HDRINCL ideal-int +pkg syscall (netbsd-386-cgo), const IP_IPSEC_POLICY ideal-int +pkg syscall (netbsd-386-cgo), const IP_MAXPACKET ideal-int +pkg syscall (netbsd-386-cgo), const IP_MAX_MEMBERSHIPS ideal-int +pkg syscall (netbsd-386-cgo), const IP_MF ideal-int +pkg syscall (netbsd-386-cgo), const IP_MINFRAGSIZE ideal-int +pkg syscall (netbsd-386-cgo), const IP_MINTTL ideal-int +pkg syscall (netbsd-386-cgo), const IP_MSS ideal-int +pkg syscall (netbsd-386-cgo), const IP_OFFMASK ideal-int +pkg syscall (netbsd-386-cgo), const IP_OPTIONS ideal-int +pkg syscall (netbsd-386-cgo), const IP_PORTRANGE ideal-int +pkg syscall (netbsd-386-cgo), const IP_PORTRANGE_DEFAULT ideal-int +pkg syscall (netbsd-386-cgo), const IP_PORTRANGE_HIGH ideal-int +pkg syscall (netbsd-386-cgo), const IP_PORTRANGE_LOW ideal-int +pkg syscall (netbsd-386-cgo), const IP_RECVDSTADDR ideal-int +pkg syscall (netbsd-386-cgo), const IP_RECVIF ideal-int +pkg syscall (netbsd-386-cgo), const IP_RECVOPTS ideal-int +pkg syscall (netbsd-386-cgo), const IP_RECVRETOPTS ideal-int +pkg syscall (netbsd-386-cgo), const IP_RECVTTL ideal-int +pkg syscall (netbsd-386-cgo), const IP_RETOPTS ideal-int +pkg syscall (netbsd-386-cgo), const IP_RF ideal-int +pkg syscall (netbsd-386-cgo), const ISIG ideal-int +pkg syscall (netbsd-386-cgo), const ISTRIP ideal-int +pkg syscall (netbsd-386-cgo), const IXANY ideal-int +pkg syscall (netbsd-386-cgo), const IXOFF ideal-int +pkg syscall (netbsd-386-cgo), const IXON ideal-int +pkg syscall (netbsd-386-cgo), const LOCK_EX ideal-int +pkg syscall (netbsd-386-cgo), const LOCK_NB ideal-int +pkg syscall (netbsd-386-cgo), const LOCK_SH ideal-int +pkg syscall (netbsd-386-cgo), const LOCK_UN ideal-int +pkg syscall (netbsd-386-cgo), const MSG_BCAST ideal-int +pkg syscall (netbsd-386-cgo), const MSG_CMSG_CLOEXEC ideal-int +pkg syscall (netbsd-386-cgo), const MSG_CONTROLMBUF ideal-int +pkg syscall (netbsd-386-cgo), const MSG_CTRUNC ideal-int +pkg syscall (netbsd-386-cgo), const MSG_DONTROUTE ideal-int +pkg syscall (netbsd-386-cgo), const MSG_DONTWAIT ideal-int +pkg syscall (netbsd-386-cgo), const MSG_EOR ideal-int +pkg syscall (netbsd-386-cgo), const MSG_IOVUSRSPACE ideal-int +pkg syscall (netbsd-386-cgo), const MSG_LENUSRSPACE ideal-int +pkg syscall (netbsd-386-cgo), const MSG_MCAST ideal-int +pkg syscall (netbsd-386-cgo), const MSG_NAMEMBUF ideal-int +pkg syscall (netbsd-386-cgo), const MSG_NBIO ideal-int +pkg syscall (netbsd-386-cgo), const MSG_NOSIGNAL ideal-int +pkg syscall (netbsd-386-cgo), const MSG_OOB ideal-int +pkg syscall (netbsd-386-cgo), const MSG_PEEK ideal-int +pkg syscall (netbsd-386-cgo), const MSG_TRUNC ideal-int +pkg syscall (netbsd-386-cgo), const MSG_USERFLAGS ideal-int +pkg syscall (netbsd-386-cgo), const MSG_WAITALL ideal-int +pkg syscall (netbsd-386-cgo), const NAME_MAX ideal-int +pkg syscall (netbsd-386-cgo), const NET_RT_DUMP ideal-int +pkg syscall (netbsd-386-cgo), const NET_RT_FLAGS ideal-int +pkg syscall (netbsd-386-cgo), const NET_RT_IFLIST ideal-int +pkg syscall (netbsd-386-cgo), const NET_RT_MAXID ideal-int +pkg syscall (netbsd-386-cgo), const NET_RT_OIFLIST ideal-int +pkg syscall (netbsd-386-cgo), const NET_RT_OOIFLIST ideal-int +pkg syscall (netbsd-386-cgo), const NOFLSH ideal-int +pkg syscall (netbsd-386-cgo), const NOTE_ATTRIB ideal-int +pkg syscall (netbsd-386-cgo), const NOTE_CHILD ideal-int +pkg syscall (netbsd-386-cgo), const NOTE_DELETE ideal-int +pkg syscall (netbsd-386-cgo), const NOTE_EXEC ideal-int +pkg syscall (netbsd-386-cgo), const NOTE_EXIT ideal-int +pkg syscall (netbsd-386-cgo), const NOTE_EXTEND ideal-int +pkg syscall (netbsd-386-cgo), const NOTE_FORK ideal-int +pkg syscall (netbsd-386-cgo), const NOTE_LINK ideal-int +pkg syscall (netbsd-386-cgo), const NOTE_LOWAT ideal-int +pkg syscall (netbsd-386-cgo), const NOTE_PCTRLMASK ideal-int +pkg syscall (netbsd-386-cgo), const NOTE_PDATAMASK ideal-int +pkg syscall (netbsd-386-cgo), const NOTE_RENAME ideal-int +pkg syscall (netbsd-386-cgo), const NOTE_REVOKE ideal-int +pkg syscall (netbsd-386-cgo), const NOTE_TRACK ideal-int +pkg syscall (netbsd-386-cgo), const NOTE_TRACKERR ideal-int +pkg syscall (netbsd-386-cgo), const NOTE_WRITE ideal-int +pkg syscall (netbsd-386-cgo), const OCRNL ideal-int +pkg syscall (netbsd-386-cgo), const OFIOGETBMAP ideal-int +pkg syscall (netbsd-386-cgo), const ONLCR ideal-int +pkg syscall (netbsd-386-cgo), const ONLRET ideal-int +pkg syscall (netbsd-386-cgo), const ONOCR ideal-int +pkg syscall (netbsd-386-cgo), const ONOEOT ideal-int +pkg syscall (netbsd-386-cgo), const OPOST ideal-int +pkg syscall (netbsd-386-cgo), const O_ACCMODE ideal-int +pkg syscall (netbsd-386-cgo), const O_ALT_IO ideal-int +pkg syscall (netbsd-386-cgo), const O_DIRECT ideal-int +pkg syscall (netbsd-386-cgo), const O_DIRECTORY ideal-int +pkg syscall (netbsd-386-cgo), const O_DSYNC ideal-int +pkg syscall (netbsd-386-cgo), const O_EXLOCK ideal-int +pkg syscall (netbsd-386-cgo), const O_FSYNC ideal-int +pkg syscall (netbsd-386-cgo), const O_NDELAY ideal-int +pkg syscall (netbsd-386-cgo), const O_NOFOLLOW ideal-int +pkg syscall (netbsd-386-cgo), const O_NOSIGPIPE ideal-int +pkg syscall (netbsd-386-cgo), const O_RSYNC ideal-int +pkg syscall (netbsd-386-cgo), const O_SHLOCK ideal-int +pkg syscall (netbsd-386-cgo), const PARENB ideal-int +pkg syscall (netbsd-386-cgo), const PARMRK ideal-int +pkg syscall (netbsd-386-cgo), const PARODD ideal-int +pkg syscall (netbsd-386-cgo), const PENDIN ideal-int +pkg syscall (netbsd-386-cgo), const PRIO_PGRP = 1 +pkg syscall (netbsd-386-cgo), const PRIO_PGRP ideal-int +pkg syscall (netbsd-386-cgo), const PRIO_PROCESS = 0 +pkg syscall (netbsd-386-cgo), const PRIO_PROCESS ideal-int +pkg syscall (netbsd-386-cgo), const PRIO_USER = 2 +pkg syscall (netbsd-386-cgo), const PRIO_USER ideal-int +pkg syscall (netbsd-386-cgo), const PRI_IOFLUSH ideal-int +pkg syscall (netbsd-386-cgo), const PTRACE_CONT ideal-int +pkg syscall (netbsd-386-cgo), const PTRACE_KILL ideal-int +pkg syscall (netbsd-386-cgo), const PTRACE_TRACEME ideal-int +pkg syscall (netbsd-386-cgo), const RLIMIT_AS ideal-int +pkg syscall (netbsd-386-cgo), const RLIMIT_CORE ideal-int +pkg syscall (netbsd-386-cgo), const RLIMIT_CPU ideal-int +pkg syscall (netbsd-386-cgo), const RLIMIT_DATA ideal-int +pkg syscall (netbsd-386-cgo), const RLIMIT_FSIZE ideal-int +pkg syscall (netbsd-386-cgo), const RLIMIT_NOFILE ideal-int +pkg syscall (netbsd-386-cgo), const RLIMIT_STACK ideal-int +pkg syscall (netbsd-386-cgo), const RLIM_INFINITY ideal-int +pkg syscall (netbsd-386-cgo), const RTAX_AUTHOR ideal-int +pkg syscall (netbsd-386-cgo), const RTAX_BRD ideal-int +pkg syscall (netbsd-386-cgo), const RTAX_DST ideal-int +pkg syscall (netbsd-386-cgo), const RTAX_GATEWAY ideal-int +pkg syscall (netbsd-386-cgo), const RTAX_GENMASK ideal-int +pkg syscall (netbsd-386-cgo), const RTAX_IFA ideal-int +pkg syscall (netbsd-386-cgo), const RTAX_IFP ideal-int +pkg syscall (netbsd-386-cgo), const RTAX_MAX ideal-int +pkg syscall (netbsd-386-cgo), const RTAX_NETMASK ideal-int +pkg syscall (netbsd-386-cgo), const RTAX_TAG ideal-int +pkg syscall (netbsd-386-cgo), const RTA_AUTHOR ideal-int +pkg syscall (netbsd-386-cgo), const RTA_BRD ideal-int +pkg syscall (netbsd-386-cgo), const RTA_DST ideal-int +pkg syscall (netbsd-386-cgo), const RTA_GATEWAY ideal-int +pkg syscall (netbsd-386-cgo), const RTA_GENMASK ideal-int +pkg syscall (netbsd-386-cgo), const RTA_IFA ideal-int +pkg syscall (netbsd-386-cgo), const RTA_IFP ideal-int +pkg syscall (netbsd-386-cgo), const RTA_NETMASK ideal-int +pkg syscall (netbsd-386-cgo), const RTA_TAG ideal-int +pkg syscall (netbsd-386-cgo), const RTF_ANNOUNCE ideal-int +pkg syscall (netbsd-386-cgo), const RTF_BLACKHOLE ideal-int +pkg syscall (netbsd-386-cgo), const RTF_CLONED ideal-int +pkg syscall (netbsd-386-cgo), const RTF_CLONING ideal-int +pkg syscall (netbsd-386-cgo), const RTF_DONE ideal-int +pkg syscall (netbsd-386-cgo), const RTF_DYNAMIC ideal-int +pkg syscall (netbsd-386-cgo), const RTF_GATEWAY ideal-int +pkg syscall (netbsd-386-cgo), const RTF_HOST ideal-int +pkg syscall (netbsd-386-cgo), const RTF_LLINFO ideal-int +pkg syscall (netbsd-386-cgo), const RTF_MASK ideal-int +pkg syscall (netbsd-386-cgo), const RTF_MODIFIED ideal-int +pkg syscall (netbsd-386-cgo), const RTF_PROTO1 ideal-int +pkg syscall (netbsd-386-cgo), const RTF_PROTO2 ideal-int +pkg syscall (netbsd-386-cgo), const RTF_REJECT ideal-int +pkg syscall (netbsd-386-cgo), const RTF_SRC ideal-int +pkg syscall (netbsd-386-cgo), const RTF_STATIC ideal-int +pkg syscall (netbsd-386-cgo), const RTF_UP ideal-int +pkg syscall (netbsd-386-cgo), const RTF_XRESOLVE ideal-int +pkg syscall (netbsd-386-cgo), const RTM_ADD ideal-int +pkg syscall (netbsd-386-cgo), const RTM_CHANGE ideal-int +pkg syscall (netbsd-386-cgo), const RTM_CHGADDR ideal-int +pkg syscall (netbsd-386-cgo), const RTM_DELADDR ideal-int +pkg syscall (netbsd-386-cgo), const RTM_DELETE ideal-int +pkg syscall (netbsd-386-cgo), const RTM_GET ideal-int +pkg syscall (netbsd-386-cgo), const RTM_IEEE80211 ideal-int +pkg syscall (netbsd-386-cgo), const RTM_IFANNOUNCE ideal-int +pkg syscall (netbsd-386-cgo), const RTM_IFINFO ideal-int +pkg syscall (netbsd-386-cgo), const RTM_LLINFO_UPD ideal-int +pkg syscall (netbsd-386-cgo), const RTM_LOCK ideal-int +pkg syscall (netbsd-386-cgo), const RTM_LOSING ideal-int +pkg syscall (netbsd-386-cgo), const RTM_MISS ideal-int +pkg syscall (netbsd-386-cgo), const RTM_NEWADDR ideal-int +pkg syscall (netbsd-386-cgo), const RTM_OIFINFO ideal-int +pkg syscall (netbsd-386-cgo), const RTM_OLDADD ideal-int +pkg syscall (netbsd-386-cgo), const RTM_OLDDEL ideal-int +pkg syscall (netbsd-386-cgo), const RTM_OOIFINFO ideal-int +pkg syscall (netbsd-386-cgo), const RTM_REDIRECT ideal-int +pkg syscall (netbsd-386-cgo), const RTM_RESOLVE ideal-int +pkg syscall (netbsd-386-cgo), const RTM_RTTUNIT ideal-int +pkg syscall (netbsd-386-cgo), const RTM_SETGATE ideal-int +pkg syscall (netbsd-386-cgo), const RTM_VERSION ideal-int +pkg syscall (netbsd-386-cgo), const RTV_EXPIRE ideal-int +pkg syscall (netbsd-386-cgo), const RTV_HOPCOUNT ideal-int +pkg syscall (netbsd-386-cgo), const RTV_MTU ideal-int +pkg syscall (netbsd-386-cgo), const RTV_RPIPE ideal-int +pkg syscall (netbsd-386-cgo), const RTV_RTT ideal-int +pkg syscall (netbsd-386-cgo), const RTV_RTTVAR ideal-int +pkg syscall (netbsd-386-cgo), const RTV_SPIPE ideal-int +pkg syscall (netbsd-386-cgo), const RTV_SSTHRESH ideal-int +pkg syscall (netbsd-386-cgo), const RUSAGE_CHILDREN ideal-int +pkg syscall (netbsd-386-cgo), const RUSAGE_SELF ideal-int +pkg syscall (netbsd-386-cgo), const SCM_CREDS ideal-int +pkg syscall (netbsd-386-cgo), const SCM_RIGHTS ideal-int +pkg syscall (netbsd-386-cgo), const SCM_TIMESTAMP ideal-int +pkg syscall (netbsd-386-cgo), const SIGCHLD Signal +pkg syscall (netbsd-386-cgo), const SIGCONT Signal +pkg syscall (netbsd-386-cgo), const SIGEMT Signal +pkg syscall (netbsd-386-cgo), const SIGINFO Signal +pkg syscall (netbsd-386-cgo), const SIGIO Signal +pkg syscall (netbsd-386-cgo), const SIGIOT Signal +pkg syscall (netbsd-386-cgo), const SIGPROF Signal +pkg syscall (netbsd-386-cgo), const SIGPWR Signal +pkg syscall (netbsd-386-cgo), const SIGSTOP Signal +pkg syscall (netbsd-386-cgo), const SIGSYS Signal +pkg syscall (netbsd-386-cgo), const SIGTSTP Signal +pkg syscall (netbsd-386-cgo), const SIGTTIN Signal +pkg syscall (netbsd-386-cgo), const SIGTTOU Signal +pkg syscall (netbsd-386-cgo), const SIGURG Signal +pkg syscall (netbsd-386-cgo), const SIGUSR1 Signal +pkg syscall (netbsd-386-cgo), const SIGUSR2 Signal +pkg syscall (netbsd-386-cgo), const SIGVTALRM Signal +pkg syscall (netbsd-386-cgo), const SIGWINCH Signal +pkg syscall (netbsd-386-cgo), const SIGXCPU Signal +pkg syscall (netbsd-386-cgo), const SIGXFSZ Signal +pkg syscall (netbsd-386-cgo), const SIOCADDMULTI ideal-int +pkg syscall (netbsd-386-cgo), const SIOCADDRT ideal-int +pkg syscall (netbsd-386-cgo), const SIOCAIFADDR ideal-int +pkg syscall (netbsd-386-cgo), const SIOCALIFADDR ideal-int +pkg syscall (netbsd-386-cgo), const SIOCATMARK ideal-int +pkg syscall (netbsd-386-cgo), const SIOCDELMULTI ideal-int +pkg syscall (netbsd-386-cgo), const SIOCDELRT ideal-int +pkg syscall (netbsd-386-cgo), const SIOCDIFADDR ideal-int +pkg syscall (netbsd-386-cgo), const SIOCDIFPHYADDR ideal-int +pkg syscall (netbsd-386-cgo), const SIOCDLIFADDR ideal-int +pkg syscall (netbsd-386-cgo), const SIOCGDRVSPEC ideal-int +pkg syscall (netbsd-386-cgo), const SIOCGETPFSYNC ideal-int +pkg syscall (netbsd-386-cgo), const SIOCGETSGCNT ideal-int +pkg syscall (netbsd-386-cgo), const SIOCGETVIFCNT ideal-int +pkg syscall (netbsd-386-cgo), const SIOCGHIWAT ideal-int +pkg syscall (netbsd-386-cgo), const SIOCGIFADDR ideal-int +pkg syscall (netbsd-386-cgo), const SIOCGIFADDRPREF ideal-int +pkg syscall (netbsd-386-cgo), const SIOCGIFALIAS ideal-int +pkg syscall (netbsd-386-cgo), const SIOCGIFBRDADDR ideal-int +pkg syscall (netbsd-386-cgo), const SIOCGIFCAP ideal-int +pkg syscall (netbsd-386-cgo), const SIOCGIFCONF ideal-int +pkg syscall (netbsd-386-cgo), const SIOCGIFDATA ideal-int +pkg syscall (netbsd-386-cgo), const SIOCGIFDLT ideal-int +pkg syscall (netbsd-386-cgo), const SIOCGIFDSTADDR ideal-int +pkg syscall (netbsd-386-cgo), const SIOCGIFFLAGS ideal-int +pkg syscall (netbsd-386-cgo), const SIOCGIFGENERIC ideal-int +pkg syscall (netbsd-386-cgo), const SIOCGIFMEDIA ideal-int +pkg syscall (netbsd-386-cgo), const SIOCGIFMETRIC ideal-int +pkg syscall (netbsd-386-cgo), const SIOCGIFMTU ideal-int +pkg syscall (netbsd-386-cgo), const SIOCGIFNETMASK ideal-int +pkg syscall (netbsd-386-cgo), const SIOCGIFPDSTADDR ideal-int +pkg syscall (netbsd-386-cgo), const SIOCGIFPSRCADDR ideal-int +pkg syscall (netbsd-386-cgo), const SIOCGLIFADDR ideal-int +pkg syscall (netbsd-386-cgo), const SIOCGLIFPHYADDR ideal-int +pkg syscall (netbsd-386-cgo), const SIOCGLINKSTR ideal-int +pkg syscall (netbsd-386-cgo), const SIOCGLOWAT ideal-int +pkg syscall (netbsd-386-cgo), const SIOCGPGRP ideal-int +pkg syscall (netbsd-386-cgo), const SIOCGVH ideal-int +pkg syscall (netbsd-386-cgo), const SIOCIFCREATE ideal-int +pkg syscall (netbsd-386-cgo), const SIOCIFDESTROY ideal-int +pkg syscall (netbsd-386-cgo), const SIOCIFGCLONERS ideal-int +pkg syscall (netbsd-386-cgo), const SIOCINITIFADDR ideal-int +pkg syscall (netbsd-386-cgo), const SIOCSDRVSPEC ideal-int +pkg syscall (netbsd-386-cgo), const SIOCSETPFSYNC ideal-int +pkg syscall (netbsd-386-cgo), const SIOCSHIWAT ideal-int +pkg syscall (netbsd-386-cgo), const SIOCSIFADDR ideal-int +pkg syscall (netbsd-386-cgo), const SIOCSIFADDRPREF ideal-int +pkg syscall (netbsd-386-cgo), const SIOCSIFBRDADDR ideal-int +pkg syscall (netbsd-386-cgo), const SIOCSIFCAP ideal-int +pkg syscall (netbsd-386-cgo), const SIOCSIFDSTADDR ideal-int +pkg syscall (netbsd-386-cgo), const SIOCSIFFLAGS ideal-int +pkg syscall (netbsd-386-cgo), const SIOCSIFGENERIC ideal-int +pkg syscall (netbsd-386-cgo), const SIOCSIFMEDIA ideal-int +pkg syscall (netbsd-386-cgo), const SIOCSIFMETRIC ideal-int +pkg syscall (netbsd-386-cgo), const SIOCSIFMTU ideal-int +pkg syscall (netbsd-386-cgo), const SIOCSIFNETMASK ideal-int +pkg syscall (netbsd-386-cgo), const SIOCSIFPHYADDR ideal-int +pkg syscall (netbsd-386-cgo), const SIOCSLIFPHYADDR ideal-int +pkg syscall (netbsd-386-cgo), const SIOCSLINKSTR ideal-int +pkg syscall (netbsd-386-cgo), const SIOCSLOWAT ideal-int +pkg syscall (netbsd-386-cgo), const SIOCSPGRP ideal-int +pkg syscall (netbsd-386-cgo), const SIOCSVH ideal-int +pkg syscall (netbsd-386-cgo), const SIOCZIFDATA ideal-int +pkg syscall (netbsd-386-cgo), const SOCK_CLOEXEC ideal-int +pkg syscall (netbsd-386-cgo), const SOCK_FLAGS_MASK ideal-int +pkg syscall (netbsd-386-cgo), const SOCK_NONBLOCK ideal-int +pkg syscall (netbsd-386-cgo), const SOCK_NOSIGPIPE ideal-int +pkg syscall (netbsd-386-cgo), const SOCK_RDM ideal-int +pkg syscall (netbsd-386-cgo), const SO_ACCEPTCONN ideal-int +pkg syscall (netbsd-386-cgo), const SO_ACCEPTFILTER ideal-int +pkg syscall (netbsd-386-cgo), const SO_DEBUG ideal-int +pkg syscall (netbsd-386-cgo), const SO_ERROR ideal-int +pkg syscall (netbsd-386-cgo), const SO_NOHEADER ideal-int +pkg syscall (netbsd-386-cgo), const SO_NOSIGPIPE ideal-int +pkg syscall (netbsd-386-cgo), const SO_OOBINLINE ideal-int +pkg syscall (netbsd-386-cgo), const SO_OVERFLOWED ideal-int +pkg syscall (netbsd-386-cgo), const SO_RCVLOWAT ideal-int +pkg syscall (netbsd-386-cgo), const SO_RCVTIMEO ideal-int +pkg syscall (netbsd-386-cgo), const SO_REUSEPORT ideal-int +pkg syscall (netbsd-386-cgo), const SO_SNDLOWAT ideal-int +pkg syscall (netbsd-386-cgo), const SO_SNDTIMEO ideal-int +pkg syscall (netbsd-386-cgo), const SO_TIMESTAMP ideal-int +pkg syscall (netbsd-386-cgo), const SO_TYPE ideal-int +pkg syscall (netbsd-386-cgo), const SO_USELOOPBACK ideal-int +pkg syscall (netbsd-386-cgo), const SYSCTL_VERSION ideal-int +pkg syscall (netbsd-386-cgo), const SYSCTL_VERS_0 ideal-int +pkg syscall (netbsd-386-cgo), const SYSCTL_VERS_1 ideal-int +pkg syscall (netbsd-386-cgo), const SYSCTL_VERS_MASK ideal-int +pkg syscall (netbsd-386-cgo), const SYS_ACCEPT ideal-int +pkg syscall (netbsd-386-cgo), const SYS_ACCESS ideal-int +pkg syscall (netbsd-386-cgo), const SYS_ACCT ideal-int +pkg syscall (netbsd-386-cgo), const SYS_ADJTIME ideal-int +pkg syscall (netbsd-386-cgo), const SYS_BIND ideal-int +pkg syscall (netbsd-386-cgo), const SYS_BREAK ideal-int +pkg syscall (netbsd-386-cgo), const SYS_CHDIR ideal-int +pkg syscall (netbsd-386-cgo), const SYS_CHFLAGS ideal-int +pkg syscall (netbsd-386-cgo), const SYS_CHMOD ideal-int +pkg syscall (netbsd-386-cgo), const SYS_CHOWN ideal-int +pkg syscall (netbsd-386-cgo), const SYS_CHROOT ideal-int +pkg syscall (netbsd-386-cgo), const SYS_CLOCK_GETRES ideal-int +pkg syscall (netbsd-386-cgo), const SYS_CLOCK_GETTIME ideal-int +pkg syscall (netbsd-386-cgo), const SYS_CLOCK_SETTIME ideal-int +pkg syscall (netbsd-386-cgo), const SYS_CLOSE ideal-int +pkg syscall (netbsd-386-cgo), const SYS_CONNECT ideal-int +pkg syscall (netbsd-386-cgo), const SYS_DUP ideal-int +pkg syscall (netbsd-386-cgo), const SYS_DUP2 ideal-int +pkg syscall (netbsd-386-cgo), const SYS_DUP3 ideal-int +pkg syscall (netbsd-386-cgo), const SYS_EXECVE ideal-int +pkg syscall (netbsd-386-cgo), const SYS_EXIT ideal-int +pkg syscall (netbsd-386-cgo), const SYS_EXTATTRCTL ideal-int +pkg syscall (netbsd-386-cgo), const SYS_EXTATTR_DELETE_FD ideal-int +pkg syscall (netbsd-386-cgo), const SYS_EXTATTR_DELETE_FILE ideal-int +pkg syscall (netbsd-386-cgo), const SYS_EXTATTR_DELETE_LINK ideal-int +pkg syscall (netbsd-386-cgo), const SYS_EXTATTR_GET_FD ideal-int +pkg syscall (netbsd-386-cgo), const SYS_EXTATTR_GET_FILE ideal-int +pkg syscall (netbsd-386-cgo), const SYS_EXTATTR_GET_LINK ideal-int +pkg syscall (netbsd-386-cgo), const SYS_EXTATTR_LIST_FD ideal-int +pkg syscall (netbsd-386-cgo), const SYS_EXTATTR_LIST_FILE ideal-int +pkg syscall (netbsd-386-cgo), const SYS_EXTATTR_LIST_LINK ideal-int +pkg syscall (netbsd-386-cgo), const SYS_EXTATTR_SET_FD ideal-int +pkg syscall (netbsd-386-cgo), const SYS_EXTATTR_SET_FILE ideal-int +pkg syscall (netbsd-386-cgo), const SYS_EXTATTR_SET_LINK ideal-int +pkg syscall (netbsd-386-cgo), const SYS_FACCESSAT ideal-int +pkg syscall (netbsd-386-cgo), const SYS_FCHDIR ideal-int +pkg syscall (netbsd-386-cgo), const SYS_FCHFLAGS ideal-int +pkg syscall (netbsd-386-cgo), const SYS_FCHMOD ideal-int +pkg syscall (netbsd-386-cgo), const SYS_FCHMODAT ideal-int +pkg syscall (netbsd-386-cgo), const SYS_FCHOWN ideal-int +pkg syscall (netbsd-386-cgo), const SYS_FCHOWNAT ideal-int +pkg syscall (netbsd-386-cgo), const SYS_FCHROOT ideal-int +pkg syscall (netbsd-386-cgo), const SYS_FCNTL ideal-int +pkg syscall (netbsd-386-cgo), const SYS_FDATASYNC ideal-int +pkg syscall (netbsd-386-cgo), const SYS_FEXECVE ideal-int +pkg syscall (netbsd-386-cgo), const SYS_FGETXATTR ideal-int +pkg syscall (netbsd-386-cgo), const SYS_FHSTAT ideal-int +pkg syscall (netbsd-386-cgo), const SYS_FKTRACE ideal-int +pkg syscall (netbsd-386-cgo), const SYS_FLISTXATTR ideal-int +pkg syscall (netbsd-386-cgo), const SYS_FLOCK ideal-int +pkg syscall (netbsd-386-cgo), const SYS_FORK ideal-int +pkg syscall (netbsd-386-cgo), const SYS_FPATHCONF ideal-int +pkg syscall (netbsd-386-cgo), const SYS_FREMOVEXATTR ideal-int +pkg syscall (netbsd-386-cgo), const SYS_FSETXATTR ideal-int +pkg syscall (netbsd-386-cgo), const SYS_FSTAT ideal-int +pkg syscall (netbsd-386-cgo), const SYS_FSTATAT ideal-int +pkg syscall (netbsd-386-cgo), const SYS_FSTATVFS1 ideal-int +pkg syscall (netbsd-386-cgo), const SYS_FSYNC ideal-int +pkg syscall (netbsd-386-cgo), const SYS_FSYNC_RANGE ideal-int +pkg syscall (netbsd-386-cgo), const SYS_FTRUNCATE ideal-int +pkg syscall (netbsd-386-cgo), const SYS_FUTIMENS ideal-int +pkg syscall (netbsd-386-cgo), const SYS_FUTIMES ideal-int +pkg syscall (netbsd-386-cgo), const SYS_GETCONTEXT ideal-int +pkg syscall (netbsd-386-cgo), const SYS_GETDENTS ideal-int +pkg syscall (netbsd-386-cgo), const SYS_GETEGID ideal-int +pkg syscall (netbsd-386-cgo), const SYS_GETEUID ideal-int +pkg syscall (netbsd-386-cgo), const SYS_GETFH ideal-int +pkg syscall (netbsd-386-cgo), const SYS_GETGID ideal-int +pkg syscall (netbsd-386-cgo), const SYS_GETGROUPS ideal-int +pkg syscall (netbsd-386-cgo), const SYS_GETITIMER ideal-int +pkg syscall (netbsd-386-cgo), const SYS_GETPEERNAME ideal-int +pkg syscall (netbsd-386-cgo), const SYS_GETPGID ideal-int +pkg syscall (netbsd-386-cgo), const SYS_GETPGRP ideal-int +pkg syscall (netbsd-386-cgo), const SYS_GETPID ideal-int +pkg syscall (netbsd-386-cgo), const SYS_GETPPID ideal-int +pkg syscall (netbsd-386-cgo), const SYS_GETPRIORITY ideal-int +pkg syscall (netbsd-386-cgo), const SYS_GETRLIMIT ideal-int +pkg syscall (netbsd-386-cgo), const SYS_GETRUSAGE ideal-int +pkg syscall (netbsd-386-cgo), const SYS_GETSID ideal-int +pkg syscall (netbsd-386-cgo), const SYS_GETSOCKNAME ideal-int +pkg syscall (netbsd-386-cgo), const SYS_GETSOCKOPT ideal-int +pkg syscall (netbsd-386-cgo), const SYS_GETTIMEOFDAY ideal-int +pkg syscall (netbsd-386-cgo), const SYS_GETUID ideal-int +pkg syscall (netbsd-386-cgo), const SYS_GETVFSSTAT ideal-int +pkg syscall (netbsd-386-cgo), const SYS_GETXATTR ideal-int +pkg syscall (netbsd-386-cgo), const SYS_IOCTL ideal-int +pkg syscall (netbsd-386-cgo), const SYS_ISSETUGID ideal-int +pkg syscall (netbsd-386-cgo), const SYS_KEVENT ideal-int +pkg syscall (netbsd-386-cgo), const SYS_KILL ideal-int +pkg syscall (netbsd-386-cgo), const SYS_KQUEUE ideal-int +pkg syscall (netbsd-386-cgo), const SYS_KQUEUE1 ideal-int +pkg syscall (netbsd-386-cgo), const SYS_KTRACE ideal-int +pkg syscall (netbsd-386-cgo), const SYS_LCHFLAGS ideal-int +pkg syscall (netbsd-386-cgo), const SYS_LCHMOD ideal-int +pkg syscall (netbsd-386-cgo), const SYS_LCHOWN ideal-int +pkg syscall (netbsd-386-cgo), const SYS_LGETXATTR ideal-int +pkg syscall (netbsd-386-cgo), const SYS_LINK ideal-int +pkg syscall (netbsd-386-cgo), const SYS_LINKAT ideal-int +pkg syscall (netbsd-386-cgo), const SYS_LISTEN ideal-int +pkg syscall (netbsd-386-cgo), const SYS_LISTXATTR ideal-int +pkg syscall (netbsd-386-cgo), const SYS_LLISTXATTR ideal-int +pkg syscall (netbsd-386-cgo), const SYS_LREMOVEXATTR ideal-int +pkg syscall (netbsd-386-cgo), const SYS_LSEEK ideal-int +pkg syscall (netbsd-386-cgo), const SYS_LSETXATTR ideal-int +pkg syscall (netbsd-386-cgo), const SYS_LSTAT ideal-int +pkg syscall (netbsd-386-cgo), const SYS_LUTIMES ideal-int +pkg syscall (netbsd-386-cgo), const SYS_MADVISE ideal-int +pkg syscall (netbsd-386-cgo), const SYS_MINCORE ideal-int +pkg syscall (netbsd-386-cgo), const SYS_MINHERIT ideal-int +pkg syscall (netbsd-386-cgo), const SYS_MKDIR ideal-int +pkg syscall (netbsd-386-cgo), const SYS_MKDIRAT ideal-int +pkg syscall (netbsd-386-cgo), const SYS_MKFIFO ideal-int +pkg syscall (netbsd-386-cgo), const SYS_MKFIFOAT ideal-int +pkg syscall (netbsd-386-cgo), const SYS_MKNOD ideal-int +pkg syscall (netbsd-386-cgo), const SYS_MKNODAT ideal-int +pkg syscall (netbsd-386-cgo), const SYS_MLOCK ideal-int +pkg syscall (netbsd-386-cgo), const SYS_MLOCKALL ideal-int +pkg syscall (netbsd-386-cgo), const SYS_MMAP ideal-int +pkg syscall (netbsd-386-cgo), const SYS_MODCTL ideal-int +pkg syscall (netbsd-386-cgo), const SYS_MOUNT ideal-int +pkg syscall (netbsd-386-cgo), const SYS_MPROTECT ideal-int +pkg syscall (netbsd-386-cgo), const SYS_MREMAP ideal-int +pkg syscall (netbsd-386-cgo), const SYS_MSGCTL ideal-int +pkg syscall (netbsd-386-cgo), const SYS_MSGGET ideal-int +pkg syscall (netbsd-386-cgo), const SYS_MSGRCV ideal-int +pkg syscall (netbsd-386-cgo), const SYS_MSGSND ideal-int +pkg syscall (netbsd-386-cgo), const SYS_MUNLOCK ideal-int +pkg syscall (netbsd-386-cgo), const SYS_MUNLOCKALL ideal-int +pkg syscall (netbsd-386-cgo), const SYS_MUNMAP ideal-int +pkg syscall (netbsd-386-cgo), const SYS_NANOSLEEP ideal-int +pkg syscall (netbsd-386-cgo), const SYS_NTP_ADJTIME ideal-int +pkg syscall (netbsd-386-cgo), const SYS_NTP_GETTIME ideal-int +pkg syscall (netbsd-386-cgo), const SYS_OPEN ideal-int +pkg syscall (netbsd-386-cgo), const SYS_OPENAT ideal-int +pkg syscall (netbsd-386-cgo), const SYS_PACCEPT ideal-int +pkg syscall (netbsd-386-cgo), const SYS_PATHCONF ideal-int +pkg syscall (netbsd-386-cgo), const SYS_PIPE ideal-int +pkg syscall (netbsd-386-cgo), const SYS_PIPE2 ideal-int +pkg syscall (netbsd-386-cgo), const SYS_PMC_CONTROL ideal-int +pkg syscall (netbsd-386-cgo), const SYS_PMC_GET_INFO ideal-int +pkg syscall (netbsd-386-cgo), const SYS_POLL ideal-int +pkg syscall (netbsd-386-cgo), const SYS_POLLTS ideal-int +pkg syscall (netbsd-386-cgo), const SYS_POSIX_FADVISE ideal-int +pkg syscall (netbsd-386-cgo), const SYS_POSIX_SPAWN ideal-int +pkg syscall (netbsd-386-cgo), const SYS_PREAD ideal-int +pkg syscall (netbsd-386-cgo), const SYS_PREADV ideal-int +pkg syscall (netbsd-386-cgo), const SYS_PROFIL ideal-int +pkg syscall (netbsd-386-cgo), const SYS_PSELECT ideal-int +pkg syscall (netbsd-386-cgo), const SYS_PSET_ASSIGN ideal-int +pkg syscall (netbsd-386-cgo), const SYS_PSET_CREATE ideal-int +pkg syscall (netbsd-386-cgo), const SYS_PSET_DESTROY ideal-int +pkg syscall (netbsd-386-cgo), const SYS_PTRACE ideal-int +pkg syscall (netbsd-386-cgo), const SYS_PWRITE ideal-int +pkg syscall (netbsd-386-cgo), const SYS_PWRITEV ideal-int +pkg syscall (netbsd-386-cgo), const SYS_RASCTL ideal-int +pkg syscall (netbsd-386-cgo), const SYS_READ ideal-int +pkg syscall (netbsd-386-cgo), const SYS_READLINK ideal-int +pkg syscall (netbsd-386-cgo), const SYS_READLINKAT ideal-int +pkg syscall (netbsd-386-cgo), const SYS_READV ideal-int +pkg syscall (netbsd-386-cgo), const SYS_REBOOT ideal-int +pkg syscall (netbsd-386-cgo), const SYS_RECVFROM ideal-int +pkg syscall (netbsd-386-cgo), const SYS_RECVMMSG ideal-int +pkg syscall (netbsd-386-cgo), const SYS_RECVMSG ideal-int +pkg syscall (netbsd-386-cgo), const SYS_REMOVEXATTR ideal-int +pkg syscall (netbsd-386-cgo), const SYS_RENAME ideal-int +pkg syscall (netbsd-386-cgo), const SYS_RENAMEAT ideal-int +pkg syscall (netbsd-386-cgo), const SYS_REVOKE ideal-int +pkg syscall (netbsd-386-cgo), const SYS_RMDIR ideal-int +pkg syscall (netbsd-386-cgo), const SYS_SBRK ideal-int +pkg syscall (netbsd-386-cgo), const SYS_SCHED_YIELD ideal-int +pkg syscall (netbsd-386-cgo), const SYS_SELECT ideal-int +pkg syscall (netbsd-386-cgo), const SYS_SEMCONFIG ideal-int +pkg syscall (netbsd-386-cgo), const SYS_SEMGET ideal-int +pkg syscall (netbsd-386-cgo), const SYS_SEMOP ideal-int +pkg syscall (netbsd-386-cgo), const SYS_SENDMMSG ideal-int +pkg syscall (netbsd-386-cgo), const SYS_SENDMSG ideal-int +pkg syscall (netbsd-386-cgo), const SYS_SENDTO ideal-int +pkg syscall (netbsd-386-cgo), const SYS_SETCONTEXT ideal-int +pkg syscall (netbsd-386-cgo), const SYS_SETEGID ideal-int +pkg syscall (netbsd-386-cgo), const SYS_SETEUID ideal-int +pkg syscall (netbsd-386-cgo), const SYS_SETGID ideal-int +pkg syscall (netbsd-386-cgo), const SYS_SETGROUPS ideal-int +pkg syscall (netbsd-386-cgo), const SYS_SETITIMER ideal-int +pkg syscall (netbsd-386-cgo), const SYS_SETPGID ideal-int +pkg syscall (netbsd-386-cgo), const SYS_SETPRIORITY ideal-int +pkg syscall (netbsd-386-cgo), const SYS_SETREGID ideal-int +pkg syscall (netbsd-386-cgo), const SYS_SETREUID ideal-int +pkg syscall (netbsd-386-cgo), const SYS_SETRLIMIT ideal-int +pkg syscall (netbsd-386-cgo), const SYS_SETSID ideal-int +pkg syscall (netbsd-386-cgo), const SYS_SETSOCKOPT ideal-int +pkg syscall (netbsd-386-cgo), const SYS_SETTIMEOFDAY ideal-int +pkg syscall (netbsd-386-cgo), const SYS_SETUID ideal-int +pkg syscall (netbsd-386-cgo), const SYS_SETXATTR ideal-int +pkg syscall (netbsd-386-cgo), const SYS_SHMAT ideal-int +pkg syscall (netbsd-386-cgo), const SYS_SHMCTL ideal-int +pkg syscall (netbsd-386-cgo), const SYS_SHMDT ideal-int +pkg syscall (netbsd-386-cgo), const SYS_SHMGET ideal-int +pkg syscall (netbsd-386-cgo), const SYS_SHUTDOWN ideal-int +pkg syscall (netbsd-386-cgo), const SYS_SIGQUEUEINFO ideal-int +pkg syscall (netbsd-386-cgo), const SYS_SOCKET ideal-int +pkg syscall (netbsd-386-cgo), const SYS_SOCKETPAIR ideal-int +pkg syscall (netbsd-386-cgo), const SYS_SSTK ideal-int +pkg syscall (netbsd-386-cgo), const SYS_STAT ideal-int +pkg syscall (netbsd-386-cgo), const SYS_STATVFS1 ideal-int +pkg syscall (netbsd-386-cgo), const SYS_SWAPCTL ideal-int +pkg syscall (netbsd-386-cgo), const SYS_SYMLINK ideal-int +pkg syscall (netbsd-386-cgo), const SYS_SYMLINKAT ideal-int +pkg syscall (netbsd-386-cgo), const SYS_SYNC ideal-int +pkg syscall (netbsd-386-cgo), const SYS_SYSARCH ideal-int +pkg syscall (netbsd-386-cgo), const SYS_TIMER_CREATE ideal-int +pkg syscall (netbsd-386-cgo), const SYS_TIMER_DELETE ideal-int +pkg syscall (netbsd-386-cgo), const SYS_TIMER_GETOVERRUN ideal-int +pkg syscall (netbsd-386-cgo), const SYS_TIMER_GETTIME ideal-int +pkg syscall (netbsd-386-cgo), const SYS_TIMER_SETTIME ideal-int +pkg syscall (netbsd-386-cgo), const SYS_TRUNCATE ideal-int +pkg syscall (netbsd-386-cgo), const SYS_UMASK ideal-int +pkg syscall (netbsd-386-cgo), const SYS_UNDELETE ideal-int +pkg syscall (netbsd-386-cgo), const SYS_UNLINK ideal-int +pkg syscall (netbsd-386-cgo), const SYS_UNLINKAT ideal-int +pkg syscall (netbsd-386-cgo), const SYS_UNMOUNT ideal-int +pkg syscall (netbsd-386-cgo), const SYS_UTIMENSAT ideal-int +pkg syscall (netbsd-386-cgo), const SYS_UTIMES ideal-int +pkg syscall (netbsd-386-cgo), const SYS_UTRACE ideal-int +pkg syscall (netbsd-386-cgo), const SYS_UUIDGEN ideal-int +pkg syscall (netbsd-386-cgo), const SYS_VADVISE ideal-int +pkg syscall (netbsd-386-cgo), const SYS_VFORK ideal-int +pkg syscall (netbsd-386-cgo), const SYS_WAIT4 ideal-int +pkg syscall (netbsd-386-cgo), const SYS_WRITE ideal-int +pkg syscall (netbsd-386-cgo), const SYS_WRITEV ideal-int +pkg syscall (netbsd-386-cgo), const SYS__LWP_CONTINUE ideal-int +pkg syscall (netbsd-386-cgo), const SYS__LWP_CREATE ideal-int +pkg syscall (netbsd-386-cgo), const SYS__LWP_CTL ideal-int +pkg syscall (netbsd-386-cgo), const SYS__LWP_DETACH ideal-int +pkg syscall (netbsd-386-cgo), const SYS__LWP_EXIT ideal-int +pkg syscall (netbsd-386-cgo), const SYS__LWP_GETNAME ideal-int +pkg syscall (netbsd-386-cgo), const SYS__LWP_GETPRIVATE ideal-int +pkg syscall (netbsd-386-cgo), const SYS__LWP_KILL ideal-int +pkg syscall (netbsd-386-cgo), const SYS__LWP_PARK ideal-int +pkg syscall (netbsd-386-cgo), const SYS__LWP_SELF ideal-int +pkg syscall (netbsd-386-cgo), const SYS__LWP_SETNAME ideal-int +pkg syscall (netbsd-386-cgo), const SYS__LWP_SETPRIVATE ideal-int +pkg syscall (netbsd-386-cgo), const SYS__LWP_SUSPEND ideal-int +pkg syscall (netbsd-386-cgo), const SYS__LWP_UNPARK ideal-int +pkg syscall (netbsd-386-cgo), const SYS__LWP_UNPARK_ALL ideal-int +pkg syscall (netbsd-386-cgo), const SYS__LWP_WAIT ideal-int +pkg syscall (netbsd-386-cgo), const SYS__LWP_WAKEUP ideal-int +pkg syscall (netbsd-386-cgo), const SYS__PSET_BIND ideal-int +pkg syscall (netbsd-386-cgo), const SYS__SCHED_GETAFFINITY ideal-int +pkg syscall (netbsd-386-cgo), const SYS__SCHED_GETPARAM ideal-int +pkg syscall (netbsd-386-cgo), const SYS__SCHED_SETAFFINITY ideal-int +pkg syscall (netbsd-386-cgo), const SYS__SCHED_SETPARAM ideal-int +pkg syscall (netbsd-386-cgo), const SYS___CLONE ideal-int +pkg syscall (netbsd-386-cgo), const SYS___GETCWD ideal-int +pkg syscall (netbsd-386-cgo), const SYS___GETLOGIN ideal-int +pkg syscall (netbsd-386-cgo), const SYS___POSIX_CHOWN ideal-int +pkg syscall (netbsd-386-cgo), const SYS___POSIX_FCHOWN ideal-int +pkg syscall (netbsd-386-cgo), const SYS___POSIX_LCHOWN ideal-int +pkg syscall (netbsd-386-cgo), const SYS___POSIX_RENAME ideal-int +pkg syscall (netbsd-386-cgo), const SYS___QUOTACTL ideal-int +pkg syscall (netbsd-386-cgo), const SYS___SEMCTL ideal-int +pkg syscall (netbsd-386-cgo), const SYS___SETLOGIN ideal-int +pkg syscall (netbsd-386-cgo), const SYS___SIGACTION_SIGTRAMP ideal-int +pkg syscall (netbsd-386-cgo), const SYS___SIGTIMEDWAIT ideal-int +pkg syscall (netbsd-386-cgo), const SYS___SYSCTL ideal-int +pkg syscall (netbsd-386-cgo), const S_ARCH1 ideal-int +pkg syscall (netbsd-386-cgo), const S_ARCH2 ideal-int +pkg syscall (netbsd-386-cgo), const S_BLKSIZE ideal-int +pkg syscall (netbsd-386-cgo), const S_IEXEC ideal-int +pkg syscall (netbsd-386-cgo), const S_IFWHT ideal-int +pkg syscall (netbsd-386-cgo), const S_IREAD ideal-int +pkg syscall (netbsd-386-cgo), const S_IRGRP ideal-int +pkg syscall (netbsd-386-cgo), const S_IROTH ideal-int +pkg syscall (netbsd-386-cgo), const S_IRWXG ideal-int +pkg syscall (netbsd-386-cgo), const S_IRWXO ideal-int +pkg syscall (netbsd-386-cgo), const S_IRWXU ideal-int +pkg syscall (netbsd-386-cgo), const S_ISTXT ideal-int +pkg syscall (netbsd-386-cgo), const S_IWGRP ideal-int +pkg syscall (netbsd-386-cgo), const S_IWOTH ideal-int +pkg syscall (netbsd-386-cgo), const S_IWRITE ideal-int +pkg syscall (netbsd-386-cgo), const S_IXGRP ideal-int +pkg syscall (netbsd-386-cgo), const S_IXOTH ideal-int +pkg syscall (netbsd-386-cgo), const S_LOGIN_SET ideal-int +pkg syscall (netbsd-386-cgo), const SizeofBpfHdr ideal-int +pkg syscall (netbsd-386-cgo), const SizeofBpfInsn ideal-int +pkg syscall (netbsd-386-cgo), const SizeofBpfProgram ideal-int +pkg syscall (netbsd-386-cgo), const SizeofBpfStat ideal-int +pkg syscall (netbsd-386-cgo), const SizeofBpfVersion ideal-int +pkg syscall (netbsd-386-cgo), const SizeofCmsghdr ideal-int +pkg syscall (netbsd-386-cgo), const SizeofICMPv6Filter = 32 +pkg syscall (netbsd-386-cgo), const SizeofICMPv6Filter ideal-int +pkg syscall (netbsd-386-cgo), const SizeofIPMreq ideal-int +pkg syscall (netbsd-386-cgo), const SizeofIPv6MTUInfo = 32 +pkg syscall (netbsd-386-cgo), const SizeofIPv6MTUInfo ideal-int +pkg syscall (netbsd-386-cgo), const SizeofIPv6Mreq ideal-int +pkg syscall (netbsd-386-cgo), const SizeofIfAnnounceMsghdr ideal-int +pkg syscall (netbsd-386-cgo), const SizeofIfData ideal-int +pkg syscall (netbsd-386-cgo), const SizeofIfMsghdr ideal-int +pkg syscall (netbsd-386-cgo), const SizeofIfaMsghdr ideal-int +pkg syscall (netbsd-386-cgo), const SizeofInet6Pktinfo ideal-int +pkg syscall (netbsd-386-cgo), const SizeofLinger ideal-int +pkg syscall (netbsd-386-cgo), const SizeofMsghdr ideal-int +pkg syscall (netbsd-386-cgo), const SizeofRtMetrics ideal-int +pkg syscall (netbsd-386-cgo), const SizeofRtMsghdr ideal-int +pkg syscall (netbsd-386-cgo), const SizeofSockaddrAny ideal-int +pkg syscall (netbsd-386-cgo), const SizeofSockaddrDatalink ideal-int +pkg syscall (netbsd-386-cgo), const SizeofSockaddrInet4 ideal-int +pkg syscall (netbsd-386-cgo), const SizeofSockaddrInet6 ideal-int +pkg syscall (netbsd-386-cgo), const SizeofSockaddrUnix ideal-int +pkg syscall (netbsd-386-cgo), const TCIFLUSH ideal-int +pkg syscall (netbsd-386-cgo), const TCIOFLUSH ideal-int +pkg syscall (netbsd-386-cgo), const TCOFLUSH ideal-int +pkg syscall (netbsd-386-cgo), const TCP_CONGCTL ideal-int +pkg syscall (netbsd-386-cgo), const TCP_KEEPCNT ideal-int +pkg syscall (netbsd-386-cgo), const TCP_KEEPIDLE ideal-int +pkg syscall (netbsd-386-cgo), const TCP_KEEPINIT ideal-int +pkg syscall (netbsd-386-cgo), const TCP_KEEPINTVL ideal-int +pkg syscall (netbsd-386-cgo), const TCP_MAXBURST ideal-int +pkg syscall (netbsd-386-cgo), const TCP_MAXSEG ideal-int +pkg syscall (netbsd-386-cgo), const TCP_MAXWIN ideal-int +pkg syscall (netbsd-386-cgo), const TCP_MAX_WINSHIFT ideal-int +pkg syscall (netbsd-386-cgo), const TCP_MD5SIG ideal-int +pkg syscall (netbsd-386-cgo), const TCP_MINMSS ideal-int +pkg syscall (netbsd-386-cgo), const TCP_MSS ideal-int +pkg syscall (netbsd-386-cgo), const TCSAFLUSH ideal-int +pkg syscall (netbsd-386-cgo), const TIOCCBRK ideal-int +pkg syscall (netbsd-386-cgo), const TIOCCDTR ideal-int +pkg syscall (netbsd-386-cgo), const TIOCCONS ideal-int +pkg syscall (netbsd-386-cgo), const TIOCDCDTIMESTAMP ideal-int +pkg syscall (netbsd-386-cgo), const TIOCDRAIN ideal-int +pkg syscall (netbsd-386-cgo), const TIOCEXCL ideal-int +pkg syscall (netbsd-386-cgo), const TIOCEXT ideal-int +pkg syscall (netbsd-386-cgo), const TIOCFLAG_CDTRCTS ideal-int +pkg syscall (netbsd-386-cgo), const TIOCFLAG_CLOCAL ideal-int +pkg syscall (netbsd-386-cgo), const TIOCFLAG_CRTSCTS ideal-int +pkg syscall (netbsd-386-cgo), const TIOCFLAG_MDMBUF ideal-int +pkg syscall (netbsd-386-cgo), const TIOCFLAG_SOFTCAR ideal-int +pkg syscall (netbsd-386-cgo), const TIOCFLUSH ideal-int +pkg syscall (netbsd-386-cgo), const TIOCGETA ideal-int +pkg syscall (netbsd-386-cgo), const TIOCGETD ideal-int +pkg syscall (netbsd-386-cgo), const TIOCGFLAGS ideal-int +pkg syscall (netbsd-386-cgo), const TIOCGLINED ideal-int +pkg syscall (netbsd-386-cgo), const TIOCGPGRP ideal-int +pkg syscall (netbsd-386-cgo), const TIOCGQSIZE ideal-int +pkg syscall (netbsd-386-cgo), const TIOCGRANTPT ideal-int +pkg syscall (netbsd-386-cgo), const TIOCGSID ideal-int +pkg syscall (netbsd-386-cgo), const TIOCGSIZE ideal-int +pkg syscall (netbsd-386-cgo), const TIOCGWINSZ ideal-int +pkg syscall (netbsd-386-cgo), const TIOCMBIC ideal-int +pkg syscall (netbsd-386-cgo), const TIOCMBIS ideal-int +pkg syscall (netbsd-386-cgo), const TIOCMGET ideal-int +pkg syscall (netbsd-386-cgo), const TIOCMSET ideal-int +pkg syscall (netbsd-386-cgo), const TIOCM_CAR ideal-int +pkg syscall (netbsd-386-cgo), const TIOCM_CD ideal-int +pkg syscall (netbsd-386-cgo), const TIOCM_CTS ideal-int +pkg syscall (netbsd-386-cgo), const TIOCM_DSR ideal-int +pkg syscall (netbsd-386-cgo), const TIOCM_DTR ideal-int +pkg syscall (netbsd-386-cgo), const TIOCM_LE ideal-int +pkg syscall (netbsd-386-cgo), const TIOCM_RI ideal-int +pkg syscall (netbsd-386-cgo), const TIOCM_RNG ideal-int +pkg syscall (netbsd-386-cgo), const TIOCM_RTS ideal-int +pkg syscall (netbsd-386-cgo), const TIOCM_SR ideal-int +pkg syscall (netbsd-386-cgo), const TIOCM_ST ideal-int +pkg syscall (netbsd-386-cgo), const TIOCNOTTY ideal-int +pkg syscall (netbsd-386-cgo), const TIOCNXCL ideal-int +pkg syscall (netbsd-386-cgo), const TIOCOUTQ ideal-int +pkg syscall (netbsd-386-cgo), const TIOCPKT ideal-int +pkg syscall (netbsd-386-cgo), const TIOCPKT_DATA ideal-int +pkg syscall (netbsd-386-cgo), const TIOCPKT_DOSTOP ideal-int +pkg syscall (netbsd-386-cgo), const TIOCPKT_FLUSHREAD ideal-int +pkg syscall (netbsd-386-cgo), const TIOCPKT_FLUSHWRITE ideal-int +pkg syscall (netbsd-386-cgo), const TIOCPKT_IOCTL ideal-int +pkg syscall (netbsd-386-cgo), const TIOCPKT_NOSTOP ideal-int +pkg syscall (netbsd-386-cgo), const TIOCPKT_START ideal-int +pkg syscall (netbsd-386-cgo), const TIOCPKT_STOP ideal-int +pkg syscall (netbsd-386-cgo), const TIOCPTMGET ideal-int +pkg syscall (netbsd-386-cgo), const TIOCPTSNAME ideal-int +pkg syscall (netbsd-386-cgo), const TIOCRCVFRAME ideal-int +pkg syscall (netbsd-386-cgo), const TIOCREMOTE ideal-int +pkg syscall (netbsd-386-cgo), const TIOCSBRK ideal-int +pkg syscall (netbsd-386-cgo), const TIOCSCTTY ideal-int +pkg syscall (netbsd-386-cgo), const TIOCSDTR ideal-int +pkg syscall (netbsd-386-cgo), const TIOCSETA ideal-int +pkg syscall (netbsd-386-cgo), const TIOCSETAF ideal-int +pkg syscall (netbsd-386-cgo), const TIOCSETAW ideal-int +pkg syscall (netbsd-386-cgo), const TIOCSETD ideal-int +pkg syscall (netbsd-386-cgo), const TIOCSFLAGS ideal-int +pkg syscall (netbsd-386-cgo), const TIOCSIG ideal-int +pkg syscall (netbsd-386-cgo), const TIOCSLINED ideal-int +pkg syscall (netbsd-386-cgo), const TIOCSPGRP ideal-int +pkg syscall (netbsd-386-cgo), const TIOCSQSIZE ideal-int +pkg syscall (netbsd-386-cgo), const TIOCSSIZE ideal-int +pkg syscall (netbsd-386-cgo), const TIOCSTART ideal-int +pkg syscall (netbsd-386-cgo), const TIOCSTAT ideal-int +pkg syscall (netbsd-386-cgo), const TIOCSTI ideal-int +pkg syscall (netbsd-386-cgo), const TIOCSTOP ideal-int +pkg syscall (netbsd-386-cgo), const TIOCSWINSZ ideal-int +pkg syscall (netbsd-386-cgo), const TIOCUCNTL ideal-int +pkg syscall (netbsd-386-cgo), const TIOCXMTFRAME ideal-int +pkg syscall (netbsd-386-cgo), const TOSTOP ideal-int +pkg syscall (netbsd-386-cgo), const VDISCARD ideal-int +pkg syscall (netbsd-386-cgo), const VDSUSP ideal-int +pkg syscall (netbsd-386-cgo), const VEOF ideal-int +pkg syscall (netbsd-386-cgo), const VEOL ideal-int +pkg syscall (netbsd-386-cgo), const VEOL2 ideal-int +pkg syscall (netbsd-386-cgo), const VERASE ideal-int +pkg syscall (netbsd-386-cgo), const VINTR ideal-int +pkg syscall (netbsd-386-cgo), const VKILL ideal-int +pkg syscall (netbsd-386-cgo), const VLNEXT ideal-int +pkg syscall (netbsd-386-cgo), const VMIN ideal-int +pkg syscall (netbsd-386-cgo), const VQUIT ideal-int +pkg syscall (netbsd-386-cgo), const VREPRINT ideal-int +pkg syscall (netbsd-386-cgo), const VSTART ideal-int +pkg syscall (netbsd-386-cgo), const VSTATUS ideal-int +pkg syscall (netbsd-386-cgo), const VSTOP ideal-int +pkg syscall (netbsd-386-cgo), const VSUSP ideal-int +pkg syscall (netbsd-386-cgo), const VTIME ideal-int +pkg syscall (netbsd-386-cgo), const VWERASE ideal-int +pkg syscall (netbsd-386-cgo), const WALL ideal-int +pkg syscall (netbsd-386-cgo), const WALLSIG ideal-int +pkg syscall (netbsd-386-cgo), const WALTSIG ideal-int +pkg syscall (netbsd-386-cgo), const WCLONE ideal-int +pkg syscall (netbsd-386-cgo), const WCOREFLAG ideal-int +pkg syscall (netbsd-386-cgo), const WNOHANG ideal-int +pkg syscall (netbsd-386-cgo), const WNOWAIT ideal-int +pkg syscall (netbsd-386-cgo), const WNOZOMBIE ideal-int +pkg syscall (netbsd-386-cgo), const WOPTSCHECKED ideal-int +pkg syscall (netbsd-386-cgo), const WSTOPPED ideal-int +pkg syscall (netbsd-386-cgo), const WUNTRACED ideal-int +pkg syscall (netbsd-386-cgo), func Accept(int) (int, Sockaddr, error) +pkg syscall (netbsd-386-cgo), func Access(string, uint32) error +pkg syscall (netbsd-386-cgo), func Adjtime(*Timeval, *Timeval) error +pkg syscall (netbsd-386-cgo), func Bind(int, Sockaddr) error +pkg syscall (netbsd-386-cgo), func BpfBuflen(int) (int, error) +pkg syscall (netbsd-386-cgo), func BpfDatalink(int) (int, error) +pkg syscall (netbsd-386-cgo), func BpfHeadercmpl(int) (int, error) +pkg syscall (netbsd-386-cgo), func BpfInterface(int, string) (string, error) +pkg syscall (netbsd-386-cgo), func BpfJump(int, int, int, int) *BpfInsn +pkg syscall (netbsd-386-cgo), func BpfStats(int) (*BpfStat, error) +pkg syscall (netbsd-386-cgo), func BpfStmt(int, int) *BpfInsn +pkg syscall (netbsd-386-cgo), func BpfTimeout(int) (*Timeval, error) +pkg syscall (netbsd-386-cgo), func CheckBpfVersion(int) error +pkg syscall (netbsd-386-cgo), func Chflags(string, int) error +pkg syscall (netbsd-386-cgo), func Chroot(string) error +pkg syscall (netbsd-386-cgo), func Close(int) error +pkg syscall (netbsd-386-cgo), func CloseOnExec(int) +pkg syscall (netbsd-386-cgo), func CmsgLen(int) int +pkg syscall (netbsd-386-cgo), func CmsgSpace(int) int +pkg syscall (netbsd-386-cgo), func Connect(int, Sockaddr) error +pkg syscall (netbsd-386-cgo), func Dup(int) (int, error) +pkg syscall (netbsd-386-cgo), func Dup2(int, int) error +pkg syscall (netbsd-386-cgo), func Fchdir(int) error +pkg syscall (netbsd-386-cgo), func Fchflags(int, int) error +pkg syscall (netbsd-386-cgo), func Fchmod(int, uint32) error +pkg syscall (netbsd-386-cgo), func Fchown(int, int, int) error +pkg syscall (netbsd-386-cgo), func Flock(int, int) error +pkg syscall (netbsd-386-cgo), func FlushBpf(int) error +pkg syscall (netbsd-386-cgo), func ForkExec(string, []string, *ProcAttr) (int, error) +pkg syscall (netbsd-386-cgo), func Fpathconf(int, int) (int, error) +pkg syscall (netbsd-386-cgo), func Fstat(int, *Stat_t) error +pkg syscall (netbsd-386-cgo), func Fsync(int) error +pkg syscall (netbsd-386-cgo), func Ftruncate(int, int64) error +pkg syscall (netbsd-386-cgo), func Futimes(int, []Timeval) error +pkg syscall (netbsd-386-cgo), func Getdirentries(int, []uint8, *uintptr) (int, error) +pkg syscall (netbsd-386-cgo), func Getpeername(int) (Sockaddr, error) +pkg syscall (netbsd-386-cgo), func Getpgid(int) (int, error) +pkg syscall (netbsd-386-cgo), func Getpgrp() int +pkg syscall (netbsd-386-cgo), func Getpriority(int, int) (int, error) +pkg syscall (netbsd-386-cgo), func Getrlimit(int, *Rlimit) error +pkg syscall (netbsd-386-cgo), func Getrusage(int, *Rusage) error +pkg syscall (netbsd-386-cgo), func Getsid(int) (int, error) +pkg syscall (netbsd-386-cgo), func Getsockname(int) (Sockaddr, error) +pkg syscall (netbsd-386-cgo), func GetsockoptByte(int, int, int) (uint8, error) +pkg syscall (netbsd-386-cgo), func GetsockoptICMPv6Filter(int, int, int) (*ICMPv6Filter, error) +pkg syscall (netbsd-386-cgo), func GetsockoptIPMreq(int, int, int) (*IPMreq, error) +pkg syscall (netbsd-386-cgo), func GetsockoptIPv6MTUInfo(int, int, int) (*IPv6MTUInfo, error) +pkg syscall (netbsd-386-cgo), func GetsockoptIPv6Mreq(int, int, int) (*IPv6Mreq, error) +pkg syscall (netbsd-386-cgo), func GetsockoptInet4Addr(int, int, int) ([4]uint8, error) +pkg syscall (netbsd-386-cgo), func GetsockoptInt(int, int, int) (int, error) +pkg syscall (netbsd-386-cgo), func Issetugid() bool +pkg syscall (netbsd-386-cgo), func Kevent(int, []Kevent_t, []Kevent_t, *Timespec) (int, error) +pkg syscall (netbsd-386-cgo), func Kill(int, Signal) error +pkg syscall (netbsd-386-cgo), func Kqueue() (int, error) +pkg syscall (netbsd-386-cgo), func Listen(int, int) error +pkg syscall (netbsd-386-cgo), func Lstat(string, *Stat_t) error +pkg syscall (netbsd-386-cgo), func Mkfifo(string, uint32) error +pkg syscall (netbsd-386-cgo), func Mknod(string, uint32, int) error +pkg syscall (netbsd-386-cgo), func Mmap(int, int64, int, int, int) ([]uint8, error) +pkg syscall (netbsd-386-cgo), func Munmap([]uint8) error +pkg syscall (netbsd-386-cgo), func Nanosleep(*Timespec, *Timespec) error +pkg syscall (netbsd-386-cgo), func Open(string, int, uint32) (int, error) +pkg syscall (netbsd-386-cgo), func ParseDirent([]uint8, int, []string) (int, int, []string) +pkg syscall (netbsd-386-cgo), func ParseRoutingMessage([]uint8) ([]RoutingMessage, error) +pkg syscall (netbsd-386-cgo), func ParseRoutingSockaddr(RoutingMessage) ([]Sockaddr, error) +pkg syscall (netbsd-386-cgo), func ParseSocketControlMessage([]uint8) ([]SocketControlMessage, error) +pkg syscall (netbsd-386-cgo), func ParseUnixRights(*SocketControlMessage) ([]int, error) +pkg syscall (netbsd-386-cgo), func Pathconf(string, int) (int, error) +pkg syscall (netbsd-386-cgo), func Pipe([]int) error +pkg syscall (netbsd-386-cgo), func Pread(int, []uint8, int64) (int, error) +pkg syscall (netbsd-386-cgo), func Pwrite(int, []uint8, int64) (int, error) +pkg syscall (netbsd-386-cgo), func RawSyscall(uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno) +pkg syscall (netbsd-386-cgo), func RawSyscall6(uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno) +pkg syscall (netbsd-386-cgo), func Read(int, []uint8) (int, error) +pkg syscall (netbsd-386-cgo), func ReadDirent(int, []uint8) (int, error) +pkg syscall (netbsd-386-cgo), func Recvfrom(int, []uint8, int) (int, Sockaddr, error) +pkg syscall (netbsd-386-cgo), func Recvmsg(int, []uint8, []uint8, int) (int, int, int, Sockaddr, error) +pkg syscall (netbsd-386-cgo), func Revoke(string) error +pkg syscall (netbsd-386-cgo), func RouteRIB(int, int) ([]uint8, error) +pkg syscall (netbsd-386-cgo), func Seek(int, int64, int) (int64, error) +pkg syscall (netbsd-386-cgo), func Select(int, *FdSet, *FdSet, *FdSet, *Timeval) error +pkg syscall (netbsd-386-cgo), func Sendfile(int, int, *int64, int) (int, error) +pkg syscall (netbsd-386-cgo), func Sendmsg(int, []uint8, []uint8, Sockaddr, int) error +pkg syscall (netbsd-386-cgo), func Sendto(int, []uint8, int, Sockaddr) error +pkg syscall (netbsd-386-cgo), func SetBpf(int, []BpfInsn) error +pkg syscall (netbsd-386-cgo), func SetBpfBuflen(int, int) (int, error) +pkg syscall (netbsd-386-cgo), func SetBpfDatalink(int, int) (int, error) +pkg syscall (netbsd-386-cgo), func SetBpfHeadercmpl(int, int) error +pkg syscall (netbsd-386-cgo), func SetBpfImmediate(int, int) error +pkg syscall (netbsd-386-cgo), func SetBpfInterface(int, string) error +pkg syscall (netbsd-386-cgo), func SetBpfPromisc(int, int) error +pkg syscall (netbsd-386-cgo), func SetBpfTimeout(int, *Timeval) error +pkg syscall (netbsd-386-cgo), func SetKevent(*Kevent_t, int, int, int) +pkg syscall (netbsd-386-cgo), func SetNonblock(int, bool) error +pkg syscall (netbsd-386-cgo), func Setegid(int) error +pkg syscall (netbsd-386-cgo), func Seteuid(int) error +pkg syscall (netbsd-386-cgo), func Setgid(int) error +pkg syscall (netbsd-386-cgo), func Setgroups([]int) error +pkg syscall (netbsd-386-cgo), func Setpgid(int, int) error +pkg syscall (netbsd-386-cgo), func Setpriority(int, int, int) error +pkg syscall (netbsd-386-cgo), func Setregid(int, int) error +pkg syscall (netbsd-386-cgo), func Setreuid(int, int) error +pkg syscall (netbsd-386-cgo), func Setrlimit(int, *Rlimit) error +pkg syscall (netbsd-386-cgo), func Setsid() (int, error) +pkg syscall (netbsd-386-cgo), func SetsockoptByte(int, int, int, uint8) error +pkg syscall (netbsd-386-cgo), func SetsockoptICMPv6Filter(int, int, int, *ICMPv6Filter) error +pkg syscall (netbsd-386-cgo), func SetsockoptIPMreq(int, int, int, *IPMreq) error +pkg syscall (netbsd-386-cgo), func SetsockoptIPv6Mreq(int, int, int, *IPv6Mreq) error +pkg syscall (netbsd-386-cgo), func SetsockoptInet4Addr(int, int, int, [4]uint8) error +pkg syscall (netbsd-386-cgo), func SetsockoptInt(int, int, int, int) error +pkg syscall (netbsd-386-cgo), func SetsockoptLinger(int, int, int, *Linger) error +pkg syscall (netbsd-386-cgo), func SetsockoptString(int, int, int, string) error +pkg syscall (netbsd-386-cgo), func SetsockoptTimeval(int, int, int, *Timeval) error +pkg syscall (netbsd-386-cgo), func Settimeofday(*Timeval) error +pkg syscall (netbsd-386-cgo), func Setuid(int) error +pkg syscall (netbsd-386-cgo), func Shutdown(int, int) error +pkg syscall (netbsd-386-cgo), func SlicePtrFromStrings([]string) ([]*uint8, error) +pkg syscall (netbsd-386-cgo), func Socket(int, int, int) (int, error) +pkg syscall (netbsd-386-cgo), func Socketpair(int, int, int) ([2]int, error) +pkg syscall (netbsd-386-cgo), func Stat(string, *Stat_t) error +pkg syscall (netbsd-386-cgo), func StringSlicePtr([]string) []*uint8 +pkg syscall (netbsd-386-cgo), func Sync() error +pkg syscall (netbsd-386-cgo), func Syscall(uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno) +pkg syscall (netbsd-386-cgo), func Syscall6(uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno) +pkg syscall (netbsd-386-cgo), func Syscall9(uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno) +pkg syscall (netbsd-386-cgo), func Sysctl(string) (string, error) +pkg syscall (netbsd-386-cgo), func SysctlUint32(string) (uint32, error) +pkg syscall (netbsd-386-cgo), func TimevalToNsec(Timeval) int64 +pkg syscall (netbsd-386-cgo), func Truncate(string, int64) error +pkg syscall (netbsd-386-cgo), func Umask(int) int +pkg syscall (netbsd-386-cgo), func UnixRights(...int) []uint8 +pkg syscall (netbsd-386-cgo), func Unmount(string, int) error +pkg syscall (netbsd-386-cgo), func Wait4(int, *WaitStatus, int, *Rusage) (int, error) +pkg syscall (netbsd-386-cgo), func Write(int, []uint8) (int, error) +pkg syscall (netbsd-386-cgo), method (*Cmsghdr) SetLen(int) +pkg syscall (netbsd-386-cgo), method (*Iovec) SetLen(int) +pkg syscall (netbsd-386-cgo), method (*Msghdr) SetControllen(int) +pkg syscall (netbsd-386-cgo), type BpfHdr struct +pkg syscall (netbsd-386-cgo), type BpfHdr struct, Caplen uint32 +pkg syscall (netbsd-386-cgo), type BpfHdr struct, Datalen uint32 +pkg syscall (netbsd-386-cgo), type BpfHdr struct, Hdrlen uint16 +pkg syscall (netbsd-386-cgo), type BpfHdr struct, Pad_cgo_0 [2]uint8 +pkg syscall (netbsd-386-cgo), type BpfHdr struct, Tstamp BpfTimeval +pkg syscall (netbsd-386-cgo), type BpfInsn struct +pkg syscall (netbsd-386-cgo), type BpfInsn struct, Code uint16 +pkg syscall (netbsd-386-cgo), type BpfInsn struct, Jf uint8 +pkg syscall (netbsd-386-cgo), type BpfInsn struct, Jt uint8 +pkg syscall (netbsd-386-cgo), type BpfInsn struct, K uint32 +pkg syscall (netbsd-386-cgo), type BpfProgram struct +pkg syscall (netbsd-386-cgo), type BpfProgram struct, Insns *BpfInsn +pkg syscall (netbsd-386-cgo), type BpfProgram struct, Len uint32 +pkg syscall (netbsd-386-cgo), type BpfStat struct +pkg syscall (netbsd-386-cgo), type BpfStat struct, Capt uint64 +pkg syscall (netbsd-386-cgo), type BpfStat struct, Drop uint64 +pkg syscall (netbsd-386-cgo), type BpfStat struct, Padding [13]uint64 +pkg syscall (netbsd-386-cgo), type BpfStat struct, Recv uint64 +pkg syscall (netbsd-386-cgo), type BpfTimeval struct +pkg syscall (netbsd-386-cgo), type BpfTimeval struct, Sec int32 +pkg syscall (netbsd-386-cgo), type BpfTimeval struct, Usec int32 +pkg syscall (netbsd-386-cgo), type BpfVersion struct +pkg syscall (netbsd-386-cgo), type BpfVersion struct, Major uint16 +pkg syscall (netbsd-386-cgo), type BpfVersion struct, Minor uint16 +pkg syscall (netbsd-386-cgo), type Cmsghdr struct +pkg syscall (netbsd-386-cgo), type Cmsghdr struct, Len uint32 +pkg syscall (netbsd-386-cgo), type Cmsghdr struct, Level int32 +pkg syscall (netbsd-386-cgo), type Cmsghdr struct, Type int32 +pkg syscall (netbsd-386-cgo), type Credential struct +pkg syscall (netbsd-386-cgo), type Credential struct, Gid uint32 +pkg syscall (netbsd-386-cgo), type Credential struct, Groups []uint32 +pkg syscall (netbsd-386-cgo), type Credential struct, Uid uint32 +pkg syscall (netbsd-386-cgo), type Dirent struct +pkg syscall (netbsd-386-cgo), type Dirent struct, Fileno uint64 +pkg syscall (netbsd-386-cgo), type Dirent struct, Name [512]int8 +pkg syscall (netbsd-386-cgo), type Dirent struct, Namlen uint16 +pkg syscall (netbsd-386-cgo), type Dirent struct, Pad_cgo_0 [3]uint8 +pkg syscall (netbsd-386-cgo), type Dirent struct, Reclen uint16 +pkg syscall (netbsd-386-cgo), type Dirent struct, Type uint8 +pkg syscall (netbsd-386-cgo), type FdSet struct +pkg syscall (netbsd-386-cgo), type FdSet struct, Bits [8]uint32 +pkg syscall (netbsd-386-cgo), type Flock_t struct +pkg syscall (netbsd-386-cgo), type Flock_t struct, Len int64 +pkg syscall (netbsd-386-cgo), type Flock_t struct, Pid int32 +pkg syscall (netbsd-386-cgo), type Flock_t struct, Start int64 +pkg syscall (netbsd-386-cgo), type Flock_t struct, Type int16 +pkg syscall (netbsd-386-cgo), type Flock_t struct, Whence int16 +pkg syscall (netbsd-386-cgo), type Fsid struct +pkg syscall (netbsd-386-cgo), type Fsid struct, X__fsid_val [2]int32 +pkg syscall (netbsd-386-cgo), type ICMPv6Filter struct +pkg syscall (netbsd-386-cgo), type ICMPv6Filter struct, Filt [8]uint32 +pkg syscall (netbsd-386-cgo), type IPv6MTUInfo struct +pkg syscall (netbsd-386-cgo), type IPv6MTUInfo struct, Addr RawSockaddrInet6 +pkg syscall (netbsd-386-cgo), type IPv6MTUInfo struct, Mtu uint32 +pkg syscall (netbsd-386-cgo), type IfAnnounceMsghdr struct +pkg syscall (netbsd-386-cgo), type IfAnnounceMsghdr struct, Index uint16 +pkg syscall (netbsd-386-cgo), type IfAnnounceMsghdr struct, Msglen uint16 +pkg syscall (netbsd-386-cgo), type IfAnnounceMsghdr struct, Name [16]int8 +pkg syscall (netbsd-386-cgo), type IfAnnounceMsghdr struct, Type uint8 +pkg syscall (netbsd-386-cgo), type IfAnnounceMsghdr struct, Version uint8 +pkg syscall (netbsd-386-cgo), type IfAnnounceMsghdr struct, What uint16 +pkg syscall (netbsd-386-cgo), type IfData struct +pkg syscall (netbsd-386-cgo), type IfData struct, Addrlen uint8 +pkg syscall (netbsd-386-cgo), type IfData struct, Baudrate uint64 +pkg syscall (netbsd-386-cgo), type IfData struct, Collisions uint64 +pkg syscall (netbsd-386-cgo), type IfData struct, Hdrlen uint8 +pkg syscall (netbsd-386-cgo), type IfData struct, Ibytes uint64 +pkg syscall (netbsd-386-cgo), type IfData struct, Ierrors uint64 +pkg syscall (netbsd-386-cgo), type IfData struct, Imcasts uint64 +pkg syscall (netbsd-386-cgo), type IfData struct, Ipackets uint64 +pkg syscall (netbsd-386-cgo), type IfData struct, Iqdrops uint64 +pkg syscall (netbsd-386-cgo), type IfData struct, Lastchange Timespec +pkg syscall (netbsd-386-cgo), type IfData struct, Link_state int32 +pkg syscall (netbsd-386-cgo), type IfData struct, Metric uint64 +pkg syscall (netbsd-386-cgo), type IfData struct, Mtu uint64 +pkg syscall (netbsd-386-cgo), type IfData struct, Noproto uint64 +pkg syscall (netbsd-386-cgo), type IfData struct, Obytes uint64 +pkg syscall (netbsd-386-cgo), type IfData struct, Oerrors uint64 +pkg syscall (netbsd-386-cgo), type IfData struct, Omcasts uint64 +pkg syscall (netbsd-386-cgo), type IfData struct, Opackets uint64 +pkg syscall (netbsd-386-cgo), type IfData struct, Pad_cgo_0 [1]uint8 +pkg syscall (netbsd-386-cgo), type IfData struct, Type uint8 +pkg syscall (netbsd-386-cgo), type IfMsghdr struct +pkg syscall (netbsd-386-cgo), type IfMsghdr struct, Addrs int32 +pkg syscall (netbsd-386-cgo), type IfMsghdr struct, Data IfData +pkg syscall (netbsd-386-cgo), type IfMsghdr struct, Flags int32 +pkg syscall (netbsd-386-cgo), type IfMsghdr struct, Index uint16 +pkg syscall (netbsd-386-cgo), type IfMsghdr struct, Msglen uint16 +pkg syscall (netbsd-386-cgo), type IfMsghdr struct, Pad_cgo_0 [2]uint8 +pkg syscall (netbsd-386-cgo), type IfMsghdr struct, Pad_cgo_1 [4]uint8 +pkg syscall (netbsd-386-cgo), type IfMsghdr struct, Type uint8 +pkg syscall (netbsd-386-cgo), type IfMsghdr struct, Version uint8 +pkg syscall (netbsd-386-cgo), type IfaMsghdr struct +pkg syscall (netbsd-386-cgo), type IfaMsghdr struct, Addrs int32 +pkg syscall (netbsd-386-cgo), type IfaMsghdr struct, Flags int32 +pkg syscall (netbsd-386-cgo), type IfaMsghdr struct, Index uint16 +pkg syscall (netbsd-386-cgo), type IfaMsghdr struct, Metric int32 +pkg syscall (netbsd-386-cgo), type IfaMsghdr struct, Msglen uint16 +pkg syscall (netbsd-386-cgo), type IfaMsghdr struct, Pad_cgo_0 [6]uint8 +pkg syscall (netbsd-386-cgo), type IfaMsghdr struct, Type uint8 +pkg syscall (netbsd-386-cgo), type IfaMsghdr struct, Version uint8 +pkg syscall (netbsd-386-cgo), type Inet6Pktinfo struct +pkg syscall (netbsd-386-cgo), type Inet6Pktinfo struct, Addr [16]uint8 +pkg syscall (netbsd-386-cgo), type Inet6Pktinfo struct, Ifindex uint32 +pkg syscall (netbsd-386-cgo), type InterfaceAddrMessage struct +pkg syscall (netbsd-386-cgo), type InterfaceAddrMessage struct, Data []uint8 +pkg syscall (netbsd-386-cgo), type InterfaceAddrMessage struct, Header IfaMsghdr +pkg syscall (netbsd-386-cgo), type InterfaceAnnounceMessage struct +pkg syscall (netbsd-386-cgo), type InterfaceAnnounceMessage struct, Header IfAnnounceMsghdr +pkg syscall (netbsd-386-cgo), type InterfaceMessage struct +pkg syscall (netbsd-386-cgo), type InterfaceMessage struct, Data []uint8 +pkg syscall (netbsd-386-cgo), type InterfaceMessage struct, Header IfMsghdr +pkg syscall (netbsd-386-cgo), type Iovec struct +pkg syscall (netbsd-386-cgo), type Iovec struct, Base *uint8 +pkg syscall (netbsd-386-cgo), type Iovec struct, Len uint32 +pkg syscall (netbsd-386-cgo), type Kevent_t struct +pkg syscall (netbsd-386-cgo), type Kevent_t struct, Data int64 +pkg syscall (netbsd-386-cgo), type Kevent_t struct, Fflags uint32 +pkg syscall (netbsd-386-cgo), type Kevent_t struct, Filter uint32 +pkg syscall (netbsd-386-cgo), type Kevent_t struct, Flags uint32 +pkg syscall (netbsd-386-cgo), type Kevent_t struct, Ident uint32 +pkg syscall (netbsd-386-cgo), type Kevent_t struct, Udata int32 +pkg syscall (netbsd-386-cgo), type Mclpool [0]uint8 +pkg syscall (netbsd-386-cgo), type Msghdr struct +pkg syscall (netbsd-386-cgo), type Msghdr struct, Control *uint8 +pkg syscall (netbsd-386-cgo), type Msghdr struct, Controllen uint32 +pkg syscall (netbsd-386-cgo), type Msghdr struct, Flags int32 +pkg syscall (netbsd-386-cgo), type Msghdr struct, Iov *Iovec +pkg syscall (netbsd-386-cgo), type Msghdr struct, Iovlen int32 +pkg syscall (netbsd-386-cgo), type Msghdr struct, Name *uint8 +pkg syscall (netbsd-386-cgo), type Msghdr struct, Namelen uint32 +pkg syscall (netbsd-386-cgo), type RawSockaddr struct, Data [14]int8 +pkg syscall (netbsd-386-cgo), type RawSockaddr struct, Family uint8 +pkg syscall (netbsd-386-cgo), type RawSockaddr struct, Len uint8 +pkg syscall (netbsd-386-cgo), type RawSockaddrAny struct, Pad [92]int8 +pkg syscall (netbsd-386-cgo), type RawSockaddrDatalink struct +pkg syscall (netbsd-386-cgo), type RawSockaddrDatalink struct, Alen uint8 +pkg syscall (netbsd-386-cgo), type RawSockaddrDatalink struct, Data [12]int8 +pkg syscall (netbsd-386-cgo), type RawSockaddrDatalink struct, Family uint8 +pkg syscall (netbsd-386-cgo), type RawSockaddrDatalink struct, Index uint16 +pkg syscall (netbsd-386-cgo), type RawSockaddrDatalink struct, Len uint8 +pkg syscall (netbsd-386-cgo), type RawSockaddrDatalink struct, Nlen uint8 +pkg syscall (netbsd-386-cgo), type RawSockaddrDatalink struct, Slen uint8 +pkg syscall (netbsd-386-cgo), type RawSockaddrDatalink struct, Type uint8 +pkg syscall (netbsd-386-cgo), type RawSockaddrInet4 struct, Family uint8 +pkg syscall (netbsd-386-cgo), type RawSockaddrInet4 struct, Len uint8 +pkg syscall (netbsd-386-cgo), type RawSockaddrInet4 struct, Zero [8]int8 +pkg syscall (netbsd-386-cgo), type RawSockaddrInet6 struct, Family uint8 +pkg syscall (netbsd-386-cgo), type RawSockaddrInet6 struct, Len uint8 +pkg syscall (netbsd-386-cgo), type RawSockaddrUnix struct +pkg syscall (netbsd-386-cgo), type RawSockaddrUnix struct, Family uint8 +pkg syscall (netbsd-386-cgo), type RawSockaddrUnix struct, Len uint8 +pkg syscall (netbsd-386-cgo), type RawSockaddrUnix struct, Path [104]int8 +pkg syscall (netbsd-386-cgo), type Rlimit struct +pkg syscall (netbsd-386-cgo), type Rlimit struct, Cur uint64 +pkg syscall (netbsd-386-cgo), type Rlimit struct, Max uint64 +pkg syscall (netbsd-386-cgo), type RouteMessage struct +pkg syscall (netbsd-386-cgo), type RouteMessage struct, Data []uint8 +pkg syscall (netbsd-386-cgo), type RouteMessage struct, Header RtMsghdr +pkg syscall (netbsd-386-cgo), type RoutingMessage interface, unexported methods +pkg syscall (netbsd-386-cgo), type RtMetrics struct +pkg syscall (netbsd-386-cgo), type RtMetrics struct, Expire int64 +pkg syscall (netbsd-386-cgo), type RtMetrics struct, Hopcount uint64 +pkg syscall (netbsd-386-cgo), type RtMetrics struct, Locks uint64 +pkg syscall (netbsd-386-cgo), type RtMetrics struct, Mtu uint64 +pkg syscall (netbsd-386-cgo), type RtMetrics struct, Pksent int64 +pkg syscall (netbsd-386-cgo), type RtMetrics struct, Recvpipe uint64 +pkg syscall (netbsd-386-cgo), type RtMetrics struct, Rtt uint64 +pkg syscall (netbsd-386-cgo), type RtMetrics struct, Rttvar uint64 +pkg syscall (netbsd-386-cgo), type RtMetrics struct, Sendpipe uint64 +pkg syscall (netbsd-386-cgo), type RtMetrics struct, Ssthresh uint64 +pkg syscall (netbsd-386-cgo), type RtMsghdr struct +pkg syscall (netbsd-386-cgo), type RtMsghdr struct, Addrs int32 +pkg syscall (netbsd-386-cgo), type RtMsghdr struct, Errno int32 +pkg syscall (netbsd-386-cgo), type RtMsghdr struct, Flags int32 +pkg syscall (netbsd-386-cgo), type RtMsghdr struct, Index uint16 +pkg syscall (netbsd-386-cgo), type RtMsghdr struct, Inits int32 +pkg syscall (netbsd-386-cgo), type RtMsghdr struct, Msglen uint16 +pkg syscall (netbsd-386-cgo), type RtMsghdr struct, Pad_cgo_0 [2]uint8 +pkg syscall (netbsd-386-cgo), type RtMsghdr struct, Pad_cgo_1 [4]uint8 +pkg syscall (netbsd-386-cgo), type RtMsghdr struct, Pid int32 +pkg syscall (netbsd-386-cgo), type RtMsghdr struct, Rmx RtMetrics +pkg syscall (netbsd-386-cgo), type RtMsghdr struct, Seq int32 +pkg syscall (netbsd-386-cgo), type RtMsghdr struct, Type uint8 +pkg syscall (netbsd-386-cgo), type RtMsghdr struct, Use int32 +pkg syscall (netbsd-386-cgo), type RtMsghdr struct, Version uint8 +pkg syscall (netbsd-386-cgo), type Rusage struct, Idrss int32 +pkg syscall (netbsd-386-cgo), type Rusage struct, Inblock int32 +pkg syscall (netbsd-386-cgo), type Rusage struct, Isrss int32 +pkg syscall (netbsd-386-cgo), type Rusage struct, Ixrss int32 +pkg syscall (netbsd-386-cgo), type Rusage struct, Majflt int32 +pkg syscall (netbsd-386-cgo), type Rusage struct, Maxrss int32 +pkg syscall (netbsd-386-cgo), type Rusage struct, Minflt int32 +pkg syscall (netbsd-386-cgo), type Rusage struct, Msgrcv int32 +pkg syscall (netbsd-386-cgo), type Rusage struct, Msgsnd int32 +pkg syscall (netbsd-386-cgo), type Rusage struct, Nivcsw int32 +pkg syscall (netbsd-386-cgo), type Rusage struct, Nsignals int32 +pkg syscall (netbsd-386-cgo), type Rusage struct, Nswap int32 +pkg syscall (netbsd-386-cgo), type Rusage struct, Nvcsw int32 +pkg syscall (netbsd-386-cgo), type Rusage struct, Oublock int32 +pkg syscall (netbsd-386-cgo), type Rusage struct, Stime Timeval +pkg syscall (netbsd-386-cgo), type Rusage struct, Utime Timeval +pkg syscall (netbsd-386-cgo), type SockaddrDatalink struct +pkg syscall (netbsd-386-cgo), type SockaddrDatalink struct, Alen uint8 +pkg syscall (netbsd-386-cgo), type SockaddrDatalink struct, Data [12]int8 +pkg syscall (netbsd-386-cgo), type SockaddrDatalink struct, Family uint8 +pkg syscall (netbsd-386-cgo), type SockaddrDatalink struct, Index uint16 +pkg syscall (netbsd-386-cgo), type SockaddrDatalink struct, Len uint8 +pkg syscall (netbsd-386-cgo), type SockaddrDatalink struct, Nlen uint8 +pkg syscall (netbsd-386-cgo), type SockaddrDatalink struct, Slen uint8 +pkg syscall (netbsd-386-cgo), type SockaddrDatalink struct, Type uint8 +pkg syscall (netbsd-386-cgo), type SocketControlMessage struct +pkg syscall (netbsd-386-cgo), type SocketControlMessage struct, Data []uint8 +pkg syscall (netbsd-386-cgo), type SocketControlMessage struct, Header Cmsghdr +pkg syscall (netbsd-386-cgo), type Stat_t struct +pkg syscall (netbsd-386-cgo), type Stat_t struct, Atimespec Timespec +pkg syscall (netbsd-386-cgo), type Stat_t struct, Birthtimespec Timespec +pkg syscall (netbsd-386-cgo), type Stat_t struct, Blksize uint32 +pkg syscall (netbsd-386-cgo), type Stat_t struct, Blocks int64 +pkg syscall (netbsd-386-cgo), type Stat_t struct, Ctimespec Timespec +pkg syscall (netbsd-386-cgo), type Stat_t struct, Dev uint64 +pkg syscall (netbsd-386-cgo), type Stat_t struct, Flags uint32 +pkg syscall (netbsd-386-cgo), type Stat_t struct, Gen uint32 +pkg syscall (netbsd-386-cgo), type Stat_t struct, Gid uint32 +pkg syscall (netbsd-386-cgo), type Stat_t struct, Ino uint64 +pkg syscall (netbsd-386-cgo), type Stat_t struct, Mode uint32 +pkg syscall (netbsd-386-cgo), type Stat_t struct, Mtimespec Timespec +pkg syscall (netbsd-386-cgo), type Stat_t struct, Nlink uint32 +pkg syscall (netbsd-386-cgo), type Stat_t struct, Rdev uint64 +pkg syscall (netbsd-386-cgo), type Stat_t struct, Size int64 +pkg syscall (netbsd-386-cgo), type Stat_t struct, Spare [2]uint32 +pkg syscall (netbsd-386-cgo), type Stat_t struct, Uid uint32 +pkg syscall (netbsd-386-cgo), type Statfs_t [0]uint8 +pkg syscall (netbsd-386-cgo), type SysProcAttr struct, Chroot string +pkg syscall (netbsd-386-cgo), type SysProcAttr struct, Credential *Credential +pkg syscall (netbsd-386-cgo), type SysProcAttr struct, Noctty bool +pkg syscall (netbsd-386-cgo), type SysProcAttr struct, Ptrace bool +pkg syscall (netbsd-386-cgo), type SysProcAttr struct, Setctty bool +pkg syscall (netbsd-386-cgo), type SysProcAttr struct, Setpgid bool +pkg syscall (netbsd-386-cgo), type SysProcAttr struct, Setsid bool +pkg syscall (netbsd-386-cgo), type Sysctlnode struct +pkg syscall (netbsd-386-cgo), type Sysctlnode struct, Flags uint32 +pkg syscall (netbsd-386-cgo), type Sysctlnode struct, Name [32]int8 +pkg syscall (netbsd-386-cgo), type Sysctlnode struct, Num int32 +pkg syscall (netbsd-386-cgo), type Sysctlnode struct, Un [16]uint8 +pkg syscall (netbsd-386-cgo), type Sysctlnode struct, Ver uint32 +pkg syscall (netbsd-386-cgo), type Sysctlnode struct, X__rsvd uint32 +pkg syscall (netbsd-386-cgo), type Sysctlnode struct, X_sysctl_desc [8]uint8 +pkg syscall (netbsd-386-cgo), type Sysctlnode struct, X_sysctl_func [8]uint8 +pkg syscall (netbsd-386-cgo), type Sysctlnode struct, X_sysctl_parent [8]uint8 +pkg syscall (netbsd-386-cgo), type Sysctlnode struct, X_sysctl_size [8]uint8 +pkg syscall (netbsd-386-cgo), type Timespec struct, Nsec int32 +pkg syscall (netbsd-386-cgo), type Timespec struct, Sec int64 +pkg syscall (netbsd-386-cgo), type Timeval struct, Sec int64 +pkg syscall (netbsd-386-cgo), type Timeval struct, Usec int32 +pkg syscall (netbsd-386-cgo), type WaitStatus uint32 +pkg syscall (netbsd-386-cgo), var Stderr int +pkg syscall (netbsd-386-cgo), var Stdin int +pkg syscall (netbsd-386-cgo), var Stdout int +pkg syscall (netbsd-amd64), const AF_APPLETALK ideal-int +pkg syscall (netbsd-amd64), const AF_ARP ideal-int +pkg syscall (netbsd-amd64), const AF_BLUETOOTH ideal-int +pkg syscall (netbsd-amd64), const AF_CCITT ideal-int +pkg syscall (netbsd-amd64), const AF_CHAOS ideal-int +pkg syscall (netbsd-amd64), const AF_CNT ideal-int +pkg syscall (netbsd-amd64), const AF_COIP ideal-int +pkg syscall (netbsd-amd64), const AF_DATAKIT ideal-int +pkg syscall (netbsd-amd64), const AF_DECnet ideal-int +pkg syscall (netbsd-amd64), const AF_DLI ideal-int +pkg syscall (netbsd-amd64), const AF_E164 ideal-int +pkg syscall (netbsd-amd64), const AF_ECMA ideal-int +pkg syscall (netbsd-amd64), const AF_HYLINK ideal-int +pkg syscall (netbsd-amd64), const AF_IEEE80211 ideal-int +pkg syscall (netbsd-amd64), const AF_IMPLINK ideal-int +pkg syscall (netbsd-amd64), const AF_IPX ideal-int +pkg syscall (netbsd-amd64), const AF_ISDN ideal-int +pkg syscall (netbsd-amd64), const AF_ISO ideal-int +pkg syscall (netbsd-amd64), const AF_LAT ideal-int +pkg syscall (netbsd-amd64), const AF_LINK ideal-int +pkg syscall (netbsd-amd64), const AF_LOCAL ideal-int +pkg syscall (netbsd-amd64), const AF_MAX ideal-int +pkg syscall (netbsd-amd64), const AF_MPLS ideal-int +pkg syscall (netbsd-amd64), const AF_NATM ideal-int +pkg syscall (netbsd-amd64), const AF_NS ideal-int +pkg syscall (netbsd-amd64), const AF_OROUTE ideal-int +pkg syscall (netbsd-amd64), const AF_OSI ideal-int +pkg syscall (netbsd-amd64), const AF_PUP ideal-int +pkg syscall (netbsd-amd64), const AF_ROUTE ideal-int +pkg syscall (netbsd-amd64), const AF_SNA ideal-int +pkg syscall (netbsd-amd64), const ARPHRD_ARCNET ideal-int +pkg syscall (netbsd-amd64), const ARPHRD_ETHER ideal-int +pkg syscall (netbsd-amd64), const ARPHRD_FRELAY ideal-int +pkg syscall (netbsd-amd64), const ARPHRD_IEEE1394 ideal-int +pkg syscall (netbsd-amd64), const ARPHRD_IEEE802 ideal-int +pkg syscall (netbsd-amd64), const ARPHRD_STRIP ideal-int +pkg syscall (netbsd-amd64), const B0 ideal-int +pkg syscall (netbsd-amd64), const B110 ideal-int +pkg syscall (netbsd-amd64), const B115200 ideal-int +pkg syscall (netbsd-amd64), const B1200 ideal-int +pkg syscall (netbsd-amd64), const B134 ideal-int +pkg syscall (netbsd-amd64), const B14400 ideal-int +pkg syscall (netbsd-amd64), const B150 ideal-int +pkg syscall (netbsd-amd64), const B1800 ideal-int +pkg syscall (netbsd-amd64), const B19200 ideal-int +pkg syscall (netbsd-amd64), const B200 ideal-int +pkg syscall (netbsd-amd64), const B230400 ideal-int +pkg syscall (netbsd-amd64), const B2400 ideal-int +pkg syscall (netbsd-amd64), const B28800 ideal-int +pkg syscall (netbsd-amd64), const B300 ideal-int +pkg syscall (netbsd-amd64), const B38400 ideal-int +pkg syscall (netbsd-amd64), const B460800 ideal-int +pkg syscall (netbsd-amd64), const B4800 ideal-int +pkg syscall (netbsd-amd64), const B50 ideal-int +pkg syscall (netbsd-amd64), const B57600 ideal-int +pkg syscall (netbsd-amd64), const B600 ideal-int +pkg syscall (netbsd-amd64), const B7200 ideal-int +pkg syscall (netbsd-amd64), const B75 ideal-int +pkg syscall (netbsd-amd64), const B76800 ideal-int +pkg syscall (netbsd-amd64), const B921600 ideal-int +pkg syscall (netbsd-amd64), const B9600 ideal-int +pkg syscall (netbsd-amd64), const BIOCFEEDBACK ideal-int +pkg syscall (netbsd-amd64), const BIOCFLUSH ideal-int +pkg syscall (netbsd-amd64), const BIOCGBLEN ideal-int +pkg syscall (netbsd-amd64), const BIOCGDLT ideal-int +pkg syscall (netbsd-amd64), const BIOCGDLTLIST ideal-int +pkg syscall (netbsd-amd64), const BIOCGETIF ideal-int +pkg syscall (netbsd-amd64), const BIOCGFEEDBACK ideal-int +pkg syscall (netbsd-amd64), const BIOCGHDRCMPLT ideal-int +pkg syscall (netbsd-amd64), const BIOCGRTIMEOUT ideal-int +pkg syscall (netbsd-amd64), const BIOCGSEESENT ideal-int +pkg syscall (netbsd-amd64), const BIOCGSTATS ideal-int +pkg syscall (netbsd-amd64), const BIOCGSTATSOLD ideal-int +pkg syscall (netbsd-amd64), const BIOCIMMEDIATE ideal-int +pkg syscall (netbsd-amd64), const BIOCPROMISC ideal-int +pkg syscall (netbsd-amd64), const BIOCSBLEN ideal-int +pkg syscall (netbsd-amd64), const BIOCSDLT ideal-int +pkg syscall (netbsd-amd64), const BIOCSETF ideal-int +pkg syscall (netbsd-amd64), const BIOCSETIF ideal-int +pkg syscall (netbsd-amd64), const BIOCSFEEDBACK ideal-int +pkg syscall (netbsd-amd64), const BIOCSHDRCMPLT ideal-int +pkg syscall (netbsd-amd64), const BIOCSRTIMEOUT ideal-int +pkg syscall (netbsd-amd64), const BIOCSSEESENT ideal-int +pkg syscall (netbsd-amd64), const BIOCSTCPF ideal-int +pkg syscall (netbsd-amd64), const BIOCSUDPF ideal-int +pkg syscall (netbsd-amd64), const BIOCVERSION ideal-int +pkg syscall (netbsd-amd64), const BPF_A ideal-int +pkg syscall (netbsd-amd64), const BPF_ABS ideal-int +pkg syscall (netbsd-amd64), const BPF_ADD ideal-int +pkg syscall (netbsd-amd64), const BPF_ALIGNMENT ideal-int +pkg syscall (netbsd-amd64), const BPF_ALIGNMENT32 ideal-int +pkg syscall (netbsd-amd64), const BPF_ALU ideal-int +pkg syscall (netbsd-amd64), const BPF_AND ideal-int +pkg syscall (netbsd-amd64), const BPF_B ideal-int +pkg syscall (netbsd-amd64), const BPF_DFLTBUFSIZE ideal-int +pkg syscall (netbsd-amd64), const BPF_DIV ideal-int +pkg syscall (netbsd-amd64), const BPF_H ideal-int +pkg syscall (netbsd-amd64), const BPF_IMM ideal-int +pkg syscall (netbsd-amd64), const BPF_IND ideal-int +pkg syscall (netbsd-amd64), const BPF_JA ideal-int +pkg syscall (netbsd-amd64), const BPF_JEQ ideal-int +pkg syscall (netbsd-amd64), const BPF_JGE ideal-int +pkg syscall (netbsd-amd64), const BPF_JGT ideal-int +pkg syscall (netbsd-amd64), const BPF_JMP ideal-int +pkg syscall (netbsd-amd64), const BPF_JSET ideal-int +pkg syscall (netbsd-amd64), const BPF_K ideal-int +pkg syscall (netbsd-amd64), const BPF_LD ideal-int +pkg syscall (netbsd-amd64), const BPF_LDX ideal-int +pkg syscall (netbsd-amd64), const BPF_LEN ideal-int +pkg syscall (netbsd-amd64), const BPF_LSH ideal-int +pkg syscall (netbsd-amd64), const BPF_MAJOR_VERSION ideal-int +pkg syscall (netbsd-amd64), const BPF_MAXBUFSIZE ideal-int +pkg syscall (netbsd-amd64), const BPF_MAXINSNS ideal-int +pkg syscall (netbsd-amd64), const BPF_MEM ideal-int +pkg syscall (netbsd-amd64), const BPF_MEMWORDS ideal-int +pkg syscall (netbsd-amd64), const BPF_MINBUFSIZE ideal-int +pkg syscall (netbsd-amd64), const BPF_MINOR_VERSION ideal-int +pkg syscall (netbsd-amd64), const BPF_MISC ideal-int +pkg syscall (netbsd-amd64), const BPF_MSH ideal-int +pkg syscall (netbsd-amd64), const BPF_MUL ideal-int +pkg syscall (netbsd-amd64), const BPF_NEG ideal-int +pkg syscall (netbsd-amd64), const BPF_OR ideal-int +pkg syscall (netbsd-amd64), const BPF_RELEASE ideal-int +pkg syscall (netbsd-amd64), const BPF_RET ideal-int +pkg syscall (netbsd-amd64), const BPF_RSH ideal-int +pkg syscall (netbsd-amd64), const BPF_ST ideal-int +pkg syscall (netbsd-amd64), const BPF_STX ideal-int +pkg syscall (netbsd-amd64), const BPF_SUB ideal-int +pkg syscall (netbsd-amd64), const BPF_TAX ideal-int +pkg syscall (netbsd-amd64), const BPF_TXA ideal-int +pkg syscall (netbsd-amd64), const BPF_W ideal-int +pkg syscall (netbsd-amd64), const BPF_X ideal-int +pkg syscall (netbsd-amd64), const BRKINT ideal-int +pkg syscall (netbsd-amd64), const CFLUSH ideal-int +pkg syscall (netbsd-amd64), const CLOCAL ideal-int +pkg syscall (netbsd-amd64), const CREAD ideal-int +pkg syscall (netbsd-amd64), const CS5 ideal-int +pkg syscall (netbsd-amd64), const CS6 ideal-int +pkg syscall (netbsd-amd64), const CS7 ideal-int +pkg syscall (netbsd-amd64), const CS8 ideal-int +pkg syscall (netbsd-amd64), const CSIZE ideal-int +pkg syscall (netbsd-amd64), const CSTART ideal-int +pkg syscall (netbsd-amd64), const CSTATUS ideal-int +pkg syscall (netbsd-amd64), const CSTOP ideal-int +pkg syscall (netbsd-amd64), const CSTOPB ideal-int +pkg syscall (netbsd-amd64), const CSUSP ideal-int +pkg syscall (netbsd-amd64), const CTL_MAXNAME ideal-int +pkg syscall (netbsd-amd64), const CTL_NET ideal-int +pkg syscall (netbsd-amd64), const CTL_QUERY ideal-int +pkg syscall (netbsd-amd64), const DIOCBSFLUSH ideal-int +pkg syscall (netbsd-amd64), const DLT_A429 ideal-int +pkg syscall (netbsd-amd64), const DLT_A653_ICM ideal-int +pkg syscall (netbsd-amd64), const DLT_AIRONET_HEADER ideal-int +pkg syscall (netbsd-amd64), const DLT_AOS ideal-int +pkg syscall (netbsd-amd64), const DLT_APPLE_IP_OVER_IEEE1394 ideal-int +pkg syscall (netbsd-amd64), const DLT_ARCNET ideal-int +pkg syscall (netbsd-amd64), const DLT_ARCNET_LINUX ideal-int +pkg syscall (netbsd-amd64), const DLT_ATM_CLIP ideal-int +pkg syscall (netbsd-amd64), const DLT_ATM_RFC1483 ideal-int +pkg syscall (netbsd-amd64), const DLT_AURORA ideal-int +pkg syscall (netbsd-amd64), const DLT_AX25 ideal-int +pkg syscall (netbsd-amd64), const DLT_AX25_KISS ideal-int +pkg syscall (netbsd-amd64), const DLT_BACNET_MS_TP ideal-int +pkg syscall (netbsd-amd64), const DLT_BLUETOOTH_HCI_H4 ideal-int +pkg syscall (netbsd-amd64), const DLT_BLUETOOTH_HCI_H4_WITH_PHDR ideal-int +pkg syscall (netbsd-amd64), const DLT_CAN20B ideal-int +pkg syscall (netbsd-amd64), const DLT_CAN_SOCKETCAN ideal-int +pkg syscall (netbsd-amd64), const DLT_CHAOS ideal-int +pkg syscall (netbsd-amd64), const DLT_CISCO_IOS ideal-int +pkg syscall (netbsd-amd64), const DLT_C_HDLC ideal-int +pkg syscall (netbsd-amd64), const DLT_C_HDLC_WITH_DIR ideal-int +pkg syscall (netbsd-amd64), const DLT_DECT ideal-int +pkg syscall (netbsd-amd64), const DLT_DOCSIS ideal-int +pkg syscall (netbsd-amd64), const DLT_ECONET ideal-int +pkg syscall (netbsd-amd64), const DLT_EN10MB ideal-int +pkg syscall (netbsd-amd64), const DLT_EN3MB ideal-int +pkg syscall (netbsd-amd64), const DLT_ENC ideal-int +pkg syscall (netbsd-amd64), const DLT_ERF ideal-int +pkg syscall (netbsd-amd64), const DLT_ERF_ETH ideal-int +pkg syscall (netbsd-amd64), const DLT_ERF_POS ideal-int +pkg syscall (netbsd-amd64), const DLT_FC_2 ideal-int +pkg syscall (netbsd-amd64), const DLT_FC_2_WITH_FRAME_DELIMS ideal-int +pkg syscall (netbsd-amd64), const DLT_FDDI ideal-int +pkg syscall (netbsd-amd64), const DLT_FLEXRAY ideal-int +pkg syscall (netbsd-amd64), const DLT_FRELAY ideal-int +pkg syscall (netbsd-amd64), const DLT_FRELAY_WITH_DIR ideal-int +pkg syscall (netbsd-amd64), const DLT_GCOM_SERIAL ideal-int +pkg syscall (netbsd-amd64), const DLT_GCOM_T1E1 ideal-int +pkg syscall (netbsd-amd64), const DLT_GPF_F ideal-int +pkg syscall (netbsd-amd64), const DLT_GPF_T ideal-int +pkg syscall (netbsd-amd64), const DLT_GPRS_LLC ideal-int +pkg syscall (netbsd-amd64), const DLT_GSMTAP_ABIS ideal-int +pkg syscall (netbsd-amd64), const DLT_GSMTAP_UM ideal-int +pkg syscall (netbsd-amd64), const DLT_HDLC ideal-int +pkg syscall (netbsd-amd64), const DLT_HHDLC ideal-int +pkg syscall (netbsd-amd64), const DLT_HIPPI ideal-int +pkg syscall (netbsd-amd64), const DLT_IBM_SN ideal-int +pkg syscall (netbsd-amd64), const DLT_IBM_SP ideal-int +pkg syscall (netbsd-amd64), const DLT_IEEE802 ideal-int +pkg syscall (netbsd-amd64), const DLT_IEEE802_11 ideal-int +pkg syscall (netbsd-amd64), const DLT_IEEE802_11_RADIO ideal-int +pkg syscall (netbsd-amd64), const DLT_IEEE802_11_RADIO_AVS ideal-int +pkg syscall (netbsd-amd64), const DLT_IEEE802_15_4 ideal-int +pkg syscall (netbsd-amd64), const DLT_IEEE802_15_4_LINUX ideal-int +pkg syscall (netbsd-amd64), const DLT_IEEE802_15_4_NONASK_PHY ideal-int +pkg syscall (netbsd-amd64), const DLT_IEEE802_16_MAC_CPS ideal-int +pkg syscall (netbsd-amd64), const DLT_IEEE802_16_MAC_CPS_RADIO ideal-int +pkg syscall (netbsd-amd64), const DLT_IPMB ideal-int +pkg syscall (netbsd-amd64), const DLT_IPMB_LINUX ideal-int +pkg syscall (netbsd-amd64), const DLT_IPNET ideal-int +pkg syscall (netbsd-amd64), const DLT_IPV4 ideal-int +pkg syscall (netbsd-amd64), const DLT_IPV6 ideal-int +pkg syscall (netbsd-amd64), const DLT_IP_OVER_FC ideal-int +pkg syscall (netbsd-amd64), const DLT_JUNIPER_ATM1 ideal-int +pkg syscall (netbsd-amd64), const DLT_JUNIPER_ATM2 ideal-int +pkg syscall (netbsd-amd64), const DLT_JUNIPER_CHDLC ideal-int +pkg syscall (netbsd-amd64), const DLT_JUNIPER_ES ideal-int +pkg syscall (netbsd-amd64), const DLT_JUNIPER_ETHER ideal-int +pkg syscall (netbsd-amd64), const DLT_JUNIPER_FRELAY ideal-int +pkg syscall (netbsd-amd64), const DLT_JUNIPER_GGSN ideal-int +pkg syscall (netbsd-amd64), const DLT_JUNIPER_ISM ideal-int +pkg syscall (netbsd-amd64), const DLT_JUNIPER_MFR ideal-int +pkg syscall (netbsd-amd64), const DLT_JUNIPER_MLFR ideal-int +pkg syscall (netbsd-amd64), const DLT_JUNIPER_MLPPP ideal-int +pkg syscall (netbsd-amd64), const DLT_JUNIPER_MONITOR ideal-int +pkg syscall (netbsd-amd64), const DLT_JUNIPER_PIC_PEER ideal-int +pkg syscall (netbsd-amd64), const DLT_JUNIPER_PPP ideal-int +pkg syscall (netbsd-amd64), const DLT_JUNIPER_PPPOE ideal-int +pkg syscall (netbsd-amd64), const DLT_JUNIPER_PPPOE_ATM ideal-int +pkg syscall (netbsd-amd64), const DLT_JUNIPER_SERVICES ideal-int +pkg syscall (netbsd-amd64), const DLT_JUNIPER_ST ideal-int +pkg syscall (netbsd-amd64), const DLT_JUNIPER_VP ideal-int +pkg syscall (netbsd-amd64), const DLT_LAPB_WITH_DIR ideal-int +pkg syscall (netbsd-amd64), const DLT_LAPD ideal-int +pkg syscall (netbsd-amd64), const DLT_LIN ideal-int +pkg syscall (netbsd-amd64), const DLT_LINUX_EVDEV ideal-int +pkg syscall (netbsd-amd64), const DLT_LINUX_IRDA ideal-int +pkg syscall (netbsd-amd64), const DLT_LINUX_LAPD ideal-int +pkg syscall (netbsd-amd64), const DLT_LINUX_SLL ideal-int +pkg syscall (netbsd-amd64), const DLT_LOOP ideal-int +pkg syscall (netbsd-amd64), const DLT_LTALK ideal-int +pkg syscall (netbsd-amd64), const DLT_MFR ideal-int +pkg syscall (netbsd-amd64), const DLT_MOST ideal-int +pkg syscall (netbsd-amd64), const DLT_MPLS ideal-int +pkg syscall (netbsd-amd64), const DLT_MTP2 ideal-int +pkg syscall (netbsd-amd64), const DLT_MTP2_WITH_PHDR ideal-int +pkg syscall (netbsd-amd64), const DLT_MTP3 ideal-int +pkg syscall (netbsd-amd64), const DLT_NULL ideal-int +pkg syscall (netbsd-amd64), const DLT_PCI_EXP ideal-int +pkg syscall (netbsd-amd64), const DLT_PFLOG ideal-int +pkg syscall (netbsd-amd64), const DLT_PFSYNC ideal-int +pkg syscall (netbsd-amd64), const DLT_PPI ideal-int +pkg syscall (netbsd-amd64), const DLT_PPP ideal-int +pkg syscall (netbsd-amd64), const DLT_PPP_BSDOS ideal-int +pkg syscall (netbsd-amd64), const DLT_PPP_ETHER ideal-int +pkg syscall (netbsd-amd64), const DLT_PPP_PPPD ideal-int +pkg syscall (netbsd-amd64), const DLT_PPP_SERIAL ideal-int +pkg syscall (netbsd-amd64), const DLT_PPP_WITH_DIR ideal-int +pkg syscall (netbsd-amd64), const DLT_PRISM_HEADER ideal-int +pkg syscall (netbsd-amd64), const DLT_PRONET ideal-int +pkg syscall (netbsd-amd64), const DLT_RAIF1 ideal-int +pkg syscall (netbsd-amd64), const DLT_RAW ideal-int +pkg syscall (netbsd-amd64), const DLT_RAWAF_MASK ideal-int +pkg syscall (netbsd-amd64), const DLT_RIO ideal-int +pkg syscall (netbsd-amd64), const DLT_SCCP ideal-int +pkg syscall (netbsd-amd64), const DLT_SITA ideal-int +pkg syscall (netbsd-amd64), const DLT_SLIP ideal-int +pkg syscall (netbsd-amd64), const DLT_SLIP_BSDOS ideal-int +pkg syscall (netbsd-amd64), const DLT_SUNATM ideal-int +pkg syscall (netbsd-amd64), const DLT_SYMANTEC_FIREWALL ideal-int +pkg syscall (netbsd-amd64), const DLT_TZSP ideal-int +pkg syscall (netbsd-amd64), const DLT_USB ideal-int +pkg syscall (netbsd-amd64), const DLT_USB_LINUX ideal-int +pkg syscall (netbsd-amd64), const DLT_USB_LINUX_MMAPPED ideal-int +pkg syscall (netbsd-amd64), const DLT_WIHART ideal-int +pkg syscall (netbsd-amd64), const DLT_X2E_SERIAL ideal-int +pkg syscall (netbsd-amd64), const DLT_X2E_XORAYA ideal-int +pkg syscall (netbsd-amd64), const DT_BLK ideal-int +pkg syscall (netbsd-amd64), const DT_CHR ideal-int +pkg syscall (netbsd-amd64), const DT_DIR ideal-int +pkg syscall (netbsd-amd64), const DT_FIFO ideal-int +pkg syscall (netbsd-amd64), const DT_LNK ideal-int +pkg syscall (netbsd-amd64), const DT_REG ideal-int +pkg syscall (netbsd-amd64), const DT_SOCK ideal-int +pkg syscall (netbsd-amd64), const DT_UNKNOWN ideal-int +pkg syscall (netbsd-amd64), const DT_WHT ideal-int +pkg syscall (netbsd-amd64), const EAUTH Errno +pkg syscall (netbsd-amd64), const EBADMSG Errno +pkg syscall (netbsd-amd64), const EBADRPC Errno +pkg syscall (netbsd-amd64), const ECHO ideal-int +pkg syscall (netbsd-amd64), const ECHOCTL ideal-int +pkg syscall (netbsd-amd64), const ECHOE ideal-int +pkg syscall (netbsd-amd64), const ECHOK ideal-int +pkg syscall (netbsd-amd64), const ECHOKE ideal-int +pkg syscall (netbsd-amd64), const ECHONL ideal-int +pkg syscall (netbsd-amd64), const ECHOPRT ideal-int +pkg syscall (netbsd-amd64), const EFTYPE Errno +pkg syscall (netbsd-amd64), const ELAST Errno +pkg syscall (netbsd-amd64), const EMULTIHOP Errno +pkg syscall (netbsd-amd64), const EMUL_LINUX ideal-int +pkg syscall (netbsd-amd64), const EMUL_LINUX32 ideal-int +pkg syscall (netbsd-amd64), const EMUL_MAXID ideal-int +pkg syscall (netbsd-amd64), const ENEEDAUTH Errno +pkg syscall (netbsd-amd64), const ENOATTR Errno +pkg syscall (netbsd-amd64), const ENODATA Errno +pkg syscall (netbsd-amd64), const ENOLINK Errno +pkg syscall (netbsd-amd64), const ENOSR Errno +pkg syscall (netbsd-amd64), const ENOSTR Errno +pkg syscall (netbsd-amd64), const EPROCLIM Errno +pkg syscall (netbsd-amd64), const EPROCUNAVAIL Errno +pkg syscall (netbsd-amd64), const EPROGMISMATCH Errno +pkg syscall (netbsd-amd64), const EPROGUNAVAIL Errno +pkg syscall (netbsd-amd64), const EPROTO Errno +pkg syscall (netbsd-amd64), const ERPCMISMATCH Errno +pkg syscall (netbsd-amd64), const ETHERCAP_JUMBO_MTU ideal-int +pkg syscall (netbsd-amd64), const ETHERCAP_VLAN_HWTAGGING ideal-int +pkg syscall (netbsd-amd64), const ETHERCAP_VLAN_MTU ideal-int +pkg syscall (netbsd-amd64), const ETHERMIN ideal-int +pkg syscall (netbsd-amd64), const ETHERMTU ideal-int +pkg syscall (netbsd-amd64), const ETHERMTU_JUMBO ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_8023 ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_AARP ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_ACCTON ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_AEONIC ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_ALPHA ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_AMBER ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_AMOEBA ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_APOLLO ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_APOLLODOMAIN ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_APPLETALK ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_APPLITEK ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_ARGONAUT ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_ARP ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_AT ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_ATALK ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_ATOMIC ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_ATT ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_ATTSTANFORD ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_AUTOPHON ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_AXIS ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_BCLOOP ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_BOFL ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_CABLETRON ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_CHAOS ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_COMDESIGN ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_COMPUGRAPHIC ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_COUNTERPOINT ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_CRONUS ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_CRONUSVLN ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_DCA ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_DDE ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_DEBNI ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_DECAM ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_DECCUST ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_DECDIAG ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_DECDNS ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_DECDTS ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_DECEXPER ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_DECLAST ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_DECLTM ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_DECMUMPS ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_DECNETBIOS ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_DELTACON ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_DIDDLE ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_DLOG1 ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_DLOG2 ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_DN ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_DOGFIGHT ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_DSMD ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_ECMA ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_ENCRYPT ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_ES ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_EXCELAN ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_EXPERDATA ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_FLIP ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_FLOWCONTROL ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_FRARP ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_GENDYN ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_HAYES ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_HIPPI_FP ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_HITACHI ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_HP ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_IEEEPUP ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_IEEEPUPAT ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_IMLBL ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_IMLBLDIAG ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_IP ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_IPAS ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_IPV6 ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_IPX ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_IPXNEW ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_KALPANA ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_LANBRIDGE ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_LANPROBE ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_LAT ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_LBACK ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_LITTLE ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_LOGICRAFT ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_LOOPBACK ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_MATRA ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_MAX ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_MERIT ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_MICP ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_MOPDL ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_MOPRC ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_MOTOROLA ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_MPLS ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_MPLS_MCAST ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_MUMPS ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_NBPCC ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_NBPCLAIM ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_NBPCLREQ ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_NBPCLRSP ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_NBPCREQ ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_NBPCRSP ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_NBPDG ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_NBPDGB ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_NBPDLTE ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_NBPRAR ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_NBPRAS ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_NBPRST ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_NBPSCD ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_NBPVCD ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_NBS ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_NCD ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_NESTAR ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_NETBEUI ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_NOVELL ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_NS ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_NSAT ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_NSCOMPAT ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_NTRAILER ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_OS9 ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_OS9NET ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_PACER ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_PAE ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_PCS ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_PLANNING ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_PPP ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_PPPOE ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_PPPOEDISC ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_PRIMENTS ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_PUP ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_PUPAT ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_RACAL ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_RATIONAL ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_RAWFR ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_RCL ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_RDP ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_RETIX ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_REVARP ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_SCA ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_SECTRA ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_SECUREDATA ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_SGITW ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_SG_BOUNCE ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_SG_DIAG ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_SG_NETGAMES ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_SG_RESV ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_SIMNET ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_SLOWPROTOCOLS ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_SNA ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_SNMP ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_SONIX ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_SPIDER ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_SPRITE ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_STP ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_TALARIS ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_TALARISMC ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_TCPCOMP ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_TCPSM ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_TEC ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_TIGAN ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_TRAIL ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_TRANSETHER ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_TYMSHARE ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_UBBST ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_UBDEBUG ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_UBDIAGLOOP ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_UBDL ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_UBNIU ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_UBNMC ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_VALID ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_VARIAN ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_VAXELN ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_VEECO ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_VEXP ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_VGLAB ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_VINES ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_VINESECHO ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_VINESLOOP ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_VITAL ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_VLAN ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_VLTLMAN ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_VPROD ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_VURESERVED ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_WATERLOO ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_WELLFLEET ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_X25 ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_X75 ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_XNSSM ideal-int +pkg syscall (netbsd-amd64), const ETHERTYPE_XTP ideal-int +pkg syscall (netbsd-amd64), const ETHER_ADDR_LEN ideal-int +pkg syscall (netbsd-amd64), const ETHER_CRC_LEN ideal-int +pkg syscall (netbsd-amd64), const ETHER_CRC_POLY_BE ideal-int +pkg syscall (netbsd-amd64), const ETHER_CRC_POLY_LE ideal-int +pkg syscall (netbsd-amd64), const ETHER_HDR_LEN ideal-int +pkg syscall (netbsd-amd64), const ETHER_MAX_LEN ideal-int +pkg syscall (netbsd-amd64), const ETHER_MAX_LEN_JUMBO ideal-int +pkg syscall (netbsd-amd64), const ETHER_MIN_LEN ideal-int +pkg syscall (netbsd-amd64), const ETHER_PPPOE_ENCAP_LEN ideal-int +pkg syscall (netbsd-amd64), const ETHER_TYPE_LEN ideal-int +pkg syscall (netbsd-amd64), const ETHER_VLAN_ENCAP_LEN ideal-int +pkg syscall (netbsd-amd64), const ETIME Errno +pkg syscall (netbsd-amd64), const EVFILT_AIO ideal-int +pkg syscall (netbsd-amd64), const EVFILT_PROC ideal-int +pkg syscall (netbsd-amd64), const EVFILT_READ ideal-int +pkg syscall (netbsd-amd64), const EVFILT_SIGNAL ideal-int +pkg syscall (netbsd-amd64), const EVFILT_SYSCOUNT ideal-int +pkg syscall (netbsd-amd64), const EVFILT_TIMER ideal-int +pkg syscall (netbsd-amd64), const EVFILT_VNODE ideal-int +pkg syscall (netbsd-amd64), const EVFILT_WRITE ideal-int +pkg syscall (netbsd-amd64), const EV_ADD ideal-int +pkg syscall (netbsd-amd64), const EV_CLEAR ideal-int +pkg syscall (netbsd-amd64), const EV_DELETE ideal-int +pkg syscall (netbsd-amd64), const EV_DISABLE ideal-int +pkg syscall (netbsd-amd64), const EV_ENABLE ideal-int +pkg syscall (netbsd-amd64), const EV_EOF ideal-int +pkg syscall (netbsd-amd64), const EV_ERROR ideal-int +pkg syscall (netbsd-amd64), const EV_FLAG1 ideal-int +pkg syscall (netbsd-amd64), const EV_ONESHOT ideal-int +pkg syscall (netbsd-amd64), const EV_SYSFLAGS ideal-int +pkg syscall (netbsd-amd64), const EXTA ideal-int +pkg syscall (netbsd-amd64), const EXTB ideal-int +pkg syscall (netbsd-amd64), const EXTPROC ideal-int +pkg syscall (netbsd-amd64), const FD_CLOEXEC ideal-int +pkg syscall (netbsd-amd64), const FD_SETSIZE ideal-int +pkg syscall (netbsd-amd64), const FLUSHO ideal-int +pkg syscall (netbsd-amd64), const F_CLOSEM ideal-int +pkg syscall (netbsd-amd64), const F_DUPFD ideal-int +pkg syscall (netbsd-amd64), const F_DUPFD_CLOEXEC ideal-int +pkg syscall (netbsd-amd64), const F_FSCTL ideal-int +pkg syscall (netbsd-amd64), const F_FSDIRMASK ideal-int +pkg syscall (netbsd-amd64), const F_FSIN ideal-int +pkg syscall (netbsd-amd64), const F_FSINOUT ideal-int +pkg syscall (netbsd-amd64), const F_FSOUT ideal-int +pkg syscall (netbsd-amd64), const F_FSPRIV ideal-int +pkg syscall (netbsd-amd64), const F_FSVOID ideal-int +pkg syscall (netbsd-amd64), const F_GETFD ideal-int +pkg syscall (netbsd-amd64), const F_GETFL ideal-int +pkg syscall (netbsd-amd64), const F_GETLK ideal-int +pkg syscall (netbsd-amd64), const F_GETNOSIGPIPE ideal-int +pkg syscall (netbsd-amd64), const F_GETOWN ideal-int +pkg syscall (netbsd-amd64), const F_MAXFD ideal-int +pkg syscall (netbsd-amd64), const F_OK ideal-int +pkg syscall (netbsd-amd64), const F_PARAM_MASK ideal-int +pkg syscall (netbsd-amd64), const F_PARAM_MAX ideal-int +pkg syscall (netbsd-amd64), const F_RDLCK ideal-int +pkg syscall (netbsd-amd64), const F_SETFD ideal-int +pkg syscall (netbsd-amd64), const F_SETFL ideal-int +pkg syscall (netbsd-amd64), const F_SETLK ideal-int +pkg syscall (netbsd-amd64), const F_SETLKW ideal-int +pkg syscall (netbsd-amd64), const F_SETNOSIGPIPE ideal-int +pkg syscall (netbsd-amd64), const F_SETOWN ideal-int +pkg syscall (netbsd-amd64), const F_UNLCK ideal-int +pkg syscall (netbsd-amd64), const F_WRLCK ideal-int +pkg syscall (netbsd-amd64), const HUPCL ideal-int +pkg syscall (netbsd-amd64), const ICANON ideal-int +pkg syscall (netbsd-amd64), const ICMP6_FILTER = 18 +pkg syscall (netbsd-amd64), const ICMP6_FILTER ideal-int +pkg syscall (netbsd-amd64), const ICRNL ideal-int +pkg syscall (netbsd-amd64), const IEXTEN ideal-int +pkg syscall (netbsd-amd64), const IFAN_ARRIVAL ideal-int +pkg syscall (netbsd-amd64), const IFAN_DEPARTURE ideal-int +pkg syscall (netbsd-amd64), const IFA_ROUTE ideal-int +pkg syscall (netbsd-amd64), const IFF_ALLMULTI ideal-int +pkg syscall (netbsd-amd64), const IFF_CANTCHANGE ideal-int +pkg syscall (netbsd-amd64), const IFF_DEBUG ideal-int +pkg syscall (netbsd-amd64), const IFF_LINK0 ideal-int +pkg syscall (netbsd-amd64), const IFF_LINK1 ideal-int +pkg syscall (netbsd-amd64), const IFF_LINK2 ideal-int +pkg syscall (netbsd-amd64), const IFF_NOARP ideal-int +pkg syscall (netbsd-amd64), const IFF_NOTRAILERS ideal-int +pkg syscall (netbsd-amd64), const IFF_OACTIVE ideal-int +pkg syscall (netbsd-amd64), const IFF_POINTOPOINT ideal-int +pkg syscall (netbsd-amd64), const IFF_PROMISC ideal-int +pkg syscall (netbsd-amd64), const IFF_RUNNING ideal-int +pkg syscall (netbsd-amd64), const IFF_SIMPLEX ideal-int +pkg syscall (netbsd-amd64), const IFNAMSIZ ideal-int +pkg syscall (netbsd-amd64), const IFT_1822 ideal-int +pkg syscall (netbsd-amd64), const IFT_A12MPPSWITCH ideal-int +pkg syscall (netbsd-amd64), const IFT_AAL2 ideal-int +pkg syscall (netbsd-amd64), const IFT_AAL5 ideal-int +pkg syscall (netbsd-amd64), const IFT_ADSL ideal-int +pkg syscall (netbsd-amd64), const IFT_AFLANE8023 ideal-int +pkg syscall (netbsd-amd64), const IFT_AFLANE8025 ideal-int +pkg syscall (netbsd-amd64), const IFT_ARAP ideal-int +pkg syscall (netbsd-amd64), const IFT_ARCNET ideal-int +pkg syscall (netbsd-amd64), const IFT_ARCNETPLUS ideal-int +pkg syscall (netbsd-amd64), const IFT_ASYNC ideal-int +pkg syscall (netbsd-amd64), const IFT_ATM ideal-int +pkg syscall (netbsd-amd64), const IFT_ATMDXI ideal-int +pkg syscall (netbsd-amd64), const IFT_ATMFUNI ideal-int +pkg syscall (netbsd-amd64), const IFT_ATMIMA ideal-int +pkg syscall (netbsd-amd64), const IFT_ATMLOGICAL ideal-int +pkg syscall (netbsd-amd64), const IFT_ATMRADIO ideal-int +pkg syscall (netbsd-amd64), const IFT_ATMSUBINTERFACE ideal-int +pkg syscall (netbsd-amd64), const IFT_ATMVCIENDPT ideal-int +pkg syscall (netbsd-amd64), const IFT_ATMVIRTUAL ideal-int +pkg syscall (netbsd-amd64), const IFT_BGPPOLICYACCOUNTING ideal-int +pkg syscall (netbsd-amd64), const IFT_BRIDGE ideal-int +pkg syscall (netbsd-amd64), const IFT_BSC ideal-int +pkg syscall (netbsd-amd64), const IFT_CARP ideal-int +pkg syscall (netbsd-amd64), const IFT_CCTEMUL ideal-int +pkg syscall (netbsd-amd64), const IFT_CEPT ideal-int +pkg syscall (netbsd-amd64), const IFT_CES ideal-int +pkg syscall (netbsd-amd64), const IFT_CHANNEL ideal-int +pkg syscall (netbsd-amd64), const IFT_CNR ideal-int +pkg syscall (netbsd-amd64), const IFT_COFFEE ideal-int +pkg syscall (netbsd-amd64), const IFT_COMPOSITELINK ideal-int +pkg syscall (netbsd-amd64), const IFT_DCN ideal-int +pkg syscall (netbsd-amd64), const IFT_DIGITALPOWERLINE ideal-int +pkg syscall (netbsd-amd64), const IFT_DIGITALWRAPPEROVERHEADCHANNEL ideal-int +pkg syscall (netbsd-amd64), const IFT_DLSW ideal-int +pkg syscall (netbsd-amd64), const IFT_DOCSCABLEDOWNSTREAM ideal-int +pkg syscall (netbsd-amd64), const IFT_DOCSCABLEMACLAYER ideal-int +pkg syscall (netbsd-amd64), const IFT_DOCSCABLEUPSTREAM ideal-int +pkg syscall (netbsd-amd64), const IFT_DOCSCABLEUPSTREAMCHANNEL ideal-int +pkg syscall (netbsd-amd64), const IFT_DS0 ideal-int +pkg syscall (netbsd-amd64), const IFT_DS0BUNDLE ideal-int +pkg syscall (netbsd-amd64), const IFT_DS1FDL ideal-int +pkg syscall (netbsd-amd64), const IFT_DS3 ideal-int +pkg syscall (netbsd-amd64), const IFT_DTM ideal-int +pkg syscall (netbsd-amd64), const IFT_DVBASILN ideal-int +pkg syscall (netbsd-amd64), const IFT_DVBASIOUT ideal-int +pkg syscall (netbsd-amd64), const IFT_DVBRCCDOWNSTREAM ideal-int +pkg syscall (netbsd-amd64), const IFT_DVBRCCMACLAYER ideal-int +pkg syscall (netbsd-amd64), const IFT_DVBRCCUPSTREAM ideal-int +pkg syscall (netbsd-amd64), const IFT_ECONET ideal-int +pkg syscall (netbsd-amd64), const IFT_EON ideal-int +pkg syscall (netbsd-amd64), const IFT_EPLRS ideal-int +pkg syscall (netbsd-amd64), const IFT_ESCON ideal-int +pkg syscall (netbsd-amd64), const IFT_ETHER ideal-int +pkg syscall (netbsd-amd64), const IFT_FAITH ideal-int +pkg syscall (netbsd-amd64), const IFT_FAST ideal-int +pkg syscall (netbsd-amd64), const IFT_FASTETHER ideal-int +pkg syscall (netbsd-amd64), const IFT_FASTETHERFX ideal-int +pkg syscall (netbsd-amd64), const IFT_FDDI ideal-int +pkg syscall (netbsd-amd64), const IFT_FIBRECHANNEL ideal-int +pkg syscall (netbsd-amd64), const IFT_FRAMERELAYINTERCONNECT ideal-int +pkg syscall (netbsd-amd64), const IFT_FRAMERELAYMPI ideal-int +pkg syscall (netbsd-amd64), const IFT_FRDLCIENDPT ideal-int +pkg syscall (netbsd-amd64), const IFT_FRELAY ideal-int +pkg syscall (netbsd-amd64), const IFT_FRELAYDCE ideal-int +pkg syscall (netbsd-amd64), const IFT_FRF16MFRBUNDLE ideal-int +pkg syscall (netbsd-amd64), const IFT_FRFORWARD ideal-int +pkg syscall (netbsd-amd64), const IFT_G703AT2MB ideal-int +pkg syscall (netbsd-amd64), const IFT_G703AT64K ideal-int +pkg syscall (netbsd-amd64), const IFT_GIF ideal-int +pkg syscall (netbsd-amd64), const IFT_GIGABITETHERNET ideal-int +pkg syscall (netbsd-amd64), const IFT_GR303IDT ideal-int +pkg syscall (netbsd-amd64), const IFT_GR303RDT ideal-int +pkg syscall (netbsd-amd64), const IFT_H323GATEKEEPER ideal-int +pkg syscall (netbsd-amd64), const IFT_H323PROXY ideal-int +pkg syscall (netbsd-amd64), const IFT_HDH1822 ideal-int +pkg syscall (netbsd-amd64), const IFT_HDLC ideal-int +pkg syscall (netbsd-amd64), const IFT_HDSL2 ideal-int +pkg syscall (netbsd-amd64), const IFT_HIPERLAN2 ideal-int +pkg syscall (netbsd-amd64), const IFT_HIPPI ideal-int +pkg syscall (netbsd-amd64), const IFT_HIPPIINTERFACE ideal-int +pkg syscall (netbsd-amd64), const IFT_HOSTPAD ideal-int +pkg syscall (netbsd-amd64), const IFT_HSSI ideal-int +pkg syscall (netbsd-amd64), const IFT_HY ideal-int +pkg syscall (netbsd-amd64), const IFT_IBM370PARCHAN ideal-int +pkg syscall (netbsd-amd64), const IFT_IDSL ideal-int +pkg syscall (netbsd-amd64), const IFT_IEEE1394 ideal-int +pkg syscall (netbsd-amd64), const IFT_IEEE80211 ideal-int +pkg syscall (netbsd-amd64), const IFT_IEEE80212 ideal-int +pkg syscall (netbsd-amd64), const IFT_IEEE8023ADLAG ideal-int +pkg syscall (netbsd-amd64), const IFT_IFGSN ideal-int +pkg syscall (netbsd-amd64), const IFT_IMT ideal-int +pkg syscall (netbsd-amd64), const IFT_INFINIBAND ideal-int +pkg syscall (netbsd-amd64), const IFT_INTERLEAVE ideal-int +pkg syscall (netbsd-amd64), const IFT_IP ideal-int +pkg syscall (netbsd-amd64), const IFT_IPFORWARD ideal-int +pkg syscall (netbsd-amd64), const IFT_IPOVERATM ideal-int +pkg syscall (netbsd-amd64), const IFT_IPOVERCDLC ideal-int +pkg syscall (netbsd-amd64), const IFT_IPOVERCLAW ideal-int +pkg syscall (netbsd-amd64), const IFT_IPSWITCH ideal-int +pkg syscall (netbsd-amd64), const IFT_ISDN ideal-int +pkg syscall (netbsd-amd64), const IFT_ISDNBASIC ideal-int +pkg syscall (netbsd-amd64), const IFT_ISDNPRIMARY ideal-int +pkg syscall (netbsd-amd64), const IFT_ISDNS ideal-int +pkg syscall (netbsd-amd64), const IFT_ISDNU ideal-int +pkg syscall (netbsd-amd64), const IFT_ISO88022LLC ideal-int +pkg syscall (netbsd-amd64), const IFT_ISO88023 ideal-int +pkg syscall (netbsd-amd64), const IFT_ISO88024 ideal-int +pkg syscall (netbsd-amd64), const IFT_ISO88025 ideal-int +pkg syscall (netbsd-amd64), const IFT_ISO88025CRFPINT ideal-int +pkg syscall (netbsd-amd64), const IFT_ISO88025DTR ideal-int +pkg syscall (netbsd-amd64), const IFT_ISO88025FIBER ideal-int +pkg syscall (netbsd-amd64), const IFT_ISO88026 ideal-int +pkg syscall (netbsd-amd64), const IFT_ISUP ideal-int +pkg syscall (netbsd-amd64), const IFT_L2VLAN ideal-int +pkg syscall (netbsd-amd64), const IFT_L3IPVLAN ideal-int +pkg syscall (netbsd-amd64), const IFT_L3IPXVLAN ideal-int +pkg syscall (netbsd-amd64), const IFT_LAPB ideal-int +pkg syscall (netbsd-amd64), const IFT_LAPD ideal-int +pkg syscall (netbsd-amd64), const IFT_LAPF ideal-int +pkg syscall (netbsd-amd64), const IFT_LINEGROUP ideal-int +pkg syscall (netbsd-amd64), const IFT_LOCALTALK ideal-int +pkg syscall (netbsd-amd64), const IFT_LOOP ideal-int +pkg syscall (netbsd-amd64), const IFT_MEDIAMAILOVERIP ideal-int +pkg syscall (netbsd-amd64), const IFT_MFSIGLINK ideal-int +pkg syscall (netbsd-amd64), const IFT_MIOX25 ideal-int +pkg syscall (netbsd-amd64), const IFT_MODEM ideal-int +pkg syscall (netbsd-amd64), const IFT_MPC ideal-int +pkg syscall (netbsd-amd64), const IFT_MPLS ideal-int +pkg syscall (netbsd-amd64), const IFT_MPLSTUNNEL ideal-int +pkg syscall (netbsd-amd64), const IFT_MSDSL ideal-int +pkg syscall (netbsd-amd64), const IFT_MVL ideal-int +pkg syscall (netbsd-amd64), const IFT_MYRINET ideal-int +pkg syscall (netbsd-amd64), const IFT_NFAS ideal-int +pkg syscall (netbsd-amd64), const IFT_NSIP ideal-int +pkg syscall (netbsd-amd64), const IFT_OPTICALCHANNEL ideal-int +pkg syscall (netbsd-amd64), const IFT_OPTICALTRANSPORT ideal-int +pkg syscall (netbsd-amd64), const IFT_OTHER ideal-int +pkg syscall (netbsd-amd64), const IFT_P10 ideal-int +pkg syscall (netbsd-amd64), const IFT_P80 ideal-int +pkg syscall (netbsd-amd64), const IFT_PARA ideal-int +pkg syscall (netbsd-amd64), const IFT_PFLOG ideal-int +pkg syscall (netbsd-amd64), const IFT_PFSYNC ideal-int +pkg syscall (netbsd-amd64), const IFT_PLC ideal-int +pkg syscall (netbsd-amd64), const IFT_PON155 ideal-int +pkg syscall (netbsd-amd64), const IFT_PON622 ideal-int +pkg syscall (netbsd-amd64), const IFT_POS ideal-int +pkg syscall (netbsd-amd64), const IFT_PPP ideal-int +pkg syscall (netbsd-amd64), const IFT_PPPMULTILINKBUNDLE ideal-int +pkg syscall (netbsd-amd64), const IFT_PROPATM ideal-int +pkg syscall (netbsd-amd64), const IFT_PROPBWAP2MP ideal-int +pkg syscall (netbsd-amd64), const IFT_PROPCNLS ideal-int +pkg syscall (netbsd-amd64), const IFT_PROPDOCSWIRELESSDOWNSTREAM ideal-int +pkg syscall (netbsd-amd64), const IFT_PROPDOCSWIRELESSMACLAYER ideal-int +pkg syscall (netbsd-amd64), const IFT_PROPDOCSWIRELESSUPSTREAM ideal-int +pkg syscall (netbsd-amd64), const IFT_PROPMUX ideal-int +pkg syscall (netbsd-amd64), const IFT_PROPVIRTUAL ideal-int +pkg syscall (netbsd-amd64), const IFT_PROPWIRELESSP2P ideal-int +pkg syscall (netbsd-amd64), const IFT_PTPSERIAL ideal-int +pkg syscall (netbsd-amd64), const IFT_PVC ideal-int +pkg syscall (netbsd-amd64), const IFT_Q2931 ideal-int +pkg syscall (netbsd-amd64), const IFT_QLLC ideal-int +pkg syscall (netbsd-amd64), const IFT_RADIOMAC ideal-int +pkg syscall (netbsd-amd64), const IFT_RADSL ideal-int +pkg syscall (netbsd-amd64), const IFT_REACHDSL ideal-int +pkg syscall (netbsd-amd64), const IFT_RFC1483 ideal-int +pkg syscall (netbsd-amd64), const IFT_RS232 ideal-int +pkg syscall (netbsd-amd64), const IFT_RSRB ideal-int +pkg syscall (netbsd-amd64), const IFT_SDLC ideal-int +pkg syscall (netbsd-amd64), const IFT_SDSL ideal-int +pkg syscall (netbsd-amd64), const IFT_SHDSL ideal-int +pkg syscall (netbsd-amd64), const IFT_SIP ideal-int +pkg syscall (netbsd-amd64), const IFT_SIPSIG ideal-int +pkg syscall (netbsd-amd64), const IFT_SIPTG ideal-int +pkg syscall (netbsd-amd64), const IFT_SLIP ideal-int +pkg syscall (netbsd-amd64), const IFT_SMDSDXI ideal-int +pkg syscall (netbsd-amd64), const IFT_SMDSICIP ideal-int +pkg syscall (netbsd-amd64), const IFT_SONET ideal-int +pkg syscall (netbsd-amd64), const IFT_SONETOVERHEADCHANNEL ideal-int +pkg syscall (netbsd-amd64), const IFT_SONETPATH ideal-int +pkg syscall (netbsd-amd64), const IFT_SONETVT ideal-int +pkg syscall (netbsd-amd64), const IFT_SRP ideal-int +pkg syscall (netbsd-amd64), const IFT_SS7SIGLINK ideal-int +pkg syscall (netbsd-amd64), const IFT_STACKTOSTACK ideal-int +pkg syscall (netbsd-amd64), const IFT_STARLAN ideal-int +pkg syscall (netbsd-amd64), const IFT_STF ideal-int +pkg syscall (netbsd-amd64), const IFT_T1 ideal-int +pkg syscall (netbsd-amd64), const IFT_TDLC ideal-int +pkg syscall (netbsd-amd64), const IFT_TELINK ideal-int +pkg syscall (netbsd-amd64), const IFT_TERMPAD ideal-int +pkg syscall (netbsd-amd64), const IFT_TR008 ideal-int +pkg syscall (netbsd-amd64), const IFT_TRANSPHDLC ideal-int +pkg syscall (netbsd-amd64), const IFT_TUNNEL ideal-int +pkg syscall (netbsd-amd64), const IFT_ULTRA ideal-int +pkg syscall (netbsd-amd64), const IFT_USB ideal-int +pkg syscall (netbsd-amd64), const IFT_V11 ideal-int +pkg syscall (netbsd-amd64), const IFT_V35 ideal-int +pkg syscall (netbsd-amd64), const IFT_V36 ideal-int +pkg syscall (netbsd-amd64), const IFT_V37 ideal-int +pkg syscall (netbsd-amd64), const IFT_VDSL ideal-int +pkg syscall (netbsd-amd64), const IFT_VIRTUALIPADDRESS ideal-int +pkg syscall (netbsd-amd64), const IFT_VIRTUALTG ideal-int +pkg syscall (netbsd-amd64), const IFT_VOICEDID ideal-int +pkg syscall (netbsd-amd64), const IFT_VOICEEM ideal-int +pkg syscall (netbsd-amd64), const IFT_VOICEEMFGD ideal-int +pkg syscall (netbsd-amd64), const IFT_VOICEENCAP ideal-int +pkg syscall (netbsd-amd64), const IFT_VOICEFGDEANA ideal-int +pkg syscall (netbsd-amd64), const IFT_VOICEFXO ideal-int +pkg syscall (netbsd-amd64), const IFT_VOICEFXS ideal-int +pkg syscall (netbsd-amd64), const IFT_VOICEOVERATM ideal-int +pkg syscall (netbsd-amd64), const IFT_VOICEOVERCABLE ideal-int +pkg syscall (netbsd-amd64), const IFT_VOICEOVERFRAMERELAY ideal-int +pkg syscall (netbsd-amd64), const IFT_VOICEOVERIP ideal-int +pkg syscall (netbsd-amd64), const IFT_X213 ideal-int +pkg syscall (netbsd-amd64), const IFT_X25 ideal-int +pkg syscall (netbsd-amd64), const IFT_X25DDN ideal-int +pkg syscall (netbsd-amd64), const IFT_X25HUNTGROUP ideal-int +pkg syscall (netbsd-amd64), const IFT_X25MLP ideal-int +pkg syscall (netbsd-amd64), const IFT_X25PLE ideal-int +pkg syscall (netbsd-amd64), const IFT_XETHER ideal-int +pkg syscall (netbsd-amd64), const IGNBRK ideal-int +pkg syscall (netbsd-amd64), const IGNCR ideal-int +pkg syscall (netbsd-amd64), const IGNPAR ideal-int +pkg syscall (netbsd-amd64), const IMAXBEL ideal-int +pkg syscall (netbsd-amd64), const INLCR ideal-int +pkg syscall (netbsd-amd64), const INPCK ideal-int +pkg syscall (netbsd-amd64), const IN_CLASSA_HOST ideal-int +pkg syscall (netbsd-amd64), const IN_CLASSA_MAX ideal-int +pkg syscall (netbsd-amd64), const IN_CLASSA_NET ideal-int +pkg syscall (netbsd-amd64), const IN_CLASSA_NSHIFT ideal-int +pkg syscall (netbsd-amd64), const IN_CLASSB_HOST ideal-int +pkg syscall (netbsd-amd64), const IN_CLASSB_MAX ideal-int +pkg syscall (netbsd-amd64), const IN_CLASSB_NET ideal-int +pkg syscall (netbsd-amd64), const IN_CLASSB_NSHIFT ideal-int +pkg syscall (netbsd-amd64), const IN_CLASSC_HOST ideal-int +pkg syscall (netbsd-amd64), const IN_CLASSC_NET ideal-int +pkg syscall (netbsd-amd64), const IN_CLASSC_NSHIFT ideal-int +pkg syscall (netbsd-amd64), const IN_CLASSD_HOST ideal-int +pkg syscall (netbsd-amd64), const IN_CLASSD_NET ideal-int +pkg syscall (netbsd-amd64), const IN_CLASSD_NSHIFT ideal-int +pkg syscall (netbsd-amd64), const IN_LOOPBACKNET ideal-int +pkg syscall (netbsd-amd64), const IPPROTO_AH ideal-int +pkg syscall (netbsd-amd64), const IPPROTO_CARP ideal-int +pkg syscall (netbsd-amd64), const IPPROTO_DONE ideal-int +pkg syscall (netbsd-amd64), const IPPROTO_DSTOPTS ideal-int +pkg syscall (netbsd-amd64), const IPPROTO_EGP ideal-int +pkg syscall (netbsd-amd64), const IPPROTO_ENCAP ideal-int +pkg syscall (netbsd-amd64), const IPPROTO_EON ideal-int +pkg syscall (netbsd-amd64), const IPPROTO_ESP ideal-int +pkg syscall (netbsd-amd64), const IPPROTO_ETHERIP ideal-int +pkg syscall (netbsd-amd64), const IPPROTO_FRAGMENT ideal-int +pkg syscall (netbsd-amd64), const IPPROTO_GGP ideal-int +pkg syscall (netbsd-amd64), const IPPROTO_GRE ideal-int +pkg syscall (netbsd-amd64), const IPPROTO_HOPOPTS ideal-int +pkg syscall (netbsd-amd64), const IPPROTO_ICMP ideal-int +pkg syscall (netbsd-amd64), const IPPROTO_ICMPV6 ideal-int +pkg syscall (netbsd-amd64), const IPPROTO_IDP ideal-int +pkg syscall (netbsd-amd64), const IPPROTO_IGMP ideal-int +pkg syscall (netbsd-amd64), const IPPROTO_IPCOMP ideal-int +pkg syscall (netbsd-amd64), const IPPROTO_IPIP ideal-int +pkg syscall (netbsd-amd64), const IPPROTO_IPV4 ideal-int +pkg syscall (netbsd-amd64), const IPPROTO_IPV6_ICMP ideal-int +pkg syscall (netbsd-amd64), const IPPROTO_MAX ideal-int +pkg syscall (netbsd-amd64), const IPPROTO_MAXID ideal-int +pkg syscall (netbsd-amd64), const IPPROTO_MOBILE ideal-int +pkg syscall (netbsd-amd64), const IPPROTO_NONE ideal-int +pkg syscall (netbsd-amd64), const IPPROTO_PFSYNC ideal-int +pkg syscall (netbsd-amd64), const IPPROTO_PIM ideal-int +pkg syscall (netbsd-amd64), const IPPROTO_PUP ideal-int +pkg syscall (netbsd-amd64), const IPPROTO_RAW ideal-int +pkg syscall (netbsd-amd64), const IPPROTO_ROUTING ideal-int +pkg syscall (netbsd-amd64), const IPPROTO_RSVP ideal-int +pkg syscall (netbsd-amd64), const IPPROTO_TP ideal-int +pkg syscall (netbsd-amd64), const IPPROTO_VRRP ideal-int +pkg syscall (netbsd-amd64), const IPV6_CHECKSUM ideal-int +pkg syscall (netbsd-amd64), const IPV6_DEFAULT_MULTICAST_HOPS ideal-int +pkg syscall (netbsd-amd64), const IPV6_DEFAULT_MULTICAST_LOOP ideal-int +pkg syscall (netbsd-amd64), const IPV6_DEFHLIM ideal-int +pkg syscall (netbsd-amd64), const IPV6_DONTFRAG ideal-int +pkg syscall (netbsd-amd64), const IPV6_DSTOPTS ideal-int +pkg syscall (netbsd-amd64), const IPV6_FAITH ideal-int +pkg syscall (netbsd-amd64), const IPV6_FLOWINFO_MASK ideal-int +pkg syscall (netbsd-amd64), const IPV6_FLOWLABEL_MASK ideal-int +pkg syscall (netbsd-amd64), const IPV6_FRAGTTL ideal-int +pkg syscall (netbsd-amd64), const IPV6_HLIMDEC ideal-int +pkg syscall (netbsd-amd64), const IPV6_HOPLIMIT ideal-int +pkg syscall (netbsd-amd64), const IPV6_HOPOPTS ideal-int +pkg syscall (netbsd-amd64), const IPV6_IPSEC_POLICY ideal-int +pkg syscall (netbsd-amd64), const IPV6_MAXHLIM ideal-int +pkg syscall (netbsd-amd64), const IPV6_MAXPACKET ideal-int +pkg syscall (netbsd-amd64), const IPV6_MMTU ideal-int +pkg syscall (netbsd-amd64), const IPV6_NEXTHOP ideal-int +pkg syscall (netbsd-amd64), const IPV6_PATHMTU ideal-int +pkg syscall (netbsd-amd64), const IPV6_PKTINFO ideal-int +pkg syscall (netbsd-amd64), const IPV6_PORTRANGE ideal-int +pkg syscall (netbsd-amd64), const IPV6_PORTRANGE_DEFAULT ideal-int +pkg syscall (netbsd-amd64), const IPV6_PORTRANGE_HIGH ideal-int +pkg syscall (netbsd-amd64), const IPV6_PORTRANGE_LOW ideal-int +pkg syscall (netbsd-amd64), const IPV6_RECVDSTOPTS ideal-int +pkg syscall (netbsd-amd64), const IPV6_RECVHOPLIMIT ideal-int +pkg syscall (netbsd-amd64), const IPV6_RECVHOPOPTS ideal-int +pkg syscall (netbsd-amd64), const IPV6_RECVPATHMTU ideal-int +pkg syscall (netbsd-amd64), const IPV6_RECVPKTINFO ideal-int +pkg syscall (netbsd-amd64), const IPV6_RECVRTHDR ideal-int +pkg syscall (netbsd-amd64), const IPV6_RECVTCLASS ideal-int +pkg syscall (netbsd-amd64), const IPV6_RTHDR ideal-int +pkg syscall (netbsd-amd64), const IPV6_RTHDRDSTOPTS ideal-int +pkg syscall (netbsd-amd64), const IPV6_RTHDR_LOOSE ideal-int +pkg syscall (netbsd-amd64), const IPV6_RTHDR_STRICT ideal-int +pkg syscall (netbsd-amd64), const IPV6_RTHDR_TYPE_0 ideal-int +pkg syscall (netbsd-amd64), const IPV6_SOCKOPT_RESERVED1 ideal-int +pkg syscall (netbsd-amd64), const IPV6_TCLASS ideal-int +pkg syscall (netbsd-amd64), const IPV6_USE_MIN_MTU ideal-int +pkg syscall (netbsd-amd64), const IPV6_VERSION ideal-int +pkg syscall (netbsd-amd64), const IPV6_VERSION_MASK ideal-int +pkg syscall (netbsd-amd64), const IP_DEFAULT_MULTICAST_LOOP ideal-int +pkg syscall (netbsd-amd64), const IP_DEFAULT_MULTICAST_TTL ideal-int +pkg syscall (netbsd-amd64), const IP_DF ideal-int +pkg syscall (netbsd-amd64), const IP_EF ideal-int +pkg syscall (netbsd-amd64), const IP_ERRORMTU ideal-int +pkg syscall (netbsd-amd64), const IP_HDRINCL ideal-int +pkg syscall (netbsd-amd64), const IP_IPSEC_POLICY ideal-int +pkg syscall (netbsd-amd64), const IP_MAXPACKET ideal-int +pkg syscall (netbsd-amd64), const IP_MAX_MEMBERSHIPS ideal-int +pkg syscall (netbsd-amd64), const IP_MF ideal-int +pkg syscall (netbsd-amd64), const IP_MINFRAGSIZE ideal-int +pkg syscall (netbsd-amd64), const IP_MINTTL ideal-int +pkg syscall (netbsd-amd64), const IP_MSS ideal-int +pkg syscall (netbsd-amd64), const IP_OFFMASK ideal-int +pkg syscall (netbsd-amd64), const IP_OPTIONS ideal-int +pkg syscall (netbsd-amd64), const IP_PORTRANGE ideal-int +pkg syscall (netbsd-amd64), const IP_PORTRANGE_DEFAULT ideal-int +pkg syscall (netbsd-amd64), const IP_PORTRANGE_HIGH ideal-int +pkg syscall (netbsd-amd64), const IP_PORTRANGE_LOW ideal-int +pkg syscall (netbsd-amd64), const IP_RECVDSTADDR ideal-int +pkg syscall (netbsd-amd64), const IP_RECVIF ideal-int +pkg syscall (netbsd-amd64), const IP_RECVOPTS ideal-int +pkg syscall (netbsd-amd64), const IP_RECVRETOPTS ideal-int +pkg syscall (netbsd-amd64), const IP_RECVTTL ideal-int +pkg syscall (netbsd-amd64), const IP_RETOPTS ideal-int +pkg syscall (netbsd-amd64), const IP_RF ideal-int +pkg syscall (netbsd-amd64), const ISIG ideal-int +pkg syscall (netbsd-amd64), const ISTRIP ideal-int +pkg syscall (netbsd-amd64), const IXANY ideal-int +pkg syscall (netbsd-amd64), const IXOFF ideal-int +pkg syscall (netbsd-amd64), const IXON ideal-int +pkg syscall (netbsd-amd64), const LOCK_EX ideal-int +pkg syscall (netbsd-amd64), const LOCK_NB ideal-int +pkg syscall (netbsd-amd64), const LOCK_SH ideal-int +pkg syscall (netbsd-amd64), const LOCK_UN ideal-int +pkg syscall (netbsd-amd64), const MSG_BCAST ideal-int +pkg syscall (netbsd-amd64), const MSG_CMSG_CLOEXEC ideal-int +pkg syscall (netbsd-amd64), const MSG_CONTROLMBUF ideal-int +pkg syscall (netbsd-amd64), const MSG_CTRUNC ideal-int +pkg syscall (netbsd-amd64), const MSG_DONTROUTE ideal-int +pkg syscall (netbsd-amd64), const MSG_DONTWAIT ideal-int +pkg syscall (netbsd-amd64), const MSG_EOR ideal-int +pkg syscall (netbsd-amd64), const MSG_IOVUSRSPACE ideal-int +pkg syscall (netbsd-amd64), const MSG_LENUSRSPACE ideal-int +pkg syscall (netbsd-amd64), const MSG_MCAST ideal-int +pkg syscall (netbsd-amd64), const MSG_NAMEMBUF ideal-int +pkg syscall (netbsd-amd64), const MSG_NBIO ideal-int +pkg syscall (netbsd-amd64), const MSG_NOSIGNAL ideal-int +pkg syscall (netbsd-amd64), const MSG_OOB ideal-int +pkg syscall (netbsd-amd64), const MSG_PEEK ideal-int +pkg syscall (netbsd-amd64), const MSG_TRUNC ideal-int +pkg syscall (netbsd-amd64), const MSG_USERFLAGS ideal-int +pkg syscall (netbsd-amd64), const MSG_WAITALL ideal-int +pkg syscall (netbsd-amd64), const NAME_MAX ideal-int +pkg syscall (netbsd-amd64), const NET_RT_DUMP ideal-int +pkg syscall (netbsd-amd64), const NET_RT_FLAGS ideal-int +pkg syscall (netbsd-amd64), const NET_RT_IFLIST ideal-int +pkg syscall (netbsd-amd64), const NET_RT_MAXID ideal-int +pkg syscall (netbsd-amd64), const NET_RT_OIFLIST ideal-int +pkg syscall (netbsd-amd64), const NET_RT_OOIFLIST ideal-int +pkg syscall (netbsd-amd64), const NOFLSH ideal-int +pkg syscall (netbsd-amd64), const NOTE_ATTRIB ideal-int +pkg syscall (netbsd-amd64), const NOTE_CHILD ideal-int +pkg syscall (netbsd-amd64), const NOTE_DELETE ideal-int +pkg syscall (netbsd-amd64), const NOTE_EXEC ideal-int +pkg syscall (netbsd-amd64), const NOTE_EXIT ideal-int +pkg syscall (netbsd-amd64), const NOTE_EXTEND ideal-int +pkg syscall (netbsd-amd64), const NOTE_FORK ideal-int +pkg syscall (netbsd-amd64), const NOTE_LINK ideal-int +pkg syscall (netbsd-amd64), const NOTE_LOWAT ideal-int +pkg syscall (netbsd-amd64), const NOTE_PCTRLMASK ideal-int +pkg syscall (netbsd-amd64), const NOTE_PDATAMASK ideal-int +pkg syscall (netbsd-amd64), const NOTE_RENAME ideal-int +pkg syscall (netbsd-amd64), const NOTE_REVOKE ideal-int +pkg syscall (netbsd-amd64), const NOTE_TRACK ideal-int +pkg syscall (netbsd-amd64), const NOTE_TRACKERR ideal-int +pkg syscall (netbsd-amd64), const NOTE_WRITE ideal-int +pkg syscall (netbsd-amd64), const OCRNL ideal-int +pkg syscall (netbsd-amd64), const OFIOGETBMAP ideal-int +pkg syscall (netbsd-amd64), const ONLCR ideal-int +pkg syscall (netbsd-amd64), const ONLRET ideal-int +pkg syscall (netbsd-amd64), const ONOCR ideal-int +pkg syscall (netbsd-amd64), const ONOEOT ideal-int +pkg syscall (netbsd-amd64), const OPOST ideal-int +pkg syscall (netbsd-amd64), const O_ACCMODE ideal-int +pkg syscall (netbsd-amd64), const O_ALT_IO ideal-int +pkg syscall (netbsd-amd64), const O_DIRECT ideal-int +pkg syscall (netbsd-amd64), const O_DIRECTORY ideal-int +pkg syscall (netbsd-amd64), const O_DSYNC ideal-int +pkg syscall (netbsd-amd64), const O_EXLOCK ideal-int +pkg syscall (netbsd-amd64), const O_FSYNC ideal-int +pkg syscall (netbsd-amd64), const O_NDELAY ideal-int +pkg syscall (netbsd-amd64), const O_NOFOLLOW ideal-int +pkg syscall (netbsd-amd64), const O_NOSIGPIPE ideal-int +pkg syscall (netbsd-amd64), const O_RSYNC ideal-int +pkg syscall (netbsd-amd64), const O_SHLOCK ideal-int +pkg syscall (netbsd-amd64), const PARENB ideal-int +pkg syscall (netbsd-amd64), const PARMRK ideal-int +pkg syscall (netbsd-amd64), const PARODD ideal-int +pkg syscall (netbsd-amd64), const PENDIN ideal-int +pkg syscall (netbsd-amd64), const PRIO_PGRP = 1 +pkg syscall (netbsd-amd64), const PRIO_PGRP ideal-int +pkg syscall (netbsd-amd64), const PRIO_PROCESS = 0 +pkg syscall (netbsd-amd64), const PRIO_PROCESS ideal-int +pkg syscall (netbsd-amd64), const PRIO_USER = 2 +pkg syscall (netbsd-amd64), const PRIO_USER ideal-int +pkg syscall (netbsd-amd64), const PRI_IOFLUSH ideal-int +pkg syscall (netbsd-amd64), const PTRACE_CONT ideal-int +pkg syscall (netbsd-amd64), const PTRACE_KILL ideal-int +pkg syscall (netbsd-amd64), const PTRACE_TRACEME ideal-int +pkg syscall (netbsd-amd64), const RLIMIT_AS ideal-int +pkg syscall (netbsd-amd64), const RLIMIT_CORE ideal-int +pkg syscall (netbsd-amd64), const RLIMIT_CPU ideal-int +pkg syscall (netbsd-amd64), const RLIMIT_DATA ideal-int +pkg syscall (netbsd-amd64), const RLIMIT_FSIZE ideal-int +pkg syscall (netbsd-amd64), const RLIMIT_NOFILE ideal-int +pkg syscall (netbsd-amd64), const RLIMIT_STACK ideal-int +pkg syscall (netbsd-amd64), const RLIM_INFINITY ideal-int +pkg syscall (netbsd-amd64), const RTAX_AUTHOR ideal-int +pkg syscall (netbsd-amd64), const RTAX_BRD ideal-int +pkg syscall (netbsd-amd64), const RTAX_DST ideal-int +pkg syscall (netbsd-amd64), const RTAX_GATEWAY ideal-int +pkg syscall (netbsd-amd64), const RTAX_GENMASK ideal-int +pkg syscall (netbsd-amd64), const RTAX_IFA ideal-int +pkg syscall (netbsd-amd64), const RTAX_IFP ideal-int +pkg syscall (netbsd-amd64), const RTAX_MAX ideal-int +pkg syscall (netbsd-amd64), const RTAX_NETMASK ideal-int +pkg syscall (netbsd-amd64), const RTAX_TAG ideal-int +pkg syscall (netbsd-amd64), const RTA_AUTHOR ideal-int +pkg syscall (netbsd-amd64), const RTA_BRD ideal-int +pkg syscall (netbsd-amd64), const RTA_DST ideal-int +pkg syscall (netbsd-amd64), const RTA_GATEWAY ideal-int +pkg syscall (netbsd-amd64), const RTA_GENMASK ideal-int +pkg syscall (netbsd-amd64), const RTA_IFA ideal-int +pkg syscall (netbsd-amd64), const RTA_IFP ideal-int +pkg syscall (netbsd-amd64), const RTA_NETMASK ideal-int +pkg syscall (netbsd-amd64), const RTA_TAG ideal-int +pkg syscall (netbsd-amd64), const RTF_ANNOUNCE ideal-int +pkg syscall (netbsd-amd64), const RTF_BLACKHOLE ideal-int +pkg syscall (netbsd-amd64), const RTF_CLONED ideal-int +pkg syscall (netbsd-amd64), const RTF_CLONING ideal-int +pkg syscall (netbsd-amd64), const RTF_DONE ideal-int +pkg syscall (netbsd-amd64), const RTF_DYNAMIC ideal-int +pkg syscall (netbsd-amd64), const RTF_GATEWAY ideal-int +pkg syscall (netbsd-amd64), const RTF_HOST ideal-int +pkg syscall (netbsd-amd64), const RTF_LLINFO ideal-int +pkg syscall (netbsd-amd64), const RTF_MASK ideal-int +pkg syscall (netbsd-amd64), const RTF_MODIFIED ideal-int +pkg syscall (netbsd-amd64), const RTF_PROTO1 ideal-int +pkg syscall (netbsd-amd64), const RTF_PROTO2 ideal-int +pkg syscall (netbsd-amd64), const RTF_REJECT ideal-int +pkg syscall (netbsd-amd64), const RTF_SRC ideal-int +pkg syscall (netbsd-amd64), const RTF_STATIC ideal-int +pkg syscall (netbsd-amd64), const RTF_UP ideal-int +pkg syscall (netbsd-amd64), const RTF_XRESOLVE ideal-int +pkg syscall (netbsd-amd64), const RTM_ADD ideal-int +pkg syscall (netbsd-amd64), const RTM_CHANGE ideal-int +pkg syscall (netbsd-amd64), const RTM_CHGADDR ideal-int +pkg syscall (netbsd-amd64), const RTM_DELADDR ideal-int +pkg syscall (netbsd-amd64), const RTM_DELETE ideal-int +pkg syscall (netbsd-amd64), const RTM_GET ideal-int +pkg syscall (netbsd-amd64), const RTM_IEEE80211 ideal-int +pkg syscall (netbsd-amd64), const RTM_IFANNOUNCE ideal-int +pkg syscall (netbsd-amd64), const RTM_IFINFO ideal-int +pkg syscall (netbsd-amd64), const RTM_LLINFO_UPD ideal-int +pkg syscall (netbsd-amd64), const RTM_LOCK ideal-int +pkg syscall (netbsd-amd64), const RTM_LOSING ideal-int +pkg syscall (netbsd-amd64), const RTM_MISS ideal-int +pkg syscall (netbsd-amd64), const RTM_NEWADDR ideal-int +pkg syscall (netbsd-amd64), const RTM_OIFINFO ideal-int +pkg syscall (netbsd-amd64), const RTM_OLDADD ideal-int +pkg syscall (netbsd-amd64), const RTM_OLDDEL ideal-int +pkg syscall (netbsd-amd64), const RTM_OOIFINFO ideal-int +pkg syscall (netbsd-amd64), const RTM_REDIRECT ideal-int +pkg syscall (netbsd-amd64), const RTM_RESOLVE ideal-int +pkg syscall (netbsd-amd64), const RTM_RTTUNIT ideal-int +pkg syscall (netbsd-amd64), const RTM_SETGATE ideal-int +pkg syscall (netbsd-amd64), const RTM_VERSION ideal-int +pkg syscall (netbsd-amd64), const RTV_EXPIRE ideal-int +pkg syscall (netbsd-amd64), const RTV_HOPCOUNT ideal-int +pkg syscall (netbsd-amd64), const RTV_MTU ideal-int +pkg syscall (netbsd-amd64), const RTV_RPIPE ideal-int +pkg syscall (netbsd-amd64), const RTV_RTT ideal-int +pkg syscall (netbsd-amd64), const RTV_RTTVAR ideal-int +pkg syscall (netbsd-amd64), const RTV_SPIPE ideal-int +pkg syscall (netbsd-amd64), const RTV_SSTHRESH ideal-int +pkg syscall (netbsd-amd64), const RUSAGE_CHILDREN ideal-int +pkg syscall (netbsd-amd64), const RUSAGE_SELF ideal-int +pkg syscall (netbsd-amd64), const SCM_CREDS ideal-int +pkg syscall (netbsd-amd64), const SCM_RIGHTS ideal-int +pkg syscall (netbsd-amd64), const SCM_TIMESTAMP ideal-int +pkg syscall (netbsd-amd64), const SIGCHLD Signal +pkg syscall (netbsd-amd64), const SIGCONT Signal +pkg syscall (netbsd-amd64), const SIGEMT Signal +pkg syscall (netbsd-amd64), const SIGINFO Signal +pkg syscall (netbsd-amd64), const SIGIO Signal +pkg syscall (netbsd-amd64), const SIGIOT Signal +pkg syscall (netbsd-amd64), const SIGPROF Signal +pkg syscall (netbsd-amd64), const SIGPWR Signal +pkg syscall (netbsd-amd64), const SIGSTOP Signal +pkg syscall (netbsd-amd64), const SIGSYS Signal +pkg syscall (netbsd-amd64), const SIGTSTP Signal +pkg syscall (netbsd-amd64), const SIGTTIN Signal +pkg syscall (netbsd-amd64), const SIGTTOU Signal +pkg syscall (netbsd-amd64), const SIGURG Signal +pkg syscall (netbsd-amd64), const SIGUSR1 Signal +pkg syscall (netbsd-amd64), const SIGUSR2 Signal +pkg syscall (netbsd-amd64), const SIGVTALRM Signal +pkg syscall (netbsd-amd64), const SIGWINCH Signal +pkg syscall (netbsd-amd64), const SIGXCPU Signal +pkg syscall (netbsd-amd64), const SIGXFSZ Signal +pkg syscall (netbsd-amd64), const SIOCADDMULTI ideal-int +pkg syscall (netbsd-amd64), const SIOCADDRT ideal-int +pkg syscall (netbsd-amd64), const SIOCAIFADDR ideal-int +pkg syscall (netbsd-amd64), const SIOCALIFADDR ideal-int +pkg syscall (netbsd-amd64), const SIOCATMARK ideal-int +pkg syscall (netbsd-amd64), const SIOCDELMULTI ideal-int +pkg syscall (netbsd-amd64), const SIOCDELRT ideal-int +pkg syscall (netbsd-amd64), const SIOCDIFADDR ideal-int +pkg syscall (netbsd-amd64), const SIOCDIFPHYADDR ideal-int +pkg syscall (netbsd-amd64), const SIOCDLIFADDR ideal-int +pkg syscall (netbsd-amd64), const SIOCGDRVSPEC ideal-int +pkg syscall (netbsd-amd64), const SIOCGETPFSYNC ideal-int +pkg syscall (netbsd-amd64), const SIOCGETSGCNT ideal-int +pkg syscall (netbsd-amd64), const SIOCGETVIFCNT ideal-int +pkg syscall (netbsd-amd64), const SIOCGHIWAT ideal-int +pkg syscall (netbsd-amd64), const SIOCGIFADDR ideal-int +pkg syscall (netbsd-amd64), const SIOCGIFADDRPREF ideal-int +pkg syscall (netbsd-amd64), const SIOCGIFALIAS ideal-int +pkg syscall (netbsd-amd64), const SIOCGIFBRDADDR ideal-int +pkg syscall (netbsd-amd64), const SIOCGIFCAP ideal-int +pkg syscall (netbsd-amd64), const SIOCGIFCONF ideal-int +pkg syscall (netbsd-amd64), const SIOCGIFDATA ideal-int +pkg syscall (netbsd-amd64), const SIOCGIFDLT ideal-int +pkg syscall (netbsd-amd64), const SIOCGIFDSTADDR ideal-int +pkg syscall (netbsd-amd64), const SIOCGIFFLAGS ideal-int +pkg syscall (netbsd-amd64), const SIOCGIFGENERIC ideal-int +pkg syscall (netbsd-amd64), const SIOCGIFMEDIA ideal-int +pkg syscall (netbsd-amd64), const SIOCGIFMETRIC ideal-int +pkg syscall (netbsd-amd64), const SIOCGIFMTU ideal-int +pkg syscall (netbsd-amd64), const SIOCGIFNETMASK ideal-int +pkg syscall (netbsd-amd64), const SIOCGIFPDSTADDR ideal-int +pkg syscall (netbsd-amd64), const SIOCGIFPSRCADDR ideal-int +pkg syscall (netbsd-amd64), const SIOCGLIFADDR ideal-int +pkg syscall (netbsd-amd64), const SIOCGLIFPHYADDR ideal-int +pkg syscall (netbsd-amd64), const SIOCGLINKSTR ideal-int +pkg syscall (netbsd-amd64), const SIOCGLOWAT ideal-int +pkg syscall (netbsd-amd64), const SIOCGPGRP ideal-int +pkg syscall (netbsd-amd64), const SIOCGVH ideal-int +pkg syscall (netbsd-amd64), const SIOCIFCREATE ideal-int +pkg syscall (netbsd-amd64), const SIOCIFDESTROY ideal-int +pkg syscall (netbsd-amd64), const SIOCIFGCLONERS ideal-int +pkg syscall (netbsd-amd64), const SIOCINITIFADDR ideal-int +pkg syscall (netbsd-amd64), const SIOCSDRVSPEC ideal-int +pkg syscall (netbsd-amd64), const SIOCSETPFSYNC ideal-int +pkg syscall (netbsd-amd64), const SIOCSHIWAT ideal-int +pkg syscall (netbsd-amd64), const SIOCSIFADDR ideal-int +pkg syscall (netbsd-amd64), const SIOCSIFADDRPREF ideal-int +pkg syscall (netbsd-amd64), const SIOCSIFBRDADDR ideal-int +pkg syscall (netbsd-amd64), const SIOCSIFCAP ideal-int +pkg syscall (netbsd-amd64), const SIOCSIFDSTADDR ideal-int +pkg syscall (netbsd-amd64), const SIOCSIFFLAGS ideal-int +pkg syscall (netbsd-amd64), const SIOCSIFGENERIC ideal-int +pkg syscall (netbsd-amd64), const SIOCSIFMEDIA ideal-int +pkg syscall (netbsd-amd64), const SIOCSIFMETRIC ideal-int +pkg syscall (netbsd-amd64), const SIOCSIFMTU ideal-int +pkg syscall (netbsd-amd64), const SIOCSIFNETMASK ideal-int +pkg syscall (netbsd-amd64), const SIOCSIFPHYADDR ideal-int +pkg syscall (netbsd-amd64), const SIOCSLIFPHYADDR ideal-int +pkg syscall (netbsd-amd64), const SIOCSLINKSTR ideal-int +pkg syscall (netbsd-amd64), const SIOCSLOWAT ideal-int +pkg syscall (netbsd-amd64), const SIOCSPGRP ideal-int +pkg syscall (netbsd-amd64), const SIOCSVH ideal-int +pkg syscall (netbsd-amd64), const SIOCZIFDATA ideal-int +pkg syscall (netbsd-amd64), const SOCK_CLOEXEC ideal-int +pkg syscall (netbsd-amd64), const SOCK_FLAGS_MASK ideal-int +pkg syscall (netbsd-amd64), const SOCK_NONBLOCK ideal-int +pkg syscall (netbsd-amd64), const SOCK_NOSIGPIPE ideal-int +pkg syscall (netbsd-amd64), const SOCK_RDM ideal-int +pkg syscall (netbsd-amd64), const SO_ACCEPTCONN ideal-int +pkg syscall (netbsd-amd64), const SO_ACCEPTFILTER ideal-int +pkg syscall (netbsd-amd64), const SO_DEBUG ideal-int +pkg syscall (netbsd-amd64), const SO_ERROR ideal-int +pkg syscall (netbsd-amd64), const SO_NOHEADER ideal-int +pkg syscall (netbsd-amd64), const SO_NOSIGPIPE ideal-int +pkg syscall (netbsd-amd64), const SO_OOBINLINE ideal-int +pkg syscall (netbsd-amd64), const SO_OVERFLOWED ideal-int +pkg syscall (netbsd-amd64), const SO_RCVLOWAT ideal-int +pkg syscall (netbsd-amd64), const SO_RCVTIMEO ideal-int +pkg syscall (netbsd-amd64), const SO_REUSEPORT ideal-int +pkg syscall (netbsd-amd64), const SO_SNDLOWAT ideal-int +pkg syscall (netbsd-amd64), const SO_SNDTIMEO ideal-int +pkg syscall (netbsd-amd64), const SO_TIMESTAMP ideal-int +pkg syscall (netbsd-amd64), const SO_TYPE ideal-int +pkg syscall (netbsd-amd64), const SO_USELOOPBACK ideal-int +pkg syscall (netbsd-amd64), const SYSCTL_VERSION ideal-int +pkg syscall (netbsd-amd64), const SYSCTL_VERS_0 ideal-int +pkg syscall (netbsd-amd64), const SYSCTL_VERS_1 ideal-int +pkg syscall (netbsd-amd64), const SYSCTL_VERS_MASK ideal-int +pkg syscall (netbsd-amd64), const SYS_ACCEPT ideal-int +pkg syscall (netbsd-amd64), const SYS_ACCESS ideal-int +pkg syscall (netbsd-amd64), const SYS_ACCT ideal-int +pkg syscall (netbsd-amd64), const SYS_ADJTIME ideal-int +pkg syscall (netbsd-amd64), const SYS_BIND ideal-int +pkg syscall (netbsd-amd64), const SYS_BREAK ideal-int +pkg syscall (netbsd-amd64), const SYS_CHDIR ideal-int +pkg syscall (netbsd-amd64), const SYS_CHFLAGS ideal-int +pkg syscall (netbsd-amd64), const SYS_CHMOD ideal-int +pkg syscall (netbsd-amd64), const SYS_CHOWN ideal-int +pkg syscall (netbsd-amd64), const SYS_CHROOT ideal-int +pkg syscall (netbsd-amd64), const SYS_CLOCK_GETRES ideal-int +pkg syscall (netbsd-amd64), const SYS_CLOCK_GETTIME ideal-int +pkg syscall (netbsd-amd64), const SYS_CLOCK_SETTIME ideal-int +pkg syscall (netbsd-amd64), const SYS_CLOSE ideal-int +pkg syscall (netbsd-amd64), const SYS_CONNECT ideal-int +pkg syscall (netbsd-amd64), const SYS_DUP ideal-int +pkg syscall (netbsd-amd64), const SYS_DUP2 ideal-int +pkg syscall (netbsd-amd64), const SYS_DUP3 ideal-int +pkg syscall (netbsd-amd64), const SYS_EXECVE ideal-int +pkg syscall (netbsd-amd64), const SYS_EXIT ideal-int +pkg syscall (netbsd-amd64), const SYS_EXTATTRCTL ideal-int +pkg syscall (netbsd-amd64), const SYS_EXTATTR_DELETE_FD ideal-int +pkg syscall (netbsd-amd64), const SYS_EXTATTR_DELETE_FILE ideal-int +pkg syscall (netbsd-amd64), const SYS_EXTATTR_DELETE_LINK ideal-int +pkg syscall (netbsd-amd64), const SYS_EXTATTR_GET_FD ideal-int +pkg syscall (netbsd-amd64), const SYS_EXTATTR_GET_FILE ideal-int +pkg syscall (netbsd-amd64), const SYS_EXTATTR_GET_LINK ideal-int +pkg syscall (netbsd-amd64), const SYS_EXTATTR_LIST_FD ideal-int +pkg syscall (netbsd-amd64), const SYS_EXTATTR_LIST_FILE ideal-int +pkg syscall (netbsd-amd64), const SYS_EXTATTR_LIST_LINK ideal-int +pkg syscall (netbsd-amd64), const SYS_EXTATTR_SET_FD ideal-int +pkg syscall (netbsd-amd64), const SYS_EXTATTR_SET_FILE ideal-int +pkg syscall (netbsd-amd64), const SYS_EXTATTR_SET_LINK ideal-int +pkg syscall (netbsd-amd64), const SYS_FACCESSAT ideal-int +pkg syscall (netbsd-amd64), const SYS_FCHDIR ideal-int +pkg syscall (netbsd-amd64), const SYS_FCHFLAGS ideal-int +pkg syscall (netbsd-amd64), const SYS_FCHMOD ideal-int +pkg syscall (netbsd-amd64), const SYS_FCHMODAT ideal-int +pkg syscall (netbsd-amd64), const SYS_FCHOWN ideal-int +pkg syscall (netbsd-amd64), const SYS_FCHOWNAT ideal-int +pkg syscall (netbsd-amd64), const SYS_FCHROOT ideal-int +pkg syscall (netbsd-amd64), const SYS_FCNTL ideal-int +pkg syscall (netbsd-amd64), const SYS_FDATASYNC ideal-int +pkg syscall (netbsd-amd64), const SYS_FEXECVE ideal-int +pkg syscall (netbsd-amd64), const SYS_FGETXATTR ideal-int +pkg syscall (netbsd-amd64), const SYS_FHSTAT ideal-int +pkg syscall (netbsd-amd64), const SYS_FKTRACE ideal-int +pkg syscall (netbsd-amd64), const SYS_FLISTXATTR ideal-int +pkg syscall (netbsd-amd64), const SYS_FLOCK ideal-int +pkg syscall (netbsd-amd64), const SYS_FORK ideal-int +pkg syscall (netbsd-amd64), const SYS_FPATHCONF ideal-int +pkg syscall (netbsd-amd64), const SYS_FREMOVEXATTR ideal-int +pkg syscall (netbsd-amd64), const SYS_FSETXATTR ideal-int +pkg syscall (netbsd-amd64), const SYS_FSTAT ideal-int +pkg syscall (netbsd-amd64), const SYS_FSTATAT ideal-int +pkg syscall (netbsd-amd64), const SYS_FSTATVFS1 ideal-int +pkg syscall (netbsd-amd64), const SYS_FSYNC ideal-int +pkg syscall (netbsd-amd64), const SYS_FSYNC_RANGE ideal-int +pkg syscall (netbsd-amd64), const SYS_FTRUNCATE ideal-int +pkg syscall (netbsd-amd64), const SYS_FUTIMENS ideal-int +pkg syscall (netbsd-amd64), const SYS_FUTIMES ideal-int +pkg syscall (netbsd-amd64), const SYS_GETCONTEXT ideal-int +pkg syscall (netbsd-amd64), const SYS_GETDENTS ideal-int +pkg syscall (netbsd-amd64), const SYS_GETEGID ideal-int +pkg syscall (netbsd-amd64), const SYS_GETEUID ideal-int +pkg syscall (netbsd-amd64), const SYS_GETFH ideal-int +pkg syscall (netbsd-amd64), const SYS_GETGID ideal-int +pkg syscall (netbsd-amd64), const SYS_GETGROUPS ideal-int +pkg syscall (netbsd-amd64), const SYS_GETITIMER ideal-int +pkg syscall (netbsd-amd64), const SYS_GETPEERNAME ideal-int +pkg syscall (netbsd-amd64), const SYS_GETPGID ideal-int +pkg syscall (netbsd-amd64), const SYS_GETPGRP ideal-int +pkg syscall (netbsd-amd64), const SYS_GETPID ideal-int +pkg syscall (netbsd-amd64), const SYS_GETPPID ideal-int +pkg syscall (netbsd-amd64), const SYS_GETPRIORITY ideal-int +pkg syscall (netbsd-amd64), const SYS_GETRLIMIT ideal-int +pkg syscall (netbsd-amd64), const SYS_GETRUSAGE ideal-int +pkg syscall (netbsd-amd64), const SYS_GETSID ideal-int +pkg syscall (netbsd-amd64), const SYS_GETSOCKNAME ideal-int +pkg syscall (netbsd-amd64), const SYS_GETSOCKOPT ideal-int +pkg syscall (netbsd-amd64), const SYS_GETTIMEOFDAY ideal-int +pkg syscall (netbsd-amd64), const SYS_GETUID ideal-int +pkg syscall (netbsd-amd64), const SYS_GETVFSSTAT ideal-int +pkg syscall (netbsd-amd64), const SYS_GETXATTR ideal-int +pkg syscall (netbsd-amd64), const SYS_IOCTL ideal-int +pkg syscall (netbsd-amd64), const SYS_ISSETUGID ideal-int +pkg syscall (netbsd-amd64), const SYS_KEVENT ideal-int +pkg syscall (netbsd-amd64), const SYS_KILL ideal-int +pkg syscall (netbsd-amd64), const SYS_KQUEUE ideal-int +pkg syscall (netbsd-amd64), const SYS_KQUEUE1 ideal-int +pkg syscall (netbsd-amd64), const SYS_KTRACE ideal-int +pkg syscall (netbsd-amd64), const SYS_LCHFLAGS ideal-int +pkg syscall (netbsd-amd64), const SYS_LCHMOD ideal-int +pkg syscall (netbsd-amd64), const SYS_LCHOWN ideal-int +pkg syscall (netbsd-amd64), const SYS_LGETXATTR ideal-int +pkg syscall (netbsd-amd64), const SYS_LINK ideal-int +pkg syscall (netbsd-amd64), const SYS_LINKAT ideal-int +pkg syscall (netbsd-amd64), const SYS_LISTEN ideal-int +pkg syscall (netbsd-amd64), const SYS_LISTXATTR ideal-int +pkg syscall (netbsd-amd64), const SYS_LLISTXATTR ideal-int +pkg syscall (netbsd-amd64), const SYS_LREMOVEXATTR ideal-int +pkg syscall (netbsd-amd64), const SYS_LSEEK ideal-int +pkg syscall (netbsd-amd64), const SYS_LSETXATTR ideal-int +pkg syscall (netbsd-amd64), const SYS_LSTAT ideal-int +pkg syscall (netbsd-amd64), const SYS_LUTIMES ideal-int +pkg syscall (netbsd-amd64), const SYS_MADVISE ideal-int +pkg syscall (netbsd-amd64), const SYS_MINCORE ideal-int +pkg syscall (netbsd-amd64), const SYS_MINHERIT ideal-int +pkg syscall (netbsd-amd64), const SYS_MKDIR ideal-int +pkg syscall (netbsd-amd64), const SYS_MKDIRAT ideal-int +pkg syscall (netbsd-amd64), const SYS_MKFIFO ideal-int +pkg syscall (netbsd-amd64), const SYS_MKFIFOAT ideal-int +pkg syscall (netbsd-amd64), const SYS_MKNOD ideal-int +pkg syscall (netbsd-amd64), const SYS_MKNODAT ideal-int +pkg syscall (netbsd-amd64), const SYS_MLOCK ideal-int +pkg syscall (netbsd-amd64), const SYS_MLOCKALL ideal-int +pkg syscall (netbsd-amd64), const SYS_MMAP ideal-int +pkg syscall (netbsd-amd64), const SYS_MODCTL ideal-int +pkg syscall (netbsd-amd64), const SYS_MOUNT ideal-int +pkg syscall (netbsd-amd64), const SYS_MPROTECT ideal-int +pkg syscall (netbsd-amd64), const SYS_MREMAP ideal-int +pkg syscall (netbsd-amd64), const SYS_MSGCTL ideal-int +pkg syscall (netbsd-amd64), const SYS_MSGGET ideal-int +pkg syscall (netbsd-amd64), const SYS_MSGRCV ideal-int +pkg syscall (netbsd-amd64), const SYS_MSGSND ideal-int +pkg syscall (netbsd-amd64), const SYS_MUNLOCK ideal-int +pkg syscall (netbsd-amd64), const SYS_MUNLOCKALL ideal-int +pkg syscall (netbsd-amd64), const SYS_MUNMAP ideal-int +pkg syscall (netbsd-amd64), const SYS_NANOSLEEP ideal-int +pkg syscall (netbsd-amd64), const SYS_NTP_ADJTIME ideal-int +pkg syscall (netbsd-amd64), const SYS_NTP_GETTIME ideal-int +pkg syscall (netbsd-amd64), const SYS_OPEN ideal-int +pkg syscall (netbsd-amd64), const SYS_OPENAT ideal-int +pkg syscall (netbsd-amd64), const SYS_PACCEPT ideal-int +pkg syscall (netbsd-amd64), const SYS_PATHCONF ideal-int +pkg syscall (netbsd-amd64), const SYS_PIPE ideal-int +pkg syscall (netbsd-amd64), const SYS_PIPE2 ideal-int +pkg syscall (netbsd-amd64), const SYS_PMC_CONTROL ideal-int +pkg syscall (netbsd-amd64), const SYS_PMC_GET_INFO ideal-int +pkg syscall (netbsd-amd64), const SYS_POLL ideal-int +pkg syscall (netbsd-amd64), const SYS_POLLTS ideal-int +pkg syscall (netbsd-amd64), const SYS_POSIX_FADVISE ideal-int +pkg syscall (netbsd-amd64), const SYS_POSIX_SPAWN ideal-int +pkg syscall (netbsd-amd64), const SYS_PREAD ideal-int +pkg syscall (netbsd-amd64), const SYS_PREADV ideal-int +pkg syscall (netbsd-amd64), const SYS_PROFIL ideal-int +pkg syscall (netbsd-amd64), const SYS_PSELECT ideal-int +pkg syscall (netbsd-amd64), const SYS_PSET_ASSIGN ideal-int +pkg syscall (netbsd-amd64), const SYS_PSET_CREATE ideal-int +pkg syscall (netbsd-amd64), const SYS_PSET_DESTROY ideal-int +pkg syscall (netbsd-amd64), const SYS_PTRACE ideal-int +pkg syscall (netbsd-amd64), const SYS_PWRITE ideal-int +pkg syscall (netbsd-amd64), const SYS_PWRITEV ideal-int +pkg syscall (netbsd-amd64), const SYS_RASCTL ideal-int +pkg syscall (netbsd-amd64), const SYS_READ ideal-int +pkg syscall (netbsd-amd64), const SYS_READLINK ideal-int +pkg syscall (netbsd-amd64), const SYS_READLINKAT ideal-int +pkg syscall (netbsd-amd64), const SYS_READV ideal-int +pkg syscall (netbsd-amd64), const SYS_REBOOT ideal-int +pkg syscall (netbsd-amd64), const SYS_RECVFROM ideal-int +pkg syscall (netbsd-amd64), const SYS_RECVMMSG ideal-int +pkg syscall (netbsd-amd64), const SYS_RECVMSG ideal-int +pkg syscall (netbsd-amd64), const SYS_REMOVEXATTR ideal-int +pkg syscall (netbsd-amd64), const SYS_RENAME ideal-int +pkg syscall (netbsd-amd64), const SYS_RENAMEAT ideal-int +pkg syscall (netbsd-amd64), const SYS_REVOKE ideal-int +pkg syscall (netbsd-amd64), const SYS_RMDIR ideal-int +pkg syscall (netbsd-amd64), const SYS_SBRK ideal-int +pkg syscall (netbsd-amd64), const SYS_SCHED_YIELD ideal-int +pkg syscall (netbsd-amd64), const SYS_SELECT ideal-int +pkg syscall (netbsd-amd64), const SYS_SEMCONFIG ideal-int +pkg syscall (netbsd-amd64), const SYS_SEMGET ideal-int +pkg syscall (netbsd-amd64), const SYS_SEMOP ideal-int +pkg syscall (netbsd-amd64), const SYS_SENDMMSG ideal-int +pkg syscall (netbsd-amd64), const SYS_SENDMSG ideal-int +pkg syscall (netbsd-amd64), const SYS_SENDTO ideal-int +pkg syscall (netbsd-amd64), const SYS_SETCONTEXT ideal-int +pkg syscall (netbsd-amd64), const SYS_SETEGID ideal-int +pkg syscall (netbsd-amd64), const SYS_SETEUID ideal-int +pkg syscall (netbsd-amd64), const SYS_SETGID ideal-int +pkg syscall (netbsd-amd64), const SYS_SETGROUPS ideal-int +pkg syscall (netbsd-amd64), const SYS_SETITIMER ideal-int +pkg syscall (netbsd-amd64), const SYS_SETPGID ideal-int +pkg syscall (netbsd-amd64), const SYS_SETPRIORITY ideal-int +pkg syscall (netbsd-amd64), const SYS_SETREGID ideal-int +pkg syscall (netbsd-amd64), const SYS_SETREUID ideal-int +pkg syscall (netbsd-amd64), const SYS_SETRLIMIT ideal-int +pkg syscall (netbsd-amd64), const SYS_SETSID ideal-int +pkg syscall (netbsd-amd64), const SYS_SETSOCKOPT ideal-int +pkg syscall (netbsd-amd64), const SYS_SETTIMEOFDAY ideal-int +pkg syscall (netbsd-amd64), const SYS_SETUID ideal-int +pkg syscall (netbsd-amd64), const SYS_SETXATTR ideal-int +pkg syscall (netbsd-amd64), const SYS_SHMAT ideal-int +pkg syscall (netbsd-amd64), const SYS_SHMCTL ideal-int +pkg syscall (netbsd-amd64), const SYS_SHMDT ideal-int +pkg syscall (netbsd-amd64), const SYS_SHMGET ideal-int +pkg syscall (netbsd-amd64), const SYS_SHUTDOWN ideal-int +pkg syscall (netbsd-amd64), const SYS_SIGQUEUEINFO ideal-int +pkg syscall (netbsd-amd64), const SYS_SOCKET ideal-int +pkg syscall (netbsd-amd64), const SYS_SOCKETPAIR ideal-int +pkg syscall (netbsd-amd64), const SYS_SSTK ideal-int +pkg syscall (netbsd-amd64), const SYS_STAT ideal-int +pkg syscall (netbsd-amd64), const SYS_STATVFS1 ideal-int +pkg syscall (netbsd-amd64), const SYS_SWAPCTL ideal-int +pkg syscall (netbsd-amd64), const SYS_SYMLINK ideal-int +pkg syscall (netbsd-amd64), const SYS_SYMLINKAT ideal-int +pkg syscall (netbsd-amd64), const SYS_SYNC ideal-int +pkg syscall (netbsd-amd64), const SYS_SYSARCH ideal-int +pkg syscall (netbsd-amd64), const SYS_TIMER_CREATE ideal-int +pkg syscall (netbsd-amd64), const SYS_TIMER_DELETE ideal-int +pkg syscall (netbsd-amd64), const SYS_TIMER_GETOVERRUN ideal-int +pkg syscall (netbsd-amd64), const SYS_TIMER_GETTIME ideal-int +pkg syscall (netbsd-amd64), const SYS_TIMER_SETTIME ideal-int +pkg syscall (netbsd-amd64), const SYS_TRUNCATE ideal-int +pkg syscall (netbsd-amd64), const SYS_UMASK ideal-int +pkg syscall (netbsd-amd64), const SYS_UNDELETE ideal-int +pkg syscall (netbsd-amd64), const SYS_UNLINK ideal-int +pkg syscall (netbsd-amd64), const SYS_UNLINKAT ideal-int +pkg syscall (netbsd-amd64), const SYS_UNMOUNT ideal-int +pkg syscall (netbsd-amd64), const SYS_UTIMENSAT ideal-int +pkg syscall (netbsd-amd64), const SYS_UTIMES ideal-int +pkg syscall (netbsd-amd64), const SYS_UTRACE ideal-int +pkg syscall (netbsd-amd64), const SYS_UUIDGEN ideal-int +pkg syscall (netbsd-amd64), const SYS_VADVISE ideal-int +pkg syscall (netbsd-amd64), const SYS_VFORK ideal-int +pkg syscall (netbsd-amd64), const SYS_WAIT4 ideal-int +pkg syscall (netbsd-amd64), const SYS_WRITE ideal-int +pkg syscall (netbsd-amd64), const SYS_WRITEV ideal-int +pkg syscall (netbsd-amd64), const SYS__LWP_CONTINUE ideal-int +pkg syscall (netbsd-amd64), const SYS__LWP_CREATE ideal-int +pkg syscall (netbsd-amd64), const SYS__LWP_CTL ideal-int +pkg syscall (netbsd-amd64), const SYS__LWP_DETACH ideal-int +pkg syscall (netbsd-amd64), const SYS__LWP_EXIT ideal-int +pkg syscall (netbsd-amd64), const SYS__LWP_GETNAME ideal-int +pkg syscall (netbsd-amd64), const SYS__LWP_GETPRIVATE ideal-int +pkg syscall (netbsd-amd64), const SYS__LWP_KILL ideal-int +pkg syscall (netbsd-amd64), const SYS__LWP_PARK ideal-int +pkg syscall (netbsd-amd64), const SYS__LWP_SELF ideal-int +pkg syscall (netbsd-amd64), const SYS__LWP_SETNAME ideal-int +pkg syscall (netbsd-amd64), const SYS__LWP_SETPRIVATE ideal-int +pkg syscall (netbsd-amd64), const SYS__LWP_SUSPEND ideal-int +pkg syscall (netbsd-amd64), const SYS__LWP_UNPARK ideal-int +pkg syscall (netbsd-amd64), const SYS__LWP_UNPARK_ALL ideal-int +pkg syscall (netbsd-amd64), const SYS__LWP_WAIT ideal-int +pkg syscall (netbsd-amd64), const SYS__LWP_WAKEUP ideal-int +pkg syscall (netbsd-amd64), const SYS__PSET_BIND ideal-int +pkg syscall (netbsd-amd64), const SYS__SCHED_GETAFFINITY ideal-int +pkg syscall (netbsd-amd64), const SYS__SCHED_GETPARAM ideal-int +pkg syscall (netbsd-amd64), const SYS__SCHED_SETAFFINITY ideal-int +pkg syscall (netbsd-amd64), const SYS__SCHED_SETPARAM ideal-int +pkg syscall (netbsd-amd64), const SYS___CLONE ideal-int +pkg syscall (netbsd-amd64), const SYS___GETCWD ideal-int +pkg syscall (netbsd-amd64), const SYS___GETLOGIN ideal-int +pkg syscall (netbsd-amd64), const SYS___POSIX_CHOWN ideal-int +pkg syscall (netbsd-amd64), const SYS___POSIX_FCHOWN ideal-int +pkg syscall (netbsd-amd64), const SYS___POSIX_LCHOWN ideal-int +pkg syscall (netbsd-amd64), const SYS___POSIX_RENAME ideal-int +pkg syscall (netbsd-amd64), const SYS___QUOTACTL ideal-int +pkg syscall (netbsd-amd64), const SYS___SEMCTL ideal-int +pkg syscall (netbsd-amd64), const SYS___SETLOGIN ideal-int +pkg syscall (netbsd-amd64), const SYS___SIGACTION_SIGTRAMP ideal-int +pkg syscall (netbsd-amd64), const SYS___SIGTIMEDWAIT ideal-int +pkg syscall (netbsd-amd64), const SYS___SYSCTL ideal-int +pkg syscall (netbsd-amd64), const S_ARCH1 ideal-int +pkg syscall (netbsd-amd64), const S_ARCH2 ideal-int +pkg syscall (netbsd-amd64), const S_BLKSIZE ideal-int +pkg syscall (netbsd-amd64), const S_IEXEC ideal-int +pkg syscall (netbsd-amd64), const S_IFWHT ideal-int +pkg syscall (netbsd-amd64), const S_IREAD ideal-int +pkg syscall (netbsd-amd64), const S_IRGRP ideal-int +pkg syscall (netbsd-amd64), const S_IROTH ideal-int +pkg syscall (netbsd-amd64), const S_IRWXG ideal-int +pkg syscall (netbsd-amd64), const S_IRWXO ideal-int +pkg syscall (netbsd-amd64), const S_IRWXU ideal-int +pkg syscall (netbsd-amd64), const S_ISTXT ideal-int +pkg syscall (netbsd-amd64), const S_IWGRP ideal-int +pkg syscall (netbsd-amd64), const S_IWOTH ideal-int +pkg syscall (netbsd-amd64), const S_IWRITE ideal-int +pkg syscall (netbsd-amd64), const S_IXGRP ideal-int +pkg syscall (netbsd-amd64), const S_IXOTH ideal-int +pkg syscall (netbsd-amd64), const S_LOGIN_SET ideal-int +pkg syscall (netbsd-amd64), const SizeofBpfHdr ideal-int +pkg syscall (netbsd-amd64), const SizeofBpfInsn ideal-int +pkg syscall (netbsd-amd64), const SizeofBpfProgram ideal-int +pkg syscall (netbsd-amd64), const SizeofBpfStat ideal-int +pkg syscall (netbsd-amd64), const SizeofBpfVersion ideal-int +pkg syscall (netbsd-amd64), const SizeofCmsghdr ideal-int +pkg syscall (netbsd-amd64), const SizeofICMPv6Filter = 32 +pkg syscall (netbsd-amd64), const SizeofICMPv6Filter ideal-int +pkg syscall (netbsd-amd64), const SizeofIPMreq ideal-int +pkg syscall (netbsd-amd64), const SizeofIPv6MTUInfo = 32 +pkg syscall (netbsd-amd64), const SizeofIPv6MTUInfo ideal-int +pkg syscall (netbsd-amd64), const SizeofIPv6Mreq ideal-int +pkg syscall (netbsd-amd64), const SizeofIfAnnounceMsghdr ideal-int +pkg syscall (netbsd-amd64), const SizeofIfData ideal-int +pkg syscall (netbsd-amd64), const SizeofIfMsghdr ideal-int +pkg syscall (netbsd-amd64), const SizeofIfaMsghdr ideal-int +pkg syscall (netbsd-amd64), const SizeofInet6Pktinfo ideal-int +pkg syscall (netbsd-amd64), const SizeofLinger ideal-int +pkg syscall (netbsd-amd64), const SizeofMsghdr ideal-int +pkg syscall (netbsd-amd64), const SizeofRtMetrics ideal-int +pkg syscall (netbsd-amd64), const SizeofRtMsghdr ideal-int +pkg syscall (netbsd-amd64), const SizeofSockaddrAny ideal-int +pkg syscall (netbsd-amd64), const SizeofSockaddrDatalink ideal-int +pkg syscall (netbsd-amd64), const SizeofSockaddrInet4 ideal-int +pkg syscall (netbsd-amd64), const SizeofSockaddrInet6 ideal-int +pkg syscall (netbsd-amd64), const SizeofSockaddrUnix ideal-int +pkg syscall (netbsd-amd64), const TCIFLUSH ideal-int +pkg syscall (netbsd-amd64), const TCIOFLUSH ideal-int +pkg syscall (netbsd-amd64), const TCOFLUSH ideal-int +pkg syscall (netbsd-amd64), const TCP_CONGCTL ideal-int +pkg syscall (netbsd-amd64), const TCP_KEEPCNT ideal-int +pkg syscall (netbsd-amd64), const TCP_KEEPIDLE ideal-int +pkg syscall (netbsd-amd64), const TCP_KEEPINIT ideal-int +pkg syscall (netbsd-amd64), const TCP_KEEPINTVL ideal-int +pkg syscall (netbsd-amd64), const TCP_MAXBURST ideal-int +pkg syscall (netbsd-amd64), const TCP_MAXSEG ideal-int +pkg syscall (netbsd-amd64), const TCP_MAXWIN ideal-int +pkg syscall (netbsd-amd64), const TCP_MAX_WINSHIFT ideal-int +pkg syscall (netbsd-amd64), const TCP_MD5SIG ideal-int +pkg syscall (netbsd-amd64), const TCP_MINMSS ideal-int +pkg syscall (netbsd-amd64), const TCP_MSS ideal-int +pkg syscall (netbsd-amd64), const TCSAFLUSH ideal-int +pkg syscall (netbsd-amd64), const TIOCCBRK ideal-int +pkg syscall (netbsd-amd64), const TIOCCDTR ideal-int +pkg syscall (netbsd-amd64), const TIOCCONS ideal-int +pkg syscall (netbsd-amd64), const TIOCDCDTIMESTAMP ideal-int +pkg syscall (netbsd-amd64), const TIOCDRAIN ideal-int +pkg syscall (netbsd-amd64), const TIOCEXCL ideal-int +pkg syscall (netbsd-amd64), const TIOCEXT ideal-int +pkg syscall (netbsd-amd64), const TIOCFLAG_CDTRCTS ideal-int +pkg syscall (netbsd-amd64), const TIOCFLAG_CLOCAL ideal-int +pkg syscall (netbsd-amd64), const TIOCFLAG_CRTSCTS ideal-int +pkg syscall (netbsd-amd64), const TIOCFLAG_MDMBUF ideal-int +pkg syscall (netbsd-amd64), const TIOCFLAG_SOFTCAR ideal-int +pkg syscall (netbsd-amd64), const TIOCFLUSH ideal-int +pkg syscall (netbsd-amd64), const TIOCGETA ideal-int +pkg syscall (netbsd-amd64), const TIOCGETD ideal-int +pkg syscall (netbsd-amd64), const TIOCGFLAGS ideal-int +pkg syscall (netbsd-amd64), const TIOCGLINED ideal-int +pkg syscall (netbsd-amd64), const TIOCGPGRP ideal-int +pkg syscall (netbsd-amd64), const TIOCGQSIZE ideal-int +pkg syscall (netbsd-amd64), const TIOCGRANTPT ideal-int +pkg syscall (netbsd-amd64), const TIOCGSID ideal-int +pkg syscall (netbsd-amd64), const TIOCGSIZE ideal-int +pkg syscall (netbsd-amd64), const TIOCGWINSZ ideal-int +pkg syscall (netbsd-amd64), const TIOCMBIC ideal-int +pkg syscall (netbsd-amd64), const TIOCMBIS ideal-int +pkg syscall (netbsd-amd64), const TIOCMGET ideal-int +pkg syscall (netbsd-amd64), const TIOCMSET ideal-int +pkg syscall (netbsd-amd64), const TIOCM_CAR ideal-int +pkg syscall (netbsd-amd64), const TIOCM_CD ideal-int +pkg syscall (netbsd-amd64), const TIOCM_CTS ideal-int +pkg syscall (netbsd-amd64), const TIOCM_DSR ideal-int +pkg syscall (netbsd-amd64), const TIOCM_DTR ideal-int +pkg syscall (netbsd-amd64), const TIOCM_LE ideal-int +pkg syscall (netbsd-amd64), const TIOCM_RI ideal-int +pkg syscall (netbsd-amd64), const TIOCM_RNG ideal-int +pkg syscall (netbsd-amd64), const TIOCM_RTS ideal-int +pkg syscall (netbsd-amd64), const TIOCM_SR ideal-int +pkg syscall (netbsd-amd64), const TIOCM_ST ideal-int +pkg syscall (netbsd-amd64), const TIOCNOTTY ideal-int +pkg syscall (netbsd-amd64), const TIOCNXCL ideal-int +pkg syscall (netbsd-amd64), const TIOCOUTQ ideal-int +pkg syscall (netbsd-amd64), const TIOCPKT ideal-int +pkg syscall (netbsd-amd64), const TIOCPKT_DATA ideal-int +pkg syscall (netbsd-amd64), const TIOCPKT_DOSTOP ideal-int +pkg syscall (netbsd-amd64), const TIOCPKT_FLUSHREAD ideal-int +pkg syscall (netbsd-amd64), const TIOCPKT_FLUSHWRITE ideal-int +pkg syscall (netbsd-amd64), const TIOCPKT_IOCTL ideal-int +pkg syscall (netbsd-amd64), const TIOCPKT_NOSTOP ideal-int +pkg syscall (netbsd-amd64), const TIOCPKT_START ideal-int +pkg syscall (netbsd-amd64), const TIOCPKT_STOP ideal-int +pkg syscall (netbsd-amd64), const TIOCPTMGET ideal-int +pkg syscall (netbsd-amd64), const TIOCPTSNAME ideal-int +pkg syscall (netbsd-amd64), const TIOCRCVFRAME ideal-int +pkg syscall (netbsd-amd64), const TIOCREMOTE ideal-int +pkg syscall (netbsd-amd64), const TIOCSBRK ideal-int +pkg syscall (netbsd-amd64), const TIOCSCTTY ideal-int +pkg syscall (netbsd-amd64), const TIOCSDTR ideal-int +pkg syscall (netbsd-amd64), const TIOCSETA ideal-int +pkg syscall (netbsd-amd64), const TIOCSETAF ideal-int +pkg syscall (netbsd-amd64), const TIOCSETAW ideal-int +pkg syscall (netbsd-amd64), const TIOCSETD ideal-int +pkg syscall (netbsd-amd64), const TIOCSFLAGS ideal-int +pkg syscall (netbsd-amd64), const TIOCSIG ideal-int +pkg syscall (netbsd-amd64), const TIOCSLINED ideal-int +pkg syscall (netbsd-amd64), const TIOCSPGRP ideal-int +pkg syscall (netbsd-amd64), const TIOCSQSIZE ideal-int +pkg syscall (netbsd-amd64), const TIOCSSIZE ideal-int +pkg syscall (netbsd-amd64), const TIOCSTART ideal-int +pkg syscall (netbsd-amd64), const TIOCSTAT ideal-int +pkg syscall (netbsd-amd64), const TIOCSTI ideal-int +pkg syscall (netbsd-amd64), const TIOCSTOP ideal-int +pkg syscall (netbsd-amd64), const TIOCSWINSZ ideal-int +pkg syscall (netbsd-amd64), const TIOCUCNTL ideal-int +pkg syscall (netbsd-amd64), const TIOCXMTFRAME ideal-int +pkg syscall (netbsd-amd64), const TOSTOP ideal-int +pkg syscall (netbsd-amd64), const VDISCARD ideal-int +pkg syscall (netbsd-amd64), const VDSUSP ideal-int +pkg syscall (netbsd-amd64), const VEOF ideal-int +pkg syscall (netbsd-amd64), const VEOL ideal-int +pkg syscall (netbsd-amd64), const VEOL2 ideal-int +pkg syscall (netbsd-amd64), const VERASE ideal-int +pkg syscall (netbsd-amd64), const VINTR ideal-int +pkg syscall (netbsd-amd64), const VKILL ideal-int +pkg syscall (netbsd-amd64), const VLNEXT ideal-int +pkg syscall (netbsd-amd64), const VMIN ideal-int +pkg syscall (netbsd-amd64), const VQUIT ideal-int +pkg syscall (netbsd-amd64), const VREPRINT ideal-int +pkg syscall (netbsd-amd64), const VSTART ideal-int +pkg syscall (netbsd-amd64), const VSTATUS ideal-int +pkg syscall (netbsd-amd64), const VSTOP ideal-int +pkg syscall (netbsd-amd64), const VSUSP ideal-int +pkg syscall (netbsd-amd64), const VTIME ideal-int +pkg syscall (netbsd-amd64), const VWERASE ideal-int +pkg syscall (netbsd-amd64), const WALL ideal-int +pkg syscall (netbsd-amd64), const WALLSIG ideal-int +pkg syscall (netbsd-amd64), const WALTSIG ideal-int +pkg syscall (netbsd-amd64), const WCLONE ideal-int +pkg syscall (netbsd-amd64), const WCOREFLAG ideal-int +pkg syscall (netbsd-amd64), const WNOHANG ideal-int +pkg syscall (netbsd-amd64), const WNOWAIT ideal-int +pkg syscall (netbsd-amd64), const WNOZOMBIE ideal-int +pkg syscall (netbsd-amd64), const WOPTSCHECKED ideal-int +pkg syscall (netbsd-amd64), const WSTOPPED ideal-int +pkg syscall (netbsd-amd64), const WUNTRACED ideal-int +pkg syscall (netbsd-amd64), func Accept(int) (int, Sockaddr, error) +pkg syscall (netbsd-amd64), func Access(string, uint32) error +pkg syscall (netbsd-amd64), func Adjtime(*Timeval, *Timeval) error +pkg syscall (netbsd-amd64), func Bind(int, Sockaddr) error +pkg syscall (netbsd-amd64), func BpfBuflen(int) (int, error) +pkg syscall (netbsd-amd64), func BpfDatalink(int) (int, error) +pkg syscall (netbsd-amd64), func BpfHeadercmpl(int) (int, error) +pkg syscall (netbsd-amd64), func BpfInterface(int, string) (string, error) +pkg syscall (netbsd-amd64), func BpfJump(int, int, int, int) *BpfInsn +pkg syscall (netbsd-amd64), func BpfStats(int) (*BpfStat, error) +pkg syscall (netbsd-amd64), func BpfStmt(int, int) *BpfInsn +pkg syscall (netbsd-amd64), func BpfTimeout(int) (*Timeval, error) +pkg syscall (netbsd-amd64), func CheckBpfVersion(int) error +pkg syscall (netbsd-amd64), func Chflags(string, int) error +pkg syscall (netbsd-amd64), func Chroot(string) error +pkg syscall (netbsd-amd64), func Close(int) error +pkg syscall (netbsd-amd64), func CloseOnExec(int) +pkg syscall (netbsd-amd64), func CmsgLen(int) int +pkg syscall (netbsd-amd64), func CmsgSpace(int) int +pkg syscall (netbsd-amd64), func Connect(int, Sockaddr) error +pkg syscall (netbsd-amd64), func Dup(int) (int, error) +pkg syscall (netbsd-amd64), func Dup2(int, int) error +pkg syscall (netbsd-amd64), func Fchdir(int) error +pkg syscall (netbsd-amd64), func Fchflags(int, int) error +pkg syscall (netbsd-amd64), func Fchmod(int, uint32) error +pkg syscall (netbsd-amd64), func Fchown(int, int, int) error +pkg syscall (netbsd-amd64), func Flock(int, int) error +pkg syscall (netbsd-amd64), func FlushBpf(int) error +pkg syscall (netbsd-amd64), func ForkExec(string, []string, *ProcAttr) (int, error) +pkg syscall (netbsd-amd64), func Fpathconf(int, int) (int, error) +pkg syscall (netbsd-amd64), func Fstat(int, *Stat_t) error +pkg syscall (netbsd-amd64), func Fsync(int) error +pkg syscall (netbsd-amd64), func Ftruncate(int, int64) error +pkg syscall (netbsd-amd64), func Futimes(int, []Timeval) error +pkg syscall (netbsd-amd64), func Getdirentries(int, []uint8, *uintptr) (int, error) +pkg syscall (netbsd-amd64), func Getpeername(int) (Sockaddr, error) +pkg syscall (netbsd-amd64), func Getpgid(int) (int, error) +pkg syscall (netbsd-amd64), func Getpgrp() int +pkg syscall (netbsd-amd64), func Getpriority(int, int) (int, error) +pkg syscall (netbsd-amd64), func Getrlimit(int, *Rlimit) error +pkg syscall (netbsd-amd64), func Getrusage(int, *Rusage) error +pkg syscall (netbsd-amd64), func Getsid(int) (int, error) +pkg syscall (netbsd-amd64), func Getsockname(int) (Sockaddr, error) +pkg syscall (netbsd-amd64), func GetsockoptByte(int, int, int) (uint8, error) +pkg syscall (netbsd-amd64), func GetsockoptICMPv6Filter(int, int, int) (*ICMPv6Filter, error) +pkg syscall (netbsd-amd64), func GetsockoptIPMreq(int, int, int) (*IPMreq, error) +pkg syscall (netbsd-amd64), func GetsockoptIPv6MTUInfo(int, int, int) (*IPv6MTUInfo, error) +pkg syscall (netbsd-amd64), func GetsockoptIPv6Mreq(int, int, int) (*IPv6Mreq, error) +pkg syscall (netbsd-amd64), func GetsockoptInet4Addr(int, int, int) ([4]uint8, error) +pkg syscall (netbsd-amd64), func GetsockoptInt(int, int, int) (int, error) +pkg syscall (netbsd-amd64), func Issetugid() bool +pkg syscall (netbsd-amd64), func Kevent(int, []Kevent_t, []Kevent_t, *Timespec) (int, error) +pkg syscall (netbsd-amd64), func Kill(int, Signal) error +pkg syscall (netbsd-amd64), func Kqueue() (int, error) +pkg syscall (netbsd-amd64), func Listen(int, int) error +pkg syscall (netbsd-amd64), func Lstat(string, *Stat_t) error +pkg syscall (netbsd-amd64), func Mkfifo(string, uint32) error +pkg syscall (netbsd-amd64), func Mknod(string, uint32, int) error +pkg syscall (netbsd-amd64), func Mmap(int, int64, int, int, int) ([]uint8, error) +pkg syscall (netbsd-amd64), func Munmap([]uint8) error +pkg syscall (netbsd-amd64), func Nanosleep(*Timespec, *Timespec) error +pkg syscall (netbsd-amd64), func Open(string, int, uint32) (int, error) +pkg syscall (netbsd-amd64), func ParseDirent([]uint8, int, []string) (int, int, []string) +pkg syscall (netbsd-amd64), func ParseRoutingMessage([]uint8) ([]RoutingMessage, error) +pkg syscall (netbsd-amd64), func ParseRoutingSockaddr(RoutingMessage) ([]Sockaddr, error) +pkg syscall (netbsd-amd64), func ParseSocketControlMessage([]uint8) ([]SocketControlMessage, error) +pkg syscall (netbsd-amd64), func ParseUnixRights(*SocketControlMessage) ([]int, error) +pkg syscall (netbsd-amd64), func Pathconf(string, int) (int, error) +pkg syscall (netbsd-amd64), func Pipe([]int) error +pkg syscall (netbsd-amd64), func Pread(int, []uint8, int64) (int, error) +pkg syscall (netbsd-amd64), func Pwrite(int, []uint8, int64) (int, error) +pkg syscall (netbsd-amd64), func RawSyscall(uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno) +pkg syscall (netbsd-amd64), func RawSyscall6(uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno) +pkg syscall (netbsd-amd64), func Read(int, []uint8) (int, error) +pkg syscall (netbsd-amd64), func ReadDirent(int, []uint8) (int, error) +pkg syscall (netbsd-amd64), func Recvfrom(int, []uint8, int) (int, Sockaddr, error) +pkg syscall (netbsd-amd64), func Recvmsg(int, []uint8, []uint8, int) (int, int, int, Sockaddr, error) +pkg syscall (netbsd-amd64), func Revoke(string) error +pkg syscall (netbsd-amd64), func RouteRIB(int, int) ([]uint8, error) +pkg syscall (netbsd-amd64), func Seek(int, int64, int) (int64, error) +pkg syscall (netbsd-amd64), func Select(int, *FdSet, *FdSet, *FdSet, *Timeval) error +pkg syscall (netbsd-amd64), func Sendfile(int, int, *int64, int) (int, error) +pkg syscall (netbsd-amd64), func Sendmsg(int, []uint8, []uint8, Sockaddr, int) error +pkg syscall (netbsd-amd64), func Sendto(int, []uint8, int, Sockaddr) error +pkg syscall (netbsd-amd64), func SetBpf(int, []BpfInsn) error +pkg syscall (netbsd-amd64), func SetBpfBuflen(int, int) (int, error) +pkg syscall (netbsd-amd64), func SetBpfDatalink(int, int) (int, error) +pkg syscall (netbsd-amd64), func SetBpfHeadercmpl(int, int) error +pkg syscall (netbsd-amd64), func SetBpfImmediate(int, int) error +pkg syscall (netbsd-amd64), func SetBpfInterface(int, string) error +pkg syscall (netbsd-amd64), func SetBpfPromisc(int, int) error +pkg syscall (netbsd-amd64), func SetBpfTimeout(int, *Timeval) error +pkg syscall (netbsd-amd64), func SetKevent(*Kevent_t, int, int, int) +pkg syscall (netbsd-amd64), func SetNonblock(int, bool) error +pkg syscall (netbsd-amd64), func Setegid(int) error +pkg syscall (netbsd-amd64), func Seteuid(int) error +pkg syscall (netbsd-amd64), func Setgid(int) error +pkg syscall (netbsd-amd64), func Setgroups([]int) error +pkg syscall (netbsd-amd64), func Setpgid(int, int) error +pkg syscall (netbsd-amd64), func Setpriority(int, int, int) error +pkg syscall (netbsd-amd64), func Setregid(int, int) error +pkg syscall (netbsd-amd64), func Setreuid(int, int) error +pkg syscall (netbsd-amd64), func Setrlimit(int, *Rlimit) error +pkg syscall (netbsd-amd64), func Setsid() (int, error) +pkg syscall (netbsd-amd64), func SetsockoptByte(int, int, int, uint8) error +pkg syscall (netbsd-amd64), func SetsockoptICMPv6Filter(int, int, int, *ICMPv6Filter) error +pkg syscall (netbsd-amd64), func SetsockoptIPMreq(int, int, int, *IPMreq) error +pkg syscall (netbsd-amd64), func SetsockoptIPv6Mreq(int, int, int, *IPv6Mreq) error +pkg syscall (netbsd-amd64), func SetsockoptInet4Addr(int, int, int, [4]uint8) error +pkg syscall (netbsd-amd64), func SetsockoptInt(int, int, int, int) error +pkg syscall (netbsd-amd64), func SetsockoptLinger(int, int, int, *Linger) error +pkg syscall (netbsd-amd64), func SetsockoptString(int, int, int, string) error +pkg syscall (netbsd-amd64), func SetsockoptTimeval(int, int, int, *Timeval) error +pkg syscall (netbsd-amd64), func Settimeofday(*Timeval) error +pkg syscall (netbsd-amd64), func Setuid(int) error +pkg syscall (netbsd-amd64), func Shutdown(int, int) error +pkg syscall (netbsd-amd64), func SlicePtrFromStrings([]string) ([]*uint8, error) +pkg syscall (netbsd-amd64), func Socket(int, int, int) (int, error) +pkg syscall (netbsd-amd64), func Socketpair(int, int, int) ([2]int, error) +pkg syscall (netbsd-amd64), func Stat(string, *Stat_t) error +pkg syscall (netbsd-amd64), func StringSlicePtr([]string) []*uint8 +pkg syscall (netbsd-amd64), func Sync() error +pkg syscall (netbsd-amd64), func Syscall(uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno) +pkg syscall (netbsd-amd64), func Syscall6(uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno) +pkg syscall (netbsd-amd64), func Syscall9(uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno) +pkg syscall (netbsd-amd64), func Sysctl(string) (string, error) +pkg syscall (netbsd-amd64), func SysctlUint32(string) (uint32, error) +pkg syscall (netbsd-amd64), func TimevalToNsec(Timeval) int64 +pkg syscall (netbsd-amd64), func Truncate(string, int64) error +pkg syscall (netbsd-amd64), func Umask(int) int +pkg syscall (netbsd-amd64), func UnixRights(...int) []uint8 +pkg syscall (netbsd-amd64), func Unmount(string, int) error +pkg syscall (netbsd-amd64), func Wait4(int, *WaitStatus, int, *Rusage) (int, error) +pkg syscall (netbsd-amd64), func Write(int, []uint8) (int, error) +pkg syscall (netbsd-amd64), method (*Cmsghdr) SetLen(int) +pkg syscall (netbsd-amd64), method (*Iovec) SetLen(int) +pkg syscall (netbsd-amd64), method (*Msghdr) SetControllen(int) +pkg syscall (netbsd-amd64), type BpfHdr struct +pkg syscall (netbsd-amd64), type BpfHdr struct, Caplen uint32 +pkg syscall (netbsd-amd64), type BpfHdr struct, Datalen uint32 +pkg syscall (netbsd-amd64), type BpfHdr struct, Hdrlen uint16 +pkg syscall (netbsd-amd64), type BpfHdr struct, Pad_cgo_0 [6]uint8 +pkg syscall (netbsd-amd64), type BpfHdr struct, Tstamp BpfTimeval +pkg syscall (netbsd-amd64), type BpfInsn struct +pkg syscall (netbsd-amd64), type BpfInsn struct, Code uint16 +pkg syscall (netbsd-amd64), type BpfInsn struct, Jf uint8 +pkg syscall (netbsd-amd64), type BpfInsn struct, Jt uint8 +pkg syscall (netbsd-amd64), type BpfInsn struct, K uint32 +pkg syscall (netbsd-amd64), type BpfProgram struct +pkg syscall (netbsd-amd64), type BpfProgram struct, Insns *BpfInsn +pkg syscall (netbsd-amd64), type BpfProgram struct, Len uint32 +pkg syscall (netbsd-amd64), type BpfProgram struct, Pad_cgo_0 [4]uint8 +pkg syscall (netbsd-amd64), type BpfStat struct +pkg syscall (netbsd-amd64), type BpfStat struct, Capt uint64 +pkg syscall (netbsd-amd64), type BpfStat struct, Drop uint64 +pkg syscall (netbsd-amd64), type BpfStat struct, Padding [13]uint64 +pkg syscall (netbsd-amd64), type BpfStat struct, Recv uint64 +pkg syscall (netbsd-amd64), type BpfTimeval struct +pkg syscall (netbsd-amd64), type BpfTimeval struct, Sec int64 +pkg syscall (netbsd-amd64), type BpfTimeval struct, Usec int64 +pkg syscall (netbsd-amd64), type BpfVersion struct +pkg syscall (netbsd-amd64), type BpfVersion struct, Major uint16 +pkg syscall (netbsd-amd64), type BpfVersion struct, Minor uint16 +pkg syscall (netbsd-amd64), type Cmsghdr struct +pkg syscall (netbsd-amd64), type Cmsghdr struct, Len uint32 +pkg syscall (netbsd-amd64), type Cmsghdr struct, Level int32 +pkg syscall (netbsd-amd64), type Cmsghdr struct, Type int32 +pkg syscall (netbsd-amd64), type Credential struct +pkg syscall (netbsd-amd64), type Credential struct, Gid uint32 +pkg syscall (netbsd-amd64), type Credential struct, Groups []uint32 +pkg syscall (netbsd-amd64), type Credential struct, Uid uint32 +pkg syscall (netbsd-amd64), type Dirent struct +pkg syscall (netbsd-amd64), type Dirent struct, Fileno uint64 +pkg syscall (netbsd-amd64), type Dirent struct, Name [512]int8 +pkg syscall (netbsd-amd64), type Dirent struct, Namlen uint16 +pkg syscall (netbsd-amd64), type Dirent struct, Pad_cgo_0 [3]uint8 +pkg syscall (netbsd-amd64), type Dirent struct, Reclen uint16 +pkg syscall (netbsd-amd64), type Dirent struct, Type uint8 +pkg syscall (netbsd-amd64), type FdSet struct +pkg syscall (netbsd-amd64), type FdSet struct, Bits [8]uint32 +pkg syscall (netbsd-amd64), type Flock_t struct +pkg syscall (netbsd-amd64), type Flock_t struct, Len int64 +pkg syscall (netbsd-amd64), type Flock_t struct, Pid int32 +pkg syscall (netbsd-amd64), type Flock_t struct, Start int64 +pkg syscall (netbsd-amd64), type Flock_t struct, Type int16 +pkg syscall (netbsd-amd64), type Flock_t struct, Whence int16 +pkg syscall (netbsd-amd64), type Fsid struct +pkg syscall (netbsd-amd64), type Fsid struct, X__fsid_val [2]int32 +pkg syscall (netbsd-amd64), type ICMPv6Filter struct +pkg syscall (netbsd-amd64), type ICMPv6Filter struct, Filt [8]uint32 +pkg syscall (netbsd-amd64), type IPv6MTUInfo struct +pkg syscall (netbsd-amd64), type IPv6MTUInfo struct, Addr RawSockaddrInet6 +pkg syscall (netbsd-amd64), type IPv6MTUInfo struct, Mtu uint32 +pkg syscall (netbsd-amd64), type IfAnnounceMsghdr struct +pkg syscall (netbsd-amd64), type IfAnnounceMsghdr struct, Index uint16 +pkg syscall (netbsd-amd64), type IfAnnounceMsghdr struct, Msglen uint16 +pkg syscall (netbsd-amd64), type IfAnnounceMsghdr struct, Name [16]int8 +pkg syscall (netbsd-amd64), type IfAnnounceMsghdr struct, Type uint8 +pkg syscall (netbsd-amd64), type IfAnnounceMsghdr struct, Version uint8 +pkg syscall (netbsd-amd64), type IfAnnounceMsghdr struct, What uint16 +pkg syscall (netbsd-amd64), type IfData struct +pkg syscall (netbsd-amd64), type IfData struct, Addrlen uint8 +pkg syscall (netbsd-amd64), type IfData struct, Baudrate uint64 +pkg syscall (netbsd-amd64), type IfData struct, Collisions uint64 +pkg syscall (netbsd-amd64), type IfData struct, Hdrlen uint8 +pkg syscall (netbsd-amd64), type IfData struct, Ibytes uint64 +pkg syscall (netbsd-amd64), type IfData struct, Ierrors uint64 +pkg syscall (netbsd-amd64), type IfData struct, Imcasts uint64 +pkg syscall (netbsd-amd64), type IfData struct, Ipackets uint64 +pkg syscall (netbsd-amd64), type IfData struct, Iqdrops uint64 +pkg syscall (netbsd-amd64), type IfData struct, Lastchange Timespec +pkg syscall (netbsd-amd64), type IfData struct, Link_state int32 +pkg syscall (netbsd-amd64), type IfData struct, Metric uint64 +pkg syscall (netbsd-amd64), type IfData struct, Mtu uint64 +pkg syscall (netbsd-amd64), type IfData struct, Noproto uint64 +pkg syscall (netbsd-amd64), type IfData struct, Obytes uint64 +pkg syscall (netbsd-amd64), type IfData struct, Oerrors uint64 +pkg syscall (netbsd-amd64), type IfData struct, Omcasts uint64 +pkg syscall (netbsd-amd64), type IfData struct, Opackets uint64 +pkg syscall (netbsd-amd64), type IfData struct, Pad_cgo_0 [1]uint8 +pkg syscall (netbsd-amd64), type IfData struct, Type uint8 +pkg syscall (netbsd-amd64), type IfMsghdr struct +pkg syscall (netbsd-amd64), type IfMsghdr struct, Addrs int32 +pkg syscall (netbsd-amd64), type IfMsghdr struct, Data IfData +pkg syscall (netbsd-amd64), type IfMsghdr struct, Flags int32 +pkg syscall (netbsd-amd64), type IfMsghdr struct, Index uint16 +pkg syscall (netbsd-amd64), type IfMsghdr struct, Msglen uint16 +pkg syscall (netbsd-amd64), type IfMsghdr struct, Pad_cgo_0 [2]uint8 +pkg syscall (netbsd-amd64), type IfMsghdr struct, Type uint8 +pkg syscall (netbsd-amd64), type IfMsghdr struct, Version uint8 +pkg syscall (netbsd-amd64), type IfaMsghdr struct +pkg syscall (netbsd-amd64), type IfaMsghdr struct, Addrs int32 +pkg syscall (netbsd-amd64), type IfaMsghdr struct, Flags int32 +pkg syscall (netbsd-amd64), type IfaMsghdr struct, Index uint16 +pkg syscall (netbsd-amd64), type IfaMsghdr struct, Metric int32 +pkg syscall (netbsd-amd64), type IfaMsghdr struct, Msglen uint16 +pkg syscall (netbsd-amd64), type IfaMsghdr struct, Pad_cgo_0 [6]uint8 +pkg syscall (netbsd-amd64), type IfaMsghdr struct, Type uint8 +pkg syscall (netbsd-amd64), type IfaMsghdr struct, Version uint8 +pkg syscall (netbsd-amd64), type Inet6Pktinfo struct +pkg syscall (netbsd-amd64), type Inet6Pktinfo struct, Addr [16]uint8 +pkg syscall (netbsd-amd64), type Inet6Pktinfo struct, Ifindex uint32 +pkg syscall (netbsd-amd64), type InterfaceAddrMessage struct +pkg syscall (netbsd-amd64), type InterfaceAddrMessage struct, Data []uint8 +pkg syscall (netbsd-amd64), type InterfaceAddrMessage struct, Header IfaMsghdr +pkg syscall (netbsd-amd64), type InterfaceAnnounceMessage struct +pkg syscall (netbsd-amd64), type InterfaceAnnounceMessage struct, Header IfAnnounceMsghdr +pkg syscall (netbsd-amd64), type InterfaceMessage struct +pkg syscall (netbsd-amd64), type InterfaceMessage struct, Data []uint8 +pkg syscall (netbsd-amd64), type InterfaceMessage struct, Header IfMsghdr +pkg syscall (netbsd-amd64), type Iovec struct +pkg syscall (netbsd-amd64), type Iovec struct, Base *uint8 +pkg syscall (netbsd-amd64), type Iovec struct, Len uint64 +pkg syscall (netbsd-amd64), type Kevent_t struct +pkg syscall (netbsd-amd64), type Kevent_t struct, Data int64 +pkg syscall (netbsd-amd64), type Kevent_t struct, Fflags uint32 +pkg syscall (netbsd-amd64), type Kevent_t struct, Filter uint32 +pkg syscall (netbsd-amd64), type Kevent_t struct, Flags uint32 +pkg syscall (netbsd-amd64), type Kevent_t struct, Ident uint64 +pkg syscall (netbsd-amd64), type Kevent_t struct, Pad_cgo_0 [4]uint8 +pkg syscall (netbsd-amd64), type Kevent_t struct, Udata int64 +pkg syscall (netbsd-amd64), type Mclpool [0]uint8 +pkg syscall (netbsd-amd64), type Msghdr struct +pkg syscall (netbsd-amd64), type Msghdr struct, Control *uint8 +pkg syscall (netbsd-amd64), type Msghdr struct, Controllen uint32 +pkg syscall (netbsd-amd64), type Msghdr struct, Flags int32 +pkg syscall (netbsd-amd64), type Msghdr struct, Iov *Iovec +pkg syscall (netbsd-amd64), type Msghdr struct, Iovlen int32 +pkg syscall (netbsd-amd64), type Msghdr struct, Name *uint8 +pkg syscall (netbsd-amd64), type Msghdr struct, Namelen uint32 +pkg syscall (netbsd-amd64), type Msghdr struct, Pad_cgo_0 [4]uint8 +pkg syscall (netbsd-amd64), type Msghdr struct, Pad_cgo_1 [4]uint8 +pkg syscall (netbsd-amd64), type RawSockaddr struct, Data [14]int8 +pkg syscall (netbsd-amd64), type RawSockaddr struct, Family uint8 +pkg syscall (netbsd-amd64), type RawSockaddr struct, Len uint8 +pkg syscall (netbsd-amd64), type RawSockaddrAny struct, Pad [92]int8 +pkg syscall (netbsd-amd64), type RawSockaddrDatalink struct +pkg syscall (netbsd-amd64), type RawSockaddrDatalink struct, Alen uint8 +pkg syscall (netbsd-amd64), type RawSockaddrDatalink struct, Data [12]int8 +pkg syscall (netbsd-amd64), type RawSockaddrDatalink struct, Family uint8 +pkg syscall (netbsd-amd64), type RawSockaddrDatalink struct, Index uint16 +pkg syscall (netbsd-amd64), type RawSockaddrDatalink struct, Len uint8 +pkg syscall (netbsd-amd64), type RawSockaddrDatalink struct, Nlen uint8 +pkg syscall (netbsd-amd64), type RawSockaddrDatalink struct, Slen uint8 +pkg syscall (netbsd-amd64), type RawSockaddrDatalink struct, Type uint8 +pkg syscall (netbsd-amd64), type RawSockaddrInet4 struct, Family uint8 +pkg syscall (netbsd-amd64), type RawSockaddrInet4 struct, Len uint8 +pkg syscall (netbsd-amd64), type RawSockaddrInet4 struct, Zero [8]int8 +pkg syscall (netbsd-amd64), type RawSockaddrInet6 struct, Family uint8 +pkg syscall (netbsd-amd64), type RawSockaddrInet6 struct, Len uint8 +pkg syscall (netbsd-amd64), type RawSockaddrUnix struct +pkg syscall (netbsd-amd64), type RawSockaddrUnix struct, Family uint8 +pkg syscall (netbsd-amd64), type RawSockaddrUnix struct, Len uint8 +pkg syscall (netbsd-amd64), type RawSockaddrUnix struct, Path [104]int8 +pkg syscall (netbsd-amd64), type Rlimit struct +pkg syscall (netbsd-amd64), type Rlimit struct, Cur uint64 +pkg syscall (netbsd-amd64), type Rlimit struct, Max uint64 +pkg syscall (netbsd-amd64), type RouteMessage struct +pkg syscall (netbsd-amd64), type RouteMessage struct, Data []uint8 +pkg syscall (netbsd-amd64), type RouteMessage struct, Header RtMsghdr +pkg syscall (netbsd-amd64), type RoutingMessage interface, unexported methods +pkg syscall (netbsd-amd64), type RtMetrics struct +pkg syscall (netbsd-amd64), type RtMetrics struct, Expire int64 +pkg syscall (netbsd-amd64), type RtMetrics struct, Hopcount uint64 +pkg syscall (netbsd-amd64), type RtMetrics struct, Locks uint64 +pkg syscall (netbsd-amd64), type RtMetrics struct, Mtu uint64 +pkg syscall (netbsd-amd64), type RtMetrics struct, Pksent int64 +pkg syscall (netbsd-amd64), type RtMetrics struct, Recvpipe uint64 +pkg syscall (netbsd-amd64), type RtMetrics struct, Rtt uint64 +pkg syscall (netbsd-amd64), type RtMetrics struct, Rttvar uint64 +pkg syscall (netbsd-amd64), type RtMetrics struct, Sendpipe uint64 +pkg syscall (netbsd-amd64), type RtMetrics struct, Ssthresh uint64 +pkg syscall (netbsd-amd64), type RtMsghdr struct +pkg syscall (netbsd-amd64), type RtMsghdr struct, Addrs int32 +pkg syscall (netbsd-amd64), type RtMsghdr struct, Errno int32 +pkg syscall (netbsd-amd64), type RtMsghdr struct, Flags int32 +pkg syscall (netbsd-amd64), type RtMsghdr struct, Index uint16 +pkg syscall (netbsd-amd64), type RtMsghdr struct, Inits int32 +pkg syscall (netbsd-amd64), type RtMsghdr struct, Msglen uint16 +pkg syscall (netbsd-amd64), type RtMsghdr struct, Pad_cgo_0 [2]uint8 +pkg syscall (netbsd-amd64), type RtMsghdr struct, Pad_cgo_1 [4]uint8 +pkg syscall (netbsd-amd64), type RtMsghdr struct, Pid int32 +pkg syscall (netbsd-amd64), type RtMsghdr struct, Rmx RtMetrics +pkg syscall (netbsd-amd64), type RtMsghdr struct, Seq int32 +pkg syscall (netbsd-amd64), type RtMsghdr struct, Type uint8 +pkg syscall (netbsd-amd64), type RtMsghdr struct, Use int32 +pkg syscall (netbsd-amd64), type RtMsghdr struct, Version uint8 +pkg syscall (netbsd-amd64), type Rusage struct, Idrss int64 +pkg syscall (netbsd-amd64), type Rusage struct, Inblock int64 +pkg syscall (netbsd-amd64), type Rusage struct, Isrss int64 +pkg syscall (netbsd-amd64), type Rusage struct, Ixrss int64 +pkg syscall (netbsd-amd64), type Rusage struct, Majflt int64 +pkg syscall (netbsd-amd64), type Rusage struct, Maxrss int64 +pkg syscall (netbsd-amd64), type Rusage struct, Minflt int64 +pkg syscall (netbsd-amd64), type Rusage struct, Msgrcv int64 +pkg syscall (netbsd-amd64), type Rusage struct, Msgsnd int64 +pkg syscall (netbsd-amd64), type Rusage struct, Nivcsw int64 +pkg syscall (netbsd-amd64), type Rusage struct, Nsignals int64 +pkg syscall (netbsd-amd64), type Rusage struct, Nswap int64 +pkg syscall (netbsd-amd64), type Rusage struct, Nvcsw int64 +pkg syscall (netbsd-amd64), type Rusage struct, Oublock int64 +pkg syscall (netbsd-amd64), type Rusage struct, Stime Timeval +pkg syscall (netbsd-amd64), type Rusage struct, Utime Timeval +pkg syscall (netbsd-amd64), type SockaddrDatalink struct +pkg syscall (netbsd-amd64), type SockaddrDatalink struct, Alen uint8 +pkg syscall (netbsd-amd64), type SockaddrDatalink struct, Data [12]int8 +pkg syscall (netbsd-amd64), type SockaddrDatalink struct, Family uint8 +pkg syscall (netbsd-amd64), type SockaddrDatalink struct, Index uint16 +pkg syscall (netbsd-amd64), type SockaddrDatalink struct, Len uint8 +pkg syscall (netbsd-amd64), type SockaddrDatalink struct, Nlen uint8 +pkg syscall (netbsd-amd64), type SockaddrDatalink struct, Slen uint8 +pkg syscall (netbsd-amd64), type SockaddrDatalink struct, Type uint8 +pkg syscall (netbsd-amd64), type SocketControlMessage struct +pkg syscall (netbsd-amd64), type SocketControlMessage struct, Data []uint8 +pkg syscall (netbsd-amd64), type SocketControlMessage struct, Header Cmsghdr +pkg syscall (netbsd-amd64), type Stat_t struct +pkg syscall (netbsd-amd64), type Stat_t struct, Atimespec Timespec +pkg syscall (netbsd-amd64), type Stat_t struct, Birthtimespec Timespec +pkg syscall (netbsd-amd64), type Stat_t struct, Blksize uint32 +pkg syscall (netbsd-amd64), type Stat_t struct, Blocks int64 +pkg syscall (netbsd-amd64), type Stat_t struct, Ctimespec Timespec +pkg syscall (netbsd-amd64), type Stat_t struct, Dev uint64 +pkg syscall (netbsd-amd64), type Stat_t struct, Flags uint32 +pkg syscall (netbsd-amd64), type Stat_t struct, Gen uint32 +pkg syscall (netbsd-amd64), type Stat_t struct, Gid uint32 +pkg syscall (netbsd-amd64), type Stat_t struct, Ino uint64 +pkg syscall (netbsd-amd64), type Stat_t struct, Mode uint32 +pkg syscall (netbsd-amd64), type Stat_t struct, Mtimespec Timespec +pkg syscall (netbsd-amd64), type Stat_t struct, Nlink uint32 +pkg syscall (netbsd-amd64), type Stat_t struct, Pad_cgo_0 [4]uint8 +pkg syscall (netbsd-amd64), type Stat_t struct, Pad_cgo_1 [4]uint8 +pkg syscall (netbsd-amd64), type Stat_t struct, Pad_cgo_2 [4]uint8 +pkg syscall (netbsd-amd64), type Stat_t struct, Rdev uint64 +pkg syscall (netbsd-amd64), type Stat_t struct, Size int64 +pkg syscall (netbsd-amd64), type Stat_t struct, Spare [2]uint32 +pkg syscall (netbsd-amd64), type Stat_t struct, Uid uint32 +pkg syscall (netbsd-amd64), type Statfs_t [0]uint8 +pkg syscall (netbsd-amd64), type SysProcAttr struct, Chroot string +pkg syscall (netbsd-amd64), type SysProcAttr struct, Credential *Credential +pkg syscall (netbsd-amd64), type SysProcAttr struct, Noctty bool +pkg syscall (netbsd-amd64), type SysProcAttr struct, Ptrace bool +pkg syscall (netbsd-amd64), type SysProcAttr struct, Setctty bool +pkg syscall (netbsd-amd64), type SysProcAttr struct, Setpgid bool +pkg syscall (netbsd-amd64), type SysProcAttr struct, Setsid bool +pkg syscall (netbsd-amd64), type Sysctlnode struct +pkg syscall (netbsd-amd64), type Sysctlnode struct, Flags uint32 +pkg syscall (netbsd-amd64), type Sysctlnode struct, Name [32]int8 +pkg syscall (netbsd-amd64), type Sysctlnode struct, Num int32 +pkg syscall (netbsd-amd64), type Sysctlnode struct, Un [16]uint8 +pkg syscall (netbsd-amd64), type Sysctlnode struct, Ver uint32 +pkg syscall (netbsd-amd64), type Sysctlnode struct, X__rsvd uint32 +pkg syscall (netbsd-amd64), type Sysctlnode struct, X_sysctl_desc [8]uint8 +pkg syscall (netbsd-amd64), type Sysctlnode struct, X_sysctl_func [8]uint8 +pkg syscall (netbsd-amd64), type Sysctlnode struct, X_sysctl_parent [8]uint8 +pkg syscall (netbsd-amd64), type Sysctlnode struct, X_sysctl_size [8]uint8 +pkg syscall (netbsd-amd64), type Timespec struct, Nsec int64 +pkg syscall (netbsd-amd64), type Timespec struct, Sec int64 +pkg syscall (netbsd-amd64), type Timeval struct, Pad_cgo_0 [4]uint8 +pkg syscall (netbsd-amd64), type Timeval struct, Sec int64 +pkg syscall (netbsd-amd64), type Timeval struct, Usec int32 +pkg syscall (netbsd-amd64), type WaitStatus uint32 +pkg syscall (netbsd-amd64), var Stderr int +pkg syscall (netbsd-amd64), var Stdin int +pkg syscall (netbsd-amd64), var Stdout int +pkg syscall (netbsd-amd64-cgo), const AF_APPLETALK ideal-int +pkg syscall (netbsd-amd64-cgo), const AF_ARP ideal-int +pkg syscall (netbsd-amd64-cgo), const AF_BLUETOOTH ideal-int +pkg syscall (netbsd-amd64-cgo), const AF_CCITT ideal-int +pkg syscall (netbsd-amd64-cgo), const AF_CHAOS ideal-int +pkg syscall (netbsd-amd64-cgo), const AF_CNT ideal-int +pkg syscall (netbsd-amd64-cgo), const AF_COIP ideal-int +pkg syscall (netbsd-amd64-cgo), const AF_DATAKIT ideal-int +pkg syscall (netbsd-amd64-cgo), const AF_DECnet ideal-int +pkg syscall (netbsd-amd64-cgo), const AF_DLI ideal-int +pkg syscall (netbsd-amd64-cgo), const AF_E164 ideal-int +pkg syscall (netbsd-amd64-cgo), const AF_ECMA ideal-int +pkg syscall (netbsd-amd64-cgo), const AF_HYLINK ideal-int +pkg syscall (netbsd-amd64-cgo), const AF_IEEE80211 ideal-int +pkg syscall (netbsd-amd64-cgo), const AF_IMPLINK ideal-int +pkg syscall (netbsd-amd64-cgo), const AF_IPX ideal-int +pkg syscall (netbsd-amd64-cgo), const AF_ISDN ideal-int +pkg syscall (netbsd-amd64-cgo), const AF_ISO ideal-int +pkg syscall (netbsd-amd64-cgo), const AF_LAT ideal-int +pkg syscall (netbsd-amd64-cgo), const AF_LINK ideal-int +pkg syscall (netbsd-amd64-cgo), const AF_LOCAL ideal-int +pkg syscall (netbsd-amd64-cgo), const AF_MAX ideal-int +pkg syscall (netbsd-amd64-cgo), const AF_MPLS ideal-int +pkg syscall (netbsd-amd64-cgo), const AF_NATM ideal-int +pkg syscall (netbsd-amd64-cgo), const AF_NS ideal-int +pkg syscall (netbsd-amd64-cgo), const AF_OROUTE ideal-int +pkg syscall (netbsd-amd64-cgo), const AF_OSI ideal-int +pkg syscall (netbsd-amd64-cgo), const AF_PUP ideal-int +pkg syscall (netbsd-amd64-cgo), const AF_ROUTE ideal-int +pkg syscall (netbsd-amd64-cgo), const AF_SNA ideal-int +pkg syscall (netbsd-amd64-cgo), const ARPHRD_ARCNET ideal-int +pkg syscall (netbsd-amd64-cgo), const ARPHRD_ETHER ideal-int +pkg syscall (netbsd-amd64-cgo), const ARPHRD_FRELAY ideal-int +pkg syscall (netbsd-amd64-cgo), const ARPHRD_IEEE1394 ideal-int +pkg syscall (netbsd-amd64-cgo), const ARPHRD_IEEE802 ideal-int +pkg syscall (netbsd-amd64-cgo), const ARPHRD_STRIP ideal-int +pkg syscall (netbsd-amd64-cgo), const B0 ideal-int +pkg syscall (netbsd-amd64-cgo), const B110 ideal-int +pkg syscall (netbsd-amd64-cgo), const B115200 ideal-int +pkg syscall (netbsd-amd64-cgo), const B1200 ideal-int +pkg syscall (netbsd-amd64-cgo), const B134 ideal-int +pkg syscall (netbsd-amd64-cgo), const B14400 ideal-int +pkg syscall (netbsd-amd64-cgo), const B150 ideal-int +pkg syscall (netbsd-amd64-cgo), const B1800 ideal-int +pkg syscall (netbsd-amd64-cgo), const B19200 ideal-int +pkg syscall (netbsd-amd64-cgo), const B200 ideal-int +pkg syscall (netbsd-amd64-cgo), const B230400 ideal-int +pkg syscall (netbsd-amd64-cgo), const B2400 ideal-int +pkg syscall (netbsd-amd64-cgo), const B28800 ideal-int +pkg syscall (netbsd-amd64-cgo), const B300 ideal-int +pkg syscall (netbsd-amd64-cgo), const B38400 ideal-int +pkg syscall (netbsd-amd64-cgo), const B460800 ideal-int +pkg syscall (netbsd-amd64-cgo), const B4800 ideal-int +pkg syscall (netbsd-amd64-cgo), const B50 ideal-int +pkg syscall (netbsd-amd64-cgo), const B57600 ideal-int +pkg syscall (netbsd-amd64-cgo), const B600 ideal-int +pkg syscall (netbsd-amd64-cgo), const B7200 ideal-int +pkg syscall (netbsd-amd64-cgo), const B75 ideal-int +pkg syscall (netbsd-amd64-cgo), const B76800 ideal-int +pkg syscall (netbsd-amd64-cgo), const B921600 ideal-int +pkg syscall (netbsd-amd64-cgo), const B9600 ideal-int +pkg syscall (netbsd-amd64-cgo), const BIOCFEEDBACK ideal-int +pkg syscall (netbsd-amd64-cgo), const BIOCFLUSH ideal-int +pkg syscall (netbsd-amd64-cgo), const BIOCGBLEN ideal-int +pkg syscall (netbsd-amd64-cgo), const BIOCGDLT ideal-int +pkg syscall (netbsd-amd64-cgo), const BIOCGDLTLIST ideal-int +pkg syscall (netbsd-amd64-cgo), const BIOCGETIF ideal-int +pkg syscall (netbsd-amd64-cgo), const BIOCGFEEDBACK ideal-int +pkg syscall (netbsd-amd64-cgo), const BIOCGHDRCMPLT ideal-int +pkg syscall (netbsd-amd64-cgo), const BIOCGRTIMEOUT ideal-int +pkg syscall (netbsd-amd64-cgo), const BIOCGSEESENT ideal-int +pkg syscall (netbsd-amd64-cgo), const BIOCGSTATS ideal-int +pkg syscall (netbsd-amd64-cgo), const BIOCGSTATSOLD ideal-int +pkg syscall (netbsd-amd64-cgo), const BIOCIMMEDIATE ideal-int +pkg syscall (netbsd-amd64-cgo), const BIOCPROMISC ideal-int +pkg syscall (netbsd-amd64-cgo), const BIOCSBLEN ideal-int +pkg syscall (netbsd-amd64-cgo), const BIOCSDLT ideal-int +pkg syscall (netbsd-amd64-cgo), const BIOCSETF ideal-int +pkg syscall (netbsd-amd64-cgo), const BIOCSETIF ideal-int +pkg syscall (netbsd-amd64-cgo), const BIOCSFEEDBACK ideal-int +pkg syscall (netbsd-amd64-cgo), const BIOCSHDRCMPLT ideal-int +pkg syscall (netbsd-amd64-cgo), const BIOCSRTIMEOUT ideal-int +pkg syscall (netbsd-amd64-cgo), const BIOCSSEESENT ideal-int +pkg syscall (netbsd-amd64-cgo), const BIOCSTCPF ideal-int +pkg syscall (netbsd-amd64-cgo), const BIOCSUDPF ideal-int +pkg syscall (netbsd-amd64-cgo), const BIOCVERSION ideal-int +pkg syscall (netbsd-amd64-cgo), const BPF_A ideal-int +pkg syscall (netbsd-amd64-cgo), const BPF_ABS ideal-int +pkg syscall (netbsd-amd64-cgo), const BPF_ADD ideal-int +pkg syscall (netbsd-amd64-cgo), const BPF_ALIGNMENT ideal-int +pkg syscall (netbsd-amd64-cgo), const BPF_ALIGNMENT32 ideal-int +pkg syscall (netbsd-amd64-cgo), const BPF_ALU ideal-int +pkg syscall (netbsd-amd64-cgo), const BPF_AND ideal-int +pkg syscall (netbsd-amd64-cgo), const BPF_B ideal-int +pkg syscall (netbsd-amd64-cgo), const BPF_DFLTBUFSIZE ideal-int +pkg syscall (netbsd-amd64-cgo), const BPF_DIV ideal-int +pkg syscall (netbsd-amd64-cgo), const BPF_H ideal-int +pkg syscall (netbsd-amd64-cgo), const BPF_IMM ideal-int +pkg syscall (netbsd-amd64-cgo), const BPF_IND ideal-int +pkg syscall (netbsd-amd64-cgo), const BPF_JA ideal-int +pkg syscall (netbsd-amd64-cgo), const BPF_JEQ ideal-int +pkg syscall (netbsd-amd64-cgo), const BPF_JGE ideal-int +pkg syscall (netbsd-amd64-cgo), const BPF_JGT ideal-int +pkg syscall (netbsd-amd64-cgo), const BPF_JMP ideal-int +pkg syscall (netbsd-amd64-cgo), const BPF_JSET ideal-int +pkg syscall (netbsd-amd64-cgo), const BPF_K ideal-int +pkg syscall (netbsd-amd64-cgo), const BPF_LD ideal-int +pkg syscall (netbsd-amd64-cgo), const BPF_LDX ideal-int +pkg syscall (netbsd-amd64-cgo), const BPF_LEN ideal-int +pkg syscall (netbsd-amd64-cgo), const BPF_LSH ideal-int +pkg syscall (netbsd-amd64-cgo), const BPF_MAJOR_VERSION ideal-int +pkg syscall (netbsd-amd64-cgo), const BPF_MAXBUFSIZE ideal-int +pkg syscall (netbsd-amd64-cgo), const BPF_MAXINSNS ideal-int +pkg syscall (netbsd-amd64-cgo), const BPF_MEM ideal-int +pkg syscall (netbsd-amd64-cgo), const BPF_MEMWORDS ideal-int +pkg syscall (netbsd-amd64-cgo), const BPF_MINBUFSIZE ideal-int +pkg syscall (netbsd-amd64-cgo), const BPF_MINOR_VERSION ideal-int +pkg syscall (netbsd-amd64-cgo), const BPF_MISC ideal-int +pkg syscall (netbsd-amd64-cgo), const BPF_MSH ideal-int +pkg syscall (netbsd-amd64-cgo), const BPF_MUL ideal-int +pkg syscall (netbsd-amd64-cgo), const BPF_NEG ideal-int +pkg syscall (netbsd-amd64-cgo), const BPF_OR ideal-int +pkg syscall (netbsd-amd64-cgo), const BPF_RELEASE ideal-int +pkg syscall (netbsd-amd64-cgo), const BPF_RET ideal-int +pkg syscall (netbsd-amd64-cgo), const BPF_RSH ideal-int +pkg syscall (netbsd-amd64-cgo), const BPF_ST ideal-int +pkg syscall (netbsd-amd64-cgo), const BPF_STX ideal-int +pkg syscall (netbsd-amd64-cgo), const BPF_SUB ideal-int +pkg syscall (netbsd-amd64-cgo), const BPF_TAX ideal-int +pkg syscall (netbsd-amd64-cgo), const BPF_TXA ideal-int +pkg syscall (netbsd-amd64-cgo), const BPF_W ideal-int +pkg syscall (netbsd-amd64-cgo), const BPF_X ideal-int +pkg syscall (netbsd-amd64-cgo), const BRKINT ideal-int +pkg syscall (netbsd-amd64-cgo), const CFLUSH ideal-int +pkg syscall (netbsd-amd64-cgo), const CLOCAL ideal-int +pkg syscall (netbsd-amd64-cgo), const CREAD ideal-int +pkg syscall (netbsd-amd64-cgo), const CS5 ideal-int +pkg syscall (netbsd-amd64-cgo), const CS6 ideal-int +pkg syscall (netbsd-amd64-cgo), const CS7 ideal-int +pkg syscall (netbsd-amd64-cgo), const CS8 ideal-int +pkg syscall (netbsd-amd64-cgo), const CSIZE ideal-int +pkg syscall (netbsd-amd64-cgo), const CSTART ideal-int +pkg syscall (netbsd-amd64-cgo), const CSTATUS ideal-int +pkg syscall (netbsd-amd64-cgo), const CSTOP ideal-int +pkg syscall (netbsd-amd64-cgo), const CSTOPB ideal-int +pkg syscall (netbsd-amd64-cgo), const CSUSP ideal-int +pkg syscall (netbsd-amd64-cgo), const CTL_MAXNAME ideal-int +pkg syscall (netbsd-amd64-cgo), const CTL_NET ideal-int +pkg syscall (netbsd-amd64-cgo), const CTL_QUERY ideal-int +pkg syscall (netbsd-amd64-cgo), const DIOCBSFLUSH ideal-int +pkg syscall (netbsd-amd64-cgo), const DLT_A429 ideal-int +pkg syscall (netbsd-amd64-cgo), const DLT_A653_ICM ideal-int +pkg syscall (netbsd-amd64-cgo), const DLT_AIRONET_HEADER ideal-int +pkg syscall (netbsd-amd64-cgo), const DLT_AOS ideal-int +pkg syscall (netbsd-amd64-cgo), const DLT_APPLE_IP_OVER_IEEE1394 ideal-int +pkg syscall (netbsd-amd64-cgo), const DLT_ARCNET ideal-int +pkg syscall (netbsd-amd64-cgo), const DLT_ARCNET_LINUX ideal-int +pkg syscall (netbsd-amd64-cgo), const DLT_ATM_CLIP ideal-int +pkg syscall (netbsd-amd64-cgo), const DLT_ATM_RFC1483 ideal-int +pkg syscall (netbsd-amd64-cgo), const DLT_AURORA ideal-int +pkg syscall (netbsd-amd64-cgo), const DLT_AX25 ideal-int +pkg syscall (netbsd-amd64-cgo), const DLT_AX25_KISS ideal-int +pkg syscall (netbsd-amd64-cgo), const DLT_BACNET_MS_TP ideal-int +pkg syscall (netbsd-amd64-cgo), const DLT_BLUETOOTH_HCI_H4 ideal-int +pkg syscall (netbsd-amd64-cgo), const DLT_BLUETOOTH_HCI_H4_WITH_PHDR ideal-int +pkg syscall (netbsd-amd64-cgo), const DLT_CAN20B ideal-int +pkg syscall (netbsd-amd64-cgo), const DLT_CAN_SOCKETCAN ideal-int +pkg syscall (netbsd-amd64-cgo), const DLT_CHAOS ideal-int +pkg syscall (netbsd-amd64-cgo), const DLT_CISCO_IOS ideal-int +pkg syscall (netbsd-amd64-cgo), const DLT_C_HDLC ideal-int +pkg syscall (netbsd-amd64-cgo), const DLT_C_HDLC_WITH_DIR ideal-int +pkg syscall (netbsd-amd64-cgo), const DLT_DECT ideal-int +pkg syscall (netbsd-amd64-cgo), const DLT_DOCSIS ideal-int +pkg syscall (netbsd-amd64-cgo), const DLT_ECONET ideal-int +pkg syscall (netbsd-amd64-cgo), const DLT_EN10MB ideal-int +pkg syscall (netbsd-amd64-cgo), const DLT_EN3MB ideal-int +pkg syscall (netbsd-amd64-cgo), const DLT_ENC ideal-int +pkg syscall (netbsd-amd64-cgo), const DLT_ERF ideal-int +pkg syscall (netbsd-amd64-cgo), const DLT_ERF_ETH ideal-int +pkg syscall (netbsd-amd64-cgo), const DLT_ERF_POS ideal-int +pkg syscall (netbsd-amd64-cgo), const DLT_FC_2 ideal-int +pkg syscall (netbsd-amd64-cgo), const DLT_FC_2_WITH_FRAME_DELIMS ideal-int +pkg syscall (netbsd-amd64-cgo), const DLT_FDDI ideal-int +pkg syscall (netbsd-amd64-cgo), const DLT_FLEXRAY ideal-int +pkg syscall (netbsd-amd64-cgo), const DLT_FRELAY ideal-int +pkg syscall (netbsd-amd64-cgo), const DLT_FRELAY_WITH_DIR ideal-int +pkg syscall (netbsd-amd64-cgo), const DLT_GCOM_SERIAL ideal-int +pkg syscall (netbsd-amd64-cgo), const DLT_GCOM_T1E1 ideal-int +pkg syscall (netbsd-amd64-cgo), const DLT_GPF_F ideal-int +pkg syscall (netbsd-amd64-cgo), const DLT_GPF_T ideal-int +pkg syscall (netbsd-amd64-cgo), const DLT_GPRS_LLC ideal-int +pkg syscall (netbsd-amd64-cgo), const DLT_GSMTAP_ABIS ideal-int +pkg syscall (netbsd-amd64-cgo), const DLT_GSMTAP_UM ideal-int +pkg syscall (netbsd-amd64-cgo), const DLT_HDLC ideal-int +pkg syscall (netbsd-amd64-cgo), const DLT_HHDLC ideal-int +pkg syscall (netbsd-amd64-cgo), const DLT_HIPPI ideal-int +pkg syscall (netbsd-amd64-cgo), const DLT_IBM_SN ideal-int +pkg syscall (netbsd-amd64-cgo), const DLT_IBM_SP ideal-int +pkg syscall (netbsd-amd64-cgo), const DLT_IEEE802 ideal-int +pkg syscall (netbsd-amd64-cgo), const DLT_IEEE802_11 ideal-int +pkg syscall (netbsd-amd64-cgo), const DLT_IEEE802_11_RADIO ideal-int +pkg syscall (netbsd-amd64-cgo), const DLT_IEEE802_11_RADIO_AVS ideal-int +pkg syscall (netbsd-amd64-cgo), const DLT_IEEE802_15_4 ideal-int +pkg syscall (netbsd-amd64-cgo), const DLT_IEEE802_15_4_LINUX ideal-int +pkg syscall (netbsd-amd64-cgo), const DLT_IEEE802_15_4_NONASK_PHY ideal-int +pkg syscall (netbsd-amd64-cgo), const DLT_IEEE802_16_MAC_CPS ideal-int +pkg syscall (netbsd-amd64-cgo), const DLT_IEEE802_16_MAC_CPS_RADIO ideal-int +pkg syscall (netbsd-amd64-cgo), const DLT_IPMB ideal-int +pkg syscall (netbsd-amd64-cgo), const DLT_IPMB_LINUX ideal-int +pkg syscall (netbsd-amd64-cgo), const DLT_IPNET ideal-int +pkg syscall (netbsd-amd64-cgo), const DLT_IPV4 ideal-int +pkg syscall (netbsd-amd64-cgo), const DLT_IPV6 ideal-int +pkg syscall (netbsd-amd64-cgo), const DLT_IP_OVER_FC ideal-int +pkg syscall (netbsd-amd64-cgo), const DLT_JUNIPER_ATM1 ideal-int +pkg syscall (netbsd-amd64-cgo), const DLT_JUNIPER_ATM2 ideal-int +pkg syscall (netbsd-amd64-cgo), const DLT_JUNIPER_CHDLC ideal-int +pkg syscall (netbsd-amd64-cgo), const DLT_JUNIPER_ES ideal-int +pkg syscall (netbsd-amd64-cgo), const DLT_JUNIPER_ETHER ideal-int +pkg syscall (netbsd-amd64-cgo), const DLT_JUNIPER_FRELAY ideal-int +pkg syscall (netbsd-amd64-cgo), const DLT_JUNIPER_GGSN ideal-int +pkg syscall (netbsd-amd64-cgo), const DLT_JUNIPER_ISM ideal-int +pkg syscall (netbsd-amd64-cgo), const DLT_JUNIPER_MFR ideal-int +pkg syscall (netbsd-amd64-cgo), const DLT_JUNIPER_MLFR ideal-int +pkg syscall (netbsd-amd64-cgo), const DLT_JUNIPER_MLPPP ideal-int +pkg syscall (netbsd-amd64-cgo), const DLT_JUNIPER_MONITOR ideal-int +pkg syscall (netbsd-amd64-cgo), const DLT_JUNIPER_PIC_PEER ideal-int +pkg syscall (netbsd-amd64-cgo), const DLT_JUNIPER_PPP ideal-int +pkg syscall (netbsd-amd64-cgo), const DLT_JUNIPER_PPPOE ideal-int +pkg syscall (netbsd-amd64-cgo), const DLT_JUNIPER_PPPOE_ATM ideal-int +pkg syscall (netbsd-amd64-cgo), const DLT_JUNIPER_SERVICES ideal-int +pkg syscall (netbsd-amd64-cgo), const DLT_JUNIPER_ST ideal-int +pkg syscall (netbsd-amd64-cgo), const DLT_JUNIPER_VP ideal-int +pkg syscall (netbsd-amd64-cgo), const DLT_LAPB_WITH_DIR ideal-int +pkg syscall (netbsd-amd64-cgo), const DLT_LAPD ideal-int +pkg syscall (netbsd-amd64-cgo), const DLT_LIN ideal-int +pkg syscall (netbsd-amd64-cgo), const DLT_LINUX_EVDEV ideal-int +pkg syscall (netbsd-amd64-cgo), const DLT_LINUX_IRDA ideal-int +pkg syscall (netbsd-amd64-cgo), const DLT_LINUX_LAPD ideal-int +pkg syscall (netbsd-amd64-cgo), const DLT_LINUX_SLL ideal-int +pkg syscall (netbsd-amd64-cgo), const DLT_LOOP ideal-int +pkg syscall (netbsd-amd64-cgo), const DLT_LTALK ideal-int +pkg syscall (netbsd-amd64-cgo), const DLT_MFR ideal-int +pkg syscall (netbsd-amd64-cgo), const DLT_MOST ideal-int +pkg syscall (netbsd-amd64-cgo), const DLT_MPLS ideal-int +pkg syscall (netbsd-amd64-cgo), const DLT_MTP2 ideal-int +pkg syscall (netbsd-amd64-cgo), const DLT_MTP2_WITH_PHDR ideal-int +pkg syscall (netbsd-amd64-cgo), const DLT_MTP3 ideal-int +pkg syscall (netbsd-amd64-cgo), const DLT_NULL ideal-int +pkg syscall (netbsd-amd64-cgo), const DLT_PCI_EXP ideal-int +pkg syscall (netbsd-amd64-cgo), const DLT_PFLOG ideal-int +pkg syscall (netbsd-amd64-cgo), const DLT_PFSYNC ideal-int +pkg syscall (netbsd-amd64-cgo), const DLT_PPI ideal-int +pkg syscall (netbsd-amd64-cgo), const DLT_PPP ideal-int +pkg syscall (netbsd-amd64-cgo), const DLT_PPP_BSDOS ideal-int +pkg syscall (netbsd-amd64-cgo), const DLT_PPP_ETHER ideal-int +pkg syscall (netbsd-amd64-cgo), const DLT_PPP_PPPD ideal-int +pkg syscall (netbsd-amd64-cgo), const DLT_PPP_SERIAL ideal-int +pkg syscall (netbsd-amd64-cgo), const DLT_PPP_WITH_DIR ideal-int +pkg syscall (netbsd-amd64-cgo), const DLT_PRISM_HEADER ideal-int +pkg syscall (netbsd-amd64-cgo), const DLT_PRONET ideal-int +pkg syscall (netbsd-amd64-cgo), const DLT_RAIF1 ideal-int +pkg syscall (netbsd-amd64-cgo), const DLT_RAW ideal-int +pkg syscall (netbsd-amd64-cgo), const DLT_RAWAF_MASK ideal-int +pkg syscall (netbsd-amd64-cgo), const DLT_RIO ideal-int +pkg syscall (netbsd-amd64-cgo), const DLT_SCCP ideal-int +pkg syscall (netbsd-amd64-cgo), const DLT_SITA ideal-int +pkg syscall (netbsd-amd64-cgo), const DLT_SLIP ideal-int +pkg syscall (netbsd-amd64-cgo), const DLT_SLIP_BSDOS ideal-int +pkg syscall (netbsd-amd64-cgo), const DLT_SUNATM ideal-int +pkg syscall (netbsd-amd64-cgo), const DLT_SYMANTEC_FIREWALL ideal-int +pkg syscall (netbsd-amd64-cgo), const DLT_TZSP ideal-int +pkg syscall (netbsd-amd64-cgo), const DLT_USB ideal-int +pkg syscall (netbsd-amd64-cgo), const DLT_USB_LINUX ideal-int +pkg syscall (netbsd-amd64-cgo), const DLT_USB_LINUX_MMAPPED ideal-int +pkg syscall (netbsd-amd64-cgo), const DLT_WIHART ideal-int +pkg syscall (netbsd-amd64-cgo), const DLT_X2E_SERIAL ideal-int +pkg syscall (netbsd-amd64-cgo), const DLT_X2E_XORAYA ideal-int +pkg syscall (netbsd-amd64-cgo), const DT_BLK ideal-int +pkg syscall (netbsd-amd64-cgo), const DT_CHR ideal-int +pkg syscall (netbsd-amd64-cgo), const DT_DIR ideal-int +pkg syscall (netbsd-amd64-cgo), const DT_FIFO ideal-int +pkg syscall (netbsd-amd64-cgo), const DT_LNK ideal-int +pkg syscall (netbsd-amd64-cgo), const DT_REG ideal-int +pkg syscall (netbsd-amd64-cgo), const DT_SOCK ideal-int +pkg syscall (netbsd-amd64-cgo), const DT_UNKNOWN ideal-int +pkg syscall (netbsd-amd64-cgo), const DT_WHT ideal-int +pkg syscall (netbsd-amd64-cgo), const EAUTH Errno +pkg syscall (netbsd-amd64-cgo), const EBADMSG Errno +pkg syscall (netbsd-amd64-cgo), const EBADRPC Errno +pkg syscall (netbsd-amd64-cgo), const ECHO ideal-int +pkg syscall (netbsd-amd64-cgo), const ECHOCTL ideal-int +pkg syscall (netbsd-amd64-cgo), const ECHOE ideal-int +pkg syscall (netbsd-amd64-cgo), const ECHOK ideal-int +pkg syscall (netbsd-amd64-cgo), const ECHOKE ideal-int +pkg syscall (netbsd-amd64-cgo), const ECHONL ideal-int +pkg syscall (netbsd-amd64-cgo), const ECHOPRT ideal-int +pkg syscall (netbsd-amd64-cgo), const EFTYPE Errno +pkg syscall (netbsd-amd64-cgo), const ELAST Errno +pkg syscall (netbsd-amd64-cgo), const EMULTIHOP Errno +pkg syscall (netbsd-amd64-cgo), const EMUL_LINUX ideal-int +pkg syscall (netbsd-amd64-cgo), const EMUL_LINUX32 ideal-int +pkg syscall (netbsd-amd64-cgo), const EMUL_MAXID ideal-int +pkg syscall (netbsd-amd64-cgo), const ENEEDAUTH Errno +pkg syscall (netbsd-amd64-cgo), const ENOATTR Errno +pkg syscall (netbsd-amd64-cgo), const ENODATA Errno +pkg syscall (netbsd-amd64-cgo), const ENOLINK Errno +pkg syscall (netbsd-amd64-cgo), const ENOSR Errno +pkg syscall (netbsd-amd64-cgo), const ENOSTR Errno +pkg syscall (netbsd-amd64-cgo), const EPROCLIM Errno +pkg syscall (netbsd-amd64-cgo), const EPROCUNAVAIL Errno +pkg syscall (netbsd-amd64-cgo), const EPROGMISMATCH Errno +pkg syscall (netbsd-amd64-cgo), const EPROGUNAVAIL Errno +pkg syscall (netbsd-amd64-cgo), const EPROTO Errno +pkg syscall (netbsd-amd64-cgo), const ERPCMISMATCH Errno +pkg syscall (netbsd-amd64-cgo), const ETHERCAP_JUMBO_MTU ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERCAP_VLAN_HWTAGGING ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERCAP_VLAN_MTU ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERMIN ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERMTU ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERMTU_JUMBO ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_8023 ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_AARP ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_ACCTON ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_AEONIC ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_ALPHA ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_AMBER ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_AMOEBA ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_APOLLO ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_APOLLODOMAIN ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_APPLETALK ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_APPLITEK ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_ARGONAUT ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_ARP ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_AT ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_ATALK ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_ATOMIC ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_ATT ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_ATTSTANFORD ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_AUTOPHON ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_AXIS ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_BCLOOP ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_BOFL ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_CABLETRON ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_CHAOS ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_COMDESIGN ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_COMPUGRAPHIC ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_COUNTERPOINT ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_CRONUS ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_CRONUSVLN ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_DCA ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_DDE ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_DEBNI ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_DECAM ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_DECCUST ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_DECDIAG ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_DECDNS ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_DECDTS ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_DECEXPER ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_DECLAST ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_DECLTM ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_DECMUMPS ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_DECNETBIOS ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_DELTACON ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_DIDDLE ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_DLOG1 ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_DLOG2 ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_DN ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_DOGFIGHT ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_DSMD ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_ECMA ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_ENCRYPT ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_ES ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_EXCELAN ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_EXPERDATA ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_FLIP ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_FLOWCONTROL ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_FRARP ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_GENDYN ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_HAYES ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_HIPPI_FP ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_HITACHI ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_HP ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_IEEEPUP ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_IEEEPUPAT ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_IMLBL ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_IMLBLDIAG ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_IP ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_IPAS ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_IPV6 ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_IPX ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_IPXNEW ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_KALPANA ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_LANBRIDGE ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_LANPROBE ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_LAT ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_LBACK ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_LITTLE ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_LOGICRAFT ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_LOOPBACK ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_MATRA ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_MAX ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_MERIT ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_MICP ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_MOPDL ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_MOPRC ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_MOTOROLA ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_MPLS ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_MPLS_MCAST ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_MUMPS ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_NBPCC ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_NBPCLAIM ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_NBPCLREQ ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_NBPCLRSP ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_NBPCREQ ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_NBPCRSP ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_NBPDG ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_NBPDGB ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_NBPDLTE ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_NBPRAR ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_NBPRAS ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_NBPRST ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_NBPSCD ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_NBPVCD ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_NBS ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_NCD ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_NESTAR ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_NETBEUI ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_NOVELL ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_NS ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_NSAT ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_NSCOMPAT ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_NTRAILER ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_OS9 ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_OS9NET ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_PACER ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_PAE ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_PCS ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_PLANNING ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_PPP ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_PPPOE ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_PPPOEDISC ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_PRIMENTS ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_PUP ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_PUPAT ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_RACAL ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_RATIONAL ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_RAWFR ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_RCL ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_RDP ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_RETIX ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_REVARP ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_SCA ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_SECTRA ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_SECUREDATA ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_SGITW ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_SG_BOUNCE ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_SG_DIAG ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_SG_NETGAMES ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_SG_RESV ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_SIMNET ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_SLOWPROTOCOLS ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_SNA ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_SNMP ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_SONIX ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_SPIDER ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_SPRITE ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_STP ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_TALARIS ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_TALARISMC ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_TCPCOMP ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_TCPSM ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_TEC ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_TIGAN ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_TRAIL ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_TRANSETHER ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_TYMSHARE ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_UBBST ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_UBDEBUG ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_UBDIAGLOOP ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_UBDL ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_UBNIU ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_UBNMC ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_VALID ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_VARIAN ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_VAXELN ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_VEECO ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_VEXP ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_VGLAB ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_VINES ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_VINESECHO ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_VINESLOOP ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_VITAL ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_VLAN ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_VLTLMAN ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_VPROD ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_VURESERVED ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_WATERLOO ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_WELLFLEET ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_X25 ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_X75 ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_XNSSM ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHERTYPE_XTP ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHER_ADDR_LEN ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHER_CRC_LEN ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHER_CRC_POLY_BE ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHER_CRC_POLY_LE ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHER_HDR_LEN ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHER_MAX_LEN ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHER_MAX_LEN_JUMBO ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHER_MIN_LEN ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHER_PPPOE_ENCAP_LEN ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHER_TYPE_LEN ideal-int +pkg syscall (netbsd-amd64-cgo), const ETHER_VLAN_ENCAP_LEN ideal-int +pkg syscall (netbsd-amd64-cgo), const ETIME Errno +pkg syscall (netbsd-amd64-cgo), const EVFILT_AIO ideal-int +pkg syscall (netbsd-amd64-cgo), const EVFILT_PROC ideal-int +pkg syscall (netbsd-amd64-cgo), const EVFILT_READ ideal-int +pkg syscall (netbsd-amd64-cgo), const EVFILT_SIGNAL ideal-int +pkg syscall (netbsd-amd64-cgo), const EVFILT_SYSCOUNT ideal-int +pkg syscall (netbsd-amd64-cgo), const EVFILT_TIMER ideal-int +pkg syscall (netbsd-amd64-cgo), const EVFILT_VNODE ideal-int +pkg syscall (netbsd-amd64-cgo), const EVFILT_WRITE ideal-int +pkg syscall (netbsd-amd64-cgo), const EV_ADD ideal-int +pkg syscall (netbsd-amd64-cgo), const EV_CLEAR ideal-int +pkg syscall (netbsd-amd64-cgo), const EV_DELETE ideal-int +pkg syscall (netbsd-amd64-cgo), const EV_DISABLE ideal-int +pkg syscall (netbsd-amd64-cgo), const EV_ENABLE ideal-int +pkg syscall (netbsd-amd64-cgo), const EV_EOF ideal-int +pkg syscall (netbsd-amd64-cgo), const EV_ERROR ideal-int +pkg syscall (netbsd-amd64-cgo), const EV_FLAG1 ideal-int +pkg syscall (netbsd-amd64-cgo), const EV_ONESHOT ideal-int +pkg syscall (netbsd-amd64-cgo), const EV_SYSFLAGS ideal-int +pkg syscall (netbsd-amd64-cgo), const EXTA ideal-int +pkg syscall (netbsd-amd64-cgo), const EXTB ideal-int +pkg syscall (netbsd-amd64-cgo), const EXTPROC ideal-int +pkg syscall (netbsd-amd64-cgo), const FD_CLOEXEC ideal-int +pkg syscall (netbsd-amd64-cgo), const FD_SETSIZE ideal-int +pkg syscall (netbsd-amd64-cgo), const FLUSHO ideal-int +pkg syscall (netbsd-amd64-cgo), const F_CLOSEM ideal-int +pkg syscall (netbsd-amd64-cgo), const F_DUPFD ideal-int +pkg syscall (netbsd-amd64-cgo), const F_DUPFD_CLOEXEC ideal-int +pkg syscall (netbsd-amd64-cgo), const F_FSCTL ideal-int +pkg syscall (netbsd-amd64-cgo), const F_FSDIRMASK ideal-int +pkg syscall (netbsd-amd64-cgo), const F_FSIN ideal-int +pkg syscall (netbsd-amd64-cgo), const F_FSINOUT ideal-int +pkg syscall (netbsd-amd64-cgo), const F_FSOUT ideal-int +pkg syscall (netbsd-amd64-cgo), const F_FSPRIV ideal-int +pkg syscall (netbsd-amd64-cgo), const F_FSVOID ideal-int +pkg syscall (netbsd-amd64-cgo), const F_GETFD ideal-int +pkg syscall (netbsd-amd64-cgo), const F_GETFL ideal-int +pkg syscall (netbsd-amd64-cgo), const F_GETLK ideal-int +pkg syscall (netbsd-amd64-cgo), const F_GETNOSIGPIPE ideal-int +pkg syscall (netbsd-amd64-cgo), const F_GETOWN ideal-int +pkg syscall (netbsd-amd64-cgo), const F_MAXFD ideal-int +pkg syscall (netbsd-amd64-cgo), const F_OK ideal-int +pkg syscall (netbsd-amd64-cgo), const F_PARAM_MASK ideal-int +pkg syscall (netbsd-amd64-cgo), const F_PARAM_MAX ideal-int +pkg syscall (netbsd-amd64-cgo), const F_RDLCK ideal-int +pkg syscall (netbsd-amd64-cgo), const F_SETFD ideal-int +pkg syscall (netbsd-amd64-cgo), const F_SETFL ideal-int +pkg syscall (netbsd-amd64-cgo), const F_SETLK ideal-int +pkg syscall (netbsd-amd64-cgo), const F_SETLKW ideal-int +pkg syscall (netbsd-amd64-cgo), const F_SETNOSIGPIPE ideal-int +pkg syscall (netbsd-amd64-cgo), const F_SETOWN ideal-int +pkg syscall (netbsd-amd64-cgo), const F_UNLCK ideal-int +pkg syscall (netbsd-amd64-cgo), const F_WRLCK ideal-int +pkg syscall (netbsd-amd64-cgo), const HUPCL ideal-int +pkg syscall (netbsd-amd64-cgo), const ICANON ideal-int +pkg syscall (netbsd-amd64-cgo), const ICMP6_FILTER = 18 +pkg syscall (netbsd-amd64-cgo), const ICMP6_FILTER ideal-int +pkg syscall (netbsd-amd64-cgo), const ICRNL ideal-int +pkg syscall (netbsd-amd64-cgo), const IEXTEN ideal-int +pkg syscall (netbsd-amd64-cgo), const IFAN_ARRIVAL ideal-int +pkg syscall (netbsd-amd64-cgo), const IFAN_DEPARTURE ideal-int +pkg syscall (netbsd-amd64-cgo), const IFA_ROUTE ideal-int +pkg syscall (netbsd-amd64-cgo), const IFF_ALLMULTI ideal-int +pkg syscall (netbsd-amd64-cgo), const IFF_CANTCHANGE ideal-int +pkg syscall (netbsd-amd64-cgo), const IFF_DEBUG ideal-int +pkg syscall (netbsd-amd64-cgo), const IFF_LINK0 ideal-int +pkg syscall (netbsd-amd64-cgo), const IFF_LINK1 ideal-int +pkg syscall (netbsd-amd64-cgo), const IFF_LINK2 ideal-int +pkg syscall (netbsd-amd64-cgo), const IFF_NOARP ideal-int +pkg syscall (netbsd-amd64-cgo), const IFF_NOTRAILERS ideal-int +pkg syscall (netbsd-amd64-cgo), const IFF_OACTIVE ideal-int +pkg syscall (netbsd-amd64-cgo), const IFF_POINTOPOINT ideal-int +pkg syscall (netbsd-amd64-cgo), const IFF_PROMISC ideal-int +pkg syscall (netbsd-amd64-cgo), const IFF_RUNNING ideal-int +pkg syscall (netbsd-amd64-cgo), const IFF_SIMPLEX ideal-int +pkg syscall (netbsd-amd64-cgo), const IFNAMSIZ ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_1822 ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_A12MPPSWITCH ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_AAL2 ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_AAL5 ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_ADSL ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_AFLANE8023 ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_AFLANE8025 ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_ARAP ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_ARCNET ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_ARCNETPLUS ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_ASYNC ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_ATM ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_ATMDXI ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_ATMFUNI ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_ATMIMA ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_ATMLOGICAL ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_ATMRADIO ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_ATMSUBINTERFACE ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_ATMVCIENDPT ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_ATMVIRTUAL ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_BGPPOLICYACCOUNTING ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_BRIDGE ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_BSC ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_CARP ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_CCTEMUL ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_CEPT ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_CES ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_CHANNEL ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_CNR ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_COFFEE ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_COMPOSITELINK ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_DCN ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_DIGITALPOWERLINE ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_DIGITALWRAPPEROVERHEADCHANNEL ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_DLSW ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_DOCSCABLEDOWNSTREAM ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_DOCSCABLEMACLAYER ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_DOCSCABLEUPSTREAM ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_DOCSCABLEUPSTREAMCHANNEL ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_DS0 ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_DS0BUNDLE ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_DS1FDL ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_DS3 ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_DTM ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_DVBASILN ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_DVBASIOUT ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_DVBRCCDOWNSTREAM ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_DVBRCCMACLAYER ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_DVBRCCUPSTREAM ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_ECONET ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_EON ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_EPLRS ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_ESCON ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_ETHER ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_FAITH ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_FAST ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_FASTETHER ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_FASTETHERFX ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_FDDI ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_FIBRECHANNEL ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_FRAMERELAYINTERCONNECT ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_FRAMERELAYMPI ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_FRDLCIENDPT ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_FRELAY ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_FRELAYDCE ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_FRF16MFRBUNDLE ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_FRFORWARD ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_G703AT2MB ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_G703AT64K ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_GIF ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_GIGABITETHERNET ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_GR303IDT ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_GR303RDT ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_H323GATEKEEPER ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_H323PROXY ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_HDH1822 ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_HDLC ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_HDSL2 ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_HIPERLAN2 ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_HIPPI ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_HIPPIINTERFACE ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_HOSTPAD ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_HSSI ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_HY ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_IBM370PARCHAN ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_IDSL ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_IEEE1394 ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_IEEE80211 ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_IEEE80212 ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_IEEE8023ADLAG ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_IFGSN ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_IMT ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_INFINIBAND ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_INTERLEAVE ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_IP ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_IPFORWARD ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_IPOVERATM ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_IPOVERCDLC ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_IPOVERCLAW ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_IPSWITCH ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_ISDN ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_ISDNBASIC ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_ISDNPRIMARY ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_ISDNS ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_ISDNU ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_ISO88022LLC ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_ISO88023 ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_ISO88024 ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_ISO88025 ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_ISO88025CRFPINT ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_ISO88025DTR ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_ISO88025FIBER ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_ISO88026 ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_ISUP ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_L2VLAN ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_L3IPVLAN ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_L3IPXVLAN ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_LAPB ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_LAPD ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_LAPF ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_LINEGROUP ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_LOCALTALK ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_LOOP ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_MEDIAMAILOVERIP ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_MFSIGLINK ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_MIOX25 ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_MODEM ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_MPC ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_MPLS ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_MPLSTUNNEL ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_MSDSL ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_MVL ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_MYRINET ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_NFAS ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_NSIP ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_OPTICALCHANNEL ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_OPTICALTRANSPORT ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_OTHER ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_P10 ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_P80 ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_PARA ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_PFLOG ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_PFSYNC ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_PLC ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_PON155 ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_PON622 ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_POS ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_PPP ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_PPPMULTILINKBUNDLE ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_PROPATM ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_PROPBWAP2MP ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_PROPCNLS ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_PROPDOCSWIRELESSDOWNSTREAM ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_PROPDOCSWIRELESSMACLAYER ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_PROPDOCSWIRELESSUPSTREAM ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_PROPMUX ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_PROPVIRTUAL ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_PROPWIRELESSP2P ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_PTPSERIAL ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_PVC ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_Q2931 ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_QLLC ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_RADIOMAC ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_RADSL ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_REACHDSL ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_RFC1483 ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_RS232 ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_RSRB ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_SDLC ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_SDSL ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_SHDSL ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_SIP ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_SIPSIG ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_SIPTG ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_SLIP ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_SMDSDXI ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_SMDSICIP ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_SONET ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_SONETOVERHEADCHANNEL ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_SONETPATH ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_SONETVT ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_SRP ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_SS7SIGLINK ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_STACKTOSTACK ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_STARLAN ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_STF ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_T1 ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_TDLC ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_TELINK ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_TERMPAD ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_TR008 ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_TRANSPHDLC ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_TUNNEL ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_ULTRA ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_USB ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_V11 ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_V35 ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_V36 ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_V37 ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_VDSL ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_VIRTUALIPADDRESS ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_VIRTUALTG ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_VOICEDID ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_VOICEEM ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_VOICEEMFGD ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_VOICEENCAP ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_VOICEFGDEANA ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_VOICEFXO ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_VOICEFXS ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_VOICEOVERATM ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_VOICEOVERCABLE ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_VOICEOVERFRAMERELAY ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_VOICEOVERIP ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_X213 ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_X25 ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_X25DDN ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_X25HUNTGROUP ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_X25MLP ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_X25PLE ideal-int +pkg syscall (netbsd-amd64-cgo), const IFT_XETHER ideal-int +pkg syscall (netbsd-amd64-cgo), const IGNBRK ideal-int +pkg syscall (netbsd-amd64-cgo), const IGNCR ideal-int +pkg syscall (netbsd-amd64-cgo), const IGNPAR ideal-int +pkg syscall (netbsd-amd64-cgo), const IMAXBEL ideal-int +pkg syscall (netbsd-amd64-cgo), const INLCR ideal-int +pkg syscall (netbsd-amd64-cgo), const INPCK ideal-int +pkg syscall (netbsd-amd64-cgo), const IN_CLASSA_HOST ideal-int +pkg syscall (netbsd-amd64-cgo), const IN_CLASSA_MAX ideal-int +pkg syscall (netbsd-amd64-cgo), const IN_CLASSA_NET ideal-int +pkg syscall (netbsd-amd64-cgo), const IN_CLASSA_NSHIFT ideal-int +pkg syscall (netbsd-amd64-cgo), const IN_CLASSB_HOST ideal-int +pkg syscall (netbsd-amd64-cgo), const IN_CLASSB_MAX ideal-int +pkg syscall (netbsd-amd64-cgo), const IN_CLASSB_NET ideal-int +pkg syscall (netbsd-amd64-cgo), const IN_CLASSB_NSHIFT ideal-int +pkg syscall (netbsd-amd64-cgo), const IN_CLASSC_HOST ideal-int +pkg syscall (netbsd-amd64-cgo), const IN_CLASSC_NET ideal-int +pkg syscall (netbsd-amd64-cgo), const IN_CLASSC_NSHIFT ideal-int +pkg syscall (netbsd-amd64-cgo), const IN_CLASSD_HOST ideal-int +pkg syscall (netbsd-amd64-cgo), const IN_CLASSD_NET ideal-int +pkg syscall (netbsd-amd64-cgo), const IN_CLASSD_NSHIFT ideal-int +pkg syscall (netbsd-amd64-cgo), const IN_LOOPBACKNET ideal-int +pkg syscall (netbsd-amd64-cgo), const IPPROTO_AH ideal-int +pkg syscall (netbsd-amd64-cgo), const IPPROTO_CARP ideal-int +pkg syscall (netbsd-amd64-cgo), const IPPROTO_DONE ideal-int +pkg syscall (netbsd-amd64-cgo), const IPPROTO_DSTOPTS ideal-int +pkg syscall (netbsd-amd64-cgo), const IPPROTO_EGP ideal-int +pkg syscall (netbsd-amd64-cgo), const IPPROTO_ENCAP ideal-int +pkg syscall (netbsd-amd64-cgo), const IPPROTO_EON ideal-int +pkg syscall (netbsd-amd64-cgo), const IPPROTO_ESP ideal-int +pkg syscall (netbsd-amd64-cgo), const IPPROTO_ETHERIP ideal-int +pkg syscall (netbsd-amd64-cgo), const IPPROTO_FRAGMENT ideal-int +pkg syscall (netbsd-amd64-cgo), const IPPROTO_GGP ideal-int +pkg syscall (netbsd-amd64-cgo), const IPPROTO_GRE ideal-int +pkg syscall (netbsd-amd64-cgo), const IPPROTO_HOPOPTS ideal-int +pkg syscall (netbsd-amd64-cgo), const IPPROTO_ICMP ideal-int +pkg syscall (netbsd-amd64-cgo), const IPPROTO_ICMPV6 ideal-int +pkg syscall (netbsd-amd64-cgo), const IPPROTO_IDP ideal-int +pkg syscall (netbsd-amd64-cgo), const IPPROTO_IGMP ideal-int +pkg syscall (netbsd-amd64-cgo), const IPPROTO_IPCOMP ideal-int +pkg syscall (netbsd-amd64-cgo), const IPPROTO_IPIP ideal-int +pkg syscall (netbsd-amd64-cgo), const IPPROTO_IPV4 ideal-int +pkg syscall (netbsd-amd64-cgo), const IPPROTO_IPV6_ICMP ideal-int +pkg syscall (netbsd-amd64-cgo), const IPPROTO_MAX ideal-int +pkg syscall (netbsd-amd64-cgo), const IPPROTO_MAXID ideal-int +pkg syscall (netbsd-amd64-cgo), const IPPROTO_MOBILE ideal-int +pkg syscall (netbsd-amd64-cgo), const IPPROTO_NONE ideal-int +pkg syscall (netbsd-amd64-cgo), const IPPROTO_PFSYNC ideal-int +pkg syscall (netbsd-amd64-cgo), const IPPROTO_PIM ideal-int +pkg syscall (netbsd-amd64-cgo), const IPPROTO_PUP ideal-int +pkg syscall (netbsd-amd64-cgo), const IPPROTO_RAW ideal-int +pkg syscall (netbsd-amd64-cgo), const IPPROTO_ROUTING ideal-int +pkg syscall (netbsd-amd64-cgo), const IPPROTO_RSVP ideal-int +pkg syscall (netbsd-amd64-cgo), const IPPROTO_TP ideal-int +pkg syscall (netbsd-amd64-cgo), const IPPROTO_VRRP ideal-int +pkg syscall (netbsd-amd64-cgo), const IPV6_CHECKSUM ideal-int +pkg syscall (netbsd-amd64-cgo), const IPV6_DEFAULT_MULTICAST_HOPS ideal-int +pkg syscall (netbsd-amd64-cgo), const IPV6_DEFAULT_MULTICAST_LOOP ideal-int +pkg syscall (netbsd-amd64-cgo), const IPV6_DEFHLIM ideal-int +pkg syscall (netbsd-amd64-cgo), const IPV6_DONTFRAG ideal-int +pkg syscall (netbsd-amd64-cgo), const IPV6_DSTOPTS ideal-int +pkg syscall (netbsd-amd64-cgo), const IPV6_FAITH ideal-int +pkg syscall (netbsd-amd64-cgo), const IPV6_FLOWINFO_MASK ideal-int +pkg syscall (netbsd-amd64-cgo), const IPV6_FLOWLABEL_MASK ideal-int +pkg syscall (netbsd-amd64-cgo), const IPV6_FRAGTTL ideal-int +pkg syscall (netbsd-amd64-cgo), const IPV6_HLIMDEC ideal-int +pkg syscall (netbsd-amd64-cgo), const IPV6_HOPLIMIT ideal-int +pkg syscall (netbsd-amd64-cgo), const IPV6_HOPOPTS ideal-int +pkg syscall (netbsd-amd64-cgo), const IPV6_IPSEC_POLICY ideal-int +pkg syscall (netbsd-amd64-cgo), const IPV6_MAXHLIM ideal-int +pkg syscall (netbsd-amd64-cgo), const IPV6_MAXPACKET ideal-int +pkg syscall (netbsd-amd64-cgo), const IPV6_MMTU ideal-int +pkg syscall (netbsd-amd64-cgo), const IPV6_NEXTHOP ideal-int +pkg syscall (netbsd-amd64-cgo), const IPV6_PATHMTU ideal-int +pkg syscall (netbsd-amd64-cgo), const IPV6_PKTINFO ideal-int +pkg syscall (netbsd-amd64-cgo), const IPV6_PORTRANGE ideal-int +pkg syscall (netbsd-amd64-cgo), const IPV6_PORTRANGE_DEFAULT ideal-int +pkg syscall (netbsd-amd64-cgo), const IPV6_PORTRANGE_HIGH ideal-int +pkg syscall (netbsd-amd64-cgo), const IPV6_PORTRANGE_LOW ideal-int +pkg syscall (netbsd-amd64-cgo), const IPV6_RECVDSTOPTS ideal-int +pkg syscall (netbsd-amd64-cgo), const IPV6_RECVHOPLIMIT ideal-int +pkg syscall (netbsd-amd64-cgo), const IPV6_RECVHOPOPTS ideal-int +pkg syscall (netbsd-amd64-cgo), const IPV6_RECVPATHMTU ideal-int +pkg syscall (netbsd-amd64-cgo), const IPV6_RECVPKTINFO ideal-int +pkg syscall (netbsd-amd64-cgo), const IPV6_RECVRTHDR ideal-int +pkg syscall (netbsd-amd64-cgo), const IPV6_RECVTCLASS ideal-int +pkg syscall (netbsd-amd64-cgo), const IPV6_RTHDR ideal-int +pkg syscall (netbsd-amd64-cgo), const IPV6_RTHDRDSTOPTS ideal-int +pkg syscall (netbsd-amd64-cgo), const IPV6_RTHDR_LOOSE ideal-int +pkg syscall (netbsd-amd64-cgo), const IPV6_RTHDR_STRICT ideal-int +pkg syscall (netbsd-amd64-cgo), const IPV6_RTHDR_TYPE_0 ideal-int +pkg syscall (netbsd-amd64-cgo), const IPV6_SOCKOPT_RESERVED1 ideal-int +pkg syscall (netbsd-amd64-cgo), const IPV6_TCLASS ideal-int +pkg syscall (netbsd-amd64-cgo), const IPV6_USE_MIN_MTU ideal-int +pkg syscall (netbsd-amd64-cgo), const IPV6_VERSION ideal-int +pkg syscall (netbsd-amd64-cgo), const IPV6_VERSION_MASK ideal-int +pkg syscall (netbsd-amd64-cgo), const IP_DEFAULT_MULTICAST_LOOP ideal-int +pkg syscall (netbsd-amd64-cgo), const IP_DEFAULT_MULTICAST_TTL ideal-int +pkg syscall (netbsd-amd64-cgo), const IP_DF ideal-int +pkg syscall (netbsd-amd64-cgo), const IP_EF ideal-int +pkg syscall (netbsd-amd64-cgo), const IP_ERRORMTU ideal-int +pkg syscall (netbsd-amd64-cgo), const IP_HDRINCL ideal-int +pkg syscall (netbsd-amd64-cgo), const IP_IPSEC_POLICY ideal-int +pkg syscall (netbsd-amd64-cgo), const IP_MAXPACKET ideal-int +pkg syscall (netbsd-amd64-cgo), const IP_MAX_MEMBERSHIPS ideal-int +pkg syscall (netbsd-amd64-cgo), const IP_MF ideal-int +pkg syscall (netbsd-amd64-cgo), const IP_MINFRAGSIZE ideal-int +pkg syscall (netbsd-amd64-cgo), const IP_MINTTL ideal-int +pkg syscall (netbsd-amd64-cgo), const IP_MSS ideal-int +pkg syscall (netbsd-amd64-cgo), const IP_OFFMASK ideal-int +pkg syscall (netbsd-amd64-cgo), const IP_OPTIONS ideal-int +pkg syscall (netbsd-amd64-cgo), const IP_PORTRANGE ideal-int +pkg syscall (netbsd-amd64-cgo), const IP_PORTRANGE_DEFAULT ideal-int +pkg syscall (netbsd-amd64-cgo), const IP_PORTRANGE_HIGH ideal-int +pkg syscall (netbsd-amd64-cgo), const IP_PORTRANGE_LOW ideal-int +pkg syscall (netbsd-amd64-cgo), const IP_RECVDSTADDR ideal-int +pkg syscall (netbsd-amd64-cgo), const IP_RECVIF ideal-int +pkg syscall (netbsd-amd64-cgo), const IP_RECVOPTS ideal-int +pkg syscall (netbsd-amd64-cgo), const IP_RECVRETOPTS ideal-int +pkg syscall (netbsd-amd64-cgo), const IP_RECVTTL ideal-int +pkg syscall (netbsd-amd64-cgo), const IP_RETOPTS ideal-int +pkg syscall (netbsd-amd64-cgo), const IP_RF ideal-int +pkg syscall (netbsd-amd64-cgo), const ISIG ideal-int +pkg syscall (netbsd-amd64-cgo), const ISTRIP ideal-int +pkg syscall (netbsd-amd64-cgo), const IXANY ideal-int +pkg syscall (netbsd-amd64-cgo), const IXOFF ideal-int +pkg syscall (netbsd-amd64-cgo), const IXON ideal-int +pkg syscall (netbsd-amd64-cgo), const LOCK_EX ideal-int +pkg syscall (netbsd-amd64-cgo), const LOCK_NB ideal-int +pkg syscall (netbsd-amd64-cgo), const LOCK_SH ideal-int +pkg syscall (netbsd-amd64-cgo), const LOCK_UN ideal-int +pkg syscall (netbsd-amd64-cgo), const MSG_BCAST ideal-int +pkg syscall (netbsd-amd64-cgo), const MSG_CMSG_CLOEXEC ideal-int +pkg syscall (netbsd-amd64-cgo), const MSG_CONTROLMBUF ideal-int +pkg syscall (netbsd-amd64-cgo), const MSG_CTRUNC ideal-int +pkg syscall (netbsd-amd64-cgo), const MSG_DONTROUTE ideal-int +pkg syscall (netbsd-amd64-cgo), const MSG_DONTWAIT ideal-int +pkg syscall (netbsd-amd64-cgo), const MSG_EOR ideal-int +pkg syscall (netbsd-amd64-cgo), const MSG_IOVUSRSPACE ideal-int +pkg syscall (netbsd-amd64-cgo), const MSG_LENUSRSPACE ideal-int +pkg syscall (netbsd-amd64-cgo), const MSG_MCAST ideal-int +pkg syscall (netbsd-amd64-cgo), const MSG_NAMEMBUF ideal-int +pkg syscall (netbsd-amd64-cgo), const MSG_NBIO ideal-int +pkg syscall (netbsd-amd64-cgo), const MSG_NOSIGNAL ideal-int +pkg syscall (netbsd-amd64-cgo), const MSG_OOB ideal-int +pkg syscall (netbsd-amd64-cgo), const MSG_PEEK ideal-int +pkg syscall (netbsd-amd64-cgo), const MSG_TRUNC ideal-int +pkg syscall (netbsd-amd64-cgo), const MSG_USERFLAGS ideal-int +pkg syscall (netbsd-amd64-cgo), const MSG_WAITALL ideal-int +pkg syscall (netbsd-amd64-cgo), const NAME_MAX ideal-int +pkg syscall (netbsd-amd64-cgo), const NET_RT_DUMP ideal-int +pkg syscall (netbsd-amd64-cgo), const NET_RT_FLAGS ideal-int +pkg syscall (netbsd-amd64-cgo), const NET_RT_IFLIST ideal-int +pkg syscall (netbsd-amd64-cgo), const NET_RT_MAXID ideal-int +pkg syscall (netbsd-amd64-cgo), const NET_RT_OIFLIST ideal-int +pkg syscall (netbsd-amd64-cgo), const NET_RT_OOIFLIST ideal-int +pkg syscall (netbsd-amd64-cgo), const NOFLSH ideal-int +pkg syscall (netbsd-amd64-cgo), const NOTE_ATTRIB ideal-int +pkg syscall (netbsd-amd64-cgo), const NOTE_CHILD ideal-int +pkg syscall (netbsd-amd64-cgo), const NOTE_DELETE ideal-int +pkg syscall (netbsd-amd64-cgo), const NOTE_EXEC ideal-int +pkg syscall (netbsd-amd64-cgo), const NOTE_EXIT ideal-int +pkg syscall (netbsd-amd64-cgo), const NOTE_EXTEND ideal-int +pkg syscall (netbsd-amd64-cgo), const NOTE_FORK ideal-int +pkg syscall (netbsd-amd64-cgo), const NOTE_LINK ideal-int +pkg syscall (netbsd-amd64-cgo), const NOTE_LOWAT ideal-int +pkg syscall (netbsd-amd64-cgo), const NOTE_PCTRLMASK ideal-int +pkg syscall (netbsd-amd64-cgo), const NOTE_PDATAMASK ideal-int +pkg syscall (netbsd-amd64-cgo), const NOTE_RENAME ideal-int +pkg syscall (netbsd-amd64-cgo), const NOTE_REVOKE ideal-int +pkg syscall (netbsd-amd64-cgo), const NOTE_TRACK ideal-int +pkg syscall (netbsd-amd64-cgo), const NOTE_TRACKERR ideal-int +pkg syscall (netbsd-amd64-cgo), const NOTE_WRITE ideal-int +pkg syscall (netbsd-amd64-cgo), const OCRNL ideal-int +pkg syscall (netbsd-amd64-cgo), const OFIOGETBMAP ideal-int +pkg syscall (netbsd-amd64-cgo), const ONLCR ideal-int +pkg syscall (netbsd-amd64-cgo), const ONLRET ideal-int +pkg syscall (netbsd-amd64-cgo), const ONOCR ideal-int +pkg syscall (netbsd-amd64-cgo), const ONOEOT ideal-int +pkg syscall (netbsd-amd64-cgo), const OPOST ideal-int +pkg syscall (netbsd-amd64-cgo), const O_ACCMODE ideal-int +pkg syscall (netbsd-amd64-cgo), const O_ALT_IO ideal-int +pkg syscall (netbsd-amd64-cgo), const O_DIRECT ideal-int +pkg syscall (netbsd-amd64-cgo), const O_DIRECTORY ideal-int +pkg syscall (netbsd-amd64-cgo), const O_DSYNC ideal-int +pkg syscall (netbsd-amd64-cgo), const O_EXLOCK ideal-int +pkg syscall (netbsd-amd64-cgo), const O_FSYNC ideal-int +pkg syscall (netbsd-amd64-cgo), const O_NDELAY ideal-int +pkg syscall (netbsd-amd64-cgo), const O_NOFOLLOW ideal-int +pkg syscall (netbsd-amd64-cgo), const O_NOSIGPIPE ideal-int +pkg syscall (netbsd-amd64-cgo), const O_RSYNC ideal-int +pkg syscall (netbsd-amd64-cgo), const O_SHLOCK ideal-int +pkg syscall (netbsd-amd64-cgo), const PARENB ideal-int +pkg syscall (netbsd-amd64-cgo), const PARMRK ideal-int +pkg syscall (netbsd-amd64-cgo), const PARODD ideal-int +pkg syscall (netbsd-amd64-cgo), const PENDIN ideal-int +pkg syscall (netbsd-amd64-cgo), const PRIO_PGRP = 1 +pkg syscall (netbsd-amd64-cgo), const PRIO_PGRP ideal-int +pkg syscall (netbsd-amd64-cgo), const PRIO_PROCESS = 0 +pkg syscall (netbsd-amd64-cgo), const PRIO_PROCESS ideal-int +pkg syscall (netbsd-amd64-cgo), const PRIO_USER = 2 +pkg syscall (netbsd-amd64-cgo), const PRIO_USER ideal-int +pkg syscall (netbsd-amd64-cgo), const PRI_IOFLUSH ideal-int +pkg syscall (netbsd-amd64-cgo), const PTRACE_CONT ideal-int +pkg syscall (netbsd-amd64-cgo), const PTRACE_KILL ideal-int +pkg syscall (netbsd-amd64-cgo), const PTRACE_TRACEME ideal-int +pkg syscall (netbsd-amd64-cgo), const RLIMIT_AS ideal-int +pkg syscall (netbsd-amd64-cgo), const RLIMIT_CORE ideal-int +pkg syscall (netbsd-amd64-cgo), const RLIMIT_CPU ideal-int +pkg syscall (netbsd-amd64-cgo), const RLIMIT_DATA ideal-int +pkg syscall (netbsd-amd64-cgo), const RLIMIT_FSIZE ideal-int +pkg syscall (netbsd-amd64-cgo), const RLIMIT_NOFILE ideal-int +pkg syscall (netbsd-amd64-cgo), const RLIMIT_STACK ideal-int +pkg syscall (netbsd-amd64-cgo), const RLIM_INFINITY ideal-int +pkg syscall (netbsd-amd64-cgo), const RTAX_AUTHOR ideal-int +pkg syscall (netbsd-amd64-cgo), const RTAX_BRD ideal-int +pkg syscall (netbsd-amd64-cgo), const RTAX_DST ideal-int +pkg syscall (netbsd-amd64-cgo), const RTAX_GATEWAY ideal-int +pkg syscall (netbsd-amd64-cgo), const RTAX_GENMASK ideal-int +pkg syscall (netbsd-amd64-cgo), const RTAX_IFA ideal-int +pkg syscall (netbsd-amd64-cgo), const RTAX_IFP ideal-int +pkg syscall (netbsd-amd64-cgo), const RTAX_MAX ideal-int +pkg syscall (netbsd-amd64-cgo), const RTAX_NETMASK ideal-int +pkg syscall (netbsd-amd64-cgo), const RTAX_TAG ideal-int +pkg syscall (netbsd-amd64-cgo), const RTA_AUTHOR ideal-int +pkg syscall (netbsd-amd64-cgo), const RTA_BRD ideal-int +pkg syscall (netbsd-amd64-cgo), const RTA_DST ideal-int +pkg syscall (netbsd-amd64-cgo), const RTA_GATEWAY ideal-int +pkg syscall (netbsd-amd64-cgo), const RTA_GENMASK ideal-int +pkg syscall (netbsd-amd64-cgo), const RTA_IFA ideal-int +pkg syscall (netbsd-amd64-cgo), const RTA_IFP ideal-int +pkg syscall (netbsd-amd64-cgo), const RTA_NETMASK ideal-int +pkg syscall (netbsd-amd64-cgo), const RTA_TAG ideal-int +pkg syscall (netbsd-amd64-cgo), const RTF_ANNOUNCE ideal-int +pkg syscall (netbsd-amd64-cgo), const RTF_BLACKHOLE ideal-int +pkg syscall (netbsd-amd64-cgo), const RTF_CLONED ideal-int +pkg syscall (netbsd-amd64-cgo), const RTF_CLONING ideal-int +pkg syscall (netbsd-amd64-cgo), const RTF_DONE ideal-int +pkg syscall (netbsd-amd64-cgo), const RTF_DYNAMIC ideal-int +pkg syscall (netbsd-amd64-cgo), const RTF_GATEWAY ideal-int +pkg syscall (netbsd-amd64-cgo), const RTF_HOST ideal-int +pkg syscall (netbsd-amd64-cgo), const RTF_LLINFO ideal-int +pkg syscall (netbsd-amd64-cgo), const RTF_MASK ideal-int +pkg syscall (netbsd-amd64-cgo), const RTF_MODIFIED ideal-int +pkg syscall (netbsd-amd64-cgo), const RTF_PROTO1 ideal-int +pkg syscall (netbsd-amd64-cgo), const RTF_PROTO2 ideal-int +pkg syscall (netbsd-amd64-cgo), const RTF_REJECT ideal-int +pkg syscall (netbsd-amd64-cgo), const RTF_SRC ideal-int +pkg syscall (netbsd-amd64-cgo), const RTF_STATIC ideal-int +pkg syscall (netbsd-amd64-cgo), const RTF_UP ideal-int +pkg syscall (netbsd-amd64-cgo), const RTF_XRESOLVE ideal-int +pkg syscall (netbsd-amd64-cgo), const RTM_ADD ideal-int +pkg syscall (netbsd-amd64-cgo), const RTM_CHANGE ideal-int +pkg syscall (netbsd-amd64-cgo), const RTM_CHGADDR ideal-int +pkg syscall (netbsd-amd64-cgo), const RTM_DELADDR ideal-int +pkg syscall (netbsd-amd64-cgo), const RTM_DELETE ideal-int +pkg syscall (netbsd-amd64-cgo), const RTM_GET ideal-int +pkg syscall (netbsd-amd64-cgo), const RTM_IEEE80211 ideal-int +pkg syscall (netbsd-amd64-cgo), const RTM_IFANNOUNCE ideal-int +pkg syscall (netbsd-amd64-cgo), const RTM_IFINFO ideal-int +pkg syscall (netbsd-amd64-cgo), const RTM_LLINFO_UPD ideal-int +pkg syscall (netbsd-amd64-cgo), const RTM_LOCK ideal-int +pkg syscall (netbsd-amd64-cgo), const RTM_LOSING ideal-int +pkg syscall (netbsd-amd64-cgo), const RTM_MISS ideal-int +pkg syscall (netbsd-amd64-cgo), const RTM_NEWADDR ideal-int +pkg syscall (netbsd-amd64-cgo), const RTM_OIFINFO ideal-int +pkg syscall (netbsd-amd64-cgo), const RTM_OLDADD ideal-int +pkg syscall (netbsd-amd64-cgo), const RTM_OLDDEL ideal-int +pkg syscall (netbsd-amd64-cgo), const RTM_OOIFINFO ideal-int +pkg syscall (netbsd-amd64-cgo), const RTM_REDIRECT ideal-int +pkg syscall (netbsd-amd64-cgo), const RTM_RESOLVE ideal-int +pkg syscall (netbsd-amd64-cgo), const RTM_RTTUNIT ideal-int +pkg syscall (netbsd-amd64-cgo), const RTM_SETGATE ideal-int +pkg syscall (netbsd-amd64-cgo), const RTM_VERSION ideal-int +pkg syscall (netbsd-amd64-cgo), const RTV_EXPIRE ideal-int +pkg syscall (netbsd-amd64-cgo), const RTV_HOPCOUNT ideal-int +pkg syscall (netbsd-amd64-cgo), const RTV_MTU ideal-int +pkg syscall (netbsd-amd64-cgo), const RTV_RPIPE ideal-int +pkg syscall (netbsd-amd64-cgo), const RTV_RTT ideal-int +pkg syscall (netbsd-amd64-cgo), const RTV_RTTVAR ideal-int +pkg syscall (netbsd-amd64-cgo), const RTV_SPIPE ideal-int +pkg syscall (netbsd-amd64-cgo), const RTV_SSTHRESH ideal-int +pkg syscall (netbsd-amd64-cgo), const RUSAGE_CHILDREN ideal-int +pkg syscall (netbsd-amd64-cgo), const RUSAGE_SELF ideal-int +pkg syscall (netbsd-amd64-cgo), const SCM_CREDS ideal-int +pkg syscall (netbsd-amd64-cgo), const SCM_RIGHTS ideal-int +pkg syscall (netbsd-amd64-cgo), const SCM_TIMESTAMP ideal-int +pkg syscall (netbsd-amd64-cgo), const SIGCHLD Signal +pkg syscall (netbsd-amd64-cgo), const SIGCONT Signal +pkg syscall (netbsd-amd64-cgo), const SIGEMT Signal +pkg syscall (netbsd-amd64-cgo), const SIGINFO Signal +pkg syscall (netbsd-amd64-cgo), const SIGIO Signal +pkg syscall (netbsd-amd64-cgo), const SIGIOT Signal +pkg syscall (netbsd-amd64-cgo), const SIGPROF Signal +pkg syscall (netbsd-amd64-cgo), const SIGPWR Signal +pkg syscall (netbsd-amd64-cgo), const SIGSTOP Signal +pkg syscall (netbsd-amd64-cgo), const SIGSYS Signal +pkg syscall (netbsd-amd64-cgo), const SIGTSTP Signal +pkg syscall (netbsd-amd64-cgo), const SIGTTIN Signal +pkg syscall (netbsd-amd64-cgo), const SIGTTOU Signal +pkg syscall (netbsd-amd64-cgo), const SIGURG Signal +pkg syscall (netbsd-amd64-cgo), const SIGUSR1 Signal +pkg syscall (netbsd-amd64-cgo), const SIGUSR2 Signal +pkg syscall (netbsd-amd64-cgo), const SIGVTALRM Signal +pkg syscall (netbsd-amd64-cgo), const SIGWINCH Signal +pkg syscall (netbsd-amd64-cgo), const SIGXCPU Signal +pkg syscall (netbsd-amd64-cgo), const SIGXFSZ Signal +pkg syscall (netbsd-amd64-cgo), const SIOCADDMULTI ideal-int +pkg syscall (netbsd-amd64-cgo), const SIOCADDRT ideal-int +pkg syscall (netbsd-amd64-cgo), const SIOCAIFADDR ideal-int +pkg syscall (netbsd-amd64-cgo), const SIOCALIFADDR ideal-int +pkg syscall (netbsd-amd64-cgo), const SIOCATMARK ideal-int +pkg syscall (netbsd-amd64-cgo), const SIOCDELMULTI ideal-int +pkg syscall (netbsd-amd64-cgo), const SIOCDELRT ideal-int +pkg syscall (netbsd-amd64-cgo), const SIOCDIFADDR ideal-int +pkg syscall (netbsd-amd64-cgo), const SIOCDIFPHYADDR ideal-int +pkg syscall (netbsd-amd64-cgo), const SIOCDLIFADDR ideal-int +pkg syscall (netbsd-amd64-cgo), const SIOCGDRVSPEC ideal-int +pkg syscall (netbsd-amd64-cgo), const SIOCGETPFSYNC ideal-int +pkg syscall (netbsd-amd64-cgo), const SIOCGETSGCNT ideal-int +pkg syscall (netbsd-amd64-cgo), const SIOCGETVIFCNT ideal-int +pkg syscall (netbsd-amd64-cgo), const SIOCGHIWAT ideal-int +pkg syscall (netbsd-amd64-cgo), const SIOCGIFADDR ideal-int +pkg syscall (netbsd-amd64-cgo), const SIOCGIFADDRPREF ideal-int +pkg syscall (netbsd-amd64-cgo), const SIOCGIFALIAS ideal-int +pkg syscall (netbsd-amd64-cgo), const SIOCGIFBRDADDR ideal-int +pkg syscall (netbsd-amd64-cgo), const SIOCGIFCAP ideal-int +pkg syscall (netbsd-amd64-cgo), const SIOCGIFCONF ideal-int +pkg syscall (netbsd-amd64-cgo), const SIOCGIFDATA ideal-int +pkg syscall (netbsd-amd64-cgo), const SIOCGIFDLT ideal-int +pkg syscall (netbsd-amd64-cgo), const SIOCGIFDSTADDR ideal-int +pkg syscall (netbsd-amd64-cgo), const SIOCGIFFLAGS ideal-int +pkg syscall (netbsd-amd64-cgo), const SIOCGIFGENERIC ideal-int +pkg syscall (netbsd-amd64-cgo), const SIOCGIFMEDIA ideal-int +pkg syscall (netbsd-amd64-cgo), const SIOCGIFMETRIC ideal-int +pkg syscall (netbsd-amd64-cgo), const SIOCGIFMTU ideal-int +pkg syscall (netbsd-amd64-cgo), const SIOCGIFNETMASK ideal-int +pkg syscall (netbsd-amd64-cgo), const SIOCGIFPDSTADDR ideal-int +pkg syscall (netbsd-amd64-cgo), const SIOCGIFPSRCADDR ideal-int +pkg syscall (netbsd-amd64-cgo), const SIOCGLIFADDR ideal-int +pkg syscall (netbsd-amd64-cgo), const SIOCGLIFPHYADDR ideal-int +pkg syscall (netbsd-amd64-cgo), const SIOCGLINKSTR ideal-int +pkg syscall (netbsd-amd64-cgo), const SIOCGLOWAT ideal-int +pkg syscall (netbsd-amd64-cgo), const SIOCGPGRP ideal-int +pkg syscall (netbsd-amd64-cgo), const SIOCGVH ideal-int +pkg syscall (netbsd-amd64-cgo), const SIOCIFCREATE ideal-int +pkg syscall (netbsd-amd64-cgo), const SIOCIFDESTROY ideal-int +pkg syscall (netbsd-amd64-cgo), const SIOCIFGCLONERS ideal-int +pkg syscall (netbsd-amd64-cgo), const SIOCINITIFADDR ideal-int +pkg syscall (netbsd-amd64-cgo), const SIOCSDRVSPEC ideal-int +pkg syscall (netbsd-amd64-cgo), const SIOCSETPFSYNC ideal-int +pkg syscall (netbsd-amd64-cgo), const SIOCSHIWAT ideal-int +pkg syscall (netbsd-amd64-cgo), const SIOCSIFADDR ideal-int +pkg syscall (netbsd-amd64-cgo), const SIOCSIFADDRPREF ideal-int +pkg syscall (netbsd-amd64-cgo), const SIOCSIFBRDADDR ideal-int +pkg syscall (netbsd-amd64-cgo), const SIOCSIFCAP ideal-int +pkg syscall (netbsd-amd64-cgo), const SIOCSIFDSTADDR ideal-int +pkg syscall (netbsd-amd64-cgo), const SIOCSIFFLAGS ideal-int +pkg syscall (netbsd-amd64-cgo), const SIOCSIFGENERIC ideal-int +pkg syscall (netbsd-amd64-cgo), const SIOCSIFMEDIA ideal-int +pkg syscall (netbsd-amd64-cgo), const SIOCSIFMETRIC ideal-int +pkg syscall (netbsd-amd64-cgo), const SIOCSIFMTU ideal-int +pkg syscall (netbsd-amd64-cgo), const SIOCSIFNETMASK ideal-int +pkg syscall (netbsd-amd64-cgo), const SIOCSIFPHYADDR ideal-int +pkg syscall (netbsd-amd64-cgo), const SIOCSLIFPHYADDR ideal-int +pkg syscall (netbsd-amd64-cgo), const SIOCSLINKSTR ideal-int +pkg syscall (netbsd-amd64-cgo), const SIOCSLOWAT ideal-int +pkg syscall (netbsd-amd64-cgo), const SIOCSPGRP ideal-int +pkg syscall (netbsd-amd64-cgo), const SIOCSVH ideal-int +pkg syscall (netbsd-amd64-cgo), const SIOCZIFDATA ideal-int +pkg syscall (netbsd-amd64-cgo), const SOCK_CLOEXEC ideal-int +pkg syscall (netbsd-amd64-cgo), const SOCK_FLAGS_MASK ideal-int +pkg syscall (netbsd-amd64-cgo), const SOCK_NONBLOCK ideal-int +pkg syscall (netbsd-amd64-cgo), const SOCK_NOSIGPIPE ideal-int +pkg syscall (netbsd-amd64-cgo), const SOCK_RDM ideal-int +pkg syscall (netbsd-amd64-cgo), const SO_ACCEPTCONN ideal-int +pkg syscall (netbsd-amd64-cgo), const SO_ACCEPTFILTER ideal-int +pkg syscall (netbsd-amd64-cgo), const SO_DEBUG ideal-int +pkg syscall (netbsd-amd64-cgo), const SO_ERROR ideal-int +pkg syscall (netbsd-amd64-cgo), const SO_NOHEADER ideal-int +pkg syscall (netbsd-amd64-cgo), const SO_NOSIGPIPE ideal-int +pkg syscall (netbsd-amd64-cgo), const SO_OOBINLINE ideal-int +pkg syscall (netbsd-amd64-cgo), const SO_OVERFLOWED ideal-int +pkg syscall (netbsd-amd64-cgo), const SO_RCVLOWAT ideal-int +pkg syscall (netbsd-amd64-cgo), const SO_RCVTIMEO ideal-int +pkg syscall (netbsd-amd64-cgo), const SO_REUSEPORT ideal-int +pkg syscall (netbsd-amd64-cgo), const SO_SNDLOWAT ideal-int +pkg syscall (netbsd-amd64-cgo), const SO_SNDTIMEO ideal-int +pkg syscall (netbsd-amd64-cgo), const SO_TIMESTAMP ideal-int +pkg syscall (netbsd-amd64-cgo), const SO_TYPE ideal-int +pkg syscall (netbsd-amd64-cgo), const SO_USELOOPBACK ideal-int +pkg syscall (netbsd-amd64-cgo), const SYSCTL_VERSION ideal-int +pkg syscall (netbsd-amd64-cgo), const SYSCTL_VERS_0 ideal-int +pkg syscall (netbsd-amd64-cgo), const SYSCTL_VERS_1 ideal-int +pkg syscall (netbsd-amd64-cgo), const SYSCTL_VERS_MASK ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_ACCEPT ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_ACCESS ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_ACCT ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_ADJTIME ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_BIND ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_BREAK ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_CHDIR ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_CHFLAGS ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_CHMOD ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_CHOWN ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_CHROOT ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_CLOCK_GETRES ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_CLOCK_GETTIME ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_CLOCK_SETTIME ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_CLOSE ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_CONNECT ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_DUP ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_DUP2 ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_DUP3 ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_EXECVE ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_EXIT ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_EXTATTRCTL ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_EXTATTR_DELETE_FD ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_EXTATTR_DELETE_FILE ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_EXTATTR_DELETE_LINK ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_EXTATTR_GET_FD ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_EXTATTR_GET_FILE ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_EXTATTR_GET_LINK ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_EXTATTR_LIST_FD ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_EXTATTR_LIST_FILE ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_EXTATTR_LIST_LINK ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_EXTATTR_SET_FD ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_EXTATTR_SET_FILE ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_EXTATTR_SET_LINK ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_FACCESSAT ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_FCHDIR ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_FCHFLAGS ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_FCHMOD ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_FCHMODAT ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_FCHOWN ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_FCHOWNAT ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_FCHROOT ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_FCNTL ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_FDATASYNC ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_FEXECVE ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_FGETXATTR ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_FHSTAT ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_FKTRACE ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_FLISTXATTR ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_FLOCK ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_FORK ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_FPATHCONF ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_FREMOVEXATTR ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_FSETXATTR ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_FSTAT ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_FSTATAT ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_FSTATVFS1 ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_FSYNC ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_FSYNC_RANGE ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_FTRUNCATE ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_FUTIMENS ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_FUTIMES ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_GETCONTEXT ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_GETDENTS ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_GETEGID ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_GETEUID ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_GETFH ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_GETGID ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_GETGROUPS ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_GETITIMER ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_GETPEERNAME ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_GETPGID ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_GETPGRP ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_GETPID ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_GETPPID ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_GETPRIORITY ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_GETRLIMIT ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_GETRUSAGE ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_GETSID ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_GETSOCKNAME ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_GETSOCKOPT ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_GETTIMEOFDAY ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_GETUID ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_GETVFSSTAT ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_GETXATTR ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_IOCTL ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_ISSETUGID ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_KEVENT ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_KILL ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_KQUEUE ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_KQUEUE1 ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_KTRACE ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_LCHFLAGS ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_LCHMOD ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_LCHOWN ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_LGETXATTR ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_LINK ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_LINKAT ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_LISTEN ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_LISTXATTR ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_LLISTXATTR ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_LREMOVEXATTR ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_LSEEK ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_LSETXATTR ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_LSTAT ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_LUTIMES ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_MADVISE ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_MINCORE ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_MINHERIT ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_MKDIR ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_MKDIRAT ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_MKFIFO ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_MKFIFOAT ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_MKNOD ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_MKNODAT ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_MLOCK ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_MLOCKALL ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_MMAP ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_MODCTL ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_MOUNT ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_MPROTECT ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_MREMAP ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_MSGCTL ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_MSGGET ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_MSGRCV ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_MSGSND ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_MUNLOCK ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_MUNLOCKALL ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_MUNMAP ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_NANOSLEEP ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_NTP_ADJTIME ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_NTP_GETTIME ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_OPEN ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_OPENAT ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_PACCEPT ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_PATHCONF ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_PIPE ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_PIPE2 ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_PMC_CONTROL ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_PMC_GET_INFO ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_POLL ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_POLLTS ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_POSIX_FADVISE ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_POSIX_SPAWN ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_PREAD ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_PREADV ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_PROFIL ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_PSELECT ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_PSET_ASSIGN ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_PSET_CREATE ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_PSET_DESTROY ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_PTRACE ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_PWRITE ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_PWRITEV ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_RASCTL ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_READ ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_READLINK ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_READLINKAT ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_READV ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_REBOOT ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_RECVFROM ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_RECVMMSG ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_RECVMSG ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_REMOVEXATTR ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_RENAME ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_RENAMEAT ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_REVOKE ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_RMDIR ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_SBRK ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_SCHED_YIELD ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_SELECT ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_SEMCONFIG ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_SEMGET ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_SEMOP ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_SENDMMSG ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_SENDMSG ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_SENDTO ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_SETCONTEXT ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_SETEGID ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_SETEUID ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_SETGID ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_SETGROUPS ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_SETITIMER ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_SETPGID ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_SETPRIORITY ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_SETREGID ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_SETREUID ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_SETRLIMIT ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_SETSID ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_SETSOCKOPT ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_SETTIMEOFDAY ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_SETUID ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_SETXATTR ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_SHMAT ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_SHMCTL ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_SHMDT ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_SHMGET ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_SHUTDOWN ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_SIGQUEUEINFO ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_SOCKET ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_SOCKETPAIR ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_SSTK ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_STAT ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_STATVFS1 ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_SWAPCTL ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_SYMLINK ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_SYMLINKAT ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_SYNC ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_SYSARCH ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_TIMER_CREATE ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_TIMER_DELETE ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_TIMER_GETOVERRUN ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_TIMER_GETTIME ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_TIMER_SETTIME ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_TRUNCATE ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_UMASK ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_UNDELETE ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_UNLINK ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_UNLINKAT ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_UNMOUNT ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_UTIMENSAT ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_UTIMES ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_UTRACE ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_UUIDGEN ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_VADVISE ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_VFORK ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_WAIT4 ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_WRITE ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS_WRITEV ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS__LWP_CONTINUE ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS__LWP_CREATE ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS__LWP_CTL ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS__LWP_DETACH ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS__LWP_EXIT ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS__LWP_GETNAME ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS__LWP_GETPRIVATE ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS__LWP_KILL ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS__LWP_PARK ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS__LWP_SELF ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS__LWP_SETNAME ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS__LWP_SETPRIVATE ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS__LWP_SUSPEND ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS__LWP_UNPARK ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS__LWP_UNPARK_ALL ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS__LWP_WAIT ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS__LWP_WAKEUP ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS__PSET_BIND ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS__SCHED_GETAFFINITY ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS__SCHED_GETPARAM ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS__SCHED_SETAFFINITY ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS__SCHED_SETPARAM ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS___CLONE ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS___GETCWD ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS___GETLOGIN ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS___POSIX_CHOWN ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS___POSIX_FCHOWN ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS___POSIX_LCHOWN ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS___POSIX_RENAME ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS___QUOTACTL ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS___SEMCTL ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS___SETLOGIN ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS___SIGACTION_SIGTRAMP ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS___SIGTIMEDWAIT ideal-int +pkg syscall (netbsd-amd64-cgo), const SYS___SYSCTL ideal-int +pkg syscall (netbsd-amd64-cgo), const S_ARCH1 ideal-int +pkg syscall (netbsd-amd64-cgo), const S_ARCH2 ideal-int +pkg syscall (netbsd-amd64-cgo), const S_BLKSIZE ideal-int +pkg syscall (netbsd-amd64-cgo), const S_IEXEC ideal-int +pkg syscall (netbsd-amd64-cgo), const S_IFWHT ideal-int +pkg syscall (netbsd-amd64-cgo), const S_IREAD ideal-int +pkg syscall (netbsd-amd64-cgo), const S_IRGRP ideal-int +pkg syscall (netbsd-amd64-cgo), const S_IROTH ideal-int +pkg syscall (netbsd-amd64-cgo), const S_IRWXG ideal-int +pkg syscall (netbsd-amd64-cgo), const S_IRWXO ideal-int +pkg syscall (netbsd-amd64-cgo), const S_IRWXU ideal-int +pkg syscall (netbsd-amd64-cgo), const S_ISTXT ideal-int +pkg syscall (netbsd-amd64-cgo), const S_IWGRP ideal-int +pkg syscall (netbsd-amd64-cgo), const S_IWOTH ideal-int +pkg syscall (netbsd-amd64-cgo), const S_IWRITE ideal-int +pkg syscall (netbsd-amd64-cgo), const S_IXGRP ideal-int +pkg syscall (netbsd-amd64-cgo), const S_IXOTH ideal-int +pkg syscall (netbsd-amd64-cgo), const S_LOGIN_SET ideal-int +pkg syscall (netbsd-amd64-cgo), const SizeofBpfHdr ideal-int +pkg syscall (netbsd-amd64-cgo), const SizeofBpfInsn ideal-int +pkg syscall (netbsd-amd64-cgo), const SizeofBpfProgram ideal-int +pkg syscall (netbsd-amd64-cgo), const SizeofBpfStat ideal-int +pkg syscall (netbsd-amd64-cgo), const SizeofBpfVersion ideal-int +pkg syscall (netbsd-amd64-cgo), const SizeofCmsghdr ideal-int +pkg syscall (netbsd-amd64-cgo), const SizeofICMPv6Filter = 32 +pkg syscall (netbsd-amd64-cgo), const SizeofICMPv6Filter ideal-int +pkg syscall (netbsd-amd64-cgo), const SizeofIPMreq ideal-int +pkg syscall (netbsd-amd64-cgo), const SizeofIPv6MTUInfo = 32 +pkg syscall (netbsd-amd64-cgo), const SizeofIPv6MTUInfo ideal-int +pkg syscall (netbsd-amd64-cgo), const SizeofIPv6Mreq ideal-int +pkg syscall (netbsd-amd64-cgo), const SizeofIfAnnounceMsghdr ideal-int +pkg syscall (netbsd-amd64-cgo), const SizeofIfData ideal-int +pkg syscall (netbsd-amd64-cgo), const SizeofIfMsghdr ideal-int +pkg syscall (netbsd-amd64-cgo), const SizeofIfaMsghdr ideal-int +pkg syscall (netbsd-amd64-cgo), const SizeofInet6Pktinfo ideal-int +pkg syscall (netbsd-amd64-cgo), const SizeofLinger ideal-int +pkg syscall (netbsd-amd64-cgo), const SizeofMsghdr ideal-int +pkg syscall (netbsd-amd64-cgo), const SizeofRtMetrics ideal-int +pkg syscall (netbsd-amd64-cgo), const SizeofRtMsghdr ideal-int +pkg syscall (netbsd-amd64-cgo), const SizeofSockaddrAny ideal-int +pkg syscall (netbsd-amd64-cgo), const SizeofSockaddrDatalink ideal-int +pkg syscall (netbsd-amd64-cgo), const SizeofSockaddrInet4 ideal-int +pkg syscall (netbsd-amd64-cgo), const SizeofSockaddrInet6 ideal-int +pkg syscall (netbsd-amd64-cgo), const SizeofSockaddrUnix ideal-int +pkg syscall (netbsd-amd64-cgo), const TCIFLUSH ideal-int +pkg syscall (netbsd-amd64-cgo), const TCIOFLUSH ideal-int +pkg syscall (netbsd-amd64-cgo), const TCOFLUSH ideal-int +pkg syscall (netbsd-amd64-cgo), const TCP_CONGCTL ideal-int +pkg syscall (netbsd-amd64-cgo), const TCP_KEEPCNT ideal-int +pkg syscall (netbsd-amd64-cgo), const TCP_KEEPIDLE ideal-int +pkg syscall (netbsd-amd64-cgo), const TCP_KEEPINIT ideal-int +pkg syscall (netbsd-amd64-cgo), const TCP_KEEPINTVL ideal-int +pkg syscall (netbsd-amd64-cgo), const TCP_MAXBURST ideal-int +pkg syscall (netbsd-amd64-cgo), const TCP_MAXSEG ideal-int +pkg syscall (netbsd-amd64-cgo), const TCP_MAXWIN ideal-int +pkg syscall (netbsd-amd64-cgo), const TCP_MAX_WINSHIFT ideal-int +pkg syscall (netbsd-amd64-cgo), const TCP_MD5SIG ideal-int +pkg syscall (netbsd-amd64-cgo), const TCP_MINMSS ideal-int +pkg syscall (netbsd-amd64-cgo), const TCP_MSS ideal-int +pkg syscall (netbsd-amd64-cgo), const TCSAFLUSH ideal-int +pkg syscall (netbsd-amd64-cgo), const TIOCCBRK ideal-int +pkg syscall (netbsd-amd64-cgo), const TIOCCDTR ideal-int +pkg syscall (netbsd-amd64-cgo), const TIOCCONS ideal-int +pkg syscall (netbsd-amd64-cgo), const TIOCDCDTIMESTAMP ideal-int +pkg syscall (netbsd-amd64-cgo), const TIOCDRAIN ideal-int +pkg syscall (netbsd-amd64-cgo), const TIOCEXCL ideal-int +pkg syscall (netbsd-amd64-cgo), const TIOCEXT ideal-int +pkg syscall (netbsd-amd64-cgo), const TIOCFLAG_CDTRCTS ideal-int +pkg syscall (netbsd-amd64-cgo), const TIOCFLAG_CLOCAL ideal-int +pkg syscall (netbsd-amd64-cgo), const TIOCFLAG_CRTSCTS ideal-int +pkg syscall (netbsd-amd64-cgo), const TIOCFLAG_MDMBUF ideal-int +pkg syscall (netbsd-amd64-cgo), const TIOCFLAG_SOFTCAR ideal-int +pkg syscall (netbsd-amd64-cgo), const TIOCFLUSH ideal-int +pkg syscall (netbsd-amd64-cgo), const TIOCGETA ideal-int +pkg syscall (netbsd-amd64-cgo), const TIOCGETD ideal-int +pkg syscall (netbsd-amd64-cgo), const TIOCGFLAGS ideal-int +pkg syscall (netbsd-amd64-cgo), const TIOCGLINED ideal-int +pkg syscall (netbsd-amd64-cgo), const TIOCGPGRP ideal-int +pkg syscall (netbsd-amd64-cgo), const TIOCGQSIZE ideal-int +pkg syscall (netbsd-amd64-cgo), const TIOCGRANTPT ideal-int +pkg syscall (netbsd-amd64-cgo), const TIOCGSID ideal-int +pkg syscall (netbsd-amd64-cgo), const TIOCGSIZE ideal-int +pkg syscall (netbsd-amd64-cgo), const TIOCGWINSZ ideal-int +pkg syscall (netbsd-amd64-cgo), const TIOCMBIC ideal-int +pkg syscall (netbsd-amd64-cgo), const TIOCMBIS ideal-int +pkg syscall (netbsd-amd64-cgo), const TIOCMGET ideal-int +pkg syscall (netbsd-amd64-cgo), const TIOCMSET ideal-int +pkg syscall (netbsd-amd64-cgo), const TIOCM_CAR ideal-int +pkg syscall (netbsd-amd64-cgo), const TIOCM_CD ideal-int +pkg syscall (netbsd-amd64-cgo), const TIOCM_CTS ideal-int +pkg syscall (netbsd-amd64-cgo), const TIOCM_DSR ideal-int +pkg syscall (netbsd-amd64-cgo), const TIOCM_DTR ideal-int +pkg syscall (netbsd-amd64-cgo), const TIOCM_LE ideal-int +pkg syscall (netbsd-amd64-cgo), const TIOCM_RI ideal-int +pkg syscall (netbsd-amd64-cgo), const TIOCM_RNG ideal-int +pkg syscall (netbsd-amd64-cgo), const TIOCM_RTS ideal-int +pkg syscall (netbsd-amd64-cgo), const TIOCM_SR ideal-int +pkg syscall (netbsd-amd64-cgo), const TIOCM_ST ideal-int +pkg syscall (netbsd-amd64-cgo), const TIOCNOTTY ideal-int +pkg syscall (netbsd-amd64-cgo), const TIOCNXCL ideal-int +pkg syscall (netbsd-amd64-cgo), const TIOCOUTQ ideal-int +pkg syscall (netbsd-amd64-cgo), const TIOCPKT ideal-int +pkg syscall (netbsd-amd64-cgo), const TIOCPKT_DATA ideal-int +pkg syscall (netbsd-amd64-cgo), const TIOCPKT_DOSTOP ideal-int +pkg syscall (netbsd-amd64-cgo), const TIOCPKT_FLUSHREAD ideal-int +pkg syscall (netbsd-amd64-cgo), const TIOCPKT_FLUSHWRITE ideal-int +pkg syscall (netbsd-amd64-cgo), const TIOCPKT_IOCTL ideal-int +pkg syscall (netbsd-amd64-cgo), const TIOCPKT_NOSTOP ideal-int +pkg syscall (netbsd-amd64-cgo), const TIOCPKT_START ideal-int +pkg syscall (netbsd-amd64-cgo), const TIOCPKT_STOP ideal-int +pkg syscall (netbsd-amd64-cgo), const TIOCPTMGET ideal-int +pkg syscall (netbsd-amd64-cgo), const TIOCPTSNAME ideal-int +pkg syscall (netbsd-amd64-cgo), const TIOCRCVFRAME ideal-int +pkg syscall (netbsd-amd64-cgo), const TIOCREMOTE ideal-int +pkg syscall (netbsd-amd64-cgo), const TIOCSBRK ideal-int +pkg syscall (netbsd-amd64-cgo), const TIOCSCTTY ideal-int +pkg syscall (netbsd-amd64-cgo), const TIOCSDTR ideal-int +pkg syscall (netbsd-amd64-cgo), const TIOCSETA ideal-int +pkg syscall (netbsd-amd64-cgo), const TIOCSETAF ideal-int +pkg syscall (netbsd-amd64-cgo), const TIOCSETAW ideal-int +pkg syscall (netbsd-amd64-cgo), const TIOCSETD ideal-int +pkg syscall (netbsd-amd64-cgo), const TIOCSFLAGS ideal-int +pkg syscall (netbsd-amd64-cgo), const TIOCSIG ideal-int +pkg syscall (netbsd-amd64-cgo), const TIOCSLINED ideal-int +pkg syscall (netbsd-amd64-cgo), const TIOCSPGRP ideal-int +pkg syscall (netbsd-amd64-cgo), const TIOCSQSIZE ideal-int +pkg syscall (netbsd-amd64-cgo), const TIOCSSIZE ideal-int +pkg syscall (netbsd-amd64-cgo), const TIOCSTART ideal-int +pkg syscall (netbsd-amd64-cgo), const TIOCSTAT ideal-int +pkg syscall (netbsd-amd64-cgo), const TIOCSTI ideal-int +pkg syscall (netbsd-amd64-cgo), const TIOCSTOP ideal-int +pkg syscall (netbsd-amd64-cgo), const TIOCSWINSZ ideal-int +pkg syscall (netbsd-amd64-cgo), const TIOCUCNTL ideal-int +pkg syscall (netbsd-amd64-cgo), const TIOCXMTFRAME ideal-int +pkg syscall (netbsd-amd64-cgo), const TOSTOP ideal-int +pkg syscall (netbsd-amd64-cgo), const VDISCARD ideal-int +pkg syscall (netbsd-amd64-cgo), const VDSUSP ideal-int +pkg syscall (netbsd-amd64-cgo), const VEOF ideal-int +pkg syscall (netbsd-amd64-cgo), const VEOL ideal-int +pkg syscall (netbsd-amd64-cgo), const VEOL2 ideal-int +pkg syscall (netbsd-amd64-cgo), const VERASE ideal-int +pkg syscall (netbsd-amd64-cgo), const VINTR ideal-int +pkg syscall (netbsd-amd64-cgo), const VKILL ideal-int +pkg syscall (netbsd-amd64-cgo), const VLNEXT ideal-int +pkg syscall (netbsd-amd64-cgo), const VMIN ideal-int +pkg syscall (netbsd-amd64-cgo), const VQUIT ideal-int +pkg syscall (netbsd-amd64-cgo), const VREPRINT ideal-int +pkg syscall (netbsd-amd64-cgo), const VSTART ideal-int +pkg syscall (netbsd-amd64-cgo), const VSTATUS ideal-int +pkg syscall (netbsd-amd64-cgo), const VSTOP ideal-int +pkg syscall (netbsd-amd64-cgo), const VSUSP ideal-int +pkg syscall (netbsd-amd64-cgo), const VTIME ideal-int +pkg syscall (netbsd-amd64-cgo), const VWERASE ideal-int +pkg syscall (netbsd-amd64-cgo), const WALL ideal-int +pkg syscall (netbsd-amd64-cgo), const WALLSIG ideal-int +pkg syscall (netbsd-amd64-cgo), const WALTSIG ideal-int +pkg syscall (netbsd-amd64-cgo), const WCLONE ideal-int +pkg syscall (netbsd-amd64-cgo), const WCOREFLAG ideal-int +pkg syscall (netbsd-amd64-cgo), const WNOHANG ideal-int +pkg syscall (netbsd-amd64-cgo), const WNOWAIT ideal-int +pkg syscall (netbsd-amd64-cgo), const WNOZOMBIE ideal-int +pkg syscall (netbsd-amd64-cgo), const WOPTSCHECKED ideal-int +pkg syscall (netbsd-amd64-cgo), const WSTOPPED ideal-int +pkg syscall (netbsd-amd64-cgo), const WUNTRACED ideal-int +pkg syscall (netbsd-amd64-cgo), func Accept(int) (int, Sockaddr, error) +pkg syscall (netbsd-amd64-cgo), func Access(string, uint32) error +pkg syscall (netbsd-amd64-cgo), func Adjtime(*Timeval, *Timeval) error +pkg syscall (netbsd-amd64-cgo), func Bind(int, Sockaddr) error +pkg syscall (netbsd-amd64-cgo), func BpfBuflen(int) (int, error) +pkg syscall (netbsd-amd64-cgo), func BpfDatalink(int) (int, error) +pkg syscall (netbsd-amd64-cgo), func BpfHeadercmpl(int) (int, error) +pkg syscall (netbsd-amd64-cgo), func BpfInterface(int, string) (string, error) +pkg syscall (netbsd-amd64-cgo), func BpfJump(int, int, int, int) *BpfInsn +pkg syscall (netbsd-amd64-cgo), func BpfStats(int) (*BpfStat, error) +pkg syscall (netbsd-amd64-cgo), func BpfStmt(int, int) *BpfInsn +pkg syscall (netbsd-amd64-cgo), func BpfTimeout(int) (*Timeval, error) +pkg syscall (netbsd-amd64-cgo), func CheckBpfVersion(int) error +pkg syscall (netbsd-amd64-cgo), func Chflags(string, int) error +pkg syscall (netbsd-amd64-cgo), func Chroot(string) error +pkg syscall (netbsd-amd64-cgo), func Close(int) error +pkg syscall (netbsd-amd64-cgo), func CloseOnExec(int) +pkg syscall (netbsd-amd64-cgo), func CmsgLen(int) int +pkg syscall (netbsd-amd64-cgo), func CmsgSpace(int) int +pkg syscall (netbsd-amd64-cgo), func Connect(int, Sockaddr) error +pkg syscall (netbsd-amd64-cgo), func Dup(int) (int, error) +pkg syscall (netbsd-amd64-cgo), func Dup2(int, int) error +pkg syscall (netbsd-amd64-cgo), func Fchdir(int) error +pkg syscall (netbsd-amd64-cgo), func Fchflags(int, int) error +pkg syscall (netbsd-amd64-cgo), func Fchmod(int, uint32) error +pkg syscall (netbsd-amd64-cgo), func Fchown(int, int, int) error +pkg syscall (netbsd-amd64-cgo), func Flock(int, int) error +pkg syscall (netbsd-amd64-cgo), func FlushBpf(int) error +pkg syscall (netbsd-amd64-cgo), func ForkExec(string, []string, *ProcAttr) (int, error) +pkg syscall (netbsd-amd64-cgo), func Fpathconf(int, int) (int, error) +pkg syscall (netbsd-amd64-cgo), func Fstat(int, *Stat_t) error +pkg syscall (netbsd-amd64-cgo), func Fsync(int) error +pkg syscall (netbsd-amd64-cgo), func Ftruncate(int, int64) error +pkg syscall (netbsd-amd64-cgo), func Futimes(int, []Timeval) error +pkg syscall (netbsd-amd64-cgo), func Getdirentries(int, []uint8, *uintptr) (int, error) +pkg syscall (netbsd-amd64-cgo), func Getpeername(int) (Sockaddr, error) +pkg syscall (netbsd-amd64-cgo), func Getpgid(int) (int, error) +pkg syscall (netbsd-amd64-cgo), func Getpgrp() int +pkg syscall (netbsd-amd64-cgo), func Getpriority(int, int) (int, error) +pkg syscall (netbsd-amd64-cgo), func Getrlimit(int, *Rlimit) error +pkg syscall (netbsd-amd64-cgo), func Getrusage(int, *Rusage) error +pkg syscall (netbsd-amd64-cgo), func Getsid(int) (int, error) +pkg syscall (netbsd-amd64-cgo), func Getsockname(int) (Sockaddr, error) +pkg syscall (netbsd-amd64-cgo), func GetsockoptByte(int, int, int) (uint8, error) +pkg syscall (netbsd-amd64-cgo), func GetsockoptICMPv6Filter(int, int, int) (*ICMPv6Filter, error) +pkg syscall (netbsd-amd64-cgo), func GetsockoptIPMreq(int, int, int) (*IPMreq, error) +pkg syscall (netbsd-amd64-cgo), func GetsockoptIPv6MTUInfo(int, int, int) (*IPv6MTUInfo, error) +pkg syscall (netbsd-amd64-cgo), func GetsockoptIPv6Mreq(int, int, int) (*IPv6Mreq, error) +pkg syscall (netbsd-amd64-cgo), func GetsockoptInet4Addr(int, int, int) ([4]uint8, error) +pkg syscall (netbsd-amd64-cgo), func GetsockoptInt(int, int, int) (int, error) +pkg syscall (netbsd-amd64-cgo), func Issetugid() bool +pkg syscall (netbsd-amd64-cgo), func Kevent(int, []Kevent_t, []Kevent_t, *Timespec) (int, error) +pkg syscall (netbsd-amd64-cgo), func Kill(int, Signal) error +pkg syscall (netbsd-amd64-cgo), func Kqueue() (int, error) +pkg syscall (netbsd-amd64-cgo), func Listen(int, int) error +pkg syscall (netbsd-amd64-cgo), func Lstat(string, *Stat_t) error +pkg syscall (netbsd-amd64-cgo), func Mkfifo(string, uint32) error +pkg syscall (netbsd-amd64-cgo), func Mknod(string, uint32, int) error +pkg syscall (netbsd-amd64-cgo), func Mmap(int, int64, int, int, int) ([]uint8, error) +pkg syscall (netbsd-amd64-cgo), func Munmap([]uint8) error +pkg syscall (netbsd-amd64-cgo), func Nanosleep(*Timespec, *Timespec) error +pkg syscall (netbsd-amd64-cgo), func Open(string, int, uint32) (int, error) +pkg syscall (netbsd-amd64-cgo), func ParseDirent([]uint8, int, []string) (int, int, []string) +pkg syscall (netbsd-amd64-cgo), func ParseRoutingMessage([]uint8) ([]RoutingMessage, error) +pkg syscall (netbsd-amd64-cgo), func ParseRoutingSockaddr(RoutingMessage) ([]Sockaddr, error) +pkg syscall (netbsd-amd64-cgo), func ParseSocketControlMessage([]uint8) ([]SocketControlMessage, error) +pkg syscall (netbsd-amd64-cgo), func ParseUnixRights(*SocketControlMessage) ([]int, error) +pkg syscall (netbsd-amd64-cgo), func Pathconf(string, int) (int, error) +pkg syscall (netbsd-amd64-cgo), func Pipe([]int) error +pkg syscall (netbsd-amd64-cgo), func Pread(int, []uint8, int64) (int, error) +pkg syscall (netbsd-amd64-cgo), func Pwrite(int, []uint8, int64) (int, error) +pkg syscall (netbsd-amd64-cgo), func RawSyscall(uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno) +pkg syscall (netbsd-amd64-cgo), func RawSyscall6(uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno) +pkg syscall (netbsd-amd64-cgo), func Read(int, []uint8) (int, error) +pkg syscall (netbsd-amd64-cgo), func ReadDirent(int, []uint8) (int, error) +pkg syscall (netbsd-amd64-cgo), func Recvfrom(int, []uint8, int) (int, Sockaddr, error) +pkg syscall (netbsd-amd64-cgo), func Recvmsg(int, []uint8, []uint8, int) (int, int, int, Sockaddr, error) +pkg syscall (netbsd-amd64-cgo), func Revoke(string) error +pkg syscall (netbsd-amd64-cgo), func RouteRIB(int, int) ([]uint8, error) +pkg syscall (netbsd-amd64-cgo), func Seek(int, int64, int) (int64, error) +pkg syscall (netbsd-amd64-cgo), func Select(int, *FdSet, *FdSet, *FdSet, *Timeval) error +pkg syscall (netbsd-amd64-cgo), func Sendfile(int, int, *int64, int) (int, error) +pkg syscall (netbsd-amd64-cgo), func Sendmsg(int, []uint8, []uint8, Sockaddr, int) error +pkg syscall (netbsd-amd64-cgo), func Sendto(int, []uint8, int, Sockaddr) error +pkg syscall (netbsd-amd64-cgo), func SetBpf(int, []BpfInsn) error +pkg syscall (netbsd-amd64-cgo), func SetBpfBuflen(int, int) (int, error) +pkg syscall (netbsd-amd64-cgo), func SetBpfDatalink(int, int) (int, error) +pkg syscall (netbsd-amd64-cgo), func SetBpfHeadercmpl(int, int) error +pkg syscall (netbsd-amd64-cgo), func SetBpfImmediate(int, int) error +pkg syscall (netbsd-amd64-cgo), func SetBpfInterface(int, string) error +pkg syscall (netbsd-amd64-cgo), func SetBpfPromisc(int, int) error +pkg syscall (netbsd-amd64-cgo), func SetBpfTimeout(int, *Timeval) error +pkg syscall (netbsd-amd64-cgo), func SetKevent(*Kevent_t, int, int, int) +pkg syscall (netbsd-amd64-cgo), func SetNonblock(int, bool) error +pkg syscall (netbsd-amd64-cgo), func Setegid(int) error +pkg syscall (netbsd-amd64-cgo), func Seteuid(int) error +pkg syscall (netbsd-amd64-cgo), func Setgid(int) error +pkg syscall (netbsd-amd64-cgo), func Setgroups([]int) error +pkg syscall (netbsd-amd64-cgo), func Setpgid(int, int) error +pkg syscall (netbsd-amd64-cgo), func Setpriority(int, int, int) error +pkg syscall (netbsd-amd64-cgo), func Setregid(int, int) error +pkg syscall (netbsd-amd64-cgo), func Setreuid(int, int) error +pkg syscall (netbsd-amd64-cgo), func Setrlimit(int, *Rlimit) error +pkg syscall (netbsd-amd64-cgo), func Setsid() (int, error) +pkg syscall (netbsd-amd64-cgo), func SetsockoptByte(int, int, int, uint8) error +pkg syscall (netbsd-amd64-cgo), func SetsockoptICMPv6Filter(int, int, int, *ICMPv6Filter) error +pkg syscall (netbsd-amd64-cgo), func SetsockoptIPMreq(int, int, int, *IPMreq) error +pkg syscall (netbsd-amd64-cgo), func SetsockoptIPv6Mreq(int, int, int, *IPv6Mreq) error +pkg syscall (netbsd-amd64-cgo), func SetsockoptInet4Addr(int, int, int, [4]uint8) error +pkg syscall (netbsd-amd64-cgo), func SetsockoptInt(int, int, int, int) error +pkg syscall (netbsd-amd64-cgo), func SetsockoptLinger(int, int, int, *Linger) error +pkg syscall (netbsd-amd64-cgo), func SetsockoptString(int, int, int, string) error +pkg syscall (netbsd-amd64-cgo), func SetsockoptTimeval(int, int, int, *Timeval) error +pkg syscall (netbsd-amd64-cgo), func Settimeofday(*Timeval) error +pkg syscall (netbsd-amd64-cgo), func Setuid(int) error +pkg syscall (netbsd-amd64-cgo), func Shutdown(int, int) error +pkg syscall (netbsd-amd64-cgo), func SlicePtrFromStrings([]string) ([]*uint8, error) +pkg syscall (netbsd-amd64-cgo), func Socket(int, int, int) (int, error) +pkg syscall (netbsd-amd64-cgo), func Socketpair(int, int, int) ([2]int, error) +pkg syscall (netbsd-amd64-cgo), func Stat(string, *Stat_t) error +pkg syscall (netbsd-amd64-cgo), func StringSlicePtr([]string) []*uint8 +pkg syscall (netbsd-amd64-cgo), func Sync() error +pkg syscall (netbsd-amd64-cgo), func Syscall(uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno) +pkg syscall (netbsd-amd64-cgo), func Syscall6(uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno) +pkg syscall (netbsd-amd64-cgo), func Syscall9(uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno) +pkg syscall (netbsd-amd64-cgo), func Sysctl(string) (string, error) +pkg syscall (netbsd-amd64-cgo), func SysctlUint32(string) (uint32, error) +pkg syscall (netbsd-amd64-cgo), func TimevalToNsec(Timeval) int64 +pkg syscall (netbsd-amd64-cgo), func Truncate(string, int64) error +pkg syscall (netbsd-amd64-cgo), func Umask(int) int +pkg syscall (netbsd-amd64-cgo), func UnixRights(...int) []uint8 +pkg syscall (netbsd-amd64-cgo), func Unmount(string, int) error +pkg syscall (netbsd-amd64-cgo), func Wait4(int, *WaitStatus, int, *Rusage) (int, error) +pkg syscall (netbsd-amd64-cgo), func Write(int, []uint8) (int, error) +pkg syscall (netbsd-amd64-cgo), method (*Cmsghdr) SetLen(int) +pkg syscall (netbsd-amd64-cgo), method (*Iovec) SetLen(int) +pkg syscall (netbsd-amd64-cgo), method (*Msghdr) SetControllen(int) +pkg syscall (netbsd-amd64-cgo), type BpfHdr struct +pkg syscall (netbsd-amd64-cgo), type BpfHdr struct, Caplen uint32 +pkg syscall (netbsd-amd64-cgo), type BpfHdr struct, Datalen uint32 +pkg syscall (netbsd-amd64-cgo), type BpfHdr struct, Hdrlen uint16 +pkg syscall (netbsd-amd64-cgo), type BpfHdr struct, Pad_cgo_0 [6]uint8 +pkg syscall (netbsd-amd64-cgo), type BpfHdr struct, Tstamp BpfTimeval +pkg syscall (netbsd-amd64-cgo), type BpfInsn struct +pkg syscall (netbsd-amd64-cgo), type BpfInsn struct, Code uint16 +pkg syscall (netbsd-amd64-cgo), type BpfInsn struct, Jf uint8 +pkg syscall (netbsd-amd64-cgo), type BpfInsn struct, Jt uint8 +pkg syscall (netbsd-amd64-cgo), type BpfInsn struct, K uint32 +pkg syscall (netbsd-amd64-cgo), type BpfProgram struct +pkg syscall (netbsd-amd64-cgo), type BpfProgram struct, Insns *BpfInsn +pkg syscall (netbsd-amd64-cgo), type BpfProgram struct, Len uint32 +pkg syscall (netbsd-amd64-cgo), type BpfProgram struct, Pad_cgo_0 [4]uint8 +pkg syscall (netbsd-amd64-cgo), type BpfStat struct +pkg syscall (netbsd-amd64-cgo), type BpfStat struct, Capt uint64 +pkg syscall (netbsd-amd64-cgo), type BpfStat struct, Drop uint64 +pkg syscall (netbsd-amd64-cgo), type BpfStat struct, Padding [13]uint64 +pkg syscall (netbsd-amd64-cgo), type BpfStat struct, Recv uint64 +pkg syscall (netbsd-amd64-cgo), type BpfTimeval struct +pkg syscall (netbsd-amd64-cgo), type BpfTimeval struct, Sec int64 +pkg syscall (netbsd-amd64-cgo), type BpfTimeval struct, Usec int64 +pkg syscall (netbsd-amd64-cgo), type BpfVersion struct +pkg syscall (netbsd-amd64-cgo), type BpfVersion struct, Major uint16 +pkg syscall (netbsd-amd64-cgo), type BpfVersion struct, Minor uint16 +pkg syscall (netbsd-amd64-cgo), type Cmsghdr struct +pkg syscall (netbsd-amd64-cgo), type Cmsghdr struct, Len uint32 +pkg syscall (netbsd-amd64-cgo), type Cmsghdr struct, Level int32 +pkg syscall (netbsd-amd64-cgo), type Cmsghdr struct, Type int32 +pkg syscall (netbsd-amd64-cgo), type Credential struct +pkg syscall (netbsd-amd64-cgo), type Credential struct, Gid uint32 +pkg syscall (netbsd-amd64-cgo), type Credential struct, Groups []uint32 +pkg syscall (netbsd-amd64-cgo), type Credential struct, Uid uint32 +pkg syscall (netbsd-amd64-cgo), type Dirent struct +pkg syscall (netbsd-amd64-cgo), type Dirent struct, Fileno uint64 +pkg syscall (netbsd-amd64-cgo), type Dirent struct, Name [512]int8 +pkg syscall (netbsd-amd64-cgo), type Dirent struct, Namlen uint16 +pkg syscall (netbsd-amd64-cgo), type Dirent struct, Pad_cgo_0 [3]uint8 +pkg syscall (netbsd-amd64-cgo), type Dirent struct, Reclen uint16 +pkg syscall (netbsd-amd64-cgo), type Dirent struct, Type uint8 +pkg syscall (netbsd-amd64-cgo), type FdSet struct +pkg syscall (netbsd-amd64-cgo), type FdSet struct, Bits [8]uint32 +pkg syscall (netbsd-amd64-cgo), type Flock_t struct +pkg syscall (netbsd-amd64-cgo), type Flock_t struct, Len int64 +pkg syscall (netbsd-amd64-cgo), type Flock_t struct, Pid int32 +pkg syscall (netbsd-amd64-cgo), type Flock_t struct, Start int64 +pkg syscall (netbsd-amd64-cgo), type Flock_t struct, Type int16 +pkg syscall (netbsd-amd64-cgo), type Flock_t struct, Whence int16 +pkg syscall (netbsd-amd64-cgo), type Fsid struct +pkg syscall (netbsd-amd64-cgo), type Fsid struct, X__fsid_val [2]int32 +pkg syscall (netbsd-amd64-cgo), type ICMPv6Filter struct +pkg syscall (netbsd-amd64-cgo), type ICMPv6Filter struct, Filt [8]uint32 +pkg syscall (netbsd-amd64-cgo), type IPv6MTUInfo struct +pkg syscall (netbsd-amd64-cgo), type IPv6MTUInfo struct, Addr RawSockaddrInet6 +pkg syscall (netbsd-amd64-cgo), type IPv6MTUInfo struct, Mtu uint32 +pkg syscall (netbsd-amd64-cgo), type IfAnnounceMsghdr struct +pkg syscall (netbsd-amd64-cgo), type IfAnnounceMsghdr struct, Index uint16 +pkg syscall (netbsd-amd64-cgo), type IfAnnounceMsghdr struct, Msglen uint16 +pkg syscall (netbsd-amd64-cgo), type IfAnnounceMsghdr struct, Name [16]int8 +pkg syscall (netbsd-amd64-cgo), type IfAnnounceMsghdr struct, Type uint8 +pkg syscall (netbsd-amd64-cgo), type IfAnnounceMsghdr struct, Version uint8 +pkg syscall (netbsd-amd64-cgo), type IfAnnounceMsghdr struct, What uint16 +pkg syscall (netbsd-amd64-cgo), type IfData struct +pkg syscall (netbsd-amd64-cgo), type IfData struct, Addrlen uint8 +pkg syscall (netbsd-amd64-cgo), type IfData struct, Baudrate uint64 +pkg syscall (netbsd-amd64-cgo), type IfData struct, Collisions uint64 +pkg syscall (netbsd-amd64-cgo), type IfData struct, Hdrlen uint8 +pkg syscall (netbsd-amd64-cgo), type IfData struct, Ibytes uint64 +pkg syscall (netbsd-amd64-cgo), type IfData struct, Ierrors uint64 +pkg syscall (netbsd-amd64-cgo), type IfData struct, Imcasts uint64 +pkg syscall (netbsd-amd64-cgo), type IfData struct, Ipackets uint64 +pkg syscall (netbsd-amd64-cgo), type IfData struct, Iqdrops uint64 +pkg syscall (netbsd-amd64-cgo), type IfData struct, Lastchange Timespec +pkg syscall (netbsd-amd64-cgo), type IfData struct, Link_state int32 +pkg syscall (netbsd-amd64-cgo), type IfData struct, Metric uint64 +pkg syscall (netbsd-amd64-cgo), type IfData struct, Mtu uint64 +pkg syscall (netbsd-amd64-cgo), type IfData struct, Noproto uint64 +pkg syscall (netbsd-amd64-cgo), type IfData struct, Obytes uint64 +pkg syscall (netbsd-amd64-cgo), type IfData struct, Oerrors uint64 +pkg syscall (netbsd-amd64-cgo), type IfData struct, Omcasts uint64 +pkg syscall (netbsd-amd64-cgo), type IfData struct, Opackets uint64 +pkg syscall (netbsd-amd64-cgo), type IfData struct, Pad_cgo_0 [1]uint8 +pkg syscall (netbsd-amd64-cgo), type IfData struct, Type uint8 +pkg syscall (netbsd-amd64-cgo), type IfMsghdr struct +pkg syscall (netbsd-amd64-cgo), type IfMsghdr struct, Addrs int32 +pkg syscall (netbsd-amd64-cgo), type IfMsghdr struct, Data IfData +pkg syscall (netbsd-amd64-cgo), type IfMsghdr struct, Flags int32 +pkg syscall (netbsd-amd64-cgo), type IfMsghdr struct, Index uint16 +pkg syscall (netbsd-amd64-cgo), type IfMsghdr struct, Msglen uint16 +pkg syscall (netbsd-amd64-cgo), type IfMsghdr struct, Pad_cgo_0 [2]uint8 +pkg syscall (netbsd-amd64-cgo), type IfMsghdr struct, Type uint8 +pkg syscall (netbsd-amd64-cgo), type IfMsghdr struct, Version uint8 +pkg syscall (netbsd-amd64-cgo), type IfaMsghdr struct +pkg syscall (netbsd-amd64-cgo), type IfaMsghdr struct, Addrs int32 +pkg syscall (netbsd-amd64-cgo), type IfaMsghdr struct, Flags int32 +pkg syscall (netbsd-amd64-cgo), type IfaMsghdr struct, Index uint16 +pkg syscall (netbsd-amd64-cgo), type IfaMsghdr struct, Metric int32 +pkg syscall (netbsd-amd64-cgo), type IfaMsghdr struct, Msglen uint16 +pkg syscall (netbsd-amd64-cgo), type IfaMsghdr struct, Pad_cgo_0 [6]uint8 +pkg syscall (netbsd-amd64-cgo), type IfaMsghdr struct, Type uint8 +pkg syscall (netbsd-amd64-cgo), type IfaMsghdr struct, Version uint8 +pkg syscall (netbsd-amd64-cgo), type Inet6Pktinfo struct +pkg syscall (netbsd-amd64-cgo), type Inet6Pktinfo struct, Addr [16]uint8 +pkg syscall (netbsd-amd64-cgo), type Inet6Pktinfo struct, Ifindex uint32 +pkg syscall (netbsd-amd64-cgo), type InterfaceAddrMessage struct +pkg syscall (netbsd-amd64-cgo), type InterfaceAddrMessage struct, Data []uint8 +pkg syscall (netbsd-amd64-cgo), type InterfaceAddrMessage struct, Header IfaMsghdr +pkg syscall (netbsd-amd64-cgo), type InterfaceAnnounceMessage struct +pkg syscall (netbsd-amd64-cgo), type InterfaceAnnounceMessage struct, Header IfAnnounceMsghdr +pkg syscall (netbsd-amd64-cgo), type InterfaceMessage struct +pkg syscall (netbsd-amd64-cgo), type InterfaceMessage struct, Data []uint8 +pkg syscall (netbsd-amd64-cgo), type InterfaceMessage struct, Header IfMsghdr +pkg syscall (netbsd-amd64-cgo), type Iovec struct +pkg syscall (netbsd-amd64-cgo), type Iovec struct, Base *uint8 +pkg syscall (netbsd-amd64-cgo), type Iovec struct, Len uint64 +pkg syscall (netbsd-amd64-cgo), type Kevent_t struct +pkg syscall (netbsd-amd64-cgo), type Kevent_t struct, Data int64 +pkg syscall (netbsd-amd64-cgo), type Kevent_t struct, Fflags uint32 +pkg syscall (netbsd-amd64-cgo), type Kevent_t struct, Filter uint32 +pkg syscall (netbsd-amd64-cgo), type Kevent_t struct, Flags uint32 +pkg syscall (netbsd-amd64-cgo), type Kevent_t struct, Ident uint64 +pkg syscall (netbsd-amd64-cgo), type Kevent_t struct, Pad_cgo_0 [4]uint8 +pkg syscall (netbsd-amd64-cgo), type Kevent_t struct, Udata int64 +pkg syscall (netbsd-amd64-cgo), type Mclpool [0]uint8 +pkg syscall (netbsd-amd64-cgo), type Msghdr struct +pkg syscall (netbsd-amd64-cgo), type Msghdr struct, Control *uint8 +pkg syscall (netbsd-amd64-cgo), type Msghdr struct, Controllen uint32 +pkg syscall (netbsd-amd64-cgo), type Msghdr struct, Flags int32 +pkg syscall (netbsd-amd64-cgo), type Msghdr struct, Iov *Iovec +pkg syscall (netbsd-amd64-cgo), type Msghdr struct, Iovlen int32 +pkg syscall (netbsd-amd64-cgo), type Msghdr struct, Name *uint8 +pkg syscall (netbsd-amd64-cgo), type Msghdr struct, Namelen uint32 +pkg syscall (netbsd-amd64-cgo), type Msghdr struct, Pad_cgo_0 [4]uint8 +pkg syscall (netbsd-amd64-cgo), type Msghdr struct, Pad_cgo_1 [4]uint8 +pkg syscall (netbsd-amd64-cgo), type RawSockaddr struct, Data [14]int8 +pkg syscall (netbsd-amd64-cgo), type RawSockaddr struct, Family uint8 +pkg syscall (netbsd-amd64-cgo), type RawSockaddr struct, Len uint8 +pkg syscall (netbsd-amd64-cgo), type RawSockaddrAny struct, Pad [92]int8 +pkg syscall (netbsd-amd64-cgo), type RawSockaddrDatalink struct +pkg syscall (netbsd-amd64-cgo), type RawSockaddrDatalink struct, Alen uint8 +pkg syscall (netbsd-amd64-cgo), type RawSockaddrDatalink struct, Data [12]int8 +pkg syscall (netbsd-amd64-cgo), type RawSockaddrDatalink struct, Family uint8 +pkg syscall (netbsd-amd64-cgo), type RawSockaddrDatalink struct, Index uint16 +pkg syscall (netbsd-amd64-cgo), type RawSockaddrDatalink struct, Len uint8 +pkg syscall (netbsd-amd64-cgo), type RawSockaddrDatalink struct, Nlen uint8 +pkg syscall (netbsd-amd64-cgo), type RawSockaddrDatalink struct, Slen uint8 +pkg syscall (netbsd-amd64-cgo), type RawSockaddrDatalink struct, Type uint8 +pkg syscall (netbsd-amd64-cgo), type RawSockaddrInet4 struct, Family uint8 +pkg syscall (netbsd-amd64-cgo), type RawSockaddrInet4 struct, Len uint8 +pkg syscall (netbsd-amd64-cgo), type RawSockaddrInet4 struct, Zero [8]int8 +pkg syscall (netbsd-amd64-cgo), type RawSockaddrInet6 struct, Family uint8 +pkg syscall (netbsd-amd64-cgo), type RawSockaddrInet6 struct, Len uint8 +pkg syscall (netbsd-amd64-cgo), type RawSockaddrUnix struct +pkg syscall (netbsd-amd64-cgo), type RawSockaddrUnix struct, Family uint8 +pkg syscall (netbsd-amd64-cgo), type RawSockaddrUnix struct, Len uint8 +pkg syscall (netbsd-amd64-cgo), type RawSockaddrUnix struct, Path [104]int8 +pkg syscall (netbsd-amd64-cgo), type Rlimit struct +pkg syscall (netbsd-amd64-cgo), type Rlimit struct, Cur uint64 +pkg syscall (netbsd-amd64-cgo), type Rlimit struct, Max uint64 +pkg syscall (netbsd-amd64-cgo), type RouteMessage struct +pkg syscall (netbsd-amd64-cgo), type RouteMessage struct, Data []uint8 +pkg syscall (netbsd-amd64-cgo), type RouteMessage struct, Header RtMsghdr +pkg syscall (netbsd-amd64-cgo), type RoutingMessage interface, unexported methods +pkg syscall (netbsd-amd64-cgo), type RtMetrics struct +pkg syscall (netbsd-amd64-cgo), type RtMetrics struct, Expire int64 +pkg syscall (netbsd-amd64-cgo), type RtMetrics struct, Hopcount uint64 +pkg syscall (netbsd-amd64-cgo), type RtMetrics struct, Locks uint64 +pkg syscall (netbsd-amd64-cgo), type RtMetrics struct, Mtu uint64 +pkg syscall (netbsd-amd64-cgo), type RtMetrics struct, Pksent int64 +pkg syscall (netbsd-amd64-cgo), type RtMetrics struct, Recvpipe uint64 +pkg syscall (netbsd-amd64-cgo), type RtMetrics struct, Rtt uint64 +pkg syscall (netbsd-amd64-cgo), type RtMetrics struct, Rttvar uint64 +pkg syscall (netbsd-amd64-cgo), type RtMetrics struct, Sendpipe uint64 +pkg syscall (netbsd-amd64-cgo), type RtMetrics struct, Ssthresh uint64 +pkg syscall (netbsd-amd64-cgo), type RtMsghdr struct +pkg syscall (netbsd-amd64-cgo), type RtMsghdr struct, Addrs int32 +pkg syscall (netbsd-amd64-cgo), type RtMsghdr struct, Errno int32 +pkg syscall (netbsd-amd64-cgo), type RtMsghdr struct, Flags int32 +pkg syscall (netbsd-amd64-cgo), type RtMsghdr struct, Index uint16 +pkg syscall (netbsd-amd64-cgo), type RtMsghdr struct, Inits int32 +pkg syscall (netbsd-amd64-cgo), type RtMsghdr struct, Msglen uint16 +pkg syscall (netbsd-amd64-cgo), type RtMsghdr struct, Pad_cgo_0 [2]uint8 +pkg syscall (netbsd-amd64-cgo), type RtMsghdr struct, Pad_cgo_1 [4]uint8 +pkg syscall (netbsd-amd64-cgo), type RtMsghdr struct, Pid int32 +pkg syscall (netbsd-amd64-cgo), type RtMsghdr struct, Rmx RtMetrics +pkg syscall (netbsd-amd64-cgo), type RtMsghdr struct, Seq int32 +pkg syscall (netbsd-amd64-cgo), type RtMsghdr struct, Type uint8 +pkg syscall (netbsd-amd64-cgo), type RtMsghdr struct, Use int32 +pkg syscall (netbsd-amd64-cgo), type RtMsghdr struct, Version uint8 +pkg syscall (netbsd-amd64-cgo), type Rusage struct, Idrss int64 +pkg syscall (netbsd-amd64-cgo), type Rusage struct, Inblock int64 +pkg syscall (netbsd-amd64-cgo), type Rusage struct, Isrss int64 +pkg syscall (netbsd-amd64-cgo), type Rusage struct, Ixrss int64 +pkg syscall (netbsd-amd64-cgo), type Rusage struct, Majflt int64 +pkg syscall (netbsd-amd64-cgo), type Rusage struct, Maxrss int64 +pkg syscall (netbsd-amd64-cgo), type Rusage struct, Minflt int64 +pkg syscall (netbsd-amd64-cgo), type Rusage struct, Msgrcv int64 +pkg syscall (netbsd-amd64-cgo), type Rusage struct, Msgsnd int64 +pkg syscall (netbsd-amd64-cgo), type Rusage struct, Nivcsw int64 +pkg syscall (netbsd-amd64-cgo), type Rusage struct, Nsignals int64 +pkg syscall (netbsd-amd64-cgo), type Rusage struct, Nswap int64 +pkg syscall (netbsd-amd64-cgo), type Rusage struct, Nvcsw int64 +pkg syscall (netbsd-amd64-cgo), type Rusage struct, Oublock int64 +pkg syscall (netbsd-amd64-cgo), type Rusage struct, Stime Timeval +pkg syscall (netbsd-amd64-cgo), type Rusage struct, Utime Timeval +pkg syscall (netbsd-amd64-cgo), type SockaddrDatalink struct +pkg syscall (netbsd-amd64-cgo), type SockaddrDatalink struct, Alen uint8 +pkg syscall (netbsd-amd64-cgo), type SockaddrDatalink struct, Data [12]int8 +pkg syscall (netbsd-amd64-cgo), type SockaddrDatalink struct, Family uint8 +pkg syscall (netbsd-amd64-cgo), type SockaddrDatalink struct, Index uint16 +pkg syscall (netbsd-amd64-cgo), type SockaddrDatalink struct, Len uint8 +pkg syscall (netbsd-amd64-cgo), type SockaddrDatalink struct, Nlen uint8 +pkg syscall (netbsd-amd64-cgo), type SockaddrDatalink struct, Slen uint8 +pkg syscall (netbsd-amd64-cgo), type SockaddrDatalink struct, Type uint8 +pkg syscall (netbsd-amd64-cgo), type SocketControlMessage struct +pkg syscall (netbsd-amd64-cgo), type SocketControlMessage struct, Data []uint8 +pkg syscall (netbsd-amd64-cgo), type SocketControlMessage struct, Header Cmsghdr +pkg syscall (netbsd-amd64-cgo), type Stat_t struct +pkg syscall (netbsd-amd64-cgo), type Stat_t struct, Atimespec Timespec +pkg syscall (netbsd-amd64-cgo), type Stat_t struct, Birthtimespec Timespec +pkg syscall (netbsd-amd64-cgo), type Stat_t struct, Blksize uint32 +pkg syscall (netbsd-amd64-cgo), type Stat_t struct, Blocks int64 +pkg syscall (netbsd-amd64-cgo), type Stat_t struct, Ctimespec Timespec +pkg syscall (netbsd-amd64-cgo), type Stat_t struct, Dev uint64 +pkg syscall (netbsd-amd64-cgo), type Stat_t struct, Flags uint32 +pkg syscall (netbsd-amd64-cgo), type Stat_t struct, Gen uint32 +pkg syscall (netbsd-amd64-cgo), type Stat_t struct, Gid uint32 +pkg syscall (netbsd-amd64-cgo), type Stat_t struct, Ino uint64 +pkg syscall (netbsd-amd64-cgo), type Stat_t struct, Mode uint32 +pkg syscall (netbsd-amd64-cgo), type Stat_t struct, Mtimespec Timespec +pkg syscall (netbsd-amd64-cgo), type Stat_t struct, Nlink uint32 +pkg syscall (netbsd-amd64-cgo), type Stat_t struct, Pad_cgo_0 [4]uint8 +pkg syscall (netbsd-amd64-cgo), type Stat_t struct, Pad_cgo_1 [4]uint8 +pkg syscall (netbsd-amd64-cgo), type Stat_t struct, Pad_cgo_2 [4]uint8 +pkg syscall (netbsd-amd64-cgo), type Stat_t struct, Rdev uint64 +pkg syscall (netbsd-amd64-cgo), type Stat_t struct, Size int64 +pkg syscall (netbsd-amd64-cgo), type Stat_t struct, Spare [2]uint32 +pkg syscall (netbsd-amd64-cgo), type Stat_t struct, Uid uint32 +pkg syscall (netbsd-amd64-cgo), type Statfs_t [0]uint8 +pkg syscall (netbsd-amd64-cgo), type SysProcAttr struct, Chroot string +pkg syscall (netbsd-amd64-cgo), type SysProcAttr struct, Credential *Credential +pkg syscall (netbsd-amd64-cgo), type SysProcAttr struct, Noctty bool +pkg syscall (netbsd-amd64-cgo), type SysProcAttr struct, Ptrace bool +pkg syscall (netbsd-amd64-cgo), type SysProcAttr struct, Setctty bool +pkg syscall (netbsd-amd64-cgo), type SysProcAttr struct, Setpgid bool +pkg syscall (netbsd-amd64-cgo), type SysProcAttr struct, Setsid bool +pkg syscall (netbsd-amd64-cgo), type Sysctlnode struct +pkg syscall (netbsd-amd64-cgo), type Sysctlnode struct, Flags uint32 +pkg syscall (netbsd-amd64-cgo), type Sysctlnode struct, Name [32]int8 +pkg syscall (netbsd-amd64-cgo), type Sysctlnode struct, Num int32 +pkg syscall (netbsd-amd64-cgo), type Sysctlnode struct, Un [16]uint8 +pkg syscall (netbsd-amd64-cgo), type Sysctlnode struct, Ver uint32 +pkg syscall (netbsd-amd64-cgo), type Sysctlnode struct, X__rsvd uint32 +pkg syscall (netbsd-amd64-cgo), type Sysctlnode struct, X_sysctl_desc [8]uint8 +pkg syscall (netbsd-amd64-cgo), type Sysctlnode struct, X_sysctl_func [8]uint8 +pkg syscall (netbsd-amd64-cgo), type Sysctlnode struct, X_sysctl_parent [8]uint8 +pkg syscall (netbsd-amd64-cgo), type Sysctlnode struct, X_sysctl_size [8]uint8 +pkg syscall (netbsd-amd64-cgo), type Timespec struct, Nsec int64 +pkg syscall (netbsd-amd64-cgo), type Timespec struct, Sec int64 +pkg syscall (netbsd-amd64-cgo), type Timeval struct, Pad_cgo_0 [4]uint8 +pkg syscall (netbsd-amd64-cgo), type Timeval struct, Sec int64 +pkg syscall (netbsd-amd64-cgo), type Timeval struct, Usec int32 +pkg syscall (netbsd-amd64-cgo), type WaitStatus uint32 +pkg syscall (netbsd-amd64-cgo), var Stderr int +pkg syscall (netbsd-amd64-cgo), var Stdin int +pkg syscall (netbsd-amd64-cgo), var Stdout int +pkg syscall (netbsd-arm), const AF_APPLETALK ideal-int +pkg syscall (netbsd-arm), const AF_ARP ideal-int +pkg syscall (netbsd-arm), const AF_BLUETOOTH ideal-int +pkg syscall (netbsd-arm), const AF_CCITT ideal-int +pkg syscall (netbsd-arm), const AF_CHAOS ideal-int +pkg syscall (netbsd-arm), const AF_CNT ideal-int +pkg syscall (netbsd-arm), const AF_COIP ideal-int +pkg syscall (netbsd-arm), const AF_DATAKIT ideal-int +pkg syscall (netbsd-arm), const AF_DECnet ideal-int +pkg syscall (netbsd-arm), const AF_DLI ideal-int +pkg syscall (netbsd-arm), const AF_E164 ideal-int +pkg syscall (netbsd-arm), const AF_ECMA ideal-int +pkg syscall (netbsd-arm), const AF_HYLINK ideal-int +pkg syscall (netbsd-arm), const AF_IEEE80211 ideal-int +pkg syscall (netbsd-arm), const AF_IMPLINK ideal-int +pkg syscall (netbsd-arm), const AF_IPX ideal-int +pkg syscall (netbsd-arm), const AF_ISDN ideal-int +pkg syscall (netbsd-arm), const AF_ISO ideal-int +pkg syscall (netbsd-arm), const AF_LAT ideal-int +pkg syscall (netbsd-arm), const AF_LINK ideal-int +pkg syscall (netbsd-arm), const AF_LOCAL ideal-int +pkg syscall (netbsd-arm), const AF_MAX ideal-int +pkg syscall (netbsd-arm), const AF_MPLS ideal-int +pkg syscall (netbsd-arm), const AF_NATM ideal-int +pkg syscall (netbsd-arm), const AF_NS ideal-int +pkg syscall (netbsd-arm), const AF_OROUTE ideal-int +pkg syscall (netbsd-arm), const AF_OSI ideal-int +pkg syscall (netbsd-arm), const AF_PUP ideal-int +pkg syscall (netbsd-arm), const AF_ROUTE ideal-int +pkg syscall (netbsd-arm), const AF_SNA ideal-int +pkg syscall (netbsd-arm), const ARPHRD_ARCNET ideal-int +pkg syscall (netbsd-arm), const ARPHRD_ETHER ideal-int +pkg syscall (netbsd-arm), const ARPHRD_FRELAY ideal-int +pkg syscall (netbsd-arm), const ARPHRD_IEEE1394 ideal-int +pkg syscall (netbsd-arm), const ARPHRD_IEEE802 ideal-int +pkg syscall (netbsd-arm), const ARPHRD_STRIP ideal-int +pkg syscall (netbsd-arm), const B0 ideal-int +pkg syscall (netbsd-arm), const B110 ideal-int +pkg syscall (netbsd-arm), const B115200 ideal-int +pkg syscall (netbsd-arm), const B1200 ideal-int +pkg syscall (netbsd-arm), const B134 ideal-int +pkg syscall (netbsd-arm), const B14400 ideal-int +pkg syscall (netbsd-arm), const B150 ideal-int +pkg syscall (netbsd-arm), const B1800 ideal-int +pkg syscall (netbsd-arm), const B19200 ideal-int +pkg syscall (netbsd-arm), const B200 ideal-int +pkg syscall (netbsd-arm), const B230400 ideal-int +pkg syscall (netbsd-arm), const B2400 ideal-int +pkg syscall (netbsd-arm), const B28800 ideal-int +pkg syscall (netbsd-arm), const B300 ideal-int +pkg syscall (netbsd-arm), const B38400 ideal-int +pkg syscall (netbsd-arm), const B460800 ideal-int +pkg syscall (netbsd-arm), const B4800 ideal-int +pkg syscall (netbsd-arm), const B50 ideal-int +pkg syscall (netbsd-arm), const B57600 ideal-int +pkg syscall (netbsd-arm), const B600 ideal-int +pkg syscall (netbsd-arm), const B7200 ideal-int +pkg syscall (netbsd-arm), const B75 ideal-int +pkg syscall (netbsd-arm), const B76800 ideal-int +pkg syscall (netbsd-arm), const B921600 ideal-int +pkg syscall (netbsd-arm), const B9600 ideal-int +pkg syscall (netbsd-arm), const BIOCFEEDBACK ideal-int +pkg syscall (netbsd-arm), const BIOCFLUSH ideal-int +pkg syscall (netbsd-arm), const BIOCGBLEN ideal-int +pkg syscall (netbsd-arm), const BIOCGDLT ideal-int +pkg syscall (netbsd-arm), const BIOCGDLTLIST ideal-int +pkg syscall (netbsd-arm), const BIOCGETIF ideal-int +pkg syscall (netbsd-arm), const BIOCGFEEDBACK ideal-int +pkg syscall (netbsd-arm), const BIOCGHDRCMPLT ideal-int +pkg syscall (netbsd-arm), const BIOCGRTIMEOUT ideal-int +pkg syscall (netbsd-arm), const BIOCGSEESENT ideal-int +pkg syscall (netbsd-arm), const BIOCGSTATS ideal-int +pkg syscall (netbsd-arm), const BIOCGSTATSOLD ideal-int +pkg syscall (netbsd-arm), const BIOCIMMEDIATE ideal-int +pkg syscall (netbsd-arm), const BIOCPROMISC ideal-int +pkg syscall (netbsd-arm), const BIOCSBLEN ideal-int +pkg syscall (netbsd-arm), const BIOCSDLT ideal-int +pkg syscall (netbsd-arm), const BIOCSETF ideal-int +pkg syscall (netbsd-arm), const BIOCSETIF ideal-int +pkg syscall (netbsd-arm), const BIOCSFEEDBACK ideal-int +pkg syscall (netbsd-arm), const BIOCSHDRCMPLT ideal-int +pkg syscall (netbsd-arm), const BIOCSRTIMEOUT ideal-int +pkg syscall (netbsd-arm), const BIOCSSEESENT ideal-int +pkg syscall (netbsd-arm), const BIOCSTCPF ideal-int +pkg syscall (netbsd-arm), const BIOCSUDPF ideal-int +pkg syscall (netbsd-arm), const BIOCVERSION ideal-int +pkg syscall (netbsd-arm), const BPF_A ideal-int +pkg syscall (netbsd-arm), const BPF_ABS ideal-int +pkg syscall (netbsd-arm), const BPF_ADD ideal-int +pkg syscall (netbsd-arm), const BPF_ALIGNMENT ideal-int +pkg syscall (netbsd-arm), const BPF_ALIGNMENT32 ideal-int +pkg syscall (netbsd-arm), const BPF_ALU ideal-int +pkg syscall (netbsd-arm), const BPF_AND ideal-int +pkg syscall (netbsd-arm), const BPF_B ideal-int +pkg syscall (netbsd-arm), const BPF_DFLTBUFSIZE ideal-int +pkg syscall (netbsd-arm), const BPF_DIV ideal-int +pkg syscall (netbsd-arm), const BPF_H ideal-int +pkg syscall (netbsd-arm), const BPF_IMM ideal-int +pkg syscall (netbsd-arm), const BPF_IND ideal-int +pkg syscall (netbsd-arm), const BPF_JA ideal-int +pkg syscall (netbsd-arm), const BPF_JEQ ideal-int +pkg syscall (netbsd-arm), const BPF_JGE ideal-int +pkg syscall (netbsd-arm), const BPF_JGT ideal-int +pkg syscall (netbsd-arm), const BPF_JMP ideal-int +pkg syscall (netbsd-arm), const BPF_JSET ideal-int +pkg syscall (netbsd-arm), const BPF_K ideal-int +pkg syscall (netbsd-arm), const BPF_LD ideal-int +pkg syscall (netbsd-arm), const BPF_LDX ideal-int +pkg syscall (netbsd-arm), const BPF_LEN ideal-int +pkg syscall (netbsd-arm), const BPF_LSH ideal-int +pkg syscall (netbsd-arm), const BPF_MAJOR_VERSION ideal-int +pkg syscall (netbsd-arm), const BPF_MAXBUFSIZE ideal-int +pkg syscall (netbsd-arm), const BPF_MAXINSNS ideal-int +pkg syscall (netbsd-arm), const BPF_MEM ideal-int +pkg syscall (netbsd-arm), const BPF_MEMWORDS ideal-int +pkg syscall (netbsd-arm), const BPF_MINBUFSIZE ideal-int +pkg syscall (netbsd-arm), const BPF_MINOR_VERSION ideal-int +pkg syscall (netbsd-arm), const BPF_MISC ideal-int +pkg syscall (netbsd-arm), const BPF_MSH ideal-int +pkg syscall (netbsd-arm), const BPF_MUL ideal-int +pkg syscall (netbsd-arm), const BPF_NEG ideal-int +pkg syscall (netbsd-arm), const BPF_OR ideal-int +pkg syscall (netbsd-arm), const BPF_RELEASE ideal-int +pkg syscall (netbsd-arm), const BPF_RET ideal-int +pkg syscall (netbsd-arm), const BPF_RSH ideal-int +pkg syscall (netbsd-arm), const BPF_ST ideal-int +pkg syscall (netbsd-arm), const BPF_STX ideal-int +pkg syscall (netbsd-arm), const BPF_SUB ideal-int +pkg syscall (netbsd-arm), const BPF_TAX ideal-int +pkg syscall (netbsd-arm), const BPF_TXA ideal-int +pkg syscall (netbsd-arm), const BPF_W ideal-int +pkg syscall (netbsd-arm), const BPF_X ideal-int +pkg syscall (netbsd-arm), const BRKINT ideal-int +pkg syscall (netbsd-arm), const CFLUSH ideal-int +pkg syscall (netbsd-arm), const CLOCAL ideal-int +pkg syscall (netbsd-arm), const CREAD ideal-int +pkg syscall (netbsd-arm), const CS5 ideal-int +pkg syscall (netbsd-arm), const CS6 ideal-int +pkg syscall (netbsd-arm), const CS7 ideal-int +pkg syscall (netbsd-arm), const CS8 ideal-int +pkg syscall (netbsd-arm), const CSIZE ideal-int +pkg syscall (netbsd-arm), const CSTART ideal-int +pkg syscall (netbsd-arm), const CSTATUS ideal-int +pkg syscall (netbsd-arm), const CSTOP ideal-int +pkg syscall (netbsd-arm), const CSTOPB ideal-int +pkg syscall (netbsd-arm), const CSUSP ideal-int +pkg syscall (netbsd-arm), const CTL_MAXNAME ideal-int +pkg syscall (netbsd-arm), const CTL_NET ideal-int +pkg syscall (netbsd-arm), const CTL_QUERY ideal-int +pkg syscall (netbsd-arm), const DIOCBSFLUSH ideal-int +pkg syscall (netbsd-arm), const DLT_A429 ideal-int +pkg syscall (netbsd-arm), const DLT_A653_ICM ideal-int +pkg syscall (netbsd-arm), const DLT_AIRONET_HEADER ideal-int +pkg syscall (netbsd-arm), const DLT_AOS ideal-int +pkg syscall (netbsd-arm), const DLT_APPLE_IP_OVER_IEEE1394 ideal-int +pkg syscall (netbsd-arm), const DLT_ARCNET ideal-int +pkg syscall (netbsd-arm), const DLT_ARCNET_LINUX ideal-int +pkg syscall (netbsd-arm), const DLT_ATM_CLIP ideal-int +pkg syscall (netbsd-arm), const DLT_ATM_RFC1483 ideal-int +pkg syscall (netbsd-arm), const DLT_AURORA ideal-int +pkg syscall (netbsd-arm), const DLT_AX25 ideal-int +pkg syscall (netbsd-arm), const DLT_AX25_KISS ideal-int +pkg syscall (netbsd-arm), const DLT_BACNET_MS_TP ideal-int +pkg syscall (netbsd-arm), const DLT_BLUETOOTH_HCI_H4 ideal-int +pkg syscall (netbsd-arm), const DLT_BLUETOOTH_HCI_H4_WITH_PHDR ideal-int +pkg syscall (netbsd-arm), const DLT_CAN20B ideal-int +pkg syscall (netbsd-arm), const DLT_CAN_SOCKETCAN ideal-int +pkg syscall (netbsd-arm), const DLT_CHAOS ideal-int +pkg syscall (netbsd-arm), const DLT_CISCO_IOS ideal-int +pkg syscall (netbsd-arm), const DLT_C_HDLC ideal-int +pkg syscall (netbsd-arm), const DLT_C_HDLC_WITH_DIR ideal-int +pkg syscall (netbsd-arm), const DLT_DECT ideal-int +pkg syscall (netbsd-arm), const DLT_DOCSIS ideal-int +pkg syscall (netbsd-arm), const DLT_ECONET ideal-int +pkg syscall (netbsd-arm), const DLT_EN10MB ideal-int +pkg syscall (netbsd-arm), const DLT_EN3MB ideal-int +pkg syscall (netbsd-arm), const DLT_ENC ideal-int +pkg syscall (netbsd-arm), const DLT_ERF ideal-int +pkg syscall (netbsd-arm), const DLT_ERF_ETH ideal-int +pkg syscall (netbsd-arm), const DLT_ERF_POS ideal-int +pkg syscall (netbsd-arm), const DLT_FC_2 ideal-int +pkg syscall (netbsd-arm), const DLT_FC_2_WITH_FRAME_DELIMS ideal-int +pkg syscall (netbsd-arm), const DLT_FDDI ideal-int +pkg syscall (netbsd-arm), const DLT_FLEXRAY ideal-int +pkg syscall (netbsd-arm), const DLT_FRELAY ideal-int +pkg syscall (netbsd-arm), const DLT_FRELAY_WITH_DIR ideal-int +pkg syscall (netbsd-arm), const DLT_GCOM_SERIAL ideal-int +pkg syscall (netbsd-arm), const DLT_GCOM_T1E1 ideal-int +pkg syscall (netbsd-arm), const DLT_GPF_F ideal-int +pkg syscall (netbsd-arm), const DLT_GPF_T ideal-int +pkg syscall (netbsd-arm), const DLT_GPRS_LLC ideal-int +pkg syscall (netbsd-arm), const DLT_GSMTAP_ABIS ideal-int +pkg syscall (netbsd-arm), const DLT_GSMTAP_UM ideal-int +pkg syscall (netbsd-arm), const DLT_HDLC ideal-int +pkg syscall (netbsd-arm), const DLT_HHDLC ideal-int +pkg syscall (netbsd-arm), const DLT_HIPPI ideal-int +pkg syscall (netbsd-arm), const DLT_IBM_SN ideal-int +pkg syscall (netbsd-arm), const DLT_IBM_SP ideal-int +pkg syscall (netbsd-arm), const DLT_IEEE802 ideal-int +pkg syscall (netbsd-arm), const DLT_IEEE802_11 ideal-int +pkg syscall (netbsd-arm), const DLT_IEEE802_11_RADIO ideal-int +pkg syscall (netbsd-arm), const DLT_IEEE802_11_RADIO_AVS ideal-int +pkg syscall (netbsd-arm), const DLT_IEEE802_15_4 ideal-int +pkg syscall (netbsd-arm), const DLT_IEEE802_15_4_LINUX ideal-int +pkg syscall (netbsd-arm), const DLT_IEEE802_15_4_NONASK_PHY ideal-int +pkg syscall (netbsd-arm), const DLT_IEEE802_16_MAC_CPS ideal-int +pkg syscall (netbsd-arm), const DLT_IEEE802_16_MAC_CPS_RADIO ideal-int +pkg syscall (netbsd-arm), const DLT_IPMB ideal-int +pkg syscall (netbsd-arm), const DLT_IPMB_LINUX ideal-int +pkg syscall (netbsd-arm), const DLT_IPNET ideal-int +pkg syscall (netbsd-arm), const DLT_IPV4 ideal-int +pkg syscall (netbsd-arm), const DLT_IPV6 ideal-int +pkg syscall (netbsd-arm), const DLT_IP_OVER_FC ideal-int +pkg syscall (netbsd-arm), const DLT_JUNIPER_ATM1 ideal-int +pkg syscall (netbsd-arm), const DLT_JUNIPER_ATM2 ideal-int +pkg syscall (netbsd-arm), const DLT_JUNIPER_CHDLC ideal-int +pkg syscall (netbsd-arm), const DLT_JUNIPER_ES ideal-int +pkg syscall (netbsd-arm), const DLT_JUNIPER_ETHER ideal-int +pkg syscall (netbsd-arm), const DLT_JUNIPER_FRELAY ideal-int +pkg syscall (netbsd-arm), const DLT_JUNIPER_GGSN ideal-int +pkg syscall (netbsd-arm), const DLT_JUNIPER_ISM ideal-int +pkg syscall (netbsd-arm), const DLT_JUNIPER_MFR ideal-int +pkg syscall (netbsd-arm), const DLT_JUNIPER_MLFR ideal-int +pkg syscall (netbsd-arm), const DLT_JUNIPER_MLPPP ideal-int +pkg syscall (netbsd-arm), const DLT_JUNIPER_MONITOR ideal-int +pkg syscall (netbsd-arm), const DLT_JUNIPER_PIC_PEER ideal-int +pkg syscall (netbsd-arm), const DLT_JUNIPER_PPP ideal-int +pkg syscall (netbsd-arm), const DLT_JUNIPER_PPPOE ideal-int +pkg syscall (netbsd-arm), const DLT_JUNIPER_PPPOE_ATM ideal-int +pkg syscall (netbsd-arm), const DLT_JUNIPER_SERVICES ideal-int +pkg syscall (netbsd-arm), const DLT_JUNIPER_ST ideal-int +pkg syscall (netbsd-arm), const DLT_JUNIPER_VP ideal-int +pkg syscall (netbsd-arm), const DLT_LAPB_WITH_DIR ideal-int +pkg syscall (netbsd-arm), const DLT_LAPD ideal-int +pkg syscall (netbsd-arm), const DLT_LIN ideal-int +pkg syscall (netbsd-arm), const DLT_LINUX_EVDEV ideal-int +pkg syscall (netbsd-arm), const DLT_LINUX_IRDA ideal-int +pkg syscall (netbsd-arm), const DLT_LINUX_LAPD ideal-int +pkg syscall (netbsd-arm), const DLT_LINUX_SLL ideal-int +pkg syscall (netbsd-arm), const DLT_LOOP ideal-int +pkg syscall (netbsd-arm), const DLT_LTALK ideal-int +pkg syscall (netbsd-arm), const DLT_MFR ideal-int +pkg syscall (netbsd-arm), const DLT_MOST ideal-int +pkg syscall (netbsd-arm), const DLT_MPLS ideal-int +pkg syscall (netbsd-arm), const DLT_MTP2 ideal-int +pkg syscall (netbsd-arm), const DLT_MTP2_WITH_PHDR ideal-int +pkg syscall (netbsd-arm), const DLT_MTP3 ideal-int +pkg syscall (netbsd-arm), const DLT_NULL ideal-int +pkg syscall (netbsd-arm), const DLT_PCI_EXP ideal-int +pkg syscall (netbsd-arm), const DLT_PFLOG ideal-int +pkg syscall (netbsd-arm), const DLT_PFSYNC ideal-int +pkg syscall (netbsd-arm), const DLT_PPI ideal-int +pkg syscall (netbsd-arm), const DLT_PPP ideal-int +pkg syscall (netbsd-arm), const DLT_PPP_BSDOS ideal-int +pkg syscall (netbsd-arm), const DLT_PPP_ETHER ideal-int +pkg syscall (netbsd-arm), const DLT_PPP_PPPD ideal-int +pkg syscall (netbsd-arm), const DLT_PPP_SERIAL ideal-int +pkg syscall (netbsd-arm), const DLT_PPP_WITH_DIR ideal-int +pkg syscall (netbsd-arm), const DLT_PRISM_HEADER ideal-int +pkg syscall (netbsd-arm), const DLT_PRONET ideal-int +pkg syscall (netbsd-arm), const DLT_RAIF1 ideal-int +pkg syscall (netbsd-arm), const DLT_RAW ideal-int +pkg syscall (netbsd-arm), const DLT_RAWAF_MASK ideal-int +pkg syscall (netbsd-arm), const DLT_RIO ideal-int +pkg syscall (netbsd-arm), const DLT_SCCP ideal-int +pkg syscall (netbsd-arm), const DLT_SITA ideal-int +pkg syscall (netbsd-arm), const DLT_SLIP ideal-int +pkg syscall (netbsd-arm), const DLT_SLIP_BSDOS ideal-int +pkg syscall (netbsd-arm), const DLT_SUNATM ideal-int +pkg syscall (netbsd-arm), const DLT_SYMANTEC_FIREWALL ideal-int +pkg syscall (netbsd-arm), const DLT_TZSP ideal-int +pkg syscall (netbsd-arm), const DLT_USB ideal-int +pkg syscall (netbsd-arm), const DLT_USB_LINUX ideal-int +pkg syscall (netbsd-arm), const DLT_USB_LINUX_MMAPPED ideal-int +pkg syscall (netbsd-arm), const DLT_WIHART ideal-int +pkg syscall (netbsd-arm), const DLT_X2E_SERIAL ideal-int +pkg syscall (netbsd-arm), const DLT_X2E_XORAYA ideal-int +pkg syscall (netbsd-arm), const DT_BLK ideal-int +pkg syscall (netbsd-arm), const DT_CHR ideal-int +pkg syscall (netbsd-arm), const DT_DIR ideal-int +pkg syscall (netbsd-arm), const DT_FIFO ideal-int +pkg syscall (netbsd-arm), const DT_LNK ideal-int +pkg syscall (netbsd-arm), const DT_REG ideal-int +pkg syscall (netbsd-arm), const DT_SOCK ideal-int +pkg syscall (netbsd-arm), const DT_UNKNOWN ideal-int +pkg syscall (netbsd-arm), const DT_WHT ideal-int +pkg syscall (netbsd-arm), const EAUTH Errno +pkg syscall (netbsd-arm), const EBADMSG Errno +pkg syscall (netbsd-arm), const EBADRPC Errno +pkg syscall (netbsd-arm), const ECHO ideal-int +pkg syscall (netbsd-arm), const ECHOCTL ideal-int +pkg syscall (netbsd-arm), const ECHOE ideal-int +pkg syscall (netbsd-arm), const ECHOK ideal-int +pkg syscall (netbsd-arm), const ECHOKE ideal-int +pkg syscall (netbsd-arm), const ECHONL ideal-int +pkg syscall (netbsd-arm), const ECHOPRT ideal-int +pkg syscall (netbsd-arm), const EFTYPE Errno +pkg syscall (netbsd-arm), const ELAST Errno +pkg syscall (netbsd-arm), const EMULTIHOP Errno +pkg syscall (netbsd-arm), const EMUL_LINUX ideal-int +pkg syscall (netbsd-arm), const EMUL_LINUX32 ideal-int +pkg syscall (netbsd-arm), const EMUL_MAXID ideal-int +pkg syscall (netbsd-arm), const ENEEDAUTH Errno +pkg syscall (netbsd-arm), const ENOATTR Errno +pkg syscall (netbsd-arm), const ENODATA Errno +pkg syscall (netbsd-arm), const ENOLINK Errno +pkg syscall (netbsd-arm), const ENOSR Errno +pkg syscall (netbsd-arm), const ENOSTR Errno +pkg syscall (netbsd-arm), const EPROCLIM Errno +pkg syscall (netbsd-arm), const EPROCUNAVAIL Errno +pkg syscall (netbsd-arm), const EPROGMISMATCH Errno +pkg syscall (netbsd-arm), const EPROGUNAVAIL Errno +pkg syscall (netbsd-arm), const EPROTO Errno +pkg syscall (netbsd-arm), const ERPCMISMATCH Errno +pkg syscall (netbsd-arm), const ETHERCAP_JUMBO_MTU ideal-int +pkg syscall (netbsd-arm), const ETHERCAP_VLAN_HWTAGGING ideal-int +pkg syscall (netbsd-arm), const ETHERCAP_VLAN_MTU ideal-int +pkg syscall (netbsd-arm), const ETHERMIN ideal-int +pkg syscall (netbsd-arm), const ETHERMTU ideal-int +pkg syscall (netbsd-arm), const ETHERMTU_JUMBO ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_8023 ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_AARP ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_ACCTON ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_AEONIC ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_ALPHA ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_AMBER ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_AMOEBA ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_APOLLO ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_APOLLODOMAIN ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_APPLETALK ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_APPLITEK ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_ARGONAUT ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_ARP ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_AT ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_ATALK ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_ATOMIC ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_ATT ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_ATTSTANFORD ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_AUTOPHON ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_AXIS ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_BCLOOP ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_BOFL ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_CABLETRON ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_CHAOS ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_COMDESIGN ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_COMPUGRAPHIC ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_COUNTERPOINT ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_CRONUS ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_CRONUSVLN ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_DCA ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_DDE ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_DEBNI ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_DECAM ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_DECCUST ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_DECDIAG ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_DECDNS ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_DECDTS ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_DECEXPER ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_DECLAST ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_DECLTM ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_DECMUMPS ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_DECNETBIOS ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_DELTACON ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_DIDDLE ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_DLOG1 ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_DLOG2 ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_DN ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_DOGFIGHT ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_DSMD ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_ECMA ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_ENCRYPT ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_ES ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_EXCELAN ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_EXPERDATA ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_FLIP ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_FLOWCONTROL ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_FRARP ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_GENDYN ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_HAYES ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_HIPPI_FP ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_HITACHI ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_HP ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_IEEEPUP ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_IEEEPUPAT ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_IMLBL ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_IMLBLDIAG ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_IP ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_IPAS ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_IPV6 ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_IPX ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_IPXNEW ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_KALPANA ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_LANBRIDGE ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_LANPROBE ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_LAT ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_LBACK ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_LITTLE ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_LOGICRAFT ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_LOOPBACK ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_MATRA ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_MAX ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_MERIT ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_MICP ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_MOPDL ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_MOPRC ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_MOTOROLA ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_MPLS ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_MPLS_MCAST ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_MUMPS ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_NBPCC ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_NBPCLAIM ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_NBPCLREQ ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_NBPCLRSP ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_NBPCREQ ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_NBPCRSP ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_NBPDG ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_NBPDGB ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_NBPDLTE ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_NBPRAR ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_NBPRAS ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_NBPRST ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_NBPSCD ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_NBPVCD ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_NBS ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_NCD ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_NESTAR ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_NETBEUI ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_NOVELL ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_NS ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_NSAT ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_NSCOMPAT ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_NTRAILER ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_OS9 ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_OS9NET ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_PACER ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_PAE ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_PCS ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_PLANNING ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_PPP ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_PPPOE ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_PPPOEDISC ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_PRIMENTS ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_PUP ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_PUPAT ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_RACAL ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_RATIONAL ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_RAWFR ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_RCL ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_RDP ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_RETIX ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_REVARP ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_SCA ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_SECTRA ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_SECUREDATA ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_SGITW ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_SG_BOUNCE ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_SG_DIAG ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_SG_NETGAMES ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_SG_RESV ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_SIMNET ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_SLOWPROTOCOLS ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_SNA ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_SNMP ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_SONIX ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_SPIDER ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_SPRITE ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_STP ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_TALARIS ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_TALARISMC ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_TCPCOMP ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_TCPSM ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_TEC ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_TIGAN ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_TRAIL ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_TRANSETHER ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_TYMSHARE ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_UBBST ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_UBDEBUG ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_UBDIAGLOOP ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_UBDL ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_UBNIU ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_UBNMC ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_VALID ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_VARIAN ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_VAXELN ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_VEECO ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_VEXP ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_VGLAB ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_VINES ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_VINESECHO ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_VINESLOOP ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_VITAL ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_VLAN ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_VLTLMAN ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_VPROD ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_VURESERVED ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_WATERLOO ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_WELLFLEET ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_X25 ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_X75 ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_XNSSM ideal-int +pkg syscall (netbsd-arm), const ETHERTYPE_XTP ideal-int +pkg syscall (netbsd-arm), const ETHER_ADDR_LEN ideal-int +pkg syscall (netbsd-arm), const ETHER_CRC_LEN ideal-int +pkg syscall (netbsd-arm), const ETHER_CRC_POLY_BE ideal-int +pkg syscall (netbsd-arm), const ETHER_CRC_POLY_LE ideal-int +pkg syscall (netbsd-arm), const ETHER_HDR_LEN ideal-int +pkg syscall (netbsd-arm), const ETHER_MAX_LEN ideal-int +pkg syscall (netbsd-arm), const ETHER_MAX_LEN_JUMBO ideal-int +pkg syscall (netbsd-arm), const ETHER_MIN_LEN ideal-int +pkg syscall (netbsd-arm), const ETHER_PPPOE_ENCAP_LEN ideal-int +pkg syscall (netbsd-arm), const ETHER_TYPE_LEN ideal-int +pkg syscall (netbsd-arm), const ETHER_VLAN_ENCAP_LEN ideal-int +pkg syscall (netbsd-arm), const ETIME Errno +pkg syscall (netbsd-arm), const EVFILT_AIO ideal-int +pkg syscall (netbsd-arm), const EVFILT_PROC ideal-int +pkg syscall (netbsd-arm), const EVFILT_READ ideal-int +pkg syscall (netbsd-arm), const EVFILT_SIGNAL ideal-int +pkg syscall (netbsd-arm), const EVFILT_SYSCOUNT ideal-int +pkg syscall (netbsd-arm), const EVFILT_TIMER ideal-int +pkg syscall (netbsd-arm), const EVFILT_VNODE ideal-int +pkg syscall (netbsd-arm), const EVFILT_WRITE ideal-int +pkg syscall (netbsd-arm), const EV_ADD ideal-int +pkg syscall (netbsd-arm), const EV_CLEAR ideal-int +pkg syscall (netbsd-arm), const EV_DELETE ideal-int +pkg syscall (netbsd-arm), const EV_DISABLE ideal-int +pkg syscall (netbsd-arm), const EV_ENABLE ideal-int +pkg syscall (netbsd-arm), const EV_EOF ideal-int +pkg syscall (netbsd-arm), const EV_ERROR ideal-int +pkg syscall (netbsd-arm), const EV_FLAG1 ideal-int +pkg syscall (netbsd-arm), const EV_ONESHOT ideal-int +pkg syscall (netbsd-arm), const EV_SYSFLAGS ideal-int +pkg syscall (netbsd-arm), const EXTA ideal-int +pkg syscall (netbsd-arm), const EXTB ideal-int +pkg syscall (netbsd-arm), const EXTPROC ideal-int +pkg syscall (netbsd-arm), const FD_CLOEXEC ideal-int +pkg syscall (netbsd-arm), const FD_SETSIZE ideal-int +pkg syscall (netbsd-arm), const FLUSHO ideal-int +pkg syscall (netbsd-arm), const F_CLOSEM ideal-int +pkg syscall (netbsd-arm), const F_DUPFD ideal-int +pkg syscall (netbsd-arm), const F_DUPFD_CLOEXEC ideal-int +pkg syscall (netbsd-arm), const F_FSCTL ideal-int +pkg syscall (netbsd-arm), const F_FSDIRMASK ideal-int +pkg syscall (netbsd-arm), const F_FSIN ideal-int +pkg syscall (netbsd-arm), const F_FSINOUT ideal-int +pkg syscall (netbsd-arm), const F_FSOUT ideal-int +pkg syscall (netbsd-arm), const F_FSPRIV ideal-int +pkg syscall (netbsd-arm), const F_FSVOID ideal-int +pkg syscall (netbsd-arm), const F_GETFD ideal-int +pkg syscall (netbsd-arm), const F_GETFL ideal-int +pkg syscall (netbsd-arm), const F_GETLK ideal-int +pkg syscall (netbsd-arm), const F_GETNOSIGPIPE ideal-int +pkg syscall (netbsd-arm), const F_GETOWN ideal-int +pkg syscall (netbsd-arm), const F_MAXFD ideal-int +pkg syscall (netbsd-arm), const F_OK ideal-int +pkg syscall (netbsd-arm), const F_PARAM_MASK ideal-int +pkg syscall (netbsd-arm), const F_PARAM_MAX ideal-int +pkg syscall (netbsd-arm), const F_RDLCK ideal-int +pkg syscall (netbsd-arm), const F_SETFD ideal-int +pkg syscall (netbsd-arm), const F_SETFL ideal-int +pkg syscall (netbsd-arm), const F_SETLK ideal-int +pkg syscall (netbsd-arm), const F_SETLKW ideal-int +pkg syscall (netbsd-arm), const F_SETNOSIGPIPE ideal-int +pkg syscall (netbsd-arm), const F_SETOWN ideal-int +pkg syscall (netbsd-arm), const F_UNLCK ideal-int +pkg syscall (netbsd-arm), const F_WRLCK ideal-int +pkg syscall (netbsd-arm), const HUPCL ideal-int +pkg syscall (netbsd-arm), const ICANON ideal-int +pkg syscall (netbsd-arm), const ICMP6_FILTER = 18 +pkg syscall (netbsd-arm), const ICMP6_FILTER ideal-int +pkg syscall (netbsd-arm), const ICRNL ideal-int +pkg syscall (netbsd-arm), const IEXTEN ideal-int +pkg syscall (netbsd-arm), const IFAN_ARRIVAL ideal-int +pkg syscall (netbsd-arm), const IFAN_DEPARTURE ideal-int +pkg syscall (netbsd-arm), const IFA_ROUTE ideal-int +pkg syscall (netbsd-arm), const IFF_ALLMULTI ideal-int +pkg syscall (netbsd-arm), const IFF_CANTCHANGE ideal-int +pkg syscall (netbsd-arm), const IFF_DEBUG ideal-int +pkg syscall (netbsd-arm), const IFF_LINK0 ideal-int +pkg syscall (netbsd-arm), const IFF_LINK1 ideal-int +pkg syscall (netbsd-arm), const IFF_LINK2 ideal-int +pkg syscall (netbsd-arm), const IFF_NOARP ideal-int +pkg syscall (netbsd-arm), const IFF_NOTRAILERS ideal-int +pkg syscall (netbsd-arm), const IFF_OACTIVE ideal-int +pkg syscall (netbsd-arm), const IFF_POINTOPOINT ideal-int +pkg syscall (netbsd-arm), const IFF_PROMISC ideal-int +pkg syscall (netbsd-arm), const IFF_RUNNING ideal-int +pkg syscall (netbsd-arm), const IFF_SIMPLEX ideal-int +pkg syscall (netbsd-arm), const IFNAMSIZ ideal-int +pkg syscall (netbsd-arm), const IFT_1822 ideal-int +pkg syscall (netbsd-arm), const IFT_A12MPPSWITCH ideal-int +pkg syscall (netbsd-arm), const IFT_AAL2 ideal-int +pkg syscall (netbsd-arm), const IFT_AAL5 ideal-int +pkg syscall (netbsd-arm), const IFT_ADSL ideal-int +pkg syscall (netbsd-arm), const IFT_AFLANE8023 ideal-int +pkg syscall (netbsd-arm), const IFT_AFLANE8025 ideal-int +pkg syscall (netbsd-arm), const IFT_ARAP ideal-int +pkg syscall (netbsd-arm), const IFT_ARCNET ideal-int +pkg syscall (netbsd-arm), const IFT_ARCNETPLUS ideal-int +pkg syscall (netbsd-arm), const IFT_ASYNC ideal-int +pkg syscall (netbsd-arm), const IFT_ATM ideal-int +pkg syscall (netbsd-arm), const IFT_ATMDXI ideal-int +pkg syscall (netbsd-arm), const IFT_ATMFUNI ideal-int +pkg syscall (netbsd-arm), const IFT_ATMIMA ideal-int +pkg syscall (netbsd-arm), const IFT_ATMLOGICAL ideal-int +pkg syscall (netbsd-arm), const IFT_ATMRADIO ideal-int +pkg syscall (netbsd-arm), const IFT_ATMSUBINTERFACE ideal-int +pkg syscall (netbsd-arm), const IFT_ATMVCIENDPT ideal-int +pkg syscall (netbsd-arm), const IFT_ATMVIRTUAL ideal-int +pkg syscall (netbsd-arm), const IFT_BGPPOLICYACCOUNTING ideal-int +pkg syscall (netbsd-arm), const IFT_BRIDGE ideal-int +pkg syscall (netbsd-arm), const IFT_BSC ideal-int +pkg syscall (netbsd-arm), const IFT_CARP ideal-int +pkg syscall (netbsd-arm), const IFT_CCTEMUL ideal-int +pkg syscall (netbsd-arm), const IFT_CEPT ideal-int +pkg syscall (netbsd-arm), const IFT_CES ideal-int +pkg syscall (netbsd-arm), const IFT_CHANNEL ideal-int +pkg syscall (netbsd-arm), const IFT_CNR ideal-int +pkg syscall (netbsd-arm), const IFT_COFFEE ideal-int +pkg syscall (netbsd-arm), const IFT_COMPOSITELINK ideal-int +pkg syscall (netbsd-arm), const IFT_DCN ideal-int +pkg syscall (netbsd-arm), const IFT_DIGITALPOWERLINE ideal-int +pkg syscall (netbsd-arm), const IFT_DIGITALWRAPPEROVERHEADCHANNEL ideal-int +pkg syscall (netbsd-arm), const IFT_DLSW ideal-int +pkg syscall (netbsd-arm), const IFT_DOCSCABLEDOWNSTREAM ideal-int +pkg syscall (netbsd-arm), const IFT_DOCSCABLEMACLAYER ideal-int +pkg syscall (netbsd-arm), const IFT_DOCSCABLEUPSTREAM ideal-int +pkg syscall (netbsd-arm), const IFT_DOCSCABLEUPSTREAMCHANNEL ideal-int +pkg syscall (netbsd-arm), const IFT_DS0 ideal-int +pkg syscall (netbsd-arm), const IFT_DS0BUNDLE ideal-int +pkg syscall (netbsd-arm), const IFT_DS1FDL ideal-int +pkg syscall (netbsd-arm), const IFT_DS3 ideal-int +pkg syscall (netbsd-arm), const IFT_DTM ideal-int +pkg syscall (netbsd-arm), const IFT_DVBASILN ideal-int +pkg syscall (netbsd-arm), const IFT_DVBASIOUT ideal-int +pkg syscall (netbsd-arm), const IFT_DVBRCCDOWNSTREAM ideal-int +pkg syscall (netbsd-arm), const IFT_DVBRCCMACLAYER ideal-int +pkg syscall (netbsd-arm), const IFT_DVBRCCUPSTREAM ideal-int +pkg syscall (netbsd-arm), const IFT_ECONET ideal-int +pkg syscall (netbsd-arm), const IFT_EON ideal-int +pkg syscall (netbsd-arm), const IFT_EPLRS ideal-int +pkg syscall (netbsd-arm), const IFT_ESCON ideal-int +pkg syscall (netbsd-arm), const IFT_ETHER ideal-int +pkg syscall (netbsd-arm), const IFT_FAITH ideal-int +pkg syscall (netbsd-arm), const IFT_FAST ideal-int +pkg syscall (netbsd-arm), const IFT_FASTETHER ideal-int +pkg syscall (netbsd-arm), const IFT_FASTETHERFX ideal-int +pkg syscall (netbsd-arm), const IFT_FDDI ideal-int +pkg syscall (netbsd-arm), const IFT_FIBRECHANNEL ideal-int +pkg syscall (netbsd-arm), const IFT_FRAMERELAYINTERCONNECT ideal-int +pkg syscall (netbsd-arm), const IFT_FRAMERELAYMPI ideal-int +pkg syscall (netbsd-arm), const IFT_FRDLCIENDPT ideal-int +pkg syscall (netbsd-arm), const IFT_FRELAY ideal-int +pkg syscall (netbsd-arm), const IFT_FRELAYDCE ideal-int +pkg syscall (netbsd-arm), const IFT_FRF16MFRBUNDLE ideal-int +pkg syscall (netbsd-arm), const IFT_FRFORWARD ideal-int +pkg syscall (netbsd-arm), const IFT_G703AT2MB ideal-int +pkg syscall (netbsd-arm), const IFT_G703AT64K ideal-int +pkg syscall (netbsd-arm), const IFT_GIF ideal-int +pkg syscall (netbsd-arm), const IFT_GIGABITETHERNET ideal-int +pkg syscall (netbsd-arm), const IFT_GR303IDT ideal-int +pkg syscall (netbsd-arm), const IFT_GR303RDT ideal-int +pkg syscall (netbsd-arm), const IFT_H323GATEKEEPER ideal-int +pkg syscall (netbsd-arm), const IFT_H323PROXY ideal-int +pkg syscall (netbsd-arm), const IFT_HDH1822 ideal-int +pkg syscall (netbsd-arm), const IFT_HDLC ideal-int +pkg syscall (netbsd-arm), const IFT_HDSL2 ideal-int +pkg syscall (netbsd-arm), const IFT_HIPERLAN2 ideal-int +pkg syscall (netbsd-arm), const IFT_HIPPI ideal-int +pkg syscall (netbsd-arm), const IFT_HIPPIINTERFACE ideal-int +pkg syscall (netbsd-arm), const IFT_HOSTPAD ideal-int +pkg syscall (netbsd-arm), const IFT_HSSI ideal-int +pkg syscall (netbsd-arm), const IFT_HY ideal-int +pkg syscall (netbsd-arm), const IFT_IBM370PARCHAN ideal-int +pkg syscall (netbsd-arm), const IFT_IDSL ideal-int +pkg syscall (netbsd-arm), const IFT_IEEE1394 ideal-int +pkg syscall (netbsd-arm), const IFT_IEEE80211 ideal-int +pkg syscall (netbsd-arm), const IFT_IEEE80212 ideal-int +pkg syscall (netbsd-arm), const IFT_IEEE8023ADLAG ideal-int +pkg syscall (netbsd-arm), const IFT_IFGSN ideal-int +pkg syscall (netbsd-arm), const IFT_IMT ideal-int +pkg syscall (netbsd-arm), const IFT_INFINIBAND ideal-int +pkg syscall (netbsd-arm), const IFT_INTERLEAVE ideal-int +pkg syscall (netbsd-arm), const IFT_IP ideal-int +pkg syscall (netbsd-arm), const IFT_IPFORWARD ideal-int +pkg syscall (netbsd-arm), const IFT_IPOVERATM ideal-int +pkg syscall (netbsd-arm), const IFT_IPOVERCDLC ideal-int +pkg syscall (netbsd-arm), const IFT_IPOVERCLAW ideal-int +pkg syscall (netbsd-arm), const IFT_IPSWITCH ideal-int +pkg syscall (netbsd-arm), const IFT_ISDN ideal-int +pkg syscall (netbsd-arm), const IFT_ISDNBASIC ideal-int +pkg syscall (netbsd-arm), const IFT_ISDNPRIMARY ideal-int +pkg syscall (netbsd-arm), const IFT_ISDNS ideal-int +pkg syscall (netbsd-arm), const IFT_ISDNU ideal-int +pkg syscall (netbsd-arm), const IFT_ISO88022LLC ideal-int +pkg syscall (netbsd-arm), const IFT_ISO88023 ideal-int +pkg syscall (netbsd-arm), const IFT_ISO88024 ideal-int +pkg syscall (netbsd-arm), const IFT_ISO88025 ideal-int +pkg syscall (netbsd-arm), const IFT_ISO88025CRFPINT ideal-int +pkg syscall (netbsd-arm), const IFT_ISO88025DTR ideal-int +pkg syscall (netbsd-arm), const IFT_ISO88025FIBER ideal-int +pkg syscall (netbsd-arm), const IFT_ISO88026 ideal-int +pkg syscall (netbsd-arm), const IFT_ISUP ideal-int +pkg syscall (netbsd-arm), const IFT_L2VLAN ideal-int +pkg syscall (netbsd-arm), const IFT_L3IPVLAN ideal-int +pkg syscall (netbsd-arm), const IFT_L3IPXVLAN ideal-int +pkg syscall (netbsd-arm), const IFT_LAPB ideal-int +pkg syscall (netbsd-arm), const IFT_LAPD ideal-int +pkg syscall (netbsd-arm), const IFT_LAPF ideal-int +pkg syscall (netbsd-arm), const IFT_LINEGROUP ideal-int +pkg syscall (netbsd-arm), const IFT_LOCALTALK ideal-int +pkg syscall (netbsd-arm), const IFT_LOOP ideal-int +pkg syscall (netbsd-arm), const IFT_MEDIAMAILOVERIP ideal-int +pkg syscall (netbsd-arm), const IFT_MFSIGLINK ideal-int +pkg syscall (netbsd-arm), const IFT_MIOX25 ideal-int +pkg syscall (netbsd-arm), const IFT_MODEM ideal-int +pkg syscall (netbsd-arm), const IFT_MPC ideal-int +pkg syscall (netbsd-arm), const IFT_MPLS ideal-int +pkg syscall (netbsd-arm), const IFT_MPLSTUNNEL ideal-int +pkg syscall (netbsd-arm), const IFT_MSDSL ideal-int +pkg syscall (netbsd-arm), const IFT_MVL ideal-int +pkg syscall (netbsd-arm), const IFT_MYRINET ideal-int +pkg syscall (netbsd-arm), const IFT_NFAS ideal-int +pkg syscall (netbsd-arm), const IFT_NSIP ideal-int +pkg syscall (netbsd-arm), const IFT_OPTICALCHANNEL ideal-int +pkg syscall (netbsd-arm), const IFT_OPTICALTRANSPORT ideal-int +pkg syscall (netbsd-arm), const IFT_OTHER ideal-int +pkg syscall (netbsd-arm), const IFT_P10 ideal-int +pkg syscall (netbsd-arm), const IFT_P80 ideal-int +pkg syscall (netbsd-arm), const IFT_PARA ideal-int +pkg syscall (netbsd-arm), const IFT_PFLOG ideal-int +pkg syscall (netbsd-arm), const IFT_PFSYNC ideal-int +pkg syscall (netbsd-arm), const IFT_PLC ideal-int +pkg syscall (netbsd-arm), const IFT_PON155 ideal-int +pkg syscall (netbsd-arm), const IFT_PON622 ideal-int +pkg syscall (netbsd-arm), const IFT_POS ideal-int +pkg syscall (netbsd-arm), const IFT_PPP ideal-int +pkg syscall (netbsd-arm), const IFT_PPPMULTILINKBUNDLE ideal-int +pkg syscall (netbsd-arm), const IFT_PROPATM ideal-int +pkg syscall (netbsd-arm), const IFT_PROPBWAP2MP ideal-int +pkg syscall (netbsd-arm), const IFT_PROPCNLS ideal-int +pkg syscall (netbsd-arm), const IFT_PROPDOCSWIRELESSDOWNSTREAM ideal-int +pkg syscall (netbsd-arm), const IFT_PROPDOCSWIRELESSMACLAYER ideal-int +pkg syscall (netbsd-arm), const IFT_PROPDOCSWIRELESSUPSTREAM ideal-int +pkg syscall (netbsd-arm), const IFT_PROPMUX ideal-int +pkg syscall (netbsd-arm), const IFT_PROPVIRTUAL ideal-int +pkg syscall (netbsd-arm), const IFT_PROPWIRELESSP2P ideal-int +pkg syscall (netbsd-arm), const IFT_PTPSERIAL ideal-int +pkg syscall (netbsd-arm), const IFT_PVC ideal-int +pkg syscall (netbsd-arm), const IFT_Q2931 ideal-int +pkg syscall (netbsd-arm), const IFT_QLLC ideal-int +pkg syscall (netbsd-arm), const IFT_RADIOMAC ideal-int +pkg syscall (netbsd-arm), const IFT_RADSL ideal-int +pkg syscall (netbsd-arm), const IFT_REACHDSL ideal-int +pkg syscall (netbsd-arm), const IFT_RFC1483 ideal-int +pkg syscall (netbsd-arm), const IFT_RS232 ideal-int +pkg syscall (netbsd-arm), const IFT_RSRB ideal-int +pkg syscall (netbsd-arm), const IFT_SDLC ideal-int +pkg syscall (netbsd-arm), const IFT_SDSL ideal-int +pkg syscall (netbsd-arm), const IFT_SHDSL ideal-int +pkg syscall (netbsd-arm), const IFT_SIP ideal-int +pkg syscall (netbsd-arm), const IFT_SIPSIG ideal-int +pkg syscall (netbsd-arm), const IFT_SIPTG ideal-int +pkg syscall (netbsd-arm), const IFT_SLIP ideal-int +pkg syscall (netbsd-arm), const IFT_SMDSDXI ideal-int +pkg syscall (netbsd-arm), const IFT_SMDSICIP ideal-int +pkg syscall (netbsd-arm), const IFT_SONET ideal-int +pkg syscall (netbsd-arm), const IFT_SONETOVERHEADCHANNEL ideal-int +pkg syscall (netbsd-arm), const IFT_SONETPATH ideal-int +pkg syscall (netbsd-arm), const IFT_SONETVT ideal-int +pkg syscall (netbsd-arm), const IFT_SRP ideal-int +pkg syscall (netbsd-arm), const IFT_SS7SIGLINK ideal-int +pkg syscall (netbsd-arm), const IFT_STACKTOSTACK ideal-int +pkg syscall (netbsd-arm), const IFT_STARLAN ideal-int +pkg syscall (netbsd-arm), const IFT_STF ideal-int +pkg syscall (netbsd-arm), const IFT_T1 ideal-int +pkg syscall (netbsd-arm), const IFT_TDLC ideal-int +pkg syscall (netbsd-arm), const IFT_TELINK ideal-int +pkg syscall (netbsd-arm), const IFT_TERMPAD ideal-int +pkg syscall (netbsd-arm), const IFT_TR008 ideal-int +pkg syscall (netbsd-arm), const IFT_TRANSPHDLC ideal-int +pkg syscall (netbsd-arm), const IFT_TUNNEL ideal-int +pkg syscall (netbsd-arm), const IFT_ULTRA ideal-int +pkg syscall (netbsd-arm), const IFT_USB ideal-int +pkg syscall (netbsd-arm), const IFT_V11 ideal-int +pkg syscall (netbsd-arm), const IFT_V35 ideal-int +pkg syscall (netbsd-arm), const IFT_V36 ideal-int +pkg syscall (netbsd-arm), const IFT_V37 ideal-int +pkg syscall (netbsd-arm), const IFT_VDSL ideal-int +pkg syscall (netbsd-arm), const IFT_VIRTUALIPADDRESS ideal-int +pkg syscall (netbsd-arm), const IFT_VIRTUALTG ideal-int +pkg syscall (netbsd-arm), const IFT_VOICEDID ideal-int +pkg syscall (netbsd-arm), const IFT_VOICEEM ideal-int +pkg syscall (netbsd-arm), const IFT_VOICEEMFGD ideal-int +pkg syscall (netbsd-arm), const IFT_VOICEENCAP ideal-int +pkg syscall (netbsd-arm), const IFT_VOICEFGDEANA ideal-int +pkg syscall (netbsd-arm), const IFT_VOICEFXO ideal-int +pkg syscall (netbsd-arm), const IFT_VOICEFXS ideal-int +pkg syscall (netbsd-arm), const IFT_VOICEOVERATM ideal-int +pkg syscall (netbsd-arm), const IFT_VOICEOVERCABLE ideal-int +pkg syscall (netbsd-arm), const IFT_VOICEOVERFRAMERELAY ideal-int +pkg syscall (netbsd-arm), const IFT_VOICEOVERIP ideal-int +pkg syscall (netbsd-arm), const IFT_X213 ideal-int +pkg syscall (netbsd-arm), const IFT_X25 ideal-int +pkg syscall (netbsd-arm), const IFT_X25DDN ideal-int +pkg syscall (netbsd-arm), const IFT_X25HUNTGROUP ideal-int +pkg syscall (netbsd-arm), const IFT_X25MLP ideal-int +pkg syscall (netbsd-arm), const IFT_X25PLE ideal-int +pkg syscall (netbsd-arm), const IFT_XETHER ideal-int +pkg syscall (netbsd-arm), const IGNBRK ideal-int +pkg syscall (netbsd-arm), const IGNCR ideal-int +pkg syscall (netbsd-arm), const IGNPAR ideal-int +pkg syscall (netbsd-arm), const IMAXBEL ideal-int +pkg syscall (netbsd-arm), const INLCR ideal-int +pkg syscall (netbsd-arm), const INPCK ideal-int +pkg syscall (netbsd-arm), const IN_CLASSA_HOST ideal-int +pkg syscall (netbsd-arm), const IN_CLASSA_MAX ideal-int +pkg syscall (netbsd-arm), const IN_CLASSA_NET ideal-int +pkg syscall (netbsd-arm), const IN_CLASSA_NSHIFT ideal-int +pkg syscall (netbsd-arm), const IN_CLASSB_HOST ideal-int +pkg syscall (netbsd-arm), const IN_CLASSB_MAX ideal-int +pkg syscall (netbsd-arm), const IN_CLASSB_NET ideal-int +pkg syscall (netbsd-arm), const IN_CLASSB_NSHIFT ideal-int +pkg syscall (netbsd-arm), const IN_CLASSC_HOST ideal-int +pkg syscall (netbsd-arm), const IN_CLASSC_NET ideal-int +pkg syscall (netbsd-arm), const IN_CLASSC_NSHIFT ideal-int +pkg syscall (netbsd-arm), const IN_CLASSD_HOST ideal-int +pkg syscall (netbsd-arm), const IN_CLASSD_NET ideal-int +pkg syscall (netbsd-arm), const IN_CLASSD_NSHIFT ideal-int +pkg syscall (netbsd-arm), const IN_LOOPBACKNET ideal-int +pkg syscall (netbsd-arm), const IPPROTO_AH ideal-int +pkg syscall (netbsd-arm), const IPPROTO_CARP ideal-int +pkg syscall (netbsd-arm), const IPPROTO_DONE ideal-int +pkg syscall (netbsd-arm), const IPPROTO_DSTOPTS ideal-int +pkg syscall (netbsd-arm), const IPPROTO_EGP ideal-int +pkg syscall (netbsd-arm), const IPPROTO_ENCAP ideal-int +pkg syscall (netbsd-arm), const IPPROTO_EON ideal-int +pkg syscall (netbsd-arm), const IPPROTO_ESP ideal-int +pkg syscall (netbsd-arm), const IPPROTO_ETHERIP ideal-int +pkg syscall (netbsd-arm), const IPPROTO_FRAGMENT ideal-int +pkg syscall (netbsd-arm), const IPPROTO_GGP ideal-int +pkg syscall (netbsd-arm), const IPPROTO_GRE ideal-int +pkg syscall (netbsd-arm), const IPPROTO_HOPOPTS ideal-int +pkg syscall (netbsd-arm), const IPPROTO_ICMP ideal-int +pkg syscall (netbsd-arm), const IPPROTO_ICMPV6 ideal-int +pkg syscall (netbsd-arm), const IPPROTO_IDP ideal-int +pkg syscall (netbsd-arm), const IPPROTO_IGMP ideal-int +pkg syscall (netbsd-arm), const IPPROTO_IPCOMP ideal-int +pkg syscall (netbsd-arm), const IPPROTO_IPIP ideal-int +pkg syscall (netbsd-arm), const IPPROTO_IPV4 ideal-int +pkg syscall (netbsd-arm), const IPPROTO_IPV6_ICMP ideal-int +pkg syscall (netbsd-arm), const IPPROTO_MAX ideal-int +pkg syscall (netbsd-arm), const IPPROTO_MAXID ideal-int +pkg syscall (netbsd-arm), const IPPROTO_MOBILE ideal-int +pkg syscall (netbsd-arm), const IPPROTO_NONE ideal-int +pkg syscall (netbsd-arm), const IPPROTO_PFSYNC ideal-int +pkg syscall (netbsd-arm), const IPPROTO_PIM ideal-int +pkg syscall (netbsd-arm), const IPPROTO_PUP ideal-int +pkg syscall (netbsd-arm), const IPPROTO_RAW ideal-int +pkg syscall (netbsd-arm), const IPPROTO_ROUTING ideal-int +pkg syscall (netbsd-arm), const IPPROTO_RSVP ideal-int +pkg syscall (netbsd-arm), const IPPROTO_TP ideal-int +pkg syscall (netbsd-arm), const IPPROTO_VRRP ideal-int +pkg syscall (netbsd-arm), const IPV6_CHECKSUM ideal-int +pkg syscall (netbsd-arm), const IPV6_DEFAULT_MULTICAST_HOPS ideal-int +pkg syscall (netbsd-arm), const IPV6_DEFAULT_MULTICAST_LOOP ideal-int +pkg syscall (netbsd-arm), const IPV6_DEFHLIM ideal-int +pkg syscall (netbsd-arm), const IPV6_DONTFRAG ideal-int +pkg syscall (netbsd-arm), const IPV6_DSTOPTS ideal-int +pkg syscall (netbsd-arm), const IPV6_FAITH ideal-int +pkg syscall (netbsd-arm), const IPV6_FLOWINFO_MASK ideal-int +pkg syscall (netbsd-arm), const IPV6_FLOWLABEL_MASK ideal-int +pkg syscall (netbsd-arm), const IPV6_FRAGTTL ideal-int +pkg syscall (netbsd-arm), const IPV6_HLIMDEC ideal-int +pkg syscall (netbsd-arm), const IPV6_HOPLIMIT ideal-int +pkg syscall (netbsd-arm), const IPV6_HOPOPTS ideal-int +pkg syscall (netbsd-arm), const IPV6_IPSEC_POLICY ideal-int +pkg syscall (netbsd-arm), const IPV6_MAXHLIM ideal-int +pkg syscall (netbsd-arm), const IPV6_MAXPACKET ideal-int +pkg syscall (netbsd-arm), const IPV6_MMTU ideal-int +pkg syscall (netbsd-arm), const IPV6_NEXTHOP ideal-int +pkg syscall (netbsd-arm), const IPV6_PATHMTU ideal-int +pkg syscall (netbsd-arm), const IPV6_PKTINFO ideal-int +pkg syscall (netbsd-arm), const IPV6_PORTRANGE ideal-int +pkg syscall (netbsd-arm), const IPV6_PORTRANGE_DEFAULT ideal-int +pkg syscall (netbsd-arm), const IPV6_PORTRANGE_HIGH ideal-int +pkg syscall (netbsd-arm), const IPV6_PORTRANGE_LOW ideal-int +pkg syscall (netbsd-arm), const IPV6_RECVDSTOPTS ideal-int +pkg syscall (netbsd-arm), const IPV6_RECVHOPLIMIT ideal-int +pkg syscall (netbsd-arm), const IPV6_RECVHOPOPTS ideal-int +pkg syscall (netbsd-arm), const IPV6_RECVPATHMTU ideal-int +pkg syscall (netbsd-arm), const IPV6_RECVPKTINFO ideal-int +pkg syscall (netbsd-arm), const IPV6_RECVRTHDR ideal-int +pkg syscall (netbsd-arm), const IPV6_RECVTCLASS ideal-int +pkg syscall (netbsd-arm), const IPV6_RTHDR ideal-int +pkg syscall (netbsd-arm), const IPV6_RTHDRDSTOPTS ideal-int +pkg syscall (netbsd-arm), const IPV6_RTHDR_LOOSE ideal-int +pkg syscall (netbsd-arm), const IPV6_RTHDR_STRICT ideal-int +pkg syscall (netbsd-arm), const IPV6_RTHDR_TYPE_0 ideal-int +pkg syscall (netbsd-arm), const IPV6_SOCKOPT_RESERVED1 ideal-int +pkg syscall (netbsd-arm), const IPV6_TCLASS ideal-int +pkg syscall (netbsd-arm), const IPV6_USE_MIN_MTU ideal-int +pkg syscall (netbsd-arm), const IPV6_VERSION ideal-int +pkg syscall (netbsd-arm), const IPV6_VERSION_MASK ideal-int +pkg syscall (netbsd-arm), const IP_DEFAULT_MULTICAST_LOOP ideal-int +pkg syscall (netbsd-arm), const IP_DEFAULT_MULTICAST_TTL ideal-int +pkg syscall (netbsd-arm), const IP_DF ideal-int +pkg syscall (netbsd-arm), const IP_EF ideal-int +pkg syscall (netbsd-arm), const IP_ERRORMTU ideal-int +pkg syscall (netbsd-arm), const IP_HDRINCL ideal-int +pkg syscall (netbsd-arm), const IP_IPSEC_POLICY ideal-int +pkg syscall (netbsd-arm), const IP_MAXPACKET ideal-int +pkg syscall (netbsd-arm), const IP_MAX_MEMBERSHIPS ideal-int +pkg syscall (netbsd-arm), const IP_MF ideal-int +pkg syscall (netbsd-arm), const IP_MINFRAGSIZE ideal-int +pkg syscall (netbsd-arm), const IP_MINTTL ideal-int +pkg syscall (netbsd-arm), const IP_MSS ideal-int +pkg syscall (netbsd-arm), const IP_OFFMASK ideal-int +pkg syscall (netbsd-arm), const IP_OPTIONS ideal-int +pkg syscall (netbsd-arm), const IP_PORTRANGE ideal-int +pkg syscall (netbsd-arm), const IP_PORTRANGE_DEFAULT ideal-int +pkg syscall (netbsd-arm), const IP_PORTRANGE_HIGH ideal-int +pkg syscall (netbsd-arm), const IP_PORTRANGE_LOW ideal-int +pkg syscall (netbsd-arm), const IP_RECVDSTADDR ideal-int +pkg syscall (netbsd-arm), const IP_RECVIF ideal-int +pkg syscall (netbsd-arm), const IP_RECVOPTS ideal-int +pkg syscall (netbsd-arm), const IP_RECVRETOPTS ideal-int +pkg syscall (netbsd-arm), const IP_RECVTTL ideal-int +pkg syscall (netbsd-arm), const IP_RETOPTS ideal-int +pkg syscall (netbsd-arm), const IP_RF ideal-int +pkg syscall (netbsd-arm), const ISIG ideal-int +pkg syscall (netbsd-arm), const ISTRIP ideal-int +pkg syscall (netbsd-arm), const IXANY ideal-int +pkg syscall (netbsd-arm), const IXOFF ideal-int +pkg syscall (netbsd-arm), const IXON ideal-int +pkg syscall (netbsd-arm), const LOCK_EX ideal-int +pkg syscall (netbsd-arm), const LOCK_NB ideal-int +pkg syscall (netbsd-arm), const LOCK_SH ideal-int +pkg syscall (netbsd-arm), const LOCK_UN ideal-int +pkg syscall (netbsd-arm), const MSG_BCAST ideal-int +pkg syscall (netbsd-arm), const MSG_CMSG_CLOEXEC ideal-int +pkg syscall (netbsd-arm), const MSG_CONTROLMBUF ideal-int +pkg syscall (netbsd-arm), const MSG_CTRUNC ideal-int +pkg syscall (netbsd-arm), const MSG_DONTROUTE ideal-int +pkg syscall (netbsd-arm), const MSG_DONTWAIT ideal-int +pkg syscall (netbsd-arm), const MSG_EOR ideal-int +pkg syscall (netbsd-arm), const MSG_IOVUSRSPACE ideal-int +pkg syscall (netbsd-arm), const MSG_LENUSRSPACE ideal-int +pkg syscall (netbsd-arm), const MSG_MCAST ideal-int +pkg syscall (netbsd-arm), const MSG_NAMEMBUF ideal-int +pkg syscall (netbsd-arm), const MSG_NBIO ideal-int +pkg syscall (netbsd-arm), const MSG_NOSIGNAL ideal-int +pkg syscall (netbsd-arm), const MSG_OOB ideal-int +pkg syscall (netbsd-arm), const MSG_PEEK ideal-int +pkg syscall (netbsd-arm), const MSG_TRUNC ideal-int +pkg syscall (netbsd-arm), const MSG_USERFLAGS ideal-int +pkg syscall (netbsd-arm), const MSG_WAITALL ideal-int +pkg syscall (netbsd-arm), const NAME_MAX ideal-int +pkg syscall (netbsd-arm), const NET_RT_DUMP ideal-int +pkg syscall (netbsd-arm), const NET_RT_FLAGS ideal-int +pkg syscall (netbsd-arm), const NET_RT_IFLIST ideal-int +pkg syscall (netbsd-arm), const NET_RT_MAXID ideal-int +pkg syscall (netbsd-arm), const NET_RT_OIFLIST ideal-int +pkg syscall (netbsd-arm), const NET_RT_OOIFLIST ideal-int +pkg syscall (netbsd-arm), const NOFLSH ideal-int +pkg syscall (netbsd-arm), const NOTE_ATTRIB ideal-int +pkg syscall (netbsd-arm), const NOTE_CHILD ideal-int +pkg syscall (netbsd-arm), const NOTE_DELETE ideal-int +pkg syscall (netbsd-arm), const NOTE_EXEC ideal-int +pkg syscall (netbsd-arm), const NOTE_EXIT ideal-int +pkg syscall (netbsd-arm), const NOTE_EXTEND ideal-int +pkg syscall (netbsd-arm), const NOTE_FORK ideal-int +pkg syscall (netbsd-arm), const NOTE_LINK ideal-int +pkg syscall (netbsd-arm), const NOTE_LOWAT ideal-int +pkg syscall (netbsd-arm), const NOTE_PCTRLMASK ideal-int +pkg syscall (netbsd-arm), const NOTE_PDATAMASK ideal-int +pkg syscall (netbsd-arm), const NOTE_RENAME ideal-int +pkg syscall (netbsd-arm), const NOTE_REVOKE ideal-int +pkg syscall (netbsd-arm), const NOTE_TRACK ideal-int +pkg syscall (netbsd-arm), const NOTE_TRACKERR ideal-int +pkg syscall (netbsd-arm), const NOTE_WRITE ideal-int +pkg syscall (netbsd-arm), const OCRNL ideal-int +pkg syscall (netbsd-arm), const OFIOGETBMAP ideal-int +pkg syscall (netbsd-arm), const ONLCR ideal-int +pkg syscall (netbsd-arm), const ONLRET ideal-int +pkg syscall (netbsd-arm), const ONOCR ideal-int +pkg syscall (netbsd-arm), const ONOEOT ideal-int +pkg syscall (netbsd-arm), const OPOST ideal-int +pkg syscall (netbsd-arm), const O_ACCMODE ideal-int +pkg syscall (netbsd-arm), const O_ALT_IO ideal-int +pkg syscall (netbsd-arm), const O_DIRECT ideal-int +pkg syscall (netbsd-arm), const O_DIRECTORY ideal-int +pkg syscall (netbsd-arm), const O_DSYNC ideal-int +pkg syscall (netbsd-arm), const O_EXLOCK ideal-int +pkg syscall (netbsd-arm), const O_FSYNC ideal-int +pkg syscall (netbsd-arm), const O_NDELAY ideal-int +pkg syscall (netbsd-arm), const O_NOFOLLOW ideal-int +pkg syscall (netbsd-arm), const O_NOSIGPIPE ideal-int +pkg syscall (netbsd-arm), const O_RSYNC ideal-int +pkg syscall (netbsd-arm), const O_SHLOCK ideal-int +pkg syscall (netbsd-arm), const PARENB ideal-int +pkg syscall (netbsd-arm), const PARMRK ideal-int +pkg syscall (netbsd-arm), const PARODD ideal-int +pkg syscall (netbsd-arm), const PENDIN ideal-int +pkg syscall (netbsd-arm), const PRIO_PGRP = 1 +pkg syscall (netbsd-arm), const PRIO_PGRP ideal-int +pkg syscall (netbsd-arm), const PRIO_PROCESS = 0 +pkg syscall (netbsd-arm), const PRIO_PROCESS ideal-int +pkg syscall (netbsd-arm), const PRIO_USER = 2 +pkg syscall (netbsd-arm), const PRIO_USER ideal-int +pkg syscall (netbsd-arm), const PRI_IOFLUSH ideal-int +pkg syscall (netbsd-arm), const PTRACE_CONT ideal-int +pkg syscall (netbsd-arm), const PTRACE_KILL ideal-int +pkg syscall (netbsd-arm), const PTRACE_TRACEME ideal-int +pkg syscall (netbsd-arm), const RLIMIT_AS ideal-int +pkg syscall (netbsd-arm), const RLIMIT_CORE ideal-int +pkg syscall (netbsd-arm), const RLIMIT_CPU ideal-int +pkg syscall (netbsd-arm), const RLIMIT_DATA ideal-int +pkg syscall (netbsd-arm), const RLIMIT_FSIZE ideal-int +pkg syscall (netbsd-arm), const RLIMIT_NOFILE ideal-int +pkg syscall (netbsd-arm), const RLIMIT_STACK ideal-int +pkg syscall (netbsd-arm), const RLIM_INFINITY ideal-int +pkg syscall (netbsd-arm), const RTAX_AUTHOR ideal-int +pkg syscall (netbsd-arm), const RTAX_BRD ideal-int +pkg syscall (netbsd-arm), const RTAX_DST ideal-int +pkg syscall (netbsd-arm), const RTAX_GATEWAY ideal-int +pkg syscall (netbsd-arm), const RTAX_GENMASK ideal-int +pkg syscall (netbsd-arm), const RTAX_IFA ideal-int +pkg syscall (netbsd-arm), const RTAX_IFP ideal-int +pkg syscall (netbsd-arm), const RTAX_MAX ideal-int +pkg syscall (netbsd-arm), const RTAX_NETMASK ideal-int +pkg syscall (netbsd-arm), const RTAX_TAG ideal-int +pkg syscall (netbsd-arm), const RTA_AUTHOR ideal-int +pkg syscall (netbsd-arm), const RTA_BRD ideal-int +pkg syscall (netbsd-arm), const RTA_DST ideal-int +pkg syscall (netbsd-arm), const RTA_GATEWAY ideal-int +pkg syscall (netbsd-arm), const RTA_GENMASK ideal-int +pkg syscall (netbsd-arm), const RTA_IFA ideal-int +pkg syscall (netbsd-arm), const RTA_IFP ideal-int +pkg syscall (netbsd-arm), const RTA_NETMASK ideal-int +pkg syscall (netbsd-arm), const RTA_TAG ideal-int +pkg syscall (netbsd-arm), const RTF_ANNOUNCE ideal-int +pkg syscall (netbsd-arm), const RTF_BLACKHOLE ideal-int +pkg syscall (netbsd-arm), const RTF_CLONED ideal-int +pkg syscall (netbsd-arm), const RTF_CLONING ideal-int +pkg syscall (netbsd-arm), const RTF_DONE ideal-int +pkg syscall (netbsd-arm), const RTF_DYNAMIC ideal-int +pkg syscall (netbsd-arm), const RTF_GATEWAY ideal-int +pkg syscall (netbsd-arm), const RTF_HOST ideal-int +pkg syscall (netbsd-arm), const RTF_LLINFO ideal-int +pkg syscall (netbsd-arm), const RTF_MASK ideal-int +pkg syscall (netbsd-arm), const RTF_MODIFIED ideal-int +pkg syscall (netbsd-arm), const RTF_PROTO1 ideal-int +pkg syscall (netbsd-arm), const RTF_PROTO2 ideal-int +pkg syscall (netbsd-arm), const RTF_REJECT ideal-int +pkg syscall (netbsd-arm), const RTF_SRC ideal-int +pkg syscall (netbsd-arm), const RTF_STATIC ideal-int +pkg syscall (netbsd-arm), const RTF_UP ideal-int +pkg syscall (netbsd-arm), const RTF_XRESOLVE ideal-int +pkg syscall (netbsd-arm), const RTM_ADD ideal-int +pkg syscall (netbsd-arm), const RTM_CHANGE ideal-int +pkg syscall (netbsd-arm), const RTM_CHGADDR ideal-int +pkg syscall (netbsd-arm), const RTM_DELADDR ideal-int +pkg syscall (netbsd-arm), const RTM_DELETE ideal-int +pkg syscall (netbsd-arm), const RTM_GET ideal-int +pkg syscall (netbsd-arm), const RTM_IEEE80211 ideal-int +pkg syscall (netbsd-arm), const RTM_IFANNOUNCE ideal-int +pkg syscall (netbsd-arm), const RTM_IFINFO ideal-int +pkg syscall (netbsd-arm), const RTM_LLINFO_UPD ideal-int +pkg syscall (netbsd-arm), const RTM_LOCK ideal-int +pkg syscall (netbsd-arm), const RTM_LOSING ideal-int +pkg syscall (netbsd-arm), const RTM_MISS ideal-int +pkg syscall (netbsd-arm), const RTM_NEWADDR ideal-int +pkg syscall (netbsd-arm), const RTM_OIFINFO ideal-int +pkg syscall (netbsd-arm), const RTM_OLDADD ideal-int +pkg syscall (netbsd-arm), const RTM_OLDDEL ideal-int +pkg syscall (netbsd-arm), const RTM_OOIFINFO ideal-int +pkg syscall (netbsd-arm), const RTM_REDIRECT ideal-int +pkg syscall (netbsd-arm), const RTM_RESOLVE ideal-int +pkg syscall (netbsd-arm), const RTM_RTTUNIT ideal-int +pkg syscall (netbsd-arm), const RTM_SETGATE ideal-int +pkg syscall (netbsd-arm), const RTM_VERSION ideal-int +pkg syscall (netbsd-arm), const RTV_EXPIRE ideal-int +pkg syscall (netbsd-arm), const RTV_HOPCOUNT ideal-int +pkg syscall (netbsd-arm), const RTV_MTU ideal-int +pkg syscall (netbsd-arm), const RTV_RPIPE ideal-int +pkg syscall (netbsd-arm), const RTV_RTT ideal-int +pkg syscall (netbsd-arm), const RTV_RTTVAR ideal-int +pkg syscall (netbsd-arm), const RTV_SPIPE ideal-int +pkg syscall (netbsd-arm), const RTV_SSTHRESH ideal-int +pkg syscall (netbsd-arm), const RUSAGE_CHILDREN ideal-int +pkg syscall (netbsd-arm), const RUSAGE_SELF ideal-int +pkg syscall (netbsd-arm), const SCM_CREDS ideal-int +pkg syscall (netbsd-arm), const SCM_RIGHTS ideal-int +pkg syscall (netbsd-arm), const SCM_TIMESTAMP ideal-int +pkg syscall (netbsd-arm), const SIGCHLD Signal +pkg syscall (netbsd-arm), const SIGCONT Signal +pkg syscall (netbsd-arm), const SIGEMT Signal +pkg syscall (netbsd-arm), const SIGINFO Signal +pkg syscall (netbsd-arm), const SIGIO Signal +pkg syscall (netbsd-arm), const SIGIOT Signal +pkg syscall (netbsd-arm), const SIGPROF Signal +pkg syscall (netbsd-arm), const SIGPWR Signal +pkg syscall (netbsd-arm), const SIGSTOP Signal +pkg syscall (netbsd-arm), const SIGSYS Signal +pkg syscall (netbsd-arm), const SIGTSTP Signal +pkg syscall (netbsd-arm), const SIGTTIN Signal +pkg syscall (netbsd-arm), const SIGTTOU Signal +pkg syscall (netbsd-arm), const SIGURG Signal +pkg syscall (netbsd-arm), const SIGUSR1 Signal +pkg syscall (netbsd-arm), const SIGUSR2 Signal +pkg syscall (netbsd-arm), const SIGVTALRM Signal +pkg syscall (netbsd-arm), const SIGWINCH Signal +pkg syscall (netbsd-arm), const SIGXCPU Signal +pkg syscall (netbsd-arm), const SIGXFSZ Signal +pkg syscall (netbsd-arm), const SIOCADDMULTI ideal-int +pkg syscall (netbsd-arm), const SIOCADDRT ideal-int +pkg syscall (netbsd-arm), const SIOCAIFADDR ideal-int +pkg syscall (netbsd-arm), const SIOCALIFADDR ideal-int +pkg syscall (netbsd-arm), const SIOCATMARK ideal-int +pkg syscall (netbsd-arm), const SIOCDELMULTI ideal-int +pkg syscall (netbsd-arm), const SIOCDELRT ideal-int +pkg syscall (netbsd-arm), const SIOCDIFADDR ideal-int +pkg syscall (netbsd-arm), const SIOCDIFPHYADDR ideal-int +pkg syscall (netbsd-arm), const SIOCDLIFADDR ideal-int +pkg syscall (netbsd-arm), const SIOCGDRVSPEC ideal-int +pkg syscall (netbsd-arm), const SIOCGETPFSYNC ideal-int +pkg syscall (netbsd-arm), const SIOCGETSGCNT ideal-int +pkg syscall (netbsd-arm), const SIOCGETVIFCNT ideal-int +pkg syscall (netbsd-arm), const SIOCGHIWAT ideal-int +pkg syscall (netbsd-arm), const SIOCGIFADDR ideal-int +pkg syscall (netbsd-arm), const SIOCGIFADDRPREF ideal-int +pkg syscall (netbsd-arm), const SIOCGIFALIAS ideal-int +pkg syscall (netbsd-arm), const SIOCGIFBRDADDR ideal-int +pkg syscall (netbsd-arm), const SIOCGIFCAP ideal-int +pkg syscall (netbsd-arm), const SIOCGIFCONF ideal-int +pkg syscall (netbsd-arm), const SIOCGIFDATA ideal-int +pkg syscall (netbsd-arm), const SIOCGIFDLT ideal-int +pkg syscall (netbsd-arm), const SIOCGIFDSTADDR ideal-int +pkg syscall (netbsd-arm), const SIOCGIFFLAGS ideal-int +pkg syscall (netbsd-arm), const SIOCGIFGENERIC ideal-int +pkg syscall (netbsd-arm), const SIOCGIFMEDIA ideal-int +pkg syscall (netbsd-arm), const SIOCGIFMETRIC ideal-int +pkg syscall (netbsd-arm), const SIOCGIFMTU ideal-int +pkg syscall (netbsd-arm), const SIOCGIFNETMASK ideal-int +pkg syscall (netbsd-arm), const SIOCGIFPDSTADDR ideal-int +pkg syscall (netbsd-arm), const SIOCGIFPSRCADDR ideal-int +pkg syscall (netbsd-arm), const SIOCGLIFADDR ideal-int +pkg syscall (netbsd-arm), const SIOCGLIFPHYADDR ideal-int +pkg syscall (netbsd-arm), const SIOCGLINKSTR ideal-int +pkg syscall (netbsd-arm), const SIOCGLOWAT ideal-int +pkg syscall (netbsd-arm), const SIOCGPGRP ideal-int +pkg syscall (netbsd-arm), const SIOCGVH ideal-int +pkg syscall (netbsd-arm), const SIOCIFCREATE ideal-int +pkg syscall (netbsd-arm), const SIOCIFDESTROY ideal-int +pkg syscall (netbsd-arm), const SIOCIFGCLONERS ideal-int +pkg syscall (netbsd-arm), const SIOCINITIFADDR ideal-int +pkg syscall (netbsd-arm), const SIOCSDRVSPEC ideal-int +pkg syscall (netbsd-arm), const SIOCSETPFSYNC ideal-int +pkg syscall (netbsd-arm), const SIOCSHIWAT ideal-int +pkg syscall (netbsd-arm), const SIOCSIFADDR ideal-int +pkg syscall (netbsd-arm), const SIOCSIFADDRPREF ideal-int +pkg syscall (netbsd-arm), const SIOCSIFBRDADDR ideal-int +pkg syscall (netbsd-arm), const SIOCSIFCAP ideal-int +pkg syscall (netbsd-arm), const SIOCSIFDSTADDR ideal-int +pkg syscall (netbsd-arm), const SIOCSIFFLAGS ideal-int +pkg syscall (netbsd-arm), const SIOCSIFGENERIC ideal-int +pkg syscall (netbsd-arm), const SIOCSIFMEDIA ideal-int +pkg syscall (netbsd-arm), const SIOCSIFMETRIC ideal-int +pkg syscall (netbsd-arm), const SIOCSIFMTU ideal-int +pkg syscall (netbsd-arm), const SIOCSIFNETMASK ideal-int +pkg syscall (netbsd-arm), const SIOCSIFPHYADDR ideal-int +pkg syscall (netbsd-arm), const SIOCSLIFPHYADDR ideal-int +pkg syscall (netbsd-arm), const SIOCSLINKSTR ideal-int +pkg syscall (netbsd-arm), const SIOCSLOWAT ideal-int +pkg syscall (netbsd-arm), const SIOCSPGRP ideal-int +pkg syscall (netbsd-arm), const SIOCSVH ideal-int +pkg syscall (netbsd-arm), const SIOCZIFDATA ideal-int +pkg syscall (netbsd-arm), const SOCK_CLOEXEC ideal-int +pkg syscall (netbsd-arm), const SOCK_FLAGS_MASK ideal-int +pkg syscall (netbsd-arm), const SOCK_NONBLOCK ideal-int +pkg syscall (netbsd-arm), const SOCK_NOSIGPIPE ideal-int +pkg syscall (netbsd-arm), const SOCK_RDM ideal-int +pkg syscall (netbsd-arm), const SO_ACCEPTCONN ideal-int +pkg syscall (netbsd-arm), const SO_ACCEPTFILTER ideal-int +pkg syscall (netbsd-arm), const SO_DEBUG ideal-int +pkg syscall (netbsd-arm), const SO_ERROR ideal-int +pkg syscall (netbsd-arm), const SO_NOHEADER ideal-int +pkg syscall (netbsd-arm), const SO_NOSIGPIPE ideal-int +pkg syscall (netbsd-arm), const SO_OOBINLINE ideal-int +pkg syscall (netbsd-arm), const SO_OVERFLOWED ideal-int +pkg syscall (netbsd-arm), const SO_RCVLOWAT ideal-int +pkg syscall (netbsd-arm), const SO_RCVTIMEO ideal-int +pkg syscall (netbsd-arm), const SO_REUSEPORT ideal-int +pkg syscall (netbsd-arm), const SO_SNDLOWAT ideal-int +pkg syscall (netbsd-arm), const SO_SNDTIMEO ideal-int +pkg syscall (netbsd-arm), const SO_TIMESTAMP ideal-int +pkg syscall (netbsd-arm), const SO_TYPE ideal-int +pkg syscall (netbsd-arm), const SO_USELOOPBACK ideal-int +pkg syscall (netbsd-arm), const SYSCTL_VERSION ideal-int +pkg syscall (netbsd-arm), const SYSCTL_VERS_0 ideal-int +pkg syscall (netbsd-arm), const SYSCTL_VERS_1 ideal-int +pkg syscall (netbsd-arm), const SYSCTL_VERS_MASK ideal-int +pkg syscall (netbsd-arm), const SYS_ACCEPT ideal-int +pkg syscall (netbsd-arm), const SYS_ACCESS ideal-int +pkg syscall (netbsd-arm), const SYS_ACCT ideal-int +pkg syscall (netbsd-arm), const SYS_ADJTIME ideal-int +pkg syscall (netbsd-arm), const SYS_BIND ideal-int +pkg syscall (netbsd-arm), const SYS_BREAK ideal-int +pkg syscall (netbsd-arm), const SYS_CHDIR ideal-int +pkg syscall (netbsd-arm), const SYS_CHFLAGS ideal-int +pkg syscall (netbsd-arm), const SYS_CHMOD ideal-int +pkg syscall (netbsd-arm), const SYS_CHOWN ideal-int +pkg syscall (netbsd-arm), const SYS_CHROOT ideal-int +pkg syscall (netbsd-arm), const SYS_CLOCK_GETRES ideal-int +pkg syscall (netbsd-arm), const SYS_CLOCK_GETTIME ideal-int +pkg syscall (netbsd-arm), const SYS_CLOCK_SETTIME ideal-int +pkg syscall (netbsd-arm), const SYS_CLOSE ideal-int +pkg syscall (netbsd-arm), const SYS_CONNECT ideal-int +pkg syscall (netbsd-arm), const SYS_DUP ideal-int +pkg syscall (netbsd-arm), const SYS_DUP2 ideal-int +pkg syscall (netbsd-arm), const SYS_DUP3 ideal-int +pkg syscall (netbsd-arm), const SYS_EXECVE ideal-int +pkg syscall (netbsd-arm), const SYS_EXIT ideal-int +pkg syscall (netbsd-arm), const SYS_EXTATTRCTL ideal-int +pkg syscall (netbsd-arm), const SYS_EXTATTR_DELETE_FD ideal-int +pkg syscall (netbsd-arm), const SYS_EXTATTR_DELETE_FILE ideal-int +pkg syscall (netbsd-arm), const SYS_EXTATTR_DELETE_LINK ideal-int +pkg syscall (netbsd-arm), const SYS_EXTATTR_GET_FD ideal-int +pkg syscall (netbsd-arm), const SYS_EXTATTR_GET_FILE ideal-int +pkg syscall (netbsd-arm), const SYS_EXTATTR_GET_LINK ideal-int +pkg syscall (netbsd-arm), const SYS_EXTATTR_LIST_FD ideal-int +pkg syscall (netbsd-arm), const SYS_EXTATTR_LIST_FILE ideal-int +pkg syscall (netbsd-arm), const SYS_EXTATTR_LIST_LINK ideal-int +pkg syscall (netbsd-arm), const SYS_EXTATTR_SET_FD ideal-int +pkg syscall (netbsd-arm), const SYS_EXTATTR_SET_FILE ideal-int +pkg syscall (netbsd-arm), const SYS_EXTATTR_SET_LINK ideal-int +pkg syscall (netbsd-arm), const SYS_FACCESSAT ideal-int +pkg syscall (netbsd-arm), const SYS_FCHDIR ideal-int +pkg syscall (netbsd-arm), const SYS_FCHFLAGS ideal-int +pkg syscall (netbsd-arm), const SYS_FCHMOD ideal-int +pkg syscall (netbsd-arm), const SYS_FCHMODAT ideal-int +pkg syscall (netbsd-arm), const SYS_FCHOWN ideal-int +pkg syscall (netbsd-arm), const SYS_FCHOWNAT ideal-int +pkg syscall (netbsd-arm), const SYS_FCHROOT ideal-int +pkg syscall (netbsd-arm), const SYS_FCNTL ideal-int +pkg syscall (netbsd-arm), const SYS_FDATASYNC ideal-int +pkg syscall (netbsd-arm), const SYS_FEXECVE ideal-int +pkg syscall (netbsd-arm), const SYS_FGETXATTR ideal-int +pkg syscall (netbsd-arm), const SYS_FHSTAT ideal-int +pkg syscall (netbsd-arm), const SYS_FKTRACE ideal-int +pkg syscall (netbsd-arm), const SYS_FLISTXATTR ideal-int +pkg syscall (netbsd-arm), const SYS_FLOCK ideal-int +pkg syscall (netbsd-arm), const SYS_FORK ideal-int +pkg syscall (netbsd-arm), const SYS_FPATHCONF ideal-int +pkg syscall (netbsd-arm), const SYS_FREMOVEXATTR ideal-int +pkg syscall (netbsd-arm), const SYS_FSETXATTR ideal-int +pkg syscall (netbsd-arm), const SYS_FSTAT ideal-int +pkg syscall (netbsd-arm), const SYS_FSTATAT ideal-int +pkg syscall (netbsd-arm), const SYS_FSTATVFS1 ideal-int +pkg syscall (netbsd-arm), const SYS_FSYNC ideal-int +pkg syscall (netbsd-arm), const SYS_FSYNC_RANGE ideal-int +pkg syscall (netbsd-arm), const SYS_FTRUNCATE ideal-int +pkg syscall (netbsd-arm), const SYS_FUTIMENS ideal-int +pkg syscall (netbsd-arm), const SYS_FUTIMES ideal-int +pkg syscall (netbsd-arm), const SYS_GETCONTEXT ideal-int +pkg syscall (netbsd-arm), const SYS_GETDENTS ideal-int +pkg syscall (netbsd-arm), const SYS_GETEGID ideal-int +pkg syscall (netbsd-arm), const SYS_GETEUID ideal-int +pkg syscall (netbsd-arm), const SYS_GETFH ideal-int +pkg syscall (netbsd-arm), const SYS_GETGID ideal-int +pkg syscall (netbsd-arm), const SYS_GETGROUPS ideal-int +pkg syscall (netbsd-arm), const SYS_GETITIMER ideal-int +pkg syscall (netbsd-arm), const SYS_GETPEERNAME ideal-int +pkg syscall (netbsd-arm), const SYS_GETPGID ideal-int +pkg syscall (netbsd-arm), const SYS_GETPGRP ideal-int +pkg syscall (netbsd-arm), const SYS_GETPID ideal-int +pkg syscall (netbsd-arm), const SYS_GETPPID ideal-int +pkg syscall (netbsd-arm), const SYS_GETPRIORITY ideal-int +pkg syscall (netbsd-arm), const SYS_GETRLIMIT ideal-int +pkg syscall (netbsd-arm), const SYS_GETRUSAGE ideal-int +pkg syscall (netbsd-arm), const SYS_GETSID ideal-int +pkg syscall (netbsd-arm), const SYS_GETSOCKNAME ideal-int +pkg syscall (netbsd-arm), const SYS_GETSOCKOPT ideal-int +pkg syscall (netbsd-arm), const SYS_GETTIMEOFDAY ideal-int +pkg syscall (netbsd-arm), const SYS_GETUID ideal-int +pkg syscall (netbsd-arm), const SYS_GETVFSSTAT ideal-int +pkg syscall (netbsd-arm), const SYS_GETXATTR ideal-int +pkg syscall (netbsd-arm), const SYS_IOCTL ideal-int +pkg syscall (netbsd-arm), const SYS_ISSETUGID ideal-int +pkg syscall (netbsd-arm), const SYS_KEVENT ideal-int +pkg syscall (netbsd-arm), const SYS_KILL ideal-int +pkg syscall (netbsd-arm), const SYS_KQUEUE ideal-int +pkg syscall (netbsd-arm), const SYS_KQUEUE1 ideal-int +pkg syscall (netbsd-arm), const SYS_KTRACE ideal-int +pkg syscall (netbsd-arm), const SYS_LCHFLAGS ideal-int +pkg syscall (netbsd-arm), const SYS_LCHMOD ideal-int +pkg syscall (netbsd-arm), const SYS_LCHOWN ideal-int +pkg syscall (netbsd-arm), const SYS_LGETXATTR ideal-int +pkg syscall (netbsd-arm), const SYS_LINK ideal-int +pkg syscall (netbsd-arm), const SYS_LINKAT ideal-int +pkg syscall (netbsd-arm), const SYS_LISTEN ideal-int +pkg syscall (netbsd-arm), const SYS_LISTXATTR ideal-int +pkg syscall (netbsd-arm), const SYS_LLISTXATTR ideal-int +pkg syscall (netbsd-arm), const SYS_LREMOVEXATTR ideal-int +pkg syscall (netbsd-arm), const SYS_LSEEK ideal-int +pkg syscall (netbsd-arm), const SYS_LSETXATTR ideal-int +pkg syscall (netbsd-arm), const SYS_LSTAT ideal-int +pkg syscall (netbsd-arm), const SYS_LUTIMES ideal-int +pkg syscall (netbsd-arm), const SYS_MADVISE ideal-int +pkg syscall (netbsd-arm), const SYS_MINCORE ideal-int +pkg syscall (netbsd-arm), const SYS_MINHERIT ideal-int +pkg syscall (netbsd-arm), const SYS_MKDIR ideal-int +pkg syscall (netbsd-arm), const SYS_MKDIRAT ideal-int +pkg syscall (netbsd-arm), const SYS_MKFIFO ideal-int +pkg syscall (netbsd-arm), const SYS_MKFIFOAT ideal-int +pkg syscall (netbsd-arm), const SYS_MKNOD ideal-int +pkg syscall (netbsd-arm), const SYS_MKNODAT ideal-int +pkg syscall (netbsd-arm), const SYS_MLOCK ideal-int +pkg syscall (netbsd-arm), const SYS_MLOCKALL ideal-int +pkg syscall (netbsd-arm), const SYS_MMAP ideal-int +pkg syscall (netbsd-arm), const SYS_MODCTL ideal-int +pkg syscall (netbsd-arm), const SYS_MOUNT ideal-int +pkg syscall (netbsd-arm), const SYS_MPROTECT ideal-int +pkg syscall (netbsd-arm), const SYS_MREMAP ideal-int +pkg syscall (netbsd-arm), const SYS_MSGCTL ideal-int +pkg syscall (netbsd-arm), const SYS_MSGGET ideal-int +pkg syscall (netbsd-arm), const SYS_MSGRCV ideal-int +pkg syscall (netbsd-arm), const SYS_MSGSND ideal-int +pkg syscall (netbsd-arm), const SYS_MUNLOCK ideal-int +pkg syscall (netbsd-arm), const SYS_MUNLOCKALL ideal-int +pkg syscall (netbsd-arm), const SYS_MUNMAP ideal-int +pkg syscall (netbsd-arm), const SYS_NANOSLEEP ideal-int +pkg syscall (netbsd-arm), const SYS_NTP_ADJTIME ideal-int +pkg syscall (netbsd-arm), const SYS_NTP_GETTIME ideal-int +pkg syscall (netbsd-arm), const SYS_OPEN ideal-int +pkg syscall (netbsd-arm), const SYS_OPENAT ideal-int +pkg syscall (netbsd-arm), const SYS_PACCEPT ideal-int +pkg syscall (netbsd-arm), const SYS_PATHCONF ideal-int +pkg syscall (netbsd-arm), const SYS_PIPE ideal-int +pkg syscall (netbsd-arm), const SYS_PIPE2 ideal-int +pkg syscall (netbsd-arm), const SYS_PMC_CONTROL ideal-int +pkg syscall (netbsd-arm), const SYS_PMC_GET_INFO ideal-int +pkg syscall (netbsd-arm), const SYS_POLL ideal-int +pkg syscall (netbsd-arm), const SYS_POLLTS ideal-int +pkg syscall (netbsd-arm), const SYS_POSIX_FADVISE ideal-int +pkg syscall (netbsd-arm), const SYS_POSIX_SPAWN ideal-int +pkg syscall (netbsd-arm), const SYS_PREAD ideal-int +pkg syscall (netbsd-arm), const SYS_PREADV ideal-int +pkg syscall (netbsd-arm), const SYS_PROFIL ideal-int +pkg syscall (netbsd-arm), const SYS_PSELECT ideal-int +pkg syscall (netbsd-arm), const SYS_PSET_ASSIGN ideal-int +pkg syscall (netbsd-arm), const SYS_PSET_CREATE ideal-int +pkg syscall (netbsd-arm), const SYS_PSET_DESTROY ideal-int +pkg syscall (netbsd-arm), const SYS_PTRACE ideal-int +pkg syscall (netbsd-arm), const SYS_PWRITE ideal-int +pkg syscall (netbsd-arm), const SYS_PWRITEV ideal-int +pkg syscall (netbsd-arm), const SYS_RASCTL ideal-int +pkg syscall (netbsd-arm), const SYS_READ ideal-int +pkg syscall (netbsd-arm), const SYS_READLINK ideal-int +pkg syscall (netbsd-arm), const SYS_READLINKAT ideal-int +pkg syscall (netbsd-arm), const SYS_READV ideal-int +pkg syscall (netbsd-arm), const SYS_REBOOT ideal-int +pkg syscall (netbsd-arm), const SYS_RECVFROM ideal-int +pkg syscall (netbsd-arm), const SYS_RECVMMSG ideal-int +pkg syscall (netbsd-arm), const SYS_RECVMSG ideal-int +pkg syscall (netbsd-arm), const SYS_REMOVEXATTR ideal-int +pkg syscall (netbsd-arm), const SYS_RENAME ideal-int +pkg syscall (netbsd-arm), const SYS_RENAMEAT ideal-int +pkg syscall (netbsd-arm), const SYS_REVOKE ideal-int +pkg syscall (netbsd-arm), const SYS_RMDIR ideal-int +pkg syscall (netbsd-arm), const SYS_SBRK ideal-int +pkg syscall (netbsd-arm), const SYS_SCHED_YIELD ideal-int +pkg syscall (netbsd-arm), const SYS_SELECT ideal-int +pkg syscall (netbsd-arm), const SYS_SEMCONFIG ideal-int +pkg syscall (netbsd-arm), const SYS_SEMGET ideal-int +pkg syscall (netbsd-arm), const SYS_SEMOP ideal-int +pkg syscall (netbsd-arm), const SYS_SENDMMSG ideal-int +pkg syscall (netbsd-arm), const SYS_SENDMSG ideal-int +pkg syscall (netbsd-arm), const SYS_SENDTO ideal-int +pkg syscall (netbsd-arm), const SYS_SETCONTEXT ideal-int +pkg syscall (netbsd-arm), const SYS_SETEGID ideal-int +pkg syscall (netbsd-arm), const SYS_SETEUID ideal-int +pkg syscall (netbsd-arm), const SYS_SETGID ideal-int +pkg syscall (netbsd-arm), const SYS_SETGROUPS ideal-int +pkg syscall (netbsd-arm), const SYS_SETITIMER ideal-int +pkg syscall (netbsd-arm), const SYS_SETPGID ideal-int +pkg syscall (netbsd-arm), const SYS_SETPRIORITY ideal-int +pkg syscall (netbsd-arm), const SYS_SETREGID ideal-int +pkg syscall (netbsd-arm), const SYS_SETREUID ideal-int +pkg syscall (netbsd-arm), const SYS_SETRLIMIT ideal-int +pkg syscall (netbsd-arm), const SYS_SETSID ideal-int +pkg syscall (netbsd-arm), const SYS_SETSOCKOPT ideal-int +pkg syscall (netbsd-arm), const SYS_SETTIMEOFDAY ideal-int +pkg syscall (netbsd-arm), const SYS_SETUID ideal-int +pkg syscall (netbsd-arm), const SYS_SETXATTR ideal-int +pkg syscall (netbsd-arm), const SYS_SHMAT ideal-int +pkg syscall (netbsd-arm), const SYS_SHMCTL ideal-int +pkg syscall (netbsd-arm), const SYS_SHMDT ideal-int +pkg syscall (netbsd-arm), const SYS_SHMGET ideal-int +pkg syscall (netbsd-arm), const SYS_SHUTDOWN ideal-int +pkg syscall (netbsd-arm), const SYS_SIGQUEUEINFO ideal-int +pkg syscall (netbsd-arm), const SYS_SOCKET ideal-int +pkg syscall (netbsd-arm), const SYS_SOCKETPAIR ideal-int +pkg syscall (netbsd-arm), const SYS_SSTK ideal-int +pkg syscall (netbsd-arm), const SYS_STAT ideal-int +pkg syscall (netbsd-arm), const SYS_STATVFS1 ideal-int +pkg syscall (netbsd-arm), const SYS_SWAPCTL ideal-int +pkg syscall (netbsd-arm), const SYS_SYMLINK ideal-int +pkg syscall (netbsd-arm), const SYS_SYMLINKAT ideal-int +pkg syscall (netbsd-arm), const SYS_SYNC ideal-int +pkg syscall (netbsd-arm), const SYS_SYSARCH ideal-int +pkg syscall (netbsd-arm), const SYS_TIMER_CREATE ideal-int +pkg syscall (netbsd-arm), const SYS_TIMER_DELETE ideal-int +pkg syscall (netbsd-arm), const SYS_TIMER_GETOVERRUN ideal-int +pkg syscall (netbsd-arm), const SYS_TIMER_GETTIME ideal-int +pkg syscall (netbsd-arm), const SYS_TIMER_SETTIME ideal-int +pkg syscall (netbsd-arm), const SYS_TRUNCATE ideal-int +pkg syscall (netbsd-arm), const SYS_UMASK ideal-int +pkg syscall (netbsd-arm), const SYS_UNDELETE ideal-int +pkg syscall (netbsd-arm), const SYS_UNLINK ideal-int +pkg syscall (netbsd-arm), const SYS_UNLINKAT ideal-int +pkg syscall (netbsd-arm), const SYS_UNMOUNT ideal-int +pkg syscall (netbsd-arm), const SYS_UTIMENSAT ideal-int +pkg syscall (netbsd-arm), const SYS_UTIMES ideal-int +pkg syscall (netbsd-arm), const SYS_UTRACE ideal-int +pkg syscall (netbsd-arm), const SYS_UUIDGEN ideal-int +pkg syscall (netbsd-arm), const SYS_VADVISE ideal-int +pkg syscall (netbsd-arm), const SYS_VFORK ideal-int +pkg syscall (netbsd-arm), const SYS_WAIT4 ideal-int +pkg syscall (netbsd-arm), const SYS_WRITE ideal-int +pkg syscall (netbsd-arm), const SYS_WRITEV ideal-int +pkg syscall (netbsd-arm), const SYS__LWP_CONTINUE ideal-int +pkg syscall (netbsd-arm), const SYS__LWP_CREATE ideal-int +pkg syscall (netbsd-arm), const SYS__LWP_CTL ideal-int +pkg syscall (netbsd-arm), const SYS__LWP_DETACH ideal-int +pkg syscall (netbsd-arm), const SYS__LWP_EXIT ideal-int +pkg syscall (netbsd-arm), const SYS__LWP_GETNAME ideal-int +pkg syscall (netbsd-arm), const SYS__LWP_GETPRIVATE ideal-int +pkg syscall (netbsd-arm), const SYS__LWP_KILL ideal-int +pkg syscall (netbsd-arm), const SYS__LWP_PARK ideal-int +pkg syscall (netbsd-arm), const SYS__LWP_SELF ideal-int +pkg syscall (netbsd-arm), const SYS__LWP_SETNAME ideal-int +pkg syscall (netbsd-arm), const SYS__LWP_SETPRIVATE ideal-int +pkg syscall (netbsd-arm), const SYS__LWP_SUSPEND ideal-int +pkg syscall (netbsd-arm), const SYS__LWP_UNPARK ideal-int +pkg syscall (netbsd-arm), const SYS__LWP_UNPARK_ALL ideal-int +pkg syscall (netbsd-arm), const SYS__LWP_WAIT ideal-int +pkg syscall (netbsd-arm), const SYS__LWP_WAKEUP ideal-int +pkg syscall (netbsd-arm), const SYS__PSET_BIND ideal-int +pkg syscall (netbsd-arm), const SYS__SCHED_GETAFFINITY ideal-int +pkg syscall (netbsd-arm), const SYS__SCHED_GETPARAM ideal-int +pkg syscall (netbsd-arm), const SYS__SCHED_SETAFFINITY ideal-int +pkg syscall (netbsd-arm), const SYS__SCHED_SETPARAM ideal-int +pkg syscall (netbsd-arm), const SYS___CLONE ideal-int +pkg syscall (netbsd-arm), const SYS___GETCWD ideal-int +pkg syscall (netbsd-arm), const SYS___GETLOGIN ideal-int +pkg syscall (netbsd-arm), const SYS___POSIX_CHOWN ideal-int +pkg syscall (netbsd-arm), const SYS___POSIX_FCHOWN ideal-int +pkg syscall (netbsd-arm), const SYS___POSIX_LCHOWN ideal-int +pkg syscall (netbsd-arm), const SYS___POSIX_RENAME ideal-int +pkg syscall (netbsd-arm), const SYS___QUOTACTL ideal-int +pkg syscall (netbsd-arm), const SYS___SEMCTL ideal-int +pkg syscall (netbsd-arm), const SYS___SETLOGIN ideal-int +pkg syscall (netbsd-arm), const SYS___SIGACTION_SIGTRAMP ideal-int +pkg syscall (netbsd-arm), const SYS___SIGTIMEDWAIT ideal-int +pkg syscall (netbsd-arm), const SYS___SYSCTL ideal-int +pkg syscall (netbsd-arm), const S_ARCH1 ideal-int +pkg syscall (netbsd-arm), const S_ARCH2 ideal-int +pkg syscall (netbsd-arm), const S_BLKSIZE ideal-int +pkg syscall (netbsd-arm), const S_IEXEC ideal-int +pkg syscall (netbsd-arm), const S_IFWHT ideal-int +pkg syscall (netbsd-arm), const S_IREAD ideal-int +pkg syscall (netbsd-arm), const S_IRGRP ideal-int +pkg syscall (netbsd-arm), const S_IROTH ideal-int +pkg syscall (netbsd-arm), const S_IRWXG ideal-int +pkg syscall (netbsd-arm), const S_IRWXO ideal-int +pkg syscall (netbsd-arm), const S_IRWXU ideal-int +pkg syscall (netbsd-arm), const S_ISTXT ideal-int +pkg syscall (netbsd-arm), const S_IWGRP ideal-int +pkg syscall (netbsd-arm), const S_IWOTH ideal-int +pkg syscall (netbsd-arm), const S_IWRITE ideal-int +pkg syscall (netbsd-arm), const S_IXGRP ideal-int +pkg syscall (netbsd-arm), const S_IXOTH ideal-int +pkg syscall (netbsd-arm), const SizeofBpfHdr ideal-int +pkg syscall (netbsd-arm), const SizeofBpfInsn ideal-int +pkg syscall (netbsd-arm), const SizeofBpfProgram ideal-int +pkg syscall (netbsd-arm), const SizeofBpfStat ideal-int +pkg syscall (netbsd-arm), const SizeofBpfVersion ideal-int +pkg syscall (netbsd-arm), const SizeofCmsghdr ideal-int +pkg syscall (netbsd-arm), const SizeofICMPv6Filter = 32 +pkg syscall (netbsd-arm), const SizeofICMPv6Filter ideal-int +pkg syscall (netbsd-arm), const SizeofIPMreq ideal-int +pkg syscall (netbsd-arm), const SizeofIPv6MTUInfo = 32 +pkg syscall (netbsd-arm), const SizeofIPv6MTUInfo ideal-int +pkg syscall (netbsd-arm), const SizeofIPv6Mreq ideal-int +pkg syscall (netbsd-arm), const SizeofIfAnnounceMsghdr ideal-int +pkg syscall (netbsd-arm), const SizeofIfData ideal-int +pkg syscall (netbsd-arm), const SizeofIfMsghdr ideal-int +pkg syscall (netbsd-arm), const SizeofIfaMsghdr ideal-int +pkg syscall (netbsd-arm), const SizeofInet6Pktinfo ideal-int +pkg syscall (netbsd-arm), const SizeofLinger ideal-int +pkg syscall (netbsd-arm), const SizeofMsghdr ideal-int +pkg syscall (netbsd-arm), const SizeofRtMetrics ideal-int +pkg syscall (netbsd-arm), const SizeofRtMsghdr ideal-int +pkg syscall (netbsd-arm), const SizeofSockaddrAny ideal-int +pkg syscall (netbsd-arm), const SizeofSockaddrDatalink ideal-int +pkg syscall (netbsd-arm), const SizeofSockaddrInet4 ideal-int +pkg syscall (netbsd-arm), const SizeofSockaddrInet6 ideal-int +pkg syscall (netbsd-arm), const SizeofSockaddrUnix ideal-int +pkg syscall (netbsd-arm), const TCIFLUSH ideal-int +pkg syscall (netbsd-arm), const TCIOFLUSH ideal-int +pkg syscall (netbsd-arm), const TCOFLUSH ideal-int +pkg syscall (netbsd-arm), const TCP_CONGCTL ideal-int +pkg syscall (netbsd-arm), const TCP_KEEPCNT ideal-int +pkg syscall (netbsd-arm), const TCP_KEEPIDLE ideal-int +pkg syscall (netbsd-arm), const TCP_KEEPINIT ideal-int +pkg syscall (netbsd-arm), const TCP_KEEPINTVL ideal-int +pkg syscall (netbsd-arm), const TCP_MAXBURST ideal-int +pkg syscall (netbsd-arm), const TCP_MAXSEG ideal-int +pkg syscall (netbsd-arm), const TCP_MAXWIN ideal-int +pkg syscall (netbsd-arm), const TCP_MAX_WINSHIFT ideal-int +pkg syscall (netbsd-arm), const TCP_MD5SIG ideal-int +pkg syscall (netbsd-arm), const TCP_MINMSS ideal-int +pkg syscall (netbsd-arm), const TCP_MSS ideal-int +pkg syscall (netbsd-arm), const TCSAFLUSH ideal-int +pkg syscall (netbsd-arm), const TIOCCBRK ideal-int +pkg syscall (netbsd-arm), const TIOCCDTR ideal-int +pkg syscall (netbsd-arm), const TIOCCONS ideal-int +pkg syscall (netbsd-arm), const TIOCDCDTIMESTAMP ideal-int +pkg syscall (netbsd-arm), const TIOCDRAIN ideal-int +pkg syscall (netbsd-arm), const TIOCEXCL ideal-int +pkg syscall (netbsd-arm), const TIOCEXT ideal-int +pkg syscall (netbsd-arm), const TIOCFLAG_CDTRCTS ideal-int +pkg syscall (netbsd-arm), const TIOCFLAG_CLOCAL ideal-int +pkg syscall (netbsd-arm), const TIOCFLAG_CRTSCTS ideal-int +pkg syscall (netbsd-arm), const TIOCFLAG_MDMBUF ideal-int +pkg syscall (netbsd-arm), const TIOCFLAG_SOFTCAR ideal-int +pkg syscall (netbsd-arm), const TIOCFLUSH ideal-int +pkg syscall (netbsd-arm), const TIOCGETA ideal-int +pkg syscall (netbsd-arm), const TIOCGETD ideal-int +pkg syscall (netbsd-arm), const TIOCGFLAGS ideal-int +pkg syscall (netbsd-arm), const TIOCGLINED ideal-int +pkg syscall (netbsd-arm), const TIOCGPGRP ideal-int +pkg syscall (netbsd-arm), const TIOCGQSIZE ideal-int +pkg syscall (netbsd-arm), const TIOCGRANTPT ideal-int +pkg syscall (netbsd-arm), const TIOCGSID ideal-int +pkg syscall (netbsd-arm), const TIOCGSIZE ideal-int +pkg syscall (netbsd-arm), const TIOCGWINSZ ideal-int +pkg syscall (netbsd-arm), const TIOCMBIC ideal-int +pkg syscall (netbsd-arm), const TIOCMBIS ideal-int +pkg syscall (netbsd-arm), const TIOCMGET ideal-int +pkg syscall (netbsd-arm), const TIOCMSET ideal-int +pkg syscall (netbsd-arm), const TIOCM_CAR ideal-int +pkg syscall (netbsd-arm), const TIOCM_CD ideal-int +pkg syscall (netbsd-arm), const TIOCM_CTS ideal-int +pkg syscall (netbsd-arm), const TIOCM_DSR ideal-int +pkg syscall (netbsd-arm), const TIOCM_DTR ideal-int +pkg syscall (netbsd-arm), const TIOCM_LE ideal-int +pkg syscall (netbsd-arm), const TIOCM_RI ideal-int +pkg syscall (netbsd-arm), const TIOCM_RNG ideal-int +pkg syscall (netbsd-arm), const TIOCM_RTS ideal-int +pkg syscall (netbsd-arm), const TIOCM_SR ideal-int +pkg syscall (netbsd-arm), const TIOCM_ST ideal-int +pkg syscall (netbsd-arm), const TIOCNOTTY ideal-int +pkg syscall (netbsd-arm), const TIOCNXCL ideal-int +pkg syscall (netbsd-arm), const TIOCOUTQ ideal-int +pkg syscall (netbsd-arm), const TIOCPKT ideal-int +pkg syscall (netbsd-arm), const TIOCPKT_DATA ideal-int +pkg syscall (netbsd-arm), const TIOCPKT_DOSTOP ideal-int +pkg syscall (netbsd-arm), const TIOCPKT_FLUSHREAD ideal-int +pkg syscall (netbsd-arm), const TIOCPKT_FLUSHWRITE ideal-int +pkg syscall (netbsd-arm), const TIOCPKT_IOCTL ideal-int +pkg syscall (netbsd-arm), const TIOCPKT_NOSTOP ideal-int +pkg syscall (netbsd-arm), const TIOCPKT_START ideal-int +pkg syscall (netbsd-arm), const TIOCPKT_STOP ideal-int +pkg syscall (netbsd-arm), const TIOCPTMGET ideal-int +pkg syscall (netbsd-arm), const TIOCPTSNAME ideal-int +pkg syscall (netbsd-arm), const TIOCRCVFRAME ideal-int +pkg syscall (netbsd-arm), const TIOCREMOTE ideal-int +pkg syscall (netbsd-arm), const TIOCSBRK ideal-int +pkg syscall (netbsd-arm), const TIOCSCTTY ideal-int +pkg syscall (netbsd-arm), const TIOCSDTR ideal-int +pkg syscall (netbsd-arm), const TIOCSETA ideal-int +pkg syscall (netbsd-arm), const TIOCSETAF ideal-int +pkg syscall (netbsd-arm), const TIOCSETAW ideal-int +pkg syscall (netbsd-arm), const TIOCSETD ideal-int +pkg syscall (netbsd-arm), const TIOCSFLAGS ideal-int +pkg syscall (netbsd-arm), const TIOCSIG ideal-int +pkg syscall (netbsd-arm), const TIOCSLINED ideal-int +pkg syscall (netbsd-arm), const TIOCSPGRP ideal-int +pkg syscall (netbsd-arm), const TIOCSQSIZE ideal-int +pkg syscall (netbsd-arm), const TIOCSSIZE ideal-int +pkg syscall (netbsd-arm), const TIOCSTART ideal-int +pkg syscall (netbsd-arm), const TIOCSTAT ideal-int +pkg syscall (netbsd-arm), const TIOCSTI ideal-int +pkg syscall (netbsd-arm), const TIOCSTOP ideal-int +pkg syscall (netbsd-arm), const TIOCSWINSZ ideal-int +pkg syscall (netbsd-arm), const TIOCUCNTL ideal-int +pkg syscall (netbsd-arm), const TIOCXMTFRAME ideal-int +pkg syscall (netbsd-arm), const TOSTOP ideal-int +pkg syscall (netbsd-arm), const VDISCARD ideal-int +pkg syscall (netbsd-arm), const VDSUSP ideal-int +pkg syscall (netbsd-arm), const VEOF ideal-int +pkg syscall (netbsd-arm), const VEOL ideal-int +pkg syscall (netbsd-arm), const VEOL2 ideal-int +pkg syscall (netbsd-arm), const VERASE ideal-int +pkg syscall (netbsd-arm), const VINTR ideal-int +pkg syscall (netbsd-arm), const VKILL ideal-int +pkg syscall (netbsd-arm), const VLNEXT ideal-int +pkg syscall (netbsd-arm), const VMIN ideal-int +pkg syscall (netbsd-arm), const VQUIT ideal-int +pkg syscall (netbsd-arm), const VREPRINT ideal-int +pkg syscall (netbsd-arm), const VSTART ideal-int +pkg syscall (netbsd-arm), const VSTATUS ideal-int +pkg syscall (netbsd-arm), const VSTOP ideal-int +pkg syscall (netbsd-arm), const VSUSP ideal-int +pkg syscall (netbsd-arm), const VTIME ideal-int +pkg syscall (netbsd-arm), const VWERASE ideal-int +pkg syscall (netbsd-arm), const WALL ideal-int +pkg syscall (netbsd-arm), const WALLSIG ideal-int +pkg syscall (netbsd-arm), const WALTSIG ideal-int +pkg syscall (netbsd-arm), const WCLONE ideal-int +pkg syscall (netbsd-arm), const WCOREFLAG ideal-int +pkg syscall (netbsd-arm), const WNOHANG ideal-int +pkg syscall (netbsd-arm), const WNOWAIT ideal-int +pkg syscall (netbsd-arm), const WNOZOMBIE ideal-int +pkg syscall (netbsd-arm), const WOPTSCHECKED ideal-int +pkg syscall (netbsd-arm), const WSTOPPED ideal-int +pkg syscall (netbsd-arm), const WUNTRACED ideal-int +pkg syscall (netbsd-arm), func Accept(int) (int, Sockaddr, error) +pkg syscall (netbsd-arm), func Access(string, uint32) error +pkg syscall (netbsd-arm), func Adjtime(*Timeval, *Timeval) error +pkg syscall (netbsd-arm), func Bind(int, Sockaddr) error +pkg syscall (netbsd-arm), func BpfBuflen(int) (int, error) +pkg syscall (netbsd-arm), func BpfDatalink(int) (int, error) +pkg syscall (netbsd-arm), func BpfHeadercmpl(int) (int, error) +pkg syscall (netbsd-arm), func BpfInterface(int, string) (string, error) +pkg syscall (netbsd-arm), func BpfJump(int, int, int, int) *BpfInsn +pkg syscall (netbsd-arm), func BpfStats(int) (*BpfStat, error) +pkg syscall (netbsd-arm), func BpfStmt(int, int) *BpfInsn +pkg syscall (netbsd-arm), func BpfTimeout(int) (*Timeval, error) +pkg syscall (netbsd-arm), func CheckBpfVersion(int) error +pkg syscall (netbsd-arm), func Chflags(string, int) error +pkg syscall (netbsd-arm), func Chroot(string) error +pkg syscall (netbsd-arm), func Close(int) error +pkg syscall (netbsd-arm), func CloseOnExec(int) +pkg syscall (netbsd-arm), func CmsgLen(int) int +pkg syscall (netbsd-arm), func CmsgSpace(int) int +pkg syscall (netbsd-arm), func Connect(int, Sockaddr) error +pkg syscall (netbsd-arm), func Dup(int) (int, error) +pkg syscall (netbsd-arm), func Dup2(int, int) error +pkg syscall (netbsd-arm), func Fchdir(int) error +pkg syscall (netbsd-arm), func Fchflags(string, int) error +pkg syscall (netbsd-arm), func Fchmod(int, uint32) error +pkg syscall (netbsd-arm), func Fchown(int, int, int) error +pkg syscall (netbsd-arm), func Flock(int, int) error +pkg syscall (netbsd-arm), func FlushBpf(int) error +pkg syscall (netbsd-arm), func ForkExec(string, []string, *ProcAttr) (int, error) +pkg syscall (netbsd-arm), func Fpathconf(int, int) (int, error) +pkg syscall (netbsd-arm), func Fstat(int, *Stat_t) error +pkg syscall (netbsd-arm), func Fsync(int) error +pkg syscall (netbsd-arm), func Ftruncate(int, int64) error +pkg syscall (netbsd-arm), func Futimes(int, []Timeval) error +pkg syscall (netbsd-arm), func Getdirentries(int, []uint8, *uintptr) (int, error) +pkg syscall (netbsd-arm), func Getpeername(int) (Sockaddr, error) +pkg syscall (netbsd-arm), func Getpgid(int) (int, error) +pkg syscall (netbsd-arm), func Getpgrp() int +pkg syscall (netbsd-arm), func Getpriority(int, int) (int, error) +pkg syscall (netbsd-arm), func Getrlimit(int, *Rlimit) error +pkg syscall (netbsd-arm), func Getrusage(int, *Rusage) error +pkg syscall (netbsd-arm), func Getsid(int) (int, error) +pkg syscall (netbsd-arm), func Getsockname(int) (Sockaddr, error) +pkg syscall (netbsd-arm), func GetsockoptByte(int, int, int) (uint8, error) +pkg syscall (netbsd-arm), func GetsockoptICMPv6Filter(int, int, int) (*ICMPv6Filter, error) +pkg syscall (netbsd-arm), func GetsockoptIPMreq(int, int, int) (*IPMreq, error) +pkg syscall (netbsd-arm), func GetsockoptIPv6MTUInfo(int, int, int) (*IPv6MTUInfo, error) +pkg syscall (netbsd-arm), func GetsockoptIPv6Mreq(int, int, int) (*IPv6Mreq, error) +pkg syscall (netbsd-arm), func GetsockoptInet4Addr(int, int, int) ([4]uint8, error) +pkg syscall (netbsd-arm), func GetsockoptInt(int, int, int) (int, error) +pkg syscall (netbsd-arm), func Issetugid() bool +pkg syscall (netbsd-arm), func Kevent(int, []Kevent_t, []Kevent_t, *Timespec) (int, error) +pkg syscall (netbsd-arm), func Kill(int, Signal) error +pkg syscall (netbsd-arm), func Kqueue() (int, error) +pkg syscall (netbsd-arm), func Listen(int, int) error +pkg syscall (netbsd-arm), func Lstat(string, *Stat_t) error +pkg syscall (netbsd-arm), func Mkfifo(string, uint32) error +pkg syscall (netbsd-arm), func Mknod(string, uint32, int) error +pkg syscall (netbsd-arm), func Mmap(int, int64, int, int, int) ([]uint8, error) +pkg syscall (netbsd-arm), func Munmap([]uint8) error +pkg syscall (netbsd-arm), func Nanosleep(*Timespec, *Timespec) error +pkg syscall (netbsd-arm), func Open(string, int, uint32) (int, error) +pkg syscall (netbsd-arm), func ParseDirent([]uint8, int, []string) (int, int, []string) +pkg syscall (netbsd-arm), func ParseRoutingMessage([]uint8) ([]RoutingMessage, error) +pkg syscall (netbsd-arm), func ParseRoutingSockaddr(RoutingMessage) ([]Sockaddr, error) +pkg syscall (netbsd-arm), func ParseSocketControlMessage([]uint8) ([]SocketControlMessage, error) +pkg syscall (netbsd-arm), func ParseUnixRights(*SocketControlMessage) ([]int, error) +pkg syscall (netbsd-arm), func Pathconf(string, int) (int, error) +pkg syscall (netbsd-arm), func Pipe([]int) error +pkg syscall (netbsd-arm), func Pread(int, []uint8, int64) (int, error) +pkg syscall (netbsd-arm), func Pwrite(int, []uint8, int64) (int, error) +pkg syscall (netbsd-arm), func RawSyscall(uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno) +pkg syscall (netbsd-arm), func RawSyscall6(uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno) +pkg syscall (netbsd-arm), func Read(int, []uint8) (int, error) +pkg syscall (netbsd-arm), func ReadDirent(int, []uint8) (int, error) +pkg syscall (netbsd-arm), func Recvfrom(int, []uint8, int) (int, Sockaddr, error) +pkg syscall (netbsd-arm), func Recvmsg(int, []uint8, []uint8, int) (int, int, int, Sockaddr, error) +pkg syscall (netbsd-arm), func Revoke(string) error +pkg syscall (netbsd-arm), func RouteRIB(int, int) ([]uint8, error) +pkg syscall (netbsd-arm), func Seek(int, int64, int) (int64, error) +pkg syscall (netbsd-arm), func Select(int, *FdSet, *FdSet, *FdSet, *Timeval) error +pkg syscall (netbsd-arm), func Sendfile(int, int, *int64, int) (int, error) +pkg syscall (netbsd-arm), func Sendmsg(int, []uint8, []uint8, Sockaddr, int) error +pkg syscall (netbsd-arm), func Sendto(int, []uint8, int, Sockaddr) error +pkg syscall (netbsd-arm), func SetBpf(int, []BpfInsn) error +pkg syscall (netbsd-arm), func SetBpfBuflen(int, int) (int, error) +pkg syscall (netbsd-arm), func SetBpfDatalink(int, int) (int, error) +pkg syscall (netbsd-arm), func SetBpfHeadercmpl(int, int) error +pkg syscall (netbsd-arm), func SetBpfImmediate(int, int) error +pkg syscall (netbsd-arm), func SetBpfInterface(int, string) error +pkg syscall (netbsd-arm), func SetBpfPromisc(int, int) error +pkg syscall (netbsd-arm), func SetBpfTimeout(int, *Timeval) error +pkg syscall (netbsd-arm), func SetKevent(*Kevent_t, int, int, int) +pkg syscall (netbsd-arm), func SetNonblock(int, bool) error +pkg syscall (netbsd-arm), func Setegid(int) error +pkg syscall (netbsd-arm), func Seteuid(int) error +pkg syscall (netbsd-arm), func Setgid(int) error +pkg syscall (netbsd-arm), func Setgroups([]int) error +pkg syscall (netbsd-arm), func Setpgid(int, int) error +pkg syscall (netbsd-arm), func Setpriority(int, int, int) error +pkg syscall (netbsd-arm), func Setregid(int, int) error +pkg syscall (netbsd-arm), func Setreuid(int, int) error +pkg syscall (netbsd-arm), func Setrlimit(int, *Rlimit) error +pkg syscall (netbsd-arm), func Setsid() (int, error) +pkg syscall (netbsd-arm), func SetsockoptByte(int, int, int, uint8) error +pkg syscall (netbsd-arm), func SetsockoptICMPv6Filter(int, int, int, *ICMPv6Filter) error +pkg syscall (netbsd-arm), func SetsockoptIPMreq(int, int, int, *IPMreq) error +pkg syscall (netbsd-arm), func SetsockoptIPv6Mreq(int, int, int, *IPv6Mreq) error +pkg syscall (netbsd-arm), func SetsockoptInet4Addr(int, int, int, [4]uint8) error +pkg syscall (netbsd-arm), func SetsockoptInt(int, int, int, int) error +pkg syscall (netbsd-arm), func SetsockoptLinger(int, int, int, *Linger) error +pkg syscall (netbsd-arm), func SetsockoptString(int, int, int, string) error +pkg syscall (netbsd-arm), func SetsockoptTimeval(int, int, int, *Timeval) error +pkg syscall (netbsd-arm), func Settimeofday(*Timeval) error +pkg syscall (netbsd-arm), func Setuid(int) error +pkg syscall (netbsd-arm), func Shutdown(int, int) error +pkg syscall (netbsd-arm), func SlicePtrFromStrings([]string) ([]*uint8, error) +pkg syscall (netbsd-arm), func Socket(int, int, int) (int, error) +pkg syscall (netbsd-arm), func Socketpair(int, int, int) ([2]int, error) +pkg syscall (netbsd-arm), func Stat(string, *Stat_t) error +pkg syscall (netbsd-arm), func StringSlicePtr([]string) []*uint8 +pkg syscall (netbsd-arm), func Sync() error +pkg syscall (netbsd-arm), func Syscall(uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno) +pkg syscall (netbsd-arm), func Syscall6(uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno) +pkg syscall (netbsd-arm), func Syscall9(uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno) +pkg syscall (netbsd-arm), func Sysctl(string) (string, error) +pkg syscall (netbsd-arm), func SysctlUint32(string) (uint32, error) +pkg syscall (netbsd-arm), func TimevalToNsec(Timeval) int64 +pkg syscall (netbsd-arm), func Truncate(string, int64) error +pkg syscall (netbsd-arm), func Umask(int) int +pkg syscall (netbsd-arm), func UnixRights(...int) []uint8 +pkg syscall (netbsd-arm), func Unmount(string, int) error +pkg syscall (netbsd-arm), func Wait4(int, *WaitStatus, int, *Rusage) (int, error) +pkg syscall (netbsd-arm), func Write(int, []uint8) (int, error) +pkg syscall (netbsd-arm), method (*Cmsghdr) SetLen(int) +pkg syscall (netbsd-arm), method (*Iovec) SetLen(int) +pkg syscall (netbsd-arm), method (*Msghdr) SetControllen(int) +pkg syscall (netbsd-arm), type BpfHdr struct +pkg syscall (netbsd-arm), type BpfHdr struct, Caplen uint32 +pkg syscall (netbsd-arm), type BpfHdr struct, Datalen uint32 +pkg syscall (netbsd-arm), type BpfHdr struct, Hdrlen uint16 +pkg syscall (netbsd-arm), type BpfHdr struct, Pad_cgo_0 [2]uint8 +pkg syscall (netbsd-arm), type BpfHdr struct, Tstamp BpfTimeval +pkg syscall (netbsd-arm), type BpfInsn struct +pkg syscall (netbsd-arm), type BpfInsn struct, Code uint16 +pkg syscall (netbsd-arm), type BpfInsn struct, Jf uint8 +pkg syscall (netbsd-arm), type BpfInsn struct, Jt uint8 +pkg syscall (netbsd-arm), type BpfInsn struct, K uint32 +pkg syscall (netbsd-arm), type BpfProgram struct +pkg syscall (netbsd-arm), type BpfProgram struct, Insns *BpfInsn +pkg syscall (netbsd-arm), type BpfProgram struct, Len uint32 +pkg syscall (netbsd-arm), type BpfStat struct +pkg syscall (netbsd-arm), type BpfStat struct, Capt uint64 +pkg syscall (netbsd-arm), type BpfStat struct, Drop uint64 +pkg syscall (netbsd-arm), type BpfStat struct, Padding [13]uint64 +pkg syscall (netbsd-arm), type BpfStat struct, Recv uint64 +pkg syscall (netbsd-arm), type BpfTimeval struct +pkg syscall (netbsd-arm), type BpfTimeval struct, Sec int32 +pkg syscall (netbsd-arm), type BpfTimeval struct, Usec int32 +pkg syscall (netbsd-arm), type BpfVersion struct +pkg syscall (netbsd-arm), type BpfVersion struct, Major uint16 +pkg syscall (netbsd-arm), type BpfVersion struct, Minor uint16 +pkg syscall (netbsd-arm), type Cmsghdr struct +pkg syscall (netbsd-arm), type Cmsghdr struct, Len uint32 +pkg syscall (netbsd-arm), type Cmsghdr struct, Level int32 +pkg syscall (netbsd-arm), type Cmsghdr struct, Type int32 +pkg syscall (netbsd-arm), type Credential struct +pkg syscall (netbsd-arm), type Credential struct, Gid uint32 +pkg syscall (netbsd-arm), type Credential struct, Groups []uint32 +pkg syscall (netbsd-arm), type Credential struct, Uid uint32 +pkg syscall (netbsd-arm), type Dirent struct +pkg syscall (netbsd-arm), type Dirent struct, Fileno uint64 +pkg syscall (netbsd-arm), type Dirent struct, Name [512]int8 +pkg syscall (netbsd-arm), type Dirent struct, Namlen uint16 +pkg syscall (netbsd-arm), type Dirent struct, Pad_cgo_0 [3]uint8 +pkg syscall (netbsd-arm), type Dirent struct, Reclen uint16 +pkg syscall (netbsd-arm), type Dirent struct, Type uint8 +pkg syscall (netbsd-arm), type FdSet struct +pkg syscall (netbsd-arm), type FdSet struct, Bits [8]uint32 +pkg syscall (netbsd-arm), type Flock_t struct +pkg syscall (netbsd-arm), type Flock_t struct, Len int64 +pkg syscall (netbsd-arm), type Flock_t struct, Pid int32 +pkg syscall (netbsd-arm), type Flock_t struct, Start int64 +pkg syscall (netbsd-arm), type Flock_t struct, Type int16 +pkg syscall (netbsd-arm), type Flock_t struct, Whence int16 +pkg syscall (netbsd-arm), type Fsid struct +pkg syscall (netbsd-arm), type Fsid struct, X__fsid_val [2]int32 +pkg syscall (netbsd-arm), type ICMPv6Filter struct +pkg syscall (netbsd-arm), type ICMPv6Filter struct, Filt [8]uint32 +pkg syscall (netbsd-arm), type IPv6MTUInfo struct +pkg syscall (netbsd-arm), type IPv6MTUInfo struct, Addr RawSockaddrInet6 +pkg syscall (netbsd-arm), type IPv6MTUInfo struct, Mtu uint32 +pkg syscall (netbsd-arm), type IfAnnounceMsghdr struct +pkg syscall (netbsd-arm), type IfAnnounceMsghdr struct, Index uint16 +pkg syscall (netbsd-arm), type IfAnnounceMsghdr struct, Msglen uint16 +pkg syscall (netbsd-arm), type IfAnnounceMsghdr struct, Name [16]int8 +pkg syscall (netbsd-arm), type IfAnnounceMsghdr struct, Type uint8 +pkg syscall (netbsd-arm), type IfAnnounceMsghdr struct, Version uint8 +pkg syscall (netbsd-arm), type IfAnnounceMsghdr struct, What uint16 +pkg syscall (netbsd-arm), type IfData struct +pkg syscall (netbsd-arm), type IfData struct, Addrlen uint8 +pkg syscall (netbsd-arm), type IfData struct, Baudrate uint64 +pkg syscall (netbsd-arm), type IfData struct, Collisions uint64 +pkg syscall (netbsd-arm), type IfData struct, Hdrlen uint8 +pkg syscall (netbsd-arm), type IfData struct, Ibytes uint64 +pkg syscall (netbsd-arm), type IfData struct, Ierrors uint64 +pkg syscall (netbsd-arm), type IfData struct, Imcasts uint64 +pkg syscall (netbsd-arm), type IfData struct, Ipackets uint64 +pkg syscall (netbsd-arm), type IfData struct, Iqdrops uint64 +pkg syscall (netbsd-arm), type IfData struct, Lastchange Timespec +pkg syscall (netbsd-arm), type IfData struct, Link_state int32 +pkg syscall (netbsd-arm), type IfData struct, Metric uint64 +pkg syscall (netbsd-arm), type IfData struct, Mtu uint64 +pkg syscall (netbsd-arm), type IfData struct, Noproto uint64 +pkg syscall (netbsd-arm), type IfData struct, Obytes uint64 +pkg syscall (netbsd-arm), type IfData struct, Oerrors uint64 +pkg syscall (netbsd-arm), type IfData struct, Omcasts uint64 +pkg syscall (netbsd-arm), type IfData struct, Opackets uint64 +pkg syscall (netbsd-arm), type IfData struct, Pad_cgo_0 [1]uint8 +pkg syscall (netbsd-arm), type IfData struct, Type uint8 +pkg syscall (netbsd-arm), type IfMsghdr struct +pkg syscall (netbsd-arm), type IfMsghdr struct, Addrs int32 +pkg syscall (netbsd-arm), type IfMsghdr struct, Data IfData +pkg syscall (netbsd-arm), type IfMsghdr struct, Flags int32 +pkg syscall (netbsd-arm), type IfMsghdr struct, Index uint16 +pkg syscall (netbsd-arm), type IfMsghdr struct, Msglen uint16 +pkg syscall (netbsd-arm), type IfMsghdr struct, Pad_cgo_0 [2]uint8 +pkg syscall (netbsd-arm), type IfMsghdr struct, Pad_cgo_1 [4]uint8 +pkg syscall (netbsd-arm), type IfMsghdr struct, Type uint8 +pkg syscall (netbsd-arm), type IfMsghdr struct, Version uint8 +pkg syscall (netbsd-arm), type IfaMsghdr struct +pkg syscall (netbsd-arm), type IfaMsghdr struct, Addrs int32 +pkg syscall (netbsd-arm), type IfaMsghdr struct, Flags int32 +pkg syscall (netbsd-arm), type IfaMsghdr struct, Index uint16 +pkg syscall (netbsd-arm), type IfaMsghdr struct, Metric int32 +pkg syscall (netbsd-arm), type IfaMsghdr struct, Msglen uint16 +pkg syscall (netbsd-arm), type IfaMsghdr struct, Pad_cgo_0 [6]uint8 +pkg syscall (netbsd-arm), type IfaMsghdr struct, Type uint8 +pkg syscall (netbsd-arm), type IfaMsghdr struct, Version uint8 +pkg syscall (netbsd-arm), type Inet6Pktinfo struct +pkg syscall (netbsd-arm), type Inet6Pktinfo struct, Addr [16]uint8 +pkg syscall (netbsd-arm), type Inet6Pktinfo struct, Ifindex uint32 +pkg syscall (netbsd-arm), type InterfaceAddrMessage struct +pkg syscall (netbsd-arm), type InterfaceAddrMessage struct, Data []uint8 +pkg syscall (netbsd-arm), type InterfaceAddrMessage struct, Header IfaMsghdr +pkg syscall (netbsd-arm), type InterfaceAnnounceMessage struct +pkg syscall (netbsd-arm), type InterfaceAnnounceMessage struct, Header IfAnnounceMsghdr +pkg syscall (netbsd-arm), type InterfaceMessage struct +pkg syscall (netbsd-arm), type InterfaceMessage struct, Data []uint8 +pkg syscall (netbsd-arm), type InterfaceMessage struct, Header IfMsghdr +pkg syscall (netbsd-arm), type Iovec struct +pkg syscall (netbsd-arm), type Iovec struct, Base *uint8 +pkg syscall (netbsd-arm), type Iovec struct, Len uint32 +pkg syscall (netbsd-arm), type Kevent_t struct +pkg syscall (netbsd-arm), type Kevent_t struct, Data int64 +pkg syscall (netbsd-arm), type Kevent_t struct, Fflags uint32 +pkg syscall (netbsd-arm), type Kevent_t struct, Filter uint32 +pkg syscall (netbsd-arm), type Kevent_t struct, Flags uint32 +pkg syscall (netbsd-arm), type Kevent_t struct, Ident uint32 +pkg syscall (netbsd-arm), type Kevent_t struct, Udata int32 +pkg syscall (netbsd-arm), type Mclpool [0]uint8 +pkg syscall (netbsd-arm), type Msghdr struct +pkg syscall (netbsd-arm), type Msghdr struct, Control *uint8 +pkg syscall (netbsd-arm), type Msghdr struct, Controllen uint32 +pkg syscall (netbsd-arm), type Msghdr struct, Flags int32 +pkg syscall (netbsd-arm), type Msghdr struct, Iov *Iovec +pkg syscall (netbsd-arm), type Msghdr struct, Iovlen int32 +pkg syscall (netbsd-arm), type Msghdr struct, Name *uint8 +pkg syscall (netbsd-arm), type Msghdr struct, Namelen uint32 +pkg syscall (netbsd-arm), type RawSockaddr struct, Data [14]int8 +pkg syscall (netbsd-arm), type RawSockaddr struct, Family uint8 +pkg syscall (netbsd-arm), type RawSockaddr struct, Len uint8 +pkg syscall (netbsd-arm), type RawSockaddrAny struct, Pad [92]int8 +pkg syscall (netbsd-arm), type RawSockaddrDatalink struct +pkg syscall (netbsd-arm), type RawSockaddrDatalink struct, Alen uint8 +pkg syscall (netbsd-arm), type RawSockaddrDatalink struct, Data [12]int8 +pkg syscall (netbsd-arm), type RawSockaddrDatalink struct, Family uint8 +pkg syscall (netbsd-arm), type RawSockaddrDatalink struct, Index uint16 +pkg syscall (netbsd-arm), type RawSockaddrDatalink struct, Len uint8 +pkg syscall (netbsd-arm), type RawSockaddrDatalink struct, Nlen uint8 +pkg syscall (netbsd-arm), type RawSockaddrDatalink struct, Slen uint8 +pkg syscall (netbsd-arm), type RawSockaddrDatalink struct, Type uint8 +pkg syscall (netbsd-arm), type RawSockaddrInet4 struct, Family uint8 +pkg syscall (netbsd-arm), type RawSockaddrInet4 struct, Len uint8 +pkg syscall (netbsd-arm), type RawSockaddrInet4 struct, Zero [8]int8 +pkg syscall (netbsd-arm), type RawSockaddrInet6 struct, Family uint8 +pkg syscall (netbsd-arm), type RawSockaddrInet6 struct, Len uint8 +pkg syscall (netbsd-arm), type RawSockaddrUnix struct +pkg syscall (netbsd-arm), type RawSockaddrUnix struct, Family uint8 +pkg syscall (netbsd-arm), type RawSockaddrUnix struct, Len uint8 +pkg syscall (netbsd-arm), type RawSockaddrUnix struct, Path [104]int8 +pkg syscall (netbsd-arm), type Rlimit struct +pkg syscall (netbsd-arm), type Rlimit struct, Cur uint64 +pkg syscall (netbsd-arm), type Rlimit struct, Max uint64 +pkg syscall (netbsd-arm), type RouteMessage struct +pkg syscall (netbsd-arm), type RouteMessage struct, Data []uint8 +pkg syscall (netbsd-arm), type RouteMessage struct, Header RtMsghdr +pkg syscall (netbsd-arm), type RoutingMessage interface, unexported methods +pkg syscall (netbsd-arm), type RtMetrics struct +pkg syscall (netbsd-arm), type RtMetrics struct, Expire int64 +pkg syscall (netbsd-arm), type RtMetrics struct, Hopcount uint64 +pkg syscall (netbsd-arm), type RtMetrics struct, Locks uint64 +pkg syscall (netbsd-arm), type RtMetrics struct, Mtu uint64 +pkg syscall (netbsd-arm), type RtMetrics struct, Pksent int64 +pkg syscall (netbsd-arm), type RtMetrics struct, Recvpipe uint64 +pkg syscall (netbsd-arm), type RtMetrics struct, Rtt uint64 +pkg syscall (netbsd-arm), type RtMetrics struct, Rttvar uint64 +pkg syscall (netbsd-arm), type RtMetrics struct, Sendpipe uint64 +pkg syscall (netbsd-arm), type RtMetrics struct, Ssthresh uint64 +pkg syscall (netbsd-arm), type RtMsghdr struct +pkg syscall (netbsd-arm), type RtMsghdr struct, Addrs int32 +pkg syscall (netbsd-arm), type RtMsghdr struct, Errno int32 +pkg syscall (netbsd-arm), type RtMsghdr struct, Flags int32 +pkg syscall (netbsd-arm), type RtMsghdr struct, Index uint16 +pkg syscall (netbsd-arm), type RtMsghdr struct, Inits int32 +pkg syscall (netbsd-arm), type RtMsghdr struct, Msglen uint16 +pkg syscall (netbsd-arm), type RtMsghdr struct, Pad_cgo_0 [2]uint8 +pkg syscall (netbsd-arm), type RtMsghdr struct, Pad_cgo_1 [4]uint8 +pkg syscall (netbsd-arm), type RtMsghdr struct, Pid int32 +pkg syscall (netbsd-arm), type RtMsghdr struct, Rmx RtMetrics +pkg syscall (netbsd-arm), type RtMsghdr struct, Seq int32 +pkg syscall (netbsd-arm), type RtMsghdr struct, Type uint8 +pkg syscall (netbsd-arm), type RtMsghdr struct, Use int32 +pkg syscall (netbsd-arm), type RtMsghdr struct, Version uint8 +pkg syscall (netbsd-arm), type Rusage struct, Idrss int32 +pkg syscall (netbsd-arm), type Rusage struct, Inblock int32 +pkg syscall (netbsd-arm), type Rusage struct, Isrss int32 +pkg syscall (netbsd-arm), type Rusage struct, Ixrss int32 +pkg syscall (netbsd-arm), type Rusage struct, Majflt int32 +pkg syscall (netbsd-arm), type Rusage struct, Maxrss int32 +pkg syscall (netbsd-arm), type Rusage struct, Minflt int32 +pkg syscall (netbsd-arm), type Rusage struct, Msgrcv int32 +pkg syscall (netbsd-arm), type Rusage struct, Msgsnd int32 +pkg syscall (netbsd-arm), type Rusage struct, Nivcsw int32 +pkg syscall (netbsd-arm), type Rusage struct, Nsignals int32 +pkg syscall (netbsd-arm), type Rusage struct, Nswap int32 +pkg syscall (netbsd-arm), type Rusage struct, Nvcsw int32 +pkg syscall (netbsd-arm), type Rusage struct, Oublock int32 +pkg syscall (netbsd-arm), type Rusage struct, Stime Timeval +pkg syscall (netbsd-arm), type Rusage struct, Utime Timeval +pkg syscall (netbsd-arm), type SockaddrDatalink struct +pkg syscall (netbsd-arm), type SockaddrDatalink struct, Alen uint8 +pkg syscall (netbsd-arm), type SockaddrDatalink struct, Data [12]int8 +pkg syscall (netbsd-arm), type SockaddrDatalink struct, Family uint8 +pkg syscall (netbsd-arm), type SockaddrDatalink struct, Index uint16 +pkg syscall (netbsd-arm), type SockaddrDatalink struct, Len uint8 +pkg syscall (netbsd-arm), type SockaddrDatalink struct, Nlen uint8 +pkg syscall (netbsd-arm), type SockaddrDatalink struct, Slen uint8 +pkg syscall (netbsd-arm), type SockaddrDatalink struct, Type uint8 +pkg syscall (netbsd-arm), type SocketControlMessage struct +pkg syscall (netbsd-arm), type SocketControlMessage struct, Data []uint8 +pkg syscall (netbsd-arm), type SocketControlMessage struct, Header Cmsghdr +pkg syscall (netbsd-arm), type Stat_t struct +pkg syscall (netbsd-arm), type Stat_t struct, Atimespec Timespec +pkg syscall (netbsd-arm), type Stat_t struct, Birthtimespec Timespec +pkg syscall (netbsd-arm), type Stat_t struct, Blksize uint32 +pkg syscall (netbsd-arm), type Stat_t struct, Blocks int64 +pkg syscall (netbsd-arm), type Stat_t struct, Ctimespec Timespec +pkg syscall (netbsd-arm), type Stat_t struct, Dev uint64 +pkg syscall (netbsd-arm), type Stat_t struct, Flags uint32 +pkg syscall (netbsd-arm), type Stat_t struct, Gen uint32 +pkg syscall (netbsd-arm), type Stat_t struct, Gid uint32 +pkg syscall (netbsd-arm), type Stat_t struct, Ino uint64 +pkg syscall (netbsd-arm), type Stat_t struct, Mode uint32 +pkg syscall (netbsd-arm), type Stat_t struct, Mtimespec Timespec +pkg syscall (netbsd-arm), type Stat_t struct, Nlink uint32 +pkg syscall (netbsd-arm), type Stat_t struct, Rdev uint64 +pkg syscall (netbsd-arm), type Stat_t struct, Size int64 +pkg syscall (netbsd-arm), type Stat_t struct, Spare [2]uint32 +pkg syscall (netbsd-arm), type Stat_t struct, Uid uint32 +pkg syscall (netbsd-arm), type Statfs_t [0]uint8 +pkg syscall (netbsd-arm), type SysProcAttr struct, Chroot string +pkg syscall (netbsd-arm), type SysProcAttr struct, Credential *Credential +pkg syscall (netbsd-arm), type SysProcAttr struct, Noctty bool +pkg syscall (netbsd-arm), type SysProcAttr struct, Ptrace bool +pkg syscall (netbsd-arm), type SysProcAttr struct, Setctty bool +pkg syscall (netbsd-arm), type SysProcAttr struct, Setpgid bool +pkg syscall (netbsd-arm), type SysProcAttr struct, Setsid bool +pkg syscall (netbsd-arm), type Sysctlnode struct +pkg syscall (netbsd-arm), type Sysctlnode struct, Flags uint32 +pkg syscall (netbsd-arm), type Sysctlnode struct, Name [32]int8 +pkg syscall (netbsd-arm), type Sysctlnode struct, Num int32 +pkg syscall (netbsd-arm), type Sysctlnode struct, Un [16]uint8 +pkg syscall (netbsd-arm), type Sysctlnode struct, Ver uint32 +pkg syscall (netbsd-arm), type Sysctlnode struct, X__rsvd uint32 +pkg syscall (netbsd-arm), type Sysctlnode struct, X_sysctl_desc [8]uint8 +pkg syscall (netbsd-arm), type Sysctlnode struct, X_sysctl_func [8]uint8 +pkg syscall (netbsd-arm), type Sysctlnode struct, X_sysctl_parent [8]uint8 +pkg syscall (netbsd-arm), type Sysctlnode struct, X_sysctl_size [8]uint8 +pkg syscall (netbsd-arm), type Timespec struct, Nsec int32 +pkg syscall (netbsd-arm), type Timespec struct, Sec int64 +pkg syscall (netbsd-arm), type Timeval struct, Sec int64 +pkg syscall (netbsd-arm), type Timeval struct, Usec int32 +pkg syscall (netbsd-arm), type WaitStatus uint32 +pkg syscall (netbsd-arm), var Stderr int +pkg syscall (netbsd-arm), var Stdin int +pkg syscall (netbsd-arm), var Stdout int +pkg syscall (netbsd-arm-cgo), const AF_APPLETALK ideal-int +pkg syscall (netbsd-arm-cgo), const AF_ARP ideal-int +pkg syscall (netbsd-arm-cgo), const AF_BLUETOOTH ideal-int +pkg syscall (netbsd-arm-cgo), const AF_CCITT ideal-int +pkg syscall (netbsd-arm-cgo), const AF_CHAOS ideal-int +pkg syscall (netbsd-arm-cgo), const AF_CNT ideal-int +pkg syscall (netbsd-arm-cgo), const AF_COIP ideal-int +pkg syscall (netbsd-arm-cgo), const AF_DATAKIT ideal-int +pkg syscall (netbsd-arm-cgo), const AF_DECnet ideal-int +pkg syscall (netbsd-arm-cgo), const AF_DLI ideal-int +pkg syscall (netbsd-arm-cgo), const AF_E164 ideal-int +pkg syscall (netbsd-arm-cgo), const AF_ECMA ideal-int +pkg syscall (netbsd-arm-cgo), const AF_HYLINK ideal-int +pkg syscall (netbsd-arm-cgo), const AF_IEEE80211 ideal-int +pkg syscall (netbsd-arm-cgo), const AF_IMPLINK ideal-int +pkg syscall (netbsd-arm-cgo), const AF_IPX ideal-int +pkg syscall (netbsd-arm-cgo), const AF_ISDN ideal-int +pkg syscall (netbsd-arm-cgo), const AF_ISO ideal-int +pkg syscall (netbsd-arm-cgo), const AF_LAT ideal-int +pkg syscall (netbsd-arm-cgo), const AF_LINK ideal-int +pkg syscall (netbsd-arm-cgo), const AF_LOCAL ideal-int +pkg syscall (netbsd-arm-cgo), const AF_MAX ideal-int +pkg syscall (netbsd-arm-cgo), const AF_MPLS ideal-int +pkg syscall (netbsd-arm-cgo), const AF_NATM ideal-int +pkg syscall (netbsd-arm-cgo), const AF_NS ideal-int +pkg syscall (netbsd-arm-cgo), const AF_OROUTE ideal-int +pkg syscall (netbsd-arm-cgo), const AF_OSI ideal-int +pkg syscall (netbsd-arm-cgo), const AF_PUP ideal-int +pkg syscall (netbsd-arm-cgo), const AF_ROUTE ideal-int +pkg syscall (netbsd-arm-cgo), const AF_SNA ideal-int +pkg syscall (netbsd-arm-cgo), const ARPHRD_ARCNET ideal-int +pkg syscall (netbsd-arm-cgo), const ARPHRD_ETHER ideal-int +pkg syscall (netbsd-arm-cgo), const ARPHRD_FRELAY ideal-int +pkg syscall (netbsd-arm-cgo), const ARPHRD_IEEE1394 ideal-int +pkg syscall (netbsd-arm-cgo), const ARPHRD_IEEE802 ideal-int +pkg syscall (netbsd-arm-cgo), const ARPHRD_STRIP ideal-int +pkg syscall (netbsd-arm-cgo), const B0 ideal-int +pkg syscall (netbsd-arm-cgo), const B110 ideal-int +pkg syscall (netbsd-arm-cgo), const B115200 ideal-int +pkg syscall (netbsd-arm-cgo), const B1200 ideal-int +pkg syscall (netbsd-arm-cgo), const B134 ideal-int +pkg syscall (netbsd-arm-cgo), const B14400 ideal-int +pkg syscall (netbsd-arm-cgo), const B150 ideal-int +pkg syscall (netbsd-arm-cgo), const B1800 ideal-int +pkg syscall (netbsd-arm-cgo), const B19200 ideal-int +pkg syscall (netbsd-arm-cgo), const B200 ideal-int +pkg syscall (netbsd-arm-cgo), const B230400 ideal-int +pkg syscall (netbsd-arm-cgo), const B2400 ideal-int +pkg syscall (netbsd-arm-cgo), const B28800 ideal-int +pkg syscall (netbsd-arm-cgo), const B300 ideal-int +pkg syscall (netbsd-arm-cgo), const B38400 ideal-int +pkg syscall (netbsd-arm-cgo), const B460800 ideal-int +pkg syscall (netbsd-arm-cgo), const B4800 ideal-int +pkg syscall (netbsd-arm-cgo), const B50 ideal-int +pkg syscall (netbsd-arm-cgo), const B57600 ideal-int +pkg syscall (netbsd-arm-cgo), const B600 ideal-int +pkg syscall (netbsd-arm-cgo), const B7200 ideal-int +pkg syscall (netbsd-arm-cgo), const B75 ideal-int +pkg syscall (netbsd-arm-cgo), const B76800 ideal-int +pkg syscall (netbsd-arm-cgo), const B921600 ideal-int +pkg syscall (netbsd-arm-cgo), const B9600 ideal-int +pkg syscall (netbsd-arm-cgo), const BIOCFEEDBACK ideal-int +pkg syscall (netbsd-arm-cgo), const BIOCFLUSH ideal-int +pkg syscall (netbsd-arm-cgo), const BIOCGBLEN ideal-int +pkg syscall (netbsd-arm-cgo), const BIOCGDLT ideal-int +pkg syscall (netbsd-arm-cgo), const BIOCGDLTLIST ideal-int +pkg syscall (netbsd-arm-cgo), const BIOCGETIF ideal-int +pkg syscall (netbsd-arm-cgo), const BIOCGFEEDBACK ideal-int +pkg syscall (netbsd-arm-cgo), const BIOCGHDRCMPLT ideal-int +pkg syscall (netbsd-arm-cgo), const BIOCGRTIMEOUT ideal-int +pkg syscall (netbsd-arm-cgo), const BIOCGSEESENT ideal-int +pkg syscall (netbsd-arm-cgo), const BIOCGSTATS ideal-int +pkg syscall (netbsd-arm-cgo), const BIOCGSTATSOLD ideal-int +pkg syscall (netbsd-arm-cgo), const BIOCIMMEDIATE ideal-int +pkg syscall (netbsd-arm-cgo), const BIOCPROMISC ideal-int +pkg syscall (netbsd-arm-cgo), const BIOCSBLEN ideal-int +pkg syscall (netbsd-arm-cgo), const BIOCSDLT ideal-int +pkg syscall (netbsd-arm-cgo), const BIOCSETF ideal-int +pkg syscall (netbsd-arm-cgo), const BIOCSETIF ideal-int +pkg syscall (netbsd-arm-cgo), const BIOCSFEEDBACK ideal-int +pkg syscall (netbsd-arm-cgo), const BIOCSHDRCMPLT ideal-int +pkg syscall (netbsd-arm-cgo), const BIOCSRTIMEOUT ideal-int +pkg syscall (netbsd-arm-cgo), const BIOCSSEESENT ideal-int +pkg syscall (netbsd-arm-cgo), const BIOCSTCPF ideal-int +pkg syscall (netbsd-arm-cgo), const BIOCSUDPF ideal-int +pkg syscall (netbsd-arm-cgo), const BIOCVERSION ideal-int +pkg syscall (netbsd-arm-cgo), const BPF_A ideal-int +pkg syscall (netbsd-arm-cgo), const BPF_ABS ideal-int +pkg syscall (netbsd-arm-cgo), const BPF_ADD ideal-int +pkg syscall (netbsd-arm-cgo), const BPF_ALIGNMENT ideal-int +pkg syscall (netbsd-arm-cgo), const BPF_ALIGNMENT32 ideal-int +pkg syscall (netbsd-arm-cgo), const BPF_ALU ideal-int +pkg syscall (netbsd-arm-cgo), const BPF_AND ideal-int +pkg syscall (netbsd-arm-cgo), const BPF_B ideal-int +pkg syscall (netbsd-arm-cgo), const BPF_DFLTBUFSIZE ideal-int +pkg syscall (netbsd-arm-cgo), const BPF_DIV ideal-int +pkg syscall (netbsd-arm-cgo), const BPF_H ideal-int +pkg syscall (netbsd-arm-cgo), const BPF_IMM ideal-int +pkg syscall (netbsd-arm-cgo), const BPF_IND ideal-int +pkg syscall (netbsd-arm-cgo), const BPF_JA ideal-int +pkg syscall (netbsd-arm-cgo), const BPF_JEQ ideal-int +pkg syscall (netbsd-arm-cgo), const BPF_JGE ideal-int +pkg syscall (netbsd-arm-cgo), const BPF_JGT ideal-int +pkg syscall (netbsd-arm-cgo), const BPF_JMP ideal-int +pkg syscall (netbsd-arm-cgo), const BPF_JSET ideal-int +pkg syscall (netbsd-arm-cgo), const BPF_K ideal-int +pkg syscall (netbsd-arm-cgo), const BPF_LD ideal-int +pkg syscall (netbsd-arm-cgo), const BPF_LDX ideal-int +pkg syscall (netbsd-arm-cgo), const BPF_LEN ideal-int +pkg syscall (netbsd-arm-cgo), const BPF_LSH ideal-int +pkg syscall (netbsd-arm-cgo), const BPF_MAJOR_VERSION ideal-int +pkg syscall (netbsd-arm-cgo), const BPF_MAXBUFSIZE ideal-int +pkg syscall (netbsd-arm-cgo), const BPF_MAXINSNS ideal-int +pkg syscall (netbsd-arm-cgo), const BPF_MEM ideal-int +pkg syscall (netbsd-arm-cgo), const BPF_MEMWORDS ideal-int +pkg syscall (netbsd-arm-cgo), const BPF_MINBUFSIZE ideal-int +pkg syscall (netbsd-arm-cgo), const BPF_MINOR_VERSION ideal-int +pkg syscall (netbsd-arm-cgo), const BPF_MISC ideal-int +pkg syscall (netbsd-arm-cgo), const BPF_MSH ideal-int +pkg syscall (netbsd-arm-cgo), const BPF_MUL ideal-int +pkg syscall (netbsd-arm-cgo), const BPF_NEG ideal-int +pkg syscall (netbsd-arm-cgo), const BPF_OR ideal-int +pkg syscall (netbsd-arm-cgo), const BPF_RELEASE ideal-int +pkg syscall (netbsd-arm-cgo), const BPF_RET ideal-int +pkg syscall (netbsd-arm-cgo), const BPF_RSH ideal-int +pkg syscall (netbsd-arm-cgo), const BPF_ST ideal-int +pkg syscall (netbsd-arm-cgo), const BPF_STX ideal-int +pkg syscall (netbsd-arm-cgo), const BPF_SUB ideal-int +pkg syscall (netbsd-arm-cgo), const BPF_TAX ideal-int +pkg syscall (netbsd-arm-cgo), const BPF_TXA ideal-int +pkg syscall (netbsd-arm-cgo), const BPF_W ideal-int +pkg syscall (netbsd-arm-cgo), const BPF_X ideal-int +pkg syscall (netbsd-arm-cgo), const BRKINT ideal-int +pkg syscall (netbsd-arm-cgo), const CFLUSH ideal-int +pkg syscall (netbsd-arm-cgo), const CLOCAL ideal-int +pkg syscall (netbsd-arm-cgo), const CREAD ideal-int +pkg syscall (netbsd-arm-cgo), const CS5 ideal-int +pkg syscall (netbsd-arm-cgo), const CS6 ideal-int +pkg syscall (netbsd-arm-cgo), const CS7 ideal-int +pkg syscall (netbsd-arm-cgo), const CS8 ideal-int +pkg syscall (netbsd-arm-cgo), const CSIZE ideal-int +pkg syscall (netbsd-arm-cgo), const CSTART ideal-int +pkg syscall (netbsd-arm-cgo), const CSTATUS ideal-int +pkg syscall (netbsd-arm-cgo), const CSTOP ideal-int +pkg syscall (netbsd-arm-cgo), const CSTOPB ideal-int +pkg syscall (netbsd-arm-cgo), const CSUSP ideal-int +pkg syscall (netbsd-arm-cgo), const CTL_MAXNAME ideal-int +pkg syscall (netbsd-arm-cgo), const CTL_NET ideal-int +pkg syscall (netbsd-arm-cgo), const CTL_QUERY ideal-int +pkg syscall (netbsd-arm-cgo), const DIOCBSFLUSH ideal-int +pkg syscall (netbsd-arm-cgo), const DLT_A429 ideal-int +pkg syscall (netbsd-arm-cgo), const DLT_A653_ICM ideal-int +pkg syscall (netbsd-arm-cgo), const DLT_AIRONET_HEADER ideal-int +pkg syscall (netbsd-arm-cgo), const DLT_AOS ideal-int +pkg syscall (netbsd-arm-cgo), const DLT_APPLE_IP_OVER_IEEE1394 ideal-int +pkg syscall (netbsd-arm-cgo), const DLT_ARCNET ideal-int +pkg syscall (netbsd-arm-cgo), const DLT_ARCNET_LINUX ideal-int +pkg syscall (netbsd-arm-cgo), const DLT_ATM_CLIP ideal-int +pkg syscall (netbsd-arm-cgo), const DLT_ATM_RFC1483 ideal-int +pkg syscall (netbsd-arm-cgo), const DLT_AURORA ideal-int +pkg syscall (netbsd-arm-cgo), const DLT_AX25 ideal-int +pkg syscall (netbsd-arm-cgo), const DLT_AX25_KISS ideal-int +pkg syscall (netbsd-arm-cgo), const DLT_BACNET_MS_TP ideal-int +pkg syscall (netbsd-arm-cgo), const DLT_BLUETOOTH_HCI_H4 ideal-int +pkg syscall (netbsd-arm-cgo), const DLT_BLUETOOTH_HCI_H4_WITH_PHDR ideal-int +pkg syscall (netbsd-arm-cgo), const DLT_CAN20B ideal-int +pkg syscall (netbsd-arm-cgo), const DLT_CAN_SOCKETCAN ideal-int +pkg syscall (netbsd-arm-cgo), const DLT_CHAOS ideal-int +pkg syscall (netbsd-arm-cgo), const DLT_CISCO_IOS ideal-int +pkg syscall (netbsd-arm-cgo), const DLT_C_HDLC ideal-int +pkg syscall (netbsd-arm-cgo), const DLT_C_HDLC_WITH_DIR ideal-int +pkg syscall (netbsd-arm-cgo), const DLT_DECT ideal-int +pkg syscall (netbsd-arm-cgo), const DLT_DOCSIS ideal-int +pkg syscall (netbsd-arm-cgo), const DLT_ECONET ideal-int +pkg syscall (netbsd-arm-cgo), const DLT_EN10MB ideal-int +pkg syscall (netbsd-arm-cgo), const DLT_EN3MB ideal-int +pkg syscall (netbsd-arm-cgo), const DLT_ENC ideal-int +pkg syscall (netbsd-arm-cgo), const DLT_ERF ideal-int +pkg syscall (netbsd-arm-cgo), const DLT_ERF_ETH ideal-int +pkg syscall (netbsd-arm-cgo), const DLT_ERF_POS ideal-int +pkg syscall (netbsd-arm-cgo), const DLT_FC_2 ideal-int +pkg syscall (netbsd-arm-cgo), const DLT_FC_2_WITH_FRAME_DELIMS ideal-int +pkg syscall (netbsd-arm-cgo), const DLT_FDDI ideal-int +pkg syscall (netbsd-arm-cgo), const DLT_FLEXRAY ideal-int +pkg syscall (netbsd-arm-cgo), const DLT_FRELAY ideal-int +pkg syscall (netbsd-arm-cgo), const DLT_FRELAY_WITH_DIR ideal-int +pkg syscall (netbsd-arm-cgo), const DLT_GCOM_SERIAL ideal-int +pkg syscall (netbsd-arm-cgo), const DLT_GCOM_T1E1 ideal-int +pkg syscall (netbsd-arm-cgo), const DLT_GPF_F ideal-int +pkg syscall (netbsd-arm-cgo), const DLT_GPF_T ideal-int +pkg syscall (netbsd-arm-cgo), const DLT_GPRS_LLC ideal-int +pkg syscall (netbsd-arm-cgo), const DLT_GSMTAP_ABIS ideal-int +pkg syscall (netbsd-arm-cgo), const DLT_GSMTAP_UM ideal-int +pkg syscall (netbsd-arm-cgo), const DLT_HDLC ideal-int +pkg syscall (netbsd-arm-cgo), const DLT_HHDLC ideal-int +pkg syscall (netbsd-arm-cgo), const DLT_HIPPI ideal-int +pkg syscall (netbsd-arm-cgo), const DLT_IBM_SN ideal-int +pkg syscall (netbsd-arm-cgo), const DLT_IBM_SP ideal-int +pkg syscall (netbsd-arm-cgo), const DLT_IEEE802 ideal-int +pkg syscall (netbsd-arm-cgo), const DLT_IEEE802_11 ideal-int +pkg syscall (netbsd-arm-cgo), const DLT_IEEE802_11_RADIO ideal-int +pkg syscall (netbsd-arm-cgo), const DLT_IEEE802_11_RADIO_AVS ideal-int +pkg syscall (netbsd-arm-cgo), const DLT_IEEE802_15_4 ideal-int +pkg syscall (netbsd-arm-cgo), const DLT_IEEE802_15_4_LINUX ideal-int +pkg syscall (netbsd-arm-cgo), const DLT_IEEE802_15_4_NONASK_PHY ideal-int +pkg syscall (netbsd-arm-cgo), const DLT_IEEE802_16_MAC_CPS ideal-int +pkg syscall (netbsd-arm-cgo), const DLT_IEEE802_16_MAC_CPS_RADIO ideal-int +pkg syscall (netbsd-arm-cgo), const DLT_IPMB ideal-int +pkg syscall (netbsd-arm-cgo), const DLT_IPMB_LINUX ideal-int +pkg syscall (netbsd-arm-cgo), const DLT_IPNET ideal-int +pkg syscall (netbsd-arm-cgo), const DLT_IPV4 ideal-int +pkg syscall (netbsd-arm-cgo), const DLT_IPV6 ideal-int +pkg syscall (netbsd-arm-cgo), const DLT_IP_OVER_FC ideal-int +pkg syscall (netbsd-arm-cgo), const DLT_JUNIPER_ATM1 ideal-int +pkg syscall (netbsd-arm-cgo), const DLT_JUNIPER_ATM2 ideal-int +pkg syscall (netbsd-arm-cgo), const DLT_JUNIPER_CHDLC ideal-int +pkg syscall (netbsd-arm-cgo), const DLT_JUNIPER_ES ideal-int +pkg syscall (netbsd-arm-cgo), const DLT_JUNIPER_ETHER ideal-int +pkg syscall (netbsd-arm-cgo), const DLT_JUNIPER_FRELAY ideal-int +pkg syscall (netbsd-arm-cgo), const DLT_JUNIPER_GGSN ideal-int +pkg syscall (netbsd-arm-cgo), const DLT_JUNIPER_ISM ideal-int +pkg syscall (netbsd-arm-cgo), const DLT_JUNIPER_MFR ideal-int +pkg syscall (netbsd-arm-cgo), const DLT_JUNIPER_MLFR ideal-int +pkg syscall (netbsd-arm-cgo), const DLT_JUNIPER_MLPPP ideal-int +pkg syscall (netbsd-arm-cgo), const DLT_JUNIPER_MONITOR ideal-int +pkg syscall (netbsd-arm-cgo), const DLT_JUNIPER_PIC_PEER ideal-int +pkg syscall (netbsd-arm-cgo), const DLT_JUNIPER_PPP ideal-int +pkg syscall (netbsd-arm-cgo), const DLT_JUNIPER_PPPOE ideal-int +pkg syscall (netbsd-arm-cgo), const DLT_JUNIPER_PPPOE_ATM ideal-int +pkg syscall (netbsd-arm-cgo), const DLT_JUNIPER_SERVICES ideal-int +pkg syscall (netbsd-arm-cgo), const DLT_JUNIPER_ST ideal-int +pkg syscall (netbsd-arm-cgo), const DLT_JUNIPER_VP ideal-int +pkg syscall (netbsd-arm-cgo), const DLT_LAPB_WITH_DIR ideal-int +pkg syscall (netbsd-arm-cgo), const DLT_LAPD ideal-int +pkg syscall (netbsd-arm-cgo), const DLT_LIN ideal-int +pkg syscall (netbsd-arm-cgo), const DLT_LINUX_EVDEV ideal-int +pkg syscall (netbsd-arm-cgo), const DLT_LINUX_IRDA ideal-int +pkg syscall (netbsd-arm-cgo), const DLT_LINUX_LAPD ideal-int +pkg syscall (netbsd-arm-cgo), const DLT_LINUX_SLL ideal-int +pkg syscall (netbsd-arm-cgo), const DLT_LOOP ideal-int +pkg syscall (netbsd-arm-cgo), const DLT_LTALK ideal-int +pkg syscall (netbsd-arm-cgo), const DLT_MFR ideal-int +pkg syscall (netbsd-arm-cgo), const DLT_MOST ideal-int +pkg syscall (netbsd-arm-cgo), const DLT_MPLS ideal-int +pkg syscall (netbsd-arm-cgo), const DLT_MTP2 ideal-int +pkg syscall (netbsd-arm-cgo), const DLT_MTP2_WITH_PHDR ideal-int +pkg syscall (netbsd-arm-cgo), const DLT_MTP3 ideal-int +pkg syscall (netbsd-arm-cgo), const DLT_NULL ideal-int +pkg syscall (netbsd-arm-cgo), const DLT_PCI_EXP ideal-int +pkg syscall (netbsd-arm-cgo), const DLT_PFLOG ideal-int +pkg syscall (netbsd-arm-cgo), const DLT_PFSYNC ideal-int +pkg syscall (netbsd-arm-cgo), const DLT_PPI ideal-int +pkg syscall (netbsd-arm-cgo), const DLT_PPP ideal-int +pkg syscall (netbsd-arm-cgo), const DLT_PPP_BSDOS ideal-int +pkg syscall (netbsd-arm-cgo), const DLT_PPP_ETHER ideal-int +pkg syscall (netbsd-arm-cgo), const DLT_PPP_PPPD ideal-int +pkg syscall (netbsd-arm-cgo), const DLT_PPP_SERIAL ideal-int +pkg syscall (netbsd-arm-cgo), const DLT_PPP_WITH_DIR ideal-int +pkg syscall (netbsd-arm-cgo), const DLT_PRISM_HEADER ideal-int +pkg syscall (netbsd-arm-cgo), const DLT_PRONET ideal-int +pkg syscall (netbsd-arm-cgo), const DLT_RAIF1 ideal-int +pkg syscall (netbsd-arm-cgo), const DLT_RAW ideal-int +pkg syscall (netbsd-arm-cgo), const DLT_RAWAF_MASK ideal-int +pkg syscall (netbsd-arm-cgo), const DLT_RIO ideal-int +pkg syscall (netbsd-arm-cgo), const DLT_SCCP ideal-int +pkg syscall (netbsd-arm-cgo), const DLT_SITA ideal-int +pkg syscall (netbsd-arm-cgo), const DLT_SLIP ideal-int +pkg syscall (netbsd-arm-cgo), const DLT_SLIP_BSDOS ideal-int +pkg syscall (netbsd-arm-cgo), const DLT_SUNATM ideal-int +pkg syscall (netbsd-arm-cgo), const DLT_SYMANTEC_FIREWALL ideal-int +pkg syscall (netbsd-arm-cgo), const DLT_TZSP ideal-int +pkg syscall (netbsd-arm-cgo), const DLT_USB ideal-int +pkg syscall (netbsd-arm-cgo), const DLT_USB_LINUX ideal-int +pkg syscall (netbsd-arm-cgo), const DLT_USB_LINUX_MMAPPED ideal-int +pkg syscall (netbsd-arm-cgo), const DLT_WIHART ideal-int +pkg syscall (netbsd-arm-cgo), const DLT_X2E_SERIAL ideal-int +pkg syscall (netbsd-arm-cgo), const DLT_X2E_XORAYA ideal-int +pkg syscall (netbsd-arm-cgo), const DT_BLK ideal-int +pkg syscall (netbsd-arm-cgo), const DT_CHR ideal-int +pkg syscall (netbsd-arm-cgo), const DT_DIR ideal-int +pkg syscall (netbsd-arm-cgo), const DT_FIFO ideal-int +pkg syscall (netbsd-arm-cgo), const DT_LNK ideal-int +pkg syscall (netbsd-arm-cgo), const DT_REG ideal-int +pkg syscall (netbsd-arm-cgo), const DT_SOCK ideal-int +pkg syscall (netbsd-arm-cgo), const DT_UNKNOWN ideal-int +pkg syscall (netbsd-arm-cgo), const DT_WHT ideal-int +pkg syscall (netbsd-arm-cgo), const EAUTH Errno +pkg syscall (netbsd-arm-cgo), const EBADMSG Errno +pkg syscall (netbsd-arm-cgo), const EBADRPC Errno +pkg syscall (netbsd-arm-cgo), const ECHO ideal-int +pkg syscall (netbsd-arm-cgo), const ECHOCTL ideal-int +pkg syscall (netbsd-arm-cgo), const ECHOE ideal-int +pkg syscall (netbsd-arm-cgo), const ECHOK ideal-int +pkg syscall (netbsd-arm-cgo), const ECHOKE ideal-int +pkg syscall (netbsd-arm-cgo), const ECHONL ideal-int +pkg syscall (netbsd-arm-cgo), const ECHOPRT ideal-int +pkg syscall (netbsd-arm-cgo), const EFTYPE Errno +pkg syscall (netbsd-arm-cgo), const ELAST Errno +pkg syscall (netbsd-arm-cgo), const EMULTIHOP Errno +pkg syscall (netbsd-arm-cgo), const EMUL_LINUX ideal-int +pkg syscall (netbsd-arm-cgo), const EMUL_LINUX32 ideal-int +pkg syscall (netbsd-arm-cgo), const EMUL_MAXID ideal-int +pkg syscall (netbsd-arm-cgo), const ENEEDAUTH Errno +pkg syscall (netbsd-arm-cgo), const ENOATTR Errno +pkg syscall (netbsd-arm-cgo), const ENODATA Errno +pkg syscall (netbsd-arm-cgo), const ENOLINK Errno +pkg syscall (netbsd-arm-cgo), const ENOSR Errno +pkg syscall (netbsd-arm-cgo), const ENOSTR Errno +pkg syscall (netbsd-arm-cgo), const EPROCLIM Errno +pkg syscall (netbsd-arm-cgo), const EPROCUNAVAIL Errno +pkg syscall (netbsd-arm-cgo), const EPROGMISMATCH Errno +pkg syscall (netbsd-arm-cgo), const EPROGUNAVAIL Errno +pkg syscall (netbsd-arm-cgo), const EPROTO Errno +pkg syscall (netbsd-arm-cgo), const ERPCMISMATCH Errno +pkg syscall (netbsd-arm-cgo), const ETHERCAP_JUMBO_MTU ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERCAP_VLAN_HWTAGGING ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERCAP_VLAN_MTU ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERMIN ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERMTU ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERMTU_JUMBO ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_8023 ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_AARP ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_ACCTON ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_AEONIC ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_ALPHA ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_AMBER ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_AMOEBA ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_APOLLO ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_APOLLODOMAIN ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_APPLETALK ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_APPLITEK ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_ARGONAUT ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_ARP ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_AT ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_ATALK ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_ATOMIC ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_ATT ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_ATTSTANFORD ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_AUTOPHON ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_AXIS ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_BCLOOP ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_BOFL ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_CABLETRON ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_CHAOS ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_COMDESIGN ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_COMPUGRAPHIC ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_COUNTERPOINT ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_CRONUS ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_CRONUSVLN ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_DCA ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_DDE ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_DEBNI ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_DECAM ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_DECCUST ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_DECDIAG ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_DECDNS ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_DECDTS ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_DECEXPER ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_DECLAST ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_DECLTM ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_DECMUMPS ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_DECNETBIOS ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_DELTACON ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_DIDDLE ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_DLOG1 ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_DLOG2 ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_DN ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_DOGFIGHT ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_DSMD ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_ECMA ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_ENCRYPT ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_ES ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_EXCELAN ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_EXPERDATA ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_FLIP ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_FLOWCONTROL ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_FRARP ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_GENDYN ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_HAYES ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_HIPPI_FP ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_HITACHI ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_HP ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_IEEEPUP ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_IEEEPUPAT ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_IMLBL ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_IMLBLDIAG ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_IP ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_IPAS ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_IPV6 ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_IPX ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_IPXNEW ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_KALPANA ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_LANBRIDGE ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_LANPROBE ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_LAT ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_LBACK ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_LITTLE ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_LOGICRAFT ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_LOOPBACK ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_MATRA ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_MAX ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_MERIT ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_MICP ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_MOPDL ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_MOPRC ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_MOTOROLA ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_MPLS ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_MPLS_MCAST ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_MUMPS ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_NBPCC ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_NBPCLAIM ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_NBPCLREQ ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_NBPCLRSP ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_NBPCREQ ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_NBPCRSP ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_NBPDG ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_NBPDGB ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_NBPDLTE ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_NBPRAR ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_NBPRAS ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_NBPRST ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_NBPSCD ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_NBPVCD ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_NBS ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_NCD ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_NESTAR ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_NETBEUI ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_NOVELL ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_NS ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_NSAT ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_NSCOMPAT ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_NTRAILER ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_OS9 ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_OS9NET ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_PACER ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_PAE ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_PCS ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_PLANNING ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_PPP ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_PPPOE ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_PPPOEDISC ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_PRIMENTS ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_PUP ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_PUPAT ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_RACAL ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_RATIONAL ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_RAWFR ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_RCL ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_RDP ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_RETIX ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_REVARP ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_SCA ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_SECTRA ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_SECUREDATA ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_SGITW ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_SG_BOUNCE ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_SG_DIAG ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_SG_NETGAMES ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_SG_RESV ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_SIMNET ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_SLOWPROTOCOLS ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_SNA ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_SNMP ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_SONIX ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_SPIDER ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_SPRITE ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_STP ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_TALARIS ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_TALARISMC ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_TCPCOMP ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_TCPSM ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_TEC ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_TIGAN ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_TRAIL ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_TRANSETHER ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_TYMSHARE ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_UBBST ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_UBDEBUG ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_UBDIAGLOOP ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_UBDL ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_UBNIU ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_UBNMC ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_VALID ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_VARIAN ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_VAXELN ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_VEECO ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_VEXP ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_VGLAB ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_VINES ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_VINESECHO ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_VINESLOOP ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_VITAL ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_VLAN ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_VLTLMAN ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_VPROD ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_VURESERVED ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_WATERLOO ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_WELLFLEET ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_X25 ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_X75 ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_XNSSM ideal-int +pkg syscall (netbsd-arm-cgo), const ETHERTYPE_XTP ideal-int +pkg syscall (netbsd-arm-cgo), const ETHER_ADDR_LEN ideal-int +pkg syscall (netbsd-arm-cgo), const ETHER_CRC_LEN ideal-int +pkg syscall (netbsd-arm-cgo), const ETHER_CRC_POLY_BE ideal-int +pkg syscall (netbsd-arm-cgo), const ETHER_CRC_POLY_LE ideal-int +pkg syscall (netbsd-arm-cgo), const ETHER_HDR_LEN ideal-int +pkg syscall (netbsd-arm-cgo), const ETHER_MAX_LEN ideal-int +pkg syscall (netbsd-arm-cgo), const ETHER_MAX_LEN_JUMBO ideal-int +pkg syscall (netbsd-arm-cgo), const ETHER_MIN_LEN ideal-int +pkg syscall (netbsd-arm-cgo), const ETHER_PPPOE_ENCAP_LEN ideal-int +pkg syscall (netbsd-arm-cgo), const ETHER_TYPE_LEN ideal-int +pkg syscall (netbsd-arm-cgo), const ETHER_VLAN_ENCAP_LEN ideal-int +pkg syscall (netbsd-arm-cgo), const ETIME Errno +pkg syscall (netbsd-arm-cgo), const EVFILT_AIO ideal-int +pkg syscall (netbsd-arm-cgo), const EVFILT_PROC ideal-int +pkg syscall (netbsd-arm-cgo), const EVFILT_READ ideal-int +pkg syscall (netbsd-arm-cgo), const EVFILT_SIGNAL ideal-int +pkg syscall (netbsd-arm-cgo), const EVFILT_SYSCOUNT ideal-int +pkg syscall (netbsd-arm-cgo), const EVFILT_TIMER ideal-int +pkg syscall (netbsd-arm-cgo), const EVFILT_VNODE ideal-int +pkg syscall (netbsd-arm-cgo), const EVFILT_WRITE ideal-int +pkg syscall (netbsd-arm-cgo), const EV_ADD ideal-int +pkg syscall (netbsd-arm-cgo), const EV_CLEAR ideal-int +pkg syscall (netbsd-arm-cgo), const EV_DELETE ideal-int +pkg syscall (netbsd-arm-cgo), const EV_DISABLE ideal-int +pkg syscall (netbsd-arm-cgo), const EV_ENABLE ideal-int +pkg syscall (netbsd-arm-cgo), const EV_EOF ideal-int +pkg syscall (netbsd-arm-cgo), const EV_ERROR ideal-int +pkg syscall (netbsd-arm-cgo), const EV_FLAG1 ideal-int +pkg syscall (netbsd-arm-cgo), const EV_ONESHOT ideal-int +pkg syscall (netbsd-arm-cgo), const EV_SYSFLAGS ideal-int +pkg syscall (netbsd-arm-cgo), const EXTA ideal-int +pkg syscall (netbsd-arm-cgo), const EXTB ideal-int +pkg syscall (netbsd-arm-cgo), const EXTPROC ideal-int +pkg syscall (netbsd-arm-cgo), const FD_CLOEXEC ideal-int +pkg syscall (netbsd-arm-cgo), const FD_SETSIZE ideal-int +pkg syscall (netbsd-arm-cgo), const FLUSHO ideal-int +pkg syscall (netbsd-arm-cgo), const F_CLOSEM ideal-int +pkg syscall (netbsd-arm-cgo), const F_DUPFD ideal-int +pkg syscall (netbsd-arm-cgo), const F_DUPFD_CLOEXEC ideal-int +pkg syscall (netbsd-arm-cgo), const F_FSCTL ideal-int +pkg syscall (netbsd-arm-cgo), const F_FSDIRMASK ideal-int +pkg syscall (netbsd-arm-cgo), const F_FSIN ideal-int +pkg syscall (netbsd-arm-cgo), const F_FSINOUT ideal-int +pkg syscall (netbsd-arm-cgo), const F_FSOUT ideal-int +pkg syscall (netbsd-arm-cgo), const F_FSPRIV ideal-int +pkg syscall (netbsd-arm-cgo), const F_FSVOID ideal-int +pkg syscall (netbsd-arm-cgo), const F_GETFD ideal-int +pkg syscall (netbsd-arm-cgo), const F_GETFL ideal-int +pkg syscall (netbsd-arm-cgo), const F_GETLK ideal-int +pkg syscall (netbsd-arm-cgo), const F_GETNOSIGPIPE ideal-int +pkg syscall (netbsd-arm-cgo), const F_GETOWN ideal-int +pkg syscall (netbsd-arm-cgo), const F_MAXFD ideal-int +pkg syscall (netbsd-arm-cgo), const F_OK ideal-int +pkg syscall (netbsd-arm-cgo), const F_PARAM_MASK ideal-int +pkg syscall (netbsd-arm-cgo), const F_PARAM_MAX ideal-int +pkg syscall (netbsd-arm-cgo), const F_RDLCK ideal-int +pkg syscall (netbsd-arm-cgo), const F_SETFD ideal-int +pkg syscall (netbsd-arm-cgo), const F_SETFL ideal-int +pkg syscall (netbsd-arm-cgo), const F_SETLK ideal-int +pkg syscall (netbsd-arm-cgo), const F_SETLKW ideal-int +pkg syscall (netbsd-arm-cgo), const F_SETNOSIGPIPE ideal-int +pkg syscall (netbsd-arm-cgo), const F_SETOWN ideal-int +pkg syscall (netbsd-arm-cgo), const F_UNLCK ideal-int +pkg syscall (netbsd-arm-cgo), const F_WRLCK ideal-int +pkg syscall (netbsd-arm-cgo), const HUPCL ideal-int +pkg syscall (netbsd-arm-cgo), const ICANON ideal-int +pkg syscall (netbsd-arm-cgo), const ICMP6_FILTER = 18 +pkg syscall (netbsd-arm-cgo), const ICMP6_FILTER ideal-int +pkg syscall (netbsd-arm-cgo), const ICRNL ideal-int +pkg syscall (netbsd-arm-cgo), const IEXTEN ideal-int +pkg syscall (netbsd-arm-cgo), const IFAN_ARRIVAL ideal-int +pkg syscall (netbsd-arm-cgo), const IFAN_DEPARTURE ideal-int +pkg syscall (netbsd-arm-cgo), const IFA_ROUTE ideal-int +pkg syscall (netbsd-arm-cgo), const IFF_ALLMULTI ideal-int +pkg syscall (netbsd-arm-cgo), const IFF_CANTCHANGE ideal-int +pkg syscall (netbsd-arm-cgo), const IFF_DEBUG ideal-int +pkg syscall (netbsd-arm-cgo), const IFF_LINK0 ideal-int +pkg syscall (netbsd-arm-cgo), const IFF_LINK1 ideal-int +pkg syscall (netbsd-arm-cgo), const IFF_LINK2 ideal-int +pkg syscall (netbsd-arm-cgo), const IFF_NOARP ideal-int +pkg syscall (netbsd-arm-cgo), const IFF_NOTRAILERS ideal-int +pkg syscall (netbsd-arm-cgo), const IFF_OACTIVE ideal-int +pkg syscall (netbsd-arm-cgo), const IFF_POINTOPOINT ideal-int +pkg syscall (netbsd-arm-cgo), const IFF_PROMISC ideal-int +pkg syscall (netbsd-arm-cgo), const IFF_RUNNING ideal-int +pkg syscall (netbsd-arm-cgo), const IFF_SIMPLEX ideal-int +pkg syscall (netbsd-arm-cgo), const IFNAMSIZ ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_1822 ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_A12MPPSWITCH ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_AAL2 ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_AAL5 ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_ADSL ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_AFLANE8023 ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_AFLANE8025 ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_ARAP ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_ARCNET ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_ARCNETPLUS ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_ASYNC ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_ATM ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_ATMDXI ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_ATMFUNI ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_ATMIMA ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_ATMLOGICAL ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_ATMRADIO ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_ATMSUBINTERFACE ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_ATMVCIENDPT ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_ATMVIRTUAL ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_BGPPOLICYACCOUNTING ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_BRIDGE ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_BSC ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_CARP ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_CCTEMUL ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_CEPT ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_CES ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_CHANNEL ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_CNR ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_COFFEE ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_COMPOSITELINK ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_DCN ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_DIGITALPOWERLINE ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_DIGITALWRAPPEROVERHEADCHANNEL ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_DLSW ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_DOCSCABLEDOWNSTREAM ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_DOCSCABLEMACLAYER ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_DOCSCABLEUPSTREAM ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_DOCSCABLEUPSTREAMCHANNEL ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_DS0 ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_DS0BUNDLE ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_DS1FDL ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_DS3 ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_DTM ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_DVBASILN ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_DVBASIOUT ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_DVBRCCDOWNSTREAM ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_DVBRCCMACLAYER ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_DVBRCCUPSTREAM ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_ECONET ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_EON ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_EPLRS ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_ESCON ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_ETHER ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_FAITH ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_FAST ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_FASTETHER ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_FASTETHERFX ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_FDDI ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_FIBRECHANNEL ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_FRAMERELAYINTERCONNECT ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_FRAMERELAYMPI ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_FRDLCIENDPT ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_FRELAY ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_FRELAYDCE ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_FRF16MFRBUNDLE ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_FRFORWARD ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_G703AT2MB ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_G703AT64K ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_GIF ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_GIGABITETHERNET ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_GR303IDT ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_GR303RDT ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_H323GATEKEEPER ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_H323PROXY ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_HDH1822 ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_HDLC ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_HDSL2 ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_HIPERLAN2 ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_HIPPI ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_HIPPIINTERFACE ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_HOSTPAD ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_HSSI ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_HY ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_IBM370PARCHAN ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_IDSL ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_IEEE1394 ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_IEEE80211 ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_IEEE80212 ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_IEEE8023ADLAG ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_IFGSN ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_IMT ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_INFINIBAND ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_INTERLEAVE ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_IP ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_IPFORWARD ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_IPOVERATM ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_IPOVERCDLC ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_IPOVERCLAW ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_IPSWITCH ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_ISDN ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_ISDNBASIC ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_ISDNPRIMARY ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_ISDNS ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_ISDNU ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_ISO88022LLC ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_ISO88023 ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_ISO88024 ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_ISO88025 ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_ISO88025CRFPINT ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_ISO88025DTR ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_ISO88025FIBER ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_ISO88026 ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_ISUP ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_L2VLAN ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_L3IPVLAN ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_L3IPXVLAN ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_LAPB ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_LAPD ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_LAPF ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_LINEGROUP ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_LOCALTALK ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_LOOP ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_MEDIAMAILOVERIP ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_MFSIGLINK ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_MIOX25 ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_MODEM ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_MPC ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_MPLS ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_MPLSTUNNEL ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_MSDSL ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_MVL ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_MYRINET ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_NFAS ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_NSIP ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_OPTICALCHANNEL ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_OPTICALTRANSPORT ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_OTHER ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_P10 ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_P80 ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_PARA ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_PFLOG ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_PFSYNC ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_PLC ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_PON155 ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_PON622 ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_POS ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_PPP ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_PPPMULTILINKBUNDLE ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_PROPATM ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_PROPBWAP2MP ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_PROPCNLS ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_PROPDOCSWIRELESSDOWNSTREAM ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_PROPDOCSWIRELESSMACLAYER ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_PROPDOCSWIRELESSUPSTREAM ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_PROPMUX ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_PROPVIRTUAL ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_PROPWIRELESSP2P ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_PTPSERIAL ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_PVC ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_Q2931 ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_QLLC ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_RADIOMAC ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_RADSL ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_REACHDSL ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_RFC1483 ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_RS232 ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_RSRB ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_SDLC ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_SDSL ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_SHDSL ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_SIP ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_SIPSIG ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_SIPTG ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_SLIP ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_SMDSDXI ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_SMDSICIP ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_SONET ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_SONETOVERHEADCHANNEL ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_SONETPATH ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_SONETVT ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_SRP ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_SS7SIGLINK ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_STACKTOSTACK ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_STARLAN ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_STF ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_T1 ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_TDLC ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_TELINK ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_TERMPAD ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_TR008 ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_TRANSPHDLC ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_TUNNEL ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_ULTRA ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_USB ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_V11 ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_V35 ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_V36 ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_V37 ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_VDSL ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_VIRTUALIPADDRESS ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_VIRTUALTG ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_VOICEDID ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_VOICEEM ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_VOICEEMFGD ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_VOICEENCAP ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_VOICEFGDEANA ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_VOICEFXO ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_VOICEFXS ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_VOICEOVERATM ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_VOICEOVERCABLE ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_VOICEOVERFRAMERELAY ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_VOICEOVERIP ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_X213 ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_X25 ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_X25DDN ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_X25HUNTGROUP ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_X25MLP ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_X25PLE ideal-int +pkg syscall (netbsd-arm-cgo), const IFT_XETHER ideal-int +pkg syscall (netbsd-arm-cgo), const IGNBRK ideal-int +pkg syscall (netbsd-arm-cgo), const IGNCR ideal-int +pkg syscall (netbsd-arm-cgo), const IGNPAR ideal-int +pkg syscall (netbsd-arm-cgo), const IMAXBEL ideal-int +pkg syscall (netbsd-arm-cgo), const INLCR ideal-int +pkg syscall (netbsd-arm-cgo), const INPCK ideal-int +pkg syscall (netbsd-arm-cgo), const IN_CLASSA_HOST ideal-int +pkg syscall (netbsd-arm-cgo), const IN_CLASSA_MAX ideal-int +pkg syscall (netbsd-arm-cgo), const IN_CLASSA_NET ideal-int +pkg syscall (netbsd-arm-cgo), const IN_CLASSA_NSHIFT ideal-int +pkg syscall (netbsd-arm-cgo), const IN_CLASSB_HOST ideal-int +pkg syscall (netbsd-arm-cgo), const IN_CLASSB_MAX ideal-int +pkg syscall (netbsd-arm-cgo), const IN_CLASSB_NET ideal-int +pkg syscall (netbsd-arm-cgo), const IN_CLASSB_NSHIFT ideal-int +pkg syscall (netbsd-arm-cgo), const IN_CLASSC_HOST ideal-int +pkg syscall (netbsd-arm-cgo), const IN_CLASSC_NET ideal-int +pkg syscall (netbsd-arm-cgo), const IN_CLASSC_NSHIFT ideal-int +pkg syscall (netbsd-arm-cgo), const IN_CLASSD_HOST ideal-int +pkg syscall (netbsd-arm-cgo), const IN_CLASSD_NET ideal-int +pkg syscall (netbsd-arm-cgo), const IN_CLASSD_NSHIFT ideal-int +pkg syscall (netbsd-arm-cgo), const IN_LOOPBACKNET ideal-int +pkg syscall (netbsd-arm-cgo), const IPPROTO_AH ideal-int +pkg syscall (netbsd-arm-cgo), const IPPROTO_CARP ideal-int +pkg syscall (netbsd-arm-cgo), const IPPROTO_DONE ideal-int +pkg syscall (netbsd-arm-cgo), const IPPROTO_DSTOPTS ideal-int +pkg syscall (netbsd-arm-cgo), const IPPROTO_EGP ideal-int +pkg syscall (netbsd-arm-cgo), const IPPROTO_ENCAP ideal-int +pkg syscall (netbsd-arm-cgo), const IPPROTO_EON ideal-int +pkg syscall (netbsd-arm-cgo), const IPPROTO_ESP ideal-int +pkg syscall (netbsd-arm-cgo), const IPPROTO_ETHERIP ideal-int +pkg syscall (netbsd-arm-cgo), const IPPROTO_FRAGMENT ideal-int +pkg syscall (netbsd-arm-cgo), const IPPROTO_GGP ideal-int +pkg syscall (netbsd-arm-cgo), const IPPROTO_GRE ideal-int +pkg syscall (netbsd-arm-cgo), const IPPROTO_HOPOPTS ideal-int +pkg syscall (netbsd-arm-cgo), const IPPROTO_ICMP ideal-int +pkg syscall (netbsd-arm-cgo), const IPPROTO_ICMPV6 ideal-int +pkg syscall (netbsd-arm-cgo), const IPPROTO_IDP ideal-int +pkg syscall (netbsd-arm-cgo), const IPPROTO_IGMP ideal-int +pkg syscall (netbsd-arm-cgo), const IPPROTO_IPCOMP ideal-int +pkg syscall (netbsd-arm-cgo), const IPPROTO_IPIP ideal-int +pkg syscall (netbsd-arm-cgo), const IPPROTO_IPV4 ideal-int +pkg syscall (netbsd-arm-cgo), const IPPROTO_IPV6_ICMP ideal-int +pkg syscall (netbsd-arm-cgo), const IPPROTO_MAX ideal-int +pkg syscall (netbsd-arm-cgo), const IPPROTO_MAXID ideal-int +pkg syscall (netbsd-arm-cgo), const IPPROTO_MOBILE ideal-int +pkg syscall (netbsd-arm-cgo), const IPPROTO_NONE ideal-int +pkg syscall (netbsd-arm-cgo), const IPPROTO_PFSYNC ideal-int +pkg syscall (netbsd-arm-cgo), const IPPROTO_PIM ideal-int +pkg syscall (netbsd-arm-cgo), const IPPROTO_PUP ideal-int +pkg syscall (netbsd-arm-cgo), const IPPROTO_RAW ideal-int +pkg syscall (netbsd-arm-cgo), const IPPROTO_ROUTING ideal-int +pkg syscall (netbsd-arm-cgo), const IPPROTO_RSVP ideal-int +pkg syscall (netbsd-arm-cgo), const IPPROTO_TP ideal-int +pkg syscall (netbsd-arm-cgo), const IPPROTO_VRRP ideal-int +pkg syscall (netbsd-arm-cgo), const IPV6_CHECKSUM ideal-int +pkg syscall (netbsd-arm-cgo), const IPV6_DEFAULT_MULTICAST_HOPS ideal-int +pkg syscall (netbsd-arm-cgo), const IPV6_DEFAULT_MULTICAST_LOOP ideal-int +pkg syscall (netbsd-arm-cgo), const IPV6_DEFHLIM ideal-int +pkg syscall (netbsd-arm-cgo), const IPV6_DONTFRAG ideal-int +pkg syscall (netbsd-arm-cgo), const IPV6_DSTOPTS ideal-int +pkg syscall (netbsd-arm-cgo), const IPV6_FAITH ideal-int +pkg syscall (netbsd-arm-cgo), const IPV6_FLOWINFO_MASK ideal-int +pkg syscall (netbsd-arm-cgo), const IPV6_FLOWLABEL_MASK ideal-int +pkg syscall (netbsd-arm-cgo), const IPV6_FRAGTTL ideal-int +pkg syscall (netbsd-arm-cgo), const IPV6_HLIMDEC ideal-int +pkg syscall (netbsd-arm-cgo), const IPV6_HOPLIMIT ideal-int +pkg syscall (netbsd-arm-cgo), const IPV6_HOPOPTS ideal-int +pkg syscall (netbsd-arm-cgo), const IPV6_IPSEC_POLICY ideal-int +pkg syscall (netbsd-arm-cgo), const IPV6_MAXHLIM ideal-int +pkg syscall (netbsd-arm-cgo), const IPV6_MAXPACKET ideal-int +pkg syscall (netbsd-arm-cgo), const IPV6_MMTU ideal-int +pkg syscall (netbsd-arm-cgo), const IPV6_NEXTHOP ideal-int +pkg syscall (netbsd-arm-cgo), const IPV6_PATHMTU ideal-int +pkg syscall (netbsd-arm-cgo), const IPV6_PKTINFO ideal-int +pkg syscall (netbsd-arm-cgo), const IPV6_PORTRANGE ideal-int +pkg syscall (netbsd-arm-cgo), const IPV6_PORTRANGE_DEFAULT ideal-int +pkg syscall (netbsd-arm-cgo), const IPV6_PORTRANGE_HIGH ideal-int +pkg syscall (netbsd-arm-cgo), const IPV6_PORTRANGE_LOW ideal-int +pkg syscall (netbsd-arm-cgo), const IPV6_RECVDSTOPTS ideal-int +pkg syscall (netbsd-arm-cgo), const IPV6_RECVHOPLIMIT ideal-int +pkg syscall (netbsd-arm-cgo), const IPV6_RECVHOPOPTS ideal-int +pkg syscall (netbsd-arm-cgo), const IPV6_RECVPATHMTU ideal-int +pkg syscall (netbsd-arm-cgo), const IPV6_RECVPKTINFO ideal-int +pkg syscall (netbsd-arm-cgo), const IPV6_RECVRTHDR ideal-int +pkg syscall (netbsd-arm-cgo), const IPV6_RECVTCLASS ideal-int +pkg syscall (netbsd-arm-cgo), const IPV6_RTHDR ideal-int +pkg syscall (netbsd-arm-cgo), const IPV6_RTHDRDSTOPTS ideal-int +pkg syscall (netbsd-arm-cgo), const IPV6_RTHDR_LOOSE ideal-int +pkg syscall (netbsd-arm-cgo), const IPV6_RTHDR_STRICT ideal-int +pkg syscall (netbsd-arm-cgo), const IPV6_RTHDR_TYPE_0 ideal-int +pkg syscall (netbsd-arm-cgo), const IPV6_SOCKOPT_RESERVED1 ideal-int +pkg syscall (netbsd-arm-cgo), const IPV6_TCLASS ideal-int +pkg syscall (netbsd-arm-cgo), const IPV6_USE_MIN_MTU ideal-int +pkg syscall (netbsd-arm-cgo), const IPV6_VERSION ideal-int +pkg syscall (netbsd-arm-cgo), const IPV6_VERSION_MASK ideal-int +pkg syscall (netbsd-arm-cgo), const IP_DEFAULT_MULTICAST_LOOP ideal-int +pkg syscall (netbsd-arm-cgo), const IP_DEFAULT_MULTICAST_TTL ideal-int +pkg syscall (netbsd-arm-cgo), const IP_DF ideal-int +pkg syscall (netbsd-arm-cgo), const IP_EF ideal-int +pkg syscall (netbsd-arm-cgo), const IP_ERRORMTU ideal-int +pkg syscall (netbsd-arm-cgo), const IP_HDRINCL ideal-int +pkg syscall (netbsd-arm-cgo), const IP_IPSEC_POLICY ideal-int +pkg syscall (netbsd-arm-cgo), const IP_MAXPACKET ideal-int +pkg syscall (netbsd-arm-cgo), const IP_MAX_MEMBERSHIPS ideal-int +pkg syscall (netbsd-arm-cgo), const IP_MF ideal-int +pkg syscall (netbsd-arm-cgo), const IP_MINFRAGSIZE ideal-int +pkg syscall (netbsd-arm-cgo), const IP_MINTTL ideal-int +pkg syscall (netbsd-arm-cgo), const IP_MSS ideal-int +pkg syscall (netbsd-arm-cgo), const IP_OFFMASK ideal-int +pkg syscall (netbsd-arm-cgo), const IP_OPTIONS ideal-int +pkg syscall (netbsd-arm-cgo), const IP_PORTRANGE ideal-int +pkg syscall (netbsd-arm-cgo), const IP_PORTRANGE_DEFAULT ideal-int +pkg syscall (netbsd-arm-cgo), const IP_PORTRANGE_HIGH ideal-int +pkg syscall (netbsd-arm-cgo), const IP_PORTRANGE_LOW ideal-int +pkg syscall (netbsd-arm-cgo), const IP_RECVDSTADDR ideal-int +pkg syscall (netbsd-arm-cgo), const IP_RECVIF ideal-int +pkg syscall (netbsd-arm-cgo), const IP_RECVOPTS ideal-int +pkg syscall (netbsd-arm-cgo), const IP_RECVRETOPTS ideal-int +pkg syscall (netbsd-arm-cgo), const IP_RECVTTL ideal-int +pkg syscall (netbsd-arm-cgo), const IP_RETOPTS ideal-int +pkg syscall (netbsd-arm-cgo), const IP_RF ideal-int +pkg syscall (netbsd-arm-cgo), const ISIG ideal-int +pkg syscall (netbsd-arm-cgo), const ISTRIP ideal-int +pkg syscall (netbsd-arm-cgo), const IXANY ideal-int +pkg syscall (netbsd-arm-cgo), const IXOFF ideal-int +pkg syscall (netbsd-arm-cgo), const IXON ideal-int +pkg syscall (netbsd-arm-cgo), const LOCK_EX ideal-int +pkg syscall (netbsd-arm-cgo), const LOCK_NB ideal-int +pkg syscall (netbsd-arm-cgo), const LOCK_SH ideal-int +pkg syscall (netbsd-arm-cgo), const LOCK_UN ideal-int +pkg syscall (netbsd-arm-cgo), const MSG_BCAST ideal-int +pkg syscall (netbsd-arm-cgo), const MSG_CMSG_CLOEXEC ideal-int +pkg syscall (netbsd-arm-cgo), const MSG_CONTROLMBUF ideal-int +pkg syscall (netbsd-arm-cgo), const MSG_CTRUNC ideal-int +pkg syscall (netbsd-arm-cgo), const MSG_DONTROUTE ideal-int +pkg syscall (netbsd-arm-cgo), const MSG_DONTWAIT ideal-int +pkg syscall (netbsd-arm-cgo), const MSG_EOR ideal-int +pkg syscall (netbsd-arm-cgo), const MSG_IOVUSRSPACE ideal-int +pkg syscall (netbsd-arm-cgo), const MSG_LENUSRSPACE ideal-int +pkg syscall (netbsd-arm-cgo), const MSG_MCAST ideal-int +pkg syscall (netbsd-arm-cgo), const MSG_NAMEMBUF ideal-int +pkg syscall (netbsd-arm-cgo), const MSG_NBIO ideal-int +pkg syscall (netbsd-arm-cgo), const MSG_NOSIGNAL ideal-int +pkg syscall (netbsd-arm-cgo), const MSG_OOB ideal-int +pkg syscall (netbsd-arm-cgo), const MSG_PEEK ideal-int +pkg syscall (netbsd-arm-cgo), const MSG_TRUNC ideal-int +pkg syscall (netbsd-arm-cgo), const MSG_USERFLAGS ideal-int +pkg syscall (netbsd-arm-cgo), const MSG_WAITALL ideal-int +pkg syscall (netbsd-arm-cgo), const NAME_MAX ideal-int +pkg syscall (netbsd-arm-cgo), const NET_RT_DUMP ideal-int +pkg syscall (netbsd-arm-cgo), const NET_RT_FLAGS ideal-int +pkg syscall (netbsd-arm-cgo), const NET_RT_IFLIST ideal-int +pkg syscall (netbsd-arm-cgo), const NET_RT_MAXID ideal-int +pkg syscall (netbsd-arm-cgo), const NET_RT_OIFLIST ideal-int +pkg syscall (netbsd-arm-cgo), const NET_RT_OOIFLIST ideal-int +pkg syscall (netbsd-arm-cgo), const NOFLSH ideal-int +pkg syscall (netbsd-arm-cgo), const NOTE_ATTRIB ideal-int +pkg syscall (netbsd-arm-cgo), const NOTE_CHILD ideal-int +pkg syscall (netbsd-arm-cgo), const NOTE_DELETE ideal-int +pkg syscall (netbsd-arm-cgo), const NOTE_EXEC ideal-int +pkg syscall (netbsd-arm-cgo), const NOTE_EXIT ideal-int +pkg syscall (netbsd-arm-cgo), const NOTE_EXTEND ideal-int +pkg syscall (netbsd-arm-cgo), const NOTE_FORK ideal-int +pkg syscall (netbsd-arm-cgo), const NOTE_LINK ideal-int +pkg syscall (netbsd-arm-cgo), const NOTE_LOWAT ideal-int +pkg syscall (netbsd-arm-cgo), const NOTE_PCTRLMASK ideal-int +pkg syscall (netbsd-arm-cgo), const NOTE_PDATAMASK ideal-int +pkg syscall (netbsd-arm-cgo), const NOTE_RENAME ideal-int +pkg syscall (netbsd-arm-cgo), const NOTE_REVOKE ideal-int +pkg syscall (netbsd-arm-cgo), const NOTE_TRACK ideal-int +pkg syscall (netbsd-arm-cgo), const NOTE_TRACKERR ideal-int +pkg syscall (netbsd-arm-cgo), const NOTE_WRITE ideal-int +pkg syscall (netbsd-arm-cgo), const OCRNL ideal-int +pkg syscall (netbsd-arm-cgo), const OFIOGETBMAP ideal-int +pkg syscall (netbsd-arm-cgo), const ONLCR ideal-int +pkg syscall (netbsd-arm-cgo), const ONLRET ideal-int +pkg syscall (netbsd-arm-cgo), const ONOCR ideal-int +pkg syscall (netbsd-arm-cgo), const ONOEOT ideal-int +pkg syscall (netbsd-arm-cgo), const OPOST ideal-int +pkg syscall (netbsd-arm-cgo), const O_ACCMODE ideal-int +pkg syscall (netbsd-arm-cgo), const O_ALT_IO ideal-int +pkg syscall (netbsd-arm-cgo), const O_DIRECT ideal-int +pkg syscall (netbsd-arm-cgo), const O_DIRECTORY ideal-int +pkg syscall (netbsd-arm-cgo), const O_DSYNC ideal-int +pkg syscall (netbsd-arm-cgo), const O_EXLOCK ideal-int +pkg syscall (netbsd-arm-cgo), const O_FSYNC ideal-int +pkg syscall (netbsd-arm-cgo), const O_NDELAY ideal-int +pkg syscall (netbsd-arm-cgo), const O_NOFOLLOW ideal-int +pkg syscall (netbsd-arm-cgo), const O_NOSIGPIPE ideal-int +pkg syscall (netbsd-arm-cgo), const O_RSYNC ideal-int +pkg syscall (netbsd-arm-cgo), const O_SHLOCK ideal-int +pkg syscall (netbsd-arm-cgo), const PARENB ideal-int +pkg syscall (netbsd-arm-cgo), const PARMRK ideal-int +pkg syscall (netbsd-arm-cgo), const PARODD ideal-int +pkg syscall (netbsd-arm-cgo), const PENDIN ideal-int +pkg syscall (netbsd-arm-cgo), const PRIO_PGRP = 1 +pkg syscall (netbsd-arm-cgo), const PRIO_PGRP ideal-int +pkg syscall (netbsd-arm-cgo), const PRIO_PROCESS = 0 +pkg syscall (netbsd-arm-cgo), const PRIO_PROCESS ideal-int +pkg syscall (netbsd-arm-cgo), const PRIO_USER = 2 +pkg syscall (netbsd-arm-cgo), const PRIO_USER ideal-int +pkg syscall (netbsd-arm-cgo), const PRI_IOFLUSH ideal-int +pkg syscall (netbsd-arm-cgo), const PTRACE_CONT ideal-int +pkg syscall (netbsd-arm-cgo), const PTRACE_KILL ideal-int +pkg syscall (netbsd-arm-cgo), const PTRACE_TRACEME ideal-int +pkg syscall (netbsd-arm-cgo), const RLIMIT_AS ideal-int +pkg syscall (netbsd-arm-cgo), const RLIMIT_CORE ideal-int +pkg syscall (netbsd-arm-cgo), const RLIMIT_CPU ideal-int +pkg syscall (netbsd-arm-cgo), const RLIMIT_DATA ideal-int +pkg syscall (netbsd-arm-cgo), const RLIMIT_FSIZE ideal-int +pkg syscall (netbsd-arm-cgo), const RLIMIT_NOFILE ideal-int +pkg syscall (netbsd-arm-cgo), const RLIMIT_STACK ideal-int +pkg syscall (netbsd-arm-cgo), const RLIM_INFINITY ideal-int +pkg syscall (netbsd-arm-cgo), const RTAX_AUTHOR ideal-int +pkg syscall (netbsd-arm-cgo), const RTAX_BRD ideal-int +pkg syscall (netbsd-arm-cgo), const RTAX_DST ideal-int +pkg syscall (netbsd-arm-cgo), const RTAX_GATEWAY ideal-int +pkg syscall (netbsd-arm-cgo), const RTAX_GENMASK ideal-int +pkg syscall (netbsd-arm-cgo), const RTAX_IFA ideal-int +pkg syscall (netbsd-arm-cgo), const RTAX_IFP ideal-int +pkg syscall (netbsd-arm-cgo), const RTAX_MAX ideal-int +pkg syscall (netbsd-arm-cgo), const RTAX_NETMASK ideal-int +pkg syscall (netbsd-arm-cgo), const RTAX_TAG ideal-int +pkg syscall (netbsd-arm-cgo), const RTA_AUTHOR ideal-int +pkg syscall (netbsd-arm-cgo), const RTA_BRD ideal-int +pkg syscall (netbsd-arm-cgo), const RTA_DST ideal-int +pkg syscall (netbsd-arm-cgo), const RTA_GATEWAY ideal-int +pkg syscall (netbsd-arm-cgo), const RTA_GENMASK ideal-int +pkg syscall (netbsd-arm-cgo), const RTA_IFA ideal-int +pkg syscall (netbsd-arm-cgo), const RTA_IFP ideal-int +pkg syscall (netbsd-arm-cgo), const RTA_NETMASK ideal-int +pkg syscall (netbsd-arm-cgo), const RTA_TAG ideal-int +pkg syscall (netbsd-arm-cgo), const RTF_ANNOUNCE ideal-int +pkg syscall (netbsd-arm-cgo), const RTF_BLACKHOLE ideal-int +pkg syscall (netbsd-arm-cgo), const RTF_CLONED ideal-int +pkg syscall (netbsd-arm-cgo), const RTF_CLONING ideal-int +pkg syscall (netbsd-arm-cgo), const RTF_DONE ideal-int +pkg syscall (netbsd-arm-cgo), const RTF_DYNAMIC ideal-int +pkg syscall (netbsd-arm-cgo), const RTF_GATEWAY ideal-int +pkg syscall (netbsd-arm-cgo), const RTF_HOST ideal-int +pkg syscall (netbsd-arm-cgo), const RTF_LLINFO ideal-int +pkg syscall (netbsd-arm-cgo), const RTF_MASK ideal-int +pkg syscall (netbsd-arm-cgo), const RTF_MODIFIED ideal-int +pkg syscall (netbsd-arm-cgo), const RTF_PROTO1 ideal-int +pkg syscall (netbsd-arm-cgo), const RTF_PROTO2 ideal-int +pkg syscall (netbsd-arm-cgo), const RTF_REJECT ideal-int +pkg syscall (netbsd-arm-cgo), const RTF_SRC ideal-int +pkg syscall (netbsd-arm-cgo), const RTF_STATIC ideal-int +pkg syscall (netbsd-arm-cgo), const RTF_UP ideal-int +pkg syscall (netbsd-arm-cgo), const RTF_XRESOLVE ideal-int +pkg syscall (netbsd-arm-cgo), const RTM_ADD ideal-int +pkg syscall (netbsd-arm-cgo), const RTM_CHANGE ideal-int +pkg syscall (netbsd-arm-cgo), const RTM_CHGADDR ideal-int +pkg syscall (netbsd-arm-cgo), const RTM_DELADDR ideal-int +pkg syscall (netbsd-arm-cgo), const RTM_DELETE ideal-int +pkg syscall (netbsd-arm-cgo), const RTM_GET ideal-int +pkg syscall (netbsd-arm-cgo), const RTM_IEEE80211 ideal-int +pkg syscall (netbsd-arm-cgo), const RTM_IFANNOUNCE ideal-int +pkg syscall (netbsd-arm-cgo), const RTM_IFINFO ideal-int +pkg syscall (netbsd-arm-cgo), const RTM_LLINFO_UPD ideal-int +pkg syscall (netbsd-arm-cgo), const RTM_LOCK ideal-int +pkg syscall (netbsd-arm-cgo), const RTM_LOSING ideal-int +pkg syscall (netbsd-arm-cgo), const RTM_MISS ideal-int +pkg syscall (netbsd-arm-cgo), const RTM_NEWADDR ideal-int +pkg syscall (netbsd-arm-cgo), const RTM_OIFINFO ideal-int +pkg syscall (netbsd-arm-cgo), const RTM_OLDADD ideal-int +pkg syscall (netbsd-arm-cgo), const RTM_OLDDEL ideal-int +pkg syscall (netbsd-arm-cgo), const RTM_OOIFINFO ideal-int +pkg syscall (netbsd-arm-cgo), const RTM_REDIRECT ideal-int +pkg syscall (netbsd-arm-cgo), const RTM_RESOLVE ideal-int +pkg syscall (netbsd-arm-cgo), const RTM_RTTUNIT ideal-int +pkg syscall (netbsd-arm-cgo), const RTM_SETGATE ideal-int +pkg syscall (netbsd-arm-cgo), const RTM_VERSION ideal-int +pkg syscall (netbsd-arm-cgo), const RTV_EXPIRE ideal-int +pkg syscall (netbsd-arm-cgo), const RTV_HOPCOUNT ideal-int +pkg syscall (netbsd-arm-cgo), const RTV_MTU ideal-int +pkg syscall (netbsd-arm-cgo), const RTV_RPIPE ideal-int +pkg syscall (netbsd-arm-cgo), const RTV_RTT ideal-int +pkg syscall (netbsd-arm-cgo), const RTV_RTTVAR ideal-int +pkg syscall (netbsd-arm-cgo), const RTV_SPIPE ideal-int +pkg syscall (netbsd-arm-cgo), const RTV_SSTHRESH ideal-int +pkg syscall (netbsd-arm-cgo), const RUSAGE_CHILDREN ideal-int +pkg syscall (netbsd-arm-cgo), const RUSAGE_SELF ideal-int +pkg syscall (netbsd-arm-cgo), const SCM_CREDS ideal-int +pkg syscall (netbsd-arm-cgo), const SCM_RIGHTS ideal-int +pkg syscall (netbsd-arm-cgo), const SCM_TIMESTAMP ideal-int +pkg syscall (netbsd-arm-cgo), const SIGCHLD Signal +pkg syscall (netbsd-arm-cgo), const SIGCONT Signal +pkg syscall (netbsd-arm-cgo), const SIGEMT Signal +pkg syscall (netbsd-arm-cgo), const SIGINFO Signal +pkg syscall (netbsd-arm-cgo), const SIGIO Signal +pkg syscall (netbsd-arm-cgo), const SIGIOT Signal +pkg syscall (netbsd-arm-cgo), const SIGPROF Signal +pkg syscall (netbsd-arm-cgo), const SIGPWR Signal +pkg syscall (netbsd-arm-cgo), const SIGSTOP Signal +pkg syscall (netbsd-arm-cgo), const SIGSYS Signal +pkg syscall (netbsd-arm-cgo), const SIGTSTP Signal +pkg syscall (netbsd-arm-cgo), const SIGTTIN Signal +pkg syscall (netbsd-arm-cgo), const SIGTTOU Signal +pkg syscall (netbsd-arm-cgo), const SIGURG Signal +pkg syscall (netbsd-arm-cgo), const SIGUSR1 Signal +pkg syscall (netbsd-arm-cgo), const SIGUSR2 Signal +pkg syscall (netbsd-arm-cgo), const SIGVTALRM Signal +pkg syscall (netbsd-arm-cgo), const SIGWINCH Signal +pkg syscall (netbsd-arm-cgo), const SIGXCPU Signal +pkg syscall (netbsd-arm-cgo), const SIGXFSZ Signal +pkg syscall (netbsd-arm-cgo), const SIOCADDMULTI ideal-int +pkg syscall (netbsd-arm-cgo), const SIOCADDRT ideal-int +pkg syscall (netbsd-arm-cgo), const SIOCAIFADDR ideal-int +pkg syscall (netbsd-arm-cgo), const SIOCALIFADDR ideal-int +pkg syscall (netbsd-arm-cgo), const SIOCATMARK ideal-int +pkg syscall (netbsd-arm-cgo), const SIOCDELMULTI ideal-int +pkg syscall (netbsd-arm-cgo), const SIOCDELRT ideal-int +pkg syscall (netbsd-arm-cgo), const SIOCDIFADDR ideal-int +pkg syscall (netbsd-arm-cgo), const SIOCDIFPHYADDR ideal-int +pkg syscall (netbsd-arm-cgo), const SIOCDLIFADDR ideal-int +pkg syscall (netbsd-arm-cgo), const SIOCGDRVSPEC ideal-int +pkg syscall (netbsd-arm-cgo), const SIOCGETPFSYNC ideal-int +pkg syscall (netbsd-arm-cgo), const SIOCGETSGCNT ideal-int +pkg syscall (netbsd-arm-cgo), const SIOCGETVIFCNT ideal-int +pkg syscall (netbsd-arm-cgo), const SIOCGHIWAT ideal-int +pkg syscall (netbsd-arm-cgo), const SIOCGIFADDR ideal-int +pkg syscall (netbsd-arm-cgo), const SIOCGIFADDRPREF ideal-int +pkg syscall (netbsd-arm-cgo), const SIOCGIFALIAS ideal-int +pkg syscall (netbsd-arm-cgo), const SIOCGIFBRDADDR ideal-int +pkg syscall (netbsd-arm-cgo), const SIOCGIFCAP ideal-int +pkg syscall (netbsd-arm-cgo), const SIOCGIFCONF ideal-int +pkg syscall (netbsd-arm-cgo), const SIOCGIFDATA ideal-int +pkg syscall (netbsd-arm-cgo), const SIOCGIFDLT ideal-int +pkg syscall (netbsd-arm-cgo), const SIOCGIFDSTADDR ideal-int +pkg syscall (netbsd-arm-cgo), const SIOCGIFFLAGS ideal-int +pkg syscall (netbsd-arm-cgo), const SIOCGIFGENERIC ideal-int +pkg syscall (netbsd-arm-cgo), const SIOCGIFMEDIA ideal-int +pkg syscall (netbsd-arm-cgo), const SIOCGIFMETRIC ideal-int +pkg syscall (netbsd-arm-cgo), const SIOCGIFMTU ideal-int +pkg syscall (netbsd-arm-cgo), const SIOCGIFNETMASK ideal-int +pkg syscall (netbsd-arm-cgo), const SIOCGIFPDSTADDR ideal-int +pkg syscall (netbsd-arm-cgo), const SIOCGIFPSRCADDR ideal-int +pkg syscall (netbsd-arm-cgo), const SIOCGLIFADDR ideal-int +pkg syscall (netbsd-arm-cgo), const SIOCGLIFPHYADDR ideal-int +pkg syscall (netbsd-arm-cgo), const SIOCGLINKSTR ideal-int +pkg syscall (netbsd-arm-cgo), const SIOCGLOWAT ideal-int +pkg syscall (netbsd-arm-cgo), const SIOCGPGRP ideal-int +pkg syscall (netbsd-arm-cgo), const SIOCGVH ideal-int +pkg syscall (netbsd-arm-cgo), const SIOCIFCREATE ideal-int +pkg syscall (netbsd-arm-cgo), const SIOCIFDESTROY ideal-int +pkg syscall (netbsd-arm-cgo), const SIOCIFGCLONERS ideal-int +pkg syscall (netbsd-arm-cgo), const SIOCINITIFADDR ideal-int +pkg syscall (netbsd-arm-cgo), const SIOCSDRVSPEC ideal-int +pkg syscall (netbsd-arm-cgo), const SIOCSETPFSYNC ideal-int +pkg syscall (netbsd-arm-cgo), const SIOCSHIWAT ideal-int +pkg syscall (netbsd-arm-cgo), const SIOCSIFADDR ideal-int +pkg syscall (netbsd-arm-cgo), const SIOCSIFADDRPREF ideal-int +pkg syscall (netbsd-arm-cgo), const SIOCSIFBRDADDR ideal-int +pkg syscall (netbsd-arm-cgo), const SIOCSIFCAP ideal-int +pkg syscall (netbsd-arm-cgo), const SIOCSIFDSTADDR ideal-int +pkg syscall (netbsd-arm-cgo), const SIOCSIFFLAGS ideal-int +pkg syscall (netbsd-arm-cgo), const SIOCSIFGENERIC ideal-int +pkg syscall (netbsd-arm-cgo), const SIOCSIFMEDIA ideal-int +pkg syscall (netbsd-arm-cgo), const SIOCSIFMETRIC ideal-int +pkg syscall (netbsd-arm-cgo), const SIOCSIFMTU ideal-int +pkg syscall (netbsd-arm-cgo), const SIOCSIFNETMASK ideal-int +pkg syscall (netbsd-arm-cgo), const SIOCSIFPHYADDR ideal-int +pkg syscall (netbsd-arm-cgo), const SIOCSLIFPHYADDR ideal-int +pkg syscall (netbsd-arm-cgo), const SIOCSLINKSTR ideal-int +pkg syscall (netbsd-arm-cgo), const SIOCSLOWAT ideal-int +pkg syscall (netbsd-arm-cgo), const SIOCSPGRP ideal-int +pkg syscall (netbsd-arm-cgo), const SIOCSVH ideal-int +pkg syscall (netbsd-arm-cgo), const SIOCZIFDATA ideal-int +pkg syscall (netbsd-arm-cgo), const SOCK_CLOEXEC ideal-int +pkg syscall (netbsd-arm-cgo), const SOCK_FLAGS_MASK ideal-int +pkg syscall (netbsd-arm-cgo), const SOCK_NONBLOCK ideal-int +pkg syscall (netbsd-arm-cgo), const SOCK_NOSIGPIPE ideal-int +pkg syscall (netbsd-arm-cgo), const SOCK_RDM ideal-int +pkg syscall (netbsd-arm-cgo), const SO_ACCEPTCONN ideal-int +pkg syscall (netbsd-arm-cgo), const SO_ACCEPTFILTER ideal-int +pkg syscall (netbsd-arm-cgo), const SO_DEBUG ideal-int +pkg syscall (netbsd-arm-cgo), const SO_ERROR ideal-int +pkg syscall (netbsd-arm-cgo), const SO_NOHEADER ideal-int +pkg syscall (netbsd-arm-cgo), const SO_NOSIGPIPE ideal-int +pkg syscall (netbsd-arm-cgo), const SO_OOBINLINE ideal-int +pkg syscall (netbsd-arm-cgo), const SO_OVERFLOWED ideal-int +pkg syscall (netbsd-arm-cgo), const SO_RCVLOWAT ideal-int +pkg syscall (netbsd-arm-cgo), const SO_RCVTIMEO ideal-int +pkg syscall (netbsd-arm-cgo), const SO_REUSEPORT ideal-int +pkg syscall (netbsd-arm-cgo), const SO_SNDLOWAT ideal-int +pkg syscall (netbsd-arm-cgo), const SO_SNDTIMEO ideal-int +pkg syscall (netbsd-arm-cgo), const SO_TIMESTAMP ideal-int +pkg syscall (netbsd-arm-cgo), const SO_TYPE ideal-int +pkg syscall (netbsd-arm-cgo), const SO_USELOOPBACK ideal-int +pkg syscall (netbsd-arm-cgo), const SYSCTL_VERSION ideal-int +pkg syscall (netbsd-arm-cgo), const SYSCTL_VERS_0 ideal-int +pkg syscall (netbsd-arm-cgo), const SYSCTL_VERS_1 ideal-int +pkg syscall (netbsd-arm-cgo), const SYSCTL_VERS_MASK ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_ACCEPT ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_ACCESS ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_ACCT ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_ADJTIME ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_BIND ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_BREAK ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_CHDIR ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_CHFLAGS ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_CHMOD ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_CHOWN ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_CHROOT ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_CLOCK_GETRES ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_CLOCK_GETTIME ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_CLOCK_SETTIME ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_CLOSE ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_CONNECT ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_DUP ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_DUP2 ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_DUP3 ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_EXECVE ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_EXIT ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_EXTATTRCTL ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_EXTATTR_DELETE_FD ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_EXTATTR_DELETE_FILE ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_EXTATTR_DELETE_LINK ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_EXTATTR_GET_FD ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_EXTATTR_GET_FILE ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_EXTATTR_GET_LINK ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_EXTATTR_LIST_FD ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_EXTATTR_LIST_FILE ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_EXTATTR_LIST_LINK ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_EXTATTR_SET_FD ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_EXTATTR_SET_FILE ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_EXTATTR_SET_LINK ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_FACCESSAT ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_FCHDIR ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_FCHFLAGS ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_FCHMOD ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_FCHMODAT ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_FCHOWN ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_FCHOWNAT ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_FCHROOT ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_FCNTL ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_FDATASYNC ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_FEXECVE ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_FGETXATTR ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_FHSTAT ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_FKTRACE ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_FLISTXATTR ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_FLOCK ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_FORK ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_FPATHCONF ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_FREMOVEXATTR ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_FSETXATTR ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_FSTAT ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_FSTATAT ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_FSTATVFS1 ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_FSYNC ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_FSYNC_RANGE ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_FTRUNCATE ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_FUTIMENS ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_FUTIMES ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_GETCONTEXT ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_GETDENTS ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_GETEGID ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_GETEUID ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_GETFH ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_GETGID ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_GETGROUPS ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_GETITIMER ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_GETPEERNAME ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_GETPGID ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_GETPGRP ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_GETPID ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_GETPPID ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_GETPRIORITY ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_GETRLIMIT ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_GETRUSAGE ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_GETSID ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_GETSOCKNAME ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_GETSOCKOPT ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_GETTIMEOFDAY ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_GETUID ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_GETVFSSTAT ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_GETXATTR ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_IOCTL ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_ISSETUGID ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_KEVENT ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_KILL ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_KQUEUE ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_KQUEUE1 ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_KTRACE ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_LCHFLAGS ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_LCHMOD ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_LCHOWN ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_LGETXATTR ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_LINK ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_LINKAT ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_LISTEN ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_LISTXATTR ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_LLISTXATTR ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_LREMOVEXATTR ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_LSEEK ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_LSETXATTR ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_LSTAT ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_LUTIMES ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_MADVISE ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_MINCORE ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_MINHERIT ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_MKDIR ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_MKDIRAT ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_MKFIFO ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_MKFIFOAT ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_MKNOD ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_MKNODAT ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_MLOCK ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_MLOCKALL ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_MMAP ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_MODCTL ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_MOUNT ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_MPROTECT ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_MREMAP ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_MSGCTL ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_MSGGET ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_MSGRCV ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_MSGSND ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_MUNLOCK ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_MUNLOCKALL ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_MUNMAP ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_NANOSLEEP ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_NTP_ADJTIME ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_NTP_GETTIME ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_OPEN ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_OPENAT ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_PACCEPT ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_PATHCONF ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_PIPE ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_PIPE2 ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_PMC_CONTROL ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_PMC_GET_INFO ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_POLL ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_POLLTS ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_POSIX_FADVISE ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_POSIX_SPAWN ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_PREAD ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_PREADV ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_PROFIL ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_PSELECT ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_PSET_ASSIGN ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_PSET_CREATE ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_PSET_DESTROY ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_PTRACE ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_PWRITE ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_PWRITEV ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_RASCTL ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_READ ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_READLINK ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_READLINKAT ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_READV ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_REBOOT ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_RECVFROM ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_RECVMMSG ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_RECVMSG ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_REMOVEXATTR ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_RENAME ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_RENAMEAT ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_REVOKE ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_RMDIR ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_SBRK ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_SCHED_YIELD ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_SELECT ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_SEMCONFIG ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_SEMGET ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_SEMOP ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_SENDMMSG ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_SENDMSG ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_SENDTO ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_SETCONTEXT ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_SETEGID ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_SETEUID ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_SETGID ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_SETGROUPS ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_SETITIMER ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_SETPGID ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_SETPRIORITY ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_SETREGID ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_SETREUID ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_SETRLIMIT ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_SETSID ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_SETSOCKOPT ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_SETTIMEOFDAY ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_SETUID ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_SETXATTR ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_SHMAT ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_SHMCTL ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_SHMDT ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_SHMGET ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_SHUTDOWN ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_SIGQUEUEINFO ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_SOCKET ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_SOCKETPAIR ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_SSTK ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_STAT ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_STATVFS1 ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_SWAPCTL ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_SYMLINK ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_SYMLINKAT ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_SYNC ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_SYSARCH ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_TIMER_CREATE ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_TIMER_DELETE ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_TIMER_GETOVERRUN ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_TIMER_GETTIME ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_TIMER_SETTIME ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_TRUNCATE ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_UMASK ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_UNDELETE ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_UNLINK ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_UNLINKAT ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_UNMOUNT ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_UTIMENSAT ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_UTIMES ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_UTRACE ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_UUIDGEN ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_VADVISE ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_VFORK ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_WAIT4 ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_WRITE ideal-int +pkg syscall (netbsd-arm-cgo), const SYS_WRITEV ideal-int +pkg syscall (netbsd-arm-cgo), const SYS__LWP_CONTINUE ideal-int +pkg syscall (netbsd-arm-cgo), const SYS__LWP_CREATE ideal-int +pkg syscall (netbsd-arm-cgo), const SYS__LWP_CTL ideal-int +pkg syscall (netbsd-arm-cgo), const SYS__LWP_DETACH ideal-int +pkg syscall (netbsd-arm-cgo), const SYS__LWP_EXIT ideal-int +pkg syscall (netbsd-arm-cgo), const SYS__LWP_GETNAME ideal-int +pkg syscall (netbsd-arm-cgo), const SYS__LWP_GETPRIVATE ideal-int +pkg syscall (netbsd-arm-cgo), const SYS__LWP_KILL ideal-int +pkg syscall (netbsd-arm-cgo), const SYS__LWP_PARK ideal-int +pkg syscall (netbsd-arm-cgo), const SYS__LWP_SELF ideal-int +pkg syscall (netbsd-arm-cgo), const SYS__LWP_SETNAME ideal-int +pkg syscall (netbsd-arm-cgo), const SYS__LWP_SETPRIVATE ideal-int +pkg syscall (netbsd-arm-cgo), const SYS__LWP_SUSPEND ideal-int +pkg syscall (netbsd-arm-cgo), const SYS__LWP_UNPARK ideal-int +pkg syscall (netbsd-arm-cgo), const SYS__LWP_UNPARK_ALL ideal-int +pkg syscall (netbsd-arm-cgo), const SYS__LWP_WAIT ideal-int +pkg syscall (netbsd-arm-cgo), const SYS__LWP_WAKEUP ideal-int +pkg syscall (netbsd-arm-cgo), const SYS__PSET_BIND ideal-int +pkg syscall (netbsd-arm-cgo), const SYS__SCHED_GETAFFINITY ideal-int +pkg syscall (netbsd-arm-cgo), const SYS__SCHED_GETPARAM ideal-int +pkg syscall (netbsd-arm-cgo), const SYS__SCHED_SETAFFINITY ideal-int +pkg syscall (netbsd-arm-cgo), const SYS__SCHED_SETPARAM ideal-int +pkg syscall (netbsd-arm-cgo), const SYS___CLONE ideal-int +pkg syscall (netbsd-arm-cgo), const SYS___GETCWD ideal-int +pkg syscall (netbsd-arm-cgo), const SYS___GETLOGIN ideal-int +pkg syscall (netbsd-arm-cgo), const SYS___POSIX_CHOWN ideal-int +pkg syscall (netbsd-arm-cgo), const SYS___POSIX_FCHOWN ideal-int +pkg syscall (netbsd-arm-cgo), const SYS___POSIX_LCHOWN ideal-int +pkg syscall (netbsd-arm-cgo), const SYS___POSIX_RENAME ideal-int +pkg syscall (netbsd-arm-cgo), const SYS___QUOTACTL ideal-int +pkg syscall (netbsd-arm-cgo), const SYS___SEMCTL ideal-int +pkg syscall (netbsd-arm-cgo), const SYS___SETLOGIN ideal-int +pkg syscall (netbsd-arm-cgo), const SYS___SIGACTION_SIGTRAMP ideal-int +pkg syscall (netbsd-arm-cgo), const SYS___SIGTIMEDWAIT ideal-int +pkg syscall (netbsd-arm-cgo), const SYS___SYSCTL ideal-int +pkg syscall (netbsd-arm-cgo), const S_ARCH1 ideal-int +pkg syscall (netbsd-arm-cgo), const S_ARCH2 ideal-int +pkg syscall (netbsd-arm-cgo), const S_BLKSIZE ideal-int +pkg syscall (netbsd-arm-cgo), const S_IEXEC ideal-int +pkg syscall (netbsd-arm-cgo), const S_IFWHT ideal-int +pkg syscall (netbsd-arm-cgo), const S_IREAD ideal-int +pkg syscall (netbsd-arm-cgo), const S_IRGRP ideal-int +pkg syscall (netbsd-arm-cgo), const S_IROTH ideal-int +pkg syscall (netbsd-arm-cgo), const S_IRWXG ideal-int +pkg syscall (netbsd-arm-cgo), const S_IRWXO ideal-int +pkg syscall (netbsd-arm-cgo), const S_IRWXU ideal-int +pkg syscall (netbsd-arm-cgo), const S_ISTXT ideal-int +pkg syscall (netbsd-arm-cgo), const S_IWGRP ideal-int +pkg syscall (netbsd-arm-cgo), const S_IWOTH ideal-int +pkg syscall (netbsd-arm-cgo), const S_IWRITE ideal-int +pkg syscall (netbsd-arm-cgo), const S_IXGRP ideal-int +pkg syscall (netbsd-arm-cgo), const S_IXOTH ideal-int +pkg syscall (netbsd-arm-cgo), const SizeofBpfHdr ideal-int +pkg syscall (netbsd-arm-cgo), const SizeofBpfInsn ideal-int +pkg syscall (netbsd-arm-cgo), const SizeofBpfProgram ideal-int +pkg syscall (netbsd-arm-cgo), const SizeofBpfStat ideal-int +pkg syscall (netbsd-arm-cgo), const SizeofBpfVersion ideal-int +pkg syscall (netbsd-arm-cgo), const SizeofCmsghdr ideal-int +pkg syscall (netbsd-arm-cgo), const SizeofICMPv6Filter = 32 +pkg syscall (netbsd-arm-cgo), const SizeofICMPv6Filter ideal-int +pkg syscall (netbsd-arm-cgo), const SizeofIPMreq ideal-int +pkg syscall (netbsd-arm-cgo), const SizeofIPv6MTUInfo = 32 +pkg syscall (netbsd-arm-cgo), const SizeofIPv6MTUInfo ideal-int +pkg syscall (netbsd-arm-cgo), const SizeofIPv6Mreq ideal-int +pkg syscall (netbsd-arm-cgo), const SizeofIfAnnounceMsghdr ideal-int +pkg syscall (netbsd-arm-cgo), const SizeofIfData ideal-int +pkg syscall (netbsd-arm-cgo), const SizeofIfMsghdr ideal-int +pkg syscall (netbsd-arm-cgo), const SizeofIfaMsghdr ideal-int +pkg syscall (netbsd-arm-cgo), const SizeofInet6Pktinfo ideal-int +pkg syscall (netbsd-arm-cgo), const SizeofLinger ideal-int +pkg syscall (netbsd-arm-cgo), const SizeofMsghdr ideal-int +pkg syscall (netbsd-arm-cgo), const SizeofRtMetrics ideal-int +pkg syscall (netbsd-arm-cgo), const SizeofRtMsghdr ideal-int +pkg syscall (netbsd-arm-cgo), const SizeofSockaddrAny ideal-int +pkg syscall (netbsd-arm-cgo), const SizeofSockaddrDatalink ideal-int +pkg syscall (netbsd-arm-cgo), const SizeofSockaddrInet4 ideal-int +pkg syscall (netbsd-arm-cgo), const SizeofSockaddrInet6 ideal-int +pkg syscall (netbsd-arm-cgo), const SizeofSockaddrUnix ideal-int +pkg syscall (netbsd-arm-cgo), const TCIFLUSH ideal-int +pkg syscall (netbsd-arm-cgo), const TCIOFLUSH ideal-int +pkg syscall (netbsd-arm-cgo), const TCOFLUSH ideal-int +pkg syscall (netbsd-arm-cgo), const TCP_CONGCTL ideal-int +pkg syscall (netbsd-arm-cgo), const TCP_KEEPCNT ideal-int +pkg syscall (netbsd-arm-cgo), const TCP_KEEPIDLE ideal-int +pkg syscall (netbsd-arm-cgo), const TCP_KEEPINIT ideal-int +pkg syscall (netbsd-arm-cgo), const TCP_KEEPINTVL ideal-int +pkg syscall (netbsd-arm-cgo), const TCP_MAXBURST ideal-int +pkg syscall (netbsd-arm-cgo), const TCP_MAXSEG ideal-int +pkg syscall (netbsd-arm-cgo), const TCP_MAXWIN ideal-int +pkg syscall (netbsd-arm-cgo), const TCP_MAX_WINSHIFT ideal-int +pkg syscall (netbsd-arm-cgo), const TCP_MD5SIG ideal-int +pkg syscall (netbsd-arm-cgo), const TCP_MINMSS ideal-int +pkg syscall (netbsd-arm-cgo), const TCP_MSS ideal-int +pkg syscall (netbsd-arm-cgo), const TCSAFLUSH ideal-int +pkg syscall (netbsd-arm-cgo), const TIOCCBRK ideal-int +pkg syscall (netbsd-arm-cgo), const TIOCCDTR ideal-int +pkg syscall (netbsd-arm-cgo), const TIOCCONS ideal-int +pkg syscall (netbsd-arm-cgo), const TIOCDCDTIMESTAMP ideal-int +pkg syscall (netbsd-arm-cgo), const TIOCDRAIN ideal-int +pkg syscall (netbsd-arm-cgo), const TIOCEXCL ideal-int +pkg syscall (netbsd-arm-cgo), const TIOCEXT ideal-int +pkg syscall (netbsd-arm-cgo), const TIOCFLAG_CDTRCTS ideal-int +pkg syscall (netbsd-arm-cgo), const TIOCFLAG_CLOCAL ideal-int +pkg syscall (netbsd-arm-cgo), const TIOCFLAG_CRTSCTS ideal-int +pkg syscall (netbsd-arm-cgo), const TIOCFLAG_MDMBUF ideal-int +pkg syscall (netbsd-arm-cgo), const TIOCFLAG_SOFTCAR ideal-int +pkg syscall (netbsd-arm-cgo), const TIOCFLUSH ideal-int +pkg syscall (netbsd-arm-cgo), const TIOCGETA ideal-int +pkg syscall (netbsd-arm-cgo), const TIOCGETD ideal-int +pkg syscall (netbsd-arm-cgo), const TIOCGFLAGS ideal-int +pkg syscall (netbsd-arm-cgo), const TIOCGLINED ideal-int +pkg syscall (netbsd-arm-cgo), const TIOCGPGRP ideal-int +pkg syscall (netbsd-arm-cgo), const TIOCGQSIZE ideal-int +pkg syscall (netbsd-arm-cgo), const TIOCGRANTPT ideal-int +pkg syscall (netbsd-arm-cgo), const TIOCGSID ideal-int +pkg syscall (netbsd-arm-cgo), const TIOCGSIZE ideal-int +pkg syscall (netbsd-arm-cgo), const TIOCGWINSZ ideal-int +pkg syscall (netbsd-arm-cgo), const TIOCMBIC ideal-int +pkg syscall (netbsd-arm-cgo), const TIOCMBIS ideal-int +pkg syscall (netbsd-arm-cgo), const TIOCMGET ideal-int +pkg syscall (netbsd-arm-cgo), const TIOCMSET ideal-int +pkg syscall (netbsd-arm-cgo), const TIOCM_CAR ideal-int +pkg syscall (netbsd-arm-cgo), const TIOCM_CD ideal-int +pkg syscall (netbsd-arm-cgo), const TIOCM_CTS ideal-int +pkg syscall (netbsd-arm-cgo), const TIOCM_DSR ideal-int +pkg syscall (netbsd-arm-cgo), const TIOCM_DTR ideal-int +pkg syscall (netbsd-arm-cgo), const TIOCM_LE ideal-int +pkg syscall (netbsd-arm-cgo), const TIOCM_RI ideal-int +pkg syscall (netbsd-arm-cgo), const TIOCM_RNG ideal-int +pkg syscall (netbsd-arm-cgo), const TIOCM_RTS ideal-int +pkg syscall (netbsd-arm-cgo), const TIOCM_SR ideal-int +pkg syscall (netbsd-arm-cgo), const TIOCM_ST ideal-int +pkg syscall (netbsd-arm-cgo), const TIOCNOTTY ideal-int +pkg syscall (netbsd-arm-cgo), const TIOCNXCL ideal-int +pkg syscall (netbsd-arm-cgo), const TIOCOUTQ ideal-int +pkg syscall (netbsd-arm-cgo), const TIOCPKT ideal-int +pkg syscall (netbsd-arm-cgo), const TIOCPKT_DATA ideal-int +pkg syscall (netbsd-arm-cgo), const TIOCPKT_DOSTOP ideal-int +pkg syscall (netbsd-arm-cgo), const TIOCPKT_FLUSHREAD ideal-int +pkg syscall (netbsd-arm-cgo), const TIOCPKT_FLUSHWRITE ideal-int +pkg syscall (netbsd-arm-cgo), const TIOCPKT_IOCTL ideal-int +pkg syscall (netbsd-arm-cgo), const TIOCPKT_NOSTOP ideal-int +pkg syscall (netbsd-arm-cgo), const TIOCPKT_START ideal-int +pkg syscall (netbsd-arm-cgo), const TIOCPKT_STOP ideal-int +pkg syscall (netbsd-arm-cgo), const TIOCPTMGET ideal-int +pkg syscall (netbsd-arm-cgo), const TIOCPTSNAME ideal-int +pkg syscall (netbsd-arm-cgo), const TIOCRCVFRAME ideal-int +pkg syscall (netbsd-arm-cgo), const TIOCREMOTE ideal-int +pkg syscall (netbsd-arm-cgo), const TIOCSBRK ideal-int +pkg syscall (netbsd-arm-cgo), const TIOCSCTTY ideal-int +pkg syscall (netbsd-arm-cgo), const TIOCSDTR ideal-int +pkg syscall (netbsd-arm-cgo), const TIOCSETA ideal-int +pkg syscall (netbsd-arm-cgo), const TIOCSETAF ideal-int +pkg syscall (netbsd-arm-cgo), const TIOCSETAW ideal-int +pkg syscall (netbsd-arm-cgo), const TIOCSETD ideal-int +pkg syscall (netbsd-arm-cgo), const TIOCSFLAGS ideal-int +pkg syscall (netbsd-arm-cgo), const TIOCSIG ideal-int +pkg syscall (netbsd-arm-cgo), const TIOCSLINED ideal-int +pkg syscall (netbsd-arm-cgo), const TIOCSPGRP ideal-int +pkg syscall (netbsd-arm-cgo), const TIOCSQSIZE ideal-int +pkg syscall (netbsd-arm-cgo), const TIOCSSIZE ideal-int +pkg syscall (netbsd-arm-cgo), const TIOCSTART ideal-int +pkg syscall (netbsd-arm-cgo), const TIOCSTAT ideal-int +pkg syscall (netbsd-arm-cgo), const TIOCSTI ideal-int +pkg syscall (netbsd-arm-cgo), const TIOCSTOP ideal-int +pkg syscall (netbsd-arm-cgo), const TIOCSWINSZ ideal-int +pkg syscall (netbsd-arm-cgo), const TIOCUCNTL ideal-int +pkg syscall (netbsd-arm-cgo), const TIOCXMTFRAME ideal-int +pkg syscall (netbsd-arm-cgo), const TOSTOP ideal-int +pkg syscall (netbsd-arm-cgo), const VDISCARD ideal-int +pkg syscall (netbsd-arm-cgo), const VDSUSP ideal-int +pkg syscall (netbsd-arm-cgo), const VEOF ideal-int +pkg syscall (netbsd-arm-cgo), const VEOL ideal-int +pkg syscall (netbsd-arm-cgo), const VEOL2 ideal-int +pkg syscall (netbsd-arm-cgo), const VERASE ideal-int +pkg syscall (netbsd-arm-cgo), const VINTR ideal-int +pkg syscall (netbsd-arm-cgo), const VKILL ideal-int +pkg syscall (netbsd-arm-cgo), const VLNEXT ideal-int +pkg syscall (netbsd-arm-cgo), const VMIN ideal-int +pkg syscall (netbsd-arm-cgo), const VQUIT ideal-int +pkg syscall (netbsd-arm-cgo), const VREPRINT ideal-int +pkg syscall (netbsd-arm-cgo), const VSTART ideal-int +pkg syscall (netbsd-arm-cgo), const VSTATUS ideal-int +pkg syscall (netbsd-arm-cgo), const VSTOP ideal-int +pkg syscall (netbsd-arm-cgo), const VSUSP ideal-int +pkg syscall (netbsd-arm-cgo), const VTIME ideal-int +pkg syscall (netbsd-arm-cgo), const VWERASE ideal-int +pkg syscall (netbsd-arm-cgo), const WALL ideal-int +pkg syscall (netbsd-arm-cgo), const WALLSIG ideal-int +pkg syscall (netbsd-arm-cgo), const WALTSIG ideal-int +pkg syscall (netbsd-arm-cgo), const WCLONE ideal-int +pkg syscall (netbsd-arm-cgo), const WCOREFLAG ideal-int +pkg syscall (netbsd-arm-cgo), const WNOHANG ideal-int +pkg syscall (netbsd-arm-cgo), const WNOWAIT ideal-int +pkg syscall (netbsd-arm-cgo), const WNOZOMBIE ideal-int +pkg syscall (netbsd-arm-cgo), const WOPTSCHECKED ideal-int +pkg syscall (netbsd-arm-cgo), const WSTOPPED ideal-int +pkg syscall (netbsd-arm-cgo), const WUNTRACED ideal-int +pkg syscall (netbsd-arm-cgo), func Accept(int) (int, Sockaddr, error) +pkg syscall (netbsd-arm-cgo), func Access(string, uint32) error +pkg syscall (netbsd-arm-cgo), func Adjtime(*Timeval, *Timeval) error +pkg syscall (netbsd-arm-cgo), func Bind(int, Sockaddr) error +pkg syscall (netbsd-arm-cgo), func BpfBuflen(int) (int, error) +pkg syscall (netbsd-arm-cgo), func BpfDatalink(int) (int, error) +pkg syscall (netbsd-arm-cgo), func BpfHeadercmpl(int) (int, error) +pkg syscall (netbsd-arm-cgo), func BpfInterface(int, string) (string, error) +pkg syscall (netbsd-arm-cgo), func BpfJump(int, int, int, int) *BpfInsn +pkg syscall (netbsd-arm-cgo), func BpfStats(int) (*BpfStat, error) +pkg syscall (netbsd-arm-cgo), func BpfStmt(int, int) *BpfInsn +pkg syscall (netbsd-arm-cgo), func BpfTimeout(int) (*Timeval, error) +pkg syscall (netbsd-arm-cgo), func CheckBpfVersion(int) error +pkg syscall (netbsd-arm-cgo), func Chflags(string, int) error +pkg syscall (netbsd-arm-cgo), func Chroot(string) error +pkg syscall (netbsd-arm-cgo), func Close(int) error +pkg syscall (netbsd-arm-cgo), func CloseOnExec(int) +pkg syscall (netbsd-arm-cgo), func CmsgLen(int) int +pkg syscall (netbsd-arm-cgo), func CmsgSpace(int) int +pkg syscall (netbsd-arm-cgo), func Connect(int, Sockaddr) error +pkg syscall (netbsd-arm-cgo), func Dup(int) (int, error) +pkg syscall (netbsd-arm-cgo), func Dup2(int, int) error +pkg syscall (netbsd-arm-cgo), func Fchdir(int) error +pkg syscall (netbsd-arm-cgo), func Fchflags(string, int) error +pkg syscall (netbsd-arm-cgo), func Fchmod(int, uint32) error +pkg syscall (netbsd-arm-cgo), func Fchown(int, int, int) error +pkg syscall (netbsd-arm-cgo), func Flock(int, int) error +pkg syscall (netbsd-arm-cgo), func FlushBpf(int) error +pkg syscall (netbsd-arm-cgo), func ForkExec(string, []string, *ProcAttr) (int, error) +pkg syscall (netbsd-arm-cgo), func Fpathconf(int, int) (int, error) +pkg syscall (netbsd-arm-cgo), func Fstat(int, *Stat_t) error +pkg syscall (netbsd-arm-cgo), func Fsync(int) error +pkg syscall (netbsd-arm-cgo), func Ftruncate(int, int64) error +pkg syscall (netbsd-arm-cgo), func Futimes(int, []Timeval) error +pkg syscall (netbsd-arm-cgo), func Getdirentries(int, []uint8, *uintptr) (int, error) +pkg syscall (netbsd-arm-cgo), func Getpeername(int) (Sockaddr, error) +pkg syscall (netbsd-arm-cgo), func Getpgid(int) (int, error) +pkg syscall (netbsd-arm-cgo), func Getpgrp() int +pkg syscall (netbsd-arm-cgo), func Getpriority(int, int) (int, error) +pkg syscall (netbsd-arm-cgo), func Getrlimit(int, *Rlimit) error +pkg syscall (netbsd-arm-cgo), func Getrusage(int, *Rusage) error +pkg syscall (netbsd-arm-cgo), func Getsid(int) (int, error) +pkg syscall (netbsd-arm-cgo), func Getsockname(int) (Sockaddr, error) +pkg syscall (netbsd-arm-cgo), func GetsockoptByte(int, int, int) (uint8, error) +pkg syscall (netbsd-arm-cgo), func GetsockoptICMPv6Filter(int, int, int) (*ICMPv6Filter, error) +pkg syscall (netbsd-arm-cgo), func GetsockoptIPMreq(int, int, int) (*IPMreq, error) +pkg syscall (netbsd-arm-cgo), func GetsockoptIPv6MTUInfo(int, int, int) (*IPv6MTUInfo, error) +pkg syscall (netbsd-arm-cgo), func GetsockoptIPv6Mreq(int, int, int) (*IPv6Mreq, error) +pkg syscall (netbsd-arm-cgo), func GetsockoptInet4Addr(int, int, int) ([4]uint8, error) +pkg syscall (netbsd-arm-cgo), func GetsockoptInt(int, int, int) (int, error) +pkg syscall (netbsd-arm-cgo), func Issetugid() bool +pkg syscall (netbsd-arm-cgo), func Kevent(int, []Kevent_t, []Kevent_t, *Timespec) (int, error) +pkg syscall (netbsd-arm-cgo), func Kill(int, Signal) error +pkg syscall (netbsd-arm-cgo), func Kqueue() (int, error) +pkg syscall (netbsd-arm-cgo), func Listen(int, int) error +pkg syscall (netbsd-arm-cgo), func Lstat(string, *Stat_t) error +pkg syscall (netbsd-arm-cgo), func Mkfifo(string, uint32) error +pkg syscall (netbsd-arm-cgo), func Mknod(string, uint32, int) error +pkg syscall (netbsd-arm-cgo), func Mmap(int, int64, int, int, int) ([]uint8, error) +pkg syscall (netbsd-arm-cgo), func Munmap([]uint8) error +pkg syscall (netbsd-arm-cgo), func Nanosleep(*Timespec, *Timespec) error +pkg syscall (netbsd-arm-cgo), func Open(string, int, uint32) (int, error) +pkg syscall (netbsd-arm-cgo), func ParseDirent([]uint8, int, []string) (int, int, []string) +pkg syscall (netbsd-arm-cgo), func ParseRoutingMessage([]uint8) ([]RoutingMessage, error) +pkg syscall (netbsd-arm-cgo), func ParseRoutingSockaddr(RoutingMessage) ([]Sockaddr, error) +pkg syscall (netbsd-arm-cgo), func ParseSocketControlMessage([]uint8) ([]SocketControlMessage, error) +pkg syscall (netbsd-arm-cgo), func ParseUnixRights(*SocketControlMessage) ([]int, error) +pkg syscall (netbsd-arm-cgo), func Pathconf(string, int) (int, error) +pkg syscall (netbsd-arm-cgo), func Pipe([]int) error +pkg syscall (netbsd-arm-cgo), func Pread(int, []uint8, int64) (int, error) +pkg syscall (netbsd-arm-cgo), func Pwrite(int, []uint8, int64) (int, error) +pkg syscall (netbsd-arm-cgo), func RawSyscall(uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno) +pkg syscall (netbsd-arm-cgo), func RawSyscall6(uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno) +pkg syscall (netbsd-arm-cgo), func Read(int, []uint8) (int, error) +pkg syscall (netbsd-arm-cgo), func ReadDirent(int, []uint8) (int, error) +pkg syscall (netbsd-arm-cgo), func Recvfrom(int, []uint8, int) (int, Sockaddr, error) +pkg syscall (netbsd-arm-cgo), func Recvmsg(int, []uint8, []uint8, int) (int, int, int, Sockaddr, error) +pkg syscall (netbsd-arm-cgo), func Revoke(string) error +pkg syscall (netbsd-arm-cgo), func RouteRIB(int, int) ([]uint8, error) +pkg syscall (netbsd-arm-cgo), func Seek(int, int64, int) (int64, error) +pkg syscall (netbsd-arm-cgo), func Select(int, *FdSet, *FdSet, *FdSet, *Timeval) error +pkg syscall (netbsd-arm-cgo), func Sendfile(int, int, *int64, int) (int, error) +pkg syscall (netbsd-arm-cgo), func Sendmsg(int, []uint8, []uint8, Sockaddr, int) error +pkg syscall (netbsd-arm-cgo), func Sendto(int, []uint8, int, Sockaddr) error +pkg syscall (netbsd-arm-cgo), func SetBpf(int, []BpfInsn) error +pkg syscall (netbsd-arm-cgo), func SetBpfBuflen(int, int) (int, error) +pkg syscall (netbsd-arm-cgo), func SetBpfDatalink(int, int) (int, error) +pkg syscall (netbsd-arm-cgo), func SetBpfHeadercmpl(int, int) error +pkg syscall (netbsd-arm-cgo), func SetBpfImmediate(int, int) error +pkg syscall (netbsd-arm-cgo), func SetBpfInterface(int, string) error +pkg syscall (netbsd-arm-cgo), func SetBpfPromisc(int, int) error +pkg syscall (netbsd-arm-cgo), func SetBpfTimeout(int, *Timeval) error +pkg syscall (netbsd-arm-cgo), func SetKevent(*Kevent_t, int, int, int) +pkg syscall (netbsd-arm-cgo), func SetNonblock(int, bool) error +pkg syscall (netbsd-arm-cgo), func Setegid(int) error +pkg syscall (netbsd-arm-cgo), func Seteuid(int) error +pkg syscall (netbsd-arm-cgo), func Setgid(int) error +pkg syscall (netbsd-arm-cgo), func Setgroups([]int) error +pkg syscall (netbsd-arm-cgo), func Setpgid(int, int) error +pkg syscall (netbsd-arm-cgo), func Setpriority(int, int, int) error +pkg syscall (netbsd-arm-cgo), func Setregid(int, int) error +pkg syscall (netbsd-arm-cgo), func Setreuid(int, int) error +pkg syscall (netbsd-arm-cgo), func Setrlimit(int, *Rlimit) error +pkg syscall (netbsd-arm-cgo), func Setsid() (int, error) +pkg syscall (netbsd-arm-cgo), func SetsockoptByte(int, int, int, uint8) error +pkg syscall (netbsd-arm-cgo), func SetsockoptICMPv6Filter(int, int, int, *ICMPv6Filter) error +pkg syscall (netbsd-arm-cgo), func SetsockoptIPMreq(int, int, int, *IPMreq) error +pkg syscall (netbsd-arm-cgo), func SetsockoptIPv6Mreq(int, int, int, *IPv6Mreq) error +pkg syscall (netbsd-arm-cgo), func SetsockoptInet4Addr(int, int, int, [4]uint8) error +pkg syscall (netbsd-arm-cgo), func SetsockoptInt(int, int, int, int) error +pkg syscall (netbsd-arm-cgo), func SetsockoptLinger(int, int, int, *Linger) error +pkg syscall (netbsd-arm-cgo), func SetsockoptString(int, int, int, string) error +pkg syscall (netbsd-arm-cgo), func SetsockoptTimeval(int, int, int, *Timeval) error +pkg syscall (netbsd-arm-cgo), func Settimeofday(*Timeval) error +pkg syscall (netbsd-arm-cgo), func Setuid(int) error +pkg syscall (netbsd-arm-cgo), func Shutdown(int, int) error +pkg syscall (netbsd-arm-cgo), func SlicePtrFromStrings([]string) ([]*uint8, error) +pkg syscall (netbsd-arm-cgo), func Socket(int, int, int) (int, error) +pkg syscall (netbsd-arm-cgo), func Socketpair(int, int, int) ([2]int, error) +pkg syscall (netbsd-arm-cgo), func Stat(string, *Stat_t) error +pkg syscall (netbsd-arm-cgo), func StringSlicePtr([]string) []*uint8 +pkg syscall (netbsd-arm-cgo), func Sync() error +pkg syscall (netbsd-arm-cgo), func Syscall(uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno) +pkg syscall (netbsd-arm-cgo), func Syscall6(uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno) +pkg syscall (netbsd-arm-cgo), func Syscall9(uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno) +pkg syscall (netbsd-arm-cgo), func Sysctl(string) (string, error) +pkg syscall (netbsd-arm-cgo), func SysctlUint32(string) (uint32, error) +pkg syscall (netbsd-arm-cgo), func TimevalToNsec(Timeval) int64 +pkg syscall (netbsd-arm-cgo), func Truncate(string, int64) error +pkg syscall (netbsd-arm-cgo), func Umask(int) int +pkg syscall (netbsd-arm-cgo), func UnixRights(...int) []uint8 +pkg syscall (netbsd-arm-cgo), func Unmount(string, int) error +pkg syscall (netbsd-arm-cgo), func Wait4(int, *WaitStatus, int, *Rusage) (int, error) +pkg syscall (netbsd-arm-cgo), func Write(int, []uint8) (int, error) +pkg syscall (netbsd-arm-cgo), method (*Cmsghdr) SetLen(int) +pkg syscall (netbsd-arm-cgo), method (*Iovec) SetLen(int) +pkg syscall (netbsd-arm-cgo), method (*Msghdr) SetControllen(int) +pkg syscall (netbsd-arm-cgo), type BpfHdr struct +pkg syscall (netbsd-arm-cgo), type BpfHdr struct, Caplen uint32 +pkg syscall (netbsd-arm-cgo), type BpfHdr struct, Datalen uint32 +pkg syscall (netbsd-arm-cgo), type BpfHdr struct, Hdrlen uint16 +pkg syscall (netbsd-arm-cgo), type BpfHdr struct, Pad_cgo_0 [2]uint8 +pkg syscall (netbsd-arm-cgo), type BpfHdr struct, Tstamp BpfTimeval +pkg syscall (netbsd-arm-cgo), type BpfInsn struct +pkg syscall (netbsd-arm-cgo), type BpfInsn struct, Code uint16 +pkg syscall (netbsd-arm-cgo), type BpfInsn struct, Jf uint8 +pkg syscall (netbsd-arm-cgo), type BpfInsn struct, Jt uint8 +pkg syscall (netbsd-arm-cgo), type BpfInsn struct, K uint32 +pkg syscall (netbsd-arm-cgo), type BpfProgram struct +pkg syscall (netbsd-arm-cgo), type BpfProgram struct, Insns *BpfInsn +pkg syscall (netbsd-arm-cgo), type BpfProgram struct, Len uint32 +pkg syscall (netbsd-arm-cgo), type BpfStat struct +pkg syscall (netbsd-arm-cgo), type BpfStat struct, Capt uint64 +pkg syscall (netbsd-arm-cgo), type BpfStat struct, Drop uint64 +pkg syscall (netbsd-arm-cgo), type BpfStat struct, Padding [13]uint64 +pkg syscall (netbsd-arm-cgo), type BpfStat struct, Recv uint64 +pkg syscall (netbsd-arm-cgo), type BpfTimeval struct +pkg syscall (netbsd-arm-cgo), type BpfTimeval struct, Sec int32 +pkg syscall (netbsd-arm-cgo), type BpfTimeval struct, Usec int32 +pkg syscall (netbsd-arm-cgo), type BpfVersion struct +pkg syscall (netbsd-arm-cgo), type BpfVersion struct, Major uint16 +pkg syscall (netbsd-arm-cgo), type BpfVersion struct, Minor uint16 +pkg syscall (netbsd-arm-cgo), type Cmsghdr struct +pkg syscall (netbsd-arm-cgo), type Cmsghdr struct, Len uint32 +pkg syscall (netbsd-arm-cgo), type Cmsghdr struct, Level int32 +pkg syscall (netbsd-arm-cgo), type Cmsghdr struct, Type int32 +pkg syscall (netbsd-arm-cgo), type Credential struct +pkg syscall (netbsd-arm-cgo), type Credential struct, Gid uint32 +pkg syscall (netbsd-arm-cgo), type Credential struct, Groups []uint32 +pkg syscall (netbsd-arm-cgo), type Credential struct, Uid uint32 +pkg syscall (netbsd-arm-cgo), type Dirent struct +pkg syscall (netbsd-arm-cgo), type Dirent struct, Fileno uint64 +pkg syscall (netbsd-arm-cgo), type Dirent struct, Name [512]int8 +pkg syscall (netbsd-arm-cgo), type Dirent struct, Namlen uint16 +pkg syscall (netbsd-arm-cgo), type Dirent struct, Pad_cgo_0 [3]uint8 +pkg syscall (netbsd-arm-cgo), type Dirent struct, Reclen uint16 +pkg syscall (netbsd-arm-cgo), type Dirent struct, Type uint8 +pkg syscall (netbsd-arm-cgo), type FdSet struct +pkg syscall (netbsd-arm-cgo), type FdSet struct, Bits [8]uint32 +pkg syscall (netbsd-arm-cgo), type Flock_t struct +pkg syscall (netbsd-arm-cgo), type Flock_t struct, Len int64 +pkg syscall (netbsd-arm-cgo), type Flock_t struct, Pid int32 +pkg syscall (netbsd-arm-cgo), type Flock_t struct, Start int64 +pkg syscall (netbsd-arm-cgo), type Flock_t struct, Type int16 +pkg syscall (netbsd-arm-cgo), type Flock_t struct, Whence int16 +pkg syscall (netbsd-arm-cgo), type Fsid struct +pkg syscall (netbsd-arm-cgo), type Fsid struct, X__fsid_val [2]int32 +pkg syscall (netbsd-arm-cgo), type ICMPv6Filter struct +pkg syscall (netbsd-arm-cgo), type ICMPv6Filter struct, Filt [8]uint32 +pkg syscall (netbsd-arm-cgo), type IPv6MTUInfo struct +pkg syscall (netbsd-arm-cgo), type IPv6MTUInfo struct, Addr RawSockaddrInet6 +pkg syscall (netbsd-arm-cgo), type IPv6MTUInfo struct, Mtu uint32 +pkg syscall (netbsd-arm-cgo), type IfAnnounceMsghdr struct +pkg syscall (netbsd-arm-cgo), type IfAnnounceMsghdr struct, Index uint16 +pkg syscall (netbsd-arm-cgo), type IfAnnounceMsghdr struct, Msglen uint16 +pkg syscall (netbsd-arm-cgo), type IfAnnounceMsghdr struct, Name [16]int8 +pkg syscall (netbsd-arm-cgo), type IfAnnounceMsghdr struct, Type uint8 +pkg syscall (netbsd-arm-cgo), type IfAnnounceMsghdr struct, Version uint8 +pkg syscall (netbsd-arm-cgo), type IfAnnounceMsghdr struct, What uint16 +pkg syscall (netbsd-arm-cgo), type IfData struct +pkg syscall (netbsd-arm-cgo), type IfData struct, Addrlen uint8 +pkg syscall (netbsd-arm-cgo), type IfData struct, Baudrate uint64 +pkg syscall (netbsd-arm-cgo), type IfData struct, Collisions uint64 +pkg syscall (netbsd-arm-cgo), type IfData struct, Hdrlen uint8 +pkg syscall (netbsd-arm-cgo), type IfData struct, Ibytes uint64 +pkg syscall (netbsd-arm-cgo), type IfData struct, Ierrors uint64 +pkg syscall (netbsd-arm-cgo), type IfData struct, Imcasts uint64 +pkg syscall (netbsd-arm-cgo), type IfData struct, Ipackets uint64 +pkg syscall (netbsd-arm-cgo), type IfData struct, Iqdrops uint64 +pkg syscall (netbsd-arm-cgo), type IfData struct, Lastchange Timespec +pkg syscall (netbsd-arm-cgo), type IfData struct, Link_state int32 +pkg syscall (netbsd-arm-cgo), type IfData struct, Metric uint64 +pkg syscall (netbsd-arm-cgo), type IfData struct, Mtu uint64 +pkg syscall (netbsd-arm-cgo), type IfData struct, Noproto uint64 +pkg syscall (netbsd-arm-cgo), type IfData struct, Obytes uint64 +pkg syscall (netbsd-arm-cgo), type IfData struct, Oerrors uint64 +pkg syscall (netbsd-arm-cgo), type IfData struct, Omcasts uint64 +pkg syscall (netbsd-arm-cgo), type IfData struct, Opackets uint64 +pkg syscall (netbsd-arm-cgo), type IfData struct, Pad_cgo_0 [1]uint8 +pkg syscall (netbsd-arm-cgo), type IfData struct, Type uint8 +pkg syscall (netbsd-arm-cgo), type IfMsghdr struct +pkg syscall (netbsd-arm-cgo), type IfMsghdr struct, Addrs int32 +pkg syscall (netbsd-arm-cgo), type IfMsghdr struct, Data IfData +pkg syscall (netbsd-arm-cgo), type IfMsghdr struct, Flags int32 +pkg syscall (netbsd-arm-cgo), type IfMsghdr struct, Index uint16 +pkg syscall (netbsd-arm-cgo), type IfMsghdr struct, Msglen uint16 +pkg syscall (netbsd-arm-cgo), type IfMsghdr struct, Pad_cgo_0 [2]uint8 +pkg syscall (netbsd-arm-cgo), type IfMsghdr struct, Pad_cgo_1 [4]uint8 +pkg syscall (netbsd-arm-cgo), type IfMsghdr struct, Type uint8 +pkg syscall (netbsd-arm-cgo), type IfMsghdr struct, Version uint8 +pkg syscall (netbsd-arm-cgo), type IfaMsghdr struct +pkg syscall (netbsd-arm-cgo), type IfaMsghdr struct, Addrs int32 +pkg syscall (netbsd-arm-cgo), type IfaMsghdr struct, Flags int32 +pkg syscall (netbsd-arm-cgo), type IfaMsghdr struct, Index uint16 +pkg syscall (netbsd-arm-cgo), type IfaMsghdr struct, Metric int32 +pkg syscall (netbsd-arm-cgo), type IfaMsghdr struct, Msglen uint16 +pkg syscall (netbsd-arm-cgo), type IfaMsghdr struct, Pad_cgo_0 [6]uint8 +pkg syscall (netbsd-arm-cgo), type IfaMsghdr struct, Type uint8 +pkg syscall (netbsd-arm-cgo), type IfaMsghdr struct, Version uint8 +pkg syscall (netbsd-arm-cgo), type Inet6Pktinfo struct +pkg syscall (netbsd-arm-cgo), type Inet6Pktinfo struct, Addr [16]uint8 +pkg syscall (netbsd-arm-cgo), type Inet6Pktinfo struct, Ifindex uint32 +pkg syscall (netbsd-arm-cgo), type InterfaceAddrMessage struct +pkg syscall (netbsd-arm-cgo), type InterfaceAddrMessage struct, Data []uint8 +pkg syscall (netbsd-arm-cgo), type InterfaceAddrMessage struct, Header IfaMsghdr +pkg syscall (netbsd-arm-cgo), type InterfaceAnnounceMessage struct +pkg syscall (netbsd-arm-cgo), type InterfaceAnnounceMessage struct, Header IfAnnounceMsghdr +pkg syscall (netbsd-arm-cgo), type InterfaceMessage struct +pkg syscall (netbsd-arm-cgo), type InterfaceMessage struct, Data []uint8 +pkg syscall (netbsd-arm-cgo), type InterfaceMessage struct, Header IfMsghdr +pkg syscall (netbsd-arm-cgo), type Iovec struct +pkg syscall (netbsd-arm-cgo), type Iovec struct, Base *uint8 +pkg syscall (netbsd-arm-cgo), type Iovec struct, Len uint32 +pkg syscall (netbsd-arm-cgo), type Kevent_t struct +pkg syscall (netbsd-arm-cgo), type Kevent_t struct, Data int64 +pkg syscall (netbsd-arm-cgo), type Kevent_t struct, Fflags uint32 +pkg syscall (netbsd-arm-cgo), type Kevent_t struct, Filter uint32 +pkg syscall (netbsd-arm-cgo), type Kevent_t struct, Flags uint32 +pkg syscall (netbsd-arm-cgo), type Kevent_t struct, Ident uint32 +pkg syscall (netbsd-arm-cgo), type Kevent_t struct, Udata int32 +pkg syscall (netbsd-arm-cgo), type Mclpool [0]uint8 +pkg syscall (netbsd-arm-cgo), type Msghdr struct +pkg syscall (netbsd-arm-cgo), type Msghdr struct, Control *uint8 +pkg syscall (netbsd-arm-cgo), type Msghdr struct, Controllen uint32 +pkg syscall (netbsd-arm-cgo), type Msghdr struct, Flags int32 +pkg syscall (netbsd-arm-cgo), type Msghdr struct, Iov *Iovec +pkg syscall (netbsd-arm-cgo), type Msghdr struct, Iovlen int32 +pkg syscall (netbsd-arm-cgo), type Msghdr struct, Name *uint8 +pkg syscall (netbsd-arm-cgo), type Msghdr struct, Namelen uint32 +pkg syscall (netbsd-arm-cgo), type RawSockaddr struct, Data [14]int8 +pkg syscall (netbsd-arm-cgo), type RawSockaddr struct, Family uint8 +pkg syscall (netbsd-arm-cgo), type RawSockaddr struct, Len uint8 +pkg syscall (netbsd-arm-cgo), type RawSockaddrAny struct, Pad [92]int8 +pkg syscall (netbsd-arm-cgo), type RawSockaddrDatalink struct +pkg syscall (netbsd-arm-cgo), type RawSockaddrDatalink struct, Alen uint8 +pkg syscall (netbsd-arm-cgo), type RawSockaddrDatalink struct, Data [12]int8 +pkg syscall (netbsd-arm-cgo), type RawSockaddrDatalink struct, Family uint8 +pkg syscall (netbsd-arm-cgo), type RawSockaddrDatalink struct, Index uint16 +pkg syscall (netbsd-arm-cgo), type RawSockaddrDatalink struct, Len uint8 +pkg syscall (netbsd-arm-cgo), type RawSockaddrDatalink struct, Nlen uint8 +pkg syscall (netbsd-arm-cgo), type RawSockaddrDatalink struct, Slen uint8 +pkg syscall (netbsd-arm-cgo), type RawSockaddrDatalink struct, Type uint8 +pkg syscall (netbsd-arm-cgo), type RawSockaddrInet4 struct, Family uint8 +pkg syscall (netbsd-arm-cgo), type RawSockaddrInet4 struct, Len uint8 +pkg syscall (netbsd-arm-cgo), type RawSockaddrInet4 struct, Zero [8]int8 +pkg syscall (netbsd-arm-cgo), type RawSockaddrInet6 struct, Family uint8 +pkg syscall (netbsd-arm-cgo), type RawSockaddrInet6 struct, Len uint8 +pkg syscall (netbsd-arm-cgo), type RawSockaddrUnix struct +pkg syscall (netbsd-arm-cgo), type RawSockaddrUnix struct, Family uint8 +pkg syscall (netbsd-arm-cgo), type RawSockaddrUnix struct, Len uint8 +pkg syscall (netbsd-arm-cgo), type RawSockaddrUnix struct, Path [104]int8 +pkg syscall (netbsd-arm-cgo), type Rlimit struct +pkg syscall (netbsd-arm-cgo), type Rlimit struct, Cur uint64 +pkg syscall (netbsd-arm-cgo), type Rlimit struct, Max uint64 +pkg syscall (netbsd-arm-cgo), type RouteMessage struct +pkg syscall (netbsd-arm-cgo), type RouteMessage struct, Data []uint8 +pkg syscall (netbsd-arm-cgo), type RouteMessage struct, Header RtMsghdr +pkg syscall (netbsd-arm-cgo), type RoutingMessage interface, unexported methods +pkg syscall (netbsd-arm-cgo), type RtMetrics struct +pkg syscall (netbsd-arm-cgo), type RtMetrics struct, Expire int64 +pkg syscall (netbsd-arm-cgo), type RtMetrics struct, Hopcount uint64 +pkg syscall (netbsd-arm-cgo), type RtMetrics struct, Locks uint64 +pkg syscall (netbsd-arm-cgo), type RtMetrics struct, Mtu uint64 +pkg syscall (netbsd-arm-cgo), type RtMetrics struct, Pksent int64 +pkg syscall (netbsd-arm-cgo), type RtMetrics struct, Recvpipe uint64 +pkg syscall (netbsd-arm-cgo), type RtMetrics struct, Rtt uint64 +pkg syscall (netbsd-arm-cgo), type RtMetrics struct, Rttvar uint64 +pkg syscall (netbsd-arm-cgo), type RtMetrics struct, Sendpipe uint64 +pkg syscall (netbsd-arm-cgo), type RtMetrics struct, Ssthresh uint64 +pkg syscall (netbsd-arm-cgo), type RtMsghdr struct +pkg syscall (netbsd-arm-cgo), type RtMsghdr struct, Addrs int32 +pkg syscall (netbsd-arm-cgo), type RtMsghdr struct, Errno int32 +pkg syscall (netbsd-arm-cgo), type RtMsghdr struct, Flags int32 +pkg syscall (netbsd-arm-cgo), type RtMsghdr struct, Index uint16 +pkg syscall (netbsd-arm-cgo), type RtMsghdr struct, Inits int32 +pkg syscall (netbsd-arm-cgo), type RtMsghdr struct, Msglen uint16 +pkg syscall (netbsd-arm-cgo), type RtMsghdr struct, Pad_cgo_0 [2]uint8 +pkg syscall (netbsd-arm-cgo), type RtMsghdr struct, Pad_cgo_1 [4]uint8 +pkg syscall (netbsd-arm-cgo), type RtMsghdr struct, Pid int32 +pkg syscall (netbsd-arm-cgo), type RtMsghdr struct, Rmx RtMetrics +pkg syscall (netbsd-arm-cgo), type RtMsghdr struct, Seq int32 +pkg syscall (netbsd-arm-cgo), type RtMsghdr struct, Type uint8 +pkg syscall (netbsd-arm-cgo), type RtMsghdr struct, Use int32 +pkg syscall (netbsd-arm-cgo), type RtMsghdr struct, Version uint8 +pkg syscall (netbsd-arm-cgo), type Rusage struct, Idrss int32 +pkg syscall (netbsd-arm-cgo), type Rusage struct, Inblock int32 +pkg syscall (netbsd-arm-cgo), type Rusage struct, Isrss int32 +pkg syscall (netbsd-arm-cgo), type Rusage struct, Ixrss int32 +pkg syscall (netbsd-arm-cgo), type Rusage struct, Majflt int32 +pkg syscall (netbsd-arm-cgo), type Rusage struct, Maxrss int32 +pkg syscall (netbsd-arm-cgo), type Rusage struct, Minflt int32 +pkg syscall (netbsd-arm-cgo), type Rusage struct, Msgrcv int32 +pkg syscall (netbsd-arm-cgo), type Rusage struct, Msgsnd int32 +pkg syscall (netbsd-arm-cgo), type Rusage struct, Nivcsw int32 +pkg syscall (netbsd-arm-cgo), type Rusage struct, Nsignals int32 +pkg syscall (netbsd-arm-cgo), type Rusage struct, Nswap int32 +pkg syscall (netbsd-arm-cgo), type Rusage struct, Nvcsw int32 +pkg syscall (netbsd-arm-cgo), type Rusage struct, Oublock int32 +pkg syscall (netbsd-arm-cgo), type Rusage struct, Stime Timeval +pkg syscall (netbsd-arm-cgo), type Rusage struct, Utime Timeval +pkg syscall (netbsd-arm-cgo), type SockaddrDatalink struct +pkg syscall (netbsd-arm-cgo), type SockaddrDatalink struct, Alen uint8 +pkg syscall (netbsd-arm-cgo), type SockaddrDatalink struct, Data [12]int8 +pkg syscall (netbsd-arm-cgo), type SockaddrDatalink struct, Family uint8 +pkg syscall (netbsd-arm-cgo), type SockaddrDatalink struct, Index uint16 +pkg syscall (netbsd-arm-cgo), type SockaddrDatalink struct, Len uint8 +pkg syscall (netbsd-arm-cgo), type SockaddrDatalink struct, Nlen uint8 +pkg syscall (netbsd-arm-cgo), type SockaddrDatalink struct, Slen uint8 +pkg syscall (netbsd-arm-cgo), type SockaddrDatalink struct, Type uint8 +pkg syscall (netbsd-arm-cgo), type SocketControlMessage struct +pkg syscall (netbsd-arm-cgo), type SocketControlMessage struct, Data []uint8 +pkg syscall (netbsd-arm-cgo), type SocketControlMessage struct, Header Cmsghdr +pkg syscall (netbsd-arm-cgo), type Stat_t struct +pkg syscall (netbsd-arm-cgo), type Stat_t struct, Atimespec Timespec +pkg syscall (netbsd-arm-cgo), type Stat_t struct, Birthtimespec Timespec +pkg syscall (netbsd-arm-cgo), type Stat_t struct, Blksize uint32 +pkg syscall (netbsd-arm-cgo), type Stat_t struct, Blocks int64 +pkg syscall (netbsd-arm-cgo), type Stat_t struct, Ctimespec Timespec +pkg syscall (netbsd-arm-cgo), type Stat_t struct, Dev uint64 +pkg syscall (netbsd-arm-cgo), type Stat_t struct, Flags uint32 +pkg syscall (netbsd-arm-cgo), type Stat_t struct, Gen uint32 +pkg syscall (netbsd-arm-cgo), type Stat_t struct, Gid uint32 +pkg syscall (netbsd-arm-cgo), type Stat_t struct, Ino uint64 +pkg syscall (netbsd-arm-cgo), type Stat_t struct, Mode uint32 +pkg syscall (netbsd-arm-cgo), type Stat_t struct, Mtimespec Timespec +pkg syscall (netbsd-arm-cgo), type Stat_t struct, Nlink uint32 +pkg syscall (netbsd-arm-cgo), type Stat_t struct, Rdev uint64 +pkg syscall (netbsd-arm-cgo), type Stat_t struct, Size int64 +pkg syscall (netbsd-arm-cgo), type Stat_t struct, Spare [2]uint32 +pkg syscall (netbsd-arm-cgo), type Stat_t struct, Uid uint32 +pkg syscall (netbsd-arm-cgo), type Statfs_t [0]uint8 +pkg syscall (netbsd-arm-cgo), type SysProcAttr struct, Chroot string +pkg syscall (netbsd-arm-cgo), type SysProcAttr struct, Credential *Credential +pkg syscall (netbsd-arm-cgo), type SysProcAttr struct, Noctty bool +pkg syscall (netbsd-arm-cgo), type SysProcAttr struct, Ptrace bool +pkg syscall (netbsd-arm-cgo), type SysProcAttr struct, Setctty bool +pkg syscall (netbsd-arm-cgo), type SysProcAttr struct, Setpgid bool +pkg syscall (netbsd-arm-cgo), type SysProcAttr struct, Setsid bool +pkg syscall (netbsd-arm-cgo), type Sysctlnode struct +pkg syscall (netbsd-arm-cgo), type Sysctlnode struct, Flags uint32 +pkg syscall (netbsd-arm-cgo), type Sysctlnode struct, Name [32]int8 +pkg syscall (netbsd-arm-cgo), type Sysctlnode struct, Num int32 +pkg syscall (netbsd-arm-cgo), type Sysctlnode struct, Un [16]uint8 +pkg syscall (netbsd-arm-cgo), type Sysctlnode struct, Ver uint32 +pkg syscall (netbsd-arm-cgo), type Sysctlnode struct, X__rsvd uint32 +pkg syscall (netbsd-arm-cgo), type Sysctlnode struct, X_sysctl_desc [8]uint8 +pkg syscall (netbsd-arm-cgo), type Sysctlnode struct, X_sysctl_func [8]uint8 +pkg syscall (netbsd-arm-cgo), type Sysctlnode struct, X_sysctl_parent [8]uint8 +pkg syscall (netbsd-arm-cgo), type Sysctlnode struct, X_sysctl_size [8]uint8 +pkg syscall (netbsd-arm-cgo), type Timespec struct, Nsec int32 +pkg syscall (netbsd-arm-cgo), type Timespec struct, Sec int64 +pkg syscall (netbsd-arm-cgo), type Timeval struct, Sec int64 +pkg syscall (netbsd-arm-cgo), type Timeval struct, Usec int32 +pkg syscall (netbsd-arm-cgo), type WaitStatus uint32 +pkg syscall (netbsd-arm-cgo), var Stderr int +pkg syscall (netbsd-arm-cgo), var Stdin int +pkg syscall (netbsd-arm-cgo), var Stdout int +pkg syscall (openbsd-386), const AF_APPLETALK ideal-int +pkg syscall (openbsd-386), const AF_BLUETOOTH ideal-int +pkg syscall (openbsd-386), const AF_CCITT ideal-int +pkg syscall (openbsd-386), const AF_CHAOS ideal-int +pkg syscall (openbsd-386), const AF_CNT ideal-int +pkg syscall (openbsd-386), const AF_COIP ideal-int +pkg syscall (openbsd-386), const AF_DATAKIT ideal-int +pkg syscall (openbsd-386), const AF_DECnet ideal-int +pkg syscall (openbsd-386), const AF_DLI ideal-int +pkg syscall (openbsd-386), const AF_E164 ideal-int +pkg syscall (openbsd-386), const AF_ECMA ideal-int +pkg syscall (openbsd-386), const AF_ENCAP ideal-int +pkg syscall (openbsd-386), const AF_HYLINK ideal-int +pkg syscall (openbsd-386), const AF_IMPLINK ideal-int +pkg syscall (openbsd-386), const AF_IPX ideal-int +pkg syscall (openbsd-386), const AF_ISDN ideal-int +pkg syscall (openbsd-386), const AF_ISO ideal-int +pkg syscall (openbsd-386), const AF_KEY ideal-int +pkg syscall (openbsd-386), const AF_LAT ideal-int +pkg syscall (openbsd-386), const AF_LINK ideal-int +pkg syscall (openbsd-386), const AF_LOCAL ideal-int +pkg syscall (openbsd-386), const AF_MAX ideal-int +pkg syscall (openbsd-386), const AF_MPLS ideal-int +pkg syscall (openbsd-386), const AF_NATM ideal-int +pkg syscall (openbsd-386), const AF_NS ideal-int +pkg syscall (openbsd-386), const AF_OSI ideal-int +pkg syscall (openbsd-386), const AF_PUP ideal-int +pkg syscall (openbsd-386), const AF_ROUTE ideal-int +pkg syscall (openbsd-386), const AF_SIP ideal-int +pkg syscall (openbsd-386), const AF_SNA ideal-int +pkg syscall (openbsd-386), const ARPHRD_ETHER ideal-int +pkg syscall (openbsd-386), const ARPHRD_FRELAY ideal-int +pkg syscall (openbsd-386), const ARPHRD_IEEE1394 ideal-int +pkg syscall (openbsd-386), const ARPHRD_IEEE802 ideal-int +pkg syscall (openbsd-386), const B0 ideal-int +pkg syscall (openbsd-386), const B110 ideal-int +pkg syscall (openbsd-386), const B115200 ideal-int +pkg syscall (openbsd-386), const B1200 ideal-int +pkg syscall (openbsd-386), const B134 ideal-int +pkg syscall (openbsd-386), const B14400 ideal-int +pkg syscall (openbsd-386), const B150 ideal-int +pkg syscall (openbsd-386), const B1800 ideal-int +pkg syscall (openbsd-386), const B19200 ideal-int +pkg syscall (openbsd-386), const B200 ideal-int +pkg syscall (openbsd-386), const B230400 ideal-int +pkg syscall (openbsd-386), const B2400 ideal-int +pkg syscall (openbsd-386), const B28800 ideal-int +pkg syscall (openbsd-386), const B300 ideal-int +pkg syscall (openbsd-386), const B38400 ideal-int +pkg syscall (openbsd-386), const B4800 ideal-int +pkg syscall (openbsd-386), const B50 ideal-int +pkg syscall (openbsd-386), const B57600 ideal-int +pkg syscall (openbsd-386), const B600 ideal-int +pkg syscall (openbsd-386), const B7200 ideal-int +pkg syscall (openbsd-386), const B75 ideal-int +pkg syscall (openbsd-386), const B76800 ideal-int +pkg syscall (openbsd-386), const B9600 ideal-int +pkg syscall (openbsd-386), const BIOCFLUSH ideal-int +pkg syscall (openbsd-386), const BIOCGBLEN ideal-int +pkg syscall (openbsd-386), const BIOCGDIRFILT ideal-int +pkg syscall (openbsd-386), const BIOCGDLT ideal-int +pkg syscall (openbsd-386), const BIOCGDLTLIST ideal-int +pkg syscall (openbsd-386), const BIOCGETIF ideal-int +pkg syscall (openbsd-386), const BIOCGFILDROP ideal-int +pkg syscall (openbsd-386), const BIOCGHDRCMPLT ideal-int +pkg syscall (openbsd-386), const BIOCGRSIG ideal-int +pkg syscall (openbsd-386), const BIOCGRTIMEOUT ideal-int +pkg syscall (openbsd-386), const BIOCGSTATS ideal-int +pkg syscall (openbsd-386), const BIOCIMMEDIATE ideal-int +pkg syscall (openbsd-386), const BIOCLOCK ideal-int +pkg syscall (openbsd-386), const BIOCPROMISC ideal-int +pkg syscall (openbsd-386), const BIOCSBLEN ideal-int +pkg syscall (openbsd-386), const BIOCSDIRFILT ideal-int +pkg syscall (openbsd-386), const BIOCSDLT ideal-int +pkg syscall (openbsd-386), const BIOCSETF ideal-int +pkg syscall (openbsd-386), const BIOCSETIF ideal-int +pkg syscall (openbsd-386), const BIOCSETWF ideal-int +pkg syscall (openbsd-386), const BIOCSFILDROP ideal-int +pkg syscall (openbsd-386), const BIOCSHDRCMPLT ideal-int +pkg syscall (openbsd-386), const BIOCSRSIG ideal-int +pkg syscall (openbsd-386), const BIOCSRTIMEOUT ideal-int +pkg syscall (openbsd-386), const BIOCVERSION ideal-int +pkg syscall (openbsd-386), const BPF_A ideal-int +pkg syscall (openbsd-386), const BPF_ABS ideal-int +pkg syscall (openbsd-386), const BPF_ADD ideal-int +pkg syscall (openbsd-386), const BPF_ALIGNMENT ideal-int +pkg syscall (openbsd-386), const BPF_ALU ideal-int +pkg syscall (openbsd-386), const BPF_AND ideal-int +pkg syscall (openbsd-386), const BPF_B ideal-int +pkg syscall (openbsd-386), const BPF_DIRECTION_IN ideal-int +pkg syscall (openbsd-386), const BPF_DIRECTION_OUT ideal-int +pkg syscall (openbsd-386), const BPF_DIV ideal-int +pkg syscall (openbsd-386), const BPF_H ideal-int +pkg syscall (openbsd-386), const BPF_IMM ideal-int +pkg syscall (openbsd-386), const BPF_IND ideal-int +pkg syscall (openbsd-386), const BPF_JA ideal-int +pkg syscall (openbsd-386), const BPF_JEQ ideal-int +pkg syscall (openbsd-386), const BPF_JGE ideal-int +pkg syscall (openbsd-386), const BPF_JGT ideal-int +pkg syscall (openbsd-386), const BPF_JMP ideal-int +pkg syscall (openbsd-386), const BPF_JSET ideal-int +pkg syscall (openbsd-386), const BPF_K ideal-int +pkg syscall (openbsd-386), const BPF_LD ideal-int +pkg syscall (openbsd-386), const BPF_LDX ideal-int +pkg syscall (openbsd-386), const BPF_LEN ideal-int +pkg syscall (openbsd-386), const BPF_LSH ideal-int +pkg syscall (openbsd-386), const BPF_MAJOR_VERSION ideal-int +pkg syscall (openbsd-386), const BPF_MAXBUFSIZE ideal-int +pkg syscall (openbsd-386), const BPF_MAXINSNS ideal-int +pkg syscall (openbsd-386), const BPF_MEM ideal-int +pkg syscall (openbsd-386), const BPF_MEMWORDS ideal-int +pkg syscall (openbsd-386), const BPF_MINBUFSIZE ideal-int +pkg syscall (openbsd-386), const BPF_MINOR_VERSION ideal-int +pkg syscall (openbsd-386), const BPF_MISC ideal-int +pkg syscall (openbsd-386), const BPF_MSH ideal-int +pkg syscall (openbsd-386), const BPF_MUL ideal-int +pkg syscall (openbsd-386), const BPF_NEG ideal-int +pkg syscall (openbsd-386), const BPF_OR ideal-int +pkg syscall (openbsd-386), const BPF_RELEASE ideal-int +pkg syscall (openbsd-386), const BPF_RET ideal-int +pkg syscall (openbsd-386), const BPF_RSH ideal-int +pkg syscall (openbsd-386), const BPF_ST ideal-int +pkg syscall (openbsd-386), const BPF_STX ideal-int +pkg syscall (openbsd-386), const BPF_SUB ideal-int +pkg syscall (openbsd-386), const BPF_TAX ideal-int +pkg syscall (openbsd-386), const BPF_TXA ideal-int +pkg syscall (openbsd-386), const BPF_W ideal-int +pkg syscall (openbsd-386), const BPF_X ideal-int +pkg syscall (openbsd-386), const BRKINT ideal-int +pkg syscall (openbsd-386), const CFLUSH ideal-int +pkg syscall (openbsd-386), const CLOCAL ideal-int +pkg syscall (openbsd-386), const CREAD ideal-int +pkg syscall (openbsd-386), const CS5 ideal-int +pkg syscall (openbsd-386), const CS6 ideal-int +pkg syscall (openbsd-386), const CS7 ideal-int +pkg syscall (openbsd-386), const CS8 ideal-int +pkg syscall (openbsd-386), const CSIZE ideal-int +pkg syscall (openbsd-386), const CSTART ideal-int +pkg syscall (openbsd-386), const CSTATUS ideal-int +pkg syscall (openbsd-386), const CSTOP ideal-int +pkg syscall (openbsd-386), const CSTOPB ideal-int +pkg syscall (openbsd-386), const CSUSP ideal-int +pkg syscall (openbsd-386), const CTL_MAXNAME ideal-int +pkg syscall (openbsd-386), const CTL_NET ideal-int +pkg syscall (openbsd-386), const DIOCOSFPFLUSH ideal-int +pkg syscall (openbsd-386), const DLT_ARCNET ideal-int +pkg syscall (openbsd-386), const DLT_ATM_RFC1483 ideal-int +pkg syscall (openbsd-386), const DLT_AX25 ideal-int +pkg syscall (openbsd-386), const DLT_CHAOS ideal-int +pkg syscall (openbsd-386), const DLT_C_HDLC ideal-int +pkg syscall (openbsd-386), const DLT_EN10MB ideal-int +pkg syscall (openbsd-386), const DLT_EN3MB ideal-int +pkg syscall (openbsd-386), const DLT_ENC ideal-int +pkg syscall (openbsd-386), const DLT_FDDI ideal-int +pkg syscall (openbsd-386), const DLT_IEEE802 ideal-int +pkg syscall (openbsd-386), const DLT_IEEE802_11 ideal-int +pkg syscall (openbsd-386), const DLT_IEEE802_11_RADIO ideal-int +pkg syscall (openbsd-386), const DLT_LOOP ideal-int +pkg syscall (openbsd-386), const DLT_MPLS ideal-int +pkg syscall (openbsd-386), const DLT_NULL ideal-int +pkg syscall (openbsd-386), const DLT_PFLOG ideal-int +pkg syscall (openbsd-386), const DLT_PFSYNC ideal-int +pkg syscall (openbsd-386), const DLT_PPP ideal-int +pkg syscall (openbsd-386), const DLT_PPP_BSDOS ideal-int +pkg syscall (openbsd-386), const DLT_PPP_ETHER ideal-int +pkg syscall (openbsd-386), const DLT_PPP_SERIAL ideal-int +pkg syscall (openbsd-386), const DLT_PRONET ideal-int +pkg syscall (openbsd-386), const DLT_RAW ideal-int +pkg syscall (openbsd-386), const DLT_SLIP ideal-int +pkg syscall (openbsd-386), const DLT_SLIP_BSDOS ideal-int +pkg syscall (openbsd-386), const DT_BLK ideal-int +pkg syscall (openbsd-386), const DT_CHR ideal-int +pkg syscall (openbsd-386), const DT_DIR ideal-int +pkg syscall (openbsd-386), const DT_FIFO ideal-int +pkg syscall (openbsd-386), const DT_LNK ideal-int +pkg syscall (openbsd-386), const DT_REG ideal-int +pkg syscall (openbsd-386), const DT_SOCK ideal-int +pkg syscall (openbsd-386), const DT_UNKNOWN ideal-int +pkg syscall (openbsd-386), const EAUTH Errno +pkg syscall (openbsd-386), const EBADRPC Errno +pkg syscall (openbsd-386), const ECHO ideal-int +pkg syscall (openbsd-386), const ECHOCTL ideal-int +pkg syscall (openbsd-386), const ECHOE ideal-int +pkg syscall (openbsd-386), const ECHOK ideal-int +pkg syscall (openbsd-386), const ECHOKE ideal-int +pkg syscall (openbsd-386), const ECHONL ideal-int +pkg syscall (openbsd-386), const ECHOPRT ideal-int +pkg syscall (openbsd-386), const EFTYPE Errno +pkg syscall (openbsd-386), const EIPSEC Errno +pkg syscall (openbsd-386), const ELAST Errno +pkg syscall (openbsd-386), const EMEDIUMTYPE Errno +pkg syscall (openbsd-386), const EMT_TAGOVF ideal-int +pkg syscall (openbsd-386), const EMUL_ENABLED ideal-int +pkg syscall (openbsd-386), const EMUL_NATIVE ideal-int +pkg syscall (openbsd-386), const ENDRUNDISC ideal-int +pkg syscall (openbsd-386), const ENEEDAUTH Errno +pkg syscall (openbsd-386), const ENOATTR Errno +pkg syscall (openbsd-386), const ENOMEDIUM Errno +pkg syscall (openbsd-386), const EPROCLIM Errno +pkg syscall (openbsd-386), const EPROCUNAVAIL Errno +pkg syscall (openbsd-386), const EPROGMISMATCH Errno +pkg syscall (openbsd-386), const EPROGUNAVAIL Errno +pkg syscall (openbsd-386), const ERPCMISMATCH Errno +pkg syscall (openbsd-386), const ETHERMIN ideal-int +pkg syscall (openbsd-386), const ETHERMTU ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_8023 ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_AARP ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_ACCTON ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_AEONIC ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_ALPHA ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_AMBER ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_AMOEBA ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_AOE ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_APOLLO ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_APOLLODOMAIN ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_APPLETALK ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_APPLITEK ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_ARGONAUT ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_ARP ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_AT ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_ATALK ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_ATOMIC ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_ATT ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_ATTSTANFORD ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_AUTOPHON ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_AXIS ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_BCLOOP ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_BOFL ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_CABLETRON ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_CHAOS ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_COMDESIGN ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_COMPUGRAPHIC ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_COUNTERPOINT ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_CRONUS ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_CRONUSVLN ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_DCA ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_DDE ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_DEBNI ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_DECAM ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_DECCUST ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_DECDIAG ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_DECDNS ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_DECDTS ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_DECEXPER ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_DECLAST ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_DECLTM ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_DECMUMPS ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_DECNETBIOS ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_DELTACON ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_DIDDLE ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_DLOG1 ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_DLOG2 ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_DN ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_DOGFIGHT ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_DSMD ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_ECMA ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_ENCRYPT ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_ES ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_EXCELAN ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_EXPERDATA ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_FLIP ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_FLOWCONTROL ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_FRARP ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_GENDYN ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_HAYES ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_HIPPI_FP ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_HITACHI ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_HP ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_IEEEPUP ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_IEEEPUPAT ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_IMLBL ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_IMLBLDIAG ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_IP ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_IPAS ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_IPV6 ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_IPX ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_IPXNEW ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_KALPANA ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_LANBRIDGE ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_LANPROBE ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_LAT ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_LBACK ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_LITTLE ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_LLDP ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_LOGICRAFT ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_LOOPBACK ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_MATRA ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_MAX ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_MERIT ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_MICP ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_MOPDL ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_MOPRC ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_MOTOROLA ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_MPLS ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_MPLS_MCAST ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_MUMPS ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_NBPCC ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_NBPCLAIM ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_NBPCLREQ ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_NBPCLRSP ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_NBPCREQ ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_NBPCRSP ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_NBPDG ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_NBPDGB ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_NBPDLTE ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_NBPRAR ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_NBPRAS ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_NBPRST ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_NBPSCD ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_NBPVCD ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_NBS ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_NCD ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_NESTAR ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_NETBEUI ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_NOVELL ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_NS ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_NSAT ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_NSCOMPAT ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_NTRAILER ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_OS9 ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_OS9NET ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_PACER ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_PAE ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_PCS ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_PLANNING ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_PPP ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_PPPOE ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_PPPOEDISC ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_PRIMENTS ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_PUP ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_PUPAT ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_QINQ ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_RACAL ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_RATIONAL ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_RAWFR ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_RCL ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_RDP ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_RETIX ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_REVARP ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_SCA ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_SECTRA ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_SECUREDATA ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_SGITW ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_SG_BOUNCE ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_SG_DIAG ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_SG_NETGAMES ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_SG_RESV ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_SIMNET ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_SLOW ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_SNA ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_SNMP ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_SONIX ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_SPIDER ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_SPRITE ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_STP ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_TALARIS ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_TALARISMC ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_TCPCOMP ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_TCPSM ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_TEC ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_TIGAN ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_TRAIL ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_TRANSETHER ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_TYMSHARE ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_UBBST ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_UBDEBUG ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_UBDIAGLOOP ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_UBDL ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_UBNIU ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_UBNMC ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_VALID ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_VARIAN ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_VAXELN ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_VEECO ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_VEXP ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_VGLAB ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_VINES ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_VINESECHO ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_VINESLOOP ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_VITAL ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_VLAN ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_VLTLMAN ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_VPROD ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_VURESERVED ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_WATERLOO ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_WELLFLEET ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_X25 ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_X75 ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_XNSSM ideal-int +pkg syscall (openbsd-386), const ETHERTYPE_XTP ideal-int +pkg syscall (openbsd-386), const ETHER_ADDR_LEN ideal-int +pkg syscall (openbsd-386), const ETHER_ALIGN ideal-int +pkg syscall (openbsd-386), const ETHER_CRC_LEN ideal-int +pkg syscall (openbsd-386), const ETHER_CRC_POLY_BE ideal-int +pkg syscall (openbsd-386), const ETHER_CRC_POLY_LE ideal-int +pkg syscall (openbsd-386), const ETHER_HDR_LEN ideal-int +pkg syscall (openbsd-386), const ETHER_MAX_DIX_LEN ideal-int +pkg syscall (openbsd-386), const ETHER_MAX_LEN ideal-int +pkg syscall (openbsd-386), const ETHER_MIN_LEN ideal-int +pkg syscall (openbsd-386), const ETHER_TYPE_LEN ideal-int +pkg syscall (openbsd-386), const ETHER_VLAN_ENCAP_LEN ideal-int +pkg syscall (openbsd-386), const EVFILT_AIO ideal-int +pkg syscall (openbsd-386), const EVFILT_PROC ideal-int +pkg syscall (openbsd-386), const EVFILT_READ ideal-int +pkg syscall (openbsd-386), const EVFILT_SIGNAL ideal-int +pkg syscall (openbsd-386), const EVFILT_SYSCOUNT ideal-int +pkg syscall (openbsd-386), const EVFILT_TIMER ideal-int +pkg syscall (openbsd-386), const EVFILT_VNODE ideal-int +pkg syscall (openbsd-386), const EVFILT_WRITE ideal-int +pkg syscall (openbsd-386), const EV_ADD ideal-int +pkg syscall (openbsd-386), const EV_CLEAR ideal-int +pkg syscall (openbsd-386), const EV_DELETE ideal-int +pkg syscall (openbsd-386), const EV_DISABLE ideal-int +pkg syscall (openbsd-386), const EV_ENABLE ideal-int +pkg syscall (openbsd-386), const EV_EOF ideal-int +pkg syscall (openbsd-386), const EV_ERROR ideal-int +pkg syscall (openbsd-386), const EV_FLAG1 ideal-int +pkg syscall (openbsd-386), const EV_ONESHOT ideal-int +pkg syscall (openbsd-386), const EV_SYSFLAGS ideal-int +pkg syscall (openbsd-386), const EXTA ideal-int +pkg syscall (openbsd-386), const EXTB ideal-int +pkg syscall (openbsd-386), const EXTPROC ideal-int +pkg syscall (openbsd-386), const FD_CLOEXEC ideal-int +pkg syscall (openbsd-386), const FD_SETSIZE ideal-int +pkg syscall (openbsd-386), const FLUSHO ideal-int +pkg syscall (openbsd-386), const F_DUPFD ideal-int +pkg syscall (openbsd-386), const F_DUPFD_CLOEXEC ideal-int +pkg syscall (openbsd-386), const F_GETFD ideal-int +pkg syscall (openbsd-386), const F_GETFL ideal-int +pkg syscall (openbsd-386), const F_GETLK ideal-int +pkg syscall (openbsd-386), const F_GETOWN ideal-int +pkg syscall (openbsd-386), const F_OK ideal-int +pkg syscall (openbsd-386), const F_RDLCK ideal-int +pkg syscall (openbsd-386), const F_SETFD ideal-int +pkg syscall (openbsd-386), const F_SETFL ideal-int +pkg syscall (openbsd-386), const F_SETLK ideal-int +pkg syscall (openbsd-386), const F_SETLKW ideal-int +pkg syscall (openbsd-386), const F_SETOWN ideal-int +pkg syscall (openbsd-386), const F_UNLCK ideal-int +pkg syscall (openbsd-386), const F_WRLCK ideal-int +pkg syscall (openbsd-386), const HUPCL ideal-int +pkg syscall (openbsd-386), const ICANON ideal-int +pkg syscall (openbsd-386), const ICMP6_FILTER = 18 +pkg syscall (openbsd-386), const ICMP6_FILTER ideal-int +pkg syscall (openbsd-386), const ICRNL ideal-int +pkg syscall (openbsd-386), const IEXTEN ideal-int +pkg syscall (openbsd-386), const IFAN_ARRIVAL ideal-int +pkg syscall (openbsd-386), const IFAN_DEPARTURE ideal-int +pkg syscall (openbsd-386), const IFA_ROUTE ideal-int +pkg syscall (openbsd-386), const IFF_ALLMULTI ideal-int +pkg syscall (openbsd-386), const IFF_CANTCHANGE ideal-int +pkg syscall (openbsd-386), const IFF_DEBUG ideal-int +pkg syscall (openbsd-386), const IFF_LINK0 ideal-int +pkg syscall (openbsd-386), const IFF_LINK1 ideal-int +pkg syscall (openbsd-386), const IFF_LINK2 ideal-int +pkg syscall (openbsd-386), const IFF_NOARP ideal-int +pkg syscall (openbsd-386), const IFF_NOTRAILERS ideal-int +pkg syscall (openbsd-386), const IFF_OACTIVE ideal-int +pkg syscall (openbsd-386), const IFF_POINTOPOINT ideal-int +pkg syscall (openbsd-386), const IFF_PROMISC ideal-int +pkg syscall (openbsd-386), const IFF_RUNNING ideal-int +pkg syscall (openbsd-386), const IFF_SIMPLEX ideal-int +pkg syscall (openbsd-386), const IFNAMSIZ ideal-int +pkg syscall (openbsd-386), const IFT_1822 ideal-int +pkg syscall (openbsd-386), const IFT_A12MPPSWITCH ideal-int +pkg syscall (openbsd-386), const IFT_AAL2 ideal-int +pkg syscall (openbsd-386), const IFT_AAL5 ideal-int +pkg syscall (openbsd-386), const IFT_ADSL ideal-int +pkg syscall (openbsd-386), const IFT_AFLANE8023 ideal-int +pkg syscall (openbsd-386), const IFT_AFLANE8025 ideal-int +pkg syscall (openbsd-386), const IFT_ARAP ideal-int +pkg syscall (openbsd-386), const IFT_ARCNET ideal-int +pkg syscall (openbsd-386), const IFT_ARCNETPLUS ideal-int +pkg syscall (openbsd-386), const IFT_ASYNC ideal-int +pkg syscall (openbsd-386), const IFT_ATM ideal-int +pkg syscall (openbsd-386), const IFT_ATMDXI ideal-int +pkg syscall (openbsd-386), const IFT_ATMFUNI ideal-int +pkg syscall (openbsd-386), const IFT_ATMIMA ideal-int +pkg syscall (openbsd-386), const IFT_ATMLOGICAL ideal-int +pkg syscall (openbsd-386), const IFT_ATMRADIO ideal-int +pkg syscall (openbsd-386), const IFT_ATMSUBINTERFACE ideal-int +pkg syscall (openbsd-386), const IFT_ATMVCIENDPT ideal-int +pkg syscall (openbsd-386), const IFT_ATMVIRTUAL ideal-int +pkg syscall (openbsd-386), const IFT_BGPPOLICYACCOUNTING ideal-int +pkg syscall (openbsd-386), const IFT_BLUETOOTH ideal-int +pkg syscall (openbsd-386), const IFT_BRIDGE ideal-int +pkg syscall (openbsd-386), const IFT_BSC ideal-int +pkg syscall (openbsd-386), const IFT_CARP ideal-int +pkg syscall (openbsd-386), const IFT_CCTEMUL ideal-int +pkg syscall (openbsd-386), const IFT_CEPT ideal-int +pkg syscall (openbsd-386), const IFT_CES ideal-int +pkg syscall (openbsd-386), const IFT_CHANNEL ideal-int +pkg syscall (openbsd-386), const IFT_CNR ideal-int +pkg syscall (openbsd-386), const IFT_COFFEE ideal-int +pkg syscall (openbsd-386), const IFT_COMPOSITELINK ideal-int +pkg syscall (openbsd-386), const IFT_DCN ideal-int +pkg syscall (openbsd-386), const IFT_DIGITALPOWERLINE ideal-int +pkg syscall (openbsd-386), const IFT_DIGITALWRAPPEROVERHEADCHANNEL ideal-int +pkg syscall (openbsd-386), const IFT_DLSW ideal-int +pkg syscall (openbsd-386), const IFT_DOCSCABLEDOWNSTREAM ideal-int +pkg syscall (openbsd-386), const IFT_DOCSCABLEMACLAYER ideal-int +pkg syscall (openbsd-386), const IFT_DOCSCABLEUPSTREAM ideal-int +pkg syscall (openbsd-386), const IFT_DOCSCABLEUPSTREAMCHANNEL ideal-int +pkg syscall (openbsd-386), const IFT_DS0 ideal-int +pkg syscall (openbsd-386), const IFT_DS0BUNDLE ideal-int +pkg syscall (openbsd-386), const IFT_DS1FDL ideal-int +pkg syscall (openbsd-386), const IFT_DS3 ideal-int +pkg syscall (openbsd-386), const IFT_DTM ideal-int +pkg syscall (openbsd-386), const IFT_DUMMY ideal-int +pkg syscall (openbsd-386), const IFT_DVBASILN ideal-int +pkg syscall (openbsd-386), const IFT_DVBASIOUT ideal-int +pkg syscall (openbsd-386), const IFT_DVBRCCDOWNSTREAM ideal-int +pkg syscall (openbsd-386), const IFT_DVBRCCMACLAYER ideal-int +pkg syscall (openbsd-386), const IFT_DVBRCCUPSTREAM ideal-int +pkg syscall (openbsd-386), const IFT_ECONET ideal-int +pkg syscall (openbsd-386), const IFT_ENC ideal-int +pkg syscall (openbsd-386), const IFT_EON ideal-int +pkg syscall (openbsd-386), const IFT_EPLRS ideal-int +pkg syscall (openbsd-386), const IFT_ESCON ideal-int +pkg syscall (openbsd-386), const IFT_ETHER ideal-int +pkg syscall (openbsd-386), const IFT_FAITH ideal-int +pkg syscall (openbsd-386), const IFT_FAST ideal-int +pkg syscall (openbsd-386), const IFT_FASTETHER ideal-int +pkg syscall (openbsd-386), const IFT_FASTETHERFX ideal-int +pkg syscall (openbsd-386), const IFT_FDDI ideal-int +pkg syscall (openbsd-386), const IFT_FIBRECHANNEL ideal-int +pkg syscall (openbsd-386), const IFT_FRAMERELAYINTERCONNECT ideal-int +pkg syscall (openbsd-386), const IFT_FRAMERELAYMPI ideal-int +pkg syscall (openbsd-386), const IFT_FRDLCIENDPT ideal-int +pkg syscall (openbsd-386), const IFT_FRELAY ideal-int +pkg syscall (openbsd-386), const IFT_FRELAYDCE ideal-int +pkg syscall (openbsd-386), const IFT_FRF16MFRBUNDLE ideal-int +pkg syscall (openbsd-386), const IFT_FRFORWARD ideal-int +pkg syscall (openbsd-386), const IFT_G703AT2MB ideal-int +pkg syscall (openbsd-386), const IFT_G703AT64K ideal-int +pkg syscall (openbsd-386), const IFT_GIF ideal-int +pkg syscall (openbsd-386), const IFT_GIGABITETHERNET ideal-int +pkg syscall (openbsd-386), const IFT_GR303IDT ideal-int +pkg syscall (openbsd-386), const IFT_GR303RDT ideal-int +pkg syscall (openbsd-386), const IFT_H323GATEKEEPER ideal-int +pkg syscall (openbsd-386), const IFT_H323PROXY ideal-int +pkg syscall (openbsd-386), const IFT_HDH1822 ideal-int +pkg syscall (openbsd-386), const IFT_HDLC ideal-int +pkg syscall (openbsd-386), const IFT_HDSL2 ideal-int +pkg syscall (openbsd-386), const IFT_HIPERLAN2 ideal-int +pkg syscall (openbsd-386), const IFT_HIPPI ideal-int +pkg syscall (openbsd-386), const IFT_HIPPIINTERFACE ideal-int +pkg syscall (openbsd-386), const IFT_HOSTPAD ideal-int +pkg syscall (openbsd-386), const IFT_HSSI ideal-int +pkg syscall (openbsd-386), const IFT_HY ideal-int +pkg syscall (openbsd-386), const IFT_IBM370PARCHAN ideal-int +pkg syscall (openbsd-386), const IFT_IDSL ideal-int +pkg syscall (openbsd-386), const IFT_IEEE1394 ideal-int +pkg syscall (openbsd-386), const IFT_IEEE80211 ideal-int +pkg syscall (openbsd-386), const IFT_IEEE80212 ideal-int +pkg syscall (openbsd-386), const IFT_IEEE8023ADLAG ideal-int +pkg syscall (openbsd-386), const IFT_IFGSN ideal-int +pkg syscall (openbsd-386), const IFT_IMT ideal-int +pkg syscall (openbsd-386), const IFT_INFINIBAND ideal-int +pkg syscall (openbsd-386), const IFT_INTERLEAVE ideal-int +pkg syscall (openbsd-386), const IFT_IP ideal-int +pkg syscall (openbsd-386), const IFT_IPFORWARD ideal-int +pkg syscall (openbsd-386), const IFT_IPOVERATM ideal-int +pkg syscall (openbsd-386), const IFT_IPOVERCDLC ideal-int +pkg syscall (openbsd-386), const IFT_IPOVERCLAW ideal-int +pkg syscall (openbsd-386), const IFT_IPSWITCH ideal-int +pkg syscall (openbsd-386), const IFT_ISDN ideal-int +pkg syscall (openbsd-386), const IFT_ISDNBASIC ideal-int +pkg syscall (openbsd-386), const IFT_ISDNPRIMARY ideal-int +pkg syscall (openbsd-386), const IFT_ISDNS ideal-int +pkg syscall (openbsd-386), const IFT_ISDNU ideal-int +pkg syscall (openbsd-386), const IFT_ISO88022LLC ideal-int +pkg syscall (openbsd-386), const IFT_ISO88023 ideal-int +pkg syscall (openbsd-386), const IFT_ISO88024 ideal-int +pkg syscall (openbsd-386), const IFT_ISO88025 ideal-int +pkg syscall (openbsd-386), const IFT_ISO88025CRFPINT ideal-int +pkg syscall (openbsd-386), const IFT_ISO88025DTR ideal-int +pkg syscall (openbsd-386), const IFT_ISO88025FIBER ideal-int +pkg syscall (openbsd-386), const IFT_ISO88026 ideal-int +pkg syscall (openbsd-386), const IFT_ISUP ideal-int +pkg syscall (openbsd-386), const IFT_L2VLAN ideal-int +pkg syscall (openbsd-386), const IFT_L3IPVLAN ideal-int +pkg syscall (openbsd-386), const IFT_L3IPXVLAN ideal-int +pkg syscall (openbsd-386), const IFT_LAPB ideal-int +pkg syscall (openbsd-386), const IFT_LAPD ideal-int +pkg syscall (openbsd-386), const IFT_LAPF ideal-int +pkg syscall (openbsd-386), const IFT_LINEGROUP ideal-int +pkg syscall (openbsd-386), const IFT_LOCALTALK ideal-int +pkg syscall (openbsd-386), const IFT_LOOP ideal-int +pkg syscall (openbsd-386), const IFT_MEDIAMAILOVERIP ideal-int +pkg syscall (openbsd-386), const IFT_MFSIGLINK ideal-int +pkg syscall (openbsd-386), const IFT_MIOX25 ideal-int +pkg syscall (openbsd-386), const IFT_MODEM ideal-int +pkg syscall (openbsd-386), const IFT_MPC ideal-int +pkg syscall (openbsd-386), const IFT_MPLS ideal-int +pkg syscall (openbsd-386), const IFT_MPLSTUNNEL ideal-int +pkg syscall (openbsd-386), const IFT_MSDSL ideal-int +pkg syscall (openbsd-386), const IFT_MVL ideal-int +pkg syscall (openbsd-386), const IFT_MYRINET ideal-int +pkg syscall (openbsd-386), const IFT_NFAS ideal-int +pkg syscall (openbsd-386), const IFT_NSIP ideal-int +pkg syscall (openbsd-386), const IFT_OPTICALCHANNEL ideal-int +pkg syscall (openbsd-386), const IFT_OPTICALTRANSPORT ideal-int +pkg syscall (openbsd-386), const IFT_OTHER ideal-int +pkg syscall (openbsd-386), const IFT_P10 ideal-int +pkg syscall (openbsd-386), const IFT_P80 ideal-int +pkg syscall (openbsd-386), const IFT_PARA ideal-int +pkg syscall (openbsd-386), const IFT_PFLOG ideal-int +pkg syscall (openbsd-386), const IFT_PFLOW ideal-int +pkg syscall (openbsd-386), const IFT_PFSYNC ideal-int +pkg syscall (openbsd-386), const IFT_PLC ideal-int +pkg syscall (openbsd-386), const IFT_PON155 ideal-int +pkg syscall (openbsd-386), const IFT_PON622 ideal-int +pkg syscall (openbsd-386), const IFT_POS ideal-int +pkg syscall (openbsd-386), const IFT_PPP ideal-int +pkg syscall (openbsd-386), const IFT_PPPMULTILINKBUNDLE ideal-int +pkg syscall (openbsd-386), const IFT_PROPATM ideal-int +pkg syscall (openbsd-386), const IFT_PROPBWAP2MP ideal-int +pkg syscall (openbsd-386), const IFT_PROPCNLS ideal-int +pkg syscall (openbsd-386), const IFT_PROPDOCSWIRELESSDOWNSTREAM ideal-int +pkg syscall (openbsd-386), const IFT_PROPDOCSWIRELESSMACLAYER ideal-int +pkg syscall (openbsd-386), const IFT_PROPDOCSWIRELESSUPSTREAM ideal-int +pkg syscall (openbsd-386), const IFT_PROPMUX ideal-int +pkg syscall (openbsd-386), const IFT_PROPVIRTUAL ideal-int +pkg syscall (openbsd-386), const IFT_PROPWIRELESSP2P ideal-int +pkg syscall (openbsd-386), const IFT_PTPSERIAL ideal-int +pkg syscall (openbsd-386), const IFT_PVC ideal-int +pkg syscall (openbsd-386), const IFT_Q2931 ideal-int +pkg syscall (openbsd-386), const IFT_QLLC ideal-int +pkg syscall (openbsd-386), const IFT_RADIOMAC ideal-int +pkg syscall (openbsd-386), const IFT_RADSL ideal-int +pkg syscall (openbsd-386), const IFT_REACHDSL ideal-int +pkg syscall (openbsd-386), const IFT_RFC1483 ideal-int +pkg syscall (openbsd-386), const IFT_RS232 ideal-int +pkg syscall (openbsd-386), const IFT_RSRB ideal-int +pkg syscall (openbsd-386), const IFT_SDLC ideal-int +pkg syscall (openbsd-386), const IFT_SDSL ideal-int +pkg syscall (openbsd-386), const IFT_SHDSL ideal-int +pkg syscall (openbsd-386), const IFT_SIP ideal-int +pkg syscall (openbsd-386), const IFT_SIPSIG ideal-int +pkg syscall (openbsd-386), const IFT_SIPTG ideal-int +pkg syscall (openbsd-386), const IFT_SLIP ideal-int +pkg syscall (openbsd-386), const IFT_SMDSDXI ideal-int +pkg syscall (openbsd-386), const IFT_SMDSICIP ideal-int +pkg syscall (openbsd-386), const IFT_SONET ideal-int +pkg syscall (openbsd-386), const IFT_SONETOVERHEADCHANNEL ideal-int +pkg syscall (openbsd-386), const IFT_SONETPATH ideal-int +pkg syscall (openbsd-386), const IFT_SONETVT ideal-int +pkg syscall (openbsd-386), const IFT_SRP ideal-int +pkg syscall (openbsd-386), const IFT_SS7SIGLINK ideal-int +pkg syscall (openbsd-386), const IFT_STACKTOSTACK ideal-int +pkg syscall (openbsd-386), const IFT_STARLAN ideal-int +pkg syscall (openbsd-386), const IFT_T1 ideal-int +pkg syscall (openbsd-386), const IFT_TDLC ideal-int +pkg syscall (openbsd-386), const IFT_TELINK ideal-int +pkg syscall (openbsd-386), const IFT_TERMPAD ideal-int +pkg syscall (openbsd-386), const IFT_TR008 ideal-int +pkg syscall (openbsd-386), const IFT_TRANSPHDLC ideal-int +pkg syscall (openbsd-386), const IFT_TUNNEL ideal-int +pkg syscall (openbsd-386), const IFT_ULTRA ideal-int +pkg syscall (openbsd-386), const IFT_USB ideal-int +pkg syscall (openbsd-386), const IFT_V11 ideal-int +pkg syscall (openbsd-386), const IFT_V35 ideal-int +pkg syscall (openbsd-386), const IFT_V36 ideal-int +pkg syscall (openbsd-386), const IFT_V37 ideal-int +pkg syscall (openbsd-386), const IFT_VDSL ideal-int +pkg syscall (openbsd-386), const IFT_VIRTUALIPADDRESS ideal-int +pkg syscall (openbsd-386), const IFT_VIRTUALTG ideal-int +pkg syscall (openbsd-386), const IFT_VOICEDID ideal-int +pkg syscall (openbsd-386), const IFT_VOICEEM ideal-int +pkg syscall (openbsd-386), const IFT_VOICEEMFGD ideal-int +pkg syscall (openbsd-386), const IFT_VOICEENCAP ideal-int +pkg syscall (openbsd-386), const IFT_VOICEFGDEANA ideal-int +pkg syscall (openbsd-386), const IFT_VOICEFXO ideal-int +pkg syscall (openbsd-386), const IFT_VOICEFXS ideal-int +pkg syscall (openbsd-386), const IFT_VOICEOVERATM ideal-int +pkg syscall (openbsd-386), const IFT_VOICEOVERCABLE ideal-int +pkg syscall (openbsd-386), const IFT_VOICEOVERFRAMERELAY ideal-int +pkg syscall (openbsd-386), const IFT_VOICEOVERIP ideal-int +pkg syscall (openbsd-386), const IFT_X213 ideal-int +pkg syscall (openbsd-386), const IFT_X25 ideal-int +pkg syscall (openbsd-386), const IFT_X25DDN ideal-int +pkg syscall (openbsd-386), const IFT_X25HUNTGROUP ideal-int +pkg syscall (openbsd-386), const IFT_X25MLP ideal-int +pkg syscall (openbsd-386), const IFT_X25PLE ideal-int +pkg syscall (openbsd-386), const IFT_XETHER ideal-int +pkg syscall (openbsd-386), const IGNBRK ideal-int +pkg syscall (openbsd-386), const IGNCR ideal-int +pkg syscall (openbsd-386), const IGNPAR ideal-int +pkg syscall (openbsd-386), const IMAXBEL ideal-int +pkg syscall (openbsd-386), const INLCR ideal-int +pkg syscall (openbsd-386), const INPCK ideal-int +pkg syscall (openbsd-386), const IN_CLASSA_HOST ideal-int +pkg syscall (openbsd-386), const IN_CLASSA_MAX ideal-int +pkg syscall (openbsd-386), const IN_CLASSA_NET ideal-int +pkg syscall (openbsd-386), const IN_CLASSA_NSHIFT ideal-int +pkg syscall (openbsd-386), const IN_CLASSB_HOST ideal-int +pkg syscall (openbsd-386), const IN_CLASSB_MAX ideal-int +pkg syscall (openbsd-386), const IN_CLASSB_NET ideal-int +pkg syscall (openbsd-386), const IN_CLASSB_NSHIFT ideal-int +pkg syscall (openbsd-386), const IN_CLASSC_HOST ideal-int +pkg syscall (openbsd-386), const IN_CLASSC_NET ideal-int +pkg syscall (openbsd-386), const IN_CLASSC_NSHIFT ideal-int +pkg syscall (openbsd-386), const IN_CLASSD_HOST ideal-int +pkg syscall (openbsd-386), const IN_CLASSD_NET ideal-int +pkg syscall (openbsd-386), const IN_CLASSD_NSHIFT ideal-int +pkg syscall (openbsd-386), const IN_LOOPBACKNET ideal-int +pkg syscall (openbsd-386), const IN_RFC3021_HOST ideal-int +pkg syscall (openbsd-386), const IN_RFC3021_NET ideal-int +pkg syscall (openbsd-386), const IN_RFC3021_NSHIFT ideal-int +pkg syscall (openbsd-386), const IPPROTO_AH ideal-int +pkg syscall (openbsd-386), const IPPROTO_CARP ideal-int +pkg syscall (openbsd-386), const IPPROTO_DIVERT ideal-int +pkg syscall (openbsd-386), const IPPROTO_DONE ideal-int +pkg syscall (openbsd-386), const IPPROTO_DSTOPTS ideal-int +pkg syscall (openbsd-386), const IPPROTO_EGP ideal-int +pkg syscall (openbsd-386), const IPPROTO_ENCAP ideal-int +pkg syscall (openbsd-386), const IPPROTO_EON ideal-int +pkg syscall (openbsd-386), const IPPROTO_ESP ideal-int +pkg syscall (openbsd-386), const IPPROTO_ETHERIP ideal-int +pkg syscall (openbsd-386), const IPPROTO_FRAGMENT ideal-int +pkg syscall (openbsd-386), const IPPROTO_GGP ideal-int +pkg syscall (openbsd-386), const IPPROTO_GRE ideal-int +pkg syscall (openbsd-386), const IPPROTO_HOPOPTS ideal-int +pkg syscall (openbsd-386), const IPPROTO_ICMP ideal-int +pkg syscall (openbsd-386), const IPPROTO_ICMPV6 ideal-int +pkg syscall (openbsd-386), const IPPROTO_IDP ideal-int +pkg syscall (openbsd-386), const IPPROTO_IGMP ideal-int +pkg syscall (openbsd-386), const IPPROTO_IPCOMP ideal-int +pkg syscall (openbsd-386), const IPPROTO_IPIP ideal-int +pkg syscall (openbsd-386), const IPPROTO_IPV4 ideal-int +pkg syscall (openbsd-386), const IPPROTO_MAX ideal-int +pkg syscall (openbsd-386), const IPPROTO_MAXID ideal-int +pkg syscall (openbsd-386), const IPPROTO_MOBILE ideal-int +pkg syscall (openbsd-386), const IPPROTO_MPLS ideal-int +pkg syscall (openbsd-386), const IPPROTO_NONE ideal-int +pkg syscall (openbsd-386), const IPPROTO_PFSYNC ideal-int +pkg syscall (openbsd-386), const IPPROTO_PIM ideal-int +pkg syscall (openbsd-386), const IPPROTO_PUP ideal-int +pkg syscall (openbsd-386), const IPPROTO_RAW ideal-int +pkg syscall (openbsd-386), const IPPROTO_ROUTING ideal-int +pkg syscall (openbsd-386), const IPPROTO_RSVP ideal-int +pkg syscall (openbsd-386), const IPPROTO_TP ideal-int +pkg syscall (openbsd-386), const IPV6_AUTH_LEVEL ideal-int +pkg syscall (openbsd-386), const IPV6_AUTOFLOWLABEL ideal-int +pkg syscall (openbsd-386), const IPV6_CHECKSUM ideal-int +pkg syscall (openbsd-386), const IPV6_DEFAULT_MULTICAST_HOPS ideal-int +pkg syscall (openbsd-386), const IPV6_DEFAULT_MULTICAST_LOOP ideal-int +pkg syscall (openbsd-386), const IPV6_DEFHLIM ideal-int +pkg syscall (openbsd-386), const IPV6_DONTFRAG ideal-int +pkg syscall (openbsd-386), const IPV6_DSTOPTS ideal-int +pkg syscall (openbsd-386), const IPV6_ESP_NETWORK_LEVEL ideal-int +pkg syscall (openbsd-386), const IPV6_ESP_TRANS_LEVEL ideal-int +pkg syscall (openbsd-386), const IPV6_FAITH ideal-int +pkg syscall (openbsd-386), const IPV6_FLOWINFO_MASK ideal-int +pkg syscall (openbsd-386), const IPV6_FLOWLABEL_MASK ideal-int +pkg syscall (openbsd-386), const IPV6_FRAGTTL ideal-int +pkg syscall (openbsd-386), const IPV6_HLIMDEC ideal-int +pkg syscall (openbsd-386), const IPV6_HOPLIMIT ideal-int +pkg syscall (openbsd-386), const IPV6_HOPOPTS ideal-int +pkg syscall (openbsd-386), const IPV6_IPCOMP_LEVEL ideal-int +pkg syscall (openbsd-386), const IPV6_MAXHLIM ideal-int +pkg syscall (openbsd-386), const IPV6_MAXPACKET ideal-int +pkg syscall (openbsd-386), const IPV6_MMTU ideal-int +pkg syscall (openbsd-386), const IPV6_NEXTHOP ideal-int +pkg syscall (openbsd-386), const IPV6_OPTIONS ideal-int +pkg syscall (openbsd-386), const IPV6_PATHMTU ideal-int +pkg syscall (openbsd-386), const IPV6_PIPEX ideal-int +pkg syscall (openbsd-386), const IPV6_PKTINFO ideal-int +pkg syscall (openbsd-386), const IPV6_PORTRANGE ideal-int +pkg syscall (openbsd-386), const IPV6_PORTRANGE_DEFAULT ideal-int +pkg syscall (openbsd-386), const IPV6_PORTRANGE_HIGH ideal-int +pkg syscall (openbsd-386), const IPV6_PORTRANGE_LOW ideal-int +pkg syscall (openbsd-386), const IPV6_RECVDSTOPTS ideal-int +pkg syscall (openbsd-386), const IPV6_RECVHOPLIMIT ideal-int +pkg syscall (openbsd-386), const IPV6_RECVHOPOPTS ideal-int +pkg syscall (openbsd-386), const IPV6_RECVPATHMTU ideal-int +pkg syscall (openbsd-386), const IPV6_RECVPKTINFO ideal-int +pkg syscall (openbsd-386), const IPV6_RECVRTHDR ideal-int +pkg syscall (openbsd-386), const IPV6_RECVTCLASS ideal-int +pkg syscall (openbsd-386), const IPV6_RTABLE ideal-int +pkg syscall (openbsd-386), const IPV6_RTHDR ideal-int +pkg syscall (openbsd-386), const IPV6_RTHDRDSTOPTS ideal-int +pkg syscall (openbsd-386), const IPV6_RTHDR_LOOSE ideal-int +pkg syscall (openbsd-386), const IPV6_RTHDR_STRICT ideal-int +pkg syscall (openbsd-386), const IPV6_RTHDR_TYPE_0 ideal-int +pkg syscall (openbsd-386), const IPV6_SOCKOPT_RESERVED1 ideal-int +pkg syscall (openbsd-386), const IPV6_TCLASS ideal-int +pkg syscall (openbsd-386), const IPV6_USE_MIN_MTU ideal-int +pkg syscall (openbsd-386), const IPV6_VERSION ideal-int +pkg syscall (openbsd-386), const IPV6_VERSION_MASK ideal-int +pkg syscall (openbsd-386), const IP_AUTH_LEVEL ideal-int +pkg syscall (openbsd-386), const IP_DEFAULT_MULTICAST_LOOP ideal-int +pkg syscall (openbsd-386), const IP_DEFAULT_MULTICAST_TTL ideal-int +pkg syscall (openbsd-386), const IP_DF ideal-int +pkg syscall (openbsd-386), const IP_ESP_NETWORK_LEVEL ideal-int +pkg syscall (openbsd-386), const IP_ESP_TRANS_LEVEL ideal-int +pkg syscall (openbsd-386), const IP_HDRINCL ideal-int +pkg syscall (openbsd-386), const IP_IPCOMP_LEVEL ideal-int +pkg syscall (openbsd-386), const IP_IPSECFLOWINFO ideal-int +pkg syscall (openbsd-386), const IP_IPSEC_LOCAL_AUTH ideal-int +pkg syscall (openbsd-386), const IP_IPSEC_LOCAL_CRED ideal-int +pkg syscall (openbsd-386), const IP_IPSEC_LOCAL_ID ideal-int +pkg syscall (openbsd-386), const IP_IPSEC_REMOTE_AUTH ideal-int +pkg syscall (openbsd-386), const IP_IPSEC_REMOTE_CRED ideal-int +pkg syscall (openbsd-386), const IP_IPSEC_REMOTE_ID ideal-int +pkg syscall (openbsd-386), const IP_MAXPACKET ideal-int +pkg syscall (openbsd-386), const IP_MAX_MEMBERSHIPS ideal-int +pkg syscall (openbsd-386), const IP_MF ideal-int +pkg syscall (openbsd-386), const IP_MINTTL ideal-int +pkg syscall (openbsd-386), const IP_MIN_MEMBERSHIPS ideal-int +pkg syscall (openbsd-386), const IP_MSS ideal-int +pkg syscall (openbsd-386), const IP_OFFMASK ideal-int +pkg syscall (openbsd-386), const IP_OPTIONS ideal-int +pkg syscall (openbsd-386), const IP_PIPEX ideal-int +pkg syscall (openbsd-386), const IP_PORTRANGE ideal-int +pkg syscall (openbsd-386), const IP_PORTRANGE_DEFAULT ideal-int +pkg syscall (openbsd-386), const IP_PORTRANGE_HIGH ideal-int +pkg syscall (openbsd-386), const IP_PORTRANGE_LOW ideal-int +pkg syscall (openbsd-386), const IP_RECVDSTADDR ideal-int +pkg syscall (openbsd-386), const IP_RECVDSTPORT ideal-int +pkg syscall (openbsd-386), const IP_RECVIF ideal-int +pkg syscall (openbsd-386), const IP_RECVOPTS ideal-int +pkg syscall (openbsd-386), const IP_RECVRETOPTS ideal-int +pkg syscall (openbsd-386), const IP_RECVRTABLE ideal-int +pkg syscall (openbsd-386), const IP_RECVTTL ideal-int +pkg syscall (openbsd-386), const IP_RETOPTS ideal-int +pkg syscall (openbsd-386), const IP_RF ideal-int +pkg syscall (openbsd-386), const IP_RTABLE ideal-int +pkg syscall (openbsd-386), const ISIG ideal-int +pkg syscall (openbsd-386), const ISTRIP ideal-int +pkg syscall (openbsd-386), const IXANY ideal-int +pkg syscall (openbsd-386), const IXOFF ideal-int +pkg syscall (openbsd-386), const IXON ideal-int +pkg syscall (openbsd-386), const LCNT_OVERLOAD_FLUSH ideal-int +pkg syscall (openbsd-386), const LOCK_EX ideal-int +pkg syscall (openbsd-386), const LOCK_NB ideal-int +pkg syscall (openbsd-386), const LOCK_SH ideal-int +pkg syscall (openbsd-386), const LOCK_UN ideal-int +pkg syscall (openbsd-386), const MSG_BCAST ideal-int +pkg syscall (openbsd-386), const MSG_CTRUNC ideal-int +pkg syscall (openbsd-386), const MSG_DONTROUTE ideal-int +pkg syscall (openbsd-386), const MSG_DONTWAIT ideal-int +pkg syscall (openbsd-386), const MSG_EOR ideal-int +pkg syscall (openbsd-386), const MSG_MCAST ideal-int +pkg syscall (openbsd-386), const MSG_NOSIGNAL ideal-int +pkg syscall (openbsd-386), const MSG_OOB ideal-int +pkg syscall (openbsd-386), const MSG_PEEK ideal-int +pkg syscall (openbsd-386), const MSG_TRUNC ideal-int +pkg syscall (openbsd-386), const MSG_WAITALL ideal-int +pkg syscall (openbsd-386), const NAME_MAX ideal-int +pkg syscall (openbsd-386), const NET_RT_DUMP ideal-int +pkg syscall (openbsd-386), const NET_RT_FLAGS ideal-int +pkg syscall (openbsd-386), const NET_RT_IFLIST ideal-int +pkg syscall (openbsd-386), const NET_RT_MAXID ideal-int +pkg syscall (openbsd-386), const NET_RT_STATS ideal-int +pkg syscall (openbsd-386), const NET_RT_TABLE ideal-int +pkg syscall (openbsd-386), const NOFLSH ideal-int +pkg syscall (openbsd-386), const NOTE_ATTRIB ideal-int +pkg syscall (openbsd-386), const NOTE_CHILD ideal-int +pkg syscall (openbsd-386), const NOTE_DELETE ideal-int +pkg syscall (openbsd-386), const NOTE_EOF ideal-int +pkg syscall (openbsd-386), const NOTE_EXEC ideal-int +pkg syscall (openbsd-386), const NOTE_EXIT ideal-int +pkg syscall (openbsd-386), const NOTE_EXTEND ideal-int +pkg syscall (openbsd-386), const NOTE_FORK ideal-int +pkg syscall (openbsd-386), const NOTE_LINK ideal-int +pkg syscall (openbsd-386), const NOTE_LOWAT ideal-int +pkg syscall (openbsd-386), const NOTE_PCTRLMASK ideal-int +pkg syscall (openbsd-386), const NOTE_PDATAMASK ideal-int +pkg syscall (openbsd-386), const NOTE_RENAME ideal-int +pkg syscall (openbsd-386), const NOTE_REVOKE ideal-int +pkg syscall (openbsd-386), const NOTE_TRACK ideal-int +pkg syscall (openbsd-386), const NOTE_TRACKERR ideal-int +pkg syscall (openbsd-386), const NOTE_TRUNCATE ideal-int +pkg syscall (openbsd-386), const NOTE_WRITE ideal-int +pkg syscall (openbsd-386), const OCRNL ideal-int +pkg syscall (openbsd-386), const ONLCR ideal-int +pkg syscall (openbsd-386), const ONLRET ideal-int +pkg syscall (openbsd-386), const ONOCR ideal-int +pkg syscall (openbsd-386), const ONOEOT ideal-int +pkg syscall (openbsd-386), const OPOST ideal-int +pkg syscall (openbsd-386), const O_ACCMODE ideal-int +pkg syscall (openbsd-386), const O_DIRECTORY ideal-int +pkg syscall (openbsd-386), const O_DSYNC ideal-int +pkg syscall (openbsd-386), const O_EXLOCK ideal-int +pkg syscall (openbsd-386), const O_FSYNC ideal-int +pkg syscall (openbsd-386), const O_NDELAY ideal-int +pkg syscall (openbsd-386), const O_NOFOLLOW ideal-int +pkg syscall (openbsd-386), const O_RSYNC ideal-int +pkg syscall (openbsd-386), const O_SHLOCK ideal-int +pkg syscall (openbsd-386), const PARENB ideal-int +pkg syscall (openbsd-386), const PARMRK ideal-int +pkg syscall (openbsd-386), const PARODD ideal-int +pkg syscall (openbsd-386), const PENDIN ideal-int +pkg syscall (openbsd-386), const PF_FLUSH ideal-int +pkg syscall (openbsd-386), const PRIO_PGRP = 1 +pkg syscall (openbsd-386), const PRIO_PGRP ideal-int +pkg syscall (openbsd-386), const PRIO_PROCESS = 0 +pkg syscall (openbsd-386), const PRIO_PROCESS ideal-int +pkg syscall (openbsd-386), const PRIO_USER = 2 +pkg syscall (openbsd-386), const PRIO_USER ideal-int +pkg syscall (openbsd-386), const PTRACE_CONT ideal-int +pkg syscall (openbsd-386), const PTRACE_KILL ideal-int +pkg syscall (openbsd-386), const PTRACE_TRACEME ideal-int +pkg syscall (openbsd-386), const PT_MASK ideal-int +pkg syscall (openbsd-386), const RLIMIT_CORE ideal-int +pkg syscall (openbsd-386), const RLIMIT_CPU ideal-int +pkg syscall (openbsd-386), const RLIMIT_DATA ideal-int +pkg syscall (openbsd-386), const RLIMIT_FSIZE ideal-int +pkg syscall (openbsd-386), const RLIMIT_NOFILE ideal-int +pkg syscall (openbsd-386), const RLIMIT_STACK ideal-int +pkg syscall (openbsd-386), const RLIM_INFINITY ideal-int +pkg syscall (openbsd-386), const RTAX_AUTHOR ideal-int +pkg syscall (openbsd-386), const RTAX_BRD ideal-int +pkg syscall (openbsd-386), const RTAX_DST ideal-int +pkg syscall (openbsd-386), const RTAX_GATEWAY ideal-int +pkg syscall (openbsd-386), const RTAX_GENMASK ideal-int +pkg syscall (openbsd-386), const RTAX_IFA ideal-int +pkg syscall (openbsd-386), const RTAX_IFP ideal-int +pkg syscall (openbsd-386), const RTAX_LABEL ideal-int +pkg syscall (openbsd-386), const RTAX_MAX ideal-int +pkg syscall (openbsd-386), const RTAX_NETMASK ideal-int +pkg syscall (openbsd-386), const RTAX_SRC ideal-int +pkg syscall (openbsd-386), const RTAX_SRCMASK ideal-int +pkg syscall (openbsd-386), const RTA_AUTHOR ideal-int +pkg syscall (openbsd-386), const RTA_BRD ideal-int +pkg syscall (openbsd-386), const RTA_DST ideal-int +pkg syscall (openbsd-386), const RTA_GATEWAY ideal-int +pkg syscall (openbsd-386), const RTA_GENMASK ideal-int +pkg syscall (openbsd-386), const RTA_IFA ideal-int +pkg syscall (openbsd-386), const RTA_IFP ideal-int +pkg syscall (openbsd-386), const RTA_LABEL ideal-int +pkg syscall (openbsd-386), const RTA_NETMASK ideal-int +pkg syscall (openbsd-386), const RTA_SRC ideal-int +pkg syscall (openbsd-386), const RTA_SRCMASK ideal-int +pkg syscall (openbsd-386), const RTF_ANNOUNCE ideal-int +pkg syscall (openbsd-386), const RTF_BLACKHOLE ideal-int +pkg syscall (openbsd-386), const RTF_CLONED ideal-int +pkg syscall (openbsd-386), const RTF_CLONING ideal-int +pkg syscall (openbsd-386), const RTF_DONE ideal-int +pkg syscall (openbsd-386), const RTF_DYNAMIC ideal-int +pkg syscall (openbsd-386), const RTF_FMASK ideal-int +pkg syscall (openbsd-386), const RTF_GATEWAY ideal-int +pkg syscall (openbsd-386), const RTF_HOST ideal-int +pkg syscall (openbsd-386), const RTF_LLINFO ideal-int +pkg syscall (openbsd-386), const RTF_MASK ideal-int +pkg syscall (openbsd-386), const RTF_MODIFIED ideal-int +pkg syscall (openbsd-386), const RTF_MPATH ideal-int +pkg syscall (openbsd-386), const RTF_MPLS ideal-int +pkg syscall (openbsd-386), const RTF_PERMANENT_ARP ideal-int +pkg syscall (openbsd-386), const RTF_PROTO1 ideal-int +pkg syscall (openbsd-386), const RTF_PROTO2 ideal-int +pkg syscall (openbsd-386), const RTF_PROTO3 ideal-int +pkg syscall (openbsd-386), const RTF_REJECT ideal-int +pkg syscall (openbsd-386), const RTF_SOURCE ideal-int +pkg syscall (openbsd-386), const RTF_STATIC ideal-int +pkg syscall (openbsd-386), const RTF_TUNNEL ideal-int +pkg syscall (openbsd-386), const RTF_UP ideal-int +pkg syscall (openbsd-386), const RTF_USETRAILERS ideal-int +pkg syscall (openbsd-386), const RTF_XRESOLVE ideal-int +pkg syscall (openbsd-386), const RTM_ADD ideal-int +pkg syscall (openbsd-386), const RTM_CHANGE ideal-int +pkg syscall (openbsd-386), const RTM_DELADDR ideal-int +pkg syscall (openbsd-386), const RTM_DELETE ideal-int +pkg syscall (openbsd-386), const RTM_DESYNC ideal-int +pkg syscall (openbsd-386), const RTM_GET ideal-int +pkg syscall (openbsd-386), const RTM_IFANNOUNCE ideal-int +pkg syscall (openbsd-386), const RTM_IFINFO ideal-int +pkg syscall (openbsd-386), const RTM_LOCK ideal-int +pkg syscall (openbsd-386), const RTM_LOSING ideal-int +pkg syscall (openbsd-386), const RTM_MAXSIZE ideal-int +pkg syscall (openbsd-386), const RTM_MISS ideal-int +pkg syscall (openbsd-386), const RTM_NEWADDR ideal-int +pkg syscall (openbsd-386), const RTM_REDIRECT ideal-int +pkg syscall (openbsd-386), const RTM_RESOLVE ideal-int +pkg syscall (openbsd-386), const RTM_RTTUNIT ideal-int +pkg syscall (openbsd-386), const RTM_VERSION ideal-int +pkg syscall (openbsd-386), const RTV_EXPIRE ideal-int +pkg syscall (openbsd-386), const RTV_HOPCOUNT ideal-int +pkg syscall (openbsd-386), const RTV_MTU ideal-int +pkg syscall (openbsd-386), const RTV_RPIPE ideal-int +pkg syscall (openbsd-386), const RTV_RTT ideal-int +pkg syscall (openbsd-386), const RTV_RTTVAR ideal-int +pkg syscall (openbsd-386), const RTV_SPIPE ideal-int +pkg syscall (openbsd-386), const RTV_SSTHRESH ideal-int +pkg syscall (openbsd-386), const RT_TABLEID_MAX ideal-int +pkg syscall (openbsd-386), const RUSAGE_CHILDREN ideal-int +pkg syscall (openbsd-386), const RUSAGE_SELF ideal-int +pkg syscall (openbsd-386), const RUSAGE_THREAD ideal-int +pkg syscall (openbsd-386), const SCM_RIGHTS ideal-int +pkg syscall (openbsd-386), const SCM_TIMESTAMP ideal-int +pkg syscall (openbsd-386), const SIGCHLD Signal +pkg syscall (openbsd-386), const SIGCONT Signal +pkg syscall (openbsd-386), const SIGEMT Signal +pkg syscall (openbsd-386), const SIGINFO Signal +pkg syscall (openbsd-386), const SIGIO Signal +pkg syscall (openbsd-386), const SIGIOT Signal +pkg syscall (openbsd-386), const SIGPROF Signal +pkg syscall (openbsd-386), const SIGSTOP Signal +pkg syscall (openbsd-386), const SIGSYS Signal +pkg syscall (openbsd-386), const SIGTHR Signal +pkg syscall (openbsd-386), const SIGTSTP Signal +pkg syscall (openbsd-386), const SIGTTIN Signal +pkg syscall (openbsd-386), const SIGTTOU Signal +pkg syscall (openbsd-386), const SIGURG Signal +pkg syscall (openbsd-386), const SIGUSR1 Signal +pkg syscall (openbsd-386), const SIGUSR2 Signal +pkg syscall (openbsd-386), const SIGVTALRM Signal +pkg syscall (openbsd-386), const SIGWINCH Signal +pkg syscall (openbsd-386), const SIGXCPU Signal +pkg syscall (openbsd-386), const SIGXFSZ Signal +pkg syscall (openbsd-386), const SIOCADDMULTI ideal-int +pkg syscall (openbsd-386), const SIOCAIFADDR ideal-int +pkg syscall (openbsd-386), const SIOCAIFGROUP ideal-int +pkg syscall (openbsd-386), const SIOCALIFADDR ideal-int +pkg syscall (openbsd-386), const SIOCATMARK ideal-int +pkg syscall (openbsd-386), const SIOCBRDGADD ideal-int +pkg syscall (openbsd-386), const SIOCBRDGADDS ideal-int +pkg syscall (openbsd-386), const SIOCBRDGARL ideal-int +pkg syscall (openbsd-386), const SIOCBRDGDADDR ideal-int +pkg syscall (openbsd-386), const SIOCBRDGDEL ideal-int +pkg syscall (openbsd-386), const SIOCBRDGDELS ideal-int +pkg syscall (openbsd-386), const SIOCBRDGFLUSH ideal-int +pkg syscall (openbsd-386), const SIOCBRDGFRL ideal-int +pkg syscall (openbsd-386), const SIOCBRDGGCACHE ideal-int +pkg syscall (openbsd-386), const SIOCBRDGGFD ideal-int +pkg syscall (openbsd-386), const SIOCBRDGGHT ideal-int +pkg syscall (openbsd-386), const SIOCBRDGGIFFLGS ideal-int +pkg syscall (openbsd-386), const SIOCBRDGGMA ideal-int +pkg syscall (openbsd-386), const SIOCBRDGGPARAM ideal-int +pkg syscall (openbsd-386), const SIOCBRDGGPRI ideal-int +pkg syscall (openbsd-386), const SIOCBRDGGRL ideal-int +pkg syscall (openbsd-386), const SIOCBRDGGSIFS ideal-int +pkg syscall (openbsd-386), const SIOCBRDGGTO ideal-int +pkg syscall (openbsd-386), const SIOCBRDGIFS ideal-int +pkg syscall (openbsd-386), const SIOCBRDGRTS ideal-int +pkg syscall (openbsd-386), const SIOCBRDGSADDR ideal-int +pkg syscall (openbsd-386), const SIOCBRDGSCACHE ideal-int +pkg syscall (openbsd-386), const SIOCBRDGSFD ideal-int +pkg syscall (openbsd-386), const SIOCBRDGSHT ideal-int +pkg syscall (openbsd-386), const SIOCBRDGSIFCOST ideal-int +pkg syscall (openbsd-386), const SIOCBRDGSIFFLGS ideal-int +pkg syscall (openbsd-386), const SIOCBRDGSIFPRIO ideal-int +pkg syscall (openbsd-386), const SIOCBRDGSMA ideal-int +pkg syscall (openbsd-386), const SIOCBRDGSPRI ideal-int +pkg syscall (openbsd-386), const SIOCBRDGSPROTO ideal-int +pkg syscall (openbsd-386), const SIOCBRDGSTO ideal-int +pkg syscall (openbsd-386), const SIOCBRDGSTXHC ideal-int +pkg syscall (openbsd-386), const SIOCDELMULTI ideal-int +pkg syscall (openbsd-386), const SIOCDIFADDR ideal-int +pkg syscall (openbsd-386), const SIOCDIFGROUP ideal-int +pkg syscall (openbsd-386), const SIOCDIFPHYADDR ideal-int +pkg syscall (openbsd-386), const SIOCDLIFADDR ideal-int +pkg syscall (openbsd-386), const SIOCGETKALIVE ideal-int +pkg syscall (openbsd-386), const SIOCGETLABEL ideal-int +pkg syscall (openbsd-386), const SIOCGETPFLOW ideal-int +pkg syscall (openbsd-386), const SIOCGETPFSYNC ideal-int +pkg syscall (openbsd-386), const SIOCGETSGCNT ideal-int +pkg syscall (openbsd-386), const SIOCGETVIFCNT ideal-int +pkg syscall (openbsd-386), const SIOCGHIWAT ideal-int +pkg syscall (openbsd-386), const SIOCGIFADDR ideal-int +pkg syscall (openbsd-386), const SIOCGIFASYNCMAP ideal-int +pkg syscall (openbsd-386), const SIOCGIFBRDADDR ideal-int +pkg syscall (openbsd-386), const SIOCGIFCONF ideal-int +pkg syscall (openbsd-386), const SIOCGIFDATA ideal-int +pkg syscall (openbsd-386), const SIOCGIFDESCR ideal-int +pkg syscall (openbsd-386), const SIOCGIFDSTADDR ideal-int +pkg syscall (openbsd-386), const SIOCGIFFLAGS ideal-int +pkg syscall (openbsd-386), const SIOCGIFGATTR ideal-int +pkg syscall (openbsd-386), const SIOCGIFGENERIC ideal-int +pkg syscall (openbsd-386), const SIOCGIFGMEMB ideal-int +pkg syscall (openbsd-386), const SIOCGIFGROUP ideal-int +pkg syscall (openbsd-386), const SIOCGIFMEDIA ideal-int +pkg syscall (openbsd-386), const SIOCGIFMETRIC ideal-int +pkg syscall (openbsd-386), const SIOCGIFMTU ideal-int +pkg syscall (openbsd-386), const SIOCGIFNETMASK ideal-int +pkg syscall (openbsd-386), const SIOCGIFPDSTADDR ideal-int +pkg syscall (openbsd-386), const SIOCGIFPRIORITY ideal-int +pkg syscall (openbsd-386), const SIOCGIFPSRCADDR ideal-int +pkg syscall (openbsd-386), const SIOCGIFRDOMAIN ideal-int +pkg syscall (openbsd-386), const SIOCGIFRTLABEL ideal-int +pkg syscall (openbsd-386), const SIOCGIFTIMESLOT ideal-int +pkg syscall (openbsd-386), const SIOCGIFXFLAGS ideal-int +pkg syscall (openbsd-386), const SIOCGLIFADDR ideal-int +pkg syscall (openbsd-386), const SIOCGLIFPHYADDR ideal-int +pkg syscall (openbsd-386), const SIOCGLIFPHYRTABLE ideal-int +pkg syscall (openbsd-386), const SIOCGLOWAT ideal-int +pkg syscall (openbsd-386), const SIOCGPGRP ideal-int +pkg syscall (openbsd-386), const SIOCGVH ideal-int +pkg syscall (openbsd-386), const SIOCIFCREATE ideal-int +pkg syscall (openbsd-386), const SIOCIFDESTROY ideal-int +pkg syscall (openbsd-386), const SIOCIFGCLONERS ideal-int +pkg syscall (openbsd-386), const SIOCSETKALIVE ideal-int +pkg syscall (openbsd-386), const SIOCSETLABEL ideal-int +pkg syscall (openbsd-386), const SIOCSETPFLOW ideal-int +pkg syscall (openbsd-386), const SIOCSETPFSYNC ideal-int +pkg syscall (openbsd-386), const SIOCSHIWAT ideal-int +pkg syscall (openbsd-386), const SIOCSIFADDR ideal-int +pkg syscall (openbsd-386), const SIOCSIFASYNCMAP ideal-int +pkg syscall (openbsd-386), const SIOCSIFBRDADDR ideal-int +pkg syscall (openbsd-386), const SIOCSIFDESCR ideal-int +pkg syscall (openbsd-386), const SIOCSIFDSTADDR ideal-int +pkg syscall (openbsd-386), const SIOCSIFFLAGS ideal-int +pkg syscall (openbsd-386), const SIOCSIFGATTR ideal-int +pkg syscall (openbsd-386), const SIOCSIFGENERIC ideal-int +pkg syscall (openbsd-386), const SIOCSIFLLADDR ideal-int +pkg syscall (openbsd-386), const SIOCSIFMEDIA ideal-int +pkg syscall (openbsd-386), const SIOCSIFMETRIC ideal-int +pkg syscall (openbsd-386), const SIOCSIFMTU ideal-int +pkg syscall (openbsd-386), const SIOCSIFNETMASK ideal-int +pkg syscall (openbsd-386), const SIOCSIFPHYADDR ideal-int +pkg syscall (openbsd-386), const SIOCSIFPRIORITY ideal-int +pkg syscall (openbsd-386), const SIOCSIFRDOMAIN ideal-int +pkg syscall (openbsd-386), const SIOCSIFRTLABEL ideal-int +pkg syscall (openbsd-386), const SIOCSIFTIMESLOT ideal-int +pkg syscall (openbsd-386), const SIOCSIFXFLAGS ideal-int +pkg syscall (openbsd-386), const SIOCSLIFPHYADDR ideal-int +pkg syscall (openbsd-386), const SIOCSLIFPHYRTABLE ideal-int +pkg syscall (openbsd-386), const SIOCSLOWAT ideal-int +pkg syscall (openbsd-386), const SIOCSPGRP ideal-int +pkg syscall (openbsd-386), const SIOCSVH ideal-int +pkg syscall (openbsd-386), const SOCK_RDM ideal-int +pkg syscall (openbsd-386), const SO_ACCEPTCONN ideal-int +pkg syscall (openbsd-386), const SO_BINDANY ideal-int +pkg syscall (openbsd-386), const SO_DEBUG ideal-int +pkg syscall (openbsd-386), const SO_ERROR ideal-int +pkg syscall (openbsd-386), const SO_NETPROC ideal-int +pkg syscall (openbsd-386), const SO_OOBINLINE ideal-int +pkg syscall (openbsd-386), const SO_PEERCRED ideal-int +pkg syscall (openbsd-386), const SO_RCVLOWAT ideal-int +pkg syscall (openbsd-386), const SO_RCVTIMEO ideal-int +pkg syscall (openbsd-386), const SO_REUSEPORT ideal-int +pkg syscall (openbsd-386), const SO_RTABLE ideal-int +pkg syscall (openbsd-386), const SO_SNDLOWAT ideal-int +pkg syscall (openbsd-386), const SO_SNDTIMEO ideal-int +pkg syscall (openbsd-386), const SO_SPLICE ideal-int +pkg syscall (openbsd-386), const SO_TIMESTAMP ideal-int +pkg syscall (openbsd-386), const SO_TYPE ideal-int +pkg syscall (openbsd-386), const SO_USELOOPBACK ideal-int +pkg syscall (openbsd-386), const SYS_ACCEPT ideal-int +pkg syscall (openbsd-386), const SYS_ACCESS ideal-int +pkg syscall (openbsd-386), const SYS_ACCT ideal-int +pkg syscall (openbsd-386), const SYS_ADJFREQ ideal-int +pkg syscall (openbsd-386), const SYS_ADJTIME ideal-int +pkg syscall (openbsd-386), const SYS_BIND ideal-int +pkg syscall (openbsd-386), const SYS_CHDIR ideal-int +pkg syscall (openbsd-386), const SYS_CHFLAGS ideal-int +pkg syscall (openbsd-386), const SYS_CHMOD ideal-int +pkg syscall (openbsd-386), const SYS_CHOWN ideal-int +pkg syscall (openbsd-386), const SYS_CHROOT ideal-int +pkg syscall (openbsd-386), const SYS_CLOCK_GETRES ideal-int +pkg syscall (openbsd-386), const SYS_CLOCK_GETTIME ideal-int +pkg syscall (openbsd-386), const SYS_CLOCK_SETTIME ideal-int +pkg syscall (openbsd-386), const SYS_CLOSE ideal-int +pkg syscall (openbsd-386), const SYS_CLOSEFROM ideal-int +pkg syscall (openbsd-386), const SYS_CONNECT ideal-int +pkg syscall (openbsd-386), const SYS_DUP ideal-int +pkg syscall (openbsd-386), const SYS_DUP2 ideal-int +pkg syscall (openbsd-386), const SYS_EXECVE ideal-int +pkg syscall (openbsd-386), const SYS_EXIT ideal-int +pkg syscall (openbsd-386), const SYS_FACCESSAT ideal-int +pkg syscall (openbsd-386), const SYS_FCHDIR ideal-int +pkg syscall (openbsd-386), const SYS_FCHFLAGS ideal-int +pkg syscall (openbsd-386), const SYS_FCHMOD ideal-int +pkg syscall (openbsd-386), const SYS_FCHMODAT ideal-int +pkg syscall (openbsd-386), const SYS_FCHOWN ideal-int +pkg syscall (openbsd-386), const SYS_FCHOWNAT ideal-int +pkg syscall (openbsd-386), const SYS_FCNTL ideal-int +pkg syscall (openbsd-386), const SYS_FHOPEN ideal-int +pkg syscall (openbsd-386), const SYS_FHSTAT ideal-int +pkg syscall (openbsd-386), const SYS_FHSTATFS ideal-int +pkg syscall (openbsd-386), const SYS_FLOCK ideal-int +pkg syscall (openbsd-386), const SYS_FORK ideal-int +pkg syscall (openbsd-386), const SYS_FPATHCONF ideal-int +pkg syscall (openbsd-386), const SYS_FSTAT ideal-int +pkg syscall (openbsd-386), const SYS_FSTATAT ideal-int +pkg syscall (openbsd-386), const SYS_FSTATFS ideal-int +pkg syscall (openbsd-386), const SYS_FSYNC ideal-int +pkg syscall (openbsd-386), const SYS_FTRUNCATE ideal-int +pkg syscall (openbsd-386), const SYS_FUTIMENS ideal-int +pkg syscall (openbsd-386), const SYS_FUTIMES ideal-int +pkg syscall (openbsd-386), const SYS_GETDIRENTRIES ideal-int +pkg syscall (openbsd-386), const SYS_GETDTABLECOUNT ideal-int +pkg syscall (openbsd-386), const SYS_GETEGID ideal-int +pkg syscall (openbsd-386), const SYS_GETEUID ideal-int +pkg syscall (openbsd-386), const SYS_GETFH ideal-int +pkg syscall (openbsd-386), const SYS_GETFSSTAT ideal-int +pkg syscall (openbsd-386), const SYS_GETGID ideal-int +pkg syscall (openbsd-386), const SYS_GETGROUPS ideal-int +pkg syscall (openbsd-386), const SYS_GETITIMER ideal-int +pkg syscall (openbsd-386), const SYS_GETLOGIN ideal-int +pkg syscall (openbsd-386), const SYS_GETPEERNAME ideal-int +pkg syscall (openbsd-386), const SYS_GETPGID ideal-int +pkg syscall (openbsd-386), const SYS_GETPGRP ideal-int +pkg syscall (openbsd-386), const SYS_GETPID ideal-int +pkg syscall (openbsd-386), const SYS_GETPPID ideal-int +pkg syscall (openbsd-386), const SYS_GETPRIORITY ideal-int +pkg syscall (openbsd-386), const SYS_GETRESGID ideal-int +pkg syscall (openbsd-386), const SYS_GETRESUID ideal-int +pkg syscall (openbsd-386), const SYS_GETRLIMIT ideal-int +pkg syscall (openbsd-386), const SYS_GETRTABLE ideal-int +pkg syscall (openbsd-386), const SYS_GETRUSAGE ideal-int +pkg syscall (openbsd-386), const SYS_GETSID ideal-int +pkg syscall (openbsd-386), const SYS_GETSOCKNAME ideal-int +pkg syscall (openbsd-386), const SYS_GETSOCKOPT ideal-int +pkg syscall (openbsd-386), const SYS_GETTHRID ideal-int +pkg syscall (openbsd-386), const SYS_GETTIMEOFDAY ideal-int +pkg syscall (openbsd-386), const SYS_GETUID ideal-int +pkg syscall (openbsd-386), const SYS_IOCTL ideal-int +pkg syscall (openbsd-386), const SYS_ISSETUGID ideal-int +pkg syscall (openbsd-386), const SYS_KEVENT ideal-int +pkg syscall (openbsd-386), const SYS_KILL ideal-int +pkg syscall (openbsd-386), const SYS_KQUEUE ideal-int +pkg syscall (openbsd-386), const SYS_KTRACE ideal-int +pkg syscall (openbsd-386), const SYS_LCHOWN ideal-int +pkg syscall (openbsd-386), const SYS_LINK ideal-int +pkg syscall (openbsd-386), const SYS_LINKAT ideal-int +pkg syscall (openbsd-386), const SYS_LISTEN ideal-int +pkg syscall (openbsd-386), const SYS_LSEEK ideal-int +pkg syscall (openbsd-386), const SYS_LSTAT ideal-int +pkg syscall (openbsd-386), const SYS_MADVISE ideal-int +pkg syscall (openbsd-386), const SYS_MINCORE ideal-int +pkg syscall (openbsd-386), const SYS_MINHERIT ideal-int +pkg syscall (openbsd-386), const SYS_MKDIR ideal-int +pkg syscall (openbsd-386), const SYS_MKDIRAT ideal-int +pkg syscall (openbsd-386), const SYS_MKFIFO ideal-int +pkg syscall (openbsd-386), const SYS_MKFIFOAT ideal-int +pkg syscall (openbsd-386), const SYS_MKNOD ideal-int +pkg syscall (openbsd-386), const SYS_MKNODAT ideal-int +pkg syscall (openbsd-386), const SYS_MLOCK ideal-int +pkg syscall (openbsd-386), const SYS_MLOCKALL ideal-int +pkg syscall (openbsd-386), const SYS_MMAP ideal-int +pkg syscall (openbsd-386), const SYS_MOUNT ideal-int +pkg syscall (openbsd-386), const SYS_MPROTECT ideal-int +pkg syscall (openbsd-386), const SYS_MQUERY ideal-int +pkg syscall (openbsd-386), const SYS_MSGCTL ideal-int +pkg syscall (openbsd-386), const SYS_MSGGET ideal-int +pkg syscall (openbsd-386), const SYS_MSGRCV ideal-int +pkg syscall (openbsd-386), const SYS_MSGSND ideal-int +pkg syscall (openbsd-386), const SYS_MSYNC ideal-int +pkg syscall (openbsd-386), const SYS_MUNLOCK ideal-int +pkg syscall (openbsd-386), const SYS_MUNLOCKALL ideal-int +pkg syscall (openbsd-386), const SYS_MUNMAP ideal-int +pkg syscall (openbsd-386), const SYS_NANOSLEEP ideal-int +pkg syscall (openbsd-386), const SYS_NFSSVC ideal-int +pkg syscall (openbsd-386), const SYS_OBREAK ideal-int +pkg syscall (openbsd-386), const SYS_OPEN ideal-int +pkg syscall (openbsd-386), const SYS_OPENAT ideal-int +pkg syscall (openbsd-386), const SYS_PATHCONF ideal-int +pkg syscall (openbsd-386), const SYS_PIPE ideal-int +pkg syscall (openbsd-386), const SYS_POLL ideal-int +pkg syscall (openbsd-386), const SYS_PREAD ideal-int +pkg syscall (openbsd-386), const SYS_PREADV ideal-int +pkg syscall (openbsd-386), const SYS_PROFIL ideal-int +pkg syscall (openbsd-386), const SYS_PTRACE ideal-int +pkg syscall (openbsd-386), const SYS_PWRITE ideal-int +pkg syscall (openbsd-386), const SYS_PWRITEV ideal-int +pkg syscall (openbsd-386), const SYS_QUOTACTL ideal-int +pkg syscall (openbsd-386), const SYS_READ ideal-int +pkg syscall (openbsd-386), const SYS_READLINK ideal-int +pkg syscall (openbsd-386), const SYS_READLINKAT ideal-int +pkg syscall (openbsd-386), const SYS_READV ideal-int +pkg syscall (openbsd-386), const SYS_REBOOT ideal-int +pkg syscall (openbsd-386), const SYS_RECVFROM ideal-int +pkg syscall (openbsd-386), const SYS_RECVMSG ideal-int +pkg syscall (openbsd-386), const SYS_RENAME ideal-int +pkg syscall (openbsd-386), const SYS_RENAMEAT ideal-int +pkg syscall (openbsd-386), const SYS_REVOKE ideal-int +pkg syscall (openbsd-386), const SYS_RMDIR ideal-int +pkg syscall (openbsd-386), const SYS_SCHED_YIELD ideal-int +pkg syscall (openbsd-386), const SYS_SELECT ideal-int +pkg syscall (openbsd-386), const SYS_SEMGET ideal-int +pkg syscall (openbsd-386), const SYS_SEMOP ideal-int +pkg syscall (openbsd-386), const SYS_SENDMSG ideal-int +pkg syscall (openbsd-386), const SYS_SENDTO ideal-int +pkg syscall (openbsd-386), const SYS_SETEGID ideal-int +pkg syscall (openbsd-386), const SYS_SETEUID ideal-int +pkg syscall (openbsd-386), const SYS_SETGID ideal-int +pkg syscall (openbsd-386), const SYS_SETGROUPS ideal-int +pkg syscall (openbsd-386), const SYS_SETITIMER ideal-int +pkg syscall (openbsd-386), const SYS_SETLOGIN ideal-int +pkg syscall (openbsd-386), const SYS_SETPGID ideal-int +pkg syscall (openbsd-386), const SYS_SETPRIORITY ideal-int +pkg syscall (openbsd-386), const SYS_SETREGID ideal-int +pkg syscall (openbsd-386), const SYS_SETRESGID ideal-int +pkg syscall (openbsd-386), const SYS_SETRESUID ideal-int +pkg syscall (openbsd-386), const SYS_SETREUID ideal-int +pkg syscall (openbsd-386), const SYS_SETRLIMIT ideal-int +pkg syscall (openbsd-386), const SYS_SETRTABLE ideal-int +pkg syscall (openbsd-386), const SYS_SETSID ideal-int +pkg syscall (openbsd-386), const SYS_SETSOCKOPT ideal-int +pkg syscall (openbsd-386), const SYS_SETTIMEOFDAY ideal-int +pkg syscall (openbsd-386), const SYS_SETUID ideal-int +pkg syscall (openbsd-386), const SYS_SHMAT ideal-int +pkg syscall (openbsd-386), const SYS_SHMCTL ideal-int +pkg syscall (openbsd-386), const SYS_SHMDT ideal-int +pkg syscall (openbsd-386), const SYS_SHMGET ideal-int +pkg syscall (openbsd-386), const SYS_SHUTDOWN ideal-int +pkg syscall (openbsd-386), const SYS_SIGACTION ideal-int +pkg syscall (openbsd-386), const SYS_SIGALTSTACK ideal-int +pkg syscall (openbsd-386), const SYS_SIGPENDING ideal-int +pkg syscall (openbsd-386), const SYS_SIGPROCMASK ideal-int +pkg syscall (openbsd-386), const SYS_SIGRETURN ideal-int +pkg syscall (openbsd-386), const SYS_SIGSUSPEND ideal-int +pkg syscall (openbsd-386), const SYS_SOCKET ideal-int +pkg syscall (openbsd-386), const SYS_SOCKETPAIR ideal-int +pkg syscall (openbsd-386), const SYS_STAT ideal-int +pkg syscall (openbsd-386), const SYS_STATFS ideal-int +pkg syscall (openbsd-386), const SYS_SWAPCTL ideal-int +pkg syscall (openbsd-386), const SYS_SYMLINK ideal-int +pkg syscall (openbsd-386), const SYS_SYMLINKAT ideal-int +pkg syscall (openbsd-386), const SYS_SYNC ideal-int +pkg syscall (openbsd-386), const SYS_SYSARCH ideal-int +pkg syscall (openbsd-386), const SYS_TRUNCATE ideal-int +pkg syscall (openbsd-386), const SYS_UMASK ideal-int +pkg syscall (openbsd-386), const SYS_UNLINK ideal-int +pkg syscall (openbsd-386), const SYS_UNLINKAT ideal-int +pkg syscall (openbsd-386), const SYS_UNMOUNT ideal-int +pkg syscall (openbsd-386), const SYS_UTIMENSAT ideal-int +pkg syscall (openbsd-386), const SYS_UTIMES ideal-int +pkg syscall (openbsd-386), const SYS_VFORK ideal-int +pkg syscall (openbsd-386), const SYS_WAIT4 ideal-int +pkg syscall (openbsd-386), const SYS_WRITE ideal-int +pkg syscall (openbsd-386), const SYS_WRITEV ideal-int +pkg syscall (openbsd-386), const SYS___GETCWD ideal-int +pkg syscall (openbsd-386), const SYS___GET_TCB ideal-int +pkg syscall (openbsd-386), const SYS___SEMCTL ideal-int +pkg syscall (openbsd-386), const SYS___SET_TCB ideal-int +pkg syscall (openbsd-386), const SYS___SYSCTL ideal-int +pkg syscall (openbsd-386), const SYS___TFORK ideal-int +pkg syscall (openbsd-386), const SYS___THREXIT ideal-int +pkg syscall (openbsd-386), const SYS___THRSIGDIVERT ideal-int +pkg syscall (openbsd-386), const SYS___THRSLEEP ideal-int +pkg syscall (openbsd-386), const SYS___THRWAKEUP ideal-int +pkg syscall (openbsd-386), const SizeofBpfHdr ideal-int +pkg syscall (openbsd-386), const SizeofBpfInsn ideal-int +pkg syscall (openbsd-386), const SizeofBpfProgram ideal-int +pkg syscall (openbsd-386), const SizeofBpfStat ideal-int +pkg syscall (openbsd-386), const SizeofBpfVersion ideal-int +pkg syscall (openbsd-386), const SizeofCmsghdr ideal-int +pkg syscall (openbsd-386), const SizeofICMPv6Filter = 32 +pkg syscall (openbsd-386), const SizeofICMPv6Filter ideal-int +pkg syscall (openbsd-386), const SizeofIPMreq ideal-int +pkg syscall (openbsd-386), const SizeofIPv6MTUInfo = 32 +pkg syscall (openbsd-386), const SizeofIPv6MTUInfo ideal-int +pkg syscall (openbsd-386), const SizeofIPv6Mreq ideal-int +pkg syscall (openbsd-386), const SizeofIfAnnounceMsghdr ideal-int +pkg syscall (openbsd-386), const SizeofIfData ideal-int +pkg syscall (openbsd-386), const SizeofIfMsghdr ideal-int +pkg syscall (openbsd-386), const SizeofIfaMsghdr ideal-int +pkg syscall (openbsd-386), const SizeofInet6Pktinfo ideal-int +pkg syscall (openbsd-386), const SizeofLinger ideal-int +pkg syscall (openbsd-386), const SizeofMsghdr ideal-int +pkg syscall (openbsd-386), const SizeofRtMetrics ideal-int +pkg syscall (openbsd-386), const SizeofRtMsghdr ideal-int +pkg syscall (openbsd-386), const SizeofSockaddrAny ideal-int +pkg syscall (openbsd-386), const SizeofSockaddrDatalink ideal-int +pkg syscall (openbsd-386), const SizeofSockaddrInet4 ideal-int +pkg syscall (openbsd-386), const SizeofSockaddrInet6 ideal-int +pkg syscall (openbsd-386), const SizeofSockaddrUnix ideal-int +pkg syscall (openbsd-386), const TCIFLUSH ideal-int +pkg syscall (openbsd-386), const TCIOFLUSH ideal-int +pkg syscall (openbsd-386), const TCOFLUSH ideal-int +pkg syscall (openbsd-386), const TCP_MAXBURST ideal-int +pkg syscall (openbsd-386), const TCP_MAXSEG ideal-int +pkg syscall (openbsd-386), const TCP_MAXWIN ideal-int +pkg syscall (openbsd-386), const TCP_MAX_SACK ideal-int +pkg syscall (openbsd-386), const TCP_MAX_WINSHIFT ideal-int +pkg syscall (openbsd-386), const TCP_MD5SIG ideal-int +pkg syscall (openbsd-386), const TCP_MSS ideal-int +pkg syscall (openbsd-386), const TCP_NSTATES ideal-int +pkg syscall (openbsd-386), const TCP_SACK_ENABLE ideal-int +pkg syscall (openbsd-386), const TCSAFLUSH ideal-int +pkg syscall (openbsd-386), const TIOCCBRK ideal-int +pkg syscall (openbsd-386), const TIOCCDTR ideal-int +pkg syscall (openbsd-386), const TIOCCONS ideal-int +pkg syscall (openbsd-386), const TIOCDRAIN ideal-int +pkg syscall (openbsd-386), const TIOCEXCL ideal-int +pkg syscall (openbsd-386), const TIOCEXT ideal-int +pkg syscall (openbsd-386), const TIOCFLAG_CLOCAL ideal-int +pkg syscall (openbsd-386), const TIOCFLAG_CRTSCTS ideal-int +pkg syscall (openbsd-386), const TIOCFLAG_MDMBUF ideal-int +pkg syscall (openbsd-386), const TIOCFLAG_PPS ideal-int +pkg syscall (openbsd-386), const TIOCFLAG_SOFTCAR ideal-int +pkg syscall (openbsd-386), const TIOCFLUSH ideal-int +pkg syscall (openbsd-386), const TIOCGETA ideal-int +pkg syscall (openbsd-386), const TIOCGETD ideal-int +pkg syscall (openbsd-386), const TIOCGFLAGS ideal-int +pkg syscall (openbsd-386), const TIOCGPGRP ideal-int +pkg syscall (openbsd-386), const TIOCGTSTAMP ideal-int +pkg syscall (openbsd-386), const TIOCGWINSZ ideal-int +pkg syscall (openbsd-386), const TIOCMBIC ideal-int +pkg syscall (openbsd-386), const TIOCMBIS ideal-int +pkg syscall (openbsd-386), const TIOCMGET ideal-int +pkg syscall (openbsd-386), const TIOCMODG ideal-int +pkg syscall (openbsd-386), const TIOCMODS ideal-int +pkg syscall (openbsd-386), const TIOCMSET ideal-int +pkg syscall (openbsd-386), const TIOCM_CAR ideal-int +pkg syscall (openbsd-386), const TIOCM_CD ideal-int +pkg syscall (openbsd-386), const TIOCM_CTS ideal-int +pkg syscall (openbsd-386), const TIOCM_DSR ideal-int +pkg syscall (openbsd-386), const TIOCM_DTR ideal-int +pkg syscall (openbsd-386), const TIOCM_LE ideal-int +pkg syscall (openbsd-386), const TIOCM_RI ideal-int +pkg syscall (openbsd-386), const TIOCM_RNG ideal-int +pkg syscall (openbsd-386), const TIOCM_RTS ideal-int +pkg syscall (openbsd-386), const TIOCM_SR ideal-int +pkg syscall (openbsd-386), const TIOCM_ST ideal-int +pkg syscall (openbsd-386), const TIOCNOTTY ideal-int +pkg syscall (openbsd-386), const TIOCNXCL ideal-int +pkg syscall (openbsd-386), const TIOCOUTQ ideal-int +pkg syscall (openbsd-386), const TIOCPKT ideal-int +pkg syscall (openbsd-386), const TIOCPKT_DATA ideal-int +pkg syscall (openbsd-386), const TIOCPKT_DOSTOP ideal-int +pkg syscall (openbsd-386), const TIOCPKT_FLUSHREAD ideal-int +pkg syscall (openbsd-386), const TIOCPKT_FLUSHWRITE ideal-int +pkg syscall (openbsd-386), const TIOCPKT_IOCTL ideal-int +pkg syscall (openbsd-386), const TIOCPKT_NOSTOP ideal-int +pkg syscall (openbsd-386), const TIOCPKT_START ideal-int +pkg syscall (openbsd-386), const TIOCPKT_STOP ideal-int +pkg syscall (openbsd-386), const TIOCREMOTE ideal-int +pkg syscall (openbsd-386), const TIOCSBRK ideal-int +pkg syscall (openbsd-386), const TIOCSCTTY ideal-int +pkg syscall (openbsd-386), const TIOCSDTR ideal-int +pkg syscall (openbsd-386), const TIOCSETA ideal-int +pkg syscall (openbsd-386), const TIOCSETAF ideal-int +pkg syscall (openbsd-386), const TIOCSETAW ideal-int +pkg syscall (openbsd-386), const TIOCSETD ideal-int +pkg syscall (openbsd-386), const TIOCSFLAGS ideal-int +pkg syscall (openbsd-386), const TIOCSIG ideal-int +pkg syscall (openbsd-386), const TIOCSPGRP ideal-int +pkg syscall (openbsd-386), const TIOCSTART ideal-int +pkg syscall (openbsd-386), const TIOCSTAT ideal-int +pkg syscall (openbsd-386), const TIOCSTI ideal-int +pkg syscall (openbsd-386), const TIOCSTOP ideal-int +pkg syscall (openbsd-386), const TIOCSTSTAMP ideal-int +pkg syscall (openbsd-386), const TIOCSWINSZ ideal-int +pkg syscall (openbsd-386), const TIOCUCNTL ideal-int +pkg syscall (openbsd-386), const TOSTOP ideal-int +pkg syscall (openbsd-386), const VDISCARD ideal-int +pkg syscall (openbsd-386), const VDSUSP ideal-int +pkg syscall (openbsd-386), const VEOF ideal-int +pkg syscall (openbsd-386), const VEOL ideal-int +pkg syscall (openbsd-386), const VEOL2 ideal-int +pkg syscall (openbsd-386), const VERASE ideal-int +pkg syscall (openbsd-386), const VINTR ideal-int +pkg syscall (openbsd-386), const VKILL ideal-int +pkg syscall (openbsd-386), const VLNEXT ideal-int +pkg syscall (openbsd-386), const VMIN ideal-int +pkg syscall (openbsd-386), const VQUIT ideal-int +pkg syscall (openbsd-386), const VREPRINT ideal-int +pkg syscall (openbsd-386), const VSTART ideal-int +pkg syscall (openbsd-386), const VSTATUS ideal-int +pkg syscall (openbsd-386), const VSTOP ideal-int +pkg syscall (openbsd-386), const VSUSP ideal-int +pkg syscall (openbsd-386), const VTIME ideal-int +pkg syscall (openbsd-386), const VWERASE ideal-int +pkg syscall (openbsd-386), const WALTSIG ideal-int +pkg syscall (openbsd-386), const WCONTINUED ideal-int +pkg syscall (openbsd-386), const WCOREFLAG ideal-int +pkg syscall (openbsd-386), const WNOHANG ideal-int +pkg syscall (openbsd-386), const WSTOPPED ideal-int +pkg syscall (openbsd-386), const WUNTRACED ideal-int +pkg syscall (openbsd-386), func Accept(int) (int, Sockaddr, error) +pkg syscall (openbsd-386), func Access(string, uint32) error +pkg syscall (openbsd-386), func Adjtime(*Timeval, *Timeval) error +pkg syscall (openbsd-386), func Bind(int, Sockaddr) error +pkg syscall (openbsd-386), func BpfBuflen(int) (int, error) +pkg syscall (openbsd-386), func BpfDatalink(int) (int, error) +pkg syscall (openbsd-386), func BpfHeadercmpl(int) (int, error) +pkg syscall (openbsd-386), func BpfInterface(int, string) (string, error) +pkg syscall (openbsd-386), func BpfJump(int, int, int, int) *BpfInsn +pkg syscall (openbsd-386), func BpfStats(int) (*BpfStat, error) +pkg syscall (openbsd-386), func BpfStmt(int, int) *BpfInsn +pkg syscall (openbsd-386), func BpfTimeout(int) (*Timeval, error) +pkg syscall (openbsd-386), func CheckBpfVersion(int) error +pkg syscall (openbsd-386), func Chflags(string, int) error +pkg syscall (openbsd-386), func Chroot(string) error +pkg syscall (openbsd-386), func Close(int) error +pkg syscall (openbsd-386), func CloseOnExec(int) +pkg syscall (openbsd-386), func CmsgLen(int) int +pkg syscall (openbsd-386), func CmsgSpace(int) int +pkg syscall (openbsd-386), func Connect(int, Sockaddr) error +pkg syscall (openbsd-386), func Dup(int) (int, error) +pkg syscall (openbsd-386), func Dup2(int, int) error +pkg syscall (openbsd-386), func Fchdir(int) error +pkg syscall (openbsd-386), func Fchflags(int, int) error +pkg syscall (openbsd-386), func Fchmod(int, uint32) error +pkg syscall (openbsd-386), func Fchown(int, int, int) error +pkg syscall (openbsd-386), func Flock(int, int) error +pkg syscall (openbsd-386), func FlushBpf(int) error +pkg syscall (openbsd-386), func ForkExec(string, []string, *ProcAttr) (int, error) +pkg syscall (openbsd-386), func Fpathconf(int, int) (int, error) +pkg syscall (openbsd-386), func Fstat(int, *Stat_t) error +pkg syscall (openbsd-386), func Fstatfs(int, *Statfs_t) error +pkg syscall (openbsd-386), func Fsync(int) error +pkg syscall (openbsd-386), func Ftruncate(int, int64) error +pkg syscall (openbsd-386), func Futimes(int, []Timeval) error +pkg syscall (openbsd-386), func Getdirentries(int, []uint8, *uintptr) (int, error) +pkg syscall (openbsd-386), func Getfsstat([]Statfs_t, int) (int, error) +pkg syscall (openbsd-386), func Getpeername(int) (Sockaddr, error) +pkg syscall (openbsd-386), func Getpgid(int) (int, error) +pkg syscall (openbsd-386), func Getpgrp() int +pkg syscall (openbsd-386), func Getpriority(int, int) (int, error) +pkg syscall (openbsd-386), func Getrlimit(int, *Rlimit) error +pkg syscall (openbsd-386), func Getrusage(int, *Rusage) error +pkg syscall (openbsd-386), func Getsid(int) (int, error) +pkg syscall (openbsd-386), func Getsockname(int) (Sockaddr, error) +pkg syscall (openbsd-386), func GetsockoptByte(int, int, int) (uint8, error) +pkg syscall (openbsd-386), func GetsockoptICMPv6Filter(int, int, int) (*ICMPv6Filter, error) +pkg syscall (openbsd-386), func GetsockoptIPMreq(int, int, int) (*IPMreq, error) +pkg syscall (openbsd-386), func GetsockoptIPv6MTUInfo(int, int, int) (*IPv6MTUInfo, error) +pkg syscall (openbsd-386), func GetsockoptIPv6Mreq(int, int, int) (*IPv6Mreq, error) +pkg syscall (openbsd-386), func GetsockoptInet4Addr(int, int, int) ([4]uint8, error) +pkg syscall (openbsd-386), func GetsockoptInt(int, int, int) (int, error) +pkg syscall (openbsd-386), func Issetugid() bool +pkg syscall (openbsd-386), func Kevent(int, []Kevent_t, []Kevent_t, *Timespec) (int, error) +pkg syscall (openbsd-386), func Kill(int, Signal) error +pkg syscall (openbsd-386), func Kqueue() (int, error) +pkg syscall (openbsd-386), func Listen(int, int) error +pkg syscall (openbsd-386), func Lstat(string, *Stat_t) error +pkg syscall (openbsd-386), func Mkfifo(string, uint32) error +pkg syscall (openbsd-386), func Mknod(string, uint32, int) error +pkg syscall (openbsd-386), func Mmap(int, int64, int, int, int) ([]uint8, error) +pkg syscall (openbsd-386), func Munmap([]uint8) error +pkg syscall (openbsd-386), func Nanosleep(*Timespec, *Timespec) error +pkg syscall (openbsd-386), func Open(string, int, uint32) (int, error) +pkg syscall (openbsd-386), func ParseDirent([]uint8, int, []string) (int, int, []string) +pkg syscall (openbsd-386), func ParseRoutingMessage([]uint8) ([]RoutingMessage, error) +pkg syscall (openbsd-386), func ParseRoutingSockaddr(RoutingMessage) ([]Sockaddr, error) +pkg syscall (openbsd-386), func ParseSocketControlMessage([]uint8) ([]SocketControlMessage, error) +pkg syscall (openbsd-386), func ParseUnixRights(*SocketControlMessage) ([]int, error) +pkg syscall (openbsd-386), func Pathconf(string, int) (int, error) +pkg syscall (openbsd-386), func Pipe([]int) error +pkg syscall (openbsd-386), func Pread(int, []uint8, int64) (int, error) +pkg syscall (openbsd-386), func Pwrite(int, []uint8, int64) (int, error) +pkg syscall (openbsd-386), func RawSyscall(uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno) +pkg syscall (openbsd-386), func RawSyscall6(uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno) +pkg syscall (openbsd-386), func Read(int, []uint8) (int, error) +pkg syscall (openbsd-386), func ReadDirent(int, []uint8) (int, error) +pkg syscall (openbsd-386), func Recvfrom(int, []uint8, int) (int, Sockaddr, error) +pkg syscall (openbsd-386), func Recvmsg(int, []uint8, []uint8, int) (int, int, int, Sockaddr, error) +pkg syscall (openbsd-386), func Revoke(string) error +pkg syscall (openbsd-386), func RouteRIB(int, int) ([]uint8, error) +pkg syscall (openbsd-386), func Seek(int, int64, int) (int64, error) +pkg syscall (openbsd-386), func Select(int, *FdSet, *FdSet, *FdSet, *Timeval) error +pkg syscall (openbsd-386), func Sendfile(int, int, *int64, int) (int, error) +pkg syscall (openbsd-386), func Sendmsg(int, []uint8, []uint8, Sockaddr, int) error +pkg syscall (openbsd-386), func Sendto(int, []uint8, int, Sockaddr) error +pkg syscall (openbsd-386), func SetBpf(int, []BpfInsn) error +pkg syscall (openbsd-386), func SetBpfBuflen(int, int) (int, error) +pkg syscall (openbsd-386), func SetBpfDatalink(int, int) (int, error) +pkg syscall (openbsd-386), func SetBpfHeadercmpl(int, int) error +pkg syscall (openbsd-386), func SetBpfImmediate(int, int) error +pkg syscall (openbsd-386), func SetBpfInterface(int, string) error +pkg syscall (openbsd-386), func SetBpfPromisc(int, int) error +pkg syscall (openbsd-386), func SetBpfTimeout(int, *Timeval) error +pkg syscall (openbsd-386), func SetKevent(*Kevent_t, int, int, int) +pkg syscall (openbsd-386), func SetNonblock(int, bool) error +pkg syscall (openbsd-386), func Setegid(int) error +pkg syscall (openbsd-386), func Seteuid(int) error +pkg syscall (openbsd-386), func Setgid(int) error +pkg syscall (openbsd-386), func Setgroups([]int) error +pkg syscall (openbsd-386), func Setlogin(string) error +pkg syscall (openbsd-386), func Setpgid(int, int) error +pkg syscall (openbsd-386), func Setpriority(int, int, int) error +pkg syscall (openbsd-386), func Setregid(int, int) error +pkg syscall (openbsd-386), func Setreuid(int, int) error +pkg syscall (openbsd-386), func Setrlimit(int, *Rlimit) error +pkg syscall (openbsd-386), func Setsid() (int, error) +pkg syscall (openbsd-386), func SetsockoptByte(int, int, int, uint8) error +pkg syscall (openbsd-386), func SetsockoptICMPv6Filter(int, int, int, *ICMPv6Filter) error +pkg syscall (openbsd-386), func SetsockoptIPMreq(int, int, int, *IPMreq) error +pkg syscall (openbsd-386), func SetsockoptIPv6Mreq(int, int, int, *IPv6Mreq) error +pkg syscall (openbsd-386), func SetsockoptInet4Addr(int, int, int, [4]uint8) error +pkg syscall (openbsd-386), func SetsockoptInt(int, int, int, int) error +pkg syscall (openbsd-386), func SetsockoptLinger(int, int, int, *Linger) error +pkg syscall (openbsd-386), func SetsockoptString(int, int, int, string) error +pkg syscall (openbsd-386), func SetsockoptTimeval(int, int, int, *Timeval) error +pkg syscall (openbsd-386), func Settimeofday(*Timeval) error +pkg syscall (openbsd-386), func Setuid(int) error +pkg syscall (openbsd-386), func Shutdown(int, int) error +pkg syscall (openbsd-386), func SlicePtrFromStrings([]string) ([]*uint8, error) +pkg syscall (openbsd-386), func Socket(int, int, int) (int, error) +pkg syscall (openbsd-386), func Socketpair(int, int, int) ([2]int, error) +pkg syscall (openbsd-386), func Stat(string, *Stat_t) error +pkg syscall (openbsd-386), func Statfs(string, *Statfs_t) error +pkg syscall (openbsd-386), func StringSlicePtr([]string) []*uint8 +pkg syscall (openbsd-386), func Sync() error +pkg syscall (openbsd-386), func Syscall(uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno) +pkg syscall (openbsd-386), func Syscall6(uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno) +pkg syscall (openbsd-386), func Syscall9(uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno) +pkg syscall (openbsd-386), func Sysctl(string) (string, error) +pkg syscall (openbsd-386), func SysctlUint32(string) (uint32, error) +pkg syscall (openbsd-386), func TimevalToNsec(Timeval) int64 +pkg syscall (openbsd-386), func Truncate(string, int64) error +pkg syscall (openbsd-386), func Umask(int) int +pkg syscall (openbsd-386), func UnixRights(...int) []uint8 +pkg syscall (openbsd-386), func Unmount(string, int) error +pkg syscall (openbsd-386), func Wait4(int, *WaitStatus, int, *Rusage) (int, error) +pkg syscall (openbsd-386), func Write(int, []uint8) (int, error) +pkg syscall (openbsd-386), method (*Cmsghdr) SetLen(int) +pkg syscall (openbsd-386), method (*Iovec) SetLen(int) +pkg syscall (openbsd-386), method (*Msghdr) SetControllen(int) +pkg syscall (openbsd-386), type BpfHdr struct +pkg syscall (openbsd-386), type BpfHdr struct, Caplen uint32 +pkg syscall (openbsd-386), type BpfHdr struct, Datalen uint32 +pkg syscall (openbsd-386), type BpfHdr struct, Hdrlen uint16 +pkg syscall (openbsd-386), type BpfHdr struct, Pad_cgo_0 [2]uint8 +pkg syscall (openbsd-386), type BpfHdr struct, Tstamp BpfTimeval +pkg syscall (openbsd-386), type BpfInsn struct +pkg syscall (openbsd-386), type BpfInsn struct, Code uint16 +pkg syscall (openbsd-386), type BpfInsn struct, Jf uint8 +pkg syscall (openbsd-386), type BpfInsn struct, Jt uint8 +pkg syscall (openbsd-386), type BpfInsn struct, K uint32 +pkg syscall (openbsd-386), type BpfProgram struct +pkg syscall (openbsd-386), type BpfProgram struct, Insns *BpfInsn +pkg syscall (openbsd-386), type BpfProgram struct, Len uint32 +pkg syscall (openbsd-386), type BpfStat struct +pkg syscall (openbsd-386), type BpfStat struct, Drop uint32 +pkg syscall (openbsd-386), type BpfStat struct, Recv uint32 +pkg syscall (openbsd-386), type BpfTimeval struct +pkg syscall (openbsd-386), type BpfTimeval struct, Sec uint32 +pkg syscall (openbsd-386), type BpfTimeval struct, Usec uint32 +pkg syscall (openbsd-386), type BpfVersion struct +pkg syscall (openbsd-386), type BpfVersion struct, Major uint16 +pkg syscall (openbsd-386), type BpfVersion struct, Minor uint16 +pkg syscall (openbsd-386), type Cmsghdr struct +pkg syscall (openbsd-386), type Cmsghdr struct, Len uint32 +pkg syscall (openbsd-386), type Cmsghdr struct, Level int32 +pkg syscall (openbsd-386), type Cmsghdr struct, Type int32 +pkg syscall (openbsd-386), type Credential struct +pkg syscall (openbsd-386), type Credential struct, Gid uint32 +pkg syscall (openbsd-386), type Credential struct, Groups []uint32 +pkg syscall (openbsd-386), type Credential struct, Uid uint32 +pkg syscall (openbsd-386), type Dirent struct +pkg syscall (openbsd-386), type Dirent struct, Fileno uint32 +pkg syscall (openbsd-386), type Dirent struct, Name [256]int8 +pkg syscall (openbsd-386), type Dirent struct, Namlen uint8 +pkg syscall (openbsd-386), type Dirent struct, Reclen uint16 +pkg syscall (openbsd-386), type Dirent struct, Type uint8 +pkg syscall (openbsd-386), type FdSet struct +pkg syscall (openbsd-386), type FdSet struct, Bits [32]int32 +pkg syscall (openbsd-386), type Flock_t struct +pkg syscall (openbsd-386), type Flock_t struct, Len int64 +pkg syscall (openbsd-386), type Flock_t struct, Pid int32 +pkg syscall (openbsd-386), type Flock_t struct, Start int64 +pkg syscall (openbsd-386), type Flock_t struct, Type int16 +pkg syscall (openbsd-386), type Flock_t struct, Whence int16 +pkg syscall (openbsd-386), type Fsid struct +pkg syscall (openbsd-386), type Fsid struct, Val [2]int32 +pkg syscall (openbsd-386), type ICMPv6Filter struct +pkg syscall (openbsd-386), type ICMPv6Filter struct, Filt [8]uint32 +pkg syscall (openbsd-386), type IPv6MTUInfo struct +pkg syscall (openbsd-386), type IPv6MTUInfo struct, Addr RawSockaddrInet6 +pkg syscall (openbsd-386), type IPv6MTUInfo struct, Mtu uint32 +pkg syscall (openbsd-386), type IfAnnounceMsghdr struct +pkg syscall (openbsd-386), type IfAnnounceMsghdr struct, Hdrlen uint16 +pkg syscall (openbsd-386), type IfAnnounceMsghdr struct, Index uint16 +pkg syscall (openbsd-386), type IfAnnounceMsghdr struct, Msglen uint16 +pkg syscall (openbsd-386), type IfAnnounceMsghdr struct, Name [16]int8 +pkg syscall (openbsd-386), type IfAnnounceMsghdr struct, Type uint8 +pkg syscall (openbsd-386), type IfAnnounceMsghdr struct, Version uint8 +pkg syscall (openbsd-386), type IfAnnounceMsghdr struct, What uint16 +pkg syscall (openbsd-386), type IfData struct +pkg syscall (openbsd-386), type IfData struct, Addrlen uint8 +pkg syscall (openbsd-386), type IfData struct, Baudrate uint64 +pkg syscall (openbsd-386), type IfData struct, Capabilities uint32 +pkg syscall (openbsd-386), type IfData struct, Collisions uint64 +pkg syscall (openbsd-386), type IfData struct, Hdrlen uint8 +pkg syscall (openbsd-386), type IfData struct, Ibytes uint64 +pkg syscall (openbsd-386), type IfData struct, Ierrors uint64 +pkg syscall (openbsd-386), type IfData struct, Imcasts uint64 +pkg syscall (openbsd-386), type IfData struct, Ipackets uint64 +pkg syscall (openbsd-386), type IfData struct, Iqdrops uint64 +pkg syscall (openbsd-386), type IfData struct, Lastchange Timeval +pkg syscall (openbsd-386), type IfData struct, Link_state uint8 +pkg syscall (openbsd-386), type IfData struct, Mclpool [7]Mclpool +pkg syscall (openbsd-386), type IfData struct, Metric uint32 +pkg syscall (openbsd-386), type IfData struct, Mtu uint32 +pkg syscall (openbsd-386), type IfData struct, Noproto uint64 +pkg syscall (openbsd-386), type IfData struct, Obytes uint64 +pkg syscall (openbsd-386), type IfData struct, Oerrors uint64 +pkg syscall (openbsd-386), type IfData struct, Omcasts uint64 +pkg syscall (openbsd-386), type IfData struct, Opackets uint64 +pkg syscall (openbsd-386), type IfData struct, Pad uint32 +pkg syscall (openbsd-386), type IfData struct, Type uint8 +pkg syscall (openbsd-386), type IfMsghdr struct +pkg syscall (openbsd-386), type IfMsghdr struct, Addrs int32 +pkg syscall (openbsd-386), type IfMsghdr struct, Data IfData +pkg syscall (openbsd-386), type IfMsghdr struct, Flags int32 +pkg syscall (openbsd-386), type IfMsghdr struct, Hdrlen uint16 +pkg syscall (openbsd-386), type IfMsghdr struct, Index uint16 +pkg syscall (openbsd-386), type IfMsghdr struct, Msglen uint16 +pkg syscall (openbsd-386), type IfMsghdr struct, Pad1 uint8 +pkg syscall (openbsd-386), type IfMsghdr struct, Pad2 uint8 +pkg syscall (openbsd-386), type IfMsghdr struct, Tableid uint16 +pkg syscall (openbsd-386), type IfMsghdr struct, Type uint8 +pkg syscall (openbsd-386), type IfMsghdr struct, Version uint8 +pkg syscall (openbsd-386), type IfMsghdr struct, Xflags int32 +pkg syscall (openbsd-386), type IfaMsghdr struct +pkg syscall (openbsd-386), type IfaMsghdr struct, Addrs int32 +pkg syscall (openbsd-386), type IfaMsghdr struct, Flags int32 +pkg syscall (openbsd-386), type IfaMsghdr struct, Hdrlen uint16 +pkg syscall (openbsd-386), type IfaMsghdr struct, Index uint16 +pkg syscall (openbsd-386), type IfaMsghdr struct, Metric int32 +pkg syscall (openbsd-386), type IfaMsghdr struct, Msglen uint16 +pkg syscall (openbsd-386), type IfaMsghdr struct, Pad1 uint8 +pkg syscall (openbsd-386), type IfaMsghdr struct, Pad2 uint8 +pkg syscall (openbsd-386), type IfaMsghdr struct, Tableid uint16 +pkg syscall (openbsd-386), type IfaMsghdr struct, Type uint8 +pkg syscall (openbsd-386), type IfaMsghdr struct, Version uint8 +pkg syscall (openbsd-386), type Inet6Pktinfo struct +pkg syscall (openbsd-386), type Inet6Pktinfo struct, Addr [16]uint8 +pkg syscall (openbsd-386), type Inet6Pktinfo struct, Ifindex uint32 +pkg syscall (openbsd-386), type InterfaceAddrMessage struct +pkg syscall (openbsd-386), type InterfaceAddrMessage struct, Data []uint8 +pkg syscall (openbsd-386), type InterfaceAddrMessage struct, Header IfaMsghdr +pkg syscall (openbsd-386), type InterfaceAnnounceMessage struct +pkg syscall (openbsd-386), type InterfaceAnnounceMessage struct, Header IfAnnounceMsghdr +pkg syscall (openbsd-386), type InterfaceMessage struct +pkg syscall (openbsd-386), type InterfaceMessage struct, Data []uint8 +pkg syscall (openbsd-386), type InterfaceMessage struct, Header IfMsghdr +pkg syscall (openbsd-386), type Iovec struct +pkg syscall (openbsd-386), type Iovec struct, Base *uint8 +pkg syscall (openbsd-386), type Iovec struct, Len uint32 +pkg syscall (openbsd-386), type Kevent_t struct +pkg syscall (openbsd-386), type Kevent_t struct, Data int32 +pkg syscall (openbsd-386), type Kevent_t struct, Fflags uint32 +pkg syscall (openbsd-386), type Kevent_t struct, Filter int16 +pkg syscall (openbsd-386), type Kevent_t struct, Flags uint16 +pkg syscall (openbsd-386), type Kevent_t struct, Ident uint32 +pkg syscall (openbsd-386), type Kevent_t struct, Udata *uint8 +pkg syscall (openbsd-386), type Mclpool struct +pkg syscall (openbsd-386), type Mclpool struct, Alive uint16 +pkg syscall (openbsd-386), type Mclpool struct, Cwm uint16 +pkg syscall (openbsd-386), type Mclpool struct, Grown uint32 +pkg syscall (openbsd-386), type Mclpool struct, Hwm uint16 +pkg syscall (openbsd-386), type Mclpool struct, Lwm uint16 +pkg syscall (openbsd-386), type Msghdr struct +pkg syscall (openbsd-386), type Msghdr struct, Control *uint8 +pkg syscall (openbsd-386), type Msghdr struct, Controllen uint32 +pkg syscall (openbsd-386), type Msghdr struct, Flags int32 +pkg syscall (openbsd-386), type Msghdr struct, Iov *Iovec +pkg syscall (openbsd-386), type Msghdr struct, Iovlen uint32 +pkg syscall (openbsd-386), type Msghdr struct, Name *uint8 +pkg syscall (openbsd-386), type Msghdr struct, Namelen uint32 +pkg syscall (openbsd-386), type RawSockaddr struct, Data [14]int8 +pkg syscall (openbsd-386), type RawSockaddr struct, Family uint8 +pkg syscall (openbsd-386), type RawSockaddr struct, Len uint8 +pkg syscall (openbsd-386), type RawSockaddrAny struct, Pad [92]int8 +pkg syscall (openbsd-386), type RawSockaddrDatalink struct +pkg syscall (openbsd-386), type RawSockaddrDatalink struct, Alen uint8 +pkg syscall (openbsd-386), type RawSockaddrDatalink struct, Data [24]int8 +pkg syscall (openbsd-386), type RawSockaddrDatalink struct, Family uint8 +pkg syscall (openbsd-386), type RawSockaddrDatalink struct, Index uint16 +pkg syscall (openbsd-386), type RawSockaddrDatalink struct, Len uint8 +pkg syscall (openbsd-386), type RawSockaddrDatalink struct, Nlen uint8 +pkg syscall (openbsd-386), type RawSockaddrDatalink struct, Slen uint8 +pkg syscall (openbsd-386), type RawSockaddrDatalink struct, Type uint8 +pkg syscall (openbsd-386), type RawSockaddrInet4 struct, Family uint8 +pkg syscall (openbsd-386), type RawSockaddrInet4 struct, Len uint8 +pkg syscall (openbsd-386), type RawSockaddrInet4 struct, Zero [8]int8 +pkg syscall (openbsd-386), type RawSockaddrInet6 struct, Family uint8 +pkg syscall (openbsd-386), type RawSockaddrInet6 struct, Len uint8 +pkg syscall (openbsd-386), type RawSockaddrUnix struct +pkg syscall (openbsd-386), type RawSockaddrUnix struct, Family uint8 +pkg syscall (openbsd-386), type RawSockaddrUnix struct, Len uint8 +pkg syscall (openbsd-386), type RawSockaddrUnix struct, Path [104]int8 +pkg syscall (openbsd-386), type Rlimit struct +pkg syscall (openbsd-386), type Rlimit struct, Cur uint64 +pkg syscall (openbsd-386), type Rlimit struct, Max uint64 +pkg syscall (openbsd-386), type RouteMessage struct +pkg syscall (openbsd-386), type RouteMessage struct, Data []uint8 +pkg syscall (openbsd-386), type RouteMessage struct, Header RtMsghdr +pkg syscall (openbsd-386), type RoutingMessage interface, unexported methods +pkg syscall (openbsd-386), type RtMetrics struct +pkg syscall (openbsd-386), type RtMetrics struct, Expire uint32 +pkg syscall (openbsd-386), type RtMetrics struct, Hopcount uint32 +pkg syscall (openbsd-386), type RtMetrics struct, Locks uint32 +pkg syscall (openbsd-386), type RtMetrics struct, Mtu uint32 +pkg syscall (openbsd-386), type RtMetrics struct, Pksent uint64 +pkg syscall (openbsd-386), type RtMetrics struct, Recvpipe uint32 +pkg syscall (openbsd-386), type RtMetrics struct, Refcnt uint32 +pkg syscall (openbsd-386), type RtMetrics struct, Rtt uint32 +pkg syscall (openbsd-386), type RtMetrics struct, Rttvar uint32 +pkg syscall (openbsd-386), type RtMetrics struct, Sendpipe uint32 +pkg syscall (openbsd-386), type RtMetrics struct, Ssthresh uint32 +pkg syscall (openbsd-386), type RtMsghdr struct +pkg syscall (openbsd-386), type RtMsghdr struct, Addrs int32 +pkg syscall (openbsd-386), type RtMsghdr struct, Errno int32 +pkg syscall (openbsd-386), type RtMsghdr struct, Flags int32 +pkg syscall (openbsd-386), type RtMsghdr struct, Fmask int32 +pkg syscall (openbsd-386), type RtMsghdr struct, Hdrlen uint16 +pkg syscall (openbsd-386), type RtMsghdr struct, Index uint16 +pkg syscall (openbsd-386), type RtMsghdr struct, Inits uint32 +pkg syscall (openbsd-386), type RtMsghdr struct, Mpls uint8 +pkg syscall (openbsd-386), type RtMsghdr struct, Msglen uint16 +pkg syscall (openbsd-386), type RtMsghdr struct, Pid int32 +pkg syscall (openbsd-386), type RtMsghdr struct, Priority uint8 +pkg syscall (openbsd-386), type RtMsghdr struct, Rmx RtMetrics +pkg syscall (openbsd-386), type RtMsghdr struct, Seq int32 +pkg syscall (openbsd-386), type RtMsghdr struct, Tableid uint16 +pkg syscall (openbsd-386), type RtMsghdr struct, Type uint8 +pkg syscall (openbsd-386), type RtMsghdr struct, Version uint8 +pkg syscall (openbsd-386), type Rusage struct, Idrss int32 +pkg syscall (openbsd-386), type Rusage struct, Inblock int32 +pkg syscall (openbsd-386), type Rusage struct, Isrss int32 +pkg syscall (openbsd-386), type Rusage struct, Ixrss int32 +pkg syscall (openbsd-386), type Rusage struct, Majflt int32 +pkg syscall (openbsd-386), type Rusage struct, Maxrss int32 +pkg syscall (openbsd-386), type Rusage struct, Minflt int32 +pkg syscall (openbsd-386), type Rusage struct, Msgrcv int32 +pkg syscall (openbsd-386), type Rusage struct, Msgsnd int32 +pkg syscall (openbsd-386), type Rusage struct, Nivcsw int32 +pkg syscall (openbsd-386), type Rusage struct, Nsignals int32 +pkg syscall (openbsd-386), type Rusage struct, Nswap int32 +pkg syscall (openbsd-386), type Rusage struct, Nvcsw int32 +pkg syscall (openbsd-386), type Rusage struct, Oublock int32 +pkg syscall (openbsd-386), type Rusage struct, Stime Timeval +pkg syscall (openbsd-386), type Rusage struct, Utime Timeval +pkg syscall (openbsd-386), type SockaddrDatalink struct +pkg syscall (openbsd-386), type SockaddrDatalink struct, Alen uint8 +pkg syscall (openbsd-386), type SockaddrDatalink struct, Data [24]int8 +pkg syscall (openbsd-386), type SockaddrDatalink struct, Family uint8 +pkg syscall (openbsd-386), type SockaddrDatalink struct, Index uint16 +pkg syscall (openbsd-386), type SockaddrDatalink struct, Len uint8 +pkg syscall (openbsd-386), type SockaddrDatalink struct, Nlen uint8 +pkg syscall (openbsd-386), type SockaddrDatalink struct, Slen uint8 +pkg syscall (openbsd-386), type SockaddrDatalink struct, Type uint8 +pkg syscall (openbsd-386), type SocketControlMessage struct +pkg syscall (openbsd-386), type SocketControlMessage struct, Data []uint8 +pkg syscall (openbsd-386), type SocketControlMessage struct, Header Cmsghdr +pkg syscall (openbsd-386), type Stat_t struct +pkg syscall (openbsd-386), type Stat_t struct, Atim Timespec +pkg syscall (openbsd-386), type Stat_t struct, Blksize uint32 +pkg syscall (openbsd-386), type Stat_t struct, Blocks int64 +pkg syscall (openbsd-386), type Stat_t struct, Ctim Timespec +pkg syscall (openbsd-386), type Stat_t struct, Dev int32 +pkg syscall (openbsd-386), type Stat_t struct, Flags uint32 +pkg syscall (openbsd-386), type Stat_t struct, Gen uint32 +pkg syscall (openbsd-386), type Stat_t struct, Gid uint32 +pkg syscall (openbsd-386), type Stat_t struct, Ino uint32 +pkg syscall (openbsd-386), type Stat_t struct, Lspare0 int32 +pkg syscall (openbsd-386), type Stat_t struct, Lspare1 int32 +pkg syscall (openbsd-386), type Stat_t struct, Mode uint32 +pkg syscall (openbsd-386), type Stat_t struct, Mtim Timespec +pkg syscall (openbsd-386), type Stat_t struct, Nlink uint32 +pkg syscall (openbsd-386), type Stat_t struct, Qspare [2]int64 +pkg syscall (openbsd-386), type Stat_t struct, Rdev int32 +pkg syscall (openbsd-386), type Stat_t struct, Size int64 +pkg syscall (openbsd-386), type Stat_t struct, Uid uint32 +pkg syscall (openbsd-386), type Stat_t struct, X__st_birthtim Timespec +pkg syscall (openbsd-386), type Statfs_t struct +pkg syscall (openbsd-386), type Statfs_t struct, F_asyncreads uint64 +pkg syscall (openbsd-386), type Statfs_t struct, F_asyncwrites uint64 +pkg syscall (openbsd-386), type Statfs_t struct, F_bavail int64 +pkg syscall (openbsd-386), type Statfs_t struct, F_bfree uint64 +pkg syscall (openbsd-386), type Statfs_t struct, F_blocks uint64 +pkg syscall (openbsd-386), type Statfs_t struct, F_bsize uint32 +pkg syscall (openbsd-386), type Statfs_t struct, F_ctime uint32 +pkg syscall (openbsd-386), type Statfs_t struct, F_favail int64 +pkg syscall (openbsd-386), type Statfs_t struct, F_ffree uint64 +pkg syscall (openbsd-386), type Statfs_t struct, F_files uint64 +pkg syscall (openbsd-386), type Statfs_t struct, F_flags uint32 +pkg syscall (openbsd-386), type Statfs_t struct, F_fsid Fsid +pkg syscall (openbsd-386), type Statfs_t struct, F_fstypename [16]int8 +pkg syscall (openbsd-386), type Statfs_t struct, F_iosize uint32 +pkg syscall (openbsd-386), type Statfs_t struct, F_mntfromname [90]int8 +pkg syscall (openbsd-386), type Statfs_t struct, F_mntonname [90]int8 +pkg syscall (openbsd-386), type Statfs_t struct, F_namemax uint32 +pkg syscall (openbsd-386), type Statfs_t struct, F_owner uint32 +pkg syscall (openbsd-386), type Statfs_t struct, F_spare [3]uint32 +pkg syscall (openbsd-386), type Statfs_t struct, F_syncreads uint64 +pkg syscall (openbsd-386), type Statfs_t struct, F_syncwrites uint64 +pkg syscall (openbsd-386), type Statfs_t struct, Mount_info [160]uint8 +pkg syscall (openbsd-386), type SysProcAttr struct, Chroot string +pkg syscall (openbsd-386), type SysProcAttr struct, Credential *Credential +pkg syscall (openbsd-386), type SysProcAttr struct, Noctty bool +pkg syscall (openbsd-386), type SysProcAttr struct, Ptrace bool +pkg syscall (openbsd-386), type SysProcAttr struct, Setctty bool +pkg syscall (openbsd-386), type SysProcAttr struct, Setpgid bool +pkg syscall (openbsd-386), type SysProcAttr struct, Setsid bool +pkg syscall (openbsd-386), type Timespec struct, Nsec int32 +pkg syscall (openbsd-386), type Timespec struct, Sec int32 +pkg syscall (openbsd-386), type Timeval struct, Sec int32 +pkg syscall (openbsd-386), type Timeval struct, Usec int32 +pkg syscall (openbsd-386), type WaitStatus uint32 +pkg syscall (openbsd-386), var Stderr int +pkg syscall (openbsd-386), var Stdin int +pkg syscall (openbsd-386), var Stdout int +pkg syscall (openbsd-386-cgo), const AF_APPLETALK ideal-int +pkg syscall (openbsd-386-cgo), const AF_BLUETOOTH ideal-int +pkg syscall (openbsd-386-cgo), const AF_CCITT ideal-int +pkg syscall (openbsd-386-cgo), const AF_CHAOS ideal-int +pkg syscall (openbsd-386-cgo), const AF_CNT ideal-int +pkg syscall (openbsd-386-cgo), const AF_COIP ideal-int +pkg syscall (openbsd-386-cgo), const AF_DATAKIT ideal-int +pkg syscall (openbsd-386-cgo), const AF_DECnet ideal-int +pkg syscall (openbsd-386-cgo), const AF_DLI ideal-int +pkg syscall (openbsd-386-cgo), const AF_E164 ideal-int +pkg syscall (openbsd-386-cgo), const AF_ECMA ideal-int +pkg syscall (openbsd-386-cgo), const AF_ENCAP ideal-int +pkg syscall (openbsd-386-cgo), const AF_HYLINK ideal-int +pkg syscall (openbsd-386-cgo), const AF_IMPLINK ideal-int +pkg syscall (openbsd-386-cgo), const AF_IPX ideal-int +pkg syscall (openbsd-386-cgo), const AF_ISDN ideal-int +pkg syscall (openbsd-386-cgo), const AF_ISO ideal-int +pkg syscall (openbsd-386-cgo), const AF_KEY ideal-int +pkg syscall (openbsd-386-cgo), const AF_LAT ideal-int +pkg syscall (openbsd-386-cgo), const AF_LINK ideal-int +pkg syscall (openbsd-386-cgo), const AF_LOCAL ideal-int +pkg syscall (openbsd-386-cgo), const AF_MAX ideal-int +pkg syscall (openbsd-386-cgo), const AF_MPLS ideal-int +pkg syscall (openbsd-386-cgo), const AF_NATM ideal-int +pkg syscall (openbsd-386-cgo), const AF_NS ideal-int +pkg syscall (openbsd-386-cgo), const AF_OSI ideal-int +pkg syscall (openbsd-386-cgo), const AF_PUP ideal-int +pkg syscall (openbsd-386-cgo), const AF_ROUTE ideal-int +pkg syscall (openbsd-386-cgo), const AF_SIP ideal-int +pkg syscall (openbsd-386-cgo), const AF_SNA ideal-int +pkg syscall (openbsd-386-cgo), const ARPHRD_ETHER ideal-int +pkg syscall (openbsd-386-cgo), const ARPHRD_FRELAY ideal-int +pkg syscall (openbsd-386-cgo), const ARPHRD_IEEE1394 ideal-int +pkg syscall (openbsd-386-cgo), const ARPHRD_IEEE802 ideal-int +pkg syscall (openbsd-386-cgo), const B0 ideal-int +pkg syscall (openbsd-386-cgo), const B110 ideal-int +pkg syscall (openbsd-386-cgo), const B115200 ideal-int +pkg syscall (openbsd-386-cgo), const B1200 ideal-int +pkg syscall (openbsd-386-cgo), const B134 ideal-int +pkg syscall (openbsd-386-cgo), const B14400 ideal-int +pkg syscall (openbsd-386-cgo), const B150 ideal-int +pkg syscall (openbsd-386-cgo), const B1800 ideal-int +pkg syscall (openbsd-386-cgo), const B19200 ideal-int +pkg syscall (openbsd-386-cgo), const B200 ideal-int +pkg syscall (openbsd-386-cgo), const B230400 ideal-int +pkg syscall (openbsd-386-cgo), const B2400 ideal-int +pkg syscall (openbsd-386-cgo), const B28800 ideal-int +pkg syscall (openbsd-386-cgo), const B300 ideal-int +pkg syscall (openbsd-386-cgo), const B38400 ideal-int +pkg syscall (openbsd-386-cgo), const B4800 ideal-int +pkg syscall (openbsd-386-cgo), const B50 ideal-int +pkg syscall (openbsd-386-cgo), const B57600 ideal-int +pkg syscall (openbsd-386-cgo), const B600 ideal-int +pkg syscall (openbsd-386-cgo), const B7200 ideal-int +pkg syscall (openbsd-386-cgo), const B75 ideal-int +pkg syscall (openbsd-386-cgo), const B76800 ideal-int +pkg syscall (openbsd-386-cgo), const B9600 ideal-int +pkg syscall (openbsd-386-cgo), const BIOCFLUSH ideal-int +pkg syscall (openbsd-386-cgo), const BIOCGBLEN ideal-int +pkg syscall (openbsd-386-cgo), const BIOCGDIRFILT ideal-int +pkg syscall (openbsd-386-cgo), const BIOCGDLT ideal-int +pkg syscall (openbsd-386-cgo), const BIOCGDLTLIST ideal-int +pkg syscall (openbsd-386-cgo), const BIOCGETIF ideal-int +pkg syscall (openbsd-386-cgo), const BIOCGFILDROP ideal-int +pkg syscall (openbsd-386-cgo), const BIOCGHDRCMPLT ideal-int +pkg syscall (openbsd-386-cgo), const BIOCGRSIG ideal-int +pkg syscall (openbsd-386-cgo), const BIOCGRTIMEOUT ideal-int +pkg syscall (openbsd-386-cgo), const BIOCGSTATS ideal-int +pkg syscall (openbsd-386-cgo), const BIOCIMMEDIATE ideal-int +pkg syscall (openbsd-386-cgo), const BIOCLOCK ideal-int +pkg syscall (openbsd-386-cgo), const BIOCPROMISC ideal-int +pkg syscall (openbsd-386-cgo), const BIOCSBLEN ideal-int +pkg syscall (openbsd-386-cgo), const BIOCSDIRFILT ideal-int +pkg syscall (openbsd-386-cgo), const BIOCSDLT ideal-int +pkg syscall (openbsd-386-cgo), const BIOCSETF ideal-int +pkg syscall (openbsd-386-cgo), const BIOCSETIF ideal-int +pkg syscall (openbsd-386-cgo), const BIOCSETWF ideal-int +pkg syscall (openbsd-386-cgo), const BIOCSFILDROP ideal-int +pkg syscall (openbsd-386-cgo), const BIOCSHDRCMPLT ideal-int +pkg syscall (openbsd-386-cgo), const BIOCSRSIG ideal-int +pkg syscall (openbsd-386-cgo), const BIOCSRTIMEOUT ideal-int +pkg syscall (openbsd-386-cgo), const BIOCVERSION ideal-int +pkg syscall (openbsd-386-cgo), const BPF_A ideal-int +pkg syscall (openbsd-386-cgo), const BPF_ABS ideal-int +pkg syscall (openbsd-386-cgo), const BPF_ADD ideal-int +pkg syscall (openbsd-386-cgo), const BPF_ALIGNMENT ideal-int +pkg syscall (openbsd-386-cgo), const BPF_ALU ideal-int +pkg syscall (openbsd-386-cgo), const BPF_AND ideal-int +pkg syscall (openbsd-386-cgo), const BPF_B ideal-int +pkg syscall (openbsd-386-cgo), const BPF_DIRECTION_IN ideal-int +pkg syscall (openbsd-386-cgo), const BPF_DIRECTION_OUT ideal-int +pkg syscall (openbsd-386-cgo), const BPF_DIV ideal-int +pkg syscall (openbsd-386-cgo), const BPF_H ideal-int +pkg syscall (openbsd-386-cgo), const BPF_IMM ideal-int +pkg syscall (openbsd-386-cgo), const BPF_IND ideal-int +pkg syscall (openbsd-386-cgo), const BPF_JA ideal-int +pkg syscall (openbsd-386-cgo), const BPF_JEQ ideal-int +pkg syscall (openbsd-386-cgo), const BPF_JGE ideal-int +pkg syscall (openbsd-386-cgo), const BPF_JGT ideal-int +pkg syscall (openbsd-386-cgo), const BPF_JMP ideal-int +pkg syscall (openbsd-386-cgo), const BPF_JSET ideal-int +pkg syscall (openbsd-386-cgo), const BPF_K ideal-int +pkg syscall (openbsd-386-cgo), const BPF_LD ideal-int +pkg syscall (openbsd-386-cgo), const BPF_LDX ideal-int +pkg syscall (openbsd-386-cgo), const BPF_LEN ideal-int +pkg syscall (openbsd-386-cgo), const BPF_LSH ideal-int +pkg syscall (openbsd-386-cgo), const BPF_MAJOR_VERSION ideal-int +pkg syscall (openbsd-386-cgo), const BPF_MAXBUFSIZE ideal-int +pkg syscall (openbsd-386-cgo), const BPF_MAXINSNS ideal-int +pkg syscall (openbsd-386-cgo), const BPF_MEM ideal-int +pkg syscall (openbsd-386-cgo), const BPF_MEMWORDS ideal-int +pkg syscall (openbsd-386-cgo), const BPF_MINBUFSIZE ideal-int +pkg syscall (openbsd-386-cgo), const BPF_MINOR_VERSION ideal-int +pkg syscall (openbsd-386-cgo), const BPF_MISC ideal-int +pkg syscall (openbsd-386-cgo), const BPF_MSH ideal-int +pkg syscall (openbsd-386-cgo), const BPF_MUL ideal-int +pkg syscall (openbsd-386-cgo), const BPF_NEG ideal-int +pkg syscall (openbsd-386-cgo), const BPF_OR ideal-int +pkg syscall (openbsd-386-cgo), const BPF_RELEASE ideal-int +pkg syscall (openbsd-386-cgo), const BPF_RET ideal-int +pkg syscall (openbsd-386-cgo), const BPF_RSH ideal-int +pkg syscall (openbsd-386-cgo), const BPF_ST ideal-int +pkg syscall (openbsd-386-cgo), const BPF_STX ideal-int +pkg syscall (openbsd-386-cgo), const BPF_SUB ideal-int +pkg syscall (openbsd-386-cgo), const BPF_TAX ideal-int +pkg syscall (openbsd-386-cgo), const BPF_TXA ideal-int +pkg syscall (openbsd-386-cgo), const BPF_W ideal-int +pkg syscall (openbsd-386-cgo), const BPF_X ideal-int +pkg syscall (openbsd-386-cgo), const BRKINT ideal-int +pkg syscall (openbsd-386-cgo), const CFLUSH ideal-int +pkg syscall (openbsd-386-cgo), const CLOCAL ideal-int +pkg syscall (openbsd-386-cgo), const CREAD ideal-int +pkg syscall (openbsd-386-cgo), const CS5 ideal-int +pkg syscall (openbsd-386-cgo), const CS6 ideal-int +pkg syscall (openbsd-386-cgo), const CS7 ideal-int +pkg syscall (openbsd-386-cgo), const CS8 ideal-int +pkg syscall (openbsd-386-cgo), const CSIZE ideal-int +pkg syscall (openbsd-386-cgo), const CSTART ideal-int +pkg syscall (openbsd-386-cgo), const CSTATUS ideal-int +pkg syscall (openbsd-386-cgo), const CSTOP ideal-int +pkg syscall (openbsd-386-cgo), const CSTOPB ideal-int +pkg syscall (openbsd-386-cgo), const CSUSP ideal-int +pkg syscall (openbsd-386-cgo), const CTL_MAXNAME ideal-int +pkg syscall (openbsd-386-cgo), const CTL_NET ideal-int +pkg syscall (openbsd-386-cgo), const DIOCOSFPFLUSH ideal-int +pkg syscall (openbsd-386-cgo), const DLT_ARCNET ideal-int +pkg syscall (openbsd-386-cgo), const DLT_ATM_RFC1483 ideal-int +pkg syscall (openbsd-386-cgo), const DLT_AX25 ideal-int +pkg syscall (openbsd-386-cgo), const DLT_CHAOS ideal-int +pkg syscall (openbsd-386-cgo), const DLT_C_HDLC ideal-int +pkg syscall (openbsd-386-cgo), const DLT_EN10MB ideal-int +pkg syscall (openbsd-386-cgo), const DLT_EN3MB ideal-int +pkg syscall (openbsd-386-cgo), const DLT_ENC ideal-int +pkg syscall (openbsd-386-cgo), const DLT_FDDI ideal-int +pkg syscall (openbsd-386-cgo), const DLT_IEEE802 ideal-int +pkg syscall (openbsd-386-cgo), const DLT_IEEE802_11 ideal-int +pkg syscall (openbsd-386-cgo), const DLT_IEEE802_11_RADIO ideal-int +pkg syscall (openbsd-386-cgo), const DLT_LOOP ideal-int +pkg syscall (openbsd-386-cgo), const DLT_MPLS ideal-int +pkg syscall (openbsd-386-cgo), const DLT_NULL ideal-int +pkg syscall (openbsd-386-cgo), const DLT_PFLOG ideal-int +pkg syscall (openbsd-386-cgo), const DLT_PFSYNC ideal-int +pkg syscall (openbsd-386-cgo), const DLT_PPP ideal-int +pkg syscall (openbsd-386-cgo), const DLT_PPP_BSDOS ideal-int +pkg syscall (openbsd-386-cgo), const DLT_PPP_ETHER ideal-int +pkg syscall (openbsd-386-cgo), const DLT_PPP_SERIAL ideal-int +pkg syscall (openbsd-386-cgo), const DLT_PRONET ideal-int +pkg syscall (openbsd-386-cgo), const DLT_RAW ideal-int +pkg syscall (openbsd-386-cgo), const DLT_SLIP ideal-int +pkg syscall (openbsd-386-cgo), const DLT_SLIP_BSDOS ideal-int +pkg syscall (openbsd-386-cgo), const DT_BLK ideal-int +pkg syscall (openbsd-386-cgo), const DT_CHR ideal-int +pkg syscall (openbsd-386-cgo), const DT_DIR ideal-int +pkg syscall (openbsd-386-cgo), const DT_FIFO ideal-int +pkg syscall (openbsd-386-cgo), const DT_LNK ideal-int +pkg syscall (openbsd-386-cgo), const DT_REG ideal-int +pkg syscall (openbsd-386-cgo), const DT_SOCK ideal-int +pkg syscall (openbsd-386-cgo), const DT_UNKNOWN ideal-int +pkg syscall (openbsd-386-cgo), const EAUTH Errno +pkg syscall (openbsd-386-cgo), const EBADRPC Errno +pkg syscall (openbsd-386-cgo), const ECHO ideal-int +pkg syscall (openbsd-386-cgo), const ECHOCTL ideal-int +pkg syscall (openbsd-386-cgo), const ECHOE ideal-int +pkg syscall (openbsd-386-cgo), const ECHOK ideal-int +pkg syscall (openbsd-386-cgo), const ECHOKE ideal-int +pkg syscall (openbsd-386-cgo), const ECHONL ideal-int +pkg syscall (openbsd-386-cgo), const ECHOPRT ideal-int +pkg syscall (openbsd-386-cgo), const EFTYPE Errno +pkg syscall (openbsd-386-cgo), const EIPSEC Errno +pkg syscall (openbsd-386-cgo), const ELAST Errno +pkg syscall (openbsd-386-cgo), const EMEDIUMTYPE Errno +pkg syscall (openbsd-386-cgo), const EMT_TAGOVF ideal-int +pkg syscall (openbsd-386-cgo), const EMUL_ENABLED ideal-int +pkg syscall (openbsd-386-cgo), const EMUL_NATIVE ideal-int +pkg syscall (openbsd-386-cgo), const ENDRUNDISC ideal-int +pkg syscall (openbsd-386-cgo), const ENEEDAUTH Errno +pkg syscall (openbsd-386-cgo), const ENOATTR Errno +pkg syscall (openbsd-386-cgo), const ENOMEDIUM Errno +pkg syscall (openbsd-386-cgo), const EPROCLIM Errno +pkg syscall (openbsd-386-cgo), const EPROCUNAVAIL Errno +pkg syscall (openbsd-386-cgo), const EPROGMISMATCH Errno +pkg syscall (openbsd-386-cgo), const EPROGUNAVAIL Errno +pkg syscall (openbsd-386-cgo), const ERPCMISMATCH Errno +pkg syscall (openbsd-386-cgo), const ETHERMIN ideal-int +pkg syscall (openbsd-386-cgo), const ETHERMTU ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_8023 ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_AARP ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_ACCTON ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_AEONIC ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_ALPHA ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_AMBER ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_AMOEBA ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_AOE ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_APOLLO ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_APOLLODOMAIN ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_APPLETALK ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_APPLITEK ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_ARGONAUT ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_ARP ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_AT ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_ATALK ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_ATOMIC ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_ATT ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_ATTSTANFORD ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_AUTOPHON ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_AXIS ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_BCLOOP ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_BOFL ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_CABLETRON ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_CHAOS ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_COMDESIGN ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_COMPUGRAPHIC ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_COUNTERPOINT ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_CRONUS ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_CRONUSVLN ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_DCA ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_DDE ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_DEBNI ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_DECAM ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_DECCUST ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_DECDIAG ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_DECDNS ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_DECDTS ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_DECEXPER ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_DECLAST ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_DECLTM ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_DECMUMPS ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_DECNETBIOS ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_DELTACON ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_DIDDLE ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_DLOG1 ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_DLOG2 ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_DN ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_DOGFIGHT ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_DSMD ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_ECMA ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_ENCRYPT ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_ES ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_EXCELAN ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_EXPERDATA ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_FLIP ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_FLOWCONTROL ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_FRARP ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_GENDYN ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_HAYES ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_HIPPI_FP ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_HITACHI ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_HP ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_IEEEPUP ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_IEEEPUPAT ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_IMLBL ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_IMLBLDIAG ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_IP ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_IPAS ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_IPV6 ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_IPX ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_IPXNEW ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_KALPANA ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_LANBRIDGE ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_LANPROBE ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_LAT ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_LBACK ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_LITTLE ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_LLDP ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_LOGICRAFT ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_LOOPBACK ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_MATRA ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_MAX ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_MERIT ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_MICP ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_MOPDL ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_MOPRC ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_MOTOROLA ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_MPLS ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_MPLS_MCAST ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_MUMPS ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_NBPCC ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_NBPCLAIM ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_NBPCLREQ ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_NBPCLRSP ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_NBPCREQ ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_NBPCRSP ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_NBPDG ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_NBPDGB ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_NBPDLTE ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_NBPRAR ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_NBPRAS ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_NBPRST ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_NBPSCD ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_NBPVCD ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_NBS ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_NCD ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_NESTAR ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_NETBEUI ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_NOVELL ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_NS ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_NSAT ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_NSCOMPAT ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_NTRAILER ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_OS9 ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_OS9NET ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_PACER ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_PAE ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_PCS ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_PLANNING ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_PPP ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_PPPOE ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_PPPOEDISC ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_PRIMENTS ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_PUP ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_PUPAT ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_QINQ ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_RACAL ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_RATIONAL ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_RAWFR ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_RCL ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_RDP ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_RETIX ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_REVARP ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_SCA ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_SECTRA ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_SECUREDATA ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_SGITW ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_SG_BOUNCE ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_SG_DIAG ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_SG_NETGAMES ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_SG_RESV ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_SIMNET ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_SLOW ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_SNA ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_SNMP ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_SONIX ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_SPIDER ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_SPRITE ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_STP ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_TALARIS ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_TALARISMC ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_TCPCOMP ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_TCPSM ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_TEC ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_TIGAN ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_TRAIL ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_TRANSETHER ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_TYMSHARE ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_UBBST ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_UBDEBUG ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_UBDIAGLOOP ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_UBDL ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_UBNIU ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_UBNMC ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_VALID ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_VARIAN ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_VAXELN ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_VEECO ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_VEXP ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_VGLAB ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_VINES ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_VINESECHO ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_VINESLOOP ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_VITAL ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_VLAN ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_VLTLMAN ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_VPROD ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_VURESERVED ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_WATERLOO ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_WELLFLEET ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_X25 ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_X75 ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_XNSSM ideal-int +pkg syscall (openbsd-386-cgo), const ETHERTYPE_XTP ideal-int +pkg syscall (openbsd-386-cgo), const ETHER_ADDR_LEN ideal-int +pkg syscall (openbsd-386-cgo), const ETHER_ALIGN ideal-int +pkg syscall (openbsd-386-cgo), const ETHER_CRC_LEN ideal-int +pkg syscall (openbsd-386-cgo), const ETHER_CRC_POLY_BE ideal-int +pkg syscall (openbsd-386-cgo), const ETHER_CRC_POLY_LE ideal-int +pkg syscall (openbsd-386-cgo), const ETHER_HDR_LEN ideal-int +pkg syscall (openbsd-386-cgo), const ETHER_MAX_DIX_LEN ideal-int +pkg syscall (openbsd-386-cgo), const ETHER_MAX_LEN ideal-int +pkg syscall (openbsd-386-cgo), const ETHER_MIN_LEN ideal-int +pkg syscall (openbsd-386-cgo), const ETHER_TYPE_LEN ideal-int +pkg syscall (openbsd-386-cgo), const ETHER_VLAN_ENCAP_LEN ideal-int +pkg syscall (openbsd-386-cgo), const EVFILT_AIO ideal-int +pkg syscall (openbsd-386-cgo), const EVFILT_PROC ideal-int +pkg syscall (openbsd-386-cgo), const EVFILT_READ ideal-int +pkg syscall (openbsd-386-cgo), const EVFILT_SIGNAL ideal-int +pkg syscall (openbsd-386-cgo), const EVFILT_SYSCOUNT ideal-int +pkg syscall (openbsd-386-cgo), const EVFILT_TIMER ideal-int +pkg syscall (openbsd-386-cgo), const EVFILT_VNODE ideal-int +pkg syscall (openbsd-386-cgo), const EVFILT_WRITE ideal-int +pkg syscall (openbsd-386-cgo), const EV_ADD ideal-int +pkg syscall (openbsd-386-cgo), const EV_CLEAR ideal-int +pkg syscall (openbsd-386-cgo), const EV_DELETE ideal-int +pkg syscall (openbsd-386-cgo), const EV_DISABLE ideal-int +pkg syscall (openbsd-386-cgo), const EV_ENABLE ideal-int +pkg syscall (openbsd-386-cgo), const EV_EOF ideal-int +pkg syscall (openbsd-386-cgo), const EV_ERROR ideal-int +pkg syscall (openbsd-386-cgo), const EV_FLAG1 ideal-int +pkg syscall (openbsd-386-cgo), const EV_ONESHOT ideal-int +pkg syscall (openbsd-386-cgo), const EV_SYSFLAGS ideal-int +pkg syscall (openbsd-386-cgo), const EXTA ideal-int +pkg syscall (openbsd-386-cgo), const EXTB ideal-int +pkg syscall (openbsd-386-cgo), const EXTPROC ideal-int +pkg syscall (openbsd-386-cgo), const FD_CLOEXEC ideal-int +pkg syscall (openbsd-386-cgo), const FD_SETSIZE ideal-int +pkg syscall (openbsd-386-cgo), const FLUSHO ideal-int +pkg syscall (openbsd-386-cgo), const F_DUPFD ideal-int +pkg syscall (openbsd-386-cgo), const F_DUPFD_CLOEXEC ideal-int +pkg syscall (openbsd-386-cgo), const F_GETFD ideal-int +pkg syscall (openbsd-386-cgo), const F_GETFL ideal-int +pkg syscall (openbsd-386-cgo), const F_GETLK ideal-int +pkg syscall (openbsd-386-cgo), const F_GETOWN ideal-int +pkg syscall (openbsd-386-cgo), const F_OK ideal-int +pkg syscall (openbsd-386-cgo), const F_RDLCK ideal-int +pkg syscall (openbsd-386-cgo), const F_SETFD ideal-int +pkg syscall (openbsd-386-cgo), const F_SETFL ideal-int +pkg syscall (openbsd-386-cgo), const F_SETLK ideal-int +pkg syscall (openbsd-386-cgo), const F_SETLKW ideal-int +pkg syscall (openbsd-386-cgo), const F_SETOWN ideal-int +pkg syscall (openbsd-386-cgo), const F_UNLCK ideal-int +pkg syscall (openbsd-386-cgo), const F_WRLCK ideal-int +pkg syscall (openbsd-386-cgo), const HUPCL ideal-int +pkg syscall (openbsd-386-cgo), const ICANON ideal-int +pkg syscall (openbsd-386-cgo), const ICMP6_FILTER = 18 +pkg syscall (openbsd-386-cgo), const ICMP6_FILTER ideal-int +pkg syscall (openbsd-386-cgo), const ICRNL ideal-int +pkg syscall (openbsd-386-cgo), const IEXTEN ideal-int +pkg syscall (openbsd-386-cgo), const IFAN_ARRIVAL ideal-int +pkg syscall (openbsd-386-cgo), const IFAN_DEPARTURE ideal-int +pkg syscall (openbsd-386-cgo), const IFA_ROUTE ideal-int +pkg syscall (openbsd-386-cgo), const IFF_ALLMULTI ideal-int +pkg syscall (openbsd-386-cgo), const IFF_CANTCHANGE ideal-int +pkg syscall (openbsd-386-cgo), const IFF_DEBUG ideal-int +pkg syscall (openbsd-386-cgo), const IFF_LINK0 ideal-int +pkg syscall (openbsd-386-cgo), const IFF_LINK1 ideal-int +pkg syscall (openbsd-386-cgo), const IFF_LINK2 ideal-int +pkg syscall (openbsd-386-cgo), const IFF_NOARP ideal-int +pkg syscall (openbsd-386-cgo), const IFF_NOTRAILERS ideal-int +pkg syscall (openbsd-386-cgo), const IFF_OACTIVE ideal-int +pkg syscall (openbsd-386-cgo), const IFF_POINTOPOINT ideal-int +pkg syscall (openbsd-386-cgo), const IFF_PROMISC ideal-int +pkg syscall (openbsd-386-cgo), const IFF_RUNNING ideal-int +pkg syscall (openbsd-386-cgo), const IFF_SIMPLEX ideal-int +pkg syscall (openbsd-386-cgo), const IFNAMSIZ ideal-int +pkg syscall (openbsd-386-cgo), const IFT_1822 ideal-int +pkg syscall (openbsd-386-cgo), const IFT_A12MPPSWITCH ideal-int +pkg syscall (openbsd-386-cgo), const IFT_AAL2 ideal-int +pkg syscall (openbsd-386-cgo), const IFT_AAL5 ideal-int +pkg syscall (openbsd-386-cgo), const IFT_ADSL ideal-int +pkg syscall (openbsd-386-cgo), const IFT_AFLANE8023 ideal-int +pkg syscall (openbsd-386-cgo), const IFT_AFLANE8025 ideal-int +pkg syscall (openbsd-386-cgo), const IFT_ARAP ideal-int +pkg syscall (openbsd-386-cgo), const IFT_ARCNET ideal-int +pkg syscall (openbsd-386-cgo), const IFT_ARCNETPLUS ideal-int +pkg syscall (openbsd-386-cgo), const IFT_ASYNC ideal-int +pkg syscall (openbsd-386-cgo), const IFT_ATM ideal-int +pkg syscall (openbsd-386-cgo), const IFT_ATMDXI ideal-int +pkg syscall (openbsd-386-cgo), const IFT_ATMFUNI ideal-int +pkg syscall (openbsd-386-cgo), const IFT_ATMIMA ideal-int +pkg syscall (openbsd-386-cgo), const IFT_ATMLOGICAL ideal-int +pkg syscall (openbsd-386-cgo), const IFT_ATMRADIO ideal-int +pkg syscall (openbsd-386-cgo), const IFT_ATMSUBINTERFACE ideal-int +pkg syscall (openbsd-386-cgo), const IFT_ATMVCIENDPT ideal-int +pkg syscall (openbsd-386-cgo), const IFT_ATMVIRTUAL ideal-int +pkg syscall (openbsd-386-cgo), const IFT_BGPPOLICYACCOUNTING ideal-int +pkg syscall (openbsd-386-cgo), const IFT_BLUETOOTH ideal-int +pkg syscall (openbsd-386-cgo), const IFT_BRIDGE ideal-int +pkg syscall (openbsd-386-cgo), const IFT_BSC ideal-int +pkg syscall (openbsd-386-cgo), const IFT_CARP ideal-int +pkg syscall (openbsd-386-cgo), const IFT_CCTEMUL ideal-int +pkg syscall (openbsd-386-cgo), const IFT_CEPT ideal-int +pkg syscall (openbsd-386-cgo), const IFT_CES ideal-int +pkg syscall (openbsd-386-cgo), const IFT_CHANNEL ideal-int +pkg syscall (openbsd-386-cgo), const IFT_CNR ideal-int +pkg syscall (openbsd-386-cgo), const IFT_COFFEE ideal-int +pkg syscall (openbsd-386-cgo), const IFT_COMPOSITELINK ideal-int +pkg syscall (openbsd-386-cgo), const IFT_DCN ideal-int +pkg syscall (openbsd-386-cgo), const IFT_DIGITALPOWERLINE ideal-int +pkg syscall (openbsd-386-cgo), const IFT_DIGITALWRAPPEROVERHEADCHANNEL ideal-int +pkg syscall (openbsd-386-cgo), const IFT_DLSW ideal-int +pkg syscall (openbsd-386-cgo), const IFT_DOCSCABLEDOWNSTREAM ideal-int +pkg syscall (openbsd-386-cgo), const IFT_DOCSCABLEMACLAYER ideal-int +pkg syscall (openbsd-386-cgo), const IFT_DOCSCABLEUPSTREAM ideal-int +pkg syscall (openbsd-386-cgo), const IFT_DOCSCABLEUPSTREAMCHANNEL ideal-int +pkg syscall (openbsd-386-cgo), const IFT_DS0 ideal-int +pkg syscall (openbsd-386-cgo), const IFT_DS0BUNDLE ideal-int +pkg syscall (openbsd-386-cgo), const IFT_DS1FDL ideal-int +pkg syscall (openbsd-386-cgo), const IFT_DS3 ideal-int +pkg syscall (openbsd-386-cgo), const IFT_DTM ideal-int +pkg syscall (openbsd-386-cgo), const IFT_DUMMY ideal-int +pkg syscall (openbsd-386-cgo), const IFT_DVBASILN ideal-int +pkg syscall (openbsd-386-cgo), const IFT_DVBASIOUT ideal-int +pkg syscall (openbsd-386-cgo), const IFT_DVBRCCDOWNSTREAM ideal-int +pkg syscall (openbsd-386-cgo), const IFT_DVBRCCMACLAYER ideal-int +pkg syscall (openbsd-386-cgo), const IFT_DVBRCCUPSTREAM ideal-int +pkg syscall (openbsd-386-cgo), const IFT_ECONET ideal-int +pkg syscall (openbsd-386-cgo), const IFT_ENC ideal-int +pkg syscall (openbsd-386-cgo), const IFT_EON ideal-int +pkg syscall (openbsd-386-cgo), const IFT_EPLRS ideal-int +pkg syscall (openbsd-386-cgo), const IFT_ESCON ideal-int +pkg syscall (openbsd-386-cgo), const IFT_ETHER ideal-int +pkg syscall (openbsd-386-cgo), const IFT_FAITH ideal-int +pkg syscall (openbsd-386-cgo), const IFT_FAST ideal-int +pkg syscall (openbsd-386-cgo), const IFT_FASTETHER ideal-int +pkg syscall (openbsd-386-cgo), const IFT_FASTETHERFX ideal-int +pkg syscall (openbsd-386-cgo), const IFT_FDDI ideal-int +pkg syscall (openbsd-386-cgo), const IFT_FIBRECHANNEL ideal-int +pkg syscall (openbsd-386-cgo), const IFT_FRAMERELAYINTERCONNECT ideal-int +pkg syscall (openbsd-386-cgo), const IFT_FRAMERELAYMPI ideal-int +pkg syscall (openbsd-386-cgo), const IFT_FRDLCIENDPT ideal-int +pkg syscall (openbsd-386-cgo), const IFT_FRELAY ideal-int +pkg syscall (openbsd-386-cgo), const IFT_FRELAYDCE ideal-int +pkg syscall (openbsd-386-cgo), const IFT_FRF16MFRBUNDLE ideal-int +pkg syscall (openbsd-386-cgo), const IFT_FRFORWARD ideal-int +pkg syscall (openbsd-386-cgo), const IFT_G703AT2MB ideal-int +pkg syscall (openbsd-386-cgo), const IFT_G703AT64K ideal-int +pkg syscall (openbsd-386-cgo), const IFT_GIF ideal-int +pkg syscall (openbsd-386-cgo), const IFT_GIGABITETHERNET ideal-int +pkg syscall (openbsd-386-cgo), const IFT_GR303IDT ideal-int +pkg syscall (openbsd-386-cgo), const IFT_GR303RDT ideal-int +pkg syscall (openbsd-386-cgo), const IFT_H323GATEKEEPER ideal-int +pkg syscall (openbsd-386-cgo), const IFT_H323PROXY ideal-int +pkg syscall (openbsd-386-cgo), const IFT_HDH1822 ideal-int +pkg syscall (openbsd-386-cgo), const IFT_HDLC ideal-int +pkg syscall (openbsd-386-cgo), const IFT_HDSL2 ideal-int +pkg syscall (openbsd-386-cgo), const IFT_HIPERLAN2 ideal-int +pkg syscall (openbsd-386-cgo), const IFT_HIPPI ideal-int +pkg syscall (openbsd-386-cgo), const IFT_HIPPIINTERFACE ideal-int +pkg syscall (openbsd-386-cgo), const IFT_HOSTPAD ideal-int +pkg syscall (openbsd-386-cgo), const IFT_HSSI ideal-int +pkg syscall (openbsd-386-cgo), const IFT_HY ideal-int +pkg syscall (openbsd-386-cgo), const IFT_IBM370PARCHAN ideal-int +pkg syscall (openbsd-386-cgo), const IFT_IDSL ideal-int +pkg syscall (openbsd-386-cgo), const IFT_IEEE1394 ideal-int +pkg syscall (openbsd-386-cgo), const IFT_IEEE80211 ideal-int +pkg syscall (openbsd-386-cgo), const IFT_IEEE80212 ideal-int +pkg syscall (openbsd-386-cgo), const IFT_IEEE8023ADLAG ideal-int +pkg syscall (openbsd-386-cgo), const IFT_IFGSN ideal-int +pkg syscall (openbsd-386-cgo), const IFT_IMT ideal-int +pkg syscall (openbsd-386-cgo), const IFT_INFINIBAND ideal-int +pkg syscall (openbsd-386-cgo), const IFT_INTERLEAVE ideal-int +pkg syscall (openbsd-386-cgo), const IFT_IP ideal-int +pkg syscall (openbsd-386-cgo), const IFT_IPFORWARD ideal-int +pkg syscall (openbsd-386-cgo), const IFT_IPOVERATM ideal-int +pkg syscall (openbsd-386-cgo), const IFT_IPOVERCDLC ideal-int +pkg syscall (openbsd-386-cgo), const IFT_IPOVERCLAW ideal-int +pkg syscall (openbsd-386-cgo), const IFT_IPSWITCH ideal-int +pkg syscall (openbsd-386-cgo), const IFT_ISDN ideal-int +pkg syscall (openbsd-386-cgo), const IFT_ISDNBASIC ideal-int +pkg syscall (openbsd-386-cgo), const IFT_ISDNPRIMARY ideal-int +pkg syscall (openbsd-386-cgo), const IFT_ISDNS ideal-int +pkg syscall (openbsd-386-cgo), const IFT_ISDNU ideal-int +pkg syscall (openbsd-386-cgo), const IFT_ISO88022LLC ideal-int +pkg syscall (openbsd-386-cgo), const IFT_ISO88023 ideal-int +pkg syscall (openbsd-386-cgo), const IFT_ISO88024 ideal-int +pkg syscall (openbsd-386-cgo), const IFT_ISO88025 ideal-int +pkg syscall (openbsd-386-cgo), const IFT_ISO88025CRFPINT ideal-int +pkg syscall (openbsd-386-cgo), const IFT_ISO88025DTR ideal-int +pkg syscall (openbsd-386-cgo), const IFT_ISO88025FIBER ideal-int +pkg syscall (openbsd-386-cgo), const IFT_ISO88026 ideal-int +pkg syscall (openbsd-386-cgo), const IFT_ISUP ideal-int +pkg syscall (openbsd-386-cgo), const IFT_L2VLAN ideal-int +pkg syscall (openbsd-386-cgo), const IFT_L3IPVLAN ideal-int +pkg syscall (openbsd-386-cgo), const IFT_L3IPXVLAN ideal-int +pkg syscall (openbsd-386-cgo), const IFT_LAPB ideal-int +pkg syscall (openbsd-386-cgo), const IFT_LAPD ideal-int +pkg syscall (openbsd-386-cgo), const IFT_LAPF ideal-int +pkg syscall (openbsd-386-cgo), const IFT_LINEGROUP ideal-int +pkg syscall (openbsd-386-cgo), const IFT_LOCALTALK ideal-int +pkg syscall (openbsd-386-cgo), const IFT_LOOP ideal-int +pkg syscall (openbsd-386-cgo), const IFT_MEDIAMAILOVERIP ideal-int +pkg syscall (openbsd-386-cgo), const IFT_MFSIGLINK ideal-int +pkg syscall (openbsd-386-cgo), const IFT_MIOX25 ideal-int +pkg syscall (openbsd-386-cgo), const IFT_MODEM ideal-int +pkg syscall (openbsd-386-cgo), const IFT_MPC ideal-int +pkg syscall (openbsd-386-cgo), const IFT_MPLS ideal-int +pkg syscall (openbsd-386-cgo), const IFT_MPLSTUNNEL ideal-int +pkg syscall (openbsd-386-cgo), const IFT_MSDSL ideal-int +pkg syscall (openbsd-386-cgo), const IFT_MVL ideal-int +pkg syscall (openbsd-386-cgo), const IFT_MYRINET ideal-int +pkg syscall (openbsd-386-cgo), const IFT_NFAS ideal-int +pkg syscall (openbsd-386-cgo), const IFT_NSIP ideal-int +pkg syscall (openbsd-386-cgo), const IFT_OPTICALCHANNEL ideal-int +pkg syscall (openbsd-386-cgo), const IFT_OPTICALTRANSPORT ideal-int +pkg syscall (openbsd-386-cgo), const IFT_OTHER ideal-int +pkg syscall (openbsd-386-cgo), const IFT_P10 ideal-int +pkg syscall (openbsd-386-cgo), const IFT_P80 ideal-int +pkg syscall (openbsd-386-cgo), const IFT_PARA ideal-int +pkg syscall (openbsd-386-cgo), const IFT_PFLOG ideal-int +pkg syscall (openbsd-386-cgo), const IFT_PFLOW ideal-int +pkg syscall (openbsd-386-cgo), const IFT_PFSYNC ideal-int +pkg syscall (openbsd-386-cgo), const IFT_PLC ideal-int +pkg syscall (openbsd-386-cgo), const IFT_PON155 ideal-int +pkg syscall (openbsd-386-cgo), const IFT_PON622 ideal-int +pkg syscall (openbsd-386-cgo), const IFT_POS ideal-int +pkg syscall (openbsd-386-cgo), const IFT_PPP ideal-int +pkg syscall (openbsd-386-cgo), const IFT_PPPMULTILINKBUNDLE ideal-int +pkg syscall (openbsd-386-cgo), const IFT_PROPATM ideal-int +pkg syscall (openbsd-386-cgo), const IFT_PROPBWAP2MP ideal-int +pkg syscall (openbsd-386-cgo), const IFT_PROPCNLS ideal-int +pkg syscall (openbsd-386-cgo), const IFT_PROPDOCSWIRELESSDOWNSTREAM ideal-int +pkg syscall (openbsd-386-cgo), const IFT_PROPDOCSWIRELESSMACLAYER ideal-int +pkg syscall (openbsd-386-cgo), const IFT_PROPDOCSWIRELESSUPSTREAM ideal-int +pkg syscall (openbsd-386-cgo), const IFT_PROPMUX ideal-int +pkg syscall (openbsd-386-cgo), const IFT_PROPVIRTUAL ideal-int +pkg syscall (openbsd-386-cgo), const IFT_PROPWIRELESSP2P ideal-int +pkg syscall (openbsd-386-cgo), const IFT_PTPSERIAL ideal-int +pkg syscall (openbsd-386-cgo), const IFT_PVC ideal-int +pkg syscall (openbsd-386-cgo), const IFT_Q2931 ideal-int +pkg syscall (openbsd-386-cgo), const IFT_QLLC ideal-int +pkg syscall (openbsd-386-cgo), const IFT_RADIOMAC ideal-int +pkg syscall (openbsd-386-cgo), const IFT_RADSL ideal-int +pkg syscall (openbsd-386-cgo), const IFT_REACHDSL ideal-int +pkg syscall (openbsd-386-cgo), const IFT_RFC1483 ideal-int +pkg syscall (openbsd-386-cgo), const IFT_RS232 ideal-int +pkg syscall (openbsd-386-cgo), const IFT_RSRB ideal-int +pkg syscall (openbsd-386-cgo), const IFT_SDLC ideal-int +pkg syscall (openbsd-386-cgo), const IFT_SDSL ideal-int +pkg syscall (openbsd-386-cgo), const IFT_SHDSL ideal-int +pkg syscall (openbsd-386-cgo), const IFT_SIP ideal-int +pkg syscall (openbsd-386-cgo), const IFT_SIPSIG ideal-int +pkg syscall (openbsd-386-cgo), const IFT_SIPTG ideal-int +pkg syscall (openbsd-386-cgo), const IFT_SLIP ideal-int +pkg syscall (openbsd-386-cgo), const IFT_SMDSDXI ideal-int +pkg syscall (openbsd-386-cgo), const IFT_SMDSICIP ideal-int +pkg syscall (openbsd-386-cgo), const IFT_SONET ideal-int +pkg syscall (openbsd-386-cgo), const IFT_SONETOVERHEADCHANNEL ideal-int +pkg syscall (openbsd-386-cgo), const IFT_SONETPATH ideal-int +pkg syscall (openbsd-386-cgo), const IFT_SONETVT ideal-int +pkg syscall (openbsd-386-cgo), const IFT_SRP ideal-int +pkg syscall (openbsd-386-cgo), const IFT_SS7SIGLINK ideal-int +pkg syscall (openbsd-386-cgo), const IFT_STACKTOSTACK ideal-int +pkg syscall (openbsd-386-cgo), const IFT_STARLAN ideal-int +pkg syscall (openbsd-386-cgo), const IFT_T1 ideal-int +pkg syscall (openbsd-386-cgo), const IFT_TDLC ideal-int +pkg syscall (openbsd-386-cgo), const IFT_TELINK ideal-int +pkg syscall (openbsd-386-cgo), const IFT_TERMPAD ideal-int +pkg syscall (openbsd-386-cgo), const IFT_TR008 ideal-int +pkg syscall (openbsd-386-cgo), const IFT_TRANSPHDLC ideal-int +pkg syscall (openbsd-386-cgo), const IFT_TUNNEL ideal-int +pkg syscall (openbsd-386-cgo), const IFT_ULTRA ideal-int +pkg syscall (openbsd-386-cgo), const IFT_USB ideal-int +pkg syscall (openbsd-386-cgo), const IFT_V11 ideal-int +pkg syscall (openbsd-386-cgo), const IFT_V35 ideal-int +pkg syscall (openbsd-386-cgo), const IFT_V36 ideal-int +pkg syscall (openbsd-386-cgo), const IFT_V37 ideal-int +pkg syscall (openbsd-386-cgo), const IFT_VDSL ideal-int +pkg syscall (openbsd-386-cgo), const IFT_VIRTUALIPADDRESS ideal-int +pkg syscall (openbsd-386-cgo), const IFT_VIRTUALTG ideal-int +pkg syscall (openbsd-386-cgo), const IFT_VOICEDID ideal-int +pkg syscall (openbsd-386-cgo), const IFT_VOICEEM ideal-int +pkg syscall (openbsd-386-cgo), const IFT_VOICEEMFGD ideal-int +pkg syscall (openbsd-386-cgo), const IFT_VOICEENCAP ideal-int +pkg syscall (openbsd-386-cgo), const IFT_VOICEFGDEANA ideal-int +pkg syscall (openbsd-386-cgo), const IFT_VOICEFXO ideal-int +pkg syscall (openbsd-386-cgo), const IFT_VOICEFXS ideal-int +pkg syscall (openbsd-386-cgo), const IFT_VOICEOVERATM ideal-int +pkg syscall (openbsd-386-cgo), const IFT_VOICEOVERCABLE ideal-int +pkg syscall (openbsd-386-cgo), const IFT_VOICEOVERFRAMERELAY ideal-int +pkg syscall (openbsd-386-cgo), const IFT_VOICEOVERIP ideal-int +pkg syscall (openbsd-386-cgo), const IFT_X213 ideal-int +pkg syscall (openbsd-386-cgo), const IFT_X25 ideal-int +pkg syscall (openbsd-386-cgo), const IFT_X25DDN ideal-int +pkg syscall (openbsd-386-cgo), const IFT_X25HUNTGROUP ideal-int +pkg syscall (openbsd-386-cgo), const IFT_X25MLP ideal-int +pkg syscall (openbsd-386-cgo), const IFT_X25PLE ideal-int +pkg syscall (openbsd-386-cgo), const IFT_XETHER ideal-int +pkg syscall (openbsd-386-cgo), const IGNBRK ideal-int +pkg syscall (openbsd-386-cgo), const IGNCR ideal-int +pkg syscall (openbsd-386-cgo), const IGNPAR ideal-int +pkg syscall (openbsd-386-cgo), const IMAXBEL ideal-int +pkg syscall (openbsd-386-cgo), const INLCR ideal-int +pkg syscall (openbsd-386-cgo), const INPCK ideal-int +pkg syscall (openbsd-386-cgo), const IN_CLASSA_HOST ideal-int +pkg syscall (openbsd-386-cgo), const IN_CLASSA_MAX ideal-int +pkg syscall (openbsd-386-cgo), const IN_CLASSA_NET ideal-int +pkg syscall (openbsd-386-cgo), const IN_CLASSA_NSHIFT ideal-int +pkg syscall (openbsd-386-cgo), const IN_CLASSB_HOST ideal-int +pkg syscall (openbsd-386-cgo), const IN_CLASSB_MAX ideal-int +pkg syscall (openbsd-386-cgo), const IN_CLASSB_NET ideal-int +pkg syscall (openbsd-386-cgo), const IN_CLASSB_NSHIFT ideal-int +pkg syscall (openbsd-386-cgo), const IN_CLASSC_HOST ideal-int +pkg syscall (openbsd-386-cgo), const IN_CLASSC_NET ideal-int +pkg syscall (openbsd-386-cgo), const IN_CLASSC_NSHIFT ideal-int +pkg syscall (openbsd-386-cgo), const IN_CLASSD_HOST ideal-int +pkg syscall (openbsd-386-cgo), const IN_CLASSD_NET ideal-int +pkg syscall (openbsd-386-cgo), const IN_CLASSD_NSHIFT ideal-int +pkg syscall (openbsd-386-cgo), const IN_LOOPBACKNET ideal-int +pkg syscall (openbsd-386-cgo), const IN_RFC3021_HOST ideal-int +pkg syscall (openbsd-386-cgo), const IN_RFC3021_NET ideal-int +pkg syscall (openbsd-386-cgo), const IN_RFC3021_NSHIFT ideal-int +pkg syscall (openbsd-386-cgo), const IPPROTO_AH ideal-int +pkg syscall (openbsd-386-cgo), const IPPROTO_CARP ideal-int +pkg syscall (openbsd-386-cgo), const IPPROTO_DIVERT ideal-int +pkg syscall (openbsd-386-cgo), const IPPROTO_DONE ideal-int +pkg syscall (openbsd-386-cgo), const IPPROTO_DSTOPTS ideal-int +pkg syscall (openbsd-386-cgo), const IPPROTO_EGP ideal-int +pkg syscall (openbsd-386-cgo), const IPPROTO_ENCAP ideal-int +pkg syscall (openbsd-386-cgo), const IPPROTO_EON ideal-int +pkg syscall (openbsd-386-cgo), const IPPROTO_ESP ideal-int +pkg syscall (openbsd-386-cgo), const IPPROTO_ETHERIP ideal-int +pkg syscall (openbsd-386-cgo), const IPPROTO_FRAGMENT ideal-int +pkg syscall (openbsd-386-cgo), const IPPROTO_GGP ideal-int +pkg syscall (openbsd-386-cgo), const IPPROTO_GRE ideal-int +pkg syscall (openbsd-386-cgo), const IPPROTO_HOPOPTS ideal-int +pkg syscall (openbsd-386-cgo), const IPPROTO_ICMP ideal-int +pkg syscall (openbsd-386-cgo), const IPPROTO_ICMPV6 ideal-int +pkg syscall (openbsd-386-cgo), const IPPROTO_IDP ideal-int +pkg syscall (openbsd-386-cgo), const IPPROTO_IGMP ideal-int +pkg syscall (openbsd-386-cgo), const IPPROTO_IPCOMP ideal-int +pkg syscall (openbsd-386-cgo), const IPPROTO_IPIP ideal-int +pkg syscall (openbsd-386-cgo), const IPPROTO_IPV4 ideal-int +pkg syscall (openbsd-386-cgo), const IPPROTO_MAX ideal-int +pkg syscall (openbsd-386-cgo), const IPPROTO_MAXID ideal-int +pkg syscall (openbsd-386-cgo), const IPPROTO_MOBILE ideal-int +pkg syscall (openbsd-386-cgo), const IPPROTO_MPLS ideal-int +pkg syscall (openbsd-386-cgo), const IPPROTO_NONE ideal-int +pkg syscall (openbsd-386-cgo), const IPPROTO_PFSYNC ideal-int +pkg syscall (openbsd-386-cgo), const IPPROTO_PIM ideal-int +pkg syscall (openbsd-386-cgo), const IPPROTO_PUP ideal-int +pkg syscall (openbsd-386-cgo), const IPPROTO_RAW ideal-int +pkg syscall (openbsd-386-cgo), const IPPROTO_ROUTING ideal-int +pkg syscall (openbsd-386-cgo), const IPPROTO_RSVP ideal-int +pkg syscall (openbsd-386-cgo), const IPPROTO_TP ideal-int +pkg syscall (openbsd-386-cgo), const IPV6_AUTH_LEVEL ideal-int +pkg syscall (openbsd-386-cgo), const IPV6_AUTOFLOWLABEL ideal-int +pkg syscall (openbsd-386-cgo), const IPV6_CHECKSUM ideal-int +pkg syscall (openbsd-386-cgo), const IPV6_DEFAULT_MULTICAST_HOPS ideal-int +pkg syscall (openbsd-386-cgo), const IPV6_DEFAULT_MULTICAST_LOOP ideal-int +pkg syscall (openbsd-386-cgo), const IPV6_DEFHLIM ideal-int +pkg syscall (openbsd-386-cgo), const IPV6_DONTFRAG ideal-int +pkg syscall (openbsd-386-cgo), const IPV6_DSTOPTS ideal-int +pkg syscall (openbsd-386-cgo), const IPV6_ESP_NETWORK_LEVEL ideal-int +pkg syscall (openbsd-386-cgo), const IPV6_ESP_TRANS_LEVEL ideal-int +pkg syscall (openbsd-386-cgo), const IPV6_FAITH ideal-int +pkg syscall (openbsd-386-cgo), const IPV6_FLOWINFO_MASK ideal-int +pkg syscall (openbsd-386-cgo), const IPV6_FLOWLABEL_MASK ideal-int +pkg syscall (openbsd-386-cgo), const IPV6_FRAGTTL ideal-int +pkg syscall (openbsd-386-cgo), const IPV6_HLIMDEC ideal-int +pkg syscall (openbsd-386-cgo), const IPV6_HOPLIMIT ideal-int +pkg syscall (openbsd-386-cgo), const IPV6_HOPOPTS ideal-int +pkg syscall (openbsd-386-cgo), const IPV6_IPCOMP_LEVEL ideal-int +pkg syscall (openbsd-386-cgo), const IPV6_MAXHLIM ideal-int +pkg syscall (openbsd-386-cgo), const IPV6_MAXPACKET ideal-int +pkg syscall (openbsd-386-cgo), const IPV6_MMTU ideal-int +pkg syscall (openbsd-386-cgo), const IPV6_NEXTHOP ideal-int +pkg syscall (openbsd-386-cgo), const IPV6_OPTIONS ideal-int +pkg syscall (openbsd-386-cgo), const IPV6_PATHMTU ideal-int +pkg syscall (openbsd-386-cgo), const IPV6_PIPEX ideal-int +pkg syscall (openbsd-386-cgo), const IPV6_PKTINFO ideal-int +pkg syscall (openbsd-386-cgo), const IPV6_PORTRANGE ideal-int +pkg syscall (openbsd-386-cgo), const IPV6_PORTRANGE_DEFAULT ideal-int +pkg syscall (openbsd-386-cgo), const IPV6_PORTRANGE_HIGH ideal-int +pkg syscall (openbsd-386-cgo), const IPV6_PORTRANGE_LOW ideal-int +pkg syscall (openbsd-386-cgo), const IPV6_RECVDSTOPTS ideal-int +pkg syscall (openbsd-386-cgo), const IPV6_RECVHOPLIMIT ideal-int +pkg syscall (openbsd-386-cgo), const IPV6_RECVHOPOPTS ideal-int +pkg syscall (openbsd-386-cgo), const IPV6_RECVPATHMTU ideal-int +pkg syscall (openbsd-386-cgo), const IPV6_RECVPKTINFO ideal-int +pkg syscall (openbsd-386-cgo), const IPV6_RECVRTHDR ideal-int +pkg syscall (openbsd-386-cgo), const IPV6_RECVTCLASS ideal-int +pkg syscall (openbsd-386-cgo), const IPV6_RTABLE ideal-int +pkg syscall (openbsd-386-cgo), const IPV6_RTHDR ideal-int +pkg syscall (openbsd-386-cgo), const IPV6_RTHDRDSTOPTS ideal-int +pkg syscall (openbsd-386-cgo), const IPV6_RTHDR_LOOSE ideal-int +pkg syscall (openbsd-386-cgo), const IPV6_RTHDR_STRICT ideal-int +pkg syscall (openbsd-386-cgo), const IPV6_RTHDR_TYPE_0 ideal-int +pkg syscall (openbsd-386-cgo), const IPV6_SOCKOPT_RESERVED1 ideal-int +pkg syscall (openbsd-386-cgo), const IPV6_TCLASS ideal-int +pkg syscall (openbsd-386-cgo), const IPV6_USE_MIN_MTU ideal-int +pkg syscall (openbsd-386-cgo), const IPV6_VERSION ideal-int +pkg syscall (openbsd-386-cgo), const IPV6_VERSION_MASK ideal-int +pkg syscall (openbsd-386-cgo), const IP_AUTH_LEVEL ideal-int +pkg syscall (openbsd-386-cgo), const IP_DEFAULT_MULTICAST_LOOP ideal-int +pkg syscall (openbsd-386-cgo), const IP_DEFAULT_MULTICAST_TTL ideal-int +pkg syscall (openbsd-386-cgo), const IP_DF ideal-int +pkg syscall (openbsd-386-cgo), const IP_ESP_NETWORK_LEVEL ideal-int +pkg syscall (openbsd-386-cgo), const IP_ESP_TRANS_LEVEL ideal-int +pkg syscall (openbsd-386-cgo), const IP_HDRINCL ideal-int +pkg syscall (openbsd-386-cgo), const IP_IPCOMP_LEVEL ideal-int +pkg syscall (openbsd-386-cgo), const IP_IPSECFLOWINFO ideal-int +pkg syscall (openbsd-386-cgo), const IP_IPSEC_LOCAL_AUTH ideal-int +pkg syscall (openbsd-386-cgo), const IP_IPSEC_LOCAL_CRED ideal-int +pkg syscall (openbsd-386-cgo), const IP_IPSEC_LOCAL_ID ideal-int +pkg syscall (openbsd-386-cgo), const IP_IPSEC_REMOTE_AUTH ideal-int +pkg syscall (openbsd-386-cgo), const IP_IPSEC_REMOTE_CRED ideal-int +pkg syscall (openbsd-386-cgo), const IP_IPSEC_REMOTE_ID ideal-int +pkg syscall (openbsd-386-cgo), const IP_MAXPACKET ideal-int +pkg syscall (openbsd-386-cgo), const IP_MAX_MEMBERSHIPS ideal-int +pkg syscall (openbsd-386-cgo), const IP_MF ideal-int +pkg syscall (openbsd-386-cgo), const IP_MINTTL ideal-int +pkg syscall (openbsd-386-cgo), const IP_MIN_MEMBERSHIPS ideal-int +pkg syscall (openbsd-386-cgo), const IP_MSS ideal-int +pkg syscall (openbsd-386-cgo), const IP_OFFMASK ideal-int +pkg syscall (openbsd-386-cgo), const IP_OPTIONS ideal-int +pkg syscall (openbsd-386-cgo), const IP_PIPEX ideal-int +pkg syscall (openbsd-386-cgo), const IP_PORTRANGE ideal-int +pkg syscall (openbsd-386-cgo), const IP_PORTRANGE_DEFAULT ideal-int +pkg syscall (openbsd-386-cgo), const IP_PORTRANGE_HIGH ideal-int +pkg syscall (openbsd-386-cgo), const IP_PORTRANGE_LOW ideal-int +pkg syscall (openbsd-386-cgo), const IP_RECVDSTADDR ideal-int +pkg syscall (openbsd-386-cgo), const IP_RECVDSTPORT ideal-int +pkg syscall (openbsd-386-cgo), const IP_RECVIF ideal-int +pkg syscall (openbsd-386-cgo), const IP_RECVOPTS ideal-int +pkg syscall (openbsd-386-cgo), const IP_RECVRETOPTS ideal-int +pkg syscall (openbsd-386-cgo), const IP_RECVRTABLE ideal-int +pkg syscall (openbsd-386-cgo), const IP_RECVTTL ideal-int +pkg syscall (openbsd-386-cgo), const IP_RETOPTS ideal-int +pkg syscall (openbsd-386-cgo), const IP_RF ideal-int +pkg syscall (openbsd-386-cgo), const IP_RTABLE ideal-int +pkg syscall (openbsd-386-cgo), const ISIG ideal-int +pkg syscall (openbsd-386-cgo), const ISTRIP ideal-int +pkg syscall (openbsd-386-cgo), const IXANY ideal-int +pkg syscall (openbsd-386-cgo), const IXOFF ideal-int +pkg syscall (openbsd-386-cgo), const IXON ideal-int +pkg syscall (openbsd-386-cgo), const LCNT_OVERLOAD_FLUSH ideal-int +pkg syscall (openbsd-386-cgo), const LOCK_EX ideal-int +pkg syscall (openbsd-386-cgo), const LOCK_NB ideal-int +pkg syscall (openbsd-386-cgo), const LOCK_SH ideal-int +pkg syscall (openbsd-386-cgo), const LOCK_UN ideal-int +pkg syscall (openbsd-386-cgo), const MSG_BCAST ideal-int +pkg syscall (openbsd-386-cgo), const MSG_CTRUNC ideal-int +pkg syscall (openbsd-386-cgo), const MSG_DONTROUTE ideal-int +pkg syscall (openbsd-386-cgo), const MSG_DONTWAIT ideal-int +pkg syscall (openbsd-386-cgo), const MSG_EOR ideal-int +pkg syscall (openbsd-386-cgo), const MSG_MCAST ideal-int +pkg syscall (openbsd-386-cgo), const MSG_NOSIGNAL ideal-int +pkg syscall (openbsd-386-cgo), const MSG_OOB ideal-int +pkg syscall (openbsd-386-cgo), const MSG_PEEK ideal-int +pkg syscall (openbsd-386-cgo), const MSG_TRUNC ideal-int +pkg syscall (openbsd-386-cgo), const MSG_WAITALL ideal-int +pkg syscall (openbsd-386-cgo), const NAME_MAX ideal-int +pkg syscall (openbsd-386-cgo), const NET_RT_DUMP ideal-int +pkg syscall (openbsd-386-cgo), const NET_RT_FLAGS ideal-int +pkg syscall (openbsd-386-cgo), const NET_RT_IFLIST ideal-int +pkg syscall (openbsd-386-cgo), const NET_RT_MAXID ideal-int +pkg syscall (openbsd-386-cgo), const NET_RT_STATS ideal-int +pkg syscall (openbsd-386-cgo), const NET_RT_TABLE ideal-int +pkg syscall (openbsd-386-cgo), const NOFLSH ideal-int +pkg syscall (openbsd-386-cgo), const NOTE_ATTRIB ideal-int +pkg syscall (openbsd-386-cgo), const NOTE_CHILD ideal-int +pkg syscall (openbsd-386-cgo), const NOTE_DELETE ideal-int +pkg syscall (openbsd-386-cgo), const NOTE_EOF ideal-int +pkg syscall (openbsd-386-cgo), const NOTE_EXEC ideal-int +pkg syscall (openbsd-386-cgo), const NOTE_EXIT ideal-int +pkg syscall (openbsd-386-cgo), const NOTE_EXTEND ideal-int +pkg syscall (openbsd-386-cgo), const NOTE_FORK ideal-int +pkg syscall (openbsd-386-cgo), const NOTE_LINK ideal-int +pkg syscall (openbsd-386-cgo), const NOTE_LOWAT ideal-int +pkg syscall (openbsd-386-cgo), const NOTE_PCTRLMASK ideal-int +pkg syscall (openbsd-386-cgo), const NOTE_PDATAMASK ideal-int +pkg syscall (openbsd-386-cgo), const NOTE_RENAME ideal-int +pkg syscall (openbsd-386-cgo), const NOTE_REVOKE ideal-int +pkg syscall (openbsd-386-cgo), const NOTE_TRACK ideal-int +pkg syscall (openbsd-386-cgo), const NOTE_TRACKERR ideal-int +pkg syscall (openbsd-386-cgo), const NOTE_TRUNCATE ideal-int +pkg syscall (openbsd-386-cgo), const NOTE_WRITE ideal-int +pkg syscall (openbsd-386-cgo), const OCRNL ideal-int +pkg syscall (openbsd-386-cgo), const ONLCR ideal-int +pkg syscall (openbsd-386-cgo), const ONLRET ideal-int +pkg syscall (openbsd-386-cgo), const ONOCR ideal-int +pkg syscall (openbsd-386-cgo), const ONOEOT ideal-int +pkg syscall (openbsd-386-cgo), const OPOST ideal-int +pkg syscall (openbsd-386-cgo), const O_ACCMODE ideal-int +pkg syscall (openbsd-386-cgo), const O_DIRECTORY ideal-int +pkg syscall (openbsd-386-cgo), const O_DSYNC ideal-int +pkg syscall (openbsd-386-cgo), const O_EXLOCK ideal-int +pkg syscall (openbsd-386-cgo), const O_FSYNC ideal-int +pkg syscall (openbsd-386-cgo), const O_NDELAY ideal-int +pkg syscall (openbsd-386-cgo), const O_NOFOLLOW ideal-int +pkg syscall (openbsd-386-cgo), const O_RSYNC ideal-int +pkg syscall (openbsd-386-cgo), const O_SHLOCK ideal-int +pkg syscall (openbsd-386-cgo), const PARENB ideal-int +pkg syscall (openbsd-386-cgo), const PARMRK ideal-int +pkg syscall (openbsd-386-cgo), const PARODD ideal-int +pkg syscall (openbsd-386-cgo), const PENDIN ideal-int +pkg syscall (openbsd-386-cgo), const PF_FLUSH ideal-int +pkg syscall (openbsd-386-cgo), const PRIO_PGRP = 1 +pkg syscall (openbsd-386-cgo), const PRIO_PGRP ideal-int +pkg syscall (openbsd-386-cgo), const PRIO_PROCESS = 0 +pkg syscall (openbsd-386-cgo), const PRIO_PROCESS ideal-int +pkg syscall (openbsd-386-cgo), const PRIO_USER = 2 +pkg syscall (openbsd-386-cgo), const PRIO_USER ideal-int +pkg syscall (openbsd-386-cgo), const PTRACE_CONT ideal-int +pkg syscall (openbsd-386-cgo), const PTRACE_KILL ideal-int +pkg syscall (openbsd-386-cgo), const PTRACE_TRACEME ideal-int +pkg syscall (openbsd-386-cgo), const PT_MASK ideal-int +pkg syscall (openbsd-386-cgo), const RLIMIT_CORE ideal-int +pkg syscall (openbsd-386-cgo), const RLIMIT_CPU ideal-int +pkg syscall (openbsd-386-cgo), const RLIMIT_DATA ideal-int +pkg syscall (openbsd-386-cgo), const RLIMIT_FSIZE ideal-int +pkg syscall (openbsd-386-cgo), const RLIMIT_NOFILE ideal-int +pkg syscall (openbsd-386-cgo), const RLIMIT_STACK ideal-int +pkg syscall (openbsd-386-cgo), const RLIM_INFINITY ideal-int +pkg syscall (openbsd-386-cgo), const RTAX_AUTHOR ideal-int +pkg syscall (openbsd-386-cgo), const RTAX_BRD ideal-int +pkg syscall (openbsd-386-cgo), const RTAX_DST ideal-int +pkg syscall (openbsd-386-cgo), const RTAX_GATEWAY ideal-int +pkg syscall (openbsd-386-cgo), const RTAX_GENMASK ideal-int +pkg syscall (openbsd-386-cgo), const RTAX_IFA ideal-int +pkg syscall (openbsd-386-cgo), const RTAX_IFP ideal-int +pkg syscall (openbsd-386-cgo), const RTAX_LABEL ideal-int +pkg syscall (openbsd-386-cgo), const RTAX_MAX ideal-int +pkg syscall (openbsd-386-cgo), const RTAX_NETMASK ideal-int +pkg syscall (openbsd-386-cgo), const RTAX_SRC ideal-int +pkg syscall (openbsd-386-cgo), const RTAX_SRCMASK ideal-int +pkg syscall (openbsd-386-cgo), const RTA_AUTHOR ideal-int +pkg syscall (openbsd-386-cgo), const RTA_BRD ideal-int +pkg syscall (openbsd-386-cgo), const RTA_DST ideal-int +pkg syscall (openbsd-386-cgo), const RTA_GATEWAY ideal-int +pkg syscall (openbsd-386-cgo), const RTA_GENMASK ideal-int +pkg syscall (openbsd-386-cgo), const RTA_IFA ideal-int +pkg syscall (openbsd-386-cgo), const RTA_IFP ideal-int +pkg syscall (openbsd-386-cgo), const RTA_LABEL ideal-int +pkg syscall (openbsd-386-cgo), const RTA_NETMASK ideal-int +pkg syscall (openbsd-386-cgo), const RTA_SRC ideal-int +pkg syscall (openbsd-386-cgo), const RTA_SRCMASK ideal-int +pkg syscall (openbsd-386-cgo), const RTF_ANNOUNCE ideal-int +pkg syscall (openbsd-386-cgo), const RTF_BLACKHOLE ideal-int +pkg syscall (openbsd-386-cgo), const RTF_CLONED ideal-int +pkg syscall (openbsd-386-cgo), const RTF_CLONING ideal-int +pkg syscall (openbsd-386-cgo), const RTF_DONE ideal-int +pkg syscall (openbsd-386-cgo), const RTF_DYNAMIC ideal-int +pkg syscall (openbsd-386-cgo), const RTF_FMASK ideal-int +pkg syscall (openbsd-386-cgo), const RTF_GATEWAY ideal-int +pkg syscall (openbsd-386-cgo), const RTF_HOST ideal-int +pkg syscall (openbsd-386-cgo), const RTF_LLINFO ideal-int +pkg syscall (openbsd-386-cgo), const RTF_MASK ideal-int +pkg syscall (openbsd-386-cgo), const RTF_MODIFIED ideal-int +pkg syscall (openbsd-386-cgo), const RTF_MPATH ideal-int +pkg syscall (openbsd-386-cgo), const RTF_MPLS ideal-int +pkg syscall (openbsd-386-cgo), const RTF_PERMANENT_ARP ideal-int +pkg syscall (openbsd-386-cgo), const RTF_PROTO1 ideal-int +pkg syscall (openbsd-386-cgo), const RTF_PROTO2 ideal-int +pkg syscall (openbsd-386-cgo), const RTF_PROTO3 ideal-int +pkg syscall (openbsd-386-cgo), const RTF_REJECT ideal-int +pkg syscall (openbsd-386-cgo), const RTF_SOURCE ideal-int +pkg syscall (openbsd-386-cgo), const RTF_STATIC ideal-int +pkg syscall (openbsd-386-cgo), const RTF_TUNNEL ideal-int +pkg syscall (openbsd-386-cgo), const RTF_UP ideal-int +pkg syscall (openbsd-386-cgo), const RTF_USETRAILERS ideal-int +pkg syscall (openbsd-386-cgo), const RTF_XRESOLVE ideal-int +pkg syscall (openbsd-386-cgo), const RTM_ADD ideal-int +pkg syscall (openbsd-386-cgo), const RTM_CHANGE ideal-int +pkg syscall (openbsd-386-cgo), const RTM_DELADDR ideal-int +pkg syscall (openbsd-386-cgo), const RTM_DELETE ideal-int +pkg syscall (openbsd-386-cgo), const RTM_DESYNC ideal-int +pkg syscall (openbsd-386-cgo), const RTM_GET ideal-int +pkg syscall (openbsd-386-cgo), const RTM_IFANNOUNCE ideal-int +pkg syscall (openbsd-386-cgo), const RTM_IFINFO ideal-int +pkg syscall (openbsd-386-cgo), const RTM_LOCK ideal-int +pkg syscall (openbsd-386-cgo), const RTM_LOSING ideal-int +pkg syscall (openbsd-386-cgo), const RTM_MAXSIZE ideal-int +pkg syscall (openbsd-386-cgo), const RTM_MISS ideal-int +pkg syscall (openbsd-386-cgo), const RTM_NEWADDR ideal-int +pkg syscall (openbsd-386-cgo), const RTM_REDIRECT ideal-int +pkg syscall (openbsd-386-cgo), const RTM_RESOLVE ideal-int +pkg syscall (openbsd-386-cgo), const RTM_RTTUNIT ideal-int +pkg syscall (openbsd-386-cgo), const RTM_VERSION ideal-int +pkg syscall (openbsd-386-cgo), const RTV_EXPIRE ideal-int +pkg syscall (openbsd-386-cgo), const RTV_HOPCOUNT ideal-int +pkg syscall (openbsd-386-cgo), const RTV_MTU ideal-int +pkg syscall (openbsd-386-cgo), const RTV_RPIPE ideal-int +pkg syscall (openbsd-386-cgo), const RTV_RTT ideal-int +pkg syscall (openbsd-386-cgo), const RTV_RTTVAR ideal-int +pkg syscall (openbsd-386-cgo), const RTV_SPIPE ideal-int +pkg syscall (openbsd-386-cgo), const RTV_SSTHRESH ideal-int +pkg syscall (openbsd-386-cgo), const RT_TABLEID_MAX ideal-int +pkg syscall (openbsd-386-cgo), const RUSAGE_CHILDREN ideal-int +pkg syscall (openbsd-386-cgo), const RUSAGE_SELF ideal-int +pkg syscall (openbsd-386-cgo), const RUSAGE_THREAD ideal-int +pkg syscall (openbsd-386-cgo), const SCM_RIGHTS ideal-int +pkg syscall (openbsd-386-cgo), const SCM_TIMESTAMP ideal-int +pkg syscall (openbsd-386-cgo), const SIGCHLD Signal +pkg syscall (openbsd-386-cgo), const SIGCONT Signal +pkg syscall (openbsd-386-cgo), const SIGEMT Signal +pkg syscall (openbsd-386-cgo), const SIGINFO Signal +pkg syscall (openbsd-386-cgo), const SIGIO Signal +pkg syscall (openbsd-386-cgo), const SIGIOT Signal +pkg syscall (openbsd-386-cgo), const SIGPROF Signal +pkg syscall (openbsd-386-cgo), const SIGSTOP Signal +pkg syscall (openbsd-386-cgo), const SIGSYS Signal +pkg syscall (openbsd-386-cgo), const SIGTHR Signal +pkg syscall (openbsd-386-cgo), const SIGTSTP Signal +pkg syscall (openbsd-386-cgo), const SIGTTIN Signal +pkg syscall (openbsd-386-cgo), const SIGTTOU Signal +pkg syscall (openbsd-386-cgo), const SIGURG Signal +pkg syscall (openbsd-386-cgo), const SIGUSR1 Signal +pkg syscall (openbsd-386-cgo), const SIGUSR2 Signal +pkg syscall (openbsd-386-cgo), const SIGVTALRM Signal +pkg syscall (openbsd-386-cgo), const SIGWINCH Signal +pkg syscall (openbsd-386-cgo), const SIGXCPU Signal +pkg syscall (openbsd-386-cgo), const SIGXFSZ Signal +pkg syscall (openbsd-386-cgo), const SIOCADDMULTI ideal-int +pkg syscall (openbsd-386-cgo), const SIOCAIFADDR ideal-int +pkg syscall (openbsd-386-cgo), const SIOCAIFGROUP ideal-int +pkg syscall (openbsd-386-cgo), const SIOCALIFADDR ideal-int +pkg syscall (openbsd-386-cgo), const SIOCATMARK ideal-int +pkg syscall (openbsd-386-cgo), const SIOCBRDGADD ideal-int +pkg syscall (openbsd-386-cgo), const SIOCBRDGADDS ideal-int +pkg syscall (openbsd-386-cgo), const SIOCBRDGARL ideal-int +pkg syscall (openbsd-386-cgo), const SIOCBRDGDADDR ideal-int +pkg syscall (openbsd-386-cgo), const SIOCBRDGDEL ideal-int +pkg syscall (openbsd-386-cgo), const SIOCBRDGDELS ideal-int +pkg syscall (openbsd-386-cgo), const SIOCBRDGFLUSH ideal-int +pkg syscall (openbsd-386-cgo), const SIOCBRDGFRL ideal-int +pkg syscall (openbsd-386-cgo), const SIOCBRDGGCACHE ideal-int +pkg syscall (openbsd-386-cgo), const SIOCBRDGGFD ideal-int +pkg syscall (openbsd-386-cgo), const SIOCBRDGGHT ideal-int +pkg syscall (openbsd-386-cgo), const SIOCBRDGGIFFLGS ideal-int +pkg syscall (openbsd-386-cgo), const SIOCBRDGGMA ideal-int +pkg syscall (openbsd-386-cgo), const SIOCBRDGGPARAM ideal-int +pkg syscall (openbsd-386-cgo), const SIOCBRDGGPRI ideal-int +pkg syscall (openbsd-386-cgo), const SIOCBRDGGRL ideal-int +pkg syscall (openbsd-386-cgo), const SIOCBRDGGSIFS ideal-int +pkg syscall (openbsd-386-cgo), const SIOCBRDGGTO ideal-int +pkg syscall (openbsd-386-cgo), const SIOCBRDGIFS ideal-int +pkg syscall (openbsd-386-cgo), const SIOCBRDGRTS ideal-int +pkg syscall (openbsd-386-cgo), const SIOCBRDGSADDR ideal-int +pkg syscall (openbsd-386-cgo), const SIOCBRDGSCACHE ideal-int +pkg syscall (openbsd-386-cgo), const SIOCBRDGSFD ideal-int +pkg syscall (openbsd-386-cgo), const SIOCBRDGSHT ideal-int +pkg syscall (openbsd-386-cgo), const SIOCBRDGSIFCOST ideal-int +pkg syscall (openbsd-386-cgo), const SIOCBRDGSIFFLGS ideal-int +pkg syscall (openbsd-386-cgo), const SIOCBRDGSIFPRIO ideal-int +pkg syscall (openbsd-386-cgo), const SIOCBRDGSMA ideal-int +pkg syscall (openbsd-386-cgo), const SIOCBRDGSPRI ideal-int +pkg syscall (openbsd-386-cgo), const SIOCBRDGSPROTO ideal-int +pkg syscall (openbsd-386-cgo), const SIOCBRDGSTO ideal-int +pkg syscall (openbsd-386-cgo), const SIOCBRDGSTXHC ideal-int +pkg syscall (openbsd-386-cgo), const SIOCDELMULTI ideal-int +pkg syscall (openbsd-386-cgo), const SIOCDIFADDR ideal-int +pkg syscall (openbsd-386-cgo), const SIOCDIFGROUP ideal-int +pkg syscall (openbsd-386-cgo), const SIOCDIFPHYADDR ideal-int +pkg syscall (openbsd-386-cgo), const SIOCDLIFADDR ideal-int +pkg syscall (openbsd-386-cgo), const SIOCGETKALIVE ideal-int +pkg syscall (openbsd-386-cgo), const SIOCGETLABEL ideal-int +pkg syscall (openbsd-386-cgo), const SIOCGETPFLOW ideal-int +pkg syscall (openbsd-386-cgo), const SIOCGETPFSYNC ideal-int +pkg syscall (openbsd-386-cgo), const SIOCGETSGCNT ideal-int +pkg syscall (openbsd-386-cgo), const SIOCGETVIFCNT ideal-int +pkg syscall (openbsd-386-cgo), const SIOCGHIWAT ideal-int +pkg syscall (openbsd-386-cgo), const SIOCGIFADDR ideal-int +pkg syscall (openbsd-386-cgo), const SIOCGIFASYNCMAP ideal-int +pkg syscall (openbsd-386-cgo), const SIOCGIFBRDADDR ideal-int +pkg syscall (openbsd-386-cgo), const SIOCGIFCONF ideal-int +pkg syscall (openbsd-386-cgo), const SIOCGIFDATA ideal-int +pkg syscall (openbsd-386-cgo), const SIOCGIFDESCR ideal-int +pkg syscall (openbsd-386-cgo), const SIOCGIFDSTADDR ideal-int +pkg syscall (openbsd-386-cgo), const SIOCGIFFLAGS ideal-int +pkg syscall (openbsd-386-cgo), const SIOCGIFGATTR ideal-int +pkg syscall (openbsd-386-cgo), const SIOCGIFGENERIC ideal-int +pkg syscall (openbsd-386-cgo), const SIOCGIFGMEMB ideal-int +pkg syscall (openbsd-386-cgo), const SIOCGIFGROUP ideal-int +pkg syscall (openbsd-386-cgo), const SIOCGIFMEDIA ideal-int +pkg syscall (openbsd-386-cgo), const SIOCGIFMETRIC ideal-int +pkg syscall (openbsd-386-cgo), const SIOCGIFMTU ideal-int +pkg syscall (openbsd-386-cgo), const SIOCGIFNETMASK ideal-int +pkg syscall (openbsd-386-cgo), const SIOCGIFPDSTADDR ideal-int +pkg syscall (openbsd-386-cgo), const SIOCGIFPRIORITY ideal-int +pkg syscall (openbsd-386-cgo), const SIOCGIFPSRCADDR ideal-int +pkg syscall (openbsd-386-cgo), const SIOCGIFRDOMAIN ideal-int +pkg syscall (openbsd-386-cgo), const SIOCGIFRTLABEL ideal-int +pkg syscall (openbsd-386-cgo), const SIOCGIFTIMESLOT ideal-int +pkg syscall (openbsd-386-cgo), const SIOCGIFXFLAGS ideal-int +pkg syscall (openbsd-386-cgo), const SIOCGLIFADDR ideal-int +pkg syscall (openbsd-386-cgo), const SIOCGLIFPHYADDR ideal-int +pkg syscall (openbsd-386-cgo), const SIOCGLIFPHYRTABLE ideal-int +pkg syscall (openbsd-386-cgo), const SIOCGLOWAT ideal-int +pkg syscall (openbsd-386-cgo), const SIOCGPGRP ideal-int +pkg syscall (openbsd-386-cgo), const SIOCGVH ideal-int +pkg syscall (openbsd-386-cgo), const SIOCIFCREATE ideal-int +pkg syscall (openbsd-386-cgo), const SIOCIFDESTROY ideal-int +pkg syscall (openbsd-386-cgo), const SIOCIFGCLONERS ideal-int +pkg syscall (openbsd-386-cgo), const SIOCSETKALIVE ideal-int +pkg syscall (openbsd-386-cgo), const SIOCSETLABEL ideal-int +pkg syscall (openbsd-386-cgo), const SIOCSETPFLOW ideal-int +pkg syscall (openbsd-386-cgo), const SIOCSETPFSYNC ideal-int +pkg syscall (openbsd-386-cgo), const SIOCSHIWAT ideal-int +pkg syscall (openbsd-386-cgo), const SIOCSIFADDR ideal-int +pkg syscall (openbsd-386-cgo), const SIOCSIFASYNCMAP ideal-int +pkg syscall (openbsd-386-cgo), const SIOCSIFBRDADDR ideal-int +pkg syscall (openbsd-386-cgo), const SIOCSIFDESCR ideal-int +pkg syscall (openbsd-386-cgo), const SIOCSIFDSTADDR ideal-int +pkg syscall (openbsd-386-cgo), const SIOCSIFFLAGS ideal-int +pkg syscall (openbsd-386-cgo), const SIOCSIFGATTR ideal-int +pkg syscall (openbsd-386-cgo), const SIOCSIFGENERIC ideal-int +pkg syscall (openbsd-386-cgo), const SIOCSIFLLADDR ideal-int +pkg syscall (openbsd-386-cgo), const SIOCSIFMEDIA ideal-int +pkg syscall (openbsd-386-cgo), const SIOCSIFMETRIC ideal-int +pkg syscall (openbsd-386-cgo), const SIOCSIFMTU ideal-int +pkg syscall (openbsd-386-cgo), const SIOCSIFNETMASK ideal-int +pkg syscall (openbsd-386-cgo), const SIOCSIFPHYADDR ideal-int +pkg syscall (openbsd-386-cgo), const SIOCSIFPRIORITY ideal-int +pkg syscall (openbsd-386-cgo), const SIOCSIFRDOMAIN ideal-int +pkg syscall (openbsd-386-cgo), const SIOCSIFRTLABEL ideal-int +pkg syscall (openbsd-386-cgo), const SIOCSIFTIMESLOT ideal-int +pkg syscall (openbsd-386-cgo), const SIOCSIFXFLAGS ideal-int +pkg syscall (openbsd-386-cgo), const SIOCSLIFPHYADDR ideal-int +pkg syscall (openbsd-386-cgo), const SIOCSLIFPHYRTABLE ideal-int +pkg syscall (openbsd-386-cgo), const SIOCSLOWAT ideal-int +pkg syscall (openbsd-386-cgo), const SIOCSPGRP ideal-int +pkg syscall (openbsd-386-cgo), const SIOCSVH ideal-int +pkg syscall (openbsd-386-cgo), const SOCK_RDM ideal-int +pkg syscall (openbsd-386-cgo), const SO_ACCEPTCONN ideal-int +pkg syscall (openbsd-386-cgo), const SO_BINDANY ideal-int +pkg syscall (openbsd-386-cgo), const SO_DEBUG ideal-int +pkg syscall (openbsd-386-cgo), const SO_ERROR ideal-int +pkg syscall (openbsd-386-cgo), const SO_NETPROC ideal-int +pkg syscall (openbsd-386-cgo), const SO_OOBINLINE ideal-int +pkg syscall (openbsd-386-cgo), const SO_PEERCRED ideal-int +pkg syscall (openbsd-386-cgo), const SO_RCVLOWAT ideal-int +pkg syscall (openbsd-386-cgo), const SO_RCVTIMEO ideal-int +pkg syscall (openbsd-386-cgo), const SO_REUSEPORT ideal-int +pkg syscall (openbsd-386-cgo), const SO_RTABLE ideal-int +pkg syscall (openbsd-386-cgo), const SO_SNDLOWAT ideal-int +pkg syscall (openbsd-386-cgo), const SO_SNDTIMEO ideal-int +pkg syscall (openbsd-386-cgo), const SO_SPLICE ideal-int +pkg syscall (openbsd-386-cgo), const SO_TIMESTAMP ideal-int +pkg syscall (openbsd-386-cgo), const SO_TYPE ideal-int +pkg syscall (openbsd-386-cgo), const SO_USELOOPBACK ideal-int +pkg syscall (openbsd-386-cgo), const SYS_ACCEPT ideal-int +pkg syscall (openbsd-386-cgo), const SYS_ACCESS ideal-int +pkg syscall (openbsd-386-cgo), const SYS_ACCT ideal-int +pkg syscall (openbsd-386-cgo), const SYS_ADJFREQ ideal-int +pkg syscall (openbsd-386-cgo), const SYS_ADJTIME ideal-int +pkg syscall (openbsd-386-cgo), const SYS_BIND ideal-int +pkg syscall (openbsd-386-cgo), const SYS_CHDIR ideal-int +pkg syscall (openbsd-386-cgo), const SYS_CHFLAGS ideal-int +pkg syscall (openbsd-386-cgo), const SYS_CHMOD ideal-int +pkg syscall (openbsd-386-cgo), const SYS_CHOWN ideal-int +pkg syscall (openbsd-386-cgo), const SYS_CHROOT ideal-int +pkg syscall (openbsd-386-cgo), const SYS_CLOCK_GETRES ideal-int +pkg syscall (openbsd-386-cgo), const SYS_CLOCK_GETTIME ideal-int +pkg syscall (openbsd-386-cgo), const SYS_CLOCK_SETTIME ideal-int +pkg syscall (openbsd-386-cgo), const SYS_CLOSE ideal-int +pkg syscall (openbsd-386-cgo), const SYS_CLOSEFROM ideal-int +pkg syscall (openbsd-386-cgo), const SYS_CONNECT ideal-int +pkg syscall (openbsd-386-cgo), const SYS_DUP ideal-int +pkg syscall (openbsd-386-cgo), const SYS_DUP2 ideal-int +pkg syscall (openbsd-386-cgo), const SYS_EXECVE ideal-int +pkg syscall (openbsd-386-cgo), const SYS_EXIT ideal-int +pkg syscall (openbsd-386-cgo), const SYS_FACCESSAT ideal-int +pkg syscall (openbsd-386-cgo), const SYS_FCHDIR ideal-int +pkg syscall (openbsd-386-cgo), const SYS_FCHFLAGS ideal-int +pkg syscall (openbsd-386-cgo), const SYS_FCHMOD ideal-int +pkg syscall (openbsd-386-cgo), const SYS_FCHMODAT ideal-int +pkg syscall (openbsd-386-cgo), const SYS_FCHOWN ideal-int +pkg syscall (openbsd-386-cgo), const SYS_FCHOWNAT ideal-int +pkg syscall (openbsd-386-cgo), const SYS_FCNTL ideal-int +pkg syscall (openbsd-386-cgo), const SYS_FHOPEN ideal-int +pkg syscall (openbsd-386-cgo), const SYS_FHSTAT ideal-int +pkg syscall (openbsd-386-cgo), const SYS_FHSTATFS ideal-int +pkg syscall (openbsd-386-cgo), const SYS_FLOCK ideal-int +pkg syscall (openbsd-386-cgo), const SYS_FORK ideal-int +pkg syscall (openbsd-386-cgo), const SYS_FPATHCONF ideal-int +pkg syscall (openbsd-386-cgo), const SYS_FSTAT ideal-int +pkg syscall (openbsd-386-cgo), const SYS_FSTATAT ideal-int +pkg syscall (openbsd-386-cgo), const SYS_FSTATFS ideal-int +pkg syscall (openbsd-386-cgo), const SYS_FSYNC ideal-int +pkg syscall (openbsd-386-cgo), const SYS_FTRUNCATE ideal-int +pkg syscall (openbsd-386-cgo), const SYS_FUTIMENS ideal-int +pkg syscall (openbsd-386-cgo), const SYS_FUTIMES ideal-int +pkg syscall (openbsd-386-cgo), const SYS_GETDIRENTRIES ideal-int +pkg syscall (openbsd-386-cgo), const SYS_GETDTABLECOUNT ideal-int +pkg syscall (openbsd-386-cgo), const SYS_GETEGID ideal-int +pkg syscall (openbsd-386-cgo), const SYS_GETEUID ideal-int +pkg syscall (openbsd-386-cgo), const SYS_GETFH ideal-int +pkg syscall (openbsd-386-cgo), const SYS_GETFSSTAT ideal-int +pkg syscall (openbsd-386-cgo), const SYS_GETGID ideal-int +pkg syscall (openbsd-386-cgo), const SYS_GETGROUPS ideal-int +pkg syscall (openbsd-386-cgo), const SYS_GETITIMER ideal-int +pkg syscall (openbsd-386-cgo), const SYS_GETLOGIN ideal-int +pkg syscall (openbsd-386-cgo), const SYS_GETPEERNAME ideal-int +pkg syscall (openbsd-386-cgo), const SYS_GETPGID ideal-int +pkg syscall (openbsd-386-cgo), const SYS_GETPGRP ideal-int +pkg syscall (openbsd-386-cgo), const SYS_GETPID ideal-int +pkg syscall (openbsd-386-cgo), const SYS_GETPPID ideal-int +pkg syscall (openbsd-386-cgo), const SYS_GETPRIORITY ideal-int +pkg syscall (openbsd-386-cgo), const SYS_GETRESGID ideal-int +pkg syscall (openbsd-386-cgo), const SYS_GETRESUID ideal-int +pkg syscall (openbsd-386-cgo), const SYS_GETRLIMIT ideal-int +pkg syscall (openbsd-386-cgo), const SYS_GETRTABLE ideal-int +pkg syscall (openbsd-386-cgo), const SYS_GETRUSAGE ideal-int +pkg syscall (openbsd-386-cgo), const SYS_GETSID ideal-int +pkg syscall (openbsd-386-cgo), const SYS_GETSOCKNAME ideal-int +pkg syscall (openbsd-386-cgo), const SYS_GETSOCKOPT ideal-int +pkg syscall (openbsd-386-cgo), const SYS_GETTHRID ideal-int +pkg syscall (openbsd-386-cgo), const SYS_GETTIMEOFDAY ideal-int +pkg syscall (openbsd-386-cgo), const SYS_GETUID ideal-int +pkg syscall (openbsd-386-cgo), const SYS_IOCTL ideal-int +pkg syscall (openbsd-386-cgo), const SYS_ISSETUGID ideal-int +pkg syscall (openbsd-386-cgo), const SYS_KEVENT ideal-int +pkg syscall (openbsd-386-cgo), const SYS_KILL ideal-int +pkg syscall (openbsd-386-cgo), const SYS_KQUEUE ideal-int +pkg syscall (openbsd-386-cgo), const SYS_KTRACE ideal-int +pkg syscall (openbsd-386-cgo), const SYS_LCHOWN ideal-int +pkg syscall (openbsd-386-cgo), const SYS_LINK ideal-int +pkg syscall (openbsd-386-cgo), const SYS_LINKAT ideal-int +pkg syscall (openbsd-386-cgo), const SYS_LISTEN ideal-int +pkg syscall (openbsd-386-cgo), const SYS_LSEEK ideal-int +pkg syscall (openbsd-386-cgo), const SYS_LSTAT ideal-int +pkg syscall (openbsd-386-cgo), const SYS_MADVISE ideal-int +pkg syscall (openbsd-386-cgo), const SYS_MINCORE ideal-int +pkg syscall (openbsd-386-cgo), const SYS_MINHERIT ideal-int +pkg syscall (openbsd-386-cgo), const SYS_MKDIR ideal-int +pkg syscall (openbsd-386-cgo), const SYS_MKDIRAT ideal-int +pkg syscall (openbsd-386-cgo), const SYS_MKFIFO ideal-int +pkg syscall (openbsd-386-cgo), const SYS_MKFIFOAT ideal-int +pkg syscall (openbsd-386-cgo), const SYS_MKNOD ideal-int +pkg syscall (openbsd-386-cgo), const SYS_MKNODAT ideal-int +pkg syscall (openbsd-386-cgo), const SYS_MLOCK ideal-int +pkg syscall (openbsd-386-cgo), const SYS_MLOCKALL ideal-int +pkg syscall (openbsd-386-cgo), const SYS_MMAP ideal-int +pkg syscall (openbsd-386-cgo), const SYS_MOUNT ideal-int +pkg syscall (openbsd-386-cgo), const SYS_MPROTECT ideal-int +pkg syscall (openbsd-386-cgo), const SYS_MQUERY ideal-int +pkg syscall (openbsd-386-cgo), const SYS_MSGCTL ideal-int +pkg syscall (openbsd-386-cgo), const SYS_MSGGET ideal-int +pkg syscall (openbsd-386-cgo), const SYS_MSGRCV ideal-int +pkg syscall (openbsd-386-cgo), const SYS_MSGSND ideal-int +pkg syscall (openbsd-386-cgo), const SYS_MSYNC ideal-int +pkg syscall (openbsd-386-cgo), const SYS_MUNLOCK ideal-int +pkg syscall (openbsd-386-cgo), const SYS_MUNLOCKALL ideal-int +pkg syscall (openbsd-386-cgo), const SYS_MUNMAP ideal-int +pkg syscall (openbsd-386-cgo), const SYS_NANOSLEEP ideal-int +pkg syscall (openbsd-386-cgo), const SYS_NFSSVC ideal-int +pkg syscall (openbsd-386-cgo), const SYS_OBREAK ideal-int +pkg syscall (openbsd-386-cgo), const SYS_OPEN ideal-int +pkg syscall (openbsd-386-cgo), const SYS_OPENAT ideal-int +pkg syscall (openbsd-386-cgo), const SYS_PATHCONF ideal-int +pkg syscall (openbsd-386-cgo), const SYS_PIPE ideal-int +pkg syscall (openbsd-386-cgo), const SYS_POLL ideal-int +pkg syscall (openbsd-386-cgo), const SYS_PREAD ideal-int +pkg syscall (openbsd-386-cgo), const SYS_PREADV ideal-int +pkg syscall (openbsd-386-cgo), const SYS_PROFIL ideal-int +pkg syscall (openbsd-386-cgo), const SYS_PTRACE ideal-int +pkg syscall (openbsd-386-cgo), const SYS_PWRITE ideal-int +pkg syscall (openbsd-386-cgo), const SYS_PWRITEV ideal-int +pkg syscall (openbsd-386-cgo), const SYS_QUOTACTL ideal-int +pkg syscall (openbsd-386-cgo), const SYS_READ ideal-int +pkg syscall (openbsd-386-cgo), const SYS_READLINK ideal-int +pkg syscall (openbsd-386-cgo), const SYS_READLINKAT ideal-int +pkg syscall (openbsd-386-cgo), const SYS_READV ideal-int +pkg syscall (openbsd-386-cgo), const SYS_REBOOT ideal-int +pkg syscall (openbsd-386-cgo), const SYS_RECVFROM ideal-int +pkg syscall (openbsd-386-cgo), const SYS_RECVMSG ideal-int +pkg syscall (openbsd-386-cgo), const SYS_RENAME ideal-int +pkg syscall (openbsd-386-cgo), const SYS_RENAMEAT ideal-int +pkg syscall (openbsd-386-cgo), const SYS_REVOKE ideal-int +pkg syscall (openbsd-386-cgo), const SYS_RMDIR ideal-int +pkg syscall (openbsd-386-cgo), const SYS_SCHED_YIELD ideal-int +pkg syscall (openbsd-386-cgo), const SYS_SELECT ideal-int +pkg syscall (openbsd-386-cgo), const SYS_SEMGET ideal-int +pkg syscall (openbsd-386-cgo), const SYS_SEMOP ideal-int +pkg syscall (openbsd-386-cgo), const SYS_SENDMSG ideal-int +pkg syscall (openbsd-386-cgo), const SYS_SENDTO ideal-int +pkg syscall (openbsd-386-cgo), const SYS_SETEGID ideal-int +pkg syscall (openbsd-386-cgo), const SYS_SETEUID ideal-int +pkg syscall (openbsd-386-cgo), const SYS_SETGID ideal-int +pkg syscall (openbsd-386-cgo), const SYS_SETGROUPS ideal-int +pkg syscall (openbsd-386-cgo), const SYS_SETITIMER ideal-int +pkg syscall (openbsd-386-cgo), const SYS_SETLOGIN ideal-int +pkg syscall (openbsd-386-cgo), const SYS_SETPGID ideal-int +pkg syscall (openbsd-386-cgo), const SYS_SETPRIORITY ideal-int +pkg syscall (openbsd-386-cgo), const SYS_SETREGID ideal-int +pkg syscall (openbsd-386-cgo), const SYS_SETRESGID ideal-int +pkg syscall (openbsd-386-cgo), const SYS_SETRESUID ideal-int +pkg syscall (openbsd-386-cgo), const SYS_SETREUID ideal-int +pkg syscall (openbsd-386-cgo), const SYS_SETRLIMIT ideal-int +pkg syscall (openbsd-386-cgo), const SYS_SETRTABLE ideal-int +pkg syscall (openbsd-386-cgo), const SYS_SETSID ideal-int +pkg syscall (openbsd-386-cgo), const SYS_SETSOCKOPT ideal-int +pkg syscall (openbsd-386-cgo), const SYS_SETTIMEOFDAY ideal-int +pkg syscall (openbsd-386-cgo), const SYS_SETUID ideal-int +pkg syscall (openbsd-386-cgo), const SYS_SHMAT ideal-int +pkg syscall (openbsd-386-cgo), const SYS_SHMCTL ideal-int +pkg syscall (openbsd-386-cgo), const SYS_SHMDT ideal-int +pkg syscall (openbsd-386-cgo), const SYS_SHMGET ideal-int +pkg syscall (openbsd-386-cgo), const SYS_SHUTDOWN ideal-int +pkg syscall (openbsd-386-cgo), const SYS_SIGACTION ideal-int +pkg syscall (openbsd-386-cgo), const SYS_SIGALTSTACK ideal-int +pkg syscall (openbsd-386-cgo), const SYS_SIGPENDING ideal-int +pkg syscall (openbsd-386-cgo), const SYS_SIGPROCMASK ideal-int +pkg syscall (openbsd-386-cgo), const SYS_SIGRETURN ideal-int +pkg syscall (openbsd-386-cgo), const SYS_SIGSUSPEND ideal-int +pkg syscall (openbsd-386-cgo), const SYS_SOCKET ideal-int +pkg syscall (openbsd-386-cgo), const SYS_SOCKETPAIR ideal-int +pkg syscall (openbsd-386-cgo), const SYS_STAT ideal-int +pkg syscall (openbsd-386-cgo), const SYS_STATFS ideal-int +pkg syscall (openbsd-386-cgo), const SYS_SWAPCTL ideal-int +pkg syscall (openbsd-386-cgo), const SYS_SYMLINK ideal-int +pkg syscall (openbsd-386-cgo), const SYS_SYMLINKAT ideal-int +pkg syscall (openbsd-386-cgo), const SYS_SYNC ideal-int +pkg syscall (openbsd-386-cgo), const SYS_SYSARCH ideal-int +pkg syscall (openbsd-386-cgo), const SYS_TRUNCATE ideal-int +pkg syscall (openbsd-386-cgo), const SYS_UMASK ideal-int +pkg syscall (openbsd-386-cgo), const SYS_UNLINK ideal-int +pkg syscall (openbsd-386-cgo), const SYS_UNLINKAT ideal-int +pkg syscall (openbsd-386-cgo), const SYS_UNMOUNT ideal-int +pkg syscall (openbsd-386-cgo), const SYS_UTIMENSAT ideal-int +pkg syscall (openbsd-386-cgo), const SYS_UTIMES ideal-int +pkg syscall (openbsd-386-cgo), const SYS_VFORK ideal-int +pkg syscall (openbsd-386-cgo), const SYS_WAIT4 ideal-int +pkg syscall (openbsd-386-cgo), const SYS_WRITE ideal-int +pkg syscall (openbsd-386-cgo), const SYS_WRITEV ideal-int +pkg syscall (openbsd-386-cgo), const SYS___GETCWD ideal-int +pkg syscall (openbsd-386-cgo), const SYS___GET_TCB ideal-int +pkg syscall (openbsd-386-cgo), const SYS___SEMCTL ideal-int +pkg syscall (openbsd-386-cgo), const SYS___SET_TCB ideal-int +pkg syscall (openbsd-386-cgo), const SYS___SYSCTL ideal-int +pkg syscall (openbsd-386-cgo), const SYS___TFORK ideal-int +pkg syscall (openbsd-386-cgo), const SYS___THREXIT ideal-int +pkg syscall (openbsd-386-cgo), const SYS___THRSIGDIVERT ideal-int +pkg syscall (openbsd-386-cgo), const SYS___THRSLEEP ideal-int +pkg syscall (openbsd-386-cgo), const SYS___THRWAKEUP ideal-int +pkg syscall (openbsd-386-cgo), const SizeofBpfHdr ideal-int +pkg syscall (openbsd-386-cgo), const SizeofBpfInsn ideal-int +pkg syscall (openbsd-386-cgo), const SizeofBpfProgram ideal-int +pkg syscall (openbsd-386-cgo), const SizeofBpfStat ideal-int +pkg syscall (openbsd-386-cgo), const SizeofBpfVersion ideal-int +pkg syscall (openbsd-386-cgo), const SizeofCmsghdr ideal-int +pkg syscall (openbsd-386-cgo), const SizeofICMPv6Filter = 32 +pkg syscall (openbsd-386-cgo), const SizeofICMPv6Filter ideal-int +pkg syscall (openbsd-386-cgo), const SizeofIPMreq ideal-int +pkg syscall (openbsd-386-cgo), const SizeofIPv6MTUInfo = 32 +pkg syscall (openbsd-386-cgo), const SizeofIPv6MTUInfo ideal-int +pkg syscall (openbsd-386-cgo), const SizeofIPv6Mreq ideal-int +pkg syscall (openbsd-386-cgo), const SizeofIfAnnounceMsghdr ideal-int +pkg syscall (openbsd-386-cgo), const SizeofIfData ideal-int +pkg syscall (openbsd-386-cgo), const SizeofIfMsghdr ideal-int +pkg syscall (openbsd-386-cgo), const SizeofIfaMsghdr ideal-int +pkg syscall (openbsd-386-cgo), const SizeofInet6Pktinfo ideal-int +pkg syscall (openbsd-386-cgo), const SizeofLinger ideal-int +pkg syscall (openbsd-386-cgo), const SizeofMsghdr ideal-int +pkg syscall (openbsd-386-cgo), const SizeofRtMetrics ideal-int +pkg syscall (openbsd-386-cgo), const SizeofRtMsghdr ideal-int +pkg syscall (openbsd-386-cgo), const SizeofSockaddrAny ideal-int +pkg syscall (openbsd-386-cgo), const SizeofSockaddrDatalink ideal-int +pkg syscall (openbsd-386-cgo), const SizeofSockaddrInet4 ideal-int +pkg syscall (openbsd-386-cgo), const SizeofSockaddrInet6 ideal-int +pkg syscall (openbsd-386-cgo), const SizeofSockaddrUnix ideal-int +pkg syscall (openbsd-386-cgo), const TCIFLUSH ideal-int +pkg syscall (openbsd-386-cgo), const TCIOFLUSH ideal-int +pkg syscall (openbsd-386-cgo), const TCOFLUSH ideal-int +pkg syscall (openbsd-386-cgo), const TCP_MAXBURST ideal-int +pkg syscall (openbsd-386-cgo), const TCP_MAXSEG ideal-int +pkg syscall (openbsd-386-cgo), const TCP_MAXWIN ideal-int +pkg syscall (openbsd-386-cgo), const TCP_MAX_SACK ideal-int +pkg syscall (openbsd-386-cgo), const TCP_MAX_WINSHIFT ideal-int +pkg syscall (openbsd-386-cgo), const TCP_MD5SIG ideal-int +pkg syscall (openbsd-386-cgo), const TCP_MSS ideal-int +pkg syscall (openbsd-386-cgo), const TCP_NSTATES ideal-int +pkg syscall (openbsd-386-cgo), const TCP_SACK_ENABLE ideal-int +pkg syscall (openbsd-386-cgo), const TCSAFLUSH ideal-int +pkg syscall (openbsd-386-cgo), const TIOCCBRK ideal-int +pkg syscall (openbsd-386-cgo), const TIOCCDTR ideal-int +pkg syscall (openbsd-386-cgo), const TIOCCONS ideal-int +pkg syscall (openbsd-386-cgo), const TIOCDRAIN ideal-int +pkg syscall (openbsd-386-cgo), const TIOCEXCL ideal-int +pkg syscall (openbsd-386-cgo), const TIOCEXT ideal-int +pkg syscall (openbsd-386-cgo), const TIOCFLAG_CLOCAL ideal-int +pkg syscall (openbsd-386-cgo), const TIOCFLAG_CRTSCTS ideal-int +pkg syscall (openbsd-386-cgo), const TIOCFLAG_MDMBUF ideal-int +pkg syscall (openbsd-386-cgo), const TIOCFLAG_PPS ideal-int +pkg syscall (openbsd-386-cgo), const TIOCFLAG_SOFTCAR ideal-int +pkg syscall (openbsd-386-cgo), const TIOCFLUSH ideal-int +pkg syscall (openbsd-386-cgo), const TIOCGETA ideal-int +pkg syscall (openbsd-386-cgo), const TIOCGETD ideal-int +pkg syscall (openbsd-386-cgo), const TIOCGFLAGS ideal-int +pkg syscall (openbsd-386-cgo), const TIOCGPGRP ideal-int +pkg syscall (openbsd-386-cgo), const TIOCGTSTAMP ideal-int +pkg syscall (openbsd-386-cgo), const TIOCGWINSZ ideal-int +pkg syscall (openbsd-386-cgo), const TIOCMBIC ideal-int +pkg syscall (openbsd-386-cgo), const TIOCMBIS ideal-int +pkg syscall (openbsd-386-cgo), const TIOCMGET ideal-int +pkg syscall (openbsd-386-cgo), const TIOCMODG ideal-int +pkg syscall (openbsd-386-cgo), const TIOCMODS ideal-int +pkg syscall (openbsd-386-cgo), const TIOCMSET ideal-int +pkg syscall (openbsd-386-cgo), const TIOCM_CAR ideal-int +pkg syscall (openbsd-386-cgo), const TIOCM_CD ideal-int +pkg syscall (openbsd-386-cgo), const TIOCM_CTS ideal-int +pkg syscall (openbsd-386-cgo), const TIOCM_DSR ideal-int +pkg syscall (openbsd-386-cgo), const TIOCM_DTR ideal-int +pkg syscall (openbsd-386-cgo), const TIOCM_LE ideal-int +pkg syscall (openbsd-386-cgo), const TIOCM_RI ideal-int +pkg syscall (openbsd-386-cgo), const TIOCM_RNG ideal-int +pkg syscall (openbsd-386-cgo), const TIOCM_RTS ideal-int +pkg syscall (openbsd-386-cgo), const TIOCM_SR ideal-int +pkg syscall (openbsd-386-cgo), const TIOCM_ST ideal-int +pkg syscall (openbsd-386-cgo), const TIOCNOTTY ideal-int +pkg syscall (openbsd-386-cgo), const TIOCNXCL ideal-int +pkg syscall (openbsd-386-cgo), const TIOCOUTQ ideal-int +pkg syscall (openbsd-386-cgo), const TIOCPKT ideal-int +pkg syscall (openbsd-386-cgo), const TIOCPKT_DATA ideal-int +pkg syscall (openbsd-386-cgo), const TIOCPKT_DOSTOP ideal-int +pkg syscall (openbsd-386-cgo), const TIOCPKT_FLUSHREAD ideal-int +pkg syscall (openbsd-386-cgo), const TIOCPKT_FLUSHWRITE ideal-int +pkg syscall (openbsd-386-cgo), const TIOCPKT_IOCTL ideal-int +pkg syscall (openbsd-386-cgo), const TIOCPKT_NOSTOP ideal-int +pkg syscall (openbsd-386-cgo), const TIOCPKT_START ideal-int +pkg syscall (openbsd-386-cgo), const TIOCPKT_STOP ideal-int +pkg syscall (openbsd-386-cgo), const TIOCREMOTE ideal-int +pkg syscall (openbsd-386-cgo), const TIOCSBRK ideal-int +pkg syscall (openbsd-386-cgo), const TIOCSCTTY ideal-int +pkg syscall (openbsd-386-cgo), const TIOCSDTR ideal-int +pkg syscall (openbsd-386-cgo), const TIOCSETA ideal-int +pkg syscall (openbsd-386-cgo), const TIOCSETAF ideal-int +pkg syscall (openbsd-386-cgo), const TIOCSETAW ideal-int +pkg syscall (openbsd-386-cgo), const TIOCSETD ideal-int +pkg syscall (openbsd-386-cgo), const TIOCSFLAGS ideal-int +pkg syscall (openbsd-386-cgo), const TIOCSIG ideal-int +pkg syscall (openbsd-386-cgo), const TIOCSPGRP ideal-int +pkg syscall (openbsd-386-cgo), const TIOCSTART ideal-int +pkg syscall (openbsd-386-cgo), const TIOCSTAT ideal-int +pkg syscall (openbsd-386-cgo), const TIOCSTI ideal-int +pkg syscall (openbsd-386-cgo), const TIOCSTOP ideal-int +pkg syscall (openbsd-386-cgo), const TIOCSTSTAMP ideal-int +pkg syscall (openbsd-386-cgo), const TIOCSWINSZ ideal-int +pkg syscall (openbsd-386-cgo), const TIOCUCNTL ideal-int +pkg syscall (openbsd-386-cgo), const TOSTOP ideal-int +pkg syscall (openbsd-386-cgo), const VDISCARD ideal-int +pkg syscall (openbsd-386-cgo), const VDSUSP ideal-int +pkg syscall (openbsd-386-cgo), const VEOF ideal-int +pkg syscall (openbsd-386-cgo), const VEOL ideal-int +pkg syscall (openbsd-386-cgo), const VEOL2 ideal-int +pkg syscall (openbsd-386-cgo), const VERASE ideal-int +pkg syscall (openbsd-386-cgo), const VINTR ideal-int +pkg syscall (openbsd-386-cgo), const VKILL ideal-int +pkg syscall (openbsd-386-cgo), const VLNEXT ideal-int +pkg syscall (openbsd-386-cgo), const VMIN ideal-int +pkg syscall (openbsd-386-cgo), const VQUIT ideal-int +pkg syscall (openbsd-386-cgo), const VREPRINT ideal-int +pkg syscall (openbsd-386-cgo), const VSTART ideal-int +pkg syscall (openbsd-386-cgo), const VSTATUS ideal-int +pkg syscall (openbsd-386-cgo), const VSTOP ideal-int +pkg syscall (openbsd-386-cgo), const VSUSP ideal-int +pkg syscall (openbsd-386-cgo), const VTIME ideal-int +pkg syscall (openbsd-386-cgo), const VWERASE ideal-int +pkg syscall (openbsd-386-cgo), const WALTSIG ideal-int +pkg syscall (openbsd-386-cgo), const WCONTINUED ideal-int +pkg syscall (openbsd-386-cgo), const WCOREFLAG ideal-int +pkg syscall (openbsd-386-cgo), const WNOHANG ideal-int +pkg syscall (openbsd-386-cgo), const WSTOPPED ideal-int +pkg syscall (openbsd-386-cgo), const WUNTRACED ideal-int +pkg syscall (openbsd-386-cgo), func Accept(int) (int, Sockaddr, error) +pkg syscall (openbsd-386-cgo), func Access(string, uint32) error +pkg syscall (openbsd-386-cgo), func Adjtime(*Timeval, *Timeval) error +pkg syscall (openbsd-386-cgo), func Bind(int, Sockaddr) error +pkg syscall (openbsd-386-cgo), func BpfBuflen(int) (int, error) +pkg syscall (openbsd-386-cgo), func BpfDatalink(int) (int, error) +pkg syscall (openbsd-386-cgo), func BpfHeadercmpl(int) (int, error) +pkg syscall (openbsd-386-cgo), func BpfInterface(int, string) (string, error) +pkg syscall (openbsd-386-cgo), func BpfJump(int, int, int, int) *BpfInsn +pkg syscall (openbsd-386-cgo), func BpfStats(int) (*BpfStat, error) +pkg syscall (openbsd-386-cgo), func BpfStmt(int, int) *BpfInsn +pkg syscall (openbsd-386-cgo), func BpfTimeout(int) (*Timeval, error) +pkg syscall (openbsd-386-cgo), func CheckBpfVersion(int) error +pkg syscall (openbsd-386-cgo), func Chflags(string, int) error +pkg syscall (openbsd-386-cgo), func Chroot(string) error +pkg syscall (openbsd-386-cgo), func Close(int) error +pkg syscall (openbsd-386-cgo), func CloseOnExec(int) +pkg syscall (openbsd-386-cgo), func CmsgLen(int) int +pkg syscall (openbsd-386-cgo), func CmsgSpace(int) int +pkg syscall (openbsd-386-cgo), func Connect(int, Sockaddr) error +pkg syscall (openbsd-386-cgo), func Dup(int) (int, error) +pkg syscall (openbsd-386-cgo), func Dup2(int, int) error +pkg syscall (openbsd-386-cgo), func Fchdir(int) error +pkg syscall (openbsd-386-cgo), func Fchflags(int, int) error +pkg syscall (openbsd-386-cgo), func Fchmod(int, uint32) error +pkg syscall (openbsd-386-cgo), func Fchown(int, int, int) error +pkg syscall (openbsd-386-cgo), func Flock(int, int) error +pkg syscall (openbsd-386-cgo), func FlushBpf(int) error +pkg syscall (openbsd-386-cgo), func ForkExec(string, []string, *ProcAttr) (int, error) +pkg syscall (openbsd-386-cgo), func Fpathconf(int, int) (int, error) +pkg syscall (openbsd-386-cgo), func Fstat(int, *Stat_t) error +pkg syscall (openbsd-386-cgo), func Fstatfs(int, *Statfs_t) error +pkg syscall (openbsd-386-cgo), func Fsync(int) error +pkg syscall (openbsd-386-cgo), func Ftruncate(int, int64) error +pkg syscall (openbsd-386-cgo), func Futimes(int, []Timeval) error +pkg syscall (openbsd-386-cgo), func Getdirentries(int, []uint8, *uintptr) (int, error) +pkg syscall (openbsd-386-cgo), func Getfsstat([]Statfs_t, int) (int, error) +pkg syscall (openbsd-386-cgo), func Getpeername(int) (Sockaddr, error) +pkg syscall (openbsd-386-cgo), func Getpgid(int) (int, error) +pkg syscall (openbsd-386-cgo), func Getpgrp() int +pkg syscall (openbsd-386-cgo), func Getpriority(int, int) (int, error) +pkg syscall (openbsd-386-cgo), func Getrlimit(int, *Rlimit) error +pkg syscall (openbsd-386-cgo), func Getrusage(int, *Rusage) error +pkg syscall (openbsd-386-cgo), func Getsid(int) (int, error) +pkg syscall (openbsd-386-cgo), func Getsockname(int) (Sockaddr, error) +pkg syscall (openbsd-386-cgo), func GetsockoptByte(int, int, int) (uint8, error) +pkg syscall (openbsd-386-cgo), func GetsockoptICMPv6Filter(int, int, int) (*ICMPv6Filter, error) +pkg syscall (openbsd-386-cgo), func GetsockoptIPMreq(int, int, int) (*IPMreq, error) +pkg syscall (openbsd-386-cgo), func GetsockoptIPv6MTUInfo(int, int, int) (*IPv6MTUInfo, error) +pkg syscall (openbsd-386-cgo), func GetsockoptIPv6Mreq(int, int, int) (*IPv6Mreq, error) +pkg syscall (openbsd-386-cgo), func GetsockoptInet4Addr(int, int, int) ([4]uint8, error) +pkg syscall (openbsd-386-cgo), func GetsockoptInt(int, int, int) (int, error) +pkg syscall (openbsd-386-cgo), func Issetugid() bool +pkg syscall (openbsd-386-cgo), func Kevent(int, []Kevent_t, []Kevent_t, *Timespec) (int, error) +pkg syscall (openbsd-386-cgo), func Kill(int, Signal) error +pkg syscall (openbsd-386-cgo), func Kqueue() (int, error) +pkg syscall (openbsd-386-cgo), func Listen(int, int) error +pkg syscall (openbsd-386-cgo), func Lstat(string, *Stat_t) error +pkg syscall (openbsd-386-cgo), func Mkfifo(string, uint32) error +pkg syscall (openbsd-386-cgo), func Mknod(string, uint32, int) error +pkg syscall (openbsd-386-cgo), func Mmap(int, int64, int, int, int) ([]uint8, error) +pkg syscall (openbsd-386-cgo), func Munmap([]uint8) error +pkg syscall (openbsd-386-cgo), func Nanosleep(*Timespec, *Timespec) error +pkg syscall (openbsd-386-cgo), func Open(string, int, uint32) (int, error) +pkg syscall (openbsd-386-cgo), func ParseDirent([]uint8, int, []string) (int, int, []string) +pkg syscall (openbsd-386-cgo), func ParseRoutingMessage([]uint8) ([]RoutingMessage, error) +pkg syscall (openbsd-386-cgo), func ParseRoutingSockaddr(RoutingMessage) ([]Sockaddr, error) +pkg syscall (openbsd-386-cgo), func ParseSocketControlMessage([]uint8) ([]SocketControlMessage, error) +pkg syscall (openbsd-386-cgo), func ParseUnixRights(*SocketControlMessage) ([]int, error) +pkg syscall (openbsd-386-cgo), func Pathconf(string, int) (int, error) +pkg syscall (openbsd-386-cgo), func Pipe([]int) error +pkg syscall (openbsd-386-cgo), func Pread(int, []uint8, int64) (int, error) +pkg syscall (openbsd-386-cgo), func Pwrite(int, []uint8, int64) (int, error) +pkg syscall (openbsd-386-cgo), func RawSyscall(uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno) +pkg syscall (openbsd-386-cgo), func RawSyscall6(uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno) +pkg syscall (openbsd-386-cgo), func Read(int, []uint8) (int, error) +pkg syscall (openbsd-386-cgo), func ReadDirent(int, []uint8) (int, error) +pkg syscall (openbsd-386-cgo), func Recvfrom(int, []uint8, int) (int, Sockaddr, error) +pkg syscall (openbsd-386-cgo), func Recvmsg(int, []uint8, []uint8, int) (int, int, int, Sockaddr, error) +pkg syscall (openbsd-386-cgo), func Revoke(string) error +pkg syscall (openbsd-386-cgo), func RouteRIB(int, int) ([]uint8, error) +pkg syscall (openbsd-386-cgo), func Seek(int, int64, int) (int64, error) +pkg syscall (openbsd-386-cgo), func Select(int, *FdSet, *FdSet, *FdSet, *Timeval) error +pkg syscall (openbsd-386-cgo), func Sendfile(int, int, *int64, int) (int, error) +pkg syscall (openbsd-386-cgo), func Sendmsg(int, []uint8, []uint8, Sockaddr, int) error +pkg syscall (openbsd-386-cgo), func Sendto(int, []uint8, int, Sockaddr) error +pkg syscall (openbsd-386-cgo), func SetBpf(int, []BpfInsn) error +pkg syscall (openbsd-386-cgo), func SetBpfBuflen(int, int) (int, error) +pkg syscall (openbsd-386-cgo), func SetBpfDatalink(int, int) (int, error) +pkg syscall (openbsd-386-cgo), func SetBpfHeadercmpl(int, int) error +pkg syscall (openbsd-386-cgo), func SetBpfImmediate(int, int) error +pkg syscall (openbsd-386-cgo), func SetBpfInterface(int, string) error +pkg syscall (openbsd-386-cgo), func SetBpfPromisc(int, int) error +pkg syscall (openbsd-386-cgo), func SetBpfTimeout(int, *Timeval) error +pkg syscall (openbsd-386-cgo), func SetKevent(*Kevent_t, int, int, int) +pkg syscall (openbsd-386-cgo), func SetNonblock(int, bool) error +pkg syscall (openbsd-386-cgo), func Setegid(int) error +pkg syscall (openbsd-386-cgo), func Seteuid(int) error +pkg syscall (openbsd-386-cgo), func Setgid(int) error +pkg syscall (openbsd-386-cgo), func Setgroups([]int) error +pkg syscall (openbsd-386-cgo), func Setlogin(string) error +pkg syscall (openbsd-386-cgo), func Setpgid(int, int) error +pkg syscall (openbsd-386-cgo), func Setpriority(int, int, int) error +pkg syscall (openbsd-386-cgo), func Setregid(int, int) error +pkg syscall (openbsd-386-cgo), func Setreuid(int, int) error +pkg syscall (openbsd-386-cgo), func Setrlimit(int, *Rlimit) error +pkg syscall (openbsd-386-cgo), func Setsid() (int, error) +pkg syscall (openbsd-386-cgo), func SetsockoptByte(int, int, int, uint8) error +pkg syscall (openbsd-386-cgo), func SetsockoptICMPv6Filter(int, int, int, *ICMPv6Filter) error +pkg syscall (openbsd-386-cgo), func SetsockoptIPMreq(int, int, int, *IPMreq) error +pkg syscall (openbsd-386-cgo), func SetsockoptIPv6Mreq(int, int, int, *IPv6Mreq) error +pkg syscall (openbsd-386-cgo), func SetsockoptInet4Addr(int, int, int, [4]uint8) error +pkg syscall (openbsd-386-cgo), func SetsockoptInt(int, int, int, int) error +pkg syscall (openbsd-386-cgo), func SetsockoptLinger(int, int, int, *Linger) error +pkg syscall (openbsd-386-cgo), func SetsockoptString(int, int, int, string) error +pkg syscall (openbsd-386-cgo), func SetsockoptTimeval(int, int, int, *Timeval) error +pkg syscall (openbsd-386-cgo), func Settimeofday(*Timeval) error +pkg syscall (openbsd-386-cgo), func Setuid(int) error +pkg syscall (openbsd-386-cgo), func Shutdown(int, int) error +pkg syscall (openbsd-386-cgo), func SlicePtrFromStrings([]string) ([]*uint8, error) +pkg syscall (openbsd-386-cgo), func Socket(int, int, int) (int, error) +pkg syscall (openbsd-386-cgo), func Socketpair(int, int, int) ([2]int, error) +pkg syscall (openbsd-386-cgo), func Stat(string, *Stat_t) error +pkg syscall (openbsd-386-cgo), func Statfs(string, *Statfs_t) error +pkg syscall (openbsd-386-cgo), func StringSlicePtr([]string) []*uint8 +pkg syscall (openbsd-386-cgo), func Sync() error +pkg syscall (openbsd-386-cgo), func Syscall(uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno) +pkg syscall (openbsd-386-cgo), func Syscall6(uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno) +pkg syscall (openbsd-386-cgo), func Syscall9(uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno) +pkg syscall (openbsd-386-cgo), func Sysctl(string) (string, error) +pkg syscall (openbsd-386-cgo), func SysctlUint32(string) (uint32, error) +pkg syscall (openbsd-386-cgo), func TimevalToNsec(Timeval) int64 +pkg syscall (openbsd-386-cgo), func Truncate(string, int64) error +pkg syscall (openbsd-386-cgo), func Umask(int) int +pkg syscall (openbsd-386-cgo), func UnixRights(...int) []uint8 +pkg syscall (openbsd-386-cgo), func Unmount(string, int) error +pkg syscall (openbsd-386-cgo), func Wait4(int, *WaitStatus, int, *Rusage) (int, error) +pkg syscall (openbsd-386-cgo), func Write(int, []uint8) (int, error) +pkg syscall (openbsd-386-cgo), method (*Cmsghdr) SetLen(int) +pkg syscall (openbsd-386-cgo), method (*Iovec) SetLen(int) +pkg syscall (openbsd-386-cgo), method (*Msghdr) SetControllen(int) +pkg syscall (openbsd-386-cgo), type BpfHdr struct +pkg syscall (openbsd-386-cgo), type BpfHdr struct, Caplen uint32 +pkg syscall (openbsd-386-cgo), type BpfHdr struct, Datalen uint32 +pkg syscall (openbsd-386-cgo), type BpfHdr struct, Hdrlen uint16 +pkg syscall (openbsd-386-cgo), type BpfHdr struct, Pad_cgo_0 [2]uint8 +pkg syscall (openbsd-386-cgo), type BpfHdr struct, Tstamp BpfTimeval +pkg syscall (openbsd-386-cgo), type BpfInsn struct +pkg syscall (openbsd-386-cgo), type BpfInsn struct, Code uint16 +pkg syscall (openbsd-386-cgo), type BpfInsn struct, Jf uint8 +pkg syscall (openbsd-386-cgo), type BpfInsn struct, Jt uint8 +pkg syscall (openbsd-386-cgo), type BpfInsn struct, K uint32 +pkg syscall (openbsd-386-cgo), type BpfProgram struct +pkg syscall (openbsd-386-cgo), type BpfProgram struct, Insns *BpfInsn +pkg syscall (openbsd-386-cgo), type BpfProgram struct, Len uint32 +pkg syscall (openbsd-386-cgo), type BpfStat struct +pkg syscall (openbsd-386-cgo), type BpfStat struct, Drop uint32 +pkg syscall (openbsd-386-cgo), type BpfStat struct, Recv uint32 +pkg syscall (openbsd-386-cgo), type BpfTimeval struct +pkg syscall (openbsd-386-cgo), type BpfTimeval struct, Sec uint32 +pkg syscall (openbsd-386-cgo), type BpfTimeval struct, Usec uint32 +pkg syscall (openbsd-386-cgo), type BpfVersion struct +pkg syscall (openbsd-386-cgo), type BpfVersion struct, Major uint16 +pkg syscall (openbsd-386-cgo), type BpfVersion struct, Minor uint16 +pkg syscall (openbsd-386-cgo), type Cmsghdr struct +pkg syscall (openbsd-386-cgo), type Cmsghdr struct, Len uint32 +pkg syscall (openbsd-386-cgo), type Cmsghdr struct, Level int32 +pkg syscall (openbsd-386-cgo), type Cmsghdr struct, Type int32 +pkg syscall (openbsd-386-cgo), type Credential struct +pkg syscall (openbsd-386-cgo), type Credential struct, Gid uint32 +pkg syscall (openbsd-386-cgo), type Credential struct, Groups []uint32 +pkg syscall (openbsd-386-cgo), type Credential struct, Uid uint32 +pkg syscall (openbsd-386-cgo), type Dirent struct +pkg syscall (openbsd-386-cgo), type Dirent struct, Fileno uint32 +pkg syscall (openbsd-386-cgo), type Dirent struct, Name [256]int8 +pkg syscall (openbsd-386-cgo), type Dirent struct, Namlen uint8 +pkg syscall (openbsd-386-cgo), type Dirent struct, Reclen uint16 +pkg syscall (openbsd-386-cgo), type Dirent struct, Type uint8 +pkg syscall (openbsd-386-cgo), type FdSet struct +pkg syscall (openbsd-386-cgo), type FdSet struct, Bits [32]int32 +pkg syscall (openbsd-386-cgo), type Flock_t struct +pkg syscall (openbsd-386-cgo), type Flock_t struct, Len int64 +pkg syscall (openbsd-386-cgo), type Flock_t struct, Pid int32 +pkg syscall (openbsd-386-cgo), type Flock_t struct, Start int64 +pkg syscall (openbsd-386-cgo), type Flock_t struct, Type int16 +pkg syscall (openbsd-386-cgo), type Flock_t struct, Whence int16 +pkg syscall (openbsd-386-cgo), type Fsid struct +pkg syscall (openbsd-386-cgo), type Fsid struct, Val [2]int32 +pkg syscall (openbsd-386-cgo), type ICMPv6Filter struct +pkg syscall (openbsd-386-cgo), type ICMPv6Filter struct, Filt [8]uint32 +pkg syscall (openbsd-386-cgo), type IPv6MTUInfo struct +pkg syscall (openbsd-386-cgo), type IPv6MTUInfo struct, Addr RawSockaddrInet6 +pkg syscall (openbsd-386-cgo), type IPv6MTUInfo struct, Mtu uint32 +pkg syscall (openbsd-386-cgo), type IfAnnounceMsghdr struct +pkg syscall (openbsd-386-cgo), type IfAnnounceMsghdr struct, Hdrlen uint16 +pkg syscall (openbsd-386-cgo), type IfAnnounceMsghdr struct, Index uint16 +pkg syscall (openbsd-386-cgo), type IfAnnounceMsghdr struct, Msglen uint16 +pkg syscall (openbsd-386-cgo), type IfAnnounceMsghdr struct, Name [16]int8 +pkg syscall (openbsd-386-cgo), type IfAnnounceMsghdr struct, Type uint8 +pkg syscall (openbsd-386-cgo), type IfAnnounceMsghdr struct, Version uint8 +pkg syscall (openbsd-386-cgo), type IfAnnounceMsghdr struct, What uint16 +pkg syscall (openbsd-386-cgo), type IfData struct +pkg syscall (openbsd-386-cgo), type IfData struct, Addrlen uint8 +pkg syscall (openbsd-386-cgo), type IfData struct, Baudrate uint64 +pkg syscall (openbsd-386-cgo), type IfData struct, Capabilities uint32 +pkg syscall (openbsd-386-cgo), type IfData struct, Collisions uint64 +pkg syscall (openbsd-386-cgo), type IfData struct, Hdrlen uint8 +pkg syscall (openbsd-386-cgo), type IfData struct, Ibytes uint64 +pkg syscall (openbsd-386-cgo), type IfData struct, Ierrors uint64 +pkg syscall (openbsd-386-cgo), type IfData struct, Imcasts uint64 +pkg syscall (openbsd-386-cgo), type IfData struct, Ipackets uint64 +pkg syscall (openbsd-386-cgo), type IfData struct, Iqdrops uint64 +pkg syscall (openbsd-386-cgo), type IfData struct, Lastchange Timeval +pkg syscall (openbsd-386-cgo), type IfData struct, Link_state uint8 +pkg syscall (openbsd-386-cgo), type IfData struct, Mclpool [7]Mclpool +pkg syscall (openbsd-386-cgo), type IfData struct, Metric uint32 +pkg syscall (openbsd-386-cgo), type IfData struct, Mtu uint32 +pkg syscall (openbsd-386-cgo), type IfData struct, Noproto uint64 +pkg syscall (openbsd-386-cgo), type IfData struct, Obytes uint64 +pkg syscall (openbsd-386-cgo), type IfData struct, Oerrors uint64 +pkg syscall (openbsd-386-cgo), type IfData struct, Omcasts uint64 +pkg syscall (openbsd-386-cgo), type IfData struct, Opackets uint64 +pkg syscall (openbsd-386-cgo), type IfData struct, Pad uint32 +pkg syscall (openbsd-386-cgo), type IfData struct, Type uint8 +pkg syscall (openbsd-386-cgo), type IfMsghdr struct +pkg syscall (openbsd-386-cgo), type IfMsghdr struct, Addrs int32 +pkg syscall (openbsd-386-cgo), type IfMsghdr struct, Data IfData +pkg syscall (openbsd-386-cgo), type IfMsghdr struct, Flags int32 +pkg syscall (openbsd-386-cgo), type IfMsghdr struct, Hdrlen uint16 +pkg syscall (openbsd-386-cgo), type IfMsghdr struct, Index uint16 +pkg syscall (openbsd-386-cgo), type IfMsghdr struct, Msglen uint16 +pkg syscall (openbsd-386-cgo), type IfMsghdr struct, Pad1 uint8 +pkg syscall (openbsd-386-cgo), type IfMsghdr struct, Pad2 uint8 +pkg syscall (openbsd-386-cgo), type IfMsghdr struct, Tableid uint16 +pkg syscall (openbsd-386-cgo), type IfMsghdr struct, Type uint8 +pkg syscall (openbsd-386-cgo), type IfMsghdr struct, Version uint8 +pkg syscall (openbsd-386-cgo), type IfMsghdr struct, Xflags int32 +pkg syscall (openbsd-386-cgo), type IfaMsghdr struct +pkg syscall (openbsd-386-cgo), type IfaMsghdr struct, Addrs int32 +pkg syscall (openbsd-386-cgo), type IfaMsghdr struct, Flags int32 +pkg syscall (openbsd-386-cgo), type IfaMsghdr struct, Hdrlen uint16 +pkg syscall (openbsd-386-cgo), type IfaMsghdr struct, Index uint16 +pkg syscall (openbsd-386-cgo), type IfaMsghdr struct, Metric int32 +pkg syscall (openbsd-386-cgo), type IfaMsghdr struct, Msglen uint16 +pkg syscall (openbsd-386-cgo), type IfaMsghdr struct, Pad1 uint8 +pkg syscall (openbsd-386-cgo), type IfaMsghdr struct, Pad2 uint8 +pkg syscall (openbsd-386-cgo), type IfaMsghdr struct, Tableid uint16 +pkg syscall (openbsd-386-cgo), type IfaMsghdr struct, Type uint8 +pkg syscall (openbsd-386-cgo), type IfaMsghdr struct, Version uint8 +pkg syscall (openbsd-386-cgo), type Inet6Pktinfo struct +pkg syscall (openbsd-386-cgo), type Inet6Pktinfo struct, Addr [16]uint8 +pkg syscall (openbsd-386-cgo), type Inet6Pktinfo struct, Ifindex uint32 +pkg syscall (openbsd-386-cgo), type InterfaceAddrMessage struct +pkg syscall (openbsd-386-cgo), type InterfaceAddrMessage struct, Data []uint8 +pkg syscall (openbsd-386-cgo), type InterfaceAddrMessage struct, Header IfaMsghdr +pkg syscall (openbsd-386-cgo), type InterfaceAnnounceMessage struct +pkg syscall (openbsd-386-cgo), type InterfaceAnnounceMessage struct, Header IfAnnounceMsghdr +pkg syscall (openbsd-386-cgo), type InterfaceMessage struct +pkg syscall (openbsd-386-cgo), type InterfaceMessage struct, Data []uint8 +pkg syscall (openbsd-386-cgo), type InterfaceMessage struct, Header IfMsghdr +pkg syscall (openbsd-386-cgo), type Iovec struct +pkg syscall (openbsd-386-cgo), type Iovec struct, Base *uint8 +pkg syscall (openbsd-386-cgo), type Iovec struct, Len uint32 +pkg syscall (openbsd-386-cgo), type Kevent_t struct +pkg syscall (openbsd-386-cgo), type Kevent_t struct, Data int32 +pkg syscall (openbsd-386-cgo), type Kevent_t struct, Fflags uint32 +pkg syscall (openbsd-386-cgo), type Kevent_t struct, Filter int16 +pkg syscall (openbsd-386-cgo), type Kevent_t struct, Flags uint16 +pkg syscall (openbsd-386-cgo), type Kevent_t struct, Ident uint32 +pkg syscall (openbsd-386-cgo), type Kevent_t struct, Udata *uint8 +pkg syscall (openbsd-386-cgo), type Mclpool struct +pkg syscall (openbsd-386-cgo), type Mclpool struct, Alive uint16 +pkg syscall (openbsd-386-cgo), type Mclpool struct, Cwm uint16 +pkg syscall (openbsd-386-cgo), type Mclpool struct, Grown uint32 +pkg syscall (openbsd-386-cgo), type Mclpool struct, Hwm uint16 +pkg syscall (openbsd-386-cgo), type Mclpool struct, Lwm uint16 +pkg syscall (openbsd-386-cgo), type Msghdr struct +pkg syscall (openbsd-386-cgo), type Msghdr struct, Control *uint8 +pkg syscall (openbsd-386-cgo), type Msghdr struct, Controllen uint32 +pkg syscall (openbsd-386-cgo), type Msghdr struct, Flags int32 +pkg syscall (openbsd-386-cgo), type Msghdr struct, Iov *Iovec +pkg syscall (openbsd-386-cgo), type Msghdr struct, Iovlen uint32 +pkg syscall (openbsd-386-cgo), type Msghdr struct, Name *uint8 +pkg syscall (openbsd-386-cgo), type Msghdr struct, Namelen uint32 +pkg syscall (openbsd-386-cgo), type RawSockaddr struct, Data [14]int8 +pkg syscall (openbsd-386-cgo), type RawSockaddr struct, Family uint8 +pkg syscall (openbsd-386-cgo), type RawSockaddr struct, Len uint8 +pkg syscall (openbsd-386-cgo), type RawSockaddrAny struct, Pad [92]int8 +pkg syscall (openbsd-386-cgo), type RawSockaddrDatalink struct +pkg syscall (openbsd-386-cgo), type RawSockaddrDatalink struct, Alen uint8 +pkg syscall (openbsd-386-cgo), type RawSockaddrDatalink struct, Data [24]int8 +pkg syscall (openbsd-386-cgo), type RawSockaddrDatalink struct, Family uint8 +pkg syscall (openbsd-386-cgo), type RawSockaddrDatalink struct, Index uint16 +pkg syscall (openbsd-386-cgo), type RawSockaddrDatalink struct, Len uint8 +pkg syscall (openbsd-386-cgo), type RawSockaddrDatalink struct, Nlen uint8 +pkg syscall (openbsd-386-cgo), type RawSockaddrDatalink struct, Slen uint8 +pkg syscall (openbsd-386-cgo), type RawSockaddrDatalink struct, Type uint8 +pkg syscall (openbsd-386-cgo), type RawSockaddrInet4 struct, Family uint8 +pkg syscall (openbsd-386-cgo), type RawSockaddrInet4 struct, Len uint8 +pkg syscall (openbsd-386-cgo), type RawSockaddrInet4 struct, Zero [8]int8 +pkg syscall (openbsd-386-cgo), type RawSockaddrInet6 struct, Family uint8 +pkg syscall (openbsd-386-cgo), type RawSockaddrInet6 struct, Len uint8 +pkg syscall (openbsd-386-cgo), type RawSockaddrUnix struct +pkg syscall (openbsd-386-cgo), type RawSockaddrUnix struct, Family uint8 +pkg syscall (openbsd-386-cgo), type RawSockaddrUnix struct, Len uint8 +pkg syscall (openbsd-386-cgo), type RawSockaddrUnix struct, Path [104]int8 +pkg syscall (openbsd-386-cgo), type Rlimit struct +pkg syscall (openbsd-386-cgo), type Rlimit struct, Cur uint64 +pkg syscall (openbsd-386-cgo), type Rlimit struct, Max uint64 +pkg syscall (openbsd-386-cgo), type RouteMessage struct +pkg syscall (openbsd-386-cgo), type RouteMessage struct, Data []uint8 +pkg syscall (openbsd-386-cgo), type RouteMessage struct, Header RtMsghdr +pkg syscall (openbsd-386-cgo), type RoutingMessage interface, unexported methods +pkg syscall (openbsd-386-cgo), type RtMetrics struct +pkg syscall (openbsd-386-cgo), type RtMetrics struct, Expire uint32 +pkg syscall (openbsd-386-cgo), type RtMetrics struct, Hopcount uint32 +pkg syscall (openbsd-386-cgo), type RtMetrics struct, Locks uint32 +pkg syscall (openbsd-386-cgo), type RtMetrics struct, Mtu uint32 +pkg syscall (openbsd-386-cgo), type RtMetrics struct, Pksent uint64 +pkg syscall (openbsd-386-cgo), type RtMetrics struct, Recvpipe uint32 +pkg syscall (openbsd-386-cgo), type RtMetrics struct, Refcnt uint32 +pkg syscall (openbsd-386-cgo), type RtMetrics struct, Rtt uint32 +pkg syscall (openbsd-386-cgo), type RtMetrics struct, Rttvar uint32 +pkg syscall (openbsd-386-cgo), type RtMetrics struct, Sendpipe uint32 +pkg syscall (openbsd-386-cgo), type RtMetrics struct, Ssthresh uint32 +pkg syscall (openbsd-386-cgo), type RtMsghdr struct +pkg syscall (openbsd-386-cgo), type RtMsghdr struct, Addrs int32 +pkg syscall (openbsd-386-cgo), type RtMsghdr struct, Errno int32 +pkg syscall (openbsd-386-cgo), type RtMsghdr struct, Flags int32 +pkg syscall (openbsd-386-cgo), type RtMsghdr struct, Fmask int32 +pkg syscall (openbsd-386-cgo), type RtMsghdr struct, Hdrlen uint16 +pkg syscall (openbsd-386-cgo), type RtMsghdr struct, Index uint16 +pkg syscall (openbsd-386-cgo), type RtMsghdr struct, Inits uint32 +pkg syscall (openbsd-386-cgo), type RtMsghdr struct, Mpls uint8 +pkg syscall (openbsd-386-cgo), type RtMsghdr struct, Msglen uint16 +pkg syscall (openbsd-386-cgo), type RtMsghdr struct, Pid int32 +pkg syscall (openbsd-386-cgo), type RtMsghdr struct, Priority uint8 +pkg syscall (openbsd-386-cgo), type RtMsghdr struct, Rmx RtMetrics +pkg syscall (openbsd-386-cgo), type RtMsghdr struct, Seq int32 +pkg syscall (openbsd-386-cgo), type RtMsghdr struct, Tableid uint16 +pkg syscall (openbsd-386-cgo), type RtMsghdr struct, Type uint8 +pkg syscall (openbsd-386-cgo), type RtMsghdr struct, Version uint8 +pkg syscall (openbsd-386-cgo), type Rusage struct, Idrss int32 +pkg syscall (openbsd-386-cgo), type Rusage struct, Inblock int32 +pkg syscall (openbsd-386-cgo), type Rusage struct, Isrss int32 +pkg syscall (openbsd-386-cgo), type Rusage struct, Ixrss int32 +pkg syscall (openbsd-386-cgo), type Rusage struct, Majflt int32 +pkg syscall (openbsd-386-cgo), type Rusage struct, Maxrss int32 +pkg syscall (openbsd-386-cgo), type Rusage struct, Minflt int32 +pkg syscall (openbsd-386-cgo), type Rusage struct, Msgrcv int32 +pkg syscall (openbsd-386-cgo), type Rusage struct, Msgsnd int32 +pkg syscall (openbsd-386-cgo), type Rusage struct, Nivcsw int32 +pkg syscall (openbsd-386-cgo), type Rusage struct, Nsignals int32 +pkg syscall (openbsd-386-cgo), type Rusage struct, Nswap int32 +pkg syscall (openbsd-386-cgo), type Rusage struct, Nvcsw int32 +pkg syscall (openbsd-386-cgo), type Rusage struct, Oublock int32 +pkg syscall (openbsd-386-cgo), type Rusage struct, Stime Timeval +pkg syscall (openbsd-386-cgo), type Rusage struct, Utime Timeval +pkg syscall (openbsd-386-cgo), type SockaddrDatalink struct +pkg syscall (openbsd-386-cgo), type SockaddrDatalink struct, Alen uint8 +pkg syscall (openbsd-386-cgo), type SockaddrDatalink struct, Data [24]int8 +pkg syscall (openbsd-386-cgo), type SockaddrDatalink struct, Family uint8 +pkg syscall (openbsd-386-cgo), type SockaddrDatalink struct, Index uint16 +pkg syscall (openbsd-386-cgo), type SockaddrDatalink struct, Len uint8 +pkg syscall (openbsd-386-cgo), type SockaddrDatalink struct, Nlen uint8 +pkg syscall (openbsd-386-cgo), type SockaddrDatalink struct, Slen uint8 +pkg syscall (openbsd-386-cgo), type SockaddrDatalink struct, Type uint8 +pkg syscall (openbsd-386-cgo), type SocketControlMessage struct +pkg syscall (openbsd-386-cgo), type SocketControlMessage struct, Data []uint8 +pkg syscall (openbsd-386-cgo), type SocketControlMessage struct, Header Cmsghdr +pkg syscall (openbsd-386-cgo), type Stat_t struct +pkg syscall (openbsd-386-cgo), type Stat_t struct, Atim Timespec +pkg syscall (openbsd-386-cgo), type Stat_t struct, Blksize uint32 +pkg syscall (openbsd-386-cgo), type Stat_t struct, Blocks int64 +pkg syscall (openbsd-386-cgo), type Stat_t struct, Ctim Timespec +pkg syscall (openbsd-386-cgo), type Stat_t struct, Dev int32 +pkg syscall (openbsd-386-cgo), type Stat_t struct, Flags uint32 +pkg syscall (openbsd-386-cgo), type Stat_t struct, Gen uint32 +pkg syscall (openbsd-386-cgo), type Stat_t struct, Gid uint32 +pkg syscall (openbsd-386-cgo), type Stat_t struct, Ino uint32 +pkg syscall (openbsd-386-cgo), type Stat_t struct, Lspare0 int32 +pkg syscall (openbsd-386-cgo), type Stat_t struct, Lspare1 int32 +pkg syscall (openbsd-386-cgo), type Stat_t struct, Mode uint32 +pkg syscall (openbsd-386-cgo), type Stat_t struct, Mtim Timespec +pkg syscall (openbsd-386-cgo), type Stat_t struct, Nlink uint32 +pkg syscall (openbsd-386-cgo), type Stat_t struct, Qspare [2]int64 +pkg syscall (openbsd-386-cgo), type Stat_t struct, Rdev int32 +pkg syscall (openbsd-386-cgo), type Stat_t struct, Size int64 +pkg syscall (openbsd-386-cgo), type Stat_t struct, Uid uint32 +pkg syscall (openbsd-386-cgo), type Stat_t struct, X__st_birthtim Timespec +pkg syscall (openbsd-386-cgo), type Statfs_t struct +pkg syscall (openbsd-386-cgo), type Statfs_t struct, F_asyncreads uint64 +pkg syscall (openbsd-386-cgo), type Statfs_t struct, F_asyncwrites uint64 +pkg syscall (openbsd-386-cgo), type Statfs_t struct, F_bavail int64 +pkg syscall (openbsd-386-cgo), type Statfs_t struct, F_bfree uint64 +pkg syscall (openbsd-386-cgo), type Statfs_t struct, F_blocks uint64 +pkg syscall (openbsd-386-cgo), type Statfs_t struct, F_bsize uint32 +pkg syscall (openbsd-386-cgo), type Statfs_t struct, F_ctime uint32 +pkg syscall (openbsd-386-cgo), type Statfs_t struct, F_favail int64 +pkg syscall (openbsd-386-cgo), type Statfs_t struct, F_ffree uint64 +pkg syscall (openbsd-386-cgo), type Statfs_t struct, F_files uint64 +pkg syscall (openbsd-386-cgo), type Statfs_t struct, F_flags uint32 +pkg syscall (openbsd-386-cgo), type Statfs_t struct, F_fsid Fsid +pkg syscall (openbsd-386-cgo), type Statfs_t struct, F_fstypename [16]int8 +pkg syscall (openbsd-386-cgo), type Statfs_t struct, F_iosize uint32 +pkg syscall (openbsd-386-cgo), type Statfs_t struct, F_mntfromname [90]int8 +pkg syscall (openbsd-386-cgo), type Statfs_t struct, F_mntonname [90]int8 +pkg syscall (openbsd-386-cgo), type Statfs_t struct, F_namemax uint32 +pkg syscall (openbsd-386-cgo), type Statfs_t struct, F_owner uint32 +pkg syscall (openbsd-386-cgo), type Statfs_t struct, F_spare [3]uint32 +pkg syscall (openbsd-386-cgo), type Statfs_t struct, F_syncreads uint64 +pkg syscall (openbsd-386-cgo), type Statfs_t struct, F_syncwrites uint64 +pkg syscall (openbsd-386-cgo), type Statfs_t struct, Mount_info [160]uint8 +pkg syscall (openbsd-386-cgo), type SysProcAttr struct, Chroot string +pkg syscall (openbsd-386-cgo), type SysProcAttr struct, Credential *Credential +pkg syscall (openbsd-386-cgo), type SysProcAttr struct, Noctty bool +pkg syscall (openbsd-386-cgo), type SysProcAttr struct, Ptrace bool +pkg syscall (openbsd-386-cgo), type SysProcAttr struct, Setctty bool +pkg syscall (openbsd-386-cgo), type SysProcAttr struct, Setpgid bool +pkg syscall (openbsd-386-cgo), type SysProcAttr struct, Setsid bool +pkg syscall (openbsd-386-cgo), type Timespec struct, Nsec int32 +pkg syscall (openbsd-386-cgo), type Timespec struct, Sec int32 +pkg syscall (openbsd-386-cgo), type Timeval struct, Sec int32 +pkg syscall (openbsd-386-cgo), type Timeval struct, Usec int32 +pkg syscall (openbsd-386-cgo), type WaitStatus uint32 +pkg syscall (openbsd-386-cgo), var Stderr int +pkg syscall (openbsd-386-cgo), var Stdin int +pkg syscall (openbsd-386-cgo), var Stdout int +pkg syscall (openbsd-amd64), const AF_APPLETALK ideal-int +pkg syscall (openbsd-amd64), const AF_BLUETOOTH ideal-int +pkg syscall (openbsd-amd64), const AF_CCITT ideal-int +pkg syscall (openbsd-amd64), const AF_CHAOS ideal-int +pkg syscall (openbsd-amd64), const AF_CNT ideal-int +pkg syscall (openbsd-amd64), const AF_COIP ideal-int +pkg syscall (openbsd-amd64), const AF_DATAKIT ideal-int +pkg syscall (openbsd-amd64), const AF_DECnet ideal-int +pkg syscall (openbsd-amd64), const AF_DLI ideal-int +pkg syscall (openbsd-amd64), const AF_E164 ideal-int +pkg syscall (openbsd-amd64), const AF_ECMA ideal-int +pkg syscall (openbsd-amd64), const AF_ENCAP ideal-int +pkg syscall (openbsd-amd64), const AF_HYLINK ideal-int +pkg syscall (openbsd-amd64), const AF_IMPLINK ideal-int +pkg syscall (openbsd-amd64), const AF_IPX ideal-int +pkg syscall (openbsd-amd64), const AF_ISDN ideal-int +pkg syscall (openbsd-amd64), const AF_ISO ideal-int +pkg syscall (openbsd-amd64), const AF_KEY ideal-int +pkg syscall (openbsd-amd64), const AF_LAT ideal-int +pkg syscall (openbsd-amd64), const AF_LINK ideal-int +pkg syscall (openbsd-amd64), const AF_LOCAL ideal-int +pkg syscall (openbsd-amd64), const AF_MAX ideal-int +pkg syscall (openbsd-amd64), const AF_MPLS ideal-int +pkg syscall (openbsd-amd64), const AF_NATM ideal-int +pkg syscall (openbsd-amd64), const AF_NS ideal-int +pkg syscall (openbsd-amd64), const AF_OSI ideal-int +pkg syscall (openbsd-amd64), const AF_PUP ideal-int +pkg syscall (openbsd-amd64), const AF_ROUTE ideal-int +pkg syscall (openbsd-amd64), const AF_SIP ideal-int +pkg syscall (openbsd-amd64), const AF_SNA ideal-int +pkg syscall (openbsd-amd64), const ARPHRD_ETHER ideal-int +pkg syscall (openbsd-amd64), const ARPHRD_FRELAY ideal-int +pkg syscall (openbsd-amd64), const ARPHRD_IEEE1394 ideal-int +pkg syscall (openbsd-amd64), const ARPHRD_IEEE802 ideal-int +pkg syscall (openbsd-amd64), const B0 ideal-int +pkg syscall (openbsd-amd64), const B110 ideal-int +pkg syscall (openbsd-amd64), const B115200 ideal-int +pkg syscall (openbsd-amd64), const B1200 ideal-int +pkg syscall (openbsd-amd64), const B134 ideal-int +pkg syscall (openbsd-amd64), const B14400 ideal-int +pkg syscall (openbsd-amd64), const B150 ideal-int +pkg syscall (openbsd-amd64), const B1800 ideal-int +pkg syscall (openbsd-amd64), const B19200 ideal-int +pkg syscall (openbsd-amd64), const B200 ideal-int +pkg syscall (openbsd-amd64), const B230400 ideal-int +pkg syscall (openbsd-amd64), const B2400 ideal-int +pkg syscall (openbsd-amd64), const B28800 ideal-int +pkg syscall (openbsd-amd64), const B300 ideal-int +pkg syscall (openbsd-amd64), const B38400 ideal-int +pkg syscall (openbsd-amd64), const B4800 ideal-int +pkg syscall (openbsd-amd64), const B50 ideal-int +pkg syscall (openbsd-amd64), const B57600 ideal-int +pkg syscall (openbsd-amd64), const B600 ideal-int +pkg syscall (openbsd-amd64), const B7200 ideal-int +pkg syscall (openbsd-amd64), const B75 ideal-int +pkg syscall (openbsd-amd64), const B76800 ideal-int +pkg syscall (openbsd-amd64), const B9600 ideal-int +pkg syscall (openbsd-amd64), const BIOCFLUSH ideal-int +pkg syscall (openbsd-amd64), const BIOCGBLEN ideal-int +pkg syscall (openbsd-amd64), const BIOCGDIRFILT ideal-int +pkg syscall (openbsd-amd64), const BIOCGDLT ideal-int +pkg syscall (openbsd-amd64), const BIOCGDLTLIST ideal-int +pkg syscall (openbsd-amd64), const BIOCGETIF ideal-int +pkg syscall (openbsd-amd64), const BIOCGFILDROP ideal-int +pkg syscall (openbsd-amd64), const BIOCGHDRCMPLT ideal-int +pkg syscall (openbsd-amd64), const BIOCGRSIG ideal-int +pkg syscall (openbsd-amd64), const BIOCGRTIMEOUT ideal-int +pkg syscall (openbsd-amd64), const BIOCGSTATS ideal-int +pkg syscall (openbsd-amd64), const BIOCIMMEDIATE ideal-int +pkg syscall (openbsd-amd64), const BIOCLOCK ideal-int +pkg syscall (openbsd-amd64), const BIOCPROMISC ideal-int +pkg syscall (openbsd-amd64), const BIOCSBLEN ideal-int +pkg syscall (openbsd-amd64), const BIOCSDIRFILT ideal-int +pkg syscall (openbsd-amd64), const BIOCSDLT ideal-int +pkg syscall (openbsd-amd64), const BIOCSETF ideal-int +pkg syscall (openbsd-amd64), const BIOCSETIF ideal-int +pkg syscall (openbsd-amd64), const BIOCSETWF ideal-int +pkg syscall (openbsd-amd64), const BIOCSFILDROP ideal-int +pkg syscall (openbsd-amd64), const BIOCSHDRCMPLT ideal-int +pkg syscall (openbsd-amd64), const BIOCSRSIG ideal-int +pkg syscall (openbsd-amd64), const BIOCSRTIMEOUT ideal-int +pkg syscall (openbsd-amd64), const BIOCVERSION ideal-int +pkg syscall (openbsd-amd64), const BPF_A ideal-int +pkg syscall (openbsd-amd64), const BPF_ABS ideal-int +pkg syscall (openbsd-amd64), const BPF_ADD ideal-int +pkg syscall (openbsd-amd64), const BPF_ALIGNMENT ideal-int +pkg syscall (openbsd-amd64), const BPF_ALU ideal-int +pkg syscall (openbsd-amd64), const BPF_AND ideal-int +pkg syscall (openbsd-amd64), const BPF_B ideal-int +pkg syscall (openbsd-amd64), const BPF_DIRECTION_IN ideal-int +pkg syscall (openbsd-amd64), const BPF_DIRECTION_OUT ideal-int +pkg syscall (openbsd-amd64), const BPF_DIV ideal-int +pkg syscall (openbsd-amd64), const BPF_H ideal-int +pkg syscall (openbsd-amd64), const BPF_IMM ideal-int +pkg syscall (openbsd-amd64), const BPF_IND ideal-int +pkg syscall (openbsd-amd64), const BPF_JA ideal-int +pkg syscall (openbsd-amd64), const BPF_JEQ ideal-int +pkg syscall (openbsd-amd64), const BPF_JGE ideal-int +pkg syscall (openbsd-amd64), const BPF_JGT ideal-int +pkg syscall (openbsd-amd64), const BPF_JMP ideal-int +pkg syscall (openbsd-amd64), const BPF_JSET ideal-int +pkg syscall (openbsd-amd64), const BPF_K ideal-int +pkg syscall (openbsd-amd64), const BPF_LD ideal-int +pkg syscall (openbsd-amd64), const BPF_LDX ideal-int +pkg syscall (openbsd-amd64), const BPF_LEN ideal-int +pkg syscall (openbsd-amd64), const BPF_LSH ideal-int +pkg syscall (openbsd-amd64), const BPF_MAJOR_VERSION ideal-int +pkg syscall (openbsd-amd64), const BPF_MAXBUFSIZE ideal-int +pkg syscall (openbsd-amd64), const BPF_MAXINSNS ideal-int +pkg syscall (openbsd-amd64), const BPF_MEM ideal-int +pkg syscall (openbsd-amd64), const BPF_MEMWORDS ideal-int +pkg syscall (openbsd-amd64), const BPF_MINBUFSIZE ideal-int +pkg syscall (openbsd-amd64), const BPF_MINOR_VERSION ideal-int +pkg syscall (openbsd-amd64), const BPF_MISC ideal-int +pkg syscall (openbsd-amd64), const BPF_MSH ideal-int +pkg syscall (openbsd-amd64), const BPF_MUL ideal-int +pkg syscall (openbsd-amd64), const BPF_NEG ideal-int +pkg syscall (openbsd-amd64), const BPF_OR ideal-int +pkg syscall (openbsd-amd64), const BPF_RELEASE ideal-int +pkg syscall (openbsd-amd64), const BPF_RET ideal-int +pkg syscall (openbsd-amd64), const BPF_RSH ideal-int +pkg syscall (openbsd-amd64), const BPF_ST ideal-int +pkg syscall (openbsd-amd64), const BPF_STX ideal-int +pkg syscall (openbsd-amd64), const BPF_SUB ideal-int +pkg syscall (openbsd-amd64), const BPF_TAX ideal-int +pkg syscall (openbsd-amd64), const BPF_TXA ideal-int +pkg syscall (openbsd-amd64), const BPF_W ideal-int +pkg syscall (openbsd-amd64), const BPF_X ideal-int +pkg syscall (openbsd-amd64), const BRKINT ideal-int +pkg syscall (openbsd-amd64), const CCR0_FLUSH ideal-int +pkg syscall (openbsd-amd64), const CFLUSH ideal-int +pkg syscall (openbsd-amd64), const CLOCAL ideal-int +pkg syscall (openbsd-amd64), const CPUID_CFLUSH ideal-int +pkg syscall (openbsd-amd64), const CREAD ideal-int +pkg syscall (openbsd-amd64), const CS5 ideal-int +pkg syscall (openbsd-amd64), const CS6 ideal-int +pkg syscall (openbsd-amd64), const CS7 ideal-int +pkg syscall (openbsd-amd64), const CS8 ideal-int +pkg syscall (openbsd-amd64), const CSIZE ideal-int +pkg syscall (openbsd-amd64), const CSTART ideal-int +pkg syscall (openbsd-amd64), const CSTATUS ideal-int +pkg syscall (openbsd-amd64), const CSTOP ideal-int +pkg syscall (openbsd-amd64), const CSTOPB ideal-int +pkg syscall (openbsd-amd64), const CSUSP ideal-int +pkg syscall (openbsd-amd64), const CTL_MAXNAME ideal-int +pkg syscall (openbsd-amd64), const CTL_NET ideal-int +pkg syscall (openbsd-amd64), const DIOCOSFPFLUSH ideal-int +pkg syscall (openbsd-amd64), const DLT_ARCNET ideal-int +pkg syscall (openbsd-amd64), const DLT_ATM_RFC1483 ideal-int +pkg syscall (openbsd-amd64), const DLT_AX25 ideal-int +pkg syscall (openbsd-amd64), const DLT_CHAOS ideal-int +pkg syscall (openbsd-amd64), const DLT_C_HDLC ideal-int +pkg syscall (openbsd-amd64), const DLT_EN10MB ideal-int +pkg syscall (openbsd-amd64), const DLT_EN3MB ideal-int +pkg syscall (openbsd-amd64), const DLT_ENC ideal-int +pkg syscall (openbsd-amd64), const DLT_FDDI ideal-int +pkg syscall (openbsd-amd64), const DLT_IEEE802 ideal-int +pkg syscall (openbsd-amd64), const DLT_IEEE802_11 ideal-int +pkg syscall (openbsd-amd64), const DLT_IEEE802_11_RADIO ideal-int +pkg syscall (openbsd-amd64), const DLT_LOOP ideal-int +pkg syscall (openbsd-amd64), const DLT_MPLS ideal-int +pkg syscall (openbsd-amd64), const DLT_NULL ideal-int +pkg syscall (openbsd-amd64), const DLT_PFLOG ideal-int +pkg syscall (openbsd-amd64), const DLT_PFSYNC ideal-int +pkg syscall (openbsd-amd64), const DLT_PPP ideal-int +pkg syscall (openbsd-amd64), const DLT_PPP_BSDOS ideal-int +pkg syscall (openbsd-amd64), const DLT_PPP_ETHER ideal-int +pkg syscall (openbsd-amd64), const DLT_PPP_SERIAL ideal-int +pkg syscall (openbsd-amd64), const DLT_PRONET ideal-int +pkg syscall (openbsd-amd64), const DLT_RAW ideal-int +pkg syscall (openbsd-amd64), const DLT_SLIP ideal-int +pkg syscall (openbsd-amd64), const DLT_SLIP_BSDOS ideal-int +pkg syscall (openbsd-amd64), const DT_BLK ideal-int +pkg syscall (openbsd-amd64), const DT_CHR ideal-int +pkg syscall (openbsd-amd64), const DT_DIR ideal-int +pkg syscall (openbsd-amd64), const DT_FIFO ideal-int +pkg syscall (openbsd-amd64), const DT_LNK ideal-int +pkg syscall (openbsd-amd64), const DT_REG ideal-int +pkg syscall (openbsd-amd64), const DT_SOCK ideal-int +pkg syscall (openbsd-amd64), const DT_UNKNOWN ideal-int +pkg syscall (openbsd-amd64), const EAUTH Errno +pkg syscall (openbsd-amd64), const EBADRPC Errno +pkg syscall (openbsd-amd64), const ECHO ideal-int +pkg syscall (openbsd-amd64), const ECHOCTL ideal-int +pkg syscall (openbsd-amd64), const ECHOE ideal-int +pkg syscall (openbsd-amd64), const ECHOK ideal-int +pkg syscall (openbsd-amd64), const ECHOKE ideal-int +pkg syscall (openbsd-amd64), const ECHONL ideal-int +pkg syscall (openbsd-amd64), const ECHOPRT ideal-int +pkg syscall (openbsd-amd64), const EFER_LMA ideal-int +pkg syscall (openbsd-amd64), const EFER_LME ideal-int +pkg syscall (openbsd-amd64), const EFER_NXE ideal-int +pkg syscall (openbsd-amd64), const EFER_SCE ideal-int +pkg syscall (openbsd-amd64), const EFTYPE Errno +pkg syscall (openbsd-amd64), const EIPSEC Errno +pkg syscall (openbsd-amd64), const ELAST Errno +pkg syscall (openbsd-amd64), const EMEDIUMTYPE Errno +pkg syscall (openbsd-amd64), const EMT_TAGOVF ideal-int +pkg syscall (openbsd-amd64), const EMUL_ENABLED ideal-int +pkg syscall (openbsd-amd64), const EMUL_NATIVE ideal-int +pkg syscall (openbsd-amd64), const ENDRUNDISC ideal-int +pkg syscall (openbsd-amd64), const ENEEDAUTH Errno +pkg syscall (openbsd-amd64), const ENOATTR Errno +pkg syscall (openbsd-amd64), const ENOMEDIUM Errno +pkg syscall (openbsd-amd64), const EPROCLIM Errno +pkg syscall (openbsd-amd64), const EPROCUNAVAIL Errno +pkg syscall (openbsd-amd64), const EPROGMISMATCH Errno +pkg syscall (openbsd-amd64), const EPROGUNAVAIL Errno +pkg syscall (openbsd-amd64), const ERPCMISMATCH Errno +pkg syscall (openbsd-amd64), const ETHERMIN ideal-int +pkg syscall (openbsd-amd64), const ETHERMTU ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_8023 ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_AARP ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_ACCTON ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_AEONIC ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_ALPHA ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_AMBER ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_AMOEBA ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_AOE ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_APOLLO ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_APOLLODOMAIN ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_APPLETALK ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_APPLITEK ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_ARGONAUT ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_ARP ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_AT ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_ATALK ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_ATOMIC ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_ATT ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_ATTSTANFORD ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_AUTOPHON ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_AXIS ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_BCLOOP ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_BOFL ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_CABLETRON ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_CHAOS ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_COMDESIGN ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_COMPUGRAPHIC ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_COUNTERPOINT ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_CRONUS ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_CRONUSVLN ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_DCA ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_DDE ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_DEBNI ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_DECAM ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_DECCUST ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_DECDIAG ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_DECDNS ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_DECDTS ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_DECEXPER ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_DECLAST ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_DECLTM ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_DECMUMPS ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_DECNETBIOS ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_DELTACON ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_DIDDLE ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_DLOG1 ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_DLOG2 ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_DN ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_DOGFIGHT ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_DSMD ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_ECMA ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_ENCRYPT ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_ES ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_EXCELAN ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_EXPERDATA ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_FLIP ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_FLOWCONTROL ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_FRARP ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_GENDYN ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_HAYES ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_HIPPI_FP ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_HITACHI ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_HP ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_IEEEPUP ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_IEEEPUPAT ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_IMLBL ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_IMLBLDIAG ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_IP ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_IPAS ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_IPV6 ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_IPX ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_IPXNEW ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_KALPANA ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_LANBRIDGE ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_LANPROBE ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_LAT ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_LBACK ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_LITTLE ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_LLDP ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_LOGICRAFT ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_LOOPBACK ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_MATRA ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_MAX ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_MERIT ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_MICP ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_MOPDL ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_MOPRC ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_MOTOROLA ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_MPLS ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_MPLS_MCAST ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_MUMPS ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_NBPCC ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_NBPCLAIM ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_NBPCLREQ ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_NBPCLRSP ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_NBPCREQ ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_NBPCRSP ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_NBPDG ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_NBPDGB ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_NBPDLTE ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_NBPRAR ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_NBPRAS ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_NBPRST ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_NBPSCD ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_NBPVCD ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_NBS ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_NCD ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_NESTAR ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_NETBEUI ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_NOVELL ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_NS ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_NSAT ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_NSCOMPAT ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_NTRAILER ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_OS9 ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_OS9NET ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_PACER ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_PAE ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_PCS ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_PLANNING ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_PPP ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_PPPOE ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_PPPOEDISC ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_PRIMENTS ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_PUP ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_PUPAT ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_QINQ ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_RACAL ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_RATIONAL ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_RAWFR ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_RCL ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_RDP ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_RETIX ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_REVARP ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_SCA ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_SECTRA ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_SECUREDATA ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_SGITW ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_SG_BOUNCE ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_SG_DIAG ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_SG_NETGAMES ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_SG_RESV ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_SIMNET ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_SLOW ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_SNA ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_SNMP ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_SONIX ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_SPIDER ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_SPRITE ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_STP ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_TALARIS ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_TALARISMC ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_TCPCOMP ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_TCPSM ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_TEC ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_TIGAN ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_TRAIL ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_TRANSETHER ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_TYMSHARE ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_UBBST ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_UBDEBUG ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_UBDIAGLOOP ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_UBDL ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_UBNIU ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_UBNMC ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_VALID ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_VARIAN ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_VAXELN ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_VEECO ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_VEXP ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_VGLAB ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_VINES ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_VINESECHO ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_VINESLOOP ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_VITAL ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_VLAN ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_VLTLMAN ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_VPROD ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_VURESERVED ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_WATERLOO ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_WELLFLEET ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_X25 ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_X75 ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_XNSSM ideal-int +pkg syscall (openbsd-amd64), const ETHERTYPE_XTP ideal-int +pkg syscall (openbsd-amd64), const ETHER_ADDR_LEN ideal-int +pkg syscall (openbsd-amd64), const ETHER_ALIGN ideal-int +pkg syscall (openbsd-amd64), const ETHER_CRC_LEN ideal-int +pkg syscall (openbsd-amd64), const ETHER_CRC_POLY_BE ideal-int +pkg syscall (openbsd-amd64), const ETHER_CRC_POLY_LE ideal-int +pkg syscall (openbsd-amd64), const ETHER_HDR_LEN ideal-int +pkg syscall (openbsd-amd64), const ETHER_MAX_DIX_LEN ideal-int +pkg syscall (openbsd-amd64), const ETHER_MAX_LEN ideal-int +pkg syscall (openbsd-amd64), const ETHER_MIN_LEN ideal-int +pkg syscall (openbsd-amd64), const ETHER_TYPE_LEN ideal-int +pkg syscall (openbsd-amd64), const ETHER_VLAN_ENCAP_LEN ideal-int +pkg syscall (openbsd-amd64), const EVFILT_AIO ideal-int +pkg syscall (openbsd-amd64), const EVFILT_PROC ideal-int +pkg syscall (openbsd-amd64), const EVFILT_READ ideal-int +pkg syscall (openbsd-amd64), const EVFILT_SIGNAL ideal-int +pkg syscall (openbsd-amd64), const EVFILT_SYSCOUNT ideal-int +pkg syscall (openbsd-amd64), const EVFILT_TIMER ideal-int +pkg syscall (openbsd-amd64), const EVFILT_VNODE ideal-int +pkg syscall (openbsd-amd64), const EVFILT_WRITE ideal-int +pkg syscall (openbsd-amd64), const EV_ADD ideal-int +pkg syscall (openbsd-amd64), const EV_CLEAR ideal-int +pkg syscall (openbsd-amd64), const EV_DELETE ideal-int +pkg syscall (openbsd-amd64), const EV_DISABLE ideal-int +pkg syscall (openbsd-amd64), const EV_ENABLE ideal-int +pkg syscall (openbsd-amd64), const EV_EOF ideal-int +pkg syscall (openbsd-amd64), const EV_ERROR ideal-int +pkg syscall (openbsd-amd64), const EV_FLAG1 ideal-int +pkg syscall (openbsd-amd64), const EV_ONESHOT ideal-int +pkg syscall (openbsd-amd64), const EV_SYSFLAGS ideal-int +pkg syscall (openbsd-amd64), const EXTA ideal-int +pkg syscall (openbsd-amd64), const EXTB ideal-int +pkg syscall (openbsd-amd64), const EXTPROC ideal-int +pkg syscall (openbsd-amd64), const FD_CLOEXEC ideal-int +pkg syscall (openbsd-amd64), const FD_SETSIZE ideal-int +pkg syscall (openbsd-amd64), const FLUSHO ideal-int +pkg syscall (openbsd-amd64), const F_DUPFD ideal-int +pkg syscall (openbsd-amd64), const F_DUPFD_CLOEXEC ideal-int +pkg syscall (openbsd-amd64), const F_GETFD ideal-int +pkg syscall (openbsd-amd64), const F_GETFL ideal-int +pkg syscall (openbsd-amd64), const F_GETLK ideal-int +pkg syscall (openbsd-amd64), const F_GETOWN ideal-int +pkg syscall (openbsd-amd64), const F_OK ideal-int +pkg syscall (openbsd-amd64), const F_RDLCK ideal-int +pkg syscall (openbsd-amd64), const F_SETFD ideal-int +pkg syscall (openbsd-amd64), const F_SETFL ideal-int +pkg syscall (openbsd-amd64), const F_SETLK ideal-int +pkg syscall (openbsd-amd64), const F_SETLKW ideal-int +pkg syscall (openbsd-amd64), const F_SETOWN ideal-int +pkg syscall (openbsd-amd64), const F_UNLCK ideal-int +pkg syscall (openbsd-amd64), const F_WRLCK ideal-int +pkg syscall (openbsd-amd64), const HUPCL ideal-int +pkg syscall (openbsd-amd64), const ICANON ideal-int +pkg syscall (openbsd-amd64), const ICMP6_FILTER = 18 +pkg syscall (openbsd-amd64), const ICMP6_FILTER ideal-int +pkg syscall (openbsd-amd64), const ICRNL ideal-int +pkg syscall (openbsd-amd64), const IEXTEN ideal-int +pkg syscall (openbsd-amd64), const IFAN_ARRIVAL ideal-int +pkg syscall (openbsd-amd64), const IFAN_DEPARTURE ideal-int +pkg syscall (openbsd-amd64), const IFA_ROUTE ideal-int +pkg syscall (openbsd-amd64), const IFF_ALLMULTI ideal-int +pkg syscall (openbsd-amd64), const IFF_CANTCHANGE ideal-int +pkg syscall (openbsd-amd64), const IFF_DEBUG ideal-int +pkg syscall (openbsd-amd64), const IFF_LINK0 ideal-int +pkg syscall (openbsd-amd64), const IFF_LINK1 ideal-int +pkg syscall (openbsd-amd64), const IFF_LINK2 ideal-int +pkg syscall (openbsd-amd64), const IFF_NOARP ideal-int +pkg syscall (openbsd-amd64), const IFF_NOTRAILERS ideal-int +pkg syscall (openbsd-amd64), const IFF_OACTIVE ideal-int +pkg syscall (openbsd-amd64), const IFF_POINTOPOINT ideal-int +pkg syscall (openbsd-amd64), const IFF_PROMISC ideal-int +pkg syscall (openbsd-amd64), const IFF_RUNNING ideal-int +pkg syscall (openbsd-amd64), const IFF_SIMPLEX ideal-int +pkg syscall (openbsd-amd64), const IFNAMSIZ ideal-int +pkg syscall (openbsd-amd64), const IFT_1822 ideal-int +pkg syscall (openbsd-amd64), const IFT_A12MPPSWITCH ideal-int +pkg syscall (openbsd-amd64), const IFT_AAL2 ideal-int +pkg syscall (openbsd-amd64), const IFT_AAL5 ideal-int +pkg syscall (openbsd-amd64), const IFT_ADSL ideal-int +pkg syscall (openbsd-amd64), const IFT_AFLANE8023 ideal-int +pkg syscall (openbsd-amd64), const IFT_AFLANE8025 ideal-int +pkg syscall (openbsd-amd64), const IFT_ARAP ideal-int +pkg syscall (openbsd-amd64), const IFT_ARCNET ideal-int +pkg syscall (openbsd-amd64), const IFT_ARCNETPLUS ideal-int +pkg syscall (openbsd-amd64), const IFT_ASYNC ideal-int +pkg syscall (openbsd-amd64), const IFT_ATM ideal-int +pkg syscall (openbsd-amd64), const IFT_ATMDXI ideal-int +pkg syscall (openbsd-amd64), const IFT_ATMFUNI ideal-int +pkg syscall (openbsd-amd64), const IFT_ATMIMA ideal-int +pkg syscall (openbsd-amd64), const IFT_ATMLOGICAL ideal-int +pkg syscall (openbsd-amd64), const IFT_ATMRADIO ideal-int +pkg syscall (openbsd-amd64), const IFT_ATMSUBINTERFACE ideal-int +pkg syscall (openbsd-amd64), const IFT_ATMVCIENDPT ideal-int +pkg syscall (openbsd-amd64), const IFT_ATMVIRTUAL ideal-int +pkg syscall (openbsd-amd64), const IFT_BGPPOLICYACCOUNTING ideal-int +pkg syscall (openbsd-amd64), const IFT_BLUETOOTH ideal-int +pkg syscall (openbsd-amd64), const IFT_BRIDGE ideal-int +pkg syscall (openbsd-amd64), const IFT_BSC ideal-int +pkg syscall (openbsd-amd64), const IFT_CARP ideal-int +pkg syscall (openbsd-amd64), const IFT_CCTEMUL ideal-int +pkg syscall (openbsd-amd64), const IFT_CEPT ideal-int +pkg syscall (openbsd-amd64), const IFT_CES ideal-int +pkg syscall (openbsd-amd64), const IFT_CHANNEL ideal-int +pkg syscall (openbsd-amd64), const IFT_CNR ideal-int +pkg syscall (openbsd-amd64), const IFT_COFFEE ideal-int +pkg syscall (openbsd-amd64), const IFT_COMPOSITELINK ideal-int +pkg syscall (openbsd-amd64), const IFT_DCN ideal-int +pkg syscall (openbsd-amd64), const IFT_DIGITALPOWERLINE ideal-int +pkg syscall (openbsd-amd64), const IFT_DIGITALWRAPPEROVERHEADCHANNEL ideal-int +pkg syscall (openbsd-amd64), const IFT_DLSW ideal-int +pkg syscall (openbsd-amd64), const IFT_DOCSCABLEDOWNSTREAM ideal-int +pkg syscall (openbsd-amd64), const IFT_DOCSCABLEMACLAYER ideal-int +pkg syscall (openbsd-amd64), const IFT_DOCSCABLEUPSTREAM ideal-int +pkg syscall (openbsd-amd64), const IFT_DOCSCABLEUPSTREAMCHANNEL ideal-int +pkg syscall (openbsd-amd64), const IFT_DS0 ideal-int +pkg syscall (openbsd-amd64), const IFT_DS0BUNDLE ideal-int +pkg syscall (openbsd-amd64), const IFT_DS1FDL ideal-int +pkg syscall (openbsd-amd64), const IFT_DS3 ideal-int +pkg syscall (openbsd-amd64), const IFT_DTM ideal-int +pkg syscall (openbsd-amd64), const IFT_DUMMY ideal-int +pkg syscall (openbsd-amd64), const IFT_DVBASILN ideal-int +pkg syscall (openbsd-amd64), const IFT_DVBASIOUT ideal-int +pkg syscall (openbsd-amd64), const IFT_DVBRCCDOWNSTREAM ideal-int +pkg syscall (openbsd-amd64), const IFT_DVBRCCMACLAYER ideal-int +pkg syscall (openbsd-amd64), const IFT_DVBRCCUPSTREAM ideal-int +pkg syscall (openbsd-amd64), const IFT_ECONET ideal-int +pkg syscall (openbsd-amd64), const IFT_ENC ideal-int +pkg syscall (openbsd-amd64), const IFT_EON ideal-int +pkg syscall (openbsd-amd64), const IFT_EPLRS ideal-int +pkg syscall (openbsd-amd64), const IFT_ESCON ideal-int +pkg syscall (openbsd-amd64), const IFT_ETHER ideal-int +pkg syscall (openbsd-amd64), const IFT_FAITH ideal-int +pkg syscall (openbsd-amd64), const IFT_FAST ideal-int +pkg syscall (openbsd-amd64), const IFT_FASTETHER ideal-int +pkg syscall (openbsd-amd64), const IFT_FASTETHERFX ideal-int +pkg syscall (openbsd-amd64), const IFT_FDDI ideal-int +pkg syscall (openbsd-amd64), const IFT_FIBRECHANNEL ideal-int +pkg syscall (openbsd-amd64), const IFT_FRAMERELAYINTERCONNECT ideal-int +pkg syscall (openbsd-amd64), const IFT_FRAMERELAYMPI ideal-int +pkg syscall (openbsd-amd64), const IFT_FRDLCIENDPT ideal-int +pkg syscall (openbsd-amd64), const IFT_FRELAY ideal-int +pkg syscall (openbsd-amd64), const IFT_FRELAYDCE ideal-int +pkg syscall (openbsd-amd64), const IFT_FRF16MFRBUNDLE ideal-int +pkg syscall (openbsd-amd64), const IFT_FRFORWARD ideal-int +pkg syscall (openbsd-amd64), const IFT_G703AT2MB ideal-int +pkg syscall (openbsd-amd64), const IFT_G703AT64K ideal-int +pkg syscall (openbsd-amd64), const IFT_GIF ideal-int +pkg syscall (openbsd-amd64), const IFT_GIGABITETHERNET ideal-int +pkg syscall (openbsd-amd64), const IFT_GR303IDT ideal-int +pkg syscall (openbsd-amd64), const IFT_GR303RDT ideal-int +pkg syscall (openbsd-amd64), const IFT_H323GATEKEEPER ideal-int +pkg syscall (openbsd-amd64), const IFT_H323PROXY ideal-int +pkg syscall (openbsd-amd64), const IFT_HDH1822 ideal-int +pkg syscall (openbsd-amd64), const IFT_HDLC ideal-int +pkg syscall (openbsd-amd64), const IFT_HDSL2 ideal-int +pkg syscall (openbsd-amd64), const IFT_HIPERLAN2 ideal-int +pkg syscall (openbsd-amd64), const IFT_HIPPI ideal-int +pkg syscall (openbsd-amd64), const IFT_HIPPIINTERFACE ideal-int +pkg syscall (openbsd-amd64), const IFT_HOSTPAD ideal-int +pkg syscall (openbsd-amd64), const IFT_HSSI ideal-int +pkg syscall (openbsd-amd64), const IFT_HY ideal-int +pkg syscall (openbsd-amd64), const IFT_IBM370PARCHAN ideal-int +pkg syscall (openbsd-amd64), const IFT_IDSL ideal-int +pkg syscall (openbsd-amd64), const IFT_IEEE1394 ideal-int +pkg syscall (openbsd-amd64), const IFT_IEEE80211 ideal-int +pkg syscall (openbsd-amd64), const IFT_IEEE80212 ideal-int +pkg syscall (openbsd-amd64), const IFT_IEEE8023ADLAG ideal-int +pkg syscall (openbsd-amd64), const IFT_IFGSN ideal-int +pkg syscall (openbsd-amd64), const IFT_IMT ideal-int +pkg syscall (openbsd-amd64), const IFT_INFINIBAND ideal-int +pkg syscall (openbsd-amd64), const IFT_INTERLEAVE ideal-int +pkg syscall (openbsd-amd64), const IFT_IP ideal-int +pkg syscall (openbsd-amd64), const IFT_IPFORWARD ideal-int +pkg syscall (openbsd-amd64), const IFT_IPOVERATM ideal-int +pkg syscall (openbsd-amd64), const IFT_IPOVERCDLC ideal-int +pkg syscall (openbsd-amd64), const IFT_IPOVERCLAW ideal-int +pkg syscall (openbsd-amd64), const IFT_IPSWITCH ideal-int +pkg syscall (openbsd-amd64), const IFT_ISDN ideal-int +pkg syscall (openbsd-amd64), const IFT_ISDNBASIC ideal-int +pkg syscall (openbsd-amd64), const IFT_ISDNPRIMARY ideal-int +pkg syscall (openbsd-amd64), const IFT_ISDNS ideal-int +pkg syscall (openbsd-amd64), const IFT_ISDNU ideal-int +pkg syscall (openbsd-amd64), const IFT_ISO88022LLC ideal-int +pkg syscall (openbsd-amd64), const IFT_ISO88023 ideal-int +pkg syscall (openbsd-amd64), const IFT_ISO88024 ideal-int +pkg syscall (openbsd-amd64), const IFT_ISO88025 ideal-int +pkg syscall (openbsd-amd64), const IFT_ISO88025CRFPINT ideal-int +pkg syscall (openbsd-amd64), const IFT_ISO88025DTR ideal-int +pkg syscall (openbsd-amd64), const IFT_ISO88025FIBER ideal-int +pkg syscall (openbsd-amd64), const IFT_ISO88026 ideal-int +pkg syscall (openbsd-amd64), const IFT_ISUP ideal-int +pkg syscall (openbsd-amd64), const IFT_L2VLAN ideal-int +pkg syscall (openbsd-amd64), const IFT_L3IPVLAN ideal-int +pkg syscall (openbsd-amd64), const IFT_L3IPXVLAN ideal-int +pkg syscall (openbsd-amd64), const IFT_LAPB ideal-int +pkg syscall (openbsd-amd64), const IFT_LAPD ideal-int +pkg syscall (openbsd-amd64), const IFT_LAPF ideal-int +pkg syscall (openbsd-amd64), const IFT_LINEGROUP ideal-int +pkg syscall (openbsd-amd64), const IFT_LOCALTALK ideal-int +pkg syscall (openbsd-amd64), const IFT_LOOP ideal-int +pkg syscall (openbsd-amd64), const IFT_MEDIAMAILOVERIP ideal-int +pkg syscall (openbsd-amd64), const IFT_MFSIGLINK ideal-int +pkg syscall (openbsd-amd64), const IFT_MIOX25 ideal-int +pkg syscall (openbsd-amd64), const IFT_MODEM ideal-int +pkg syscall (openbsd-amd64), const IFT_MPC ideal-int +pkg syscall (openbsd-amd64), const IFT_MPLS ideal-int +pkg syscall (openbsd-amd64), const IFT_MPLSTUNNEL ideal-int +pkg syscall (openbsd-amd64), const IFT_MSDSL ideal-int +pkg syscall (openbsd-amd64), const IFT_MVL ideal-int +pkg syscall (openbsd-amd64), const IFT_MYRINET ideal-int +pkg syscall (openbsd-amd64), const IFT_NFAS ideal-int +pkg syscall (openbsd-amd64), const IFT_NSIP ideal-int +pkg syscall (openbsd-amd64), const IFT_OPTICALCHANNEL ideal-int +pkg syscall (openbsd-amd64), const IFT_OPTICALTRANSPORT ideal-int +pkg syscall (openbsd-amd64), const IFT_OTHER ideal-int +pkg syscall (openbsd-amd64), const IFT_P10 ideal-int +pkg syscall (openbsd-amd64), const IFT_P80 ideal-int +pkg syscall (openbsd-amd64), const IFT_PARA ideal-int +pkg syscall (openbsd-amd64), const IFT_PFLOG ideal-int +pkg syscall (openbsd-amd64), const IFT_PFLOW ideal-int +pkg syscall (openbsd-amd64), const IFT_PFSYNC ideal-int +pkg syscall (openbsd-amd64), const IFT_PLC ideal-int +pkg syscall (openbsd-amd64), const IFT_PON155 ideal-int +pkg syscall (openbsd-amd64), const IFT_PON622 ideal-int +pkg syscall (openbsd-amd64), const IFT_POS ideal-int +pkg syscall (openbsd-amd64), const IFT_PPP ideal-int +pkg syscall (openbsd-amd64), const IFT_PPPMULTILINKBUNDLE ideal-int +pkg syscall (openbsd-amd64), const IFT_PROPATM ideal-int +pkg syscall (openbsd-amd64), const IFT_PROPBWAP2MP ideal-int +pkg syscall (openbsd-amd64), const IFT_PROPCNLS ideal-int +pkg syscall (openbsd-amd64), const IFT_PROPDOCSWIRELESSDOWNSTREAM ideal-int +pkg syscall (openbsd-amd64), const IFT_PROPDOCSWIRELESSMACLAYER ideal-int +pkg syscall (openbsd-amd64), const IFT_PROPDOCSWIRELESSUPSTREAM ideal-int +pkg syscall (openbsd-amd64), const IFT_PROPMUX ideal-int +pkg syscall (openbsd-amd64), const IFT_PROPVIRTUAL ideal-int +pkg syscall (openbsd-amd64), const IFT_PROPWIRELESSP2P ideal-int +pkg syscall (openbsd-amd64), const IFT_PTPSERIAL ideal-int +pkg syscall (openbsd-amd64), const IFT_PVC ideal-int +pkg syscall (openbsd-amd64), const IFT_Q2931 ideal-int +pkg syscall (openbsd-amd64), const IFT_QLLC ideal-int +pkg syscall (openbsd-amd64), const IFT_RADIOMAC ideal-int +pkg syscall (openbsd-amd64), const IFT_RADSL ideal-int +pkg syscall (openbsd-amd64), const IFT_REACHDSL ideal-int +pkg syscall (openbsd-amd64), const IFT_RFC1483 ideal-int +pkg syscall (openbsd-amd64), const IFT_RS232 ideal-int +pkg syscall (openbsd-amd64), const IFT_RSRB ideal-int +pkg syscall (openbsd-amd64), const IFT_SDLC ideal-int +pkg syscall (openbsd-amd64), const IFT_SDSL ideal-int +pkg syscall (openbsd-amd64), const IFT_SHDSL ideal-int +pkg syscall (openbsd-amd64), const IFT_SIP ideal-int +pkg syscall (openbsd-amd64), const IFT_SIPSIG ideal-int +pkg syscall (openbsd-amd64), const IFT_SIPTG ideal-int +pkg syscall (openbsd-amd64), const IFT_SLIP ideal-int +pkg syscall (openbsd-amd64), const IFT_SMDSDXI ideal-int +pkg syscall (openbsd-amd64), const IFT_SMDSICIP ideal-int +pkg syscall (openbsd-amd64), const IFT_SONET ideal-int +pkg syscall (openbsd-amd64), const IFT_SONETOVERHEADCHANNEL ideal-int +pkg syscall (openbsd-amd64), const IFT_SONETPATH ideal-int +pkg syscall (openbsd-amd64), const IFT_SONETVT ideal-int +pkg syscall (openbsd-amd64), const IFT_SRP ideal-int +pkg syscall (openbsd-amd64), const IFT_SS7SIGLINK ideal-int +pkg syscall (openbsd-amd64), const IFT_STACKTOSTACK ideal-int +pkg syscall (openbsd-amd64), const IFT_STARLAN ideal-int +pkg syscall (openbsd-amd64), const IFT_T1 ideal-int +pkg syscall (openbsd-amd64), const IFT_TDLC ideal-int +pkg syscall (openbsd-amd64), const IFT_TELINK ideal-int +pkg syscall (openbsd-amd64), const IFT_TERMPAD ideal-int +pkg syscall (openbsd-amd64), const IFT_TR008 ideal-int +pkg syscall (openbsd-amd64), const IFT_TRANSPHDLC ideal-int +pkg syscall (openbsd-amd64), const IFT_TUNNEL ideal-int +pkg syscall (openbsd-amd64), const IFT_ULTRA ideal-int +pkg syscall (openbsd-amd64), const IFT_USB ideal-int +pkg syscall (openbsd-amd64), const IFT_V11 ideal-int +pkg syscall (openbsd-amd64), const IFT_V35 ideal-int +pkg syscall (openbsd-amd64), const IFT_V36 ideal-int +pkg syscall (openbsd-amd64), const IFT_V37 ideal-int +pkg syscall (openbsd-amd64), const IFT_VDSL ideal-int +pkg syscall (openbsd-amd64), const IFT_VIRTUALIPADDRESS ideal-int +pkg syscall (openbsd-amd64), const IFT_VIRTUALTG ideal-int +pkg syscall (openbsd-amd64), const IFT_VOICEDID ideal-int +pkg syscall (openbsd-amd64), const IFT_VOICEEM ideal-int +pkg syscall (openbsd-amd64), const IFT_VOICEEMFGD ideal-int +pkg syscall (openbsd-amd64), const IFT_VOICEENCAP ideal-int +pkg syscall (openbsd-amd64), const IFT_VOICEFGDEANA ideal-int +pkg syscall (openbsd-amd64), const IFT_VOICEFXO ideal-int +pkg syscall (openbsd-amd64), const IFT_VOICEFXS ideal-int +pkg syscall (openbsd-amd64), const IFT_VOICEOVERATM ideal-int +pkg syscall (openbsd-amd64), const IFT_VOICEOVERCABLE ideal-int +pkg syscall (openbsd-amd64), const IFT_VOICEOVERFRAMERELAY ideal-int +pkg syscall (openbsd-amd64), const IFT_VOICEOVERIP ideal-int +pkg syscall (openbsd-amd64), const IFT_X213 ideal-int +pkg syscall (openbsd-amd64), const IFT_X25 ideal-int +pkg syscall (openbsd-amd64), const IFT_X25DDN ideal-int +pkg syscall (openbsd-amd64), const IFT_X25HUNTGROUP ideal-int +pkg syscall (openbsd-amd64), const IFT_X25MLP ideal-int +pkg syscall (openbsd-amd64), const IFT_X25PLE ideal-int +pkg syscall (openbsd-amd64), const IFT_XETHER ideal-int +pkg syscall (openbsd-amd64), const IGNBRK ideal-int +pkg syscall (openbsd-amd64), const IGNCR ideal-int +pkg syscall (openbsd-amd64), const IGNPAR ideal-int +pkg syscall (openbsd-amd64), const IMAXBEL ideal-int +pkg syscall (openbsd-amd64), const INLCR ideal-int +pkg syscall (openbsd-amd64), const INPCK ideal-int +pkg syscall (openbsd-amd64), const IN_CLASSA_HOST ideal-int +pkg syscall (openbsd-amd64), const IN_CLASSA_MAX ideal-int +pkg syscall (openbsd-amd64), const IN_CLASSA_NET ideal-int +pkg syscall (openbsd-amd64), const IN_CLASSA_NSHIFT ideal-int +pkg syscall (openbsd-amd64), const IN_CLASSB_HOST ideal-int +pkg syscall (openbsd-amd64), const IN_CLASSB_MAX ideal-int +pkg syscall (openbsd-amd64), const IN_CLASSB_NET ideal-int +pkg syscall (openbsd-amd64), const IN_CLASSB_NSHIFT ideal-int +pkg syscall (openbsd-amd64), const IN_CLASSC_HOST ideal-int +pkg syscall (openbsd-amd64), const IN_CLASSC_NET ideal-int +pkg syscall (openbsd-amd64), const IN_CLASSC_NSHIFT ideal-int +pkg syscall (openbsd-amd64), const IN_CLASSD_HOST ideal-int +pkg syscall (openbsd-amd64), const IN_CLASSD_NET ideal-int +pkg syscall (openbsd-amd64), const IN_CLASSD_NSHIFT ideal-int +pkg syscall (openbsd-amd64), const IN_LOOPBACKNET ideal-int +pkg syscall (openbsd-amd64), const IN_RFC3021_HOST ideal-int +pkg syscall (openbsd-amd64), const IN_RFC3021_NET ideal-int +pkg syscall (openbsd-amd64), const IN_RFC3021_NSHIFT ideal-int +pkg syscall (openbsd-amd64), const IPPROTO_AH ideal-int +pkg syscall (openbsd-amd64), const IPPROTO_CARP ideal-int +pkg syscall (openbsd-amd64), const IPPROTO_DIVERT ideal-int +pkg syscall (openbsd-amd64), const IPPROTO_DONE ideal-int +pkg syscall (openbsd-amd64), const IPPROTO_DSTOPTS ideal-int +pkg syscall (openbsd-amd64), const IPPROTO_EGP ideal-int +pkg syscall (openbsd-amd64), const IPPROTO_ENCAP ideal-int +pkg syscall (openbsd-amd64), const IPPROTO_EON ideal-int +pkg syscall (openbsd-amd64), const IPPROTO_ESP ideal-int +pkg syscall (openbsd-amd64), const IPPROTO_ETHERIP ideal-int +pkg syscall (openbsd-amd64), const IPPROTO_FRAGMENT ideal-int +pkg syscall (openbsd-amd64), const IPPROTO_GGP ideal-int +pkg syscall (openbsd-amd64), const IPPROTO_GRE ideal-int +pkg syscall (openbsd-amd64), const IPPROTO_HOPOPTS ideal-int +pkg syscall (openbsd-amd64), const IPPROTO_ICMP ideal-int +pkg syscall (openbsd-amd64), const IPPROTO_ICMPV6 ideal-int +pkg syscall (openbsd-amd64), const IPPROTO_IDP ideal-int +pkg syscall (openbsd-amd64), const IPPROTO_IGMP ideal-int +pkg syscall (openbsd-amd64), const IPPROTO_IPCOMP ideal-int +pkg syscall (openbsd-amd64), const IPPROTO_IPIP ideal-int +pkg syscall (openbsd-amd64), const IPPROTO_IPV4 ideal-int +pkg syscall (openbsd-amd64), const IPPROTO_MAX ideal-int +pkg syscall (openbsd-amd64), const IPPROTO_MAXID ideal-int +pkg syscall (openbsd-amd64), const IPPROTO_MOBILE ideal-int +pkg syscall (openbsd-amd64), const IPPROTO_MPLS ideal-int +pkg syscall (openbsd-amd64), const IPPROTO_NONE ideal-int +pkg syscall (openbsd-amd64), const IPPROTO_PFSYNC ideal-int +pkg syscall (openbsd-amd64), const IPPROTO_PIM ideal-int +pkg syscall (openbsd-amd64), const IPPROTO_PUP ideal-int +pkg syscall (openbsd-amd64), const IPPROTO_RAW ideal-int +pkg syscall (openbsd-amd64), const IPPROTO_ROUTING ideal-int +pkg syscall (openbsd-amd64), const IPPROTO_RSVP ideal-int +pkg syscall (openbsd-amd64), const IPPROTO_TP ideal-int +pkg syscall (openbsd-amd64), const IPV6_AUTH_LEVEL ideal-int +pkg syscall (openbsd-amd64), const IPV6_AUTOFLOWLABEL ideal-int +pkg syscall (openbsd-amd64), const IPV6_CHECKSUM ideal-int +pkg syscall (openbsd-amd64), const IPV6_DEFAULT_MULTICAST_HOPS ideal-int +pkg syscall (openbsd-amd64), const IPV6_DEFAULT_MULTICAST_LOOP ideal-int +pkg syscall (openbsd-amd64), const IPV6_DEFHLIM ideal-int +pkg syscall (openbsd-amd64), const IPV6_DONTFRAG ideal-int +pkg syscall (openbsd-amd64), const IPV6_DSTOPTS ideal-int +pkg syscall (openbsd-amd64), const IPV6_ESP_NETWORK_LEVEL ideal-int +pkg syscall (openbsd-amd64), const IPV6_ESP_TRANS_LEVEL ideal-int +pkg syscall (openbsd-amd64), const IPV6_FAITH ideal-int +pkg syscall (openbsd-amd64), const IPV6_FLOWINFO_MASK ideal-int +pkg syscall (openbsd-amd64), const IPV6_FLOWLABEL_MASK ideal-int +pkg syscall (openbsd-amd64), const IPV6_FRAGTTL ideal-int +pkg syscall (openbsd-amd64), const IPV6_HLIMDEC ideal-int +pkg syscall (openbsd-amd64), const IPV6_HOPLIMIT ideal-int +pkg syscall (openbsd-amd64), const IPV6_HOPOPTS ideal-int +pkg syscall (openbsd-amd64), const IPV6_IPCOMP_LEVEL ideal-int +pkg syscall (openbsd-amd64), const IPV6_MAXHLIM ideal-int +pkg syscall (openbsd-amd64), const IPV6_MAXPACKET ideal-int +pkg syscall (openbsd-amd64), const IPV6_MMTU ideal-int +pkg syscall (openbsd-amd64), const IPV6_NEXTHOP ideal-int +pkg syscall (openbsd-amd64), const IPV6_OPTIONS ideal-int +pkg syscall (openbsd-amd64), const IPV6_PATHMTU ideal-int +pkg syscall (openbsd-amd64), const IPV6_PIPEX ideal-int +pkg syscall (openbsd-amd64), const IPV6_PKTINFO ideal-int +pkg syscall (openbsd-amd64), const IPV6_PORTRANGE ideal-int +pkg syscall (openbsd-amd64), const IPV6_PORTRANGE_DEFAULT ideal-int +pkg syscall (openbsd-amd64), const IPV6_PORTRANGE_HIGH ideal-int +pkg syscall (openbsd-amd64), const IPV6_PORTRANGE_LOW ideal-int +pkg syscall (openbsd-amd64), const IPV6_RECVDSTOPTS ideal-int +pkg syscall (openbsd-amd64), const IPV6_RECVHOPLIMIT ideal-int +pkg syscall (openbsd-amd64), const IPV6_RECVHOPOPTS ideal-int +pkg syscall (openbsd-amd64), const IPV6_RECVPATHMTU ideal-int +pkg syscall (openbsd-amd64), const IPV6_RECVPKTINFO ideal-int +pkg syscall (openbsd-amd64), const IPV6_RECVRTHDR ideal-int +pkg syscall (openbsd-amd64), const IPV6_RECVTCLASS ideal-int +pkg syscall (openbsd-amd64), const IPV6_RTABLE ideal-int +pkg syscall (openbsd-amd64), const IPV6_RTHDR ideal-int +pkg syscall (openbsd-amd64), const IPV6_RTHDRDSTOPTS ideal-int +pkg syscall (openbsd-amd64), const IPV6_RTHDR_LOOSE ideal-int +pkg syscall (openbsd-amd64), const IPV6_RTHDR_STRICT ideal-int +pkg syscall (openbsd-amd64), const IPV6_RTHDR_TYPE_0 ideal-int +pkg syscall (openbsd-amd64), const IPV6_SOCKOPT_RESERVED1 ideal-int +pkg syscall (openbsd-amd64), const IPV6_TCLASS ideal-int +pkg syscall (openbsd-amd64), const IPV6_USE_MIN_MTU ideal-int +pkg syscall (openbsd-amd64), const IPV6_VERSION ideal-int +pkg syscall (openbsd-amd64), const IPV6_VERSION_MASK ideal-int +pkg syscall (openbsd-amd64), const IP_AUTH_LEVEL ideal-int +pkg syscall (openbsd-amd64), const IP_DEFAULT_MULTICAST_LOOP ideal-int +pkg syscall (openbsd-amd64), const IP_DEFAULT_MULTICAST_TTL ideal-int +pkg syscall (openbsd-amd64), const IP_DF ideal-int +pkg syscall (openbsd-amd64), const IP_ESP_NETWORK_LEVEL ideal-int +pkg syscall (openbsd-amd64), const IP_ESP_TRANS_LEVEL ideal-int +pkg syscall (openbsd-amd64), const IP_HDRINCL ideal-int +pkg syscall (openbsd-amd64), const IP_IPCOMP_LEVEL ideal-int +pkg syscall (openbsd-amd64), const IP_IPSECFLOWINFO ideal-int +pkg syscall (openbsd-amd64), const IP_IPSEC_LOCAL_AUTH ideal-int +pkg syscall (openbsd-amd64), const IP_IPSEC_LOCAL_CRED ideal-int +pkg syscall (openbsd-amd64), const IP_IPSEC_LOCAL_ID ideal-int +pkg syscall (openbsd-amd64), const IP_IPSEC_REMOTE_AUTH ideal-int +pkg syscall (openbsd-amd64), const IP_IPSEC_REMOTE_CRED ideal-int +pkg syscall (openbsd-amd64), const IP_IPSEC_REMOTE_ID ideal-int +pkg syscall (openbsd-amd64), const IP_MAXPACKET ideal-int +pkg syscall (openbsd-amd64), const IP_MAX_MEMBERSHIPS ideal-int +pkg syscall (openbsd-amd64), const IP_MF ideal-int +pkg syscall (openbsd-amd64), const IP_MINTTL ideal-int +pkg syscall (openbsd-amd64), const IP_MIN_MEMBERSHIPS ideal-int +pkg syscall (openbsd-amd64), const IP_MSS ideal-int +pkg syscall (openbsd-amd64), const IP_OFFMASK ideal-int +pkg syscall (openbsd-amd64), const IP_OPTIONS ideal-int +pkg syscall (openbsd-amd64), const IP_PIPEX ideal-int +pkg syscall (openbsd-amd64), const IP_PORTRANGE ideal-int +pkg syscall (openbsd-amd64), const IP_PORTRANGE_DEFAULT ideal-int +pkg syscall (openbsd-amd64), const IP_PORTRANGE_HIGH ideal-int +pkg syscall (openbsd-amd64), const IP_PORTRANGE_LOW ideal-int +pkg syscall (openbsd-amd64), const IP_RECVDSTADDR ideal-int +pkg syscall (openbsd-amd64), const IP_RECVDSTPORT ideal-int +pkg syscall (openbsd-amd64), const IP_RECVIF ideal-int +pkg syscall (openbsd-amd64), const IP_RECVOPTS ideal-int +pkg syscall (openbsd-amd64), const IP_RECVRETOPTS ideal-int +pkg syscall (openbsd-amd64), const IP_RECVRTABLE ideal-int +pkg syscall (openbsd-amd64), const IP_RECVTTL ideal-int +pkg syscall (openbsd-amd64), const IP_RETOPTS ideal-int +pkg syscall (openbsd-amd64), const IP_RF ideal-int +pkg syscall (openbsd-amd64), const IP_RTABLE ideal-int +pkg syscall (openbsd-amd64), const ISIG ideal-int +pkg syscall (openbsd-amd64), const ISTRIP ideal-int +pkg syscall (openbsd-amd64), const IXANY ideal-int +pkg syscall (openbsd-amd64), const IXOFF ideal-int +pkg syscall (openbsd-amd64), const IXON ideal-int +pkg syscall (openbsd-amd64), const LCNT_OVERLOAD_FLUSH ideal-int +pkg syscall (openbsd-amd64), const LOCK_EX ideal-int +pkg syscall (openbsd-amd64), const LOCK_NB ideal-int +pkg syscall (openbsd-amd64), const LOCK_SH ideal-int +pkg syscall (openbsd-amd64), const LOCK_UN ideal-int +pkg syscall (openbsd-amd64), const MSG_BCAST ideal-int +pkg syscall (openbsd-amd64), const MSG_CTRUNC ideal-int +pkg syscall (openbsd-amd64), const MSG_DONTROUTE ideal-int +pkg syscall (openbsd-amd64), const MSG_DONTWAIT ideal-int +pkg syscall (openbsd-amd64), const MSG_EOR ideal-int +pkg syscall (openbsd-amd64), const MSG_MCAST ideal-int +pkg syscall (openbsd-amd64), const MSG_NOSIGNAL ideal-int +pkg syscall (openbsd-amd64), const MSG_OOB ideal-int +pkg syscall (openbsd-amd64), const MSG_PEEK ideal-int +pkg syscall (openbsd-amd64), const MSG_TRUNC ideal-int +pkg syscall (openbsd-amd64), const MSG_WAITALL ideal-int +pkg syscall (openbsd-amd64), const NAME_MAX ideal-int +pkg syscall (openbsd-amd64), const NET_RT_DUMP ideal-int +pkg syscall (openbsd-amd64), const NET_RT_FLAGS ideal-int +pkg syscall (openbsd-amd64), const NET_RT_IFLIST ideal-int +pkg syscall (openbsd-amd64), const NET_RT_MAXID ideal-int +pkg syscall (openbsd-amd64), const NET_RT_STATS ideal-int +pkg syscall (openbsd-amd64), const NET_RT_TABLE ideal-int +pkg syscall (openbsd-amd64), const NOFLSH ideal-int +pkg syscall (openbsd-amd64), const NOTE_ATTRIB ideal-int +pkg syscall (openbsd-amd64), const NOTE_CHILD ideal-int +pkg syscall (openbsd-amd64), const NOTE_DELETE ideal-int +pkg syscall (openbsd-amd64), const NOTE_EOF ideal-int +pkg syscall (openbsd-amd64), const NOTE_EXEC ideal-int +pkg syscall (openbsd-amd64), const NOTE_EXIT ideal-int +pkg syscall (openbsd-amd64), const NOTE_EXTEND ideal-int +pkg syscall (openbsd-amd64), const NOTE_FORK ideal-int +pkg syscall (openbsd-amd64), const NOTE_LINK ideal-int +pkg syscall (openbsd-amd64), const NOTE_LOWAT ideal-int +pkg syscall (openbsd-amd64), const NOTE_PCTRLMASK ideal-int +pkg syscall (openbsd-amd64), const NOTE_PDATAMASK ideal-int +pkg syscall (openbsd-amd64), const NOTE_RENAME ideal-int +pkg syscall (openbsd-amd64), const NOTE_REVOKE ideal-int +pkg syscall (openbsd-amd64), const NOTE_TRACK ideal-int +pkg syscall (openbsd-amd64), const NOTE_TRACKERR ideal-int +pkg syscall (openbsd-amd64), const NOTE_TRUNCATE ideal-int +pkg syscall (openbsd-amd64), const NOTE_WRITE ideal-int +pkg syscall (openbsd-amd64), const OCRNL ideal-int +pkg syscall (openbsd-amd64), const ONLCR ideal-int +pkg syscall (openbsd-amd64), const ONLRET ideal-int +pkg syscall (openbsd-amd64), const ONOCR ideal-int +pkg syscall (openbsd-amd64), const ONOEOT ideal-int +pkg syscall (openbsd-amd64), const OPOST ideal-int +pkg syscall (openbsd-amd64), const O_ACCMODE ideal-int +pkg syscall (openbsd-amd64), const O_DIRECTORY ideal-int +pkg syscall (openbsd-amd64), const O_DSYNC ideal-int +pkg syscall (openbsd-amd64), const O_EXLOCK ideal-int +pkg syscall (openbsd-amd64), const O_FSYNC ideal-int +pkg syscall (openbsd-amd64), const O_NDELAY ideal-int +pkg syscall (openbsd-amd64), const O_NOFOLLOW ideal-int +pkg syscall (openbsd-amd64), const O_RSYNC ideal-int +pkg syscall (openbsd-amd64), const O_SHLOCK ideal-int +pkg syscall (openbsd-amd64), const PARENB ideal-int +pkg syscall (openbsd-amd64), const PARMRK ideal-int +pkg syscall (openbsd-amd64), const PARODD ideal-int +pkg syscall (openbsd-amd64), const PENDIN ideal-int +pkg syscall (openbsd-amd64), const PF_FLUSH ideal-int +pkg syscall (openbsd-amd64), const PMC5_PIPELINE_FLUSH ideal-int +pkg syscall (openbsd-amd64), const PRIO_PGRP = 1 +pkg syscall (openbsd-amd64), const PRIO_PGRP ideal-int +pkg syscall (openbsd-amd64), const PRIO_PROCESS = 0 +pkg syscall (openbsd-amd64), const PRIO_PROCESS ideal-int +pkg syscall (openbsd-amd64), const PRIO_USER = 2 +pkg syscall (openbsd-amd64), const PRIO_USER ideal-int +pkg syscall (openbsd-amd64), const PTRACE_CONT ideal-int +pkg syscall (openbsd-amd64), const PTRACE_KILL ideal-int +pkg syscall (openbsd-amd64), const PTRACE_TRACEME ideal-int +pkg syscall (openbsd-amd64), const RLIMIT_CORE ideal-int +pkg syscall (openbsd-amd64), const RLIMIT_CPU ideal-int +pkg syscall (openbsd-amd64), const RLIMIT_DATA ideal-int +pkg syscall (openbsd-amd64), const RLIMIT_FSIZE ideal-int +pkg syscall (openbsd-amd64), const RLIMIT_NOFILE ideal-int +pkg syscall (openbsd-amd64), const RLIMIT_STACK ideal-int +pkg syscall (openbsd-amd64), const RLIM_INFINITY ideal-int +pkg syscall (openbsd-amd64), const RTAX_AUTHOR ideal-int +pkg syscall (openbsd-amd64), const RTAX_BRD ideal-int +pkg syscall (openbsd-amd64), const RTAX_DST ideal-int +pkg syscall (openbsd-amd64), const RTAX_GATEWAY ideal-int +pkg syscall (openbsd-amd64), const RTAX_GENMASK ideal-int +pkg syscall (openbsd-amd64), const RTAX_IFA ideal-int +pkg syscall (openbsd-amd64), const RTAX_IFP ideal-int +pkg syscall (openbsd-amd64), const RTAX_LABEL ideal-int +pkg syscall (openbsd-amd64), const RTAX_MAX ideal-int +pkg syscall (openbsd-amd64), const RTAX_NETMASK ideal-int +pkg syscall (openbsd-amd64), const RTAX_SRC ideal-int +pkg syscall (openbsd-amd64), const RTAX_SRCMASK ideal-int +pkg syscall (openbsd-amd64), const RTA_AUTHOR ideal-int +pkg syscall (openbsd-amd64), const RTA_BRD ideal-int +pkg syscall (openbsd-amd64), const RTA_DST ideal-int +pkg syscall (openbsd-amd64), const RTA_GATEWAY ideal-int +pkg syscall (openbsd-amd64), const RTA_GENMASK ideal-int +pkg syscall (openbsd-amd64), const RTA_IFA ideal-int +pkg syscall (openbsd-amd64), const RTA_IFP ideal-int +pkg syscall (openbsd-amd64), const RTA_LABEL ideal-int +pkg syscall (openbsd-amd64), const RTA_NETMASK ideal-int +pkg syscall (openbsd-amd64), const RTA_SRC ideal-int +pkg syscall (openbsd-amd64), const RTA_SRCMASK ideal-int +pkg syscall (openbsd-amd64), const RTF_ANNOUNCE ideal-int +pkg syscall (openbsd-amd64), const RTF_BLACKHOLE ideal-int +pkg syscall (openbsd-amd64), const RTF_CLONED ideal-int +pkg syscall (openbsd-amd64), const RTF_CLONING ideal-int +pkg syscall (openbsd-amd64), const RTF_DONE ideal-int +pkg syscall (openbsd-amd64), const RTF_DYNAMIC ideal-int +pkg syscall (openbsd-amd64), const RTF_FMASK ideal-int +pkg syscall (openbsd-amd64), const RTF_GATEWAY ideal-int +pkg syscall (openbsd-amd64), const RTF_HOST ideal-int +pkg syscall (openbsd-amd64), const RTF_LLINFO ideal-int +pkg syscall (openbsd-amd64), const RTF_MASK ideal-int +pkg syscall (openbsd-amd64), const RTF_MODIFIED ideal-int +pkg syscall (openbsd-amd64), const RTF_MPATH ideal-int +pkg syscall (openbsd-amd64), const RTF_MPLS ideal-int +pkg syscall (openbsd-amd64), const RTF_PERMANENT_ARP ideal-int +pkg syscall (openbsd-amd64), const RTF_PROTO1 ideal-int +pkg syscall (openbsd-amd64), const RTF_PROTO2 ideal-int +pkg syscall (openbsd-amd64), const RTF_PROTO3 ideal-int +pkg syscall (openbsd-amd64), const RTF_REJECT ideal-int +pkg syscall (openbsd-amd64), const RTF_SOURCE ideal-int +pkg syscall (openbsd-amd64), const RTF_STATIC ideal-int +pkg syscall (openbsd-amd64), const RTF_TUNNEL ideal-int +pkg syscall (openbsd-amd64), const RTF_UP ideal-int +pkg syscall (openbsd-amd64), const RTF_USETRAILERS ideal-int +pkg syscall (openbsd-amd64), const RTF_XRESOLVE ideal-int +pkg syscall (openbsd-amd64), const RTM_ADD ideal-int +pkg syscall (openbsd-amd64), const RTM_CHANGE ideal-int +pkg syscall (openbsd-amd64), const RTM_DELADDR ideal-int +pkg syscall (openbsd-amd64), const RTM_DELETE ideal-int +pkg syscall (openbsd-amd64), const RTM_DESYNC ideal-int +pkg syscall (openbsd-amd64), const RTM_GET ideal-int +pkg syscall (openbsd-amd64), const RTM_IFANNOUNCE ideal-int +pkg syscall (openbsd-amd64), const RTM_IFINFO ideal-int +pkg syscall (openbsd-amd64), const RTM_LOCK ideal-int +pkg syscall (openbsd-amd64), const RTM_LOSING ideal-int +pkg syscall (openbsd-amd64), const RTM_MAXSIZE ideal-int +pkg syscall (openbsd-amd64), const RTM_MISS ideal-int +pkg syscall (openbsd-amd64), const RTM_NEWADDR ideal-int +pkg syscall (openbsd-amd64), const RTM_REDIRECT ideal-int +pkg syscall (openbsd-amd64), const RTM_RESOLVE ideal-int +pkg syscall (openbsd-amd64), const RTM_RTTUNIT ideal-int +pkg syscall (openbsd-amd64), const RTM_VERSION ideal-int +pkg syscall (openbsd-amd64), const RTV_EXPIRE ideal-int +pkg syscall (openbsd-amd64), const RTV_HOPCOUNT ideal-int +pkg syscall (openbsd-amd64), const RTV_MTU ideal-int +pkg syscall (openbsd-amd64), const RTV_RPIPE ideal-int +pkg syscall (openbsd-amd64), const RTV_RTT ideal-int +pkg syscall (openbsd-amd64), const RTV_RTTVAR ideal-int +pkg syscall (openbsd-amd64), const RTV_SPIPE ideal-int +pkg syscall (openbsd-amd64), const RTV_SSTHRESH ideal-int +pkg syscall (openbsd-amd64), const RT_TABLEID_MAX ideal-int +pkg syscall (openbsd-amd64), const RUSAGE_CHILDREN ideal-int +pkg syscall (openbsd-amd64), const RUSAGE_SELF ideal-int +pkg syscall (openbsd-amd64), const RUSAGE_THREAD ideal-int +pkg syscall (openbsd-amd64), const SCM_RIGHTS ideal-int +pkg syscall (openbsd-amd64), const SCM_TIMESTAMP ideal-int +pkg syscall (openbsd-amd64), const SIGCHLD Signal +pkg syscall (openbsd-amd64), const SIGCONT Signal +pkg syscall (openbsd-amd64), const SIGEMT Signal +pkg syscall (openbsd-amd64), const SIGINFO Signal +pkg syscall (openbsd-amd64), const SIGIO Signal +pkg syscall (openbsd-amd64), const SIGIOT Signal +pkg syscall (openbsd-amd64), const SIGPROF Signal +pkg syscall (openbsd-amd64), const SIGSTOP Signal +pkg syscall (openbsd-amd64), const SIGSYS Signal +pkg syscall (openbsd-amd64), const SIGTHR Signal +pkg syscall (openbsd-amd64), const SIGTSTP Signal +pkg syscall (openbsd-amd64), const SIGTTIN Signal +pkg syscall (openbsd-amd64), const SIGTTOU Signal +pkg syscall (openbsd-amd64), const SIGURG Signal +pkg syscall (openbsd-amd64), const SIGUSR1 Signal +pkg syscall (openbsd-amd64), const SIGUSR2 Signal +pkg syscall (openbsd-amd64), const SIGVTALRM Signal +pkg syscall (openbsd-amd64), const SIGWINCH Signal +pkg syscall (openbsd-amd64), const SIGXCPU Signal +pkg syscall (openbsd-amd64), const SIGXFSZ Signal +pkg syscall (openbsd-amd64), const SIOCADDMULTI ideal-int +pkg syscall (openbsd-amd64), const SIOCAIFADDR ideal-int +pkg syscall (openbsd-amd64), const SIOCAIFGROUP ideal-int +pkg syscall (openbsd-amd64), const SIOCALIFADDR ideal-int +pkg syscall (openbsd-amd64), const SIOCATMARK ideal-int +pkg syscall (openbsd-amd64), const SIOCBRDGADD ideal-int +pkg syscall (openbsd-amd64), const SIOCBRDGADDS ideal-int +pkg syscall (openbsd-amd64), const SIOCBRDGARL ideal-int +pkg syscall (openbsd-amd64), const SIOCBRDGDADDR ideal-int +pkg syscall (openbsd-amd64), const SIOCBRDGDEL ideal-int +pkg syscall (openbsd-amd64), const SIOCBRDGDELS ideal-int +pkg syscall (openbsd-amd64), const SIOCBRDGFLUSH ideal-int +pkg syscall (openbsd-amd64), const SIOCBRDGFRL ideal-int +pkg syscall (openbsd-amd64), const SIOCBRDGGCACHE ideal-int +pkg syscall (openbsd-amd64), const SIOCBRDGGFD ideal-int +pkg syscall (openbsd-amd64), const SIOCBRDGGHT ideal-int +pkg syscall (openbsd-amd64), const SIOCBRDGGIFFLGS ideal-int +pkg syscall (openbsd-amd64), const SIOCBRDGGMA ideal-int +pkg syscall (openbsd-amd64), const SIOCBRDGGPARAM ideal-int +pkg syscall (openbsd-amd64), const SIOCBRDGGPRI ideal-int +pkg syscall (openbsd-amd64), const SIOCBRDGGRL ideal-int +pkg syscall (openbsd-amd64), const SIOCBRDGGSIFS ideal-int +pkg syscall (openbsd-amd64), const SIOCBRDGGTO ideal-int +pkg syscall (openbsd-amd64), const SIOCBRDGIFS ideal-int +pkg syscall (openbsd-amd64), const SIOCBRDGRTS ideal-int +pkg syscall (openbsd-amd64), const SIOCBRDGSADDR ideal-int +pkg syscall (openbsd-amd64), const SIOCBRDGSCACHE ideal-int +pkg syscall (openbsd-amd64), const SIOCBRDGSFD ideal-int +pkg syscall (openbsd-amd64), const SIOCBRDGSHT ideal-int +pkg syscall (openbsd-amd64), const SIOCBRDGSIFCOST ideal-int +pkg syscall (openbsd-amd64), const SIOCBRDGSIFFLGS ideal-int +pkg syscall (openbsd-amd64), const SIOCBRDGSIFPRIO ideal-int +pkg syscall (openbsd-amd64), const SIOCBRDGSMA ideal-int +pkg syscall (openbsd-amd64), const SIOCBRDGSPRI ideal-int +pkg syscall (openbsd-amd64), const SIOCBRDGSPROTO ideal-int +pkg syscall (openbsd-amd64), const SIOCBRDGSTO ideal-int +pkg syscall (openbsd-amd64), const SIOCBRDGSTXHC ideal-int +pkg syscall (openbsd-amd64), const SIOCDELMULTI ideal-int +pkg syscall (openbsd-amd64), const SIOCDIFADDR ideal-int +pkg syscall (openbsd-amd64), const SIOCDIFGROUP ideal-int +pkg syscall (openbsd-amd64), const SIOCDIFPHYADDR ideal-int +pkg syscall (openbsd-amd64), const SIOCDLIFADDR ideal-int +pkg syscall (openbsd-amd64), const SIOCGETKALIVE ideal-int +pkg syscall (openbsd-amd64), const SIOCGETLABEL ideal-int +pkg syscall (openbsd-amd64), const SIOCGETPFLOW ideal-int +pkg syscall (openbsd-amd64), const SIOCGETPFSYNC ideal-int +pkg syscall (openbsd-amd64), const SIOCGETSGCNT ideal-int +pkg syscall (openbsd-amd64), const SIOCGETVIFCNT ideal-int +pkg syscall (openbsd-amd64), const SIOCGHIWAT ideal-int +pkg syscall (openbsd-amd64), const SIOCGIFADDR ideal-int +pkg syscall (openbsd-amd64), const SIOCGIFASYNCMAP ideal-int +pkg syscall (openbsd-amd64), const SIOCGIFBRDADDR ideal-int +pkg syscall (openbsd-amd64), const SIOCGIFCONF ideal-int +pkg syscall (openbsd-amd64), const SIOCGIFDATA ideal-int +pkg syscall (openbsd-amd64), const SIOCGIFDESCR ideal-int +pkg syscall (openbsd-amd64), const SIOCGIFDSTADDR ideal-int +pkg syscall (openbsd-amd64), const SIOCGIFFLAGS ideal-int +pkg syscall (openbsd-amd64), const SIOCGIFGATTR ideal-int +pkg syscall (openbsd-amd64), const SIOCGIFGENERIC ideal-int +pkg syscall (openbsd-amd64), const SIOCGIFGMEMB ideal-int +pkg syscall (openbsd-amd64), const SIOCGIFGROUP ideal-int +pkg syscall (openbsd-amd64), const SIOCGIFMEDIA ideal-int +pkg syscall (openbsd-amd64), const SIOCGIFMETRIC ideal-int +pkg syscall (openbsd-amd64), const SIOCGIFMTU ideal-int +pkg syscall (openbsd-amd64), const SIOCGIFNETMASK ideal-int +pkg syscall (openbsd-amd64), const SIOCGIFPDSTADDR ideal-int +pkg syscall (openbsd-amd64), const SIOCGIFPRIORITY ideal-int +pkg syscall (openbsd-amd64), const SIOCGIFPSRCADDR ideal-int +pkg syscall (openbsd-amd64), const SIOCGIFRDOMAIN ideal-int +pkg syscall (openbsd-amd64), const SIOCGIFRTLABEL ideal-int +pkg syscall (openbsd-amd64), const SIOCGIFTIMESLOT ideal-int +pkg syscall (openbsd-amd64), const SIOCGIFXFLAGS ideal-int +pkg syscall (openbsd-amd64), const SIOCGLIFADDR ideal-int +pkg syscall (openbsd-amd64), const SIOCGLIFPHYADDR ideal-int +pkg syscall (openbsd-amd64), const SIOCGLIFPHYRTABLE ideal-int +pkg syscall (openbsd-amd64), const SIOCGLOWAT ideal-int +pkg syscall (openbsd-amd64), const SIOCGPGRP ideal-int +pkg syscall (openbsd-amd64), const SIOCGVH ideal-int +pkg syscall (openbsd-amd64), const SIOCIFCREATE ideal-int +pkg syscall (openbsd-amd64), const SIOCIFDESTROY ideal-int +pkg syscall (openbsd-amd64), const SIOCIFGCLONERS ideal-int +pkg syscall (openbsd-amd64), const SIOCSETKALIVE ideal-int +pkg syscall (openbsd-amd64), const SIOCSETLABEL ideal-int +pkg syscall (openbsd-amd64), const SIOCSETPFLOW ideal-int +pkg syscall (openbsd-amd64), const SIOCSETPFSYNC ideal-int +pkg syscall (openbsd-amd64), const SIOCSHIWAT ideal-int +pkg syscall (openbsd-amd64), const SIOCSIFADDR ideal-int +pkg syscall (openbsd-amd64), const SIOCSIFASYNCMAP ideal-int +pkg syscall (openbsd-amd64), const SIOCSIFBRDADDR ideal-int +pkg syscall (openbsd-amd64), const SIOCSIFDESCR ideal-int +pkg syscall (openbsd-amd64), const SIOCSIFDSTADDR ideal-int +pkg syscall (openbsd-amd64), const SIOCSIFFLAGS ideal-int +pkg syscall (openbsd-amd64), const SIOCSIFGATTR ideal-int +pkg syscall (openbsd-amd64), const SIOCSIFGENERIC ideal-int +pkg syscall (openbsd-amd64), const SIOCSIFLLADDR ideal-int +pkg syscall (openbsd-amd64), const SIOCSIFMEDIA ideal-int +pkg syscall (openbsd-amd64), const SIOCSIFMETRIC ideal-int +pkg syscall (openbsd-amd64), const SIOCSIFMTU ideal-int +pkg syscall (openbsd-amd64), const SIOCSIFNETMASK ideal-int +pkg syscall (openbsd-amd64), const SIOCSIFPHYADDR ideal-int +pkg syscall (openbsd-amd64), const SIOCSIFPRIORITY ideal-int +pkg syscall (openbsd-amd64), const SIOCSIFRDOMAIN ideal-int +pkg syscall (openbsd-amd64), const SIOCSIFRTLABEL ideal-int +pkg syscall (openbsd-amd64), const SIOCSIFTIMESLOT ideal-int +pkg syscall (openbsd-amd64), const SIOCSIFXFLAGS ideal-int +pkg syscall (openbsd-amd64), const SIOCSLIFPHYADDR ideal-int +pkg syscall (openbsd-amd64), const SIOCSLIFPHYRTABLE ideal-int +pkg syscall (openbsd-amd64), const SIOCSLOWAT ideal-int +pkg syscall (openbsd-amd64), const SIOCSPGRP ideal-int +pkg syscall (openbsd-amd64), const SIOCSVH ideal-int +pkg syscall (openbsd-amd64), const SOCK_RDM ideal-int +pkg syscall (openbsd-amd64), const SO_ACCEPTCONN ideal-int +pkg syscall (openbsd-amd64), const SO_BINDANY ideal-int +pkg syscall (openbsd-amd64), const SO_DEBUG ideal-int +pkg syscall (openbsd-amd64), const SO_ERROR ideal-int +pkg syscall (openbsd-amd64), const SO_NETPROC ideal-int +pkg syscall (openbsd-amd64), const SO_OOBINLINE ideal-int +pkg syscall (openbsd-amd64), const SO_PEERCRED ideal-int +pkg syscall (openbsd-amd64), const SO_RCVLOWAT ideal-int +pkg syscall (openbsd-amd64), const SO_RCVTIMEO ideal-int +pkg syscall (openbsd-amd64), const SO_REUSEPORT ideal-int +pkg syscall (openbsd-amd64), const SO_RTABLE ideal-int +pkg syscall (openbsd-amd64), const SO_SNDLOWAT ideal-int +pkg syscall (openbsd-amd64), const SO_SNDTIMEO ideal-int +pkg syscall (openbsd-amd64), const SO_SPLICE ideal-int +pkg syscall (openbsd-amd64), const SO_TIMESTAMP ideal-int +pkg syscall (openbsd-amd64), const SO_TYPE ideal-int +pkg syscall (openbsd-amd64), const SO_USELOOPBACK ideal-int +pkg syscall (openbsd-amd64), const SYS_ACCEPT ideal-int +pkg syscall (openbsd-amd64), const SYS_ACCESS ideal-int +pkg syscall (openbsd-amd64), const SYS_ACCT ideal-int +pkg syscall (openbsd-amd64), const SYS_ADJFREQ ideal-int +pkg syscall (openbsd-amd64), const SYS_ADJTIME ideal-int +pkg syscall (openbsd-amd64), const SYS_BIND ideal-int +pkg syscall (openbsd-amd64), const SYS_CHDIR ideal-int +pkg syscall (openbsd-amd64), const SYS_CHFLAGS ideal-int +pkg syscall (openbsd-amd64), const SYS_CHMOD ideal-int +pkg syscall (openbsd-amd64), const SYS_CHOWN ideal-int +pkg syscall (openbsd-amd64), const SYS_CHROOT ideal-int +pkg syscall (openbsd-amd64), const SYS_CLOCK_GETRES ideal-int +pkg syscall (openbsd-amd64), const SYS_CLOCK_GETTIME ideal-int +pkg syscall (openbsd-amd64), const SYS_CLOCK_SETTIME ideal-int +pkg syscall (openbsd-amd64), const SYS_CLOSE ideal-int +pkg syscall (openbsd-amd64), const SYS_CLOSEFROM ideal-int +pkg syscall (openbsd-amd64), const SYS_CONNECT ideal-int +pkg syscall (openbsd-amd64), const SYS_DUP ideal-int +pkg syscall (openbsd-amd64), const SYS_DUP2 ideal-int +pkg syscall (openbsd-amd64), const SYS_EXECVE ideal-int +pkg syscall (openbsd-amd64), const SYS_EXIT ideal-int +pkg syscall (openbsd-amd64), const SYS_FACCESSAT ideal-int +pkg syscall (openbsd-amd64), const SYS_FCHDIR ideal-int +pkg syscall (openbsd-amd64), const SYS_FCHFLAGS ideal-int +pkg syscall (openbsd-amd64), const SYS_FCHMOD ideal-int +pkg syscall (openbsd-amd64), const SYS_FCHMODAT ideal-int +pkg syscall (openbsd-amd64), const SYS_FCHOWN ideal-int +pkg syscall (openbsd-amd64), const SYS_FCHOWNAT ideal-int +pkg syscall (openbsd-amd64), const SYS_FCNTL ideal-int +pkg syscall (openbsd-amd64), const SYS_FHOPEN ideal-int +pkg syscall (openbsd-amd64), const SYS_FHSTAT ideal-int +pkg syscall (openbsd-amd64), const SYS_FHSTATFS ideal-int +pkg syscall (openbsd-amd64), const SYS_FLOCK ideal-int +pkg syscall (openbsd-amd64), const SYS_FORK ideal-int +pkg syscall (openbsd-amd64), const SYS_FPATHCONF ideal-int +pkg syscall (openbsd-amd64), const SYS_FSTAT ideal-int +pkg syscall (openbsd-amd64), const SYS_FSTATAT ideal-int +pkg syscall (openbsd-amd64), const SYS_FSTATFS ideal-int +pkg syscall (openbsd-amd64), const SYS_FSYNC ideal-int +pkg syscall (openbsd-amd64), const SYS_FTRUNCATE ideal-int +pkg syscall (openbsd-amd64), const SYS_FUTIMENS ideal-int +pkg syscall (openbsd-amd64), const SYS_FUTIMES ideal-int +pkg syscall (openbsd-amd64), const SYS_GETDIRENTRIES ideal-int +pkg syscall (openbsd-amd64), const SYS_GETDTABLECOUNT ideal-int +pkg syscall (openbsd-amd64), const SYS_GETEGID ideal-int +pkg syscall (openbsd-amd64), const SYS_GETEUID ideal-int +pkg syscall (openbsd-amd64), const SYS_GETFH ideal-int +pkg syscall (openbsd-amd64), const SYS_GETFSSTAT ideal-int +pkg syscall (openbsd-amd64), const SYS_GETGID ideal-int +pkg syscall (openbsd-amd64), const SYS_GETGROUPS ideal-int +pkg syscall (openbsd-amd64), const SYS_GETITIMER ideal-int +pkg syscall (openbsd-amd64), const SYS_GETLOGIN ideal-int +pkg syscall (openbsd-amd64), const SYS_GETPEERNAME ideal-int +pkg syscall (openbsd-amd64), const SYS_GETPGID ideal-int +pkg syscall (openbsd-amd64), const SYS_GETPGRP ideal-int +pkg syscall (openbsd-amd64), const SYS_GETPID ideal-int +pkg syscall (openbsd-amd64), const SYS_GETPPID ideal-int +pkg syscall (openbsd-amd64), const SYS_GETPRIORITY ideal-int +pkg syscall (openbsd-amd64), const SYS_GETRESGID ideal-int +pkg syscall (openbsd-amd64), const SYS_GETRESUID ideal-int +pkg syscall (openbsd-amd64), const SYS_GETRLIMIT ideal-int +pkg syscall (openbsd-amd64), const SYS_GETRTABLE ideal-int +pkg syscall (openbsd-amd64), const SYS_GETRUSAGE ideal-int +pkg syscall (openbsd-amd64), const SYS_GETSID ideal-int +pkg syscall (openbsd-amd64), const SYS_GETSOCKNAME ideal-int +pkg syscall (openbsd-amd64), const SYS_GETSOCKOPT ideal-int +pkg syscall (openbsd-amd64), const SYS_GETTHRID ideal-int +pkg syscall (openbsd-amd64), const SYS_GETTIMEOFDAY ideal-int +pkg syscall (openbsd-amd64), const SYS_GETUID ideal-int +pkg syscall (openbsd-amd64), const SYS_IOCTL ideal-int +pkg syscall (openbsd-amd64), const SYS_ISSETUGID ideal-int +pkg syscall (openbsd-amd64), const SYS_KEVENT ideal-int +pkg syscall (openbsd-amd64), const SYS_KILL ideal-int +pkg syscall (openbsd-amd64), const SYS_KQUEUE ideal-int +pkg syscall (openbsd-amd64), const SYS_KTRACE ideal-int +pkg syscall (openbsd-amd64), const SYS_LCHOWN ideal-int +pkg syscall (openbsd-amd64), const SYS_LINK ideal-int +pkg syscall (openbsd-amd64), const SYS_LINKAT ideal-int +pkg syscall (openbsd-amd64), const SYS_LISTEN ideal-int +pkg syscall (openbsd-amd64), const SYS_LSEEK ideal-int +pkg syscall (openbsd-amd64), const SYS_LSTAT ideal-int +pkg syscall (openbsd-amd64), const SYS_MADVISE ideal-int +pkg syscall (openbsd-amd64), const SYS_MINCORE ideal-int +pkg syscall (openbsd-amd64), const SYS_MINHERIT ideal-int +pkg syscall (openbsd-amd64), const SYS_MKDIR ideal-int +pkg syscall (openbsd-amd64), const SYS_MKDIRAT ideal-int +pkg syscall (openbsd-amd64), const SYS_MKFIFO ideal-int +pkg syscall (openbsd-amd64), const SYS_MKFIFOAT ideal-int +pkg syscall (openbsd-amd64), const SYS_MKNOD ideal-int +pkg syscall (openbsd-amd64), const SYS_MKNODAT ideal-int +pkg syscall (openbsd-amd64), const SYS_MLOCK ideal-int +pkg syscall (openbsd-amd64), const SYS_MLOCKALL ideal-int +pkg syscall (openbsd-amd64), const SYS_MMAP ideal-int +pkg syscall (openbsd-amd64), const SYS_MOUNT ideal-int +pkg syscall (openbsd-amd64), const SYS_MPROTECT ideal-int +pkg syscall (openbsd-amd64), const SYS_MQUERY ideal-int +pkg syscall (openbsd-amd64), const SYS_MSGCTL ideal-int +pkg syscall (openbsd-amd64), const SYS_MSGGET ideal-int +pkg syscall (openbsd-amd64), const SYS_MSGRCV ideal-int +pkg syscall (openbsd-amd64), const SYS_MSGSND ideal-int +pkg syscall (openbsd-amd64), const SYS_MSYNC ideal-int +pkg syscall (openbsd-amd64), const SYS_MUNLOCK ideal-int +pkg syscall (openbsd-amd64), const SYS_MUNLOCKALL ideal-int +pkg syscall (openbsd-amd64), const SYS_MUNMAP ideal-int +pkg syscall (openbsd-amd64), const SYS_NANOSLEEP ideal-int +pkg syscall (openbsd-amd64), const SYS_NFSSVC ideal-int +pkg syscall (openbsd-amd64), const SYS_OBREAK ideal-int +pkg syscall (openbsd-amd64), const SYS_OPEN ideal-int +pkg syscall (openbsd-amd64), const SYS_OPENAT ideal-int +pkg syscall (openbsd-amd64), const SYS_PATHCONF ideal-int +pkg syscall (openbsd-amd64), const SYS_PIPE ideal-int +pkg syscall (openbsd-amd64), const SYS_POLL ideal-int +pkg syscall (openbsd-amd64), const SYS_PREAD ideal-int +pkg syscall (openbsd-amd64), const SYS_PREADV ideal-int +pkg syscall (openbsd-amd64), const SYS_PROFIL ideal-int +pkg syscall (openbsd-amd64), const SYS_PTRACE ideal-int +pkg syscall (openbsd-amd64), const SYS_PWRITE ideal-int +pkg syscall (openbsd-amd64), const SYS_PWRITEV ideal-int +pkg syscall (openbsd-amd64), const SYS_QUOTACTL ideal-int +pkg syscall (openbsd-amd64), const SYS_READ ideal-int +pkg syscall (openbsd-amd64), const SYS_READLINK ideal-int +pkg syscall (openbsd-amd64), const SYS_READLINKAT ideal-int +pkg syscall (openbsd-amd64), const SYS_READV ideal-int +pkg syscall (openbsd-amd64), const SYS_REBOOT ideal-int +pkg syscall (openbsd-amd64), const SYS_RECVFROM ideal-int +pkg syscall (openbsd-amd64), const SYS_RECVMSG ideal-int +pkg syscall (openbsd-amd64), const SYS_RENAME ideal-int +pkg syscall (openbsd-amd64), const SYS_RENAMEAT ideal-int +pkg syscall (openbsd-amd64), const SYS_REVOKE ideal-int +pkg syscall (openbsd-amd64), const SYS_RMDIR ideal-int +pkg syscall (openbsd-amd64), const SYS_SCHED_YIELD ideal-int +pkg syscall (openbsd-amd64), const SYS_SELECT ideal-int +pkg syscall (openbsd-amd64), const SYS_SEMGET ideal-int +pkg syscall (openbsd-amd64), const SYS_SEMOP ideal-int +pkg syscall (openbsd-amd64), const SYS_SENDMSG ideal-int +pkg syscall (openbsd-amd64), const SYS_SENDTO ideal-int +pkg syscall (openbsd-amd64), const SYS_SETEGID ideal-int +pkg syscall (openbsd-amd64), const SYS_SETEUID ideal-int +pkg syscall (openbsd-amd64), const SYS_SETGID ideal-int +pkg syscall (openbsd-amd64), const SYS_SETGROUPS ideal-int +pkg syscall (openbsd-amd64), const SYS_SETITIMER ideal-int +pkg syscall (openbsd-amd64), const SYS_SETLOGIN ideal-int +pkg syscall (openbsd-amd64), const SYS_SETPGID ideal-int +pkg syscall (openbsd-amd64), const SYS_SETPRIORITY ideal-int +pkg syscall (openbsd-amd64), const SYS_SETREGID ideal-int +pkg syscall (openbsd-amd64), const SYS_SETRESGID ideal-int +pkg syscall (openbsd-amd64), const SYS_SETRESUID ideal-int +pkg syscall (openbsd-amd64), const SYS_SETREUID ideal-int +pkg syscall (openbsd-amd64), const SYS_SETRLIMIT ideal-int +pkg syscall (openbsd-amd64), const SYS_SETRTABLE ideal-int +pkg syscall (openbsd-amd64), const SYS_SETSID ideal-int +pkg syscall (openbsd-amd64), const SYS_SETSOCKOPT ideal-int +pkg syscall (openbsd-amd64), const SYS_SETTIMEOFDAY ideal-int +pkg syscall (openbsd-amd64), const SYS_SETUID ideal-int +pkg syscall (openbsd-amd64), const SYS_SHMAT ideal-int +pkg syscall (openbsd-amd64), const SYS_SHMCTL ideal-int +pkg syscall (openbsd-amd64), const SYS_SHMDT ideal-int +pkg syscall (openbsd-amd64), const SYS_SHMGET ideal-int +pkg syscall (openbsd-amd64), const SYS_SHUTDOWN ideal-int +pkg syscall (openbsd-amd64), const SYS_SIGACTION ideal-int +pkg syscall (openbsd-amd64), const SYS_SIGALTSTACK ideal-int +pkg syscall (openbsd-amd64), const SYS_SIGPENDING ideal-int +pkg syscall (openbsd-amd64), const SYS_SIGPROCMASK ideal-int +pkg syscall (openbsd-amd64), const SYS_SIGRETURN ideal-int +pkg syscall (openbsd-amd64), const SYS_SIGSUSPEND ideal-int +pkg syscall (openbsd-amd64), const SYS_SOCKET ideal-int +pkg syscall (openbsd-amd64), const SYS_SOCKETPAIR ideal-int +pkg syscall (openbsd-amd64), const SYS_STAT ideal-int +pkg syscall (openbsd-amd64), const SYS_STATFS ideal-int +pkg syscall (openbsd-amd64), const SYS_SWAPCTL ideal-int +pkg syscall (openbsd-amd64), const SYS_SYMLINK ideal-int +pkg syscall (openbsd-amd64), const SYS_SYMLINKAT ideal-int +pkg syscall (openbsd-amd64), const SYS_SYNC ideal-int +pkg syscall (openbsd-amd64), const SYS_SYSARCH ideal-int +pkg syscall (openbsd-amd64), const SYS_TRUNCATE ideal-int +pkg syscall (openbsd-amd64), const SYS_UMASK ideal-int +pkg syscall (openbsd-amd64), const SYS_UNLINK ideal-int +pkg syscall (openbsd-amd64), const SYS_UNLINKAT ideal-int +pkg syscall (openbsd-amd64), const SYS_UNMOUNT ideal-int +pkg syscall (openbsd-amd64), const SYS_UTIMENSAT ideal-int +pkg syscall (openbsd-amd64), const SYS_UTIMES ideal-int +pkg syscall (openbsd-amd64), const SYS_VFORK ideal-int +pkg syscall (openbsd-amd64), const SYS_WAIT4 ideal-int +pkg syscall (openbsd-amd64), const SYS_WRITE ideal-int +pkg syscall (openbsd-amd64), const SYS_WRITEV ideal-int +pkg syscall (openbsd-amd64), const SYS___GETCWD ideal-int +pkg syscall (openbsd-amd64), const SYS___GET_TCB ideal-int +pkg syscall (openbsd-amd64), const SYS___SEMCTL ideal-int +pkg syscall (openbsd-amd64), const SYS___SET_TCB ideal-int +pkg syscall (openbsd-amd64), const SYS___SYSCTL ideal-int +pkg syscall (openbsd-amd64), const SYS___TFORK ideal-int +pkg syscall (openbsd-amd64), const SYS___THREXIT ideal-int +pkg syscall (openbsd-amd64), const SYS___THRSIGDIVERT ideal-int +pkg syscall (openbsd-amd64), const SYS___THRSLEEP ideal-int +pkg syscall (openbsd-amd64), const SYS___THRWAKEUP ideal-int +pkg syscall (openbsd-amd64), const SizeofBpfHdr ideal-int +pkg syscall (openbsd-amd64), const SizeofBpfInsn ideal-int +pkg syscall (openbsd-amd64), const SizeofBpfProgram ideal-int +pkg syscall (openbsd-amd64), const SizeofBpfStat ideal-int +pkg syscall (openbsd-amd64), const SizeofBpfVersion ideal-int +pkg syscall (openbsd-amd64), const SizeofCmsghdr ideal-int +pkg syscall (openbsd-amd64), const SizeofICMPv6Filter = 32 +pkg syscall (openbsd-amd64), const SizeofICMPv6Filter ideal-int +pkg syscall (openbsd-amd64), const SizeofIPMreq ideal-int +pkg syscall (openbsd-amd64), const SizeofIPv6MTUInfo = 32 +pkg syscall (openbsd-amd64), const SizeofIPv6MTUInfo ideal-int +pkg syscall (openbsd-amd64), const SizeofIPv6Mreq ideal-int +pkg syscall (openbsd-amd64), const SizeofIfAnnounceMsghdr ideal-int +pkg syscall (openbsd-amd64), const SizeofIfData ideal-int +pkg syscall (openbsd-amd64), const SizeofIfMsghdr ideal-int +pkg syscall (openbsd-amd64), const SizeofIfaMsghdr ideal-int +pkg syscall (openbsd-amd64), const SizeofInet6Pktinfo ideal-int +pkg syscall (openbsd-amd64), const SizeofLinger ideal-int +pkg syscall (openbsd-amd64), const SizeofMsghdr ideal-int +pkg syscall (openbsd-amd64), const SizeofRtMetrics ideal-int +pkg syscall (openbsd-amd64), const SizeofRtMsghdr ideal-int +pkg syscall (openbsd-amd64), const SizeofSockaddrAny ideal-int +pkg syscall (openbsd-amd64), const SizeofSockaddrDatalink ideal-int +pkg syscall (openbsd-amd64), const SizeofSockaddrInet4 ideal-int +pkg syscall (openbsd-amd64), const SizeofSockaddrInet6 ideal-int +pkg syscall (openbsd-amd64), const SizeofSockaddrUnix ideal-int +pkg syscall (openbsd-amd64), const TCIFLUSH ideal-int +pkg syscall (openbsd-amd64), const TCIOFLUSH ideal-int +pkg syscall (openbsd-amd64), const TCOFLUSH ideal-int +pkg syscall (openbsd-amd64), const TCP_MAXBURST ideal-int +pkg syscall (openbsd-amd64), const TCP_MAXSEG ideal-int +pkg syscall (openbsd-amd64), const TCP_MAXWIN ideal-int +pkg syscall (openbsd-amd64), const TCP_MAX_SACK ideal-int +pkg syscall (openbsd-amd64), const TCP_MAX_WINSHIFT ideal-int +pkg syscall (openbsd-amd64), const TCP_MD5SIG ideal-int +pkg syscall (openbsd-amd64), const TCP_MSS ideal-int +pkg syscall (openbsd-amd64), const TCP_NSTATES ideal-int +pkg syscall (openbsd-amd64), const TCP_SACK_ENABLE ideal-int +pkg syscall (openbsd-amd64), const TCSAFLUSH ideal-int +pkg syscall (openbsd-amd64), const TIOCCBRK ideal-int +pkg syscall (openbsd-amd64), const TIOCCDTR ideal-int +pkg syscall (openbsd-amd64), const TIOCCONS ideal-int +pkg syscall (openbsd-amd64), const TIOCDRAIN ideal-int +pkg syscall (openbsd-amd64), const TIOCEXCL ideal-int +pkg syscall (openbsd-amd64), const TIOCEXT ideal-int +pkg syscall (openbsd-amd64), const TIOCFLAG_CLOCAL ideal-int +pkg syscall (openbsd-amd64), const TIOCFLAG_CRTSCTS ideal-int +pkg syscall (openbsd-amd64), const TIOCFLAG_MDMBUF ideal-int +pkg syscall (openbsd-amd64), const TIOCFLAG_PPS ideal-int +pkg syscall (openbsd-amd64), const TIOCFLAG_SOFTCAR ideal-int +pkg syscall (openbsd-amd64), const TIOCFLUSH ideal-int +pkg syscall (openbsd-amd64), const TIOCGETA ideal-int +pkg syscall (openbsd-amd64), const TIOCGETD ideal-int +pkg syscall (openbsd-amd64), const TIOCGFLAGS ideal-int +pkg syscall (openbsd-amd64), const TIOCGPGRP ideal-int +pkg syscall (openbsd-amd64), const TIOCGTSTAMP ideal-int +pkg syscall (openbsd-amd64), const TIOCGWINSZ ideal-int +pkg syscall (openbsd-amd64), const TIOCMBIC ideal-int +pkg syscall (openbsd-amd64), const TIOCMBIS ideal-int +pkg syscall (openbsd-amd64), const TIOCMGET ideal-int +pkg syscall (openbsd-amd64), const TIOCMODG ideal-int +pkg syscall (openbsd-amd64), const TIOCMODS ideal-int +pkg syscall (openbsd-amd64), const TIOCMSET ideal-int +pkg syscall (openbsd-amd64), const TIOCM_CAR ideal-int +pkg syscall (openbsd-amd64), const TIOCM_CD ideal-int +pkg syscall (openbsd-amd64), const TIOCM_CTS ideal-int +pkg syscall (openbsd-amd64), const TIOCM_DSR ideal-int +pkg syscall (openbsd-amd64), const TIOCM_DTR ideal-int +pkg syscall (openbsd-amd64), const TIOCM_LE ideal-int +pkg syscall (openbsd-amd64), const TIOCM_RI ideal-int +pkg syscall (openbsd-amd64), const TIOCM_RNG ideal-int +pkg syscall (openbsd-amd64), const TIOCM_RTS ideal-int +pkg syscall (openbsd-amd64), const TIOCM_SR ideal-int +pkg syscall (openbsd-amd64), const TIOCM_ST ideal-int +pkg syscall (openbsd-amd64), const TIOCNOTTY ideal-int +pkg syscall (openbsd-amd64), const TIOCNXCL ideal-int +pkg syscall (openbsd-amd64), const TIOCOUTQ ideal-int +pkg syscall (openbsd-amd64), const TIOCPKT ideal-int +pkg syscall (openbsd-amd64), const TIOCPKT_DATA ideal-int +pkg syscall (openbsd-amd64), const TIOCPKT_DOSTOP ideal-int +pkg syscall (openbsd-amd64), const TIOCPKT_FLUSHREAD ideal-int +pkg syscall (openbsd-amd64), const TIOCPKT_FLUSHWRITE ideal-int +pkg syscall (openbsd-amd64), const TIOCPKT_IOCTL ideal-int +pkg syscall (openbsd-amd64), const TIOCPKT_NOSTOP ideal-int +pkg syscall (openbsd-amd64), const TIOCPKT_START ideal-int +pkg syscall (openbsd-amd64), const TIOCPKT_STOP ideal-int +pkg syscall (openbsd-amd64), const TIOCREMOTE ideal-int +pkg syscall (openbsd-amd64), const TIOCSBRK ideal-int +pkg syscall (openbsd-amd64), const TIOCSCTTY ideal-int +pkg syscall (openbsd-amd64), const TIOCSDTR ideal-int +pkg syscall (openbsd-amd64), const TIOCSETA ideal-int +pkg syscall (openbsd-amd64), const TIOCSETAF ideal-int +pkg syscall (openbsd-amd64), const TIOCSETAW ideal-int +pkg syscall (openbsd-amd64), const TIOCSETD ideal-int +pkg syscall (openbsd-amd64), const TIOCSFLAGS ideal-int +pkg syscall (openbsd-amd64), const TIOCSIG ideal-int +pkg syscall (openbsd-amd64), const TIOCSPGRP ideal-int +pkg syscall (openbsd-amd64), const TIOCSTART ideal-int +pkg syscall (openbsd-amd64), const TIOCSTAT ideal-int +pkg syscall (openbsd-amd64), const TIOCSTI ideal-int +pkg syscall (openbsd-amd64), const TIOCSTOP ideal-int +pkg syscall (openbsd-amd64), const TIOCSTSTAMP ideal-int +pkg syscall (openbsd-amd64), const TIOCSWINSZ ideal-int +pkg syscall (openbsd-amd64), const TIOCUCNTL ideal-int +pkg syscall (openbsd-amd64), const TOSTOP ideal-int +pkg syscall (openbsd-amd64), const VDISCARD ideal-int +pkg syscall (openbsd-amd64), const VDSUSP ideal-int +pkg syscall (openbsd-amd64), const VEOF ideal-int +pkg syscall (openbsd-amd64), const VEOL ideal-int +pkg syscall (openbsd-amd64), const VEOL2 ideal-int +pkg syscall (openbsd-amd64), const VERASE ideal-int +pkg syscall (openbsd-amd64), const VINTR ideal-int +pkg syscall (openbsd-amd64), const VKILL ideal-int +pkg syscall (openbsd-amd64), const VLNEXT ideal-int +pkg syscall (openbsd-amd64), const VMIN ideal-int +pkg syscall (openbsd-amd64), const VQUIT ideal-int +pkg syscall (openbsd-amd64), const VREPRINT ideal-int +pkg syscall (openbsd-amd64), const VSTART ideal-int +pkg syscall (openbsd-amd64), const VSTATUS ideal-int +pkg syscall (openbsd-amd64), const VSTOP ideal-int +pkg syscall (openbsd-amd64), const VSUSP ideal-int +pkg syscall (openbsd-amd64), const VTIME ideal-int +pkg syscall (openbsd-amd64), const VWERASE ideal-int +pkg syscall (openbsd-amd64), const WALTSIG ideal-int +pkg syscall (openbsd-amd64), const WCONTINUED ideal-int +pkg syscall (openbsd-amd64), const WCOREFLAG ideal-int +pkg syscall (openbsd-amd64), const WNOHANG ideal-int +pkg syscall (openbsd-amd64), const WSTOPPED ideal-int +pkg syscall (openbsd-amd64), const WUNTRACED ideal-int +pkg syscall (openbsd-amd64), func Accept(int) (int, Sockaddr, error) +pkg syscall (openbsd-amd64), func Access(string, uint32) error +pkg syscall (openbsd-amd64), func Adjtime(*Timeval, *Timeval) error +pkg syscall (openbsd-amd64), func Bind(int, Sockaddr) error +pkg syscall (openbsd-amd64), func BpfBuflen(int) (int, error) +pkg syscall (openbsd-amd64), func BpfDatalink(int) (int, error) +pkg syscall (openbsd-amd64), func BpfHeadercmpl(int) (int, error) +pkg syscall (openbsd-amd64), func BpfInterface(int, string) (string, error) +pkg syscall (openbsd-amd64), func BpfJump(int, int, int, int) *BpfInsn +pkg syscall (openbsd-amd64), func BpfStats(int) (*BpfStat, error) +pkg syscall (openbsd-amd64), func BpfStmt(int, int) *BpfInsn +pkg syscall (openbsd-amd64), func BpfTimeout(int) (*Timeval, error) +pkg syscall (openbsd-amd64), func CheckBpfVersion(int) error +pkg syscall (openbsd-amd64), func Chflags(string, int) error +pkg syscall (openbsd-amd64), func Chroot(string) error +pkg syscall (openbsd-amd64), func Close(int) error +pkg syscall (openbsd-amd64), func CloseOnExec(int) +pkg syscall (openbsd-amd64), func CmsgLen(int) int +pkg syscall (openbsd-amd64), func CmsgSpace(int) int +pkg syscall (openbsd-amd64), func Connect(int, Sockaddr) error +pkg syscall (openbsd-amd64), func Dup(int) (int, error) +pkg syscall (openbsd-amd64), func Dup2(int, int) error +pkg syscall (openbsd-amd64), func Fchdir(int) error +pkg syscall (openbsd-amd64), func Fchflags(int, int) error +pkg syscall (openbsd-amd64), func Fchmod(int, uint32) error +pkg syscall (openbsd-amd64), func Fchown(int, int, int) error +pkg syscall (openbsd-amd64), func Flock(int, int) error +pkg syscall (openbsd-amd64), func FlushBpf(int) error +pkg syscall (openbsd-amd64), func ForkExec(string, []string, *ProcAttr) (int, error) +pkg syscall (openbsd-amd64), func Fpathconf(int, int) (int, error) +pkg syscall (openbsd-amd64), func Fstat(int, *Stat_t) error +pkg syscall (openbsd-amd64), func Fstatfs(int, *Statfs_t) error +pkg syscall (openbsd-amd64), func Fsync(int) error +pkg syscall (openbsd-amd64), func Ftruncate(int, int64) error +pkg syscall (openbsd-amd64), func Futimes(int, []Timeval) error +pkg syscall (openbsd-amd64), func Getdirentries(int, []uint8, *uintptr) (int, error) +pkg syscall (openbsd-amd64), func Getfsstat([]Statfs_t, int) (int, error) +pkg syscall (openbsd-amd64), func Getpeername(int) (Sockaddr, error) +pkg syscall (openbsd-amd64), func Getpgid(int) (int, error) +pkg syscall (openbsd-amd64), func Getpgrp() int +pkg syscall (openbsd-amd64), func Getpriority(int, int) (int, error) +pkg syscall (openbsd-amd64), func Getrlimit(int, *Rlimit) error +pkg syscall (openbsd-amd64), func Getrusage(int, *Rusage) error +pkg syscall (openbsd-amd64), func Getsid(int) (int, error) +pkg syscall (openbsd-amd64), func Getsockname(int) (Sockaddr, error) +pkg syscall (openbsd-amd64), func GetsockoptByte(int, int, int) (uint8, error) +pkg syscall (openbsd-amd64), func GetsockoptICMPv6Filter(int, int, int) (*ICMPv6Filter, error) +pkg syscall (openbsd-amd64), func GetsockoptIPMreq(int, int, int) (*IPMreq, error) +pkg syscall (openbsd-amd64), func GetsockoptIPv6MTUInfo(int, int, int) (*IPv6MTUInfo, error) +pkg syscall (openbsd-amd64), func GetsockoptIPv6Mreq(int, int, int) (*IPv6Mreq, error) +pkg syscall (openbsd-amd64), func GetsockoptInet4Addr(int, int, int) ([4]uint8, error) +pkg syscall (openbsd-amd64), func GetsockoptInt(int, int, int) (int, error) +pkg syscall (openbsd-amd64), func Issetugid() bool +pkg syscall (openbsd-amd64), func Kevent(int, []Kevent_t, []Kevent_t, *Timespec) (int, error) +pkg syscall (openbsd-amd64), func Kill(int, Signal) error +pkg syscall (openbsd-amd64), func Kqueue() (int, error) +pkg syscall (openbsd-amd64), func Listen(int, int) error +pkg syscall (openbsd-amd64), func Lstat(string, *Stat_t) error +pkg syscall (openbsd-amd64), func Mkfifo(string, uint32) error +pkg syscall (openbsd-amd64), func Mknod(string, uint32, int) error +pkg syscall (openbsd-amd64), func Mmap(int, int64, int, int, int) ([]uint8, error) +pkg syscall (openbsd-amd64), func Munmap([]uint8) error +pkg syscall (openbsd-amd64), func Nanosleep(*Timespec, *Timespec) error +pkg syscall (openbsd-amd64), func Open(string, int, uint32) (int, error) +pkg syscall (openbsd-amd64), func ParseDirent([]uint8, int, []string) (int, int, []string) +pkg syscall (openbsd-amd64), func ParseRoutingMessage([]uint8) ([]RoutingMessage, error) +pkg syscall (openbsd-amd64), func ParseRoutingSockaddr(RoutingMessage) ([]Sockaddr, error) +pkg syscall (openbsd-amd64), func ParseSocketControlMessage([]uint8) ([]SocketControlMessage, error) +pkg syscall (openbsd-amd64), func ParseUnixRights(*SocketControlMessage) ([]int, error) +pkg syscall (openbsd-amd64), func Pathconf(string, int) (int, error) +pkg syscall (openbsd-amd64), func Pipe([]int) error +pkg syscall (openbsd-amd64), func Pread(int, []uint8, int64) (int, error) +pkg syscall (openbsd-amd64), func Pwrite(int, []uint8, int64) (int, error) +pkg syscall (openbsd-amd64), func RawSyscall(uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno) +pkg syscall (openbsd-amd64), func RawSyscall6(uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno) +pkg syscall (openbsd-amd64), func Read(int, []uint8) (int, error) +pkg syscall (openbsd-amd64), func ReadDirent(int, []uint8) (int, error) +pkg syscall (openbsd-amd64), func Recvfrom(int, []uint8, int) (int, Sockaddr, error) +pkg syscall (openbsd-amd64), func Recvmsg(int, []uint8, []uint8, int) (int, int, int, Sockaddr, error) +pkg syscall (openbsd-amd64), func Revoke(string) error +pkg syscall (openbsd-amd64), func RouteRIB(int, int) ([]uint8, error) +pkg syscall (openbsd-amd64), func Seek(int, int64, int) (int64, error) +pkg syscall (openbsd-amd64), func Select(int, *FdSet, *FdSet, *FdSet, *Timeval) error +pkg syscall (openbsd-amd64), func Sendfile(int, int, *int64, int) (int, error) +pkg syscall (openbsd-amd64), func Sendmsg(int, []uint8, []uint8, Sockaddr, int) error +pkg syscall (openbsd-amd64), func Sendto(int, []uint8, int, Sockaddr) error +pkg syscall (openbsd-amd64), func SetBpf(int, []BpfInsn) error +pkg syscall (openbsd-amd64), func SetBpfBuflen(int, int) (int, error) +pkg syscall (openbsd-amd64), func SetBpfDatalink(int, int) (int, error) +pkg syscall (openbsd-amd64), func SetBpfHeadercmpl(int, int) error +pkg syscall (openbsd-amd64), func SetBpfImmediate(int, int) error +pkg syscall (openbsd-amd64), func SetBpfInterface(int, string) error +pkg syscall (openbsd-amd64), func SetBpfPromisc(int, int) error +pkg syscall (openbsd-amd64), func SetBpfTimeout(int, *Timeval) error +pkg syscall (openbsd-amd64), func SetKevent(*Kevent_t, int, int, int) +pkg syscall (openbsd-amd64), func SetNonblock(int, bool) error +pkg syscall (openbsd-amd64), func Setegid(int) error +pkg syscall (openbsd-amd64), func Seteuid(int) error +pkg syscall (openbsd-amd64), func Setgid(int) error +pkg syscall (openbsd-amd64), func Setgroups([]int) error +pkg syscall (openbsd-amd64), func Setlogin(string) error +pkg syscall (openbsd-amd64), func Setpgid(int, int) error +pkg syscall (openbsd-amd64), func Setpriority(int, int, int) error +pkg syscall (openbsd-amd64), func Setregid(int, int) error +pkg syscall (openbsd-amd64), func Setreuid(int, int) error +pkg syscall (openbsd-amd64), func Setrlimit(int, *Rlimit) error +pkg syscall (openbsd-amd64), func Setsid() (int, error) +pkg syscall (openbsd-amd64), func SetsockoptByte(int, int, int, uint8) error +pkg syscall (openbsd-amd64), func SetsockoptICMPv6Filter(int, int, int, *ICMPv6Filter) error +pkg syscall (openbsd-amd64), func SetsockoptIPMreq(int, int, int, *IPMreq) error +pkg syscall (openbsd-amd64), func SetsockoptIPv6Mreq(int, int, int, *IPv6Mreq) error +pkg syscall (openbsd-amd64), func SetsockoptInet4Addr(int, int, int, [4]uint8) error +pkg syscall (openbsd-amd64), func SetsockoptInt(int, int, int, int) error +pkg syscall (openbsd-amd64), func SetsockoptLinger(int, int, int, *Linger) error +pkg syscall (openbsd-amd64), func SetsockoptString(int, int, int, string) error +pkg syscall (openbsd-amd64), func SetsockoptTimeval(int, int, int, *Timeval) error +pkg syscall (openbsd-amd64), func Settimeofday(*Timeval) error +pkg syscall (openbsd-amd64), func Setuid(int) error +pkg syscall (openbsd-amd64), func Shutdown(int, int) error +pkg syscall (openbsd-amd64), func SlicePtrFromStrings([]string) ([]*uint8, error) +pkg syscall (openbsd-amd64), func Socket(int, int, int) (int, error) +pkg syscall (openbsd-amd64), func Socketpair(int, int, int) ([2]int, error) +pkg syscall (openbsd-amd64), func Stat(string, *Stat_t) error +pkg syscall (openbsd-amd64), func Statfs(string, *Statfs_t) error +pkg syscall (openbsd-amd64), func StringSlicePtr([]string) []*uint8 +pkg syscall (openbsd-amd64), func Sync() error +pkg syscall (openbsd-amd64), func Syscall(uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno) +pkg syscall (openbsd-amd64), func Syscall6(uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno) +pkg syscall (openbsd-amd64), func Syscall9(uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno) +pkg syscall (openbsd-amd64), func Sysctl(string) (string, error) +pkg syscall (openbsd-amd64), func SysctlUint32(string) (uint32, error) +pkg syscall (openbsd-amd64), func TimevalToNsec(Timeval) int64 +pkg syscall (openbsd-amd64), func Truncate(string, int64) error +pkg syscall (openbsd-amd64), func Umask(int) int +pkg syscall (openbsd-amd64), func UnixRights(...int) []uint8 +pkg syscall (openbsd-amd64), func Unmount(string, int) error +pkg syscall (openbsd-amd64), func Wait4(int, *WaitStatus, int, *Rusage) (int, error) +pkg syscall (openbsd-amd64), func Write(int, []uint8) (int, error) +pkg syscall (openbsd-amd64), method (*Cmsghdr) SetLen(int) +pkg syscall (openbsd-amd64), method (*Iovec) SetLen(int) +pkg syscall (openbsd-amd64), method (*Msghdr) SetControllen(int) +pkg syscall (openbsd-amd64), type BpfHdr struct +pkg syscall (openbsd-amd64), type BpfHdr struct, Caplen uint32 +pkg syscall (openbsd-amd64), type BpfHdr struct, Datalen uint32 +pkg syscall (openbsd-amd64), type BpfHdr struct, Hdrlen uint16 +pkg syscall (openbsd-amd64), type BpfHdr struct, Pad_cgo_0 [2]uint8 +pkg syscall (openbsd-amd64), type BpfHdr struct, Tstamp BpfTimeval +pkg syscall (openbsd-amd64), type BpfInsn struct +pkg syscall (openbsd-amd64), type BpfInsn struct, Code uint16 +pkg syscall (openbsd-amd64), type BpfInsn struct, Jf uint8 +pkg syscall (openbsd-amd64), type BpfInsn struct, Jt uint8 +pkg syscall (openbsd-amd64), type BpfInsn struct, K uint32 +pkg syscall (openbsd-amd64), type BpfProgram struct +pkg syscall (openbsd-amd64), type BpfProgram struct, Insns *BpfInsn +pkg syscall (openbsd-amd64), type BpfProgram struct, Len uint32 +pkg syscall (openbsd-amd64), type BpfProgram struct, Pad_cgo_0 [4]uint8 +pkg syscall (openbsd-amd64), type BpfStat struct +pkg syscall (openbsd-amd64), type BpfStat struct, Drop uint32 +pkg syscall (openbsd-amd64), type BpfStat struct, Recv uint32 +pkg syscall (openbsd-amd64), type BpfTimeval struct +pkg syscall (openbsd-amd64), type BpfTimeval struct, Sec uint32 +pkg syscall (openbsd-amd64), type BpfTimeval struct, Usec uint32 +pkg syscall (openbsd-amd64), type BpfVersion struct +pkg syscall (openbsd-amd64), type BpfVersion struct, Major uint16 +pkg syscall (openbsd-amd64), type BpfVersion struct, Minor uint16 +pkg syscall (openbsd-amd64), type Cmsghdr struct +pkg syscall (openbsd-amd64), type Cmsghdr struct, Len uint32 +pkg syscall (openbsd-amd64), type Cmsghdr struct, Level int32 +pkg syscall (openbsd-amd64), type Cmsghdr struct, Type int32 +pkg syscall (openbsd-amd64), type Credential struct +pkg syscall (openbsd-amd64), type Credential struct, Gid uint32 +pkg syscall (openbsd-amd64), type Credential struct, Groups []uint32 +pkg syscall (openbsd-amd64), type Credential struct, Uid uint32 +pkg syscall (openbsd-amd64), type Dirent struct +pkg syscall (openbsd-amd64), type Dirent struct, Fileno uint32 +pkg syscall (openbsd-amd64), type Dirent struct, Name [256]int8 +pkg syscall (openbsd-amd64), type Dirent struct, Namlen uint8 +pkg syscall (openbsd-amd64), type Dirent struct, Reclen uint16 +pkg syscall (openbsd-amd64), type Dirent struct, Type uint8 +pkg syscall (openbsd-amd64), type FdSet struct +pkg syscall (openbsd-amd64), type FdSet struct, Bits [32]int32 +pkg syscall (openbsd-amd64), type Flock_t struct +pkg syscall (openbsd-amd64), type Flock_t struct, Len int64 +pkg syscall (openbsd-amd64), type Flock_t struct, Pid int32 +pkg syscall (openbsd-amd64), type Flock_t struct, Start int64 +pkg syscall (openbsd-amd64), type Flock_t struct, Type int16 +pkg syscall (openbsd-amd64), type Flock_t struct, Whence int16 +pkg syscall (openbsd-amd64), type Fsid struct +pkg syscall (openbsd-amd64), type Fsid struct, Val [2]int32 +pkg syscall (openbsd-amd64), type ICMPv6Filter struct +pkg syscall (openbsd-amd64), type ICMPv6Filter struct, Filt [8]uint32 +pkg syscall (openbsd-amd64), type IPv6MTUInfo struct +pkg syscall (openbsd-amd64), type IPv6MTUInfo struct, Addr RawSockaddrInet6 +pkg syscall (openbsd-amd64), type IPv6MTUInfo struct, Mtu uint32 +pkg syscall (openbsd-amd64), type IfAnnounceMsghdr struct +pkg syscall (openbsd-amd64), type IfAnnounceMsghdr struct, Hdrlen uint16 +pkg syscall (openbsd-amd64), type IfAnnounceMsghdr struct, Index uint16 +pkg syscall (openbsd-amd64), type IfAnnounceMsghdr struct, Msglen uint16 +pkg syscall (openbsd-amd64), type IfAnnounceMsghdr struct, Name [16]int8 +pkg syscall (openbsd-amd64), type IfAnnounceMsghdr struct, Type uint8 +pkg syscall (openbsd-amd64), type IfAnnounceMsghdr struct, Version uint8 +pkg syscall (openbsd-amd64), type IfAnnounceMsghdr struct, What uint16 +pkg syscall (openbsd-amd64), type IfData struct +pkg syscall (openbsd-amd64), type IfData struct, Addrlen uint8 +pkg syscall (openbsd-amd64), type IfData struct, Baudrate uint64 +pkg syscall (openbsd-amd64), type IfData struct, Capabilities uint32 +pkg syscall (openbsd-amd64), type IfData struct, Collisions uint64 +pkg syscall (openbsd-amd64), type IfData struct, Hdrlen uint8 +pkg syscall (openbsd-amd64), type IfData struct, Ibytes uint64 +pkg syscall (openbsd-amd64), type IfData struct, Ierrors uint64 +pkg syscall (openbsd-amd64), type IfData struct, Imcasts uint64 +pkg syscall (openbsd-amd64), type IfData struct, Ipackets uint64 +pkg syscall (openbsd-amd64), type IfData struct, Iqdrops uint64 +pkg syscall (openbsd-amd64), type IfData struct, Lastchange Timeval +pkg syscall (openbsd-amd64), type IfData struct, Link_state uint8 +pkg syscall (openbsd-amd64), type IfData struct, Mclpool [7]Mclpool +pkg syscall (openbsd-amd64), type IfData struct, Metric uint32 +pkg syscall (openbsd-amd64), type IfData struct, Mtu uint32 +pkg syscall (openbsd-amd64), type IfData struct, Noproto uint64 +pkg syscall (openbsd-amd64), type IfData struct, Obytes uint64 +pkg syscall (openbsd-amd64), type IfData struct, Oerrors uint64 +pkg syscall (openbsd-amd64), type IfData struct, Omcasts uint64 +pkg syscall (openbsd-amd64), type IfData struct, Opackets uint64 +pkg syscall (openbsd-amd64), type IfData struct, Pad uint32 +pkg syscall (openbsd-amd64), type IfData struct, Pad_cgo_0 [4]uint8 +pkg syscall (openbsd-amd64), type IfData struct, Pad_cgo_1 [4]uint8 +pkg syscall (openbsd-amd64), type IfData struct, Type uint8 +pkg syscall (openbsd-amd64), type IfMsghdr struct +pkg syscall (openbsd-amd64), type IfMsghdr struct, Addrs int32 +pkg syscall (openbsd-amd64), type IfMsghdr struct, Data IfData +pkg syscall (openbsd-amd64), type IfMsghdr struct, Flags int32 +pkg syscall (openbsd-amd64), type IfMsghdr struct, Hdrlen uint16 +pkg syscall (openbsd-amd64), type IfMsghdr struct, Index uint16 +pkg syscall (openbsd-amd64), type IfMsghdr struct, Msglen uint16 +pkg syscall (openbsd-amd64), type IfMsghdr struct, Pad1 uint8 +pkg syscall (openbsd-amd64), type IfMsghdr struct, Pad2 uint8 +pkg syscall (openbsd-amd64), type IfMsghdr struct, Tableid uint16 +pkg syscall (openbsd-amd64), type IfMsghdr struct, Type uint8 +pkg syscall (openbsd-amd64), type IfMsghdr struct, Version uint8 +pkg syscall (openbsd-amd64), type IfMsghdr struct, Xflags int32 +pkg syscall (openbsd-amd64), type IfaMsghdr struct +pkg syscall (openbsd-amd64), type IfaMsghdr struct, Addrs int32 +pkg syscall (openbsd-amd64), type IfaMsghdr struct, Flags int32 +pkg syscall (openbsd-amd64), type IfaMsghdr struct, Hdrlen uint16 +pkg syscall (openbsd-amd64), type IfaMsghdr struct, Index uint16 +pkg syscall (openbsd-amd64), type IfaMsghdr struct, Metric int32 +pkg syscall (openbsd-amd64), type IfaMsghdr struct, Msglen uint16 +pkg syscall (openbsd-amd64), type IfaMsghdr struct, Pad1 uint8 +pkg syscall (openbsd-amd64), type IfaMsghdr struct, Pad2 uint8 +pkg syscall (openbsd-amd64), type IfaMsghdr struct, Tableid uint16 +pkg syscall (openbsd-amd64), type IfaMsghdr struct, Type uint8 +pkg syscall (openbsd-amd64), type IfaMsghdr struct, Version uint8 +pkg syscall (openbsd-amd64), type Inet6Pktinfo struct +pkg syscall (openbsd-amd64), type Inet6Pktinfo struct, Addr [16]uint8 +pkg syscall (openbsd-amd64), type Inet6Pktinfo struct, Ifindex uint32 +pkg syscall (openbsd-amd64), type InterfaceAddrMessage struct +pkg syscall (openbsd-amd64), type InterfaceAddrMessage struct, Data []uint8 +pkg syscall (openbsd-amd64), type InterfaceAddrMessage struct, Header IfaMsghdr +pkg syscall (openbsd-amd64), type InterfaceAnnounceMessage struct +pkg syscall (openbsd-amd64), type InterfaceAnnounceMessage struct, Header IfAnnounceMsghdr +pkg syscall (openbsd-amd64), type InterfaceMessage struct +pkg syscall (openbsd-amd64), type InterfaceMessage struct, Data []uint8 +pkg syscall (openbsd-amd64), type InterfaceMessage struct, Header IfMsghdr +pkg syscall (openbsd-amd64), type Iovec struct +pkg syscall (openbsd-amd64), type Iovec struct, Base *uint8 +pkg syscall (openbsd-amd64), type Iovec struct, Len uint64 +pkg syscall (openbsd-amd64), type Kevent_t struct +pkg syscall (openbsd-amd64), type Kevent_t struct, Data int32 +pkg syscall (openbsd-amd64), type Kevent_t struct, Fflags uint32 +pkg syscall (openbsd-amd64), type Kevent_t struct, Filter int16 +pkg syscall (openbsd-amd64), type Kevent_t struct, Flags uint16 +pkg syscall (openbsd-amd64), type Kevent_t struct, Ident uint32 +pkg syscall (openbsd-amd64), type Kevent_t struct, Udata *uint8 +pkg syscall (openbsd-amd64), type Mclpool struct +pkg syscall (openbsd-amd64), type Mclpool struct, Alive uint16 +pkg syscall (openbsd-amd64), type Mclpool struct, Cwm uint16 +pkg syscall (openbsd-amd64), type Mclpool struct, Grown uint32 +pkg syscall (openbsd-amd64), type Mclpool struct, Hwm uint16 +pkg syscall (openbsd-amd64), type Mclpool struct, Lwm uint16 +pkg syscall (openbsd-amd64), type Msghdr struct +pkg syscall (openbsd-amd64), type Msghdr struct, Control *uint8 +pkg syscall (openbsd-amd64), type Msghdr struct, Controllen uint32 +pkg syscall (openbsd-amd64), type Msghdr struct, Flags int32 +pkg syscall (openbsd-amd64), type Msghdr struct, Iov *Iovec +pkg syscall (openbsd-amd64), type Msghdr struct, Iovlen uint32 +pkg syscall (openbsd-amd64), type Msghdr struct, Name *uint8 +pkg syscall (openbsd-amd64), type Msghdr struct, Namelen uint32 +pkg syscall (openbsd-amd64), type Msghdr struct, Pad_cgo_0 [4]uint8 +pkg syscall (openbsd-amd64), type Msghdr struct, Pad_cgo_1 [4]uint8 +pkg syscall (openbsd-amd64), type RawSockaddr struct, Data [14]int8 +pkg syscall (openbsd-amd64), type RawSockaddr struct, Family uint8 +pkg syscall (openbsd-amd64), type RawSockaddr struct, Len uint8 +pkg syscall (openbsd-amd64), type RawSockaddrAny struct, Pad [92]int8 +pkg syscall (openbsd-amd64), type RawSockaddrDatalink struct +pkg syscall (openbsd-amd64), type RawSockaddrDatalink struct, Alen uint8 +pkg syscall (openbsd-amd64), type RawSockaddrDatalink struct, Data [24]int8 +pkg syscall (openbsd-amd64), type RawSockaddrDatalink struct, Family uint8 +pkg syscall (openbsd-amd64), type RawSockaddrDatalink struct, Index uint16 +pkg syscall (openbsd-amd64), type RawSockaddrDatalink struct, Len uint8 +pkg syscall (openbsd-amd64), type RawSockaddrDatalink struct, Nlen uint8 +pkg syscall (openbsd-amd64), type RawSockaddrDatalink struct, Slen uint8 +pkg syscall (openbsd-amd64), type RawSockaddrDatalink struct, Type uint8 +pkg syscall (openbsd-amd64), type RawSockaddrInet4 struct, Family uint8 +pkg syscall (openbsd-amd64), type RawSockaddrInet4 struct, Len uint8 +pkg syscall (openbsd-amd64), type RawSockaddrInet4 struct, Zero [8]int8 +pkg syscall (openbsd-amd64), type RawSockaddrInet6 struct, Family uint8 +pkg syscall (openbsd-amd64), type RawSockaddrInet6 struct, Len uint8 +pkg syscall (openbsd-amd64), type RawSockaddrUnix struct +pkg syscall (openbsd-amd64), type RawSockaddrUnix struct, Family uint8 +pkg syscall (openbsd-amd64), type RawSockaddrUnix struct, Len uint8 +pkg syscall (openbsd-amd64), type RawSockaddrUnix struct, Path [104]int8 +pkg syscall (openbsd-amd64), type Rlimit struct +pkg syscall (openbsd-amd64), type Rlimit struct, Cur uint64 +pkg syscall (openbsd-amd64), type Rlimit struct, Max uint64 +pkg syscall (openbsd-amd64), type RouteMessage struct +pkg syscall (openbsd-amd64), type RouteMessage struct, Data []uint8 +pkg syscall (openbsd-amd64), type RouteMessage struct, Header RtMsghdr +pkg syscall (openbsd-amd64), type RoutingMessage interface, unexported methods +pkg syscall (openbsd-amd64), type RtMetrics struct +pkg syscall (openbsd-amd64), type RtMetrics struct, Expire uint32 +pkg syscall (openbsd-amd64), type RtMetrics struct, Hopcount uint32 +pkg syscall (openbsd-amd64), type RtMetrics struct, Locks uint32 +pkg syscall (openbsd-amd64), type RtMetrics struct, Mtu uint32 +pkg syscall (openbsd-amd64), type RtMetrics struct, Pksent uint64 +pkg syscall (openbsd-amd64), type RtMetrics struct, Recvpipe uint32 +pkg syscall (openbsd-amd64), type RtMetrics struct, Refcnt uint32 +pkg syscall (openbsd-amd64), type RtMetrics struct, Rtt uint32 +pkg syscall (openbsd-amd64), type RtMetrics struct, Rttvar uint32 +pkg syscall (openbsd-amd64), type RtMetrics struct, Sendpipe uint32 +pkg syscall (openbsd-amd64), type RtMetrics struct, Ssthresh uint32 +pkg syscall (openbsd-amd64), type RtMsghdr struct +pkg syscall (openbsd-amd64), type RtMsghdr struct, Addrs int32 +pkg syscall (openbsd-amd64), type RtMsghdr struct, Errno int32 +pkg syscall (openbsd-amd64), type RtMsghdr struct, Flags int32 +pkg syscall (openbsd-amd64), type RtMsghdr struct, Fmask int32 +pkg syscall (openbsd-amd64), type RtMsghdr struct, Hdrlen uint16 +pkg syscall (openbsd-amd64), type RtMsghdr struct, Index uint16 +pkg syscall (openbsd-amd64), type RtMsghdr struct, Inits uint32 +pkg syscall (openbsd-amd64), type RtMsghdr struct, Mpls uint8 +pkg syscall (openbsd-amd64), type RtMsghdr struct, Msglen uint16 +pkg syscall (openbsd-amd64), type RtMsghdr struct, Pid int32 +pkg syscall (openbsd-amd64), type RtMsghdr struct, Priority uint8 +pkg syscall (openbsd-amd64), type RtMsghdr struct, Rmx RtMetrics +pkg syscall (openbsd-amd64), type RtMsghdr struct, Seq int32 +pkg syscall (openbsd-amd64), type RtMsghdr struct, Tableid uint16 +pkg syscall (openbsd-amd64), type RtMsghdr struct, Type uint8 +pkg syscall (openbsd-amd64), type RtMsghdr struct, Version uint8 +pkg syscall (openbsd-amd64), type Rusage struct, Idrss int64 +pkg syscall (openbsd-amd64), type Rusage struct, Inblock int64 +pkg syscall (openbsd-amd64), type Rusage struct, Isrss int64 +pkg syscall (openbsd-amd64), type Rusage struct, Ixrss int64 +pkg syscall (openbsd-amd64), type Rusage struct, Majflt int64 +pkg syscall (openbsd-amd64), type Rusage struct, Maxrss int64 +pkg syscall (openbsd-amd64), type Rusage struct, Minflt int64 +pkg syscall (openbsd-amd64), type Rusage struct, Msgrcv int64 +pkg syscall (openbsd-amd64), type Rusage struct, Msgsnd int64 +pkg syscall (openbsd-amd64), type Rusage struct, Nivcsw int64 +pkg syscall (openbsd-amd64), type Rusage struct, Nsignals int64 +pkg syscall (openbsd-amd64), type Rusage struct, Nswap int64 +pkg syscall (openbsd-amd64), type Rusage struct, Nvcsw int64 +pkg syscall (openbsd-amd64), type Rusage struct, Oublock int64 +pkg syscall (openbsd-amd64), type Rusage struct, Stime Timeval +pkg syscall (openbsd-amd64), type Rusage struct, Utime Timeval +pkg syscall (openbsd-amd64), type SockaddrDatalink struct +pkg syscall (openbsd-amd64), type SockaddrDatalink struct, Alen uint8 +pkg syscall (openbsd-amd64), type SockaddrDatalink struct, Data [24]int8 +pkg syscall (openbsd-amd64), type SockaddrDatalink struct, Family uint8 +pkg syscall (openbsd-amd64), type SockaddrDatalink struct, Index uint16 +pkg syscall (openbsd-amd64), type SockaddrDatalink struct, Len uint8 +pkg syscall (openbsd-amd64), type SockaddrDatalink struct, Nlen uint8 +pkg syscall (openbsd-amd64), type SockaddrDatalink struct, Slen uint8 +pkg syscall (openbsd-amd64), type SockaddrDatalink struct, Type uint8 +pkg syscall (openbsd-amd64), type SocketControlMessage struct +pkg syscall (openbsd-amd64), type SocketControlMessage struct, Data []uint8 +pkg syscall (openbsd-amd64), type SocketControlMessage struct, Header Cmsghdr +pkg syscall (openbsd-amd64), type Stat_t struct +pkg syscall (openbsd-amd64), type Stat_t struct, Atim Timespec +pkg syscall (openbsd-amd64), type Stat_t struct, Blksize uint32 +pkg syscall (openbsd-amd64), type Stat_t struct, Blocks int64 +pkg syscall (openbsd-amd64), type Stat_t struct, Ctim Timespec +pkg syscall (openbsd-amd64), type Stat_t struct, Dev int32 +pkg syscall (openbsd-amd64), type Stat_t struct, Flags uint32 +pkg syscall (openbsd-amd64), type Stat_t struct, Gen uint32 +pkg syscall (openbsd-amd64), type Stat_t struct, Gid uint32 +pkg syscall (openbsd-amd64), type Stat_t struct, Ino uint32 +pkg syscall (openbsd-amd64), type Stat_t struct, Lspare0 int32 +pkg syscall (openbsd-amd64), type Stat_t struct, Lspare1 int32 +pkg syscall (openbsd-amd64), type Stat_t struct, Mode uint32 +pkg syscall (openbsd-amd64), type Stat_t struct, Mtim Timespec +pkg syscall (openbsd-amd64), type Stat_t struct, Nlink uint32 +pkg syscall (openbsd-amd64), type Stat_t struct, Qspare [2]int64 +pkg syscall (openbsd-amd64), type Stat_t struct, Rdev int32 +pkg syscall (openbsd-amd64), type Stat_t struct, Size int64 +pkg syscall (openbsd-amd64), type Stat_t struct, Uid uint32 +pkg syscall (openbsd-amd64), type Stat_t struct, X__st_birthtim Timespec +pkg syscall (openbsd-amd64), type Statfs_t struct +pkg syscall (openbsd-amd64), type Statfs_t struct, F_asyncreads uint64 +pkg syscall (openbsd-amd64), type Statfs_t struct, F_asyncwrites uint64 +pkg syscall (openbsd-amd64), type Statfs_t struct, F_bavail int64 +pkg syscall (openbsd-amd64), type Statfs_t struct, F_bfree uint64 +pkg syscall (openbsd-amd64), type Statfs_t struct, F_blocks uint64 +pkg syscall (openbsd-amd64), type Statfs_t struct, F_bsize uint32 +pkg syscall (openbsd-amd64), type Statfs_t struct, F_ctime uint32 +pkg syscall (openbsd-amd64), type Statfs_t struct, F_favail int64 +pkg syscall (openbsd-amd64), type Statfs_t struct, F_ffree uint64 +pkg syscall (openbsd-amd64), type Statfs_t struct, F_files uint64 +pkg syscall (openbsd-amd64), type Statfs_t struct, F_flags uint32 +pkg syscall (openbsd-amd64), type Statfs_t struct, F_fsid Fsid +pkg syscall (openbsd-amd64), type Statfs_t struct, F_fstypename [16]int8 +pkg syscall (openbsd-amd64), type Statfs_t struct, F_iosize uint32 +pkg syscall (openbsd-amd64), type Statfs_t struct, F_mntfromname [90]int8 +pkg syscall (openbsd-amd64), type Statfs_t struct, F_mntonname [90]int8 +pkg syscall (openbsd-amd64), type Statfs_t struct, F_namemax uint32 +pkg syscall (openbsd-amd64), type Statfs_t struct, F_owner uint32 +pkg syscall (openbsd-amd64), type Statfs_t struct, F_spare [3]uint32 +pkg syscall (openbsd-amd64), type Statfs_t struct, F_syncreads uint64 +pkg syscall (openbsd-amd64), type Statfs_t struct, F_syncwrites uint64 +pkg syscall (openbsd-amd64), type Statfs_t struct, Mount_info [160]uint8 +pkg syscall (openbsd-amd64), type Statfs_t struct, Pad_cgo_0 [4]uint8 +pkg syscall (openbsd-amd64), type Statfs_t struct, Pad_cgo_1 [4]uint8 +pkg syscall (openbsd-amd64), type SysProcAttr struct, Chroot string +pkg syscall (openbsd-amd64), type SysProcAttr struct, Credential *Credential +pkg syscall (openbsd-amd64), type SysProcAttr struct, Noctty bool +pkg syscall (openbsd-amd64), type SysProcAttr struct, Ptrace bool +pkg syscall (openbsd-amd64), type SysProcAttr struct, Setctty bool +pkg syscall (openbsd-amd64), type SysProcAttr struct, Setpgid bool +pkg syscall (openbsd-amd64), type SysProcAttr struct, Setsid bool +pkg syscall (openbsd-amd64), type Timespec struct, Nsec int64 +pkg syscall (openbsd-amd64), type Timespec struct, Pad_cgo_0 [4]uint8 +pkg syscall (openbsd-amd64), type Timespec struct, Sec int32 +pkg syscall (openbsd-amd64), type Timeval struct, Sec int64 +pkg syscall (openbsd-amd64), type Timeval struct, Usec int64 +pkg syscall (openbsd-amd64), type WaitStatus uint32 +pkg syscall (openbsd-amd64), var Stderr int +pkg syscall (openbsd-amd64), var Stdin int +pkg syscall (openbsd-amd64), var Stdout int +pkg syscall (openbsd-amd64-cgo), const AF_APPLETALK ideal-int +pkg syscall (openbsd-amd64-cgo), const AF_BLUETOOTH ideal-int +pkg syscall (openbsd-amd64-cgo), const AF_CCITT ideal-int +pkg syscall (openbsd-amd64-cgo), const AF_CHAOS ideal-int +pkg syscall (openbsd-amd64-cgo), const AF_CNT ideal-int +pkg syscall (openbsd-amd64-cgo), const AF_COIP ideal-int +pkg syscall (openbsd-amd64-cgo), const AF_DATAKIT ideal-int +pkg syscall (openbsd-amd64-cgo), const AF_DECnet ideal-int +pkg syscall (openbsd-amd64-cgo), const AF_DLI ideal-int +pkg syscall (openbsd-amd64-cgo), const AF_E164 ideal-int +pkg syscall (openbsd-amd64-cgo), const AF_ECMA ideal-int +pkg syscall (openbsd-amd64-cgo), const AF_ENCAP ideal-int +pkg syscall (openbsd-amd64-cgo), const AF_HYLINK ideal-int +pkg syscall (openbsd-amd64-cgo), const AF_IMPLINK ideal-int +pkg syscall (openbsd-amd64-cgo), const AF_IPX ideal-int +pkg syscall (openbsd-amd64-cgo), const AF_ISDN ideal-int +pkg syscall (openbsd-amd64-cgo), const AF_ISO ideal-int +pkg syscall (openbsd-amd64-cgo), const AF_KEY ideal-int +pkg syscall (openbsd-amd64-cgo), const AF_LAT ideal-int +pkg syscall (openbsd-amd64-cgo), const AF_LINK ideal-int +pkg syscall (openbsd-amd64-cgo), const AF_LOCAL ideal-int +pkg syscall (openbsd-amd64-cgo), const AF_MAX ideal-int +pkg syscall (openbsd-amd64-cgo), const AF_MPLS ideal-int +pkg syscall (openbsd-amd64-cgo), const AF_NATM ideal-int +pkg syscall (openbsd-amd64-cgo), const AF_NS ideal-int +pkg syscall (openbsd-amd64-cgo), const AF_OSI ideal-int +pkg syscall (openbsd-amd64-cgo), const AF_PUP ideal-int +pkg syscall (openbsd-amd64-cgo), const AF_ROUTE ideal-int +pkg syscall (openbsd-amd64-cgo), const AF_SIP ideal-int +pkg syscall (openbsd-amd64-cgo), const AF_SNA ideal-int +pkg syscall (openbsd-amd64-cgo), const ARPHRD_ETHER ideal-int +pkg syscall (openbsd-amd64-cgo), const ARPHRD_FRELAY ideal-int +pkg syscall (openbsd-amd64-cgo), const ARPHRD_IEEE1394 ideal-int +pkg syscall (openbsd-amd64-cgo), const ARPHRD_IEEE802 ideal-int +pkg syscall (openbsd-amd64-cgo), const B0 ideal-int +pkg syscall (openbsd-amd64-cgo), const B110 ideal-int +pkg syscall (openbsd-amd64-cgo), const B115200 ideal-int +pkg syscall (openbsd-amd64-cgo), const B1200 ideal-int +pkg syscall (openbsd-amd64-cgo), const B134 ideal-int +pkg syscall (openbsd-amd64-cgo), const B14400 ideal-int +pkg syscall (openbsd-amd64-cgo), const B150 ideal-int +pkg syscall (openbsd-amd64-cgo), const B1800 ideal-int +pkg syscall (openbsd-amd64-cgo), const B19200 ideal-int +pkg syscall (openbsd-amd64-cgo), const B200 ideal-int +pkg syscall (openbsd-amd64-cgo), const B230400 ideal-int +pkg syscall (openbsd-amd64-cgo), const B2400 ideal-int +pkg syscall (openbsd-amd64-cgo), const B28800 ideal-int +pkg syscall (openbsd-amd64-cgo), const B300 ideal-int +pkg syscall (openbsd-amd64-cgo), const B38400 ideal-int +pkg syscall (openbsd-amd64-cgo), const B4800 ideal-int +pkg syscall (openbsd-amd64-cgo), const B50 ideal-int +pkg syscall (openbsd-amd64-cgo), const B57600 ideal-int +pkg syscall (openbsd-amd64-cgo), const B600 ideal-int +pkg syscall (openbsd-amd64-cgo), const B7200 ideal-int +pkg syscall (openbsd-amd64-cgo), const B75 ideal-int +pkg syscall (openbsd-amd64-cgo), const B76800 ideal-int +pkg syscall (openbsd-amd64-cgo), const B9600 ideal-int +pkg syscall (openbsd-amd64-cgo), const BIOCFLUSH ideal-int +pkg syscall (openbsd-amd64-cgo), const BIOCGBLEN ideal-int +pkg syscall (openbsd-amd64-cgo), const BIOCGDIRFILT ideal-int +pkg syscall (openbsd-amd64-cgo), const BIOCGDLT ideal-int +pkg syscall (openbsd-amd64-cgo), const BIOCGDLTLIST ideal-int +pkg syscall (openbsd-amd64-cgo), const BIOCGETIF ideal-int +pkg syscall (openbsd-amd64-cgo), const BIOCGFILDROP ideal-int +pkg syscall (openbsd-amd64-cgo), const BIOCGHDRCMPLT ideal-int +pkg syscall (openbsd-amd64-cgo), const BIOCGRSIG ideal-int +pkg syscall (openbsd-amd64-cgo), const BIOCGRTIMEOUT ideal-int +pkg syscall (openbsd-amd64-cgo), const BIOCGSTATS ideal-int +pkg syscall (openbsd-amd64-cgo), const BIOCIMMEDIATE ideal-int +pkg syscall (openbsd-amd64-cgo), const BIOCLOCK ideal-int +pkg syscall (openbsd-amd64-cgo), const BIOCPROMISC ideal-int +pkg syscall (openbsd-amd64-cgo), const BIOCSBLEN ideal-int +pkg syscall (openbsd-amd64-cgo), const BIOCSDIRFILT ideal-int +pkg syscall (openbsd-amd64-cgo), const BIOCSDLT ideal-int +pkg syscall (openbsd-amd64-cgo), const BIOCSETF ideal-int +pkg syscall (openbsd-amd64-cgo), const BIOCSETIF ideal-int +pkg syscall (openbsd-amd64-cgo), const BIOCSETWF ideal-int +pkg syscall (openbsd-amd64-cgo), const BIOCSFILDROP ideal-int +pkg syscall (openbsd-amd64-cgo), const BIOCSHDRCMPLT ideal-int +pkg syscall (openbsd-amd64-cgo), const BIOCSRSIG ideal-int +pkg syscall (openbsd-amd64-cgo), const BIOCSRTIMEOUT ideal-int +pkg syscall (openbsd-amd64-cgo), const BIOCVERSION ideal-int +pkg syscall (openbsd-amd64-cgo), const BPF_A ideal-int +pkg syscall (openbsd-amd64-cgo), const BPF_ABS ideal-int +pkg syscall (openbsd-amd64-cgo), const BPF_ADD ideal-int +pkg syscall (openbsd-amd64-cgo), const BPF_ALIGNMENT ideal-int +pkg syscall (openbsd-amd64-cgo), const BPF_ALU ideal-int +pkg syscall (openbsd-amd64-cgo), const BPF_AND ideal-int +pkg syscall (openbsd-amd64-cgo), const BPF_B ideal-int +pkg syscall (openbsd-amd64-cgo), const BPF_DIRECTION_IN ideal-int +pkg syscall (openbsd-amd64-cgo), const BPF_DIRECTION_OUT ideal-int +pkg syscall (openbsd-amd64-cgo), const BPF_DIV ideal-int +pkg syscall (openbsd-amd64-cgo), const BPF_H ideal-int +pkg syscall (openbsd-amd64-cgo), const BPF_IMM ideal-int +pkg syscall (openbsd-amd64-cgo), const BPF_IND ideal-int +pkg syscall (openbsd-amd64-cgo), const BPF_JA ideal-int +pkg syscall (openbsd-amd64-cgo), const BPF_JEQ ideal-int +pkg syscall (openbsd-amd64-cgo), const BPF_JGE ideal-int +pkg syscall (openbsd-amd64-cgo), const BPF_JGT ideal-int +pkg syscall (openbsd-amd64-cgo), const BPF_JMP ideal-int +pkg syscall (openbsd-amd64-cgo), const BPF_JSET ideal-int +pkg syscall (openbsd-amd64-cgo), const BPF_K ideal-int +pkg syscall (openbsd-amd64-cgo), const BPF_LD ideal-int +pkg syscall (openbsd-amd64-cgo), const BPF_LDX ideal-int +pkg syscall (openbsd-amd64-cgo), const BPF_LEN ideal-int +pkg syscall (openbsd-amd64-cgo), const BPF_LSH ideal-int +pkg syscall (openbsd-amd64-cgo), const BPF_MAJOR_VERSION ideal-int +pkg syscall (openbsd-amd64-cgo), const BPF_MAXBUFSIZE ideal-int +pkg syscall (openbsd-amd64-cgo), const BPF_MAXINSNS ideal-int +pkg syscall (openbsd-amd64-cgo), const BPF_MEM ideal-int +pkg syscall (openbsd-amd64-cgo), const BPF_MEMWORDS ideal-int +pkg syscall (openbsd-amd64-cgo), const BPF_MINBUFSIZE ideal-int +pkg syscall (openbsd-amd64-cgo), const BPF_MINOR_VERSION ideal-int +pkg syscall (openbsd-amd64-cgo), const BPF_MISC ideal-int +pkg syscall (openbsd-amd64-cgo), const BPF_MSH ideal-int +pkg syscall (openbsd-amd64-cgo), const BPF_MUL ideal-int +pkg syscall (openbsd-amd64-cgo), const BPF_NEG ideal-int +pkg syscall (openbsd-amd64-cgo), const BPF_OR ideal-int +pkg syscall (openbsd-amd64-cgo), const BPF_RELEASE ideal-int +pkg syscall (openbsd-amd64-cgo), const BPF_RET ideal-int +pkg syscall (openbsd-amd64-cgo), const BPF_RSH ideal-int +pkg syscall (openbsd-amd64-cgo), const BPF_ST ideal-int +pkg syscall (openbsd-amd64-cgo), const BPF_STX ideal-int +pkg syscall (openbsd-amd64-cgo), const BPF_SUB ideal-int +pkg syscall (openbsd-amd64-cgo), const BPF_TAX ideal-int +pkg syscall (openbsd-amd64-cgo), const BPF_TXA ideal-int +pkg syscall (openbsd-amd64-cgo), const BPF_W ideal-int +pkg syscall (openbsd-amd64-cgo), const BPF_X ideal-int +pkg syscall (openbsd-amd64-cgo), const BRKINT ideal-int +pkg syscall (openbsd-amd64-cgo), const CCR0_FLUSH ideal-int +pkg syscall (openbsd-amd64-cgo), const CFLUSH ideal-int +pkg syscall (openbsd-amd64-cgo), const CLOCAL ideal-int +pkg syscall (openbsd-amd64-cgo), const CPUID_CFLUSH ideal-int +pkg syscall (openbsd-amd64-cgo), const CREAD ideal-int +pkg syscall (openbsd-amd64-cgo), const CS5 ideal-int +pkg syscall (openbsd-amd64-cgo), const CS6 ideal-int +pkg syscall (openbsd-amd64-cgo), const CS7 ideal-int +pkg syscall (openbsd-amd64-cgo), const CS8 ideal-int +pkg syscall (openbsd-amd64-cgo), const CSIZE ideal-int +pkg syscall (openbsd-amd64-cgo), const CSTART ideal-int +pkg syscall (openbsd-amd64-cgo), const CSTATUS ideal-int +pkg syscall (openbsd-amd64-cgo), const CSTOP ideal-int +pkg syscall (openbsd-amd64-cgo), const CSTOPB ideal-int +pkg syscall (openbsd-amd64-cgo), const CSUSP ideal-int +pkg syscall (openbsd-amd64-cgo), const CTL_MAXNAME ideal-int +pkg syscall (openbsd-amd64-cgo), const CTL_NET ideal-int +pkg syscall (openbsd-amd64-cgo), const DIOCOSFPFLUSH ideal-int +pkg syscall (openbsd-amd64-cgo), const DLT_ARCNET ideal-int +pkg syscall (openbsd-amd64-cgo), const DLT_ATM_RFC1483 ideal-int +pkg syscall (openbsd-amd64-cgo), const DLT_AX25 ideal-int +pkg syscall (openbsd-amd64-cgo), const DLT_CHAOS ideal-int +pkg syscall (openbsd-amd64-cgo), const DLT_C_HDLC ideal-int +pkg syscall (openbsd-amd64-cgo), const DLT_EN10MB ideal-int +pkg syscall (openbsd-amd64-cgo), const DLT_EN3MB ideal-int +pkg syscall (openbsd-amd64-cgo), const DLT_ENC ideal-int +pkg syscall (openbsd-amd64-cgo), const DLT_FDDI ideal-int +pkg syscall (openbsd-amd64-cgo), const DLT_IEEE802 ideal-int +pkg syscall (openbsd-amd64-cgo), const DLT_IEEE802_11 ideal-int +pkg syscall (openbsd-amd64-cgo), const DLT_IEEE802_11_RADIO ideal-int +pkg syscall (openbsd-amd64-cgo), const DLT_LOOP ideal-int +pkg syscall (openbsd-amd64-cgo), const DLT_MPLS ideal-int +pkg syscall (openbsd-amd64-cgo), const DLT_NULL ideal-int +pkg syscall (openbsd-amd64-cgo), const DLT_PFLOG ideal-int +pkg syscall (openbsd-amd64-cgo), const DLT_PFSYNC ideal-int +pkg syscall (openbsd-amd64-cgo), const DLT_PPP ideal-int +pkg syscall (openbsd-amd64-cgo), const DLT_PPP_BSDOS ideal-int +pkg syscall (openbsd-amd64-cgo), const DLT_PPP_ETHER ideal-int +pkg syscall (openbsd-amd64-cgo), const DLT_PPP_SERIAL ideal-int +pkg syscall (openbsd-amd64-cgo), const DLT_PRONET ideal-int +pkg syscall (openbsd-amd64-cgo), const DLT_RAW ideal-int +pkg syscall (openbsd-amd64-cgo), const DLT_SLIP ideal-int +pkg syscall (openbsd-amd64-cgo), const DLT_SLIP_BSDOS ideal-int +pkg syscall (openbsd-amd64-cgo), const DT_BLK ideal-int +pkg syscall (openbsd-amd64-cgo), const DT_CHR ideal-int +pkg syscall (openbsd-amd64-cgo), const DT_DIR ideal-int +pkg syscall (openbsd-amd64-cgo), const DT_FIFO ideal-int +pkg syscall (openbsd-amd64-cgo), const DT_LNK ideal-int +pkg syscall (openbsd-amd64-cgo), const DT_REG ideal-int +pkg syscall (openbsd-amd64-cgo), const DT_SOCK ideal-int +pkg syscall (openbsd-amd64-cgo), const DT_UNKNOWN ideal-int +pkg syscall (openbsd-amd64-cgo), const EAUTH Errno +pkg syscall (openbsd-amd64-cgo), const EBADRPC Errno +pkg syscall (openbsd-amd64-cgo), const ECHO ideal-int +pkg syscall (openbsd-amd64-cgo), const ECHOCTL ideal-int +pkg syscall (openbsd-amd64-cgo), const ECHOE ideal-int +pkg syscall (openbsd-amd64-cgo), const ECHOK ideal-int +pkg syscall (openbsd-amd64-cgo), const ECHOKE ideal-int +pkg syscall (openbsd-amd64-cgo), const ECHONL ideal-int +pkg syscall (openbsd-amd64-cgo), const ECHOPRT ideal-int +pkg syscall (openbsd-amd64-cgo), const EFER_LMA ideal-int +pkg syscall (openbsd-amd64-cgo), const EFER_LME ideal-int +pkg syscall (openbsd-amd64-cgo), const EFER_NXE ideal-int +pkg syscall (openbsd-amd64-cgo), const EFER_SCE ideal-int +pkg syscall (openbsd-amd64-cgo), const EFTYPE Errno +pkg syscall (openbsd-amd64-cgo), const EIPSEC Errno +pkg syscall (openbsd-amd64-cgo), const ELAST Errno +pkg syscall (openbsd-amd64-cgo), const EMEDIUMTYPE Errno +pkg syscall (openbsd-amd64-cgo), const EMT_TAGOVF ideal-int +pkg syscall (openbsd-amd64-cgo), const EMUL_ENABLED ideal-int +pkg syscall (openbsd-amd64-cgo), const EMUL_NATIVE ideal-int +pkg syscall (openbsd-amd64-cgo), const ENDRUNDISC ideal-int +pkg syscall (openbsd-amd64-cgo), const ENEEDAUTH Errno +pkg syscall (openbsd-amd64-cgo), const ENOATTR Errno +pkg syscall (openbsd-amd64-cgo), const ENOMEDIUM Errno +pkg syscall (openbsd-amd64-cgo), const EPROCLIM Errno +pkg syscall (openbsd-amd64-cgo), const EPROCUNAVAIL Errno +pkg syscall (openbsd-amd64-cgo), const EPROGMISMATCH Errno +pkg syscall (openbsd-amd64-cgo), const EPROGUNAVAIL Errno +pkg syscall (openbsd-amd64-cgo), const ERPCMISMATCH Errno +pkg syscall (openbsd-amd64-cgo), const ETHERMIN ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERMTU ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_8023 ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_AARP ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_ACCTON ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_AEONIC ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_ALPHA ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_AMBER ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_AMOEBA ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_AOE ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_APOLLO ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_APOLLODOMAIN ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_APPLETALK ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_APPLITEK ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_ARGONAUT ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_ARP ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_AT ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_ATALK ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_ATOMIC ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_ATT ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_ATTSTANFORD ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_AUTOPHON ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_AXIS ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_BCLOOP ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_BOFL ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_CABLETRON ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_CHAOS ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_COMDESIGN ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_COMPUGRAPHIC ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_COUNTERPOINT ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_CRONUS ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_CRONUSVLN ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_DCA ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_DDE ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_DEBNI ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_DECAM ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_DECCUST ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_DECDIAG ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_DECDNS ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_DECDTS ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_DECEXPER ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_DECLAST ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_DECLTM ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_DECMUMPS ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_DECNETBIOS ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_DELTACON ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_DIDDLE ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_DLOG1 ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_DLOG2 ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_DN ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_DOGFIGHT ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_DSMD ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_ECMA ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_ENCRYPT ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_ES ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_EXCELAN ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_EXPERDATA ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_FLIP ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_FLOWCONTROL ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_FRARP ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_GENDYN ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_HAYES ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_HIPPI_FP ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_HITACHI ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_HP ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_IEEEPUP ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_IEEEPUPAT ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_IMLBL ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_IMLBLDIAG ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_IP ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_IPAS ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_IPV6 ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_IPX ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_IPXNEW ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_KALPANA ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_LANBRIDGE ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_LANPROBE ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_LAT ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_LBACK ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_LITTLE ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_LLDP ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_LOGICRAFT ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_LOOPBACK ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_MATRA ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_MAX ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_MERIT ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_MICP ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_MOPDL ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_MOPRC ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_MOTOROLA ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_MPLS ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_MPLS_MCAST ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_MUMPS ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_NBPCC ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_NBPCLAIM ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_NBPCLREQ ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_NBPCLRSP ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_NBPCREQ ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_NBPCRSP ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_NBPDG ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_NBPDGB ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_NBPDLTE ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_NBPRAR ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_NBPRAS ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_NBPRST ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_NBPSCD ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_NBPVCD ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_NBS ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_NCD ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_NESTAR ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_NETBEUI ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_NOVELL ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_NS ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_NSAT ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_NSCOMPAT ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_NTRAILER ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_OS9 ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_OS9NET ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_PACER ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_PAE ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_PCS ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_PLANNING ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_PPP ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_PPPOE ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_PPPOEDISC ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_PRIMENTS ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_PUP ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_PUPAT ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_QINQ ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_RACAL ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_RATIONAL ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_RAWFR ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_RCL ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_RDP ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_RETIX ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_REVARP ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_SCA ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_SECTRA ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_SECUREDATA ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_SGITW ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_SG_BOUNCE ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_SG_DIAG ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_SG_NETGAMES ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_SG_RESV ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_SIMNET ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_SLOW ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_SNA ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_SNMP ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_SONIX ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_SPIDER ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_SPRITE ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_STP ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_TALARIS ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_TALARISMC ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_TCPCOMP ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_TCPSM ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_TEC ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_TIGAN ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_TRAIL ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_TRANSETHER ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_TYMSHARE ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_UBBST ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_UBDEBUG ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_UBDIAGLOOP ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_UBDL ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_UBNIU ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_UBNMC ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_VALID ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_VARIAN ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_VAXELN ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_VEECO ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_VEXP ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_VGLAB ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_VINES ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_VINESECHO ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_VINESLOOP ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_VITAL ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_VLAN ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_VLTLMAN ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_VPROD ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_VURESERVED ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_WATERLOO ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_WELLFLEET ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_X25 ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_X75 ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_XNSSM ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHERTYPE_XTP ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHER_ADDR_LEN ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHER_ALIGN ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHER_CRC_LEN ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHER_CRC_POLY_BE ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHER_CRC_POLY_LE ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHER_HDR_LEN ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHER_MAX_DIX_LEN ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHER_MAX_LEN ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHER_MIN_LEN ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHER_TYPE_LEN ideal-int +pkg syscall (openbsd-amd64-cgo), const ETHER_VLAN_ENCAP_LEN ideal-int +pkg syscall (openbsd-amd64-cgo), const EVFILT_AIO ideal-int +pkg syscall (openbsd-amd64-cgo), const EVFILT_PROC ideal-int +pkg syscall (openbsd-amd64-cgo), const EVFILT_READ ideal-int +pkg syscall (openbsd-amd64-cgo), const EVFILT_SIGNAL ideal-int +pkg syscall (openbsd-amd64-cgo), const EVFILT_SYSCOUNT ideal-int +pkg syscall (openbsd-amd64-cgo), const EVFILT_TIMER ideal-int +pkg syscall (openbsd-amd64-cgo), const EVFILT_VNODE ideal-int +pkg syscall (openbsd-amd64-cgo), const EVFILT_WRITE ideal-int +pkg syscall (openbsd-amd64-cgo), const EV_ADD ideal-int +pkg syscall (openbsd-amd64-cgo), const EV_CLEAR ideal-int +pkg syscall (openbsd-amd64-cgo), const EV_DELETE ideal-int +pkg syscall (openbsd-amd64-cgo), const EV_DISABLE ideal-int +pkg syscall (openbsd-amd64-cgo), const EV_ENABLE ideal-int +pkg syscall (openbsd-amd64-cgo), const EV_EOF ideal-int +pkg syscall (openbsd-amd64-cgo), const EV_ERROR ideal-int +pkg syscall (openbsd-amd64-cgo), const EV_FLAG1 ideal-int +pkg syscall (openbsd-amd64-cgo), const EV_ONESHOT ideal-int +pkg syscall (openbsd-amd64-cgo), const EV_SYSFLAGS ideal-int +pkg syscall (openbsd-amd64-cgo), const EXTA ideal-int +pkg syscall (openbsd-amd64-cgo), const EXTB ideal-int +pkg syscall (openbsd-amd64-cgo), const EXTPROC ideal-int +pkg syscall (openbsd-amd64-cgo), const FD_CLOEXEC ideal-int +pkg syscall (openbsd-amd64-cgo), const FD_SETSIZE ideal-int +pkg syscall (openbsd-amd64-cgo), const FLUSHO ideal-int +pkg syscall (openbsd-amd64-cgo), const F_DUPFD ideal-int +pkg syscall (openbsd-amd64-cgo), const F_DUPFD_CLOEXEC ideal-int +pkg syscall (openbsd-amd64-cgo), const F_GETFD ideal-int +pkg syscall (openbsd-amd64-cgo), const F_GETFL ideal-int +pkg syscall (openbsd-amd64-cgo), const F_GETLK ideal-int +pkg syscall (openbsd-amd64-cgo), const F_GETOWN ideal-int +pkg syscall (openbsd-amd64-cgo), const F_OK ideal-int +pkg syscall (openbsd-amd64-cgo), const F_RDLCK ideal-int +pkg syscall (openbsd-amd64-cgo), const F_SETFD ideal-int +pkg syscall (openbsd-amd64-cgo), const F_SETFL ideal-int +pkg syscall (openbsd-amd64-cgo), const F_SETLK ideal-int +pkg syscall (openbsd-amd64-cgo), const F_SETLKW ideal-int +pkg syscall (openbsd-amd64-cgo), const F_SETOWN ideal-int +pkg syscall (openbsd-amd64-cgo), const F_UNLCK ideal-int +pkg syscall (openbsd-amd64-cgo), const F_WRLCK ideal-int +pkg syscall (openbsd-amd64-cgo), const HUPCL ideal-int +pkg syscall (openbsd-amd64-cgo), const ICANON ideal-int +pkg syscall (openbsd-amd64-cgo), const ICMP6_FILTER = 18 +pkg syscall (openbsd-amd64-cgo), const ICMP6_FILTER ideal-int +pkg syscall (openbsd-amd64-cgo), const ICRNL ideal-int +pkg syscall (openbsd-amd64-cgo), const IEXTEN ideal-int +pkg syscall (openbsd-amd64-cgo), const IFAN_ARRIVAL ideal-int +pkg syscall (openbsd-amd64-cgo), const IFAN_DEPARTURE ideal-int +pkg syscall (openbsd-amd64-cgo), const IFA_ROUTE ideal-int +pkg syscall (openbsd-amd64-cgo), const IFF_ALLMULTI ideal-int +pkg syscall (openbsd-amd64-cgo), const IFF_CANTCHANGE ideal-int +pkg syscall (openbsd-amd64-cgo), const IFF_DEBUG ideal-int +pkg syscall (openbsd-amd64-cgo), const IFF_LINK0 ideal-int +pkg syscall (openbsd-amd64-cgo), const IFF_LINK1 ideal-int +pkg syscall (openbsd-amd64-cgo), const IFF_LINK2 ideal-int +pkg syscall (openbsd-amd64-cgo), const IFF_NOARP ideal-int +pkg syscall (openbsd-amd64-cgo), const IFF_NOTRAILERS ideal-int +pkg syscall (openbsd-amd64-cgo), const IFF_OACTIVE ideal-int +pkg syscall (openbsd-amd64-cgo), const IFF_POINTOPOINT ideal-int +pkg syscall (openbsd-amd64-cgo), const IFF_PROMISC ideal-int +pkg syscall (openbsd-amd64-cgo), const IFF_RUNNING ideal-int +pkg syscall (openbsd-amd64-cgo), const IFF_SIMPLEX ideal-int +pkg syscall (openbsd-amd64-cgo), const IFNAMSIZ ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_1822 ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_A12MPPSWITCH ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_AAL2 ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_AAL5 ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_ADSL ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_AFLANE8023 ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_AFLANE8025 ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_ARAP ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_ARCNET ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_ARCNETPLUS ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_ASYNC ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_ATM ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_ATMDXI ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_ATMFUNI ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_ATMIMA ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_ATMLOGICAL ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_ATMRADIO ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_ATMSUBINTERFACE ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_ATMVCIENDPT ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_ATMVIRTUAL ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_BGPPOLICYACCOUNTING ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_BLUETOOTH ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_BRIDGE ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_BSC ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_CARP ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_CCTEMUL ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_CEPT ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_CES ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_CHANNEL ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_CNR ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_COFFEE ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_COMPOSITELINK ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_DCN ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_DIGITALPOWERLINE ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_DIGITALWRAPPEROVERHEADCHANNEL ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_DLSW ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_DOCSCABLEDOWNSTREAM ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_DOCSCABLEMACLAYER ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_DOCSCABLEUPSTREAM ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_DOCSCABLEUPSTREAMCHANNEL ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_DS0 ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_DS0BUNDLE ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_DS1FDL ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_DS3 ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_DTM ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_DUMMY ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_DVBASILN ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_DVBASIOUT ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_DVBRCCDOWNSTREAM ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_DVBRCCMACLAYER ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_DVBRCCUPSTREAM ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_ECONET ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_ENC ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_EON ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_EPLRS ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_ESCON ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_ETHER ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_FAITH ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_FAST ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_FASTETHER ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_FASTETHERFX ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_FDDI ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_FIBRECHANNEL ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_FRAMERELAYINTERCONNECT ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_FRAMERELAYMPI ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_FRDLCIENDPT ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_FRELAY ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_FRELAYDCE ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_FRF16MFRBUNDLE ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_FRFORWARD ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_G703AT2MB ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_G703AT64K ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_GIF ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_GIGABITETHERNET ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_GR303IDT ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_GR303RDT ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_H323GATEKEEPER ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_H323PROXY ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_HDH1822 ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_HDLC ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_HDSL2 ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_HIPERLAN2 ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_HIPPI ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_HIPPIINTERFACE ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_HOSTPAD ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_HSSI ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_HY ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_IBM370PARCHAN ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_IDSL ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_IEEE1394 ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_IEEE80211 ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_IEEE80212 ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_IEEE8023ADLAG ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_IFGSN ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_IMT ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_INFINIBAND ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_INTERLEAVE ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_IP ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_IPFORWARD ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_IPOVERATM ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_IPOVERCDLC ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_IPOVERCLAW ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_IPSWITCH ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_ISDN ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_ISDNBASIC ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_ISDNPRIMARY ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_ISDNS ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_ISDNU ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_ISO88022LLC ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_ISO88023 ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_ISO88024 ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_ISO88025 ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_ISO88025CRFPINT ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_ISO88025DTR ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_ISO88025FIBER ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_ISO88026 ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_ISUP ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_L2VLAN ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_L3IPVLAN ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_L3IPXVLAN ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_LAPB ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_LAPD ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_LAPF ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_LINEGROUP ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_LOCALTALK ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_LOOP ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_MEDIAMAILOVERIP ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_MFSIGLINK ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_MIOX25 ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_MODEM ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_MPC ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_MPLS ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_MPLSTUNNEL ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_MSDSL ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_MVL ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_MYRINET ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_NFAS ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_NSIP ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_OPTICALCHANNEL ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_OPTICALTRANSPORT ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_OTHER ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_P10 ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_P80 ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_PARA ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_PFLOG ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_PFLOW ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_PFSYNC ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_PLC ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_PON155 ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_PON622 ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_POS ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_PPP ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_PPPMULTILINKBUNDLE ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_PROPATM ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_PROPBWAP2MP ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_PROPCNLS ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_PROPDOCSWIRELESSDOWNSTREAM ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_PROPDOCSWIRELESSMACLAYER ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_PROPDOCSWIRELESSUPSTREAM ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_PROPMUX ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_PROPVIRTUAL ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_PROPWIRELESSP2P ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_PTPSERIAL ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_PVC ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_Q2931 ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_QLLC ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_RADIOMAC ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_RADSL ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_REACHDSL ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_RFC1483 ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_RS232 ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_RSRB ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_SDLC ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_SDSL ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_SHDSL ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_SIP ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_SIPSIG ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_SIPTG ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_SLIP ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_SMDSDXI ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_SMDSICIP ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_SONET ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_SONETOVERHEADCHANNEL ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_SONETPATH ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_SONETVT ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_SRP ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_SS7SIGLINK ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_STACKTOSTACK ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_STARLAN ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_T1 ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_TDLC ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_TELINK ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_TERMPAD ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_TR008 ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_TRANSPHDLC ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_TUNNEL ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_ULTRA ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_USB ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_V11 ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_V35 ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_V36 ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_V37 ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_VDSL ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_VIRTUALIPADDRESS ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_VIRTUALTG ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_VOICEDID ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_VOICEEM ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_VOICEEMFGD ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_VOICEENCAP ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_VOICEFGDEANA ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_VOICEFXO ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_VOICEFXS ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_VOICEOVERATM ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_VOICEOVERCABLE ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_VOICEOVERFRAMERELAY ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_VOICEOVERIP ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_X213 ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_X25 ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_X25DDN ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_X25HUNTGROUP ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_X25MLP ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_X25PLE ideal-int +pkg syscall (openbsd-amd64-cgo), const IFT_XETHER ideal-int +pkg syscall (openbsd-amd64-cgo), const IGNBRK ideal-int +pkg syscall (openbsd-amd64-cgo), const IGNCR ideal-int +pkg syscall (openbsd-amd64-cgo), const IGNPAR ideal-int +pkg syscall (openbsd-amd64-cgo), const IMAXBEL ideal-int +pkg syscall (openbsd-amd64-cgo), const INLCR ideal-int +pkg syscall (openbsd-amd64-cgo), const INPCK ideal-int +pkg syscall (openbsd-amd64-cgo), const IN_CLASSA_HOST ideal-int +pkg syscall (openbsd-amd64-cgo), const IN_CLASSA_MAX ideal-int +pkg syscall (openbsd-amd64-cgo), const IN_CLASSA_NET ideal-int +pkg syscall (openbsd-amd64-cgo), const IN_CLASSA_NSHIFT ideal-int +pkg syscall (openbsd-amd64-cgo), const IN_CLASSB_HOST ideal-int +pkg syscall (openbsd-amd64-cgo), const IN_CLASSB_MAX ideal-int +pkg syscall (openbsd-amd64-cgo), const IN_CLASSB_NET ideal-int +pkg syscall (openbsd-amd64-cgo), const IN_CLASSB_NSHIFT ideal-int +pkg syscall (openbsd-amd64-cgo), const IN_CLASSC_HOST ideal-int +pkg syscall (openbsd-amd64-cgo), const IN_CLASSC_NET ideal-int +pkg syscall (openbsd-amd64-cgo), const IN_CLASSC_NSHIFT ideal-int +pkg syscall (openbsd-amd64-cgo), const IN_CLASSD_HOST ideal-int +pkg syscall (openbsd-amd64-cgo), const IN_CLASSD_NET ideal-int +pkg syscall (openbsd-amd64-cgo), const IN_CLASSD_NSHIFT ideal-int +pkg syscall (openbsd-amd64-cgo), const IN_LOOPBACKNET ideal-int +pkg syscall (openbsd-amd64-cgo), const IN_RFC3021_HOST ideal-int +pkg syscall (openbsd-amd64-cgo), const IN_RFC3021_NET ideal-int +pkg syscall (openbsd-amd64-cgo), const IN_RFC3021_NSHIFT ideal-int +pkg syscall (openbsd-amd64-cgo), const IPPROTO_AH ideal-int +pkg syscall (openbsd-amd64-cgo), const IPPROTO_CARP ideal-int +pkg syscall (openbsd-amd64-cgo), const IPPROTO_DIVERT ideal-int +pkg syscall (openbsd-amd64-cgo), const IPPROTO_DONE ideal-int +pkg syscall (openbsd-amd64-cgo), const IPPROTO_DSTOPTS ideal-int +pkg syscall (openbsd-amd64-cgo), const IPPROTO_EGP ideal-int +pkg syscall (openbsd-amd64-cgo), const IPPROTO_ENCAP ideal-int +pkg syscall (openbsd-amd64-cgo), const IPPROTO_EON ideal-int +pkg syscall (openbsd-amd64-cgo), const IPPROTO_ESP ideal-int +pkg syscall (openbsd-amd64-cgo), const IPPROTO_ETHERIP ideal-int +pkg syscall (openbsd-amd64-cgo), const IPPROTO_FRAGMENT ideal-int +pkg syscall (openbsd-amd64-cgo), const IPPROTO_GGP ideal-int +pkg syscall (openbsd-amd64-cgo), const IPPROTO_GRE ideal-int +pkg syscall (openbsd-amd64-cgo), const IPPROTO_HOPOPTS ideal-int +pkg syscall (openbsd-amd64-cgo), const IPPROTO_ICMP ideal-int +pkg syscall (openbsd-amd64-cgo), const IPPROTO_ICMPV6 ideal-int +pkg syscall (openbsd-amd64-cgo), const IPPROTO_IDP ideal-int +pkg syscall (openbsd-amd64-cgo), const IPPROTO_IGMP ideal-int +pkg syscall (openbsd-amd64-cgo), const IPPROTO_IPCOMP ideal-int +pkg syscall (openbsd-amd64-cgo), const IPPROTO_IPIP ideal-int +pkg syscall (openbsd-amd64-cgo), const IPPROTO_IPV4 ideal-int +pkg syscall (openbsd-amd64-cgo), const IPPROTO_MAX ideal-int +pkg syscall (openbsd-amd64-cgo), const IPPROTO_MAXID ideal-int +pkg syscall (openbsd-amd64-cgo), const IPPROTO_MOBILE ideal-int +pkg syscall (openbsd-amd64-cgo), const IPPROTO_MPLS ideal-int +pkg syscall (openbsd-amd64-cgo), const IPPROTO_NONE ideal-int +pkg syscall (openbsd-amd64-cgo), const IPPROTO_PFSYNC ideal-int +pkg syscall (openbsd-amd64-cgo), const IPPROTO_PIM ideal-int +pkg syscall (openbsd-amd64-cgo), const IPPROTO_PUP ideal-int +pkg syscall (openbsd-amd64-cgo), const IPPROTO_RAW ideal-int +pkg syscall (openbsd-amd64-cgo), const IPPROTO_ROUTING ideal-int +pkg syscall (openbsd-amd64-cgo), const IPPROTO_RSVP ideal-int +pkg syscall (openbsd-amd64-cgo), const IPPROTO_TP ideal-int +pkg syscall (openbsd-amd64-cgo), const IPV6_AUTH_LEVEL ideal-int +pkg syscall (openbsd-amd64-cgo), const IPV6_AUTOFLOWLABEL ideal-int +pkg syscall (openbsd-amd64-cgo), const IPV6_CHECKSUM ideal-int +pkg syscall (openbsd-amd64-cgo), const IPV6_DEFAULT_MULTICAST_HOPS ideal-int +pkg syscall (openbsd-amd64-cgo), const IPV6_DEFAULT_MULTICAST_LOOP ideal-int +pkg syscall (openbsd-amd64-cgo), const IPV6_DEFHLIM ideal-int +pkg syscall (openbsd-amd64-cgo), const IPV6_DONTFRAG ideal-int +pkg syscall (openbsd-amd64-cgo), const IPV6_DSTOPTS ideal-int +pkg syscall (openbsd-amd64-cgo), const IPV6_ESP_NETWORK_LEVEL ideal-int +pkg syscall (openbsd-amd64-cgo), const IPV6_ESP_TRANS_LEVEL ideal-int +pkg syscall (openbsd-amd64-cgo), const IPV6_FAITH ideal-int +pkg syscall (openbsd-amd64-cgo), const IPV6_FLOWINFO_MASK ideal-int +pkg syscall (openbsd-amd64-cgo), const IPV6_FLOWLABEL_MASK ideal-int +pkg syscall (openbsd-amd64-cgo), const IPV6_FRAGTTL ideal-int +pkg syscall (openbsd-amd64-cgo), const IPV6_HLIMDEC ideal-int +pkg syscall (openbsd-amd64-cgo), const IPV6_HOPLIMIT ideal-int +pkg syscall (openbsd-amd64-cgo), const IPV6_HOPOPTS ideal-int +pkg syscall (openbsd-amd64-cgo), const IPV6_IPCOMP_LEVEL ideal-int +pkg syscall (openbsd-amd64-cgo), const IPV6_MAXHLIM ideal-int +pkg syscall (openbsd-amd64-cgo), const IPV6_MAXPACKET ideal-int +pkg syscall (openbsd-amd64-cgo), const IPV6_MMTU ideal-int +pkg syscall (openbsd-amd64-cgo), const IPV6_NEXTHOP ideal-int +pkg syscall (openbsd-amd64-cgo), const IPV6_OPTIONS ideal-int +pkg syscall (openbsd-amd64-cgo), const IPV6_PATHMTU ideal-int +pkg syscall (openbsd-amd64-cgo), const IPV6_PIPEX ideal-int +pkg syscall (openbsd-amd64-cgo), const IPV6_PKTINFO ideal-int +pkg syscall (openbsd-amd64-cgo), const IPV6_PORTRANGE ideal-int +pkg syscall (openbsd-amd64-cgo), const IPV6_PORTRANGE_DEFAULT ideal-int +pkg syscall (openbsd-amd64-cgo), const IPV6_PORTRANGE_HIGH ideal-int +pkg syscall (openbsd-amd64-cgo), const IPV6_PORTRANGE_LOW ideal-int +pkg syscall (openbsd-amd64-cgo), const IPV6_RECVDSTOPTS ideal-int +pkg syscall (openbsd-amd64-cgo), const IPV6_RECVHOPLIMIT ideal-int +pkg syscall (openbsd-amd64-cgo), const IPV6_RECVHOPOPTS ideal-int +pkg syscall (openbsd-amd64-cgo), const IPV6_RECVPATHMTU ideal-int +pkg syscall (openbsd-amd64-cgo), const IPV6_RECVPKTINFO ideal-int +pkg syscall (openbsd-amd64-cgo), const IPV6_RECVRTHDR ideal-int +pkg syscall (openbsd-amd64-cgo), const IPV6_RECVTCLASS ideal-int +pkg syscall (openbsd-amd64-cgo), const IPV6_RTABLE ideal-int +pkg syscall (openbsd-amd64-cgo), const IPV6_RTHDR ideal-int +pkg syscall (openbsd-amd64-cgo), const IPV6_RTHDRDSTOPTS ideal-int +pkg syscall (openbsd-amd64-cgo), const IPV6_RTHDR_LOOSE ideal-int +pkg syscall (openbsd-amd64-cgo), const IPV6_RTHDR_STRICT ideal-int +pkg syscall (openbsd-amd64-cgo), const IPV6_RTHDR_TYPE_0 ideal-int +pkg syscall (openbsd-amd64-cgo), const IPV6_SOCKOPT_RESERVED1 ideal-int +pkg syscall (openbsd-amd64-cgo), const IPV6_TCLASS ideal-int +pkg syscall (openbsd-amd64-cgo), const IPV6_USE_MIN_MTU ideal-int +pkg syscall (openbsd-amd64-cgo), const IPV6_VERSION ideal-int +pkg syscall (openbsd-amd64-cgo), const IPV6_VERSION_MASK ideal-int +pkg syscall (openbsd-amd64-cgo), const IP_AUTH_LEVEL ideal-int +pkg syscall (openbsd-amd64-cgo), const IP_DEFAULT_MULTICAST_LOOP ideal-int +pkg syscall (openbsd-amd64-cgo), const IP_DEFAULT_MULTICAST_TTL ideal-int +pkg syscall (openbsd-amd64-cgo), const IP_DF ideal-int +pkg syscall (openbsd-amd64-cgo), const IP_ESP_NETWORK_LEVEL ideal-int +pkg syscall (openbsd-amd64-cgo), const IP_ESP_TRANS_LEVEL ideal-int +pkg syscall (openbsd-amd64-cgo), const IP_HDRINCL ideal-int +pkg syscall (openbsd-amd64-cgo), const IP_IPCOMP_LEVEL ideal-int +pkg syscall (openbsd-amd64-cgo), const IP_IPSECFLOWINFO ideal-int +pkg syscall (openbsd-amd64-cgo), const IP_IPSEC_LOCAL_AUTH ideal-int +pkg syscall (openbsd-amd64-cgo), const IP_IPSEC_LOCAL_CRED ideal-int +pkg syscall (openbsd-amd64-cgo), const IP_IPSEC_LOCAL_ID ideal-int +pkg syscall (openbsd-amd64-cgo), const IP_IPSEC_REMOTE_AUTH ideal-int +pkg syscall (openbsd-amd64-cgo), const IP_IPSEC_REMOTE_CRED ideal-int +pkg syscall (openbsd-amd64-cgo), const IP_IPSEC_REMOTE_ID ideal-int +pkg syscall (openbsd-amd64-cgo), const IP_MAXPACKET ideal-int +pkg syscall (openbsd-amd64-cgo), const IP_MAX_MEMBERSHIPS ideal-int +pkg syscall (openbsd-amd64-cgo), const IP_MF ideal-int +pkg syscall (openbsd-amd64-cgo), const IP_MINTTL ideal-int +pkg syscall (openbsd-amd64-cgo), const IP_MIN_MEMBERSHIPS ideal-int +pkg syscall (openbsd-amd64-cgo), const IP_MSS ideal-int +pkg syscall (openbsd-amd64-cgo), const IP_OFFMASK ideal-int +pkg syscall (openbsd-amd64-cgo), const IP_OPTIONS ideal-int +pkg syscall (openbsd-amd64-cgo), const IP_PIPEX ideal-int +pkg syscall (openbsd-amd64-cgo), const IP_PORTRANGE ideal-int +pkg syscall (openbsd-amd64-cgo), const IP_PORTRANGE_DEFAULT ideal-int +pkg syscall (openbsd-amd64-cgo), const IP_PORTRANGE_HIGH ideal-int +pkg syscall (openbsd-amd64-cgo), const IP_PORTRANGE_LOW ideal-int +pkg syscall (openbsd-amd64-cgo), const IP_RECVDSTADDR ideal-int +pkg syscall (openbsd-amd64-cgo), const IP_RECVDSTPORT ideal-int +pkg syscall (openbsd-amd64-cgo), const IP_RECVIF ideal-int +pkg syscall (openbsd-amd64-cgo), const IP_RECVOPTS ideal-int +pkg syscall (openbsd-amd64-cgo), const IP_RECVRETOPTS ideal-int +pkg syscall (openbsd-amd64-cgo), const IP_RECVRTABLE ideal-int +pkg syscall (openbsd-amd64-cgo), const IP_RECVTTL ideal-int +pkg syscall (openbsd-amd64-cgo), const IP_RETOPTS ideal-int +pkg syscall (openbsd-amd64-cgo), const IP_RF ideal-int +pkg syscall (openbsd-amd64-cgo), const IP_RTABLE ideal-int +pkg syscall (openbsd-amd64-cgo), const ISIG ideal-int +pkg syscall (openbsd-amd64-cgo), const ISTRIP ideal-int +pkg syscall (openbsd-amd64-cgo), const IXANY ideal-int +pkg syscall (openbsd-amd64-cgo), const IXOFF ideal-int +pkg syscall (openbsd-amd64-cgo), const IXON ideal-int +pkg syscall (openbsd-amd64-cgo), const LCNT_OVERLOAD_FLUSH ideal-int +pkg syscall (openbsd-amd64-cgo), const LOCK_EX ideal-int +pkg syscall (openbsd-amd64-cgo), const LOCK_NB ideal-int +pkg syscall (openbsd-amd64-cgo), const LOCK_SH ideal-int +pkg syscall (openbsd-amd64-cgo), const LOCK_UN ideal-int +pkg syscall (openbsd-amd64-cgo), const MSG_BCAST ideal-int +pkg syscall (openbsd-amd64-cgo), const MSG_CTRUNC ideal-int +pkg syscall (openbsd-amd64-cgo), const MSG_DONTROUTE ideal-int +pkg syscall (openbsd-amd64-cgo), const MSG_DONTWAIT ideal-int +pkg syscall (openbsd-amd64-cgo), const MSG_EOR ideal-int +pkg syscall (openbsd-amd64-cgo), const MSG_MCAST ideal-int +pkg syscall (openbsd-amd64-cgo), const MSG_NOSIGNAL ideal-int +pkg syscall (openbsd-amd64-cgo), const MSG_OOB ideal-int +pkg syscall (openbsd-amd64-cgo), const MSG_PEEK ideal-int +pkg syscall (openbsd-amd64-cgo), const MSG_TRUNC ideal-int +pkg syscall (openbsd-amd64-cgo), const MSG_WAITALL ideal-int +pkg syscall (openbsd-amd64-cgo), const NAME_MAX ideal-int +pkg syscall (openbsd-amd64-cgo), const NET_RT_DUMP ideal-int +pkg syscall (openbsd-amd64-cgo), const NET_RT_FLAGS ideal-int +pkg syscall (openbsd-amd64-cgo), const NET_RT_IFLIST ideal-int +pkg syscall (openbsd-amd64-cgo), const NET_RT_MAXID ideal-int +pkg syscall (openbsd-amd64-cgo), const NET_RT_STATS ideal-int +pkg syscall (openbsd-amd64-cgo), const NET_RT_TABLE ideal-int +pkg syscall (openbsd-amd64-cgo), const NOFLSH ideal-int +pkg syscall (openbsd-amd64-cgo), const NOTE_ATTRIB ideal-int +pkg syscall (openbsd-amd64-cgo), const NOTE_CHILD ideal-int +pkg syscall (openbsd-amd64-cgo), const NOTE_DELETE ideal-int +pkg syscall (openbsd-amd64-cgo), const NOTE_EOF ideal-int +pkg syscall (openbsd-amd64-cgo), const NOTE_EXEC ideal-int +pkg syscall (openbsd-amd64-cgo), const NOTE_EXIT ideal-int +pkg syscall (openbsd-amd64-cgo), const NOTE_EXTEND ideal-int +pkg syscall (openbsd-amd64-cgo), const NOTE_FORK ideal-int +pkg syscall (openbsd-amd64-cgo), const NOTE_LINK ideal-int +pkg syscall (openbsd-amd64-cgo), const NOTE_LOWAT ideal-int +pkg syscall (openbsd-amd64-cgo), const NOTE_PCTRLMASK ideal-int +pkg syscall (openbsd-amd64-cgo), const NOTE_PDATAMASK ideal-int +pkg syscall (openbsd-amd64-cgo), const NOTE_RENAME ideal-int +pkg syscall (openbsd-amd64-cgo), const NOTE_REVOKE ideal-int +pkg syscall (openbsd-amd64-cgo), const NOTE_TRACK ideal-int +pkg syscall (openbsd-amd64-cgo), const NOTE_TRACKERR ideal-int +pkg syscall (openbsd-amd64-cgo), const NOTE_TRUNCATE ideal-int +pkg syscall (openbsd-amd64-cgo), const NOTE_WRITE ideal-int +pkg syscall (openbsd-amd64-cgo), const OCRNL ideal-int +pkg syscall (openbsd-amd64-cgo), const ONLCR ideal-int +pkg syscall (openbsd-amd64-cgo), const ONLRET ideal-int +pkg syscall (openbsd-amd64-cgo), const ONOCR ideal-int +pkg syscall (openbsd-amd64-cgo), const ONOEOT ideal-int +pkg syscall (openbsd-amd64-cgo), const OPOST ideal-int +pkg syscall (openbsd-amd64-cgo), const O_ACCMODE ideal-int +pkg syscall (openbsd-amd64-cgo), const O_DIRECTORY ideal-int +pkg syscall (openbsd-amd64-cgo), const O_DSYNC ideal-int +pkg syscall (openbsd-amd64-cgo), const O_EXLOCK ideal-int +pkg syscall (openbsd-amd64-cgo), const O_FSYNC ideal-int +pkg syscall (openbsd-amd64-cgo), const O_NDELAY ideal-int +pkg syscall (openbsd-amd64-cgo), const O_NOFOLLOW ideal-int +pkg syscall (openbsd-amd64-cgo), const O_RSYNC ideal-int +pkg syscall (openbsd-amd64-cgo), const O_SHLOCK ideal-int +pkg syscall (openbsd-amd64-cgo), const PARENB ideal-int +pkg syscall (openbsd-amd64-cgo), const PARMRK ideal-int +pkg syscall (openbsd-amd64-cgo), const PARODD ideal-int +pkg syscall (openbsd-amd64-cgo), const PENDIN ideal-int +pkg syscall (openbsd-amd64-cgo), const PF_FLUSH ideal-int +pkg syscall (openbsd-amd64-cgo), const PMC5_PIPELINE_FLUSH ideal-int +pkg syscall (openbsd-amd64-cgo), const PRIO_PGRP = 1 +pkg syscall (openbsd-amd64-cgo), const PRIO_PGRP ideal-int +pkg syscall (openbsd-amd64-cgo), const PRIO_PROCESS = 0 +pkg syscall (openbsd-amd64-cgo), const PRIO_PROCESS ideal-int +pkg syscall (openbsd-amd64-cgo), const PRIO_USER = 2 +pkg syscall (openbsd-amd64-cgo), const PRIO_USER ideal-int +pkg syscall (openbsd-amd64-cgo), const PTRACE_CONT ideal-int +pkg syscall (openbsd-amd64-cgo), const PTRACE_KILL ideal-int +pkg syscall (openbsd-amd64-cgo), const PTRACE_TRACEME ideal-int +pkg syscall (openbsd-amd64-cgo), const RLIMIT_CORE ideal-int +pkg syscall (openbsd-amd64-cgo), const RLIMIT_CPU ideal-int +pkg syscall (openbsd-amd64-cgo), const RLIMIT_DATA ideal-int +pkg syscall (openbsd-amd64-cgo), const RLIMIT_FSIZE ideal-int +pkg syscall (openbsd-amd64-cgo), const RLIMIT_NOFILE ideal-int +pkg syscall (openbsd-amd64-cgo), const RLIMIT_STACK ideal-int +pkg syscall (openbsd-amd64-cgo), const RLIM_INFINITY ideal-int +pkg syscall (openbsd-amd64-cgo), const RTAX_AUTHOR ideal-int +pkg syscall (openbsd-amd64-cgo), const RTAX_BRD ideal-int +pkg syscall (openbsd-amd64-cgo), const RTAX_DST ideal-int +pkg syscall (openbsd-amd64-cgo), const RTAX_GATEWAY ideal-int +pkg syscall (openbsd-amd64-cgo), const RTAX_GENMASK ideal-int +pkg syscall (openbsd-amd64-cgo), const RTAX_IFA ideal-int +pkg syscall (openbsd-amd64-cgo), const RTAX_IFP ideal-int +pkg syscall (openbsd-amd64-cgo), const RTAX_LABEL ideal-int +pkg syscall (openbsd-amd64-cgo), const RTAX_MAX ideal-int +pkg syscall (openbsd-amd64-cgo), const RTAX_NETMASK ideal-int +pkg syscall (openbsd-amd64-cgo), const RTAX_SRC ideal-int +pkg syscall (openbsd-amd64-cgo), const RTAX_SRCMASK ideal-int +pkg syscall (openbsd-amd64-cgo), const RTA_AUTHOR ideal-int +pkg syscall (openbsd-amd64-cgo), const RTA_BRD ideal-int +pkg syscall (openbsd-amd64-cgo), const RTA_DST ideal-int +pkg syscall (openbsd-amd64-cgo), const RTA_GATEWAY ideal-int +pkg syscall (openbsd-amd64-cgo), const RTA_GENMASK ideal-int +pkg syscall (openbsd-amd64-cgo), const RTA_IFA ideal-int +pkg syscall (openbsd-amd64-cgo), const RTA_IFP ideal-int +pkg syscall (openbsd-amd64-cgo), const RTA_LABEL ideal-int +pkg syscall (openbsd-amd64-cgo), const RTA_NETMASK ideal-int +pkg syscall (openbsd-amd64-cgo), const RTA_SRC ideal-int +pkg syscall (openbsd-amd64-cgo), const RTA_SRCMASK ideal-int +pkg syscall (openbsd-amd64-cgo), const RTF_ANNOUNCE ideal-int +pkg syscall (openbsd-amd64-cgo), const RTF_BLACKHOLE ideal-int +pkg syscall (openbsd-amd64-cgo), const RTF_CLONED ideal-int +pkg syscall (openbsd-amd64-cgo), const RTF_CLONING ideal-int +pkg syscall (openbsd-amd64-cgo), const RTF_DONE ideal-int +pkg syscall (openbsd-amd64-cgo), const RTF_DYNAMIC ideal-int +pkg syscall (openbsd-amd64-cgo), const RTF_FMASK ideal-int +pkg syscall (openbsd-amd64-cgo), const RTF_GATEWAY ideal-int +pkg syscall (openbsd-amd64-cgo), const RTF_HOST ideal-int +pkg syscall (openbsd-amd64-cgo), const RTF_LLINFO ideal-int +pkg syscall (openbsd-amd64-cgo), const RTF_MASK ideal-int +pkg syscall (openbsd-amd64-cgo), const RTF_MODIFIED ideal-int +pkg syscall (openbsd-amd64-cgo), const RTF_MPATH ideal-int +pkg syscall (openbsd-amd64-cgo), const RTF_MPLS ideal-int +pkg syscall (openbsd-amd64-cgo), const RTF_PERMANENT_ARP ideal-int +pkg syscall (openbsd-amd64-cgo), const RTF_PROTO1 ideal-int +pkg syscall (openbsd-amd64-cgo), const RTF_PROTO2 ideal-int +pkg syscall (openbsd-amd64-cgo), const RTF_PROTO3 ideal-int +pkg syscall (openbsd-amd64-cgo), const RTF_REJECT ideal-int +pkg syscall (openbsd-amd64-cgo), const RTF_SOURCE ideal-int +pkg syscall (openbsd-amd64-cgo), const RTF_STATIC ideal-int +pkg syscall (openbsd-amd64-cgo), const RTF_TUNNEL ideal-int +pkg syscall (openbsd-amd64-cgo), const RTF_UP ideal-int +pkg syscall (openbsd-amd64-cgo), const RTF_USETRAILERS ideal-int +pkg syscall (openbsd-amd64-cgo), const RTF_XRESOLVE ideal-int +pkg syscall (openbsd-amd64-cgo), const RTM_ADD ideal-int +pkg syscall (openbsd-amd64-cgo), const RTM_CHANGE ideal-int +pkg syscall (openbsd-amd64-cgo), const RTM_DELADDR ideal-int +pkg syscall (openbsd-amd64-cgo), const RTM_DELETE ideal-int +pkg syscall (openbsd-amd64-cgo), const RTM_DESYNC ideal-int +pkg syscall (openbsd-amd64-cgo), const RTM_GET ideal-int +pkg syscall (openbsd-amd64-cgo), const RTM_IFANNOUNCE ideal-int +pkg syscall (openbsd-amd64-cgo), const RTM_IFINFO ideal-int +pkg syscall (openbsd-amd64-cgo), const RTM_LOCK ideal-int +pkg syscall (openbsd-amd64-cgo), const RTM_LOSING ideal-int +pkg syscall (openbsd-amd64-cgo), const RTM_MAXSIZE ideal-int +pkg syscall (openbsd-amd64-cgo), const RTM_MISS ideal-int +pkg syscall (openbsd-amd64-cgo), const RTM_NEWADDR ideal-int +pkg syscall (openbsd-amd64-cgo), const RTM_REDIRECT ideal-int +pkg syscall (openbsd-amd64-cgo), const RTM_RESOLVE ideal-int +pkg syscall (openbsd-amd64-cgo), const RTM_RTTUNIT ideal-int +pkg syscall (openbsd-amd64-cgo), const RTM_VERSION ideal-int +pkg syscall (openbsd-amd64-cgo), const RTV_EXPIRE ideal-int +pkg syscall (openbsd-amd64-cgo), const RTV_HOPCOUNT ideal-int +pkg syscall (openbsd-amd64-cgo), const RTV_MTU ideal-int +pkg syscall (openbsd-amd64-cgo), const RTV_RPIPE ideal-int +pkg syscall (openbsd-amd64-cgo), const RTV_RTT ideal-int +pkg syscall (openbsd-amd64-cgo), const RTV_RTTVAR ideal-int +pkg syscall (openbsd-amd64-cgo), const RTV_SPIPE ideal-int +pkg syscall (openbsd-amd64-cgo), const RTV_SSTHRESH ideal-int +pkg syscall (openbsd-amd64-cgo), const RT_TABLEID_MAX ideal-int +pkg syscall (openbsd-amd64-cgo), const RUSAGE_CHILDREN ideal-int +pkg syscall (openbsd-amd64-cgo), const RUSAGE_SELF ideal-int +pkg syscall (openbsd-amd64-cgo), const RUSAGE_THREAD ideal-int +pkg syscall (openbsd-amd64-cgo), const SCM_RIGHTS ideal-int +pkg syscall (openbsd-amd64-cgo), const SCM_TIMESTAMP ideal-int +pkg syscall (openbsd-amd64-cgo), const SIGCHLD Signal +pkg syscall (openbsd-amd64-cgo), const SIGCONT Signal +pkg syscall (openbsd-amd64-cgo), const SIGEMT Signal +pkg syscall (openbsd-amd64-cgo), const SIGINFO Signal +pkg syscall (openbsd-amd64-cgo), const SIGIO Signal +pkg syscall (openbsd-amd64-cgo), const SIGIOT Signal +pkg syscall (openbsd-amd64-cgo), const SIGPROF Signal +pkg syscall (openbsd-amd64-cgo), const SIGSTOP Signal +pkg syscall (openbsd-amd64-cgo), const SIGSYS Signal +pkg syscall (openbsd-amd64-cgo), const SIGTHR Signal +pkg syscall (openbsd-amd64-cgo), const SIGTSTP Signal +pkg syscall (openbsd-amd64-cgo), const SIGTTIN Signal +pkg syscall (openbsd-amd64-cgo), const SIGTTOU Signal +pkg syscall (openbsd-amd64-cgo), const SIGURG Signal +pkg syscall (openbsd-amd64-cgo), const SIGUSR1 Signal +pkg syscall (openbsd-amd64-cgo), const SIGUSR2 Signal +pkg syscall (openbsd-amd64-cgo), const SIGVTALRM Signal +pkg syscall (openbsd-amd64-cgo), const SIGWINCH Signal +pkg syscall (openbsd-amd64-cgo), const SIGXCPU Signal +pkg syscall (openbsd-amd64-cgo), const SIGXFSZ Signal +pkg syscall (openbsd-amd64-cgo), const SIOCADDMULTI ideal-int +pkg syscall (openbsd-amd64-cgo), const SIOCAIFADDR ideal-int +pkg syscall (openbsd-amd64-cgo), const SIOCAIFGROUP ideal-int +pkg syscall (openbsd-amd64-cgo), const SIOCALIFADDR ideal-int +pkg syscall (openbsd-amd64-cgo), const SIOCATMARK ideal-int +pkg syscall (openbsd-amd64-cgo), const SIOCBRDGADD ideal-int +pkg syscall (openbsd-amd64-cgo), const SIOCBRDGADDS ideal-int +pkg syscall (openbsd-amd64-cgo), const SIOCBRDGARL ideal-int +pkg syscall (openbsd-amd64-cgo), const SIOCBRDGDADDR ideal-int +pkg syscall (openbsd-amd64-cgo), const SIOCBRDGDEL ideal-int +pkg syscall (openbsd-amd64-cgo), const SIOCBRDGDELS ideal-int +pkg syscall (openbsd-amd64-cgo), const SIOCBRDGFLUSH ideal-int +pkg syscall (openbsd-amd64-cgo), const SIOCBRDGFRL ideal-int +pkg syscall (openbsd-amd64-cgo), const SIOCBRDGGCACHE ideal-int +pkg syscall (openbsd-amd64-cgo), const SIOCBRDGGFD ideal-int +pkg syscall (openbsd-amd64-cgo), const SIOCBRDGGHT ideal-int +pkg syscall (openbsd-amd64-cgo), const SIOCBRDGGIFFLGS ideal-int +pkg syscall (openbsd-amd64-cgo), const SIOCBRDGGMA ideal-int +pkg syscall (openbsd-amd64-cgo), const SIOCBRDGGPARAM ideal-int +pkg syscall (openbsd-amd64-cgo), const SIOCBRDGGPRI ideal-int +pkg syscall (openbsd-amd64-cgo), const SIOCBRDGGRL ideal-int +pkg syscall (openbsd-amd64-cgo), const SIOCBRDGGSIFS ideal-int +pkg syscall (openbsd-amd64-cgo), const SIOCBRDGGTO ideal-int +pkg syscall (openbsd-amd64-cgo), const SIOCBRDGIFS ideal-int +pkg syscall (openbsd-amd64-cgo), const SIOCBRDGRTS ideal-int +pkg syscall (openbsd-amd64-cgo), const SIOCBRDGSADDR ideal-int +pkg syscall (openbsd-amd64-cgo), const SIOCBRDGSCACHE ideal-int +pkg syscall (openbsd-amd64-cgo), const SIOCBRDGSFD ideal-int +pkg syscall (openbsd-amd64-cgo), const SIOCBRDGSHT ideal-int +pkg syscall (openbsd-amd64-cgo), const SIOCBRDGSIFCOST ideal-int +pkg syscall (openbsd-amd64-cgo), const SIOCBRDGSIFFLGS ideal-int +pkg syscall (openbsd-amd64-cgo), const SIOCBRDGSIFPRIO ideal-int +pkg syscall (openbsd-amd64-cgo), const SIOCBRDGSMA ideal-int +pkg syscall (openbsd-amd64-cgo), const SIOCBRDGSPRI ideal-int +pkg syscall (openbsd-amd64-cgo), const SIOCBRDGSPROTO ideal-int +pkg syscall (openbsd-amd64-cgo), const SIOCBRDGSTO ideal-int +pkg syscall (openbsd-amd64-cgo), const SIOCBRDGSTXHC ideal-int +pkg syscall (openbsd-amd64-cgo), const SIOCDELMULTI ideal-int +pkg syscall (openbsd-amd64-cgo), const SIOCDIFADDR ideal-int +pkg syscall (openbsd-amd64-cgo), const SIOCDIFGROUP ideal-int +pkg syscall (openbsd-amd64-cgo), const SIOCDIFPHYADDR ideal-int +pkg syscall (openbsd-amd64-cgo), const SIOCDLIFADDR ideal-int +pkg syscall (openbsd-amd64-cgo), const SIOCGETKALIVE ideal-int +pkg syscall (openbsd-amd64-cgo), const SIOCGETLABEL ideal-int +pkg syscall (openbsd-amd64-cgo), const SIOCGETPFLOW ideal-int +pkg syscall (openbsd-amd64-cgo), const SIOCGETPFSYNC ideal-int +pkg syscall (openbsd-amd64-cgo), const SIOCGETSGCNT ideal-int +pkg syscall (openbsd-amd64-cgo), const SIOCGETVIFCNT ideal-int +pkg syscall (openbsd-amd64-cgo), const SIOCGHIWAT ideal-int +pkg syscall (openbsd-amd64-cgo), const SIOCGIFADDR ideal-int +pkg syscall (openbsd-amd64-cgo), const SIOCGIFASYNCMAP ideal-int +pkg syscall (openbsd-amd64-cgo), const SIOCGIFBRDADDR ideal-int +pkg syscall (openbsd-amd64-cgo), const SIOCGIFCONF ideal-int +pkg syscall (openbsd-amd64-cgo), const SIOCGIFDATA ideal-int +pkg syscall (openbsd-amd64-cgo), const SIOCGIFDESCR ideal-int +pkg syscall (openbsd-amd64-cgo), const SIOCGIFDSTADDR ideal-int +pkg syscall (openbsd-amd64-cgo), const SIOCGIFFLAGS ideal-int +pkg syscall (openbsd-amd64-cgo), const SIOCGIFGATTR ideal-int +pkg syscall (openbsd-amd64-cgo), const SIOCGIFGENERIC ideal-int +pkg syscall (openbsd-amd64-cgo), const SIOCGIFGMEMB ideal-int +pkg syscall (openbsd-amd64-cgo), const SIOCGIFGROUP ideal-int +pkg syscall (openbsd-amd64-cgo), const SIOCGIFMEDIA ideal-int +pkg syscall (openbsd-amd64-cgo), const SIOCGIFMETRIC ideal-int +pkg syscall (openbsd-amd64-cgo), const SIOCGIFMTU ideal-int +pkg syscall (openbsd-amd64-cgo), const SIOCGIFNETMASK ideal-int +pkg syscall (openbsd-amd64-cgo), const SIOCGIFPDSTADDR ideal-int +pkg syscall (openbsd-amd64-cgo), const SIOCGIFPRIORITY ideal-int +pkg syscall (openbsd-amd64-cgo), const SIOCGIFPSRCADDR ideal-int +pkg syscall (openbsd-amd64-cgo), const SIOCGIFRDOMAIN ideal-int +pkg syscall (openbsd-amd64-cgo), const SIOCGIFRTLABEL ideal-int +pkg syscall (openbsd-amd64-cgo), const SIOCGIFTIMESLOT ideal-int +pkg syscall (openbsd-amd64-cgo), const SIOCGIFXFLAGS ideal-int +pkg syscall (openbsd-amd64-cgo), const SIOCGLIFADDR ideal-int +pkg syscall (openbsd-amd64-cgo), const SIOCGLIFPHYADDR ideal-int +pkg syscall (openbsd-amd64-cgo), const SIOCGLIFPHYRTABLE ideal-int +pkg syscall (openbsd-amd64-cgo), const SIOCGLOWAT ideal-int +pkg syscall (openbsd-amd64-cgo), const SIOCGPGRP ideal-int +pkg syscall (openbsd-amd64-cgo), const SIOCGVH ideal-int +pkg syscall (openbsd-amd64-cgo), const SIOCIFCREATE ideal-int +pkg syscall (openbsd-amd64-cgo), const SIOCIFDESTROY ideal-int +pkg syscall (openbsd-amd64-cgo), const SIOCIFGCLONERS ideal-int +pkg syscall (openbsd-amd64-cgo), const SIOCSETKALIVE ideal-int +pkg syscall (openbsd-amd64-cgo), const SIOCSETLABEL ideal-int +pkg syscall (openbsd-amd64-cgo), const SIOCSETPFLOW ideal-int +pkg syscall (openbsd-amd64-cgo), const SIOCSETPFSYNC ideal-int +pkg syscall (openbsd-amd64-cgo), const SIOCSHIWAT ideal-int +pkg syscall (openbsd-amd64-cgo), const SIOCSIFADDR ideal-int +pkg syscall (openbsd-amd64-cgo), const SIOCSIFASYNCMAP ideal-int +pkg syscall (openbsd-amd64-cgo), const SIOCSIFBRDADDR ideal-int +pkg syscall (openbsd-amd64-cgo), const SIOCSIFDESCR ideal-int +pkg syscall (openbsd-amd64-cgo), const SIOCSIFDSTADDR ideal-int +pkg syscall (openbsd-amd64-cgo), const SIOCSIFFLAGS ideal-int +pkg syscall (openbsd-amd64-cgo), const SIOCSIFGATTR ideal-int +pkg syscall (openbsd-amd64-cgo), const SIOCSIFGENERIC ideal-int +pkg syscall (openbsd-amd64-cgo), const SIOCSIFLLADDR ideal-int +pkg syscall (openbsd-amd64-cgo), const SIOCSIFMEDIA ideal-int +pkg syscall (openbsd-amd64-cgo), const SIOCSIFMETRIC ideal-int +pkg syscall (openbsd-amd64-cgo), const SIOCSIFMTU ideal-int +pkg syscall (openbsd-amd64-cgo), const SIOCSIFNETMASK ideal-int +pkg syscall (openbsd-amd64-cgo), const SIOCSIFPHYADDR ideal-int +pkg syscall (openbsd-amd64-cgo), const SIOCSIFPRIORITY ideal-int +pkg syscall (openbsd-amd64-cgo), const SIOCSIFRDOMAIN ideal-int +pkg syscall (openbsd-amd64-cgo), const SIOCSIFRTLABEL ideal-int +pkg syscall (openbsd-amd64-cgo), const SIOCSIFTIMESLOT ideal-int +pkg syscall (openbsd-amd64-cgo), const SIOCSIFXFLAGS ideal-int +pkg syscall (openbsd-amd64-cgo), const SIOCSLIFPHYADDR ideal-int +pkg syscall (openbsd-amd64-cgo), const SIOCSLIFPHYRTABLE ideal-int +pkg syscall (openbsd-amd64-cgo), const SIOCSLOWAT ideal-int +pkg syscall (openbsd-amd64-cgo), const SIOCSPGRP ideal-int +pkg syscall (openbsd-amd64-cgo), const SIOCSVH ideal-int +pkg syscall (openbsd-amd64-cgo), const SOCK_RDM ideal-int +pkg syscall (openbsd-amd64-cgo), const SO_ACCEPTCONN ideal-int +pkg syscall (openbsd-amd64-cgo), const SO_BINDANY ideal-int +pkg syscall (openbsd-amd64-cgo), const SO_DEBUG ideal-int +pkg syscall (openbsd-amd64-cgo), const SO_ERROR ideal-int +pkg syscall (openbsd-amd64-cgo), const SO_NETPROC ideal-int +pkg syscall (openbsd-amd64-cgo), const SO_OOBINLINE ideal-int +pkg syscall (openbsd-amd64-cgo), const SO_PEERCRED ideal-int +pkg syscall (openbsd-amd64-cgo), const SO_RCVLOWAT ideal-int +pkg syscall (openbsd-amd64-cgo), const SO_RCVTIMEO ideal-int +pkg syscall (openbsd-amd64-cgo), const SO_REUSEPORT ideal-int +pkg syscall (openbsd-amd64-cgo), const SO_RTABLE ideal-int +pkg syscall (openbsd-amd64-cgo), const SO_SNDLOWAT ideal-int +pkg syscall (openbsd-amd64-cgo), const SO_SNDTIMEO ideal-int +pkg syscall (openbsd-amd64-cgo), const SO_SPLICE ideal-int +pkg syscall (openbsd-amd64-cgo), const SO_TIMESTAMP ideal-int +pkg syscall (openbsd-amd64-cgo), const SO_TYPE ideal-int +pkg syscall (openbsd-amd64-cgo), const SO_USELOOPBACK ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_ACCEPT ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_ACCESS ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_ACCT ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_ADJFREQ ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_ADJTIME ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_BIND ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_CHDIR ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_CHFLAGS ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_CHMOD ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_CHOWN ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_CHROOT ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_CLOCK_GETRES ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_CLOCK_GETTIME ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_CLOCK_SETTIME ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_CLOSE ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_CLOSEFROM ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_CONNECT ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_DUP ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_DUP2 ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_EXECVE ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_EXIT ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_FACCESSAT ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_FCHDIR ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_FCHFLAGS ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_FCHMOD ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_FCHMODAT ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_FCHOWN ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_FCHOWNAT ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_FCNTL ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_FHOPEN ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_FHSTAT ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_FHSTATFS ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_FLOCK ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_FORK ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_FPATHCONF ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_FSTAT ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_FSTATAT ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_FSTATFS ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_FSYNC ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_FTRUNCATE ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_FUTIMENS ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_FUTIMES ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_GETDIRENTRIES ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_GETDTABLECOUNT ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_GETEGID ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_GETEUID ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_GETFH ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_GETFSSTAT ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_GETGID ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_GETGROUPS ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_GETITIMER ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_GETLOGIN ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_GETPEERNAME ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_GETPGID ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_GETPGRP ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_GETPID ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_GETPPID ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_GETPRIORITY ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_GETRESGID ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_GETRESUID ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_GETRLIMIT ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_GETRTABLE ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_GETRUSAGE ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_GETSID ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_GETSOCKNAME ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_GETSOCKOPT ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_GETTHRID ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_GETTIMEOFDAY ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_GETUID ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_IOCTL ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_ISSETUGID ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_KEVENT ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_KILL ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_KQUEUE ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_KTRACE ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_LCHOWN ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_LINK ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_LINKAT ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_LISTEN ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_LSEEK ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_LSTAT ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_MADVISE ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_MINCORE ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_MINHERIT ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_MKDIR ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_MKDIRAT ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_MKFIFO ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_MKFIFOAT ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_MKNOD ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_MKNODAT ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_MLOCK ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_MLOCKALL ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_MMAP ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_MOUNT ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_MPROTECT ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_MQUERY ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_MSGCTL ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_MSGGET ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_MSGRCV ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_MSGSND ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_MSYNC ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_MUNLOCK ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_MUNLOCKALL ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_MUNMAP ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_NANOSLEEP ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_NFSSVC ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_OBREAK ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_OPEN ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_OPENAT ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_PATHCONF ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_PIPE ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_POLL ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_PREAD ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_PREADV ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_PROFIL ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_PTRACE ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_PWRITE ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_PWRITEV ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_QUOTACTL ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_READ ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_READLINK ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_READLINKAT ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_READV ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_REBOOT ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_RECVFROM ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_RECVMSG ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_RENAME ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_RENAMEAT ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_REVOKE ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_RMDIR ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_SCHED_YIELD ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_SELECT ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_SEMGET ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_SEMOP ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_SENDMSG ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_SENDTO ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_SETEGID ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_SETEUID ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_SETGID ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_SETGROUPS ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_SETITIMER ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_SETLOGIN ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_SETPGID ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_SETPRIORITY ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_SETREGID ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_SETRESGID ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_SETRESUID ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_SETREUID ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_SETRLIMIT ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_SETRTABLE ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_SETSID ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_SETSOCKOPT ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_SETTIMEOFDAY ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_SETUID ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_SHMAT ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_SHMCTL ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_SHMDT ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_SHMGET ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_SHUTDOWN ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_SIGACTION ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_SIGALTSTACK ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_SIGPENDING ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_SIGPROCMASK ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_SIGRETURN ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_SIGSUSPEND ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_SOCKET ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_SOCKETPAIR ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_STAT ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_STATFS ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_SWAPCTL ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_SYMLINK ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_SYMLINKAT ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_SYNC ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_SYSARCH ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_TRUNCATE ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_UMASK ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_UNLINK ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_UNLINKAT ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_UNMOUNT ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_UTIMENSAT ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_UTIMES ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_VFORK ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_WAIT4 ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_WRITE ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_WRITEV ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS___GETCWD ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS___GET_TCB ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS___SEMCTL ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS___SET_TCB ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS___SYSCTL ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS___TFORK ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS___THREXIT ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS___THRSIGDIVERT ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS___THRSLEEP ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS___THRWAKEUP ideal-int +pkg syscall (openbsd-amd64-cgo), const SizeofBpfHdr ideal-int +pkg syscall (openbsd-amd64-cgo), const SizeofBpfInsn ideal-int +pkg syscall (openbsd-amd64-cgo), const SizeofBpfProgram ideal-int +pkg syscall (openbsd-amd64-cgo), const SizeofBpfStat ideal-int +pkg syscall (openbsd-amd64-cgo), const SizeofBpfVersion ideal-int +pkg syscall (openbsd-amd64-cgo), const SizeofCmsghdr ideal-int +pkg syscall (openbsd-amd64-cgo), const SizeofICMPv6Filter = 32 +pkg syscall (openbsd-amd64-cgo), const SizeofICMPv6Filter ideal-int +pkg syscall (openbsd-amd64-cgo), const SizeofIPMreq ideal-int +pkg syscall (openbsd-amd64-cgo), const SizeofIPv6MTUInfo = 32 +pkg syscall (openbsd-amd64-cgo), const SizeofIPv6MTUInfo ideal-int +pkg syscall (openbsd-amd64-cgo), const SizeofIPv6Mreq ideal-int +pkg syscall (openbsd-amd64-cgo), const SizeofIfAnnounceMsghdr ideal-int +pkg syscall (openbsd-amd64-cgo), const SizeofIfData ideal-int +pkg syscall (openbsd-amd64-cgo), const SizeofIfMsghdr ideal-int +pkg syscall (openbsd-amd64-cgo), const SizeofIfaMsghdr ideal-int +pkg syscall (openbsd-amd64-cgo), const SizeofInet6Pktinfo ideal-int +pkg syscall (openbsd-amd64-cgo), const SizeofLinger ideal-int +pkg syscall (openbsd-amd64-cgo), const SizeofMsghdr ideal-int +pkg syscall (openbsd-amd64-cgo), const SizeofRtMetrics ideal-int +pkg syscall (openbsd-amd64-cgo), const SizeofRtMsghdr ideal-int +pkg syscall (openbsd-amd64-cgo), const SizeofSockaddrAny ideal-int +pkg syscall (openbsd-amd64-cgo), const SizeofSockaddrDatalink ideal-int +pkg syscall (openbsd-amd64-cgo), const SizeofSockaddrInet4 ideal-int +pkg syscall (openbsd-amd64-cgo), const SizeofSockaddrInet6 ideal-int +pkg syscall (openbsd-amd64-cgo), const SizeofSockaddrUnix ideal-int +pkg syscall (openbsd-amd64-cgo), const TCIFLUSH ideal-int +pkg syscall (openbsd-amd64-cgo), const TCIOFLUSH ideal-int +pkg syscall (openbsd-amd64-cgo), const TCOFLUSH ideal-int +pkg syscall (openbsd-amd64-cgo), const TCP_MAXBURST ideal-int +pkg syscall (openbsd-amd64-cgo), const TCP_MAXSEG ideal-int +pkg syscall (openbsd-amd64-cgo), const TCP_MAXWIN ideal-int +pkg syscall (openbsd-amd64-cgo), const TCP_MAX_SACK ideal-int +pkg syscall (openbsd-amd64-cgo), const TCP_MAX_WINSHIFT ideal-int +pkg syscall (openbsd-amd64-cgo), const TCP_MD5SIG ideal-int +pkg syscall (openbsd-amd64-cgo), const TCP_MSS ideal-int +pkg syscall (openbsd-amd64-cgo), const TCP_NSTATES ideal-int +pkg syscall (openbsd-amd64-cgo), const TCP_SACK_ENABLE ideal-int +pkg syscall (openbsd-amd64-cgo), const TCSAFLUSH ideal-int +pkg syscall (openbsd-amd64-cgo), const TIOCCBRK ideal-int +pkg syscall (openbsd-amd64-cgo), const TIOCCDTR ideal-int +pkg syscall (openbsd-amd64-cgo), const TIOCCONS ideal-int +pkg syscall (openbsd-amd64-cgo), const TIOCDRAIN ideal-int +pkg syscall (openbsd-amd64-cgo), const TIOCEXCL ideal-int +pkg syscall (openbsd-amd64-cgo), const TIOCEXT ideal-int +pkg syscall (openbsd-amd64-cgo), const TIOCFLAG_CLOCAL ideal-int +pkg syscall (openbsd-amd64-cgo), const TIOCFLAG_CRTSCTS ideal-int +pkg syscall (openbsd-amd64-cgo), const TIOCFLAG_MDMBUF ideal-int +pkg syscall (openbsd-amd64-cgo), const TIOCFLAG_PPS ideal-int +pkg syscall (openbsd-amd64-cgo), const TIOCFLAG_SOFTCAR ideal-int +pkg syscall (openbsd-amd64-cgo), const TIOCFLUSH ideal-int +pkg syscall (openbsd-amd64-cgo), const TIOCGETA ideal-int +pkg syscall (openbsd-amd64-cgo), const TIOCGETD ideal-int +pkg syscall (openbsd-amd64-cgo), const TIOCGFLAGS ideal-int +pkg syscall (openbsd-amd64-cgo), const TIOCGPGRP ideal-int +pkg syscall (openbsd-amd64-cgo), const TIOCGTSTAMP ideal-int +pkg syscall (openbsd-amd64-cgo), const TIOCGWINSZ ideal-int +pkg syscall (openbsd-amd64-cgo), const TIOCMBIC ideal-int +pkg syscall (openbsd-amd64-cgo), const TIOCMBIS ideal-int +pkg syscall (openbsd-amd64-cgo), const TIOCMGET ideal-int +pkg syscall (openbsd-amd64-cgo), const TIOCMODG ideal-int +pkg syscall (openbsd-amd64-cgo), const TIOCMODS ideal-int +pkg syscall (openbsd-amd64-cgo), const TIOCMSET ideal-int +pkg syscall (openbsd-amd64-cgo), const TIOCM_CAR ideal-int +pkg syscall (openbsd-amd64-cgo), const TIOCM_CD ideal-int +pkg syscall (openbsd-amd64-cgo), const TIOCM_CTS ideal-int +pkg syscall (openbsd-amd64-cgo), const TIOCM_DSR ideal-int +pkg syscall (openbsd-amd64-cgo), const TIOCM_DTR ideal-int +pkg syscall (openbsd-amd64-cgo), const TIOCM_LE ideal-int +pkg syscall (openbsd-amd64-cgo), const TIOCM_RI ideal-int +pkg syscall (openbsd-amd64-cgo), const TIOCM_RNG ideal-int +pkg syscall (openbsd-amd64-cgo), const TIOCM_RTS ideal-int +pkg syscall (openbsd-amd64-cgo), const TIOCM_SR ideal-int +pkg syscall (openbsd-amd64-cgo), const TIOCM_ST ideal-int +pkg syscall (openbsd-amd64-cgo), const TIOCNOTTY ideal-int +pkg syscall (openbsd-amd64-cgo), const TIOCNXCL ideal-int +pkg syscall (openbsd-amd64-cgo), const TIOCOUTQ ideal-int +pkg syscall (openbsd-amd64-cgo), const TIOCPKT ideal-int +pkg syscall (openbsd-amd64-cgo), const TIOCPKT_DATA ideal-int +pkg syscall (openbsd-amd64-cgo), const TIOCPKT_DOSTOP ideal-int +pkg syscall (openbsd-amd64-cgo), const TIOCPKT_FLUSHREAD ideal-int +pkg syscall (openbsd-amd64-cgo), const TIOCPKT_FLUSHWRITE ideal-int +pkg syscall (openbsd-amd64-cgo), const TIOCPKT_IOCTL ideal-int +pkg syscall (openbsd-amd64-cgo), const TIOCPKT_NOSTOP ideal-int +pkg syscall (openbsd-amd64-cgo), const TIOCPKT_START ideal-int +pkg syscall (openbsd-amd64-cgo), const TIOCPKT_STOP ideal-int +pkg syscall (openbsd-amd64-cgo), const TIOCREMOTE ideal-int +pkg syscall (openbsd-amd64-cgo), const TIOCSBRK ideal-int +pkg syscall (openbsd-amd64-cgo), const TIOCSCTTY ideal-int +pkg syscall (openbsd-amd64-cgo), const TIOCSDTR ideal-int +pkg syscall (openbsd-amd64-cgo), const TIOCSETA ideal-int +pkg syscall (openbsd-amd64-cgo), const TIOCSETAF ideal-int +pkg syscall (openbsd-amd64-cgo), const TIOCSETAW ideal-int +pkg syscall (openbsd-amd64-cgo), const TIOCSETD ideal-int +pkg syscall (openbsd-amd64-cgo), const TIOCSFLAGS ideal-int +pkg syscall (openbsd-amd64-cgo), const TIOCSIG ideal-int +pkg syscall (openbsd-amd64-cgo), const TIOCSPGRP ideal-int +pkg syscall (openbsd-amd64-cgo), const TIOCSTART ideal-int +pkg syscall (openbsd-amd64-cgo), const TIOCSTAT ideal-int +pkg syscall (openbsd-amd64-cgo), const TIOCSTI ideal-int +pkg syscall (openbsd-amd64-cgo), const TIOCSTOP ideal-int +pkg syscall (openbsd-amd64-cgo), const TIOCSTSTAMP ideal-int +pkg syscall (openbsd-amd64-cgo), const TIOCSWINSZ ideal-int +pkg syscall (openbsd-amd64-cgo), const TIOCUCNTL ideal-int +pkg syscall (openbsd-amd64-cgo), const TOSTOP ideal-int +pkg syscall (openbsd-amd64-cgo), const VDISCARD ideal-int +pkg syscall (openbsd-amd64-cgo), const VDSUSP ideal-int +pkg syscall (openbsd-amd64-cgo), const VEOF ideal-int +pkg syscall (openbsd-amd64-cgo), const VEOL ideal-int +pkg syscall (openbsd-amd64-cgo), const VEOL2 ideal-int +pkg syscall (openbsd-amd64-cgo), const VERASE ideal-int +pkg syscall (openbsd-amd64-cgo), const VINTR ideal-int +pkg syscall (openbsd-amd64-cgo), const VKILL ideal-int +pkg syscall (openbsd-amd64-cgo), const VLNEXT ideal-int +pkg syscall (openbsd-amd64-cgo), const VMIN ideal-int +pkg syscall (openbsd-amd64-cgo), const VQUIT ideal-int +pkg syscall (openbsd-amd64-cgo), const VREPRINT ideal-int +pkg syscall (openbsd-amd64-cgo), const VSTART ideal-int +pkg syscall (openbsd-amd64-cgo), const VSTATUS ideal-int +pkg syscall (openbsd-amd64-cgo), const VSTOP ideal-int +pkg syscall (openbsd-amd64-cgo), const VSUSP ideal-int +pkg syscall (openbsd-amd64-cgo), const VTIME ideal-int +pkg syscall (openbsd-amd64-cgo), const VWERASE ideal-int +pkg syscall (openbsd-amd64-cgo), const WALTSIG ideal-int +pkg syscall (openbsd-amd64-cgo), const WCONTINUED ideal-int +pkg syscall (openbsd-amd64-cgo), const WCOREFLAG ideal-int +pkg syscall (openbsd-amd64-cgo), const WNOHANG ideal-int +pkg syscall (openbsd-amd64-cgo), const WSTOPPED ideal-int +pkg syscall (openbsd-amd64-cgo), const WUNTRACED ideal-int +pkg syscall (openbsd-amd64-cgo), func Accept(int) (int, Sockaddr, error) +pkg syscall (openbsd-amd64-cgo), func Access(string, uint32) error +pkg syscall (openbsd-amd64-cgo), func Adjtime(*Timeval, *Timeval) error +pkg syscall (openbsd-amd64-cgo), func Bind(int, Sockaddr) error +pkg syscall (openbsd-amd64-cgo), func BpfBuflen(int) (int, error) +pkg syscall (openbsd-amd64-cgo), func BpfDatalink(int) (int, error) +pkg syscall (openbsd-amd64-cgo), func BpfHeadercmpl(int) (int, error) +pkg syscall (openbsd-amd64-cgo), func BpfInterface(int, string) (string, error) +pkg syscall (openbsd-amd64-cgo), func BpfJump(int, int, int, int) *BpfInsn +pkg syscall (openbsd-amd64-cgo), func BpfStats(int) (*BpfStat, error) +pkg syscall (openbsd-amd64-cgo), func BpfStmt(int, int) *BpfInsn +pkg syscall (openbsd-amd64-cgo), func BpfTimeout(int) (*Timeval, error) +pkg syscall (openbsd-amd64-cgo), func CheckBpfVersion(int) error +pkg syscall (openbsd-amd64-cgo), func Chflags(string, int) error +pkg syscall (openbsd-amd64-cgo), func Chroot(string) error +pkg syscall (openbsd-amd64-cgo), func Close(int) error +pkg syscall (openbsd-amd64-cgo), func CloseOnExec(int) +pkg syscall (openbsd-amd64-cgo), func CmsgLen(int) int +pkg syscall (openbsd-amd64-cgo), func CmsgSpace(int) int +pkg syscall (openbsd-amd64-cgo), func Connect(int, Sockaddr) error +pkg syscall (openbsd-amd64-cgo), func Dup(int) (int, error) +pkg syscall (openbsd-amd64-cgo), func Dup2(int, int) error +pkg syscall (openbsd-amd64-cgo), func Fchdir(int) error +pkg syscall (openbsd-amd64-cgo), func Fchflags(int, int) error +pkg syscall (openbsd-amd64-cgo), func Fchmod(int, uint32) error +pkg syscall (openbsd-amd64-cgo), func Fchown(int, int, int) error +pkg syscall (openbsd-amd64-cgo), func Flock(int, int) error +pkg syscall (openbsd-amd64-cgo), func FlushBpf(int) error +pkg syscall (openbsd-amd64-cgo), func ForkExec(string, []string, *ProcAttr) (int, error) +pkg syscall (openbsd-amd64-cgo), func Fpathconf(int, int) (int, error) +pkg syscall (openbsd-amd64-cgo), func Fstat(int, *Stat_t) error +pkg syscall (openbsd-amd64-cgo), func Fstatfs(int, *Statfs_t) error +pkg syscall (openbsd-amd64-cgo), func Fsync(int) error +pkg syscall (openbsd-amd64-cgo), func Ftruncate(int, int64) error +pkg syscall (openbsd-amd64-cgo), func Futimes(int, []Timeval) error +pkg syscall (openbsd-amd64-cgo), func Getdirentries(int, []uint8, *uintptr) (int, error) +pkg syscall (openbsd-amd64-cgo), func Getfsstat([]Statfs_t, int) (int, error) +pkg syscall (openbsd-amd64-cgo), func Getpeername(int) (Sockaddr, error) +pkg syscall (openbsd-amd64-cgo), func Getpgid(int) (int, error) +pkg syscall (openbsd-amd64-cgo), func Getpgrp() int +pkg syscall (openbsd-amd64-cgo), func Getpriority(int, int) (int, error) +pkg syscall (openbsd-amd64-cgo), func Getrlimit(int, *Rlimit) error +pkg syscall (openbsd-amd64-cgo), func Getrusage(int, *Rusage) error +pkg syscall (openbsd-amd64-cgo), func Getsid(int) (int, error) +pkg syscall (openbsd-amd64-cgo), func Getsockname(int) (Sockaddr, error) +pkg syscall (openbsd-amd64-cgo), func GetsockoptByte(int, int, int) (uint8, error) +pkg syscall (openbsd-amd64-cgo), func GetsockoptICMPv6Filter(int, int, int) (*ICMPv6Filter, error) +pkg syscall (openbsd-amd64-cgo), func GetsockoptIPMreq(int, int, int) (*IPMreq, error) +pkg syscall (openbsd-amd64-cgo), func GetsockoptIPv6MTUInfo(int, int, int) (*IPv6MTUInfo, error) +pkg syscall (openbsd-amd64-cgo), func GetsockoptIPv6Mreq(int, int, int) (*IPv6Mreq, error) +pkg syscall (openbsd-amd64-cgo), func GetsockoptInet4Addr(int, int, int) ([4]uint8, error) +pkg syscall (openbsd-amd64-cgo), func GetsockoptInt(int, int, int) (int, error) +pkg syscall (openbsd-amd64-cgo), func Issetugid() bool +pkg syscall (openbsd-amd64-cgo), func Kevent(int, []Kevent_t, []Kevent_t, *Timespec) (int, error) +pkg syscall (openbsd-amd64-cgo), func Kill(int, Signal) error +pkg syscall (openbsd-amd64-cgo), func Kqueue() (int, error) +pkg syscall (openbsd-amd64-cgo), func Listen(int, int) error +pkg syscall (openbsd-amd64-cgo), func Lstat(string, *Stat_t) error +pkg syscall (openbsd-amd64-cgo), func Mkfifo(string, uint32) error +pkg syscall (openbsd-amd64-cgo), func Mknod(string, uint32, int) error +pkg syscall (openbsd-amd64-cgo), func Mmap(int, int64, int, int, int) ([]uint8, error) +pkg syscall (openbsd-amd64-cgo), func Munmap([]uint8) error +pkg syscall (openbsd-amd64-cgo), func Nanosleep(*Timespec, *Timespec) error +pkg syscall (openbsd-amd64-cgo), func Open(string, int, uint32) (int, error) +pkg syscall (openbsd-amd64-cgo), func ParseDirent([]uint8, int, []string) (int, int, []string) +pkg syscall (openbsd-amd64-cgo), func ParseRoutingMessage([]uint8) ([]RoutingMessage, error) +pkg syscall (openbsd-amd64-cgo), func ParseRoutingSockaddr(RoutingMessage) ([]Sockaddr, error) +pkg syscall (openbsd-amd64-cgo), func ParseSocketControlMessage([]uint8) ([]SocketControlMessage, error) +pkg syscall (openbsd-amd64-cgo), func ParseUnixRights(*SocketControlMessage) ([]int, error) +pkg syscall (openbsd-amd64-cgo), func Pathconf(string, int) (int, error) +pkg syscall (openbsd-amd64-cgo), func Pipe([]int) error +pkg syscall (openbsd-amd64-cgo), func Pread(int, []uint8, int64) (int, error) +pkg syscall (openbsd-amd64-cgo), func Pwrite(int, []uint8, int64) (int, error) +pkg syscall (openbsd-amd64-cgo), func RawSyscall(uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno) +pkg syscall (openbsd-amd64-cgo), func RawSyscall6(uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno) +pkg syscall (openbsd-amd64-cgo), func Read(int, []uint8) (int, error) +pkg syscall (openbsd-amd64-cgo), func ReadDirent(int, []uint8) (int, error) +pkg syscall (openbsd-amd64-cgo), func Recvfrom(int, []uint8, int) (int, Sockaddr, error) +pkg syscall (openbsd-amd64-cgo), func Recvmsg(int, []uint8, []uint8, int) (int, int, int, Sockaddr, error) +pkg syscall (openbsd-amd64-cgo), func Revoke(string) error +pkg syscall (openbsd-amd64-cgo), func RouteRIB(int, int) ([]uint8, error) +pkg syscall (openbsd-amd64-cgo), func Seek(int, int64, int) (int64, error) +pkg syscall (openbsd-amd64-cgo), func Select(int, *FdSet, *FdSet, *FdSet, *Timeval) error +pkg syscall (openbsd-amd64-cgo), func Sendfile(int, int, *int64, int) (int, error) +pkg syscall (openbsd-amd64-cgo), func Sendmsg(int, []uint8, []uint8, Sockaddr, int) error +pkg syscall (openbsd-amd64-cgo), func Sendto(int, []uint8, int, Sockaddr) error +pkg syscall (openbsd-amd64-cgo), func SetBpf(int, []BpfInsn) error +pkg syscall (openbsd-amd64-cgo), func SetBpfBuflen(int, int) (int, error) +pkg syscall (openbsd-amd64-cgo), func SetBpfDatalink(int, int) (int, error) +pkg syscall (openbsd-amd64-cgo), func SetBpfHeadercmpl(int, int) error +pkg syscall (openbsd-amd64-cgo), func SetBpfImmediate(int, int) error +pkg syscall (openbsd-amd64-cgo), func SetBpfInterface(int, string) error +pkg syscall (openbsd-amd64-cgo), func SetBpfPromisc(int, int) error +pkg syscall (openbsd-amd64-cgo), func SetBpfTimeout(int, *Timeval) error +pkg syscall (openbsd-amd64-cgo), func SetKevent(*Kevent_t, int, int, int) +pkg syscall (openbsd-amd64-cgo), func SetNonblock(int, bool) error +pkg syscall (openbsd-amd64-cgo), func Setegid(int) error +pkg syscall (openbsd-amd64-cgo), func Seteuid(int) error +pkg syscall (openbsd-amd64-cgo), func Setgid(int) error +pkg syscall (openbsd-amd64-cgo), func Setgroups([]int) error +pkg syscall (openbsd-amd64-cgo), func Setlogin(string) error +pkg syscall (openbsd-amd64-cgo), func Setpgid(int, int) error +pkg syscall (openbsd-amd64-cgo), func Setpriority(int, int, int) error +pkg syscall (openbsd-amd64-cgo), func Setregid(int, int) error +pkg syscall (openbsd-amd64-cgo), func Setreuid(int, int) error +pkg syscall (openbsd-amd64-cgo), func Setrlimit(int, *Rlimit) error +pkg syscall (openbsd-amd64-cgo), func Setsid() (int, error) +pkg syscall (openbsd-amd64-cgo), func SetsockoptByte(int, int, int, uint8) error +pkg syscall (openbsd-amd64-cgo), func SetsockoptICMPv6Filter(int, int, int, *ICMPv6Filter) error +pkg syscall (openbsd-amd64-cgo), func SetsockoptIPMreq(int, int, int, *IPMreq) error +pkg syscall (openbsd-amd64-cgo), func SetsockoptIPv6Mreq(int, int, int, *IPv6Mreq) error +pkg syscall (openbsd-amd64-cgo), func SetsockoptInet4Addr(int, int, int, [4]uint8) error +pkg syscall (openbsd-amd64-cgo), func SetsockoptInt(int, int, int, int) error +pkg syscall (openbsd-amd64-cgo), func SetsockoptLinger(int, int, int, *Linger) error +pkg syscall (openbsd-amd64-cgo), func SetsockoptString(int, int, int, string) error +pkg syscall (openbsd-amd64-cgo), func SetsockoptTimeval(int, int, int, *Timeval) error +pkg syscall (openbsd-amd64-cgo), func Settimeofday(*Timeval) error +pkg syscall (openbsd-amd64-cgo), func Setuid(int) error +pkg syscall (openbsd-amd64-cgo), func Shutdown(int, int) error +pkg syscall (openbsd-amd64-cgo), func SlicePtrFromStrings([]string) ([]*uint8, error) +pkg syscall (openbsd-amd64-cgo), func Socket(int, int, int) (int, error) +pkg syscall (openbsd-amd64-cgo), func Socketpair(int, int, int) ([2]int, error) +pkg syscall (openbsd-amd64-cgo), func Stat(string, *Stat_t) error +pkg syscall (openbsd-amd64-cgo), func Statfs(string, *Statfs_t) error +pkg syscall (openbsd-amd64-cgo), func StringSlicePtr([]string) []*uint8 +pkg syscall (openbsd-amd64-cgo), func Sync() error +pkg syscall (openbsd-amd64-cgo), func Syscall(uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno) +pkg syscall (openbsd-amd64-cgo), func Syscall6(uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno) +pkg syscall (openbsd-amd64-cgo), func Syscall9(uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno) +pkg syscall (openbsd-amd64-cgo), func Sysctl(string) (string, error) +pkg syscall (openbsd-amd64-cgo), func SysctlUint32(string) (uint32, error) +pkg syscall (openbsd-amd64-cgo), func TimevalToNsec(Timeval) int64 +pkg syscall (openbsd-amd64-cgo), func Truncate(string, int64) error +pkg syscall (openbsd-amd64-cgo), func Umask(int) int +pkg syscall (openbsd-amd64-cgo), func UnixRights(...int) []uint8 +pkg syscall (openbsd-amd64-cgo), func Unmount(string, int) error +pkg syscall (openbsd-amd64-cgo), func Wait4(int, *WaitStatus, int, *Rusage) (int, error) +pkg syscall (openbsd-amd64-cgo), func Write(int, []uint8) (int, error) +pkg syscall (openbsd-amd64-cgo), method (*Cmsghdr) SetLen(int) +pkg syscall (openbsd-amd64-cgo), method (*Iovec) SetLen(int) +pkg syscall (openbsd-amd64-cgo), method (*Msghdr) SetControllen(int) +pkg syscall (openbsd-amd64-cgo), type BpfHdr struct +pkg syscall (openbsd-amd64-cgo), type BpfHdr struct, Caplen uint32 +pkg syscall (openbsd-amd64-cgo), type BpfHdr struct, Datalen uint32 +pkg syscall (openbsd-amd64-cgo), type BpfHdr struct, Hdrlen uint16 +pkg syscall (openbsd-amd64-cgo), type BpfHdr struct, Pad_cgo_0 [2]uint8 +pkg syscall (openbsd-amd64-cgo), type BpfHdr struct, Tstamp BpfTimeval +pkg syscall (openbsd-amd64-cgo), type BpfInsn struct +pkg syscall (openbsd-amd64-cgo), type BpfInsn struct, Code uint16 +pkg syscall (openbsd-amd64-cgo), type BpfInsn struct, Jf uint8 +pkg syscall (openbsd-amd64-cgo), type BpfInsn struct, Jt uint8 +pkg syscall (openbsd-amd64-cgo), type BpfInsn struct, K uint32 +pkg syscall (openbsd-amd64-cgo), type BpfProgram struct +pkg syscall (openbsd-amd64-cgo), type BpfProgram struct, Insns *BpfInsn +pkg syscall (openbsd-amd64-cgo), type BpfProgram struct, Len uint32 +pkg syscall (openbsd-amd64-cgo), type BpfProgram struct, Pad_cgo_0 [4]uint8 +pkg syscall (openbsd-amd64-cgo), type BpfStat struct +pkg syscall (openbsd-amd64-cgo), type BpfStat struct, Drop uint32 +pkg syscall (openbsd-amd64-cgo), type BpfStat struct, Recv uint32 +pkg syscall (openbsd-amd64-cgo), type BpfTimeval struct +pkg syscall (openbsd-amd64-cgo), type BpfTimeval struct, Sec uint32 +pkg syscall (openbsd-amd64-cgo), type BpfTimeval struct, Usec uint32 +pkg syscall (openbsd-amd64-cgo), type BpfVersion struct +pkg syscall (openbsd-amd64-cgo), type BpfVersion struct, Major uint16 +pkg syscall (openbsd-amd64-cgo), type BpfVersion struct, Minor uint16 +pkg syscall (openbsd-amd64-cgo), type Cmsghdr struct +pkg syscall (openbsd-amd64-cgo), type Cmsghdr struct, Len uint32 +pkg syscall (openbsd-amd64-cgo), type Cmsghdr struct, Level int32 +pkg syscall (openbsd-amd64-cgo), type Cmsghdr struct, Type int32 +pkg syscall (openbsd-amd64-cgo), type Credential struct +pkg syscall (openbsd-amd64-cgo), type Credential struct, Gid uint32 +pkg syscall (openbsd-amd64-cgo), type Credential struct, Groups []uint32 +pkg syscall (openbsd-amd64-cgo), type Credential struct, Uid uint32 +pkg syscall (openbsd-amd64-cgo), type Dirent struct +pkg syscall (openbsd-amd64-cgo), type Dirent struct, Fileno uint32 +pkg syscall (openbsd-amd64-cgo), type Dirent struct, Name [256]int8 +pkg syscall (openbsd-amd64-cgo), type Dirent struct, Namlen uint8 +pkg syscall (openbsd-amd64-cgo), type Dirent struct, Reclen uint16 +pkg syscall (openbsd-amd64-cgo), type Dirent struct, Type uint8 +pkg syscall (openbsd-amd64-cgo), type FdSet struct +pkg syscall (openbsd-amd64-cgo), type FdSet struct, Bits [32]int32 +pkg syscall (openbsd-amd64-cgo), type Flock_t struct +pkg syscall (openbsd-amd64-cgo), type Flock_t struct, Len int64 +pkg syscall (openbsd-amd64-cgo), type Flock_t struct, Pid int32 +pkg syscall (openbsd-amd64-cgo), type Flock_t struct, Start int64 +pkg syscall (openbsd-amd64-cgo), type Flock_t struct, Type int16 +pkg syscall (openbsd-amd64-cgo), type Flock_t struct, Whence int16 +pkg syscall (openbsd-amd64-cgo), type Fsid struct +pkg syscall (openbsd-amd64-cgo), type Fsid struct, Val [2]int32 +pkg syscall (openbsd-amd64-cgo), type ICMPv6Filter struct +pkg syscall (openbsd-amd64-cgo), type ICMPv6Filter struct, Filt [8]uint32 +pkg syscall (openbsd-amd64-cgo), type IPv6MTUInfo struct +pkg syscall (openbsd-amd64-cgo), type IPv6MTUInfo struct, Addr RawSockaddrInet6 +pkg syscall (openbsd-amd64-cgo), type IPv6MTUInfo struct, Mtu uint32 +pkg syscall (openbsd-amd64-cgo), type IfAnnounceMsghdr struct +pkg syscall (openbsd-amd64-cgo), type IfAnnounceMsghdr struct, Hdrlen uint16 +pkg syscall (openbsd-amd64-cgo), type IfAnnounceMsghdr struct, Index uint16 +pkg syscall (openbsd-amd64-cgo), type IfAnnounceMsghdr struct, Msglen uint16 +pkg syscall (openbsd-amd64-cgo), type IfAnnounceMsghdr struct, Name [16]int8 +pkg syscall (openbsd-amd64-cgo), type IfAnnounceMsghdr struct, Type uint8 +pkg syscall (openbsd-amd64-cgo), type IfAnnounceMsghdr struct, Version uint8 +pkg syscall (openbsd-amd64-cgo), type IfAnnounceMsghdr struct, What uint16 +pkg syscall (openbsd-amd64-cgo), type IfData struct +pkg syscall (openbsd-amd64-cgo), type IfData struct, Addrlen uint8 +pkg syscall (openbsd-amd64-cgo), type IfData struct, Baudrate uint64 +pkg syscall (openbsd-amd64-cgo), type IfData struct, Capabilities uint32 +pkg syscall (openbsd-amd64-cgo), type IfData struct, Collisions uint64 +pkg syscall (openbsd-amd64-cgo), type IfData struct, Hdrlen uint8 +pkg syscall (openbsd-amd64-cgo), type IfData struct, Ibytes uint64 +pkg syscall (openbsd-amd64-cgo), type IfData struct, Ierrors uint64 +pkg syscall (openbsd-amd64-cgo), type IfData struct, Imcasts uint64 +pkg syscall (openbsd-amd64-cgo), type IfData struct, Ipackets uint64 +pkg syscall (openbsd-amd64-cgo), type IfData struct, Iqdrops uint64 +pkg syscall (openbsd-amd64-cgo), type IfData struct, Lastchange Timeval +pkg syscall (openbsd-amd64-cgo), type IfData struct, Link_state uint8 +pkg syscall (openbsd-amd64-cgo), type IfData struct, Mclpool [7]Mclpool +pkg syscall (openbsd-amd64-cgo), type IfData struct, Metric uint32 +pkg syscall (openbsd-amd64-cgo), type IfData struct, Mtu uint32 +pkg syscall (openbsd-amd64-cgo), type IfData struct, Noproto uint64 +pkg syscall (openbsd-amd64-cgo), type IfData struct, Obytes uint64 +pkg syscall (openbsd-amd64-cgo), type IfData struct, Oerrors uint64 +pkg syscall (openbsd-amd64-cgo), type IfData struct, Omcasts uint64 +pkg syscall (openbsd-amd64-cgo), type IfData struct, Opackets uint64 +pkg syscall (openbsd-amd64-cgo), type IfData struct, Pad uint32 +pkg syscall (openbsd-amd64-cgo), type IfData struct, Pad_cgo_0 [4]uint8 +pkg syscall (openbsd-amd64-cgo), type IfData struct, Pad_cgo_1 [4]uint8 +pkg syscall (openbsd-amd64-cgo), type IfData struct, Type uint8 +pkg syscall (openbsd-amd64-cgo), type IfMsghdr struct +pkg syscall (openbsd-amd64-cgo), type IfMsghdr struct, Addrs int32 +pkg syscall (openbsd-amd64-cgo), type IfMsghdr struct, Data IfData +pkg syscall (openbsd-amd64-cgo), type IfMsghdr struct, Flags int32 +pkg syscall (openbsd-amd64-cgo), type IfMsghdr struct, Hdrlen uint16 +pkg syscall (openbsd-amd64-cgo), type IfMsghdr struct, Index uint16 +pkg syscall (openbsd-amd64-cgo), type IfMsghdr struct, Msglen uint16 +pkg syscall (openbsd-amd64-cgo), type IfMsghdr struct, Pad1 uint8 +pkg syscall (openbsd-amd64-cgo), type IfMsghdr struct, Pad2 uint8 +pkg syscall (openbsd-amd64-cgo), type IfMsghdr struct, Tableid uint16 +pkg syscall (openbsd-amd64-cgo), type IfMsghdr struct, Type uint8 +pkg syscall (openbsd-amd64-cgo), type IfMsghdr struct, Version uint8 +pkg syscall (openbsd-amd64-cgo), type IfMsghdr struct, Xflags int32 +pkg syscall (openbsd-amd64-cgo), type IfaMsghdr struct +pkg syscall (openbsd-amd64-cgo), type IfaMsghdr struct, Addrs int32 +pkg syscall (openbsd-amd64-cgo), type IfaMsghdr struct, Flags int32 +pkg syscall (openbsd-amd64-cgo), type IfaMsghdr struct, Hdrlen uint16 +pkg syscall (openbsd-amd64-cgo), type IfaMsghdr struct, Index uint16 +pkg syscall (openbsd-amd64-cgo), type IfaMsghdr struct, Metric int32 +pkg syscall (openbsd-amd64-cgo), type IfaMsghdr struct, Msglen uint16 +pkg syscall (openbsd-amd64-cgo), type IfaMsghdr struct, Pad1 uint8 +pkg syscall (openbsd-amd64-cgo), type IfaMsghdr struct, Pad2 uint8 +pkg syscall (openbsd-amd64-cgo), type IfaMsghdr struct, Tableid uint16 +pkg syscall (openbsd-amd64-cgo), type IfaMsghdr struct, Type uint8 +pkg syscall (openbsd-amd64-cgo), type IfaMsghdr struct, Version uint8 +pkg syscall (openbsd-amd64-cgo), type Inet6Pktinfo struct +pkg syscall (openbsd-amd64-cgo), type Inet6Pktinfo struct, Addr [16]uint8 +pkg syscall (openbsd-amd64-cgo), type Inet6Pktinfo struct, Ifindex uint32 +pkg syscall (openbsd-amd64-cgo), type InterfaceAddrMessage struct +pkg syscall (openbsd-amd64-cgo), type InterfaceAddrMessage struct, Data []uint8 +pkg syscall (openbsd-amd64-cgo), type InterfaceAddrMessage struct, Header IfaMsghdr +pkg syscall (openbsd-amd64-cgo), type InterfaceAnnounceMessage struct +pkg syscall (openbsd-amd64-cgo), type InterfaceAnnounceMessage struct, Header IfAnnounceMsghdr +pkg syscall (openbsd-amd64-cgo), type InterfaceMessage struct +pkg syscall (openbsd-amd64-cgo), type InterfaceMessage struct, Data []uint8 +pkg syscall (openbsd-amd64-cgo), type InterfaceMessage struct, Header IfMsghdr +pkg syscall (openbsd-amd64-cgo), type Iovec struct +pkg syscall (openbsd-amd64-cgo), type Iovec struct, Base *uint8 +pkg syscall (openbsd-amd64-cgo), type Iovec struct, Len uint64 +pkg syscall (openbsd-amd64-cgo), type Kevent_t struct +pkg syscall (openbsd-amd64-cgo), type Kevent_t struct, Data int32 +pkg syscall (openbsd-amd64-cgo), type Kevent_t struct, Fflags uint32 +pkg syscall (openbsd-amd64-cgo), type Kevent_t struct, Filter int16 +pkg syscall (openbsd-amd64-cgo), type Kevent_t struct, Flags uint16 +pkg syscall (openbsd-amd64-cgo), type Kevent_t struct, Ident uint32 +pkg syscall (openbsd-amd64-cgo), type Kevent_t struct, Udata *uint8 +pkg syscall (openbsd-amd64-cgo), type Mclpool struct +pkg syscall (openbsd-amd64-cgo), type Mclpool struct, Alive uint16 +pkg syscall (openbsd-amd64-cgo), type Mclpool struct, Cwm uint16 +pkg syscall (openbsd-amd64-cgo), type Mclpool struct, Grown uint32 +pkg syscall (openbsd-amd64-cgo), type Mclpool struct, Hwm uint16 +pkg syscall (openbsd-amd64-cgo), type Mclpool struct, Lwm uint16 +pkg syscall (openbsd-amd64-cgo), type Msghdr struct +pkg syscall (openbsd-amd64-cgo), type Msghdr struct, Control *uint8 +pkg syscall (openbsd-amd64-cgo), type Msghdr struct, Controllen uint32 +pkg syscall (openbsd-amd64-cgo), type Msghdr struct, Flags int32 +pkg syscall (openbsd-amd64-cgo), type Msghdr struct, Iov *Iovec +pkg syscall (openbsd-amd64-cgo), type Msghdr struct, Iovlen uint32 +pkg syscall (openbsd-amd64-cgo), type Msghdr struct, Name *uint8 +pkg syscall (openbsd-amd64-cgo), type Msghdr struct, Namelen uint32 +pkg syscall (openbsd-amd64-cgo), type Msghdr struct, Pad_cgo_0 [4]uint8 +pkg syscall (openbsd-amd64-cgo), type Msghdr struct, Pad_cgo_1 [4]uint8 +pkg syscall (openbsd-amd64-cgo), type RawSockaddr struct, Data [14]int8 +pkg syscall (openbsd-amd64-cgo), type RawSockaddr struct, Family uint8 +pkg syscall (openbsd-amd64-cgo), type RawSockaddr struct, Len uint8 +pkg syscall (openbsd-amd64-cgo), type RawSockaddrAny struct, Pad [92]int8 +pkg syscall (openbsd-amd64-cgo), type RawSockaddrDatalink struct +pkg syscall (openbsd-amd64-cgo), type RawSockaddrDatalink struct, Alen uint8 +pkg syscall (openbsd-amd64-cgo), type RawSockaddrDatalink struct, Data [24]int8 +pkg syscall (openbsd-amd64-cgo), type RawSockaddrDatalink struct, Family uint8 +pkg syscall (openbsd-amd64-cgo), type RawSockaddrDatalink struct, Index uint16 +pkg syscall (openbsd-amd64-cgo), type RawSockaddrDatalink struct, Len uint8 +pkg syscall (openbsd-amd64-cgo), type RawSockaddrDatalink struct, Nlen uint8 +pkg syscall (openbsd-amd64-cgo), type RawSockaddrDatalink struct, Slen uint8 +pkg syscall (openbsd-amd64-cgo), type RawSockaddrDatalink struct, Type uint8 +pkg syscall (openbsd-amd64-cgo), type RawSockaddrInet4 struct, Family uint8 +pkg syscall (openbsd-amd64-cgo), type RawSockaddrInet4 struct, Len uint8 +pkg syscall (openbsd-amd64-cgo), type RawSockaddrInet4 struct, Zero [8]int8 +pkg syscall (openbsd-amd64-cgo), type RawSockaddrInet6 struct, Family uint8 +pkg syscall (openbsd-amd64-cgo), type RawSockaddrInet6 struct, Len uint8 +pkg syscall (openbsd-amd64-cgo), type RawSockaddrUnix struct +pkg syscall (openbsd-amd64-cgo), type RawSockaddrUnix struct, Family uint8 +pkg syscall (openbsd-amd64-cgo), type RawSockaddrUnix struct, Len uint8 +pkg syscall (openbsd-amd64-cgo), type RawSockaddrUnix struct, Path [104]int8 +pkg syscall (openbsd-amd64-cgo), type Rlimit struct +pkg syscall (openbsd-amd64-cgo), type Rlimit struct, Cur uint64 +pkg syscall (openbsd-amd64-cgo), type Rlimit struct, Max uint64 +pkg syscall (openbsd-amd64-cgo), type RouteMessage struct +pkg syscall (openbsd-amd64-cgo), type RouteMessage struct, Data []uint8 +pkg syscall (openbsd-amd64-cgo), type RouteMessage struct, Header RtMsghdr +pkg syscall (openbsd-amd64-cgo), type RoutingMessage interface, unexported methods +pkg syscall (openbsd-amd64-cgo), type RtMetrics struct +pkg syscall (openbsd-amd64-cgo), type RtMetrics struct, Expire uint32 +pkg syscall (openbsd-amd64-cgo), type RtMetrics struct, Hopcount uint32 +pkg syscall (openbsd-amd64-cgo), type RtMetrics struct, Locks uint32 +pkg syscall (openbsd-amd64-cgo), type RtMetrics struct, Mtu uint32 +pkg syscall (openbsd-amd64-cgo), type RtMetrics struct, Pksent uint64 +pkg syscall (openbsd-amd64-cgo), type RtMetrics struct, Recvpipe uint32 +pkg syscall (openbsd-amd64-cgo), type RtMetrics struct, Refcnt uint32 +pkg syscall (openbsd-amd64-cgo), type RtMetrics struct, Rtt uint32 +pkg syscall (openbsd-amd64-cgo), type RtMetrics struct, Rttvar uint32 +pkg syscall (openbsd-amd64-cgo), type RtMetrics struct, Sendpipe uint32 +pkg syscall (openbsd-amd64-cgo), type RtMetrics struct, Ssthresh uint32 +pkg syscall (openbsd-amd64-cgo), type RtMsghdr struct +pkg syscall (openbsd-amd64-cgo), type RtMsghdr struct, Addrs int32 +pkg syscall (openbsd-amd64-cgo), type RtMsghdr struct, Errno int32 +pkg syscall (openbsd-amd64-cgo), type RtMsghdr struct, Flags int32 +pkg syscall (openbsd-amd64-cgo), type RtMsghdr struct, Fmask int32 +pkg syscall (openbsd-amd64-cgo), type RtMsghdr struct, Hdrlen uint16 +pkg syscall (openbsd-amd64-cgo), type RtMsghdr struct, Index uint16 +pkg syscall (openbsd-amd64-cgo), type RtMsghdr struct, Inits uint32 +pkg syscall (openbsd-amd64-cgo), type RtMsghdr struct, Mpls uint8 +pkg syscall (openbsd-amd64-cgo), type RtMsghdr struct, Msglen uint16 +pkg syscall (openbsd-amd64-cgo), type RtMsghdr struct, Pid int32 +pkg syscall (openbsd-amd64-cgo), type RtMsghdr struct, Priority uint8 +pkg syscall (openbsd-amd64-cgo), type RtMsghdr struct, Rmx RtMetrics +pkg syscall (openbsd-amd64-cgo), type RtMsghdr struct, Seq int32 +pkg syscall (openbsd-amd64-cgo), type RtMsghdr struct, Tableid uint16 +pkg syscall (openbsd-amd64-cgo), type RtMsghdr struct, Type uint8 +pkg syscall (openbsd-amd64-cgo), type RtMsghdr struct, Version uint8 +pkg syscall (openbsd-amd64-cgo), type Rusage struct, Idrss int64 +pkg syscall (openbsd-amd64-cgo), type Rusage struct, Inblock int64 +pkg syscall (openbsd-amd64-cgo), type Rusage struct, Isrss int64 +pkg syscall (openbsd-amd64-cgo), type Rusage struct, Ixrss int64 +pkg syscall (openbsd-amd64-cgo), type Rusage struct, Majflt int64 +pkg syscall (openbsd-amd64-cgo), type Rusage struct, Maxrss int64 +pkg syscall (openbsd-amd64-cgo), type Rusage struct, Minflt int64 +pkg syscall (openbsd-amd64-cgo), type Rusage struct, Msgrcv int64 +pkg syscall (openbsd-amd64-cgo), type Rusage struct, Msgsnd int64 +pkg syscall (openbsd-amd64-cgo), type Rusage struct, Nivcsw int64 +pkg syscall (openbsd-amd64-cgo), type Rusage struct, Nsignals int64 +pkg syscall (openbsd-amd64-cgo), type Rusage struct, Nswap int64 +pkg syscall (openbsd-amd64-cgo), type Rusage struct, Nvcsw int64 +pkg syscall (openbsd-amd64-cgo), type Rusage struct, Oublock int64 +pkg syscall (openbsd-amd64-cgo), type Rusage struct, Stime Timeval +pkg syscall (openbsd-amd64-cgo), type Rusage struct, Utime Timeval +pkg syscall (openbsd-amd64-cgo), type SockaddrDatalink struct +pkg syscall (openbsd-amd64-cgo), type SockaddrDatalink struct, Alen uint8 +pkg syscall (openbsd-amd64-cgo), type SockaddrDatalink struct, Data [24]int8 +pkg syscall (openbsd-amd64-cgo), type SockaddrDatalink struct, Family uint8 +pkg syscall (openbsd-amd64-cgo), type SockaddrDatalink struct, Index uint16 +pkg syscall (openbsd-amd64-cgo), type SockaddrDatalink struct, Len uint8 +pkg syscall (openbsd-amd64-cgo), type SockaddrDatalink struct, Nlen uint8 +pkg syscall (openbsd-amd64-cgo), type SockaddrDatalink struct, Slen uint8 +pkg syscall (openbsd-amd64-cgo), type SockaddrDatalink struct, Type uint8 +pkg syscall (openbsd-amd64-cgo), type SocketControlMessage struct +pkg syscall (openbsd-amd64-cgo), type SocketControlMessage struct, Data []uint8 +pkg syscall (openbsd-amd64-cgo), type SocketControlMessage struct, Header Cmsghdr +pkg syscall (openbsd-amd64-cgo), type Stat_t struct +pkg syscall (openbsd-amd64-cgo), type Stat_t struct, Atim Timespec +pkg syscall (openbsd-amd64-cgo), type Stat_t struct, Blksize uint32 +pkg syscall (openbsd-amd64-cgo), type Stat_t struct, Blocks int64 +pkg syscall (openbsd-amd64-cgo), type Stat_t struct, Ctim Timespec +pkg syscall (openbsd-amd64-cgo), type Stat_t struct, Dev int32 +pkg syscall (openbsd-amd64-cgo), type Stat_t struct, Flags uint32 +pkg syscall (openbsd-amd64-cgo), type Stat_t struct, Gen uint32 +pkg syscall (openbsd-amd64-cgo), type Stat_t struct, Gid uint32 +pkg syscall (openbsd-amd64-cgo), type Stat_t struct, Ino uint32 +pkg syscall (openbsd-amd64-cgo), type Stat_t struct, Lspare0 int32 +pkg syscall (openbsd-amd64-cgo), type Stat_t struct, Lspare1 int32 +pkg syscall (openbsd-amd64-cgo), type Stat_t struct, Mode uint32 +pkg syscall (openbsd-amd64-cgo), type Stat_t struct, Mtim Timespec +pkg syscall (openbsd-amd64-cgo), type Stat_t struct, Nlink uint32 +pkg syscall (openbsd-amd64-cgo), type Stat_t struct, Qspare [2]int64 +pkg syscall (openbsd-amd64-cgo), type Stat_t struct, Rdev int32 +pkg syscall (openbsd-amd64-cgo), type Stat_t struct, Size int64 +pkg syscall (openbsd-amd64-cgo), type Stat_t struct, Uid uint32 +pkg syscall (openbsd-amd64-cgo), type Stat_t struct, X__st_birthtim Timespec +pkg syscall (openbsd-amd64-cgo), type Statfs_t struct +pkg syscall (openbsd-amd64-cgo), type Statfs_t struct, F_asyncreads uint64 +pkg syscall (openbsd-amd64-cgo), type Statfs_t struct, F_asyncwrites uint64 +pkg syscall (openbsd-amd64-cgo), type Statfs_t struct, F_bavail int64 +pkg syscall (openbsd-amd64-cgo), type Statfs_t struct, F_bfree uint64 +pkg syscall (openbsd-amd64-cgo), type Statfs_t struct, F_blocks uint64 +pkg syscall (openbsd-amd64-cgo), type Statfs_t struct, F_bsize uint32 +pkg syscall (openbsd-amd64-cgo), type Statfs_t struct, F_ctime uint32 +pkg syscall (openbsd-amd64-cgo), type Statfs_t struct, F_favail int64 +pkg syscall (openbsd-amd64-cgo), type Statfs_t struct, F_ffree uint64 +pkg syscall (openbsd-amd64-cgo), type Statfs_t struct, F_files uint64 +pkg syscall (openbsd-amd64-cgo), type Statfs_t struct, F_flags uint32 +pkg syscall (openbsd-amd64-cgo), type Statfs_t struct, F_fsid Fsid +pkg syscall (openbsd-amd64-cgo), type Statfs_t struct, F_fstypename [16]int8 +pkg syscall (openbsd-amd64-cgo), type Statfs_t struct, F_iosize uint32 +pkg syscall (openbsd-amd64-cgo), type Statfs_t struct, F_mntfromname [90]int8 +pkg syscall (openbsd-amd64-cgo), type Statfs_t struct, F_mntonname [90]int8 +pkg syscall (openbsd-amd64-cgo), type Statfs_t struct, F_namemax uint32 +pkg syscall (openbsd-amd64-cgo), type Statfs_t struct, F_owner uint32 +pkg syscall (openbsd-amd64-cgo), type Statfs_t struct, F_spare [3]uint32 +pkg syscall (openbsd-amd64-cgo), type Statfs_t struct, F_syncreads uint64 +pkg syscall (openbsd-amd64-cgo), type Statfs_t struct, F_syncwrites uint64 +pkg syscall (openbsd-amd64-cgo), type Statfs_t struct, Mount_info [160]uint8 +pkg syscall (openbsd-amd64-cgo), type Statfs_t struct, Pad_cgo_0 [4]uint8 +pkg syscall (openbsd-amd64-cgo), type Statfs_t struct, Pad_cgo_1 [4]uint8 +pkg syscall (openbsd-amd64-cgo), type SysProcAttr struct, Chroot string +pkg syscall (openbsd-amd64-cgo), type SysProcAttr struct, Credential *Credential +pkg syscall (openbsd-amd64-cgo), type SysProcAttr struct, Noctty bool +pkg syscall (openbsd-amd64-cgo), type SysProcAttr struct, Ptrace bool +pkg syscall (openbsd-amd64-cgo), type SysProcAttr struct, Setctty bool +pkg syscall (openbsd-amd64-cgo), type SysProcAttr struct, Setpgid bool +pkg syscall (openbsd-amd64-cgo), type SysProcAttr struct, Setsid bool +pkg syscall (openbsd-amd64-cgo), type Timespec struct, Nsec int64 +pkg syscall (openbsd-amd64-cgo), type Timespec struct, Pad_cgo_0 [4]uint8 +pkg syscall (openbsd-amd64-cgo), type Timespec struct, Sec int32 +pkg syscall (openbsd-amd64-cgo), type Timeval struct, Sec int64 +pkg syscall (openbsd-amd64-cgo), type Timeval struct, Usec int64 +pkg syscall (openbsd-amd64-cgo), type WaitStatus uint32 +pkg syscall (openbsd-amd64-cgo), var Stderr int +pkg syscall (openbsd-amd64-cgo), var Stdin int +pkg syscall (openbsd-amd64-cgo), var Stdout int +pkg syscall (windows-386), const BASE_PROTOCOL = 1 +pkg syscall (windows-386), const BASE_PROTOCOL ideal-int +pkg syscall (windows-386), const ERROR_HANDLE_EOF = 38 +pkg syscall (windows-386), const ERROR_HANDLE_EOF Errno +pkg syscall (windows-386), const FILE_SKIP_COMPLETION_PORT_ON_SUCCESS = 1 +pkg syscall (windows-386), const FILE_SKIP_COMPLETION_PORT_ON_SUCCESS ideal-int +pkg syscall (windows-386), const FILE_SKIP_SET_EVENT_ON_HANDLE = 2 +pkg syscall (windows-386), const FILE_SKIP_SET_EVENT_ON_HANDLE ideal-int +pkg syscall (windows-386), const LAYERED_PROTOCOL = 0 +pkg syscall (windows-386), const LAYERED_PROTOCOL ideal-int +pkg syscall (windows-386), const MAX_PROTOCOL_CHAIN = 7 +pkg syscall (windows-386), const MAX_PROTOCOL_CHAIN ideal-int +pkg syscall (windows-386), const NetSetupDomainName = 3 +pkg syscall (windows-386), const NetSetupDomainName ideal-int +pkg syscall (windows-386), const NetSetupUnjoined = 1 +pkg syscall (windows-386), const NetSetupUnjoined ideal-int +pkg syscall (windows-386), const NetSetupUnknownStatus = 0 +pkg syscall (windows-386), const NetSetupUnknownStatus ideal-int +pkg syscall (windows-386), const NetSetupWorkgroupName = 2 +pkg syscall (windows-386), const NetSetupWorkgroupName ideal-int +pkg syscall (windows-386), const PFL_HIDDEN = 4 +pkg syscall (windows-386), const PFL_HIDDEN ideal-int +pkg syscall (windows-386), const PFL_MATCHES_PROTOCOL_ZERO = 8 +pkg syscall (windows-386), const PFL_MATCHES_PROTOCOL_ZERO ideal-int +pkg syscall (windows-386), const PFL_MULTIPLE_PROTO_ENTRIES = 1 +pkg syscall (windows-386), const PFL_MULTIPLE_PROTO_ENTRIES ideal-int +pkg syscall (windows-386), const PFL_NETWORKDIRECT_PROVIDER = 16 +pkg syscall (windows-386), const PFL_NETWORKDIRECT_PROVIDER ideal-int +pkg syscall (windows-386), const PFL_RECOMMENDED_PROTO_ENTRY = 2 +pkg syscall (windows-386), const PFL_RECOMMENDED_PROTO_ENTRY ideal-int +pkg syscall (windows-386), const PROCESS_TERMINATE = 1 +pkg syscall (windows-386), const PROCESS_TERMINATE ideal-int +pkg syscall (windows-386), const WSAEACCES = 10013 +pkg syscall (windows-386), const WSAEACCES Errno +pkg syscall (windows-386), const WSAPROTOCOL_LEN = 255 +pkg syscall (windows-386), const WSAPROTOCOL_LEN ideal-int +pkg syscall (windows-386), const XP1_CONNECTIONLESS = 1 +pkg syscall (windows-386), const XP1_CONNECTIONLESS ideal-int +pkg syscall (windows-386), const XP1_CONNECT_DATA = 128 +pkg syscall (windows-386), const XP1_CONNECT_DATA ideal-int +pkg syscall (windows-386), const XP1_DISCONNECT_DATA = 256 +pkg syscall (windows-386), const XP1_DISCONNECT_DATA ideal-int +pkg syscall (windows-386), const XP1_EXPEDITED_DATA = 64 +pkg syscall (windows-386), const XP1_EXPEDITED_DATA ideal-int +pkg syscall (windows-386), const XP1_GRACEFUL_CLOSE = 32 +pkg syscall (windows-386), const XP1_GRACEFUL_CLOSE ideal-int +pkg syscall (windows-386), const XP1_GUARANTEED_DELIVERY = 2 +pkg syscall (windows-386), const XP1_GUARANTEED_DELIVERY ideal-int +pkg syscall (windows-386), const XP1_GUARANTEED_ORDER = 4 +pkg syscall (windows-386), const XP1_GUARANTEED_ORDER ideal-int +pkg syscall (windows-386), const XP1_IFS_HANDLES = 131072 +pkg syscall (windows-386), const XP1_IFS_HANDLES ideal-int +pkg syscall (windows-386), const XP1_MESSAGE_ORIENTED = 8 +pkg syscall (windows-386), const XP1_MESSAGE_ORIENTED ideal-int +pkg syscall (windows-386), const XP1_MULTIPOINT_CONTROL_PLANE = 2048 +pkg syscall (windows-386), const XP1_MULTIPOINT_CONTROL_PLANE ideal-int +pkg syscall (windows-386), const XP1_MULTIPOINT_DATA_PLANE = 4096 +pkg syscall (windows-386), const XP1_MULTIPOINT_DATA_PLANE ideal-int +pkg syscall (windows-386), const XP1_PARTIAL_MESSAGE = 262144 +pkg syscall (windows-386), const XP1_PARTIAL_MESSAGE ideal-int +pkg syscall (windows-386), const XP1_PSEUDO_STREAM = 16 +pkg syscall (windows-386), const XP1_PSEUDO_STREAM ideal-int +pkg syscall (windows-386), const XP1_QOS_SUPPORTED = 8192 +pkg syscall (windows-386), const XP1_QOS_SUPPORTED ideal-int +pkg syscall (windows-386), const XP1_SAN_SUPPORT_SDP = 524288 +pkg syscall (windows-386), const XP1_SAN_SUPPORT_SDP ideal-int +pkg syscall (windows-386), const XP1_SUPPORT_BROADCAST = 512 +pkg syscall (windows-386), const XP1_SUPPORT_BROADCAST ideal-int +pkg syscall (windows-386), const XP1_SUPPORT_MULTIPOINT = 1024 +pkg syscall (windows-386), const XP1_SUPPORT_MULTIPOINT ideal-int +pkg syscall (windows-386), const XP1_UNI_RECV = 65536 +pkg syscall (windows-386), const XP1_UNI_RECV ideal-int +pkg syscall (windows-386), const XP1_UNI_SEND = 32768 +pkg syscall (windows-386), const XP1_UNI_SEND ideal-int +pkg syscall (windows-386), func LoadSetFileCompletionNotificationModes() error +pkg syscall (windows-386), func NetGetJoinInformation(*uint16, **uint16, *uint32) error +pkg syscall (windows-386), func SetFileCompletionNotificationModes(Handle, uint8) error +pkg syscall (windows-386), func WSAEnumProtocols(*int32, *WSAProtocolInfo, *uint32) (int32, error) +pkg syscall (windows-386), type IpMaskString struct, String [16]uint8 +pkg syscall (windows-386), type WSAProtocolChain struct +pkg syscall (windows-386), type WSAProtocolChain struct, ChainEntries [7]uint32 +pkg syscall (windows-386), type WSAProtocolChain struct, ChainLen int32 +pkg syscall (windows-386), type WSAProtocolInfo struct +pkg syscall (windows-386), type WSAProtocolInfo struct, AddressFamily int32 +pkg syscall (windows-386), type WSAProtocolInfo struct, CatalogEntryId uint32 +pkg syscall (windows-386), type WSAProtocolInfo struct, MaxSockAddr int32 +pkg syscall (windows-386), type WSAProtocolInfo struct, MessageSize uint32 +pkg syscall (windows-386), type WSAProtocolInfo struct, MinSockAddr int32 +pkg syscall (windows-386), type WSAProtocolInfo struct, NetworkByteOrder int32 +pkg syscall (windows-386), type WSAProtocolInfo struct, Protocol int32 +pkg syscall (windows-386), type WSAProtocolInfo struct, ProtocolChain WSAProtocolChain +pkg syscall (windows-386), type WSAProtocolInfo struct, ProtocolMaxOffset int32 +pkg syscall (windows-386), type WSAProtocolInfo struct, ProtocolName [256]uint16 +pkg syscall (windows-386), type WSAProtocolInfo struct, ProviderFlags uint32 +pkg syscall (windows-386), type WSAProtocolInfo struct, ProviderId GUID +pkg syscall (windows-386), type WSAProtocolInfo struct, ProviderReserved uint32 +pkg syscall (windows-386), type WSAProtocolInfo struct, SecurityScheme int32 +pkg syscall (windows-386), type WSAProtocolInfo struct, ServiceFlags1 uint32 +pkg syscall (windows-386), type WSAProtocolInfo struct, ServiceFlags2 uint32 +pkg syscall (windows-386), type WSAProtocolInfo struct, ServiceFlags3 uint32 +pkg syscall (windows-386), type WSAProtocolInfo struct, ServiceFlags4 uint32 +pkg syscall (windows-386), type WSAProtocolInfo struct, SocketType int32 +pkg syscall (windows-386), type WSAProtocolInfo struct, Version int32 +pkg syscall (windows-amd64), const BASE_PROTOCOL = 1 +pkg syscall (windows-amd64), const BASE_PROTOCOL ideal-int +pkg syscall (windows-amd64), const ERROR_HANDLE_EOF = 38 +pkg syscall (windows-amd64), const ERROR_HANDLE_EOF Errno +pkg syscall (windows-amd64), const FILE_SKIP_COMPLETION_PORT_ON_SUCCESS = 1 +pkg syscall (windows-amd64), const FILE_SKIP_COMPLETION_PORT_ON_SUCCESS ideal-int +pkg syscall (windows-amd64), const FILE_SKIP_SET_EVENT_ON_HANDLE = 2 +pkg syscall (windows-amd64), const FILE_SKIP_SET_EVENT_ON_HANDLE ideal-int +pkg syscall (windows-amd64), const LAYERED_PROTOCOL = 0 +pkg syscall (windows-amd64), const LAYERED_PROTOCOL ideal-int +pkg syscall (windows-amd64), const MAX_PROTOCOL_CHAIN = 7 +pkg syscall (windows-amd64), const MAX_PROTOCOL_CHAIN ideal-int +pkg syscall (windows-amd64), const NetSetupDomainName = 3 +pkg syscall (windows-amd64), const NetSetupDomainName ideal-int +pkg syscall (windows-amd64), const NetSetupUnjoined = 1 +pkg syscall (windows-amd64), const NetSetupUnjoined ideal-int +pkg syscall (windows-amd64), const NetSetupUnknownStatus = 0 +pkg syscall (windows-amd64), const NetSetupUnknownStatus ideal-int +pkg syscall (windows-amd64), const NetSetupWorkgroupName = 2 +pkg syscall (windows-amd64), const NetSetupWorkgroupName ideal-int +pkg syscall (windows-amd64), const PFL_HIDDEN = 4 +pkg syscall (windows-amd64), const PFL_HIDDEN ideal-int +pkg syscall (windows-amd64), const PFL_MATCHES_PROTOCOL_ZERO = 8 +pkg syscall (windows-amd64), const PFL_MATCHES_PROTOCOL_ZERO ideal-int +pkg syscall (windows-amd64), const PFL_MULTIPLE_PROTO_ENTRIES = 1 +pkg syscall (windows-amd64), const PFL_MULTIPLE_PROTO_ENTRIES ideal-int +pkg syscall (windows-amd64), const PFL_NETWORKDIRECT_PROVIDER = 16 +pkg syscall (windows-amd64), const PFL_NETWORKDIRECT_PROVIDER ideal-int +pkg syscall (windows-amd64), const PFL_RECOMMENDED_PROTO_ENTRY = 2 +pkg syscall (windows-amd64), const PFL_RECOMMENDED_PROTO_ENTRY ideal-int +pkg syscall (windows-amd64), const PROCESS_TERMINATE = 1 +pkg syscall (windows-amd64), const PROCESS_TERMINATE ideal-int +pkg syscall (windows-amd64), const WSAEACCES = 10013 +pkg syscall (windows-amd64), const WSAEACCES Errno +pkg syscall (windows-amd64), const WSAPROTOCOL_LEN = 255 +pkg syscall (windows-amd64), const WSAPROTOCOL_LEN ideal-int +pkg syscall (windows-amd64), const XP1_CONNECTIONLESS = 1 +pkg syscall (windows-amd64), const XP1_CONNECTIONLESS ideal-int +pkg syscall (windows-amd64), const XP1_CONNECT_DATA = 128 +pkg syscall (windows-amd64), const XP1_CONNECT_DATA ideal-int +pkg syscall (windows-amd64), const XP1_DISCONNECT_DATA = 256 +pkg syscall (windows-amd64), const XP1_DISCONNECT_DATA ideal-int +pkg syscall (windows-amd64), const XP1_EXPEDITED_DATA = 64 +pkg syscall (windows-amd64), const XP1_EXPEDITED_DATA ideal-int +pkg syscall (windows-amd64), const XP1_GRACEFUL_CLOSE = 32 +pkg syscall (windows-amd64), const XP1_GRACEFUL_CLOSE ideal-int +pkg syscall (windows-amd64), const XP1_GUARANTEED_DELIVERY = 2 +pkg syscall (windows-amd64), const XP1_GUARANTEED_DELIVERY ideal-int +pkg syscall (windows-amd64), const XP1_GUARANTEED_ORDER = 4 +pkg syscall (windows-amd64), const XP1_GUARANTEED_ORDER ideal-int +pkg syscall (windows-amd64), const XP1_IFS_HANDLES = 131072 +pkg syscall (windows-amd64), const XP1_IFS_HANDLES ideal-int +pkg syscall (windows-amd64), const XP1_MESSAGE_ORIENTED = 8 +pkg syscall (windows-amd64), const XP1_MESSAGE_ORIENTED ideal-int +pkg syscall (windows-amd64), const XP1_MULTIPOINT_CONTROL_PLANE = 2048 +pkg syscall (windows-amd64), const XP1_MULTIPOINT_CONTROL_PLANE ideal-int +pkg syscall (windows-amd64), const XP1_MULTIPOINT_DATA_PLANE = 4096 +pkg syscall (windows-amd64), const XP1_MULTIPOINT_DATA_PLANE ideal-int +pkg syscall (windows-amd64), const XP1_PARTIAL_MESSAGE = 262144 +pkg syscall (windows-amd64), const XP1_PARTIAL_MESSAGE ideal-int +pkg syscall (windows-amd64), const XP1_PSEUDO_STREAM = 16 +pkg syscall (windows-amd64), const XP1_PSEUDO_STREAM ideal-int +pkg syscall (windows-amd64), const XP1_QOS_SUPPORTED = 8192 +pkg syscall (windows-amd64), const XP1_QOS_SUPPORTED ideal-int +pkg syscall (windows-amd64), const XP1_SAN_SUPPORT_SDP = 524288 +pkg syscall (windows-amd64), const XP1_SAN_SUPPORT_SDP ideal-int +pkg syscall (windows-amd64), const XP1_SUPPORT_BROADCAST = 512 +pkg syscall (windows-amd64), const XP1_SUPPORT_BROADCAST ideal-int +pkg syscall (windows-amd64), const XP1_SUPPORT_MULTIPOINT = 1024 +pkg syscall (windows-amd64), const XP1_SUPPORT_MULTIPOINT ideal-int +pkg syscall (windows-amd64), const XP1_UNI_RECV = 65536 +pkg syscall (windows-amd64), const XP1_UNI_RECV ideal-int +pkg syscall (windows-amd64), const XP1_UNI_SEND = 32768 +pkg syscall (windows-amd64), const XP1_UNI_SEND ideal-int +pkg syscall (windows-amd64), func LoadSetFileCompletionNotificationModes() error +pkg syscall (windows-amd64), func NetGetJoinInformation(*uint16, **uint16, *uint32) error +pkg syscall (windows-amd64), func SetFileCompletionNotificationModes(Handle, uint8) error +pkg syscall (windows-amd64), func WSAEnumProtocols(*int32, *WSAProtocolInfo, *uint32) (int32, error) +pkg syscall (windows-amd64), type IpMaskString struct, String [16]uint8 +pkg syscall (windows-amd64), type WSAProtocolChain struct +pkg syscall (windows-amd64), type WSAProtocolChain struct, ChainEntries [7]uint32 +pkg syscall (windows-amd64), type WSAProtocolChain struct, ChainLen int32 +pkg syscall (windows-amd64), type WSAProtocolInfo struct +pkg syscall (windows-amd64), type WSAProtocolInfo struct, AddressFamily int32 +pkg syscall (windows-amd64), type WSAProtocolInfo struct, CatalogEntryId uint32 +pkg syscall (windows-amd64), type WSAProtocolInfo struct, MaxSockAddr int32 +pkg syscall (windows-amd64), type WSAProtocolInfo struct, MessageSize uint32 +pkg syscall (windows-amd64), type WSAProtocolInfo struct, MinSockAddr int32 +pkg syscall (windows-amd64), type WSAProtocolInfo struct, NetworkByteOrder int32 +pkg syscall (windows-amd64), type WSAProtocolInfo struct, Protocol int32 +pkg syscall (windows-amd64), type WSAProtocolInfo struct, ProtocolChain WSAProtocolChain +pkg syscall (windows-amd64), type WSAProtocolInfo struct, ProtocolMaxOffset int32 +pkg syscall (windows-amd64), type WSAProtocolInfo struct, ProtocolName [256]uint16 +pkg syscall (windows-amd64), type WSAProtocolInfo struct, ProviderFlags uint32 +pkg syscall (windows-amd64), type WSAProtocolInfo struct, ProviderId GUID +pkg syscall (windows-amd64), type WSAProtocolInfo struct, ProviderReserved uint32 +pkg syscall (windows-amd64), type WSAProtocolInfo struct, SecurityScheme int32 +pkg syscall (windows-amd64), type WSAProtocolInfo struct, ServiceFlags1 uint32 +pkg syscall (windows-amd64), type WSAProtocolInfo struct, ServiceFlags2 uint32 +pkg syscall (windows-amd64), type WSAProtocolInfo struct, ServiceFlags3 uint32 +pkg syscall (windows-amd64), type WSAProtocolInfo struct, ServiceFlags4 uint32 +pkg syscall (windows-amd64), type WSAProtocolInfo struct, SocketType int32 +pkg syscall (windows-amd64), type WSAProtocolInfo struct, Version int32 +pkg testing, func RegisterCover(Cover) +pkg testing, type Cover struct +pkg testing, type Cover struct, Blocks map[string][]CoverBlock +pkg testing, type Cover struct, Counters map[string][]uint32 +pkg testing, type Cover struct, CoveredPackages string +pkg testing, type Cover struct, Mode string +pkg testing, type CoverBlock struct +pkg testing, type CoverBlock struct, Col0 uint16 +pkg testing, type CoverBlock struct, Col1 uint16 +pkg testing, type CoverBlock struct, Line0 uint32 +pkg testing, type CoverBlock struct, Line1 uint32 +pkg testing, type CoverBlock struct, Stmts uint16 +pkg testing, type TB interface, Error(...interface{}) +pkg testing, type TB interface, Errorf(string, ...interface{}) +pkg testing, type TB interface, Fail() +pkg testing, type TB interface, FailNow() +pkg testing, type TB interface, Failed() bool +pkg testing, type TB interface, Fatal(...interface{}) +pkg testing, type TB interface, Fatalf(string, ...interface{}) +pkg testing, type TB interface, Log(...interface{}) +pkg testing, type TB interface, Logf(string, ...interface{}) +pkg testing, type TB interface, Skip(...interface{}) +pkg testing, type TB interface, SkipNow() +pkg testing, type TB interface, Skipf(string, ...interface{}) +pkg testing, type TB interface, Skipped() bool +pkg testing, type TB interface, unexported methods +pkg text/template, method (Template) Copy() *parse.Tree +pkg text/template/parse, method (*Tree) Copy() *Tree +pkg time, method (*Time) UnmarshalBinary([]uint8) error +pkg time, method (*Time) UnmarshalText([]uint8) error +pkg time, method (Time) MarshalBinary() ([]uint8, error) +pkg time, method (Time) MarshalText() ([]uint8, error) +pkg unicode, func In(int32, ...*RangeTable) bool diff --git a/api/go1.3.txt b/api/go1.3.txt new file mode 100644 index 0000000000000000000000000000000000000000..0474277c495d637354696790f16b79c8b14fe537 --- /dev/null +++ b/api/go1.3.txt @@ -0,0 +1,2053 @@ +pkg archive/tar, const TypeGNUSparse = 83 +pkg archive/tar, const TypeGNUSparse ideal-char +pkg archive/tar, type Header struct, Xattrs map[string]string +pkg compress/gzip, method (*Reader) Reset(io.Reader) error +pkg crypto/tls, const CurveP256 = 23 +pkg crypto/tls, const CurveP256 CurveID +pkg crypto/tls, const CurveP384 = 24 +pkg crypto/tls, const CurveP384 CurveID +pkg crypto/tls, const CurveP521 = 25 +pkg crypto/tls, const CurveP521 CurveID +pkg crypto/tls, func DialWithDialer(*net.Dialer, string, string, *Config) (*Conn, error) +pkg crypto/tls, func NewLRUClientSessionCache(int) ClientSessionCache +pkg crypto/tls, type ClientSessionCache interface { Get, Put } +pkg crypto/tls, type ClientSessionCache interface, Get(string) (*ClientSessionState, bool) +pkg crypto/tls, type ClientSessionCache interface, Put(string, *ClientSessionState) +pkg crypto/tls, type ClientSessionState struct +pkg crypto/tls, type Config struct, ClientSessionCache ClientSessionCache +pkg crypto/tls, type Config struct, CurvePreferences []CurveID +pkg crypto/tls, type ConnectionState struct, Version uint16 +pkg crypto/tls, type CurveID uint16 +pkg crypto/x509, func CreateCertificateRequest(io.Reader, *CertificateRequest, interface{}) ([]uint8, error) +pkg crypto/x509, func ParseCertificateRequest([]uint8) (*CertificateRequest, error) +pkg crypto/x509, type CertificateRequest struct +pkg crypto/x509, type CertificateRequest struct, Attributes []pkix.AttributeTypeAndValueSET +pkg crypto/x509, type CertificateRequest struct, DNSNames []string +pkg crypto/x509, type CertificateRequest struct, EmailAddresses []string +pkg crypto/x509, type CertificateRequest struct, Extensions []pkix.Extension +pkg crypto/x509, type CertificateRequest struct, ExtraExtensions []pkix.Extension +pkg crypto/x509, type CertificateRequest struct, IPAddresses []net.IP +pkg crypto/x509, type CertificateRequest struct, PublicKey interface{} +pkg crypto/x509, type CertificateRequest struct, PublicKeyAlgorithm PublicKeyAlgorithm +pkg crypto/x509, type CertificateRequest struct, Raw []uint8 +pkg crypto/x509, type CertificateRequest struct, RawSubject []uint8 +pkg crypto/x509, type CertificateRequest struct, RawSubjectPublicKeyInfo []uint8 +pkg crypto/x509, type CertificateRequest struct, RawTBSCertificateRequest []uint8 +pkg crypto/x509, type CertificateRequest struct, Signature []uint8 +pkg crypto/x509, type CertificateRequest struct, SignatureAlgorithm SignatureAlgorithm +pkg crypto/x509, type CertificateRequest struct, Subject pkix.Name +pkg crypto/x509, type CertificateRequest struct, Version int +pkg crypto/x509/pkix, type AttributeTypeAndValueSET struct +pkg crypto/x509/pkix, type AttributeTypeAndValueSET struct, Type asn1.ObjectIdentifier +pkg crypto/x509/pkix, type AttributeTypeAndValueSET struct, Value [][]AttributeTypeAndValue +pkg debug/dwarf, const TagCondition = 63 +pkg debug/dwarf, const TagCondition Tag +pkg debug/dwarf, const TagRvalueReferenceType = 66 +pkg debug/dwarf, const TagRvalueReferenceType Tag +pkg debug/dwarf, const TagSharedType = 64 +pkg debug/dwarf, const TagSharedType Tag +pkg debug/dwarf, const TagTemplateAlias = 67 +pkg debug/dwarf, const TagTemplateAlias Tag +pkg debug/dwarf, const TagTypeUnit = 65 +pkg debug/dwarf, const TagTypeUnit Tag +pkg debug/dwarf, method (*Data) AddTypes(string, []uint8) error +pkg debug/macho, const CpuArm = 12 +pkg debug/macho, const CpuArm Cpu +pkg debug/macho, const CpuPpc = 18 +pkg debug/macho, const CpuPpc Cpu +pkg debug/macho, const CpuPpc64 = 16777234 +pkg debug/macho, const CpuPpc64 Cpu +pkg debug/macho, const MagicFat = 3405691582 +pkg debug/macho, const MagicFat uint32 +pkg debug/macho, const TypeBundle = 8 +pkg debug/macho, const TypeBundle Type +pkg debug/macho, const TypeDylib = 6 +pkg debug/macho, const TypeDylib Type +pkg debug/macho, func NewFatFile(io.ReaderAt) (*FatFile, error) +pkg debug/macho, func OpenFat(string) (*FatFile, error) +pkg debug/macho, method (*FatFile) Close() error +pkg debug/macho, method (FatArch) Close() error +pkg debug/macho, method (FatArch) DWARF() (*dwarf.Data, error) +pkg debug/macho, method (FatArch) ImportedLibraries() ([]string, error) +pkg debug/macho, method (FatArch) ImportedSymbols() ([]string, error) +pkg debug/macho, method (FatArch) Section(string) *Section +pkg debug/macho, method (FatArch) Segment(string) *Segment +pkg debug/macho, type FatArch struct +pkg debug/macho, type FatArch struct, embedded *File +pkg debug/macho, type FatArch struct, embedded FatArchHeader +pkg debug/macho, type FatArchHeader struct +pkg debug/macho, type FatArchHeader struct, Align uint32 +pkg debug/macho, type FatArchHeader struct, Cpu Cpu +pkg debug/macho, type FatArchHeader struct, Offset uint32 +pkg debug/macho, type FatArchHeader struct, Size uint32 +pkg debug/macho, type FatArchHeader struct, SubCpu uint32 +pkg debug/macho, type FatFile struct +pkg debug/macho, type FatFile struct, Arches []FatArch +pkg debug/macho, type FatFile struct, Magic uint32 +pkg debug/macho, var ErrNotFat *FormatError +pkg debug/pe, type DataDirectory struct +pkg debug/pe, type DataDirectory struct, Size uint32 +pkg debug/pe, type DataDirectory struct, VirtualAddress uint32 +pkg debug/pe, type File struct, OptionalHeader interface{} +pkg debug/pe, type OptionalHeader32 struct +pkg debug/pe, type OptionalHeader32 struct, AddressOfEntryPoint uint32 +pkg debug/pe, type OptionalHeader32 struct, BaseOfCode uint32 +pkg debug/pe, type OptionalHeader32 struct, BaseOfData uint32 +pkg debug/pe, type OptionalHeader32 struct, CheckSum uint32 +pkg debug/pe, type OptionalHeader32 struct, DataDirectory [16]DataDirectory +pkg debug/pe, type OptionalHeader32 struct, DllCharacteristics uint16 +pkg debug/pe, type OptionalHeader32 struct, FileAlignment uint32 +pkg debug/pe, type OptionalHeader32 struct, ImageBase uint32 +pkg debug/pe, type OptionalHeader32 struct, LoaderFlags uint32 +pkg debug/pe, type OptionalHeader32 struct, Magic uint16 +pkg debug/pe, type OptionalHeader32 struct, MajorImageVersion uint16 +pkg debug/pe, type OptionalHeader32 struct, MajorLinkerVersion uint8 +pkg debug/pe, type OptionalHeader32 struct, MajorOperatingSystemVersion uint16 +pkg debug/pe, type OptionalHeader32 struct, MajorSubsystemVersion uint16 +pkg debug/pe, type OptionalHeader32 struct, MinorImageVersion uint16 +pkg debug/pe, type OptionalHeader32 struct, MinorLinkerVersion uint8 +pkg debug/pe, type OptionalHeader32 struct, MinorOperatingSystemVersion uint16 +pkg debug/pe, type OptionalHeader32 struct, MinorSubsystemVersion uint16 +pkg debug/pe, type OptionalHeader32 struct, NumberOfRvaAndSizes uint32 +pkg debug/pe, type OptionalHeader32 struct, SectionAlignment uint32 +pkg debug/pe, type OptionalHeader32 struct, SizeOfCode uint32 +pkg debug/pe, type OptionalHeader32 struct, SizeOfHeaders uint32 +pkg debug/pe, type OptionalHeader32 struct, SizeOfHeapCommit uint32 +pkg debug/pe, type OptionalHeader32 struct, SizeOfHeapReserve uint32 +pkg debug/pe, type OptionalHeader32 struct, SizeOfImage uint32 +pkg debug/pe, type OptionalHeader32 struct, SizeOfInitializedData uint32 +pkg debug/pe, type OptionalHeader32 struct, SizeOfStackCommit uint32 +pkg debug/pe, type OptionalHeader32 struct, SizeOfStackReserve uint32 +pkg debug/pe, type OptionalHeader32 struct, SizeOfUninitializedData uint32 +pkg debug/pe, type OptionalHeader32 struct, Subsystem uint16 +pkg debug/pe, type OptionalHeader32 struct, Win32VersionValue uint32 +pkg debug/pe, type OptionalHeader64 struct +pkg debug/pe, type OptionalHeader64 struct, AddressOfEntryPoint uint32 +pkg debug/pe, type OptionalHeader64 struct, BaseOfCode uint32 +pkg debug/pe, type OptionalHeader64 struct, CheckSum uint32 +pkg debug/pe, type OptionalHeader64 struct, DataDirectory [16]DataDirectory +pkg debug/pe, type OptionalHeader64 struct, DllCharacteristics uint16 +pkg debug/pe, type OptionalHeader64 struct, FileAlignment uint32 +pkg debug/pe, type OptionalHeader64 struct, ImageBase uint64 +pkg debug/pe, type OptionalHeader64 struct, LoaderFlags uint32 +pkg debug/pe, type OptionalHeader64 struct, Magic uint16 +pkg debug/pe, type OptionalHeader64 struct, MajorImageVersion uint16 +pkg debug/pe, type OptionalHeader64 struct, MajorLinkerVersion uint8 +pkg debug/pe, type OptionalHeader64 struct, MajorOperatingSystemVersion uint16 +pkg debug/pe, type OptionalHeader64 struct, MajorSubsystemVersion uint16 +pkg debug/pe, type OptionalHeader64 struct, MinorImageVersion uint16 +pkg debug/pe, type OptionalHeader64 struct, MinorLinkerVersion uint8 +pkg debug/pe, type OptionalHeader64 struct, MinorOperatingSystemVersion uint16 +pkg debug/pe, type OptionalHeader64 struct, MinorSubsystemVersion uint16 +pkg debug/pe, type OptionalHeader64 struct, NumberOfRvaAndSizes uint32 +pkg debug/pe, type OptionalHeader64 struct, SectionAlignment uint32 +pkg debug/pe, type OptionalHeader64 struct, SizeOfCode uint32 +pkg debug/pe, type OptionalHeader64 struct, SizeOfHeaders uint32 +pkg debug/pe, type OptionalHeader64 struct, SizeOfHeapCommit uint64 +pkg debug/pe, type OptionalHeader64 struct, SizeOfHeapReserve uint64 +pkg debug/pe, type OptionalHeader64 struct, SizeOfImage uint32 +pkg debug/pe, type OptionalHeader64 struct, SizeOfInitializedData uint32 +pkg debug/pe, type OptionalHeader64 struct, SizeOfStackCommit uint64 +pkg debug/pe, type OptionalHeader64 struct, SizeOfStackReserve uint64 +pkg debug/pe, type OptionalHeader64 struct, SizeOfUninitializedData uint32 +pkg debug/pe, type OptionalHeader64 struct, Subsystem uint16 +pkg debug/pe, type OptionalHeader64 struct, Win32VersionValue uint32 +pkg debug/plan9obj, const Magic386 = 491 +pkg debug/plan9obj, const Magic386 ideal-int +pkg debug/plan9obj, const Magic64 = 32768 +pkg debug/plan9obj, const Magic64 ideal-int +pkg debug/plan9obj, const MagicAMD64 = 35479 +pkg debug/plan9obj, const MagicAMD64 ideal-int +pkg debug/plan9obj, const MagicARM = 1607 +pkg debug/plan9obj, const MagicARM ideal-int +pkg debug/plan9obj, func NewFile(io.ReaderAt) (*File, error) +pkg debug/plan9obj, func Open(string) (*File, error) +pkg debug/plan9obj, method (*File) Close() error +pkg debug/plan9obj, method (*File) Section(string) *Section +pkg debug/plan9obj, method (*File) Symbols() ([]Sym, error) +pkg debug/plan9obj, method (*Section) Data() ([]uint8, error) +pkg debug/plan9obj, method (*Section) Open() io.ReadSeeker +pkg debug/plan9obj, method (Section) ReadAt([]uint8, int64) (int, error) +pkg debug/plan9obj, type File struct +pkg debug/plan9obj, type File struct, Sections []*Section +pkg debug/plan9obj, type File struct, embedded FileHeader +pkg debug/plan9obj, type FileHeader struct +pkg debug/plan9obj, type FileHeader struct, Bss uint32 +pkg debug/plan9obj, type FileHeader struct, Entry uint64 +pkg debug/plan9obj, type FileHeader struct, Magic uint32 +pkg debug/plan9obj, type FileHeader struct, PtrSize int +pkg debug/plan9obj, type Section struct +pkg debug/plan9obj, type Section struct, embedded SectionHeader +pkg debug/plan9obj, type Section struct, embedded io.ReaderAt +pkg debug/plan9obj, type SectionHeader struct +pkg debug/plan9obj, type SectionHeader struct, Name string +pkg debug/plan9obj, type SectionHeader struct, Offset uint32 +pkg debug/plan9obj, type SectionHeader struct, Size uint32 +pkg debug/plan9obj, type Sym struct +pkg debug/plan9obj, type Sym struct, Name string +pkg debug/plan9obj, type Sym struct, Type int32 +pkg debug/plan9obj, type Sym struct, Value uint64 +pkg encoding/asn1, method (ObjectIdentifier) String() string +pkg go/build, type Package struct, MFiles []string +pkg math/big, method (*Int) MarshalText() ([]uint8, error) +pkg math/big, method (*Int) UnmarshalText([]uint8) error +pkg math/big, method (*Rat) MarshalText() ([]uint8, error) +pkg math/big, method (*Rat) UnmarshalText([]uint8) error +pkg net, type Dialer struct, KeepAlive time.Duration +pkg net/http, const StateActive = 1 +pkg net/http, const StateActive ConnState +pkg net/http, const StateClosed = 4 +pkg net/http, const StateClosed ConnState +pkg net/http, const StateHijacked = 3 +pkg net/http, const StateHijacked ConnState +pkg net/http, const StateIdle = 2 +pkg net/http, const StateIdle ConnState +pkg net/http, const StateNew = 0 +pkg net/http, const StateNew ConnState +pkg net/http, method (*Server) SetKeepAlivesEnabled(bool) +pkg net/http, method (ConnState) String() string +pkg net/http, type Client struct, Timeout time.Duration +pkg net/http, type ConnState int +pkg net/http, type Response struct, TLS *tls.ConnectionState +pkg net/http, type Server struct, ConnState func(net.Conn, ConnState) +pkg net/http, type Server struct, ErrorLog *log.Logger +pkg net/http, type Transport struct, TLSHandshakeTimeout time.Duration +pkg regexp/syntax, method (*Inst) MatchRunePos(int32) int +pkg regexp/syntax, method (InstOp) String() string +pkg runtime/debug, func SetPanicOnFault(bool) bool +pkg runtime/debug, func WriteHeapDump(uintptr) +pkg sync, method (*Pool) Get() interface{} +pkg sync, method (*Pool) Put(interface{}) +pkg sync, type Pool struct +pkg sync, type Pool struct, New func() interface{} +pkg syscall (darwin-386), func FcntlFlock(uintptr, int, *Flock_t) error +pkg syscall (darwin-386), func Mlock([]uint8) error +pkg syscall (darwin-386), func Mlockall(int) error +pkg syscall (darwin-386), func Mprotect([]uint8, int) error +pkg syscall (darwin-386), func Munlock([]uint8) error +pkg syscall (darwin-386), func Munlockall() error +pkg syscall (darwin-386), func SendmsgN(int, []uint8, []uint8, Sockaddr, int) (int, error) +pkg syscall (darwin-386-cgo), func FcntlFlock(uintptr, int, *Flock_t) error +pkg syscall (darwin-386-cgo), func Mlock([]uint8) error +pkg syscall (darwin-386-cgo), func Mlockall(int) error +pkg syscall (darwin-386-cgo), func Mprotect([]uint8, int) error +pkg syscall (darwin-386-cgo), func Munlock([]uint8) error +pkg syscall (darwin-386-cgo), func Munlockall() error +pkg syscall (darwin-386-cgo), func SendmsgN(int, []uint8, []uint8, Sockaddr, int) (int, error) +pkg syscall (darwin-amd64), func FcntlFlock(uintptr, int, *Flock_t) error +pkg syscall (darwin-amd64), func Mlock([]uint8) error +pkg syscall (darwin-amd64), func Mlockall(int) error +pkg syscall (darwin-amd64), func Mprotect([]uint8, int) error +pkg syscall (darwin-amd64), func Munlock([]uint8) error +pkg syscall (darwin-amd64), func Munlockall() error +pkg syscall (darwin-amd64), func SendmsgN(int, []uint8, []uint8, Sockaddr, int) (int, error) +pkg syscall (darwin-amd64-cgo), func FcntlFlock(uintptr, int, *Flock_t) error +pkg syscall (darwin-amd64-cgo), func Mlock([]uint8) error +pkg syscall (darwin-amd64-cgo), func Mlockall(int) error +pkg syscall (darwin-amd64-cgo), func Mprotect([]uint8, int) error +pkg syscall (darwin-amd64-cgo), func Munlock([]uint8) error +pkg syscall (darwin-amd64-cgo), func Munlockall() error +pkg syscall (darwin-amd64-cgo), func SendmsgN(int, []uint8, []uint8, Sockaddr, int) (int, error) +pkg syscall (freebsd-386), const AF_INET6_SDP = 42 +pkg syscall (freebsd-386), const AF_INET6_SDP ideal-int +pkg syscall (freebsd-386), const AF_INET_SDP = 40 +pkg syscall (freebsd-386), const AF_INET_SDP ideal-int +pkg syscall (freebsd-386), const AF_MAX = 42 +pkg syscall (freebsd-386), const DLT_MATCHING_MAX = 246 +pkg syscall (freebsd-386), const DLT_MPEG_2_TS = 243 +pkg syscall (freebsd-386), const DLT_MPEG_2_TS ideal-int +pkg syscall (freebsd-386), const DLT_NFC_LLCP = 245 +pkg syscall (freebsd-386), const DLT_NFC_LLCP ideal-int +pkg syscall (freebsd-386), const DLT_NG40 = 244 +pkg syscall (freebsd-386), const DLT_NG40 ideal-int +pkg syscall (freebsd-386), const ELAST = 96 +pkg syscall (freebsd-386), const ENOTRECOVERABLE = 95 +pkg syscall (freebsd-386), const ENOTRECOVERABLE Errno +pkg syscall (freebsd-386), const EOWNERDEAD = 96 +pkg syscall (freebsd-386), const EOWNERDEAD Errno +pkg syscall (freebsd-386), const EV_DROP = 4096 +pkg syscall (freebsd-386), const EV_DROP ideal-int +pkg syscall (freebsd-386), const IPPROTO_MPLS = 137 +pkg syscall (freebsd-386), const IPPROTO_MPLS ideal-int +pkg syscall (freebsd-386), const MAP_ALIGNED_SUPER = 16777216 +pkg syscall (freebsd-386), const MAP_ALIGNED_SUPER ideal-int +pkg syscall (freebsd-386), const MAP_ALIGNMENT_MASK = -16777216 +pkg syscall (freebsd-386), const MAP_ALIGNMENT_MASK ideal-int +pkg syscall (freebsd-386), const MAP_ALIGNMENT_SHIFT = 24 +pkg syscall (freebsd-386), const MAP_ALIGNMENT_SHIFT ideal-int +pkg syscall (freebsd-386), const MSG_CMSG_CLOEXEC = 262144 +pkg syscall (freebsd-386), const MSG_CMSG_CLOEXEC ideal-int +pkg syscall (freebsd-386), const NAME_MAX = 255 +pkg syscall (freebsd-386), const NAME_MAX ideal-int +pkg syscall (freebsd-386), const O_CLOEXEC = 1048576 +pkg syscall (freebsd-386), const RTF_GWFLAG_COMPAT = 2147483648 +pkg syscall (freebsd-386), const RTF_GWFLAG_COMPAT ideal-int +pkg syscall (freebsd-386), const RT_NORTREF = 2 +pkg syscall (freebsd-386), const RT_NORTREF ideal-int +pkg syscall (freebsd-386), const SIGLIBRT = 33 +pkg syscall (freebsd-386), const SIGLIBRT Signal +pkg syscall (freebsd-386), const SOCK_CLOEXEC = 268435456 +pkg syscall (freebsd-386), const SOCK_CLOEXEC ideal-int +pkg syscall (freebsd-386), const SOCK_NONBLOCK = 536870912 +pkg syscall (freebsd-386), const SOCK_NONBLOCK ideal-int +pkg syscall (freebsd-386), const SO_VENDOR = 2147483648 +pkg syscall (freebsd-386), const SO_VENDOR ideal-int +pkg syscall (freebsd-386), const SYS_ACCEPT4 = 541 +pkg syscall (freebsd-386), const SYS_ACCEPT4 ideal-int +pkg syscall (freebsd-386), const SYS_BINDAT = 538 +pkg syscall (freebsd-386), const SYS_BINDAT ideal-int +pkg syscall (freebsd-386), const SYS_CHFLAGSAT = 540 +pkg syscall (freebsd-386), const SYS_CHFLAGSAT ideal-int +pkg syscall (freebsd-386), const SYS_CONNECTAT = 539 +pkg syscall (freebsd-386), const SYS_CONNECTAT ideal-int +pkg syscall (freebsd-386), const SYS_PIPE2 = 542 +pkg syscall (freebsd-386), const SYS_PIPE2 ideal-int +pkg syscall (freebsd-386), const SYS_PROCCTL = 544 +pkg syscall (freebsd-386), const SYS_PROCCTL ideal-int +pkg syscall (freebsd-386), const TCP_VENDOR = 2147483648 +pkg syscall (freebsd-386), const TCP_VENDOR ideal-int +pkg syscall (freebsd-386), const WEXITED = 16 +pkg syscall (freebsd-386), const WEXITED ideal-int +pkg syscall (freebsd-386), const WTRAPPED = 32 +pkg syscall (freebsd-386), const WTRAPPED ideal-int +pkg syscall (freebsd-386), func Accept4(int, int) (int, Sockaddr, error) +pkg syscall (freebsd-386), func FcntlFlock(uintptr, int, *Flock_t) error +pkg syscall (freebsd-386), func SendmsgN(int, []uint8, []uint8, Sockaddr, int) (int, error) +pkg syscall (freebsd-386), type Termios struct +pkg syscall (freebsd-386), type Termios struct, Cc [20]uint8 +pkg syscall (freebsd-386), type Termios struct, Cflag uint32 +pkg syscall (freebsd-386), type Termios struct, Iflag uint32 +pkg syscall (freebsd-386), type Termios struct, Ispeed uint32 +pkg syscall (freebsd-386), type Termios struct, Lflag uint32 +pkg syscall (freebsd-386), type Termios struct, Oflag uint32 +pkg syscall (freebsd-386), type Termios struct, Ospeed uint32 +pkg syscall (freebsd-386-cgo), const AF_INET6_SDP = 42 +pkg syscall (freebsd-386-cgo), const AF_INET6_SDP ideal-int +pkg syscall (freebsd-386-cgo), const AF_INET_SDP = 40 +pkg syscall (freebsd-386-cgo), const AF_INET_SDP ideal-int +pkg syscall (freebsd-386-cgo), const AF_MAX = 42 +pkg syscall (freebsd-386-cgo), const DLT_MATCHING_MAX = 246 +pkg syscall (freebsd-386-cgo), const DLT_MPEG_2_TS = 243 +pkg syscall (freebsd-386-cgo), const DLT_MPEG_2_TS ideal-int +pkg syscall (freebsd-386-cgo), const DLT_NFC_LLCP = 245 +pkg syscall (freebsd-386-cgo), const DLT_NFC_LLCP ideal-int +pkg syscall (freebsd-386-cgo), const DLT_NG40 = 244 +pkg syscall (freebsd-386-cgo), const DLT_NG40 ideal-int +pkg syscall (freebsd-386-cgo), const ELAST = 96 +pkg syscall (freebsd-386-cgo), const ENOTRECOVERABLE = 95 +pkg syscall (freebsd-386-cgo), const ENOTRECOVERABLE Errno +pkg syscall (freebsd-386-cgo), const EOWNERDEAD = 96 +pkg syscall (freebsd-386-cgo), const EOWNERDEAD Errno +pkg syscall (freebsd-386-cgo), const EV_DROP = 4096 +pkg syscall (freebsd-386-cgo), const EV_DROP ideal-int +pkg syscall (freebsd-386-cgo), const IPPROTO_MPLS = 137 +pkg syscall (freebsd-386-cgo), const IPPROTO_MPLS ideal-int +pkg syscall (freebsd-386-cgo), const MAP_ALIGNED_SUPER = 16777216 +pkg syscall (freebsd-386-cgo), const MAP_ALIGNED_SUPER ideal-int +pkg syscall (freebsd-386-cgo), const MAP_ALIGNMENT_MASK = -16777216 +pkg syscall (freebsd-386-cgo), const MAP_ALIGNMENT_MASK ideal-int +pkg syscall (freebsd-386-cgo), const MAP_ALIGNMENT_SHIFT = 24 +pkg syscall (freebsd-386-cgo), const MAP_ALIGNMENT_SHIFT ideal-int +pkg syscall (freebsd-386-cgo), const MSG_CMSG_CLOEXEC = 262144 +pkg syscall (freebsd-386-cgo), const MSG_CMSG_CLOEXEC ideal-int +pkg syscall (freebsd-386-cgo), const NAME_MAX = 255 +pkg syscall (freebsd-386-cgo), const NAME_MAX ideal-int +pkg syscall (freebsd-386-cgo), const O_CLOEXEC = 1048576 +pkg syscall (freebsd-386-cgo), const RTF_GWFLAG_COMPAT = 2147483648 +pkg syscall (freebsd-386-cgo), const RTF_GWFLAG_COMPAT ideal-int +pkg syscall (freebsd-386-cgo), const RT_NORTREF = 2 +pkg syscall (freebsd-386-cgo), const RT_NORTREF ideal-int +pkg syscall (freebsd-386-cgo), const SIGLIBRT = 33 +pkg syscall (freebsd-386-cgo), const SIGLIBRT Signal +pkg syscall (freebsd-386-cgo), const SOCK_CLOEXEC = 268435456 +pkg syscall (freebsd-386-cgo), const SOCK_CLOEXEC ideal-int +pkg syscall (freebsd-386-cgo), const SOCK_NONBLOCK = 536870912 +pkg syscall (freebsd-386-cgo), const SOCK_NONBLOCK ideal-int +pkg syscall (freebsd-386-cgo), const SO_VENDOR = 2147483648 +pkg syscall (freebsd-386-cgo), const SO_VENDOR ideal-int +pkg syscall (freebsd-386-cgo), const SYS_ACCEPT4 = 541 +pkg syscall (freebsd-386-cgo), const SYS_ACCEPT4 ideal-int +pkg syscall (freebsd-386-cgo), const SYS_BINDAT = 538 +pkg syscall (freebsd-386-cgo), const SYS_BINDAT ideal-int +pkg syscall (freebsd-386-cgo), const SYS_CHFLAGSAT = 540 +pkg syscall (freebsd-386-cgo), const SYS_CHFLAGSAT ideal-int +pkg syscall (freebsd-386-cgo), const SYS_CONNECTAT = 539 +pkg syscall (freebsd-386-cgo), const SYS_CONNECTAT ideal-int +pkg syscall (freebsd-386-cgo), const SYS_PIPE2 = 542 +pkg syscall (freebsd-386-cgo), const SYS_PIPE2 ideal-int +pkg syscall (freebsd-386-cgo), const SYS_PROCCTL = 544 +pkg syscall (freebsd-386-cgo), const SYS_PROCCTL ideal-int +pkg syscall (freebsd-386-cgo), const TCP_VENDOR = 2147483648 +pkg syscall (freebsd-386-cgo), const TCP_VENDOR ideal-int +pkg syscall (freebsd-386-cgo), const WEXITED = 16 +pkg syscall (freebsd-386-cgo), const WEXITED ideal-int +pkg syscall (freebsd-386-cgo), const WTRAPPED = 32 +pkg syscall (freebsd-386-cgo), const WTRAPPED ideal-int +pkg syscall (freebsd-386-cgo), func Accept4(int, int) (int, Sockaddr, error) +pkg syscall (freebsd-386-cgo), func FcntlFlock(uintptr, int, *Flock_t) error +pkg syscall (freebsd-386-cgo), func SendmsgN(int, []uint8, []uint8, Sockaddr, int) (int, error) +pkg syscall (freebsd-386-cgo), type Termios struct +pkg syscall (freebsd-386-cgo), type Termios struct, Cc [20]uint8 +pkg syscall (freebsd-386-cgo), type Termios struct, Cflag uint32 +pkg syscall (freebsd-386-cgo), type Termios struct, Iflag uint32 +pkg syscall (freebsd-386-cgo), type Termios struct, Ispeed uint32 +pkg syscall (freebsd-386-cgo), type Termios struct, Lflag uint32 +pkg syscall (freebsd-386-cgo), type Termios struct, Oflag uint32 +pkg syscall (freebsd-386-cgo), type Termios struct, Ospeed uint32 +pkg syscall (freebsd-amd64), const AF_INET6_SDP = 42 +pkg syscall (freebsd-amd64), const AF_INET6_SDP ideal-int +pkg syscall (freebsd-amd64), const AF_INET_SDP = 40 +pkg syscall (freebsd-amd64), const AF_INET_SDP ideal-int +pkg syscall (freebsd-amd64), const AF_MAX = 42 +pkg syscall (freebsd-amd64), const DLT_MATCHING_MAX = 246 +pkg syscall (freebsd-amd64), const DLT_MPEG_2_TS = 243 +pkg syscall (freebsd-amd64), const DLT_MPEG_2_TS ideal-int +pkg syscall (freebsd-amd64), const DLT_NFC_LLCP = 245 +pkg syscall (freebsd-amd64), const DLT_NFC_LLCP ideal-int +pkg syscall (freebsd-amd64), const DLT_NG40 = 244 +pkg syscall (freebsd-amd64), const DLT_NG40 ideal-int +pkg syscall (freebsd-amd64), const ELAST = 96 +pkg syscall (freebsd-amd64), const ENOTRECOVERABLE = 95 +pkg syscall (freebsd-amd64), const ENOTRECOVERABLE Errno +pkg syscall (freebsd-amd64), const EOWNERDEAD = 96 +pkg syscall (freebsd-amd64), const EOWNERDEAD Errno +pkg syscall (freebsd-amd64), const EV_DROP = 4096 +pkg syscall (freebsd-amd64), const EV_DROP ideal-int +pkg syscall (freebsd-amd64), const IPPROTO_MPLS = 137 +pkg syscall (freebsd-amd64), const IPPROTO_MPLS ideal-int +pkg syscall (freebsd-amd64), const MAP_32BIT = 524288 +pkg syscall (freebsd-amd64), const MAP_32BIT ideal-int +pkg syscall (freebsd-amd64), const MAP_ALIGNED_SUPER = 16777216 +pkg syscall (freebsd-amd64), const MAP_ALIGNED_SUPER ideal-int +pkg syscall (freebsd-amd64), const MAP_ALIGNMENT_MASK = -16777216 +pkg syscall (freebsd-amd64), const MAP_ALIGNMENT_MASK ideal-int +pkg syscall (freebsd-amd64), const MAP_ALIGNMENT_SHIFT = 24 +pkg syscall (freebsd-amd64), const MAP_ALIGNMENT_SHIFT ideal-int +pkg syscall (freebsd-amd64), const MSG_CMSG_CLOEXEC = 262144 +pkg syscall (freebsd-amd64), const MSG_CMSG_CLOEXEC ideal-int +pkg syscall (freebsd-amd64), const NAME_MAX = 255 +pkg syscall (freebsd-amd64), const NAME_MAX ideal-int +pkg syscall (freebsd-amd64), const O_CLOEXEC = 1048576 +pkg syscall (freebsd-amd64), const RTF_GWFLAG_COMPAT = 2147483648 +pkg syscall (freebsd-amd64), const RTF_GWFLAG_COMPAT ideal-int +pkg syscall (freebsd-amd64), const RT_NORTREF = 2 +pkg syscall (freebsd-amd64), const RT_NORTREF ideal-int +pkg syscall (freebsd-amd64), const SIGLIBRT = 33 +pkg syscall (freebsd-amd64), const SIGLIBRT Signal +pkg syscall (freebsd-amd64), const SOCK_CLOEXEC = 268435456 +pkg syscall (freebsd-amd64), const SOCK_CLOEXEC ideal-int +pkg syscall (freebsd-amd64), const SOCK_NONBLOCK = 536870912 +pkg syscall (freebsd-amd64), const SOCK_NONBLOCK ideal-int +pkg syscall (freebsd-amd64), const SO_VENDOR = 2147483648 +pkg syscall (freebsd-amd64), const SO_VENDOR ideal-int +pkg syscall (freebsd-amd64), const SYS_ACCEPT4 = 541 +pkg syscall (freebsd-amd64), const SYS_ACCEPT4 ideal-int +pkg syscall (freebsd-amd64), const SYS_BINDAT = 538 +pkg syscall (freebsd-amd64), const SYS_BINDAT ideal-int +pkg syscall (freebsd-amd64), const SYS_CHFLAGSAT = 540 +pkg syscall (freebsd-amd64), const SYS_CHFLAGSAT ideal-int +pkg syscall (freebsd-amd64), const SYS_CONNECTAT = 539 +pkg syscall (freebsd-amd64), const SYS_CONNECTAT ideal-int +pkg syscall (freebsd-amd64), const SYS_PIPE2 = 542 +pkg syscall (freebsd-amd64), const SYS_PIPE2 ideal-int +pkg syscall (freebsd-amd64), const SYS_PROCCTL = 544 +pkg syscall (freebsd-amd64), const SYS_PROCCTL ideal-int +pkg syscall (freebsd-amd64), const TCP_VENDOR = 2147483648 +pkg syscall (freebsd-amd64), const TCP_VENDOR ideal-int +pkg syscall (freebsd-amd64), const WEXITED = 16 +pkg syscall (freebsd-amd64), const WEXITED ideal-int +pkg syscall (freebsd-amd64), const WTRAPPED = 32 +pkg syscall (freebsd-amd64), const WTRAPPED ideal-int +pkg syscall (freebsd-amd64), func Accept4(int, int) (int, Sockaddr, error) +pkg syscall (freebsd-amd64), func FcntlFlock(uintptr, int, *Flock_t) error +pkg syscall (freebsd-amd64), func SendmsgN(int, []uint8, []uint8, Sockaddr, int) (int, error) +pkg syscall (freebsd-amd64), type Termios struct +pkg syscall (freebsd-amd64), type Termios struct, Cc [20]uint8 +pkg syscall (freebsd-amd64), type Termios struct, Cflag uint32 +pkg syscall (freebsd-amd64), type Termios struct, Iflag uint32 +pkg syscall (freebsd-amd64), type Termios struct, Ispeed uint32 +pkg syscall (freebsd-amd64), type Termios struct, Lflag uint32 +pkg syscall (freebsd-amd64), type Termios struct, Oflag uint32 +pkg syscall (freebsd-amd64), type Termios struct, Ospeed uint32 +pkg syscall (freebsd-amd64-cgo), const AF_INET6_SDP = 42 +pkg syscall (freebsd-amd64-cgo), const AF_INET6_SDP ideal-int +pkg syscall (freebsd-amd64-cgo), const AF_INET_SDP = 40 +pkg syscall (freebsd-amd64-cgo), const AF_INET_SDP ideal-int +pkg syscall (freebsd-amd64-cgo), const AF_MAX = 42 +pkg syscall (freebsd-amd64-cgo), const DLT_MATCHING_MAX = 246 +pkg syscall (freebsd-amd64-cgo), const DLT_MPEG_2_TS = 243 +pkg syscall (freebsd-amd64-cgo), const DLT_MPEG_2_TS ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_NFC_LLCP = 245 +pkg syscall (freebsd-amd64-cgo), const DLT_NFC_LLCP ideal-int +pkg syscall (freebsd-amd64-cgo), const DLT_NG40 = 244 +pkg syscall (freebsd-amd64-cgo), const DLT_NG40 ideal-int +pkg syscall (freebsd-amd64-cgo), const ELAST = 96 +pkg syscall (freebsd-amd64-cgo), const ENOTRECOVERABLE = 95 +pkg syscall (freebsd-amd64-cgo), const ENOTRECOVERABLE Errno +pkg syscall (freebsd-amd64-cgo), const EOWNERDEAD = 96 +pkg syscall (freebsd-amd64-cgo), const EOWNERDEAD Errno +pkg syscall (freebsd-amd64-cgo), const EV_DROP = 4096 +pkg syscall (freebsd-amd64-cgo), const EV_DROP ideal-int +pkg syscall (freebsd-amd64-cgo), const IPPROTO_MPLS = 137 +pkg syscall (freebsd-amd64-cgo), const IPPROTO_MPLS ideal-int +pkg syscall (freebsd-amd64-cgo), const MAP_32BIT = 524288 +pkg syscall (freebsd-amd64-cgo), const MAP_32BIT ideal-int +pkg syscall (freebsd-amd64-cgo), const MAP_ALIGNED_SUPER = 16777216 +pkg syscall (freebsd-amd64-cgo), const MAP_ALIGNED_SUPER ideal-int +pkg syscall (freebsd-amd64-cgo), const MAP_ALIGNMENT_MASK = -16777216 +pkg syscall (freebsd-amd64-cgo), const MAP_ALIGNMENT_MASK ideal-int +pkg syscall (freebsd-amd64-cgo), const MAP_ALIGNMENT_SHIFT = 24 +pkg syscall (freebsd-amd64-cgo), const MAP_ALIGNMENT_SHIFT ideal-int +pkg syscall (freebsd-amd64-cgo), const MSG_CMSG_CLOEXEC = 262144 +pkg syscall (freebsd-amd64-cgo), const MSG_CMSG_CLOEXEC ideal-int +pkg syscall (freebsd-amd64-cgo), const NAME_MAX = 255 +pkg syscall (freebsd-amd64-cgo), const NAME_MAX ideal-int +pkg syscall (freebsd-amd64-cgo), const O_CLOEXEC = 1048576 +pkg syscall (freebsd-amd64-cgo), const RTF_GWFLAG_COMPAT = 2147483648 +pkg syscall (freebsd-amd64-cgo), const RTF_GWFLAG_COMPAT ideal-int +pkg syscall (freebsd-amd64-cgo), const RT_NORTREF = 2 +pkg syscall (freebsd-amd64-cgo), const RT_NORTREF ideal-int +pkg syscall (freebsd-amd64-cgo), const SIGLIBRT = 33 +pkg syscall (freebsd-amd64-cgo), const SIGLIBRT Signal +pkg syscall (freebsd-amd64-cgo), const SOCK_CLOEXEC = 268435456 +pkg syscall (freebsd-amd64-cgo), const SOCK_CLOEXEC ideal-int +pkg syscall (freebsd-amd64-cgo), const SOCK_NONBLOCK = 536870912 +pkg syscall (freebsd-amd64-cgo), const SOCK_NONBLOCK ideal-int +pkg syscall (freebsd-amd64-cgo), const SO_VENDOR = 2147483648 +pkg syscall (freebsd-amd64-cgo), const SO_VENDOR ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_ACCEPT4 = 541 +pkg syscall (freebsd-amd64-cgo), const SYS_ACCEPT4 ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_BINDAT = 538 +pkg syscall (freebsd-amd64-cgo), const SYS_BINDAT ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_CHFLAGSAT = 540 +pkg syscall (freebsd-amd64-cgo), const SYS_CHFLAGSAT ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_CONNECTAT = 539 +pkg syscall (freebsd-amd64-cgo), const SYS_CONNECTAT ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_PIPE2 = 542 +pkg syscall (freebsd-amd64-cgo), const SYS_PIPE2 ideal-int +pkg syscall (freebsd-amd64-cgo), const SYS_PROCCTL = 544 +pkg syscall (freebsd-amd64-cgo), const SYS_PROCCTL ideal-int +pkg syscall (freebsd-amd64-cgo), const TCP_VENDOR = 2147483648 +pkg syscall (freebsd-amd64-cgo), const TCP_VENDOR ideal-int +pkg syscall (freebsd-amd64-cgo), const WEXITED = 16 +pkg syscall (freebsd-amd64-cgo), const WEXITED ideal-int +pkg syscall (freebsd-amd64-cgo), const WTRAPPED = 32 +pkg syscall (freebsd-amd64-cgo), const WTRAPPED ideal-int +pkg syscall (freebsd-amd64-cgo), func Accept4(int, int) (int, Sockaddr, error) +pkg syscall (freebsd-amd64-cgo), func FcntlFlock(uintptr, int, *Flock_t) error +pkg syscall (freebsd-amd64-cgo), func SendmsgN(int, []uint8, []uint8, Sockaddr, int) (int, error) +pkg syscall (freebsd-amd64-cgo), type Termios struct +pkg syscall (freebsd-amd64-cgo), type Termios struct, Cc [20]uint8 +pkg syscall (freebsd-amd64-cgo), type Termios struct, Cflag uint32 +pkg syscall (freebsd-amd64-cgo), type Termios struct, Iflag uint32 +pkg syscall (freebsd-amd64-cgo), type Termios struct, Ispeed uint32 +pkg syscall (freebsd-amd64-cgo), type Termios struct, Lflag uint32 +pkg syscall (freebsd-amd64-cgo), type Termios struct, Oflag uint32 +pkg syscall (freebsd-amd64-cgo), type Termios struct, Ospeed uint32 +pkg syscall (freebsd-arm), const AF_INET6_SDP = 42 +pkg syscall (freebsd-arm), const AF_INET6_SDP ideal-int +pkg syscall (freebsd-arm), const AF_INET_SDP = 40 +pkg syscall (freebsd-arm), const AF_INET_SDP ideal-int +pkg syscall (freebsd-arm), const AF_MAX = 42 +pkg syscall (freebsd-arm), const BIOCGRTIMEOUT = 1074807406 +pkg syscall (freebsd-arm), const BIOCSRTIMEOUT = 2148549229 +pkg syscall (freebsd-arm), const ELAST = 96 +pkg syscall (freebsd-arm), const ENOTRECOVERABLE = 95 +pkg syscall (freebsd-arm), const ENOTRECOVERABLE Errno +pkg syscall (freebsd-arm), const EOWNERDEAD = 96 +pkg syscall (freebsd-arm), const EOWNERDEAD Errno +pkg syscall (freebsd-arm), const EV_DROP = 4096 +pkg syscall (freebsd-arm), const EV_DROP ideal-int +pkg syscall (freebsd-arm), const IFT_CARP = 248 +pkg syscall (freebsd-arm), const IFT_CARP ideal-int +pkg syscall (freebsd-arm), const MAP_ALIGNED_SUPER = 16777216 +pkg syscall (freebsd-arm), const MAP_ALIGNED_SUPER ideal-int +pkg syscall (freebsd-arm), const MAP_ALIGNMENT_MASK = -16777216 +pkg syscall (freebsd-arm), const MAP_ALIGNMENT_MASK ideal-int +pkg syscall (freebsd-arm), const MAP_ALIGNMENT_SHIFT = 24 +pkg syscall (freebsd-arm), const MAP_ALIGNMENT_SHIFT ideal-int +pkg syscall (freebsd-arm), const MSG_CMSG_CLOEXEC = 262144 +pkg syscall (freebsd-arm), const MSG_CMSG_CLOEXEC ideal-int +pkg syscall (freebsd-arm), const NAME_MAX = 255 +pkg syscall (freebsd-arm), const NAME_MAX ideal-int +pkg syscall (freebsd-arm), const O_CLOEXEC = 1048576 +pkg syscall (freebsd-arm), const RTF_GWFLAG_COMPAT = 2147483648 +pkg syscall (freebsd-arm), const RTF_GWFLAG_COMPAT ideal-int +pkg syscall (freebsd-arm), const SIOCAIFADDR = 2151704858 +pkg syscall (freebsd-arm), const SIOCGIFSTATUS = 3274795323 +pkg syscall (freebsd-arm), const SIOCSIFPHYADDR = 2151704902 +pkg syscall (freebsd-arm), const SOCK_CLOEXEC = 268435456 +pkg syscall (freebsd-arm), const SOCK_CLOEXEC ideal-int +pkg syscall (freebsd-arm), const SOCK_NONBLOCK = 536870912 +pkg syscall (freebsd-arm), const SOCK_NONBLOCK ideal-int +pkg syscall (freebsd-arm), const SO_VENDOR = 2147483648 +pkg syscall (freebsd-arm), const SO_VENDOR ideal-int +pkg syscall (freebsd-arm), const SYS_ACCEPT4 = 541 +pkg syscall (freebsd-arm), const SYS_ACCEPT4 ideal-int +pkg syscall (freebsd-arm), const SYS_BINDAT = 538 +pkg syscall (freebsd-arm), const SYS_BINDAT ideal-int +pkg syscall (freebsd-arm), const SYS_CAP_GETRIGHTS = 515 +pkg syscall (freebsd-arm), const SYS_CAP_GETRIGHTS ideal-int +pkg syscall (freebsd-arm), const SYS_CHFLAGSAT = 540 +pkg syscall (freebsd-arm), const SYS_CHFLAGSAT ideal-int +pkg syscall (freebsd-arm), const SYS_CONNECTAT = 539 +pkg syscall (freebsd-arm), const SYS_CONNECTAT ideal-int +pkg syscall (freebsd-arm), const SYS_PIPE2 = 542 +pkg syscall (freebsd-arm), const SYS_PIPE2 ideal-int +pkg syscall (freebsd-arm), const SYS_PROCCTL = 544 +pkg syscall (freebsd-arm), const SYS_PROCCTL ideal-int +pkg syscall (freebsd-arm), const SizeofBpfHdr = 32 +pkg syscall (freebsd-arm), const SizeofIfData = 96 +pkg syscall (freebsd-arm), const SizeofIfMsghdr = 112 +pkg syscall (freebsd-arm), const SizeofSockaddrDatalink = 54 +pkg syscall (freebsd-arm), const SizeofSockaddrUnix = 106 +pkg syscall (freebsd-arm), const TCP_VENDOR = 2147483648 +pkg syscall (freebsd-arm), const TCP_VENDOR ideal-int +pkg syscall (freebsd-arm), const TIOCTIMESTAMP = 1074820185 +pkg syscall (freebsd-arm), func Accept4(int, int) (int, Sockaddr, error) +pkg syscall (freebsd-arm), func Fchflags(int, int) error +pkg syscall (freebsd-arm), func FcntlFlock(uintptr, int, *Flock_t) error +pkg syscall (freebsd-arm), func SendmsgN(int, []uint8, []uint8, Sockaddr, int) (int, error) +pkg syscall (freebsd-arm), type BpfHdr struct, Pad_cgo_0 [6]uint8 +pkg syscall (freebsd-arm), type Flock_t struct, Pad_cgo_0 [4]uint8 +pkg syscall (freebsd-arm), type IfData struct, Pad_cgo_0 [4]uint8 +pkg syscall (freebsd-arm), type Termios struct +pkg syscall (freebsd-arm), type Termios struct, Cc [20]uint8 +pkg syscall (freebsd-arm), type Termios struct, Cflag uint32 +pkg syscall (freebsd-arm), type Termios struct, Iflag uint32 +pkg syscall (freebsd-arm), type Termios struct, Ispeed uint32 +pkg syscall (freebsd-arm), type Termios struct, Lflag uint32 +pkg syscall (freebsd-arm), type Termios struct, Oflag uint32 +pkg syscall (freebsd-arm), type Termios struct, Ospeed uint32 +pkg syscall (freebsd-arm), type Timespec struct, Pad_cgo_0 [4]uint8 +pkg syscall (freebsd-arm), type Timeval struct, Pad_cgo_0 [4]uint8 +pkg syscall (freebsd-arm-cgo), const AF_INET6_SDP = 42 +pkg syscall (freebsd-arm-cgo), const AF_INET6_SDP ideal-int +pkg syscall (freebsd-arm-cgo), const AF_INET_SDP = 40 +pkg syscall (freebsd-arm-cgo), const AF_INET_SDP ideal-int +pkg syscall (freebsd-arm-cgo), const AF_MAX = 42 +pkg syscall (freebsd-arm-cgo), const BIOCGRTIMEOUT = 1074807406 +pkg syscall (freebsd-arm-cgo), const BIOCSRTIMEOUT = 2148549229 +pkg syscall (freebsd-arm-cgo), const ELAST = 96 +pkg syscall (freebsd-arm-cgo), const ENOTRECOVERABLE = 95 +pkg syscall (freebsd-arm-cgo), const ENOTRECOVERABLE Errno +pkg syscall (freebsd-arm-cgo), const EOWNERDEAD = 96 +pkg syscall (freebsd-arm-cgo), const EOWNERDEAD Errno +pkg syscall (freebsd-arm-cgo), const EV_DROP = 4096 +pkg syscall (freebsd-arm-cgo), const EV_DROP ideal-int +pkg syscall (freebsd-arm-cgo), const IFT_CARP = 248 +pkg syscall (freebsd-arm-cgo), const IFT_CARP ideal-int +pkg syscall (freebsd-arm-cgo), const MAP_ALIGNED_SUPER = 16777216 +pkg syscall (freebsd-arm-cgo), const MAP_ALIGNED_SUPER ideal-int +pkg syscall (freebsd-arm-cgo), const MAP_ALIGNMENT_MASK = -16777216 +pkg syscall (freebsd-arm-cgo), const MAP_ALIGNMENT_MASK ideal-int +pkg syscall (freebsd-arm-cgo), const MAP_ALIGNMENT_SHIFT = 24 +pkg syscall (freebsd-arm-cgo), const MAP_ALIGNMENT_SHIFT ideal-int +pkg syscall (freebsd-arm-cgo), const MSG_CMSG_CLOEXEC = 262144 +pkg syscall (freebsd-arm-cgo), const MSG_CMSG_CLOEXEC ideal-int +pkg syscall (freebsd-arm-cgo), const NAME_MAX = 255 +pkg syscall (freebsd-arm-cgo), const NAME_MAX ideal-int +pkg syscall (freebsd-arm-cgo), const O_CLOEXEC = 1048576 +pkg syscall (freebsd-arm-cgo), const RTF_GWFLAG_COMPAT = 2147483648 +pkg syscall (freebsd-arm-cgo), const RTF_GWFLAG_COMPAT ideal-int +pkg syscall (freebsd-arm-cgo), const SIOCAIFADDR = 2151704858 +pkg syscall (freebsd-arm-cgo), const SIOCGIFSTATUS = 3274795323 +pkg syscall (freebsd-arm-cgo), const SIOCSIFPHYADDR = 2151704902 +pkg syscall (freebsd-arm-cgo), const SOCK_CLOEXEC = 268435456 +pkg syscall (freebsd-arm-cgo), const SOCK_CLOEXEC ideal-int +pkg syscall (freebsd-arm-cgo), const SOCK_NONBLOCK = 536870912 +pkg syscall (freebsd-arm-cgo), const SOCK_NONBLOCK ideal-int +pkg syscall (freebsd-arm-cgo), const SO_VENDOR = 2147483648 +pkg syscall (freebsd-arm-cgo), const SO_VENDOR ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_ACCEPT4 = 541 +pkg syscall (freebsd-arm-cgo), const SYS_ACCEPT4 ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_BINDAT = 538 +pkg syscall (freebsd-arm-cgo), const SYS_BINDAT ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_CAP_GETRIGHTS = 515 +pkg syscall (freebsd-arm-cgo), const SYS_CAP_GETRIGHTS ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_CHFLAGSAT = 540 +pkg syscall (freebsd-arm-cgo), const SYS_CHFLAGSAT ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_CONNECTAT = 539 +pkg syscall (freebsd-arm-cgo), const SYS_CONNECTAT ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_PIPE2 = 542 +pkg syscall (freebsd-arm-cgo), const SYS_PIPE2 ideal-int +pkg syscall (freebsd-arm-cgo), const SYS_PROCCTL = 544 +pkg syscall (freebsd-arm-cgo), const SYS_PROCCTL ideal-int +pkg syscall (freebsd-arm-cgo), const SizeofBpfHdr = 32 +pkg syscall (freebsd-arm-cgo), const SizeofIfData = 96 +pkg syscall (freebsd-arm-cgo), const SizeofIfMsghdr = 112 +pkg syscall (freebsd-arm-cgo), const SizeofSockaddrDatalink = 54 +pkg syscall (freebsd-arm-cgo), const SizeofSockaddrUnix = 106 +pkg syscall (freebsd-arm-cgo), const TCP_VENDOR = 2147483648 +pkg syscall (freebsd-arm-cgo), const TCP_VENDOR ideal-int +pkg syscall (freebsd-arm-cgo), const TIOCTIMESTAMP = 1074820185 +pkg syscall (freebsd-arm-cgo), func Accept4(int, int) (int, Sockaddr, error) +pkg syscall (freebsd-arm-cgo), func Fchflags(int, int) error +pkg syscall (freebsd-arm-cgo), func FcntlFlock(uintptr, int, *Flock_t) error +pkg syscall (freebsd-arm-cgo), func SendmsgN(int, []uint8, []uint8, Sockaddr, int) (int, error) +pkg syscall (freebsd-arm-cgo), type BpfHdr struct, Pad_cgo_0 [6]uint8 +pkg syscall (freebsd-arm-cgo), type Flock_t struct, Pad_cgo_0 [4]uint8 +pkg syscall (freebsd-arm-cgo), type IfData struct, Pad_cgo_0 [4]uint8 +pkg syscall (freebsd-arm-cgo), type Termios struct +pkg syscall (freebsd-arm-cgo), type Termios struct, Cc [20]uint8 +pkg syscall (freebsd-arm-cgo), type Termios struct, Cflag uint32 +pkg syscall (freebsd-arm-cgo), type Termios struct, Iflag uint32 +pkg syscall (freebsd-arm-cgo), type Termios struct, Ispeed uint32 +pkg syscall (freebsd-arm-cgo), type Termios struct, Lflag uint32 +pkg syscall (freebsd-arm-cgo), type Termios struct, Oflag uint32 +pkg syscall (freebsd-arm-cgo), type Termios struct, Ospeed uint32 +pkg syscall (freebsd-arm-cgo), type Timespec struct, Pad_cgo_0 [4]uint8 +pkg syscall (freebsd-arm-cgo), type Timeval struct, Pad_cgo_0 [4]uint8 +pkg syscall (linux-386), func FcntlFlock(uintptr, int, *Flock_t) error +pkg syscall (linux-386), func SendmsgN(int, []uint8, []uint8, Sockaddr, int) (int, error) +pkg syscall (linux-386), type Flock_t struct +pkg syscall (linux-386), type Flock_t struct, Len int64 +pkg syscall (linux-386), type Flock_t struct, Pid int32 +pkg syscall (linux-386), type Flock_t struct, Start int64 +pkg syscall (linux-386), type Flock_t struct, Type int16 +pkg syscall (linux-386), type Flock_t struct, Whence int16 +pkg syscall (linux-386-cgo), func FcntlFlock(uintptr, int, *Flock_t) error +pkg syscall (linux-386-cgo), func SendmsgN(int, []uint8, []uint8, Sockaddr, int) (int, error) +pkg syscall (linux-386-cgo), type Flock_t struct +pkg syscall (linux-386-cgo), type Flock_t struct, Len int64 +pkg syscall (linux-386-cgo), type Flock_t struct, Pid int32 +pkg syscall (linux-386-cgo), type Flock_t struct, Start int64 +pkg syscall (linux-386-cgo), type Flock_t struct, Type int16 +pkg syscall (linux-386-cgo), type Flock_t struct, Whence int16 +pkg syscall (linux-amd64), func FcntlFlock(uintptr, int, *Flock_t) error +pkg syscall (linux-amd64), func SendmsgN(int, []uint8, []uint8, Sockaddr, int) (int, error) +pkg syscall (linux-amd64), type Flock_t struct +pkg syscall (linux-amd64), type Flock_t struct, Len int64 +pkg syscall (linux-amd64), type Flock_t struct, Pad_cgo_0 [4]uint8 +pkg syscall (linux-amd64), type Flock_t struct, Pad_cgo_1 [4]uint8 +pkg syscall (linux-amd64), type Flock_t struct, Pid int32 +pkg syscall (linux-amd64), type Flock_t struct, Start int64 +pkg syscall (linux-amd64), type Flock_t struct, Type int16 +pkg syscall (linux-amd64), type Flock_t struct, Whence int16 +pkg syscall (linux-amd64-cgo), func FcntlFlock(uintptr, int, *Flock_t) error +pkg syscall (linux-amd64-cgo), func SendmsgN(int, []uint8, []uint8, Sockaddr, int) (int, error) +pkg syscall (linux-amd64-cgo), type Flock_t struct +pkg syscall (linux-amd64-cgo), type Flock_t struct, Len int64 +pkg syscall (linux-amd64-cgo), type Flock_t struct, Pad_cgo_0 [4]uint8 +pkg syscall (linux-amd64-cgo), type Flock_t struct, Pad_cgo_1 [4]uint8 +pkg syscall (linux-amd64-cgo), type Flock_t struct, Pid int32 +pkg syscall (linux-amd64-cgo), type Flock_t struct, Start int64 +pkg syscall (linux-amd64-cgo), type Flock_t struct, Type int16 +pkg syscall (linux-amd64-cgo), type Flock_t struct, Whence int16 +pkg syscall (linux-arm), func FcntlFlock(uintptr, int, *Flock_t) error +pkg syscall (linux-arm), func SendmsgN(int, []uint8, []uint8, Sockaddr, int) (int, error) +pkg syscall (linux-arm), type Flock_t struct +pkg syscall (linux-arm), type Flock_t struct, Len int64 +pkg syscall (linux-arm), type Flock_t struct, Pad_cgo_0 [4]uint8 +pkg syscall (linux-arm), type Flock_t struct, Pad_cgo_1 [4]uint8 +pkg syscall (linux-arm), type Flock_t struct, Pid int32 +pkg syscall (linux-arm), type Flock_t struct, Start int64 +pkg syscall (linux-arm), type Flock_t struct, Type int16 +pkg syscall (linux-arm), type Flock_t struct, Whence int16 +pkg syscall (linux-arm-cgo), func FcntlFlock(uintptr, int, *Flock_t) error +pkg syscall (linux-arm-cgo), func SendmsgN(int, []uint8, []uint8, Sockaddr, int) (int, error) +pkg syscall (linux-arm-cgo), type Flock_t struct +pkg syscall (linux-arm-cgo), type Flock_t struct, Len int64 +pkg syscall (linux-arm-cgo), type Flock_t struct, Pad_cgo_0 [4]uint8 +pkg syscall (linux-arm-cgo), type Flock_t struct, Pad_cgo_1 [4]uint8 +pkg syscall (linux-arm-cgo), type Flock_t struct, Pid int32 +pkg syscall (linux-arm-cgo), type Flock_t struct, Start int64 +pkg syscall (linux-arm-cgo), type Flock_t struct, Type int16 +pkg syscall (linux-arm-cgo), type Flock_t struct, Whence int16 +pkg syscall (netbsd-386), const CLONE_CSIGNAL = 255 +pkg syscall (netbsd-386), const CLONE_CSIGNAL ideal-int +pkg syscall (netbsd-386), const CLONE_FILES = 1024 +pkg syscall (netbsd-386), const CLONE_FILES ideal-int +pkg syscall (netbsd-386), const CLONE_FS = 512 +pkg syscall (netbsd-386), const CLONE_FS ideal-int +pkg syscall (netbsd-386), const CLONE_PID = 4096 +pkg syscall (netbsd-386), const CLONE_PID ideal-int +pkg syscall (netbsd-386), const CLONE_PTRACE = 8192 +pkg syscall (netbsd-386), const CLONE_PTRACE ideal-int +pkg syscall (netbsd-386), const CLONE_SIGHAND = 2048 +pkg syscall (netbsd-386), const CLONE_SIGHAND ideal-int +pkg syscall (netbsd-386), const CLONE_VFORK = 16384 +pkg syscall (netbsd-386), const CLONE_VFORK ideal-int +pkg syscall (netbsd-386), const CLONE_VM = 256 +pkg syscall (netbsd-386), const CLONE_VM ideal-int +pkg syscall (netbsd-386), const MADV_DONTNEED = 4 +pkg syscall (netbsd-386), const MADV_DONTNEED ideal-int +pkg syscall (netbsd-386), const MADV_FREE = 6 +pkg syscall (netbsd-386), const MADV_FREE ideal-int +pkg syscall (netbsd-386), const MADV_NORMAL = 0 +pkg syscall (netbsd-386), const MADV_NORMAL ideal-int +pkg syscall (netbsd-386), const MADV_RANDOM = 1 +pkg syscall (netbsd-386), const MADV_RANDOM ideal-int +pkg syscall (netbsd-386), const MADV_SEQUENTIAL = 2 +pkg syscall (netbsd-386), const MADV_SEQUENTIAL ideal-int +pkg syscall (netbsd-386), const MADV_SPACEAVAIL = 5 +pkg syscall (netbsd-386), const MADV_SPACEAVAIL ideal-int +pkg syscall (netbsd-386), const MADV_WILLNEED = 3 +pkg syscall (netbsd-386), const MADV_WILLNEED ideal-int +pkg syscall (netbsd-386), const MAP_ALIGNMENT_16MB = 402653184 +pkg syscall (netbsd-386), const MAP_ALIGNMENT_16MB ideal-int +pkg syscall (netbsd-386), const MAP_ALIGNMENT_1TB = 671088640 +pkg syscall (netbsd-386), const MAP_ALIGNMENT_1TB ideal-int +pkg syscall (netbsd-386), const MAP_ALIGNMENT_256TB = 805306368 +pkg syscall (netbsd-386), const MAP_ALIGNMENT_256TB ideal-int +pkg syscall (netbsd-386), const MAP_ALIGNMENT_4GB = 536870912 +pkg syscall (netbsd-386), const MAP_ALIGNMENT_4GB ideal-int +pkg syscall (netbsd-386), const MAP_ALIGNMENT_64KB = 268435456 +pkg syscall (netbsd-386), const MAP_ALIGNMENT_64KB ideal-int +pkg syscall (netbsd-386), const MAP_ALIGNMENT_64PB = 939524096 +pkg syscall (netbsd-386), const MAP_ALIGNMENT_64PB ideal-int +pkg syscall (netbsd-386), const MAP_ALIGNMENT_MASK = -16777216 +pkg syscall (netbsd-386), const MAP_ALIGNMENT_MASK ideal-int +pkg syscall (netbsd-386), const MAP_ALIGNMENT_SHIFT = 24 +pkg syscall (netbsd-386), const MAP_ALIGNMENT_SHIFT ideal-int +pkg syscall (netbsd-386), const MAP_ANON = 4096 +pkg syscall (netbsd-386), const MAP_ANON ideal-int +pkg syscall (netbsd-386), const MAP_FILE = 0 +pkg syscall (netbsd-386), const MAP_FILE ideal-int +pkg syscall (netbsd-386), const MAP_FIXED = 16 +pkg syscall (netbsd-386), const MAP_FIXED ideal-int +pkg syscall (netbsd-386), const MAP_HASSEMAPHORE = 512 +pkg syscall (netbsd-386), const MAP_HASSEMAPHORE ideal-int +pkg syscall (netbsd-386), const MAP_INHERIT = 128 +pkg syscall (netbsd-386), const MAP_INHERIT ideal-int +pkg syscall (netbsd-386), const MAP_INHERIT_COPY = 1 +pkg syscall (netbsd-386), const MAP_INHERIT_COPY ideal-int +pkg syscall (netbsd-386), const MAP_INHERIT_DEFAULT = 1 +pkg syscall (netbsd-386), const MAP_INHERIT_DEFAULT ideal-int +pkg syscall (netbsd-386), const MAP_INHERIT_DONATE_COPY = 3 +pkg syscall (netbsd-386), const MAP_INHERIT_DONATE_COPY ideal-int +pkg syscall (netbsd-386), const MAP_INHERIT_NONE = 2 +pkg syscall (netbsd-386), const MAP_INHERIT_NONE ideal-int +pkg syscall (netbsd-386), const MAP_INHERIT_SHARE = 0 +pkg syscall (netbsd-386), const MAP_INHERIT_SHARE ideal-int +pkg syscall (netbsd-386), const MAP_NORESERVE = 64 +pkg syscall (netbsd-386), const MAP_NORESERVE ideal-int +pkg syscall (netbsd-386), const MAP_PRIVATE = 2 +pkg syscall (netbsd-386), const MAP_PRIVATE ideal-int +pkg syscall (netbsd-386), const MAP_RENAME = 32 +pkg syscall (netbsd-386), const MAP_RENAME ideal-int +pkg syscall (netbsd-386), const MAP_SHARED = 1 +pkg syscall (netbsd-386), const MAP_SHARED ideal-int +pkg syscall (netbsd-386), const MAP_STACK = 8192 +pkg syscall (netbsd-386), const MAP_STACK ideal-int +pkg syscall (netbsd-386), const MAP_TRYFIXED = 1024 +pkg syscall (netbsd-386), const MAP_TRYFIXED ideal-int +pkg syscall (netbsd-386), const MAP_WIRED = 2048 +pkg syscall (netbsd-386), const MAP_WIRED ideal-int +pkg syscall (netbsd-386), const MCL_CURRENT = 1 +pkg syscall (netbsd-386), const MCL_CURRENT ideal-int +pkg syscall (netbsd-386), const MCL_FUTURE = 2 +pkg syscall (netbsd-386), const MCL_FUTURE ideal-int +pkg syscall (netbsd-386), const MS_ASYNC = 1 +pkg syscall (netbsd-386), const MS_ASYNC ideal-int +pkg syscall (netbsd-386), const MS_INVALIDATE = 2 +pkg syscall (netbsd-386), const MS_INVALIDATE ideal-int +pkg syscall (netbsd-386), const MS_SYNC = 4 +pkg syscall (netbsd-386), const MS_SYNC ideal-int +pkg syscall (netbsd-386), const PROT_EXEC = 4 +pkg syscall (netbsd-386), const PROT_EXEC ideal-int +pkg syscall (netbsd-386), const PROT_NONE = 0 +pkg syscall (netbsd-386), const PROT_NONE ideal-int +pkg syscall (netbsd-386), const PROT_READ = 1 +pkg syscall (netbsd-386), const PROT_READ ideal-int +pkg syscall (netbsd-386), const PROT_WRITE = 2 +pkg syscall (netbsd-386), const PROT_WRITE ideal-int +pkg syscall (netbsd-386), func FcntlFlock(uintptr, int, *Flock_t) error +pkg syscall (netbsd-386), func SendmsgN(int, []uint8, []uint8, Sockaddr, int) (int, error) +pkg syscall (netbsd-386), type Termios struct +pkg syscall (netbsd-386), type Termios struct, Cc [20]uint8 +pkg syscall (netbsd-386), type Termios struct, Cflag uint32 +pkg syscall (netbsd-386), type Termios struct, Iflag uint32 +pkg syscall (netbsd-386), type Termios struct, Ispeed int32 +pkg syscall (netbsd-386), type Termios struct, Lflag uint32 +pkg syscall (netbsd-386), type Termios struct, Oflag uint32 +pkg syscall (netbsd-386), type Termios struct, Ospeed int32 +pkg syscall (netbsd-386-cgo), const CLONE_CSIGNAL = 255 +pkg syscall (netbsd-386-cgo), const CLONE_CSIGNAL ideal-int +pkg syscall (netbsd-386-cgo), const CLONE_FILES = 1024 +pkg syscall (netbsd-386-cgo), const CLONE_FILES ideal-int +pkg syscall (netbsd-386-cgo), const CLONE_FS = 512 +pkg syscall (netbsd-386-cgo), const CLONE_FS ideal-int +pkg syscall (netbsd-386-cgo), const CLONE_PID = 4096 +pkg syscall (netbsd-386-cgo), const CLONE_PID ideal-int +pkg syscall (netbsd-386-cgo), const CLONE_PTRACE = 8192 +pkg syscall (netbsd-386-cgo), const CLONE_PTRACE ideal-int +pkg syscall (netbsd-386-cgo), const CLONE_SIGHAND = 2048 +pkg syscall (netbsd-386-cgo), const CLONE_SIGHAND ideal-int +pkg syscall (netbsd-386-cgo), const CLONE_VFORK = 16384 +pkg syscall (netbsd-386-cgo), const CLONE_VFORK ideal-int +pkg syscall (netbsd-386-cgo), const CLONE_VM = 256 +pkg syscall (netbsd-386-cgo), const CLONE_VM ideal-int +pkg syscall (netbsd-386-cgo), const MADV_DONTNEED = 4 +pkg syscall (netbsd-386-cgo), const MADV_DONTNEED ideal-int +pkg syscall (netbsd-386-cgo), const MADV_FREE = 6 +pkg syscall (netbsd-386-cgo), const MADV_FREE ideal-int +pkg syscall (netbsd-386-cgo), const MADV_NORMAL = 0 +pkg syscall (netbsd-386-cgo), const MADV_NORMAL ideal-int +pkg syscall (netbsd-386-cgo), const MADV_RANDOM = 1 +pkg syscall (netbsd-386-cgo), const MADV_RANDOM ideal-int +pkg syscall (netbsd-386-cgo), const MADV_SEQUENTIAL = 2 +pkg syscall (netbsd-386-cgo), const MADV_SEQUENTIAL ideal-int +pkg syscall (netbsd-386-cgo), const MADV_SPACEAVAIL = 5 +pkg syscall (netbsd-386-cgo), const MADV_SPACEAVAIL ideal-int +pkg syscall (netbsd-386-cgo), const MADV_WILLNEED = 3 +pkg syscall (netbsd-386-cgo), const MADV_WILLNEED ideal-int +pkg syscall (netbsd-386-cgo), const MAP_ALIGNMENT_16MB = 402653184 +pkg syscall (netbsd-386-cgo), const MAP_ALIGNMENT_16MB ideal-int +pkg syscall (netbsd-386-cgo), const MAP_ALIGNMENT_1TB = 671088640 +pkg syscall (netbsd-386-cgo), const MAP_ALIGNMENT_1TB ideal-int +pkg syscall (netbsd-386-cgo), const MAP_ALIGNMENT_256TB = 805306368 +pkg syscall (netbsd-386-cgo), const MAP_ALIGNMENT_256TB ideal-int +pkg syscall (netbsd-386-cgo), const MAP_ALIGNMENT_4GB = 536870912 +pkg syscall (netbsd-386-cgo), const MAP_ALIGNMENT_4GB ideal-int +pkg syscall (netbsd-386-cgo), const MAP_ALIGNMENT_64KB = 268435456 +pkg syscall (netbsd-386-cgo), const MAP_ALIGNMENT_64KB ideal-int +pkg syscall (netbsd-386-cgo), const MAP_ALIGNMENT_64PB = 939524096 +pkg syscall (netbsd-386-cgo), const MAP_ALIGNMENT_64PB ideal-int +pkg syscall (netbsd-386-cgo), const MAP_ALIGNMENT_MASK = -16777216 +pkg syscall (netbsd-386-cgo), const MAP_ALIGNMENT_MASK ideal-int +pkg syscall (netbsd-386-cgo), const MAP_ALIGNMENT_SHIFT = 24 +pkg syscall (netbsd-386-cgo), const MAP_ALIGNMENT_SHIFT ideal-int +pkg syscall (netbsd-386-cgo), const MAP_ANON = 4096 +pkg syscall (netbsd-386-cgo), const MAP_ANON ideal-int +pkg syscall (netbsd-386-cgo), const MAP_FILE = 0 +pkg syscall (netbsd-386-cgo), const MAP_FILE ideal-int +pkg syscall (netbsd-386-cgo), const MAP_FIXED = 16 +pkg syscall (netbsd-386-cgo), const MAP_FIXED ideal-int +pkg syscall (netbsd-386-cgo), const MAP_HASSEMAPHORE = 512 +pkg syscall (netbsd-386-cgo), const MAP_HASSEMAPHORE ideal-int +pkg syscall (netbsd-386-cgo), const MAP_INHERIT = 128 +pkg syscall (netbsd-386-cgo), const MAP_INHERIT ideal-int +pkg syscall (netbsd-386-cgo), const MAP_INHERIT_COPY = 1 +pkg syscall (netbsd-386-cgo), const MAP_INHERIT_COPY ideal-int +pkg syscall (netbsd-386-cgo), const MAP_INHERIT_DEFAULT = 1 +pkg syscall (netbsd-386-cgo), const MAP_INHERIT_DEFAULT ideal-int +pkg syscall (netbsd-386-cgo), const MAP_INHERIT_DONATE_COPY = 3 +pkg syscall (netbsd-386-cgo), const MAP_INHERIT_DONATE_COPY ideal-int +pkg syscall (netbsd-386-cgo), const MAP_INHERIT_NONE = 2 +pkg syscall (netbsd-386-cgo), const MAP_INHERIT_NONE ideal-int +pkg syscall (netbsd-386-cgo), const MAP_INHERIT_SHARE = 0 +pkg syscall (netbsd-386-cgo), const MAP_INHERIT_SHARE ideal-int +pkg syscall (netbsd-386-cgo), const MAP_NORESERVE = 64 +pkg syscall (netbsd-386-cgo), const MAP_NORESERVE ideal-int +pkg syscall (netbsd-386-cgo), const MAP_PRIVATE = 2 +pkg syscall (netbsd-386-cgo), const MAP_PRIVATE ideal-int +pkg syscall (netbsd-386-cgo), const MAP_RENAME = 32 +pkg syscall (netbsd-386-cgo), const MAP_RENAME ideal-int +pkg syscall (netbsd-386-cgo), const MAP_SHARED = 1 +pkg syscall (netbsd-386-cgo), const MAP_SHARED ideal-int +pkg syscall (netbsd-386-cgo), const MAP_STACK = 8192 +pkg syscall (netbsd-386-cgo), const MAP_STACK ideal-int +pkg syscall (netbsd-386-cgo), const MAP_TRYFIXED = 1024 +pkg syscall (netbsd-386-cgo), const MAP_TRYFIXED ideal-int +pkg syscall (netbsd-386-cgo), const MAP_WIRED = 2048 +pkg syscall (netbsd-386-cgo), const MAP_WIRED ideal-int +pkg syscall (netbsd-386-cgo), const MCL_CURRENT = 1 +pkg syscall (netbsd-386-cgo), const MCL_CURRENT ideal-int +pkg syscall (netbsd-386-cgo), const MCL_FUTURE = 2 +pkg syscall (netbsd-386-cgo), const MCL_FUTURE ideal-int +pkg syscall (netbsd-386-cgo), const MS_ASYNC = 1 +pkg syscall (netbsd-386-cgo), const MS_ASYNC ideal-int +pkg syscall (netbsd-386-cgo), const MS_INVALIDATE = 2 +pkg syscall (netbsd-386-cgo), const MS_INVALIDATE ideal-int +pkg syscall (netbsd-386-cgo), const MS_SYNC = 4 +pkg syscall (netbsd-386-cgo), const MS_SYNC ideal-int +pkg syscall (netbsd-386-cgo), const PROT_EXEC = 4 +pkg syscall (netbsd-386-cgo), const PROT_EXEC ideal-int +pkg syscall (netbsd-386-cgo), const PROT_NONE = 0 +pkg syscall (netbsd-386-cgo), const PROT_NONE ideal-int +pkg syscall (netbsd-386-cgo), const PROT_READ = 1 +pkg syscall (netbsd-386-cgo), const PROT_READ ideal-int +pkg syscall (netbsd-386-cgo), const PROT_WRITE = 2 +pkg syscall (netbsd-386-cgo), const PROT_WRITE ideal-int +pkg syscall (netbsd-386-cgo), func FcntlFlock(uintptr, int, *Flock_t) error +pkg syscall (netbsd-386-cgo), func SendmsgN(int, []uint8, []uint8, Sockaddr, int) (int, error) +pkg syscall (netbsd-386-cgo), type Termios struct +pkg syscall (netbsd-386-cgo), type Termios struct, Cc [20]uint8 +pkg syscall (netbsd-386-cgo), type Termios struct, Cflag uint32 +pkg syscall (netbsd-386-cgo), type Termios struct, Iflag uint32 +pkg syscall (netbsd-386-cgo), type Termios struct, Ispeed int32 +pkg syscall (netbsd-386-cgo), type Termios struct, Lflag uint32 +pkg syscall (netbsd-386-cgo), type Termios struct, Oflag uint32 +pkg syscall (netbsd-386-cgo), type Termios struct, Ospeed int32 +pkg syscall (netbsd-amd64), const CLONE_CSIGNAL = 255 +pkg syscall (netbsd-amd64), const CLONE_CSIGNAL ideal-int +pkg syscall (netbsd-amd64), const CLONE_FILES = 1024 +pkg syscall (netbsd-amd64), const CLONE_FILES ideal-int +pkg syscall (netbsd-amd64), const CLONE_FS = 512 +pkg syscall (netbsd-amd64), const CLONE_FS ideal-int +pkg syscall (netbsd-amd64), const CLONE_PID = 4096 +pkg syscall (netbsd-amd64), const CLONE_PID ideal-int +pkg syscall (netbsd-amd64), const CLONE_PTRACE = 8192 +pkg syscall (netbsd-amd64), const CLONE_PTRACE ideal-int +pkg syscall (netbsd-amd64), const CLONE_SIGHAND = 2048 +pkg syscall (netbsd-amd64), const CLONE_SIGHAND ideal-int +pkg syscall (netbsd-amd64), const CLONE_VFORK = 16384 +pkg syscall (netbsd-amd64), const CLONE_VFORK ideal-int +pkg syscall (netbsd-amd64), const CLONE_VM = 256 +pkg syscall (netbsd-amd64), const CLONE_VM ideal-int +pkg syscall (netbsd-amd64), const MADV_DONTNEED = 4 +pkg syscall (netbsd-amd64), const MADV_DONTNEED ideal-int +pkg syscall (netbsd-amd64), const MADV_FREE = 6 +pkg syscall (netbsd-amd64), const MADV_FREE ideal-int +pkg syscall (netbsd-amd64), const MADV_NORMAL = 0 +pkg syscall (netbsd-amd64), const MADV_NORMAL ideal-int +pkg syscall (netbsd-amd64), const MADV_RANDOM = 1 +pkg syscall (netbsd-amd64), const MADV_RANDOM ideal-int +pkg syscall (netbsd-amd64), const MADV_SEQUENTIAL = 2 +pkg syscall (netbsd-amd64), const MADV_SEQUENTIAL ideal-int +pkg syscall (netbsd-amd64), const MADV_SPACEAVAIL = 5 +pkg syscall (netbsd-amd64), const MADV_SPACEAVAIL ideal-int +pkg syscall (netbsd-amd64), const MADV_WILLNEED = 3 +pkg syscall (netbsd-amd64), const MADV_WILLNEED ideal-int +pkg syscall (netbsd-amd64), const MAP_ALIGNMENT_16MB = 402653184 +pkg syscall (netbsd-amd64), const MAP_ALIGNMENT_16MB ideal-int +pkg syscall (netbsd-amd64), const MAP_ALIGNMENT_1TB = 671088640 +pkg syscall (netbsd-amd64), const MAP_ALIGNMENT_1TB ideal-int +pkg syscall (netbsd-amd64), const MAP_ALIGNMENT_256TB = 805306368 +pkg syscall (netbsd-amd64), const MAP_ALIGNMENT_256TB ideal-int +pkg syscall (netbsd-amd64), const MAP_ALIGNMENT_4GB = 536870912 +pkg syscall (netbsd-amd64), const MAP_ALIGNMENT_4GB ideal-int +pkg syscall (netbsd-amd64), const MAP_ALIGNMENT_64KB = 268435456 +pkg syscall (netbsd-amd64), const MAP_ALIGNMENT_64KB ideal-int +pkg syscall (netbsd-amd64), const MAP_ALIGNMENT_64PB = 939524096 +pkg syscall (netbsd-amd64), const MAP_ALIGNMENT_64PB ideal-int +pkg syscall (netbsd-amd64), const MAP_ALIGNMENT_MASK = -16777216 +pkg syscall (netbsd-amd64), const MAP_ALIGNMENT_MASK ideal-int +pkg syscall (netbsd-amd64), const MAP_ALIGNMENT_SHIFT = 24 +pkg syscall (netbsd-amd64), const MAP_ALIGNMENT_SHIFT ideal-int +pkg syscall (netbsd-amd64), const MAP_ANON = 4096 +pkg syscall (netbsd-amd64), const MAP_ANON ideal-int +pkg syscall (netbsd-amd64), const MAP_FILE = 0 +pkg syscall (netbsd-amd64), const MAP_FILE ideal-int +pkg syscall (netbsd-amd64), const MAP_FIXED = 16 +pkg syscall (netbsd-amd64), const MAP_FIXED ideal-int +pkg syscall (netbsd-amd64), const MAP_HASSEMAPHORE = 512 +pkg syscall (netbsd-amd64), const MAP_HASSEMAPHORE ideal-int +pkg syscall (netbsd-amd64), const MAP_INHERIT = 128 +pkg syscall (netbsd-amd64), const MAP_INHERIT ideal-int +pkg syscall (netbsd-amd64), const MAP_INHERIT_COPY = 1 +pkg syscall (netbsd-amd64), const MAP_INHERIT_COPY ideal-int +pkg syscall (netbsd-amd64), const MAP_INHERIT_DEFAULT = 1 +pkg syscall (netbsd-amd64), const MAP_INHERIT_DEFAULT ideal-int +pkg syscall (netbsd-amd64), const MAP_INHERIT_DONATE_COPY = 3 +pkg syscall (netbsd-amd64), const MAP_INHERIT_DONATE_COPY ideal-int +pkg syscall (netbsd-amd64), const MAP_INHERIT_NONE = 2 +pkg syscall (netbsd-amd64), const MAP_INHERIT_NONE ideal-int +pkg syscall (netbsd-amd64), const MAP_INHERIT_SHARE = 0 +pkg syscall (netbsd-amd64), const MAP_INHERIT_SHARE ideal-int +pkg syscall (netbsd-amd64), const MAP_NORESERVE = 64 +pkg syscall (netbsd-amd64), const MAP_NORESERVE ideal-int +pkg syscall (netbsd-amd64), const MAP_PRIVATE = 2 +pkg syscall (netbsd-amd64), const MAP_PRIVATE ideal-int +pkg syscall (netbsd-amd64), const MAP_RENAME = 32 +pkg syscall (netbsd-amd64), const MAP_RENAME ideal-int +pkg syscall (netbsd-amd64), const MAP_SHARED = 1 +pkg syscall (netbsd-amd64), const MAP_SHARED ideal-int +pkg syscall (netbsd-amd64), const MAP_STACK = 8192 +pkg syscall (netbsd-amd64), const MAP_STACK ideal-int +pkg syscall (netbsd-amd64), const MAP_TRYFIXED = 1024 +pkg syscall (netbsd-amd64), const MAP_TRYFIXED ideal-int +pkg syscall (netbsd-amd64), const MAP_WIRED = 2048 +pkg syscall (netbsd-amd64), const MAP_WIRED ideal-int +pkg syscall (netbsd-amd64), const MCL_CURRENT = 1 +pkg syscall (netbsd-amd64), const MCL_CURRENT ideal-int +pkg syscall (netbsd-amd64), const MCL_FUTURE = 2 +pkg syscall (netbsd-amd64), const MCL_FUTURE ideal-int +pkg syscall (netbsd-amd64), const MS_ASYNC = 1 +pkg syscall (netbsd-amd64), const MS_ASYNC ideal-int +pkg syscall (netbsd-amd64), const MS_INVALIDATE = 2 +pkg syscall (netbsd-amd64), const MS_INVALIDATE ideal-int +pkg syscall (netbsd-amd64), const MS_SYNC = 4 +pkg syscall (netbsd-amd64), const MS_SYNC ideal-int +pkg syscall (netbsd-amd64), const PROT_EXEC = 4 +pkg syscall (netbsd-amd64), const PROT_EXEC ideal-int +pkg syscall (netbsd-amd64), const PROT_NONE = 0 +pkg syscall (netbsd-amd64), const PROT_NONE ideal-int +pkg syscall (netbsd-amd64), const PROT_READ = 1 +pkg syscall (netbsd-amd64), const PROT_READ ideal-int +pkg syscall (netbsd-amd64), const PROT_WRITE = 2 +pkg syscall (netbsd-amd64), const PROT_WRITE ideal-int +pkg syscall (netbsd-amd64), func FcntlFlock(uintptr, int, *Flock_t) error +pkg syscall (netbsd-amd64), func SendmsgN(int, []uint8, []uint8, Sockaddr, int) (int, error) +pkg syscall (netbsd-amd64), type Termios struct +pkg syscall (netbsd-amd64), type Termios struct, Cc [20]uint8 +pkg syscall (netbsd-amd64), type Termios struct, Cflag uint32 +pkg syscall (netbsd-amd64), type Termios struct, Iflag uint32 +pkg syscall (netbsd-amd64), type Termios struct, Ispeed int32 +pkg syscall (netbsd-amd64), type Termios struct, Lflag uint32 +pkg syscall (netbsd-amd64), type Termios struct, Oflag uint32 +pkg syscall (netbsd-amd64), type Termios struct, Ospeed int32 +pkg syscall (netbsd-amd64-cgo), const CLONE_CSIGNAL = 255 +pkg syscall (netbsd-amd64-cgo), const CLONE_CSIGNAL ideal-int +pkg syscall (netbsd-amd64-cgo), const CLONE_FILES = 1024 +pkg syscall (netbsd-amd64-cgo), const CLONE_FILES ideal-int +pkg syscall (netbsd-amd64-cgo), const CLONE_FS = 512 +pkg syscall (netbsd-amd64-cgo), const CLONE_FS ideal-int +pkg syscall (netbsd-amd64-cgo), const CLONE_PID = 4096 +pkg syscall (netbsd-amd64-cgo), const CLONE_PID ideal-int +pkg syscall (netbsd-amd64-cgo), const CLONE_PTRACE = 8192 +pkg syscall (netbsd-amd64-cgo), const CLONE_PTRACE ideal-int +pkg syscall (netbsd-amd64-cgo), const CLONE_SIGHAND = 2048 +pkg syscall (netbsd-amd64-cgo), const CLONE_SIGHAND ideal-int +pkg syscall (netbsd-amd64-cgo), const CLONE_VFORK = 16384 +pkg syscall (netbsd-amd64-cgo), const CLONE_VFORK ideal-int +pkg syscall (netbsd-amd64-cgo), const CLONE_VM = 256 +pkg syscall (netbsd-amd64-cgo), const CLONE_VM ideal-int +pkg syscall (netbsd-amd64-cgo), const MADV_DONTNEED = 4 +pkg syscall (netbsd-amd64-cgo), const MADV_DONTNEED ideal-int +pkg syscall (netbsd-amd64-cgo), const MADV_FREE = 6 +pkg syscall (netbsd-amd64-cgo), const MADV_FREE ideal-int +pkg syscall (netbsd-amd64-cgo), const MADV_NORMAL = 0 +pkg syscall (netbsd-amd64-cgo), const MADV_NORMAL ideal-int +pkg syscall (netbsd-amd64-cgo), const MADV_RANDOM = 1 +pkg syscall (netbsd-amd64-cgo), const MADV_RANDOM ideal-int +pkg syscall (netbsd-amd64-cgo), const MADV_SEQUENTIAL = 2 +pkg syscall (netbsd-amd64-cgo), const MADV_SEQUENTIAL ideal-int +pkg syscall (netbsd-amd64-cgo), const MADV_SPACEAVAIL = 5 +pkg syscall (netbsd-amd64-cgo), const MADV_SPACEAVAIL ideal-int +pkg syscall (netbsd-amd64-cgo), const MADV_WILLNEED = 3 +pkg syscall (netbsd-amd64-cgo), const MADV_WILLNEED ideal-int +pkg syscall (netbsd-amd64-cgo), const MAP_ALIGNMENT_16MB = 402653184 +pkg syscall (netbsd-amd64-cgo), const MAP_ALIGNMENT_16MB ideal-int +pkg syscall (netbsd-amd64-cgo), const MAP_ALIGNMENT_1TB = 671088640 +pkg syscall (netbsd-amd64-cgo), const MAP_ALIGNMENT_1TB ideal-int +pkg syscall (netbsd-amd64-cgo), const MAP_ALIGNMENT_256TB = 805306368 +pkg syscall (netbsd-amd64-cgo), const MAP_ALIGNMENT_256TB ideal-int +pkg syscall (netbsd-amd64-cgo), const MAP_ALIGNMENT_4GB = 536870912 +pkg syscall (netbsd-amd64-cgo), const MAP_ALIGNMENT_4GB ideal-int +pkg syscall (netbsd-amd64-cgo), const MAP_ALIGNMENT_64KB = 268435456 +pkg syscall (netbsd-amd64-cgo), const MAP_ALIGNMENT_64KB ideal-int +pkg syscall (netbsd-amd64-cgo), const MAP_ALIGNMENT_64PB = 939524096 +pkg syscall (netbsd-amd64-cgo), const MAP_ALIGNMENT_64PB ideal-int +pkg syscall (netbsd-amd64-cgo), const MAP_ALIGNMENT_MASK = -16777216 +pkg syscall (netbsd-amd64-cgo), const MAP_ALIGNMENT_MASK ideal-int +pkg syscall (netbsd-amd64-cgo), const MAP_ALIGNMENT_SHIFT = 24 +pkg syscall (netbsd-amd64-cgo), const MAP_ALIGNMENT_SHIFT ideal-int +pkg syscall (netbsd-amd64-cgo), const MAP_ANON = 4096 +pkg syscall (netbsd-amd64-cgo), const MAP_ANON ideal-int +pkg syscall (netbsd-amd64-cgo), const MAP_FILE = 0 +pkg syscall (netbsd-amd64-cgo), const MAP_FILE ideal-int +pkg syscall (netbsd-amd64-cgo), const MAP_FIXED = 16 +pkg syscall (netbsd-amd64-cgo), const MAP_FIXED ideal-int +pkg syscall (netbsd-amd64-cgo), const MAP_HASSEMAPHORE = 512 +pkg syscall (netbsd-amd64-cgo), const MAP_HASSEMAPHORE ideal-int +pkg syscall (netbsd-amd64-cgo), const MAP_INHERIT = 128 +pkg syscall (netbsd-amd64-cgo), const MAP_INHERIT ideal-int +pkg syscall (netbsd-amd64-cgo), const MAP_INHERIT_COPY = 1 +pkg syscall (netbsd-amd64-cgo), const MAP_INHERIT_COPY ideal-int +pkg syscall (netbsd-amd64-cgo), const MAP_INHERIT_DEFAULT = 1 +pkg syscall (netbsd-amd64-cgo), const MAP_INHERIT_DEFAULT ideal-int +pkg syscall (netbsd-amd64-cgo), const MAP_INHERIT_DONATE_COPY = 3 +pkg syscall (netbsd-amd64-cgo), const MAP_INHERIT_DONATE_COPY ideal-int +pkg syscall (netbsd-amd64-cgo), const MAP_INHERIT_NONE = 2 +pkg syscall (netbsd-amd64-cgo), const MAP_INHERIT_NONE ideal-int +pkg syscall (netbsd-amd64-cgo), const MAP_INHERIT_SHARE = 0 +pkg syscall (netbsd-amd64-cgo), const MAP_INHERIT_SHARE ideal-int +pkg syscall (netbsd-amd64-cgo), const MAP_NORESERVE = 64 +pkg syscall (netbsd-amd64-cgo), const MAP_NORESERVE ideal-int +pkg syscall (netbsd-amd64-cgo), const MAP_PRIVATE = 2 +pkg syscall (netbsd-amd64-cgo), const MAP_PRIVATE ideal-int +pkg syscall (netbsd-amd64-cgo), const MAP_RENAME = 32 +pkg syscall (netbsd-amd64-cgo), const MAP_RENAME ideal-int +pkg syscall (netbsd-amd64-cgo), const MAP_SHARED = 1 +pkg syscall (netbsd-amd64-cgo), const MAP_SHARED ideal-int +pkg syscall (netbsd-amd64-cgo), const MAP_STACK = 8192 +pkg syscall (netbsd-amd64-cgo), const MAP_STACK ideal-int +pkg syscall (netbsd-amd64-cgo), const MAP_TRYFIXED = 1024 +pkg syscall (netbsd-amd64-cgo), const MAP_TRYFIXED ideal-int +pkg syscall (netbsd-amd64-cgo), const MAP_WIRED = 2048 +pkg syscall (netbsd-amd64-cgo), const MAP_WIRED ideal-int +pkg syscall (netbsd-amd64-cgo), const MCL_CURRENT = 1 +pkg syscall (netbsd-amd64-cgo), const MCL_CURRENT ideal-int +pkg syscall (netbsd-amd64-cgo), const MCL_FUTURE = 2 +pkg syscall (netbsd-amd64-cgo), const MCL_FUTURE ideal-int +pkg syscall (netbsd-amd64-cgo), const MS_ASYNC = 1 +pkg syscall (netbsd-amd64-cgo), const MS_ASYNC ideal-int +pkg syscall (netbsd-amd64-cgo), const MS_INVALIDATE = 2 +pkg syscall (netbsd-amd64-cgo), const MS_INVALIDATE ideal-int +pkg syscall (netbsd-amd64-cgo), const MS_SYNC = 4 +pkg syscall (netbsd-amd64-cgo), const MS_SYNC ideal-int +pkg syscall (netbsd-amd64-cgo), const PROT_EXEC = 4 +pkg syscall (netbsd-amd64-cgo), const PROT_EXEC ideal-int +pkg syscall (netbsd-amd64-cgo), const PROT_NONE = 0 +pkg syscall (netbsd-amd64-cgo), const PROT_NONE ideal-int +pkg syscall (netbsd-amd64-cgo), const PROT_READ = 1 +pkg syscall (netbsd-amd64-cgo), const PROT_READ ideal-int +pkg syscall (netbsd-amd64-cgo), const PROT_WRITE = 2 +pkg syscall (netbsd-amd64-cgo), const PROT_WRITE ideal-int +pkg syscall (netbsd-amd64-cgo), func FcntlFlock(uintptr, int, *Flock_t) error +pkg syscall (netbsd-amd64-cgo), func SendmsgN(int, []uint8, []uint8, Sockaddr, int) (int, error) +pkg syscall (netbsd-amd64-cgo), type Termios struct +pkg syscall (netbsd-amd64-cgo), type Termios struct, Cc [20]uint8 +pkg syscall (netbsd-amd64-cgo), type Termios struct, Cflag uint32 +pkg syscall (netbsd-amd64-cgo), type Termios struct, Iflag uint32 +pkg syscall (netbsd-amd64-cgo), type Termios struct, Ispeed int32 +pkg syscall (netbsd-amd64-cgo), type Termios struct, Lflag uint32 +pkg syscall (netbsd-amd64-cgo), type Termios struct, Oflag uint32 +pkg syscall (netbsd-amd64-cgo), type Termios struct, Ospeed int32 +pkg syscall (netbsd-arm), const MADV_DONTNEED = 4 +pkg syscall (netbsd-arm), const MADV_DONTNEED ideal-int +pkg syscall (netbsd-arm), const MADV_FREE = 6 +pkg syscall (netbsd-arm), const MADV_FREE ideal-int +pkg syscall (netbsd-arm), const MADV_NORMAL = 0 +pkg syscall (netbsd-arm), const MADV_NORMAL ideal-int +pkg syscall (netbsd-arm), const MADV_RANDOM = 1 +pkg syscall (netbsd-arm), const MADV_RANDOM ideal-int +pkg syscall (netbsd-arm), const MADV_SEQUENTIAL = 2 +pkg syscall (netbsd-arm), const MADV_SEQUENTIAL ideal-int +pkg syscall (netbsd-arm), const MADV_SPACEAVAIL = 5 +pkg syscall (netbsd-arm), const MADV_SPACEAVAIL ideal-int +pkg syscall (netbsd-arm), const MADV_WILLNEED = 3 +pkg syscall (netbsd-arm), const MADV_WILLNEED ideal-int +pkg syscall (netbsd-arm), const MAP_ALIGNMENT_16MB = 402653184 +pkg syscall (netbsd-arm), const MAP_ALIGNMENT_16MB ideal-int +pkg syscall (netbsd-arm), const MAP_ALIGNMENT_1TB = 671088640 +pkg syscall (netbsd-arm), const MAP_ALIGNMENT_1TB ideal-int +pkg syscall (netbsd-arm), const MAP_ALIGNMENT_256TB = 805306368 +pkg syscall (netbsd-arm), const MAP_ALIGNMENT_256TB ideal-int +pkg syscall (netbsd-arm), const MAP_ALIGNMENT_4GB = 536870912 +pkg syscall (netbsd-arm), const MAP_ALIGNMENT_4GB ideal-int +pkg syscall (netbsd-arm), const MAP_ALIGNMENT_64KB = 268435456 +pkg syscall (netbsd-arm), const MAP_ALIGNMENT_64KB ideal-int +pkg syscall (netbsd-arm), const MAP_ALIGNMENT_64PB = 939524096 +pkg syscall (netbsd-arm), const MAP_ALIGNMENT_64PB ideal-int +pkg syscall (netbsd-arm), const MAP_ALIGNMENT_MASK = -16777216 +pkg syscall (netbsd-arm), const MAP_ALIGNMENT_MASK ideal-int +pkg syscall (netbsd-arm), const MAP_ALIGNMENT_SHIFT = 24 +pkg syscall (netbsd-arm), const MAP_ALIGNMENT_SHIFT ideal-int +pkg syscall (netbsd-arm), const MAP_ANON = 4096 +pkg syscall (netbsd-arm), const MAP_ANON ideal-int +pkg syscall (netbsd-arm), const MAP_FILE = 0 +pkg syscall (netbsd-arm), const MAP_FILE ideal-int +pkg syscall (netbsd-arm), const MAP_FIXED = 16 +pkg syscall (netbsd-arm), const MAP_FIXED ideal-int +pkg syscall (netbsd-arm), const MAP_HASSEMAPHORE = 512 +pkg syscall (netbsd-arm), const MAP_HASSEMAPHORE ideal-int +pkg syscall (netbsd-arm), const MAP_INHERIT = 128 +pkg syscall (netbsd-arm), const MAP_INHERIT ideal-int +pkg syscall (netbsd-arm), const MAP_INHERIT_COPY = 1 +pkg syscall (netbsd-arm), const MAP_INHERIT_COPY ideal-int +pkg syscall (netbsd-arm), const MAP_INHERIT_DEFAULT = 1 +pkg syscall (netbsd-arm), const MAP_INHERIT_DEFAULT ideal-int +pkg syscall (netbsd-arm), const MAP_INHERIT_DONATE_COPY = 3 +pkg syscall (netbsd-arm), const MAP_INHERIT_DONATE_COPY ideal-int +pkg syscall (netbsd-arm), const MAP_INHERIT_NONE = 2 +pkg syscall (netbsd-arm), const MAP_INHERIT_NONE ideal-int +pkg syscall (netbsd-arm), const MAP_INHERIT_SHARE = 0 +pkg syscall (netbsd-arm), const MAP_INHERIT_SHARE ideal-int +pkg syscall (netbsd-arm), const MAP_NORESERVE = 64 +pkg syscall (netbsd-arm), const MAP_NORESERVE ideal-int +pkg syscall (netbsd-arm), const MAP_PRIVATE = 2 +pkg syscall (netbsd-arm), const MAP_PRIVATE ideal-int +pkg syscall (netbsd-arm), const MAP_RENAME = 32 +pkg syscall (netbsd-arm), const MAP_RENAME ideal-int +pkg syscall (netbsd-arm), const MAP_SHARED = 1 +pkg syscall (netbsd-arm), const MAP_SHARED ideal-int +pkg syscall (netbsd-arm), const MAP_STACK = 8192 +pkg syscall (netbsd-arm), const MAP_STACK ideal-int +pkg syscall (netbsd-arm), const MAP_TRYFIXED = 1024 +pkg syscall (netbsd-arm), const MAP_TRYFIXED ideal-int +pkg syscall (netbsd-arm), const MAP_WIRED = 2048 +pkg syscall (netbsd-arm), const MAP_WIRED ideal-int +pkg syscall (netbsd-arm), const PROT_EXEC = 4 +pkg syscall (netbsd-arm), const PROT_EXEC ideal-int +pkg syscall (netbsd-arm), const PROT_NONE = 0 +pkg syscall (netbsd-arm), const PROT_NONE ideal-int +pkg syscall (netbsd-arm), const PROT_READ = 1 +pkg syscall (netbsd-arm), const PROT_READ ideal-int +pkg syscall (netbsd-arm), const PROT_WRITE = 2 +pkg syscall (netbsd-arm), const PROT_WRITE ideal-int +pkg syscall (netbsd-arm), const SizeofIfData = 136 +pkg syscall (netbsd-arm), func Fchflags(int, int) error +pkg syscall (netbsd-arm), func FcntlFlock(uintptr, int, *Flock_t) error +pkg syscall (netbsd-arm), func SendmsgN(int, []uint8, []uint8, Sockaddr, int) (int, error) +pkg syscall (netbsd-arm), type Kevent_t struct, Pad_cgo_0 [4]uint8 +pkg syscall (netbsd-arm), type Stat_t struct, Pad_cgo_0 [4]uint8 +pkg syscall (netbsd-arm), type Stat_t struct, Pad_cgo_1 [4]uint8 +pkg syscall (netbsd-arm), type Stat_t struct, Pad_cgo_2 [4]uint8 +pkg syscall (netbsd-arm), type Termios struct +pkg syscall (netbsd-arm), type Termios struct, Cc [20]uint8 +pkg syscall (netbsd-arm), type Termios struct, Cflag uint32 +pkg syscall (netbsd-arm), type Termios struct, Iflag uint32 +pkg syscall (netbsd-arm), type Termios struct, Ispeed int32 +pkg syscall (netbsd-arm), type Termios struct, Lflag uint32 +pkg syscall (netbsd-arm), type Termios struct, Oflag uint32 +pkg syscall (netbsd-arm), type Termios struct, Ospeed int32 +pkg syscall (netbsd-arm), type Timespec struct, Pad_cgo_0 [4]uint8 +pkg syscall (netbsd-arm), type Timeval struct, Pad_cgo_0 [4]uint8 +pkg syscall (netbsd-arm-cgo), const MADV_DONTNEED = 4 +pkg syscall (netbsd-arm-cgo), const MADV_DONTNEED ideal-int +pkg syscall (netbsd-arm-cgo), const MADV_FREE = 6 +pkg syscall (netbsd-arm-cgo), const MADV_FREE ideal-int +pkg syscall (netbsd-arm-cgo), const MADV_NORMAL = 0 +pkg syscall (netbsd-arm-cgo), const MADV_NORMAL ideal-int +pkg syscall (netbsd-arm-cgo), const MADV_RANDOM = 1 +pkg syscall (netbsd-arm-cgo), const MADV_RANDOM ideal-int +pkg syscall (netbsd-arm-cgo), const MADV_SEQUENTIAL = 2 +pkg syscall (netbsd-arm-cgo), const MADV_SEQUENTIAL ideal-int +pkg syscall (netbsd-arm-cgo), const MADV_SPACEAVAIL = 5 +pkg syscall (netbsd-arm-cgo), const MADV_SPACEAVAIL ideal-int +pkg syscall (netbsd-arm-cgo), const MADV_WILLNEED = 3 +pkg syscall (netbsd-arm-cgo), const MADV_WILLNEED ideal-int +pkg syscall (netbsd-arm-cgo), const MAP_ALIGNMENT_16MB = 402653184 +pkg syscall (netbsd-arm-cgo), const MAP_ALIGNMENT_16MB ideal-int +pkg syscall (netbsd-arm-cgo), const MAP_ALIGNMENT_1TB = 671088640 +pkg syscall (netbsd-arm-cgo), const MAP_ALIGNMENT_1TB ideal-int +pkg syscall (netbsd-arm-cgo), const MAP_ALIGNMENT_256TB = 805306368 +pkg syscall (netbsd-arm-cgo), const MAP_ALIGNMENT_256TB ideal-int +pkg syscall (netbsd-arm-cgo), const MAP_ALIGNMENT_4GB = 536870912 +pkg syscall (netbsd-arm-cgo), const MAP_ALIGNMENT_4GB ideal-int +pkg syscall (netbsd-arm-cgo), const MAP_ALIGNMENT_64KB = 268435456 +pkg syscall (netbsd-arm-cgo), const MAP_ALIGNMENT_64KB ideal-int +pkg syscall (netbsd-arm-cgo), const MAP_ALIGNMENT_64PB = 939524096 +pkg syscall (netbsd-arm-cgo), const MAP_ALIGNMENT_64PB ideal-int +pkg syscall (netbsd-arm-cgo), const MAP_ALIGNMENT_MASK = -16777216 +pkg syscall (netbsd-arm-cgo), const MAP_ALIGNMENT_MASK ideal-int +pkg syscall (netbsd-arm-cgo), const MAP_ALIGNMENT_SHIFT = 24 +pkg syscall (netbsd-arm-cgo), const MAP_ALIGNMENT_SHIFT ideal-int +pkg syscall (netbsd-arm-cgo), const MAP_ANON = 4096 +pkg syscall (netbsd-arm-cgo), const MAP_ANON ideal-int +pkg syscall (netbsd-arm-cgo), const MAP_FILE = 0 +pkg syscall (netbsd-arm-cgo), const MAP_FILE ideal-int +pkg syscall (netbsd-arm-cgo), const MAP_FIXED = 16 +pkg syscall (netbsd-arm-cgo), const MAP_FIXED ideal-int +pkg syscall (netbsd-arm-cgo), const MAP_HASSEMAPHORE = 512 +pkg syscall (netbsd-arm-cgo), const MAP_HASSEMAPHORE ideal-int +pkg syscall (netbsd-arm-cgo), const MAP_INHERIT = 128 +pkg syscall (netbsd-arm-cgo), const MAP_INHERIT ideal-int +pkg syscall (netbsd-arm-cgo), const MAP_INHERIT_COPY = 1 +pkg syscall (netbsd-arm-cgo), const MAP_INHERIT_COPY ideal-int +pkg syscall (netbsd-arm-cgo), const MAP_INHERIT_DEFAULT = 1 +pkg syscall (netbsd-arm-cgo), const MAP_INHERIT_DEFAULT ideal-int +pkg syscall (netbsd-arm-cgo), const MAP_INHERIT_DONATE_COPY = 3 +pkg syscall (netbsd-arm-cgo), const MAP_INHERIT_DONATE_COPY ideal-int +pkg syscall (netbsd-arm-cgo), const MAP_INHERIT_NONE = 2 +pkg syscall (netbsd-arm-cgo), const MAP_INHERIT_NONE ideal-int +pkg syscall (netbsd-arm-cgo), const MAP_INHERIT_SHARE = 0 +pkg syscall (netbsd-arm-cgo), const MAP_INHERIT_SHARE ideal-int +pkg syscall (netbsd-arm-cgo), const MAP_NORESERVE = 64 +pkg syscall (netbsd-arm-cgo), const MAP_NORESERVE ideal-int +pkg syscall (netbsd-arm-cgo), const MAP_PRIVATE = 2 +pkg syscall (netbsd-arm-cgo), const MAP_PRIVATE ideal-int +pkg syscall (netbsd-arm-cgo), const MAP_RENAME = 32 +pkg syscall (netbsd-arm-cgo), const MAP_RENAME ideal-int +pkg syscall (netbsd-arm-cgo), const MAP_SHARED = 1 +pkg syscall (netbsd-arm-cgo), const MAP_SHARED ideal-int +pkg syscall (netbsd-arm-cgo), const MAP_STACK = 8192 +pkg syscall (netbsd-arm-cgo), const MAP_STACK ideal-int +pkg syscall (netbsd-arm-cgo), const MAP_TRYFIXED = 1024 +pkg syscall (netbsd-arm-cgo), const MAP_TRYFIXED ideal-int +pkg syscall (netbsd-arm-cgo), const MAP_WIRED = 2048 +pkg syscall (netbsd-arm-cgo), const MAP_WIRED ideal-int +pkg syscall (netbsd-arm-cgo), const PROT_EXEC = 4 +pkg syscall (netbsd-arm-cgo), const PROT_EXEC ideal-int +pkg syscall (netbsd-arm-cgo), const PROT_NONE = 0 +pkg syscall (netbsd-arm-cgo), const PROT_NONE ideal-int +pkg syscall (netbsd-arm-cgo), const PROT_READ = 1 +pkg syscall (netbsd-arm-cgo), const PROT_READ ideal-int +pkg syscall (netbsd-arm-cgo), const PROT_WRITE = 2 +pkg syscall (netbsd-arm-cgo), const PROT_WRITE ideal-int +pkg syscall (netbsd-arm-cgo), const SizeofIfData = 136 +pkg syscall (netbsd-arm-cgo), func Fchflags(int, int) error +pkg syscall (netbsd-arm-cgo), func FcntlFlock(uintptr, int, *Flock_t) error +pkg syscall (netbsd-arm-cgo), func SendmsgN(int, []uint8, []uint8, Sockaddr, int) (int, error) +pkg syscall (netbsd-arm-cgo), type Kevent_t struct, Pad_cgo_0 [4]uint8 +pkg syscall (netbsd-arm-cgo), type Stat_t struct, Pad_cgo_0 [4]uint8 +pkg syscall (netbsd-arm-cgo), type Stat_t struct, Pad_cgo_1 [4]uint8 +pkg syscall (netbsd-arm-cgo), type Stat_t struct, Pad_cgo_2 [4]uint8 +pkg syscall (netbsd-arm-cgo), type Termios struct +pkg syscall (netbsd-arm-cgo), type Termios struct, Cc [20]uint8 +pkg syscall (netbsd-arm-cgo), type Termios struct, Cflag uint32 +pkg syscall (netbsd-arm-cgo), type Termios struct, Iflag uint32 +pkg syscall (netbsd-arm-cgo), type Termios struct, Ispeed int32 +pkg syscall (netbsd-arm-cgo), type Termios struct, Lflag uint32 +pkg syscall (netbsd-arm-cgo), type Termios struct, Oflag uint32 +pkg syscall (netbsd-arm-cgo), type Termios struct, Ospeed int32 +pkg syscall (netbsd-arm-cgo), type Timespec struct, Pad_cgo_0 [4]uint8 +pkg syscall (netbsd-arm-cgo), type Timeval struct, Pad_cgo_0 [4]uint8 +pkg syscall (openbsd-386), const BIOCGRTIMEOUT = 1074545262 +pkg syscall (openbsd-386), const BIOCSRTIMEOUT = 2148287085 +pkg syscall (openbsd-386), const IPPROTO_DIVERT_INIT = 2 +pkg syscall (openbsd-386), const IPPROTO_DIVERT_INIT ideal-int +pkg syscall (openbsd-386), const IPPROTO_DIVERT_RESP = 1 +pkg syscall (openbsd-386), const IPPROTO_DIVERT_RESP ideal-int +pkg syscall (openbsd-386), const IPV6_RECVDSTPORT = 64 +pkg syscall (openbsd-386), const IPV6_RECVDSTPORT ideal-int +pkg syscall (openbsd-386), const IP_DIVERTFL = 4130 +pkg syscall (openbsd-386), const IP_DIVERTFL ideal-int +pkg syscall (openbsd-386), const MADV_DONTNEED = 4 +pkg syscall (openbsd-386), const MADV_DONTNEED ideal-int +pkg syscall (openbsd-386), const MADV_FREE = 6 +pkg syscall (openbsd-386), const MADV_FREE ideal-int +pkg syscall (openbsd-386), const MADV_NORMAL = 0 +pkg syscall (openbsd-386), const MADV_NORMAL ideal-int +pkg syscall (openbsd-386), const MADV_RANDOM = 1 +pkg syscall (openbsd-386), const MADV_RANDOM ideal-int +pkg syscall (openbsd-386), const MADV_SEQUENTIAL = 2 +pkg syscall (openbsd-386), const MADV_SEQUENTIAL ideal-int +pkg syscall (openbsd-386), const MADV_SPACEAVAIL = 5 +pkg syscall (openbsd-386), const MADV_SPACEAVAIL ideal-int +pkg syscall (openbsd-386), const MADV_WILLNEED = 3 +pkg syscall (openbsd-386), const MADV_WILLNEED ideal-int +pkg syscall (openbsd-386), const MAP_ANON = 4096 +pkg syscall (openbsd-386), const MAP_ANON ideal-int +pkg syscall (openbsd-386), const MAP_COPY = 4 +pkg syscall (openbsd-386), const MAP_COPY ideal-int +pkg syscall (openbsd-386), const MAP_FILE = 0 +pkg syscall (openbsd-386), const MAP_FILE ideal-int +pkg syscall (openbsd-386), const MAP_FIXED = 16 +pkg syscall (openbsd-386), const MAP_FIXED ideal-int +pkg syscall (openbsd-386), const MAP_FLAGMASK = 8183 +pkg syscall (openbsd-386), const MAP_FLAGMASK ideal-int +pkg syscall (openbsd-386), const MAP_HASSEMAPHORE = 512 +pkg syscall (openbsd-386), const MAP_HASSEMAPHORE ideal-int +pkg syscall (openbsd-386), const MAP_INHERIT = 128 +pkg syscall (openbsd-386), const MAP_INHERIT ideal-int +pkg syscall (openbsd-386), const MAP_INHERIT_COPY = 1 +pkg syscall (openbsd-386), const MAP_INHERIT_COPY ideal-int +pkg syscall (openbsd-386), const MAP_INHERIT_DONATE_COPY = 3 +pkg syscall (openbsd-386), const MAP_INHERIT_DONATE_COPY ideal-int +pkg syscall (openbsd-386), const MAP_INHERIT_NONE = 2 +pkg syscall (openbsd-386), const MAP_INHERIT_NONE ideal-int +pkg syscall (openbsd-386), const MAP_INHERIT_SHARE = 0 +pkg syscall (openbsd-386), const MAP_INHERIT_SHARE ideal-int +pkg syscall (openbsd-386), const MAP_NOEXTEND = 256 +pkg syscall (openbsd-386), const MAP_NOEXTEND ideal-int +pkg syscall (openbsd-386), const MAP_NORESERVE = 64 +pkg syscall (openbsd-386), const MAP_NORESERVE ideal-int +pkg syscall (openbsd-386), const MAP_PRIVATE = 2 +pkg syscall (openbsd-386), const MAP_PRIVATE ideal-int +pkg syscall (openbsd-386), const MAP_RENAME = 32 +pkg syscall (openbsd-386), const MAP_RENAME ideal-int +pkg syscall (openbsd-386), const MAP_SHARED = 1 +pkg syscall (openbsd-386), const MAP_SHARED ideal-int +pkg syscall (openbsd-386), const MAP_TRYFIXED = 1024 +pkg syscall (openbsd-386), const MAP_TRYFIXED ideal-int +pkg syscall (openbsd-386), const MCL_CURRENT = 1 +pkg syscall (openbsd-386), const MCL_CURRENT ideal-int +pkg syscall (openbsd-386), const MCL_FUTURE = 2 +pkg syscall (openbsd-386), const MCL_FUTURE ideal-int +pkg syscall (openbsd-386), const MS_ASYNC = 1 +pkg syscall (openbsd-386), const MS_ASYNC ideal-int +pkg syscall (openbsd-386), const MS_INVALIDATE = 4 +pkg syscall (openbsd-386), const MS_INVALIDATE ideal-int +pkg syscall (openbsd-386), const MS_SYNC = 2 +pkg syscall (openbsd-386), const MS_SYNC ideal-int +pkg syscall (openbsd-386), const PROT_EXEC = 4 +pkg syscall (openbsd-386), const PROT_EXEC ideal-int +pkg syscall (openbsd-386), const PROT_NONE = 0 +pkg syscall (openbsd-386), const PROT_NONE ideal-int +pkg syscall (openbsd-386), const PROT_READ = 1 +pkg syscall (openbsd-386), const PROT_READ ideal-int +pkg syscall (openbsd-386), const PROT_WRITE = 2 +pkg syscall (openbsd-386), const PROT_WRITE ideal-int +pkg syscall (openbsd-386), const RTF_FMASK = 1112072 +pkg syscall (openbsd-386), const RTM_VERSION = 5 +pkg syscall (openbsd-386), const SIOCBRDGDADDR = 2166909255 +pkg syscall (openbsd-386), const SIOCBRDGGPARAM = 3225184600 +pkg syscall (openbsd-386), const SIOCBRDGSADDR = 3240651076 +pkg syscall (openbsd-386), const SIOCGETVLAN = 3223349648 +pkg syscall (openbsd-386), const SIOCGETVLAN ideal-int +pkg syscall (openbsd-386), const SIOCGIFHARDMTU = 3223349669 +pkg syscall (openbsd-386), const SIOCGIFHARDMTU ideal-int +pkg syscall (openbsd-386), const SIOCGLIFPHYTTL = 3223349673 +pkg syscall (openbsd-386), const SIOCGLIFPHYTTL ideal-int +pkg syscall (openbsd-386), const SIOCGSPPPPARAMS = 3223349652 +pkg syscall (openbsd-386), const SIOCGSPPPPARAMS ideal-int +pkg syscall (openbsd-386), const SIOCGVNETID = 3223349671 +pkg syscall (openbsd-386), const SIOCGVNETID ideal-int +pkg syscall (openbsd-386), const SIOCSETVLAN = 2149607823 +pkg syscall (openbsd-386), const SIOCSETVLAN ideal-int +pkg syscall (openbsd-386), const SIOCSLIFPHYTTL = 2149607848 +pkg syscall (openbsd-386), const SIOCSLIFPHYTTL ideal-int +pkg syscall (openbsd-386), const SIOCSSPPPPARAMS = 2149607827 +pkg syscall (openbsd-386), const SIOCSSPPPPARAMS ideal-int +pkg syscall (openbsd-386), const SIOCSVNETID = 2149607846 +pkg syscall (openbsd-386), const SIOCSVNETID ideal-int +pkg syscall (openbsd-386), const SYS_CLOCK_GETRES = 89 +pkg syscall (openbsd-386), const SYS_CLOCK_GETTIME = 87 +pkg syscall (openbsd-386), const SYS_CLOCK_SETTIME = 88 +pkg syscall (openbsd-386), const SYS_FHSTATFS = 65 +pkg syscall (openbsd-386), const SYS_FSTAT = 53 +pkg syscall (openbsd-386), const SYS_FSTATAT = 42 +pkg syscall (openbsd-386), const SYS_FSTATFS = 64 +pkg syscall (openbsd-386), const SYS_FUTIMENS = 85 +pkg syscall (openbsd-386), const SYS_FUTIMES = 77 +pkg syscall (openbsd-386), const SYS_GETDENTS = 99 +pkg syscall (openbsd-386), const SYS_GETDENTS ideal-int +pkg syscall (openbsd-386), const SYS_GETFSSTAT = 62 +pkg syscall (openbsd-386), const SYS_GETITIMER = 70 +pkg syscall (openbsd-386), const SYS_GETRUSAGE = 19 +pkg syscall (openbsd-386), const SYS_GETTIMEOFDAY = 67 +pkg syscall (openbsd-386), const SYS_KEVENT = 72 +pkg syscall (openbsd-386), const SYS_LSTAT = 40 +pkg syscall (openbsd-386), const SYS_NANOSLEEP = 91 +pkg syscall (openbsd-386), const SYS_PPOLL = 109 +pkg syscall (openbsd-386), const SYS_PPOLL ideal-int +pkg syscall (openbsd-386), const SYS_PSELECT = 110 +pkg syscall (openbsd-386), const SYS_PSELECT ideal-int +pkg syscall (openbsd-386), const SYS_SELECT = 71 +pkg syscall (openbsd-386), const SYS_SETITIMER = 69 +pkg syscall (openbsd-386), const SYS_SETTIMEOFDAY = 68 +pkg syscall (openbsd-386), const SYS_STAT = 38 +pkg syscall (openbsd-386), const SYS_STATFS = 63 +pkg syscall (openbsd-386), const SYS_UTIMENSAT = 84 +pkg syscall (openbsd-386), const SYS_UTIMES = 76 +pkg syscall (openbsd-386), const SYS_UTRACE = 209 +pkg syscall (openbsd-386), const SYS_UTRACE ideal-int +pkg syscall (openbsd-386), const SYS_WAIT4 = 11 +pkg syscall (openbsd-386), const SYS___THRSLEEP = 94 +pkg syscall (openbsd-386), const SizeofIfData = 212 +pkg syscall (openbsd-386), const SizeofIfMsghdr = 236 +pkg syscall (openbsd-386), const SizeofRtMetrics = 56 +pkg syscall (openbsd-386), const SizeofRtMsghdr = 96 +pkg syscall (openbsd-386), const TCP_NOPUSH = 16 +pkg syscall (openbsd-386), const TCP_NOPUSH ideal-int +pkg syscall (openbsd-386), const TIOCGSID = 1074033763 +pkg syscall (openbsd-386), const TIOCGSID ideal-int +pkg syscall (openbsd-386), const TIOCGTSTAMP = 1074558043 +pkg syscall (openbsd-386), func FcntlFlock(uintptr, int, *Flock_t) error +pkg syscall (openbsd-386), func SendmsgN(int, []uint8, []uint8, Sockaddr, int) (int, error) +pkg syscall (openbsd-386), type Dirent struct, Fileno uint64 +pkg syscall (openbsd-386), type Dirent struct, Off int64 +pkg syscall (openbsd-386), type Dirent struct, X__d_padding [4]uint8 +pkg syscall (openbsd-386), type FdSet struct, Bits [32]uint32 +pkg syscall (openbsd-386), type Kevent_t struct, Data int64 +pkg syscall (openbsd-386), type Mclpool struct, Grown int32 +pkg syscall (openbsd-386), type RtMetrics struct, Expire int64 +pkg syscall (openbsd-386), type RtMetrics struct, Pad uint32 +pkg syscall (openbsd-386), type Stat_t struct, Ino uint64 +pkg syscall (openbsd-386), type Statfs_t struct, F_ctime uint64 +pkg syscall (openbsd-386), type Statfs_t struct, F_mntfromspec [90]int8 +pkg syscall (openbsd-386), type Statfs_t struct, Pad_cgo_0 [2]uint8 +pkg syscall (openbsd-386), type Termios struct +pkg syscall (openbsd-386), type Termios struct, Cc [20]uint8 +pkg syscall (openbsd-386), type Termios struct, Cflag uint32 +pkg syscall (openbsd-386), type Termios struct, Iflag uint32 +pkg syscall (openbsd-386), type Termios struct, Ispeed int32 +pkg syscall (openbsd-386), type Termios struct, Lflag uint32 +pkg syscall (openbsd-386), type Termios struct, Oflag uint32 +pkg syscall (openbsd-386), type Termios struct, Ospeed int32 +pkg syscall (openbsd-386), type Timespec struct, Sec int64 +pkg syscall (openbsd-386), type Timeval struct, Sec int64 +pkg syscall (openbsd-386-cgo), const BIOCGRTIMEOUT = 1074545262 +pkg syscall (openbsd-386-cgo), const BIOCSRTIMEOUT = 2148287085 +pkg syscall (openbsd-386-cgo), const IPPROTO_DIVERT_INIT = 2 +pkg syscall (openbsd-386-cgo), const IPPROTO_DIVERT_INIT ideal-int +pkg syscall (openbsd-386-cgo), const IPPROTO_DIVERT_RESP = 1 +pkg syscall (openbsd-386-cgo), const IPPROTO_DIVERT_RESP ideal-int +pkg syscall (openbsd-386-cgo), const IPV6_RECVDSTPORT = 64 +pkg syscall (openbsd-386-cgo), const IPV6_RECVDSTPORT ideal-int +pkg syscall (openbsd-386-cgo), const IP_DIVERTFL = 4130 +pkg syscall (openbsd-386-cgo), const IP_DIVERTFL ideal-int +pkg syscall (openbsd-386-cgo), const MADV_DONTNEED = 4 +pkg syscall (openbsd-386-cgo), const MADV_DONTNEED ideal-int +pkg syscall (openbsd-386-cgo), const MADV_FREE = 6 +pkg syscall (openbsd-386-cgo), const MADV_FREE ideal-int +pkg syscall (openbsd-386-cgo), const MADV_NORMAL = 0 +pkg syscall (openbsd-386-cgo), const MADV_NORMAL ideal-int +pkg syscall (openbsd-386-cgo), const MADV_RANDOM = 1 +pkg syscall (openbsd-386-cgo), const MADV_RANDOM ideal-int +pkg syscall (openbsd-386-cgo), const MADV_SEQUENTIAL = 2 +pkg syscall (openbsd-386-cgo), const MADV_SEQUENTIAL ideal-int +pkg syscall (openbsd-386-cgo), const MADV_SPACEAVAIL = 5 +pkg syscall (openbsd-386-cgo), const MADV_SPACEAVAIL ideal-int +pkg syscall (openbsd-386-cgo), const MADV_WILLNEED = 3 +pkg syscall (openbsd-386-cgo), const MADV_WILLNEED ideal-int +pkg syscall (openbsd-386-cgo), const MAP_ANON = 4096 +pkg syscall (openbsd-386-cgo), const MAP_ANON ideal-int +pkg syscall (openbsd-386-cgo), const MAP_COPY = 4 +pkg syscall (openbsd-386-cgo), const MAP_COPY ideal-int +pkg syscall (openbsd-386-cgo), const MAP_FILE = 0 +pkg syscall (openbsd-386-cgo), const MAP_FILE ideal-int +pkg syscall (openbsd-386-cgo), const MAP_FIXED = 16 +pkg syscall (openbsd-386-cgo), const MAP_FIXED ideal-int +pkg syscall (openbsd-386-cgo), const MAP_FLAGMASK = 8183 +pkg syscall (openbsd-386-cgo), const MAP_FLAGMASK ideal-int +pkg syscall (openbsd-386-cgo), const MAP_HASSEMAPHORE = 512 +pkg syscall (openbsd-386-cgo), const MAP_HASSEMAPHORE ideal-int +pkg syscall (openbsd-386-cgo), const MAP_INHERIT = 128 +pkg syscall (openbsd-386-cgo), const MAP_INHERIT ideal-int +pkg syscall (openbsd-386-cgo), const MAP_INHERIT_COPY = 1 +pkg syscall (openbsd-386-cgo), const MAP_INHERIT_COPY ideal-int +pkg syscall (openbsd-386-cgo), const MAP_INHERIT_DONATE_COPY = 3 +pkg syscall (openbsd-386-cgo), const MAP_INHERIT_DONATE_COPY ideal-int +pkg syscall (openbsd-386-cgo), const MAP_INHERIT_NONE = 2 +pkg syscall (openbsd-386-cgo), const MAP_INHERIT_NONE ideal-int +pkg syscall (openbsd-386-cgo), const MAP_INHERIT_SHARE = 0 +pkg syscall (openbsd-386-cgo), const MAP_INHERIT_SHARE ideal-int +pkg syscall (openbsd-386-cgo), const MAP_NOEXTEND = 256 +pkg syscall (openbsd-386-cgo), const MAP_NOEXTEND ideal-int +pkg syscall (openbsd-386-cgo), const MAP_NORESERVE = 64 +pkg syscall (openbsd-386-cgo), const MAP_NORESERVE ideal-int +pkg syscall (openbsd-386-cgo), const MAP_PRIVATE = 2 +pkg syscall (openbsd-386-cgo), const MAP_PRIVATE ideal-int +pkg syscall (openbsd-386-cgo), const MAP_RENAME = 32 +pkg syscall (openbsd-386-cgo), const MAP_RENAME ideal-int +pkg syscall (openbsd-386-cgo), const MAP_SHARED = 1 +pkg syscall (openbsd-386-cgo), const MAP_SHARED ideal-int +pkg syscall (openbsd-386-cgo), const MAP_TRYFIXED = 1024 +pkg syscall (openbsd-386-cgo), const MAP_TRYFIXED ideal-int +pkg syscall (openbsd-386-cgo), const MCL_CURRENT = 1 +pkg syscall (openbsd-386-cgo), const MCL_CURRENT ideal-int +pkg syscall (openbsd-386-cgo), const MCL_FUTURE = 2 +pkg syscall (openbsd-386-cgo), const MCL_FUTURE ideal-int +pkg syscall (openbsd-386-cgo), const MS_ASYNC = 1 +pkg syscall (openbsd-386-cgo), const MS_ASYNC ideal-int +pkg syscall (openbsd-386-cgo), const MS_INVALIDATE = 4 +pkg syscall (openbsd-386-cgo), const MS_INVALIDATE ideal-int +pkg syscall (openbsd-386-cgo), const MS_SYNC = 2 +pkg syscall (openbsd-386-cgo), const MS_SYNC ideal-int +pkg syscall (openbsd-386-cgo), const PROT_EXEC = 4 +pkg syscall (openbsd-386-cgo), const PROT_EXEC ideal-int +pkg syscall (openbsd-386-cgo), const PROT_NONE = 0 +pkg syscall (openbsd-386-cgo), const PROT_NONE ideal-int +pkg syscall (openbsd-386-cgo), const PROT_READ = 1 +pkg syscall (openbsd-386-cgo), const PROT_READ ideal-int +pkg syscall (openbsd-386-cgo), const PROT_WRITE = 2 +pkg syscall (openbsd-386-cgo), const PROT_WRITE ideal-int +pkg syscall (openbsd-386-cgo), const RTF_FMASK = 1112072 +pkg syscall (openbsd-386-cgo), const RTM_VERSION = 5 +pkg syscall (openbsd-386-cgo), const SIOCBRDGDADDR = 2166909255 +pkg syscall (openbsd-386-cgo), const SIOCBRDGGPARAM = 3225184600 +pkg syscall (openbsd-386-cgo), const SIOCBRDGSADDR = 3240651076 +pkg syscall (openbsd-386-cgo), const SIOCGETVLAN = 3223349648 +pkg syscall (openbsd-386-cgo), const SIOCGETVLAN ideal-int +pkg syscall (openbsd-386-cgo), const SIOCGIFHARDMTU = 3223349669 +pkg syscall (openbsd-386-cgo), const SIOCGIFHARDMTU ideal-int +pkg syscall (openbsd-386-cgo), const SIOCGLIFPHYTTL = 3223349673 +pkg syscall (openbsd-386-cgo), const SIOCGLIFPHYTTL ideal-int +pkg syscall (openbsd-386-cgo), const SIOCGSPPPPARAMS = 3223349652 +pkg syscall (openbsd-386-cgo), const SIOCGSPPPPARAMS ideal-int +pkg syscall (openbsd-386-cgo), const SIOCGVNETID = 3223349671 +pkg syscall (openbsd-386-cgo), const SIOCGVNETID ideal-int +pkg syscall (openbsd-386-cgo), const SIOCSETVLAN = 2149607823 +pkg syscall (openbsd-386-cgo), const SIOCSETVLAN ideal-int +pkg syscall (openbsd-386-cgo), const SIOCSLIFPHYTTL = 2149607848 +pkg syscall (openbsd-386-cgo), const SIOCSLIFPHYTTL ideal-int +pkg syscall (openbsd-386-cgo), const SIOCSSPPPPARAMS = 2149607827 +pkg syscall (openbsd-386-cgo), const SIOCSSPPPPARAMS ideal-int +pkg syscall (openbsd-386-cgo), const SIOCSVNETID = 2149607846 +pkg syscall (openbsd-386-cgo), const SIOCSVNETID ideal-int +pkg syscall (openbsd-386-cgo), const SYS_CLOCK_GETRES = 89 +pkg syscall (openbsd-386-cgo), const SYS_CLOCK_GETTIME = 87 +pkg syscall (openbsd-386-cgo), const SYS_CLOCK_SETTIME = 88 +pkg syscall (openbsd-386-cgo), const SYS_FHSTATFS = 65 +pkg syscall (openbsd-386-cgo), const SYS_FSTAT = 53 +pkg syscall (openbsd-386-cgo), const SYS_FSTATAT = 42 +pkg syscall (openbsd-386-cgo), const SYS_FSTATFS = 64 +pkg syscall (openbsd-386-cgo), const SYS_FUTIMENS = 85 +pkg syscall (openbsd-386-cgo), const SYS_FUTIMES = 77 +pkg syscall (openbsd-386-cgo), const SYS_GETDENTS = 99 +pkg syscall (openbsd-386-cgo), const SYS_GETDENTS ideal-int +pkg syscall (openbsd-386-cgo), const SYS_GETFSSTAT = 62 +pkg syscall (openbsd-386-cgo), const SYS_GETITIMER = 70 +pkg syscall (openbsd-386-cgo), const SYS_GETRUSAGE = 19 +pkg syscall (openbsd-386-cgo), const SYS_GETTIMEOFDAY = 67 +pkg syscall (openbsd-386-cgo), const SYS_KEVENT = 72 +pkg syscall (openbsd-386-cgo), const SYS_LSTAT = 40 +pkg syscall (openbsd-386-cgo), const SYS_NANOSLEEP = 91 +pkg syscall (openbsd-386-cgo), const SYS_PPOLL = 109 +pkg syscall (openbsd-386-cgo), const SYS_PPOLL ideal-int +pkg syscall (openbsd-386-cgo), const SYS_PSELECT = 110 +pkg syscall (openbsd-386-cgo), const SYS_PSELECT ideal-int +pkg syscall (openbsd-386-cgo), const SYS_SELECT = 71 +pkg syscall (openbsd-386-cgo), const SYS_SETITIMER = 69 +pkg syscall (openbsd-386-cgo), const SYS_SETTIMEOFDAY = 68 +pkg syscall (openbsd-386-cgo), const SYS_STAT = 38 +pkg syscall (openbsd-386-cgo), const SYS_STATFS = 63 +pkg syscall (openbsd-386-cgo), const SYS_UTIMENSAT = 84 +pkg syscall (openbsd-386-cgo), const SYS_UTIMES = 76 +pkg syscall (openbsd-386-cgo), const SYS_UTRACE = 209 +pkg syscall (openbsd-386-cgo), const SYS_UTRACE ideal-int +pkg syscall (openbsd-386-cgo), const SYS_WAIT4 = 11 +pkg syscall (openbsd-386-cgo), const SYS___THRSLEEP = 94 +pkg syscall (openbsd-386-cgo), const SizeofIfData = 212 +pkg syscall (openbsd-386-cgo), const SizeofIfMsghdr = 236 +pkg syscall (openbsd-386-cgo), const SizeofRtMetrics = 56 +pkg syscall (openbsd-386-cgo), const SizeofRtMsghdr = 96 +pkg syscall (openbsd-386-cgo), const TCP_NOPUSH = 16 +pkg syscall (openbsd-386-cgo), const TCP_NOPUSH ideal-int +pkg syscall (openbsd-386-cgo), const TIOCGSID = 1074033763 +pkg syscall (openbsd-386-cgo), const TIOCGSID ideal-int +pkg syscall (openbsd-386-cgo), const TIOCGTSTAMP = 1074558043 +pkg syscall (openbsd-386-cgo), func FcntlFlock(uintptr, int, *Flock_t) error +pkg syscall (openbsd-386-cgo), func SendmsgN(int, []uint8, []uint8, Sockaddr, int) (int, error) +pkg syscall (openbsd-386-cgo), type Dirent struct, Fileno uint64 +pkg syscall (openbsd-386-cgo), type Dirent struct, Off int64 +pkg syscall (openbsd-386-cgo), type Dirent struct, X__d_padding [4]uint8 +pkg syscall (openbsd-386-cgo), type FdSet struct, Bits [32]uint32 +pkg syscall (openbsd-386-cgo), type Kevent_t struct, Data int64 +pkg syscall (openbsd-386-cgo), type Mclpool struct, Grown int32 +pkg syscall (openbsd-386-cgo), type RtMetrics struct, Expire int64 +pkg syscall (openbsd-386-cgo), type RtMetrics struct, Pad uint32 +pkg syscall (openbsd-386-cgo), type Stat_t struct, Ino uint64 +pkg syscall (openbsd-386-cgo), type Statfs_t struct, F_ctime uint64 +pkg syscall (openbsd-386-cgo), type Statfs_t struct, F_mntfromspec [90]int8 +pkg syscall (openbsd-386-cgo), type Statfs_t struct, Pad_cgo_0 [2]uint8 +pkg syscall (openbsd-386-cgo), type Termios struct +pkg syscall (openbsd-386-cgo), type Termios struct, Cc [20]uint8 +pkg syscall (openbsd-386-cgo), type Termios struct, Cflag uint32 +pkg syscall (openbsd-386-cgo), type Termios struct, Iflag uint32 +pkg syscall (openbsd-386-cgo), type Termios struct, Ispeed int32 +pkg syscall (openbsd-386-cgo), type Termios struct, Lflag uint32 +pkg syscall (openbsd-386-cgo), type Termios struct, Oflag uint32 +pkg syscall (openbsd-386-cgo), type Termios struct, Ospeed int32 +pkg syscall (openbsd-386-cgo), type Timespec struct, Sec int64 +pkg syscall (openbsd-386-cgo), type Timeval struct, Sec int64 +pkg syscall (openbsd-amd64), const IPPROTO_DIVERT_INIT = 2 +pkg syscall (openbsd-amd64), const IPPROTO_DIVERT_INIT ideal-int +pkg syscall (openbsd-amd64), const IPPROTO_DIVERT_RESP = 1 +pkg syscall (openbsd-amd64), const IPPROTO_DIVERT_RESP ideal-int +pkg syscall (openbsd-amd64), const IPV6_RECVDSTPORT = 64 +pkg syscall (openbsd-amd64), const IPV6_RECVDSTPORT ideal-int +pkg syscall (openbsd-amd64), const IP_DIVERTFL = 4130 +pkg syscall (openbsd-amd64), const IP_DIVERTFL ideal-int +pkg syscall (openbsd-amd64), const MADV_DONTNEED = 4 +pkg syscall (openbsd-amd64), const MADV_DONTNEED ideal-int +pkg syscall (openbsd-amd64), const MADV_FREE = 6 +pkg syscall (openbsd-amd64), const MADV_FREE ideal-int +pkg syscall (openbsd-amd64), const MADV_NORMAL = 0 +pkg syscall (openbsd-amd64), const MADV_NORMAL ideal-int +pkg syscall (openbsd-amd64), const MADV_RANDOM = 1 +pkg syscall (openbsd-amd64), const MADV_RANDOM ideal-int +pkg syscall (openbsd-amd64), const MADV_SEQUENTIAL = 2 +pkg syscall (openbsd-amd64), const MADV_SEQUENTIAL ideal-int +pkg syscall (openbsd-amd64), const MADV_SPACEAVAIL = 5 +pkg syscall (openbsd-amd64), const MADV_SPACEAVAIL ideal-int +pkg syscall (openbsd-amd64), const MADV_WILLNEED = 3 +pkg syscall (openbsd-amd64), const MADV_WILLNEED ideal-int +pkg syscall (openbsd-amd64), const MAP_ANON = 4096 +pkg syscall (openbsd-amd64), const MAP_ANON ideal-int +pkg syscall (openbsd-amd64), const MAP_COPY = 4 +pkg syscall (openbsd-amd64), const MAP_COPY ideal-int +pkg syscall (openbsd-amd64), const MAP_FILE = 0 +pkg syscall (openbsd-amd64), const MAP_FILE ideal-int +pkg syscall (openbsd-amd64), const MAP_FIXED = 16 +pkg syscall (openbsd-amd64), const MAP_FIXED ideal-int +pkg syscall (openbsd-amd64), const MAP_FLAGMASK = 8183 +pkg syscall (openbsd-amd64), const MAP_FLAGMASK ideal-int +pkg syscall (openbsd-amd64), const MAP_HASSEMAPHORE = 512 +pkg syscall (openbsd-amd64), const MAP_HASSEMAPHORE ideal-int +pkg syscall (openbsd-amd64), const MAP_INHERIT = 128 +pkg syscall (openbsd-amd64), const MAP_INHERIT ideal-int +pkg syscall (openbsd-amd64), const MAP_INHERIT_COPY = 1 +pkg syscall (openbsd-amd64), const MAP_INHERIT_COPY ideal-int +pkg syscall (openbsd-amd64), const MAP_INHERIT_DONATE_COPY = 3 +pkg syscall (openbsd-amd64), const MAP_INHERIT_DONATE_COPY ideal-int +pkg syscall (openbsd-amd64), const MAP_INHERIT_NONE = 2 +pkg syscall (openbsd-amd64), const MAP_INHERIT_NONE ideal-int +pkg syscall (openbsd-amd64), const MAP_INHERIT_SHARE = 0 +pkg syscall (openbsd-amd64), const MAP_INHERIT_SHARE ideal-int +pkg syscall (openbsd-amd64), const MAP_NOEXTEND = 256 +pkg syscall (openbsd-amd64), const MAP_NOEXTEND ideal-int +pkg syscall (openbsd-amd64), const MAP_NORESERVE = 64 +pkg syscall (openbsd-amd64), const MAP_NORESERVE ideal-int +pkg syscall (openbsd-amd64), const MAP_PRIVATE = 2 +pkg syscall (openbsd-amd64), const MAP_PRIVATE ideal-int +pkg syscall (openbsd-amd64), const MAP_RENAME = 32 +pkg syscall (openbsd-amd64), const MAP_RENAME ideal-int +pkg syscall (openbsd-amd64), const MAP_SHARED = 1 +pkg syscall (openbsd-amd64), const MAP_SHARED ideal-int +pkg syscall (openbsd-amd64), const MAP_TRYFIXED = 1024 +pkg syscall (openbsd-amd64), const MAP_TRYFIXED ideal-int +pkg syscall (openbsd-amd64), const MCL_CURRENT = 1 +pkg syscall (openbsd-amd64), const MCL_CURRENT ideal-int +pkg syscall (openbsd-amd64), const MCL_FUTURE = 2 +pkg syscall (openbsd-amd64), const MCL_FUTURE ideal-int +pkg syscall (openbsd-amd64), const MS_ASYNC = 1 +pkg syscall (openbsd-amd64), const MS_ASYNC ideal-int +pkg syscall (openbsd-amd64), const MS_INVALIDATE = 4 +pkg syscall (openbsd-amd64), const MS_INVALIDATE ideal-int +pkg syscall (openbsd-amd64), const MS_SYNC = 2 +pkg syscall (openbsd-amd64), const MS_SYNC ideal-int +pkg syscall (openbsd-amd64), const PROT_EXEC = 4 +pkg syscall (openbsd-amd64), const PROT_EXEC ideal-int +pkg syscall (openbsd-amd64), const PROT_NONE = 0 +pkg syscall (openbsd-amd64), const PROT_NONE ideal-int +pkg syscall (openbsd-amd64), const PROT_READ = 1 +pkg syscall (openbsd-amd64), const PROT_READ ideal-int +pkg syscall (openbsd-amd64), const PROT_WRITE = 2 +pkg syscall (openbsd-amd64), const PROT_WRITE ideal-int +pkg syscall (openbsd-amd64), const RTF_FMASK = 1112072 +pkg syscall (openbsd-amd64), const RTM_VERSION = 5 +pkg syscall (openbsd-amd64), const SIOCBRDGDADDR = 2166909255 +pkg syscall (openbsd-amd64), const SIOCBRDGSADDR = 3240651076 +pkg syscall (openbsd-amd64), const SIOCGETVLAN = 3223349648 +pkg syscall (openbsd-amd64), const SIOCGETVLAN ideal-int +pkg syscall (openbsd-amd64), const SIOCGIFHARDMTU = 3223349669 +pkg syscall (openbsd-amd64), const SIOCGIFHARDMTU ideal-int +pkg syscall (openbsd-amd64), const SIOCGLIFPHYTTL = 3223349673 +pkg syscall (openbsd-amd64), const SIOCGLIFPHYTTL ideal-int +pkg syscall (openbsd-amd64), const SIOCGSPPPPARAMS = 3223349652 +pkg syscall (openbsd-amd64), const SIOCGSPPPPARAMS ideal-int +pkg syscall (openbsd-amd64), const SIOCGVNETID = 3223349671 +pkg syscall (openbsd-amd64), const SIOCGVNETID ideal-int +pkg syscall (openbsd-amd64), const SIOCSETVLAN = 2149607823 +pkg syscall (openbsd-amd64), const SIOCSETVLAN ideal-int +pkg syscall (openbsd-amd64), const SIOCSLIFPHYTTL = 2149607848 +pkg syscall (openbsd-amd64), const SIOCSLIFPHYTTL ideal-int +pkg syscall (openbsd-amd64), const SIOCSSPPPPARAMS = 2149607827 +pkg syscall (openbsd-amd64), const SIOCSSPPPPARAMS ideal-int +pkg syscall (openbsd-amd64), const SIOCSVNETID = 2149607846 +pkg syscall (openbsd-amd64), const SIOCSVNETID ideal-int +pkg syscall (openbsd-amd64), const SYS_CLOCK_GETRES = 89 +pkg syscall (openbsd-amd64), const SYS_CLOCK_GETTIME = 87 +pkg syscall (openbsd-amd64), const SYS_CLOCK_SETTIME = 88 +pkg syscall (openbsd-amd64), const SYS_FHSTATFS = 65 +pkg syscall (openbsd-amd64), const SYS_FSTAT = 53 +pkg syscall (openbsd-amd64), const SYS_FSTATAT = 42 +pkg syscall (openbsd-amd64), const SYS_FSTATFS = 64 +pkg syscall (openbsd-amd64), const SYS_FUTIMENS = 85 +pkg syscall (openbsd-amd64), const SYS_FUTIMES = 77 +pkg syscall (openbsd-amd64), const SYS_GETDENTS = 99 +pkg syscall (openbsd-amd64), const SYS_GETDENTS ideal-int +pkg syscall (openbsd-amd64), const SYS_GETFSSTAT = 62 +pkg syscall (openbsd-amd64), const SYS_GETITIMER = 70 +pkg syscall (openbsd-amd64), const SYS_GETRUSAGE = 19 +pkg syscall (openbsd-amd64), const SYS_GETTIMEOFDAY = 67 +pkg syscall (openbsd-amd64), const SYS_KEVENT = 72 +pkg syscall (openbsd-amd64), const SYS_LSTAT = 40 +pkg syscall (openbsd-amd64), const SYS_NANOSLEEP = 91 +pkg syscall (openbsd-amd64), const SYS_PPOLL = 109 +pkg syscall (openbsd-amd64), const SYS_PPOLL ideal-int +pkg syscall (openbsd-amd64), const SYS_PSELECT = 110 +pkg syscall (openbsd-amd64), const SYS_PSELECT ideal-int +pkg syscall (openbsd-amd64), const SYS_SELECT = 71 +pkg syscall (openbsd-amd64), const SYS_SETITIMER = 69 +pkg syscall (openbsd-amd64), const SYS_SETTIMEOFDAY = 68 +pkg syscall (openbsd-amd64), const SYS_STAT = 38 +pkg syscall (openbsd-amd64), const SYS_STATFS = 63 +pkg syscall (openbsd-amd64), const SYS_UTIMENSAT = 84 +pkg syscall (openbsd-amd64), const SYS_UTIMES = 76 +pkg syscall (openbsd-amd64), const SYS_UTRACE = 209 +pkg syscall (openbsd-amd64), const SYS_UTRACE ideal-int +pkg syscall (openbsd-amd64), const SYS_WAIT4 = 11 +pkg syscall (openbsd-amd64), const SYS___THRSLEEP = 94 +pkg syscall (openbsd-amd64), const SizeofRtMetrics = 56 +pkg syscall (openbsd-amd64), const SizeofRtMsghdr = 96 +pkg syscall (openbsd-amd64), const TCP_NOPUSH = 16 +pkg syscall (openbsd-amd64), const TCP_NOPUSH ideal-int +pkg syscall (openbsd-amd64), const TIOCGSID = 1074033763 +pkg syscall (openbsd-amd64), const TIOCGSID ideal-int +pkg syscall (openbsd-amd64), func FcntlFlock(uintptr, int, *Flock_t) error +pkg syscall (openbsd-amd64), func SendmsgN(int, []uint8, []uint8, Sockaddr, int) (int, error) +pkg syscall (openbsd-amd64), type Dirent struct, Fileno uint64 +pkg syscall (openbsd-amd64), type Dirent struct, Off int64 +pkg syscall (openbsd-amd64), type Dirent struct, X__d_padding [4]uint8 +pkg syscall (openbsd-amd64), type FdSet struct, Bits [32]uint32 +pkg syscall (openbsd-amd64), type Kevent_t struct, Data int64 +pkg syscall (openbsd-amd64), type Kevent_t struct, Ident uint64 +pkg syscall (openbsd-amd64), type Mclpool struct, Grown int32 +pkg syscall (openbsd-amd64), type RtMetrics struct, Expire int64 +pkg syscall (openbsd-amd64), type RtMetrics struct, Pad uint32 +pkg syscall (openbsd-amd64), type Stat_t struct, Ino uint64 +pkg syscall (openbsd-amd64), type Stat_t struct, Pad_cgo_0 [4]uint8 +pkg syscall (openbsd-amd64), type Statfs_t struct, F_ctime uint64 +pkg syscall (openbsd-amd64), type Statfs_t struct, F_mntfromspec [90]int8 +pkg syscall (openbsd-amd64), type Statfs_t struct, Pad_cgo_1 [2]uint8 +pkg syscall (openbsd-amd64), type Termios struct +pkg syscall (openbsd-amd64), type Termios struct, Cc [20]uint8 +pkg syscall (openbsd-amd64), type Termios struct, Cflag uint32 +pkg syscall (openbsd-amd64), type Termios struct, Iflag uint32 +pkg syscall (openbsd-amd64), type Termios struct, Ispeed int32 +pkg syscall (openbsd-amd64), type Termios struct, Lflag uint32 +pkg syscall (openbsd-amd64), type Termios struct, Oflag uint32 +pkg syscall (openbsd-amd64), type Termios struct, Ospeed int32 +pkg syscall (openbsd-amd64), type Timespec struct, Sec int64 +pkg syscall (openbsd-amd64-cgo), const IPPROTO_DIVERT_INIT = 2 +pkg syscall (openbsd-amd64-cgo), const IPPROTO_DIVERT_INIT ideal-int +pkg syscall (openbsd-amd64-cgo), const IPPROTO_DIVERT_RESP = 1 +pkg syscall (openbsd-amd64-cgo), const IPPROTO_DIVERT_RESP ideal-int +pkg syscall (openbsd-amd64-cgo), const IPV6_RECVDSTPORT = 64 +pkg syscall (openbsd-amd64-cgo), const IPV6_RECVDSTPORT ideal-int +pkg syscall (openbsd-amd64-cgo), const IP_DIVERTFL = 4130 +pkg syscall (openbsd-amd64-cgo), const IP_DIVERTFL ideal-int +pkg syscall (openbsd-amd64-cgo), const MADV_DONTNEED = 4 +pkg syscall (openbsd-amd64-cgo), const MADV_DONTNEED ideal-int +pkg syscall (openbsd-amd64-cgo), const MADV_FREE = 6 +pkg syscall (openbsd-amd64-cgo), const MADV_FREE ideal-int +pkg syscall (openbsd-amd64-cgo), const MADV_NORMAL = 0 +pkg syscall (openbsd-amd64-cgo), const MADV_NORMAL ideal-int +pkg syscall (openbsd-amd64-cgo), const MADV_RANDOM = 1 +pkg syscall (openbsd-amd64-cgo), const MADV_RANDOM ideal-int +pkg syscall (openbsd-amd64-cgo), const MADV_SEQUENTIAL = 2 +pkg syscall (openbsd-amd64-cgo), const MADV_SEQUENTIAL ideal-int +pkg syscall (openbsd-amd64-cgo), const MADV_SPACEAVAIL = 5 +pkg syscall (openbsd-amd64-cgo), const MADV_SPACEAVAIL ideal-int +pkg syscall (openbsd-amd64-cgo), const MADV_WILLNEED = 3 +pkg syscall (openbsd-amd64-cgo), const MADV_WILLNEED ideal-int +pkg syscall (openbsd-amd64-cgo), const MAP_ANON = 4096 +pkg syscall (openbsd-amd64-cgo), const MAP_ANON ideal-int +pkg syscall (openbsd-amd64-cgo), const MAP_COPY = 4 +pkg syscall (openbsd-amd64-cgo), const MAP_COPY ideal-int +pkg syscall (openbsd-amd64-cgo), const MAP_FILE = 0 +pkg syscall (openbsd-amd64-cgo), const MAP_FILE ideal-int +pkg syscall (openbsd-amd64-cgo), const MAP_FIXED = 16 +pkg syscall (openbsd-amd64-cgo), const MAP_FIXED ideal-int +pkg syscall (openbsd-amd64-cgo), const MAP_FLAGMASK = 8183 +pkg syscall (openbsd-amd64-cgo), const MAP_FLAGMASK ideal-int +pkg syscall (openbsd-amd64-cgo), const MAP_HASSEMAPHORE = 512 +pkg syscall (openbsd-amd64-cgo), const MAP_HASSEMAPHORE ideal-int +pkg syscall (openbsd-amd64-cgo), const MAP_INHERIT = 128 +pkg syscall (openbsd-amd64-cgo), const MAP_INHERIT ideal-int +pkg syscall (openbsd-amd64-cgo), const MAP_INHERIT_COPY = 1 +pkg syscall (openbsd-amd64-cgo), const MAP_INHERIT_COPY ideal-int +pkg syscall (openbsd-amd64-cgo), const MAP_INHERIT_DONATE_COPY = 3 +pkg syscall (openbsd-amd64-cgo), const MAP_INHERIT_DONATE_COPY ideal-int +pkg syscall (openbsd-amd64-cgo), const MAP_INHERIT_NONE = 2 +pkg syscall (openbsd-amd64-cgo), const MAP_INHERIT_NONE ideal-int +pkg syscall (openbsd-amd64-cgo), const MAP_INHERIT_SHARE = 0 +pkg syscall (openbsd-amd64-cgo), const MAP_INHERIT_SHARE ideal-int +pkg syscall (openbsd-amd64-cgo), const MAP_NOEXTEND = 256 +pkg syscall (openbsd-amd64-cgo), const MAP_NOEXTEND ideal-int +pkg syscall (openbsd-amd64-cgo), const MAP_NORESERVE = 64 +pkg syscall (openbsd-amd64-cgo), const MAP_NORESERVE ideal-int +pkg syscall (openbsd-amd64-cgo), const MAP_PRIVATE = 2 +pkg syscall (openbsd-amd64-cgo), const MAP_PRIVATE ideal-int +pkg syscall (openbsd-amd64-cgo), const MAP_RENAME = 32 +pkg syscall (openbsd-amd64-cgo), const MAP_RENAME ideal-int +pkg syscall (openbsd-amd64-cgo), const MAP_SHARED = 1 +pkg syscall (openbsd-amd64-cgo), const MAP_SHARED ideal-int +pkg syscall (openbsd-amd64-cgo), const MAP_TRYFIXED = 1024 +pkg syscall (openbsd-amd64-cgo), const MAP_TRYFIXED ideal-int +pkg syscall (openbsd-amd64-cgo), const MCL_CURRENT = 1 +pkg syscall (openbsd-amd64-cgo), const MCL_CURRENT ideal-int +pkg syscall (openbsd-amd64-cgo), const MCL_FUTURE = 2 +pkg syscall (openbsd-amd64-cgo), const MCL_FUTURE ideal-int +pkg syscall (openbsd-amd64-cgo), const MS_ASYNC = 1 +pkg syscall (openbsd-amd64-cgo), const MS_ASYNC ideal-int +pkg syscall (openbsd-amd64-cgo), const MS_INVALIDATE = 4 +pkg syscall (openbsd-amd64-cgo), const MS_INVALIDATE ideal-int +pkg syscall (openbsd-amd64-cgo), const MS_SYNC = 2 +pkg syscall (openbsd-amd64-cgo), const MS_SYNC ideal-int +pkg syscall (openbsd-amd64-cgo), const PROT_EXEC = 4 +pkg syscall (openbsd-amd64-cgo), const PROT_EXEC ideal-int +pkg syscall (openbsd-amd64-cgo), const PROT_NONE = 0 +pkg syscall (openbsd-amd64-cgo), const PROT_NONE ideal-int +pkg syscall (openbsd-amd64-cgo), const PROT_READ = 1 +pkg syscall (openbsd-amd64-cgo), const PROT_READ ideal-int +pkg syscall (openbsd-amd64-cgo), const PROT_WRITE = 2 +pkg syscall (openbsd-amd64-cgo), const PROT_WRITE ideal-int +pkg syscall (openbsd-amd64-cgo), const RTF_FMASK = 1112072 +pkg syscall (openbsd-amd64-cgo), const RTM_VERSION = 5 +pkg syscall (openbsd-amd64-cgo), const SIOCBRDGDADDR = 2166909255 +pkg syscall (openbsd-amd64-cgo), const SIOCBRDGSADDR = 3240651076 +pkg syscall (openbsd-amd64-cgo), const SIOCGETVLAN = 3223349648 +pkg syscall (openbsd-amd64-cgo), const SIOCGETVLAN ideal-int +pkg syscall (openbsd-amd64-cgo), const SIOCGIFHARDMTU = 3223349669 +pkg syscall (openbsd-amd64-cgo), const SIOCGIFHARDMTU ideal-int +pkg syscall (openbsd-amd64-cgo), const SIOCGLIFPHYTTL = 3223349673 +pkg syscall (openbsd-amd64-cgo), const SIOCGLIFPHYTTL ideal-int +pkg syscall (openbsd-amd64-cgo), const SIOCGSPPPPARAMS = 3223349652 +pkg syscall (openbsd-amd64-cgo), const SIOCGSPPPPARAMS ideal-int +pkg syscall (openbsd-amd64-cgo), const SIOCGVNETID = 3223349671 +pkg syscall (openbsd-amd64-cgo), const SIOCGVNETID ideal-int +pkg syscall (openbsd-amd64-cgo), const SIOCSETVLAN = 2149607823 +pkg syscall (openbsd-amd64-cgo), const SIOCSETVLAN ideal-int +pkg syscall (openbsd-amd64-cgo), const SIOCSLIFPHYTTL = 2149607848 +pkg syscall (openbsd-amd64-cgo), const SIOCSLIFPHYTTL ideal-int +pkg syscall (openbsd-amd64-cgo), const SIOCSSPPPPARAMS = 2149607827 +pkg syscall (openbsd-amd64-cgo), const SIOCSSPPPPARAMS ideal-int +pkg syscall (openbsd-amd64-cgo), const SIOCSVNETID = 2149607846 +pkg syscall (openbsd-amd64-cgo), const SIOCSVNETID ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_CLOCK_GETRES = 89 +pkg syscall (openbsd-amd64-cgo), const SYS_CLOCK_GETTIME = 87 +pkg syscall (openbsd-amd64-cgo), const SYS_CLOCK_SETTIME = 88 +pkg syscall (openbsd-amd64-cgo), const SYS_FHSTATFS = 65 +pkg syscall (openbsd-amd64-cgo), const SYS_FSTAT = 53 +pkg syscall (openbsd-amd64-cgo), const SYS_FSTATAT = 42 +pkg syscall (openbsd-amd64-cgo), const SYS_FSTATFS = 64 +pkg syscall (openbsd-amd64-cgo), const SYS_FUTIMENS = 85 +pkg syscall (openbsd-amd64-cgo), const SYS_FUTIMES = 77 +pkg syscall (openbsd-amd64-cgo), const SYS_GETDENTS = 99 +pkg syscall (openbsd-amd64-cgo), const SYS_GETDENTS ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_GETFSSTAT = 62 +pkg syscall (openbsd-amd64-cgo), const SYS_GETITIMER = 70 +pkg syscall (openbsd-amd64-cgo), const SYS_GETRUSAGE = 19 +pkg syscall (openbsd-amd64-cgo), const SYS_GETTIMEOFDAY = 67 +pkg syscall (openbsd-amd64-cgo), const SYS_KEVENT = 72 +pkg syscall (openbsd-amd64-cgo), const SYS_LSTAT = 40 +pkg syscall (openbsd-amd64-cgo), const SYS_NANOSLEEP = 91 +pkg syscall (openbsd-amd64-cgo), const SYS_PPOLL = 109 +pkg syscall (openbsd-amd64-cgo), const SYS_PPOLL ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_PSELECT = 110 +pkg syscall (openbsd-amd64-cgo), const SYS_PSELECT ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_SELECT = 71 +pkg syscall (openbsd-amd64-cgo), const SYS_SETITIMER = 69 +pkg syscall (openbsd-amd64-cgo), const SYS_SETTIMEOFDAY = 68 +pkg syscall (openbsd-amd64-cgo), const SYS_STAT = 38 +pkg syscall (openbsd-amd64-cgo), const SYS_STATFS = 63 +pkg syscall (openbsd-amd64-cgo), const SYS_UTIMENSAT = 84 +pkg syscall (openbsd-amd64-cgo), const SYS_UTIMES = 76 +pkg syscall (openbsd-amd64-cgo), const SYS_UTRACE = 209 +pkg syscall (openbsd-amd64-cgo), const SYS_UTRACE ideal-int +pkg syscall (openbsd-amd64-cgo), const SYS_WAIT4 = 11 +pkg syscall (openbsd-amd64-cgo), const SYS___THRSLEEP = 94 +pkg syscall (openbsd-amd64-cgo), const SizeofRtMetrics = 56 +pkg syscall (openbsd-amd64-cgo), const SizeofRtMsghdr = 96 +pkg syscall (openbsd-amd64-cgo), const TCP_NOPUSH = 16 +pkg syscall (openbsd-amd64-cgo), const TCP_NOPUSH ideal-int +pkg syscall (openbsd-amd64-cgo), const TIOCGSID = 1074033763 +pkg syscall (openbsd-amd64-cgo), const TIOCGSID ideal-int +pkg syscall (openbsd-amd64-cgo), func FcntlFlock(uintptr, int, *Flock_t) error +pkg syscall (openbsd-amd64-cgo), func SendmsgN(int, []uint8, []uint8, Sockaddr, int) (int, error) +pkg syscall (openbsd-amd64-cgo), type Dirent struct, Fileno uint64 +pkg syscall (openbsd-amd64-cgo), type Dirent struct, Off int64 +pkg syscall (openbsd-amd64-cgo), type Dirent struct, X__d_padding [4]uint8 +pkg syscall (openbsd-amd64-cgo), type FdSet struct, Bits [32]uint32 +pkg syscall (openbsd-amd64-cgo), type Kevent_t struct, Data int64 +pkg syscall (openbsd-amd64-cgo), type Kevent_t struct, Ident uint64 +pkg syscall (openbsd-amd64-cgo), type Mclpool struct, Grown int32 +pkg syscall (openbsd-amd64-cgo), type RtMetrics struct, Expire int64 +pkg syscall (openbsd-amd64-cgo), type RtMetrics struct, Pad uint32 +pkg syscall (openbsd-amd64-cgo), type Stat_t struct, Ino uint64 +pkg syscall (openbsd-amd64-cgo), type Stat_t struct, Pad_cgo_0 [4]uint8 +pkg syscall (openbsd-amd64-cgo), type Statfs_t struct, F_ctime uint64 +pkg syscall (openbsd-amd64-cgo), type Statfs_t struct, F_mntfromspec [90]int8 +pkg syscall (openbsd-amd64-cgo), type Statfs_t struct, Pad_cgo_1 [2]uint8 +pkg syscall (openbsd-amd64-cgo), type Termios struct +pkg syscall (openbsd-amd64-cgo), type Termios struct, Cc [20]uint8 +pkg syscall (openbsd-amd64-cgo), type Termios struct, Cflag uint32 +pkg syscall (openbsd-amd64-cgo), type Termios struct, Iflag uint32 +pkg syscall (openbsd-amd64-cgo), type Termios struct, Ispeed int32 +pkg syscall (openbsd-amd64-cgo), type Termios struct, Lflag uint32 +pkg syscall (openbsd-amd64-cgo), type Termios struct, Oflag uint32 +pkg syscall (openbsd-amd64-cgo), type Termios struct, Ospeed int32 +pkg syscall (openbsd-amd64-cgo), type Timespec struct, Sec int64 +pkg syscall (windows-386), const ERROR_MORE_DATA = 234 +pkg syscall (windows-386), const ERROR_MORE_DATA Errno +pkg syscall (windows-386), const ERROR_NETNAME_DELETED = 64 +pkg syscall (windows-386), const ERROR_NETNAME_DELETED Errno +pkg syscall (windows-386), const IOC_VENDOR = 402653184 +pkg syscall (windows-386), const IOC_VENDOR ideal-int +pkg syscall (windows-386), const SIO_KEEPALIVE_VALS = 2550136836 +pkg syscall (windows-386), const SIO_KEEPALIVE_VALS ideal-int +pkg syscall (windows-386), const WSAECONNRESET = 10054 +pkg syscall (windows-386), const WSAECONNRESET Errno +pkg syscall (windows-386), func NewCallbackCDecl(interface{}) uintptr +pkg syscall (windows-386), type TCPKeepalive struct +pkg syscall (windows-386), type TCPKeepalive struct, Interval uint32 +pkg syscall (windows-386), type TCPKeepalive struct, OnOff uint32 +pkg syscall (windows-386), type TCPKeepalive struct, Time uint32 +pkg syscall (windows-amd64), const ERROR_MORE_DATA = 234 +pkg syscall (windows-amd64), const ERROR_MORE_DATA Errno +pkg syscall (windows-amd64), const ERROR_NETNAME_DELETED = 64 +pkg syscall (windows-amd64), const ERROR_NETNAME_DELETED Errno +pkg syscall (windows-amd64), const IOC_VENDOR = 402653184 +pkg syscall (windows-amd64), const IOC_VENDOR ideal-int +pkg syscall (windows-amd64), const SIO_KEEPALIVE_VALS = 2550136836 +pkg syscall (windows-amd64), const SIO_KEEPALIVE_VALS ideal-int +pkg syscall (windows-amd64), const WSAECONNRESET = 10054 +pkg syscall (windows-amd64), const WSAECONNRESET Errno +pkg syscall (windows-amd64), func NewCallbackCDecl(interface{}) uintptr +pkg syscall (windows-amd64), type TCPKeepalive struct +pkg syscall (windows-amd64), type TCPKeepalive struct, Interval uint32 +pkg syscall (windows-amd64), type TCPKeepalive struct, OnOff uint32 +pkg syscall (windows-amd64), type TCPKeepalive struct, Time uint32 +pkg testing, method (*B) RunParallel(func(*PB)) +pkg testing, method (*B) SetParallelism(int) +pkg testing, method (*PB) Next() bool +pkg testing, type PB struct +pkg unicode, const Version = "6.3.0" diff --git a/api/go1.4.txt b/api/go1.4.txt new file mode 100644 index 0000000000000000000000000000000000000000..08cb17f86932c896f5895a31a21703147510ab73 --- /dev/null +++ b/api/go1.4.txt @@ -0,0 +1,604 @@ +# CL 134210043 archive/zip: add Writer.Flush, Brad Fitzpatrick +pkg archive/zip, method (*Writer) Flush() error + +# CL 97140043 compress/flate: add Reset() to allow reusing large buffers to compress multiple buffers, James Robinson +pkg compress/flate, type Resetter interface { Reset } +pkg compress/flate, type Resetter interface, Reset(io.Reader, []uint8) error +pkg compress/zlib, type Resetter interface { Reset } +pkg compress/zlib, type Resetter interface, Reset(io.Reader, []uint8) error + +# CL 159120044 compress/gzip: allow stopping at end of first stream, Russ Cox +pkg compress/gzip, method (*Reader) Multistream(bool) + +# CL 138800043 crypto: Add SHA3 functions in go.crypto/sha3 to the Hash enum., David Leon Gil +pkg crypto, const SHA3_224 = 10 +pkg crypto, const SHA3_224 Hash +pkg crypto, const SHA3_256 = 11 +pkg crypto, const SHA3_256 Hash +pkg crypto, const SHA3_384 = 12 +pkg crypto, const SHA3_384 Hash +pkg crypto, const SHA3_512 = 13 +pkg crypto, const SHA3_512 Hash + +# CL 114680043 crypto: add Signer, Adam Langley +pkg crypto, method (Hash) HashFunc() Hash +pkg crypto, type Signer interface { Public, Sign } +pkg crypto, type Signer interface, Public() PublicKey +pkg crypto, type Signer interface, Sign(io.Reader, []uint8, SignerOpts) ([]uint8, error) +pkg crypto, type SignerOpts interface { HashFunc } +pkg crypto, type SignerOpts interface, HashFunc() Hash +pkg crypto/ecdsa, method (*PrivateKey) Public() crypto.PublicKey +pkg crypto/ecdsa, method (*PrivateKey) Sign(io.Reader, []uint8, crypto.SignerOpts) ([]uint8, error) +pkg crypto/rsa, method (*PSSOptions) HashFunc() crypto.Hash +pkg crypto/rsa, method (*PrivateKey) Public() crypto.PublicKey +pkg crypto/rsa, method (*PrivateKey) Sign(io.Reader, []uint8, crypto.SignerOpts) ([]uint8, error) +pkg crypto/rsa, type PSSOptions struct, Hash crypto.Hash + +# CL 157090043 crypto/tls: support TLS_FALLBACK_SCSV as a server., Adam Langley +pkg crypto/tls, const TLS_FALLBACK_SCSV = 22016 +pkg crypto/tls, const TLS_FALLBACK_SCSV uint16 + +# CL 107400043 crypto/tls: Added dynamic alternative to NameToCertificate map for SNI, Percy Wegmann +pkg crypto/tls, type ClientHelloInfo struct +pkg crypto/tls, type ClientHelloInfo struct, CipherSuites []uint16 +pkg crypto/tls, type ClientHelloInfo struct, ServerName string +pkg crypto/tls, type ClientHelloInfo struct, SupportedCurves []CurveID +pkg crypto/tls, type ClientHelloInfo struct, SupportedPoints []uint8 +pkg crypto/tls, type Config struct, GetCertificate func(*ClientHelloInfo) (*Certificate, error) +pkg crypto/tls, type ConnectionState struct, TLSUnique []uint8 + +# CL 153420045 crypto/x509: continue to recognise MaxPathLen of zero as "no value"., Adam Langley +pkg crypto/x509, type Certificate struct, MaxPathLenZero bool + +# CL 158950043 database/sql: add Drivers, returning list of registered drivers, Russ Cox +pkg database/sql, func Drivers() []string + +# CL 117280043 debug/dwarf: fix Reader panic on DW_TAG_unspecified_type, Derek Parker +pkg debug/dwarf, method (*UnspecifiedType) Basic() *BasicType +pkg debug/dwarf, method (*UnspecifiedType) Common() *CommonType +pkg debug/dwarf, method (*UnspecifiedType) Size() int64 +pkg debug/dwarf, method (*UnspecifiedType) String() string +pkg debug/dwarf, type UnspecifiedType struct +pkg debug/dwarf, type UnspecifiedType struct, embedded BasicType + +# CL 132000043 debug/elf: support arm64 relocations, Michael Hudson-Doyle +pkg debug/elf, const EM_AARCH64 = 183 +pkg debug/elf, const EM_AARCH64 Machine +pkg debug/elf, const R_AARCH64_ABS16 = 259 +pkg debug/elf, const R_AARCH64_ABS16 R_AARCH64 +pkg debug/elf, const R_AARCH64_ABS32 = 258 +pkg debug/elf, const R_AARCH64_ABS32 R_AARCH64 +pkg debug/elf, const R_AARCH64_ABS64 = 257 +pkg debug/elf, const R_AARCH64_ABS64 R_AARCH64 +pkg debug/elf, const R_AARCH64_ADD_ABS_LO12_NC = 277 +pkg debug/elf, const R_AARCH64_ADD_ABS_LO12_NC R_AARCH64 +pkg debug/elf, const R_AARCH64_ADR_GOT_PAGE = 311 +pkg debug/elf, const R_AARCH64_ADR_GOT_PAGE R_AARCH64 +pkg debug/elf, const R_AARCH64_ADR_PREL_LO21 = 274 +pkg debug/elf, const R_AARCH64_ADR_PREL_LO21 R_AARCH64 +pkg debug/elf, const R_AARCH64_ADR_PREL_PG_HI21 = 275 +pkg debug/elf, const R_AARCH64_ADR_PREL_PG_HI21 R_AARCH64 +pkg debug/elf, const R_AARCH64_ADR_PREL_PG_HI21_NC = 276 +pkg debug/elf, const R_AARCH64_ADR_PREL_PG_HI21_NC R_AARCH64 +pkg debug/elf, const R_AARCH64_CALL26 = 283 +pkg debug/elf, const R_AARCH64_CALL26 R_AARCH64 +pkg debug/elf, const R_AARCH64_CONDBR19 = 280 +pkg debug/elf, const R_AARCH64_CONDBR19 R_AARCH64 +pkg debug/elf, const R_AARCH64_COPY = 1024 +pkg debug/elf, const R_AARCH64_COPY R_AARCH64 +pkg debug/elf, const R_AARCH64_GLOB_DAT = 1025 +pkg debug/elf, const R_AARCH64_GLOB_DAT R_AARCH64 +pkg debug/elf, const R_AARCH64_GOT_LD_PREL19 = 309 +pkg debug/elf, const R_AARCH64_GOT_LD_PREL19 R_AARCH64 +pkg debug/elf, const R_AARCH64_IRELATIVE = 1032 +pkg debug/elf, const R_AARCH64_IRELATIVE R_AARCH64 +pkg debug/elf, const R_AARCH64_JUMP26 = 282 +pkg debug/elf, const R_AARCH64_JUMP26 R_AARCH64 +pkg debug/elf, const R_AARCH64_JUMP_SLOT = 1026 +pkg debug/elf, const R_AARCH64_JUMP_SLOT R_AARCH64 +pkg debug/elf, const R_AARCH64_LD64_GOT_LO12_NC = 312 +pkg debug/elf, const R_AARCH64_LD64_GOT_LO12_NC R_AARCH64 +pkg debug/elf, const R_AARCH64_LDST128_ABS_LO12_NC = 299 +pkg debug/elf, const R_AARCH64_LDST128_ABS_LO12_NC R_AARCH64 +pkg debug/elf, const R_AARCH64_LDST16_ABS_LO12_NC = 284 +pkg debug/elf, const R_AARCH64_LDST16_ABS_LO12_NC R_AARCH64 +pkg debug/elf, const R_AARCH64_LDST32_ABS_LO12_NC = 285 +pkg debug/elf, const R_AARCH64_LDST32_ABS_LO12_NC R_AARCH64 +pkg debug/elf, const R_AARCH64_LDST64_ABS_LO12_NC = 286 +pkg debug/elf, const R_AARCH64_LDST64_ABS_LO12_NC R_AARCH64 +pkg debug/elf, const R_AARCH64_LDST8_ABS_LO12_NC = 278 +pkg debug/elf, const R_AARCH64_LDST8_ABS_LO12_NC R_AARCH64 +pkg debug/elf, const R_AARCH64_LD_PREL_LO19 = 273 +pkg debug/elf, const R_AARCH64_LD_PREL_LO19 R_AARCH64 +pkg debug/elf, const R_AARCH64_MOVW_SABS_G0 = 270 +pkg debug/elf, const R_AARCH64_MOVW_SABS_G0 R_AARCH64 +pkg debug/elf, const R_AARCH64_MOVW_SABS_G1 = 271 +pkg debug/elf, const R_AARCH64_MOVW_SABS_G1 R_AARCH64 +pkg debug/elf, const R_AARCH64_MOVW_SABS_G2 = 272 +pkg debug/elf, const R_AARCH64_MOVW_SABS_G2 R_AARCH64 +pkg debug/elf, const R_AARCH64_MOVW_UABS_G0 = 263 +pkg debug/elf, const R_AARCH64_MOVW_UABS_G0 R_AARCH64 +pkg debug/elf, const R_AARCH64_MOVW_UABS_G0_NC = 264 +pkg debug/elf, const R_AARCH64_MOVW_UABS_G0_NC R_AARCH64 +pkg debug/elf, const R_AARCH64_MOVW_UABS_G1 = 265 +pkg debug/elf, const R_AARCH64_MOVW_UABS_G1 R_AARCH64 +pkg debug/elf, const R_AARCH64_MOVW_UABS_G1_NC = 266 +pkg debug/elf, const R_AARCH64_MOVW_UABS_G1_NC R_AARCH64 +pkg debug/elf, const R_AARCH64_MOVW_UABS_G2 = 267 +pkg debug/elf, const R_AARCH64_MOVW_UABS_G2 R_AARCH64 +pkg debug/elf, const R_AARCH64_MOVW_UABS_G2_NC = 268 +pkg debug/elf, const R_AARCH64_MOVW_UABS_G2_NC R_AARCH64 +pkg debug/elf, const R_AARCH64_MOVW_UABS_G3 = 269 +pkg debug/elf, const R_AARCH64_MOVW_UABS_G3 R_AARCH64 +pkg debug/elf, const R_AARCH64_NONE = 0 +pkg debug/elf, const R_AARCH64_NONE R_AARCH64 +pkg debug/elf, const R_AARCH64_NULL = 256 +pkg debug/elf, const R_AARCH64_NULL R_AARCH64 +pkg debug/elf, const R_AARCH64_P32_ABS16 = 2 +pkg debug/elf, const R_AARCH64_P32_ABS16 R_AARCH64 +pkg debug/elf, const R_AARCH64_P32_ABS32 = 1 +pkg debug/elf, const R_AARCH64_P32_ABS32 R_AARCH64 +pkg debug/elf, const R_AARCH64_P32_ADD_ABS_LO12_NC = 12 +pkg debug/elf, const R_AARCH64_P32_ADD_ABS_LO12_NC R_AARCH64 +pkg debug/elf, const R_AARCH64_P32_ADR_GOT_PAGE = 26 +pkg debug/elf, const R_AARCH64_P32_ADR_GOT_PAGE R_AARCH64 +pkg debug/elf, const R_AARCH64_P32_ADR_PREL_LO21 = 10 +pkg debug/elf, const R_AARCH64_P32_ADR_PREL_LO21 R_AARCH64 +pkg debug/elf, const R_AARCH64_P32_ADR_PREL_PG_HI21 = 11 +pkg debug/elf, const R_AARCH64_P32_ADR_PREL_PG_HI21 R_AARCH64 +pkg debug/elf, const R_AARCH64_P32_CALL26 = 21 +pkg debug/elf, const R_AARCH64_P32_CALL26 R_AARCH64 +pkg debug/elf, const R_AARCH64_P32_CONDBR19 = 19 +pkg debug/elf, const R_AARCH64_P32_CONDBR19 R_AARCH64 +pkg debug/elf, const R_AARCH64_P32_COPY = 180 +pkg debug/elf, const R_AARCH64_P32_COPY R_AARCH64 +pkg debug/elf, const R_AARCH64_P32_GLOB_DAT = 181 +pkg debug/elf, const R_AARCH64_P32_GLOB_DAT R_AARCH64 +pkg debug/elf, const R_AARCH64_P32_GOT_LD_PREL19 = 25 +pkg debug/elf, const R_AARCH64_P32_GOT_LD_PREL19 R_AARCH64 +pkg debug/elf, const R_AARCH64_P32_IRELATIVE = 188 +pkg debug/elf, const R_AARCH64_P32_IRELATIVE R_AARCH64 +pkg debug/elf, const R_AARCH64_P32_JUMP26 = 20 +pkg debug/elf, const R_AARCH64_P32_JUMP26 R_AARCH64 +pkg debug/elf, const R_AARCH64_P32_JUMP_SLOT = 182 +pkg debug/elf, const R_AARCH64_P32_JUMP_SLOT R_AARCH64 +pkg debug/elf, const R_AARCH64_P32_LD32_GOT_LO12_NC = 27 +pkg debug/elf, const R_AARCH64_P32_LD32_GOT_LO12_NC R_AARCH64 +pkg debug/elf, const R_AARCH64_P32_LDST128_ABS_LO12_NC = 17 +pkg debug/elf, const R_AARCH64_P32_LDST128_ABS_LO12_NC R_AARCH64 +pkg debug/elf, const R_AARCH64_P32_LDST16_ABS_LO12_NC = 14 +pkg debug/elf, const R_AARCH64_P32_LDST16_ABS_LO12_NC R_AARCH64 +pkg debug/elf, const R_AARCH64_P32_LDST32_ABS_LO12_NC = 15 +pkg debug/elf, const R_AARCH64_P32_LDST32_ABS_LO12_NC R_AARCH64 +pkg debug/elf, const R_AARCH64_P32_LDST64_ABS_LO12_NC = 16 +pkg debug/elf, const R_AARCH64_P32_LDST64_ABS_LO12_NC R_AARCH64 +pkg debug/elf, const R_AARCH64_P32_LDST8_ABS_LO12_NC = 13 +pkg debug/elf, const R_AARCH64_P32_LDST8_ABS_LO12_NC R_AARCH64 +pkg debug/elf, const R_AARCH64_P32_LD_PREL_LO19 = 9 +pkg debug/elf, const R_AARCH64_P32_LD_PREL_LO19 R_AARCH64 +pkg debug/elf, const R_AARCH64_P32_MOVW_SABS_G0 = 8 +pkg debug/elf, const R_AARCH64_P32_MOVW_SABS_G0 R_AARCH64 +pkg debug/elf, const R_AARCH64_P32_MOVW_UABS_G0 = 5 +pkg debug/elf, const R_AARCH64_P32_MOVW_UABS_G0 R_AARCH64 +pkg debug/elf, const R_AARCH64_P32_MOVW_UABS_G0_NC = 6 +pkg debug/elf, const R_AARCH64_P32_MOVW_UABS_G0_NC R_AARCH64 +pkg debug/elf, const R_AARCH64_P32_MOVW_UABS_G1 = 7 +pkg debug/elf, const R_AARCH64_P32_MOVW_UABS_G1 R_AARCH64 +pkg debug/elf, const R_AARCH64_P32_PREL16 = 4 +pkg debug/elf, const R_AARCH64_P32_PREL16 R_AARCH64 +pkg debug/elf, const R_AARCH64_P32_PREL32 = 3 +pkg debug/elf, const R_AARCH64_P32_PREL32 R_AARCH64 +pkg debug/elf, const R_AARCH64_P32_RELATIVE = 183 +pkg debug/elf, const R_AARCH64_P32_RELATIVE R_AARCH64 +pkg debug/elf, const R_AARCH64_P32_TLSDESC = 187 +pkg debug/elf, const R_AARCH64_P32_TLSDESC R_AARCH64 +pkg debug/elf, const R_AARCH64_P32_TLSDESC_ADD_LO12_NC = 126 +pkg debug/elf, const R_AARCH64_P32_TLSDESC_ADD_LO12_NC R_AARCH64 +pkg debug/elf, const R_AARCH64_P32_TLSDESC_ADR_PAGE21 = 124 +pkg debug/elf, const R_AARCH64_P32_TLSDESC_ADR_PAGE21 R_AARCH64 +pkg debug/elf, const R_AARCH64_P32_TLSDESC_ADR_PREL21 = 123 +pkg debug/elf, const R_AARCH64_P32_TLSDESC_ADR_PREL21 R_AARCH64 +pkg debug/elf, const R_AARCH64_P32_TLSDESC_CALL = 127 +pkg debug/elf, const R_AARCH64_P32_TLSDESC_CALL R_AARCH64 +pkg debug/elf, const R_AARCH64_P32_TLSDESC_LD32_LO12_NC = 125 +pkg debug/elf, const R_AARCH64_P32_TLSDESC_LD32_LO12_NC R_AARCH64 +pkg debug/elf, const R_AARCH64_P32_TLSDESC_LD_PREL19 = 122 +pkg debug/elf, const R_AARCH64_P32_TLSDESC_LD_PREL19 R_AARCH64 +pkg debug/elf, const R_AARCH64_P32_TLSGD_ADD_LO12_NC = 82 +pkg debug/elf, const R_AARCH64_P32_TLSGD_ADD_LO12_NC R_AARCH64 +pkg debug/elf, const R_AARCH64_P32_TLSGD_ADR_PAGE21 = 81 +pkg debug/elf, const R_AARCH64_P32_TLSGD_ADR_PAGE21 R_AARCH64 +pkg debug/elf, const R_AARCH64_P32_TLSIE_ADR_GOTTPREL_PAGE21 = 103 +pkg debug/elf, const R_AARCH64_P32_TLSIE_ADR_GOTTPREL_PAGE21 R_AARCH64 +pkg debug/elf, const R_AARCH64_P32_TLSIE_LD32_GOTTPREL_LO12_NC = 104 +pkg debug/elf, const R_AARCH64_P32_TLSIE_LD32_GOTTPREL_LO12_NC R_AARCH64 +pkg debug/elf, const R_AARCH64_P32_TLSIE_LD_GOTTPREL_PREL19 = 105 +pkg debug/elf, const R_AARCH64_P32_TLSIE_LD_GOTTPREL_PREL19 R_AARCH64 +pkg debug/elf, const R_AARCH64_P32_TLSLE_ADD_TPREL_HI12 = 109 +pkg debug/elf, const R_AARCH64_P32_TLSLE_ADD_TPREL_HI12 R_AARCH64 +pkg debug/elf, const R_AARCH64_P32_TLSLE_ADD_TPREL_LO12 = 110 +pkg debug/elf, const R_AARCH64_P32_TLSLE_ADD_TPREL_LO12 R_AARCH64 +pkg debug/elf, const R_AARCH64_P32_TLSLE_ADD_TPREL_LO12_NC = 111 +pkg debug/elf, const R_AARCH64_P32_TLSLE_ADD_TPREL_LO12_NC R_AARCH64 +pkg debug/elf, const R_AARCH64_P32_TLSLE_MOVW_TPREL_G0 = 107 +pkg debug/elf, const R_AARCH64_P32_TLSLE_MOVW_TPREL_G0 R_AARCH64 +pkg debug/elf, const R_AARCH64_P32_TLSLE_MOVW_TPREL_G0_NC = 108 +pkg debug/elf, const R_AARCH64_P32_TLSLE_MOVW_TPREL_G0_NC R_AARCH64 +pkg debug/elf, const R_AARCH64_P32_TLSLE_MOVW_TPREL_G1 = 106 +pkg debug/elf, const R_AARCH64_P32_TLSLE_MOVW_TPREL_G1 R_AARCH64 +pkg debug/elf, const R_AARCH64_P32_TLS_DTPMOD = 184 +pkg debug/elf, const R_AARCH64_P32_TLS_DTPMOD R_AARCH64 +pkg debug/elf, const R_AARCH64_P32_TLS_DTPREL = 185 +pkg debug/elf, const R_AARCH64_P32_TLS_DTPREL R_AARCH64 +pkg debug/elf, const R_AARCH64_P32_TLS_TPREL = 186 +pkg debug/elf, const R_AARCH64_P32_TLS_TPREL R_AARCH64 +pkg debug/elf, const R_AARCH64_P32_TSTBR14 = 18 +pkg debug/elf, const R_AARCH64_P32_TSTBR14 R_AARCH64 +pkg debug/elf, const R_AARCH64_PREL16 = 262 +pkg debug/elf, const R_AARCH64_PREL16 R_AARCH64 +pkg debug/elf, const R_AARCH64_PREL32 = 261 +pkg debug/elf, const R_AARCH64_PREL32 R_AARCH64 +pkg debug/elf, const R_AARCH64_PREL64 = 260 +pkg debug/elf, const R_AARCH64_PREL64 R_AARCH64 +pkg debug/elf, const R_AARCH64_RELATIVE = 1027 +pkg debug/elf, const R_AARCH64_RELATIVE R_AARCH64 +pkg debug/elf, const R_AARCH64_TLSDESC = 1031 +pkg debug/elf, const R_AARCH64_TLSDESC R_AARCH64 +pkg debug/elf, const R_AARCH64_TLSDESC_ADD = 568 +pkg debug/elf, const R_AARCH64_TLSDESC_ADD R_AARCH64 +pkg debug/elf, const R_AARCH64_TLSDESC_ADD_LO12_NC = 564 +pkg debug/elf, const R_AARCH64_TLSDESC_ADD_LO12_NC R_AARCH64 +pkg debug/elf, const R_AARCH64_TLSDESC_ADR_PAGE21 = 562 +pkg debug/elf, const R_AARCH64_TLSDESC_ADR_PAGE21 R_AARCH64 +pkg debug/elf, const R_AARCH64_TLSDESC_ADR_PREL21 = 561 +pkg debug/elf, const R_AARCH64_TLSDESC_ADR_PREL21 R_AARCH64 +pkg debug/elf, const R_AARCH64_TLSDESC_CALL = 569 +pkg debug/elf, const R_AARCH64_TLSDESC_CALL R_AARCH64 +pkg debug/elf, const R_AARCH64_TLSDESC_LD64_LO12_NC = 563 +pkg debug/elf, const R_AARCH64_TLSDESC_LD64_LO12_NC R_AARCH64 +pkg debug/elf, const R_AARCH64_TLSDESC_LDR = 567 +pkg debug/elf, const R_AARCH64_TLSDESC_LDR R_AARCH64 +pkg debug/elf, const R_AARCH64_TLSDESC_LD_PREL19 = 560 +pkg debug/elf, const R_AARCH64_TLSDESC_LD_PREL19 R_AARCH64 +pkg debug/elf, const R_AARCH64_TLSDESC_OFF_G0_NC = 566 +pkg debug/elf, const R_AARCH64_TLSDESC_OFF_G0_NC R_AARCH64 +pkg debug/elf, const R_AARCH64_TLSDESC_OFF_G1 = 565 +pkg debug/elf, const R_AARCH64_TLSDESC_OFF_G1 R_AARCH64 +pkg debug/elf, const R_AARCH64_TLSGD_ADD_LO12_NC = 514 +pkg debug/elf, const R_AARCH64_TLSGD_ADD_LO12_NC R_AARCH64 +pkg debug/elf, const R_AARCH64_TLSGD_ADR_PAGE21 = 513 +pkg debug/elf, const R_AARCH64_TLSGD_ADR_PAGE21 R_AARCH64 +pkg debug/elf, const R_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21 = 541 +pkg debug/elf, const R_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21 R_AARCH64 +pkg debug/elf, const R_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC = 542 +pkg debug/elf, const R_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC R_AARCH64 +pkg debug/elf, const R_AARCH64_TLSIE_LD_GOTTPREL_PREL19 = 543 +pkg debug/elf, const R_AARCH64_TLSIE_LD_GOTTPREL_PREL19 R_AARCH64 +pkg debug/elf, const R_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC = 540 +pkg debug/elf, const R_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC R_AARCH64 +pkg debug/elf, const R_AARCH64_TLSIE_MOVW_GOTTPREL_G1 = 539 +pkg debug/elf, const R_AARCH64_TLSIE_MOVW_GOTTPREL_G1 R_AARCH64 +pkg debug/elf, const R_AARCH64_TLSLE_ADD_TPREL_HI12 = 549 +pkg debug/elf, const R_AARCH64_TLSLE_ADD_TPREL_HI12 R_AARCH64 +pkg debug/elf, const R_AARCH64_TLSLE_ADD_TPREL_LO12 = 550 +pkg debug/elf, const R_AARCH64_TLSLE_ADD_TPREL_LO12 R_AARCH64 +pkg debug/elf, const R_AARCH64_TLSLE_ADD_TPREL_LO12_NC = 551 +pkg debug/elf, const R_AARCH64_TLSLE_ADD_TPREL_LO12_NC R_AARCH64 +pkg debug/elf, const R_AARCH64_TLSLE_MOVW_TPREL_G0 = 547 +pkg debug/elf, const R_AARCH64_TLSLE_MOVW_TPREL_G0 R_AARCH64 +pkg debug/elf, const R_AARCH64_TLSLE_MOVW_TPREL_G0_NC = 548 +pkg debug/elf, const R_AARCH64_TLSLE_MOVW_TPREL_G0_NC R_AARCH64 +pkg debug/elf, const R_AARCH64_TLSLE_MOVW_TPREL_G1 = 545 +pkg debug/elf, const R_AARCH64_TLSLE_MOVW_TPREL_G1 R_AARCH64 +pkg debug/elf, const R_AARCH64_TLSLE_MOVW_TPREL_G1_NC = 546 +pkg debug/elf, const R_AARCH64_TLSLE_MOVW_TPREL_G1_NC R_AARCH64 +pkg debug/elf, const R_AARCH64_TLSLE_MOVW_TPREL_G2 = 544 +pkg debug/elf, const R_AARCH64_TLSLE_MOVW_TPREL_G2 R_AARCH64 +pkg debug/elf, const R_AARCH64_TLS_DTPMOD64 = 1028 +pkg debug/elf, const R_AARCH64_TLS_DTPMOD64 R_AARCH64 +pkg debug/elf, const R_AARCH64_TLS_DTPREL64 = 1029 +pkg debug/elf, const R_AARCH64_TLS_DTPREL64 R_AARCH64 +pkg debug/elf, const R_AARCH64_TLS_TPREL64 = 1030 +pkg debug/elf, const R_AARCH64_TLS_TPREL64 R_AARCH64 +pkg debug/elf, const R_AARCH64_TSTBR14 = 279 +pkg debug/elf, const R_AARCH64_TSTBR14 R_AARCH64 +pkg debug/elf, method (R_AARCH64) GoString() string +pkg debug/elf, method (R_AARCH64) String() string +pkg debug/elf, type R_AARCH64 int + +# CL 107530043 debug/elf: add (*File).DynamicSymbols, ErrNoSymbols, and tests for (*File).Symbols and (*File).DynamicSymbols, and formalize symbol order., Pietro Gagliardi +pkg debug/elf, method (*File) DynamicSymbols() ([]Symbol, error) +pkg debug/elf, var ErrNoSymbols error + +# CL 106460044 debug/plan9obj, cmd/addr2line: on Plan 9 use a.out header, Aram Hăvărneanu +pkg debug/plan9obj, type FileHeader struct, HdrSize uint64 +pkg debug/plan9obj, type FileHeader struct, LoadAddress uint64 + +# CL 122960043 encoding/xml: add InputOffset method to Decoder, Russ Cox +pkg encoding/xml, method (*Decoder) InputOffset() int64 + +# CL 124940043 cmd/go, go/build: implement import comment checking, Russ Cox +pkg go/build, const ImportComment = 4 +pkg go/build, const ImportComment ImportMode +pkg go/build, type Package struct, ImportComment string + +# CL 155050043 go/build: Return MultiplePackageError on importing a dir containing multiple packages, Jens Frederich +pkg go/build, method (*MultiplePackageError) Error() string +pkg go/build, type MultiplePackageError struct +pkg go/build, type MultiplePackageError struct, Dir string +pkg go/build, type MultiplePackageError struct, Files []string +pkg go/build, type MultiplePackageError struct, Packages []string + +# CL 135110044 go/token: implement PositionFor accessors, Robert Griesemer +pkg go/token, method (*File) PositionFor(Pos, bool) Position +pkg go/token, method (*FileSet) PositionFor(Pos, bool) Position + +# CL 109000049 image: add RGBAAt, Gray16At, etc., ChaiShushan +pkg image, method (*Alpha) AlphaAt(int, int) color.Alpha +pkg image, method (*Alpha16) Alpha16At(int, int) color.Alpha16 +pkg image, method (*Gray) GrayAt(int, int) color.Gray +pkg image, method (*Gray16) Gray16At(int, int) color.Gray16 +pkg image, method (*NRGBA) NRGBAAt(int, int) color.NRGBA +pkg image, method (*NRGBA64) NRGBA64At(int, int) color.NRGBA64 +pkg image, method (*RGBA) RGBAAt(int, int) color.RGBA +pkg image, method (*RGBA64) RGBA64At(int, int) color.RGBA64 +pkg image, method (*YCbCr) YCbCrAt(int, int) color.YCbCr + +# CL 129190043 png: make the encoder configurable, Jeff R. Allen +pkg image/png, const BestCompression = -3 +pkg image/png, const BestCompression CompressionLevel +pkg image/png, const BestSpeed = -2 +pkg image/png, const BestSpeed CompressionLevel +pkg image/png, const DefaultCompression = 0 +pkg image/png, const DefaultCompression CompressionLevel +pkg image/png, const NoCompression = -1 +pkg image/png, const NoCompression CompressionLevel +pkg image/png, method (*Encoder) Encode(io.Writer, image.Image) error +pkg image/png, type CompressionLevel int +pkg image/png, type Encoder struct +pkg image/png, type Encoder struct, CompressionLevel CompressionLevel + +# CL 101750048 math: implement Nextafter32, Robert Griesemer +pkg math, func Nextafter32(float32, float32) float32 + +# CL 93550043 math/big: implement Rat.Float32, Robert Griesemer +pkg math/big, method (*Rat) Float32() (float32, bool) + +# CL 76540043 net/http: add BasicAuth method to *http.Request, Kelsey Hightower +pkg net/http, method (*Request) BasicAuth() (string, string, bool) + +# CL 137940043 net/http: add Transport.DialTLS hook, Brad Fitzpatrick +pkg net/http, type Transport struct, DialTLS func(string, string) (net.Conn, error) + +# CL 132750043 net/http/httputil: Pass a Logger to ReverseProxy, allowing the user to control logging., Mark Theunissen +pkg net/http/httputil, type ReverseProxy struct, ErrorLog *log.Logger + +# CL 148370043 os, syscall: add Unsetenv, Brad Fitzpatrick +pkg os, func Unsetenv(string) error +pkg syscall, func Unsetenv(string) error + +# CL 144020043 reflect: add Type.Comparable, Russ Cox +pkg reflect, type Type interface, Comparable() bool + +# CL 153670043 runtime: add PauseEnd array to MemStats and GCStats, Jens Frederich +pkg runtime, type MemStats struct, PauseEnd [256]uint64 +pkg runtime/debug, type GCStats struct, PauseEnd []time.Time + +# CL 136710045 sync/atomic: add Value, Dmitriy Vyukov +pkg sync/atomic, method (*Value) Load() interface{} +pkg sync/atomic, method (*Value) Store(interface{}) +pkg sync/atomic, type Value struct + +# CL 126190043 syscall: support UID/GID map files for Linux user namespaces, Mrunal Patel +pkg syscall (linux-386), type SysProcAttr struct, GidMappings []SysProcIDMap +pkg syscall (linux-386), type SysProcAttr struct, UidMappings []SysProcIDMap +pkg syscall (linux-386), type SysProcIDMap struct +pkg syscall (linux-386), type SysProcIDMap struct, ContainerID int +pkg syscall (linux-386), type SysProcIDMap struct, HostID int +pkg syscall (linux-386), type SysProcIDMap struct, Size int +pkg syscall (linux-386-cgo), type SysProcAttr struct, GidMappings []SysProcIDMap +pkg syscall (linux-386-cgo), type SysProcAttr struct, UidMappings []SysProcIDMap +pkg syscall (linux-386-cgo), type SysProcIDMap struct +pkg syscall (linux-386-cgo), type SysProcIDMap struct, ContainerID int +pkg syscall (linux-386-cgo), type SysProcIDMap struct, HostID int +pkg syscall (linux-386-cgo), type SysProcIDMap struct, Size int +pkg syscall (linux-amd64), type SysProcAttr struct, GidMappings []SysProcIDMap +pkg syscall (linux-amd64), type SysProcAttr struct, UidMappings []SysProcIDMap +pkg syscall (linux-amd64), type SysProcIDMap struct +pkg syscall (linux-amd64), type SysProcIDMap struct, ContainerID int +pkg syscall (linux-amd64), type SysProcIDMap struct, HostID int +pkg syscall (linux-amd64), type SysProcIDMap struct, Size int +pkg syscall (linux-amd64-cgo), type SysProcAttr struct, GidMappings []SysProcIDMap +pkg syscall (linux-amd64-cgo), type SysProcAttr struct, UidMappings []SysProcIDMap +pkg syscall (linux-amd64-cgo), type SysProcIDMap struct +pkg syscall (linux-amd64-cgo), type SysProcIDMap struct, ContainerID int +pkg syscall (linux-amd64-cgo), type SysProcIDMap struct, HostID int +pkg syscall (linux-amd64-cgo), type SysProcIDMap struct, Size int +pkg syscall (linux-arm), type SysProcAttr struct, GidMappings []SysProcIDMap +pkg syscall (linux-arm), type SysProcAttr struct, UidMappings []SysProcIDMap +pkg syscall (linux-arm), type SysProcIDMap struct +pkg syscall (linux-arm), type SysProcIDMap struct, ContainerID int +pkg syscall (linux-arm), type SysProcIDMap struct, HostID int +pkg syscall (linux-arm), type SysProcIDMap struct, Size int +pkg syscall (linux-arm-cgo), type SysProcAttr struct, GidMappings []SysProcIDMap +pkg syscall (linux-arm-cgo), type SysProcAttr struct, UidMappings []SysProcIDMap +pkg syscall (linux-arm-cgo), type SysProcIDMap struct +pkg syscall (linux-arm-cgo), type SysProcIDMap struct, ContainerID int +pkg syscall (linux-arm-cgo), type SysProcIDMap struct, HostID int +pkg syscall (linux-arm-cgo), type SysProcIDMap struct, Size int + +# CL 122200043 net: fix CNAME resolving on Windows, Egon Elbre +pkg syscall (windows-386), const DNS_INFO_NO_RECORDS = 9501 +pkg syscall (windows-386), const DNS_INFO_NO_RECORDS ideal-int +pkg syscall (windows-386), const DnsSectionAdditional = 3 +pkg syscall (windows-386), const DnsSectionAdditional ideal-int +pkg syscall (windows-386), const DnsSectionAnswer = 1 +pkg syscall (windows-386), const DnsSectionAnswer ideal-int +pkg syscall (windows-386), const DnsSectionAuthority = 2 +pkg syscall (windows-386), const DnsSectionAuthority ideal-int +pkg syscall (windows-386), const DnsSectionQuestion = 0 +pkg syscall (windows-386), const DnsSectionQuestion ideal-int +pkg syscall (windows-386), func DnsNameCompare(*uint16, *uint16) bool +pkg syscall (windows-amd64), const DNS_INFO_NO_RECORDS = 9501 +pkg syscall (windows-amd64), const DNS_INFO_NO_RECORDS ideal-int +pkg syscall (windows-amd64), const DnsSectionAdditional = 3 +pkg syscall (windows-amd64), const DnsSectionAdditional ideal-int +pkg syscall (windows-amd64), const DnsSectionAnswer = 1 +pkg syscall (windows-amd64), const DnsSectionAnswer ideal-int +pkg syscall (windows-amd64), const DnsSectionAuthority = 2 +pkg syscall (windows-amd64), const DnsSectionAuthority ideal-int +pkg syscall (windows-amd64), const DnsSectionQuestion = 0 +pkg syscall (windows-amd64), const DnsSectionQuestion ideal-int +pkg syscall (windows-amd64), func DnsNameCompare(*uint16, *uint16) bool + +# CL 86160044 os: Implement symlink support for Windows, Michael Fraenkel +pkg syscall (windows-386), const ERROR_PRIVILEGE_NOT_HELD = 1314 +pkg syscall (windows-386), const ERROR_PRIVILEGE_NOT_HELD Errno +pkg syscall (windows-amd64), const ERROR_PRIVILEGE_NOT_HELD = 1314 +pkg syscall (windows-amd64), const ERROR_PRIVILEGE_NOT_HELD Errno + +# CL 86160044 os: Implement symlink support for Windows, Michael Fraenkel +pkg syscall (windows-386), const FILE_ATTRIBUTE_REPARSE_POINT = 1024 +pkg syscall (windows-386), const FILE_ATTRIBUTE_REPARSE_POINT ideal-int +pkg syscall (windows-386), const FILE_FLAG_OPEN_REPARSE_POINT = 2097152 +pkg syscall (windows-386), const FILE_FLAG_OPEN_REPARSE_POINT ideal-int +pkg syscall (windows-386), const FSCTL_GET_REPARSE_POINT = 589992 +pkg syscall (windows-386), const FSCTL_GET_REPARSE_POINT ideal-int +pkg syscall (windows-386), const IO_REPARSE_TAG_SYMLINK = 2684354572 +pkg syscall (windows-386), const IO_REPARSE_TAG_SYMLINK ideal-int +pkg syscall (windows-386), const MAXIMUM_REPARSE_DATA_BUFFER_SIZE = 16384 +pkg syscall (windows-386), const MAXIMUM_REPARSE_DATA_BUFFER_SIZE ideal-int +pkg syscall (windows-386), const SYMBOLIC_LINK_FLAG_DIRECTORY = 1 +pkg syscall (windows-386), const SYMBOLIC_LINK_FLAG_DIRECTORY ideal-int +pkg syscall (windows-386), func CreateHardLink(*uint16, *uint16, uintptr) error +pkg syscall (windows-386), func CreateSymbolicLink(*uint16, *uint16, uint32) error +pkg syscall (windows-386), func DeviceIoControl(Handle, uint32, *uint8, uint32, *uint8, uint32, *uint32, *Overlapped) error +pkg syscall (windows-386), func LoadCreateSymbolicLink() error +pkg syscall (windows-amd64), const FILE_ATTRIBUTE_REPARSE_POINT = 1024 +pkg syscall (windows-amd64), const FILE_ATTRIBUTE_REPARSE_POINT ideal-int +pkg syscall (windows-amd64), const FILE_FLAG_OPEN_REPARSE_POINT = 2097152 +pkg syscall (windows-amd64), const FILE_FLAG_OPEN_REPARSE_POINT ideal-int +pkg syscall (windows-amd64), const FSCTL_GET_REPARSE_POINT = 589992 +pkg syscall (windows-amd64), const FSCTL_GET_REPARSE_POINT ideal-int +pkg syscall (windows-amd64), const IO_REPARSE_TAG_SYMLINK = 2684354572 +pkg syscall (windows-amd64), const IO_REPARSE_TAG_SYMLINK ideal-int +pkg syscall (windows-amd64), const MAXIMUM_REPARSE_DATA_BUFFER_SIZE = 16384 +pkg syscall (windows-amd64), const MAXIMUM_REPARSE_DATA_BUFFER_SIZE ideal-int +pkg syscall (windows-amd64), const SYMBOLIC_LINK_FLAG_DIRECTORY = 1 +pkg syscall (windows-amd64), const SYMBOLIC_LINK_FLAG_DIRECTORY ideal-int +pkg syscall (windows-amd64), func CreateHardLink(*uint16, *uint16, uintptr) error +pkg syscall (windows-amd64), func CreateSymbolicLink(*uint16, *uint16, uint32) error +pkg syscall (windows-amd64), func DeviceIoControl(Handle, uint32, *uint8, uint32, *uint8, uint32, *uint32, *Overlapped) error +pkg syscall (windows-amd64), func LoadCreateSymbolicLink() error + +# CL 149510043 net: disable SIO_UDP_CONNRESET behavior on windows., Ron Hashimoto +pkg syscall (windows-386), const SIO_UDP_CONNRESET = 2550136844 +pkg syscall (windows-386), const SIO_UDP_CONNRESET ideal-int +pkg syscall (windows-amd64), const SIO_UDP_CONNRESET = 2550136844 +pkg syscall (windows-amd64), const SIO_UDP_CONNRESET ideal-int + +# CL 102320044 syscall: implement syscall.Getppid() on Windows, Alan Shreve +pkg syscall (windows-386), const TH32CS_INHERIT = 2147483648 +pkg syscall (windows-386), const TH32CS_INHERIT ideal-int +pkg syscall (windows-386), const TH32CS_SNAPALL = 15 +pkg syscall (windows-386), const TH32CS_SNAPALL ideal-int +pkg syscall (windows-386), const TH32CS_SNAPHEAPLIST = 1 +pkg syscall (windows-386), const TH32CS_SNAPHEAPLIST ideal-int +pkg syscall (windows-386), const TH32CS_SNAPMODULE = 8 +pkg syscall (windows-386), const TH32CS_SNAPMODULE ideal-int +pkg syscall (windows-386), const TH32CS_SNAPMODULE32 = 16 +pkg syscall (windows-386), const TH32CS_SNAPMODULE32 ideal-int +pkg syscall (windows-386), const TH32CS_SNAPPROCESS = 2 +pkg syscall (windows-386), const TH32CS_SNAPPROCESS ideal-int +pkg syscall (windows-386), const TH32CS_SNAPTHREAD = 4 +pkg syscall (windows-386), const TH32CS_SNAPTHREAD ideal-int +pkg syscall (windows-386), func CreateToolhelp32Snapshot(uint32, uint32) (Handle, error) +pkg syscall (windows-386), func Process32First(Handle, *ProcessEntry32) error +pkg syscall (windows-386), func Process32Next(Handle, *ProcessEntry32) error +pkg syscall (windows-386), type ProcessEntry32 struct +pkg syscall (windows-386), type ProcessEntry32 struct, DefaultHeapID uintptr +pkg syscall (windows-386), type ProcessEntry32 struct, ExeFile [260]uint16 +pkg syscall (windows-386), type ProcessEntry32 struct, Flags uint32 +pkg syscall (windows-386), type ProcessEntry32 struct, ModuleID uint32 +pkg syscall (windows-386), type ProcessEntry32 struct, ParentProcessID uint32 +pkg syscall (windows-386), type ProcessEntry32 struct, PriClassBase int32 +pkg syscall (windows-386), type ProcessEntry32 struct, ProcessID uint32 +pkg syscall (windows-386), type ProcessEntry32 struct, Size uint32 +pkg syscall (windows-386), type ProcessEntry32 struct, Threads uint32 +pkg syscall (windows-386), type ProcessEntry32 struct, Usage uint32 +pkg syscall (windows-amd64), const TH32CS_INHERIT = 2147483648 +pkg syscall (windows-amd64), const TH32CS_INHERIT ideal-int +pkg syscall (windows-amd64), const TH32CS_SNAPALL = 15 +pkg syscall (windows-amd64), const TH32CS_SNAPALL ideal-int +pkg syscall (windows-amd64), const TH32CS_SNAPHEAPLIST = 1 +pkg syscall (windows-amd64), const TH32CS_SNAPHEAPLIST ideal-int +pkg syscall (windows-amd64), const TH32CS_SNAPMODULE = 8 +pkg syscall (windows-amd64), const TH32CS_SNAPMODULE ideal-int +pkg syscall (windows-amd64), const TH32CS_SNAPMODULE32 = 16 +pkg syscall (windows-amd64), const TH32CS_SNAPMODULE32 ideal-int +pkg syscall (windows-amd64), const TH32CS_SNAPPROCESS = 2 +pkg syscall (windows-amd64), const TH32CS_SNAPPROCESS ideal-int +pkg syscall (windows-amd64), const TH32CS_SNAPTHREAD = 4 +pkg syscall (windows-amd64), const TH32CS_SNAPTHREAD ideal-int +pkg syscall (windows-amd64), func CreateToolhelp32Snapshot(uint32, uint32) (Handle, error) +pkg syscall (windows-amd64), func Process32First(Handle, *ProcessEntry32) error +pkg syscall (windows-amd64), func Process32Next(Handle, *ProcessEntry32) error +pkg syscall (windows-amd64), type ProcessEntry32 struct +pkg syscall (windows-amd64), type ProcessEntry32 struct, DefaultHeapID uintptr +pkg syscall (windows-amd64), type ProcessEntry32 struct, ExeFile [260]uint16 +pkg syscall (windows-amd64), type ProcessEntry32 struct, Flags uint32 +pkg syscall (windows-amd64), type ProcessEntry32 struct, ModuleID uint32 +pkg syscall (windows-amd64), type ProcessEntry32 struct, ParentProcessID uint32 +pkg syscall (windows-amd64), type ProcessEntry32 struct, PriClassBase int32 +pkg syscall (windows-amd64), type ProcessEntry32 struct, ProcessID uint32 +pkg syscall (windows-amd64), type ProcessEntry32 struct, Size uint32 +pkg syscall (windows-amd64), type ProcessEntry32 struct, Threads uint32 +pkg syscall (windows-amd64), type ProcessEntry32 struct, Usage uint32 + +# CL 127740043 os: make SameFile handle paths like c:a.txt properly, Alex Brainman +pkg syscall (windows-386), func FullPath(string) (string, error) +pkg syscall (windows-amd64), func FullPath(string) (string, error) + +# CL 98150043 testing: add Coverage function, Russ Cox +pkg testing, func Coverage() float64 + +# CL 148770043 cmd/go, testing: add TestMain support, Russ Cox +pkg testing, func MainStart(func(string, string) (bool, error), []InternalTest, []InternalBenchmark, []InternalExample) *M +pkg testing, method (*M) Run() int +pkg testing, type M struct + +# CL 108030044 text/scanner: provide facility for custom identifiers, Robert Griesemer +pkg text/scanner, type Scanner struct, IsIdentRune func(int32, int) bool + +# CL 130620043 text/template: add back pointer to Nodes for better error generation, Rob Pike +pkg text/template/parse, type DotNode struct, embedded NodeType +pkg text/template/parse, type NilNode struct, embedded NodeType +pkg text/template/parse, method (*BranchNode) Copy() Node +pkg text/template/parse, method (*IdentifierNode) SetTree(*Tree) *IdentifierNode +pkg html/template, type Error struct, Node parse.Node + +# CL 127470043 unicode: strconv: regexp: Upgrade to Unicode 7.0.0., Marcel van Lohuizen +pkg unicode, const Version = "7.0.0" +pkg unicode, var Bassa_Vah *RangeTable +pkg unicode, var Caucasian_Albanian *RangeTable +pkg unicode, var Duployan *RangeTable +pkg unicode, var Elbasan *RangeTable +pkg unicode, var Grantha *RangeTable +pkg unicode, var Khojki *RangeTable +pkg unicode, var Khudawadi *RangeTable +pkg unicode, var Linear_A *RangeTable +pkg unicode, var Mahajani *RangeTable +pkg unicode, var Manichaean *RangeTable +pkg unicode, var Mende_Kikakui *RangeTable +pkg unicode, var Modi *RangeTable +pkg unicode, var Mro *RangeTable +pkg unicode, var Nabataean *RangeTable +pkg unicode, var Old_North_Arabian *RangeTable +pkg unicode, var Old_Permic *RangeTable +pkg unicode, var Pahawh_Hmong *RangeTable +pkg unicode, var Palmyrene *RangeTable +pkg unicode, var Pau_Cin_Hau *RangeTable +pkg unicode, var Psalter_Pahlavi *RangeTable +pkg unicode, var Siddham *RangeTable +pkg unicode, var Tirhuta *RangeTable +pkg unicode, var Warang_Citi *RangeTable diff --git a/api/go1.5.txt b/api/go1.5.txt new file mode 100644 index 0000000000000000000000000000000000000000..d9cf7970755a40b4564423bd048dd0a06aff9739 --- /dev/null +++ b/api/go1.5.txt @@ -0,0 +1,975 @@ +pkg archive/zip, method (*Writer) SetOffset(int64) +pkg bufio, method (*Reader) Discard(int) (int, error) +pkg bufio, method (ReadWriter) Discard(int) (int, error) +pkg bytes, func LastIndexByte([]uint8, uint8) int +pkg bytes, method (*Buffer) Cap() int +pkg bytes, method (*Reader) Size() int64 +pkg crypto, const SHA512_224 = 14 +pkg crypto, const SHA512_224 Hash +pkg crypto, const SHA512_256 = 15 +pkg crypto, const SHA512_256 Hash +pkg crypto, type Decrypter interface { Decrypt, Public } +pkg crypto, type Decrypter interface, Decrypt(io.Reader, []uint8, DecrypterOpts) ([]uint8, error) +pkg crypto, type Decrypter interface, Public() PublicKey +pkg crypto, type DecrypterOpts interface {} +pkg crypto/cipher, func NewGCMWithNonceSize(Block, int) (AEAD, error) +pkg crypto/elliptic, type CurveParams struct, Name string +pkg crypto/rsa, method (*PrivateKey) Decrypt(io.Reader, []uint8, crypto.DecrypterOpts) ([]uint8, error) +pkg crypto/rsa, type OAEPOptions struct +pkg crypto/rsa, type OAEPOptions struct, Hash crypto.Hash +pkg crypto/rsa, type OAEPOptions struct, Label []uint8 +pkg crypto/rsa, type PKCS1v15DecryptOptions struct +pkg crypto/rsa, type PKCS1v15DecryptOptions struct, SessionKeyLen int +pkg crypto/sha512, const Size224 = 28 +pkg crypto/sha512, const Size224 ideal-int +pkg crypto/sha512, const Size256 = 32 +pkg crypto/sha512, const Size256 ideal-int +pkg crypto/sha512, func New512_224() hash.Hash +pkg crypto/sha512, func New512_256() hash.Hash +pkg crypto/sha512, func Sum512_224([]uint8) [28]uint8 +pkg crypto/sha512, func Sum512_256([]uint8) [32]uint8 +pkg crypto/tls, const TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 = 49196 +pkg crypto/tls, const TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 uint16 +pkg crypto/tls, const TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 = 49200 +pkg crypto/tls, const TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 uint16 +pkg crypto/tls, method (*Config) SetSessionTicketKeys([][32]uint8) +pkg crypto/tls, type Certificate struct, SignedCertificateTimestamps [][]uint8 +pkg crypto/tls, type ConnectionState struct, OCSPResponse []uint8 +pkg crypto/tls, type ConnectionState struct, SignedCertificateTimestamps [][]uint8 +pkg crypto/x509, method (*CertificateRequest) CheckSignature() error +pkg crypto/x509, type Certificate struct, UnhandledCriticalExtensions []asn1.ObjectIdentifier +pkg crypto/x509/pkix, type Name struct, ExtraNames []AttributeTypeAndValue +pkg database/sql, method (*DB) Stats() DBStats +pkg database/sql, type DBStats struct +pkg database/sql, type DBStats struct, OpenConnections int +pkg debug/dwarf, const ClassAddress = 1 +pkg debug/dwarf, const ClassAddress Class +pkg debug/dwarf, const ClassBlock = 2 +pkg debug/dwarf, const ClassBlock Class +pkg debug/dwarf, const ClassConstant = 3 +pkg debug/dwarf, const ClassConstant Class +pkg debug/dwarf, const ClassExprLoc = 4 +pkg debug/dwarf, const ClassExprLoc Class +pkg debug/dwarf, const ClassFlag = 5 +pkg debug/dwarf, const ClassFlag Class +pkg debug/dwarf, const ClassLinePtr = 6 +pkg debug/dwarf, const ClassLinePtr Class +pkg debug/dwarf, const ClassLocListPtr = 7 +pkg debug/dwarf, const ClassLocListPtr Class +pkg debug/dwarf, const ClassMacPtr = 8 +pkg debug/dwarf, const ClassMacPtr Class +pkg debug/dwarf, const ClassRangeListPtr = 9 +pkg debug/dwarf, const ClassRangeListPtr Class +pkg debug/dwarf, const ClassReference = 10 +pkg debug/dwarf, const ClassReference Class +pkg debug/dwarf, const ClassReferenceAlt = 13 +pkg debug/dwarf, const ClassReferenceAlt Class +pkg debug/dwarf, const ClassReferenceSig = 11 +pkg debug/dwarf, const ClassReferenceSig Class +pkg debug/dwarf, const ClassString = 12 +pkg debug/dwarf, const ClassString Class +pkg debug/dwarf, const ClassStringAlt = 14 +pkg debug/dwarf, const ClassStringAlt Class +pkg debug/dwarf, method (*Data) LineReader(*Entry) (*LineReader, error) +pkg debug/dwarf, method (*Entry) AttrField(Attr) *Field +pkg debug/dwarf, method (*LineReader) Next(*LineEntry) error +pkg debug/dwarf, method (*LineReader) Reset() +pkg debug/dwarf, method (*LineReader) Seek(LineReaderPos) +pkg debug/dwarf, method (*LineReader) SeekPC(uint64, *LineEntry) error +pkg debug/dwarf, method (*LineReader) Tell() LineReaderPos +pkg debug/dwarf, method (*Reader) AddressSize() int +pkg debug/dwarf, method (Class) GoString() string +pkg debug/dwarf, method (Class) String() string +pkg debug/dwarf, type Class int +pkg debug/dwarf, type Field struct, Class Class +pkg debug/dwarf, type LineEntry struct +pkg debug/dwarf, type LineEntry struct, Address uint64 +pkg debug/dwarf, type LineEntry struct, BasicBlock bool +pkg debug/dwarf, type LineEntry struct, Column int +pkg debug/dwarf, type LineEntry struct, Discriminator int +pkg debug/dwarf, type LineEntry struct, EndSequence bool +pkg debug/dwarf, type LineEntry struct, EpilogueBegin bool +pkg debug/dwarf, type LineEntry struct, File *LineFile +pkg debug/dwarf, type LineEntry struct, ISA int +pkg debug/dwarf, type LineEntry struct, IsStmt bool +pkg debug/dwarf, type LineEntry struct, Line int +pkg debug/dwarf, type LineEntry struct, OpIndex int +pkg debug/dwarf, type LineEntry struct, PrologueEnd bool +pkg debug/dwarf, type LineFile struct +pkg debug/dwarf, type LineFile struct, Length int +pkg debug/dwarf, type LineFile struct, Mtime uint64 +pkg debug/dwarf, type LineFile struct, Name string +pkg debug/dwarf, type LineReader struct +pkg debug/dwarf, type LineReaderPos struct +pkg debug/dwarf, var ErrUnknownPC error +pkg debug/elf, const R_PPC64_ADDR14 = 7 +pkg debug/elf, const R_PPC64_ADDR14 R_PPC64 +pkg debug/elf, const R_PPC64_ADDR14_BRNTAKEN = 9 +pkg debug/elf, const R_PPC64_ADDR14_BRNTAKEN R_PPC64 +pkg debug/elf, const R_PPC64_ADDR14_BRTAKEN = 8 +pkg debug/elf, const R_PPC64_ADDR14_BRTAKEN R_PPC64 +pkg debug/elf, const R_PPC64_ADDR16 = 3 +pkg debug/elf, const R_PPC64_ADDR16 R_PPC64 +pkg debug/elf, const R_PPC64_ADDR16_DS = 56 +pkg debug/elf, const R_PPC64_ADDR16_DS R_PPC64 +pkg debug/elf, const R_PPC64_ADDR16_HA = 6 +pkg debug/elf, const R_PPC64_ADDR16_HA R_PPC64 +pkg debug/elf, const R_PPC64_ADDR16_HI = 5 +pkg debug/elf, const R_PPC64_ADDR16_HI R_PPC64 +pkg debug/elf, const R_PPC64_ADDR16_HIGHER = 39 +pkg debug/elf, const R_PPC64_ADDR16_HIGHER R_PPC64 +pkg debug/elf, const R_PPC64_ADDR16_HIGHERA = 40 +pkg debug/elf, const R_PPC64_ADDR16_HIGHERA R_PPC64 +pkg debug/elf, const R_PPC64_ADDR16_HIGHEST = 41 +pkg debug/elf, const R_PPC64_ADDR16_HIGHEST R_PPC64 +pkg debug/elf, const R_PPC64_ADDR16_HIGHESTA = 42 +pkg debug/elf, const R_PPC64_ADDR16_HIGHESTA R_PPC64 +pkg debug/elf, const R_PPC64_ADDR16_LO = 4 +pkg debug/elf, const R_PPC64_ADDR16_LO R_PPC64 +pkg debug/elf, const R_PPC64_ADDR16_LO_DS = 57 +pkg debug/elf, const R_PPC64_ADDR16_LO_DS R_PPC64 +pkg debug/elf, const R_PPC64_ADDR24 = 2 +pkg debug/elf, const R_PPC64_ADDR24 R_PPC64 +pkg debug/elf, const R_PPC64_ADDR32 = 1 +pkg debug/elf, const R_PPC64_ADDR32 R_PPC64 +pkg debug/elf, const R_PPC64_ADDR64 = 38 +pkg debug/elf, const R_PPC64_ADDR64 R_PPC64 +pkg debug/elf, const R_PPC64_DTPMOD64 = 68 +pkg debug/elf, const R_PPC64_DTPMOD64 R_PPC64 +pkg debug/elf, const R_PPC64_DTPREL16 = 74 +pkg debug/elf, const R_PPC64_DTPREL16 R_PPC64 +pkg debug/elf, const R_PPC64_DTPREL16_DS = 101 +pkg debug/elf, const R_PPC64_DTPREL16_DS R_PPC64 +pkg debug/elf, const R_PPC64_DTPREL16_HA = 77 +pkg debug/elf, const R_PPC64_DTPREL16_HA R_PPC64 +pkg debug/elf, const R_PPC64_DTPREL16_HI = 76 +pkg debug/elf, const R_PPC64_DTPREL16_HI R_PPC64 +pkg debug/elf, const R_PPC64_DTPREL16_HIGHER = 103 +pkg debug/elf, const R_PPC64_DTPREL16_HIGHER R_PPC64 +pkg debug/elf, const R_PPC64_DTPREL16_HIGHERA = 104 +pkg debug/elf, const R_PPC64_DTPREL16_HIGHERA R_PPC64 +pkg debug/elf, const R_PPC64_DTPREL16_HIGHEST = 105 +pkg debug/elf, const R_PPC64_DTPREL16_HIGHEST R_PPC64 +pkg debug/elf, const R_PPC64_DTPREL16_HIGHESTA = 106 +pkg debug/elf, const R_PPC64_DTPREL16_HIGHESTA R_PPC64 +pkg debug/elf, const R_PPC64_DTPREL16_LO = 75 +pkg debug/elf, const R_PPC64_DTPREL16_LO R_PPC64 +pkg debug/elf, const R_PPC64_DTPREL16_LO_DS = 102 +pkg debug/elf, const R_PPC64_DTPREL16_LO_DS R_PPC64 +pkg debug/elf, const R_PPC64_DTPREL64 = 78 +pkg debug/elf, const R_PPC64_DTPREL64 R_PPC64 +pkg debug/elf, const R_PPC64_GOT16 = 14 +pkg debug/elf, const R_PPC64_GOT16 R_PPC64 +pkg debug/elf, const R_PPC64_GOT16_DS = 58 +pkg debug/elf, const R_PPC64_GOT16_DS R_PPC64 +pkg debug/elf, const R_PPC64_GOT16_HA = 17 +pkg debug/elf, const R_PPC64_GOT16_HA R_PPC64 +pkg debug/elf, const R_PPC64_GOT16_HI = 16 +pkg debug/elf, const R_PPC64_GOT16_HI R_PPC64 +pkg debug/elf, const R_PPC64_GOT16_LO = 15 +pkg debug/elf, const R_PPC64_GOT16_LO R_PPC64 +pkg debug/elf, const R_PPC64_GOT16_LO_DS = 59 +pkg debug/elf, const R_PPC64_GOT16_LO_DS R_PPC64 +pkg debug/elf, const R_PPC64_GOT_DTPREL16_DS = 91 +pkg debug/elf, const R_PPC64_GOT_DTPREL16_DS R_PPC64 +pkg debug/elf, const R_PPC64_GOT_DTPREL16_HA = 94 +pkg debug/elf, const R_PPC64_GOT_DTPREL16_HA R_PPC64 +pkg debug/elf, const R_PPC64_GOT_DTPREL16_HI = 93 +pkg debug/elf, const R_PPC64_GOT_DTPREL16_HI R_PPC64 +pkg debug/elf, const R_PPC64_GOT_DTPREL16_LO_DS = 92 +pkg debug/elf, const R_PPC64_GOT_DTPREL16_LO_DS R_PPC64 +pkg debug/elf, const R_PPC64_GOT_TLSGD16 = 79 +pkg debug/elf, const R_PPC64_GOT_TLSGD16 R_PPC64 +pkg debug/elf, const R_PPC64_GOT_TLSGD16_HA = 82 +pkg debug/elf, const R_PPC64_GOT_TLSGD16_HA R_PPC64 +pkg debug/elf, const R_PPC64_GOT_TLSGD16_HI = 81 +pkg debug/elf, const R_PPC64_GOT_TLSGD16_HI R_PPC64 +pkg debug/elf, const R_PPC64_GOT_TLSGD16_LO = 80 +pkg debug/elf, const R_PPC64_GOT_TLSGD16_LO R_PPC64 +pkg debug/elf, const R_PPC64_GOT_TLSLD16 = 83 +pkg debug/elf, const R_PPC64_GOT_TLSLD16 R_PPC64 +pkg debug/elf, const R_PPC64_GOT_TLSLD16_HA = 86 +pkg debug/elf, const R_PPC64_GOT_TLSLD16_HA R_PPC64 +pkg debug/elf, const R_PPC64_GOT_TLSLD16_HI = 85 +pkg debug/elf, const R_PPC64_GOT_TLSLD16_HI R_PPC64 +pkg debug/elf, const R_PPC64_GOT_TLSLD16_LO = 84 +pkg debug/elf, const R_PPC64_GOT_TLSLD16_LO R_PPC64 +pkg debug/elf, const R_PPC64_GOT_TPREL16_DS = 87 +pkg debug/elf, const R_PPC64_GOT_TPREL16_DS R_PPC64 +pkg debug/elf, const R_PPC64_GOT_TPREL16_HA = 90 +pkg debug/elf, const R_PPC64_GOT_TPREL16_HA R_PPC64 +pkg debug/elf, const R_PPC64_GOT_TPREL16_HI = 89 +pkg debug/elf, const R_PPC64_GOT_TPREL16_HI R_PPC64 +pkg debug/elf, const R_PPC64_GOT_TPREL16_LO_DS = 88 +pkg debug/elf, const R_PPC64_GOT_TPREL16_LO_DS R_PPC64 +pkg debug/elf, const R_PPC64_JMP_SLOT = 21 +pkg debug/elf, const R_PPC64_JMP_SLOT R_PPC64 +pkg debug/elf, const R_PPC64_NONE = 0 +pkg debug/elf, const R_PPC64_NONE R_PPC64 +pkg debug/elf, const R_PPC64_REL14 = 11 +pkg debug/elf, const R_PPC64_REL14 R_PPC64 +pkg debug/elf, const R_PPC64_REL14_BRNTAKEN = 13 +pkg debug/elf, const R_PPC64_REL14_BRNTAKEN R_PPC64 +pkg debug/elf, const R_PPC64_REL14_BRTAKEN = 12 +pkg debug/elf, const R_PPC64_REL14_BRTAKEN R_PPC64 +pkg debug/elf, const R_PPC64_REL16 = 249 +pkg debug/elf, const R_PPC64_REL16 R_PPC64 +pkg debug/elf, const R_PPC64_REL16_HA = 252 +pkg debug/elf, const R_PPC64_REL16_HA R_PPC64 +pkg debug/elf, const R_PPC64_REL16_HI = 251 +pkg debug/elf, const R_PPC64_REL16_HI R_PPC64 +pkg debug/elf, const R_PPC64_REL16_LO = 250 +pkg debug/elf, const R_PPC64_REL16_LO R_PPC64 +pkg debug/elf, const R_PPC64_REL24 = 10 +pkg debug/elf, const R_PPC64_REL24 R_PPC64 +pkg debug/elf, const R_PPC64_REL32 = 26 +pkg debug/elf, const R_PPC64_REL32 R_PPC64 +pkg debug/elf, const R_PPC64_REL64 = 44 +pkg debug/elf, const R_PPC64_REL64 R_PPC64 +pkg debug/elf, const R_PPC64_TLS = 67 +pkg debug/elf, const R_PPC64_TLS R_PPC64 +pkg debug/elf, const R_PPC64_TLSGD = 107 +pkg debug/elf, const R_PPC64_TLSGD R_PPC64 +pkg debug/elf, const R_PPC64_TLSLD = 108 +pkg debug/elf, const R_PPC64_TLSLD R_PPC64 +pkg debug/elf, const R_PPC64_TOC = 51 +pkg debug/elf, const R_PPC64_TOC R_PPC64 +pkg debug/elf, const R_PPC64_TOC16 = 47 +pkg debug/elf, const R_PPC64_TOC16 R_PPC64 +pkg debug/elf, const R_PPC64_TOC16_DS = 63 +pkg debug/elf, const R_PPC64_TOC16_DS R_PPC64 +pkg debug/elf, const R_PPC64_TOC16_HA = 50 +pkg debug/elf, const R_PPC64_TOC16_HA R_PPC64 +pkg debug/elf, const R_PPC64_TOC16_HI = 49 +pkg debug/elf, const R_PPC64_TOC16_HI R_PPC64 +pkg debug/elf, const R_PPC64_TOC16_LO = 48 +pkg debug/elf, const R_PPC64_TOC16_LO R_PPC64 +pkg debug/elf, const R_PPC64_TOC16_LO_DS = 64 +pkg debug/elf, const R_PPC64_TOC16_LO_DS R_PPC64 +pkg debug/elf, const R_PPC64_TPREL16 = 69 +pkg debug/elf, const R_PPC64_TPREL16 R_PPC64 +pkg debug/elf, const R_PPC64_TPREL16_DS = 95 +pkg debug/elf, const R_PPC64_TPREL16_DS R_PPC64 +pkg debug/elf, const R_PPC64_TPREL16_HA = 72 +pkg debug/elf, const R_PPC64_TPREL16_HA R_PPC64 +pkg debug/elf, const R_PPC64_TPREL16_HI = 71 +pkg debug/elf, const R_PPC64_TPREL16_HI R_PPC64 +pkg debug/elf, const R_PPC64_TPREL16_HIGHER = 97 +pkg debug/elf, const R_PPC64_TPREL16_HIGHER R_PPC64 +pkg debug/elf, const R_PPC64_TPREL16_HIGHERA = 98 +pkg debug/elf, const R_PPC64_TPREL16_HIGHERA R_PPC64 +pkg debug/elf, const R_PPC64_TPREL16_HIGHEST = 99 +pkg debug/elf, const R_PPC64_TPREL16_HIGHEST R_PPC64 +pkg debug/elf, const R_PPC64_TPREL16_HIGHESTA = 100 +pkg debug/elf, const R_PPC64_TPREL16_HIGHESTA R_PPC64 +pkg debug/elf, const R_PPC64_TPREL16_LO = 70 +pkg debug/elf, const R_PPC64_TPREL16_LO R_PPC64 +pkg debug/elf, const R_PPC64_TPREL16_LO_DS = 96 +pkg debug/elf, const R_PPC64_TPREL16_LO_DS R_PPC64 +pkg debug/elf, const R_PPC64_TPREL64 = 73 +pkg debug/elf, const R_PPC64_TPREL64 R_PPC64 +pkg debug/elf, method (R_PPC64) GoString() string +pkg debug/elf, method (R_PPC64) String() string +pkg debug/elf, type R_PPC64 int +pkg encoding/base64, const NoPadding = -1 +pkg encoding/base64, const NoPadding int32 +pkg encoding/base64, const StdPadding = 61 +pkg encoding/base64, const StdPadding int32 +pkg encoding/base64, method (Encoding) WithPadding(int32) *Encoding +pkg encoding/base64, var RawStdEncoding *Encoding +pkg encoding/base64, var RawURLEncoding *Encoding +pkg encoding/json, method (*Decoder) More() bool +pkg encoding/json, method (*Decoder) Token() (Token, error) +pkg encoding/json, method (Delim) String() string +pkg encoding/json, type Delim int32 +pkg encoding/json, type Token interface {} +pkg encoding/json, type UnmarshalTypeError struct, Offset int64 +pkg flag, func UnquoteUsage(*Flag) (string, string) +pkg go/ast, type EmptyStmt struct, Implicit bool +pkg go/build, type Package struct, PkgTargetRoot string +pkg go/constant, const Bool = 1 +pkg go/constant, const Bool Kind +pkg go/constant, const Complex = 5 +pkg go/constant, const Complex Kind +pkg go/constant, const Float = 4 +pkg go/constant, const Float Kind +pkg go/constant, const Int = 3 +pkg go/constant, const Int Kind +pkg go/constant, const String = 2 +pkg go/constant, const String Kind +pkg go/constant, const Unknown = 0 +pkg go/constant, const Unknown Kind +pkg go/constant, func BinaryOp(Value, token.Token, Value) Value +pkg go/constant, func BitLen(Value) int +pkg go/constant, func BoolVal(Value) bool +pkg go/constant, func Bytes(Value) []uint8 +pkg go/constant, func Compare(Value, token.Token, Value) bool +pkg go/constant, func Denom(Value) Value +pkg go/constant, func Float32Val(Value) (float32, bool) +pkg go/constant, func Float64Val(Value) (float64, bool) +pkg go/constant, func Imag(Value) Value +pkg go/constant, func Int64Val(Value) (int64, bool) +pkg go/constant, func MakeBool(bool) Value +pkg go/constant, func MakeFloat64(float64) Value +pkg go/constant, func MakeFromBytes([]uint8) Value +pkg go/constant, func MakeFromLiteral(string, token.Token, uint) Value +pkg go/constant, func MakeImag(Value) Value +pkg go/constant, func MakeInt64(int64) Value +pkg go/constant, func MakeString(string) Value +pkg go/constant, func MakeUint64(uint64) Value +pkg go/constant, func MakeUnknown() Value +pkg go/constant, func Num(Value) Value +pkg go/constant, func Real(Value) Value +pkg go/constant, func Shift(Value, token.Token, uint) Value +pkg go/constant, func Sign(Value) int +pkg go/constant, func StringVal(Value) string +pkg go/constant, func Uint64Val(Value) (uint64, bool) +pkg go/constant, func UnaryOp(token.Token, Value, uint) Value +pkg go/constant, type Kind int +pkg go/constant, type Value interface, Kind() Kind +pkg go/constant, type Value interface, String() string +pkg go/constant, type Value interface, unexported methods +pkg go/importer, func Default() types.Importer +pkg go/importer, func For(string, Lookup) types.Importer +pkg go/importer, type Lookup func(string) (io.ReadCloser, error) +pkg go/parser, func ParseExprFrom(*token.FileSet, string, interface{}, Mode) (ast.Expr, error) +pkg go/types, const Bool = 1 +pkg go/types, const Bool BasicKind +pkg go/types, const Byte = 8 +pkg go/types, const Byte BasicKind +pkg go/types, const Complex128 = 16 +pkg go/types, const Complex128 BasicKind +pkg go/types, const Complex64 = 15 +pkg go/types, const Complex64 BasicKind +pkg go/types, const FieldVal = 0 +pkg go/types, const FieldVal SelectionKind +pkg go/types, const Float32 = 13 +pkg go/types, const Float32 BasicKind +pkg go/types, const Float64 = 14 +pkg go/types, const Float64 BasicKind +pkg go/types, const Int = 2 +pkg go/types, const Int BasicKind +pkg go/types, const Int16 = 4 +pkg go/types, const Int16 BasicKind +pkg go/types, const Int32 = 5 +pkg go/types, const Int32 BasicKind +pkg go/types, const Int64 = 6 +pkg go/types, const Int64 BasicKind +pkg go/types, const Int8 = 3 +pkg go/types, const Int8 BasicKind +pkg go/types, const Invalid = 0 +pkg go/types, const Invalid BasicKind +pkg go/types, const IsBoolean = 1 +pkg go/types, const IsBoolean BasicInfo +pkg go/types, const IsComplex = 16 +pkg go/types, const IsComplex BasicInfo +pkg go/types, const IsConstType = 59 +pkg go/types, const IsConstType BasicInfo +pkg go/types, const IsFloat = 8 +pkg go/types, const IsFloat BasicInfo +pkg go/types, const IsInteger = 2 +pkg go/types, const IsInteger BasicInfo +pkg go/types, const IsNumeric = 26 +pkg go/types, const IsNumeric BasicInfo +pkg go/types, const IsOrdered = 42 +pkg go/types, const IsOrdered BasicInfo +pkg go/types, const IsString = 32 +pkg go/types, const IsString BasicInfo +pkg go/types, const IsUnsigned = 4 +pkg go/types, const IsUnsigned BasicInfo +pkg go/types, const IsUntyped = 64 +pkg go/types, const IsUntyped BasicInfo +pkg go/types, const MethodExpr = 2 +pkg go/types, const MethodExpr SelectionKind +pkg go/types, const MethodVal = 1 +pkg go/types, const MethodVal SelectionKind +pkg go/types, const RecvOnly = 2 +pkg go/types, const RecvOnly ChanDir +pkg go/types, const Rune = 5 +pkg go/types, const Rune BasicKind +pkg go/types, const SendOnly = 1 +pkg go/types, const SendOnly ChanDir +pkg go/types, const SendRecv = 0 +pkg go/types, const SendRecv ChanDir +pkg go/types, const String = 17 +pkg go/types, const String BasicKind +pkg go/types, const Uint = 7 +pkg go/types, const Uint BasicKind +pkg go/types, const Uint16 = 9 +pkg go/types, const Uint16 BasicKind +pkg go/types, const Uint32 = 10 +pkg go/types, const Uint32 BasicKind +pkg go/types, const Uint64 = 11 +pkg go/types, const Uint64 BasicKind +pkg go/types, const Uint8 = 8 +pkg go/types, const Uint8 BasicKind +pkg go/types, const Uintptr = 12 +pkg go/types, const Uintptr BasicKind +pkg go/types, const UnsafePointer = 18 +pkg go/types, const UnsafePointer BasicKind +pkg go/types, const UntypedBool = 19 +pkg go/types, const UntypedBool BasicKind +pkg go/types, const UntypedComplex = 23 +pkg go/types, const UntypedComplex BasicKind +pkg go/types, const UntypedFloat = 22 +pkg go/types, const UntypedFloat BasicKind +pkg go/types, const UntypedInt = 20 +pkg go/types, const UntypedInt BasicKind +pkg go/types, const UntypedNil = 25 +pkg go/types, const UntypedNil BasicKind +pkg go/types, const UntypedRune = 21 +pkg go/types, const UntypedRune BasicKind +pkg go/types, const UntypedString = 24 +pkg go/types, const UntypedString BasicKind +pkg go/types, func AssertableTo(*Interface, Type) bool +pkg go/types, func AssignableTo(Type, Type) bool +pkg go/types, func Comparable(Type) bool +pkg go/types, func ConvertibleTo(Type, Type) bool +pkg go/types, func DefPredeclaredTestFuncs() +pkg go/types, func Eval(*token.FileSet, *Package, token.Pos, string) (TypeAndValue, error) +pkg go/types, func ExprString(ast.Expr) string +pkg go/types, func Id(*Package, string) string +pkg go/types, func Identical(Type, Type) bool +pkg go/types, func Implements(Type, *Interface) bool +pkg go/types, func IsInterface(Type) bool +pkg go/types, func LookupFieldOrMethod(Type, bool, *Package, string) (Object, []int, bool) +pkg go/types, func MissingMethod(Type, *Interface, bool) (*Func, bool) +pkg go/types, func NewArray(Type, int64) *Array +pkg go/types, func NewChan(ChanDir, Type) *Chan +pkg go/types, func NewChecker(*Config, *token.FileSet, *Package, *Info) *Checker +pkg go/types, func NewConst(token.Pos, *Package, string, Type, constant.Value) *Const +pkg go/types, func NewField(token.Pos, *Package, string, Type, bool) *Var +pkg go/types, func NewFunc(token.Pos, *Package, string, *Signature) *Func +pkg go/types, func NewInterface([]*Func, []*Named) *Interface +pkg go/types, func NewLabel(token.Pos, *Package, string) *Label +pkg go/types, func NewMap(Type, Type) *Map +pkg go/types, func NewMethodSet(Type) *MethodSet +pkg go/types, func NewNamed(*TypeName, Type, []*Func) *Named +pkg go/types, func NewPackage(string, string) *Package +pkg go/types, func NewParam(token.Pos, *Package, string, Type) *Var +pkg go/types, func NewPkgName(token.Pos, *Package, string, *Package) *PkgName +pkg go/types, func NewPointer(Type) *Pointer +pkg go/types, func NewScope(*Scope, token.Pos, token.Pos, string) *Scope +pkg go/types, func NewSignature(*Var, *Tuple, *Tuple, bool) *Signature +pkg go/types, func NewSlice(Type) *Slice +pkg go/types, func NewStruct([]*Var, []string) *Struct +pkg go/types, func NewTuple(...*Var) *Tuple +pkg go/types, func NewTypeName(token.Pos, *Package, string, Type) *TypeName +pkg go/types, func NewVar(token.Pos, *Package, string, Type) *Var +pkg go/types, func ObjectString(Object, Qualifier) string +pkg go/types, func RelativeTo(*Package) Qualifier +pkg go/types, func SelectionString(*Selection, Qualifier) string +pkg go/types, func TypeString(Type, Qualifier) string +pkg go/types, func WriteExpr(*bytes.Buffer, ast.Expr) +pkg go/types, func WriteSignature(*bytes.Buffer, *Signature, Qualifier) +pkg go/types, func WriteType(*bytes.Buffer, Type, Qualifier) +pkg go/types, method (*Array) Elem() Type +pkg go/types, method (*Array) Len() int64 +pkg go/types, method (*Array) String() string +pkg go/types, method (*Array) Underlying() Type +pkg go/types, method (*Basic) Info() BasicInfo +pkg go/types, method (*Basic) Kind() BasicKind +pkg go/types, method (*Basic) Name() string +pkg go/types, method (*Basic) String() string +pkg go/types, method (*Basic) Underlying() Type +pkg go/types, method (*Builtin) Exported() bool +pkg go/types, method (*Builtin) Id() string +pkg go/types, method (*Builtin) Name() string +pkg go/types, method (*Builtin) Parent() *Scope +pkg go/types, method (*Builtin) Pkg() *Package +pkg go/types, method (*Builtin) Pos() token.Pos +pkg go/types, method (*Builtin) String() string +pkg go/types, method (*Builtin) Type() Type +pkg go/types, method (*Chan) Dir() ChanDir +pkg go/types, method (*Chan) Elem() Type +pkg go/types, method (*Chan) String() string +pkg go/types, method (*Chan) Underlying() Type +pkg go/types, method (*Checker) Files([]*ast.File) error +pkg go/types, method (*Config) Check(string, *token.FileSet, []*ast.File, *Info) (*Package, error) +pkg go/types, method (*Const) Exported() bool +pkg go/types, method (*Const) Id() string +pkg go/types, method (*Const) Name() string +pkg go/types, method (*Const) Parent() *Scope +pkg go/types, method (*Const) Pkg() *Package +pkg go/types, method (*Const) Pos() token.Pos +pkg go/types, method (*Const) String() string +pkg go/types, method (*Const) Type() Type +pkg go/types, method (*Const) Val() constant.Value +pkg go/types, method (*Func) Exported() bool +pkg go/types, method (*Func) FullName() string +pkg go/types, method (*Func) Id() string +pkg go/types, method (*Func) Name() string +pkg go/types, method (*Func) Parent() *Scope +pkg go/types, method (*Func) Pkg() *Package +pkg go/types, method (*Func) Pos() token.Pos +pkg go/types, method (*Func) Scope() *Scope +pkg go/types, method (*Func) String() string +pkg go/types, method (*Func) Type() Type +pkg go/types, method (*Info) ObjectOf(*ast.Ident) Object +pkg go/types, method (*Info) TypeOf(ast.Expr) Type +pkg go/types, method (*Initializer) String() string +pkg go/types, method (*Interface) Complete() *Interface +pkg go/types, method (*Interface) Embedded(int) *Named +pkg go/types, method (*Interface) Empty() bool +pkg go/types, method (*Interface) ExplicitMethod(int) *Func +pkg go/types, method (*Interface) Method(int) *Func +pkg go/types, method (*Interface) NumEmbeddeds() int +pkg go/types, method (*Interface) NumExplicitMethods() int +pkg go/types, method (*Interface) NumMethods() int +pkg go/types, method (*Interface) String() string +pkg go/types, method (*Interface) Underlying() Type +pkg go/types, method (*Label) Exported() bool +pkg go/types, method (*Label) Id() string +pkg go/types, method (*Label) Name() string +pkg go/types, method (*Label) Parent() *Scope +pkg go/types, method (*Label) Pkg() *Package +pkg go/types, method (*Label) Pos() token.Pos +pkg go/types, method (*Label) String() string +pkg go/types, method (*Label) Type() Type +pkg go/types, method (*Map) Elem() Type +pkg go/types, method (*Map) Key() Type +pkg go/types, method (*Map) String() string +pkg go/types, method (*Map) Underlying() Type +pkg go/types, method (*MethodSet) At(int) *Selection +pkg go/types, method (*MethodSet) Len() int +pkg go/types, method (*MethodSet) Lookup(*Package, string) *Selection +pkg go/types, method (*MethodSet) String() string +pkg go/types, method (*Named) AddMethod(*Func) +pkg go/types, method (*Named) Method(int) *Func +pkg go/types, method (*Named) NumMethods() int +pkg go/types, method (*Named) Obj() *TypeName +pkg go/types, method (*Named) SetUnderlying(Type) +pkg go/types, method (*Named) String() string +pkg go/types, method (*Named) Underlying() Type +pkg go/types, method (*Nil) Exported() bool +pkg go/types, method (*Nil) Id() string +pkg go/types, method (*Nil) Name() string +pkg go/types, method (*Nil) Parent() *Scope +pkg go/types, method (*Nil) Pkg() *Package +pkg go/types, method (*Nil) Pos() token.Pos +pkg go/types, method (*Nil) String() string +pkg go/types, method (*Nil) Type() Type +pkg go/types, method (*Package) Complete() bool +pkg go/types, method (*Package) Imports() []*Package +pkg go/types, method (*Package) MarkComplete() +pkg go/types, method (*Package) Name() string +pkg go/types, method (*Package) Path() string +pkg go/types, method (*Package) Scope() *Scope +pkg go/types, method (*Package) SetImports([]*Package) +pkg go/types, method (*Package) String() string +pkg go/types, method (*PkgName) Exported() bool +pkg go/types, method (*PkgName) Id() string +pkg go/types, method (*PkgName) Imported() *Package +pkg go/types, method (*PkgName) Name() string +pkg go/types, method (*PkgName) Parent() *Scope +pkg go/types, method (*PkgName) Pkg() *Package +pkg go/types, method (*PkgName) Pos() token.Pos +pkg go/types, method (*PkgName) String() string +pkg go/types, method (*PkgName) Type() Type +pkg go/types, method (*Pointer) Elem() Type +pkg go/types, method (*Pointer) String() string +pkg go/types, method (*Pointer) Underlying() Type +pkg go/types, method (*Scope) Child(int) *Scope +pkg go/types, method (*Scope) Contains(token.Pos) bool +pkg go/types, method (*Scope) End() token.Pos +pkg go/types, method (*Scope) Innermost(token.Pos) *Scope +pkg go/types, method (*Scope) Insert(Object) Object +pkg go/types, method (*Scope) Len() int +pkg go/types, method (*Scope) Lookup(string) Object +pkg go/types, method (*Scope) LookupParent(string, token.Pos) (*Scope, Object) +pkg go/types, method (*Scope) Names() []string +pkg go/types, method (*Scope) NumChildren() int +pkg go/types, method (*Scope) Parent() *Scope +pkg go/types, method (*Scope) Pos() token.Pos +pkg go/types, method (*Scope) String() string +pkg go/types, method (*Scope) WriteTo(io.Writer, int, bool) +pkg go/types, method (*Selection) Index() []int +pkg go/types, method (*Selection) Indirect() bool +pkg go/types, method (*Selection) Kind() SelectionKind +pkg go/types, method (*Selection) Obj() Object +pkg go/types, method (*Selection) Recv() Type +pkg go/types, method (*Selection) String() string +pkg go/types, method (*Selection) Type() Type +pkg go/types, method (*Signature) Params() *Tuple +pkg go/types, method (*Signature) Recv() *Var +pkg go/types, method (*Signature) Results() *Tuple +pkg go/types, method (*Signature) String() string +pkg go/types, method (*Signature) Underlying() Type +pkg go/types, method (*Signature) Variadic() bool +pkg go/types, method (*Slice) Elem() Type +pkg go/types, method (*Slice) String() string +pkg go/types, method (*Slice) Underlying() Type +pkg go/types, method (*StdSizes) Alignof(Type) int64 +pkg go/types, method (*StdSizes) Offsetsof([]*Var) []int64 +pkg go/types, method (*StdSizes) Sizeof(Type) int64 +pkg go/types, method (*Struct) Field(int) *Var +pkg go/types, method (*Struct) NumFields() int +pkg go/types, method (*Struct) String() string +pkg go/types, method (*Struct) Tag(int) string +pkg go/types, method (*Struct) Underlying() Type +pkg go/types, method (*Tuple) At(int) *Var +pkg go/types, method (*Tuple) Len() int +pkg go/types, method (*Tuple) String() string +pkg go/types, method (*Tuple) Underlying() Type +pkg go/types, method (*TypeName) Exported() bool +pkg go/types, method (*TypeName) Id() string +pkg go/types, method (*TypeName) Name() string +pkg go/types, method (*TypeName) Parent() *Scope +pkg go/types, method (*TypeName) Pkg() *Package +pkg go/types, method (*TypeName) Pos() token.Pos +pkg go/types, method (*TypeName) String() string +pkg go/types, method (*TypeName) Type() Type +pkg go/types, method (*Var) Anonymous() bool +pkg go/types, method (*Var) Exported() bool +pkg go/types, method (*Var) Id() string +pkg go/types, method (*Var) IsField() bool +pkg go/types, method (*Var) Name() string +pkg go/types, method (*Var) Parent() *Scope +pkg go/types, method (*Var) Pkg() *Package +pkg go/types, method (*Var) Pos() token.Pos +pkg go/types, method (*Var) String() string +pkg go/types, method (*Var) Type() Type +pkg go/types, method (Checker) ObjectOf(*ast.Ident) Object +pkg go/types, method (Checker) TypeOf(ast.Expr) Type +pkg go/types, method (Error) Error() string +pkg go/types, method (TypeAndValue) Addressable() bool +pkg go/types, method (TypeAndValue) Assignable() bool +pkg go/types, method (TypeAndValue) HasOk() bool +pkg go/types, method (TypeAndValue) IsBuiltin() bool +pkg go/types, method (TypeAndValue) IsNil() bool +pkg go/types, method (TypeAndValue) IsType() bool +pkg go/types, method (TypeAndValue) IsValue() bool +pkg go/types, method (TypeAndValue) IsVoid() bool +pkg go/types, type Array struct +pkg go/types, type Basic struct +pkg go/types, type BasicInfo int +pkg go/types, type BasicKind int +pkg go/types, type Builtin struct +pkg go/types, type Chan struct +pkg go/types, type ChanDir int +pkg go/types, type Checker struct +pkg go/types, type Checker struct, embedded *Info +pkg go/types, type Config struct +pkg go/types, type Config struct, DisableUnusedImportCheck bool +pkg go/types, type Config struct, Error func(error) +pkg go/types, type Config struct, FakeImportC bool +pkg go/types, type Config struct, IgnoreFuncBodies bool +pkg go/types, type Config struct, Importer Importer +pkg go/types, type Config struct, Sizes Sizes +pkg go/types, type Const struct +pkg go/types, type Error struct +pkg go/types, type Error struct, Fset *token.FileSet +pkg go/types, type Error struct, Msg string +pkg go/types, type Error struct, Pos token.Pos +pkg go/types, type Error struct, Soft bool +pkg go/types, type Func struct +pkg go/types, type Importer interface { Import } +pkg go/types, type Importer interface, Import(string) (*Package, error) +pkg go/types, type Info struct +pkg go/types, type Info struct, Defs map[*ast.Ident]Object +pkg go/types, type Info struct, Implicits map[ast.Node]Object +pkg go/types, type Info struct, InitOrder []*Initializer +pkg go/types, type Info struct, Scopes map[ast.Node]*Scope +pkg go/types, type Info struct, Selections map[*ast.SelectorExpr]*Selection +pkg go/types, type Info struct, Types map[ast.Expr]TypeAndValue +pkg go/types, type Info struct, Uses map[*ast.Ident]Object +pkg go/types, type Initializer struct +pkg go/types, type Initializer struct, Lhs []*Var +pkg go/types, type Initializer struct, Rhs ast.Expr +pkg go/types, type Interface struct +pkg go/types, type Label struct +pkg go/types, type Map struct +pkg go/types, type MethodSet struct +pkg go/types, type Named struct +pkg go/types, type Nil struct +pkg go/types, type Object interface, Exported() bool +pkg go/types, type Object interface, Id() string +pkg go/types, type Object interface, Name() string +pkg go/types, type Object interface, Parent() *Scope +pkg go/types, type Object interface, Pkg() *Package +pkg go/types, type Object interface, Pos() token.Pos +pkg go/types, type Object interface, String() string +pkg go/types, type Object interface, Type() Type +pkg go/types, type Object interface, unexported methods +pkg go/types, type Package struct +pkg go/types, type PkgName struct +pkg go/types, type Pointer struct +pkg go/types, type Qualifier func(*Package) string +pkg go/types, type Scope struct +pkg go/types, type Selection struct +pkg go/types, type SelectionKind int +pkg go/types, type Signature struct +pkg go/types, type Sizes interface { Alignof, Offsetsof, Sizeof } +pkg go/types, type Sizes interface, Alignof(Type) int64 +pkg go/types, type Sizes interface, Offsetsof([]*Var) []int64 +pkg go/types, type Sizes interface, Sizeof(Type) int64 +pkg go/types, type Slice struct +pkg go/types, type StdSizes struct +pkg go/types, type StdSizes struct, MaxAlign int64 +pkg go/types, type StdSizes struct, WordSize int64 +pkg go/types, type Struct struct +pkg go/types, type Tuple struct +pkg go/types, type Type interface { String, Underlying } +pkg go/types, type Type interface, String() string +pkg go/types, type Type interface, Underlying() Type +pkg go/types, type TypeAndValue struct +pkg go/types, type TypeAndValue struct, Type Type +pkg go/types, type TypeAndValue struct, Value constant.Value +pkg go/types, type TypeName struct +pkg go/types, type Var struct +pkg go/types, var Typ []*Basic +pkg go/types, var Universe *Scope +pkg go/types, var Unsafe *Package +pkg html/template, method (*Template) Option(...string) *Template +pkg image, const YCbCrSubsampleRatio410 = 5 +pkg image, const YCbCrSubsampleRatio410 YCbCrSubsampleRatio +pkg image, const YCbCrSubsampleRatio411 = 4 +pkg image, const YCbCrSubsampleRatio411 YCbCrSubsampleRatio +pkg image, func NewCMYK(Rectangle) *CMYK +pkg image, method (*CMYK) At(int, int) color.Color +pkg image, method (*CMYK) Bounds() Rectangle +pkg image, method (*CMYK) CMYKAt(int, int) color.CMYK +pkg image, method (*CMYK) ColorModel() color.Model +pkg image, method (*CMYK) Opaque() bool +pkg image, method (*CMYK) PixOffset(int, int) int +pkg image, method (*CMYK) Set(int, int, color.Color) +pkg image, method (*CMYK) SetCMYK(int, int, color.CMYK) +pkg image, method (*CMYK) SubImage(Rectangle) Image +pkg image, method (Rectangle) At(int, int) color.Color +pkg image, method (Rectangle) Bounds() Rectangle +pkg image, method (Rectangle) ColorModel() color.Model +pkg image, type CMYK struct +pkg image, type CMYK struct, Pix []uint8 +pkg image, type CMYK struct, Rect Rectangle +pkg image, type CMYK struct, Stride int +pkg image/color, func CMYKToRGB(uint8, uint8, uint8, uint8) (uint8, uint8, uint8) +pkg image/color, func RGBToCMYK(uint8, uint8, uint8) (uint8, uint8, uint8, uint8) +pkg image/color, method (CMYK) RGBA() (uint32, uint32, uint32, uint32) +pkg image/color, type CMYK struct +pkg image/color, type CMYK struct, C uint8 +pkg image/color, type CMYK struct, K uint8 +pkg image/color, type CMYK struct, M uint8 +pkg image/color, type CMYK struct, Y uint8 +pkg image/color, var CMYKModel Model +pkg image/gif, const DisposalBackground = 2 +pkg image/gif, const DisposalBackground ideal-int +pkg image/gif, const DisposalNone = 1 +pkg image/gif, const DisposalNone ideal-int +pkg image/gif, const DisposalPrevious = 3 +pkg image/gif, const DisposalPrevious ideal-int +pkg image/gif, type GIF struct, BackgroundIndex uint8 +pkg image/gif, type GIF struct, Config image.Config +pkg image/gif, type GIF struct, Disposal []uint8 +pkg io, func CopyBuffer(Writer, Reader, []uint8) (int64, error) +pkg log, const LUTC = 32 +pkg log, const LUTC ideal-int +pkg log, func Output(int, string) error +pkg log, method (*Logger) SetOutput(io.Writer) +pkg math/big, const Above = 1 +pkg math/big, const Above Accuracy +pkg math/big, const AwayFromZero = 3 +pkg math/big, const AwayFromZero RoundingMode +pkg math/big, const Below = -1 +pkg math/big, const Below Accuracy +pkg math/big, const Exact = 0 +pkg math/big, const Exact Accuracy +pkg math/big, const MaxExp = 2147483647 +pkg math/big, const MaxExp ideal-int +pkg math/big, const MaxPrec = 4294967295 +pkg math/big, const MaxPrec ideal-int +pkg math/big, const MinExp = -2147483648 +pkg math/big, const MinExp ideal-int +pkg math/big, const ToNearestAway = 1 +pkg math/big, const ToNearestAway RoundingMode +pkg math/big, const ToNearestEven = 0 +pkg math/big, const ToNearestEven RoundingMode +pkg math/big, const ToNegativeInf = 4 +pkg math/big, const ToNegativeInf RoundingMode +pkg math/big, const ToPositiveInf = 5 +pkg math/big, const ToPositiveInf RoundingMode +pkg math/big, const ToZero = 2 +pkg math/big, const ToZero RoundingMode +pkg math/big, func Jacobi(*Int, *Int) int +pkg math/big, func NewFloat(float64) *Float +pkg math/big, func ParseFloat(string, int, uint, RoundingMode) (*Float, int, error) +pkg math/big, method (*Float) Abs(*Float) *Float +pkg math/big, method (*Float) Acc() Accuracy +pkg math/big, method (*Float) Add(*Float, *Float) *Float +pkg math/big, method (*Float) Append([]uint8, uint8, int) []uint8 +pkg math/big, method (*Float) Cmp(*Float) int +pkg math/big, method (*Float) Copy(*Float) *Float +pkg math/big, method (*Float) Float32() (float32, Accuracy) +pkg math/big, method (*Float) Float64() (float64, Accuracy) +pkg math/big, method (*Float) Format(fmt.State, int32) +pkg math/big, method (*Float) Int(*Int) (*Int, Accuracy) +pkg math/big, method (*Float) Int64() (int64, Accuracy) +pkg math/big, method (*Float) IsInf() bool +pkg math/big, method (*Float) IsInt() bool +pkg math/big, method (*Float) MantExp(*Float) int +pkg math/big, method (*Float) MinPrec() uint +pkg math/big, method (*Float) Mode() RoundingMode +pkg math/big, method (*Float) Mul(*Float, *Float) *Float +pkg math/big, method (*Float) Neg(*Float) *Float +pkg math/big, method (*Float) Parse(string, int) (*Float, int, error) +pkg math/big, method (*Float) Prec() uint +pkg math/big, method (*Float) Quo(*Float, *Float) *Float +pkg math/big, method (*Float) Rat(*Rat) (*Rat, Accuracy) +pkg math/big, method (*Float) Set(*Float) *Float +pkg math/big, method (*Float) SetFloat64(float64) *Float +pkg math/big, method (*Float) SetInf(bool) *Float +pkg math/big, method (*Float) SetInt(*Int) *Float +pkg math/big, method (*Float) SetInt64(int64) *Float +pkg math/big, method (*Float) SetMantExp(*Float, int) *Float +pkg math/big, method (*Float) SetMode(RoundingMode) *Float +pkg math/big, method (*Float) SetPrec(uint) *Float +pkg math/big, method (*Float) SetRat(*Rat) *Float +pkg math/big, method (*Float) SetString(string) (*Float, bool) +pkg math/big, method (*Float) SetUint64(uint64) *Float +pkg math/big, method (*Float) Sign() int +pkg math/big, method (*Float) Signbit() bool +pkg math/big, method (*Float) String() string +pkg math/big, method (*Float) Sub(*Float, *Float) *Float +pkg math/big, method (*Float) Text(uint8, int) string +pkg math/big, method (*Float) Uint64() (uint64, Accuracy) +pkg math/big, method (*Int) ModSqrt(*Int, *Int) *Int +pkg math/big, method (Accuracy) String() string +pkg math/big, method (ErrNaN) Error() string +pkg math/big, method (RoundingMode) String() string +pkg math/big, type Accuracy int8 +pkg math/big, type ErrNaN struct +pkg math/big, type Float struct +pkg math/big, type RoundingMode uint8 +pkg mime, const BEncoding = 98 +pkg mime, const BEncoding WordEncoder +pkg mime, const QEncoding = 113 +pkg mime, const QEncoding WordEncoder +pkg mime, func ExtensionsByType(string) ([]string, error) +pkg mime, method (*WordDecoder) Decode(string) (string, error) +pkg mime, method (*WordDecoder) DecodeHeader(string) (string, error) +pkg mime, method (WordEncoder) Encode(string, string) string +pkg mime, type WordDecoder struct +pkg mime, type WordDecoder struct, CharsetReader func(string, io.Reader) (io.Reader, error) +pkg mime, type WordEncoder uint8 +pkg mime/quotedprintable, func NewReader(io.Reader) *Reader +pkg mime/quotedprintable, func NewWriter(io.Writer) *Writer +pkg mime/quotedprintable, method (*Reader) Read([]uint8) (int, error) +pkg mime/quotedprintable, method (*Writer) Close() error +pkg mime/quotedprintable, method (*Writer) Write([]uint8) (int, error) +pkg mime/quotedprintable, type Reader struct +pkg mime/quotedprintable, type Writer struct +pkg mime/quotedprintable, type Writer struct, Binary bool +pkg net, type Dialer struct, FallbackDelay time.Duration +pkg net, type OpError struct, Source Addr +pkg net/http, type Request struct, Cancel <-chan struct +pkg net/http/fcgi, var ErrConnClosed error +pkg net/http/fcgi, var ErrRequestAborted error +pkg net/http/pprof, func Trace(http.ResponseWriter, *http.Request) +pkg net/mail, method (*AddressParser) Parse(string) (*Address, error) +pkg net/mail, method (*AddressParser) ParseList(string) ([]*Address, error) +pkg net/mail, type AddressParser struct +pkg net/mail, type AddressParser struct, WordDecoder *mime.WordDecoder +pkg net/smtp, method (*Client) TLSConnectionState() (tls.ConnectionState, bool) +pkg net/url, method (*URL) EscapedPath() string +pkg net/url, type URL struct, RawPath string +pkg os, func LookupEnv(string) (string, bool) +pkg os/signal, func Ignore(...os.Signal) +pkg os/signal, func Reset(...os.Signal) +pkg reflect, func ArrayOf(int, Type) Type +pkg reflect, func FuncOf([]Type, []Type, bool) Type +pkg runtime, func ReadTrace() []uint8 +pkg runtime, func StartTrace() error +pkg runtime, func StopTrace() +pkg runtime, type MemStats struct, GCCPUFraction float64 +pkg runtime/trace, func Start(io.Writer) error +pkg runtime/trace, func Stop() +pkg strings, func Compare(string, string) int +pkg strings, func LastIndexByte(string, uint8) int +pkg strings, method (*Reader) Size() int64 +pkg syscall (darwin-386), type SysProcAttr struct, Ctty int +pkg syscall (darwin-386), type SysProcAttr struct, Foreground bool +pkg syscall (darwin-386), type SysProcAttr struct, Pgid int +pkg syscall (darwin-386-cgo), type SysProcAttr struct, Ctty int +pkg syscall (darwin-386-cgo), type SysProcAttr struct, Foreground bool +pkg syscall (darwin-386-cgo), type SysProcAttr struct, Pgid int +pkg syscall (darwin-amd64), type SysProcAttr struct, Ctty int +pkg syscall (darwin-amd64), type SysProcAttr struct, Foreground bool +pkg syscall (darwin-amd64), type SysProcAttr struct, Pgid int +pkg syscall (darwin-amd64-cgo), type SysProcAttr struct, Ctty int +pkg syscall (darwin-amd64-cgo), type SysProcAttr struct, Foreground bool +pkg syscall (darwin-amd64-cgo), type SysProcAttr struct, Pgid int +pkg syscall (freebsd-386), type SysProcAttr struct, Ctty int +pkg syscall (freebsd-386), type SysProcAttr struct, Foreground bool +pkg syscall (freebsd-386), type SysProcAttr struct, Pgid int +pkg syscall (freebsd-386-cgo), type SysProcAttr struct, Ctty int +pkg syscall (freebsd-386-cgo), type SysProcAttr struct, Foreground bool +pkg syscall (freebsd-386-cgo), type SysProcAttr struct, Pgid int +pkg syscall (freebsd-amd64), type SysProcAttr struct, Ctty int +pkg syscall (freebsd-amd64), type SysProcAttr struct, Foreground bool +pkg syscall (freebsd-amd64), type SysProcAttr struct, Pgid int +pkg syscall (freebsd-amd64-cgo), type SysProcAttr struct, Ctty int +pkg syscall (freebsd-amd64-cgo), type SysProcAttr struct, Foreground bool +pkg syscall (freebsd-amd64-cgo), type SysProcAttr struct, Pgid int +pkg syscall (freebsd-arm), type SysProcAttr struct, Ctty int +pkg syscall (freebsd-arm), type SysProcAttr struct, Foreground bool +pkg syscall (freebsd-arm), type SysProcAttr struct, Pgid int +pkg syscall (freebsd-arm-cgo), type SysProcAttr struct, Ctty int +pkg syscall (freebsd-arm-cgo), type SysProcAttr struct, Foreground bool +pkg syscall (freebsd-arm-cgo), type SysProcAttr struct, Pgid int +pkg syscall (linux-386), type SysProcAttr struct, Foreground bool +pkg syscall (linux-386), type SysProcAttr struct, GidMappingsEnableSetgroups bool +pkg syscall (linux-386), type SysProcAttr struct, Pgid int +pkg syscall (linux-386-cgo), type SysProcAttr struct, Foreground bool +pkg syscall (linux-386-cgo), type SysProcAttr struct, GidMappingsEnableSetgroups bool +pkg syscall (linux-386-cgo), type SysProcAttr struct, Pgid int +pkg syscall (linux-amd64), type SysProcAttr struct, Foreground bool +pkg syscall (linux-amd64), type SysProcAttr struct, GidMappingsEnableSetgroups bool +pkg syscall (linux-amd64), type SysProcAttr struct, Pgid int +pkg syscall (linux-amd64-cgo), type SysProcAttr struct, Foreground bool +pkg syscall (linux-amd64-cgo), type SysProcAttr struct, GidMappingsEnableSetgroups bool +pkg syscall (linux-amd64-cgo), type SysProcAttr struct, Pgid int +pkg syscall (linux-arm), type SysProcAttr struct, Foreground bool +pkg syscall (linux-arm), type SysProcAttr struct, GidMappingsEnableSetgroups bool +pkg syscall (linux-arm), type SysProcAttr struct, Pgid int +pkg syscall (linux-arm-cgo), type SysProcAttr struct, Foreground bool +pkg syscall (linux-arm-cgo), type SysProcAttr struct, GidMappingsEnableSetgroups bool +pkg syscall (linux-arm-cgo), type SysProcAttr struct, Pgid int +pkg syscall (netbsd-386), type SysProcAttr struct, Ctty int +pkg syscall (netbsd-386), type SysProcAttr struct, Foreground bool +pkg syscall (netbsd-386), type SysProcAttr struct, Pgid int +pkg syscall (netbsd-386-cgo), type SysProcAttr struct, Ctty int +pkg syscall (netbsd-386-cgo), type SysProcAttr struct, Foreground bool +pkg syscall (netbsd-386-cgo), type SysProcAttr struct, Pgid int +pkg syscall (netbsd-amd64), type SysProcAttr struct, Ctty int +pkg syscall (netbsd-amd64), type SysProcAttr struct, Foreground bool +pkg syscall (netbsd-amd64), type SysProcAttr struct, Pgid int +pkg syscall (netbsd-amd64-cgo), type SysProcAttr struct, Ctty int +pkg syscall (netbsd-amd64-cgo), type SysProcAttr struct, Foreground bool +pkg syscall (netbsd-amd64-cgo), type SysProcAttr struct, Pgid int +pkg syscall (netbsd-arm), type SysProcAttr struct, Ctty int +pkg syscall (netbsd-arm), type SysProcAttr struct, Foreground bool +pkg syscall (netbsd-arm), type SysProcAttr struct, Pgid int +pkg syscall (netbsd-arm-cgo), type SysProcAttr struct, Ctty int +pkg syscall (netbsd-arm-cgo), type SysProcAttr struct, Foreground bool +pkg syscall (netbsd-arm-cgo), type SysProcAttr struct, Pgid int +pkg syscall (openbsd-386), type SysProcAttr struct, Ctty int +pkg syscall (openbsd-386), type SysProcAttr struct, Foreground bool +pkg syscall (openbsd-386), type SysProcAttr struct, Pgid int +pkg syscall (openbsd-386-cgo), type SysProcAttr struct, Ctty int +pkg syscall (openbsd-386-cgo), type SysProcAttr struct, Foreground bool +pkg syscall (openbsd-386-cgo), type SysProcAttr struct, Pgid int +pkg syscall (openbsd-amd64), type SysProcAttr struct, Ctty int +pkg syscall (openbsd-amd64), type SysProcAttr struct, Foreground bool +pkg syscall (openbsd-amd64), type SysProcAttr struct, Pgid int +pkg syscall (openbsd-amd64-cgo), type SysProcAttr struct, Ctty int +pkg syscall (openbsd-amd64-cgo), type SysProcAttr struct, Foreground bool +pkg syscall (openbsd-amd64-cgo), type SysProcAttr struct, Pgid int +pkg text/template, method (*Template) DefinedTemplates() string +pkg text/template, method (*Template) Option(...string) *Template +pkg time, method (Time) AppendFormat([]uint8, string) []uint8 +pkg unicode, const Version = "8.0.0" +pkg unicode, var Ahom *RangeTable +pkg unicode, var Anatolian_Hieroglyphs *RangeTable +pkg unicode, var Hatran *RangeTable +pkg unicode, var Multani *RangeTable +pkg unicode, var Old_Hungarian *RangeTable +pkg unicode, var SignWriting *RangeTable diff --git a/api/go1.txt b/api/go1.txt new file mode 100644 index 0000000000000000000000000000000000000000..5e3dea5a372525191ed651a6d46be0a924b7d3ab --- /dev/null +++ b/api/go1.txt @@ -0,0 +1,30871 @@ +pkg archive/tar, const TypeBlock ideal-char +pkg archive/tar, const TypeChar ideal-char +pkg archive/tar, const TypeCont ideal-char +pkg archive/tar, const TypeDir ideal-char +pkg archive/tar, const TypeFifo ideal-char +pkg archive/tar, const TypeLink ideal-char +pkg archive/tar, const TypeReg ideal-char +pkg archive/tar, const TypeRegA ideal-char +pkg archive/tar, const TypeSymlink ideal-char +pkg archive/tar, const TypeXGlobalHeader ideal-char +pkg archive/tar, const TypeXHeader ideal-char +pkg archive/tar, func NewReader(io.Reader) *Reader +pkg archive/tar, func NewWriter(io.Writer) *Writer +pkg archive/tar, method (*Reader) Next() (*Header, error) +pkg archive/tar, method (*Reader) Read([]uint8) (int, error) +pkg archive/tar, method (*Writer) Close() error +pkg archive/tar, method (*Writer) Flush() error +pkg archive/tar, method (*Writer) Write([]uint8) (int, error) +pkg archive/tar, method (*Writer) WriteHeader(*Header) error +pkg archive/tar, type Header struct +pkg archive/tar, type Header struct, AccessTime time.Time +pkg archive/tar, type Header struct, ChangeTime time.Time +pkg archive/tar, type Header struct, Devmajor int64 +pkg archive/tar, type Header struct, Devminor int64 +pkg archive/tar, type Header struct, Gid int +pkg archive/tar, type Header struct, Gname string +pkg archive/tar, type Header struct, Linkname string +pkg archive/tar, type Header struct, ModTime time.Time +pkg archive/tar, type Header struct, Mode int64 +pkg archive/tar, type Header struct, Name string +pkg archive/tar, type Header struct, Size int64 +pkg archive/tar, type Header struct, Typeflag uint8 +pkg archive/tar, type Header struct, Uid int +pkg archive/tar, type Header struct, Uname string +pkg archive/tar, type Reader struct +pkg archive/tar, type Writer struct +pkg archive/tar, var ErrFieldTooLong error +pkg archive/tar, var ErrHeader error +pkg archive/tar, var ErrWriteAfterClose error +pkg archive/tar, var ErrWriteTooLong error +pkg archive/zip, const Deflate uint16 +pkg archive/zip, const Store uint16 +pkg archive/zip, func FileInfoHeader(os.FileInfo) (*FileHeader, error) +pkg archive/zip, func NewReader(io.ReaderAt, int64) (*Reader, error) +pkg archive/zip, func NewWriter(io.Writer) *Writer +pkg archive/zip, func OpenReader(string) (*ReadCloser, error) +pkg archive/zip, method (*File) FileInfo() os.FileInfo +pkg archive/zip, method (*File) ModTime() time.Time +pkg archive/zip, method (*File) Mode() os.FileMode +pkg archive/zip, method (*File) Open() (io.ReadCloser, error) +pkg archive/zip, method (*File) SetModTime(time.Time) +pkg archive/zip, method (*File) SetMode(os.FileMode) +pkg archive/zip, method (*FileHeader) FileInfo() os.FileInfo +pkg archive/zip, method (*FileHeader) ModTime() time.Time +pkg archive/zip, method (*FileHeader) Mode() os.FileMode +pkg archive/zip, method (*FileHeader) SetModTime(time.Time) +pkg archive/zip, method (*FileHeader) SetMode(os.FileMode) +pkg archive/zip, method (*ReadCloser) Close() error +pkg archive/zip, method (*Writer) Close() error +pkg archive/zip, method (*Writer) Create(string) (io.Writer, error) +pkg archive/zip, method (*Writer) CreateHeader(*FileHeader) (io.Writer, error) +pkg archive/zip, type File struct +pkg archive/zip, type File struct, embedded FileHeader +pkg archive/zip, type FileHeader struct +pkg archive/zip, type FileHeader struct, CRC32 uint32 +pkg archive/zip, type FileHeader struct, Comment string +pkg archive/zip, type FileHeader struct, CompressedSize uint32 +pkg archive/zip, type FileHeader struct, CreatorVersion uint16 +pkg archive/zip, type FileHeader struct, ExternalAttrs uint32 +pkg archive/zip, type FileHeader struct, Extra []uint8 +pkg archive/zip, type FileHeader struct, Flags uint16 +pkg archive/zip, type FileHeader struct, Method uint16 +pkg archive/zip, type FileHeader struct, ModifiedDate uint16 +pkg archive/zip, type FileHeader struct, ModifiedTime uint16 +pkg archive/zip, type FileHeader struct, Name string +pkg archive/zip, type FileHeader struct, ReaderVersion uint16 +pkg archive/zip, type FileHeader struct, UncompressedSize uint32 +pkg archive/zip, type ReadCloser struct +pkg archive/zip, type ReadCloser struct, embedded Reader +pkg archive/zip, type Reader struct +pkg archive/zip, type Reader struct, Comment string +pkg archive/zip, type Reader struct, File []*File +pkg archive/zip, type Writer struct +pkg archive/zip, var ErrAlgorithm error +pkg archive/zip, var ErrChecksum error +pkg archive/zip, var ErrFormat error +pkg bufio, func NewReadWriter(*Reader, *Writer) *ReadWriter +pkg bufio, func NewReader(io.Reader) *Reader +pkg bufio, func NewReaderSize(io.Reader, int) *Reader +pkg bufio, func NewWriter(io.Writer) *Writer +pkg bufio, func NewWriterSize(io.Writer, int) *Writer +pkg bufio, method (*Reader) Buffered() int +pkg bufio, method (*Reader) Peek(int) ([]uint8, error) +pkg bufio, method (*Reader) Read([]uint8) (int, error) +pkg bufio, method (*Reader) ReadByte() (uint8, error) +pkg bufio, method (*Reader) ReadBytes(uint8) ([]uint8, error) +pkg bufio, method (*Reader) ReadLine() ([]uint8, bool, error) +pkg bufio, method (*Reader) ReadRune() (int32, int, error) +pkg bufio, method (*Reader) ReadSlice(uint8) ([]uint8, error) +pkg bufio, method (*Reader) ReadString(uint8) (string, error) +pkg bufio, method (*Reader) UnreadByte() error +pkg bufio, method (*Reader) UnreadRune() error +pkg bufio, method (*Writer) Available() int +pkg bufio, method (*Writer) Buffered() int +pkg bufio, method (*Writer) Flush() error +pkg bufio, method (*Writer) Write([]uint8) (int, error) +pkg bufio, method (*Writer) WriteByte(uint8) error +pkg bufio, method (*Writer) WriteRune(int32) (int, error) +pkg bufio, method (*Writer) WriteString(string) (int, error) +pkg bufio, method (ReadWriter) Available() int +pkg bufio, method (ReadWriter) Flush() error +pkg bufio, method (ReadWriter) Peek(int) ([]uint8, error) +pkg bufio, method (ReadWriter) Read([]uint8) (int, error) +pkg bufio, method (ReadWriter) ReadByte() (uint8, error) +pkg bufio, method (ReadWriter) ReadBytes(uint8) ([]uint8, error) +pkg bufio, method (ReadWriter) ReadLine() ([]uint8, bool, error) +pkg bufio, method (ReadWriter) ReadRune() (int32, int, error) +pkg bufio, method (ReadWriter) ReadSlice(uint8) ([]uint8, error) +pkg bufio, method (ReadWriter) ReadString(uint8) (string, error) +pkg bufio, method (ReadWriter) UnreadByte() error +pkg bufio, method (ReadWriter) UnreadRune() error +pkg bufio, method (ReadWriter) Write([]uint8) (int, error) +pkg bufio, method (ReadWriter) WriteByte(uint8) error +pkg bufio, method (ReadWriter) WriteRune(int32) (int, error) +pkg bufio, method (ReadWriter) WriteString(string) (int, error) +pkg bufio, type ReadWriter struct +pkg bufio, type ReadWriter struct, embedded *Reader +pkg bufio, type ReadWriter struct, embedded *Writer +pkg bufio, type Reader struct +pkg bufio, type Writer struct +pkg bufio, var ErrBufferFull error +pkg bufio, var ErrInvalidUnreadByte error +pkg bufio, var ErrInvalidUnreadRune error +pkg bufio, var ErrNegativeCount error +pkg bytes, const MinRead ideal-int +pkg bytes, func Compare([]uint8, []uint8) int +pkg bytes, func Contains([]uint8, []uint8) bool +pkg bytes, func Count([]uint8, []uint8) int +pkg bytes, func Equal([]uint8, []uint8) bool +pkg bytes, func EqualFold([]uint8, []uint8) bool +pkg bytes, func Fields([]uint8) [][]uint8 +pkg bytes, func FieldsFunc([]uint8, func(int32) bool) [][]uint8 +pkg bytes, func HasPrefix([]uint8, []uint8) bool +pkg bytes, func HasSuffix([]uint8, []uint8) bool +pkg bytes, func Index([]uint8, []uint8) int +pkg bytes, func IndexAny([]uint8, string) int +pkg bytes, func IndexByte([]uint8, uint8) int +pkg bytes, func IndexFunc([]uint8, func(int32) bool) int +pkg bytes, func IndexRune([]uint8, int32) int +pkg bytes, func Join([][]uint8, []uint8) []uint8 +pkg bytes, func LastIndex([]uint8, []uint8) int +pkg bytes, func LastIndexAny([]uint8, string) int +pkg bytes, func LastIndexFunc([]uint8, func(int32) bool) int +pkg bytes, func Map(func(int32) int32, []uint8) []uint8 +pkg bytes, func NewBuffer([]uint8) *Buffer +pkg bytes, func NewBufferString(string) *Buffer +pkg bytes, func NewReader([]uint8) *Reader +pkg bytes, func Repeat([]uint8, int) []uint8 +pkg bytes, func Replace([]uint8, []uint8, []uint8, int) []uint8 +pkg bytes, func Runes([]uint8) []int32 +pkg bytes, func Split([]uint8, []uint8) [][]uint8 +pkg bytes, func SplitAfter([]uint8, []uint8) [][]uint8 +pkg bytes, func SplitAfterN([]uint8, []uint8, int) [][]uint8 +pkg bytes, func SplitN([]uint8, []uint8, int) [][]uint8 +pkg bytes, func Title([]uint8) []uint8 +pkg bytes, func ToLower([]uint8) []uint8 +pkg bytes, func ToLowerSpecial(unicode.SpecialCase, []uint8) []uint8 +pkg bytes, func ToTitle([]uint8) []uint8 +pkg bytes, func ToTitleSpecial(unicode.SpecialCase, []uint8) []uint8 +pkg bytes, func ToUpper([]uint8) []uint8 +pkg bytes, func ToUpperSpecial(unicode.SpecialCase, []uint8) []uint8 +pkg bytes, func Trim([]uint8, string) []uint8 +pkg bytes, func TrimFunc([]uint8, func(int32) bool) []uint8 +pkg bytes, func TrimLeft([]uint8, string) []uint8 +pkg bytes, func TrimLeftFunc([]uint8, func(int32) bool) []uint8 +pkg bytes, func TrimRight([]uint8, string) []uint8 +pkg bytes, func TrimRightFunc([]uint8, func(int32) bool) []uint8 +pkg bytes, func TrimSpace([]uint8) []uint8 +pkg bytes, method (*Buffer) Bytes() []uint8 +pkg bytes, method (*Buffer) Len() int +pkg bytes, method (*Buffer) Next(int) []uint8 +pkg bytes, method (*Buffer) Read([]uint8) (int, error) +pkg bytes, method (*Buffer) ReadByte() (uint8, error) +pkg bytes, method (*Buffer) ReadBytes(uint8) ([]uint8, error) +pkg bytes, method (*Buffer) ReadFrom(io.Reader) (int64, error) +pkg bytes, method (*Buffer) ReadRune() (int32, int, error) +pkg bytes, method (*Buffer) ReadString(uint8) (string, error) +pkg bytes, method (*Buffer) Reset() +pkg bytes, method (*Buffer) String() string +pkg bytes, method (*Buffer) Truncate(int) +pkg bytes, method (*Buffer) UnreadByte() error +pkg bytes, method (*Buffer) UnreadRune() error +pkg bytes, method (*Buffer) Write([]uint8) (int, error) +pkg bytes, method (*Buffer) WriteByte(uint8) error +pkg bytes, method (*Buffer) WriteRune(int32) (int, error) +pkg bytes, method (*Buffer) WriteString(string) (int, error) +pkg bytes, method (*Buffer) WriteTo(io.Writer) (int64, error) +pkg bytes, method (*Reader) Len() int +pkg bytes, method (*Reader) Read([]uint8) (int, error) +pkg bytes, method (*Reader) ReadAt([]uint8, int64) (int, error) +pkg bytes, method (*Reader) ReadByte() (uint8, error) +pkg bytes, method (*Reader) ReadRune() (int32, int, error) +pkg bytes, method (*Reader) Seek(int64, int) (int64, error) +pkg bytes, method (*Reader) UnreadByte() error +pkg bytes, method (*Reader) UnreadRune() error +pkg bytes, type Buffer struct +pkg bytes, type Reader struct +pkg bytes, var ErrTooLarge error +pkg compress/bzip2, func NewReader(io.Reader) io.Reader +pkg compress/bzip2, method (StructuralError) Error() string +pkg compress/bzip2, type StructuralError string +pkg compress/flate, const BestCompression ideal-int +pkg compress/flate, const BestSpeed ideal-int +pkg compress/flate, const DefaultCompression ideal-int +pkg compress/flate, const NoCompression ideal-int +pkg compress/flate, func NewReader(io.Reader) io.ReadCloser +pkg compress/flate, func NewReaderDict(io.Reader, []uint8) io.ReadCloser +pkg compress/flate, func NewWriter(io.Writer, int) (*Writer, error) +pkg compress/flate, func NewWriterDict(io.Writer, int, []uint8) (*Writer, error) +pkg compress/flate, method (*ReadError) Error() string +pkg compress/flate, method (*WriteError) Error() string +pkg compress/flate, method (*Writer) Close() error +pkg compress/flate, method (*Writer) Flush() error +pkg compress/flate, method (*Writer) Write([]uint8) (int, error) +pkg compress/flate, method (CorruptInputError) Error() string +pkg compress/flate, method (InternalError) Error() string +pkg compress/flate, type CorruptInputError int64 +pkg compress/flate, type InternalError string +pkg compress/flate, type ReadError struct +pkg compress/flate, type ReadError struct, Err error +pkg compress/flate, type ReadError struct, Offset int64 +pkg compress/flate, type Reader interface { Read, ReadByte } +pkg compress/flate, type Reader interface, Read([]uint8) (int, error) +pkg compress/flate, type Reader interface, ReadByte() (uint8, error) +pkg compress/flate, type WriteError struct +pkg compress/flate, type WriteError struct, Err error +pkg compress/flate, type WriteError struct, Offset int64 +pkg compress/flate, type Writer struct +pkg compress/gzip, const BestCompression ideal-int +pkg compress/gzip, const BestSpeed ideal-int +pkg compress/gzip, const DefaultCompression ideal-int +pkg compress/gzip, const NoCompression ideal-int +pkg compress/gzip, func NewReader(io.Reader) (*Reader, error) +pkg compress/gzip, func NewWriter(io.Writer) *Writer +pkg compress/gzip, func NewWriterLevel(io.Writer, int) (*Writer, error) +pkg compress/gzip, method (*Reader) Close() error +pkg compress/gzip, method (*Reader) Read([]uint8) (int, error) +pkg compress/gzip, method (*Writer) Close() error +pkg compress/gzip, method (*Writer) Write([]uint8) (int, error) +pkg compress/gzip, type Header struct +pkg compress/gzip, type Header struct, Comment string +pkg compress/gzip, type Header struct, Extra []uint8 +pkg compress/gzip, type Header struct, ModTime time.Time +pkg compress/gzip, type Header struct, Name string +pkg compress/gzip, type Header struct, OS uint8 +pkg compress/gzip, type Reader struct +pkg compress/gzip, type Reader struct, embedded Header +pkg compress/gzip, type Writer struct +pkg compress/gzip, type Writer struct, embedded Header +pkg compress/gzip, var ErrChecksum error +pkg compress/gzip, var ErrHeader error +pkg compress/lzw, const LSB Order +pkg compress/lzw, const MSB Order +pkg compress/lzw, func NewReader(io.Reader, Order, int) io.ReadCloser +pkg compress/lzw, func NewWriter(io.Writer, Order, int) io.WriteCloser +pkg compress/lzw, type Order int +pkg compress/zlib, const BestCompression ideal-int +pkg compress/zlib, const BestSpeed ideal-int +pkg compress/zlib, const DefaultCompression ideal-int +pkg compress/zlib, const NoCompression ideal-int +pkg compress/zlib, func NewReader(io.Reader) (io.ReadCloser, error) +pkg compress/zlib, func NewReaderDict(io.Reader, []uint8) (io.ReadCloser, error) +pkg compress/zlib, func NewWriter(io.Writer) *Writer +pkg compress/zlib, func NewWriterLevel(io.Writer, int) (*Writer, error) +pkg compress/zlib, func NewWriterLevelDict(io.Writer, int, []uint8) (*Writer, error) +pkg compress/zlib, method (*Writer) Close() error +pkg compress/zlib, method (*Writer) Flush() error +pkg compress/zlib, method (*Writer) Write([]uint8) (int, error) +pkg compress/zlib, type Writer struct +pkg compress/zlib, var ErrChecksum error +pkg compress/zlib, var ErrDictionary error +pkg compress/zlib, var ErrHeader error +pkg container/heap, func Init(Interface) +pkg container/heap, func Pop(Interface) interface{} +pkg container/heap, func Push(Interface, interface{}) +pkg container/heap, func Remove(Interface, int) interface{} +pkg container/heap, type Interface interface { Len, Less, Pop, Push, Swap } +pkg container/heap, type Interface interface, Len() int +pkg container/heap, type Interface interface, Less(int, int) bool +pkg container/heap, type Interface interface, Pop() interface{} +pkg container/heap, type Interface interface, Push(interface{}) +pkg container/heap, type Interface interface, Swap(int, int) +pkg container/list, func New() *List +pkg container/list, method (*Element) Next() *Element +pkg container/list, method (*Element) Prev() *Element +pkg container/list, method (*List) Back() *Element +pkg container/list, method (*List) Front() *Element +pkg container/list, method (*List) Init() *List +pkg container/list, method (*List) InsertAfter(interface{}, *Element) *Element +pkg container/list, method (*List) InsertBefore(interface{}, *Element) *Element +pkg container/list, method (*List) Len() int +pkg container/list, method (*List) MoveToBack(*Element) +pkg container/list, method (*List) MoveToFront(*Element) +pkg container/list, method (*List) PushBack(interface{}) *Element +pkg container/list, method (*List) PushBackList(*List) +pkg container/list, method (*List) PushFront(interface{}) *Element +pkg container/list, method (*List) PushFrontList(*List) +pkg container/list, method (*List) Remove(*Element) interface{} +pkg container/list, type Element struct +pkg container/list, type Element struct, Value interface{} +pkg container/list, type List struct +pkg container/ring, func New(int) *Ring +pkg container/ring, method (*Ring) Do(func(interface{})) +pkg container/ring, method (*Ring) Len() int +pkg container/ring, method (*Ring) Link(*Ring) *Ring +pkg container/ring, method (*Ring) Move(int) *Ring +pkg container/ring, method (*Ring) Next() *Ring +pkg container/ring, method (*Ring) Prev() *Ring +pkg container/ring, method (*Ring) Unlink(int) *Ring +pkg container/ring, type Ring struct +pkg container/ring, type Ring struct, Value interface{} +pkg crypto, const MD4 Hash +pkg crypto, const MD5 Hash +pkg crypto, const MD5SHA1 Hash +pkg crypto, const RIPEMD160 Hash +pkg crypto, const SHA1 Hash +pkg crypto, const SHA224 Hash +pkg crypto, const SHA256 Hash +pkg crypto, const SHA384 Hash +pkg crypto, const SHA512 Hash +pkg crypto, func RegisterHash(Hash, func() hash.Hash) +pkg crypto, method (Hash) Available() bool +pkg crypto, method (Hash) New() hash.Hash +pkg crypto, method (Hash) Size() int +pkg crypto, type Hash uint +pkg crypto, type PrivateKey interface {} +pkg crypto/aes, const BlockSize ideal-int +pkg crypto/aes, func NewCipher([]uint8) (cipher.Block, error) +pkg crypto/aes, method (KeySizeError) Error() string +pkg crypto/aes, type KeySizeError int +pkg crypto/cipher, func NewCBCDecrypter(Block, []uint8) BlockMode +pkg crypto/cipher, func NewCBCEncrypter(Block, []uint8) BlockMode +pkg crypto/cipher, func NewCFBDecrypter(Block, []uint8) Stream +pkg crypto/cipher, func NewCFBEncrypter(Block, []uint8) Stream +pkg crypto/cipher, func NewCTR(Block, []uint8) Stream +pkg crypto/cipher, func NewOFB(Block, []uint8) Stream +pkg crypto/cipher, method (StreamReader) Read([]uint8) (int, error) +pkg crypto/cipher, method (StreamWriter) Close() error +pkg crypto/cipher, method (StreamWriter) Write([]uint8) (int, error) +pkg crypto/cipher, type Block interface { BlockSize, Decrypt, Encrypt } +pkg crypto/cipher, type Block interface, BlockSize() int +pkg crypto/cipher, type Block interface, Decrypt([]uint8, []uint8) +pkg crypto/cipher, type Block interface, Encrypt([]uint8, []uint8) +pkg crypto/cipher, type BlockMode interface { BlockSize, CryptBlocks } +pkg crypto/cipher, type BlockMode interface, BlockSize() int +pkg crypto/cipher, type BlockMode interface, CryptBlocks([]uint8, []uint8) +pkg crypto/cipher, type Stream interface { XORKeyStream } +pkg crypto/cipher, type Stream interface, XORKeyStream([]uint8, []uint8) +pkg crypto/cipher, type StreamReader struct +pkg crypto/cipher, type StreamReader struct, R io.Reader +pkg crypto/cipher, type StreamReader struct, S Stream +pkg crypto/cipher, type StreamWriter struct +pkg crypto/cipher, type StreamWriter struct, Err error +pkg crypto/cipher, type StreamWriter struct, S Stream +pkg crypto/cipher, type StreamWriter struct, W io.Writer +pkg crypto/des, const BlockSize ideal-int +pkg crypto/des, func NewCipher([]uint8) (cipher.Block, error) +pkg crypto/des, func NewTripleDESCipher([]uint8) (cipher.Block, error) +pkg crypto/des, method (KeySizeError) Error() string +pkg crypto/des, type KeySizeError int +pkg crypto/dsa, const L1024N160 ParameterSizes +pkg crypto/dsa, const L2048N224 ParameterSizes +pkg crypto/dsa, const L2048N256 ParameterSizes +pkg crypto/dsa, const L3072N256 ParameterSizes +pkg crypto/dsa, func GenerateKey(*PrivateKey, io.Reader) error +pkg crypto/dsa, func GenerateParameters(*Parameters, io.Reader, ParameterSizes) error +pkg crypto/dsa, func Sign(io.Reader, *PrivateKey, []uint8) (*big.Int, *big.Int, error) +pkg crypto/dsa, func Verify(*PublicKey, []uint8, *big.Int, *big.Int) bool +pkg crypto/dsa, type ParameterSizes int +pkg crypto/dsa, type Parameters struct +pkg crypto/dsa, type Parameters struct, G *big.Int +pkg crypto/dsa, type Parameters struct, P *big.Int +pkg crypto/dsa, type Parameters struct, Q *big.Int +pkg crypto/dsa, type PrivateKey struct +pkg crypto/dsa, type PrivateKey struct, X *big.Int +pkg crypto/dsa, type PrivateKey struct, embedded PublicKey +pkg crypto/dsa, type PublicKey struct +pkg crypto/dsa, type PublicKey struct, Y *big.Int +pkg crypto/dsa, type PublicKey struct, embedded Parameters +pkg crypto/dsa, var ErrInvalidPublicKey error +pkg crypto/ecdsa, func GenerateKey(elliptic.Curve, io.Reader) (*PrivateKey, error) +pkg crypto/ecdsa, func Sign(io.Reader, *PrivateKey, []uint8) (*big.Int, *big.Int, error) +pkg crypto/ecdsa, func Verify(*PublicKey, []uint8, *big.Int, *big.Int) bool +pkg crypto/ecdsa, method (PrivateKey) Add(*big.Int, *big.Int, *big.Int, *big.Int) (*big.Int, *big.Int) +pkg crypto/ecdsa, method (PrivateKey) Double(*big.Int, *big.Int) (*big.Int, *big.Int) +pkg crypto/ecdsa, method (PrivateKey) IsOnCurve(*big.Int, *big.Int) bool +pkg crypto/ecdsa, method (PrivateKey) Params() *elliptic.CurveParams +pkg crypto/ecdsa, method (PrivateKey) ScalarBaseMult([]uint8) (*big.Int, *big.Int) +pkg crypto/ecdsa, method (PrivateKey) ScalarMult(*big.Int, *big.Int, []uint8) (*big.Int, *big.Int) +pkg crypto/ecdsa, method (PublicKey) Add(*big.Int, *big.Int, *big.Int, *big.Int) (*big.Int, *big.Int) +pkg crypto/ecdsa, method (PublicKey) Double(*big.Int, *big.Int) (*big.Int, *big.Int) +pkg crypto/ecdsa, method (PublicKey) IsOnCurve(*big.Int, *big.Int) bool +pkg crypto/ecdsa, method (PublicKey) Params() *elliptic.CurveParams +pkg crypto/ecdsa, method (PublicKey) ScalarBaseMult([]uint8) (*big.Int, *big.Int) +pkg crypto/ecdsa, method (PublicKey) ScalarMult(*big.Int, *big.Int, []uint8) (*big.Int, *big.Int) +pkg crypto/ecdsa, type PrivateKey struct +pkg crypto/ecdsa, type PrivateKey struct, D *big.Int +pkg crypto/ecdsa, type PrivateKey struct, embedded PublicKey +pkg crypto/ecdsa, type PublicKey struct +pkg crypto/ecdsa, type PublicKey struct, X *big.Int +pkg crypto/ecdsa, type PublicKey struct, Y *big.Int +pkg crypto/ecdsa, type PublicKey struct, embedded elliptic.Curve +pkg crypto/elliptic, func GenerateKey(Curve, io.Reader) ([]uint8, *big.Int, *big.Int, error) +pkg crypto/elliptic, func Marshal(Curve, *big.Int, *big.Int) []uint8 +pkg crypto/elliptic, func P224() Curve +pkg crypto/elliptic, func P256() Curve +pkg crypto/elliptic, func P384() Curve +pkg crypto/elliptic, func P521() Curve +pkg crypto/elliptic, func Unmarshal(Curve, []uint8) (*big.Int, *big.Int) +pkg crypto/elliptic, method (*CurveParams) Add(*big.Int, *big.Int, *big.Int, *big.Int) (*big.Int, *big.Int) +pkg crypto/elliptic, method (*CurveParams) Double(*big.Int, *big.Int) (*big.Int, *big.Int) +pkg crypto/elliptic, method (*CurveParams) IsOnCurve(*big.Int, *big.Int) bool +pkg crypto/elliptic, method (*CurveParams) Params() *CurveParams +pkg crypto/elliptic, method (*CurveParams) ScalarBaseMult([]uint8) (*big.Int, *big.Int) +pkg crypto/elliptic, method (*CurveParams) ScalarMult(*big.Int, *big.Int, []uint8) (*big.Int, *big.Int) +pkg crypto/elliptic, type Curve interface { Add, Double, IsOnCurve, Params, ScalarBaseMult, ScalarMult } +pkg crypto/elliptic, type Curve interface, Add(*big.Int, *big.Int, *big.Int, *big.Int) (*big.Int, *big.Int) +pkg crypto/elliptic, type Curve interface, Double(*big.Int, *big.Int) (*big.Int, *big.Int) +pkg crypto/elliptic, type Curve interface, IsOnCurve(*big.Int, *big.Int) bool +pkg crypto/elliptic, type Curve interface, Params() *CurveParams +pkg crypto/elliptic, type Curve interface, ScalarBaseMult([]uint8) (*big.Int, *big.Int) +pkg crypto/elliptic, type Curve interface, ScalarMult(*big.Int, *big.Int, []uint8) (*big.Int, *big.Int) +pkg crypto/elliptic, type CurveParams struct +pkg crypto/elliptic, type CurveParams struct, B *big.Int +pkg crypto/elliptic, type CurveParams struct, BitSize int +pkg crypto/elliptic, type CurveParams struct, Gx *big.Int +pkg crypto/elliptic, type CurveParams struct, Gy *big.Int +pkg crypto/elliptic, type CurveParams struct, N *big.Int +pkg crypto/elliptic, type CurveParams struct, P *big.Int +pkg crypto/hmac, func New(func() hash.Hash, []uint8) hash.Hash +pkg crypto/md5, const BlockSize ideal-int +pkg crypto/md5, const Size ideal-int +pkg crypto/md5, func New() hash.Hash +pkg crypto/rand, func Int(io.Reader, *big.Int) (*big.Int, error) +pkg crypto/rand, func Prime(io.Reader, int) (*big.Int, error) +pkg crypto/rand, func Read([]uint8) (int, error) +pkg crypto/rand, var Reader io.Reader +pkg crypto/rc4, func NewCipher([]uint8) (*Cipher, error) +pkg crypto/rc4, method (*Cipher) Reset() +pkg crypto/rc4, method (*Cipher) XORKeyStream([]uint8, []uint8) +pkg crypto/rc4, method (KeySizeError) Error() string +pkg crypto/rc4, type Cipher struct +pkg crypto/rc4, type KeySizeError int +pkg crypto/rsa, func DecryptOAEP(hash.Hash, io.Reader, *PrivateKey, []uint8, []uint8) ([]uint8, error) +pkg crypto/rsa, func DecryptPKCS1v15(io.Reader, *PrivateKey, []uint8) ([]uint8, error) +pkg crypto/rsa, func DecryptPKCS1v15SessionKey(io.Reader, *PrivateKey, []uint8, []uint8) error +pkg crypto/rsa, func EncryptOAEP(hash.Hash, io.Reader, *PublicKey, []uint8, []uint8) ([]uint8, error) +pkg crypto/rsa, func EncryptPKCS1v15(io.Reader, *PublicKey, []uint8) ([]uint8, error) +pkg crypto/rsa, func GenerateKey(io.Reader, int) (*PrivateKey, error) +pkg crypto/rsa, func GenerateMultiPrimeKey(io.Reader, int, int) (*PrivateKey, error) +pkg crypto/rsa, func SignPKCS1v15(io.Reader, *PrivateKey, crypto.Hash, []uint8) ([]uint8, error) +pkg crypto/rsa, func VerifyPKCS1v15(*PublicKey, crypto.Hash, []uint8, []uint8) error +pkg crypto/rsa, method (*PrivateKey) Precompute() +pkg crypto/rsa, method (*PrivateKey) Validate() error +pkg crypto/rsa, type CRTValue struct +pkg crypto/rsa, type CRTValue struct, Coeff *big.Int +pkg crypto/rsa, type CRTValue struct, Exp *big.Int +pkg crypto/rsa, type CRTValue struct, R *big.Int +pkg crypto/rsa, type PrecomputedValues struct +pkg crypto/rsa, type PrecomputedValues struct, CRTValues []CRTValue +pkg crypto/rsa, type PrecomputedValues struct, Dp *big.Int +pkg crypto/rsa, type PrecomputedValues struct, Dq *big.Int +pkg crypto/rsa, type PrecomputedValues struct, Qinv *big.Int +pkg crypto/rsa, type PrivateKey struct +pkg crypto/rsa, type PrivateKey struct, D *big.Int +pkg crypto/rsa, type PrivateKey struct, Precomputed PrecomputedValues +pkg crypto/rsa, type PrivateKey struct, Primes []*big.Int +pkg crypto/rsa, type PrivateKey struct, embedded PublicKey +pkg crypto/rsa, type PublicKey struct +pkg crypto/rsa, type PublicKey struct, E int +pkg crypto/rsa, type PublicKey struct, N *big.Int +pkg crypto/rsa, var ErrDecryption error +pkg crypto/rsa, var ErrMessageTooLong error +pkg crypto/rsa, var ErrVerification error +pkg crypto/sha1, const BlockSize ideal-int +pkg crypto/sha1, const Size ideal-int +pkg crypto/sha1, func New() hash.Hash +pkg crypto/sha256, const BlockSize ideal-int +pkg crypto/sha256, const Size ideal-int +pkg crypto/sha256, const Size224 ideal-int +pkg crypto/sha256, func New() hash.Hash +pkg crypto/sha256, func New224() hash.Hash +pkg crypto/sha512, const BlockSize ideal-int +pkg crypto/sha512, const Size ideal-int +pkg crypto/sha512, const Size384 ideal-int +pkg crypto/sha512, func New() hash.Hash +pkg crypto/sha512, func New384() hash.Hash +pkg crypto/subtle, func ConstantTimeByteEq(uint8, uint8) int +pkg crypto/subtle, func ConstantTimeCompare([]uint8, []uint8) int +pkg crypto/subtle, func ConstantTimeCopy(int, []uint8, []uint8) +pkg crypto/subtle, func ConstantTimeEq(int32, int32) int +pkg crypto/subtle, func ConstantTimeSelect(int, int, int) int +pkg crypto/tls, const NoClientCert ClientAuthType +pkg crypto/tls, const RequestClientCert ClientAuthType +pkg crypto/tls, const RequireAndVerifyClientCert ClientAuthType +pkg crypto/tls, const RequireAnyClientCert ClientAuthType +pkg crypto/tls, const TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA uint16 +pkg crypto/tls, const TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA uint16 +pkg crypto/tls, const TLS_ECDHE_RSA_WITH_RC4_128_SHA uint16 +pkg crypto/tls, const TLS_RSA_WITH_3DES_EDE_CBC_SHA uint16 +pkg crypto/tls, const TLS_RSA_WITH_AES_128_CBC_SHA uint16 +pkg crypto/tls, const TLS_RSA_WITH_RC4_128_SHA uint16 +pkg crypto/tls, const VerifyClientCertIfGiven ClientAuthType +pkg crypto/tls, func Client(net.Conn, *Config) *Conn +pkg crypto/tls, func Dial(string, string, *Config) (*Conn, error) +pkg crypto/tls, func Listen(string, string, *Config) (net.Listener, error) +pkg crypto/tls, func LoadX509KeyPair(string, string) (Certificate, error) +pkg crypto/tls, func NewListener(net.Listener, *Config) net.Listener +pkg crypto/tls, func Server(net.Conn, *Config) *Conn +pkg crypto/tls, func X509KeyPair([]uint8, []uint8) (Certificate, error) +pkg crypto/tls, method (*Config) BuildNameToCertificate() +pkg crypto/tls, method (*Conn) Close() error +pkg crypto/tls, method (*Conn) ConnectionState() ConnectionState +pkg crypto/tls, method (*Conn) Handshake() error +pkg crypto/tls, method (*Conn) LocalAddr() net.Addr +pkg crypto/tls, method (*Conn) OCSPResponse() []uint8 +pkg crypto/tls, method (*Conn) Read([]uint8) (int, error) +pkg crypto/tls, method (*Conn) RemoteAddr() net.Addr +pkg crypto/tls, method (*Conn) SetDeadline(time.Time) error +pkg crypto/tls, method (*Conn) SetReadDeadline(time.Time) error +pkg crypto/tls, method (*Conn) SetWriteDeadline(time.Time) error +pkg crypto/tls, method (*Conn) VerifyHostname(string) error +pkg crypto/tls, method (*Conn) Write([]uint8) (int, error) +pkg crypto/tls, type Certificate struct +pkg crypto/tls, type Certificate struct, Certificate [][]uint8 +pkg crypto/tls, type Certificate struct, Leaf *x509.Certificate +pkg crypto/tls, type Certificate struct, OCSPStaple []uint8 +pkg crypto/tls, type Certificate struct, PrivateKey crypto.PrivateKey +pkg crypto/tls, type ClientAuthType int +pkg crypto/tls, type Config struct +pkg crypto/tls, type Config struct, Certificates []Certificate +pkg crypto/tls, type Config struct, CipherSuites []uint16 +pkg crypto/tls, type Config struct, ClientAuth ClientAuthType +pkg crypto/tls, type Config struct, ClientCAs *x509.CertPool +pkg crypto/tls, type Config struct, InsecureSkipVerify bool +pkg crypto/tls, type Config struct, NameToCertificate map[string]*Certificate +pkg crypto/tls, type Config struct, NextProtos []string +pkg crypto/tls, type Config struct, Rand io.Reader +pkg crypto/tls, type Config struct, RootCAs *x509.CertPool +pkg crypto/tls, type Config struct, ServerName string +pkg crypto/tls, type Config struct, Time func() time.Time +pkg crypto/tls, type Conn struct +pkg crypto/tls, type ConnectionState struct +pkg crypto/tls, type ConnectionState struct, CipherSuite uint16 +pkg crypto/tls, type ConnectionState struct, HandshakeComplete bool +pkg crypto/tls, type ConnectionState struct, NegotiatedProtocol string +pkg crypto/tls, type ConnectionState struct, NegotiatedProtocolIsMutual bool +pkg crypto/tls, type ConnectionState struct, PeerCertificates []*x509.Certificate +pkg crypto/tls, type ConnectionState struct, ServerName string +pkg crypto/tls, type ConnectionState struct, VerifiedChains [][]*x509.Certificate +pkg crypto/x509, const CANotAuthorizedForThisName InvalidReason +pkg crypto/x509, const DSA PublicKeyAlgorithm +pkg crypto/x509, const DSAWithSHA1 SignatureAlgorithm +pkg crypto/x509, const DSAWithSHA256 SignatureAlgorithm +pkg crypto/x509, const Expired InvalidReason +pkg crypto/x509, const ExtKeyUsageAny ExtKeyUsage +pkg crypto/x509, const ExtKeyUsageClientAuth ExtKeyUsage +pkg crypto/x509, const ExtKeyUsageCodeSigning ExtKeyUsage +pkg crypto/x509, const ExtKeyUsageEmailProtection ExtKeyUsage +pkg crypto/x509, const ExtKeyUsageOCSPSigning ExtKeyUsage +pkg crypto/x509, const ExtKeyUsageServerAuth ExtKeyUsage +pkg crypto/x509, const ExtKeyUsageTimeStamping ExtKeyUsage +pkg crypto/x509, const KeyUsageCRLSign KeyUsage +pkg crypto/x509, const KeyUsageCertSign KeyUsage +pkg crypto/x509, const KeyUsageContentCommitment KeyUsage +pkg crypto/x509, const KeyUsageDataEncipherment KeyUsage +pkg crypto/x509, const KeyUsageDecipherOnly KeyUsage +pkg crypto/x509, const KeyUsageDigitalSignature KeyUsage +pkg crypto/x509, const KeyUsageEncipherOnly KeyUsage +pkg crypto/x509, const KeyUsageKeyAgreement KeyUsage +pkg crypto/x509, const KeyUsageKeyEncipherment KeyUsage +pkg crypto/x509, const MD2WithRSA SignatureAlgorithm +pkg crypto/x509, const MD5WithRSA SignatureAlgorithm +pkg crypto/x509, const NotAuthorizedToSign InvalidReason +pkg crypto/x509, const RSA PublicKeyAlgorithm +pkg crypto/x509, const SHA1WithRSA SignatureAlgorithm +pkg crypto/x509, const SHA256WithRSA SignatureAlgorithm +pkg crypto/x509, const SHA384WithRSA SignatureAlgorithm +pkg crypto/x509, const SHA512WithRSA SignatureAlgorithm +pkg crypto/x509, const TooManyIntermediates InvalidReason +pkg crypto/x509, const UnknownPublicKeyAlgorithm PublicKeyAlgorithm +pkg crypto/x509, const UnknownSignatureAlgorithm SignatureAlgorithm +pkg crypto/x509, func CreateCertificate(io.Reader, *Certificate, *Certificate, interface{}, interface{}) ([]uint8, error) +pkg crypto/x509, func MarshalPKCS1PrivateKey(*rsa.PrivateKey) []uint8 +pkg crypto/x509, func MarshalPKIXPublicKey(interface{}) ([]uint8, error) +pkg crypto/x509, func NewCertPool() *CertPool +pkg crypto/x509, func ParseCRL([]uint8) (*pkix.CertificateList, error) +pkg crypto/x509, func ParseCertificate([]uint8) (*Certificate, error) +pkg crypto/x509, func ParseCertificates([]uint8) ([]*Certificate, error) +pkg crypto/x509, func ParseDERCRL([]uint8) (*pkix.CertificateList, error) +pkg crypto/x509, func ParsePKCS1PrivateKey([]uint8) (*rsa.PrivateKey, error) +pkg crypto/x509, func ParsePKCS8PrivateKey([]uint8) (interface{}, error) +pkg crypto/x509, func ParsePKIXPublicKey([]uint8) (interface{}, error) +pkg crypto/x509, method (*CertPool) AddCert(*Certificate) +pkg crypto/x509, method (*CertPool) AppendCertsFromPEM([]uint8) bool +pkg crypto/x509, method (*CertPool) Subjects() [][]uint8 +pkg crypto/x509, method (*Certificate) CheckCRLSignature(*pkix.CertificateList) error +pkg crypto/x509, method (*Certificate) CheckSignature(SignatureAlgorithm, []uint8, []uint8) error +pkg crypto/x509, method (*Certificate) CheckSignatureFrom(*Certificate) error +pkg crypto/x509, method (*Certificate) CreateCRL(io.Reader, interface{}, []pkix.RevokedCertificate, time.Time, time.Time) ([]uint8, error) +pkg crypto/x509, method (*Certificate) Equal(*Certificate) bool +pkg crypto/x509, method (*Certificate) Verify(VerifyOptions) ([][]*Certificate, error) +pkg crypto/x509, method (*Certificate) VerifyHostname(string) error +pkg crypto/x509, method (CertificateInvalidError) Error() string +pkg crypto/x509, method (ConstraintViolationError) Error() string +pkg crypto/x509, method (HostnameError) Error() string +pkg crypto/x509, method (UnhandledCriticalExtension) Error() string +pkg crypto/x509, method (UnknownAuthorityError) Error() string +pkg crypto/x509, type CertPool struct +pkg crypto/x509, type Certificate struct +pkg crypto/x509, type Certificate struct, AuthorityKeyId []uint8 +pkg crypto/x509, type Certificate struct, BasicConstraintsValid bool +pkg crypto/x509, type Certificate struct, DNSNames []string +pkg crypto/x509, type Certificate struct, EmailAddresses []string +pkg crypto/x509, type Certificate struct, ExtKeyUsage []ExtKeyUsage +pkg crypto/x509, type Certificate struct, IsCA bool +pkg crypto/x509, type Certificate struct, Issuer pkix.Name +pkg crypto/x509, type Certificate struct, KeyUsage KeyUsage +pkg crypto/x509, type Certificate struct, MaxPathLen int +pkg crypto/x509, type Certificate struct, NotAfter time.Time +pkg crypto/x509, type Certificate struct, NotBefore time.Time +pkg crypto/x509, type Certificate struct, PermittedDNSDomains []string +pkg crypto/x509, type Certificate struct, PermittedDNSDomainsCritical bool +pkg crypto/x509, type Certificate struct, PolicyIdentifiers []asn1.ObjectIdentifier +pkg crypto/x509, type Certificate struct, PublicKey interface{} +pkg crypto/x509, type Certificate struct, PublicKeyAlgorithm PublicKeyAlgorithm +pkg crypto/x509, type Certificate struct, Raw []uint8 +pkg crypto/x509, type Certificate struct, RawIssuer []uint8 +pkg crypto/x509, type Certificate struct, RawSubject []uint8 +pkg crypto/x509, type Certificate struct, RawSubjectPublicKeyInfo []uint8 +pkg crypto/x509, type Certificate struct, RawTBSCertificate []uint8 +pkg crypto/x509, type Certificate struct, SerialNumber *big.Int +pkg crypto/x509, type Certificate struct, Signature []uint8 +pkg crypto/x509, type Certificate struct, SignatureAlgorithm SignatureAlgorithm +pkg crypto/x509, type Certificate struct, Subject pkix.Name +pkg crypto/x509, type Certificate struct, SubjectKeyId []uint8 +pkg crypto/x509, type Certificate struct, UnknownExtKeyUsage []asn1.ObjectIdentifier +pkg crypto/x509, type Certificate struct, Version int +pkg crypto/x509, type CertificateInvalidError struct +pkg crypto/x509, type CertificateInvalidError struct, Cert *Certificate +pkg crypto/x509, type CertificateInvalidError struct, Reason InvalidReason +pkg crypto/x509, type ConstraintViolationError struct +pkg crypto/x509, type ExtKeyUsage int +pkg crypto/x509, type HostnameError struct +pkg crypto/x509, type HostnameError struct, Certificate *Certificate +pkg crypto/x509, type HostnameError struct, Host string +pkg crypto/x509, type InvalidReason int +pkg crypto/x509, type KeyUsage int +pkg crypto/x509, type PublicKeyAlgorithm int +pkg crypto/x509, type SignatureAlgorithm int +pkg crypto/x509, type UnhandledCriticalExtension struct +pkg crypto/x509, type UnknownAuthorityError struct +pkg crypto/x509, type VerifyOptions struct +pkg crypto/x509, type VerifyOptions struct, CurrentTime time.Time +pkg crypto/x509, type VerifyOptions struct, DNSName string +pkg crypto/x509, type VerifyOptions struct, Intermediates *CertPool +pkg crypto/x509, type VerifyOptions struct, Roots *CertPool +pkg crypto/x509, var ErrUnsupportedAlgorithm error +pkg crypto/x509/pkix, method (*CertificateList) HasExpired(time.Time) bool +pkg crypto/x509/pkix, method (*Name) FillFromRDNSequence(*RDNSequence) +pkg crypto/x509/pkix, method (Name) ToRDNSequence() RDNSequence +pkg crypto/x509/pkix, type AlgorithmIdentifier struct +pkg crypto/x509/pkix, type AlgorithmIdentifier struct, Algorithm asn1.ObjectIdentifier +pkg crypto/x509/pkix, type AlgorithmIdentifier struct, Parameters asn1.RawValue +pkg crypto/x509/pkix, type AttributeTypeAndValue struct +pkg crypto/x509/pkix, type AttributeTypeAndValue struct, Type asn1.ObjectIdentifier +pkg crypto/x509/pkix, type AttributeTypeAndValue struct, Value interface{} +pkg crypto/x509/pkix, type CertificateList struct +pkg crypto/x509/pkix, type CertificateList struct, SignatureAlgorithm AlgorithmIdentifier +pkg crypto/x509/pkix, type CertificateList struct, SignatureValue asn1.BitString +pkg crypto/x509/pkix, type CertificateList struct, TBSCertList TBSCertificateList +pkg crypto/x509/pkix, type Extension struct +pkg crypto/x509/pkix, type Extension struct, Critical bool +pkg crypto/x509/pkix, type Extension struct, Id asn1.ObjectIdentifier +pkg crypto/x509/pkix, type Extension struct, Value []uint8 +pkg crypto/x509/pkix, type Name struct +pkg crypto/x509/pkix, type Name struct, CommonName string +pkg crypto/x509/pkix, type Name struct, Country []string +pkg crypto/x509/pkix, type Name struct, Locality []string +pkg crypto/x509/pkix, type Name struct, Names []AttributeTypeAndValue +pkg crypto/x509/pkix, type Name struct, Organization []string +pkg crypto/x509/pkix, type Name struct, OrganizationalUnit []string +pkg crypto/x509/pkix, type Name struct, PostalCode []string +pkg crypto/x509/pkix, type Name struct, Province []string +pkg crypto/x509/pkix, type Name struct, SerialNumber string +pkg crypto/x509/pkix, type Name struct, StreetAddress []string +pkg crypto/x509/pkix, type RDNSequence []RelativeDistinguishedNameSET +pkg crypto/x509/pkix, type RelativeDistinguishedNameSET []AttributeTypeAndValue +pkg crypto/x509/pkix, type RevokedCertificate struct +pkg crypto/x509/pkix, type RevokedCertificate struct, Extensions []Extension +pkg crypto/x509/pkix, type RevokedCertificate struct, RevocationTime time.Time +pkg crypto/x509/pkix, type RevokedCertificate struct, SerialNumber *big.Int +pkg crypto/x509/pkix, type TBSCertificateList struct +pkg crypto/x509/pkix, type TBSCertificateList struct, Extensions []Extension +pkg crypto/x509/pkix, type TBSCertificateList struct, Issuer RDNSequence +pkg crypto/x509/pkix, type TBSCertificateList struct, NextUpdate time.Time +pkg crypto/x509/pkix, type TBSCertificateList struct, Raw asn1.RawContent +pkg crypto/x509/pkix, type TBSCertificateList struct, RevokedCertificates []RevokedCertificate +pkg crypto/x509/pkix, type TBSCertificateList struct, Signature AlgorithmIdentifier +pkg crypto/x509/pkix, type TBSCertificateList struct, ThisUpdate time.Time +pkg crypto/x509/pkix, type TBSCertificateList struct, Version int +pkg database/sql, func Open(string, string) (*DB, error) +pkg database/sql, func Register(string, driver.Driver) +pkg database/sql, method (*DB) Begin() (*Tx, error) +pkg database/sql, method (*DB) Close() error +pkg database/sql, method (*DB) Driver() driver.Driver +pkg database/sql, method (*DB) Exec(string, ...interface{}) (Result, error) +pkg database/sql, method (*DB) Prepare(string) (*Stmt, error) +pkg database/sql, method (*DB) Query(string, ...interface{}) (*Rows, error) +pkg database/sql, method (*DB) QueryRow(string, ...interface{}) *Row +pkg database/sql, method (*NullBool) Scan(interface{}) error +pkg database/sql, method (*NullFloat64) Scan(interface{}) error +pkg database/sql, method (*NullInt64) Scan(interface{}) error +pkg database/sql, method (*NullString) Scan(interface{}) error +pkg database/sql, method (*Row) Scan(...interface{}) error +pkg database/sql, method (*Rows) Close() error +pkg database/sql, method (*Rows) Columns() ([]string, error) +pkg database/sql, method (*Rows) Err() error +pkg database/sql, method (*Rows) Next() bool +pkg database/sql, method (*Rows) Scan(...interface{}) error +pkg database/sql, method (*Stmt) Close() error +pkg database/sql, method (*Stmt) Exec(...interface{}) (Result, error) +pkg database/sql, method (*Stmt) Query(...interface{}) (*Rows, error) +pkg database/sql, method (*Stmt) QueryRow(...interface{}) *Row +pkg database/sql, method (*Tx) Commit() error +pkg database/sql, method (*Tx) Exec(string, ...interface{}) (Result, error) +pkg database/sql, method (*Tx) Prepare(string) (*Stmt, error) +pkg database/sql, method (*Tx) Query(string, ...interface{}) (*Rows, error) +pkg database/sql, method (*Tx) QueryRow(string, ...interface{}) *Row +pkg database/sql, method (*Tx) Rollback() error +pkg database/sql, method (*Tx) Stmt(*Stmt) *Stmt +pkg database/sql, method (NullBool) Value() (driver.Value, error) +pkg database/sql, method (NullFloat64) Value() (driver.Value, error) +pkg database/sql, method (NullInt64) Value() (driver.Value, error) +pkg database/sql, method (NullString) Value() (driver.Value, error) +pkg database/sql, type DB struct +pkg database/sql, type NullBool struct +pkg database/sql, type NullBool struct, Bool bool +pkg database/sql, type NullBool struct, Valid bool +pkg database/sql, type NullFloat64 struct +pkg database/sql, type NullFloat64 struct, Float64 float64 +pkg database/sql, type NullFloat64 struct, Valid bool +pkg database/sql, type NullInt64 struct +pkg database/sql, type NullInt64 struct, Int64 int64 +pkg database/sql, type NullInt64 struct, Valid bool +pkg database/sql, type NullString struct +pkg database/sql, type NullString struct, String string +pkg database/sql, type NullString struct, Valid bool +pkg database/sql, type RawBytes []uint8 +pkg database/sql, type Result interface { LastInsertId, RowsAffected } +pkg database/sql, type Result interface, LastInsertId() (int64, error) +pkg database/sql, type Result interface, RowsAffected() (int64, error) +pkg database/sql, type Row struct +pkg database/sql, type Rows struct +pkg database/sql, type Scanner interface { Scan } +pkg database/sql, type Scanner interface, Scan(interface{}) error +pkg database/sql, type Stmt struct +pkg database/sql, type Tx struct +pkg database/sql, var ErrNoRows error +pkg database/sql, var ErrTxDone error +pkg database/sql/driver, func IsScanValue(interface{}) bool +pkg database/sql/driver, func IsValue(interface{}) bool +pkg database/sql/driver, method (NotNull) ConvertValue(interface{}) (Value, error) +pkg database/sql/driver, method (Null) ConvertValue(interface{}) (Value, error) +pkg database/sql/driver, method (RowsAffected) LastInsertId() (int64, error) +pkg database/sql/driver, method (RowsAffected) RowsAffected() (int64, error) +pkg database/sql/driver, type ColumnConverter interface { ColumnConverter } +pkg database/sql/driver, type ColumnConverter interface, ColumnConverter(int) ValueConverter +pkg database/sql/driver, type Conn interface { Begin, Close, Prepare } +pkg database/sql/driver, type Conn interface, Begin() (Tx, error) +pkg database/sql/driver, type Conn interface, Close() error +pkg database/sql/driver, type Conn interface, Prepare(string) (Stmt, error) +pkg database/sql/driver, type Driver interface { Open } +pkg database/sql/driver, type Driver interface, Open(string) (Conn, error) +pkg database/sql/driver, type Execer interface { Exec } +pkg database/sql/driver, type Execer interface, Exec(string, []Value) (Result, error) +pkg database/sql/driver, type NotNull struct +pkg database/sql/driver, type NotNull struct, Converter ValueConverter +pkg database/sql/driver, type Null struct +pkg database/sql/driver, type Null struct, Converter ValueConverter +pkg database/sql/driver, type Result interface { LastInsertId, RowsAffected } +pkg database/sql/driver, type Result interface, LastInsertId() (int64, error) +pkg database/sql/driver, type Result interface, RowsAffected() (int64, error) +pkg database/sql/driver, type Rows interface { Close, Columns, Next } +pkg database/sql/driver, type Rows interface, Close() error +pkg database/sql/driver, type Rows interface, Columns() []string +pkg database/sql/driver, type Rows interface, Next([]Value) error +pkg database/sql/driver, type RowsAffected int64 +pkg database/sql/driver, type Stmt interface { Close, Exec, NumInput, Query } +pkg database/sql/driver, type Stmt interface, Close() error +pkg database/sql/driver, type Stmt interface, Exec([]Value) (Result, error) +pkg database/sql/driver, type Stmt interface, NumInput() int +pkg database/sql/driver, type Stmt interface, Query([]Value) (Rows, error) +pkg database/sql/driver, type Tx interface { Commit, Rollback } +pkg database/sql/driver, type Tx interface, Commit() error +pkg database/sql/driver, type Tx interface, Rollback() error +pkg database/sql/driver, type Value interface {} +pkg database/sql/driver, type ValueConverter interface { ConvertValue } +pkg database/sql/driver, type ValueConverter interface, ConvertValue(interface{}) (Value, error) +pkg database/sql/driver, type Valuer interface { Value } +pkg database/sql/driver, type Valuer interface, Value() (Value, error) +pkg database/sql/driver, var Bool boolType +pkg database/sql/driver, var DefaultParameterConverter defaultConverter +pkg database/sql/driver, var ErrBadConn error +pkg database/sql/driver, var ErrSkip error +pkg database/sql/driver, var Int32 int32Type +pkg database/sql/driver, var ResultNoRows noRows +pkg database/sql/driver, var String stringType +pkg debug/dwarf, const AttrAbstractOrigin Attr +pkg debug/dwarf, const AttrAccessibility Attr +pkg debug/dwarf, const AttrAddrClass Attr +pkg debug/dwarf, const AttrAllocated Attr +pkg debug/dwarf, const AttrArtificial Attr +pkg debug/dwarf, const AttrAssociated Attr +pkg debug/dwarf, const AttrBaseTypes Attr +pkg debug/dwarf, const AttrBitOffset Attr +pkg debug/dwarf, const AttrBitSize Attr +pkg debug/dwarf, const AttrByteSize Attr +pkg debug/dwarf, const AttrCallColumn Attr +pkg debug/dwarf, const AttrCallFile Attr +pkg debug/dwarf, const AttrCallLine Attr +pkg debug/dwarf, const AttrCalling Attr +pkg debug/dwarf, const AttrCommonRef Attr +pkg debug/dwarf, const AttrCompDir Attr +pkg debug/dwarf, const AttrConstValue Attr +pkg debug/dwarf, const AttrContainingType Attr +pkg debug/dwarf, const AttrCount Attr +pkg debug/dwarf, const AttrDataLocation Attr +pkg debug/dwarf, const AttrDataMemberLoc Attr +pkg debug/dwarf, const AttrDeclColumn Attr +pkg debug/dwarf, const AttrDeclFile Attr +pkg debug/dwarf, const AttrDeclLine Attr +pkg debug/dwarf, const AttrDeclaration Attr +pkg debug/dwarf, const AttrDefaultValue Attr +pkg debug/dwarf, const AttrDescription Attr +pkg debug/dwarf, const AttrDiscr Attr +pkg debug/dwarf, const AttrDiscrList Attr +pkg debug/dwarf, const AttrDiscrValue Attr +pkg debug/dwarf, const AttrEncoding Attr +pkg debug/dwarf, const AttrEntrypc Attr +pkg debug/dwarf, const AttrExtension Attr +pkg debug/dwarf, const AttrExternal Attr +pkg debug/dwarf, const AttrFrameBase Attr +pkg debug/dwarf, const AttrFriend Attr +pkg debug/dwarf, const AttrHighpc Attr +pkg debug/dwarf, const AttrIdentifierCase Attr +pkg debug/dwarf, const AttrImport Attr +pkg debug/dwarf, const AttrInline Attr +pkg debug/dwarf, const AttrIsOptional Attr +pkg debug/dwarf, const AttrLanguage Attr +pkg debug/dwarf, const AttrLocation Attr +pkg debug/dwarf, const AttrLowerBound Attr +pkg debug/dwarf, const AttrLowpc Attr +pkg debug/dwarf, const AttrMacroInfo Attr +pkg debug/dwarf, const AttrName Attr +pkg debug/dwarf, const AttrNamelistItem Attr +pkg debug/dwarf, const AttrOrdering Attr +pkg debug/dwarf, const AttrPriority Attr +pkg debug/dwarf, const AttrProducer Attr +pkg debug/dwarf, const AttrPrototyped Attr +pkg debug/dwarf, const AttrRanges Attr +pkg debug/dwarf, const AttrReturnAddr Attr +pkg debug/dwarf, const AttrSegment Attr +pkg debug/dwarf, const AttrSibling Attr +pkg debug/dwarf, const AttrSpecification Attr +pkg debug/dwarf, const AttrStartScope Attr +pkg debug/dwarf, const AttrStaticLink Attr +pkg debug/dwarf, const AttrStmtList Attr +pkg debug/dwarf, const AttrStride Attr +pkg debug/dwarf, const AttrStrideSize Attr +pkg debug/dwarf, const AttrStringLength Attr +pkg debug/dwarf, const AttrTrampoline Attr +pkg debug/dwarf, const AttrType Attr +pkg debug/dwarf, const AttrUpperBound Attr +pkg debug/dwarf, const AttrUseLocation Attr +pkg debug/dwarf, const AttrUseUTF8 Attr +pkg debug/dwarf, const AttrVarParam Attr +pkg debug/dwarf, const AttrVirtuality Attr +pkg debug/dwarf, const AttrVisibility Attr +pkg debug/dwarf, const AttrVtableElemLoc Attr +pkg debug/dwarf, const TagAccessDeclaration Tag +pkg debug/dwarf, const TagArrayType Tag +pkg debug/dwarf, const TagBaseType Tag +pkg debug/dwarf, const TagCatchDwarfBlock Tag +pkg debug/dwarf, const TagClassType Tag +pkg debug/dwarf, const TagCommonDwarfBlock Tag +pkg debug/dwarf, const TagCommonInclusion Tag +pkg debug/dwarf, const TagCompileUnit Tag +pkg debug/dwarf, const TagConstType Tag +pkg debug/dwarf, const TagConstant Tag +pkg debug/dwarf, const TagDwarfProcedure Tag +pkg debug/dwarf, const TagEntryPoint Tag +pkg debug/dwarf, const TagEnumerationType Tag +pkg debug/dwarf, const TagEnumerator Tag +pkg debug/dwarf, const TagFileType Tag +pkg debug/dwarf, const TagFormalParameter Tag +pkg debug/dwarf, const TagFriend Tag +pkg debug/dwarf, const TagImportedDeclaration Tag +pkg debug/dwarf, const TagImportedModule Tag +pkg debug/dwarf, const TagImportedUnit Tag +pkg debug/dwarf, const TagInheritance Tag +pkg debug/dwarf, const TagInlinedSubroutine Tag +pkg debug/dwarf, const TagInterfaceType Tag +pkg debug/dwarf, const TagLabel Tag +pkg debug/dwarf, const TagLexDwarfBlock Tag +pkg debug/dwarf, const TagMember Tag +pkg debug/dwarf, const TagModule Tag +pkg debug/dwarf, const TagMutableType Tag +pkg debug/dwarf, const TagNamelist Tag +pkg debug/dwarf, const TagNamelistItem Tag +pkg debug/dwarf, const TagNamespace Tag +pkg debug/dwarf, const TagPackedType Tag +pkg debug/dwarf, const TagPartialUnit Tag +pkg debug/dwarf, const TagPointerType Tag +pkg debug/dwarf, const TagPtrToMemberType Tag +pkg debug/dwarf, const TagReferenceType Tag +pkg debug/dwarf, const TagRestrictType Tag +pkg debug/dwarf, const TagSetType Tag +pkg debug/dwarf, const TagStringType Tag +pkg debug/dwarf, const TagStructType Tag +pkg debug/dwarf, const TagSubprogram Tag +pkg debug/dwarf, const TagSubrangeType Tag +pkg debug/dwarf, const TagSubroutineType Tag +pkg debug/dwarf, const TagTemplateTypeParameter Tag +pkg debug/dwarf, const TagTemplateValueParameter Tag +pkg debug/dwarf, const TagThrownType Tag +pkg debug/dwarf, const TagTryDwarfBlock Tag +pkg debug/dwarf, const TagTypedef Tag +pkg debug/dwarf, const TagUnionType Tag +pkg debug/dwarf, const TagUnspecifiedParameters Tag +pkg debug/dwarf, const TagUnspecifiedType Tag +pkg debug/dwarf, const TagVariable Tag +pkg debug/dwarf, const TagVariant Tag +pkg debug/dwarf, const TagVariantPart Tag +pkg debug/dwarf, const TagVolatileType Tag +pkg debug/dwarf, const TagWithStmt Tag +pkg debug/dwarf, func New([]uint8, []uint8, []uint8, []uint8, []uint8, []uint8, []uint8, []uint8) (*Data, error) +pkg debug/dwarf, method (*AddrType) Basic() *BasicType +pkg debug/dwarf, method (*AddrType) Common() *CommonType +pkg debug/dwarf, method (*AddrType) Size() int64 +pkg debug/dwarf, method (*AddrType) String() string +pkg debug/dwarf, method (*ArrayType) Common() *CommonType +pkg debug/dwarf, method (*ArrayType) Size() int64 +pkg debug/dwarf, method (*ArrayType) String() string +pkg debug/dwarf, method (*BasicType) Basic() *BasicType +pkg debug/dwarf, method (*BasicType) Common() *CommonType +pkg debug/dwarf, method (*BasicType) Size() int64 +pkg debug/dwarf, method (*BasicType) String() string +pkg debug/dwarf, method (*BoolType) Basic() *BasicType +pkg debug/dwarf, method (*BoolType) Common() *CommonType +pkg debug/dwarf, method (*BoolType) Size() int64 +pkg debug/dwarf, method (*BoolType) String() string +pkg debug/dwarf, method (*CharType) Basic() *BasicType +pkg debug/dwarf, method (*CharType) Common() *CommonType +pkg debug/dwarf, method (*CharType) Size() int64 +pkg debug/dwarf, method (*CharType) String() string +pkg debug/dwarf, method (*CommonType) Common() *CommonType +pkg debug/dwarf, method (*CommonType) Size() int64 +pkg debug/dwarf, method (*ComplexType) Basic() *BasicType +pkg debug/dwarf, method (*ComplexType) Common() *CommonType +pkg debug/dwarf, method (*ComplexType) Size() int64 +pkg debug/dwarf, method (*ComplexType) String() string +pkg debug/dwarf, method (*Data) Reader() *Reader +pkg debug/dwarf, method (*Data) Type(Offset) (Type, error) +pkg debug/dwarf, method (*DotDotDotType) Common() *CommonType +pkg debug/dwarf, method (*DotDotDotType) Size() int64 +pkg debug/dwarf, method (*DotDotDotType) String() string +pkg debug/dwarf, method (*Entry) Val(Attr) interface{} +pkg debug/dwarf, method (*EnumType) Common() *CommonType +pkg debug/dwarf, method (*EnumType) Size() int64 +pkg debug/dwarf, method (*EnumType) String() string +pkg debug/dwarf, method (*FloatType) Basic() *BasicType +pkg debug/dwarf, method (*FloatType) Common() *CommonType +pkg debug/dwarf, method (*FloatType) Size() int64 +pkg debug/dwarf, method (*FloatType) String() string +pkg debug/dwarf, method (*FuncType) Common() *CommonType +pkg debug/dwarf, method (*FuncType) Size() int64 +pkg debug/dwarf, method (*FuncType) String() string +pkg debug/dwarf, method (*IntType) Basic() *BasicType +pkg debug/dwarf, method (*IntType) Common() *CommonType +pkg debug/dwarf, method (*IntType) Size() int64 +pkg debug/dwarf, method (*IntType) String() string +pkg debug/dwarf, method (*PtrType) Common() *CommonType +pkg debug/dwarf, method (*PtrType) Size() int64 +pkg debug/dwarf, method (*PtrType) String() string +pkg debug/dwarf, method (*QualType) Common() *CommonType +pkg debug/dwarf, method (*QualType) Size() int64 +pkg debug/dwarf, method (*QualType) String() string +pkg debug/dwarf, method (*Reader) Next() (*Entry, error) +pkg debug/dwarf, method (*Reader) Seek(Offset) +pkg debug/dwarf, method (*Reader) SkipChildren() +pkg debug/dwarf, method (*StructType) Common() *CommonType +pkg debug/dwarf, method (*StructType) Defn() string +pkg debug/dwarf, method (*StructType) Size() int64 +pkg debug/dwarf, method (*StructType) String() string +pkg debug/dwarf, method (*TypedefType) Common() *CommonType +pkg debug/dwarf, method (*TypedefType) Size() int64 +pkg debug/dwarf, method (*TypedefType) String() string +pkg debug/dwarf, method (*UcharType) Basic() *BasicType +pkg debug/dwarf, method (*UcharType) Common() *CommonType +pkg debug/dwarf, method (*UcharType) Size() int64 +pkg debug/dwarf, method (*UcharType) String() string +pkg debug/dwarf, method (*UintType) Basic() *BasicType +pkg debug/dwarf, method (*UintType) Common() *CommonType +pkg debug/dwarf, method (*UintType) Size() int64 +pkg debug/dwarf, method (*UintType) String() string +pkg debug/dwarf, method (*VoidType) Common() *CommonType +pkg debug/dwarf, method (*VoidType) Size() int64 +pkg debug/dwarf, method (*VoidType) String() string +pkg debug/dwarf, method (Attr) GoString() string +pkg debug/dwarf, method (Attr) String() string +pkg debug/dwarf, method (DecodeError) Error() string +pkg debug/dwarf, method (Tag) GoString() string +pkg debug/dwarf, method (Tag) String() string +pkg debug/dwarf, type AddrType struct +pkg debug/dwarf, type AddrType struct, embedded BasicType +pkg debug/dwarf, type ArrayType struct +pkg debug/dwarf, type ArrayType struct, Count int64 +pkg debug/dwarf, type ArrayType struct, StrideBitSize int64 +pkg debug/dwarf, type ArrayType struct, Type Type +pkg debug/dwarf, type ArrayType struct, embedded CommonType +pkg debug/dwarf, type Attr uint32 +pkg debug/dwarf, type BasicType struct +pkg debug/dwarf, type BasicType struct, BitOffset int64 +pkg debug/dwarf, type BasicType struct, BitSize int64 +pkg debug/dwarf, type BasicType struct, embedded CommonType +pkg debug/dwarf, type BoolType struct +pkg debug/dwarf, type BoolType struct, embedded BasicType +pkg debug/dwarf, type CharType struct +pkg debug/dwarf, type CharType struct, embedded BasicType +pkg debug/dwarf, type CommonType struct +pkg debug/dwarf, type CommonType struct, ByteSize int64 +pkg debug/dwarf, type CommonType struct, Name string +pkg debug/dwarf, type ComplexType struct +pkg debug/dwarf, type ComplexType struct, embedded BasicType +pkg debug/dwarf, type Data struct +pkg debug/dwarf, type DecodeError struct +pkg debug/dwarf, type DecodeError struct, Err string +pkg debug/dwarf, type DecodeError struct, Name string +pkg debug/dwarf, type DecodeError struct, Offset Offset +pkg debug/dwarf, type DotDotDotType struct +pkg debug/dwarf, type DotDotDotType struct, embedded CommonType +pkg debug/dwarf, type Entry struct +pkg debug/dwarf, type Entry struct, Children bool +pkg debug/dwarf, type Entry struct, Field []Field +pkg debug/dwarf, type Entry struct, Offset Offset +pkg debug/dwarf, type Entry struct, Tag Tag +pkg debug/dwarf, type EnumType struct +pkg debug/dwarf, type EnumType struct, EnumName string +pkg debug/dwarf, type EnumType struct, Val []*EnumValue +pkg debug/dwarf, type EnumType struct, embedded CommonType +pkg debug/dwarf, type EnumValue struct +pkg debug/dwarf, type EnumValue struct, Name string +pkg debug/dwarf, type EnumValue struct, Val int64 +pkg debug/dwarf, type Field struct +pkg debug/dwarf, type Field struct, Attr Attr +pkg debug/dwarf, type Field struct, Val interface{} +pkg debug/dwarf, type FloatType struct +pkg debug/dwarf, type FloatType struct, embedded BasicType +pkg debug/dwarf, type FuncType struct +pkg debug/dwarf, type FuncType struct, ParamType []Type +pkg debug/dwarf, type FuncType struct, ReturnType Type +pkg debug/dwarf, type FuncType struct, embedded CommonType +pkg debug/dwarf, type IntType struct +pkg debug/dwarf, type IntType struct, embedded BasicType +pkg debug/dwarf, type Offset uint32 +pkg debug/dwarf, type PtrType struct +pkg debug/dwarf, type PtrType struct, Type Type +pkg debug/dwarf, type PtrType struct, embedded CommonType +pkg debug/dwarf, type QualType struct +pkg debug/dwarf, type QualType struct, Qual string +pkg debug/dwarf, type QualType struct, Type Type +pkg debug/dwarf, type QualType struct, embedded CommonType +pkg debug/dwarf, type Reader struct +pkg debug/dwarf, type StructField struct +pkg debug/dwarf, type StructField struct, BitOffset int64 +pkg debug/dwarf, type StructField struct, BitSize int64 +pkg debug/dwarf, type StructField struct, ByteOffset int64 +pkg debug/dwarf, type StructField struct, ByteSize int64 +pkg debug/dwarf, type StructField struct, Name string +pkg debug/dwarf, type StructField struct, Type Type +pkg debug/dwarf, type StructType struct +pkg debug/dwarf, type StructType struct, Field []*StructField +pkg debug/dwarf, type StructType struct, Incomplete bool +pkg debug/dwarf, type StructType struct, Kind string +pkg debug/dwarf, type StructType struct, StructName string +pkg debug/dwarf, type StructType struct, embedded CommonType +pkg debug/dwarf, type Tag uint32 +pkg debug/dwarf, type Type interface { Common, Size, String } +pkg debug/dwarf, type Type interface, Common() *CommonType +pkg debug/dwarf, type Type interface, Size() int64 +pkg debug/dwarf, type Type interface, String() string +pkg debug/dwarf, type TypedefType struct +pkg debug/dwarf, type TypedefType struct, Type Type +pkg debug/dwarf, type TypedefType struct, embedded CommonType +pkg debug/dwarf, type UcharType struct +pkg debug/dwarf, type UcharType struct, embedded BasicType +pkg debug/dwarf, type UintType struct +pkg debug/dwarf, type UintType struct, embedded BasicType +pkg debug/dwarf, type VoidType struct +pkg debug/dwarf, type VoidType struct, embedded CommonType +pkg debug/elf, const ARM_MAGIC_TRAMP_NUMBER ideal-int +pkg debug/elf, const DF_BIND_NOW DynFlag +pkg debug/elf, const DF_ORIGIN DynFlag +pkg debug/elf, const DF_STATIC_TLS DynFlag +pkg debug/elf, const DF_SYMBOLIC DynFlag +pkg debug/elf, const DF_TEXTREL DynFlag +pkg debug/elf, const DT_BIND_NOW DynTag +pkg debug/elf, const DT_DEBUG DynTag +pkg debug/elf, const DT_ENCODING DynTag +pkg debug/elf, const DT_FINI DynTag +pkg debug/elf, const DT_FINI_ARRAY DynTag +pkg debug/elf, const DT_FINI_ARRAYSZ DynTag +pkg debug/elf, const DT_FLAGS DynTag +pkg debug/elf, const DT_HASH DynTag +pkg debug/elf, const DT_HIOS DynTag +pkg debug/elf, const DT_HIPROC DynTag +pkg debug/elf, const DT_INIT DynTag +pkg debug/elf, const DT_INIT_ARRAY DynTag +pkg debug/elf, const DT_INIT_ARRAYSZ DynTag +pkg debug/elf, const DT_JMPREL DynTag +pkg debug/elf, const DT_LOOS DynTag +pkg debug/elf, const DT_LOPROC DynTag +pkg debug/elf, const DT_NEEDED DynTag +pkg debug/elf, const DT_NULL DynTag +pkg debug/elf, const DT_PLTGOT DynTag +pkg debug/elf, const DT_PLTREL DynTag +pkg debug/elf, const DT_PLTRELSZ DynTag +pkg debug/elf, const DT_PREINIT_ARRAY DynTag +pkg debug/elf, const DT_PREINIT_ARRAYSZ DynTag +pkg debug/elf, const DT_REL DynTag +pkg debug/elf, const DT_RELA DynTag +pkg debug/elf, const DT_RELAENT DynTag +pkg debug/elf, const DT_RELASZ DynTag +pkg debug/elf, const DT_RELENT DynTag +pkg debug/elf, const DT_RELSZ DynTag +pkg debug/elf, const DT_RPATH DynTag +pkg debug/elf, const DT_RUNPATH DynTag +pkg debug/elf, const DT_SONAME DynTag +pkg debug/elf, const DT_STRSZ DynTag +pkg debug/elf, const DT_STRTAB DynTag +pkg debug/elf, const DT_SYMBOLIC DynTag +pkg debug/elf, const DT_SYMENT DynTag +pkg debug/elf, const DT_SYMTAB DynTag +pkg debug/elf, const DT_TEXTREL DynTag +pkg debug/elf, const DT_VERNEED DynTag +pkg debug/elf, const DT_VERNEEDNUM DynTag +pkg debug/elf, const DT_VERSYM DynTag +pkg debug/elf, const EI_ABIVERSION ideal-int +pkg debug/elf, const EI_CLASS ideal-int +pkg debug/elf, const EI_DATA ideal-int +pkg debug/elf, const EI_NIDENT ideal-int +pkg debug/elf, const EI_OSABI ideal-int +pkg debug/elf, const EI_PAD ideal-int +pkg debug/elf, const EI_VERSION ideal-int +pkg debug/elf, const ELFCLASS32 Class +pkg debug/elf, const ELFCLASS64 Class +pkg debug/elf, const ELFCLASSNONE Class +pkg debug/elf, const ELFDATA2LSB Data +pkg debug/elf, const ELFDATA2MSB Data +pkg debug/elf, const ELFDATANONE Data +pkg debug/elf, const ELFMAG ideal-string +pkg debug/elf, const ELFOSABI_86OPEN OSABI +pkg debug/elf, const ELFOSABI_AIX OSABI +pkg debug/elf, const ELFOSABI_ARM OSABI +pkg debug/elf, const ELFOSABI_FREEBSD OSABI +pkg debug/elf, const ELFOSABI_HPUX OSABI +pkg debug/elf, const ELFOSABI_HURD OSABI +pkg debug/elf, const ELFOSABI_IRIX OSABI +pkg debug/elf, const ELFOSABI_LINUX OSABI +pkg debug/elf, const ELFOSABI_MODESTO OSABI +pkg debug/elf, const ELFOSABI_NETBSD OSABI +pkg debug/elf, const ELFOSABI_NONE OSABI +pkg debug/elf, const ELFOSABI_NSK OSABI +pkg debug/elf, const ELFOSABI_OPENBSD OSABI +pkg debug/elf, const ELFOSABI_OPENVMS OSABI +pkg debug/elf, const ELFOSABI_SOLARIS OSABI +pkg debug/elf, const ELFOSABI_STANDALONE OSABI +pkg debug/elf, const ELFOSABI_TRU64 OSABI +pkg debug/elf, const EM_386 Machine +pkg debug/elf, const EM_486 Machine +pkg debug/elf, const EM_68HC12 Machine +pkg debug/elf, const EM_68K Machine +pkg debug/elf, const EM_860 Machine +pkg debug/elf, const EM_88K Machine +pkg debug/elf, const EM_960 Machine +pkg debug/elf, const EM_ALPHA Machine +pkg debug/elf, const EM_ALPHA_STD Machine +pkg debug/elf, const EM_ARC Machine +pkg debug/elf, const EM_ARM Machine +pkg debug/elf, const EM_COLDFIRE Machine +pkg debug/elf, const EM_FR20 Machine +pkg debug/elf, const EM_H8S Machine +pkg debug/elf, const EM_H8_300 Machine +pkg debug/elf, const EM_H8_300H Machine +pkg debug/elf, const EM_H8_500 Machine +pkg debug/elf, const EM_IA_64 Machine +pkg debug/elf, const EM_M32 Machine +pkg debug/elf, const EM_ME16 Machine +pkg debug/elf, const EM_MIPS Machine +pkg debug/elf, const EM_MIPS_RS3_LE Machine +pkg debug/elf, const EM_MIPS_RS4_BE Machine +pkg debug/elf, const EM_MIPS_X Machine +pkg debug/elf, const EM_MMA Machine +pkg debug/elf, const EM_NCPU Machine +pkg debug/elf, const EM_NDR1 Machine +pkg debug/elf, const EM_NONE Machine +pkg debug/elf, const EM_PARISC Machine +pkg debug/elf, const EM_PCP Machine +pkg debug/elf, const EM_PPC Machine +pkg debug/elf, const EM_PPC64 Machine +pkg debug/elf, const EM_RCE Machine +pkg debug/elf, const EM_RH32 Machine +pkg debug/elf, const EM_S370 Machine +pkg debug/elf, const EM_S390 Machine +pkg debug/elf, const EM_SH Machine +pkg debug/elf, const EM_SPARC Machine +pkg debug/elf, const EM_SPARC32PLUS Machine +pkg debug/elf, const EM_SPARCV9 Machine +pkg debug/elf, const EM_ST100 Machine +pkg debug/elf, const EM_STARCORE Machine +pkg debug/elf, const EM_TINYJ Machine +pkg debug/elf, const EM_TRICORE Machine +pkg debug/elf, const EM_V800 Machine +pkg debug/elf, const EM_VPP500 Machine +pkg debug/elf, const EM_X86_64 Machine +pkg debug/elf, const ET_CORE Type +pkg debug/elf, const ET_DYN Type +pkg debug/elf, const ET_EXEC Type +pkg debug/elf, const ET_HIOS Type +pkg debug/elf, const ET_HIPROC Type +pkg debug/elf, const ET_LOOS Type +pkg debug/elf, const ET_LOPROC Type +pkg debug/elf, const ET_NONE Type +pkg debug/elf, const ET_REL Type +pkg debug/elf, const EV_CURRENT Version +pkg debug/elf, const EV_NONE Version +pkg debug/elf, const NT_FPREGSET NType +pkg debug/elf, const NT_PRPSINFO NType +pkg debug/elf, const NT_PRSTATUS NType +pkg debug/elf, const PF_MASKOS ProgFlag +pkg debug/elf, const PF_MASKPROC ProgFlag +pkg debug/elf, const PF_R ProgFlag +pkg debug/elf, const PF_W ProgFlag +pkg debug/elf, const PF_X ProgFlag +pkg debug/elf, const PT_DYNAMIC ProgType +pkg debug/elf, const PT_HIOS ProgType +pkg debug/elf, const PT_HIPROC ProgType +pkg debug/elf, const PT_INTERP ProgType +pkg debug/elf, const PT_LOAD ProgType +pkg debug/elf, const PT_LOOS ProgType +pkg debug/elf, const PT_LOPROC ProgType +pkg debug/elf, const PT_NOTE ProgType +pkg debug/elf, const PT_NULL ProgType +pkg debug/elf, const PT_PHDR ProgType +pkg debug/elf, const PT_SHLIB ProgType +pkg debug/elf, const PT_TLS ProgType +pkg debug/elf, const R_386_32 R_386 +pkg debug/elf, const R_386_COPY R_386 +pkg debug/elf, const R_386_GLOB_DAT R_386 +pkg debug/elf, const R_386_GOT32 R_386 +pkg debug/elf, const R_386_GOTOFF R_386 +pkg debug/elf, const R_386_GOTPC R_386 +pkg debug/elf, const R_386_JMP_SLOT R_386 +pkg debug/elf, const R_386_NONE R_386 +pkg debug/elf, const R_386_PC32 R_386 +pkg debug/elf, const R_386_PLT32 R_386 +pkg debug/elf, const R_386_RELATIVE R_386 +pkg debug/elf, const R_386_TLS_DTPMOD32 R_386 +pkg debug/elf, const R_386_TLS_DTPOFF32 R_386 +pkg debug/elf, const R_386_TLS_GD R_386 +pkg debug/elf, const R_386_TLS_GD_32 R_386 +pkg debug/elf, const R_386_TLS_GD_CALL R_386 +pkg debug/elf, const R_386_TLS_GD_POP R_386 +pkg debug/elf, const R_386_TLS_GD_PUSH R_386 +pkg debug/elf, const R_386_TLS_GOTIE R_386 +pkg debug/elf, const R_386_TLS_IE R_386 +pkg debug/elf, const R_386_TLS_IE_32 R_386 +pkg debug/elf, const R_386_TLS_LDM R_386 +pkg debug/elf, const R_386_TLS_LDM_32 R_386 +pkg debug/elf, const R_386_TLS_LDM_CALL R_386 +pkg debug/elf, const R_386_TLS_LDM_POP R_386 +pkg debug/elf, const R_386_TLS_LDM_PUSH R_386 +pkg debug/elf, const R_386_TLS_LDO_32 R_386 +pkg debug/elf, const R_386_TLS_LE R_386 +pkg debug/elf, const R_386_TLS_LE_32 R_386 +pkg debug/elf, const R_386_TLS_TPOFF R_386 +pkg debug/elf, const R_386_TLS_TPOFF32 R_386 +pkg debug/elf, const R_ALPHA_BRADDR R_ALPHA +pkg debug/elf, const R_ALPHA_COPY R_ALPHA +pkg debug/elf, const R_ALPHA_GLOB_DAT R_ALPHA +pkg debug/elf, const R_ALPHA_GPDISP R_ALPHA +pkg debug/elf, const R_ALPHA_GPREL32 R_ALPHA +pkg debug/elf, const R_ALPHA_GPRELHIGH R_ALPHA +pkg debug/elf, const R_ALPHA_GPRELLOW R_ALPHA +pkg debug/elf, const R_ALPHA_GPVALUE R_ALPHA +pkg debug/elf, const R_ALPHA_HINT R_ALPHA +pkg debug/elf, const R_ALPHA_IMMED_BR_HI32 R_ALPHA +pkg debug/elf, const R_ALPHA_IMMED_GP_16 R_ALPHA +pkg debug/elf, const R_ALPHA_IMMED_GP_HI32 R_ALPHA +pkg debug/elf, const R_ALPHA_IMMED_LO32 R_ALPHA +pkg debug/elf, const R_ALPHA_IMMED_SCN_HI32 R_ALPHA +pkg debug/elf, const R_ALPHA_JMP_SLOT R_ALPHA +pkg debug/elf, const R_ALPHA_LITERAL R_ALPHA +pkg debug/elf, const R_ALPHA_LITUSE R_ALPHA +pkg debug/elf, const R_ALPHA_NONE R_ALPHA +pkg debug/elf, const R_ALPHA_OP_PRSHIFT R_ALPHA +pkg debug/elf, const R_ALPHA_OP_PSUB R_ALPHA +pkg debug/elf, const R_ALPHA_OP_PUSH R_ALPHA +pkg debug/elf, const R_ALPHA_OP_STORE R_ALPHA +pkg debug/elf, const R_ALPHA_REFLONG R_ALPHA +pkg debug/elf, const R_ALPHA_REFQUAD R_ALPHA +pkg debug/elf, const R_ALPHA_RELATIVE R_ALPHA +pkg debug/elf, const R_ALPHA_SREL16 R_ALPHA +pkg debug/elf, const R_ALPHA_SREL32 R_ALPHA +pkg debug/elf, const R_ALPHA_SREL64 R_ALPHA +pkg debug/elf, const R_ARM_ABS12 R_ARM +pkg debug/elf, const R_ARM_ABS16 R_ARM +pkg debug/elf, const R_ARM_ABS32 R_ARM +pkg debug/elf, const R_ARM_ABS8 R_ARM +pkg debug/elf, const R_ARM_AMP_VCALL9 R_ARM +pkg debug/elf, const R_ARM_COPY R_ARM +pkg debug/elf, const R_ARM_GLOB_DAT R_ARM +pkg debug/elf, const R_ARM_GNU_VTENTRY R_ARM +pkg debug/elf, const R_ARM_GNU_VTINHERIT R_ARM +pkg debug/elf, const R_ARM_GOT32 R_ARM +pkg debug/elf, const R_ARM_GOTOFF R_ARM +pkg debug/elf, const R_ARM_GOTPC R_ARM +pkg debug/elf, const R_ARM_JUMP_SLOT R_ARM +pkg debug/elf, const R_ARM_NONE R_ARM +pkg debug/elf, const R_ARM_PC13 R_ARM +pkg debug/elf, const R_ARM_PC24 R_ARM +pkg debug/elf, const R_ARM_PLT32 R_ARM +pkg debug/elf, const R_ARM_RABS32 R_ARM +pkg debug/elf, const R_ARM_RBASE R_ARM +pkg debug/elf, const R_ARM_REL32 R_ARM +pkg debug/elf, const R_ARM_RELATIVE R_ARM +pkg debug/elf, const R_ARM_RPC24 R_ARM +pkg debug/elf, const R_ARM_RREL32 R_ARM +pkg debug/elf, const R_ARM_RSBREL32 R_ARM +pkg debug/elf, const R_ARM_SBREL32 R_ARM +pkg debug/elf, const R_ARM_SWI24 R_ARM +pkg debug/elf, const R_ARM_THM_ABS5 R_ARM +pkg debug/elf, const R_ARM_THM_PC22 R_ARM +pkg debug/elf, const R_ARM_THM_PC8 R_ARM +pkg debug/elf, const R_ARM_THM_RPC22 R_ARM +pkg debug/elf, const R_ARM_THM_SWI8 R_ARM +pkg debug/elf, const R_ARM_THM_XPC22 R_ARM +pkg debug/elf, const R_ARM_XPC25 R_ARM +pkg debug/elf, const R_PPC_ADDR14 R_PPC +pkg debug/elf, const R_PPC_ADDR14_BRNTAKEN R_PPC +pkg debug/elf, const R_PPC_ADDR14_BRTAKEN R_PPC +pkg debug/elf, const R_PPC_ADDR16 R_PPC +pkg debug/elf, const R_PPC_ADDR16_HA R_PPC +pkg debug/elf, const R_PPC_ADDR16_HI R_PPC +pkg debug/elf, const R_PPC_ADDR16_LO R_PPC +pkg debug/elf, const R_PPC_ADDR24 R_PPC +pkg debug/elf, const R_PPC_ADDR32 R_PPC +pkg debug/elf, const R_PPC_COPY R_PPC +pkg debug/elf, const R_PPC_DTPMOD32 R_PPC +pkg debug/elf, const R_PPC_DTPREL16 R_PPC +pkg debug/elf, const R_PPC_DTPREL16_HA R_PPC +pkg debug/elf, const R_PPC_DTPREL16_HI R_PPC +pkg debug/elf, const R_PPC_DTPREL16_LO R_PPC +pkg debug/elf, const R_PPC_DTPREL32 R_PPC +pkg debug/elf, const R_PPC_EMB_BIT_FLD R_PPC +pkg debug/elf, const R_PPC_EMB_MRKREF R_PPC +pkg debug/elf, const R_PPC_EMB_NADDR16 R_PPC +pkg debug/elf, const R_PPC_EMB_NADDR16_HA R_PPC +pkg debug/elf, const R_PPC_EMB_NADDR16_HI R_PPC +pkg debug/elf, const R_PPC_EMB_NADDR16_LO R_PPC +pkg debug/elf, const R_PPC_EMB_NADDR32 R_PPC +pkg debug/elf, const R_PPC_EMB_RELSDA R_PPC +pkg debug/elf, const R_PPC_EMB_RELSEC16 R_PPC +pkg debug/elf, const R_PPC_EMB_RELST_HA R_PPC +pkg debug/elf, const R_PPC_EMB_RELST_HI R_PPC +pkg debug/elf, const R_PPC_EMB_RELST_LO R_PPC +pkg debug/elf, const R_PPC_EMB_SDA21 R_PPC +pkg debug/elf, const R_PPC_EMB_SDA2I16 R_PPC +pkg debug/elf, const R_PPC_EMB_SDA2REL R_PPC +pkg debug/elf, const R_PPC_EMB_SDAI16 R_PPC +pkg debug/elf, const R_PPC_GLOB_DAT R_PPC +pkg debug/elf, const R_PPC_GOT16 R_PPC +pkg debug/elf, const R_PPC_GOT16_HA R_PPC +pkg debug/elf, const R_PPC_GOT16_HI R_PPC +pkg debug/elf, const R_PPC_GOT16_LO R_PPC +pkg debug/elf, const R_PPC_GOT_TLSGD16 R_PPC +pkg debug/elf, const R_PPC_GOT_TLSGD16_HA R_PPC +pkg debug/elf, const R_PPC_GOT_TLSGD16_HI R_PPC +pkg debug/elf, const R_PPC_GOT_TLSGD16_LO R_PPC +pkg debug/elf, const R_PPC_GOT_TLSLD16 R_PPC +pkg debug/elf, const R_PPC_GOT_TLSLD16_HA R_PPC +pkg debug/elf, const R_PPC_GOT_TLSLD16_HI R_PPC +pkg debug/elf, const R_PPC_GOT_TLSLD16_LO R_PPC +pkg debug/elf, const R_PPC_GOT_TPREL16 R_PPC +pkg debug/elf, const R_PPC_GOT_TPREL16_HA R_PPC +pkg debug/elf, const R_PPC_GOT_TPREL16_HI R_PPC +pkg debug/elf, const R_PPC_GOT_TPREL16_LO R_PPC +pkg debug/elf, const R_PPC_JMP_SLOT R_PPC +pkg debug/elf, const R_PPC_LOCAL24PC R_PPC +pkg debug/elf, const R_PPC_NONE R_PPC +pkg debug/elf, const R_PPC_PLT16_HA R_PPC +pkg debug/elf, const R_PPC_PLT16_HI R_PPC +pkg debug/elf, const R_PPC_PLT16_LO R_PPC +pkg debug/elf, const R_PPC_PLT32 R_PPC +pkg debug/elf, const R_PPC_PLTREL24 R_PPC +pkg debug/elf, const R_PPC_PLTREL32 R_PPC +pkg debug/elf, const R_PPC_REL14 R_PPC +pkg debug/elf, const R_PPC_REL14_BRNTAKEN R_PPC +pkg debug/elf, const R_PPC_REL14_BRTAKEN R_PPC +pkg debug/elf, const R_PPC_REL24 R_PPC +pkg debug/elf, const R_PPC_REL32 R_PPC +pkg debug/elf, const R_PPC_RELATIVE R_PPC +pkg debug/elf, const R_PPC_SDAREL16 R_PPC +pkg debug/elf, const R_PPC_SECTOFF R_PPC +pkg debug/elf, const R_PPC_SECTOFF_HA R_PPC +pkg debug/elf, const R_PPC_SECTOFF_HI R_PPC +pkg debug/elf, const R_PPC_SECTOFF_LO R_PPC +pkg debug/elf, const R_PPC_TLS R_PPC +pkg debug/elf, const R_PPC_TPREL16 R_PPC +pkg debug/elf, const R_PPC_TPREL16_HA R_PPC +pkg debug/elf, const R_PPC_TPREL16_HI R_PPC +pkg debug/elf, const R_PPC_TPREL16_LO R_PPC +pkg debug/elf, const R_PPC_TPREL32 R_PPC +pkg debug/elf, const R_PPC_UADDR16 R_PPC +pkg debug/elf, const R_PPC_UADDR32 R_PPC +pkg debug/elf, const R_SPARC_10 R_SPARC +pkg debug/elf, const R_SPARC_11 R_SPARC +pkg debug/elf, const R_SPARC_13 R_SPARC +pkg debug/elf, const R_SPARC_16 R_SPARC +pkg debug/elf, const R_SPARC_22 R_SPARC +pkg debug/elf, const R_SPARC_32 R_SPARC +pkg debug/elf, const R_SPARC_5 R_SPARC +pkg debug/elf, const R_SPARC_6 R_SPARC +pkg debug/elf, const R_SPARC_64 R_SPARC +pkg debug/elf, const R_SPARC_7 R_SPARC +pkg debug/elf, const R_SPARC_8 R_SPARC +pkg debug/elf, const R_SPARC_COPY R_SPARC +pkg debug/elf, const R_SPARC_DISP16 R_SPARC +pkg debug/elf, const R_SPARC_DISP32 R_SPARC +pkg debug/elf, const R_SPARC_DISP64 R_SPARC +pkg debug/elf, const R_SPARC_DISP8 R_SPARC +pkg debug/elf, const R_SPARC_GLOB_DAT R_SPARC +pkg debug/elf, const R_SPARC_GLOB_JMP R_SPARC +pkg debug/elf, const R_SPARC_GOT10 R_SPARC +pkg debug/elf, const R_SPARC_GOT13 R_SPARC +pkg debug/elf, const R_SPARC_GOT22 R_SPARC +pkg debug/elf, const R_SPARC_H44 R_SPARC +pkg debug/elf, const R_SPARC_HH22 R_SPARC +pkg debug/elf, const R_SPARC_HI22 R_SPARC +pkg debug/elf, const R_SPARC_HIPLT22 R_SPARC +pkg debug/elf, const R_SPARC_HIX22 R_SPARC +pkg debug/elf, const R_SPARC_HM10 R_SPARC +pkg debug/elf, const R_SPARC_JMP_SLOT R_SPARC +pkg debug/elf, const R_SPARC_L44 R_SPARC +pkg debug/elf, const R_SPARC_LM22 R_SPARC +pkg debug/elf, const R_SPARC_LO10 R_SPARC +pkg debug/elf, const R_SPARC_LOPLT10 R_SPARC +pkg debug/elf, const R_SPARC_LOX10 R_SPARC +pkg debug/elf, const R_SPARC_M44 R_SPARC +pkg debug/elf, const R_SPARC_NONE R_SPARC +pkg debug/elf, const R_SPARC_OLO10 R_SPARC +pkg debug/elf, const R_SPARC_PC10 R_SPARC +pkg debug/elf, const R_SPARC_PC22 R_SPARC +pkg debug/elf, const R_SPARC_PCPLT10 R_SPARC +pkg debug/elf, const R_SPARC_PCPLT22 R_SPARC +pkg debug/elf, const R_SPARC_PCPLT32 R_SPARC +pkg debug/elf, const R_SPARC_PC_HH22 R_SPARC +pkg debug/elf, const R_SPARC_PC_HM10 R_SPARC +pkg debug/elf, const R_SPARC_PC_LM22 R_SPARC +pkg debug/elf, const R_SPARC_PLT32 R_SPARC +pkg debug/elf, const R_SPARC_PLT64 R_SPARC +pkg debug/elf, const R_SPARC_REGISTER R_SPARC +pkg debug/elf, const R_SPARC_RELATIVE R_SPARC +pkg debug/elf, const R_SPARC_UA16 R_SPARC +pkg debug/elf, const R_SPARC_UA32 R_SPARC +pkg debug/elf, const R_SPARC_UA64 R_SPARC +pkg debug/elf, const R_SPARC_WDISP16 R_SPARC +pkg debug/elf, const R_SPARC_WDISP19 R_SPARC +pkg debug/elf, const R_SPARC_WDISP22 R_SPARC +pkg debug/elf, const R_SPARC_WDISP30 R_SPARC +pkg debug/elf, const R_SPARC_WPLT30 R_SPARC +pkg debug/elf, const R_X86_64_16 R_X86_64 +pkg debug/elf, const R_X86_64_32 R_X86_64 +pkg debug/elf, const R_X86_64_32S R_X86_64 +pkg debug/elf, const R_X86_64_64 R_X86_64 +pkg debug/elf, const R_X86_64_8 R_X86_64 +pkg debug/elf, const R_X86_64_COPY R_X86_64 +pkg debug/elf, const R_X86_64_DTPMOD64 R_X86_64 +pkg debug/elf, const R_X86_64_DTPOFF32 R_X86_64 +pkg debug/elf, const R_X86_64_DTPOFF64 R_X86_64 +pkg debug/elf, const R_X86_64_GLOB_DAT R_X86_64 +pkg debug/elf, const R_X86_64_GOT32 R_X86_64 +pkg debug/elf, const R_X86_64_GOTPCREL R_X86_64 +pkg debug/elf, const R_X86_64_GOTTPOFF R_X86_64 +pkg debug/elf, const R_X86_64_JMP_SLOT R_X86_64 +pkg debug/elf, const R_X86_64_NONE R_X86_64 +pkg debug/elf, const R_X86_64_PC16 R_X86_64 +pkg debug/elf, const R_X86_64_PC32 R_X86_64 +pkg debug/elf, const R_X86_64_PC8 R_X86_64 +pkg debug/elf, const R_X86_64_PLT32 R_X86_64 +pkg debug/elf, const R_X86_64_RELATIVE R_X86_64 +pkg debug/elf, const R_X86_64_TLSGD R_X86_64 +pkg debug/elf, const R_X86_64_TLSLD R_X86_64 +pkg debug/elf, const R_X86_64_TPOFF32 R_X86_64 +pkg debug/elf, const R_X86_64_TPOFF64 R_X86_64 +pkg debug/elf, const SHF_ALLOC SectionFlag +pkg debug/elf, const SHF_EXECINSTR SectionFlag +pkg debug/elf, const SHF_GROUP SectionFlag +pkg debug/elf, const SHF_INFO_LINK SectionFlag +pkg debug/elf, const SHF_LINK_ORDER SectionFlag +pkg debug/elf, const SHF_MASKOS SectionFlag +pkg debug/elf, const SHF_MASKPROC SectionFlag +pkg debug/elf, const SHF_MERGE SectionFlag +pkg debug/elf, const SHF_OS_NONCONFORMING SectionFlag +pkg debug/elf, const SHF_STRINGS SectionFlag +pkg debug/elf, const SHF_TLS SectionFlag +pkg debug/elf, const SHF_WRITE SectionFlag +pkg debug/elf, const SHN_ABS SectionIndex +pkg debug/elf, const SHN_COMMON SectionIndex +pkg debug/elf, const SHN_HIOS SectionIndex +pkg debug/elf, const SHN_HIPROC SectionIndex +pkg debug/elf, const SHN_HIRESERVE SectionIndex +pkg debug/elf, const SHN_LOOS SectionIndex +pkg debug/elf, const SHN_LOPROC SectionIndex +pkg debug/elf, const SHN_LORESERVE SectionIndex +pkg debug/elf, const SHN_UNDEF SectionIndex +pkg debug/elf, const SHN_XINDEX SectionIndex +pkg debug/elf, const SHT_DYNAMIC SectionType +pkg debug/elf, const SHT_DYNSYM SectionType +pkg debug/elf, const SHT_FINI_ARRAY SectionType +pkg debug/elf, const SHT_GNU_ATTRIBUTES SectionType +pkg debug/elf, const SHT_GNU_HASH SectionType +pkg debug/elf, const SHT_GNU_LIBLIST SectionType +pkg debug/elf, const SHT_GNU_VERDEF SectionType +pkg debug/elf, const SHT_GNU_VERNEED SectionType +pkg debug/elf, const SHT_GNU_VERSYM SectionType +pkg debug/elf, const SHT_GROUP SectionType +pkg debug/elf, const SHT_HASH SectionType +pkg debug/elf, const SHT_HIOS SectionType +pkg debug/elf, const SHT_HIPROC SectionType +pkg debug/elf, const SHT_HIUSER SectionType +pkg debug/elf, const SHT_INIT_ARRAY SectionType +pkg debug/elf, const SHT_LOOS SectionType +pkg debug/elf, const SHT_LOPROC SectionType +pkg debug/elf, const SHT_LOUSER SectionType +pkg debug/elf, const SHT_NOBITS SectionType +pkg debug/elf, const SHT_NOTE SectionType +pkg debug/elf, const SHT_NULL SectionType +pkg debug/elf, const SHT_PREINIT_ARRAY SectionType +pkg debug/elf, const SHT_PROGBITS SectionType +pkg debug/elf, const SHT_REL SectionType +pkg debug/elf, const SHT_RELA SectionType +pkg debug/elf, const SHT_SHLIB SectionType +pkg debug/elf, const SHT_STRTAB SectionType +pkg debug/elf, const SHT_SYMTAB SectionType +pkg debug/elf, const SHT_SYMTAB_SHNDX SectionType +pkg debug/elf, const STB_GLOBAL SymBind +pkg debug/elf, const STB_HIOS SymBind +pkg debug/elf, const STB_HIPROC SymBind +pkg debug/elf, const STB_LOCAL SymBind +pkg debug/elf, const STB_LOOS SymBind +pkg debug/elf, const STB_LOPROC SymBind +pkg debug/elf, const STB_WEAK SymBind +pkg debug/elf, const STT_COMMON SymType +pkg debug/elf, const STT_FILE SymType +pkg debug/elf, const STT_FUNC SymType +pkg debug/elf, const STT_HIOS SymType +pkg debug/elf, const STT_HIPROC SymType +pkg debug/elf, const STT_LOOS SymType +pkg debug/elf, const STT_LOPROC SymType +pkg debug/elf, const STT_NOTYPE SymType +pkg debug/elf, const STT_OBJECT SymType +pkg debug/elf, const STT_SECTION SymType +pkg debug/elf, const STT_TLS SymType +pkg debug/elf, const STV_DEFAULT SymVis +pkg debug/elf, const STV_HIDDEN SymVis +pkg debug/elf, const STV_INTERNAL SymVis +pkg debug/elf, const STV_PROTECTED SymVis +pkg debug/elf, const Sym32Size ideal-int +pkg debug/elf, const Sym64Size ideal-int +pkg debug/elf, func NewFile(io.ReaderAt) (*File, error) +pkg debug/elf, func Open(string) (*File, error) +pkg debug/elf, func R_INFO(uint32, uint32) uint64 +pkg debug/elf, func R_INFO32(uint32, uint32) uint32 +pkg debug/elf, func R_SYM32(uint32) uint32 +pkg debug/elf, func R_SYM64(uint64) uint32 +pkg debug/elf, func R_TYPE32(uint32) uint32 +pkg debug/elf, func R_TYPE64(uint64) uint32 +pkg debug/elf, func ST_BIND(uint8) SymBind +pkg debug/elf, func ST_INFO(SymBind, SymType) uint8 +pkg debug/elf, func ST_TYPE(uint8) SymType +pkg debug/elf, func ST_VISIBILITY(uint8) SymVis +pkg debug/elf, method (*File) Close() error +pkg debug/elf, method (*File) DWARF() (*dwarf.Data, error) +pkg debug/elf, method (*File) ImportedLibraries() ([]string, error) +pkg debug/elf, method (*File) ImportedSymbols() ([]ImportedSymbol, error) +pkg debug/elf, method (*File) Section(string) *Section +pkg debug/elf, method (*File) SectionByType(SectionType) *Section +pkg debug/elf, method (*File) Symbols() ([]Symbol, error) +pkg debug/elf, method (*FormatError) Error() string +pkg debug/elf, method (*Prog) Open() io.ReadSeeker +pkg debug/elf, method (*Section) Data() ([]uint8, error) +pkg debug/elf, method (*Section) Open() io.ReadSeeker +pkg debug/elf, method (Class) GoString() string +pkg debug/elf, method (Class) String() string +pkg debug/elf, method (Data) GoString() string +pkg debug/elf, method (Data) String() string +pkg debug/elf, method (DynFlag) GoString() string +pkg debug/elf, method (DynFlag) String() string +pkg debug/elf, method (DynTag) GoString() string +pkg debug/elf, method (DynTag) String() string +pkg debug/elf, method (Machine) GoString() string +pkg debug/elf, method (Machine) String() string +pkg debug/elf, method (NType) GoString() string +pkg debug/elf, method (NType) String() string +pkg debug/elf, method (OSABI) GoString() string +pkg debug/elf, method (OSABI) String() string +pkg debug/elf, method (Prog) ReadAt([]uint8, int64) (int, error) +pkg debug/elf, method (ProgFlag) GoString() string +pkg debug/elf, method (ProgFlag) String() string +pkg debug/elf, method (ProgType) GoString() string +pkg debug/elf, method (ProgType) String() string +pkg debug/elf, method (R_386) GoString() string +pkg debug/elf, method (R_386) String() string +pkg debug/elf, method (R_ALPHA) GoString() string +pkg debug/elf, method (R_ALPHA) String() string +pkg debug/elf, method (R_ARM) GoString() string +pkg debug/elf, method (R_ARM) String() string +pkg debug/elf, method (R_PPC) GoString() string +pkg debug/elf, method (R_PPC) String() string +pkg debug/elf, method (R_SPARC) GoString() string +pkg debug/elf, method (R_SPARC) String() string +pkg debug/elf, method (R_X86_64) GoString() string +pkg debug/elf, method (R_X86_64) String() string +pkg debug/elf, method (Section) ReadAt([]uint8, int64) (int, error) +pkg debug/elf, method (SectionFlag) GoString() string +pkg debug/elf, method (SectionFlag) String() string +pkg debug/elf, method (SectionIndex) GoString() string +pkg debug/elf, method (SectionIndex) String() string +pkg debug/elf, method (SectionType) GoString() string +pkg debug/elf, method (SectionType) String() string +pkg debug/elf, method (SymBind) GoString() string +pkg debug/elf, method (SymBind) String() string +pkg debug/elf, method (SymType) GoString() string +pkg debug/elf, method (SymType) String() string +pkg debug/elf, method (SymVis) GoString() string +pkg debug/elf, method (SymVis) String() string +pkg debug/elf, method (Type) GoString() string +pkg debug/elf, method (Type) String() string +pkg debug/elf, method (Version) GoString() string +pkg debug/elf, method (Version) String() string +pkg debug/elf, type Class uint8 +pkg debug/elf, type Data uint8 +pkg debug/elf, type Dyn32 struct +pkg debug/elf, type Dyn32 struct, Tag int32 +pkg debug/elf, type Dyn32 struct, Val uint32 +pkg debug/elf, type Dyn64 struct +pkg debug/elf, type Dyn64 struct, Tag int64 +pkg debug/elf, type Dyn64 struct, Val uint64 +pkg debug/elf, type DynFlag int +pkg debug/elf, type DynTag int +pkg debug/elf, type File struct +pkg debug/elf, type File struct, Progs []*Prog +pkg debug/elf, type File struct, Sections []*Section +pkg debug/elf, type File struct, embedded FileHeader +pkg debug/elf, type FileHeader struct +pkg debug/elf, type FileHeader struct, ABIVersion uint8 +pkg debug/elf, type FileHeader struct, ByteOrder binary.ByteOrder +pkg debug/elf, type FileHeader struct, Class Class +pkg debug/elf, type FileHeader struct, Data Data +pkg debug/elf, type FileHeader struct, Machine Machine +pkg debug/elf, type FileHeader struct, OSABI OSABI +pkg debug/elf, type FileHeader struct, Type Type +pkg debug/elf, type FileHeader struct, Version Version +pkg debug/elf, type FormatError struct +pkg debug/elf, type Header32 struct +pkg debug/elf, type Header32 struct, Ehsize uint16 +pkg debug/elf, type Header32 struct, Entry uint32 +pkg debug/elf, type Header32 struct, Flags uint32 +pkg debug/elf, type Header32 struct, Ident [16]uint8 +pkg debug/elf, type Header32 struct, Machine uint16 +pkg debug/elf, type Header32 struct, Phentsize uint16 +pkg debug/elf, type Header32 struct, Phnum uint16 +pkg debug/elf, type Header32 struct, Phoff uint32 +pkg debug/elf, type Header32 struct, Shentsize uint16 +pkg debug/elf, type Header32 struct, Shnum uint16 +pkg debug/elf, type Header32 struct, Shoff uint32 +pkg debug/elf, type Header32 struct, Shstrndx uint16 +pkg debug/elf, type Header32 struct, Type uint16 +pkg debug/elf, type Header32 struct, Version uint32 +pkg debug/elf, type Header64 struct +pkg debug/elf, type Header64 struct, Ehsize uint16 +pkg debug/elf, type Header64 struct, Entry uint64 +pkg debug/elf, type Header64 struct, Flags uint32 +pkg debug/elf, type Header64 struct, Ident [16]uint8 +pkg debug/elf, type Header64 struct, Machine uint16 +pkg debug/elf, type Header64 struct, Phentsize uint16 +pkg debug/elf, type Header64 struct, Phnum uint16 +pkg debug/elf, type Header64 struct, Phoff uint64 +pkg debug/elf, type Header64 struct, Shentsize uint16 +pkg debug/elf, type Header64 struct, Shnum uint16 +pkg debug/elf, type Header64 struct, Shoff uint64 +pkg debug/elf, type Header64 struct, Shstrndx uint16 +pkg debug/elf, type Header64 struct, Type uint16 +pkg debug/elf, type Header64 struct, Version uint32 +pkg debug/elf, type ImportedSymbol struct +pkg debug/elf, type ImportedSymbol struct, Library string +pkg debug/elf, type ImportedSymbol struct, Name string +pkg debug/elf, type ImportedSymbol struct, Version string +pkg debug/elf, type Machine uint16 +pkg debug/elf, type NType int +pkg debug/elf, type OSABI uint8 +pkg debug/elf, type Prog struct +pkg debug/elf, type Prog struct, embedded ProgHeader +pkg debug/elf, type Prog struct, embedded io.ReaderAt +pkg debug/elf, type Prog32 struct +pkg debug/elf, type Prog32 struct, Align uint32 +pkg debug/elf, type Prog32 struct, Filesz uint32 +pkg debug/elf, type Prog32 struct, Flags uint32 +pkg debug/elf, type Prog32 struct, Memsz uint32 +pkg debug/elf, type Prog32 struct, Off uint32 +pkg debug/elf, type Prog32 struct, Paddr uint32 +pkg debug/elf, type Prog32 struct, Type uint32 +pkg debug/elf, type Prog32 struct, Vaddr uint32 +pkg debug/elf, type Prog64 struct +pkg debug/elf, type Prog64 struct, Align uint64 +pkg debug/elf, type Prog64 struct, Filesz uint64 +pkg debug/elf, type Prog64 struct, Flags uint32 +pkg debug/elf, type Prog64 struct, Memsz uint64 +pkg debug/elf, type Prog64 struct, Off uint64 +pkg debug/elf, type Prog64 struct, Paddr uint64 +pkg debug/elf, type Prog64 struct, Type uint32 +pkg debug/elf, type Prog64 struct, Vaddr uint64 +pkg debug/elf, type ProgFlag uint32 +pkg debug/elf, type ProgHeader struct +pkg debug/elf, type ProgHeader struct, Align uint64 +pkg debug/elf, type ProgHeader struct, Filesz uint64 +pkg debug/elf, type ProgHeader struct, Flags ProgFlag +pkg debug/elf, type ProgHeader struct, Memsz uint64 +pkg debug/elf, type ProgHeader struct, Off uint64 +pkg debug/elf, type ProgHeader struct, Paddr uint64 +pkg debug/elf, type ProgHeader struct, Type ProgType +pkg debug/elf, type ProgHeader struct, Vaddr uint64 +pkg debug/elf, type ProgType int +pkg debug/elf, type R_386 int +pkg debug/elf, type R_ALPHA int +pkg debug/elf, type R_ARM int +pkg debug/elf, type R_PPC int +pkg debug/elf, type R_SPARC int +pkg debug/elf, type R_X86_64 int +pkg debug/elf, type Rel32 struct +pkg debug/elf, type Rel32 struct, Info uint32 +pkg debug/elf, type Rel32 struct, Off uint32 +pkg debug/elf, type Rel64 struct +pkg debug/elf, type Rel64 struct, Info uint64 +pkg debug/elf, type Rel64 struct, Off uint64 +pkg debug/elf, type Rela32 struct +pkg debug/elf, type Rela32 struct, Addend int32 +pkg debug/elf, type Rela32 struct, Info uint32 +pkg debug/elf, type Rela32 struct, Off uint32 +pkg debug/elf, type Rela64 struct +pkg debug/elf, type Rela64 struct, Addend int64 +pkg debug/elf, type Rela64 struct, Info uint64 +pkg debug/elf, type Rela64 struct, Off uint64 +pkg debug/elf, type Section struct +pkg debug/elf, type Section struct, embedded SectionHeader +pkg debug/elf, type Section struct, embedded io.ReaderAt +pkg debug/elf, type Section32 struct +pkg debug/elf, type Section32 struct, Addr uint32 +pkg debug/elf, type Section32 struct, Addralign uint32 +pkg debug/elf, type Section32 struct, Entsize uint32 +pkg debug/elf, type Section32 struct, Flags uint32 +pkg debug/elf, type Section32 struct, Info uint32 +pkg debug/elf, type Section32 struct, Link uint32 +pkg debug/elf, type Section32 struct, Name uint32 +pkg debug/elf, type Section32 struct, Off uint32 +pkg debug/elf, type Section32 struct, Size uint32 +pkg debug/elf, type Section32 struct, Type uint32 +pkg debug/elf, type Section64 struct +pkg debug/elf, type Section64 struct, Addr uint64 +pkg debug/elf, type Section64 struct, Addralign uint64 +pkg debug/elf, type Section64 struct, Entsize uint64 +pkg debug/elf, type Section64 struct, Flags uint64 +pkg debug/elf, type Section64 struct, Info uint32 +pkg debug/elf, type Section64 struct, Link uint32 +pkg debug/elf, type Section64 struct, Name uint32 +pkg debug/elf, type Section64 struct, Off uint64 +pkg debug/elf, type Section64 struct, Size uint64 +pkg debug/elf, type Section64 struct, Type uint32 +pkg debug/elf, type SectionFlag uint32 +pkg debug/elf, type SectionHeader struct +pkg debug/elf, type SectionHeader struct, Addr uint64 +pkg debug/elf, type SectionHeader struct, Addralign uint64 +pkg debug/elf, type SectionHeader struct, Entsize uint64 +pkg debug/elf, type SectionHeader struct, Flags SectionFlag +pkg debug/elf, type SectionHeader struct, Info uint32 +pkg debug/elf, type SectionHeader struct, Link uint32 +pkg debug/elf, type SectionHeader struct, Name string +pkg debug/elf, type SectionHeader struct, Offset uint64 +pkg debug/elf, type SectionHeader struct, Size uint64 +pkg debug/elf, type SectionHeader struct, Type SectionType +pkg debug/elf, type SectionIndex int +pkg debug/elf, type SectionType uint32 +pkg debug/elf, type Sym32 struct +pkg debug/elf, type Sym32 struct, Info uint8 +pkg debug/elf, type Sym32 struct, Name uint32 +pkg debug/elf, type Sym32 struct, Other uint8 +pkg debug/elf, type Sym32 struct, Shndx uint16 +pkg debug/elf, type Sym32 struct, Size uint32 +pkg debug/elf, type Sym32 struct, Value uint32 +pkg debug/elf, type Sym64 struct +pkg debug/elf, type Sym64 struct, Info uint8 +pkg debug/elf, type Sym64 struct, Name uint32 +pkg debug/elf, type Sym64 struct, Other uint8 +pkg debug/elf, type Sym64 struct, Shndx uint16 +pkg debug/elf, type Sym64 struct, Size uint64 +pkg debug/elf, type Sym64 struct, Value uint64 +pkg debug/elf, type SymBind int +pkg debug/elf, type SymType int +pkg debug/elf, type SymVis int +pkg debug/elf, type Symbol struct +pkg debug/elf, type Symbol struct, Info uint8 +pkg debug/elf, type Symbol struct, Name string +pkg debug/elf, type Symbol struct, Other uint8 +pkg debug/elf, type Symbol struct, Section SectionIndex +pkg debug/elf, type Symbol struct, Size uint64 +pkg debug/elf, type Symbol struct, Value uint64 +pkg debug/elf, type Type uint16 +pkg debug/elf, type Version uint8 +pkg debug/gosym, func NewLineTable([]uint8, uint64) *LineTable +pkg debug/gosym, func NewTable([]uint8, *LineTable) (*Table, error) +pkg debug/gosym, method (*DecodingError) Error() string +pkg debug/gosym, method (*LineTable) LineToPC(int, uint64) uint64 +pkg debug/gosym, method (*LineTable) PCToLine(uint64) int +pkg debug/gosym, method (*Sym) BaseName() string +pkg debug/gosym, method (*Sym) PackageName() string +pkg debug/gosym, method (*Sym) ReceiverName() string +pkg debug/gosym, method (*Sym) Static() bool +pkg debug/gosym, method (*Table) LineToPC(string, int) (uint64, *Func, error) +pkg debug/gosym, method (*Table) LookupFunc(string) *Func +pkg debug/gosym, method (*Table) LookupSym(string) *Sym +pkg debug/gosym, method (*Table) PCToFunc(uint64) *Func +pkg debug/gosym, method (*Table) PCToLine(uint64) (string, int, *Func) +pkg debug/gosym, method (*Table) SymByAddr(uint64) *Sym +pkg debug/gosym, method (*UnknownLineError) Error() string +pkg debug/gosym, method (Func) BaseName() string +pkg debug/gosym, method (Func) PackageName() string +pkg debug/gosym, method (Func) ReceiverName() string +pkg debug/gosym, method (Func) Static() bool +pkg debug/gosym, method (UnknownFileError) Error() string +pkg debug/gosym, type DecodingError struct +pkg debug/gosym, type Func struct +pkg debug/gosym, type Func struct, End uint64 +pkg debug/gosym, type Func struct, Entry uint64 +pkg debug/gosym, type Func struct, FrameSize int +pkg debug/gosym, type Func struct, LineTable *LineTable +pkg debug/gosym, type Func struct, Locals []*Sym +pkg debug/gosym, type Func struct, Obj *Obj +pkg debug/gosym, type Func struct, Params []*Sym +pkg debug/gosym, type Func struct, embedded *Sym +pkg debug/gosym, type LineTable struct +pkg debug/gosym, type LineTable struct, Data []uint8 +pkg debug/gosym, type LineTable struct, Line int +pkg debug/gosym, type LineTable struct, PC uint64 +pkg debug/gosym, type Obj struct +pkg debug/gosym, type Obj struct, Funcs []Func +pkg debug/gosym, type Obj struct, Paths []Sym +pkg debug/gosym, type Sym struct +pkg debug/gosym, type Sym struct, Func *Func +pkg debug/gosym, type Sym struct, GoType uint64 +pkg debug/gosym, type Sym struct, Name string +pkg debug/gosym, type Sym struct, Type uint8 +pkg debug/gosym, type Sym struct, Value uint64 +pkg debug/gosym, type Table struct +pkg debug/gosym, type Table struct, Files map[string]*Obj +pkg debug/gosym, type Table struct, Funcs []Func +pkg debug/gosym, type Table struct, Objs []Obj +pkg debug/gosym, type Table struct, Syms []Sym +pkg debug/gosym, type UnknownFileError string +pkg debug/gosym, type UnknownLineError struct +pkg debug/gosym, type UnknownLineError struct, File string +pkg debug/gosym, type UnknownLineError struct, Line int +pkg debug/macho, const Cpu386 Cpu +pkg debug/macho, const CpuAmd64 Cpu +pkg debug/macho, const LoadCmdDylib LoadCmd +pkg debug/macho, const LoadCmdDylinker LoadCmd +pkg debug/macho, const LoadCmdDysymtab LoadCmd +pkg debug/macho, const LoadCmdSegment LoadCmd +pkg debug/macho, const LoadCmdSegment64 LoadCmd +pkg debug/macho, const LoadCmdSymtab LoadCmd +pkg debug/macho, const LoadCmdThread LoadCmd +pkg debug/macho, const LoadCmdUnixThread LoadCmd +pkg debug/macho, const Magic32 uint32 +pkg debug/macho, const Magic64 uint32 +pkg debug/macho, const TypeExec Type +pkg debug/macho, const TypeObj Type +pkg debug/macho, func NewFile(io.ReaderAt) (*File, error) +pkg debug/macho, func Open(string) (*File, error) +pkg debug/macho, method (*File) Close() error +pkg debug/macho, method (*File) DWARF() (*dwarf.Data, error) +pkg debug/macho, method (*File) ImportedLibraries() ([]string, error) +pkg debug/macho, method (*File) ImportedSymbols() ([]string, error) +pkg debug/macho, method (*File) Section(string) *Section +pkg debug/macho, method (*File) Segment(string) *Segment +pkg debug/macho, method (*FormatError) Error() string +pkg debug/macho, method (*Section) Data() ([]uint8, error) +pkg debug/macho, method (*Section) Open() io.ReadSeeker +pkg debug/macho, method (*Segment) Data() ([]uint8, error) +pkg debug/macho, method (*Segment) Open() io.ReadSeeker +pkg debug/macho, method (Cpu) GoString() string +pkg debug/macho, method (Cpu) String() string +pkg debug/macho, method (Dylib) Raw() []uint8 +pkg debug/macho, method (Dysymtab) Raw() []uint8 +pkg debug/macho, method (LoadBytes) Raw() []uint8 +pkg debug/macho, method (LoadCmd) GoString() string +pkg debug/macho, method (LoadCmd) String() string +pkg debug/macho, method (Section) ReadAt([]uint8, int64) (int, error) +pkg debug/macho, method (Segment) Raw() []uint8 +pkg debug/macho, method (Segment) ReadAt([]uint8, int64) (int, error) +pkg debug/macho, method (Symtab) Raw() []uint8 +pkg debug/macho, type Cpu uint32 +pkg debug/macho, type Dylib struct +pkg debug/macho, type Dylib struct, CompatVersion uint32 +pkg debug/macho, type Dylib struct, CurrentVersion uint32 +pkg debug/macho, type Dylib struct, Name string +pkg debug/macho, type Dylib struct, Time uint32 +pkg debug/macho, type Dylib struct, embedded LoadBytes +pkg debug/macho, type DylibCmd struct +pkg debug/macho, type DylibCmd struct, Cmd LoadCmd +pkg debug/macho, type DylibCmd struct, CompatVersion uint32 +pkg debug/macho, type DylibCmd struct, CurrentVersion uint32 +pkg debug/macho, type DylibCmd struct, Len uint32 +pkg debug/macho, type DylibCmd struct, Name uint32 +pkg debug/macho, type DylibCmd struct, Time uint32 +pkg debug/macho, type Dysymtab struct +pkg debug/macho, type Dysymtab struct, IndirectSyms []uint32 +pkg debug/macho, type Dysymtab struct, embedded DysymtabCmd +pkg debug/macho, type Dysymtab struct, embedded LoadBytes +pkg debug/macho, type DysymtabCmd struct +pkg debug/macho, type DysymtabCmd struct, Cmd LoadCmd +pkg debug/macho, type DysymtabCmd struct, Extrefsymoff uint32 +pkg debug/macho, type DysymtabCmd struct, Extreloff uint32 +pkg debug/macho, type DysymtabCmd struct, Iextdefsym uint32 +pkg debug/macho, type DysymtabCmd struct, Ilocalsym uint32 +pkg debug/macho, type DysymtabCmd struct, Indirectsymoff uint32 +pkg debug/macho, type DysymtabCmd struct, Iundefsym uint32 +pkg debug/macho, type DysymtabCmd struct, Len uint32 +pkg debug/macho, type DysymtabCmd struct, Locreloff uint32 +pkg debug/macho, type DysymtabCmd struct, Modtaboff uint32 +pkg debug/macho, type DysymtabCmd struct, Nextdefsym uint32 +pkg debug/macho, type DysymtabCmd struct, Nextrefsyms uint32 +pkg debug/macho, type DysymtabCmd struct, Nextrel uint32 +pkg debug/macho, type DysymtabCmd struct, Nindirectsyms uint32 +pkg debug/macho, type DysymtabCmd struct, Nlocalsym uint32 +pkg debug/macho, type DysymtabCmd struct, Nlocrel uint32 +pkg debug/macho, type DysymtabCmd struct, Nmodtab uint32 +pkg debug/macho, type DysymtabCmd struct, Ntoc uint32 +pkg debug/macho, type DysymtabCmd struct, Nundefsym uint32 +pkg debug/macho, type DysymtabCmd struct, Tocoffset uint32 +pkg debug/macho, type File struct +pkg debug/macho, type File struct, ByteOrder binary.ByteOrder +pkg debug/macho, type File struct, Dysymtab *Dysymtab +pkg debug/macho, type File struct, Loads []Load +pkg debug/macho, type File struct, Sections []*Section +pkg debug/macho, type File struct, Symtab *Symtab +pkg debug/macho, type File struct, embedded FileHeader +pkg debug/macho, type FileHeader struct +pkg debug/macho, type FileHeader struct, Cmdsz uint32 +pkg debug/macho, type FileHeader struct, Cpu Cpu +pkg debug/macho, type FileHeader struct, Flags uint32 +pkg debug/macho, type FileHeader struct, Magic uint32 +pkg debug/macho, type FileHeader struct, Ncmd uint32 +pkg debug/macho, type FileHeader struct, SubCpu uint32 +pkg debug/macho, type FileHeader struct, Type Type +pkg debug/macho, type FormatError struct +pkg debug/macho, type Load interface { Raw } +pkg debug/macho, type Load interface, Raw() []uint8 +pkg debug/macho, type LoadBytes []uint8 +pkg debug/macho, type LoadCmd uint32 +pkg debug/macho, type Nlist32 struct +pkg debug/macho, type Nlist32 struct, Desc uint16 +pkg debug/macho, type Nlist32 struct, Name uint32 +pkg debug/macho, type Nlist32 struct, Sect uint8 +pkg debug/macho, type Nlist32 struct, Type uint8 +pkg debug/macho, type Nlist32 struct, Value uint32 +pkg debug/macho, type Nlist64 struct +pkg debug/macho, type Nlist64 struct, Desc uint16 +pkg debug/macho, type Nlist64 struct, Name uint32 +pkg debug/macho, type Nlist64 struct, Sect uint8 +pkg debug/macho, type Nlist64 struct, Type uint8 +pkg debug/macho, type Nlist64 struct, Value uint64 +pkg debug/macho, type Regs386 struct +pkg debug/macho, type Regs386 struct, AX uint32 +pkg debug/macho, type Regs386 struct, BP uint32 +pkg debug/macho, type Regs386 struct, BX uint32 +pkg debug/macho, type Regs386 struct, CS uint32 +pkg debug/macho, type Regs386 struct, CX uint32 +pkg debug/macho, type Regs386 struct, DI uint32 +pkg debug/macho, type Regs386 struct, DS uint32 +pkg debug/macho, type Regs386 struct, DX uint32 +pkg debug/macho, type Regs386 struct, ES uint32 +pkg debug/macho, type Regs386 struct, FLAGS uint32 +pkg debug/macho, type Regs386 struct, FS uint32 +pkg debug/macho, type Regs386 struct, GS uint32 +pkg debug/macho, type Regs386 struct, IP uint32 +pkg debug/macho, type Regs386 struct, SI uint32 +pkg debug/macho, type Regs386 struct, SP uint32 +pkg debug/macho, type Regs386 struct, SS uint32 +pkg debug/macho, type RegsAMD64 struct +pkg debug/macho, type RegsAMD64 struct, AX uint64 +pkg debug/macho, type RegsAMD64 struct, BP uint64 +pkg debug/macho, type RegsAMD64 struct, BX uint64 +pkg debug/macho, type RegsAMD64 struct, CS uint64 +pkg debug/macho, type RegsAMD64 struct, CX uint64 +pkg debug/macho, type RegsAMD64 struct, DI uint64 +pkg debug/macho, type RegsAMD64 struct, DX uint64 +pkg debug/macho, type RegsAMD64 struct, FLAGS uint64 +pkg debug/macho, type RegsAMD64 struct, FS uint64 +pkg debug/macho, type RegsAMD64 struct, GS uint64 +pkg debug/macho, type RegsAMD64 struct, IP uint64 +pkg debug/macho, type RegsAMD64 struct, R10 uint64 +pkg debug/macho, type RegsAMD64 struct, R11 uint64 +pkg debug/macho, type RegsAMD64 struct, R12 uint64 +pkg debug/macho, type RegsAMD64 struct, R13 uint64 +pkg debug/macho, type RegsAMD64 struct, R14 uint64 +pkg debug/macho, type RegsAMD64 struct, R15 uint64 +pkg debug/macho, type RegsAMD64 struct, R8 uint64 +pkg debug/macho, type RegsAMD64 struct, R9 uint64 +pkg debug/macho, type RegsAMD64 struct, SI uint64 +pkg debug/macho, type RegsAMD64 struct, SP uint64 +pkg debug/macho, type Section struct +pkg debug/macho, type Section struct, embedded SectionHeader +pkg debug/macho, type Section struct, embedded io.ReaderAt +pkg debug/macho, type Section32 struct +pkg debug/macho, type Section32 struct, Addr uint32 +pkg debug/macho, type Section32 struct, Align uint32 +pkg debug/macho, type Section32 struct, Flags uint32 +pkg debug/macho, type Section32 struct, Name [16]uint8 +pkg debug/macho, type Section32 struct, Nreloc uint32 +pkg debug/macho, type Section32 struct, Offset uint32 +pkg debug/macho, type Section32 struct, Reloff uint32 +pkg debug/macho, type Section32 struct, Reserve1 uint32 +pkg debug/macho, type Section32 struct, Reserve2 uint32 +pkg debug/macho, type Section32 struct, Seg [16]uint8 +pkg debug/macho, type Section32 struct, Size uint32 +pkg debug/macho, type Section64 struct +pkg debug/macho, type Section64 struct, Addr uint64 +pkg debug/macho, type Section64 struct, Align uint32 +pkg debug/macho, type Section64 struct, Flags uint32 +pkg debug/macho, type Section64 struct, Name [16]uint8 +pkg debug/macho, type Section64 struct, Nreloc uint32 +pkg debug/macho, type Section64 struct, Offset uint32 +pkg debug/macho, type Section64 struct, Reloff uint32 +pkg debug/macho, type Section64 struct, Reserve1 uint32 +pkg debug/macho, type Section64 struct, Reserve2 uint32 +pkg debug/macho, type Section64 struct, Reserve3 uint32 +pkg debug/macho, type Section64 struct, Seg [16]uint8 +pkg debug/macho, type Section64 struct, Size uint64 +pkg debug/macho, type SectionHeader struct +pkg debug/macho, type SectionHeader struct, Addr uint64 +pkg debug/macho, type SectionHeader struct, Align uint32 +pkg debug/macho, type SectionHeader struct, Flags uint32 +pkg debug/macho, type SectionHeader struct, Name string +pkg debug/macho, type SectionHeader struct, Nreloc uint32 +pkg debug/macho, type SectionHeader struct, Offset uint32 +pkg debug/macho, type SectionHeader struct, Reloff uint32 +pkg debug/macho, type SectionHeader struct, Seg string +pkg debug/macho, type SectionHeader struct, Size uint64 +pkg debug/macho, type Segment struct +pkg debug/macho, type Segment struct, embedded LoadBytes +pkg debug/macho, type Segment struct, embedded SegmentHeader +pkg debug/macho, type Segment struct, embedded io.ReaderAt +pkg debug/macho, type Segment32 struct +pkg debug/macho, type Segment32 struct, Addr uint32 +pkg debug/macho, type Segment32 struct, Cmd LoadCmd +pkg debug/macho, type Segment32 struct, Filesz uint32 +pkg debug/macho, type Segment32 struct, Flag uint32 +pkg debug/macho, type Segment32 struct, Len uint32 +pkg debug/macho, type Segment32 struct, Maxprot uint32 +pkg debug/macho, type Segment32 struct, Memsz uint32 +pkg debug/macho, type Segment32 struct, Name [16]uint8 +pkg debug/macho, type Segment32 struct, Nsect uint32 +pkg debug/macho, type Segment32 struct, Offset uint32 +pkg debug/macho, type Segment32 struct, Prot uint32 +pkg debug/macho, type Segment64 struct +pkg debug/macho, type Segment64 struct, Addr uint64 +pkg debug/macho, type Segment64 struct, Cmd LoadCmd +pkg debug/macho, type Segment64 struct, Filesz uint64 +pkg debug/macho, type Segment64 struct, Flag uint32 +pkg debug/macho, type Segment64 struct, Len uint32 +pkg debug/macho, type Segment64 struct, Maxprot uint32 +pkg debug/macho, type Segment64 struct, Memsz uint64 +pkg debug/macho, type Segment64 struct, Name [16]uint8 +pkg debug/macho, type Segment64 struct, Nsect uint32 +pkg debug/macho, type Segment64 struct, Offset uint64 +pkg debug/macho, type Segment64 struct, Prot uint32 +pkg debug/macho, type SegmentHeader struct +pkg debug/macho, type SegmentHeader struct, Addr uint64 +pkg debug/macho, type SegmentHeader struct, Cmd LoadCmd +pkg debug/macho, type SegmentHeader struct, Filesz uint64 +pkg debug/macho, type SegmentHeader struct, Flag uint32 +pkg debug/macho, type SegmentHeader struct, Len uint32 +pkg debug/macho, type SegmentHeader struct, Maxprot uint32 +pkg debug/macho, type SegmentHeader struct, Memsz uint64 +pkg debug/macho, type SegmentHeader struct, Name string +pkg debug/macho, type SegmentHeader struct, Nsect uint32 +pkg debug/macho, type SegmentHeader struct, Offset uint64 +pkg debug/macho, type SegmentHeader struct, Prot uint32 +pkg debug/macho, type Symbol struct +pkg debug/macho, type Symbol struct, Desc uint16 +pkg debug/macho, type Symbol struct, Name string +pkg debug/macho, type Symbol struct, Sect uint8 +pkg debug/macho, type Symbol struct, Type uint8 +pkg debug/macho, type Symbol struct, Value uint64 +pkg debug/macho, type Symtab struct +pkg debug/macho, type Symtab struct, Syms []Symbol +pkg debug/macho, type Symtab struct, embedded LoadBytes +pkg debug/macho, type Symtab struct, embedded SymtabCmd +pkg debug/macho, type SymtabCmd struct +pkg debug/macho, type SymtabCmd struct, Cmd LoadCmd +pkg debug/macho, type SymtabCmd struct, Len uint32 +pkg debug/macho, type SymtabCmd struct, Nsyms uint32 +pkg debug/macho, type SymtabCmd struct, Stroff uint32 +pkg debug/macho, type SymtabCmd struct, Strsize uint32 +pkg debug/macho, type SymtabCmd struct, Symoff uint32 +pkg debug/macho, type Thread struct +pkg debug/macho, type Thread struct, Cmd LoadCmd +pkg debug/macho, type Thread struct, Data []uint32 +pkg debug/macho, type Thread struct, Len uint32 +pkg debug/macho, type Thread struct, Type uint32 +pkg debug/macho, type Type uint32 +pkg debug/pe, const IMAGE_FILE_MACHINE_AM33 ideal-int +pkg debug/pe, const IMAGE_FILE_MACHINE_AMD64 ideal-int +pkg debug/pe, const IMAGE_FILE_MACHINE_ARM ideal-int +pkg debug/pe, const IMAGE_FILE_MACHINE_EBC ideal-int +pkg debug/pe, const IMAGE_FILE_MACHINE_I386 ideal-int +pkg debug/pe, const IMAGE_FILE_MACHINE_IA64 ideal-int +pkg debug/pe, const IMAGE_FILE_MACHINE_M32R ideal-int +pkg debug/pe, const IMAGE_FILE_MACHINE_MIPS16 ideal-int +pkg debug/pe, const IMAGE_FILE_MACHINE_MIPSFPU ideal-int +pkg debug/pe, const IMAGE_FILE_MACHINE_MIPSFPU16 ideal-int +pkg debug/pe, const IMAGE_FILE_MACHINE_POWERPC ideal-int +pkg debug/pe, const IMAGE_FILE_MACHINE_POWERPCFP ideal-int +pkg debug/pe, const IMAGE_FILE_MACHINE_R4000 ideal-int +pkg debug/pe, const IMAGE_FILE_MACHINE_SH3 ideal-int +pkg debug/pe, const IMAGE_FILE_MACHINE_SH3DSP ideal-int +pkg debug/pe, const IMAGE_FILE_MACHINE_SH4 ideal-int +pkg debug/pe, const IMAGE_FILE_MACHINE_SH5 ideal-int +pkg debug/pe, const IMAGE_FILE_MACHINE_THUMB ideal-int +pkg debug/pe, const IMAGE_FILE_MACHINE_UNKNOWN ideal-int +pkg debug/pe, const IMAGE_FILE_MACHINE_WCEMIPSV2 ideal-int +pkg debug/pe, func NewFile(io.ReaderAt) (*File, error) +pkg debug/pe, func Open(string) (*File, error) +pkg debug/pe, method (*File) Close() error +pkg debug/pe, method (*File) DWARF() (*dwarf.Data, error) +pkg debug/pe, method (*File) ImportedLibraries() ([]string, error) +pkg debug/pe, method (*File) ImportedSymbols() ([]string, error) +pkg debug/pe, method (*File) Section(string) *Section +pkg debug/pe, method (*FormatError) Error() string +pkg debug/pe, method (*Section) Data() ([]uint8, error) +pkg debug/pe, method (*Section) Open() io.ReadSeeker +pkg debug/pe, method (Section) ReadAt([]uint8, int64) (int, error) +pkg debug/pe, type File struct +pkg debug/pe, type File struct, Sections []*Section +pkg debug/pe, type File struct, embedded FileHeader +pkg debug/pe, type FileHeader struct +pkg debug/pe, type FileHeader struct, Characteristics uint16 +pkg debug/pe, type FileHeader struct, Machine uint16 +pkg debug/pe, type FileHeader struct, NumberOfSections uint16 +pkg debug/pe, type FileHeader struct, NumberOfSymbols uint32 +pkg debug/pe, type FileHeader struct, PointerToSymbolTable uint32 +pkg debug/pe, type FileHeader struct, SizeOfOptionalHeader uint16 +pkg debug/pe, type FileHeader struct, TimeDateStamp uint32 +pkg debug/pe, type FormatError struct +pkg debug/pe, type ImportDirectory struct +pkg debug/pe, type ImportDirectory struct, FirstThunk uint32 +pkg debug/pe, type ImportDirectory struct, ForwarderChain uint32 +pkg debug/pe, type ImportDirectory struct, Name uint32 +pkg debug/pe, type ImportDirectory struct, OriginalFirstThunk uint32 +pkg debug/pe, type ImportDirectory struct, TimeDateStamp uint32 +pkg debug/pe, type Section struct +pkg debug/pe, type Section struct, embedded SectionHeader +pkg debug/pe, type Section struct, embedded io.ReaderAt +pkg debug/pe, type SectionHeader struct +pkg debug/pe, type SectionHeader struct, Characteristics uint32 +pkg debug/pe, type SectionHeader struct, Name string +pkg debug/pe, type SectionHeader struct, NumberOfLineNumbers uint16 +pkg debug/pe, type SectionHeader struct, NumberOfRelocations uint16 +pkg debug/pe, type SectionHeader struct, Offset uint32 +pkg debug/pe, type SectionHeader struct, PointerToLineNumbers uint32 +pkg debug/pe, type SectionHeader struct, PointerToRelocations uint32 +pkg debug/pe, type SectionHeader struct, Size uint32 +pkg debug/pe, type SectionHeader struct, VirtualAddress uint32 +pkg debug/pe, type SectionHeader struct, VirtualSize uint32 +pkg debug/pe, type SectionHeader32 struct +pkg debug/pe, type SectionHeader32 struct, Characteristics uint32 +pkg debug/pe, type SectionHeader32 struct, Name [8]uint8 +pkg debug/pe, type SectionHeader32 struct, NumberOfLineNumbers uint16 +pkg debug/pe, type SectionHeader32 struct, NumberOfRelocations uint16 +pkg debug/pe, type SectionHeader32 struct, PointerToLineNumbers uint32 +pkg debug/pe, type SectionHeader32 struct, PointerToRawData uint32 +pkg debug/pe, type SectionHeader32 struct, PointerToRelocations uint32 +pkg debug/pe, type SectionHeader32 struct, SizeOfRawData uint32 +pkg debug/pe, type SectionHeader32 struct, VirtualAddress uint32 +pkg debug/pe, type SectionHeader32 struct, VirtualSize uint32 +pkg encoding/ascii85, func Decode([]uint8, []uint8, bool) (int, int, error) +pkg encoding/ascii85, func Encode([]uint8, []uint8) int +pkg encoding/ascii85, func MaxEncodedLen(int) int +pkg encoding/ascii85, func NewDecoder(io.Reader) io.Reader +pkg encoding/ascii85, func NewEncoder(io.Writer) io.WriteCloser +pkg encoding/ascii85, method (CorruptInputError) Error() string +pkg encoding/ascii85, type CorruptInputError int64 +pkg encoding/asn1, func Marshal(interface{}) ([]uint8, error) +pkg encoding/asn1, func Unmarshal([]uint8, interface{}) ([]uint8, error) +pkg encoding/asn1, func UnmarshalWithParams([]uint8, interface{}, string) ([]uint8, error) +pkg encoding/asn1, method (BitString) At(int) int +pkg encoding/asn1, method (BitString) RightAlign() []uint8 +pkg encoding/asn1, method (ObjectIdentifier) Equal(ObjectIdentifier) bool +pkg encoding/asn1, method (StructuralError) Error() string +pkg encoding/asn1, method (SyntaxError) Error() string +pkg encoding/asn1, type BitString struct +pkg encoding/asn1, type BitString struct, BitLength int +pkg encoding/asn1, type BitString struct, Bytes []uint8 +pkg encoding/asn1, type Enumerated int +pkg encoding/asn1, type Flag bool +pkg encoding/asn1, type ObjectIdentifier []int +pkg encoding/asn1, type RawContent []uint8 +pkg encoding/asn1, type RawValue struct +pkg encoding/asn1, type RawValue struct, Bytes []uint8 +pkg encoding/asn1, type RawValue struct, Class int +pkg encoding/asn1, type RawValue struct, FullBytes []uint8 +pkg encoding/asn1, type RawValue struct, IsCompound bool +pkg encoding/asn1, type RawValue struct, Tag int +pkg encoding/asn1, type StructuralError struct +pkg encoding/asn1, type StructuralError struct, Msg string +pkg encoding/asn1, type SyntaxError struct +pkg encoding/asn1, type SyntaxError struct, Msg string +pkg encoding/base32, func NewDecoder(*Encoding, io.Reader) io.Reader +pkg encoding/base32, func NewEncoder(*Encoding, io.Writer) io.WriteCloser +pkg encoding/base32, func NewEncoding(string) *Encoding +pkg encoding/base32, method (*Encoding) Decode([]uint8, []uint8) (int, error) +pkg encoding/base32, method (*Encoding) DecodeString(string) ([]uint8, error) +pkg encoding/base32, method (*Encoding) DecodedLen(int) int +pkg encoding/base32, method (*Encoding) Encode([]uint8, []uint8) +pkg encoding/base32, method (*Encoding) EncodeToString([]uint8) string +pkg encoding/base32, method (*Encoding) EncodedLen(int) int +pkg encoding/base32, method (CorruptInputError) Error() string +pkg encoding/base32, type CorruptInputError int64 +pkg encoding/base32, type Encoding struct +pkg encoding/base32, var HexEncoding *Encoding +pkg encoding/base32, var StdEncoding *Encoding +pkg encoding/base64, func NewDecoder(*Encoding, io.Reader) io.Reader +pkg encoding/base64, func NewEncoder(*Encoding, io.Writer) io.WriteCloser +pkg encoding/base64, func NewEncoding(string) *Encoding +pkg encoding/base64, method (*Encoding) Decode([]uint8, []uint8) (int, error) +pkg encoding/base64, method (*Encoding) DecodeString(string) ([]uint8, error) +pkg encoding/base64, method (*Encoding) DecodedLen(int) int +pkg encoding/base64, method (*Encoding) Encode([]uint8, []uint8) +pkg encoding/base64, method (*Encoding) EncodeToString([]uint8) string +pkg encoding/base64, method (*Encoding) EncodedLen(int) int +pkg encoding/base64, method (CorruptInputError) Error() string +pkg encoding/base64, type CorruptInputError int64 +pkg encoding/base64, type Encoding struct +pkg encoding/base64, var StdEncoding *Encoding +pkg encoding/base64, var URLEncoding *Encoding +pkg encoding/binary, const MaxVarintLen16 ideal-int +pkg encoding/binary, const MaxVarintLen32 ideal-int +pkg encoding/binary, const MaxVarintLen64 ideal-int +pkg encoding/binary, func PutUvarint([]uint8, uint64) int +pkg encoding/binary, func PutVarint([]uint8, int64) int +pkg encoding/binary, func Read(io.Reader, ByteOrder, interface{}) error +pkg encoding/binary, func ReadUvarint(io.ByteReader) (uint64, error) +pkg encoding/binary, func ReadVarint(io.ByteReader) (int64, error) +pkg encoding/binary, func Size(interface{}) int +pkg encoding/binary, func Uvarint([]uint8) (uint64, int) +pkg encoding/binary, func Varint([]uint8) (int64, int) +pkg encoding/binary, func Write(io.Writer, ByteOrder, interface{}) error +pkg encoding/binary, type ByteOrder interface { PutUint16, PutUint32, PutUint64, String, Uint16, Uint32, Uint64 } +pkg encoding/binary, type ByteOrder interface, PutUint16([]uint8, uint16) +pkg encoding/binary, type ByteOrder interface, PutUint32([]uint8, uint32) +pkg encoding/binary, type ByteOrder interface, PutUint64([]uint8, uint64) +pkg encoding/binary, type ByteOrder interface, String() string +pkg encoding/binary, type ByteOrder interface, Uint16([]uint8) uint16 +pkg encoding/binary, type ByteOrder interface, Uint32([]uint8) uint32 +pkg encoding/binary, type ByteOrder interface, Uint64([]uint8) uint64 +pkg encoding/binary, var BigEndian bigEndian +pkg encoding/binary, var LittleEndian littleEndian +pkg encoding/csv, func NewReader(io.Reader) *Reader +pkg encoding/csv, func NewWriter(io.Writer) *Writer +pkg encoding/csv, method (*ParseError) Error() string +pkg encoding/csv, method (*Reader) Read() ([]string, error) +pkg encoding/csv, method (*Reader) ReadAll() ([][]string, error) +pkg encoding/csv, method (*Writer) Flush() +pkg encoding/csv, method (*Writer) Write([]string) error +pkg encoding/csv, method (*Writer) WriteAll([][]string) error +pkg encoding/csv, type ParseError struct +pkg encoding/csv, type ParseError struct, Column int +pkg encoding/csv, type ParseError struct, Err error +pkg encoding/csv, type ParseError struct, Line int +pkg encoding/csv, type Reader struct +pkg encoding/csv, type Reader struct, Comma int32 +pkg encoding/csv, type Reader struct, Comment int32 +pkg encoding/csv, type Reader struct, FieldsPerRecord int +pkg encoding/csv, type Reader struct, LazyQuotes bool +pkg encoding/csv, type Reader struct, TrailingComma bool +pkg encoding/csv, type Reader struct, TrimLeadingSpace bool +pkg encoding/csv, type Writer struct +pkg encoding/csv, type Writer struct, Comma int32 +pkg encoding/csv, type Writer struct, UseCRLF bool +pkg encoding/csv, var ErrBareQuote error +pkg encoding/csv, var ErrFieldCount error +pkg encoding/csv, var ErrQuote error +pkg encoding/csv, var ErrTrailingComma error +pkg encoding/gob, func NewDecoder(io.Reader) *Decoder +pkg encoding/gob, func NewEncoder(io.Writer) *Encoder +pkg encoding/gob, func Register(interface{}) +pkg encoding/gob, func RegisterName(string, interface{}) +pkg encoding/gob, method (*Decoder) Decode(interface{}) error +pkg encoding/gob, method (*Decoder) DecodeValue(reflect.Value) error +pkg encoding/gob, method (*Encoder) Encode(interface{}) error +pkg encoding/gob, method (*Encoder) EncodeValue(reflect.Value) error +pkg encoding/gob, type CommonType struct +pkg encoding/gob, type CommonType struct, Id typeId +pkg encoding/gob, type CommonType struct, Name string +pkg encoding/gob, type Decoder struct +pkg encoding/gob, type Encoder struct +pkg encoding/gob, type GobDecoder interface { GobDecode } +pkg encoding/gob, type GobDecoder interface, GobDecode([]uint8) error +pkg encoding/gob, type GobEncoder interface { GobEncode } +pkg encoding/gob, type GobEncoder interface, GobEncode() ([]uint8, error) +pkg encoding/hex, func Decode([]uint8, []uint8) (int, error) +pkg encoding/hex, func DecodeString(string) ([]uint8, error) +pkg encoding/hex, func DecodedLen(int) int +pkg encoding/hex, func Dump([]uint8) string +pkg encoding/hex, func Dumper(io.Writer) io.WriteCloser +pkg encoding/hex, func Encode([]uint8, []uint8) int +pkg encoding/hex, func EncodeToString([]uint8) string +pkg encoding/hex, func EncodedLen(int) int +pkg encoding/hex, method (InvalidByteError) Error() string +pkg encoding/hex, type InvalidByteError uint8 +pkg encoding/hex, var ErrLength error +pkg encoding/json, func Compact(*bytes.Buffer, []uint8) error +pkg encoding/json, func HTMLEscape(*bytes.Buffer, []uint8) +pkg encoding/json, func Indent(*bytes.Buffer, []uint8, string, string) error +pkg encoding/json, func Marshal(interface{}) ([]uint8, error) +pkg encoding/json, func MarshalIndent(interface{}, string, string) ([]uint8, error) +pkg encoding/json, func NewDecoder(io.Reader) *Decoder +pkg encoding/json, func NewEncoder(io.Writer) *Encoder +pkg encoding/json, func Unmarshal([]uint8, interface{}) error +pkg encoding/json, method (*Decoder) Decode(interface{}) error +pkg encoding/json, method (*Encoder) Encode(interface{}) error +pkg encoding/json, method (*InvalidUTF8Error) Error() string +pkg encoding/json, method (*InvalidUnmarshalError) Error() string +pkg encoding/json, method (*MarshalerError) Error() string +pkg encoding/json, method (*RawMessage) MarshalJSON() ([]uint8, error) +pkg encoding/json, method (*RawMessage) UnmarshalJSON([]uint8) error +pkg encoding/json, method (*SyntaxError) Error() string +pkg encoding/json, method (*UnmarshalFieldError) Error() string +pkg encoding/json, method (*UnmarshalTypeError) Error() string +pkg encoding/json, method (*UnsupportedTypeError) Error() string +pkg encoding/json, method (*UnsupportedValueError) Error() string +pkg encoding/json, type Decoder struct +pkg encoding/json, type Encoder struct +pkg encoding/json, type InvalidUTF8Error struct +pkg encoding/json, type InvalidUTF8Error struct, S string +pkg encoding/json, type InvalidUnmarshalError struct +pkg encoding/json, type InvalidUnmarshalError struct, Type reflect.Type +pkg encoding/json, type Marshaler interface { MarshalJSON } +pkg encoding/json, type Marshaler interface, MarshalJSON() ([]uint8, error) +pkg encoding/json, type MarshalerError struct +pkg encoding/json, type MarshalerError struct, Err error +pkg encoding/json, type MarshalerError struct, Type reflect.Type +pkg encoding/json, type RawMessage []uint8 +pkg encoding/json, type SyntaxError struct +pkg encoding/json, type SyntaxError struct, Offset int64 +pkg encoding/json, type UnmarshalFieldError struct +pkg encoding/json, type UnmarshalFieldError struct, Field reflect.StructField +pkg encoding/json, type UnmarshalFieldError struct, Key string +pkg encoding/json, type UnmarshalFieldError struct, Type reflect.Type +pkg encoding/json, type UnmarshalTypeError struct +pkg encoding/json, type UnmarshalTypeError struct, Type reflect.Type +pkg encoding/json, type UnmarshalTypeError struct, Value string +pkg encoding/json, type Unmarshaler interface { UnmarshalJSON } +pkg encoding/json, type Unmarshaler interface, UnmarshalJSON([]uint8) error +pkg encoding/json, type UnsupportedTypeError struct +pkg encoding/json, type UnsupportedTypeError struct, Type reflect.Type +pkg encoding/json, type UnsupportedValueError struct +pkg encoding/json, type UnsupportedValueError struct, Str string +pkg encoding/json, type UnsupportedValueError struct, Value reflect.Value +pkg encoding/pem, func Decode([]uint8) (*Block, []uint8) +pkg encoding/pem, func Encode(io.Writer, *Block) error +pkg encoding/pem, func EncodeToMemory(*Block) []uint8 +pkg encoding/pem, type Block struct +pkg encoding/pem, type Block struct, Bytes []uint8 +pkg encoding/pem, type Block struct, Headers map[string]string +pkg encoding/pem, type Block struct, Type string +pkg encoding/xml, const Header ideal-string +pkg encoding/xml, func CopyToken(Token) Token +pkg encoding/xml, func Escape(io.Writer, []uint8) +pkg encoding/xml, func Marshal(interface{}) ([]uint8, error) +pkg encoding/xml, func MarshalIndent(interface{}, string, string) ([]uint8, error) +pkg encoding/xml, func NewDecoder(io.Reader) *Decoder +pkg encoding/xml, func NewEncoder(io.Writer) *Encoder +pkg encoding/xml, func Unmarshal([]uint8, interface{}) error +pkg encoding/xml, method (*Decoder) Decode(interface{}) error +pkg encoding/xml, method (*Decoder) DecodeElement(interface{}, *StartElement) error +pkg encoding/xml, method (*Decoder) RawToken() (Token, error) +pkg encoding/xml, method (*Decoder) Skip() error +pkg encoding/xml, method (*Decoder) Token() (Token, error) +pkg encoding/xml, method (*Encoder) Encode(interface{}) error +pkg encoding/xml, method (*SyntaxError) Error() string +pkg encoding/xml, method (*TagPathError) Error() string +pkg encoding/xml, method (*UnsupportedTypeError) Error() string +pkg encoding/xml, method (CharData) Copy() CharData +pkg encoding/xml, method (Comment) Copy() Comment +pkg encoding/xml, method (Directive) Copy() Directive +pkg encoding/xml, method (ProcInst) Copy() ProcInst +pkg encoding/xml, method (StartElement) Copy() StartElement +pkg encoding/xml, method (UnmarshalError) Error() string +pkg encoding/xml, type Attr struct +pkg encoding/xml, type Attr struct, Name Name +pkg encoding/xml, type Attr struct, Value string +pkg encoding/xml, type CharData []uint8 +pkg encoding/xml, type Comment []uint8 +pkg encoding/xml, type Decoder struct +pkg encoding/xml, type Decoder struct, AutoClose []string +pkg encoding/xml, type Decoder struct, CharsetReader func(string, io.Reader) (io.Reader, error) +pkg encoding/xml, type Decoder struct, Entity map[string]string +pkg encoding/xml, type Decoder struct, Strict bool +pkg encoding/xml, type Directive []uint8 +pkg encoding/xml, type Encoder struct +pkg encoding/xml, type EndElement struct +pkg encoding/xml, type EndElement struct, Name Name +pkg encoding/xml, type Name struct +pkg encoding/xml, type Name struct, Local string +pkg encoding/xml, type Name struct, Space string +pkg encoding/xml, type ProcInst struct +pkg encoding/xml, type ProcInst struct, Inst []uint8 +pkg encoding/xml, type ProcInst struct, Target string +pkg encoding/xml, type StartElement struct +pkg encoding/xml, type StartElement struct, Attr []Attr +pkg encoding/xml, type StartElement struct, Name Name +pkg encoding/xml, type SyntaxError struct +pkg encoding/xml, type SyntaxError struct, Line int +pkg encoding/xml, type SyntaxError struct, Msg string +pkg encoding/xml, type TagPathError struct +pkg encoding/xml, type TagPathError struct, Field1 string +pkg encoding/xml, type TagPathError struct, Field2 string +pkg encoding/xml, type TagPathError struct, Struct reflect.Type +pkg encoding/xml, type TagPathError struct, Tag1 string +pkg encoding/xml, type TagPathError struct, Tag2 string +pkg encoding/xml, type Token interface {} +pkg encoding/xml, type UnmarshalError string +pkg encoding/xml, type UnsupportedTypeError struct +pkg encoding/xml, type UnsupportedTypeError struct, Type reflect.Type +pkg encoding/xml, var HTMLAutoClose []string +pkg encoding/xml, var HTMLEntity map[string]string +pkg errors, func New(string) error +pkg expvar, func Do(func(KeyValue)) +pkg expvar, func Get(string) Var +pkg expvar, func NewFloat(string) *Float +pkg expvar, func NewInt(string) *Int +pkg expvar, func NewMap(string) *Map +pkg expvar, func NewString(string) *String +pkg expvar, func Publish(string, Var) +pkg expvar, method (*Float) Add(float64) +pkg expvar, method (*Float) Set(float64) +pkg expvar, method (*Float) String() string +pkg expvar, method (*Int) Add(int64) +pkg expvar, method (*Int) Set(int64) +pkg expvar, method (*Int) String() string +pkg expvar, method (*Map) Add(string, int64) +pkg expvar, method (*Map) AddFloat(string, float64) +pkg expvar, method (*Map) Do(func(KeyValue)) +pkg expvar, method (*Map) Get(string) Var +pkg expvar, method (*Map) Init() *Map +pkg expvar, method (*Map) Set(string, Var) +pkg expvar, method (*Map) String() string +pkg expvar, method (*String) Set(string) +pkg expvar, method (*String) String() string +pkg expvar, method (Func) String() string +pkg expvar, type Float struct +pkg expvar, type Func func() interface{} +pkg expvar, type Int struct +pkg expvar, type KeyValue struct +pkg expvar, type KeyValue struct, Key string +pkg expvar, type KeyValue struct, Value Var +pkg expvar, type Map struct +pkg expvar, type String struct +pkg expvar, type Var interface { String } +pkg expvar, type Var interface, String() string +pkg flag, const ContinueOnError ErrorHandling +pkg flag, const ExitOnError ErrorHandling +pkg flag, const PanicOnError ErrorHandling +pkg flag, func Arg(int) string +pkg flag, func Args() []string +pkg flag, func Bool(string, bool, string) *bool +pkg flag, func BoolVar(*bool, string, bool, string) +pkg flag, func Duration(string, time.Duration, string) *time.Duration +pkg flag, func DurationVar(*time.Duration, string, time.Duration, string) +pkg flag, func Float64(string, float64, string) *float64 +pkg flag, func Float64Var(*float64, string, float64, string) +pkg flag, func Int(string, int, string) *int +pkg flag, func Int64(string, int64, string) *int64 +pkg flag, func Int64Var(*int64, string, int64, string) +pkg flag, func IntVar(*int, string, int, string) +pkg flag, func Lookup(string) *Flag +pkg flag, func NArg() int +pkg flag, func NFlag() int +pkg flag, func NewFlagSet(string, ErrorHandling) *FlagSet +pkg flag, func Parse() +pkg flag, func Parsed() bool +pkg flag, func PrintDefaults() +pkg flag, func Set(string, string) error +pkg flag, func String(string, string, string) *string +pkg flag, func StringVar(*string, string, string, string) +pkg flag, func Uint(string, uint, string) *uint +pkg flag, func Uint64(string, uint64, string) *uint64 +pkg flag, func Uint64Var(*uint64, string, uint64, string) +pkg flag, func UintVar(*uint, string, uint, string) +pkg flag, func Var(Value, string, string) +pkg flag, func Visit(func(*Flag)) +pkg flag, func VisitAll(func(*Flag)) +pkg flag, method (*FlagSet) Arg(int) string +pkg flag, method (*FlagSet) Args() []string +pkg flag, method (*FlagSet) Bool(string, bool, string) *bool +pkg flag, method (*FlagSet) BoolVar(*bool, string, bool, string) +pkg flag, method (*FlagSet) Duration(string, time.Duration, string) *time.Duration +pkg flag, method (*FlagSet) DurationVar(*time.Duration, string, time.Duration, string) +pkg flag, method (*FlagSet) Float64(string, float64, string) *float64 +pkg flag, method (*FlagSet) Float64Var(*float64, string, float64, string) +pkg flag, method (*FlagSet) Init(string, ErrorHandling) +pkg flag, method (*FlagSet) Int(string, int, string) *int +pkg flag, method (*FlagSet) Int64(string, int64, string) *int64 +pkg flag, method (*FlagSet) Int64Var(*int64, string, int64, string) +pkg flag, method (*FlagSet) IntVar(*int, string, int, string) +pkg flag, method (*FlagSet) Lookup(string) *Flag +pkg flag, method (*FlagSet) NArg() int +pkg flag, method (*FlagSet) NFlag() int +pkg flag, method (*FlagSet) Parse([]string) error +pkg flag, method (*FlagSet) Parsed() bool +pkg flag, method (*FlagSet) PrintDefaults() +pkg flag, method (*FlagSet) Set(string, string) error +pkg flag, method (*FlagSet) SetOutput(io.Writer) +pkg flag, method (*FlagSet) String(string, string, string) *string +pkg flag, method (*FlagSet) StringVar(*string, string, string, string) +pkg flag, method (*FlagSet) Uint(string, uint, string) *uint +pkg flag, method (*FlagSet) Uint64(string, uint64, string) *uint64 +pkg flag, method (*FlagSet) Uint64Var(*uint64, string, uint64, string) +pkg flag, method (*FlagSet) UintVar(*uint, string, uint, string) +pkg flag, method (*FlagSet) Var(Value, string, string) +pkg flag, method (*FlagSet) Visit(func(*Flag)) +pkg flag, method (*FlagSet) VisitAll(func(*Flag)) +pkg flag, type ErrorHandling int +pkg flag, type Flag struct +pkg flag, type Flag struct, DefValue string +pkg flag, type Flag struct, Name string +pkg flag, type Flag struct, Usage string +pkg flag, type Flag struct, Value Value +pkg flag, type FlagSet struct +pkg flag, type FlagSet struct, Usage func() +pkg flag, type Value interface { Set, String } +pkg flag, type Value interface, Set(string) error +pkg flag, type Value interface, String() string +pkg flag, var ErrHelp error +pkg flag, var Usage func() +pkg fmt, func Errorf(string, ...interface{}) error +pkg fmt, func Fprint(io.Writer, ...interface{}) (int, error) +pkg fmt, func Fprintf(io.Writer, string, ...interface{}) (int, error) +pkg fmt, func Fprintln(io.Writer, ...interface{}) (int, error) +pkg fmt, func Fscan(io.Reader, ...interface{}) (int, error) +pkg fmt, func Fscanf(io.Reader, string, ...interface{}) (int, error) +pkg fmt, func Fscanln(io.Reader, ...interface{}) (int, error) +pkg fmt, func Print(...interface{}) (int, error) +pkg fmt, func Printf(string, ...interface{}) (int, error) +pkg fmt, func Println(...interface{}) (int, error) +pkg fmt, func Scan(...interface{}) (int, error) +pkg fmt, func Scanf(string, ...interface{}) (int, error) +pkg fmt, func Scanln(...interface{}) (int, error) +pkg fmt, func Sprint(...interface{}) string +pkg fmt, func Sprintf(string, ...interface{}) string +pkg fmt, func Sprintln(...interface{}) string +pkg fmt, func Sscan(string, ...interface{}) (int, error) +pkg fmt, func Sscanf(string, string, ...interface{}) (int, error) +pkg fmt, func Sscanln(string, ...interface{}) (int, error) +pkg fmt, type Formatter interface { Format } +pkg fmt, type Formatter interface, Format(State, int32) +pkg fmt, type GoStringer interface { GoString } +pkg fmt, type GoStringer interface, GoString() string +pkg fmt, type ScanState interface { Read, ReadRune, SkipSpace, Token, UnreadRune, Width } +pkg fmt, type ScanState interface, Read([]uint8) (int, error) +pkg fmt, type ScanState interface, ReadRune() (int32, int, error) +pkg fmt, type ScanState interface, SkipSpace() +pkg fmt, type ScanState interface, Token(bool, func(int32) bool) ([]uint8, error) +pkg fmt, type ScanState interface, UnreadRune() error +pkg fmt, type ScanState interface, Width() (int, bool) +pkg fmt, type Scanner interface { Scan } +pkg fmt, type Scanner interface, Scan(ScanState, int32) error +pkg fmt, type State interface { Flag, Precision, Width, Write } +pkg fmt, type State interface, Flag(int) bool +pkg fmt, type State interface, Precision() (int, bool) +pkg fmt, type State interface, Width() (int, bool) +pkg fmt, type State interface, Write([]uint8) (int, error) +pkg fmt, type Stringer interface { String } +pkg fmt, type Stringer interface, String() string +pkg go/ast, const Bad ObjKind +pkg go/ast, const Con ObjKind +pkg go/ast, const FilterFuncDuplicates MergeMode +pkg go/ast, const FilterImportDuplicates MergeMode +pkg go/ast, const FilterUnassociatedComments MergeMode +pkg go/ast, const Fun ObjKind +pkg go/ast, const Lbl ObjKind +pkg go/ast, const Pkg ObjKind +pkg go/ast, const RECV ChanDir +pkg go/ast, const SEND ChanDir +pkg go/ast, const Typ ObjKind +pkg go/ast, const Var ObjKind +pkg go/ast, func FileExports(*File) bool +pkg go/ast, func FilterDecl(Decl, Filter) bool +pkg go/ast, func FilterFile(*File, Filter) bool +pkg go/ast, func FilterPackage(*Package, Filter) bool +pkg go/ast, func Fprint(io.Writer, *token.FileSet, interface{}, FieldFilter) error +pkg go/ast, func Inspect(Node, func(Node) bool) +pkg go/ast, func IsExported(string) bool +pkg go/ast, func MergePackageFiles(*Package, MergeMode) *File +pkg go/ast, func NewIdent(string) *Ident +pkg go/ast, func NewObj(ObjKind, string) *Object +pkg go/ast, func NewPackage(*token.FileSet, map[string]*File, Importer, *Scope) (*Package, error) +pkg go/ast, func NewScope(*Scope) *Scope +pkg go/ast, func NotNilFilter(string, reflect.Value) bool +pkg go/ast, func PackageExports(*Package) bool +pkg go/ast, func Print(*token.FileSet, interface{}) error +pkg go/ast, func SortImports(*token.FileSet, *File) +pkg go/ast, func Walk(Visitor, Node) +pkg go/ast, method (*ArrayType) End() token.Pos +pkg go/ast, method (*ArrayType) Pos() token.Pos +pkg go/ast, method (*AssignStmt) End() token.Pos +pkg go/ast, method (*AssignStmt) Pos() token.Pos +pkg go/ast, method (*BadDecl) End() token.Pos +pkg go/ast, method (*BadDecl) Pos() token.Pos +pkg go/ast, method (*BadExpr) End() token.Pos +pkg go/ast, method (*BadExpr) Pos() token.Pos +pkg go/ast, method (*BadStmt) End() token.Pos +pkg go/ast, method (*BadStmt) Pos() token.Pos +pkg go/ast, method (*BasicLit) End() token.Pos +pkg go/ast, method (*BasicLit) Pos() token.Pos +pkg go/ast, method (*BinaryExpr) End() token.Pos +pkg go/ast, method (*BinaryExpr) Pos() token.Pos +pkg go/ast, method (*BlockStmt) End() token.Pos +pkg go/ast, method (*BlockStmt) Pos() token.Pos +pkg go/ast, method (*BranchStmt) End() token.Pos +pkg go/ast, method (*BranchStmt) Pos() token.Pos +pkg go/ast, method (*CallExpr) End() token.Pos +pkg go/ast, method (*CallExpr) Pos() token.Pos +pkg go/ast, method (*CaseClause) End() token.Pos +pkg go/ast, method (*CaseClause) Pos() token.Pos +pkg go/ast, method (*ChanType) End() token.Pos +pkg go/ast, method (*ChanType) Pos() token.Pos +pkg go/ast, method (*CommClause) End() token.Pos +pkg go/ast, method (*CommClause) Pos() token.Pos +pkg go/ast, method (*Comment) End() token.Pos +pkg go/ast, method (*Comment) Pos() token.Pos +pkg go/ast, method (*CommentGroup) End() token.Pos +pkg go/ast, method (*CommentGroup) Pos() token.Pos +pkg go/ast, method (*CommentGroup) Text() string +pkg go/ast, method (*CompositeLit) End() token.Pos +pkg go/ast, method (*CompositeLit) Pos() token.Pos +pkg go/ast, method (*DeclStmt) End() token.Pos +pkg go/ast, method (*DeclStmt) Pos() token.Pos +pkg go/ast, method (*DeferStmt) End() token.Pos +pkg go/ast, method (*DeferStmt) Pos() token.Pos +pkg go/ast, method (*Ellipsis) End() token.Pos +pkg go/ast, method (*Ellipsis) Pos() token.Pos +pkg go/ast, method (*EmptyStmt) End() token.Pos +pkg go/ast, method (*EmptyStmt) Pos() token.Pos +pkg go/ast, method (*ExprStmt) End() token.Pos +pkg go/ast, method (*ExprStmt) Pos() token.Pos +pkg go/ast, method (*Field) End() token.Pos +pkg go/ast, method (*Field) Pos() token.Pos +pkg go/ast, method (*FieldList) End() token.Pos +pkg go/ast, method (*FieldList) NumFields() int +pkg go/ast, method (*FieldList) Pos() token.Pos +pkg go/ast, method (*File) End() token.Pos +pkg go/ast, method (*File) Pos() token.Pos +pkg go/ast, method (*ForStmt) End() token.Pos +pkg go/ast, method (*ForStmt) Pos() token.Pos +pkg go/ast, method (*FuncDecl) End() token.Pos +pkg go/ast, method (*FuncDecl) Pos() token.Pos +pkg go/ast, method (*FuncLit) End() token.Pos +pkg go/ast, method (*FuncLit) Pos() token.Pos +pkg go/ast, method (*FuncType) End() token.Pos +pkg go/ast, method (*FuncType) Pos() token.Pos +pkg go/ast, method (*GenDecl) End() token.Pos +pkg go/ast, method (*GenDecl) Pos() token.Pos +pkg go/ast, method (*GoStmt) End() token.Pos +pkg go/ast, method (*GoStmt) Pos() token.Pos +pkg go/ast, method (*Ident) End() token.Pos +pkg go/ast, method (*Ident) IsExported() bool +pkg go/ast, method (*Ident) Pos() token.Pos +pkg go/ast, method (*Ident) String() string +pkg go/ast, method (*IfStmt) End() token.Pos +pkg go/ast, method (*IfStmt) Pos() token.Pos +pkg go/ast, method (*ImportSpec) End() token.Pos +pkg go/ast, method (*ImportSpec) Pos() token.Pos +pkg go/ast, method (*IncDecStmt) End() token.Pos +pkg go/ast, method (*IncDecStmt) Pos() token.Pos +pkg go/ast, method (*IndexExpr) End() token.Pos +pkg go/ast, method (*IndexExpr) Pos() token.Pos +pkg go/ast, method (*InterfaceType) End() token.Pos +pkg go/ast, method (*InterfaceType) Pos() token.Pos +pkg go/ast, method (*KeyValueExpr) End() token.Pos +pkg go/ast, method (*KeyValueExpr) Pos() token.Pos +pkg go/ast, method (*LabeledStmt) End() token.Pos +pkg go/ast, method (*LabeledStmt) Pos() token.Pos +pkg go/ast, method (*MapType) End() token.Pos +pkg go/ast, method (*MapType) Pos() token.Pos +pkg go/ast, method (*Object) Pos() token.Pos +pkg go/ast, method (*Package) End() token.Pos +pkg go/ast, method (*Package) Pos() token.Pos +pkg go/ast, method (*ParenExpr) End() token.Pos +pkg go/ast, method (*ParenExpr) Pos() token.Pos +pkg go/ast, method (*RangeStmt) End() token.Pos +pkg go/ast, method (*RangeStmt) Pos() token.Pos +pkg go/ast, method (*ReturnStmt) End() token.Pos +pkg go/ast, method (*ReturnStmt) Pos() token.Pos +pkg go/ast, method (*Scope) Insert(*Object) *Object +pkg go/ast, method (*Scope) Lookup(string) *Object +pkg go/ast, method (*Scope) String() string +pkg go/ast, method (*SelectStmt) End() token.Pos +pkg go/ast, method (*SelectStmt) Pos() token.Pos +pkg go/ast, method (*SelectorExpr) End() token.Pos +pkg go/ast, method (*SelectorExpr) Pos() token.Pos +pkg go/ast, method (*SendStmt) End() token.Pos +pkg go/ast, method (*SendStmt) Pos() token.Pos +pkg go/ast, method (*SliceExpr) End() token.Pos +pkg go/ast, method (*SliceExpr) Pos() token.Pos +pkg go/ast, method (*StarExpr) End() token.Pos +pkg go/ast, method (*StarExpr) Pos() token.Pos +pkg go/ast, method (*StructType) End() token.Pos +pkg go/ast, method (*StructType) Pos() token.Pos +pkg go/ast, method (*SwitchStmt) End() token.Pos +pkg go/ast, method (*SwitchStmt) Pos() token.Pos +pkg go/ast, method (*TypeAssertExpr) End() token.Pos +pkg go/ast, method (*TypeAssertExpr) Pos() token.Pos +pkg go/ast, method (*TypeSpec) End() token.Pos +pkg go/ast, method (*TypeSpec) Pos() token.Pos +pkg go/ast, method (*TypeSwitchStmt) End() token.Pos +pkg go/ast, method (*TypeSwitchStmt) Pos() token.Pos +pkg go/ast, method (*UnaryExpr) End() token.Pos +pkg go/ast, method (*UnaryExpr) Pos() token.Pos +pkg go/ast, method (*ValueSpec) End() token.Pos +pkg go/ast, method (*ValueSpec) Pos() token.Pos +pkg go/ast, method (ObjKind) String() string +pkg go/ast, type ArrayType struct +pkg go/ast, type ArrayType struct, Elt Expr +pkg go/ast, type ArrayType struct, Lbrack token.Pos +pkg go/ast, type ArrayType struct, Len Expr +pkg go/ast, type AssignStmt struct +pkg go/ast, type AssignStmt struct, Lhs []Expr +pkg go/ast, type AssignStmt struct, Rhs []Expr +pkg go/ast, type AssignStmt struct, Tok token.Token +pkg go/ast, type AssignStmt struct, TokPos token.Pos +pkg go/ast, type BadDecl struct +pkg go/ast, type BadDecl struct, From token.Pos +pkg go/ast, type BadDecl struct, To token.Pos +pkg go/ast, type BadExpr struct +pkg go/ast, type BadExpr struct, From token.Pos +pkg go/ast, type BadExpr struct, To token.Pos +pkg go/ast, type BadStmt struct +pkg go/ast, type BadStmt struct, From token.Pos +pkg go/ast, type BadStmt struct, To token.Pos +pkg go/ast, type BasicLit struct +pkg go/ast, type BasicLit struct, Kind token.Token +pkg go/ast, type BasicLit struct, Value string +pkg go/ast, type BasicLit struct, ValuePos token.Pos +pkg go/ast, type BinaryExpr struct +pkg go/ast, type BinaryExpr struct, Op token.Token +pkg go/ast, type BinaryExpr struct, OpPos token.Pos +pkg go/ast, type BinaryExpr struct, X Expr +pkg go/ast, type BinaryExpr struct, Y Expr +pkg go/ast, type BlockStmt struct +pkg go/ast, type BlockStmt struct, Lbrace token.Pos +pkg go/ast, type BlockStmt struct, List []Stmt +pkg go/ast, type BlockStmt struct, Rbrace token.Pos +pkg go/ast, type BranchStmt struct +pkg go/ast, type BranchStmt struct, Label *Ident +pkg go/ast, type BranchStmt struct, Tok token.Token +pkg go/ast, type BranchStmt struct, TokPos token.Pos +pkg go/ast, type CallExpr struct +pkg go/ast, type CallExpr struct, Args []Expr +pkg go/ast, type CallExpr struct, Ellipsis token.Pos +pkg go/ast, type CallExpr struct, Fun Expr +pkg go/ast, type CallExpr struct, Lparen token.Pos +pkg go/ast, type CallExpr struct, Rparen token.Pos +pkg go/ast, type CaseClause struct +pkg go/ast, type CaseClause struct, Body []Stmt +pkg go/ast, type CaseClause struct, Case token.Pos +pkg go/ast, type CaseClause struct, Colon token.Pos +pkg go/ast, type CaseClause struct, List []Expr +pkg go/ast, type ChanDir int +pkg go/ast, type ChanType struct +pkg go/ast, type ChanType struct, Begin token.Pos +pkg go/ast, type ChanType struct, Dir ChanDir +pkg go/ast, type ChanType struct, Value Expr +pkg go/ast, type CommClause struct +pkg go/ast, type CommClause struct, Body []Stmt +pkg go/ast, type CommClause struct, Case token.Pos +pkg go/ast, type CommClause struct, Colon token.Pos +pkg go/ast, type CommClause struct, Comm Stmt +pkg go/ast, type Comment struct +pkg go/ast, type Comment struct, Slash token.Pos +pkg go/ast, type Comment struct, Text string +pkg go/ast, type CommentGroup struct +pkg go/ast, type CommentGroup struct, List []*Comment +pkg go/ast, type CompositeLit struct +pkg go/ast, type CompositeLit struct, Elts []Expr +pkg go/ast, type CompositeLit struct, Lbrace token.Pos +pkg go/ast, type CompositeLit struct, Rbrace token.Pos +pkg go/ast, type CompositeLit struct, Type Expr +pkg go/ast, type Decl interface, End() token.Pos +pkg go/ast, type Decl interface, Pos() token.Pos +pkg go/ast, type Decl interface, unexported methods +pkg go/ast, type DeclStmt struct +pkg go/ast, type DeclStmt struct, Decl Decl +pkg go/ast, type DeferStmt struct +pkg go/ast, type DeferStmt struct, Call *CallExpr +pkg go/ast, type DeferStmt struct, Defer token.Pos +pkg go/ast, type Ellipsis struct +pkg go/ast, type Ellipsis struct, Ellipsis token.Pos +pkg go/ast, type Ellipsis struct, Elt Expr +pkg go/ast, type EmptyStmt struct +pkg go/ast, type EmptyStmt struct, Semicolon token.Pos +pkg go/ast, type Expr interface, End() token.Pos +pkg go/ast, type Expr interface, Pos() token.Pos +pkg go/ast, type Expr interface, unexported methods +pkg go/ast, type ExprStmt struct +pkg go/ast, type ExprStmt struct, X Expr +pkg go/ast, type Field struct +pkg go/ast, type Field struct, Comment *CommentGroup +pkg go/ast, type Field struct, Doc *CommentGroup +pkg go/ast, type Field struct, Names []*Ident +pkg go/ast, type Field struct, Tag *BasicLit +pkg go/ast, type Field struct, Type Expr +pkg go/ast, type FieldFilter func(string, reflect.Value) bool +pkg go/ast, type FieldList struct +pkg go/ast, type FieldList struct, Closing token.Pos +pkg go/ast, type FieldList struct, List []*Field +pkg go/ast, type FieldList struct, Opening token.Pos +pkg go/ast, type File struct +pkg go/ast, type File struct, Comments []*CommentGroup +pkg go/ast, type File struct, Decls []Decl +pkg go/ast, type File struct, Doc *CommentGroup +pkg go/ast, type File struct, Imports []*ImportSpec +pkg go/ast, type File struct, Name *Ident +pkg go/ast, type File struct, Package token.Pos +pkg go/ast, type File struct, Scope *Scope +pkg go/ast, type File struct, Unresolved []*Ident +pkg go/ast, type Filter func(string) bool +pkg go/ast, type ForStmt struct +pkg go/ast, type ForStmt struct, Body *BlockStmt +pkg go/ast, type ForStmt struct, Cond Expr +pkg go/ast, type ForStmt struct, For token.Pos +pkg go/ast, type ForStmt struct, Init Stmt +pkg go/ast, type ForStmt struct, Post Stmt +pkg go/ast, type FuncDecl struct +pkg go/ast, type FuncDecl struct, Body *BlockStmt +pkg go/ast, type FuncDecl struct, Doc *CommentGroup +pkg go/ast, type FuncDecl struct, Name *Ident +pkg go/ast, type FuncDecl struct, Recv *FieldList +pkg go/ast, type FuncDecl struct, Type *FuncType +pkg go/ast, type FuncLit struct +pkg go/ast, type FuncLit struct, Body *BlockStmt +pkg go/ast, type FuncLit struct, Type *FuncType +pkg go/ast, type FuncType struct +pkg go/ast, type FuncType struct, Func token.Pos +pkg go/ast, type FuncType struct, Params *FieldList +pkg go/ast, type FuncType struct, Results *FieldList +pkg go/ast, type GenDecl struct +pkg go/ast, type GenDecl struct, Doc *CommentGroup +pkg go/ast, type GenDecl struct, Lparen token.Pos +pkg go/ast, type GenDecl struct, Rparen token.Pos +pkg go/ast, type GenDecl struct, Specs []Spec +pkg go/ast, type GenDecl struct, Tok token.Token +pkg go/ast, type GenDecl struct, TokPos token.Pos +pkg go/ast, type GoStmt struct +pkg go/ast, type GoStmt struct, Call *CallExpr +pkg go/ast, type GoStmt struct, Go token.Pos +pkg go/ast, type Ident struct +pkg go/ast, type Ident struct, Name string +pkg go/ast, type Ident struct, NamePos token.Pos +pkg go/ast, type Ident struct, Obj *Object +pkg go/ast, type IfStmt struct +pkg go/ast, type IfStmt struct, Body *BlockStmt +pkg go/ast, type IfStmt struct, Cond Expr +pkg go/ast, type IfStmt struct, Else Stmt +pkg go/ast, type IfStmt struct, If token.Pos +pkg go/ast, type IfStmt struct, Init Stmt +pkg go/ast, type ImportSpec struct +pkg go/ast, type ImportSpec struct, Comment *CommentGroup +pkg go/ast, type ImportSpec struct, Doc *CommentGroup +pkg go/ast, type ImportSpec struct, EndPos token.Pos +pkg go/ast, type ImportSpec struct, Name *Ident +pkg go/ast, type ImportSpec struct, Path *BasicLit +pkg go/ast, type Importer func(map[string]*Object, string) (*Object, error) +pkg go/ast, type IncDecStmt struct +pkg go/ast, type IncDecStmt struct, Tok token.Token +pkg go/ast, type IncDecStmt struct, TokPos token.Pos +pkg go/ast, type IncDecStmt struct, X Expr +pkg go/ast, type IndexExpr struct +pkg go/ast, type IndexExpr struct, Index Expr +pkg go/ast, type IndexExpr struct, Lbrack token.Pos +pkg go/ast, type IndexExpr struct, Rbrack token.Pos +pkg go/ast, type IndexExpr struct, X Expr +pkg go/ast, type InterfaceType struct +pkg go/ast, type InterfaceType struct, Incomplete bool +pkg go/ast, type InterfaceType struct, Interface token.Pos +pkg go/ast, type InterfaceType struct, Methods *FieldList +pkg go/ast, type KeyValueExpr struct +pkg go/ast, type KeyValueExpr struct, Colon token.Pos +pkg go/ast, type KeyValueExpr struct, Key Expr +pkg go/ast, type KeyValueExpr struct, Value Expr +pkg go/ast, type LabeledStmt struct +pkg go/ast, type LabeledStmt struct, Colon token.Pos +pkg go/ast, type LabeledStmt struct, Label *Ident +pkg go/ast, type LabeledStmt struct, Stmt Stmt +pkg go/ast, type MapType struct +pkg go/ast, type MapType struct, Key Expr +pkg go/ast, type MapType struct, Map token.Pos +pkg go/ast, type MapType struct, Value Expr +pkg go/ast, type MergeMode uint +pkg go/ast, type Node interface { End, Pos } +pkg go/ast, type Node interface, End() token.Pos +pkg go/ast, type Node interface, Pos() token.Pos +pkg go/ast, type ObjKind int +pkg go/ast, type Object struct +pkg go/ast, type Object struct, Data interface{} +pkg go/ast, type Object struct, Decl interface{} +pkg go/ast, type Object struct, Kind ObjKind +pkg go/ast, type Object struct, Name string +pkg go/ast, type Object struct, Type interface{} +pkg go/ast, type Package struct +pkg go/ast, type Package struct, Files map[string]*File +pkg go/ast, type Package struct, Imports map[string]*Object +pkg go/ast, type Package struct, Name string +pkg go/ast, type Package struct, Scope *Scope +pkg go/ast, type ParenExpr struct +pkg go/ast, type ParenExpr struct, Lparen token.Pos +pkg go/ast, type ParenExpr struct, Rparen token.Pos +pkg go/ast, type ParenExpr struct, X Expr +pkg go/ast, type RangeStmt struct +pkg go/ast, type RangeStmt struct, Body *BlockStmt +pkg go/ast, type RangeStmt struct, For token.Pos +pkg go/ast, type RangeStmt struct, Key Expr +pkg go/ast, type RangeStmt struct, Tok token.Token +pkg go/ast, type RangeStmt struct, TokPos token.Pos +pkg go/ast, type RangeStmt struct, Value Expr +pkg go/ast, type RangeStmt struct, X Expr +pkg go/ast, type ReturnStmt struct +pkg go/ast, type ReturnStmt struct, Results []Expr +pkg go/ast, type ReturnStmt struct, Return token.Pos +pkg go/ast, type Scope struct +pkg go/ast, type Scope struct, Objects map[string]*Object +pkg go/ast, type Scope struct, Outer *Scope +pkg go/ast, type SelectStmt struct +pkg go/ast, type SelectStmt struct, Body *BlockStmt +pkg go/ast, type SelectStmt struct, Select token.Pos +pkg go/ast, type SelectorExpr struct +pkg go/ast, type SelectorExpr struct, Sel *Ident +pkg go/ast, type SelectorExpr struct, X Expr +pkg go/ast, type SendStmt struct +pkg go/ast, type SendStmt struct, Arrow token.Pos +pkg go/ast, type SendStmt struct, Chan Expr +pkg go/ast, type SendStmt struct, Value Expr +pkg go/ast, type SliceExpr struct +pkg go/ast, type SliceExpr struct, High Expr +pkg go/ast, type SliceExpr struct, Lbrack token.Pos +pkg go/ast, type SliceExpr struct, Low Expr +pkg go/ast, type SliceExpr struct, Rbrack token.Pos +pkg go/ast, type SliceExpr struct, X Expr +pkg go/ast, type Spec interface, End() token.Pos +pkg go/ast, type Spec interface, Pos() token.Pos +pkg go/ast, type Spec interface, unexported methods +pkg go/ast, type StarExpr struct +pkg go/ast, type StarExpr struct, Star token.Pos +pkg go/ast, type StarExpr struct, X Expr +pkg go/ast, type Stmt interface, End() token.Pos +pkg go/ast, type Stmt interface, Pos() token.Pos +pkg go/ast, type Stmt interface, unexported methods +pkg go/ast, type StructType struct +pkg go/ast, type StructType struct, Fields *FieldList +pkg go/ast, type StructType struct, Incomplete bool +pkg go/ast, type StructType struct, Struct token.Pos +pkg go/ast, type SwitchStmt struct +pkg go/ast, type SwitchStmt struct, Body *BlockStmt +pkg go/ast, type SwitchStmt struct, Init Stmt +pkg go/ast, type SwitchStmt struct, Switch token.Pos +pkg go/ast, type SwitchStmt struct, Tag Expr +pkg go/ast, type TypeAssertExpr struct +pkg go/ast, type TypeAssertExpr struct, Type Expr +pkg go/ast, type TypeAssertExpr struct, X Expr +pkg go/ast, type TypeSpec struct +pkg go/ast, type TypeSpec struct, Comment *CommentGroup +pkg go/ast, type TypeSpec struct, Doc *CommentGroup +pkg go/ast, type TypeSpec struct, Name *Ident +pkg go/ast, type TypeSpec struct, Type Expr +pkg go/ast, type TypeSwitchStmt struct +pkg go/ast, type TypeSwitchStmt struct, Assign Stmt +pkg go/ast, type TypeSwitchStmt struct, Body *BlockStmt +pkg go/ast, type TypeSwitchStmt struct, Init Stmt +pkg go/ast, type TypeSwitchStmt struct, Switch token.Pos +pkg go/ast, type UnaryExpr struct +pkg go/ast, type UnaryExpr struct, Op token.Token +pkg go/ast, type UnaryExpr struct, OpPos token.Pos +pkg go/ast, type UnaryExpr struct, X Expr +pkg go/ast, type ValueSpec struct +pkg go/ast, type ValueSpec struct, Comment *CommentGroup +pkg go/ast, type ValueSpec struct, Doc *CommentGroup +pkg go/ast, type ValueSpec struct, Names []*Ident +pkg go/ast, type ValueSpec struct, Type Expr +pkg go/ast, type ValueSpec struct, Values []Expr +pkg go/ast, type Visitor interface { Visit } +pkg go/ast, type Visitor interface, Visit(Node) Visitor +pkg go/build, const AllowBinary ImportMode +pkg go/build, const FindOnly ImportMode +pkg go/build, func ArchChar(string) (string, error) +pkg go/build, func Import(string, string, ImportMode) (*Package, error) +pkg go/build, func ImportDir(string, ImportMode) (*Package, error) +pkg go/build, func IsLocalImport(string) bool +pkg go/build, method (*Context) Import(string, string, ImportMode) (*Package, error) +pkg go/build, method (*Context) ImportDir(string, ImportMode) (*Package, error) +pkg go/build, method (*Context) SrcDirs() []string +pkg go/build, method (*NoGoError) Error() string +pkg go/build, method (*Package) IsCommand() bool +pkg go/build, type Context struct +pkg go/build, type Context struct, BuildTags []string +pkg go/build, type Context struct, CgoEnabled bool +pkg go/build, type Context struct, Compiler string +pkg go/build, type Context struct, GOARCH string +pkg go/build, type Context struct, GOOS string +pkg go/build, type Context struct, GOPATH string +pkg go/build, type Context struct, GOROOT string +pkg go/build, type Context struct, HasSubdir func(string, string) (string, bool) +pkg go/build, type Context struct, IsAbsPath func(string) bool +pkg go/build, type Context struct, IsDir func(string) bool +pkg go/build, type Context struct, JoinPath func(...string) string +pkg go/build, type Context struct, OpenFile func(string) (io.ReadCloser, error) +pkg go/build, type Context struct, ReadDir func(string) ([]os.FileInfo, error) +pkg go/build, type Context struct, SplitPathList func(string) []string +pkg go/build, type Context struct, UseAllFiles bool +pkg go/build, type ImportMode uint +pkg go/build, type NoGoError struct +pkg go/build, type NoGoError struct, Dir string +pkg go/build, type Package struct +pkg go/build, type Package struct, BinDir string +pkg go/build, type Package struct, CFiles []string +pkg go/build, type Package struct, CgoCFLAGS []string +pkg go/build, type Package struct, CgoFiles []string +pkg go/build, type Package struct, CgoLDFLAGS []string +pkg go/build, type Package struct, CgoPkgConfig []string +pkg go/build, type Package struct, Dir string +pkg go/build, type Package struct, Doc string +pkg go/build, type Package struct, GoFiles []string +pkg go/build, type Package struct, Goroot bool +pkg go/build, type Package struct, HFiles []string +pkg go/build, type Package struct, ImportPath string +pkg go/build, type Package struct, ImportPos map[string][]token.Position +pkg go/build, type Package struct, Imports []string +pkg go/build, type Package struct, Name string +pkg go/build, type Package struct, PkgObj string +pkg go/build, type Package struct, PkgRoot string +pkg go/build, type Package struct, Root string +pkg go/build, type Package struct, SFiles []string +pkg go/build, type Package struct, SrcRoot string +pkg go/build, type Package struct, SysoFiles []string +pkg go/build, type Package struct, TestGoFiles []string +pkg go/build, type Package struct, TestImportPos map[string][]token.Position +pkg go/build, type Package struct, TestImports []string +pkg go/build, type Package struct, XTestGoFiles []string +pkg go/build, type Package struct, XTestImportPos map[string][]token.Position +pkg go/build, type Package struct, XTestImports []string +pkg go/build, var Default Context +pkg go/build, var ToolDir string +pkg go/doc, const AllDecls Mode +pkg go/doc, const AllMethods Mode +pkg go/doc, func Examples(...*ast.File) []*Example +pkg go/doc, func New(*ast.Package, string, Mode) *Package +pkg go/doc, func Synopsis(string) string +pkg go/doc, func ToHTML(io.Writer, string, map[string]string) +pkg go/doc, func ToText(io.Writer, string, string, string, int) +pkg go/doc, method (*Package) Filter(Filter) +pkg go/doc, type Example struct +pkg go/doc, type Example struct, Code ast.Node +pkg go/doc, type Example struct, Comments []*ast.CommentGroup +pkg go/doc, type Example struct, Doc string +pkg go/doc, type Example struct, Name string +pkg go/doc, type Example struct, Output string +pkg go/doc, type Filter func(string) bool +pkg go/doc, type Func struct +pkg go/doc, type Func struct, Decl *ast.FuncDecl +pkg go/doc, type Func struct, Doc string +pkg go/doc, type Func struct, Level int +pkg go/doc, type Func struct, Name string +pkg go/doc, type Func struct, Orig string +pkg go/doc, type Func struct, Recv string +pkg go/doc, type Mode int +pkg go/doc, type Package struct +pkg go/doc, type Package struct, Bugs []string +pkg go/doc, type Package struct, Consts []*Value +pkg go/doc, type Package struct, Doc string +pkg go/doc, type Package struct, Filenames []string +pkg go/doc, type Package struct, Funcs []*Func +pkg go/doc, type Package struct, ImportPath string +pkg go/doc, type Package struct, Imports []string +pkg go/doc, type Package struct, Name string +pkg go/doc, type Package struct, Types []*Type +pkg go/doc, type Package struct, Vars []*Value +pkg go/doc, type Type struct +pkg go/doc, type Type struct, Consts []*Value +pkg go/doc, type Type struct, Decl *ast.GenDecl +pkg go/doc, type Type struct, Doc string +pkg go/doc, type Type struct, Funcs []*Func +pkg go/doc, type Type struct, Methods []*Func +pkg go/doc, type Type struct, Name string +pkg go/doc, type Type struct, Vars []*Value +pkg go/doc, type Value struct +pkg go/doc, type Value struct, Decl *ast.GenDecl +pkg go/doc, type Value struct, Doc string +pkg go/doc, type Value struct, Names []string +pkg go/parser, const DeclarationErrors Mode +pkg go/parser, const ImportsOnly Mode +pkg go/parser, const PackageClauseOnly Mode +pkg go/parser, const ParseComments Mode +pkg go/parser, const SpuriousErrors Mode +pkg go/parser, const Trace Mode +pkg go/parser, func ParseDir(*token.FileSet, string, func(os.FileInfo) bool, Mode) (map[string]*ast.Package, error) +pkg go/parser, func ParseExpr(string) (ast.Expr, error) +pkg go/parser, func ParseFile(*token.FileSet, string, interface{}, Mode) (*ast.File, error) +pkg go/parser, type Mode uint +pkg go/printer, const RawFormat Mode +pkg go/printer, const SourcePos Mode +pkg go/printer, const TabIndent Mode +pkg go/printer, const UseSpaces Mode +pkg go/printer, func Fprint(io.Writer, *token.FileSet, interface{}) error +pkg go/printer, method (*Config) Fprint(io.Writer, *token.FileSet, interface{}) error +pkg go/printer, type CommentedNode struct +pkg go/printer, type CommentedNode struct, Comments []*ast.CommentGroup +pkg go/printer, type CommentedNode struct, Node interface{} +pkg go/printer, type Config struct +pkg go/printer, type Config struct, Mode Mode +pkg go/printer, type Config struct, Tabwidth int +pkg go/printer, type Mode uint +pkg go/scanner, const ScanComments Mode +pkg go/scanner, func PrintError(io.Writer, error) +pkg go/scanner, method (*ErrorList) Add(token.Position, string) +pkg go/scanner, method (*ErrorList) RemoveMultiples() +pkg go/scanner, method (*ErrorList) Reset() +pkg go/scanner, method (*Scanner) Init(*token.File, []uint8, ErrorHandler, Mode) +pkg go/scanner, method (*Scanner) Scan() (token.Pos, token.Token, string) +pkg go/scanner, method (Error) Error() string +pkg go/scanner, method (ErrorList) Err() error +pkg go/scanner, method (ErrorList) Error() string +pkg go/scanner, method (ErrorList) Len() int +pkg go/scanner, method (ErrorList) Less(int, int) bool +pkg go/scanner, method (ErrorList) Sort() +pkg go/scanner, method (ErrorList) Swap(int, int) +pkg go/scanner, type Error struct +pkg go/scanner, type Error struct, Msg string +pkg go/scanner, type Error struct, Pos token.Position +pkg go/scanner, type ErrorHandler func(token.Position, string) +pkg go/scanner, type ErrorList []*Error +pkg go/scanner, type Mode uint +pkg go/scanner, type Scanner struct +pkg go/scanner, type Scanner struct, ErrorCount int +pkg go/token, const ADD Token +pkg go/token, const ADD_ASSIGN Token +pkg go/token, const AND Token +pkg go/token, const AND_ASSIGN Token +pkg go/token, const AND_NOT Token +pkg go/token, const AND_NOT_ASSIGN Token +pkg go/token, const ARROW Token +pkg go/token, const ASSIGN Token +pkg go/token, const BREAK Token +pkg go/token, const CASE Token +pkg go/token, const CHAN Token +pkg go/token, const CHAR Token +pkg go/token, const COLON Token +pkg go/token, const COMMA Token +pkg go/token, const COMMENT Token +pkg go/token, const CONST Token +pkg go/token, const CONTINUE Token +pkg go/token, const DEC Token +pkg go/token, const DEFAULT Token +pkg go/token, const DEFER Token +pkg go/token, const DEFINE Token +pkg go/token, const ELLIPSIS Token +pkg go/token, const ELSE Token +pkg go/token, const EOF Token +pkg go/token, const EQL Token +pkg go/token, const FALLTHROUGH Token +pkg go/token, const FLOAT Token +pkg go/token, const FOR Token +pkg go/token, const FUNC Token +pkg go/token, const GEQ Token +pkg go/token, const GO Token +pkg go/token, const GOTO Token +pkg go/token, const GTR Token +pkg go/token, const HighestPrec ideal-int +pkg go/token, const IDENT Token +pkg go/token, const IF Token +pkg go/token, const ILLEGAL Token +pkg go/token, const IMAG Token +pkg go/token, const IMPORT Token +pkg go/token, const INC Token +pkg go/token, const INT Token +pkg go/token, const INTERFACE Token +pkg go/token, const LAND Token +pkg go/token, const LBRACE Token +pkg go/token, const LBRACK Token +pkg go/token, const LEQ Token +pkg go/token, const LOR Token +pkg go/token, const LPAREN Token +pkg go/token, const LSS Token +pkg go/token, const LowestPrec ideal-int +pkg go/token, const MAP Token +pkg go/token, const MUL Token +pkg go/token, const MUL_ASSIGN Token +pkg go/token, const NEQ Token +pkg go/token, const NOT Token +pkg go/token, const NoPos Pos +pkg go/token, const OR Token +pkg go/token, const OR_ASSIGN Token +pkg go/token, const PACKAGE Token +pkg go/token, const PERIOD Token +pkg go/token, const QUO Token +pkg go/token, const QUO_ASSIGN Token +pkg go/token, const RANGE Token +pkg go/token, const RBRACE Token +pkg go/token, const RBRACK Token +pkg go/token, const REM Token +pkg go/token, const REM_ASSIGN Token +pkg go/token, const RETURN Token +pkg go/token, const RPAREN Token +pkg go/token, const SELECT Token +pkg go/token, const SEMICOLON Token +pkg go/token, const SHL Token +pkg go/token, const SHL_ASSIGN Token +pkg go/token, const SHR Token +pkg go/token, const SHR_ASSIGN Token +pkg go/token, const STRING Token +pkg go/token, const STRUCT Token +pkg go/token, const SUB Token +pkg go/token, const SUB_ASSIGN Token +pkg go/token, const SWITCH Token +pkg go/token, const TYPE Token +pkg go/token, const UnaryPrec ideal-int +pkg go/token, const VAR Token +pkg go/token, const XOR Token +pkg go/token, const XOR_ASSIGN Token +pkg go/token, func Lookup(string) Token +pkg go/token, func NewFileSet() *FileSet +pkg go/token, method (*File) AddLine(int) +pkg go/token, method (*File) AddLineInfo(int, string, int) +pkg go/token, method (*File) Base() int +pkg go/token, method (*File) Line(Pos) int +pkg go/token, method (*File) LineCount() int +pkg go/token, method (*File) Name() string +pkg go/token, method (*File) Offset(Pos) int +pkg go/token, method (*File) Pos(int) Pos +pkg go/token, method (*File) Position(Pos) Position +pkg go/token, method (*File) SetLines([]int) bool +pkg go/token, method (*File) SetLinesForContent([]uint8) +pkg go/token, method (*File) Size() int +pkg go/token, method (*FileSet) AddFile(string, int, int) *File +pkg go/token, method (*FileSet) Base() int +pkg go/token, method (*FileSet) File(Pos) *File +pkg go/token, method (*FileSet) Iterate(func(*File) bool) +pkg go/token, method (*FileSet) Position(Pos) Position +pkg go/token, method (*FileSet) Read(func(interface{}) error) error +pkg go/token, method (*FileSet) Write(func(interface{}) error) error +pkg go/token, method (*Position) IsValid() bool +pkg go/token, method (Pos) IsValid() bool +pkg go/token, method (Position) String() string +pkg go/token, method (Token) IsKeyword() bool +pkg go/token, method (Token) IsLiteral() bool +pkg go/token, method (Token) IsOperator() bool +pkg go/token, method (Token) Precedence() int +pkg go/token, method (Token) String() string +pkg go/token, type File struct +pkg go/token, type FileSet struct +pkg go/token, type Pos int +pkg go/token, type Position struct +pkg go/token, type Position struct, Column int +pkg go/token, type Position struct, Filename string +pkg go/token, type Position struct, Line int +pkg go/token, type Position struct, Offset int +pkg go/token, type Token int +pkg hash, type Hash interface { BlockSize, Reset, Size, Sum, Write } +pkg hash, type Hash interface, BlockSize() int +pkg hash, type Hash interface, Reset() +pkg hash, type Hash interface, Size() int +pkg hash, type Hash interface, Sum([]uint8) []uint8 +pkg hash, type Hash interface, Write([]uint8) (int, error) +pkg hash, type Hash32 interface { BlockSize, Reset, Size, Sum, Sum32, Write } +pkg hash, type Hash32 interface, BlockSize() int +pkg hash, type Hash32 interface, Reset() +pkg hash, type Hash32 interface, Size() int +pkg hash, type Hash32 interface, Sum([]uint8) []uint8 +pkg hash, type Hash32 interface, Sum32() uint32 +pkg hash, type Hash32 interface, Write([]uint8) (int, error) +pkg hash, type Hash64 interface { BlockSize, Reset, Size, Sum, Sum64, Write } +pkg hash, type Hash64 interface, BlockSize() int +pkg hash, type Hash64 interface, Reset() +pkg hash, type Hash64 interface, Size() int +pkg hash, type Hash64 interface, Sum([]uint8) []uint8 +pkg hash, type Hash64 interface, Sum64() uint64 +pkg hash, type Hash64 interface, Write([]uint8) (int, error) +pkg hash/adler32, const Size ideal-int +pkg hash/adler32, func Checksum([]uint8) uint32 +pkg hash/adler32, func New() hash.Hash32 +pkg hash/crc32, const Castagnoli ideal-int +pkg hash/crc32, const IEEE ideal-int +pkg hash/crc32, const Koopman ideal-int +pkg hash/crc32, const Size ideal-int +pkg hash/crc32, func Checksum([]uint8, *Table) uint32 +pkg hash/crc32, func ChecksumIEEE([]uint8) uint32 +pkg hash/crc32, func MakeTable(uint32) *Table +pkg hash/crc32, func New(*Table) hash.Hash32 +pkg hash/crc32, func NewIEEE() hash.Hash32 +pkg hash/crc32, func Update(uint32, *Table, []uint8) uint32 +pkg hash/crc32, type Table [256]uint32 +pkg hash/crc32, var IEEETable *Table +pkg hash/crc64, const ECMA ideal-int +pkg hash/crc64, const ISO ideal-int +pkg hash/crc64, const Size ideal-int +pkg hash/crc64, func Checksum([]uint8, *Table) uint64 +pkg hash/crc64, func MakeTable(uint64) *Table +pkg hash/crc64, func New(*Table) hash.Hash64 +pkg hash/crc64, func Update(uint64, *Table, []uint8) uint64 +pkg hash/crc64, type Table [256]uint64 +pkg hash/fnv, func New32() hash.Hash32 +pkg hash/fnv, func New32a() hash.Hash32 +pkg hash/fnv, func New64() hash.Hash64 +pkg hash/fnv, func New64a() hash.Hash64 +pkg html, func EscapeString(string) string +pkg html, func UnescapeString(string) string +pkg html/template, const ErrAmbigContext ErrorCode +pkg html/template, const ErrBadHTML ErrorCode +pkg html/template, const ErrBranchEnd ErrorCode +pkg html/template, const ErrEndContext ErrorCode +pkg html/template, const ErrNoSuchTemplate ErrorCode +pkg html/template, const ErrOutputContext ErrorCode +pkg html/template, const ErrPartialCharset ErrorCode +pkg html/template, const ErrPartialEscape ErrorCode +pkg html/template, const ErrRangeLoopReentry ErrorCode +pkg html/template, const ErrSlashAmbig ErrorCode +pkg html/template, const OK ErrorCode +pkg html/template, func HTMLEscape(io.Writer, []uint8) +pkg html/template, func HTMLEscapeString(string) string +pkg html/template, func HTMLEscaper(...interface{}) string +pkg html/template, func JSEscape(io.Writer, []uint8) +pkg html/template, func JSEscapeString(string) string +pkg html/template, func JSEscaper(...interface{}) string +pkg html/template, func Must(*Template, error) *Template +pkg html/template, func New(string) *Template +pkg html/template, func ParseFiles(...string) (*Template, error) +pkg html/template, func ParseGlob(string) (*Template, error) +pkg html/template, func URLQueryEscaper(...interface{}) string +pkg html/template, method (*Error) Error() string +pkg html/template, method (*Template) AddParseTree(string, *parse.Tree) (*Template, error) +pkg html/template, method (*Template) Clone() (*Template, error) +pkg html/template, method (*Template) Delims(string, string) *Template +pkg html/template, method (*Template) Execute(io.Writer, interface{}) error +pkg html/template, method (*Template) ExecuteTemplate(io.Writer, string, interface{}) error +pkg html/template, method (*Template) Funcs(FuncMap) *Template +pkg html/template, method (*Template) Lookup(string) *Template +pkg html/template, method (*Template) Name() string +pkg html/template, method (*Template) New(string) *Template +pkg html/template, method (*Template) Parse(string) (*Template, error) +pkg html/template, method (*Template) ParseFiles(...string) (*Template, error) +pkg html/template, method (*Template) ParseGlob(string) (*Template, error) +pkg html/template, method (*Template) Templates() []*Template +pkg html/template, type CSS string +pkg html/template, type Error struct +pkg html/template, type Error struct, Description string +pkg html/template, type Error struct, ErrorCode ErrorCode +pkg html/template, type Error struct, Line int +pkg html/template, type Error struct, Name string +pkg html/template, type ErrorCode int +pkg html/template, type FuncMap map[string]interface{} +pkg html/template, type HTML string +pkg html/template, type HTMLAttr string +pkg html/template, type JS string +pkg html/template, type JSStr string +pkg html/template, type Template struct +pkg html/template, type URL string +pkg image, const YCbCrSubsampleRatio420 YCbCrSubsampleRatio +pkg image, const YCbCrSubsampleRatio422 YCbCrSubsampleRatio +pkg image, const YCbCrSubsampleRatio444 YCbCrSubsampleRatio +pkg image, func Decode(io.Reader) (Image, string, error) +pkg image, func DecodeConfig(io.Reader) (Config, string, error) +pkg image, func NewAlpha(Rectangle) *Alpha +pkg image, func NewAlpha16(Rectangle) *Alpha16 +pkg image, func NewGray(Rectangle) *Gray +pkg image, func NewGray16(Rectangle) *Gray16 +pkg image, func NewNRGBA(Rectangle) *NRGBA +pkg image, func NewNRGBA64(Rectangle) *NRGBA64 +pkg image, func NewPaletted(Rectangle, color.Palette) *Paletted +pkg image, func NewRGBA(Rectangle) *RGBA +pkg image, func NewRGBA64(Rectangle) *RGBA64 +pkg image, func NewUniform(color.Color) *Uniform +pkg image, func NewYCbCr(Rectangle, YCbCrSubsampleRatio) *YCbCr +pkg image, func Pt(int, int) Point +pkg image, func Rect(int, int, int, int) Rectangle +pkg image, func RegisterFormat(string, string, func(io.Reader) (Image, error), func(io.Reader) (Config, error)) +pkg image, method (*Alpha) At(int, int) color.Color +pkg image, method (*Alpha) Bounds() Rectangle +pkg image, method (*Alpha) ColorModel() color.Model +pkg image, method (*Alpha) Opaque() bool +pkg image, method (*Alpha) PixOffset(int, int) int +pkg image, method (*Alpha) Set(int, int, color.Color) +pkg image, method (*Alpha) SetAlpha(int, int, color.Alpha) +pkg image, method (*Alpha) SubImage(Rectangle) Image +pkg image, method (*Alpha16) At(int, int) color.Color +pkg image, method (*Alpha16) Bounds() Rectangle +pkg image, method (*Alpha16) ColorModel() color.Model +pkg image, method (*Alpha16) Opaque() bool +pkg image, method (*Alpha16) PixOffset(int, int) int +pkg image, method (*Alpha16) Set(int, int, color.Color) +pkg image, method (*Alpha16) SetAlpha16(int, int, color.Alpha16) +pkg image, method (*Alpha16) SubImage(Rectangle) Image +pkg image, method (*Gray) At(int, int) color.Color +pkg image, method (*Gray) Bounds() Rectangle +pkg image, method (*Gray) ColorModel() color.Model +pkg image, method (*Gray) Opaque() bool +pkg image, method (*Gray) PixOffset(int, int) int +pkg image, method (*Gray) Set(int, int, color.Color) +pkg image, method (*Gray) SetGray(int, int, color.Gray) +pkg image, method (*Gray) SubImage(Rectangle) Image +pkg image, method (*Gray16) At(int, int) color.Color +pkg image, method (*Gray16) Bounds() Rectangle +pkg image, method (*Gray16) ColorModel() color.Model +pkg image, method (*Gray16) Opaque() bool +pkg image, method (*Gray16) PixOffset(int, int) int +pkg image, method (*Gray16) Set(int, int, color.Color) +pkg image, method (*Gray16) SetGray16(int, int, color.Gray16) +pkg image, method (*Gray16) SubImage(Rectangle) Image +pkg image, method (*NRGBA) At(int, int) color.Color +pkg image, method (*NRGBA) Bounds() Rectangle +pkg image, method (*NRGBA) ColorModel() color.Model +pkg image, method (*NRGBA) Opaque() bool +pkg image, method (*NRGBA) PixOffset(int, int) int +pkg image, method (*NRGBA) Set(int, int, color.Color) +pkg image, method (*NRGBA) SetNRGBA(int, int, color.NRGBA) +pkg image, method (*NRGBA) SubImage(Rectangle) Image +pkg image, method (*NRGBA64) At(int, int) color.Color +pkg image, method (*NRGBA64) Bounds() Rectangle +pkg image, method (*NRGBA64) ColorModel() color.Model +pkg image, method (*NRGBA64) Opaque() bool +pkg image, method (*NRGBA64) PixOffset(int, int) int +pkg image, method (*NRGBA64) Set(int, int, color.Color) +pkg image, method (*NRGBA64) SetNRGBA64(int, int, color.NRGBA64) +pkg image, method (*NRGBA64) SubImage(Rectangle) Image +pkg image, method (*Paletted) At(int, int) color.Color +pkg image, method (*Paletted) Bounds() Rectangle +pkg image, method (*Paletted) ColorIndexAt(int, int) uint8 +pkg image, method (*Paletted) ColorModel() color.Model +pkg image, method (*Paletted) Opaque() bool +pkg image, method (*Paletted) PixOffset(int, int) int +pkg image, method (*Paletted) Set(int, int, color.Color) +pkg image, method (*Paletted) SetColorIndex(int, int, uint8) +pkg image, method (*Paletted) SubImage(Rectangle) Image +pkg image, method (*RGBA) At(int, int) color.Color +pkg image, method (*RGBA) Bounds() Rectangle +pkg image, method (*RGBA) ColorModel() color.Model +pkg image, method (*RGBA) Opaque() bool +pkg image, method (*RGBA) PixOffset(int, int) int +pkg image, method (*RGBA) Set(int, int, color.Color) +pkg image, method (*RGBA) SetRGBA(int, int, color.RGBA) +pkg image, method (*RGBA) SubImage(Rectangle) Image +pkg image, method (*RGBA64) At(int, int) color.Color +pkg image, method (*RGBA64) Bounds() Rectangle +pkg image, method (*RGBA64) ColorModel() color.Model +pkg image, method (*RGBA64) Opaque() bool +pkg image, method (*RGBA64) PixOffset(int, int) int +pkg image, method (*RGBA64) Set(int, int, color.Color) +pkg image, method (*RGBA64) SetRGBA64(int, int, color.RGBA64) +pkg image, method (*RGBA64) SubImage(Rectangle) Image +pkg image, method (*Uniform) At(int, int) color.Color +pkg image, method (*Uniform) Bounds() Rectangle +pkg image, method (*Uniform) ColorModel() color.Model +pkg image, method (*Uniform) Convert(color.Color) color.Color +pkg image, method (*Uniform) Opaque() bool +pkg image, method (*Uniform) RGBA() (uint32, uint32, uint32, uint32) +pkg image, method (*YCbCr) At(int, int) color.Color +pkg image, method (*YCbCr) Bounds() Rectangle +pkg image, method (*YCbCr) COffset(int, int) int +pkg image, method (*YCbCr) ColorModel() color.Model +pkg image, method (*YCbCr) Opaque() bool +pkg image, method (*YCbCr) SubImage(Rectangle) Image +pkg image, method (*YCbCr) YOffset(int, int) int +pkg image, method (Point) Add(Point) Point +pkg image, method (Point) Div(int) Point +pkg image, method (Point) Eq(Point) bool +pkg image, method (Point) In(Rectangle) bool +pkg image, method (Point) Mod(Rectangle) Point +pkg image, method (Point) Mul(int) Point +pkg image, method (Point) String() string +pkg image, method (Point) Sub(Point) Point +pkg image, method (Rectangle) Add(Point) Rectangle +pkg image, method (Rectangle) Canon() Rectangle +pkg image, method (Rectangle) Dx() int +pkg image, method (Rectangle) Dy() int +pkg image, method (Rectangle) Empty() bool +pkg image, method (Rectangle) Eq(Rectangle) bool +pkg image, method (Rectangle) In(Rectangle) bool +pkg image, method (Rectangle) Inset(int) Rectangle +pkg image, method (Rectangle) Intersect(Rectangle) Rectangle +pkg image, method (Rectangle) Overlaps(Rectangle) bool +pkg image, method (Rectangle) Size() Point +pkg image, method (Rectangle) String() string +pkg image, method (Rectangle) Sub(Point) Rectangle +pkg image, method (Rectangle) Union(Rectangle) Rectangle +pkg image, method (YCbCrSubsampleRatio) String() string +pkg image, type Alpha struct +pkg image, type Alpha struct, Pix []uint8 +pkg image, type Alpha struct, Rect Rectangle +pkg image, type Alpha struct, Stride int +pkg image, type Alpha16 struct +pkg image, type Alpha16 struct, Pix []uint8 +pkg image, type Alpha16 struct, Rect Rectangle +pkg image, type Alpha16 struct, Stride int +pkg image, type Config struct +pkg image, type Config struct, ColorModel color.Model +pkg image, type Config struct, Height int +pkg image, type Config struct, Width int +pkg image, type Gray struct +pkg image, type Gray struct, Pix []uint8 +pkg image, type Gray struct, Rect Rectangle +pkg image, type Gray struct, Stride int +pkg image, type Gray16 struct +pkg image, type Gray16 struct, Pix []uint8 +pkg image, type Gray16 struct, Rect Rectangle +pkg image, type Gray16 struct, Stride int +pkg image, type Image interface { At, Bounds, ColorModel } +pkg image, type Image interface, At(int, int) color.Color +pkg image, type Image interface, Bounds() Rectangle +pkg image, type Image interface, ColorModel() color.Model +pkg image, type NRGBA struct +pkg image, type NRGBA struct, Pix []uint8 +pkg image, type NRGBA struct, Rect Rectangle +pkg image, type NRGBA struct, Stride int +pkg image, type NRGBA64 struct +pkg image, type NRGBA64 struct, Pix []uint8 +pkg image, type NRGBA64 struct, Rect Rectangle +pkg image, type NRGBA64 struct, Stride int +pkg image, type Paletted struct +pkg image, type Paletted struct, Palette color.Palette +pkg image, type Paletted struct, Pix []uint8 +pkg image, type Paletted struct, Rect Rectangle +pkg image, type Paletted struct, Stride int +pkg image, type PalettedImage interface { At, Bounds, ColorIndexAt, ColorModel } +pkg image, type PalettedImage interface, At(int, int) color.Color +pkg image, type PalettedImage interface, Bounds() Rectangle +pkg image, type PalettedImage interface, ColorIndexAt(int, int) uint8 +pkg image, type PalettedImage interface, ColorModel() color.Model +pkg image, type Point struct +pkg image, type Point struct, X int +pkg image, type Point struct, Y int +pkg image, type RGBA struct +pkg image, type RGBA struct, Pix []uint8 +pkg image, type RGBA struct, Rect Rectangle +pkg image, type RGBA struct, Stride int +pkg image, type RGBA64 struct +pkg image, type RGBA64 struct, Pix []uint8 +pkg image, type RGBA64 struct, Rect Rectangle +pkg image, type RGBA64 struct, Stride int +pkg image, type Rectangle struct +pkg image, type Rectangle struct, Max Point +pkg image, type Rectangle struct, Min Point +pkg image, type Uniform struct +pkg image, type Uniform struct, C color.Color +pkg image, type YCbCr struct +pkg image, type YCbCr struct, CStride int +pkg image, type YCbCr struct, Cb []uint8 +pkg image, type YCbCr struct, Cr []uint8 +pkg image, type YCbCr struct, Rect Rectangle +pkg image, type YCbCr struct, SubsampleRatio YCbCrSubsampleRatio +pkg image, type YCbCr struct, Y []uint8 +pkg image, type YCbCr struct, YStride int +pkg image, type YCbCrSubsampleRatio int +pkg image, var Black *Uniform +pkg image, var ErrFormat error +pkg image, var Opaque *Uniform +pkg image, var Transparent *Uniform +pkg image, var White *Uniform +pkg image, var ZP Point +pkg image, var ZR Rectangle +pkg image/color, func ModelFunc(func(Color) Color) Model +pkg image/color, func RGBToYCbCr(uint8, uint8, uint8) (uint8, uint8, uint8) +pkg image/color, func YCbCrToRGB(uint8, uint8, uint8) (uint8, uint8, uint8) +pkg image/color, method (Alpha) RGBA() (uint32, uint32, uint32, uint32) +pkg image/color, method (Alpha16) RGBA() (uint32, uint32, uint32, uint32) +pkg image/color, method (Gray) RGBA() (uint32, uint32, uint32, uint32) +pkg image/color, method (Gray16) RGBA() (uint32, uint32, uint32, uint32) +pkg image/color, method (NRGBA) RGBA() (uint32, uint32, uint32, uint32) +pkg image/color, method (NRGBA64) RGBA() (uint32, uint32, uint32, uint32) +pkg image/color, method (Palette) Convert(Color) Color +pkg image/color, method (Palette) Index(Color) int +pkg image/color, method (RGBA) RGBA() (uint32, uint32, uint32, uint32) +pkg image/color, method (RGBA64) RGBA() (uint32, uint32, uint32, uint32) +pkg image/color, method (YCbCr) RGBA() (uint32, uint32, uint32, uint32) +pkg image/color, type Alpha struct +pkg image/color, type Alpha struct, A uint8 +pkg image/color, type Alpha16 struct +pkg image/color, type Alpha16 struct, A uint16 +pkg image/color, type Color interface { RGBA } +pkg image/color, type Color interface, RGBA() (uint32, uint32, uint32, uint32) +pkg image/color, type Gray struct +pkg image/color, type Gray struct, Y uint8 +pkg image/color, type Gray16 struct +pkg image/color, type Gray16 struct, Y uint16 +pkg image/color, type Model interface { Convert } +pkg image/color, type Model interface, Convert(Color) Color +pkg image/color, type NRGBA struct +pkg image/color, type NRGBA struct, A uint8 +pkg image/color, type NRGBA struct, B uint8 +pkg image/color, type NRGBA struct, G uint8 +pkg image/color, type NRGBA struct, R uint8 +pkg image/color, type NRGBA64 struct +pkg image/color, type NRGBA64 struct, A uint16 +pkg image/color, type NRGBA64 struct, B uint16 +pkg image/color, type NRGBA64 struct, G uint16 +pkg image/color, type NRGBA64 struct, R uint16 +pkg image/color, type Palette []Color +pkg image/color, type RGBA struct +pkg image/color, type RGBA struct, A uint8 +pkg image/color, type RGBA struct, B uint8 +pkg image/color, type RGBA struct, G uint8 +pkg image/color, type RGBA struct, R uint8 +pkg image/color, type RGBA64 struct +pkg image/color, type RGBA64 struct, A uint16 +pkg image/color, type RGBA64 struct, B uint16 +pkg image/color, type RGBA64 struct, G uint16 +pkg image/color, type RGBA64 struct, R uint16 +pkg image/color, type YCbCr struct +pkg image/color, type YCbCr struct, Cb uint8 +pkg image/color, type YCbCr struct, Cr uint8 +pkg image/color, type YCbCr struct, Y uint8 +pkg image/color, var Alpha16Model Model +pkg image/color, var AlphaModel Model +pkg image/color, var Black Gray16 +pkg image/color, var Gray16Model Model +pkg image/color, var GrayModel Model +pkg image/color, var NRGBA64Model Model +pkg image/color, var NRGBAModel Model +pkg image/color, var Opaque Alpha16 +pkg image/color, var RGBA64Model Model +pkg image/color, var RGBAModel Model +pkg image/color, var Transparent Alpha16 +pkg image/color, var White Gray16 +pkg image/color, var YCbCrModel Model +pkg image/draw, const Over Op +pkg image/draw, const Src Op +pkg image/draw, func Draw(Image, image.Rectangle, image.Image, image.Point, Op) +pkg image/draw, func DrawMask(Image, image.Rectangle, image.Image, image.Point, image.Image, image.Point, Op) +pkg image/draw, type Image interface { At, Bounds, ColorModel, Set } +pkg image/draw, type Image interface, At(int, int) color.Color +pkg image/draw, type Image interface, Bounds() image.Rectangle +pkg image/draw, type Image interface, ColorModel() color.Model +pkg image/draw, type Image interface, Set(int, int, color.Color) +pkg image/draw, type Op int +pkg image/gif, func Decode(io.Reader) (image.Image, error) +pkg image/gif, func DecodeAll(io.Reader) (*GIF, error) +pkg image/gif, func DecodeConfig(io.Reader) (image.Config, error) +pkg image/gif, type GIF struct +pkg image/gif, type GIF struct, Delay []int +pkg image/gif, type GIF struct, Image []*image.Paletted +pkg image/gif, type GIF struct, LoopCount int +pkg image/jpeg, const DefaultQuality ideal-int +pkg image/jpeg, func Decode(io.Reader) (image.Image, error) +pkg image/jpeg, func DecodeConfig(io.Reader) (image.Config, error) +pkg image/jpeg, func Encode(io.Writer, image.Image, *Options) error +pkg image/jpeg, method (FormatError) Error() string +pkg image/jpeg, method (UnsupportedError) Error() string +pkg image/jpeg, type FormatError string +pkg image/jpeg, type Options struct +pkg image/jpeg, type Options struct, Quality int +pkg image/jpeg, type Reader interface { Read, ReadByte } +pkg image/jpeg, type Reader interface, Read([]uint8) (int, error) +pkg image/jpeg, type Reader interface, ReadByte() (uint8, error) +pkg image/jpeg, type UnsupportedError string +pkg image/png, func Decode(io.Reader) (image.Image, error) +pkg image/png, func DecodeConfig(io.Reader) (image.Config, error) +pkg image/png, func Encode(io.Writer, image.Image) error +pkg image/png, method (FormatError) Error() string +pkg image/png, method (UnsupportedError) Error() string +pkg image/png, type FormatError string +pkg image/png, type UnsupportedError string +pkg index/suffixarray, func New([]uint8) *Index +pkg index/suffixarray, method (*Index) Bytes() []uint8 +pkg index/suffixarray, method (*Index) FindAllIndex(*regexp.Regexp, int) [][]int +pkg index/suffixarray, method (*Index) Lookup([]uint8, int) []int +pkg index/suffixarray, method (*Index) Read(io.Reader) error +pkg index/suffixarray, method (*Index) Write(io.Writer) error +pkg index/suffixarray, type Index struct +pkg io, func Copy(Writer, Reader) (int64, error) +pkg io, func CopyN(Writer, Reader, int64) (int64, error) +pkg io, func LimitReader(Reader, int64) Reader +pkg io, func MultiReader(...Reader) Reader +pkg io, func MultiWriter(...Writer) Writer +pkg io, func NewSectionReader(ReaderAt, int64, int64) *SectionReader +pkg io, func Pipe() (*PipeReader, *PipeWriter) +pkg io, func ReadAtLeast(Reader, []uint8, int) (int, error) +pkg io, func ReadFull(Reader, []uint8) (int, error) +pkg io, func TeeReader(Reader, Writer) Reader +pkg io, func WriteString(Writer, string) (int, error) +pkg io, method (*LimitedReader) Read([]uint8) (int, error) +pkg io, method (*PipeReader) Close() error +pkg io, method (*PipeReader) CloseWithError(error) error +pkg io, method (*PipeReader) Read([]uint8) (int, error) +pkg io, method (*PipeWriter) Close() error +pkg io, method (*PipeWriter) CloseWithError(error) error +pkg io, method (*PipeWriter) Write([]uint8) (int, error) +pkg io, method (*SectionReader) Read([]uint8) (int, error) +pkg io, method (*SectionReader) ReadAt([]uint8, int64) (int, error) +pkg io, method (*SectionReader) Seek(int64, int) (int64, error) +pkg io, method (*SectionReader) Size() int64 +pkg io, type ByteReader interface { ReadByte } +pkg io, type ByteReader interface, ReadByte() (uint8, error) +pkg io, type ByteScanner interface { ReadByte, UnreadByte } +pkg io, type ByteScanner interface, ReadByte() (uint8, error) +pkg io, type ByteScanner interface, UnreadByte() error +pkg io, type Closer interface { Close } +pkg io, type Closer interface, Close() error +pkg io, type LimitedReader struct +pkg io, type LimitedReader struct, N int64 +pkg io, type LimitedReader struct, R Reader +pkg io, type PipeReader struct +pkg io, type PipeWriter struct +pkg io, type ReadCloser interface { Close, Read } +pkg io, type ReadCloser interface, Close() error +pkg io, type ReadCloser interface, Read([]uint8) (int, error) +pkg io, type ReadSeeker interface { Read, Seek } +pkg io, type ReadSeeker interface, Read([]uint8) (int, error) +pkg io, type ReadSeeker interface, Seek(int64, int) (int64, error) +pkg io, type ReadWriteCloser interface { Close, Read, Write } +pkg io, type ReadWriteCloser interface, Close() error +pkg io, type ReadWriteCloser interface, Read([]uint8) (int, error) +pkg io, type ReadWriteCloser interface, Write([]uint8) (int, error) +pkg io, type ReadWriteSeeker interface { Read, Seek, Write } +pkg io, type ReadWriteSeeker interface, Read([]uint8) (int, error) +pkg io, type ReadWriteSeeker interface, Seek(int64, int) (int64, error) +pkg io, type ReadWriteSeeker interface, Write([]uint8) (int, error) +pkg io, type ReadWriter interface { Read, Write } +pkg io, type ReadWriter interface, Read([]uint8) (int, error) +pkg io, type ReadWriter interface, Write([]uint8) (int, error) +pkg io, type Reader interface { Read } +pkg io, type Reader interface, Read([]uint8) (int, error) +pkg io, type ReaderAt interface { ReadAt } +pkg io, type ReaderAt interface, ReadAt([]uint8, int64) (int, error) +pkg io, type ReaderFrom interface { ReadFrom } +pkg io, type ReaderFrom interface, ReadFrom(Reader) (int64, error) +pkg io, type RuneReader interface { ReadRune } +pkg io, type RuneReader interface, ReadRune() (int32, int, error) +pkg io, type RuneScanner interface { ReadRune, UnreadRune } +pkg io, type RuneScanner interface, ReadRune() (int32, int, error) +pkg io, type RuneScanner interface, UnreadRune() error +pkg io, type SectionReader struct +pkg io, type Seeker interface { Seek } +pkg io, type Seeker interface, Seek(int64, int) (int64, error) +pkg io, type WriteCloser interface { Close, Write } +pkg io, type WriteCloser interface, Close() error +pkg io, type WriteCloser interface, Write([]uint8) (int, error) +pkg io, type WriteSeeker interface { Seek, Write } +pkg io, type WriteSeeker interface, Seek(int64, int) (int64, error) +pkg io, type WriteSeeker interface, Write([]uint8) (int, error) +pkg io, type Writer interface { Write } +pkg io, type Writer interface, Write([]uint8) (int, error) +pkg io, type WriterAt interface { WriteAt } +pkg io, type WriterAt interface, WriteAt([]uint8, int64) (int, error) +pkg io, type WriterTo interface { WriteTo } +pkg io, type WriterTo interface, WriteTo(Writer) (int64, error) +pkg io, var EOF error +pkg io, var ErrClosedPipe error +pkg io, var ErrShortBuffer error +pkg io, var ErrShortWrite error +pkg io, var ErrUnexpectedEOF error +pkg io/ioutil, func NopCloser(io.Reader) io.ReadCloser +pkg io/ioutil, func ReadAll(io.Reader) ([]uint8, error) +pkg io/ioutil, func ReadDir(string) ([]os.FileInfo, error) +pkg io/ioutil, func ReadFile(string) ([]uint8, error) +pkg io/ioutil, func TempDir(string, string) (string, error) +pkg io/ioutil, func TempFile(string, string) (*os.File, error) +pkg io/ioutil, func WriteFile(string, []uint8, os.FileMode) error +pkg io/ioutil, var Discard io.Writer +pkg log, const Ldate ideal-int +pkg log, const Llongfile ideal-int +pkg log, const Lmicroseconds ideal-int +pkg log, const Lshortfile ideal-int +pkg log, const LstdFlags ideal-int +pkg log, const Ltime ideal-int +pkg log, func Fatal(...interface{}) +pkg log, func Fatalf(string, ...interface{}) +pkg log, func Fatalln(...interface{}) +pkg log, func Flags() int +pkg log, func New(io.Writer, string, int) *Logger +pkg log, func Panic(...interface{}) +pkg log, func Panicf(string, ...interface{}) +pkg log, func Panicln(...interface{}) +pkg log, func Prefix() string +pkg log, func Print(...interface{}) +pkg log, func Printf(string, ...interface{}) +pkg log, func Println(...interface{}) +pkg log, func SetFlags(int) +pkg log, func SetOutput(io.Writer) +pkg log, func SetPrefix(string) +pkg log, method (*Logger) Fatal(...interface{}) +pkg log, method (*Logger) Fatalf(string, ...interface{}) +pkg log, method (*Logger) Fatalln(...interface{}) +pkg log, method (*Logger) Flags() int +pkg log, method (*Logger) Output(int, string) error +pkg log, method (*Logger) Panic(...interface{}) +pkg log, method (*Logger) Panicf(string, ...interface{}) +pkg log, method (*Logger) Panicln(...interface{}) +pkg log, method (*Logger) Prefix() string +pkg log, method (*Logger) Print(...interface{}) +pkg log, method (*Logger) Printf(string, ...interface{}) +pkg log, method (*Logger) Println(...interface{}) +pkg log, method (*Logger) SetFlags(int) +pkg log, method (*Logger) SetPrefix(string) +pkg log, type Logger struct +pkg log/syslog (darwin-386), const LOG_ALERT Priority +pkg log/syslog (darwin-386), const LOG_CRIT Priority +pkg log/syslog (darwin-386), const LOG_DEBUG Priority +pkg log/syslog (darwin-386), const LOG_EMERG Priority +pkg log/syslog (darwin-386), const LOG_ERR Priority +pkg log/syslog (darwin-386), const LOG_INFO Priority +pkg log/syslog (darwin-386), const LOG_NOTICE Priority +pkg log/syslog (darwin-386), const LOG_WARNING Priority +pkg log/syslog (darwin-386), func Dial(string, string, Priority, string) (*Writer, error) +pkg log/syslog (darwin-386), func New(Priority, string) (*Writer, error) +pkg log/syslog (darwin-386), func NewLogger(Priority, int) (*log.Logger, error) +pkg log/syslog (darwin-386), method (*Writer) Alert(string) error +pkg log/syslog (darwin-386), method (*Writer) Close() error +pkg log/syslog (darwin-386), method (*Writer) Crit(string) error +pkg log/syslog (darwin-386), method (*Writer) Debug(string) error +pkg log/syslog (darwin-386), method (*Writer) Emerg(string) error +pkg log/syslog (darwin-386), method (*Writer) Err(string) error +pkg log/syslog (darwin-386), method (*Writer) Info(string) error +pkg log/syslog (darwin-386), method (*Writer) Notice(string) error +pkg log/syslog (darwin-386), method (*Writer) Warning(string) error +pkg log/syslog (darwin-386), method (*Writer) Write([]uint8) (int, error) +pkg log/syslog (darwin-386), type Priority int +pkg log/syslog (darwin-386), type Writer struct +pkg log/syslog (darwin-386-cgo), const LOG_ALERT Priority +pkg log/syslog (darwin-386-cgo), const LOG_CRIT Priority +pkg log/syslog (darwin-386-cgo), const LOG_DEBUG Priority +pkg log/syslog (darwin-386-cgo), const LOG_EMERG Priority +pkg log/syslog (darwin-386-cgo), const LOG_ERR Priority +pkg log/syslog (darwin-386-cgo), const LOG_INFO Priority +pkg log/syslog (darwin-386-cgo), const LOG_NOTICE Priority +pkg log/syslog (darwin-386-cgo), const LOG_WARNING Priority +pkg log/syslog (darwin-386-cgo), func Dial(string, string, Priority, string) (*Writer, error) +pkg log/syslog (darwin-386-cgo), func New(Priority, string) (*Writer, error) +pkg log/syslog (darwin-386-cgo), func NewLogger(Priority, int) (*log.Logger, error) +pkg log/syslog (darwin-386-cgo), method (*Writer) Alert(string) error +pkg log/syslog (darwin-386-cgo), method (*Writer) Close() error +pkg log/syslog (darwin-386-cgo), method (*Writer) Crit(string) error +pkg log/syslog (darwin-386-cgo), method (*Writer) Debug(string) error +pkg log/syslog (darwin-386-cgo), method (*Writer) Emerg(string) error +pkg log/syslog (darwin-386-cgo), method (*Writer) Err(string) error +pkg log/syslog (darwin-386-cgo), method (*Writer) Info(string) error +pkg log/syslog (darwin-386-cgo), method (*Writer) Notice(string) error +pkg log/syslog (darwin-386-cgo), method (*Writer) Warning(string) error +pkg log/syslog (darwin-386-cgo), method (*Writer) Write([]uint8) (int, error) +pkg log/syslog (darwin-386-cgo), type Priority int +pkg log/syslog (darwin-386-cgo), type Writer struct +pkg log/syslog (darwin-amd64), const LOG_ALERT Priority +pkg log/syslog (darwin-amd64), const LOG_CRIT Priority +pkg log/syslog (darwin-amd64), const LOG_DEBUG Priority +pkg log/syslog (darwin-amd64), const LOG_EMERG Priority +pkg log/syslog (darwin-amd64), const LOG_ERR Priority +pkg log/syslog (darwin-amd64), const LOG_INFO Priority +pkg log/syslog (darwin-amd64), const LOG_NOTICE Priority +pkg log/syslog (darwin-amd64), const LOG_WARNING Priority +pkg log/syslog (darwin-amd64), func Dial(string, string, Priority, string) (*Writer, error) +pkg log/syslog (darwin-amd64), func New(Priority, string) (*Writer, error) +pkg log/syslog (darwin-amd64), func NewLogger(Priority, int) (*log.Logger, error) +pkg log/syslog (darwin-amd64), method (*Writer) Alert(string) error +pkg log/syslog (darwin-amd64), method (*Writer) Close() error +pkg log/syslog (darwin-amd64), method (*Writer) Crit(string) error +pkg log/syslog (darwin-amd64), method (*Writer) Debug(string) error +pkg log/syslog (darwin-amd64), method (*Writer) Emerg(string) error +pkg log/syslog (darwin-amd64), method (*Writer) Err(string) error +pkg log/syslog (darwin-amd64), method (*Writer) Info(string) error +pkg log/syslog (darwin-amd64), method (*Writer) Notice(string) error +pkg log/syslog (darwin-amd64), method (*Writer) Warning(string) error +pkg log/syslog (darwin-amd64), method (*Writer) Write([]uint8) (int, error) +pkg log/syslog (darwin-amd64), type Priority int +pkg log/syslog (darwin-amd64), type Writer struct +pkg log/syslog (darwin-amd64-cgo), const LOG_ALERT Priority +pkg log/syslog (darwin-amd64-cgo), const LOG_CRIT Priority +pkg log/syslog (darwin-amd64-cgo), const LOG_DEBUG Priority +pkg log/syslog (darwin-amd64-cgo), const LOG_EMERG Priority +pkg log/syslog (darwin-amd64-cgo), const LOG_ERR Priority +pkg log/syslog (darwin-amd64-cgo), const LOG_INFO Priority +pkg log/syslog (darwin-amd64-cgo), const LOG_NOTICE Priority +pkg log/syslog (darwin-amd64-cgo), const LOG_WARNING Priority +pkg log/syslog (darwin-amd64-cgo), func Dial(string, string, Priority, string) (*Writer, error) +pkg log/syslog (darwin-amd64-cgo), func New(Priority, string) (*Writer, error) +pkg log/syslog (darwin-amd64-cgo), func NewLogger(Priority, int) (*log.Logger, error) +pkg log/syslog (darwin-amd64-cgo), method (*Writer) Alert(string) error +pkg log/syslog (darwin-amd64-cgo), method (*Writer) Close() error +pkg log/syslog (darwin-amd64-cgo), method (*Writer) Crit(string) error +pkg log/syslog (darwin-amd64-cgo), method (*Writer) Debug(string) error +pkg log/syslog (darwin-amd64-cgo), method (*Writer) Emerg(string) error +pkg log/syslog (darwin-amd64-cgo), method (*Writer) Err(string) error +pkg log/syslog (darwin-amd64-cgo), method (*Writer) Info(string) error +pkg log/syslog (darwin-amd64-cgo), method (*Writer) Notice(string) error +pkg log/syslog (darwin-amd64-cgo), method (*Writer) Warning(string) error +pkg log/syslog (darwin-amd64-cgo), method (*Writer) Write([]uint8) (int, error) +pkg log/syslog (darwin-amd64-cgo), type Priority int +pkg log/syslog (darwin-amd64-cgo), type Writer struct +pkg log/syslog (freebsd-386), const LOG_ALERT Priority +pkg log/syslog (freebsd-386), const LOG_CRIT Priority +pkg log/syslog (freebsd-386), const LOG_DEBUG Priority +pkg log/syslog (freebsd-386), const LOG_EMERG Priority +pkg log/syslog (freebsd-386), const LOG_ERR Priority +pkg log/syslog (freebsd-386), const LOG_INFO Priority +pkg log/syslog (freebsd-386), const LOG_NOTICE Priority +pkg log/syslog (freebsd-386), const LOG_WARNING Priority +pkg log/syslog (freebsd-386), func Dial(string, string, Priority, string) (*Writer, error) +pkg log/syslog (freebsd-386), func New(Priority, string) (*Writer, error) +pkg log/syslog (freebsd-386), func NewLogger(Priority, int) (*log.Logger, error) +pkg log/syslog (freebsd-386), method (*Writer) Alert(string) error +pkg log/syslog (freebsd-386), method (*Writer) Close() error +pkg log/syslog (freebsd-386), method (*Writer) Crit(string) error +pkg log/syslog (freebsd-386), method (*Writer) Debug(string) error +pkg log/syslog (freebsd-386), method (*Writer) Emerg(string) error +pkg log/syslog (freebsd-386), method (*Writer) Err(string) error +pkg log/syslog (freebsd-386), method (*Writer) Info(string) error +pkg log/syslog (freebsd-386), method (*Writer) Notice(string) error +pkg log/syslog (freebsd-386), method (*Writer) Warning(string) error +pkg log/syslog (freebsd-386), method (*Writer) Write([]uint8) (int, error) +pkg log/syslog (freebsd-386), type Priority int +pkg log/syslog (freebsd-386), type Writer struct +pkg log/syslog (freebsd-amd64), const LOG_ALERT Priority +pkg log/syslog (freebsd-amd64), const LOG_CRIT Priority +pkg log/syslog (freebsd-amd64), const LOG_DEBUG Priority +pkg log/syslog (freebsd-amd64), const LOG_EMERG Priority +pkg log/syslog (freebsd-amd64), const LOG_ERR Priority +pkg log/syslog (freebsd-amd64), const LOG_INFO Priority +pkg log/syslog (freebsd-amd64), const LOG_NOTICE Priority +pkg log/syslog (freebsd-amd64), const LOG_WARNING Priority +pkg log/syslog (freebsd-amd64), func Dial(string, string, Priority, string) (*Writer, error) +pkg log/syslog (freebsd-amd64), func New(Priority, string) (*Writer, error) +pkg log/syslog (freebsd-amd64), func NewLogger(Priority, int) (*log.Logger, error) +pkg log/syslog (freebsd-amd64), method (*Writer) Alert(string) error +pkg log/syslog (freebsd-amd64), method (*Writer) Close() error +pkg log/syslog (freebsd-amd64), method (*Writer) Crit(string) error +pkg log/syslog (freebsd-amd64), method (*Writer) Debug(string) error +pkg log/syslog (freebsd-amd64), method (*Writer) Emerg(string) error +pkg log/syslog (freebsd-amd64), method (*Writer) Err(string) error +pkg log/syslog (freebsd-amd64), method (*Writer) Info(string) error +pkg log/syslog (freebsd-amd64), method (*Writer) Notice(string) error +pkg log/syslog (freebsd-amd64), method (*Writer) Warning(string) error +pkg log/syslog (freebsd-amd64), method (*Writer) Write([]uint8) (int, error) +pkg log/syslog (freebsd-amd64), type Priority int +pkg log/syslog (freebsd-amd64), type Writer struct +pkg log/syslog (linux-386), const LOG_ALERT Priority +pkg log/syslog (linux-386), const LOG_CRIT Priority +pkg log/syslog (linux-386), const LOG_DEBUG Priority +pkg log/syslog (linux-386), const LOG_EMERG Priority +pkg log/syslog (linux-386), const LOG_ERR Priority +pkg log/syslog (linux-386), const LOG_INFO Priority +pkg log/syslog (linux-386), const LOG_NOTICE Priority +pkg log/syslog (linux-386), const LOG_WARNING Priority +pkg log/syslog (linux-386), func Dial(string, string, Priority, string) (*Writer, error) +pkg log/syslog (linux-386), func New(Priority, string) (*Writer, error) +pkg log/syslog (linux-386), func NewLogger(Priority, int) (*log.Logger, error) +pkg log/syslog (linux-386), method (*Writer) Alert(string) error +pkg log/syslog (linux-386), method (*Writer) Close() error +pkg log/syslog (linux-386), method (*Writer) Crit(string) error +pkg log/syslog (linux-386), method (*Writer) Debug(string) error +pkg log/syslog (linux-386), method (*Writer) Emerg(string) error +pkg log/syslog (linux-386), method (*Writer) Err(string) error +pkg log/syslog (linux-386), method (*Writer) Info(string) error +pkg log/syslog (linux-386), method (*Writer) Notice(string) error +pkg log/syslog (linux-386), method (*Writer) Warning(string) error +pkg log/syslog (linux-386), method (*Writer) Write([]uint8) (int, error) +pkg log/syslog (linux-386), type Priority int +pkg log/syslog (linux-386), type Writer struct +pkg log/syslog (linux-386-cgo), const LOG_ALERT Priority +pkg log/syslog (linux-386-cgo), const LOG_CRIT Priority +pkg log/syslog (linux-386-cgo), const LOG_DEBUG Priority +pkg log/syslog (linux-386-cgo), const LOG_EMERG Priority +pkg log/syslog (linux-386-cgo), const LOG_ERR Priority +pkg log/syslog (linux-386-cgo), const LOG_INFO Priority +pkg log/syslog (linux-386-cgo), const LOG_NOTICE Priority +pkg log/syslog (linux-386-cgo), const LOG_WARNING Priority +pkg log/syslog (linux-386-cgo), func Dial(string, string, Priority, string) (*Writer, error) +pkg log/syslog (linux-386-cgo), func New(Priority, string) (*Writer, error) +pkg log/syslog (linux-386-cgo), func NewLogger(Priority, int) (*log.Logger, error) +pkg log/syslog (linux-386-cgo), method (*Writer) Alert(string) error +pkg log/syslog (linux-386-cgo), method (*Writer) Close() error +pkg log/syslog (linux-386-cgo), method (*Writer) Crit(string) error +pkg log/syslog (linux-386-cgo), method (*Writer) Debug(string) error +pkg log/syslog (linux-386-cgo), method (*Writer) Emerg(string) error +pkg log/syslog (linux-386-cgo), method (*Writer) Err(string) error +pkg log/syslog (linux-386-cgo), method (*Writer) Info(string) error +pkg log/syslog (linux-386-cgo), method (*Writer) Notice(string) error +pkg log/syslog (linux-386-cgo), method (*Writer) Warning(string) error +pkg log/syslog (linux-386-cgo), method (*Writer) Write([]uint8) (int, error) +pkg log/syslog (linux-386-cgo), type Priority int +pkg log/syslog (linux-386-cgo), type Writer struct +pkg log/syslog (linux-amd64), const LOG_ALERT Priority +pkg log/syslog (linux-amd64), const LOG_CRIT Priority +pkg log/syslog (linux-amd64), const LOG_DEBUG Priority +pkg log/syslog (linux-amd64), const LOG_EMERG Priority +pkg log/syslog (linux-amd64), const LOG_ERR Priority +pkg log/syslog (linux-amd64), const LOG_INFO Priority +pkg log/syslog (linux-amd64), const LOG_NOTICE Priority +pkg log/syslog (linux-amd64), const LOG_WARNING Priority +pkg log/syslog (linux-amd64), func Dial(string, string, Priority, string) (*Writer, error) +pkg log/syslog (linux-amd64), func New(Priority, string) (*Writer, error) +pkg log/syslog (linux-amd64), func NewLogger(Priority, int) (*log.Logger, error) +pkg log/syslog (linux-amd64), method (*Writer) Alert(string) error +pkg log/syslog (linux-amd64), method (*Writer) Close() error +pkg log/syslog (linux-amd64), method (*Writer) Crit(string) error +pkg log/syslog (linux-amd64), method (*Writer) Debug(string) error +pkg log/syslog (linux-amd64), method (*Writer) Emerg(string) error +pkg log/syslog (linux-amd64), method (*Writer) Err(string) error +pkg log/syslog (linux-amd64), method (*Writer) Info(string) error +pkg log/syslog (linux-amd64), method (*Writer) Notice(string) error +pkg log/syslog (linux-amd64), method (*Writer) Warning(string) error +pkg log/syslog (linux-amd64), method (*Writer) Write([]uint8) (int, error) +pkg log/syslog (linux-amd64), type Priority int +pkg log/syslog (linux-amd64), type Writer struct +pkg log/syslog (linux-amd64-cgo), const LOG_ALERT Priority +pkg log/syslog (linux-amd64-cgo), const LOG_CRIT Priority +pkg log/syslog (linux-amd64-cgo), const LOG_DEBUG Priority +pkg log/syslog (linux-amd64-cgo), const LOG_EMERG Priority +pkg log/syslog (linux-amd64-cgo), const LOG_ERR Priority +pkg log/syslog (linux-amd64-cgo), const LOG_INFO Priority +pkg log/syslog (linux-amd64-cgo), const LOG_NOTICE Priority +pkg log/syslog (linux-amd64-cgo), const LOG_WARNING Priority +pkg log/syslog (linux-amd64-cgo), func Dial(string, string, Priority, string) (*Writer, error) +pkg log/syslog (linux-amd64-cgo), func New(Priority, string) (*Writer, error) +pkg log/syslog (linux-amd64-cgo), func NewLogger(Priority, int) (*log.Logger, error) +pkg log/syslog (linux-amd64-cgo), method (*Writer) Alert(string) error +pkg log/syslog (linux-amd64-cgo), method (*Writer) Close() error +pkg log/syslog (linux-amd64-cgo), method (*Writer) Crit(string) error +pkg log/syslog (linux-amd64-cgo), method (*Writer) Debug(string) error +pkg log/syslog (linux-amd64-cgo), method (*Writer) Emerg(string) error +pkg log/syslog (linux-amd64-cgo), method (*Writer) Err(string) error +pkg log/syslog (linux-amd64-cgo), method (*Writer) Info(string) error +pkg log/syslog (linux-amd64-cgo), method (*Writer) Notice(string) error +pkg log/syslog (linux-amd64-cgo), method (*Writer) Warning(string) error +pkg log/syslog (linux-amd64-cgo), method (*Writer) Write([]uint8) (int, error) +pkg log/syslog (linux-amd64-cgo), type Priority int +pkg log/syslog (linux-amd64-cgo), type Writer struct +pkg log/syslog (linux-arm), const LOG_ALERT Priority +pkg log/syslog (linux-arm), const LOG_CRIT Priority +pkg log/syslog (linux-arm), const LOG_DEBUG Priority +pkg log/syslog (linux-arm), const LOG_EMERG Priority +pkg log/syslog (linux-arm), const LOG_ERR Priority +pkg log/syslog (linux-arm), const LOG_INFO Priority +pkg log/syslog (linux-arm), const LOG_NOTICE Priority +pkg log/syslog (linux-arm), const LOG_WARNING Priority +pkg log/syslog (linux-arm), func Dial(string, string, Priority, string) (*Writer, error) +pkg log/syslog (linux-arm), func New(Priority, string) (*Writer, error) +pkg log/syslog (linux-arm), func NewLogger(Priority, int) (*log.Logger, error) +pkg log/syslog (linux-arm), method (*Writer) Alert(string) error +pkg log/syslog (linux-arm), method (*Writer) Close() error +pkg log/syslog (linux-arm), method (*Writer) Crit(string) error +pkg log/syslog (linux-arm), method (*Writer) Debug(string) error +pkg log/syslog (linux-arm), method (*Writer) Emerg(string) error +pkg log/syslog (linux-arm), method (*Writer) Err(string) error +pkg log/syslog (linux-arm), method (*Writer) Info(string) error +pkg log/syslog (linux-arm), method (*Writer) Notice(string) error +pkg log/syslog (linux-arm), method (*Writer) Warning(string) error +pkg log/syslog (linux-arm), method (*Writer) Write([]uint8) (int, error) +pkg log/syslog (linux-arm), type Priority int +pkg log/syslog (linux-arm), type Writer struct +pkg math, const E ideal-float +pkg math, const Ln10 ideal-float +pkg math, const Ln2 ideal-float +pkg math, const Log10E ideal-float +pkg math, const Log2E ideal-float +pkg math, const MaxFloat32 ideal-float +pkg math, const MaxFloat64 ideal-float +pkg math, const MaxInt16 ideal-int +pkg math, const MaxInt32 ideal-int +pkg math, const MaxInt64 ideal-int +pkg math, const MaxInt8 ideal-int +pkg math, const MaxUint16 ideal-int +pkg math, const MaxUint32 ideal-int +pkg math, const MaxUint64 ideal-int +pkg math, const MaxUint8 ideal-int +pkg math, const MinInt16 ideal-int +pkg math, const MinInt32 ideal-int +pkg math, const MinInt64 ideal-int +pkg math, const MinInt8 ideal-int +pkg math, const Phi ideal-float +pkg math, const Pi ideal-float +pkg math, const SmallestNonzeroFloat32 ideal-float +pkg math, const SmallestNonzeroFloat64 ideal-float +pkg math, const Sqrt2 ideal-float +pkg math, const SqrtE ideal-float +pkg math, const SqrtPhi ideal-float +pkg math, const SqrtPi ideal-float +pkg math, func Abs(float64) float64 +pkg math, func Acos(float64) float64 +pkg math, func Acosh(float64) float64 +pkg math, func Asin(float64) float64 +pkg math, func Asinh(float64) float64 +pkg math, func Atan(float64) float64 +pkg math, func Atan2(float64, float64) float64 +pkg math, func Atanh(float64) float64 +pkg math, func Cbrt(float64) float64 +pkg math, func Ceil(float64) float64 +pkg math, func Copysign(float64, float64) float64 +pkg math, func Cos(float64) float64 +pkg math, func Cosh(float64) float64 +pkg math, func Dim(float64, float64) float64 +pkg math, func Erf(float64) float64 +pkg math, func Erfc(float64) float64 +pkg math, func Exp(float64) float64 +pkg math, func Exp2(float64) float64 +pkg math, func Expm1(float64) float64 +pkg math, func Float32bits(float32) uint32 +pkg math, func Float32frombits(uint32) float32 +pkg math, func Float64bits(float64) uint64 +pkg math, func Float64frombits(uint64) float64 +pkg math, func Floor(float64) float64 +pkg math, func Frexp(float64) (float64, int) +pkg math, func Gamma(float64) float64 +pkg math, func Hypot(float64, float64) float64 +pkg math, func Ilogb(float64) int +pkg math, func Inf(int) float64 +pkg math, func IsInf(float64, int) bool +pkg math, func IsNaN(float64) bool +pkg math, func J0(float64) float64 +pkg math, func J1(float64) float64 +pkg math, func Jn(int, float64) float64 +pkg math, func Ldexp(float64, int) float64 +pkg math, func Lgamma(float64) (float64, int) +pkg math, func Log(float64) float64 +pkg math, func Log10(float64) float64 +pkg math, func Log1p(float64) float64 +pkg math, func Log2(float64) float64 +pkg math, func Logb(float64) float64 +pkg math, func Max(float64, float64) float64 +pkg math, func Min(float64, float64) float64 +pkg math, func Mod(float64, float64) float64 +pkg math, func Modf(float64) (float64, float64) +pkg math, func NaN() float64 +pkg math, func Nextafter(float64, float64) float64 +pkg math, func Pow(float64, float64) float64 +pkg math, func Pow10(int) float64 +pkg math, func Remainder(float64, float64) float64 +pkg math, func Signbit(float64) bool +pkg math, func Sin(float64) float64 +pkg math, func Sincos(float64) (float64, float64) +pkg math, func Sinh(float64) float64 +pkg math, func Sqrt(float64) float64 +pkg math, func Tan(float64) float64 +pkg math, func Tanh(float64) float64 +pkg math, func Trunc(float64) float64 +pkg math, func Y0(float64) float64 +pkg math, func Y1(float64) float64 +pkg math, func Yn(int, float64) float64 +pkg math/big, const MaxBase ideal-char +pkg math/big, func NewInt(int64) *Int +pkg math/big, func NewRat(int64, int64) *Rat +pkg math/big, method (*Int) Abs(*Int) *Int +pkg math/big, method (*Int) Add(*Int, *Int) *Int +pkg math/big, method (*Int) And(*Int, *Int) *Int +pkg math/big, method (*Int) AndNot(*Int, *Int) *Int +pkg math/big, method (*Int) Binomial(int64, int64) *Int +pkg math/big, method (*Int) Bit(int) uint +pkg math/big, method (*Int) BitLen() int +pkg math/big, method (*Int) Bits() []Word +pkg math/big, method (*Int) Bytes() []uint8 +pkg math/big, method (*Int) Cmp(*Int) int +pkg math/big, method (*Int) Div(*Int, *Int) *Int +pkg math/big, method (*Int) DivMod(*Int, *Int, *Int) (*Int, *Int) +pkg math/big, method (*Int) Exp(*Int, *Int, *Int) *Int +pkg math/big, method (*Int) Format(fmt.State, int32) +pkg math/big, method (*Int) GCD(*Int, *Int, *Int, *Int) *Int +pkg math/big, method (*Int) GobDecode([]uint8) error +pkg math/big, method (*Int) GobEncode() ([]uint8, error) +pkg math/big, method (*Int) Int64() int64 +pkg math/big, method (*Int) Lsh(*Int, uint) *Int +pkg math/big, method (*Int) Mod(*Int, *Int) *Int +pkg math/big, method (*Int) ModInverse(*Int, *Int) *Int +pkg math/big, method (*Int) Mul(*Int, *Int) *Int +pkg math/big, method (*Int) MulRange(int64, int64) *Int +pkg math/big, method (*Int) Neg(*Int) *Int +pkg math/big, method (*Int) Not(*Int) *Int +pkg math/big, method (*Int) Or(*Int, *Int) *Int +pkg math/big, method (*Int) ProbablyPrime(int) bool +pkg math/big, method (*Int) Quo(*Int, *Int) *Int +pkg math/big, method (*Int) QuoRem(*Int, *Int, *Int) (*Int, *Int) +pkg math/big, method (*Int) Rand(*rand.Rand, *Int) *Int +pkg math/big, method (*Int) Rem(*Int, *Int) *Int +pkg math/big, method (*Int) Rsh(*Int, uint) *Int +pkg math/big, method (*Int) Scan(fmt.ScanState, int32) error +pkg math/big, method (*Int) Set(*Int) *Int +pkg math/big, method (*Int) SetBit(*Int, int, uint) *Int +pkg math/big, method (*Int) SetBits([]Word) *Int +pkg math/big, method (*Int) SetBytes([]uint8) *Int +pkg math/big, method (*Int) SetInt64(int64) *Int +pkg math/big, method (*Int) SetString(string, int) (*Int, bool) +pkg math/big, method (*Int) Sign() int +pkg math/big, method (*Int) String() string +pkg math/big, method (*Int) Sub(*Int, *Int) *Int +pkg math/big, method (*Int) Xor(*Int, *Int) *Int +pkg math/big, method (*Rat) Abs(*Rat) *Rat +pkg math/big, method (*Rat) Add(*Rat, *Rat) *Rat +pkg math/big, method (*Rat) Cmp(*Rat) int +pkg math/big, method (*Rat) Denom() *Int +pkg math/big, method (*Rat) FloatString(int) string +pkg math/big, method (*Rat) GobDecode([]uint8) error +pkg math/big, method (*Rat) GobEncode() ([]uint8, error) +pkg math/big, method (*Rat) Inv(*Rat) *Rat +pkg math/big, method (*Rat) IsInt() bool +pkg math/big, method (*Rat) Mul(*Rat, *Rat) *Rat +pkg math/big, method (*Rat) Neg(*Rat) *Rat +pkg math/big, method (*Rat) Num() *Int +pkg math/big, method (*Rat) Quo(*Rat, *Rat) *Rat +pkg math/big, method (*Rat) RatString() string +pkg math/big, method (*Rat) Scan(fmt.ScanState, int32) error +pkg math/big, method (*Rat) Set(*Rat) *Rat +pkg math/big, method (*Rat) SetFrac(*Int, *Int) *Rat +pkg math/big, method (*Rat) SetFrac64(int64, int64) *Rat +pkg math/big, method (*Rat) SetInt(*Int) *Rat +pkg math/big, method (*Rat) SetInt64(int64) *Rat +pkg math/big, method (*Rat) SetString(string) (*Rat, bool) +pkg math/big, method (*Rat) Sign() int +pkg math/big, method (*Rat) String() string +pkg math/big, method (*Rat) Sub(*Rat, *Rat) *Rat +pkg math/big, type Int struct +pkg math/big, type Rat struct +pkg math/big, type Word uintptr +pkg math/cmplx, func Abs(complex128) float64 +pkg math/cmplx, func Acos(complex128) complex128 +pkg math/cmplx, func Acosh(complex128) complex128 +pkg math/cmplx, func Asin(complex128) complex128 +pkg math/cmplx, func Asinh(complex128) complex128 +pkg math/cmplx, func Atan(complex128) complex128 +pkg math/cmplx, func Atanh(complex128) complex128 +pkg math/cmplx, func Conj(complex128) complex128 +pkg math/cmplx, func Cos(complex128) complex128 +pkg math/cmplx, func Cosh(complex128) complex128 +pkg math/cmplx, func Cot(complex128) complex128 +pkg math/cmplx, func Exp(complex128) complex128 +pkg math/cmplx, func Inf() complex128 +pkg math/cmplx, func IsInf(complex128) bool +pkg math/cmplx, func IsNaN(complex128) bool +pkg math/cmplx, func Log(complex128) complex128 +pkg math/cmplx, func Log10(complex128) complex128 +pkg math/cmplx, func NaN() complex128 +pkg math/cmplx, func Phase(complex128) float64 +pkg math/cmplx, func Polar(complex128) (float64, float64) +pkg math/cmplx, func Pow(complex128, complex128) complex128 +pkg math/cmplx, func Rect(float64, float64) complex128 +pkg math/cmplx, func Sin(complex128) complex128 +pkg math/cmplx, func Sinh(complex128) complex128 +pkg math/cmplx, func Sqrt(complex128) complex128 +pkg math/cmplx, func Tan(complex128) complex128 +pkg math/cmplx, func Tanh(complex128) complex128 +pkg math/rand, func ExpFloat64() float64 +pkg math/rand, func Float32() float32 +pkg math/rand, func Float64() float64 +pkg math/rand, func Int() int +pkg math/rand, func Int31() int32 +pkg math/rand, func Int31n(int32) int32 +pkg math/rand, func Int63() int64 +pkg math/rand, func Int63n(int64) int64 +pkg math/rand, func Intn(int) int +pkg math/rand, func New(Source) *Rand +pkg math/rand, func NewSource(int64) Source +pkg math/rand, func NewZipf(*Rand, float64, float64, uint64) *Zipf +pkg math/rand, func NormFloat64() float64 +pkg math/rand, func Perm(int) []int +pkg math/rand, func Seed(int64) +pkg math/rand, func Uint32() uint32 +pkg math/rand, method (*Rand) ExpFloat64() float64 +pkg math/rand, method (*Rand) Float32() float32 +pkg math/rand, method (*Rand) Float64() float64 +pkg math/rand, method (*Rand) Int() int +pkg math/rand, method (*Rand) Int31() int32 +pkg math/rand, method (*Rand) Int31n(int32) int32 +pkg math/rand, method (*Rand) Int63() int64 +pkg math/rand, method (*Rand) Int63n(int64) int64 +pkg math/rand, method (*Rand) Intn(int) int +pkg math/rand, method (*Rand) NormFloat64() float64 +pkg math/rand, method (*Rand) Perm(int) []int +pkg math/rand, method (*Rand) Seed(int64) +pkg math/rand, method (*Rand) Uint32() uint32 +pkg math/rand, method (*Zipf) Uint64() uint64 +pkg math/rand, type Rand struct +pkg math/rand, type Source interface { Int63, Seed } +pkg math/rand, type Source interface, Int63() int64 +pkg math/rand, type Source interface, Seed(int64) +pkg math/rand, type Zipf struct +pkg mime, func AddExtensionType(string, string) error +pkg mime, func FormatMediaType(string, map[string]string) string +pkg mime, func ParseMediaType(string) (string, map[string]string, error) +pkg mime, func TypeByExtension(string) string +pkg mime/multipart, func NewReader(io.Reader, string) *Reader +pkg mime/multipart, func NewWriter(io.Writer) *Writer +pkg mime/multipart, method (*FileHeader) Open() (File, error) +pkg mime/multipart, method (*Form) RemoveAll() error +pkg mime/multipart, method (*Part) Close() error +pkg mime/multipart, method (*Part) FileName() string +pkg mime/multipart, method (*Part) FormName() string +pkg mime/multipart, method (*Part) Read([]uint8) (int, error) +pkg mime/multipart, method (*Reader) NextPart() (*Part, error) +pkg mime/multipart, method (*Reader) ReadForm(int64) (*Form, error) +pkg mime/multipart, method (*Writer) Boundary() string +pkg mime/multipart, method (*Writer) Close() error +pkg mime/multipart, method (*Writer) CreateFormField(string) (io.Writer, error) +pkg mime/multipart, method (*Writer) CreateFormFile(string, string) (io.Writer, error) +pkg mime/multipart, method (*Writer) CreatePart(textproto.MIMEHeader) (io.Writer, error) +pkg mime/multipart, method (*Writer) FormDataContentType() string +pkg mime/multipart, method (*Writer) WriteField(string, string) error +pkg mime/multipart, type File interface { Close, Read, ReadAt, Seek } +pkg mime/multipart, type File interface, Close() error +pkg mime/multipart, type File interface, Read([]uint8) (int, error) +pkg mime/multipart, type File interface, ReadAt([]uint8, int64) (int, error) +pkg mime/multipart, type File interface, Seek(int64, int) (int64, error) +pkg mime/multipart, type FileHeader struct +pkg mime/multipart, type FileHeader struct, Filename string +pkg mime/multipart, type FileHeader struct, Header textproto.MIMEHeader +pkg mime/multipart, type Form struct +pkg mime/multipart, type Form struct, File map[string][]*FileHeader +pkg mime/multipart, type Form struct, Value map[string][]string +pkg mime/multipart, type Part struct +pkg mime/multipart, type Part struct, Header textproto.MIMEHeader +pkg mime/multipart, type Reader struct +pkg mime/multipart, type Writer struct +pkg net, const FlagBroadcast Flags +pkg net, const FlagLoopback Flags +pkg net, const FlagMulticast Flags +pkg net, const FlagPointToPoint Flags +pkg net, const FlagUp Flags +pkg net, const IPv4len ideal-int +pkg net, const IPv6len ideal-int +pkg net, func CIDRMask(int, int) IPMask +pkg net, func Dial(string, string) (Conn, error) +pkg net, func DialIP(string, *IPAddr, *IPAddr) (*IPConn, error) +pkg net, func DialTCP(string, *TCPAddr, *TCPAddr) (*TCPConn, error) +pkg net, func DialTimeout(string, string, time.Duration) (Conn, error) +pkg net, func DialUDP(string, *UDPAddr, *UDPAddr) (*UDPConn, error) +pkg net, func DialUnix(string, *UnixAddr, *UnixAddr) (*UnixConn, error) +pkg net, func FileConn(*os.File) (Conn, error) +pkg net, func FileListener(*os.File) (Listener, error) +pkg net, func FilePacketConn(*os.File) (PacketConn, error) +pkg net, func IPv4(uint8, uint8, uint8, uint8) IP +pkg net, func IPv4Mask(uint8, uint8, uint8, uint8) IPMask +pkg net, func InterfaceAddrs() ([]Addr, error) +pkg net, func InterfaceByIndex(int) (*Interface, error) +pkg net, func InterfaceByName(string) (*Interface, error) +pkg net, func Interfaces() ([]Interface, error) +pkg net, func JoinHostPort(string, string) string +pkg net, func Listen(string, string) (Listener, error) +pkg net, func ListenIP(string, *IPAddr) (*IPConn, error) +pkg net, func ListenMulticastUDP(string, *Interface, *UDPAddr) (*UDPConn, error) +pkg net, func ListenPacket(string, string) (PacketConn, error) +pkg net, func ListenTCP(string, *TCPAddr) (*TCPListener, error) +pkg net, func ListenUDP(string, *UDPAddr) (*UDPConn, error) +pkg net, func ListenUnix(string, *UnixAddr) (*UnixListener, error) +pkg net, func ListenUnixgram(string, *UnixAddr) (*UDPConn, error) +pkg net, func LookupAddr(string) ([]string, error) +pkg net, func LookupCNAME(string) (string, error) +pkg net, func LookupHost(string) ([]string, error) +pkg net, func LookupIP(string) ([]IP, error) +pkg net, func LookupMX(string) ([]*MX, error) +pkg net, func LookupPort(string, string) (int, error) +pkg net, func LookupSRV(string, string, string) (string, []*SRV, error) +pkg net, func LookupTXT(string) ([]string, error) +pkg net, func ParseCIDR(string) (IP, *IPNet, error) +pkg net, func ParseIP(string) IP +pkg net, func ParseMAC(string) (HardwareAddr, error) +pkg net, func Pipe() (Conn, Conn) +pkg net, func ResolveIPAddr(string, string) (*IPAddr, error) +pkg net, func ResolveTCPAddr(string, string) (*TCPAddr, error) +pkg net, func ResolveUDPAddr(string, string) (*UDPAddr, error) +pkg net, func ResolveUnixAddr(string, string) (*UnixAddr, error) +pkg net, func SplitHostPort(string) (string, string, error) +pkg net, method (*AddrError) Error() string +pkg net, method (*AddrError) Temporary() bool +pkg net, method (*AddrError) Timeout() bool +pkg net, method (*DNSConfigError) Error() string +pkg net, method (*DNSConfigError) Temporary() bool +pkg net, method (*DNSConfigError) Timeout() bool +pkg net, method (*DNSError) Error() string +pkg net, method (*DNSError) Temporary() bool +pkg net, method (*DNSError) Timeout() bool +pkg net, method (*IPAddr) Network() string +pkg net, method (*IPAddr) String() string +pkg net, method (*IPConn) Close() error +pkg net, method (*IPConn) File() (*os.File, error) +pkg net, method (*IPConn) LocalAddr() Addr +pkg net, method (*IPConn) Read([]uint8) (int, error) +pkg net, method (*IPConn) ReadFrom([]uint8) (int, Addr, error) +pkg net, method (*IPConn) ReadFromIP([]uint8) (int, *IPAddr, error) +pkg net, method (*IPConn) RemoteAddr() Addr +pkg net, method (*IPConn) SetDeadline(time.Time) error +pkg net, method (*IPConn) SetReadBuffer(int) error +pkg net, method (*IPConn) SetReadDeadline(time.Time) error +pkg net, method (*IPConn) SetWriteBuffer(int) error +pkg net, method (*IPConn) SetWriteDeadline(time.Time) error +pkg net, method (*IPConn) Write([]uint8) (int, error) +pkg net, method (*IPConn) WriteTo([]uint8, Addr) (int, error) +pkg net, method (*IPConn) WriteToIP([]uint8, *IPAddr) (int, error) +pkg net, method (*IPNet) Contains(IP) bool +pkg net, method (*IPNet) Network() string +pkg net, method (*IPNet) String() string +pkg net, method (*Interface) Addrs() ([]Addr, error) +pkg net, method (*Interface) MulticastAddrs() ([]Addr, error) +pkg net, method (*OpError) Error() string +pkg net, method (*OpError) Temporary() bool +pkg net, method (*OpError) Timeout() bool +pkg net, method (*ParseError) Error() string +pkg net, method (*TCPAddr) Network() string +pkg net, method (*TCPAddr) String() string +pkg net, method (*TCPConn) Close() error +pkg net, method (*TCPConn) CloseRead() error +pkg net, method (*TCPConn) CloseWrite() error +pkg net, method (*TCPConn) File() (*os.File, error) +pkg net, method (*TCPConn) LocalAddr() Addr +pkg net, method (*TCPConn) Read([]uint8) (int, error) +pkg net, method (*TCPConn) ReadFrom(io.Reader) (int64, error) +pkg net, method (*TCPConn) RemoteAddr() Addr +pkg net, method (*TCPConn) SetDeadline(time.Time) error +pkg net, method (*TCPConn) SetKeepAlive(bool) error +pkg net, method (*TCPConn) SetLinger(int) error +pkg net, method (*TCPConn) SetNoDelay(bool) error +pkg net, method (*TCPConn) SetReadBuffer(int) error +pkg net, method (*TCPConn) SetReadDeadline(time.Time) error +pkg net, method (*TCPConn) SetWriteBuffer(int) error +pkg net, method (*TCPConn) SetWriteDeadline(time.Time) error +pkg net, method (*TCPConn) Write([]uint8) (int, error) +pkg net, method (*TCPListener) Accept() (Conn, error) +pkg net, method (*TCPListener) AcceptTCP() (*TCPConn, error) +pkg net, method (*TCPListener) Addr() Addr +pkg net, method (*TCPListener) Close() error +pkg net, method (*TCPListener) File() (*os.File, error) +pkg net, method (*TCPListener) SetDeadline(time.Time) error +pkg net, method (*UDPAddr) Network() string +pkg net, method (*UDPAddr) String() string +pkg net, method (*UDPConn) Close() error +pkg net, method (*UDPConn) File() (*os.File, error) +pkg net, method (*UDPConn) LocalAddr() Addr +pkg net, method (*UDPConn) Read([]uint8) (int, error) +pkg net, method (*UDPConn) ReadFrom([]uint8) (int, Addr, error) +pkg net, method (*UDPConn) ReadFromUDP([]uint8) (int, *UDPAddr, error) +pkg net, method (*UDPConn) RemoteAddr() Addr +pkg net, method (*UDPConn) SetDeadline(time.Time) error +pkg net, method (*UDPConn) SetReadBuffer(int) error +pkg net, method (*UDPConn) SetReadDeadline(time.Time) error +pkg net, method (*UDPConn) SetWriteBuffer(int) error +pkg net, method (*UDPConn) SetWriteDeadline(time.Time) error +pkg net, method (*UDPConn) Write([]uint8) (int, error) +pkg net, method (*UDPConn) WriteTo([]uint8, Addr) (int, error) +pkg net, method (*UDPConn) WriteToUDP([]uint8, *UDPAddr) (int, error) +pkg net, method (*UnixAddr) Network() string +pkg net, method (*UnixAddr) String() string +pkg net, method (*UnixConn) Close() error +pkg net, method (*UnixConn) File() (*os.File, error) +pkg net, method (*UnixConn) LocalAddr() Addr +pkg net, method (*UnixConn) Read([]uint8) (int, error) +pkg net, method (*UnixConn) ReadFrom([]uint8) (int, Addr, error) +pkg net, method (*UnixConn) ReadFromUnix([]uint8) (int, *UnixAddr, error) +pkg net, method (*UnixConn) ReadMsgUnix([]uint8, []uint8) (int, int, int, *UnixAddr, error) +pkg net, method (*UnixConn) RemoteAddr() Addr +pkg net, method (*UnixConn) SetDeadline(time.Time) error +pkg net, method (*UnixConn) SetReadBuffer(int) error +pkg net, method (*UnixConn) SetReadDeadline(time.Time) error +pkg net, method (*UnixConn) SetWriteBuffer(int) error +pkg net, method (*UnixConn) SetWriteDeadline(time.Time) error +pkg net, method (*UnixConn) Write([]uint8) (int, error) +pkg net, method (*UnixConn) WriteMsgUnix([]uint8, []uint8, *UnixAddr) (int, int, error) +pkg net, method (*UnixConn) WriteTo([]uint8, Addr) (int, error) +pkg net, method (*UnixConn) WriteToUnix([]uint8, *UnixAddr) (int, error) +pkg net, method (*UnixListener) Accept() (Conn, error) +pkg net, method (*UnixListener) AcceptUnix() (*UnixConn, error) +pkg net, method (*UnixListener) Addr() Addr +pkg net, method (*UnixListener) Close() error +pkg net, method (*UnixListener) File() (*os.File, error) +pkg net, method (*UnixListener) SetDeadline(time.Time) error +pkg net, method (Flags) String() string +pkg net, method (HardwareAddr) String() string +pkg net, method (IP) DefaultMask() IPMask +pkg net, method (IP) Equal(IP) bool +pkg net, method (IP) IsGlobalUnicast() bool +pkg net, method (IP) IsInterfaceLocalMulticast() bool +pkg net, method (IP) IsLinkLocalMulticast() bool +pkg net, method (IP) IsLinkLocalUnicast() bool +pkg net, method (IP) IsLoopback() bool +pkg net, method (IP) IsMulticast() bool +pkg net, method (IP) IsUnspecified() bool +pkg net, method (IP) Mask(IPMask) IP +pkg net, method (IP) String() string +pkg net, method (IP) To16() IP +pkg net, method (IP) To4() IP +pkg net, method (IPMask) Size() (int, int) +pkg net, method (IPMask) String() string +pkg net, method (InvalidAddrError) Error() string +pkg net, method (InvalidAddrError) Temporary() bool +pkg net, method (InvalidAddrError) Timeout() bool +pkg net, method (UnknownNetworkError) Error() string +pkg net, method (UnknownNetworkError) Temporary() bool +pkg net, method (UnknownNetworkError) Timeout() bool +pkg net, type Addr interface { Network, String } +pkg net, type Addr interface, Network() string +pkg net, type Addr interface, String() string +pkg net, type AddrError struct +pkg net, type AddrError struct, Addr string +pkg net, type AddrError struct, Err string +pkg net, type Conn interface { Close, LocalAddr, Read, RemoteAddr, SetDeadline, SetReadDeadline, SetWriteDeadline, Write } +pkg net, type Conn interface, Close() error +pkg net, type Conn interface, LocalAddr() Addr +pkg net, type Conn interface, Read([]uint8) (int, error) +pkg net, type Conn interface, RemoteAddr() Addr +pkg net, type Conn interface, SetDeadline(time.Time) error +pkg net, type Conn interface, SetReadDeadline(time.Time) error +pkg net, type Conn interface, SetWriteDeadline(time.Time) error +pkg net, type Conn interface, Write([]uint8) (int, error) +pkg net, type DNSConfigError struct +pkg net, type DNSConfigError struct, Err error +pkg net, type DNSError struct +pkg net, type DNSError struct, Err string +pkg net, type DNSError struct, IsTimeout bool +pkg net, type DNSError struct, Name string +pkg net, type DNSError struct, Server string +pkg net, type Error interface { Error, Temporary, Timeout } +pkg net, type Error interface, Error() string +pkg net, type Error interface, Temporary() bool +pkg net, type Error interface, Timeout() bool +pkg net, type Flags uint +pkg net, type HardwareAddr []uint8 +pkg net, type IP []uint8 +pkg net, type IPAddr struct +pkg net, type IPAddr struct, IP IP +pkg net, type IPConn struct +pkg net, type IPMask []uint8 +pkg net, type IPNet struct +pkg net, type IPNet struct, IP IP +pkg net, type IPNet struct, Mask IPMask +pkg net, type Interface struct +pkg net, type Interface struct, Flags Flags +pkg net, type Interface struct, HardwareAddr HardwareAddr +pkg net, type Interface struct, Index int +pkg net, type Interface struct, MTU int +pkg net, type Interface struct, Name string +pkg net, type InvalidAddrError string +pkg net, type Listener interface { Accept, Addr, Close } +pkg net, type Listener interface, Accept() (Conn, error) +pkg net, type Listener interface, Addr() Addr +pkg net, type Listener interface, Close() error +pkg net, type MX struct +pkg net, type MX struct, Host string +pkg net, type MX struct, Pref uint16 +pkg net, type OpError struct +pkg net, type OpError struct, Addr Addr +pkg net, type OpError struct, Err error +pkg net, type OpError struct, Net string +pkg net, type OpError struct, Op string +pkg net, type PacketConn interface { Close, LocalAddr, ReadFrom, SetDeadline, SetReadDeadline, SetWriteDeadline, WriteTo } +pkg net, type PacketConn interface, Close() error +pkg net, type PacketConn interface, LocalAddr() Addr +pkg net, type PacketConn interface, ReadFrom([]uint8) (int, Addr, error) +pkg net, type PacketConn interface, SetDeadline(time.Time) error +pkg net, type PacketConn interface, SetReadDeadline(time.Time) error +pkg net, type PacketConn interface, SetWriteDeadline(time.Time) error +pkg net, type PacketConn interface, WriteTo([]uint8, Addr) (int, error) +pkg net, type ParseError struct +pkg net, type ParseError struct, Text string +pkg net, type ParseError struct, Type string +pkg net, type SRV struct +pkg net, type SRV struct, Port uint16 +pkg net, type SRV struct, Priority uint16 +pkg net, type SRV struct, Target string +pkg net, type SRV struct, Weight uint16 +pkg net, type TCPAddr struct +pkg net, type TCPAddr struct, IP IP +pkg net, type TCPAddr struct, Port int +pkg net, type TCPConn struct +pkg net, type TCPListener struct +pkg net, type UDPAddr struct +pkg net, type UDPAddr struct, IP IP +pkg net, type UDPAddr struct, Port int +pkg net, type UDPConn struct +pkg net, type UnixAddr struct +pkg net, type UnixAddr struct, Name string +pkg net, type UnixAddr struct, Net string +pkg net, type UnixConn struct +pkg net, type UnixListener struct +pkg net, type UnknownNetworkError string +pkg net, var ErrWriteToConnected error +pkg net, var IPv4allrouter IP +pkg net, var IPv4allsys IP +pkg net, var IPv4bcast IP +pkg net, var IPv4zero IP +pkg net, var IPv6interfacelocalallnodes IP +pkg net, var IPv6linklocalallnodes IP +pkg net, var IPv6linklocalallrouters IP +pkg net, var IPv6loopback IP +pkg net, var IPv6unspecified IP +pkg net, var IPv6zero IP +pkg net/http, const DefaultMaxHeaderBytes ideal-int +pkg net/http, const DefaultMaxIdleConnsPerHost ideal-int +pkg net/http, const StatusAccepted ideal-int +pkg net/http, const StatusBadGateway ideal-int +pkg net/http, const StatusBadRequest ideal-int +pkg net/http, const StatusConflict ideal-int +pkg net/http, const StatusContinue ideal-int +pkg net/http, const StatusCreated ideal-int +pkg net/http, const StatusExpectationFailed ideal-int +pkg net/http, const StatusForbidden ideal-int +pkg net/http, const StatusFound ideal-int +pkg net/http, const StatusGatewayTimeout ideal-int +pkg net/http, const StatusGone ideal-int +pkg net/http, const StatusHTTPVersionNotSupported ideal-int +pkg net/http, const StatusInternalServerError ideal-int +pkg net/http, const StatusLengthRequired ideal-int +pkg net/http, const StatusMethodNotAllowed ideal-int +pkg net/http, const StatusMovedPermanently ideal-int +pkg net/http, const StatusMultipleChoices ideal-int +pkg net/http, const StatusNoContent ideal-int +pkg net/http, const StatusNonAuthoritativeInfo ideal-int +pkg net/http, const StatusNotAcceptable ideal-int +pkg net/http, const StatusNotFound ideal-int +pkg net/http, const StatusNotImplemented ideal-int +pkg net/http, const StatusNotModified ideal-int +pkg net/http, const StatusOK ideal-int +pkg net/http, const StatusPartialContent ideal-int +pkg net/http, const StatusPaymentRequired ideal-int +pkg net/http, const StatusPreconditionFailed ideal-int +pkg net/http, const StatusProxyAuthRequired ideal-int +pkg net/http, const StatusRequestEntityTooLarge ideal-int +pkg net/http, const StatusRequestTimeout ideal-int +pkg net/http, const StatusRequestURITooLong ideal-int +pkg net/http, const StatusRequestedRangeNotSatisfiable ideal-int +pkg net/http, const StatusResetContent ideal-int +pkg net/http, const StatusSeeOther ideal-int +pkg net/http, const StatusServiceUnavailable ideal-int +pkg net/http, const StatusSwitchingProtocols ideal-int +pkg net/http, const StatusTeapot ideal-int +pkg net/http, const StatusTemporaryRedirect ideal-int +pkg net/http, const StatusUnauthorized ideal-int +pkg net/http, const StatusUnsupportedMediaType ideal-int +pkg net/http, const StatusUseProxy ideal-int +pkg net/http, const TimeFormat ideal-string +pkg net/http, func CanonicalHeaderKey(string) string +pkg net/http, func DetectContentType([]uint8) string +pkg net/http, func Error(ResponseWriter, string, int) +pkg net/http, func FileServer(FileSystem) Handler +pkg net/http, func Get(string) (*Response, error) +pkg net/http, func Handle(string, Handler) +pkg net/http, func HandleFunc(string, func(ResponseWriter, *Request)) +pkg net/http, func Head(string) (*Response, error) +pkg net/http, func ListenAndServe(string, Handler) error +pkg net/http, func ListenAndServeTLS(string, string, string, Handler) error +pkg net/http, func MaxBytesReader(ResponseWriter, io.ReadCloser, int64) io.ReadCloser +pkg net/http, func NewFileTransport(FileSystem) RoundTripper +pkg net/http, func NewRequest(string, string, io.Reader) (*Request, error) +pkg net/http, func NewServeMux() *ServeMux +pkg net/http, func NotFound(ResponseWriter, *Request) +pkg net/http, func NotFoundHandler() Handler +pkg net/http, func ParseHTTPVersion(string) (int, int, bool) +pkg net/http, func Post(string, string, io.Reader) (*Response, error) +pkg net/http, func PostForm(string, url.Values) (*Response, error) +pkg net/http, func ProxyFromEnvironment(*Request) (*url.URL, error) +pkg net/http, func ProxyURL(*url.URL) func(*Request) (*url.URL, error) +pkg net/http, func ReadRequest(*bufio.Reader) (*Request, error) +pkg net/http, func ReadResponse(*bufio.Reader, *Request) (*Response, error) +pkg net/http, func Redirect(ResponseWriter, *Request, string, int) +pkg net/http, func RedirectHandler(string, int) Handler +pkg net/http, func Serve(net.Listener, Handler) error +pkg net/http, func ServeContent(ResponseWriter, *Request, string, time.Time, io.ReadSeeker) +pkg net/http, func ServeFile(ResponseWriter, *Request, string) +pkg net/http, func SetCookie(ResponseWriter, *Cookie) +pkg net/http, func StatusText(int) string +pkg net/http, func StripPrefix(string, Handler) Handler +pkg net/http, func TimeoutHandler(Handler, time.Duration, string) Handler +pkg net/http, method (*Client) Do(*Request) (*Response, error) +pkg net/http, method (*Client) Get(string) (*Response, error) +pkg net/http, method (*Client) Head(string) (*Response, error) +pkg net/http, method (*Client) Post(string, string, io.Reader) (*Response, error) +pkg net/http, method (*Client) PostForm(string, url.Values) (*Response, error) +pkg net/http, method (*Cookie) String() string +pkg net/http, method (*ProtocolError) Error() string +pkg net/http, method (*Request) AddCookie(*Cookie) +pkg net/http, method (*Request) Cookie(string) (*Cookie, error) +pkg net/http, method (*Request) Cookies() []*Cookie +pkg net/http, method (*Request) FormFile(string) (multipart.File, *multipart.FileHeader, error) +pkg net/http, method (*Request) FormValue(string) string +pkg net/http, method (*Request) MultipartReader() (*multipart.Reader, error) +pkg net/http, method (*Request) ParseForm() error +pkg net/http, method (*Request) ParseMultipartForm(int64) error +pkg net/http, method (*Request) ProtoAtLeast(int, int) bool +pkg net/http, method (*Request) Referer() string +pkg net/http, method (*Request) SetBasicAuth(string, string) +pkg net/http, method (*Request) UserAgent() string +pkg net/http, method (*Request) Write(io.Writer) error +pkg net/http, method (*Request) WriteProxy(io.Writer) error +pkg net/http, method (*Response) Cookies() []*Cookie +pkg net/http, method (*Response) Location() (*url.URL, error) +pkg net/http, method (*Response) ProtoAtLeast(int, int) bool +pkg net/http, method (*Response) Write(io.Writer) error +pkg net/http, method (*ServeMux) Handle(string, Handler) +pkg net/http, method (*ServeMux) HandleFunc(string, func(ResponseWriter, *Request)) +pkg net/http, method (*ServeMux) ServeHTTP(ResponseWriter, *Request) +pkg net/http, method (*Server) ListenAndServe() error +pkg net/http, method (*Server) ListenAndServeTLS(string, string) error +pkg net/http, method (*Server) Serve(net.Listener) error +pkg net/http, method (*Transport) CloseIdleConnections() +pkg net/http, method (*Transport) RegisterProtocol(string, RoundTripper) +pkg net/http, method (*Transport) RoundTrip(*Request) (*Response, error) +pkg net/http, method (Dir) Open(string) (File, error) +pkg net/http, method (HandlerFunc) ServeHTTP(ResponseWriter, *Request) +pkg net/http, method (Header) Add(string, string) +pkg net/http, method (Header) Del(string) +pkg net/http, method (Header) Get(string) string +pkg net/http, method (Header) Set(string, string) +pkg net/http, method (Header) Write(io.Writer) error +pkg net/http, method (Header) WriteSubset(io.Writer, map[string]bool) error +pkg net/http, type Client struct +pkg net/http, type Client struct, CheckRedirect func(*Request, []*Request) error +pkg net/http, type Client struct, Jar CookieJar +pkg net/http, type Client struct, Transport RoundTripper +pkg net/http, type Cookie struct +pkg net/http, type Cookie struct, Domain string +pkg net/http, type Cookie struct, Expires time.Time +pkg net/http, type Cookie struct, HttpOnly bool +pkg net/http, type Cookie struct, MaxAge int +pkg net/http, type Cookie struct, Name string +pkg net/http, type Cookie struct, Path string +pkg net/http, type Cookie struct, Raw string +pkg net/http, type Cookie struct, RawExpires string +pkg net/http, type Cookie struct, Secure bool +pkg net/http, type Cookie struct, Unparsed []string +pkg net/http, type Cookie struct, Value string +pkg net/http, type CookieJar interface { Cookies, SetCookies } +pkg net/http, type CookieJar interface, Cookies(*url.URL) []*Cookie +pkg net/http, type CookieJar interface, SetCookies(*url.URL, []*Cookie) +pkg net/http, type Dir string +pkg net/http, type File interface { Close, Read, Readdir, Seek, Stat } +pkg net/http, type File interface, Close() error +pkg net/http, type File interface, Read([]uint8) (int, error) +pkg net/http, type File interface, Readdir(int) ([]os.FileInfo, error) +pkg net/http, type File interface, Seek(int64, int) (int64, error) +pkg net/http, type File interface, Stat() (os.FileInfo, error) +pkg net/http, type FileSystem interface { Open } +pkg net/http, type FileSystem interface, Open(string) (File, error) +pkg net/http, type Flusher interface { Flush } +pkg net/http, type Flusher interface, Flush() +pkg net/http, type Handler interface { ServeHTTP } +pkg net/http, type Handler interface, ServeHTTP(ResponseWriter, *Request) +pkg net/http, type HandlerFunc func(ResponseWriter, *Request) +pkg net/http, type Header map[string][]string +pkg net/http, type Hijacker interface { Hijack } +pkg net/http, type Hijacker interface, Hijack() (net.Conn, *bufio.ReadWriter, error) +pkg net/http, type ProtocolError struct +pkg net/http, type ProtocolError struct, ErrorString string +pkg net/http, type Request struct +pkg net/http, type Request struct, Body io.ReadCloser +pkg net/http, type Request struct, Close bool +pkg net/http, type Request struct, ContentLength int64 +pkg net/http, type Request struct, Form url.Values +pkg net/http, type Request struct, Header Header +pkg net/http, type Request struct, Host string +pkg net/http, type Request struct, Method string +pkg net/http, type Request struct, MultipartForm *multipart.Form +pkg net/http, type Request struct, Proto string +pkg net/http, type Request struct, ProtoMajor int +pkg net/http, type Request struct, ProtoMinor int +pkg net/http, type Request struct, RemoteAddr string +pkg net/http, type Request struct, RequestURI string +pkg net/http, type Request struct, TLS *tls.ConnectionState +pkg net/http, type Request struct, Trailer Header +pkg net/http, type Request struct, TransferEncoding []string +pkg net/http, type Request struct, URL *url.URL +pkg net/http, type Response struct +pkg net/http, type Response struct, Body io.ReadCloser +pkg net/http, type Response struct, Close bool +pkg net/http, type Response struct, ContentLength int64 +pkg net/http, type Response struct, Header Header +pkg net/http, type Response struct, Proto string +pkg net/http, type Response struct, ProtoMajor int +pkg net/http, type Response struct, ProtoMinor int +pkg net/http, type Response struct, Request *Request +pkg net/http, type Response struct, Status string +pkg net/http, type Response struct, StatusCode int +pkg net/http, type Response struct, Trailer Header +pkg net/http, type Response struct, TransferEncoding []string +pkg net/http, type ResponseWriter interface { Header, Write, WriteHeader } +pkg net/http, type ResponseWriter interface, Header() Header +pkg net/http, type ResponseWriter interface, Write([]uint8) (int, error) +pkg net/http, type ResponseWriter interface, WriteHeader(int) +pkg net/http, type RoundTripper interface { RoundTrip } +pkg net/http, type RoundTripper interface, RoundTrip(*Request) (*Response, error) +pkg net/http, type ServeMux struct +pkg net/http, type Server struct +pkg net/http, type Server struct, Addr string +pkg net/http, type Server struct, Handler Handler +pkg net/http, type Server struct, MaxHeaderBytes int +pkg net/http, type Server struct, ReadTimeout time.Duration +pkg net/http, type Server struct, TLSConfig *tls.Config +pkg net/http, type Server struct, WriteTimeout time.Duration +pkg net/http, type Transport struct +pkg net/http, type Transport struct, Dial func(string, string) (net.Conn, error) +pkg net/http, type Transport struct, DisableCompression bool +pkg net/http, type Transport struct, DisableKeepAlives bool +pkg net/http, type Transport struct, MaxIdleConnsPerHost int +pkg net/http, type Transport struct, Proxy func(*Request) (*url.URL, error) +pkg net/http, type Transport struct, TLSClientConfig *tls.Config +pkg net/http, var DefaultClient *Client +pkg net/http, var DefaultServeMux *ServeMux +pkg net/http, var DefaultTransport RoundTripper +pkg net/http, var ErrBodyNotAllowed error +pkg net/http, var ErrBodyReadAfterClose error +pkg net/http, var ErrContentLength error +pkg net/http, var ErrHandlerTimeout error +pkg net/http, var ErrHeaderTooLong *ProtocolError +pkg net/http, var ErrHijacked error +pkg net/http, var ErrLineTooLong error +pkg net/http, var ErrMissingBoundary *ProtocolError +pkg net/http, var ErrMissingContentLength *ProtocolError +pkg net/http, var ErrMissingFile error +pkg net/http, var ErrNoCookie error +pkg net/http, var ErrNoLocation error +pkg net/http, var ErrNotMultipart *ProtocolError +pkg net/http, var ErrNotSupported *ProtocolError +pkg net/http, var ErrShortBody *ProtocolError +pkg net/http, var ErrUnexpectedTrailer *ProtocolError +pkg net/http, var ErrWriteAfterFlush error +pkg net/http/cgi, func Request() (*http.Request, error) +pkg net/http/cgi, func RequestFromMap(map[string]string) (*http.Request, error) +pkg net/http/cgi, func Serve(http.Handler) error +pkg net/http/cgi, method (*Handler) ServeHTTP(http.ResponseWriter, *http.Request) +pkg net/http/cgi, type Handler struct +pkg net/http/cgi, type Handler struct, Args []string +pkg net/http/cgi, type Handler struct, Dir string +pkg net/http/cgi, type Handler struct, Env []string +pkg net/http/cgi, type Handler struct, InheritEnv []string +pkg net/http/cgi, type Handler struct, Logger *log.Logger +pkg net/http/cgi, type Handler struct, Path string +pkg net/http/cgi, type Handler struct, PathLocationHandler http.Handler +pkg net/http/cgi, type Handler struct, Root string +pkg net/http/fcgi, func Serve(net.Listener, http.Handler) error +pkg net/http/httptest, const DefaultRemoteAddr ideal-string +pkg net/http/httptest, func NewRecorder() *ResponseRecorder +pkg net/http/httptest, func NewServer(http.Handler) *Server +pkg net/http/httptest, func NewTLSServer(http.Handler) *Server +pkg net/http/httptest, func NewUnstartedServer(http.Handler) *Server +pkg net/http/httptest, method (*ResponseRecorder) Flush() +pkg net/http/httptest, method (*ResponseRecorder) Header() http.Header +pkg net/http/httptest, method (*ResponseRecorder) Write([]uint8) (int, error) +pkg net/http/httptest, method (*ResponseRecorder) WriteHeader(int) +pkg net/http/httptest, method (*Server) Close() +pkg net/http/httptest, method (*Server) CloseClientConnections() +pkg net/http/httptest, method (*Server) Start() +pkg net/http/httptest, method (*Server) StartTLS() +pkg net/http/httptest, type ResponseRecorder struct +pkg net/http/httptest, type ResponseRecorder struct, Body *bytes.Buffer +pkg net/http/httptest, type ResponseRecorder struct, Code int +pkg net/http/httptest, type ResponseRecorder struct, Flushed bool +pkg net/http/httptest, type ResponseRecorder struct, HeaderMap http.Header +pkg net/http/httptest, type Server struct +pkg net/http/httptest, type Server struct, Config *http.Server +pkg net/http/httptest, type Server struct, Listener net.Listener +pkg net/http/httptest, type Server struct, TLS *tls.Config +pkg net/http/httptest, type Server struct, URL string +pkg net/http/httputil, func DumpRequest(*http.Request, bool) ([]uint8, error) +pkg net/http/httputil, func DumpRequestOut(*http.Request, bool) ([]uint8, error) +pkg net/http/httputil, func DumpResponse(*http.Response, bool) ([]uint8, error) +pkg net/http/httputil, func NewChunkedReader(io.Reader) io.Reader +pkg net/http/httputil, func NewChunkedWriter(io.Writer) io.WriteCloser +pkg net/http/httputil, func NewClientConn(net.Conn, *bufio.Reader) *ClientConn +pkg net/http/httputil, func NewProxyClientConn(net.Conn, *bufio.Reader) *ClientConn +pkg net/http/httputil, func NewServerConn(net.Conn, *bufio.Reader) *ServerConn +pkg net/http/httputil, func NewSingleHostReverseProxy(*url.URL) *ReverseProxy +pkg net/http/httputil, method (*ClientConn) Close() error +pkg net/http/httputil, method (*ClientConn) Do(*http.Request) (*http.Response, error) +pkg net/http/httputil, method (*ClientConn) Hijack() (net.Conn, *bufio.Reader) +pkg net/http/httputil, method (*ClientConn) Pending() int +pkg net/http/httputil, method (*ClientConn) Read(*http.Request) (*http.Response, error) +pkg net/http/httputil, method (*ClientConn) Write(*http.Request) error +pkg net/http/httputil, method (*ReverseProxy) ServeHTTP(http.ResponseWriter, *http.Request) +pkg net/http/httputil, method (*ServerConn) Close() error +pkg net/http/httputil, method (*ServerConn) Hijack() (net.Conn, *bufio.Reader) +pkg net/http/httputil, method (*ServerConn) Pending() int +pkg net/http/httputil, method (*ServerConn) Read() (*http.Request, error) +pkg net/http/httputil, method (*ServerConn) Write(*http.Request, *http.Response) error +pkg net/http/httputil, type ClientConn struct +pkg net/http/httputil, type ReverseProxy struct +pkg net/http/httputil, type ReverseProxy struct, Director func(*http.Request) +pkg net/http/httputil, type ReverseProxy struct, FlushInterval time.Duration +pkg net/http/httputil, type ReverseProxy struct, Transport http.RoundTripper +pkg net/http/httputil, type ServerConn struct +pkg net/http/httputil, var ErrClosed *http.ProtocolError +pkg net/http/httputil, var ErrLineTooLong error +pkg net/http/httputil, var ErrPersistEOF *http.ProtocolError +pkg net/http/httputil, var ErrPipeline *http.ProtocolError +pkg net/http/pprof, func Cmdline(http.ResponseWriter, *http.Request) +pkg net/http/pprof, func Handler(string) http.Handler +pkg net/http/pprof, func Index(http.ResponseWriter, *http.Request) +pkg net/http/pprof, func Profile(http.ResponseWriter, *http.Request) +pkg net/http/pprof, func Symbol(http.ResponseWriter, *http.Request) +pkg net/mail, func ReadMessage(io.Reader) (*Message, error) +pkg net/mail, method (*Address) String() string +pkg net/mail, method (Header) AddressList(string) ([]*Address, error) +pkg net/mail, method (Header) Date() (time.Time, error) +pkg net/mail, method (Header) Get(string) string +pkg net/mail, type Address struct +pkg net/mail, type Address struct, Address string +pkg net/mail, type Address struct, Name string +pkg net/mail, type Header map[string][]string +pkg net/mail, type Message struct +pkg net/mail, type Message struct, Body io.Reader +pkg net/mail, type Message struct, Header Header +pkg net/mail, var ErrHeaderNotPresent error +pkg net/rpc, const DefaultDebugPath ideal-string +pkg net/rpc, const DefaultRPCPath ideal-string +pkg net/rpc, func Accept(net.Listener) +pkg net/rpc, func Dial(string, string) (*Client, error) +pkg net/rpc, func DialHTTP(string, string) (*Client, error) +pkg net/rpc, func DialHTTPPath(string, string, string) (*Client, error) +pkg net/rpc, func HandleHTTP() +pkg net/rpc, func NewClient(io.ReadWriteCloser) *Client +pkg net/rpc, func NewClientWithCodec(ClientCodec) *Client +pkg net/rpc, func NewServer() *Server +pkg net/rpc, func Register(interface{}) error +pkg net/rpc, func RegisterName(string, interface{}) error +pkg net/rpc, func ServeCodec(ServerCodec) +pkg net/rpc, func ServeConn(io.ReadWriteCloser) +pkg net/rpc, func ServeRequest(ServerCodec) error +pkg net/rpc, method (*Client) Call(string, interface{}, interface{}) error +pkg net/rpc, method (*Client) Close() error +pkg net/rpc, method (*Client) Go(string, interface{}, interface{}, chan *Call) *Call +pkg net/rpc, method (*Server) Accept(net.Listener) +pkg net/rpc, method (*Server) HandleHTTP(string, string) +pkg net/rpc, method (*Server) Register(interface{}) error +pkg net/rpc, method (*Server) RegisterName(string, interface{}) error +pkg net/rpc, method (*Server) ServeCodec(ServerCodec) +pkg net/rpc, method (*Server) ServeConn(io.ReadWriteCloser) +pkg net/rpc, method (*Server) ServeHTTP(http.ResponseWriter, *http.Request) +pkg net/rpc, method (*Server) ServeRequest(ServerCodec) error +pkg net/rpc, method (ServerError) Error() string +pkg net/rpc, type Call struct +pkg net/rpc, type Call struct, Args interface{} +pkg net/rpc, type Call struct, Done chan *Call +pkg net/rpc, type Call struct, Error error +pkg net/rpc, type Call struct, Reply interface{} +pkg net/rpc, type Call struct, ServiceMethod string +pkg net/rpc, type Client struct +pkg net/rpc, type ClientCodec interface { Close, ReadResponseBody, ReadResponseHeader, WriteRequest } +pkg net/rpc, type ClientCodec interface, Close() error +pkg net/rpc, type ClientCodec interface, ReadResponseBody(interface{}) error +pkg net/rpc, type ClientCodec interface, ReadResponseHeader(*Response) error +pkg net/rpc, type ClientCodec interface, WriteRequest(*Request, interface{}) error +pkg net/rpc, type Request struct +pkg net/rpc, type Request struct, Seq uint64 +pkg net/rpc, type Request struct, ServiceMethod string +pkg net/rpc, type Response struct +pkg net/rpc, type Response struct, Error string +pkg net/rpc, type Response struct, Seq uint64 +pkg net/rpc, type Response struct, ServiceMethod string +pkg net/rpc, type Server struct +pkg net/rpc, type ServerCodec interface { Close, ReadRequestBody, ReadRequestHeader, WriteResponse } +pkg net/rpc, type ServerCodec interface, Close() error +pkg net/rpc, type ServerCodec interface, ReadRequestBody(interface{}) error +pkg net/rpc, type ServerCodec interface, ReadRequestHeader(*Request) error +pkg net/rpc, type ServerCodec interface, WriteResponse(*Response, interface{}) error +pkg net/rpc, type ServerError string +pkg net/rpc, var DefaultServer *Server +pkg net/rpc, var ErrShutdown error +pkg net/rpc/jsonrpc, func Dial(string, string) (*rpc.Client, error) +pkg net/rpc/jsonrpc, func NewClient(io.ReadWriteCloser) *rpc.Client +pkg net/rpc/jsonrpc, func NewClientCodec(io.ReadWriteCloser) rpc.ClientCodec +pkg net/rpc/jsonrpc, func NewServerCodec(io.ReadWriteCloser) rpc.ServerCodec +pkg net/rpc/jsonrpc, func ServeConn(io.ReadWriteCloser) +pkg net/smtp, func CRAMMD5Auth(string, string) Auth +pkg net/smtp, func Dial(string) (*Client, error) +pkg net/smtp, func NewClient(net.Conn, string) (*Client, error) +pkg net/smtp, func PlainAuth(string, string, string, string) Auth +pkg net/smtp, func SendMail(string, Auth, string, []string, []uint8) error +pkg net/smtp, method (*Client) Auth(Auth) error +pkg net/smtp, method (*Client) Data() (io.WriteCloser, error) +pkg net/smtp, method (*Client) Extension(string) (bool, string) +pkg net/smtp, method (*Client) Mail(string) error +pkg net/smtp, method (*Client) Quit() error +pkg net/smtp, method (*Client) Rcpt(string) error +pkg net/smtp, method (*Client) Reset() error +pkg net/smtp, method (*Client) StartTLS(*tls.Config) error +pkg net/smtp, method (*Client) Verify(string) error +pkg net/smtp, type Auth interface { Next, Start } +pkg net/smtp, type Auth interface, Next([]uint8, bool) ([]uint8, error) +pkg net/smtp, type Auth interface, Start(*ServerInfo) (string, []uint8, error) +pkg net/smtp, type Client struct +pkg net/smtp, type Client struct, Text *textproto.Conn +pkg net/smtp, type ServerInfo struct +pkg net/smtp, type ServerInfo struct, Auth []string +pkg net/smtp, type ServerInfo struct, Name string +pkg net/smtp, type ServerInfo struct, TLS bool +pkg net/textproto, func CanonicalMIMEHeaderKey(string) string +pkg net/textproto, func Dial(string, string) (*Conn, error) +pkg net/textproto, func NewConn(io.ReadWriteCloser) *Conn +pkg net/textproto, func NewReader(*bufio.Reader) *Reader +pkg net/textproto, func NewWriter(*bufio.Writer) *Writer +pkg net/textproto, method (*Conn) Close() error +pkg net/textproto, method (*Conn) Cmd(string, ...interface{}) (uint, error) +pkg net/textproto, method (*Conn) DotReader() io.Reader +pkg net/textproto, method (*Conn) DotWriter() io.WriteCloser +pkg net/textproto, method (*Conn) EndRequest(uint) +pkg net/textproto, method (*Conn) EndResponse(uint) +pkg net/textproto, method (*Conn) Next() uint +pkg net/textproto, method (*Conn) PrintfLine(string, ...interface{}) error +pkg net/textproto, method (*Conn) ReadCodeLine(int) (int, string, error) +pkg net/textproto, method (*Conn) ReadContinuedLine() (string, error) +pkg net/textproto, method (*Conn) ReadContinuedLineBytes() ([]uint8, error) +pkg net/textproto, method (*Conn) ReadDotBytes() ([]uint8, error) +pkg net/textproto, method (*Conn) ReadDotLines() ([]string, error) +pkg net/textproto, method (*Conn) ReadLine() (string, error) +pkg net/textproto, method (*Conn) ReadLineBytes() ([]uint8, error) +pkg net/textproto, method (*Conn) ReadMIMEHeader() (MIMEHeader, error) +pkg net/textproto, method (*Conn) ReadResponse(int) (int, string, error) +pkg net/textproto, method (*Conn) StartRequest(uint) +pkg net/textproto, method (*Conn) StartResponse(uint) +pkg net/textproto, method (*Error) Error() string +pkg net/textproto, method (*Pipeline) EndRequest(uint) +pkg net/textproto, method (*Pipeline) EndResponse(uint) +pkg net/textproto, method (*Pipeline) Next() uint +pkg net/textproto, method (*Pipeline) StartRequest(uint) +pkg net/textproto, method (*Pipeline) StartResponse(uint) +pkg net/textproto, method (*Reader) DotReader() io.Reader +pkg net/textproto, method (*Reader) ReadCodeLine(int) (int, string, error) +pkg net/textproto, method (*Reader) ReadContinuedLine() (string, error) +pkg net/textproto, method (*Reader) ReadContinuedLineBytes() ([]uint8, error) +pkg net/textproto, method (*Reader) ReadDotBytes() ([]uint8, error) +pkg net/textproto, method (*Reader) ReadDotLines() ([]string, error) +pkg net/textproto, method (*Reader) ReadLine() (string, error) +pkg net/textproto, method (*Reader) ReadLineBytes() ([]uint8, error) +pkg net/textproto, method (*Reader) ReadMIMEHeader() (MIMEHeader, error) +pkg net/textproto, method (*Reader) ReadResponse(int) (int, string, error) +pkg net/textproto, method (*Writer) DotWriter() io.WriteCloser +pkg net/textproto, method (*Writer) PrintfLine(string, ...interface{}) error +pkg net/textproto, method (MIMEHeader) Add(string, string) +pkg net/textproto, method (MIMEHeader) Del(string) +pkg net/textproto, method (MIMEHeader) Get(string) string +pkg net/textproto, method (MIMEHeader) Set(string, string) +pkg net/textproto, method (ProtocolError) Error() string +pkg net/textproto, type Conn struct +pkg net/textproto, type Conn struct, embedded Pipeline +pkg net/textproto, type Conn struct, embedded Reader +pkg net/textproto, type Conn struct, embedded Writer +pkg net/textproto, type Error struct +pkg net/textproto, type Error struct, Code int +pkg net/textproto, type Error struct, Msg string +pkg net/textproto, type MIMEHeader map[string][]string +pkg net/textproto, type Pipeline struct +pkg net/textproto, type ProtocolError string +pkg net/textproto, type Reader struct +pkg net/textproto, type Reader struct, R *bufio.Reader +pkg net/textproto, type Writer struct +pkg net/textproto, type Writer struct, W *bufio.Writer +pkg net/url, func Parse(string) (*URL, error) +pkg net/url, func ParseQuery(string) (Values, error) +pkg net/url, func ParseRequestURI(string) (*URL, error) +pkg net/url, func QueryEscape(string) string +pkg net/url, func QueryUnescape(string) (string, error) +pkg net/url, func User(string) *Userinfo +pkg net/url, func UserPassword(string, string) *Userinfo +pkg net/url, method (*Error) Error() string +pkg net/url, method (*URL) IsAbs() bool +pkg net/url, method (*URL) Parse(string) (*URL, error) +pkg net/url, method (*URL) Query() Values +pkg net/url, method (*URL) RequestURI() string +pkg net/url, method (*URL) ResolveReference(*URL) *URL +pkg net/url, method (*URL) String() string +pkg net/url, method (*Userinfo) Password() (string, bool) +pkg net/url, method (*Userinfo) String() string +pkg net/url, method (*Userinfo) Username() string +pkg net/url, method (EscapeError) Error() string +pkg net/url, method (Values) Add(string, string) +pkg net/url, method (Values) Del(string) +pkg net/url, method (Values) Encode() string +pkg net/url, method (Values) Get(string) string +pkg net/url, method (Values) Set(string, string) +pkg net/url, type Error struct +pkg net/url, type Error struct, Err error +pkg net/url, type Error struct, Op string +pkg net/url, type Error struct, URL string +pkg net/url, type EscapeError string +pkg net/url, type URL struct +pkg net/url, type URL struct, Fragment string +pkg net/url, type URL struct, Host string +pkg net/url, type URL struct, Opaque string +pkg net/url, type URL struct, Path string +pkg net/url, type URL struct, RawQuery string +pkg net/url, type URL struct, Scheme string +pkg net/url, type URL struct, User *Userinfo +pkg net/url, type Userinfo struct +pkg net/url, type Values map[string][]string +pkg os, const DevNull ideal-string +pkg os, const ModeAppend FileMode +pkg os, const ModeCharDevice FileMode +pkg os, const ModeDevice FileMode +pkg os, const ModeDir FileMode +pkg os, const ModeExclusive FileMode +pkg os, const ModeNamedPipe FileMode +pkg os, const ModePerm FileMode +pkg os, const ModeSetgid FileMode +pkg os, const ModeSetuid FileMode +pkg os, const ModeSocket FileMode +pkg os, const ModeSticky FileMode +pkg os, const ModeSymlink FileMode +pkg os, const ModeTemporary FileMode +pkg os, const ModeType FileMode +pkg os, const O_APPEND int +pkg os, const O_CREATE int +pkg os, const O_EXCL int +pkg os, const O_RDONLY int +pkg os, const O_RDWR int +pkg os, const O_SYNC int +pkg os, const O_TRUNC int +pkg os, const O_WRONLY int +pkg os, const PathListSeparator ideal-char +pkg os, const PathSeparator ideal-char +pkg os, const SEEK_CUR int +pkg os, const SEEK_END int +pkg os, const SEEK_SET int +pkg os, func Chdir(string) error +pkg os, func Chmod(string, FileMode) error +pkg os, func Chown(string, int, int) error +pkg os, func Chtimes(string, time.Time, time.Time) error +pkg os, func Clearenv() +pkg os, func Create(string) (*File, error) +pkg os, func Environ() []string +pkg os, func Exit(int) +pkg os, func Expand(string, func(string) string) string +pkg os, func ExpandEnv(string) string +pkg os, func FindProcess(int) (*Process, error) +pkg os, func Getegid() int +pkg os, func Getenv(string) string +pkg os, func Geteuid() int +pkg os, func Getgid() int +pkg os, func Getgroups() ([]int, error) +pkg os, func Getpagesize() int +pkg os, func Getpid() int +pkg os, func Getppid() int +pkg os, func Getuid() int +pkg os, func Getwd() (string, error) +pkg os, func Hostname() (string, error) +pkg os, func IsExist(error) bool +pkg os, func IsNotExist(error) bool +pkg os, func IsPathSeparator(uint8) bool +pkg os, func IsPermission(error) bool +pkg os, func Lchown(string, int, int) error +pkg os, func Link(string, string) error +pkg os, func Lstat(string) (FileInfo, error) +pkg os, func Mkdir(string, FileMode) error +pkg os, func MkdirAll(string, FileMode) error +pkg os, func NewFile(uintptr, string) *File +pkg os, func NewSyscallError(string, error) error +pkg os, func Open(string) (*File, error) +pkg os, func OpenFile(string, int, FileMode) (*File, error) +pkg os, func Pipe() (*File, *File, error) +pkg os, func Readlink(string) (string, error) +pkg os, func Remove(string) error +pkg os, func RemoveAll(string) error +pkg os, func Rename(string, string) error +pkg os, func SameFile(FileInfo, FileInfo) bool +pkg os, func Setenv(string, string) error +pkg os, func StartProcess(string, []string, *ProcAttr) (*Process, error) +pkg os, func Stat(string) (FileInfo, error) +pkg os, func Symlink(string, string) error +pkg os, func TempDir() string +pkg os, func Truncate(string, int64) error +pkg os, method (*File) Chdir() error +pkg os, method (*File) Chmod(FileMode) error +pkg os, method (*File) Chown(int, int) error +pkg os, method (*File) Close() error +pkg os, method (*File) Fd() uintptr +pkg os, method (*File) Name() string +pkg os, method (*File) Read([]uint8) (int, error) +pkg os, method (*File) ReadAt([]uint8, int64) (int, error) +pkg os, method (*File) Readdir(int) ([]FileInfo, error) +pkg os, method (*File) Readdirnames(int) ([]string, error) +pkg os, method (*File) Seek(int64, int) (int64, error) +pkg os, method (*File) Stat() (FileInfo, error) +pkg os, method (*File) Sync() error +pkg os, method (*File) Truncate(int64) error +pkg os, method (*File) Write([]uint8) (int, error) +pkg os, method (*File) WriteAt([]uint8, int64) (int, error) +pkg os, method (*File) WriteString(string) (int, error) +pkg os, method (*LinkError) Error() string +pkg os, method (*PathError) Error() string +pkg os, method (*Process) Kill() error +pkg os, method (*Process) Release() error +pkg os, method (*Process) Signal(Signal) error +pkg os, method (*Process) Wait() (*ProcessState, error) +pkg os, method (*ProcessState) Exited() bool +pkg os, method (*ProcessState) Pid() int +pkg os, method (*ProcessState) String() string +pkg os, method (*ProcessState) Success() bool +pkg os, method (*ProcessState) Sys() interface{} +pkg os, method (*ProcessState) SysUsage() interface{} +pkg os, method (*ProcessState) SystemTime() time.Duration +pkg os, method (*ProcessState) UserTime() time.Duration +pkg os, method (*SyscallError) Error() string +pkg os, method (FileMode) IsDir() bool +pkg os, method (FileMode) Perm() FileMode +pkg os, method (FileMode) String() string +pkg os, type File struct +pkg os, type FileInfo interface { IsDir, ModTime, Mode, Name, Size, Sys } +pkg os, type FileInfo interface, IsDir() bool +pkg os, type FileInfo interface, ModTime() time.Time +pkg os, type FileInfo interface, Mode() FileMode +pkg os, type FileInfo interface, Name() string +pkg os, type FileInfo interface, Size() int64 +pkg os, type FileInfo interface, Sys() interface{} +pkg os, type FileMode uint32 +pkg os, type LinkError struct +pkg os, type LinkError struct, Err error +pkg os, type LinkError struct, New string +pkg os, type LinkError struct, Old string +pkg os, type LinkError struct, Op string +pkg os, type PathError struct +pkg os, type PathError struct, Err error +pkg os, type PathError struct, Op string +pkg os, type PathError struct, Path string +pkg os, type ProcAttr struct +pkg os, type ProcAttr struct, Dir string +pkg os, type ProcAttr struct, Env []string +pkg os, type ProcAttr struct, Files []*File +pkg os, type ProcAttr struct, Sys *syscall.SysProcAttr +pkg os, type Process struct +pkg os, type Process struct, Pid int +pkg os, type ProcessState struct +pkg os, type Signal interface { Signal, String } +pkg os, type Signal interface, Signal() +pkg os, type Signal interface, String() string +pkg os, type SyscallError struct +pkg os, type SyscallError struct, Err error +pkg os, type SyscallError struct, Syscall string +pkg os, var Args []string +pkg os, var ErrExist error +pkg os, var ErrInvalid error +pkg os, var ErrNotExist error +pkg os, var ErrPermission error +pkg os, var Interrupt Signal +pkg os, var Kill Signal +pkg os, var Stderr *File +pkg os, var Stdin *File +pkg os, var Stdout *File +pkg os/exec, func Command(string, ...string) *Cmd +pkg os/exec, func LookPath(string) (string, error) +pkg os/exec, method (*Cmd) CombinedOutput() ([]uint8, error) +pkg os/exec, method (*Cmd) Output() ([]uint8, error) +pkg os/exec, method (*Cmd) Run() error +pkg os/exec, method (*Cmd) Start() error +pkg os/exec, method (*Cmd) StderrPipe() (io.ReadCloser, error) +pkg os/exec, method (*Cmd) StdinPipe() (io.WriteCloser, error) +pkg os/exec, method (*Cmd) StdoutPipe() (io.ReadCloser, error) +pkg os/exec, method (*Cmd) Wait() error +pkg os/exec, method (*Error) Error() string +pkg os/exec, method (*ExitError) Error() string +pkg os/exec, method (ExitError) Exited() bool +pkg os/exec, method (ExitError) Pid() int +pkg os/exec, method (ExitError) String() string +pkg os/exec, method (ExitError) Success() bool +pkg os/exec, method (ExitError) Sys() interface{} +pkg os/exec, method (ExitError) SysUsage() interface{} +pkg os/exec, method (ExitError) SystemTime() time.Duration +pkg os/exec, method (ExitError) UserTime() time.Duration +pkg os/exec, type Cmd struct +pkg os/exec, type Cmd struct, Args []string +pkg os/exec, type Cmd struct, Dir string +pkg os/exec, type Cmd struct, Env []string +pkg os/exec, type Cmd struct, ExtraFiles []*os.File +pkg os/exec, type Cmd struct, Path string +pkg os/exec, type Cmd struct, Process *os.Process +pkg os/exec, type Cmd struct, ProcessState *os.ProcessState +pkg os/exec, type Cmd struct, Stderr io.Writer +pkg os/exec, type Cmd struct, Stdin io.Reader +pkg os/exec, type Cmd struct, Stdout io.Writer +pkg os/exec, type Cmd struct, SysProcAttr *syscall.SysProcAttr +pkg os/exec, type Error struct +pkg os/exec, type Error struct, Err error +pkg os/exec, type Error struct, Name string +pkg os/exec, type ExitError struct +pkg os/exec, type ExitError struct, embedded *os.ProcessState +pkg os/exec, var ErrNotFound error +pkg os/signal, func Notify(chan<- os.Signal, ...os.Signal) +pkg os/user, func Current() (*User, error) +pkg os/user, func Lookup(string) (*User, error) +pkg os/user, func LookupId(string) (*User, error) +pkg os/user, method (UnknownUserError) Error() string +pkg os/user, method (UnknownUserIdError) Error() string +pkg os/user, type UnknownUserError string +pkg os/user, type UnknownUserIdError int +pkg os/user, type User struct +pkg os/user, type User struct, Gid string +pkg os/user, type User struct, HomeDir string +pkg os/user, type User struct, Name string +pkg os/user, type User struct, Uid string +pkg os/user, type User struct, Username string +pkg path, func Base(string) string +pkg path, func Clean(string) string +pkg path, func Dir(string) string +pkg path, func Ext(string) string +pkg path, func IsAbs(string) bool +pkg path, func Join(...string) string +pkg path, func Match(string, string) (bool, error) +pkg path, func Split(string) (string, string) +pkg path, var ErrBadPattern error +pkg path/filepath, const ListSeparator ideal-char +pkg path/filepath, const Separator ideal-char +pkg path/filepath, func Abs(string) (string, error) +pkg path/filepath, func Base(string) string +pkg path/filepath, func Clean(string) string +pkg path/filepath, func Dir(string) string +pkg path/filepath, func EvalSymlinks(string) (string, error) +pkg path/filepath, func Ext(string) string +pkg path/filepath, func FromSlash(string) string +pkg path/filepath, func Glob(string) ([]string, error) +pkg path/filepath, func HasPrefix(string, string) bool +pkg path/filepath, func IsAbs(string) bool +pkg path/filepath, func Join(...string) string +pkg path/filepath, func Match(string, string) (bool, error) +pkg path/filepath, func Rel(string, string) (string, error) +pkg path/filepath, func Split(string) (string, string) +pkg path/filepath, func SplitList(string) []string +pkg path/filepath, func ToSlash(string) string +pkg path/filepath, func VolumeName(string) string +pkg path/filepath, func Walk(string, WalkFunc) error +pkg path/filepath, type WalkFunc func(string, os.FileInfo, error) error +pkg path/filepath, var ErrBadPattern error +pkg path/filepath, var SkipDir error +pkg reflect, const Array Kind +pkg reflect, const Bool Kind +pkg reflect, const BothDir ChanDir +pkg reflect, const Chan Kind +pkg reflect, const Complex128 Kind +pkg reflect, const Complex64 Kind +pkg reflect, const Float32 Kind +pkg reflect, const Float64 Kind +pkg reflect, const Func Kind +pkg reflect, const Int Kind +pkg reflect, const Int16 Kind +pkg reflect, const Int32 Kind +pkg reflect, const Int64 Kind +pkg reflect, const Int8 Kind +pkg reflect, const Interface Kind +pkg reflect, const Invalid Kind +pkg reflect, const Map Kind +pkg reflect, const Ptr Kind +pkg reflect, const RecvDir ChanDir +pkg reflect, const SendDir ChanDir +pkg reflect, const Slice Kind +pkg reflect, const String Kind +pkg reflect, const Struct Kind +pkg reflect, const Uint Kind +pkg reflect, const Uint16 Kind +pkg reflect, const Uint32 Kind +pkg reflect, const Uint64 Kind +pkg reflect, const Uint8 Kind +pkg reflect, const Uintptr Kind +pkg reflect, const UnsafePointer Kind +pkg reflect, func Append(Value, ...Value) Value +pkg reflect, func AppendSlice(Value, Value) Value +pkg reflect, func Copy(Value, Value) int +pkg reflect, func DeepEqual(interface{}, interface{}) bool +pkg reflect, func Indirect(Value) Value +pkg reflect, func MakeChan(Type, int) Value +pkg reflect, func MakeMap(Type) Value +pkg reflect, func MakeSlice(Type, int, int) Value +pkg reflect, func New(Type) Value +pkg reflect, func NewAt(Type, unsafe.Pointer) Value +pkg reflect, func PtrTo(Type) Type +pkg reflect, func TypeOf(interface{}) Type +pkg reflect, func ValueOf(interface{}) Value +pkg reflect, func Zero(Type) Value +pkg reflect, method (*ValueError) Error() string +pkg reflect, method (ChanDir) String() string +pkg reflect, method (Kind) String() string +pkg reflect, method (StructTag) Get(string) string +pkg reflect, method (Value) Addr() Value +pkg reflect, method (Value) Bool() bool +pkg reflect, method (Value) Bytes() []uint8 +pkg reflect, method (Value) Call([]Value) []Value +pkg reflect, method (Value) CallSlice([]Value) []Value +pkg reflect, method (Value) CanAddr() bool +pkg reflect, method (Value) CanInterface() bool +pkg reflect, method (Value) CanSet() bool +pkg reflect, method (Value) Cap() int +pkg reflect, method (Value) Close() +pkg reflect, method (Value) Complex() complex128 +pkg reflect, method (Value) Elem() Value +pkg reflect, method (Value) Field(int) Value +pkg reflect, method (Value) FieldByIndex([]int) Value +pkg reflect, method (Value) FieldByName(string) Value +pkg reflect, method (Value) FieldByNameFunc(func(string) bool) Value +pkg reflect, method (Value) Float() float64 +pkg reflect, method (Value) Index(int) Value +pkg reflect, method (Value) Int() int64 +pkg reflect, method (Value) Interface() interface{} +pkg reflect, method (Value) InterfaceData() [2]uintptr +pkg reflect, method (Value) IsNil() bool +pkg reflect, method (Value) IsValid() bool +pkg reflect, method (Value) Kind() Kind +pkg reflect, method (Value) Len() int +pkg reflect, method (Value) MapIndex(Value) Value +pkg reflect, method (Value) MapKeys() []Value +pkg reflect, method (Value) Method(int) Value +pkg reflect, method (Value) MethodByName(string) Value +pkg reflect, method (Value) NumField() int +pkg reflect, method (Value) NumMethod() int +pkg reflect, method (Value) OverflowComplex(complex128) bool +pkg reflect, method (Value) OverflowFloat(float64) bool +pkg reflect, method (Value) OverflowInt(int64) bool +pkg reflect, method (Value) OverflowUint(uint64) bool +pkg reflect, method (Value) Pointer() uintptr +pkg reflect, method (Value) Recv() (Value, bool) +pkg reflect, method (Value) Send(Value) +pkg reflect, method (Value) Set(Value) +pkg reflect, method (Value) SetBool(bool) +pkg reflect, method (Value) SetBytes([]uint8) +pkg reflect, method (Value) SetComplex(complex128) +pkg reflect, method (Value) SetFloat(float64) +pkg reflect, method (Value) SetInt(int64) +pkg reflect, method (Value) SetLen(int) +pkg reflect, method (Value) SetMapIndex(Value, Value) +pkg reflect, method (Value) SetPointer(unsafe.Pointer) +pkg reflect, method (Value) SetString(string) +pkg reflect, method (Value) SetUint(uint64) +pkg reflect, method (Value) Slice(int, int) Value +pkg reflect, method (Value) String() string +pkg reflect, method (Value) TryRecv() (Value, bool) +pkg reflect, method (Value) TrySend(Value) bool +pkg reflect, method (Value) Type() Type +pkg reflect, method (Value) Uint() uint64 +pkg reflect, method (Value) UnsafeAddr() uintptr +pkg reflect, type ChanDir int +pkg reflect, type Kind uint +pkg reflect, type Method struct +pkg reflect, type Method struct, Func Value +pkg reflect, type Method struct, Index int +pkg reflect, type Method struct, Name string +pkg reflect, type Method struct, PkgPath string +pkg reflect, type Method struct, Type Type +pkg reflect, type SliceHeader struct +pkg reflect, type SliceHeader struct, Cap int +pkg reflect, type SliceHeader struct, Data uintptr +pkg reflect, type SliceHeader struct, Len int +pkg reflect, type StringHeader struct +pkg reflect, type StringHeader struct, Data uintptr +pkg reflect, type StringHeader struct, Len int +pkg reflect, type StructField struct +pkg reflect, type StructField struct, Anonymous bool +pkg reflect, type StructField struct, Index []int +pkg reflect, type StructField struct, Name string +pkg reflect, type StructField struct, Offset uintptr +pkg reflect, type StructField struct, PkgPath string +pkg reflect, type StructField struct, Tag StructTag +pkg reflect, type StructField struct, Type Type +pkg reflect, type StructTag string +pkg reflect, type Type interface, Align() int +pkg reflect, type Type interface, AssignableTo(Type) bool +pkg reflect, type Type interface, Bits() int +pkg reflect, type Type interface, ChanDir() ChanDir +pkg reflect, type Type interface, Elem() Type +pkg reflect, type Type interface, Field(int) StructField +pkg reflect, type Type interface, FieldAlign() int +pkg reflect, type Type interface, FieldByIndex([]int) StructField +pkg reflect, type Type interface, FieldByName(string) (StructField, bool) +pkg reflect, type Type interface, FieldByNameFunc(func(string) bool) (StructField, bool) +pkg reflect, type Type interface, Implements(Type) bool +pkg reflect, type Type interface, In(int) Type +pkg reflect, type Type interface, IsVariadic() bool +pkg reflect, type Type interface, Key() Type +pkg reflect, type Type interface, Kind() Kind +pkg reflect, type Type interface, Len() int +pkg reflect, type Type interface, Method(int) Method +pkg reflect, type Type interface, MethodByName(string) (Method, bool) +pkg reflect, type Type interface, Name() string +pkg reflect, type Type interface, NumField() int +pkg reflect, type Type interface, NumIn() int +pkg reflect, type Type interface, NumMethod() int +pkg reflect, type Type interface, NumOut() int +pkg reflect, type Type interface, Out(int) Type +pkg reflect, type Type interface, PkgPath() string +pkg reflect, type Type interface, Size() uintptr +pkg reflect, type Type interface, String() string +pkg reflect, type Type interface, unexported methods +pkg reflect, type Value struct +pkg reflect, type ValueError struct +pkg reflect, type ValueError struct, Kind Kind +pkg reflect, type ValueError struct, Method string +pkg regexp, func Compile(string) (*Regexp, error) +pkg regexp, func CompilePOSIX(string) (*Regexp, error) +pkg regexp, func Match(string, []uint8) (bool, error) +pkg regexp, func MatchReader(string, io.RuneReader) (bool, error) +pkg regexp, func MatchString(string, string) (bool, error) +pkg regexp, func MustCompile(string) *Regexp +pkg regexp, func MustCompilePOSIX(string) *Regexp +pkg regexp, func QuoteMeta(string) string +pkg regexp, method (*Regexp) Expand([]uint8, []uint8, []uint8, []int) []uint8 +pkg regexp, method (*Regexp) ExpandString([]uint8, string, string, []int) []uint8 +pkg regexp, method (*Regexp) Find([]uint8) []uint8 +pkg regexp, method (*Regexp) FindAll([]uint8, int) [][]uint8 +pkg regexp, method (*Regexp) FindAllIndex([]uint8, int) [][]int +pkg regexp, method (*Regexp) FindAllString(string, int) []string +pkg regexp, method (*Regexp) FindAllStringIndex(string, int) [][]int +pkg regexp, method (*Regexp) FindAllStringSubmatch(string, int) [][]string +pkg regexp, method (*Regexp) FindAllStringSubmatchIndex(string, int) [][]int +pkg regexp, method (*Regexp) FindAllSubmatch([]uint8, int) [][][]uint8 +pkg regexp, method (*Regexp) FindAllSubmatchIndex([]uint8, int) [][]int +pkg regexp, method (*Regexp) FindIndex([]uint8) []int +pkg regexp, method (*Regexp) FindReaderIndex(io.RuneReader) []int +pkg regexp, method (*Regexp) FindReaderSubmatchIndex(io.RuneReader) []int +pkg regexp, method (*Regexp) FindString(string) string +pkg regexp, method (*Regexp) FindStringIndex(string) []int +pkg regexp, method (*Regexp) FindStringSubmatch(string) []string +pkg regexp, method (*Regexp) FindStringSubmatchIndex(string) []int +pkg regexp, method (*Regexp) FindSubmatch([]uint8) [][]uint8 +pkg regexp, method (*Regexp) FindSubmatchIndex([]uint8) []int +pkg regexp, method (*Regexp) LiteralPrefix() (string, bool) +pkg regexp, method (*Regexp) Match([]uint8) bool +pkg regexp, method (*Regexp) MatchReader(io.RuneReader) bool +pkg regexp, method (*Regexp) MatchString(string) bool +pkg regexp, method (*Regexp) NumSubexp() int +pkg regexp, method (*Regexp) ReplaceAll([]uint8, []uint8) []uint8 +pkg regexp, method (*Regexp) ReplaceAllFunc([]uint8, func([]uint8) []uint8) []uint8 +pkg regexp, method (*Regexp) ReplaceAllLiteral([]uint8, []uint8) []uint8 +pkg regexp, method (*Regexp) ReplaceAllLiteralString(string, string) string +pkg regexp, method (*Regexp) ReplaceAllString(string, string) string +pkg regexp, method (*Regexp) ReplaceAllStringFunc(string, func(string) string) string +pkg regexp, method (*Regexp) String() string +pkg regexp, method (*Regexp) SubexpNames() []string +pkg regexp, type Regexp struct +pkg regexp/syntax, const ClassNL Flags +pkg regexp/syntax, const DotNL Flags +pkg regexp/syntax, const EmptyBeginLine EmptyOp +pkg regexp/syntax, const EmptyBeginText EmptyOp +pkg regexp/syntax, const EmptyEndLine EmptyOp +pkg regexp/syntax, const EmptyEndText EmptyOp +pkg regexp/syntax, const EmptyNoWordBoundary EmptyOp +pkg regexp/syntax, const EmptyWordBoundary EmptyOp +pkg regexp/syntax, const ErrInternalError ErrorCode +pkg regexp/syntax, const ErrInvalidCharClass ErrorCode +pkg regexp/syntax, const ErrInvalidCharRange ErrorCode +pkg regexp/syntax, const ErrInvalidEscape ErrorCode +pkg regexp/syntax, const ErrInvalidNamedCapture ErrorCode +pkg regexp/syntax, const ErrInvalidPerlOp ErrorCode +pkg regexp/syntax, const ErrInvalidRepeatOp ErrorCode +pkg regexp/syntax, const ErrInvalidRepeatSize ErrorCode +pkg regexp/syntax, const ErrInvalidUTF8 ErrorCode +pkg regexp/syntax, const ErrMissingBracket ErrorCode +pkg regexp/syntax, const ErrMissingParen ErrorCode +pkg regexp/syntax, const ErrMissingRepeatArgument ErrorCode +pkg regexp/syntax, const ErrTrailingBackslash ErrorCode +pkg regexp/syntax, const FoldCase Flags +pkg regexp/syntax, const InstAlt InstOp +pkg regexp/syntax, const InstAltMatch InstOp +pkg regexp/syntax, const InstCapture InstOp +pkg regexp/syntax, const InstEmptyWidth InstOp +pkg regexp/syntax, const InstFail InstOp +pkg regexp/syntax, const InstMatch InstOp +pkg regexp/syntax, const InstNop InstOp +pkg regexp/syntax, const InstRune InstOp +pkg regexp/syntax, const InstRune1 InstOp +pkg regexp/syntax, const InstRuneAny InstOp +pkg regexp/syntax, const InstRuneAnyNotNL InstOp +pkg regexp/syntax, const Literal Flags +pkg regexp/syntax, const MatchNL Flags +pkg regexp/syntax, const NonGreedy Flags +pkg regexp/syntax, const OneLine Flags +pkg regexp/syntax, const OpAlternate Op +pkg regexp/syntax, const OpAnyChar Op +pkg regexp/syntax, const OpAnyCharNotNL Op +pkg regexp/syntax, const OpBeginLine Op +pkg regexp/syntax, const OpBeginText Op +pkg regexp/syntax, const OpCapture Op +pkg regexp/syntax, const OpCharClass Op +pkg regexp/syntax, const OpConcat Op +pkg regexp/syntax, const OpEmptyMatch Op +pkg regexp/syntax, const OpEndLine Op +pkg regexp/syntax, const OpEndText Op +pkg regexp/syntax, const OpLiteral Op +pkg regexp/syntax, const OpNoMatch Op +pkg regexp/syntax, const OpNoWordBoundary Op +pkg regexp/syntax, const OpPlus Op +pkg regexp/syntax, const OpQuest Op +pkg regexp/syntax, const OpRepeat Op +pkg regexp/syntax, const OpStar Op +pkg regexp/syntax, const OpWordBoundary Op +pkg regexp/syntax, const POSIX Flags +pkg regexp/syntax, const Perl Flags +pkg regexp/syntax, const PerlX Flags +pkg regexp/syntax, const Simple Flags +pkg regexp/syntax, const UnicodeGroups Flags +pkg regexp/syntax, const WasDollar Flags +pkg regexp/syntax, func Compile(*Regexp) (*Prog, error) +pkg regexp/syntax, func EmptyOpContext(int32, int32) EmptyOp +pkg regexp/syntax, func IsWordChar(int32) bool +pkg regexp/syntax, func Parse(string, Flags) (*Regexp, error) +pkg regexp/syntax, method (*Error) Error() string +pkg regexp/syntax, method (*Inst) MatchEmptyWidth(int32, int32) bool +pkg regexp/syntax, method (*Inst) MatchRune(int32) bool +pkg regexp/syntax, method (*Inst) String() string +pkg regexp/syntax, method (*Prog) Prefix() (string, bool) +pkg regexp/syntax, method (*Prog) StartCond() EmptyOp +pkg regexp/syntax, method (*Prog) String() string +pkg regexp/syntax, method (*Regexp) CapNames() []string +pkg regexp/syntax, method (*Regexp) Equal(*Regexp) bool +pkg regexp/syntax, method (*Regexp) MaxCap() int +pkg regexp/syntax, method (*Regexp) Simplify() *Regexp +pkg regexp/syntax, method (*Regexp) String() string +pkg regexp/syntax, method (ErrorCode) String() string +pkg regexp/syntax, type EmptyOp uint8 +pkg regexp/syntax, type Error struct +pkg regexp/syntax, type Error struct, Code ErrorCode +pkg regexp/syntax, type Error struct, Expr string +pkg regexp/syntax, type ErrorCode string +pkg regexp/syntax, type Flags uint16 +pkg regexp/syntax, type Inst struct +pkg regexp/syntax, type Inst struct, Arg uint32 +pkg regexp/syntax, type Inst struct, Op InstOp +pkg regexp/syntax, type Inst struct, Out uint32 +pkg regexp/syntax, type Inst struct, Rune []int32 +pkg regexp/syntax, type InstOp uint8 +pkg regexp/syntax, type Op uint8 +pkg regexp/syntax, type Prog struct +pkg regexp/syntax, type Prog struct, Inst []Inst +pkg regexp/syntax, type Prog struct, NumCap int +pkg regexp/syntax, type Prog struct, Start int +pkg regexp/syntax, type Regexp struct +pkg regexp/syntax, type Regexp struct, Cap int +pkg regexp/syntax, type Regexp struct, Flags Flags +pkg regexp/syntax, type Regexp struct, Max int +pkg regexp/syntax, type Regexp struct, Min int +pkg regexp/syntax, type Regexp struct, Name string +pkg regexp/syntax, type Regexp struct, Op Op +pkg regexp/syntax, type Regexp struct, Rune []int32 +pkg regexp/syntax, type Regexp struct, Rune0 [2]int32 +pkg regexp/syntax, type Regexp struct, Sub []*Regexp +pkg regexp/syntax, type Regexp struct, Sub0 [1]*Regexp +pkg runtime, const Compiler ideal-string +pkg runtime, const GOARCH string +pkg runtime, const GOOS string +pkg runtime, func Breakpoint() +pkg runtime, func CPUProfile() []uint8 +pkg runtime, func Caller(int) (uintptr, string, int, bool) +pkg runtime, func Callers(int, []uintptr) int +pkg runtime, func FuncForPC(uintptr) *Func +pkg runtime, func GC() +pkg runtime, func GOMAXPROCS(int) int +pkg runtime, func GOROOT() string +pkg runtime, func Goexit() +pkg runtime, func GoroutineProfile([]StackRecord) (int, bool) +pkg runtime, func Gosched() +pkg runtime, func LockOSThread() +pkg runtime, func MemProfile([]MemProfileRecord, bool) (int, bool) +pkg runtime, func NumCPU() int +pkg runtime, func NumCgoCall() int64 +pkg runtime, func NumGoroutine() int +pkg runtime, func ReadMemStats(*MemStats) +pkg runtime, func SetCPUProfileRate(int) +pkg runtime, func SetFinalizer(interface{}, interface{}) +pkg runtime, func Stack([]uint8, bool) int +pkg runtime, func ThreadCreateProfile([]StackRecord) (int, bool) +pkg runtime, func UnlockOSThread() +pkg runtime, func Version() string +pkg runtime, method (*Func) Entry() uintptr +pkg runtime, method (*Func) FileLine(uintptr) (string, int) +pkg runtime, method (*Func) Name() string +pkg runtime, method (*MemProfileRecord) InUseBytes() int64 +pkg runtime, method (*MemProfileRecord) InUseObjects() int64 +pkg runtime, method (*MemProfileRecord) Stack() []uintptr +pkg runtime, method (*StackRecord) Stack() []uintptr +pkg runtime, method (*TypeAssertionError) Error() string +pkg runtime, method (*TypeAssertionError) RuntimeError() +pkg runtime, type Error interface { Error, RuntimeError } +pkg runtime, type Error interface, Error() string +pkg runtime, type Error interface, RuntimeError() +pkg runtime, type Func struct +pkg runtime, type MemProfileRecord struct +pkg runtime, type MemProfileRecord struct, AllocBytes int64 +pkg runtime, type MemProfileRecord struct, AllocObjects int64 +pkg runtime, type MemProfileRecord struct, FreeBytes int64 +pkg runtime, type MemProfileRecord struct, FreeObjects int64 +pkg runtime, type MemProfileRecord struct, Stack0 [32]uintptr +pkg runtime, type MemStats struct +pkg runtime, type MemStats struct, Alloc uint64 +pkg runtime, type MemStats struct, BuckHashSys uint64 +pkg runtime, type MemStats struct, BySize [61]struct +pkg runtime, type MemStats struct, DebugGC bool +pkg runtime, type MemStats struct, EnableGC bool +pkg runtime, type MemStats struct, Frees uint64 +pkg runtime, type MemStats struct, HeapAlloc uint64 +pkg runtime, type MemStats struct, HeapIdle uint64 +pkg runtime, type MemStats struct, HeapInuse uint64 +pkg runtime, type MemStats struct, HeapObjects uint64 +pkg runtime, type MemStats struct, HeapReleased uint64 +pkg runtime, type MemStats struct, HeapSys uint64 +pkg runtime, type MemStats struct, LastGC uint64 +pkg runtime, type MemStats struct, Lookups uint64 +pkg runtime, type MemStats struct, MCacheInuse uint64 +pkg runtime, type MemStats struct, MCacheSys uint64 +pkg runtime, type MemStats struct, MSpanInuse uint64 +pkg runtime, type MemStats struct, MSpanSys uint64 +pkg runtime, type MemStats struct, Mallocs uint64 +pkg runtime, type MemStats struct, NextGC uint64 +pkg runtime, type MemStats struct, NumGC uint32 +pkg runtime, type MemStats struct, PauseNs [256]uint64 +pkg runtime, type MemStats struct, PauseTotalNs uint64 +pkg runtime, type MemStats struct, StackInuse uint64 +pkg runtime, type MemStats struct, StackSys uint64 +pkg runtime, type MemStats struct, Sys uint64 +pkg runtime, type MemStats struct, TotalAlloc uint64 +pkg runtime, type StackRecord struct +pkg runtime, type StackRecord struct, Stack0 [32]uintptr +pkg runtime, type TypeAssertionError struct +pkg runtime, var MemProfileRate int +pkg runtime/debug, func PrintStack() +pkg runtime/debug, func Stack() []uint8 +pkg runtime/pprof, func Lookup(string) *Profile +pkg runtime/pprof, func NewProfile(string) *Profile +pkg runtime/pprof, func Profiles() []*Profile +pkg runtime/pprof, func StartCPUProfile(io.Writer) error +pkg runtime/pprof, func StopCPUProfile() +pkg runtime/pprof, func WriteHeapProfile(io.Writer) error +pkg runtime/pprof, method (*Profile) Add(interface{}, int) +pkg runtime/pprof, method (*Profile) Count() int +pkg runtime/pprof, method (*Profile) Name() string +pkg runtime/pprof, method (*Profile) Remove(interface{}) +pkg runtime/pprof, method (*Profile) WriteTo(io.Writer, int) error +pkg runtime/pprof, type Profile struct +pkg sort, func Float64s([]float64) +pkg sort, func Float64sAreSorted([]float64) bool +pkg sort, func Ints([]int) +pkg sort, func IntsAreSorted([]int) bool +pkg sort, func IsSorted(Interface) bool +pkg sort, func Search(int, func(int) bool) int +pkg sort, func SearchFloat64s([]float64, float64) int +pkg sort, func SearchInts([]int, int) int +pkg sort, func SearchStrings([]string, string) int +pkg sort, func Sort(Interface) +pkg sort, func Strings([]string) +pkg sort, func StringsAreSorted([]string) bool +pkg sort, method (Float64Slice) Len() int +pkg sort, method (Float64Slice) Less(int, int) bool +pkg sort, method (Float64Slice) Search(float64) int +pkg sort, method (Float64Slice) Sort() +pkg sort, method (Float64Slice) Swap(int, int) +pkg sort, method (IntSlice) Len() int +pkg sort, method (IntSlice) Less(int, int) bool +pkg sort, method (IntSlice) Search(int) int +pkg sort, method (IntSlice) Sort() +pkg sort, method (IntSlice) Swap(int, int) +pkg sort, method (StringSlice) Len() int +pkg sort, method (StringSlice) Less(int, int) bool +pkg sort, method (StringSlice) Search(string) int +pkg sort, method (StringSlice) Sort() +pkg sort, method (StringSlice) Swap(int, int) +pkg sort, type Float64Slice []float64 +pkg sort, type IntSlice []int +pkg sort, type Interface interface { Len, Less, Swap } +pkg sort, type Interface interface, Len() int +pkg sort, type Interface interface, Less(int, int) bool +pkg sort, type Interface interface, Swap(int, int) +pkg sort, type StringSlice []string +pkg strconv, const IntSize ideal-int +pkg strconv, func AppendBool([]uint8, bool) []uint8 +pkg strconv, func AppendFloat([]uint8, float64, uint8, int, int) []uint8 +pkg strconv, func AppendInt([]uint8, int64, int) []uint8 +pkg strconv, func AppendQuote([]uint8, string) []uint8 +pkg strconv, func AppendQuoteRune([]uint8, int32) []uint8 +pkg strconv, func AppendQuoteRuneToASCII([]uint8, int32) []uint8 +pkg strconv, func AppendQuoteToASCII([]uint8, string) []uint8 +pkg strconv, func AppendUint([]uint8, uint64, int) []uint8 +pkg strconv, func Atoi(string) (int, error) +pkg strconv, func CanBackquote(string) bool +pkg strconv, func FormatBool(bool) string +pkg strconv, func FormatFloat(float64, uint8, int, int) string +pkg strconv, func FormatInt(int64, int) string +pkg strconv, func FormatUint(uint64, int) string +pkg strconv, func IsPrint(int32) bool +pkg strconv, func Itoa(int) string +pkg strconv, func ParseBool(string) (bool, error) +pkg strconv, func ParseFloat(string, int) (float64, error) +pkg strconv, func ParseInt(string, int, int) (int64, error) +pkg strconv, func ParseUint(string, int, int) (uint64, error) +pkg strconv, func Quote(string) string +pkg strconv, func QuoteRune(int32) string +pkg strconv, func QuoteRuneToASCII(int32) string +pkg strconv, func QuoteToASCII(string) string +pkg strconv, func Unquote(string) (string, error) +pkg strconv, func UnquoteChar(string, uint8) (int32, bool, string, error) +pkg strconv, method (*NumError) Error() string +pkg strconv, type NumError struct +pkg strconv, type NumError struct, Err error +pkg strconv, type NumError struct, Func string +pkg strconv, type NumError struct, Num string +pkg strconv, var ErrRange error +pkg strconv, var ErrSyntax error +pkg strings, func Contains(string, string) bool +pkg strings, func ContainsAny(string, string) bool +pkg strings, func ContainsRune(string, int32) bool +pkg strings, func Count(string, string) int +pkg strings, func EqualFold(string, string) bool +pkg strings, func Fields(string) []string +pkg strings, func FieldsFunc(string, func(int32) bool) []string +pkg strings, func HasPrefix(string, string) bool +pkg strings, func HasSuffix(string, string) bool +pkg strings, func Index(string, string) int +pkg strings, func IndexAny(string, string) int +pkg strings, func IndexFunc(string, func(int32) bool) int +pkg strings, func IndexRune(string, int32) int +pkg strings, func Join([]string, string) string +pkg strings, func LastIndex(string, string) int +pkg strings, func LastIndexAny(string, string) int +pkg strings, func LastIndexFunc(string, func(int32) bool) int +pkg strings, func Map(func(int32) int32, string) string +pkg strings, func NewReader(string) *Reader +pkg strings, func NewReplacer(...string) *Replacer +pkg strings, func Repeat(string, int) string +pkg strings, func Replace(string, string, string, int) string +pkg strings, func Split(string, string) []string +pkg strings, func SplitAfter(string, string) []string +pkg strings, func SplitAfterN(string, string, int) []string +pkg strings, func SplitN(string, string, int) []string +pkg strings, func Title(string) string +pkg strings, func ToLower(string) string +pkg strings, func ToLowerSpecial(unicode.SpecialCase, string) string +pkg strings, func ToTitle(string) string +pkg strings, func ToTitleSpecial(unicode.SpecialCase, string) string +pkg strings, func ToUpper(string) string +pkg strings, func ToUpperSpecial(unicode.SpecialCase, string) string +pkg strings, func Trim(string, string) string +pkg strings, func TrimFunc(string, func(int32) bool) string +pkg strings, func TrimLeft(string, string) string +pkg strings, func TrimLeftFunc(string, func(int32) bool) string +pkg strings, func TrimRight(string, string) string +pkg strings, func TrimRightFunc(string, func(int32) bool) string +pkg strings, func TrimSpace(string) string +pkg strings, method (*Reader) Len() int +pkg strings, method (*Reader) Read([]uint8) (int, error) +pkg strings, method (*Reader) ReadAt([]uint8, int64) (int, error) +pkg strings, method (*Reader) ReadByte() (uint8, error) +pkg strings, method (*Reader) ReadRune() (int32, int, error) +pkg strings, method (*Reader) Seek(int64, int) (int64, error) +pkg strings, method (*Reader) UnreadByte() error +pkg strings, method (*Reader) UnreadRune() error +pkg strings, method (*Replacer) Replace(string) string +pkg strings, method (*Replacer) WriteString(io.Writer, string) (int, error) +pkg strings, type Reader struct +pkg strings, type Replacer struct +pkg sync, func NewCond(Locker) *Cond +pkg sync, method (*Cond) Broadcast() +pkg sync, method (*Cond) Signal() +pkg sync, method (*Cond) Wait() +pkg sync, method (*Mutex) Lock() +pkg sync, method (*Mutex) Unlock() +pkg sync, method (*Once) Do(func()) +pkg sync, method (*RWMutex) Lock() +pkg sync, method (*RWMutex) RLock() +pkg sync, method (*RWMutex) RLocker() Locker +pkg sync, method (*RWMutex) RUnlock() +pkg sync, method (*RWMutex) Unlock() +pkg sync, method (*WaitGroup) Add(int) +pkg sync, method (*WaitGroup) Done() +pkg sync, method (*WaitGroup) Wait() +pkg sync, type Cond struct +pkg sync, type Cond struct, L Locker +pkg sync, type Locker interface { Lock, Unlock } +pkg sync, type Locker interface, Lock() +pkg sync, type Locker interface, Unlock() +pkg sync, type Mutex struct +pkg sync, type Once struct +pkg sync, type RWMutex struct +pkg sync, type WaitGroup struct +pkg sync/atomic, func AddInt32(*int32, int32) int32 +pkg sync/atomic, func AddInt64(*int64, int64) int64 +pkg sync/atomic, func AddUint32(*uint32, uint32) uint32 +pkg sync/atomic, func AddUint64(*uint64, uint64) uint64 +pkg sync/atomic, func AddUintptr(*uintptr, uintptr) uintptr +pkg sync/atomic, func CompareAndSwapInt32(*int32, int32, int32) bool +pkg sync/atomic, func CompareAndSwapInt64(*int64, int64, int64) bool +pkg sync/atomic, func CompareAndSwapPointer(*unsafe.Pointer, unsafe.Pointer, unsafe.Pointer) bool +pkg sync/atomic, func CompareAndSwapUint32(*uint32, uint32, uint32) bool +pkg sync/atomic, func CompareAndSwapUint64(*uint64, uint64, uint64) bool +pkg sync/atomic, func CompareAndSwapUintptr(*uintptr, uintptr, uintptr) bool +pkg sync/atomic, func LoadInt32(*int32) int32 +pkg sync/atomic, func LoadInt64(*int64) int64 +pkg sync/atomic, func LoadPointer(*unsafe.Pointer) unsafe.Pointer +pkg sync/atomic, func LoadUint32(*uint32) uint32 +pkg sync/atomic, func LoadUint64(*uint64) uint64 +pkg sync/atomic, func LoadUintptr(*uintptr) uintptr +pkg sync/atomic, func StoreInt32(*int32, int32) +pkg sync/atomic, func StoreInt64(*int64, int64) +pkg sync/atomic, func StorePointer(*unsafe.Pointer, unsafe.Pointer) +pkg sync/atomic, func StoreUint32(*uint32, uint32) +pkg sync/atomic, func StoreUint64(*uint64, uint64) +pkg sync/atomic, func StoreUintptr(*uintptr, uintptr) +pkg syscall (darwin-386), const AF_APPLETALK ideal-int +pkg syscall (darwin-386), const AF_CCITT ideal-int +pkg syscall (darwin-386), const AF_CHAOS ideal-int +pkg syscall (darwin-386), const AF_CNT ideal-int +pkg syscall (darwin-386), const AF_COIP ideal-int +pkg syscall (darwin-386), const AF_DATAKIT ideal-int +pkg syscall (darwin-386), const AF_DECnet ideal-int +pkg syscall (darwin-386), const AF_DLI ideal-int +pkg syscall (darwin-386), const AF_E164 ideal-int +pkg syscall (darwin-386), const AF_ECMA ideal-int +pkg syscall (darwin-386), const AF_HYLINK ideal-int +pkg syscall (darwin-386), const AF_IEEE80211 ideal-int +pkg syscall (darwin-386), const AF_IMPLINK ideal-int +pkg syscall (darwin-386), const AF_IPX ideal-int +pkg syscall (darwin-386), const AF_ISDN ideal-int +pkg syscall (darwin-386), const AF_ISO ideal-int +pkg syscall (darwin-386), const AF_LAT ideal-int +pkg syscall (darwin-386), const AF_LINK ideal-int +pkg syscall (darwin-386), const AF_LOCAL ideal-int +pkg syscall (darwin-386), const AF_MAX ideal-int +pkg syscall (darwin-386), const AF_NATM ideal-int +pkg syscall (darwin-386), const AF_NDRV ideal-int +pkg syscall (darwin-386), const AF_NETBIOS ideal-int +pkg syscall (darwin-386), const AF_NS ideal-int +pkg syscall (darwin-386), const AF_OSI ideal-int +pkg syscall (darwin-386), const AF_PPP ideal-int +pkg syscall (darwin-386), const AF_PUP ideal-int +pkg syscall (darwin-386), const AF_RESERVED_36 ideal-int +pkg syscall (darwin-386), const AF_ROUTE ideal-int +pkg syscall (darwin-386), const AF_SIP ideal-int +pkg syscall (darwin-386), const AF_SNA ideal-int +pkg syscall (darwin-386), const AF_SYSTEM ideal-int +pkg syscall (darwin-386), const BIOCFLUSH ideal-int +pkg syscall (darwin-386), const BIOCGBLEN ideal-int +pkg syscall (darwin-386), const BIOCGDLT ideal-int +pkg syscall (darwin-386), const BIOCGDLTLIST ideal-int +pkg syscall (darwin-386), const BIOCGETIF ideal-int +pkg syscall (darwin-386), const BIOCGHDRCMPLT ideal-int +pkg syscall (darwin-386), const BIOCGRSIG ideal-int +pkg syscall (darwin-386), const BIOCGRTIMEOUT ideal-int +pkg syscall (darwin-386), const BIOCGSEESENT ideal-int +pkg syscall (darwin-386), const BIOCGSTATS ideal-int +pkg syscall (darwin-386), const BIOCIMMEDIATE ideal-int +pkg syscall (darwin-386), const BIOCPROMISC ideal-int +pkg syscall (darwin-386), const BIOCSBLEN ideal-int +pkg syscall (darwin-386), const BIOCSDLT ideal-int +pkg syscall (darwin-386), const BIOCSETF ideal-int +pkg syscall (darwin-386), const BIOCSETIF ideal-int +pkg syscall (darwin-386), const BIOCSHDRCMPLT ideal-int +pkg syscall (darwin-386), const BIOCSRSIG ideal-int +pkg syscall (darwin-386), const BIOCSRTIMEOUT ideal-int +pkg syscall (darwin-386), const BIOCSSEESENT ideal-int +pkg syscall (darwin-386), const BIOCVERSION ideal-int +pkg syscall (darwin-386), const BPF_A ideal-int +pkg syscall (darwin-386), const BPF_ABS ideal-int +pkg syscall (darwin-386), const BPF_ADD ideal-int +pkg syscall (darwin-386), const BPF_ALIGNMENT ideal-int +pkg syscall (darwin-386), const BPF_ALU ideal-int +pkg syscall (darwin-386), const BPF_AND ideal-int +pkg syscall (darwin-386), const BPF_B ideal-int +pkg syscall (darwin-386), const BPF_DIV ideal-int +pkg syscall (darwin-386), const BPF_H ideal-int +pkg syscall (darwin-386), const BPF_IMM ideal-int +pkg syscall (darwin-386), const BPF_IND ideal-int +pkg syscall (darwin-386), const BPF_JA ideal-int +pkg syscall (darwin-386), const BPF_JEQ ideal-int +pkg syscall (darwin-386), const BPF_JGE ideal-int +pkg syscall (darwin-386), const BPF_JGT ideal-int +pkg syscall (darwin-386), const BPF_JMP ideal-int +pkg syscall (darwin-386), const BPF_JSET ideal-int +pkg syscall (darwin-386), const BPF_K ideal-int +pkg syscall (darwin-386), const BPF_LD ideal-int +pkg syscall (darwin-386), const BPF_LDX ideal-int +pkg syscall (darwin-386), const BPF_LEN ideal-int +pkg syscall (darwin-386), const BPF_LSH ideal-int +pkg syscall (darwin-386), const BPF_MAJOR_VERSION ideal-int +pkg syscall (darwin-386), const BPF_MAXBUFSIZE ideal-int +pkg syscall (darwin-386), const BPF_MAXINSNS ideal-int +pkg syscall (darwin-386), const BPF_MEM ideal-int +pkg syscall (darwin-386), const BPF_MEMWORDS ideal-int +pkg syscall (darwin-386), const BPF_MINBUFSIZE ideal-int +pkg syscall (darwin-386), const BPF_MINOR_VERSION ideal-int +pkg syscall (darwin-386), const BPF_MISC ideal-int +pkg syscall (darwin-386), const BPF_MSH ideal-int +pkg syscall (darwin-386), const BPF_MUL ideal-int +pkg syscall (darwin-386), const BPF_NEG ideal-int +pkg syscall (darwin-386), const BPF_OR ideal-int +pkg syscall (darwin-386), const BPF_RELEASE ideal-int +pkg syscall (darwin-386), const BPF_RET ideal-int +pkg syscall (darwin-386), const BPF_RSH ideal-int +pkg syscall (darwin-386), const BPF_ST ideal-int +pkg syscall (darwin-386), const BPF_STX ideal-int +pkg syscall (darwin-386), const BPF_SUB ideal-int +pkg syscall (darwin-386), const BPF_TAX ideal-int +pkg syscall (darwin-386), const BPF_TXA ideal-int +pkg syscall (darwin-386), const BPF_W ideal-int +pkg syscall (darwin-386), const BPF_X ideal-int +pkg syscall (darwin-386), const CTL_MAXNAME ideal-int +pkg syscall (darwin-386), const CTL_NET ideal-int +pkg syscall (darwin-386), const DLT_APPLE_IP_OVER_IEEE1394 ideal-int +pkg syscall (darwin-386), const DLT_ARCNET ideal-int +pkg syscall (darwin-386), const DLT_ATM_CLIP ideal-int +pkg syscall (darwin-386), const DLT_ATM_RFC1483 ideal-int +pkg syscall (darwin-386), const DLT_AX25 ideal-int +pkg syscall (darwin-386), const DLT_CHAOS ideal-int +pkg syscall (darwin-386), const DLT_CHDLC ideal-int +pkg syscall (darwin-386), const DLT_C_HDLC ideal-int +pkg syscall (darwin-386), const DLT_EN10MB ideal-int +pkg syscall (darwin-386), const DLT_EN3MB ideal-int +pkg syscall (darwin-386), const DLT_FDDI ideal-int +pkg syscall (darwin-386), const DLT_IEEE802 ideal-int +pkg syscall (darwin-386), const DLT_IEEE802_11 ideal-int +pkg syscall (darwin-386), const DLT_IEEE802_11_RADIO ideal-int +pkg syscall (darwin-386), const DLT_IEEE802_11_RADIO_AVS ideal-int +pkg syscall (darwin-386), const DLT_LINUX_SLL ideal-int +pkg syscall (darwin-386), const DLT_LOOP ideal-int +pkg syscall (darwin-386), const DLT_NULL ideal-int +pkg syscall (darwin-386), const DLT_PFLOG ideal-int +pkg syscall (darwin-386), const DLT_PFSYNC ideal-int +pkg syscall (darwin-386), const DLT_PPP ideal-int +pkg syscall (darwin-386), const DLT_PPP_BSDOS ideal-int +pkg syscall (darwin-386), const DLT_PPP_SERIAL ideal-int +pkg syscall (darwin-386), const DLT_PRONET ideal-int +pkg syscall (darwin-386), const DLT_RAW ideal-int +pkg syscall (darwin-386), const DLT_SLIP ideal-int +pkg syscall (darwin-386), const DLT_SLIP_BSDOS ideal-int +pkg syscall (darwin-386), const DT_BLK ideal-int +pkg syscall (darwin-386), const DT_CHR ideal-int +pkg syscall (darwin-386), const DT_DIR ideal-int +pkg syscall (darwin-386), const DT_FIFO ideal-int +pkg syscall (darwin-386), const DT_LNK ideal-int +pkg syscall (darwin-386), const DT_REG ideal-int +pkg syscall (darwin-386), const DT_SOCK ideal-int +pkg syscall (darwin-386), const DT_UNKNOWN ideal-int +pkg syscall (darwin-386), const DT_WHT ideal-int +pkg syscall (darwin-386), const EAUTH Errno +pkg syscall (darwin-386), const EBADARCH Errno +pkg syscall (darwin-386), const EBADEXEC Errno +pkg syscall (darwin-386), const EBADMACHO Errno +pkg syscall (darwin-386), const EBADMSG Errno +pkg syscall (darwin-386), const EBADRPC Errno +pkg syscall (darwin-386), const ECHO ideal-int +pkg syscall (darwin-386), const ECHOCTL ideal-int +pkg syscall (darwin-386), const ECHOE ideal-int +pkg syscall (darwin-386), const ECHOK ideal-int +pkg syscall (darwin-386), const ECHOKE ideal-int +pkg syscall (darwin-386), const ECHONL ideal-int +pkg syscall (darwin-386), const ECHOPRT ideal-int +pkg syscall (darwin-386), const EDEVERR Errno +pkg syscall (darwin-386), const EFTYPE Errno +pkg syscall (darwin-386), const ELAST Errno +pkg syscall (darwin-386), const EMULTIHOP Errno +pkg syscall (darwin-386), const ENEEDAUTH Errno +pkg syscall (darwin-386), const ENOATTR Errno +pkg syscall (darwin-386), const ENODATA Errno +pkg syscall (darwin-386), const ENOLINK Errno +pkg syscall (darwin-386), const ENOPOLICY Errno +pkg syscall (darwin-386), const ENOSR Errno +pkg syscall (darwin-386), const ENOSTR Errno +pkg syscall (darwin-386), const ENOTRECOVERABLE Errno +pkg syscall (darwin-386), const EOWNERDEAD Errno +pkg syscall (darwin-386), const EPROCLIM Errno +pkg syscall (darwin-386), const EPROCUNAVAIL Errno +pkg syscall (darwin-386), const EPROGMISMATCH Errno +pkg syscall (darwin-386), const EPROGUNAVAIL Errno +pkg syscall (darwin-386), const EPROTO Errno +pkg syscall (darwin-386), const EPWROFF Errno +pkg syscall (darwin-386), const ERPCMISMATCH Errno +pkg syscall (darwin-386), const ESHLIBVERS Errno +pkg syscall (darwin-386), const ETIME Errno +pkg syscall (darwin-386), const EVFILT_AIO ideal-int +pkg syscall (darwin-386), const EVFILT_FS ideal-int +pkg syscall (darwin-386), const EVFILT_MACHPORT ideal-int +pkg syscall (darwin-386), const EVFILT_PROC ideal-int +pkg syscall (darwin-386), const EVFILT_READ ideal-int +pkg syscall (darwin-386), const EVFILT_SIGNAL ideal-int +pkg syscall (darwin-386), const EVFILT_SYSCOUNT ideal-int +pkg syscall (darwin-386), const EVFILT_THREADMARKER ideal-int +pkg syscall (darwin-386), const EVFILT_TIMER ideal-int +pkg syscall (darwin-386), const EVFILT_USER ideal-int +pkg syscall (darwin-386), const EVFILT_VM ideal-int +pkg syscall (darwin-386), const EVFILT_VNODE ideal-int +pkg syscall (darwin-386), const EVFILT_WRITE ideal-int +pkg syscall (darwin-386), const EV_ADD ideal-int +pkg syscall (darwin-386), const EV_CLEAR ideal-int +pkg syscall (darwin-386), const EV_DELETE ideal-int +pkg syscall (darwin-386), const EV_DISABLE ideal-int +pkg syscall (darwin-386), const EV_DISPATCH ideal-int +pkg syscall (darwin-386), const EV_ENABLE ideal-int +pkg syscall (darwin-386), const EV_EOF ideal-int +pkg syscall (darwin-386), const EV_ERROR ideal-int +pkg syscall (darwin-386), const EV_FLAG0 ideal-int +pkg syscall (darwin-386), const EV_FLAG1 ideal-int +pkg syscall (darwin-386), const EV_ONESHOT ideal-int +pkg syscall (darwin-386), const EV_OOBAND ideal-int +pkg syscall (darwin-386), const EV_POLL ideal-int +pkg syscall (darwin-386), const EV_RECEIPT ideal-int +pkg syscall (darwin-386), const EV_SYSFLAGS ideal-int +pkg syscall (darwin-386), const EXTA ideal-int +pkg syscall (darwin-386), const EXTB ideal-int +pkg syscall (darwin-386), const EXTPROC ideal-int +pkg syscall (darwin-386), const FD_CLOEXEC ideal-int +pkg syscall (darwin-386), const FD_SETSIZE ideal-int +pkg syscall (darwin-386), const F_ADDFILESIGS ideal-int +pkg syscall (darwin-386), const F_ADDSIGS ideal-int +pkg syscall (darwin-386), const F_ALLOCATEALL ideal-int +pkg syscall (darwin-386), const F_ALLOCATECONTIG ideal-int +pkg syscall (darwin-386), const F_CHKCLEAN ideal-int +pkg syscall (darwin-386), const F_DUPFD ideal-int +pkg syscall (darwin-386), const F_DUPFD_CLOEXEC ideal-int +pkg syscall (darwin-386), const F_FLUSH_DATA ideal-int +pkg syscall (darwin-386), const F_FREEZE_FS ideal-int +pkg syscall (darwin-386), const F_FULLFSYNC ideal-int +pkg syscall (darwin-386), const F_GETFD ideal-int +pkg syscall (darwin-386), const F_GETFL ideal-int +pkg syscall (darwin-386), const F_GETLK ideal-int +pkg syscall (darwin-386), const F_GETLKPID ideal-int +pkg syscall (darwin-386), const F_GETNOSIGPIPE ideal-int +pkg syscall (darwin-386), const F_GETOWN ideal-int +pkg syscall (darwin-386), const F_GETPATH ideal-int +pkg syscall (darwin-386), const F_GETPATH_MTMINFO ideal-int +pkg syscall (darwin-386), const F_GETPROTECTIONCLASS ideal-int +pkg syscall (darwin-386), const F_GLOBAL_NOCACHE ideal-int +pkg syscall (darwin-386), const F_LOG2PHYS ideal-int +pkg syscall (darwin-386), const F_LOG2PHYS_EXT ideal-int +pkg syscall (darwin-386), const F_MARKDEPENDENCY ideal-int +pkg syscall (darwin-386), const F_NOCACHE ideal-int +pkg syscall (darwin-386), const F_NODIRECT ideal-int +pkg syscall (darwin-386), const F_OK ideal-int +pkg syscall (darwin-386), const F_PATHPKG_CHECK ideal-int +pkg syscall (darwin-386), const F_PEOFPOSMODE ideal-int +pkg syscall (darwin-386), const F_PREALLOCATE ideal-int +pkg syscall (darwin-386), const F_RDADVISE ideal-int +pkg syscall (darwin-386), const F_RDAHEAD ideal-int +pkg syscall (darwin-386), const F_RDLCK ideal-int +pkg syscall (darwin-386), const F_READBOOTSTRAP ideal-int +pkg syscall (darwin-386), const F_SETBACKINGSTORE ideal-int +pkg syscall (darwin-386), const F_SETFD ideal-int +pkg syscall (darwin-386), const F_SETFL ideal-int +pkg syscall (darwin-386), const F_SETLK ideal-int +pkg syscall (darwin-386), const F_SETLKW ideal-int +pkg syscall (darwin-386), const F_SETNOSIGPIPE ideal-int +pkg syscall (darwin-386), const F_SETOWN ideal-int +pkg syscall (darwin-386), const F_SETPROTECTIONCLASS ideal-int +pkg syscall (darwin-386), const F_SETSIZE ideal-int +pkg syscall (darwin-386), const F_THAW_FS ideal-int +pkg syscall (darwin-386), const F_UNLCK ideal-int +pkg syscall (darwin-386), const F_VOLPOSMODE ideal-int +pkg syscall (darwin-386), const F_WRITEBOOTSTRAP ideal-int +pkg syscall (darwin-386), const F_WRLCK ideal-int +pkg syscall (darwin-386), const IFF_ALLMULTI ideal-int +pkg syscall (darwin-386), const IFF_ALTPHYS ideal-int +pkg syscall (darwin-386), const IFF_DEBUG ideal-int +pkg syscall (darwin-386), const IFF_LINK0 ideal-int +pkg syscall (darwin-386), const IFF_LINK1 ideal-int +pkg syscall (darwin-386), const IFF_LINK2 ideal-int +pkg syscall (darwin-386), const IFF_NOARP ideal-int +pkg syscall (darwin-386), const IFF_NOTRAILERS ideal-int +pkg syscall (darwin-386), const IFF_OACTIVE ideal-int +pkg syscall (darwin-386), const IFF_POINTOPOINT ideal-int +pkg syscall (darwin-386), const IFF_PROMISC ideal-int +pkg syscall (darwin-386), const IFF_RUNNING ideal-int +pkg syscall (darwin-386), const IFF_SIMPLEX ideal-int +pkg syscall (darwin-386), const IFNAMSIZ ideal-int +pkg syscall (darwin-386), const IFT_1822 ideal-int +pkg syscall (darwin-386), const IFT_AAL5 ideal-int +pkg syscall (darwin-386), const IFT_ARCNET ideal-int +pkg syscall (darwin-386), const IFT_ARCNETPLUS ideal-int +pkg syscall (darwin-386), const IFT_ATM ideal-int +pkg syscall (darwin-386), const IFT_BRIDGE ideal-int +pkg syscall (darwin-386), const IFT_CARP ideal-int +pkg syscall (darwin-386), const IFT_CELLULAR ideal-int +pkg syscall (darwin-386), const IFT_CEPT ideal-int +pkg syscall (darwin-386), const IFT_DS3 ideal-int +pkg syscall (darwin-386), const IFT_ENC ideal-int +pkg syscall (darwin-386), const IFT_EON ideal-int +pkg syscall (darwin-386), const IFT_ETHER ideal-int +pkg syscall (darwin-386), const IFT_FAITH ideal-int +pkg syscall (darwin-386), const IFT_FDDI ideal-int +pkg syscall (darwin-386), const IFT_FRELAY ideal-int +pkg syscall (darwin-386), const IFT_FRELAYDCE ideal-int +pkg syscall (darwin-386), const IFT_GIF ideal-int +pkg syscall (darwin-386), const IFT_HDH1822 ideal-int +pkg syscall (darwin-386), const IFT_HIPPI ideal-int +pkg syscall (darwin-386), const IFT_HSSI ideal-int +pkg syscall (darwin-386), const IFT_HY ideal-int +pkg syscall (darwin-386), const IFT_IEEE1394 ideal-int +pkg syscall (darwin-386), const IFT_IEEE8023ADLAG ideal-int +pkg syscall (darwin-386), const IFT_ISDNBASIC ideal-int +pkg syscall (darwin-386), const IFT_ISDNPRIMARY ideal-int +pkg syscall (darwin-386), const IFT_ISO88022LLC ideal-int +pkg syscall (darwin-386), const IFT_ISO88023 ideal-int +pkg syscall (darwin-386), const IFT_ISO88024 ideal-int +pkg syscall (darwin-386), const IFT_ISO88025 ideal-int +pkg syscall (darwin-386), const IFT_ISO88026 ideal-int +pkg syscall (darwin-386), const IFT_L2VLAN ideal-int +pkg syscall (darwin-386), const IFT_LAPB ideal-int +pkg syscall (darwin-386), const IFT_LOCALTALK ideal-int +pkg syscall (darwin-386), const IFT_LOOP ideal-int +pkg syscall (darwin-386), const IFT_MIOX25 ideal-int +pkg syscall (darwin-386), const IFT_MODEM ideal-int +pkg syscall (darwin-386), const IFT_NSIP ideal-int +pkg syscall (darwin-386), const IFT_OTHER ideal-int +pkg syscall (darwin-386), const IFT_P10 ideal-int +pkg syscall (darwin-386), const IFT_P80 ideal-int +pkg syscall (darwin-386), const IFT_PARA ideal-int +pkg syscall (darwin-386), const IFT_PDP ideal-int +pkg syscall (darwin-386), const IFT_PFLOG ideal-int +pkg syscall (darwin-386), const IFT_PFSYNC ideal-int +pkg syscall (darwin-386), const IFT_PPP ideal-int +pkg syscall (darwin-386), const IFT_PROPMUX ideal-int +pkg syscall (darwin-386), const IFT_PROPVIRTUAL ideal-int +pkg syscall (darwin-386), const IFT_PTPSERIAL ideal-int +pkg syscall (darwin-386), const IFT_RS232 ideal-int +pkg syscall (darwin-386), const IFT_SDLC ideal-int +pkg syscall (darwin-386), const IFT_SIP ideal-int +pkg syscall (darwin-386), const IFT_SLIP ideal-int +pkg syscall (darwin-386), const IFT_SMDSDXI ideal-int +pkg syscall (darwin-386), const IFT_SMDSICIP ideal-int +pkg syscall (darwin-386), const IFT_SONET ideal-int +pkg syscall (darwin-386), const IFT_SONETPATH ideal-int +pkg syscall (darwin-386), const IFT_SONETVT ideal-int +pkg syscall (darwin-386), const IFT_STARLAN ideal-int +pkg syscall (darwin-386), const IFT_STF ideal-int +pkg syscall (darwin-386), const IFT_T1 ideal-int +pkg syscall (darwin-386), const IFT_ULTRA ideal-int +pkg syscall (darwin-386), const IFT_V35 ideal-int +pkg syscall (darwin-386), const IFT_X25 ideal-int +pkg syscall (darwin-386), const IFT_X25DDN ideal-int +pkg syscall (darwin-386), const IFT_X25PLE ideal-int +pkg syscall (darwin-386), const IFT_XETHER ideal-int +pkg syscall (darwin-386), const IN_CLASSA_HOST ideal-int +pkg syscall (darwin-386), const IN_CLASSA_MAX ideal-int +pkg syscall (darwin-386), const IN_CLASSA_NET ideal-int +pkg syscall (darwin-386), const IN_CLASSA_NSHIFT ideal-int +pkg syscall (darwin-386), const IN_CLASSB_HOST ideal-int +pkg syscall (darwin-386), const IN_CLASSB_MAX ideal-int +pkg syscall (darwin-386), const IN_CLASSB_NET ideal-int +pkg syscall (darwin-386), const IN_CLASSB_NSHIFT ideal-int +pkg syscall (darwin-386), const IN_CLASSC_HOST ideal-int +pkg syscall (darwin-386), const IN_CLASSC_NET ideal-int +pkg syscall (darwin-386), const IN_CLASSC_NSHIFT ideal-int +pkg syscall (darwin-386), const IN_CLASSD_HOST ideal-int +pkg syscall (darwin-386), const IN_CLASSD_NET ideal-int +pkg syscall (darwin-386), const IN_CLASSD_NSHIFT ideal-int +pkg syscall (darwin-386), const IN_LINKLOCALNETNUM ideal-int +pkg syscall (darwin-386), const IN_LOOPBACKNET ideal-int +pkg syscall (darwin-386), const IPPROTO_3PC ideal-int +pkg syscall (darwin-386), const IPPROTO_ADFS ideal-int +pkg syscall (darwin-386), const IPPROTO_AH ideal-int +pkg syscall (darwin-386), const IPPROTO_AHIP ideal-int +pkg syscall (darwin-386), const IPPROTO_APES ideal-int +pkg syscall (darwin-386), const IPPROTO_ARGUS ideal-int +pkg syscall (darwin-386), const IPPROTO_AX25 ideal-int +pkg syscall (darwin-386), const IPPROTO_BHA ideal-int +pkg syscall (darwin-386), const IPPROTO_BLT ideal-int +pkg syscall (darwin-386), const IPPROTO_BRSATMON ideal-int +pkg syscall (darwin-386), const IPPROTO_CFTP ideal-int +pkg syscall (darwin-386), const IPPROTO_CHAOS ideal-int +pkg syscall (darwin-386), const IPPROTO_CMTP ideal-int +pkg syscall (darwin-386), const IPPROTO_CPHB ideal-int +pkg syscall (darwin-386), const IPPROTO_CPNX ideal-int +pkg syscall (darwin-386), const IPPROTO_DDP ideal-int +pkg syscall (darwin-386), const IPPROTO_DGP ideal-int +pkg syscall (darwin-386), const IPPROTO_DIVERT ideal-int +pkg syscall (darwin-386), const IPPROTO_DONE ideal-int +pkg syscall (darwin-386), const IPPROTO_DSTOPTS ideal-int +pkg syscall (darwin-386), const IPPROTO_EGP ideal-int +pkg syscall (darwin-386), const IPPROTO_EMCON ideal-int +pkg syscall (darwin-386), const IPPROTO_ENCAP ideal-int +pkg syscall (darwin-386), const IPPROTO_EON ideal-int +pkg syscall (darwin-386), const IPPROTO_ESP ideal-int +pkg syscall (darwin-386), const IPPROTO_ETHERIP ideal-int +pkg syscall (darwin-386), const IPPROTO_FRAGMENT ideal-int +pkg syscall (darwin-386), const IPPROTO_GGP ideal-int +pkg syscall (darwin-386), const IPPROTO_GMTP ideal-int +pkg syscall (darwin-386), const IPPROTO_GRE ideal-int +pkg syscall (darwin-386), const IPPROTO_HELLO ideal-int +pkg syscall (darwin-386), const IPPROTO_HMP ideal-int +pkg syscall (darwin-386), const IPPROTO_HOPOPTS ideal-int +pkg syscall (darwin-386), const IPPROTO_ICMP ideal-int +pkg syscall (darwin-386), const IPPROTO_ICMPV6 ideal-int +pkg syscall (darwin-386), const IPPROTO_IDP ideal-int +pkg syscall (darwin-386), const IPPROTO_IDPR ideal-int +pkg syscall (darwin-386), const IPPROTO_IDRP ideal-int +pkg syscall (darwin-386), const IPPROTO_IGMP ideal-int +pkg syscall (darwin-386), const IPPROTO_IGP ideal-int +pkg syscall (darwin-386), const IPPROTO_IGRP ideal-int +pkg syscall (darwin-386), const IPPROTO_IL ideal-int +pkg syscall (darwin-386), const IPPROTO_INLSP ideal-int +pkg syscall (darwin-386), const IPPROTO_INP ideal-int +pkg syscall (darwin-386), const IPPROTO_IPCOMP ideal-int +pkg syscall (darwin-386), const IPPROTO_IPCV ideal-int +pkg syscall (darwin-386), const IPPROTO_IPEIP ideal-int +pkg syscall (darwin-386), const IPPROTO_IPIP ideal-int +pkg syscall (darwin-386), const IPPROTO_IPPC ideal-int +pkg syscall (darwin-386), const IPPROTO_IPV4 ideal-int +pkg syscall (darwin-386), const IPPROTO_IRTP ideal-int +pkg syscall (darwin-386), const IPPROTO_KRYPTOLAN ideal-int +pkg syscall (darwin-386), const IPPROTO_LARP ideal-int +pkg syscall (darwin-386), const IPPROTO_LEAF1 ideal-int +pkg syscall (darwin-386), const IPPROTO_LEAF2 ideal-int +pkg syscall (darwin-386), const IPPROTO_MAX ideal-int +pkg syscall (darwin-386), const IPPROTO_MAXID ideal-int +pkg syscall (darwin-386), const IPPROTO_MEAS ideal-int +pkg syscall (darwin-386), const IPPROTO_MHRP ideal-int +pkg syscall (darwin-386), const IPPROTO_MICP ideal-int +pkg syscall (darwin-386), const IPPROTO_MTP ideal-int +pkg syscall (darwin-386), const IPPROTO_MUX ideal-int +pkg syscall (darwin-386), const IPPROTO_ND ideal-int +pkg syscall (darwin-386), const IPPROTO_NHRP ideal-int +pkg syscall (darwin-386), const IPPROTO_NONE ideal-int +pkg syscall (darwin-386), const IPPROTO_NSP ideal-int +pkg syscall (darwin-386), const IPPROTO_NVPII ideal-int +pkg syscall (darwin-386), const IPPROTO_OSPFIGP ideal-int +pkg syscall (darwin-386), const IPPROTO_PGM ideal-int +pkg syscall (darwin-386), const IPPROTO_PIGP ideal-int +pkg syscall (darwin-386), const IPPROTO_PIM ideal-int +pkg syscall (darwin-386), const IPPROTO_PRM ideal-int +pkg syscall (darwin-386), const IPPROTO_PUP ideal-int +pkg syscall (darwin-386), const IPPROTO_PVP ideal-int +pkg syscall (darwin-386), const IPPROTO_RAW ideal-int +pkg syscall (darwin-386), const IPPROTO_RCCMON ideal-int +pkg syscall (darwin-386), const IPPROTO_RDP ideal-int +pkg syscall (darwin-386), const IPPROTO_ROUTING ideal-int +pkg syscall (darwin-386), const IPPROTO_RSVP ideal-int +pkg syscall (darwin-386), const IPPROTO_RVD ideal-int +pkg syscall (darwin-386), const IPPROTO_SATEXPAK ideal-int +pkg syscall (darwin-386), const IPPROTO_SATMON ideal-int +pkg syscall (darwin-386), const IPPROTO_SCCSP ideal-int +pkg syscall (darwin-386), const IPPROTO_SCTP ideal-int +pkg syscall (darwin-386), const IPPROTO_SDRP ideal-int +pkg syscall (darwin-386), const IPPROTO_SEP ideal-int +pkg syscall (darwin-386), const IPPROTO_SRPC ideal-int +pkg syscall (darwin-386), const IPPROTO_ST ideal-int +pkg syscall (darwin-386), const IPPROTO_SVMTP ideal-int +pkg syscall (darwin-386), const IPPROTO_SWIPE ideal-int +pkg syscall (darwin-386), const IPPROTO_TCF ideal-int +pkg syscall (darwin-386), const IPPROTO_TP ideal-int +pkg syscall (darwin-386), const IPPROTO_TPXX ideal-int +pkg syscall (darwin-386), const IPPROTO_TRUNK1 ideal-int +pkg syscall (darwin-386), const IPPROTO_TRUNK2 ideal-int +pkg syscall (darwin-386), const IPPROTO_TTP ideal-int +pkg syscall (darwin-386), const IPPROTO_VINES ideal-int +pkg syscall (darwin-386), const IPPROTO_VISA ideal-int +pkg syscall (darwin-386), const IPPROTO_VMTP ideal-int +pkg syscall (darwin-386), const IPPROTO_WBEXPAK ideal-int +pkg syscall (darwin-386), const IPPROTO_WBMON ideal-int +pkg syscall (darwin-386), const IPPROTO_WSN ideal-int +pkg syscall (darwin-386), const IPPROTO_XNET ideal-int +pkg syscall (darwin-386), const IPPROTO_XTP ideal-int +pkg syscall (darwin-386), const IPV6_2292DSTOPTS ideal-int +pkg syscall (darwin-386), const IPV6_2292HOPLIMIT ideal-int +pkg syscall (darwin-386), const IPV6_2292HOPOPTS ideal-int +pkg syscall (darwin-386), const IPV6_2292NEXTHOP ideal-int +pkg syscall (darwin-386), const IPV6_2292PKTINFO ideal-int +pkg syscall (darwin-386), const IPV6_2292PKTOPTIONS ideal-int +pkg syscall (darwin-386), const IPV6_2292RTHDR ideal-int +pkg syscall (darwin-386), const IPV6_BINDV6ONLY ideal-int +pkg syscall (darwin-386), const IPV6_BOUND_IF ideal-int +pkg syscall (darwin-386), const IPV6_CHECKSUM ideal-int +pkg syscall (darwin-386), const IPV6_DEFAULT_MULTICAST_HOPS ideal-int +pkg syscall (darwin-386), const IPV6_DEFAULT_MULTICAST_LOOP ideal-int +pkg syscall (darwin-386), const IPV6_DEFHLIM ideal-int +pkg syscall (darwin-386), const IPV6_FAITH ideal-int +pkg syscall (darwin-386), const IPV6_FLOWINFO_MASK ideal-int +pkg syscall (darwin-386), const IPV6_FLOWLABEL_MASK ideal-int +pkg syscall (darwin-386), const IPV6_FRAGTTL ideal-int +pkg syscall (darwin-386), const IPV6_FW_ADD ideal-int +pkg syscall (darwin-386), const IPV6_FW_DEL ideal-int +pkg syscall (darwin-386), const IPV6_FW_FLUSH ideal-int +pkg syscall (darwin-386), const IPV6_FW_GET ideal-int +pkg syscall (darwin-386), const IPV6_FW_ZERO ideal-int +pkg syscall (darwin-386), const IPV6_HLIMDEC ideal-int +pkg syscall (darwin-386), const IPV6_IPSEC_POLICY ideal-int +pkg syscall (darwin-386), const IPV6_MAXHLIM ideal-int +pkg syscall (darwin-386), const IPV6_MAXOPTHDR ideal-int +pkg syscall (darwin-386), const IPV6_MAXPACKET ideal-int +pkg syscall (darwin-386), const IPV6_MAX_GROUP_SRC_FILTER ideal-int +pkg syscall (darwin-386), const IPV6_MAX_MEMBERSHIPS ideal-int +pkg syscall (darwin-386), const IPV6_MAX_SOCK_SRC_FILTER ideal-int +pkg syscall (darwin-386), const IPV6_MIN_MEMBERSHIPS ideal-int +pkg syscall (darwin-386), const IPV6_MMTU ideal-int +pkg syscall (darwin-386), const IPV6_PORTRANGE ideal-int +pkg syscall (darwin-386), const IPV6_PORTRANGE_DEFAULT ideal-int +pkg syscall (darwin-386), const IPV6_PORTRANGE_HIGH ideal-int +pkg syscall (darwin-386), const IPV6_PORTRANGE_LOW ideal-int +pkg syscall (darwin-386), const IPV6_RECVTCLASS ideal-int +pkg syscall (darwin-386), const IPV6_RTHDR_LOOSE ideal-int +pkg syscall (darwin-386), const IPV6_RTHDR_STRICT ideal-int +pkg syscall (darwin-386), const IPV6_RTHDR_TYPE_0 ideal-int +pkg syscall (darwin-386), const IPV6_SOCKOPT_RESERVED1 ideal-int +pkg syscall (darwin-386), const IPV6_TCLASS ideal-int +pkg syscall (darwin-386), const IPV6_VERSION ideal-int +pkg syscall (darwin-386), const IPV6_VERSION_MASK ideal-int +pkg syscall (darwin-386), const IP_ADD_SOURCE_MEMBERSHIP ideal-int +pkg syscall (darwin-386), const IP_BLOCK_SOURCE ideal-int +pkg syscall (darwin-386), const IP_BOUND_IF ideal-int +pkg syscall (darwin-386), const IP_DEFAULT_MULTICAST_LOOP ideal-int +pkg syscall (darwin-386), const IP_DEFAULT_MULTICAST_TTL ideal-int +pkg syscall (darwin-386), const IP_DF ideal-int +pkg syscall (darwin-386), const IP_DROP_SOURCE_MEMBERSHIP ideal-int +pkg syscall (darwin-386), const IP_DUMMYNET_CONFIGURE ideal-int +pkg syscall (darwin-386), const IP_DUMMYNET_DEL ideal-int +pkg syscall (darwin-386), const IP_DUMMYNET_FLUSH ideal-int +pkg syscall (darwin-386), const IP_DUMMYNET_GET ideal-int +pkg syscall (darwin-386), const IP_FAITH ideal-int +pkg syscall (darwin-386), const IP_FW_ADD ideal-int +pkg syscall (darwin-386), const IP_FW_DEL ideal-int +pkg syscall (darwin-386), const IP_FW_FLUSH ideal-int +pkg syscall (darwin-386), const IP_FW_GET ideal-int +pkg syscall (darwin-386), const IP_FW_RESETLOG ideal-int +pkg syscall (darwin-386), const IP_FW_ZERO ideal-int +pkg syscall (darwin-386), const IP_HDRINCL ideal-int +pkg syscall (darwin-386), const IP_IPSEC_POLICY ideal-int +pkg syscall (darwin-386), const IP_MAXPACKET ideal-int +pkg syscall (darwin-386), const IP_MAX_GROUP_SRC_FILTER ideal-int +pkg syscall (darwin-386), const IP_MAX_MEMBERSHIPS ideal-int +pkg syscall (darwin-386), const IP_MAX_SOCK_MUTE_FILTER ideal-int +pkg syscall (darwin-386), const IP_MAX_SOCK_SRC_FILTER ideal-int +pkg syscall (darwin-386), const IP_MF ideal-int +pkg syscall (darwin-386), const IP_MIN_MEMBERSHIPS ideal-int +pkg syscall (darwin-386), const IP_MSFILTER ideal-int +pkg syscall (darwin-386), const IP_MSS ideal-int +pkg syscall (darwin-386), const IP_MULTICAST_IFINDEX ideal-int +pkg syscall (darwin-386), const IP_MULTICAST_VIF ideal-int +pkg syscall (darwin-386), const IP_NAT__XXX ideal-int +pkg syscall (darwin-386), const IP_OFFMASK ideal-int +pkg syscall (darwin-386), const IP_OLD_FW_ADD ideal-int +pkg syscall (darwin-386), const IP_OLD_FW_DEL ideal-int +pkg syscall (darwin-386), const IP_OLD_FW_FLUSH ideal-int +pkg syscall (darwin-386), const IP_OLD_FW_GET ideal-int +pkg syscall (darwin-386), const IP_OLD_FW_RESETLOG ideal-int +pkg syscall (darwin-386), const IP_OLD_FW_ZERO ideal-int +pkg syscall (darwin-386), const IP_OPTIONS ideal-int +pkg syscall (darwin-386), const IP_PKTINFO ideal-int +pkg syscall (darwin-386), const IP_PORTRANGE ideal-int +pkg syscall (darwin-386), const IP_PORTRANGE_DEFAULT ideal-int +pkg syscall (darwin-386), const IP_PORTRANGE_HIGH ideal-int +pkg syscall (darwin-386), const IP_PORTRANGE_LOW ideal-int +pkg syscall (darwin-386), const IP_RECVDSTADDR ideal-int +pkg syscall (darwin-386), const IP_RECVIF ideal-int +pkg syscall (darwin-386), const IP_RECVOPTS ideal-int +pkg syscall (darwin-386), const IP_RECVPKTINFO ideal-int +pkg syscall (darwin-386), const IP_RECVRETOPTS ideal-int +pkg syscall (darwin-386), const IP_RECVTTL ideal-int +pkg syscall (darwin-386), const IP_RETOPTS ideal-int +pkg syscall (darwin-386), const IP_RF ideal-int +pkg syscall (darwin-386), const IP_RSVP_OFF ideal-int +pkg syscall (darwin-386), const IP_RSVP_ON ideal-int +pkg syscall (darwin-386), const IP_RSVP_VIF_OFF ideal-int +pkg syscall (darwin-386), const IP_RSVP_VIF_ON ideal-int +pkg syscall (darwin-386), const IP_STRIPHDR ideal-int +pkg syscall (darwin-386), const IP_TRAFFIC_MGT_BACKGROUND ideal-int +pkg syscall (darwin-386), const IP_UNBLOCK_SOURCE ideal-int +pkg syscall (darwin-386), const LOCK_EX ideal-int +pkg syscall (darwin-386), const LOCK_NB ideal-int +pkg syscall (darwin-386), const LOCK_SH ideal-int +pkg syscall (darwin-386), const LOCK_UN ideal-int +pkg syscall (darwin-386), const MADV_CAN_REUSE ideal-int +pkg syscall (darwin-386), const MADV_DONTNEED ideal-int +pkg syscall (darwin-386), const MADV_FREE ideal-int +pkg syscall (darwin-386), const MADV_FREE_REUSABLE ideal-int +pkg syscall (darwin-386), const MADV_FREE_REUSE ideal-int +pkg syscall (darwin-386), const MADV_NORMAL ideal-int +pkg syscall (darwin-386), const MADV_RANDOM ideal-int +pkg syscall (darwin-386), const MADV_SEQUENTIAL ideal-int +pkg syscall (darwin-386), const MADV_WILLNEED ideal-int +pkg syscall (darwin-386), const MADV_ZERO_WIRED_PAGES ideal-int +pkg syscall (darwin-386), const MAP_ANON ideal-int +pkg syscall (darwin-386), const MAP_COPY ideal-int +pkg syscall (darwin-386), const MAP_FILE ideal-int +pkg syscall (darwin-386), const MAP_FIXED ideal-int +pkg syscall (darwin-386), const MAP_HASSEMAPHORE ideal-int +pkg syscall (darwin-386), const MAP_JIT ideal-int +pkg syscall (darwin-386), const MAP_NOCACHE ideal-int +pkg syscall (darwin-386), const MAP_NOEXTEND ideal-int +pkg syscall (darwin-386), const MAP_NORESERVE ideal-int +pkg syscall (darwin-386), const MAP_PRIVATE ideal-int +pkg syscall (darwin-386), const MAP_RENAME ideal-int +pkg syscall (darwin-386), const MAP_RESERVED0080 ideal-int +pkg syscall (darwin-386), const MAP_SHARED ideal-int +pkg syscall (darwin-386), const MCL_CURRENT ideal-int +pkg syscall (darwin-386), const MCL_FUTURE ideal-int +pkg syscall (darwin-386), const MSG_CTRUNC ideal-int +pkg syscall (darwin-386), const MSG_DONTROUTE ideal-int +pkg syscall (darwin-386), const MSG_DONTWAIT ideal-int +pkg syscall (darwin-386), const MSG_EOF ideal-int +pkg syscall (darwin-386), const MSG_EOR ideal-int +pkg syscall (darwin-386), const MSG_FLUSH ideal-int +pkg syscall (darwin-386), const MSG_HAVEMORE ideal-int +pkg syscall (darwin-386), const MSG_HOLD ideal-int +pkg syscall (darwin-386), const MSG_NEEDSA ideal-int +pkg syscall (darwin-386), const MSG_OOB ideal-int +pkg syscall (darwin-386), const MSG_PEEK ideal-int +pkg syscall (darwin-386), const MSG_RCVMORE ideal-int +pkg syscall (darwin-386), const MSG_SEND ideal-int +pkg syscall (darwin-386), const MSG_TRUNC ideal-int +pkg syscall (darwin-386), const MSG_WAITALL ideal-int +pkg syscall (darwin-386), const MSG_WAITSTREAM ideal-int +pkg syscall (darwin-386), const MS_ASYNC ideal-int +pkg syscall (darwin-386), const MS_DEACTIVATE ideal-int +pkg syscall (darwin-386), const MS_INVALIDATE ideal-int +pkg syscall (darwin-386), const MS_KILLPAGES ideal-int +pkg syscall (darwin-386), const MS_SYNC ideal-int +pkg syscall (darwin-386), const NAME_MAX ideal-int +pkg syscall (darwin-386), const NET_RT_DUMP ideal-int +pkg syscall (darwin-386), const NET_RT_DUMP2 ideal-int +pkg syscall (darwin-386), const NET_RT_FLAGS ideal-int +pkg syscall (darwin-386), const NET_RT_IFLIST ideal-int +pkg syscall (darwin-386), const NET_RT_IFLIST2 ideal-int +pkg syscall (darwin-386), const NET_RT_MAXID ideal-int +pkg syscall (darwin-386), const NET_RT_STAT ideal-int +pkg syscall (darwin-386), const NET_RT_TRASH ideal-int +pkg syscall (darwin-386), const NOTE_ABSOLUTE ideal-int +pkg syscall (darwin-386), const NOTE_ATTRIB ideal-int +pkg syscall (darwin-386), const NOTE_CHILD ideal-int +pkg syscall (darwin-386), const NOTE_DELETE ideal-int +pkg syscall (darwin-386), const NOTE_EXEC ideal-int +pkg syscall (darwin-386), const NOTE_EXIT ideal-int +pkg syscall (darwin-386), const NOTE_EXITSTATUS ideal-int +pkg syscall (darwin-386), const NOTE_EXTEND ideal-int +pkg syscall (darwin-386), const NOTE_FFAND ideal-int +pkg syscall (darwin-386), const NOTE_FFCOPY ideal-int +pkg syscall (darwin-386), const NOTE_FFCTRLMASK ideal-int +pkg syscall (darwin-386), const NOTE_FFLAGSMASK ideal-int +pkg syscall (darwin-386), const NOTE_FFNOP ideal-int +pkg syscall (darwin-386), const NOTE_FFOR ideal-int +pkg syscall (darwin-386), const NOTE_FORK ideal-int +pkg syscall (darwin-386), const NOTE_LINK ideal-int +pkg syscall (darwin-386), const NOTE_LOWAT ideal-int +pkg syscall (darwin-386), const NOTE_NONE ideal-int +pkg syscall (darwin-386), const NOTE_NSECONDS ideal-int +pkg syscall (darwin-386), const NOTE_PCTRLMASK ideal-int +pkg syscall (darwin-386), const NOTE_PDATAMASK ideal-int +pkg syscall (darwin-386), const NOTE_REAP ideal-int +pkg syscall (darwin-386), const NOTE_RENAME ideal-int +pkg syscall (darwin-386), const NOTE_RESOURCEEND ideal-int +pkg syscall (darwin-386), const NOTE_REVOKE ideal-int +pkg syscall (darwin-386), const NOTE_SECONDS ideal-int +pkg syscall (darwin-386), const NOTE_SIGNAL ideal-int +pkg syscall (darwin-386), const NOTE_TRACK ideal-int +pkg syscall (darwin-386), const NOTE_TRACKERR ideal-int +pkg syscall (darwin-386), const NOTE_TRIGGER ideal-int +pkg syscall (darwin-386), const NOTE_USECONDS ideal-int +pkg syscall (darwin-386), const NOTE_VM_ERROR ideal-int +pkg syscall (darwin-386), const NOTE_VM_PRESSURE ideal-int +pkg syscall (darwin-386), const NOTE_VM_PRESSURE_SUDDEN_TERMINATE ideal-int +pkg syscall (darwin-386), const NOTE_VM_PRESSURE_TERMINATE ideal-int +pkg syscall (darwin-386), const NOTE_WRITE ideal-int +pkg syscall (darwin-386), const O_ACCMODE ideal-int +pkg syscall (darwin-386), const O_ALERT ideal-int +pkg syscall (darwin-386), const O_DIRECTORY ideal-int +pkg syscall (darwin-386), const O_DSYNC ideal-int +pkg syscall (darwin-386), const O_EVTONLY ideal-int +pkg syscall (darwin-386), const O_EXLOCK ideal-int +pkg syscall (darwin-386), const O_FSYNC ideal-int +pkg syscall (darwin-386), const O_NDELAY ideal-int +pkg syscall (darwin-386), const O_NOFOLLOW ideal-int +pkg syscall (darwin-386), const O_POPUP ideal-int +pkg syscall (darwin-386), const O_SHLOCK ideal-int +pkg syscall (darwin-386), const O_SYMLINK ideal-int +pkg syscall (darwin-386), const PROT_EXEC ideal-int +pkg syscall (darwin-386), const PROT_NONE ideal-int +pkg syscall (darwin-386), const PROT_READ ideal-int +pkg syscall (darwin-386), const PROT_WRITE ideal-int +pkg syscall (darwin-386), const PTRACE_CONT ideal-int +pkg syscall (darwin-386), const PTRACE_KILL ideal-int +pkg syscall (darwin-386), const PTRACE_TRACEME ideal-int +pkg syscall (darwin-386), const PT_ATTACH ideal-int +pkg syscall (darwin-386), const PT_ATTACHEXC ideal-int +pkg syscall (darwin-386), const PT_CONTINUE ideal-int +pkg syscall (darwin-386), const PT_DENY_ATTACH ideal-int +pkg syscall (darwin-386), const PT_DETACH ideal-int +pkg syscall (darwin-386), const PT_FIRSTMACH ideal-int +pkg syscall (darwin-386), const PT_FORCEQUOTA ideal-int +pkg syscall (darwin-386), const PT_KILL ideal-int +pkg syscall (darwin-386), const PT_READ_D ideal-int +pkg syscall (darwin-386), const PT_READ_I ideal-int +pkg syscall (darwin-386), const PT_READ_U ideal-int +pkg syscall (darwin-386), const PT_SIGEXC ideal-int +pkg syscall (darwin-386), const PT_STEP ideal-int +pkg syscall (darwin-386), const PT_THUPDATE ideal-int +pkg syscall (darwin-386), const PT_TRACE_ME ideal-int +pkg syscall (darwin-386), const PT_WRITE_D ideal-int +pkg syscall (darwin-386), const PT_WRITE_I ideal-int +pkg syscall (darwin-386), const PT_WRITE_U ideal-int +pkg syscall (darwin-386), const RLIMIT_AS ideal-int +pkg syscall (darwin-386), const RLIMIT_CORE ideal-int +pkg syscall (darwin-386), const RLIMIT_CPU ideal-int +pkg syscall (darwin-386), const RLIMIT_DATA ideal-int +pkg syscall (darwin-386), const RLIMIT_FSIZE ideal-int +pkg syscall (darwin-386), const RLIMIT_NOFILE ideal-int +pkg syscall (darwin-386), const RLIMIT_STACK ideal-int +pkg syscall (darwin-386), const RLIM_INFINITY ideal-int +pkg syscall (darwin-386), const RTAX_AUTHOR ideal-int +pkg syscall (darwin-386), const RTAX_BRD ideal-int +pkg syscall (darwin-386), const RTAX_DST ideal-int +pkg syscall (darwin-386), const RTAX_GATEWAY ideal-int +pkg syscall (darwin-386), const RTAX_GENMASK ideal-int +pkg syscall (darwin-386), const RTAX_IFA ideal-int +pkg syscall (darwin-386), const RTAX_IFP ideal-int +pkg syscall (darwin-386), const RTAX_MAX ideal-int +pkg syscall (darwin-386), const RTAX_NETMASK ideal-int +pkg syscall (darwin-386), const RTA_AUTHOR ideal-int +pkg syscall (darwin-386), const RTA_BRD ideal-int +pkg syscall (darwin-386), const RTA_DST ideal-int +pkg syscall (darwin-386), const RTA_GATEWAY ideal-int +pkg syscall (darwin-386), const RTA_GENMASK ideal-int +pkg syscall (darwin-386), const RTA_IFA ideal-int +pkg syscall (darwin-386), const RTA_IFP ideal-int +pkg syscall (darwin-386), const RTA_NETMASK ideal-int +pkg syscall (darwin-386), const RTF_BLACKHOLE ideal-int +pkg syscall (darwin-386), const RTF_BROADCAST ideal-int +pkg syscall (darwin-386), const RTF_CLONING ideal-int +pkg syscall (darwin-386), const RTF_CONDEMNED ideal-int +pkg syscall (darwin-386), const RTF_DELCLONE ideal-int +pkg syscall (darwin-386), const RTF_DONE ideal-int +pkg syscall (darwin-386), const RTF_DYNAMIC ideal-int +pkg syscall (darwin-386), const RTF_GATEWAY ideal-int +pkg syscall (darwin-386), const RTF_HOST ideal-int +pkg syscall (darwin-386), const RTF_IFREF ideal-int +pkg syscall (darwin-386), const RTF_IFSCOPE ideal-int +pkg syscall (darwin-386), const RTF_LLINFO ideal-int +pkg syscall (darwin-386), const RTF_LOCAL ideal-int +pkg syscall (darwin-386), const RTF_MODIFIED ideal-int +pkg syscall (darwin-386), const RTF_MULTICAST ideal-int +pkg syscall (darwin-386), const RTF_PINNED ideal-int +pkg syscall (darwin-386), const RTF_PRCLONING ideal-int +pkg syscall (darwin-386), const RTF_PROTO1 ideal-int +pkg syscall (darwin-386), const RTF_PROTO2 ideal-int +pkg syscall (darwin-386), const RTF_PROTO3 ideal-int +pkg syscall (darwin-386), const RTF_REJECT ideal-int +pkg syscall (darwin-386), const RTF_STATIC ideal-int +pkg syscall (darwin-386), const RTF_UP ideal-int +pkg syscall (darwin-386), const RTF_WASCLONED ideal-int +pkg syscall (darwin-386), const RTF_XRESOLVE ideal-int +pkg syscall (darwin-386), const RTM_ADD ideal-int +pkg syscall (darwin-386), const RTM_CHANGE ideal-int +pkg syscall (darwin-386), const RTM_DELADDR ideal-int +pkg syscall (darwin-386), const RTM_DELETE ideal-int +pkg syscall (darwin-386), const RTM_DELMADDR ideal-int +pkg syscall (darwin-386), const RTM_GET ideal-int +pkg syscall (darwin-386), const RTM_GET2 ideal-int +pkg syscall (darwin-386), const RTM_IFINFO ideal-int +pkg syscall (darwin-386), const RTM_IFINFO2 ideal-int +pkg syscall (darwin-386), const RTM_LOCK ideal-int +pkg syscall (darwin-386), const RTM_LOSING ideal-int +pkg syscall (darwin-386), const RTM_MISS ideal-int +pkg syscall (darwin-386), const RTM_NEWADDR ideal-int +pkg syscall (darwin-386), const RTM_NEWMADDR ideal-int +pkg syscall (darwin-386), const RTM_NEWMADDR2 ideal-int +pkg syscall (darwin-386), const RTM_OLDADD ideal-int +pkg syscall (darwin-386), const RTM_OLDDEL ideal-int +pkg syscall (darwin-386), const RTM_REDIRECT ideal-int +pkg syscall (darwin-386), const RTM_RESOLVE ideal-int +pkg syscall (darwin-386), const RTM_RTTUNIT ideal-int +pkg syscall (darwin-386), const RTM_VERSION ideal-int +pkg syscall (darwin-386), const RTV_EXPIRE ideal-int +pkg syscall (darwin-386), const RTV_HOPCOUNT ideal-int +pkg syscall (darwin-386), const RTV_MTU ideal-int +pkg syscall (darwin-386), const RTV_RPIPE ideal-int +pkg syscall (darwin-386), const RTV_RTT ideal-int +pkg syscall (darwin-386), const RTV_RTTVAR ideal-int +pkg syscall (darwin-386), const RTV_SPIPE ideal-int +pkg syscall (darwin-386), const RTV_SSTHRESH ideal-int +pkg syscall (darwin-386), const RUSAGE_CHILDREN ideal-int +pkg syscall (darwin-386), const RUSAGE_SELF ideal-int +pkg syscall (darwin-386), const SCM_CREDS ideal-int +pkg syscall (darwin-386), const SCM_RIGHTS ideal-int +pkg syscall (darwin-386), const SCM_TIMESTAMP ideal-int +pkg syscall (darwin-386), const SCM_TIMESTAMP_MONOTONIC ideal-int +pkg syscall (darwin-386), const SIGCHLD Signal +pkg syscall (darwin-386), const SIGCONT Signal +pkg syscall (darwin-386), const SIGEMT Signal +pkg syscall (darwin-386), const SIGINFO Signal +pkg syscall (darwin-386), const SIGIO Signal +pkg syscall (darwin-386), const SIGIOT Signal +pkg syscall (darwin-386), const SIGPROF Signal +pkg syscall (darwin-386), const SIGSTOP Signal +pkg syscall (darwin-386), const SIGSYS Signal +pkg syscall (darwin-386), const SIGTSTP Signal +pkg syscall (darwin-386), const SIGTTIN Signal +pkg syscall (darwin-386), const SIGTTOU Signal +pkg syscall (darwin-386), const SIGURG Signal +pkg syscall (darwin-386), const SIGUSR1 Signal +pkg syscall (darwin-386), const SIGUSR2 Signal +pkg syscall (darwin-386), const SIGVTALRM Signal +pkg syscall (darwin-386), const SIGWINCH Signal +pkg syscall (darwin-386), const SIGXCPU Signal +pkg syscall (darwin-386), const SIGXFSZ Signal +pkg syscall (darwin-386), const SIOCADDMULTI ideal-int +pkg syscall (darwin-386), const SIOCAIFADDR ideal-int +pkg syscall (darwin-386), const SIOCALIFADDR ideal-int +pkg syscall (darwin-386), const SIOCARPIPLL ideal-int +pkg syscall (darwin-386), const SIOCATMARK ideal-int +pkg syscall (darwin-386), const SIOCAUTOADDR ideal-int +pkg syscall (darwin-386), const SIOCAUTONETMASK ideal-int +pkg syscall (darwin-386), const SIOCDELMULTI ideal-int +pkg syscall (darwin-386), const SIOCDIFADDR ideal-int +pkg syscall (darwin-386), const SIOCDIFPHYADDR ideal-int +pkg syscall (darwin-386), const SIOCDLIFADDR ideal-int +pkg syscall (darwin-386), const SIOCGDRVSPEC ideal-int +pkg syscall (darwin-386), const SIOCGETSGCNT ideal-int +pkg syscall (darwin-386), const SIOCGETVIFCNT ideal-int +pkg syscall (darwin-386), const SIOCGETVLAN ideal-int +pkg syscall (darwin-386), const SIOCGHIWAT ideal-int +pkg syscall (darwin-386), const SIOCGIFADDR ideal-int +pkg syscall (darwin-386), const SIOCGIFALTMTU ideal-int +pkg syscall (darwin-386), const SIOCGIFASYNCMAP ideal-int +pkg syscall (darwin-386), const SIOCGIFBOND ideal-int +pkg syscall (darwin-386), const SIOCGIFBRDADDR ideal-int +pkg syscall (darwin-386), const SIOCGIFCAP ideal-int +pkg syscall (darwin-386), const SIOCGIFCONF ideal-int +pkg syscall (darwin-386), const SIOCGIFDEVMTU ideal-int +pkg syscall (darwin-386), const SIOCGIFDSTADDR ideal-int +pkg syscall (darwin-386), const SIOCGIFFLAGS ideal-int +pkg syscall (darwin-386), const SIOCGIFGENERIC ideal-int +pkg syscall (darwin-386), const SIOCGIFKPI ideal-int +pkg syscall (darwin-386), const SIOCGIFMAC ideal-int +pkg syscall (darwin-386), const SIOCGIFMEDIA ideal-int +pkg syscall (darwin-386), const SIOCGIFMETRIC ideal-int +pkg syscall (darwin-386), const SIOCGIFMTU ideal-int +pkg syscall (darwin-386), const SIOCGIFNETMASK ideal-int +pkg syscall (darwin-386), const SIOCGIFPDSTADDR ideal-int +pkg syscall (darwin-386), const SIOCGIFPHYS ideal-int +pkg syscall (darwin-386), const SIOCGIFPSRCADDR ideal-int +pkg syscall (darwin-386), const SIOCGIFSTATUS ideal-int +pkg syscall (darwin-386), const SIOCGIFVLAN ideal-int +pkg syscall (darwin-386), const SIOCGIFWAKEFLAGS ideal-int +pkg syscall (darwin-386), const SIOCGLIFADDR ideal-int +pkg syscall (darwin-386), const SIOCGLIFPHYADDR ideal-int +pkg syscall (darwin-386), const SIOCGLOWAT ideal-int +pkg syscall (darwin-386), const SIOCGPGRP ideal-int +pkg syscall (darwin-386), const SIOCIFCREATE ideal-int +pkg syscall (darwin-386), const SIOCIFCREATE2 ideal-int +pkg syscall (darwin-386), const SIOCIFDESTROY ideal-int +pkg syscall (darwin-386), const SIOCRSLVMULTI ideal-int +pkg syscall (darwin-386), const SIOCSDRVSPEC ideal-int +pkg syscall (darwin-386), const SIOCSETVLAN ideal-int +pkg syscall (darwin-386), const SIOCSHIWAT ideal-int +pkg syscall (darwin-386), const SIOCSIFADDR ideal-int +pkg syscall (darwin-386), const SIOCSIFALTMTU ideal-int +pkg syscall (darwin-386), const SIOCSIFASYNCMAP ideal-int +pkg syscall (darwin-386), const SIOCSIFBOND ideal-int +pkg syscall (darwin-386), const SIOCSIFBRDADDR ideal-int +pkg syscall (darwin-386), const SIOCSIFCAP ideal-int +pkg syscall (darwin-386), const SIOCSIFDSTADDR ideal-int +pkg syscall (darwin-386), const SIOCSIFFLAGS ideal-int +pkg syscall (darwin-386), const SIOCSIFGENERIC ideal-int +pkg syscall (darwin-386), const SIOCSIFKPI ideal-int +pkg syscall (darwin-386), const SIOCSIFLLADDR ideal-int +pkg syscall (darwin-386), const SIOCSIFMAC ideal-int +pkg syscall (darwin-386), const SIOCSIFMEDIA ideal-int +pkg syscall (darwin-386), const SIOCSIFMETRIC ideal-int +pkg syscall (darwin-386), const SIOCSIFMTU ideal-int +pkg syscall (darwin-386), const SIOCSIFNETMASK ideal-int +pkg syscall (darwin-386), const SIOCSIFPHYADDR ideal-int +pkg syscall (darwin-386), const SIOCSIFPHYS ideal-int +pkg syscall (darwin-386), const SIOCSIFVLAN ideal-int +pkg syscall (darwin-386), const SIOCSLIFPHYADDR ideal-int +pkg syscall (darwin-386), const SIOCSLOWAT ideal-int +pkg syscall (darwin-386), const SIOCSPGRP ideal-int +pkg syscall (darwin-386), const SOCK_MAXADDRLEN ideal-int +pkg syscall (darwin-386), const SOCK_RDM ideal-int +pkg syscall (darwin-386), const SO_ACCEPTCONN ideal-int +pkg syscall (darwin-386), const SO_DEBUG ideal-int +pkg syscall (darwin-386), const SO_DONTTRUNC ideal-int +pkg syscall (darwin-386), const SO_ERROR ideal-int +pkg syscall (darwin-386), const SO_LABEL ideal-int +pkg syscall (darwin-386), const SO_LINGER_SEC ideal-int +pkg syscall (darwin-386), const SO_NKE ideal-int +pkg syscall (darwin-386), const SO_NOADDRERR ideal-int +pkg syscall (darwin-386), const SO_NOSIGPIPE ideal-int +pkg syscall (darwin-386), const SO_NOTIFYCONFLICT ideal-int +pkg syscall (darwin-386), const SO_NP_EXTENSIONS ideal-int +pkg syscall (darwin-386), const SO_NREAD ideal-int +pkg syscall (darwin-386), const SO_NWRITE ideal-int +pkg syscall (darwin-386), const SO_OOBINLINE ideal-int +pkg syscall (darwin-386), const SO_PEERLABEL ideal-int +pkg syscall (darwin-386), const SO_RANDOMPORT ideal-int +pkg syscall (darwin-386), const SO_RCVLOWAT ideal-int +pkg syscall (darwin-386), const SO_RCVTIMEO ideal-int +pkg syscall (darwin-386), const SO_RESTRICTIONS ideal-int +pkg syscall (darwin-386), const SO_RESTRICT_DENYIN ideal-int +pkg syscall (darwin-386), const SO_RESTRICT_DENYOUT ideal-int +pkg syscall (darwin-386), const SO_RESTRICT_DENYSET ideal-int +pkg syscall (darwin-386), const SO_REUSEPORT ideal-int +pkg syscall (darwin-386), const SO_REUSESHAREUID ideal-int +pkg syscall (darwin-386), const SO_SNDLOWAT ideal-int +pkg syscall (darwin-386), const SO_SNDTIMEO ideal-int +pkg syscall (darwin-386), const SO_TIMESTAMP ideal-int +pkg syscall (darwin-386), const SO_TIMESTAMP_MONOTONIC ideal-int +pkg syscall (darwin-386), const SO_TYPE ideal-int +pkg syscall (darwin-386), const SO_UPCALLCLOSEWAIT ideal-int +pkg syscall (darwin-386), const SO_USELOOPBACK ideal-int +pkg syscall (darwin-386), const SO_WANTMORE ideal-int +pkg syscall (darwin-386), const SO_WANTOOBFLAG ideal-int +pkg syscall (darwin-386), const SYS_ACCEPT ideal-int +pkg syscall (darwin-386), const SYS_ACCEPT_NOCANCEL ideal-int +pkg syscall (darwin-386), const SYS_ACCESS ideal-int +pkg syscall (darwin-386), const SYS_ACCESS_EXTENDED ideal-int +pkg syscall (darwin-386), const SYS_ACCT ideal-int +pkg syscall (darwin-386), const SYS_ADD_PROFIL ideal-int +pkg syscall (darwin-386), const SYS_ADJTIME ideal-int +pkg syscall (darwin-386), const SYS_AIO_CANCEL ideal-int +pkg syscall (darwin-386), const SYS_AIO_ERROR ideal-int +pkg syscall (darwin-386), const SYS_AIO_FSYNC ideal-int +pkg syscall (darwin-386), const SYS_AIO_READ ideal-int +pkg syscall (darwin-386), const SYS_AIO_RETURN ideal-int +pkg syscall (darwin-386), const SYS_AIO_SUSPEND ideal-int +pkg syscall (darwin-386), const SYS_AIO_SUSPEND_NOCANCEL ideal-int +pkg syscall (darwin-386), const SYS_AIO_WRITE ideal-int +pkg syscall (darwin-386), const SYS_ATGETMSG ideal-int +pkg syscall (darwin-386), const SYS_ATPGETREQ ideal-int +pkg syscall (darwin-386), const SYS_ATPGETRSP ideal-int +pkg syscall (darwin-386), const SYS_ATPSNDREQ ideal-int +pkg syscall (darwin-386), const SYS_ATPSNDRSP ideal-int +pkg syscall (darwin-386), const SYS_ATPUTMSG ideal-int +pkg syscall (darwin-386), const SYS_ATSOCKET ideal-int +pkg syscall (darwin-386), const SYS_AUDIT ideal-int +pkg syscall (darwin-386), const SYS_AUDITCTL ideal-int +pkg syscall (darwin-386), const SYS_AUDITON ideal-int +pkg syscall (darwin-386), const SYS_AUDIT_SESSION_JOIN ideal-int +pkg syscall (darwin-386), const SYS_AUDIT_SESSION_PORT ideal-int +pkg syscall (darwin-386), const SYS_AUDIT_SESSION_SELF ideal-int +pkg syscall (darwin-386), const SYS_BIND ideal-int +pkg syscall (darwin-386), const SYS_BSDTHREAD_CREATE ideal-int +pkg syscall (darwin-386), const SYS_BSDTHREAD_REGISTER ideal-int +pkg syscall (darwin-386), const SYS_BSDTHREAD_TERMINATE ideal-int +pkg syscall (darwin-386), const SYS_CHDIR ideal-int +pkg syscall (darwin-386), const SYS_CHFLAGS ideal-int +pkg syscall (darwin-386), const SYS_CHMOD ideal-int +pkg syscall (darwin-386), const SYS_CHMOD_EXTENDED ideal-int +pkg syscall (darwin-386), const SYS_CHOWN ideal-int +pkg syscall (darwin-386), const SYS_CHROOT ideal-int +pkg syscall (darwin-386), const SYS_CHUD ideal-int +pkg syscall (darwin-386), const SYS_CLOSE ideal-int +pkg syscall (darwin-386), const SYS_CLOSE_NOCANCEL ideal-int +pkg syscall (darwin-386), const SYS_CONNECT ideal-int +pkg syscall (darwin-386), const SYS_CONNECT_NOCANCEL ideal-int +pkg syscall (darwin-386), const SYS_COPYFILE ideal-int +pkg syscall (darwin-386), const SYS_CSOPS ideal-int +pkg syscall (darwin-386), const SYS_DELETE ideal-int +pkg syscall (darwin-386), const SYS_DUP ideal-int +pkg syscall (darwin-386), const SYS_DUP2 ideal-int +pkg syscall (darwin-386), const SYS_EXCHANGEDATA ideal-int +pkg syscall (darwin-386), const SYS_EXECVE ideal-int +pkg syscall (darwin-386), const SYS_EXIT ideal-int +pkg syscall (darwin-386), const SYS_FCHDIR ideal-int +pkg syscall (darwin-386), const SYS_FCHFLAGS ideal-int +pkg syscall (darwin-386), const SYS_FCHMOD ideal-int +pkg syscall (darwin-386), const SYS_FCHMOD_EXTENDED ideal-int +pkg syscall (darwin-386), const SYS_FCHOWN ideal-int +pkg syscall (darwin-386), const SYS_FCNTL ideal-int +pkg syscall (darwin-386), const SYS_FCNTL_NOCANCEL ideal-int +pkg syscall (darwin-386), const SYS_FDATASYNC ideal-int +pkg syscall (darwin-386), const SYS_FFSCTL ideal-int +pkg syscall (darwin-386), const SYS_FGETATTRLIST ideal-int +pkg syscall (darwin-386), const SYS_FGETXATTR ideal-int +pkg syscall (darwin-386), const SYS_FHOPEN ideal-int +pkg syscall (darwin-386), const SYS_FILEPORT_MAKEFD ideal-int +pkg syscall (darwin-386), const SYS_FILEPORT_MAKEPORT ideal-int +pkg syscall (darwin-386), const SYS_FLISTXATTR ideal-int +pkg syscall (darwin-386), const SYS_FLOCK ideal-int +pkg syscall (darwin-386), const SYS_FORK ideal-int +pkg syscall (darwin-386), const SYS_FPATHCONF ideal-int +pkg syscall (darwin-386), const SYS_FREMOVEXATTR ideal-int +pkg syscall (darwin-386), const SYS_FSCTL ideal-int +pkg syscall (darwin-386), const SYS_FSETATTRLIST ideal-int +pkg syscall (darwin-386), const SYS_FSETXATTR ideal-int +pkg syscall (darwin-386), const SYS_FSGETPATH ideal-int +pkg syscall (darwin-386), const SYS_FSTAT ideal-int +pkg syscall (darwin-386), const SYS_FSTAT64 ideal-int +pkg syscall (darwin-386), const SYS_FSTAT64_EXTENDED ideal-int +pkg syscall (darwin-386), const SYS_FSTATFS ideal-int +pkg syscall (darwin-386), const SYS_FSTATFS64 ideal-int +pkg syscall (darwin-386), const SYS_FSTATV ideal-int +pkg syscall (darwin-386), const SYS_FSTAT_EXTENDED ideal-int +pkg syscall (darwin-386), const SYS_FSYNC ideal-int +pkg syscall (darwin-386), const SYS_FSYNC_NOCANCEL ideal-int +pkg syscall (darwin-386), const SYS_FTRUNCATE ideal-int +pkg syscall (darwin-386), const SYS_FUTIMES ideal-int +pkg syscall (darwin-386), const SYS_GETATTRLIST ideal-int +pkg syscall (darwin-386), const SYS_GETAUDIT ideal-int +pkg syscall (darwin-386), const SYS_GETAUDIT_ADDR ideal-int +pkg syscall (darwin-386), const SYS_GETAUID ideal-int +pkg syscall (darwin-386), const SYS_GETDIRENTRIES ideal-int +pkg syscall (darwin-386), const SYS_GETDIRENTRIES64 ideal-int +pkg syscall (darwin-386), const SYS_GETDIRENTRIESATTR ideal-int +pkg syscall (darwin-386), const SYS_GETDTABLESIZE ideal-int +pkg syscall (darwin-386), const SYS_GETEGID ideal-int +pkg syscall (darwin-386), const SYS_GETEUID ideal-int +pkg syscall (darwin-386), const SYS_GETFH ideal-int +pkg syscall (darwin-386), const SYS_GETFSSTAT ideal-int +pkg syscall (darwin-386), const SYS_GETFSSTAT64 ideal-int +pkg syscall (darwin-386), const SYS_GETGID ideal-int +pkg syscall (darwin-386), const SYS_GETGROUPS ideal-int +pkg syscall (darwin-386), const SYS_GETHOSTUUID ideal-int +pkg syscall (darwin-386), const SYS_GETITIMER ideal-int +pkg syscall (darwin-386), const SYS_GETLCID ideal-int +pkg syscall (darwin-386), const SYS_GETLOGIN ideal-int +pkg syscall (darwin-386), const SYS_GETPEERNAME ideal-int +pkg syscall (darwin-386), const SYS_GETPGID ideal-int +pkg syscall (darwin-386), const SYS_GETPGRP ideal-int +pkg syscall (darwin-386), const SYS_GETPID ideal-int +pkg syscall (darwin-386), const SYS_GETPPID ideal-int +pkg syscall (darwin-386), const SYS_GETPRIORITY ideal-int +pkg syscall (darwin-386), const SYS_GETRLIMIT ideal-int +pkg syscall (darwin-386), const SYS_GETRUSAGE ideal-int +pkg syscall (darwin-386), const SYS_GETSGROUPS ideal-int +pkg syscall (darwin-386), const SYS_GETSID ideal-int +pkg syscall (darwin-386), const SYS_GETSOCKNAME ideal-int +pkg syscall (darwin-386), const SYS_GETSOCKOPT ideal-int +pkg syscall (darwin-386), const SYS_GETTID ideal-int +pkg syscall (darwin-386), const SYS_GETTIMEOFDAY ideal-int +pkg syscall (darwin-386), const SYS_GETUID ideal-int +pkg syscall (darwin-386), const SYS_GETWGROUPS ideal-int +pkg syscall (darwin-386), const SYS_GETXATTR ideal-int +pkg syscall (darwin-386), const SYS_IDENTITYSVC ideal-int +pkg syscall (darwin-386), const SYS_INITGROUPS ideal-int +pkg syscall (darwin-386), const SYS_IOCTL ideal-int +pkg syscall (darwin-386), const SYS_IOPOLICYSYS ideal-int +pkg syscall (darwin-386), const SYS_ISSETUGID ideal-int +pkg syscall (darwin-386), const SYS_KDEBUG_TRACE ideal-int +pkg syscall (darwin-386), const SYS_KEVENT ideal-int +pkg syscall (darwin-386), const SYS_KEVENT64 ideal-int +pkg syscall (darwin-386), const SYS_KILL ideal-int +pkg syscall (darwin-386), const SYS_KQUEUE ideal-int +pkg syscall (darwin-386), const SYS_LCHOWN ideal-int +pkg syscall (darwin-386), const SYS_LINK ideal-int +pkg syscall (darwin-386), const SYS_LIO_LISTIO ideal-int +pkg syscall (darwin-386), const SYS_LISTEN ideal-int +pkg syscall (darwin-386), const SYS_LISTXATTR ideal-int +pkg syscall (darwin-386), const SYS_LSEEK ideal-int +pkg syscall (darwin-386), const SYS_LSTAT ideal-int +pkg syscall (darwin-386), const SYS_LSTAT64 ideal-int +pkg syscall (darwin-386), const SYS_LSTAT64_EXTENDED ideal-int +pkg syscall (darwin-386), const SYS_LSTATV ideal-int +pkg syscall (darwin-386), const SYS_LSTAT_EXTENDED ideal-int +pkg syscall (darwin-386), const SYS_MADVISE ideal-int +pkg syscall (darwin-386), const SYS_MAXSYSCALL ideal-int +pkg syscall (darwin-386), const SYS_MINCORE ideal-int +pkg syscall (darwin-386), const SYS_MINHERIT ideal-int +pkg syscall (darwin-386), const SYS_MKCOMPLEX ideal-int +pkg syscall (darwin-386), const SYS_MKDIR ideal-int +pkg syscall (darwin-386), const SYS_MKDIR_EXTENDED ideal-int +pkg syscall (darwin-386), const SYS_MKFIFO ideal-int +pkg syscall (darwin-386), const SYS_MKFIFO_EXTENDED ideal-int +pkg syscall (darwin-386), const SYS_MKNOD ideal-int +pkg syscall (darwin-386), const SYS_MLOCK ideal-int +pkg syscall (darwin-386), const SYS_MLOCKALL ideal-int +pkg syscall (darwin-386), const SYS_MMAP ideal-int +pkg syscall (darwin-386), const SYS_MODWATCH ideal-int +pkg syscall (darwin-386), const SYS_MOUNT ideal-int +pkg syscall (darwin-386), const SYS_MPROTECT ideal-int +pkg syscall (darwin-386), const SYS_MSGCTL ideal-int +pkg syscall (darwin-386), const SYS_MSGGET ideal-int +pkg syscall (darwin-386), const SYS_MSGRCV ideal-int +pkg syscall (darwin-386), const SYS_MSGRCV_NOCANCEL ideal-int +pkg syscall (darwin-386), const SYS_MSGSND ideal-int +pkg syscall (darwin-386), const SYS_MSGSND_NOCANCEL ideal-int +pkg syscall (darwin-386), const SYS_MSGSYS ideal-int +pkg syscall (darwin-386), const SYS_MSYNC ideal-int +pkg syscall (darwin-386), const SYS_MSYNC_NOCANCEL ideal-int +pkg syscall (darwin-386), const SYS_MUNLOCK ideal-int +pkg syscall (darwin-386), const SYS_MUNLOCKALL ideal-int +pkg syscall (darwin-386), const SYS_MUNMAP ideal-int +pkg syscall (darwin-386), const SYS_NFSCLNT ideal-int +pkg syscall (darwin-386), const SYS_NFSSVC ideal-int +pkg syscall (darwin-386), const SYS_OPEN ideal-int +pkg syscall (darwin-386), const SYS_OPEN_EXTENDED ideal-int +pkg syscall (darwin-386), const SYS_OPEN_NOCANCEL ideal-int +pkg syscall (darwin-386), const SYS_PATHCONF ideal-int +pkg syscall (darwin-386), const SYS_PID_HIBERNATE ideal-int +pkg syscall (darwin-386), const SYS_PID_RESUME ideal-int +pkg syscall (darwin-386), const SYS_PID_SHUTDOWN_SOCKETS ideal-int +pkg syscall (darwin-386), const SYS_PID_SUSPEND ideal-int +pkg syscall (darwin-386), const SYS_PIPE ideal-int +pkg syscall (darwin-386), const SYS_POLL ideal-int +pkg syscall (darwin-386), const SYS_POLL_NOCANCEL ideal-int +pkg syscall (darwin-386), const SYS_POSIX_SPAWN ideal-int +pkg syscall (darwin-386), const SYS_PREAD ideal-int +pkg syscall (darwin-386), const SYS_PREAD_NOCANCEL ideal-int +pkg syscall (darwin-386), const SYS_PROCESS_POLICY ideal-int +pkg syscall (darwin-386), const SYS_PROC_INFO ideal-int +pkg syscall (darwin-386), const SYS_PROFIL ideal-int +pkg syscall (darwin-386), const SYS_PSYNCH_CVBROAD ideal-int +pkg syscall (darwin-386), const SYS_PSYNCH_CVCLRPREPOST ideal-int +pkg syscall (darwin-386), const SYS_PSYNCH_CVSIGNAL ideal-int +pkg syscall (darwin-386), const SYS_PSYNCH_CVWAIT ideal-int +pkg syscall (darwin-386), const SYS_PSYNCH_MUTEXDROP ideal-int +pkg syscall (darwin-386), const SYS_PSYNCH_MUTEXWAIT ideal-int +pkg syscall (darwin-386), const SYS_PSYNCH_RW_DOWNGRADE ideal-int +pkg syscall (darwin-386), const SYS_PSYNCH_RW_LONGRDLOCK ideal-int +pkg syscall (darwin-386), const SYS_PSYNCH_RW_RDLOCK ideal-int +pkg syscall (darwin-386), const SYS_PSYNCH_RW_UNLOCK ideal-int +pkg syscall (darwin-386), const SYS_PSYNCH_RW_UNLOCK2 ideal-int +pkg syscall (darwin-386), const SYS_PSYNCH_RW_UPGRADE ideal-int +pkg syscall (darwin-386), const SYS_PSYNCH_RW_WRLOCK ideal-int +pkg syscall (darwin-386), const SYS_PSYNCH_RW_YIELDWRLOCK ideal-int +pkg syscall (darwin-386), const SYS_PTRACE ideal-int +pkg syscall (darwin-386), const SYS_PWRITE ideal-int +pkg syscall (darwin-386), const SYS_PWRITE_NOCANCEL ideal-int +pkg syscall (darwin-386), const SYS_QUOTACTL ideal-int +pkg syscall (darwin-386), const SYS_READ ideal-int +pkg syscall (darwin-386), const SYS_READLINK ideal-int +pkg syscall (darwin-386), const SYS_READV ideal-int +pkg syscall (darwin-386), const SYS_READV_NOCANCEL ideal-int +pkg syscall (darwin-386), const SYS_READ_NOCANCEL ideal-int +pkg syscall (darwin-386), const SYS_REBOOT ideal-int +pkg syscall (darwin-386), const SYS_RECVFROM ideal-int +pkg syscall (darwin-386), const SYS_RECVFROM_NOCANCEL ideal-int +pkg syscall (darwin-386), const SYS_RECVMSG ideal-int +pkg syscall (darwin-386), const SYS_RECVMSG_NOCANCEL ideal-int +pkg syscall (darwin-386), const SYS_REMOVEXATTR ideal-int +pkg syscall (darwin-386), const SYS_RENAME ideal-int +pkg syscall (darwin-386), const SYS_REVOKE ideal-int +pkg syscall (darwin-386), const SYS_RMDIR ideal-int +pkg syscall (darwin-386), const SYS_SEARCHFS ideal-int +pkg syscall (darwin-386), const SYS_SELECT ideal-int +pkg syscall (darwin-386), const SYS_SELECT_NOCANCEL ideal-int +pkg syscall (darwin-386), const SYS_SEMCTL ideal-int +pkg syscall (darwin-386), const SYS_SEMGET ideal-int +pkg syscall (darwin-386), const SYS_SEMOP ideal-int +pkg syscall (darwin-386), const SYS_SEMSYS ideal-int +pkg syscall (darwin-386), const SYS_SEM_CLOSE ideal-int +pkg syscall (darwin-386), const SYS_SEM_DESTROY ideal-int +pkg syscall (darwin-386), const SYS_SEM_GETVALUE ideal-int +pkg syscall (darwin-386), const SYS_SEM_INIT ideal-int +pkg syscall (darwin-386), const SYS_SEM_OPEN ideal-int +pkg syscall (darwin-386), const SYS_SEM_POST ideal-int +pkg syscall (darwin-386), const SYS_SEM_TRYWAIT ideal-int +pkg syscall (darwin-386), const SYS_SEM_UNLINK ideal-int +pkg syscall (darwin-386), const SYS_SEM_WAIT ideal-int +pkg syscall (darwin-386), const SYS_SEM_WAIT_NOCANCEL ideal-int +pkg syscall (darwin-386), const SYS_SENDFILE ideal-int +pkg syscall (darwin-386), const SYS_SENDMSG ideal-int +pkg syscall (darwin-386), const SYS_SENDMSG_NOCANCEL ideal-int +pkg syscall (darwin-386), const SYS_SENDTO ideal-int +pkg syscall (darwin-386), const SYS_SENDTO_NOCANCEL ideal-int +pkg syscall (darwin-386), const SYS_SETATTRLIST ideal-int +pkg syscall (darwin-386), const SYS_SETAUDIT ideal-int +pkg syscall (darwin-386), const SYS_SETAUDIT_ADDR ideal-int +pkg syscall (darwin-386), const SYS_SETAUID ideal-int +pkg syscall (darwin-386), const SYS_SETEGID ideal-int +pkg syscall (darwin-386), const SYS_SETEUID ideal-int +pkg syscall (darwin-386), const SYS_SETGID ideal-int +pkg syscall (darwin-386), const SYS_SETGROUPS ideal-int +pkg syscall (darwin-386), const SYS_SETITIMER ideal-int +pkg syscall (darwin-386), const SYS_SETLCID ideal-int +pkg syscall (darwin-386), const SYS_SETLOGIN ideal-int +pkg syscall (darwin-386), const SYS_SETPGID ideal-int +pkg syscall (darwin-386), const SYS_SETPRIORITY ideal-int +pkg syscall (darwin-386), const SYS_SETPRIVEXEC ideal-int +pkg syscall (darwin-386), const SYS_SETREGID ideal-int +pkg syscall (darwin-386), const SYS_SETREUID ideal-int +pkg syscall (darwin-386), const SYS_SETRLIMIT ideal-int +pkg syscall (darwin-386), const SYS_SETSGROUPS ideal-int +pkg syscall (darwin-386), const SYS_SETSID ideal-int +pkg syscall (darwin-386), const SYS_SETSOCKOPT ideal-int +pkg syscall (darwin-386), const SYS_SETTID ideal-int +pkg syscall (darwin-386), const SYS_SETTID_WITH_PID ideal-int +pkg syscall (darwin-386), const SYS_SETTIMEOFDAY ideal-int +pkg syscall (darwin-386), const SYS_SETUID ideal-int +pkg syscall (darwin-386), const SYS_SETWGROUPS ideal-int +pkg syscall (darwin-386), const SYS_SETXATTR ideal-int +pkg syscall (darwin-386), const SYS_SHARED_REGION_CHECK_NP ideal-int +pkg syscall (darwin-386), const SYS_SHARED_REGION_MAP_AND_SLIDE_NP ideal-int +pkg syscall (darwin-386), const SYS_SHMAT ideal-int +pkg syscall (darwin-386), const SYS_SHMCTL ideal-int +pkg syscall (darwin-386), const SYS_SHMDT ideal-int +pkg syscall (darwin-386), const SYS_SHMGET ideal-int +pkg syscall (darwin-386), const SYS_SHMSYS ideal-int +pkg syscall (darwin-386), const SYS_SHM_OPEN ideal-int +pkg syscall (darwin-386), const SYS_SHM_UNLINK ideal-int +pkg syscall (darwin-386), const SYS_SHUTDOWN ideal-int +pkg syscall (darwin-386), const SYS_SIGACTION ideal-int +pkg syscall (darwin-386), const SYS_SIGALTSTACK ideal-int +pkg syscall (darwin-386), const SYS_SIGPENDING ideal-int +pkg syscall (darwin-386), const SYS_SIGPROCMASK ideal-int +pkg syscall (darwin-386), const SYS_SIGRETURN ideal-int +pkg syscall (darwin-386), const SYS_SIGSUSPEND ideal-int +pkg syscall (darwin-386), const SYS_SIGSUSPEND_NOCANCEL ideal-int +pkg syscall (darwin-386), const SYS_SOCKET ideal-int +pkg syscall (darwin-386), const SYS_SOCKETPAIR ideal-int +pkg syscall (darwin-386), const SYS_STACK_SNAPSHOT ideal-int +pkg syscall (darwin-386), const SYS_STAT ideal-int +pkg syscall (darwin-386), const SYS_STAT64 ideal-int +pkg syscall (darwin-386), const SYS_STAT64_EXTENDED ideal-int +pkg syscall (darwin-386), const SYS_STATFS ideal-int +pkg syscall (darwin-386), const SYS_STATFS64 ideal-int +pkg syscall (darwin-386), const SYS_STATV ideal-int +pkg syscall (darwin-386), const SYS_STAT_EXTENDED ideal-int +pkg syscall (darwin-386), const SYS_SWAPON ideal-int +pkg syscall (darwin-386), const SYS_SYMLINK ideal-int +pkg syscall (darwin-386), const SYS_SYNC ideal-int +pkg syscall (darwin-386), const SYS_SYSCALL ideal-int +pkg syscall (darwin-386), const SYS_THREAD_SELFID ideal-int +pkg syscall (darwin-386), const SYS_TRUNCATE ideal-int +pkg syscall (darwin-386), const SYS_UMASK ideal-int +pkg syscall (darwin-386), const SYS_UMASK_EXTENDED ideal-int +pkg syscall (darwin-386), const SYS_UNDELETE ideal-int +pkg syscall (darwin-386), const SYS_UNLINK ideal-int +pkg syscall (darwin-386), const SYS_UNMOUNT ideal-int +pkg syscall (darwin-386), const SYS_UTIMES ideal-int +pkg syscall (darwin-386), const SYS_VFORK ideal-int +pkg syscall (darwin-386), const SYS_VM_PRESSURE_MONITOR ideal-int +pkg syscall (darwin-386), const SYS_WAIT4 ideal-int +pkg syscall (darwin-386), const SYS_WAIT4_NOCANCEL ideal-int +pkg syscall (darwin-386), const SYS_WAITEVENT ideal-int +pkg syscall (darwin-386), const SYS_WAITID ideal-int +pkg syscall (darwin-386), const SYS_WAITID_NOCANCEL ideal-int +pkg syscall (darwin-386), const SYS_WATCHEVENT ideal-int +pkg syscall (darwin-386), const SYS_WORKQ_KERNRETURN ideal-int +pkg syscall (darwin-386), const SYS_WORKQ_OPEN ideal-int +pkg syscall (darwin-386), const SYS_WRITE ideal-int +pkg syscall (darwin-386), const SYS_WRITEV ideal-int +pkg syscall (darwin-386), const SYS_WRITEV_NOCANCEL ideal-int +pkg syscall (darwin-386), const SYS_WRITE_NOCANCEL ideal-int +pkg syscall (darwin-386), const SYS___DISABLE_THREADSIGNAL ideal-int +pkg syscall (darwin-386), const SYS___MAC_EXECVE ideal-int +pkg syscall (darwin-386), const SYS___MAC_GETFSSTAT ideal-int +pkg syscall (darwin-386), const SYS___MAC_GET_FD ideal-int +pkg syscall (darwin-386), const SYS___MAC_GET_FILE ideal-int +pkg syscall (darwin-386), const SYS___MAC_GET_LCID ideal-int +pkg syscall (darwin-386), const SYS___MAC_GET_LCTX ideal-int +pkg syscall (darwin-386), const SYS___MAC_GET_LINK ideal-int +pkg syscall (darwin-386), const SYS___MAC_GET_MOUNT ideal-int +pkg syscall (darwin-386), const SYS___MAC_GET_PID ideal-int +pkg syscall (darwin-386), const SYS___MAC_GET_PROC ideal-int +pkg syscall (darwin-386), const SYS___MAC_MOUNT ideal-int +pkg syscall (darwin-386), const SYS___MAC_SET_FD ideal-int +pkg syscall (darwin-386), const SYS___MAC_SET_FILE ideal-int +pkg syscall (darwin-386), const SYS___MAC_SET_LCTX ideal-int +pkg syscall (darwin-386), const SYS___MAC_SET_LINK ideal-int +pkg syscall (darwin-386), const SYS___MAC_SET_PROC ideal-int +pkg syscall (darwin-386), const SYS___MAC_SYSCALL ideal-int +pkg syscall (darwin-386), const SYS___OLD_SEMWAIT_SIGNAL ideal-int +pkg syscall (darwin-386), const SYS___OLD_SEMWAIT_SIGNAL_NOCANCEL ideal-int +pkg syscall (darwin-386), const SYS___PTHREAD_CANCELED ideal-int +pkg syscall (darwin-386), const SYS___PTHREAD_CHDIR ideal-int +pkg syscall (darwin-386), const SYS___PTHREAD_FCHDIR ideal-int +pkg syscall (darwin-386), const SYS___PTHREAD_KILL ideal-int +pkg syscall (darwin-386), const SYS___PTHREAD_MARKCANCEL ideal-int +pkg syscall (darwin-386), const SYS___PTHREAD_SIGMASK ideal-int +pkg syscall (darwin-386), const SYS___SEMWAIT_SIGNAL ideal-int +pkg syscall (darwin-386), const SYS___SEMWAIT_SIGNAL_NOCANCEL ideal-int +pkg syscall (darwin-386), const SYS___SIGWAIT ideal-int +pkg syscall (darwin-386), const SYS___SIGWAIT_NOCANCEL ideal-int +pkg syscall (darwin-386), const SYS___SYSCTL ideal-int +pkg syscall (darwin-386), const S_IEXEC ideal-int +pkg syscall (darwin-386), const S_IFWHT ideal-int +pkg syscall (darwin-386), const S_IREAD ideal-int +pkg syscall (darwin-386), const S_IRGRP ideal-int +pkg syscall (darwin-386), const S_IROTH ideal-int +pkg syscall (darwin-386), const S_IRWXG ideal-int +pkg syscall (darwin-386), const S_IRWXO ideal-int +pkg syscall (darwin-386), const S_IRWXU ideal-int +pkg syscall (darwin-386), const S_ISTXT ideal-int +pkg syscall (darwin-386), const S_IWGRP ideal-int +pkg syscall (darwin-386), const S_IWOTH ideal-int +pkg syscall (darwin-386), const S_IWRITE ideal-int +pkg syscall (darwin-386), const S_IXGRP ideal-int +pkg syscall (darwin-386), const S_IXOTH ideal-int +pkg syscall (darwin-386), const SizeofBpfHdr ideal-int +pkg syscall (darwin-386), const SizeofBpfInsn ideal-int +pkg syscall (darwin-386), const SizeofBpfProgram ideal-int +pkg syscall (darwin-386), const SizeofBpfStat ideal-int +pkg syscall (darwin-386), const SizeofBpfVersion ideal-int +pkg syscall (darwin-386), const SizeofCmsghdr ideal-int +pkg syscall (darwin-386), const SizeofIPMreq ideal-int +pkg syscall (darwin-386), const SizeofIPv6Mreq ideal-int +pkg syscall (darwin-386), const SizeofIfData ideal-int +pkg syscall (darwin-386), const SizeofIfMsghdr ideal-int +pkg syscall (darwin-386), const SizeofIfaMsghdr ideal-int +pkg syscall (darwin-386), const SizeofIfmaMsghdr ideal-int +pkg syscall (darwin-386), const SizeofIfmaMsghdr2 ideal-int +pkg syscall (darwin-386), const SizeofInet6Pktinfo ideal-int +pkg syscall (darwin-386), const SizeofLinger ideal-int +pkg syscall (darwin-386), const SizeofMsghdr ideal-int +pkg syscall (darwin-386), const SizeofRtMetrics ideal-int +pkg syscall (darwin-386), const SizeofRtMsghdr ideal-int +pkg syscall (darwin-386), const SizeofSockaddrAny ideal-int +pkg syscall (darwin-386), const SizeofSockaddrDatalink ideal-int +pkg syscall (darwin-386), const SizeofSockaddrInet4 ideal-int +pkg syscall (darwin-386), const SizeofSockaddrInet6 ideal-int +pkg syscall (darwin-386), const SizeofSockaddrUnix ideal-int +pkg syscall (darwin-386), const TCP_CONNECTIONTIMEOUT ideal-int +pkg syscall (darwin-386), const TCP_KEEPALIVE ideal-int +pkg syscall (darwin-386), const TCP_MAXHLEN ideal-int +pkg syscall (darwin-386), const TCP_MAXOLEN ideal-int +pkg syscall (darwin-386), const TCP_MAXSEG ideal-int +pkg syscall (darwin-386), const TCP_MAXWIN ideal-int +pkg syscall (darwin-386), const TCP_MAX_SACK ideal-int +pkg syscall (darwin-386), const TCP_MAX_WINSHIFT ideal-int +pkg syscall (darwin-386), const TCP_MINMSS ideal-int +pkg syscall (darwin-386), const TCP_MINMSSOVERLOAD ideal-int +pkg syscall (darwin-386), const TCP_MSS ideal-int +pkg syscall (darwin-386), const TCP_NOOPT ideal-int +pkg syscall (darwin-386), const TCP_NOPUSH ideal-int +pkg syscall (darwin-386), const TCP_RXT_CONNDROPTIME ideal-int +pkg syscall (darwin-386), const TCP_RXT_FINDROP ideal-int +pkg syscall (darwin-386), const TIOCCBRK ideal-int +pkg syscall (darwin-386), const TIOCCDTR ideal-int +pkg syscall (darwin-386), const TIOCCONS ideal-int +pkg syscall (darwin-386), const TIOCDCDTIMESTAMP ideal-int +pkg syscall (darwin-386), const TIOCDRAIN ideal-int +pkg syscall (darwin-386), const TIOCDSIMICROCODE ideal-int +pkg syscall (darwin-386), const TIOCEXCL ideal-int +pkg syscall (darwin-386), const TIOCEXT ideal-int +pkg syscall (darwin-386), const TIOCFLUSH ideal-int +pkg syscall (darwin-386), const TIOCGDRAINWAIT ideal-int +pkg syscall (darwin-386), const TIOCGETA ideal-int +pkg syscall (darwin-386), const TIOCGETD ideal-int +pkg syscall (darwin-386), const TIOCGPGRP ideal-int +pkg syscall (darwin-386), const TIOCGWINSZ ideal-int +pkg syscall (darwin-386), const TIOCIXOFF ideal-int +pkg syscall (darwin-386), const TIOCIXON ideal-int +pkg syscall (darwin-386), const TIOCMBIC ideal-int +pkg syscall (darwin-386), const TIOCMBIS ideal-int +pkg syscall (darwin-386), const TIOCMGDTRWAIT ideal-int +pkg syscall (darwin-386), const TIOCMGET ideal-int +pkg syscall (darwin-386), const TIOCMODG ideal-int +pkg syscall (darwin-386), const TIOCMODS ideal-int +pkg syscall (darwin-386), const TIOCMSDTRWAIT ideal-int +pkg syscall (darwin-386), const TIOCMSET ideal-int +pkg syscall (darwin-386), const TIOCM_CAR ideal-int +pkg syscall (darwin-386), const TIOCM_CD ideal-int +pkg syscall (darwin-386), const TIOCM_CTS ideal-int +pkg syscall (darwin-386), const TIOCM_DSR ideal-int +pkg syscall (darwin-386), const TIOCM_DTR ideal-int +pkg syscall (darwin-386), const TIOCM_LE ideal-int +pkg syscall (darwin-386), const TIOCM_RI ideal-int +pkg syscall (darwin-386), const TIOCM_RNG ideal-int +pkg syscall (darwin-386), const TIOCM_RTS ideal-int +pkg syscall (darwin-386), const TIOCM_SR ideal-int +pkg syscall (darwin-386), const TIOCM_ST ideal-int +pkg syscall (darwin-386), const TIOCNOTTY ideal-int +pkg syscall (darwin-386), const TIOCNXCL ideal-int +pkg syscall (darwin-386), const TIOCOUTQ ideal-int +pkg syscall (darwin-386), const TIOCPKT ideal-int +pkg syscall (darwin-386), const TIOCPKT_DATA ideal-int +pkg syscall (darwin-386), const TIOCPKT_DOSTOP ideal-int +pkg syscall (darwin-386), const TIOCPKT_FLUSHREAD ideal-int +pkg syscall (darwin-386), const TIOCPKT_FLUSHWRITE ideal-int +pkg syscall (darwin-386), const TIOCPKT_IOCTL ideal-int +pkg syscall (darwin-386), const TIOCPKT_NOSTOP ideal-int +pkg syscall (darwin-386), const TIOCPKT_START ideal-int +pkg syscall (darwin-386), const TIOCPKT_STOP ideal-int +pkg syscall (darwin-386), const TIOCPTYGNAME ideal-int +pkg syscall (darwin-386), const TIOCPTYGRANT ideal-int +pkg syscall (darwin-386), const TIOCPTYUNLK ideal-int +pkg syscall (darwin-386), const TIOCREMOTE ideal-int +pkg syscall (darwin-386), const TIOCSBRK ideal-int +pkg syscall (darwin-386), const TIOCSCONS ideal-int +pkg syscall (darwin-386), const TIOCSCTTY ideal-int +pkg syscall (darwin-386), const TIOCSDRAINWAIT ideal-int +pkg syscall (darwin-386), const TIOCSDTR ideal-int +pkg syscall (darwin-386), const TIOCSETA ideal-int +pkg syscall (darwin-386), const TIOCSETAF ideal-int +pkg syscall (darwin-386), const TIOCSETAW ideal-int +pkg syscall (darwin-386), const TIOCSETD ideal-int +pkg syscall (darwin-386), const TIOCSIG ideal-int +pkg syscall (darwin-386), const TIOCSPGRP ideal-int +pkg syscall (darwin-386), const TIOCSTART ideal-int +pkg syscall (darwin-386), const TIOCSTAT ideal-int +pkg syscall (darwin-386), const TIOCSTI ideal-int +pkg syscall (darwin-386), const TIOCSTOP ideal-int +pkg syscall (darwin-386), const TIOCSWINSZ ideal-int +pkg syscall (darwin-386), const TIOCTIMESTAMP ideal-int +pkg syscall (darwin-386), const TIOCUCNTL ideal-int +pkg syscall (darwin-386), const WCONTINUED ideal-int +pkg syscall (darwin-386), const WCOREFLAG ideal-int +pkg syscall (darwin-386), const WEXITED ideal-int +pkg syscall (darwin-386), const WNOHANG ideal-int +pkg syscall (darwin-386), const WNOWAIT ideal-int +pkg syscall (darwin-386), const WORDSIZE ideal-int +pkg syscall (darwin-386), const WSTOPPED ideal-int +pkg syscall (darwin-386), const WUNTRACED ideal-int +pkg syscall (darwin-386), func Accept(int) (int, Sockaddr, error) +pkg syscall (darwin-386), func Access(string, uint32) error +pkg syscall (darwin-386), func Adjtime(*Timeval, *Timeval) error +pkg syscall (darwin-386), func Bind(int, Sockaddr) error +pkg syscall (darwin-386), func BpfBuflen(int) (int, error) +pkg syscall (darwin-386), func BpfDatalink(int) (int, error) +pkg syscall (darwin-386), func BpfHeadercmpl(int) (int, error) +pkg syscall (darwin-386), func BpfInterface(int, string) (string, error) +pkg syscall (darwin-386), func BpfJump(int, int, int, int) *BpfInsn +pkg syscall (darwin-386), func BpfStats(int) (*BpfStat, error) +pkg syscall (darwin-386), func BpfStmt(int, int) *BpfInsn +pkg syscall (darwin-386), func BpfTimeout(int) (*Timeval, error) +pkg syscall (darwin-386), func CheckBpfVersion(int) error +pkg syscall (darwin-386), func Chflags(string, int) error +pkg syscall (darwin-386), func Chroot(string) error +pkg syscall (darwin-386), func Close(int) error +pkg syscall (darwin-386), func CloseOnExec(int) +pkg syscall (darwin-386), func CmsgLen(int) int +pkg syscall (darwin-386), func CmsgSpace(int) int +pkg syscall (darwin-386), func Connect(int, Sockaddr) error +pkg syscall (darwin-386), func Dup(int) (int, error) +pkg syscall (darwin-386), func Dup2(int, int) error +pkg syscall (darwin-386), func Exchangedata(string, string, int) error +pkg syscall (darwin-386), func Fchdir(int) error +pkg syscall (darwin-386), func Fchflags(string, int) error +pkg syscall (darwin-386), func Fchmod(int, uint32) error +pkg syscall (darwin-386), func Fchown(int, int, int) error +pkg syscall (darwin-386), func Flock(int, int) error +pkg syscall (darwin-386), func FlushBpf(int) error +pkg syscall (darwin-386), func ForkExec(string, []string, *ProcAttr) (int, error) +pkg syscall (darwin-386), func Fpathconf(int, int) (int, error) +pkg syscall (darwin-386), func Fstat(int, *Stat_t) error +pkg syscall (darwin-386), func Fstatfs(int, *Statfs_t) error +pkg syscall (darwin-386), func Fsync(int) error +pkg syscall (darwin-386), func Ftruncate(int, int64) error +pkg syscall (darwin-386), func Futimes(int, []Timeval) error +pkg syscall (darwin-386), func Getdirentries(int, []uint8, *uintptr) (int, error) +pkg syscall (darwin-386), func Getdtablesize() int +pkg syscall (darwin-386), func Getfsstat([]Statfs_t, int) (int, error) +pkg syscall (darwin-386), func Getpeername(int) (Sockaddr, error) +pkg syscall (darwin-386), func Getpgid(int) (int, error) +pkg syscall (darwin-386), func Getpgrp() int +pkg syscall (darwin-386), func Getpriority(int, int) (int, error) +pkg syscall (darwin-386), func Getrlimit(int, *Rlimit) error +pkg syscall (darwin-386), func Getrusage(int, *Rusage) error +pkg syscall (darwin-386), func Getsid(int) (int, error) +pkg syscall (darwin-386), func Getsockname(int) (Sockaddr, error) +pkg syscall (darwin-386), func GetsockoptByte(int, int, int) (uint8, error) +pkg syscall (darwin-386), func GetsockoptIPMreq(int, int, int) (*IPMreq, error) +pkg syscall (darwin-386), func GetsockoptIPv6Mreq(int, int, int) (*IPv6Mreq, error) +pkg syscall (darwin-386), func GetsockoptInet4Addr(int, int, int) ([4]uint8, error) +pkg syscall (darwin-386), func GetsockoptInt(int, int, int) (int, error) +pkg syscall (darwin-386), func Issetugid() bool +pkg syscall (darwin-386), func Kevent(int, []Kevent_t, []Kevent_t, *Timespec) (int, error) +pkg syscall (darwin-386), func Kill(int, Signal) error +pkg syscall (darwin-386), func Kqueue() (int, error) +pkg syscall (darwin-386), func Listen(int, int) error +pkg syscall (darwin-386), func Lstat(string, *Stat_t) error +pkg syscall (darwin-386), func Mkfifo(string, uint32) error +pkg syscall (darwin-386), func Mknod(string, uint32, int) error +pkg syscall (darwin-386), func Mmap(int, int64, int, int, int) ([]uint8, error) +pkg syscall (darwin-386), func Munmap([]uint8) error +pkg syscall (darwin-386), func NsecToTimespec(int64) Timespec +pkg syscall (darwin-386), func Open(string, int, uint32) (int, error) +pkg syscall (darwin-386), func ParseDirent([]uint8, int, []string) (int, int, []string) +pkg syscall (darwin-386), func ParseRoutingMessage([]uint8) ([]RoutingMessage, error) +pkg syscall (darwin-386), func ParseRoutingSockaddr(RoutingMessage) ([]Sockaddr, error) +pkg syscall (darwin-386), func ParseSocketControlMessage([]uint8) ([]SocketControlMessage, error) +pkg syscall (darwin-386), func ParseUnixRights(*SocketControlMessage) ([]int, error) +pkg syscall (darwin-386), func Pathconf(string, int) (int, error) +pkg syscall (darwin-386), func Pipe([]int) error +pkg syscall (darwin-386), func Pread(int, []uint8, int64) (int, error) +pkg syscall (darwin-386), func PtraceAttach(int) error +pkg syscall (darwin-386), func PtraceDetach(int) error +pkg syscall (darwin-386), func Pwrite(int, []uint8, int64) (int, error) +pkg syscall (darwin-386), func RawSyscall(uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno) +pkg syscall (darwin-386), func RawSyscall6(uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno) +pkg syscall (darwin-386), func Read(int, []uint8) (int, error) +pkg syscall (darwin-386), func ReadDirent(int, []uint8) (int, error) +pkg syscall (darwin-386), func Recvfrom(int, []uint8, int) (int, Sockaddr, error) +pkg syscall (darwin-386), func Recvmsg(int, []uint8, []uint8, int) (int, int, int, Sockaddr, error) +pkg syscall (darwin-386), func Revoke(string) error +pkg syscall (darwin-386), func RouteRIB(int, int) ([]uint8, error) +pkg syscall (darwin-386), func Seek(int, int64, int) (int64, error) +pkg syscall (darwin-386), func Select(int, *FdSet, *FdSet, *FdSet, *Timeval) error +pkg syscall (darwin-386), func Sendfile(int, int, *int64, int) (int, error) +pkg syscall (darwin-386), func Sendmsg(int, []uint8, []uint8, Sockaddr, int) error +pkg syscall (darwin-386), func Sendto(int, []uint8, int, Sockaddr) error +pkg syscall (darwin-386), func SetBpf(int, []BpfInsn) error +pkg syscall (darwin-386), func SetBpfBuflen(int, int) (int, error) +pkg syscall (darwin-386), func SetBpfDatalink(int, int) (int, error) +pkg syscall (darwin-386), func SetBpfHeadercmpl(int, int) error +pkg syscall (darwin-386), func SetBpfImmediate(int, int) error +pkg syscall (darwin-386), func SetBpfInterface(int, string) error +pkg syscall (darwin-386), func SetBpfPromisc(int, int) error +pkg syscall (darwin-386), func SetBpfTimeout(int, *Timeval) error +pkg syscall (darwin-386), func SetKevent(*Kevent_t, int, int, int) +pkg syscall (darwin-386), func SetNonblock(int, bool) error +pkg syscall (darwin-386), func Setegid(int) error +pkg syscall (darwin-386), func Seteuid(int) error +pkg syscall (darwin-386), func Setgid(int) error +pkg syscall (darwin-386), func Setgroups([]int) error +pkg syscall (darwin-386), func Setlogin(string) error +pkg syscall (darwin-386), func Setpgid(int, int) error +pkg syscall (darwin-386), func Setpriority(int, int, int) error +pkg syscall (darwin-386), func Setprivexec(int) error +pkg syscall (darwin-386), func Setregid(int, int) error +pkg syscall (darwin-386), func Setreuid(int, int) error +pkg syscall (darwin-386), func Setrlimit(int, *Rlimit) error +pkg syscall (darwin-386), func Setsid() (int, error) +pkg syscall (darwin-386), func SetsockoptByte(int, int, int, uint8) error +pkg syscall (darwin-386), func SetsockoptIPMreq(int, int, int, *IPMreq) error +pkg syscall (darwin-386), func SetsockoptIPv6Mreq(int, int, int, *IPv6Mreq) error +pkg syscall (darwin-386), func SetsockoptInet4Addr(int, int, int, [4]uint8) error +pkg syscall (darwin-386), func SetsockoptInt(int, int, int, int) error +pkg syscall (darwin-386), func SetsockoptLinger(int, int, int, *Linger) error +pkg syscall (darwin-386), func SetsockoptString(int, int, int, string) error +pkg syscall (darwin-386), func SetsockoptTimeval(int, int, int, *Timeval) error +pkg syscall (darwin-386), func Settimeofday(*Timeval) error +pkg syscall (darwin-386), func Setuid(int) error +pkg syscall (darwin-386), func Shutdown(int, int) error +pkg syscall (darwin-386), func Socket(int, int, int) (int, error) +pkg syscall (darwin-386), func Socketpair(int, int, int) ([2]int, error) +pkg syscall (darwin-386), func Stat(string, *Stat_t) error +pkg syscall (darwin-386), func Statfs(string, *Statfs_t) error +pkg syscall (darwin-386), func StringSlicePtr([]string) []*uint8 +pkg syscall (darwin-386), func Sync() error +pkg syscall (darwin-386), func Syscall(uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno) +pkg syscall (darwin-386), func Syscall6(uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno) +pkg syscall (darwin-386), func Syscall9(uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno) +pkg syscall (darwin-386), func Sysctl(string) (string, error) +pkg syscall (darwin-386), func SysctlUint32(string) (uint32, error) +pkg syscall (darwin-386), func TimespecToNsec(Timespec) int64 +pkg syscall (darwin-386), func TimevalToNsec(Timeval) int64 +pkg syscall (darwin-386), func Truncate(string, int64) error +pkg syscall (darwin-386), func Umask(int) int +pkg syscall (darwin-386), func Undelete(string) error +pkg syscall (darwin-386), func UnixRights(...int) []uint8 +pkg syscall (darwin-386), func Unmount(string, int) error +pkg syscall (darwin-386), func Wait4(int, *WaitStatus, int, *Rusage) (int, error) +pkg syscall (darwin-386), func Write(int, []uint8) (int, error) +pkg syscall (darwin-386), method (*Cmsghdr) SetLen(int) +pkg syscall (darwin-386), method (*Iovec) SetLen(int) +pkg syscall (darwin-386), method (*Msghdr) SetControllen(int) +pkg syscall (darwin-386), type BpfHdr struct +pkg syscall (darwin-386), type BpfHdr struct, Caplen uint32 +pkg syscall (darwin-386), type BpfHdr struct, Datalen uint32 +pkg syscall (darwin-386), type BpfHdr struct, Hdrlen uint16 +pkg syscall (darwin-386), type BpfHdr struct, Pad_cgo_0 [2]uint8 +pkg syscall (darwin-386), type BpfHdr struct, Tstamp Timeval +pkg syscall (darwin-386), type BpfInsn struct +pkg syscall (darwin-386), type BpfInsn struct, Code uint16 +pkg syscall (darwin-386), type BpfInsn struct, Jf uint8 +pkg syscall (darwin-386), type BpfInsn struct, Jt uint8 +pkg syscall (darwin-386), type BpfInsn struct, K uint32 +pkg syscall (darwin-386), type BpfProgram struct +pkg syscall (darwin-386), type BpfProgram struct, Insns *BpfInsn +pkg syscall (darwin-386), type BpfProgram struct, Len uint32 +pkg syscall (darwin-386), type BpfStat struct +pkg syscall (darwin-386), type BpfStat struct, Drop uint32 +pkg syscall (darwin-386), type BpfStat struct, Recv uint32 +pkg syscall (darwin-386), type BpfVersion struct +pkg syscall (darwin-386), type BpfVersion struct, Major uint16 +pkg syscall (darwin-386), type BpfVersion struct, Minor uint16 +pkg syscall (darwin-386), type Cmsghdr struct +pkg syscall (darwin-386), type Cmsghdr struct, Len uint32 +pkg syscall (darwin-386), type Cmsghdr struct, Level int32 +pkg syscall (darwin-386), type Cmsghdr struct, Type int32 +pkg syscall (darwin-386), type Credential struct +pkg syscall (darwin-386), type Credential struct, Gid uint32 +pkg syscall (darwin-386), type Credential struct, Groups []uint32 +pkg syscall (darwin-386), type Credential struct, Uid uint32 +pkg syscall (darwin-386), type Dirent struct +pkg syscall (darwin-386), type Dirent struct, Ino uint64 +pkg syscall (darwin-386), type Dirent struct, Name [1024]int8 +pkg syscall (darwin-386), type Dirent struct, Namlen uint16 +pkg syscall (darwin-386), type Dirent struct, Pad_cgo_0 [3]uint8 +pkg syscall (darwin-386), type Dirent struct, Reclen uint16 +pkg syscall (darwin-386), type Dirent struct, Seekoff uint64 +pkg syscall (darwin-386), type Dirent struct, Type uint8 +pkg syscall (darwin-386), type Fbootstraptransfer_t struct +pkg syscall (darwin-386), type Fbootstraptransfer_t struct, Buffer *uint8 +pkg syscall (darwin-386), type Fbootstraptransfer_t struct, Length uint32 +pkg syscall (darwin-386), type Fbootstraptransfer_t struct, Offset int64 +pkg syscall (darwin-386), type FdSet struct +pkg syscall (darwin-386), type FdSet struct, Bits [32]int32 +pkg syscall (darwin-386), type Flock_t struct +pkg syscall (darwin-386), type Flock_t struct, Len int64 +pkg syscall (darwin-386), type Flock_t struct, Pid int32 +pkg syscall (darwin-386), type Flock_t struct, Start int64 +pkg syscall (darwin-386), type Flock_t struct, Type int16 +pkg syscall (darwin-386), type Flock_t struct, Whence int16 +pkg syscall (darwin-386), type Fsid struct +pkg syscall (darwin-386), type Fsid struct, Val [2]int32 +pkg syscall (darwin-386), type Fstore_t struct +pkg syscall (darwin-386), type Fstore_t struct, Bytesalloc int64 +pkg syscall (darwin-386), type Fstore_t struct, Flags uint32 +pkg syscall (darwin-386), type Fstore_t struct, Length int64 +pkg syscall (darwin-386), type Fstore_t struct, Offset int64 +pkg syscall (darwin-386), type Fstore_t struct, Posmode int32 +pkg syscall (darwin-386), type IfData struct +pkg syscall (darwin-386), type IfData struct, Addrlen uint8 +pkg syscall (darwin-386), type IfData struct, Baudrate uint32 +pkg syscall (darwin-386), type IfData struct, Collisions uint32 +pkg syscall (darwin-386), type IfData struct, Hdrlen uint8 +pkg syscall (darwin-386), type IfData struct, Hwassist uint32 +pkg syscall (darwin-386), type IfData struct, Ibytes uint32 +pkg syscall (darwin-386), type IfData struct, Ierrors uint32 +pkg syscall (darwin-386), type IfData struct, Imcasts uint32 +pkg syscall (darwin-386), type IfData struct, Ipackets uint32 +pkg syscall (darwin-386), type IfData struct, Iqdrops uint32 +pkg syscall (darwin-386), type IfData struct, Lastchange Timeval +pkg syscall (darwin-386), type IfData struct, Metric uint32 +pkg syscall (darwin-386), type IfData struct, Mtu uint32 +pkg syscall (darwin-386), type IfData struct, Noproto uint32 +pkg syscall (darwin-386), type IfData struct, Obytes uint32 +pkg syscall (darwin-386), type IfData struct, Oerrors uint32 +pkg syscall (darwin-386), type IfData struct, Omcasts uint32 +pkg syscall (darwin-386), type IfData struct, Opackets uint32 +pkg syscall (darwin-386), type IfData struct, Physical uint8 +pkg syscall (darwin-386), type IfData struct, Recvquota uint8 +pkg syscall (darwin-386), type IfData struct, Recvtiming uint32 +pkg syscall (darwin-386), type IfData struct, Reserved1 uint32 +pkg syscall (darwin-386), type IfData struct, Reserved2 uint32 +pkg syscall (darwin-386), type IfData struct, Type uint8 +pkg syscall (darwin-386), type IfData struct, Typelen uint8 +pkg syscall (darwin-386), type IfData struct, Unused1 uint8 +pkg syscall (darwin-386), type IfData struct, Unused2 uint32 +pkg syscall (darwin-386), type IfData struct, Xmitquota uint8 +pkg syscall (darwin-386), type IfData struct, Xmittiming uint32 +pkg syscall (darwin-386), type IfMsghdr struct +pkg syscall (darwin-386), type IfMsghdr struct, Addrs int32 +pkg syscall (darwin-386), type IfMsghdr struct, Data IfData +pkg syscall (darwin-386), type IfMsghdr struct, Flags int32 +pkg syscall (darwin-386), type IfMsghdr struct, Index uint16 +pkg syscall (darwin-386), type IfMsghdr struct, Msglen uint16 +pkg syscall (darwin-386), type IfMsghdr struct, Pad_cgo_0 [2]uint8 +pkg syscall (darwin-386), type IfMsghdr struct, Type uint8 +pkg syscall (darwin-386), type IfMsghdr struct, Version uint8 +pkg syscall (darwin-386), type IfaMsghdr struct +pkg syscall (darwin-386), type IfaMsghdr struct, Addrs int32 +pkg syscall (darwin-386), type IfaMsghdr struct, Flags int32 +pkg syscall (darwin-386), type IfaMsghdr struct, Index uint16 +pkg syscall (darwin-386), type IfaMsghdr struct, Metric int32 +pkg syscall (darwin-386), type IfaMsghdr struct, Msglen uint16 +pkg syscall (darwin-386), type IfaMsghdr struct, Pad_cgo_0 [2]uint8 +pkg syscall (darwin-386), type IfaMsghdr struct, Type uint8 +pkg syscall (darwin-386), type IfaMsghdr struct, Version uint8 +pkg syscall (darwin-386), type IfmaMsghdr struct +pkg syscall (darwin-386), type IfmaMsghdr struct, Addrs int32 +pkg syscall (darwin-386), type IfmaMsghdr struct, Flags int32 +pkg syscall (darwin-386), type IfmaMsghdr struct, Index uint16 +pkg syscall (darwin-386), type IfmaMsghdr struct, Msglen uint16 +pkg syscall (darwin-386), type IfmaMsghdr struct, Pad_cgo_0 [2]uint8 +pkg syscall (darwin-386), type IfmaMsghdr struct, Type uint8 +pkg syscall (darwin-386), type IfmaMsghdr struct, Version uint8 +pkg syscall (darwin-386), type IfmaMsghdr2 struct +pkg syscall (darwin-386), type IfmaMsghdr2 struct, Addrs int32 +pkg syscall (darwin-386), type IfmaMsghdr2 struct, Flags int32 +pkg syscall (darwin-386), type IfmaMsghdr2 struct, Index uint16 +pkg syscall (darwin-386), type IfmaMsghdr2 struct, Msglen uint16 +pkg syscall (darwin-386), type IfmaMsghdr2 struct, Pad_cgo_0 [2]uint8 +pkg syscall (darwin-386), type IfmaMsghdr2 struct, Refcount int32 +pkg syscall (darwin-386), type IfmaMsghdr2 struct, Type uint8 +pkg syscall (darwin-386), type IfmaMsghdr2 struct, Version uint8 +pkg syscall (darwin-386), type Inet6Pktinfo struct +pkg syscall (darwin-386), type Inet6Pktinfo struct, Addr [16]uint8 +pkg syscall (darwin-386), type Inet6Pktinfo struct, Ifindex uint32 +pkg syscall (darwin-386), type InterfaceAddrMessage struct +pkg syscall (darwin-386), type InterfaceAddrMessage struct, Data []uint8 +pkg syscall (darwin-386), type InterfaceAddrMessage struct, Header IfaMsghdr +pkg syscall (darwin-386), type InterfaceMessage struct +pkg syscall (darwin-386), type InterfaceMessage struct, Data []uint8 +pkg syscall (darwin-386), type InterfaceMessage struct, Header IfMsghdr +pkg syscall (darwin-386), type InterfaceMulticastAddrMessage struct +pkg syscall (darwin-386), type InterfaceMulticastAddrMessage struct, Data []uint8 +pkg syscall (darwin-386), type InterfaceMulticastAddrMessage struct, Header IfmaMsghdr2 +pkg syscall (darwin-386), type Iovec struct +pkg syscall (darwin-386), type Iovec struct, Base *uint8 +pkg syscall (darwin-386), type Iovec struct, Len uint32 +pkg syscall (darwin-386), type Kevent_t struct +pkg syscall (darwin-386), type Kevent_t struct, Data int32 +pkg syscall (darwin-386), type Kevent_t struct, Fflags uint32 +pkg syscall (darwin-386), type Kevent_t struct, Filter int16 +pkg syscall (darwin-386), type Kevent_t struct, Flags uint16 +pkg syscall (darwin-386), type Kevent_t struct, Ident uint32 +pkg syscall (darwin-386), type Kevent_t struct, Udata *uint8 +pkg syscall (darwin-386), type Log2phys_t struct +pkg syscall (darwin-386), type Log2phys_t struct, Contigbytes int64 +pkg syscall (darwin-386), type Log2phys_t struct, Devoffset int64 +pkg syscall (darwin-386), type Log2phys_t struct, Flags uint32 +pkg syscall (darwin-386), type Msghdr struct +pkg syscall (darwin-386), type Msghdr struct, Control *uint8 +pkg syscall (darwin-386), type Msghdr struct, Controllen uint32 +pkg syscall (darwin-386), type Msghdr struct, Flags int32 +pkg syscall (darwin-386), type Msghdr struct, Iov *Iovec +pkg syscall (darwin-386), type Msghdr struct, Iovlen int32 +pkg syscall (darwin-386), type Msghdr struct, Name *uint8 +pkg syscall (darwin-386), type Msghdr struct, Namelen uint32 +pkg syscall (darwin-386), type Radvisory_t struct +pkg syscall (darwin-386), type Radvisory_t struct, Count int32 +pkg syscall (darwin-386), type Radvisory_t struct, Offset int64 +pkg syscall (darwin-386), type RawSockaddr struct, Data [14]int8 +pkg syscall (darwin-386), type RawSockaddr struct, Family uint8 +pkg syscall (darwin-386), type RawSockaddr struct, Len uint8 +pkg syscall (darwin-386), type RawSockaddrAny struct, Pad [92]int8 +pkg syscall (darwin-386), type RawSockaddrDatalink struct +pkg syscall (darwin-386), type RawSockaddrDatalink struct, Alen uint8 +pkg syscall (darwin-386), type RawSockaddrDatalink struct, Data [12]int8 +pkg syscall (darwin-386), type RawSockaddrDatalink struct, Family uint8 +pkg syscall (darwin-386), type RawSockaddrDatalink struct, Index uint16 +pkg syscall (darwin-386), type RawSockaddrDatalink struct, Len uint8 +pkg syscall (darwin-386), type RawSockaddrDatalink struct, Nlen uint8 +pkg syscall (darwin-386), type RawSockaddrDatalink struct, Slen uint8 +pkg syscall (darwin-386), type RawSockaddrDatalink struct, Type uint8 +pkg syscall (darwin-386), type RawSockaddrInet4 struct, Family uint8 +pkg syscall (darwin-386), type RawSockaddrInet4 struct, Len uint8 +pkg syscall (darwin-386), type RawSockaddrInet4 struct, Zero [8]int8 +pkg syscall (darwin-386), type RawSockaddrInet6 struct +pkg syscall (darwin-386), type RawSockaddrInet6 struct, Addr [16]uint8 +pkg syscall (darwin-386), type RawSockaddrInet6 struct, Family uint8 +pkg syscall (darwin-386), type RawSockaddrInet6 struct, Flowinfo uint32 +pkg syscall (darwin-386), type RawSockaddrInet6 struct, Len uint8 +pkg syscall (darwin-386), type RawSockaddrInet6 struct, Port uint16 +pkg syscall (darwin-386), type RawSockaddrInet6 struct, Scope_id uint32 +pkg syscall (darwin-386), type RawSockaddrUnix struct +pkg syscall (darwin-386), type RawSockaddrUnix struct, Family uint8 +pkg syscall (darwin-386), type RawSockaddrUnix struct, Len uint8 +pkg syscall (darwin-386), type RawSockaddrUnix struct, Path [104]int8 +pkg syscall (darwin-386), type Rlimit struct +pkg syscall (darwin-386), type Rlimit struct, Cur uint64 +pkg syscall (darwin-386), type Rlimit struct, Max uint64 +pkg syscall (darwin-386), type RouteMessage struct +pkg syscall (darwin-386), type RouteMessage struct, Data []uint8 +pkg syscall (darwin-386), type RouteMessage struct, Header RtMsghdr +pkg syscall (darwin-386), type RoutingMessage interface, unexported methods +pkg syscall (darwin-386), type RtMetrics struct +pkg syscall (darwin-386), type RtMetrics struct, Expire int32 +pkg syscall (darwin-386), type RtMetrics struct, Filler [4]uint32 +pkg syscall (darwin-386), type RtMetrics struct, Hopcount uint32 +pkg syscall (darwin-386), type RtMetrics struct, Locks uint32 +pkg syscall (darwin-386), type RtMetrics struct, Mtu uint32 +pkg syscall (darwin-386), type RtMetrics struct, Pksent uint32 +pkg syscall (darwin-386), type RtMetrics struct, Recvpipe uint32 +pkg syscall (darwin-386), type RtMetrics struct, Rtt uint32 +pkg syscall (darwin-386), type RtMetrics struct, Rttvar uint32 +pkg syscall (darwin-386), type RtMetrics struct, Sendpipe uint32 +pkg syscall (darwin-386), type RtMetrics struct, Ssthresh uint32 +pkg syscall (darwin-386), type RtMsghdr struct +pkg syscall (darwin-386), type RtMsghdr struct, Addrs int32 +pkg syscall (darwin-386), type RtMsghdr struct, Errno int32 +pkg syscall (darwin-386), type RtMsghdr struct, Flags int32 +pkg syscall (darwin-386), type RtMsghdr struct, Index uint16 +pkg syscall (darwin-386), type RtMsghdr struct, Inits uint32 +pkg syscall (darwin-386), type RtMsghdr struct, Msglen uint16 +pkg syscall (darwin-386), type RtMsghdr struct, Pad_cgo_0 [2]uint8 +pkg syscall (darwin-386), type RtMsghdr struct, Pid int32 +pkg syscall (darwin-386), type RtMsghdr struct, Rmx RtMetrics +pkg syscall (darwin-386), type RtMsghdr struct, Seq int32 +pkg syscall (darwin-386), type RtMsghdr struct, Type uint8 +pkg syscall (darwin-386), type RtMsghdr struct, Use int32 +pkg syscall (darwin-386), type RtMsghdr struct, Version uint8 +pkg syscall (darwin-386), type Rusage struct, Idrss int32 +pkg syscall (darwin-386), type Rusage struct, Inblock int32 +pkg syscall (darwin-386), type Rusage struct, Isrss int32 +pkg syscall (darwin-386), type Rusage struct, Ixrss int32 +pkg syscall (darwin-386), type Rusage struct, Majflt int32 +pkg syscall (darwin-386), type Rusage struct, Maxrss int32 +pkg syscall (darwin-386), type Rusage struct, Minflt int32 +pkg syscall (darwin-386), type Rusage struct, Msgrcv int32 +pkg syscall (darwin-386), type Rusage struct, Msgsnd int32 +pkg syscall (darwin-386), type Rusage struct, Nivcsw int32 +pkg syscall (darwin-386), type Rusage struct, Nsignals int32 +pkg syscall (darwin-386), type Rusage struct, Nswap int32 +pkg syscall (darwin-386), type Rusage struct, Nvcsw int32 +pkg syscall (darwin-386), type Rusage struct, Oublock int32 +pkg syscall (darwin-386), type Rusage struct, Stime Timeval +pkg syscall (darwin-386), type Rusage struct, Utime Timeval +pkg syscall (darwin-386), type SockaddrDatalink struct +pkg syscall (darwin-386), type SockaddrDatalink struct, Alen uint8 +pkg syscall (darwin-386), type SockaddrDatalink struct, Data [12]int8 +pkg syscall (darwin-386), type SockaddrDatalink struct, Family uint8 +pkg syscall (darwin-386), type SockaddrDatalink struct, Index uint16 +pkg syscall (darwin-386), type SockaddrDatalink struct, Len uint8 +pkg syscall (darwin-386), type SockaddrDatalink struct, Nlen uint8 +pkg syscall (darwin-386), type SockaddrDatalink struct, Slen uint8 +pkg syscall (darwin-386), type SockaddrDatalink struct, Type uint8 +pkg syscall (darwin-386), type SocketControlMessage struct +pkg syscall (darwin-386), type SocketControlMessage struct, Data []uint8 +pkg syscall (darwin-386), type SocketControlMessage struct, Header Cmsghdr +pkg syscall (darwin-386), type Stat_t struct +pkg syscall (darwin-386), type Stat_t struct, Atimespec Timespec +pkg syscall (darwin-386), type Stat_t struct, Birthtimespec Timespec +pkg syscall (darwin-386), type Stat_t struct, Blksize int32 +pkg syscall (darwin-386), type Stat_t struct, Blocks int64 +pkg syscall (darwin-386), type Stat_t struct, Ctimespec Timespec +pkg syscall (darwin-386), type Stat_t struct, Dev int32 +pkg syscall (darwin-386), type Stat_t struct, Flags uint32 +pkg syscall (darwin-386), type Stat_t struct, Gen uint32 +pkg syscall (darwin-386), type Stat_t struct, Gid uint32 +pkg syscall (darwin-386), type Stat_t struct, Ino uint64 +pkg syscall (darwin-386), type Stat_t struct, Lspare int32 +pkg syscall (darwin-386), type Stat_t struct, Mode uint16 +pkg syscall (darwin-386), type Stat_t struct, Mtimespec Timespec +pkg syscall (darwin-386), type Stat_t struct, Nlink uint16 +pkg syscall (darwin-386), type Stat_t struct, Qspare [2]int64 +pkg syscall (darwin-386), type Stat_t struct, Rdev int32 +pkg syscall (darwin-386), type Stat_t struct, Size int64 +pkg syscall (darwin-386), type Stat_t struct, Uid uint32 +pkg syscall (darwin-386), type Statfs_t struct +pkg syscall (darwin-386), type Statfs_t struct, Bavail uint64 +pkg syscall (darwin-386), type Statfs_t struct, Bfree uint64 +pkg syscall (darwin-386), type Statfs_t struct, Blocks uint64 +pkg syscall (darwin-386), type Statfs_t struct, Bsize uint32 +pkg syscall (darwin-386), type Statfs_t struct, Ffree uint64 +pkg syscall (darwin-386), type Statfs_t struct, Files uint64 +pkg syscall (darwin-386), type Statfs_t struct, Flags uint32 +pkg syscall (darwin-386), type Statfs_t struct, Fsid Fsid +pkg syscall (darwin-386), type Statfs_t struct, Fssubtype uint32 +pkg syscall (darwin-386), type Statfs_t struct, Fstypename [16]int8 +pkg syscall (darwin-386), type Statfs_t struct, Iosize int32 +pkg syscall (darwin-386), type Statfs_t struct, Mntfromname [1024]int8 +pkg syscall (darwin-386), type Statfs_t struct, Mntonname [1024]int8 +pkg syscall (darwin-386), type Statfs_t struct, Owner uint32 +pkg syscall (darwin-386), type Statfs_t struct, Reserved [8]uint32 +pkg syscall (darwin-386), type Statfs_t struct, Type uint32 +pkg syscall (darwin-386), type SysProcAttr struct, Chroot string +pkg syscall (darwin-386), type SysProcAttr struct, Credential *Credential +pkg syscall (darwin-386), type SysProcAttr struct, Noctty bool +pkg syscall (darwin-386), type SysProcAttr struct, Ptrace bool +pkg syscall (darwin-386), type SysProcAttr struct, Setctty bool +pkg syscall (darwin-386), type SysProcAttr struct, Setpgid bool +pkg syscall (darwin-386), type SysProcAttr struct, Setsid bool +pkg syscall (darwin-386), type Timespec struct, Nsec int32 +pkg syscall (darwin-386), type Timespec struct, Sec int32 +pkg syscall (darwin-386), type Timeval struct, Sec int32 +pkg syscall (darwin-386), type Timeval struct, Usec int32 +pkg syscall (darwin-386), type Timeval32 [0]uint8 +pkg syscall (darwin-386), type WaitStatus uint32 +pkg syscall (darwin-386), var Stderr int +pkg syscall (darwin-386), var Stdin int +pkg syscall (darwin-386), var Stdout int +pkg syscall (darwin-386-cgo), const AF_APPLETALK ideal-int +pkg syscall (darwin-386-cgo), const AF_CCITT ideal-int +pkg syscall (darwin-386-cgo), const AF_CHAOS ideal-int +pkg syscall (darwin-386-cgo), const AF_CNT ideal-int +pkg syscall (darwin-386-cgo), const AF_COIP ideal-int +pkg syscall (darwin-386-cgo), const AF_DATAKIT ideal-int +pkg syscall (darwin-386-cgo), const AF_DECnet ideal-int +pkg syscall (darwin-386-cgo), const AF_DLI ideal-int +pkg syscall (darwin-386-cgo), const AF_E164 ideal-int +pkg syscall (darwin-386-cgo), const AF_ECMA ideal-int +pkg syscall (darwin-386-cgo), const AF_HYLINK ideal-int +pkg syscall (darwin-386-cgo), const AF_IEEE80211 ideal-int +pkg syscall (darwin-386-cgo), const AF_IMPLINK ideal-int +pkg syscall (darwin-386-cgo), const AF_IPX ideal-int +pkg syscall (darwin-386-cgo), const AF_ISDN ideal-int +pkg syscall (darwin-386-cgo), const AF_ISO ideal-int +pkg syscall (darwin-386-cgo), const AF_LAT ideal-int +pkg syscall (darwin-386-cgo), const AF_LINK ideal-int +pkg syscall (darwin-386-cgo), const AF_LOCAL ideal-int +pkg syscall (darwin-386-cgo), const AF_MAX ideal-int +pkg syscall (darwin-386-cgo), const AF_NATM ideal-int +pkg syscall (darwin-386-cgo), const AF_NDRV ideal-int +pkg syscall (darwin-386-cgo), const AF_NETBIOS ideal-int +pkg syscall (darwin-386-cgo), const AF_NS ideal-int +pkg syscall (darwin-386-cgo), const AF_OSI ideal-int +pkg syscall (darwin-386-cgo), const AF_PPP ideal-int +pkg syscall (darwin-386-cgo), const AF_PUP ideal-int +pkg syscall (darwin-386-cgo), const AF_RESERVED_36 ideal-int +pkg syscall (darwin-386-cgo), const AF_ROUTE ideal-int +pkg syscall (darwin-386-cgo), const AF_SIP ideal-int +pkg syscall (darwin-386-cgo), const AF_SNA ideal-int +pkg syscall (darwin-386-cgo), const AF_SYSTEM ideal-int +pkg syscall (darwin-386-cgo), const BIOCFLUSH ideal-int +pkg syscall (darwin-386-cgo), const BIOCGBLEN ideal-int +pkg syscall (darwin-386-cgo), const BIOCGDLT ideal-int +pkg syscall (darwin-386-cgo), const BIOCGDLTLIST ideal-int +pkg syscall (darwin-386-cgo), const BIOCGETIF ideal-int +pkg syscall (darwin-386-cgo), const BIOCGHDRCMPLT ideal-int +pkg syscall (darwin-386-cgo), const BIOCGRSIG ideal-int +pkg syscall (darwin-386-cgo), const BIOCGRTIMEOUT ideal-int +pkg syscall (darwin-386-cgo), const BIOCGSEESENT ideal-int +pkg syscall (darwin-386-cgo), const BIOCGSTATS ideal-int +pkg syscall (darwin-386-cgo), const BIOCIMMEDIATE ideal-int +pkg syscall (darwin-386-cgo), const BIOCPROMISC ideal-int +pkg syscall (darwin-386-cgo), const BIOCSBLEN ideal-int +pkg syscall (darwin-386-cgo), const BIOCSDLT ideal-int +pkg syscall (darwin-386-cgo), const BIOCSETF ideal-int +pkg syscall (darwin-386-cgo), const BIOCSETIF ideal-int +pkg syscall (darwin-386-cgo), const BIOCSHDRCMPLT ideal-int +pkg syscall (darwin-386-cgo), const BIOCSRSIG ideal-int +pkg syscall (darwin-386-cgo), const BIOCSRTIMEOUT ideal-int +pkg syscall (darwin-386-cgo), const BIOCSSEESENT ideal-int +pkg syscall (darwin-386-cgo), const BIOCVERSION ideal-int +pkg syscall (darwin-386-cgo), const BPF_A ideal-int +pkg syscall (darwin-386-cgo), const BPF_ABS ideal-int +pkg syscall (darwin-386-cgo), const BPF_ADD ideal-int +pkg syscall (darwin-386-cgo), const BPF_ALIGNMENT ideal-int +pkg syscall (darwin-386-cgo), const BPF_ALU ideal-int +pkg syscall (darwin-386-cgo), const BPF_AND ideal-int +pkg syscall (darwin-386-cgo), const BPF_B ideal-int +pkg syscall (darwin-386-cgo), const BPF_DIV ideal-int +pkg syscall (darwin-386-cgo), const BPF_H ideal-int +pkg syscall (darwin-386-cgo), const BPF_IMM ideal-int +pkg syscall (darwin-386-cgo), const BPF_IND ideal-int +pkg syscall (darwin-386-cgo), const BPF_JA ideal-int +pkg syscall (darwin-386-cgo), const BPF_JEQ ideal-int +pkg syscall (darwin-386-cgo), const BPF_JGE ideal-int +pkg syscall (darwin-386-cgo), const BPF_JGT ideal-int +pkg syscall (darwin-386-cgo), const BPF_JMP ideal-int +pkg syscall (darwin-386-cgo), const BPF_JSET ideal-int +pkg syscall (darwin-386-cgo), const BPF_K ideal-int +pkg syscall (darwin-386-cgo), const BPF_LD ideal-int +pkg syscall (darwin-386-cgo), const BPF_LDX ideal-int +pkg syscall (darwin-386-cgo), const BPF_LEN ideal-int +pkg syscall (darwin-386-cgo), const BPF_LSH ideal-int +pkg syscall (darwin-386-cgo), const BPF_MAJOR_VERSION ideal-int +pkg syscall (darwin-386-cgo), const BPF_MAXBUFSIZE ideal-int +pkg syscall (darwin-386-cgo), const BPF_MAXINSNS ideal-int +pkg syscall (darwin-386-cgo), const BPF_MEM ideal-int +pkg syscall (darwin-386-cgo), const BPF_MEMWORDS ideal-int +pkg syscall (darwin-386-cgo), const BPF_MINBUFSIZE ideal-int +pkg syscall (darwin-386-cgo), const BPF_MINOR_VERSION ideal-int +pkg syscall (darwin-386-cgo), const BPF_MISC ideal-int +pkg syscall (darwin-386-cgo), const BPF_MSH ideal-int +pkg syscall (darwin-386-cgo), const BPF_MUL ideal-int +pkg syscall (darwin-386-cgo), const BPF_NEG ideal-int +pkg syscall (darwin-386-cgo), const BPF_OR ideal-int +pkg syscall (darwin-386-cgo), const BPF_RELEASE ideal-int +pkg syscall (darwin-386-cgo), const BPF_RET ideal-int +pkg syscall (darwin-386-cgo), const BPF_RSH ideal-int +pkg syscall (darwin-386-cgo), const BPF_ST ideal-int +pkg syscall (darwin-386-cgo), const BPF_STX ideal-int +pkg syscall (darwin-386-cgo), const BPF_SUB ideal-int +pkg syscall (darwin-386-cgo), const BPF_TAX ideal-int +pkg syscall (darwin-386-cgo), const BPF_TXA ideal-int +pkg syscall (darwin-386-cgo), const BPF_W ideal-int +pkg syscall (darwin-386-cgo), const BPF_X ideal-int +pkg syscall (darwin-386-cgo), const CTL_MAXNAME ideal-int +pkg syscall (darwin-386-cgo), const CTL_NET ideal-int +pkg syscall (darwin-386-cgo), const DLT_APPLE_IP_OVER_IEEE1394 ideal-int +pkg syscall (darwin-386-cgo), const DLT_ARCNET ideal-int +pkg syscall (darwin-386-cgo), const DLT_ATM_CLIP ideal-int +pkg syscall (darwin-386-cgo), const DLT_ATM_RFC1483 ideal-int +pkg syscall (darwin-386-cgo), const DLT_AX25 ideal-int +pkg syscall (darwin-386-cgo), const DLT_CHAOS ideal-int +pkg syscall (darwin-386-cgo), const DLT_CHDLC ideal-int +pkg syscall (darwin-386-cgo), const DLT_C_HDLC ideal-int +pkg syscall (darwin-386-cgo), const DLT_EN10MB ideal-int +pkg syscall (darwin-386-cgo), const DLT_EN3MB ideal-int +pkg syscall (darwin-386-cgo), const DLT_FDDI ideal-int +pkg syscall (darwin-386-cgo), const DLT_IEEE802 ideal-int +pkg syscall (darwin-386-cgo), const DLT_IEEE802_11 ideal-int +pkg syscall (darwin-386-cgo), const DLT_IEEE802_11_RADIO ideal-int +pkg syscall (darwin-386-cgo), const DLT_IEEE802_11_RADIO_AVS ideal-int +pkg syscall (darwin-386-cgo), const DLT_LINUX_SLL ideal-int +pkg syscall (darwin-386-cgo), const DLT_LOOP ideal-int +pkg syscall (darwin-386-cgo), const DLT_NULL ideal-int +pkg syscall (darwin-386-cgo), const DLT_PFLOG ideal-int +pkg syscall (darwin-386-cgo), const DLT_PFSYNC ideal-int +pkg syscall (darwin-386-cgo), const DLT_PPP ideal-int +pkg syscall (darwin-386-cgo), const DLT_PPP_BSDOS ideal-int +pkg syscall (darwin-386-cgo), const DLT_PPP_SERIAL ideal-int +pkg syscall (darwin-386-cgo), const DLT_PRONET ideal-int +pkg syscall (darwin-386-cgo), const DLT_RAW ideal-int +pkg syscall (darwin-386-cgo), const DLT_SLIP ideal-int +pkg syscall (darwin-386-cgo), const DLT_SLIP_BSDOS ideal-int +pkg syscall (darwin-386-cgo), const DT_BLK ideal-int +pkg syscall (darwin-386-cgo), const DT_CHR ideal-int +pkg syscall (darwin-386-cgo), const DT_DIR ideal-int +pkg syscall (darwin-386-cgo), const DT_FIFO ideal-int +pkg syscall (darwin-386-cgo), const DT_LNK ideal-int +pkg syscall (darwin-386-cgo), const DT_REG ideal-int +pkg syscall (darwin-386-cgo), const DT_SOCK ideal-int +pkg syscall (darwin-386-cgo), const DT_UNKNOWN ideal-int +pkg syscall (darwin-386-cgo), const DT_WHT ideal-int +pkg syscall (darwin-386-cgo), const EAUTH Errno +pkg syscall (darwin-386-cgo), const EBADARCH Errno +pkg syscall (darwin-386-cgo), const EBADEXEC Errno +pkg syscall (darwin-386-cgo), const EBADMACHO Errno +pkg syscall (darwin-386-cgo), const EBADMSG Errno +pkg syscall (darwin-386-cgo), const EBADRPC Errno +pkg syscall (darwin-386-cgo), const ECHO ideal-int +pkg syscall (darwin-386-cgo), const ECHOCTL ideal-int +pkg syscall (darwin-386-cgo), const ECHOE ideal-int +pkg syscall (darwin-386-cgo), const ECHOK ideal-int +pkg syscall (darwin-386-cgo), const ECHOKE ideal-int +pkg syscall (darwin-386-cgo), const ECHONL ideal-int +pkg syscall (darwin-386-cgo), const ECHOPRT ideal-int +pkg syscall (darwin-386-cgo), const EDEVERR Errno +pkg syscall (darwin-386-cgo), const EFTYPE Errno +pkg syscall (darwin-386-cgo), const ELAST Errno +pkg syscall (darwin-386-cgo), const EMULTIHOP Errno +pkg syscall (darwin-386-cgo), const ENEEDAUTH Errno +pkg syscall (darwin-386-cgo), const ENOATTR Errno +pkg syscall (darwin-386-cgo), const ENODATA Errno +pkg syscall (darwin-386-cgo), const ENOLINK Errno +pkg syscall (darwin-386-cgo), const ENOPOLICY Errno +pkg syscall (darwin-386-cgo), const ENOSR Errno +pkg syscall (darwin-386-cgo), const ENOSTR Errno +pkg syscall (darwin-386-cgo), const ENOTRECOVERABLE Errno +pkg syscall (darwin-386-cgo), const EOWNERDEAD Errno +pkg syscall (darwin-386-cgo), const EPROCLIM Errno +pkg syscall (darwin-386-cgo), const EPROCUNAVAIL Errno +pkg syscall (darwin-386-cgo), const EPROGMISMATCH Errno +pkg syscall (darwin-386-cgo), const EPROGUNAVAIL Errno +pkg syscall (darwin-386-cgo), const EPROTO Errno +pkg syscall (darwin-386-cgo), const EPWROFF Errno +pkg syscall (darwin-386-cgo), const ERPCMISMATCH Errno +pkg syscall (darwin-386-cgo), const ESHLIBVERS Errno +pkg syscall (darwin-386-cgo), const ETIME Errno +pkg syscall (darwin-386-cgo), const EVFILT_AIO ideal-int +pkg syscall (darwin-386-cgo), const EVFILT_FS ideal-int +pkg syscall (darwin-386-cgo), const EVFILT_MACHPORT ideal-int +pkg syscall (darwin-386-cgo), const EVFILT_PROC ideal-int +pkg syscall (darwin-386-cgo), const EVFILT_READ ideal-int +pkg syscall (darwin-386-cgo), const EVFILT_SIGNAL ideal-int +pkg syscall (darwin-386-cgo), const EVFILT_SYSCOUNT ideal-int +pkg syscall (darwin-386-cgo), const EVFILT_THREADMARKER ideal-int +pkg syscall (darwin-386-cgo), const EVFILT_TIMER ideal-int +pkg syscall (darwin-386-cgo), const EVFILT_USER ideal-int +pkg syscall (darwin-386-cgo), const EVFILT_VM ideal-int +pkg syscall (darwin-386-cgo), const EVFILT_VNODE ideal-int +pkg syscall (darwin-386-cgo), const EVFILT_WRITE ideal-int +pkg syscall (darwin-386-cgo), const EV_ADD ideal-int +pkg syscall (darwin-386-cgo), const EV_CLEAR ideal-int +pkg syscall (darwin-386-cgo), const EV_DELETE ideal-int +pkg syscall (darwin-386-cgo), const EV_DISABLE ideal-int +pkg syscall (darwin-386-cgo), const EV_DISPATCH ideal-int +pkg syscall (darwin-386-cgo), const EV_ENABLE ideal-int +pkg syscall (darwin-386-cgo), const EV_EOF ideal-int +pkg syscall (darwin-386-cgo), const EV_ERROR ideal-int +pkg syscall (darwin-386-cgo), const EV_FLAG0 ideal-int +pkg syscall (darwin-386-cgo), const EV_FLAG1 ideal-int +pkg syscall (darwin-386-cgo), const EV_ONESHOT ideal-int +pkg syscall (darwin-386-cgo), const EV_OOBAND ideal-int +pkg syscall (darwin-386-cgo), const EV_POLL ideal-int +pkg syscall (darwin-386-cgo), const EV_RECEIPT ideal-int +pkg syscall (darwin-386-cgo), const EV_SYSFLAGS ideal-int +pkg syscall (darwin-386-cgo), const EXTA ideal-int +pkg syscall (darwin-386-cgo), const EXTB ideal-int +pkg syscall (darwin-386-cgo), const EXTPROC ideal-int +pkg syscall (darwin-386-cgo), const FD_CLOEXEC ideal-int +pkg syscall (darwin-386-cgo), const FD_SETSIZE ideal-int +pkg syscall (darwin-386-cgo), const F_ADDFILESIGS ideal-int +pkg syscall (darwin-386-cgo), const F_ADDSIGS ideal-int +pkg syscall (darwin-386-cgo), const F_ALLOCATEALL ideal-int +pkg syscall (darwin-386-cgo), const F_ALLOCATECONTIG ideal-int +pkg syscall (darwin-386-cgo), const F_CHKCLEAN ideal-int +pkg syscall (darwin-386-cgo), const F_DUPFD ideal-int +pkg syscall (darwin-386-cgo), const F_DUPFD_CLOEXEC ideal-int +pkg syscall (darwin-386-cgo), const F_FLUSH_DATA ideal-int +pkg syscall (darwin-386-cgo), const F_FREEZE_FS ideal-int +pkg syscall (darwin-386-cgo), const F_FULLFSYNC ideal-int +pkg syscall (darwin-386-cgo), const F_GETFD ideal-int +pkg syscall (darwin-386-cgo), const F_GETFL ideal-int +pkg syscall (darwin-386-cgo), const F_GETLK ideal-int +pkg syscall (darwin-386-cgo), const F_GETLKPID ideal-int +pkg syscall (darwin-386-cgo), const F_GETNOSIGPIPE ideal-int +pkg syscall (darwin-386-cgo), const F_GETOWN ideal-int +pkg syscall (darwin-386-cgo), const F_GETPATH ideal-int +pkg syscall (darwin-386-cgo), const F_GETPATH_MTMINFO ideal-int +pkg syscall (darwin-386-cgo), const F_GETPROTECTIONCLASS ideal-int +pkg syscall (darwin-386-cgo), const F_GLOBAL_NOCACHE ideal-int +pkg syscall (darwin-386-cgo), const F_LOG2PHYS ideal-int +pkg syscall (darwin-386-cgo), const F_LOG2PHYS_EXT ideal-int +pkg syscall (darwin-386-cgo), const F_MARKDEPENDENCY ideal-int +pkg syscall (darwin-386-cgo), const F_NOCACHE ideal-int +pkg syscall (darwin-386-cgo), const F_NODIRECT ideal-int +pkg syscall (darwin-386-cgo), const F_OK ideal-int +pkg syscall (darwin-386-cgo), const F_PATHPKG_CHECK ideal-int +pkg syscall (darwin-386-cgo), const F_PEOFPOSMODE ideal-int +pkg syscall (darwin-386-cgo), const F_PREALLOCATE ideal-int +pkg syscall (darwin-386-cgo), const F_RDADVISE ideal-int +pkg syscall (darwin-386-cgo), const F_RDAHEAD ideal-int +pkg syscall (darwin-386-cgo), const F_RDLCK ideal-int +pkg syscall (darwin-386-cgo), const F_READBOOTSTRAP ideal-int +pkg syscall (darwin-386-cgo), const F_SETBACKINGSTORE ideal-int +pkg syscall (darwin-386-cgo), const F_SETFD ideal-int +pkg syscall (darwin-386-cgo), const F_SETFL ideal-int +pkg syscall (darwin-386-cgo), const F_SETLK ideal-int +pkg syscall (darwin-386-cgo), const F_SETLKW ideal-int +pkg syscall (darwin-386-cgo), const F_SETNOSIGPIPE ideal-int +pkg syscall (darwin-386-cgo), const F_SETOWN ideal-int +pkg syscall (darwin-386-cgo), const F_SETPROTECTIONCLASS ideal-int +pkg syscall (darwin-386-cgo), const F_SETSIZE ideal-int +pkg syscall (darwin-386-cgo), const F_THAW_FS ideal-int +pkg syscall (darwin-386-cgo), const F_UNLCK ideal-int +pkg syscall (darwin-386-cgo), const F_VOLPOSMODE ideal-int +pkg syscall (darwin-386-cgo), const F_WRITEBOOTSTRAP ideal-int +pkg syscall (darwin-386-cgo), const F_WRLCK ideal-int +pkg syscall (darwin-386-cgo), const IFF_ALLMULTI ideal-int +pkg syscall (darwin-386-cgo), const IFF_ALTPHYS ideal-int +pkg syscall (darwin-386-cgo), const IFF_DEBUG ideal-int +pkg syscall (darwin-386-cgo), const IFF_LINK0 ideal-int +pkg syscall (darwin-386-cgo), const IFF_LINK1 ideal-int +pkg syscall (darwin-386-cgo), const IFF_LINK2 ideal-int +pkg syscall (darwin-386-cgo), const IFF_NOARP ideal-int +pkg syscall (darwin-386-cgo), const IFF_NOTRAILERS ideal-int +pkg syscall (darwin-386-cgo), const IFF_OACTIVE ideal-int +pkg syscall (darwin-386-cgo), const IFF_POINTOPOINT ideal-int +pkg syscall (darwin-386-cgo), const IFF_PROMISC ideal-int +pkg syscall (darwin-386-cgo), const IFF_RUNNING ideal-int +pkg syscall (darwin-386-cgo), const IFF_SIMPLEX ideal-int +pkg syscall (darwin-386-cgo), const IFNAMSIZ ideal-int +pkg syscall (darwin-386-cgo), const IFT_1822 ideal-int +pkg syscall (darwin-386-cgo), const IFT_AAL5 ideal-int +pkg syscall (darwin-386-cgo), const IFT_ARCNET ideal-int +pkg syscall (darwin-386-cgo), const IFT_ARCNETPLUS ideal-int +pkg syscall (darwin-386-cgo), const IFT_ATM ideal-int +pkg syscall (darwin-386-cgo), const IFT_BRIDGE ideal-int +pkg syscall (darwin-386-cgo), const IFT_CARP ideal-int +pkg syscall (darwin-386-cgo), const IFT_CELLULAR ideal-int +pkg syscall (darwin-386-cgo), const IFT_CEPT ideal-int +pkg syscall (darwin-386-cgo), const IFT_DS3 ideal-int +pkg syscall (darwin-386-cgo), const IFT_ENC ideal-int +pkg syscall (darwin-386-cgo), const IFT_EON ideal-int +pkg syscall (darwin-386-cgo), const IFT_ETHER ideal-int +pkg syscall (darwin-386-cgo), const IFT_FAITH ideal-int +pkg syscall (darwin-386-cgo), const IFT_FDDI ideal-int +pkg syscall (darwin-386-cgo), const IFT_FRELAY ideal-int +pkg syscall (darwin-386-cgo), const IFT_FRELAYDCE ideal-int +pkg syscall (darwin-386-cgo), const IFT_GIF ideal-int +pkg syscall (darwin-386-cgo), const IFT_HDH1822 ideal-int +pkg syscall (darwin-386-cgo), const IFT_HIPPI ideal-int +pkg syscall (darwin-386-cgo), const IFT_HSSI ideal-int +pkg syscall (darwin-386-cgo), const IFT_HY ideal-int +pkg syscall (darwin-386-cgo), const IFT_IEEE1394 ideal-int +pkg syscall (darwin-386-cgo), const IFT_IEEE8023ADLAG ideal-int +pkg syscall (darwin-386-cgo), const IFT_ISDNBASIC ideal-int +pkg syscall (darwin-386-cgo), const IFT_ISDNPRIMARY ideal-int +pkg syscall (darwin-386-cgo), const IFT_ISO88022LLC ideal-int +pkg syscall (darwin-386-cgo), const IFT_ISO88023 ideal-int +pkg syscall (darwin-386-cgo), const IFT_ISO88024 ideal-int +pkg syscall (darwin-386-cgo), const IFT_ISO88025 ideal-int +pkg syscall (darwin-386-cgo), const IFT_ISO88026 ideal-int +pkg syscall (darwin-386-cgo), const IFT_L2VLAN ideal-int +pkg syscall (darwin-386-cgo), const IFT_LAPB ideal-int +pkg syscall (darwin-386-cgo), const IFT_LOCALTALK ideal-int +pkg syscall (darwin-386-cgo), const IFT_LOOP ideal-int +pkg syscall (darwin-386-cgo), const IFT_MIOX25 ideal-int +pkg syscall (darwin-386-cgo), const IFT_MODEM ideal-int +pkg syscall (darwin-386-cgo), const IFT_NSIP ideal-int +pkg syscall (darwin-386-cgo), const IFT_OTHER ideal-int +pkg syscall (darwin-386-cgo), const IFT_P10 ideal-int +pkg syscall (darwin-386-cgo), const IFT_P80 ideal-int +pkg syscall (darwin-386-cgo), const IFT_PARA ideal-int +pkg syscall (darwin-386-cgo), const IFT_PDP ideal-int +pkg syscall (darwin-386-cgo), const IFT_PFLOG ideal-int +pkg syscall (darwin-386-cgo), const IFT_PFSYNC ideal-int +pkg syscall (darwin-386-cgo), const IFT_PPP ideal-int +pkg syscall (darwin-386-cgo), const IFT_PROPMUX ideal-int +pkg syscall (darwin-386-cgo), const IFT_PROPVIRTUAL ideal-int +pkg syscall (darwin-386-cgo), const IFT_PTPSERIAL ideal-int +pkg syscall (darwin-386-cgo), const IFT_RS232 ideal-int +pkg syscall (darwin-386-cgo), const IFT_SDLC ideal-int +pkg syscall (darwin-386-cgo), const IFT_SIP ideal-int +pkg syscall (darwin-386-cgo), const IFT_SLIP ideal-int +pkg syscall (darwin-386-cgo), const IFT_SMDSDXI ideal-int +pkg syscall (darwin-386-cgo), const IFT_SMDSICIP ideal-int +pkg syscall (darwin-386-cgo), const IFT_SONET ideal-int +pkg syscall (darwin-386-cgo), const IFT_SONETPATH ideal-int +pkg syscall (darwin-386-cgo), const IFT_SONETVT ideal-int +pkg syscall (darwin-386-cgo), const IFT_STARLAN ideal-int +pkg syscall (darwin-386-cgo), const IFT_STF ideal-int +pkg syscall (darwin-386-cgo), const IFT_T1 ideal-int +pkg syscall (darwin-386-cgo), const IFT_ULTRA ideal-int +pkg syscall (darwin-386-cgo), const IFT_V35 ideal-int +pkg syscall (darwin-386-cgo), const IFT_X25 ideal-int +pkg syscall (darwin-386-cgo), const IFT_X25DDN ideal-int +pkg syscall (darwin-386-cgo), const IFT_X25PLE ideal-int +pkg syscall (darwin-386-cgo), const IFT_XETHER ideal-int +pkg syscall (darwin-386-cgo), const IN_CLASSA_HOST ideal-int +pkg syscall (darwin-386-cgo), const IN_CLASSA_MAX ideal-int +pkg syscall (darwin-386-cgo), const IN_CLASSA_NET ideal-int +pkg syscall (darwin-386-cgo), const IN_CLASSA_NSHIFT ideal-int +pkg syscall (darwin-386-cgo), const IN_CLASSB_HOST ideal-int +pkg syscall (darwin-386-cgo), const IN_CLASSB_MAX ideal-int +pkg syscall (darwin-386-cgo), const IN_CLASSB_NET ideal-int +pkg syscall (darwin-386-cgo), const IN_CLASSB_NSHIFT ideal-int +pkg syscall (darwin-386-cgo), const IN_CLASSC_HOST ideal-int +pkg syscall (darwin-386-cgo), const IN_CLASSC_NET ideal-int +pkg syscall (darwin-386-cgo), const IN_CLASSC_NSHIFT ideal-int +pkg syscall (darwin-386-cgo), const IN_CLASSD_HOST ideal-int +pkg syscall (darwin-386-cgo), const IN_CLASSD_NET ideal-int +pkg syscall (darwin-386-cgo), const IN_CLASSD_NSHIFT ideal-int +pkg syscall (darwin-386-cgo), const IN_LINKLOCALNETNUM ideal-int +pkg syscall (darwin-386-cgo), const IN_LOOPBACKNET ideal-int +pkg syscall (darwin-386-cgo), const IPPROTO_3PC ideal-int +pkg syscall (darwin-386-cgo), const IPPROTO_ADFS ideal-int +pkg syscall (darwin-386-cgo), const IPPROTO_AH ideal-int +pkg syscall (darwin-386-cgo), const IPPROTO_AHIP ideal-int +pkg syscall (darwin-386-cgo), const IPPROTO_APES ideal-int +pkg syscall (darwin-386-cgo), const IPPROTO_ARGUS ideal-int +pkg syscall (darwin-386-cgo), const IPPROTO_AX25 ideal-int +pkg syscall (darwin-386-cgo), const IPPROTO_BHA ideal-int +pkg syscall (darwin-386-cgo), const IPPROTO_BLT ideal-int +pkg syscall (darwin-386-cgo), const IPPROTO_BRSATMON ideal-int +pkg syscall (darwin-386-cgo), const IPPROTO_CFTP ideal-int +pkg syscall (darwin-386-cgo), const IPPROTO_CHAOS ideal-int +pkg syscall (darwin-386-cgo), const IPPROTO_CMTP ideal-int +pkg syscall (darwin-386-cgo), const IPPROTO_CPHB ideal-int +pkg syscall (darwin-386-cgo), const IPPROTO_CPNX ideal-int +pkg syscall (darwin-386-cgo), const IPPROTO_DDP ideal-int +pkg syscall (darwin-386-cgo), const IPPROTO_DGP ideal-int +pkg syscall (darwin-386-cgo), const IPPROTO_DIVERT ideal-int +pkg syscall (darwin-386-cgo), const IPPROTO_DONE ideal-int +pkg syscall (darwin-386-cgo), const IPPROTO_DSTOPTS ideal-int +pkg syscall (darwin-386-cgo), const IPPROTO_EGP ideal-int +pkg syscall (darwin-386-cgo), const IPPROTO_EMCON ideal-int +pkg syscall (darwin-386-cgo), const IPPROTO_ENCAP ideal-int +pkg syscall (darwin-386-cgo), const IPPROTO_EON ideal-int +pkg syscall (darwin-386-cgo), const IPPROTO_ESP ideal-int +pkg syscall (darwin-386-cgo), const IPPROTO_ETHERIP ideal-int +pkg syscall (darwin-386-cgo), const IPPROTO_FRAGMENT ideal-int +pkg syscall (darwin-386-cgo), const IPPROTO_GGP ideal-int +pkg syscall (darwin-386-cgo), const IPPROTO_GMTP ideal-int +pkg syscall (darwin-386-cgo), const IPPROTO_GRE ideal-int +pkg syscall (darwin-386-cgo), const IPPROTO_HELLO ideal-int +pkg syscall (darwin-386-cgo), const IPPROTO_HMP ideal-int +pkg syscall (darwin-386-cgo), const IPPROTO_HOPOPTS ideal-int +pkg syscall (darwin-386-cgo), const IPPROTO_ICMP ideal-int +pkg syscall (darwin-386-cgo), const IPPROTO_ICMPV6 ideal-int +pkg syscall (darwin-386-cgo), const IPPROTO_IDP ideal-int +pkg syscall (darwin-386-cgo), const IPPROTO_IDPR ideal-int +pkg syscall (darwin-386-cgo), const IPPROTO_IDRP ideal-int +pkg syscall (darwin-386-cgo), const IPPROTO_IGMP ideal-int +pkg syscall (darwin-386-cgo), const IPPROTO_IGP ideal-int +pkg syscall (darwin-386-cgo), const IPPROTO_IGRP ideal-int +pkg syscall (darwin-386-cgo), const IPPROTO_IL ideal-int +pkg syscall (darwin-386-cgo), const IPPROTO_INLSP ideal-int +pkg syscall (darwin-386-cgo), const IPPROTO_INP ideal-int +pkg syscall (darwin-386-cgo), const IPPROTO_IPCOMP ideal-int +pkg syscall (darwin-386-cgo), const IPPROTO_IPCV ideal-int +pkg syscall (darwin-386-cgo), const IPPROTO_IPEIP ideal-int +pkg syscall (darwin-386-cgo), const IPPROTO_IPIP ideal-int +pkg syscall (darwin-386-cgo), const IPPROTO_IPPC ideal-int +pkg syscall (darwin-386-cgo), const IPPROTO_IPV4 ideal-int +pkg syscall (darwin-386-cgo), const IPPROTO_IRTP ideal-int +pkg syscall (darwin-386-cgo), const IPPROTO_KRYPTOLAN ideal-int +pkg syscall (darwin-386-cgo), const IPPROTO_LARP ideal-int +pkg syscall (darwin-386-cgo), const IPPROTO_LEAF1 ideal-int +pkg syscall (darwin-386-cgo), const IPPROTO_LEAF2 ideal-int +pkg syscall (darwin-386-cgo), const IPPROTO_MAX ideal-int +pkg syscall (darwin-386-cgo), const IPPROTO_MAXID ideal-int +pkg syscall (darwin-386-cgo), const IPPROTO_MEAS ideal-int +pkg syscall (darwin-386-cgo), const IPPROTO_MHRP ideal-int +pkg syscall (darwin-386-cgo), const IPPROTO_MICP ideal-int +pkg syscall (darwin-386-cgo), const IPPROTO_MTP ideal-int +pkg syscall (darwin-386-cgo), const IPPROTO_MUX ideal-int +pkg syscall (darwin-386-cgo), const IPPROTO_ND ideal-int +pkg syscall (darwin-386-cgo), const IPPROTO_NHRP ideal-int +pkg syscall (darwin-386-cgo), const IPPROTO_NONE ideal-int +pkg syscall (darwin-386-cgo), const IPPROTO_NSP ideal-int +pkg syscall (darwin-386-cgo), const IPPROTO_NVPII ideal-int +pkg syscall (darwin-386-cgo), const IPPROTO_OSPFIGP ideal-int +pkg syscall (darwin-386-cgo), const IPPROTO_PGM ideal-int +pkg syscall (darwin-386-cgo), const IPPROTO_PIGP ideal-int +pkg syscall (darwin-386-cgo), const IPPROTO_PIM ideal-int +pkg syscall (darwin-386-cgo), const IPPROTO_PRM ideal-int +pkg syscall (darwin-386-cgo), const IPPROTO_PUP ideal-int +pkg syscall (darwin-386-cgo), const IPPROTO_PVP ideal-int +pkg syscall (darwin-386-cgo), const IPPROTO_RAW ideal-int +pkg syscall (darwin-386-cgo), const IPPROTO_RCCMON ideal-int +pkg syscall (darwin-386-cgo), const IPPROTO_RDP ideal-int +pkg syscall (darwin-386-cgo), const IPPROTO_ROUTING ideal-int +pkg syscall (darwin-386-cgo), const IPPROTO_RSVP ideal-int +pkg syscall (darwin-386-cgo), const IPPROTO_RVD ideal-int +pkg syscall (darwin-386-cgo), const IPPROTO_SATEXPAK ideal-int +pkg syscall (darwin-386-cgo), const IPPROTO_SATMON ideal-int +pkg syscall (darwin-386-cgo), const IPPROTO_SCCSP ideal-int +pkg syscall (darwin-386-cgo), const IPPROTO_SCTP ideal-int +pkg syscall (darwin-386-cgo), const IPPROTO_SDRP ideal-int +pkg syscall (darwin-386-cgo), const IPPROTO_SEP ideal-int +pkg syscall (darwin-386-cgo), const IPPROTO_SRPC ideal-int +pkg syscall (darwin-386-cgo), const IPPROTO_ST ideal-int +pkg syscall (darwin-386-cgo), const IPPROTO_SVMTP ideal-int +pkg syscall (darwin-386-cgo), const IPPROTO_SWIPE ideal-int +pkg syscall (darwin-386-cgo), const IPPROTO_TCF ideal-int +pkg syscall (darwin-386-cgo), const IPPROTO_TP ideal-int +pkg syscall (darwin-386-cgo), const IPPROTO_TPXX ideal-int +pkg syscall (darwin-386-cgo), const IPPROTO_TRUNK1 ideal-int +pkg syscall (darwin-386-cgo), const IPPROTO_TRUNK2 ideal-int +pkg syscall (darwin-386-cgo), const IPPROTO_TTP ideal-int +pkg syscall (darwin-386-cgo), const IPPROTO_VINES ideal-int +pkg syscall (darwin-386-cgo), const IPPROTO_VISA ideal-int +pkg syscall (darwin-386-cgo), const IPPROTO_VMTP ideal-int +pkg syscall (darwin-386-cgo), const IPPROTO_WBEXPAK ideal-int +pkg syscall (darwin-386-cgo), const IPPROTO_WBMON ideal-int +pkg syscall (darwin-386-cgo), const IPPROTO_WSN ideal-int +pkg syscall (darwin-386-cgo), const IPPROTO_XNET ideal-int +pkg syscall (darwin-386-cgo), const IPPROTO_XTP ideal-int +pkg syscall (darwin-386-cgo), const IPV6_2292DSTOPTS ideal-int +pkg syscall (darwin-386-cgo), const IPV6_2292HOPLIMIT ideal-int +pkg syscall (darwin-386-cgo), const IPV6_2292HOPOPTS ideal-int +pkg syscall (darwin-386-cgo), const IPV6_2292NEXTHOP ideal-int +pkg syscall (darwin-386-cgo), const IPV6_2292PKTINFO ideal-int +pkg syscall (darwin-386-cgo), const IPV6_2292PKTOPTIONS ideal-int +pkg syscall (darwin-386-cgo), const IPV6_2292RTHDR ideal-int +pkg syscall (darwin-386-cgo), const IPV6_BINDV6ONLY ideal-int +pkg syscall (darwin-386-cgo), const IPV6_BOUND_IF ideal-int +pkg syscall (darwin-386-cgo), const IPV6_CHECKSUM ideal-int +pkg syscall (darwin-386-cgo), const IPV6_DEFAULT_MULTICAST_HOPS ideal-int +pkg syscall (darwin-386-cgo), const IPV6_DEFAULT_MULTICAST_LOOP ideal-int +pkg syscall (darwin-386-cgo), const IPV6_DEFHLIM ideal-int +pkg syscall (darwin-386-cgo), const IPV6_FAITH ideal-int +pkg syscall (darwin-386-cgo), const IPV6_FLOWINFO_MASK ideal-int +pkg syscall (darwin-386-cgo), const IPV6_FLOWLABEL_MASK ideal-int +pkg syscall (darwin-386-cgo), const IPV6_FRAGTTL ideal-int +pkg syscall (darwin-386-cgo), const IPV6_FW_ADD ideal-int +pkg syscall (darwin-386-cgo), const IPV6_FW_DEL ideal-int +pkg syscall (darwin-386-cgo), const IPV6_FW_FLUSH ideal-int +pkg syscall (darwin-386-cgo), const IPV6_FW_GET ideal-int +pkg syscall (darwin-386-cgo), const IPV6_FW_ZERO ideal-int +pkg syscall (darwin-386-cgo), const IPV6_HLIMDEC ideal-int +pkg syscall (darwin-386-cgo), const IPV6_IPSEC_POLICY ideal-int +pkg syscall (darwin-386-cgo), const IPV6_MAXHLIM ideal-int +pkg syscall (darwin-386-cgo), const IPV6_MAXOPTHDR ideal-int +pkg syscall (darwin-386-cgo), const IPV6_MAXPACKET ideal-int +pkg syscall (darwin-386-cgo), const IPV6_MAX_GROUP_SRC_FILTER ideal-int +pkg syscall (darwin-386-cgo), const IPV6_MAX_MEMBERSHIPS ideal-int +pkg syscall (darwin-386-cgo), const IPV6_MAX_SOCK_SRC_FILTER ideal-int +pkg syscall (darwin-386-cgo), const IPV6_MIN_MEMBERSHIPS ideal-int +pkg syscall (darwin-386-cgo), const IPV6_MMTU ideal-int +pkg syscall (darwin-386-cgo), const IPV6_PORTRANGE ideal-int +pkg syscall (darwin-386-cgo), const IPV6_PORTRANGE_DEFAULT ideal-int +pkg syscall (darwin-386-cgo), const IPV6_PORTRANGE_HIGH ideal-int +pkg syscall (darwin-386-cgo), const IPV6_PORTRANGE_LOW ideal-int +pkg syscall (darwin-386-cgo), const IPV6_RECVTCLASS ideal-int +pkg syscall (darwin-386-cgo), const IPV6_RTHDR_LOOSE ideal-int +pkg syscall (darwin-386-cgo), const IPV6_RTHDR_STRICT ideal-int +pkg syscall (darwin-386-cgo), const IPV6_RTHDR_TYPE_0 ideal-int +pkg syscall (darwin-386-cgo), const IPV6_SOCKOPT_RESERVED1 ideal-int +pkg syscall (darwin-386-cgo), const IPV6_TCLASS ideal-int +pkg syscall (darwin-386-cgo), const IPV6_VERSION ideal-int +pkg syscall (darwin-386-cgo), const IPV6_VERSION_MASK ideal-int +pkg syscall (darwin-386-cgo), const IP_ADD_SOURCE_MEMBERSHIP ideal-int +pkg syscall (darwin-386-cgo), const IP_BLOCK_SOURCE ideal-int +pkg syscall (darwin-386-cgo), const IP_BOUND_IF ideal-int +pkg syscall (darwin-386-cgo), const IP_DEFAULT_MULTICAST_LOOP ideal-int +pkg syscall (darwin-386-cgo), const IP_DEFAULT_MULTICAST_TTL ideal-int +pkg syscall (darwin-386-cgo), const IP_DF ideal-int +pkg syscall (darwin-386-cgo), const IP_DROP_SOURCE_MEMBERSHIP ideal-int +pkg syscall (darwin-386-cgo), const IP_DUMMYNET_CONFIGURE ideal-int +pkg syscall (darwin-386-cgo), const IP_DUMMYNET_DEL ideal-int +pkg syscall (darwin-386-cgo), const IP_DUMMYNET_FLUSH ideal-int +pkg syscall (darwin-386-cgo), const IP_DUMMYNET_GET ideal-int +pkg syscall (darwin-386-cgo), const IP_FAITH ideal-int +pkg syscall (darwin-386-cgo), const IP_FW_ADD ideal-int +pkg syscall (darwin-386-cgo), const IP_FW_DEL ideal-int +pkg syscall (darwin-386-cgo), const IP_FW_FLUSH ideal-int +pkg syscall (darwin-386-cgo), const IP_FW_GET ideal-int +pkg syscall (darwin-386-cgo), const IP_FW_RESETLOG ideal-int +pkg syscall (darwin-386-cgo), const IP_FW_ZERO ideal-int +pkg syscall (darwin-386-cgo), const IP_HDRINCL ideal-int +pkg syscall (darwin-386-cgo), const IP_IPSEC_POLICY ideal-int +pkg syscall (darwin-386-cgo), const IP_MAXPACKET ideal-int +pkg syscall (darwin-386-cgo), const IP_MAX_GROUP_SRC_FILTER ideal-int +pkg syscall (darwin-386-cgo), const IP_MAX_MEMBERSHIPS ideal-int +pkg syscall (darwin-386-cgo), const IP_MAX_SOCK_MUTE_FILTER ideal-int +pkg syscall (darwin-386-cgo), const IP_MAX_SOCK_SRC_FILTER ideal-int +pkg syscall (darwin-386-cgo), const IP_MF ideal-int +pkg syscall (darwin-386-cgo), const IP_MIN_MEMBERSHIPS ideal-int +pkg syscall (darwin-386-cgo), const IP_MSFILTER ideal-int +pkg syscall (darwin-386-cgo), const IP_MSS ideal-int +pkg syscall (darwin-386-cgo), const IP_MULTICAST_IFINDEX ideal-int +pkg syscall (darwin-386-cgo), const IP_MULTICAST_VIF ideal-int +pkg syscall (darwin-386-cgo), const IP_NAT__XXX ideal-int +pkg syscall (darwin-386-cgo), const IP_OFFMASK ideal-int +pkg syscall (darwin-386-cgo), const IP_OLD_FW_ADD ideal-int +pkg syscall (darwin-386-cgo), const IP_OLD_FW_DEL ideal-int +pkg syscall (darwin-386-cgo), const IP_OLD_FW_FLUSH ideal-int +pkg syscall (darwin-386-cgo), const IP_OLD_FW_GET ideal-int +pkg syscall (darwin-386-cgo), const IP_OLD_FW_RESETLOG ideal-int +pkg syscall (darwin-386-cgo), const IP_OLD_FW_ZERO ideal-int +pkg syscall (darwin-386-cgo), const IP_OPTIONS ideal-int +pkg syscall (darwin-386-cgo), const IP_PKTINFO ideal-int +pkg syscall (darwin-386-cgo), const IP_PORTRANGE ideal-int +pkg syscall (darwin-386-cgo), const IP_PORTRANGE_DEFAULT ideal-int +pkg syscall (darwin-386-cgo), const IP_PORTRANGE_HIGH ideal-int +pkg syscall (darwin-386-cgo), const IP_PORTRANGE_LOW ideal-int +pkg syscall (darwin-386-cgo), const IP_RECVDSTADDR ideal-int +pkg syscall (darwin-386-cgo), const IP_RECVIF ideal-int +pkg syscall (darwin-386-cgo), const IP_RECVOPTS ideal-int +pkg syscall (darwin-386-cgo), const IP_RECVPKTINFO ideal-int +pkg syscall (darwin-386-cgo), const IP_RECVRETOPTS ideal-int +pkg syscall (darwin-386-cgo), const IP_RECVTTL ideal-int +pkg syscall (darwin-386-cgo), const IP_RETOPTS ideal-int +pkg syscall (darwin-386-cgo), const IP_RF ideal-int +pkg syscall (darwin-386-cgo), const IP_RSVP_OFF ideal-int +pkg syscall (darwin-386-cgo), const IP_RSVP_ON ideal-int +pkg syscall (darwin-386-cgo), const IP_RSVP_VIF_OFF ideal-int +pkg syscall (darwin-386-cgo), const IP_RSVP_VIF_ON ideal-int +pkg syscall (darwin-386-cgo), const IP_STRIPHDR ideal-int +pkg syscall (darwin-386-cgo), const IP_TRAFFIC_MGT_BACKGROUND ideal-int +pkg syscall (darwin-386-cgo), const IP_UNBLOCK_SOURCE ideal-int +pkg syscall (darwin-386-cgo), const LOCK_EX ideal-int +pkg syscall (darwin-386-cgo), const LOCK_NB ideal-int +pkg syscall (darwin-386-cgo), const LOCK_SH ideal-int +pkg syscall (darwin-386-cgo), const LOCK_UN ideal-int +pkg syscall (darwin-386-cgo), const MADV_CAN_REUSE ideal-int +pkg syscall (darwin-386-cgo), const MADV_DONTNEED ideal-int +pkg syscall (darwin-386-cgo), const MADV_FREE ideal-int +pkg syscall (darwin-386-cgo), const MADV_FREE_REUSABLE ideal-int +pkg syscall (darwin-386-cgo), const MADV_FREE_REUSE ideal-int +pkg syscall (darwin-386-cgo), const MADV_NORMAL ideal-int +pkg syscall (darwin-386-cgo), const MADV_RANDOM ideal-int +pkg syscall (darwin-386-cgo), const MADV_SEQUENTIAL ideal-int +pkg syscall (darwin-386-cgo), const MADV_WILLNEED ideal-int +pkg syscall (darwin-386-cgo), const MADV_ZERO_WIRED_PAGES ideal-int +pkg syscall (darwin-386-cgo), const MAP_ANON ideal-int +pkg syscall (darwin-386-cgo), const MAP_COPY ideal-int +pkg syscall (darwin-386-cgo), const MAP_FILE ideal-int +pkg syscall (darwin-386-cgo), const MAP_FIXED ideal-int +pkg syscall (darwin-386-cgo), const MAP_HASSEMAPHORE ideal-int +pkg syscall (darwin-386-cgo), const MAP_JIT ideal-int +pkg syscall (darwin-386-cgo), const MAP_NOCACHE ideal-int +pkg syscall (darwin-386-cgo), const MAP_NOEXTEND ideal-int +pkg syscall (darwin-386-cgo), const MAP_NORESERVE ideal-int +pkg syscall (darwin-386-cgo), const MAP_PRIVATE ideal-int +pkg syscall (darwin-386-cgo), const MAP_RENAME ideal-int +pkg syscall (darwin-386-cgo), const MAP_RESERVED0080 ideal-int +pkg syscall (darwin-386-cgo), const MAP_SHARED ideal-int +pkg syscall (darwin-386-cgo), const MCL_CURRENT ideal-int +pkg syscall (darwin-386-cgo), const MCL_FUTURE ideal-int +pkg syscall (darwin-386-cgo), const MSG_CTRUNC ideal-int +pkg syscall (darwin-386-cgo), const MSG_DONTROUTE ideal-int +pkg syscall (darwin-386-cgo), const MSG_DONTWAIT ideal-int +pkg syscall (darwin-386-cgo), const MSG_EOF ideal-int +pkg syscall (darwin-386-cgo), const MSG_EOR ideal-int +pkg syscall (darwin-386-cgo), const MSG_FLUSH ideal-int +pkg syscall (darwin-386-cgo), const MSG_HAVEMORE ideal-int +pkg syscall (darwin-386-cgo), const MSG_HOLD ideal-int +pkg syscall (darwin-386-cgo), const MSG_NEEDSA ideal-int +pkg syscall (darwin-386-cgo), const MSG_OOB ideal-int +pkg syscall (darwin-386-cgo), const MSG_PEEK ideal-int +pkg syscall (darwin-386-cgo), const MSG_RCVMORE ideal-int +pkg syscall (darwin-386-cgo), const MSG_SEND ideal-int +pkg syscall (darwin-386-cgo), const MSG_TRUNC ideal-int +pkg syscall (darwin-386-cgo), const MSG_WAITALL ideal-int +pkg syscall (darwin-386-cgo), const MSG_WAITSTREAM ideal-int +pkg syscall (darwin-386-cgo), const MS_ASYNC ideal-int +pkg syscall (darwin-386-cgo), const MS_DEACTIVATE ideal-int +pkg syscall (darwin-386-cgo), const MS_INVALIDATE ideal-int +pkg syscall (darwin-386-cgo), const MS_KILLPAGES ideal-int +pkg syscall (darwin-386-cgo), const MS_SYNC ideal-int +pkg syscall (darwin-386-cgo), const NAME_MAX ideal-int +pkg syscall (darwin-386-cgo), const NET_RT_DUMP ideal-int +pkg syscall (darwin-386-cgo), const NET_RT_DUMP2 ideal-int +pkg syscall (darwin-386-cgo), const NET_RT_FLAGS ideal-int +pkg syscall (darwin-386-cgo), const NET_RT_IFLIST ideal-int +pkg syscall (darwin-386-cgo), const NET_RT_IFLIST2 ideal-int +pkg syscall (darwin-386-cgo), const NET_RT_MAXID ideal-int +pkg syscall (darwin-386-cgo), const NET_RT_STAT ideal-int +pkg syscall (darwin-386-cgo), const NET_RT_TRASH ideal-int +pkg syscall (darwin-386-cgo), const NOTE_ABSOLUTE ideal-int +pkg syscall (darwin-386-cgo), const NOTE_ATTRIB ideal-int +pkg syscall (darwin-386-cgo), const NOTE_CHILD ideal-int +pkg syscall (darwin-386-cgo), const NOTE_DELETE ideal-int +pkg syscall (darwin-386-cgo), const NOTE_EXEC ideal-int +pkg syscall (darwin-386-cgo), const NOTE_EXIT ideal-int +pkg syscall (darwin-386-cgo), const NOTE_EXITSTATUS ideal-int +pkg syscall (darwin-386-cgo), const NOTE_EXTEND ideal-int +pkg syscall (darwin-386-cgo), const NOTE_FFAND ideal-int +pkg syscall (darwin-386-cgo), const NOTE_FFCOPY ideal-int +pkg syscall (darwin-386-cgo), const NOTE_FFCTRLMASK ideal-int +pkg syscall (darwin-386-cgo), const NOTE_FFLAGSMASK ideal-int +pkg syscall (darwin-386-cgo), const NOTE_FFNOP ideal-int +pkg syscall (darwin-386-cgo), const NOTE_FFOR ideal-int +pkg syscall (darwin-386-cgo), const NOTE_FORK ideal-int +pkg syscall (darwin-386-cgo), const NOTE_LINK ideal-int +pkg syscall (darwin-386-cgo), const NOTE_LOWAT ideal-int +pkg syscall (darwin-386-cgo), const NOTE_NONE ideal-int +pkg syscall (darwin-386-cgo), const NOTE_NSECONDS ideal-int +pkg syscall (darwin-386-cgo), const NOTE_PCTRLMASK ideal-int +pkg syscall (darwin-386-cgo), const NOTE_PDATAMASK ideal-int +pkg syscall (darwin-386-cgo), const NOTE_REAP ideal-int +pkg syscall (darwin-386-cgo), const NOTE_RENAME ideal-int +pkg syscall (darwin-386-cgo), const NOTE_RESOURCEEND ideal-int +pkg syscall (darwin-386-cgo), const NOTE_REVOKE ideal-int +pkg syscall (darwin-386-cgo), const NOTE_SECONDS ideal-int +pkg syscall (darwin-386-cgo), const NOTE_SIGNAL ideal-int +pkg syscall (darwin-386-cgo), const NOTE_TRACK ideal-int +pkg syscall (darwin-386-cgo), const NOTE_TRACKERR ideal-int +pkg syscall (darwin-386-cgo), const NOTE_TRIGGER ideal-int +pkg syscall (darwin-386-cgo), const NOTE_USECONDS ideal-int +pkg syscall (darwin-386-cgo), const NOTE_VM_ERROR ideal-int +pkg syscall (darwin-386-cgo), const NOTE_VM_PRESSURE ideal-int +pkg syscall (darwin-386-cgo), const NOTE_VM_PRESSURE_SUDDEN_TERMINATE ideal-int +pkg syscall (darwin-386-cgo), const NOTE_VM_PRESSURE_TERMINATE ideal-int +pkg syscall (darwin-386-cgo), const NOTE_WRITE ideal-int +pkg syscall (darwin-386-cgo), const O_ACCMODE ideal-int +pkg syscall (darwin-386-cgo), const O_ALERT ideal-int +pkg syscall (darwin-386-cgo), const O_DIRECTORY ideal-int +pkg syscall (darwin-386-cgo), const O_DSYNC ideal-int +pkg syscall (darwin-386-cgo), const O_EVTONLY ideal-int +pkg syscall (darwin-386-cgo), const O_EXLOCK ideal-int +pkg syscall (darwin-386-cgo), const O_FSYNC ideal-int +pkg syscall (darwin-386-cgo), const O_NDELAY ideal-int +pkg syscall (darwin-386-cgo), const O_NOFOLLOW ideal-int +pkg syscall (darwin-386-cgo), const O_POPUP ideal-int +pkg syscall (darwin-386-cgo), const O_SHLOCK ideal-int +pkg syscall (darwin-386-cgo), const O_SYMLINK ideal-int +pkg syscall (darwin-386-cgo), const PROT_EXEC ideal-int +pkg syscall (darwin-386-cgo), const PROT_NONE ideal-int +pkg syscall (darwin-386-cgo), const PROT_READ ideal-int +pkg syscall (darwin-386-cgo), const PROT_WRITE ideal-int +pkg syscall (darwin-386-cgo), const PTRACE_CONT ideal-int +pkg syscall (darwin-386-cgo), const PTRACE_KILL ideal-int +pkg syscall (darwin-386-cgo), const PTRACE_TRACEME ideal-int +pkg syscall (darwin-386-cgo), const PT_ATTACH ideal-int +pkg syscall (darwin-386-cgo), const PT_ATTACHEXC ideal-int +pkg syscall (darwin-386-cgo), const PT_CONTINUE ideal-int +pkg syscall (darwin-386-cgo), const PT_DENY_ATTACH ideal-int +pkg syscall (darwin-386-cgo), const PT_DETACH ideal-int +pkg syscall (darwin-386-cgo), const PT_FIRSTMACH ideal-int +pkg syscall (darwin-386-cgo), const PT_FORCEQUOTA ideal-int +pkg syscall (darwin-386-cgo), const PT_KILL ideal-int +pkg syscall (darwin-386-cgo), const PT_READ_D ideal-int +pkg syscall (darwin-386-cgo), const PT_READ_I ideal-int +pkg syscall (darwin-386-cgo), const PT_READ_U ideal-int +pkg syscall (darwin-386-cgo), const PT_SIGEXC ideal-int +pkg syscall (darwin-386-cgo), const PT_STEP ideal-int +pkg syscall (darwin-386-cgo), const PT_THUPDATE ideal-int +pkg syscall (darwin-386-cgo), const PT_TRACE_ME ideal-int +pkg syscall (darwin-386-cgo), const PT_WRITE_D ideal-int +pkg syscall (darwin-386-cgo), const PT_WRITE_I ideal-int +pkg syscall (darwin-386-cgo), const PT_WRITE_U ideal-int +pkg syscall (darwin-386-cgo), const RLIMIT_AS ideal-int +pkg syscall (darwin-386-cgo), const RLIMIT_CORE ideal-int +pkg syscall (darwin-386-cgo), const RLIMIT_CPU ideal-int +pkg syscall (darwin-386-cgo), const RLIMIT_DATA ideal-int +pkg syscall (darwin-386-cgo), const RLIMIT_FSIZE ideal-int +pkg syscall (darwin-386-cgo), const RLIMIT_NOFILE ideal-int +pkg syscall (darwin-386-cgo), const RLIMIT_STACK ideal-int +pkg syscall (darwin-386-cgo), const RLIM_INFINITY ideal-int +pkg syscall (darwin-386-cgo), const RTAX_AUTHOR ideal-int +pkg syscall (darwin-386-cgo), const RTAX_BRD ideal-int +pkg syscall (darwin-386-cgo), const RTAX_DST ideal-int +pkg syscall (darwin-386-cgo), const RTAX_GATEWAY ideal-int +pkg syscall (darwin-386-cgo), const RTAX_GENMASK ideal-int +pkg syscall (darwin-386-cgo), const RTAX_IFA ideal-int +pkg syscall (darwin-386-cgo), const RTAX_IFP ideal-int +pkg syscall (darwin-386-cgo), const RTAX_MAX ideal-int +pkg syscall (darwin-386-cgo), const RTAX_NETMASK ideal-int +pkg syscall (darwin-386-cgo), const RTA_AUTHOR ideal-int +pkg syscall (darwin-386-cgo), const RTA_BRD ideal-int +pkg syscall (darwin-386-cgo), const RTA_DST ideal-int +pkg syscall (darwin-386-cgo), const RTA_GATEWAY ideal-int +pkg syscall (darwin-386-cgo), const RTA_GENMASK ideal-int +pkg syscall (darwin-386-cgo), const RTA_IFA ideal-int +pkg syscall (darwin-386-cgo), const RTA_IFP ideal-int +pkg syscall (darwin-386-cgo), const RTA_NETMASK ideal-int +pkg syscall (darwin-386-cgo), const RTF_BLACKHOLE ideal-int +pkg syscall (darwin-386-cgo), const RTF_BROADCAST ideal-int +pkg syscall (darwin-386-cgo), const RTF_CLONING ideal-int +pkg syscall (darwin-386-cgo), const RTF_CONDEMNED ideal-int +pkg syscall (darwin-386-cgo), const RTF_DELCLONE ideal-int +pkg syscall (darwin-386-cgo), const RTF_DONE ideal-int +pkg syscall (darwin-386-cgo), const RTF_DYNAMIC ideal-int +pkg syscall (darwin-386-cgo), const RTF_GATEWAY ideal-int +pkg syscall (darwin-386-cgo), const RTF_HOST ideal-int +pkg syscall (darwin-386-cgo), const RTF_IFREF ideal-int +pkg syscall (darwin-386-cgo), const RTF_IFSCOPE ideal-int +pkg syscall (darwin-386-cgo), const RTF_LLINFO ideal-int +pkg syscall (darwin-386-cgo), const RTF_LOCAL ideal-int +pkg syscall (darwin-386-cgo), const RTF_MODIFIED ideal-int +pkg syscall (darwin-386-cgo), const RTF_MULTICAST ideal-int +pkg syscall (darwin-386-cgo), const RTF_PINNED ideal-int +pkg syscall (darwin-386-cgo), const RTF_PRCLONING ideal-int +pkg syscall (darwin-386-cgo), const RTF_PROTO1 ideal-int +pkg syscall (darwin-386-cgo), const RTF_PROTO2 ideal-int +pkg syscall (darwin-386-cgo), const RTF_PROTO3 ideal-int +pkg syscall (darwin-386-cgo), const RTF_REJECT ideal-int +pkg syscall (darwin-386-cgo), const RTF_STATIC ideal-int +pkg syscall (darwin-386-cgo), const RTF_UP ideal-int +pkg syscall (darwin-386-cgo), const RTF_WASCLONED ideal-int +pkg syscall (darwin-386-cgo), const RTF_XRESOLVE ideal-int +pkg syscall (darwin-386-cgo), const RTM_ADD ideal-int +pkg syscall (darwin-386-cgo), const RTM_CHANGE ideal-int +pkg syscall (darwin-386-cgo), const RTM_DELADDR ideal-int +pkg syscall (darwin-386-cgo), const RTM_DELETE ideal-int +pkg syscall (darwin-386-cgo), const RTM_DELMADDR ideal-int +pkg syscall (darwin-386-cgo), const RTM_GET ideal-int +pkg syscall (darwin-386-cgo), const RTM_GET2 ideal-int +pkg syscall (darwin-386-cgo), const RTM_IFINFO ideal-int +pkg syscall (darwin-386-cgo), const RTM_IFINFO2 ideal-int +pkg syscall (darwin-386-cgo), const RTM_LOCK ideal-int +pkg syscall (darwin-386-cgo), const RTM_LOSING ideal-int +pkg syscall (darwin-386-cgo), const RTM_MISS ideal-int +pkg syscall (darwin-386-cgo), const RTM_NEWADDR ideal-int +pkg syscall (darwin-386-cgo), const RTM_NEWMADDR ideal-int +pkg syscall (darwin-386-cgo), const RTM_NEWMADDR2 ideal-int +pkg syscall (darwin-386-cgo), const RTM_OLDADD ideal-int +pkg syscall (darwin-386-cgo), const RTM_OLDDEL ideal-int +pkg syscall (darwin-386-cgo), const RTM_REDIRECT ideal-int +pkg syscall (darwin-386-cgo), const RTM_RESOLVE ideal-int +pkg syscall (darwin-386-cgo), const RTM_RTTUNIT ideal-int +pkg syscall (darwin-386-cgo), const RTM_VERSION ideal-int +pkg syscall (darwin-386-cgo), const RTV_EXPIRE ideal-int +pkg syscall (darwin-386-cgo), const RTV_HOPCOUNT ideal-int +pkg syscall (darwin-386-cgo), const RTV_MTU ideal-int +pkg syscall (darwin-386-cgo), const RTV_RPIPE ideal-int +pkg syscall (darwin-386-cgo), const RTV_RTT ideal-int +pkg syscall (darwin-386-cgo), const RTV_RTTVAR ideal-int +pkg syscall (darwin-386-cgo), const RTV_SPIPE ideal-int +pkg syscall (darwin-386-cgo), const RTV_SSTHRESH ideal-int +pkg syscall (darwin-386-cgo), const RUSAGE_CHILDREN ideal-int +pkg syscall (darwin-386-cgo), const RUSAGE_SELF ideal-int +pkg syscall (darwin-386-cgo), const SCM_CREDS ideal-int +pkg syscall (darwin-386-cgo), const SCM_RIGHTS ideal-int +pkg syscall (darwin-386-cgo), const SCM_TIMESTAMP ideal-int +pkg syscall (darwin-386-cgo), const SCM_TIMESTAMP_MONOTONIC ideal-int +pkg syscall (darwin-386-cgo), const SIGCHLD Signal +pkg syscall (darwin-386-cgo), const SIGCONT Signal +pkg syscall (darwin-386-cgo), const SIGEMT Signal +pkg syscall (darwin-386-cgo), const SIGINFO Signal +pkg syscall (darwin-386-cgo), const SIGIO Signal +pkg syscall (darwin-386-cgo), const SIGIOT Signal +pkg syscall (darwin-386-cgo), const SIGPROF Signal +pkg syscall (darwin-386-cgo), const SIGSTOP Signal +pkg syscall (darwin-386-cgo), const SIGSYS Signal +pkg syscall (darwin-386-cgo), const SIGTSTP Signal +pkg syscall (darwin-386-cgo), const SIGTTIN Signal +pkg syscall (darwin-386-cgo), const SIGTTOU Signal +pkg syscall (darwin-386-cgo), const SIGURG Signal +pkg syscall (darwin-386-cgo), const SIGUSR1 Signal +pkg syscall (darwin-386-cgo), const SIGUSR2 Signal +pkg syscall (darwin-386-cgo), const SIGVTALRM Signal +pkg syscall (darwin-386-cgo), const SIGWINCH Signal +pkg syscall (darwin-386-cgo), const SIGXCPU Signal +pkg syscall (darwin-386-cgo), const SIGXFSZ Signal +pkg syscall (darwin-386-cgo), const SIOCADDMULTI ideal-int +pkg syscall (darwin-386-cgo), const SIOCAIFADDR ideal-int +pkg syscall (darwin-386-cgo), const SIOCALIFADDR ideal-int +pkg syscall (darwin-386-cgo), const SIOCARPIPLL ideal-int +pkg syscall (darwin-386-cgo), const SIOCATMARK ideal-int +pkg syscall (darwin-386-cgo), const SIOCAUTOADDR ideal-int +pkg syscall (darwin-386-cgo), const SIOCAUTONETMASK ideal-int +pkg syscall (darwin-386-cgo), const SIOCDELMULTI ideal-int +pkg syscall (darwin-386-cgo), const SIOCDIFADDR ideal-int +pkg syscall (darwin-386-cgo), const SIOCDIFPHYADDR ideal-int +pkg syscall (darwin-386-cgo), const SIOCDLIFADDR ideal-int +pkg syscall (darwin-386-cgo), const SIOCGDRVSPEC ideal-int +pkg syscall (darwin-386-cgo), const SIOCGETSGCNT ideal-int +pkg syscall (darwin-386-cgo), const SIOCGETVIFCNT ideal-int +pkg syscall (darwin-386-cgo), const SIOCGETVLAN ideal-int +pkg syscall (darwin-386-cgo), const SIOCGHIWAT ideal-int +pkg syscall (darwin-386-cgo), const SIOCGIFADDR ideal-int +pkg syscall (darwin-386-cgo), const SIOCGIFALTMTU ideal-int +pkg syscall (darwin-386-cgo), const SIOCGIFASYNCMAP ideal-int +pkg syscall (darwin-386-cgo), const SIOCGIFBOND ideal-int +pkg syscall (darwin-386-cgo), const SIOCGIFBRDADDR ideal-int +pkg syscall (darwin-386-cgo), const SIOCGIFCAP ideal-int +pkg syscall (darwin-386-cgo), const SIOCGIFCONF ideal-int +pkg syscall (darwin-386-cgo), const SIOCGIFDEVMTU ideal-int +pkg syscall (darwin-386-cgo), const SIOCGIFDSTADDR ideal-int +pkg syscall (darwin-386-cgo), const SIOCGIFFLAGS ideal-int +pkg syscall (darwin-386-cgo), const SIOCGIFGENERIC ideal-int +pkg syscall (darwin-386-cgo), const SIOCGIFKPI ideal-int +pkg syscall (darwin-386-cgo), const SIOCGIFMAC ideal-int +pkg syscall (darwin-386-cgo), const SIOCGIFMEDIA ideal-int +pkg syscall (darwin-386-cgo), const SIOCGIFMETRIC ideal-int +pkg syscall (darwin-386-cgo), const SIOCGIFMTU ideal-int +pkg syscall (darwin-386-cgo), const SIOCGIFNETMASK ideal-int +pkg syscall (darwin-386-cgo), const SIOCGIFPDSTADDR ideal-int +pkg syscall (darwin-386-cgo), const SIOCGIFPHYS ideal-int +pkg syscall (darwin-386-cgo), const SIOCGIFPSRCADDR ideal-int +pkg syscall (darwin-386-cgo), const SIOCGIFSTATUS ideal-int +pkg syscall (darwin-386-cgo), const SIOCGIFVLAN ideal-int +pkg syscall (darwin-386-cgo), const SIOCGIFWAKEFLAGS ideal-int +pkg syscall (darwin-386-cgo), const SIOCGLIFADDR ideal-int +pkg syscall (darwin-386-cgo), const SIOCGLIFPHYADDR ideal-int +pkg syscall (darwin-386-cgo), const SIOCGLOWAT ideal-int +pkg syscall (darwin-386-cgo), const SIOCGPGRP ideal-int +pkg syscall (darwin-386-cgo), const SIOCIFCREATE ideal-int +pkg syscall (darwin-386-cgo), const SIOCIFCREATE2 ideal-int +pkg syscall (darwin-386-cgo), const SIOCIFDESTROY ideal-int +pkg syscall (darwin-386-cgo), const SIOCRSLVMULTI ideal-int +pkg syscall (darwin-386-cgo), const SIOCSDRVSPEC ideal-int +pkg syscall (darwin-386-cgo), const SIOCSETVLAN ideal-int +pkg syscall (darwin-386-cgo), const SIOCSHIWAT ideal-int +pkg syscall (darwin-386-cgo), const SIOCSIFADDR ideal-int +pkg syscall (darwin-386-cgo), const SIOCSIFALTMTU ideal-int +pkg syscall (darwin-386-cgo), const SIOCSIFASYNCMAP ideal-int +pkg syscall (darwin-386-cgo), const SIOCSIFBOND ideal-int +pkg syscall (darwin-386-cgo), const SIOCSIFBRDADDR ideal-int +pkg syscall (darwin-386-cgo), const SIOCSIFCAP ideal-int +pkg syscall (darwin-386-cgo), const SIOCSIFDSTADDR ideal-int +pkg syscall (darwin-386-cgo), const SIOCSIFFLAGS ideal-int +pkg syscall (darwin-386-cgo), const SIOCSIFGENERIC ideal-int +pkg syscall (darwin-386-cgo), const SIOCSIFKPI ideal-int +pkg syscall (darwin-386-cgo), const SIOCSIFLLADDR ideal-int +pkg syscall (darwin-386-cgo), const SIOCSIFMAC ideal-int +pkg syscall (darwin-386-cgo), const SIOCSIFMEDIA ideal-int +pkg syscall (darwin-386-cgo), const SIOCSIFMETRIC ideal-int +pkg syscall (darwin-386-cgo), const SIOCSIFMTU ideal-int +pkg syscall (darwin-386-cgo), const SIOCSIFNETMASK ideal-int +pkg syscall (darwin-386-cgo), const SIOCSIFPHYADDR ideal-int +pkg syscall (darwin-386-cgo), const SIOCSIFPHYS ideal-int +pkg syscall (darwin-386-cgo), const SIOCSIFVLAN ideal-int +pkg syscall (darwin-386-cgo), const SIOCSLIFPHYADDR ideal-int +pkg syscall (darwin-386-cgo), const SIOCSLOWAT ideal-int +pkg syscall (darwin-386-cgo), const SIOCSPGRP ideal-int +pkg syscall (darwin-386-cgo), const SOCK_MAXADDRLEN ideal-int +pkg syscall (darwin-386-cgo), const SOCK_RDM ideal-int +pkg syscall (darwin-386-cgo), const SO_ACCEPTCONN ideal-int +pkg syscall (darwin-386-cgo), const SO_DEBUG ideal-int +pkg syscall (darwin-386-cgo), const SO_DONTTRUNC ideal-int +pkg syscall (darwin-386-cgo), const SO_ERROR ideal-int +pkg syscall (darwin-386-cgo), const SO_LABEL ideal-int +pkg syscall (darwin-386-cgo), const SO_LINGER_SEC ideal-int +pkg syscall (darwin-386-cgo), const SO_NKE ideal-int +pkg syscall (darwin-386-cgo), const SO_NOADDRERR ideal-int +pkg syscall (darwin-386-cgo), const SO_NOSIGPIPE ideal-int +pkg syscall (darwin-386-cgo), const SO_NOTIFYCONFLICT ideal-int +pkg syscall (darwin-386-cgo), const SO_NP_EXTENSIONS ideal-int +pkg syscall (darwin-386-cgo), const SO_NREAD ideal-int +pkg syscall (darwin-386-cgo), const SO_NWRITE ideal-int +pkg syscall (darwin-386-cgo), const SO_OOBINLINE ideal-int +pkg syscall (darwin-386-cgo), const SO_PEERLABEL ideal-int +pkg syscall (darwin-386-cgo), const SO_RANDOMPORT ideal-int +pkg syscall (darwin-386-cgo), const SO_RCVLOWAT ideal-int +pkg syscall (darwin-386-cgo), const SO_RCVTIMEO ideal-int +pkg syscall (darwin-386-cgo), const SO_RESTRICTIONS ideal-int +pkg syscall (darwin-386-cgo), const SO_RESTRICT_DENYIN ideal-int +pkg syscall (darwin-386-cgo), const SO_RESTRICT_DENYOUT ideal-int +pkg syscall (darwin-386-cgo), const SO_RESTRICT_DENYSET ideal-int +pkg syscall (darwin-386-cgo), const SO_REUSEPORT ideal-int +pkg syscall (darwin-386-cgo), const SO_REUSESHAREUID ideal-int +pkg syscall (darwin-386-cgo), const SO_SNDLOWAT ideal-int +pkg syscall (darwin-386-cgo), const SO_SNDTIMEO ideal-int +pkg syscall (darwin-386-cgo), const SO_TIMESTAMP ideal-int +pkg syscall (darwin-386-cgo), const SO_TIMESTAMP_MONOTONIC ideal-int +pkg syscall (darwin-386-cgo), const SO_TYPE ideal-int +pkg syscall (darwin-386-cgo), const SO_UPCALLCLOSEWAIT ideal-int +pkg syscall (darwin-386-cgo), const SO_USELOOPBACK ideal-int +pkg syscall (darwin-386-cgo), const SO_WANTMORE ideal-int +pkg syscall (darwin-386-cgo), const SO_WANTOOBFLAG ideal-int +pkg syscall (darwin-386-cgo), const SYS_ACCEPT ideal-int +pkg syscall (darwin-386-cgo), const SYS_ACCEPT_NOCANCEL ideal-int +pkg syscall (darwin-386-cgo), const SYS_ACCESS ideal-int +pkg syscall (darwin-386-cgo), const SYS_ACCESS_EXTENDED ideal-int +pkg syscall (darwin-386-cgo), const SYS_ACCT ideal-int +pkg syscall (darwin-386-cgo), const SYS_ADD_PROFIL ideal-int +pkg syscall (darwin-386-cgo), const SYS_ADJTIME ideal-int +pkg syscall (darwin-386-cgo), const SYS_AIO_CANCEL ideal-int +pkg syscall (darwin-386-cgo), const SYS_AIO_ERROR ideal-int +pkg syscall (darwin-386-cgo), const SYS_AIO_FSYNC ideal-int +pkg syscall (darwin-386-cgo), const SYS_AIO_READ ideal-int +pkg syscall (darwin-386-cgo), const SYS_AIO_RETURN ideal-int +pkg syscall (darwin-386-cgo), const SYS_AIO_SUSPEND ideal-int +pkg syscall (darwin-386-cgo), const SYS_AIO_SUSPEND_NOCANCEL ideal-int +pkg syscall (darwin-386-cgo), const SYS_AIO_WRITE ideal-int +pkg syscall (darwin-386-cgo), const SYS_ATGETMSG ideal-int +pkg syscall (darwin-386-cgo), const SYS_ATPGETREQ ideal-int +pkg syscall (darwin-386-cgo), const SYS_ATPGETRSP ideal-int +pkg syscall (darwin-386-cgo), const SYS_ATPSNDREQ ideal-int +pkg syscall (darwin-386-cgo), const SYS_ATPSNDRSP ideal-int +pkg syscall (darwin-386-cgo), const SYS_ATPUTMSG ideal-int +pkg syscall (darwin-386-cgo), const SYS_ATSOCKET ideal-int +pkg syscall (darwin-386-cgo), const SYS_AUDIT ideal-int +pkg syscall (darwin-386-cgo), const SYS_AUDITCTL ideal-int +pkg syscall (darwin-386-cgo), const SYS_AUDITON ideal-int +pkg syscall (darwin-386-cgo), const SYS_AUDIT_SESSION_JOIN ideal-int +pkg syscall (darwin-386-cgo), const SYS_AUDIT_SESSION_PORT ideal-int +pkg syscall (darwin-386-cgo), const SYS_AUDIT_SESSION_SELF ideal-int +pkg syscall (darwin-386-cgo), const SYS_BIND ideal-int +pkg syscall (darwin-386-cgo), const SYS_BSDTHREAD_CREATE ideal-int +pkg syscall (darwin-386-cgo), const SYS_BSDTHREAD_REGISTER ideal-int +pkg syscall (darwin-386-cgo), const SYS_BSDTHREAD_TERMINATE ideal-int +pkg syscall (darwin-386-cgo), const SYS_CHDIR ideal-int +pkg syscall (darwin-386-cgo), const SYS_CHFLAGS ideal-int +pkg syscall (darwin-386-cgo), const SYS_CHMOD ideal-int +pkg syscall (darwin-386-cgo), const SYS_CHMOD_EXTENDED ideal-int +pkg syscall (darwin-386-cgo), const SYS_CHOWN ideal-int +pkg syscall (darwin-386-cgo), const SYS_CHROOT ideal-int +pkg syscall (darwin-386-cgo), const SYS_CHUD ideal-int +pkg syscall (darwin-386-cgo), const SYS_CLOSE ideal-int +pkg syscall (darwin-386-cgo), const SYS_CLOSE_NOCANCEL ideal-int +pkg syscall (darwin-386-cgo), const SYS_CONNECT ideal-int +pkg syscall (darwin-386-cgo), const SYS_CONNECT_NOCANCEL ideal-int +pkg syscall (darwin-386-cgo), const SYS_COPYFILE ideal-int +pkg syscall (darwin-386-cgo), const SYS_CSOPS ideal-int +pkg syscall (darwin-386-cgo), const SYS_DELETE ideal-int +pkg syscall (darwin-386-cgo), const SYS_DUP ideal-int +pkg syscall (darwin-386-cgo), const SYS_DUP2 ideal-int +pkg syscall (darwin-386-cgo), const SYS_EXCHANGEDATA ideal-int +pkg syscall (darwin-386-cgo), const SYS_EXECVE ideal-int +pkg syscall (darwin-386-cgo), const SYS_EXIT ideal-int +pkg syscall (darwin-386-cgo), const SYS_FCHDIR ideal-int +pkg syscall (darwin-386-cgo), const SYS_FCHFLAGS ideal-int +pkg syscall (darwin-386-cgo), const SYS_FCHMOD ideal-int +pkg syscall (darwin-386-cgo), const SYS_FCHMOD_EXTENDED ideal-int +pkg syscall (darwin-386-cgo), const SYS_FCHOWN ideal-int +pkg syscall (darwin-386-cgo), const SYS_FCNTL ideal-int +pkg syscall (darwin-386-cgo), const SYS_FCNTL_NOCANCEL ideal-int +pkg syscall (darwin-386-cgo), const SYS_FDATASYNC ideal-int +pkg syscall (darwin-386-cgo), const SYS_FFSCTL ideal-int +pkg syscall (darwin-386-cgo), const SYS_FGETATTRLIST ideal-int +pkg syscall (darwin-386-cgo), const SYS_FGETXATTR ideal-int +pkg syscall (darwin-386-cgo), const SYS_FHOPEN ideal-int +pkg syscall (darwin-386-cgo), const SYS_FILEPORT_MAKEFD ideal-int +pkg syscall (darwin-386-cgo), const SYS_FILEPORT_MAKEPORT ideal-int +pkg syscall (darwin-386-cgo), const SYS_FLISTXATTR ideal-int +pkg syscall (darwin-386-cgo), const SYS_FLOCK ideal-int +pkg syscall (darwin-386-cgo), const SYS_FORK ideal-int +pkg syscall (darwin-386-cgo), const SYS_FPATHCONF ideal-int +pkg syscall (darwin-386-cgo), const SYS_FREMOVEXATTR ideal-int +pkg syscall (darwin-386-cgo), const SYS_FSCTL ideal-int +pkg syscall (darwin-386-cgo), const SYS_FSETATTRLIST ideal-int +pkg syscall (darwin-386-cgo), const SYS_FSETXATTR ideal-int +pkg syscall (darwin-386-cgo), const SYS_FSGETPATH ideal-int +pkg syscall (darwin-386-cgo), const SYS_FSTAT ideal-int +pkg syscall (darwin-386-cgo), const SYS_FSTAT64 ideal-int +pkg syscall (darwin-386-cgo), const SYS_FSTAT64_EXTENDED ideal-int +pkg syscall (darwin-386-cgo), const SYS_FSTATFS ideal-int +pkg syscall (darwin-386-cgo), const SYS_FSTATFS64 ideal-int +pkg syscall (darwin-386-cgo), const SYS_FSTATV ideal-int +pkg syscall (darwin-386-cgo), const SYS_FSTAT_EXTENDED ideal-int +pkg syscall (darwin-386-cgo), const SYS_FSYNC ideal-int +pkg syscall (darwin-386-cgo), const SYS_FSYNC_NOCANCEL ideal-int +pkg syscall (darwin-386-cgo), const SYS_FTRUNCATE ideal-int +pkg syscall (darwin-386-cgo), const SYS_FUTIMES ideal-int +pkg syscall (darwin-386-cgo), const SYS_GETATTRLIST ideal-int +pkg syscall (darwin-386-cgo), const SYS_GETAUDIT ideal-int +pkg syscall (darwin-386-cgo), const SYS_GETAUDIT_ADDR ideal-int +pkg syscall (darwin-386-cgo), const SYS_GETAUID ideal-int +pkg syscall (darwin-386-cgo), const SYS_GETDIRENTRIES ideal-int +pkg syscall (darwin-386-cgo), const SYS_GETDIRENTRIES64 ideal-int +pkg syscall (darwin-386-cgo), const SYS_GETDIRENTRIESATTR ideal-int +pkg syscall (darwin-386-cgo), const SYS_GETDTABLESIZE ideal-int +pkg syscall (darwin-386-cgo), const SYS_GETEGID ideal-int +pkg syscall (darwin-386-cgo), const SYS_GETEUID ideal-int +pkg syscall (darwin-386-cgo), const SYS_GETFH ideal-int +pkg syscall (darwin-386-cgo), const SYS_GETFSSTAT ideal-int +pkg syscall (darwin-386-cgo), const SYS_GETFSSTAT64 ideal-int +pkg syscall (darwin-386-cgo), const SYS_GETGID ideal-int +pkg syscall (darwin-386-cgo), const SYS_GETGROUPS ideal-int +pkg syscall (darwin-386-cgo), const SYS_GETHOSTUUID ideal-int +pkg syscall (darwin-386-cgo), const SYS_GETITIMER ideal-int +pkg syscall (darwin-386-cgo), const SYS_GETLCID ideal-int +pkg syscall (darwin-386-cgo), const SYS_GETLOGIN ideal-int +pkg syscall (darwin-386-cgo), const SYS_GETPEERNAME ideal-int +pkg syscall (darwin-386-cgo), const SYS_GETPGID ideal-int +pkg syscall (darwin-386-cgo), const SYS_GETPGRP ideal-int +pkg syscall (darwin-386-cgo), const SYS_GETPID ideal-int +pkg syscall (darwin-386-cgo), const SYS_GETPPID ideal-int +pkg syscall (darwin-386-cgo), const SYS_GETPRIORITY ideal-int +pkg syscall (darwin-386-cgo), const SYS_GETRLIMIT ideal-int +pkg syscall (darwin-386-cgo), const SYS_GETRUSAGE ideal-int +pkg syscall (darwin-386-cgo), const SYS_GETSGROUPS ideal-int +pkg syscall (darwin-386-cgo), const SYS_GETSID ideal-int +pkg syscall (darwin-386-cgo), const SYS_GETSOCKNAME ideal-int +pkg syscall (darwin-386-cgo), const SYS_GETSOCKOPT ideal-int +pkg syscall (darwin-386-cgo), const SYS_GETTID ideal-int +pkg syscall (darwin-386-cgo), const SYS_GETTIMEOFDAY ideal-int +pkg syscall (darwin-386-cgo), const SYS_GETUID ideal-int +pkg syscall (darwin-386-cgo), const SYS_GETWGROUPS ideal-int +pkg syscall (darwin-386-cgo), const SYS_GETXATTR ideal-int +pkg syscall (darwin-386-cgo), const SYS_IDENTITYSVC ideal-int +pkg syscall (darwin-386-cgo), const SYS_INITGROUPS ideal-int +pkg syscall (darwin-386-cgo), const SYS_IOCTL ideal-int +pkg syscall (darwin-386-cgo), const SYS_IOPOLICYSYS ideal-int +pkg syscall (darwin-386-cgo), const SYS_ISSETUGID ideal-int +pkg syscall (darwin-386-cgo), const SYS_KDEBUG_TRACE ideal-int +pkg syscall (darwin-386-cgo), const SYS_KEVENT ideal-int +pkg syscall (darwin-386-cgo), const SYS_KEVENT64 ideal-int +pkg syscall (darwin-386-cgo), const SYS_KILL ideal-int +pkg syscall (darwin-386-cgo), const SYS_KQUEUE ideal-int +pkg syscall (darwin-386-cgo), const SYS_LCHOWN ideal-int +pkg syscall (darwin-386-cgo), const SYS_LINK ideal-int +pkg syscall (darwin-386-cgo), const SYS_LIO_LISTIO ideal-int +pkg syscall (darwin-386-cgo), const SYS_LISTEN ideal-int +pkg syscall (darwin-386-cgo), const SYS_LISTXATTR ideal-int +pkg syscall (darwin-386-cgo), const SYS_LSEEK ideal-int +pkg syscall (darwin-386-cgo), const SYS_LSTAT ideal-int +pkg syscall (darwin-386-cgo), const SYS_LSTAT64 ideal-int +pkg syscall (darwin-386-cgo), const SYS_LSTAT64_EXTENDED ideal-int +pkg syscall (darwin-386-cgo), const SYS_LSTATV ideal-int +pkg syscall (darwin-386-cgo), const SYS_LSTAT_EXTENDED ideal-int +pkg syscall (darwin-386-cgo), const SYS_MADVISE ideal-int +pkg syscall (darwin-386-cgo), const SYS_MAXSYSCALL ideal-int +pkg syscall (darwin-386-cgo), const SYS_MINCORE ideal-int +pkg syscall (darwin-386-cgo), const SYS_MINHERIT ideal-int +pkg syscall (darwin-386-cgo), const SYS_MKCOMPLEX ideal-int +pkg syscall (darwin-386-cgo), const SYS_MKDIR ideal-int +pkg syscall (darwin-386-cgo), const SYS_MKDIR_EXTENDED ideal-int +pkg syscall (darwin-386-cgo), const SYS_MKFIFO ideal-int +pkg syscall (darwin-386-cgo), const SYS_MKFIFO_EXTENDED ideal-int +pkg syscall (darwin-386-cgo), const SYS_MKNOD ideal-int +pkg syscall (darwin-386-cgo), const SYS_MLOCK ideal-int +pkg syscall (darwin-386-cgo), const SYS_MLOCKALL ideal-int +pkg syscall (darwin-386-cgo), const SYS_MMAP ideal-int +pkg syscall (darwin-386-cgo), const SYS_MODWATCH ideal-int +pkg syscall (darwin-386-cgo), const SYS_MOUNT ideal-int +pkg syscall (darwin-386-cgo), const SYS_MPROTECT ideal-int +pkg syscall (darwin-386-cgo), const SYS_MSGCTL ideal-int +pkg syscall (darwin-386-cgo), const SYS_MSGGET ideal-int +pkg syscall (darwin-386-cgo), const SYS_MSGRCV ideal-int +pkg syscall (darwin-386-cgo), const SYS_MSGRCV_NOCANCEL ideal-int +pkg syscall (darwin-386-cgo), const SYS_MSGSND ideal-int +pkg syscall (darwin-386-cgo), const SYS_MSGSND_NOCANCEL ideal-int +pkg syscall (darwin-386-cgo), const SYS_MSGSYS ideal-int +pkg syscall (darwin-386-cgo), const SYS_MSYNC ideal-int +pkg syscall (darwin-386-cgo), const SYS_MSYNC_NOCANCEL ideal-int +pkg syscall (darwin-386-cgo), const SYS_MUNLOCK ideal-int +pkg syscall (darwin-386-cgo), const SYS_MUNLOCKALL ideal-int +pkg syscall (darwin-386-cgo), const SYS_MUNMAP ideal-int +pkg syscall (darwin-386-cgo), const SYS_NFSCLNT ideal-int +pkg syscall (darwin-386-cgo), const SYS_NFSSVC ideal-int +pkg syscall (darwin-386-cgo), const SYS_OPEN ideal-int +pkg syscall (darwin-386-cgo), const SYS_OPEN_EXTENDED ideal-int +pkg syscall (darwin-386-cgo), const SYS_OPEN_NOCANCEL ideal-int +pkg syscall (darwin-386-cgo), const SYS_PATHCONF ideal-int +pkg syscall (darwin-386-cgo), const SYS_PID_HIBERNATE ideal-int +pkg syscall (darwin-386-cgo), const SYS_PID_RESUME ideal-int +pkg syscall (darwin-386-cgo), const SYS_PID_SHUTDOWN_SOCKETS ideal-int +pkg syscall (darwin-386-cgo), const SYS_PID_SUSPEND ideal-int +pkg syscall (darwin-386-cgo), const SYS_PIPE ideal-int +pkg syscall (darwin-386-cgo), const SYS_POLL ideal-int +pkg syscall (darwin-386-cgo), const SYS_POLL_NOCANCEL ideal-int +pkg syscall (darwin-386-cgo), const SYS_POSIX_SPAWN ideal-int +pkg syscall (darwin-386-cgo), const SYS_PREAD ideal-int +pkg syscall (darwin-386-cgo), const SYS_PREAD_NOCANCEL ideal-int +pkg syscall (darwin-386-cgo), const SYS_PROCESS_POLICY ideal-int +pkg syscall (darwin-386-cgo), const SYS_PROC_INFO ideal-int +pkg syscall (darwin-386-cgo), const SYS_PROFIL ideal-int +pkg syscall (darwin-386-cgo), const SYS_PSYNCH_CVBROAD ideal-int +pkg syscall (darwin-386-cgo), const SYS_PSYNCH_CVCLRPREPOST ideal-int +pkg syscall (darwin-386-cgo), const SYS_PSYNCH_CVSIGNAL ideal-int +pkg syscall (darwin-386-cgo), const SYS_PSYNCH_CVWAIT ideal-int +pkg syscall (darwin-386-cgo), const SYS_PSYNCH_MUTEXDROP ideal-int +pkg syscall (darwin-386-cgo), const SYS_PSYNCH_MUTEXWAIT ideal-int +pkg syscall (darwin-386-cgo), const SYS_PSYNCH_RW_DOWNGRADE ideal-int +pkg syscall (darwin-386-cgo), const SYS_PSYNCH_RW_LONGRDLOCK ideal-int +pkg syscall (darwin-386-cgo), const SYS_PSYNCH_RW_RDLOCK ideal-int +pkg syscall (darwin-386-cgo), const SYS_PSYNCH_RW_UNLOCK ideal-int +pkg syscall (darwin-386-cgo), const SYS_PSYNCH_RW_UNLOCK2 ideal-int +pkg syscall (darwin-386-cgo), const SYS_PSYNCH_RW_UPGRADE ideal-int +pkg syscall (darwin-386-cgo), const SYS_PSYNCH_RW_WRLOCK ideal-int +pkg syscall (darwin-386-cgo), const SYS_PSYNCH_RW_YIELDWRLOCK ideal-int +pkg syscall (darwin-386-cgo), const SYS_PTRACE ideal-int +pkg syscall (darwin-386-cgo), const SYS_PWRITE ideal-int +pkg syscall (darwin-386-cgo), const SYS_PWRITE_NOCANCEL ideal-int +pkg syscall (darwin-386-cgo), const SYS_QUOTACTL ideal-int +pkg syscall (darwin-386-cgo), const SYS_READ ideal-int +pkg syscall (darwin-386-cgo), const SYS_READLINK ideal-int +pkg syscall (darwin-386-cgo), const SYS_READV ideal-int +pkg syscall (darwin-386-cgo), const SYS_READV_NOCANCEL ideal-int +pkg syscall (darwin-386-cgo), const SYS_READ_NOCANCEL ideal-int +pkg syscall (darwin-386-cgo), const SYS_REBOOT ideal-int +pkg syscall (darwin-386-cgo), const SYS_RECVFROM ideal-int +pkg syscall (darwin-386-cgo), const SYS_RECVFROM_NOCANCEL ideal-int +pkg syscall (darwin-386-cgo), const SYS_RECVMSG ideal-int +pkg syscall (darwin-386-cgo), const SYS_RECVMSG_NOCANCEL ideal-int +pkg syscall (darwin-386-cgo), const SYS_REMOVEXATTR ideal-int +pkg syscall (darwin-386-cgo), const SYS_RENAME ideal-int +pkg syscall (darwin-386-cgo), const SYS_REVOKE ideal-int +pkg syscall (darwin-386-cgo), const SYS_RMDIR ideal-int +pkg syscall (darwin-386-cgo), const SYS_SEARCHFS ideal-int +pkg syscall (darwin-386-cgo), const SYS_SELECT ideal-int +pkg syscall (darwin-386-cgo), const SYS_SELECT_NOCANCEL ideal-int +pkg syscall (darwin-386-cgo), const SYS_SEMCTL ideal-int +pkg syscall (darwin-386-cgo), const SYS_SEMGET ideal-int +pkg syscall (darwin-386-cgo), const SYS_SEMOP ideal-int +pkg syscall (darwin-386-cgo), const SYS_SEMSYS ideal-int +pkg syscall (darwin-386-cgo), const SYS_SEM_CLOSE ideal-int +pkg syscall (darwin-386-cgo), const SYS_SEM_DESTROY ideal-int +pkg syscall (darwin-386-cgo), const SYS_SEM_GETVALUE ideal-int +pkg syscall (darwin-386-cgo), const SYS_SEM_INIT ideal-int +pkg syscall (darwin-386-cgo), const SYS_SEM_OPEN ideal-int +pkg syscall (darwin-386-cgo), const SYS_SEM_POST ideal-int +pkg syscall (darwin-386-cgo), const SYS_SEM_TRYWAIT ideal-int +pkg syscall (darwin-386-cgo), const SYS_SEM_UNLINK ideal-int +pkg syscall (darwin-386-cgo), const SYS_SEM_WAIT ideal-int +pkg syscall (darwin-386-cgo), const SYS_SEM_WAIT_NOCANCEL ideal-int +pkg syscall (darwin-386-cgo), const SYS_SENDFILE ideal-int +pkg syscall (darwin-386-cgo), const SYS_SENDMSG ideal-int +pkg syscall (darwin-386-cgo), const SYS_SENDMSG_NOCANCEL ideal-int +pkg syscall (darwin-386-cgo), const SYS_SENDTO ideal-int +pkg syscall (darwin-386-cgo), const SYS_SENDTO_NOCANCEL ideal-int +pkg syscall (darwin-386-cgo), const SYS_SETATTRLIST ideal-int +pkg syscall (darwin-386-cgo), const SYS_SETAUDIT ideal-int +pkg syscall (darwin-386-cgo), const SYS_SETAUDIT_ADDR ideal-int +pkg syscall (darwin-386-cgo), const SYS_SETAUID ideal-int +pkg syscall (darwin-386-cgo), const SYS_SETEGID ideal-int +pkg syscall (darwin-386-cgo), const SYS_SETEUID ideal-int +pkg syscall (darwin-386-cgo), const SYS_SETGID ideal-int +pkg syscall (darwin-386-cgo), const SYS_SETGROUPS ideal-int +pkg syscall (darwin-386-cgo), const SYS_SETITIMER ideal-int +pkg syscall (darwin-386-cgo), const SYS_SETLCID ideal-int +pkg syscall (darwin-386-cgo), const SYS_SETLOGIN ideal-int +pkg syscall (darwin-386-cgo), const SYS_SETPGID ideal-int +pkg syscall (darwin-386-cgo), const SYS_SETPRIORITY ideal-int +pkg syscall (darwin-386-cgo), const SYS_SETPRIVEXEC ideal-int +pkg syscall (darwin-386-cgo), const SYS_SETREGID ideal-int +pkg syscall (darwin-386-cgo), const SYS_SETREUID ideal-int +pkg syscall (darwin-386-cgo), const SYS_SETRLIMIT ideal-int +pkg syscall (darwin-386-cgo), const SYS_SETSGROUPS ideal-int +pkg syscall (darwin-386-cgo), const SYS_SETSID ideal-int +pkg syscall (darwin-386-cgo), const SYS_SETSOCKOPT ideal-int +pkg syscall (darwin-386-cgo), const SYS_SETTID ideal-int +pkg syscall (darwin-386-cgo), const SYS_SETTID_WITH_PID ideal-int +pkg syscall (darwin-386-cgo), const SYS_SETTIMEOFDAY ideal-int +pkg syscall (darwin-386-cgo), const SYS_SETUID ideal-int +pkg syscall (darwin-386-cgo), const SYS_SETWGROUPS ideal-int +pkg syscall (darwin-386-cgo), const SYS_SETXATTR ideal-int +pkg syscall (darwin-386-cgo), const SYS_SHARED_REGION_CHECK_NP ideal-int +pkg syscall (darwin-386-cgo), const SYS_SHARED_REGION_MAP_AND_SLIDE_NP ideal-int +pkg syscall (darwin-386-cgo), const SYS_SHMAT ideal-int +pkg syscall (darwin-386-cgo), const SYS_SHMCTL ideal-int +pkg syscall (darwin-386-cgo), const SYS_SHMDT ideal-int +pkg syscall (darwin-386-cgo), const SYS_SHMGET ideal-int +pkg syscall (darwin-386-cgo), const SYS_SHMSYS ideal-int +pkg syscall (darwin-386-cgo), const SYS_SHM_OPEN ideal-int +pkg syscall (darwin-386-cgo), const SYS_SHM_UNLINK ideal-int +pkg syscall (darwin-386-cgo), const SYS_SHUTDOWN ideal-int +pkg syscall (darwin-386-cgo), const SYS_SIGACTION ideal-int +pkg syscall (darwin-386-cgo), const SYS_SIGALTSTACK ideal-int +pkg syscall (darwin-386-cgo), const SYS_SIGPENDING ideal-int +pkg syscall (darwin-386-cgo), const SYS_SIGPROCMASK ideal-int +pkg syscall (darwin-386-cgo), const SYS_SIGRETURN ideal-int +pkg syscall (darwin-386-cgo), const SYS_SIGSUSPEND ideal-int +pkg syscall (darwin-386-cgo), const SYS_SIGSUSPEND_NOCANCEL ideal-int +pkg syscall (darwin-386-cgo), const SYS_SOCKET ideal-int +pkg syscall (darwin-386-cgo), const SYS_SOCKETPAIR ideal-int +pkg syscall (darwin-386-cgo), const SYS_STACK_SNAPSHOT ideal-int +pkg syscall (darwin-386-cgo), const SYS_STAT ideal-int +pkg syscall (darwin-386-cgo), const SYS_STAT64 ideal-int +pkg syscall (darwin-386-cgo), const SYS_STAT64_EXTENDED ideal-int +pkg syscall (darwin-386-cgo), const SYS_STATFS ideal-int +pkg syscall (darwin-386-cgo), const SYS_STATFS64 ideal-int +pkg syscall (darwin-386-cgo), const SYS_STATV ideal-int +pkg syscall (darwin-386-cgo), const SYS_STAT_EXTENDED ideal-int +pkg syscall (darwin-386-cgo), const SYS_SWAPON ideal-int +pkg syscall (darwin-386-cgo), const SYS_SYMLINK ideal-int +pkg syscall (darwin-386-cgo), const SYS_SYNC ideal-int +pkg syscall (darwin-386-cgo), const SYS_SYSCALL ideal-int +pkg syscall (darwin-386-cgo), const SYS_THREAD_SELFID ideal-int +pkg syscall (darwin-386-cgo), const SYS_TRUNCATE ideal-int +pkg syscall (darwin-386-cgo), const SYS_UMASK ideal-int +pkg syscall (darwin-386-cgo), const SYS_UMASK_EXTENDED ideal-int +pkg syscall (darwin-386-cgo), const SYS_UNDELETE ideal-int +pkg syscall (darwin-386-cgo), const SYS_UNLINK ideal-int +pkg syscall (darwin-386-cgo), const SYS_UNMOUNT ideal-int +pkg syscall (darwin-386-cgo), const SYS_UTIMES ideal-int +pkg syscall (darwin-386-cgo), const SYS_VFORK ideal-int +pkg syscall (darwin-386-cgo), const SYS_VM_PRESSURE_MONITOR ideal-int +pkg syscall (darwin-386-cgo), const SYS_WAIT4 ideal-int +pkg syscall (darwin-386-cgo), const SYS_WAIT4_NOCANCEL ideal-int +pkg syscall (darwin-386-cgo), const SYS_WAITEVENT ideal-int +pkg syscall (darwin-386-cgo), const SYS_WAITID ideal-int +pkg syscall (darwin-386-cgo), const SYS_WAITID_NOCANCEL ideal-int +pkg syscall (darwin-386-cgo), const SYS_WATCHEVENT ideal-int +pkg syscall (darwin-386-cgo), const SYS_WORKQ_KERNRETURN ideal-int +pkg syscall (darwin-386-cgo), const SYS_WORKQ_OPEN ideal-int +pkg syscall (darwin-386-cgo), const SYS_WRITE ideal-int +pkg syscall (darwin-386-cgo), const SYS_WRITEV ideal-int +pkg syscall (darwin-386-cgo), const SYS_WRITEV_NOCANCEL ideal-int +pkg syscall (darwin-386-cgo), const SYS_WRITE_NOCANCEL ideal-int +pkg syscall (darwin-386-cgo), const SYS___DISABLE_THREADSIGNAL ideal-int +pkg syscall (darwin-386-cgo), const SYS___MAC_EXECVE ideal-int +pkg syscall (darwin-386-cgo), const SYS___MAC_GETFSSTAT ideal-int +pkg syscall (darwin-386-cgo), const SYS___MAC_GET_FD ideal-int +pkg syscall (darwin-386-cgo), const SYS___MAC_GET_FILE ideal-int +pkg syscall (darwin-386-cgo), const SYS___MAC_GET_LCID ideal-int +pkg syscall (darwin-386-cgo), const SYS___MAC_GET_LCTX ideal-int +pkg syscall (darwin-386-cgo), const SYS___MAC_GET_LINK ideal-int +pkg syscall (darwin-386-cgo), const SYS___MAC_GET_MOUNT ideal-int +pkg syscall (darwin-386-cgo), const SYS___MAC_GET_PID ideal-int +pkg syscall (darwin-386-cgo), const SYS___MAC_GET_PROC ideal-int +pkg syscall (darwin-386-cgo), const SYS___MAC_MOUNT ideal-int +pkg syscall (darwin-386-cgo), const SYS___MAC_SET_FD ideal-int +pkg syscall (darwin-386-cgo), const SYS___MAC_SET_FILE ideal-int +pkg syscall (darwin-386-cgo), const SYS___MAC_SET_LCTX ideal-int +pkg syscall (darwin-386-cgo), const SYS___MAC_SET_LINK ideal-int +pkg syscall (darwin-386-cgo), const SYS___MAC_SET_PROC ideal-int +pkg syscall (darwin-386-cgo), const SYS___MAC_SYSCALL ideal-int +pkg syscall (darwin-386-cgo), const SYS___OLD_SEMWAIT_SIGNAL ideal-int +pkg syscall (darwin-386-cgo), const SYS___OLD_SEMWAIT_SIGNAL_NOCANCEL ideal-int +pkg syscall (darwin-386-cgo), const SYS___PTHREAD_CANCELED ideal-int +pkg syscall (darwin-386-cgo), const SYS___PTHREAD_CHDIR ideal-int +pkg syscall (darwin-386-cgo), const SYS___PTHREAD_FCHDIR ideal-int +pkg syscall (darwin-386-cgo), const SYS___PTHREAD_KILL ideal-int +pkg syscall (darwin-386-cgo), const SYS___PTHREAD_MARKCANCEL ideal-int +pkg syscall (darwin-386-cgo), const SYS___PTHREAD_SIGMASK ideal-int +pkg syscall (darwin-386-cgo), const SYS___SEMWAIT_SIGNAL ideal-int +pkg syscall (darwin-386-cgo), const SYS___SEMWAIT_SIGNAL_NOCANCEL ideal-int +pkg syscall (darwin-386-cgo), const SYS___SIGWAIT ideal-int +pkg syscall (darwin-386-cgo), const SYS___SIGWAIT_NOCANCEL ideal-int +pkg syscall (darwin-386-cgo), const SYS___SYSCTL ideal-int +pkg syscall (darwin-386-cgo), const S_IEXEC ideal-int +pkg syscall (darwin-386-cgo), const S_IFWHT ideal-int +pkg syscall (darwin-386-cgo), const S_IREAD ideal-int +pkg syscall (darwin-386-cgo), const S_IRGRP ideal-int +pkg syscall (darwin-386-cgo), const S_IROTH ideal-int +pkg syscall (darwin-386-cgo), const S_IRWXG ideal-int +pkg syscall (darwin-386-cgo), const S_IRWXO ideal-int +pkg syscall (darwin-386-cgo), const S_IRWXU ideal-int +pkg syscall (darwin-386-cgo), const S_ISTXT ideal-int +pkg syscall (darwin-386-cgo), const S_IWGRP ideal-int +pkg syscall (darwin-386-cgo), const S_IWOTH ideal-int +pkg syscall (darwin-386-cgo), const S_IWRITE ideal-int +pkg syscall (darwin-386-cgo), const S_IXGRP ideal-int +pkg syscall (darwin-386-cgo), const S_IXOTH ideal-int +pkg syscall (darwin-386-cgo), const SizeofBpfHdr ideal-int +pkg syscall (darwin-386-cgo), const SizeofBpfInsn ideal-int +pkg syscall (darwin-386-cgo), const SizeofBpfProgram ideal-int +pkg syscall (darwin-386-cgo), const SizeofBpfStat ideal-int +pkg syscall (darwin-386-cgo), const SizeofBpfVersion ideal-int +pkg syscall (darwin-386-cgo), const SizeofCmsghdr ideal-int +pkg syscall (darwin-386-cgo), const SizeofIPMreq ideal-int +pkg syscall (darwin-386-cgo), const SizeofIPv6Mreq ideal-int +pkg syscall (darwin-386-cgo), const SizeofIfData ideal-int +pkg syscall (darwin-386-cgo), const SizeofIfMsghdr ideal-int +pkg syscall (darwin-386-cgo), const SizeofIfaMsghdr ideal-int +pkg syscall (darwin-386-cgo), const SizeofIfmaMsghdr ideal-int +pkg syscall (darwin-386-cgo), const SizeofIfmaMsghdr2 ideal-int +pkg syscall (darwin-386-cgo), const SizeofInet6Pktinfo ideal-int +pkg syscall (darwin-386-cgo), const SizeofLinger ideal-int +pkg syscall (darwin-386-cgo), const SizeofMsghdr ideal-int +pkg syscall (darwin-386-cgo), const SizeofRtMetrics ideal-int +pkg syscall (darwin-386-cgo), const SizeofRtMsghdr ideal-int +pkg syscall (darwin-386-cgo), const SizeofSockaddrAny ideal-int +pkg syscall (darwin-386-cgo), const SizeofSockaddrDatalink ideal-int +pkg syscall (darwin-386-cgo), const SizeofSockaddrInet4 ideal-int +pkg syscall (darwin-386-cgo), const SizeofSockaddrInet6 ideal-int +pkg syscall (darwin-386-cgo), const SizeofSockaddrUnix ideal-int +pkg syscall (darwin-386-cgo), const TCP_CONNECTIONTIMEOUT ideal-int +pkg syscall (darwin-386-cgo), const TCP_KEEPALIVE ideal-int +pkg syscall (darwin-386-cgo), const TCP_MAXHLEN ideal-int +pkg syscall (darwin-386-cgo), const TCP_MAXOLEN ideal-int +pkg syscall (darwin-386-cgo), const TCP_MAXSEG ideal-int +pkg syscall (darwin-386-cgo), const TCP_MAXWIN ideal-int +pkg syscall (darwin-386-cgo), const TCP_MAX_SACK ideal-int +pkg syscall (darwin-386-cgo), const TCP_MAX_WINSHIFT ideal-int +pkg syscall (darwin-386-cgo), const TCP_MINMSS ideal-int +pkg syscall (darwin-386-cgo), const TCP_MINMSSOVERLOAD ideal-int +pkg syscall (darwin-386-cgo), const TCP_MSS ideal-int +pkg syscall (darwin-386-cgo), const TCP_NOOPT ideal-int +pkg syscall (darwin-386-cgo), const TCP_NOPUSH ideal-int +pkg syscall (darwin-386-cgo), const TCP_RXT_CONNDROPTIME ideal-int +pkg syscall (darwin-386-cgo), const TCP_RXT_FINDROP ideal-int +pkg syscall (darwin-386-cgo), const TIOCCBRK ideal-int +pkg syscall (darwin-386-cgo), const TIOCCDTR ideal-int +pkg syscall (darwin-386-cgo), const TIOCCONS ideal-int +pkg syscall (darwin-386-cgo), const TIOCDCDTIMESTAMP ideal-int +pkg syscall (darwin-386-cgo), const TIOCDRAIN ideal-int +pkg syscall (darwin-386-cgo), const TIOCDSIMICROCODE ideal-int +pkg syscall (darwin-386-cgo), const TIOCEXCL ideal-int +pkg syscall (darwin-386-cgo), const TIOCEXT ideal-int +pkg syscall (darwin-386-cgo), const TIOCFLUSH ideal-int +pkg syscall (darwin-386-cgo), const TIOCGDRAINWAIT ideal-int +pkg syscall (darwin-386-cgo), const TIOCGETA ideal-int +pkg syscall (darwin-386-cgo), const TIOCGETD ideal-int +pkg syscall (darwin-386-cgo), const TIOCGPGRP ideal-int +pkg syscall (darwin-386-cgo), const TIOCGWINSZ ideal-int +pkg syscall (darwin-386-cgo), const TIOCIXOFF ideal-int +pkg syscall (darwin-386-cgo), const TIOCIXON ideal-int +pkg syscall (darwin-386-cgo), const TIOCMBIC ideal-int +pkg syscall (darwin-386-cgo), const TIOCMBIS ideal-int +pkg syscall (darwin-386-cgo), const TIOCMGDTRWAIT ideal-int +pkg syscall (darwin-386-cgo), const TIOCMGET ideal-int +pkg syscall (darwin-386-cgo), const TIOCMODG ideal-int +pkg syscall (darwin-386-cgo), const TIOCMODS ideal-int +pkg syscall (darwin-386-cgo), const TIOCMSDTRWAIT ideal-int +pkg syscall (darwin-386-cgo), const TIOCMSET ideal-int +pkg syscall (darwin-386-cgo), const TIOCM_CAR ideal-int +pkg syscall (darwin-386-cgo), const TIOCM_CD ideal-int +pkg syscall (darwin-386-cgo), const TIOCM_CTS ideal-int +pkg syscall (darwin-386-cgo), const TIOCM_DSR ideal-int +pkg syscall (darwin-386-cgo), const TIOCM_DTR ideal-int +pkg syscall (darwin-386-cgo), const TIOCM_LE ideal-int +pkg syscall (darwin-386-cgo), const TIOCM_RI ideal-int +pkg syscall (darwin-386-cgo), const TIOCM_RNG ideal-int +pkg syscall (darwin-386-cgo), const TIOCM_RTS ideal-int +pkg syscall (darwin-386-cgo), const TIOCM_SR ideal-int +pkg syscall (darwin-386-cgo), const TIOCM_ST ideal-int +pkg syscall (darwin-386-cgo), const TIOCNOTTY ideal-int +pkg syscall (darwin-386-cgo), const TIOCNXCL ideal-int +pkg syscall (darwin-386-cgo), const TIOCOUTQ ideal-int +pkg syscall (darwin-386-cgo), const TIOCPKT ideal-int +pkg syscall (darwin-386-cgo), const TIOCPKT_DATA ideal-int +pkg syscall (darwin-386-cgo), const TIOCPKT_DOSTOP ideal-int +pkg syscall (darwin-386-cgo), const TIOCPKT_FLUSHREAD ideal-int +pkg syscall (darwin-386-cgo), const TIOCPKT_FLUSHWRITE ideal-int +pkg syscall (darwin-386-cgo), const TIOCPKT_IOCTL ideal-int +pkg syscall (darwin-386-cgo), const TIOCPKT_NOSTOP ideal-int +pkg syscall (darwin-386-cgo), const TIOCPKT_START ideal-int +pkg syscall (darwin-386-cgo), const TIOCPKT_STOP ideal-int +pkg syscall (darwin-386-cgo), const TIOCPTYGNAME ideal-int +pkg syscall (darwin-386-cgo), const TIOCPTYGRANT ideal-int +pkg syscall (darwin-386-cgo), const TIOCPTYUNLK ideal-int +pkg syscall (darwin-386-cgo), const TIOCREMOTE ideal-int +pkg syscall (darwin-386-cgo), const TIOCSBRK ideal-int +pkg syscall (darwin-386-cgo), const TIOCSCONS ideal-int +pkg syscall (darwin-386-cgo), const TIOCSCTTY ideal-int +pkg syscall (darwin-386-cgo), const TIOCSDRAINWAIT ideal-int +pkg syscall (darwin-386-cgo), const TIOCSDTR ideal-int +pkg syscall (darwin-386-cgo), const TIOCSETA ideal-int +pkg syscall (darwin-386-cgo), const TIOCSETAF ideal-int +pkg syscall (darwin-386-cgo), const TIOCSETAW ideal-int +pkg syscall (darwin-386-cgo), const TIOCSETD ideal-int +pkg syscall (darwin-386-cgo), const TIOCSIG ideal-int +pkg syscall (darwin-386-cgo), const TIOCSPGRP ideal-int +pkg syscall (darwin-386-cgo), const TIOCSTART ideal-int +pkg syscall (darwin-386-cgo), const TIOCSTAT ideal-int +pkg syscall (darwin-386-cgo), const TIOCSTI ideal-int +pkg syscall (darwin-386-cgo), const TIOCSTOP ideal-int +pkg syscall (darwin-386-cgo), const TIOCSWINSZ ideal-int +pkg syscall (darwin-386-cgo), const TIOCTIMESTAMP ideal-int +pkg syscall (darwin-386-cgo), const TIOCUCNTL ideal-int +pkg syscall (darwin-386-cgo), const WCONTINUED ideal-int +pkg syscall (darwin-386-cgo), const WCOREFLAG ideal-int +pkg syscall (darwin-386-cgo), const WEXITED ideal-int +pkg syscall (darwin-386-cgo), const WNOHANG ideal-int +pkg syscall (darwin-386-cgo), const WNOWAIT ideal-int +pkg syscall (darwin-386-cgo), const WORDSIZE ideal-int +pkg syscall (darwin-386-cgo), const WSTOPPED ideal-int +pkg syscall (darwin-386-cgo), const WUNTRACED ideal-int +pkg syscall (darwin-386-cgo), func Accept(int) (int, Sockaddr, error) +pkg syscall (darwin-386-cgo), func Access(string, uint32) error +pkg syscall (darwin-386-cgo), func Adjtime(*Timeval, *Timeval) error +pkg syscall (darwin-386-cgo), func Bind(int, Sockaddr) error +pkg syscall (darwin-386-cgo), func BpfBuflen(int) (int, error) +pkg syscall (darwin-386-cgo), func BpfDatalink(int) (int, error) +pkg syscall (darwin-386-cgo), func BpfHeadercmpl(int) (int, error) +pkg syscall (darwin-386-cgo), func BpfInterface(int, string) (string, error) +pkg syscall (darwin-386-cgo), func BpfJump(int, int, int, int) *BpfInsn +pkg syscall (darwin-386-cgo), func BpfStats(int) (*BpfStat, error) +pkg syscall (darwin-386-cgo), func BpfStmt(int, int) *BpfInsn +pkg syscall (darwin-386-cgo), func BpfTimeout(int) (*Timeval, error) +pkg syscall (darwin-386-cgo), func CheckBpfVersion(int) error +pkg syscall (darwin-386-cgo), func Chflags(string, int) error +pkg syscall (darwin-386-cgo), func Chroot(string) error +pkg syscall (darwin-386-cgo), func Close(int) error +pkg syscall (darwin-386-cgo), func CloseOnExec(int) +pkg syscall (darwin-386-cgo), func CmsgLen(int) int +pkg syscall (darwin-386-cgo), func CmsgSpace(int) int +pkg syscall (darwin-386-cgo), func Connect(int, Sockaddr) error +pkg syscall (darwin-386-cgo), func Dup(int) (int, error) +pkg syscall (darwin-386-cgo), func Dup2(int, int) error +pkg syscall (darwin-386-cgo), func Exchangedata(string, string, int) error +pkg syscall (darwin-386-cgo), func Fchdir(int) error +pkg syscall (darwin-386-cgo), func Fchflags(string, int) error +pkg syscall (darwin-386-cgo), func Fchmod(int, uint32) error +pkg syscall (darwin-386-cgo), func Fchown(int, int, int) error +pkg syscall (darwin-386-cgo), func Flock(int, int) error +pkg syscall (darwin-386-cgo), func FlushBpf(int) error +pkg syscall (darwin-386-cgo), func ForkExec(string, []string, *ProcAttr) (int, error) +pkg syscall (darwin-386-cgo), func Fpathconf(int, int) (int, error) +pkg syscall (darwin-386-cgo), func Fstat(int, *Stat_t) error +pkg syscall (darwin-386-cgo), func Fstatfs(int, *Statfs_t) error +pkg syscall (darwin-386-cgo), func Fsync(int) error +pkg syscall (darwin-386-cgo), func Ftruncate(int, int64) error +pkg syscall (darwin-386-cgo), func Futimes(int, []Timeval) error +pkg syscall (darwin-386-cgo), func Getdirentries(int, []uint8, *uintptr) (int, error) +pkg syscall (darwin-386-cgo), func Getdtablesize() int +pkg syscall (darwin-386-cgo), func Getfsstat([]Statfs_t, int) (int, error) +pkg syscall (darwin-386-cgo), func Getpeername(int) (Sockaddr, error) +pkg syscall (darwin-386-cgo), func Getpgid(int) (int, error) +pkg syscall (darwin-386-cgo), func Getpgrp() int +pkg syscall (darwin-386-cgo), func Getpriority(int, int) (int, error) +pkg syscall (darwin-386-cgo), func Getrlimit(int, *Rlimit) error +pkg syscall (darwin-386-cgo), func Getrusage(int, *Rusage) error +pkg syscall (darwin-386-cgo), func Getsid(int) (int, error) +pkg syscall (darwin-386-cgo), func Getsockname(int) (Sockaddr, error) +pkg syscall (darwin-386-cgo), func GetsockoptByte(int, int, int) (uint8, error) +pkg syscall (darwin-386-cgo), func GetsockoptIPMreq(int, int, int) (*IPMreq, error) +pkg syscall (darwin-386-cgo), func GetsockoptIPv6Mreq(int, int, int) (*IPv6Mreq, error) +pkg syscall (darwin-386-cgo), func GetsockoptInet4Addr(int, int, int) ([4]uint8, error) +pkg syscall (darwin-386-cgo), func GetsockoptInt(int, int, int) (int, error) +pkg syscall (darwin-386-cgo), func Issetugid() bool +pkg syscall (darwin-386-cgo), func Kevent(int, []Kevent_t, []Kevent_t, *Timespec) (int, error) +pkg syscall (darwin-386-cgo), func Kill(int, Signal) error +pkg syscall (darwin-386-cgo), func Kqueue() (int, error) +pkg syscall (darwin-386-cgo), func Listen(int, int) error +pkg syscall (darwin-386-cgo), func Lstat(string, *Stat_t) error +pkg syscall (darwin-386-cgo), func Mkfifo(string, uint32) error +pkg syscall (darwin-386-cgo), func Mknod(string, uint32, int) error +pkg syscall (darwin-386-cgo), func Mmap(int, int64, int, int, int) ([]uint8, error) +pkg syscall (darwin-386-cgo), func Munmap([]uint8) error +pkg syscall (darwin-386-cgo), func NsecToTimespec(int64) Timespec +pkg syscall (darwin-386-cgo), func Open(string, int, uint32) (int, error) +pkg syscall (darwin-386-cgo), func ParseDirent([]uint8, int, []string) (int, int, []string) +pkg syscall (darwin-386-cgo), func ParseRoutingMessage([]uint8) ([]RoutingMessage, error) +pkg syscall (darwin-386-cgo), func ParseRoutingSockaddr(RoutingMessage) ([]Sockaddr, error) +pkg syscall (darwin-386-cgo), func ParseSocketControlMessage([]uint8) ([]SocketControlMessage, error) +pkg syscall (darwin-386-cgo), func ParseUnixRights(*SocketControlMessage) ([]int, error) +pkg syscall (darwin-386-cgo), func Pathconf(string, int) (int, error) +pkg syscall (darwin-386-cgo), func Pipe([]int) error +pkg syscall (darwin-386-cgo), func Pread(int, []uint8, int64) (int, error) +pkg syscall (darwin-386-cgo), func PtraceAttach(int) error +pkg syscall (darwin-386-cgo), func PtraceDetach(int) error +pkg syscall (darwin-386-cgo), func Pwrite(int, []uint8, int64) (int, error) +pkg syscall (darwin-386-cgo), func RawSyscall(uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno) +pkg syscall (darwin-386-cgo), func RawSyscall6(uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno) +pkg syscall (darwin-386-cgo), func Read(int, []uint8) (int, error) +pkg syscall (darwin-386-cgo), func ReadDirent(int, []uint8) (int, error) +pkg syscall (darwin-386-cgo), func Recvfrom(int, []uint8, int) (int, Sockaddr, error) +pkg syscall (darwin-386-cgo), func Recvmsg(int, []uint8, []uint8, int) (int, int, int, Sockaddr, error) +pkg syscall (darwin-386-cgo), func Revoke(string) error +pkg syscall (darwin-386-cgo), func RouteRIB(int, int) ([]uint8, error) +pkg syscall (darwin-386-cgo), func Seek(int, int64, int) (int64, error) +pkg syscall (darwin-386-cgo), func Select(int, *FdSet, *FdSet, *FdSet, *Timeval) error +pkg syscall (darwin-386-cgo), func Sendfile(int, int, *int64, int) (int, error) +pkg syscall (darwin-386-cgo), func Sendmsg(int, []uint8, []uint8, Sockaddr, int) error +pkg syscall (darwin-386-cgo), func Sendto(int, []uint8, int, Sockaddr) error +pkg syscall (darwin-386-cgo), func SetBpf(int, []BpfInsn) error +pkg syscall (darwin-386-cgo), func SetBpfBuflen(int, int) (int, error) +pkg syscall (darwin-386-cgo), func SetBpfDatalink(int, int) (int, error) +pkg syscall (darwin-386-cgo), func SetBpfHeadercmpl(int, int) error +pkg syscall (darwin-386-cgo), func SetBpfImmediate(int, int) error +pkg syscall (darwin-386-cgo), func SetBpfInterface(int, string) error +pkg syscall (darwin-386-cgo), func SetBpfPromisc(int, int) error +pkg syscall (darwin-386-cgo), func SetBpfTimeout(int, *Timeval) error +pkg syscall (darwin-386-cgo), func SetKevent(*Kevent_t, int, int, int) +pkg syscall (darwin-386-cgo), func SetNonblock(int, bool) error +pkg syscall (darwin-386-cgo), func Setegid(int) error +pkg syscall (darwin-386-cgo), func Seteuid(int) error +pkg syscall (darwin-386-cgo), func Setgid(int) error +pkg syscall (darwin-386-cgo), func Setgroups([]int) error +pkg syscall (darwin-386-cgo), func Setlogin(string) error +pkg syscall (darwin-386-cgo), func Setpgid(int, int) error +pkg syscall (darwin-386-cgo), func Setpriority(int, int, int) error +pkg syscall (darwin-386-cgo), func Setprivexec(int) error +pkg syscall (darwin-386-cgo), func Setregid(int, int) error +pkg syscall (darwin-386-cgo), func Setreuid(int, int) error +pkg syscall (darwin-386-cgo), func Setrlimit(int, *Rlimit) error +pkg syscall (darwin-386-cgo), func Setsid() (int, error) +pkg syscall (darwin-386-cgo), func SetsockoptByte(int, int, int, uint8) error +pkg syscall (darwin-386-cgo), func SetsockoptIPMreq(int, int, int, *IPMreq) error +pkg syscall (darwin-386-cgo), func SetsockoptIPv6Mreq(int, int, int, *IPv6Mreq) error +pkg syscall (darwin-386-cgo), func SetsockoptInet4Addr(int, int, int, [4]uint8) error +pkg syscall (darwin-386-cgo), func SetsockoptInt(int, int, int, int) error +pkg syscall (darwin-386-cgo), func SetsockoptLinger(int, int, int, *Linger) error +pkg syscall (darwin-386-cgo), func SetsockoptString(int, int, int, string) error +pkg syscall (darwin-386-cgo), func SetsockoptTimeval(int, int, int, *Timeval) error +pkg syscall (darwin-386-cgo), func Settimeofday(*Timeval) error +pkg syscall (darwin-386-cgo), func Setuid(int) error +pkg syscall (darwin-386-cgo), func Shutdown(int, int) error +pkg syscall (darwin-386-cgo), func Socket(int, int, int) (int, error) +pkg syscall (darwin-386-cgo), func Socketpair(int, int, int) ([2]int, error) +pkg syscall (darwin-386-cgo), func Stat(string, *Stat_t) error +pkg syscall (darwin-386-cgo), func Statfs(string, *Statfs_t) error +pkg syscall (darwin-386-cgo), func StringSlicePtr([]string) []*uint8 +pkg syscall (darwin-386-cgo), func Sync() error +pkg syscall (darwin-386-cgo), func Syscall(uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno) +pkg syscall (darwin-386-cgo), func Syscall6(uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno) +pkg syscall (darwin-386-cgo), func Syscall9(uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno) +pkg syscall (darwin-386-cgo), func Sysctl(string) (string, error) +pkg syscall (darwin-386-cgo), func SysctlUint32(string) (uint32, error) +pkg syscall (darwin-386-cgo), func TimespecToNsec(Timespec) int64 +pkg syscall (darwin-386-cgo), func TimevalToNsec(Timeval) int64 +pkg syscall (darwin-386-cgo), func Truncate(string, int64) error +pkg syscall (darwin-386-cgo), func Umask(int) int +pkg syscall (darwin-386-cgo), func Undelete(string) error +pkg syscall (darwin-386-cgo), func UnixRights(...int) []uint8 +pkg syscall (darwin-386-cgo), func Unmount(string, int) error +pkg syscall (darwin-386-cgo), func Wait4(int, *WaitStatus, int, *Rusage) (int, error) +pkg syscall (darwin-386-cgo), func Write(int, []uint8) (int, error) +pkg syscall (darwin-386-cgo), method (*Cmsghdr) SetLen(int) +pkg syscall (darwin-386-cgo), method (*Iovec) SetLen(int) +pkg syscall (darwin-386-cgo), method (*Msghdr) SetControllen(int) +pkg syscall (darwin-386-cgo), type BpfHdr struct +pkg syscall (darwin-386-cgo), type BpfHdr struct, Caplen uint32 +pkg syscall (darwin-386-cgo), type BpfHdr struct, Datalen uint32 +pkg syscall (darwin-386-cgo), type BpfHdr struct, Hdrlen uint16 +pkg syscall (darwin-386-cgo), type BpfHdr struct, Pad_cgo_0 [2]uint8 +pkg syscall (darwin-386-cgo), type BpfHdr struct, Tstamp Timeval +pkg syscall (darwin-386-cgo), type BpfInsn struct +pkg syscall (darwin-386-cgo), type BpfInsn struct, Code uint16 +pkg syscall (darwin-386-cgo), type BpfInsn struct, Jf uint8 +pkg syscall (darwin-386-cgo), type BpfInsn struct, Jt uint8 +pkg syscall (darwin-386-cgo), type BpfInsn struct, K uint32 +pkg syscall (darwin-386-cgo), type BpfProgram struct +pkg syscall (darwin-386-cgo), type BpfProgram struct, Insns *BpfInsn +pkg syscall (darwin-386-cgo), type BpfProgram struct, Len uint32 +pkg syscall (darwin-386-cgo), type BpfStat struct +pkg syscall (darwin-386-cgo), type BpfStat struct, Drop uint32 +pkg syscall (darwin-386-cgo), type BpfStat struct, Recv uint32 +pkg syscall (darwin-386-cgo), type BpfVersion struct +pkg syscall (darwin-386-cgo), type BpfVersion struct, Major uint16 +pkg syscall (darwin-386-cgo), type BpfVersion struct, Minor uint16 +pkg syscall (darwin-386-cgo), type Cmsghdr struct +pkg syscall (darwin-386-cgo), type Cmsghdr struct, Len uint32 +pkg syscall (darwin-386-cgo), type Cmsghdr struct, Level int32 +pkg syscall (darwin-386-cgo), type Cmsghdr struct, Type int32 +pkg syscall (darwin-386-cgo), type Credential struct +pkg syscall (darwin-386-cgo), type Credential struct, Gid uint32 +pkg syscall (darwin-386-cgo), type Credential struct, Groups []uint32 +pkg syscall (darwin-386-cgo), type Credential struct, Uid uint32 +pkg syscall (darwin-386-cgo), type Dirent struct +pkg syscall (darwin-386-cgo), type Dirent struct, Ino uint64 +pkg syscall (darwin-386-cgo), type Dirent struct, Name [1024]int8 +pkg syscall (darwin-386-cgo), type Dirent struct, Namlen uint16 +pkg syscall (darwin-386-cgo), type Dirent struct, Pad_cgo_0 [3]uint8 +pkg syscall (darwin-386-cgo), type Dirent struct, Reclen uint16 +pkg syscall (darwin-386-cgo), type Dirent struct, Seekoff uint64 +pkg syscall (darwin-386-cgo), type Dirent struct, Type uint8 +pkg syscall (darwin-386-cgo), type Fbootstraptransfer_t struct +pkg syscall (darwin-386-cgo), type Fbootstraptransfer_t struct, Buffer *uint8 +pkg syscall (darwin-386-cgo), type Fbootstraptransfer_t struct, Length uint32 +pkg syscall (darwin-386-cgo), type Fbootstraptransfer_t struct, Offset int64 +pkg syscall (darwin-386-cgo), type FdSet struct +pkg syscall (darwin-386-cgo), type FdSet struct, Bits [32]int32 +pkg syscall (darwin-386-cgo), type Flock_t struct +pkg syscall (darwin-386-cgo), type Flock_t struct, Len int64 +pkg syscall (darwin-386-cgo), type Flock_t struct, Pid int32 +pkg syscall (darwin-386-cgo), type Flock_t struct, Start int64 +pkg syscall (darwin-386-cgo), type Flock_t struct, Type int16 +pkg syscall (darwin-386-cgo), type Flock_t struct, Whence int16 +pkg syscall (darwin-386-cgo), type Fsid struct +pkg syscall (darwin-386-cgo), type Fsid struct, Val [2]int32 +pkg syscall (darwin-386-cgo), type Fstore_t struct +pkg syscall (darwin-386-cgo), type Fstore_t struct, Bytesalloc int64 +pkg syscall (darwin-386-cgo), type Fstore_t struct, Flags uint32 +pkg syscall (darwin-386-cgo), type Fstore_t struct, Length int64 +pkg syscall (darwin-386-cgo), type Fstore_t struct, Offset int64 +pkg syscall (darwin-386-cgo), type Fstore_t struct, Posmode int32 +pkg syscall (darwin-386-cgo), type IfData struct +pkg syscall (darwin-386-cgo), type IfData struct, Addrlen uint8 +pkg syscall (darwin-386-cgo), type IfData struct, Baudrate uint32 +pkg syscall (darwin-386-cgo), type IfData struct, Collisions uint32 +pkg syscall (darwin-386-cgo), type IfData struct, Hdrlen uint8 +pkg syscall (darwin-386-cgo), type IfData struct, Hwassist uint32 +pkg syscall (darwin-386-cgo), type IfData struct, Ibytes uint32 +pkg syscall (darwin-386-cgo), type IfData struct, Ierrors uint32 +pkg syscall (darwin-386-cgo), type IfData struct, Imcasts uint32 +pkg syscall (darwin-386-cgo), type IfData struct, Ipackets uint32 +pkg syscall (darwin-386-cgo), type IfData struct, Iqdrops uint32 +pkg syscall (darwin-386-cgo), type IfData struct, Lastchange Timeval +pkg syscall (darwin-386-cgo), type IfData struct, Metric uint32 +pkg syscall (darwin-386-cgo), type IfData struct, Mtu uint32 +pkg syscall (darwin-386-cgo), type IfData struct, Noproto uint32 +pkg syscall (darwin-386-cgo), type IfData struct, Obytes uint32 +pkg syscall (darwin-386-cgo), type IfData struct, Oerrors uint32 +pkg syscall (darwin-386-cgo), type IfData struct, Omcasts uint32 +pkg syscall (darwin-386-cgo), type IfData struct, Opackets uint32 +pkg syscall (darwin-386-cgo), type IfData struct, Physical uint8 +pkg syscall (darwin-386-cgo), type IfData struct, Recvquota uint8 +pkg syscall (darwin-386-cgo), type IfData struct, Recvtiming uint32 +pkg syscall (darwin-386-cgo), type IfData struct, Reserved1 uint32 +pkg syscall (darwin-386-cgo), type IfData struct, Reserved2 uint32 +pkg syscall (darwin-386-cgo), type IfData struct, Type uint8 +pkg syscall (darwin-386-cgo), type IfData struct, Typelen uint8 +pkg syscall (darwin-386-cgo), type IfData struct, Unused1 uint8 +pkg syscall (darwin-386-cgo), type IfData struct, Unused2 uint32 +pkg syscall (darwin-386-cgo), type IfData struct, Xmitquota uint8 +pkg syscall (darwin-386-cgo), type IfData struct, Xmittiming uint32 +pkg syscall (darwin-386-cgo), type IfMsghdr struct +pkg syscall (darwin-386-cgo), type IfMsghdr struct, Addrs int32 +pkg syscall (darwin-386-cgo), type IfMsghdr struct, Data IfData +pkg syscall (darwin-386-cgo), type IfMsghdr struct, Flags int32 +pkg syscall (darwin-386-cgo), type IfMsghdr struct, Index uint16 +pkg syscall (darwin-386-cgo), type IfMsghdr struct, Msglen uint16 +pkg syscall (darwin-386-cgo), type IfMsghdr struct, Pad_cgo_0 [2]uint8 +pkg syscall (darwin-386-cgo), type IfMsghdr struct, Type uint8 +pkg syscall (darwin-386-cgo), type IfMsghdr struct, Version uint8 +pkg syscall (darwin-386-cgo), type IfaMsghdr struct +pkg syscall (darwin-386-cgo), type IfaMsghdr struct, Addrs int32 +pkg syscall (darwin-386-cgo), type IfaMsghdr struct, Flags int32 +pkg syscall (darwin-386-cgo), type IfaMsghdr struct, Index uint16 +pkg syscall (darwin-386-cgo), type IfaMsghdr struct, Metric int32 +pkg syscall (darwin-386-cgo), type IfaMsghdr struct, Msglen uint16 +pkg syscall (darwin-386-cgo), type IfaMsghdr struct, Pad_cgo_0 [2]uint8 +pkg syscall (darwin-386-cgo), type IfaMsghdr struct, Type uint8 +pkg syscall (darwin-386-cgo), type IfaMsghdr struct, Version uint8 +pkg syscall (darwin-386-cgo), type IfmaMsghdr struct +pkg syscall (darwin-386-cgo), type IfmaMsghdr struct, Addrs int32 +pkg syscall (darwin-386-cgo), type IfmaMsghdr struct, Flags int32 +pkg syscall (darwin-386-cgo), type IfmaMsghdr struct, Index uint16 +pkg syscall (darwin-386-cgo), type IfmaMsghdr struct, Msglen uint16 +pkg syscall (darwin-386-cgo), type IfmaMsghdr struct, Pad_cgo_0 [2]uint8 +pkg syscall (darwin-386-cgo), type IfmaMsghdr struct, Type uint8 +pkg syscall (darwin-386-cgo), type IfmaMsghdr struct, Version uint8 +pkg syscall (darwin-386-cgo), type IfmaMsghdr2 struct +pkg syscall (darwin-386-cgo), type IfmaMsghdr2 struct, Addrs int32 +pkg syscall (darwin-386-cgo), type IfmaMsghdr2 struct, Flags int32 +pkg syscall (darwin-386-cgo), type IfmaMsghdr2 struct, Index uint16 +pkg syscall (darwin-386-cgo), type IfmaMsghdr2 struct, Msglen uint16 +pkg syscall (darwin-386-cgo), type IfmaMsghdr2 struct, Pad_cgo_0 [2]uint8 +pkg syscall (darwin-386-cgo), type IfmaMsghdr2 struct, Refcount int32 +pkg syscall (darwin-386-cgo), type IfmaMsghdr2 struct, Type uint8 +pkg syscall (darwin-386-cgo), type IfmaMsghdr2 struct, Version uint8 +pkg syscall (darwin-386-cgo), type Inet6Pktinfo struct +pkg syscall (darwin-386-cgo), type Inet6Pktinfo struct, Addr [16]uint8 +pkg syscall (darwin-386-cgo), type Inet6Pktinfo struct, Ifindex uint32 +pkg syscall (darwin-386-cgo), type InterfaceAddrMessage struct +pkg syscall (darwin-386-cgo), type InterfaceAddrMessage struct, Data []uint8 +pkg syscall (darwin-386-cgo), type InterfaceAddrMessage struct, Header IfaMsghdr +pkg syscall (darwin-386-cgo), type InterfaceMessage struct +pkg syscall (darwin-386-cgo), type InterfaceMessage struct, Data []uint8 +pkg syscall (darwin-386-cgo), type InterfaceMessage struct, Header IfMsghdr +pkg syscall (darwin-386-cgo), type InterfaceMulticastAddrMessage struct +pkg syscall (darwin-386-cgo), type InterfaceMulticastAddrMessage struct, Data []uint8 +pkg syscall (darwin-386-cgo), type InterfaceMulticastAddrMessage struct, Header IfmaMsghdr2 +pkg syscall (darwin-386-cgo), type Iovec struct +pkg syscall (darwin-386-cgo), type Iovec struct, Base *uint8 +pkg syscall (darwin-386-cgo), type Iovec struct, Len uint32 +pkg syscall (darwin-386-cgo), type Kevent_t struct +pkg syscall (darwin-386-cgo), type Kevent_t struct, Data int32 +pkg syscall (darwin-386-cgo), type Kevent_t struct, Fflags uint32 +pkg syscall (darwin-386-cgo), type Kevent_t struct, Filter int16 +pkg syscall (darwin-386-cgo), type Kevent_t struct, Flags uint16 +pkg syscall (darwin-386-cgo), type Kevent_t struct, Ident uint32 +pkg syscall (darwin-386-cgo), type Kevent_t struct, Udata *uint8 +pkg syscall (darwin-386-cgo), type Log2phys_t struct +pkg syscall (darwin-386-cgo), type Log2phys_t struct, Contigbytes int64 +pkg syscall (darwin-386-cgo), type Log2phys_t struct, Devoffset int64 +pkg syscall (darwin-386-cgo), type Log2phys_t struct, Flags uint32 +pkg syscall (darwin-386-cgo), type Msghdr struct +pkg syscall (darwin-386-cgo), type Msghdr struct, Control *uint8 +pkg syscall (darwin-386-cgo), type Msghdr struct, Controllen uint32 +pkg syscall (darwin-386-cgo), type Msghdr struct, Flags int32 +pkg syscall (darwin-386-cgo), type Msghdr struct, Iov *Iovec +pkg syscall (darwin-386-cgo), type Msghdr struct, Iovlen int32 +pkg syscall (darwin-386-cgo), type Msghdr struct, Name *uint8 +pkg syscall (darwin-386-cgo), type Msghdr struct, Namelen uint32 +pkg syscall (darwin-386-cgo), type Radvisory_t struct +pkg syscall (darwin-386-cgo), type Radvisory_t struct, Count int32 +pkg syscall (darwin-386-cgo), type Radvisory_t struct, Offset int64 +pkg syscall (darwin-386-cgo), type RawSockaddr struct, Data [14]int8 +pkg syscall (darwin-386-cgo), type RawSockaddr struct, Family uint8 +pkg syscall (darwin-386-cgo), type RawSockaddr struct, Len uint8 +pkg syscall (darwin-386-cgo), type RawSockaddrAny struct, Pad [92]int8 +pkg syscall (darwin-386-cgo), type RawSockaddrDatalink struct +pkg syscall (darwin-386-cgo), type RawSockaddrDatalink struct, Alen uint8 +pkg syscall (darwin-386-cgo), type RawSockaddrDatalink struct, Data [12]int8 +pkg syscall (darwin-386-cgo), type RawSockaddrDatalink struct, Family uint8 +pkg syscall (darwin-386-cgo), type RawSockaddrDatalink struct, Index uint16 +pkg syscall (darwin-386-cgo), type RawSockaddrDatalink struct, Len uint8 +pkg syscall (darwin-386-cgo), type RawSockaddrDatalink struct, Nlen uint8 +pkg syscall (darwin-386-cgo), type RawSockaddrDatalink struct, Slen uint8 +pkg syscall (darwin-386-cgo), type RawSockaddrDatalink struct, Type uint8 +pkg syscall (darwin-386-cgo), type RawSockaddrInet4 struct, Family uint8 +pkg syscall (darwin-386-cgo), type RawSockaddrInet4 struct, Len uint8 +pkg syscall (darwin-386-cgo), type RawSockaddrInet4 struct, Zero [8]int8 +pkg syscall (darwin-386-cgo), type RawSockaddrInet6 struct +pkg syscall (darwin-386-cgo), type RawSockaddrInet6 struct, Addr [16]uint8 +pkg syscall (darwin-386-cgo), type RawSockaddrInet6 struct, Family uint8 +pkg syscall (darwin-386-cgo), type RawSockaddrInet6 struct, Flowinfo uint32 +pkg syscall (darwin-386-cgo), type RawSockaddrInet6 struct, Len uint8 +pkg syscall (darwin-386-cgo), type RawSockaddrInet6 struct, Port uint16 +pkg syscall (darwin-386-cgo), type RawSockaddrInet6 struct, Scope_id uint32 +pkg syscall (darwin-386-cgo), type RawSockaddrUnix struct +pkg syscall (darwin-386-cgo), type RawSockaddrUnix struct, Family uint8 +pkg syscall (darwin-386-cgo), type RawSockaddrUnix struct, Len uint8 +pkg syscall (darwin-386-cgo), type RawSockaddrUnix struct, Path [104]int8 +pkg syscall (darwin-386-cgo), type Rlimit struct +pkg syscall (darwin-386-cgo), type Rlimit struct, Cur uint64 +pkg syscall (darwin-386-cgo), type Rlimit struct, Max uint64 +pkg syscall (darwin-386-cgo), type RouteMessage struct +pkg syscall (darwin-386-cgo), type RouteMessage struct, Data []uint8 +pkg syscall (darwin-386-cgo), type RouteMessage struct, Header RtMsghdr +pkg syscall (darwin-386-cgo), type RoutingMessage interface, unexported methods +pkg syscall (darwin-386-cgo), type RtMetrics struct +pkg syscall (darwin-386-cgo), type RtMetrics struct, Expire int32 +pkg syscall (darwin-386-cgo), type RtMetrics struct, Filler [4]uint32 +pkg syscall (darwin-386-cgo), type RtMetrics struct, Hopcount uint32 +pkg syscall (darwin-386-cgo), type RtMetrics struct, Locks uint32 +pkg syscall (darwin-386-cgo), type RtMetrics struct, Mtu uint32 +pkg syscall (darwin-386-cgo), type RtMetrics struct, Pksent uint32 +pkg syscall (darwin-386-cgo), type RtMetrics struct, Recvpipe uint32 +pkg syscall (darwin-386-cgo), type RtMetrics struct, Rtt uint32 +pkg syscall (darwin-386-cgo), type RtMetrics struct, Rttvar uint32 +pkg syscall (darwin-386-cgo), type RtMetrics struct, Sendpipe uint32 +pkg syscall (darwin-386-cgo), type RtMetrics struct, Ssthresh uint32 +pkg syscall (darwin-386-cgo), type RtMsghdr struct +pkg syscall (darwin-386-cgo), type RtMsghdr struct, Addrs int32 +pkg syscall (darwin-386-cgo), type RtMsghdr struct, Errno int32 +pkg syscall (darwin-386-cgo), type RtMsghdr struct, Flags int32 +pkg syscall (darwin-386-cgo), type RtMsghdr struct, Index uint16 +pkg syscall (darwin-386-cgo), type RtMsghdr struct, Inits uint32 +pkg syscall (darwin-386-cgo), type RtMsghdr struct, Msglen uint16 +pkg syscall (darwin-386-cgo), type RtMsghdr struct, Pad_cgo_0 [2]uint8 +pkg syscall (darwin-386-cgo), type RtMsghdr struct, Pid int32 +pkg syscall (darwin-386-cgo), type RtMsghdr struct, Rmx RtMetrics +pkg syscall (darwin-386-cgo), type RtMsghdr struct, Seq int32 +pkg syscall (darwin-386-cgo), type RtMsghdr struct, Type uint8 +pkg syscall (darwin-386-cgo), type RtMsghdr struct, Use int32 +pkg syscall (darwin-386-cgo), type RtMsghdr struct, Version uint8 +pkg syscall (darwin-386-cgo), type Rusage struct, Idrss int32 +pkg syscall (darwin-386-cgo), type Rusage struct, Inblock int32 +pkg syscall (darwin-386-cgo), type Rusage struct, Isrss int32 +pkg syscall (darwin-386-cgo), type Rusage struct, Ixrss int32 +pkg syscall (darwin-386-cgo), type Rusage struct, Majflt int32 +pkg syscall (darwin-386-cgo), type Rusage struct, Maxrss int32 +pkg syscall (darwin-386-cgo), type Rusage struct, Minflt int32 +pkg syscall (darwin-386-cgo), type Rusage struct, Msgrcv int32 +pkg syscall (darwin-386-cgo), type Rusage struct, Msgsnd int32 +pkg syscall (darwin-386-cgo), type Rusage struct, Nivcsw int32 +pkg syscall (darwin-386-cgo), type Rusage struct, Nsignals int32 +pkg syscall (darwin-386-cgo), type Rusage struct, Nswap int32 +pkg syscall (darwin-386-cgo), type Rusage struct, Nvcsw int32 +pkg syscall (darwin-386-cgo), type Rusage struct, Oublock int32 +pkg syscall (darwin-386-cgo), type Rusage struct, Stime Timeval +pkg syscall (darwin-386-cgo), type Rusage struct, Utime Timeval +pkg syscall (darwin-386-cgo), type SockaddrDatalink struct +pkg syscall (darwin-386-cgo), type SockaddrDatalink struct, Alen uint8 +pkg syscall (darwin-386-cgo), type SockaddrDatalink struct, Data [12]int8 +pkg syscall (darwin-386-cgo), type SockaddrDatalink struct, Family uint8 +pkg syscall (darwin-386-cgo), type SockaddrDatalink struct, Index uint16 +pkg syscall (darwin-386-cgo), type SockaddrDatalink struct, Len uint8 +pkg syscall (darwin-386-cgo), type SockaddrDatalink struct, Nlen uint8 +pkg syscall (darwin-386-cgo), type SockaddrDatalink struct, Slen uint8 +pkg syscall (darwin-386-cgo), type SockaddrDatalink struct, Type uint8 +pkg syscall (darwin-386-cgo), type SocketControlMessage struct +pkg syscall (darwin-386-cgo), type SocketControlMessage struct, Data []uint8 +pkg syscall (darwin-386-cgo), type SocketControlMessage struct, Header Cmsghdr +pkg syscall (darwin-386-cgo), type Stat_t struct +pkg syscall (darwin-386-cgo), type Stat_t struct, Atimespec Timespec +pkg syscall (darwin-386-cgo), type Stat_t struct, Birthtimespec Timespec +pkg syscall (darwin-386-cgo), type Stat_t struct, Blksize int32 +pkg syscall (darwin-386-cgo), type Stat_t struct, Blocks int64 +pkg syscall (darwin-386-cgo), type Stat_t struct, Ctimespec Timespec +pkg syscall (darwin-386-cgo), type Stat_t struct, Dev int32 +pkg syscall (darwin-386-cgo), type Stat_t struct, Flags uint32 +pkg syscall (darwin-386-cgo), type Stat_t struct, Gen uint32 +pkg syscall (darwin-386-cgo), type Stat_t struct, Gid uint32 +pkg syscall (darwin-386-cgo), type Stat_t struct, Ino uint64 +pkg syscall (darwin-386-cgo), type Stat_t struct, Lspare int32 +pkg syscall (darwin-386-cgo), type Stat_t struct, Mode uint16 +pkg syscall (darwin-386-cgo), type Stat_t struct, Mtimespec Timespec +pkg syscall (darwin-386-cgo), type Stat_t struct, Nlink uint16 +pkg syscall (darwin-386-cgo), type Stat_t struct, Qspare [2]int64 +pkg syscall (darwin-386-cgo), type Stat_t struct, Rdev int32 +pkg syscall (darwin-386-cgo), type Stat_t struct, Size int64 +pkg syscall (darwin-386-cgo), type Stat_t struct, Uid uint32 +pkg syscall (darwin-386-cgo), type Statfs_t struct +pkg syscall (darwin-386-cgo), type Statfs_t struct, Bavail uint64 +pkg syscall (darwin-386-cgo), type Statfs_t struct, Bfree uint64 +pkg syscall (darwin-386-cgo), type Statfs_t struct, Blocks uint64 +pkg syscall (darwin-386-cgo), type Statfs_t struct, Bsize uint32 +pkg syscall (darwin-386-cgo), type Statfs_t struct, Ffree uint64 +pkg syscall (darwin-386-cgo), type Statfs_t struct, Files uint64 +pkg syscall (darwin-386-cgo), type Statfs_t struct, Flags uint32 +pkg syscall (darwin-386-cgo), type Statfs_t struct, Fsid Fsid +pkg syscall (darwin-386-cgo), type Statfs_t struct, Fssubtype uint32 +pkg syscall (darwin-386-cgo), type Statfs_t struct, Fstypename [16]int8 +pkg syscall (darwin-386-cgo), type Statfs_t struct, Iosize int32 +pkg syscall (darwin-386-cgo), type Statfs_t struct, Mntfromname [1024]int8 +pkg syscall (darwin-386-cgo), type Statfs_t struct, Mntonname [1024]int8 +pkg syscall (darwin-386-cgo), type Statfs_t struct, Owner uint32 +pkg syscall (darwin-386-cgo), type Statfs_t struct, Reserved [8]uint32 +pkg syscall (darwin-386-cgo), type Statfs_t struct, Type uint32 +pkg syscall (darwin-386-cgo), type SysProcAttr struct, Chroot string +pkg syscall (darwin-386-cgo), type SysProcAttr struct, Credential *Credential +pkg syscall (darwin-386-cgo), type SysProcAttr struct, Noctty bool +pkg syscall (darwin-386-cgo), type SysProcAttr struct, Ptrace bool +pkg syscall (darwin-386-cgo), type SysProcAttr struct, Setctty bool +pkg syscall (darwin-386-cgo), type SysProcAttr struct, Setpgid bool +pkg syscall (darwin-386-cgo), type SysProcAttr struct, Setsid bool +pkg syscall (darwin-386-cgo), type Timespec struct, Nsec int32 +pkg syscall (darwin-386-cgo), type Timespec struct, Sec int32 +pkg syscall (darwin-386-cgo), type Timeval struct, Sec int32 +pkg syscall (darwin-386-cgo), type Timeval struct, Usec int32 +pkg syscall (darwin-386-cgo), type Timeval32 [0]uint8 +pkg syscall (darwin-386-cgo), type WaitStatus uint32 +pkg syscall (darwin-386-cgo), var Stderr int +pkg syscall (darwin-386-cgo), var Stdin int +pkg syscall (darwin-386-cgo), var Stdout int +pkg syscall (darwin-amd64), const AF_APPLETALK ideal-int +pkg syscall (darwin-amd64), const AF_CCITT ideal-int +pkg syscall (darwin-amd64), const AF_CHAOS ideal-int +pkg syscall (darwin-amd64), const AF_CNT ideal-int +pkg syscall (darwin-amd64), const AF_COIP ideal-int +pkg syscall (darwin-amd64), const AF_DATAKIT ideal-int +pkg syscall (darwin-amd64), const AF_DECnet ideal-int +pkg syscall (darwin-amd64), const AF_DLI ideal-int +pkg syscall (darwin-amd64), const AF_E164 ideal-int +pkg syscall (darwin-amd64), const AF_ECMA ideal-int +pkg syscall (darwin-amd64), const AF_HYLINK ideal-int +pkg syscall (darwin-amd64), const AF_IEEE80211 ideal-int +pkg syscall (darwin-amd64), const AF_IMPLINK ideal-int +pkg syscall (darwin-amd64), const AF_IPX ideal-int +pkg syscall (darwin-amd64), const AF_ISDN ideal-int +pkg syscall (darwin-amd64), const AF_ISO ideal-int +pkg syscall (darwin-amd64), const AF_LAT ideal-int +pkg syscall (darwin-amd64), const AF_LINK ideal-int +pkg syscall (darwin-amd64), const AF_LOCAL ideal-int +pkg syscall (darwin-amd64), const AF_MAX ideal-int +pkg syscall (darwin-amd64), const AF_NATM ideal-int +pkg syscall (darwin-amd64), const AF_NDRV ideal-int +pkg syscall (darwin-amd64), const AF_NETBIOS ideal-int +pkg syscall (darwin-amd64), const AF_NS ideal-int +pkg syscall (darwin-amd64), const AF_OSI ideal-int +pkg syscall (darwin-amd64), const AF_PPP ideal-int +pkg syscall (darwin-amd64), const AF_PUP ideal-int +pkg syscall (darwin-amd64), const AF_RESERVED_36 ideal-int +pkg syscall (darwin-amd64), const AF_ROUTE ideal-int +pkg syscall (darwin-amd64), const AF_SIP ideal-int +pkg syscall (darwin-amd64), const AF_SNA ideal-int +pkg syscall (darwin-amd64), const AF_SYSTEM ideal-int +pkg syscall (darwin-amd64), const BIOCFLUSH ideal-int +pkg syscall (darwin-amd64), const BIOCGBLEN ideal-int +pkg syscall (darwin-amd64), const BIOCGDLT ideal-int +pkg syscall (darwin-amd64), const BIOCGDLTLIST ideal-int +pkg syscall (darwin-amd64), const BIOCGETIF ideal-int +pkg syscall (darwin-amd64), const BIOCGHDRCMPLT ideal-int +pkg syscall (darwin-amd64), const BIOCGRSIG ideal-int +pkg syscall (darwin-amd64), const BIOCGRTIMEOUT ideal-int +pkg syscall (darwin-amd64), const BIOCGSEESENT ideal-int +pkg syscall (darwin-amd64), const BIOCGSTATS ideal-int +pkg syscall (darwin-amd64), const BIOCIMMEDIATE ideal-int +pkg syscall (darwin-amd64), const BIOCPROMISC ideal-int +pkg syscall (darwin-amd64), const BIOCSBLEN ideal-int +pkg syscall (darwin-amd64), const BIOCSDLT ideal-int +pkg syscall (darwin-amd64), const BIOCSETF ideal-int +pkg syscall (darwin-amd64), const BIOCSETIF ideal-int +pkg syscall (darwin-amd64), const BIOCSHDRCMPLT ideal-int +pkg syscall (darwin-amd64), const BIOCSRSIG ideal-int +pkg syscall (darwin-amd64), const BIOCSRTIMEOUT ideal-int +pkg syscall (darwin-amd64), const BIOCSSEESENT ideal-int +pkg syscall (darwin-amd64), const BIOCVERSION ideal-int +pkg syscall (darwin-amd64), const BPF_A ideal-int +pkg syscall (darwin-amd64), const BPF_ABS ideal-int +pkg syscall (darwin-amd64), const BPF_ADD ideal-int +pkg syscall (darwin-amd64), const BPF_ALIGNMENT ideal-int +pkg syscall (darwin-amd64), const BPF_ALU ideal-int +pkg syscall (darwin-amd64), const BPF_AND ideal-int +pkg syscall (darwin-amd64), const BPF_B ideal-int +pkg syscall (darwin-amd64), const BPF_DIV ideal-int +pkg syscall (darwin-amd64), const BPF_H ideal-int +pkg syscall (darwin-amd64), const BPF_IMM ideal-int +pkg syscall (darwin-amd64), const BPF_IND ideal-int +pkg syscall (darwin-amd64), const BPF_JA ideal-int +pkg syscall (darwin-amd64), const BPF_JEQ ideal-int +pkg syscall (darwin-amd64), const BPF_JGE ideal-int +pkg syscall (darwin-amd64), const BPF_JGT ideal-int +pkg syscall (darwin-amd64), const BPF_JMP ideal-int +pkg syscall (darwin-amd64), const BPF_JSET ideal-int +pkg syscall (darwin-amd64), const BPF_K ideal-int +pkg syscall (darwin-amd64), const BPF_LD ideal-int +pkg syscall (darwin-amd64), const BPF_LDX ideal-int +pkg syscall (darwin-amd64), const BPF_LEN ideal-int +pkg syscall (darwin-amd64), const BPF_LSH ideal-int +pkg syscall (darwin-amd64), const BPF_MAJOR_VERSION ideal-int +pkg syscall (darwin-amd64), const BPF_MAXBUFSIZE ideal-int +pkg syscall (darwin-amd64), const BPF_MAXINSNS ideal-int +pkg syscall (darwin-amd64), const BPF_MEM ideal-int +pkg syscall (darwin-amd64), const BPF_MEMWORDS ideal-int +pkg syscall (darwin-amd64), const BPF_MINBUFSIZE ideal-int +pkg syscall (darwin-amd64), const BPF_MINOR_VERSION ideal-int +pkg syscall (darwin-amd64), const BPF_MISC ideal-int +pkg syscall (darwin-amd64), const BPF_MSH ideal-int +pkg syscall (darwin-amd64), const BPF_MUL ideal-int +pkg syscall (darwin-amd64), const BPF_NEG ideal-int +pkg syscall (darwin-amd64), const BPF_OR ideal-int +pkg syscall (darwin-amd64), const BPF_RELEASE ideal-int +pkg syscall (darwin-amd64), const BPF_RET ideal-int +pkg syscall (darwin-amd64), const BPF_RSH ideal-int +pkg syscall (darwin-amd64), const BPF_ST ideal-int +pkg syscall (darwin-amd64), const BPF_STX ideal-int +pkg syscall (darwin-amd64), const BPF_SUB ideal-int +pkg syscall (darwin-amd64), const BPF_TAX ideal-int +pkg syscall (darwin-amd64), const BPF_TXA ideal-int +pkg syscall (darwin-amd64), const BPF_W ideal-int +pkg syscall (darwin-amd64), const BPF_X ideal-int +pkg syscall (darwin-amd64), const CTL_MAXNAME ideal-int +pkg syscall (darwin-amd64), const CTL_NET ideal-int +pkg syscall (darwin-amd64), const DLT_APPLE_IP_OVER_IEEE1394 ideal-int +pkg syscall (darwin-amd64), const DLT_ARCNET ideal-int +pkg syscall (darwin-amd64), const DLT_ATM_CLIP ideal-int +pkg syscall (darwin-amd64), const DLT_ATM_RFC1483 ideal-int +pkg syscall (darwin-amd64), const DLT_AX25 ideal-int +pkg syscall (darwin-amd64), const DLT_CHAOS ideal-int +pkg syscall (darwin-amd64), const DLT_CHDLC ideal-int +pkg syscall (darwin-amd64), const DLT_C_HDLC ideal-int +pkg syscall (darwin-amd64), const DLT_EN10MB ideal-int +pkg syscall (darwin-amd64), const DLT_EN3MB ideal-int +pkg syscall (darwin-amd64), const DLT_FDDI ideal-int +pkg syscall (darwin-amd64), const DLT_IEEE802 ideal-int +pkg syscall (darwin-amd64), const DLT_IEEE802_11 ideal-int +pkg syscall (darwin-amd64), const DLT_IEEE802_11_RADIO ideal-int +pkg syscall (darwin-amd64), const DLT_IEEE802_11_RADIO_AVS ideal-int +pkg syscall (darwin-amd64), const DLT_LINUX_SLL ideal-int +pkg syscall (darwin-amd64), const DLT_LOOP ideal-int +pkg syscall (darwin-amd64), const DLT_NULL ideal-int +pkg syscall (darwin-amd64), const DLT_PFLOG ideal-int +pkg syscall (darwin-amd64), const DLT_PFSYNC ideal-int +pkg syscall (darwin-amd64), const DLT_PPP ideal-int +pkg syscall (darwin-amd64), const DLT_PPP_BSDOS ideal-int +pkg syscall (darwin-amd64), const DLT_PPP_SERIAL ideal-int +pkg syscall (darwin-amd64), const DLT_PRONET ideal-int +pkg syscall (darwin-amd64), const DLT_RAW ideal-int +pkg syscall (darwin-amd64), const DLT_SLIP ideal-int +pkg syscall (darwin-amd64), const DLT_SLIP_BSDOS ideal-int +pkg syscall (darwin-amd64), const DT_BLK ideal-int +pkg syscall (darwin-amd64), const DT_CHR ideal-int +pkg syscall (darwin-amd64), const DT_DIR ideal-int +pkg syscall (darwin-amd64), const DT_FIFO ideal-int +pkg syscall (darwin-amd64), const DT_LNK ideal-int +pkg syscall (darwin-amd64), const DT_REG ideal-int +pkg syscall (darwin-amd64), const DT_SOCK ideal-int +pkg syscall (darwin-amd64), const DT_UNKNOWN ideal-int +pkg syscall (darwin-amd64), const DT_WHT ideal-int +pkg syscall (darwin-amd64), const EAUTH Errno +pkg syscall (darwin-amd64), const EBADARCH Errno +pkg syscall (darwin-amd64), const EBADEXEC Errno +pkg syscall (darwin-amd64), const EBADMACHO Errno +pkg syscall (darwin-amd64), const EBADMSG Errno +pkg syscall (darwin-amd64), const EBADRPC Errno +pkg syscall (darwin-amd64), const ECHO ideal-int +pkg syscall (darwin-amd64), const ECHOCTL ideal-int +pkg syscall (darwin-amd64), const ECHOE ideal-int +pkg syscall (darwin-amd64), const ECHOK ideal-int +pkg syscall (darwin-amd64), const ECHOKE ideal-int +pkg syscall (darwin-amd64), const ECHONL ideal-int +pkg syscall (darwin-amd64), const ECHOPRT ideal-int +pkg syscall (darwin-amd64), const EDEVERR Errno +pkg syscall (darwin-amd64), const EFTYPE Errno +pkg syscall (darwin-amd64), const ELAST Errno +pkg syscall (darwin-amd64), const EMULTIHOP Errno +pkg syscall (darwin-amd64), const ENEEDAUTH Errno +pkg syscall (darwin-amd64), const ENOATTR Errno +pkg syscall (darwin-amd64), const ENODATA Errno +pkg syscall (darwin-amd64), const ENOLINK Errno +pkg syscall (darwin-amd64), const ENOPOLICY Errno +pkg syscall (darwin-amd64), const ENOSR Errno +pkg syscall (darwin-amd64), const ENOSTR Errno +pkg syscall (darwin-amd64), const ENOTRECOVERABLE Errno +pkg syscall (darwin-amd64), const EOWNERDEAD Errno +pkg syscall (darwin-amd64), const EPROCLIM Errno +pkg syscall (darwin-amd64), const EPROCUNAVAIL Errno +pkg syscall (darwin-amd64), const EPROGMISMATCH Errno +pkg syscall (darwin-amd64), const EPROGUNAVAIL Errno +pkg syscall (darwin-amd64), const EPROTO Errno +pkg syscall (darwin-amd64), const EPWROFF Errno +pkg syscall (darwin-amd64), const ERPCMISMATCH Errno +pkg syscall (darwin-amd64), const ESHLIBVERS Errno +pkg syscall (darwin-amd64), const ETIME Errno +pkg syscall (darwin-amd64), const EVFILT_AIO ideal-int +pkg syscall (darwin-amd64), const EVFILT_FS ideal-int +pkg syscall (darwin-amd64), const EVFILT_MACHPORT ideal-int +pkg syscall (darwin-amd64), const EVFILT_PROC ideal-int +pkg syscall (darwin-amd64), const EVFILT_READ ideal-int +pkg syscall (darwin-amd64), const EVFILT_SIGNAL ideal-int +pkg syscall (darwin-amd64), const EVFILT_SYSCOUNT ideal-int +pkg syscall (darwin-amd64), const EVFILT_THREADMARKER ideal-int +pkg syscall (darwin-amd64), const EVFILT_TIMER ideal-int +pkg syscall (darwin-amd64), const EVFILT_USER ideal-int +pkg syscall (darwin-amd64), const EVFILT_VM ideal-int +pkg syscall (darwin-amd64), const EVFILT_VNODE ideal-int +pkg syscall (darwin-amd64), const EVFILT_WRITE ideal-int +pkg syscall (darwin-amd64), const EV_ADD ideal-int +pkg syscall (darwin-amd64), const EV_CLEAR ideal-int +pkg syscall (darwin-amd64), const EV_DELETE ideal-int +pkg syscall (darwin-amd64), const EV_DISABLE ideal-int +pkg syscall (darwin-amd64), const EV_DISPATCH ideal-int +pkg syscall (darwin-amd64), const EV_ENABLE ideal-int +pkg syscall (darwin-amd64), const EV_EOF ideal-int +pkg syscall (darwin-amd64), const EV_ERROR ideal-int +pkg syscall (darwin-amd64), const EV_FLAG0 ideal-int +pkg syscall (darwin-amd64), const EV_FLAG1 ideal-int +pkg syscall (darwin-amd64), const EV_ONESHOT ideal-int +pkg syscall (darwin-amd64), const EV_OOBAND ideal-int +pkg syscall (darwin-amd64), const EV_POLL ideal-int +pkg syscall (darwin-amd64), const EV_RECEIPT ideal-int +pkg syscall (darwin-amd64), const EV_SYSFLAGS ideal-int +pkg syscall (darwin-amd64), const EXTA ideal-int +pkg syscall (darwin-amd64), const EXTB ideal-int +pkg syscall (darwin-amd64), const EXTPROC ideal-int +pkg syscall (darwin-amd64), const FD_CLOEXEC ideal-int +pkg syscall (darwin-amd64), const FD_SETSIZE ideal-int +pkg syscall (darwin-amd64), const F_ADDFILESIGS ideal-int +pkg syscall (darwin-amd64), const F_ADDSIGS ideal-int +pkg syscall (darwin-amd64), const F_ALLOCATEALL ideal-int +pkg syscall (darwin-amd64), const F_ALLOCATECONTIG ideal-int +pkg syscall (darwin-amd64), const F_CHKCLEAN ideal-int +pkg syscall (darwin-amd64), const F_DUPFD ideal-int +pkg syscall (darwin-amd64), const F_DUPFD_CLOEXEC ideal-int +pkg syscall (darwin-amd64), const F_FLUSH_DATA ideal-int +pkg syscall (darwin-amd64), const F_FREEZE_FS ideal-int +pkg syscall (darwin-amd64), const F_FULLFSYNC ideal-int +pkg syscall (darwin-amd64), const F_GETFD ideal-int +pkg syscall (darwin-amd64), const F_GETFL ideal-int +pkg syscall (darwin-amd64), const F_GETLK ideal-int +pkg syscall (darwin-amd64), const F_GETLKPID ideal-int +pkg syscall (darwin-amd64), const F_GETNOSIGPIPE ideal-int +pkg syscall (darwin-amd64), const F_GETOWN ideal-int +pkg syscall (darwin-amd64), const F_GETPATH ideal-int +pkg syscall (darwin-amd64), const F_GETPATH_MTMINFO ideal-int +pkg syscall (darwin-amd64), const F_GETPROTECTIONCLASS ideal-int +pkg syscall (darwin-amd64), const F_GLOBAL_NOCACHE ideal-int +pkg syscall (darwin-amd64), const F_LOG2PHYS ideal-int +pkg syscall (darwin-amd64), const F_LOG2PHYS_EXT ideal-int +pkg syscall (darwin-amd64), const F_MARKDEPENDENCY ideal-int +pkg syscall (darwin-amd64), const F_NOCACHE ideal-int +pkg syscall (darwin-amd64), const F_NODIRECT ideal-int +pkg syscall (darwin-amd64), const F_OK ideal-int +pkg syscall (darwin-amd64), const F_PATHPKG_CHECK ideal-int +pkg syscall (darwin-amd64), const F_PEOFPOSMODE ideal-int +pkg syscall (darwin-amd64), const F_PREALLOCATE ideal-int +pkg syscall (darwin-amd64), const F_RDADVISE ideal-int +pkg syscall (darwin-amd64), const F_RDAHEAD ideal-int +pkg syscall (darwin-amd64), const F_RDLCK ideal-int +pkg syscall (darwin-amd64), const F_READBOOTSTRAP ideal-int +pkg syscall (darwin-amd64), const F_SETBACKINGSTORE ideal-int +pkg syscall (darwin-amd64), const F_SETFD ideal-int +pkg syscall (darwin-amd64), const F_SETFL ideal-int +pkg syscall (darwin-amd64), const F_SETLK ideal-int +pkg syscall (darwin-amd64), const F_SETLKW ideal-int +pkg syscall (darwin-amd64), const F_SETNOSIGPIPE ideal-int +pkg syscall (darwin-amd64), const F_SETOWN ideal-int +pkg syscall (darwin-amd64), const F_SETPROTECTIONCLASS ideal-int +pkg syscall (darwin-amd64), const F_SETSIZE ideal-int +pkg syscall (darwin-amd64), const F_THAW_FS ideal-int +pkg syscall (darwin-amd64), const F_UNLCK ideal-int +pkg syscall (darwin-amd64), const F_VOLPOSMODE ideal-int +pkg syscall (darwin-amd64), const F_WRITEBOOTSTRAP ideal-int +pkg syscall (darwin-amd64), const F_WRLCK ideal-int +pkg syscall (darwin-amd64), const IFF_ALLMULTI ideal-int +pkg syscall (darwin-amd64), const IFF_ALTPHYS ideal-int +pkg syscall (darwin-amd64), const IFF_DEBUG ideal-int +pkg syscall (darwin-amd64), const IFF_LINK0 ideal-int +pkg syscall (darwin-amd64), const IFF_LINK1 ideal-int +pkg syscall (darwin-amd64), const IFF_LINK2 ideal-int +pkg syscall (darwin-amd64), const IFF_NOARP ideal-int +pkg syscall (darwin-amd64), const IFF_NOTRAILERS ideal-int +pkg syscall (darwin-amd64), const IFF_OACTIVE ideal-int +pkg syscall (darwin-amd64), const IFF_POINTOPOINT ideal-int +pkg syscall (darwin-amd64), const IFF_PROMISC ideal-int +pkg syscall (darwin-amd64), const IFF_RUNNING ideal-int +pkg syscall (darwin-amd64), const IFF_SIMPLEX ideal-int +pkg syscall (darwin-amd64), const IFNAMSIZ ideal-int +pkg syscall (darwin-amd64), const IFT_1822 ideal-int +pkg syscall (darwin-amd64), const IFT_AAL5 ideal-int +pkg syscall (darwin-amd64), const IFT_ARCNET ideal-int +pkg syscall (darwin-amd64), const IFT_ARCNETPLUS ideal-int +pkg syscall (darwin-amd64), const IFT_ATM ideal-int +pkg syscall (darwin-amd64), const IFT_BRIDGE ideal-int +pkg syscall (darwin-amd64), const IFT_CARP ideal-int +pkg syscall (darwin-amd64), const IFT_CELLULAR ideal-int +pkg syscall (darwin-amd64), const IFT_CEPT ideal-int +pkg syscall (darwin-amd64), const IFT_DS3 ideal-int +pkg syscall (darwin-amd64), const IFT_ENC ideal-int +pkg syscall (darwin-amd64), const IFT_EON ideal-int +pkg syscall (darwin-amd64), const IFT_ETHER ideal-int +pkg syscall (darwin-amd64), const IFT_FAITH ideal-int +pkg syscall (darwin-amd64), const IFT_FDDI ideal-int +pkg syscall (darwin-amd64), const IFT_FRELAY ideal-int +pkg syscall (darwin-amd64), const IFT_FRELAYDCE ideal-int +pkg syscall (darwin-amd64), const IFT_GIF ideal-int +pkg syscall (darwin-amd64), const IFT_HDH1822 ideal-int +pkg syscall (darwin-amd64), const IFT_HIPPI ideal-int +pkg syscall (darwin-amd64), const IFT_HSSI ideal-int +pkg syscall (darwin-amd64), const IFT_HY ideal-int +pkg syscall (darwin-amd64), const IFT_IEEE1394 ideal-int +pkg syscall (darwin-amd64), const IFT_IEEE8023ADLAG ideal-int +pkg syscall (darwin-amd64), const IFT_ISDNBASIC ideal-int +pkg syscall (darwin-amd64), const IFT_ISDNPRIMARY ideal-int +pkg syscall (darwin-amd64), const IFT_ISO88022LLC ideal-int +pkg syscall (darwin-amd64), const IFT_ISO88023 ideal-int +pkg syscall (darwin-amd64), const IFT_ISO88024 ideal-int +pkg syscall (darwin-amd64), const IFT_ISO88025 ideal-int +pkg syscall (darwin-amd64), const IFT_ISO88026 ideal-int +pkg syscall (darwin-amd64), const IFT_L2VLAN ideal-int +pkg syscall (darwin-amd64), const IFT_LAPB ideal-int +pkg syscall (darwin-amd64), const IFT_LOCALTALK ideal-int +pkg syscall (darwin-amd64), const IFT_LOOP ideal-int +pkg syscall (darwin-amd64), const IFT_MIOX25 ideal-int +pkg syscall (darwin-amd64), const IFT_MODEM ideal-int +pkg syscall (darwin-amd64), const IFT_NSIP ideal-int +pkg syscall (darwin-amd64), const IFT_OTHER ideal-int +pkg syscall (darwin-amd64), const IFT_P10 ideal-int +pkg syscall (darwin-amd64), const IFT_P80 ideal-int +pkg syscall (darwin-amd64), const IFT_PARA ideal-int +pkg syscall (darwin-amd64), const IFT_PDP ideal-int +pkg syscall (darwin-amd64), const IFT_PFLOG ideal-int +pkg syscall (darwin-amd64), const IFT_PFSYNC ideal-int +pkg syscall (darwin-amd64), const IFT_PPP ideal-int +pkg syscall (darwin-amd64), const IFT_PROPMUX ideal-int +pkg syscall (darwin-amd64), const IFT_PROPVIRTUAL ideal-int +pkg syscall (darwin-amd64), const IFT_PTPSERIAL ideal-int +pkg syscall (darwin-amd64), const IFT_RS232 ideal-int +pkg syscall (darwin-amd64), const IFT_SDLC ideal-int +pkg syscall (darwin-amd64), const IFT_SIP ideal-int +pkg syscall (darwin-amd64), const IFT_SLIP ideal-int +pkg syscall (darwin-amd64), const IFT_SMDSDXI ideal-int +pkg syscall (darwin-amd64), const IFT_SMDSICIP ideal-int +pkg syscall (darwin-amd64), const IFT_SONET ideal-int +pkg syscall (darwin-amd64), const IFT_SONETPATH ideal-int +pkg syscall (darwin-amd64), const IFT_SONETVT ideal-int +pkg syscall (darwin-amd64), const IFT_STARLAN ideal-int +pkg syscall (darwin-amd64), const IFT_STF ideal-int +pkg syscall (darwin-amd64), const IFT_T1 ideal-int +pkg syscall (darwin-amd64), const IFT_ULTRA ideal-int +pkg syscall (darwin-amd64), const IFT_V35 ideal-int +pkg syscall (darwin-amd64), const IFT_X25 ideal-int +pkg syscall (darwin-amd64), const IFT_X25DDN ideal-int +pkg syscall (darwin-amd64), const IFT_X25PLE ideal-int +pkg syscall (darwin-amd64), const IFT_XETHER ideal-int +pkg syscall (darwin-amd64), const IN_CLASSA_HOST ideal-int +pkg syscall (darwin-amd64), const IN_CLASSA_MAX ideal-int +pkg syscall (darwin-amd64), const IN_CLASSA_NET ideal-int +pkg syscall (darwin-amd64), const IN_CLASSA_NSHIFT ideal-int +pkg syscall (darwin-amd64), const IN_CLASSB_HOST ideal-int +pkg syscall (darwin-amd64), const IN_CLASSB_MAX ideal-int +pkg syscall (darwin-amd64), const IN_CLASSB_NET ideal-int +pkg syscall (darwin-amd64), const IN_CLASSB_NSHIFT ideal-int +pkg syscall (darwin-amd64), const IN_CLASSC_HOST ideal-int +pkg syscall (darwin-amd64), const IN_CLASSC_NET ideal-int +pkg syscall (darwin-amd64), const IN_CLASSC_NSHIFT ideal-int +pkg syscall (darwin-amd64), const IN_CLASSD_HOST ideal-int +pkg syscall (darwin-amd64), const IN_CLASSD_NET ideal-int +pkg syscall (darwin-amd64), const IN_CLASSD_NSHIFT ideal-int +pkg syscall (darwin-amd64), const IN_LINKLOCALNETNUM ideal-int +pkg syscall (darwin-amd64), const IN_LOOPBACKNET ideal-int +pkg syscall (darwin-amd64), const IPPROTO_3PC ideal-int +pkg syscall (darwin-amd64), const IPPROTO_ADFS ideal-int +pkg syscall (darwin-amd64), const IPPROTO_AH ideal-int +pkg syscall (darwin-amd64), const IPPROTO_AHIP ideal-int +pkg syscall (darwin-amd64), const IPPROTO_APES ideal-int +pkg syscall (darwin-amd64), const IPPROTO_ARGUS ideal-int +pkg syscall (darwin-amd64), const IPPROTO_AX25 ideal-int +pkg syscall (darwin-amd64), const IPPROTO_BHA ideal-int +pkg syscall (darwin-amd64), const IPPROTO_BLT ideal-int +pkg syscall (darwin-amd64), const IPPROTO_BRSATMON ideal-int +pkg syscall (darwin-amd64), const IPPROTO_CFTP ideal-int +pkg syscall (darwin-amd64), const IPPROTO_CHAOS ideal-int +pkg syscall (darwin-amd64), const IPPROTO_CMTP ideal-int +pkg syscall (darwin-amd64), const IPPROTO_CPHB ideal-int +pkg syscall (darwin-amd64), const IPPROTO_CPNX ideal-int +pkg syscall (darwin-amd64), const IPPROTO_DDP ideal-int +pkg syscall (darwin-amd64), const IPPROTO_DGP ideal-int +pkg syscall (darwin-amd64), const IPPROTO_DIVERT ideal-int +pkg syscall (darwin-amd64), const IPPROTO_DONE ideal-int +pkg syscall (darwin-amd64), const IPPROTO_DSTOPTS ideal-int +pkg syscall (darwin-amd64), const IPPROTO_EGP ideal-int +pkg syscall (darwin-amd64), const IPPROTO_EMCON ideal-int +pkg syscall (darwin-amd64), const IPPROTO_ENCAP ideal-int +pkg syscall (darwin-amd64), const IPPROTO_EON ideal-int +pkg syscall (darwin-amd64), const IPPROTO_ESP ideal-int +pkg syscall (darwin-amd64), const IPPROTO_ETHERIP ideal-int +pkg syscall (darwin-amd64), const IPPROTO_FRAGMENT ideal-int +pkg syscall (darwin-amd64), const IPPROTO_GGP ideal-int +pkg syscall (darwin-amd64), const IPPROTO_GMTP ideal-int +pkg syscall (darwin-amd64), const IPPROTO_GRE ideal-int +pkg syscall (darwin-amd64), const IPPROTO_HELLO ideal-int +pkg syscall (darwin-amd64), const IPPROTO_HMP ideal-int +pkg syscall (darwin-amd64), const IPPROTO_HOPOPTS ideal-int +pkg syscall (darwin-amd64), const IPPROTO_ICMP ideal-int +pkg syscall (darwin-amd64), const IPPROTO_ICMPV6 ideal-int +pkg syscall (darwin-amd64), const IPPROTO_IDP ideal-int +pkg syscall (darwin-amd64), const IPPROTO_IDPR ideal-int +pkg syscall (darwin-amd64), const IPPROTO_IDRP ideal-int +pkg syscall (darwin-amd64), const IPPROTO_IGMP ideal-int +pkg syscall (darwin-amd64), const IPPROTO_IGP ideal-int +pkg syscall (darwin-amd64), const IPPROTO_IGRP ideal-int +pkg syscall (darwin-amd64), const IPPROTO_IL ideal-int +pkg syscall (darwin-amd64), const IPPROTO_INLSP ideal-int +pkg syscall (darwin-amd64), const IPPROTO_INP ideal-int +pkg syscall (darwin-amd64), const IPPROTO_IPCOMP ideal-int +pkg syscall (darwin-amd64), const IPPROTO_IPCV ideal-int +pkg syscall (darwin-amd64), const IPPROTO_IPEIP ideal-int +pkg syscall (darwin-amd64), const IPPROTO_IPIP ideal-int +pkg syscall (darwin-amd64), const IPPROTO_IPPC ideal-int +pkg syscall (darwin-amd64), const IPPROTO_IPV4 ideal-int +pkg syscall (darwin-amd64), const IPPROTO_IRTP ideal-int +pkg syscall (darwin-amd64), const IPPROTO_KRYPTOLAN ideal-int +pkg syscall (darwin-amd64), const IPPROTO_LARP ideal-int +pkg syscall (darwin-amd64), const IPPROTO_LEAF1 ideal-int +pkg syscall (darwin-amd64), const IPPROTO_LEAF2 ideal-int +pkg syscall (darwin-amd64), const IPPROTO_MAX ideal-int +pkg syscall (darwin-amd64), const IPPROTO_MAXID ideal-int +pkg syscall (darwin-amd64), const IPPROTO_MEAS ideal-int +pkg syscall (darwin-amd64), const IPPROTO_MHRP ideal-int +pkg syscall (darwin-amd64), const IPPROTO_MICP ideal-int +pkg syscall (darwin-amd64), const IPPROTO_MTP ideal-int +pkg syscall (darwin-amd64), const IPPROTO_MUX ideal-int +pkg syscall (darwin-amd64), const IPPROTO_ND ideal-int +pkg syscall (darwin-amd64), const IPPROTO_NHRP ideal-int +pkg syscall (darwin-amd64), const IPPROTO_NONE ideal-int +pkg syscall (darwin-amd64), const IPPROTO_NSP ideal-int +pkg syscall (darwin-amd64), const IPPROTO_NVPII ideal-int +pkg syscall (darwin-amd64), const IPPROTO_OSPFIGP ideal-int +pkg syscall (darwin-amd64), const IPPROTO_PGM ideal-int +pkg syscall (darwin-amd64), const IPPROTO_PIGP ideal-int +pkg syscall (darwin-amd64), const IPPROTO_PIM ideal-int +pkg syscall (darwin-amd64), const IPPROTO_PRM ideal-int +pkg syscall (darwin-amd64), const IPPROTO_PUP ideal-int +pkg syscall (darwin-amd64), const IPPROTO_PVP ideal-int +pkg syscall (darwin-amd64), const IPPROTO_RAW ideal-int +pkg syscall (darwin-amd64), const IPPROTO_RCCMON ideal-int +pkg syscall (darwin-amd64), const IPPROTO_RDP ideal-int +pkg syscall (darwin-amd64), const IPPROTO_ROUTING ideal-int +pkg syscall (darwin-amd64), const IPPROTO_RSVP ideal-int +pkg syscall (darwin-amd64), const IPPROTO_RVD ideal-int +pkg syscall (darwin-amd64), const IPPROTO_SATEXPAK ideal-int +pkg syscall (darwin-amd64), const IPPROTO_SATMON ideal-int +pkg syscall (darwin-amd64), const IPPROTO_SCCSP ideal-int +pkg syscall (darwin-amd64), const IPPROTO_SCTP ideal-int +pkg syscall (darwin-amd64), const IPPROTO_SDRP ideal-int +pkg syscall (darwin-amd64), const IPPROTO_SEP ideal-int +pkg syscall (darwin-amd64), const IPPROTO_SRPC ideal-int +pkg syscall (darwin-amd64), const IPPROTO_ST ideal-int +pkg syscall (darwin-amd64), const IPPROTO_SVMTP ideal-int +pkg syscall (darwin-amd64), const IPPROTO_SWIPE ideal-int +pkg syscall (darwin-amd64), const IPPROTO_TCF ideal-int +pkg syscall (darwin-amd64), const IPPROTO_TP ideal-int +pkg syscall (darwin-amd64), const IPPROTO_TPXX ideal-int +pkg syscall (darwin-amd64), const IPPROTO_TRUNK1 ideal-int +pkg syscall (darwin-amd64), const IPPROTO_TRUNK2 ideal-int +pkg syscall (darwin-amd64), const IPPROTO_TTP ideal-int +pkg syscall (darwin-amd64), const IPPROTO_VINES ideal-int +pkg syscall (darwin-amd64), const IPPROTO_VISA ideal-int +pkg syscall (darwin-amd64), const IPPROTO_VMTP ideal-int +pkg syscall (darwin-amd64), const IPPROTO_WBEXPAK ideal-int +pkg syscall (darwin-amd64), const IPPROTO_WBMON ideal-int +pkg syscall (darwin-amd64), const IPPROTO_WSN ideal-int +pkg syscall (darwin-amd64), const IPPROTO_XNET ideal-int +pkg syscall (darwin-amd64), const IPPROTO_XTP ideal-int +pkg syscall (darwin-amd64), const IPV6_2292DSTOPTS ideal-int +pkg syscall (darwin-amd64), const IPV6_2292HOPLIMIT ideal-int +pkg syscall (darwin-amd64), const IPV6_2292HOPOPTS ideal-int +pkg syscall (darwin-amd64), const IPV6_2292NEXTHOP ideal-int +pkg syscall (darwin-amd64), const IPV6_2292PKTINFO ideal-int +pkg syscall (darwin-amd64), const IPV6_2292PKTOPTIONS ideal-int +pkg syscall (darwin-amd64), const IPV6_2292RTHDR ideal-int +pkg syscall (darwin-amd64), const IPV6_BINDV6ONLY ideal-int +pkg syscall (darwin-amd64), const IPV6_BOUND_IF ideal-int +pkg syscall (darwin-amd64), const IPV6_CHECKSUM ideal-int +pkg syscall (darwin-amd64), const IPV6_DEFAULT_MULTICAST_HOPS ideal-int +pkg syscall (darwin-amd64), const IPV6_DEFAULT_MULTICAST_LOOP ideal-int +pkg syscall (darwin-amd64), const IPV6_DEFHLIM ideal-int +pkg syscall (darwin-amd64), const IPV6_FAITH ideal-int +pkg syscall (darwin-amd64), const IPV6_FLOWINFO_MASK ideal-int +pkg syscall (darwin-amd64), const IPV6_FLOWLABEL_MASK ideal-int +pkg syscall (darwin-amd64), const IPV6_FRAGTTL ideal-int +pkg syscall (darwin-amd64), const IPV6_FW_ADD ideal-int +pkg syscall (darwin-amd64), const IPV6_FW_DEL ideal-int +pkg syscall (darwin-amd64), const IPV6_FW_FLUSH ideal-int +pkg syscall (darwin-amd64), const IPV6_FW_GET ideal-int +pkg syscall (darwin-amd64), const IPV6_FW_ZERO ideal-int +pkg syscall (darwin-amd64), const IPV6_HLIMDEC ideal-int +pkg syscall (darwin-amd64), const IPV6_IPSEC_POLICY ideal-int +pkg syscall (darwin-amd64), const IPV6_MAXHLIM ideal-int +pkg syscall (darwin-amd64), const IPV6_MAXOPTHDR ideal-int +pkg syscall (darwin-amd64), const IPV6_MAXPACKET ideal-int +pkg syscall (darwin-amd64), const IPV6_MAX_GROUP_SRC_FILTER ideal-int +pkg syscall (darwin-amd64), const IPV6_MAX_MEMBERSHIPS ideal-int +pkg syscall (darwin-amd64), const IPV6_MAX_SOCK_SRC_FILTER ideal-int +pkg syscall (darwin-amd64), const IPV6_MIN_MEMBERSHIPS ideal-int +pkg syscall (darwin-amd64), const IPV6_MMTU ideal-int +pkg syscall (darwin-amd64), const IPV6_PORTRANGE ideal-int +pkg syscall (darwin-amd64), const IPV6_PORTRANGE_DEFAULT ideal-int +pkg syscall (darwin-amd64), const IPV6_PORTRANGE_HIGH ideal-int +pkg syscall (darwin-amd64), const IPV6_PORTRANGE_LOW ideal-int +pkg syscall (darwin-amd64), const IPV6_RECVTCLASS ideal-int +pkg syscall (darwin-amd64), const IPV6_RTHDR_LOOSE ideal-int +pkg syscall (darwin-amd64), const IPV6_RTHDR_STRICT ideal-int +pkg syscall (darwin-amd64), const IPV6_RTHDR_TYPE_0 ideal-int +pkg syscall (darwin-amd64), const IPV6_SOCKOPT_RESERVED1 ideal-int +pkg syscall (darwin-amd64), const IPV6_TCLASS ideal-int +pkg syscall (darwin-amd64), const IPV6_VERSION ideal-int +pkg syscall (darwin-amd64), const IPV6_VERSION_MASK ideal-int +pkg syscall (darwin-amd64), const IP_ADD_SOURCE_MEMBERSHIP ideal-int +pkg syscall (darwin-amd64), const IP_BLOCK_SOURCE ideal-int +pkg syscall (darwin-amd64), const IP_BOUND_IF ideal-int +pkg syscall (darwin-amd64), const IP_DEFAULT_MULTICAST_LOOP ideal-int +pkg syscall (darwin-amd64), const IP_DEFAULT_MULTICAST_TTL ideal-int +pkg syscall (darwin-amd64), const IP_DF ideal-int +pkg syscall (darwin-amd64), const IP_DROP_SOURCE_MEMBERSHIP ideal-int +pkg syscall (darwin-amd64), const IP_DUMMYNET_CONFIGURE ideal-int +pkg syscall (darwin-amd64), const IP_DUMMYNET_DEL ideal-int +pkg syscall (darwin-amd64), const IP_DUMMYNET_FLUSH ideal-int +pkg syscall (darwin-amd64), const IP_DUMMYNET_GET ideal-int +pkg syscall (darwin-amd64), const IP_FAITH ideal-int +pkg syscall (darwin-amd64), const IP_FW_ADD ideal-int +pkg syscall (darwin-amd64), const IP_FW_DEL ideal-int +pkg syscall (darwin-amd64), const IP_FW_FLUSH ideal-int +pkg syscall (darwin-amd64), const IP_FW_GET ideal-int +pkg syscall (darwin-amd64), const IP_FW_RESETLOG ideal-int +pkg syscall (darwin-amd64), const IP_FW_ZERO ideal-int +pkg syscall (darwin-amd64), const IP_HDRINCL ideal-int +pkg syscall (darwin-amd64), const IP_IPSEC_POLICY ideal-int +pkg syscall (darwin-amd64), const IP_MAXPACKET ideal-int +pkg syscall (darwin-amd64), const IP_MAX_GROUP_SRC_FILTER ideal-int +pkg syscall (darwin-amd64), const IP_MAX_MEMBERSHIPS ideal-int +pkg syscall (darwin-amd64), const IP_MAX_SOCK_MUTE_FILTER ideal-int +pkg syscall (darwin-amd64), const IP_MAX_SOCK_SRC_FILTER ideal-int +pkg syscall (darwin-amd64), const IP_MF ideal-int +pkg syscall (darwin-amd64), const IP_MIN_MEMBERSHIPS ideal-int +pkg syscall (darwin-amd64), const IP_MSFILTER ideal-int +pkg syscall (darwin-amd64), const IP_MSS ideal-int +pkg syscall (darwin-amd64), const IP_MULTICAST_IFINDEX ideal-int +pkg syscall (darwin-amd64), const IP_MULTICAST_VIF ideal-int +pkg syscall (darwin-amd64), const IP_NAT__XXX ideal-int +pkg syscall (darwin-amd64), const IP_OFFMASK ideal-int +pkg syscall (darwin-amd64), const IP_OLD_FW_ADD ideal-int +pkg syscall (darwin-amd64), const IP_OLD_FW_DEL ideal-int +pkg syscall (darwin-amd64), const IP_OLD_FW_FLUSH ideal-int +pkg syscall (darwin-amd64), const IP_OLD_FW_GET ideal-int +pkg syscall (darwin-amd64), const IP_OLD_FW_RESETLOG ideal-int +pkg syscall (darwin-amd64), const IP_OLD_FW_ZERO ideal-int +pkg syscall (darwin-amd64), const IP_OPTIONS ideal-int +pkg syscall (darwin-amd64), const IP_PKTINFO ideal-int +pkg syscall (darwin-amd64), const IP_PORTRANGE ideal-int +pkg syscall (darwin-amd64), const IP_PORTRANGE_DEFAULT ideal-int +pkg syscall (darwin-amd64), const IP_PORTRANGE_HIGH ideal-int +pkg syscall (darwin-amd64), const IP_PORTRANGE_LOW ideal-int +pkg syscall (darwin-amd64), const IP_RECVDSTADDR ideal-int +pkg syscall (darwin-amd64), const IP_RECVIF ideal-int +pkg syscall (darwin-amd64), const IP_RECVOPTS ideal-int +pkg syscall (darwin-amd64), const IP_RECVPKTINFO ideal-int +pkg syscall (darwin-amd64), const IP_RECVRETOPTS ideal-int +pkg syscall (darwin-amd64), const IP_RECVTTL ideal-int +pkg syscall (darwin-amd64), const IP_RETOPTS ideal-int +pkg syscall (darwin-amd64), const IP_RF ideal-int +pkg syscall (darwin-amd64), const IP_RSVP_OFF ideal-int +pkg syscall (darwin-amd64), const IP_RSVP_ON ideal-int +pkg syscall (darwin-amd64), const IP_RSVP_VIF_OFF ideal-int +pkg syscall (darwin-amd64), const IP_RSVP_VIF_ON ideal-int +pkg syscall (darwin-amd64), const IP_STRIPHDR ideal-int +pkg syscall (darwin-amd64), const IP_TRAFFIC_MGT_BACKGROUND ideal-int +pkg syscall (darwin-amd64), const IP_UNBLOCK_SOURCE ideal-int +pkg syscall (darwin-amd64), const LOCK_EX ideal-int +pkg syscall (darwin-amd64), const LOCK_NB ideal-int +pkg syscall (darwin-amd64), const LOCK_SH ideal-int +pkg syscall (darwin-amd64), const LOCK_UN ideal-int +pkg syscall (darwin-amd64), const MADV_CAN_REUSE ideal-int +pkg syscall (darwin-amd64), const MADV_DONTNEED ideal-int +pkg syscall (darwin-amd64), const MADV_FREE ideal-int +pkg syscall (darwin-amd64), const MADV_FREE_REUSABLE ideal-int +pkg syscall (darwin-amd64), const MADV_FREE_REUSE ideal-int +pkg syscall (darwin-amd64), const MADV_NORMAL ideal-int +pkg syscall (darwin-amd64), const MADV_RANDOM ideal-int +pkg syscall (darwin-amd64), const MADV_SEQUENTIAL ideal-int +pkg syscall (darwin-amd64), const MADV_WILLNEED ideal-int +pkg syscall (darwin-amd64), const MADV_ZERO_WIRED_PAGES ideal-int +pkg syscall (darwin-amd64), const MAP_ANON ideal-int +pkg syscall (darwin-amd64), const MAP_COPY ideal-int +pkg syscall (darwin-amd64), const MAP_FILE ideal-int +pkg syscall (darwin-amd64), const MAP_FIXED ideal-int +pkg syscall (darwin-amd64), const MAP_HASSEMAPHORE ideal-int +pkg syscall (darwin-amd64), const MAP_JIT ideal-int +pkg syscall (darwin-amd64), const MAP_NOCACHE ideal-int +pkg syscall (darwin-amd64), const MAP_NOEXTEND ideal-int +pkg syscall (darwin-amd64), const MAP_NORESERVE ideal-int +pkg syscall (darwin-amd64), const MAP_PRIVATE ideal-int +pkg syscall (darwin-amd64), const MAP_RENAME ideal-int +pkg syscall (darwin-amd64), const MAP_RESERVED0080 ideal-int +pkg syscall (darwin-amd64), const MAP_SHARED ideal-int +pkg syscall (darwin-amd64), const MCL_CURRENT ideal-int +pkg syscall (darwin-amd64), const MCL_FUTURE ideal-int +pkg syscall (darwin-amd64), const MSG_CTRUNC ideal-int +pkg syscall (darwin-amd64), const MSG_DONTROUTE ideal-int +pkg syscall (darwin-amd64), const MSG_DONTWAIT ideal-int +pkg syscall (darwin-amd64), const MSG_EOF ideal-int +pkg syscall (darwin-amd64), const MSG_EOR ideal-int +pkg syscall (darwin-amd64), const MSG_FLUSH ideal-int +pkg syscall (darwin-amd64), const MSG_HAVEMORE ideal-int +pkg syscall (darwin-amd64), const MSG_HOLD ideal-int +pkg syscall (darwin-amd64), const MSG_NEEDSA ideal-int +pkg syscall (darwin-amd64), const MSG_OOB ideal-int +pkg syscall (darwin-amd64), const MSG_PEEK ideal-int +pkg syscall (darwin-amd64), const MSG_RCVMORE ideal-int +pkg syscall (darwin-amd64), const MSG_SEND ideal-int +pkg syscall (darwin-amd64), const MSG_TRUNC ideal-int +pkg syscall (darwin-amd64), const MSG_WAITALL ideal-int +pkg syscall (darwin-amd64), const MSG_WAITSTREAM ideal-int +pkg syscall (darwin-amd64), const MS_ASYNC ideal-int +pkg syscall (darwin-amd64), const MS_DEACTIVATE ideal-int +pkg syscall (darwin-amd64), const MS_INVALIDATE ideal-int +pkg syscall (darwin-amd64), const MS_KILLPAGES ideal-int +pkg syscall (darwin-amd64), const MS_SYNC ideal-int +pkg syscall (darwin-amd64), const NAME_MAX ideal-int +pkg syscall (darwin-amd64), const NET_RT_DUMP ideal-int +pkg syscall (darwin-amd64), const NET_RT_DUMP2 ideal-int +pkg syscall (darwin-amd64), const NET_RT_FLAGS ideal-int +pkg syscall (darwin-amd64), const NET_RT_IFLIST ideal-int +pkg syscall (darwin-amd64), const NET_RT_IFLIST2 ideal-int +pkg syscall (darwin-amd64), const NET_RT_MAXID ideal-int +pkg syscall (darwin-amd64), const NET_RT_STAT ideal-int +pkg syscall (darwin-amd64), const NET_RT_TRASH ideal-int +pkg syscall (darwin-amd64), const NOTE_ABSOLUTE ideal-int +pkg syscall (darwin-amd64), const NOTE_ATTRIB ideal-int +pkg syscall (darwin-amd64), const NOTE_CHILD ideal-int +pkg syscall (darwin-amd64), const NOTE_DELETE ideal-int +pkg syscall (darwin-amd64), const NOTE_EXEC ideal-int +pkg syscall (darwin-amd64), const NOTE_EXIT ideal-int +pkg syscall (darwin-amd64), const NOTE_EXITSTATUS ideal-int +pkg syscall (darwin-amd64), const NOTE_EXTEND ideal-int +pkg syscall (darwin-amd64), const NOTE_FFAND ideal-int +pkg syscall (darwin-amd64), const NOTE_FFCOPY ideal-int +pkg syscall (darwin-amd64), const NOTE_FFCTRLMASK ideal-int +pkg syscall (darwin-amd64), const NOTE_FFLAGSMASK ideal-int +pkg syscall (darwin-amd64), const NOTE_FFNOP ideal-int +pkg syscall (darwin-amd64), const NOTE_FFOR ideal-int +pkg syscall (darwin-amd64), const NOTE_FORK ideal-int +pkg syscall (darwin-amd64), const NOTE_LINK ideal-int +pkg syscall (darwin-amd64), const NOTE_LOWAT ideal-int +pkg syscall (darwin-amd64), const NOTE_NONE ideal-int +pkg syscall (darwin-amd64), const NOTE_NSECONDS ideal-int +pkg syscall (darwin-amd64), const NOTE_PCTRLMASK ideal-int +pkg syscall (darwin-amd64), const NOTE_PDATAMASK ideal-int +pkg syscall (darwin-amd64), const NOTE_REAP ideal-int +pkg syscall (darwin-amd64), const NOTE_RENAME ideal-int +pkg syscall (darwin-amd64), const NOTE_RESOURCEEND ideal-int +pkg syscall (darwin-amd64), const NOTE_REVOKE ideal-int +pkg syscall (darwin-amd64), const NOTE_SECONDS ideal-int +pkg syscall (darwin-amd64), const NOTE_SIGNAL ideal-int +pkg syscall (darwin-amd64), const NOTE_TRACK ideal-int +pkg syscall (darwin-amd64), const NOTE_TRACKERR ideal-int +pkg syscall (darwin-amd64), const NOTE_TRIGGER ideal-int +pkg syscall (darwin-amd64), const NOTE_USECONDS ideal-int +pkg syscall (darwin-amd64), const NOTE_VM_ERROR ideal-int +pkg syscall (darwin-amd64), const NOTE_VM_PRESSURE ideal-int +pkg syscall (darwin-amd64), const NOTE_VM_PRESSURE_SUDDEN_TERMINATE ideal-int +pkg syscall (darwin-amd64), const NOTE_VM_PRESSURE_TERMINATE ideal-int +pkg syscall (darwin-amd64), const NOTE_WRITE ideal-int +pkg syscall (darwin-amd64), const O_ACCMODE ideal-int +pkg syscall (darwin-amd64), const O_ALERT ideal-int +pkg syscall (darwin-amd64), const O_DIRECTORY ideal-int +pkg syscall (darwin-amd64), const O_DSYNC ideal-int +pkg syscall (darwin-amd64), const O_EVTONLY ideal-int +pkg syscall (darwin-amd64), const O_EXLOCK ideal-int +pkg syscall (darwin-amd64), const O_FSYNC ideal-int +pkg syscall (darwin-amd64), const O_NDELAY ideal-int +pkg syscall (darwin-amd64), const O_NOFOLLOW ideal-int +pkg syscall (darwin-amd64), const O_POPUP ideal-int +pkg syscall (darwin-amd64), const O_SHLOCK ideal-int +pkg syscall (darwin-amd64), const O_SYMLINK ideal-int +pkg syscall (darwin-amd64), const PROT_EXEC ideal-int +pkg syscall (darwin-amd64), const PROT_NONE ideal-int +pkg syscall (darwin-amd64), const PROT_READ ideal-int +pkg syscall (darwin-amd64), const PROT_WRITE ideal-int +pkg syscall (darwin-amd64), const PTRACE_CONT ideal-int +pkg syscall (darwin-amd64), const PTRACE_KILL ideal-int +pkg syscall (darwin-amd64), const PTRACE_TRACEME ideal-int +pkg syscall (darwin-amd64), const PT_ATTACH ideal-int +pkg syscall (darwin-amd64), const PT_ATTACHEXC ideal-int +pkg syscall (darwin-amd64), const PT_CONTINUE ideal-int +pkg syscall (darwin-amd64), const PT_DENY_ATTACH ideal-int +pkg syscall (darwin-amd64), const PT_DETACH ideal-int +pkg syscall (darwin-amd64), const PT_FIRSTMACH ideal-int +pkg syscall (darwin-amd64), const PT_FORCEQUOTA ideal-int +pkg syscall (darwin-amd64), const PT_KILL ideal-int +pkg syscall (darwin-amd64), const PT_READ_D ideal-int +pkg syscall (darwin-amd64), const PT_READ_I ideal-int +pkg syscall (darwin-amd64), const PT_READ_U ideal-int +pkg syscall (darwin-amd64), const PT_SIGEXC ideal-int +pkg syscall (darwin-amd64), const PT_STEP ideal-int +pkg syscall (darwin-amd64), const PT_THUPDATE ideal-int +pkg syscall (darwin-amd64), const PT_TRACE_ME ideal-int +pkg syscall (darwin-amd64), const PT_WRITE_D ideal-int +pkg syscall (darwin-amd64), const PT_WRITE_I ideal-int +pkg syscall (darwin-amd64), const PT_WRITE_U ideal-int +pkg syscall (darwin-amd64), const RLIMIT_AS ideal-int +pkg syscall (darwin-amd64), const RLIMIT_CORE ideal-int +pkg syscall (darwin-amd64), const RLIMIT_CPU ideal-int +pkg syscall (darwin-amd64), const RLIMIT_DATA ideal-int +pkg syscall (darwin-amd64), const RLIMIT_FSIZE ideal-int +pkg syscall (darwin-amd64), const RLIMIT_NOFILE ideal-int +pkg syscall (darwin-amd64), const RLIMIT_STACK ideal-int +pkg syscall (darwin-amd64), const RLIM_INFINITY ideal-int +pkg syscall (darwin-amd64), const RTAX_AUTHOR ideal-int +pkg syscall (darwin-amd64), const RTAX_BRD ideal-int +pkg syscall (darwin-amd64), const RTAX_DST ideal-int +pkg syscall (darwin-amd64), const RTAX_GATEWAY ideal-int +pkg syscall (darwin-amd64), const RTAX_GENMASK ideal-int +pkg syscall (darwin-amd64), const RTAX_IFA ideal-int +pkg syscall (darwin-amd64), const RTAX_IFP ideal-int +pkg syscall (darwin-amd64), const RTAX_MAX ideal-int +pkg syscall (darwin-amd64), const RTAX_NETMASK ideal-int +pkg syscall (darwin-amd64), const RTA_AUTHOR ideal-int +pkg syscall (darwin-amd64), const RTA_BRD ideal-int +pkg syscall (darwin-amd64), const RTA_DST ideal-int +pkg syscall (darwin-amd64), const RTA_GATEWAY ideal-int +pkg syscall (darwin-amd64), const RTA_GENMASK ideal-int +pkg syscall (darwin-amd64), const RTA_IFA ideal-int +pkg syscall (darwin-amd64), const RTA_IFP ideal-int +pkg syscall (darwin-amd64), const RTA_NETMASK ideal-int +pkg syscall (darwin-amd64), const RTF_BLACKHOLE ideal-int +pkg syscall (darwin-amd64), const RTF_BROADCAST ideal-int +pkg syscall (darwin-amd64), const RTF_CLONING ideal-int +pkg syscall (darwin-amd64), const RTF_CONDEMNED ideal-int +pkg syscall (darwin-amd64), const RTF_DELCLONE ideal-int +pkg syscall (darwin-amd64), const RTF_DONE ideal-int +pkg syscall (darwin-amd64), const RTF_DYNAMIC ideal-int +pkg syscall (darwin-amd64), const RTF_GATEWAY ideal-int +pkg syscall (darwin-amd64), const RTF_HOST ideal-int +pkg syscall (darwin-amd64), const RTF_IFREF ideal-int +pkg syscall (darwin-amd64), const RTF_IFSCOPE ideal-int +pkg syscall (darwin-amd64), const RTF_LLINFO ideal-int +pkg syscall (darwin-amd64), const RTF_LOCAL ideal-int +pkg syscall (darwin-amd64), const RTF_MODIFIED ideal-int +pkg syscall (darwin-amd64), const RTF_MULTICAST ideal-int +pkg syscall (darwin-amd64), const RTF_PINNED ideal-int +pkg syscall (darwin-amd64), const RTF_PRCLONING ideal-int +pkg syscall (darwin-amd64), const RTF_PROTO1 ideal-int +pkg syscall (darwin-amd64), const RTF_PROTO2 ideal-int +pkg syscall (darwin-amd64), const RTF_PROTO3 ideal-int +pkg syscall (darwin-amd64), const RTF_REJECT ideal-int +pkg syscall (darwin-amd64), const RTF_STATIC ideal-int +pkg syscall (darwin-amd64), const RTF_UP ideal-int +pkg syscall (darwin-amd64), const RTF_WASCLONED ideal-int +pkg syscall (darwin-amd64), const RTF_XRESOLVE ideal-int +pkg syscall (darwin-amd64), const RTM_ADD ideal-int +pkg syscall (darwin-amd64), const RTM_CHANGE ideal-int +pkg syscall (darwin-amd64), const RTM_DELADDR ideal-int +pkg syscall (darwin-amd64), const RTM_DELETE ideal-int +pkg syscall (darwin-amd64), const RTM_DELMADDR ideal-int +pkg syscall (darwin-amd64), const RTM_GET ideal-int +pkg syscall (darwin-amd64), const RTM_GET2 ideal-int +pkg syscall (darwin-amd64), const RTM_IFINFO ideal-int +pkg syscall (darwin-amd64), const RTM_IFINFO2 ideal-int +pkg syscall (darwin-amd64), const RTM_LOCK ideal-int +pkg syscall (darwin-amd64), const RTM_LOSING ideal-int +pkg syscall (darwin-amd64), const RTM_MISS ideal-int +pkg syscall (darwin-amd64), const RTM_NEWADDR ideal-int +pkg syscall (darwin-amd64), const RTM_NEWMADDR ideal-int +pkg syscall (darwin-amd64), const RTM_NEWMADDR2 ideal-int +pkg syscall (darwin-amd64), const RTM_OLDADD ideal-int +pkg syscall (darwin-amd64), const RTM_OLDDEL ideal-int +pkg syscall (darwin-amd64), const RTM_REDIRECT ideal-int +pkg syscall (darwin-amd64), const RTM_RESOLVE ideal-int +pkg syscall (darwin-amd64), const RTM_RTTUNIT ideal-int +pkg syscall (darwin-amd64), const RTM_VERSION ideal-int +pkg syscall (darwin-amd64), const RTV_EXPIRE ideal-int +pkg syscall (darwin-amd64), const RTV_HOPCOUNT ideal-int +pkg syscall (darwin-amd64), const RTV_MTU ideal-int +pkg syscall (darwin-amd64), const RTV_RPIPE ideal-int +pkg syscall (darwin-amd64), const RTV_RTT ideal-int +pkg syscall (darwin-amd64), const RTV_RTTVAR ideal-int +pkg syscall (darwin-amd64), const RTV_SPIPE ideal-int +pkg syscall (darwin-amd64), const RTV_SSTHRESH ideal-int +pkg syscall (darwin-amd64), const RUSAGE_CHILDREN ideal-int +pkg syscall (darwin-amd64), const RUSAGE_SELF ideal-int +pkg syscall (darwin-amd64), const SCM_CREDS ideal-int +pkg syscall (darwin-amd64), const SCM_RIGHTS ideal-int +pkg syscall (darwin-amd64), const SCM_TIMESTAMP ideal-int +pkg syscall (darwin-amd64), const SCM_TIMESTAMP_MONOTONIC ideal-int +pkg syscall (darwin-amd64), const SIGCHLD Signal +pkg syscall (darwin-amd64), const SIGCONT Signal +pkg syscall (darwin-amd64), const SIGEMT Signal +pkg syscall (darwin-amd64), const SIGINFO Signal +pkg syscall (darwin-amd64), const SIGIO Signal +pkg syscall (darwin-amd64), const SIGIOT Signal +pkg syscall (darwin-amd64), const SIGPROF Signal +pkg syscall (darwin-amd64), const SIGSTOP Signal +pkg syscall (darwin-amd64), const SIGSYS Signal +pkg syscall (darwin-amd64), const SIGTSTP Signal +pkg syscall (darwin-amd64), const SIGTTIN Signal +pkg syscall (darwin-amd64), const SIGTTOU Signal +pkg syscall (darwin-amd64), const SIGURG Signal +pkg syscall (darwin-amd64), const SIGUSR1 Signal +pkg syscall (darwin-amd64), const SIGUSR2 Signal +pkg syscall (darwin-amd64), const SIGVTALRM Signal +pkg syscall (darwin-amd64), const SIGWINCH Signal +pkg syscall (darwin-amd64), const SIGXCPU Signal +pkg syscall (darwin-amd64), const SIGXFSZ Signal +pkg syscall (darwin-amd64), const SIOCADDMULTI ideal-int +pkg syscall (darwin-amd64), const SIOCAIFADDR ideal-int +pkg syscall (darwin-amd64), const SIOCALIFADDR ideal-int +pkg syscall (darwin-amd64), const SIOCARPIPLL ideal-int +pkg syscall (darwin-amd64), const SIOCATMARK ideal-int +pkg syscall (darwin-amd64), const SIOCAUTOADDR ideal-int +pkg syscall (darwin-amd64), const SIOCAUTONETMASK ideal-int +pkg syscall (darwin-amd64), const SIOCDELMULTI ideal-int +pkg syscall (darwin-amd64), const SIOCDIFADDR ideal-int +pkg syscall (darwin-amd64), const SIOCDIFPHYADDR ideal-int +pkg syscall (darwin-amd64), const SIOCDLIFADDR ideal-int +pkg syscall (darwin-amd64), const SIOCGDRVSPEC ideal-int +pkg syscall (darwin-amd64), const SIOCGETSGCNT ideal-int +pkg syscall (darwin-amd64), const SIOCGETVIFCNT ideal-int +pkg syscall (darwin-amd64), const SIOCGETVLAN ideal-int +pkg syscall (darwin-amd64), const SIOCGHIWAT ideal-int +pkg syscall (darwin-amd64), const SIOCGIFADDR ideal-int +pkg syscall (darwin-amd64), const SIOCGIFALTMTU ideal-int +pkg syscall (darwin-amd64), const SIOCGIFASYNCMAP ideal-int +pkg syscall (darwin-amd64), const SIOCGIFBOND ideal-int +pkg syscall (darwin-amd64), const SIOCGIFBRDADDR ideal-int +pkg syscall (darwin-amd64), const SIOCGIFCAP ideal-int +pkg syscall (darwin-amd64), const SIOCGIFCONF ideal-int +pkg syscall (darwin-amd64), const SIOCGIFDEVMTU ideal-int +pkg syscall (darwin-amd64), const SIOCGIFDSTADDR ideal-int +pkg syscall (darwin-amd64), const SIOCGIFFLAGS ideal-int +pkg syscall (darwin-amd64), const SIOCGIFGENERIC ideal-int +pkg syscall (darwin-amd64), const SIOCGIFKPI ideal-int +pkg syscall (darwin-amd64), const SIOCGIFMAC ideal-int +pkg syscall (darwin-amd64), const SIOCGIFMEDIA ideal-int +pkg syscall (darwin-amd64), const SIOCGIFMETRIC ideal-int +pkg syscall (darwin-amd64), const SIOCGIFMTU ideal-int +pkg syscall (darwin-amd64), const SIOCGIFNETMASK ideal-int +pkg syscall (darwin-amd64), const SIOCGIFPDSTADDR ideal-int +pkg syscall (darwin-amd64), const SIOCGIFPHYS ideal-int +pkg syscall (darwin-amd64), const SIOCGIFPSRCADDR ideal-int +pkg syscall (darwin-amd64), const SIOCGIFSTATUS ideal-int +pkg syscall (darwin-amd64), const SIOCGIFVLAN ideal-int +pkg syscall (darwin-amd64), const SIOCGIFWAKEFLAGS ideal-int +pkg syscall (darwin-amd64), const SIOCGLIFADDR ideal-int +pkg syscall (darwin-amd64), const SIOCGLIFPHYADDR ideal-int +pkg syscall (darwin-amd64), const SIOCGLOWAT ideal-int +pkg syscall (darwin-amd64), const SIOCGPGRP ideal-int +pkg syscall (darwin-amd64), const SIOCIFCREATE ideal-int +pkg syscall (darwin-amd64), const SIOCIFCREATE2 ideal-int +pkg syscall (darwin-amd64), const SIOCIFDESTROY ideal-int +pkg syscall (darwin-amd64), const SIOCRSLVMULTI ideal-int +pkg syscall (darwin-amd64), const SIOCSDRVSPEC ideal-int +pkg syscall (darwin-amd64), const SIOCSETVLAN ideal-int +pkg syscall (darwin-amd64), const SIOCSHIWAT ideal-int +pkg syscall (darwin-amd64), const SIOCSIFADDR ideal-int +pkg syscall (darwin-amd64), const SIOCSIFALTMTU ideal-int +pkg syscall (darwin-amd64), const SIOCSIFASYNCMAP ideal-int +pkg syscall (darwin-amd64), const SIOCSIFBOND ideal-int +pkg syscall (darwin-amd64), const SIOCSIFBRDADDR ideal-int +pkg syscall (darwin-amd64), const SIOCSIFCAP ideal-int +pkg syscall (darwin-amd64), const SIOCSIFDSTADDR ideal-int +pkg syscall (darwin-amd64), const SIOCSIFFLAGS ideal-int +pkg syscall (darwin-amd64), const SIOCSIFGENERIC ideal-int +pkg syscall (darwin-amd64), const SIOCSIFKPI ideal-int +pkg syscall (darwin-amd64), const SIOCSIFLLADDR ideal-int +pkg syscall (darwin-amd64), const SIOCSIFMAC ideal-int +pkg syscall (darwin-amd64), const SIOCSIFMEDIA ideal-int +pkg syscall (darwin-amd64), const SIOCSIFMETRIC ideal-int +pkg syscall (darwin-amd64), const SIOCSIFMTU ideal-int +pkg syscall (darwin-amd64), const SIOCSIFNETMASK ideal-int +pkg syscall (darwin-amd64), const SIOCSIFPHYADDR ideal-int +pkg syscall (darwin-amd64), const SIOCSIFPHYS ideal-int +pkg syscall (darwin-amd64), const SIOCSIFVLAN ideal-int +pkg syscall (darwin-amd64), const SIOCSLIFPHYADDR ideal-int +pkg syscall (darwin-amd64), const SIOCSLOWAT ideal-int +pkg syscall (darwin-amd64), const SIOCSPGRP ideal-int +pkg syscall (darwin-amd64), const SOCK_MAXADDRLEN ideal-int +pkg syscall (darwin-amd64), const SOCK_RDM ideal-int +pkg syscall (darwin-amd64), const SO_ACCEPTCONN ideal-int +pkg syscall (darwin-amd64), const SO_DEBUG ideal-int +pkg syscall (darwin-amd64), const SO_DONTTRUNC ideal-int +pkg syscall (darwin-amd64), const SO_ERROR ideal-int +pkg syscall (darwin-amd64), const SO_LABEL ideal-int +pkg syscall (darwin-amd64), const SO_LINGER_SEC ideal-int +pkg syscall (darwin-amd64), const SO_NKE ideal-int +pkg syscall (darwin-amd64), const SO_NOADDRERR ideal-int +pkg syscall (darwin-amd64), const SO_NOSIGPIPE ideal-int +pkg syscall (darwin-amd64), const SO_NOTIFYCONFLICT ideal-int +pkg syscall (darwin-amd64), const SO_NP_EXTENSIONS ideal-int +pkg syscall (darwin-amd64), const SO_NREAD ideal-int +pkg syscall (darwin-amd64), const SO_NWRITE ideal-int +pkg syscall (darwin-amd64), const SO_OOBINLINE ideal-int +pkg syscall (darwin-amd64), const SO_PEERLABEL ideal-int +pkg syscall (darwin-amd64), const SO_RANDOMPORT ideal-int +pkg syscall (darwin-amd64), const SO_RCVLOWAT ideal-int +pkg syscall (darwin-amd64), const SO_RCVTIMEO ideal-int +pkg syscall (darwin-amd64), const SO_RESTRICTIONS ideal-int +pkg syscall (darwin-amd64), const SO_RESTRICT_DENYIN ideal-int +pkg syscall (darwin-amd64), const SO_RESTRICT_DENYOUT ideal-int +pkg syscall (darwin-amd64), const SO_RESTRICT_DENYSET ideal-int +pkg syscall (darwin-amd64), const SO_REUSEPORT ideal-int +pkg syscall (darwin-amd64), const SO_REUSESHAREUID ideal-int +pkg syscall (darwin-amd64), const SO_SNDLOWAT ideal-int +pkg syscall (darwin-amd64), const SO_SNDTIMEO ideal-int +pkg syscall (darwin-amd64), const SO_TIMESTAMP ideal-int +pkg syscall (darwin-amd64), const SO_TIMESTAMP_MONOTONIC ideal-int +pkg syscall (darwin-amd64), const SO_TYPE ideal-int +pkg syscall (darwin-amd64), const SO_UPCALLCLOSEWAIT ideal-int +pkg syscall (darwin-amd64), const SO_USELOOPBACK ideal-int +pkg syscall (darwin-amd64), const SO_WANTMORE ideal-int +pkg syscall (darwin-amd64), const SO_WANTOOBFLAG ideal-int +pkg syscall (darwin-amd64), const SYS_ACCEPT ideal-int +pkg syscall (darwin-amd64), const SYS_ACCEPT_NOCANCEL ideal-int +pkg syscall (darwin-amd64), const SYS_ACCESS ideal-int +pkg syscall (darwin-amd64), const SYS_ACCESS_EXTENDED ideal-int +pkg syscall (darwin-amd64), const SYS_ACCT ideal-int +pkg syscall (darwin-amd64), const SYS_ADD_PROFIL ideal-int +pkg syscall (darwin-amd64), const SYS_ADJTIME ideal-int +pkg syscall (darwin-amd64), const SYS_AIO_CANCEL ideal-int +pkg syscall (darwin-amd64), const SYS_AIO_ERROR ideal-int +pkg syscall (darwin-amd64), const SYS_AIO_FSYNC ideal-int +pkg syscall (darwin-amd64), const SYS_AIO_READ ideal-int +pkg syscall (darwin-amd64), const SYS_AIO_RETURN ideal-int +pkg syscall (darwin-amd64), const SYS_AIO_SUSPEND ideal-int +pkg syscall (darwin-amd64), const SYS_AIO_SUSPEND_NOCANCEL ideal-int +pkg syscall (darwin-amd64), const SYS_AIO_WRITE ideal-int +pkg syscall (darwin-amd64), const SYS_ATGETMSG ideal-int +pkg syscall (darwin-amd64), const SYS_ATPGETREQ ideal-int +pkg syscall (darwin-amd64), const SYS_ATPGETRSP ideal-int +pkg syscall (darwin-amd64), const SYS_ATPSNDREQ ideal-int +pkg syscall (darwin-amd64), const SYS_ATPSNDRSP ideal-int +pkg syscall (darwin-amd64), const SYS_ATPUTMSG ideal-int +pkg syscall (darwin-amd64), const SYS_ATSOCKET ideal-int +pkg syscall (darwin-amd64), const SYS_AUDIT ideal-int +pkg syscall (darwin-amd64), const SYS_AUDITCTL ideal-int +pkg syscall (darwin-amd64), const SYS_AUDITON ideal-int +pkg syscall (darwin-amd64), const SYS_AUDIT_SESSION_JOIN ideal-int +pkg syscall (darwin-amd64), const SYS_AUDIT_SESSION_PORT ideal-int +pkg syscall (darwin-amd64), const SYS_AUDIT_SESSION_SELF ideal-int +pkg syscall (darwin-amd64), const SYS_BIND ideal-int +pkg syscall (darwin-amd64), const SYS_BSDTHREAD_CREATE ideal-int +pkg syscall (darwin-amd64), const SYS_BSDTHREAD_REGISTER ideal-int +pkg syscall (darwin-amd64), const SYS_BSDTHREAD_TERMINATE ideal-int +pkg syscall (darwin-amd64), const SYS_CHDIR ideal-int +pkg syscall (darwin-amd64), const SYS_CHFLAGS ideal-int +pkg syscall (darwin-amd64), const SYS_CHMOD ideal-int +pkg syscall (darwin-amd64), const SYS_CHMOD_EXTENDED ideal-int +pkg syscall (darwin-amd64), const SYS_CHOWN ideal-int +pkg syscall (darwin-amd64), const SYS_CHROOT ideal-int +pkg syscall (darwin-amd64), const SYS_CHUD ideal-int +pkg syscall (darwin-amd64), const SYS_CLOSE ideal-int +pkg syscall (darwin-amd64), const SYS_CLOSE_NOCANCEL ideal-int +pkg syscall (darwin-amd64), const SYS_CONNECT ideal-int +pkg syscall (darwin-amd64), const SYS_CONNECT_NOCANCEL ideal-int +pkg syscall (darwin-amd64), const SYS_COPYFILE ideal-int +pkg syscall (darwin-amd64), const SYS_CSOPS ideal-int +pkg syscall (darwin-amd64), const SYS_DELETE ideal-int +pkg syscall (darwin-amd64), const SYS_DUP ideal-int +pkg syscall (darwin-amd64), const SYS_DUP2 ideal-int +pkg syscall (darwin-amd64), const SYS_EXCHANGEDATA ideal-int +pkg syscall (darwin-amd64), const SYS_EXECVE ideal-int +pkg syscall (darwin-amd64), const SYS_EXIT ideal-int +pkg syscall (darwin-amd64), const SYS_FCHDIR ideal-int +pkg syscall (darwin-amd64), const SYS_FCHFLAGS ideal-int +pkg syscall (darwin-amd64), const SYS_FCHMOD ideal-int +pkg syscall (darwin-amd64), const SYS_FCHMOD_EXTENDED ideal-int +pkg syscall (darwin-amd64), const SYS_FCHOWN ideal-int +pkg syscall (darwin-amd64), const SYS_FCNTL ideal-int +pkg syscall (darwin-amd64), const SYS_FCNTL_NOCANCEL ideal-int +pkg syscall (darwin-amd64), const SYS_FDATASYNC ideal-int +pkg syscall (darwin-amd64), const SYS_FFSCTL ideal-int +pkg syscall (darwin-amd64), const SYS_FGETATTRLIST ideal-int +pkg syscall (darwin-amd64), const SYS_FGETXATTR ideal-int +pkg syscall (darwin-amd64), const SYS_FHOPEN ideal-int +pkg syscall (darwin-amd64), const SYS_FILEPORT_MAKEFD ideal-int +pkg syscall (darwin-amd64), const SYS_FILEPORT_MAKEPORT ideal-int +pkg syscall (darwin-amd64), const SYS_FLISTXATTR ideal-int +pkg syscall (darwin-amd64), const SYS_FLOCK ideal-int +pkg syscall (darwin-amd64), const SYS_FORK ideal-int +pkg syscall (darwin-amd64), const SYS_FPATHCONF ideal-int +pkg syscall (darwin-amd64), const SYS_FREMOVEXATTR ideal-int +pkg syscall (darwin-amd64), const SYS_FSCTL ideal-int +pkg syscall (darwin-amd64), const SYS_FSETATTRLIST ideal-int +pkg syscall (darwin-amd64), const SYS_FSETXATTR ideal-int +pkg syscall (darwin-amd64), const SYS_FSGETPATH ideal-int +pkg syscall (darwin-amd64), const SYS_FSTAT ideal-int +pkg syscall (darwin-amd64), const SYS_FSTAT64 ideal-int +pkg syscall (darwin-amd64), const SYS_FSTAT64_EXTENDED ideal-int +pkg syscall (darwin-amd64), const SYS_FSTATFS ideal-int +pkg syscall (darwin-amd64), const SYS_FSTATFS64 ideal-int +pkg syscall (darwin-amd64), const SYS_FSTATV ideal-int +pkg syscall (darwin-amd64), const SYS_FSTAT_EXTENDED ideal-int +pkg syscall (darwin-amd64), const SYS_FSYNC ideal-int +pkg syscall (darwin-amd64), const SYS_FSYNC_NOCANCEL ideal-int +pkg syscall (darwin-amd64), const SYS_FTRUNCATE ideal-int +pkg syscall (darwin-amd64), const SYS_FUTIMES ideal-int +pkg syscall (darwin-amd64), const SYS_GETATTRLIST ideal-int +pkg syscall (darwin-amd64), const SYS_GETAUDIT ideal-int +pkg syscall (darwin-amd64), const SYS_GETAUDIT_ADDR ideal-int +pkg syscall (darwin-amd64), const SYS_GETAUID ideal-int +pkg syscall (darwin-amd64), const SYS_GETDIRENTRIES ideal-int +pkg syscall (darwin-amd64), const SYS_GETDIRENTRIES64 ideal-int +pkg syscall (darwin-amd64), const SYS_GETDIRENTRIESATTR ideal-int +pkg syscall (darwin-amd64), const SYS_GETDTABLESIZE ideal-int +pkg syscall (darwin-amd64), const SYS_GETEGID ideal-int +pkg syscall (darwin-amd64), const SYS_GETEUID ideal-int +pkg syscall (darwin-amd64), const SYS_GETFH ideal-int +pkg syscall (darwin-amd64), const SYS_GETFSSTAT ideal-int +pkg syscall (darwin-amd64), const SYS_GETFSSTAT64 ideal-int +pkg syscall (darwin-amd64), const SYS_GETGID ideal-int +pkg syscall (darwin-amd64), const SYS_GETGROUPS ideal-int +pkg syscall (darwin-amd64), const SYS_GETHOSTUUID ideal-int +pkg syscall (darwin-amd64), const SYS_GETITIMER ideal-int +pkg syscall (darwin-amd64), const SYS_GETLCID ideal-int +pkg syscall (darwin-amd64), const SYS_GETLOGIN ideal-int +pkg syscall (darwin-amd64), const SYS_GETPEERNAME ideal-int +pkg syscall (darwin-amd64), const SYS_GETPGID ideal-int +pkg syscall (darwin-amd64), const SYS_GETPGRP ideal-int +pkg syscall (darwin-amd64), const SYS_GETPID ideal-int +pkg syscall (darwin-amd64), const SYS_GETPPID ideal-int +pkg syscall (darwin-amd64), const SYS_GETPRIORITY ideal-int +pkg syscall (darwin-amd64), const SYS_GETRLIMIT ideal-int +pkg syscall (darwin-amd64), const SYS_GETRUSAGE ideal-int +pkg syscall (darwin-amd64), const SYS_GETSGROUPS ideal-int +pkg syscall (darwin-amd64), const SYS_GETSID ideal-int +pkg syscall (darwin-amd64), const SYS_GETSOCKNAME ideal-int +pkg syscall (darwin-amd64), const SYS_GETSOCKOPT ideal-int +pkg syscall (darwin-amd64), const SYS_GETTID ideal-int +pkg syscall (darwin-amd64), const SYS_GETTIMEOFDAY ideal-int +pkg syscall (darwin-amd64), const SYS_GETUID ideal-int +pkg syscall (darwin-amd64), const SYS_GETWGROUPS ideal-int +pkg syscall (darwin-amd64), const SYS_GETXATTR ideal-int +pkg syscall (darwin-amd64), const SYS_IDENTITYSVC ideal-int +pkg syscall (darwin-amd64), const SYS_INITGROUPS ideal-int +pkg syscall (darwin-amd64), const SYS_IOCTL ideal-int +pkg syscall (darwin-amd64), const SYS_IOPOLICYSYS ideal-int +pkg syscall (darwin-amd64), const SYS_ISSETUGID ideal-int +pkg syscall (darwin-amd64), const SYS_KDEBUG_TRACE ideal-int +pkg syscall (darwin-amd64), const SYS_KEVENT ideal-int +pkg syscall (darwin-amd64), const SYS_KEVENT64 ideal-int +pkg syscall (darwin-amd64), const SYS_KILL ideal-int +pkg syscall (darwin-amd64), const SYS_KQUEUE ideal-int +pkg syscall (darwin-amd64), const SYS_LCHOWN ideal-int +pkg syscall (darwin-amd64), const SYS_LINK ideal-int +pkg syscall (darwin-amd64), const SYS_LIO_LISTIO ideal-int +pkg syscall (darwin-amd64), const SYS_LISTEN ideal-int +pkg syscall (darwin-amd64), const SYS_LISTXATTR ideal-int +pkg syscall (darwin-amd64), const SYS_LSEEK ideal-int +pkg syscall (darwin-amd64), const SYS_LSTAT ideal-int +pkg syscall (darwin-amd64), const SYS_LSTAT64 ideal-int +pkg syscall (darwin-amd64), const SYS_LSTAT64_EXTENDED ideal-int +pkg syscall (darwin-amd64), const SYS_LSTATV ideal-int +pkg syscall (darwin-amd64), const SYS_LSTAT_EXTENDED ideal-int +pkg syscall (darwin-amd64), const SYS_MADVISE ideal-int +pkg syscall (darwin-amd64), const SYS_MAXSYSCALL ideal-int +pkg syscall (darwin-amd64), const SYS_MINCORE ideal-int +pkg syscall (darwin-amd64), const SYS_MINHERIT ideal-int +pkg syscall (darwin-amd64), const SYS_MKCOMPLEX ideal-int +pkg syscall (darwin-amd64), const SYS_MKDIR ideal-int +pkg syscall (darwin-amd64), const SYS_MKDIR_EXTENDED ideal-int +pkg syscall (darwin-amd64), const SYS_MKFIFO ideal-int +pkg syscall (darwin-amd64), const SYS_MKFIFO_EXTENDED ideal-int +pkg syscall (darwin-amd64), const SYS_MKNOD ideal-int +pkg syscall (darwin-amd64), const SYS_MLOCK ideal-int +pkg syscall (darwin-amd64), const SYS_MLOCKALL ideal-int +pkg syscall (darwin-amd64), const SYS_MMAP ideal-int +pkg syscall (darwin-amd64), const SYS_MODWATCH ideal-int +pkg syscall (darwin-amd64), const SYS_MOUNT ideal-int +pkg syscall (darwin-amd64), const SYS_MPROTECT ideal-int +pkg syscall (darwin-amd64), const SYS_MSGCTL ideal-int +pkg syscall (darwin-amd64), const SYS_MSGGET ideal-int +pkg syscall (darwin-amd64), const SYS_MSGRCV ideal-int +pkg syscall (darwin-amd64), const SYS_MSGRCV_NOCANCEL ideal-int +pkg syscall (darwin-amd64), const SYS_MSGSND ideal-int +pkg syscall (darwin-amd64), const SYS_MSGSND_NOCANCEL ideal-int +pkg syscall (darwin-amd64), const SYS_MSGSYS ideal-int +pkg syscall (darwin-amd64), const SYS_MSYNC ideal-int +pkg syscall (darwin-amd64), const SYS_MSYNC_NOCANCEL ideal-int +pkg syscall (darwin-amd64), const SYS_MUNLOCK ideal-int +pkg syscall (darwin-amd64), const SYS_MUNLOCKALL ideal-int +pkg syscall (darwin-amd64), const SYS_MUNMAP ideal-int +pkg syscall (darwin-amd64), const SYS_NFSCLNT ideal-int +pkg syscall (darwin-amd64), const SYS_NFSSVC ideal-int +pkg syscall (darwin-amd64), const SYS_OPEN ideal-int +pkg syscall (darwin-amd64), const SYS_OPEN_EXTENDED ideal-int +pkg syscall (darwin-amd64), const SYS_OPEN_NOCANCEL ideal-int +pkg syscall (darwin-amd64), const SYS_PATHCONF ideal-int +pkg syscall (darwin-amd64), const SYS_PID_HIBERNATE ideal-int +pkg syscall (darwin-amd64), const SYS_PID_RESUME ideal-int +pkg syscall (darwin-amd64), const SYS_PID_SHUTDOWN_SOCKETS ideal-int +pkg syscall (darwin-amd64), const SYS_PID_SUSPEND ideal-int +pkg syscall (darwin-amd64), const SYS_PIPE ideal-int +pkg syscall (darwin-amd64), const SYS_POLL ideal-int +pkg syscall (darwin-amd64), const SYS_POLL_NOCANCEL ideal-int +pkg syscall (darwin-amd64), const SYS_POSIX_SPAWN ideal-int +pkg syscall (darwin-amd64), const SYS_PREAD ideal-int +pkg syscall (darwin-amd64), const SYS_PREAD_NOCANCEL ideal-int +pkg syscall (darwin-amd64), const SYS_PROCESS_POLICY ideal-int +pkg syscall (darwin-amd64), const SYS_PROC_INFO ideal-int +pkg syscall (darwin-amd64), const SYS_PROFIL ideal-int +pkg syscall (darwin-amd64), const SYS_PSYNCH_CVBROAD ideal-int +pkg syscall (darwin-amd64), const SYS_PSYNCH_CVCLRPREPOST ideal-int +pkg syscall (darwin-amd64), const SYS_PSYNCH_CVSIGNAL ideal-int +pkg syscall (darwin-amd64), const SYS_PSYNCH_CVWAIT ideal-int +pkg syscall (darwin-amd64), const SYS_PSYNCH_MUTEXDROP ideal-int +pkg syscall (darwin-amd64), const SYS_PSYNCH_MUTEXWAIT ideal-int +pkg syscall (darwin-amd64), const SYS_PSYNCH_RW_DOWNGRADE ideal-int +pkg syscall (darwin-amd64), const SYS_PSYNCH_RW_LONGRDLOCK ideal-int +pkg syscall (darwin-amd64), const SYS_PSYNCH_RW_RDLOCK ideal-int +pkg syscall (darwin-amd64), const SYS_PSYNCH_RW_UNLOCK ideal-int +pkg syscall (darwin-amd64), const SYS_PSYNCH_RW_UNLOCK2 ideal-int +pkg syscall (darwin-amd64), const SYS_PSYNCH_RW_UPGRADE ideal-int +pkg syscall (darwin-amd64), const SYS_PSYNCH_RW_WRLOCK ideal-int +pkg syscall (darwin-amd64), const SYS_PSYNCH_RW_YIELDWRLOCK ideal-int +pkg syscall (darwin-amd64), const SYS_PTRACE ideal-int +pkg syscall (darwin-amd64), const SYS_PWRITE ideal-int +pkg syscall (darwin-amd64), const SYS_PWRITE_NOCANCEL ideal-int +pkg syscall (darwin-amd64), const SYS_QUOTACTL ideal-int +pkg syscall (darwin-amd64), const SYS_READ ideal-int +pkg syscall (darwin-amd64), const SYS_READLINK ideal-int +pkg syscall (darwin-amd64), const SYS_READV ideal-int +pkg syscall (darwin-amd64), const SYS_READV_NOCANCEL ideal-int +pkg syscall (darwin-amd64), const SYS_READ_NOCANCEL ideal-int +pkg syscall (darwin-amd64), const SYS_REBOOT ideal-int +pkg syscall (darwin-amd64), const SYS_RECVFROM ideal-int +pkg syscall (darwin-amd64), const SYS_RECVFROM_NOCANCEL ideal-int +pkg syscall (darwin-amd64), const SYS_RECVMSG ideal-int +pkg syscall (darwin-amd64), const SYS_RECVMSG_NOCANCEL ideal-int +pkg syscall (darwin-amd64), const SYS_REMOVEXATTR ideal-int +pkg syscall (darwin-amd64), const SYS_RENAME ideal-int +pkg syscall (darwin-amd64), const SYS_REVOKE ideal-int +pkg syscall (darwin-amd64), const SYS_RMDIR ideal-int +pkg syscall (darwin-amd64), const SYS_SEARCHFS ideal-int +pkg syscall (darwin-amd64), const SYS_SELECT ideal-int +pkg syscall (darwin-amd64), const SYS_SELECT_NOCANCEL ideal-int +pkg syscall (darwin-amd64), const SYS_SEMCTL ideal-int +pkg syscall (darwin-amd64), const SYS_SEMGET ideal-int +pkg syscall (darwin-amd64), const SYS_SEMOP ideal-int +pkg syscall (darwin-amd64), const SYS_SEMSYS ideal-int +pkg syscall (darwin-amd64), const SYS_SEM_CLOSE ideal-int +pkg syscall (darwin-amd64), const SYS_SEM_DESTROY ideal-int +pkg syscall (darwin-amd64), const SYS_SEM_GETVALUE ideal-int +pkg syscall (darwin-amd64), const SYS_SEM_INIT ideal-int +pkg syscall (darwin-amd64), const SYS_SEM_OPEN ideal-int +pkg syscall (darwin-amd64), const SYS_SEM_POST ideal-int +pkg syscall (darwin-amd64), const SYS_SEM_TRYWAIT ideal-int +pkg syscall (darwin-amd64), const SYS_SEM_UNLINK ideal-int +pkg syscall (darwin-amd64), const SYS_SEM_WAIT ideal-int +pkg syscall (darwin-amd64), const SYS_SEM_WAIT_NOCANCEL ideal-int +pkg syscall (darwin-amd64), const SYS_SENDFILE ideal-int +pkg syscall (darwin-amd64), const SYS_SENDMSG ideal-int +pkg syscall (darwin-amd64), const SYS_SENDMSG_NOCANCEL ideal-int +pkg syscall (darwin-amd64), const SYS_SENDTO ideal-int +pkg syscall (darwin-amd64), const SYS_SENDTO_NOCANCEL ideal-int +pkg syscall (darwin-amd64), const SYS_SETATTRLIST ideal-int +pkg syscall (darwin-amd64), const SYS_SETAUDIT ideal-int +pkg syscall (darwin-amd64), const SYS_SETAUDIT_ADDR ideal-int +pkg syscall (darwin-amd64), const SYS_SETAUID ideal-int +pkg syscall (darwin-amd64), const SYS_SETEGID ideal-int +pkg syscall (darwin-amd64), const SYS_SETEUID ideal-int +pkg syscall (darwin-amd64), const SYS_SETGID ideal-int +pkg syscall (darwin-amd64), const SYS_SETGROUPS ideal-int +pkg syscall (darwin-amd64), const SYS_SETITIMER ideal-int +pkg syscall (darwin-amd64), const SYS_SETLCID ideal-int +pkg syscall (darwin-amd64), const SYS_SETLOGIN ideal-int +pkg syscall (darwin-amd64), const SYS_SETPGID ideal-int +pkg syscall (darwin-amd64), const SYS_SETPRIORITY ideal-int +pkg syscall (darwin-amd64), const SYS_SETPRIVEXEC ideal-int +pkg syscall (darwin-amd64), const SYS_SETREGID ideal-int +pkg syscall (darwin-amd64), const SYS_SETREUID ideal-int +pkg syscall (darwin-amd64), const SYS_SETRLIMIT ideal-int +pkg syscall (darwin-amd64), const SYS_SETSGROUPS ideal-int +pkg syscall (darwin-amd64), const SYS_SETSID ideal-int +pkg syscall (darwin-amd64), const SYS_SETSOCKOPT ideal-int +pkg syscall (darwin-amd64), const SYS_SETTID ideal-int +pkg syscall (darwin-amd64), const SYS_SETTID_WITH_PID ideal-int +pkg syscall (darwin-amd64), const SYS_SETTIMEOFDAY ideal-int +pkg syscall (darwin-amd64), const SYS_SETUID ideal-int +pkg syscall (darwin-amd64), const SYS_SETWGROUPS ideal-int +pkg syscall (darwin-amd64), const SYS_SETXATTR ideal-int +pkg syscall (darwin-amd64), const SYS_SHARED_REGION_CHECK_NP ideal-int +pkg syscall (darwin-amd64), const SYS_SHARED_REGION_MAP_AND_SLIDE_NP ideal-int +pkg syscall (darwin-amd64), const SYS_SHMAT ideal-int +pkg syscall (darwin-amd64), const SYS_SHMCTL ideal-int +pkg syscall (darwin-amd64), const SYS_SHMDT ideal-int +pkg syscall (darwin-amd64), const SYS_SHMGET ideal-int +pkg syscall (darwin-amd64), const SYS_SHMSYS ideal-int +pkg syscall (darwin-amd64), const SYS_SHM_OPEN ideal-int +pkg syscall (darwin-amd64), const SYS_SHM_UNLINK ideal-int +pkg syscall (darwin-amd64), const SYS_SHUTDOWN ideal-int +pkg syscall (darwin-amd64), const SYS_SIGACTION ideal-int +pkg syscall (darwin-amd64), const SYS_SIGALTSTACK ideal-int +pkg syscall (darwin-amd64), const SYS_SIGPENDING ideal-int +pkg syscall (darwin-amd64), const SYS_SIGPROCMASK ideal-int +pkg syscall (darwin-amd64), const SYS_SIGRETURN ideal-int +pkg syscall (darwin-amd64), const SYS_SIGSUSPEND ideal-int +pkg syscall (darwin-amd64), const SYS_SIGSUSPEND_NOCANCEL ideal-int +pkg syscall (darwin-amd64), const SYS_SOCKET ideal-int +pkg syscall (darwin-amd64), const SYS_SOCKETPAIR ideal-int +pkg syscall (darwin-amd64), const SYS_STACK_SNAPSHOT ideal-int +pkg syscall (darwin-amd64), const SYS_STAT ideal-int +pkg syscall (darwin-amd64), const SYS_STAT64 ideal-int +pkg syscall (darwin-amd64), const SYS_STAT64_EXTENDED ideal-int +pkg syscall (darwin-amd64), const SYS_STATFS ideal-int +pkg syscall (darwin-amd64), const SYS_STATFS64 ideal-int +pkg syscall (darwin-amd64), const SYS_STATV ideal-int +pkg syscall (darwin-amd64), const SYS_STAT_EXTENDED ideal-int +pkg syscall (darwin-amd64), const SYS_SWAPON ideal-int +pkg syscall (darwin-amd64), const SYS_SYMLINK ideal-int +pkg syscall (darwin-amd64), const SYS_SYNC ideal-int +pkg syscall (darwin-amd64), const SYS_SYSCALL ideal-int +pkg syscall (darwin-amd64), const SYS_THREAD_SELFID ideal-int +pkg syscall (darwin-amd64), const SYS_TRUNCATE ideal-int +pkg syscall (darwin-amd64), const SYS_UMASK ideal-int +pkg syscall (darwin-amd64), const SYS_UMASK_EXTENDED ideal-int +pkg syscall (darwin-amd64), const SYS_UNDELETE ideal-int +pkg syscall (darwin-amd64), const SYS_UNLINK ideal-int +pkg syscall (darwin-amd64), const SYS_UNMOUNT ideal-int +pkg syscall (darwin-amd64), const SYS_UTIMES ideal-int +pkg syscall (darwin-amd64), const SYS_VFORK ideal-int +pkg syscall (darwin-amd64), const SYS_VM_PRESSURE_MONITOR ideal-int +pkg syscall (darwin-amd64), const SYS_WAIT4 ideal-int +pkg syscall (darwin-amd64), const SYS_WAIT4_NOCANCEL ideal-int +pkg syscall (darwin-amd64), const SYS_WAITEVENT ideal-int +pkg syscall (darwin-amd64), const SYS_WAITID ideal-int +pkg syscall (darwin-amd64), const SYS_WAITID_NOCANCEL ideal-int +pkg syscall (darwin-amd64), const SYS_WATCHEVENT ideal-int +pkg syscall (darwin-amd64), const SYS_WORKQ_KERNRETURN ideal-int +pkg syscall (darwin-amd64), const SYS_WORKQ_OPEN ideal-int +pkg syscall (darwin-amd64), const SYS_WRITE ideal-int +pkg syscall (darwin-amd64), const SYS_WRITEV ideal-int +pkg syscall (darwin-amd64), const SYS_WRITEV_NOCANCEL ideal-int +pkg syscall (darwin-amd64), const SYS_WRITE_NOCANCEL ideal-int +pkg syscall (darwin-amd64), const SYS___DISABLE_THREADSIGNAL ideal-int +pkg syscall (darwin-amd64), const SYS___MAC_EXECVE ideal-int +pkg syscall (darwin-amd64), const SYS___MAC_GETFSSTAT ideal-int +pkg syscall (darwin-amd64), const SYS___MAC_GET_FD ideal-int +pkg syscall (darwin-amd64), const SYS___MAC_GET_FILE ideal-int +pkg syscall (darwin-amd64), const SYS___MAC_GET_LCID ideal-int +pkg syscall (darwin-amd64), const SYS___MAC_GET_LCTX ideal-int +pkg syscall (darwin-amd64), const SYS___MAC_GET_LINK ideal-int +pkg syscall (darwin-amd64), const SYS___MAC_GET_MOUNT ideal-int +pkg syscall (darwin-amd64), const SYS___MAC_GET_PID ideal-int +pkg syscall (darwin-amd64), const SYS___MAC_GET_PROC ideal-int +pkg syscall (darwin-amd64), const SYS___MAC_MOUNT ideal-int +pkg syscall (darwin-amd64), const SYS___MAC_SET_FD ideal-int +pkg syscall (darwin-amd64), const SYS___MAC_SET_FILE ideal-int +pkg syscall (darwin-amd64), const SYS___MAC_SET_LCTX ideal-int +pkg syscall (darwin-amd64), const SYS___MAC_SET_LINK ideal-int +pkg syscall (darwin-amd64), const SYS___MAC_SET_PROC ideal-int +pkg syscall (darwin-amd64), const SYS___MAC_SYSCALL ideal-int +pkg syscall (darwin-amd64), const SYS___OLD_SEMWAIT_SIGNAL ideal-int +pkg syscall (darwin-amd64), const SYS___OLD_SEMWAIT_SIGNAL_NOCANCEL ideal-int +pkg syscall (darwin-amd64), const SYS___PTHREAD_CANCELED ideal-int +pkg syscall (darwin-amd64), const SYS___PTHREAD_CHDIR ideal-int +pkg syscall (darwin-amd64), const SYS___PTHREAD_FCHDIR ideal-int +pkg syscall (darwin-amd64), const SYS___PTHREAD_KILL ideal-int +pkg syscall (darwin-amd64), const SYS___PTHREAD_MARKCANCEL ideal-int +pkg syscall (darwin-amd64), const SYS___PTHREAD_SIGMASK ideal-int +pkg syscall (darwin-amd64), const SYS___SEMWAIT_SIGNAL ideal-int +pkg syscall (darwin-amd64), const SYS___SEMWAIT_SIGNAL_NOCANCEL ideal-int +pkg syscall (darwin-amd64), const SYS___SIGWAIT ideal-int +pkg syscall (darwin-amd64), const SYS___SIGWAIT_NOCANCEL ideal-int +pkg syscall (darwin-amd64), const SYS___SYSCTL ideal-int +pkg syscall (darwin-amd64), const S_IEXEC ideal-int +pkg syscall (darwin-amd64), const S_IFWHT ideal-int +pkg syscall (darwin-amd64), const S_IREAD ideal-int +pkg syscall (darwin-amd64), const S_IRGRP ideal-int +pkg syscall (darwin-amd64), const S_IROTH ideal-int +pkg syscall (darwin-amd64), const S_IRWXG ideal-int +pkg syscall (darwin-amd64), const S_IRWXO ideal-int +pkg syscall (darwin-amd64), const S_IRWXU ideal-int +pkg syscall (darwin-amd64), const S_ISTXT ideal-int +pkg syscall (darwin-amd64), const S_IWGRP ideal-int +pkg syscall (darwin-amd64), const S_IWOTH ideal-int +pkg syscall (darwin-amd64), const S_IWRITE ideal-int +pkg syscall (darwin-amd64), const S_IXGRP ideal-int +pkg syscall (darwin-amd64), const S_IXOTH ideal-int +pkg syscall (darwin-amd64), const SizeofBpfHdr ideal-int +pkg syscall (darwin-amd64), const SizeofBpfInsn ideal-int +pkg syscall (darwin-amd64), const SizeofBpfProgram ideal-int +pkg syscall (darwin-amd64), const SizeofBpfStat ideal-int +pkg syscall (darwin-amd64), const SizeofBpfVersion ideal-int +pkg syscall (darwin-amd64), const SizeofCmsghdr ideal-int +pkg syscall (darwin-amd64), const SizeofIPMreq ideal-int +pkg syscall (darwin-amd64), const SizeofIPv6Mreq ideal-int +pkg syscall (darwin-amd64), const SizeofIfData ideal-int +pkg syscall (darwin-amd64), const SizeofIfMsghdr ideal-int +pkg syscall (darwin-amd64), const SizeofIfaMsghdr ideal-int +pkg syscall (darwin-amd64), const SizeofIfmaMsghdr ideal-int +pkg syscall (darwin-amd64), const SizeofIfmaMsghdr2 ideal-int +pkg syscall (darwin-amd64), const SizeofInet6Pktinfo ideal-int +pkg syscall (darwin-amd64), const SizeofLinger ideal-int +pkg syscall (darwin-amd64), const SizeofMsghdr ideal-int +pkg syscall (darwin-amd64), const SizeofRtMetrics ideal-int +pkg syscall (darwin-amd64), const SizeofRtMsghdr ideal-int +pkg syscall (darwin-amd64), const SizeofSockaddrAny ideal-int +pkg syscall (darwin-amd64), const SizeofSockaddrDatalink ideal-int +pkg syscall (darwin-amd64), const SizeofSockaddrInet4 ideal-int +pkg syscall (darwin-amd64), const SizeofSockaddrInet6 ideal-int +pkg syscall (darwin-amd64), const SizeofSockaddrUnix ideal-int +pkg syscall (darwin-amd64), const TCP_CONNECTIONTIMEOUT ideal-int +pkg syscall (darwin-amd64), const TCP_KEEPALIVE ideal-int +pkg syscall (darwin-amd64), const TCP_MAXHLEN ideal-int +pkg syscall (darwin-amd64), const TCP_MAXOLEN ideal-int +pkg syscall (darwin-amd64), const TCP_MAXSEG ideal-int +pkg syscall (darwin-amd64), const TCP_MAXWIN ideal-int +pkg syscall (darwin-amd64), const TCP_MAX_SACK ideal-int +pkg syscall (darwin-amd64), const TCP_MAX_WINSHIFT ideal-int +pkg syscall (darwin-amd64), const TCP_MINMSS ideal-int +pkg syscall (darwin-amd64), const TCP_MINMSSOVERLOAD ideal-int +pkg syscall (darwin-amd64), const TCP_MSS ideal-int +pkg syscall (darwin-amd64), const TCP_NOOPT ideal-int +pkg syscall (darwin-amd64), const TCP_NOPUSH ideal-int +pkg syscall (darwin-amd64), const TCP_RXT_CONNDROPTIME ideal-int +pkg syscall (darwin-amd64), const TCP_RXT_FINDROP ideal-int +pkg syscall (darwin-amd64), const TIOCCBRK ideal-int +pkg syscall (darwin-amd64), const TIOCCDTR ideal-int +pkg syscall (darwin-amd64), const TIOCCONS ideal-int +pkg syscall (darwin-amd64), const TIOCDCDTIMESTAMP ideal-int +pkg syscall (darwin-amd64), const TIOCDRAIN ideal-int +pkg syscall (darwin-amd64), const TIOCDSIMICROCODE ideal-int +pkg syscall (darwin-amd64), const TIOCEXCL ideal-int +pkg syscall (darwin-amd64), const TIOCEXT ideal-int +pkg syscall (darwin-amd64), const TIOCFLUSH ideal-int +pkg syscall (darwin-amd64), const TIOCGDRAINWAIT ideal-int +pkg syscall (darwin-amd64), const TIOCGETA ideal-int +pkg syscall (darwin-amd64), const TIOCGETD ideal-int +pkg syscall (darwin-amd64), const TIOCGPGRP ideal-int +pkg syscall (darwin-amd64), const TIOCGWINSZ ideal-int +pkg syscall (darwin-amd64), const TIOCIXOFF ideal-int +pkg syscall (darwin-amd64), const TIOCIXON ideal-int +pkg syscall (darwin-amd64), const TIOCMBIC ideal-int +pkg syscall (darwin-amd64), const TIOCMBIS ideal-int +pkg syscall (darwin-amd64), const TIOCMGDTRWAIT ideal-int +pkg syscall (darwin-amd64), const TIOCMGET ideal-int +pkg syscall (darwin-amd64), const TIOCMODG ideal-int +pkg syscall (darwin-amd64), const TIOCMODS ideal-int +pkg syscall (darwin-amd64), const TIOCMSDTRWAIT ideal-int +pkg syscall (darwin-amd64), const TIOCMSET ideal-int +pkg syscall (darwin-amd64), const TIOCM_CAR ideal-int +pkg syscall (darwin-amd64), const TIOCM_CD ideal-int +pkg syscall (darwin-amd64), const TIOCM_CTS ideal-int +pkg syscall (darwin-amd64), const TIOCM_DSR ideal-int +pkg syscall (darwin-amd64), const TIOCM_DTR ideal-int +pkg syscall (darwin-amd64), const TIOCM_LE ideal-int +pkg syscall (darwin-amd64), const TIOCM_RI ideal-int +pkg syscall (darwin-amd64), const TIOCM_RNG ideal-int +pkg syscall (darwin-amd64), const TIOCM_RTS ideal-int +pkg syscall (darwin-amd64), const TIOCM_SR ideal-int +pkg syscall (darwin-amd64), const TIOCM_ST ideal-int +pkg syscall (darwin-amd64), const TIOCNOTTY ideal-int +pkg syscall (darwin-amd64), const TIOCNXCL ideal-int +pkg syscall (darwin-amd64), const TIOCOUTQ ideal-int +pkg syscall (darwin-amd64), const TIOCPKT ideal-int +pkg syscall (darwin-amd64), const TIOCPKT_DATA ideal-int +pkg syscall (darwin-amd64), const TIOCPKT_DOSTOP ideal-int +pkg syscall (darwin-amd64), const TIOCPKT_FLUSHREAD ideal-int +pkg syscall (darwin-amd64), const TIOCPKT_FLUSHWRITE ideal-int +pkg syscall (darwin-amd64), const TIOCPKT_IOCTL ideal-int +pkg syscall (darwin-amd64), const TIOCPKT_NOSTOP ideal-int +pkg syscall (darwin-amd64), const TIOCPKT_START ideal-int +pkg syscall (darwin-amd64), const TIOCPKT_STOP ideal-int +pkg syscall (darwin-amd64), const TIOCPTYGNAME ideal-int +pkg syscall (darwin-amd64), const TIOCPTYGRANT ideal-int +pkg syscall (darwin-amd64), const TIOCPTYUNLK ideal-int +pkg syscall (darwin-amd64), const TIOCREMOTE ideal-int +pkg syscall (darwin-amd64), const TIOCSBRK ideal-int +pkg syscall (darwin-amd64), const TIOCSCONS ideal-int +pkg syscall (darwin-amd64), const TIOCSCTTY ideal-int +pkg syscall (darwin-amd64), const TIOCSDRAINWAIT ideal-int +pkg syscall (darwin-amd64), const TIOCSDTR ideal-int +pkg syscall (darwin-amd64), const TIOCSETA ideal-int +pkg syscall (darwin-amd64), const TIOCSETAF ideal-int +pkg syscall (darwin-amd64), const TIOCSETAW ideal-int +pkg syscall (darwin-amd64), const TIOCSETD ideal-int +pkg syscall (darwin-amd64), const TIOCSIG ideal-int +pkg syscall (darwin-amd64), const TIOCSPGRP ideal-int +pkg syscall (darwin-amd64), const TIOCSTART ideal-int +pkg syscall (darwin-amd64), const TIOCSTAT ideal-int +pkg syscall (darwin-amd64), const TIOCSTI ideal-int +pkg syscall (darwin-amd64), const TIOCSTOP ideal-int +pkg syscall (darwin-amd64), const TIOCSWINSZ ideal-int +pkg syscall (darwin-amd64), const TIOCTIMESTAMP ideal-int +pkg syscall (darwin-amd64), const TIOCUCNTL ideal-int +pkg syscall (darwin-amd64), const WCONTINUED ideal-int +pkg syscall (darwin-amd64), const WCOREFLAG ideal-int +pkg syscall (darwin-amd64), const WEXITED ideal-int +pkg syscall (darwin-amd64), const WNOHANG ideal-int +pkg syscall (darwin-amd64), const WNOWAIT ideal-int +pkg syscall (darwin-amd64), const WORDSIZE ideal-int +pkg syscall (darwin-amd64), const WSTOPPED ideal-int +pkg syscall (darwin-amd64), const WUNTRACED ideal-int +pkg syscall (darwin-amd64), func Accept(int) (int, Sockaddr, error) +pkg syscall (darwin-amd64), func Access(string, uint32) error +pkg syscall (darwin-amd64), func Adjtime(*Timeval, *Timeval) error +pkg syscall (darwin-amd64), func Bind(int, Sockaddr) error +pkg syscall (darwin-amd64), func BpfBuflen(int) (int, error) +pkg syscall (darwin-amd64), func BpfDatalink(int) (int, error) +pkg syscall (darwin-amd64), func BpfHeadercmpl(int) (int, error) +pkg syscall (darwin-amd64), func BpfInterface(int, string) (string, error) +pkg syscall (darwin-amd64), func BpfJump(int, int, int, int) *BpfInsn +pkg syscall (darwin-amd64), func BpfStats(int) (*BpfStat, error) +pkg syscall (darwin-amd64), func BpfStmt(int, int) *BpfInsn +pkg syscall (darwin-amd64), func BpfTimeout(int) (*Timeval, error) +pkg syscall (darwin-amd64), func CheckBpfVersion(int) error +pkg syscall (darwin-amd64), func Chflags(string, int) error +pkg syscall (darwin-amd64), func Chroot(string) error +pkg syscall (darwin-amd64), func Close(int) error +pkg syscall (darwin-amd64), func CloseOnExec(int) +pkg syscall (darwin-amd64), func CmsgLen(int) int +pkg syscall (darwin-amd64), func CmsgSpace(int) int +pkg syscall (darwin-amd64), func Connect(int, Sockaddr) error +pkg syscall (darwin-amd64), func Dup(int) (int, error) +pkg syscall (darwin-amd64), func Dup2(int, int) error +pkg syscall (darwin-amd64), func Exchangedata(string, string, int) error +pkg syscall (darwin-amd64), func Fchdir(int) error +pkg syscall (darwin-amd64), func Fchflags(string, int) error +pkg syscall (darwin-amd64), func Fchmod(int, uint32) error +pkg syscall (darwin-amd64), func Fchown(int, int, int) error +pkg syscall (darwin-amd64), func Flock(int, int) error +pkg syscall (darwin-amd64), func FlushBpf(int) error +pkg syscall (darwin-amd64), func ForkExec(string, []string, *ProcAttr) (int, error) +pkg syscall (darwin-amd64), func Fpathconf(int, int) (int, error) +pkg syscall (darwin-amd64), func Fstat(int, *Stat_t) error +pkg syscall (darwin-amd64), func Fstatfs(int, *Statfs_t) error +pkg syscall (darwin-amd64), func Fsync(int) error +pkg syscall (darwin-amd64), func Ftruncate(int, int64) error +pkg syscall (darwin-amd64), func Futimes(int, []Timeval) error +pkg syscall (darwin-amd64), func Getdirentries(int, []uint8, *uintptr) (int, error) +pkg syscall (darwin-amd64), func Getdtablesize() int +pkg syscall (darwin-amd64), func Getfsstat([]Statfs_t, int) (int, error) +pkg syscall (darwin-amd64), func Getpeername(int) (Sockaddr, error) +pkg syscall (darwin-amd64), func Getpgid(int) (int, error) +pkg syscall (darwin-amd64), func Getpgrp() int +pkg syscall (darwin-amd64), func Getpriority(int, int) (int, error) +pkg syscall (darwin-amd64), func Getrlimit(int, *Rlimit) error +pkg syscall (darwin-amd64), func Getrusage(int, *Rusage) error +pkg syscall (darwin-amd64), func Getsid(int) (int, error) +pkg syscall (darwin-amd64), func Getsockname(int) (Sockaddr, error) +pkg syscall (darwin-amd64), func GetsockoptByte(int, int, int) (uint8, error) +pkg syscall (darwin-amd64), func GetsockoptIPMreq(int, int, int) (*IPMreq, error) +pkg syscall (darwin-amd64), func GetsockoptIPv6Mreq(int, int, int) (*IPv6Mreq, error) +pkg syscall (darwin-amd64), func GetsockoptInet4Addr(int, int, int) ([4]uint8, error) +pkg syscall (darwin-amd64), func GetsockoptInt(int, int, int) (int, error) +pkg syscall (darwin-amd64), func Issetugid() bool +pkg syscall (darwin-amd64), func Kevent(int, []Kevent_t, []Kevent_t, *Timespec) (int, error) +pkg syscall (darwin-amd64), func Kill(int, Signal) error +pkg syscall (darwin-amd64), func Kqueue() (int, error) +pkg syscall (darwin-amd64), func Listen(int, int) error +pkg syscall (darwin-amd64), func Lstat(string, *Stat_t) error +pkg syscall (darwin-amd64), func Mkfifo(string, uint32) error +pkg syscall (darwin-amd64), func Mknod(string, uint32, int) error +pkg syscall (darwin-amd64), func Mmap(int, int64, int, int, int) ([]uint8, error) +pkg syscall (darwin-amd64), func Munmap([]uint8) error +pkg syscall (darwin-amd64), func NsecToTimespec(int64) Timespec +pkg syscall (darwin-amd64), func Open(string, int, uint32) (int, error) +pkg syscall (darwin-amd64), func ParseDirent([]uint8, int, []string) (int, int, []string) +pkg syscall (darwin-amd64), func ParseRoutingMessage([]uint8) ([]RoutingMessage, error) +pkg syscall (darwin-amd64), func ParseRoutingSockaddr(RoutingMessage) ([]Sockaddr, error) +pkg syscall (darwin-amd64), func ParseSocketControlMessage([]uint8) ([]SocketControlMessage, error) +pkg syscall (darwin-amd64), func ParseUnixRights(*SocketControlMessage) ([]int, error) +pkg syscall (darwin-amd64), func Pathconf(string, int) (int, error) +pkg syscall (darwin-amd64), func Pipe([]int) error +pkg syscall (darwin-amd64), func Pread(int, []uint8, int64) (int, error) +pkg syscall (darwin-amd64), func PtraceAttach(int) error +pkg syscall (darwin-amd64), func PtraceDetach(int) error +pkg syscall (darwin-amd64), func Pwrite(int, []uint8, int64) (int, error) +pkg syscall (darwin-amd64), func RawSyscall(uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno) +pkg syscall (darwin-amd64), func RawSyscall6(uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno) +pkg syscall (darwin-amd64), func Read(int, []uint8) (int, error) +pkg syscall (darwin-amd64), func ReadDirent(int, []uint8) (int, error) +pkg syscall (darwin-amd64), func Recvfrom(int, []uint8, int) (int, Sockaddr, error) +pkg syscall (darwin-amd64), func Recvmsg(int, []uint8, []uint8, int) (int, int, int, Sockaddr, error) +pkg syscall (darwin-amd64), func Revoke(string) error +pkg syscall (darwin-amd64), func RouteRIB(int, int) ([]uint8, error) +pkg syscall (darwin-amd64), func Seek(int, int64, int) (int64, error) +pkg syscall (darwin-amd64), func Select(int, *FdSet, *FdSet, *FdSet, *Timeval) error +pkg syscall (darwin-amd64), func Sendfile(int, int, *int64, int) (int, error) +pkg syscall (darwin-amd64), func Sendmsg(int, []uint8, []uint8, Sockaddr, int) error +pkg syscall (darwin-amd64), func Sendto(int, []uint8, int, Sockaddr) error +pkg syscall (darwin-amd64), func SetBpf(int, []BpfInsn) error +pkg syscall (darwin-amd64), func SetBpfBuflen(int, int) (int, error) +pkg syscall (darwin-amd64), func SetBpfDatalink(int, int) (int, error) +pkg syscall (darwin-amd64), func SetBpfHeadercmpl(int, int) error +pkg syscall (darwin-amd64), func SetBpfImmediate(int, int) error +pkg syscall (darwin-amd64), func SetBpfInterface(int, string) error +pkg syscall (darwin-amd64), func SetBpfPromisc(int, int) error +pkg syscall (darwin-amd64), func SetBpfTimeout(int, *Timeval) error +pkg syscall (darwin-amd64), func SetKevent(*Kevent_t, int, int, int) +pkg syscall (darwin-amd64), func SetNonblock(int, bool) error +pkg syscall (darwin-amd64), func Setegid(int) error +pkg syscall (darwin-amd64), func Seteuid(int) error +pkg syscall (darwin-amd64), func Setgid(int) error +pkg syscall (darwin-amd64), func Setgroups([]int) error +pkg syscall (darwin-amd64), func Setlogin(string) error +pkg syscall (darwin-amd64), func Setpgid(int, int) error +pkg syscall (darwin-amd64), func Setpriority(int, int, int) error +pkg syscall (darwin-amd64), func Setprivexec(int) error +pkg syscall (darwin-amd64), func Setregid(int, int) error +pkg syscall (darwin-amd64), func Setreuid(int, int) error +pkg syscall (darwin-amd64), func Setrlimit(int, *Rlimit) error +pkg syscall (darwin-amd64), func Setsid() (int, error) +pkg syscall (darwin-amd64), func SetsockoptByte(int, int, int, uint8) error +pkg syscall (darwin-amd64), func SetsockoptIPMreq(int, int, int, *IPMreq) error +pkg syscall (darwin-amd64), func SetsockoptIPv6Mreq(int, int, int, *IPv6Mreq) error +pkg syscall (darwin-amd64), func SetsockoptInet4Addr(int, int, int, [4]uint8) error +pkg syscall (darwin-amd64), func SetsockoptInt(int, int, int, int) error +pkg syscall (darwin-amd64), func SetsockoptLinger(int, int, int, *Linger) error +pkg syscall (darwin-amd64), func SetsockoptString(int, int, int, string) error +pkg syscall (darwin-amd64), func SetsockoptTimeval(int, int, int, *Timeval) error +pkg syscall (darwin-amd64), func Settimeofday(*Timeval) error +pkg syscall (darwin-amd64), func Setuid(int) error +pkg syscall (darwin-amd64), func Shutdown(int, int) error +pkg syscall (darwin-amd64), func Socket(int, int, int) (int, error) +pkg syscall (darwin-amd64), func Socketpair(int, int, int) ([2]int, error) +pkg syscall (darwin-amd64), func Stat(string, *Stat_t) error +pkg syscall (darwin-amd64), func Statfs(string, *Statfs_t) error +pkg syscall (darwin-amd64), func StringSlicePtr([]string) []*uint8 +pkg syscall (darwin-amd64), func Sync() error +pkg syscall (darwin-amd64), func Syscall(uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno) +pkg syscall (darwin-amd64), func Syscall6(uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno) +pkg syscall (darwin-amd64), func Sysctl(string) (string, error) +pkg syscall (darwin-amd64), func SysctlUint32(string) (uint32, error) +pkg syscall (darwin-amd64), func TimespecToNsec(Timespec) int64 +pkg syscall (darwin-amd64), func TimevalToNsec(Timeval) int64 +pkg syscall (darwin-amd64), func Truncate(string, int64) error +pkg syscall (darwin-amd64), func Umask(int) int +pkg syscall (darwin-amd64), func Undelete(string) error +pkg syscall (darwin-amd64), func UnixRights(...int) []uint8 +pkg syscall (darwin-amd64), func Unmount(string, int) error +pkg syscall (darwin-amd64), func Wait4(int, *WaitStatus, int, *Rusage) (int, error) +pkg syscall (darwin-amd64), func Write(int, []uint8) (int, error) +pkg syscall (darwin-amd64), method (*Cmsghdr) SetLen(int) +pkg syscall (darwin-amd64), method (*Iovec) SetLen(int) +pkg syscall (darwin-amd64), method (*Msghdr) SetControllen(int) +pkg syscall (darwin-amd64), type BpfHdr struct +pkg syscall (darwin-amd64), type BpfHdr struct, Caplen uint32 +pkg syscall (darwin-amd64), type BpfHdr struct, Datalen uint32 +pkg syscall (darwin-amd64), type BpfHdr struct, Hdrlen uint16 +pkg syscall (darwin-amd64), type BpfHdr struct, Pad_cgo_0 [2]uint8 +pkg syscall (darwin-amd64), type BpfHdr struct, Tstamp Timeval32 +pkg syscall (darwin-amd64), type BpfInsn struct +pkg syscall (darwin-amd64), type BpfInsn struct, Code uint16 +pkg syscall (darwin-amd64), type BpfInsn struct, Jf uint8 +pkg syscall (darwin-amd64), type BpfInsn struct, Jt uint8 +pkg syscall (darwin-amd64), type BpfInsn struct, K uint32 +pkg syscall (darwin-amd64), type BpfProgram struct +pkg syscall (darwin-amd64), type BpfProgram struct, Insns *BpfInsn +pkg syscall (darwin-amd64), type BpfProgram struct, Len uint32 +pkg syscall (darwin-amd64), type BpfProgram struct, Pad_cgo_0 [4]uint8 +pkg syscall (darwin-amd64), type BpfStat struct +pkg syscall (darwin-amd64), type BpfStat struct, Drop uint32 +pkg syscall (darwin-amd64), type BpfStat struct, Recv uint32 +pkg syscall (darwin-amd64), type BpfVersion struct +pkg syscall (darwin-amd64), type BpfVersion struct, Major uint16 +pkg syscall (darwin-amd64), type BpfVersion struct, Minor uint16 +pkg syscall (darwin-amd64), type Cmsghdr struct +pkg syscall (darwin-amd64), type Cmsghdr struct, Len uint32 +pkg syscall (darwin-amd64), type Cmsghdr struct, Level int32 +pkg syscall (darwin-amd64), type Cmsghdr struct, Type int32 +pkg syscall (darwin-amd64), type Credential struct +pkg syscall (darwin-amd64), type Credential struct, Gid uint32 +pkg syscall (darwin-amd64), type Credential struct, Groups []uint32 +pkg syscall (darwin-amd64), type Credential struct, Uid uint32 +pkg syscall (darwin-amd64), type Dirent struct +pkg syscall (darwin-amd64), type Dirent struct, Ino uint64 +pkg syscall (darwin-amd64), type Dirent struct, Name [1024]int8 +pkg syscall (darwin-amd64), type Dirent struct, Namlen uint16 +pkg syscall (darwin-amd64), type Dirent struct, Pad_cgo_0 [3]uint8 +pkg syscall (darwin-amd64), type Dirent struct, Reclen uint16 +pkg syscall (darwin-amd64), type Dirent struct, Seekoff uint64 +pkg syscall (darwin-amd64), type Dirent struct, Type uint8 +pkg syscall (darwin-amd64), type Fbootstraptransfer_t struct +pkg syscall (darwin-amd64), type Fbootstraptransfer_t struct, Buffer *uint8 +pkg syscall (darwin-amd64), type Fbootstraptransfer_t struct, Length uint64 +pkg syscall (darwin-amd64), type Fbootstraptransfer_t struct, Offset int64 +pkg syscall (darwin-amd64), type FdSet struct +pkg syscall (darwin-amd64), type FdSet struct, Bits [32]int32 +pkg syscall (darwin-amd64), type Flock_t struct +pkg syscall (darwin-amd64), type Flock_t struct, Len int64 +pkg syscall (darwin-amd64), type Flock_t struct, Pid int32 +pkg syscall (darwin-amd64), type Flock_t struct, Start int64 +pkg syscall (darwin-amd64), type Flock_t struct, Type int16 +pkg syscall (darwin-amd64), type Flock_t struct, Whence int16 +pkg syscall (darwin-amd64), type Fsid struct +pkg syscall (darwin-amd64), type Fsid struct, Val [2]int32 +pkg syscall (darwin-amd64), type Fstore_t struct +pkg syscall (darwin-amd64), type Fstore_t struct, Bytesalloc int64 +pkg syscall (darwin-amd64), type Fstore_t struct, Flags uint32 +pkg syscall (darwin-amd64), type Fstore_t struct, Length int64 +pkg syscall (darwin-amd64), type Fstore_t struct, Offset int64 +pkg syscall (darwin-amd64), type Fstore_t struct, Posmode int32 +pkg syscall (darwin-amd64), type IfData struct +pkg syscall (darwin-amd64), type IfData struct, Addrlen uint8 +pkg syscall (darwin-amd64), type IfData struct, Baudrate uint32 +pkg syscall (darwin-amd64), type IfData struct, Collisions uint32 +pkg syscall (darwin-amd64), type IfData struct, Hdrlen uint8 +pkg syscall (darwin-amd64), type IfData struct, Hwassist uint32 +pkg syscall (darwin-amd64), type IfData struct, Ibytes uint32 +pkg syscall (darwin-amd64), type IfData struct, Ierrors uint32 +pkg syscall (darwin-amd64), type IfData struct, Imcasts uint32 +pkg syscall (darwin-amd64), type IfData struct, Ipackets uint32 +pkg syscall (darwin-amd64), type IfData struct, Iqdrops uint32 +pkg syscall (darwin-amd64), type IfData struct, Lastchange Timeval32 +pkg syscall (darwin-amd64), type IfData struct, Metric uint32 +pkg syscall (darwin-amd64), type IfData struct, Mtu uint32 +pkg syscall (darwin-amd64), type IfData struct, Noproto uint32 +pkg syscall (darwin-amd64), type IfData struct, Obytes uint32 +pkg syscall (darwin-amd64), type IfData struct, Oerrors uint32 +pkg syscall (darwin-amd64), type IfData struct, Omcasts uint32 +pkg syscall (darwin-amd64), type IfData struct, Opackets uint32 +pkg syscall (darwin-amd64), type IfData struct, Physical uint8 +pkg syscall (darwin-amd64), type IfData struct, Recvquota uint8 +pkg syscall (darwin-amd64), type IfData struct, Recvtiming uint32 +pkg syscall (darwin-amd64), type IfData struct, Reserved1 uint32 +pkg syscall (darwin-amd64), type IfData struct, Reserved2 uint32 +pkg syscall (darwin-amd64), type IfData struct, Type uint8 +pkg syscall (darwin-amd64), type IfData struct, Typelen uint8 +pkg syscall (darwin-amd64), type IfData struct, Unused1 uint8 +pkg syscall (darwin-amd64), type IfData struct, Unused2 uint32 +pkg syscall (darwin-amd64), type IfData struct, Xmitquota uint8 +pkg syscall (darwin-amd64), type IfData struct, Xmittiming uint32 +pkg syscall (darwin-amd64), type IfMsghdr struct +pkg syscall (darwin-amd64), type IfMsghdr struct, Addrs int32 +pkg syscall (darwin-amd64), type IfMsghdr struct, Data IfData +pkg syscall (darwin-amd64), type IfMsghdr struct, Flags int32 +pkg syscall (darwin-amd64), type IfMsghdr struct, Index uint16 +pkg syscall (darwin-amd64), type IfMsghdr struct, Msglen uint16 +pkg syscall (darwin-amd64), type IfMsghdr struct, Pad_cgo_0 [2]uint8 +pkg syscall (darwin-amd64), type IfMsghdr struct, Type uint8 +pkg syscall (darwin-amd64), type IfMsghdr struct, Version uint8 +pkg syscall (darwin-amd64), type IfaMsghdr struct +pkg syscall (darwin-amd64), type IfaMsghdr struct, Addrs int32 +pkg syscall (darwin-amd64), type IfaMsghdr struct, Flags int32 +pkg syscall (darwin-amd64), type IfaMsghdr struct, Index uint16 +pkg syscall (darwin-amd64), type IfaMsghdr struct, Metric int32 +pkg syscall (darwin-amd64), type IfaMsghdr struct, Msglen uint16 +pkg syscall (darwin-amd64), type IfaMsghdr struct, Pad_cgo_0 [2]uint8 +pkg syscall (darwin-amd64), type IfaMsghdr struct, Type uint8 +pkg syscall (darwin-amd64), type IfaMsghdr struct, Version uint8 +pkg syscall (darwin-amd64), type IfmaMsghdr struct +pkg syscall (darwin-amd64), type IfmaMsghdr struct, Addrs int32 +pkg syscall (darwin-amd64), type IfmaMsghdr struct, Flags int32 +pkg syscall (darwin-amd64), type IfmaMsghdr struct, Index uint16 +pkg syscall (darwin-amd64), type IfmaMsghdr struct, Msglen uint16 +pkg syscall (darwin-amd64), type IfmaMsghdr struct, Pad_cgo_0 [2]uint8 +pkg syscall (darwin-amd64), type IfmaMsghdr struct, Type uint8 +pkg syscall (darwin-amd64), type IfmaMsghdr struct, Version uint8 +pkg syscall (darwin-amd64), type IfmaMsghdr2 struct +pkg syscall (darwin-amd64), type IfmaMsghdr2 struct, Addrs int32 +pkg syscall (darwin-amd64), type IfmaMsghdr2 struct, Flags int32 +pkg syscall (darwin-amd64), type IfmaMsghdr2 struct, Index uint16 +pkg syscall (darwin-amd64), type IfmaMsghdr2 struct, Msglen uint16 +pkg syscall (darwin-amd64), type IfmaMsghdr2 struct, Pad_cgo_0 [2]uint8 +pkg syscall (darwin-amd64), type IfmaMsghdr2 struct, Refcount int32 +pkg syscall (darwin-amd64), type IfmaMsghdr2 struct, Type uint8 +pkg syscall (darwin-amd64), type IfmaMsghdr2 struct, Version uint8 +pkg syscall (darwin-amd64), type Inet6Pktinfo struct +pkg syscall (darwin-amd64), type Inet6Pktinfo struct, Addr [16]uint8 +pkg syscall (darwin-amd64), type Inet6Pktinfo struct, Ifindex uint32 +pkg syscall (darwin-amd64), type InterfaceAddrMessage struct +pkg syscall (darwin-amd64), type InterfaceAddrMessage struct, Data []uint8 +pkg syscall (darwin-amd64), type InterfaceAddrMessage struct, Header IfaMsghdr +pkg syscall (darwin-amd64), type InterfaceMessage struct +pkg syscall (darwin-amd64), type InterfaceMessage struct, Data []uint8 +pkg syscall (darwin-amd64), type InterfaceMessage struct, Header IfMsghdr +pkg syscall (darwin-amd64), type InterfaceMulticastAddrMessage struct +pkg syscall (darwin-amd64), type InterfaceMulticastAddrMessage struct, Data []uint8 +pkg syscall (darwin-amd64), type InterfaceMulticastAddrMessage struct, Header IfmaMsghdr2 +pkg syscall (darwin-amd64), type Iovec struct +pkg syscall (darwin-amd64), type Iovec struct, Base *uint8 +pkg syscall (darwin-amd64), type Iovec struct, Len uint64 +pkg syscall (darwin-amd64), type Kevent_t struct +pkg syscall (darwin-amd64), type Kevent_t struct, Data int64 +pkg syscall (darwin-amd64), type Kevent_t struct, Fflags uint32 +pkg syscall (darwin-amd64), type Kevent_t struct, Filter int16 +pkg syscall (darwin-amd64), type Kevent_t struct, Flags uint16 +pkg syscall (darwin-amd64), type Kevent_t struct, Ident uint64 +pkg syscall (darwin-amd64), type Kevent_t struct, Udata *uint8 +pkg syscall (darwin-amd64), type Log2phys_t struct +pkg syscall (darwin-amd64), type Log2phys_t struct, Contigbytes int64 +pkg syscall (darwin-amd64), type Log2phys_t struct, Devoffset int64 +pkg syscall (darwin-amd64), type Log2phys_t struct, Flags uint32 +pkg syscall (darwin-amd64), type Msghdr struct +pkg syscall (darwin-amd64), type Msghdr struct, Control *uint8 +pkg syscall (darwin-amd64), type Msghdr struct, Controllen uint32 +pkg syscall (darwin-amd64), type Msghdr struct, Flags int32 +pkg syscall (darwin-amd64), type Msghdr struct, Iov *Iovec +pkg syscall (darwin-amd64), type Msghdr struct, Iovlen int32 +pkg syscall (darwin-amd64), type Msghdr struct, Name *uint8 +pkg syscall (darwin-amd64), type Msghdr struct, Namelen uint32 +pkg syscall (darwin-amd64), type Msghdr struct, Pad_cgo_0 [4]uint8 +pkg syscall (darwin-amd64), type Msghdr struct, Pad_cgo_1 [4]uint8 +pkg syscall (darwin-amd64), type Radvisory_t struct +pkg syscall (darwin-amd64), type Radvisory_t struct, Count int32 +pkg syscall (darwin-amd64), type Radvisory_t struct, Offset int64 +pkg syscall (darwin-amd64), type Radvisory_t struct, Pad_cgo_0 [4]uint8 +pkg syscall (darwin-amd64), type RawSockaddr struct, Data [14]int8 +pkg syscall (darwin-amd64), type RawSockaddr struct, Family uint8 +pkg syscall (darwin-amd64), type RawSockaddr struct, Len uint8 +pkg syscall (darwin-amd64), type RawSockaddrAny struct, Pad [92]int8 +pkg syscall (darwin-amd64), type RawSockaddrDatalink struct +pkg syscall (darwin-amd64), type RawSockaddrDatalink struct, Alen uint8 +pkg syscall (darwin-amd64), type RawSockaddrDatalink struct, Data [12]int8 +pkg syscall (darwin-amd64), type RawSockaddrDatalink struct, Family uint8 +pkg syscall (darwin-amd64), type RawSockaddrDatalink struct, Index uint16 +pkg syscall (darwin-amd64), type RawSockaddrDatalink struct, Len uint8 +pkg syscall (darwin-amd64), type RawSockaddrDatalink struct, Nlen uint8 +pkg syscall (darwin-amd64), type RawSockaddrDatalink struct, Slen uint8 +pkg syscall (darwin-amd64), type RawSockaddrDatalink struct, Type uint8 +pkg syscall (darwin-amd64), type RawSockaddrInet4 struct, Family uint8 +pkg syscall (darwin-amd64), type RawSockaddrInet4 struct, Len uint8 +pkg syscall (darwin-amd64), type RawSockaddrInet4 struct, Zero [8]int8 +pkg syscall (darwin-amd64), type RawSockaddrInet6 struct +pkg syscall (darwin-amd64), type RawSockaddrInet6 struct, Addr [16]uint8 +pkg syscall (darwin-amd64), type RawSockaddrInet6 struct, Family uint8 +pkg syscall (darwin-amd64), type RawSockaddrInet6 struct, Flowinfo uint32 +pkg syscall (darwin-amd64), type RawSockaddrInet6 struct, Len uint8 +pkg syscall (darwin-amd64), type RawSockaddrInet6 struct, Port uint16 +pkg syscall (darwin-amd64), type RawSockaddrInet6 struct, Scope_id uint32 +pkg syscall (darwin-amd64), type RawSockaddrUnix struct +pkg syscall (darwin-amd64), type RawSockaddrUnix struct, Family uint8 +pkg syscall (darwin-amd64), type RawSockaddrUnix struct, Len uint8 +pkg syscall (darwin-amd64), type RawSockaddrUnix struct, Path [104]int8 +pkg syscall (darwin-amd64), type Rlimit struct +pkg syscall (darwin-amd64), type Rlimit struct, Cur uint64 +pkg syscall (darwin-amd64), type Rlimit struct, Max uint64 +pkg syscall (darwin-amd64), type RouteMessage struct +pkg syscall (darwin-amd64), type RouteMessage struct, Data []uint8 +pkg syscall (darwin-amd64), type RouteMessage struct, Header RtMsghdr +pkg syscall (darwin-amd64), type RoutingMessage interface, unexported methods +pkg syscall (darwin-amd64), type RtMetrics struct +pkg syscall (darwin-amd64), type RtMetrics struct, Expire int32 +pkg syscall (darwin-amd64), type RtMetrics struct, Filler [4]uint32 +pkg syscall (darwin-amd64), type RtMetrics struct, Hopcount uint32 +pkg syscall (darwin-amd64), type RtMetrics struct, Locks uint32 +pkg syscall (darwin-amd64), type RtMetrics struct, Mtu uint32 +pkg syscall (darwin-amd64), type RtMetrics struct, Pksent uint32 +pkg syscall (darwin-amd64), type RtMetrics struct, Recvpipe uint32 +pkg syscall (darwin-amd64), type RtMetrics struct, Rtt uint32 +pkg syscall (darwin-amd64), type RtMetrics struct, Rttvar uint32 +pkg syscall (darwin-amd64), type RtMetrics struct, Sendpipe uint32 +pkg syscall (darwin-amd64), type RtMetrics struct, Ssthresh uint32 +pkg syscall (darwin-amd64), type RtMsghdr struct +pkg syscall (darwin-amd64), type RtMsghdr struct, Addrs int32 +pkg syscall (darwin-amd64), type RtMsghdr struct, Errno int32 +pkg syscall (darwin-amd64), type RtMsghdr struct, Flags int32 +pkg syscall (darwin-amd64), type RtMsghdr struct, Index uint16 +pkg syscall (darwin-amd64), type RtMsghdr struct, Inits uint32 +pkg syscall (darwin-amd64), type RtMsghdr struct, Msglen uint16 +pkg syscall (darwin-amd64), type RtMsghdr struct, Pad_cgo_0 [2]uint8 +pkg syscall (darwin-amd64), type RtMsghdr struct, Pid int32 +pkg syscall (darwin-amd64), type RtMsghdr struct, Rmx RtMetrics +pkg syscall (darwin-amd64), type RtMsghdr struct, Seq int32 +pkg syscall (darwin-amd64), type RtMsghdr struct, Type uint8 +pkg syscall (darwin-amd64), type RtMsghdr struct, Use int32 +pkg syscall (darwin-amd64), type RtMsghdr struct, Version uint8 +pkg syscall (darwin-amd64), type Rusage struct, Idrss int64 +pkg syscall (darwin-amd64), type Rusage struct, Inblock int64 +pkg syscall (darwin-amd64), type Rusage struct, Isrss int64 +pkg syscall (darwin-amd64), type Rusage struct, Ixrss int64 +pkg syscall (darwin-amd64), type Rusage struct, Majflt int64 +pkg syscall (darwin-amd64), type Rusage struct, Maxrss int64 +pkg syscall (darwin-amd64), type Rusage struct, Minflt int64 +pkg syscall (darwin-amd64), type Rusage struct, Msgrcv int64 +pkg syscall (darwin-amd64), type Rusage struct, Msgsnd int64 +pkg syscall (darwin-amd64), type Rusage struct, Nivcsw int64 +pkg syscall (darwin-amd64), type Rusage struct, Nsignals int64 +pkg syscall (darwin-amd64), type Rusage struct, Nswap int64 +pkg syscall (darwin-amd64), type Rusage struct, Nvcsw int64 +pkg syscall (darwin-amd64), type Rusage struct, Oublock int64 +pkg syscall (darwin-amd64), type Rusage struct, Stime Timeval +pkg syscall (darwin-amd64), type Rusage struct, Utime Timeval +pkg syscall (darwin-amd64), type SockaddrDatalink struct +pkg syscall (darwin-amd64), type SockaddrDatalink struct, Alen uint8 +pkg syscall (darwin-amd64), type SockaddrDatalink struct, Data [12]int8 +pkg syscall (darwin-amd64), type SockaddrDatalink struct, Family uint8 +pkg syscall (darwin-amd64), type SockaddrDatalink struct, Index uint16 +pkg syscall (darwin-amd64), type SockaddrDatalink struct, Len uint8 +pkg syscall (darwin-amd64), type SockaddrDatalink struct, Nlen uint8 +pkg syscall (darwin-amd64), type SockaddrDatalink struct, Slen uint8 +pkg syscall (darwin-amd64), type SockaddrDatalink struct, Type uint8 +pkg syscall (darwin-amd64), type SocketControlMessage struct +pkg syscall (darwin-amd64), type SocketControlMessage struct, Data []uint8 +pkg syscall (darwin-amd64), type SocketControlMessage struct, Header Cmsghdr +pkg syscall (darwin-amd64), type Stat_t struct +pkg syscall (darwin-amd64), type Stat_t struct, Atimespec Timespec +pkg syscall (darwin-amd64), type Stat_t struct, Birthtimespec Timespec +pkg syscall (darwin-amd64), type Stat_t struct, Blksize int32 +pkg syscall (darwin-amd64), type Stat_t struct, Blocks int64 +pkg syscall (darwin-amd64), type Stat_t struct, Ctimespec Timespec +pkg syscall (darwin-amd64), type Stat_t struct, Dev int32 +pkg syscall (darwin-amd64), type Stat_t struct, Flags uint32 +pkg syscall (darwin-amd64), type Stat_t struct, Gen uint32 +pkg syscall (darwin-amd64), type Stat_t struct, Gid uint32 +pkg syscall (darwin-amd64), type Stat_t struct, Ino uint64 +pkg syscall (darwin-amd64), type Stat_t struct, Lspare int32 +pkg syscall (darwin-amd64), type Stat_t struct, Mode uint16 +pkg syscall (darwin-amd64), type Stat_t struct, Mtimespec Timespec +pkg syscall (darwin-amd64), type Stat_t struct, Nlink uint16 +pkg syscall (darwin-amd64), type Stat_t struct, Pad_cgo_0 [4]uint8 +pkg syscall (darwin-amd64), type Stat_t struct, Qspare [2]int64 +pkg syscall (darwin-amd64), type Stat_t struct, Rdev int32 +pkg syscall (darwin-amd64), type Stat_t struct, Size int64 +pkg syscall (darwin-amd64), type Stat_t struct, Uid uint32 +pkg syscall (darwin-amd64), type Statfs_t struct +pkg syscall (darwin-amd64), type Statfs_t struct, Bavail uint64 +pkg syscall (darwin-amd64), type Statfs_t struct, Bfree uint64 +pkg syscall (darwin-amd64), type Statfs_t struct, Blocks uint64 +pkg syscall (darwin-amd64), type Statfs_t struct, Bsize uint32 +pkg syscall (darwin-amd64), type Statfs_t struct, Ffree uint64 +pkg syscall (darwin-amd64), type Statfs_t struct, Files uint64 +pkg syscall (darwin-amd64), type Statfs_t struct, Flags uint32 +pkg syscall (darwin-amd64), type Statfs_t struct, Fsid Fsid +pkg syscall (darwin-amd64), type Statfs_t struct, Fssubtype uint32 +pkg syscall (darwin-amd64), type Statfs_t struct, Fstypename [16]int8 +pkg syscall (darwin-amd64), type Statfs_t struct, Iosize int32 +pkg syscall (darwin-amd64), type Statfs_t struct, Mntfromname [1024]int8 +pkg syscall (darwin-amd64), type Statfs_t struct, Mntonname [1024]int8 +pkg syscall (darwin-amd64), type Statfs_t struct, Owner uint32 +pkg syscall (darwin-amd64), type Statfs_t struct, Reserved [8]uint32 +pkg syscall (darwin-amd64), type Statfs_t struct, Type uint32 +pkg syscall (darwin-amd64), type SysProcAttr struct, Chroot string +pkg syscall (darwin-amd64), type SysProcAttr struct, Credential *Credential +pkg syscall (darwin-amd64), type SysProcAttr struct, Noctty bool +pkg syscall (darwin-amd64), type SysProcAttr struct, Ptrace bool +pkg syscall (darwin-amd64), type SysProcAttr struct, Setctty bool +pkg syscall (darwin-amd64), type SysProcAttr struct, Setpgid bool +pkg syscall (darwin-amd64), type SysProcAttr struct, Setsid bool +pkg syscall (darwin-amd64), type Timespec struct, Nsec int64 +pkg syscall (darwin-amd64), type Timespec struct, Sec int64 +pkg syscall (darwin-amd64), type Timeval struct, Pad_cgo_0 [4]uint8 +pkg syscall (darwin-amd64), type Timeval struct, Sec int64 +pkg syscall (darwin-amd64), type Timeval struct, Usec int32 +pkg syscall (darwin-amd64), type Timeval32 struct +pkg syscall (darwin-amd64), type Timeval32 struct, Sec int32 +pkg syscall (darwin-amd64), type Timeval32 struct, Usec int32 +pkg syscall (darwin-amd64), type WaitStatus uint32 +pkg syscall (darwin-amd64), var Stderr int +pkg syscall (darwin-amd64), var Stdin int +pkg syscall (darwin-amd64), var Stdout int +pkg syscall (darwin-amd64-cgo), const AF_APPLETALK ideal-int +pkg syscall (darwin-amd64-cgo), const AF_CCITT ideal-int +pkg syscall (darwin-amd64-cgo), const AF_CHAOS ideal-int +pkg syscall (darwin-amd64-cgo), const AF_CNT ideal-int +pkg syscall (darwin-amd64-cgo), const AF_COIP ideal-int +pkg syscall (darwin-amd64-cgo), const AF_DATAKIT ideal-int +pkg syscall (darwin-amd64-cgo), const AF_DECnet ideal-int +pkg syscall (darwin-amd64-cgo), const AF_DLI ideal-int +pkg syscall (darwin-amd64-cgo), const AF_E164 ideal-int +pkg syscall (darwin-amd64-cgo), const AF_ECMA ideal-int +pkg syscall (darwin-amd64-cgo), const AF_HYLINK ideal-int +pkg syscall (darwin-amd64-cgo), const AF_IEEE80211 ideal-int +pkg syscall (darwin-amd64-cgo), const AF_IMPLINK ideal-int +pkg syscall (darwin-amd64-cgo), const AF_IPX ideal-int +pkg syscall (darwin-amd64-cgo), const AF_ISDN ideal-int +pkg syscall (darwin-amd64-cgo), const AF_ISO ideal-int +pkg syscall (darwin-amd64-cgo), const AF_LAT ideal-int +pkg syscall (darwin-amd64-cgo), const AF_LINK ideal-int +pkg syscall (darwin-amd64-cgo), const AF_LOCAL ideal-int +pkg syscall (darwin-amd64-cgo), const AF_MAX ideal-int +pkg syscall (darwin-amd64-cgo), const AF_NATM ideal-int +pkg syscall (darwin-amd64-cgo), const AF_NDRV ideal-int +pkg syscall (darwin-amd64-cgo), const AF_NETBIOS ideal-int +pkg syscall (darwin-amd64-cgo), const AF_NS ideal-int +pkg syscall (darwin-amd64-cgo), const AF_OSI ideal-int +pkg syscall (darwin-amd64-cgo), const AF_PPP ideal-int +pkg syscall (darwin-amd64-cgo), const AF_PUP ideal-int +pkg syscall (darwin-amd64-cgo), const AF_RESERVED_36 ideal-int +pkg syscall (darwin-amd64-cgo), const AF_ROUTE ideal-int +pkg syscall (darwin-amd64-cgo), const AF_SIP ideal-int +pkg syscall (darwin-amd64-cgo), const AF_SNA ideal-int +pkg syscall (darwin-amd64-cgo), const AF_SYSTEM ideal-int +pkg syscall (darwin-amd64-cgo), const BIOCFLUSH ideal-int +pkg syscall (darwin-amd64-cgo), const BIOCGBLEN ideal-int +pkg syscall (darwin-amd64-cgo), const BIOCGDLT ideal-int +pkg syscall (darwin-amd64-cgo), const BIOCGDLTLIST ideal-int +pkg syscall (darwin-amd64-cgo), const BIOCGETIF ideal-int +pkg syscall (darwin-amd64-cgo), const BIOCGHDRCMPLT ideal-int +pkg syscall (darwin-amd64-cgo), const BIOCGRSIG ideal-int +pkg syscall (darwin-amd64-cgo), const BIOCGRTIMEOUT ideal-int +pkg syscall (darwin-amd64-cgo), const BIOCGSEESENT ideal-int +pkg syscall (darwin-amd64-cgo), const BIOCGSTATS ideal-int +pkg syscall (darwin-amd64-cgo), const BIOCIMMEDIATE ideal-int +pkg syscall (darwin-amd64-cgo), const BIOCPROMISC ideal-int +pkg syscall (darwin-amd64-cgo), const BIOCSBLEN ideal-int +pkg syscall (darwin-amd64-cgo), const BIOCSDLT ideal-int +pkg syscall (darwin-amd64-cgo), const BIOCSETF ideal-int +pkg syscall (darwin-amd64-cgo), const BIOCSETIF ideal-int +pkg syscall (darwin-amd64-cgo), const BIOCSHDRCMPLT ideal-int +pkg syscall (darwin-amd64-cgo), const BIOCSRSIG ideal-int +pkg syscall (darwin-amd64-cgo), const BIOCSRTIMEOUT ideal-int +pkg syscall (darwin-amd64-cgo), const BIOCSSEESENT ideal-int +pkg syscall (darwin-amd64-cgo), const BIOCVERSION ideal-int +pkg syscall (darwin-amd64-cgo), const BPF_A ideal-int +pkg syscall (darwin-amd64-cgo), const BPF_ABS ideal-int +pkg syscall (darwin-amd64-cgo), const BPF_ADD ideal-int +pkg syscall (darwin-amd64-cgo), const BPF_ALIGNMENT ideal-int +pkg syscall (darwin-amd64-cgo), const BPF_ALU ideal-int +pkg syscall (darwin-amd64-cgo), const BPF_AND ideal-int +pkg syscall (darwin-amd64-cgo), const BPF_B ideal-int +pkg syscall (darwin-amd64-cgo), const BPF_DIV ideal-int +pkg syscall (darwin-amd64-cgo), const BPF_H ideal-int +pkg syscall (darwin-amd64-cgo), const BPF_IMM ideal-int +pkg syscall (darwin-amd64-cgo), const BPF_IND ideal-int +pkg syscall (darwin-amd64-cgo), const BPF_JA ideal-int +pkg syscall (darwin-amd64-cgo), const BPF_JEQ ideal-int +pkg syscall (darwin-amd64-cgo), const BPF_JGE ideal-int +pkg syscall (darwin-amd64-cgo), const BPF_JGT ideal-int +pkg syscall (darwin-amd64-cgo), const BPF_JMP ideal-int +pkg syscall (darwin-amd64-cgo), const BPF_JSET ideal-int +pkg syscall (darwin-amd64-cgo), const BPF_K ideal-int +pkg syscall (darwin-amd64-cgo), const BPF_LD ideal-int +pkg syscall (darwin-amd64-cgo), const BPF_LDX ideal-int +pkg syscall (darwin-amd64-cgo), const BPF_LEN ideal-int +pkg syscall (darwin-amd64-cgo), const BPF_LSH ideal-int +pkg syscall (darwin-amd64-cgo), const BPF_MAJOR_VERSION ideal-int +pkg syscall (darwin-amd64-cgo), const BPF_MAXBUFSIZE ideal-int +pkg syscall (darwin-amd64-cgo), const BPF_MAXINSNS ideal-int +pkg syscall (darwin-amd64-cgo), const BPF_MEM ideal-int +pkg syscall (darwin-amd64-cgo), const BPF_MEMWORDS ideal-int +pkg syscall (darwin-amd64-cgo), const BPF_MINBUFSIZE ideal-int +pkg syscall (darwin-amd64-cgo), const BPF_MINOR_VERSION ideal-int +pkg syscall (darwin-amd64-cgo), const BPF_MISC ideal-int +pkg syscall (darwin-amd64-cgo), const BPF_MSH ideal-int +pkg syscall (darwin-amd64-cgo), const BPF_MUL ideal-int +pkg syscall (darwin-amd64-cgo), const BPF_NEG ideal-int +pkg syscall (darwin-amd64-cgo), const BPF_OR ideal-int +pkg syscall (darwin-amd64-cgo), const BPF_RELEASE ideal-int +pkg syscall (darwin-amd64-cgo), const BPF_RET ideal-int +pkg syscall (darwin-amd64-cgo), const BPF_RSH ideal-int +pkg syscall (darwin-amd64-cgo), const BPF_ST ideal-int +pkg syscall (darwin-amd64-cgo), const BPF_STX ideal-int +pkg syscall (darwin-amd64-cgo), const BPF_SUB ideal-int +pkg syscall (darwin-amd64-cgo), const BPF_TAX ideal-int +pkg syscall (darwin-amd64-cgo), const BPF_TXA ideal-int +pkg syscall (darwin-amd64-cgo), const BPF_W ideal-int +pkg syscall (darwin-amd64-cgo), const BPF_X ideal-int +pkg syscall (darwin-amd64-cgo), const CTL_MAXNAME ideal-int +pkg syscall (darwin-amd64-cgo), const CTL_NET ideal-int +pkg syscall (darwin-amd64-cgo), const DLT_APPLE_IP_OVER_IEEE1394 ideal-int +pkg syscall (darwin-amd64-cgo), const DLT_ARCNET ideal-int +pkg syscall (darwin-amd64-cgo), const DLT_ATM_CLIP ideal-int +pkg syscall (darwin-amd64-cgo), const DLT_ATM_RFC1483 ideal-int +pkg syscall (darwin-amd64-cgo), const DLT_AX25 ideal-int +pkg syscall (darwin-amd64-cgo), const DLT_CHAOS ideal-int +pkg syscall (darwin-amd64-cgo), const DLT_CHDLC ideal-int +pkg syscall (darwin-amd64-cgo), const DLT_C_HDLC ideal-int +pkg syscall (darwin-amd64-cgo), const DLT_EN10MB ideal-int +pkg syscall (darwin-amd64-cgo), const DLT_EN3MB ideal-int +pkg syscall (darwin-amd64-cgo), const DLT_FDDI ideal-int +pkg syscall (darwin-amd64-cgo), const DLT_IEEE802 ideal-int +pkg syscall (darwin-amd64-cgo), const DLT_IEEE802_11 ideal-int +pkg syscall (darwin-amd64-cgo), const DLT_IEEE802_11_RADIO ideal-int +pkg syscall (darwin-amd64-cgo), const DLT_IEEE802_11_RADIO_AVS ideal-int +pkg syscall (darwin-amd64-cgo), const DLT_LINUX_SLL ideal-int +pkg syscall (darwin-amd64-cgo), const DLT_LOOP ideal-int +pkg syscall (darwin-amd64-cgo), const DLT_NULL ideal-int +pkg syscall (darwin-amd64-cgo), const DLT_PFLOG ideal-int +pkg syscall (darwin-amd64-cgo), const DLT_PFSYNC ideal-int +pkg syscall (darwin-amd64-cgo), const DLT_PPP ideal-int +pkg syscall (darwin-amd64-cgo), const DLT_PPP_BSDOS ideal-int +pkg syscall (darwin-amd64-cgo), const DLT_PPP_SERIAL ideal-int +pkg syscall (darwin-amd64-cgo), const DLT_PRONET ideal-int +pkg syscall (darwin-amd64-cgo), const DLT_RAW ideal-int +pkg syscall (darwin-amd64-cgo), const DLT_SLIP ideal-int +pkg syscall (darwin-amd64-cgo), const DLT_SLIP_BSDOS ideal-int +pkg syscall (darwin-amd64-cgo), const DT_BLK ideal-int +pkg syscall (darwin-amd64-cgo), const DT_CHR ideal-int +pkg syscall (darwin-amd64-cgo), const DT_DIR ideal-int +pkg syscall (darwin-amd64-cgo), const DT_FIFO ideal-int +pkg syscall (darwin-amd64-cgo), const DT_LNK ideal-int +pkg syscall (darwin-amd64-cgo), const DT_REG ideal-int +pkg syscall (darwin-amd64-cgo), const DT_SOCK ideal-int +pkg syscall (darwin-amd64-cgo), const DT_UNKNOWN ideal-int +pkg syscall (darwin-amd64-cgo), const DT_WHT ideal-int +pkg syscall (darwin-amd64-cgo), const EAUTH Errno +pkg syscall (darwin-amd64-cgo), const EBADARCH Errno +pkg syscall (darwin-amd64-cgo), const EBADEXEC Errno +pkg syscall (darwin-amd64-cgo), const EBADMACHO Errno +pkg syscall (darwin-amd64-cgo), const EBADMSG Errno +pkg syscall (darwin-amd64-cgo), const EBADRPC Errno +pkg syscall (darwin-amd64-cgo), const ECHO ideal-int +pkg syscall (darwin-amd64-cgo), const ECHOCTL ideal-int +pkg syscall (darwin-amd64-cgo), const ECHOE ideal-int +pkg syscall (darwin-amd64-cgo), const ECHOK ideal-int +pkg syscall (darwin-amd64-cgo), const ECHOKE ideal-int +pkg syscall (darwin-amd64-cgo), const ECHONL ideal-int +pkg syscall (darwin-amd64-cgo), const ECHOPRT ideal-int +pkg syscall (darwin-amd64-cgo), const EDEVERR Errno +pkg syscall (darwin-amd64-cgo), const EFTYPE Errno +pkg syscall (darwin-amd64-cgo), const ELAST Errno +pkg syscall (darwin-amd64-cgo), const EMULTIHOP Errno +pkg syscall (darwin-amd64-cgo), const ENEEDAUTH Errno +pkg syscall (darwin-amd64-cgo), const ENOATTR Errno +pkg syscall (darwin-amd64-cgo), const ENODATA Errno +pkg syscall (darwin-amd64-cgo), const ENOLINK Errno +pkg syscall (darwin-amd64-cgo), const ENOPOLICY Errno +pkg syscall (darwin-amd64-cgo), const ENOSR Errno +pkg syscall (darwin-amd64-cgo), const ENOSTR Errno +pkg syscall (darwin-amd64-cgo), const ENOTRECOVERABLE Errno +pkg syscall (darwin-amd64-cgo), const EOWNERDEAD Errno +pkg syscall (darwin-amd64-cgo), const EPROCLIM Errno +pkg syscall (darwin-amd64-cgo), const EPROCUNAVAIL Errno +pkg syscall (darwin-amd64-cgo), const EPROGMISMATCH Errno +pkg syscall (darwin-amd64-cgo), const EPROGUNAVAIL Errno +pkg syscall (darwin-amd64-cgo), const EPROTO Errno +pkg syscall (darwin-amd64-cgo), const EPWROFF Errno +pkg syscall (darwin-amd64-cgo), const ERPCMISMATCH Errno +pkg syscall (darwin-amd64-cgo), const ESHLIBVERS Errno +pkg syscall (darwin-amd64-cgo), const ETIME Errno +pkg syscall (darwin-amd64-cgo), const EVFILT_AIO ideal-int +pkg syscall (darwin-amd64-cgo), const EVFILT_FS ideal-int +pkg syscall (darwin-amd64-cgo), const EVFILT_MACHPORT ideal-int +pkg syscall (darwin-amd64-cgo), const EVFILT_PROC ideal-int +pkg syscall (darwin-amd64-cgo), const EVFILT_READ ideal-int +pkg syscall (darwin-amd64-cgo), const EVFILT_SIGNAL ideal-int +pkg syscall (darwin-amd64-cgo), const EVFILT_SYSCOUNT ideal-int +pkg syscall (darwin-amd64-cgo), const EVFILT_THREADMARKER ideal-int +pkg syscall (darwin-amd64-cgo), const EVFILT_TIMER ideal-int +pkg syscall (darwin-amd64-cgo), const EVFILT_USER ideal-int +pkg syscall (darwin-amd64-cgo), const EVFILT_VM ideal-int +pkg syscall (darwin-amd64-cgo), const EVFILT_VNODE ideal-int +pkg syscall (darwin-amd64-cgo), const EVFILT_WRITE ideal-int +pkg syscall (darwin-amd64-cgo), const EV_ADD ideal-int +pkg syscall (darwin-amd64-cgo), const EV_CLEAR ideal-int +pkg syscall (darwin-amd64-cgo), const EV_DELETE ideal-int +pkg syscall (darwin-amd64-cgo), const EV_DISABLE ideal-int +pkg syscall (darwin-amd64-cgo), const EV_DISPATCH ideal-int +pkg syscall (darwin-amd64-cgo), const EV_ENABLE ideal-int +pkg syscall (darwin-amd64-cgo), const EV_EOF ideal-int +pkg syscall (darwin-amd64-cgo), const EV_ERROR ideal-int +pkg syscall (darwin-amd64-cgo), const EV_FLAG0 ideal-int +pkg syscall (darwin-amd64-cgo), const EV_FLAG1 ideal-int +pkg syscall (darwin-amd64-cgo), const EV_ONESHOT ideal-int +pkg syscall (darwin-amd64-cgo), const EV_OOBAND ideal-int +pkg syscall (darwin-amd64-cgo), const EV_POLL ideal-int +pkg syscall (darwin-amd64-cgo), const EV_RECEIPT ideal-int +pkg syscall (darwin-amd64-cgo), const EV_SYSFLAGS ideal-int +pkg syscall (darwin-amd64-cgo), const EXTA ideal-int +pkg syscall (darwin-amd64-cgo), const EXTB ideal-int +pkg syscall (darwin-amd64-cgo), const EXTPROC ideal-int +pkg syscall (darwin-amd64-cgo), const FD_CLOEXEC ideal-int +pkg syscall (darwin-amd64-cgo), const FD_SETSIZE ideal-int +pkg syscall (darwin-amd64-cgo), const F_ADDFILESIGS ideal-int +pkg syscall (darwin-amd64-cgo), const F_ADDSIGS ideal-int +pkg syscall (darwin-amd64-cgo), const F_ALLOCATEALL ideal-int +pkg syscall (darwin-amd64-cgo), const F_ALLOCATECONTIG ideal-int +pkg syscall (darwin-amd64-cgo), const F_CHKCLEAN ideal-int +pkg syscall (darwin-amd64-cgo), const F_DUPFD ideal-int +pkg syscall (darwin-amd64-cgo), const F_DUPFD_CLOEXEC ideal-int +pkg syscall (darwin-amd64-cgo), const F_FLUSH_DATA ideal-int +pkg syscall (darwin-amd64-cgo), const F_FREEZE_FS ideal-int +pkg syscall (darwin-amd64-cgo), const F_FULLFSYNC ideal-int +pkg syscall (darwin-amd64-cgo), const F_GETFD ideal-int +pkg syscall (darwin-amd64-cgo), const F_GETFL ideal-int +pkg syscall (darwin-amd64-cgo), const F_GETLK ideal-int +pkg syscall (darwin-amd64-cgo), const F_GETLKPID ideal-int +pkg syscall (darwin-amd64-cgo), const F_GETNOSIGPIPE ideal-int +pkg syscall (darwin-amd64-cgo), const F_GETOWN ideal-int +pkg syscall (darwin-amd64-cgo), const F_GETPATH ideal-int +pkg syscall (darwin-amd64-cgo), const F_GETPATH_MTMINFO ideal-int +pkg syscall (darwin-amd64-cgo), const F_GETPROTECTIONCLASS ideal-int +pkg syscall (darwin-amd64-cgo), const F_GLOBAL_NOCACHE ideal-int +pkg syscall (darwin-amd64-cgo), const F_LOG2PHYS ideal-int +pkg syscall (darwin-amd64-cgo), const F_LOG2PHYS_EXT ideal-int +pkg syscall (darwin-amd64-cgo), const F_MARKDEPENDENCY ideal-int +pkg syscall (darwin-amd64-cgo), const F_NOCACHE ideal-int +pkg syscall (darwin-amd64-cgo), const F_NODIRECT ideal-int +pkg syscall (darwin-amd64-cgo), const F_OK ideal-int +pkg syscall (darwin-amd64-cgo), const F_PATHPKG_CHECK ideal-int +pkg syscall (darwin-amd64-cgo), const F_PEOFPOSMODE ideal-int +pkg syscall (darwin-amd64-cgo), const F_PREALLOCATE ideal-int +pkg syscall (darwin-amd64-cgo), const F_RDADVISE ideal-int +pkg syscall (darwin-amd64-cgo), const F_RDAHEAD ideal-int +pkg syscall (darwin-amd64-cgo), const F_RDLCK ideal-int +pkg syscall (darwin-amd64-cgo), const F_READBOOTSTRAP ideal-int +pkg syscall (darwin-amd64-cgo), const F_SETBACKINGSTORE ideal-int +pkg syscall (darwin-amd64-cgo), const F_SETFD ideal-int +pkg syscall (darwin-amd64-cgo), const F_SETFL ideal-int +pkg syscall (darwin-amd64-cgo), const F_SETLK ideal-int +pkg syscall (darwin-amd64-cgo), const F_SETLKW ideal-int +pkg syscall (darwin-amd64-cgo), const F_SETNOSIGPIPE ideal-int +pkg syscall (darwin-amd64-cgo), const F_SETOWN ideal-int +pkg syscall (darwin-amd64-cgo), const F_SETPROTECTIONCLASS ideal-int +pkg syscall (darwin-amd64-cgo), const F_SETSIZE ideal-int +pkg syscall (darwin-amd64-cgo), const F_THAW_FS ideal-int +pkg syscall (darwin-amd64-cgo), const F_UNLCK ideal-int +pkg syscall (darwin-amd64-cgo), const F_VOLPOSMODE ideal-int +pkg syscall (darwin-amd64-cgo), const F_WRITEBOOTSTRAP ideal-int +pkg syscall (darwin-amd64-cgo), const F_WRLCK ideal-int +pkg syscall (darwin-amd64-cgo), const IFF_ALLMULTI ideal-int +pkg syscall (darwin-amd64-cgo), const IFF_ALTPHYS ideal-int +pkg syscall (darwin-amd64-cgo), const IFF_DEBUG ideal-int +pkg syscall (darwin-amd64-cgo), const IFF_LINK0 ideal-int +pkg syscall (darwin-amd64-cgo), const IFF_LINK1 ideal-int +pkg syscall (darwin-amd64-cgo), const IFF_LINK2 ideal-int +pkg syscall (darwin-amd64-cgo), const IFF_NOARP ideal-int +pkg syscall (darwin-amd64-cgo), const IFF_NOTRAILERS ideal-int +pkg syscall (darwin-amd64-cgo), const IFF_OACTIVE ideal-int +pkg syscall (darwin-amd64-cgo), const IFF_POINTOPOINT ideal-int +pkg syscall (darwin-amd64-cgo), const IFF_PROMISC ideal-int +pkg syscall (darwin-amd64-cgo), const IFF_RUNNING ideal-int +pkg syscall (darwin-amd64-cgo), const IFF_SIMPLEX ideal-int +pkg syscall (darwin-amd64-cgo), const IFNAMSIZ ideal-int +pkg syscall (darwin-amd64-cgo), const IFT_1822 ideal-int +pkg syscall (darwin-amd64-cgo), const IFT_AAL5 ideal-int +pkg syscall (darwin-amd64-cgo), const IFT_ARCNET ideal-int +pkg syscall (darwin-amd64-cgo), const IFT_ARCNETPLUS ideal-int +pkg syscall (darwin-amd64-cgo), const IFT_ATM ideal-int +pkg syscall (darwin-amd64-cgo), const IFT_BRIDGE ideal-int +pkg syscall (darwin-amd64-cgo), const IFT_CARP ideal-int +pkg syscall (darwin-amd64-cgo), const IFT_CELLULAR ideal-int +pkg syscall (darwin-amd64-cgo), const IFT_CEPT ideal-int +pkg syscall (darwin-amd64-cgo), const IFT_DS3 ideal-int +pkg syscall (darwin-amd64-cgo), const IFT_ENC ideal-int +pkg syscall (darwin-amd64-cgo), const IFT_EON ideal-int +pkg syscall (darwin-amd64-cgo), const IFT_ETHER ideal-int +pkg syscall (darwin-amd64-cgo), const IFT_FAITH ideal-int +pkg syscall (darwin-amd64-cgo), const IFT_FDDI ideal-int +pkg syscall (darwin-amd64-cgo), const IFT_FRELAY ideal-int +pkg syscall (darwin-amd64-cgo), const IFT_FRELAYDCE ideal-int +pkg syscall (darwin-amd64-cgo), const IFT_GIF ideal-int +pkg syscall (darwin-amd64-cgo), const IFT_HDH1822 ideal-int +pkg syscall (darwin-amd64-cgo), const IFT_HIPPI ideal-int +pkg syscall (darwin-amd64-cgo), const IFT_HSSI ideal-int +pkg syscall (darwin-amd64-cgo), const IFT_HY ideal-int +pkg syscall (darwin-amd64-cgo), const IFT_IEEE1394 ideal-int +pkg syscall (darwin-amd64-cgo), const IFT_IEEE8023ADLAG ideal-int +pkg syscall (darwin-amd64-cgo), const IFT_ISDNBASIC ideal-int +pkg syscall (darwin-amd64-cgo), const IFT_ISDNPRIMARY ideal-int +pkg syscall (darwin-amd64-cgo), const IFT_ISO88022LLC ideal-int +pkg syscall (darwin-amd64-cgo), const IFT_ISO88023 ideal-int +pkg syscall (darwin-amd64-cgo), const IFT_ISO88024 ideal-int +pkg syscall (darwin-amd64-cgo), const IFT_ISO88025 ideal-int +pkg syscall (darwin-amd64-cgo), const IFT_ISO88026 ideal-int +pkg syscall (darwin-amd64-cgo), const IFT_L2VLAN ideal-int +pkg syscall (darwin-amd64-cgo), const IFT_LAPB ideal-int +pkg syscall (darwin-amd64-cgo), const IFT_LOCALTALK ideal-int +pkg syscall (darwin-amd64-cgo), const IFT_LOOP ideal-int +pkg syscall (darwin-amd64-cgo), const IFT_MIOX25 ideal-int +pkg syscall (darwin-amd64-cgo), const IFT_MODEM ideal-int +pkg syscall (darwin-amd64-cgo), const IFT_NSIP ideal-int +pkg syscall (darwin-amd64-cgo), const IFT_OTHER ideal-int +pkg syscall (darwin-amd64-cgo), const IFT_P10 ideal-int +pkg syscall (darwin-amd64-cgo), const IFT_P80 ideal-int +pkg syscall (darwin-amd64-cgo), const IFT_PARA ideal-int +pkg syscall (darwin-amd64-cgo), const IFT_PDP ideal-int +pkg syscall (darwin-amd64-cgo), const IFT_PFLOG ideal-int +pkg syscall (darwin-amd64-cgo), const IFT_PFSYNC ideal-int +pkg syscall (darwin-amd64-cgo), const IFT_PPP ideal-int +pkg syscall (darwin-amd64-cgo), const IFT_PROPMUX ideal-int +pkg syscall (darwin-amd64-cgo), const IFT_PROPVIRTUAL ideal-int +pkg syscall (darwin-amd64-cgo), const IFT_PTPSERIAL ideal-int +pkg syscall (darwin-amd64-cgo), const IFT_RS232 ideal-int +pkg syscall (darwin-amd64-cgo), const IFT_SDLC ideal-int +pkg syscall (darwin-amd64-cgo), const IFT_SIP ideal-int +pkg syscall (darwin-amd64-cgo), const IFT_SLIP ideal-int +pkg syscall (darwin-amd64-cgo), const IFT_SMDSDXI ideal-int +pkg syscall (darwin-amd64-cgo), const IFT_SMDSICIP ideal-int +pkg syscall (darwin-amd64-cgo), const IFT_SONET ideal-int +pkg syscall (darwin-amd64-cgo), const IFT_SONETPATH ideal-int +pkg syscall (darwin-amd64-cgo), const IFT_SONETVT ideal-int +pkg syscall (darwin-amd64-cgo), const IFT_STARLAN ideal-int +pkg syscall (darwin-amd64-cgo), const IFT_STF ideal-int +pkg syscall (darwin-amd64-cgo), const IFT_T1 ideal-int +pkg syscall (darwin-amd64-cgo), const IFT_ULTRA ideal-int +pkg syscall (darwin-amd64-cgo), const IFT_V35 ideal-int +pkg syscall (darwin-amd64-cgo), const IFT_X25 ideal-int +pkg syscall (darwin-amd64-cgo), const IFT_X25DDN ideal-int +pkg syscall (darwin-amd64-cgo), const IFT_X25PLE ideal-int +pkg syscall (darwin-amd64-cgo), const IFT_XETHER ideal-int +pkg syscall (darwin-amd64-cgo), const IN_CLASSA_HOST ideal-int +pkg syscall (darwin-amd64-cgo), const IN_CLASSA_MAX ideal-int +pkg syscall (darwin-amd64-cgo), const IN_CLASSA_NET ideal-int +pkg syscall (darwin-amd64-cgo), const IN_CLASSA_NSHIFT ideal-int +pkg syscall (darwin-amd64-cgo), const IN_CLASSB_HOST ideal-int +pkg syscall (darwin-amd64-cgo), const IN_CLASSB_MAX ideal-int +pkg syscall (darwin-amd64-cgo), const IN_CLASSB_NET ideal-int +pkg syscall (darwin-amd64-cgo), const IN_CLASSB_NSHIFT ideal-int +pkg syscall (darwin-amd64-cgo), const IN_CLASSC_HOST ideal-int +pkg syscall (darwin-amd64-cgo), const IN_CLASSC_NET ideal-int +pkg syscall (darwin-amd64-cgo), const IN_CLASSC_NSHIFT ideal-int +pkg syscall (darwin-amd64-cgo), const IN_CLASSD_HOST ideal-int +pkg syscall (darwin-amd64-cgo), const IN_CLASSD_NET ideal-int +pkg syscall (darwin-amd64-cgo), const IN_CLASSD_NSHIFT ideal-int +pkg syscall (darwin-amd64-cgo), const IN_LINKLOCALNETNUM ideal-int +pkg syscall (darwin-amd64-cgo), const IN_LOOPBACKNET ideal-int +pkg syscall (darwin-amd64-cgo), const IPPROTO_3PC ideal-int +pkg syscall (darwin-amd64-cgo), const IPPROTO_ADFS ideal-int +pkg syscall (darwin-amd64-cgo), const IPPROTO_AH ideal-int +pkg syscall (darwin-amd64-cgo), const IPPROTO_AHIP ideal-int +pkg syscall (darwin-amd64-cgo), const IPPROTO_APES ideal-int +pkg syscall (darwin-amd64-cgo), const IPPROTO_ARGUS ideal-int +pkg syscall (darwin-amd64-cgo), const IPPROTO_AX25 ideal-int +pkg syscall (darwin-amd64-cgo), const IPPROTO_BHA ideal-int +pkg syscall (darwin-amd64-cgo), const IPPROTO_BLT ideal-int +pkg syscall (darwin-amd64-cgo), const IPPROTO_BRSATMON ideal-int +pkg syscall (darwin-amd64-cgo), const IPPROTO_CFTP ideal-int +pkg syscall (darwin-amd64-cgo), const IPPROTO_CHAOS ideal-int +pkg syscall (darwin-amd64-cgo), const IPPROTO_CMTP ideal-int +pkg syscall (darwin-amd64-cgo), const IPPROTO_CPHB ideal-int +pkg syscall (darwin-amd64-cgo), const IPPROTO_CPNX ideal-int +pkg syscall (darwin-amd64-cgo), const IPPROTO_DDP ideal-int +pkg syscall (darwin-amd64-cgo), const IPPROTO_DGP ideal-int +pkg syscall (darwin-amd64-cgo), const IPPROTO_DIVERT ideal-int +pkg syscall (darwin-amd64-cgo), const IPPROTO_DONE ideal-int +pkg syscall (darwin-amd64-cgo), const IPPROTO_DSTOPTS ideal-int +pkg syscall (darwin-amd64-cgo), const IPPROTO_EGP ideal-int +pkg syscall (darwin-amd64-cgo), const IPPROTO_EMCON ideal-int +pkg syscall (darwin-amd64-cgo), const IPPROTO_ENCAP ideal-int +pkg syscall (darwin-amd64-cgo), const IPPROTO_EON ideal-int +pkg syscall (darwin-amd64-cgo), const IPPROTO_ESP ideal-int +pkg syscall (darwin-amd64-cgo), const IPPROTO_ETHERIP ideal-int +pkg syscall (darwin-amd64-cgo), const IPPROTO_FRAGMENT ideal-int +pkg syscall (darwin-amd64-cgo), const IPPROTO_GGP ideal-int +pkg syscall (darwin-amd64-cgo), const IPPROTO_GMTP ideal-int +pkg syscall (darwin-amd64-cgo), const IPPROTO_GRE ideal-int +pkg syscall (darwin-amd64-cgo), const IPPROTO_HELLO ideal-int +pkg syscall (darwin-amd64-cgo), const IPPROTO_HMP ideal-int +pkg syscall (darwin-amd64-cgo), const IPPROTO_HOPOPTS ideal-int +pkg syscall (darwin-amd64-cgo), const IPPROTO_ICMP ideal-int +pkg syscall (darwin-amd64-cgo), const IPPROTO_ICMPV6 ideal-int +pkg syscall (darwin-amd64-cgo), const IPPROTO_IDP ideal-int +pkg syscall (darwin-amd64-cgo), const IPPROTO_IDPR ideal-int +pkg syscall (darwin-amd64-cgo), const IPPROTO_IDRP ideal-int +pkg syscall (darwin-amd64-cgo), const IPPROTO_IGMP ideal-int +pkg syscall (darwin-amd64-cgo), const IPPROTO_IGP ideal-int +pkg syscall (darwin-amd64-cgo), const IPPROTO_IGRP ideal-int +pkg syscall (darwin-amd64-cgo), const IPPROTO_IL ideal-int +pkg syscall (darwin-amd64-cgo), const IPPROTO_INLSP ideal-int +pkg syscall (darwin-amd64-cgo), const IPPROTO_INP ideal-int +pkg syscall (darwin-amd64-cgo), const IPPROTO_IPCOMP ideal-int +pkg syscall (darwin-amd64-cgo), const IPPROTO_IPCV ideal-int +pkg syscall (darwin-amd64-cgo), const IPPROTO_IPEIP ideal-int +pkg syscall (darwin-amd64-cgo), const IPPROTO_IPIP ideal-int +pkg syscall (darwin-amd64-cgo), const IPPROTO_IPPC ideal-int +pkg syscall (darwin-amd64-cgo), const IPPROTO_IPV4 ideal-int +pkg syscall (darwin-amd64-cgo), const IPPROTO_IRTP ideal-int +pkg syscall (darwin-amd64-cgo), const IPPROTO_KRYPTOLAN ideal-int +pkg syscall (darwin-amd64-cgo), const IPPROTO_LARP ideal-int +pkg syscall (darwin-amd64-cgo), const IPPROTO_LEAF1 ideal-int +pkg syscall (darwin-amd64-cgo), const IPPROTO_LEAF2 ideal-int +pkg syscall (darwin-amd64-cgo), const IPPROTO_MAX ideal-int +pkg syscall (darwin-amd64-cgo), const IPPROTO_MAXID ideal-int +pkg syscall (darwin-amd64-cgo), const IPPROTO_MEAS ideal-int +pkg syscall (darwin-amd64-cgo), const IPPROTO_MHRP ideal-int +pkg syscall (darwin-amd64-cgo), const IPPROTO_MICP ideal-int +pkg syscall (darwin-amd64-cgo), const IPPROTO_MTP ideal-int +pkg syscall (darwin-amd64-cgo), const IPPROTO_MUX ideal-int +pkg syscall (darwin-amd64-cgo), const IPPROTO_ND ideal-int +pkg syscall (darwin-amd64-cgo), const IPPROTO_NHRP ideal-int +pkg syscall (darwin-amd64-cgo), const IPPROTO_NONE ideal-int +pkg syscall (darwin-amd64-cgo), const IPPROTO_NSP ideal-int +pkg syscall (darwin-amd64-cgo), const IPPROTO_NVPII ideal-int +pkg syscall (darwin-amd64-cgo), const IPPROTO_OSPFIGP ideal-int +pkg syscall (darwin-amd64-cgo), const IPPROTO_PGM ideal-int +pkg syscall (darwin-amd64-cgo), const IPPROTO_PIGP ideal-int +pkg syscall (darwin-amd64-cgo), const IPPROTO_PIM ideal-int +pkg syscall (darwin-amd64-cgo), const IPPROTO_PRM ideal-int +pkg syscall (darwin-amd64-cgo), const IPPROTO_PUP ideal-int +pkg syscall (darwin-amd64-cgo), const IPPROTO_PVP ideal-int +pkg syscall (darwin-amd64-cgo), const IPPROTO_RAW ideal-int +pkg syscall (darwin-amd64-cgo), const IPPROTO_RCCMON ideal-int +pkg syscall (darwin-amd64-cgo), const IPPROTO_RDP ideal-int +pkg syscall (darwin-amd64-cgo), const IPPROTO_ROUTING ideal-int +pkg syscall (darwin-amd64-cgo), const IPPROTO_RSVP ideal-int +pkg syscall (darwin-amd64-cgo), const IPPROTO_RVD ideal-int +pkg syscall (darwin-amd64-cgo), const IPPROTO_SATEXPAK ideal-int +pkg syscall (darwin-amd64-cgo), const IPPROTO_SATMON ideal-int +pkg syscall (darwin-amd64-cgo), const IPPROTO_SCCSP ideal-int +pkg syscall (darwin-amd64-cgo), const IPPROTO_SCTP ideal-int +pkg syscall (darwin-amd64-cgo), const IPPROTO_SDRP ideal-int +pkg syscall (darwin-amd64-cgo), const IPPROTO_SEP ideal-int +pkg syscall (darwin-amd64-cgo), const IPPROTO_SRPC ideal-int +pkg syscall (darwin-amd64-cgo), const IPPROTO_ST ideal-int +pkg syscall (darwin-amd64-cgo), const IPPROTO_SVMTP ideal-int +pkg syscall (darwin-amd64-cgo), const IPPROTO_SWIPE ideal-int +pkg syscall (darwin-amd64-cgo), const IPPROTO_TCF ideal-int +pkg syscall (darwin-amd64-cgo), const IPPROTO_TP ideal-int +pkg syscall (darwin-amd64-cgo), const IPPROTO_TPXX ideal-int +pkg syscall (darwin-amd64-cgo), const IPPROTO_TRUNK1 ideal-int +pkg syscall (darwin-amd64-cgo), const IPPROTO_TRUNK2 ideal-int +pkg syscall (darwin-amd64-cgo), const IPPROTO_TTP ideal-int +pkg syscall (darwin-amd64-cgo), const IPPROTO_VINES ideal-int +pkg syscall (darwin-amd64-cgo), const IPPROTO_VISA ideal-int +pkg syscall (darwin-amd64-cgo), const IPPROTO_VMTP ideal-int +pkg syscall (darwin-amd64-cgo), const IPPROTO_WBEXPAK ideal-int +pkg syscall (darwin-amd64-cgo), const IPPROTO_WBMON ideal-int +pkg syscall (darwin-amd64-cgo), const IPPROTO_WSN ideal-int +pkg syscall (darwin-amd64-cgo), const IPPROTO_XNET ideal-int +pkg syscall (darwin-amd64-cgo), const IPPROTO_XTP ideal-int +pkg syscall (darwin-amd64-cgo), const IPV6_2292DSTOPTS ideal-int +pkg syscall (darwin-amd64-cgo), const IPV6_2292HOPLIMIT ideal-int +pkg syscall (darwin-amd64-cgo), const IPV6_2292HOPOPTS ideal-int +pkg syscall (darwin-amd64-cgo), const IPV6_2292NEXTHOP ideal-int +pkg syscall (darwin-amd64-cgo), const IPV6_2292PKTINFO ideal-int +pkg syscall (darwin-amd64-cgo), const IPV6_2292PKTOPTIONS ideal-int +pkg syscall (darwin-amd64-cgo), const IPV6_2292RTHDR ideal-int +pkg syscall (darwin-amd64-cgo), const IPV6_BINDV6ONLY ideal-int +pkg syscall (darwin-amd64-cgo), const IPV6_BOUND_IF ideal-int +pkg syscall (darwin-amd64-cgo), const IPV6_CHECKSUM ideal-int +pkg syscall (darwin-amd64-cgo), const IPV6_DEFAULT_MULTICAST_HOPS ideal-int +pkg syscall (darwin-amd64-cgo), const IPV6_DEFAULT_MULTICAST_LOOP ideal-int +pkg syscall (darwin-amd64-cgo), const IPV6_DEFHLIM ideal-int +pkg syscall (darwin-amd64-cgo), const IPV6_FAITH ideal-int +pkg syscall (darwin-amd64-cgo), const IPV6_FLOWINFO_MASK ideal-int +pkg syscall (darwin-amd64-cgo), const IPV6_FLOWLABEL_MASK ideal-int +pkg syscall (darwin-amd64-cgo), const IPV6_FRAGTTL ideal-int +pkg syscall (darwin-amd64-cgo), const IPV6_FW_ADD ideal-int +pkg syscall (darwin-amd64-cgo), const IPV6_FW_DEL ideal-int +pkg syscall (darwin-amd64-cgo), const IPV6_FW_FLUSH ideal-int +pkg syscall (darwin-amd64-cgo), const IPV6_FW_GET ideal-int +pkg syscall (darwin-amd64-cgo), const IPV6_FW_ZERO ideal-int +pkg syscall (darwin-amd64-cgo), const IPV6_HLIMDEC ideal-int +pkg syscall (darwin-amd64-cgo), const IPV6_IPSEC_POLICY ideal-int +pkg syscall (darwin-amd64-cgo), const IPV6_MAXHLIM ideal-int +pkg syscall (darwin-amd64-cgo), const IPV6_MAXOPTHDR ideal-int +pkg syscall (darwin-amd64-cgo), const IPV6_MAXPACKET ideal-int +pkg syscall (darwin-amd64-cgo), const IPV6_MAX_GROUP_SRC_FILTER ideal-int +pkg syscall (darwin-amd64-cgo), const IPV6_MAX_MEMBERSHIPS ideal-int +pkg syscall (darwin-amd64-cgo), const IPV6_MAX_SOCK_SRC_FILTER ideal-int +pkg syscall (darwin-amd64-cgo), const IPV6_MIN_MEMBERSHIPS ideal-int +pkg syscall (darwin-amd64-cgo), const IPV6_MMTU ideal-int +pkg syscall (darwin-amd64-cgo), const IPV6_PORTRANGE ideal-int +pkg syscall (darwin-amd64-cgo), const IPV6_PORTRANGE_DEFAULT ideal-int +pkg syscall (darwin-amd64-cgo), const IPV6_PORTRANGE_HIGH ideal-int +pkg syscall (darwin-amd64-cgo), const IPV6_PORTRANGE_LOW ideal-int +pkg syscall (darwin-amd64-cgo), const IPV6_RECVTCLASS ideal-int +pkg syscall (darwin-amd64-cgo), const IPV6_RTHDR_LOOSE ideal-int +pkg syscall (darwin-amd64-cgo), const IPV6_RTHDR_STRICT ideal-int +pkg syscall (darwin-amd64-cgo), const IPV6_RTHDR_TYPE_0 ideal-int +pkg syscall (darwin-amd64-cgo), const IPV6_SOCKOPT_RESERVED1 ideal-int +pkg syscall (darwin-amd64-cgo), const IPV6_TCLASS ideal-int +pkg syscall (darwin-amd64-cgo), const IPV6_VERSION ideal-int +pkg syscall (darwin-amd64-cgo), const IPV6_VERSION_MASK ideal-int +pkg syscall (darwin-amd64-cgo), const IP_ADD_SOURCE_MEMBERSHIP ideal-int +pkg syscall (darwin-amd64-cgo), const IP_BLOCK_SOURCE ideal-int +pkg syscall (darwin-amd64-cgo), const IP_BOUND_IF ideal-int +pkg syscall (darwin-amd64-cgo), const IP_DEFAULT_MULTICAST_LOOP ideal-int +pkg syscall (darwin-amd64-cgo), const IP_DEFAULT_MULTICAST_TTL ideal-int +pkg syscall (darwin-amd64-cgo), const IP_DF ideal-int +pkg syscall (darwin-amd64-cgo), const IP_DROP_SOURCE_MEMBERSHIP ideal-int +pkg syscall (darwin-amd64-cgo), const IP_DUMMYNET_CONFIGURE ideal-int +pkg syscall (darwin-amd64-cgo), const IP_DUMMYNET_DEL ideal-int +pkg syscall (darwin-amd64-cgo), const IP_DUMMYNET_FLUSH ideal-int +pkg syscall (darwin-amd64-cgo), const IP_DUMMYNET_GET ideal-int +pkg syscall (darwin-amd64-cgo), const IP_FAITH ideal-int +pkg syscall (darwin-amd64-cgo), const IP_FW_ADD ideal-int +pkg syscall (darwin-amd64-cgo), const IP_FW_DEL ideal-int +pkg syscall (darwin-amd64-cgo), const IP_FW_FLUSH ideal-int +pkg syscall (darwin-amd64-cgo), const IP_FW_GET ideal-int +pkg syscall (darwin-amd64-cgo), const IP_FW_RESETLOG ideal-int +pkg syscall (darwin-amd64-cgo), const IP_FW_ZERO ideal-int +pkg syscall (darwin-amd64-cgo), const IP_HDRINCL ideal-int +pkg syscall (darwin-amd64-cgo), const IP_IPSEC_POLICY ideal-int +pkg syscall (darwin-amd64-cgo), const IP_MAXPACKET ideal-int +pkg syscall (darwin-amd64-cgo), const IP_MAX_GROUP_SRC_FILTER ideal-int +pkg syscall (darwin-amd64-cgo), const IP_MAX_MEMBERSHIPS ideal-int +pkg syscall (darwin-amd64-cgo), const IP_MAX_SOCK_MUTE_FILTER ideal-int +pkg syscall (darwin-amd64-cgo), const IP_MAX_SOCK_SRC_FILTER ideal-int +pkg syscall (darwin-amd64-cgo), const IP_MF ideal-int +pkg syscall (darwin-amd64-cgo), const IP_MIN_MEMBERSHIPS ideal-int +pkg syscall (darwin-amd64-cgo), const IP_MSFILTER ideal-int +pkg syscall (darwin-amd64-cgo), const IP_MSS ideal-int +pkg syscall (darwin-amd64-cgo), const IP_MULTICAST_IFINDEX ideal-int +pkg syscall (darwin-amd64-cgo), const IP_MULTICAST_VIF ideal-int +pkg syscall (darwin-amd64-cgo), const IP_NAT__XXX ideal-int +pkg syscall (darwin-amd64-cgo), const IP_OFFMASK ideal-int +pkg syscall (darwin-amd64-cgo), const IP_OLD_FW_ADD ideal-int +pkg syscall (darwin-amd64-cgo), const IP_OLD_FW_DEL ideal-int +pkg syscall (darwin-amd64-cgo), const IP_OLD_FW_FLUSH ideal-int +pkg syscall (darwin-amd64-cgo), const IP_OLD_FW_GET ideal-int +pkg syscall (darwin-amd64-cgo), const IP_OLD_FW_RESETLOG ideal-int +pkg syscall (darwin-amd64-cgo), const IP_OLD_FW_ZERO ideal-int +pkg syscall (darwin-amd64-cgo), const IP_OPTIONS ideal-int +pkg syscall (darwin-amd64-cgo), const IP_PKTINFO ideal-int +pkg syscall (darwin-amd64-cgo), const IP_PORTRANGE ideal-int +pkg syscall (darwin-amd64-cgo), const IP_PORTRANGE_DEFAULT ideal-int +pkg syscall (darwin-amd64-cgo), const IP_PORTRANGE_HIGH ideal-int +pkg syscall (darwin-amd64-cgo), const IP_PORTRANGE_LOW ideal-int +pkg syscall (darwin-amd64-cgo), const IP_RECVDSTADDR ideal-int +pkg syscall (darwin-amd64-cgo), const IP_RECVIF ideal-int +pkg syscall (darwin-amd64-cgo), const IP_RECVOPTS ideal-int +pkg syscall (darwin-amd64-cgo), const IP_RECVPKTINFO ideal-int +pkg syscall (darwin-amd64-cgo), const IP_RECVRETOPTS ideal-int +pkg syscall (darwin-amd64-cgo), const IP_RECVTTL ideal-int +pkg syscall (darwin-amd64-cgo), const IP_RETOPTS ideal-int +pkg syscall (darwin-amd64-cgo), const IP_RF ideal-int +pkg syscall (darwin-amd64-cgo), const IP_RSVP_OFF ideal-int +pkg syscall (darwin-amd64-cgo), const IP_RSVP_ON ideal-int +pkg syscall (darwin-amd64-cgo), const IP_RSVP_VIF_OFF ideal-int +pkg syscall (darwin-amd64-cgo), const IP_RSVP_VIF_ON ideal-int +pkg syscall (darwin-amd64-cgo), const IP_STRIPHDR ideal-int +pkg syscall (darwin-amd64-cgo), const IP_TRAFFIC_MGT_BACKGROUND ideal-int +pkg syscall (darwin-amd64-cgo), const IP_UNBLOCK_SOURCE ideal-int +pkg syscall (darwin-amd64-cgo), const LOCK_EX ideal-int +pkg syscall (darwin-amd64-cgo), const LOCK_NB ideal-int +pkg syscall (darwin-amd64-cgo), const LOCK_SH ideal-int +pkg syscall (darwin-amd64-cgo), const LOCK_UN ideal-int +pkg syscall (darwin-amd64-cgo), const MADV_CAN_REUSE ideal-int +pkg syscall (darwin-amd64-cgo), const MADV_DONTNEED ideal-int +pkg syscall (darwin-amd64-cgo), const MADV_FREE ideal-int +pkg syscall (darwin-amd64-cgo), const MADV_FREE_REUSABLE ideal-int +pkg syscall (darwin-amd64-cgo), const MADV_FREE_REUSE ideal-int +pkg syscall (darwin-amd64-cgo), const MADV_NORMAL ideal-int +pkg syscall (darwin-amd64-cgo), const MADV_RANDOM ideal-int +pkg syscall (darwin-amd64-cgo), const MADV_SEQUENTIAL ideal-int +pkg syscall (darwin-amd64-cgo), const MADV_WILLNEED ideal-int +pkg syscall (darwin-amd64-cgo), const MADV_ZERO_WIRED_PAGES ideal-int +pkg syscall (darwin-amd64-cgo), const MAP_ANON ideal-int +pkg syscall (darwin-amd64-cgo), const MAP_COPY ideal-int +pkg syscall (darwin-amd64-cgo), const MAP_FILE ideal-int +pkg syscall (darwin-amd64-cgo), const MAP_FIXED ideal-int +pkg syscall (darwin-amd64-cgo), const MAP_HASSEMAPHORE ideal-int +pkg syscall (darwin-amd64-cgo), const MAP_JIT ideal-int +pkg syscall (darwin-amd64-cgo), const MAP_NOCACHE ideal-int +pkg syscall (darwin-amd64-cgo), const MAP_NOEXTEND ideal-int +pkg syscall (darwin-amd64-cgo), const MAP_NORESERVE ideal-int +pkg syscall (darwin-amd64-cgo), const MAP_PRIVATE ideal-int +pkg syscall (darwin-amd64-cgo), const MAP_RENAME ideal-int +pkg syscall (darwin-amd64-cgo), const MAP_RESERVED0080 ideal-int +pkg syscall (darwin-amd64-cgo), const MAP_SHARED ideal-int +pkg syscall (darwin-amd64-cgo), const MCL_CURRENT ideal-int +pkg syscall (darwin-amd64-cgo), const MCL_FUTURE ideal-int +pkg syscall (darwin-amd64-cgo), const MSG_CTRUNC ideal-int +pkg syscall (darwin-amd64-cgo), const MSG_DONTROUTE ideal-int +pkg syscall (darwin-amd64-cgo), const MSG_DONTWAIT ideal-int +pkg syscall (darwin-amd64-cgo), const MSG_EOF ideal-int +pkg syscall (darwin-amd64-cgo), const MSG_EOR ideal-int +pkg syscall (darwin-amd64-cgo), const MSG_FLUSH ideal-int +pkg syscall (darwin-amd64-cgo), const MSG_HAVEMORE ideal-int +pkg syscall (darwin-amd64-cgo), const MSG_HOLD ideal-int +pkg syscall (darwin-amd64-cgo), const MSG_NEEDSA ideal-int +pkg syscall (darwin-amd64-cgo), const MSG_OOB ideal-int +pkg syscall (darwin-amd64-cgo), const MSG_PEEK ideal-int +pkg syscall (darwin-amd64-cgo), const MSG_RCVMORE ideal-int +pkg syscall (darwin-amd64-cgo), const MSG_SEND ideal-int +pkg syscall (darwin-amd64-cgo), const MSG_TRUNC ideal-int +pkg syscall (darwin-amd64-cgo), const MSG_WAITALL ideal-int +pkg syscall (darwin-amd64-cgo), const MSG_WAITSTREAM ideal-int +pkg syscall (darwin-amd64-cgo), const MS_ASYNC ideal-int +pkg syscall (darwin-amd64-cgo), const MS_DEACTIVATE ideal-int +pkg syscall (darwin-amd64-cgo), const MS_INVALIDATE ideal-int +pkg syscall (darwin-amd64-cgo), const MS_KILLPAGES ideal-int +pkg syscall (darwin-amd64-cgo), const MS_SYNC ideal-int +pkg syscall (darwin-amd64-cgo), const NAME_MAX ideal-int +pkg syscall (darwin-amd64-cgo), const NET_RT_DUMP ideal-int +pkg syscall (darwin-amd64-cgo), const NET_RT_DUMP2 ideal-int +pkg syscall (darwin-amd64-cgo), const NET_RT_FLAGS ideal-int +pkg syscall (darwin-amd64-cgo), const NET_RT_IFLIST ideal-int +pkg syscall (darwin-amd64-cgo), const NET_RT_IFLIST2 ideal-int +pkg syscall (darwin-amd64-cgo), const NET_RT_MAXID ideal-int +pkg syscall (darwin-amd64-cgo), const NET_RT_STAT ideal-int +pkg syscall (darwin-amd64-cgo), const NET_RT_TRASH ideal-int +pkg syscall (darwin-amd64-cgo), const NOTE_ABSOLUTE ideal-int +pkg syscall (darwin-amd64-cgo), const NOTE_ATTRIB ideal-int +pkg syscall (darwin-amd64-cgo), const NOTE_CHILD ideal-int +pkg syscall (darwin-amd64-cgo), const NOTE_DELETE ideal-int +pkg syscall (darwin-amd64-cgo), const NOTE_EXEC ideal-int +pkg syscall (darwin-amd64-cgo), const NOTE_EXIT ideal-int +pkg syscall (darwin-amd64-cgo), const NOTE_EXITSTATUS ideal-int +pkg syscall (darwin-amd64-cgo), const NOTE_EXTEND ideal-int +pkg syscall (darwin-amd64-cgo), const NOTE_FFAND ideal-int +pkg syscall (darwin-amd64-cgo), const NOTE_FFCOPY ideal-int +pkg syscall (darwin-amd64-cgo), const NOTE_FFCTRLMASK ideal-int +pkg syscall (darwin-amd64-cgo), const NOTE_FFLAGSMASK ideal-int +pkg syscall (darwin-amd64-cgo), const NOTE_FFNOP ideal-int +pkg syscall (darwin-amd64-cgo), const NOTE_FFOR ideal-int +pkg syscall (darwin-amd64-cgo), const NOTE_FORK ideal-int +pkg syscall (darwin-amd64-cgo), const NOTE_LINK ideal-int +pkg syscall (darwin-amd64-cgo), const NOTE_LOWAT ideal-int +pkg syscall (darwin-amd64-cgo), const NOTE_NONE ideal-int +pkg syscall (darwin-amd64-cgo), const NOTE_NSECONDS ideal-int +pkg syscall (darwin-amd64-cgo), const NOTE_PCTRLMASK ideal-int +pkg syscall (darwin-amd64-cgo), const NOTE_PDATAMASK ideal-int +pkg syscall (darwin-amd64-cgo), const NOTE_REAP ideal-int +pkg syscall (darwin-amd64-cgo), const NOTE_RENAME ideal-int +pkg syscall (darwin-amd64-cgo), const NOTE_RESOURCEEND ideal-int +pkg syscall (darwin-amd64-cgo), const NOTE_REVOKE ideal-int +pkg syscall (darwin-amd64-cgo), const NOTE_SECONDS ideal-int +pkg syscall (darwin-amd64-cgo), const NOTE_SIGNAL ideal-int +pkg syscall (darwin-amd64-cgo), const NOTE_TRACK ideal-int +pkg syscall (darwin-amd64-cgo), const NOTE_TRACKERR ideal-int +pkg syscall (darwin-amd64-cgo), const NOTE_TRIGGER ideal-int +pkg syscall (darwin-amd64-cgo), const NOTE_USECONDS ideal-int +pkg syscall (darwin-amd64-cgo), const NOTE_VM_ERROR ideal-int +pkg syscall (darwin-amd64-cgo), const NOTE_VM_PRESSURE ideal-int +pkg syscall (darwin-amd64-cgo), const NOTE_VM_PRESSURE_SUDDEN_TERMINATE ideal-int +pkg syscall (darwin-amd64-cgo), const NOTE_VM_PRESSURE_TERMINATE ideal-int +pkg syscall (darwin-amd64-cgo), const NOTE_WRITE ideal-int +pkg syscall (darwin-amd64-cgo), const O_ACCMODE ideal-int +pkg syscall (darwin-amd64-cgo), const O_ALERT ideal-int +pkg syscall (darwin-amd64-cgo), const O_DIRECTORY ideal-int +pkg syscall (darwin-amd64-cgo), const O_DSYNC ideal-int +pkg syscall (darwin-amd64-cgo), const O_EVTONLY ideal-int +pkg syscall (darwin-amd64-cgo), const O_EXLOCK ideal-int +pkg syscall (darwin-amd64-cgo), const O_FSYNC ideal-int +pkg syscall (darwin-amd64-cgo), const O_NDELAY ideal-int +pkg syscall (darwin-amd64-cgo), const O_NOFOLLOW ideal-int +pkg syscall (darwin-amd64-cgo), const O_POPUP ideal-int +pkg syscall (darwin-amd64-cgo), const O_SHLOCK ideal-int +pkg syscall (darwin-amd64-cgo), const O_SYMLINK ideal-int +pkg syscall (darwin-amd64-cgo), const PROT_EXEC ideal-int +pkg syscall (darwin-amd64-cgo), const PROT_NONE ideal-int +pkg syscall (darwin-amd64-cgo), const PROT_READ ideal-int +pkg syscall (darwin-amd64-cgo), const PROT_WRITE ideal-int +pkg syscall (darwin-amd64-cgo), const PTRACE_CONT ideal-int +pkg syscall (darwin-amd64-cgo), const PTRACE_KILL ideal-int +pkg syscall (darwin-amd64-cgo), const PTRACE_TRACEME ideal-int +pkg syscall (darwin-amd64-cgo), const PT_ATTACH ideal-int +pkg syscall (darwin-amd64-cgo), const PT_ATTACHEXC ideal-int +pkg syscall (darwin-amd64-cgo), const PT_CONTINUE ideal-int +pkg syscall (darwin-amd64-cgo), const PT_DENY_ATTACH ideal-int +pkg syscall (darwin-amd64-cgo), const PT_DETACH ideal-int +pkg syscall (darwin-amd64-cgo), const PT_FIRSTMACH ideal-int +pkg syscall (darwin-amd64-cgo), const PT_FORCEQUOTA ideal-int +pkg syscall (darwin-amd64-cgo), const PT_KILL ideal-int +pkg syscall (darwin-amd64-cgo), const PT_READ_D ideal-int +pkg syscall (darwin-amd64-cgo), const PT_READ_I ideal-int +pkg syscall (darwin-amd64-cgo), const PT_READ_U ideal-int +pkg syscall (darwin-amd64-cgo), const PT_SIGEXC ideal-int +pkg syscall (darwin-amd64-cgo), const PT_STEP ideal-int +pkg syscall (darwin-amd64-cgo), const PT_THUPDATE ideal-int +pkg syscall (darwin-amd64-cgo), const PT_TRACE_ME ideal-int +pkg syscall (darwin-amd64-cgo), const PT_WRITE_D ideal-int +pkg syscall (darwin-amd64-cgo), const PT_WRITE_I ideal-int +pkg syscall (darwin-amd64-cgo), const PT_WRITE_U ideal-int +pkg syscall (darwin-amd64-cgo), const RLIMIT_AS ideal-int +pkg syscall (darwin-amd64-cgo), const RLIMIT_CORE ideal-int +pkg syscall (darwin-amd64-cgo), const RLIMIT_CPU ideal-int +pkg syscall (darwin-amd64-cgo), const RLIMIT_DATA ideal-int +pkg syscall (darwin-amd64-cgo), const RLIMIT_FSIZE ideal-int +pkg syscall (darwin-amd64-cgo), const RLIMIT_NOFILE ideal-int +pkg syscall (darwin-amd64-cgo), const RLIMIT_STACK ideal-int +pkg syscall (darwin-amd64-cgo), const RLIM_INFINITY ideal-int +pkg syscall (darwin-amd64-cgo), const RTAX_AUTHOR ideal-int +pkg syscall (darwin-amd64-cgo), const RTAX_BRD ideal-int +pkg syscall (darwin-amd64-cgo), const RTAX_DST ideal-int +pkg syscall (darwin-amd64-cgo), const RTAX_GATEWAY ideal-int +pkg syscall (darwin-amd64-cgo), const RTAX_GENMASK ideal-int +pkg syscall (darwin-amd64-cgo), const RTAX_IFA ideal-int +pkg syscall (darwin-amd64-cgo), const RTAX_IFP ideal-int +pkg syscall (darwin-amd64-cgo), const RTAX_MAX ideal-int +pkg syscall (darwin-amd64-cgo), const RTAX_NETMASK ideal-int +pkg syscall (darwin-amd64-cgo), const RTA_AUTHOR ideal-int +pkg syscall (darwin-amd64-cgo), const RTA_BRD ideal-int +pkg syscall (darwin-amd64-cgo), const RTA_DST ideal-int +pkg syscall (darwin-amd64-cgo), const RTA_GATEWAY ideal-int +pkg syscall (darwin-amd64-cgo), const RTA_GENMASK ideal-int +pkg syscall (darwin-amd64-cgo), const RTA_IFA ideal-int +pkg syscall (darwin-amd64-cgo), const RTA_IFP ideal-int +pkg syscall (darwin-amd64-cgo), const RTA_NETMASK ideal-int +pkg syscall (darwin-amd64-cgo), const RTF_BLACKHOLE ideal-int +pkg syscall (darwin-amd64-cgo), const RTF_BROADCAST ideal-int +pkg syscall (darwin-amd64-cgo), const RTF_CLONING ideal-int +pkg syscall (darwin-amd64-cgo), const RTF_CONDEMNED ideal-int +pkg syscall (darwin-amd64-cgo), const RTF_DELCLONE ideal-int +pkg syscall (darwin-amd64-cgo), const RTF_DONE ideal-int +pkg syscall (darwin-amd64-cgo), const RTF_DYNAMIC ideal-int +pkg syscall (darwin-amd64-cgo), const RTF_GATEWAY ideal-int +pkg syscall (darwin-amd64-cgo), const RTF_HOST ideal-int +pkg syscall (darwin-amd64-cgo), const RTF_IFREF ideal-int +pkg syscall (darwin-amd64-cgo), const RTF_IFSCOPE ideal-int +pkg syscall (darwin-amd64-cgo), const RTF_LLINFO ideal-int +pkg syscall (darwin-amd64-cgo), const RTF_LOCAL ideal-int +pkg syscall (darwin-amd64-cgo), const RTF_MODIFIED ideal-int +pkg syscall (darwin-amd64-cgo), const RTF_MULTICAST ideal-int +pkg syscall (darwin-amd64-cgo), const RTF_PINNED ideal-int +pkg syscall (darwin-amd64-cgo), const RTF_PRCLONING ideal-int +pkg syscall (darwin-amd64-cgo), const RTF_PROTO1 ideal-int +pkg syscall (darwin-amd64-cgo), const RTF_PROTO2 ideal-int +pkg syscall (darwin-amd64-cgo), const RTF_PROTO3 ideal-int +pkg syscall (darwin-amd64-cgo), const RTF_REJECT ideal-int +pkg syscall (darwin-amd64-cgo), const RTF_STATIC ideal-int +pkg syscall (darwin-amd64-cgo), const RTF_UP ideal-int +pkg syscall (darwin-amd64-cgo), const RTF_WASCLONED ideal-int +pkg syscall (darwin-amd64-cgo), const RTF_XRESOLVE ideal-int +pkg syscall (darwin-amd64-cgo), const RTM_ADD ideal-int +pkg syscall (darwin-amd64-cgo), const RTM_CHANGE ideal-int +pkg syscall (darwin-amd64-cgo), const RTM_DELADDR ideal-int +pkg syscall (darwin-amd64-cgo), const RTM_DELETE ideal-int +pkg syscall (darwin-amd64-cgo), const RTM_DELMADDR ideal-int +pkg syscall (darwin-amd64-cgo), const RTM_GET ideal-int +pkg syscall (darwin-amd64-cgo), const RTM_GET2 ideal-int +pkg syscall (darwin-amd64-cgo), const RTM_IFINFO ideal-int +pkg syscall (darwin-amd64-cgo), const RTM_IFINFO2 ideal-int +pkg syscall (darwin-amd64-cgo), const RTM_LOCK ideal-int +pkg syscall (darwin-amd64-cgo), const RTM_LOSING ideal-int +pkg syscall (darwin-amd64-cgo), const RTM_MISS ideal-int +pkg syscall (darwin-amd64-cgo), const RTM_NEWADDR ideal-int +pkg syscall (darwin-amd64-cgo), const RTM_NEWMADDR ideal-int +pkg syscall (darwin-amd64-cgo), const RTM_NEWMADDR2 ideal-int +pkg syscall (darwin-amd64-cgo), const RTM_OLDADD ideal-int +pkg syscall (darwin-amd64-cgo), const RTM_OLDDEL ideal-int +pkg syscall (darwin-amd64-cgo), const RTM_REDIRECT ideal-int +pkg syscall (darwin-amd64-cgo), const RTM_RESOLVE ideal-int +pkg syscall (darwin-amd64-cgo), const RTM_RTTUNIT ideal-int +pkg syscall (darwin-amd64-cgo), const RTM_VERSION ideal-int +pkg syscall (darwin-amd64-cgo), const RTV_EXPIRE ideal-int +pkg syscall (darwin-amd64-cgo), const RTV_HOPCOUNT ideal-int +pkg syscall (darwin-amd64-cgo), const RTV_MTU ideal-int +pkg syscall (darwin-amd64-cgo), const RTV_RPIPE ideal-int +pkg syscall (darwin-amd64-cgo), const RTV_RTT ideal-int +pkg syscall (darwin-amd64-cgo), const RTV_RTTVAR ideal-int +pkg syscall (darwin-amd64-cgo), const RTV_SPIPE ideal-int +pkg syscall (darwin-amd64-cgo), const RTV_SSTHRESH ideal-int +pkg syscall (darwin-amd64-cgo), const RUSAGE_CHILDREN ideal-int +pkg syscall (darwin-amd64-cgo), const RUSAGE_SELF ideal-int +pkg syscall (darwin-amd64-cgo), const SCM_CREDS ideal-int +pkg syscall (darwin-amd64-cgo), const SCM_RIGHTS ideal-int +pkg syscall (darwin-amd64-cgo), const SCM_TIMESTAMP ideal-int +pkg syscall (darwin-amd64-cgo), const SCM_TIMESTAMP_MONOTONIC ideal-int +pkg syscall (darwin-amd64-cgo), const SIGCHLD Signal +pkg syscall (darwin-amd64-cgo), const SIGCONT Signal +pkg syscall (darwin-amd64-cgo), const SIGEMT Signal +pkg syscall (darwin-amd64-cgo), const SIGINFO Signal +pkg syscall (darwin-amd64-cgo), const SIGIO Signal +pkg syscall (darwin-amd64-cgo), const SIGIOT Signal +pkg syscall (darwin-amd64-cgo), const SIGPROF Signal +pkg syscall (darwin-amd64-cgo), const SIGSTOP Signal +pkg syscall (darwin-amd64-cgo), const SIGSYS Signal +pkg syscall (darwin-amd64-cgo), const SIGTSTP Signal +pkg syscall (darwin-amd64-cgo), const SIGTTIN Signal +pkg syscall (darwin-amd64-cgo), const SIGTTOU Signal +pkg syscall (darwin-amd64-cgo), const SIGURG Signal +pkg syscall (darwin-amd64-cgo), const SIGUSR1 Signal +pkg syscall (darwin-amd64-cgo), const SIGUSR2 Signal +pkg syscall (darwin-amd64-cgo), const SIGVTALRM Signal +pkg syscall (darwin-amd64-cgo), const SIGWINCH Signal +pkg syscall (darwin-amd64-cgo), const SIGXCPU Signal +pkg syscall (darwin-amd64-cgo), const SIGXFSZ Signal +pkg syscall (darwin-amd64-cgo), const SIOCADDMULTI ideal-int +pkg syscall (darwin-amd64-cgo), const SIOCAIFADDR ideal-int +pkg syscall (darwin-amd64-cgo), const SIOCALIFADDR ideal-int +pkg syscall (darwin-amd64-cgo), const SIOCARPIPLL ideal-int +pkg syscall (darwin-amd64-cgo), const SIOCATMARK ideal-int +pkg syscall (darwin-amd64-cgo), const SIOCAUTOADDR ideal-int +pkg syscall (darwin-amd64-cgo), const SIOCAUTONETMASK ideal-int +pkg syscall (darwin-amd64-cgo), const SIOCDELMULTI ideal-int +pkg syscall (darwin-amd64-cgo), const SIOCDIFADDR ideal-int +pkg syscall (darwin-amd64-cgo), const SIOCDIFPHYADDR ideal-int +pkg syscall (darwin-amd64-cgo), const SIOCDLIFADDR ideal-int +pkg syscall (darwin-amd64-cgo), const SIOCGDRVSPEC ideal-int +pkg syscall (darwin-amd64-cgo), const SIOCGETSGCNT ideal-int +pkg syscall (darwin-amd64-cgo), const SIOCGETVIFCNT ideal-int +pkg syscall (darwin-amd64-cgo), const SIOCGETVLAN ideal-int +pkg syscall (darwin-amd64-cgo), const SIOCGHIWAT ideal-int +pkg syscall (darwin-amd64-cgo), const SIOCGIFADDR ideal-int +pkg syscall (darwin-amd64-cgo), const SIOCGIFALTMTU ideal-int +pkg syscall (darwin-amd64-cgo), const SIOCGIFASYNCMAP ideal-int +pkg syscall (darwin-amd64-cgo), const SIOCGIFBOND ideal-int +pkg syscall (darwin-amd64-cgo), const SIOCGIFBRDADDR ideal-int +pkg syscall (darwin-amd64-cgo), const SIOCGIFCAP ideal-int +pkg syscall (darwin-amd64-cgo), const SIOCGIFCONF ideal-int +pkg syscall (darwin-amd64-cgo), const SIOCGIFDEVMTU ideal-int +pkg syscall (darwin-amd64-cgo), const SIOCGIFDSTADDR ideal-int +pkg syscall (darwin-amd64-cgo), const SIOCGIFFLAGS ideal-int +pkg syscall (darwin-amd64-cgo), const SIOCGIFGENERIC ideal-int +pkg syscall (darwin-amd64-cgo), const SIOCGIFKPI ideal-int +pkg syscall (darwin-amd64-cgo), const SIOCGIFMAC ideal-int +pkg syscall (darwin-amd64-cgo), const SIOCGIFMEDIA ideal-int +pkg syscall (darwin-amd64-cgo), const SIOCGIFMETRIC ideal-int +pkg syscall (darwin-amd64-cgo), const SIOCGIFMTU ideal-int +pkg syscall (darwin-amd64-cgo), const SIOCGIFNETMASK ideal-int +pkg syscall (darwin-amd64-cgo), const SIOCGIFPDSTADDR ideal-int +pkg syscall (darwin-amd64-cgo), const SIOCGIFPHYS ideal-int +pkg syscall (darwin-amd64-cgo), const SIOCGIFPSRCADDR ideal-int +pkg syscall (darwin-amd64-cgo), const SIOCGIFSTATUS ideal-int +pkg syscall (darwin-amd64-cgo), const SIOCGIFVLAN ideal-int +pkg syscall (darwin-amd64-cgo), const SIOCGIFWAKEFLAGS ideal-int +pkg syscall (darwin-amd64-cgo), const SIOCGLIFADDR ideal-int +pkg syscall (darwin-amd64-cgo), const SIOCGLIFPHYADDR ideal-int +pkg syscall (darwin-amd64-cgo), const SIOCGLOWAT ideal-int +pkg syscall (darwin-amd64-cgo), const SIOCGPGRP ideal-int +pkg syscall (darwin-amd64-cgo), const SIOCIFCREATE ideal-int +pkg syscall (darwin-amd64-cgo), const SIOCIFCREATE2 ideal-int +pkg syscall (darwin-amd64-cgo), const SIOCIFDESTROY ideal-int +pkg syscall (darwin-amd64-cgo), const SIOCRSLVMULTI ideal-int +pkg syscall (darwin-amd64-cgo), const SIOCSDRVSPEC ideal-int +pkg syscall (darwin-amd64-cgo), const SIOCSETVLAN ideal-int +pkg syscall (darwin-amd64-cgo), const SIOCSHIWAT ideal-int +pkg syscall (darwin-amd64-cgo), const SIOCSIFADDR ideal-int +pkg syscall (darwin-amd64-cgo), const SIOCSIFALTMTU ideal-int +pkg syscall (darwin-amd64-cgo), const SIOCSIFASYNCMAP ideal-int +pkg syscall (darwin-amd64-cgo), const SIOCSIFBOND ideal-int +pkg syscall (darwin-amd64-cgo), const SIOCSIFBRDADDR ideal-int +pkg syscall (darwin-amd64-cgo), const SIOCSIFCAP ideal-int +pkg syscall (darwin-amd64-cgo), const SIOCSIFDSTADDR ideal-int +pkg syscall (darwin-amd64-cgo), const SIOCSIFFLAGS ideal-int +pkg syscall (darwin-amd64-cgo), const SIOCSIFGENERIC ideal-int +pkg syscall (darwin-amd64-cgo), const SIOCSIFKPI ideal-int +pkg syscall (darwin-amd64-cgo), const SIOCSIFLLADDR ideal-int +pkg syscall (darwin-amd64-cgo), const SIOCSIFMAC ideal-int +pkg syscall (darwin-amd64-cgo), const SIOCSIFMEDIA ideal-int +pkg syscall (darwin-amd64-cgo), const SIOCSIFMETRIC ideal-int +pkg syscall (darwin-amd64-cgo), const SIOCSIFMTU ideal-int +pkg syscall (darwin-amd64-cgo), const SIOCSIFNETMASK ideal-int +pkg syscall (darwin-amd64-cgo), const SIOCSIFPHYADDR ideal-int +pkg syscall (darwin-amd64-cgo), const SIOCSIFPHYS ideal-int +pkg syscall (darwin-amd64-cgo), const SIOCSIFVLAN ideal-int +pkg syscall (darwin-amd64-cgo), const SIOCSLIFPHYADDR ideal-int +pkg syscall (darwin-amd64-cgo), const SIOCSLOWAT ideal-int +pkg syscall (darwin-amd64-cgo), const SIOCSPGRP ideal-int +pkg syscall (darwin-amd64-cgo), const SOCK_MAXADDRLEN ideal-int +pkg syscall (darwin-amd64-cgo), const SOCK_RDM ideal-int +pkg syscall (darwin-amd64-cgo), const SO_ACCEPTCONN ideal-int +pkg syscall (darwin-amd64-cgo), const SO_DEBUG ideal-int +pkg syscall (darwin-amd64-cgo), const SO_DONTTRUNC ideal-int +pkg syscall (darwin-amd64-cgo), const SO_ERROR ideal-int +pkg syscall (darwin-amd64-cgo), const SO_LABEL ideal-int +pkg syscall (darwin-amd64-cgo), const SO_LINGER_SEC ideal-int +pkg syscall (darwin-amd64-cgo), const SO_NKE ideal-int +pkg syscall (darwin-amd64-cgo), const SO_NOADDRERR ideal-int +pkg syscall (darwin-amd64-cgo), const SO_NOSIGPIPE ideal-int +pkg syscall (darwin-amd64-cgo), const SO_NOTIFYCONFLICT ideal-int +pkg syscall (darwin-amd64-cgo), const SO_NP_EXTENSIONS ideal-int +pkg syscall (darwin-amd64-cgo), const SO_NREAD ideal-int +pkg syscall (darwin-amd64-cgo), const SO_NWRITE ideal-int +pkg syscall (darwin-amd64-cgo), const SO_OOBINLINE ideal-int +pkg syscall (darwin-amd64-cgo), const SO_PEERLABEL ideal-int +pkg syscall (darwin-amd64-cgo), const SO_RANDOMPORT ideal-int +pkg syscall (darwin-amd64-cgo), const SO_RCVLOWAT ideal-int +pkg syscall (darwin-amd64-cgo), const SO_RCVTIMEO ideal-int +pkg syscall (darwin-amd64-cgo), const SO_RESTRICTIONS ideal-int +pkg syscall (darwin-amd64-cgo), const SO_RESTRICT_DENYIN ideal-int +pkg syscall (darwin-amd64-cgo), const SO_RESTRICT_DENYOUT ideal-int +pkg syscall (darwin-amd64-cgo), const SO_RESTRICT_DENYSET ideal-int +pkg syscall (darwin-amd64-cgo), const SO_REUSEPORT ideal-int +pkg syscall (darwin-amd64-cgo), const SO_REUSESHAREUID ideal-int +pkg syscall (darwin-amd64-cgo), const SO_SNDLOWAT ideal-int +pkg syscall (darwin-amd64-cgo), const SO_SNDTIMEO ideal-int +pkg syscall (darwin-amd64-cgo), const SO_TIMESTAMP ideal-int +pkg syscall (darwin-amd64-cgo), const SO_TIMESTAMP_MONOTONIC ideal-int +pkg syscall (darwin-amd64-cgo), const SO_TYPE ideal-int +pkg syscall (darwin-amd64-cgo), const SO_UPCALLCLOSEWAIT ideal-int +pkg syscall (darwin-amd64-cgo), const SO_USELOOPBACK ideal-int +pkg syscall (darwin-amd64-cgo), const SO_WANTMORE ideal-int +pkg syscall (darwin-amd64-cgo), const SO_WANTOOBFLAG ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_ACCEPT ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_ACCEPT_NOCANCEL ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_ACCESS ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_ACCESS_EXTENDED ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_ACCT ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_ADD_PROFIL ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_ADJTIME ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_AIO_CANCEL ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_AIO_ERROR ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_AIO_FSYNC ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_AIO_READ ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_AIO_RETURN ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_AIO_SUSPEND ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_AIO_SUSPEND_NOCANCEL ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_AIO_WRITE ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_ATGETMSG ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_ATPGETREQ ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_ATPGETRSP ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_ATPSNDREQ ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_ATPSNDRSP ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_ATPUTMSG ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_ATSOCKET ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_AUDIT ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_AUDITCTL ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_AUDITON ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_AUDIT_SESSION_JOIN ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_AUDIT_SESSION_PORT ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_AUDIT_SESSION_SELF ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_BIND ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_BSDTHREAD_CREATE ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_BSDTHREAD_REGISTER ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_BSDTHREAD_TERMINATE ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_CHDIR ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_CHFLAGS ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_CHMOD ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_CHMOD_EXTENDED ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_CHOWN ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_CHROOT ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_CHUD ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_CLOSE ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_CLOSE_NOCANCEL ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_CONNECT ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_CONNECT_NOCANCEL ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_COPYFILE ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_CSOPS ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_DELETE ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_DUP ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_DUP2 ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_EXCHANGEDATA ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_EXECVE ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_EXIT ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_FCHDIR ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_FCHFLAGS ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_FCHMOD ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_FCHMOD_EXTENDED ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_FCHOWN ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_FCNTL ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_FCNTL_NOCANCEL ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_FDATASYNC ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_FFSCTL ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_FGETATTRLIST ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_FGETXATTR ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_FHOPEN ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_FILEPORT_MAKEFD ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_FILEPORT_MAKEPORT ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_FLISTXATTR ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_FLOCK ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_FORK ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_FPATHCONF ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_FREMOVEXATTR ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_FSCTL ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_FSETATTRLIST ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_FSETXATTR ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_FSGETPATH ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_FSTAT ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_FSTAT64 ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_FSTAT64_EXTENDED ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_FSTATFS ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_FSTATFS64 ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_FSTATV ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_FSTAT_EXTENDED ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_FSYNC ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_FSYNC_NOCANCEL ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_FTRUNCATE ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_FUTIMES ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_GETATTRLIST ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_GETAUDIT ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_GETAUDIT_ADDR ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_GETAUID ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_GETDIRENTRIES ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_GETDIRENTRIES64 ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_GETDIRENTRIESATTR ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_GETDTABLESIZE ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_GETEGID ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_GETEUID ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_GETFH ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_GETFSSTAT ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_GETFSSTAT64 ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_GETGID ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_GETGROUPS ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_GETHOSTUUID ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_GETITIMER ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_GETLCID ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_GETLOGIN ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_GETPEERNAME ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_GETPGID ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_GETPGRP ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_GETPID ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_GETPPID ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_GETPRIORITY ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_GETRLIMIT ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_GETRUSAGE ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_GETSGROUPS ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_GETSID ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_GETSOCKNAME ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_GETSOCKOPT ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_GETTID ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_GETTIMEOFDAY ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_GETUID ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_GETWGROUPS ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_GETXATTR ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_IDENTITYSVC ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_INITGROUPS ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_IOCTL ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_IOPOLICYSYS ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_ISSETUGID ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_KDEBUG_TRACE ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_KEVENT ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_KEVENT64 ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_KILL ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_KQUEUE ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_LCHOWN ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_LINK ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_LIO_LISTIO ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_LISTEN ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_LISTXATTR ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_LSEEK ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_LSTAT ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_LSTAT64 ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_LSTAT64_EXTENDED ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_LSTATV ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_LSTAT_EXTENDED ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_MADVISE ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_MAXSYSCALL ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_MINCORE ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_MINHERIT ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_MKCOMPLEX ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_MKDIR ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_MKDIR_EXTENDED ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_MKFIFO ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_MKFIFO_EXTENDED ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_MKNOD ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_MLOCK ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_MLOCKALL ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_MMAP ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_MODWATCH ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_MOUNT ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_MPROTECT ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_MSGCTL ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_MSGGET ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_MSGRCV ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_MSGRCV_NOCANCEL ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_MSGSND ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_MSGSND_NOCANCEL ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_MSGSYS ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_MSYNC ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_MSYNC_NOCANCEL ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_MUNLOCK ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_MUNLOCKALL ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_MUNMAP ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_NFSCLNT ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_NFSSVC ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_OPEN ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_OPEN_EXTENDED ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_OPEN_NOCANCEL ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_PATHCONF ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_PID_HIBERNATE ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_PID_RESUME ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_PID_SHUTDOWN_SOCKETS ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_PID_SUSPEND ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_PIPE ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_POLL ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_POLL_NOCANCEL ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_POSIX_SPAWN ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_PREAD ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_PREAD_NOCANCEL ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_PROCESS_POLICY ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_PROC_INFO ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_PROFIL ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_PSYNCH_CVBROAD ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_PSYNCH_CVCLRPREPOST ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_PSYNCH_CVSIGNAL ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_PSYNCH_CVWAIT ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_PSYNCH_MUTEXDROP ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_PSYNCH_MUTEXWAIT ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_PSYNCH_RW_DOWNGRADE ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_PSYNCH_RW_LONGRDLOCK ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_PSYNCH_RW_RDLOCK ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_PSYNCH_RW_UNLOCK ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_PSYNCH_RW_UNLOCK2 ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_PSYNCH_RW_UPGRADE ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_PSYNCH_RW_WRLOCK ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_PSYNCH_RW_YIELDWRLOCK ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_PTRACE ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_PWRITE ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_PWRITE_NOCANCEL ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_QUOTACTL ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_READ ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_READLINK ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_READV ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_READV_NOCANCEL ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_READ_NOCANCEL ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_REBOOT ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_RECVFROM ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_RECVFROM_NOCANCEL ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_RECVMSG ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_RECVMSG_NOCANCEL ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_REMOVEXATTR ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_RENAME ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_REVOKE ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_RMDIR ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_SEARCHFS ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_SELECT ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_SELECT_NOCANCEL ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_SEMCTL ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_SEMGET ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_SEMOP ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_SEMSYS ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_SEM_CLOSE ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_SEM_DESTROY ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_SEM_GETVALUE ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_SEM_INIT ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_SEM_OPEN ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_SEM_POST ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_SEM_TRYWAIT ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_SEM_UNLINK ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_SEM_WAIT ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_SEM_WAIT_NOCANCEL ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_SENDFILE ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_SENDMSG ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_SENDMSG_NOCANCEL ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_SENDTO ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_SENDTO_NOCANCEL ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_SETATTRLIST ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_SETAUDIT ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_SETAUDIT_ADDR ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_SETAUID ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_SETEGID ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_SETEUID ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_SETGID ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_SETGROUPS ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_SETITIMER ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_SETLCID ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_SETLOGIN ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_SETPGID ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_SETPRIORITY ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_SETPRIVEXEC ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_SETREGID ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_SETREUID ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_SETRLIMIT ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_SETSGROUPS ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_SETSID ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_SETSOCKOPT ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_SETTID ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_SETTID_WITH_PID ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_SETTIMEOFDAY ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_SETUID ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_SETWGROUPS ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_SETXATTR ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_SHARED_REGION_CHECK_NP ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_SHARED_REGION_MAP_AND_SLIDE_NP ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_SHMAT ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_SHMCTL ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_SHMDT ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_SHMGET ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_SHMSYS ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_SHM_OPEN ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_SHM_UNLINK ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_SHUTDOWN ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_SIGACTION ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_SIGALTSTACK ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_SIGPENDING ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_SIGPROCMASK ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_SIGRETURN ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_SIGSUSPEND ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_SIGSUSPEND_NOCANCEL ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_SOCKET ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_SOCKETPAIR ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_STACK_SNAPSHOT ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_STAT ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_STAT64 ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_STAT64_EXTENDED ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_STATFS ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_STATFS64 ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_STATV ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_STAT_EXTENDED ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_SWAPON ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_SYMLINK ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_SYNC ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_SYSCALL ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_THREAD_SELFID ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_TRUNCATE ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_UMASK ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_UMASK_EXTENDED ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_UNDELETE ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_UNLINK ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_UNMOUNT ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_UTIMES ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_VFORK ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_VM_PRESSURE_MONITOR ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_WAIT4 ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_WAIT4_NOCANCEL ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_WAITEVENT ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_WAITID ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_WAITID_NOCANCEL ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_WATCHEVENT ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_WORKQ_KERNRETURN ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_WORKQ_OPEN ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_WRITE ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_WRITEV ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_WRITEV_NOCANCEL ideal-int +pkg syscall (darwin-amd64-cgo), const SYS_WRITE_NOCANCEL ideal-int +pkg syscall (darwin-amd64-cgo), const SYS___DISABLE_THREADSIGNAL ideal-int +pkg syscall (darwin-amd64-cgo), const SYS___MAC_EXECVE ideal-int +pkg syscall (darwin-amd64-cgo), const SYS___MAC_GETFSSTAT ideal-int +pkg syscall (darwin-amd64-cgo), const SYS___MAC_GET_FD ideal-int +pkg syscall (darwin-amd64-cgo), const SYS___MAC_GET_FILE ideal-int +pkg syscall (darwin-amd64-cgo), const SYS___MAC_GET_LCID ideal-int +pkg syscall (darwin-amd64-cgo), const SYS___MAC_GET_LCTX ideal-int +pkg syscall (darwin-amd64-cgo), const SYS___MAC_GET_LINK ideal-int +pkg syscall (darwin-amd64-cgo), const SYS___MAC_GET_MOUNT ideal-int +pkg syscall (darwin-amd64-cgo), const SYS___MAC_GET_PID ideal-int +pkg syscall (darwin-amd64-cgo), const SYS___MAC_GET_PROC ideal-int +pkg syscall (darwin-amd64-cgo), const SYS___MAC_MOUNT ideal-int +pkg syscall (darwin-amd64-cgo), const SYS___MAC_SET_FD ideal-int +pkg syscall (darwin-amd64-cgo), const SYS___MAC_SET_FILE ideal-int +pkg syscall (darwin-amd64-cgo), const SYS___MAC_SET_LCTX ideal-int +pkg syscall (darwin-amd64-cgo), const SYS___MAC_SET_LINK ideal-int +pkg syscall (darwin-amd64-cgo), const SYS___MAC_SET_PROC ideal-int +pkg syscall (darwin-amd64-cgo), const SYS___MAC_SYSCALL ideal-int +pkg syscall (darwin-amd64-cgo), const SYS___OLD_SEMWAIT_SIGNAL ideal-int +pkg syscall (darwin-amd64-cgo), const SYS___OLD_SEMWAIT_SIGNAL_NOCANCEL ideal-int +pkg syscall (darwin-amd64-cgo), const SYS___PTHREAD_CANCELED ideal-int +pkg syscall (darwin-amd64-cgo), const SYS___PTHREAD_CHDIR ideal-int +pkg syscall (darwin-amd64-cgo), const SYS___PTHREAD_FCHDIR ideal-int +pkg syscall (darwin-amd64-cgo), const SYS___PTHREAD_KILL ideal-int +pkg syscall (darwin-amd64-cgo), const SYS___PTHREAD_MARKCANCEL ideal-int +pkg syscall (darwin-amd64-cgo), const SYS___PTHREAD_SIGMASK ideal-int +pkg syscall (darwin-amd64-cgo), const SYS___SEMWAIT_SIGNAL ideal-int +pkg syscall (darwin-amd64-cgo), const SYS___SEMWAIT_SIGNAL_NOCANCEL ideal-int +pkg syscall (darwin-amd64-cgo), const SYS___SIGWAIT ideal-int +pkg syscall (darwin-amd64-cgo), const SYS___SIGWAIT_NOCANCEL ideal-int +pkg syscall (darwin-amd64-cgo), const SYS___SYSCTL ideal-int +pkg syscall (darwin-amd64-cgo), const S_IEXEC ideal-int +pkg syscall (darwin-amd64-cgo), const S_IFWHT ideal-int +pkg syscall (darwin-amd64-cgo), const S_IREAD ideal-int +pkg syscall (darwin-amd64-cgo), const S_IRGRP ideal-int +pkg syscall (darwin-amd64-cgo), const S_IROTH ideal-int +pkg syscall (darwin-amd64-cgo), const S_IRWXG ideal-int +pkg syscall (darwin-amd64-cgo), const S_IRWXO ideal-int +pkg syscall (darwin-amd64-cgo), const S_IRWXU ideal-int +pkg syscall (darwin-amd64-cgo), const S_ISTXT ideal-int +pkg syscall (darwin-amd64-cgo), const S_IWGRP ideal-int +pkg syscall (darwin-amd64-cgo), const S_IWOTH ideal-int +pkg syscall (darwin-amd64-cgo), const S_IWRITE ideal-int +pkg syscall (darwin-amd64-cgo), const S_IXGRP ideal-int +pkg syscall (darwin-amd64-cgo), const S_IXOTH ideal-int +pkg syscall (darwin-amd64-cgo), const SizeofBpfHdr ideal-int +pkg syscall (darwin-amd64-cgo), const SizeofBpfInsn ideal-int +pkg syscall (darwin-amd64-cgo), const SizeofBpfProgram ideal-int +pkg syscall (darwin-amd64-cgo), const SizeofBpfStat ideal-int +pkg syscall (darwin-amd64-cgo), const SizeofBpfVersion ideal-int +pkg syscall (darwin-amd64-cgo), const SizeofCmsghdr ideal-int +pkg syscall (darwin-amd64-cgo), const SizeofIPMreq ideal-int +pkg syscall (darwin-amd64-cgo), const SizeofIPv6Mreq ideal-int +pkg syscall (darwin-amd64-cgo), const SizeofIfData ideal-int +pkg syscall (darwin-amd64-cgo), const SizeofIfMsghdr ideal-int +pkg syscall (darwin-amd64-cgo), const SizeofIfaMsghdr ideal-int +pkg syscall (darwin-amd64-cgo), const SizeofIfmaMsghdr ideal-int +pkg syscall (darwin-amd64-cgo), const SizeofIfmaMsghdr2 ideal-int +pkg syscall (darwin-amd64-cgo), const SizeofInet6Pktinfo ideal-int +pkg syscall (darwin-amd64-cgo), const SizeofLinger ideal-int +pkg syscall (darwin-amd64-cgo), const SizeofMsghdr ideal-int +pkg syscall (darwin-amd64-cgo), const SizeofRtMetrics ideal-int +pkg syscall (darwin-amd64-cgo), const SizeofRtMsghdr ideal-int +pkg syscall (darwin-amd64-cgo), const SizeofSockaddrAny ideal-int +pkg syscall (darwin-amd64-cgo), const SizeofSockaddrDatalink ideal-int +pkg syscall (darwin-amd64-cgo), const SizeofSockaddrInet4 ideal-int +pkg syscall (darwin-amd64-cgo), const SizeofSockaddrInet6 ideal-int +pkg syscall (darwin-amd64-cgo), const SizeofSockaddrUnix ideal-int +pkg syscall (darwin-amd64-cgo), const TCP_CONNECTIONTIMEOUT ideal-int +pkg syscall (darwin-amd64-cgo), const TCP_KEEPALIVE ideal-int +pkg syscall (darwin-amd64-cgo), const TCP_MAXHLEN ideal-int +pkg syscall (darwin-amd64-cgo), const TCP_MAXOLEN ideal-int +pkg syscall (darwin-amd64-cgo), const TCP_MAXSEG ideal-int +pkg syscall (darwin-amd64-cgo), const TCP_MAXWIN ideal-int +pkg syscall (darwin-amd64-cgo), const TCP_MAX_SACK ideal-int +pkg syscall (darwin-amd64-cgo), const TCP_MAX_WINSHIFT ideal-int +pkg syscall (darwin-amd64-cgo), const TCP_MINMSS ideal-int +pkg syscall (darwin-amd64-cgo), const TCP_MINMSSOVERLOAD ideal-int +pkg syscall (darwin-amd64-cgo), const TCP_MSS ideal-int +pkg syscall (darwin-amd64-cgo), const TCP_NOOPT ideal-int +pkg syscall (darwin-amd64-cgo), const TCP_NOPUSH ideal-int +pkg syscall (darwin-amd64-cgo), const TCP_RXT_CONNDROPTIME ideal-int +pkg syscall (darwin-amd64-cgo), const TCP_RXT_FINDROP ideal-int +pkg syscall (darwin-amd64-cgo), const TIOCCBRK ideal-int +pkg syscall (darwin-amd64-cgo), const TIOCCDTR ideal-int +pkg syscall (darwin-amd64-cgo), const TIOCCONS ideal-int +pkg syscall (darwin-amd64-cgo), const TIOCDCDTIMESTAMP ideal-int +pkg syscall (darwin-amd64-cgo), const TIOCDRAIN ideal-int +pkg syscall (darwin-amd64-cgo), const TIOCDSIMICROCODE ideal-int +pkg syscall (darwin-amd64-cgo), const TIOCEXCL ideal-int +pkg syscall (darwin-amd64-cgo), const TIOCEXT ideal-int +pkg syscall (darwin-amd64-cgo), const TIOCFLUSH ideal-int +pkg syscall (darwin-amd64-cgo), const TIOCGDRAINWAIT ideal-int +pkg syscall (darwin-amd64-cgo), const TIOCGETA ideal-int +pkg syscall (darwin-amd64-cgo), const TIOCGETD ideal-int +pkg syscall (darwin-amd64-cgo), const TIOCGPGRP ideal-int +pkg syscall (darwin-amd64-cgo), const TIOCGWINSZ ideal-int +pkg syscall (darwin-amd64-cgo), const TIOCIXOFF ideal-int +pkg syscall (darwin-amd64-cgo), const TIOCIXON ideal-int +pkg syscall (darwin-amd64-cgo), const TIOCMBIC ideal-int +pkg syscall (darwin-amd64-cgo), const TIOCMBIS ideal-int +pkg syscall (darwin-amd64-cgo), const TIOCMGDTRWAIT ideal-int +pkg syscall (darwin-amd64-cgo), const TIOCMGET ideal-int +pkg syscall (darwin-amd64-cgo), const TIOCMODG ideal-int +pkg syscall (darwin-amd64-cgo), const TIOCMODS ideal-int +pkg syscall (darwin-amd64-cgo), const TIOCMSDTRWAIT ideal-int +pkg syscall (darwin-amd64-cgo), const TIOCMSET ideal-int +pkg syscall (darwin-amd64-cgo), const TIOCM_CAR ideal-int +pkg syscall (darwin-amd64-cgo), const TIOCM_CD ideal-int +pkg syscall (darwin-amd64-cgo), const TIOCM_CTS ideal-int +pkg syscall (darwin-amd64-cgo), const TIOCM_DSR ideal-int +pkg syscall (darwin-amd64-cgo), const TIOCM_DTR ideal-int +pkg syscall (darwin-amd64-cgo), const TIOCM_LE ideal-int +pkg syscall (darwin-amd64-cgo), const TIOCM_RI ideal-int +pkg syscall (darwin-amd64-cgo), const TIOCM_RNG ideal-int +pkg syscall (darwin-amd64-cgo), const TIOCM_RTS ideal-int +pkg syscall (darwin-amd64-cgo), const TIOCM_SR ideal-int +pkg syscall (darwin-amd64-cgo), const TIOCM_ST ideal-int +pkg syscall (darwin-amd64-cgo), const TIOCNOTTY ideal-int +pkg syscall (darwin-amd64-cgo), const TIOCNXCL ideal-int +pkg syscall (darwin-amd64-cgo), const TIOCOUTQ ideal-int +pkg syscall (darwin-amd64-cgo), const TIOCPKT ideal-int +pkg syscall (darwin-amd64-cgo), const TIOCPKT_DATA ideal-int +pkg syscall (darwin-amd64-cgo), const TIOCPKT_DOSTOP ideal-int +pkg syscall (darwin-amd64-cgo), const TIOCPKT_FLUSHREAD ideal-int +pkg syscall (darwin-amd64-cgo), const TIOCPKT_FLUSHWRITE ideal-int +pkg syscall (darwin-amd64-cgo), const TIOCPKT_IOCTL ideal-int +pkg syscall (darwin-amd64-cgo), const TIOCPKT_NOSTOP ideal-int +pkg syscall (darwin-amd64-cgo), const TIOCPKT_START ideal-int +pkg syscall (darwin-amd64-cgo), const TIOCPKT_STOP ideal-int +pkg syscall (darwin-amd64-cgo), const TIOCPTYGNAME ideal-int +pkg syscall (darwin-amd64-cgo), const TIOCPTYGRANT ideal-int +pkg syscall (darwin-amd64-cgo), const TIOCPTYUNLK ideal-int +pkg syscall (darwin-amd64-cgo), const TIOCREMOTE ideal-int +pkg syscall (darwin-amd64-cgo), const TIOCSBRK ideal-int +pkg syscall (darwin-amd64-cgo), const TIOCSCONS ideal-int +pkg syscall (darwin-amd64-cgo), const TIOCSCTTY ideal-int +pkg syscall (darwin-amd64-cgo), const TIOCSDRAINWAIT ideal-int +pkg syscall (darwin-amd64-cgo), const TIOCSDTR ideal-int +pkg syscall (darwin-amd64-cgo), const TIOCSETA ideal-int +pkg syscall (darwin-amd64-cgo), const TIOCSETAF ideal-int +pkg syscall (darwin-amd64-cgo), const TIOCSETAW ideal-int +pkg syscall (darwin-amd64-cgo), const TIOCSETD ideal-int +pkg syscall (darwin-amd64-cgo), const TIOCSIG ideal-int +pkg syscall (darwin-amd64-cgo), const TIOCSPGRP ideal-int +pkg syscall (darwin-amd64-cgo), const TIOCSTART ideal-int +pkg syscall (darwin-amd64-cgo), const TIOCSTAT ideal-int +pkg syscall (darwin-amd64-cgo), const TIOCSTI ideal-int +pkg syscall (darwin-amd64-cgo), const TIOCSTOP ideal-int +pkg syscall (darwin-amd64-cgo), const TIOCSWINSZ ideal-int +pkg syscall (darwin-amd64-cgo), const TIOCTIMESTAMP ideal-int +pkg syscall (darwin-amd64-cgo), const TIOCUCNTL ideal-int +pkg syscall (darwin-amd64-cgo), const WCONTINUED ideal-int +pkg syscall (darwin-amd64-cgo), const WCOREFLAG ideal-int +pkg syscall (darwin-amd64-cgo), const WEXITED ideal-int +pkg syscall (darwin-amd64-cgo), const WNOHANG ideal-int +pkg syscall (darwin-amd64-cgo), const WNOWAIT ideal-int +pkg syscall (darwin-amd64-cgo), const WORDSIZE ideal-int +pkg syscall (darwin-amd64-cgo), const WSTOPPED ideal-int +pkg syscall (darwin-amd64-cgo), const WUNTRACED ideal-int +pkg syscall (darwin-amd64-cgo), func Accept(int) (int, Sockaddr, error) +pkg syscall (darwin-amd64-cgo), func Access(string, uint32) error +pkg syscall (darwin-amd64-cgo), func Adjtime(*Timeval, *Timeval) error +pkg syscall (darwin-amd64-cgo), func Bind(int, Sockaddr) error +pkg syscall (darwin-amd64-cgo), func BpfBuflen(int) (int, error) +pkg syscall (darwin-amd64-cgo), func BpfDatalink(int) (int, error) +pkg syscall (darwin-amd64-cgo), func BpfHeadercmpl(int) (int, error) +pkg syscall (darwin-amd64-cgo), func BpfInterface(int, string) (string, error) +pkg syscall (darwin-amd64-cgo), func BpfJump(int, int, int, int) *BpfInsn +pkg syscall (darwin-amd64-cgo), func BpfStats(int) (*BpfStat, error) +pkg syscall (darwin-amd64-cgo), func BpfStmt(int, int) *BpfInsn +pkg syscall (darwin-amd64-cgo), func BpfTimeout(int) (*Timeval, error) +pkg syscall (darwin-amd64-cgo), func CheckBpfVersion(int) error +pkg syscall (darwin-amd64-cgo), func Chflags(string, int) error +pkg syscall (darwin-amd64-cgo), func Chroot(string) error +pkg syscall (darwin-amd64-cgo), func Close(int) error +pkg syscall (darwin-amd64-cgo), func CloseOnExec(int) +pkg syscall (darwin-amd64-cgo), func CmsgLen(int) int +pkg syscall (darwin-amd64-cgo), func CmsgSpace(int) int +pkg syscall (darwin-amd64-cgo), func Connect(int, Sockaddr) error +pkg syscall (darwin-amd64-cgo), func Dup(int) (int, error) +pkg syscall (darwin-amd64-cgo), func Dup2(int, int) error +pkg syscall (darwin-amd64-cgo), func Exchangedata(string, string, int) error +pkg syscall (darwin-amd64-cgo), func Fchdir(int) error +pkg syscall (darwin-amd64-cgo), func Fchflags(string, int) error +pkg syscall (darwin-amd64-cgo), func Fchmod(int, uint32) error +pkg syscall (darwin-amd64-cgo), func Fchown(int, int, int) error +pkg syscall (darwin-amd64-cgo), func Flock(int, int) error +pkg syscall (darwin-amd64-cgo), func FlushBpf(int) error +pkg syscall (darwin-amd64-cgo), func ForkExec(string, []string, *ProcAttr) (int, error) +pkg syscall (darwin-amd64-cgo), func Fpathconf(int, int) (int, error) +pkg syscall (darwin-amd64-cgo), func Fstat(int, *Stat_t) error +pkg syscall (darwin-amd64-cgo), func Fstatfs(int, *Statfs_t) error +pkg syscall (darwin-amd64-cgo), func Fsync(int) error +pkg syscall (darwin-amd64-cgo), func Ftruncate(int, int64) error +pkg syscall (darwin-amd64-cgo), func Futimes(int, []Timeval) error +pkg syscall (darwin-amd64-cgo), func Getdirentries(int, []uint8, *uintptr) (int, error) +pkg syscall (darwin-amd64-cgo), func Getdtablesize() int +pkg syscall (darwin-amd64-cgo), func Getfsstat([]Statfs_t, int) (int, error) +pkg syscall (darwin-amd64-cgo), func Getpeername(int) (Sockaddr, error) +pkg syscall (darwin-amd64-cgo), func Getpgid(int) (int, error) +pkg syscall (darwin-amd64-cgo), func Getpgrp() int +pkg syscall (darwin-amd64-cgo), func Getpriority(int, int) (int, error) +pkg syscall (darwin-amd64-cgo), func Getrlimit(int, *Rlimit) error +pkg syscall (darwin-amd64-cgo), func Getrusage(int, *Rusage) error +pkg syscall (darwin-amd64-cgo), func Getsid(int) (int, error) +pkg syscall (darwin-amd64-cgo), func Getsockname(int) (Sockaddr, error) +pkg syscall (darwin-amd64-cgo), func GetsockoptByte(int, int, int) (uint8, error) +pkg syscall (darwin-amd64-cgo), func GetsockoptIPMreq(int, int, int) (*IPMreq, error) +pkg syscall (darwin-amd64-cgo), func GetsockoptIPv6Mreq(int, int, int) (*IPv6Mreq, error) +pkg syscall (darwin-amd64-cgo), func GetsockoptInet4Addr(int, int, int) ([4]uint8, error) +pkg syscall (darwin-amd64-cgo), func GetsockoptInt(int, int, int) (int, error) +pkg syscall (darwin-amd64-cgo), func Issetugid() bool +pkg syscall (darwin-amd64-cgo), func Kevent(int, []Kevent_t, []Kevent_t, *Timespec) (int, error) +pkg syscall (darwin-amd64-cgo), func Kill(int, Signal) error +pkg syscall (darwin-amd64-cgo), func Kqueue() (int, error) +pkg syscall (darwin-amd64-cgo), func Listen(int, int) error +pkg syscall (darwin-amd64-cgo), func Lstat(string, *Stat_t) error +pkg syscall (darwin-amd64-cgo), func Mkfifo(string, uint32) error +pkg syscall (darwin-amd64-cgo), func Mknod(string, uint32, int) error +pkg syscall (darwin-amd64-cgo), func Mmap(int, int64, int, int, int) ([]uint8, error) +pkg syscall (darwin-amd64-cgo), func Munmap([]uint8) error +pkg syscall (darwin-amd64-cgo), func NsecToTimespec(int64) Timespec +pkg syscall (darwin-amd64-cgo), func Open(string, int, uint32) (int, error) +pkg syscall (darwin-amd64-cgo), func ParseDirent([]uint8, int, []string) (int, int, []string) +pkg syscall (darwin-amd64-cgo), func ParseRoutingMessage([]uint8) ([]RoutingMessage, error) +pkg syscall (darwin-amd64-cgo), func ParseRoutingSockaddr(RoutingMessage) ([]Sockaddr, error) +pkg syscall (darwin-amd64-cgo), func ParseSocketControlMessage([]uint8) ([]SocketControlMessage, error) +pkg syscall (darwin-amd64-cgo), func ParseUnixRights(*SocketControlMessage) ([]int, error) +pkg syscall (darwin-amd64-cgo), func Pathconf(string, int) (int, error) +pkg syscall (darwin-amd64-cgo), func Pipe([]int) error +pkg syscall (darwin-amd64-cgo), func Pread(int, []uint8, int64) (int, error) +pkg syscall (darwin-amd64-cgo), func PtraceAttach(int) error +pkg syscall (darwin-amd64-cgo), func PtraceDetach(int) error +pkg syscall (darwin-amd64-cgo), func Pwrite(int, []uint8, int64) (int, error) +pkg syscall (darwin-amd64-cgo), func RawSyscall(uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno) +pkg syscall (darwin-amd64-cgo), func RawSyscall6(uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno) +pkg syscall (darwin-amd64-cgo), func Read(int, []uint8) (int, error) +pkg syscall (darwin-amd64-cgo), func ReadDirent(int, []uint8) (int, error) +pkg syscall (darwin-amd64-cgo), func Recvfrom(int, []uint8, int) (int, Sockaddr, error) +pkg syscall (darwin-amd64-cgo), func Recvmsg(int, []uint8, []uint8, int) (int, int, int, Sockaddr, error) +pkg syscall (darwin-amd64-cgo), func Revoke(string) error +pkg syscall (darwin-amd64-cgo), func RouteRIB(int, int) ([]uint8, error) +pkg syscall (darwin-amd64-cgo), func Seek(int, int64, int) (int64, error) +pkg syscall (darwin-amd64-cgo), func Select(int, *FdSet, *FdSet, *FdSet, *Timeval) error +pkg syscall (darwin-amd64-cgo), func Sendfile(int, int, *int64, int) (int, error) +pkg syscall (darwin-amd64-cgo), func Sendmsg(int, []uint8, []uint8, Sockaddr, int) error +pkg syscall (darwin-amd64-cgo), func Sendto(int, []uint8, int, Sockaddr) error +pkg syscall (darwin-amd64-cgo), func SetBpf(int, []BpfInsn) error +pkg syscall (darwin-amd64-cgo), func SetBpfBuflen(int, int) (int, error) +pkg syscall (darwin-amd64-cgo), func SetBpfDatalink(int, int) (int, error) +pkg syscall (darwin-amd64-cgo), func SetBpfHeadercmpl(int, int) error +pkg syscall (darwin-amd64-cgo), func SetBpfImmediate(int, int) error +pkg syscall (darwin-amd64-cgo), func SetBpfInterface(int, string) error +pkg syscall (darwin-amd64-cgo), func SetBpfPromisc(int, int) error +pkg syscall (darwin-amd64-cgo), func SetBpfTimeout(int, *Timeval) error +pkg syscall (darwin-amd64-cgo), func SetKevent(*Kevent_t, int, int, int) +pkg syscall (darwin-amd64-cgo), func SetNonblock(int, bool) error +pkg syscall (darwin-amd64-cgo), func Setegid(int) error +pkg syscall (darwin-amd64-cgo), func Seteuid(int) error +pkg syscall (darwin-amd64-cgo), func Setgid(int) error +pkg syscall (darwin-amd64-cgo), func Setgroups([]int) error +pkg syscall (darwin-amd64-cgo), func Setlogin(string) error +pkg syscall (darwin-amd64-cgo), func Setpgid(int, int) error +pkg syscall (darwin-amd64-cgo), func Setpriority(int, int, int) error +pkg syscall (darwin-amd64-cgo), func Setprivexec(int) error +pkg syscall (darwin-amd64-cgo), func Setregid(int, int) error +pkg syscall (darwin-amd64-cgo), func Setreuid(int, int) error +pkg syscall (darwin-amd64-cgo), func Setrlimit(int, *Rlimit) error +pkg syscall (darwin-amd64-cgo), func Setsid() (int, error) +pkg syscall (darwin-amd64-cgo), func SetsockoptByte(int, int, int, uint8) error +pkg syscall (darwin-amd64-cgo), func SetsockoptIPMreq(int, int, int, *IPMreq) error +pkg syscall (darwin-amd64-cgo), func SetsockoptIPv6Mreq(int, int, int, *IPv6Mreq) error +pkg syscall (darwin-amd64-cgo), func SetsockoptInet4Addr(int, int, int, [4]uint8) error +pkg syscall (darwin-amd64-cgo), func SetsockoptInt(int, int, int, int) error +pkg syscall (darwin-amd64-cgo), func SetsockoptLinger(int, int, int, *Linger) error +pkg syscall (darwin-amd64-cgo), func SetsockoptString(int, int, int, string) error +pkg syscall (darwin-amd64-cgo), func SetsockoptTimeval(int, int, int, *Timeval) error +pkg syscall (darwin-amd64-cgo), func Settimeofday(*Timeval) error +pkg syscall (darwin-amd64-cgo), func Setuid(int) error +pkg syscall (darwin-amd64-cgo), func Shutdown(int, int) error +pkg syscall (darwin-amd64-cgo), func Socket(int, int, int) (int, error) +pkg syscall (darwin-amd64-cgo), func Socketpair(int, int, int) ([2]int, error) +pkg syscall (darwin-amd64-cgo), func Stat(string, *Stat_t) error +pkg syscall (darwin-amd64-cgo), func Statfs(string, *Statfs_t) error +pkg syscall (darwin-amd64-cgo), func StringSlicePtr([]string) []*uint8 +pkg syscall (darwin-amd64-cgo), func Sync() error +pkg syscall (darwin-amd64-cgo), func Syscall(uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno) +pkg syscall (darwin-amd64-cgo), func Syscall6(uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno) +pkg syscall (darwin-amd64-cgo), func Sysctl(string) (string, error) +pkg syscall (darwin-amd64-cgo), func SysctlUint32(string) (uint32, error) +pkg syscall (darwin-amd64-cgo), func TimespecToNsec(Timespec) int64 +pkg syscall (darwin-amd64-cgo), func TimevalToNsec(Timeval) int64 +pkg syscall (darwin-amd64-cgo), func Truncate(string, int64) error +pkg syscall (darwin-amd64-cgo), func Umask(int) int +pkg syscall (darwin-amd64-cgo), func Undelete(string) error +pkg syscall (darwin-amd64-cgo), func UnixRights(...int) []uint8 +pkg syscall (darwin-amd64-cgo), func Unmount(string, int) error +pkg syscall (darwin-amd64-cgo), func Wait4(int, *WaitStatus, int, *Rusage) (int, error) +pkg syscall (darwin-amd64-cgo), func Write(int, []uint8) (int, error) +pkg syscall (darwin-amd64-cgo), method (*Cmsghdr) SetLen(int) +pkg syscall (darwin-amd64-cgo), method (*Iovec) SetLen(int) +pkg syscall (darwin-amd64-cgo), method (*Msghdr) SetControllen(int) +pkg syscall (darwin-amd64-cgo), type BpfHdr struct +pkg syscall (darwin-amd64-cgo), type BpfHdr struct, Caplen uint32 +pkg syscall (darwin-amd64-cgo), type BpfHdr struct, Datalen uint32 +pkg syscall (darwin-amd64-cgo), type BpfHdr struct, Hdrlen uint16 +pkg syscall (darwin-amd64-cgo), type BpfHdr struct, Pad_cgo_0 [2]uint8 +pkg syscall (darwin-amd64-cgo), type BpfHdr struct, Tstamp Timeval32 +pkg syscall (darwin-amd64-cgo), type BpfInsn struct +pkg syscall (darwin-amd64-cgo), type BpfInsn struct, Code uint16 +pkg syscall (darwin-amd64-cgo), type BpfInsn struct, Jf uint8 +pkg syscall (darwin-amd64-cgo), type BpfInsn struct, Jt uint8 +pkg syscall (darwin-amd64-cgo), type BpfInsn struct, K uint32 +pkg syscall (darwin-amd64-cgo), type BpfProgram struct +pkg syscall (darwin-amd64-cgo), type BpfProgram struct, Insns *BpfInsn +pkg syscall (darwin-amd64-cgo), type BpfProgram struct, Len uint32 +pkg syscall (darwin-amd64-cgo), type BpfProgram struct, Pad_cgo_0 [4]uint8 +pkg syscall (darwin-amd64-cgo), type BpfStat struct +pkg syscall (darwin-amd64-cgo), type BpfStat struct, Drop uint32 +pkg syscall (darwin-amd64-cgo), type BpfStat struct, Recv uint32 +pkg syscall (darwin-amd64-cgo), type BpfVersion struct +pkg syscall (darwin-amd64-cgo), type BpfVersion struct, Major uint16 +pkg syscall (darwin-amd64-cgo), type BpfVersion struct, Minor uint16 +pkg syscall (darwin-amd64-cgo), type Cmsghdr struct +pkg syscall (darwin-amd64-cgo), type Cmsghdr struct, Len uint32 +pkg syscall (darwin-amd64-cgo), type Cmsghdr struct, Level int32 +pkg syscall (darwin-amd64-cgo), type Cmsghdr struct, Type int32 +pkg syscall (darwin-amd64-cgo), type Credential struct +pkg syscall (darwin-amd64-cgo), type Credential struct, Gid uint32 +pkg syscall (darwin-amd64-cgo), type Credential struct, Groups []uint32 +pkg syscall (darwin-amd64-cgo), type Credential struct, Uid uint32 +pkg syscall (darwin-amd64-cgo), type Dirent struct +pkg syscall (darwin-amd64-cgo), type Dirent struct, Ino uint64 +pkg syscall (darwin-amd64-cgo), type Dirent struct, Name [1024]int8 +pkg syscall (darwin-amd64-cgo), type Dirent struct, Namlen uint16 +pkg syscall (darwin-amd64-cgo), type Dirent struct, Pad_cgo_0 [3]uint8 +pkg syscall (darwin-amd64-cgo), type Dirent struct, Reclen uint16 +pkg syscall (darwin-amd64-cgo), type Dirent struct, Seekoff uint64 +pkg syscall (darwin-amd64-cgo), type Dirent struct, Type uint8 +pkg syscall (darwin-amd64-cgo), type Fbootstraptransfer_t struct +pkg syscall (darwin-amd64-cgo), type Fbootstraptransfer_t struct, Buffer *uint8 +pkg syscall (darwin-amd64-cgo), type Fbootstraptransfer_t struct, Length uint64 +pkg syscall (darwin-amd64-cgo), type Fbootstraptransfer_t struct, Offset int64 +pkg syscall (darwin-amd64-cgo), type FdSet struct +pkg syscall (darwin-amd64-cgo), type FdSet struct, Bits [32]int32 +pkg syscall (darwin-amd64-cgo), type Flock_t struct +pkg syscall (darwin-amd64-cgo), type Flock_t struct, Len int64 +pkg syscall (darwin-amd64-cgo), type Flock_t struct, Pid int32 +pkg syscall (darwin-amd64-cgo), type Flock_t struct, Start int64 +pkg syscall (darwin-amd64-cgo), type Flock_t struct, Type int16 +pkg syscall (darwin-amd64-cgo), type Flock_t struct, Whence int16 +pkg syscall (darwin-amd64-cgo), type Fsid struct +pkg syscall (darwin-amd64-cgo), type Fsid struct, Val [2]int32 +pkg syscall (darwin-amd64-cgo), type Fstore_t struct +pkg syscall (darwin-amd64-cgo), type Fstore_t struct, Bytesalloc int64 +pkg syscall (darwin-amd64-cgo), type Fstore_t struct, Flags uint32 +pkg syscall (darwin-amd64-cgo), type Fstore_t struct, Length int64 +pkg syscall (darwin-amd64-cgo), type Fstore_t struct, Offset int64 +pkg syscall (darwin-amd64-cgo), type Fstore_t struct, Posmode int32 +pkg syscall (darwin-amd64-cgo), type IfData struct +pkg syscall (darwin-amd64-cgo), type IfData struct, Addrlen uint8 +pkg syscall (darwin-amd64-cgo), type IfData struct, Baudrate uint32 +pkg syscall (darwin-amd64-cgo), type IfData struct, Collisions uint32 +pkg syscall (darwin-amd64-cgo), type IfData struct, Hdrlen uint8 +pkg syscall (darwin-amd64-cgo), type IfData struct, Hwassist uint32 +pkg syscall (darwin-amd64-cgo), type IfData struct, Ibytes uint32 +pkg syscall (darwin-amd64-cgo), type IfData struct, Ierrors uint32 +pkg syscall (darwin-amd64-cgo), type IfData struct, Imcasts uint32 +pkg syscall (darwin-amd64-cgo), type IfData struct, Ipackets uint32 +pkg syscall (darwin-amd64-cgo), type IfData struct, Iqdrops uint32 +pkg syscall (darwin-amd64-cgo), type IfData struct, Lastchange Timeval32 +pkg syscall (darwin-amd64-cgo), type IfData struct, Metric uint32 +pkg syscall (darwin-amd64-cgo), type IfData struct, Mtu uint32 +pkg syscall (darwin-amd64-cgo), type IfData struct, Noproto uint32 +pkg syscall (darwin-amd64-cgo), type IfData struct, Obytes uint32 +pkg syscall (darwin-amd64-cgo), type IfData struct, Oerrors uint32 +pkg syscall (darwin-amd64-cgo), type IfData struct, Omcasts uint32 +pkg syscall (darwin-amd64-cgo), type IfData struct, Opackets uint32 +pkg syscall (darwin-amd64-cgo), type IfData struct, Physical uint8 +pkg syscall (darwin-amd64-cgo), type IfData struct, Recvquota uint8 +pkg syscall (darwin-amd64-cgo), type IfData struct, Recvtiming uint32 +pkg syscall (darwin-amd64-cgo), type IfData struct, Reserved1 uint32 +pkg syscall (darwin-amd64-cgo), type IfData struct, Reserved2 uint32 +pkg syscall (darwin-amd64-cgo), type IfData struct, Type uint8 +pkg syscall (darwin-amd64-cgo), type IfData struct, Typelen uint8 +pkg syscall (darwin-amd64-cgo), type IfData struct, Unused1 uint8 +pkg syscall (darwin-amd64-cgo), type IfData struct, Unused2 uint32 +pkg syscall (darwin-amd64-cgo), type IfData struct, Xmitquota uint8 +pkg syscall (darwin-amd64-cgo), type IfData struct, Xmittiming uint32 +pkg syscall (darwin-amd64-cgo), type IfMsghdr struct +pkg syscall (darwin-amd64-cgo), type IfMsghdr struct, Addrs int32 +pkg syscall (darwin-amd64-cgo), type IfMsghdr struct, Data IfData +pkg syscall (darwin-amd64-cgo), type IfMsghdr struct, Flags int32 +pkg syscall (darwin-amd64-cgo), type IfMsghdr struct, Index uint16 +pkg syscall (darwin-amd64-cgo), type IfMsghdr struct, Msglen uint16 +pkg syscall (darwin-amd64-cgo), type IfMsghdr struct, Pad_cgo_0 [2]uint8 +pkg syscall (darwin-amd64-cgo), type IfMsghdr struct, Type uint8 +pkg syscall (darwin-amd64-cgo), type IfMsghdr struct, Version uint8 +pkg syscall (darwin-amd64-cgo), type IfaMsghdr struct +pkg syscall (darwin-amd64-cgo), type IfaMsghdr struct, Addrs int32 +pkg syscall (darwin-amd64-cgo), type IfaMsghdr struct, Flags int32 +pkg syscall (darwin-amd64-cgo), type IfaMsghdr struct, Index uint16 +pkg syscall (darwin-amd64-cgo), type IfaMsghdr struct, Metric int32 +pkg syscall (darwin-amd64-cgo), type IfaMsghdr struct, Msglen uint16 +pkg syscall (darwin-amd64-cgo), type IfaMsghdr struct, Pad_cgo_0 [2]uint8 +pkg syscall (darwin-amd64-cgo), type IfaMsghdr struct, Type uint8 +pkg syscall (darwin-amd64-cgo), type IfaMsghdr struct, Version uint8 +pkg syscall (darwin-amd64-cgo), type IfmaMsghdr struct +pkg syscall (darwin-amd64-cgo), type IfmaMsghdr struct, Addrs int32 +pkg syscall (darwin-amd64-cgo), type IfmaMsghdr struct, Flags int32 +pkg syscall (darwin-amd64-cgo), type IfmaMsghdr struct, Index uint16 +pkg syscall (darwin-amd64-cgo), type IfmaMsghdr struct, Msglen uint16 +pkg syscall (darwin-amd64-cgo), type IfmaMsghdr struct, Pad_cgo_0 [2]uint8 +pkg syscall (darwin-amd64-cgo), type IfmaMsghdr struct, Type uint8 +pkg syscall (darwin-amd64-cgo), type IfmaMsghdr struct, Version uint8 +pkg syscall (darwin-amd64-cgo), type IfmaMsghdr2 struct +pkg syscall (darwin-amd64-cgo), type IfmaMsghdr2 struct, Addrs int32 +pkg syscall (darwin-amd64-cgo), type IfmaMsghdr2 struct, Flags int32 +pkg syscall (darwin-amd64-cgo), type IfmaMsghdr2 struct, Index uint16 +pkg syscall (darwin-amd64-cgo), type IfmaMsghdr2 struct, Msglen uint16 +pkg syscall (darwin-amd64-cgo), type IfmaMsghdr2 struct, Pad_cgo_0 [2]uint8 +pkg syscall (darwin-amd64-cgo), type IfmaMsghdr2 struct, Refcount int32 +pkg syscall (darwin-amd64-cgo), type IfmaMsghdr2 struct, Type uint8 +pkg syscall (darwin-amd64-cgo), type IfmaMsghdr2 struct, Version uint8 +pkg syscall (darwin-amd64-cgo), type Inet6Pktinfo struct +pkg syscall (darwin-amd64-cgo), type Inet6Pktinfo struct, Addr [16]uint8 +pkg syscall (darwin-amd64-cgo), type Inet6Pktinfo struct, Ifindex uint32 +pkg syscall (darwin-amd64-cgo), type InterfaceAddrMessage struct +pkg syscall (darwin-amd64-cgo), type InterfaceAddrMessage struct, Data []uint8 +pkg syscall (darwin-amd64-cgo), type InterfaceAddrMessage struct, Header IfaMsghdr +pkg syscall (darwin-amd64-cgo), type InterfaceMessage struct +pkg syscall (darwin-amd64-cgo), type InterfaceMessage struct, Data []uint8 +pkg syscall (darwin-amd64-cgo), type InterfaceMessage struct, Header IfMsghdr +pkg syscall (darwin-amd64-cgo), type InterfaceMulticastAddrMessage struct +pkg syscall (darwin-amd64-cgo), type InterfaceMulticastAddrMessage struct, Data []uint8 +pkg syscall (darwin-amd64-cgo), type InterfaceMulticastAddrMessage struct, Header IfmaMsghdr2 +pkg syscall (darwin-amd64-cgo), type Iovec struct +pkg syscall (darwin-amd64-cgo), type Iovec struct, Base *uint8 +pkg syscall (darwin-amd64-cgo), type Iovec struct, Len uint64 +pkg syscall (darwin-amd64-cgo), type Kevent_t struct +pkg syscall (darwin-amd64-cgo), type Kevent_t struct, Data int64 +pkg syscall (darwin-amd64-cgo), type Kevent_t struct, Fflags uint32 +pkg syscall (darwin-amd64-cgo), type Kevent_t struct, Filter int16 +pkg syscall (darwin-amd64-cgo), type Kevent_t struct, Flags uint16 +pkg syscall (darwin-amd64-cgo), type Kevent_t struct, Ident uint64 +pkg syscall (darwin-amd64-cgo), type Kevent_t struct, Udata *uint8 +pkg syscall (darwin-amd64-cgo), type Log2phys_t struct +pkg syscall (darwin-amd64-cgo), type Log2phys_t struct, Contigbytes int64 +pkg syscall (darwin-amd64-cgo), type Log2phys_t struct, Devoffset int64 +pkg syscall (darwin-amd64-cgo), type Log2phys_t struct, Flags uint32 +pkg syscall (darwin-amd64-cgo), type Msghdr struct +pkg syscall (darwin-amd64-cgo), type Msghdr struct, Control *uint8 +pkg syscall (darwin-amd64-cgo), type Msghdr struct, Controllen uint32 +pkg syscall (darwin-amd64-cgo), type Msghdr struct, Flags int32 +pkg syscall (darwin-amd64-cgo), type Msghdr struct, Iov *Iovec +pkg syscall (darwin-amd64-cgo), type Msghdr struct, Iovlen int32 +pkg syscall (darwin-amd64-cgo), type Msghdr struct, Name *uint8 +pkg syscall (darwin-amd64-cgo), type Msghdr struct, Namelen uint32 +pkg syscall (darwin-amd64-cgo), type Msghdr struct, Pad_cgo_0 [4]uint8 +pkg syscall (darwin-amd64-cgo), type Msghdr struct, Pad_cgo_1 [4]uint8 +pkg syscall (darwin-amd64-cgo), type Radvisory_t struct +pkg syscall (darwin-amd64-cgo), type Radvisory_t struct, Count int32 +pkg syscall (darwin-amd64-cgo), type Radvisory_t struct, Offset int64 +pkg syscall (darwin-amd64-cgo), type Radvisory_t struct, Pad_cgo_0 [4]uint8 +pkg syscall (darwin-amd64-cgo), type RawSockaddr struct, Data [14]int8 +pkg syscall (darwin-amd64-cgo), type RawSockaddr struct, Family uint8 +pkg syscall (darwin-amd64-cgo), type RawSockaddr struct, Len uint8 +pkg syscall (darwin-amd64-cgo), type RawSockaddrAny struct, Pad [92]int8 +pkg syscall (darwin-amd64-cgo), type RawSockaddrDatalink struct +pkg syscall (darwin-amd64-cgo), type RawSockaddrDatalink struct, Alen uint8 +pkg syscall (darwin-amd64-cgo), type RawSockaddrDatalink struct, Data [12]int8 +pkg syscall (darwin-amd64-cgo), type RawSockaddrDatalink struct, Family uint8 +pkg syscall (darwin-amd64-cgo), type RawSockaddrDatalink struct, Index uint16 +pkg syscall (darwin-amd64-cgo), type RawSockaddrDatalink struct, Len uint8 +pkg syscall (darwin-amd64-cgo), type RawSockaddrDatalink struct, Nlen uint8 +pkg syscall (darwin-amd64-cgo), type RawSockaddrDatalink struct, Slen uint8 +pkg syscall (darwin-amd64-cgo), type RawSockaddrDatalink struct, Type uint8 +pkg syscall (darwin-amd64-cgo), type RawSockaddrInet4 struct, Family uint8 +pkg syscall (darwin-amd64-cgo), type RawSockaddrInet4 struct, Len uint8 +pkg syscall (darwin-amd64-cgo), type RawSockaddrInet4 struct, Zero [8]int8 +pkg syscall (darwin-amd64-cgo), type RawSockaddrInet6 struct +pkg syscall (darwin-amd64-cgo), type RawSockaddrInet6 struct, Addr [16]uint8 +pkg syscall (darwin-amd64-cgo), type RawSockaddrInet6 struct, Family uint8 +pkg syscall (darwin-amd64-cgo), type RawSockaddrInet6 struct, Flowinfo uint32 +pkg syscall (darwin-amd64-cgo), type RawSockaddrInet6 struct, Len uint8 +pkg syscall (darwin-amd64-cgo), type RawSockaddrInet6 struct, Port uint16 +pkg syscall (darwin-amd64-cgo), type RawSockaddrInet6 struct, Scope_id uint32 +pkg syscall (darwin-amd64-cgo), type RawSockaddrUnix struct +pkg syscall (darwin-amd64-cgo), type RawSockaddrUnix struct, Family uint8 +pkg syscall (darwin-amd64-cgo), type RawSockaddrUnix struct, Len uint8 +pkg syscall (darwin-amd64-cgo), type RawSockaddrUnix struct, Path [104]int8 +pkg syscall (darwin-amd64-cgo), type Rlimit struct +pkg syscall (darwin-amd64-cgo), type Rlimit struct, Cur uint64 +pkg syscall (darwin-amd64-cgo), type Rlimit struct, Max uint64 +pkg syscall (darwin-amd64-cgo), type RouteMessage struct +pkg syscall (darwin-amd64-cgo), type RouteMessage struct, Data []uint8 +pkg syscall (darwin-amd64-cgo), type RouteMessage struct, Header RtMsghdr +pkg syscall (darwin-amd64-cgo), type RoutingMessage interface, unexported methods +pkg syscall (darwin-amd64-cgo), type RtMetrics struct +pkg syscall (darwin-amd64-cgo), type RtMetrics struct, Expire int32 +pkg syscall (darwin-amd64-cgo), type RtMetrics struct, Filler [4]uint32 +pkg syscall (darwin-amd64-cgo), type RtMetrics struct, Hopcount uint32 +pkg syscall (darwin-amd64-cgo), type RtMetrics struct, Locks uint32 +pkg syscall (darwin-amd64-cgo), type RtMetrics struct, Mtu uint32 +pkg syscall (darwin-amd64-cgo), type RtMetrics struct, Pksent uint32 +pkg syscall (darwin-amd64-cgo), type RtMetrics struct, Recvpipe uint32 +pkg syscall (darwin-amd64-cgo), type RtMetrics struct, Rtt uint32 +pkg syscall (darwin-amd64-cgo), type RtMetrics struct, Rttvar uint32 +pkg syscall (darwin-amd64-cgo), type RtMetrics struct, Sendpipe uint32 +pkg syscall (darwin-amd64-cgo), type RtMetrics struct, Ssthresh uint32 +pkg syscall (darwin-amd64-cgo), type RtMsghdr struct +pkg syscall (darwin-amd64-cgo), type RtMsghdr struct, Addrs int32 +pkg syscall (darwin-amd64-cgo), type RtMsghdr struct, Errno int32 +pkg syscall (darwin-amd64-cgo), type RtMsghdr struct, Flags int32 +pkg syscall (darwin-amd64-cgo), type RtMsghdr struct, Index uint16 +pkg syscall (darwin-amd64-cgo), type RtMsghdr struct, Inits uint32 +pkg syscall (darwin-amd64-cgo), type RtMsghdr struct, Msglen uint16 +pkg syscall (darwin-amd64-cgo), type RtMsghdr struct, Pad_cgo_0 [2]uint8 +pkg syscall (darwin-amd64-cgo), type RtMsghdr struct, Pid int32 +pkg syscall (darwin-amd64-cgo), type RtMsghdr struct, Rmx RtMetrics +pkg syscall (darwin-amd64-cgo), type RtMsghdr struct, Seq int32 +pkg syscall (darwin-amd64-cgo), type RtMsghdr struct, Type uint8 +pkg syscall (darwin-amd64-cgo), type RtMsghdr struct, Use int32 +pkg syscall (darwin-amd64-cgo), type RtMsghdr struct, Version uint8 +pkg syscall (darwin-amd64-cgo), type Rusage struct, Idrss int64 +pkg syscall (darwin-amd64-cgo), type Rusage struct, Inblock int64 +pkg syscall (darwin-amd64-cgo), type Rusage struct, Isrss int64 +pkg syscall (darwin-amd64-cgo), type Rusage struct, Ixrss int64 +pkg syscall (darwin-amd64-cgo), type Rusage struct, Majflt int64 +pkg syscall (darwin-amd64-cgo), type Rusage struct, Maxrss int64 +pkg syscall (darwin-amd64-cgo), type Rusage struct, Minflt int64 +pkg syscall (darwin-amd64-cgo), type Rusage struct, Msgrcv int64 +pkg syscall (darwin-amd64-cgo), type Rusage struct, Msgsnd int64 +pkg syscall (darwin-amd64-cgo), type Rusage struct, Nivcsw int64 +pkg syscall (darwin-amd64-cgo), type Rusage struct, Nsignals int64 +pkg syscall (darwin-amd64-cgo), type Rusage struct, Nswap int64 +pkg syscall (darwin-amd64-cgo), type Rusage struct, Nvcsw int64 +pkg syscall (darwin-amd64-cgo), type Rusage struct, Oublock int64 +pkg syscall (darwin-amd64-cgo), type Rusage struct, Stime Timeval +pkg syscall (darwin-amd64-cgo), type Rusage struct, Utime Timeval +pkg syscall (darwin-amd64-cgo), type SockaddrDatalink struct +pkg syscall (darwin-amd64-cgo), type SockaddrDatalink struct, Alen uint8 +pkg syscall (darwin-amd64-cgo), type SockaddrDatalink struct, Data [12]int8 +pkg syscall (darwin-amd64-cgo), type SockaddrDatalink struct, Family uint8 +pkg syscall (darwin-amd64-cgo), type SockaddrDatalink struct, Index uint16 +pkg syscall (darwin-amd64-cgo), type SockaddrDatalink struct, Len uint8 +pkg syscall (darwin-amd64-cgo), type SockaddrDatalink struct, Nlen uint8 +pkg syscall (darwin-amd64-cgo), type SockaddrDatalink struct, Slen uint8 +pkg syscall (darwin-amd64-cgo), type SockaddrDatalink struct, Type uint8 +pkg syscall (darwin-amd64-cgo), type SocketControlMessage struct +pkg syscall (darwin-amd64-cgo), type SocketControlMessage struct, Data []uint8 +pkg syscall (darwin-amd64-cgo), type SocketControlMessage struct, Header Cmsghdr +pkg syscall (darwin-amd64-cgo), type Stat_t struct +pkg syscall (darwin-amd64-cgo), type Stat_t struct, Atimespec Timespec +pkg syscall (darwin-amd64-cgo), type Stat_t struct, Birthtimespec Timespec +pkg syscall (darwin-amd64-cgo), type Stat_t struct, Blksize int32 +pkg syscall (darwin-amd64-cgo), type Stat_t struct, Blocks int64 +pkg syscall (darwin-amd64-cgo), type Stat_t struct, Ctimespec Timespec +pkg syscall (darwin-amd64-cgo), type Stat_t struct, Dev int32 +pkg syscall (darwin-amd64-cgo), type Stat_t struct, Flags uint32 +pkg syscall (darwin-amd64-cgo), type Stat_t struct, Gen uint32 +pkg syscall (darwin-amd64-cgo), type Stat_t struct, Gid uint32 +pkg syscall (darwin-amd64-cgo), type Stat_t struct, Ino uint64 +pkg syscall (darwin-amd64-cgo), type Stat_t struct, Lspare int32 +pkg syscall (darwin-amd64-cgo), type Stat_t struct, Mode uint16 +pkg syscall (darwin-amd64-cgo), type Stat_t struct, Mtimespec Timespec +pkg syscall (darwin-amd64-cgo), type Stat_t struct, Nlink uint16 +pkg syscall (darwin-amd64-cgo), type Stat_t struct, Pad_cgo_0 [4]uint8 +pkg syscall (darwin-amd64-cgo), type Stat_t struct, Qspare [2]int64 +pkg syscall (darwin-amd64-cgo), type Stat_t struct, Rdev int32 +pkg syscall (darwin-amd64-cgo), type Stat_t struct, Size int64 +pkg syscall (darwin-amd64-cgo), type Stat_t struct, Uid uint32 +pkg syscall (darwin-amd64-cgo), type Statfs_t struct +pkg syscall (darwin-amd64-cgo), type Statfs_t struct, Bavail uint64 +pkg syscall (darwin-amd64-cgo), type Statfs_t struct, Bfree uint64 +pkg syscall (darwin-amd64-cgo), type Statfs_t struct, Blocks uint64 +pkg syscall (darwin-amd64-cgo), type Statfs_t struct, Bsize uint32 +pkg syscall (darwin-amd64-cgo), type Statfs_t struct, Ffree uint64 +pkg syscall (darwin-amd64-cgo), type Statfs_t struct, Files uint64 +pkg syscall (darwin-amd64-cgo), type Statfs_t struct, Flags uint32 +pkg syscall (darwin-amd64-cgo), type Statfs_t struct, Fsid Fsid +pkg syscall (darwin-amd64-cgo), type Statfs_t struct, Fssubtype uint32 +pkg syscall (darwin-amd64-cgo), type Statfs_t struct, Fstypename [16]int8 +pkg syscall (darwin-amd64-cgo), type Statfs_t struct, Iosize int32 +pkg syscall (darwin-amd64-cgo), type Statfs_t struct, Mntfromname [1024]int8 +pkg syscall (darwin-amd64-cgo), type Statfs_t struct, Mntonname [1024]int8 +pkg syscall (darwin-amd64-cgo), type Statfs_t struct, Owner uint32 +pkg syscall (darwin-amd64-cgo), type Statfs_t struct, Reserved [8]uint32 +pkg syscall (darwin-amd64-cgo), type Statfs_t struct, Type uint32 +pkg syscall (darwin-amd64-cgo), type SysProcAttr struct, Chroot string +pkg syscall (darwin-amd64-cgo), type SysProcAttr struct, Credential *Credential +pkg syscall (darwin-amd64-cgo), type SysProcAttr struct, Noctty bool +pkg syscall (darwin-amd64-cgo), type SysProcAttr struct, Ptrace bool +pkg syscall (darwin-amd64-cgo), type SysProcAttr struct, Setctty bool +pkg syscall (darwin-amd64-cgo), type SysProcAttr struct, Setpgid bool +pkg syscall (darwin-amd64-cgo), type SysProcAttr struct, Setsid bool +pkg syscall (darwin-amd64-cgo), type Timespec struct, Nsec int64 +pkg syscall (darwin-amd64-cgo), type Timespec struct, Sec int64 +pkg syscall (darwin-amd64-cgo), type Timeval struct, Pad_cgo_0 [4]uint8 +pkg syscall (darwin-amd64-cgo), type Timeval struct, Sec int64 +pkg syscall (darwin-amd64-cgo), type Timeval struct, Usec int32 +pkg syscall (darwin-amd64-cgo), type Timeval32 struct +pkg syscall (darwin-amd64-cgo), type Timeval32 struct, Sec int32 +pkg syscall (darwin-amd64-cgo), type Timeval32 struct, Usec int32 +pkg syscall (darwin-amd64-cgo), type WaitStatus uint32 +pkg syscall (darwin-amd64-cgo), var Stderr int +pkg syscall (darwin-amd64-cgo), var Stdin int +pkg syscall (darwin-amd64-cgo), var Stdout int +pkg syscall (freebsd-386), const AF_APPLETALK ideal-int +pkg syscall (freebsd-386), const AF_ARP ideal-int +pkg syscall (freebsd-386), const AF_ATM ideal-int +pkg syscall (freebsd-386), const AF_BLUETOOTH ideal-int +pkg syscall (freebsd-386), const AF_CCITT ideal-int +pkg syscall (freebsd-386), const AF_CHAOS ideal-int +pkg syscall (freebsd-386), const AF_CNT ideal-int +pkg syscall (freebsd-386), const AF_COIP ideal-int +pkg syscall (freebsd-386), const AF_DATAKIT ideal-int +pkg syscall (freebsd-386), const AF_DECnet ideal-int +pkg syscall (freebsd-386), const AF_DLI ideal-int +pkg syscall (freebsd-386), const AF_E164 ideal-int +pkg syscall (freebsd-386), const AF_ECMA ideal-int +pkg syscall (freebsd-386), const AF_HYLINK ideal-int +pkg syscall (freebsd-386), const AF_IEEE80211 ideal-int +pkg syscall (freebsd-386), const AF_IMPLINK ideal-int +pkg syscall (freebsd-386), const AF_IPX ideal-int +pkg syscall (freebsd-386), const AF_ISDN ideal-int +pkg syscall (freebsd-386), const AF_ISO ideal-int +pkg syscall (freebsd-386), const AF_LAT ideal-int +pkg syscall (freebsd-386), const AF_LINK ideal-int +pkg syscall (freebsd-386), const AF_LOCAL ideal-int +pkg syscall (freebsd-386), const AF_MAX ideal-int +pkg syscall (freebsd-386), const AF_NATM ideal-int +pkg syscall (freebsd-386), const AF_NETBIOS ideal-int +pkg syscall (freebsd-386), const AF_NETGRAPH ideal-int +pkg syscall (freebsd-386), const AF_OSI ideal-int +pkg syscall (freebsd-386), const AF_PUP ideal-int +pkg syscall (freebsd-386), const AF_ROUTE ideal-int +pkg syscall (freebsd-386), const AF_SCLUSTER ideal-int +pkg syscall (freebsd-386), const AF_SIP ideal-int +pkg syscall (freebsd-386), const AF_SLOW ideal-int +pkg syscall (freebsd-386), const AF_SNA ideal-int +pkg syscall (freebsd-386), const AF_VENDOR00 ideal-int +pkg syscall (freebsd-386), const AF_VENDOR01 ideal-int +pkg syscall (freebsd-386), const AF_VENDOR02 ideal-int +pkg syscall (freebsd-386), const AF_VENDOR03 ideal-int +pkg syscall (freebsd-386), const AF_VENDOR04 ideal-int +pkg syscall (freebsd-386), const AF_VENDOR05 ideal-int +pkg syscall (freebsd-386), const AF_VENDOR06 ideal-int +pkg syscall (freebsd-386), const AF_VENDOR07 ideal-int +pkg syscall (freebsd-386), const AF_VENDOR08 ideal-int +pkg syscall (freebsd-386), const AF_VENDOR09 ideal-int +pkg syscall (freebsd-386), const AF_VENDOR10 ideal-int +pkg syscall (freebsd-386), const AF_VENDOR11 ideal-int +pkg syscall (freebsd-386), const AF_VENDOR12 ideal-int +pkg syscall (freebsd-386), const AF_VENDOR13 ideal-int +pkg syscall (freebsd-386), const AF_VENDOR14 ideal-int +pkg syscall (freebsd-386), const AF_VENDOR15 ideal-int +pkg syscall (freebsd-386), const AF_VENDOR16 ideal-int +pkg syscall (freebsd-386), const AF_VENDOR17 ideal-int +pkg syscall (freebsd-386), const AF_VENDOR18 ideal-int +pkg syscall (freebsd-386), const AF_VENDOR19 ideal-int +pkg syscall (freebsd-386), const AF_VENDOR20 ideal-int +pkg syscall (freebsd-386), const AF_VENDOR21 ideal-int +pkg syscall (freebsd-386), const AF_VENDOR22 ideal-int +pkg syscall (freebsd-386), const AF_VENDOR23 ideal-int +pkg syscall (freebsd-386), const AF_VENDOR24 ideal-int +pkg syscall (freebsd-386), const AF_VENDOR25 ideal-int +pkg syscall (freebsd-386), const AF_VENDOR26 ideal-int +pkg syscall (freebsd-386), const AF_VENDOR27 ideal-int +pkg syscall (freebsd-386), const AF_VENDOR28 ideal-int +pkg syscall (freebsd-386), const AF_VENDOR29 ideal-int +pkg syscall (freebsd-386), const AF_VENDOR30 ideal-int +pkg syscall (freebsd-386), const AF_VENDOR31 ideal-int +pkg syscall (freebsd-386), const AF_VENDOR32 ideal-int +pkg syscall (freebsd-386), const AF_VENDOR33 ideal-int +pkg syscall (freebsd-386), const AF_VENDOR34 ideal-int +pkg syscall (freebsd-386), const AF_VENDOR35 ideal-int +pkg syscall (freebsd-386), const AF_VENDOR36 ideal-int +pkg syscall (freebsd-386), const AF_VENDOR37 ideal-int +pkg syscall (freebsd-386), const AF_VENDOR38 ideal-int +pkg syscall (freebsd-386), const AF_VENDOR39 ideal-int +pkg syscall (freebsd-386), const AF_VENDOR40 ideal-int +pkg syscall (freebsd-386), const AF_VENDOR41 ideal-int +pkg syscall (freebsd-386), const AF_VENDOR42 ideal-int +pkg syscall (freebsd-386), const AF_VENDOR43 ideal-int +pkg syscall (freebsd-386), const AF_VENDOR44 ideal-int +pkg syscall (freebsd-386), const AF_VENDOR45 ideal-int +pkg syscall (freebsd-386), const AF_VENDOR46 ideal-int +pkg syscall (freebsd-386), const AF_VENDOR47 ideal-int +pkg syscall (freebsd-386), const BIOCFEEDBACK ideal-int +pkg syscall (freebsd-386), const BIOCFLUSH ideal-int +pkg syscall (freebsd-386), const BIOCGBLEN ideal-int +pkg syscall (freebsd-386), const BIOCGDIRECTION ideal-int +pkg syscall (freebsd-386), const BIOCGDLT ideal-int +pkg syscall (freebsd-386), const BIOCGDLTLIST ideal-int +pkg syscall (freebsd-386), const BIOCGETBUFMODE ideal-int +pkg syscall (freebsd-386), const BIOCGETIF ideal-int +pkg syscall (freebsd-386), const BIOCGETZMAX ideal-int +pkg syscall (freebsd-386), const BIOCGHDRCMPLT ideal-int +pkg syscall (freebsd-386), const BIOCGRSIG ideal-int +pkg syscall (freebsd-386), const BIOCGRTIMEOUT ideal-int +pkg syscall (freebsd-386), const BIOCGSEESENT ideal-int +pkg syscall (freebsd-386), const BIOCGSTATS ideal-int +pkg syscall (freebsd-386), const BIOCIMMEDIATE ideal-int +pkg syscall (freebsd-386), const BIOCLOCK ideal-int +pkg syscall (freebsd-386), const BIOCPROMISC ideal-int +pkg syscall (freebsd-386), const BIOCROTZBUF ideal-int +pkg syscall (freebsd-386), const BIOCSBLEN ideal-int +pkg syscall (freebsd-386), const BIOCSDIRECTION ideal-int +pkg syscall (freebsd-386), const BIOCSDLT ideal-int +pkg syscall (freebsd-386), const BIOCSETBUFMODE ideal-int +pkg syscall (freebsd-386), const BIOCSETF ideal-int +pkg syscall (freebsd-386), const BIOCSETFNR ideal-int +pkg syscall (freebsd-386), const BIOCSETIF ideal-int +pkg syscall (freebsd-386), const BIOCSETWF ideal-int +pkg syscall (freebsd-386), const BIOCSETZBUF ideal-int +pkg syscall (freebsd-386), const BIOCSHDRCMPLT ideal-int +pkg syscall (freebsd-386), const BIOCSRSIG ideal-int +pkg syscall (freebsd-386), const BIOCSRTIMEOUT ideal-int +pkg syscall (freebsd-386), const BIOCSSEESENT ideal-int +pkg syscall (freebsd-386), const BIOCVERSION ideal-int +pkg syscall (freebsd-386), const BPF_A ideal-int +pkg syscall (freebsd-386), const BPF_ABS ideal-int +pkg syscall (freebsd-386), const BPF_ADD ideal-int +pkg syscall (freebsd-386), const BPF_ALIGNMENT ideal-int +pkg syscall (freebsd-386), const BPF_ALU ideal-int +pkg syscall (freebsd-386), const BPF_AND ideal-int +pkg syscall (freebsd-386), const BPF_B ideal-int +pkg syscall (freebsd-386), const BPF_BUFMODE_BUFFER ideal-int +pkg syscall (freebsd-386), const BPF_BUFMODE_ZBUF ideal-int +pkg syscall (freebsd-386), const BPF_DIV ideal-int +pkg syscall (freebsd-386), const BPF_H ideal-int +pkg syscall (freebsd-386), const BPF_IMM ideal-int +pkg syscall (freebsd-386), const BPF_IND ideal-int +pkg syscall (freebsd-386), const BPF_JA ideal-int +pkg syscall (freebsd-386), const BPF_JEQ ideal-int +pkg syscall (freebsd-386), const BPF_JGE ideal-int +pkg syscall (freebsd-386), const BPF_JGT ideal-int +pkg syscall (freebsd-386), const BPF_JMP ideal-int +pkg syscall (freebsd-386), const BPF_JSET ideal-int +pkg syscall (freebsd-386), const BPF_K ideal-int +pkg syscall (freebsd-386), const BPF_LD ideal-int +pkg syscall (freebsd-386), const BPF_LDX ideal-int +pkg syscall (freebsd-386), const BPF_LEN ideal-int +pkg syscall (freebsd-386), const BPF_LSH ideal-int +pkg syscall (freebsd-386), const BPF_MAJOR_VERSION ideal-int +pkg syscall (freebsd-386), const BPF_MAXBUFSIZE ideal-int +pkg syscall (freebsd-386), const BPF_MAXINSNS ideal-int +pkg syscall (freebsd-386), const BPF_MEM ideal-int +pkg syscall (freebsd-386), const BPF_MEMWORDS ideal-int +pkg syscall (freebsd-386), const BPF_MINBUFSIZE ideal-int +pkg syscall (freebsd-386), const BPF_MINOR_VERSION ideal-int +pkg syscall (freebsd-386), const BPF_MISC ideal-int +pkg syscall (freebsd-386), const BPF_MSH ideal-int +pkg syscall (freebsd-386), const BPF_MUL ideal-int +pkg syscall (freebsd-386), const BPF_NEG ideal-int +pkg syscall (freebsd-386), const BPF_OR ideal-int +pkg syscall (freebsd-386), const BPF_RELEASE ideal-int +pkg syscall (freebsd-386), const BPF_RET ideal-int +pkg syscall (freebsd-386), const BPF_RSH ideal-int +pkg syscall (freebsd-386), const BPF_ST ideal-int +pkg syscall (freebsd-386), const BPF_STX ideal-int +pkg syscall (freebsd-386), const BPF_SUB ideal-int +pkg syscall (freebsd-386), const BPF_TAX ideal-int +pkg syscall (freebsd-386), const BPF_TXA ideal-int +pkg syscall (freebsd-386), const BPF_W ideal-int +pkg syscall (freebsd-386), const BPF_X ideal-int +pkg syscall (freebsd-386), const CTL_MAXNAME ideal-int +pkg syscall (freebsd-386), const CTL_NET ideal-int +pkg syscall (freebsd-386), const DLT_A429 ideal-int +pkg syscall (freebsd-386), const DLT_A653_ICM ideal-int +pkg syscall (freebsd-386), const DLT_AIRONET_HEADER ideal-int +pkg syscall (freebsd-386), const DLT_APPLE_IP_OVER_IEEE1394 ideal-int +pkg syscall (freebsd-386), const DLT_ARCNET ideal-int +pkg syscall (freebsd-386), const DLT_ARCNET_LINUX ideal-int +pkg syscall (freebsd-386), const DLT_ATM_CLIP ideal-int +pkg syscall (freebsd-386), const DLT_ATM_RFC1483 ideal-int +pkg syscall (freebsd-386), const DLT_AURORA ideal-int +pkg syscall (freebsd-386), const DLT_AX25 ideal-int +pkg syscall (freebsd-386), const DLT_AX25_KISS ideal-int +pkg syscall (freebsd-386), const DLT_BACNET_MS_TP ideal-int +pkg syscall (freebsd-386), const DLT_BLUETOOTH_HCI_H4 ideal-int +pkg syscall (freebsd-386), const DLT_BLUETOOTH_HCI_H4_WITH_PHDR ideal-int +pkg syscall (freebsd-386), const DLT_CAN20B ideal-int +pkg syscall (freebsd-386), const DLT_CHAOS ideal-int +pkg syscall (freebsd-386), const DLT_CHDLC ideal-int +pkg syscall (freebsd-386), const DLT_CISCO_IOS ideal-int +pkg syscall (freebsd-386), const DLT_C_HDLC ideal-int +pkg syscall (freebsd-386), const DLT_C_HDLC_WITH_DIR ideal-int +pkg syscall (freebsd-386), const DLT_DOCSIS ideal-int +pkg syscall (freebsd-386), const DLT_ECONET ideal-int +pkg syscall (freebsd-386), const DLT_EN10MB ideal-int +pkg syscall (freebsd-386), const DLT_EN3MB ideal-int +pkg syscall (freebsd-386), const DLT_ENC ideal-int +pkg syscall (freebsd-386), const DLT_ERF ideal-int +pkg syscall (freebsd-386), const DLT_ERF_ETH ideal-int +pkg syscall (freebsd-386), const DLT_ERF_POS ideal-int +pkg syscall (freebsd-386), const DLT_FDDI ideal-int +pkg syscall (freebsd-386), const DLT_FLEXRAY ideal-int +pkg syscall (freebsd-386), const DLT_FRELAY ideal-int +pkg syscall (freebsd-386), const DLT_FRELAY_WITH_DIR ideal-int +pkg syscall (freebsd-386), const DLT_GCOM_SERIAL ideal-int +pkg syscall (freebsd-386), const DLT_GCOM_T1E1 ideal-int +pkg syscall (freebsd-386), const DLT_GPF_F ideal-int +pkg syscall (freebsd-386), const DLT_GPF_T ideal-int +pkg syscall (freebsd-386), const DLT_GPRS_LLC ideal-int +pkg syscall (freebsd-386), const DLT_HHDLC ideal-int +pkg syscall (freebsd-386), const DLT_IBM_SN ideal-int +pkg syscall (freebsd-386), const DLT_IBM_SP ideal-int +pkg syscall (freebsd-386), const DLT_IEEE802 ideal-int +pkg syscall (freebsd-386), const DLT_IEEE802_11 ideal-int +pkg syscall (freebsd-386), const DLT_IEEE802_11_RADIO ideal-int +pkg syscall (freebsd-386), const DLT_IEEE802_11_RADIO_AVS ideal-int +pkg syscall (freebsd-386), const DLT_IEEE802_15_4 ideal-int +pkg syscall (freebsd-386), const DLT_IEEE802_15_4_LINUX ideal-int +pkg syscall (freebsd-386), const DLT_IEEE802_15_4_NONASK_PHY ideal-int +pkg syscall (freebsd-386), const DLT_IEEE802_16_MAC_CPS ideal-int +pkg syscall (freebsd-386), const DLT_IEEE802_16_MAC_CPS_RADIO ideal-int +pkg syscall (freebsd-386), const DLT_IPFILTER ideal-int +pkg syscall (freebsd-386), const DLT_IPMB ideal-int +pkg syscall (freebsd-386), const DLT_IPMB_LINUX ideal-int +pkg syscall (freebsd-386), const DLT_IP_OVER_FC ideal-int +pkg syscall (freebsd-386), const DLT_JUNIPER_ATM1 ideal-int +pkg syscall (freebsd-386), const DLT_JUNIPER_ATM2 ideal-int +pkg syscall (freebsd-386), const DLT_JUNIPER_CHDLC ideal-int +pkg syscall (freebsd-386), const DLT_JUNIPER_ES ideal-int +pkg syscall (freebsd-386), const DLT_JUNIPER_ETHER ideal-int +pkg syscall (freebsd-386), const DLT_JUNIPER_FRELAY ideal-int +pkg syscall (freebsd-386), const DLT_JUNIPER_GGSN ideal-int +pkg syscall (freebsd-386), const DLT_JUNIPER_ISM ideal-int +pkg syscall (freebsd-386), const DLT_JUNIPER_MFR ideal-int +pkg syscall (freebsd-386), const DLT_JUNIPER_MLFR ideal-int +pkg syscall (freebsd-386), const DLT_JUNIPER_MLPPP ideal-int +pkg syscall (freebsd-386), const DLT_JUNIPER_MONITOR ideal-int +pkg syscall (freebsd-386), const DLT_JUNIPER_PIC_PEER ideal-int +pkg syscall (freebsd-386), const DLT_JUNIPER_PPP ideal-int +pkg syscall (freebsd-386), const DLT_JUNIPER_PPPOE ideal-int +pkg syscall (freebsd-386), const DLT_JUNIPER_PPPOE_ATM ideal-int +pkg syscall (freebsd-386), const DLT_JUNIPER_SERVICES ideal-int +pkg syscall (freebsd-386), const DLT_JUNIPER_ST ideal-int +pkg syscall (freebsd-386), const DLT_JUNIPER_VP ideal-int +pkg syscall (freebsd-386), const DLT_LAPB_WITH_DIR ideal-int +pkg syscall (freebsd-386), const DLT_LAPD ideal-int +pkg syscall (freebsd-386), const DLT_LIN ideal-int +pkg syscall (freebsd-386), const DLT_LINUX_IRDA ideal-int +pkg syscall (freebsd-386), const DLT_LINUX_LAPD ideal-int +pkg syscall (freebsd-386), const DLT_LINUX_PPP_WITHDIRECTION ideal-int +pkg syscall (freebsd-386), const DLT_LINUX_SLL ideal-int +pkg syscall (freebsd-386), const DLT_LOOP ideal-int +pkg syscall (freebsd-386), const DLT_LTALK ideal-int +pkg syscall (freebsd-386), const DLT_MFR ideal-int +pkg syscall (freebsd-386), const DLT_MOST ideal-int +pkg syscall (freebsd-386), const DLT_MTP2 ideal-int +pkg syscall (freebsd-386), const DLT_MTP2_WITH_PHDR ideal-int +pkg syscall (freebsd-386), const DLT_MTP3 ideal-int +pkg syscall (freebsd-386), const DLT_NULL ideal-int +pkg syscall (freebsd-386), const DLT_PCI_EXP ideal-int +pkg syscall (freebsd-386), const DLT_PFLOG ideal-int +pkg syscall (freebsd-386), const DLT_PFSYNC ideal-int +pkg syscall (freebsd-386), const DLT_PPI ideal-int +pkg syscall (freebsd-386), const DLT_PPP ideal-int +pkg syscall (freebsd-386), const DLT_PPP_BSDOS ideal-int +pkg syscall (freebsd-386), const DLT_PPP_ETHER ideal-int +pkg syscall (freebsd-386), const DLT_PPP_PPPD ideal-int +pkg syscall (freebsd-386), const DLT_PPP_SERIAL ideal-int +pkg syscall (freebsd-386), const DLT_PPP_WITH_DIR ideal-int +pkg syscall (freebsd-386), const DLT_PPP_WITH_DIRECTION ideal-int +pkg syscall (freebsd-386), const DLT_PRISM_HEADER ideal-int +pkg syscall (freebsd-386), const DLT_PRONET ideal-int +pkg syscall (freebsd-386), const DLT_RAIF1 ideal-int +pkg syscall (freebsd-386), const DLT_RAW ideal-int +pkg syscall (freebsd-386), const DLT_RIO ideal-int +pkg syscall (freebsd-386), const DLT_SCCP ideal-int +pkg syscall (freebsd-386), const DLT_SITA ideal-int +pkg syscall (freebsd-386), const DLT_SLIP ideal-int +pkg syscall (freebsd-386), const DLT_SLIP_BSDOS ideal-int +pkg syscall (freebsd-386), const DLT_SUNATM ideal-int +pkg syscall (freebsd-386), const DLT_SYMANTEC_FIREWALL ideal-int +pkg syscall (freebsd-386), const DLT_TZSP ideal-int +pkg syscall (freebsd-386), const DLT_USB ideal-int +pkg syscall (freebsd-386), const DLT_USB_LINUX ideal-int +pkg syscall (freebsd-386), const DLT_USER0 ideal-int +pkg syscall (freebsd-386), const DLT_USER1 ideal-int +pkg syscall (freebsd-386), const DLT_USER10 ideal-int +pkg syscall (freebsd-386), const DLT_USER11 ideal-int +pkg syscall (freebsd-386), const DLT_USER12 ideal-int +pkg syscall (freebsd-386), const DLT_USER13 ideal-int +pkg syscall (freebsd-386), const DLT_USER14 ideal-int +pkg syscall (freebsd-386), const DLT_USER15 ideal-int +pkg syscall (freebsd-386), const DLT_USER2 ideal-int +pkg syscall (freebsd-386), const DLT_USER3 ideal-int +pkg syscall (freebsd-386), const DLT_USER4 ideal-int +pkg syscall (freebsd-386), const DLT_USER5 ideal-int +pkg syscall (freebsd-386), const DLT_USER6 ideal-int +pkg syscall (freebsd-386), const DLT_USER7 ideal-int +pkg syscall (freebsd-386), const DLT_USER8 ideal-int +pkg syscall (freebsd-386), const DLT_USER9 ideal-int +pkg syscall (freebsd-386), const DLT_X2E_SERIAL ideal-int +pkg syscall (freebsd-386), const DLT_X2E_XORAYA ideal-int +pkg syscall (freebsd-386), const DT_BLK ideal-int +pkg syscall (freebsd-386), const DT_CHR ideal-int +pkg syscall (freebsd-386), const DT_DIR ideal-int +pkg syscall (freebsd-386), const DT_FIFO ideal-int +pkg syscall (freebsd-386), const DT_LNK ideal-int +pkg syscall (freebsd-386), const DT_REG ideal-int +pkg syscall (freebsd-386), const DT_SOCK ideal-int +pkg syscall (freebsd-386), const DT_UNKNOWN ideal-int +pkg syscall (freebsd-386), const DT_WHT ideal-int +pkg syscall (freebsd-386), const EAUTH Errno +pkg syscall (freebsd-386), const EBADMSG Errno +pkg syscall (freebsd-386), const EBADRPC Errno +pkg syscall (freebsd-386), const ECHO ideal-int +pkg syscall (freebsd-386), const ECHOCTL ideal-int +pkg syscall (freebsd-386), const ECHOE ideal-int +pkg syscall (freebsd-386), const ECHOK ideal-int +pkg syscall (freebsd-386), const ECHOKE ideal-int +pkg syscall (freebsd-386), const ECHONL ideal-int +pkg syscall (freebsd-386), const ECHOPRT ideal-int +pkg syscall (freebsd-386), const EDOOFUS Errno +pkg syscall (freebsd-386), const EFTYPE Errno +pkg syscall (freebsd-386), const ELAST Errno +pkg syscall (freebsd-386), const EMULTIHOP Errno +pkg syscall (freebsd-386), const ENEEDAUTH Errno +pkg syscall (freebsd-386), const ENOATTR Errno +pkg syscall (freebsd-386), const ENOLINK Errno +pkg syscall (freebsd-386), const ENOTCAPABLE Errno +pkg syscall (freebsd-386), const EPROCLIM Errno +pkg syscall (freebsd-386), const EPROCUNAVAIL Errno +pkg syscall (freebsd-386), const EPROGMISMATCH Errno +pkg syscall (freebsd-386), const EPROGUNAVAIL Errno +pkg syscall (freebsd-386), const EPROTO Errno +pkg syscall (freebsd-386), const ERPCMISMATCH Errno +pkg syscall (freebsd-386), const EVFILT_AIO ideal-int +pkg syscall (freebsd-386), const EVFILT_FS ideal-int +pkg syscall (freebsd-386), const EVFILT_LIO ideal-int +pkg syscall (freebsd-386), const EVFILT_PROC ideal-int +pkg syscall (freebsd-386), const EVFILT_READ ideal-int +pkg syscall (freebsd-386), const EVFILT_SIGNAL ideal-int +pkg syscall (freebsd-386), const EVFILT_SYSCOUNT ideal-int +pkg syscall (freebsd-386), const EVFILT_TIMER ideal-int +pkg syscall (freebsd-386), const EVFILT_USER ideal-int +pkg syscall (freebsd-386), const EVFILT_VNODE ideal-int +pkg syscall (freebsd-386), const EVFILT_WRITE ideal-int +pkg syscall (freebsd-386), const EV_ADD ideal-int +pkg syscall (freebsd-386), const EV_CLEAR ideal-int +pkg syscall (freebsd-386), const EV_DELETE ideal-int +pkg syscall (freebsd-386), const EV_DISABLE ideal-int +pkg syscall (freebsd-386), const EV_DISPATCH ideal-int +pkg syscall (freebsd-386), const EV_ENABLE ideal-int +pkg syscall (freebsd-386), const EV_EOF ideal-int +pkg syscall (freebsd-386), const EV_ERROR ideal-int +pkg syscall (freebsd-386), const EV_FLAG1 ideal-int +pkg syscall (freebsd-386), const EV_ONESHOT ideal-int +pkg syscall (freebsd-386), const EV_RECEIPT ideal-int +pkg syscall (freebsd-386), const EV_SYSFLAGS ideal-int +pkg syscall (freebsd-386), const EXTA ideal-int +pkg syscall (freebsd-386), const EXTB ideal-int +pkg syscall (freebsd-386), const EXTPROC ideal-int +pkg syscall (freebsd-386), const FD_CLOEXEC ideal-int +pkg syscall (freebsd-386), const FD_SETSIZE ideal-int +pkg syscall (freebsd-386), const F_CANCEL ideal-int +pkg syscall (freebsd-386), const F_DUP2FD ideal-int +pkg syscall (freebsd-386), const F_DUPFD ideal-int +pkg syscall (freebsd-386), const F_GETFD ideal-int +pkg syscall (freebsd-386), const F_GETFL ideal-int +pkg syscall (freebsd-386), const F_GETLK ideal-int +pkg syscall (freebsd-386), const F_GETOWN ideal-int +pkg syscall (freebsd-386), const F_OGETLK ideal-int +pkg syscall (freebsd-386), const F_OK ideal-int +pkg syscall (freebsd-386), const F_OSETLK ideal-int +pkg syscall (freebsd-386), const F_OSETLKW ideal-int +pkg syscall (freebsd-386), const F_RDAHEAD ideal-int +pkg syscall (freebsd-386), const F_RDLCK ideal-int +pkg syscall (freebsd-386), const F_READAHEAD ideal-int +pkg syscall (freebsd-386), const F_SETFD ideal-int +pkg syscall (freebsd-386), const F_SETFL ideal-int +pkg syscall (freebsd-386), const F_SETLK ideal-int +pkg syscall (freebsd-386), const F_SETLKW ideal-int +pkg syscall (freebsd-386), const F_SETLK_REMOTE ideal-int +pkg syscall (freebsd-386), const F_SETOWN ideal-int +pkg syscall (freebsd-386), const F_UNLCK ideal-int +pkg syscall (freebsd-386), const F_UNLCKSYS ideal-int +pkg syscall (freebsd-386), const F_WRLCK ideal-int +pkg syscall (freebsd-386), const IFF_ALLMULTI ideal-int +pkg syscall (freebsd-386), const IFF_ALTPHYS ideal-int +pkg syscall (freebsd-386), const IFF_CANTCHANGE ideal-int +pkg syscall (freebsd-386), const IFF_DEBUG ideal-int +pkg syscall (freebsd-386), const IFF_DRV_OACTIVE ideal-int +pkg syscall (freebsd-386), const IFF_DRV_RUNNING ideal-int +pkg syscall (freebsd-386), const IFF_DYING ideal-int +pkg syscall (freebsd-386), const IFF_LINK0 ideal-int +pkg syscall (freebsd-386), const IFF_LINK1 ideal-int +pkg syscall (freebsd-386), const IFF_LINK2 ideal-int +pkg syscall (freebsd-386), const IFF_MONITOR ideal-int +pkg syscall (freebsd-386), const IFF_NOARP ideal-int +pkg syscall (freebsd-386), const IFF_OACTIVE ideal-int +pkg syscall (freebsd-386), const IFF_POINTOPOINT ideal-int +pkg syscall (freebsd-386), const IFF_PPROMISC ideal-int +pkg syscall (freebsd-386), const IFF_PROMISC ideal-int +pkg syscall (freebsd-386), const IFF_RENAMING ideal-int +pkg syscall (freebsd-386), const IFF_RUNNING ideal-int +pkg syscall (freebsd-386), const IFF_SIMPLEX ideal-int +pkg syscall (freebsd-386), const IFF_SMART ideal-int +pkg syscall (freebsd-386), const IFF_STATICARP ideal-int +pkg syscall (freebsd-386), const IFNAMSIZ ideal-int +pkg syscall (freebsd-386), const IFT_1822 ideal-int +pkg syscall (freebsd-386), const IFT_A12MPPSWITCH ideal-int +pkg syscall (freebsd-386), const IFT_AAL2 ideal-int +pkg syscall (freebsd-386), const IFT_AAL5 ideal-int +pkg syscall (freebsd-386), const IFT_ADSL ideal-int +pkg syscall (freebsd-386), const IFT_AFLANE8023 ideal-int +pkg syscall (freebsd-386), const IFT_AFLANE8025 ideal-int +pkg syscall (freebsd-386), const IFT_ARAP ideal-int +pkg syscall (freebsd-386), const IFT_ARCNET ideal-int +pkg syscall (freebsd-386), const IFT_ARCNETPLUS ideal-int +pkg syscall (freebsd-386), const IFT_ASYNC ideal-int +pkg syscall (freebsd-386), const IFT_ATM ideal-int +pkg syscall (freebsd-386), const IFT_ATMDXI ideal-int +pkg syscall (freebsd-386), const IFT_ATMFUNI ideal-int +pkg syscall (freebsd-386), const IFT_ATMIMA ideal-int +pkg syscall (freebsd-386), const IFT_ATMLOGICAL ideal-int +pkg syscall (freebsd-386), const IFT_ATMRADIO ideal-int +pkg syscall (freebsd-386), const IFT_ATMSUBINTERFACE ideal-int +pkg syscall (freebsd-386), const IFT_ATMVCIENDPT ideal-int +pkg syscall (freebsd-386), const IFT_ATMVIRTUAL ideal-int +pkg syscall (freebsd-386), const IFT_BGPPOLICYACCOUNTING ideal-int +pkg syscall (freebsd-386), const IFT_BRIDGE ideal-int +pkg syscall (freebsd-386), const IFT_BSC ideal-int +pkg syscall (freebsd-386), const IFT_CARP ideal-int +pkg syscall (freebsd-386), const IFT_CCTEMUL ideal-int +pkg syscall (freebsd-386), const IFT_CEPT ideal-int +pkg syscall (freebsd-386), const IFT_CES ideal-int +pkg syscall (freebsd-386), const IFT_CHANNEL ideal-int +pkg syscall (freebsd-386), const IFT_CNR ideal-int +pkg syscall (freebsd-386), const IFT_COFFEE ideal-int +pkg syscall (freebsd-386), const IFT_COMPOSITELINK ideal-int +pkg syscall (freebsd-386), const IFT_DCN ideal-int +pkg syscall (freebsd-386), const IFT_DIGITALPOWERLINE ideal-int +pkg syscall (freebsd-386), const IFT_DIGITALWRAPPEROVERHEADCHANNEL ideal-int +pkg syscall (freebsd-386), const IFT_DLSW ideal-int +pkg syscall (freebsd-386), const IFT_DOCSCABLEDOWNSTREAM ideal-int +pkg syscall (freebsd-386), const IFT_DOCSCABLEMACLAYER ideal-int +pkg syscall (freebsd-386), const IFT_DOCSCABLEUPSTREAM ideal-int +pkg syscall (freebsd-386), const IFT_DS0 ideal-int +pkg syscall (freebsd-386), const IFT_DS0BUNDLE ideal-int +pkg syscall (freebsd-386), const IFT_DS1FDL ideal-int +pkg syscall (freebsd-386), const IFT_DS3 ideal-int +pkg syscall (freebsd-386), const IFT_DTM ideal-int +pkg syscall (freebsd-386), const IFT_DVBASILN ideal-int +pkg syscall (freebsd-386), const IFT_DVBASIOUT ideal-int +pkg syscall (freebsd-386), const IFT_DVBRCCDOWNSTREAM ideal-int +pkg syscall (freebsd-386), const IFT_DVBRCCMACLAYER ideal-int +pkg syscall (freebsd-386), const IFT_DVBRCCUPSTREAM ideal-int +pkg syscall (freebsd-386), const IFT_ENC ideal-int +pkg syscall (freebsd-386), const IFT_EON ideal-int +pkg syscall (freebsd-386), const IFT_EPLRS ideal-int +pkg syscall (freebsd-386), const IFT_ESCON ideal-int +pkg syscall (freebsd-386), const IFT_ETHER ideal-int +pkg syscall (freebsd-386), const IFT_FAITH ideal-int +pkg syscall (freebsd-386), const IFT_FAST ideal-int +pkg syscall (freebsd-386), const IFT_FASTETHER ideal-int +pkg syscall (freebsd-386), const IFT_FASTETHERFX ideal-int +pkg syscall (freebsd-386), const IFT_FDDI ideal-int +pkg syscall (freebsd-386), const IFT_FIBRECHANNEL ideal-int +pkg syscall (freebsd-386), const IFT_FRAMERELAYINTERCONNECT ideal-int +pkg syscall (freebsd-386), const IFT_FRAMERELAYMPI ideal-int +pkg syscall (freebsd-386), const IFT_FRDLCIENDPT ideal-int +pkg syscall (freebsd-386), const IFT_FRELAY ideal-int +pkg syscall (freebsd-386), const IFT_FRELAYDCE ideal-int +pkg syscall (freebsd-386), const IFT_FRF16MFRBUNDLE ideal-int +pkg syscall (freebsd-386), const IFT_FRFORWARD ideal-int +pkg syscall (freebsd-386), const IFT_G703AT2MB ideal-int +pkg syscall (freebsd-386), const IFT_G703AT64K ideal-int +pkg syscall (freebsd-386), const IFT_GIF ideal-int +pkg syscall (freebsd-386), const IFT_GIGABITETHERNET ideal-int +pkg syscall (freebsd-386), const IFT_GR303IDT ideal-int +pkg syscall (freebsd-386), const IFT_GR303RDT ideal-int +pkg syscall (freebsd-386), const IFT_H323GATEKEEPER ideal-int +pkg syscall (freebsd-386), const IFT_H323PROXY ideal-int +pkg syscall (freebsd-386), const IFT_HDH1822 ideal-int +pkg syscall (freebsd-386), const IFT_HDLC ideal-int +pkg syscall (freebsd-386), const IFT_HDSL2 ideal-int +pkg syscall (freebsd-386), const IFT_HIPERLAN2 ideal-int +pkg syscall (freebsd-386), const IFT_HIPPI ideal-int +pkg syscall (freebsd-386), const IFT_HIPPIINTERFACE ideal-int +pkg syscall (freebsd-386), const IFT_HOSTPAD ideal-int +pkg syscall (freebsd-386), const IFT_HSSI ideal-int +pkg syscall (freebsd-386), const IFT_HY ideal-int +pkg syscall (freebsd-386), const IFT_IBM370PARCHAN ideal-int +pkg syscall (freebsd-386), const IFT_IDSL ideal-int +pkg syscall (freebsd-386), const IFT_IEEE1394 ideal-int +pkg syscall (freebsd-386), const IFT_IEEE80211 ideal-int +pkg syscall (freebsd-386), const IFT_IEEE80212 ideal-int +pkg syscall (freebsd-386), const IFT_IEEE8023ADLAG ideal-int +pkg syscall (freebsd-386), const IFT_IFGSN ideal-int +pkg syscall (freebsd-386), const IFT_IMT ideal-int +pkg syscall (freebsd-386), const IFT_INTERLEAVE ideal-int +pkg syscall (freebsd-386), const IFT_IP ideal-int +pkg syscall (freebsd-386), const IFT_IPFORWARD ideal-int +pkg syscall (freebsd-386), const IFT_IPOVERATM ideal-int +pkg syscall (freebsd-386), const IFT_IPOVERCDLC ideal-int +pkg syscall (freebsd-386), const IFT_IPOVERCLAW ideal-int +pkg syscall (freebsd-386), const IFT_IPSWITCH ideal-int +pkg syscall (freebsd-386), const IFT_IPXIP ideal-int +pkg syscall (freebsd-386), const IFT_ISDN ideal-int +pkg syscall (freebsd-386), const IFT_ISDNBASIC ideal-int +pkg syscall (freebsd-386), const IFT_ISDNPRIMARY ideal-int +pkg syscall (freebsd-386), const IFT_ISDNS ideal-int +pkg syscall (freebsd-386), const IFT_ISDNU ideal-int +pkg syscall (freebsd-386), const IFT_ISO88022LLC ideal-int +pkg syscall (freebsd-386), const IFT_ISO88023 ideal-int +pkg syscall (freebsd-386), const IFT_ISO88024 ideal-int +pkg syscall (freebsd-386), const IFT_ISO88025 ideal-int +pkg syscall (freebsd-386), const IFT_ISO88025CRFPINT ideal-int +pkg syscall (freebsd-386), const IFT_ISO88025DTR ideal-int +pkg syscall (freebsd-386), const IFT_ISO88025FIBER ideal-int +pkg syscall (freebsd-386), const IFT_ISO88026 ideal-int +pkg syscall (freebsd-386), const IFT_ISUP ideal-int +pkg syscall (freebsd-386), const IFT_L2VLAN ideal-int +pkg syscall (freebsd-386), const IFT_L3IPVLAN ideal-int +pkg syscall (freebsd-386), const IFT_L3IPXVLAN ideal-int +pkg syscall (freebsd-386), const IFT_LAPB ideal-int +pkg syscall (freebsd-386), const IFT_LAPD ideal-int +pkg syscall (freebsd-386), const IFT_LAPF ideal-int +pkg syscall (freebsd-386), const IFT_LOCALTALK ideal-int +pkg syscall (freebsd-386), const IFT_LOOP ideal-int +pkg syscall (freebsd-386), const IFT_MEDIAMAILOVERIP ideal-int +pkg syscall (freebsd-386), const IFT_MFSIGLINK ideal-int +pkg syscall (freebsd-386), const IFT_MIOX25 ideal-int +pkg syscall (freebsd-386), const IFT_MODEM ideal-int +pkg syscall (freebsd-386), const IFT_MPC ideal-int +pkg syscall (freebsd-386), const IFT_MPLS ideal-int +pkg syscall (freebsd-386), const IFT_MPLSTUNNEL ideal-int +pkg syscall (freebsd-386), const IFT_MSDSL ideal-int +pkg syscall (freebsd-386), const IFT_MVL ideal-int +pkg syscall (freebsd-386), const IFT_MYRINET ideal-int +pkg syscall (freebsd-386), const IFT_NFAS ideal-int +pkg syscall (freebsd-386), const IFT_NSIP ideal-int +pkg syscall (freebsd-386), const IFT_OPTICALCHANNEL ideal-int +pkg syscall (freebsd-386), const IFT_OPTICALTRANSPORT ideal-int +pkg syscall (freebsd-386), const IFT_OTHER ideal-int +pkg syscall (freebsd-386), const IFT_P10 ideal-int +pkg syscall (freebsd-386), const IFT_P80 ideal-int +pkg syscall (freebsd-386), const IFT_PARA ideal-int +pkg syscall (freebsd-386), const IFT_PFLOG ideal-int +pkg syscall (freebsd-386), const IFT_PFSYNC ideal-int +pkg syscall (freebsd-386), const IFT_PLC ideal-int +pkg syscall (freebsd-386), const IFT_POS ideal-int +pkg syscall (freebsd-386), const IFT_PPP ideal-int +pkg syscall (freebsd-386), const IFT_PPPMULTILINKBUNDLE ideal-int +pkg syscall (freebsd-386), const IFT_PROPBWAP2MP ideal-int +pkg syscall (freebsd-386), const IFT_PROPCNLS ideal-int +pkg syscall (freebsd-386), const IFT_PROPDOCSWIRELESSDOWNSTREAM ideal-int +pkg syscall (freebsd-386), const IFT_PROPDOCSWIRELESSMACLAYER ideal-int +pkg syscall (freebsd-386), const IFT_PROPDOCSWIRELESSUPSTREAM ideal-int +pkg syscall (freebsd-386), const IFT_PROPMUX ideal-int +pkg syscall (freebsd-386), const IFT_PROPVIRTUAL ideal-int +pkg syscall (freebsd-386), const IFT_PROPWIRELESSP2P ideal-int +pkg syscall (freebsd-386), const IFT_PTPSERIAL ideal-int +pkg syscall (freebsd-386), const IFT_PVC ideal-int +pkg syscall (freebsd-386), const IFT_QLLC ideal-int +pkg syscall (freebsd-386), const IFT_RADIOMAC ideal-int +pkg syscall (freebsd-386), const IFT_RADSL ideal-int +pkg syscall (freebsd-386), const IFT_REACHDSL ideal-int +pkg syscall (freebsd-386), const IFT_RFC1483 ideal-int +pkg syscall (freebsd-386), const IFT_RS232 ideal-int +pkg syscall (freebsd-386), const IFT_RSRB ideal-int +pkg syscall (freebsd-386), const IFT_SDLC ideal-int +pkg syscall (freebsd-386), const IFT_SDSL ideal-int +pkg syscall (freebsd-386), const IFT_SHDSL ideal-int +pkg syscall (freebsd-386), const IFT_SIP ideal-int +pkg syscall (freebsd-386), const IFT_SLIP ideal-int +pkg syscall (freebsd-386), const IFT_SMDSDXI ideal-int +pkg syscall (freebsd-386), const IFT_SMDSICIP ideal-int +pkg syscall (freebsd-386), const IFT_SONET ideal-int +pkg syscall (freebsd-386), const IFT_SONETOVERHEADCHANNEL ideal-int +pkg syscall (freebsd-386), const IFT_SONETPATH ideal-int +pkg syscall (freebsd-386), const IFT_SONETVT ideal-int +pkg syscall (freebsd-386), const IFT_SRP ideal-int +pkg syscall (freebsd-386), const IFT_SS7SIGLINK ideal-int +pkg syscall (freebsd-386), const IFT_STACKTOSTACK ideal-int +pkg syscall (freebsd-386), const IFT_STARLAN ideal-int +pkg syscall (freebsd-386), const IFT_STF ideal-int +pkg syscall (freebsd-386), const IFT_T1 ideal-int +pkg syscall (freebsd-386), const IFT_TDLC ideal-int +pkg syscall (freebsd-386), const IFT_TERMPAD ideal-int +pkg syscall (freebsd-386), const IFT_TR008 ideal-int +pkg syscall (freebsd-386), const IFT_TRANSPHDLC ideal-int +pkg syscall (freebsd-386), const IFT_TUNNEL ideal-int +pkg syscall (freebsd-386), const IFT_ULTRA ideal-int +pkg syscall (freebsd-386), const IFT_USB ideal-int +pkg syscall (freebsd-386), const IFT_V11 ideal-int +pkg syscall (freebsd-386), const IFT_V35 ideal-int +pkg syscall (freebsd-386), const IFT_V36 ideal-int +pkg syscall (freebsd-386), const IFT_V37 ideal-int +pkg syscall (freebsd-386), const IFT_VDSL ideal-int +pkg syscall (freebsd-386), const IFT_VIRTUALIPADDRESS ideal-int +pkg syscall (freebsd-386), const IFT_VOICEEM ideal-int +pkg syscall (freebsd-386), const IFT_VOICEENCAP ideal-int +pkg syscall (freebsd-386), const IFT_VOICEFXO ideal-int +pkg syscall (freebsd-386), const IFT_VOICEFXS ideal-int +pkg syscall (freebsd-386), const IFT_VOICEOVERATM ideal-int +pkg syscall (freebsd-386), const IFT_VOICEOVERFRAMERELAY ideal-int +pkg syscall (freebsd-386), const IFT_VOICEOVERIP ideal-int +pkg syscall (freebsd-386), const IFT_X213 ideal-int +pkg syscall (freebsd-386), const IFT_X25 ideal-int +pkg syscall (freebsd-386), const IFT_X25DDN ideal-int +pkg syscall (freebsd-386), const IFT_X25HUNTGROUP ideal-int +pkg syscall (freebsd-386), const IFT_X25MLP ideal-int +pkg syscall (freebsd-386), const IFT_X25PLE ideal-int +pkg syscall (freebsd-386), const IFT_XETHER ideal-int +pkg syscall (freebsd-386), const IN_CLASSA_HOST ideal-int +pkg syscall (freebsd-386), const IN_CLASSA_MAX ideal-int +pkg syscall (freebsd-386), const IN_CLASSA_NET ideal-int +pkg syscall (freebsd-386), const IN_CLASSA_NSHIFT ideal-int +pkg syscall (freebsd-386), const IN_CLASSB_HOST ideal-int +pkg syscall (freebsd-386), const IN_CLASSB_MAX ideal-int +pkg syscall (freebsd-386), const IN_CLASSB_NET ideal-int +pkg syscall (freebsd-386), const IN_CLASSB_NSHIFT ideal-int +pkg syscall (freebsd-386), const IN_CLASSC_HOST ideal-int +pkg syscall (freebsd-386), const IN_CLASSC_NET ideal-int +pkg syscall (freebsd-386), const IN_CLASSC_NSHIFT ideal-int +pkg syscall (freebsd-386), const IN_CLASSD_HOST ideal-int +pkg syscall (freebsd-386), const IN_CLASSD_NET ideal-int +pkg syscall (freebsd-386), const IN_CLASSD_NSHIFT ideal-int +pkg syscall (freebsd-386), const IN_LOOPBACKNET ideal-int +pkg syscall (freebsd-386), const IPPROTO_3PC ideal-int +pkg syscall (freebsd-386), const IPPROTO_ADFS ideal-int +pkg syscall (freebsd-386), const IPPROTO_AH ideal-int +pkg syscall (freebsd-386), const IPPROTO_AHIP ideal-int +pkg syscall (freebsd-386), const IPPROTO_APES ideal-int +pkg syscall (freebsd-386), const IPPROTO_ARGUS ideal-int +pkg syscall (freebsd-386), const IPPROTO_AX25 ideal-int +pkg syscall (freebsd-386), const IPPROTO_BHA ideal-int +pkg syscall (freebsd-386), const IPPROTO_BLT ideal-int +pkg syscall (freebsd-386), const IPPROTO_BRSATMON ideal-int +pkg syscall (freebsd-386), const IPPROTO_CARP ideal-int +pkg syscall (freebsd-386), const IPPROTO_CFTP ideal-int +pkg syscall (freebsd-386), const IPPROTO_CHAOS ideal-int +pkg syscall (freebsd-386), const IPPROTO_CMTP ideal-int +pkg syscall (freebsd-386), const IPPROTO_CPHB ideal-int +pkg syscall (freebsd-386), const IPPROTO_CPNX ideal-int +pkg syscall (freebsd-386), const IPPROTO_DDP ideal-int +pkg syscall (freebsd-386), const IPPROTO_DGP ideal-int +pkg syscall (freebsd-386), const IPPROTO_DIVERT ideal-int +pkg syscall (freebsd-386), const IPPROTO_DONE ideal-int +pkg syscall (freebsd-386), const IPPROTO_DSTOPTS ideal-int +pkg syscall (freebsd-386), const IPPROTO_EGP ideal-int +pkg syscall (freebsd-386), const IPPROTO_EMCON ideal-int +pkg syscall (freebsd-386), const IPPROTO_ENCAP ideal-int +pkg syscall (freebsd-386), const IPPROTO_EON ideal-int +pkg syscall (freebsd-386), const IPPROTO_ESP ideal-int +pkg syscall (freebsd-386), const IPPROTO_ETHERIP ideal-int +pkg syscall (freebsd-386), const IPPROTO_FRAGMENT ideal-int +pkg syscall (freebsd-386), const IPPROTO_GGP ideal-int +pkg syscall (freebsd-386), const IPPROTO_GMTP ideal-int +pkg syscall (freebsd-386), const IPPROTO_GRE ideal-int +pkg syscall (freebsd-386), const IPPROTO_HELLO ideal-int +pkg syscall (freebsd-386), const IPPROTO_HMP ideal-int +pkg syscall (freebsd-386), const IPPROTO_HOPOPTS ideal-int +pkg syscall (freebsd-386), const IPPROTO_ICMP ideal-int +pkg syscall (freebsd-386), const IPPROTO_ICMPV6 ideal-int +pkg syscall (freebsd-386), const IPPROTO_IDP ideal-int +pkg syscall (freebsd-386), const IPPROTO_IDPR ideal-int +pkg syscall (freebsd-386), const IPPROTO_IDRP ideal-int +pkg syscall (freebsd-386), const IPPROTO_IGMP ideal-int +pkg syscall (freebsd-386), const IPPROTO_IGP ideal-int +pkg syscall (freebsd-386), const IPPROTO_IGRP ideal-int +pkg syscall (freebsd-386), const IPPROTO_IL ideal-int +pkg syscall (freebsd-386), const IPPROTO_INLSP ideal-int +pkg syscall (freebsd-386), const IPPROTO_INP ideal-int +pkg syscall (freebsd-386), const IPPROTO_IPCOMP ideal-int +pkg syscall (freebsd-386), const IPPROTO_IPCV ideal-int +pkg syscall (freebsd-386), const IPPROTO_IPEIP ideal-int +pkg syscall (freebsd-386), const IPPROTO_IPIP ideal-int +pkg syscall (freebsd-386), const IPPROTO_IPPC ideal-int +pkg syscall (freebsd-386), const IPPROTO_IPV4 ideal-int +pkg syscall (freebsd-386), const IPPROTO_IRTP ideal-int +pkg syscall (freebsd-386), const IPPROTO_KRYPTOLAN ideal-int +pkg syscall (freebsd-386), const IPPROTO_LARP ideal-int +pkg syscall (freebsd-386), const IPPROTO_LEAF1 ideal-int +pkg syscall (freebsd-386), const IPPROTO_LEAF2 ideal-int +pkg syscall (freebsd-386), const IPPROTO_MAX ideal-int +pkg syscall (freebsd-386), const IPPROTO_MAXID ideal-int +pkg syscall (freebsd-386), const IPPROTO_MEAS ideal-int +pkg syscall (freebsd-386), const IPPROTO_MHRP ideal-int +pkg syscall (freebsd-386), const IPPROTO_MICP ideal-int +pkg syscall (freebsd-386), const IPPROTO_MOBILE ideal-int +pkg syscall (freebsd-386), const IPPROTO_MTP ideal-int +pkg syscall (freebsd-386), const IPPROTO_MUX ideal-int +pkg syscall (freebsd-386), const IPPROTO_ND ideal-int +pkg syscall (freebsd-386), const IPPROTO_NHRP ideal-int +pkg syscall (freebsd-386), const IPPROTO_NONE ideal-int +pkg syscall (freebsd-386), const IPPROTO_NSP ideal-int +pkg syscall (freebsd-386), const IPPROTO_NVPII ideal-int +pkg syscall (freebsd-386), const IPPROTO_OLD_DIVERT ideal-int +pkg syscall (freebsd-386), const IPPROTO_OSPFIGP ideal-int +pkg syscall (freebsd-386), const IPPROTO_PFSYNC ideal-int +pkg syscall (freebsd-386), const IPPROTO_PGM ideal-int +pkg syscall (freebsd-386), const IPPROTO_PIGP ideal-int +pkg syscall (freebsd-386), const IPPROTO_PIM ideal-int +pkg syscall (freebsd-386), const IPPROTO_PRM ideal-int +pkg syscall (freebsd-386), const IPPROTO_PUP ideal-int +pkg syscall (freebsd-386), const IPPROTO_PVP ideal-int +pkg syscall (freebsd-386), const IPPROTO_RAW ideal-int +pkg syscall (freebsd-386), const IPPROTO_RCCMON ideal-int +pkg syscall (freebsd-386), const IPPROTO_RDP ideal-int +pkg syscall (freebsd-386), const IPPROTO_ROUTING ideal-int +pkg syscall (freebsd-386), const IPPROTO_RSVP ideal-int +pkg syscall (freebsd-386), const IPPROTO_RVD ideal-int +pkg syscall (freebsd-386), const IPPROTO_SATEXPAK ideal-int +pkg syscall (freebsd-386), const IPPROTO_SATMON ideal-int +pkg syscall (freebsd-386), const IPPROTO_SCCSP ideal-int +pkg syscall (freebsd-386), const IPPROTO_SCTP ideal-int +pkg syscall (freebsd-386), const IPPROTO_SDRP ideal-int +pkg syscall (freebsd-386), const IPPROTO_SEP ideal-int +pkg syscall (freebsd-386), const IPPROTO_SKIP ideal-int +pkg syscall (freebsd-386), const IPPROTO_SPACER ideal-int +pkg syscall (freebsd-386), const IPPROTO_SRPC ideal-int +pkg syscall (freebsd-386), const IPPROTO_ST ideal-int +pkg syscall (freebsd-386), const IPPROTO_SVMTP ideal-int +pkg syscall (freebsd-386), const IPPROTO_SWIPE ideal-int +pkg syscall (freebsd-386), const IPPROTO_TCF ideal-int +pkg syscall (freebsd-386), const IPPROTO_TLSP ideal-int +pkg syscall (freebsd-386), const IPPROTO_TP ideal-int +pkg syscall (freebsd-386), const IPPROTO_TPXX ideal-int +pkg syscall (freebsd-386), const IPPROTO_TRUNK1 ideal-int +pkg syscall (freebsd-386), const IPPROTO_TRUNK2 ideal-int +pkg syscall (freebsd-386), const IPPROTO_TTP ideal-int +pkg syscall (freebsd-386), const IPPROTO_VINES ideal-int +pkg syscall (freebsd-386), const IPPROTO_VISA ideal-int +pkg syscall (freebsd-386), const IPPROTO_VMTP ideal-int +pkg syscall (freebsd-386), const IPPROTO_WBEXPAK ideal-int +pkg syscall (freebsd-386), const IPPROTO_WBMON ideal-int +pkg syscall (freebsd-386), const IPPROTO_WSN ideal-int +pkg syscall (freebsd-386), const IPPROTO_XNET ideal-int +pkg syscall (freebsd-386), const IPPROTO_XTP ideal-int +pkg syscall (freebsd-386), const IPV6_AUTOFLOWLABEL ideal-int +pkg syscall (freebsd-386), const IPV6_BINDANY ideal-int +pkg syscall (freebsd-386), const IPV6_BINDV6ONLY ideal-int +pkg syscall (freebsd-386), const IPV6_CHECKSUM ideal-int +pkg syscall (freebsd-386), const IPV6_DEFAULT_MULTICAST_HOPS ideal-int +pkg syscall (freebsd-386), const IPV6_DEFAULT_MULTICAST_LOOP ideal-int +pkg syscall (freebsd-386), const IPV6_DEFHLIM ideal-int +pkg syscall (freebsd-386), const IPV6_DONTFRAG ideal-int +pkg syscall (freebsd-386), const IPV6_DSTOPTS ideal-int +pkg syscall (freebsd-386), const IPV6_FAITH ideal-int +pkg syscall (freebsd-386), const IPV6_FLOWINFO_MASK ideal-int +pkg syscall (freebsd-386), const IPV6_FLOWLABEL_MASK ideal-int +pkg syscall (freebsd-386), const IPV6_FRAGTTL ideal-int +pkg syscall (freebsd-386), const IPV6_FW_ADD ideal-int +pkg syscall (freebsd-386), const IPV6_FW_DEL ideal-int +pkg syscall (freebsd-386), const IPV6_FW_FLUSH ideal-int +pkg syscall (freebsd-386), const IPV6_FW_GET ideal-int +pkg syscall (freebsd-386), const IPV6_FW_ZERO ideal-int +pkg syscall (freebsd-386), const IPV6_HLIMDEC ideal-int +pkg syscall (freebsd-386), const IPV6_HOPLIMIT ideal-int +pkg syscall (freebsd-386), const IPV6_HOPOPTS ideal-int +pkg syscall (freebsd-386), const IPV6_IPSEC_POLICY ideal-int +pkg syscall (freebsd-386), const IPV6_MAXHLIM ideal-int +pkg syscall (freebsd-386), const IPV6_MAXOPTHDR ideal-int +pkg syscall (freebsd-386), const IPV6_MAXPACKET ideal-int +pkg syscall (freebsd-386), const IPV6_MAX_GROUP_SRC_FILTER ideal-int +pkg syscall (freebsd-386), const IPV6_MAX_MEMBERSHIPS ideal-int +pkg syscall (freebsd-386), const IPV6_MAX_SOCK_SRC_FILTER ideal-int +pkg syscall (freebsd-386), const IPV6_MIN_MEMBERSHIPS ideal-int +pkg syscall (freebsd-386), const IPV6_MMTU ideal-int +pkg syscall (freebsd-386), const IPV6_MSFILTER ideal-int +pkg syscall (freebsd-386), const IPV6_NEXTHOP ideal-int +pkg syscall (freebsd-386), const IPV6_PATHMTU ideal-int +pkg syscall (freebsd-386), const IPV6_PKTINFO ideal-int +pkg syscall (freebsd-386), const IPV6_PORTRANGE ideal-int +pkg syscall (freebsd-386), const IPV6_PORTRANGE_DEFAULT ideal-int +pkg syscall (freebsd-386), const IPV6_PORTRANGE_HIGH ideal-int +pkg syscall (freebsd-386), const IPV6_PORTRANGE_LOW ideal-int +pkg syscall (freebsd-386), const IPV6_PREFER_TEMPADDR ideal-int +pkg syscall (freebsd-386), const IPV6_RECVDSTOPTS ideal-int +pkg syscall (freebsd-386), const IPV6_RECVHOPLIMIT ideal-int +pkg syscall (freebsd-386), const IPV6_RECVHOPOPTS ideal-int +pkg syscall (freebsd-386), const IPV6_RECVPATHMTU ideal-int +pkg syscall (freebsd-386), const IPV6_RECVPKTINFO ideal-int +pkg syscall (freebsd-386), const IPV6_RECVRTHDR ideal-int +pkg syscall (freebsd-386), const IPV6_RECVTCLASS ideal-int +pkg syscall (freebsd-386), const IPV6_RTHDR ideal-int +pkg syscall (freebsd-386), const IPV6_RTHDRDSTOPTS ideal-int +pkg syscall (freebsd-386), const IPV6_RTHDR_LOOSE ideal-int +pkg syscall (freebsd-386), const IPV6_RTHDR_STRICT ideal-int +pkg syscall (freebsd-386), const IPV6_RTHDR_TYPE_0 ideal-int +pkg syscall (freebsd-386), const IPV6_SOCKOPT_RESERVED1 ideal-int +pkg syscall (freebsd-386), const IPV6_TCLASS ideal-int +pkg syscall (freebsd-386), const IPV6_USE_MIN_MTU ideal-int +pkg syscall (freebsd-386), const IPV6_VERSION ideal-int +pkg syscall (freebsd-386), const IPV6_VERSION_MASK ideal-int +pkg syscall (freebsd-386), const IP_ADD_SOURCE_MEMBERSHIP ideal-int +pkg syscall (freebsd-386), const IP_BINDANY ideal-int +pkg syscall (freebsd-386), const IP_BLOCK_SOURCE ideal-int +pkg syscall (freebsd-386), const IP_DEFAULT_MULTICAST_LOOP ideal-int +pkg syscall (freebsd-386), const IP_DEFAULT_MULTICAST_TTL ideal-int +pkg syscall (freebsd-386), const IP_DF ideal-int +pkg syscall (freebsd-386), const IP_DONTFRAG ideal-int +pkg syscall (freebsd-386), const IP_DROP_SOURCE_MEMBERSHIP ideal-int +pkg syscall (freebsd-386), const IP_DUMMYNET3 ideal-int +pkg syscall (freebsd-386), const IP_DUMMYNET_CONFIGURE ideal-int +pkg syscall (freebsd-386), const IP_DUMMYNET_DEL ideal-int +pkg syscall (freebsd-386), const IP_DUMMYNET_FLUSH ideal-int +pkg syscall (freebsd-386), const IP_DUMMYNET_GET ideal-int +pkg syscall (freebsd-386), const IP_FAITH ideal-int +pkg syscall (freebsd-386), const IP_FW3 ideal-int +pkg syscall (freebsd-386), const IP_FW_ADD ideal-int +pkg syscall (freebsd-386), const IP_FW_DEL ideal-int +pkg syscall (freebsd-386), const IP_FW_FLUSH ideal-int +pkg syscall (freebsd-386), const IP_FW_GET ideal-int +pkg syscall (freebsd-386), const IP_FW_NAT_CFG ideal-int +pkg syscall (freebsd-386), const IP_FW_NAT_DEL ideal-int +pkg syscall (freebsd-386), const IP_FW_NAT_GET_CONFIG ideal-int +pkg syscall (freebsd-386), const IP_FW_NAT_GET_LOG ideal-int +pkg syscall (freebsd-386), const IP_FW_RESETLOG ideal-int +pkg syscall (freebsd-386), const IP_FW_TABLE_ADD ideal-int +pkg syscall (freebsd-386), const IP_FW_TABLE_DEL ideal-int +pkg syscall (freebsd-386), const IP_FW_TABLE_FLUSH ideal-int +pkg syscall (freebsd-386), const IP_FW_TABLE_GETSIZE ideal-int +pkg syscall (freebsd-386), const IP_FW_TABLE_LIST ideal-int +pkg syscall (freebsd-386), const IP_FW_ZERO ideal-int +pkg syscall (freebsd-386), const IP_HDRINCL ideal-int +pkg syscall (freebsd-386), const IP_IPSEC_POLICY ideal-int +pkg syscall (freebsd-386), const IP_MAXPACKET ideal-int +pkg syscall (freebsd-386), const IP_MAX_GROUP_SRC_FILTER ideal-int +pkg syscall (freebsd-386), const IP_MAX_MEMBERSHIPS ideal-int +pkg syscall (freebsd-386), const IP_MAX_SOCK_MUTE_FILTER ideal-int +pkg syscall (freebsd-386), const IP_MAX_SOCK_SRC_FILTER ideal-int +pkg syscall (freebsd-386), const IP_MAX_SOURCE_FILTER ideal-int +pkg syscall (freebsd-386), const IP_MF ideal-int +pkg syscall (freebsd-386), const IP_MINTTL ideal-int +pkg syscall (freebsd-386), const IP_MIN_MEMBERSHIPS ideal-int +pkg syscall (freebsd-386), const IP_MSFILTER ideal-int +pkg syscall (freebsd-386), const IP_MSS ideal-int +pkg syscall (freebsd-386), const IP_MULTICAST_VIF ideal-int +pkg syscall (freebsd-386), const IP_OFFMASK ideal-int +pkg syscall (freebsd-386), const IP_ONESBCAST ideal-int +pkg syscall (freebsd-386), const IP_OPTIONS ideal-int +pkg syscall (freebsd-386), const IP_PORTRANGE ideal-int +pkg syscall (freebsd-386), const IP_PORTRANGE_DEFAULT ideal-int +pkg syscall (freebsd-386), const IP_PORTRANGE_HIGH ideal-int +pkg syscall (freebsd-386), const IP_PORTRANGE_LOW ideal-int +pkg syscall (freebsd-386), const IP_RECVDSTADDR ideal-int +pkg syscall (freebsd-386), const IP_RECVIF ideal-int +pkg syscall (freebsd-386), const IP_RECVOPTS ideal-int +pkg syscall (freebsd-386), const IP_RECVRETOPTS ideal-int +pkg syscall (freebsd-386), const IP_RECVTTL ideal-int +pkg syscall (freebsd-386), const IP_RETOPTS ideal-int +pkg syscall (freebsd-386), const IP_RF ideal-int +pkg syscall (freebsd-386), const IP_RSVP_OFF ideal-int +pkg syscall (freebsd-386), const IP_RSVP_ON ideal-int +pkg syscall (freebsd-386), const IP_RSVP_VIF_OFF ideal-int +pkg syscall (freebsd-386), const IP_RSVP_VIF_ON ideal-int +pkg syscall (freebsd-386), const IP_SENDSRCADDR ideal-int +pkg syscall (freebsd-386), const IP_UNBLOCK_SOURCE ideal-int +pkg syscall (freebsd-386), const LOCK_EX ideal-int +pkg syscall (freebsd-386), const LOCK_NB ideal-int +pkg syscall (freebsd-386), const LOCK_SH ideal-int +pkg syscall (freebsd-386), const LOCK_UN ideal-int +pkg syscall (freebsd-386), const MSG_COMPAT ideal-int +pkg syscall (freebsd-386), const MSG_CTRUNC ideal-int +pkg syscall (freebsd-386), const MSG_DONTROUTE ideal-int +pkg syscall (freebsd-386), const MSG_DONTWAIT ideal-int +pkg syscall (freebsd-386), const MSG_EOF ideal-int +pkg syscall (freebsd-386), const MSG_EOR ideal-int +pkg syscall (freebsd-386), const MSG_NBIO ideal-int +pkg syscall (freebsd-386), const MSG_NOSIGNAL ideal-int +pkg syscall (freebsd-386), const MSG_NOTIFICATION ideal-int +pkg syscall (freebsd-386), const MSG_OOB ideal-int +pkg syscall (freebsd-386), const MSG_PEEK ideal-int +pkg syscall (freebsd-386), const MSG_TRUNC ideal-int +pkg syscall (freebsd-386), const MSG_WAITALL ideal-int +pkg syscall (freebsd-386), const NET_RT_DUMP ideal-int +pkg syscall (freebsd-386), const NET_RT_FLAGS ideal-int +pkg syscall (freebsd-386), const NET_RT_IFLIST ideal-int +pkg syscall (freebsd-386), const NET_RT_IFMALIST ideal-int +pkg syscall (freebsd-386), const NET_RT_MAXID ideal-int +pkg syscall (freebsd-386), const NOTE_ATTRIB ideal-int +pkg syscall (freebsd-386), const NOTE_CHILD ideal-int +pkg syscall (freebsd-386), const NOTE_DELETE ideal-int +pkg syscall (freebsd-386), const NOTE_EXEC ideal-int +pkg syscall (freebsd-386), const NOTE_EXIT ideal-int +pkg syscall (freebsd-386), const NOTE_EXTEND ideal-int +pkg syscall (freebsd-386), const NOTE_FFAND ideal-int +pkg syscall (freebsd-386), const NOTE_FFCOPY ideal-int +pkg syscall (freebsd-386), const NOTE_FFCTRLMASK ideal-int +pkg syscall (freebsd-386), const NOTE_FFLAGSMASK ideal-int +pkg syscall (freebsd-386), const NOTE_FFNOP ideal-int +pkg syscall (freebsd-386), const NOTE_FFOR ideal-int +pkg syscall (freebsd-386), const NOTE_FORK ideal-int +pkg syscall (freebsd-386), const NOTE_LINK ideal-int +pkg syscall (freebsd-386), const NOTE_LOWAT ideal-int +pkg syscall (freebsd-386), const NOTE_PCTRLMASK ideal-int +pkg syscall (freebsd-386), const NOTE_PDATAMASK ideal-int +pkg syscall (freebsd-386), const NOTE_RENAME ideal-int +pkg syscall (freebsd-386), const NOTE_REVOKE ideal-int +pkg syscall (freebsd-386), const NOTE_TRACK ideal-int +pkg syscall (freebsd-386), const NOTE_TRACKERR ideal-int +pkg syscall (freebsd-386), const NOTE_TRIGGER ideal-int +pkg syscall (freebsd-386), const NOTE_WRITE ideal-int +pkg syscall (freebsd-386), const O_ACCMODE ideal-int +pkg syscall (freebsd-386), const O_DIRECT ideal-int +pkg syscall (freebsd-386), const O_DIRECTORY ideal-int +pkg syscall (freebsd-386), const O_EXEC ideal-int +pkg syscall (freebsd-386), const O_EXLOCK ideal-int +pkg syscall (freebsd-386), const O_FSYNC ideal-int +pkg syscall (freebsd-386), const O_NDELAY ideal-int +pkg syscall (freebsd-386), const O_NOFOLLOW ideal-int +pkg syscall (freebsd-386), const O_SHLOCK ideal-int +pkg syscall (freebsd-386), const O_TTY_INIT ideal-int +pkg syscall (freebsd-386), const PTRACE_CONT ideal-int +pkg syscall (freebsd-386), const PTRACE_KILL ideal-int +pkg syscall (freebsd-386), const PTRACE_TRACEME ideal-int +pkg syscall (freebsd-386), const RLIMIT_AS ideal-int +pkg syscall (freebsd-386), const RLIMIT_CORE ideal-int +pkg syscall (freebsd-386), const RLIMIT_CPU ideal-int +pkg syscall (freebsd-386), const RLIMIT_DATA ideal-int +pkg syscall (freebsd-386), const RLIMIT_FSIZE ideal-int +pkg syscall (freebsd-386), const RLIMIT_NOFILE ideal-int +pkg syscall (freebsd-386), const RLIMIT_STACK ideal-int +pkg syscall (freebsd-386), const RLIM_INFINITY ideal-int +pkg syscall (freebsd-386), const RTAX_AUTHOR ideal-int +pkg syscall (freebsd-386), const RTAX_BRD ideal-int +pkg syscall (freebsd-386), const RTAX_DST ideal-int +pkg syscall (freebsd-386), const RTAX_GATEWAY ideal-int +pkg syscall (freebsd-386), const RTAX_GENMASK ideal-int +pkg syscall (freebsd-386), const RTAX_IFA ideal-int +pkg syscall (freebsd-386), const RTAX_IFP ideal-int +pkg syscall (freebsd-386), const RTAX_MAX ideal-int +pkg syscall (freebsd-386), const RTAX_NETMASK ideal-int +pkg syscall (freebsd-386), const RTA_AUTHOR ideal-int +pkg syscall (freebsd-386), const RTA_BRD ideal-int +pkg syscall (freebsd-386), const RTA_DST ideal-int +pkg syscall (freebsd-386), const RTA_GATEWAY ideal-int +pkg syscall (freebsd-386), const RTA_GENMASK ideal-int +pkg syscall (freebsd-386), const RTA_IFA ideal-int +pkg syscall (freebsd-386), const RTA_IFP ideal-int +pkg syscall (freebsd-386), const RTA_NETMASK ideal-int +pkg syscall (freebsd-386), const RTF_BLACKHOLE ideal-int +pkg syscall (freebsd-386), const RTF_BROADCAST ideal-int +pkg syscall (freebsd-386), const RTF_DONE ideal-int +pkg syscall (freebsd-386), const RTF_DYNAMIC ideal-int +pkg syscall (freebsd-386), const RTF_FMASK ideal-int +pkg syscall (freebsd-386), const RTF_GATEWAY ideal-int +pkg syscall (freebsd-386), const RTF_HOST ideal-int +pkg syscall (freebsd-386), const RTF_LLDATA ideal-int +pkg syscall (freebsd-386), const RTF_LLINFO ideal-int +pkg syscall (freebsd-386), const RTF_LOCAL ideal-int +pkg syscall (freebsd-386), const RTF_MODIFIED ideal-int +pkg syscall (freebsd-386), const RTF_MULTICAST ideal-int +pkg syscall (freebsd-386), const RTF_PINNED ideal-int +pkg syscall (freebsd-386), const RTF_PRCLONING ideal-int +pkg syscall (freebsd-386), const RTF_PROTO1 ideal-int +pkg syscall (freebsd-386), const RTF_PROTO2 ideal-int +pkg syscall (freebsd-386), const RTF_PROTO3 ideal-int +pkg syscall (freebsd-386), const RTF_REJECT ideal-int +pkg syscall (freebsd-386), const RTF_RNH_LOCKED ideal-int +pkg syscall (freebsd-386), const RTF_STATIC ideal-int +pkg syscall (freebsd-386), const RTF_STICKY ideal-int +pkg syscall (freebsd-386), const RTF_UP ideal-int +pkg syscall (freebsd-386), const RTF_XRESOLVE ideal-int +pkg syscall (freebsd-386), const RTM_ADD ideal-int +pkg syscall (freebsd-386), const RTM_CHANGE ideal-int +pkg syscall (freebsd-386), const RTM_DELADDR ideal-int +pkg syscall (freebsd-386), const RTM_DELETE ideal-int +pkg syscall (freebsd-386), const RTM_DELMADDR ideal-int +pkg syscall (freebsd-386), const RTM_GET ideal-int +pkg syscall (freebsd-386), const RTM_IEEE80211 ideal-int +pkg syscall (freebsd-386), const RTM_IFANNOUNCE ideal-int +pkg syscall (freebsd-386), const RTM_IFINFO ideal-int +pkg syscall (freebsd-386), const RTM_LOCK ideal-int +pkg syscall (freebsd-386), const RTM_LOSING ideal-int +pkg syscall (freebsd-386), const RTM_MISS ideal-int +pkg syscall (freebsd-386), const RTM_NEWADDR ideal-int +pkg syscall (freebsd-386), const RTM_NEWMADDR ideal-int +pkg syscall (freebsd-386), const RTM_OLDADD ideal-int +pkg syscall (freebsd-386), const RTM_OLDDEL ideal-int +pkg syscall (freebsd-386), const RTM_REDIRECT ideal-int +pkg syscall (freebsd-386), const RTM_RESOLVE ideal-int +pkg syscall (freebsd-386), const RTM_RTTUNIT ideal-int +pkg syscall (freebsd-386), const RTM_VERSION ideal-int +pkg syscall (freebsd-386), const RTV_EXPIRE ideal-int +pkg syscall (freebsd-386), const RTV_HOPCOUNT ideal-int +pkg syscall (freebsd-386), const RTV_MTU ideal-int +pkg syscall (freebsd-386), const RTV_RPIPE ideal-int +pkg syscall (freebsd-386), const RTV_RTT ideal-int +pkg syscall (freebsd-386), const RTV_RTTVAR ideal-int +pkg syscall (freebsd-386), const RTV_SPIPE ideal-int +pkg syscall (freebsd-386), const RTV_SSTHRESH ideal-int +pkg syscall (freebsd-386), const RTV_WEIGHT ideal-int +pkg syscall (freebsd-386), const RUSAGE_CHILDREN ideal-int +pkg syscall (freebsd-386), const RUSAGE_SELF ideal-int +pkg syscall (freebsd-386), const RUSAGE_THREAD ideal-int +pkg syscall (freebsd-386), const SCM_BINTIME ideal-int +pkg syscall (freebsd-386), const SCM_CREDS ideal-int +pkg syscall (freebsd-386), const SCM_RIGHTS ideal-int +pkg syscall (freebsd-386), const SCM_TIMESTAMP ideal-int +pkg syscall (freebsd-386), const SIGCHLD Signal +pkg syscall (freebsd-386), const SIGCONT Signal +pkg syscall (freebsd-386), const SIGEMT Signal +pkg syscall (freebsd-386), const SIGINFO Signal +pkg syscall (freebsd-386), const SIGIO Signal +pkg syscall (freebsd-386), const SIGIOT Signal +pkg syscall (freebsd-386), const SIGLWP Signal +pkg syscall (freebsd-386), const SIGPROF Signal +pkg syscall (freebsd-386), const SIGSTOP Signal +pkg syscall (freebsd-386), const SIGSYS Signal +pkg syscall (freebsd-386), const SIGTHR Signal +pkg syscall (freebsd-386), const SIGTSTP Signal +pkg syscall (freebsd-386), const SIGTTIN Signal +pkg syscall (freebsd-386), const SIGTTOU Signal +pkg syscall (freebsd-386), const SIGURG Signal +pkg syscall (freebsd-386), const SIGUSR1 Signal +pkg syscall (freebsd-386), const SIGUSR2 Signal +pkg syscall (freebsd-386), const SIGVTALRM Signal +pkg syscall (freebsd-386), const SIGWINCH Signal +pkg syscall (freebsd-386), const SIGXCPU Signal +pkg syscall (freebsd-386), const SIGXFSZ Signal +pkg syscall (freebsd-386), const SIOCADDMULTI ideal-int +pkg syscall (freebsd-386), const SIOCADDRT ideal-int +pkg syscall (freebsd-386), const SIOCAIFADDR ideal-int +pkg syscall (freebsd-386), const SIOCAIFGROUP ideal-int +pkg syscall (freebsd-386), const SIOCALIFADDR ideal-int +pkg syscall (freebsd-386), const SIOCATMARK ideal-int +pkg syscall (freebsd-386), const SIOCDELMULTI ideal-int +pkg syscall (freebsd-386), const SIOCDELRT ideal-int +pkg syscall (freebsd-386), const SIOCDIFADDR ideal-int +pkg syscall (freebsd-386), const SIOCDIFGROUP ideal-int +pkg syscall (freebsd-386), const SIOCDIFPHYADDR ideal-int +pkg syscall (freebsd-386), const SIOCDLIFADDR ideal-int +pkg syscall (freebsd-386), const SIOCGDRVSPEC ideal-int +pkg syscall (freebsd-386), const SIOCGETSGCNT ideal-int +pkg syscall (freebsd-386), const SIOCGETVIFCNT ideal-int +pkg syscall (freebsd-386), const SIOCGHIWAT ideal-int +pkg syscall (freebsd-386), const SIOCGIFADDR ideal-int +pkg syscall (freebsd-386), const SIOCGIFBRDADDR ideal-int +pkg syscall (freebsd-386), const SIOCGIFCAP ideal-int +pkg syscall (freebsd-386), const SIOCGIFCONF ideal-int +pkg syscall (freebsd-386), const SIOCGIFDESCR ideal-int +pkg syscall (freebsd-386), const SIOCGIFDSTADDR ideal-int +pkg syscall (freebsd-386), const SIOCGIFFLAGS ideal-int +pkg syscall (freebsd-386), const SIOCGIFGENERIC ideal-int +pkg syscall (freebsd-386), const SIOCGIFGMEMB ideal-int +pkg syscall (freebsd-386), const SIOCGIFGROUP ideal-int +pkg syscall (freebsd-386), const SIOCGIFINDEX ideal-int +pkg syscall (freebsd-386), const SIOCGIFMAC ideal-int +pkg syscall (freebsd-386), const SIOCGIFMEDIA ideal-int +pkg syscall (freebsd-386), const SIOCGIFMETRIC ideal-int +pkg syscall (freebsd-386), const SIOCGIFMTU ideal-int +pkg syscall (freebsd-386), const SIOCGIFNETMASK ideal-int +pkg syscall (freebsd-386), const SIOCGIFPDSTADDR ideal-int +pkg syscall (freebsd-386), const SIOCGIFPHYS ideal-int +pkg syscall (freebsd-386), const SIOCGIFPSRCADDR ideal-int +pkg syscall (freebsd-386), const SIOCGIFSTATUS ideal-int +pkg syscall (freebsd-386), const SIOCGLIFADDR ideal-int +pkg syscall (freebsd-386), const SIOCGLIFPHYADDR ideal-int +pkg syscall (freebsd-386), const SIOCGLOWAT ideal-int +pkg syscall (freebsd-386), const SIOCGPGRP ideal-int +pkg syscall (freebsd-386), const SIOCGPRIVATE_0 ideal-int +pkg syscall (freebsd-386), const SIOCGPRIVATE_1 ideal-int +pkg syscall (freebsd-386), const SIOCIFCREATE ideal-int +pkg syscall (freebsd-386), const SIOCIFCREATE2 ideal-int +pkg syscall (freebsd-386), const SIOCIFDESTROY ideal-int +pkg syscall (freebsd-386), const SIOCIFGCLONERS ideal-int +pkg syscall (freebsd-386), const SIOCSDRVSPEC ideal-int +pkg syscall (freebsd-386), const SIOCSHIWAT ideal-int +pkg syscall (freebsd-386), const SIOCSIFADDR ideal-int +pkg syscall (freebsd-386), const SIOCSIFBRDADDR ideal-int +pkg syscall (freebsd-386), const SIOCSIFCAP ideal-int +pkg syscall (freebsd-386), const SIOCSIFDESCR ideal-int +pkg syscall (freebsd-386), const SIOCSIFDSTADDR ideal-int +pkg syscall (freebsd-386), const SIOCSIFFLAGS ideal-int +pkg syscall (freebsd-386), const SIOCSIFGENERIC ideal-int +pkg syscall (freebsd-386), const SIOCSIFLLADDR ideal-int +pkg syscall (freebsd-386), const SIOCSIFMAC ideal-int +pkg syscall (freebsd-386), const SIOCSIFMEDIA ideal-int +pkg syscall (freebsd-386), const SIOCSIFMETRIC ideal-int +pkg syscall (freebsd-386), const SIOCSIFMTU ideal-int +pkg syscall (freebsd-386), const SIOCSIFNAME ideal-int +pkg syscall (freebsd-386), const SIOCSIFNETMASK ideal-int +pkg syscall (freebsd-386), const SIOCSIFPHYADDR ideal-int +pkg syscall (freebsd-386), const SIOCSIFPHYS ideal-int +pkg syscall (freebsd-386), const SIOCSIFRVNET ideal-int +pkg syscall (freebsd-386), const SIOCSIFVNET ideal-int +pkg syscall (freebsd-386), const SIOCSLIFPHYADDR ideal-int +pkg syscall (freebsd-386), const SIOCSLOWAT ideal-int +pkg syscall (freebsd-386), const SIOCSPGRP ideal-int +pkg syscall (freebsd-386), const SOCK_MAXADDRLEN ideal-int +pkg syscall (freebsd-386), const SOCK_RDM ideal-int +pkg syscall (freebsd-386), const SO_ACCEPTCONN ideal-int +pkg syscall (freebsd-386), const SO_ACCEPTFILTER ideal-int +pkg syscall (freebsd-386), const SO_BINTIME ideal-int +pkg syscall (freebsd-386), const SO_DEBUG ideal-int +pkg syscall (freebsd-386), const SO_ERROR ideal-int +pkg syscall (freebsd-386), const SO_LABEL ideal-int +pkg syscall (freebsd-386), const SO_LISTENINCQLEN ideal-int +pkg syscall (freebsd-386), const SO_LISTENQLEN ideal-int +pkg syscall (freebsd-386), const SO_LISTENQLIMIT ideal-int +pkg syscall (freebsd-386), const SO_NOSIGPIPE ideal-int +pkg syscall (freebsd-386), const SO_NO_DDP ideal-int +pkg syscall (freebsd-386), const SO_NO_OFFLOAD ideal-int +pkg syscall (freebsd-386), const SO_OOBINLINE ideal-int +pkg syscall (freebsd-386), const SO_PEERLABEL ideal-int +pkg syscall (freebsd-386), const SO_RCVLOWAT ideal-int +pkg syscall (freebsd-386), const SO_RCVTIMEO ideal-int +pkg syscall (freebsd-386), const SO_REUSEPORT ideal-int +pkg syscall (freebsd-386), const SO_SETFIB ideal-int +pkg syscall (freebsd-386), const SO_SNDLOWAT ideal-int +pkg syscall (freebsd-386), const SO_SNDTIMEO ideal-int +pkg syscall (freebsd-386), const SO_TIMESTAMP ideal-int +pkg syscall (freebsd-386), const SO_TYPE ideal-int +pkg syscall (freebsd-386), const SO_USELOOPBACK ideal-int +pkg syscall (freebsd-386), const SYS_ABORT2 ideal-int +pkg syscall (freebsd-386), const SYS_ACCEPT ideal-int +pkg syscall (freebsd-386), const SYS_ACCESS ideal-int +pkg syscall (freebsd-386), const SYS_ACCT ideal-int +pkg syscall (freebsd-386), const SYS_ADJTIME ideal-int +pkg syscall (freebsd-386), const SYS_AUDIT ideal-int +pkg syscall (freebsd-386), const SYS_AUDITCTL ideal-int +pkg syscall (freebsd-386), const SYS_AUDITON ideal-int +pkg syscall (freebsd-386), const SYS_BIND ideal-int +pkg syscall (freebsd-386), const SYS_CAP_ENTER ideal-int +pkg syscall (freebsd-386), const SYS_CAP_GETMODE ideal-int +pkg syscall (freebsd-386), const SYS_CAP_GETRIGHTS ideal-int +pkg syscall (freebsd-386), const SYS_CAP_NEW ideal-int +pkg syscall (freebsd-386), const SYS_CHDIR ideal-int +pkg syscall (freebsd-386), const SYS_CHFLAGS ideal-int +pkg syscall (freebsd-386), const SYS_CHMOD ideal-int +pkg syscall (freebsd-386), const SYS_CHOWN ideal-int +pkg syscall (freebsd-386), const SYS_CHROOT ideal-int +pkg syscall (freebsd-386), const SYS_CLOCK_GETRES ideal-int +pkg syscall (freebsd-386), const SYS_CLOCK_GETTIME ideal-int +pkg syscall (freebsd-386), const SYS_CLOCK_SETTIME ideal-int +pkg syscall (freebsd-386), const SYS_CLOSE ideal-int +pkg syscall (freebsd-386), const SYS_CLOSEFROM ideal-int +pkg syscall (freebsd-386), const SYS_CONNECT ideal-int +pkg syscall (freebsd-386), const SYS_CPUSET ideal-int +pkg syscall (freebsd-386), const SYS_CPUSET_GETAFFINITY ideal-int +pkg syscall (freebsd-386), const SYS_CPUSET_GETID ideal-int +pkg syscall (freebsd-386), const SYS_CPUSET_SETAFFINITY ideal-int +pkg syscall (freebsd-386), const SYS_CPUSET_SETID ideal-int +pkg syscall (freebsd-386), const SYS_DUP ideal-int +pkg syscall (freebsd-386), const SYS_DUP2 ideal-int +pkg syscall (freebsd-386), const SYS_EACCESS ideal-int +pkg syscall (freebsd-386), const SYS_EXECVE ideal-int +pkg syscall (freebsd-386), const SYS_EXIT ideal-int +pkg syscall (freebsd-386), const SYS_EXTATTRCTL ideal-int +pkg syscall (freebsd-386), const SYS_EXTATTR_DELETE_FD ideal-int +pkg syscall (freebsd-386), const SYS_EXTATTR_DELETE_FILE ideal-int +pkg syscall (freebsd-386), const SYS_EXTATTR_DELETE_LINK ideal-int +pkg syscall (freebsd-386), const SYS_EXTATTR_GET_FD ideal-int +pkg syscall (freebsd-386), const SYS_EXTATTR_GET_FILE ideal-int +pkg syscall (freebsd-386), const SYS_EXTATTR_GET_LINK ideal-int +pkg syscall (freebsd-386), const SYS_EXTATTR_LIST_FD ideal-int +pkg syscall (freebsd-386), const SYS_EXTATTR_LIST_FILE ideal-int +pkg syscall (freebsd-386), const SYS_EXTATTR_LIST_LINK ideal-int +pkg syscall (freebsd-386), const SYS_EXTATTR_SET_FD ideal-int +pkg syscall (freebsd-386), const SYS_EXTATTR_SET_FILE ideal-int +pkg syscall (freebsd-386), const SYS_EXTATTR_SET_LINK ideal-int +pkg syscall (freebsd-386), const SYS_FACCESSAT ideal-int +pkg syscall (freebsd-386), const SYS_FCHDIR ideal-int +pkg syscall (freebsd-386), const SYS_FCHFLAGS ideal-int +pkg syscall (freebsd-386), const SYS_FCHMOD ideal-int +pkg syscall (freebsd-386), const SYS_FCHMODAT ideal-int +pkg syscall (freebsd-386), const SYS_FCHOWN ideal-int +pkg syscall (freebsd-386), const SYS_FCHOWNAT ideal-int +pkg syscall (freebsd-386), const SYS_FCNTL ideal-int +pkg syscall (freebsd-386), const SYS_FEXECVE ideal-int +pkg syscall (freebsd-386), const SYS_FFCLOCK_GETCOUNTER ideal-int +pkg syscall (freebsd-386), const SYS_FFCLOCK_GETESTIMATE ideal-int +pkg syscall (freebsd-386), const SYS_FFCLOCK_SETESTIMATE ideal-int +pkg syscall (freebsd-386), const SYS_FHOPEN ideal-int +pkg syscall (freebsd-386), const SYS_FHSTAT ideal-int +pkg syscall (freebsd-386), const SYS_FHSTATFS ideal-int +pkg syscall (freebsd-386), const SYS_FLOCK ideal-int +pkg syscall (freebsd-386), const SYS_FORK ideal-int +pkg syscall (freebsd-386), const SYS_FPATHCONF ideal-int +pkg syscall (freebsd-386), const SYS_FREEBSD6_FTRUNCATE ideal-int +pkg syscall (freebsd-386), const SYS_FREEBSD6_LSEEK ideal-int +pkg syscall (freebsd-386), const SYS_FREEBSD6_MMAP ideal-int +pkg syscall (freebsd-386), const SYS_FREEBSD6_PREAD ideal-int +pkg syscall (freebsd-386), const SYS_FREEBSD6_PWRITE ideal-int +pkg syscall (freebsd-386), const SYS_FREEBSD6_TRUNCATE ideal-int +pkg syscall (freebsd-386), const SYS_FSTAT ideal-int +pkg syscall (freebsd-386), const SYS_FSTATAT ideal-int +pkg syscall (freebsd-386), const SYS_FSTATFS ideal-int +pkg syscall (freebsd-386), const SYS_FSYNC ideal-int +pkg syscall (freebsd-386), const SYS_FTRUNCATE ideal-int +pkg syscall (freebsd-386), const SYS_FUTIMES ideal-int +pkg syscall (freebsd-386), const SYS_FUTIMESAT ideal-int +pkg syscall (freebsd-386), const SYS_GETAUDIT ideal-int +pkg syscall (freebsd-386), const SYS_GETAUDIT_ADDR ideal-int +pkg syscall (freebsd-386), const SYS_GETAUID ideal-int +pkg syscall (freebsd-386), const SYS_GETCONTEXT ideal-int +pkg syscall (freebsd-386), const SYS_GETDENTS ideal-int +pkg syscall (freebsd-386), const SYS_GETDIRENTRIES ideal-int +pkg syscall (freebsd-386), const SYS_GETDTABLESIZE ideal-int +pkg syscall (freebsd-386), const SYS_GETEGID ideal-int +pkg syscall (freebsd-386), const SYS_GETEUID ideal-int +pkg syscall (freebsd-386), const SYS_GETFH ideal-int +pkg syscall (freebsd-386), const SYS_GETFSSTAT ideal-int +pkg syscall (freebsd-386), const SYS_GETGID ideal-int +pkg syscall (freebsd-386), const SYS_GETGROUPS ideal-int +pkg syscall (freebsd-386), const SYS_GETITIMER ideal-int +pkg syscall (freebsd-386), const SYS_GETLOGIN ideal-int +pkg syscall (freebsd-386), const SYS_GETLOGINCLASS ideal-int +pkg syscall (freebsd-386), const SYS_GETPEERNAME ideal-int +pkg syscall (freebsd-386), const SYS_GETPGID ideal-int +pkg syscall (freebsd-386), const SYS_GETPGRP ideal-int +pkg syscall (freebsd-386), const SYS_GETPID ideal-int +pkg syscall (freebsd-386), const SYS_GETPPID ideal-int +pkg syscall (freebsd-386), const SYS_GETPRIORITY ideal-int +pkg syscall (freebsd-386), const SYS_GETRESGID ideal-int +pkg syscall (freebsd-386), const SYS_GETRESUID ideal-int +pkg syscall (freebsd-386), const SYS_GETRLIMIT ideal-int +pkg syscall (freebsd-386), const SYS_GETRUSAGE ideal-int +pkg syscall (freebsd-386), const SYS_GETSID ideal-int +pkg syscall (freebsd-386), const SYS_GETSOCKNAME ideal-int +pkg syscall (freebsd-386), const SYS_GETSOCKOPT ideal-int +pkg syscall (freebsd-386), const SYS_GETTIMEOFDAY ideal-int +pkg syscall (freebsd-386), const SYS_GETUID ideal-int +pkg syscall (freebsd-386), const SYS_IOCTL ideal-int +pkg syscall (freebsd-386), const SYS_ISSETUGID ideal-int +pkg syscall (freebsd-386), const SYS_JAIL ideal-int +pkg syscall (freebsd-386), const SYS_JAIL_ATTACH ideal-int +pkg syscall (freebsd-386), const SYS_JAIL_GET ideal-int +pkg syscall (freebsd-386), const SYS_JAIL_REMOVE ideal-int +pkg syscall (freebsd-386), const SYS_JAIL_SET ideal-int +pkg syscall (freebsd-386), const SYS_KENV ideal-int +pkg syscall (freebsd-386), const SYS_KEVENT ideal-int +pkg syscall (freebsd-386), const SYS_KILL ideal-int +pkg syscall (freebsd-386), const SYS_KLDFIND ideal-int +pkg syscall (freebsd-386), const SYS_KLDFIRSTMOD ideal-int +pkg syscall (freebsd-386), const SYS_KLDLOAD ideal-int +pkg syscall (freebsd-386), const SYS_KLDNEXT ideal-int +pkg syscall (freebsd-386), const SYS_KLDSTAT ideal-int +pkg syscall (freebsd-386), const SYS_KLDSYM ideal-int +pkg syscall (freebsd-386), const SYS_KLDUNLOAD ideal-int +pkg syscall (freebsd-386), const SYS_KLDUNLOADF ideal-int +pkg syscall (freebsd-386), const SYS_KQUEUE ideal-int +pkg syscall (freebsd-386), const SYS_KTIMER_CREATE ideal-int +pkg syscall (freebsd-386), const SYS_KTIMER_DELETE ideal-int +pkg syscall (freebsd-386), const SYS_KTIMER_GETOVERRUN ideal-int +pkg syscall (freebsd-386), const SYS_KTIMER_GETTIME ideal-int +pkg syscall (freebsd-386), const SYS_KTIMER_SETTIME ideal-int +pkg syscall (freebsd-386), const SYS_KTRACE ideal-int +pkg syscall (freebsd-386), const SYS_LCHFLAGS ideal-int +pkg syscall (freebsd-386), const SYS_LCHMOD ideal-int +pkg syscall (freebsd-386), const SYS_LCHOWN ideal-int +pkg syscall (freebsd-386), const SYS_LGETFH ideal-int +pkg syscall (freebsd-386), const SYS_LINK ideal-int +pkg syscall (freebsd-386), const SYS_LINKAT ideal-int +pkg syscall (freebsd-386), const SYS_LISTEN ideal-int +pkg syscall (freebsd-386), const SYS_LPATHCONF ideal-int +pkg syscall (freebsd-386), const SYS_LSEEK ideal-int +pkg syscall (freebsd-386), const SYS_LSTAT ideal-int +pkg syscall (freebsd-386), const SYS_LUTIMES ideal-int +pkg syscall (freebsd-386), const SYS_MAC_SYSCALL ideal-int +pkg syscall (freebsd-386), const SYS_MADVISE ideal-int +pkg syscall (freebsd-386), const SYS_MINCORE ideal-int +pkg syscall (freebsd-386), const SYS_MINHERIT ideal-int +pkg syscall (freebsd-386), const SYS_MKDIR ideal-int +pkg syscall (freebsd-386), const SYS_MKDIRAT ideal-int +pkg syscall (freebsd-386), const SYS_MKFIFO ideal-int +pkg syscall (freebsd-386), const SYS_MKFIFOAT ideal-int +pkg syscall (freebsd-386), const SYS_MKNOD ideal-int +pkg syscall (freebsd-386), const SYS_MKNODAT ideal-int +pkg syscall (freebsd-386), const SYS_MLOCK ideal-int +pkg syscall (freebsd-386), const SYS_MLOCKALL ideal-int +pkg syscall (freebsd-386), const SYS_MMAP ideal-int +pkg syscall (freebsd-386), const SYS_MODFIND ideal-int +pkg syscall (freebsd-386), const SYS_MODFNEXT ideal-int +pkg syscall (freebsd-386), const SYS_MODNEXT ideal-int +pkg syscall (freebsd-386), const SYS_MODSTAT ideal-int +pkg syscall (freebsd-386), const SYS_MOUNT ideal-int +pkg syscall (freebsd-386), const SYS_MPROTECT ideal-int +pkg syscall (freebsd-386), const SYS_MSYNC ideal-int +pkg syscall (freebsd-386), const SYS_MUNLOCK ideal-int +pkg syscall (freebsd-386), const SYS_MUNLOCKALL ideal-int +pkg syscall (freebsd-386), const SYS_MUNMAP ideal-int +pkg syscall (freebsd-386), const SYS_NANOSLEEP ideal-int +pkg syscall (freebsd-386), const SYS_NFSTAT ideal-int +pkg syscall (freebsd-386), const SYS_NLSTAT ideal-int +pkg syscall (freebsd-386), const SYS_NMOUNT ideal-int +pkg syscall (freebsd-386), const SYS_NSTAT ideal-int +pkg syscall (freebsd-386), const SYS_NTP_ADJTIME ideal-int +pkg syscall (freebsd-386), const SYS_NTP_GETTIME ideal-int +pkg syscall (freebsd-386), const SYS_OBREAK ideal-int +pkg syscall (freebsd-386), const SYS_OPEN ideal-int +pkg syscall (freebsd-386), const SYS_OPENAT ideal-int +pkg syscall (freebsd-386), const SYS_OPENBSD_POLL ideal-int +pkg syscall (freebsd-386), const SYS_OVADVISE ideal-int +pkg syscall (freebsd-386), const SYS_PATHCONF ideal-int +pkg syscall (freebsd-386), const SYS_PDFORK ideal-int +pkg syscall (freebsd-386), const SYS_PDGETPID ideal-int +pkg syscall (freebsd-386), const SYS_PDKILL ideal-int +pkg syscall (freebsd-386), const SYS_PIPE ideal-int +pkg syscall (freebsd-386), const SYS_POLL ideal-int +pkg syscall (freebsd-386), const SYS_POSIX_FADVISE ideal-int +pkg syscall (freebsd-386), const SYS_POSIX_FALLOCATE ideal-int +pkg syscall (freebsd-386), const SYS_POSIX_OPENPT ideal-int +pkg syscall (freebsd-386), const SYS_PREAD ideal-int +pkg syscall (freebsd-386), const SYS_PREADV ideal-int +pkg syscall (freebsd-386), const SYS_PROFIL ideal-int +pkg syscall (freebsd-386), const SYS_PSELECT ideal-int +pkg syscall (freebsd-386), const SYS_PTRACE ideal-int +pkg syscall (freebsd-386), const SYS_PWRITE ideal-int +pkg syscall (freebsd-386), const SYS_PWRITEV ideal-int +pkg syscall (freebsd-386), const SYS_QUOTACTL ideal-int +pkg syscall (freebsd-386), const SYS_RCTL_ADD_RULE ideal-int +pkg syscall (freebsd-386), const SYS_RCTL_GET_LIMITS ideal-int +pkg syscall (freebsd-386), const SYS_RCTL_GET_RACCT ideal-int +pkg syscall (freebsd-386), const SYS_RCTL_GET_RULES ideal-int +pkg syscall (freebsd-386), const SYS_RCTL_REMOVE_RULE ideal-int +pkg syscall (freebsd-386), const SYS_READ ideal-int +pkg syscall (freebsd-386), const SYS_READLINK ideal-int +pkg syscall (freebsd-386), const SYS_READLINKAT ideal-int +pkg syscall (freebsd-386), const SYS_READV ideal-int +pkg syscall (freebsd-386), const SYS_REBOOT ideal-int +pkg syscall (freebsd-386), const SYS_RECVFROM ideal-int +pkg syscall (freebsd-386), const SYS_RECVMSG ideal-int +pkg syscall (freebsd-386), const SYS_RENAME ideal-int +pkg syscall (freebsd-386), const SYS_RENAMEAT ideal-int +pkg syscall (freebsd-386), const SYS_REVOKE ideal-int +pkg syscall (freebsd-386), const SYS_RFORK ideal-int +pkg syscall (freebsd-386), const SYS_RMDIR ideal-int +pkg syscall (freebsd-386), const SYS_RTPRIO ideal-int +pkg syscall (freebsd-386), const SYS_RTPRIO_THREAD ideal-int +pkg syscall (freebsd-386), const SYS_SBRK ideal-int +pkg syscall (freebsd-386), const SYS_SCHED_GETPARAM ideal-int +pkg syscall (freebsd-386), const SYS_SCHED_GETSCHEDULER ideal-int +pkg syscall (freebsd-386), const SYS_SCHED_GET_PRIORITY_MAX ideal-int +pkg syscall (freebsd-386), const SYS_SCHED_GET_PRIORITY_MIN ideal-int +pkg syscall (freebsd-386), const SYS_SCHED_RR_GET_INTERVAL ideal-int +pkg syscall (freebsd-386), const SYS_SCHED_SETPARAM ideal-int +pkg syscall (freebsd-386), const SYS_SCHED_SETSCHEDULER ideal-int +pkg syscall (freebsd-386), const SYS_SCHED_YIELD ideal-int +pkg syscall (freebsd-386), const SYS_SCTP_GENERIC_RECVMSG ideal-int +pkg syscall (freebsd-386), const SYS_SCTP_GENERIC_SENDMSG ideal-int +pkg syscall (freebsd-386), const SYS_SCTP_GENERIC_SENDMSG_IOV ideal-int +pkg syscall (freebsd-386), const SYS_SCTP_PEELOFF ideal-int +pkg syscall (freebsd-386), const SYS_SELECT ideal-int +pkg syscall (freebsd-386), const SYS_SENDFILE ideal-int +pkg syscall (freebsd-386), const SYS_SENDMSG ideal-int +pkg syscall (freebsd-386), const SYS_SENDTO ideal-int +pkg syscall (freebsd-386), const SYS_SETAUDIT ideal-int +pkg syscall (freebsd-386), const SYS_SETAUDIT_ADDR ideal-int +pkg syscall (freebsd-386), const SYS_SETAUID ideal-int +pkg syscall (freebsd-386), const SYS_SETCONTEXT ideal-int +pkg syscall (freebsd-386), const SYS_SETEGID ideal-int +pkg syscall (freebsd-386), const SYS_SETEUID ideal-int +pkg syscall (freebsd-386), const SYS_SETFIB ideal-int +pkg syscall (freebsd-386), const SYS_SETGID ideal-int +pkg syscall (freebsd-386), const SYS_SETGROUPS ideal-int +pkg syscall (freebsd-386), const SYS_SETITIMER ideal-int +pkg syscall (freebsd-386), const SYS_SETLOGIN ideal-int +pkg syscall (freebsd-386), const SYS_SETLOGINCLASS ideal-int +pkg syscall (freebsd-386), const SYS_SETPGID ideal-int +pkg syscall (freebsd-386), const SYS_SETPRIORITY ideal-int +pkg syscall (freebsd-386), const SYS_SETREGID ideal-int +pkg syscall (freebsd-386), const SYS_SETRESGID ideal-int +pkg syscall (freebsd-386), const SYS_SETRESUID ideal-int +pkg syscall (freebsd-386), const SYS_SETREUID ideal-int +pkg syscall (freebsd-386), const SYS_SETRLIMIT ideal-int +pkg syscall (freebsd-386), const SYS_SETSID ideal-int +pkg syscall (freebsd-386), const SYS_SETSOCKOPT ideal-int +pkg syscall (freebsd-386), const SYS_SETTIMEOFDAY ideal-int +pkg syscall (freebsd-386), const SYS_SETUID ideal-int +pkg syscall (freebsd-386), const SYS_SHM_OPEN ideal-int +pkg syscall (freebsd-386), const SYS_SHM_UNLINK ideal-int +pkg syscall (freebsd-386), const SYS_SHUTDOWN ideal-int +pkg syscall (freebsd-386), const SYS_SIGACTION ideal-int +pkg syscall (freebsd-386), const SYS_SIGALTSTACK ideal-int +pkg syscall (freebsd-386), const SYS_SIGPENDING ideal-int +pkg syscall (freebsd-386), const SYS_SIGPROCMASK ideal-int +pkg syscall (freebsd-386), const SYS_SIGQUEUE ideal-int +pkg syscall (freebsd-386), const SYS_SIGRETURN ideal-int +pkg syscall (freebsd-386), const SYS_SIGSUSPEND ideal-int +pkg syscall (freebsd-386), const SYS_SIGTIMEDWAIT ideal-int +pkg syscall (freebsd-386), const SYS_SIGWAIT ideal-int +pkg syscall (freebsd-386), const SYS_SIGWAITINFO ideal-int +pkg syscall (freebsd-386), const SYS_SOCKET ideal-int +pkg syscall (freebsd-386), const SYS_SOCKETPAIR ideal-int +pkg syscall (freebsd-386), const SYS_SSTK ideal-int +pkg syscall (freebsd-386), const SYS_STAT ideal-int +pkg syscall (freebsd-386), const SYS_STATFS ideal-int +pkg syscall (freebsd-386), const SYS_SWAPCONTEXT ideal-int +pkg syscall (freebsd-386), const SYS_SWAPOFF ideal-int +pkg syscall (freebsd-386), const SYS_SWAPON ideal-int +pkg syscall (freebsd-386), const SYS_SYMLINK ideal-int +pkg syscall (freebsd-386), const SYS_SYMLINKAT ideal-int +pkg syscall (freebsd-386), const SYS_SYNC ideal-int +pkg syscall (freebsd-386), const SYS_SYSARCH ideal-int +pkg syscall (freebsd-386), const SYS_THR_CREATE ideal-int +pkg syscall (freebsd-386), const SYS_THR_EXIT ideal-int +pkg syscall (freebsd-386), const SYS_THR_KILL ideal-int +pkg syscall (freebsd-386), const SYS_THR_KILL2 ideal-int +pkg syscall (freebsd-386), const SYS_THR_NEW ideal-int +pkg syscall (freebsd-386), const SYS_THR_SELF ideal-int +pkg syscall (freebsd-386), const SYS_THR_SET_NAME ideal-int +pkg syscall (freebsd-386), const SYS_THR_SUSPEND ideal-int +pkg syscall (freebsd-386), const SYS_THR_WAKE ideal-int +pkg syscall (freebsd-386), const SYS_TRUNCATE ideal-int +pkg syscall (freebsd-386), const SYS_UMASK ideal-int +pkg syscall (freebsd-386), const SYS_UNDELETE ideal-int +pkg syscall (freebsd-386), const SYS_UNLINK ideal-int +pkg syscall (freebsd-386), const SYS_UNLINKAT ideal-int +pkg syscall (freebsd-386), const SYS_UNMOUNT ideal-int +pkg syscall (freebsd-386), const SYS_UTIMES ideal-int +pkg syscall (freebsd-386), const SYS_UTRACE ideal-int +pkg syscall (freebsd-386), const SYS_UUIDGEN ideal-int +pkg syscall (freebsd-386), const SYS_VFORK ideal-int +pkg syscall (freebsd-386), const SYS_WAIT4 ideal-int +pkg syscall (freebsd-386), const SYS_WRITE ideal-int +pkg syscall (freebsd-386), const SYS_WRITEV ideal-int +pkg syscall (freebsd-386), const SYS_YIELD ideal-int +pkg syscall (freebsd-386), const SYS__UMTX_LOCK ideal-int +pkg syscall (freebsd-386), const SYS__UMTX_OP ideal-int +pkg syscall (freebsd-386), const SYS__UMTX_UNLOCK ideal-int +pkg syscall (freebsd-386), const SYS___ACL_ACLCHECK_FD ideal-int +pkg syscall (freebsd-386), const SYS___ACL_ACLCHECK_FILE ideal-int +pkg syscall (freebsd-386), const SYS___ACL_ACLCHECK_LINK ideal-int +pkg syscall (freebsd-386), const SYS___ACL_DELETE_FD ideal-int +pkg syscall (freebsd-386), const SYS___ACL_DELETE_FILE ideal-int +pkg syscall (freebsd-386), const SYS___ACL_DELETE_LINK ideal-int +pkg syscall (freebsd-386), const SYS___ACL_GET_FD ideal-int +pkg syscall (freebsd-386), const SYS___ACL_GET_FILE ideal-int +pkg syscall (freebsd-386), const SYS___ACL_GET_LINK ideal-int +pkg syscall (freebsd-386), const SYS___ACL_SET_FD ideal-int +pkg syscall (freebsd-386), const SYS___ACL_SET_FILE ideal-int +pkg syscall (freebsd-386), const SYS___ACL_SET_LINK ideal-int +pkg syscall (freebsd-386), const SYS___GETCWD ideal-int +pkg syscall (freebsd-386), const SYS___MAC_EXECVE ideal-int +pkg syscall (freebsd-386), const SYS___MAC_GET_FD ideal-int +pkg syscall (freebsd-386), const SYS___MAC_GET_FILE ideal-int +pkg syscall (freebsd-386), const SYS___MAC_GET_LINK ideal-int +pkg syscall (freebsd-386), const SYS___MAC_GET_PID ideal-int +pkg syscall (freebsd-386), const SYS___MAC_GET_PROC ideal-int +pkg syscall (freebsd-386), const SYS___MAC_SET_FD ideal-int +pkg syscall (freebsd-386), const SYS___MAC_SET_FILE ideal-int +pkg syscall (freebsd-386), const SYS___MAC_SET_LINK ideal-int +pkg syscall (freebsd-386), const SYS___MAC_SET_PROC ideal-int +pkg syscall (freebsd-386), const SYS___SETUGID ideal-int +pkg syscall (freebsd-386), const SYS___SYSCTL ideal-int +pkg syscall (freebsd-386), const SizeofBpfHdr ideal-int +pkg syscall (freebsd-386), const SizeofBpfInsn ideal-int +pkg syscall (freebsd-386), const SizeofBpfProgram ideal-int +pkg syscall (freebsd-386), const SizeofBpfStat ideal-int +pkg syscall (freebsd-386), const SizeofBpfVersion ideal-int +pkg syscall (freebsd-386), const SizeofBpfZbuf ideal-int +pkg syscall (freebsd-386), const SizeofBpfZbufHeader ideal-int +pkg syscall (freebsd-386), const SizeofCmsghdr ideal-int +pkg syscall (freebsd-386), const SizeofIPMreq ideal-int +pkg syscall (freebsd-386), const SizeofIPMreqn ideal-int +pkg syscall (freebsd-386), const SizeofIPv6Mreq ideal-int +pkg syscall (freebsd-386), const SizeofIfData ideal-int +pkg syscall (freebsd-386), const SizeofIfMsghdr ideal-int +pkg syscall (freebsd-386), const SizeofIfaMsghdr ideal-int +pkg syscall (freebsd-386), const SizeofIfmaMsghdr ideal-int +pkg syscall (freebsd-386), const SizeofInet6Pktinfo ideal-int +pkg syscall (freebsd-386), const SizeofLinger ideal-int +pkg syscall (freebsd-386), const SizeofMsghdr ideal-int +pkg syscall (freebsd-386), const SizeofRtMetrics ideal-int +pkg syscall (freebsd-386), const SizeofRtMsghdr ideal-int +pkg syscall (freebsd-386), const SizeofSockaddrAny ideal-int +pkg syscall (freebsd-386), const SizeofSockaddrDatalink ideal-int +pkg syscall (freebsd-386), const SizeofSockaddrInet4 ideal-int +pkg syscall (freebsd-386), const SizeofSockaddrInet6 ideal-int +pkg syscall (freebsd-386), const SizeofSockaddrUnix ideal-int +pkg syscall (freebsd-386), const TCP_CA_NAME_MAX ideal-int +pkg syscall (freebsd-386), const TCP_CONGESTION ideal-int +pkg syscall (freebsd-386), const TCP_INFO ideal-int +pkg syscall (freebsd-386), const TCP_MAXBURST ideal-int +pkg syscall (freebsd-386), const TCP_MAXHLEN ideal-int +pkg syscall (freebsd-386), const TCP_MAXOLEN ideal-int +pkg syscall (freebsd-386), const TCP_MAXSEG ideal-int +pkg syscall (freebsd-386), const TCP_MAXWIN ideal-int +pkg syscall (freebsd-386), const TCP_MAX_SACK ideal-int +pkg syscall (freebsd-386), const TCP_MAX_WINSHIFT ideal-int +pkg syscall (freebsd-386), const TCP_MD5SIG ideal-int +pkg syscall (freebsd-386), const TCP_MINMSS ideal-int +pkg syscall (freebsd-386), const TCP_MSS ideal-int +pkg syscall (freebsd-386), const TCP_NOOPT ideal-int +pkg syscall (freebsd-386), const TCP_NOPUSH ideal-int +pkg syscall (freebsd-386), const TIOCCBRK ideal-int +pkg syscall (freebsd-386), const TIOCCDTR ideal-int +pkg syscall (freebsd-386), const TIOCCONS ideal-int +pkg syscall (freebsd-386), const TIOCDRAIN ideal-int +pkg syscall (freebsd-386), const TIOCEXCL ideal-int +pkg syscall (freebsd-386), const TIOCEXT ideal-int +pkg syscall (freebsd-386), const TIOCFLUSH ideal-int +pkg syscall (freebsd-386), const TIOCGDRAINWAIT ideal-int +pkg syscall (freebsd-386), const TIOCGETA ideal-int +pkg syscall (freebsd-386), const TIOCGETD ideal-int +pkg syscall (freebsd-386), const TIOCGPGRP ideal-int +pkg syscall (freebsd-386), const TIOCGPTN ideal-int +pkg syscall (freebsd-386), const TIOCGSID ideal-int +pkg syscall (freebsd-386), const TIOCGWINSZ ideal-int +pkg syscall (freebsd-386), const TIOCMBIC ideal-int +pkg syscall (freebsd-386), const TIOCMBIS ideal-int +pkg syscall (freebsd-386), const TIOCMGDTRWAIT ideal-int +pkg syscall (freebsd-386), const TIOCMGET ideal-int +pkg syscall (freebsd-386), const TIOCMSDTRWAIT ideal-int +pkg syscall (freebsd-386), const TIOCMSET ideal-int +pkg syscall (freebsd-386), const TIOCM_CAR ideal-int +pkg syscall (freebsd-386), const TIOCM_CD ideal-int +pkg syscall (freebsd-386), const TIOCM_CTS ideal-int +pkg syscall (freebsd-386), const TIOCM_DCD ideal-int +pkg syscall (freebsd-386), const TIOCM_DSR ideal-int +pkg syscall (freebsd-386), const TIOCM_DTR ideal-int +pkg syscall (freebsd-386), const TIOCM_LE ideal-int +pkg syscall (freebsd-386), const TIOCM_RI ideal-int +pkg syscall (freebsd-386), const TIOCM_RNG ideal-int +pkg syscall (freebsd-386), const TIOCM_RTS ideal-int +pkg syscall (freebsd-386), const TIOCM_SR ideal-int +pkg syscall (freebsd-386), const TIOCM_ST ideal-int +pkg syscall (freebsd-386), const TIOCNOTTY ideal-int +pkg syscall (freebsd-386), const TIOCNXCL ideal-int +pkg syscall (freebsd-386), const TIOCOUTQ ideal-int +pkg syscall (freebsd-386), const TIOCPKT ideal-int +pkg syscall (freebsd-386), const TIOCPKT_DATA ideal-int +pkg syscall (freebsd-386), const TIOCPKT_DOSTOP ideal-int +pkg syscall (freebsd-386), const TIOCPKT_FLUSHREAD ideal-int +pkg syscall (freebsd-386), const TIOCPKT_FLUSHWRITE ideal-int +pkg syscall (freebsd-386), const TIOCPKT_IOCTL ideal-int +pkg syscall (freebsd-386), const TIOCPKT_NOSTOP ideal-int +pkg syscall (freebsd-386), const TIOCPKT_START ideal-int +pkg syscall (freebsd-386), const TIOCPKT_STOP ideal-int +pkg syscall (freebsd-386), const TIOCPTMASTER ideal-int +pkg syscall (freebsd-386), const TIOCSBRK ideal-int +pkg syscall (freebsd-386), const TIOCSCTTY ideal-int +pkg syscall (freebsd-386), const TIOCSDRAINWAIT ideal-int +pkg syscall (freebsd-386), const TIOCSDTR ideal-int +pkg syscall (freebsd-386), const TIOCSETA ideal-int +pkg syscall (freebsd-386), const TIOCSETAF ideal-int +pkg syscall (freebsd-386), const TIOCSETAW ideal-int +pkg syscall (freebsd-386), const TIOCSETD ideal-int +pkg syscall (freebsd-386), const TIOCSIG ideal-int +pkg syscall (freebsd-386), const TIOCSPGRP ideal-int +pkg syscall (freebsd-386), const TIOCSTART ideal-int +pkg syscall (freebsd-386), const TIOCSTAT ideal-int +pkg syscall (freebsd-386), const TIOCSTI ideal-int +pkg syscall (freebsd-386), const TIOCSTOP ideal-int +pkg syscall (freebsd-386), const TIOCSWINSZ ideal-int +pkg syscall (freebsd-386), const TIOCTIMESTAMP ideal-int +pkg syscall (freebsd-386), const TIOCUCNTL ideal-int +pkg syscall (freebsd-386), const WCONTINUED ideal-int +pkg syscall (freebsd-386), const WCOREFLAG ideal-int +pkg syscall (freebsd-386), const WLINUXCLONE ideal-int +pkg syscall (freebsd-386), const WNOHANG ideal-int +pkg syscall (freebsd-386), const WNOWAIT ideal-int +pkg syscall (freebsd-386), const WSTOPPED ideal-int +pkg syscall (freebsd-386), const WUNTRACED ideal-int +pkg syscall (freebsd-386), func Accept(int) (int, Sockaddr, error) +pkg syscall (freebsd-386), func Access(string, uint32) error +pkg syscall (freebsd-386), func Adjtime(*Timeval, *Timeval) error +pkg syscall (freebsd-386), func Bind(int, Sockaddr) error +pkg syscall (freebsd-386), func BpfBuflen(int) (int, error) +pkg syscall (freebsd-386), func BpfDatalink(int) (int, error) +pkg syscall (freebsd-386), func BpfHeadercmpl(int) (int, error) +pkg syscall (freebsd-386), func BpfInterface(int, string) (string, error) +pkg syscall (freebsd-386), func BpfJump(int, int, int, int) *BpfInsn +pkg syscall (freebsd-386), func BpfStats(int) (*BpfStat, error) +pkg syscall (freebsd-386), func BpfStmt(int, int) *BpfInsn +pkg syscall (freebsd-386), func BpfTimeout(int) (*Timeval, error) +pkg syscall (freebsd-386), func CheckBpfVersion(int) error +pkg syscall (freebsd-386), func Chflags(string, int) error +pkg syscall (freebsd-386), func Chroot(string) error +pkg syscall (freebsd-386), func Close(int) error +pkg syscall (freebsd-386), func CloseOnExec(int) +pkg syscall (freebsd-386), func CmsgLen(int) int +pkg syscall (freebsd-386), func CmsgSpace(int) int +pkg syscall (freebsd-386), func Connect(int, Sockaddr) error +pkg syscall (freebsd-386), func Dup(int) (int, error) +pkg syscall (freebsd-386), func Dup2(int, int) error +pkg syscall (freebsd-386), func Fchdir(int) error +pkg syscall (freebsd-386), func Fchflags(string, int) error +pkg syscall (freebsd-386), func Fchmod(int, uint32) error +pkg syscall (freebsd-386), func Fchown(int, int, int) error +pkg syscall (freebsd-386), func Flock(int, int) error +pkg syscall (freebsd-386), func FlushBpf(int) error +pkg syscall (freebsd-386), func ForkExec(string, []string, *ProcAttr) (int, error) +pkg syscall (freebsd-386), func Fpathconf(int, int) (int, error) +pkg syscall (freebsd-386), func Fstat(int, *Stat_t) error +pkg syscall (freebsd-386), func Fstatfs(int, *Statfs_t) error +pkg syscall (freebsd-386), func Fsync(int) error +pkg syscall (freebsd-386), func Ftruncate(int, int64) error +pkg syscall (freebsd-386), func Futimes(int, []Timeval) error +pkg syscall (freebsd-386), func Getdirentries(int, []uint8, *uintptr) (int, error) +pkg syscall (freebsd-386), func Getdtablesize() int +pkg syscall (freebsd-386), func Getfsstat([]Statfs_t, int) (int, error) +pkg syscall (freebsd-386), func Getpeername(int) (Sockaddr, error) +pkg syscall (freebsd-386), func Getpgid(int) (int, error) +pkg syscall (freebsd-386), func Getpgrp() int +pkg syscall (freebsd-386), func Getpriority(int, int) (int, error) +pkg syscall (freebsd-386), func Getrlimit(int, *Rlimit) error +pkg syscall (freebsd-386), func Getrusage(int, *Rusage) error +pkg syscall (freebsd-386), func Getsid(int) (int, error) +pkg syscall (freebsd-386), func Getsockname(int) (Sockaddr, error) +pkg syscall (freebsd-386), func GetsockoptByte(int, int, int) (uint8, error) +pkg syscall (freebsd-386), func GetsockoptIPMreq(int, int, int) (*IPMreq, error) +pkg syscall (freebsd-386), func GetsockoptIPMreqn(int, int, int) (*IPMreqn, error) +pkg syscall (freebsd-386), func GetsockoptIPv6Mreq(int, int, int) (*IPv6Mreq, error) +pkg syscall (freebsd-386), func GetsockoptInet4Addr(int, int, int) ([4]uint8, error) +pkg syscall (freebsd-386), func GetsockoptInt(int, int, int) (int, error) +pkg syscall (freebsd-386), func Issetugid() bool +pkg syscall (freebsd-386), func Kevent(int, []Kevent_t, []Kevent_t, *Timespec) (int, error) +pkg syscall (freebsd-386), func Kill(int, Signal) error +pkg syscall (freebsd-386), func Kqueue() (int, error) +pkg syscall (freebsd-386), func Listen(int, int) error +pkg syscall (freebsd-386), func Lstat(string, *Stat_t) error +pkg syscall (freebsd-386), func Mkfifo(string, uint32) error +pkg syscall (freebsd-386), func Mknod(string, uint32, int) error +pkg syscall (freebsd-386), func Mmap(int, int64, int, int, int) ([]uint8, error) +pkg syscall (freebsd-386), func Munmap([]uint8) error +pkg syscall (freebsd-386), func Nanosleep(*Timespec, *Timespec) error +pkg syscall (freebsd-386), func NsecToTimespec(int64) Timespec +pkg syscall (freebsd-386), func Open(string, int, uint32) (int, error) +pkg syscall (freebsd-386), func ParseDirent([]uint8, int, []string) (int, int, []string) +pkg syscall (freebsd-386), func ParseRoutingMessage([]uint8) ([]RoutingMessage, error) +pkg syscall (freebsd-386), func ParseRoutingSockaddr(RoutingMessage) ([]Sockaddr, error) +pkg syscall (freebsd-386), func ParseSocketControlMessage([]uint8) ([]SocketControlMessage, error) +pkg syscall (freebsd-386), func ParseUnixRights(*SocketControlMessage) ([]int, error) +pkg syscall (freebsd-386), func Pathconf(string, int) (int, error) +pkg syscall (freebsd-386), func Pipe([]int) error +pkg syscall (freebsd-386), func Pread(int, []uint8, int64) (int, error) +pkg syscall (freebsd-386), func Pwrite(int, []uint8, int64) (int, error) +pkg syscall (freebsd-386), func RawSyscall(uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno) +pkg syscall (freebsd-386), func RawSyscall6(uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno) +pkg syscall (freebsd-386), func Read(int, []uint8) (int, error) +pkg syscall (freebsd-386), func ReadDirent(int, []uint8) (int, error) +pkg syscall (freebsd-386), func Recvfrom(int, []uint8, int) (int, Sockaddr, error) +pkg syscall (freebsd-386), func Recvmsg(int, []uint8, []uint8, int) (int, int, int, Sockaddr, error) +pkg syscall (freebsd-386), func Revoke(string) error +pkg syscall (freebsd-386), func RouteRIB(int, int) ([]uint8, error) +pkg syscall (freebsd-386), func Seek(int, int64, int) (int64, error) +pkg syscall (freebsd-386), func Select(int, *FdSet, *FdSet, *FdSet, *Timeval) error +pkg syscall (freebsd-386), func Sendfile(int, int, *int64, int) (int, error) +pkg syscall (freebsd-386), func Sendmsg(int, []uint8, []uint8, Sockaddr, int) error +pkg syscall (freebsd-386), func Sendto(int, []uint8, int, Sockaddr) error +pkg syscall (freebsd-386), func SetBpf(int, []BpfInsn) error +pkg syscall (freebsd-386), func SetBpfBuflen(int, int) (int, error) +pkg syscall (freebsd-386), func SetBpfDatalink(int, int) (int, error) +pkg syscall (freebsd-386), func SetBpfHeadercmpl(int, int) error +pkg syscall (freebsd-386), func SetBpfImmediate(int, int) error +pkg syscall (freebsd-386), func SetBpfInterface(int, string) error +pkg syscall (freebsd-386), func SetBpfPromisc(int, int) error +pkg syscall (freebsd-386), func SetBpfTimeout(int, *Timeval) error +pkg syscall (freebsd-386), func SetKevent(*Kevent_t, int, int, int) +pkg syscall (freebsd-386), func SetNonblock(int, bool) error +pkg syscall (freebsd-386), func Setegid(int) error +pkg syscall (freebsd-386), func Seteuid(int) error +pkg syscall (freebsd-386), func Setgid(int) error +pkg syscall (freebsd-386), func Setgroups([]int) error +pkg syscall (freebsd-386), func Setlogin(string) error +pkg syscall (freebsd-386), func Setpgid(int, int) error +pkg syscall (freebsd-386), func Setpriority(int, int, int) error +pkg syscall (freebsd-386), func Setregid(int, int) error +pkg syscall (freebsd-386), func Setreuid(int, int) error +pkg syscall (freebsd-386), func Setrlimit(int, *Rlimit) error +pkg syscall (freebsd-386), func Setsid() (int, error) +pkg syscall (freebsd-386), func SetsockoptByte(int, int, int, uint8) error +pkg syscall (freebsd-386), func SetsockoptIPMreq(int, int, int, *IPMreq) error +pkg syscall (freebsd-386), func SetsockoptIPMreqn(int, int, int, *IPMreqn) error +pkg syscall (freebsd-386), func SetsockoptIPv6Mreq(int, int, int, *IPv6Mreq) error +pkg syscall (freebsd-386), func SetsockoptInet4Addr(int, int, int, [4]uint8) error +pkg syscall (freebsd-386), func SetsockoptInt(int, int, int, int) error +pkg syscall (freebsd-386), func SetsockoptLinger(int, int, int, *Linger) error +pkg syscall (freebsd-386), func SetsockoptString(int, int, int, string) error +pkg syscall (freebsd-386), func SetsockoptTimeval(int, int, int, *Timeval) error +pkg syscall (freebsd-386), func Settimeofday(*Timeval) error +pkg syscall (freebsd-386), func Setuid(int) error +pkg syscall (freebsd-386), func Shutdown(int, int) error +pkg syscall (freebsd-386), func Socket(int, int, int) (int, error) +pkg syscall (freebsd-386), func Socketpair(int, int, int) ([2]int, error) +pkg syscall (freebsd-386), func Stat(string, *Stat_t) error +pkg syscall (freebsd-386), func Statfs(string, *Statfs_t) error +pkg syscall (freebsd-386), func StringSlicePtr([]string) []*uint8 +pkg syscall (freebsd-386), func Sync() error +pkg syscall (freebsd-386), func Syscall(uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno) +pkg syscall (freebsd-386), func Syscall6(uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno) +pkg syscall (freebsd-386), func Syscall9(uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno) +pkg syscall (freebsd-386), func Sysctl(string) (string, error) +pkg syscall (freebsd-386), func SysctlUint32(string) (uint32, error) +pkg syscall (freebsd-386), func TimespecToNsec(Timespec) int64 +pkg syscall (freebsd-386), func TimevalToNsec(Timeval) int64 +pkg syscall (freebsd-386), func Truncate(string, int64) error +pkg syscall (freebsd-386), func Umask(int) int +pkg syscall (freebsd-386), func Undelete(string) error +pkg syscall (freebsd-386), func UnixRights(...int) []uint8 +pkg syscall (freebsd-386), func Unmount(string, int) error +pkg syscall (freebsd-386), func Wait4(int, *WaitStatus, int, *Rusage) (int, error) +pkg syscall (freebsd-386), func Write(int, []uint8) (int, error) +pkg syscall (freebsd-386), method (*Cmsghdr) SetLen(int) +pkg syscall (freebsd-386), method (*Iovec) SetLen(int) +pkg syscall (freebsd-386), method (*Msghdr) SetControllen(int) +pkg syscall (freebsd-386), type BpfHdr struct +pkg syscall (freebsd-386), type BpfHdr struct, Caplen uint32 +pkg syscall (freebsd-386), type BpfHdr struct, Datalen uint32 +pkg syscall (freebsd-386), type BpfHdr struct, Hdrlen uint16 +pkg syscall (freebsd-386), type BpfHdr struct, Pad_cgo_0 [2]uint8 +pkg syscall (freebsd-386), type BpfHdr struct, Tstamp Timeval +pkg syscall (freebsd-386), type BpfInsn struct +pkg syscall (freebsd-386), type BpfInsn struct, Code uint16 +pkg syscall (freebsd-386), type BpfInsn struct, Jf uint8 +pkg syscall (freebsd-386), type BpfInsn struct, Jt uint8 +pkg syscall (freebsd-386), type BpfInsn struct, K uint32 +pkg syscall (freebsd-386), type BpfProgram struct +pkg syscall (freebsd-386), type BpfProgram struct, Insns *BpfInsn +pkg syscall (freebsd-386), type BpfProgram struct, Len uint32 +pkg syscall (freebsd-386), type BpfStat struct +pkg syscall (freebsd-386), type BpfStat struct, Drop uint32 +pkg syscall (freebsd-386), type BpfStat struct, Recv uint32 +pkg syscall (freebsd-386), type BpfVersion struct +pkg syscall (freebsd-386), type BpfVersion struct, Major uint16 +pkg syscall (freebsd-386), type BpfVersion struct, Minor uint16 +pkg syscall (freebsd-386), type BpfZbuf struct +pkg syscall (freebsd-386), type BpfZbuf struct, Bufa *uint8 +pkg syscall (freebsd-386), type BpfZbuf struct, Bufb *uint8 +pkg syscall (freebsd-386), type BpfZbuf struct, Buflen uint32 +pkg syscall (freebsd-386), type BpfZbufHeader struct +pkg syscall (freebsd-386), type BpfZbufHeader struct, Kernel_gen uint32 +pkg syscall (freebsd-386), type BpfZbufHeader struct, Kernel_len uint32 +pkg syscall (freebsd-386), type BpfZbufHeader struct, User_gen uint32 +pkg syscall (freebsd-386), type BpfZbufHeader struct, X_bzh_pad [5]uint32 +pkg syscall (freebsd-386), type Cmsghdr struct +pkg syscall (freebsd-386), type Cmsghdr struct, Len uint32 +pkg syscall (freebsd-386), type Cmsghdr struct, Level int32 +pkg syscall (freebsd-386), type Cmsghdr struct, Type int32 +pkg syscall (freebsd-386), type Credential struct +pkg syscall (freebsd-386), type Credential struct, Gid uint32 +pkg syscall (freebsd-386), type Credential struct, Groups []uint32 +pkg syscall (freebsd-386), type Credential struct, Uid uint32 +pkg syscall (freebsd-386), type Dirent struct +pkg syscall (freebsd-386), type Dirent struct, Fileno uint32 +pkg syscall (freebsd-386), type Dirent struct, Name [256]int8 +pkg syscall (freebsd-386), type Dirent struct, Namlen uint8 +pkg syscall (freebsd-386), type Dirent struct, Reclen uint16 +pkg syscall (freebsd-386), type Dirent struct, Type uint8 +pkg syscall (freebsd-386), type FdSet struct +pkg syscall (freebsd-386), type FdSet struct, X__fds_bits [32]uint32 +pkg syscall (freebsd-386), type Flock_t struct +pkg syscall (freebsd-386), type Flock_t struct, Len int64 +pkg syscall (freebsd-386), type Flock_t struct, Pid int32 +pkg syscall (freebsd-386), type Flock_t struct, Start int64 +pkg syscall (freebsd-386), type Flock_t struct, Sysid int32 +pkg syscall (freebsd-386), type Flock_t struct, Type int16 +pkg syscall (freebsd-386), type Flock_t struct, Whence int16 +pkg syscall (freebsd-386), type Fsid struct +pkg syscall (freebsd-386), type Fsid struct, Val [2]int32 +pkg syscall (freebsd-386), type IPMreqn struct +pkg syscall (freebsd-386), type IPMreqn struct, Address [4]uint8 +pkg syscall (freebsd-386), type IPMreqn struct, Ifindex int32 +pkg syscall (freebsd-386), type IPMreqn struct, Multiaddr [4]uint8 +pkg syscall (freebsd-386), type IfData struct +pkg syscall (freebsd-386), type IfData struct, Addrlen uint8 +pkg syscall (freebsd-386), type IfData struct, Baudrate uint32 +pkg syscall (freebsd-386), type IfData struct, Collisions uint32 +pkg syscall (freebsd-386), type IfData struct, Datalen uint8 +pkg syscall (freebsd-386), type IfData struct, Epoch int32 +pkg syscall (freebsd-386), type IfData struct, Hdrlen uint8 +pkg syscall (freebsd-386), type IfData struct, Hwassist uint32 +pkg syscall (freebsd-386), type IfData struct, Ibytes uint32 +pkg syscall (freebsd-386), type IfData struct, Ierrors uint32 +pkg syscall (freebsd-386), type IfData struct, Imcasts uint32 +pkg syscall (freebsd-386), type IfData struct, Ipackets uint32 +pkg syscall (freebsd-386), type IfData struct, Iqdrops uint32 +pkg syscall (freebsd-386), type IfData struct, Lastchange Timeval +pkg syscall (freebsd-386), type IfData struct, Link_state uint8 +pkg syscall (freebsd-386), type IfData struct, Metric uint32 +pkg syscall (freebsd-386), type IfData struct, Mtu uint32 +pkg syscall (freebsd-386), type IfData struct, Noproto uint32 +pkg syscall (freebsd-386), type IfData struct, Obytes uint32 +pkg syscall (freebsd-386), type IfData struct, Oerrors uint32 +pkg syscall (freebsd-386), type IfData struct, Omcasts uint32 +pkg syscall (freebsd-386), type IfData struct, Opackets uint32 +pkg syscall (freebsd-386), type IfData struct, Physical uint8 +pkg syscall (freebsd-386), type IfData struct, Spare_char1 uint8 +pkg syscall (freebsd-386), type IfData struct, Spare_char2 uint8 +pkg syscall (freebsd-386), type IfData struct, Type uint8 +pkg syscall (freebsd-386), type IfMsghdr struct +pkg syscall (freebsd-386), type IfMsghdr struct, Addrs int32 +pkg syscall (freebsd-386), type IfMsghdr struct, Data IfData +pkg syscall (freebsd-386), type IfMsghdr struct, Flags int32 +pkg syscall (freebsd-386), type IfMsghdr struct, Index uint16 +pkg syscall (freebsd-386), type IfMsghdr struct, Msglen uint16 +pkg syscall (freebsd-386), type IfMsghdr struct, Pad_cgo_0 [2]uint8 +pkg syscall (freebsd-386), type IfMsghdr struct, Type uint8 +pkg syscall (freebsd-386), type IfMsghdr struct, Version uint8 +pkg syscall (freebsd-386), type IfaMsghdr struct +pkg syscall (freebsd-386), type IfaMsghdr struct, Addrs int32 +pkg syscall (freebsd-386), type IfaMsghdr struct, Flags int32 +pkg syscall (freebsd-386), type IfaMsghdr struct, Index uint16 +pkg syscall (freebsd-386), type IfaMsghdr struct, Metric int32 +pkg syscall (freebsd-386), type IfaMsghdr struct, Msglen uint16 +pkg syscall (freebsd-386), type IfaMsghdr struct, Pad_cgo_0 [2]uint8 +pkg syscall (freebsd-386), type IfaMsghdr struct, Type uint8 +pkg syscall (freebsd-386), type IfaMsghdr struct, Version uint8 +pkg syscall (freebsd-386), type IfmaMsghdr struct +pkg syscall (freebsd-386), type IfmaMsghdr struct, Addrs int32 +pkg syscall (freebsd-386), type IfmaMsghdr struct, Flags int32 +pkg syscall (freebsd-386), type IfmaMsghdr struct, Index uint16 +pkg syscall (freebsd-386), type IfmaMsghdr struct, Msglen uint16 +pkg syscall (freebsd-386), type IfmaMsghdr struct, Pad_cgo_0 [2]uint8 +pkg syscall (freebsd-386), type IfmaMsghdr struct, Type uint8 +pkg syscall (freebsd-386), type IfmaMsghdr struct, Version uint8 +pkg syscall (freebsd-386), type Inet6Pktinfo struct +pkg syscall (freebsd-386), type Inet6Pktinfo struct, Addr [16]uint8 +pkg syscall (freebsd-386), type Inet6Pktinfo struct, Ifindex uint32 +pkg syscall (freebsd-386), type InterfaceAddrMessage struct +pkg syscall (freebsd-386), type InterfaceAddrMessage struct, Data []uint8 +pkg syscall (freebsd-386), type InterfaceAddrMessage struct, Header IfaMsghdr +pkg syscall (freebsd-386), type InterfaceMessage struct +pkg syscall (freebsd-386), type InterfaceMessage struct, Data []uint8 +pkg syscall (freebsd-386), type InterfaceMessage struct, Header IfMsghdr +pkg syscall (freebsd-386), type InterfaceMulticastAddrMessage struct +pkg syscall (freebsd-386), type InterfaceMulticastAddrMessage struct, Data []uint8 +pkg syscall (freebsd-386), type InterfaceMulticastAddrMessage struct, Header IfmaMsghdr +pkg syscall (freebsd-386), type Iovec struct +pkg syscall (freebsd-386), type Iovec struct, Base *uint8 +pkg syscall (freebsd-386), type Iovec struct, Len uint32 +pkg syscall (freebsd-386), type Kevent_t struct +pkg syscall (freebsd-386), type Kevent_t struct, Data int32 +pkg syscall (freebsd-386), type Kevent_t struct, Fflags uint32 +pkg syscall (freebsd-386), type Kevent_t struct, Filter int16 +pkg syscall (freebsd-386), type Kevent_t struct, Flags uint16 +pkg syscall (freebsd-386), type Kevent_t struct, Ident uint32 +pkg syscall (freebsd-386), type Kevent_t struct, Udata *uint8 +pkg syscall (freebsd-386), type Msghdr struct +pkg syscall (freebsd-386), type Msghdr struct, Control *uint8 +pkg syscall (freebsd-386), type Msghdr struct, Controllen uint32 +pkg syscall (freebsd-386), type Msghdr struct, Flags int32 +pkg syscall (freebsd-386), type Msghdr struct, Iov *Iovec +pkg syscall (freebsd-386), type Msghdr struct, Iovlen int32 +pkg syscall (freebsd-386), type Msghdr struct, Name *uint8 +pkg syscall (freebsd-386), type Msghdr struct, Namelen uint32 +pkg syscall (freebsd-386), type RawSockaddr struct, Data [14]int8 +pkg syscall (freebsd-386), type RawSockaddr struct, Family uint8 +pkg syscall (freebsd-386), type RawSockaddr struct, Len uint8 +pkg syscall (freebsd-386), type RawSockaddrAny struct, Pad [92]int8 +pkg syscall (freebsd-386), type RawSockaddrDatalink struct +pkg syscall (freebsd-386), type RawSockaddrDatalink struct, Alen uint8 +pkg syscall (freebsd-386), type RawSockaddrDatalink struct, Data [46]int8 +pkg syscall (freebsd-386), type RawSockaddrDatalink struct, Family uint8 +pkg syscall (freebsd-386), type RawSockaddrDatalink struct, Index uint16 +pkg syscall (freebsd-386), type RawSockaddrDatalink struct, Len uint8 +pkg syscall (freebsd-386), type RawSockaddrDatalink struct, Nlen uint8 +pkg syscall (freebsd-386), type RawSockaddrDatalink struct, Slen uint8 +pkg syscall (freebsd-386), type RawSockaddrDatalink struct, Type uint8 +pkg syscall (freebsd-386), type RawSockaddrInet4 struct, Family uint8 +pkg syscall (freebsd-386), type RawSockaddrInet4 struct, Len uint8 +pkg syscall (freebsd-386), type RawSockaddrInet4 struct, Zero [8]int8 +pkg syscall (freebsd-386), type RawSockaddrInet6 struct +pkg syscall (freebsd-386), type RawSockaddrInet6 struct, Addr [16]uint8 +pkg syscall (freebsd-386), type RawSockaddrInet6 struct, Family uint8 +pkg syscall (freebsd-386), type RawSockaddrInet6 struct, Flowinfo uint32 +pkg syscall (freebsd-386), type RawSockaddrInet6 struct, Len uint8 +pkg syscall (freebsd-386), type RawSockaddrInet6 struct, Port uint16 +pkg syscall (freebsd-386), type RawSockaddrInet6 struct, Scope_id uint32 +pkg syscall (freebsd-386), type RawSockaddrUnix struct +pkg syscall (freebsd-386), type RawSockaddrUnix struct, Family uint8 +pkg syscall (freebsd-386), type RawSockaddrUnix struct, Len uint8 +pkg syscall (freebsd-386), type RawSockaddrUnix struct, Path [104]int8 +pkg syscall (freebsd-386), type Rlimit struct +pkg syscall (freebsd-386), type Rlimit struct, Cur int64 +pkg syscall (freebsd-386), type Rlimit struct, Max int64 +pkg syscall (freebsd-386), type RouteMessage struct +pkg syscall (freebsd-386), type RouteMessage struct, Data []uint8 +pkg syscall (freebsd-386), type RouteMessage struct, Header RtMsghdr +pkg syscall (freebsd-386), type RoutingMessage interface, unexported methods +pkg syscall (freebsd-386), type RtMetrics struct +pkg syscall (freebsd-386), type RtMetrics struct, Expire uint32 +pkg syscall (freebsd-386), type RtMetrics struct, Filler [3]uint32 +pkg syscall (freebsd-386), type RtMetrics struct, Hopcount uint32 +pkg syscall (freebsd-386), type RtMetrics struct, Locks uint32 +pkg syscall (freebsd-386), type RtMetrics struct, Mtu uint32 +pkg syscall (freebsd-386), type RtMetrics struct, Pksent uint32 +pkg syscall (freebsd-386), type RtMetrics struct, Recvpipe uint32 +pkg syscall (freebsd-386), type RtMetrics struct, Rtt uint32 +pkg syscall (freebsd-386), type RtMetrics struct, Rttvar uint32 +pkg syscall (freebsd-386), type RtMetrics struct, Sendpipe uint32 +pkg syscall (freebsd-386), type RtMetrics struct, Ssthresh uint32 +pkg syscall (freebsd-386), type RtMetrics struct, Weight uint32 +pkg syscall (freebsd-386), type RtMsghdr struct +pkg syscall (freebsd-386), type RtMsghdr struct, Addrs int32 +pkg syscall (freebsd-386), type RtMsghdr struct, Errno int32 +pkg syscall (freebsd-386), type RtMsghdr struct, Flags int32 +pkg syscall (freebsd-386), type RtMsghdr struct, Fmask int32 +pkg syscall (freebsd-386), type RtMsghdr struct, Index uint16 +pkg syscall (freebsd-386), type RtMsghdr struct, Inits uint32 +pkg syscall (freebsd-386), type RtMsghdr struct, Msglen uint16 +pkg syscall (freebsd-386), type RtMsghdr struct, Pad_cgo_0 [2]uint8 +pkg syscall (freebsd-386), type RtMsghdr struct, Pid int32 +pkg syscall (freebsd-386), type RtMsghdr struct, Rmx RtMetrics +pkg syscall (freebsd-386), type RtMsghdr struct, Seq int32 +pkg syscall (freebsd-386), type RtMsghdr struct, Type uint8 +pkg syscall (freebsd-386), type RtMsghdr struct, Version uint8 +pkg syscall (freebsd-386), type Rusage struct, Idrss int32 +pkg syscall (freebsd-386), type Rusage struct, Inblock int32 +pkg syscall (freebsd-386), type Rusage struct, Isrss int32 +pkg syscall (freebsd-386), type Rusage struct, Ixrss int32 +pkg syscall (freebsd-386), type Rusage struct, Majflt int32 +pkg syscall (freebsd-386), type Rusage struct, Maxrss int32 +pkg syscall (freebsd-386), type Rusage struct, Minflt int32 +pkg syscall (freebsd-386), type Rusage struct, Msgrcv int32 +pkg syscall (freebsd-386), type Rusage struct, Msgsnd int32 +pkg syscall (freebsd-386), type Rusage struct, Nivcsw int32 +pkg syscall (freebsd-386), type Rusage struct, Nsignals int32 +pkg syscall (freebsd-386), type Rusage struct, Nswap int32 +pkg syscall (freebsd-386), type Rusage struct, Nvcsw int32 +pkg syscall (freebsd-386), type Rusage struct, Oublock int32 +pkg syscall (freebsd-386), type Rusage struct, Stime Timeval +pkg syscall (freebsd-386), type Rusage struct, Utime Timeval +pkg syscall (freebsd-386), type SockaddrDatalink struct +pkg syscall (freebsd-386), type SockaddrDatalink struct, Alen uint8 +pkg syscall (freebsd-386), type SockaddrDatalink struct, Data [46]int8 +pkg syscall (freebsd-386), type SockaddrDatalink struct, Family uint8 +pkg syscall (freebsd-386), type SockaddrDatalink struct, Index uint16 +pkg syscall (freebsd-386), type SockaddrDatalink struct, Len uint8 +pkg syscall (freebsd-386), type SockaddrDatalink struct, Nlen uint8 +pkg syscall (freebsd-386), type SockaddrDatalink struct, Slen uint8 +pkg syscall (freebsd-386), type SockaddrDatalink struct, Type uint8 +pkg syscall (freebsd-386), type SocketControlMessage struct +pkg syscall (freebsd-386), type SocketControlMessage struct, Data []uint8 +pkg syscall (freebsd-386), type SocketControlMessage struct, Header Cmsghdr +pkg syscall (freebsd-386), type Stat_t struct +pkg syscall (freebsd-386), type Stat_t struct, Atimespec Timespec +pkg syscall (freebsd-386), type Stat_t struct, Birthtimespec Timespec +pkg syscall (freebsd-386), type Stat_t struct, Blksize uint32 +pkg syscall (freebsd-386), type Stat_t struct, Blocks int64 +pkg syscall (freebsd-386), type Stat_t struct, Ctimespec Timespec +pkg syscall (freebsd-386), type Stat_t struct, Dev uint32 +pkg syscall (freebsd-386), type Stat_t struct, Flags uint32 +pkg syscall (freebsd-386), type Stat_t struct, Gen uint32 +pkg syscall (freebsd-386), type Stat_t struct, Gid uint32 +pkg syscall (freebsd-386), type Stat_t struct, Ino uint32 +pkg syscall (freebsd-386), type Stat_t struct, Lspare int32 +pkg syscall (freebsd-386), type Stat_t struct, Mode uint16 +pkg syscall (freebsd-386), type Stat_t struct, Mtimespec Timespec +pkg syscall (freebsd-386), type Stat_t struct, Nlink uint16 +pkg syscall (freebsd-386), type Stat_t struct, Pad_cgo_0 [8]uint8 +pkg syscall (freebsd-386), type Stat_t struct, Rdev uint32 +pkg syscall (freebsd-386), type Stat_t struct, Size int64 +pkg syscall (freebsd-386), type Stat_t struct, Uid uint32 +pkg syscall (freebsd-386), type Statfs_t struct +pkg syscall (freebsd-386), type Statfs_t struct, Asyncreads uint64 +pkg syscall (freebsd-386), type Statfs_t struct, Asyncwrites uint64 +pkg syscall (freebsd-386), type Statfs_t struct, Bavail int64 +pkg syscall (freebsd-386), type Statfs_t struct, Bfree uint64 +pkg syscall (freebsd-386), type Statfs_t struct, Blocks uint64 +pkg syscall (freebsd-386), type Statfs_t struct, Bsize uint64 +pkg syscall (freebsd-386), type Statfs_t struct, Charspare [80]int8 +pkg syscall (freebsd-386), type Statfs_t struct, Ffree int64 +pkg syscall (freebsd-386), type Statfs_t struct, Files uint64 +pkg syscall (freebsd-386), type Statfs_t struct, Flags uint64 +pkg syscall (freebsd-386), type Statfs_t struct, Fsid Fsid +pkg syscall (freebsd-386), type Statfs_t struct, Fstypename [16]int8 +pkg syscall (freebsd-386), type Statfs_t struct, Iosize uint64 +pkg syscall (freebsd-386), type Statfs_t struct, Mntfromname [88]int8 +pkg syscall (freebsd-386), type Statfs_t struct, Mntonname [88]int8 +pkg syscall (freebsd-386), type Statfs_t struct, Namemax uint32 +pkg syscall (freebsd-386), type Statfs_t struct, Owner uint32 +pkg syscall (freebsd-386), type Statfs_t struct, Spare [10]uint64 +pkg syscall (freebsd-386), type Statfs_t struct, Syncreads uint64 +pkg syscall (freebsd-386), type Statfs_t struct, Syncwrites uint64 +pkg syscall (freebsd-386), type Statfs_t struct, Type uint32 +pkg syscall (freebsd-386), type Statfs_t struct, Version uint32 +pkg syscall (freebsd-386), type SysProcAttr struct, Chroot string +pkg syscall (freebsd-386), type SysProcAttr struct, Credential *Credential +pkg syscall (freebsd-386), type SysProcAttr struct, Noctty bool +pkg syscall (freebsd-386), type SysProcAttr struct, Ptrace bool +pkg syscall (freebsd-386), type SysProcAttr struct, Setctty bool +pkg syscall (freebsd-386), type SysProcAttr struct, Setpgid bool +pkg syscall (freebsd-386), type SysProcAttr struct, Setsid bool +pkg syscall (freebsd-386), type Timespec struct, Nsec int32 +pkg syscall (freebsd-386), type Timespec struct, Sec int32 +pkg syscall (freebsd-386), type Timeval struct, Sec int32 +pkg syscall (freebsd-386), type Timeval struct, Usec int32 +pkg syscall (freebsd-386), type WaitStatus uint32 +pkg syscall (freebsd-386), var Stderr int +pkg syscall (freebsd-386), var Stdin int +pkg syscall (freebsd-386), var Stdout int +pkg syscall (freebsd-amd64), const AF_APPLETALK ideal-int +pkg syscall (freebsd-amd64), const AF_ARP ideal-int +pkg syscall (freebsd-amd64), const AF_ATM ideal-int +pkg syscall (freebsd-amd64), const AF_BLUETOOTH ideal-int +pkg syscall (freebsd-amd64), const AF_CCITT ideal-int +pkg syscall (freebsd-amd64), const AF_CHAOS ideal-int +pkg syscall (freebsd-amd64), const AF_CNT ideal-int +pkg syscall (freebsd-amd64), const AF_COIP ideal-int +pkg syscall (freebsd-amd64), const AF_DATAKIT ideal-int +pkg syscall (freebsd-amd64), const AF_DECnet ideal-int +pkg syscall (freebsd-amd64), const AF_DLI ideal-int +pkg syscall (freebsd-amd64), const AF_E164 ideal-int +pkg syscall (freebsd-amd64), const AF_ECMA ideal-int +pkg syscall (freebsd-amd64), const AF_HYLINK ideal-int +pkg syscall (freebsd-amd64), const AF_IEEE80211 ideal-int +pkg syscall (freebsd-amd64), const AF_IMPLINK ideal-int +pkg syscall (freebsd-amd64), const AF_IPX ideal-int +pkg syscall (freebsd-amd64), const AF_ISDN ideal-int +pkg syscall (freebsd-amd64), const AF_ISO ideal-int +pkg syscall (freebsd-amd64), const AF_LAT ideal-int +pkg syscall (freebsd-amd64), const AF_LINK ideal-int +pkg syscall (freebsd-amd64), const AF_LOCAL ideal-int +pkg syscall (freebsd-amd64), const AF_MAX ideal-int +pkg syscall (freebsd-amd64), const AF_NATM ideal-int +pkg syscall (freebsd-amd64), const AF_NETBIOS ideal-int +pkg syscall (freebsd-amd64), const AF_NETGRAPH ideal-int +pkg syscall (freebsd-amd64), const AF_OSI ideal-int +pkg syscall (freebsd-amd64), const AF_PUP ideal-int +pkg syscall (freebsd-amd64), const AF_ROUTE ideal-int +pkg syscall (freebsd-amd64), const AF_SCLUSTER ideal-int +pkg syscall (freebsd-amd64), const AF_SIP ideal-int +pkg syscall (freebsd-amd64), const AF_SLOW ideal-int +pkg syscall (freebsd-amd64), const AF_SNA ideal-int +pkg syscall (freebsd-amd64), const AF_VENDOR00 ideal-int +pkg syscall (freebsd-amd64), const AF_VENDOR01 ideal-int +pkg syscall (freebsd-amd64), const AF_VENDOR02 ideal-int +pkg syscall (freebsd-amd64), const AF_VENDOR03 ideal-int +pkg syscall (freebsd-amd64), const AF_VENDOR04 ideal-int +pkg syscall (freebsd-amd64), const AF_VENDOR05 ideal-int +pkg syscall (freebsd-amd64), const AF_VENDOR06 ideal-int +pkg syscall (freebsd-amd64), const AF_VENDOR07 ideal-int +pkg syscall (freebsd-amd64), const AF_VENDOR08 ideal-int +pkg syscall (freebsd-amd64), const AF_VENDOR09 ideal-int +pkg syscall (freebsd-amd64), const AF_VENDOR10 ideal-int +pkg syscall (freebsd-amd64), const AF_VENDOR11 ideal-int +pkg syscall (freebsd-amd64), const AF_VENDOR12 ideal-int +pkg syscall (freebsd-amd64), const AF_VENDOR13 ideal-int +pkg syscall (freebsd-amd64), const AF_VENDOR14 ideal-int +pkg syscall (freebsd-amd64), const AF_VENDOR15 ideal-int +pkg syscall (freebsd-amd64), const AF_VENDOR16 ideal-int +pkg syscall (freebsd-amd64), const AF_VENDOR17 ideal-int +pkg syscall (freebsd-amd64), const AF_VENDOR18 ideal-int +pkg syscall (freebsd-amd64), const AF_VENDOR19 ideal-int +pkg syscall (freebsd-amd64), const AF_VENDOR20 ideal-int +pkg syscall (freebsd-amd64), const AF_VENDOR21 ideal-int +pkg syscall (freebsd-amd64), const AF_VENDOR22 ideal-int +pkg syscall (freebsd-amd64), const AF_VENDOR23 ideal-int +pkg syscall (freebsd-amd64), const AF_VENDOR24 ideal-int +pkg syscall (freebsd-amd64), const AF_VENDOR25 ideal-int +pkg syscall (freebsd-amd64), const AF_VENDOR26 ideal-int +pkg syscall (freebsd-amd64), const AF_VENDOR27 ideal-int +pkg syscall (freebsd-amd64), const AF_VENDOR28 ideal-int +pkg syscall (freebsd-amd64), const AF_VENDOR29 ideal-int +pkg syscall (freebsd-amd64), const AF_VENDOR30 ideal-int +pkg syscall (freebsd-amd64), const AF_VENDOR31 ideal-int +pkg syscall (freebsd-amd64), const AF_VENDOR32 ideal-int +pkg syscall (freebsd-amd64), const AF_VENDOR33 ideal-int +pkg syscall (freebsd-amd64), const AF_VENDOR34 ideal-int +pkg syscall (freebsd-amd64), const AF_VENDOR35 ideal-int +pkg syscall (freebsd-amd64), const AF_VENDOR36 ideal-int +pkg syscall (freebsd-amd64), const AF_VENDOR37 ideal-int +pkg syscall (freebsd-amd64), const AF_VENDOR38 ideal-int +pkg syscall (freebsd-amd64), const AF_VENDOR39 ideal-int +pkg syscall (freebsd-amd64), const AF_VENDOR40 ideal-int +pkg syscall (freebsd-amd64), const AF_VENDOR41 ideal-int +pkg syscall (freebsd-amd64), const AF_VENDOR42 ideal-int +pkg syscall (freebsd-amd64), const AF_VENDOR43 ideal-int +pkg syscall (freebsd-amd64), const AF_VENDOR44 ideal-int +pkg syscall (freebsd-amd64), const AF_VENDOR45 ideal-int +pkg syscall (freebsd-amd64), const AF_VENDOR46 ideal-int +pkg syscall (freebsd-amd64), const AF_VENDOR47 ideal-int +pkg syscall (freebsd-amd64), const BIOCFEEDBACK ideal-int +pkg syscall (freebsd-amd64), const BIOCFLUSH ideal-int +pkg syscall (freebsd-amd64), const BIOCGBLEN ideal-int +pkg syscall (freebsd-amd64), const BIOCGDIRECTION ideal-int +pkg syscall (freebsd-amd64), const BIOCGDLT ideal-int +pkg syscall (freebsd-amd64), const BIOCGDLTLIST ideal-int +pkg syscall (freebsd-amd64), const BIOCGETBUFMODE ideal-int +pkg syscall (freebsd-amd64), const BIOCGETIF ideal-int +pkg syscall (freebsd-amd64), const BIOCGETZMAX ideal-int +pkg syscall (freebsd-amd64), const BIOCGHDRCMPLT ideal-int +pkg syscall (freebsd-amd64), const BIOCGRSIG ideal-int +pkg syscall (freebsd-amd64), const BIOCGRTIMEOUT ideal-int +pkg syscall (freebsd-amd64), const BIOCGSEESENT ideal-int +pkg syscall (freebsd-amd64), const BIOCGSTATS ideal-int +pkg syscall (freebsd-amd64), const BIOCIMMEDIATE ideal-int +pkg syscall (freebsd-amd64), const BIOCLOCK ideal-int +pkg syscall (freebsd-amd64), const BIOCPROMISC ideal-int +pkg syscall (freebsd-amd64), const BIOCROTZBUF ideal-int +pkg syscall (freebsd-amd64), const BIOCSBLEN ideal-int +pkg syscall (freebsd-amd64), const BIOCSDIRECTION ideal-int +pkg syscall (freebsd-amd64), const BIOCSDLT ideal-int +pkg syscall (freebsd-amd64), const BIOCSETBUFMODE ideal-int +pkg syscall (freebsd-amd64), const BIOCSETF ideal-int +pkg syscall (freebsd-amd64), const BIOCSETFNR ideal-int +pkg syscall (freebsd-amd64), const BIOCSETIF ideal-int +pkg syscall (freebsd-amd64), const BIOCSETWF ideal-int +pkg syscall (freebsd-amd64), const BIOCSETZBUF ideal-int +pkg syscall (freebsd-amd64), const BIOCSHDRCMPLT ideal-int +pkg syscall (freebsd-amd64), const BIOCSRSIG ideal-int +pkg syscall (freebsd-amd64), const BIOCSRTIMEOUT ideal-int +pkg syscall (freebsd-amd64), const BIOCSSEESENT ideal-int +pkg syscall (freebsd-amd64), const BIOCVERSION ideal-int +pkg syscall (freebsd-amd64), const BPF_A ideal-int +pkg syscall (freebsd-amd64), const BPF_ABS ideal-int +pkg syscall (freebsd-amd64), const BPF_ADD ideal-int +pkg syscall (freebsd-amd64), const BPF_ALIGNMENT ideal-int +pkg syscall (freebsd-amd64), const BPF_ALU ideal-int +pkg syscall (freebsd-amd64), const BPF_AND ideal-int +pkg syscall (freebsd-amd64), const BPF_B ideal-int +pkg syscall (freebsd-amd64), const BPF_BUFMODE_BUFFER ideal-int +pkg syscall (freebsd-amd64), const BPF_BUFMODE_ZBUF ideal-int +pkg syscall (freebsd-amd64), const BPF_DIV ideal-int +pkg syscall (freebsd-amd64), const BPF_H ideal-int +pkg syscall (freebsd-amd64), const BPF_IMM ideal-int +pkg syscall (freebsd-amd64), const BPF_IND ideal-int +pkg syscall (freebsd-amd64), const BPF_JA ideal-int +pkg syscall (freebsd-amd64), const BPF_JEQ ideal-int +pkg syscall (freebsd-amd64), const BPF_JGE ideal-int +pkg syscall (freebsd-amd64), const BPF_JGT ideal-int +pkg syscall (freebsd-amd64), const BPF_JMP ideal-int +pkg syscall (freebsd-amd64), const BPF_JSET ideal-int +pkg syscall (freebsd-amd64), const BPF_K ideal-int +pkg syscall (freebsd-amd64), const BPF_LD ideal-int +pkg syscall (freebsd-amd64), const BPF_LDX ideal-int +pkg syscall (freebsd-amd64), const BPF_LEN ideal-int +pkg syscall (freebsd-amd64), const BPF_LSH ideal-int +pkg syscall (freebsd-amd64), const BPF_MAJOR_VERSION ideal-int +pkg syscall (freebsd-amd64), const BPF_MAXBUFSIZE ideal-int +pkg syscall (freebsd-amd64), const BPF_MAXINSNS ideal-int +pkg syscall (freebsd-amd64), const BPF_MEM ideal-int +pkg syscall (freebsd-amd64), const BPF_MEMWORDS ideal-int +pkg syscall (freebsd-amd64), const BPF_MINBUFSIZE ideal-int +pkg syscall (freebsd-amd64), const BPF_MINOR_VERSION ideal-int +pkg syscall (freebsd-amd64), const BPF_MISC ideal-int +pkg syscall (freebsd-amd64), const BPF_MSH ideal-int +pkg syscall (freebsd-amd64), const BPF_MUL ideal-int +pkg syscall (freebsd-amd64), const BPF_NEG ideal-int +pkg syscall (freebsd-amd64), const BPF_OR ideal-int +pkg syscall (freebsd-amd64), const BPF_RELEASE ideal-int +pkg syscall (freebsd-amd64), const BPF_RET ideal-int +pkg syscall (freebsd-amd64), const BPF_RSH ideal-int +pkg syscall (freebsd-amd64), const BPF_ST ideal-int +pkg syscall (freebsd-amd64), const BPF_STX ideal-int +pkg syscall (freebsd-amd64), const BPF_SUB ideal-int +pkg syscall (freebsd-amd64), const BPF_TAX ideal-int +pkg syscall (freebsd-amd64), const BPF_TXA ideal-int +pkg syscall (freebsd-amd64), const BPF_W ideal-int +pkg syscall (freebsd-amd64), const BPF_X ideal-int +pkg syscall (freebsd-amd64), const CTL_MAXNAME ideal-int +pkg syscall (freebsd-amd64), const CTL_NET ideal-int +pkg syscall (freebsd-amd64), const DLT_A429 ideal-int +pkg syscall (freebsd-amd64), const DLT_A653_ICM ideal-int +pkg syscall (freebsd-amd64), const DLT_AIRONET_HEADER ideal-int +pkg syscall (freebsd-amd64), const DLT_APPLE_IP_OVER_IEEE1394 ideal-int +pkg syscall (freebsd-amd64), const DLT_ARCNET ideal-int +pkg syscall (freebsd-amd64), const DLT_ARCNET_LINUX ideal-int +pkg syscall (freebsd-amd64), const DLT_ATM_CLIP ideal-int +pkg syscall (freebsd-amd64), const DLT_ATM_RFC1483 ideal-int +pkg syscall (freebsd-amd64), const DLT_AURORA ideal-int +pkg syscall (freebsd-amd64), const DLT_AX25 ideal-int +pkg syscall (freebsd-amd64), const DLT_AX25_KISS ideal-int +pkg syscall (freebsd-amd64), const DLT_BACNET_MS_TP ideal-int +pkg syscall (freebsd-amd64), const DLT_BLUETOOTH_HCI_H4 ideal-int +pkg syscall (freebsd-amd64), const DLT_BLUETOOTH_HCI_H4_WITH_PHDR ideal-int +pkg syscall (freebsd-amd64), const DLT_CAN20B ideal-int +pkg syscall (freebsd-amd64), const DLT_CHAOS ideal-int +pkg syscall (freebsd-amd64), const DLT_CHDLC ideal-int +pkg syscall (freebsd-amd64), const DLT_CISCO_IOS ideal-int +pkg syscall (freebsd-amd64), const DLT_C_HDLC ideal-int +pkg syscall (freebsd-amd64), const DLT_C_HDLC_WITH_DIR ideal-int +pkg syscall (freebsd-amd64), const DLT_DOCSIS ideal-int +pkg syscall (freebsd-amd64), const DLT_ECONET ideal-int +pkg syscall (freebsd-amd64), const DLT_EN10MB ideal-int +pkg syscall (freebsd-amd64), const DLT_EN3MB ideal-int +pkg syscall (freebsd-amd64), const DLT_ENC ideal-int +pkg syscall (freebsd-amd64), const DLT_ERF ideal-int +pkg syscall (freebsd-amd64), const DLT_ERF_ETH ideal-int +pkg syscall (freebsd-amd64), const DLT_ERF_POS ideal-int +pkg syscall (freebsd-amd64), const DLT_FDDI ideal-int +pkg syscall (freebsd-amd64), const DLT_FLEXRAY ideal-int +pkg syscall (freebsd-amd64), const DLT_FRELAY ideal-int +pkg syscall (freebsd-amd64), const DLT_FRELAY_WITH_DIR ideal-int +pkg syscall (freebsd-amd64), const DLT_GCOM_SERIAL ideal-int +pkg syscall (freebsd-amd64), const DLT_GCOM_T1E1 ideal-int +pkg syscall (freebsd-amd64), const DLT_GPF_F ideal-int +pkg syscall (freebsd-amd64), const DLT_GPF_T ideal-int +pkg syscall (freebsd-amd64), const DLT_GPRS_LLC ideal-int +pkg syscall (freebsd-amd64), const DLT_HHDLC ideal-int +pkg syscall (freebsd-amd64), const DLT_IBM_SN ideal-int +pkg syscall (freebsd-amd64), const DLT_IBM_SP ideal-int +pkg syscall (freebsd-amd64), const DLT_IEEE802 ideal-int +pkg syscall (freebsd-amd64), const DLT_IEEE802_11 ideal-int +pkg syscall (freebsd-amd64), const DLT_IEEE802_11_RADIO ideal-int +pkg syscall (freebsd-amd64), const DLT_IEEE802_11_RADIO_AVS ideal-int +pkg syscall (freebsd-amd64), const DLT_IEEE802_15_4 ideal-int +pkg syscall (freebsd-amd64), const DLT_IEEE802_15_4_LINUX ideal-int +pkg syscall (freebsd-amd64), const DLT_IEEE802_15_4_NONASK_PHY ideal-int +pkg syscall (freebsd-amd64), const DLT_IEEE802_16_MAC_CPS ideal-int +pkg syscall (freebsd-amd64), const DLT_IEEE802_16_MAC_CPS_RADIO ideal-int +pkg syscall (freebsd-amd64), const DLT_IPFILTER ideal-int +pkg syscall (freebsd-amd64), const DLT_IPMB ideal-int +pkg syscall (freebsd-amd64), const DLT_IPMB_LINUX ideal-int +pkg syscall (freebsd-amd64), const DLT_IP_OVER_FC ideal-int +pkg syscall (freebsd-amd64), const DLT_JUNIPER_ATM1 ideal-int +pkg syscall (freebsd-amd64), const DLT_JUNIPER_ATM2 ideal-int +pkg syscall (freebsd-amd64), const DLT_JUNIPER_CHDLC ideal-int +pkg syscall (freebsd-amd64), const DLT_JUNIPER_ES ideal-int +pkg syscall (freebsd-amd64), const DLT_JUNIPER_ETHER ideal-int +pkg syscall (freebsd-amd64), const DLT_JUNIPER_FRELAY ideal-int +pkg syscall (freebsd-amd64), const DLT_JUNIPER_GGSN ideal-int +pkg syscall (freebsd-amd64), const DLT_JUNIPER_ISM ideal-int +pkg syscall (freebsd-amd64), const DLT_JUNIPER_MFR ideal-int +pkg syscall (freebsd-amd64), const DLT_JUNIPER_MLFR ideal-int +pkg syscall (freebsd-amd64), const DLT_JUNIPER_MLPPP ideal-int +pkg syscall (freebsd-amd64), const DLT_JUNIPER_MONITOR ideal-int +pkg syscall (freebsd-amd64), const DLT_JUNIPER_PIC_PEER ideal-int +pkg syscall (freebsd-amd64), const DLT_JUNIPER_PPP ideal-int +pkg syscall (freebsd-amd64), const DLT_JUNIPER_PPPOE ideal-int +pkg syscall (freebsd-amd64), const DLT_JUNIPER_PPPOE_ATM ideal-int +pkg syscall (freebsd-amd64), const DLT_JUNIPER_SERVICES ideal-int +pkg syscall (freebsd-amd64), const DLT_JUNIPER_ST ideal-int +pkg syscall (freebsd-amd64), const DLT_JUNIPER_VP ideal-int +pkg syscall (freebsd-amd64), const DLT_LAPB_WITH_DIR ideal-int +pkg syscall (freebsd-amd64), const DLT_LAPD ideal-int +pkg syscall (freebsd-amd64), const DLT_LIN ideal-int +pkg syscall (freebsd-amd64), const DLT_LINUX_IRDA ideal-int +pkg syscall (freebsd-amd64), const DLT_LINUX_LAPD ideal-int +pkg syscall (freebsd-amd64), const DLT_LINUX_PPP_WITHDIRECTION ideal-int +pkg syscall (freebsd-amd64), const DLT_LINUX_SLL ideal-int +pkg syscall (freebsd-amd64), const DLT_LOOP ideal-int +pkg syscall (freebsd-amd64), const DLT_LTALK ideal-int +pkg syscall (freebsd-amd64), const DLT_MFR ideal-int +pkg syscall (freebsd-amd64), const DLT_MOST ideal-int +pkg syscall (freebsd-amd64), const DLT_MTP2 ideal-int +pkg syscall (freebsd-amd64), const DLT_MTP2_WITH_PHDR ideal-int +pkg syscall (freebsd-amd64), const DLT_MTP3 ideal-int +pkg syscall (freebsd-amd64), const DLT_NULL ideal-int +pkg syscall (freebsd-amd64), const DLT_PCI_EXP ideal-int +pkg syscall (freebsd-amd64), const DLT_PFLOG ideal-int +pkg syscall (freebsd-amd64), const DLT_PFSYNC ideal-int +pkg syscall (freebsd-amd64), const DLT_PPI ideal-int +pkg syscall (freebsd-amd64), const DLT_PPP ideal-int +pkg syscall (freebsd-amd64), const DLT_PPP_BSDOS ideal-int +pkg syscall (freebsd-amd64), const DLT_PPP_ETHER ideal-int +pkg syscall (freebsd-amd64), const DLT_PPP_PPPD ideal-int +pkg syscall (freebsd-amd64), const DLT_PPP_SERIAL ideal-int +pkg syscall (freebsd-amd64), const DLT_PPP_WITH_DIR ideal-int +pkg syscall (freebsd-amd64), const DLT_PPP_WITH_DIRECTION ideal-int +pkg syscall (freebsd-amd64), const DLT_PRISM_HEADER ideal-int +pkg syscall (freebsd-amd64), const DLT_PRONET ideal-int +pkg syscall (freebsd-amd64), const DLT_RAIF1 ideal-int +pkg syscall (freebsd-amd64), const DLT_RAW ideal-int +pkg syscall (freebsd-amd64), const DLT_RIO ideal-int +pkg syscall (freebsd-amd64), const DLT_SCCP ideal-int +pkg syscall (freebsd-amd64), const DLT_SITA ideal-int +pkg syscall (freebsd-amd64), const DLT_SLIP ideal-int +pkg syscall (freebsd-amd64), const DLT_SLIP_BSDOS ideal-int +pkg syscall (freebsd-amd64), const DLT_SUNATM ideal-int +pkg syscall (freebsd-amd64), const DLT_SYMANTEC_FIREWALL ideal-int +pkg syscall (freebsd-amd64), const DLT_TZSP ideal-int +pkg syscall (freebsd-amd64), const DLT_USB ideal-int +pkg syscall (freebsd-amd64), const DLT_USB_LINUX ideal-int +pkg syscall (freebsd-amd64), const DLT_USER0 ideal-int +pkg syscall (freebsd-amd64), const DLT_USER1 ideal-int +pkg syscall (freebsd-amd64), const DLT_USER10 ideal-int +pkg syscall (freebsd-amd64), const DLT_USER11 ideal-int +pkg syscall (freebsd-amd64), const DLT_USER12 ideal-int +pkg syscall (freebsd-amd64), const DLT_USER13 ideal-int +pkg syscall (freebsd-amd64), const DLT_USER14 ideal-int +pkg syscall (freebsd-amd64), const DLT_USER15 ideal-int +pkg syscall (freebsd-amd64), const DLT_USER2 ideal-int +pkg syscall (freebsd-amd64), const DLT_USER3 ideal-int +pkg syscall (freebsd-amd64), const DLT_USER4 ideal-int +pkg syscall (freebsd-amd64), const DLT_USER5 ideal-int +pkg syscall (freebsd-amd64), const DLT_USER6 ideal-int +pkg syscall (freebsd-amd64), const DLT_USER7 ideal-int +pkg syscall (freebsd-amd64), const DLT_USER8 ideal-int +pkg syscall (freebsd-amd64), const DLT_USER9 ideal-int +pkg syscall (freebsd-amd64), const DLT_X2E_SERIAL ideal-int +pkg syscall (freebsd-amd64), const DLT_X2E_XORAYA ideal-int +pkg syscall (freebsd-amd64), const DT_BLK ideal-int +pkg syscall (freebsd-amd64), const DT_CHR ideal-int +pkg syscall (freebsd-amd64), const DT_DIR ideal-int +pkg syscall (freebsd-amd64), const DT_FIFO ideal-int +pkg syscall (freebsd-amd64), const DT_LNK ideal-int +pkg syscall (freebsd-amd64), const DT_REG ideal-int +pkg syscall (freebsd-amd64), const DT_SOCK ideal-int +pkg syscall (freebsd-amd64), const DT_UNKNOWN ideal-int +pkg syscall (freebsd-amd64), const DT_WHT ideal-int +pkg syscall (freebsd-amd64), const EAUTH Errno +pkg syscall (freebsd-amd64), const EBADMSG Errno +pkg syscall (freebsd-amd64), const EBADRPC Errno +pkg syscall (freebsd-amd64), const ECHO ideal-int +pkg syscall (freebsd-amd64), const ECHOCTL ideal-int +pkg syscall (freebsd-amd64), const ECHOE ideal-int +pkg syscall (freebsd-amd64), const ECHOK ideal-int +pkg syscall (freebsd-amd64), const ECHOKE ideal-int +pkg syscall (freebsd-amd64), const ECHONL ideal-int +pkg syscall (freebsd-amd64), const ECHOPRT ideal-int +pkg syscall (freebsd-amd64), const EDOOFUS Errno +pkg syscall (freebsd-amd64), const EFTYPE Errno +pkg syscall (freebsd-amd64), const ELAST Errno +pkg syscall (freebsd-amd64), const EMULTIHOP Errno +pkg syscall (freebsd-amd64), const ENEEDAUTH Errno +pkg syscall (freebsd-amd64), const ENOATTR Errno +pkg syscall (freebsd-amd64), const ENOLINK Errno +pkg syscall (freebsd-amd64), const ENOTCAPABLE Errno +pkg syscall (freebsd-amd64), const EPROCLIM Errno +pkg syscall (freebsd-amd64), const EPROCUNAVAIL Errno +pkg syscall (freebsd-amd64), const EPROGMISMATCH Errno +pkg syscall (freebsd-amd64), const EPROGUNAVAIL Errno +pkg syscall (freebsd-amd64), const EPROTO Errno +pkg syscall (freebsd-amd64), const ERPCMISMATCH Errno +pkg syscall (freebsd-amd64), const EVFILT_AIO ideal-int +pkg syscall (freebsd-amd64), const EVFILT_FS ideal-int +pkg syscall (freebsd-amd64), const EVFILT_LIO ideal-int +pkg syscall (freebsd-amd64), const EVFILT_PROC ideal-int +pkg syscall (freebsd-amd64), const EVFILT_READ ideal-int +pkg syscall (freebsd-amd64), const EVFILT_SIGNAL ideal-int +pkg syscall (freebsd-amd64), const EVFILT_SYSCOUNT ideal-int +pkg syscall (freebsd-amd64), const EVFILT_TIMER ideal-int +pkg syscall (freebsd-amd64), const EVFILT_USER ideal-int +pkg syscall (freebsd-amd64), const EVFILT_VNODE ideal-int +pkg syscall (freebsd-amd64), const EVFILT_WRITE ideal-int +pkg syscall (freebsd-amd64), const EV_ADD ideal-int +pkg syscall (freebsd-amd64), const EV_CLEAR ideal-int +pkg syscall (freebsd-amd64), const EV_DELETE ideal-int +pkg syscall (freebsd-amd64), const EV_DISABLE ideal-int +pkg syscall (freebsd-amd64), const EV_DISPATCH ideal-int +pkg syscall (freebsd-amd64), const EV_ENABLE ideal-int +pkg syscall (freebsd-amd64), const EV_EOF ideal-int +pkg syscall (freebsd-amd64), const EV_ERROR ideal-int +pkg syscall (freebsd-amd64), const EV_FLAG1 ideal-int +pkg syscall (freebsd-amd64), const EV_ONESHOT ideal-int +pkg syscall (freebsd-amd64), const EV_RECEIPT ideal-int +pkg syscall (freebsd-amd64), const EV_SYSFLAGS ideal-int +pkg syscall (freebsd-amd64), const EXTA ideal-int +pkg syscall (freebsd-amd64), const EXTB ideal-int +pkg syscall (freebsd-amd64), const EXTPROC ideal-int +pkg syscall (freebsd-amd64), const FD_CLOEXEC ideal-int +pkg syscall (freebsd-amd64), const FD_SETSIZE ideal-int +pkg syscall (freebsd-amd64), const F_CANCEL ideal-int +pkg syscall (freebsd-amd64), const F_DUP2FD ideal-int +pkg syscall (freebsd-amd64), const F_DUPFD ideal-int +pkg syscall (freebsd-amd64), const F_GETFD ideal-int +pkg syscall (freebsd-amd64), const F_GETFL ideal-int +pkg syscall (freebsd-amd64), const F_GETLK ideal-int +pkg syscall (freebsd-amd64), const F_GETOWN ideal-int +pkg syscall (freebsd-amd64), const F_OGETLK ideal-int +pkg syscall (freebsd-amd64), const F_OK ideal-int +pkg syscall (freebsd-amd64), const F_OSETLK ideal-int +pkg syscall (freebsd-amd64), const F_OSETLKW ideal-int +pkg syscall (freebsd-amd64), const F_RDAHEAD ideal-int +pkg syscall (freebsd-amd64), const F_RDLCK ideal-int +pkg syscall (freebsd-amd64), const F_READAHEAD ideal-int +pkg syscall (freebsd-amd64), const F_SETFD ideal-int +pkg syscall (freebsd-amd64), const F_SETFL ideal-int +pkg syscall (freebsd-amd64), const F_SETLK ideal-int +pkg syscall (freebsd-amd64), const F_SETLKW ideal-int +pkg syscall (freebsd-amd64), const F_SETLK_REMOTE ideal-int +pkg syscall (freebsd-amd64), const F_SETOWN ideal-int +pkg syscall (freebsd-amd64), const F_UNLCK ideal-int +pkg syscall (freebsd-amd64), const F_UNLCKSYS ideal-int +pkg syscall (freebsd-amd64), const F_WRLCK ideal-int +pkg syscall (freebsd-amd64), const IFF_ALLMULTI ideal-int +pkg syscall (freebsd-amd64), const IFF_ALTPHYS ideal-int +pkg syscall (freebsd-amd64), const IFF_CANTCHANGE ideal-int +pkg syscall (freebsd-amd64), const IFF_DEBUG ideal-int +pkg syscall (freebsd-amd64), const IFF_DRV_OACTIVE ideal-int +pkg syscall (freebsd-amd64), const IFF_DRV_RUNNING ideal-int +pkg syscall (freebsd-amd64), const IFF_DYING ideal-int +pkg syscall (freebsd-amd64), const IFF_LINK0 ideal-int +pkg syscall (freebsd-amd64), const IFF_LINK1 ideal-int +pkg syscall (freebsd-amd64), const IFF_LINK2 ideal-int +pkg syscall (freebsd-amd64), const IFF_MONITOR ideal-int +pkg syscall (freebsd-amd64), const IFF_NOARP ideal-int +pkg syscall (freebsd-amd64), const IFF_OACTIVE ideal-int +pkg syscall (freebsd-amd64), const IFF_POINTOPOINT ideal-int +pkg syscall (freebsd-amd64), const IFF_PPROMISC ideal-int +pkg syscall (freebsd-amd64), const IFF_PROMISC ideal-int +pkg syscall (freebsd-amd64), const IFF_RENAMING ideal-int +pkg syscall (freebsd-amd64), const IFF_RUNNING ideal-int +pkg syscall (freebsd-amd64), const IFF_SIMPLEX ideal-int +pkg syscall (freebsd-amd64), const IFF_SMART ideal-int +pkg syscall (freebsd-amd64), const IFF_STATICARP ideal-int +pkg syscall (freebsd-amd64), const IFNAMSIZ ideal-int +pkg syscall (freebsd-amd64), const IFT_1822 ideal-int +pkg syscall (freebsd-amd64), const IFT_A12MPPSWITCH ideal-int +pkg syscall (freebsd-amd64), const IFT_AAL2 ideal-int +pkg syscall (freebsd-amd64), const IFT_AAL5 ideal-int +pkg syscall (freebsd-amd64), const IFT_ADSL ideal-int +pkg syscall (freebsd-amd64), const IFT_AFLANE8023 ideal-int +pkg syscall (freebsd-amd64), const IFT_AFLANE8025 ideal-int +pkg syscall (freebsd-amd64), const IFT_ARAP ideal-int +pkg syscall (freebsd-amd64), const IFT_ARCNET ideal-int +pkg syscall (freebsd-amd64), const IFT_ARCNETPLUS ideal-int +pkg syscall (freebsd-amd64), const IFT_ASYNC ideal-int +pkg syscall (freebsd-amd64), const IFT_ATM ideal-int +pkg syscall (freebsd-amd64), const IFT_ATMDXI ideal-int +pkg syscall (freebsd-amd64), const IFT_ATMFUNI ideal-int +pkg syscall (freebsd-amd64), const IFT_ATMIMA ideal-int +pkg syscall (freebsd-amd64), const IFT_ATMLOGICAL ideal-int +pkg syscall (freebsd-amd64), const IFT_ATMRADIO ideal-int +pkg syscall (freebsd-amd64), const IFT_ATMSUBINTERFACE ideal-int +pkg syscall (freebsd-amd64), const IFT_ATMVCIENDPT ideal-int +pkg syscall (freebsd-amd64), const IFT_ATMVIRTUAL ideal-int +pkg syscall (freebsd-amd64), const IFT_BGPPOLICYACCOUNTING ideal-int +pkg syscall (freebsd-amd64), const IFT_BRIDGE ideal-int +pkg syscall (freebsd-amd64), const IFT_BSC ideal-int +pkg syscall (freebsd-amd64), const IFT_CARP ideal-int +pkg syscall (freebsd-amd64), const IFT_CCTEMUL ideal-int +pkg syscall (freebsd-amd64), const IFT_CEPT ideal-int +pkg syscall (freebsd-amd64), const IFT_CES ideal-int +pkg syscall (freebsd-amd64), const IFT_CHANNEL ideal-int +pkg syscall (freebsd-amd64), const IFT_CNR ideal-int +pkg syscall (freebsd-amd64), const IFT_COFFEE ideal-int +pkg syscall (freebsd-amd64), const IFT_COMPOSITELINK ideal-int +pkg syscall (freebsd-amd64), const IFT_DCN ideal-int +pkg syscall (freebsd-amd64), const IFT_DIGITALPOWERLINE ideal-int +pkg syscall (freebsd-amd64), const IFT_DIGITALWRAPPEROVERHEADCHANNEL ideal-int +pkg syscall (freebsd-amd64), const IFT_DLSW ideal-int +pkg syscall (freebsd-amd64), const IFT_DOCSCABLEDOWNSTREAM ideal-int +pkg syscall (freebsd-amd64), const IFT_DOCSCABLEMACLAYER ideal-int +pkg syscall (freebsd-amd64), const IFT_DOCSCABLEUPSTREAM ideal-int +pkg syscall (freebsd-amd64), const IFT_DS0 ideal-int +pkg syscall (freebsd-amd64), const IFT_DS0BUNDLE ideal-int +pkg syscall (freebsd-amd64), const IFT_DS1FDL ideal-int +pkg syscall (freebsd-amd64), const IFT_DS3 ideal-int +pkg syscall (freebsd-amd64), const IFT_DTM ideal-int +pkg syscall (freebsd-amd64), const IFT_DVBASILN ideal-int +pkg syscall (freebsd-amd64), const IFT_DVBASIOUT ideal-int +pkg syscall (freebsd-amd64), const IFT_DVBRCCDOWNSTREAM ideal-int +pkg syscall (freebsd-amd64), const IFT_DVBRCCMACLAYER ideal-int +pkg syscall (freebsd-amd64), const IFT_DVBRCCUPSTREAM ideal-int +pkg syscall (freebsd-amd64), const IFT_ENC ideal-int +pkg syscall (freebsd-amd64), const IFT_EON ideal-int +pkg syscall (freebsd-amd64), const IFT_EPLRS ideal-int +pkg syscall (freebsd-amd64), const IFT_ESCON ideal-int +pkg syscall (freebsd-amd64), const IFT_ETHER ideal-int +pkg syscall (freebsd-amd64), const IFT_FAITH ideal-int +pkg syscall (freebsd-amd64), const IFT_FAST ideal-int +pkg syscall (freebsd-amd64), const IFT_FASTETHER ideal-int +pkg syscall (freebsd-amd64), const IFT_FASTETHERFX ideal-int +pkg syscall (freebsd-amd64), const IFT_FDDI ideal-int +pkg syscall (freebsd-amd64), const IFT_FIBRECHANNEL ideal-int +pkg syscall (freebsd-amd64), const IFT_FRAMERELAYINTERCONNECT ideal-int +pkg syscall (freebsd-amd64), const IFT_FRAMERELAYMPI ideal-int +pkg syscall (freebsd-amd64), const IFT_FRDLCIENDPT ideal-int +pkg syscall (freebsd-amd64), const IFT_FRELAY ideal-int +pkg syscall (freebsd-amd64), const IFT_FRELAYDCE ideal-int +pkg syscall (freebsd-amd64), const IFT_FRF16MFRBUNDLE ideal-int +pkg syscall (freebsd-amd64), const IFT_FRFORWARD ideal-int +pkg syscall (freebsd-amd64), const IFT_G703AT2MB ideal-int +pkg syscall (freebsd-amd64), const IFT_G703AT64K ideal-int +pkg syscall (freebsd-amd64), const IFT_GIF ideal-int +pkg syscall (freebsd-amd64), const IFT_GIGABITETHERNET ideal-int +pkg syscall (freebsd-amd64), const IFT_GR303IDT ideal-int +pkg syscall (freebsd-amd64), const IFT_GR303RDT ideal-int +pkg syscall (freebsd-amd64), const IFT_H323GATEKEEPER ideal-int +pkg syscall (freebsd-amd64), const IFT_H323PROXY ideal-int +pkg syscall (freebsd-amd64), const IFT_HDH1822 ideal-int +pkg syscall (freebsd-amd64), const IFT_HDLC ideal-int +pkg syscall (freebsd-amd64), const IFT_HDSL2 ideal-int +pkg syscall (freebsd-amd64), const IFT_HIPERLAN2 ideal-int +pkg syscall (freebsd-amd64), const IFT_HIPPI ideal-int +pkg syscall (freebsd-amd64), const IFT_HIPPIINTERFACE ideal-int +pkg syscall (freebsd-amd64), const IFT_HOSTPAD ideal-int +pkg syscall (freebsd-amd64), const IFT_HSSI ideal-int +pkg syscall (freebsd-amd64), const IFT_HY ideal-int +pkg syscall (freebsd-amd64), const IFT_IBM370PARCHAN ideal-int +pkg syscall (freebsd-amd64), const IFT_IDSL ideal-int +pkg syscall (freebsd-amd64), const IFT_IEEE1394 ideal-int +pkg syscall (freebsd-amd64), const IFT_IEEE80211 ideal-int +pkg syscall (freebsd-amd64), const IFT_IEEE80212 ideal-int +pkg syscall (freebsd-amd64), const IFT_IEEE8023ADLAG ideal-int +pkg syscall (freebsd-amd64), const IFT_IFGSN ideal-int +pkg syscall (freebsd-amd64), const IFT_IMT ideal-int +pkg syscall (freebsd-amd64), const IFT_INTERLEAVE ideal-int +pkg syscall (freebsd-amd64), const IFT_IP ideal-int +pkg syscall (freebsd-amd64), const IFT_IPFORWARD ideal-int +pkg syscall (freebsd-amd64), const IFT_IPOVERATM ideal-int +pkg syscall (freebsd-amd64), const IFT_IPOVERCDLC ideal-int +pkg syscall (freebsd-amd64), const IFT_IPOVERCLAW ideal-int +pkg syscall (freebsd-amd64), const IFT_IPSWITCH ideal-int +pkg syscall (freebsd-amd64), const IFT_IPXIP ideal-int +pkg syscall (freebsd-amd64), const IFT_ISDN ideal-int +pkg syscall (freebsd-amd64), const IFT_ISDNBASIC ideal-int +pkg syscall (freebsd-amd64), const IFT_ISDNPRIMARY ideal-int +pkg syscall (freebsd-amd64), const IFT_ISDNS ideal-int +pkg syscall (freebsd-amd64), const IFT_ISDNU ideal-int +pkg syscall (freebsd-amd64), const IFT_ISO88022LLC ideal-int +pkg syscall (freebsd-amd64), const IFT_ISO88023 ideal-int +pkg syscall (freebsd-amd64), const IFT_ISO88024 ideal-int +pkg syscall (freebsd-amd64), const IFT_ISO88025 ideal-int +pkg syscall (freebsd-amd64), const IFT_ISO88025CRFPINT ideal-int +pkg syscall (freebsd-amd64), const IFT_ISO88025DTR ideal-int +pkg syscall (freebsd-amd64), const IFT_ISO88025FIBER ideal-int +pkg syscall (freebsd-amd64), const IFT_ISO88026 ideal-int +pkg syscall (freebsd-amd64), const IFT_ISUP ideal-int +pkg syscall (freebsd-amd64), const IFT_L2VLAN ideal-int +pkg syscall (freebsd-amd64), const IFT_L3IPVLAN ideal-int +pkg syscall (freebsd-amd64), const IFT_L3IPXVLAN ideal-int +pkg syscall (freebsd-amd64), const IFT_LAPB ideal-int +pkg syscall (freebsd-amd64), const IFT_LAPD ideal-int +pkg syscall (freebsd-amd64), const IFT_LAPF ideal-int +pkg syscall (freebsd-amd64), const IFT_LOCALTALK ideal-int +pkg syscall (freebsd-amd64), const IFT_LOOP ideal-int +pkg syscall (freebsd-amd64), const IFT_MEDIAMAILOVERIP ideal-int +pkg syscall (freebsd-amd64), const IFT_MFSIGLINK ideal-int +pkg syscall (freebsd-amd64), const IFT_MIOX25 ideal-int +pkg syscall (freebsd-amd64), const IFT_MODEM ideal-int +pkg syscall (freebsd-amd64), const IFT_MPC ideal-int +pkg syscall (freebsd-amd64), const IFT_MPLS ideal-int +pkg syscall (freebsd-amd64), const IFT_MPLSTUNNEL ideal-int +pkg syscall (freebsd-amd64), const IFT_MSDSL ideal-int +pkg syscall (freebsd-amd64), const IFT_MVL ideal-int +pkg syscall (freebsd-amd64), const IFT_MYRINET ideal-int +pkg syscall (freebsd-amd64), const IFT_NFAS ideal-int +pkg syscall (freebsd-amd64), const IFT_NSIP ideal-int +pkg syscall (freebsd-amd64), const IFT_OPTICALCHANNEL ideal-int +pkg syscall (freebsd-amd64), const IFT_OPTICALTRANSPORT ideal-int +pkg syscall (freebsd-amd64), const IFT_OTHER ideal-int +pkg syscall (freebsd-amd64), const IFT_P10 ideal-int +pkg syscall (freebsd-amd64), const IFT_P80 ideal-int +pkg syscall (freebsd-amd64), const IFT_PARA ideal-int +pkg syscall (freebsd-amd64), const IFT_PFLOG ideal-int +pkg syscall (freebsd-amd64), const IFT_PFSYNC ideal-int +pkg syscall (freebsd-amd64), const IFT_PLC ideal-int +pkg syscall (freebsd-amd64), const IFT_POS ideal-int +pkg syscall (freebsd-amd64), const IFT_PPP ideal-int +pkg syscall (freebsd-amd64), const IFT_PPPMULTILINKBUNDLE ideal-int +pkg syscall (freebsd-amd64), const IFT_PROPBWAP2MP ideal-int +pkg syscall (freebsd-amd64), const IFT_PROPCNLS ideal-int +pkg syscall (freebsd-amd64), const IFT_PROPDOCSWIRELESSDOWNSTREAM ideal-int +pkg syscall (freebsd-amd64), const IFT_PROPDOCSWIRELESSMACLAYER ideal-int +pkg syscall (freebsd-amd64), const IFT_PROPDOCSWIRELESSUPSTREAM ideal-int +pkg syscall (freebsd-amd64), const IFT_PROPMUX ideal-int +pkg syscall (freebsd-amd64), const IFT_PROPVIRTUAL ideal-int +pkg syscall (freebsd-amd64), const IFT_PROPWIRELESSP2P ideal-int +pkg syscall (freebsd-amd64), const IFT_PTPSERIAL ideal-int +pkg syscall (freebsd-amd64), const IFT_PVC ideal-int +pkg syscall (freebsd-amd64), const IFT_QLLC ideal-int +pkg syscall (freebsd-amd64), const IFT_RADIOMAC ideal-int +pkg syscall (freebsd-amd64), const IFT_RADSL ideal-int +pkg syscall (freebsd-amd64), const IFT_REACHDSL ideal-int +pkg syscall (freebsd-amd64), const IFT_RFC1483 ideal-int +pkg syscall (freebsd-amd64), const IFT_RS232 ideal-int +pkg syscall (freebsd-amd64), const IFT_RSRB ideal-int +pkg syscall (freebsd-amd64), const IFT_SDLC ideal-int +pkg syscall (freebsd-amd64), const IFT_SDSL ideal-int +pkg syscall (freebsd-amd64), const IFT_SHDSL ideal-int +pkg syscall (freebsd-amd64), const IFT_SIP ideal-int +pkg syscall (freebsd-amd64), const IFT_SLIP ideal-int +pkg syscall (freebsd-amd64), const IFT_SMDSDXI ideal-int +pkg syscall (freebsd-amd64), const IFT_SMDSICIP ideal-int +pkg syscall (freebsd-amd64), const IFT_SONET ideal-int +pkg syscall (freebsd-amd64), const IFT_SONETOVERHEADCHANNEL ideal-int +pkg syscall (freebsd-amd64), const IFT_SONETPATH ideal-int +pkg syscall (freebsd-amd64), const IFT_SONETVT ideal-int +pkg syscall (freebsd-amd64), const IFT_SRP ideal-int +pkg syscall (freebsd-amd64), const IFT_SS7SIGLINK ideal-int +pkg syscall (freebsd-amd64), const IFT_STACKTOSTACK ideal-int +pkg syscall (freebsd-amd64), const IFT_STARLAN ideal-int +pkg syscall (freebsd-amd64), const IFT_STF ideal-int +pkg syscall (freebsd-amd64), const IFT_T1 ideal-int +pkg syscall (freebsd-amd64), const IFT_TDLC ideal-int +pkg syscall (freebsd-amd64), const IFT_TERMPAD ideal-int +pkg syscall (freebsd-amd64), const IFT_TR008 ideal-int +pkg syscall (freebsd-amd64), const IFT_TRANSPHDLC ideal-int +pkg syscall (freebsd-amd64), const IFT_TUNNEL ideal-int +pkg syscall (freebsd-amd64), const IFT_ULTRA ideal-int +pkg syscall (freebsd-amd64), const IFT_USB ideal-int +pkg syscall (freebsd-amd64), const IFT_V11 ideal-int +pkg syscall (freebsd-amd64), const IFT_V35 ideal-int +pkg syscall (freebsd-amd64), const IFT_V36 ideal-int +pkg syscall (freebsd-amd64), const IFT_V37 ideal-int +pkg syscall (freebsd-amd64), const IFT_VDSL ideal-int +pkg syscall (freebsd-amd64), const IFT_VIRTUALIPADDRESS ideal-int +pkg syscall (freebsd-amd64), const IFT_VOICEEM ideal-int +pkg syscall (freebsd-amd64), const IFT_VOICEENCAP ideal-int +pkg syscall (freebsd-amd64), const IFT_VOICEFXO ideal-int +pkg syscall (freebsd-amd64), const IFT_VOICEFXS ideal-int +pkg syscall (freebsd-amd64), const IFT_VOICEOVERATM ideal-int +pkg syscall (freebsd-amd64), const IFT_VOICEOVERFRAMERELAY ideal-int +pkg syscall (freebsd-amd64), const IFT_VOICEOVERIP ideal-int +pkg syscall (freebsd-amd64), const IFT_X213 ideal-int +pkg syscall (freebsd-amd64), const IFT_X25 ideal-int +pkg syscall (freebsd-amd64), const IFT_X25DDN ideal-int +pkg syscall (freebsd-amd64), const IFT_X25HUNTGROUP ideal-int +pkg syscall (freebsd-amd64), const IFT_X25MLP ideal-int +pkg syscall (freebsd-amd64), const IFT_X25PLE ideal-int +pkg syscall (freebsd-amd64), const IFT_XETHER ideal-int +pkg syscall (freebsd-amd64), const IN_CLASSA_HOST ideal-int +pkg syscall (freebsd-amd64), const IN_CLASSA_MAX ideal-int +pkg syscall (freebsd-amd64), const IN_CLASSA_NET ideal-int +pkg syscall (freebsd-amd64), const IN_CLASSA_NSHIFT ideal-int +pkg syscall (freebsd-amd64), const IN_CLASSB_HOST ideal-int +pkg syscall (freebsd-amd64), const IN_CLASSB_MAX ideal-int +pkg syscall (freebsd-amd64), const IN_CLASSB_NET ideal-int +pkg syscall (freebsd-amd64), const IN_CLASSB_NSHIFT ideal-int +pkg syscall (freebsd-amd64), const IN_CLASSC_HOST ideal-int +pkg syscall (freebsd-amd64), const IN_CLASSC_NET ideal-int +pkg syscall (freebsd-amd64), const IN_CLASSC_NSHIFT ideal-int +pkg syscall (freebsd-amd64), const IN_CLASSD_HOST ideal-int +pkg syscall (freebsd-amd64), const IN_CLASSD_NET ideal-int +pkg syscall (freebsd-amd64), const IN_CLASSD_NSHIFT ideal-int +pkg syscall (freebsd-amd64), const IN_LOOPBACKNET ideal-int +pkg syscall (freebsd-amd64), const IPPROTO_3PC ideal-int +pkg syscall (freebsd-amd64), const IPPROTO_ADFS ideal-int +pkg syscall (freebsd-amd64), const IPPROTO_AH ideal-int +pkg syscall (freebsd-amd64), const IPPROTO_AHIP ideal-int +pkg syscall (freebsd-amd64), const IPPROTO_APES ideal-int +pkg syscall (freebsd-amd64), const IPPROTO_ARGUS ideal-int +pkg syscall (freebsd-amd64), const IPPROTO_AX25 ideal-int +pkg syscall (freebsd-amd64), const IPPROTO_BHA ideal-int +pkg syscall (freebsd-amd64), const IPPROTO_BLT ideal-int +pkg syscall (freebsd-amd64), const IPPROTO_BRSATMON ideal-int +pkg syscall (freebsd-amd64), const IPPROTO_CARP ideal-int +pkg syscall (freebsd-amd64), const IPPROTO_CFTP ideal-int +pkg syscall (freebsd-amd64), const IPPROTO_CHAOS ideal-int +pkg syscall (freebsd-amd64), const IPPROTO_CMTP ideal-int +pkg syscall (freebsd-amd64), const IPPROTO_CPHB ideal-int +pkg syscall (freebsd-amd64), const IPPROTO_CPNX ideal-int +pkg syscall (freebsd-amd64), const IPPROTO_DDP ideal-int +pkg syscall (freebsd-amd64), const IPPROTO_DGP ideal-int +pkg syscall (freebsd-amd64), const IPPROTO_DIVERT ideal-int +pkg syscall (freebsd-amd64), const IPPROTO_DONE ideal-int +pkg syscall (freebsd-amd64), const IPPROTO_DSTOPTS ideal-int +pkg syscall (freebsd-amd64), const IPPROTO_EGP ideal-int +pkg syscall (freebsd-amd64), const IPPROTO_EMCON ideal-int +pkg syscall (freebsd-amd64), const IPPROTO_ENCAP ideal-int +pkg syscall (freebsd-amd64), const IPPROTO_EON ideal-int +pkg syscall (freebsd-amd64), const IPPROTO_ESP ideal-int +pkg syscall (freebsd-amd64), const IPPROTO_ETHERIP ideal-int +pkg syscall (freebsd-amd64), const IPPROTO_FRAGMENT ideal-int +pkg syscall (freebsd-amd64), const IPPROTO_GGP ideal-int +pkg syscall (freebsd-amd64), const IPPROTO_GMTP ideal-int +pkg syscall (freebsd-amd64), const IPPROTO_GRE ideal-int +pkg syscall (freebsd-amd64), const IPPROTO_HELLO ideal-int +pkg syscall (freebsd-amd64), const IPPROTO_HMP ideal-int +pkg syscall (freebsd-amd64), const IPPROTO_HOPOPTS ideal-int +pkg syscall (freebsd-amd64), const IPPROTO_ICMP ideal-int +pkg syscall (freebsd-amd64), const IPPROTO_ICMPV6 ideal-int +pkg syscall (freebsd-amd64), const IPPROTO_IDP ideal-int +pkg syscall (freebsd-amd64), const IPPROTO_IDPR ideal-int +pkg syscall (freebsd-amd64), const IPPROTO_IDRP ideal-int +pkg syscall (freebsd-amd64), const IPPROTO_IGMP ideal-int +pkg syscall (freebsd-amd64), const IPPROTO_IGP ideal-int +pkg syscall (freebsd-amd64), const IPPROTO_IGRP ideal-int +pkg syscall (freebsd-amd64), const IPPROTO_IL ideal-int +pkg syscall (freebsd-amd64), const IPPROTO_INLSP ideal-int +pkg syscall (freebsd-amd64), const IPPROTO_INP ideal-int +pkg syscall (freebsd-amd64), const IPPROTO_IPCOMP ideal-int +pkg syscall (freebsd-amd64), const IPPROTO_IPCV ideal-int +pkg syscall (freebsd-amd64), const IPPROTO_IPEIP ideal-int +pkg syscall (freebsd-amd64), const IPPROTO_IPIP ideal-int +pkg syscall (freebsd-amd64), const IPPROTO_IPPC ideal-int +pkg syscall (freebsd-amd64), const IPPROTO_IPV4 ideal-int +pkg syscall (freebsd-amd64), const IPPROTO_IRTP ideal-int +pkg syscall (freebsd-amd64), const IPPROTO_KRYPTOLAN ideal-int +pkg syscall (freebsd-amd64), const IPPROTO_LARP ideal-int +pkg syscall (freebsd-amd64), const IPPROTO_LEAF1 ideal-int +pkg syscall (freebsd-amd64), const IPPROTO_LEAF2 ideal-int +pkg syscall (freebsd-amd64), const IPPROTO_MAX ideal-int +pkg syscall (freebsd-amd64), const IPPROTO_MAXID ideal-int +pkg syscall (freebsd-amd64), const IPPROTO_MEAS ideal-int +pkg syscall (freebsd-amd64), const IPPROTO_MHRP ideal-int +pkg syscall (freebsd-amd64), const IPPROTO_MICP ideal-int +pkg syscall (freebsd-amd64), const IPPROTO_MOBILE ideal-int +pkg syscall (freebsd-amd64), const IPPROTO_MTP ideal-int +pkg syscall (freebsd-amd64), const IPPROTO_MUX ideal-int +pkg syscall (freebsd-amd64), const IPPROTO_ND ideal-int +pkg syscall (freebsd-amd64), const IPPROTO_NHRP ideal-int +pkg syscall (freebsd-amd64), const IPPROTO_NONE ideal-int +pkg syscall (freebsd-amd64), const IPPROTO_NSP ideal-int +pkg syscall (freebsd-amd64), const IPPROTO_NVPII ideal-int +pkg syscall (freebsd-amd64), const IPPROTO_OLD_DIVERT ideal-int +pkg syscall (freebsd-amd64), const IPPROTO_OSPFIGP ideal-int +pkg syscall (freebsd-amd64), const IPPROTO_PFSYNC ideal-int +pkg syscall (freebsd-amd64), const IPPROTO_PGM ideal-int +pkg syscall (freebsd-amd64), const IPPROTO_PIGP ideal-int +pkg syscall (freebsd-amd64), const IPPROTO_PIM ideal-int +pkg syscall (freebsd-amd64), const IPPROTO_PRM ideal-int +pkg syscall (freebsd-amd64), const IPPROTO_PUP ideal-int +pkg syscall (freebsd-amd64), const IPPROTO_PVP ideal-int +pkg syscall (freebsd-amd64), const IPPROTO_RAW ideal-int +pkg syscall (freebsd-amd64), const IPPROTO_RCCMON ideal-int +pkg syscall (freebsd-amd64), const IPPROTO_RDP ideal-int +pkg syscall (freebsd-amd64), const IPPROTO_ROUTING ideal-int +pkg syscall (freebsd-amd64), const IPPROTO_RSVP ideal-int +pkg syscall (freebsd-amd64), const IPPROTO_RVD ideal-int +pkg syscall (freebsd-amd64), const IPPROTO_SATEXPAK ideal-int +pkg syscall (freebsd-amd64), const IPPROTO_SATMON ideal-int +pkg syscall (freebsd-amd64), const IPPROTO_SCCSP ideal-int +pkg syscall (freebsd-amd64), const IPPROTO_SCTP ideal-int +pkg syscall (freebsd-amd64), const IPPROTO_SDRP ideal-int +pkg syscall (freebsd-amd64), const IPPROTO_SEP ideal-int +pkg syscall (freebsd-amd64), const IPPROTO_SKIP ideal-int +pkg syscall (freebsd-amd64), const IPPROTO_SPACER ideal-int +pkg syscall (freebsd-amd64), const IPPROTO_SRPC ideal-int +pkg syscall (freebsd-amd64), const IPPROTO_ST ideal-int +pkg syscall (freebsd-amd64), const IPPROTO_SVMTP ideal-int +pkg syscall (freebsd-amd64), const IPPROTO_SWIPE ideal-int +pkg syscall (freebsd-amd64), const IPPROTO_TCF ideal-int +pkg syscall (freebsd-amd64), const IPPROTO_TLSP ideal-int +pkg syscall (freebsd-amd64), const IPPROTO_TP ideal-int +pkg syscall (freebsd-amd64), const IPPROTO_TPXX ideal-int +pkg syscall (freebsd-amd64), const IPPROTO_TRUNK1 ideal-int +pkg syscall (freebsd-amd64), const IPPROTO_TRUNK2 ideal-int +pkg syscall (freebsd-amd64), const IPPROTO_TTP ideal-int +pkg syscall (freebsd-amd64), const IPPROTO_VINES ideal-int +pkg syscall (freebsd-amd64), const IPPROTO_VISA ideal-int +pkg syscall (freebsd-amd64), const IPPROTO_VMTP ideal-int +pkg syscall (freebsd-amd64), const IPPROTO_WBEXPAK ideal-int +pkg syscall (freebsd-amd64), const IPPROTO_WBMON ideal-int +pkg syscall (freebsd-amd64), const IPPROTO_WSN ideal-int +pkg syscall (freebsd-amd64), const IPPROTO_XNET ideal-int +pkg syscall (freebsd-amd64), const IPPROTO_XTP ideal-int +pkg syscall (freebsd-amd64), const IPV6_AUTOFLOWLABEL ideal-int +pkg syscall (freebsd-amd64), const IPV6_BINDANY ideal-int +pkg syscall (freebsd-amd64), const IPV6_BINDV6ONLY ideal-int +pkg syscall (freebsd-amd64), const IPV6_CHECKSUM ideal-int +pkg syscall (freebsd-amd64), const IPV6_DEFAULT_MULTICAST_HOPS ideal-int +pkg syscall (freebsd-amd64), const IPV6_DEFAULT_MULTICAST_LOOP ideal-int +pkg syscall (freebsd-amd64), const IPV6_DEFHLIM ideal-int +pkg syscall (freebsd-amd64), const IPV6_DONTFRAG ideal-int +pkg syscall (freebsd-amd64), const IPV6_DSTOPTS ideal-int +pkg syscall (freebsd-amd64), const IPV6_FAITH ideal-int +pkg syscall (freebsd-amd64), const IPV6_FLOWINFO_MASK ideal-int +pkg syscall (freebsd-amd64), const IPV6_FLOWLABEL_MASK ideal-int +pkg syscall (freebsd-amd64), const IPV6_FRAGTTL ideal-int +pkg syscall (freebsd-amd64), const IPV6_FW_ADD ideal-int +pkg syscall (freebsd-amd64), const IPV6_FW_DEL ideal-int +pkg syscall (freebsd-amd64), const IPV6_FW_FLUSH ideal-int +pkg syscall (freebsd-amd64), const IPV6_FW_GET ideal-int +pkg syscall (freebsd-amd64), const IPV6_FW_ZERO ideal-int +pkg syscall (freebsd-amd64), const IPV6_HLIMDEC ideal-int +pkg syscall (freebsd-amd64), const IPV6_HOPLIMIT ideal-int +pkg syscall (freebsd-amd64), const IPV6_HOPOPTS ideal-int +pkg syscall (freebsd-amd64), const IPV6_IPSEC_POLICY ideal-int +pkg syscall (freebsd-amd64), const IPV6_MAXHLIM ideal-int +pkg syscall (freebsd-amd64), const IPV6_MAXOPTHDR ideal-int +pkg syscall (freebsd-amd64), const IPV6_MAXPACKET ideal-int +pkg syscall (freebsd-amd64), const IPV6_MAX_GROUP_SRC_FILTER ideal-int +pkg syscall (freebsd-amd64), const IPV6_MAX_MEMBERSHIPS ideal-int +pkg syscall (freebsd-amd64), const IPV6_MAX_SOCK_SRC_FILTER ideal-int +pkg syscall (freebsd-amd64), const IPV6_MIN_MEMBERSHIPS ideal-int +pkg syscall (freebsd-amd64), const IPV6_MMTU ideal-int +pkg syscall (freebsd-amd64), const IPV6_MSFILTER ideal-int +pkg syscall (freebsd-amd64), const IPV6_NEXTHOP ideal-int +pkg syscall (freebsd-amd64), const IPV6_PATHMTU ideal-int +pkg syscall (freebsd-amd64), const IPV6_PKTINFO ideal-int +pkg syscall (freebsd-amd64), const IPV6_PORTRANGE ideal-int +pkg syscall (freebsd-amd64), const IPV6_PORTRANGE_DEFAULT ideal-int +pkg syscall (freebsd-amd64), const IPV6_PORTRANGE_HIGH ideal-int +pkg syscall (freebsd-amd64), const IPV6_PORTRANGE_LOW ideal-int +pkg syscall (freebsd-amd64), const IPV6_PREFER_TEMPADDR ideal-int +pkg syscall (freebsd-amd64), const IPV6_RECVDSTOPTS ideal-int +pkg syscall (freebsd-amd64), const IPV6_RECVHOPLIMIT ideal-int +pkg syscall (freebsd-amd64), const IPV6_RECVHOPOPTS ideal-int +pkg syscall (freebsd-amd64), const IPV6_RECVPATHMTU ideal-int +pkg syscall (freebsd-amd64), const IPV6_RECVPKTINFO ideal-int +pkg syscall (freebsd-amd64), const IPV6_RECVRTHDR ideal-int +pkg syscall (freebsd-amd64), const IPV6_RECVTCLASS ideal-int +pkg syscall (freebsd-amd64), const IPV6_RTHDR ideal-int +pkg syscall (freebsd-amd64), const IPV6_RTHDRDSTOPTS ideal-int +pkg syscall (freebsd-amd64), const IPV6_RTHDR_LOOSE ideal-int +pkg syscall (freebsd-amd64), const IPV6_RTHDR_STRICT ideal-int +pkg syscall (freebsd-amd64), const IPV6_RTHDR_TYPE_0 ideal-int +pkg syscall (freebsd-amd64), const IPV6_SOCKOPT_RESERVED1 ideal-int +pkg syscall (freebsd-amd64), const IPV6_TCLASS ideal-int +pkg syscall (freebsd-amd64), const IPV6_USE_MIN_MTU ideal-int +pkg syscall (freebsd-amd64), const IPV6_VERSION ideal-int +pkg syscall (freebsd-amd64), const IPV6_VERSION_MASK ideal-int +pkg syscall (freebsd-amd64), const IP_ADD_SOURCE_MEMBERSHIP ideal-int +pkg syscall (freebsd-amd64), const IP_BINDANY ideal-int +pkg syscall (freebsd-amd64), const IP_BLOCK_SOURCE ideal-int +pkg syscall (freebsd-amd64), const IP_DEFAULT_MULTICAST_LOOP ideal-int +pkg syscall (freebsd-amd64), const IP_DEFAULT_MULTICAST_TTL ideal-int +pkg syscall (freebsd-amd64), const IP_DF ideal-int +pkg syscall (freebsd-amd64), const IP_DONTFRAG ideal-int +pkg syscall (freebsd-amd64), const IP_DROP_SOURCE_MEMBERSHIP ideal-int +pkg syscall (freebsd-amd64), const IP_DUMMYNET3 ideal-int +pkg syscall (freebsd-amd64), const IP_DUMMYNET_CONFIGURE ideal-int +pkg syscall (freebsd-amd64), const IP_DUMMYNET_DEL ideal-int +pkg syscall (freebsd-amd64), const IP_DUMMYNET_FLUSH ideal-int +pkg syscall (freebsd-amd64), const IP_DUMMYNET_GET ideal-int +pkg syscall (freebsd-amd64), const IP_FAITH ideal-int +pkg syscall (freebsd-amd64), const IP_FW3 ideal-int +pkg syscall (freebsd-amd64), const IP_FW_ADD ideal-int +pkg syscall (freebsd-amd64), const IP_FW_DEL ideal-int +pkg syscall (freebsd-amd64), const IP_FW_FLUSH ideal-int +pkg syscall (freebsd-amd64), const IP_FW_GET ideal-int +pkg syscall (freebsd-amd64), const IP_FW_NAT_CFG ideal-int +pkg syscall (freebsd-amd64), const IP_FW_NAT_DEL ideal-int +pkg syscall (freebsd-amd64), const IP_FW_NAT_GET_CONFIG ideal-int +pkg syscall (freebsd-amd64), const IP_FW_NAT_GET_LOG ideal-int +pkg syscall (freebsd-amd64), const IP_FW_RESETLOG ideal-int +pkg syscall (freebsd-amd64), const IP_FW_TABLE_ADD ideal-int +pkg syscall (freebsd-amd64), const IP_FW_TABLE_DEL ideal-int +pkg syscall (freebsd-amd64), const IP_FW_TABLE_FLUSH ideal-int +pkg syscall (freebsd-amd64), const IP_FW_TABLE_GETSIZE ideal-int +pkg syscall (freebsd-amd64), const IP_FW_TABLE_LIST ideal-int +pkg syscall (freebsd-amd64), const IP_FW_ZERO ideal-int +pkg syscall (freebsd-amd64), const IP_HDRINCL ideal-int +pkg syscall (freebsd-amd64), const IP_IPSEC_POLICY ideal-int +pkg syscall (freebsd-amd64), const IP_MAXPACKET ideal-int +pkg syscall (freebsd-amd64), const IP_MAX_GROUP_SRC_FILTER ideal-int +pkg syscall (freebsd-amd64), const IP_MAX_MEMBERSHIPS ideal-int +pkg syscall (freebsd-amd64), const IP_MAX_SOCK_MUTE_FILTER ideal-int +pkg syscall (freebsd-amd64), const IP_MAX_SOCK_SRC_FILTER ideal-int +pkg syscall (freebsd-amd64), const IP_MAX_SOURCE_FILTER ideal-int +pkg syscall (freebsd-amd64), const IP_MF ideal-int +pkg syscall (freebsd-amd64), const IP_MINTTL ideal-int +pkg syscall (freebsd-amd64), const IP_MIN_MEMBERSHIPS ideal-int +pkg syscall (freebsd-amd64), const IP_MSFILTER ideal-int +pkg syscall (freebsd-amd64), const IP_MSS ideal-int +pkg syscall (freebsd-amd64), const IP_MULTICAST_VIF ideal-int +pkg syscall (freebsd-amd64), const IP_OFFMASK ideal-int +pkg syscall (freebsd-amd64), const IP_ONESBCAST ideal-int +pkg syscall (freebsd-amd64), const IP_OPTIONS ideal-int +pkg syscall (freebsd-amd64), const IP_PORTRANGE ideal-int +pkg syscall (freebsd-amd64), const IP_PORTRANGE_DEFAULT ideal-int +pkg syscall (freebsd-amd64), const IP_PORTRANGE_HIGH ideal-int +pkg syscall (freebsd-amd64), const IP_PORTRANGE_LOW ideal-int +pkg syscall (freebsd-amd64), const IP_RECVDSTADDR ideal-int +pkg syscall (freebsd-amd64), const IP_RECVIF ideal-int +pkg syscall (freebsd-amd64), const IP_RECVOPTS ideal-int +pkg syscall (freebsd-amd64), const IP_RECVRETOPTS ideal-int +pkg syscall (freebsd-amd64), const IP_RECVTTL ideal-int +pkg syscall (freebsd-amd64), const IP_RETOPTS ideal-int +pkg syscall (freebsd-amd64), const IP_RF ideal-int +pkg syscall (freebsd-amd64), const IP_RSVP_OFF ideal-int +pkg syscall (freebsd-amd64), const IP_RSVP_ON ideal-int +pkg syscall (freebsd-amd64), const IP_RSVP_VIF_OFF ideal-int +pkg syscall (freebsd-amd64), const IP_RSVP_VIF_ON ideal-int +pkg syscall (freebsd-amd64), const IP_SENDSRCADDR ideal-int +pkg syscall (freebsd-amd64), const IP_UNBLOCK_SOURCE ideal-int +pkg syscall (freebsd-amd64), const LOCK_EX ideal-int +pkg syscall (freebsd-amd64), const LOCK_NB ideal-int +pkg syscall (freebsd-amd64), const LOCK_SH ideal-int +pkg syscall (freebsd-amd64), const LOCK_UN ideal-int +pkg syscall (freebsd-amd64), const MSG_COMPAT ideal-int +pkg syscall (freebsd-amd64), const MSG_CTRUNC ideal-int +pkg syscall (freebsd-amd64), const MSG_DONTROUTE ideal-int +pkg syscall (freebsd-amd64), const MSG_DONTWAIT ideal-int +pkg syscall (freebsd-amd64), const MSG_EOF ideal-int +pkg syscall (freebsd-amd64), const MSG_EOR ideal-int +pkg syscall (freebsd-amd64), const MSG_NBIO ideal-int +pkg syscall (freebsd-amd64), const MSG_NOSIGNAL ideal-int +pkg syscall (freebsd-amd64), const MSG_NOTIFICATION ideal-int +pkg syscall (freebsd-amd64), const MSG_OOB ideal-int +pkg syscall (freebsd-amd64), const MSG_PEEK ideal-int +pkg syscall (freebsd-amd64), const MSG_TRUNC ideal-int +pkg syscall (freebsd-amd64), const MSG_WAITALL ideal-int +pkg syscall (freebsd-amd64), const NET_RT_DUMP ideal-int +pkg syscall (freebsd-amd64), const NET_RT_FLAGS ideal-int +pkg syscall (freebsd-amd64), const NET_RT_IFLIST ideal-int +pkg syscall (freebsd-amd64), const NET_RT_IFMALIST ideal-int +pkg syscall (freebsd-amd64), const NET_RT_MAXID ideal-int +pkg syscall (freebsd-amd64), const NOTE_ATTRIB ideal-int +pkg syscall (freebsd-amd64), const NOTE_CHILD ideal-int +pkg syscall (freebsd-amd64), const NOTE_DELETE ideal-int +pkg syscall (freebsd-amd64), const NOTE_EXEC ideal-int +pkg syscall (freebsd-amd64), const NOTE_EXIT ideal-int +pkg syscall (freebsd-amd64), const NOTE_EXTEND ideal-int +pkg syscall (freebsd-amd64), const NOTE_FFAND ideal-int +pkg syscall (freebsd-amd64), const NOTE_FFCOPY ideal-int +pkg syscall (freebsd-amd64), const NOTE_FFCTRLMASK ideal-int +pkg syscall (freebsd-amd64), const NOTE_FFLAGSMASK ideal-int +pkg syscall (freebsd-amd64), const NOTE_FFNOP ideal-int +pkg syscall (freebsd-amd64), const NOTE_FFOR ideal-int +pkg syscall (freebsd-amd64), const NOTE_FORK ideal-int +pkg syscall (freebsd-amd64), const NOTE_LINK ideal-int +pkg syscall (freebsd-amd64), const NOTE_LOWAT ideal-int +pkg syscall (freebsd-amd64), const NOTE_PCTRLMASK ideal-int +pkg syscall (freebsd-amd64), const NOTE_PDATAMASK ideal-int +pkg syscall (freebsd-amd64), const NOTE_RENAME ideal-int +pkg syscall (freebsd-amd64), const NOTE_REVOKE ideal-int +pkg syscall (freebsd-amd64), const NOTE_TRACK ideal-int +pkg syscall (freebsd-amd64), const NOTE_TRACKERR ideal-int +pkg syscall (freebsd-amd64), const NOTE_TRIGGER ideal-int +pkg syscall (freebsd-amd64), const NOTE_WRITE ideal-int +pkg syscall (freebsd-amd64), const O_ACCMODE ideal-int +pkg syscall (freebsd-amd64), const O_DIRECT ideal-int +pkg syscall (freebsd-amd64), const O_DIRECTORY ideal-int +pkg syscall (freebsd-amd64), const O_EXEC ideal-int +pkg syscall (freebsd-amd64), const O_EXLOCK ideal-int +pkg syscall (freebsd-amd64), const O_FSYNC ideal-int +pkg syscall (freebsd-amd64), const O_NDELAY ideal-int +pkg syscall (freebsd-amd64), const O_NOFOLLOW ideal-int +pkg syscall (freebsd-amd64), const O_SHLOCK ideal-int +pkg syscall (freebsd-amd64), const O_TTY_INIT ideal-int +pkg syscall (freebsd-amd64), const PTRACE_CONT ideal-int +pkg syscall (freebsd-amd64), const PTRACE_KILL ideal-int +pkg syscall (freebsd-amd64), const PTRACE_TRACEME ideal-int +pkg syscall (freebsd-amd64), const RLIMIT_AS ideal-int +pkg syscall (freebsd-amd64), const RLIMIT_CORE ideal-int +pkg syscall (freebsd-amd64), const RLIMIT_CPU ideal-int +pkg syscall (freebsd-amd64), const RLIMIT_DATA ideal-int +pkg syscall (freebsd-amd64), const RLIMIT_FSIZE ideal-int +pkg syscall (freebsd-amd64), const RLIMIT_NOFILE ideal-int +pkg syscall (freebsd-amd64), const RLIMIT_STACK ideal-int +pkg syscall (freebsd-amd64), const RLIM_INFINITY ideal-int +pkg syscall (freebsd-amd64), const RTAX_AUTHOR ideal-int +pkg syscall (freebsd-amd64), const RTAX_BRD ideal-int +pkg syscall (freebsd-amd64), const RTAX_DST ideal-int +pkg syscall (freebsd-amd64), const RTAX_GATEWAY ideal-int +pkg syscall (freebsd-amd64), const RTAX_GENMASK ideal-int +pkg syscall (freebsd-amd64), const RTAX_IFA ideal-int +pkg syscall (freebsd-amd64), const RTAX_IFP ideal-int +pkg syscall (freebsd-amd64), const RTAX_MAX ideal-int +pkg syscall (freebsd-amd64), const RTAX_NETMASK ideal-int +pkg syscall (freebsd-amd64), const RTA_AUTHOR ideal-int +pkg syscall (freebsd-amd64), const RTA_BRD ideal-int +pkg syscall (freebsd-amd64), const RTA_DST ideal-int +pkg syscall (freebsd-amd64), const RTA_GATEWAY ideal-int +pkg syscall (freebsd-amd64), const RTA_GENMASK ideal-int +pkg syscall (freebsd-amd64), const RTA_IFA ideal-int +pkg syscall (freebsd-amd64), const RTA_IFP ideal-int +pkg syscall (freebsd-amd64), const RTA_NETMASK ideal-int +pkg syscall (freebsd-amd64), const RTF_BLACKHOLE ideal-int +pkg syscall (freebsd-amd64), const RTF_BROADCAST ideal-int +pkg syscall (freebsd-amd64), const RTF_DONE ideal-int +pkg syscall (freebsd-amd64), const RTF_DYNAMIC ideal-int +pkg syscall (freebsd-amd64), const RTF_FMASK ideal-int +pkg syscall (freebsd-amd64), const RTF_GATEWAY ideal-int +pkg syscall (freebsd-amd64), const RTF_HOST ideal-int +pkg syscall (freebsd-amd64), const RTF_LLDATA ideal-int +pkg syscall (freebsd-amd64), const RTF_LLINFO ideal-int +pkg syscall (freebsd-amd64), const RTF_LOCAL ideal-int +pkg syscall (freebsd-amd64), const RTF_MODIFIED ideal-int +pkg syscall (freebsd-amd64), const RTF_MULTICAST ideal-int +pkg syscall (freebsd-amd64), const RTF_PINNED ideal-int +pkg syscall (freebsd-amd64), const RTF_PRCLONING ideal-int +pkg syscall (freebsd-amd64), const RTF_PROTO1 ideal-int +pkg syscall (freebsd-amd64), const RTF_PROTO2 ideal-int +pkg syscall (freebsd-amd64), const RTF_PROTO3 ideal-int +pkg syscall (freebsd-amd64), const RTF_REJECT ideal-int +pkg syscall (freebsd-amd64), const RTF_RNH_LOCKED ideal-int +pkg syscall (freebsd-amd64), const RTF_STATIC ideal-int +pkg syscall (freebsd-amd64), const RTF_STICKY ideal-int +pkg syscall (freebsd-amd64), const RTF_UP ideal-int +pkg syscall (freebsd-amd64), const RTF_XRESOLVE ideal-int +pkg syscall (freebsd-amd64), const RTM_ADD ideal-int +pkg syscall (freebsd-amd64), const RTM_CHANGE ideal-int +pkg syscall (freebsd-amd64), const RTM_DELADDR ideal-int +pkg syscall (freebsd-amd64), const RTM_DELETE ideal-int +pkg syscall (freebsd-amd64), const RTM_DELMADDR ideal-int +pkg syscall (freebsd-amd64), const RTM_GET ideal-int +pkg syscall (freebsd-amd64), const RTM_IEEE80211 ideal-int +pkg syscall (freebsd-amd64), const RTM_IFANNOUNCE ideal-int +pkg syscall (freebsd-amd64), const RTM_IFINFO ideal-int +pkg syscall (freebsd-amd64), const RTM_LOCK ideal-int +pkg syscall (freebsd-amd64), const RTM_LOSING ideal-int +pkg syscall (freebsd-amd64), const RTM_MISS ideal-int +pkg syscall (freebsd-amd64), const RTM_NEWADDR ideal-int +pkg syscall (freebsd-amd64), const RTM_NEWMADDR ideal-int +pkg syscall (freebsd-amd64), const RTM_OLDADD ideal-int +pkg syscall (freebsd-amd64), const RTM_OLDDEL ideal-int +pkg syscall (freebsd-amd64), const RTM_REDIRECT ideal-int +pkg syscall (freebsd-amd64), const RTM_RESOLVE ideal-int +pkg syscall (freebsd-amd64), const RTM_RTTUNIT ideal-int +pkg syscall (freebsd-amd64), const RTM_VERSION ideal-int +pkg syscall (freebsd-amd64), const RTV_EXPIRE ideal-int +pkg syscall (freebsd-amd64), const RTV_HOPCOUNT ideal-int +pkg syscall (freebsd-amd64), const RTV_MTU ideal-int +pkg syscall (freebsd-amd64), const RTV_RPIPE ideal-int +pkg syscall (freebsd-amd64), const RTV_RTT ideal-int +pkg syscall (freebsd-amd64), const RTV_RTTVAR ideal-int +pkg syscall (freebsd-amd64), const RTV_SPIPE ideal-int +pkg syscall (freebsd-amd64), const RTV_SSTHRESH ideal-int +pkg syscall (freebsd-amd64), const RTV_WEIGHT ideal-int +pkg syscall (freebsd-amd64), const RUSAGE_CHILDREN ideal-int +pkg syscall (freebsd-amd64), const RUSAGE_SELF ideal-int +pkg syscall (freebsd-amd64), const RUSAGE_THREAD ideal-int +pkg syscall (freebsd-amd64), const SCM_BINTIME ideal-int +pkg syscall (freebsd-amd64), const SCM_CREDS ideal-int +pkg syscall (freebsd-amd64), const SCM_RIGHTS ideal-int +pkg syscall (freebsd-amd64), const SCM_TIMESTAMP ideal-int +pkg syscall (freebsd-amd64), const SIGCHLD Signal +pkg syscall (freebsd-amd64), const SIGCONT Signal +pkg syscall (freebsd-amd64), const SIGEMT Signal +pkg syscall (freebsd-amd64), const SIGINFO Signal +pkg syscall (freebsd-amd64), const SIGIO Signal +pkg syscall (freebsd-amd64), const SIGIOT Signal +pkg syscall (freebsd-amd64), const SIGLWP Signal +pkg syscall (freebsd-amd64), const SIGPROF Signal +pkg syscall (freebsd-amd64), const SIGSTOP Signal +pkg syscall (freebsd-amd64), const SIGSYS Signal +pkg syscall (freebsd-amd64), const SIGTHR Signal +pkg syscall (freebsd-amd64), const SIGTSTP Signal +pkg syscall (freebsd-amd64), const SIGTTIN Signal +pkg syscall (freebsd-amd64), const SIGTTOU Signal +pkg syscall (freebsd-amd64), const SIGURG Signal +pkg syscall (freebsd-amd64), const SIGUSR1 Signal +pkg syscall (freebsd-amd64), const SIGUSR2 Signal +pkg syscall (freebsd-amd64), const SIGVTALRM Signal +pkg syscall (freebsd-amd64), const SIGWINCH Signal +pkg syscall (freebsd-amd64), const SIGXCPU Signal +pkg syscall (freebsd-amd64), const SIGXFSZ Signal +pkg syscall (freebsd-amd64), const SIOCADDMULTI ideal-int +pkg syscall (freebsd-amd64), const SIOCADDRT ideal-int +pkg syscall (freebsd-amd64), const SIOCAIFADDR ideal-int +pkg syscall (freebsd-amd64), const SIOCAIFGROUP ideal-int +pkg syscall (freebsd-amd64), const SIOCALIFADDR ideal-int +pkg syscall (freebsd-amd64), const SIOCATMARK ideal-int +pkg syscall (freebsd-amd64), const SIOCDELMULTI ideal-int +pkg syscall (freebsd-amd64), const SIOCDELRT ideal-int +pkg syscall (freebsd-amd64), const SIOCDIFADDR ideal-int +pkg syscall (freebsd-amd64), const SIOCDIFGROUP ideal-int +pkg syscall (freebsd-amd64), const SIOCDIFPHYADDR ideal-int +pkg syscall (freebsd-amd64), const SIOCDLIFADDR ideal-int +pkg syscall (freebsd-amd64), const SIOCGDRVSPEC ideal-int +pkg syscall (freebsd-amd64), const SIOCGETSGCNT ideal-int +pkg syscall (freebsd-amd64), const SIOCGETVIFCNT ideal-int +pkg syscall (freebsd-amd64), const SIOCGHIWAT ideal-int +pkg syscall (freebsd-amd64), const SIOCGIFADDR ideal-int +pkg syscall (freebsd-amd64), const SIOCGIFBRDADDR ideal-int +pkg syscall (freebsd-amd64), const SIOCGIFCAP ideal-int +pkg syscall (freebsd-amd64), const SIOCGIFCONF ideal-int +pkg syscall (freebsd-amd64), const SIOCGIFDESCR ideal-int +pkg syscall (freebsd-amd64), const SIOCGIFDSTADDR ideal-int +pkg syscall (freebsd-amd64), const SIOCGIFFLAGS ideal-int +pkg syscall (freebsd-amd64), const SIOCGIFGENERIC ideal-int +pkg syscall (freebsd-amd64), const SIOCGIFGMEMB ideal-int +pkg syscall (freebsd-amd64), const SIOCGIFGROUP ideal-int +pkg syscall (freebsd-amd64), const SIOCGIFINDEX ideal-int +pkg syscall (freebsd-amd64), const SIOCGIFMAC ideal-int +pkg syscall (freebsd-amd64), const SIOCGIFMEDIA ideal-int +pkg syscall (freebsd-amd64), const SIOCGIFMETRIC ideal-int +pkg syscall (freebsd-amd64), const SIOCGIFMTU ideal-int +pkg syscall (freebsd-amd64), const SIOCGIFNETMASK ideal-int +pkg syscall (freebsd-amd64), const SIOCGIFPDSTADDR ideal-int +pkg syscall (freebsd-amd64), const SIOCGIFPHYS ideal-int +pkg syscall (freebsd-amd64), const SIOCGIFPSRCADDR ideal-int +pkg syscall (freebsd-amd64), const SIOCGIFSTATUS ideal-int +pkg syscall (freebsd-amd64), const SIOCGLIFADDR ideal-int +pkg syscall (freebsd-amd64), const SIOCGLIFPHYADDR ideal-int +pkg syscall (freebsd-amd64), const SIOCGLOWAT ideal-int +pkg syscall (freebsd-amd64), const SIOCGPGRP ideal-int +pkg syscall (freebsd-amd64), const SIOCGPRIVATE_0 ideal-int +pkg syscall (freebsd-amd64), const SIOCGPRIVATE_1 ideal-int +pkg syscall (freebsd-amd64), const SIOCIFCREATE ideal-int +pkg syscall (freebsd-amd64), const SIOCIFCREATE2 ideal-int +pkg syscall (freebsd-amd64), const SIOCIFDESTROY ideal-int +pkg syscall (freebsd-amd64), const SIOCIFGCLONERS ideal-int +pkg syscall (freebsd-amd64), const SIOCSDRVSPEC ideal-int +pkg syscall (freebsd-amd64), const SIOCSHIWAT ideal-int +pkg syscall (freebsd-amd64), const SIOCSIFADDR ideal-int +pkg syscall (freebsd-amd64), const SIOCSIFBRDADDR ideal-int +pkg syscall (freebsd-amd64), const SIOCSIFCAP ideal-int +pkg syscall (freebsd-amd64), const SIOCSIFDESCR ideal-int +pkg syscall (freebsd-amd64), const SIOCSIFDSTADDR ideal-int +pkg syscall (freebsd-amd64), const SIOCSIFFLAGS ideal-int +pkg syscall (freebsd-amd64), const SIOCSIFGENERIC ideal-int +pkg syscall (freebsd-amd64), const SIOCSIFLLADDR ideal-int +pkg syscall (freebsd-amd64), const SIOCSIFMAC ideal-int +pkg syscall (freebsd-amd64), const SIOCSIFMEDIA ideal-int +pkg syscall (freebsd-amd64), const SIOCSIFMETRIC ideal-int +pkg syscall (freebsd-amd64), const SIOCSIFMTU ideal-int +pkg syscall (freebsd-amd64), const SIOCSIFNAME ideal-int +pkg syscall (freebsd-amd64), const SIOCSIFNETMASK ideal-int +pkg syscall (freebsd-amd64), const SIOCSIFPHYADDR ideal-int +pkg syscall (freebsd-amd64), const SIOCSIFPHYS ideal-int +pkg syscall (freebsd-amd64), const SIOCSIFRVNET ideal-int +pkg syscall (freebsd-amd64), const SIOCSIFVNET ideal-int +pkg syscall (freebsd-amd64), const SIOCSLIFPHYADDR ideal-int +pkg syscall (freebsd-amd64), const SIOCSLOWAT ideal-int +pkg syscall (freebsd-amd64), const SIOCSPGRP ideal-int +pkg syscall (freebsd-amd64), const SOCK_MAXADDRLEN ideal-int +pkg syscall (freebsd-amd64), const SOCK_RDM ideal-int +pkg syscall (freebsd-amd64), const SO_ACCEPTCONN ideal-int +pkg syscall (freebsd-amd64), const SO_ACCEPTFILTER ideal-int +pkg syscall (freebsd-amd64), const SO_BINTIME ideal-int +pkg syscall (freebsd-amd64), const SO_DEBUG ideal-int +pkg syscall (freebsd-amd64), const SO_ERROR ideal-int +pkg syscall (freebsd-amd64), const SO_LABEL ideal-int +pkg syscall (freebsd-amd64), const SO_LISTENINCQLEN ideal-int +pkg syscall (freebsd-amd64), const SO_LISTENQLEN ideal-int +pkg syscall (freebsd-amd64), const SO_LISTENQLIMIT ideal-int +pkg syscall (freebsd-amd64), const SO_NOSIGPIPE ideal-int +pkg syscall (freebsd-amd64), const SO_NO_DDP ideal-int +pkg syscall (freebsd-amd64), const SO_NO_OFFLOAD ideal-int +pkg syscall (freebsd-amd64), const SO_OOBINLINE ideal-int +pkg syscall (freebsd-amd64), const SO_PEERLABEL ideal-int +pkg syscall (freebsd-amd64), const SO_RCVLOWAT ideal-int +pkg syscall (freebsd-amd64), const SO_RCVTIMEO ideal-int +pkg syscall (freebsd-amd64), const SO_REUSEPORT ideal-int +pkg syscall (freebsd-amd64), const SO_SETFIB ideal-int +pkg syscall (freebsd-amd64), const SO_SNDLOWAT ideal-int +pkg syscall (freebsd-amd64), const SO_SNDTIMEO ideal-int +pkg syscall (freebsd-amd64), const SO_TIMESTAMP ideal-int +pkg syscall (freebsd-amd64), const SO_TYPE ideal-int +pkg syscall (freebsd-amd64), const SO_USELOOPBACK ideal-int +pkg syscall (freebsd-amd64), const SYS_ABORT2 ideal-int +pkg syscall (freebsd-amd64), const SYS_ACCEPT ideal-int +pkg syscall (freebsd-amd64), const SYS_ACCESS ideal-int +pkg syscall (freebsd-amd64), const SYS_ACCT ideal-int +pkg syscall (freebsd-amd64), const SYS_ADJTIME ideal-int +pkg syscall (freebsd-amd64), const SYS_AUDIT ideal-int +pkg syscall (freebsd-amd64), const SYS_AUDITCTL ideal-int +pkg syscall (freebsd-amd64), const SYS_AUDITON ideal-int +pkg syscall (freebsd-amd64), const SYS_BIND ideal-int +pkg syscall (freebsd-amd64), const SYS_CAP_ENTER ideal-int +pkg syscall (freebsd-amd64), const SYS_CAP_GETMODE ideal-int +pkg syscall (freebsd-amd64), const SYS_CAP_GETRIGHTS ideal-int +pkg syscall (freebsd-amd64), const SYS_CAP_NEW ideal-int +pkg syscall (freebsd-amd64), const SYS_CHDIR ideal-int +pkg syscall (freebsd-amd64), const SYS_CHFLAGS ideal-int +pkg syscall (freebsd-amd64), const SYS_CHMOD ideal-int +pkg syscall (freebsd-amd64), const SYS_CHOWN ideal-int +pkg syscall (freebsd-amd64), const SYS_CHROOT ideal-int +pkg syscall (freebsd-amd64), const SYS_CLOCK_GETRES ideal-int +pkg syscall (freebsd-amd64), const SYS_CLOCK_GETTIME ideal-int +pkg syscall (freebsd-amd64), const SYS_CLOCK_SETTIME ideal-int +pkg syscall (freebsd-amd64), const SYS_CLOSE ideal-int +pkg syscall (freebsd-amd64), const SYS_CLOSEFROM ideal-int +pkg syscall (freebsd-amd64), const SYS_CONNECT ideal-int +pkg syscall (freebsd-amd64), const SYS_CPUSET ideal-int +pkg syscall (freebsd-amd64), const SYS_CPUSET_GETAFFINITY ideal-int +pkg syscall (freebsd-amd64), const SYS_CPUSET_GETID ideal-int +pkg syscall (freebsd-amd64), const SYS_CPUSET_SETAFFINITY ideal-int +pkg syscall (freebsd-amd64), const SYS_CPUSET_SETID ideal-int +pkg syscall (freebsd-amd64), const SYS_DUP ideal-int +pkg syscall (freebsd-amd64), const SYS_DUP2 ideal-int +pkg syscall (freebsd-amd64), const SYS_EACCESS ideal-int +pkg syscall (freebsd-amd64), const SYS_EXECVE ideal-int +pkg syscall (freebsd-amd64), const SYS_EXIT ideal-int +pkg syscall (freebsd-amd64), const SYS_EXTATTRCTL ideal-int +pkg syscall (freebsd-amd64), const SYS_EXTATTR_DELETE_FD ideal-int +pkg syscall (freebsd-amd64), const SYS_EXTATTR_DELETE_FILE ideal-int +pkg syscall (freebsd-amd64), const SYS_EXTATTR_DELETE_LINK ideal-int +pkg syscall (freebsd-amd64), const SYS_EXTATTR_GET_FD ideal-int +pkg syscall (freebsd-amd64), const SYS_EXTATTR_GET_FILE ideal-int +pkg syscall (freebsd-amd64), const SYS_EXTATTR_GET_LINK ideal-int +pkg syscall (freebsd-amd64), const SYS_EXTATTR_LIST_FD ideal-int +pkg syscall (freebsd-amd64), const SYS_EXTATTR_LIST_FILE ideal-int +pkg syscall (freebsd-amd64), const SYS_EXTATTR_LIST_LINK ideal-int +pkg syscall (freebsd-amd64), const SYS_EXTATTR_SET_FD ideal-int +pkg syscall (freebsd-amd64), const SYS_EXTATTR_SET_FILE ideal-int +pkg syscall (freebsd-amd64), const SYS_EXTATTR_SET_LINK ideal-int +pkg syscall (freebsd-amd64), const SYS_FACCESSAT ideal-int +pkg syscall (freebsd-amd64), const SYS_FCHDIR ideal-int +pkg syscall (freebsd-amd64), const SYS_FCHFLAGS ideal-int +pkg syscall (freebsd-amd64), const SYS_FCHMOD ideal-int +pkg syscall (freebsd-amd64), const SYS_FCHMODAT ideal-int +pkg syscall (freebsd-amd64), const SYS_FCHOWN ideal-int +pkg syscall (freebsd-amd64), const SYS_FCHOWNAT ideal-int +pkg syscall (freebsd-amd64), const SYS_FCNTL ideal-int +pkg syscall (freebsd-amd64), const SYS_FEXECVE ideal-int +pkg syscall (freebsd-amd64), const SYS_FFCLOCK_GETCOUNTER ideal-int +pkg syscall (freebsd-amd64), const SYS_FFCLOCK_GETESTIMATE ideal-int +pkg syscall (freebsd-amd64), const SYS_FFCLOCK_SETESTIMATE ideal-int +pkg syscall (freebsd-amd64), const SYS_FHOPEN ideal-int +pkg syscall (freebsd-amd64), const SYS_FHSTAT ideal-int +pkg syscall (freebsd-amd64), const SYS_FHSTATFS ideal-int +pkg syscall (freebsd-amd64), const SYS_FLOCK ideal-int +pkg syscall (freebsd-amd64), const SYS_FORK ideal-int +pkg syscall (freebsd-amd64), const SYS_FPATHCONF ideal-int +pkg syscall (freebsd-amd64), const SYS_FREEBSD6_FTRUNCATE ideal-int +pkg syscall (freebsd-amd64), const SYS_FREEBSD6_LSEEK ideal-int +pkg syscall (freebsd-amd64), const SYS_FREEBSD6_MMAP ideal-int +pkg syscall (freebsd-amd64), const SYS_FREEBSD6_PREAD ideal-int +pkg syscall (freebsd-amd64), const SYS_FREEBSD6_PWRITE ideal-int +pkg syscall (freebsd-amd64), const SYS_FREEBSD6_TRUNCATE ideal-int +pkg syscall (freebsd-amd64), const SYS_FSTAT ideal-int +pkg syscall (freebsd-amd64), const SYS_FSTATAT ideal-int +pkg syscall (freebsd-amd64), const SYS_FSTATFS ideal-int +pkg syscall (freebsd-amd64), const SYS_FSYNC ideal-int +pkg syscall (freebsd-amd64), const SYS_FTRUNCATE ideal-int +pkg syscall (freebsd-amd64), const SYS_FUTIMES ideal-int +pkg syscall (freebsd-amd64), const SYS_FUTIMESAT ideal-int +pkg syscall (freebsd-amd64), const SYS_GETAUDIT ideal-int +pkg syscall (freebsd-amd64), const SYS_GETAUDIT_ADDR ideal-int +pkg syscall (freebsd-amd64), const SYS_GETAUID ideal-int +pkg syscall (freebsd-amd64), const SYS_GETCONTEXT ideal-int +pkg syscall (freebsd-amd64), const SYS_GETDENTS ideal-int +pkg syscall (freebsd-amd64), const SYS_GETDIRENTRIES ideal-int +pkg syscall (freebsd-amd64), const SYS_GETDTABLESIZE ideal-int +pkg syscall (freebsd-amd64), const SYS_GETEGID ideal-int +pkg syscall (freebsd-amd64), const SYS_GETEUID ideal-int +pkg syscall (freebsd-amd64), const SYS_GETFH ideal-int +pkg syscall (freebsd-amd64), const SYS_GETFSSTAT ideal-int +pkg syscall (freebsd-amd64), const SYS_GETGID ideal-int +pkg syscall (freebsd-amd64), const SYS_GETGROUPS ideal-int +pkg syscall (freebsd-amd64), const SYS_GETITIMER ideal-int +pkg syscall (freebsd-amd64), const SYS_GETLOGIN ideal-int +pkg syscall (freebsd-amd64), const SYS_GETLOGINCLASS ideal-int +pkg syscall (freebsd-amd64), const SYS_GETPEERNAME ideal-int +pkg syscall (freebsd-amd64), const SYS_GETPGID ideal-int +pkg syscall (freebsd-amd64), const SYS_GETPGRP ideal-int +pkg syscall (freebsd-amd64), const SYS_GETPID ideal-int +pkg syscall (freebsd-amd64), const SYS_GETPPID ideal-int +pkg syscall (freebsd-amd64), const SYS_GETPRIORITY ideal-int +pkg syscall (freebsd-amd64), const SYS_GETRESGID ideal-int +pkg syscall (freebsd-amd64), const SYS_GETRESUID ideal-int +pkg syscall (freebsd-amd64), const SYS_GETRLIMIT ideal-int +pkg syscall (freebsd-amd64), const SYS_GETRUSAGE ideal-int +pkg syscall (freebsd-amd64), const SYS_GETSID ideal-int +pkg syscall (freebsd-amd64), const SYS_GETSOCKNAME ideal-int +pkg syscall (freebsd-amd64), const SYS_GETSOCKOPT ideal-int +pkg syscall (freebsd-amd64), const SYS_GETTIMEOFDAY ideal-int +pkg syscall (freebsd-amd64), const SYS_GETUID ideal-int +pkg syscall (freebsd-amd64), const SYS_IOCTL ideal-int +pkg syscall (freebsd-amd64), const SYS_ISSETUGID ideal-int +pkg syscall (freebsd-amd64), const SYS_JAIL ideal-int +pkg syscall (freebsd-amd64), const SYS_JAIL_ATTACH ideal-int +pkg syscall (freebsd-amd64), const SYS_JAIL_GET ideal-int +pkg syscall (freebsd-amd64), const SYS_JAIL_REMOVE ideal-int +pkg syscall (freebsd-amd64), const SYS_JAIL_SET ideal-int +pkg syscall (freebsd-amd64), const SYS_KENV ideal-int +pkg syscall (freebsd-amd64), const SYS_KEVENT ideal-int +pkg syscall (freebsd-amd64), const SYS_KILL ideal-int +pkg syscall (freebsd-amd64), const SYS_KLDFIND ideal-int +pkg syscall (freebsd-amd64), const SYS_KLDFIRSTMOD ideal-int +pkg syscall (freebsd-amd64), const SYS_KLDLOAD ideal-int +pkg syscall (freebsd-amd64), const SYS_KLDNEXT ideal-int +pkg syscall (freebsd-amd64), const SYS_KLDSTAT ideal-int +pkg syscall (freebsd-amd64), const SYS_KLDSYM ideal-int +pkg syscall (freebsd-amd64), const SYS_KLDUNLOAD ideal-int +pkg syscall (freebsd-amd64), const SYS_KLDUNLOADF ideal-int +pkg syscall (freebsd-amd64), const SYS_KQUEUE ideal-int +pkg syscall (freebsd-amd64), const SYS_KTIMER_CREATE ideal-int +pkg syscall (freebsd-amd64), const SYS_KTIMER_DELETE ideal-int +pkg syscall (freebsd-amd64), const SYS_KTIMER_GETOVERRUN ideal-int +pkg syscall (freebsd-amd64), const SYS_KTIMER_GETTIME ideal-int +pkg syscall (freebsd-amd64), const SYS_KTIMER_SETTIME ideal-int +pkg syscall (freebsd-amd64), const SYS_KTRACE ideal-int +pkg syscall (freebsd-amd64), const SYS_LCHFLAGS ideal-int +pkg syscall (freebsd-amd64), const SYS_LCHMOD ideal-int +pkg syscall (freebsd-amd64), const SYS_LCHOWN ideal-int +pkg syscall (freebsd-amd64), const SYS_LGETFH ideal-int +pkg syscall (freebsd-amd64), const SYS_LINK ideal-int +pkg syscall (freebsd-amd64), const SYS_LINKAT ideal-int +pkg syscall (freebsd-amd64), const SYS_LISTEN ideal-int +pkg syscall (freebsd-amd64), const SYS_LPATHCONF ideal-int +pkg syscall (freebsd-amd64), const SYS_LSEEK ideal-int +pkg syscall (freebsd-amd64), const SYS_LSTAT ideal-int +pkg syscall (freebsd-amd64), const SYS_LUTIMES ideal-int +pkg syscall (freebsd-amd64), const SYS_MAC_SYSCALL ideal-int +pkg syscall (freebsd-amd64), const SYS_MADVISE ideal-int +pkg syscall (freebsd-amd64), const SYS_MINCORE ideal-int +pkg syscall (freebsd-amd64), const SYS_MINHERIT ideal-int +pkg syscall (freebsd-amd64), const SYS_MKDIR ideal-int +pkg syscall (freebsd-amd64), const SYS_MKDIRAT ideal-int +pkg syscall (freebsd-amd64), const SYS_MKFIFO ideal-int +pkg syscall (freebsd-amd64), const SYS_MKFIFOAT ideal-int +pkg syscall (freebsd-amd64), const SYS_MKNOD ideal-int +pkg syscall (freebsd-amd64), const SYS_MKNODAT ideal-int +pkg syscall (freebsd-amd64), const SYS_MLOCK ideal-int +pkg syscall (freebsd-amd64), const SYS_MLOCKALL ideal-int +pkg syscall (freebsd-amd64), const SYS_MMAP ideal-int +pkg syscall (freebsd-amd64), const SYS_MODFIND ideal-int +pkg syscall (freebsd-amd64), const SYS_MODFNEXT ideal-int +pkg syscall (freebsd-amd64), const SYS_MODNEXT ideal-int +pkg syscall (freebsd-amd64), const SYS_MODSTAT ideal-int +pkg syscall (freebsd-amd64), const SYS_MOUNT ideal-int +pkg syscall (freebsd-amd64), const SYS_MPROTECT ideal-int +pkg syscall (freebsd-amd64), const SYS_MSYNC ideal-int +pkg syscall (freebsd-amd64), const SYS_MUNLOCK ideal-int +pkg syscall (freebsd-amd64), const SYS_MUNLOCKALL ideal-int +pkg syscall (freebsd-amd64), const SYS_MUNMAP ideal-int +pkg syscall (freebsd-amd64), const SYS_NANOSLEEP ideal-int +pkg syscall (freebsd-amd64), const SYS_NFSTAT ideal-int +pkg syscall (freebsd-amd64), const SYS_NLSTAT ideal-int +pkg syscall (freebsd-amd64), const SYS_NMOUNT ideal-int +pkg syscall (freebsd-amd64), const SYS_NSTAT ideal-int +pkg syscall (freebsd-amd64), const SYS_NTP_ADJTIME ideal-int +pkg syscall (freebsd-amd64), const SYS_NTP_GETTIME ideal-int +pkg syscall (freebsd-amd64), const SYS_OBREAK ideal-int +pkg syscall (freebsd-amd64), const SYS_OPEN ideal-int +pkg syscall (freebsd-amd64), const SYS_OPENAT ideal-int +pkg syscall (freebsd-amd64), const SYS_OPENBSD_POLL ideal-int +pkg syscall (freebsd-amd64), const SYS_OVADVISE ideal-int +pkg syscall (freebsd-amd64), const SYS_PATHCONF ideal-int +pkg syscall (freebsd-amd64), const SYS_PDFORK ideal-int +pkg syscall (freebsd-amd64), const SYS_PDGETPID ideal-int +pkg syscall (freebsd-amd64), const SYS_PDKILL ideal-int +pkg syscall (freebsd-amd64), const SYS_PIPE ideal-int +pkg syscall (freebsd-amd64), const SYS_POLL ideal-int +pkg syscall (freebsd-amd64), const SYS_POSIX_FADVISE ideal-int +pkg syscall (freebsd-amd64), const SYS_POSIX_FALLOCATE ideal-int +pkg syscall (freebsd-amd64), const SYS_POSIX_OPENPT ideal-int +pkg syscall (freebsd-amd64), const SYS_PREAD ideal-int +pkg syscall (freebsd-amd64), const SYS_PREADV ideal-int +pkg syscall (freebsd-amd64), const SYS_PROFIL ideal-int +pkg syscall (freebsd-amd64), const SYS_PSELECT ideal-int +pkg syscall (freebsd-amd64), const SYS_PTRACE ideal-int +pkg syscall (freebsd-amd64), const SYS_PWRITE ideal-int +pkg syscall (freebsd-amd64), const SYS_PWRITEV ideal-int +pkg syscall (freebsd-amd64), const SYS_QUOTACTL ideal-int +pkg syscall (freebsd-amd64), const SYS_RCTL_ADD_RULE ideal-int +pkg syscall (freebsd-amd64), const SYS_RCTL_GET_LIMITS ideal-int +pkg syscall (freebsd-amd64), const SYS_RCTL_GET_RACCT ideal-int +pkg syscall (freebsd-amd64), const SYS_RCTL_GET_RULES ideal-int +pkg syscall (freebsd-amd64), const SYS_RCTL_REMOVE_RULE ideal-int +pkg syscall (freebsd-amd64), const SYS_READ ideal-int +pkg syscall (freebsd-amd64), const SYS_READLINK ideal-int +pkg syscall (freebsd-amd64), const SYS_READLINKAT ideal-int +pkg syscall (freebsd-amd64), const SYS_READV ideal-int +pkg syscall (freebsd-amd64), const SYS_REBOOT ideal-int +pkg syscall (freebsd-amd64), const SYS_RECVFROM ideal-int +pkg syscall (freebsd-amd64), const SYS_RECVMSG ideal-int +pkg syscall (freebsd-amd64), const SYS_RENAME ideal-int +pkg syscall (freebsd-amd64), const SYS_RENAMEAT ideal-int +pkg syscall (freebsd-amd64), const SYS_REVOKE ideal-int +pkg syscall (freebsd-amd64), const SYS_RFORK ideal-int +pkg syscall (freebsd-amd64), const SYS_RMDIR ideal-int +pkg syscall (freebsd-amd64), const SYS_RTPRIO ideal-int +pkg syscall (freebsd-amd64), const SYS_RTPRIO_THREAD ideal-int +pkg syscall (freebsd-amd64), const SYS_SBRK ideal-int +pkg syscall (freebsd-amd64), const SYS_SCHED_GETPARAM ideal-int +pkg syscall (freebsd-amd64), const SYS_SCHED_GETSCHEDULER ideal-int +pkg syscall (freebsd-amd64), const SYS_SCHED_GET_PRIORITY_MAX ideal-int +pkg syscall (freebsd-amd64), const SYS_SCHED_GET_PRIORITY_MIN ideal-int +pkg syscall (freebsd-amd64), const SYS_SCHED_RR_GET_INTERVAL ideal-int +pkg syscall (freebsd-amd64), const SYS_SCHED_SETPARAM ideal-int +pkg syscall (freebsd-amd64), const SYS_SCHED_SETSCHEDULER ideal-int +pkg syscall (freebsd-amd64), const SYS_SCHED_YIELD ideal-int +pkg syscall (freebsd-amd64), const SYS_SCTP_GENERIC_RECVMSG ideal-int +pkg syscall (freebsd-amd64), const SYS_SCTP_GENERIC_SENDMSG ideal-int +pkg syscall (freebsd-amd64), const SYS_SCTP_GENERIC_SENDMSG_IOV ideal-int +pkg syscall (freebsd-amd64), const SYS_SCTP_PEELOFF ideal-int +pkg syscall (freebsd-amd64), const SYS_SELECT ideal-int +pkg syscall (freebsd-amd64), const SYS_SENDFILE ideal-int +pkg syscall (freebsd-amd64), const SYS_SENDMSG ideal-int +pkg syscall (freebsd-amd64), const SYS_SENDTO ideal-int +pkg syscall (freebsd-amd64), const SYS_SETAUDIT ideal-int +pkg syscall (freebsd-amd64), const SYS_SETAUDIT_ADDR ideal-int +pkg syscall (freebsd-amd64), const SYS_SETAUID ideal-int +pkg syscall (freebsd-amd64), const SYS_SETCONTEXT ideal-int +pkg syscall (freebsd-amd64), const SYS_SETEGID ideal-int +pkg syscall (freebsd-amd64), const SYS_SETEUID ideal-int +pkg syscall (freebsd-amd64), const SYS_SETFIB ideal-int +pkg syscall (freebsd-amd64), const SYS_SETGID ideal-int +pkg syscall (freebsd-amd64), const SYS_SETGROUPS ideal-int +pkg syscall (freebsd-amd64), const SYS_SETITIMER ideal-int +pkg syscall (freebsd-amd64), const SYS_SETLOGIN ideal-int +pkg syscall (freebsd-amd64), const SYS_SETLOGINCLASS ideal-int +pkg syscall (freebsd-amd64), const SYS_SETPGID ideal-int +pkg syscall (freebsd-amd64), const SYS_SETPRIORITY ideal-int +pkg syscall (freebsd-amd64), const SYS_SETREGID ideal-int +pkg syscall (freebsd-amd64), const SYS_SETRESGID ideal-int +pkg syscall (freebsd-amd64), const SYS_SETRESUID ideal-int +pkg syscall (freebsd-amd64), const SYS_SETREUID ideal-int +pkg syscall (freebsd-amd64), const SYS_SETRLIMIT ideal-int +pkg syscall (freebsd-amd64), const SYS_SETSID ideal-int +pkg syscall (freebsd-amd64), const SYS_SETSOCKOPT ideal-int +pkg syscall (freebsd-amd64), const SYS_SETTIMEOFDAY ideal-int +pkg syscall (freebsd-amd64), const SYS_SETUID ideal-int +pkg syscall (freebsd-amd64), const SYS_SHM_OPEN ideal-int +pkg syscall (freebsd-amd64), const SYS_SHM_UNLINK ideal-int +pkg syscall (freebsd-amd64), const SYS_SHUTDOWN ideal-int +pkg syscall (freebsd-amd64), const SYS_SIGACTION ideal-int +pkg syscall (freebsd-amd64), const SYS_SIGALTSTACK ideal-int +pkg syscall (freebsd-amd64), const SYS_SIGPENDING ideal-int +pkg syscall (freebsd-amd64), const SYS_SIGPROCMASK ideal-int +pkg syscall (freebsd-amd64), const SYS_SIGQUEUE ideal-int +pkg syscall (freebsd-amd64), const SYS_SIGRETURN ideal-int +pkg syscall (freebsd-amd64), const SYS_SIGSUSPEND ideal-int +pkg syscall (freebsd-amd64), const SYS_SIGTIMEDWAIT ideal-int +pkg syscall (freebsd-amd64), const SYS_SIGWAIT ideal-int +pkg syscall (freebsd-amd64), const SYS_SIGWAITINFO ideal-int +pkg syscall (freebsd-amd64), const SYS_SOCKET ideal-int +pkg syscall (freebsd-amd64), const SYS_SOCKETPAIR ideal-int +pkg syscall (freebsd-amd64), const SYS_SSTK ideal-int +pkg syscall (freebsd-amd64), const SYS_STAT ideal-int +pkg syscall (freebsd-amd64), const SYS_STATFS ideal-int +pkg syscall (freebsd-amd64), const SYS_SWAPCONTEXT ideal-int +pkg syscall (freebsd-amd64), const SYS_SWAPOFF ideal-int +pkg syscall (freebsd-amd64), const SYS_SWAPON ideal-int +pkg syscall (freebsd-amd64), const SYS_SYMLINK ideal-int +pkg syscall (freebsd-amd64), const SYS_SYMLINKAT ideal-int +pkg syscall (freebsd-amd64), const SYS_SYNC ideal-int +pkg syscall (freebsd-amd64), const SYS_SYSARCH ideal-int +pkg syscall (freebsd-amd64), const SYS_THR_CREATE ideal-int +pkg syscall (freebsd-amd64), const SYS_THR_EXIT ideal-int +pkg syscall (freebsd-amd64), const SYS_THR_KILL ideal-int +pkg syscall (freebsd-amd64), const SYS_THR_KILL2 ideal-int +pkg syscall (freebsd-amd64), const SYS_THR_NEW ideal-int +pkg syscall (freebsd-amd64), const SYS_THR_SELF ideal-int +pkg syscall (freebsd-amd64), const SYS_THR_SET_NAME ideal-int +pkg syscall (freebsd-amd64), const SYS_THR_SUSPEND ideal-int +pkg syscall (freebsd-amd64), const SYS_THR_WAKE ideal-int +pkg syscall (freebsd-amd64), const SYS_TRUNCATE ideal-int +pkg syscall (freebsd-amd64), const SYS_UMASK ideal-int +pkg syscall (freebsd-amd64), const SYS_UNDELETE ideal-int +pkg syscall (freebsd-amd64), const SYS_UNLINK ideal-int +pkg syscall (freebsd-amd64), const SYS_UNLINKAT ideal-int +pkg syscall (freebsd-amd64), const SYS_UNMOUNT ideal-int +pkg syscall (freebsd-amd64), const SYS_UTIMES ideal-int +pkg syscall (freebsd-amd64), const SYS_UTRACE ideal-int +pkg syscall (freebsd-amd64), const SYS_UUIDGEN ideal-int +pkg syscall (freebsd-amd64), const SYS_VFORK ideal-int +pkg syscall (freebsd-amd64), const SYS_WAIT4 ideal-int +pkg syscall (freebsd-amd64), const SYS_WRITE ideal-int +pkg syscall (freebsd-amd64), const SYS_WRITEV ideal-int +pkg syscall (freebsd-amd64), const SYS_YIELD ideal-int +pkg syscall (freebsd-amd64), const SYS__UMTX_LOCK ideal-int +pkg syscall (freebsd-amd64), const SYS__UMTX_OP ideal-int +pkg syscall (freebsd-amd64), const SYS__UMTX_UNLOCK ideal-int +pkg syscall (freebsd-amd64), const SYS___ACL_ACLCHECK_FD ideal-int +pkg syscall (freebsd-amd64), const SYS___ACL_ACLCHECK_FILE ideal-int +pkg syscall (freebsd-amd64), const SYS___ACL_ACLCHECK_LINK ideal-int +pkg syscall (freebsd-amd64), const SYS___ACL_DELETE_FD ideal-int +pkg syscall (freebsd-amd64), const SYS___ACL_DELETE_FILE ideal-int +pkg syscall (freebsd-amd64), const SYS___ACL_DELETE_LINK ideal-int +pkg syscall (freebsd-amd64), const SYS___ACL_GET_FD ideal-int +pkg syscall (freebsd-amd64), const SYS___ACL_GET_FILE ideal-int +pkg syscall (freebsd-amd64), const SYS___ACL_GET_LINK ideal-int +pkg syscall (freebsd-amd64), const SYS___ACL_SET_FD ideal-int +pkg syscall (freebsd-amd64), const SYS___ACL_SET_FILE ideal-int +pkg syscall (freebsd-amd64), const SYS___ACL_SET_LINK ideal-int +pkg syscall (freebsd-amd64), const SYS___GETCWD ideal-int +pkg syscall (freebsd-amd64), const SYS___MAC_EXECVE ideal-int +pkg syscall (freebsd-amd64), const SYS___MAC_GET_FD ideal-int +pkg syscall (freebsd-amd64), const SYS___MAC_GET_FILE ideal-int +pkg syscall (freebsd-amd64), const SYS___MAC_GET_LINK ideal-int +pkg syscall (freebsd-amd64), const SYS___MAC_GET_PID ideal-int +pkg syscall (freebsd-amd64), const SYS___MAC_GET_PROC ideal-int +pkg syscall (freebsd-amd64), const SYS___MAC_SET_FD ideal-int +pkg syscall (freebsd-amd64), const SYS___MAC_SET_FILE ideal-int +pkg syscall (freebsd-amd64), const SYS___MAC_SET_LINK ideal-int +pkg syscall (freebsd-amd64), const SYS___MAC_SET_PROC ideal-int +pkg syscall (freebsd-amd64), const SYS___SETUGID ideal-int +pkg syscall (freebsd-amd64), const SYS___SYSCTL ideal-int +pkg syscall (freebsd-amd64), const SizeofBpfHdr ideal-int +pkg syscall (freebsd-amd64), const SizeofBpfInsn ideal-int +pkg syscall (freebsd-amd64), const SizeofBpfProgram ideal-int +pkg syscall (freebsd-amd64), const SizeofBpfStat ideal-int +pkg syscall (freebsd-amd64), const SizeofBpfVersion ideal-int +pkg syscall (freebsd-amd64), const SizeofBpfZbuf ideal-int +pkg syscall (freebsd-amd64), const SizeofBpfZbufHeader ideal-int +pkg syscall (freebsd-amd64), const SizeofCmsghdr ideal-int +pkg syscall (freebsd-amd64), const SizeofIPMreq ideal-int +pkg syscall (freebsd-amd64), const SizeofIPMreqn ideal-int +pkg syscall (freebsd-amd64), const SizeofIPv6Mreq ideal-int +pkg syscall (freebsd-amd64), const SizeofIfData ideal-int +pkg syscall (freebsd-amd64), const SizeofIfMsghdr ideal-int +pkg syscall (freebsd-amd64), const SizeofIfaMsghdr ideal-int +pkg syscall (freebsd-amd64), const SizeofIfmaMsghdr ideal-int +pkg syscall (freebsd-amd64), const SizeofInet6Pktinfo ideal-int +pkg syscall (freebsd-amd64), const SizeofLinger ideal-int +pkg syscall (freebsd-amd64), const SizeofMsghdr ideal-int +pkg syscall (freebsd-amd64), const SizeofRtMetrics ideal-int +pkg syscall (freebsd-amd64), const SizeofRtMsghdr ideal-int +pkg syscall (freebsd-amd64), const SizeofSockaddrAny ideal-int +pkg syscall (freebsd-amd64), const SizeofSockaddrDatalink ideal-int +pkg syscall (freebsd-amd64), const SizeofSockaddrInet4 ideal-int +pkg syscall (freebsd-amd64), const SizeofSockaddrInet6 ideal-int +pkg syscall (freebsd-amd64), const SizeofSockaddrUnix ideal-int +pkg syscall (freebsd-amd64), const TCP_CA_NAME_MAX ideal-int +pkg syscall (freebsd-amd64), const TCP_CONGESTION ideal-int +pkg syscall (freebsd-amd64), const TCP_INFO ideal-int +pkg syscall (freebsd-amd64), const TCP_MAXBURST ideal-int +pkg syscall (freebsd-amd64), const TCP_MAXHLEN ideal-int +pkg syscall (freebsd-amd64), const TCP_MAXOLEN ideal-int +pkg syscall (freebsd-amd64), const TCP_MAXSEG ideal-int +pkg syscall (freebsd-amd64), const TCP_MAXWIN ideal-int +pkg syscall (freebsd-amd64), const TCP_MAX_SACK ideal-int +pkg syscall (freebsd-amd64), const TCP_MAX_WINSHIFT ideal-int +pkg syscall (freebsd-amd64), const TCP_MD5SIG ideal-int +pkg syscall (freebsd-amd64), const TCP_MINMSS ideal-int +pkg syscall (freebsd-amd64), const TCP_MSS ideal-int +pkg syscall (freebsd-amd64), const TCP_NOOPT ideal-int +pkg syscall (freebsd-amd64), const TCP_NOPUSH ideal-int +pkg syscall (freebsd-amd64), const TIOCCBRK ideal-int +pkg syscall (freebsd-amd64), const TIOCCDTR ideal-int +pkg syscall (freebsd-amd64), const TIOCCONS ideal-int +pkg syscall (freebsd-amd64), const TIOCDRAIN ideal-int +pkg syscall (freebsd-amd64), const TIOCEXCL ideal-int +pkg syscall (freebsd-amd64), const TIOCEXT ideal-int +pkg syscall (freebsd-amd64), const TIOCFLUSH ideal-int +pkg syscall (freebsd-amd64), const TIOCGDRAINWAIT ideal-int +pkg syscall (freebsd-amd64), const TIOCGETA ideal-int +pkg syscall (freebsd-amd64), const TIOCGETD ideal-int +pkg syscall (freebsd-amd64), const TIOCGPGRP ideal-int +pkg syscall (freebsd-amd64), const TIOCGPTN ideal-int +pkg syscall (freebsd-amd64), const TIOCGSID ideal-int +pkg syscall (freebsd-amd64), const TIOCGWINSZ ideal-int +pkg syscall (freebsd-amd64), const TIOCMBIC ideal-int +pkg syscall (freebsd-amd64), const TIOCMBIS ideal-int +pkg syscall (freebsd-amd64), const TIOCMGDTRWAIT ideal-int +pkg syscall (freebsd-amd64), const TIOCMGET ideal-int +pkg syscall (freebsd-amd64), const TIOCMSDTRWAIT ideal-int +pkg syscall (freebsd-amd64), const TIOCMSET ideal-int +pkg syscall (freebsd-amd64), const TIOCM_CAR ideal-int +pkg syscall (freebsd-amd64), const TIOCM_CD ideal-int +pkg syscall (freebsd-amd64), const TIOCM_CTS ideal-int +pkg syscall (freebsd-amd64), const TIOCM_DCD ideal-int +pkg syscall (freebsd-amd64), const TIOCM_DSR ideal-int +pkg syscall (freebsd-amd64), const TIOCM_DTR ideal-int +pkg syscall (freebsd-amd64), const TIOCM_LE ideal-int +pkg syscall (freebsd-amd64), const TIOCM_RI ideal-int +pkg syscall (freebsd-amd64), const TIOCM_RNG ideal-int +pkg syscall (freebsd-amd64), const TIOCM_RTS ideal-int +pkg syscall (freebsd-amd64), const TIOCM_SR ideal-int +pkg syscall (freebsd-amd64), const TIOCM_ST ideal-int +pkg syscall (freebsd-amd64), const TIOCNOTTY ideal-int +pkg syscall (freebsd-amd64), const TIOCNXCL ideal-int +pkg syscall (freebsd-amd64), const TIOCOUTQ ideal-int +pkg syscall (freebsd-amd64), const TIOCPKT ideal-int +pkg syscall (freebsd-amd64), const TIOCPKT_DATA ideal-int +pkg syscall (freebsd-amd64), const TIOCPKT_DOSTOP ideal-int +pkg syscall (freebsd-amd64), const TIOCPKT_FLUSHREAD ideal-int +pkg syscall (freebsd-amd64), const TIOCPKT_FLUSHWRITE ideal-int +pkg syscall (freebsd-amd64), const TIOCPKT_IOCTL ideal-int +pkg syscall (freebsd-amd64), const TIOCPKT_NOSTOP ideal-int +pkg syscall (freebsd-amd64), const TIOCPKT_START ideal-int +pkg syscall (freebsd-amd64), const TIOCPKT_STOP ideal-int +pkg syscall (freebsd-amd64), const TIOCPTMASTER ideal-int +pkg syscall (freebsd-amd64), const TIOCSBRK ideal-int +pkg syscall (freebsd-amd64), const TIOCSCTTY ideal-int +pkg syscall (freebsd-amd64), const TIOCSDRAINWAIT ideal-int +pkg syscall (freebsd-amd64), const TIOCSDTR ideal-int +pkg syscall (freebsd-amd64), const TIOCSETA ideal-int +pkg syscall (freebsd-amd64), const TIOCSETAF ideal-int +pkg syscall (freebsd-amd64), const TIOCSETAW ideal-int +pkg syscall (freebsd-amd64), const TIOCSETD ideal-int +pkg syscall (freebsd-amd64), const TIOCSIG ideal-int +pkg syscall (freebsd-amd64), const TIOCSPGRP ideal-int +pkg syscall (freebsd-amd64), const TIOCSTART ideal-int +pkg syscall (freebsd-amd64), const TIOCSTAT ideal-int +pkg syscall (freebsd-amd64), const TIOCSTI ideal-int +pkg syscall (freebsd-amd64), const TIOCSTOP ideal-int +pkg syscall (freebsd-amd64), const TIOCSWINSZ ideal-int +pkg syscall (freebsd-amd64), const TIOCTIMESTAMP ideal-int +pkg syscall (freebsd-amd64), const TIOCUCNTL ideal-int +pkg syscall (freebsd-amd64), const WCONTINUED ideal-int +pkg syscall (freebsd-amd64), const WCOREFLAG ideal-int +pkg syscall (freebsd-amd64), const WLINUXCLONE ideal-int +pkg syscall (freebsd-amd64), const WNOHANG ideal-int +pkg syscall (freebsd-amd64), const WNOWAIT ideal-int +pkg syscall (freebsd-amd64), const WSTOPPED ideal-int +pkg syscall (freebsd-amd64), const WUNTRACED ideal-int +pkg syscall (freebsd-amd64), func Accept(int) (int, Sockaddr, error) +pkg syscall (freebsd-amd64), func Access(string, uint32) error +pkg syscall (freebsd-amd64), func Adjtime(*Timeval, *Timeval) error +pkg syscall (freebsd-amd64), func Bind(int, Sockaddr) error +pkg syscall (freebsd-amd64), func BpfBuflen(int) (int, error) +pkg syscall (freebsd-amd64), func BpfDatalink(int) (int, error) +pkg syscall (freebsd-amd64), func BpfHeadercmpl(int) (int, error) +pkg syscall (freebsd-amd64), func BpfInterface(int, string) (string, error) +pkg syscall (freebsd-amd64), func BpfJump(int, int, int, int) *BpfInsn +pkg syscall (freebsd-amd64), func BpfStats(int) (*BpfStat, error) +pkg syscall (freebsd-amd64), func BpfStmt(int, int) *BpfInsn +pkg syscall (freebsd-amd64), func BpfTimeout(int) (*Timeval, error) +pkg syscall (freebsd-amd64), func CheckBpfVersion(int) error +pkg syscall (freebsd-amd64), func Chflags(string, int) error +pkg syscall (freebsd-amd64), func Chroot(string) error +pkg syscall (freebsd-amd64), func Close(int) error +pkg syscall (freebsd-amd64), func CloseOnExec(int) +pkg syscall (freebsd-amd64), func CmsgLen(int) int +pkg syscall (freebsd-amd64), func CmsgSpace(int) int +pkg syscall (freebsd-amd64), func Connect(int, Sockaddr) error +pkg syscall (freebsd-amd64), func Dup(int) (int, error) +pkg syscall (freebsd-amd64), func Dup2(int, int) error +pkg syscall (freebsd-amd64), func Fchdir(int) error +pkg syscall (freebsd-amd64), func Fchflags(string, int) error +pkg syscall (freebsd-amd64), func Fchmod(int, uint32) error +pkg syscall (freebsd-amd64), func Fchown(int, int, int) error +pkg syscall (freebsd-amd64), func Flock(int, int) error +pkg syscall (freebsd-amd64), func FlushBpf(int) error +pkg syscall (freebsd-amd64), func ForkExec(string, []string, *ProcAttr) (int, error) +pkg syscall (freebsd-amd64), func Fpathconf(int, int) (int, error) +pkg syscall (freebsd-amd64), func Fstat(int, *Stat_t) error +pkg syscall (freebsd-amd64), func Fstatfs(int, *Statfs_t) error +pkg syscall (freebsd-amd64), func Fsync(int) error +pkg syscall (freebsd-amd64), func Ftruncate(int, int64) error +pkg syscall (freebsd-amd64), func Futimes(int, []Timeval) error +pkg syscall (freebsd-amd64), func Getdirentries(int, []uint8, *uintptr) (int, error) +pkg syscall (freebsd-amd64), func Getdtablesize() int +pkg syscall (freebsd-amd64), func Getfsstat([]Statfs_t, int) (int, error) +pkg syscall (freebsd-amd64), func Getpeername(int) (Sockaddr, error) +pkg syscall (freebsd-amd64), func Getpgid(int) (int, error) +pkg syscall (freebsd-amd64), func Getpgrp() int +pkg syscall (freebsd-amd64), func Getpriority(int, int) (int, error) +pkg syscall (freebsd-amd64), func Getrlimit(int, *Rlimit) error +pkg syscall (freebsd-amd64), func Getrusage(int, *Rusage) error +pkg syscall (freebsd-amd64), func Getsid(int) (int, error) +pkg syscall (freebsd-amd64), func Getsockname(int) (Sockaddr, error) +pkg syscall (freebsd-amd64), func GetsockoptByte(int, int, int) (uint8, error) +pkg syscall (freebsd-amd64), func GetsockoptIPMreq(int, int, int) (*IPMreq, error) +pkg syscall (freebsd-amd64), func GetsockoptIPMreqn(int, int, int) (*IPMreqn, error) +pkg syscall (freebsd-amd64), func GetsockoptIPv6Mreq(int, int, int) (*IPv6Mreq, error) +pkg syscall (freebsd-amd64), func GetsockoptInet4Addr(int, int, int) ([4]uint8, error) +pkg syscall (freebsd-amd64), func GetsockoptInt(int, int, int) (int, error) +pkg syscall (freebsd-amd64), func Issetugid() bool +pkg syscall (freebsd-amd64), func Kevent(int, []Kevent_t, []Kevent_t, *Timespec) (int, error) +pkg syscall (freebsd-amd64), func Kill(int, Signal) error +pkg syscall (freebsd-amd64), func Kqueue() (int, error) +pkg syscall (freebsd-amd64), func Listen(int, int) error +pkg syscall (freebsd-amd64), func Lstat(string, *Stat_t) error +pkg syscall (freebsd-amd64), func Mkfifo(string, uint32) error +pkg syscall (freebsd-amd64), func Mknod(string, uint32, int) error +pkg syscall (freebsd-amd64), func Mmap(int, int64, int, int, int) ([]uint8, error) +pkg syscall (freebsd-amd64), func Munmap([]uint8) error +pkg syscall (freebsd-amd64), func Nanosleep(*Timespec, *Timespec) error +pkg syscall (freebsd-amd64), func NsecToTimespec(int64) Timespec +pkg syscall (freebsd-amd64), func Open(string, int, uint32) (int, error) +pkg syscall (freebsd-amd64), func ParseDirent([]uint8, int, []string) (int, int, []string) +pkg syscall (freebsd-amd64), func ParseRoutingMessage([]uint8) ([]RoutingMessage, error) +pkg syscall (freebsd-amd64), func ParseRoutingSockaddr(RoutingMessage) ([]Sockaddr, error) +pkg syscall (freebsd-amd64), func ParseSocketControlMessage([]uint8) ([]SocketControlMessage, error) +pkg syscall (freebsd-amd64), func ParseUnixRights(*SocketControlMessage) ([]int, error) +pkg syscall (freebsd-amd64), func Pathconf(string, int) (int, error) +pkg syscall (freebsd-amd64), func Pipe([]int) error +pkg syscall (freebsd-amd64), func Pread(int, []uint8, int64) (int, error) +pkg syscall (freebsd-amd64), func Pwrite(int, []uint8, int64) (int, error) +pkg syscall (freebsd-amd64), func RawSyscall(uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno) +pkg syscall (freebsd-amd64), func RawSyscall6(uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno) +pkg syscall (freebsd-amd64), func Read(int, []uint8) (int, error) +pkg syscall (freebsd-amd64), func ReadDirent(int, []uint8) (int, error) +pkg syscall (freebsd-amd64), func Recvfrom(int, []uint8, int) (int, Sockaddr, error) +pkg syscall (freebsd-amd64), func Recvmsg(int, []uint8, []uint8, int) (int, int, int, Sockaddr, error) +pkg syscall (freebsd-amd64), func Revoke(string) error +pkg syscall (freebsd-amd64), func RouteRIB(int, int) ([]uint8, error) +pkg syscall (freebsd-amd64), func Seek(int, int64, int) (int64, error) +pkg syscall (freebsd-amd64), func Select(int, *FdSet, *FdSet, *FdSet, *Timeval) error +pkg syscall (freebsd-amd64), func Sendfile(int, int, *int64, int) (int, error) +pkg syscall (freebsd-amd64), func Sendmsg(int, []uint8, []uint8, Sockaddr, int) error +pkg syscall (freebsd-amd64), func Sendto(int, []uint8, int, Sockaddr) error +pkg syscall (freebsd-amd64), func SetBpf(int, []BpfInsn) error +pkg syscall (freebsd-amd64), func SetBpfBuflen(int, int) (int, error) +pkg syscall (freebsd-amd64), func SetBpfDatalink(int, int) (int, error) +pkg syscall (freebsd-amd64), func SetBpfHeadercmpl(int, int) error +pkg syscall (freebsd-amd64), func SetBpfImmediate(int, int) error +pkg syscall (freebsd-amd64), func SetBpfInterface(int, string) error +pkg syscall (freebsd-amd64), func SetBpfPromisc(int, int) error +pkg syscall (freebsd-amd64), func SetBpfTimeout(int, *Timeval) error +pkg syscall (freebsd-amd64), func SetKevent(*Kevent_t, int, int, int) +pkg syscall (freebsd-amd64), func SetNonblock(int, bool) error +pkg syscall (freebsd-amd64), func Setegid(int) error +pkg syscall (freebsd-amd64), func Seteuid(int) error +pkg syscall (freebsd-amd64), func Setgid(int) error +pkg syscall (freebsd-amd64), func Setgroups([]int) error +pkg syscall (freebsd-amd64), func Setlogin(string) error +pkg syscall (freebsd-amd64), func Setpgid(int, int) error +pkg syscall (freebsd-amd64), func Setpriority(int, int, int) error +pkg syscall (freebsd-amd64), func Setregid(int, int) error +pkg syscall (freebsd-amd64), func Setreuid(int, int) error +pkg syscall (freebsd-amd64), func Setrlimit(int, *Rlimit) error +pkg syscall (freebsd-amd64), func Setsid() (int, error) +pkg syscall (freebsd-amd64), func SetsockoptByte(int, int, int, uint8) error +pkg syscall (freebsd-amd64), func SetsockoptIPMreq(int, int, int, *IPMreq) error +pkg syscall (freebsd-amd64), func SetsockoptIPMreqn(int, int, int, *IPMreqn) error +pkg syscall (freebsd-amd64), func SetsockoptIPv6Mreq(int, int, int, *IPv6Mreq) error +pkg syscall (freebsd-amd64), func SetsockoptInet4Addr(int, int, int, [4]uint8) error +pkg syscall (freebsd-amd64), func SetsockoptInt(int, int, int, int) error +pkg syscall (freebsd-amd64), func SetsockoptLinger(int, int, int, *Linger) error +pkg syscall (freebsd-amd64), func SetsockoptString(int, int, int, string) error +pkg syscall (freebsd-amd64), func SetsockoptTimeval(int, int, int, *Timeval) error +pkg syscall (freebsd-amd64), func Settimeofday(*Timeval) error +pkg syscall (freebsd-amd64), func Setuid(int) error +pkg syscall (freebsd-amd64), func Shutdown(int, int) error +pkg syscall (freebsd-amd64), func Socket(int, int, int) (int, error) +pkg syscall (freebsd-amd64), func Socketpair(int, int, int) ([2]int, error) +pkg syscall (freebsd-amd64), func Stat(string, *Stat_t) error +pkg syscall (freebsd-amd64), func Statfs(string, *Statfs_t) error +pkg syscall (freebsd-amd64), func StringSlicePtr([]string) []*uint8 +pkg syscall (freebsd-amd64), func Sync() error +pkg syscall (freebsd-amd64), func Syscall(uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno) +pkg syscall (freebsd-amd64), func Syscall6(uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno) +pkg syscall (freebsd-amd64), func Sysctl(string) (string, error) +pkg syscall (freebsd-amd64), func SysctlUint32(string) (uint32, error) +pkg syscall (freebsd-amd64), func TimespecToNsec(Timespec) int64 +pkg syscall (freebsd-amd64), func TimevalToNsec(Timeval) int64 +pkg syscall (freebsd-amd64), func Truncate(string, int64) error +pkg syscall (freebsd-amd64), func Umask(int) int +pkg syscall (freebsd-amd64), func Undelete(string) error +pkg syscall (freebsd-amd64), func UnixRights(...int) []uint8 +pkg syscall (freebsd-amd64), func Unmount(string, int) error +pkg syscall (freebsd-amd64), func Wait4(int, *WaitStatus, int, *Rusage) (int, error) +pkg syscall (freebsd-amd64), func Write(int, []uint8) (int, error) +pkg syscall (freebsd-amd64), method (*Cmsghdr) SetLen(int) +pkg syscall (freebsd-amd64), method (*Iovec) SetLen(int) +pkg syscall (freebsd-amd64), method (*Msghdr) SetControllen(int) +pkg syscall (freebsd-amd64), type BpfHdr struct +pkg syscall (freebsd-amd64), type BpfHdr struct, Caplen uint32 +pkg syscall (freebsd-amd64), type BpfHdr struct, Datalen uint32 +pkg syscall (freebsd-amd64), type BpfHdr struct, Hdrlen uint16 +pkg syscall (freebsd-amd64), type BpfHdr struct, Pad_cgo_0 [6]uint8 +pkg syscall (freebsd-amd64), type BpfHdr struct, Tstamp Timeval +pkg syscall (freebsd-amd64), type BpfInsn struct +pkg syscall (freebsd-amd64), type BpfInsn struct, Code uint16 +pkg syscall (freebsd-amd64), type BpfInsn struct, Jf uint8 +pkg syscall (freebsd-amd64), type BpfInsn struct, Jt uint8 +pkg syscall (freebsd-amd64), type BpfInsn struct, K uint32 +pkg syscall (freebsd-amd64), type BpfProgram struct +pkg syscall (freebsd-amd64), type BpfProgram struct, Insns *BpfInsn +pkg syscall (freebsd-amd64), type BpfProgram struct, Len uint32 +pkg syscall (freebsd-amd64), type BpfProgram struct, Pad_cgo_0 [4]uint8 +pkg syscall (freebsd-amd64), type BpfStat struct +pkg syscall (freebsd-amd64), type BpfStat struct, Drop uint32 +pkg syscall (freebsd-amd64), type BpfStat struct, Recv uint32 +pkg syscall (freebsd-amd64), type BpfVersion struct +pkg syscall (freebsd-amd64), type BpfVersion struct, Major uint16 +pkg syscall (freebsd-amd64), type BpfVersion struct, Minor uint16 +pkg syscall (freebsd-amd64), type BpfZbuf struct +pkg syscall (freebsd-amd64), type BpfZbuf struct, Bufa *uint8 +pkg syscall (freebsd-amd64), type BpfZbuf struct, Bufb *uint8 +pkg syscall (freebsd-amd64), type BpfZbuf struct, Buflen uint64 +pkg syscall (freebsd-amd64), type BpfZbufHeader struct +pkg syscall (freebsd-amd64), type BpfZbufHeader struct, Kernel_gen uint32 +pkg syscall (freebsd-amd64), type BpfZbufHeader struct, Kernel_len uint32 +pkg syscall (freebsd-amd64), type BpfZbufHeader struct, User_gen uint32 +pkg syscall (freebsd-amd64), type BpfZbufHeader struct, X_bzh_pad [5]uint32 +pkg syscall (freebsd-amd64), type Cmsghdr struct +pkg syscall (freebsd-amd64), type Cmsghdr struct, Len uint32 +pkg syscall (freebsd-amd64), type Cmsghdr struct, Level int32 +pkg syscall (freebsd-amd64), type Cmsghdr struct, Type int32 +pkg syscall (freebsd-amd64), type Credential struct +pkg syscall (freebsd-amd64), type Credential struct, Gid uint32 +pkg syscall (freebsd-amd64), type Credential struct, Groups []uint32 +pkg syscall (freebsd-amd64), type Credential struct, Uid uint32 +pkg syscall (freebsd-amd64), type Dirent struct +pkg syscall (freebsd-amd64), type Dirent struct, Fileno uint32 +pkg syscall (freebsd-amd64), type Dirent struct, Name [256]int8 +pkg syscall (freebsd-amd64), type Dirent struct, Namlen uint8 +pkg syscall (freebsd-amd64), type Dirent struct, Reclen uint16 +pkg syscall (freebsd-amd64), type Dirent struct, Type uint8 +pkg syscall (freebsd-amd64), type FdSet struct +pkg syscall (freebsd-amd64), type FdSet struct, X__fds_bits [16]uint64 +pkg syscall (freebsd-amd64), type Flock_t struct +pkg syscall (freebsd-amd64), type Flock_t struct, Len int64 +pkg syscall (freebsd-amd64), type Flock_t struct, Pad_cgo_0 [4]uint8 +pkg syscall (freebsd-amd64), type Flock_t struct, Pid int32 +pkg syscall (freebsd-amd64), type Flock_t struct, Start int64 +pkg syscall (freebsd-amd64), type Flock_t struct, Sysid int32 +pkg syscall (freebsd-amd64), type Flock_t struct, Type int16 +pkg syscall (freebsd-amd64), type Flock_t struct, Whence int16 +pkg syscall (freebsd-amd64), type Fsid struct +pkg syscall (freebsd-amd64), type Fsid struct, Val [2]int32 +pkg syscall (freebsd-amd64), type IPMreqn struct +pkg syscall (freebsd-amd64), type IPMreqn struct, Address [4]uint8 +pkg syscall (freebsd-amd64), type IPMreqn struct, Ifindex int32 +pkg syscall (freebsd-amd64), type IPMreqn struct, Multiaddr [4]uint8 +pkg syscall (freebsd-amd64), type IfData struct +pkg syscall (freebsd-amd64), type IfData struct, Addrlen uint8 +pkg syscall (freebsd-amd64), type IfData struct, Baudrate uint64 +pkg syscall (freebsd-amd64), type IfData struct, Collisions uint64 +pkg syscall (freebsd-amd64), type IfData struct, Datalen uint8 +pkg syscall (freebsd-amd64), type IfData struct, Epoch int64 +pkg syscall (freebsd-amd64), type IfData struct, Hdrlen uint8 +pkg syscall (freebsd-amd64), type IfData struct, Hwassist uint64 +pkg syscall (freebsd-amd64), type IfData struct, Ibytes uint64 +pkg syscall (freebsd-amd64), type IfData struct, Ierrors uint64 +pkg syscall (freebsd-amd64), type IfData struct, Imcasts uint64 +pkg syscall (freebsd-amd64), type IfData struct, Ipackets uint64 +pkg syscall (freebsd-amd64), type IfData struct, Iqdrops uint64 +pkg syscall (freebsd-amd64), type IfData struct, Lastchange Timeval +pkg syscall (freebsd-amd64), type IfData struct, Link_state uint8 +pkg syscall (freebsd-amd64), type IfData struct, Metric uint64 +pkg syscall (freebsd-amd64), type IfData struct, Mtu uint64 +pkg syscall (freebsd-amd64), type IfData struct, Noproto uint64 +pkg syscall (freebsd-amd64), type IfData struct, Obytes uint64 +pkg syscall (freebsd-amd64), type IfData struct, Oerrors uint64 +pkg syscall (freebsd-amd64), type IfData struct, Omcasts uint64 +pkg syscall (freebsd-amd64), type IfData struct, Opackets uint64 +pkg syscall (freebsd-amd64), type IfData struct, Physical uint8 +pkg syscall (freebsd-amd64), type IfData struct, Spare_char1 uint8 +pkg syscall (freebsd-amd64), type IfData struct, Spare_char2 uint8 +pkg syscall (freebsd-amd64), type IfData struct, Type uint8 +pkg syscall (freebsd-amd64), type IfMsghdr struct +pkg syscall (freebsd-amd64), type IfMsghdr struct, Addrs int32 +pkg syscall (freebsd-amd64), type IfMsghdr struct, Data IfData +pkg syscall (freebsd-amd64), type IfMsghdr struct, Flags int32 +pkg syscall (freebsd-amd64), type IfMsghdr struct, Index uint16 +pkg syscall (freebsd-amd64), type IfMsghdr struct, Msglen uint16 +pkg syscall (freebsd-amd64), type IfMsghdr struct, Pad_cgo_0 [2]uint8 +pkg syscall (freebsd-amd64), type IfMsghdr struct, Type uint8 +pkg syscall (freebsd-amd64), type IfMsghdr struct, Version uint8 +pkg syscall (freebsd-amd64), type IfaMsghdr struct +pkg syscall (freebsd-amd64), type IfaMsghdr struct, Addrs int32 +pkg syscall (freebsd-amd64), type IfaMsghdr struct, Flags int32 +pkg syscall (freebsd-amd64), type IfaMsghdr struct, Index uint16 +pkg syscall (freebsd-amd64), type IfaMsghdr struct, Metric int32 +pkg syscall (freebsd-amd64), type IfaMsghdr struct, Msglen uint16 +pkg syscall (freebsd-amd64), type IfaMsghdr struct, Pad_cgo_0 [2]uint8 +pkg syscall (freebsd-amd64), type IfaMsghdr struct, Type uint8 +pkg syscall (freebsd-amd64), type IfaMsghdr struct, Version uint8 +pkg syscall (freebsd-amd64), type IfmaMsghdr struct +pkg syscall (freebsd-amd64), type IfmaMsghdr struct, Addrs int32 +pkg syscall (freebsd-amd64), type IfmaMsghdr struct, Flags int32 +pkg syscall (freebsd-amd64), type IfmaMsghdr struct, Index uint16 +pkg syscall (freebsd-amd64), type IfmaMsghdr struct, Msglen uint16 +pkg syscall (freebsd-amd64), type IfmaMsghdr struct, Pad_cgo_0 [2]uint8 +pkg syscall (freebsd-amd64), type IfmaMsghdr struct, Type uint8 +pkg syscall (freebsd-amd64), type IfmaMsghdr struct, Version uint8 +pkg syscall (freebsd-amd64), type Inet6Pktinfo struct +pkg syscall (freebsd-amd64), type Inet6Pktinfo struct, Addr [16]uint8 +pkg syscall (freebsd-amd64), type Inet6Pktinfo struct, Ifindex uint32 +pkg syscall (freebsd-amd64), type InterfaceAddrMessage struct +pkg syscall (freebsd-amd64), type InterfaceAddrMessage struct, Data []uint8 +pkg syscall (freebsd-amd64), type InterfaceAddrMessage struct, Header IfaMsghdr +pkg syscall (freebsd-amd64), type InterfaceMessage struct +pkg syscall (freebsd-amd64), type InterfaceMessage struct, Data []uint8 +pkg syscall (freebsd-amd64), type InterfaceMessage struct, Header IfMsghdr +pkg syscall (freebsd-amd64), type InterfaceMulticastAddrMessage struct +pkg syscall (freebsd-amd64), type InterfaceMulticastAddrMessage struct, Data []uint8 +pkg syscall (freebsd-amd64), type InterfaceMulticastAddrMessage struct, Header IfmaMsghdr +pkg syscall (freebsd-amd64), type Iovec struct +pkg syscall (freebsd-amd64), type Iovec struct, Base *uint8 +pkg syscall (freebsd-amd64), type Iovec struct, Len uint64 +pkg syscall (freebsd-amd64), type Kevent_t struct +pkg syscall (freebsd-amd64), type Kevent_t struct, Data int64 +pkg syscall (freebsd-amd64), type Kevent_t struct, Fflags uint32 +pkg syscall (freebsd-amd64), type Kevent_t struct, Filter int16 +pkg syscall (freebsd-amd64), type Kevent_t struct, Flags uint16 +pkg syscall (freebsd-amd64), type Kevent_t struct, Ident uint64 +pkg syscall (freebsd-amd64), type Kevent_t struct, Udata *uint8 +pkg syscall (freebsd-amd64), type Msghdr struct +pkg syscall (freebsd-amd64), type Msghdr struct, Control *uint8 +pkg syscall (freebsd-amd64), type Msghdr struct, Controllen uint32 +pkg syscall (freebsd-amd64), type Msghdr struct, Flags int32 +pkg syscall (freebsd-amd64), type Msghdr struct, Iov *Iovec +pkg syscall (freebsd-amd64), type Msghdr struct, Iovlen int32 +pkg syscall (freebsd-amd64), type Msghdr struct, Name *uint8 +pkg syscall (freebsd-amd64), type Msghdr struct, Namelen uint32 +pkg syscall (freebsd-amd64), type Msghdr struct, Pad_cgo_0 [4]uint8 +pkg syscall (freebsd-amd64), type Msghdr struct, Pad_cgo_1 [4]uint8 +pkg syscall (freebsd-amd64), type RawSockaddr struct, Data [14]int8 +pkg syscall (freebsd-amd64), type RawSockaddr struct, Family uint8 +pkg syscall (freebsd-amd64), type RawSockaddr struct, Len uint8 +pkg syscall (freebsd-amd64), type RawSockaddrAny struct, Pad [92]int8 +pkg syscall (freebsd-amd64), type RawSockaddrDatalink struct +pkg syscall (freebsd-amd64), type RawSockaddrDatalink struct, Alen uint8 +pkg syscall (freebsd-amd64), type RawSockaddrDatalink struct, Data [46]int8 +pkg syscall (freebsd-amd64), type RawSockaddrDatalink struct, Family uint8 +pkg syscall (freebsd-amd64), type RawSockaddrDatalink struct, Index uint16 +pkg syscall (freebsd-amd64), type RawSockaddrDatalink struct, Len uint8 +pkg syscall (freebsd-amd64), type RawSockaddrDatalink struct, Nlen uint8 +pkg syscall (freebsd-amd64), type RawSockaddrDatalink struct, Slen uint8 +pkg syscall (freebsd-amd64), type RawSockaddrDatalink struct, Type uint8 +pkg syscall (freebsd-amd64), type RawSockaddrInet4 struct, Family uint8 +pkg syscall (freebsd-amd64), type RawSockaddrInet4 struct, Len uint8 +pkg syscall (freebsd-amd64), type RawSockaddrInet4 struct, Zero [8]int8 +pkg syscall (freebsd-amd64), type RawSockaddrInet6 struct +pkg syscall (freebsd-amd64), type RawSockaddrInet6 struct, Addr [16]uint8 +pkg syscall (freebsd-amd64), type RawSockaddrInet6 struct, Family uint8 +pkg syscall (freebsd-amd64), type RawSockaddrInet6 struct, Flowinfo uint32 +pkg syscall (freebsd-amd64), type RawSockaddrInet6 struct, Len uint8 +pkg syscall (freebsd-amd64), type RawSockaddrInet6 struct, Port uint16 +pkg syscall (freebsd-amd64), type RawSockaddrInet6 struct, Scope_id uint32 +pkg syscall (freebsd-amd64), type RawSockaddrUnix struct +pkg syscall (freebsd-amd64), type RawSockaddrUnix struct, Family uint8 +pkg syscall (freebsd-amd64), type RawSockaddrUnix struct, Len uint8 +pkg syscall (freebsd-amd64), type RawSockaddrUnix struct, Path [104]int8 +pkg syscall (freebsd-amd64), type Rlimit struct +pkg syscall (freebsd-amd64), type Rlimit struct, Cur int64 +pkg syscall (freebsd-amd64), type Rlimit struct, Max int64 +pkg syscall (freebsd-amd64), type RouteMessage struct +pkg syscall (freebsd-amd64), type RouteMessage struct, Data []uint8 +pkg syscall (freebsd-amd64), type RouteMessage struct, Header RtMsghdr +pkg syscall (freebsd-amd64), type RoutingMessage interface, unexported methods +pkg syscall (freebsd-amd64), type RtMetrics struct +pkg syscall (freebsd-amd64), type RtMetrics struct, Expire uint64 +pkg syscall (freebsd-amd64), type RtMetrics struct, Filler [3]uint64 +pkg syscall (freebsd-amd64), type RtMetrics struct, Hopcount uint64 +pkg syscall (freebsd-amd64), type RtMetrics struct, Locks uint64 +pkg syscall (freebsd-amd64), type RtMetrics struct, Mtu uint64 +pkg syscall (freebsd-amd64), type RtMetrics struct, Pksent uint64 +pkg syscall (freebsd-amd64), type RtMetrics struct, Recvpipe uint64 +pkg syscall (freebsd-amd64), type RtMetrics struct, Rtt uint64 +pkg syscall (freebsd-amd64), type RtMetrics struct, Rttvar uint64 +pkg syscall (freebsd-amd64), type RtMetrics struct, Sendpipe uint64 +pkg syscall (freebsd-amd64), type RtMetrics struct, Ssthresh uint64 +pkg syscall (freebsd-amd64), type RtMetrics struct, Weight uint64 +pkg syscall (freebsd-amd64), type RtMsghdr struct +pkg syscall (freebsd-amd64), type RtMsghdr struct, Addrs int32 +pkg syscall (freebsd-amd64), type RtMsghdr struct, Errno int32 +pkg syscall (freebsd-amd64), type RtMsghdr struct, Flags int32 +pkg syscall (freebsd-amd64), type RtMsghdr struct, Fmask int32 +pkg syscall (freebsd-amd64), type RtMsghdr struct, Index uint16 +pkg syscall (freebsd-amd64), type RtMsghdr struct, Inits uint64 +pkg syscall (freebsd-amd64), type RtMsghdr struct, Msglen uint16 +pkg syscall (freebsd-amd64), type RtMsghdr struct, Pad_cgo_0 [2]uint8 +pkg syscall (freebsd-amd64), type RtMsghdr struct, Pid int32 +pkg syscall (freebsd-amd64), type RtMsghdr struct, Rmx RtMetrics +pkg syscall (freebsd-amd64), type RtMsghdr struct, Seq int32 +pkg syscall (freebsd-amd64), type RtMsghdr struct, Type uint8 +pkg syscall (freebsd-amd64), type RtMsghdr struct, Version uint8 +pkg syscall (freebsd-amd64), type Rusage struct, Idrss int64 +pkg syscall (freebsd-amd64), type Rusage struct, Inblock int64 +pkg syscall (freebsd-amd64), type Rusage struct, Isrss int64 +pkg syscall (freebsd-amd64), type Rusage struct, Ixrss int64 +pkg syscall (freebsd-amd64), type Rusage struct, Majflt int64 +pkg syscall (freebsd-amd64), type Rusage struct, Maxrss int64 +pkg syscall (freebsd-amd64), type Rusage struct, Minflt int64 +pkg syscall (freebsd-amd64), type Rusage struct, Msgrcv int64 +pkg syscall (freebsd-amd64), type Rusage struct, Msgsnd int64 +pkg syscall (freebsd-amd64), type Rusage struct, Nivcsw int64 +pkg syscall (freebsd-amd64), type Rusage struct, Nsignals int64 +pkg syscall (freebsd-amd64), type Rusage struct, Nswap int64 +pkg syscall (freebsd-amd64), type Rusage struct, Nvcsw int64 +pkg syscall (freebsd-amd64), type Rusage struct, Oublock int64 +pkg syscall (freebsd-amd64), type Rusage struct, Stime Timeval +pkg syscall (freebsd-amd64), type Rusage struct, Utime Timeval +pkg syscall (freebsd-amd64), type SockaddrDatalink struct +pkg syscall (freebsd-amd64), type SockaddrDatalink struct, Alen uint8 +pkg syscall (freebsd-amd64), type SockaddrDatalink struct, Data [46]int8 +pkg syscall (freebsd-amd64), type SockaddrDatalink struct, Family uint8 +pkg syscall (freebsd-amd64), type SockaddrDatalink struct, Index uint16 +pkg syscall (freebsd-amd64), type SockaddrDatalink struct, Len uint8 +pkg syscall (freebsd-amd64), type SockaddrDatalink struct, Nlen uint8 +pkg syscall (freebsd-amd64), type SockaddrDatalink struct, Slen uint8 +pkg syscall (freebsd-amd64), type SockaddrDatalink struct, Type uint8 +pkg syscall (freebsd-amd64), type SocketControlMessage struct +pkg syscall (freebsd-amd64), type SocketControlMessage struct, Data []uint8 +pkg syscall (freebsd-amd64), type SocketControlMessage struct, Header Cmsghdr +pkg syscall (freebsd-amd64), type Stat_t struct +pkg syscall (freebsd-amd64), type Stat_t struct, Atimespec Timespec +pkg syscall (freebsd-amd64), type Stat_t struct, Birthtimespec Timespec +pkg syscall (freebsd-amd64), type Stat_t struct, Blksize uint32 +pkg syscall (freebsd-amd64), type Stat_t struct, Blocks int64 +pkg syscall (freebsd-amd64), type Stat_t struct, Ctimespec Timespec +pkg syscall (freebsd-amd64), type Stat_t struct, Dev uint32 +pkg syscall (freebsd-amd64), type Stat_t struct, Flags uint32 +pkg syscall (freebsd-amd64), type Stat_t struct, Gen uint32 +pkg syscall (freebsd-amd64), type Stat_t struct, Gid uint32 +pkg syscall (freebsd-amd64), type Stat_t struct, Ino uint32 +pkg syscall (freebsd-amd64), type Stat_t struct, Lspare int32 +pkg syscall (freebsd-amd64), type Stat_t struct, Mode uint16 +pkg syscall (freebsd-amd64), type Stat_t struct, Mtimespec Timespec +pkg syscall (freebsd-amd64), type Stat_t struct, Nlink uint16 +pkg syscall (freebsd-amd64), type Stat_t struct, Rdev uint32 +pkg syscall (freebsd-amd64), type Stat_t struct, Size int64 +pkg syscall (freebsd-amd64), type Stat_t struct, Uid uint32 +pkg syscall (freebsd-amd64), type Statfs_t struct +pkg syscall (freebsd-amd64), type Statfs_t struct, Asyncreads uint64 +pkg syscall (freebsd-amd64), type Statfs_t struct, Asyncwrites uint64 +pkg syscall (freebsd-amd64), type Statfs_t struct, Bavail int64 +pkg syscall (freebsd-amd64), type Statfs_t struct, Bfree uint64 +pkg syscall (freebsd-amd64), type Statfs_t struct, Blocks uint64 +pkg syscall (freebsd-amd64), type Statfs_t struct, Bsize uint64 +pkg syscall (freebsd-amd64), type Statfs_t struct, Charspare [80]int8 +pkg syscall (freebsd-amd64), type Statfs_t struct, Ffree int64 +pkg syscall (freebsd-amd64), type Statfs_t struct, Files uint64 +pkg syscall (freebsd-amd64), type Statfs_t struct, Flags uint64 +pkg syscall (freebsd-amd64), type Statfs_t struct, Fsid Fsid +pkg syscall (freebsd-amd64), type Statfs_t struct, Fstypename [16]int8 +pkg syscall (freebsd-amd64), type Statfs_t struct, Iosize uint64 +pkg syscall (freebsd-amd64), type Statfs_t struct, Mntfromname [88]int8 +pkg syscall (freebsd-amd64), type Statfs_t struct, Mntonname [88]int8 +pkg syscall (freebsd-amd64), type Statfs_t struct, Namemax uint32 +pkg syscall (freebsd-amd64), type Statfs_t struct, Owner uint32 +pkg syscall (freebsd-amd64), type Statfs_t struct, Spare [10]uint64 +pkg syscall (freebsd-amd64), type Statfs_t struct, Syncreads uint64 +pkg syscall (freebsd-amd64), type Statfs_t struct, Syncwrites uint64 +pkg syscall (freebsd-amd64), type Statfs_t struct, Type uint32 +pkg syscall (freebsd-amd64), type Statfs_t struct, Version uint32 +pkg syscall (freebsd-amd64), type SysProcAttr struct, Chroot string +pkg syscall (freebsd-amd64), type SysProcAttr struct, Credential *Credential +pkg syscall (freebsd-amd64), type SysProcAttr struct, Noctty bool +pkg syscall (freebsd-amd64), type SysProcAttr struct, Ptrace bool +pkg syscall (freebsd-amd64), type SysProcAttr struct, Setctty bool +pkg syscall (freebsd-amd64), type SysProcAttr struct, Setpgid bool +pkg syscall (freebsd-amd64), type SysProcAttr struct, Setsid bool +pkg syscall (freebsd-amd64), type Timespec struct, Nsec int64 +pkg syscall (freebsd-amd64), type Timespec struct, Sec int64 +pkg syscall (freebsd-amd64), type Timeval struct, Sec int64 +pkg syscall (freebsd-amd64), type Timeval struct, Usec int64 +pkg syscall (freebsd-amd64), type WaitStatus uint32 +pkg syscall (freebsd-amd64), var Stderr int +pkg syscall (freebsd-amd64), var Stdin int +pkg syscall (freebsd-amd64), var Stdout int +pkg syscall (linux-386), const AF_ALG ideal-int +pkg syscall (linux-386), const AF_APPLETALK ideal-int +pkg syscall (linux-386), const AF_ASH ideal-int +pkg syscall (linux-386), const AF_ATMPVC ideal-int +pkg syscall (linux-386), const AF_ATMSVC ideal-int +pkg syscall (linux-386), const AF_AX25 ideal-int +pkg syscall (linux-386), const AF_BLUETOOTH ideal-int +pkg syscall (linux-386), const AF_BRIDGE ideal-int +pkg syscall (linux-386), const AF_CAIF ideal-int +pkg syscall (linux-386), const AF_CAN ideal-int +pkg syscall (linux-386), const AF_DECnet ideal-int +pkg syscall (linux-386), const AF_ECONET ideal-int +pkg syscall (linux-386), const AF_FILE ideal-int +pkg syscall (linux-386), const AF_IEEE802154 ideal-int +pkg syscall (linux-386), const AF_IPX ideal-int +pkg syscall (linux-386), const AF_IRDA ideal-int +pkg syscall (linux-386), const AF_ISDN ideal-int +pkg syscall (linux-386), const AF_IUCV ideal-int +pkg syscall (linux-386), const AF_KEY ideal-int +pkg syscall (linux-386), const AF_LLC ideal-int +pkg syscall (linux-386), const AF_LOCAL ideal-int +pkg syscall (linux-386), const AF_MAX ideal-int +pkg syscall (linux-386), const AF_NETBEUI ideal-int +pkg syscall (linux-386), const AF_NETLINK ideal-int +pkg syscall (linux-386), const AF_NETROM ideal-int +pkg syscall (linux-386), const AF_PACKET ideal-int +pkg syscall (linux-386), const AF_PHONET ideal-int +pkg syscall (linux-386), const AF_PPPOX ideal-int +pkg syscall (linux-386), const AF_RDS ideal-int +pkg syscall (linux-386), const AF_ROSE ideal-int +pkg syscall (linux-386), const AF_ROUTE ideal-int +pkg syscall (linux-386), const AF_RXRPC ideal-int +pkg syscall (linux-386), const AF_SECURITY ideal-int +pkg syscall (linux-386), const AF_SNA ideal-int +pkg syscall (linux-386), const AF_TIPC ideal-int +pkg syscall (linux-386), const AF_WANPIPE ideal-int +pkg syscall (linux-386), const AF_X25 ideal-int +pkg syscall (linux-386), const ARPHRD_ADAPT ideal-int +pkg syscall (linux-386), const ARPHRD_APPLETLK ideal-int +pkg syscall (linux-386), const ARPHRD_ARCNET ideal-int +pkg syscall (linux-386), const ARPHRD_ASH ideal-int +pkg syscall (linux-386), const ARPHRD_ATM ideal-int +pkg syscall (linux-386), const ARPHRD_AX25 ideal-int +pkg syscall (linux-386), const ARPHRD_BIF ideal-int +pkg syscall (linux-386), const ARPHRD_CHAOS ideal-int +pkg syscall (linux-386), const ARPHRD_CISCO ideal-int +pkg syscall (linux-386), const ARPHRD_CSLIP ideal-int +pkg syscall (linux-386), const ARPHRD_CSLIP6 ideal-int +pkg syscall (linux-386), const ARPHRD_DDCMP ideal-int +pkg syscall (linux-386), const ARPHRD_DLCI ideal-int +pkg syscall (linux-386), const ARPHRD_ECONET ideal-int +pkg syscall (linux-386), const ARPHRD_EETHER ideal-int +pkg syscall (linux-386), const ARPHRD_ETHER ideal-int +pkg syscall (linux-386), const ARPHRD_EUI64 ideal-int +pkg syscall (linux-386), const ARPHRD_FCAL ideal-int +pkg syscall (linux-386), const ARPHRD_FCFABRIC ideal-int +pkg syscall (linux-386), const ARPHRD_FCPL ideal-int +pkg syscall (linux-386), const ARPHRD_FCPP ideal-int +pkg syscall (linux-386), const ARPHRD_FDDI ideal-int +pkg syscall (linux-386), const ARPHRD_FRAD ideal-int +pkg syscall (linux-386), const ARPHRD_HDLC ideal-int +pkg syscall (linux-386), const ARPHRD_HIPPI ideal-int +pkg syscall (linux-386), const ARPHRD_HWX25 ideal-int +pkg syscall (linux-386), const ARPHRD_IEEE1394 ideal-int +pkg syscall (linux-386), const ARPHRD_IEEE802 ideal-int +pkg syscall (linux-386), const ARPHRD_IEEE80211 ideal-int +pkg syscall (linux-386), const ARPHRD_IEEE80211_PRISM ideal-int +pkg syscall (linux-386), const ARPHRD_IEEE80211_RADIOTAP ideal-int +pkg syscall (linux-386), const ARPHRD_IEEE802154 ideal-int +pkg syscall (linux-386), const ARPHRD_IEEE802154_PHY ideal-int +pkg syscall (linux-386), const ARPHRD_IEEE802_TR ideal-int +pkg syscall (linux-386), const ARPHRD_INFINIBAND ideal-int +pkg syscall (linux-386), const ARPHRD_IPDDP ideal-int +pkg syscall (linux-386), const ARPHRD_IPGRE ideal-int +pkg syscall (linux-386), const ARPHRD_IRDA ideal-int +pkg syscall (linux-386), const ARPHRD_LAPB ideal-int +pkg syscall (linux-386), const ARPHRD_LOCALTLK ideal-int +pkg syscall (linux-386), const ARPHRD_LOOPBACK ideal-int +pkg syscall (linux-386), const ARPHRD_METRICOM ideal-int +pkg syscall (linux-386), const ARPHRD_NETROM ideal-int +pkg syscall (linux-386), const ARPHRD_NONE ideal-int +pkg syscall (linux-386), const ARPHRD_PIMREG ideal-int +pkg syscall (linux-386), const ARPHRD_PPP ideal-int +pkg syscall (linux-386), const ARPHRD_PRONET ideal-int +pkg syscall (linux-386), const ARPHRD_RAWHDLC ideal-int +pkg syscall (linux-386), const ARPHRD_ROSE ideal-int +pkg syscall (linux-386), const ARPHRD_RSRVD ideal-int +pkg syscall (linux-386), const ARPHRD_SIT ideal-int +pkg syscall (linux-386), const ARPHRD_SKIP ideal-int +pkg syscall (linux-386), const ARPHRD_SLIP ideal-int +pkg syscall (linux-386), const ARPHRD_SLIP6 ideal-int +pkg syscall (linux-386), const ARPHRD_TUNNEL ideal-int +pkg syscall (linux-386), const ARPHRD_TUNNEL6 ideal-int +pkg syscall (linux-386), const ARPHRD_VOID ideal-int +pkg syscall (linux-386), const ARPHRD_X25 ideal-int +pkg syscall (linux-386), const B0 ideal-int +pkg syscall (linux-386), const B1000000 ideal-int +pkg syscall (linux-386), const B110 ideal-int +pkg syscall (linux-386), const B115200 ideal-int +pkg syscall (linux-386), const B1152000 ideal-int +pkg syscall (linux-386), const B1200 ideal-int +pkg syscall (linux-386), const B134 ideal-int +pkg syscall (linux-386), const B150 ideal-int +pkg syscall (linux-386), const B1500000 ideal-int +pkg syscall (linux-386), const B1800 ideal-int +pkg syscall (linux-386), const B19200 ideal-int +pkg syscall (linux-386), const B200 ideal-int +pkg syscall (linux-386), const B2000000 ideal-int +pkg syscall (linux-386), const B230400 ideal-int +pkg syscall (linux-386), const B2400 ideal-int +pkg syscall (linux-386), const B2500000 ideal-int +pkg syscall (linux-386), const B300 ideal-int +pkg syscall (linux-386), const B3000000 ideal-int +pkg syscall (linux-386), const B3500000 ideal-int +pkg syscall (linux-386), const B38400 ideal-int +pkg syscall (linux-386), const B4000000 ideal-int +pkg syscall (linux-386), const B460800 ideal-int +pkg syscall (linux-386), const B4800 ideal-int +pkg syscall (linux-386), const B50 ideal-int +pkg syscall (linux-386), const B500000 ideal-int +pkg syscall (linux-386), const B57600 ideal-int +pkg syscall (linux-386), const B576000 ideal-int +pkg syscall (linux-386), const B600 ideal-int +pkg syscall (linux-386), const B75 ideal-int +pkg syscall (linux-386), const B921600 ideal-int +pkg syscall (linux-386), const B9600 ideal-int +pkg syscall (linux-386), const BPF_A ideal-int +pkg syscall (linux-386), const BPF_ABS ideal-int +pkg syscall (linux-386), const BPF_ADD ideal-int +pkg syscall (linux-386), const BPF_ALU ideal-int +pkg syscall (linux-386), const BPF_AND ideal-int +pkg syscall (linux-386), const BPF_B ideal-int +pkg syscall (linux-386), const BPF_DIV ideal-int +pkg syscall (linux-386), const BPF_H ideal-int +pkg syscall (linux-386), const BPF_IMM ideal-int +pkg syscall (linux-386), const BPF_IND ideal-int +pkg syscall (linux-386), const BPF_JA ideal-int +pkg syscall (linux-386), const BPF_JEQ ideal-int +pkg syscall (linux-386), const BPF_JGE ideal-int +pkg syscall (linux-386), const BPF_JGT ideal-int +pkg syscall (linux-386), const BPF_JMP ideal-int +pkg syscall (linux-386), const BPF_JSET ideal-int +pkg syscall (linux-386), const BPF_K ideal-int +pkg syscall (linux-386), const BPF_LD ideal-int +pkg syscall (linux-386), const BPF_LDX ideal-int +pkg syscall (linux-386), const BPF_LEN ideal-int +pkg syscall (linux-386), const BPF_LSH ideal-int +pkg syscall (linux-386), const BPF_MAJOR_VERSION ideal-int +pkg syscall (linux-386), const BPF_MAXINSNS ideal-int +pkg syscall (linux-386), const BPF_MEM ideal-int +pkg syscall (linux-386), const BPF_MEMWORDS ideal-int +pkg syscall (linux-386), const BPF_MINOR_VERSION ideal-int +pkg syscall (linux-386), const BPF_MISC ideal-int +pkg syscall (linux-386), const BPF_MSH ideal-int +pkg syscall (linux-386), const BPF_MUL ideal-int +pkg syscall (linux-386), const BPF_NEG ideal-int +pkg syscall (linux-386), const BPF_OR ideal-int +pkg syscall (linux-386), const BPF_RET ideal-int +pkg syscall (linux-386), const BPF_RSH ideal-int +pkg syscall (linux-386), const BPF_ST ideal-int +pkg syscall (linux-386), const BPF_STX ideal-int +pkg syscall (linux-386), const BPF_SUB ideal-int +pkg syscall (linux-386), const BPF_TAX ideal-int +pkg syscall (linux-386), const BPF_TXA ideal-int +pkg syscall (linux-386), const BPF_W ideal-int +pkg syscall (linux-386), const BPF_X ideal-int +pkg syscall (linux-386), const BRKINT ideal-int +pkg syscall (linux-386), const CLOCAL ideal-int +pkg syscall (linux-386), const CREAD ideal-int +pkg syscall (linux-386), const CS5 ideal-int +pkg syscall (linux-386), const CS6 ideal-int +pkg syscall (linux-386), const CS7 ideal-int +pkg syscall (linux-386), const CS8 ideal-int +pkg syscall (linux-386), const CSIZE ideal-int +pkg syscall (linux-386), const CSTOPB ideal-int +pkg syscall (linux-386), const DT_BLK ideal-int +pkg syscall (linux-386), const DT_CHR ideal-int +pkg syscall (linux-386), const DT_DIR ideal-int +pkg syscall (linux-386), const DT_FIFO ideal-int +pkg syscall (linux-386), const DT_LNK ideal-int +pkg syscall (linux-386), const DT_REG ideal-int +pkg syscall (linux-386), const DT_SOCK ideal-int +pkg syscall (linux-386), const DT_UNKNOWN ideal-int +pkg syscall (linux-386), const DT_WHT ideal-int +pkg syscall (linux-386), const EADV Errno +pkg syscall (linux-386), const EBADE Errno +pkg syscall (linux-386), const EBADFD Errno +pkg syscall (linux-386), const EBADMSG Errno +pkg syscall (linux-386), const EBADR Errno +pkg syscall (linux-386), const EBADRQC Errno +pkg syscall (linux-386), const EBADSLT Errno +pkg syscall (linux-386), const EBFONT Errno +pkg syscall (linux-386), const ECHO ideal-int +pkg syscall (linux-386), const ECHOCTL ideal-int +pkg syscall (linux-386), const ECHOE ideal-int +pkg syscall (linux-386), const ECHOK ideal-int +pkg syscall (linux-386), const ECHOKE ideal-int +pkg syscall (linux-386), const ECHONL ideal-int +pkg syscall (linux-386), const ECHOPRT ideal-int +pkg syscall (linux-386), const ECHRNG Errno +pkg syscall (linux-386), const ECOMM Errno +pkg syscall (linux-386), const EDEADLOCK Errno +pkg syscall (linux-386), const EDOTDOT Errno +pkg syscall (linux-386), const EISNAM Errno +pkg syscall (linux-386), const EKEYEXPIRED Errno +pkg syscall (linux-386), const EKEYREJECTED Errno +pkg syscall (linux-386), const EKEYREVOKED Errno +pkg syscall (linux-386), const EL2HLT Errno +pkg syscall (linux-386), const EL2NSYNC Errno +pkg syscall (linux-386), const EL3HLT Errno +pkg syscall (linux-386), const EL3RST Errno +pkg syscall (linux-386), const ELIBACC Errno +pkg syscall (linux-386), const ELIBBAD Errno +pkg syscall (linux-386), const ELIBEXEC Errno +pkg syscall (linux-386), const ELIBMAX Errno +pkg syscall (linux-386), const ELIBSCN Errno +pkg syscall (linux-386), const ELNRNG Errno +pkg syscall (linux-386), const EMEDIUMTYPE Errno +pkg syscall (linux-386), const EMULTIHOP Errno +pkg syscall (linux-386), const ENAVAIL Errno +pkg syscall (linux-386), const ENOANO Errno +pkg syscall (linux-386), const ENOCSI Errno +pkg syscall (linux-386), const ENODATA Errno +pkg syscall (linux-386), const ENOKEY Errno +pkg syscall (linux-386), const ENOLINK Errno +pkg syscall (linux-386), const ENOMEDIUM Errno +pkg syscall (linux-386), const ENONET Errno +pkg syscall (linux-386), const ENOPKG Errno +pkg syscall (linux-386), const ENOSR Errno +pkg syscall (linux-386), const ENOSTR Errno +pkg syscall (linux-386), const ENOTNAM Errno +pkg syscall (linux-386), const ENOTRECOVERABLE Errno +pkg syscall (linux-386), const ENOTUNIQ Errno +pkg syscall (linux-386), const EOWNERDEAD Errno +pkg syscall (linux-386), const EPOLLERR ideal-int +pkg syscall (linux-386), const EPOLLET ideal-int +pkg syscall (linux-386), const EPOLLHUP ideal-int +pkg syscall (linux-386), const EPOLLIN ideal-int +pkg syscall (linux-386), const EPOLLMSG ideal-int +pkg syscall (linux-386), const EPOLLONESHOT ideal-int +pkg syscall (linux-386), const EPOLLOUT ideal-int +pkg syscall (linux-386), const EPOLLPRI ideal-int +pkg syscall (linux-386), const EPOLLRDBAND ideal-int +pkg syscall (linux-386), const EPOLLRDHUP ideal-int +pkg syscall (linux-386), const EPOLLRDNORM ideal-int +pkg syscall (linux-386), const EPOLLWRBAND ideal-int +pkg syscall (linux-386), const EPOLLWRNORM ideal-int +pkg syscall (linux-386), const EPOLL_CLOEXEC ideal-int +pkg syscall (linux-386), const EPOLL_CTL_ADD ideal-int +pkg syscall (linux-386), const EPOLL_CTL_DEL ideal-int +pkg syscall (linux-386), const EPOLL_CTL_MOD ideal-int +pkg syscall (linux-386), const EPOLL_NONBLOCK ideal-int +pkg syscall (linux-386), const EPROTO Errno +pkg syscall (linux-386), const EREMCHG Errno +pkg syscall (linux-386), const EREMOTEIO Errno +pkg syscall (linux-386), const ERESTART Errno +pkg syscall (linux-386), const ERFKILL Errno +pkg syscall (linux-386), const ESRMNT Errno +pkg syscall (linux-386), const ESTRPIPE Errno +pkg syscall (linux-386), const ETH_P_1588 ideal-int +pkg syscall (linux-386), const ETH_P_8021Q ideal-int +pkg syscall (linux-386), const ETH_P_802_2 ideal-int +pkg syscall (linux-386), const ETH_P_802_3 ideal-int +pkg syscall (linux-386), const ETH_P_AARP ideal-int +pkg syscall (linux-386), const ETH_P_ALL ideal-int +pkg syscall (linux-386), const ETH_P_AOE ideal-int +pkg syscall (linux-386), const ETH_P_ARCNET ideal-int +pkg syscall (linux-386), const ETH_P_ARP ideal-int +pkg syscall (linux-386), const ETH_P_ATALK ideal-int +pkg syscall (linux-386), const ETH_P_ATMFATE ideal-int +pkg syscall (linux-386), const ETH_P_ATMMPOA ideal-int +pkg syscall (linux-386), const ETH_P_AX25 ideal-int +pkg syscall (linux-386), const ETH_P_BPQ ideal-int +pkg syscall (linux-386), const ETH_P_CAIF ideal-int +pkg syscall (linux-386), const ETH_P_CAN ideal-int +pkg syscall (linux-386), const ETH_P_CONTROL ideal-int +pkg syscall (linux-386), const ETH_P_CUST ideal-int +pkg syscall (linux-386), const ETH_P_DDCMP ideal-int +pkg syscall (linux-386), const ETH_P_DEC ideal-int +pkg syscall (linux-386), const ETH_P_DIAG ideal-int +pkg syscall (linux-386), const ETH_P_DNA_DL ideal-int +pkg syscall (linux-386), const ETH_P_DNA_RC ideal-int +pkg syscall (linux-386), const ETH_P_DNA_RT ideal-int +pkg syscall (linux-386), const ETH_P_DSA ideal-int +pkg syscall (linux-386), const ETH_P_ECONET ideal-int +pkg syscall (linux-386), const ETH_P_EDSA ideal-int +pkg syscall (linux-386), const ETH_P_FCOE ideal-int +pkg syscall (linux-386), const ETH_P_FIP ideal-int +pkg syscall (linux-386), const ETH_P_HDLC ideal-int +pkg syscall (linux-386), const ETH_P_IEEE802154 ideal-int +pkg syscall (linux-386), const ETH_P_IEEEPUP ideal-int +pkg syscall (linux-386), const ETH_P_IEEEPUPAT ideal-int +pkg syscall (linux-386), const ETH_P_IP ideal-int +pkg syscall (linux-386), const ETH_P_IPV6 ideal-int +pkg syscall (linux-386), const ETH_P_IPX ideal-int +pkg syscall (linux-386), const ETH_P_IRDA ideal-int +pkg syscall (linux-386), const ETH_P_LAT ideal-int +pkg syscall (linux-386), const ETH_P_LINK_CTL ideal-int +pkg syscall (linux-386), const ETH_P_LOCALTALK ideal-int +pkg syscall (linux-386), const ETH_P_LOOP ideal-int +pkg syscall (linux-386), const ETH_P_MOBITEX ideal-int +pkg syscall (linux-386), const ETH_P_MPLS_MC ideal-int +pkg syscall (linux-386), const ETH_P_MPLS_UC ideal-int +pkg syscall (linux-386), const ETH_P_PAE ideal-int +pkg syscall (linux-386), const ETH_P_PAUSE ideal-int +pkg syscall (linux-386), const ETH_P_PHONET ideal-int +pkg syscall (linux-386), const ETH_P_PPPTALK ideal-int +pkg syscall (linux-386), const ETH_P_PPP_DISC ideal-int +pkg syscall (linux-386), const ETH_P_PPP_MP ideal-int +pkg syscall (linux-386), const ETH_P_PPP_SES ideal-int +pkg syscall (linux-386), const ETH_P_PUP ideal-int +pkg syscall (linux-386), const ETH_P_PUPAT ideal-int +pkg syscall (linux-386), const ETH_P_RARP ideal-int +pkg syscall (linux-386), const ETH_P_SCA ideal-int +pkg syscall (linux-386), const ETH_P_SLOW ideal-int +pkg syscall (linux-386), const ETH_P_SNAP ideal-int +pkg syscall (linux-386), const ETH_P_TEB ideal-int +pkg syscall (linux-386), const ETH_P_TIPC ideal-int +pkg syscall (linux-386), const ETH_P_TRAILER ideal-int +pkg syscall (linux-386), const ETH_P_TR_802_2 ideal-int +pkg syscall (linux-386), const ETH_P_WAN_PPP ideal-int +pkg syscall (linux-386), const ETH_P_WCCP ideal-int +pkg syscall (linux-386), const ETH_P_X25 ideal-int +pkg syscall (linux-386), const ETIME Errno +pkg syscall (linux-386), const EUCLEAN Errno +pkg syscall (linux-386), const EUNATCH Errno +pkg syscall (linux-386), const EXFULL Errno +pkg syscall (linux-386), const FD_CLOEXEC ideal-int +pkg syscall (linux-386), const FD_SETSIZE ideal-int +pkg syscall (linux-386), const FLUSHO ideal-int +pkg syscall (linux-386), const F_DUPFD ideal-int +pkg syscall (linux-386), const F_DUPFD_CLOEXEC ideal-int +pkg syscall (linux-386), const F_EXLCK ideal-int +pkg syscall (linux-386), const F_GETFD ideal-int +pkg syscall (linux-386), const F_GETFL ideal-int +pkg syscall (linux-386), const F_GETLEASE ideal-int +pkg syscall (linux-386), const F_GETLK ideal-int +pkg syscall (linux-386), const F_GETLK64 ideal-int +pkg syscall (linux-386), const F_GETOWN ideal-int +pkg syscall (linux-386), const F_GETOWN_EX ideal-int +pkg syscall (linux-386), const F_GETPIPE_SZ ideal-int +pkg syscall (linux-386), const F_GETSIG ideal-int +pkg syscall (linux-386), const F_LOCK ideal-int +pkg syscall (linux-386), const F_NOTIFY ideal-int +pkg syscall (linux-386), const F_OK ideal-int +pkg syscall (linux-386), const F_RDLCK ideal-int +pkg syscall (linux-386), const F_SETFD ideal-int +pkg syscall (linux-386), const F_SETFL ideal-int +pkg syscall (linux-386), const F_SETLEASE ideal-int +pkg syscall (linux-386), const F_SETLK ideal-int +pkg syscall (linux-386), const F_SETLK64 ideal-int +pkg syscall (linux-386), const F_SETLKW ideal-int +pkg syscall (linux-386), const F_SETLKW64 ideal-int +pkg syscall (linux-386), const F_SETOWN ideal-int +pkg syscall (linux-386), const F_SETOWN_EX ideal-int +pkg syscall (linux-386), const F_SETPIPE_SZ ideal-int +pkg syscall (linux-386), const F_SETSIG ideal-int +pkg syscall (linux-386), const F_SHLCK ideal-int +pkg syscall (linux-386), const F_TEST ideal-int +pkg syscall (linux-386), const F_TLOCK ideal-int +pkg syscall (linux-386), const F_ULOCK ideal-int +pkg syscall (linux-386), const F_UNLCK ideal-int +pkg syscall (linux-386), const F_WRLCK ideal-int +pkg syscall (linux-386), const HUPCL ideal-int +pkg syscall (linux-386), const ICANON ideal-int +pkg syscall (linux-386), const ICRNL ideal-int +pkg syscall (linux-386), const IEXTEN ideal-int +pkg syscall (linux-386), const IFA_ADDRESS ideal-int +pkg syscall (linux-386), const IFA_ANYCAST ideal-int +pkg syscall (linux-386), const IFA_BROADCAST ideal-int +pkg syscall (linux-386), const IFA_CACHEINFO ideal-int +pkg syscall (linux-386), const IFA_F_DADFAILED ideal-int +pkg syscall (linux-386), const IFA_F_DEPRECATED ideal-int +pkg syscall (linux-386), const IFA_F_HOMEADDRESS ideal-int +pkg syscall (linux-386), const IFA_F_NODAD ideal-int +pkg syscall (linux-386), const IFA_F_OPTIMISTIC ideal-int +pkg syscall (linux-386), const IFA_F_PERMANENT ideal-int +pkg syscall (linux-386), const IFA_F_SECONDARY ideal-int +pkg syscall (linux-386), const IFA_F_TEMPORARY ideal-int +pkg syscall (linux-386), const IFA_F_TENTATIVE ideal-int +pkg syscall (linux-386), const IFA_LABEL ideal-int +pkg syscall (linux-386), const IFA_LOCAL ideal-int +pkg syscall (linux-386), const IFA_MAX ideal-int +pkg syscall (linux-386), const IFA_MULTICAST ideal-int +pkg syscall (linux-386), const IFA_UNSPEC ideal-int +pkg syscall (linux-386), const IFF_ALLMULTI ideal-int +pkg syscall (linux-386), const IFF_AUTOMEDIA ideal-int +pkg syscall (linux-386), const IFF_DEBUG ideal-int +pkg syscall (linux-386), const IFF_DYNAMIC ideal-int +pkg syscall (linux-386), const IFF_MASTER ideal-int +pkg syscall (linux-386), const IFF_NOARP ideal-int +pkg syscall (linux-386), const IFF_NOTRAILERS ideal-int +pkg syscall (linux-386), const IFF_NO_PI ideal-int +pkg syscall (linux-386), const IFF_ONE_QUEUE ideal-int +pkg syscall (linux-386), const IFF_POINTOPOINT ideal-int +pkg syscall (linux-386), const IFF_PORTSEL ideal-int +pkg syscall (linux-386), const IFF_PROMISC ideal-int +pkg syscall (linux-386), const IFF_RUNNING ideal-int +pkg syscall (linux-386), const IFF_SLAVE ideal-int +pkg syscall (linux-386), const IFF_TAP ideal-int +pkg syscall (linux-386), const IFF_TUN ideal-int +pkg syscall (linux-386), const IFF_TUN_EXCL ideal-int +pkg syscall (linux-386), const IFF_VNET_HDR ideal-int +pkg syscall (linux-386), const IFLA_ADDRESS ideal-int +pkg syscall (linux-386), const IFLA_BROADCAST ideal-int +pkg syscall (linux-386), const IFLA_COST ideal-int +pkg syscall (linux-386), const IFLA_IFALIAS ideal-int +pkg syscall (linux-386), const IFLA_IFNAME ideal-int +pkg syscall (linux-386), const IFLA_LINK ideal-int +pkg syscall (linux-386), const IFLA_LINKINFO ideal-int +pkg syscall (linux-386), const IFLA_LINKMODE ideal-int +pkg syscall (linux-386), const IFLA_MAP ideal-int +pkg syscall (linux-386), const IFLA_MASTER ideal-int +pkg syscall (linux-386), const IFLA_MAX ideal-int +pkg syscall (linux-386), const IFLA_MTU ideal-int +pkg syscall (linux-386), const IFLA_NET_NS_PID ideal-int +pkg syscall (linux-386), const IFLA_OPERSTATE ideal-int +pkg syscall (linux-386), const IFLA_PRIORITY ideal-int +pkg syscall (linux-386), const IFLA_PROTINFO ideal-int +pkg syscall (linux-386), const IFLA_QDISC ideal-int +pkg syscall (linux-386), const IFLA_STATS ideal-int +pkg syscall (linux-386), const IFLA_TXQLEN ideal-int +pkg syscall (linux-386), const IFLA_UNSPEC ideal-int +pkg syscall (linux-386), const IFLA_WEIGHT ideal-int +pkg syscall (linux-386), const IFLA_WIRELESS ideal-int +pkg syscall (linux-386), const IFNAMSIZ ideal-int +pkg syscall (linux-386), const IGNBRK ideal-int +pkg syscall (linux-386), const IGNCR ideal-int +pkg syscall (linux-386), const IGNPAR ideal-int +pkg syscall (linux-386), const IMAXBEL ideal-int +pkg syscall (linux-386), const INLCR ideal-int +pkg syscall (linux-386), const INPCK ideal-int +pkg syscall (linux-386), const IN_ACCESS ideal-int +pkg syscall (linux-386), const IN_ALL_EVENTS ideal-int +pkg syscall (linux-386), const IN_ATTRIB ideal-int +pkg syscall (linux-386), const IN_CLASSA_HOST ideal-int +pkg syscall (linux-386), const IN_CLASSA_MAX ideal-int +pkg syscall (linux-386), const IN_CLASSA_NET ideal-int +pkg syscall (linux-386), const IN_CLASSA_NSHIFT ideal-int +pkg syscall (linux-386), const IN_CLASSB_HOST ideal-int +pkg syscall (linux-386), const IN_CLASSB_MAX ideal-int +pkg syscall (linux-386), const IN_CLASSB_NET ideal-int +pkg syscall (linux-386), const IN_CLASSB_NSHIFT ideal-int +pkg syscall (linux-386), const IN_CLASSC_HOST ideal-int +pkg syscall (linux-386), const IN_CLASSC_NET ideal-int +pkg syscall (linux-386), const IN_CLASSC_NSHIFT ideal-int +pkg syscall (linux-386), const IN_CLOEXEC ideal-int +pkg syscall (linux-386), const IN_CLOSE ideal-int +pkg syscall (linux-386), const IN_CLOSE_NOWRITE ideal-int +pkg syscall (linux-386), const IN_CLOSE_WRITE ideal-int +pkg syscall (linux-386), const IN_CREATE ideal-int +pkg syscall (linux-386), const IN_DELETE ideal-int +pkg syscall (linux-386), const IN_DELETE_SELF ideal-int +pkg syscall (linux-386), const IN_DONT_FOLLOW ideal-int +pkg syscall (linux-386), const IN_EXCL_UNLINK ideal-int +pkg syscall (linux-386), const IN_IGNORED ideal-int +pkg syscall (linux-386), const IN_ISDIR ideal-int +pkg syscall (linux-386), const IN_LOOPBACKNET ideal-int +pkg syscall (linux-386), const IN_MASK_ADD ideal-int +pkg syscall (linux-386), const IN_MODIFY ideal-int +pkg syscall (linux-386), const IN_MOVE ideal-int +pkg syscall (linux-386), const IN_MOVED_FROM ideal-int +pkg syscall (linux-386), const IN_MOVED_TO ideal-int +pkg syscall (linux-386), const IN_MOVE_SELF ideal-int +pkg syscall (linux-386), const IN_NONBLOCK ideal-int +pkg syscall (linux-386), const IN_ONESHOT ideal-int +pkg syscall (linux-386), const IN_ONLYDIR ideal-int +pkg syscall (linux-386), const IN_OPEN ideal-int +pkg syscall (linux-386), const IN_Q_OVERFLOW ideal-int +pkg syscall (linux-386), const IN_UNMOUNT ideal-int +pkg syscall (linux-386), const IPPROTO_AH ideal-int +pkg syscall (linux-386), const IPPROTO_COMP ideal-int +pkg syscall (linux-386), const IPPROTO_DCCP ideal-int +pkg syscall (linux-386), const IPPROTO_DSTOPTS ideal-int +pkg syscall (linux-386), const IPPROTO_EGP ideal-int +pkg syscall (linux-386), const IPPROTO_ENCAP ideal-int +pkg syscall (linux-386), const IPPROTO_ESP ideal-int +pkg syscall (linux-386), const IPPROTO_FRAGMENT ideal-int +pkg syscall (linux-386), const IPPROTO_GRE ideal-int +pkg syscall (linux-386), const IPPROTO_HOPOPTS ideal-int +pkg syscall (linux-386), const IPPROTO_ICMP ideal-int +pkg syscall (linux-386), const IPPROTO_ICMPV6 ideal-int +pkg syscall (linux-386), const IPPROTO_IDP ideal-int +pkg syscall (linux-386), const IPPROTO_IGMP ideal-int +pkg syscall (linux-386), const IPPROTO_IPIP ideal-int +pkg syscall (linux-386), const IPPROTO_MTP ideal-int +pkg syscall (linux-386), const IPPROTO_NONE ideal-int +pkg syscall (linux-386), const IPPROTO_PIM ideal-int +pkg syscall (linux-386), const IPPROTO_PUP ideal-int +pkg syscall (linux-386), const IPPROTO_RAW ideal-int +pkg syscall (linux-386), const IPPROTO_ROUTING ideal-int +pkg syscall (linux-386), const IPPROTO_RSVP ideal-int +pkg syscall (linux-386), const IPPROTO_SCTP ideal-int +pkg syscall (linux-386), const IPPROTO_TP ideal-int +pkg syscall (linux-386), const IPPROTO_UDPLITE ideal-int +pkg syscall (linux-386), const IPV6_2292DSTOPTS ideal-int +pkg syscall (linux-386), const IPV6_2292HOPLIMIT ideal-int +pkg syscall (linux-386), const IPV6_2292HOPOPTS ideal-int +pkg syscall (linux-386), const IPV6_2292PKTINFO ideal-int +pkg syscall (linux-386), const IPV6_2292PKTOPTIONS ideal-int +pkg syscall (linux-386), const IPV6_2292RTHDR ideal-int +pkg syscall (linux-386), const IPV6_ADDRFORM ideal-int +pkg syscall (linux-386), const IPV6_ADD_MEMBERSHIP ideal-int +pkg syscall (linux-386), const IPV6_AUTHHDR ideal-int +pkg syscall (linux-386), const IPV6_CHECKSUM ideal-int +pkg syscall (linux-386), const IPV6_DROP_MEMBERSHIP ideal-int +pkg syscall (linux-386), const IPV6_DSTOPTS ideal-int +pkg syscall (linux-386), const IPV6_HOPLIMIT ideal-int +pkg syscall (linux-386), const IPV6_HOPOPTS ideal-int +pkg syscall (linux-386), const IPV6_IPSEC_POLICY ideal-int +pkg syscall (linux-386), const IPV6_JOIN_ANYCAST ideal-int +pkg syscall (linux-386), const IPV6_LEAVE_ANYCAST ideal-int +pkg syscall (linux-386), const IPV6_MTU ideal-int +pkg syscall (linux-386), const IPV6_MTU_DISCOVER ideal-int +pkg syscall (linux-386), const IPV6_NEXTHOP ideal-int +pkg syscall (linux-386), const IPV6_PKTINFO ideal-int +pkg syscall (linux-386), const IPV6_PMTUDISC_DO ideal-int +pkg syscall (linux-386), const IPV6_PMTUDISC_DONT ideal-int +pkg syscall (linux-386), const IPV6_PMTUDISC_PROBE ideal-int +pkg syscall (linux-386), const IPV6_PMTUDISC_WANT ideal-int +pkg syscall (linux-386), const IPV6_RECVDSTOPTS ideal-int +pkg syscall (linux-386), const IPV6_RECVERR ideal-int +pkg syscall (linux-386), const IPV6_RECVHOPLIMIT ideal-int +pkg syscall (linux-386), const IPV6_RECVHOPOPTS ideal-int +pkg syscall (linux-386), const IPV6_RECVPKTINFO ideal-int +pkg syscall (linux-386), const IPV6_RECVRTHDR ideal-int +pkg syscall (linux-386), const IPV6_RECVTCLASS ideal-int +pkg syscall (linux-386), const IPV6_ROUTER_ALERT ideal-int +pkg syscall (linux-386), const IPV6_RTHDR ideal-int +pkg syscall (linux-386), const IPV6_RTHDRDSTOPTS ideal-int +pkg syscall (linux-386), const IPV6_RTHDR_LOOSE ideal-int +pkg syscall (linux-386), const IPV6_RTHDR_STRICT ideal-int +pkg syscall (linux-386), const IPV6_RTHDR_TYPE_0 ideal-int +pkg syscall (linux-386), const IPV6_RXDSTOPTS ideal-int +pkg syscall (linux-386), const IPV6_RXHOPOPTS ideal-int +pkg syscall (linux-386), const IPV6_TCLASS ideal-int +pkg syscall (linux-386), const IPV6_XFRM_POLICY ideal-int +pkg syscall (linux-386), const IP_ADD_SOURCE_MEMBERSHIP ideal-int +pkg syscall (linux-386), const IP_BLOCK_SOURCE ideal-int +pkg syscall (linux-386), const IP_DEFAULT_MULTICAST_LOOP ideal-int +pkg syscall (linux-386), const IP_DEFAULT_MULTICAST_TTL ideal-int +pkg syscall (linux-386), const IP_DF ideal-int +pkg syscall (linux-386), const IP_DROP_SOURCE_MEMBERSHIP ideal-int +pkg syscall (linux-386), const IP_FREEBIND ideal-int +pkg syscall (linux-386), const IP_HDRINCL ideal-int +pkg syscall (linux-386), const IP_IPSEC_POLICY ideal-int +pkg syscall (linux-386), const IP_MAXPACKET ideal-int +pkg syscall (linux-386), const IP_MAX_MEMBERSHIPS ideal-int +pkg syscall (linux-386), const IP_MF ideal-int +pkg syscall (linux-386), const IP_MINTTL ideal-int +pkg syscall (linux-386), const IP_MSFILTER ideal-int +pkg syscall (linux-386), const IP_MSS ideal-int +pkg syscall (linux-386), const IP_MTU ideal-int +pkg syscall (linux-386), const IP_MTU_DISCOVER ideal-int +pkg syscall (linux-386), const IP_OFFMASK ideal-int +pkg syscall (linux-386), const IP_OPTIONS ideal-int +pkg syscall (linux-386), const IP_ORIGDSTADDR ideal-int +pkg syscall (linux-386), const IP_PASSSEC ideal-int +pkg syscall (linux-386), const IP_PKTINFO ideal-int +pkg syscall (linux-386), const IP_PKTOPTIONS ideal-int +pkg syscall (linux-386), const IP_PMTUDISC ideal-int +pkg syscall (linux-386), const IP_PMTUDISC_DO ideal-int +pkg syscall (linux-386), const IP_PMTUDISC_DONT ideal-int +pkg syscall (linux-386), const IP_PMTUDISC_PROBE ideal-int +pkg syscall (linux-386), const IP_PMTUDISC_WANT ideal-int +pkg syscall (linux-386), const IP_RECVERR ideal-int +pkg syscall (linux-386), const IP_RECVOPTS ideal-int +pkg syscall (linux-386), const IP_RECVORIGDSTADDR ideal-int +pkg syscall (linux-386), const IP_RECVRETOPTS ideal-int +pkg syscall (linux-386), const IP_RECVTOS ideal-int +pkg syscall (linux-386), const IP_RECVTTL ideal-int +pkg syscall (linux-386), const IP_RETOPTS ideal-int +pkg syscall (linux-386), const IP_RF ideal-int +pkg syscall (linux-386), const IP_ROUTER_ALERT ideal-int +pkg syscall (linux-386), const IP_TRANSPARENT ideal-int +pkg syscall (linux-386), const IP_UNBLOCK_SOURCE ideal-int +pkg syscall (linux-386), const IP_XFRM_POLICY ideal-int +pkg syscall (linux-386), const ISIG ideal-int +pkg syscall (linux-386), const ISTRIP ideal-int +pkg syscall (linux-386), const IUCLC ideal-int +pkg syscall (linux-386), const IUTF8 ideal-int +pkg syscall (linux-386), const IXANY ideal-int +pkg syscall (linux-386), const IXOFF ideal-int +pkg syscall (linux-386), const IXON ideal-int +pkg syscall (linux-386), const LINUX_REBOOT_CMD_CAD_OFF ideal-int +pkg syscall (linux-386), const LINUX_REBOOT_CMD_CAD_ON ideal-int +pkg syscall (linux-386), const LINUX_REBOOT_CMD_HALT ideal-int +pkg syscall (linux-386), const LINUX_REBOOT_CMD_KEXEC ideal-int +pkg syscall (linux-386), const LINUX_REBOOT_CMD_POWER_OFF ideal-int +pkg syscall (linux-386), const LINUX_REBOOT_CMD_RESTART ideal-int +pkg syscall (linux-386), const LINUX_REBOOT_CMD_RESTART2 ideal-int +pkg syscall (linux-386), const LINUX_REBOOT_CMD_SW_SUSPEND ideal-int +pkg syscall (linux-386), const LINUX_REBOOT_MAGIC1 ideal-int +pkg syscall (linux-386), const LINUX_REBOOT_MAGIC2 ideal-int +pkg syscall (linux-386), const LOCK_EX ideal-int +pkg syscall (linux-386), const LOCK_NB ideal-int +pkg syscall (linux-386), const LOCK_SH ideal-int +pkg syscall (linux-386), const LOCK_UN ideal-int +pkg syscall (linux-386), const MADV_DOFORK ideal-int +pkg syscall (linux-386), const MADV_DONTFORK ideal-int +pkg syscall (linux-386), const MADV_DONTNEED ideal-int +pkg syscall (linux-386), const MADV_HUGEPAGE ideal-int +pkg syscall (linux-386), const MADV_HWPOISON ideal-int +pkg syscall (linux-386), const MADV_MERGEABLE ideal-int +pkg syscall (linux-386), const MADV_NOHUGEPAGE ideal-int +pkg syscall (linux-386), const MADV_NORMAL ideal-int +pkg syscall (linux-386), const MADV_RANDOM ideal-int +pkg syscall (linux-386), const MADV_REMOVE ideal-int +pkg syscall (linux-386), const MADV_SEQUENTIAL ideal-int +pkg syscall (linux-386), const MADV_UNMERGEABLE ideal-int +pkg syscall (linux-386), const MADV_WILLNEED ideal-int +pkg syscall (linux-386), const MAP_32BIT ideal-int +pkg syscall (linux-386), const MAP_ANON ideal-int +pkg syscall (linux-386), const MAP_ANONYMOUS ideal-int +pkg syscall (linux-386), const MAP_DENYWRITE ideal-int +pkg syscall (linux-386), const MAP_EXECUTABLE ideal-int +pkg syscall (linux-386), const MAP_FILE ideal-int +pkg syscall (linux-386), const MAP_FIXED ideal-int +pkg syscall (linux-386), const MAP_GROWSDOWN ideal-int +pkg syscall (linux-386), const MAP_HUGETLB ideal-int +pkg syscall (linux-386), const MAP_LOCKED ideal-int +pkg syscall (linux-386), const MAP_NONBLOCK ideal-int +pkg syscall (linux-386), const MAP_NORESERVE ideal-int +pkg syscall (linux-386), const MAP_POPULATE ideal-int +pkg syscall (linux-386), const MAP_PRIVATE ideal-int +pkg syscall (linux-386), const MAP_SHARED ideal-int +pkg syscall (linux-386), const MAP_STACK ideal-int +pkg syscall (linux-386), const MAP_TYPE ideal-int +pkg syscall (linux-386), const MCL_CURRENT ideal-int +pkg syscall (linux-386), const MCL_FUTURE ideal-int +pkg syscall (linux-386), const MNT_DETACH ideal-int +pkg syscall (linux-386), const MNT_EXPIRE ideal-int +pkg syscall (linux-386), const MNT_FORCE ideal-int +pkg syscall (linux-386), const MSG_CMSG_CLOEXEC ideal-int +pkg syscall (linux-386), const MSG_CONFIRM ideal-int +pkg syscall (linux-386), const MSG_CTRUNC ideal-int +pkg syscall (linux-386), const MSG_DONTROUTE ideal-int +pkg syscall (linux-386), const MSG_DONTWAIT ideal-int +pkg syscall (linux-386), const MSG_EOR ideal-int +pkg syscall (linux-386), const MSG_ERRQUEUE ideal-int +pkg syscall (linux-386), const MSG_FIN ideal-int +pkg syscall (linux-386), const MSG_MORE ideal-int +pkg syscall (linux-386), const MSG_NOSIGNAL ideal-int +pkg syscall (linux-386), const MSG_OOB ideal-int +pkg syscall (linux-386), const MSG_PEEK ideal-int +pkg syscall (linux-386), const MSG_PROXY ideal-int +pkg syscall (linux-386), const MSG_RST ideal-int +pkg syscall (linux-386), const MSG_SYN ideal-int +pkg syscall (linux-386), const MSG_TRUNC ideal-int +pkg syscall (linux-386), const MSG_TRYHARD ideal-int +pkg syscall (linux-386), const MSG_WAITALL ideal-int +pkg syscall (linux-386), const MSG_WAITFORONE ideal-int +pkg syscall (linux-386), const MS_ACTIVE ideal-int +pkg syscall (linux-386), const MS_ASYNC ideal-int +pkg syscall (linux-386), const MS_BIND ideal-int +pkg syscall (linux-386), const MS_DIRSYNC ideal-int +pkg syscall (linux-386), const MS_INVALIDATE ideal-int +pkg syscall (linux-386), const MS_I_VERSION ideal-int +pkg syscall (linux-386), const MS_KERNMOUNT ideal-int +pkg syscall (linux-386), const MS_MANDLOCK ideal-int +pkg syscall (linux-386), const MS_MGC_MSK ideal-int +pkg syscall (linux-386), const MS_MGC_VAL ideal-int +pkg syscall (linux-386), const MS_MOVE ideal-int +pkg syscall (linux-386), const MS_NOATIME ideal-int +pkg syscall (linux-386), const MS_NODEV ideal-int +pkg syscall (linux-386), const MS_NODIRATIME ideal-int +pkg syscall (linux-386), const MS_NOEXEC ideal-int +pkg syscall (linux-386), const MS_NOSUID ideal-int +pkg syscall (linux-386), const MS_NOUSER ideal-int +pkg syscall (linux-386), const MS_POSIXACL ideal-int +pkg syscall (linux-386), const MS_PRIVATE ideal-int +pkg syscall (linux-386), const MS_RDONLY ideal-int +pkg syscall (linux-386), const MS_REC ideal-int +pkg syscall (linux-386), const MS_RELATIME ideal-int +pkg syscall (linux-386), const MS_REMOUNT ideal-int +pkg syscall (linux-386), const MS_RMT_MASK ideal-int +pkg syscall (linux-386), const MS_SHARED ideal-int +pkg syscall (linux-386), const MS_SILENT ideal-int +pkg syscall (linux-386), const MS_SLAVE ideal-int +pkg syscall (linux-386), const MS_STRICTATIME ideal-int +pkg syscall (linux-386), const MS_SYNC ideal-int +pkg syscall (linux-386), const MS_SYNCHRONOUS ideal-int +pkg syscall (linux-386), const MS_UNBINDABLE ideal-int +pkg syscall (linux-386), const NAME_MAX ideal-int +pkg syscall (linux-386), const NETLINK_ADD_MEMBERSHIP ideal-int +pkg syscall (linux-386), const NETLINK_AUDIT ideal-int +pkg syscall (linux-386), const NETLINK_BROADCAST_ERROR ideal-int +pkg syscall (linux-386), const NETLINK_CONNECTOR ideal-int +pkg syscall (linux-386), const NETLINK_DNRTMSG ideal-int +pkg syscall (linux-386), const NETLINK_DROP_MEMBERSHIP ideal-int +pkg syscall (linux-386), const NETLINK_ECRYPTFS ideal-int +pkg syscall (linux-386), const NETLINK_FIB_LOOKUP ideal-int +pkg syscall (linux-386), const NETLINK_FIREWALL ideal-int +pkg syscall (linux-386), const NETLINK_GENERIC ideal-int +pkg syscall (linux-386), const NETLINK_INET_DIAG ideal-int +pkg syscall (linux-386), const NETLINK_IP6_FW ideal-int +pkg syscall (linux-386), const NETLINK_ISCSI ideal-int +pkg syscall (linux-386), const NETLINK_KOBJECT_UEVENT ideal-int +pkg syscall (linux-386), const NETLINK_NETFILTER ideal-int +pkg syscall (linux-386), const NETLINK_NFLOG ideal-int +pkg syscall (linux-386), const NETLINK_NO_ENOBUFS ideal-int +pkg syscall (linux-386), const NETLINK_PKTINFO ideal-int +pkg syscall (linux-386), const NETLINK_ROUTE ideal-int +pkg syscall (linux-386), const NETLINK_SCSITRANSPORT ideal-int +pkg syscall (linux-386), const NETLINK_SELINUX ideal-int +pkg syscall (linux-386), const NETLINK_UNUSED ideal-int +pkg syscall (linux-386), const NETLINK_USERSOCK ideal-int +pkg syscall (linux-386), const NETLINK_XFRM ideal-int +pkg syscall (linux-386), const NLA_ALIGNTO ideal-int +pkg syscall (linux-386), const NLA_F_NESTED ideal-int +pkg syscall (linux-386), const NLA_F_NET_BYTEORDER ideal-int +pkg syscall (linux-386), const NLA_HDRLEN ideal-int +pkg syscall (linux-386), const NLMSG_ALIGNTO ideal-int +pkg syscall (linux-386), const NLMSG_DONE ideal-int +pkg syscall (linux-386), const NLMSG_ERROR ideal-int +pkg syscall (linux-386), const NLMSG_HDRLEN ideal-int +pkg syscall (linux-386), const NLMSG_MIN_TYPE ideal-int +pkg syscall (linux-386), const NLMSG_NOOP ideal-int +pkg syscall (linux-386), const NLMSG_OVERRUN ideal-int +pkg syscall (linux-386), const NLM_F_ACK ideal-int +pkg syscall (linux-386), const NLM_F_APPEND ideal-int +pkg syscall (linux-386), const NLM_F_ATOMIC ideal-int +pkg syscall (linux-386), const NLM_F_CREATE ideal-int +pkg syscall (linux-386), const NLM_F_DUMP ideal-int +pkg syscall (linux-386), const NLM_F_ECHO ideal-int +pkg syscall (linux-386), const NLM_F_EXCL ideal-int +pkg syscall (linux-386), const NLM_F_MATCH ideal-int +pkg syscall (linux-386), const NLM_F_MULTI ideal-int +pkg syscall (linux-386), const NLM_F_REPLACE ideal-int +pkg syscall (linux-386), const NLM_F_REQUEST ideal-int +pkg syscall (linux-386), const NLM_F_ROOT ideal-int +pkg syscall (linux-386), const NOFLSH ideal-int +pkg syscall (linux-386), const OCRNL ideal-int +pkg syscall (linux-386), const OFDEL ideal-int +pkg syscall (linux-386), const OFILL ideal-int +pkg syscall (linux-386), const OLCUC ideal-int +pkg syscall (linux-386), const ONLCR ideal-int +pkg syscall (linux-386), const ONLRET ideal-int +pkg syscall (linux-386), const ONOCR ideal-int +pkg syscall (linux-386), const OPOST ideal-int +pkg syscall (linux-386), const O_ACCMODE ideal-int +pkg syscall (linux-386), const O_DIRECT ideal-int +pkg syscall (linux-386), const O_DIRECTORY ideal-int +pkg syscall (linux-386), const O_DSYNC ideal-int +pkg syscall (linux-386), const O_FSYNC ideal-int +pkg syscall (linux-386), const O_LARGEFILE ideal-int +pkg syscall (linux-386), const O_NDELAY ideal-int +pkg syscall (linux-386), const O_NOATIME ideal-int +pkg syscall (linux-386), const O_NOFOLLOW ideal-int +pkg syscall (linux-386), const O_RSYNC ideal-int +pkg syscall (linux-386), const PACKET_ADD_MEMBERSHIP ideal-int +pkg syscall (linux-386), const PACKET_BROADCAST ideal-int +pkg syscall (linux-386), const PACKET_DROP_MEMBERSHIP ideal-int +pkg syscall (linux-386), const PACKET_FASTROUTE ideal-int +pkg syscall (linux-386), const PACKET_HOST ideal-int +pkg syscall (linux-386), const PACKET_LOOPBACK ideal-int +pkg syscall (linux-386), const PACKET_MR_ALLMULTI ideal-int +pkg syscall (linux-386), const PACKET_MR_MULTICAST ideal-int +pkg syscall (linux-386), const PACKET_MR_PROMISC ideal-int +pkg syscall (linux-386), const PACKET_MULTICAST ideal-int +pkg syscall (linux-386), const PACKET_OTHERHOST ideal-int +pkg syscall (linux-386), const PACKET_OUTGOING ideal-int +pkg syscall (linux-386), const PACKET_RECV_OUTPUT ideal-int +pkg syscall (linux-386), const PACKET_RX_RING ideal-int +pkg syscall (linux-386), const PACKET_STATISTICS ideal-int +pkg syscall (linux-386), const PARENB ideal-int +pkg syscall (linux-386), const PARMRK ideal-int +pkg syscall (linux-386), const PARODD ideal-int +pkg syscall (linux-386), const PENDIN ideal-int +pkg syscall (linux-386), const PROT_EXEC ideal-int +pkg syscall (linux-386), const PROT_GROWSDOWN ideal-int +pkg syscall (linux-386), const PROT_GROWSUP ideal-int +pkg syscall (linux-386), const PROT_NONE ideal-int +pkg syscall (linux-386), const PROT_READ ideal-int +pkg syscall (linux-386), const PROT_WRITE ideal-int +pkg syscall (linux-386), const PR_CAPBSET_DROP ideal-int +pkg syscall (linux-386), const PR_CAPBSET_READ ideal-int +pkg syscall (linux-386), const PR_ENDIAN_BIG ideal-int +pkg syscall (linux-386), const PR_ENDIAN_LITTLE ideal-int +pkg syscall (linux-386), const PR_ENDIAN_PPC_LITTLE ideal-int +pkg syscall (linux-386), const PR_FPEMU_NOPRINT ideal-int +pkg syscall (linux-386), const PR_FPEMU_SIGFPE ideal-int +pkg syscall (linux-386), const PR_FP_EXC_ASYNC ideal-int +pkg syscall (linux-386), const PR_FP_EXC_DISABLED ideal-int +pkg syscall (linux-386), const PR_FP_EXC_DIV ideal-int +pkg syscall (linux-386), const PR_FP_EXC_INV ideal-int +pkg syscall (linux-386), const PR_FP_EXC_NONRECOV ideal-int +pkg syscall (linux-386), const PR_FP_EXC_OVF ideal-int +pkg syscall (linux-386), const PR_FP_EXC_PRECISE ideal-int +pkg syscall (linux-386), const PR_FP_EXC_RES ideal-int +pkg syscall (linux-386), const PR_FP_EXC_SW_ENABLE ideal-int +pkg syscall (linux-386), const PR_FP_EXC_UND ideal-int +pkg syscall (linux-386), const PR_GET_DUMPABLE ideal-int +pkg syscall (linux-386), const PR_GET_ENDIAN ideal-int +pkg syscall (linux-386), const PR_GET_FPEMU ideal-int +pkg syscall (linux-386), const PR_GET_FPEXC ideal-int +pkg syscall (linux-386), const PR_GET_KEEPCAPS ideal-int +pkg syscall (linux-386), const PR_GET_NAME ideal-int +pkg syscall (linux-386), const PR_GET_PDEATHSIG ideal-int +pkg syscall (linux-386), const PR_GET_SECCOMP ideal-int +pkg syscall (linux-386), const PR_GET_SECUREBITS ideal-int +pkg syscall (linux-386), const PR_GET_TIMERSLACK ideal-int +pkg syscall (linux-386), const PR_GET_TIMING ideal-int +pkg syscall (linux-386), const PR_GET_TSC ideal-int +pkg syscall (linux-386), const PR_GET_UNALIGN ideal-int +pkg syscall (linux-386), const PR_MCE_KILL ideal-int +pkg syscall (linux-386), const PR_MCE_KILL_CLEAR ideal-int +pkg syscall (linux-386), const PR_MCE_KILL_DEFAULT ideal-int +pkg syscall (linux-386), const PR_MCE_KILL_EARLY ideal-int +pkg syscall (linux-386), const PR_MCE_KILL_GET ideal-int +pkg syscall (linux-386), const PR_MCE_KILL_LATE ideal-int +pkg syscall (linux-386), const PR_MCE_KILL_SET ideal-int +pkg syscall (linux-386), const PR_SET_DUMPABLE ideal-int +pkg syscall (linux-386), const PR_SET_ENDIAN ideal-int +pkg syscall (linux-386), const PR_SET_FPEMU ideal-int +pkg syscall (linux-386), const PR_SET_FPEXC ideal-int +pkg syscall (linux-386), const PR_SET_KEEPCAPS ideal-int +pkg syscall (linux-386), const PR_SET_NAME ideal-int +pkg syscall (linux-386), const PR_SET_PDEATHSIG ideal-int +pkg syscall (linux-386), const PR_SET_PTRACER ideal-int +pkg syscall (linux-386), const PR_SET_SECCOMP ideal-int +pkg syscall (linux-386), const PR_SET_SECUREBITS ideal-int +pkg syscall (linux-386), const PR_SET_TIMERSLACK ideal-int +pkg syscall (linux-386), const PR_SET_TIMING ideal-int +pkg syscall (linux-386), const PR_SET_TSC ideal-int +pkg syscall (linux-386), const PR_SET_UNALIGN ideal-int +pkg syscall (linux-386), const PR_TASK_PERF_EVENTS_DISABLE ideal-int +pkg syscall (linux-386), const PR_TASK_PERF_EVENTS_ENABLE ideal-int +pkg syscall (linux-386), const PR_TIMING_STATISTICAL ideal-int +pkg syscall (linux-386), const PR_TIMING_TIMESTAMP ideal-int +pkg syscall (linux-386), const PR_TSC_ENABLE ideal-int +pkg syscall (linux-386), const PR_TSC_SIGSEGV ideal-int +pkg syscall (linux-386), const PR_UNALIGN_NOPRINT ideal-int +pkg syscall (linux-386), const PR_UNALIGN_SIGBUS ideal-int +pkg syscall (linux-386), const PTRACE_ATTACH ideal-int +pkg syscall (linux-386), const PTRACE_CONT ideal-int +pkg syscall (linux-386), const PTRACE_DETACH ideal-int +pkg syscall (linux-386), const PTRACE_EVENT_CLONE ideal-int +pkg syscall (linux-386), const PTRACE_EVENT_EXEC ideal-int +pkg syscall (linux-386), const PTRACE_EVENT_EXIT ideal-int +pkg syscall (linux-386), const PTRACE_EVENT_FORK ideal-int +pkg syscall (linux-386), const PTRACE_EVENT_VFORK ideal-int +pkg syscall (linux-386), const PTRACE_EVENT_VFORK_DONE ideal-int +pkg syscall (linux-386), const PTRACE_GETEVENTMSG ideal-int +pkg syscall (linux-386), const PTRACE_GETFPREGS ideal-int +pkg syscall (linux-386), const PTRACE_GETFPXREGS ideal-int +pkg syscall (linux-386), const PTRACE_GETREGS ideal-int +pkg syscall (linux-386), const PTRACE_GETREGSET ideal-int +pkg syscall (linux-386), const PTRACE_GETSIGINFO ideal-int +pkg syscall (linux-386), const PTRACE_GET_THREAD_AREA ideal-int +pkg syscall (linux-386), const PTRACE_KILL ideal-int +pkg syscall (linux-386), const PTRACE_OLDSETOPTIONS ideal-int +pkg syscall (linux-386), const PTRACE_O_MASK ideal-int +pkg syscall (linux-386), const PTRACE_O_TRACECLONE ideal-int +pkg syscall (linux-386), const PTRACE_O_TRACEEXEC ideal-int +pkg syscall (linux-386), const PTRACE_O_TRACEEXIT ideal-int +pkg syscall (linux-386), const PTRACE_O_TRACEFORK ideal-int +pkg syscall (linux-386), const PTRACE_O_TRACESYSGOOD ideal-int +pkg syscall (linux-386), const PTRACE_O_TRACEVFORK ideal-int +pkg syscall (linux-386), const PTRACE_O_TRACEVFORKDONE ideal-int +pkg syscall (linux-386), const PTRACE_PEEKDATA ideal-int +pkg syscall (linux-386), const PTRACE_PEEKTEXT ideal-int +pkg syscall (linux-386), const PTRACE_PEEKUSR ideal-int +pkg syscall (linux-386), const PTRACE_POKEDATA ideal-int +pkg syscall (linux-386), const PTRACE_POKETEXT ideal-int +pkg syscall (linux-386), const PTRACE_POKEUSR ideal-int +pkg syscall (linux-386), const PTRACE_SETFPREGS ideal-int +pkg syscall (linux-386), const PTRACE_SETFPXREGS ideal-int +pkg syscall (linux-386), const PTRACE_SETOPTIONS ideal-int +pkg syscall (linux-386), const PTRACE_SETREGS ideal-int +pkg syscall (linux-386), const PTRACE_SETREGSET ideal-int +pkg syscall (linux-386), const PTRACE_SETSIGINFO ideal-int +pkg syscall (linux-386), const PTRACE_SET_THREAD_AREA ideal-int +pkg syscall (linux-386), const PTRACE_SINGLEBLOCK ideal-int +pkg syscall (linux-386), const PTRACE_SINGLESTEP ideal-int +pkg syscall (linux-386), const PTRACE_SYSCALL ideal-int +pkg syscall (linux-386), const PTRACE_SYSEMU ideal-int +pkg syscall (linux-386), const PTRACE_SYSEMU_SINGLESTEP ideal-int +pkg syscall (linux-386), const PTRACE_TRACEME ideal-int +pkg syscall (linux-386), const PathMax ideal-int +pkg syscall (linux-386), const RLIMIT_AS ideal-int +pkg syscall (linux-386), const RLIMIT_CORE ideal-int +pkg syscall (linux-386), const RLIMIT_CPU ideal-int +pkg syscall (linux-386), const RLIMIT_DATA ideal-int +pkg syscall (linux-386), const RLIMIT_FSIZE ideal-int +pkg syscall (linux-386), const RLIMIT_NOFILE ideal-int +pkg syscall (linux-386), const RLIMIT_STACK ideal-int +pkg syscall (linux-386), const RLIM_INFINITY ideal-int +pkg syscall (linux-386), const RTAX_ADVMSS ideal-int +pkg syscall (linux-386), const RTAX_CWND ideal-int +pkg syscall (linux-386), const RTAX_FEATURES ideal-int +pkg syscall (linux-386), const RTAX_FEATURE_ALLFRAG ideal-int +pkg syscall (linux-386), const RTAX_FEATURE_ECN ideal-int +pkg syscall (linux-386), const RTAX_FEATURE_SACK ideal-int +pkg syscall (linux-386), const RTAX_FEATURE_TIMESTAMP ideal-int +pkg syscall (linux-386), const RTAX_HOPLIMIT ideal-int +pkg syscall (linux-386), const RTAX_INITCWND ideal-int +pkg syscall (linux-386), const RTAX_INITRWND ideal-int +pkg syscall (linux-386), const RTAX_LOCK ideal-int +pkg syscall (linux-386), const RTAX_MAX ideal-int +pkg syscall (linux-386), const RTAX_MTU ideal-int +pkg syscall (linux-386), const RTAX_REORDERING ideal-int +pkg syscall (linux-386), const RTAX_RTO_MIN ideal-int +pkg syscall (linux-386), const RTAX_RTT ideal-int +pkg syscall (linux-386), const RTAX_RTTVAR ideal-int +pkg syscall (linux-386), const RTAX_SSTHRESH ideal-int +pkg syscall (linux-386), const RTAX_UNSPEC ideal-int +pkg syscall (linux-386), const RTAX_WINDOW ideal-int +pkg syscall (linux-386), const RTA_ALIGNTO ideal-int +pkg syscall (linux-386), const RTA_CACHEINFO ideal-int +pkg syscall (linux-386), const RTA_DST ideal-int +pkg syscall (linux-386), const RTA_FLOW ideal-int +pkg syscall (linux-386), const RTA_GATEWAY ideal-int +pkg syscall (linux-386), const RTA_IIF ideal-int +pkg syscall (linux-386), const RTA_MAX ideal-int +pkg syscall (linux-386), const RTA_METRICS ideal-int +pkg syscall (linux-386), const RTA_MULTIPATH ideal-int +pkg syscall (linux-386), const RTA_OIF ideal-int +pkg syscall (linux-386), const RTA_PREFSRC ideal-int +pkg syscall (linux-386), const RTA_PRIORITY ideal-int +pkg syscall (linux-386), const RTA_SRC ideal-int +pkg syscall (linux-386), const RTA_TABLE ideal-int +pkg syscall (linux-386), const RTA_UNSPEC ideal-int +pkg syscall (linux-386), const RTCF_DIRECTSRC ideal-int +pkg syscall (linux-386), const RTCF_DOREDIRECT ideal-int +pkg syscall (linux-386), const RTCF_LOG ideal-int +pkg syscall (linux-386), const RTCF_MASQ ideal-int +pkg syscall (linux-386), const RTCF_NAT ideal-int +pkg syscall (linux-386), const RTCF_VALVE ideal-int +pkg syscall (linux-386), const RTF_ADDRCLASSMASK ideal-int +pkg syscall (linux-386), const RTF_ADDRCONF ideal-int +pkg syscall (linux-386), const RTF_ALLONLINK ideal-int +pkg syscall (linux-386), const RTF_BROADCAST ideal-int +pkg syscall (linux-386), const RTF_CACHE ideal-int +pkg syscall (linux-386), const RTF_DEFAULT ideal-int +pkg syscall (linux-386), const RTF_DYNAMIC ideal-int +pkg syscall (linux-386), const RTF_FLOW ideal-int +pkg syscall (linux-386), const RTF_GATEWAY ideal-int +pkg syscall (linux-386), const RTF_HOST ideal-int +pkg syscall (linux-386), const RTF_INTERFACE ideal-int +pkg syscall (linux-386), const RTF_IRTT ideal-int +pkg syscall (linux-386), const RTF_LINKRT ideal-int +pkg syscall (linux-386), const RTF_LOCAL ideal-int +pkg syscall (linux-386), const RTF_MODIFIED ideal-int +pkg syscall (linux-386), const RTF_MSS ideal-int +pkg syscall (linux-386), const RTF_MTU ideal-int +pkg syscall (linux-386), const RTF_MULTICAST ideal-int +pkg syscall (linux-386), const RTF_NAT ideal-int +pkg syscall (linux-386), const RTF_NOFORWARD ideal-int +pkg syscall (linux-386), const RTF_NONEXTHOP ideal-int +pkg syscall (linux-386), const RTF_NOPMTUDISC ideal-int +pkg syscall (linux-386), const RTF_POLICY ideal-int +pkg syscall (linux-386), const RTF_REINSTATE ideal-int +pkg syscall (linux-386), const RTF_REJECT ideal-int +pkg syscall (linux-386), const RTF_STATIC ideal-int +pkg syscall (linux-386), const RTF_THROW ideal-int +pkg syscall (linux-386), const RTF_UP ideal-int +pkg syscall (linux-386), const RTF_WINDOW ideal-int +pkg syscall (linux-386), const RTF_XRESOLVE ideal-int +pkg syscall (linux-386), const RTM_BASE ideal-int +pkg syscall (linux-386), const RTM_DELACTION ideal-int +pkg syscall (linux-386), const RTM_DELADDR ideal-int +pkg syscall (linux-386), const RTM_DELADDRLABEL ideal-int +pkg syscall (linux-386), const RTM_DELLINK ideal-int +pkg syscall (linux-386), const RTM_DELNEIGH ideal-int +pkg syscall (linux-386), const RTM_DELQDISC ideal-int +pkg syscall (linux-386), const RTM_DELROUTE ideal-int +pkg syscall (linux-386), const RTM_DELRULE ideal-int +pkg syscall (linux-386), const RTM_DELTCLASS ideal-int +pkg syscall (linux-386), const RTM_DELTFILTER ideal-int +pkg syscall (linux-386), const RTM_F_CLONED ideal-int +pkg syscall (linux-386), const RTM_F_EQUALIZE ideal-int +pkg syscall (linux-386), const RTM_F_NOTIFY ideal-int +pkg syscall (linux-386), const RTM_F_PREFIX ideal-int +pkg syscall (linux-386), const RTM_GETACTION ideal-int +pkg syscall (linux-386), const RTM_GETADDR ideal-int +pkg syscall (linux-386), const RTM_GETADDRLABEL ideal-int +pkg syscall (linux-386), const RTM_GETANYCAST ideal-int +pkg syscall (linux-386), const RTM_GETDCB ideal-int +pkg syscall (linux-386), const RTM_GETLINK ideal-int +pkg syscall (linux-386), const RTM_GETMULTICAST ideal-int +pkg syscall (linux-386), const RTM_GETNEIGH ideal-int +pkg syscall (linux-386), const RTM_GETNEIGHTBL ideal-int +pkg syscall (linux-386), const RTM_GETQDISC ideal-int +pkg syscall (linux-386), const RTM_GETROUTE ideal-int +pkg syscall (linux-386), const RTM_GETRULE ideal-int +pkg syscall (linux-386), const RTM_GETTCLASS ideal-int +pkg syscall (linux-386), const RTM_GETTFILTER ideal-int +pkg syscall (linux-386), const RTM_MAX ideal-int +pkg syscall (linux-386), const RTM_NEWACTION ideal-int +pkg syscall (linux-386), const RTM_NEWADDR ideal-int +pkg syscall (linux-386), const RTM_NEWADDRLABEL ideal-int +pkg syscall (linux-386), const RTM_NEWLINK ideal-int +pkg syscall (linux-386), const RTM_NEWNDUSEROPT ideal-int +pkg syscall (linux-386), const RTM_NEWNEIGH ideal-int +pkg syscall (linux-386), const RTM_NEWNEIGHTBL ideal-int +pkg syscall (linux-386), const RTM_NEWPREFIX ideal-int +pkg syscall (linux-386), const RTM_NEWQDISC ideal-int +pkg syscall (linux-386), const RTM_NEWROUTE ideal-int +pkg syscall (linux-386), const RTM_NEWRULE ideal-int +pkg syscall (linux-386), const RTM_NEWTCLASS ideal-int +pkg syscall (linux-386), const RTM_NEWTFILTER ideal-int +pkg syscall (linux-386), const RTM_NR_FAMILIES ideal-int +pkg syscall (linux-386), const RTM_NR_MSGTYPES ideal-int +pkg syscall (linux-386), const RTM_SETDCB ideal-int +pkg syscall (linux-386), const RTM_SETLINK ideal-int +pkg syscall (linux-386), const RTM_SETNEIGHTBL ideal-int +pkg syscall (linux-386), const RTNH_ALIGNTO ideal-int +pkg syscall (linux-386), const RTNH_F_DEAD ideal-int +pkg syscall (linux-386), const RTNH_F_ONLINK ideal-int +pkg syscall (linux-386), const RTNH_F_PERVASIVE ideal-int +pkg syscall (linux-386), const RTN_ANYCAST ideal-int +pkg syscall (linux-386), const RTN_BLACKHOLE ideal-int +pkg syscall (linux-386), const RTN_BROADCAST ideal-int +pkg syscall (linux-386), const RTN_LOCAL ideal-int +pkg syscall (linux-386), const RTN_MAX ideal-int +pkg syscall (linux-386), const RTN_MULTICAST ideal-int +pkg syscall (linux-386), const RTN_NAT ideal-int +pkg syscall (linux-386), const RTN_PROHIBIT ideal-int +pkg syscall (linux-386), const RTN_THROW ideal-int +pkg syscall (linux-386), const RTN_UNICAST ideal-int +pkg syscall (linux-386), const RTN_UNREACHABLE ideal-int +pkg syscall (linux-386), const RTN_UNSPEC ideal-int +pkg syscall (linux-386), const RTN_XRESOLVE ideal-int +pkg syscall (linux-386), const RTPROT_BIRD ideal-int +pkg syscall (linux-386), const RTPROT_BOOT ideal-int +pkg syscall (linux-386), const RTPROT_DHCP ideal-int +pkg syscall (linux-386), const RTPROT_DNROUTED ideal-int +pkg syscall (linux-386), const RTPROT_GATED ideal-int +pkg syscall (linux-386), const RTPROT_KERNEL ideal-int +pkg syscall (linux-386), const RTPROT_MRT ideal-int +pkg syscall (linux-386), const RTPROT_NTK ideal-int +pkg syscall (linux-386), const RTPROT_RA ideal-int +pkg syscall (linux-386), const RTPROT_REDIRECT ideal-int +pkg syscall (linux-386), const RTPROT_STATIC ideal-int +pkg syscall (linux-386), const RTPROT_UNSPEC ideal-int +pkg syscall (linux-386), const RTPROT_XORP ideal-int +pkg syscall (linux-386), const RTPROT_ZEBRA ideal-int +pkg syscall (linux-386), const RT_CLASS_DEFAULT ideal-int +pkg syscall (linux-386), const RT_CLASS_LOCAL ideal-int +pkg syscall (linux-386), const RT_CLASS_MAIN ideal-int +pkg syscall (linux-386), const RT_CLASS_MAX ideal-int +pkg syscall (linux-386), const RT_CLASS_UNSPEC ideal-int +pkg syscall (linux-386), const RT_SCOPE_HOST ideal-int +pkg syscall (linux-386), const RT_SCOPE_LINK ideal-int +pkg syscall (linux-386), const RT_SCOPE_NOWHERE ideal-int +pkg syscall (linux-386), const RT_SCOPE_SITE ideal-int +pkg syscall (linux-386), const RT_SCOPE_UNIVERSE ideal-int +pkg syscall (linux-386), const RT_TABLE_COMPAT ideal-int +pkg syscall (linux-386), const RT_TABLE_DEFAULT ideal-int +pkg syscall (linux-386), const RT_TABLE_LOCAL ideal-int +pkg syscall (linux-386), const RT_TABLE_MAIN ideal-int +pkg syscall (linux-386), const RT_TABLE_MAX ideal-int +pkg syscall (linux-386), const RT_TABLE_UNSPEC ideal-int +pkg syscall (linux-386), const RUSAGE_CHILDREN ideal-int +pkg syscall (linux-386), const RUSAGE_SELF ideal-int +pkg syscall (linux-386), const RUSAGE_THREAD ideal-int +pkg syscall (linux-386), const SCM_CREDENTIALS ideal-int +pkg syscall (linux-386), const SCM_RIGHTS ideal-int +pkg syscall (linux-386), const SCM_TIMESTAMP ideal-int +pkg syscall (linux-386), const SCM_TIMESTAMPING ideal-int +pkg syscall (linux-386), const SCM_TIMESTAMPNS ideal-int +pkg syscall (linux-386), const SIGCHLD Signal +pkg syscall (linux-386), const SIGCLD Signal +pkg syscall (linux-386), const SIGCONT Signal +pkg syscall (linux-386), const SIGIO Signal +pkg syscall (linux-386), const SIGIOT Signal +pkg syscall (linux-386), const SIGPOLL Signal +pkg syscall (linux-386), const SIGPROF Signal +pkg syscall (linux-386), const SIGPWR Signal +pkg syscall (linux-386), const SIGSTKFLT Signal +pkg syscall (linux-386), const SIGSTOP Signal +pkg syscall (linux-386), const SIGSYS Signal +pkg syscall (linux-386), const SIGTSTP Signal +pkg syscall (linux-386), const SIGTTIN Signal +pkg syscall (linux-386), const SIGTTOU Signal +pkg syscall (linux-386), const SIGUNUSED Signal +pkg syscall (linux-386), const SIGURG Signal +pkg syscall (linux-386), const SIGUSR1 Signal +pkg syscall (linux-386), const SIGUSR2 Signal +pkg syscall (linux-386), const SIGVTALRM Signal +pkg syscall (linux-386), const SIGWINCH Signal +pkg syscall (linux-386), const SIGXCPU Signal +pkg syscall (linux-386), const SIGXFSZ Signal +pkg syscall (linux-386), const SIOCADDDLCI ideal-int +pkg syscall (linux-386), const SIOCADDMULTI ideal-int +pkg syscall (linux-386), const SIOCADDRT ideal-int +pkg syscall (linux-386), const SIOCATMARK ideal-int +pkg syscall (linux-386), const SIOCDARP ideal-int +pkg syscall (linux-386), const SIOCDELDLCI ideal-int +pkg syscall (linux-386), const SIOCDELMULTI ideal-int +pkg syscall (linux-386), const SIOCDELRT ideal-int +pkg syscall (linux-386), const SIOCDEVPRIVATE ideal-int +pkg syscall (linux-386), const SIOCDIFADDR ideal-int +pkg syscall (linux-386), const SIOCDRARP ideal-int +pkg syscall (linux-386), const SIOCGARP ideal-int +pkg syscall (linux-386), const SIOCGIFADDR ideal-int +pkg syscall (linux-386), const SIOCGIFBR ideal-int +pkg syscall (linux-386), const SIOCGIFBRDADDR ideal-int +pkg syscall (linux-386), const SIOCGIFCONF ideal-int +pkg syscall (linux-386), const SIOCGIFCOUNT ideal-int +pkg syscall (linux-386), const SIOCGIFDSTADDR ideal-int +pkg syscall (linux-386), const SIOCGIFENCAP ideal-int +pkg syscall (linux-386), const SIOCGIFFLAGS ideal-int +pkg syscall (linux-386), const SIOCGIFHWADDR ideal-int +pkg syscall (linux-386), const SIOCGIFINDEX ideal-int +pkg syscall (linux-386), const SIOCGIFMAP ideal-int +pkg syscall (linux-386), const SIOCGIFMEM ideal-int +pkg syscall (linux-386), const SIOCGIFMETRIC ideal-int +pkg syscall (linux-386), const SIOCGIFMTU ideal-int +pkg syscall (linux-386), const SIOCGIFNAME ideal-int +pkg syscall (linux-386), const SIOCGIFNETMASK ideal-int +pkg syscall (linux-386), const SIOCGIFPFLAGS ideal-int +pkg syscall (linux-386), const SIOCGIFSLAVE ideal-int +pkg syscall (linux-386), const SIOCGIFTXQLEN ideal-int +pkg syscall (linux-386), const SIOCGPGRP ideal-int +pkg syscall (linux-386), const SIOCGRARP ideal-int +pkg syscall (linux-386), const SIOCGSTAMP ideal-int +pkg syscall (linux-386), const SIOCGSTAMPNS ideal-int +pkg syscall (linux-386), const SIOCPROTOPRIVATE ideal-int +pkg syscall (linux-386), const SIOCRTMSG ideal-int +pkg syscall (linux-386), const SIOCSARP ideal-int +pkg syscall (linux-386), const SIOCSIFADDR ideal-int +pkg syscall (linux-386), const SIOCSIFBR ideal-int +pkg syscall (linux-386), const SIOCSIFBRDADDR ideal-int +pkg syscall (linux-386), const SIOCSIFDSTADDR ideal-int +pkg syscall (linux-386), const SIOCSIFENCAP ideal-int +pkg syscall (linux-386), const SIOCSIFFLAGS ideal-int +pkg syscall (linux-386), const SIOCSIFHWADDR ideal-int +pkg syscall (linux-386), const SIOCSIFHWBROADCAST ideal-int +pkg syscall (linux-386), const SIOCSIFLINK ideal-int +pkg syscall (linux-386), const SIOCSIFMAP ideal-int +pkg syscall (linux-386), const SIOCSIFMEM ideal-int +pkg syscall (linux-386), const SIOCSIFMETRIC ideal-int +pkg syscall (linux-386), const SIOCSIFMTU ideal-int +pkg syscall (linux-386), const SIOCSIFNAME ideal-int +pkg syscall (linux-386), const SIOCSIFNETMASK ideal-int +pkg syscall (linux-386), const SIOCSIFPFLAGS ideal-int +pkg syscall (linux-386), const SIOCSIFSLAVE ideal-int +pkg syscall (linux-386), const SIOCSIFTXQLEN ideal-int +pkg syscall (linux-386), const SIOCSPGRP ideal-int +pkg syscall (linux-386), const SIOCSRARP ideal-int +pkg syscall (linux-386), const SOCK_CLOEXEC ideal-int +pkg syscall (linux-386), const SOCK_DCCP ideal-int +pkg syscall (linux-386), const SOCK_NONBLOCK ideal-int +pkg syscall (linux-386), const SOCK_PACKET ideal-int +pkg syscall (linux-386), const SOCK_RDM ideal-int +pkg syscall (linux-386), const SOL_AAL ideal-int +pkg syscall (linux-386), const SOL_ATM ideal-int +pkg syscall (linux-386), const SOL_DECNET ideal-int +pkg syscall (linux-386), const SOL_ICMPV6 ideal-int +pkg syscall (linux-386), const SOL_IP ideal-int +pkg syscall (linux-386), const SOL_IPV6 ideal-int +pkg syscall (linux-386), const SOL_IRDA ideal-int +pkg syscall (linux-386), const SOL_PACKET ideal-int +pkg syscall (linux-386), const SOL_RAW ideal-int +pkg syscall (linux-386), const SOL_TCP ideal-int +pkg syscall (linux-386), const SOL_X25 ideal-int +pkg syscall (linux-386), const SO_ACCEPTCONN ideal-int +pkg syscall (linux-386), const SO_ATTACH_FILTER ideal-int +pkg syscall (linux-386), const SO_BINDTODEVICE ideal-int +pkg syscall (linux-386), const SO_BSDCOMPAT ideal-int +pkg syscall (linux-386), const SO_DEBUG ideal-int +pkg syscall (linux-386), const SO_DETACH_FILTER ideal-int +pkg syscall (linux-386), const SO_DOMAIN ideal-int +pkg syscall (linux-386), const SO_ERROR ideal-int +pkg syscall (linux-386), const SO_MARK ideal-int +pkg syscall (linux-386), const SO_NO_CHECK ideal-int +pkg syscall (linux-386), const SO_OOBINLINE ideal-int +pkg syscall (linux-386), const SO_PASSCRED ideal-int +pkg syscall (linux-386), const SO_PASSSEC ideal-int +pkg syscall (linux-386), const SO_PEERCRED ideal-int +pkg syscall (linux-386), const SO_PEERNAME ideal-int +pkg syscall (linux-386), const SO_PEERSEC ideal-int +pkg syscall (linux-386), const SO_PRIORITY ideal-int +pkg syscall (linux-386), const SO_PROTOCOL ideal-int +pkg syscall (linux-386), const SO_RCVBUFFORCE ideal-int +pkg syscall (linux-386), const SO_RCVLOWAT ideal-int +pkg syscall (linux-386), const SO_RCVTIMEO ideal-int +pkg syscall (linux-386), const SO_RXQ_OVFL ideal-int +pkg syscall (linux-386), const SO_SECURITY_AUTHENTICATION ideal-int +pkg syscall (linux-386), const SO_SECURITY_ENCRYPTION_NETWORK ideal-int +pkg syscall (linux-386), const SO_SECURITY_ENCRYPTION_TRANSPORT ideal-int +pkg syscall (linux-386), const SO_SNDBUFFORCE ideal-int +pkg syscall (linux-386), const SO_SNDLOWAT ideal-int +pkg syscall (linux-386), const SO_SNDTIMEO ideal-int +pkg syscall (linux-386), const SO_TIMESTAMP ideal-int +pkg syscall (linux-386), const SO_TIMESTAMPING ideal-int +pkg syscall (linux-386), const SO_TIMESTAMPNS ideal-int +pkg syscall (linux-386), const SO_TYPE ideal-int +pkg syscall (linux-386), const SYS_ACCESS ideal-int +pkg syscall (linux-386), const SYS_ACCT ideal-int +pkg syscall (linux-386), const SYS_ADD_KEY ideal-int +pkg syscall (linux-386), const SYS_ADJTIMEX ideal-int +pkg syscall (linux-386), const SYS_AFS_SYSCALL ideal-int +pkg syscall (linux-386), const SYS_ALARM ideal-int +pkg syscall (linux-386), const SYS_BDFLUSH ideal-int +pkg syscall (linux-386), const SYS_BREAK ideal-int +pkg syscall (linux-386), const SYS_BRK ideal-int +pkg syscall (linux-386), const SYS_CAPGET ideal-int +pkg syscall (linux-386), const SYS_CAPSET ideal-int +pkg syscall (linux-386), const SYS_CHDIR ideal-int +pkg syscall (linux-386), const SYS_CHMOD ideal-int +pkg syscall (linux-386), const SYS_CHOWN ideal-int +pkg syscall (linux-386), const SYS_CHOWN32 ideal-int +pkg syscall (linux-386), const SYS_CHROOT ideal-int +pkg syscall (linux-386), const SYS_CLOCK_GETRES ideal-int +pkg syscall (linux-386), const SYS_CLOCK_GETTIME ideal-int +pkg syscall (linux-386), const SYS_CLOCK_NANOSLEEP ideal-int +pkg syscall (linux-386), const SYS_CLOCK_SETTIME ideal-int +pkg syscall (linux-386), const SYS_CLONE ideal-int +pkg syscall (linux-386), const SYS_CLOSE ideal-int +pkg syscall (linux-386), const SYS_CREAT ideal-int +pkg syscall (linux-386), const SYS_CREATE_MODULE ideal-int +pkg syscall (linux-386), const SYS_DELETE_MODULE ideal-int +pkg syscall (linux-386), const SYS_DUP ideal-int +pkg syscall (linux-386), const SYS_DUP2 ideal-int +pkg syscall (linux-386), const SYS_DUP3 ideal-int +pkg syscall (linux-386), const SYS_EPOLL_CREATE ideal-int +pkg syscall (linux-386), const SYS_EPOLL_CREATE1 ideal-int +pkg syscall (linux-386), const SYS_EPOLL_CTL ideal-int +pkg syscall (linux-386), const SYS_EPOLL_PWAIT ideal-int +pkg syscall (linux-386), const SYS_EPOLL_WAIT ideal-int +pkg syscall (linux-386), const SYS_EVENTFD ideal-int +pkg syscall (linux-386), const SYS_EVENTFD2 ideal-int +pkg syscall (linux-386), const SYS_EXECVE ideal-int +pkg syscall (linux-386), const SYS_EXIT ideal-int +pkg syscall (linux-386), const SYS_EXIT_GROUP ideal-int +pkg syscall (linux-386), const SYS_FACCESSAT ideal-int +pkg syscall (linux-386), const SYS_FADVISE64 ideal-int +pkg syscall (linux-386), const SYS_FADVISE64_64 ideal-int +pkg syscall (linux-386), const SYS_FALLOCATE ideal-int +pkg syscall (linux-386), const SYS_FANOTIFY_INIT ideal-int +pkg syscall (linux-386), const SYS_FANOTIFY_MARK ideal-int +pkg syscall (linux-386), const SYS_FCHDIR ideal-int +pkg syscall (linux-386), const SYS_FCHMOD ideal-int +pkg syscall (linux-386), const SYS_FCHMODAT ideal-int +pkg syscall (linux-386), const SYS_FCHOWN ideal-int +pkg syscall (linux-386), const SYS_FCHOWN32 ideal-int +pkg syscall (linux-386), const SYS_FCHOWNAT ideal-int +pkg syscall (linux-386), const SYS_FCNTL ideal-int +pkg syscall (linux-386), const SYS_FCNTL64 ideal-int +pkg syscall (linux-386), const SYS_FDATASYNC ideal-int +pkg syscall (linux-386), const SYS_FGETXATTR ideal-int +pkg syscall (linux-386), const SYS_FLISTXATTR ideal-int +pkg syscall (linux-386), const SYS_FLOCK ideal-int +pkg syscall (linux-386), const SYS_FORK ideal-int +pkg syscall (linux-386), const SYS_FREMOVEXATTR ideal-int +pkg syscall (linux-386), const SYS_FSETXATTR ideal-int +pkg syscall (linux-386), const SYS_FSTAT ideal-int +pkg syscall (linux-386), const SYS_FSTAT64 ideal-int +pkg syscall (linux-386), const SYS_FSTATAT64 ideal-int +pkg syscall (linux-386), const SYS_FSTATFS ideal-int +pkg syscall (linux-386), const SYS_FSTATFS64 ideal-int +pkg syscall (linux-386), const SYS_FSYNC ideal-int +pkg syscall (linux-386), const SYS_FTIME ideal-int +pkg syscall (linux-386), const SYS_FTRUNCATE ideal-int +pkg syscall (linux-386), const SYS_FTRUNCATE64 ideal-int +pkg syscall (linux-386), const SYS_FUTEX ideal-int +pkg syscall (linux-386), const SYS_FUTIMESAT ideal-int +pkg syscall (linux-386), const SYS_GETCPU ideal-int +pkg syscall (linux-386), const SYS_GETCWD ideal-int +pkg syscall (linux-386), const SYS_GETDENTS ideal-int +pkg syscall (linux-386), const SYS_GETDENTS64 ideal-int +pkg syscall (linux-386), const SYS_GETEGID ideal-int +pkg syscall (linux-386), const SYS_GETEGID32 ideal-int +pkg syscall (linux-386), const SYS_GETEUID ideal-int +pkg syscall (linux-386), const SYS_GETEUID32 ideal-int +pkg syscall (linux-386), const SYS_GETGID ideal-int +pkg syscall (linux-386), const SYS_GETGID32 ideal-int +pkg syscall (linux-386), const SYS_GETGROUPS ideal-int +pkg syscall (linux-386), const SYS_GETGROUPS32 ideal-int +pkg syscall (linux-386), const SYS_GETITIMER ideal-int +pkg syscall (linux-386), const SYS_GETPGID ideal-int +pkg syscall (linux-386), const SYS_GETPGRP ideal-int +pkg syscall (linux-386), const SYS_GETPID ideal-int +pkg syscall (linux-386), const SYS_GETPMSG ideal-int +pkg syscall (linux-386), const SYS_GETPPID ideal-int +pkg syscall (linux-386), const SYS_GETPRIORITY ideal-int +pkg syscall (linux-386), const SYS_GETRESGID ideal-int +pkg syscall (linux-386), const SYS_GETRESGID32 ideal-int +pkg syscall (linux-386), const SYS_GETRESUID ideal-int +pkg syscall (linux-386), const SYS_GETRESUID32 ideal-int +pkg syscall (linux-386), const SYS_GETRLIMIT ideal-int +pkg syscall (linux-386), const SYS_GETRUSAGE ideal-int +pkg syscall (linux-386), const SYS_GETSID ideal-int +pkg syscall (linux-386), const SYS_GETTID ideal-int +pkg syscall (linux-386), const SYS_GETTIMEOFDAY ideal-int +pkg syscall (linux-386), const SYS_GETUID ideal-int +pkg syscall (linux-386), const SYS_GETUID32 ideal-int +pkg syscall (linux-386), const SYS_GETXATTR ideal-int +pkg syscall (linux-386), const SYS_GET_KERNEL_SYMS ideal-int +pkg syscall (linux-386), const SYS_GET_MEMPOLICY ideal-int +pkg syscall (linux-386), const SYS_GET_ROBUST_LIST ideal-int +pkg syscall (linux-386), const SYS_GET_THREAD_AREA ideal-int +pkg syscall (linux-386), const SYS_GTTY ideal-int +pkg syscall (linux-386), const SYS_IDLE ideal-int +pkg syscall (linux-386), const SYS_INIT_MODULE ideal-int +pkg syscall (linux-386), const SYS_INOTIFY_ADD_WATCH ideal-int +pkg syscall (linux-386), const SYS_INOTIFY_INIT ideal-int +pkg syscall (linux-386), const SYS_INOTIFY_INIT1 ideal-int +pkg syscall (linux-386), const SYS_INOTIFY_RM_WATCH ideal-int +pkg syscall (linux-386), const SYS_IOCTL ideal-int +pkg syscall (linux-386), const SYS_IOPERM ideal-int +pkg syscall (linux-386), const SYS_IOPL ideal-int +pkg syscall (linux-386), const SYS_IOPRIO_GET ideal-int +pkg syscall (linux-386), const SYS_IOPRIO_SET ideal-int +pkg syscall (linux-386), const SYS_IO_CANCEL ideal-int +pkg syscall (linux-386), const SYS_IO_DESTROY ideal-int +pkg syscall (linux-386), const SYS_IO_GETEVENTS ideal-int +pkg syscall (linux-386), const SYS_IO_SETUP ideal-int +pkg syscall (linux-386), const SYS_IO_SUBMIT ideal-int +pkg syscall (linux-386), const SYS_IPC ideal-int +pkg syscall (linux-386), const SYS_KEXEC_LOAD ideal-int +pkg syscall (linux-386), const SYS_KEYCTL ideal-int +pkg syscall (linux-386), const SYS_KILL ideal-int +pkg syscall (linux-386), const SYS_LCHOWN ideal-int +pkg syscall (linux-386), const SYS_LCHOWN32 ideal-int +pkg syscall (linux-386), const SYS_LGETXATTR ideal-int +pkg syscall (linux-386), const SYS_LINK ideal-int +pkg syscall (linux-386), const SYS_LINKAT ideal-int +pkg syscall (linux-386), const SYS_LISTXATTR ideal-int +pkg syscall (linux-386), const SYS_LLISTXATTR ideal-int +pkg syscall (linux-386), const SYS_LOCK ideal-int +pkg syscall (linux-386), const SYS_LOOKUP_DCOOKIE ideal-int +pkg syscall (linux-386), const SYS_LREMOVEXATTR ideal-int +pkg syscall (linux-386), const SYS_LSEEK ideal-int +pkg syscall (linux-386), const SYS_LSETXATTR ideal-int +pkg syscall (linux-386), const SYS_LSTAT ideal-int +pkg syscall (linux-386), const SYS_LSTAT64 ideal-int +pkg syscall (linux-386), const SYS_MADVISE ideal-int +pkg syscall (linux-386), const SYS_MADVISE1 ideal-int +pkg syscall (linux-386), const SYS_MBIND ideal-int +pkg syscall (linux-386), const SYS_MIGRATE_PAGES ideal-int +pkg syscall (linux-386), const SYS_MINCORE ideal-int +pkg syscall (linux-386), const SYS_MKDIR ideal-int +pkg syscall (linux-386), const SYS_MKDIRAT ideal-int +pkg syscall (linux-386), const SYS_MKNOD ideal-int +pkg syscall (linux-386), const SYS_MKNODAT ideal-int +pkg syscall (linux-386), const SYS_MLOCK ideal-int +pkg syscall (linux-386), const SYS_MLOCKALL ideal-int +pkg syscall (linux-386), const SYS_MMAP ideal-int +pkg syscall (linux-386), const SYS_MMAP2 ideal-int +pkg syscall (linux-386), const SYS_MODIFY_LDT ideal-int +pkg syscall (linux-386), const SYS_MOUNT ideal-int +pkg syscall (linux-386), const SYS_MOVE_PAGES ideal-int +pkg syscall (linux-386), const SYS_MPROTECT ideal-int +pkg syscall (linux-386), const SYS_MPX ideal-int +pkg syscall (linux-386), const SYS_MQ_GETSETATTR ideal-int +pkg syscall (linux-386), const SYS_MQ_NOTIFY ideal-int +pkg syscall (linux-386), const SYS_MQ_OPEN ideal-int +pkg syscall (linux-386), const SYS_MQ_TIMEDRECEIVE ideal-int +pkg syscall (linux-386), const SYS_MQ_TIMEDSEND ideal-int +pkg syscall (linux-386), const SYS_MQ_UNLINK ideal-int +pkg syscall (linux-386), const SYS_MREMAP ideal-int +pkg syscall (linux-386), const SYS_MSYNC ideal-int +pkg syscall (linux-386), const SYS_MUNLOCK ideal-int +pkg syscall (linux-386), const SYS_MUNLOCKALL ideal-int +pkg syscall (linux-386), const SYS_MUNMAP ideal-int +pkg syscall (linux-386), const SYS_NANOSLEEP ideal-int +pkg syscall (linux-386), const SYS_NFSSERVCTL ideal-int +pkg syscall (linux-386), const SYS_NICE ideal-int +pkg syscall (linux-386), const SYS_OLDFSTAT ideal-int +pkg syscall (linux-386), const SYS_OLDLSTAT ideal-int +pkg syscall (linux-386), const SYS_OLDOLDUNAME ideal-int +pkg syscall (linux-386), const SYS_OLDSTAT ideal-int +pkg syscall (linux-386), const SYS_OLDUNAME ideal-int +pkg syscall (linux-386), const SYS_OPEN ideal-int +pkg syscall (linux-386), const SYS_OPENAT ideal-int +pkg syscall (linux-386), const SYS_PAUSE ideal-int +pkg syscall (linux-386), const SYS_PERF_EVENT_OPEN ideal-int +pkg syscall (linux-386), const SYS_PERSONALITY ideal-int +pkg syscall (linux-386), const SYS_PIPE ideal-int +pkg syscall (linux-386), const SYS_PIPE2 ideal-int +pkg syscall (linux-386), const SYS_PIVOT_ROOT ideal-int +pkg syscall (linux-386), const SYS_POLL ideal-int +pkg syscall (linux-386), const SYS_PPOLL ideal-int +pkg syscall (linux-386), const SYS_PRCTL ideal-int +pkg syscall (linux-386), const SYS_PREAD64 ideal-int +pkg syscall (linux-386), const SYS_PREADV ideal-int +pkg syscall (linux-386), const SYS_PRLIMIT64 ideal-int +pkg syscall (linux-386), const SYS_PROF ideal-int +pkg syscall (linux-386), const SYS_PROFIL ideal-int +pkg syscall (linux-386), const SYS_PSELECT6 ideal-int +pkg syscall (linux-386), const SYS_PTRACE ideal-int +pkg syscall (linux-386), const SYS_PUTPMSG ideal-int +pkg syscall (linux-386), const SYS_PWRITE64 ideal-int +pkg syscall (linux-386), const SYS_PWRITEV ideal-int +pkg syscall (linux-386), const SYS_QUERY_MODULE ideal-int +pkg syscall (linux-386), const SYS_QUOTACTL ideal-int +pkg syscall (linux-386), const SYS_READ ideal-int +pkg syscall (linux-386), const SYS_READAHEAD ideal-int +pkg syscall (linux-386), const SYS_READDIR ideal-int +pkg syscall (linux-386), const SYS_READLINK ideal-int +pkg syscall (linux-386), const SYS_READLINKAT ideal-int +pkg syscall (linux-386), const SYS_READV ideal-int +pkg syscall (linux-386), const SYS_REBOOT ideal-int +pkg syscall (linux-386), const SYS_RECVMMSG ideal-int +pkg syscall (linux-386), const SYS_REMAP_FILE_PAGES ideal-int +pkg syscall (linux-386), const SYS_REMOVEXATTR ideal-int +pkg syscall (linux-386), const SYS_RENAME ideal-int +pkg syscall (linux-386), const SYS_RENAMEAT ideal-int +pkg syscall (linux-386), const SYS_REQUEST_KEY ideal-int +pkg syscall (linux-386), const SYS_RESTART_SYSCALL ideal-int +pkg syscall (linux-386), const SYS_RMDIR ideal-int +pkg syscall (linux-386), const SYS_RT_SIGACTION ideal-int +pkg syscall (linux-386), const SYS_RT_SIGPENDING ideal-int +pkg syscall (linux-386), const SYS_RT_SIGPROCMASK ideal-int +pkg syscall (linux-386), const SYS_RT_SIGQUEUEINFO ideal-int +pkg syscall (linux-386), const SYS_RT_SIGRETURN ideal-int +pkg syscall (linux-386), const SYS_RT_SIGSUSPEND ideal-int +pkg syscall (linux-386), const SYS_RT_SIGTIMEDWAIT ideal-int +pkg syscall (linux-386), const SYS_RT_TGSIGQUEUEINFO ideal-int +pkg syscall (linux-386), const SYS_SCHED_GETAFFINITY ideal-int +pkg syscall (linux-386), const SYS_SCHED_GETPARAM ideal-int +pkg syscall (linux-386), const SYS_SCHED_GETSCHEDULER ideal-int +pkg syscall (linux-386), const SYS_SCHED_GET_PRIORITY_MAX ideal-int +pkg syscall (linux-386), const SYS_SCHED_GET_PRIORITY_MIN ideal-int +pkg syscall (linux-386), const SYS_SCHED_RR_GET_INTERVAL ideal-int +pkg syscall (linux-386), const SYS_SCHED_SETAFFINITY ideal-int +pkg syscall (linux-386), const SYS_SCHED_SETPARAM ideal-int +pkg syscall (linux-386), const SYS_SCHED_SETSCHEDULER ideal-int +pkg syscall (linux-386), const SYS_SCHED_YIELD ideal-int +pkg syscall (linux-386), const SYS_SELECT ideal-int +pkg syscall (linux-386), const SYS_SENDFILE ideal-int +pkg syscall (linux-386), const SYS_SENDFILE64 ideal-int +pkg syscall (linux-386), const SYS_SETDOMAINNAME ideal-int +pkg syscall (linux-386), const SYS_SETFSGID ideal-int +pkg syscall (linux-386), const SYS_SETFSGID32 ideal-int +pkg syscall (linux-386), const SYS_SETFSUID ideal-int +pkg syscall (linux-386), const SYS_SETFSUID32 ideal-int +pkg syscall (linux-386), const SYS_SETGID ideal-int +pkg syscall (linux-386), const SYS_SETGID32 ideal-int +pkg syscall (linux-386), const SYS_SETGROUPS ideal-int +pkg syscall (linux-386), const SYS_SETGROUPS32 ideal-int +pkg syscall (linux-386), const SYS_SETHOSTNAME ideal-int +pkg syscall (linux-386), const SYS_SETITIMER ideal-int +pkg syscall (linux-386), const SYS_SETPGID ideal-int +pkg syscall (linux-386), const SYS_SETPRIORITY ideal-int +pkg syscall (linux-386), const SYS_SETREGID ideal-int +pkg syscall (linux-386), const SYS_SETREGID32 ideal-int +pkg syscall (linux-386), const SYS_SETRESGID ideal-int +pkg syscall (linux-386), const SYS_SETRESGID32 ideal-int +pkg syscall (linux-386), const SYS_SETRESUID ideal-int +pkg syscall (linux-386), const SYS_SETRESUID32 ideal-int +pkg syscall (linux-386), const SYS_SETREUID ideal-int +pkg syscall (linux-386), const SYS_SETREUID32 ideal-int +pkg syscall (linux-386), const SYS_SETRLIMIT ideal-int +pkg syscall (linux-386), const SYS_SETSID ideal-int +pkg syscall (linux-386), const SYS_SETTIMEOFDAY ideal-int +pkg syscall (linux-386), const SYS_SETUID ideal-int +pkg syscall (linux-386), const SYS_SETUID32 ideal-int +pkg syscall (linux-386), const SYS_SETXATTR ideal-int +pkg syscall (linux-386), const SYS_SET_MEMPOLICY ideal-int +pkg syscall (linux-386), const SYS_SET_ROBUST_LIST ideal-int +pkg syscall (linux-386), const SYS_SET_THREAD_AREA ideal-int +pkg syscall (linux-386), const SYS_SET_TID_ADDRESS ideal-int +pkg syscall (linux-386), const SYS_SGETMASK ideal-int +pkg syscall (linux-386), const SYS_SIGACTION ideal-int +pkg syscall (linux-386), const SYS_SIGALTSTACK ideal-int +pkg syscall (linux-386), const SYS_SIGNAL ideal-int +pkg syscall (linux-386), const SYS_SIGNALFD ideal-int +pkg syscall (linux-386), const SYS_SIGNALFD4 ideal-int +pkg syscall (linux-386), const SYS_SIGPENDING ideal-int +pkg syscall (linux-386), const SYS_SIGPROCMASK ideal-int +pkg syscall (linux-386), const SYS_SIGRETURN ideal-int +pkg syscall (linux-386), const SYS_SIGSUSPEND ideal-int +pkg syscall (linux-386), const SYS_SOCKETCALL ideal-int +pkg syscall (linux-386), const SYS_SPLICE ideal-int +pkg syscall (linux-386), const SYS_SSETMASK ideal-int +pkg syscall (linux-386), const SYS_STAT ideal-int +pkg syscall (linux-386), const SYS_STAT64 ideal-int +pkg syscall (linux-386), const SYS_STATFS ideal-int +pkg syscall (linux-386), const SYS_STATFS64 ideal-int +pkg syscall (linux-386), const SYS_STIME ideal-int +pkg syscall (linux-386), const SYS_STTY ideal-int +pkg syscall (linux-386), const SYS_SWAPOFF ideal-int +pkg syscall (linux-386), const SYS_SWAPON ideal-int +pkg syscall (linux-386), const SYS_SYMLINK ideal-int +pkg syscall (linux-386), const SYS_SYMLINKAT ideal-int +pkg syscall (linux-386), const SYS_SYNC ideal-int +pkg syscall (linux-386), const SYS_SYNC_FILE_RANGE ideal-int +pkg syscall (linux-386), const SYS_SYSFS ideal-int +pkg syscall (linux-386), const SYS_SYSINFO ideal-int +pkg syscall (linux-386), const SYS_SYSLOG ideal-int +pkg syscall (linux-386), const SYS_TEE ideal-int +pkg syscall (linux-386), const SYS_TGKILL ideal-int +pkg syscall (linux-386), const SYS_TIME ideal-int +pkg syscall (linux-386), const SYS_TIMERFD_CREATE ideal-int +pkg syscall (linux-386), const SYS_TIMERFD_GETTIME ideal-int +pkg syscall (linux-386), const SYS_TIMERFD_SETTIME ideal-int +pkg syscall (linux-386), const SYS_TIMER_CREATE ideal-int +pkg syscall (linux-386), const SYS_TIMER_DELETE ideal-int +pkg syscall (linux-386), const SYS_TIMER_GETOVERRUN ideal-int +pkg syscall (linux-386), const SYS_TIMER_GETTIME ideal-int +pkg syscall (linux-386), const SYS_TIMER_SETTIME ideal-int +pkg syscall (linux-386), const SYS_TIMES ideal-int +pkg syscall (linux-386), const SYS_TKILL ideal-int +pkg syscall (linux-386), const SYS_TRUNCATE ideal-int +pkg syscall (linux-386), const SYS_TRUNCATE64 ideal-int +pkg syscall (linux-386), const SYS_UGETRLIMIT ideal-int +pkg syscall (linux-386), const SYS_ULIMIT ideal-int +pkg syscall (linux-386), const SYS_UMASK ideal-int +pkg syscall (linux-386), const SYS_UMOUNT ideal-int +pkg syscall (linux-386), const SYS_UMOUNT2 ideal-int +pkg syscall (linux-386), const SYS_UNAME ideal-int +pkg syscall (linux-386), const SYS_UNLINK ideal-int +pkg syscall (linux-386), const SYS_UNLINKAT ideal-int +pkg syscall (linux-386), const SYS_UNSHARE ideal-int +pkg syscall (linux-386), const SYS_USELIB ideal-int +pkg syscall (linux-386), const SYS_USTAT ideal-int +pkg syscall (linux-386), const SYS_UTIME ideal-int +pkg syscall (linux-386), const SYS_UTIMENSAT ideal-int +pkg syscall (linux-386), const SYS_UTIMES ideal-int +pkg syscall (linux-386), const SYS_VFORK ideal-int +pkg syscall (linux-386), const SYS_VHANGUP ideal-int +pkg syscall (linux-386), const SYS_VM86 ideal-int +pkg syscall (linux-386), const SYS_VM86OLD ideal-int +pkg syscall (linux-386), const SYS_VMSPLICE ideal-int +pkg syscall (linux-386), const SYS_VSERVER ideal-int +pkg syscall (linux-386), const SYS_WAIT4 ideal-int +pkg syscall (linux-386), const SYS_WAITID ideal-int +pkg syscall (linux-386), const SYS_WAITPID ideal-int +pkg syscall (linux-386), const SYS_WRITE ideal-int +pkg syscall (linux-386), const SYS_WRITEV ideal-int +pkg syscall (linux-386), const SYS__LLSEEK ideal-int +pkg syscall (linux-386), const SYS__NEWSELECT ideal-int +pkg syscall (linux-386), const SYS__SYSCTL ideal-int +pkg syscall (linux-386), const S_BLKSIZE ideal-int +pkg syscall (linux-386), const S_IEXEC ideal-int +pkg syscall (linux-386), const S_IREAD ideal-int +pkg syscall (linux-386), const S_IRGRP ideal-int +pkg syscall (linux-386), const S_IROTH ideal-int +pkg syscall (linux-386), const S_IRWXG ideal-int +pkg syscall (linux-386), const S_IRWXO ideal-int +pkg syscall (linux-386), const S_IRWXU ideal-int +pkg syscall (linux-386), const S_IWGRP ideal-int +pkg syscall (linux-386), const S_IWOTH ideal-int +pkg syscall (linux-386), const S_IWRITE ideal-int +pkg syscall (linux-386), const S_IXGRP ideal-int +pkg syscall (linux-386), const S_IXOTH ideal-int +pkg syscall (linux-386), const SizeofCmsghdr ideal-int +pkg syscall (linux-386), const SizeofIPMreq ideal-int +pkg syscall (linux-386), const SizeofIPMreqn ideal-int +pkg syscall (linux-386), const SizeofIPv6Mreq ideal-int +pkg syscall (linux-386), const SizeofIfAddrmsg ideal-int +pkg syscall (linux-386), const SizeofIfInfomsg ideal-int +pkg syscall (linux-386), const SizeofInet4Pktinfo ideal-int +pkg syscall (linux-386), const SizeofInet6Pktinfo ideal-int +pkg syscall (linux-386), const SizeofInotifyEvent ideal-int +pkg syscall (linux-386), const SizeofLinger ideal-int +pkg syscall (linux-386), const SizeofMsghdr ideal-int +pkg syscall (linux-386), const SizeofNlAttr ideal-int +pkg syscall (linux-386), const SizeofNlMsgerr ideal-int +pkg syscall (linux-386), const SizeofNlMsghdr ideal-int +pkg syscall (linux-386), const SizeofRtAttr ideal-int +pkg syscall (linux-386), const SizeofRtGenmsg ideal-int +pkg syscall (linux-386), const SizeofRtMsg ideal-int +pkg syscall (linux-386), const SizeofRtNexthop ideal-int +pkg syscall (linux-386), const SizeofSockFilter ideal-int +pkg syscall (linux-386), const SizeofSockFprog ideal-int +pkg syscall (linux-386), const SizeofSockaddrAny ideal-int +pkg syscall (linux-386), const SizeofSockaddrInet4 ideal-int +pkg syscall (linux-386), const SizeofSockaddrInet6 ideal-int +pkg syscall (linux-386), const SizeofSockaddrLinklayer ideal-int +pkg syscall (linux-386), const SizeofSockaddrNetlink ideal-int +pkg syscall (linux-386), const SizeofSockaddrUnix ideal-int +pkg syscall (linux-386), const SizeofUcred ideal-int +pkg syscall (linux-386), const TCGETS ideal-int +pkg syscall (linux-386), const TCP_CONGESTION ideal-int +pkg syscall (linux-386), const TCP_CORK ideal-int +pkg syscall (linux-386), const TCP_DEFER_ACCEPT ideal-int +pkg syscall (linux-386), const TCP_INFO ideal-int +pkg syscall (linux-386), const TCP_KEEPCNT ideal-int +pkg syscall (linux-386), const TCP_KEEPIDLE ideal-int +pkg syscall (linux-386), const TCP_KEEPINTVL ideal-int +pkg syscall (linux-386), const TCP_LINGER2 ideal-int +pkg syscall (linux-386), const TCP_MAXSEG ideal-int +pkg syscall (linux-386), const TCP_MAXWIN ideal-int +pkg syscall (linux-386), const TCP_MAX_WINSHIFT ideal-int +pkg syscall (linux-386), const TCP_MD5SIG ideal-int +pkg syscall (linux-386), const TCP_MD5SIG_MAXKEYLEN ideal-int +pkg syscall (linux-386), const TCP_MSS ideal-int +pkg syscall (linux-386), const TCP_QUICKACK ideal-int +pkg syscall (linux-386), const TCP_SYNCNT ideal-int +pkg syscall (linux-386), const TCP_WINDOW_CLAMP ideal-int +pkg syscall (linux-386), const TCSETS ideal-int +pkg syscall (linux-386), const TIOCCBRK ideal-int +pkg syscall (linux-386), const TIOCCONS ideal-int +pkg syscall (linux-386), const TIOCEXCL ideal-int +pkg syscall (linux-386), const TIOCGDEV ideal-int +pkg syscall (linux-386), const TIOCGETD ideal-int +pkg syscall (linux-386), const TIOCGICOUNT ideal-int +pkg syscall (linux-386), const TIOCGLCKTRMIOS ideal-int +pkg syscall (linux-386), const TIOCGPGRP ideal-int +pkg syscall (linux-386), const TIOCGPTN ideal-int +pkg syscall (linux-386), const TIOCGRS485 ideal-int +pkg syscall (linux-386), const TIOCGSERIAL ideal-int +pkg syscall (linux-386), const TIOCGSID ideal-int +pkg syscall (linux-386), const TIOCGSOFTCAR ideal-int +pkg syscall (linux-386), const TIOCGWINSZ ideal-int +pkg syscall (linux-386), const TIOCINQ ideal-int +pkg syscall (linux-386), const TIOCLINUX ideal-int +pkg syscall (linux-386), const TIOCMBIC ideal-int +pkg syscall (linux-386), const TIOCMBIS ideal-int +pkg syscall (linux-386), const TIOCMGET ideal-int +pkg syscall (linux-386), const TIOCMIWAIT ideal-int +pkg syscall (linux-386), const TIOCMSET ideal-int +pkg syscall (linux-386), const TIOCM_CAR ideal-int +pkg syscall (linux-386), const TIOCM_CD ideal-int +pkg syscall (linux-386), const TIOCM_CTS ideal-int +pkg syscall (linux-386), const TIOCM_DSR ideal-int +pkg syscall (linux-386), const TIOCM_DTR ideal-int +pkg syscall (linux-386), const TIOCM_LE ideal-int +pkg syscall (linux-386), const TIOCM_RI ideal-int +pkg syscall (linux-386), const TIOCM_RNG ideal-int +pkg syscall (linux-386), const TIOCM_RTS ideal-int +pkg syscall (linux-386), const TIOCM_SR ideal-int +pkg syscall (linux-386), const TIOCM_ST ideal-int +pkg syscall (linux-386), const TIOCNOTTY ideal-int +pkg syscall (linux-386), const TIOCNXCL ideal-int +pkg syscall (linux-386), const TIOCOUTQ ideal-int +pkg syscall (linux-386), const TIOCPKT ideal-int +pkg syscall (linux-386), const TIOCPKT_DATA ideal-int +pkg syscall (linux-386), const TIOCPKT_DOSTOP ideal-int +pkg syscall (linux-386), const TIOCPKT_FLUSHREAD ideal-int +pkg syscall (linux-386), const TIOCPKT_FLUSHWRITE ideal-int +pkg syscall (linux-386), const TIOCPKT_IOCTL ideal-int +pkg syscall (linux-386), const TIOCPKT_NOSTOP ideal-int +pkg syscall (linux-386), const TIOCPKT_START ideal-int +pkg syscall (linux-386), const TIOCPKT_STOP ideal-int +pkg syscall (linux-386), const TIOCSBRK ideal-int +pkg syscall (linux-386), const TIOCSCTTY ideal-int +pkg syscall (linux-386), const TIOCSERCONFIG ideal-int +pkg syscall (linux-386), const TIOCSERGETLSR ideal-int +pkg syscall (linux-386), const TIOCSERGETMULTI ideal-int +pkg syscall (linux-386), const TIOCSERGSTRUCT ideal-int +pkg syscall (linux-386), const TIOCSERGWILD ideal-int +pkg syscall (linux-386), const TIOCSERSETMULTI ideal-int +pkg syscall (linux-386), const TIOCSERSWILD ideal-int +pkg syscall (linux-386), const TIOCSER_TEMT ideal-int +pkg syscall (linux-386), const TIOCSETD ideal-int +pkg syscall (linux-386), const TIOCSIG ideal-int +pkg syscall (linux-386), const TIOCSLCKTRMIOS ideal-int +pkg syscall (linux-386), const TIOCSPGRP ideal-int +pkg syscall (linux-386), const TIOCSPTLCK ideal-int +pkg syscall (linux-386), const TIOCSRS485 ideal-int +pkg syscall (linux-386), const TIOCSSERIAL ideal-int +pkg syscall (linux-386), const TIOCSSOFTCAR ideal-int +pkg syscall (linux-386), const TIOCSTI ideal-int +pkg syscall (linux-386), const TIOCSWINSZ ideal-int +pkg syscall (linux-386), const TOSTOP ideal-int +pkg syscall (linux-386), const TUNATTACHFILTER ideal-int +pkg syscall (linux-386), const TUNDETACHFILTER ideal-int +pkg syscall (linux-386), const TUNGETFEATURES ideal-int +pkg syscall (linux-386), const TUNGETIFF ideal-int +pkg syscall (linux-386), const TUNGETSNDBUF ideal-int +pkg syscall (linux-386), const TUNGETVNETHDRSZ ideal-int +pkg syscall (linux-386), const TUNSETDEBUG ideal-int +pkg syscall (linux-386), const TUNSETGROUP ideal-int +pkg syscall (linux-386), const TUNSETIFF ideal-int +pkg syscall (linux-386), const TUNSETLINK ideal-int +pkg syscall (linux-386), const TUNSETNOCSUM ideal-int +pkg syscall (linux-386), const TUNSETOFFLOAD ideal-int +pkg syscall (linux-386), const TUNSETOWNER ideal-int +pkg syscall (linux-386), const TUNSETPERSIST ideal-int +pkg syscall (linux-386), const TUNSETSNDBUF ideal-int +pkg syscall (linux-386), const TUNSETTXFILTER ideal-int +pkg syscall (linux-386), const TUNSETVNETHDRSZ ideal-int +pkg syscall (linux-386), const VDISCARD ideal-int +pkg syscall (linux-386), const VEOF ideal-int +pkg syscall (linux-386), const VEOL ideal-int +pkg syscall (linux-386), const VEOL2 ideal-int +pkg syscall (linux-386), const VERASE ideal-int +pkg syscall (linux-386), const VINTR ideal-int +pkg syscall (linux-386), const VKILL ideal-int +pkg syscall (linux-386), const VLNEXT ideal-int +pkg syscall (linux-386), const VMIN ideal-int +pkg syscall (linux-386), const VQUIT ideal-int +pkg syscall (linux-386), const VREPRINT ideal-int +pkg syscall (linux-386), const VSTART ideal-int +pkg syscall (linux-386), const VSTOP ideal-int +pkg syscall (linux-386), const VSUSP ideal-int +pkg syscall (linux-386), const VSWTC ideal-int +pkg syscall (linux-386), const VTIME ideal-int +pkg syscall (linux-386), const VWERASE ideal-int +pkg syscall (linux-386), const WALL ideal-int +pkg syscall (linux-386), const WCLONE ideal-int +pkg syscall (linux-386), const WCONTINUED ideal-int +pkg syscall (linux-386), const WEXITED ideal-int +pkg syscall (linux-386), const WNOHANG ideal-int +pkg syscall (linux-386), const WNOTHREAD ideal-int +pkg syscall (linux-386), const WNOWAIT ideal-int +pkg syscall (linux-386), const WORDSIZE ideal-int +pkg syscall (linux-386), const WSTOPPED ideal-int +pkg syscall (linux-386), const WUNTRACED ideal-int +pkg syscall (linux-386), const XCASE ideal-int +pkg syscall (linux-386), func Accept(int) (int, Sockaddr, error) +pkg syscall (linux-386), func Access(string, uint32) error +pkg syscall (linux-386), func Acct(string) error +pkg syscall (linux-386), func Adjtimex(*Timex) (int, error) +pkg syscall (linux-386), func AttachLsf(int, []SockFilter) error +pkg syscall (linux-386), func Bind(int, Sockaddr) error +pkg syscall (linux-386), func BindToDevice(int, string) error +pkg syscall (linux-386), func Chroot(string) error +pkg syscall (linux-386), func Close(int) error +pkg syscall (linux-386), func CloseOnExec(int) +pkg syscall (linux-386), func CmsgLen(int) int +pkg syscall (linux-386), func CmsgSpace(int) int +pkg syscall (linux-386), func Connect(int, Sockaddr) error +pkg syscall (linux-386), func Creat(string, uint32) (int, error) +pkg syscall (linux-386), func DetachLsf(int) error +pkg syscall (linux-386), func Dup(int) (int, error) +pkg syscall (linux-386), func Dup2(int, int) error +pkg syscall (linux-386), func EpollCreate(int) (int, error) +pkg syscall (linux-386), func EpollCreate1(int) (int, error) +pkg syscall (linux-386), func EpollCtl(int, int, int, *EpollEvent) error +pkg syscall (linux-386), func EpollWait(int, []EpollEvent, int) (int, error) +pkg syscall (linux-386), func Faccessat(int, string, uint32, int) error +pkg syscall (linux-386), func Fallocate(int, uint32, int64, int64) error +pkg syscall (linux-386), func Fchdir(int) error +pkg syscall (linux-386), func Fchmod(int, uint32) error +pkg syscall (linux-386), func Fchmodat(int, string, uint32, int) error +pkg syscall (linux-386), func Fchown(int, int, int) error +pkg syscall (linux-386), func Fchownat(int, string, int, int, int) error +pkg syscall (linux-386), func Fdatasync(int) error +pkg syscall (linux-386), func Flock(int, int) error +pkg syscall (linux-386), func ForkExec(string, []string, *ProcAttr) (int, error) +pkg syscall (linux-386), func Fstat(int, *Stat_t) error +pkg syscall (linux-386), func Fstatfs(int, *Statfs_t) error +pkg syscall (linux-386), func Fsync(int) error +pkg syscall (linux-386), func Ftruncate(int, int64) error +pkg syscall (linux-386), func Futimes(int, []Timeval) error +pkg syscall (linux-386), func Futimesat(int, string, []Timeval) error +pkg syscall (linux-386), func Getcwd([]uint8) (int, error) +pkg syscall (linux-386), func Getdents(int, []uint8) (int, error) +pkg syscall (linux-386), func Getpeername(int) (Sockaddr, error) +pkg syscall (linux-386), func Getpgid(int) (int, error) +pkg syscall (linux-386), func Getpgrp() int +pkg syscall (linux-386), func Getrlimit(int, *Rlimit) error +pkg syscall (linux-386), func Getrusage(int, *Rusage) error +pkg syscall (linux-386), func Getsockname(int) (Sockaddr, error) +pkg syscall (linux-386), func GetsockoptIPMreq(int, int, int) (*IPMreq, error) +pkg syscall (linux-386), func GetsockoptIPMreqn(int, int, int) (*IPMreqn, error) +pkg syscall (linux-386), func GetsockoptIPv6Mreq(int, int, int) (*IPv6Mreq, error) +pkg syscall (linux-386), func GetsockoptInet4Addr(int, int, int) ([4]uint8, error) +pkg syscall (linux-386), func GetsockoptInt(int, int, int) (int, error) +pkg syscall (linux-386), func Gettid() int +pkg syscall (linux-386), func InotifyAddWatch(int, string, uint32) (int, error) +pkg syscall (linux-386), func InotifyInit() (int, error) +pkg syscall (linux-386), func InotifyInit1(int) (int, error) +pkg syscall (linux-386), func InotifyRmWatch(int, uint32) (int, error) +pkg syscall (linux-386), func Ioperm(int, int, int) error +pkg syscall (linux-386), func Iopl(int) error +pkg syscall (linux-386), func Kill(int, Signal) error +pkg syscall (linux-386), func Klogctl(int, []uint8) (int, error) +pkg syscall (linux-386), func Listen(int, int) error +pkg syscall (linux-386), func LsfJump(int, int, int, int) *SockFilter +pkg syscall (linux-386), func LsfSocket(int, int) (int, error) +pkg syscall (linux-386), func LsfStmt(int, int) *SockFilter +pkg syscall (linux-386), func Lstat(string, *Stat_t) error +pkg syscall (linux-386), func Madvise([]uint8, int) error +pkg syscall (linux-386), func Mkdirat(int, string, uint32) error +pkg syscall (linux-386), func Mkfifo(string, uint32) error +pkg syscall (linux-386), func Mknod(string, uint32, int) error +pkg syscall (linux-386), func Mknodat(int, string, uint32, int) error +pkg syscall (linux-386), func Mlock([]uint8) error +pkg syscall (linux-386), func Mlockall(int) error +pkg syscall (linux-386), func Mmap(int, int64, int, int, int) ([]uint8, error) +pkg syscall (linux-386), func Mount(string, string, string, uintptr, string) error +pkg syscall (linux-386), func Mprotect([]uint8, int) error +pkg syscall (linux-386), func Munlock([]uint8) error +pkg syscall (linux-386), func Munlockall() error +pkg syscall (linux-386), func Munmap([]uint8) error +pkg syscall (linux-386), func Nanosleep(*Timespec, *Timespec) error +pkg syscall (linux-386), func NetlinkRIB(int, int) ([]uint8, error) +pkg syscall (linux-386), func NsecToTimespec(int64) Timespec +pkg syscall (linux-386), func Open(string, int, uint32) (int, error) +pkg syscall (linux-386), func Openat(int, string, int, uint32) (int, error) +pkg syscall (linux-386), func ParseDirent([]uint8, int, []string) (int, int, []string) +pkg syscall (linux-386), func ParseNetlinkMessage([]uint8) ([]NetlinkMessage, error) +pkg syscall (linux-386), func ParseNetlinkRouteAttr(*NetlinkMessage) ([]NetlinkRouteAttr, error) +pkg syscall (linux-386), func ParseSocketControlMessage([]uint8) ([]SocketControlMessage, error) +pkg syscall (linux-386), func ParseUnixCredentials(*SocketControlMessage) (*Ucred, error) +pkg syscall (linux-386), func ParseUnixRights(*SocketControlMessage) ([]int, error) +pkg syscall (linux-386), func Pause() error +pkg syscall (linux-386), func Pipe([]int) error +pkg syscall (linux-386), func PivotRoot(string, string) error +pkg syscall (linux-386), func Pread(int, []uint8, int64) (int, error) +pkg syscall (linux-386), func PtraceAttach(int) error +pkg syscall (linux-386), func PtraceCont(int, int) error +pkg syscall (linux-386), func PtraceDetach(int) error +pkg syscall (linux-386), func PtraceGetEventMsg(int) (uint, error) +pkg syscall (linux-386), func PtraceGetRegs(int, *PtraceRegs) error +pkg syscall (linux-386), func PtracePeekData(int, uintptr, []uint8) (int, error) +pkg syscall (linux-386), func PtracePeekText(int, uintptr, []uint8) (int, error) +pkg syscall (linux-386), func PtracePokeData(int, uintptr, []uint8) (int, error) +pkg syscall (linux-386), func PtracePokeText(int, uintptr, []uint8) (int, error) +pkg syscall (linux-386), func PtraceSetOptions(int, int) error +pkg syscall (linux-386), func PtraceSetRegs(int, *PtraceRegs) error +pkg syscall (linux-386), func PtraceSingleStep(int) error +pkg syscall (linux-386), func Pwrite(int, []uint8, int64) (int, error) +pkg syscall (linux-386), func RawSyscall(uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno) +pkg syscall (linux-386), func RawSyscall6(uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno) +pkg syscall (linux-386), func Read(int, []uint8) (int, error) +pkg syscall (linux-386), func ReadDirent(int, []uint8) (int, error) +pkg syscall (linux-386), func Reboot(int) error +pkg syscall (linux-386), func Recvfrom(int, []uint8, int) (int, Sockaddr, error) +pkg syscall (linux-386), func Recvmsg(int, []uint8, []uint8, int) (int, int, int, Sockaddr, error) +pkg syscall (linux-386), func Renameat(int, string, int, string) error +pkg syscall (linux-386), func Seek(int, int64, int) (int64, error) +pkg syscall (linux-386), func Select(int, *FdSet, *FdSet, *FdSet, *Timeval) (int, error) +pkg syscall (linux-386), func Sendfile(int, int, *int64, int) (int, error) +pkg syscall (linux-386), func Sendmsg(int, []uint8, []uint8, Sockaddr, int) error +pkg syscall (linux-386), func Sendto(int, []uint8, int, Sockaddr) error +pkg syscall (linux-386), func SetLsfPromisc(string, bool) error +pkg syscall (linux-386), func SetNonblock(int, bool) error +pkg syscall (linux-386), func Setdomainname([]uint8) error +pkg syscall (linux-386), func Setfsgid(int) error +pkg syscall (linux-386), func Setfsuid(int) error +pkg syscall (linux-386), func Setgid(int) error +pkg syscall (linux-386), func Setgroups([]int) error +pkg syscall (linux-386), func Sethostname([]uint8) error +pkg syscall (linux-386), func Setpgid(int, int) error +pkg syscall (linux-386), func Setregid(int, int) error +pkg syscall (linux-386), func Setresgid(int, int, int) error +pkg syscall (linux-386), func Setresuid(int, int, int) error +pkg syscall (linux-386), func Setreuid(int, int) error +pkg syscall (linux-386), func Setrlimit(int, *Rlimit) error +pkg syscall (linux-386), func Setsid() (int, error) +pkg syscall (linux-386), func SetsockoptIPMreq(int, int, int, *IPMreq) error +pkg syscall (linux-386), func SetsockoptIPMreqn(int, int, int, *IPMreqn) error +pkg syscall (linux-386), func SetsockoptIPv6Mreq(int, int, int, *IPv6Mreq) error +pkg syscall (linux-386), func SetsockoptInet4Addr(int, int, int, [4]uint8) error +pkg syscall (linux-386), func SetsockoptInt(int, int, int, int) error +pkg syscall (linux-386), func SetsockoptLinger(int, int, int, *Linger) error +pkg syscall (linux-386), func SetsockoptString(int, int, int, string) error +pkg syscall (linux-386), func SetsockoptTimeval(int, int, int, *Timeval) error +pkg syscall (linux-386), func Settimeofday(*Timeval) error +pkg syscall (linux-386), func Setuid(int) error +pkg syscall (linux-386), func Shutdown(int, int) error +pkg syscall (linux-386), func Socket(int, int, int) (int, error) +pkg syscall (linux-386), func Socketpair(int, int, int) ([2]int, error) +pkg syscall (linux-386), func Splice(int, *int64, int, *int64, int, int) (int, error) +pkg syscall (linux-386), func Stat(string, *Stat_t) error +pkg syscall (linux-386), func Statfs(string, *Statfs_t) error +pkg syscall (linux-386), func StringSlicePtr([]string) []*uint8 +pkg syscall (linux-386), func Sync() +pkg syscall (linux-386), func SyncFileRange(int, int64, int64, int) error +pkg syscall (linux-386), func Syscall(uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno) +pkg syscall (linux-386), func Syscall6(uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno) +pkg syscall (linux-386), func Sysinfo(*Sysinfo_t) error +pkg syscall (linux-386), func Tee(int, int, int, int) (int64, error) +pkg syscall (linux-386), func Tgkill(int, int, Signal) error +pkg syscall (linux-386), func Time(*Time_t) (Time_t, error) +pkg syscall (linux-386), func Times(*Tms) (uintptr, error) +pkg syscall (linux-386), func TimespecToNsec(Timespec) int64 +pkg syscall (linux-386), func TimevalToNsec(Timeval) int64 +pkg syscall (linux-386), func Truncate(string, int64) error +pkg syscall (linux-386), func Umask(int) int +pkg syscall (linux-386), func Uname(*Utsname) error +pkg syscall (linux-386), func UnixCredentials(*Ucred) []uint8 +pkg syscall (linux-386), func UnixRights(...int) []uint8 +pkg syscall (linux-386), func Unlinkat(int, string) error +pkg syscall (linux-386), func Unmount(string, int) error +pkg syscall (linux-386), func Unshare(int) error +pkg syscall (linux-386), func Ustat(int, *Ustat_t) error +pkg syscall (linux-386), func Utime(string, *Utimbuf) error +pkg syscall (linux-386), func Wait4(int, *WaitStatus, int, *Rusage) (int, error) +pkg syscall (linux-386), func Write(int, []uint8) (int, error) +pkg syscall (linux-386), method (*Cmsghdr) SetLen(int) +pkg syscall (linux-386), method (*Iovec) SetLen(int) +pkg syscall (linux-386), method (*Msghdr) SetControllen(int) +pkg syscall (linux-386), method (*PtraceRegs) PC() uint64 +pkg syscall (linux-386), method (*PtraceRegs) SetPC(uint64) +pkg syscall (linux-386), type Cmsghdr struct +pkg syscall (linux-386), type Cmsghdr struct, Len uint32 +pkg syscall (linux-386), type Cmsghdr struct, Level int32 +pkg syscall (linux-386), type Cmsghdr struct, Type int32 +pkg syscall (linux-386), type Cmsghdr struct, X__cmsg_data [0]uint8 +pkg syscall (linux-386), type Credential struct +pkg syscall (linux-386), type Credential struct, Gid uint32 +pkg syscall (linux-386), type Credential struct, Groups []uint32 +pkg syscall (linux-386), type Credential struct, Uid uint32 +pkg syscall (linux-386), type Dirent struct +pkg syscall (linux-386), type Dirent struct, Ino uint64 +pkg syscall (linux-386), type Dirent struct, Name [256]int8 +pkg syscall (linux-386), type Dirent struct, Off int64 +pkg syscall (linux-386), type Dirent struct, Pad_cgo_0 [1]uint8 +pkg syscall (linux-386), type Dirent struct, Reclen uint16 +pkg syscall (linux-386), type Dirent struct, Type uint8 +pkg syscall (linux-386), type EpollEvent struct +pkg syscall (linux-386), type EpollEvent struct, Events uint32 +pkg syscall (linux-386), type EpollEvent struct, Fd int32 +pkg syscall (linux-386), type EpollEvent struct, Pad int32 +pkg syscall (linux-386), type FdSet struct +pkg syscall (linux-386), type FdSet struct, Bits [32]int32 +pkg syscall (linux-386), type Fsid struct +pkg syscall (linux-386), type Fsid struct, X__val [2]int32 +pkg syscall (linux-386), type IPMreqn struct +pkg syscall (linux-386), type IPMreqn struct, Address [4]uint8 +pkg syscall (linux-386), type IPMreqn struct, Ifindex int32 +pkg syscall (linux-386), type IPMreqn struct, Multiaddr [4]uint8 +pkg syscall (linux-386), type IfAddrmsg struct +pkg syscall (linux-386), type IfAddrmsg struct, Family uint8 +pkg syscall (linux-386), type IfAddrmsg struct, Flags uint8 +pkg syscall (linux-386), type IfAddrmsg struct, Index uint32 +pkg syscall (linux-386), type IfAddrmsg struct, Prefixlen uint8 +pkg syscall (linux-386), type IfAddrmsg struct, Scope uint8 +pkg syscall (linux-386), type IfInfomsg struct +pkg syscall (linux-386), type IfInfomsg struct, Change uint32 +pkg syscall (linux-386), type IfInfomsg struct, Family uint8 +pkg syscall (linux-386), type IfInfomsg struct, Flags uint32 +pkg syscall (linux-386), type IfInfomsg struct, Index int32 +pkg syscall (linux-386), type IfInfomsg struct, Type uint16 +pkg syscall (linux-386), type IfInfomsg struct, X__ifi_pad uint8 +pkg syscall (linux-386), type Inet4Pktinfo struct +pkg syscall (linux-386), type Inet4Pktinfo struct, Addr [4]uint8 +pkg syscall (linux-386), type Inet4Pktinfo struct, Ifindex int32 +pkg syscall (linux-386), type Inet4Pktinfo struct, Spec_dst [4]uint8 +pkg syscall (linux-386), type Inet6Pktinfo struct +pkg syscall (linux-386), type Inet6Pktinfo struct, Addr [16]uint8 +pkg syscall (linux-386), type Inet6Pktinfo struct, Ifindex uint32 +pkg syscall (linux-386), type InotifyEvent struct +pkg syscall (linux-386), type InotifyEvent struct, Cookie uint32 +pkg syscall (linux-386), type InotifyEvent struct, Len uint32 +pkg syscall (linux-386), type InotifyEvent struct, Mask uint32 +pkg syscall (linux-386), type InotifyEvent struct, Name [0]uint8 +pkg syscall (linux-386), type InotifyEvent struct, Wd int32 +pkg syscall (linux-386), type Iovec struct +pkg syscall (linux-386), type Iovec struct, Base *uint8 +pkg syscall (linux-386), type Iovec struct, Len uint32 +pkg syscall (linux-386), type Msghdr struct +pkg syscall (linux-386), type Msghdr struct, Control *uint8 +pkg syscall (linux-386), type Msghdr struct, Controllen uint32 +pkg syscall (linux-386), type Msghdr struct, Flags int32 +pkg syscall (linux-386), type Msghdr struct, Iov *Iovec +pkg syscall (linux-386), type Msghdr struct, Iovlen uint32 +pkg syscall (linux-386), type Msghdr struct, Name *uint8 +pkg syscall (linux-386), type Msghdr struct, Namelen uint32 +pkg syscall (linux-386), type NetlinkMessage struct +pkg syscall (linux-386), type NetlinkMessage struct, Data []uint8 +pkg syscall (linux-386), type NetlinkMessage struct, Header NlMsghdr +pkg syscall (linux-386), type NetlinkRouteAttr struct +pkg syscall (linux-386), type NetlinkRouteAttr struct, Attr RtAttr +pkg syscall (linux-386), type NetlinkRouteAttr struct, Value []uint8 +pkg syscall (linux-386), type NetlinkRouteRequest struct +pkg syscall (linux-386), type NetlinkRouteRequest struct, Data RtGenmsg +pkg syscall (linux-386), type NetlinkRouteRequest struct, Header NlMsghdr +pkg syscall (linux-386), type NlAttr struct +pkg syscall (linux-386), type NlAttr struct, Len uint16 +pkg syscall (linux-386), type NlAttr struct, Type uint16 +pkg syscall (linux-386), type NlMsgerr struct +pkg syscall (linux-386), type NlMsgerr struct, Error int32 +pkg syscall (linux-386), type NlMsgerr struct, Msg NlMsghdr +pkg syscall (linux-386), type NlMsghdr struct +pkg syscall (linux-386), type NlMsghdr struct, Flags uint16 +pkg syscall (linux-386), type NlMsghdr struct, Len uint32 +pkg syscall (linux-386), type NlMsghdr struct, Pid uint32 +pkg syscall (linux-386), type NlMsghdr struct, Seq uint32 +pkg syscall (linux-386), type NlMsghdr struct, Type uint16 +pkg syscall (linux-386), type PtraceRegs struct +pkg syscall (linux-386), type PtraceRegs struct, Eax int32 +pkg syscall (linux-386), type PtraceRegs struct, Ebp int32 +pkg syscall (linux-386), type PtraceRegs struct, Ebx int32 +pkg syscall (linux-386), type PtraceRegs struct, Ecx int32 +pkg syscall (linux-386), type PtraceRegs struct, Edi int32 +pkg syscall (linux-386), type PtraceRegs struct, Edx int32 +pkg syscall (linux-386), type PtraceRegs struct, Eflags int32 +pkg syscall (linux-386), type PtraceRegs struct, Eip int32 +pkg syscall (linux-386), type PtraceRegs struct, Esi int32 +pkg syscall (linux-386), type PtraceRegs struct, Esp int32 +pkg syscall (linux-386), type PtraceRegs struct, Orig_eax int32 +pkg syscall (linux-386), type PtraceRegs struct, Xcs int32 +pkg syscall (linux-386), type PtraceRegs struct, Xds int32 +pkg syscall (linux-386), type PtraceRegs struct, Xes int32 +pkg syscall (linux-386), type PtraceRegs struct, Xfs int32 +pkg syscall (linux-386), type PtraceRegs struct, Xgs int32 +pkg syscall (linux-386), type PtraceRegs struct, Xss int32 +pkg syscall (linux-386), type RawSockaddr struct, Data [14]int8 +pkg syscall (linux-386), type RawSockaddr struct, Family uint16 +pkg syscall (linux-386), type RawSockaddrAny struct, Pad [96]int8 +pkg syscall (linux-386), type RawSockaddrInet4 struct, Family uint16 +pkg syscall (linux-386), type RawSockaddrInet4 struct, Zero [8]uint8 +pkg syscall (linux-386), type RawSockaddrInet6 struct +pkg syscall (linux-386), type RawSockaddrInet6 struct, Addr [16]uint8 +pkg syscall (linux-386), type RawSockaddrInet6 struct, Family uint16 +pkg syscall (linux-386), type RawSockaddrInet6 struct, Flowinfo uint32 +pkg syscall (linux-386), type RawSockaddrInet6 struct, Port uint16 +pkg syscall (linux-386), type RawSockaddrInet6 struct, Scope_id uint32 +pkg syscall (linux-386), type RawSockaddrLinklayer struct +pkg syscall (linux-386), type RawSockaddrLinklayer struct, Addr [8]uint8 +pkg syscall (linux-386), type RawSockaddrLinklayer struct, Family uint16 +pkg syscall (linux-386), type RawSockaddrLinklayer struct, Halen uint8 +pkg syscall (linux-386), type RawSockaddrLinklayer struct, Hatype uint16 +pkg syscall (linux-386), type RawSockaddrLinklayer struct, Ifindex int32 +pkg syscall (linux-386), type RawSockaddrLinklayer struct, Pkttype uint8 +pkg syscall (linux-386), type RawSockaddrLinklayer struct, Protocol uint16 +pkg syscall (linux-386), type RawSockaddrNetlink struct +pkg syscall (linux-386), type RawSockaddrNetlink struct, Family uint16 +pkg syscall (linux-386), type RawSockaddrNetlink struct, Groups uint32 +pkg syscall (linux-386), type RawSockaddrNetlink struct, Pad uint16 +pkg syscall (linux-386), type RawSockaddrNetlink struct, Pid uint32 +pkg syscall (linux-386), type RawSockaddrUnix struct +pkg syscall (linux-386), type RawSockaddrUnix struct, Family uint16 +pkg syscall (linux-386), type RawSockaddrUnix struct, Path [108]int8 +pkg syscall (linux-386), type Rlimit struct +pkg syscall (linux-386), type Rlimit struct, Cur uint64 +pkg syscall (linux-386), type Rlimit struct, Max uint64 +pkg syscall (linux-386), type RtAttr struct +pkg syscall (linux-386), type RtAttr struct, Len uint16 +pkg syscall (linux-386), type RtAttr struct, Type uint16 +pkg syscall (linux-386), type RtGenmsg struct +pkg syscall (linux-386), type RtGenmsg struct, Family uint8 +pkg syscall (linux-386), type RtMsg struct +pkg syscall (linux-386), type RtMsg struct, Dst_len uint8 +pkg syscall (linux-386), type RtMsg struct, Family uint8 +pkg syscall (linux-386), type RtMsg struct, Flags uint32 +pkg syscall (linux-386), type RtMsg struct, Protocol uint8 +pkg syscall (linux-386), type RtMsg struct, Scope uint8 +pkg syscall (linux-386), type RtMsg struct, Src_len uint8 +pkg syscall (linux-386), type RtMsg struct, Table uint8 +pkg syscall (linux-386), type RtMsg struct, Tos uint8 +pkg syscall (linux-386), type RtMsg struct, Type uint8 +pkg syscall (linux-386), type RtNexthop struct +pkg syscall (linux-386), type RtNexthop struct, Flags uint8 +pkg syscall (linux-386), type RtNexthop struct, Hops uint8 +pkg syscall (linux-386), type RtNexthop struct, Ifindex int32 +pkg syscall (linux-386), type RtNexthop struct, Len uint16 +pkg syscall (linux-386), type Rusage struct, Idrss int32 +pkg syscall (linux-386), type Rusage struct, Inblock int32 +pkg syscall (linux-386), type Rusage struct, Isrss int32 +pkg syscall (linux-386), type Rusage struct, Ixrss int32 +pkg syscall (linux-386), type Rusage struct, Majflt int32 +pkg syscall (linux-386), type Rusage struct, Maxrss int32 +pkg syscall (linux-386), type Rusage struct, Minflt int32 +pkg syscall (linux-386), type Rusage struct, Msgrcv int32 +pkg syscall (linux-386), type Rusage struct, Msgsnd int32 +pkg syscall (linux-386), type Rusage struct, Nivcsw int32 +pkg syscall (linux-386), type Rusage struct, Nsignals int32 +pkg syscall (linux-386), type Rusage struct, Nswap int32 +pkg syscall (linux-386), type Rusage struct, Nvcsw int32 +pkg syscall (linux-386), type Rusage struct, Oublock int32 +pkg syscall (linux-386), type Rusage struct, Stime Timeval +pkg syscall (linux-386), type Rusage struct, Utime Timeval +pkg syscall (linux-386), type SockFilter struct +pkg syscall (linux-386), type SockFilter struct, Code uint16 +pkg syscall (linux-386), type SockFilter struct, Jf uint8 +pkg syscall (linux-386), type SockFilter struct, Jt uint8 +pkg syscall (linux-386), type SockFilter struct, K uint32 +pkg syscall (linux-386), type SockFprog struct +pkg syscall (linux-386), type SockFprog struct, Filter *SockFilter +pkg syscall (linux-386), type SockFprog struct, Len uint16 +pkg syscall (linux-386), type SockFprog struct, Pad_cgo_0 [2]uint8 +pkg syscall (linux-386), type SockaddrLinklayer struct +pkg syscall (linux-386), type SockaddrLinklayer struct, Addr [8]uint8 +pkg syscall (linux-386), type SockaddrLinklayer struct, Halen uint8 +pkg syscall (linux-386), type SockaddrLinklayer struct, Hatype uint16 +pkg syscall (linux-386), type SockaddrLinklayer struct, Ifindex int +pkg syscall (linux-386), type SockaddrLinklayer struct, Pkttype uint8 +pkg syscall (linux-386), type SockaddrLinklayer struct, Protocol uint16 +pkg syscall (linux-386), type SockaddrNetlink struct +pkg syscall (linux-386), type SockaddrNetlink struct, Family uint16 +pkg syscall (linux-386), type SockaddrNetlink struct, Groups uint32 +pkg syscall (linux-386), type SockaddrNetlink struct, Pad uint16 +pkg syscall (linux-386), type SockaddrNetlink struct, Pid uint32 +pkg syscall (linux-386), type SocketControlMessage struct +pkg syscall (linux-386), type SocketControlMessage struct, Data []uint8 +pkg syscall (linux-386), type SocketControlMessage struct, Header Cmsghdr +pkg syscall (linux-386), type Stat_t struct +pkg syscall (linux-386), type Stat_t struct, Atim Timespec +pkg syscall (linux-386), type Stat_t struct, Blksize int32 +pkg syscall (linux-386), type Stat_t struct, Blocks int64 +pkg syscall (linux-386), type Stat_t struct, Ctim Timespec +pkg syscall (linux-386), type Stat_t struct, Dev uint64 +pkg syscall (linux-386), type Stat_t struct, Gid uint32 +pkg syscall (linux-386), type Stat_t struct, Ino uint64 +pkg syscall (linux-386), type Stat_t struct, Mode uint32 +pkg syscall (linux-386), type Stat_t struct, Mtim Timespec +pkg syscall (linux-386), type Stat_t struct, Nlink uint32 +pkg syscall (linux-386), type Stat_t struct, Pad_cgo_0 [2]uint8 +pkg syscall (linux-386), type Stat_t struct, Pad_cgo_1 [2]uint8 +pkg syscall (linux-386), type Stat_t struct, Rdev uint64 +pkg syscall (linux-386), type Stat_t struct, Size int64 +pkg syscall (linux-386), type Stat_t struct, Uid uint32 +pkg syscall (linux-386), type Stat_t struct, X__pad1 uint16 +pkg syscall (linux-386), type Stat_t struct, X__pad2 uint16 +pkg syscall (linux-386), type Stat_t struct, X__st_ino uint32 +pkg syscall (linux-386), type Statfs_t struct +pkg syscall (linux-386), type Statfs_t struct, Bavail uint64 +pkg syscall (linux-386), type Statfs_t struct, Bfree uint64 +pkg syscall (linux-386), type Statfs_t struct, Blocks uint64 +pkg syscall (linux-386), type Statfs_t struct, Bsize int32 +pkg syscall (linux-386), type Statfs_t struct, Ffree uint64 +pkg syscall (linux-386), type Statfs_t struct, Files uint64 +pkg syscall (linux-386), type Statfs_t struct, Flags int32 +pkg syscall (linux-386), type Statfs_t struct, Frsize int32 +pkg syscall (linux-386), type Statfs_t struct, Fsid Fsid +pkg syscall (linux-386), type Statfs_t struct, Namelen int32 +pkg syscall (linux-386), type Statfs_t struct, Spare [4]int32 +pkg syscall (linux-386), type Statfs_t struct, Type int32 +pkg syscall (linux-386), type SysProcAttr struct, Chroot string +pkg syscall (linux-386), type SysProcAttr struct, Credential *Credential +pkg syscall (linux-386), type SysProcAttr struct, Noctty bool +pkg syscall (linux-386), type SysProcAttr struct, Pdeathsig Signal +pkg syscall (linux-386), type SysProcAttr struct, Ptrace bool +pkg syscall (linux-386), type SysProcAttr struct, Setctty bool +pkg syscall (linux-386), type SysProcAttr struct, Setpgid bool +pkg syscall (linux-386), type SysProcAttr struct, Setsid bool +pkg syscall (linux-386), type Sysinfo_t struct +pkg syscall (linux-386), type Sysinfo_t struct, Bufferram uint32 +pkg syscall (linux-386), type Sysinfo_t struct, Freehigh uint32 +pkg syscall (linux-386), type Sysinfo_t struct, Freeram uint32 +pkg syscall (linux-386), type Sysinfo_t struct, Freeswap uint32 +pkg syscall (linux-386), type Sysinfo_t struct, Loads [3]uint32 +pkg syscall (linux-386), type Sysinfo_t struct, Pad uint16 +pkg syscall (linux-386), type Sysinfo_t struct, Procs uint16 +pkg syscall (linux-386), type Sysinfo_t struct, Sharedram uint32 +pkg syscall (linux-386), type Sysinfo_t struct, Totalhigh uint32 +pkg syscall (linux-386), type Sysinfo_t struct, Totalram uint32 +pkg syscall (linux-386), type Sysinfo_t struct, Totalswap uint32 +pkg syscall (linux-386), type Sysinfo_t struct, Unit uint32 +pkg syscall (linux-386), type Sysinfo_t struct, Uptime int32 +pkg syscall (linux-386), type Sysinfo_t struct, X_f [8]int8 +pkg syscall (linux-386), type Termios struct +pkg syscall (linux-386), type Termios struct, Cc [32]uint8 +pkg syscall (linux-386), type Termios struct, Cflag uint32 +pkg syscall (linux-386), type Termios struct, Iflag uint32 +pkg syscall (linux-386), type Termios struct, Ispeed uint32 +pkg syscall (linux-386), type Termios struct, Lflag uint32 +pkg syscall (linux-386), type Termios struct, Line uint8 +pkg syscall (linux-386), type Termios struct, Oflag uint32 +pkg syscall (linux-386), type Termios struct, Ospeed uint32 +pkg syscall (linux-386), type Termios struct, Pad_cgo_0 [3]uint8 +pkg syscall (linux-386), type Time_t int32 +pkg syscall (linux-386), type Timespec struct, Nsec int32 +pkg syscall (linux-386), type Timespec struct, Sec int32 +pkg syscall (linux-386), type Timeval struct, Sec int32 +pkg syscall (linux-386), type Timeval struct, Usec int32 +pkg syscall (linux-386), type Timex struct +pkg syscall (linux-386), type Timex struct, Calcnt int32 +pkg syscall (linux-386), type Timex struct, Constant int32 +pkg syscall (linux-386), type Timex struct, Errcnt int32 +pkg syscall (linux-386), type Timex struct, Esterror int32 +pkg syscall (linux-386), type Timex struct, Freq int32 +pkg syscall (linux-386), type Timex struct, Jitcnt int32 +pkg syscall (linux-386), type Timex struct, Jitter int32 +pkg syscall (linux-386), type Timex struct, Maxerror int32 +pkg syscall (linux-386), type Timex struct, Modes uint32 +pkg syscall (linux-386), type Timex struct, Offset int32 +pkg syscall (linux-386), type Timex struct, Pad_cgo_0 [44]uint8 +pkg syscall (linux-386), type Timex struct, Ppsfreq int32 +pkg syscall (linux-386), type Timex struct, Precision int32 +pkg syscall (linux-386), type Timex struct, Shift int32 +pkg syscall (linux-386), type Timex struct, Stabil int32 +pkg syscall (linux-386), type Timex struct, Status int32 +pkg syscall (linux-386), type Timex struct, Stbcnt int32 +pkg syscall (linux-386), type Timex struct, Tai int32 +pkg syscall (linux-386), type Timex struct, Tick int32 +pkg syscall (linux-386), type Timex struct, Time Timeval +pkg syscall (linux-386), type Timex struct, Tolerance int32 +pkg syscall (linux-386), type Tms struct +pkg syscall (linux-386), type Tms struct, Cstime int32 +pkg syscall (linux-386), type Tms struct, Cutime int32 +pkg syscall (linux-386), type Tms struct, Stime int32 +pkg syscall (linux-386), type Tms struct, Utime int32 +pkg syscall (linux-386), type Ucred struct +pkg syscall (linux-386), type Ucred struct, Gid uint32 +pkg syscall (linux-386), type Ucred struct, Pid int32 +pkg syscall (linux-386), type Ucred struct, Uid uint32 +pkg syscall (linux-386), type Ustat_t struct +pkg syscall (linux-386), type Ustat_t struct, Fname [6]int8 +pkg syscall (linux-386), type Ustat_t struct, Fpack [6]int8 +pkg syscall (linux-386), type Ustat_t struct, Tfree int32 +pkg syscall (linux-386), type Ustat_t struct, Tinode uint32 +pkg syscall (linux-386), type Utimbuf struct +pkg syscall (linux-386), type Utimbuf struct, Actime int32 +pkg syscall (linux-386), type Utimbuf struct, Modtime int32 +pkg syscall (linux-386), type Utsname struct +pkg syscall (linux-386), type Utsname struct, Domainname [65]int8 +pkg syscall (linux-386), type Utsname struct, Machine [65]int8 +pkg syscall (linux-386), type Utsname struct, Nodename [65]int8 +pkg syscall (linux-386), type Utsname struct, Release [65]int8 +pkg syscall (linux-386), type Utsname struct, Sysname [65]int8 +pkg syscall (linux-386), type Utsname struct, Version [65]int8 +pkg syscall (linux-386), type WaitStatus uint32 +pkg syscall (linux-386), var Stderr int +pkg syscall (linux-386), var Stdin int +pkg syscall (linux-386), var Stdout int +pkg syscall (linux-386-cgo), const AF_ALG ideal-int +pkg syscall (linux-386-cgo), const AF_APPLETALK ideal-int +pkg syscall (linux-386-cgo), const AF_ASH ideal-int +pkg syscall (linux-386-cgo), const AF_ATMPVC ideal-int +pkg syscall (linux-386-cgo), const AF_ATMSVC ideal-int +pkg syscall (linux-386-cgo), const AF_AX25 ideal-int +pkg syscall (linux-386-cgo), const AF_BLUETOOTH ideal-int +pkg syscall (linux-386-cgo), const AF_BRIDGE ideal-int +pkg syscall (linux-386-cgo), const AF_CAIF ideal-int +pkg syscall (linux-386-cgo), const AF_CAN ideal-int +pkg syscall (linux-386-cgo), const AF_DECnet ideal-int +pkg syscall (linux-386-cgo), const AF_ECONET ideal-int +pkg syscall (linux-386-cgo), const AF_FILE ideal-int +pkg syscall (linux-386-cgo), const AF_IEEE802154 ideal-int +pkg syscall (linux-386-cgo), const AF_IPX ideal-int +pkg syscall (linux-386-cgo), const AF_IRDA ideal-int +pkg syscall (linux-386-cgo), const AF_ISDN ideal-int +pkg syscall (linux-386-cgo), const AF_IUCV ideal-int +pkg syscall (linux-386-cgo), const AF_KEY ideal-int +pkg syscall (linux-386-cgo), const AF_LLC ideal-int +pkg syscall (linux-386-cgo), const AF_LOCAL ideal-int +pkg syscall (linux-386-cgo), const AF_MAX ideal-int +pkg syscall (linux-386-cgo), const AF_NETBEUI ideal-int +pkg syscall (linux-386-cgo), const AF_NETLINK ideal-int +pkg syscall (linux-386-cgo), const AF_NETROM ideal-int +pkg syscall (linux-386-cgo), const AF_PACKET ideal-int +pkg syscall (linux-386-cgo), const AF_PHONET ideal-int +pkg syscall (linux-386-cgo), const AF_PPPOX ideal-int +pkg syscall (linux-386-cgo), const AF_RDS ideal-int +pkg syscall (linux-386-cgo), const AF_ROSE ideal-int +pkg syscall (linux-386-cgo), const AF_ROUTE ideal-int +pkg syscall (linux-386-cgo), const AF_RXRPC ideal-int +pkg syscall (linux-386-cgo), const AF_SECURITY ideal-int +pkg syscall (linux-386-cgo), const AF_SNA ideal-int +pkg syscall (linux-386-cgo), const AF_TIPC ideal-int +pkg syscall (linux-386-cgo), const AF_WANPIPE ideal-int +pkg syscall (linux-386-cgo), const AF_X25 ideal-int +pkg syscall (linux-386-cgo), const ARPHRD_ADAPT ideal-int +pkg syscall (linux-386-cgo), const ARPHRD_APPLETLK ideal-int +pkg syscall (linux-386-cgo), const ARPHRD_ARCNET ideal-int +pkg syscall (linux-386-cgo), const ARPHRD_ASH ideal-int +pkg syscall (linux-386-cgo), const ARPHRD_ATM ideal-int +pkg syscall (linux-386-cgo), const ARPHRD_AX25 ideal-int +pkg syscall (linux-386-cgo), const ARPHRD_BIF ideal-int +pkg syscall (linux-386-cgo), const ARPHRD_CHAOS ideal-int +pkg syscall (linux-386-cgo), const ARPHRD_CISCO ideal-int +pkg syscall (linux-386-cgo), const ARPHRD_CSLIP ideal-int +pkg syscall (linux-386-cgo), const ARPHRD_CSLIP6 ideal-int +pkg syscall (linux-386-cgo), const ARPHRD_DDCMP ideal-int +pkg syscall (linux-386-cgo), const ARPHRD_DLCI ideal-int +pkg syscall (linux-386-cgo), const ARPHRD_ECONET ideal-int +pkg syscall (linux-386-cgo), const ARPHRD_EETHER ideal-int +pkg syscall (linux-386-cgo), const ARPHRD_ETHER ideal-int +pkg syscall (linux-386-cgo), const ARPHRD_EUI64 ideal-int +pkg syscall (linux-386-cgo), const ARPHRD_FCAL ideal-int +pkg syscall (linux-386-cgo), const ARPHRD_FCFABRIC ideal-int +pkg syscall (linux-386-cgo), const ARPHRD_FCPL ideal-int +pkg syscall (linux-386-cgo), const ARPHRD_FCPP ideal-int +pkg syscall (linux-386-cgo), const ARPHRD_FDDI ideal-int +pkg syscall (linux-386-cgo), const ARPHRD_FRAD ideal-int +pkg syscall (linux-386-cgo), const ARPHRD_HDLC ideal-int +pkg syscall (linux-386-cgo), const ARPHRD_HIPPI ideal-int +pkg syscall (linux-386-cgo), const ARPHRD_HWX25 ideal-int +pkg syscall (linux-386-cgo), const ARPHRD_IEEE1394 ideal-int +pkg syscall (linux-386-cgo), const ARPHRD_IEEE802 ideal-int +pkg syscall (linux-386-cgo), const ARPHRD_IEEE80211 ideal-int +pkg syscall (linux-386-cgo), const ARPHRD_IEEE80211_PRISM ideal-int +pkg syscall (linux-386-cgo), const ARPHRD_IEEE80211_RADIOTAP ideal-int +pkg syscall (linux-386-cgo), const ARPHRD_IEEE802154 ideal-int +pkg syscall (linux-386-cgo), const ARPHRD_IEEE802154_PHY ideal-int +pkg syscall (linux-386-cgo), const ARPHRD_IEEE802_TR ideal-int +pkg syscall (linux-386-cgo), const ARPHRD_INFINIBAND ideal-int +pkg syscall (linux-386-cgo), const ARPHRD_IPDDP ideal-int +pkg syscall (linux-386-cgo), const ARPHRD_IPGRE ideal-int +pkg syscall (linux-386-cgo), const ARPHRD_IRDA ideal-int +pkg syscall (linux-386-cgo), const ARPHRD_LAPB ideal-int +pkg syscall (linux-386-cgo), const ARPHRD_LOCALTLK ideal-int +pkg syscall (linux-386-cgo), const ARPHRD_LOOPBACK ideal-int +pkg syscall (linux-386-cgo), const ARPHRD_METRICOM ideal-int +pkg syscall (linux-386-cgo), const ARPHRD_NETROM ideal-int +pkg syscall (linux-386-cgo), const ARPHRD_NONE ideal-int +pkg syscall (linux-386-cgo), const ARPHRD_PIMREG ideal-int +pkg syscall (linux-386-cgo), const ARPHRD_PPP ideal-int +pkg syscall (linux-386-cgo), const ARPHRD_PRONET ideal-int +pkg syscall (linux-386-cgo), const ARPHRD_RAWHDLC ideal-int +pkg syscall (linux-386-cgo), const ARPHRD_ROSE ideal-int +pkg syscall (linux-386-cgo), const ARPHRD_RSRVD ideal-int +pkg syscall (linux-386-cgo), const ARPHRD_SIT ideal-int +pkg syscall (linux-386-cgo), const ARPHRD_SKIP ideal-int +pkg syscall (linux-386-cgo), const ARPHRD_SLIP ideal-int +pkg syscall (linux-386-cgo), const ARPHRD_SLIP6 ideal-int +pkg syscall (linux-386-cgo), const ARPHRD_TUNNEL ideal-int +pkg syscall (linux-386-cgo), const ARPHRD_TUNNEL6 ideal-int +pkg syscall (linux-386-cgo), const ARPHRD_VOID ideal-int +pkg syscall (linux-386-cgo), const ARPHRD_X25 ideal-int +pkg syscall (linux-386-cgo), const B0 ideal-int +pkg syscall (linux-386-cgo), const B1000000 ideal-int +pkg syscall (linux-386-cgo), const B110 ideal-int +pkg syscall (linux-386-cgo), const B115200 ideal-int +pkg syscall (linux-386-cgo), const B1152000 ideal-int +pkg syscall (linux-386-cgo), const B1200 ideal-int +pkg syscall (linux-386-cgo), const B134 ideal-int +pkg syscall (linux-386-cgo), const B150 ideal-int +pkg syscall (linux-386-cgo), const B1500000 ideal-int +pkg syscall (linux-386-cgo), const B1800 ideal-int +pkg syscall (linux-386-cgo), const B19200 ideal-int +pkg syscall (linux-386-cgo), const B200 ideal-int +pkg syscall (linux-386-cgo), const B2000000 ideal-int +pkg syscall (linux-386-cgo), const B230400 ideal-int +pkg syscall (linux-386-cgo), const B2400 ideal-int +pkg syscall (linux-386-cgo), const B2500000 ideal-int +pkg syscall (linux-386-cgo), const B300 ideal-int +pkg syscall (linux-386-cgo), const B3000000 ideal-int +pkg syscall (linux-386-cgo), const B3500000 ideal-int +pkg syscall (linux-386-cgo), const B38400 ideal-int +pkg syscall (linux-386-cgo), const B4000000 ideal-int +pkg syscall (linux-386-cgo), const B460800 ideal-int +pkg syscall (linux-386-cgo), const B4800 ideal-int +pkg syscall (linux-386-cgo), const B50 ideal-int +pkg syscall (linux-386-cgo), const B500000 ideal-int +pkg syscall (linux-386-cgo), const B57600 ideal-int +pkg syscall (linux-386-cgo), const B576000 ideal-int +pkg syscall (linux-386-cgo), const B600 ideal-int +pkg syscall (linux-386-cgo), const B75 ideal-int +pkg syscall (linux-386-cgo), const B921600 ideal-int +pkg syscall (linux-386-cgo), const B9600 ideal-int +pkg syscall (linux-386-cgo), const BPF_A ideal-int +pkg syscall (linux-386-cgo), const BPF_ABS ideal-int +pkg syscall (linux-386-cgo), const BPF_ADD ideal-int +pkg syscall (linux-386-cgo), const BPF_ALU ideal-int +pkg syscall (linux-386-cgo), const BPF_AND ideal-int +pkg syscall (linux-386-cgo), const BPF_B ideal-int +pkg syscall (linux-386-cgo), const BPF_DIV ideal-int +pkg syscall (linux-386-cgo), const BPF_H ideal-int +pkg syscall (linux-386-cgo), const BPF_IMM ideal-int +pkg syscall (linux-386-cgo), const BPF_IND ideal-int +pkg syscall (linux-386-cgo), const BPF_JA ideal-int +pkg syscall (linux-386-cgo), const BPF_JEQ ideal-int +pkg syscall (linux-386-cgo), const BPF_JGE ideal-int +pkg syscall (linux-386-cgo), const BPF_JGT ideal-int +pkg syscall (linux-386-cgo), const BPF_JMP ideal-int +pkg syscall (linux-386-cgo), const BPF_JSET ideal-int +pkg syscall (linux-386-cgo), const BPF_K ideal-int +pkg syscall (linux-386-cgo), const BPF_LD ideal-int +pkg syscall (linux-386-cgo), const BPF_LDX ideal-int +pkg syscall (linux-386-cgo), const BPF_LEN ideal-int +pkg syscall (linux-386-cgo), const BPF_LSH ideal-int +pkg syscall (linux-386-cgo), const BPF_MAJOR_VERSION ideal-int +pkg syscall (linux-386-cgo), const BPF_MAXINSNS ideal-int +pkg syscall (linux-386-cgo), const BPF_MEM ideal-int +pkg syscall (linux-386-cgo), const BPF_MEMWORDS ideal-int +pkg syscall (linux-386-cgo), const BPF_MINOR_VERSION ideal-int +pkg syscall (linux-386-cgo), const BPF_MISC ideal-int +pkg syscall (linux-386-cgo), const BPF_MSH ideal-int +pkg syscall (linux-386-cgo), const BPF_MUL ideal-int +pkg syscall (linux-386-cgo), const BPF_NEG ideal-int +pkg syscall (linux-386-cgo), const BPF_OR ideal-int +pkg syscall (linux-386-cgo), const BPF_RET ideal-int +pkg syscall (linux-386-cgo), const BPF_RSH ideal-int +pkg syscall (linux-386-cgo), const BPF_ST ideal-int +pkg syscall (linux-386-cgo), const BPF_STX ideal-int +pkg syscall (linux-386-cgo), const BPF_SUB ideal-int +pkg syscall (linux-386-cgo), const BPF_TAX ideal-int +pkg syscall (linux-386-cgo), const BPF_TXA ideal-int +pkg syscall (linux-386-cgo), const BPF_W ideal-int +pkg syscall (linux-386-cgo), const BPF_X ideal-int +pkg syscall (linux-386-cgo), const BRKINT ideal-int +pkg syscall (linux-386-cgo), const CLOCAL ideal-int +pkg syscall (linux-386-cgo), const CREAD ideal-int +pkg syscall (linux-386-cgo), const CS5 ideal-int +pkg syscall (linux-386-cgo), const CS6 ideal-int +pkg syscall (linux-386-cgo), const CS7 ideal-int +pkg syscall (linux-386-cgo), const CS8 ideal-int +pkg syscall (linux-386-cgo), const CSIZE ideal-int +pkg syscall (linux-386-cgo), const CSTOPB ideal-int +pkg syscall (linux-386-cgo), const DT_BLK ideal-int +pkg syscall (linux-386-cgo), const DT_CHR ideal-int +pkg syscall (linux-386-cgo), const DT_DIR ideal-int +pkg syscall (linux-386-cgo), const DT_FIFO ideal-int +pkg syscall (linux-386-cgo), const DT_LNK ideal-int +pkg syscall (linux-386-cgo), const DT_REG ideal-int +pkg syscall (linux-386-cgo), const DT_SOCK ideal-int +pkg syscall (linux-386-cgo), const DT_UNKNOWN ideal-int +pkg syscall (linux-386-cgo), const DT_WHT ideal-int +pkg syscall (linux-386-cgo), const EADV Errno +pkg syscall (linux-386-cgo), const EBADE Errno +pkg syscall (linux-386-cgo), const EBADFD Errno +pkg syscall (linux-386-cgo), const EBADMSG Errno +pkg syscall (linux-386-cgo), const EBADR Errno +pkg syscall (linux-386-cgo), const EBADRQC Errno +pkg syscall (linux-386-cgo), const EBADSLT Errno +pkg syscall (linux-386-cgo), const EBFONT Errno +pkg syscall (linux-386-cgo), const ECHO ideal-int +pkg syscall (linux-386-cgo), const ECHOCTL ideal-int +pkg syscall (linux-386-cgo), const ECHOE ideal-int +pkg syscall (linux-386-cgo), const ECHOK ideal-int +pkg syscall (linux-386-cgo), const ECHOKE ideal-int +pkg syscall (linux-386-cgo), const ECHONL ideal-int +pkg syscall (linux-386-cgo), const ECHOPRT ideal-int +pkg syscall (linux-386-cgo), const ECHRNG Errno +pkg syscall (linux-386-cgo), const ECOMM Errno +pkg syscall (linux-386-cgo), const EDEADLOCK Errno +pkg syscall (linux-386-cgo), const EDOTDOT Errno +pkg syscall (linux-386-cgo), const EISNAM Errno +pkg syscall (linux-386-cgo), const EKEYEXPIRED Errno +pkg syscall (linux-386-cgo), const EKEYREJECTED Errno +pkg syscall (linux-386-cgo), const EKEYREVOKED Errno +pkg syscall (linux-386-cgo), const EL2HLT Errno +pkg syscall (linux-386-cgo), const EL2NSYNC Errno +pkg syscall (linux-386-cgo), const EL3HLT Errno +pkg syscall (linux-386-cgo), const EL3RST Errno +pkg syscall (linux-386-cgo), const ELIBACC Errno +pkg syscall (linux-386-cgo), const ELIBBAD Errno +pkg syscall (linux-386-cgo), const ELIBEXEC Errno +pkg syscall (linux-386-cgo), const ELIBMAX Errno +pkg syscall (linux-386-cgo), const ELIBSCN Errno +pkg syscall (linux-386-cgo), const ELNRNG Errno +pkg syscall (linux-386-cgo), const EMEDIUMTYPE Errno +pkg syscall (linux-386-cgo), const EMULTIHOP Errno +pkg syscall (linux-386-cgo), const ENAVAIL Errno +pkg syscall (linux-386-cgo), const ENOANO Errno +pkg syscall (linux-386-cgo), const ENOCSI Errno +pkg syscall (linux-386-cgo), const ENODATA Errno +pkg syscall (linux-386-cgo), const ENOKEY Errno +pkg syscall (linux-386-cgo), const ENOLINK Errno +pkg syscall (linux-386-cgo), const ENOMEDIUM Errno +pkg syscall (linux-386-cgo), const ENONET Errno +pkg syscall (linux-386-cgo), const ENOPKG Errno +pkg syscall (linux-386-cgo), const ENOSR Errno +pkg syscall (linux-386-cgo), const ENOSTR Errno +pkg syscall (linux-386-cgo), const ENOTNAM Errno +pkg syscall (linux-386-cgo), const ENOTRECOVERABLE Errno +pkg syscall (linux-386-cgo), const ENOTUNIQ Errno +pkg syscall (linux-386-cgo), const EOWNERDEAD Errno +pkg syscall (linux-386-cgo), const EPOLLERR ideal-int +pkg syscall (linux-386-cgo), const EPOLLET ideal-int +pkg syscall (linux-386-cgo), const EPOLLHUP ideal-int +pkg syscall (linux-386-cgo), const EPOLLIN ideal-int +pkg syscall (linux-386-cgo), const EPOLLMSG ideal-int +pkg syscall (linux-386-cgo), const EPOLLONESHOT ideal-int +pkg syscall (linux-386-cgo), const EPOLLOUT ideal-int +pkg syscall (linux-386-cgo), const EPOLLPRI ideal-int +pkg syscall (linux-386-cgo), const EPOLLRDBAND ideal-int +pkg syscall (linux-386-cgo), const EPOLLRDHUP ideal-int +pkg syscall (linux-386-cgo), const EPOLLRDNORM ideal-int +pkg syscall (linux-386-cgo), const EPOLLWRBAND ideal-int +pkg syscall (linux-386-cgo), const EPOLLWRNORM ideal-int +pkg syscall (linux-386-cgo), const EPOLL_CLOEXEC ideal-int +pkg syscall (linux-386-cgo), const EPOLL_CTL_ADD ideal-int +pkg syscall (linux-386-cgo), const EPOLL_CTL_DEL ideal-int +pkg syscall (linux-386-cgo), const EPOLL_CTL_MOD ideal-int +pkg syscall (linux-386-cgo), const EPOLL_NONBLOCK ideal-int +pkg syscall (linux-386-cgo), const EPROTO Errno +pkg syscall (linux-386-cgo), const EREMCHG Errno +pkg syscall (linux-386-cgo), const EREMOTEIO Errno +pkg syscall (linux-386-cgo), const ERESTART Errno +pkg syscall (linux-386-cgo), const ERFKILL Errno +pkg syscall (linux-386-cgo), const ESRMNT Errno +pkg syscall (linux-386-cgo), const ESTRPIPE Errno +pkg syscall (linux-386-cgo), const ETH_P_1588 ideal-int +pkg syscall (linux-386-cgo), const ETH_P_8021Q ideal-int +pkg syscall (linux-386-cgo), const ETH_P_802_2 ideal-int +pkg syscall (linux-386-cgo), const ETH_P_802_3 ideal-int +pkg syscall (linux-386-cgo), const ETH_P_AARP ideal-int +pkg syscall (linux-386-cgo), const ETH_P_ALL ideal-int +pkg syscall (linux-386-cgo), const ETH_P_AOE ideal-int +pkg syscall (linux-386-cgo), const ETH_P_ARCNET ideal-int +pkg syscall (linux-386-cgo), const ETH_P_ARP ideal-int +pkg syscall (linux-386-cgo), const ETH_P_ATALK ideal-int +pkg syscall (linux-386-cgo), const ETH_P_ATMFATE ideal-int +pkg syscall (linux-386-cgo), const ETH_P_ATMMPOA ideal-int +pkg syscall (linux-386-cgo), const ETH_P_AX25 ideal-int +pkg syscall (linux-386-cgo), const ETH_P_BPQ ideal-int +pkg syscall (linux-386-cgo), const ETH_P_CAIF ideal-int +pkg syscall (linux-386-cgo), const ETH_P_CAN ideal-int +pkg syscall (linux-386-cgo), const ETH_P_CONTROL ideal-int +pkg syscall (linux-386-cgo), const ETH_P_CUST ideal-int +pkg syscall (linux-386-cgo), const ETH_P_DDCMP ideal-int +pkg syscall (linux-386-cgo), const ETH_P_DEC ideal-int +pkg syscall (linux-386-cgo), const ETH_P_DIAG ideal-int +pkg syscall (linux-386-cgo), const ETH_P_DNA_DL ideal-int +pkg syscall (linux-386-cgo), const ETH_P_DNA_RC ideal-int +pkg syscall (linux-386-cgo), const ETH_P_DNA_RT ideal-int +pkg syscall (linux-386-cgo), const ETH_P_DSA ideal-int +pkg syscall (linux-386-cgo), const ETH_P_ECONET ideal-int +pkg syscall (linux-386-cgo), const ETH_P_EDSA ideal-int +pkg syscall (linux-386-cgo), const ETH_P_FCOE ideal-int +pkg syscall (linux-386-cgo), const ETH_P_FIP ideal-int +pkg syscall (linux-386-cgo), const ETH_P_HDLC ideal-int +pkg syscall (linux-386-cgo), const ETH_P_IEEE802154 ideal-int +pkg syscall (linux-386-cgo), const ETH_P_IEEEPUP ideal-int +pkg syscall (linux-386-cgo), const ETH_P_IEEEPUPAT ideal-int +pkg syscall (linux-386-cgo), const ETH_P_IP ideal-int +pkg syscall (linux-386-cgo), const ETH_P_IPV6 ideal-int +pkg syscall (linux-386-cgo), const ETH_P_IPX ideal-int +pkg syscall (linux-386-cgo), const ETH_P_IRDA ideal-int +pkg syscall (linux-386-cgo), const ETH_P_LAT ideal-int +pkg syscall (linux-386-cgo), const ETH_P_LINK_CTL ideal-int +pkg syscall (linux-386-cgo), const ETH_P_LOCALTALK ideal-int +pkg syscall (linux-386-cgo), const ETH_P_LOOP ideal-int +pkg syscall (linux-386-cgo), const ETH_P_MOBITEX ideal-int +pkg syscall (linux-386-cgo), const ETH_P_MPLS_MC ideal-int +pkg syscall (linux-386-cgo), const ETH_P_MPLS_UC ideal-int +pkg syscall (linux-386-cgo), const ETH_P_PAE ideal-int +pkg syscall (linux-386-cgo), const ETH_P_PAUSE ideal-int +pkg syscall (linux-386-cgo), const ETH_P_PHONET ideal-int +pkg syscall (linux-386-cgo), const ETH_P_PPPTALK ideal-int +pkg syscall (linux-386-cgo), const ETH_P_PPP_DISC ideal-int +pkg syscall (linux-386-cgo), const ETH_P_PPP_MP ideal-int +pkg syscall (linux-386-cgo), const ETH_P_PPP_SES ideal-int +pkg syscall (linux-386-cgo), const ETH_P_PUP ideal-int +pkg syscall (linux-386-cgo), const ETH_P_PUPAT ideal-int +pkg syscall (linux-386-cgo), const ETH_P_RARP ideal-int +pkg syscall (linux-386-cgo), const ETH_P_SCA ideal-int +pkg syscall (linux-386-cgo), const ETH_P_SLOW ideal-int +pkg syscall (linux-386-cgo), const ETH_P_SNAP ideal-int +pkg syscall (linux-386-cgo), const ETH_P_TEB ideal-int +pkg syscall (linux-386-cgo), const ETH_P_TIPC ideal-int +pkg syscall (linux-386-cgo), const ETH_P_TRAILER ideal-int +pkg syscall (linux-386-cgo), const ETH_P_TR_802_2 ideal-int +pkg syscall (linux-386-cgo), const ETH_P_WAN_PPP ideal-int +pkg syscall (linux-386-cgo), const ETH_P_WCCP ideal-int +pkg syscall (linux-386-cgo), const ETH_P_X25 ideal-int +pkg syscall (linux-386-cgo), const ETIME Errno +pkg syscall (linux-386-cgo), const EUCLEAN Errno +pkg syscall (linux-386-cgo), const EUNATCH Errno +pkg syscall (linux-386-cgo), const EXFULL Errno +pkg syscall (linux-386-cgo), const FD_CLOEXEC ideal-int +pkg syscall (linux-386-cgo), const FD_SETSIZE ideal-int +pkg syscall (linux-386-cgo), const FLUSHO ideal-int +pkg syscall (linux-386-cgo), const F_DUPFD ideal-int +pkg syscall (linux-386-cgo), const F_DUPFD_CLOEXEC ideal-int +pkg syscall (linux-386-cgo), const F_EXLCK ideal-int +pkg syscall (linux-386-cgo), const F_GETFD ideal-int +pkg syscall (linux-386-cgo), const F_GETFL ideal-int +pkg syscall (linux-386-cgo), const F_GETLEASE ideal-int +pkg syscall (linux-386-cgo), const F_GETLK ideal-int +pkg syscall (linux-386-cgo), const F_GETLK64 ideal-int +pkg syscall (linux-386-cgo), const F_GETOWN ideal-int +pkg syscall (linux-386-cgo), const F_GETOWN_EX ideal-int +pkg syscall (linux-386-cgo), const F_GETPIPE_SZ ideal-int +pkg syscall (linux-386-cgo), const F_GETSIG ideal-int +pkg syscall (linux-386-cgo), const F_LOCK ideal-int +pkg syscall (linux-386-cgo), const F_NOTIFY ideal-int +pkg syscall (linux-386-cgo), const F_OK ideal-int +pkg syscall (linux-386-cgo), const F_RDLCK ideal-int +pkg syscall (linux-386-cgo), const F_SETFD ideal-int +pkg syscall (linux-386-cgo), const F_SETFL ideal-int +pkg syscall (linux-386-cgo), const F_SETLEASE ideal-int +pkg syscall (linux-386-cgo), const F_SETLK ideal-int +pkg syscall (linux-386-cgo), const F_SETLK64 ideal-int +pkg syscall (linux-386-cgo), const F_SETLKW ideal-int +pkg syscall (linux-386-cgo), const F_SETLKW64 ideal-int +pkg syscall (linux-386-cgo), const F_SETOWN ideal-int +pkg syscall (linux-386-cgo), const F_SETOWN_EX ideal-int +pkg syscall (linux-386-cgo), const F_SETPIPE_SZ ideal-int +pkg syscall (linux-386-cgo), const F_SETSIG ideal-int +pkg syscall (linux-386-cgo), const F_SHLCK ideal-int +pkg syscall (linux-386-cgo), const F_TEST ideal-int +pkg syscall (linux-386-cgo), const F_TLOCK ideal-int +pkg syscall (linux-386-cgo), const F_ULOCK ideal-int +pkg syscall (linux-386-cgo), const F_UNLCK ideal-int +pkg syscall (linux-386-cgo), const F_WRLCK ideal-int +pkg syscall (linux-386-cgo), const HUPCL ideal-int +pkg syscall (linux-386-cgo), const ICANON ideal-int +pkg syscall (linux-386-cgo), const ICRNL ideal-int +pkg syscall (linux-386-cgo), const IEXTEN ideal-int +pkg syscall (linux-386-cgo), const IFA_ADDRESS ideal-int +pkg syscall (linux-386-cgo), const IFA_ANYCAST ideal-int +pkg syscall (linux-386-cgo), const IFA_BROADCAST ideal-int +pkg syscall (linux-386-cgo), const IFA_CACHEINFO ideal-int +pkg syscall (linux-386-cgo), const IFA_F_DADFAILED ideal-int +pkg syscall (linux-386-cgo), const IFA_F_DEPRECATED ideal-int +pkg syscall (linux-386-cgo), const IFA_F_HOMEADDRESS ideal-int +pkg syscall (linux-386-cgo), const IFA_F_NODAD ideal-int +pkg syscall (linux-386-cgo), const IFA_F_OPTIMISTIC ideal-int +pkg syscall (linux-386-cgo), const IFA_F_PERMANENT ideal-int +pkg syscall (linux-386-cgo), const IFA_F_SECONDARY ideal-int +pkg syscall (linux-386-cgo), const IFA_F_TEMPORARY ideal-int +pkg syscall (linux-386-cgo), const IFA_F_TENTATIVE ideal-int +pkg syscall (linux-386-cgo), const IFA_LABEL ideal-int +pkg syscall (linux-386-cgo), const IFA_LOCAL ideal-int +pkg syscall (linux-386-cgo), const IFA_MAX ideal-int +pkg syscall (linux-386-cgo), const IFA_MULTICAST ideal-int +pkg syscall (linux-386-cgo), const IFA_UNSPEC ideal-int +pkg syscall (linux-386-cgo), const IFF_ALLMULTI ideal-int +pkg syscall (linux-386-cgo), const IFF_AUTOMEDIA ideal-int +pkg syscall (linux-386-cgo), const IFF_DEBUG ideal-int +pkg syscall (linux-386-cgo), const IFF_DYNAMIC ideal-int +pkg syscall (linux-386-cgo), const IFF_MASTER ideal-int +pkg syscall (linux-386-cgo), const IFF_NOARP ideal-int +pkg syscall (linux-386-cgo), const IFF_NOTRAILERS ideal-int +pkg syscall (linux-386-cgo), const IFF_NO_PI ideal-int +pkg syscall (linux-386-cgo), const IFF_ONE_QUEUE ideal-int +pkg syscall (linux-386-cgo), const IFF_POINTOPOINT ideal-int +pkg syscall (linux-386-cgo), const IFF_PORTSEL ideal-int +pkg syscall (linux-386-cgo), const IFF_PROMISC ideal-int +pkg syscall (linux-386-cgo), const IFF_RUNNING ideal-int +pkg syscall (linux-386-cgo), const IFF_SLAVE ideal-int +pkg syscall (linux-386-cgo), const IFF_TAP ideal-int +pkg syscall (linux-386-cgo), const IFF_TUN ideal-int +pkg syscall (linux-386-cgo), const IFF_TUN_EXCL ideal-int +pkg syscall (linux-386-cgo), const IFF_VNET_HDR ideal-int +pkg syscall (linux-386-cgo), const IFLA_ADDRESS ideal-int +pkg syscall (linux-386-cgo), const IFLA_BROADCAST ideal-int +pkg syscall (linux-386-cgo), const IFLA_COST ideal-int +pkg syscall (linux-386-cgo), const IFLA_IFALIAS ideal-int +pkg syscall (linux-386-cgo), const IFLA_IFNAME ideal-int +pkg syscall (linux-386-cgo), const IFLA_LINK ideal-int +pkg syscall (linux-386-cgo), const IFLA_LINKINFO ideal-int +pkg syscall (linux-386-cgo), const IFLA_LINKMODE ideal-int +pkg syscall (linux-386-cgo), const IFLA_MAP ideal-int +pkg syscall (linux-386-cgo), const IFLA_MASTER ideal-int +pkg syscall (linux-386-cgo), const IFLA_MAX ideal-int +pkg syscall (linux-386-cgo), const IFLA_MTU ideal-int +pkg syscall (linux-386-cgo), const IFLA_NET_NS_PID ideal-int +pkg syscall (linux-386-cgo), const IFLA_OPERSTATE ideal-int +pkg syscall (linux-386-cgo), const IFLA_PRIORITY ideal-int +pkg syscall (linux-386-cgo), const IFLA_PROTINFO ideal-int +pkg syscall (linux-386-cgo), const IFLA_QDISC ideal-int +pkg syscall (linux-386-cgo), const IFLA_STATS ideal-int +pkg syscall (linux-386-cgo), const IFLA_TXQLEN ideal-int +pkg syscall (linux-386-cgo), const IFLA_UNSPEC ideal-int +pkg syscall (linux-386-cgo), const IFLA_WEIGHT ideal-int +pkg syscall (linux-386-cgo), const IFLA_WIRELESS ideal-int +pkg syscall (linux-386-cgo), const IFNAMSIZ ideal-int +pkg syscall (linux-386-cgo), const IGNBRK ideal-int +pkg syscall (linux-386-cgo), const IGNCR ideal-int +pkg syscall (linux-386-cgo), const IGNPAR ideal-int +pkg syscall (linux-386-cgo), const IMAXBEL ideal-int +pkg syscall (linux-386-cgo), const INLCR ideal-int +pkg syscall (linux-386-cgo), const INPCK ideal-int +pkg syscall (linux-386-cgo), const IN_ACCESS ideal-int +pkg syscall (linux-386-cgo), const IN_ALL_EVENTS ideal-int +pkg syscall (linux-386-cgo), const IN_ATTRIB ideal-int +pkg syscall (linux-386-cgo), const IN_CLASSA_HOST ideal-int +pkg syscall (linux-386-cgo), const IN_CLASSA_MAX ideal-int +pkg syscall (linux-386-cgo), const IN_CLASSA_NET ideal-int +pkg syscall (linux-386-cgo), const IN_CLASSA_NSHIFT ideal-int +pkg syscall (linux-386-cgo), const IN_CLASSB_HOST ideal-int +pkg syscall (linux-386-cgo), const IN_CLASSB_MAX ideal-int +pkg syscall (linux-386-cgo), const IN_CLASSB_NET ideal-int +pkg syscall (linux-386-cgo), const IN_CLASSB_NSHIFT ideal-int +pkg syscall (linux-386-cgo), const IN_CLASSC_HOST ideal-int +pkg syscall (linux-386-cgo), const IN_CLASSC_NET ideal-int +pkg syscall (linux-386-cgo), const IN_CLASSC_NSHIFT ideal-int +pkg syscall (linux-386-cgo), const IN_CLOEXEC ideal-int +pkg syscall (linux-386-cgo), const IN_CLOSE ideal-int +pkg syscall (linux-386-cgo), const IN_CLOSE_NOWRITE ideal-int +pkg syscall (linux-386-cgo), const IN_CLOSE_WRITE ideal-int +pkg syscall (linux-386-cgo), const IN_CREATE ideal-int +pkg syscall (linux-386-cgo), const IN_DELETE ideal-int +pkg syscall (linux-386-cgo), const IN_DELETE_SELF ideal-int +pkg syscall (linux-386-cgo), const IN_DONT_FOLLOW ideal-int +pkg syscall (linux-386-cgo), const IN_EXCL_UNLINK ideal-int +pkg syscall (linux-386-cgo), const IN_IGNORED ideal-int +pkg syscall (linux-386-cgo), const IN_ISDIR ideal-int +pkg syscall (linux-386-cgo), const IN_LOOPBACKNET ideal-int +pkg syscall (linux-386-cgo), const IN_MASK_ADD ideal-int +pkg syscall (linux-386-cgo), const IN_MODIFY ideal-int +pkg syscall (linux-386-cgo), const IN_MOVE ideal-int +pkg syscall (linux-386-cgo), const IN_MOVED_FROM ideal-int +pkg syscall (linux-386-cgo), const IN_MOVED_TO ideal-int +pkg syscall (linux-386-cgo), const IN_MOVE_SELF ideal-int +pkg syscall (linux-386-cgo), const IN_NONBLOCK ideal-int +pkg syscall (linux-386-cgo), const IN_ONESHOT ideal-int +pkg syscall (linux-386-cgo), const IN_ONLYDIR ideal-int +pkg syscall (linux-386-cgo), const IN_OPEN ideal-int +pkg syscall (linux-386-cgo), const IN_Q_OVERFLOW ideal-int +pkg syscall (linux-386-cgo), const IN_UNMOUNT ideal-int +pkg syscall (linux-386-cgo), const IPPROTO_AH ideal-int +pkg syscall (linux-386-cgo), const IPPROTO_COMP ideal-int +pkg syscall (linux-386-cgo), const IPPROTO_DCCP ideal-int +pkg syscall (linux-386-cgo), const IPPROTO_DSTOPTS ideal-int +pkg syscall (linux-386-cgo), const IPPROTO_EGP ideal-int +pkg syscall (linux-386-cgo), const IPPROTO_ENCAP ideal-int +pkg syscall (linux-386-cgo), const IPPROTO_ESP ideal-int +pkg syscall (linux-386-cgo), const IPPROTO_FRAGMENT ideal-int +pkg syscall (linux-386-cgo), const IPPROTO_GRE ideal-int +pkg syscall (linux-386-cgo), const IPPROTO_HOPOPTS ideal-int +pkg syscall (linux-386-cgo), const IPPROTO_ICMP ideal-int +pkg syscall (linux-386-cgo), const IPPROTO_ICMPV6 ideal-int +pkg syscall (linux-386-cgo), const IPPROTO_IDP ideal-int +pkg syscall (linux-386-cgo), const IPPROTO_IGMP ideal-int +pkg syscall (linux-386-cgo), const IPPROTO_IPIP ideal-int +pkg syscall (linux-386-cgo), const IPPROTO_MTP ideal-int +pkg syscall (linux-386-cgo), const IPPROTO_NONE ideal-int +pkg syscall (linux-386-cgo), const IPPROTO_PIM ideal-int +pkg syscall (linux-386-cgo), const IPPROTO_PUP ideal-int +pkg syscall (linux-386-cgo), const IPPROTO_RAW ideal-int +pkg syscall (linux-386-cgo), const IPPROTO_ROUTING ideal-int +pkg syscall (linux-386-cgo), const IPPROTO_RSVP ideal-int +pkg syscall (linux-386-cgo), const IPPROTO_SCTP ideal-int +pkg syscall (linux-386-cgo), const IPPROTO_TP ideal-int +pkg syscall (linux-386-cgo), const IPPROTO_UDPLITE ideal-int +pkg syscall (linux-386-cgo), const IPV6_2292DSTOPTS ideal-int +pkg syscall (linux-386-cgo), const IPV6_2292HOPLIMIT ideal-int +pkg syscall (linux-386-cgo), const IPV6_2292HOPOPTS ideal-int +pkg syscall (linux-386-cgo), const IPV6_2292PKTINFO ideal-int +pkg syscall (linux-386-cgo), const IPV6_2292PKTOPTIONS ideal-int +pkg syscall (linux-386-cgo), const IPV6_2292RTHDR ideal-int +pkg syscall (linux-386-cgo), const IPV6_ADDRFORM ideal-int +pkg syscall (linux-386-cgo), const IPV6_ADD_MEMBERSHIP ideal-int +pkg syscall (linux-386-cgo), const IPV6_AUTHHDR ideal-int +pkg syscall (linux-386-cgo), const IPV6_CHECKSUM ideal-int +pkg syscall (linux-386-cgo), const IPV6_DROP_MEMBERSHIP ideal-int +pkg syscall (linux-386-cgo), const IPV6_DSTOPTS ideal-int +pkg syscall (linux-386-cgo), const IPV6_HOPLIMIT ideal-int +pkg syscall (linux-386-cgo), const IPV6_HOPOPTS ideal-int +pkg syscall (linux-386-cgo), const IPV6_IPSEC_POLICY ideal-int +pkg syscall (linux-386-cgo), const IPV6_JOIN_ANYCAST ideal-int +pkg syscall (linux-386-cgo), const IPV6_LEAVE_ANYCAST ideal-int +pkg syscall (linux-386-cgo), const IPV6_MTU ideal-int +pkg syscall (linux-386-cgo), const IPV6_MTU_DISCOVER ideal-int +pkg syscall (linux-386-cgo), const IPV6_NEXTHOP ideal-int +pkg syscall (linux-386-cgo), const IPV6_PKTINFO ideal-int +pkg syscall (linux-386-cgo), const IPV6_PMTUDISC_DO ideal-int +pkg syscall (linux-386-cgo), const IPV6_PMTUDISC_DONT ideal-int +pkg syscall (linux-386-cgo), const IPV6_PMTUDISC_PROBE ideal-int +pkg syscall (linux-386-cgo), const IPV6_PMTUDISC_WANT ideal-int +pkg syscall (linux-386-cgo), const IPV6_RECVDSTOPTS ideal-int +pkg syscall (linux-386-cgo), const IPV6_RECVERR ideal-int +pkg syscall (linux-386-cgo), const IPV6_RECVHOPLIMIT ideal-int +pkg syscall (linux-386-cgo), const IPV6_RECVHOPOPTS ideal-int +pkg syscall (linux-386-cgo), const IPV6_RECVPKTINFO ideal-int +pkg syscall (linux-386-cgo), const IPV6_RECVRTHDR ideal-int +pkg syscall (linux-386-cgo), const IPV6_RECVTCLASS ideal-int +pkg syscall (linux-386-cgo), const IPV6_ROUTER_ALERT ideal-int +pkg syscall (linux-386-cgo), const IPV6_RTHDR ideal-int +pkg syscall (linux-386-cgo), const IPV6_RTHDRDSTOPTS ideal-int +pkg syscall (linux-386-cgo), const IPV6_RTHDR_LOOSE ideal-int +pkg syscall (linux-386-cgo), const IPV6_RTHDR_STRICT ideal-int +pkg syscall (linux-386-cgo), const IPV6_RTHDR_TYPE_0 ideal-int +pkg syscall (linux-386-cgo), const IPV6_RXDSTOPTS ideal-int +pkg syscall (linux-386-cgo), const IPV6_RXHOPOPTS ideal-int +pkg syscall (linux-386-cgo), const IPV6_TCLASS ideal-int +pkg syscall (linux-386-cgo), const IPV6_XFRM_POLICY ideal-int +pkg syscall (linux-386-cgo), const IP_ADD_SOURCE_MEMBERSHIP ideal-int +pkg syscall (linux-386-cgo), const IP_BLOCK_SOURCE ideal-int +pkg syscall (linux-386-cgo), const IP_DEFAULT_MULTICAST_LOOP ideal-int +pkg syscall (linux-386-cgo), const IP_DEFAULT_MULTICAST_TTL ideal-int +pkg syscall (linux-386-cgo), const IP_DF ideal-int +pkg syscall (linux-386-cgo), const IP_DROP_SOURCE_MEMBERSHIP ideal-int +pkg syscall (linux-386-cgo), const IP_FREEBIND ideal-int +pkg syscall (linux-386-cgo), const IP_HDRINCL ideal-int +pkg syscall (linux-386-cgo), const IP_IPSEC_POLICY ideal-int +pkg syscall (linux-386-cgo), const IP_MAXPACKET ideal-int +pkg syscall (linux-386-cgo), const IP_MAX_MEMBERSHIPS ideal-int +pkg syscall (linux-386-cgo), const IP_MF ideal-int +pkg syscall (linux-386-cgo), const IP_MINTTL ideal-int +pkg syscall (linux-386-cgo), const IP_MSFILTER ideal-int +pkg syscall (linux-386-cgo), const IP_MSS ideal-int +pkg syscall (linux-386-cgo), const IP_MTU ideal-int +pkg syscall (linux-386-cgo), const IP_MTU_DISCOVER ideal-int +pkg syscall (linux-386-cgo), const IP_OFFMASK ideal-int +pkg syscall (linux-386-cgo), const IP_OPTIONS ideal-int +pkg syscall (linux-386-cgo), const IP_ORIGDSTADDR ideal-int +pkg syscall (linux-386-cgo), const IP_PASSSEC ideal-int +pkg syscall (linux-386-cgo), const IP_PKTINFO ideal-int +pkg syscall (linux-386-cgo), const IP_PKTOPTIONS ideal-int +pkg syscall (linux-386-cgo), const IP_PMTUDISC ideal-int +pkg syscall (linux-386-cgo), const IP_PMTUDISC_DO ideal-int +pkg syscall (linux-386-cgo), const IP_PMTUDISC_DONT ideal-int +pkg syscall (linux-386-cgo), const IP_PMTUDISC_PROBE ideal-int +pkg syscall (linux-386-cgo), const IP_PMTUDISC_WANT ideal-int +pkg syscall (linux-386-cgo), const IP_RECVERR ideal-int +pkg syscall (linux-386-cgo), const IP_RECVOPTS ideal-int +pkg syscall (linux-386-cgo), const IP_RECVORIGDSTADDR ideal-int +pkg syscall (linux-386-cgo), const IP_RECVRETOPTS ideal-int +pkg syscall (linux-386-cgo), const IP_RECVTOS ideal-int +pkg syscall (linux-386-cgo), const IP_RECVTTL ideal-int +pkg syscall (linux-386-cgo), const IP_RETOPTS ideal-int +pkg syscall (linux-386-cgo), const IP_RF ideal-int +pkg syscall (linux-386-cgo), const IP_ROUTER_ALERT ideal-int +pkg syscall (linux-386-cgo), const IP_TRANSPARENT ideal-int +pkg syscall (linux-386-cgo), const IP_UNBLOCK_SOURCE ideal-int +pkg syscall (linux-386-cgo), const IP_XFRM_POLICY ideal-int +pkg syscall (linux-386-cgo), const ISIG ideal-int +pkg syscall (linux-386-cgo), const ISTRIP ideal-int +pkg syscall (linux-386-cgo), const IUCLC ideal-int +pkg syscall (linux-386-cgo), const IUTF8 ideal-int +pkg syscall (linux-386-cgo), const IXANY ideal-int +pkg syscall (linux-386-cgo), const IXOFF ideal-int +pkg syscall (linux-386-cgo), const IXON ideal-int +pkg syscall (linux-386-cgo), const LINUX_REBOOT_CMD_CAD_OFF ideal-int +pkg syscall (linux-386-cgo), const LINUX_REBOOT_CMD_CAD_ON ideal-int +pkg syscall (linux-386-cgo), const LINUX_REBOOT_CMD_HALT ideal-int +pkg syscall (linux-386-cgo), const LINUX_REBOOT_CMD_KEXEC ideal-int +pkg syscall (linux-386-cgo), const LINUX_REBOOT_CMD_POWER_OFF ideal-int +pkg syscall (linux-386-cgo), const LINUX_REBOOT_CMD_RESTART ideal-int +pkg syscall (linux-386-cgo), const LINUX_REBOOT_CMD_RESTART2 ideal-int +pkg syscall (linux-386-cgo), const LINUX_REBOOT_CMD_SW_SUSPEND ideal-int +pkg syscall (linux-386-cgo), const LINUX_REBOOT_MAGIC1 ideal-int +pkg syscall (linux-386-cgo), const LINUX_REBOOT_MAGIC2 ideal-int +pkg syscall (linux-386-cgo), const LOCK_EX ideal-int +pkg syscall (linux-386-cgo), const LOCK_NB ideal-int +pkg syscall (linux-386-cgo), const LOCK_SH ideal-int +pkg syscall (linux-386-cgo), const LOCK_UN ideal-int +pkg syscall (linux-386-cgo), const MADV_DOFORK ideal-int +pkg syscall (linux-386-cgo), const MADV_DONTFORK ideal-int +pkg syscall (linux-386-cgo), const MADV_DONTNEED ideal-int +pkg syscall (linux-386-cgo), const MADV_HUGEPAGE ideal-int +pkg syscall (linux-386-cgo), const MADV_HWPOISON ideal-int +pkg syscall (linux-386-cgo), const MADV_MERGEABLE ideal-int +pkg syscall (linux-386-cgo), const MADV_NOHUGEPAGE ideal-int +pkg syscall (linux-386-cgo), const MADV_NORMAL ideal-int +pkg syscall (linux-386-cgo), const MADV_RANDOM ideal-int +pkg syscall (linux-386-cgo), const MADV_REMOVE ideal-int +pkg syscall (linux-386-cgo), const MADV_SEQUENTIAL ideal-int +pkg syscall (linux-386-cgo), const MADV_UNMERGEABLE ideal-int +pkg syscall (linux-386-cgo), const MADV_WILLNEED ideal-int +pkg syscall (linux-386-cgo), const MAP_32BIT ideal-int +pkg syscall (linux-386-cgo), const MAP_ANON ideal-int +pkg syscall (linux-386-cgo), const MAP_ANONYMOUS ideal-int +pkg syscall (linux-386-cgo), const MAP_DENYWRITE ideal-int +pkg syscall (linux-386-cgo), const MAP_EXECUTABLE ideal-int +pkg syscall (linux-386-cgo), const MAP_FILE ideal-int +pkg syscall (linux-386-cgo), const MAP_FIXED ideal-int +pkg syscall (linux-386-cgo), const MAP_GROWSDOWN ideal-int +pkg syscall (linux-386-cgo), const MAP_HUGETLB ideal-int +pkg syscall (linux-386-cgo), const MAP_LOCKED ideal-int +pkg syscall (linux-386-cgo), const MAP_NONBLOCK ideal-int +pkg syscall (linux-386-cgo), const MAP_NORESERVE ideal-int +pkg syscall (linux-386-cgo), const MAP_POPULATE ideal-int +pkg syscall (linux-386-cgo), const MAP_PRIVATE ideal-int +pkg syscall (linux-386-cgo), const MAP_SHARED ideal-int +pkg syscall (linux-386-cgo), const MAP_STACK ideal-int +pkg syscall (linux-386-cgo), const MAP_TYPE ideal-int +pkg syscall (linux-386-cgo), const MCL_CURRENT ideal-int +pkg syscall (linux-386-cgo), const MCL_FUTURE ideal-int +pkg syscall (linux-386-cgo), const MNT_DETACH ideal-int +pkg syscall (linux-386-cgo), const MNT_EXPIRE ideal-int +pkg syscall (linux-386-cgo), const MNT_FORCE ideal-int +pkg syscall (linux-386-cgo), const MSG_CMSG_CLOEXEC ideal-int +pkg syscall (linux-386-cgo), const MSG_CONFIRM ideal-int +pkg syscall (linux-386-cgo), const MSG_CTRUNC ideal-int +pkg syscall (linux-386-cgo), const MSG_DONTROUTE ideal-int +pkg syscall (linux-386-cgo), const MSG_DONTWAIT ideal-int +pkg syscall (linux-386-cgo), const MSG_EOR ideal-int +pkg syscall (linux-386-cgo), const MSG_ERRQUEUE ideal-int +pkg syscall (linux-386-cgo), const MSG_FIN ideal-int +pkg syscall (linux-386-cgo), const MSG_MORE ideal-int +pkg syscall (linux-386-cgo), const MSG_NOSIGNAL ideal-int +pkg syscall (linux-386-cgo), const MSG_OOB ideal-int +pkg syscall (linux-386-cgo), const MSG_PEEK ideal-int +pkg syscall (linux-386-cgo), const MSG_PROXY ideal-int +pkg syscall (linux-386-cgo), const MSG_RST ideal-int +pkg syscall (linux-386-cgo), const MSG_SYN ideal-int +pkg syscall (linux-386-cgo), const MSG_TRUNC ideal-int +pkg syscall (linux-386-cgo), const MSG_TRYHARD ideal-int +pkg syscall (linux-386-cgo), const MSG_WAITALL ideal-int +pkg syscall (linux-386-cgo), const MSG_WAITFORONE ideal-int +pkg syscall (linux-386-cgo), const MS_ACTIVE ideal-int +pkg syscall (linux-386-cgo), const MS_ASYNC ideal-int +pkg syscall (linux-386-cgo), const MS_BIND ideal-int +pkg syscall (linux-386-cgo), const MS_DIRSYNC ideal-int +pkg syscall (linux-386-cgo), const MS_INVALIDATE ideal-int +pkg syscall (linux-386-cgo), const MS_I_VERSION ideal-int +pkg syscall (linux-386-cgo), const MS_KERNMOUNT ideal-int +pkg syscall (linux-386-cgo), const MS_MANDLOCK ideal-int +pkg syscall (linux-386-cgo), const MS_MGC_MSK ideal-int +pkg syscall (linux-386-cgo), const MS_MGC_VAL ideal-int +pkg syscall (linux-386-cgo), const MS_MOVE ideal-int +pkg syscall (linux-386-cgo), const MS_NOATIME ideal-int +pkg syscall (linux-386-cgo), const MS_NODEV ideal-int +pkg syscall (linux-386-cgo), const MS_NODIRATIME ideal-int +pkg syscall (linux-386-cgo), const MS_NOEXEC ideal-int +pkg syscall (linux-386-cgo), const MS_NOSUID ideal-int +pkg syscall (linux-386-cgo), const MS_NOUSER ideal-int +pkg syscall (linux-386-cgo), const MS_POSIXACL ideal-int +pkg syscall (linux-386-cgo), const MS_PRIVATE ideal-int +pkg syscall (linux-386-cgo), const MS_RDONLY ideal-int +pkg syscall (linux-386-cgo), const MS_REC ideal-int +pkg syscall (linux-386-cgo), const MS_RELATIME ideal-int +pkg syscall (linux-386-cgo), const MS_REMOUNT ideal-int +pkg syscall (linux-386-cgo), const MS_RMT_MASK ideal-int +pkg syscall (linux-386-cgo), const MS_SHARED ideal-int +pkg syscall (linux-386-cgo), const MS_SILENT ideal-int +pkg syscall (linux-386-cgo), const MS_SLAVE ideal-int +pkg syscall (linux-386-cgo), const MS_STRICTATIME ideal-int +pkg syscall (linux-386-cgo), const MS_SYNC ideal-int +pkg syscall (linux-386-cgo), const MS_SYNCHRONOUS ideal-int +pkg syscall (linux-386-cgo), const MS_UNBINDABLE ideal-int +pkg syscall (linux-386-cgo), const NAME_MAX ideal-int +pkg syscall (linux-386-cgo), const NETLINK_ADD_MEMBERSHIP ideal-int +pkg syscall (linux-386-cgo), const NETLINK_AUDIT ideal-int +pkg syscall (linux-386-cgo), const NETLINK_BROADCAST_ERROR ideal-int +pkg syscall (linux-386-cgo), const NETLINK_CONNECTOR ideal-int +pkg syscall (linux-386-cgo), const NETLINK_DNRTMSG ideal-int +pkg syscall (linux-386-cgo), const NETLINK_DROP_MEMBERSHIP ideal-int +pkg syscall (linux-386-cgo), const NETLINK_ECRYPTFS ideal-int +pkg syscall (linux-386-cgo), const NETLINK_FIB_LOOKUP ideal-int +pkg syscall (linux-386-cgo), const NETLINK_FIREWALL ideal-int +pkg syscall (linux-386-cgo), const NETLINK_GENERIC ideal-int +pkg syscall (linux-386-cgo), const NETLINK_INET_DIAG ideal-int +pkg syscall (linux-386-cgo), const NETLINK_IP6_FW ideal-int +pkg syscall (linux-386-cgo), const NETLINK_ISCSI ideal-int +pkg syscall (linux-386-cgo), const NETLINK_KOBJECT_UEVENT ideal-int +pkg syscall (linux-386-cgo), const NETLINK_NETFILTER ideal-int +pkg syscall (linux-386-cgo), const NETLINK_NFLOG ideal-int +pkg syscall (linux-386-cgo), const NETLINK_NO_ENOBUFS ideal-int +pkg syscall (linux-386-cgo), const NETLINK_PKTINFO ideal-int +pkg syscall (linux-386-cgo), const NETLINK_ROUTE ideal-int +pkg syscall (linux-386-cgo), const NETLINK_SCSITRANSPORT ideal-int +pkg syscall (linux-386-cgo), const NETLINK_SELINUX ideal-int +pkg syscall (linux-386-cgo), const NETLINK_UNUSED ideal-int +pkg syscall (linux-386-cgo), const NETLINK_USERSOCK ideal-int +pkg syscall (linux-386-cgo), const NETLINK_XFRM ideal-int +pkg syscall (linux-386-cgo), const NLA_ALIGNTO ideal-int +pkg syscall (linux-386-cgo), const NLA_F_NESTED ideal-int +pkg syscall (linux-386-cgo), const NLA_F_NET_BYTEORDER ideal-int +pkg syscall (linux-386-cgo), const NLA_HDRLEN ideal-int +pkg syscall (linux-386-cgo), const NLMSG_ALIGNTO ideal-int +pkg syscall (linux-386-cgo), const NLMSG_DONE ideal-int +pkg syscall (linux-386-cgo), const NLMSG_ERROR ideal-int +pkg syscall (linux-386-cgo), const NLMSG_HDRLEN ideal-int +pkg syscall (linux-386-cgo), const NLMSG_MIN_TYPE ideal-int +pkg syscall (linux-386-cgo), const NLMSG_NOOP ideal-int +pkg syscall (linux-386-cgo), const NLMSG_OVERRUN ideal-int +pkg syscall (linux-386-cgo), const NLM_F_ACK ideal-int +pkg syscall (linux-386-cgo), const NLM_F_APPEND ideal-int +pkg syscall (linux-386-cgo), const NLM_F_ATOMIC ideal-int +pkg syscall (linux-386-cgo), const NLM_F_CREATE ideal-int +pkg syscall (linux-386-cgo), const NLM_F_DUMP ideal-int +pkg syscall (linux-386-cgo), const NLM_F_ECHO ideal-int +pkg syscall (linux-386-cgo), const NLM_F_EXCL ideal-int +pkg syscall (linux-386-cgo), const NLM_F_MATCH ideal-int +pkg syscall (linux-386-cgo), const NLM_F_MULTI ideal-int +pkg syscall (linux-386-cgo), const NLM_F_REPLACE ideal-int +pkg syscall (linux-386-cgo), const NLM_F_REQUEST ideal-int +pkg syscall (linux-386-cgo), const NLM_F_ROOT ideal-int +pkg syscall (linux-386-cgo), const NOFLSH ideal-int +pkg syscall (linux-386-cgo), const OCRNL ideal-int +pkg syscall (linux-386-cgo), const OFDEL ideal-int +pkg syscall (linux-386-cgo), const OFILL ideal-int +pkg syscall (linux-386-cgo), const OLCUC ideal-int +pkg syscall (linux-386-cgo), const ONLCR ideal-int +pkg syscall (linux-386-cgo), const ONLRET ideal-int +pkg syscall (linux-386-cgo), const ONOCR ideal-int +pkg syscall (linux-386-cgo), const OPOST ideal-int +pkg syscall (linux-386-cgo), const O_ACCMODE ideal-int +pkg syscall (linux-386-cgo), const O_DIRECT ideal-int +pkg syscall (linux-386-cgo), const O_DIRECTORY ideal-int +pkg syscall (linux-386-cgo), const O_DSYNC ideal-int +pkg syscall (linux-386-cgo), const O_FSYNC ideal-int +pkg syscall (linux-386-cgo), const O_LARGEFILE ideal-int +pkg syscall (linux-386-cgo), const O_NDELAY ideal-int +pkg syscall (linux-386-cgo), const O_NOATIME ideal-int +pkg syscall (linux-386-cgo), const O_NOFOLLOW ideal-int +pkg syscall (linux-386-cgo), const O_RSYNC ideal-int +pkg syscall (linux-386-cgo), const PACKET_ADD_MEMBERSHIP ideal-int +pkg syscall (linux-386-cgo), const PACKET_BROADCAST ideal-int +pkg syscall (linux-386-cgo), const PACKET_DROP_MEMBERSHIP ideal-int +pkg syscall (linux-386-cgo), const PACKET_FASTROUTE ideal-int +pkg syscall (linux-386-cgo), const PACKET_HOST ideal-int +pkg syscall (linux-386-cgo), const PACKET_LOOPBACK ideal-int +pkg syscall (linux-386-cgo), const PACKET_MR_ALLMULTI ideal-int +pkg syscall (linux-386-cgo), const PACKET_MR_MULTICAST ideal-int +pkg syscall (linux-386-cgo), const PACKET_MR_PROMISC ideal-int +pkg syscall (linux-386-cgo), const PACKET_MULTICAST ideal-int +pkg syscall (linux-386-cgo), const PACKET_OTHERHOST ideal-int +pkg syscall (linux-386-cgo), const PACKET_OUTGOING ideal-int +pkg syscall (linux-386-cgo), const PACKET_RECV_OUTPUT ideal-int +pkg syscall (linux-386-cgo), const PACKET_RX_RING ideal-int +pkg syscall (linux-386-cgo), const PACKET_STATISTICS ideal-int +pkg syscall (linux-386-cgo), const PARENB ideal-int +pkg syscall (linux-386-cgo), const PARMRK ideal-int +pkg syscall (linux-386-cgo), const PARODD ideal-int +pkg syscall (linux-386-cgo), const PENDIN ideal-int +pkg syscall (linux-386-cgo), const PROT_EXEC ideal-int +pkg syscall (linux-386-cgo), const PROT_GROWSDOWN ideal-int +pkg syscall (linux-386-cgo), const PROT_GROWSUP ideal-int +pkg syscall (linux-386-cgo), const PROT_NONE ideal-int +pkg syscall (linux-386-cgo), const PROT_READ ideal-int +pkg syscall (linux-386-cgo), const PROT_WRITE ideal-int +pkg syscall (linux-386-cgo), const PR_CAPBSET_DROP ideal-int +pkg syscall (linux-386-cgo), const PR_CAPBSET_READ ideal-int +pkg syscall (linux-386-cgo), const PR_ENDIAN_BIG ideal-int +pkg syscall (linux-386-cgo), const PR_ENDIAN_LITTLE ideal-int +pkg syscall (linux-386-cgo), const PR_ENDIAN_PPC_LITTLE ideal-int +pkg syscall (linux-386-cgo), const PR_FPEMU_NOPRINT ideal-int +pkg syscall (linux-386-cgo), const PR_FPEMU_SIGFPE ideal-int +pkg syscall (linux-386-cgo), const PR_FP_EXC_ASYNC ideal-int +pkg syscall (linux-386-cgo), const PR_FP_EXC_DISABLED ideal-int +pkg syscall (linux-386-cgo), const PR_FP_EXC_DIV ideal-int +pkg syscall (linux-386-cgo), const PR_FP_EXC_INV ideal-int +pkg syscall (linux-386-cgo), const PR_FP_EXC_NONRECOV ideal-int +pkg syscall (linux-386-cgo), const PR_FP_EXC_OVF ideal-int +pkg syscall (linux-386-cgo), const PR_FP_EXC_PRECISE ideal-int +pkg syscall (linux-386-cgo), const PR_FP_EXC_RES ideal-int +pkg syscall (linux-386-cgo), const PR_FP_EXC_SW_ENABLE ideal-int +pkg syscall (linux-386-cgo), const PR_FP_EXC_UND ideal-int +pkg syscall (linux-386-cgo), const PR_GET_DUMPABLE ideal-int +pkg syscall (linux-386-cgo), const PR_GET_ENDIAN ideal-int +pkg syscall (linux-386-cgo), const PR_GET_FPEMU ideal-int +pkg syscall (linux-386-cgo), const PR_GET_FPEXC ideal-int +pkg syscall (linux-386-cgo), const PR_GET_KEEPCAPS ideal-int +pkg syscall (linux-386-cgo), const PR_GET_NAME ideal-int +pkg syscall (linux-386-cgo), const PR_GET_PDEATHSIG ideal-int +pkg syscall (linux-386-cgo), const PR_GET_SECCOMP ideal-int +pkg syscall (linux-386-cgo), const PR_GET_SECUREBITS ideal-int +pkg syscall (linux-386-cgo), const PR_GET_TIMERSLACK ideal-int +pkg syscall (linux-386-cgo), const PR_GET_TIMING ideal-int +pkg syscall (linux-386-cgo), const PR_GET_TSC ideal-int +pkg syscall (linux-386-cgo), const PR_GET_UNALIGN ideal-int +pkg syscall (linux-386-cgo), const PR_MCE_KILL ideal-int +pkg syscall (linux-386-cgo), const PR_MCE_KILL_CLEAR ideal-int +pkg syscall (linux-386-cgo), const PR_MCE_KILL_DEFAULT ideal-int +pkg syscall (linux-386-cgo), const PR_MCE_KILL_EARLY ideal-int +pkg syscall (linux-386-cgo), const PR_MCE_KILL_GET ideal-int +pkg syscall (linux-386-cgo), const PR_MCE_KILL_LATE ideal-int +pkg syscall (linux-386-cgo), const PR_MCE_KILL_SET ideal-int +pkg syscall (linux-386-cgo), const PR_SET_DUMPABLE ideal-int +pkg syscall (linux-386-cgo), const PR_SET_ENDIAN ideal-int +pkg syscall (linux-386-cgo), const PR_SET_FPEMU ideal-int +pkg syscall (linux-386-cgo), const PR_SET_FPEXC ideal-int +pkg syscall (linux-386-cgo), const PR_SET_KEEPCAPS ideal-int +pkg syscall (linux-386-cgo), const PR_SET_NAME ideal-int +pkg syscall (linux-386-cgo), const PR_SET_PDEATHSIG ideal-int +pkg syscall (linux-386-cgo), const PR_SET_PTRACER ideal-int +pkg syscall (linux-386-cgo), const PR_SET_SECCOMP ideal-int +pkg syscall (linux-386-cgo), const PR_SET_SECUREBITS ideal-int +pkg syscall (linux-386-cgo), const PR_SET_TIMERSLACK ideal-int +pkg syscall (linux-386-cgo), const PR_SET_TIMING ideal-int +pkg syscall (linux-386-cgo), const PR_SET_TSC ideal-int +pkg syscall (linux-386-cgo), const PR_SET_UNALIGN ideal-int +pkg syscall (linux-386-cgo), const PR_TASK_PERF_EVENTS_DISABLE ideal-int +pkg syscall (linux-386-cgo), const PR_TASK_PERF_EVENTS_ENABLE ideal-int +pkg syscall (linux-386-cgo), const PR_TIMING_STATISTICAL ideal-int +pkg syscall (linux-386-cgo), const PR_TIMING_TIMESTAMP ideal-int +pkg syscall (linux-386-cgo), const PR_TSC_ENABLE ideal-int +pkg syscall (linux-386-cgo), const PR_TSC_SIGSEGV ideal-int +pkg syscall (linux-386-cgo), const PR_UNALIGN_NOPRINT ideal-int +pkg syscall (linux-386-cgo), const PR_UNALIGN_SIGBUS ideal-int +pkg syscall (linux-386-cgo), const PTRACE_ATTACH ideal-int +pkg syscall (linux-386-cgo), const PTRACE_CONT ideal-int +pkg syscall (linux-386-cgo), const PTRACE_DETACH ideal-int +pkg syscall (linux-386-cgo), const PTRACE_EVENT_CLONE ideal-int +pkg syscall (linux-386-cgo), const PTRACE_EVENT_EXEC ideal-int +pkg syscall (linux-386-cgo), const PTRACE_EVENT_EXIT ideal-int +pkg syscall (linux-386-cgo), const PTRACE_EVENT_FORK ideal-int +pkg syscall (linux-386-cgo), const PTRACE_EVENT_VFORK ideal-int +pkg syscall (linux-386-cgo), const PTRACE_EVENT_VFORK_DONE ideal-int +pkg syscall (linux-386-cgo), const PTRACE_GETEVENTMSG ideal-int +pkg syscall (linux-386-cgo), const PTRACE_GETFPREGS ideal-int +pkg syscall (linux-386-cgo), const PTRACE_GETFPXREGS ideal-int +pkg syscall (linux-386-cgo), const PTRACE_GETREGS ideal-int +pkg syscall (linux-386-cgo), const PTRACE_GETREGSET ideal-int +pkg syscall (linux-386-cgo), const PTRACE_GETSIGINFO ideal-int +pkg syscall (linux-386-cgo), const PTRACE_GET_THREAD_AREA ideal-int +pkg syscall (linux-386-cgo), const PTRACE_KILL ideal-int +pkg syscall (linux-386-cgo), const PTRACE_OLDSETOPTIONS ideal-int +pkg syscall (linux-386-cgo), const PTRACE_O_MASK ideal-int +pkg syscall (linux-386-cgo), const PTRACE_O_TRACECLONE ideal-int +pkg syscall (linux-386-cgo), const PTRACE_O_TRACEEXEC ideal-int +pkg syscall (linux-386-cgo), const PTRACE_O_TRACEEXIT ideal-int +pkg syscall (linux-386-cgo), const PTRACE_O_TRACEFORK ideal-int +pkg syscall (linux-386-cgo), const PTRACE_O_TRACESYSGOOD ideal-int +pkg syscall (linux-386-cgo), const PTRACE_O_TRACEVFORK ideal-int +pkg syscall (linux-386-cgo), const PTRACE_O_TRACEVFORKDONE ideal-int +pkg syscall (linux-386-cgo), const PTRACE_PEEKDATA ideal-int +pkg syscall (linux-386-cgo), const PTRACE_PEEKTEXT ideal-int +pkg syscall (linux-386-cgo), const PTRACE_PEEKUSR ideal-int +pkg syscall (linux-386-cgo), const PTRACE_POKEDATA ideal-int +pkg syscall (linux-386-cgo), const PTRACE_POKETEXT ideal-int +pkg syscall (linux-386-cgo), const PTRACE_POKEUSR ideal-int +pkg syscall (linux-386-cgo), const PTRACE_SETFPREGS ideal-int +pkg syscall (linux-386-cgo), const PTRACE_SETFPXREGS ideal-int +pkg syscall (linux-386-cgo), const PTRACE_SETOPTIONS ideal-int +pkg syscall (linux-386-cgo), const PTRACE_SETREGS ideal-int +pkg syscall (linux-386-cgo), const PTRACE_SETREGSET ideal-int +pkg syscall (linux-386-cgo), const PTRACE_SETSIGINFO ideal-int +pkg syscall (linux-386-cgo), const PTRACE_SET_THREAD_AREA ideal-int +pkg syscall (linux-386-cgo), const PTRACE_SINGLEBLOCK ideal-int +pkg syscall (linux-386-cgo), const PTRACE_SINGLESTEP ideal-int +pkg syscall (linux-386-cgo), const PTRACE_SYSCALL ideal-int +pkg syscall (linux-386-cgo), const PTRACE_SYSEMU ideal-int +pkg syscall (linux-386-cgo), const PTRACE_SYSEMU_SINGLESTEP ideal-int +pkg syscall (linux-386-cgo), const PTRACE_TRACEME ideal-int +pkg syscall (linux-386-cgo), const PathMax ideal-int +pkg syscall (linux-386-cgo), const RLIMIT_AS ideal-int +pkg syscall (linux-386-cgo), const RLIMIT_CORE ideal-int +pkg syscall (linux-386-cgo), const RLIMIT_CPU ideal-int +pkg syscall (linux-386-cgo), const RLIMIT_DATA ideal-int +pkg syscall (linux-386-cgo), const RLIMIT_FSIZE ideal-int +pkg syscall (linux-386-cgo), const RLIMIT_NOFILE ideal-int +pkg syscall (linux-386-cgo), const RLIMIT_STACK ideal-int +pkg syscall (linux-386-cgo), const RLIM_INFINITY ideal-int +pkg syscall (linux-386-cgo), const RTAX_ADVMSS ideal-int +pkg syscall (linux-386-cgo), const RTAX_CWND ideal-int +pkg syscall (linux-386-cgo), const RTAX_FEATURES ideal-int +pkg syscall (linux-386-cgo), const RTAX_FEATURE_ALLFRAG ideal-int +pkg syscall (linux-386-cgo), const RTAX_FEATURE_ECN ideal-int +pkg syscall (linux-386-cgo), const RTAX_FEATURE_SACK ideal-int +pkg syscall (linux-386-cgo), const RTAX_FEATURE_TIMESTAMP ideal-int +pkg syscall (linux-386-cgo), const RTAX_HOPLIMIT ideal-int +pkg syscall (linux-386-cgo), const RTAX_INITCWND ideal-int +pkg syscall (linux-386-cgo), const RTAX_INITRWND ideal-int +pkg syscall (linux-386-cgo), const RTAX_LOCK ideal-int +pkg syscall (linux-386-cgo), const RTAX_MAX ideal-int +pkg syscall (linux-386-cgo), const RTAX_MTU ideal-int +pkg syscall (linux-386-cgo), const RTAX_REORDERING ideal-int +pkg syscall (linux-386-cgo), const RTAX_RTO_MIN ideal-int +pkg syscall (linux-386-cgo), const RTAX_RTT ideal-int +pkg syscall (linux-386-cgo), const RTAX_RTTVAR ideal-int +pkg syscall (linux-386-cgo), const RTAX_SSTHRESH ideal-int +pkg syscall (linux-386-cgo), const RTAX_UNSPEC ideal-int +pkg syscall (linux-386-cgo), const RTAX_WINDOW ideal-int +pkg syscall (linux-386-cgo), const RTA_ALIGNTO ideal-int +pkg syscall (linux-386-cgo), const RTA_CACHEINFO ideal-int +pkg syscall (linux-386-cgo), const RTA_DST ideal-int +pkg syscall (linux-386-cgo), const RTA_FLOW ideal-int +pkg syscall (linux-386-cgo), const RTA_GATEWAY ideal-int +pkg syscall (linux-386-cgo), const RTA_IIF ideal-int +pkg syscall (linux-386-cgo), const RTA_MAX ideal-int +pkg syscall (linux-386-cgo), const RTA_METRICS ideal-int +pkg syscall (linux-386-cgo), const RTA_MULTIPATH ideal-int +pkg syscall (linux-386-cgo), const RTA_OIF ideal-int +pkg syscall (linux-386-cgo), const RTA_PREFSRC ideal-int +pkg syscall (linux-386-cgo), const RTA_PRIORITY ideal-int +pkg syscall (linux-386-cgo), const RTA_SRC ideal-int +pkg syscall (linux-386-cgo), const RTA_TABLE ideal-int +pkg syscall (linux-386-cgo), const RTA_UNSPEC ideal-int +pkg syscall (linux-386-cgo), const RTCF_DIRECTSRC ideal-int +pkg syscall (linux-386-cgo), const RTCF_DOREDIRECT ideal-int +pkg syscall (linux-386-cgo), const RTCF_LOG ideal-int +pkg syscall (linux-386-cgo), const RTCF_MASQ ideal-int +pkg syscall (linux-386-cgo), const RTCF_NAT ideal-int +pkg syscall (linux-386-cgo), const RTCF_VALVE ideal-int +pkg syscall (linux-386-cgo), const RTF_ADDRCLASSMASK ideal-int +pkg syscall (linux-386-cgo), const RTF_ADDRCONF ideal-int +pkg syscall (linux-386-cgo), const RTF_ALLONLINK ideal-int +pkg syscall (linux-386-cgo), const RTF_BROADCAST ideal-int +pkg syscall (linux-386-cgo), const RTF_CACHE ideal-int +pkg syscall (linux-386-cgo), const RTF_DEFAULT ideal-int +pkg syscall (linux-386-cgo), const RTF_DYNAMIC ideal-int +pkg syscall (linux-386-cgo), const RTF_FLOW ideal-int +pkg syscall (linux-386-cgo), const RTF_GATEWAY ideal-int +pkg syscall (linux-386-cgo), const RTF_HOST ideal-int +pkg syscall (linux-386-cgo), const RTF_INTERFACE ideal-int +pkg syscall (linux-386-cgo), const RTF_IRTT ideal-int +pkg syscall (linux-386-cgo), const RTF_LINKRT ideal-int +pkg syscall (linux-386-cgo), const RTF_LOCAL ideal-int +pkg syscall (linux-386-cgo), const RTF_MODIFIED ideal-int +pkg syscall (linux-386-cgo), const RTF_MSS ideal-int +pkg syscall (linux-386-cgo), const RTF_MTU ideal-int +pkg syscall (linux-386-cgo), const RTF_MULTICAST ideal-int +pkg syscall (linux-386-cgo), const RTF_NAT ideal-int +pkg syscall (linux-386-cgo), const RTF_NOFORWARD ideal-int +pkg syscall (linux-386-cgo), const RTF_NONEXTHOP ideal-int +pkg syscall (linux-386-cgo), const RTF_NOPMTUDISC ideal-int +pkg syscall (linux-386-cgo), const RTF_POLICY ideal-int +pkg syscall (linux-386-cgo), const RTF_REINSTATE ideal-int +pkg syscall (linux-386-cgo), const RTF_REJECT ideal-int +pkg syscall (linux-386-cgo), const RTF_STATIC ideal-int +pkg syscall (linux-386-cgo), const RTF_THROW ideal-int +pkg syscall (linux-386-cgo), const RTF_UP ideal-int +pkg syscall (linux-386-cgo), const RTF_WINDOW ideal-int +pkg syscall (linux-386-cgo), const RTF_XRESOLVE ideal-int +pkg syscall (linux-386-cgo), const RTM_BASE ideal-int +pkg syscall (linux-386-cgo), const RTM_DELACTION ideal-int +pkg syscall (linux-386-cgo), const RTM_DELADDR ideal-int +pkg syscall (linux-386-cgo), const RTM_DELADDRLABEL ideal-int +pkg syscall (linux-386-cgo), const RTM_DELLINK ideal-int +pkg syscall (linux-386-cgo), const RTM_DELNEIGH ideal-int +pkg syscall (linux-386-cgo), const RTM_DELQDISC ideal-int +pkg syscall (linux-386-cgo), const RTM_DELROUTE ideal-int +pkg syscall (linux-386-cgo), const RTM_DELRULE ideal-int +pkg syscall (linux-386-cgo), const RTM_DELTCLASS ideal-int +pkg syscall (linux-386-cgo), const RTM_DELTFILTER ideal-int +pkg syscall (linux-386-cgo), const RTM_F_CLONED ideal-int +pkg syscall (linux-386-cgo), const RTM_F_EQUALIZE ideal-int +pkg syscall (linux-386-cgo), const RTM_F_NOTIFY ideal-int +pkg syscall (linux-386-cgo), const RTM_F_PREFIX ideal-int +pkg syscall (linux-386-cgo), const RTM_GETACTION ideal-int +pkg syscall (linux-386-cgo), const RTM_GETADDR ideal-int +pkg syscall (linux-386-cgo), const RTM_GETADDRLABEL ideal-int +pkg syscall (linux-386-cgo), const RTM_GETANYCAST ideal-int +pkg syscall (linux-386-cgo), const RTM_GETDCB ideal-int +pkg syscall (linux-386-cgo), const RTM_GETLINK ideal-int +pkg syscall (linux-386-cgo), const RTM_GETMULTICAST ideal-int +pkg syscall (linux-386-cgo), const RTM_GETNEIGH ideal-int +pkg syscall (linux-386-cgo), const RTM_GETNEIGHTBL ideal-int +pkg syscall (linux-386-cgo), const RTM_GETQDISC ideal-int +pkg syscall (linux-386-cgo), const RTM_GETROUTE ideal-int +pkg syscall (linux-386-cgo), const RTM_GETRULE ideal-int +pkg syscall (linux-386-cgo), const RTM_GETTCLASS ideal-int +pkg syscall (linux-386-cgo), const RTM_GETTFILTER ideal-int +pkg syscall (linux-386-cgo), const RTM_MAX ideal-int +pkg syscall (linux-386-cgo), const RTM_NEWACTION ideal-int +pkg syscall (linux-386-cgo), const RTM_NEWADDR ideal-int +pkg syscall (linux-386-cgo), const RTM_NEWADDRLABEL ideal-int +pkg syscall (linux-386-cgo), const RTM_NEWLINK ideal-int +pkg syscall (linux-386-cgo), const RTM_NEWNDUSEROPT ideal-int +pkg syscall (linux-386-cgo), const RTM_NEWNEIGH ideal-int +pkg syscall (linux-386-cgo), const RTM_NEWNEIGHTBL ideal-int +pkg syscall (linux-386-cgo), const RTM_NEWPREFIX ideal-int +pkg syscall (linux-386-cgo), const RTM_NEWQDISC ideal-int +pkg syscall (linux-386-cgo), const RTM_NEWROUTE ideal-int +pkg syscall (linux-386-cgo), const RTM_NEWRULE ideal-int +pkg syscall (linux-386-cgo), const RTM_NEWTCLASS ideal-int +pkg syscall (linux-386-cgo), const RTM_NEWTFILTER ideal-int +pkg syscall (linux-386-cgo), const RTM_NR_FAMILIES ideal-int +pkg syscall (linux-386-cgo), const RTM_NR_MSGTYPES ideal-int +pkg syscall (linux-386-cgo), const RTM_SETDCB ideal-int +pkg syscall (linux-386-cgo), const RTM_SETLINK ideal-int +pkg syscall (linux-386-cgo), const RTM_SETNEIGHTBL ideal-int +pkg syscall (linux-386-cgo), const RTNH_ALIGNTO ideal-int +pkg syscall (linux-386-cgo), const RTNH_F_DEAD ideal-int +pkg syscall (linux-386-cgo), const RTNH_F_ONLINK ideal-int +pkg syscall (linux-386-cgo), const RTNH_F_PERVASIVE ideal-int +pkg syscall (linux-386-cgo), const RTN_ANYCAST ideal-int +pkg syscall (linux-386-cgo), const RTN_BLACKHOLE ideal-int +pkg syscall (linux-386-cgo), const RTN_BROADCAST ideal-int +pkg syscall (linux-386-cgo), const RTN_LOCAL ideal-int +pkg syscall (linux-386-cgo), const RTN_MAX ideal-int +pkg syscall (linux-386-cgo), const RTN_MULTICAST ideal-int +pkg syscall (linux-386-cgo), const RTN_NAT ideal-int +pkg syscall (linux-386-cgo), const RTN_PROHIBIT ideal-int +pkg syscall (linux-386-cgo), const RTN_THROW ideal-int +pkg syscall (linux-386-cgo), const RTN_UNICAST ideal-int +pkg syscall (linux-386-cgo), const RTN_UNREACHABLE ideal-int +pkg syscall (linux-386-cgo), const RTN_UNSPEC ideal-int +pkg syscall (linux-386-cgo), const RTN_XRESOLVE ideal-int +pkg syscall (linux-386-cgo), const RTPROT_BIRD ideal-int +pkg syscall (linux-386-cgo), const RTPROT_BOOT ideal-int +pkg syscall (linux-386-cgo), const RTPROT_DHCP ideal-int +pkg syscall (linux-386-cgo), const RTPROT_DNROUTED ideal-int +pkg syscall (linux-386-cgo), const RTPROT_GATED ideal-int +pkg syscall (linux-386-cgo), const RTPROT_KERNEL ideal-int +pkg syscall (linux-386-cgo), const RTPROT_MRT ideal-int +pkg syscall (linux-386-cgo), const RTPROT_NTK ideal-int +pkg syscall (linux-386-cgo), const RTPROT_RA ideal-int +pkg syscall (linux-386-cgo), const RTPROT_REDIRECT ideal-int +pkg syscall (linux-386-cgo), const RTPROT_STATIC ideal-int +pkg syscall (linux-386-cgo), const RTPROT_UNSPEC ideal-int +pkg syscall (linux-386-cgo), const RTPROT_XORP ideal-int +pkg syscall (linux-386-cgo), const RTPROT_ZEBRA ideal-int +pkg syscall (linux-386-cgo), const RT_CLASS_DEFAULT ideal-int +pkg syscall (linux-386-cgo), const RT_CLASS_LOCAL ideal-int +pkg syscall (linux-386-cgo), const RT_CLASS_MAIN ideal-int +pkg syscall (linux-386-cgo), const RT_CLASS_MAX ideal-int +pkg syscall (linux-386-cgo), const RT_CLASS_UNSPEC ideal-int +pkg syscall (linux-386-cgo), const RT_SCOPE_HOST ideal-int +pkg syscall (linux-386-cgo), const RT_SCOPE_LINK ideal-int +pkg syscall (linux-386-cgo), const RT_SCOPE_NOWHERE ideal-int +pkg syscall (linux-386-cgo), const RT_SCOPE_SITE ideal-int +pkg syscall (linux-386-cgo), const RT_SCOPE_UNIVERSE ideal-int +pkg syscall (linux-386-cgo), const RT_TABLE_COMPAT ideal-int +pkg syscall (linux-386-cgo), const RT_TABLE_DEFAULT ideal-int +pkg syscall (linux-386-cgo), const RT_TABLE_LOCAL ideal-int +pkg syscall (linux-386-cgo), const RT_TABLE_MAIN ideal-int +pkg syscall (linux-386-cgo), const RT_TABLE_MAX ideal-int +pkg syscall (linux-386-cgo), const RT_TABLE_UNSPEC ideal-int +pkg syscall (linux-386-cgo), const RUSAGE_CHILDREN ideal-int +pkg syscall (linux-386-cgo), const RUSAGE_SELF ideal-int +pkg syscall (linux-386-cgo), const RUSAGE_THREAD ideal-int +pkg syscall (linux-386-cgo), const SCM_CREDENTIALS ideal-int +pkg syscall (linux-386-cgo), const SCM_RIGHTS ideal-int +pkg syscall (linux-386-cgo), const SCM_TIMESTAMP ideal-int +pkg syscall (linux-386-cgo), const SCM_TIMESTAMPING ideal-int +pkg syscall (linux-386-cgo), const SCM_TIMESTAMPNS ideal-int +pkg syscall (linux-386-cgo), const SIGCHLD Signal +pkg syscall (linux-386-cgo), const SIGCLD Signal +pkg syscall (linux-386-cgo), const SIGCONT Signal +pkg syscall (linux-386-cgo), const SIGIO Signal +pkg syscall (linux-386-cgo), const SIGIOT Signal +pkg syscall (linux-386-cgo), const SIGPOLL Signal +pkg syscall (linux-386-cgo), const SIGPROF Signal +pkg syscall (linux-386-cgo), const SIGPWR Signal +pkg syscall (linux-386-cgo), const SIGSTKFLT Signal +pkg syscall (linux-386-cgo), const SIGSTOP Signal +pkg syscall (linux-386-cgo), const SIGSYS Signal +pkg syscall (linux-386-cgo), const SIGTSTP Signal +pkg syscall (linux-386-cgo), const SIGTTIN Signal +pkg syscall (linux-386-cgo), const SIGTTOU Signal +pkg syscall (linux-386-cgo), const SIGUNUSED Signal +pkg syscall (linux-386-cgo), const SIGURG Signal +pkg syscall (linux-386-cgo), const SIGUSR1 Signal +pkg syscall (linux-386-cgo), const SIGUSR2 Signal +pkg syscall (linux-386-cgo), const SIGVTALRM Signal +pkg syscall (linux-386-cgo), const SIGWINCH Signal +pkg syscall (linux-386-cgo), const SIGXCPU Signal +pkg syscall (linux-386-cgo), const SIGXFSZ Signal +pkg syscall (linux-386-cgo), const SIOCADDDLCI ideal-int +pkg syscall (linux-386-cgo), const SIOCADDMULTI ideal-int +pkg syscall (linux-386-cgo), const SIOCADDRT ideal-int +pkg syscall (linux-386-cgo), const SIOCATMARK ideal-int +pkg syscall (linux-386-cgo), const SIOCDARP ideal-int +pkg syscall (linux-386-cgo), const SIOCDELDLCI ideal-int +pkg syscall (linux-386-cgo), const SIOCDELMULTI ideal-int +pkg syscall (linux-386-cgo), const SIOCDELRT ideal-int +pkg syscall (linux-386-cgo), const SIOCDEVPRIVATE ideal-int +pkg syscall (linux-386-cgo), const SIOCDIFADDR ideal-int +pkg syscall (linux-386-cgo), const SIOCDRARP ideal-int +pkg syscall (linux-386-cgo), const SIOCGARP ideal-int +pkg syscall (linux-386-cgo), const SIOCGIFADDR ideal-int +pkg syscall (linux-386-cgo), const SIOCGIFBR ideal-int +pkg syscall (linux-386-cgo), const SIOCGIFBRDADDR ideal-int +pkg syscall (linux-386-cgo), const SIOCGIFCONF ideal-int +pkg syscall (linux-386-cgo), const SIOCGIFCOUNT ideal-int +pkg syscall (linux-386-cgo), const SIOCGIFDSTADDR ideal-int +pkg syscall (linux-386-cgo), const SIOCGIFENCAP ideal-int +pkg syscall (linux-386-cgo), const SIOCGIFFLAGS ideal-int +pkg syscall (linux-386-cgo), const SIOCGIFHWADDR ideal-int +pkg syscall (linux-386-cgo), const SIOCGIFINDEX ideal-int +pkg syscall (linux-386-cgo), const SIOCGIFMAP ideal-int +pkg syscall (linux-386-cgo), const SIOCGIFMEM ideal-int +pkg syscall (linux-386-cgo), const SIOCGIFMETRIC ideal-int +pkg syscall (linux-386-cgo), const SIOCGIFMTU ideal-int +pkg syscall (linux-386-cgo), const SIOCGIFNAME ideal-int +pkg syscall (linux-386-cgo), const SIOCGIFNETMASK ideal-int +pkg syscall (linux-386-cgo), const SIOCGIFPFLAGS ideal-int +pkg syscall (linux-386-cgo), const SIOCGIFSLAVE ideal-int +pkg syscall (linux-386-cgo), const SIOCGIFTXQLEN ideal-int +pkg syscall (linux-386-cgo), const SIOCGPGRP ideal-int +pkg syscall (linux-386-cgo), const SIOCGRARP ideal-int +pkg syscall (linux-386-cgo), const SIOCGSTAMP ideal-int +pkg syscall (linux-386-cgo), const SIOCGSTAMPNS ideal-int +pkg syscall (linux-386-cgo), const SIOCPROTOPRIVATE ideal-int +pkg syscall (linux-386-cgo), const SIOCRTMSG ideal-int +pkg syscall (linux-386-cgo), const SIOCSARP ideal-int +pkg syscall (linux-386-cgo), const SIOCSIFADDR ideal-int +pkg syscall (linux-386-cgo), const SIOCSIFBR ideal-int +pkg syscall (linux-386-cgo), const SIOCSIFBRDADDR ideal-int +pkg syscall (linux-386-cgo), const SIOCSIFDSTADDR ideal-int +pkg syscall (linux-386-cgo), const SIOCSIFENCAP ideal-int +pkg syscall (linux-386-cgo), const SIOCSIFFLAGS ideal-int +pkg syscall (linux-386-cgo), const SIOCSIFHWADDR ideal-int +pkg syscall (linux-386-cgo), const SIOCSIFHWBROADCAST ideal-int +pkg syscall (linux-386-cgo), const SIOCSIFLINK ideal-int +pkg syscall (linux-386-cgo), const SIOCSIFMAP ideal-int +pkg syscall (linux-386-cgo), const SIOCSIFMEM ideal-int +pkg syscall (linux-386-cgo), const SIOCSIFMETRIC ideal-int +pkg syscall (linux-386-cgo), const SIOCSIFMTU ideal-int +pkg syscall (linux-386-cgo), const SIOCSIFNAME ideal-int +pkg syscall (linux-386-cgo), const SIOCSIFNETMASK ideal-int +pkg syscall (linux-386-cgo), const SIOCSIFPFLAGS ideal-int +pkg syscall (linux-386-cgo), const SIOCSIFSLAVE ideal-int +pkg syscall (linux-386-cgo), const SIOCSIFTXQLEN ideal-int +pkg syscall (linux-386-cgo), const SIOCSPGRP ideal-int +pkg syscall (linux-386-cgo), const SIOCSRARP ideal-int +pkg syscall (linux-386-cgo), const SOCK_CLOEXEC ideal-int +pkg syscall (linux-386-cgo), const SOCK_DCCP ideal-int +pkg syscall (linux-386-cgo), const SOCK_NONBLOCK ideal-int +pkg syscall (linux-386-cgo), const SOCK_PACKET ideal-int +pkg syscall (linux-386-cgo), const SOCK_RDM ideal-int +pkg syscall (linux-386-cgo), const SOL_AAL ideal-int +pkg syscall (linux-386-cgo), const SOL_ATM ideal-int +pkg syscall (linux-386-cgo), const SOL_DECNET ideal-int +pkg syscall (linux-386-cgo), const SOL_ICMPV6 ideal-int +pkg syscall (linux-386-cgo), const SOL_IP ideal-int +pkg syscall (linux-386-cgo), const SOL_IPV6 ideal-int +pkg syscall (linux-386-cgo), const SOL_IRDA ideal-int +pkg syscall (linux-386-cgo), const SOL_PACKET ideal-int +pkg syscall (linux-386-cgo), const SOL_RAW ideal-int +pkg syscall (linux-386-cgo), const SOL_TCP ideal-int +pkg syscall (linux-386-cgo), const SOL_X25 ideal-int +pkg syscall (linux-386-cgo), const SO_ACCEPTCONN ideal-int +pkg syscall (linux-386-cgo), const SO_ATTACH_FILTER ideal-int +pkg syscall (linux-386-cgo), const SO_BINDTODEVICE ideal-int +pkg syscall (linux-386-cgo), const SO_BSDCOMPAT ideal-int +pkg syscall (linux-386-cgo), const SO_DEBUG ideal-int +pkg syscall (linux-386-cgo), const SO_DETACH_FILTER ideal-int +pkg syscall (linux-386-cgo), const SO_DOMAIN ideal-int +pkg syscall (linux-386-cgo), const SO_ERROR ideal-int +pkg syscall (linux-386-cgo), const SO_MARK ideal-int +pkg syscall (linux-386-cgo), const SO_NO_CHECK ideal-int +pkg syscall (linux-386-cgo), const SO_OOBINLINE ideal-int +pkg syscall (linux-386-cgo), const SO_PASSCRED ideal-int +pkg syscall (linux-386-cgo), const SO_PASSSEC ideal-int +pkg syscall (linux-386-cgo), const SO_PEERCRED ideal-int +pkg syscall (linux-386-cgo), const SO_PEERNAME ideal-int +pkg syscall (linux-386-cgo), const SO_PEERSEC ideal-int +pkg syscall (linux-386-cgo), const SO_PRIORITY ideal-int +pkg syscall (linux-386-cgo), const SO_PROTOCOL ideal-int +pkg syscall (linux-386-cgo), const SO_RCVBUFFORCE ideal-int +pkg syscall (linux-386-cgo), const SO_RCVLOWAT ideal-int +pkg syscall (linux-386-cgo), const SO_RCVTIMEO ideal-int +pkg syscall (linux-386-cgo), const SO_RXQ_OVFL ideal-int +pkg syscall (linux-386-cgo), const SO_SECURITY_AUTHENTICATION ideal-int +pkg syscall (linux-386-cgo), const SO_SECURITY_ENCRYPTION_NETWORK ideal-int +pkg syscall (linux-386-cgo), const SO_SECURITY_ENCRYPTION_TRANSPORT ideal-int +pkg syscall (linux-386-cgo), const SO_SNDBUFFORCE ideal-int +pkg syscall (linux-386-cgo), const SO_SNDLOWAT ideal-int +pkg syscall (linux-386-cgo), const SO_SNDTIMEO ideal-int +pkg syscall (linux-386-cgo), const SO_TIMESTAMP ideal-int +pkg syscall (linux-386-cgo), const SO_TIMESTAMPING ideal-int +pkg syscall (linux-386-cgo), const SO_TIMESTAMPNS ideal-int +pkg syscall (linux-386-cgo), const SO_TYPE ideal-int +pkg syscall (linux-386-cgo), const SYS_ACCESS ideal-int +pkg syscall (linux-386-cgo), const SYS_ACCT ideal-int +pkg syscall (linux-386-cgo), const SYS_ADD_KEY ideal-int +pkg syscall (linux-386-cgo), const SYS_ADJTIMEX ideal-int +pkg syscall (linux-386-cgo), const SYS_AFS_SYSCALL ideal-int +pkg syscall (linux-386-cgo), const SYS_ALARM ideal-int +pkg syscall (linux-386-cgo), const SYS_BDFLUSH ideal-int +pkg syscall (linux-386-cgo), const SYS_BREAK ideal-int +pkg syscall (linux-386-cgo), const SYS_BRK ideal-int +pkg syscall (linux-386-cgo), const SYS_CAPGET ideal-int +pkg syscall (linux-386-cgo), const SYS_CAPSET ideal-int +pkg syscall (linux-386-cgo), const SYS_CHDIR ideal-int +pkg syscall (linux-386-cgo), const SYS_CHMOD ideal-int +pkg syscall (linux-386-cgo), const SYS_CHOWN ideal-int +pkg syscall (linux-386-cgo), const SYS_CHOWN32 ideal-int +pkg syscall (linux-386-cgo), const SYS_CHROOT ideal-int +pkg syscall (linux-386-cgo), const SYS_CLOCK_GETRES ideal-int +pkg syscall (linux-386-cgo), const SYS_CLOCK_GETTIME ideal-int +pkg syscall (linux-386-cgo), const SYS_CLOCK_NANOSLEEP ideal-int +pkg syscall (linux-386-cgo), const SYS_CLOCK_SETTIME ideal-int +pkg syscall (linux-386-cgo), const SYS_CLONE ideal-int +pkg syscall (linux-386-cgo), const SYS_CLOSE ideal-int +pkg syscall (linux-386-cgo), const SYS_CREAT ideal-int +pkg syscall (linux-386-cgo), const SYS_CREATE_MODULE ideal-int +pkg syscall (linux-386-cgo), const SYS_DELETE_MODULE ideal-int +pkg syscall (linux-386-cgo), const SYS_DUP ideal-int +pkg syscall (linux-386-cgo), const SYS_DUP2 ideal-int +pkg syscall (linux-386-cgo), const SYS_DUP3 ideal-int +pkg syscall (linux-386-cgo), const SYS_EPOLL_CREATE ideal-int +pkg syscall (linux-386-cgo), const SYS_EPOLL_CREATE1 ideal-int +pkg syscall (linux-386-cgo), const SYS_EPOLL_CTL ideal-int +pkg syscall (linux-386-cgo), const SYS_EPOLL_PWAIT ideal-int +pkg syscall (linux-386-cgo), const SYS_EPOLL_WAIT ideal-int +pkg syscall (linux-386-cgo), const SYS_EVENTFD ideal-int +pkg syscall (linux-386-cgo), const SYS_EVENTFD2 ideal-int +pkg syscall (linux-386-cgo), const SYS_EXECVE ideal-int +pkg syscall (linux-386-cgo), const SYS_EXIT ideal-int +pkg syscall (linux-386-cgo), const SYS_EXIT_GROUP ideal-int +pkg syscall (linux-386-cgo), const SYS_FACCESSAT ideal-int +pkg syscall (linux-386-cgo), const SYS_FADVISE64 ideal-int +pkg syscall (linux-386-cgo), const SYS_FADVISE64_64 ideal-int +pkg syscall (linux-386-cgo), const SYS_FALLOCATE ideal-int +pkg syscall (linux-386-cgo), const SYS_FANOTIFY_INIT ideal-int +pkg syscall (linux-386-cgo), const SYS_FANOTIFY_MARK ideal-int +pkg syscall (linux-386-cgo), const SYS_FCHDIR ideal-int +pkg syscall (linux-386-cgo), const SYS_FCHMOD ideal-int +pkg syscall (linux-386-cgo), const SYS_FCHMODAT ideal-int +pkg syscall (linux-386-cgo), const SYS_FCHOWN ideal-int +pkg syscall (linux-386-cgo), const SYS_FCHOWN32 ideal-int +pkg syscall (linux-386-cgo), const SYS_FCHOWNAT ideal-int +pkg syscall (linux-386-cgo), const SYS_FCNTL ideal-int +pkg syscall (linux-386-cgo), const SYS_FCNTL64 ideal-int +pkg syscall (linux-386-cgo), const SYS_FDATASYNC ideal-int +pkg syscall (linux-386-cgo), const SYS_FGETXATTR ideal-int +pkg syscall (linux-386-cgo), const SYS_FLISTXATTR ideal-int +pkg syscall (linux-386-cgo), const SYS_FLOCK ideal-int +pkg syscall (linux-386-cgo), const SYS_FORK ideal-int +pkg syscall (linux-386-cgo), const SYS_FREMOVEXATTR ideal-int +pkg syscall (linux-386-cgo), const SYS_FSETXATTR ideal-int +pkg syscall (linux-386-cgo), const SYS_FSTAT ideal-int +pkg syscall (linux-386-cgo), const SYS_FSTAT64 ideal-int +pkg syscall (linux-386-cgo), const SYS_FSTATAT64 ideal-int +pkg syscall (linux-386-cgo), const SYS_FSTATFS ideal-int +pkg syscall (linux-386-cgo), const SYS_FSTATFS64 ideal-int +pkg syscall (linux-386-cgo), const SYS_FSYNC ideal-int +pkg syscall (linux-386-cgo), const SYS_FTIME ideal-int +pkg syscall (linux-386-cgo), const SYS_FTRUNCATE ideal-int +pkg syscall (linux-386-cgo), const SYS_FTRUNCATE64 ideal-int +pkg syscall (linux-386-cgo), const SYS_FUTEX ideal-int +pkg syscall (linux-386-cgo), const SYS_FUTIMESAT ideal-int +pkg syscall (linux-386-cgo), const SYS_GETCPU ideal-int +pkg syscall (linux-386-cgo), const SYS_GETCWD ideal-int +pkg syscall (linux-386-cgo), const SYS_GETDENTS ideal-int +pkg syscall (linux-386-cgo), const SYS_GETDENTS64 ideal-int +pkg syscall (linux-386-cgo), const SYS_GETEGID ideal-int +pkg syscall (linux-386-cgo), const SYS_GETEGID32 ideal-int +pkg syscall (linux-386-cgo), const SYS_GETEUID ideal-int +pkg syscall (linux-386-cgo), const SYS_GETEUID32 ideal-int +pkg syscall (linux-386-cgo), const SYS_GETGID ideal-int +pkg syscall (linux-386-cgo), const SYS_GETGID32 ideal-int +pkg syscall (linux-386-cgo), const SYS_GETGROUPS ideal-int +pkg syscall (linux-386-cgo), const SYS_GETGROUPS32 ideal-int +pkg syscall (linux-386-cgo), const SYS_GETITIMER ideal-int +pkg syscall (linux-386-cgo), const SYS_GETPGID ideal-int +pkg syscall (linux-386-cgo), const SYS_GETPGRP ideal-int +pkg syscall (linux-386-cgo), const SYS_GETPID ideal-int +pkg syscall (linux-386-cgo), const SYS_GETPMSG ideal-int +pkg syscall (linux-386-cgo), const SYS_GETPPID ideal-int +pkg syscall (linux-386-cgo), const SYS_GETPRIORITY ideal-int +pkg syscall (linux-386-cgo), const SYS_GETRESGID ideal-int +pkg syscall (linux-386-cgo), const SYS_GETRESGID32 ideal-int +pkg syscall (linux-386-cgo), const SYS_GETRESUID ideal-int +pkg syscall (linux-386-cgo), const SYS_GETRESUID32 ideal-int +pkg syscall (linux-386-cgo), const SYS_GETRLIMIT ideal-int +pkg syscall (linux-386-cgo), const SYS_GETRUSAGE ideal-int +pkg syscall (linux-386-cgo), const SYS_GETSID ideal-int +pkg syscall (linux-386-cgo), const SYS_GETTID ideal-int +pkg syscall (linux-386-cgo), const SYS_GETTIMEOFDAY ideal-int +pkg syscall (linux-386-cgo), const SYS_GETUID ideal-int +pkg syscall (linux-386-cgo), const SYS_GETUID32 ideal-int +pkg syscall (linux-386-cgo), const SYS_GETXATTR ideal-int +pkg syscall (linux-386-cgo), const SYS_GET_KERNEL_SYMS ideal-int +pkg syscall (linux-386-cgo), const SYS_GET_MEMPOLICY ideal-int +pkg syscall (linux-386-cgo), const SYS_GET_ROBUST_LIST ideal-int +pkg syscall (linux-386-cgo), const SYS_GET_THREAD_AREA ideal-int +pkg syscall (linux-386-cgo), const SYS_GTTY ideal-int +pkg syscall (linux-386-cgo), const SYS_IDLE ideal-int +pkg syscall (linux-386-cgo), const SYS_INIT_MODULE ideal-int +pkg syscall (linux-386-cgo), const SYS_INOTIFY_ADD_WATCH ideal-int +pkg syscall (linux-386-cgo), const SYS_INOTIFY_INIT ideal-int +pkg syscall (linux-386-cgo), const SYS_INOTIFY_INIT1 ideal-int +pkg syscall (linux-386-cgo), const SYS_INOTIFY_RM_WATCH ideal-int +pkg syscall (linux-386-cgo), const SYS_IOCTL ideal-int +pkg syscall (linux-386-cgo), const SYS_IOPERM ideal-int +pkg syscall (linux-386-cgo), const SYS_IOPL ideal-int +pkg syscall (linux-386-cgo), const SYS_IOPRIO_GET ideal-int +pkg syscall (linux-386-cgo), const SYS_IOPRIO_SET ideal-int +pkg syscall (linux-386-cgo), const SYS_IO_CANCEL ideal-int +pkg syscall (linux-386-cgo), const SYS_IO_DESTROY ideal-int +pkg syscall (linux-386-cgo), const SYS_IO_GETEVENTS ideal-int +pkg syscall (linux-386-cgo), const SYS_IO_SETUP ideal-int +pkg syscall (linux-386-cgo), const SYS_IO_SUBMIT ideal-int +pkg syscall (linux-386-cgo), const SYS_IPC ideal-int +pkg syscall (linux-386-cgo), const SYS_KEXEC_LOAD ideal-int +pkg syscall (linux-386-cgo), const SYS_KEYCTL ideal-int +pkg syscall (linux-386-cgo), const SYS_KILL ideal-int +pkg syscall (linux-386-cgo), const SYS_LCHOWN ideal-int +pkg syscall (linux-386-cgo), const SYS_LCHOWN32 ideal-int +pkg syscall (linux-386-cgo), const SYS_LGETXATTR ideal-int +pkg syscall (linux-386-cgo), const SYS_LINK ideal-int +pkg syscall (linux-386-cgo), const SYS_LINKAT ideal-int +pkg syscall (linux-386-cgo), const SYS_LISTXATTR ideal-int +pkg syscall (linux-386-cgo), const SYS_LLISTXATTR ideal-int +pkg syscall (linux-386-cgo), const SYS_LOCK ideal-int +pkg syscall (linux-386-cgo), const SYS_LOOKUP_DCOOKIE ideal-int +pkg syscall (linux-386-cgo), const SYS_LREMOVEXATTR ideal-int +pkg syscall (linux-386-cgo), const SYS_LSEEK ideal-int +pkg syscall (linux-386-cgo), const SYS_LSETXATTR ideal-int +pkg syscall (linux-386-cgo), const SYS_LSTAT ideal-int +pkg syscall (linux-386-cgo), const SYS_LSTAT64 ideal-int +pkg syscall (linux-386-cgo), const SYS_MADVISE ideal-int +pkg syscall (linux-386-cgo), const SYS_MADVISE1 ideal-int +pkg syscall (linux-386-cgo), const SYS_MBIND ideal-int +pkg syscall (linux-386-cgo), const SYS_MIGRATE_PAGES ideal-int +pkg syscall (linux-386-cgo), const SYS_MINCORE ideal-int +pkg syscall (linux-386-cgo), const SYS_MKDIR ideal-int +pkg syscall (linux-386-cgo), const SYS_MKDIRAT ideal-int +pkg syscall (linux-386-cgo), const SYS_MKNOD ideal-int +pkg syscall (linux-386-cgo), const SYS_MKNODAT ideal-int +pkg syscall (linux-386-cgo), const SYS_MLOCK ideal-int +pkg syscall (linux-386-cgo), const SYS_MLOCKALL ideal-int +pkg syscall (linux-386-cgo), const SYS_MMAP ideal-int +pkg syscall (linux-386-cgo), const SYS_MMAP2 ideal-int +pkg syscall (linux-386-cgo), const SYS_MODIFY_LDT ideal-int +pkg syscall (linux-386-cgo), const SYS_MOUNT ideal-int +pkg syscall (linux-386-cgo), const SYS_MOVE_PAGES ideal-int +pkg syscall (linux-386-cgo), const SYS_MPROTECT ideal-int +pkg syscall (linux-386-cgo), const SYS_MPX ideal-int +pkg syscall (linux-386-cgo), const SYS_MQ_GETSETATTR ideal-int +pkg syscall (linux-386-cgo), const SYS_MQ_NOTIFY ideal-int +pkg syscall (linux-386-cgo), const SYS_MQ_OPEN ideal-int +pkg syscall (linux-386-cgo), const SYS_MQ_TIMEDRECEIVE ideal-int +pkg syscall (linux-386-cgo), const SYS_MQ_TIMEDSEND ideal-int +pkg syscall (linux-386-cgo), const SYS_MQ_UNLINK ideal-int +pkg syscall (linux-386-cgo), const SYS_MREMAP ideal-int +pkg syscall (linux-386-cgo), const SYS_MSYNC ideal-int +pkg syscall (linux-386-cgo), const SYS_MUNLOCK ideal-int +pkg syscall (linux-386-cgo), const SYS_MUNLOCKALL ideal-int +pkg syscall (linux-386-cgo), const SYS_MUNMAP ideal-int +pkg syscall (linux-386-cgo), const SYS_NANOSLEEP ideal-int +pkg syscall (linux-386-cgo), const SYS_NFSSERVCTL ideal-int +pkg syscall (linux-386-cgo), const SYS_NICE ideal-int +pkg syscall (linux-386-cgo), const SYS_OLDFSTAT ideal-int +pkg syscall (linux-386-cgo), const SYS_OLDLSTAT ideal-int +pkg syscall (linux-386-cgo), const SYS_OLDOLDUNAME ideal-int +pkg syscall (linux-386-cgo), const SYS_OLDSTAT ideal-int +pkg syscall (linux-386-cgo), const SYS_OLDUNAME ideal-int +pkg syscall (linux-386-cgo), const SYS_OPEN ideal-int +pkg syscall (linux-386-cgo), const SYS_OPENAT ideal-int +pkg syscall (linux-386-cgo), const SYS_PAUSE ideal-int +pkg syscall (linux-386-cgo), const SYS_PERF_EVENT_OPEN ideal-int +pkg syscall (linux-386-cgo), const SYS_PERSONALITY ideal-int +pkg syscall (linux-386-cgo), const SYS_PIPE ideal-int +pkg syscall (linux-386-cgo), const SYS_PIPE2 ideal-int +pkg syscall (linux-386-cgo), const SYS_PIVOT_ROOT ideal-int +pkg syscall (linux-386-cgo), const SYS_POLL ideal-int +pkg syscall (linux-386-cgo), const SYS_PPOLL ideal-int +pkg syscall (linux-386-cgo), const SYS_PRCTL ideal-int +pkg syscall (linux-386-cgo), const SYS_PREAD64 ideal-int +pkg syscall (linux-386-cgo), const SYS_PREADV ideal-int +pkg syscall (linux-386-cgo), const SYS_PRLIMIT64 ideal-int +pkg syscall (linux-386-cgo), const SYS_PROF ideal-int +pkg syscall (linux-386-cgo), const SYS_PROFIL ideal-int +pkg syscall (linux-386-cgo), const SYS_PSELECT6 ideal-int +pkg syscall (linux-386-cgo), const SYS_PTRACE ideal-int +pkg syscall (linux-386-cgo), const SYS_PUTPMSG ideal-int +pkg syscall (linux-386-cgo), const SYS_PWRITE64 ideal-int +pkg syscall (linux-386-cgo), const SYS_PWRITEV ideal-int +pkg syscall (linux-386-cgo), const SYS_QUERY_MODULE ideal-int +pkg syscall (linux-386-cgo), const SYS_QUOTACTL ideal-int +pkg syscall (linux-386-cgo), const SYS_READ ideal-int +pkg syscall (linux-386-cgo), const SYS_READAHEAD ideal-int +pkg syscall (linux-386-cgo), const SYS_READDIR ideal-int +pkg syscall (linux-386-cgo), const SYS_READLINK ideal-int +pkg syscall (linux-386-cgo), const SYS_READLINKAT ideal-int +pkg syscall (linux-386-cgo), const SYS_READV ideal-int +pkg syscall (linux-386-cgo), const SYS_REBOOT ideal-int +pkg syscall (linux-386-cgo), const SYS_RECVMMSG ideal-int +pkg syscall (linux-386-cgo), const SYS_REMAP_FILE_PAGES ideal-int +pkg syscall (linux-386-cgo), const SYS_REMOVEXATTR ideal-int +pkg syscall (linux-386-cgo), const SYS_RENAME ideal-int +pkg syscall (linux-386-cgo), const SYS_RENAMEAT ideal-int +pkg syscall (linux-386-cgo), const SYS_REQUEST_KEY ideal-int +pkg syscall (linux-386-cgo), const SYS_RESTART_SYSCALL ideal-int +pkg syscall (linux-386-cgo), const SYS_RMDIR ideal-int +pkg syscall (linux-386-cgo), const SYS_RT_SIGACTION ideal-int +pkg syscall (linux-386-cgo), const SYS_RT_SIGPENDING ideal-int +pkg syscall (linux-386-cgo), const SYS_RT_SIGPROCMASK ideal-int +pkg syscall (linux-386-cgo), const SYS_RT_SIGQUEUEINFO ideal-int +pkg syscall (linux-386-cgo), const SYS_RT_SIGRETURN ideal-int +pkg syscall (linux-386-cgo), const SYS_RT_SIGSUSPEND ideal-int +pkg syscall (linux-386-cgo), const SYS_RT_SIGTIMEDWAIT ideal-int +pkg syscall (linux-386-cgo), const SYS_RT_TGSIGQUEUEINFO ideal-int +pkg syscall (linux-386-cgo), const SYS_SCHED_GETAFFINITY ideal-int +pkg syscall (linux-386-cgo), const SYS_SCHED_GETPARAM ideal-int +pkg syscall (linux-386-cgo), const SYS_SCHED_GETSCHEDULER ideal-int +pkg syscall (linux-386-cgo), const SYS_SCHED_GET_PRIORITY_MAX ideal-int +pkg syscall (linux-386-cgo), const SYS_SCHED_GET_PRIORITY_MIN ideal-int +pkg syscall (linux-386-cgo), const SYS_SCHED_RR_GET_INTERVAL ideal-int +pkg syscall (linux-386-cgo), const SYS_SCHED_SETAFFINITY ideal-int +pkg syscall (linux-386-cgo), const SYS_SCHED_SETPARAM ideal-int +pkg syscall (linux-386-cgo), const SYS_SCHED_SETSCHEDULER ideal-int +pkg syscall (linux-386-cgo), const SYS_SCHED_YIELD ideal-int +pkg syscall (linux-386-cgo), const SYS_SELECT ideal-int +pkg syscall (linux-386-cgo), const SYS_SENDFILE ideal-int +pkg syscall (linux-386-cgo), const SYS_SENDFILE64 ideal-int +pkg syscall (linux-386-cgo), const SYS_SETDOMAINNAME ideal-int +pkg syscall (linux-386-cgo), const SYS_SETFSGID ideal-int +pkg syscall (linux-386-cgo), const SYS_SETFSGID32 ideal-int +pkg syscall (linux-386-cgo), const SYS_SETFSUID ideal-int +pkg syscall (linux-386-cgo), const SYS_SETFSUID32 ideal-int +pkg syscall (linux-386-cgo), const SYS_SETGID ideal-int +pkg syscall (linux-386-cgo), const SYS_SETGID32 ideal-int +pkg syscall (linux-386-cgo), const SYS_SETGROUPS ideal-int +pkg syscall (linux-386-cgo), const SYS_SETGROUPS32 ideal-int +pkg syscall (linux-386-cgo), const SYS_SETHOSTNAME ideal-int +pkg syscall (linux-386-cgo), const SYS_SETITIMER ideal-int +pkg syscall (linux-386-cgo), const SYS_SETPGID ideal-int +pkg syscall (linux-386-cgo), const SYS_SETPRIORITY ideal-int +pkg syscall (linux-386-cgo), const SYS_SETREGID ideal-int +pkg syscall (linux-386-cgo), const SYS_SETREGID32 ideal-int +pkg syscall (linux-386-cgo), const SYS_SETRESGID ideal-int +pkg syscall (linux-386-cgo), const SYS_SETRESGID32 ideal-int +pkg syscall (linux-386-cgo), const SYS_SETRESUID ideal-int +pkg syscall (linux-386-cgo), const SYS_SETRESUID32 ideal-int +pkg syscall (linux-386-cgo), const SYS_SETREUID ideal-int +pkg syscall (linux-386-cgo), const SYS_SETREUID32 ideal-int +pkg syscall (linux-386-cgo), const SYS_SETRLIMIT ideal-int +pkg syscall (linux-386-cgo), const SYS_SETSID ideal-int +pkg syscall (linux-386-cgo), const SYS_SETTIMEOFDAY ideal-int +pkg syscall (linux-386-cgo), const SYS_SETUID ideal-int +pkg syscall (linux-386-cgo), const SYS_SETUID32 ideal-int +pkg syscall (linux-386-cgo), const SYS_SETXATTR ideal-int +pkg syscall (linux-386-cgo), const SYS_SET_MEMPOLICY ideal-int +pkg syscall (linux-386-cgo), const SYS_SET_ROBUST_LIST ideal-int +pkg syscall (linux-386-cgo), const SYS_SET_THREAD_AREA ideal-int +pkg syscall (linux-386-cgo), const SYS_SET_TID_ADDRESS ideal-int +pkg syscall (linux-386-cgo), const SYS_SGETMASK ideal-int +pkg syscall (linux-386-cgo), const SYS_SIGACTION ideal-int +pkg syscall (linux-386-cgo), const SYS_SIGALTSTACK ideal-int +pkg syscall (linux-386-cgo), const SYS_SIGNAL ideal-int +pkg syscall (linux-386-cgo), const SYS_SIGNALFD ideal-int +pkg syscall (linux-386-cgo), const SYS_SIGNALFD4 ideal-int +pkg syscall (linux-386-cgo), const SYS_SIGPENDING ideal-int +pkg syscall (linux-386-cgo), const SYS_SIGPROCMASK ideal-int +pkg syscall (linux-386-cgo), const SYS_SIGRETURN ideal-int +pkg syscall (linux-386-cgo), const SYS_SIGSUSPEND ideal-int +pkg syscall (linux-386-cgo), const SYS_SOCKETCALL ideal-int +pkg syscall (linux-386-cgo), const SYS_SPLICE ideal-int +pkg syscall (linux-386-cgo), const SYS_SSETMASK ideal-int +pkg syscall (linux-386-cgo), const SYS_STAT ideal-int +pkg syscall (linux-386-cgo), const SYS_STAT64 ideal-int +pkg syscall (linux-386-cgo), const SYS_STATFS ideal-int +pkg syscall (linux-386-cgo), const SYS_STATFS64 ideal-int +pkg syscall (linux-386-cgo), const SYS_STIME ideal-int +pkg syscall (linux-386-cgo), const SYS_STTY ideal-int +pkg syscall (linux-386-cgo), const SYS_SWAPOFF ideal-int +pkg syscall (linux-386-cgo), const SYS_SWAPON ideal-int +pkg syscall (linux-386-cgo), const SYS_SYMLINK ideal-int +pkg syscall (linux-386-cgo), const SYS_SYMLINKAT ideal-int +pkg syscall (linux-386-cgo), const SYS_SYNC ideal-int +pkg syscall (linux-386-cgo), const SYS_SYNC_FILE_RANGE ideal-int +pkg syscall (linux-386-cgo), const SYS_SYSFS ideal-int +pkg syscall (linux-386-cgo), const SYS_SYSINFO ideal-int +pkg syscall (linux-386-cgo), const SYS_SYSLOG ideal-int +pkg syscall (linux-386-cgo), const SYS_TEE ideal-int +pkg syscall (linux-386-cgo), const SYS_TGKILL ideal-int +pkg syscall (linux-386-cgo), const SYS_TIME ideal-int +pkg syscall (linux-386-cgo), const SYS_TIMERFD_CREATE ideal-int +pkg syscall (linux-386-cgo), const SYS_TIMERFD_GETTIME ideal-int +pkg syscall (linux-386-cgo), const SYS_TIMERFD_SETTIME ideal-int +pkg syscall (linux-386-cgo), const SYS_TIMER_CREATE ideal-int +pkg syscall (linux-386-cgo), const SYS_TIMER_DELETE ideal-int +pkg syscall (linux-386-cgo), const SYS_TIMER_GETOVERRUN ideal-int +pkg syscall (linux-386-cgo), const SYS_TIMER_GETTIME ideal-int +pkg syscall (linux-386-cgo), const SYS_TIMER_SETTIME ideal-int +pkg syscall (linux-386-cgo), const SYS_TIMES ideal-int +pkg syscall (linux-386-cgo), const SYS_TKILL ideal-int +pkg syscall (linux-386-cgo), const SYS_TRUNCATE ideal-int +pkg syscall (linux-386-cgo), const SYS_TRUNCATE64 ideal-int +pkg syscall (linux-386-cgo), const SYS_UGETRLIMIT ideal-int +pkg syscall (linux-386-cgo), const SYS_ULIMIT ideal-int +pkg syscall (linux-386-cgo), const SYS_UMASK ideal-int +pkg syscall (linux-386-cgo), const SYS_UMOUNT ideal-int +pkg syscall (linux-386-cgo), const SYS_UMOUNT2 ideal-int +pkg syscall (linux-386-cgo), const SYS_UNAME ideal-int +pkg syscall (linux-386-cgo), const SYS_UNLINK ideal-int +pkg syscall (linux-386-cgo), const SYS_UNLINKAT ideal-int +pkg syscall (linux-386-cgo), const SYS_UNSHARE ideal-int +pkg syscall (linux-386-cgo), const SYS_USELIB ideal-int +pkg syscall (linux-386-cgo), const SYS_USTAT ideal-int +pkg syscall (linux-386-cgo), const SYS_UTIME ideal-int +pkg syscall (linux-386-cgo), const SYS_UTIMENSAT ideal-int +pkg syscall (linux-386-cgo), const SYS_UTIMES ideal-int +pkg syscall (linux-386-cgo), const SYS_VFORK ideal-int +pkg syscall (linux-386-cgo), const SYS_VHANGUP ideal-int +pkg syscall (linux-386-cgo), const SYS_VM86 ideal-int +pkg syscall (linux-386-cgo), const SYS_VM86OLD ideal-int +pkg syscall (linux-386-cgo), const SYS_VMSPLICE ideal-int +pkg syscall (linux-386-cgo), const SYS_VSERVER ideal-int +pkg syscall (linux-386-cgo), const SYS_WAIT4 ideal-int +pkg syscall (linux-386-cgo), const SYS_WAITID ideal-int +pkg syscall (linux-386-cgo), const SYS_WAITPID ideal-int +pkg syscall (linux-386-cgo), const SYS_WRITE ideal-int +pkg syscall (linux-386-cgo), const SYS_WRITEV ideal-int +pkg syscall (linux-386-cgo), const SYS__LLSEEK ideal-int +pkg syscall (linux-386-cgo), const SYS__NEWSELECT ideal-int +pkg syscall (linux-386-cgo), const SYS__SYSCTL ideal-int +pkg syscall (linux-386-cgo), const S_BLKSIZE ideal-int +pkg syscall (linux-386-cgo), const S_IEXEC ideal-int +pkg syscall (linux-386-cgo), const S_IREAD ideal-int +pkg syscall (linux-386-cgo), const S_IRGRP ideal-int +pkg syscall (linux-386-cgo), const S_IROTH ideal-int +pkg syscall (linux-386-cgo), const S_IRWXG ideal-int +pkg syscall (linux-386-cgo), const S_IRWXO ideal-int +pkg syscall (linux-386-cgo), const S_IRWXU ideal-int +pkg syscall (linux-386-cgo), const S_IWGRP ideal-int +pkg syscall (linux-386-cgo), const S_IWOTH ideal-int +pkg syscall (linux-386-cgo), const S_IWRITE ideal-int +pkg syscall (linux-386-cgo), const S_IXGRP ideal-int +pkg syscall (linux-386-cgo), const S_IXOTH ideal-int +pkg syscall (linux-386-cgo), const SizeofCmsghdr ideal-int +pkg syscall (linux-386-cgo), const SizeofIPMreq ideal-int +pkg syscall (linux-386-cgo), const SizeofIPMreqn ideal-int +pkg syscall (linux-386-cgo), const SizeofIPv6Mreq ideal-int +pkg syscall (linux-386-cgo), const SizeofIfAddrmsg ideal-int +pkg syscall (linux-386-cgo), const SizeofIfInfomsg ideal-int +pkg syscall (linux-386-cgo), const SizeofInet4Pktinfo ideal-int +pkg syscall (linux-386-cgo), const SizeofInet6Pktinfo ideal-int +pkg syscall (linux-386-cgo), const SizeofInotifyEvent ideal-int +pkg syscall (linux-386-cgo), const SizeofLinger ideal-int +pkg syscall (linux-386-cgo), const SizeofMsghdr ideal-int +pkg syscall (linux-386-cgo), const SizeofNlAttr ideal-int +pkg syscall (linux-386-cgo), const SizeofNlMsgerr ideal-int +pkg syscall (linux-386-cgo), const SizeofNlMsghdr ideal-int +pkg syscall (linux-386-cgo), const SizeofRtAttr ideal-int +pkg syscall (linux-386-cgo), const SizeofRtGenmsg ideal-int +pkg syscall (linux-386-cgo), const SizeofRtMsg ideal-int +pkg syscall (linux-386-cgo), const SizeofRtNexthop ideal-int +pkg syscall (linux-386-cgo), const SizeofSockFilter ideal-int +pkg syscall (linux-386-cgo), const SizeofSockFprog ideal-int +pkg syscall (linux-386-cgo), const SizeofSockaddrAny ideal-int +pkg syscall (linux-386-cgo), const SizeofSockaddrInet4 ideal-int +pkg syscall (linux-386-cgo), const SizeofSockaddrInet6 ideal-int +pkg syscall (linux-386-cgo), const SizeofSockaddrLinklayer ideal-int +pkg syscall (linux-386-cgo), const SizeofSockaddrNetlink ideal-int +pkg syscall (linux-386-cgo), const SizeofSockaddrUnix ideal-int +pkg syscall (linux-386-cgo), const SizeofUcred ideal-int +pkg syscall (linux-386-cgo), const TCGETS ideal-int +pkg syscall (linux-386-cgo), const TCP_CONGESTION ideal-int +pkg syscall (linux-386-cgo), const TCP_CORK ideal-int +pkg syscall (linux-386-cgo), const TCP_DEFER_ACCEPT ideal-int +pkg syscall (linux-386-cgo), const TCP_INFO ideal-int +pkg syscall (linux-386-cgo), const TCP_KEEPCNT ideal-int +pkg syscall (linux-386-cgo), const TCP_KEEPIDLE ideal-int +pkg syscall (linux-386-cgo), const TCP_KEEPINTVL ideal-int +pkg syscall (linux-386-cgo), const TCP_LINGER2 ideal-int +pkg syscall (linux-386-cgo), const TCP_MAXSEG ideal-int +pkg syscall (linux-386-cgo), const TCP_MAXWIN ideal-int +pkg syscall (linux-386-cgo), const TCP_MAX_WINSHIFT ideal-int +pkg syscall (linux-386-cgo), const TCP_MD5SIG ideal-int +pkg syscall (linux-386-cgo), const TCP_MD5SIG_MAXKEYLEN ideal-int +pkg syscall (linux-386-cgo), const TCP_MSS ideal-int +pkg syscall (linux-386-cgo), const TCP_QUICKACK ideal-int +pkg syscall (linux-386-cgo), const TCP_SYNCNT ideal-int +pkg syscall (linux-386-cgo), const TCP_WINDOW_CLAMP ideal-int +pkg syscall (linux-386-cgo), const TCSETS ideal-int +pkg syscall (linux-386-cgo), const TIOCCBRK ideal-int +pkg syscall (linux-386-cgo), const TIOCCONS ideal-int +pkg syscall (linux-386-cgo), const TIOCEXCL ideal-int +pkg syscall (linux-386-cgo), const TIOCGDEV ideal-int +pkg syscall (linux-386-cgo), const TIOCGETD ideal-int +pkg syscall (linux-386-cgo), const TIOCGICOUNT ideal-int +pkg syscall (linux-386-cgo), const TIOCGLCKTRMIOS ideal-int +pkg syscall (linux-386-cgo), const TIOCGPGRP ideal-int +pkg syscall (linux-386-cgo), const TIOCGPTN ideal-int +pkg syscall (linux-386-cgo), const TIOCGRS485 ideal-int +pkg syscall (linux-386-cgo), const TIOCGSERIAL ideal-int +pkg syscall (linux-386-cgo), const TIOCGSID ideal-int +pkg syscall (linux-386-cgo), const TIOCGSOFTCAR ideal-int +pkg syscall (linux-386-cgo), const TIOCGWINSZ ideal-int +pkg syscall (linux-386-cgo), const TIOCINQ ideal-int +pkg syscall (linux-386-cgo), const TIOCLINUX ideal-int +pkg syscall (linux-386-cgo), const TIOCMBIC ideal-int +pkg syscall (linux-386-cgo), const TIOCMBIS ideal-int +pkg syscall (linux-386-cgo), const TIOCMGET ideal-int +pkg syscall (linux-386-cgo), const TIOCMIWAIT ideal-int +pkg syscall (linux-386-cgo), const TIOCMSET ideal-int +pkg syscall (linux-386-cgo), const TIOCM_CAR ideal-int +pkg syscall (linux-386-cgo), const TIOCM_CD ideal-int +pkg syscall (linux-386-cgo), const TIOCM_CTS ideal-int +pkg syscall (linux-386-cgo), const TIOCM_DSR ideal-int +pkg syscall (linux-386-cgo), const TIOCM_DTR ideal-int +pkg syscall (linux-386-cgo), const TIOCM_LE ideal-int +pkg syscall (linux-386-cgo), const TIOCM_RI ideal-int +pkg syscall (linux-386-cgo), const TIOCM_RNG ideal-int +pkg syscall (linux-386-cgo), const TIOCM_RTS ideal-int +pkg syscall (linux-386-cgo), const TIOCM_SR ideal-int +pkg syscall (linux-386-cgo), const TIOCM_ST ideal-int +pkg syscall (linux-386-cgo), const TIOCNOTTY ideal-int +pkg syscall (linux-386-cgo), const TIOCNXCL ideal-int +pkg syscall (linux-386-cgo), const TIOCOUTQ ideal-int +pkg syscall (linux-386-cgo), const TIOCPKT ideal-int +pkg syscall (linux-386-cgo), const TIOCPKT_DATA ideal-int +pkg syscall (linux-386-cgo), const TIOCPKT_DOSTOP ideal-int +pkg syscall (linux-386-cgo), const TIOCPKT_FLUSHREAD ideal-int +pkg syscall (linux-386-cgo), const TIOCPKT_FLUSHWRITE ideal-int +pkg syscall (linux-386-cgo), const TIOCPKT_IOCTL ideal-int +pkg syscall (linux-386-cgo), const TIOCPKT_NOSTOP ideal-int +pkg syscall (linux-386-cgo), const TIOCPKT_START ideal-int +pkg syscall (linux-386-cgo), const TIOCPKT_STOP ideal-int +pkg syscall (linux-386-cgo), const TIOCSBRK ideal-int +pkg syscall (linux-386-cgo), const TIOCSCTTY ideal-int +pkg syscall (linux-386-cgo), const TIOCSERCONFIG ideal-int +pkg syscall (linux-386-cgo), const TIOCSERGETLSR ideal-int +pkg syscall (linux-386-cgo), const TIOCSERGETMULTI ideal-int +pkg syscall (linux-386-cgo), const TIOCSERGSTRUCT ideal-int +pkg syscall (linux-386-cgo), const TIOCSERGWILD ideal-int +pkg syscall (linux-386-cgo), const TIOCSERSETMULTI ideal-int +pkg syscall (linux-386-cgo), const TIOCSERSWILD ideal-int +pkg syscall (linux-386-cgo), const TIOCSER_TEMT ideal-int +pkg syscall (linux-386-cgo), const TIOCSETD ideal-int +pkg syscall (linux-386-cgo), const TIOCSIG ideal-int +pkg syscall (linux-386-cgo), const TIOCSLCKTRMIOS ideal-int +pkg syscall (linux-386-cgo), const TIOCSPGRP ideal-int +pkg syscall (linux-386-cgo), const TIOCSPTLCK ideal-int +pkg syscall (linux-386-cgo), const TIOCSRS485 ideal-int +pkg syscall (linux-386-cgo), const TIOCSSERIAL ideal-int +pkg syscall (linux-386-cgo), const TIOCSSOFTCAR ideal-int +pkg syscall (linux-386-cgo), const TIOCSTI ideal-int +pkg syscall (linux-386-cgo), const TIOCSWINSZ ideal-int +pkg syscall (linux-386-cgo), const TOSTOP ideal-int +pkg syscall (linux-386-cgo), const TUNATTACHFILTER ideal-int +pkg syscall (linux-386-cgo), const TUNDETACHFILTER ideal-int +pkg syscall (linux-386-cgo), const TUNGETFEATURES ideal-int +pkg syscall (linux-386-cgo), const TUNGETIFF ideal-int +pkg syscall (linux-386-cgo), const TUNGETSNDBUF ideal-int +pkg syscall (linux-386-cgo), const TUNGETVNETHDRSZ ideal-int +pkg syscall (linux-386-cgo), const TUNSETDEBUG ideal-int +pkg syscall (linux-386-cgo), const TUNSETGROUP ideal-int +pkg syscall (linux-386-cgo), const TUNSETIFF ideal-int +pkg syscall (linux-386-cgo), const TUNSETLINK ideal-int +pkg syscall (linux-386-cgo), const TUNSETNOCSUM ideal-int +pkg syscall (linux-386-cgo), const TUNSETOFFLOAD ideal-int +pkg syscall (linux-386-cgo), const TUNSETOWNER ideal-int +pkg syscall (linux-386-cgo), const TUNSETPERSIST ideal-int +pkg syscall (linux-386-cgo), const TUNSETSNDBUF ideal-int +pkg syscall (linux-386-cgo), const TUNSETTXFILTER ideal-int +pkg syscall (linux-386-cgo), const TUNSETVNETHDRSZ ideal-int +pkg syscall (linux-386-cgo), const VDISCARD ideal-int +pkg syscall (linux-386-cgo), const VEOF ideal-int +pkg syscall (linux-386-cgo), const VEOL ideal-int +pkg syscall (linux-386-cgo), const VEOL2 ideal-int +pkg syscall (linux-386-cgo), const VERASE ideal-int +pkg syscall (linux-386-cgo), const VINTR ideal-int +pkg syscall (linux-386-cgo), const VKILL ideal-int +pkg syscall (linux-386-cgo), const VLNEXT ideal-int +pkg syscall (linux-386-cgo), const VMIN ideal-int +pkg syscall (linux-386-cgo), const VQUIT ideal-int +pkg syscall (linux-386-cgo), const VREPRINT ideal-int +pkg syscall (linux-386-cgo), const VSTART ideal-int +pkg syscall (linux-386-cgo), const VSTOP ideal-int +pkg syscall (linux-386-cgo), const VSUSP ideal-int +pkg syscall (linux-386-cgo), const VSWTC ideal-int +pkg syscall (linux-386-cgo), const VTIME ideal-int +pkg syscall (linux-386-cgo), const VWERASE ideal-int +pkg syscall (linux-386-cgo), const WALL ideal-int +pkg syscall (linux-386-cgo), const WCLONE ideal-int +pkg syscall (linux-386-cgo), const WCONTINUED ideal-int +pkg syscall (linux-386-cgo), const WEXITED ideal-int +pkg syscall (linux-386-cgo), const WNOHANG ideal-int +pkg syscall (linux-386-cgo), const WNOTHREAD ideal-int +pkg syscall (linux-386-cgo), const WNOWAIT ideal-int +pkg syscall (linux-386-cgo), const WORDSIZE ideal-int +pkg syscall (linux-386-cgo), const WSTOPPED ideal-int +pkg syscall (linux-386-cgo), const WUNTRACED ideal-int +pkg syscall (linux-386-cgo), const XCASE ideal-int +pkg syscall (linux-386-cgo), func Accept(int) (int, Sockaddr, error) +pkg syscall (linux-386-cgo), func Access(string, uint32) error +pkg syscall (linux-386-cgo), func Acct(string) error +pkg syscall (linux-386-cgo), func Adjtimex(*Timex) (int, error) +pkg syscall (linux-386-cgo), func AttachLsf(int, []SockFilter) error +pkg syscall (linux-386-cgo), func Bind(int, Sockaddr) error +pkg syscall (linux-386-cgo), func BindToDevice(int, string) error +pkg syscall (linux-386-cgo), func Chroot(string) error +pkg syscall (linux-386-cgo), func Close(int) error +pkg syscall (linux-386-cgo), func CloseOnExec(int) +pkg syscall (linux-386-cgo), func CmsgLen(int) int +pkg syscall (linux-386-cgo), func CmsgSpace(int) int +pkg syscall (linux-386-cgo), func Connect(int, Sockaddr) error +pkg syscall (linux-386-cgo), func Creat(string, uint32) (int, error) +pkg syscall (linux-386-cgo), func DetachLsf(int) error +pkg syscall (linux-386-cgo), func Dup(int) (int, error) +pkg syscall (linux-386-cgo), func Dup2(int, int) error +pkg syscall (linux-386-cgo), func EpollCreate(int) (int, error) +pkg syscall (linux-386-cgo), func EpollCreate1(int) (int, error) +pkg syscall (linux-386-cgo), func EpollCtl(int, int, int, *EpollEvent) error +pkg syscall (linux-386-cgo), func EpollWait(int, []EpollEvent, int) (int, error) +pkg syscall (linux-386-cgo), func Faccessat(int, string, uint32, int) error +pkg syscall (linux-386-cgo), func Fallocate(int, uint32, int64, int64) error +pkg syscall (linux-386-cgo), func Fchdir(int) error +pkg syscall (linux-386-cgo), func Fchmod(int, uint32) error +pkg syscall (linux-386-cgo), func Fchmodat(int, string, uint32, int) error +pkg syscall (linux-386-cgo), func Fchown(int, int, int) error +pkg syscall (linux-386-cgo), func Fchownat(int, string, int, int, int) error +pkg syscall (linux-386-cgo), func Fdatasync(int) error +pkg syscall (linux-386-cgo), func Flock(int, int) error +pkg syscall (linux-386-cgo), func ForkExec(string, []string, *ProcAttr) (int, error) +pkg syscall (linux-386-cgo), func Fstat(int, *Stat_t) error +pkg syscall (linux-386-cgo), func Fstatfs(int, *Statfs_t) error +pkg syscall (linux-386-cgo), func Fsync(int) error +pkg syscall (linux-386-cgo), func Ftruncate(int, int64) error +pkg syscall (linux-386-cgo), func Futimes(int, []Timeval) error +pkg syscall (linux-386-cgo), func Futimesat(int, string, []Timeval) error +pkg syscall (linux-386-cgo), func Getcwd([]uint8) (int, error) +pkg syscall (linux-386-cgo), func Getdents(int, []uint8) (int, error) +pkg syscall (linux-386-cgo), func Getpeername(int) (Sockaddr, error) +pkg syscall (linux-386-cgo), func Getpgid(int) (int, error) +pkg syscall (linux-386-cgo), func Getpgrp() int +pkg syscall (linux-386-cgo), func Getrlimit(int, *Rlimit) error +pkg syscall (linux-386-cgo), func Getrusage(int, *Rusage) error +pkg syscall (linux-386-cgo), func Getsockname(int) (Sockaddr, error) +pkg syscall (linux-386-cgo), func GetsockoptIPMreq(int, int, int) (*IPMreq, error) +pkg syscall (linux-386-cgo), func GetsockoptIPMreqn(int, int, int) (*IPMreqn, error) +pkg syscall (linux-386-cgo), func GetsockoptIPv6Mreq(int, int, int) (*IPv6Mreq, error) +pkg syscall (linux-386-cgo), func GetsockoptInet4Addr(int, int, int) ([4]uint8, error) +pkg syscall (linux-386-cgo), func GetsockoptInt(int, int, int) (int, error) +pkg syscall (linux-386-cgo), func Gettid() int +pkg syscall (linux-386-cgo), func InotifyAddWatch(int, string, uint32) (int, error) +pkg syscall (linux-386-cgo), func InotifyInit() (int, error) +pkg syscall (linux-386-cgo), func InotifyInit1(int) (int, error) +pkg syscall (linux-386-cgo), func InotifyRmWatch(int, uint32) (int, error) +pkg syscall (linux-386-cgo), func Ioperm(int, int, int) error +pkg syscall (linux-386-cgo), func Iopl(int) error +pkg syscall (linux-386-cgo), func Kill(int, Signal) error +pkg syscall (linux-386-cgo), func Klogctl(int, []uint8) (int, error) +pkg syscall (linux-386-cgo), func Listen(int, int) error +pkg syscall (linux-386-cgo), func LsfJump(int, int, int, int) *SockFilter +pkg syscall (linux-386-cgo), func LsfSocket(int, int) (int, error) +pkg syscall (linux-386-cgo), func LsfStmt(int, int) *SockFilter +pkg syscall (linux-386-cgo), func Lstat(string, *Stat_t) error +pkg syscall (linux-386-cgo), func Madvise([]uint8, int) error +pkg syscall (linux-386-cgo), func Mkdirat(int, string, uint32) error +pkg syscall (linux-386-cgo), func Mkfifo(string, uint32) error +pkg syscall (linux-386-cgo), func Mknod(string, uint32, int) error +pkg syscall (linux-386-cgo), func Mknodat(int, string, uint32, int) error +pkg syscall (linux-386-cgo), func Mlock([]uint8) error +pkg syscall (linux-386-cgo), func Mlockall(int) error +pkg syscall (linux-386-cgo), func Mmap(int, int64, int, int, int) ([]uint8, error) +pkg syscall (linux-386-cgo), func Mount(string, string, string, uintptr, string) error +pkg syscall (linux-386-cgo), func Mprotect([]uint8, int) error +pkg syscall (linux-386-cgo), func Munlock([]uint8) error +pkg syscall (linux-386-cgo), func Munlockall() error +pkg syscall (linux-386-cgo), func Munmap([]uint8) error +pkg syscall (linux-386-cgo), func Nanosleep(*Timespec, *Timespec) error +pkg syscall (linux-386-cgo), func NetlinkRIB(int, int) ([]uint8, error) +pkg syscall (linux-386-cgo), func NsecToTimespec(int64) Timespec +pkg syscall (linux-386-cgo), func Open(string, int, uint32) (int, error) +pkg syscall (linux-386-cgo), func Openat(int, string, int, uint32) (int, error) +pkg syscall (linux-386-cgo), func ParseDirent([]uint8, int, []string) (int, int, []string) +pkg syscall (linux-386-cgo), func ParseNetlinkMessage([]uint8) ([]NetlinkMessage, error) +pkg syscall (linux-386-cgo), func ParseNetlinkRouteAttr(*NetlinkMessage) ([]NetlinkRouteAttr, error) +pkg syscall (linux-386-cgo), func ParseSocketControlMessage([]uint8) ([]SocketControlMessage, error) +pkg syscall (linux-386-cgo), func ParseUnixCredentials(*SocketControlMessage) (*Ucred, error) +pkg syscall (linux-386-cgo), func ParseUnixRights(*SocketControlMessage) ([]int, error) +pkg syscall (linux-386-cgo), func Pause() error +pkg syscall (linux-386-cgo), func Pipe([]int) error +pkg syscall (linux-386-cgo), func PivotRoot(string, string) error +pkg syscall (linux-386-cgo), func Pread(int, []uint8, int64) (int, error) +pkg syscall (linux-386-cgo), func PtraceAttach(int) error +pkg syscall (linux-386-cgo), func PtraceCont(int, int) error +pkg syscall (linux-386-cgo), func PtraceDetach(int) error +pkg syscall (linux-386-cgo), func PtraceGetEventMsg(int) (uint, error) +pkg syscall (linux-386-cgo), func PtraceGetRegs(int, *PtraceRegs) error +pkg syscall (linux-386-cgo), func PtracePeekData(int, uintptr, []uint8) (int, error) +pkg syscall (linux-386-cgo), func PtracePeekText(int, uintptr, []uint8) (int, error) +pkg syscall (linux-386-cgo), func PtracePokeData(int, uintptr, []uint8) (int, error) +pkg syscall (linux-386-cgo), func PtracePokeText(int, uintptr, []uint8) (int, error) +pkg syscall (linux-386-cgo), func PtraceSetOptions(int, int) error +pkg syscall (linux-386-cgo), func PtraceSetRegs(int, *PtraceRegs) error +pkg syscall (linux-386-cgo), func PtraceSingleStep(int) error +pkg syscall (linux-386-cgo), func Pwrite(int, []uint8, int64) (int, error) +pkg syscall (linux-386-cgo), func RawSyscall(uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno) +pkg syscall (linux-386-cgo), func RawSyscall6(uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno) +pkg syscall (linux-386-cgo), func Read(int, []uint8) (int, error) +pkg syscall (linux-386-cgo), func ReadDirent(int, []uint8) (int, error) +pkg syscall (linux-386-cgo), func Reboot(int) error +pkg syscall (linux-386-cgo), func Recvfrom(int, []uint8, int) (int, Sockaddr, error) +pkg syscall (linux-386-cgo), func Recvmsg(int, []uint8, []uint8, int) (int, int, int, Sockaddr, error) +pkg syscall (linux-386-cgo), func Renameat(int, string, int, string) error +pkg syscall (linux-386-cgo), func Seek(int, int64, int) (int64, error) +pkg syscall (linux-386-cgo), func Select(int, *FdSet, *FdSet, *FdSet, *Timeval) (int, error) +pkg syscall (linux-386-cgo), func Sendfile(int, int, *int64, int) (int, error) +pkg syscall (linux-386-cgo), func Sendmsg(int, []uint8, []uint8, Sockaddr, int) error +pkg syscall (linux-386-cgo), func Sendto(int, []uint8, int, Sockaddr) error +pkg syscall (linux-386-cgo), func SetLsfPromisc(string, bool) error +pkg syscall (linux-386-cgo), func SetNonblock(int, bool) error +pkg syscall (linux-386-cgo), func Setdomainname([]uint8) error +pkg syscall (linux-386-cgo), func Setfsgid(int) error +pkg syscall (linux-386-cgo), func Setfsuid(int) error +pkg syscall (linux-386-cgo), func Setgid(int) error +pkg syscall (linux-386-cgo), func Setgroups([]int) error +pkg syscall (linux-386-cgo), func Sethostname([]uint8) error +pkg syscall (linux-386-cgo), func Setpgid(int, int) error +pkg syscall (linux-386-cgo), func Setregid(int, int) error +pkg syscall (linux-386-cgo), func Setresgid(int, int, int) error +pkg syscall (linux-386-cgo), func Setresuid(int, int, int) error +pkg syscall (linux-386-cgo), func Setreuid(int, int) error +pkg syscall (linux-386-cgo), func Setrlimit(int, *Rlimit) error +pkg syscall (linux-386-cgo), func Setsid() (int, error) +pkg syscall (linux-386-cgo), func SetsockoptIPMreq(int, int, int, *IPMreq) error +pkg syscall (linux-386-cgo), func SetsockoptIPMreqn(int, int, int, *IPMreqn) error +pkg syscall (linux-386-cgo), func SetsockoptIPv6Mreq(int, int, int, *IPv6Mreq) error +pkg syscall (linux-386-cgo), func SetsockoptInet4Addr(int, int, int, [4]uint8) error +pkg syscall (linux-386-cgo), func SetsockoptInt(int, int, int, int) error +pkg syscall (linux-386-cgo), func SetsockoptLinger(int, int, int, *Linger) error +pkg syscall (linux-386-cgo), func SetsockoptString(int, int, int, string) error +pkg syscall (linux-386-cgo), func SetsockoptTimeval(int, int, int, *Timeval) error +pkg syscall (linux-386-cgo), func Settimeofday(*Timeval) error +pkg syscall (linux-386-cgo), func Setuid(int) error +pkg syscall (linux-386-cgo), func Shutdown(int, int) error +pkg syscall (linux-386-cgo), func Socket(int, int, int) (int, error) +pkg syscall (linux-386-cgo), func Socketpair(int, int, int) ([2]int, error) +pkg syscall (linux-386-cgo), func Splice(int, *int64, int, *int64, int, int) (int, error) +pkg syscall (linux-386-cgo), func Stat(string, *Stat_t) error +pkg syscall (linux-386-cgo), func Statfs(string, *Statfs_t) error +pkg syscall (linux-386-cgo), func StringSlicePtr([]string) []*uint8 +pkg syscall (linux-386-cgo), func Sync() +pkg syscall (linux-386-cgo), func SyncFileRange(int, int64, int64, int) error +pkg syscall (linux-386-cgo), func Syscall(uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno) +pkg syscall (linux-386-cgo), func Syscall6(uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno) +pkg syscall (linux-386-cgo), func Sysinfo(*Sysinfo_t) error +pkg syscall (linux-386-cgo), func Tee(int, int, int, int) (int64, error) +pkg syscall (linux-386-cgo), func Tgkill(int, int, Signal) error +pkg syscall (linux-386-cgo), func Time(*Time_t) (Time_t, error) +pkg syscall (linux-386-cgo), func Times(*Tms) (uintptr, error) +pkg syscall (linux-386-cgo), func TimespecToNsec(Timespec) int64 +pkg syscall (linux-386-cgo), func TimevalToNsec(Timeval) int64 +pkg syscall (linux-386-cgo), func Truncate(string, int64) error +pkg syscall (linux-386-cgo), func Umask(int) int +pkg syscall (linux-386-cgo), func Uname(*Utsname) error +pkg syscall (linux-386-cgo), func UnixCredentials(*Ucred) []uint8 +pkg syscall (linux-386-cgo), func UnixRights(...int) []uint8 +pkg syscall (linux-386-cgo), func Unlinkat(int, string) error +pkg syscall (linux-386-cgo), func Unmount(string, int) error +pkg syscall (linux-386-cgo), func Unshare(int) error +pkg syscall (linux-386-cgo), func Ustat(int, *Ustat_t) error +pkg syscall (linux-386-cgo), func Utime(string, *Utimbuf) error +pkg syscall (linux-386-cgo), func Wait4(int, *WaitStatus, int, *Rusage) (int, error) +pkg syscall (linux-386-cgo), func Write(int, []uint8) (int, error) +pkg syscall (linux-386-cgo), method (*Cmsghdr) SetLen(int) +pkg syscall (linux-386-cgo), method (*Iovec) SetLen(int) +pkg syscall (linux-386-cgo), method (*Msghdr) SetControllen(int) +pkg syscall (linux-386-cgo), method (*PtraceRegs) PC() uint64 +pkg syscall (linux-386-cgo), method (*PtraceRegs) SetPC(uint64) +pkg syscall (linux-386-cgo), type Cmsghdr struct +pkg syscall (linux-386-cgo), type Cmsghdr struct, Len uint32 +pkg syscall (linux-386-cgo), type Cmsghdr struct, Level int32 +pkg syscall (linux-386-cgo), type Cmsghdr struct, Type int32 +pkg syscall (linux-386-cgo), type Cmsghdr struct, X__cmsg_data [0]uint8 +pkg syscall (linux-386-cgo), type Credential struct +pkg syscall (linux-386-cgo), type Credential struct, Gid uint32 +pkg syscall (linux-386-cgo), type Credential struct, Groups []uint32 +pkg syscall (linux-386-cgo), type Credential struct, Uid uint32 +pkg syscall (linux-386-cgo), type Dirent struct +pkg syscall (linux-386-cgo), type Dirent struct, Ino uint64 +pkg syscall (linux-386-cgo), type Dirent struct, Name [256]int8 +pkg syscall (linux-386-cgo), type Dirent struct, Off int64 +pkg syscall (linux-386-cgo), type Dirent struct, Pad_cgo_0 [1]uint8 +pkg syscall (linux-386-cgo), type Dirent struct, Reclen uint16 +pkg syscall (linux-386-cgo), type Dirent struct, Type uint8 +pkg syscall (linux-386-cgo), type EpollEvent struct +pkg syscall (linux-386-cgo), type EpollEvent struct, Events uint32 +pkg syscall (linux-386-cgo), type EpollEvent struct, Fd int32 +pkg syscall (linux-386-cgo), type EpollEvent struct, Pad int32 +pkg syscall (linux-386-cgo), type FdSet struct +pkg syscall (linux-386-cgo), type FdSet struct, Bits [32]int32 +pkg syscall (linux-386-cgo), type Fsid struct +pkg syscall (linux-386-cgo), type Fsid struct, X__val [2]int32 +pkg syscall (linux-386-cgo), type IPMreqn struct +pkg syscall (linux-386-cgo), type IPMreqn struct, Address [4]uint8 +pkg syscall (linux-386-cgo), type IPMreqn struct, Ifindex int32 +pkg syscall (linux-386-cgo), type IPMreqn struct, Multiaddr [4]uint8 +pkg syscall (linux-386-cgo), type IfAddrmsg struct +pkg syscall (linux-386-cgo), type IfAddrmsg struct, Family uint8 +pkg syscall (linux-386-cgo), type IfAddrmsg struct, Flags uint8 +pkg syscall (linux-386-cgo), type IfAddrmsg struct, Index uint32 +pkg syscall (linux-386-cgo), type IfAddrmsg struct, Prefixlen uint8 +pkg syscall (linux-386-cgo), type IfAddrmsg struct, Scope uint8 +pkg syscall (linux-386-cgo), type IfInfomsg struct +pkg syscall (linux-386-cgo), type IfInfomsg struct, Change uint32 +pkg syscall (linux-386-cgo), type IfInfomsg struct, Family uint8 +pkg syscall (linux-386-cgo), type IfInfomsg struct, Flags uint32 +pkg syscall (linux-386-cgo), type IfInfomsg struct, Index int32 +pkg syscall (linux-386-cgo), type IfInfomsg struct, Type uint16 +pkg syscall (linux-386-cgo), type IfInfomsg struct, X__ifi_pad uint8 +pkg syscall (linux-386-cgo), type Inet4Pktinfo struct +pkg syscall (linux-386-cgo), type Inet4Pktinfo struct, Addr [4]uint8 +pkg syscall (linux-386-cgo), type Inet4Pktinfo struct, Ifindex int32 +pkg syscall (linux-386-cgo), type Inet4Pktinfo struct, Spec_dst [4]uint8 +pkg syscall (linux-386-cgo), type Inet6Pktinfo struct +pkg syscall (linux-386-cgo), type Inet6Pktinfo struct, Addr [16]uint8 +pkg syscall (linux-386-cgo), type Inet6Pktinfo struct, Ifindex uint32 +pkg syscall (linux-386-cgo), type InotifyEvent struct +pkg syscall (linux-386-cgo), type InotifyEvent struct, Cookie uint32 +pkg syscall (linux-386-cgo), type InotifyEvent struct, Len uint32 +pkg syscall (linux-386-cgo), type InotifyEvent struct, Mask uint32 +pkg syscall (linux-386-cgo), type InotifyEvent struct, Name [0]uint8 +pkg syscall (linux-386-cgo), type InotifyEvent struct, Wd int32 +pkg syscall (linux-386-cgo), type Iovec struct +pkg syscall (linux-386-cgo), type Iovec struct, Base *uint8 +pkg syscall (linux-386-cgo), type Iovec struct, Len uint32 +pkg syscall (linux-386-cgo), type Msghdr struct +pkg syscall (linux-386-cgo), type Msghdr struct, Control *uint8 +pkg syscall (linux-386-cgo), type Msghdr struct, Controllen uint32 +pkg syscall (linux-386-cgo), type Msghdr struct, Flags int32 +pkg syscall (linux-386-cgo), type Msghdr struct, Iov *Iovec +pkg syscall (linux-386-cgo), type Msghdr struct, Iovlen uint32 +pkg syscall (linux-386-cgo), type Msghdr struct, Name *uint8 +pkg syscall (linux-386-cgo), type Msghdr struct, Namelen uint32 +pkg syscall (linux-386-cgo), type NetlinkMessage struct +pkg syscall (linux-386-cgo), type NetlinkMessage struct, Data []uint8 +pkg syscall (linux-386-cgo), type NetlinkMessage struct, Header NlMsghdr +pkg syscall (linux-386-cgo), type NetlinkRouteAttr struct +pkg syscall (linux-386-cgo), type NetlinkRouteAttr struct, Attr RtAttr +pkg syscall (linux-386-cgo), type NetlinkRouteAttr struct, Value []uint8 +pkg syscall (linux-386-cgo), type NetlinkRouteRequest struct +pkg syscall (linux-386-cgo), type NetlinkRouteRequest struct, Data RtGenmsg +pkg syscall (linux-386-cgo), type NetlinkRouteRequest struct, Header NlMsghdr +pkg syscall (linux-386-cgo), type NlAttr struct +pkg syscall (linux-386-cgo), type NlAttr struct, Len uint16 +pkg syscall (linux-386-cgo), type NlAttr struct, Type uint16 +pkg syscall (linux-386-cgo), type NlMsgerr struct +pkg syscall (linux-386-cgo), type NlMsgerr struct, Error int32 +pkg syscall (linux-386-cgo), type NlMsgerr struct, Msg NlMsghdr +pkg syscall (linux-386-cgo), type NlMsghdr struct +pkg syscall (linux-386-cgo), type NlMsghdr struct, Flags uint16 +pkg syscall (linux-386-cgo), type NlMsghdr struct, Len uint32 +pkg syscall (linux-386-cgo), type NlMsghdr struct, Pid uint32 +pkg syscall (linux-386-cgo), type NlMsghdr struct, Seq uint32 +pkg syscall (linux-386-cgo), type NlMsghdr struct, Type uint16 +pkg syscall (linux-386-cgo), type PtraceRegs struct +pkg syscall (linux-386-cgo), type PtraceRegs struct, Eax int32 +pkg syscall (linux-386-cgo), type PtraceRegs struct, Ebp int32 +pkg syscall (linux-386-cgo), type PtraceRegs struct, Ebx int32 +pkg syscall (linux-386-cgo), type PtraceRegs struct, Ecx int32 +pkg syscall (linux-386-cgo), type PtraceRegs struct, Edi int32 +pkg syscall (linux-386-cgo), type PtraceRegs struct, Edx int32 +pkg syscall (linux-386-cgo), type PtraceRegs struct, Eflags int32 +pkg syscall (linux-386-cgo), type PtraceRegs struct, Eip int32 +pkg syscall (linux-386-cgo), type PtraceRegs struct, Esi int32 +pkg syscall (linux-386-cgo), type PtraceRegs struct, Esp int32 +pkg syscall (linux-386-cgo), type PtraceRegs struct, Orig_eax int32 +pkg syscall (linux-386-cgo), type PtraceRegs struct, Xcs int32 +pkg syscall (linux-386-cgo), type PtraceRegs struct, Xds int32 +pkg syscall (linux-386-cgo), type PtraceRegs struct, Xes int32 +pkg syscall (linux-386-cgo), type PtraceRegs struct, Xfs int32 +pkg syscall (linux-386-cgo), type PtraceRegs struct, Xgs int32 +pkg syscall (linux-386-cgo), type PtraceRegs struct, Xss int32 +pkg syscall (linux-386-cgo), type RawSockaddr struct, Data [14]int8 +pkg syscall (linux-386-cgo), type RawSockaddr struct, Family uint16 +pkg syscall (linux-386-cgo), type RawSockaddrAny struct, Pad [96]int8 +pkg syscall (linux-386-cgo), type RawSockaddrInet4 struct, Family uint16 +pkg syscall (linux-386-cgo), type RawSockaddrInet4 struct, Zero [8]uint8 +pkg syscall (linux-386-cgo), type RawSockaddrInet6 struct +pkg syscall (linux-386-cgo), type RawSockaddrInet6 struct, Addr [16]uint8 +pkg syscall (linux-386-cgo), type RawSockaddrInet6 struct, Family uint16 +pkg syscall (linux-386-cgo), type RawSockaddrInet6 struct, Flowinfo uint32 +pkg syscall (linux-386-cgo), type RawSockaddrInet6 struct, Port uint16 +pkg syscall (linux-386-cgo), type RawSockaddrInet6 struct, Scope_id uint32 +pkg syscall (linux-386-cgo), type RawSockaddrLinklayer struct +pkg syscall (linux-386-cgo), type RawSockaddrLinklayer struct, Addr [8]uint8 +pkg syscall (linux-386-cgo), type RawSockaddrLinklayer struct, Family uint16 +pkg syscall (linux-386-cgo), type RawSockaddrLinklayer struct, Halen uint8 +pkg syscall (linux-386-cgo), type RawSockaddrLinklayer struct, Hatype uint16 +pkg syscall (linux-386-cgo), type RawSockaddrLinklayer struct, Ifindex int32 +pkg syscall (linux-386-cgo), type RawSockaddrLinklayer struct, Pkttype uint8 +pkg syscall (linux-386-cgo), type RawSockaddrLinklayer struct, Protocol uint16 +pkg syscall (linux-386-cgo), type RawSockaddrNetlink struct +pkg syscall (linux-386-cgo), type RawSockaddrNetlink struct, Family uint16 +pkg syscall (linux-386-cgo), type RawSockaddrNetlink struct, Groups uint32 +pkg syscall (linux-386-cgo), type RawSockaddrNetlink struct, Pad uint16 +pkg syscall (linux-386-cgo), type RawSockaddrNetlink struct, Pid uint32 +pkg syscall (linux-386-cgo), type RawSockaddrUnix struct +pkg syscall (linux-386-cgo), type RawSockaddrUnix struct, Family uint16 +pkg syscall (linux-386-cgo), type RawSockaddrUnix struct, Path [108]int8 +pkg syscall (linux-386-cgo), type Rlimit struct +pkg syscall (linux-386-cgo), type Rlimit struct, Cur uint64 +pkg syscall (linux-386-cgo), type Rlimit struct, Max uint64 +pkg syscall (linux-386-cgo), type RtAttr struct +pkg syscall (linux-386-cgo), type RtAttr struct, Len uint16 +pkg syscall (linux-386-cgo), type RtAttr struct, Type uint16 +pkg syscall (linux-386-cgo), type RtGenmsg struct +pkg syscall (linux-386-cgo), type RtGenmsg struct, Family uint8 +pkg syscall (linux-386-cgo), type RtMsg struct +pkg syscall (linux-386-cgo), type RtMsg struct, Dst_len uint8 +pkg syscall (linux-386-cgo), type RtMsg struct, Family uint8 +pkg syscall (linux-386-cgo), type RtMsg struct, Flags uint32 +pkg syscall (linux-386-cgo), type RtMsg struct, Protocol uint8 +pkg syscall (linux-386-cgo), type RtMsg struct, Scope uint8 +pkg syscall (linux-386-cgo), type RtMsg struct, Src_len uint8 +pkg syscall (linux-386-cgo), type RtMsg struct, Table uint8 +pkg syscall (linux-386-cgo), type RtMsg struct, Tos uint8 +pkg syscall (linux-386-cgo), type RtMsg struct, Type uint8 +pkg syscall (linux-386-cgo), type RtNexthop struct +pkg syscall (linux-386-cgo), type RtNexthop struct, Flags uint8 +pkg syscall (linux-386-cgo), type RtNexthop struct, Hops uint8 +pkg syscall (linux-386-cgo), type RtNexthop struct, Ifindex int32 +pkg syscall (linux-386-cgo), type RtNexthop struct, Len uint16 +pkg syscall (linux-386-cgo), type Rusage struct, Idrss int32 +pkg syscall (linux-386-cgo), type Rusage struct, Inblock int32 +pkg syscall (linux-386-cgo), type Rusage struct, Isrss int32 +pkg syscall (linux-386-cgo), type Rusage struct, Ixrss int32 +pkg syscall (linux-386-cgo), type Rusage struct, Majflt int32 +pkg syscall (linux-386-cgo), type Rusage struct, Maxrss int32 +pkg syscall (linux-386-cgo), type Rusage struct, Minflt int32 +pkg syscall (linux-386-cgo), type Rusage struct, Msgrcv int32 +pkg syscall (linux-386-cgo), type Rusage struct, Msgsnd int32 +pkg syscall (linux-386-cgo), type Rusage struct, Nivcsw int32 +pkg syscall (linux-386-cgo), type Rusage struct, Nsignals int32 +pkg syscall (linux-386-cgo), type Rusage struct, Nswap int32 +pkg syscall (linux-386-cgo), type Rusage struct, Nvcsw int32 +pkg syscall (linux-386-cgo), type Rusage struct, Oublock int32 +pkg syscall (linux-386-cgo), type Rusage struct, Stime Timeval +pkg syscall (linux-386-cgo), type Rusage struct, Utime Timeval +pkg syscall (linux-386-cgo), type SockFilter struct +pkg syscall (linux-386-cgo), type SockFilter struct, Code uint16 +pkg syscall (linux-386-cgo), type SockFilter struct, Jf uint8 +pkg syscall (linux-386-cgo), type SockFilter struct, Jt uint8 +pkg syscall (linux-386-cgo), type SockFilter struct, K uint32 +pkg syscall (linux-386-cgo), type SockFprog struct +pkg syscall (linux-386-cgo), type SockFprog struct, Filter *SockFilter +pkg syscall (linux-386-cgo), type SockFprog struct, Len uint16 +pkg syscall (linux-386-cgo), type SockFprog struct, Pad_cgo_0 [2]uint8 +pkg syscall (linux-386-cgo), type SockaddrLinklayer struct +pkg syscall (linux-386-cgo), type SockaddrLinklayer struct, Addr [8]uint8 +pkg syscall (linux-386-cgo), type SockaddrLinklayer struct, Halen uint8 +pkg syscall (linux-386-cgo), type SockaddrLinklayer struct, Hatype uint16 +pkg syscall (linux-386-cgo), type SockaddrLinklayer struct, Ifindex int +pkg syscall (linux-386-cgo), type SockaddrLinklayer struct, Pkttype uint8 +pkg syscall (linux-386-cgo), type SockaddrLinklayer struct, Protocol uint16 +pkg syscall (linux-386-cgo), type SockaddrNetlink struct +pkg syscall (linux-386-cgo), type SockaddrNetlink struct, Family uint16 +pkg syscall (linux-386-cgo), type SockaddrNetlink struct, Groups uint32 +pkg syscall (linux-386-cgo), type SockaddrNetlink struct, Pad uint16 +pkg syscall (linux-386-cgo), type SockaddrNetlink struct, Pid uint32 +pkg syscall (linux-386-cgo), type SocketControlMessage struct +pkg syscall (linux-386-cgo), type SocketControlMessage struct, Data []uint8 +pkg syscall (linux-386-cgo), type SocketControlMessage struct, Header Cmsghdr +pkg syscall (linux-386-cgo), type Stat_t struct +pkg syscall (linux-386-cgo), type Stat_t struct, Atim Timespec +pkg syscall (linux-386-cgo), type Stat_t struct, Blksize int32 +pkg syscall (linux-386-cgo), type Stat_t struct, Blocks int64 +pkg syscall (linux-386-cgo), type Stat_t struct, Ctim Timespec +pkg syscall (linux-386-cgo), type Stat_t struct, Dev uint64 +pkg syscall (linux-386-cgo), type Stat_t struct, Gid uint32 +pkg syscall (linux-386-cgo), type Stat_t struct, Ino uint64 +pkg syscall (linux-386-cgo), type Stat_t struct, Mode uint32 +pkg syscall (linux-386-cgo), type Stat_t struct, Mtim Timespec +pkg syscall (linux-386-cgo), type Stat_t struct, Nlink uint32 +pkg syscall (linux-386-cgo), type Stat_t struct, Pad_cgo_0 [2]uint8 +pkg syscall (linux-386-cgo), type Stat_t struct, Pad_cgo_1 [2]uint8 +pkg syscall (linux-386-cgo), type Stat_t struct, Rdev uint64 +pkg syscall (linux-386-cgo), type Stat_t struct, Size int64 +pkg syscall (linux-386-cgo), type Stat_t struct, Uid uint32 +pkg syscall (linux-386-cgo), type Stat_t struct, X__pad1 uint16 +pkg syscall (linux-386-cgo), type Stat_t struct, X__pad2 uint16 +pkg syscall (linux-386-cgo), type Stat_t struct, X__st_ino uint32 +pkg syscall (linux-386-cgo), type Statfs_t struct +pkg syscall (linux-386-cgo), type Statfs_t struct, Bavail uint64 +pkg syscall (linux-386-cgo), type Statfs_t struct, Bfree uint64 +pkg syscall (linux-386-cgo), type Statfs_t struct, Blocks uint64 +pkg syscall (linux-386-cgo), type Statfs_t struct, Bsize int32 +pkg syscall (linux-386-cgo), type Statfs_t struct, Ffree uint64 +pkg syscall (linux-386-cgo), type Statfs_t struct, Files uint64 +pkg syscall (linux-386-cgo), type Statfs_t struct, Flags int32 +pkg syscall (linux-386-cgo), type Statfs_t struct, Frsize int32 +pkg syscall (linux-386-cgo), type Statfs_t struct, Fsid Fsid +pkg syscall (linux-386-cgo), type Statfs_t struct, Namelen int32 +pkg syscall (linux-386-cgo), type Statfs_t struct, Spare [4]int32 +pkg syscall (linux-386-cgo), type Statfs_t struct, Type int32 +pkg syscall (linux-386-cgo), type SysProcAttr struct, Chroot string +pkg syscall (linux-386-cgo), type SysProcAttr struct, Credential *Credential +pkg syscall (linux-386-cgo), type SysProcAttr struct, Noctty bool +pkg syscall (linux-386-cgo), type SysProcAttr struct, Pdeathsig Signal +pkg syscall (linux-386-cgo), type SysProcAttr struct, Ptrace bool +pkg syscall (linux-386-cgo), type SysProcAttr struct, Setctty bool +pkg syscall (linux-386-cgo), type SysProcAttr struct, Setpgid bool +pkg syscall (linux-386-cgo), type SysProcAttr struct, Setsid bool +pkg syscall (linux-386-cgo), type Sysinfo_t struct +pkg syscall (linux-386-cgo), type Sysinfo_t struct, Bufferram uint32 +pkg syscall (linux-386-cgo), type Sysinfo_t struct, Freehigh uint32 +pkg syscall (linux-386-cgo), type Sysinfo_t struct, Freeram uint32 +pkg syscall (linux-386-cgo), type Sysinfo_t struct, Freeswap uint32 +pkg syscall (linux-386-cgo), type Sysinfo_t struct, Loads [3]uint32 +pkg syscall (linux-386-cgo), type Sysinfo_t struct, Pad uint16 +pkg syscall (linux-386-cgo), type Sysinfo_t struct, Procs uint16 +pkg syscall (linux-386-cgo), type Sysinfo_t struct, Sharedram uint32 +pkg syscall (linux-386-cgo), type Sysinfo_t struct, Totalhigh uint32 +pkg syscall (linux-386-cgo), type Sysinfo_t struct, Totalram uint32 +pkg syscall (linux-386-cgo), type Sysinfo_t struct, Totalswap uint32 +pkg syscall (linux-386-cgo), type Sysinfo_t struct, Unit uint32 +pkg syscall (linux-386-cgo), type Sysinfo_t struct, Uptime int32 +pkg syscall (linux-386-cgo), type Sysinfo_t struct, X_f [8]int8 +pkg syscall (linux-386-cgo), type Termios struct +pkg syscall (linux-386-cgo), type Termios struct, Cc [32]uint8 +pkg syscall (linux-386-cgo), type Termios struct, Cflag uint32 +pkg syscall (linux-386-cgo), type Termios struct, Iflag uint32 +pkg syscall (linux-386-cgo), type Termios struct, Ispeed uint32 +pkg syscall (linux-386-cgo), type Termios struct, Lflag uint32 +pkg syscall (linux-386-cgo), type Termios struct, Line uint8 +pkg syscall (linux-386-cgo), type Termios struct, Oflag uint32 +pkg syscall (linux-386-cgo), type Termios struct, Ospeed uint32 +pkg syscall (linux-386-cgo), type Termios struct, Pad_cgo_0 [3]uint8 +pkg syscall (linux-386-cgo), type Time_t int32 +pkg syscall (linux-386-cgo), type Timespec struct, Nsec int32 +pkg syscall (linux-386-cgo), type Timespec struct, Sec int32 +pkg syscall (linux-386-cgo), type Timeval struct, Sec int32 +pkg syscall (linux-386-cgo), type Timeval struct, Usec int32 +pkg syscall (linux-386-cgo), type Timex struct +pkg syscall (linux-386-cgo), type Timex struct, Calcnt int32 +pkg syscall (linux-386-cgo), type Timex struct, Constant int32 +pkg syscall (linux-386-cgo), type Timex struct, Errcnt int32 +pkg syscall (linux-386-cgo), type Timex struct, Esterror int32 +pkg syscall (linux-386-cgo), type Timex struct, Freq int32 +pkg syscall (linux-386-cgo), type Timex struct, Jitcnt int32 +pkg syscall (linux-386-cgo), type Timex struct, Jitter int32 +pkg syscall (linux-386-cgo), type Timex struct, Maxerror int32 +pkg syscall (linux-386-cgo), type Timex struct, Modes uint32 +pkg syscall (linux-386-cgo), type Timex struct, Offset int32 +pkg syscall (linux-386-cgo), type Timex struct, Pad_cgo_0 [44]uint8 +pkg syscall (linux-386-cgo), type Timex struct, Ppsfreq int32 +pkg syscall (linux-386-cgo), type Timex struct, Precision int32 +pkg syscall (linux-386-cgo), type Timex struct, Shift int32 +pkg syscall (linux-386-cgo), type Timex struct, Stabil int32 +pkg syscall (linux-386-cgo), type Timex struct, Status int32 +pkg syscall (linux-386-cgo), type Timex struct, Stbcnt int32 +pkg syscall (linux-386-cgo), type Timex struct, Tai int32 +pkg syscall (linux-386-cgo), type Timex struct, Tick int32 +pkg syscall (linux-386-cgo), type Timex struct, Time Timeval +pkg syscall (linux-386-cgo), type Timex struct, Tolerance int32 +pkg syscall (linux-386-cgo), type Tms struct +pkg syscall (linux-386-cgo), type Tms struct, Cstime int32 +pkg syscall (linux-386-cgo), type Tms struct, Cutime int32 +pkg syscall (linux-386-cgo), type Tms struct, Stime int32 +pkg syscall (linux-386-cgo), type Tms struct, Utime int32 +pkg syscall (linux-386-cgo), type Ucred struct +pkg syscall (linux-386-cgo), type Ucred struct, Gid uint32 +pkg syscall (linux-386-cgo), type Ucred struct, Pid int32 +pkg syscall (linux-386-cgo), type Ucred struct, Uid uint32 +pkg syscall (linux-386-cgo), type Ustat_t struct +pkg syscall (linux-386-cgo), type Ustat_t struct, Fname [6]int8 +pkg syscall (linux-386-cgo), type Ustat_t struct, Fpack [6]int8 +pkg syscall (linux-386-cgo), type Ustat_t struct, Tfree int32 +pkg syscall (linux-386-cgo), type Ustat_t struct, Tinode uint32 +pkg syscall (linux-386-cgo), type Utimbuf struct +pkg syscall (linux-386-cgo), type Utimbuf struct, Actime int32 +pkg syscall (linux-386-cgo), type Utimbuf struct, Modtime int32 +pkg syscall (linux-386-cgo), type Utsname struct +pkg syscall (linux-386-cgo), type Utsname struct, Domainname [65]int8 +pkg syscall (linux-386-cgo), type Utsname struct, Machine [65]int8 +pkg syscall (linux-386-cgo), type Utsname struct, Nodename [65]int8 +pkg syscall (linux-386-cgo), type Utsname struct, Release [65]int8 +pkg syscall (linux-386-cgo), type Utsname struct, Sysname [65]int8 +pkg syscall (linux-386-cgo), type Utsname struct, Version [65]int8 +pkg syscall (linux-386-cgo), type WaitStatus uint32 +pkg syscall (linux-386-cgo), var Stderr int +pkg syscall (linux-386-cgo), var Stdin int +pkg syscall (linux-386-cgo), var Stdout int +pkg syscall (linux-amd64), const AF_ALG ideal-int +pkg syscall (linux-amd64), const AF_APPLETALK ideal-int +pkg syscall (linux-amd64), const AF_ASH ideal-int +pkg syscall (linux-amd64), const AF_ATMPVC ideal-int +pkg syscall (linux-amd64), const AF_ATMSVC ideal-int +pkg syscall (linux-amd64), const AF_AX25 ideal-int +pkg syscall (linux-amd64), const AF_BLUETOOTH ideal-int +pkg syscall (linux-amd64), const AF_BRIDGE ideal-int +pkg syscall (linux-amd64), const AF_CAIF ideal-int +pkg syscall (linux-amd64), const AF_CAN ideal-int +pkg syscall (linux-amd64), const AF_DECnet ideal-int +pkg syscall (linux-amd64), const AF_ECONET ideal-int +pkg syscall (linux-amd64), const AF_FILE ideal-int +pkg syscall (linux-amd64), const AF_IEEE802154 ideal-int +pkg syscall (linux-amd64), const AF_IPX ideal-int +pkg syscall (linux-amd64), const AF_IRDA ideal-int +pkg syscall (linux-amd64), const AF_ISDN ideal-int +pkg syscall (linux-amd64), const AF_IUCV ideal-int +pkg syscall (linux-amd64), const AF_KEY ideal-int +pkg syscall (linux-amd64), const AF_LLC ideal-int +pkg syscall (linux-amd64), const AF_LOCAL ideal-int +pkg syscall (linux-amd64), const AF_MAX ideal-int +pkg syscall (linux-amd64), const AF_NETBEUI ideal-int +pkg syscall (linux-amd64), const AF_NETLINK ideal-int +pkg syscall (linux-amd64), const AF_NETROM ideal-int +pkg syscall (linux-amd64), const AF_PACKET ideal-int +pkg syscall (linux-amd64), const AF_PHONET ideal-int +pkg syscall (linux-amd64), const AF_PPPOX ideal-int +pkg syscall (linux-amd64), const AF_RDS ideal-int +pkg syscall (linux-amd64), const AF_ROSE ideal-int +pkg syscall (linux-amd64), const AF_ROUTE ideal-int +pkg syscall (linux-amd64), const AF_RXRPC ideal-int +pkg syscall (linux-amd64), const AF_SECURITY ideal-int +pkg syscall (linux-amd64), const AF_SNA ideal-int +pkg syscall (linux-amd64), const AF_TIPC ideal-int +pkg syscall (linux-amd64), const AF_WANPIPE ideal-int +pkg syscall (linux-amd64), const AF_X25 ideal-int +pkg syscall (linux-amd64), const ARPHRD_ADAPT ideal-int +pkg syscall (linux-amd64), const ARPHRD_APPLETLK ideal-int +pkg syscall (linux-amd64), const ARPHRD_ARCNET ideal-int +pkg syscall (linux-amd64), const ARPHRD_ASH ideal-int +pkg syscall (linux-amd64), const ARPHRD_ATM ideal-int +pkg syscall (linux-amd64), const ARPHRD_AX25 ideal-int +pkg syscall (linux-amd64), const ARPHRD_BIF ideal-int +pkg syscall (linux-amd64), const ARPHRD_CHAOS ideal-int +pkg syscall (linux-amd64), const ARPHRD_CISCO ideal-int +pkg syscall (linux-amd64), const ARPHRD_CSLIP ideal-int +pkg syscall (linux-amd64), const ARPHRD_CSLIP6 ideal-int +pkg syscall (linux-amd64), const ARPHRD_DDCMP ideal-int +pkg syscall (linux-amd64), const ARPHRD_DLCI ideal-int +pkg syscall (linux-amd64), const ARPHRD_ECONET ideal-int +pkg syscall (linux-amd64), const ARPHRD_EETHER ideal-int +pkg syscall (linux-amd64), const ARPHRD_ETHER ideal-int +pkg syscall (linux-amd64), const ARPHRD_EUI64 ideal-int +pkg syscall (linux-amd64), const ARPHRD_FCAL ideal-int +pkg syscall (linux-amd64), const ARPHRD_FCFABRIC ideal-int +pkg syscall (linux-amd64), const ARPHRD_FCPL ideal-int +pkg syscall (linux-amd64), const ARPHRD_FCPP ideal-int +pkg syscall (linux-amd64), const ARPHRD_FDDI ideal-int +pkg syscall (linux-amd64), const ARPHRD_FRAD ideal-int +pkg syscall (linux-amd64), const ARPHRD_HDLC ideal-int +pkg syscall (linux-amd64), const ARPHRD_HIPPI ideal-int +pkg syscall (linux-amd64), const ARPHRD_HWX25 ideal-int +pkg syscall (linux-amd64), const ARPHRD_IEEE1394 ideal-int +pkg syscall (linux-amd64), const ARPHRD_IEEE802 ideal-int +pkg syscall (linux-amd64), const ARPHRD_IEEE80211 ideal-int +pkg syscall (linux-amd64), const ARPHRD_IEEE80211_PRISM ideal-int +pkg syscall (linux-amd64), const ARPHRD_IEEE80211_RADIOTAP ideal-int +pkg syscall (linux-amd64), const ARPHRD_IEEE802154 ideal-int +pkg syscall (linux-amd64), const ARPHRD_IEEE802154_PHY ideal-int +pkg syscall (linux-amd64), const ARPHRD_IEEE802_TR ideal-int +pkg syscall (linux-amd64), const ARPHRD_INFINIBAND ideal-int +pkg syscall (linux-amd64), const ARPHRD_IPDDP ideal-int +pkg syscall (linux-amd64), const ARPHRD_IPGRE ideal-int +pkg syscall (linux-amd64), const ARPHRD_IRDA ideal-int +pkg syscall (linux-amd64), const ARPHRD_LAPB ideal-int +pkg syscall (linux-amd64), const ARPHRD_LOCALTLK ideal-int +pkg syscall (linux-amd64), const ARPHRD_LOOPBACK ideal-int +pkg syscall (linux-amd64), const ARPHRD_METRICOM ideal-int +pkg syscall (linux-amd64), const ARPHRD_NETROM ideal-int +pkg syscall (linux-amd64), const ARPHRD_NONE ideal-int +pkg syscall (linux-amd64), const ARPHRD_PIMREG ideal-int +pkg syscall (linux-amd64), const ARPHRD_PPP ideal-int +pkg syscall (linux-amd64), const ARPHRD_PRONET ideal-int +pkg syscall (linux-amd64), const ARPHRD_RAWHDLC ideal-int +pkg syscall (linux-amd64), const ARPHRD_ROSE ideal-int +pkg syscall (linux-amd64), const ARPHRD_RSRVD ideal-int +pkg syscall (linux-amd64), const ARPHRD_SIT ideal-int +pkg syscall (linux-amd64), const ARPHRD_SKIP ideal-int +pkg syscall (linux-amd64), const ARPHRD_SLIP ideal-int +pkg syscall (linux-amd64), const ARPHRD_SLIP6 ideal-int +pkg syscall (linux-amd64), const ARPHRD_TUNNEL ideal-int +pkg syscall (linux-amd64), const ARPHRD_TUNNEL6 ideal-int +pkg syscall (linux-amd64), const ARPHRD_VOID ideal-int +pkg syscall (linux-amd64), const ARPHRD_X25 ideal-int +pkg syscall (linux-amd64), const B0 ideal-int +pkg syscall (linux-amd64), const B1000000 ideal-int +pkg syscall (linux-amd64), const B110 ideal-int +pkg syscall (linux-amd64), const B115200 ideal-int +pkg syscall (linux-amd64), const B1152000 ideal-int +pkg syscall (linux-amd64), const B1200 ideal-int +pkg syscall (linux-amd64), const B134 ideal-int +pkg syscall (linux-amd64), const B150 ideal-int +pkg syscall (linux-amd64), const B1500000 ideal-int +pkg syscall (linux-amd64), const B1800 ideal-int +pkg syscall (linux-amd64), const B19200 ideal-int +pkg syscall (linux-amd64), const B200 ideal-int +pkg syscall (linux-amd64), const B2000000 ideal-int +pkg syscall (linux-amd64), const B230400 ideal-int +pkg syscall (linux-amd64), const B2400 ideal-int +pkg syscall (linux-amd64), const B2500000 ideal-int +pkg syscall (linux-amd64), const B300 ideal-int +pkg syscall (linux-amd64), const B3000000 ideal-int +pkg syscall (linux-amd64), const B3500000 ideal-int +pkg syscall (linux-amd64), const B38400 ideal-int +pkg syscall (linux-amd64), const B4000000 ideal-int +pkg syscall (linux-amd64), const B460800 ideal-int +pkg syscall (linux-amd64), const B4800 ideal-int +pkg syscall (linux-amd64), const B50 ideal-int +pkg syscall (linux-amd64), const B500000 ideal-int +pkg syscall (linux-amd64), const B57600 ideal-int +pkg syscall (linux-amd64), const B576000 ideal-int +pkg syscall (linux-amd64), const B600 ideal-int +pkg syscall (linux-amd64), const B75 ideal-int +pkg syscall (linux-amd64), const B921600 ideal-int +pkg syscall (linux-amd64), const B9600 ideal-int +pkg syscall (linux-amd64), const BPF_A ideal-int +pkg syscall (linux-amd64), const BPF_ABS ideal-int +pkg syscall (linux-amd64), const BPF_ADD ideal-int +pkg syscall (linux-amd64), const BPF_ALU ideal-int +pkg syscall (linux-amd64), const BPF_AND ideal-int +pkg syscall (linux-amd64), const BPF_B ideal-int +pkg syscall (linux-amd64), const BPF_DIV ideal-int +pkg syscall (linux-amd64), const BPF_H ideal-int +pkg syscall (linux-amd64), const BPF_IMM ideal-int +pkg syscall (linux-amd64), const BPF_IND ideal-int +pkg syscall (linux-amd64), const BPF_JA ideal-int +pkg syscall (linux-amd64), const BPF_JEQ ideal-int +pkg syscall (linux-amd64), const BPF_JGE ideal-int +pkg syscall (linux-amd64), const BPF_JGT ideal-int +pkg syscall (linux-amd64), const BPF_JMP ideal-int +pkg syscall (linux-amd64), const BPF_JSET ideal-int +pkg syscall (linux-amd64), const BPF_K ideal-int +pkg syscall (linux-amd64), const BPF_LD ideal-int +pkg syscall (linux-amd64), const BPF_LDX ideal-int +pkg syscall (linux-amd64), const BPF_LEN ideal-int +pkg syscall (linux-amd64), const BPF_LSH ideal-int +pkg syscall (linux-amd64), const BPF_MAJOR_VERSION ideal-int +pkg syscall (linux-amd64), const BPF_MAXINSNS ideal-int +pkg syscall (linux-amd64), const BPF_MEM ideal-int +pkg syscall (linux-amd64), const BPF_MEMWORDS ideal-int +pkg syscall (linux-amd64), const BPF_MINOR_VERSION ideal-int +pkg syscall (linux-amd64), const BPF_MISC ideal-int +pkg syscall (linux-amd64), const BPF_MSH ideal-int +pkg syscall (linux-amd64), const BPF_MUL ideal-int +pkg syscall (linux-amd64), const BPF_NEG ideal-int +pkg syscall (linux-amd64), const BPF_OR ideal-int +pkg syscall (linux-amd64), const BPF_RET ideal-int +pkg syscall (linux-amd64), const BPF_RSH ideal-int +pkg syscall (linux-amd64), const BPF_ST ideal-int +pkg syscall (linux-amd64), const BPF_STX ideal-int +pkg syscall (linux-amd64), const BPF_SUB ideal-int +pkg syscall (linux-amd64), const BPF_TAX ideal-int +pkg syscall (linux-amd64), const BPF_TXA ideal-int +pkg syscall (linux-amd64), const BPF_W ideal-int +pkg syscall (linux-amd64), const BPF_X ideal-int +pkg syscall (linux-amd64), const BRKINT ideal-int +pkg syscall (linux-amd64), const CLOCAL ideal-int +pkg syscall (linux-amd64), const CREAD ideal-int +pkg syscall (linux-amd64), const CS5 ideal-int +pkg syscall (linux-amd64), const CS6 ideal-int +pkg syscall (linux-amd64), const CS7 ideal-int +pkg syscall (linux-amd64), const CS8 ideal-int +pkg syscall (linux-amd64), const CSIZE ideal-int +pkg syscall (linux-amd64), const CSTOPB ideal-int +pkg syscall (linux-amd64), const DT_BLK ideal-int +pkg syscall (linux-amd64), const DT_CHR ideal-int +pkg syscall (linux-amd64), const DT_DIR ideal-int +pkg syscall (linux-amd64), const DT_FIFO ideal-int +pkg syscall (linux-amd64), const DT_LNK ideal-int +pkg syscall (linux-amd64), const DT_REG ideal-int +pkg syscall (linux-amd64), const DT_SOCK ideal-int +pkg syscall (linux-amd64), const DT_UNKNOWN ideal-int +pkg syscall (linux-amd64), const DT_WHT ideal-int +pkg syscall (linux-amd64), const EADV Errno +pkg syscall (linux-amd64), const EBADE Errno +pkg syscall (linux-amd64), const EBADFD Errno +pkg syscall (linux-amd64), const EBADMSG Errno +pkg syscall (linux-amd64), const EBADR Errno +pkg syscall (linux-amd64), const EBADRQC Errno +pkg syscall (linux-amd64), const EBADSLT Errno +pkg syscall (linux-amd64), const EBFONT Errno +pkg syscall (linux-amd64), const ECHO ideal-int +pkg syscall (linux-amd64), const ECHOCTL ideal-int +pkg syscall (linux-amd64), const ECHOE ideal-int +pkg syscall (linux-amd64), const ECHOK ideal-int +pkg syscall (linux-amd64), const ECHOKE ideal-int +pkg syscall (linux-amd64), const ECHONL ideal-int +pkg syscall (linux-amd64), const ECHOPRT ideal-int +pkg syscall (linux-amd64), const ECHRNG Errno +pkg syscall (linux-amd64), const ECOMM Errno +pkg syscall (linux-amd64), const EDEADLOCK Errno +pkg syscall (linux-amd64), const EDOTDOT Errno +pkg syscall (linux-amd64), const EISNAM Errno +pkg syscall (linux-amd64), const EKEYEXPIRED Errno +pkg syscall (linux-amd64), const EKEYREJECTED Errno +pkg syscall (linux-amd64), const EKEYREVOKED Errno +pkg syscall (linux-amd64), const EL2HLT Errno +pkg syscall (linux-amd64), const EL2NSYNC Errno +pkg syscall (linux-amd64), const EL3HLT Errno +pkg syscall (linux-amd64), const EL3RST Errno +pkg syscall (linux-amd64), const ELIBACC Errno +pkg syscall (linux-amd64), const ELIBBAD Errno +pkg syscall (linux-amd64), const ELIBEXEC Errno +pkg syscall (linux-amd64), const ELIBMAX Errno +pkg syscall (linux-amd64), const ELIBSCN Errno +pkg syscall (linux-amd64), const ELNRNG Errno +pkg syscall (linux-amd64), const EMEDIUMTYPE Errno +pkg syscall (linux-amd64), const EMULTIHOP Errno +pkg syscall (linux-amd64), const ENAVAIL Errno +pkg syscall (linux-amd64), const ENOANO Errno +pkg syscall (linux-amd64), const ENOCSI Errno +pkg syscall (linux-amd64), const ENODATA Errno +pkg syscall (linux-amd64), const ENOKEY Errno +pkg syscall (linux-amd64), const ENOLINK Errno +pkg syscall (linux-amd64), const ENOMEDIUM Errno +pkg syscall (linux-amd64), const ENONET Errno +pkg syscall (linux-amd64), const ENOPKG Errno +pkg syscall (linux-amd64), const ENOSR Errno +pkg syscall (linux-amd64), const ENOSTR Errno +pkg syscall (linux-amd64), const ENOTNAM Errno +pkg syscall (linux-amd64), const ENOTRECOVERABLE Errno +pkg syscall (linux-amd64), const ENOTUNIQ Errno +pkg syscall (linux-amd64), const EOWNERDEAD Errno +pkg syscall (linux-amd64), const EPOLLERR ideal-int +pkg syscall (linux-amd64), const EPOLLET ideal-int +pkg syscall (linux-amd64), const EPOLLHUP ideal-int +pkg syscall (linux-amd64), const EPOLLIN ideal-int +pkg syscall (linux-amd64), const EPOLLMSG ideal-int +pkg syscall (linux-amd64), const EPOLLONESHOT ideal-int +pkg syscall (linux-amd64), const EPOLLOUT ideal-int +pkg syscall (linux-amd64), const EPOLLPRI ideal-int +pkg syscall (linux-amd64), const EPOLLRDBAND ideal-int +pkg syscall (linux-amd64), const EPOLLRDHUP ideal-int +pkg syscall (linux-amd64), const EPOLLRDNORM ideal-int +pkg syscall (linux-amd64), const EPOLLWRBAND ideal-int +pkg syscall (linux-amd64), const EPOLLWRNORM ideal-int +pkg syscall (linux-amd64), const EPOLL_CLOEXEC ideal-int +pkg syscall (linux-amd64), const EPOLL_CTL_ADD ideal-int +pkg syscall (linux-amd64), const EPOLL_CTL_DEL ideal-int +pkg syscall (linux-amd64), const EPOLL_CTL_MOD ideal-int +pkg syscall (linux-amd64), const EPOLL_NONBLOCK ideal-int +pkg syscall (linux-amd64), const EPROTO Errno +pkg syscall (linux-amd64), const EREMCHG Errno +pkg syscall (linux-amd64), const EREMOTEIO Errno +pkg syscall (linux-amd64), const ERESTART Errno +pkg syscall (linux-amd64), const ERFKILL Errno +pkg syscall (linux-amd64), const ESRMNT Errno +pkg syscall (linux-amd64), const ESTRPIPE Errno +pkg syscall (linux-amd64), const ETH_P_1588 ideal-int +pkg syscall (linux-amd64), const ETH_P_8021Q ideal-int +pkg syscall (linux-amd64), const ETH_P_802_2 ideal-int +pkg syscall (linux-amd64), const ETH_P_802_3 ideal-int +pkg syscall (linux-amd64), const ETH_P_AARP ideal-int +pkg syscall (linux-amd64), const ETH_P_ALL ideal-int +pkg syscall (linux-amd64), const ETH_P_AOE ideal-int +pkg syscall (linux-amd64), const ETH_P_ARCNET ideal-int +pkg syscall (linux-amd64), const ETH_P_ARP ideal-int +pkg syscall (linux-amd64), const ETH_P_ATALK ideal-int +pkg syscall (linux-amd64), const ETH_P_ATMFATE ideal-int +pkg syscall (linux-amd64), const ETH_P_ATMMPOA ideal-int +pkg syscall (linux-amd64), const ETH_P_AX25 ideal-int +pkg syscall (linux-amd64), const ETH_P_BPQ ideal-int +pkg syscall (linux-amd64), const ETH_P_CAIF ideal-int +pkg syscall (linux-amd64), const ETH_P_CAN ideal-int +pkg syscall (linux-amd64), const ETH_P_CONTROL ideal-int +pkg syscall (linux-amd64), const ETH_P_CUST ideal-int +pkg syscall (linux-amd64), const ETH_P_DDCMP ideal-int +pkg syscall (linux-amd64), const ETH_P_DEC ideal-int +pkg syscall (linux-amd64), const ETH_P_DIAG ideal-int +pkg syscall (linux-amd64), const ETH_P_DNA_DL ideal-int +pkg syscall (linux-amd64), const ETH_P_DNA_RC ideal-int +pkg syscall (linux-amd64), const ETH_P_DNA_RT ideal-int +pkg syscall (linux-amd64), const ETH_P_DSA ideal-int +pkg syscall (linux-amd64), const ETH_P_ECONET ideal-int +pkg syscall (linux-amd64), const ETH_P_EDSA ideal-int +pkg syscall (linux-amd64), const ETH_P_FCOE ideal-int +pkg syscall (linux-amd64), const ETH_P_FIP ideal-int +pkg syscall (linux-amd64), const ETH_P_HDLC ideal-int +pkg syscall (linux-amd64), const ETH_P_IEEE802154 ideal-int +pkg syscall (linux-amd64), const ETH_P_IEEEPUP ideal-int +pkg syscall (linux-amd64), const ETH_P_IEEEPUPAT ideal-int +pkg syscall (linux-amd64), const ETH_P_IP ideal-int +pkg syscall (linux-amd64), const ETH_P_IPV6 ideal-int +pkg syscall (linux-amd64), const ETH_P_IPX ideal-int +pkg syscall (linux-amd64), const ETH_P_IRDA ideal-int +pkg syscall (linux-amd64), const ETH_P_LAT ideal-int +pkg syscall (linux-amd64), const ETH_P_LINK_CTL ideal-int +pkg syscall (linux-amd64), const ETH_P_LOCALTALK ideal-int +pkg syscall (linux-amd64), const ETH_P_LOOP ideal-int +pkg syscall (linux-amd64), const ETH_P_MOBITEX ideal-int +pkg syscall (linux-amd64), const ETH_P_MPLS_MC ideal-int +pkg syscall (linux-amd64), const ETH_P_MPLS_UC ideal-int +pkg syscall (linux-amd64), const ETH_P_PAE ideal-int +pkg syscall (linux-amd64), const ETH_P_PAUSE ideal-int +pkg syscall (linux-amd64), const ETH_P_PHONET ideal-int +pkg syscall (linux-amd64), const ETH_P_PPPTALK ideal-int +pkg syscall (linux-amd64), const ETH_P_PPP_DISC ideal-int +pkg syscall (linux-amd64), const ETH_P_PPP_MP ideal-int +pkg syscall (linux-amd64), const ETH_P_PPP_SES ideal-int +pkg syscall (linux-amd64), const ETH_P_PUP ideal-int +pkg syscall (linux-amd64), const ETH_P_PUPAT ideal-int +pkg syscall (linux-amd64), const ETH_P_RARP ideal-int +pkg syscall (linux-amd64), const ETH_P_SCA ideal-int +pkg syscall (linux-amd64), const ETH_P_SLOW ideal-int +pkg syscall (linux-amd64), const ETH_P_SNAP ideal-int +pkg syscall (linux-amd64), const ETH_P_TEB ideal-int +pkg syscall (linux-amd64), const ETH_P_TIPC ideal-int +pkg syscall (linux-amd64), const ETH_P_TRAILER ideal-int +pkg syscall (linux-amd64), const ETH_P_TR_802_2 ideal-int +pkg syscall (linux-amd64), const ETH_P_WAN_PPP ideal-int +pkg syscall (linux-amd64), const ETH_P_WCCP ideal-int +pkg syscall (linux-amd64), const ETH_P_X25 ideal-int +pkg syscall (linux-amd64), const ETIME Errno +pkg syscall (linux-amd64), const EUCLEAN Errno +pkg syscall (linux-amd64), const EUNATCH Errno +pkg syscall (linux-amd64), const EXFULL Errno +pkg syscall (linux-amd64), const FD_CLOEXEC ideal-int +pkg syscall (linux-amd64), const FD_SETSIZE ideal-int +pkg syscall (linux-amd64), const FLUSHO ideal-int +pkg syscall (linux-amd64), const F_DUPFD ideal-int +pkg syscall (linux-amd64), const F_DUPFD_CLOEXEC ideal-int +pkg syscall (linux-amd64), const F_EXLCK ideal-int +pkg syscall (linux-amd64), const F_GETFD ideal-int +pkg syscall (linux-amd64), const F_GETFL ideal-int +pkg syscall (linux-amd64), const F_GETLEASE ideal-int +pkg syscall (linux-amd64), const F_GETLK ideal-int +pkg syscall (linux-amd64), const F_GETLK64 ideal-int +pkg syscall (linux-amd64), const F_GETOWN ideal-int +pkg syscall (linux-amd64), const F_GETOWN_EX ideal-int +pkg syscall (linux-amd64), const F_GETPIPE_SZ ideal-int +pkg syscall (linux-amd64), const F_GETSIG ideal-int +pkg syscall (linux-amd64), const F_LOCK ideal-int +pkg syscall (linux-amd64), const F_NOTIFY ideal-int +pkg syscall (linux-amd64), const F_OK ideal-int +pkg syscall (linux-amd64), const F_RDLCK ideal-int +pkg syscall (linux-amd64), const F_SETFD ideal-int +pkg syscall (linux-amd64), const F_SETFL ideal-int +pkg syscall (linux-amd64), const F_SETLEASE ideal-int +pkg syscall (linux-amd64), const F_SETLK ideal-int +pkg syscall (linux-amd64), const F_SETLK64 ideal-int +pkg syscall (linux-amd64), const F_SETLKW ideal-int +pkg syscall (linux-amd64), const F_SETLKW64 ideal-int +pkg syscall (linux-amd64), const F_SETOWN ideal-int +pkg syscall (linux-amd64), const F_SETOWN_EX ideal-int +pkg syscall (linux-amd64), const F_SETPIPE_SZ ideal-int +pkg syscall (linux-amd64), const F_SETSIG ideal-int +pkg syscall (linux-amd64), const F_SHLCK ideal-int +pkg syscall (linux-amd64), const F_TEST ideal-int +pkg syscall (linux-amd64), const F_TLOCK ideal-int +pkg syscall (linux-amd64), const F_ULOCK ideal-int +pkg syscall (linux-amd64), const F_UNLCK ideal-int +pkg syscall (linux-amd64), const F_WRLCK ideal-int +pkg syscall (linux-amd64), const HUPCL ideal-int +pkg syscall (linux-amd64), const ICANON ideal-int +pkg syscall (linux-amd64), const ICRNL ideal-int +pkg syscall (linux-amd64), const IEXTEN ideal-int +pkg syscall (linux-amd64), const IFA_ADDRESS ideal-int +pkg syscall (linux-amd64), const IFA_ANYCAST ideal-int +pkg syscall (linux-amd64), const IFA_BROADCAST ideal-int +pkg syscall (linux-amd64), const IFA_CACHEINFO ideal-int +pkg syscall (linux-amd64), const IFA_F_DADFAILED ideal-int +pkg syscall (linux-amd64), const IFA_F_DEPRECATED ideal-int +pkg syscall (linux-amd64), const IFA_F_HOMEADDRESS ideal-int +pkg syscall (linux-amd64), const IFA_F_NODAD ideal-int +pkg syscall (linux-amd64), const IFA_F_OPTIMISTIC ideal-int +pkg syscall (linux-amd64), const IFA_F_PERMANENT ideal-int +pkg syscall (linux-amd64), const IFA_F_SECONDARY ideal-int +pkg syscall (linux-amd64), const IFA_F_TEMPORARY ideal-int +pkg syscall (linux-amd64), const IFA_F_TENTATIVE ideal-int +pkg syscall (linux-amd64), const IFA_LABEL ideal-int +pkg syscall (linux-amd64), const IFA_LOCAL ideal-int +pkg syscall (linux-amd64), const IFA_MAX ideal-int +pkg syscall (linux-amd64), const IFA_MULTICAST ideal-int +pkg syscall (linux-amd64), const IFA_UNSPEC ideal-int +pkg syscall (linux-amd64), const IFF_ALLMULTI ideal-int +pkg syscall (linux-amd64), const IFF_AUTOMEDIA ideal-int +pkg syscall (linux-amd64), const IFF_DEBUG ideal-int +pkg syscall (linux-amd64), const IFF_DYNAMIC ideal-int +pkg syscall (linux-amd64), const IFF_MASTER ideal-int +pkg syscall (linux-amd64), const IFF_NOARP ideal-int +pkg syscall (linux-amd64), const IFF_NOTRAILERS ideal-int +pkg syscall (linux-amd64), const IFF_NO_PI ideal-int +pkg syscall (linux-amd64), const IFF_ONE_QUEUE ideal-int +pkg syscall (linux-amd64), const IFF_POINTOPOINT ideal-int +pkg syscall (linux-amd64), const IFF_PORTSEL ideal-int +pkg syscall (linux-amd64), const IFF_PROMISC ideal-int +pkg syscall (linux-amd64), const IFF_RUNNING ideal-int +pkg syscall (linux-amd64), const IFF_SLAVE ideal-int +pkg syscall (linux-amd64), const IFF_TAP ideal-int +pkg syscall (linux-amd64), const IFF_TUN ideal-int +pkg syscall (linux-amd64), const IFF_TUN_EXCL ideal-int +pkg syscall (linux-amd64), const IFF_VNET_HDR ideal-int +pkg syscall (linux-amd64), const IFLA_ADDRESS ideal-int +pkg syscall (linux-amd64), const IFLA_BROADCAST ideal-int +pkg syscall (linux-amd64), const IFLA_COST ideal-int +pkg syscall (linux-amd64), const IFLA_IFALIAS ideal-int +pkg syscall (linux-amd64), const IFLA_IFNAME ideal-int +pkg syscall (linux-amd64), const IFLA_LINK ideal-int +pkg syscall (linux-amd64), const IFLA_LINKINFO ideal-int +pkg syscall (linux-amd64), const IFLA_LINKMODE ideal-int +pkg syscall (linux-amd64), const IFLA_MAP ideal-int +pkg syscall (linux-amd64), const IFLA_MASTER ideal-int +pkg syscall (linux-amd64), const IFLA_MAX ideal-int +pkg syscall (linux-amd64), const IFLA_MTU ideal-int +pkg syscall (linux-amd64), const IFLA_NET_NS_PID ideal-int +pkg syscall (linux-amd64), const IFLA_OPERSTATE ideal-int +pkg syscall (linux-amd64), const IFLA_PRIORITY ideal-int +pkg syscall (linux-amd64), const IFLA_PROTINFO ideal-int +pkg syscall (linux-amd64), const IFLA_QDISC ideal-int +pkg syscall (linux-amd64), const IFLA_STATS ideal-int +pkg syscall (linux-amd64), const IFLA_TXQLEN ideal-int +pkg syscall (linux-amd64), const IFLA_UNSPEC ideal-int +pkg syscall (linux-amd64), const IFLA_WEIGHT ideal-int +pkg syscall (linux-amd64), const IFLA_WIRELESS ideal-int +pkg syscall (linux-amd64), const IFNAMSIZ ideal-int +pkg syscall (linux-amd64), const IGNBRK ideal-int +pkg syscall (linux-amd64), const IGNCR ideal-int +pkg syscall (linux-amd64), const IGNPAR ideal-int +pkg syscall (linux-amd64), const IMAXBEL ideal-int +pkg syscall (linux-amd64), const INLCR ideal-int +pkg syscall (linux-amd64), const INPCK ideal-int +pkg syscall (linux-amd64), const IN_ACCESS ideal-int +pkg syscall (linux-amd64), const IN_ALL_EVENTS ideal-int +pkg syscall (linux-amd64), const IN_ATTRIB ideal-int +pkg syscall (linux-amd64), const IN_CLASSA_HOST ideal-int +pkg syscall (linux-amd64), const IN_CLASSA_MAX ideal-int +pkg syscall (linux-amd64), const IN_CLASSA_NET ideal-int +pkg syscall (linux-amd64), const IN_CLASSA_NSHIFT ideal-int +pkg syscall (linux-amd64), const IN_CLASSB_HOST ideal-int +pkg syscall (linux-amd64), const IN_CLASSB_MAX ideal-int +pkg syscall (linux-amd64), const IN_CLASSB_NET ideal-int +pkg syscall (linux-amd64), const IN_CLASSB_NSHIFT ideal-int +pkg syscall (linux-amd64), const IN_CLASSC_HOST ideal-int +pkg syscall (linux-amd64), const IN_CLASSC_NET ideal-int +pkg syscall (linux-amd64), const IN_CLASSC_NSHIFT ideal-int +pkg syscall (linux-amd64), const IN_CLOEXEC ideal-int +pkg syscall (linux-amd64), const IN_CLOSE ideal-int +pkg syscall (linux-amd64), const IN_CLOSE_NOWRITE ideal-int +pkg syscall (linux-amd64), const IN_CLOSE_WRITE ideal-int +pkg syscall (linux-amd64), const IN_CREATE ideal-int +pkg syscall (linux-amd64), const IN_DELETE ideal-int +pkg syscall (linux-amd64), const IN_DELETE_SELF ideal-int +pkg syscall (linux-amd64), const IN_DONT_FOLLOW ideal-int +pkg syscall (linux-amd64), const IN_EXCL_UNLINK ideal-int +pkg syscall (linux-amd64), const IN_IGNORED ideal-int +pkg syscall (linux-amd64), const IN_ISDIR ideal-int +pkg syscall (linux-amd64), const IN_LOOPBACKNET ideal-int +pkg syscall (linux-amd64), const IN_MASK_ADD ideal-int +pkg syscall (linux-amd64), const IN_MODIFY ideal-int +pkg syscall (linux-amd64), const IN_MOVE ideal-int +pkg syscall (linux-amd64), const IN_MOVED_FROM ideal-int +pkg syscall (linux-amd64), const IN_MOVED_TO ideal-int +pkg syscall (linux-amd64), const IN_MOVE_SELF ideal-int +pkg syscall (linux-amd64), const IN_NONBLOCK ideal-int +pkg syscall (linux-amd64), const IN_ONESHOT ideal-int +pkg syscall (linux-amd64), const IN_ONLYDIR ideal-int +pkg syscall (linux-amd64), const IN_OPEN ideal-int +pkg syscall (linux-amd64), const IN_Q_OVERFLOW ideal-int +pkg syscall (linux-amd64), const IN_UNMOUNT ideal-int +pkg syscall (linux-amd64), const IPPROTO_AH ideal-int +pkg syscall (linux-amd64), const IPPROTO_COMP ideal-int +pkg syscall (linux-amd64), const IPPROTO_DCCP ideal-int +pkg syscall (linux-amd64), const IPPROTO_DSTOPTS ideal-int +pkg syscall (linux-amd64), const IPPROTO_EGP ideal-int +pkg syscall (linux-amd64), const IPPROTO_ENCAP ideal-int +pkg syscall (linux-amd64), const IPPROTO_ESP ideal-int +pkg syscall (linux-amd64), const IPPROTO_FRAGMENT ideal-int +pkg syscall (linux-amd64), const IPPROTO_GRE ideal-int +pkg syscall (linux-amd64), const IPPROTO_HOPOPTS ideal-int +pkg syscall (linux-amd64), const IPPROTO_ICMP ideal-int +pkg syscall (linux-amd64), const IPPROTO_ICMPV6 ideal-int +pkg syscall (linux-amd64), const IPPROTO_IDP ideal-int +pkg syscall (linux-amd64), const IPPROTO_IGMP ideal-int +pkg syscall (linux-amd64), const IPPROTO_IPIP ideal-int +pkg syscall (linux-amd64), const IPPROTO_MTP ideal-int +pkg syscall (linux-amd64), const IPPROTO_NONE ideal-int +pkg syscall (linux-amd64), const IPPROTO_PIM ideal-int +pkg syscall (linux-amd64), const IPPROTO_PUP ideal-int +pkg syscall (linux-amd64), const IPPROTO_RAW ideal-int +pkg syscall (linux-amd64), const IPPROTO_ROUTING ideal-int +pkg syscall (linux-amd64), const IPPROTO_RSVP ideal-int +pkg syscall (linux-amd64), const IPPROTO_SCTP ideal-int +pkg syscall (linux-amd64), const IPPROTO_TP ideal-int +pkg syscall (linux-amd64), const IPPROTO_UDPLITE ideal-int +pkg syscall (linux-amd64), const IPV6_2292DSTOPTS ideal-int +pkg syscall (linux-amd64), const IPV6_2292HOPLIMIT ideal-int +pkg syscall (linux-amd64), const IPV6_2292HOPOPTS ideal-int +pkg syscall (linux-amd64), const IPV6_2292PKTINFO ideal-int +pkg syscall (linux-amd64), const IPV6_2292PKTOPTIONS ideal-int +pkg syscall (linux-amd64), const IPV6_2292RTHDR ideal-int +pkg syscall (linux-amd64), const IPV6_ADDRFORM ideal-int +pkg syscall (linux-amd64), const IPV6_ADD_MEMBERSHIP ideal-int +pkg syscall (linux-amd64), const IPV6_AUTHHDR ideal-int +pkg syscall (linux-amd64), const IPV6_CHECKSUM ideal-int +pkg syscall (linux-amd64), const IPV6_DROP_MEMBERSHIP ideal-int +pkg syscall (linux-amd64), const IPV6_DSTOPTS ideal-int +pkg syscall (linux-amd64), const IPV6_HOPLIMIT ideal-int +pkg syscall (linux-amd64), const IPV6_HOPOPTS ideal-int +pkg syscall (linux-amd64), const IPV6_IPSEC_POLICY ideal-int +pkg syscall (linux-amd64), const IPV6_JOIN_ANYCAST ideal-int +pkg syscall (linux-amd64), const IPV6_LEAVE_ANYCAST ideal-int +pkg syscall (linux-amd64), const IPV6_MTU ideal-int +pkg syscall (linux-amd64), const IPV6_MTU_DISCOVER ideal-int +pkg syscall (linux-amd64), const IPV6_NEXTHOP ideal-int +pkg syscall (linux-amd64), const IPV6_PKTINFO ideal-int +pkg syscall (linux-amd64), const IPV6_PMTUDISC_DO ideal-int +pkg syscall (linux-amd64), const IPV6_PMTUDISC_DONT ideal-int +pkg syscall (linux-amd64), const IPV6_PMTUDISC_PROBE ideal-int +pkg syscall (linux-amd64), const IPV6_PMTUDISC_WANT ideal-int +pkg syscall (linux-amd64), const IPV6_RECVDSTOPTS ideal-int +pkg syscall (linux-amd64), const IPV6_RECVERR ideal-int +pkg syscall (linux-amd64), const IPV6_RECVHOPLIMIT ideal-int +pkg syscall (linux-amd64), const IPV6_RECVHOPOPTS ideal-int +pkg syscall (linux-amd64), const IPV6_RECVPKTINFO ideal-int +pkg syscall (linux-amd64), const IPV6_RECVRTHDR ideal-int +pkg syscall (linux-amd64), const IPV6_RECVTCLASS ideal-int +pkg syscall (linux-amd64), const IPV6_ROUTER_ALERT ideal-int +pkg syscall (linux-amd64), const IPV6_RTHDR ideal-int +pkg syscall (linux-amd64), const IPV6_RTHDRDSTOPTS ideal-int +pkg syscall (linux-amd64), const IPV6_RTHDR_LOOSE ideal-int +pkg syscall (linux-amd64), const IPV6_RTHDR_STRICT ideal-int +pkg syscall (linux-amd64), const IPV6_RTHDR_TYPE_0 ideal-int +pkg syscall (linux-amd64), const IPV6_RXDSTOPTS ideal-int +pkg syscall (linux-amd64), const IPV6_RXHOPOPTS ideal-int +pkg syscall (linux-amd64), const IPV6_TCLASS ideal-int +pkg syscall (linux-amd64), const IPV6_XFRM_POLICY ideal-int +pkg syscall (linux-amd64), const IP_ADD_SOURCE_MEMBERSHIP ideal-int +pkg syscall (linux-amd64), const IP_BLOCK_SOURCE ideal-int +pkg syscall (linux-amd64), const IP_DEFAULT_MULTICAST_LOOP ideal-int +pkg syscall (linux-amd64), const IP_DEFAULT_MULTICAST_TTL ideal-int +pkg syscall (linux-amd64), const IP_DF ideal-int +pkg syscall (linux-amd64), const IP_DROP_SOURCE_MEMBERSHIP ideal-int +pkg syscall (linux-amd64), const IP_FREEBIND ideal-int +pkg syscall (linux-amd64), const IP_HDRINCL ideal-int +pkg syscall (linux-amd64), const IP_IPSEC_POLICY ideal-int +pkg syscall (linux-amd64), const IP_MAXPACKET ideal-int +pkg syscall (linux-amd64), const IP_MAX_MEMBERSHIPS ideal-int +pkg syscall (linux-amd64), const IP_MF ideal-int +pkg syscall (linux-amd64), const IP_MINTTL ideal-int +pkg syscall (linux-amd64), const IP_MSFILTER ideal-int +pkg syscall (linux-amd64), const IP_MSS ideal-int +pkg syscall (linux-amd64), const IP_MTU ideal-int +pkg syscall (linux-amd64), const IP_MTU_DISCOVER ideal-int +pkg syscall (linux-amd64), const IP_OFFMASK ideal-int +pkg syscall (linux-amd64), const IP_OPTIONS ideal-int +pkg syscall (linux-amd64), const IP_ORIGDSTADDR ideal-int +pkg syscall (linux-amd64), const IP_PASSSEC ideal-int +pkg syscall (linux-amd64), const IP_PKTINFO ideal-int +pkg syscall (linux-amd64), const IP_PKTOPTIONS ideal-int +pkg syscall (linux-amd64), const IP_PMTUDISC ideal-int +pkg syscall (linux-amd64), const IP_PMTUDISC_DO ideal-int +pkg syscall (linux-amd64), const IP_PMTUDISC_DONT ideal-int +pkg syscall (linux-amd64), const IP_PMTUDISC_PROBE ideal-int +pkg syscall (linux-amd64), const IP_PMTUDISC_WANT ideal-int +pkg syscall (linux-amd64), const IP_RECVERR ideal-int +pkg syscall (linux-amd64), const IP_RECVOPTS ideal-int +pkg syscall (linux-amd64), const IP_RECVORIGDSTADDR ideal-int +pkg syscall (linux-amd64), const IP_RECVRETOPTS ideal-int +pkg syscall (linux-amd64), const IP_RECVTOS ideal-int +pkg syscall (linux-amd64), const IP_RECVTTL ideal-int +pkg syscall (linux-amd64), const IP_RETOPTS ideal-int +pkg syscall (linux-amd64), const IP_RF ideal-int +pkg syscall (linux-amd64), const IP_ROUTER_ALERT ideal-int +pkg syscall (linux-amd64), const IP_TRANSPARENT ideal-int +pkg syscall (linux-amd64), const IP_UNBLOCK_SOURCE ideal-int +pkg syscall (linux-amd64), const IP_XFRM_POLICY ideal-int +pkg syscall (linux-amd64), const ISIG ideal-int +pkg syscall (linux-amd64), const ISTRIP ideal-int +pkg syscall (linux-amd64), const IUCLC ideal-int +pkg syscall (linux-amd64), const IUTF8 ideal-int +pkg syscall (linux-amd64), const IXANY ideal-int +pkg syscall (linux-amd64), const IXOFF ideal-int +pkg syscall (linux-amd64), const IXON ideal-int +pkg syscall (linux-amd64), const LINUX_REBOOT_CMD_CAD_OFF ideal-int +pkg syscall (linux-amd64), const LINUX_REBOOT_CMD_CAD_ON ideal-int +pkg syscall (linux-amd64), const LINUX_REBOOT_CMD_HALT ideal-int +pkg syscall (linux-amd64), const LINUX_REBOOT_CMD_KEXEC ideal-int +pkg syscall (linux-amd64), const LINUX_REBOOT_CMD_POWER_OFF ideal-int +pkg syscall (linux-amd64), const LINUX_REBOOT_CMD_RESTART ideal-int +pkg syscall (linux-amd64), const LINUX_REBOOT_CMD_RESTART2 ideal-int +pkg syscall (linux-amd64), const LINUX_REBOOT_CMD_SW_SUSPEND ideal-int +pkg syscall (linux-amd64), const LINUX_REBOOT_MAGIC1 ideal-int +pkg syscall (linux-amd64), const LINUX_REBOOT_MAGIC2 ideal-int +pkg syscall (linux-amd64), const LOCK_EX ideal-int +pkg syscall (linux-amd64), const LOCK_NB ideal-int +pkg syscall (linux-amd64), const LOCK_SH ideal-int +pkg syscall (linux-amd64), const LOCK_UN ideal-int +pkg syscall (linux-amd64), const MADV_DOFORK ideal-int +pkg syscall (linux-amd64), const MADV_DONTFORK ideal-int +pkg syscall (linux-amd64), const MADV_DONTNEED ideal-int +pkg syscall (linux-amd64), const MADV_HUGEPAGE ideal-int +pkg syscall (linux-amd64), const MADV_HWPOISON ideal-int +pkg syscall (linux-amd64), const MADV_MERGEABLE ideal-int +pkg syscall (linux-amd64), const MADV_NOHUGEPAGE ideal-int +pkg syscall (linux-amd64), const MADV_NORMAL ideal-int +pkg syscall (linux-amd64), const MADV_RANDOM ideal-int +pkg syscall (linux-amd64), const MADV_REMOVE ideal-int +pkg syscall (linux-amd64), const MADV_SEQUENTIAL ideal-int +pkg syscall (linux-amd64), const MADV_UNMERGEABLE ideal-int +pkg syscall (linux-amd64), const MADV_WILLNEED ideal-int +pkg syscall (linux-amd64), const MAP_32BIT ideal-int +pkg syscall (linux-amd64), const MAP_ANON ideal-int +pkg syscall (linux-amd64), const MAP_ANONYMOUS ideal-int +pkg syscall (linux-amd64), const MAP_DENYWRITE ideal-int +pkg syscall (linux-amd64), const MAP_EXECUTABLE ideal-int +pkg syscall (linux-amd64), const MAP_FILE ideal-int +pkg syscall (linux-amd64), const MAP_FIXED ideal-int +pkg syscall (linux-amd64), const MAP_GROWSDOWN ideal-int +pkg syscall (linux-amd64), const MAP_HUGETLB ideal-int +pkg syscall (linux-amd64), const MAP_LOCKED ideal-int +pkg syscall (linux-amd64), const MAP_NONBLOCK ideal-int +pkg syscall (linux-amd64), const MAP_NORESERVE ideal-int +pkg syscall (linux-amd64), const MAP_POPULATE ideal-int +pkg syscall (linux-amd64), const MAP_PRIVATE ideal-int +pkg syscall (linux-amd64), const MAP_SHARED ideal-int +pkg syscall (linux-amd64), const MAP_STACK ideal-int +pkg syscall (linux-amd64), const MAP_TYPE ideal-int +pkg syscall (linux-amd64), const MCL_CURRENT ideal-int +pkg syscall (linux-amd64), const MCL_FUTURE ideal-int +pkg syscall (linux-amd64), const MNT_DETACH ideal-int +pkg syscall (linux-amd64), const MNT_EXPIRE ideal-int +pkg syscall (linux-amd64), const MNT_FORCE ideal-int +pkg syscall (linux-amd64), const MSG_CMSG_CLOEXEC ideal-int +pkg syscall (linux-amd64), const MSG_CONFIRM ideal-int +pkg syscall (linux-amd64), const MSG_CTRUNC ideal-int +pkg syscall (linux-amd64), const MSG_DONTROUTE ideal-int +pkg syscall (linux-amd64), const MSG_DONTWAIT ideal-int +pkg syscall (linux-amd64), const MSG_EOR ideal-int +pkg syscall (linux-amd64), const MSG_ERRQUEUE ideal-int +pkg syscall (linux-amd64), const MSG_FIN ideal-int +pkg syscall (linux-amd64), const MSG_MORE ideal-int +pkg syscall (linux-amd64), const MSG_NOSIGNAL ideal-int +pkg syscall (linux-amd64), const MSG_OOB ideal-int +pkg syscall (linux-amd64), const MSG_PEEK ideal-int +pkg syscall (linux-amd64), const MSG_PROXY ideal-int +pkg syscall (linux-amd64), const MSG_RST ideal-int +pkg syscall (linux-amd64), const MSG_SYN ideal-int +pkg syscall (linux-amd64), const MSG_TRUNC ideal-int +pkg syscall (linux-amd64), const MSG_TRYHARD ideal-int +pkg syscall (linux-amd64), const MSG_WAITALL ideal-int +pkg syscall (linux-amd64), const MSG_WAITFORONE ideal-int +pkg syscall (linux-amd64), const MS_ACTIVE ideal-int +pkg syscall (linux-amd64), const MS_ASYNC ideal-int +pkg syscall (linux-amd64), const MS_BIND ideal-int +pkg syscall (linux-amd64), const MS_DIRSYNC ideal-int +pkg syscall (linux-amd64), const MS_INVALIDATE ideal-int +pkg syscall (linux-amd64), const MS_I_VERSION ideal-int +pkg syscall (linux-amd64), const MS_KERNMOUNT ideal-int +pkg syscall (linux-amd64), const MS_MANDLOCK ideal-int +pkg syscall (linux-amd64), const MS_MGC_MSK ideal-int +pkg syscall (linux-amd64), const MS_MGC_VAL ideal-int +pkg syscall (linux-amd64), const MS_MOVE ideal-int +pkg syscall (linux-amd64), const MS_NOATIME ideal-int +pkg syscall (linux-amd64), const MS_NODEV ideal-int +pkg syscall (linux-amd64), const MS_NODIRATIME ideal-int +pkg syscall (linux-amd64), const MS_NOEXEC ideal-int +pkg syscall (linux-amd64), const MS_NOSUID ideal-int +pkg syscall (linux-amd64), const MS_NOUSER ideal-int +pkg syscall (linux-amd64), const MS_POSIXACL ideal-int +pkg syscall (linux-amd64), const MS_PRIVATE ideal-int +pkg syscall (linux-amd64), const MS_RDONLY ideal-int +pkg syscall (linux-amd64), const MS_REC ideal-int +pkg syscall (linux-amd64), const MS_RELATIME ideal-int +pkg syscall (linux-amd64), const MS_REMOUNT ideal-int +pkg syscall (linux-amd64), const MS_RMT_MASK ideal-int +pkg syscall (linux-amd64), const MS_SHARED ideal-int +pkg syscall (linux-amd64), const MS_SILENT ideal-int +pkg syscall (linux-amd64), const MS_SLAVE ideal-int +pkg syscall (linux-amd64), const MS_STRICTATIME ideal-int +pkg syscall (linux-amd64), const MS_SYNC ideal-int +pkg syscall (linux-amd64), const MS_SYNCHRONOUS ideal-int +pkg syscall (linux-amd64), const MS_UNBINDABLE ideal-int +pkg syscall (linux-amd64), const NAME_MAX ideal-int +pkg syscall (linux-amd64), const NETLINK_ADD_MEMBERSHIP ideal-int +pkg syscall (linux-amd64), const NETLINK_AUDIT ideal-int +pkg syscall (linux-amd64), const NETLINK_BROADCAST_ERROR ideal-int +pkg syscall (linux-amd64), const NETLINK_CONNECTOR ideal-int +pkg syscall (linux-amd64), const NETLINK_DNRTMSG ideal-int +pkg syscall (linux-amd64), const NETLINK_DROP_MEMBERSHIP ideal-int +pkg syscall (linux-amd64), const NETLINK_ECRYPTFS ideal-int +pkg syscall (linux-amd64), const NETLINK_FIB_LOOKUP ideal-int +pkg syscall (linux-amd64), const NETLINK_FIREWALL ideal-int +pkg syscall (linux-amd64), const NETLINK_GENERIC ideal-int +pkg syscall (linux-amd64), const NETLINK_INET_DIAG ideal-int +pkg syscall (linux-amd64), const NETLINK_IP6_FW ideal-int +pkg syscall (linux-amd64), const NETLINK_ISCSI ideal-int +pkg syscall (linux-amd64), const NETLINK_KOBJECT_UEVENT ideal-int +pkg syscall (linux-amd64), const NETLINK_NETFILTER ideal-int +pkg syscall (linux-amd64), const NETLINK_NFLOG ideal-int +pkg syscall (linux-amd64), const NETLINK_NO_ENOBUFS ideal-int +pkg syscall (linux-amd64), const NETLINK_PKTINFO ideal-int +pkg syscall (linux-amd64), const NETLINK_ROUTE ideal-int +pkg syscall (linux-amd64), const NETLINK_SCSITRANSPORT ideal-int +pkg syscall (linux-amd64), const NETLINK_SELINUX ideal-int +pkg syscall (linux-amd64), const NETLINK_UNUSED ideal-int +pkg syscall (linux-amd64), const NETLINK_USERSOCK ideal-int +pkg syscall (linux-amd64), const NETLINK_XFRM ideal-int +pkg syscall (linux-amd64), const NLA_ALIGNTO ideal-int +pkg syscall (linux-amd64), const NLA_F_NESTED ideal-int +pkg syscall (linux-amd64), const NLA_F_NET_BYTEORDER ideal-int +pkg syscall (linux-amd64), const NLA_HDRLEN ideal-int +pkg syscall (linux-amd64), const NLMSG_ALIGNTO ideal-int +pkg syscall (linux-amd64), const NLMSG_DONE ideal-int +pkg syscall (linux-amd64), const NLMSG_ERROR ideal-int +pkg syscall (linux-amd64), const NLMSG_HDRLEN ideal-int +pkg syscall (linux-amd64), const NLMSG_MIN_TYPE ideal-int +pkg syscall (linux-amd64), const NLMSG_NOOP ideal-int +pkg syscall (linux-amd64), const NLMSG_OVERRUN ideal-int +pkg syscall (linux-amd64), const NLM_F_ACK ideal-int +pkg syscall (linux-amd64), const NLM_F_APPEND ideal-int +pkg syscall (linux-amd64), const NLM_F_ATOMIC ideal-int +pkg syscall (linux-amd64), const NLM_F_CREATE ideal-int +pkg syscall (linux-amd64), const NLM_F_DUMP ideal-int +pkg syscall (linux-amd64), const NLM_F_ECHO ideal-int +pkg syscall (linux-amd64), const NLM_F_EXCL ideal-int +pkg syscall (linux-amd64), const NLM_F_MATCH ideal-int +pkg syscall (linux-amd64), const NLM_F_MULTI ideal-int +pkg syscall (linux-amd64), const NLM_F_REPLACE ideal-int +pkg syscall (linux-amd64), const NLM_F_REQUEST ideal-int +pkg syscall (linux-amd64), const NLM_F_ROOT ideal-int +pkg syscall (linux-amd64), const NOFLSH ideal-int +pkg syscall (linux-amd64), const OCRNL ideal-int +pkg syscall (linux-amd64), const OFDEL ideal-int +pkg syscall (linux-amd64), const OFILL ideal-int +pkg syscall (linux-amd64), const OLCUC ideal-int +pkg syscall (linux-amd64), const ONLCR ideal-int +pkg syscall (linux-amd64), const ONLRET ideal-int +pkg syscall (linux-amd64), const ONOCR ideal-int +pkg syscall (linux-amd64), const OPOST ideal-int +pkg syscall (linux-amd64), const O_ACCMODE ideal-int +pkg syscall (linux-amd64), const O_DIRECT ideal-int +pkg syscall (linux-amd64), const O_DIRECTORY ideal-int +pkg syscall (linux-amd64), const O_DSYNC ideal-int +pkg syscall (linux-amd64), const O_FSYNC ideal-int +pkg syscall (linux-amd64), const O_LARGEFILE ideal-int +pkg syscall (linux-amd64), const O_NDELAY ideal-int +pkg syscall (linux-amd64), const O_NOATIME ideal-int +pkg syscall (linux-amd64), const O_NOFOLLOW ideal-int +pkg syscall (linux-amd64), const O_RSYNC ideal-int +pkg syscall (linux-amd64), const PACKET_ADD_MEMBERSHIP ideal-int +pkg syscall (linux-amd64), const PACKET_BROADCAST ideal-int +pkg syscall (linux-amd64), const PACKET_DROP_MEMBERSHIP ideal-int +pkg syscall (linux-amd64), const PACKET_FASTROUTE ideal-int +pkg syscall (linux-amd64), const PACKET_HOST ideal-int +pkg syscall (linux-amd64), const PACKET_LOOPBACK ideal-int +pkg syscall (linux-amd64), const PACKET_MR_ALLMULTI ideal-int +pkg syscall (linux-amd64), const PACKET_MR_MULTICAST ideal-int +pkg syscall (linux-amd64), const PACKET_MR_PROMISC ideal-int +pkg syscall (linux-amd64), const PACKET_MULTICAST ideal-int +pkg syscall (linux-amd64), const PACKET_OTHERHOST ideal-int +pkg syscall (linux-amd64), const PACKET_OUTGOING ideal-int +pkg syscall (linux-amd64), const PACKET_RECV_OUTPUT ideal-int +pkg syscall (linux-amd64), const PACKET_RX_RING ideal-int +pkg syscall (linux-amd64), const PACKET_STATISTICS ideal-int +pkg syscall (linux-amd64), const PARENB ideal-int +pkg syscall (linux-amd64), const PARMRK ideal-int +pkg syscall (linux-amd64), const PARODD ideal-int +pkg syscall (linux-amd64), const PENDIN ideal-int +pkg syscall (linux-amd64), const PROT_EXEC ideal-int +pkg syscall (linux-amd64), const PROT_GROWSDOWN ideal-int +pkg syscall (linux-amd64), const PROT_GROWSUP ideal-int +pkg syscall (linux-amd64), const PROT_NONE ideal-int +pkg syscall (linux-amd64), const PROT_READ ideal-int +pkg syscall (linux-amd64), const PROT_WRITE ideal-int +pkg syscall (linux-amd64), const PR_CAPBSET_DROP ideal-int +pkg syscall (linux-amd64), const PR_CAPBSET_READ ideal-int +pkg syscall (linux-amd64), const PR_ENDIAN_BIG ideal-int +pkg syscall (linux-amd64), const PR_ENDIAN_LITTLE ideal-int +pkg syscall (linux-amd64), const PR_ENDIAN_PPC_LITTLE ideal-int +pkg syscall (linux-amd64), const PR_FPEMU_NOPRINT ideal-int +pkg syscall (linux-amd64), const PR_FPEMU_SIGFPE ideal-int +pkg syscall (linux-amd64), const PR_FP_EXC_ASYNC ideal-int +pkg syscall (linux-amd64), const PR_FP_EXC_DISABLED ideal-int +pkg syscall (linux-amd64), const PR_FP_EXC_DIV ideal-int +pkg syscall (linux-amd64), const PR_FP_EXC_INV ideal-int +pkg syscall (linux-amd64), const PR_FP_EXC_NONRECOV ideal-int +pkg syscall (linux-amd64), const PR_FP_EXC_OVF ideal-int +pkg syscall (linux-amd64), const PR_FP_EXC_PRECISE ideal-int +pkg syscall (linux-amd64), const PR_FP_EXC_RES ideal-int +pkg syscall (linux-amd64), const PR_FP_EXC_SW_ENABLE ideal-int +pkg syscall (linux-amd64), const PR_FP_EXC_UND ideal-int +pkg syscall (linux-amd64), const PR_GET_DUMPABLE ideal-int +pkg syscall (linux-amd64), const PR_GET_ENDIAN ideal-int +pkg syscall (linux-amd64), const PR_GET_FPEMU ideal-int +pkg syscall (linux-amd64), const PR_GET_FPEXC ideal-int +pkg syscall (linux-amd64), const PR_GET_KEEPCAPS ideal-int +pkg syscall (linux-amd64), const PR_GET_NAME ideal-int +pkg syscall (linux-amd64), const PR_GET_PDEATHSIG ideal-int +pkg syscall (linux-amd64), const PR_GET_SECCOMP ideal-int +pkg syscall (linux-amd64), const PR_GET_SECUREBITS ideal-int +pkg syscall (linux-amd64), const PR_GET_TIMERSLACK ideal-int +pkg syscall (linux-amd64), const PR_GET_TIMING ideal-int +pkg syscall (linux-amd64), const PR_GET_TSC ideal-int +pkg syscall (linux-amd64), const PR_GET_UNALIGN ideal-int +pkg syscall (linux-amd64), const PR_MCE_KILL ideal-int +pkg syscall (linux-amd64), const PR_MCE_KILL_CLEAR ideal-int +pkg syscall (linux-amd64), const PR_MCE_KILL_DEFAULT ideal-int +pkg syscall (linux-amd64), const PR_MCE_KILL_EARLY ideal-int +pkg syscall (linux-amd64), const PR_MCE_KILL_GET ideal-int +pkg syscall (linux-amd64), const PR_MCE_KILL_LATE ideal-int +pkg syscall (linux-amd64), const PR_MCE_KILL_SET ideal-int +pkg syscall (linux-amd64), const PR_SET_DUMPABLE ideal-int +pkg syscall (linux-amd64), const PR_SET_ENDIAN ideal-int +pkg syscall (linux-amd64), const PR_SET_FPEMU ideal-int +pkg syscall (linux-amd64), const PR_SET_FPEXC ideal-int +pkg syscall (linux-amd64), const PR_SET_KEEPCAPS ideal-int +pkg syscall (linux-amd64), const PR_SET_NAME ideal-int +pkg syscall (linux-amd64), const PR_SET_PDEATHSIG ideal-int +pkg syscall (linux-amd64), const PR_SET_PTRACER ideal-int +pkg syscall (linux-amd64), const PR_SET_SECCOMP ideal-int +pkg syscall (linux-amd64), const PR_SET_SECUREBITS ideal-int +pkg syscall (linux-amd64), const PR_SET_TIMERSLACK ideal-int +pkg syscall (linux-amd64), const PR_SET_TIMING ideal-int +pkg syscall (linux-amd64), const PR_SET_TSC ideal-int +pkg syscall (linux-amd64), const PR_SET_UNALIGN ideal-int +pkg syscall (linux-amd64), const PR_TASK_PERF_EVENTS_DISABLE ideal-int +pkg syscall (linux-amd64), const PR_TASK_PERF_EVENTS_ENABLE ideal-int +pkg syscall (linux-amd64), const PR_TIMING_STATISTICAL ideal-int +pkg syscall (linux-amd64), const PR_TIMING_TIMESTAMP ideal-int +pkg syscall (linux-amd64), const PR_TSC_ENABLE ideal-int +pkg syscall (linux-amd64), const PR_TSC_SIGSEGV ideal-int +pkg syscall (linux-amd64), const PR_UNALIGN_NOPRINT ideal-int +pkg syscall (linux-amd64), const PR_UNALIGN_SIGBUS ideal-int +pkg syscall (linux-amd64), const PTRACE_ARCH_PRCTL ideal-int +pkg syscall (linux-amd64), const PTRACE_ATTACH ideal-int +pkg syscall (linux-amd64), const PTRACE_CONT ideal-int +pkg syscall (linux-amd64), const PTRACE_DETACH ideal-int +pkg syscall (linux-amd64), const PTRACE_EVENT_CLONE ideal-int +pkg syscall (linux-amd64), const PTRACE_EVENT_EXEC ideal-int +pkg syscall (linux-amd64), const PTRACE_EVENT_EXIT ideal-int +pkg syscall (linux-amd64), const PTRACE_EVENT_FORK ideal-int +pkg syscall (linux-amd64), const PTRACE_EVENT_VFORK ideal-int +pkg syscall (linux-amd64), const PTRACE_EVENT_VFORK_DONE ideal-int +pkg syscall (linux-amd64), const PTRACE_GETEVENTMSG ideal-int +pkg syscall (linux-amd64), const PTRACE_GETFPREGS ideal-int +pkg syscall (linux-amd64), const PTRACE_GETFPXREGS ideal-int +pkg syscall (linux-amd64), const PTRACE_GETREGS ideal-int +pkg syscall (linux-amd64), const PTRACE_GETREGSET ideal-int +pkg syscall (linux-amd64), const PTRACE_GETSIGINFO ideal-int +pkg syscall (linux-amd64), const PTRACE_GET_THREAD_AREA ideal-int +pkg syscall (linux-amd64), const PTRACE_KILL ideal-int +pkg syscall (linux-amd64), const PTRACE_OLDSETOPTIONS ideal-int +pkg syscall (linux-amd64), const PTRACE_O_MASK ideal-int +pkg syscall (linux-amd64), const PTRACE_O_TRACECLONE ideal-int +pkg syscall (linux-amd64), const PTRACE_O_TRACEEXEC ideal-int +pkg syscall (linux-amd64), const PTRACE_O_TRACEEXIT ideal-int +pkg syscall (linux-amd64), const PTRACE_O_TRACEFORK ideal-int +pkg syscall (linux-amd64), const PTRACE_O_TRACESYSGOOD ideal-int +pkg syscall (linux-amd64), const PTRACE_O_TRACEVFORK ideal-int +pkg syscall (linux-amd64), const PTRACE_O_TRACEVFORKDONE ideal-int +pkg syscall (linux-amd64), const PTRACE_PEEKDATA ideal-int +pkg syscall (linux-amd64), const PTRACE_PEEKTEXT ideal-int +pkg syscall (linux-amd64), const PTRACE_PEEKUSR ideal-int +pkg syscall (linux-amd64), const PTRACE_POKEDATA ideal-int +pkg syscall (linux-amd64), const PTRACE_POKETEXT ideal-int +pkg syscall (linux-amd64), const PTRACE_POKEUSR ideal-int +pkg syscall (linux-amd64), const PTRACE_SETFPREGS ideal-int +pkg syscall (linux-amd64), const PTRACE_SETFPXREGS ideal-int +pkg syscall (linux-amd64), const PTRACE_SETOPTIONS ideal-int +pkg syscall (linux-amd64), const PTRACE_SETREGS ideal-int +pkg syscall (linux-amd64), const PTRACE_SETREGSET ideal-int +pkg syscall (linux-amd64), const PTRACE_SETSIGINFO ideal-int +pkg syscall (linux-amd64), const PTRACE_SET_THREAD_AREA ideal-int +pkg syscall (linux-amd64), const PTRACE_SINGLEBLOCK ideal-int +pkg syscall (linux-amd64), const PTRACE_SINGLESTEP ideal-int +pkg syscall (linux-amd64), const PTRACE_SYSCALL ideal-int +pkg syscall (linux-amd64), const PTRACE_SYSEMU ideal-int +pkg syscall (linux-amd64), const PTRACE_SYSEMU_SINGLESTEP ideal-int +pkg syscall (linux-amd64), const PTRACE_TRACEME ideal-int +pkg syscall (linux-amd64), const PathMax ideal-int +pkg syscall (linux-amd64), const RLIMIT_AS ideal-int +pkg syscall (linux-amd64), const RLIMIT_CORE ideal-int +pkg syscall (linux-amd64), const RLIMIT_CPU ideal-int +pkg syscall (linux-amd64), const RLIMIT_DATA ideal-int +pkg syscall (linux-amd64), const RLIMIT_FSIZE ideal-int +pkg syscall (linux-amd64), const RLIMIT_NOFILE ideal-int +pkg syscall (linux-amd64), const RLIMIT_STACK ideal-int +pkg syscall (linux-amd64), const RLIM_INFINITY ideal-int +pkg syscall (linux-amd64), const RTAX_ADVMSS ideal-int +pkg syscall (linux-amd64), const RTAX_CWND ideal-int +pkg syscall (linux-amd64), const RTAX_FEATURES ideal-int +pkg syscall (linux-amd64), const RTAX_FEATURE_ALLFRAG ideal-int +pkg syscall (linux-amd64), const RTAX_FEATURE_ECN ideal-int +pkg syscall (linux-amd64), const RTAX_FEATURE_SACK ideal-int +pkg syscall (linux-amd64), const RTAX_FEATURE_TIMESTAMP ideal-int +pkg syscall (linux-amd64), const RTAX_HOPLIMIT ideal-int +pkg syscall (linux-amd64), const RTAX_INITCWND ideal-int +pkg syscall (linux-amd64), const RTAX_INITRWND ideal-int +pkg syscall (linux-amd64), const RTAX_LOCK ideal-int +pkg syscall (linux-amd64), const RTAX_MAX ideal-int +pkg syscall (linux-amd64), const RTAX_MTU ideal-int +pkg syscall (linux-amd64), const RTAX_REORDERING ideal-int +pkg syscall (linux-amd64), const RTAX_RTO_MIN ideal-int +pkg syscall (linux-amd64), const RTAX_RTT ideal-int +pkg syscall (linux-amd64), const RTAX_RTTVAR ideal-int +pkg syscall (linux-amd64), const RTAX_SSTHRESH ideal-int +pkg syscall (linux-amd64), const RTAX_UNSPEC ideal-int +pkg syscall (linux-amd64), const RTAX_WINDOW ideal-int +pkg syscall (linux-amd64), const RTA_ALIGNTO ideal-int +pkg syscall (linux-amd64), const RTA_CACHEINFO ideal-int +pkg syscall (linux-amd64), const RTA_DST ideal-int +pkg syscall (linux-amd64), const RTA_FLOW ideal-int +pkg syscall (linux-amd64), const RTA_GATEWAY ideal-int +pkg syscall (linux-amd64), const RTA_IIF ideal-int +pkg syscall (linux-amd64), const RTA_MAX ideal-int +pkg syscall (linux-amd64), const RTA_METRICS ideal-int +pkg syscall (linux-amd64), const RTA_MULTIPATH ideal-int +pkg syscall (linux-amd64), const RTA_OIF ideal-int +pkg syscall (linux-amd64), const RTA_PREFSRC ideal-int +pkg syscall (linux-amd64), const RTA_PRIORITY ideal-int +pkg syscall (linux-amd64), const RTA_SRC ideal-int +pkg syscall (linux-amd64), const RTA_TABLE ideal-int +pkg syscall (linux-amd64), const RTA_UNSPEC ideal-int +pkg syscall (linux-amd64), const RTCF_DIRECTSRC ideal-int +pkg syscall (linux-amd64), const RTCF_DOREDIRECT ideal-int +pkg syscall (linux-amd64), const RTCF_LOG ideal-int +pkg syscall (linux-amd64), const RTCF_MASQ ideal-int +pkg syscall (linux-amd64), const RTCF_NAT ideal-int +pkg syscall (linux-amd64), const RTCF_VALVE ideal-int +pkg syscall (linux-amd64), const RTF_ADDRCLASSMASK ideal-int +pkg syscall (linux-amd64), const RTF_ADDRCONF ideal-int +pkg syscall (linux-amd64), const RTF_ALLONLINK ideal-int +pkg syscall (linux-amd64), const RTF_BROADCAST ideal-int +pkg syscall (linux-amd64), const RTF_CACHE ideal-int +pkg syscall (linux-amd64), const RTF_DEFAULT ideal-int +pkg syscall (linux-amd64), const RTF_DYNAMIC ideal-int +pkg syscall (linux-amd64), const RTF_FLOW ideal-int +pkg syscall (linux-amd64), const RTF_GATEWAY ideal-int +pkg syscall (linux-amd64), const RTF_HOST ideal-int +pkg syscall (linux-amd64), const RTF_INTERFACE ideal-int +pkg syscall (linux-amd64), const RTF_IRTT ideal-int +pkg syscall (linux-amd64), const RTF_LINKRT ideal-int +pkg syscall (linux-amd64), const RTF_LOCAL ideal-int +pkg syscall (linux-amd64), const RTF_MODIFIED ideal-int +pkg syscall (linux-amd64), const RTF_MSS ideal-int +pkg syscall (linux-amd64), const RTF_MTU ideal-int +pkg syscall (linux-amd64), const RTF_MULTICAST ideal-int +pkg syscall (linux-amd64), const RTF_NAT ideal-int +pkg syscall (linux-amd64), const RTF_NOFORWARD ideal-int +pkg syscall (linux-amd64), const RTF_NONEXTHOP ideal-int +pkg syscall (linux-amd64), const RTF_NOPMTUDISC ideal-int +pkg syscall (linux-amd64), const RTF_POLICY ideal-int +pkg syscall (linux-amd64), const RTF_REINSTATE ideal-int +pkg syscall (linux-amd64), const RTF_REJECT ideal-int +pkg syscall (linux-amd64), const RTF_STATIC ideal-int +pkg syscall (linux-amd64), const RTF_THROW ideal-int +pkg syscall (linux-amd64), const RTF_UP ideal-int +pkg syscall (linux-amd64), const RTF_WINDOW ideal-int +pkg syscall (linux-amd64), const RTF_XRESOLVE ideal-int +pkg syscall (linux-amd64), const RTM_BASE ideal-int +pkg syscall (linux-amd64), const RTM_DELACTION ideal-int +pkg syscall (linux-amd64), const RTM_DELADDR ideal-int +pkg syscall (linux-amd64), const RTM_DELADDRLABEL ideal-int +pkg syscall (linux-amd64), const RTM_DELLINK ideal-int +pkg syscall (linux-amd64), const RTM_DELNEIGH ideal-int +pkg syscall (linux-amd64), const RTM_DELQDISC ideal-int +pkg syscall (linux-amd64), const RTM_DELROUTE ideal-int +pkg syscall (linux-amd64), const RTM_DELRULE ideal-int +pkg syscall (linux-amd64), const RTM_DELTCLASS ideal-int +pkg syscall (linux-amd64), const RTM_DELTFILTER ideal-int +pkg syscall (linux-amd64), const RTM_F_CLONED ideal-int +pkg syscall (linux-amd64), const RTM_F_EQUALIZE ideal-int +pkg syscall (linux-amd64), const RTM_F_NOTIFY ideal-int +pkg syscall (linux-amd64), const RTM_F_PREFIX ideal-int +pkg syscall (linux-amd64), const RTM_GETACTION ideal-int +pkg syscall (linux-amd64), const RTM_GETADDR ideal-int +pkg syscall (linux-amd64), const RTM_GETADDRLABEL ideal-int +pkg syscall (linux-amd64), const RTM_GETANYCAST ideal-int +pkg syscall (linux-amd64), const RTM_GETDCB ideal-int +pkg syscall (linux-amd64), const RTM_GETLINK ideal-int +pkg syscall (linux-amd64), const RTM_GETMULTICAST ideal-int +pkg syscall (linux-amd64), const RTM_GETNEIGH ideal-int +pkg syscall (linux-amd64), const RTM_GETNEIGHTBL ideal-int +pkg syscall (linux-amd64), const RTM_GETQDISC ideal-int +pkg syscall (linux-amd64), const RTM_GETROUTE ideal-int +pkg syscall (linux-amd64), const RTM_GETRULE ideal-int +pkg syscall (linux-amd64), const RTM_GETTCLASS ideal-int +pkg syscall (linux-amd64), const RTM_GETTFILTER ideal-int +pkg syscall (linux-amd64), const RTM_MAX ideal-int +pkg syscall (linux-amd64), const RTM_NEWACTION ideal-int +pkg syscall (linux-amd64), const RTM_NEWADDR ideal-int +pkg syscall (linux-amd64), const RTM_NEWADDRLABEL ideal-int +pkg syscall (linux-amd64), const RTM_NEWLINK ideal-int +pkg syscall (linux-amd64), const RTM_NEWNDUSEROPT ideal-int +pkg syscall (linux-amd64), const RTM_NEWNEIGH ideal-int +pkg syscall (linux-amd64), const RTM_NEWNEIGHTBL ideal-int +pkg syscall (linux-amd64), const RTM_NEWPREFIX ideal-int +pkg syscall (linux-amd64), const RTM_NEWQDISC ideal-int +pkg syscall (linux-amd64), const RTM_NEWROUTE ideal-int +pkg syscall (linux-amd64), const RTM_NEWRULE ideal-int +pkg syscall (linux-amd64), const RTM_NEWTCLASS ideal-int +pkg syscall (linux-amd64), const RTM_NEWTFILTER ideal-int +pkg syscall (linux-amd64), const RTM_NR_FAMILIES ideal-int +pkg syscall (linux-amd64), const RTM_NR_MSGTYPES ideal-int +pkg syscall (linux-amd64), const RTM_SETDCB ideal-int +pkg syscall (linux-amd64), const RTM_SETLINK ideal-int +pkg syscall (linux-amd64), const RTM_SETNEIGHTBL ideal-int +pkg syscall (linux-amd64), const RTNH_ALIGNTO ideal-int +pkg syscall (linux-amd64), const RTNH_F_DEAD ideal-int +pkg syscall (linux-amd64), const RTNH_F_ONLINK ideal-int +pkg syscall (linux-amd64), const RTNH_F_PERVASIVE ideal-int +pkg syscall (linux-amd64), const RTN_ANYCAST ideal-int +pkg syscall (linux-amd64), const RTN_BLACKHOLE ideal-int +pkg syscall (linux-amd64), const RTN_BROADCAST ideal-int +pkg syscall (linux-amd64), const RTN_LOCAL ideal-int +pkg syscall (linux-amd64), const RTN_MAX ideal-int +pkg syscall (linux-amd64), const RTN_MULTICAST ideal-int +pkg syscall (linux-amd64), const RTN_NAT ideal-int +pkg syscall (linux-amd64), const RTN_PROHIBIT ideal-int +pkg syscall (linux-amd64), const RTN_THROW ideal-int +pkg syscall (linux-amd64), const RTN_UNICAST ideal-int +pkg syscall (linux-amd64), const RTN_UNREACHABLE ideal-int +pkg syscall (linux-amd64), const RTN_UNSPEC ideal-int +pkg syscall (linux-amd64), const RTN_XRESOLVE ideal-int +pkg syscall (linux-amd64), const RTPROT_BIRD ideal-int +pkg syscall (linux-amd64), const RTPROT_BOOT ideal-int +pkg syscall (linux-amd64), const RTPROT_DHCP ideal-int +pkg syscall (linux-amd64), const RTPROT_DNROUTED ideal-int +pkg syscall (linux-amd64), const RTPROT_GATED ideal-int +pkg syscall (linux-amd64), const RTPROT_KERNEL ideal-int +pkg syscall (linux-amd64), const RTPROT_MRT ideal-int +pkg syscall (linux-amd64), const RTPROT_NTK ideal-int +pkg syscall (linux-amd64), const RTPROT_RA ideal-int +pkg syscall (linux-amd64), const RTPROT_REDIRECT ideal-int +pkg syscall (linux-amd64), const RTPROT_STATIC ideal-int +pkg syscall (linux-amd64), const RTPROT_UNSPEC ideal-int +pkg syscall (linux-amd64), const RTPROT_XORP ideal-int +pkg syscall (linux-amd64), const RTPROT_ZEBRA ideal-int +pkg syscall (linux-amd64), const RT_CLASS_DEFAULT ideal-int +pkg syscall (linux-amd64), const RT_CLASS_LOCAL ideal-int +pkg syscall (linux-amd64), const RT_CLASS_MAIN ideal-int +pkg syscall (linux-amd64), const RT_CLASS_MAX ideal-int +pkg syscall (linux-amd64), const RT_CLASS_UNSPEC ideal-int +pkg syscall (linux-amd64), const RT_SCOPE_HOST ideal-int +pkg syscall (linux-amd64), const RT_SCOPE_LINK ideal-int +pkg syscall (linux-amd64), const RT_SCOPE_NOWHERE ideal-int +pkg syscall (linux-amd64), const RT_SCOPE_SITE ideal-int +pkg syscall (linux-amd64), const RT_SCOPE_UNIVERSE ideal-int +pkg syscall (linux-amd64), const RT_TABLE_COMPAT ideal-int +pkg syscall (linux-amd64), const RT_TABLE_DEFAULT ideal-int +pkg syscall (linux-amd64), const RT_TABLE_LOCAL ideal-int +pkg syscall (linux-amd64), const RT_TABLE_MAIN ideal-int +pkg syscall (linux-amd64), const RT_TABLE_MAX ideal-int +pkg syscall (linux-amd64), const RT_TABLE_UNSPEC ideal-int +pkg syscall (linux-amd64), const RUSAGE_CHILDREN ideal-int +pkg syscall (linux-amd64), const RUSAGE_SELF ideal-int +pkg syscall (linux-amd64), const RUSAGE_THREAD ideal-int +pkg syscall (linux-amd64), const SCM_CREDENTIALS ideal-int +pkg syscall (linux-amd64), const SCM_RIGHTS ideal-int +pkg syscall (linux-amd64), const SCM_TIMESTAMP ideal-int +pkg syscall (linux-amd64), const SCM_TIMESTAMPING ideal-int +pkg syscall (linux-amd64), const SCM_TIMESTAMPNS ideal-int +pkg syscall (linux-amd64), const SIGCHLD Signal +pkg syscall (linux-amd64), const SIGCLD Signal +pkg syscall (linux-amd64), const SIGCONT Signal +pkg syscall (linux-amd64), const SIGIO Signal +pkg syscall (linux-amd64), const SIGIOT Signal +pkg syscall (linux-amd64), const SIGPOLL Signal +pkg syscall (linux-amd64), const SIGPROF Signal +pkg syscall (linux-amd64), const SIGPWR Signal +pkg syscall (linux-amd64), const SIGSTKFLT Signal +pkg syscall (linux-amd64), const SIGSTOP Signal +pkg syscall (linux-amd64), const SIGSYS Signal +pkg syscall (linux-amd64), const SIGTSTP Signal +pkg syscall (linux-amd64), const SIGTTIN Signal +pkg syscall (linux-amd64), const SIGTTOU Signal +pkg syscall (linux-amd64), const SIGUNUSED Signal +pkg syscall (linux-amd64), const SIGURG Signal +pkg syscall (linux-amd64), const SIGUSR1 Signal +pkg syscall (linux-amd64), const SIGUSR2 Signal +pkg syscall (linux-amd64), const SIGVTALRM Signal +pkg syscall (linux-amd64), const SIGWINCH Signal +pkg syscall (linux-amd64), const SIGXCPU Signal +pkg syscall (linux-amd64), const SIGXFSZ Signal +pkg syscall (linux-amd64), const SIOCADDDLCI ideal-int +pkg syscall (linux-amd64), const SIOCADDMULTI ideal-int +pkg syscall (linux-amd64), const SIOCADDRT ideal-int +pkg syscall (linux-amd64), const SIOCATMARK ideal-int +pkg syscall (linux-amd64), const SIOCDARP ideal-int +pkg syscall (linux-amd64), const SIOCDELDLCI ideal-int +pkg syscall (linux-amd64), const SIOCDELMULTI ideal-int +pkg syscall (linux-amd64), const SIOCDELRT ideal-int +pkg syscall (linux-amd64), const SIOCDEVPRIVATE ideal-int +pkg syscall (linux-amd64), const SIOCDIFADDR ideal-int +pkg syscall (linux-amd64), const SIOCDRARP ideal-int +pkg syscall (linux-amd64), const SIOCGARP ideal-int +pkg syscall (linux-amd64), const SIOCGIFADDR ideal-int +pkg syscall (linux-amd64), const SIOCGIFBR ideal-int +pkg syscall (linux-amd64), const SIOCGIFBRDADDR ideal-int +pkg syscall (linux-amd64), const SIOCGIFCONF ideal-int +pkg syscall (linux-amd64), const SIOCGIFCOUNT ideal-int +pkg syscall (linux-amd64), const SIOCGIFDSTADDR ideal-int +pkg syscall (linux-amd64), const SIOCGIFENCAP ideal-int +pkg syscall (linux-amd64), const SIOCGIFFLAGS ideal-int +pkg syscall (linux-amd64), const SIOCGIFHWADDR ideal-int +pkg syscall (linux-amd64), const SIOCGIFINDEX ideal-int +pkg syscall (linux-amd64), const SIOCGIFMAP ideal-int +pkg syscall (linux-amd64), const SIOCGIFMEM ideal-int +pkg syscall (linux-amd64), const SIOCGIFMETRIC ideal-int +pkg syscall (linux-amd64), const SIOCGIFMTU ideal-int +pkg syscall (linux-amd64), const SIOCGIFNAME ideal-int +pkg syscall (linux-amd64), const SIOCGIFNETMASK ideal-int +pkg syscall (linux-amd64), const SIOCGIFPFLAGS ideal-int +pkg syscall (linux-amd64), const SIOCGIFSLAVE ideal-int +pkg syscall (linux-amd64), const SIOCGIFTXQLEN ideal-int +pkg syscall (linux-amd64), const SIOCGPGRP ideal-int +pkg syscall (linux-amd64), const SIOCGRARP ideal-int +pkg syscall (linux-amd64), const SIOCGSTAMP ideal-int +pkg syscall (linux-amd64), const SIOCGSTAMPNS ideal-int +pkg syscall (linux-amd64), const SIOCPROTOPRIVATE ideal-int +pkg syscall (linux-amd64), const SIOCRTMSG ideal-int +pkg syscall (linux-amd64), const SIOCSARP ideal-int +pkg syscall (linux-amd64), const SIOCSIFADDR ideal-int +pkg syscall (linux-amd64), const SIOCSIFBR ideal-int +pkg syscall (linux-amd64), const SIOCSIFBRDADDR ideal-int +pkg syscall (linux-amd64), const SIOCSIFDSTADDR ideal-int +pkg syscall (linux-amd64), const SIOCSIFENCAP ideal-int +pkg syscall (linux-amd64), const SIOCSIFFLAGS ideal-int +pkg syscall (linux-amd64), const SIOCSIFHWADDR ideal-int +pkg syscall (linux-amd64), const SIOCSIFHWBROADCAST ideal-int +pkg syscall (linux-amd64), const SIOCSIFLINK ideal-int +pkg syscall (linux-amd64), const SIOCSIFMAP ideal-int +pkg syscall (linux-amd64), const SIOCSIFMEM ideal-int +pkg syscall (linux-amd64), const SIOCSIFMETRIC ideal-int +pkg syscall (linux-amd64), const SIOCSIFMTU ideal-int +pkg syscall (linux-amd64), const SIOCSIFNAME ideal-int +pkg syscall (linux-amd64), const SIOCSIFNETMASK ideal-int +pkg syscall (linux-amd64), const SIOCSIFPFLAGS ideal-int +pkg syscall (linux-amd64), const SIOCSIFSLAVE ideal-int +pkg syscall (linux-amd64), const SIOCSIFTXQLEN ideal-int +pkg syscall (linux-amd64), const SIOCSPGRP ideal-int +pkg syscall (linux-amd64), const SIOCSRARP ideal-int +pkg syscall (linux-amd64), const SOCK_CLOEXEC ideal-int +pkg syscall (linux-amd64), const SOCK_DCCP ideal-int +pkg syscall (linux-amd64), const SOCK_NONBLOCK ideal-int +pkg syscall (linux-amd64), const SOCK_PACKET ideal-int +pkg syscall (linux-amd64), const SOCK_RDM ideal-int +pkg syscall (linux-amd64), const SOL_AAL ideal-int +pkg syscall (linux-amd64), const SOL_ATM ideal-int +pkg syscall (linux-amd64), const SOL_DECNET ideal-int +pkg syscall (linux-amd64), const SOL_ICMPV6 ideal-int +pkg syscall (linux-amd64), const SOL_IP ideal-int +pkg syscall (linux-amd64), const SOL_IPV6 ideal-int +pkg syscall (linux-amd64), const SOL_IRDA ideal-int +pkg syscall (linux-amd64), const SOL_PACKET ideal-int +pkg syscall (linux-amd64), const SOL_RAW ideal-int +pkg syscall (linux-amd64), const SOL_TCP ideal-int +pkg syscall (linux-amd64), const SOL_X25 ideal-int +pkg syscall (linux-amd64), const SO_ACCEPTCONN ideal-int +pkg syscall (linux-amd64), const SO_ATTACH_FILTER ideal-int +pkg syscall (linux-amd64), const SO_BINDTODEVICE ideal-int +pkg syscall (linux-amd64), const SO_BSDCOMPAT ideal-int +pkg syscall (linux-amd64), const SO_DEBUG ideal-int +pkg syscall (linux-amd64), const SO_DETACH_FILTER ideal-int +pkg syscall (linux-amd64), const SO_DOMAIN ideal-int +pkg syscall (linux-amd64), const SO_ERROR ideal-int +pkg syscall (linux-amd64), const SO_MARK ideal-int +pkg syscall (linux-amd64), const SO_NO_CHECK ideal-int +pkg syscall (linux-amd64), const SO_OOBINLINE ideal-int +pkg syscall (linux-amd64), const SO_PASSCRED ideal-int +pkg syscall (linux-amd64), const SO_PASSSEC ideal-int +pkg syscall (linux-amd64), const SO_PEERCRED ideal-int +pkg syscall (linux-amd64), const SO_PEERNAME ideal-int +pkg syscall (linux-amd64), const SO_PEERSEC ideal-int +pkg syscall (linux-amd64), const SO_PRIORITY ideal-int +pkg syscall (linux-amd64), const SO_PROTOCOL ideal-int +pkg syscall (linux-amd64), const SO_RCVBUFFORCE ideal-int +pkg syscall (linux-amd64), const SO_RCVLOWAT ideal-int +pkg syscall (linux-amd64), const SO_RCVTIMEO ideal-int +pkg syscall (linux-amd64), const SO_RXQ_OVFL ideal-int +pkg syscall (linux-amd64), const SO_SECURITY_AUTHENTICATION ideal-int +pkg syscall (linux-amd64), const SO_SECURITY_ENCRYPTION_NETWORK ideal-int +pkg syscall (linux-amd64), const SO_SECURITY_ENCRYPTION_TRANSPORT ideal-int +pkg syscall (linux-amd64), const SO_SNDBUFFORCE ideal-int +pkg syscall (linux-amd64), const SO_SNDLOWAT ideal-int +pkg syscall (linux-amd64), const SO_SNDTIMEO ideal-int +pkg syscall (linux-amd64), const SO_TIMESTAMP ideal-int +pkg syscall (linux-amd64), const SO_TIMESTAMPING ideal-int +pkg syscall (linux-amd64), const SO_TIMESTAMPNS ideal-int +pkg syscall (linux-amd64), const SO_TYPE ideal-int +pkg syscall (linux-amd64), const SYS_ACCEPT ideal-int +pkg syscall (linux-amd64), const SYS_ACCEPT4 ideal-int +pkg syscall (linux-amd64), const SYS_ACCESS ideal-int +pkg syscall (linux-amd64), const SYS_ACCT ideal-int +pkg syscall (linux-amd64), const SYS_ADD_KEY ideal-int +pkg syscall (linux-amd64), const SYS_ADJTIMEX ideal-int +pkg syscall (linux-amd64), const SYS_AFS_SYSCALL ideal-int +pkg syscall (linux-amd64), const SYS_ALARM ideal-int +pkg syscall (linux-amd64), const SYS_ARCH_PRCTL ideal-int +pkg syscall (linux-amd64), const SYS_BIND ideal-int +pkg syscall (linux-amd64), const SYS_BRK ideal-int +pkg syscall (linux-amd64), const SYS_CAPGET ideal-int +pkg syscall (linux-amd64), const SYS_CAPSET ideal-int +pkg syscall (linux-amd64), const SYS_CHDIR ideal-int +pkg syscall (linux-amd64), const SYS_CHMOD ideal-int +pkg syscall (linux-amd64), const SYS_CHOWN ideal-int +pkg syscall (linux-amd64), const SYS_CHROOT ideal-int +pkg syscall (linux-amd64), const SYS_CLOCK_GETRES ideal-int +pkg syscall (linux-amd64), const SYS_CLOCK_GETTIME ideal-int +pkg syscall (linux-amd64), const SYS_CLOCK_NANOSLEEP ideal-int +pkg syscall (linux-amd64), const SYS_CLOCK_SETTIME ideal-int +pkg syscall (linux-amd64), const SYS_CLONE ideal-int +pkg syscall (linux-amd64), const SYS_CLOSE ideal-int +pkg syscall (linux-amd64), const SYS_CONNECT ideal-int +pkg syscall (linux-amd64), const SYS_CREAT ideal-int +pkg syscall (linux-amd64), const SYS_CREATE_MODULE ideal-int +pkg syscall (linux-amd64), const SYS_DELETE_MODULE ideal-int +pkg syscall (linux-amd64), const SYS_DUP ideal-int +pkg syscall (linux-amd64), const SYS_DUP2 ideal-int +pkg syscall (linux-amd64), const SYS_DUP3 ideal-int +pkg syscall (linux-amd64), const SYS_EPOLL_CREATE ideal-int +pkg syscall (linux-amd64), const SYS_EPOLL_CREATE1 ideal-int +pkg syscall (linux-amd64), const SYS_EPOLL_CTL ideal-int +pkg syscall (linux-amd64), const SYS_EPOLL_CTL_OLD ideal-int +pkg syscall (linux-amd64), const SYS_EPOLL_PWAIT ideal-int +pkg syscall (linux-amd64), const SYS_EPOLL_WAIT ideal-int +pkg syscall (linux-amd64), const SYS_EPOLL_WAIT_OLD ideal-int +pkg syscall (linux-amd64), const SYS_EVENTFD ideal-int +pkg syscall (linux-amd64), const SYS_EVENTFD2 ideal-int +pkg syscall (linux-amd64), const SYS_EXECVE ideal-int +pkg syscall (linux-amd64), const SYS_EXIT ideal-int +pkg syscall (linux-amd64), const SYS_EXIT_GROUP ideal-int +pkg syscall (linux-amd64), const SYS_FACCESSAT ideal-int +pkg syscall (linux-amd64), const SYS_FADVISE64 ideal-int +pkg syscall (linux-amd64), const SYS_FALLOCATE ideal-int +pkg syscall (linux-amd64), const SYS_FANOTIFY_INIT ideal-int +pkg syscall (linux-amd64), const SYS_FANOTIFY_MARK ideal-int +pkg syscall (linux-amd64), const SYS_FCHDIR ideal-int +pkg syscall (linux-amd64), const SYS_FCHMOD ideal-int +pkg syscall (linux-amd64), const SYS_FCHMODAT ideal-int +pkg syscall (linux-amd64), const SYS_FCHOWN ideal-int +pkg syscall (linux-amd64), const SYS_FCHOWNAT ideal-int +pkg syscall (linux-amd64), const SYS_FCNTL ideal-int +pkg syscall (linux-amd64), const SYS_FDATASYNC ideal-int +pkg syscall (linux-amd64), const SYS_FGETXATTR ideal-int +pkg syscall (linux-amd64), const SYS_FLISTXATTR ideal-int +pkg syscall (linux-amd64), const SYS_FLOCK ideal-int +pkg syscall (linux-amd64), const SYS_FORK ideal-int +pkg syscall (linux-amd64), const SYS_FREMOVEXATTR ideal-int +pkg syscall (linux-amd64), const SYS_FSETXATTR ideal-int +pkg syscall (linux-amd64), const SYS_FSTAT ideal-int +pkg syscall (linux-amd64), const SYS_FSTATFS ideal-int +pkg syscall (linux-amd64), const SYS_FSYNC ideal-int +pkg syscall (linux-amd64), const SYS_FTRUNCATE ideal-int +pkg syscall (linux-amd64), const SYS_FUTEX ideal-int +pkg syscall (linux-amd64), const SYS_FUTIMESAT ideal-int +pkg syscall (linux-amd64), const SYS_GETCWD ideal-int +pkg syscall (linux-amd64), const SYS_GETDENTS ideal-int +pkg syscall (linux-amd64), const SYS_GETDENTS64 ideal-int +pkg syscall (linux-amd64), const SYS_GETEGID ideal-int +pkg syscall (linux-amd64), const SYS_GETEUID ideal-int +pkg syscall (linux-amd64), const SYS_GETGID ideal-int +pkg syscall (linux-amd64), const SYS_GETGROUPS ideal-int +pkg syscall (linux-amd64), const SYS_GETITIMER ideal-int +pkg syscall (linux-amd64), const SYS_GETPEERNAME ideal-int +pkg syscall (linux-amd64), const SYS_GETPGID ideal-int +pkg syscall (linux-amd64), const SYS_GETPGRP ideal-int +pkg syscall (linux-amd64), const SYS_GETPID ideal-int +pkg syscall (linux-amd64), const SYS_GETPMSG ideal-int +pkg syscall (linux-amd64), const SYS_GETPPID ideal-int +pkg syscall (linux-amd64), const SYS_GETPRIORITY ideal-int +pkg syscall (linux-amd64), const SYS_GETRESGID ideal-int +pkg syscall (linux-amd64), const SYS_GETRESUID ideal-int +pkg syscall (linux-amd64), const SYS_GETRLIMIT ideal-int +pkg syscall (linux-amd64), const SYS_GETRUSAGE ideal-int +pkg syscall (linux-amd64), const SYS_GETSID ideal-int +pkg syscall (linux-amd64), const SYS_GETSOCKNAME ideal-int +pkg syscall (linux-amd64), const SYS_GETSOCKOPT ideal-int +pkg syscall (linux-amd64), const SYS_GETTID ideal-int +pkg syscall (linux-amd64), const SYS_GETTIMEOFDAY ideal-int +pkg syscall (linux-amd64), const SYS_GETUID ideal-int +pkg syscall (linux-amd64), const SYS_GETXATTR ideal-int +pkg syscall (linux-amd64), const SYS_GET_KERNEL_SYMS ideal-int +pkg syscall (linux-amd64), const SYS_GET_MEMPOLICY ideal-int +pkg syscall (linux-amd64), const SYS_GET_ROBUST_LIST ideal-int +pkg syscall (linux-amd64), const SYS_GET_THREAD_AREA ideal-int +pkg syscall (linux-amd64), const SYS_INIT_MODULE ideal-int +pkg syscall (linux-amd64), const SYS_INOTIFY_ADD_WATCH ideal-int +pkg syscall (linux-amd64), const SYS_INOTIFY_INIT ideal-int +pkg syscall (linux-amd64), const SYS_INOTIFY_INIT1 ideal-int +pkg syscall (linux-amd64), const SYS_INOTIFY_RM_WATCH ideal-int +pkg syscall (linux-amd64), const SYS_IOCTL ideal-int +pkg syscall (linux-amd64), const SYS_IOPERM ideal-int +pkg syscall (linux-amd64), const SYS_IOPL ideal-int +pkg syscall (linux-amd64), const SYS_IOPRIO_GET ideal-int +pkg syscall (linux-amd64), const SYS_IOPRIO_SET ideal-int +pkg syscall (linux-amd64), const SYS_IO_CANCEL ideal-int +pkg syscall (linux-amd64), const SYS_IO_DESTROY ideal-int +pkg syscall (linux-amd64), const SYS_IO_GETEVENTS ideal-int +pkg syscall (linux-amd64), const SYS_IO_SETUP ideal-int +pkg syscall (linux-amd64), const SYS_IO_SUBMIT ideal-int +pkg syscall (linux-amd64), const SYS_KEXEC_LOAD ideal-int +pkg syscall (linux-amd64), const SYS_KEYCTL ideal-int +pkg syscall (linux-amd64), const SYS_KILL ideal-int +pkg syscall (linux-amd64), const SYS_LCHOWN ideal-int +pkg syscall (linux-amd64), const SYS_LGETXATTR ideal-int +pkg syscall (linux-amd64), const SYS_LINK ideal-int +pkg syscall (linux-amd64), const SYS_LINKAT ideal-int +pkg syscall (linux-amd64), const SYS_LISTEN ideal-int +pkg syscall (linux-amd64), const SYS_LISTXATTR ideal-int +pkg syscall (linux-amd64), const SYS_LLISTXATTR ideal-int +pkg syscall (linux-amd64), const SYS_LOOKUP_DCOOKIE ideal-int +pkg syscall (linux-amd64), const SYS_LREMOVEXATTR ideal-int +pkg syscall (linux-amd64), const SYS_LSEEK ideal-int +pkg syscall (linux-amd64), const SYS_LSETXATTR ideal-int +pkg syscall (linux-amd64), const SYS_LSTAT ideal-int +pkg syscall (linux-amd64), const SYS_MADVISE ideal-int +pkg syscall (linux-amd64), const SYS_MBIND ideal-int +pkg syscall (linux-amd64), const SYS_MIGRATE_PAGES ideal-int +pkg syscall (linux-amd64), const SYS_MINCORE ideal-int +pkg syscall (linux-amd64), const SYS_MKDIR ideal-int +pkg syscall (linux-amd64), const SYS_MKDIRAT ideal-int +pkg syscall (linux-amd64), const SYS_MKNOD ideal-int +pkg syscall (linux-amd64), const SYS_MKNODAT ideal-int +pkg syscall (linux-amd64), const SYS_MLOCK ideal-int +pkg syscall (linux-amd64), const SYS_MLOCKALL ideal-int +pkg syscall (linux-amd64), const SYS_MMAP ideal-int +pkg syscall (linux-amd64), const SYS_MODIFY_LDT ideal-int +pkg syscall (linux-amd64), const SYS_MOUNT ideal-int +pkg syscall (linux-amd64), const SYS_MOVE_PAGES ideal-int +pkg syscall (linux-amd64), const SYS_MPROTECT ideal-int +pkg syscall (linux-amd64), const SYS_MQ_GETSETATTR ideal-int +pkg syscall (linux-amd64), const SYS_MQ_NOTIFY ideal-int +pkg syscall (linux-amd64), const SYS_MQ_OPEN ideal-int +pkg syscall (linux-amd64), const SYS_MQ_TIMEDRECEIVE ideal-int +pkg syscall (linux-amd64), const SYS_MQ_TIMEDSEND ideal-int +pkg syscall (linux-amd64), const SYS_MQ_UNLINK ideal-int +pkg syscall (linux-amd64), const SYS_MREMAP ideal-int +pkg syscall (linux-amd64), const SYS_MSGCTL ideal-int +pkg syscall (linux-amd64), const SYS_MSGGET ideal-int +pkg syscall (linux-amd64), const SYS_MSGRCV ideal-int +pkg syscall (linux-amd64), const SYS_MSGSND ideal-int +pkg syscall (linux-amd64), const SYS_MSYNC ideal-int +pkg syscall (linux-amd64), const SYS_MUNLOCK ideal-int +pkg syscall (linux-amd64), const SYS_MUNLOCKALL ideal-int +pkg syscall (linux-amd64), const SYS_MUNMAP ideal-int +pkg syscall (linux-amd64), const SYS_NANOSLEEP ideal-int +pkg syscall (linux-amd64), const SYS_NEWFSTATAT ideal-int +pkg syscall (linux-amd64), const SYS_NFSSERVCTL ideal-int +pkg syscall (linux-amd64), const SYS_OPEN ideal-int +pkg syscall (linux-amd64), const SYS_OPENAT ideal-int +pkg syscall (linux-amd64), const SYS_PAUSE ideal-int +pkg syscall (linux-amd64), const SYS_PERF_EVENT_OPEN ideal-int +pkg syscall (linux-amd64), const SYS_PERSONALITY ideal-int +pkg syscall (linux-amd64), const SYS_PIPE ideal-int +pkg syscall (linux-amd64), const SYS_PIPE2 ideal-int +pkg syscall (linux-amd64), const SYS_PIVOT_ROOT ideal-int +pkg syscall (linux-amd64), const SYS_POLL ideal-int +pkg syscall (linux-amd64), const SYS_PPOLL ideal-int +pkg syscall (linux-amd64), const SYS_PRCTL ideal-int +pkg syscall (linux-amd64), const SYS_PREAD64 ideal-int +pkg syscall (linux-amd64), const SYS_PREADV ideal-int +pkg syscall (linux-amd64), const SYS_PRLIMIT64 ideal-int +pkg syscall (linux-amd64), const SYS_PSELECT6 ideal-int +pkg syscall (linux-amd64), const SYS_PTRACE ideal-int +pkg syscall (linux-amd64), const SYS_PUTPMSG ideal-int +pkg syscall (linux-amd64), const SYS_PWRITE64 ideal-int +pkg syscall (linux-amd64), const SYS_PWRITEV ideal-int +pkg syscall (linux-amd64), const SYS_QUERY_MODULE ideal-int +pkg syscall (linux-amd64), const SYS_QUOTACTL ideal-int +pkg syscall (linux-amd64), const SYS_READ ideal-int +pkg syscall (linux-amd64), const SYS_READAHEAD ideal-int +pkg syscall (linux-amd64), const SYS_READLINK ideal-int +pkg syscall (linux-amd64), const SYS_READLINKAT ideal-int +pkg syscall (linux-amd64), const SYS_READV ideal-int +pkg syscall (linux-amd64), const SYS_REBOOT ideal-int +pkg syscall (linux-amd64), const SYS_RECVFROM ideal-int +pkg syscall (linux-amd64), const SYS_RECVMMSG ideal-int +pkg syscall (linux-amd64), const SYS_RECVMSG ideal-int +pkg syscall (linux-amd64), const SYS_REMAP_FILE_PAGES ideal-int +pkg syscall (linux-amd64), const SYS_REMOVEXATTR ideal-int +pkg syscall (linux-amd64), const SYS_RENAME ideal-int +pkg syscall (linux-amd64), const SYS_RENAMEAT ideal-int +pkg syscall (linux-amd64), const SYS_REQUEST_KEY ideal-int +pkg syscall (linux-amd64), const SYS_RESTART_SYSCALL ideal-int +pkg syscall (linux-amd64), const SYS_RMDIR ideal-int +pkg syscall (linux-amd64), const SYS_RT_SIGACTION ideal-int +pkg syscall (linux-amd64), const SYS_RT_SIGPENDING ideal-int +pkg syscall (linux-amd64), const SYS_RT_SIGPROCMASK ideal-int +pkg syscall (linux-amd64), const SYS_RT_SIGQUEUEINFO ideal-int +pkg syscall (linux-amd64), const SYS_RT_SIGRETURN ideal-int +pkg syscall (linux-amd64), const SYS_RT_SIGSUSPEND ideal-int +pkg syscall (linux-amd64), const SYS_RT_SIGTIMEDWAIT ideal-int +pkg syscall (linux-amd64), const SYS_RT_TGSIGQUEUEINFO ideal-int +pkg syscall (linux-amd64), const SYS_SCHED_GETAFFINITY ideal-int +pkg syscall (linux-amd64), const SYS_SCHED_GETPARAM ideal-int +pkg syscall (linux-amd64), const SYS_SCHED_GETSCHEDULER ideal-int +pkg syscall (linux-amd64), const SYS_SCHED_GET_PRIORITY_MAX ideal-int +pkg syscall (linux-amd64), const SYS_SCHED_GET_PRIORITY_MIN ideal-int +pkg syscall (linux-amd64), const SYS_SCHED_RR_GET_INTERVAL ideal-int +pkg syscall (linux-amd64), const SYS_SCHED_SETAFFINITY ideal-int +pkg syscall (linux-amd64), const SYS_SCHED_SETPARAM ideal-int +pkg syscall (linux-amd64), const SYS_SCHED_SETSCHEDULER ideal-int +pkg syscall (linux-amd64), const SYS_SCHED_YIELD ideal-int +pkg syscall (linux-amd64), const SYS_SECURITY ideal-int +pkg syscall (linux-amd64), const SYS_SELECT ideal-int +pkg syscall (linux-amd64), const SYS_SEMCTL ideal-int +pkg syscall (linux-amd64), const SYS_SEMGET ideal-int +pkg syscall (linux-amd64), const SYS_SEMOP ideal-int +pkg syscall (linux-amd64), const SYS_SEMTIMEDOP ideal-int +pkg syscall (linux-amd64), const SYS_SENDFILE ideal-int +pkg syscall (linux-amd64), const SYS_SENDMSG ideal-int +pkg syscall (linux-amd64), const SYS_SENDTO ideal-int +pkg syscall (linux-amd64), const SYS_SETDOMAINNAME ideal-int +pkg syscall (linux-amd64), const SYS_SETFSGID ideal-int +pkg syscall (linux-amd64), const SYS_SETFSUID ideal-int +pkg syscall (linux-amd64), const SYS_SETGID ideal-int +pkg syscall (linux-amd64), const SYS_SETGROUPS ideal-int +pkg syscall (linux-amd64), const SYS_SETHOSTNAME ideal-int +pkg syscall (linux-amd64), const SYS_SETITIMER ideal-int +pkg syscall (linux-amd64), const SYS_SETPGID ideal-int +pkg syscall (linux-amd64), const SYS_SETPRIORITY ideal-int +pkg syscall (linux-amd64), const SYS_SETREGID ideal-int +pkg syscall (linux-amd64), const SYS_SETRESGID ideal-int +pkg syscall (linux-amd64), const SYS_SETRESUID ideal-int +pkg syscall (linux-amd64), const SYS_SETREUID ideal-int +pkg syscall (linux-amd64), const SYS_SETRLIMIT ideal-int +pkg syscall (linux-amd64), const SYS_SETSID ideal-int +pkg syscall (linux-amd64), const SYS_SETSOCKOPT ideal-int +pkg syscall (linux-amd64), const SYS_SETTIMEOFDAY ideal-int +pkg syscall (linux-amd64), const SYS_SETUID ideal-int +pkg syscall (linux-amd64), const SYS_SETXATTR ideal-int +pkg syscall (linux-amd64), const SYS_SET_MEMPOLICY ideal-int +pkg syscall (linux-amd64), const SYS_SET_ROBUST_LIST ideal-int +pkg syscall (linux-amd64), const SYS_SET_THREAD_AREA ideal-int +pkg syscall (linux-amd64), const SYS_SET_TID_ADDRESS ideal-int +pkg syscall (linux-amd64), const SYS_SHMAT ideal-int +pkg syscall (linux-amd64), const SYS_SHMCTL ideal-int +pkg syscall (linux-amd64), const SYS_SHMDT ideal-int +pkg syscall (linux-amd64), const SYS_SHMGET ideal-int +pkg syscall (linux-amd64), const SYS_SHUTDOWN ideal-int +pkg syscall (linux-amd64), const SYS_SIGALTSTACK ideal-int +pkg syscall (linux-amd64), const SYS_SIGNALFD ideal-int +pkg syscall (linux-amd64), const SYS_SIGNALFD4 ideal-int +pkg syscall (linux-amd64), const SYS_SOCKET ideal-int +pkg syscall (linux-amd64), const SYS_SOCKETPAIR ideal-int +pkg syscall (linux-amd64), const SYS_SPLICE ideal-int +pkg syscall (linux-amd64), const SYS_STAT ideal-int +pkg syscall (linux-amd64), const SYS_STATFS ideal-int +pkg syscall (linux-amd64), const SYS_SWAPOFF ideal-int +pkg syscall (linux-amd64), const SYS_SWAPON ideal-int +pkg syscall (linux-amd64), const SYS_SYMLINK ideal-int +pkg syscall (linux-amd64), const SYS_SYMLINKAT ideal-int +pkg syscall (linux-amd64), const SYS_SYNC ideal-int +pkg syscall (linux-amd64), const SYS_SYNC_FILE_RANGE ideal-int +pkg syscall (linux-amd64), const SYS_SYSFS ideal-int +pkg syscall (linux-amd64), const SYS_SYSINFO ideal-int +pkg syscall (linux-amd64), const SYS_SYSLOG ideal-int +pkg syscall (linux-amd64), const SYS_TEE ideal-int +pkg syscall (linux-amd64), const SYS_TGKILL ideal-int +pkg syscall (linux-amd64), const SYS_TIME ideal-int +pkg syscall (linux-amd64), const SYS_TIMERFD_CREATE ideal-int +pkg syscall (linux-amd64), const SYS_TIMERFD_GETTIME ideal-int +pkg syscall (linux-amd64), const SYS_TIMERFD_SETTIME ideal-int +pkg syscall (linux-amd64), const SYS_TIMER_CREATE ideal-int +pkg syscall (linux-amd64), const SYS_TIMER_DELETE ideal-int +pkg syscall (linux-amd64), const SYS_TIMER_GETOVERRUN ideal-int +pkg syscall (linux-amd64), const SYS_TIMER_GETTIME ideal-int +pkg syscall (linux-amd64), const SYS_TIMER_SETTIME ideal-int +pkg syscall (linux-amd64), const SYS_TIMES ideal-int +pkg syscall (linux-amd64), const SYS_TKILL ideal-int +pkg syscall (linux-amd64), const SYS_TRUNCATE ideal-int +pkg syscall (linux-amd64), const SYS_TUXCALL ideal-int +pkg syscall (linux-amd64), const SYS_UMASK ideal-int +pkg syscall (linux-amd64), const SYS_UMOUNT2 ideal-int +pkg syscall (linux-amd64), const SYS_UNAME ideal-int +pkg syscall (linux-amd64), const SYS_UNLINK ideal-int +pkg syscall (linux-amd64), const SYS_UNLINKAT ideal-int +pkg syscall (linux-amd64), const SYS_UNSHARE ideal-int +pkg syscall (linux-amd64), const SYS_USELIB ideal-int +pkg syscall (linux-amd64), const SYS_USTAT ideal-int +pkg syscall (linux-amd64), const SYS_UTIME ideal-int +pkg syscall (linux-amd64), const SYS_UTIMENSAT ideal-int +pkg syscall (linux-amd64), const SYS_UTIMES ideal-int +pkg syscall (linux-amd64), const SYS_VFORK ideal-int +pkg syscall (linux-amd64), const SYS_VHANGUP ideal-int +pkg syscall (linux-amd64), const SYS_VMSPLICE ideal-int +pkg syscall (linux-amd64), const SYS_VSERVER ideal-int +pkg syscall (linux-amd64), const SYS_WAIT4 ideal-int +pkg syscall (linux-amd64), const SYS_WAITID ideal-int +pkg syscall (linux-amd64), const SYS_WRITE ideal-int +pkg syscall (linux-amd64), const SYS_WRITEV ideal-int +pkg syscall (linux-amd64), const SYS__SYSCTL ideal-int +pkg syscall (linux-amd64), const S_BLKSIZE ideal-int +pkg syscall (linux-amd64), const S_IEXEC ideal-int +pkg syscall (linux-amd64), const S_IREAD ideal-int +pkg syscall (linux-amd64), const S_IRGRP ideal-int +pkg syscall (linux-amd64), const S_IROTH ideal-int +pkg syscall (linux-amd64), const S_IRWXG ideal-int +pkg syscall (linux-amd64), const S_IRWXO ideal-int +pkg syscall (linux-amd64), const S_IRWXU ideal-int +pkg syscall (linux-amd64), const S_IWGRP ideal-int +pkg syscall (linux-amd64), const S_IWOTH ideal-int +pkg syscall (linux-amd64), const S_IWRITE ideal-int +pkg syscall (linux-amd64), const S_IXGRP ideal-int +pkg syscall (linux-amd64), const S_IXOTH ideal-int +pkg syscall (linux-amd64), const SizeofCmsghdr ideal-int +pkg syscall (linux-amd64), const SizeofIPMreq ideal-int +pkg syscall (linux-amd64), const SizeofIPMreqn ideal-int +pkg syscall (linux-amd64), const SizeofIPv6Mreq ideal-int +pkg syscall (linux-amd64), const SizeofIfAddrmsg ideal-int +pkg syscall (linux-amd64), const SizeofIfInfomsg ideal-int +pkg syscall (linux-amd64), const SizeofInet4Pktinfo ideal-int +pkg syscall (linux-amd64), const SizeofInet6Pktinfo ideal-int +pkg syscall (linux-amd64), const SizeofInotifyEvent ideal-int +pkg syscall (linux-amd64), const SizeofLinger ideal-int +pkg syscall (linux-amd64), const SizeofMsghdr ideal-int +pkg syscall (linux-amd64), const SizeofNlAttr ideal-int +pkg syscall (linux-amd64), const SizeofNlMsgerr ideal-int +pkg syscall (linux-amd64), const SizeofNlMsghdr ideal-int +pkg syscall (linux-amd64), const SizeofRtAttr ideal-int +pkg syscall (linux-amd64), const SizeofRtGenmsg ideal-int +pkg syscall (linux-amd64), const SizeofRtMsg ideal-int +pkg syscall (linux-amd64), const SizeofRtNexthop ideal-int +pkg syscall (linux-amd64), const SizeofSockFilter ideal-int +pkg syscall (linux-amd64), const SizeofSockFprog ideal-int +pkg syscall (linux-amd64), const SizeofSockaddrAny ideal-int +pkg syscall (linux-amd64), const SizeofSockaddrInet4 ideal-int +pkg syscall (linux-amd64), const SizeofSockaddrInet6 ideal-int +pkg syscall (linux-amd64), const SizeofSockaddrLinklayer ideal-int +pkg syscall (linux-amd64), const SizeofSockaddrNetlink ideal-int +pkg syscall (linux-amd64), const SizeofSockaddrUnix ideal-int +pkg syscall (linux-amd64), const SizeofUcred ideal-int +pkg syscall (linux-amd64), const TCGETS ideal-int +pkg syscall (linux-amd64), const TCP_CONGESTION ideal-int +pkg syscall (linux-amd64), const TCP_CORK ideal-int +pkg syscall (linux-amd64), const TCP_DEFER_ACCEPT ideal-int +pkg syscall (linux-amd64), const TCP_INFO ideal-int +pkg syscall (linux-amd64), const TCP_KEEPCNT ideal-int +pkg syscall (linux-amd64), const TCP_KEEPIDLE ideal-int +pkg syscall (linux-amd64), const TCP_KEEPINTVL ideal-int +pkg syscall (linux-amd64), const TCP_LINGER2 ideal-int +pkg syscall (linux-amd64), const TCP_MAXSEG ideal-int +pkg syscall (linux-amd64), const TCP_MAXWIN ideal-int +pkg syscall (linux-amd64), const TCP_MAX_WINSHIFT ideal-int +pkg syscall (linux-amd64), const TCP_MD5SIG ideal-int +pkg syscall (linux-amd64), const TCP_MD5SIG_MAXKEYLEN ideal-int +pkg syscall (linux-amd64), const TCP_MSS ideal-int +pkg syscall (linux-amd64), const TCP_QUICKACK ideal-int +pkg syscall (linux-amd64), const TCP_SYNCNT ideal-int +pkg syscall (linux-amd64), const TCP_WINDOW_CLAMP ideal-int +pkg syscall (linux-amd64), const TCSETS ideal-int +pkg syscall (linux-amd64), const TIOCCBRK ideal-int +pkg syscall (linux-amd64), const TIOCCONS ideal-int +pkg syscall (linux-amd64), const TIOCEXCL ideal-int +pkg syscall (linux-amd64), const TIOCGDEV ideal-int +pkg syscall (linux-amd64), const TIOCGETD ideal-int +pkg syscall (linux-amd64), const TIOCGICOUNT ideal-int +pkg syscall (linux-amd64), const TIOCGLCKTRMIOS ideal-int +pkg syscall (linux-amd64), const TIOCGPGRP ideal-int +pkg syscall (linux-amd64), const TIOCGPTN ideal-int +pkg syscall (linux-amd64), const TIOCGRS485 ideal-int +pkg syscall (linux-amd64), const TIOCGSERIAL ideal-int +pkg syscall (linux-amd64), const TIOCGSID ideal-int +pkg syscall (linux-amd64), const TIOCGSOFTCAR ideal-int +pkg syscall (linux-amd64), const TIOCGWINSZ ideal-int +pkg syscall (linux-amd64), const TIOCINQ ideal-int +pkg syscall (linux-amd64), const TIOCLINUX ideal-int +pkg syscall (linux-amd64), const TIOCMBIC ideal-int +pkg syscall (linux-amd64), const TIOCMBIS ideal-int +pkg syscall (linux-amd64), const TIOCMGET ideal-int +pkg syscall (linux-amd64), const TIOCMIWAIT ideal-int +pkg syscall (linux-amd64), const TIOCMSET ideal-int +pkg syscall (linux-amd64), const TIOCM_CAR ideal-int +pkg syscall (linux-amd64), const TIOCM_CD ideal-int +pkg syscall (linux-amd64), const TIOCM_CTS ideal-int +pkg syscall (linux-amd64), const TIOCM_DSR ideal-int +pkg syscall (linux-amd64), const TIOCM_DTR ideal-int +pkg syscall (linux-amd64), const TIOCM_LE ideal-int +pkg syscall (linux-amd64), const TIOCM_RI ideal-int +pkg syscall (linux-amd64), const TIOCM_RNG ideal-int +pkg syscall (linux-amd64), const TIOCM_RTS ideal-int +pkg syscall (linux-amd64), const TIOCM_SR ideal-int +pkg syscall (linux-amd64), const TIOCM_ST ideal-int +pkg syscall (linux-amd64), const TIOCNOTTY ideal-int +pkg syscall (linux-amd64), const TIOCNXCL ideal-int +pkg syscall (linux-amd64), const TIOCOUTQ ideal-int +pkg syscall (linux-amd64), const TIOCPKT ideal-int +pkg syscall (linux-amd64), const TIOCPKT_DATA ideal-int +pkg syscall (linux-amd64), const TIOCPKT_DOSTOP ideal-int +pkg syscall (linux-amd64), const TIOCPKT_FLUSHREAD ideal-int +pkg syscall (linux-amd64), const TIOCPKT_FLUSHWRITE ideal-int +pkg syscall (linux-amd64), const TIOCPKT_IOCTL ideal-int +pkg syscall (linux-amd64), const TIOCPKT_NOSTOP ideal-int +pkg syscall (linux-amd64), const TIOCPKT_START ideal-int +pkg syscall (linux-amd64), const TIOCPKT_STOP ideal-int +pkg syscall (linux-amd64), const TIOCSBRK ideal-int +pkg syscall (linux-amd64), const TIOCSCTTY ideal-int +pkg syscall (linux-amd64), const TIOCSERCONFIG ideal-int +pkg syscall (linux-amd64), const TIOCSERGETLSR ideal-int +pkg syscall (linux-amd64), const TIOCSERGETMULTI ideal-int +pkg syscall (linux-amd64), const TIOCSERGSTRUCT ideal-int +pkg syscall (linux-amd64), const TIOCSERGWILD ideal-int +pkg syscall (linux-amd64), const TIOCSERSETMULTI ideal-int +pkg syscall (linux-amd64), const TIOCSERSWILD ideal-int +pkg syscall (linux-amd64), const TIOCSER_TEMT ideal-int +pkg syscall (linux-amd64), const TIOCSETD ideal-int +pkg syscall (linux-amd64), const TIOCSIG ideal-int +pkg syscall (linux-amd64), const TIOCSLCKTRMIOS ideal-int +pkg syscall (linux-amd64), const TIOCSPGRP ideal-int +pkg syscall (linux-amd64), const TIOCSPTLCK ideal-int +pkg syscall (linux-amd64), const TIOCSRS485 ideal-int +pkg syscall (linux-amd64), const TIOCSSERIAL ideal-int +pkg syscall (linux-amd64), const TIOCSSOFTCAR ideal-int +pkg syscall (linux-amd64), const TIOCSTI ideal-int +pkg syscall (linux-amd64), const TIOCSWINSZ ideal-int +pkg syscall (linux-amd64), const TOSTOP ideal-int +pkg syscall (linux-amd64), const TUNATTACHFILTER ideal-int +pkg syscall (linux-amd64), const TUNDETACHFILTER ideal-int +pkg syscall (linux-amd64), const TUNGETFEATURES ideal-int +pkg syscall (linux-amd64), const TUNGETIFF ideal-int +pkg syscall (linux-amd64), const TUNGETSNDBUF ideal-int +pkg syscall (linux-amd64), const TUNGETVNETHDRSZ ideal-int +pkg syscall (linux-amd64), const TUNSETDEBUG ideal-int +pkg syscall (linux-amd64), const TUNSETGROUP ideal-int +pkg syscall (linux-amd64), const TUNSETIFF ideal-int +pkg syscall (linux-amd64), const TUNSETLINK ideal-int +pkg syscall (linux-amd64), const TUNSETNOCSUM ideal-int +pkg syscall (linux-amd64), const TUNSETOFFLOAD ideal-int +pkg syscall (linux-amd64), const TUNSETOWNER ideal-int +pkg syscall (linux-amd64), const TUNSETPERSIST ideal-int +pkg syscall (linux-amd64), const TUNSETSNDBUF ideal-int +pkg syscall (linux-amd64), const TUNSETTXFILTER ideal-int +pkg syscall (linux-amd64), const TUNSETVNETHDRSZ ideal-int +pkg syscall (linux-amd64), const VDISCARD ideal-int +pkg syscall (linux-amd64), const VEOF ideal-int +pkg syscall (linux-amd64), const VEOL ideal-int +pkg syscall (linux-amd64), const VEOL2 ideal-int +pkg syscall (linux-amd64), const VERASE ideal-int +pkg syscall (linux-amd64), const VINTR ideal-int +pkg syscall (linux-amd64), const VKILL ideal-int +pkg syscall (linux-amd64), const VLNEXT ideal-int +pkg syscall (linux-amd64), const VMIN ideal-int +pkg syscall (linux-amd64), const VQUIT ideal-int +pkg syscall (linux-amd64), const VREPRINT ideal-int +pkg syscall (linux-amd64), const VSTART ideal-int +pkg syscall (linux-amd64), const VSTOP ideal-int +pkg syscall (linux-amd64), const VSUSP ideal-int +pkg syscall (linux-amd64), const VSWTC ideal-int +pkg syscall (linux-amd64), const VTIME ideal-int +pkg syscall (linux-amd64), const VWERASE ideal-int +pkg syscall (linux-amd64), const WALL ideal-int +pkg syscall (linux-amd64), const WCLONE ideal-int +pkg syscall (linux-amd64), const WCONTINUED ideal-int +pkg syscall (linux-amd64), const WEXITED ideal-int +pkg syscall (linux-amd64), const WNOHANG ideal-int +pkg syscall (linux-amd64), const WNOTHREAD ideal-int +pkg syscall (linux-amd64), const WNOWAIT ideal-int +pkg syscall (linux-amd64), const WORDSIZE ideal-int +pkg syscall (linux-amd64), const WSTOPPED ideal-int +pkg syscall (linux-amd64), const WUNTRACED ideal-int +pkg syscall (linux-amd64), const XCASE ideal-int +pkg syscall (linux-amd64), func Accept(int) (int, Sockaddr, error) +pkg syscall (linux-amd64), func Access(string, uint32) error +pkg syscall (linux-amd64), func Acct(string) error +pkg syscall (linux-amd64), func Adjtimex(*Timex) (int, error) +pkg syscall (linux-amd64), func AttachLsf(int, []SockFilter) error +pkg syscall (linux-amd64), func Bind(int, Sockaddr) error +pkg syscall (linux-amd64), func BindToDevice(int, string) error +pkg syscall (linux-amd64), func Chroot(string) error +pkg syscall (linux-amd64), func Close(int) error +pkg syscall (linux-amd64), func CloseOnExec(int) +pkg syscall (linux-amd64), func CmsgLen(int) int +pkg syscall (linux-amd64), func CmsgSpace(int) int +pkg syscall (linux-amd64), func Connect(int, Sockaddr) error +pkg syscall (linux-amd64), func Creat(string, uint32) (int, error) +pkg syscall (linux-amd64), func DetachLsf(int) error +pkg syscall (linux-amd64), func Dup(int) (int, error) +pkg syscall (linux-amd64), func Dup2(int, int) error +pkg syscall (linux-amd64), func EpollCreate(int) (int, error) +pkg syscall (linux-amd64), func EpollCreate1(int) (int, error) +pkg syscall (linux-amd64), func EpollCtl(int, int, int, *EpollEvent) error +pkg syscall (linux-amd64), func EpollWait(int, []EpollEvent, int) (int, error) +pkg syscall (linux-amd64), func Faccessat(int, string, uint32, int) error +pkg syscall (linux-amd64), func Fallocate(int, uint32, int64, int64) error +pkg syscall (linux-amd64), func Fchdir(int) error +pkg syscall (linux-amd64), func Fchmod(int, uint32) error +pkg syscall (linux-amd64), func Fchmodat(int, string, uint32, int) error +pkg syscall (linux-amd64), func Fchown(int, int, int) error +pkg syscall (linux-amd64), func Fchownat(int, string, int, int, int) error +pkg syscall (linux-amd64), func Fdatasync(int) error +pkg syscall (linux-amd64), func Flock(int, int) error +pkg syscall (linux-amd64), func ForkExec(string, []string, *ProcAttr) (int, error) +pkg syscall (linux-amd64), func Fstat(int, *Stat_t) error +pkg syscall (linux-amd64), func Fstatfs(int, *Statfs_t) error +pkg syscall (linux-amd64), func Fsync(int) error +pkg syscall (linux-amd64), func Ftruncate(int, int64) error +pkg syscall (linux-amd64), func Futimes(int, []Timeval) error +pkg syscall (linux-amd64), func Futimesat(int, string, []Timeval) error +pkg syscall (linux-amd64), func Getcwd([]uint8) (int, error) +pkg syscall (linux-amd64), func Getdents(int, []uint8) (int, error) +pkg syscall (linux-amd64), func Getpeername(int) (Sockaddr, error) +pkg syscall (linux-amd64), func Getpgid(int) (int, error) +pkg syscall (linux-amd64), func Getpgrp() int +pkg syscall (linux-amd64), func Getrlimit(int, *Rlimit) error +pkg syscall (linux-amd64), func Getrusage(int, *Rusage) error +pkg syscall (linux-amd64), func Getsockname(int) (Sockaddr, error) +pkg syscall (linux-amd64), func GetsockoptIPMreq(int, int, int) (*IPMreq, error) +pkg syscall (linux-amd64), func GetsockoptIPMreqn(int, int, int) (*IPMreqn, error) +pkg syscall (linux-amd64), func GetsockoptIPv6Mreq(int, int, int) (*IPv6Mreq, error) +pkg syscall (linux-amd64), func GetsockoptInet4Addr(int, int, int) ([4]uint8, error) +pkg syscall (linux-amd64), func GetsockoptInt(int, int, int) (int, error) +pkg syscall (linux-amd64), func Gettid() int +pkg syscall (linux-amd64), func InotifyAddWatch(int, string, uint32) (int, error) +pkg syscall (linux-amd64), func InotifyInit() (int, error) +pkg syscall (linux-amd64), func InotifyInit1(int) (int, error) +pkg syscall (linux-amd64), func InotifyRmWatch(int, uint32) (int, error) +pkg syscall (linux-amd64), func Ioperm(int, int, int) error +pkg syscall (linux-amd64), func Iopl(int) error +pkg syscall (linux-amd64), func Kill(int, Signal) error +pkg syscall (linux-amd64), func Klogctl(int, []uint8) (int, error) +pkg syscall (linux-amd64), func Listen(int, int) error +pkg syscall (linux-amd64), func LsfJump(int, int, int, int) *SockFilter +pkg syscall (linux-amd64), func LsfSocket(int, int) (int, error) +pkg syscall (linux-amd64), func LsfStmt(int, int) *SockFilter +pkg syscall (linux-amd64), func Lstat(string, *Stat_t) error +pkg syscall (linux-amd64), func Madvise([]uint8, int) error +pkg syscall (linux-amd64), func Mkdirat(int, string, uint32) error +pkg syscall (linux-amd64), func Mkfifo(string, uint32) error +pkg syscall (linux-amd64), func Mknod(string, uint32, int) error +pkg syscall (linux-amd64), func Mknodat(int, string, uint32, int) error +pkg syscall (linux-amd64), func Mlock([]uint8) error +pkg syscall (linux-amd64), func Mlockall(int) error +pkg syscall (linux-amd64), func Mmap(int, int64, int, int, int) ([]uint8, error) +pkg syscall (linux-amd64), func Mount(string, string, string, uintptr, string) error +pkg syscall (linux-amd64), func Mprotect([]uint8, int) error +pkg syscall (linux-amd64), func Munlock([]uint8) error +pkg syscall (linux-amd64), func Munlockall() error +pkg syscall (linux-amd64), func Munmap([]uint8) error +pkg syscall (linux-amd64), func Nanosleep(*Timespec, *Timespec) error +pkg syscall (linux-amd64), func NetlinkRIB(int, int) ([]uint8, error) +pkg syscall (linux-amd64), func NsecToTimespec(int64) Timespec +pkg syscall (linux-amd64), func Open(string, int, uint32) (int, error) +pkg syscall (linux-amd64), func Openat(int, string, int, uint32) (int, error) +pkg syscall (linux-amd64), func ParseDirent([]uint8, int, []string) (int, int, []string) +pkg syscall (linux-amd64), func ParseNetlinkMessage([]uint8) ([]NetlinkMessage, error) +pkg syscall (linux-amd64), func ParseNetlinkRouteAttr(*NetlinkMessage) ([]NetlinkRouteAttr, error) +pkg syscall (linux-amd64), func ParseSocketControlMessage([]uint8) ([]SocketControlMessage, error) +pkg syscall (linux-amd64), func ParseUnixCredentials(*SocketControlMessage) (*Ucred, error) +pkg syscall (linux-amd64), func ParseUnixRights(*SocketControlMessage) ([]int, error) +pkg syscall (linux-amd64), func Pause() error +pkg syscall (linux-amd64), func Pipe([]int) error +pkg syscall (linux-amd64), func PivotRoot(string, string) error +pkg syscall (linux-amd64), func Pread(int, []uint8, int64) (int, error) +pkg syscall (linux-amd64), func PtraceAttach(int) error +pkg syscall (linux-amd64), func PtraceCont(int, int) error +pkg syscall (linux-amd64), func PtraceDetach(int) error +pkg syscall (linux-amd64), func PtraceGetEventMsg(int) (uint, error) +pkg syscall (linux-amd64), func PtraceGetRegs(int, *PtraceRegs) error +pkg syscall (linux-amd64), func PtracePeekData(int, uintptr, []uint8) (int, error) +pkg syscall (linux-amd64), func PtracePeekText(int, uintptr, []uint8) (int, error) +pkg syscall (linux-amd64), func PtracePokeData(int, uintptr, []uint8) (int, error) +pkg syscall (linux-amd64), func PtracePokeText(int, uintptr, []uint8) (int, error) +pkg syscall (linux-amd64), func PtraceSetOptions(int, int) error +pkg syscall (linux-amd64), func PtraceSetRegs(int, *PtraceRegs) error +pkg syscall (linux-amd64), func PtraceSingleStep(int) error +pkg syscall (linux-amd64), func Pwrite(int, []uint8, int64) (int, error) +pkg syscall (linux-amd64), func RawSyscall(uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno) +pkg syscall (linux-amd64), func RawSyscall6(uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno) +pkg syscall (linux-amd64), func Read(int, []uint8) (int, error) +pkg syscall (linux-amd64), func ReadDirent(int, []uint8) (int, error) +pkg syscall (linux-amd64), func Reboot(int) error +pkg syscall (linux-amd64), func Recvfrom(int, []uint8, int) (int, Sockaddr, error) +pkg syscall (linux-amd64), func Recvmsg(int, []uint8, []uint8, int) (int, int, int, Sockaddr, error) +pkg syscall (linux-amd64), func Renameat(int, string, int, string) error +pkg syscall (linux-amd64), func Seek(int, int64, int) (int64, error) +pkg syscall (linux-amd64), func Select(int, *FdSet, *FdSet, *FdSet, *Timeval) (int, error) +pkg syscall (linux-amd64), func Sendfile(int, int, *int64, int) (int, error) +pkg syscall (linux-amd64), func Sendmsg(int, []uint8, []uint8, Sockaddr, int) error +pkg syscall (linux-amd64), func Sendto(int, []uint8, int, Sockaddr) error +pkg syscall (linux-amd64), func SetLsfPromisc(string, bool) error +pkg syscall (linux-amd64), func SetNonblock(int, bool) error +pkg syscall (linux-amd64), func Setdomainname([]uint8) error +pkg syscall (linux-amd64), func Setfsgid(int) error +pkg syscall (linux-amd64), func Setfsuid(int) error +pkg syscall (linux-amd64), func Setgid(int) error +pkg syscall (linux-amd64), func Setgroups([]int) error +pkg syscall (linux-amd64), func Sethostname([]uint8) error +pkg syscall (linux-amd64), func Setpgid(int, int) error +pkg syscall (linux-amd64), func Setregid(int, int) error +pkg syscall (linux-amd64), func Setresgid(int, int, int) error +pkg syscall (linux-amd64), func Setresuid(int, int, int) error +pkg syscall (linux-amd64), func Setreuid(int, int) error +pkg syscall (linux-amd64), func Setrlimit(int, *Rlimit) error +pkg syscall (linux-amd64), func Setsid() (int, error) +pkg syscall (linux-amd64), func SetsockoptIPMreq(int, int, int, *IPMreq) error +pkg syscall (linux-amd64), func SetsockoptIPMreqn(int, int, int, *IPMreqn) error +pkg syscall (linux-amd64), func SetsockoptIPv6Mreq(int, int, int, *IPv6Mreq) error +pkg syscall (linux-amd64), func SetsockoptInet4Addr(int, int, int, [4]uint8) error +pkg syscall (linux-amd64), func SetsockoptInt(int, int, int, int) error +pkg syscall (linux-amd64), func SetsockoptLinger(int, int, int, *Linger) error +pkg syscall (linux-amd64), func SetsockoptString(int, int, int, string) error +pkg syscall (linux-amd64), func SetsockoptTimeval(int, int, int, *Timeval) error +pkg syscall (linux-amd64), func Settimeofday(*Timeval) error +pkg syscall (linux-amd64), func Setuid(int) error +pkg syscall (linux-amd64), func Shutdown(int, int) error +pkg syscall (linux-amd64), func Socket(int, int, int) (int, error) +pkg syscall (linux-amd64), func Socketpair(int, int, int) ([2]int, error) +pkg syscall (linux-amd64), func Splice(int, *int64, int, *int64, int, int) (int64, error) +pkg syscall (linux-amd64), func Stat(string, *Stat_t) error +pkg syscall (linux-amd64), func Statfs(string, *Statfs_t) error +pkg syscall (linux-amd64), func StringSlicePtr([]string) []*uint8 +pkg syscall (linux-amd64), func Sync() +pkg syscall (linux-amd64), func SyncFileRange(int, int64, int64, int) error +pkg syscall (linux-amd64), func Syscall(uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno) +pkg syscall (linux-amd64), func Syscall6(uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno) +pkg syscall (linux-amd64), func Sysinfo(*Sysinfo_t) error +pkg syscall (linux-amd64), func Tee(int, int, int, int) (int64, error) +pkg syscall (linux-amd64), func Tgkill(int, int, Signal) error +pkg syscall (linux-amd64), func Time(*Time_t) (Time_t, error) +pkg syscall (linux-amd64), func Times(*Tms) (uintptr, error) +pkg syscall (linux-amd64), func TimespecToNsec(Timespec) int64 +pkg syscall (linux-amd64), func TimevalToNsec(Timeval) int64 +pkg syscall (linux-amd64), func Truncate(string, int64) error +pkg syscall (linux-amd64), func Umask(int) int +pkg syscall (linux-amd64), func Uname(*Utsname) error +pkg syscall (linux-amd64), func UnixCredentials(*Ucred) []uint8 +pkg syscall (linux-amd64), func UnixRights(...int) []uint8 +pkg syscall (linux-amd64), func Unlinkat(int, string) error +pkg syscall (linux-amd64), func Unmount(string, int) error +pkg syscall (linux-amd64), func Unshare(int) error +pkg syscall (linux-amd64), func Ustat(int, *Ustat_t) error +pkg syscall (linux-amd64), func Utime(string, *Utimbuf) error +pkg syscall (linux-amd64), func Wait4(int, *WaitStatus, int, *Rusage) (int, error) +pkg syscall (linux-amd64), func Write(int, []uint8) (int, error) +pkg syscall (linux-amd64), method (*Cmsghdr) SetLen(int) +pkg syscall (linux-amd64), method (*Iovec) SetLen(int) +pkg syscall (linux-amd64), method (*Msghdr) SetControllen(int) +pkg syscall (linux-amd64), method (*PtraceRegs) PC() uint64 +pkg syscall (linux-amd64), method (*PtraceRegs) SetPC(uint64) +pkg syscall (linux-amd64), type Cmsghdr struct +pkg syscall (linux-amd64), type Cmsghdr struct, Len uint64 +pkg syscall (linux-amd64), type Cmsghdr struct, Level int32 +pkg syscall (linux-amd64), type Cmsghdr struct, Type int32 +pkg syscall (linux-amd64), type Cmsghdr struct, X__cmsg_data [0]uint8 +pkg syscall (linux-amd64), type Credential struct +pkg syscall (linux-amd64), type Credential struct, Gid uint32 +pkg syscall (linux-amd64), type Credential struct, Groups []uint32 +pkg syscall (linux-amd64), type Credential struct, Uid uint32 +pkg syscall (linux-amd64), type Dirent struct +pkg syscall (linux-amd64), type Dirent struct, Ino uint64 +pkg syscall (linux-amd64), type Dirent struct, Name [256]int8 +pkg syscall (linux-amd64), type Dirent struct, Off int64 +pkg syscall (linux-amd64), type Dirent struct, Pad_cgo_0 [5]uint8 +pkg syscall (linux-amd64), type Dirent struct, Reclen uint16 +pkg syscall (linux-amd64), type Dirent struct, Type uint8 +pkg syscall (linux-amd64), type EpollEvent struct +pkg syscall (linux-amd64), type EpollEvent struct, Events uint32 +pkg syscall (linux-amd64), type EpollEvent struct, Fd int32 +pkg syscall (linux-amd64), type EpollEvent struct, Pad int32 +pkg syscall (linux-amd64), type FdSet struct +pkg syscall (linux-amd64), type FdSet struct, Bits [16]int64 +pkg syscall (linux-amd64), type Fsid struct +pkg syscall (linux-amd64), type Fsid struct, X__val [2]int32 +pkg syscall (linux-amd64), type IPMreqn struct +pkg syscall (linux-amd64), type IPMreqn struct, Address [4]uint8 +pkg syscall (linux-amd64), type IPMreqn struct, Ifindex int32 +pkg syscall (linux-amd64), type IPMreqn struct, Multiaddr [4]uint8 +pkg syscall (linux-amd64), type IfAddrmsg struct +pkg syscall (linux-amd64), type IfAddrmsg struct, Family uint8 +pkg syscall (linux-amd64), type IfAddrmsg struct, Flags uint8 +pkg syscall (linux-amd64), type IfAddrmsg struct, Index uint32 +pkg syscall (linux-amd64), type IfAddrmsg struct, Prefixlen uint8 +pkg syscall (linux-amd64), type IfAddrmsg struct, Scope uint8 +pkg syscall (linux-amd64), type IfInfomsg struct +pkg syscall (linux-amd64), type IfInfomsg struct, Change uint32 +pkg syscall (linux-amd64), type IfInfomsg struct, Family uint8 +pkg syscall (linux-amd64), type IfInfomsg struct, Flags uint32 +pkg syscall (linux-amd64), type IfInfomsg struct, Index int32 +pkg syscall (linux-amd64), type IfInfomsg struct, Type uint16 +pkg syscall (linux-amd64), type IfInfomsg struct, X__ifi_pad uint8 +pkg syscall (linux-amd64), type Inet4Pktinfo struct +pkg syscall (linux-amd64), type Inet4Pktinfo struct, Addr [4]uint8 +pkg syscall (linux-amd64), type Inet4Pktinfo struct, Ifindex int32 +pkg syscall (linux-amd64), type Inet4Pktinfo struct, Spec_dst [4]uint8 +pkg syscall (linux-amd64), type Inet6Pktinfo struct +pkg syscall (linux-amd64), type Inet6Pktinfo struct, Addr [16]uint8 +pkg syscall (linux-amd64), type Inet6Pktinfo struct, Ifindex uint32 +pkg syscall (linux-amd64), type InotifyEvent struct +pkg syscall (linux-amd64), type InotifyEvent struct, Cookie uint32 +pkg syscall (linux-amd64), type InotifyEvent struct, Len uint32 +pkg syscall (linux-amd64), type InotifyEvent struct, Mask uint32 +pkg syscall (linux-amd64), type InotifyEvent struct, Name [0]uint8 +pkg syscall (linux-amd64), type InotifyEvent struct, Wd int32 +pkg syscall (linux-amd64), type Iovec struct +pkg syscall (linux-amd64), type Iovec struct, Base *uint8 +pkg syscall (linux-amd64), type Iovec struct, Len uint64 +pkg syscall (linux-amd64), type Msghdr struct +pkg syscall (linux-amd64), type Msghdr struct, Control *uint8 +pkg syscall (linux-amd64), type Msghdr struct, Controllen uint64 +pkg syscall (linux-amd64), type Msghdr struct, Flags int32 +pkg syscall (linux-amd64), type Msghdr struct, Iov *Iovec +pkg syscall (linux-amd64), type Msghdr struct, Iovlen uint64 +pkg syscall (linux-amd64), type Msghdr struct, Name *uint8 +pkg syscall (linux-amd64), type Msghdr struct, Namelen uint32 +pkg syscall (linux-amd64), type Msghdr struct, Pad_cgo_0 [4]uint8 +pkg syscall (linux-amd64), type Msghdr struct, Pad_cgo_1 [4]uint8 +pkg syscall (linux-amd64), type NetlinkMessage struct +pkg syscall (linux-amd64), type NetlinkMessage struct, Data []uint8 +pkg syscall (linux-amd64), type NetlinkMessage struct, Header NlMsghdr +pkg syscall (linux-amd64), type NetlinkRouteAttr struct +pkg syscall (linux-amd64), type NetlinkRouteAttr struct, Attr RtAttr +pkg syscall (linux-amd64), type NetlinkRouteAttr struct, Value []uint8 +pkg syscall (linux-amd64), type NetlinkRouteRequest struct +pkg syscall (linux-amd64), type NetlinkRouteRequest struct, Data RtGenmsg +pkg syscall (linux-amd64), type NetlinkRouteRequest struct, Header NlMsghdr +pkg syscall (linux-amd64), type NlAttr struct +pkg syscall (linux-amd64), type NlAttr struct, Len uint16 +pkg syscall (linux-amd64), type NlAttr struct, Type uint16 +pkg syscall (linux-amd64), type NlMsgerr struct +pkg syscall (linux-amd64), type NlMsgerr struct, Error int32 +pkg syscall (linux-amd64), type NlMsgerr struct, Msg NlMsghdr +pkg syscall (linux-amd64), type NlMsghdr struct +pkg syscall (linux-amd64), type NlMsghdr struct, Flags uint16 +pkg syscall (linux-amd64), type NlMsghdr struct, Len uint32 +pkg syscall (linux-amd64), type NlMsghdr struct, Pid uint32 +pkg syscall (linux-amd64), type NlMsghdr struct, Seq uint32 +pkg syscall (linux-amd64), type NlMsghdr struct, Type uint16 +pkg syscall (linux-amd64), type PtraceRegs struct +pkg syscall (linux-amd64), type PtraceRegs struct, Cs uint64 +pkg syscall (linux-amd64), type PtraceRegs struct, Ds uint64 +pkg syscall (linux-amd64), type PtraceRegs struct, Eflags uint64 +pkg syscall (linux-amd64), type PtraceRegs struct, Es uint64 +pkg syscall (linux-amd64), type PtraceRegs struct, Fs uint64 +pkg syscall (linux-amd64), type PtraceRegs struct, Fs_base uint64 +pkg syscall (linux-amd64), type PtraceRegs struct, Gs uint64 +pkg syscall (linux-amd64), type PtraceRegs struct, Gs_base uint64 +pkg syscall (linux-amd64), type PtraceRegs struct, Orig_rax uint64 +pkg syscall (linux-amd64), type PtraceRegs struct, R10 uint64 +pkg syscall (linux-amd64), type PtraceRegs struct, R11 uint64 +pkg syscall (linux-amd64), type PtraceRegs struct, R12 uint64 +pkg syscall (linux-amd64), type PtraceRegs struct, R13 uint64 +pkg syscall (linux-amd64), type PtraceRegs struct, R14 uint64 +pkg syscall (linux-amd64), type PtraceRegs struct, R15 uint64 +pkg syscall (linux-amd64), type PtraceRegs struct, R8 uint64 +pkg syscall (linux-amd64), type PtraceRegs struct, R9 uint64 +pkg syscall (linux-amd64), type PtraceRegs struct, Rax uint64 +pkg syscall (linux-amd64), type PtraceRegs struct, Rbp uint64 +pkg syscall (linux-amd64), type PtraceRegs struct, Rbx uint64 +pkg syscall (linux-amd64), type PtraceRegs struct, Rcx uint64 +pkg syscall (linux-amd64), type PtraceRegs struct, Rdi uint64 +pkg syscall (linux-amd64), type PtraceRegs struct, Rdx uint64 +pkg syscall (linux-amd64), type PtraceRegs struct, Rip uint64 +pkg syscall (linux-amd64), type PtraceRegs struct, Rsi uint64 +pkg syscall (linux-amd64), type PtraceRegs struct, Rsp uint64 +pkg syscall (linux-amd64), type PtraceRegs struct, Ss uint64 +pkg syscall (linux-amd64), type RawSockaddr struct, Data [14]int8 +pkg syscall (linux-amd64), type RawSockaddr struct, Family uint16 +pkg syscall (linux-amd64), type RawSockaddrAny struct, Pad [96]int8 +pkg syscall (linux-amd64), type RawSockaddrInet4 struct, Family uint16 +pkg syscall (linux-amd64), type RawSockaddrInet4 struct, Zero [8]uint8 +pkg syscall (linux-amd64), type RawSockaddrInet6 struct +pkg syscall (linux-amd64), type RawSockaddrInet6 struct, Addr [16]uint8 +pkg syscall (linux-amd64), type RawSockaddrInet6 struct, Family uint16 +pkg syscall (linux-amd64), type RawSockaddrInet6 struct, Flowinfo uint32 +pkg syscall (linux-amd64), type RawSockaddrInet6 struct, Port uint16 +pkg syscall (linux-amd64), type RawSockaddrInet6 struct, Scope_id uint32 +pkg syscall (linux-amd64), type RawSockaddrLinklayer struct +pkg syscall (linux-amd64), type RawSockaddrLinklayer struct, Addr [8]uint8 +pkg syscall (linux-amd64), type RawSockaddrLinklayer struct, Family uint16 +pkg syscall (linux-amd64), type RawSockaddrLinklayer struct, Halen uint8 +pkg syscall (linux-amd64), type RawSockaddrLinklayer struct, Hatype uint16 +pkg syscall (linux-amd64), type RawSockaddrLinklayer struct, Ifindex int32 +pkg syscall (linux-amd64), type RawSockaddrLinklayer struct, Pkttype uint8 +pkg syscall (linux-amd64), type RawSockaddrLinklayer struct, Protocol uint16 +pkg syscall (linux-amd64), type RawSockaddrNetlink struct +pkg syscall (linux-amd64), type RawSockaddrNetlink struct, Family uint16 +pkg syscall (linux-amd64), type RawSockaddrNetlink struct, Groups uint32 +pkg syscall (linux-amd64), type RawSockaddrNetlink struct, Pad uint16 +pkg syscall (linux-amd64), type RawSockaddrNetlink struct, Pid uint32 +pkg syscall (linux-amd64), type RawSockaddrUnix struct +pkg syscall (linux-amd64), type RawSockaddrUnix struct, Family uint16 +pkg syscall (linux-amd64), type RawSockaddrUnix struct, Path [108]int8 +pkg syscall (linux-amd64), type Rlimit struct +pkg syscall (linux-amd64), type Rlimit struct, Cur uint64 +pkg syscall (linux-amd64), type Rlimit struct, Max uint64 +pkg syscall (linux-amd64), type RtAttr struct +pkg syscall (linux-amd64), type RtAttr struct, Len uint16 +pkg syscall (linux-amd64), type RtAttr struct, Type uint16 +pkg syscall (linux-amd64), type RtGenmsg struct +pkg syscall (linux-amd64), type RtGenmsg struct, Family uint8 +pkg syscall (linux-amd64), type RtMsg struct +pkg syscall (linux-amd64), type RtMsg struct, Dst_len uint8 +pkg syscall (linux-amd64), type RtMsg struct, Family uint8 +pkg syscall (linux-amd64), type RtMsg struct, Flags uint32 +pkg syscall (linux-amd64), type RtMsg struct, Protocol uint8 +pkg syscall (linux-amd64), type RtMsg struct, Scope uint8 +pkg syscall (linux-amd64), type RtMsg struct, Src_len uint8 +pkg syscall (linux-amd64), type RtMsg struct, Table uint8 +pkg syscall (linux-amd64), type RtMsg struct, Tos uint8 +pkg syscall (linux-amd64), type RtMsg struct, Type uint8 +pkg syscall (linux-amd64), type RtNexthop struct +pkg syscall (linux-amd64), type RtNexthop struct, Flags uint8 +pkg syscall (linux-amd64), type RtNexthop struct, Hops uint8 +pkg syscall (linux-amd64), type RtNexthop struct, Ifindex int32 +pkg syscall (linux-amd64), type RtNexthop struct, Len uint16 +pkg syscall (linux-amd64), type Rusage struct, Idrss int64 +pkg syscall (linux-amd64), type Rusage struct, Inblock int64 +pkg syscall (linux-amd64), type Rusage struct, Isrss int64 +pkg syscall (linux-amd64), type Rusage struct, Ixrss int64 +pkg syscall (linux-amd64), type Rusage struct, Majflt int64 +pkg syscall (linux-amd64), type Rusage struct, Maxrss int64 +pkg syscall (linux-amd64), type Rusage struct, Minflt int64 +pkg syscall (linux-amd64), type Rusage struct, Msgrcv int64 +pkg syscall (linux-amd64), type Rusage struct, Msgsnd int64 +pkg syscall (linux-amd64), type Rusage struct, Nivcsw int64 +pkg syscall (linux-amd64), type Rusage struct, Nsignals int64 +pkg syscall (linux-amd64), type Rusage struct, Nswap int64 +pkg syscall (linux-amd64), type Rusage struct, Nvcsw int64 +pkg syscall (linux-amd64), type Rusage struct, Oublock int64 +pkg syscall (linux-amd64), type Rusage struct, Stime Timeval +pkg syscall (linux-amd64), type Rusage struct, Utime Timeval +pkg syscall (linux-amd64), type SockFilter struct +pkg syscall (linux-amd64), type SockFilter struct, Code uint16 +pkg syscall (linux-amd64), type SockFilter struct, Jf uint8 +pkg syscall (linux-amd64), type SockFilter struct, Jt uint8 +pkg syscall (linux-amd64), type SockFilter struct, K uint32 +pkg syscall (linux-amd64), type SockFprog struct +pkg syscall (linux-amd64), type SockFprog struct, Filter *SockFilter +pkg syscall (linux-amd64), type SockFprog struct, Len uint16 +pkg syscall (linux-amd64), type SockFprog struct, Pad_cgo_0 [6]uint8 +pkg syscall (linux-amd64), type SockaddrLinklayer struct +pkg syscall (linux-amd64), type SockaddrLinklayer struct, Addr [8]uint8 +pkg syscall (linux-amd64), type SockaddrLinklayer struct, Halen uint8 +pkg syscall (linux-amd64), type SockaddrLinklayer struct, Hatype uint16 +pkg syscall (linux-amd64), type SockaddrLinklayer struct, Ifindex int +pkg syscall (linux-amd64), type SockaddrLinklayer struct, Pkttype uint8 +pkg syscall (linux-amd64), type SockaddrLinklayer struct, Protocol uint16 +pkg syscall (linux-amd64), type SockaddrNetlink struct +pkg syscall (linux-amd64), type SockaddrNetlink struct, Family uint16 +pkg syscall (linux-amd64), type SockaddrNetlink struct, Groups uint32 +pkg syscall (linux-amd64), type SockaddrNetlink struct, Pad uint16 +pkg syscall (linux-amd64), type SockaddrNetlink struct, Pid uint32 +pkg syscall (linux-amd64), type SocketControlMessage struct +pkg syscall (linux-amd64), type SocketControlMessage struct, Data []uint8 +pkg syscall (linux-amd64), type SocketControlMessage struct, Header Cmsghdr +pkg syscall (linux-amd64), type Stat_t struct +pkg syscall (linux-amd64), type Stat_t struct, Atim Timespec +pkg syscall (linux-amd64), type Stat_t struct, Blksize int64 +pkg syscall (linux-amd64), type Stat_t struct, Blocks int64 +pkg syscall (linux-amd64), type Stat_t struct, Ctim Timespec +pkg syscall (linux-amd64), type Stat_t struct, Dev uint64 +pkg syscall (linux-amd64), type Stat_t struct, Gid uint32 +pkg syscall (linux-amd64), type Stat_t struct, Ino uint64 +pkg syscall (linux-amd64), type Stat_t struct, Mode uint32 +pkg syscall (linux-amd64), type Stat_t struct, Mtim Timespec +pkg syscall (linux-amd64), type Stat_t struct, Nlink uint64 +pkg syscall (linux-amd64), type Stat_t struct, Rdev uint64 +pkg syscall (linux-amd64), type Stat_t struct, Size int64 +pkg syscall (linux-amd64), type Stat_t struct, Uid uint32 +pkg syscall (linux-amd64), type Stat_t struct, X__pad0 int32 +pkg syscall (linux-amd64), type Stat_t struct, X__unused [3]int64 +pkg syscall (linux-amd64), type Statfs_t struct +pkg syscall (linux-amd64), type Statfs_t struct, Bavail uint64 +pkg syscall (linux-amd64), type Statfs_t struct, Bfree uint64 +pkg syscall (linux-amd64), type Statfs_t struct, Blocks uint64 +pkg syscall (linux-amd64), type Statfs_t struct, Bsize int64 +pkg syscall (linux-amd64), type Statfs_t struct, Ffree uint64 +pkg syscall (linux-amd64), type Statfs_t struct, Files uint64 +pkg syscall (linux-amd64), type Statfs_t struct, Flags int64 +pkg syscall (linux-amd64), type Statfs_t struct, Frsize int64 +pkg syscall (linux-amd64), type Statfs_t struct, Fsid Fsid +pkg syscall (linux-amd64), type Statfs_t struct, Namelen int64 +pkg syscall (linux-amd64), type Statfs_t struct, Spare [4]int64 +pkg syscall (linux-amd64), type Statfs_t struct, Type int64 +pkg syscall (linux-amd64), type SysProcAttr struct, Chroot string +pkg syscall (linux-amd64), type SysProcAttr struct, Credential *Credential +pkg syscall (linux-amd64), type SysProcAttr struct, Noctty bool +pkg syscall (linux-amd64), type SysProcAttr struct, Pdeathsig Signal +pkg syscall (linux-amd64), type SysProcAttr struct, Ptrace bool +pkg syscall (linux-amd64), type SysProcAttr struct, Setctty bool +pkg syscall (linux-amd64), type SysProcAttr struct, Setpgid bool +pkg syscall (linux-amd64), type SysProcAttr struct, Setsid bool +pkg syscall (linux-amd64), type Sysinfo_t struct +pkg syscall (linux-amd64), type Sysinfo_t struct, Bufferram uint64 +pkg syscall (linux-amd64), type Sysinfo_t struct, Freehigh uint64 +pkg syscall (linux-amd64), type Sysinfo_t struct, Freeram uint64 +pkg syscall (linux-amd64), type Sysinfo_t struct, Freeswap uint64 +pkg syscall (linux-amd64), type Sysinfo_t struct, Loads [3]uint64 +pkg syscall (linux-amd64), type Sysinfo_t struct, Pad uint16 +pkg syscall (linux-amd64), type Sysinfo_t struct, Pad_cgo_0 [4]uint8 +pkg syscall (linux-amd64), type Sysinfo_t struct, Pad_cgo_1 [4]uint8 +pkg syscall (linux-amd64), type Sysinfo_t struct, Procs uint16 +pkg syscall (linux-amd64), type Sysinfo_t struct, Sharedram uint64 +pkg syscall (linux-amd64), type Sysinfo_t struct, Totalhigh uint64 +pkg syscall (linux-amd64), type Sysinfo_t struct, Totalram uint64 +pkg syscall (linux-amd64), type Sysinfo_t struct, Totalswap uint64 +pkg syscall (linux-amd64), type Sysinfo_t struct, Unit uint32 +pkg syscall (linux-amd64), type Sysinfo_t struct, Uptime int64 +pkg syscall (linux-amd64), type Sysinfo_t struct, X_f [0]uint8 +pkg syscall (linux-amd64), type Termios struct +pkg syscall (linux-amd64), type Termios struct, Cc [32]uint8 +pkg syscall (linux-amd64), type Termios struct, Cflag uint32 +pkg syscall (linux-amd64), type Termios struct, Iflag uint32 +pkg syscall (linux-amd64), type Termios struct, Ispeed uint32 +pkg syscall (linux-amd64), type Termios struct, Lflag uint32 +pkg syscall (linux-amd64), type Termios struct, Line uint8 +pkg syscall (linux-amd64), type Termios struct, Oflag uint32 +pkg syscall (linux-amd64), type Termios struct, Ospeed uint32 +pkg syscall (linux-amd64), type Termios struct, Pad_cgo_0 [3]uint8 +pkg syscall (linux-amd64), type Time_t int64 +pkg syscall (linux-amd64), type Timespec struct, Nsec int64 +pkg syscall (linux-amd64), type Timespec struct, Sec int64 +pkg syscall (linux-amd64), type Timeval struct, Sec int64 +pkg syscall (linux-amd64), type Timeval struct, Usec int64 +pkg syscall (linux-amd64), type Timex struct +pkg syscall (linux-amd64), type Timex struct, Calcnt int64 +pkg syscall (linux-amd64), type Timex struct, Constant int64 +pkg syscall (linux-amd64), type Timex struct, Errcnt int64 +pkg syscall (linux-amd64), type Timex struct, Esterror int64 +pkg syscall (linux-amd64), type Timex struct, Freq int64 +pkg syscall (linux-amd64), type Timex struct, Jitcnt int64 +pkg syscall (linux-amd64), type Timex struct, Jitter int64 +pkg syscall (linux-amd64), type Timex struct, Maxerror int64 +pkg syscall (linux-amd64), type Timex struct, Modes uint32 +pkg syscall (linux-amd64), type Timex struct, Offset int64 +pkg syscall (linux-amd64), type Timex struct, Pad_cgo_0 [4]uint8 +pkg syscall (linux-amd64), type Timex struct, Pad_cgo_1 [4]uint8 +pkg syscall (linux-amd64), type Timex struct, Pad_cgo_2 [4]uint8 +pkg syscall (linux-amd64), type Timex struct, Pad_cgo_3 [44]uint8 +pkg syscall (linux-amd64), type Timex struct, Ppsfreq int64 +pkg syscall (linux-amd64), type Timex struct, Precision int64 +pkg syscall (linux-amd64), type Timex struct, Shift int32 +pkg syscall (linux-amd64), type Timex struct, Stabil int64 +pkg syscall (linux-amd64), type Timex struct, Status int32 +pkg syscall (linux-amd64), type Timex struct, Stbcnt int64 +pkg syscall (linux-amd64), type Timex struct, Tai int32 +pkg syscall (linux-amd64), type Timex struct, Tick int64 +pkg syscall (linux-amd64), type Timex struct, Time Timeval +pkg syscall (linux-amd64), type Timex struct, Tolerance int64 +pkg syscall (linux-amd64), type Tms struct +pkg syscall (linux-amd64), type Tms struct, Cstime int64 +pkg syscall (linux-amd64), type Tms struct, Cutime int64 +pkg syscall (linux-amd64), type Tms struct, Stime int64 +pkg syscall (linux-amd64), type Tms struct, Utime int64 +pkg syscall (linux-amd64), type Ucred struct +pkg syscall (linux-amd64), type Ucred struct, Gid uint32 +pkg syscall (linux-amd64), type Ucred struct, Pid int32 +pkg syscall (linux-amd64), type Ucred struct, Uid uint32 +pkg syscall (linux-amd64), type Ustat_t struct +pkg syscall (linux-amd64), type Ustat_t struct, Fname [6]int8 +pkg syscall (linux-amd64), type Ustat_t struct, Fpack [6]int8 +pkg syscall (linux-amd64), type Ustat_t struct, Pad_cgo_0 [4]uint8 +pkg syscall (linux-amd64), type Ustat_t struct, Pad_cgo_1 [4]uint8 +pkg syscall (linux-amd64), type Ustat_t struct, Tfree int32 +pkg syscall (linux-amd64), type Ustat_t struct, Tinode uint64 +pkg syscall (linux-amd64), type Utimbuf struct +pkg syscall (linux-amd64), type Utimbuf struct, Actime int64 +pkg syscall (linux-amd64), type Utimbuf struct, Modtime int64 +pkg syscall (linux-amd64), type Utsname struct +pkg syscall (linux-amd64), type Utsname struct, Domainname [65]int8 +pkg syscall (linux-amd64), type Utsname struct, Machine [65]int8 +pkg syscall (linux-amd64), type Utsname struct, Nodename [65]int8 +pkg syscall (linux-amd64), type Utsname struct, Release [65]int8 +pkg syscall (linux-amd64), type Utsname struct, Sysname [65]int8 +pkg syscall (linux-amd64), type Utsname struct, Version [65]int8 +pkg syscall (linux-amd64), type WaitStatus uint32 +pkg syscall (linux-amd64), var Stderr int +pkg syscall (linux-amd64), var Stdin int +pkg syscall (linux-amd64), var Stdout int +pkg syscall (linux-amd64-cgo), const AF_ALG ideal-int +pkg syscall (linux-amd64-cgo), const AF_APPLETALK ideal-int +pkg syscall (linux-amd64-cgo), const AF_ASH ideal-int +pkg syscall (linux-amd64-cgo), const AF_ATMPVC ideal-int +pkg syscall (linux-amd64-cgo), const AF_ATMSVC ideal-int +pkg syscall (linux-amd64-cgo), const AF_AX25 ideal-int +pkg syscall (linux-amd64-cgo), const AF_BLUETOOTH ideal-int +pkg syscall (linux-amd64-cgo), const AF_BRIDGE ideal-int +pkg syscall (linux-amd64-cgo), const AF_CAIF ideal-int +pkg syscall (linux-amd64-cgo), const AF_CAN ideal-int +pkg syscall (linux-amd64-cgo), const AF_DECnet ideal-int +pkg syscall (linux-amd64-cgo), const AF_ECONET ideal-int +pkg syscall (linux-amd64-cgo), const AF_FILE ideal-int +pkg syscall (linux-amd64-cgo), const AF_IEEE802154 ideal-int +pkg syscall (linux-amd64-cgo), const AF_IPX ideal-int +pkg syscall (linux-amd64-cgo), const AF_IRDA ideal-int +pkg syscall (linux-amd64-cgo), const AF_ISDN ideal-int +pkg syscall (linux-amd64-cgo), const AF_IUCV ideal-int +pkg syscall (linux-amd64-cgo), const AF_KEY ideal-int +pkg syscall (linux-amd64-cgo), const AF_LLC ideal-int +pkg syscall (linux-amd64-cgo), const AF_LOCAL ideal-int +pkg syscall (linux-amd64-cgo), const AF_MAX ideal-int +pkg syscall (linux-amd64-cgo), const AF_NETBEUI ideal-int +pkg syscall (linux-amd64-cgo), const AF_NETLINK ideal-int +pkg syscall (linux-amd64-cgo), const AF_NETROM ideal-int +pkg syscall (linux-amd64-cgo), const AF_PACKET ideal-int +pkg syscall (linux-amd64-cgo), const AF_PHONET ideal-int +pkg syscall (linux-amd64-cgo), const AF_PPPOX ideal-int +pkg syscall (linux-amd64-cgo), const AF_RDS ideal-int +pkg syscall (linux-amd64-cgo), const AF_ROSE ideal-int +pkg syscall (linux-amd64-cgo), const AF_ROUTE ideal-int +pkg syscall (linux-amd64-cgo), const AF_RXRPC ideal-int +pkg syscall (linux-amd64-cgo), const AF_SECURITY ideal-int +pkg syscall (linux-amd64-cgo), const AF_SNA ideal-int +pkg syscall (linux-amd64-cgo), const AF_TIPC ideal-int +pkg syscall (linux-amd64-cgo), const AF_WANPIPE ideal-int +pkg syscall (linux-amd64-cgo), const AF_X25 ideal-int +pkg syscall (linux-amd64-cgo), const ARPHRD_ADAPT ideal-int +pkg syscall (linux-amd64-cgo), const ARPHRD_APPLETLK ideal-int +pkg syscall (linux-amd64-cgo), const ARPHRD_ARCNET ideal-int +pkg syscall (linux-amd64-cgo), const ARPHRD_ASH ideal-int +pkg syscall (linux-amd64-cgo), const ARPHRD_ATM ideal-int +pkg syscall (linux-amd64-cgo), const ARPHRD_AX25 ideal-int +pkg syscall (linux-amd64-cgo), const ARPHRD_BIF ideal-int +pkg syscall (linux-amd64-cgo), const ARPHRD_CHAOS ideal-int +pkg syscall (linux-amd64-cgo), const ARPHRD_CISCO ideal-int +pkg syscall (linux-amd64-cgo), const ARPHRD_CSLIP ideal-int +pkg syscall (linux-amd64-cgo), const ARPHRD_CSLIP6 ideal-int +pkg syscall (linux-amd64-cgo), const ARPHRD_DDCMP ideal-int +pkg syscall (linux-amd64-cgo), const ARPHRD_DLCI ideal-int +pkg syscall (linux-amd64-cgo), const ARPHRD_ECONET ideal-int +pkg syscall (linux-amd64-cgo), const ARPHRD_EETHER ideal-int +pkg syscall (linux-amd64-cgo), const ARPHRD_ETHER ideal-int +pkg syscall (linux-amd64-cgo), const ARPHRD_EUI64 ideal-int +pkg syscall (linux-amd64-cgo), const ARPHRD_FCAL ideal-int +pkg syscall (linux-amd64-cgo), const ARPHRD_FCFABRIC ideal-int +pkg syscall (linux-amd64-cgo), const ARPHRD_FCPL ideal-int +pkg syscall (linux-amd64-cgo), const ARPHRD_FCPP ideal-int +pkg syscall (linux-amd64-cgo), const ARPHRD_FDDI ideal-int +pkg syscall (linux-amd64-cgo), const ARPHRD_FRAD ideal-int +pkg syscall (linux-amd64-cgo), const ARPHRD_HDLC ideal-int +pkg syscall (linux-amd64-cgo), const ARPHRD_HIPPI ideal-int +pkg syscall (linux-amd64-cgo), const ARPHRD_HWX25 ideal-int +pkg syscall (linux-amd64-cgo), const ARPHRD_IEEE1394 ideal-int +pkg syscall (linux-amd64-cgo), const ARPHRD_IEEE802 ideal-int +pkg syscall (linux-amd64-cgo), const ARPHRD_IEEE80211 ideal-int +pkg syscall (linux-amd64-cgo), const ARPHRD_IEEE80211_PRISM ideal-int +pkg syscall (linux-amd64-cgo), const ARPHRD_IEEE80211_RADIOTAP ideal-int +pkg syscall (linux-amd64-cgo), const ARPHRD_IEEE802154 ideal-int +pkg syscall (linux-amd64-cgo), const ARPHRD_IEEE802154_PHY ideal-int +pkg syscall (linux-amd64-cgo), const ARPHRD_IEEE802_TR ideal-int +pkg syscall (linux-amd64-cgo), const ARPHRD_INFINIBAND ideal-int +pkg syscall (linux-amd64-cgo), const ARPHRD_IPDDP ideal-int +pkg syscall (linux-amd64-cgo), const ARPHRD_IPGRE ideal-int +pkg syscall (linux-amd64-cgo), const ARPHRD_IRDA ideal-int +pkg syscall (linux-amd64-cgo), const ARPHRD_LAPB ideal-int +pkg syscall (linux-amd64-cgo), const ARPHRD_LOCALTLK ideal-int +pkg syscall (linux-amd64-cgo), const ARPHRD_LOOPBACK ideal-int +pkg syscall (linux-amd64-cgo), const ARPHRD_METRICOM ideal-int +pkg syscall (linux-amd64-cgo), const ARPHRD_NETROM ideal-int +pkg syscall (linux-amd64-cgo), const ARPHRD_NONE ideal-int +pkg syscall (linux-amd64-cgo), const ARPHRD_PIMREG ideal-int +pkg syscall (linux-amd64-cgo), const ARPHRD_PPP ideal-int +pkg syscall (linux-amd64-cgo), const ARPHRD_PRONET ideal-int +pkg syscall (linux-amd64-cgo), const ARPHRD_RAWHDLC ideal-int +pkg syscall (linux-amd64-cgo), const ARPHRD_ROSE ideal-int +pkg syscall (linux-amd64-cgo), const ARPHRD_RSRVD ideal-int +pkg syscall (linux-amd64-cgo), const ARPHRD_SIT ideal-int +pkg syscall (linux-amd64-cgo), const ARPHRD_SKIP ideal-int +pkg syscall (linux-amd64-cgo), const ARPHRD_SLIP ideal-int +pkg syscall (linux-amd64-cgo), const ARPHRD_SLIP6 ideal-int +pkg syscall (linux-amd64-cgo), const ARPHRD_TUNNEL ideal-int +pkg syscall (linux-amd64-cgo), const ARPHRD_TUNNEL6 ideal-int +pkg syscall (linux-amd64-cgo), const ARPHRD_VOID ideal-int +pkg syscall (linux-amd64-cgo), const ARPHRD_X25 ideal-int +pkg syscall (linux-amd64-cgo), const B0 ideal-int +pkg syscall (linux-amd64-cgo), const B1000000 ideal-int +pkg syscall (linux-amd64-cgo), const B110 ideal-int +pkg syscall (linux-amd64-cgo), const B115200 ideal-int +pkg syscall (linux-amd64-cgo), const B1152000 ideal-int +pkg syscall (linux-amd64-cgo), const B1200 ideal-int +pkg syscall (linux-amd64-cgo), const B134 ideal-int +pkg syscall (linux-amd64-cgo), const B150 ideal-int +pkg syscall (linux-amd64-cgo), const B1500000 ideal-int +pkg syscall (linux-amd64-cgo), const B1800 ideal-int +pkg syscall (linux-amd64-cgo), const B19200 ideal-int +pkg syscall (linux-amd64-cgo), const B200 ideal-int +pkg syscall (linux-amd64-cgo), const B2000000 ideal-int +pkg syscall (linux-amd64-cgo), const B230400 ideal-int +pkg syscall (linux-amd64-cgo), const B2400 ideal-int +pkg syscall (linux-amd64-cgo), const B2500000 ideal-int +pkg syscall (linux-amd64-cgo), const B300 ideal-int +pkg syscall (linux-amd64-cgo), const B3000000 ideal-int +pkg syscall (linux-amd64-cgo), const B3500000 ideal-int +pkg syscall (linux-amd64-cgo), const B38400 ideal-int +pkg syscall (linux-amd64-cgo), const B4000000 ideal-int +pkg syscall (linux-amd64-cgo), const B460800 ideal-int +pkg syscall (linux-amd64-cgo), const B4800 ideal-int +pkg syscall (linux-amd64-cgo), const B50 ideal-int +pkg syscall (linux-amd64-cgo), const B500000 ideal-int +pkg syscall (linux-amd64-cgo), const B57600 ideal-int +pkg syscall (linux-amd64-cgo), const B576000 ideal-int +pkg syscall (linux-amd64-cgo), const B600 ideal-int +pkg syscall (linux-amd64-cgo), const B75 ideal-int +pkg syscall (linux-amd64-cgo), const B921600 ideal-int +pkg syscall (linux-amd64-cgo), const B9600 ideal-int +pkg syscall (linux-amd64-cgo), const BPF_A ideal-int +pkg syscall (linux-amd64-cgo), const BPF_ABS ideal-int +pkg syscall (linux-amd64-cgo), const BPF_ADD ideal-int +pkg syscall (linux-amd64-cgo), const BPF_ALU ideal-int +pkg syscall (linux-amd64-cgo), const BPF_AND ideal-int +pkg syscall (linux-amd64-cgo), const BPF_B ideal-int +pkg syscall (linux-amd64-cgo), const BPF_DIV ideal-int +pkg syscall (linux-amd64-cgo), const BPF_H ideal-int +pkg syscall (linux-amd64-cgo), const BPF_IMM ideal-int +pkg syscall (linux-amd64-cgo), const BPF_IND ideal-int +pkg syscall (linux-amd64-cgo), const BPF_JA ideal-int +pkg syscall (linux-amd64-cgo), const BPF_JEQ ideal-int +pkg syscall (linux-amd64-cgo), const BPF_JGE ideal-int +pkg syscall (linux-amd64-cgo), const BPF_JGT ideal-int +pkg syscall (linux-amd64-cgo), const BPF_JMP ideal-int +pkg syscall (linux-amd64-cgo), const BPF_JSET ideal-int +pkg syscall (linux-amd64-cgo), const BPF_K ideal-int +pkg syscall (linux-amd64-cgo), const BPF_LD ideal-int +pkg syscall (linux-amd64-cgo), const BPF_LDX ideal-int +pkg syscall (linux-amd64-cgo), const BPF_LEN ideal-int +pkg syscall (linux-amd64-cgo), const BPF_LSH ideal-int +pkg syscall (linux-amd64-cgo), const BPF_MAJOR_VERSION ideal-int +pkg syscall (linux-amd64-cgo), const BPF_MAXINSNS ideal-int +pkg syscall (linux-amd64-cgo), const BPF_MEM ideal-int +pkg syscall (linux-amd64-cgo), const BPF_MEMWORDS ideal-int +pkg syscall (linux-amd64-cgo), const BPF_MINOR_VERSION ideal-int +pkg syscall (linux-amd64-cgo), const BPF_MISC ideal-int +pkg syscall (linux-amd64-cgo), const BPF_MSH ideal-int +pkg syscall (linux-amd64-cgo), const BPF_MUL ideal-int +pkg syscall (linux-amd64-cgo), const BPF_NEG ideal-int +pkg syscall (linux-amd64-cgo), const BPF_OR ideal-int +pkg syscall (linux-amd64-cgo), const BPF_RET ideal-int +pkg syscall (linux-amd64-cgo), const BPF_RSH ideal-int +pkg syscall (linux-amd64-cgo), const BPF_ST ideal-int +pkg syscall (linux-amd64-cgo), const BPF_STX ideal-int +pkg syscall (linux-amd64-cgo), const BPF_SUB ideal-int +pkg syscall (linux-amd64-cgo), const BPF_TAX ideal-int +pkg syscall (linux-amd64-cgo), const BPF_TXA ideal-int +pkg syscall (linux-amd64-cgo), const BPF_W ideal-int +pkg syscall (linux-amd64-cgo), const BPF_X ideal-int +pkg syscall (linux-amd64-cgo), const BRKINT ideal-int +pkg syscall (linux-amd64-cgo), const CLOCAL ideal-int +pkg syscall (linux-amd64-cgo), const CREAD ideal-int +pkg syscall (linux-amd64-cgo), const CS5 ideal-int +pkg syscall (linux-amd64-cgo), const CS6 ideal-int +pkg syscall (linux-amd64-cgo), const CS7 ideal-int +pkg syscall (linux-amd64-cgo), const CS8 ideal-int +pkg syscall (linux-amd64-cgo), const CSIZE ideal-int +pkg syscall (linux-amd64-cgo), const CSTOPB ideal-int +pkg syscall (linux-amd64-cgo), const DT_BLK ideal-int +pkg syscall (linux-amd64-cgo), const DT_CHR ideal-int +pkg syscall (linux-amd64-cgo), const DT_DIR ideal-int +pkg syscall (linux-amd64-cgo), const DT_FIFO ideal-int +pkg syscall (linux-amd64-cgo), const DT_LNK ideal-int +pkg syscall (linux-amd64-cgo), const DT_REG ideal-int +pkg syscall (linux-amd64-cgo), const DT_SOCK ideal-int +pkg syscall (linux-amd64-cgo), const DT_UNKNOWN ideal-int +pkg syscall (linux-amd64-cgo), const DT_WHT ideal-int +pkg syscall (linux-amd64-cgo), const EADV Errno +pkg syscall (linux-amd64-cgo), const EBADE Errno +pkg syscall (linux-amd64-cgo), const EBADFD Errno +pkg syscall (linux-amd64-cgo), const EBADMSG Errno +pkg syscall (linux-amd64-cgo), const EBADR Errno +pkg syscall (linux-amd64-cgo), const EBADRQC Errno +pkg syscall (linux-amd64-cgo), const EBADSLT Errno +pkg syscall (linux-amd64-cgo), const EBFONT Errno +pkg syscall (linux-amd64-cgo), const ECHO ideal-int +pkg syscall (linux-amd64-cgo), const ECHOCTL ideal-int +pkg syscall (linux-amd64-cgo), const ECHOE ideal-int +pkg syscall (linux-amd64-cgo), const ECHOK ideal-int +pkg syscall (linux-amd64-cgo), const ECHOKE ideal-int +pkg syscall (linux-amd64-cgo), const ECHONL ideal-int +pkg syscall (linux-amd64-cgo), const ECHOPRT ideal-int +pkg syscall (linux-amd64-cgo), const ECHRNG Errno +pkg syscall (linux-amd64-cgo), const ECOMM Errno +pkg syscall (linux-amd64-cgo), const EDEADLOCK Errno +pkg syscall (linux-amd64-cgo), const EDOTDOT Errno +pkg syscall (linux-amd64-cgo), const EISNAM Errno +pkg syscall (linux-amd64-cgo), const EKEYEXPIRED Errno +pkg syscall (linux-amd64-cgo), const EKEYREJECTED Errno +pkg syscall (linux-amd64-cgo), const EKEYREVOKED Errno +pkg syscall (linux-amd64-cgo), const EL2HLT Errno +pkg syscall (linux-amd64-cgo), const EL2NSYNC Errno +pkg syscall (linux-amd64-cgo), const EL3HLT Errno +pkg syscall (linux-amd64-cgo), const EL3RST Errno +pkg syscall (linux-amd64-cgo), const ELIBACC Errno +pkg syscall (linux-amd64-cgo), const ELIBBAD Errno +pkg syscall (linux-amd64-cgo), const ELIBEXEC Errno +pkg syscall (linux-amd64-cgo), const ELIBMAX Errno +pkg syscall (linux-amd64-cgo), const ELIBSCN Errno +pkg syscall (linux-amd64-cgo), const ELNRNG Errno +pkg syscall (linux-amd64-cgo), const EMEDIUMTYPE Errno +pkg syscall (linux-amd64-cgo), const EMULTIHOP Errno +pkg syscall (linux-amd64-cgo), const ENAVAIL Errno +pkg syscall (linux-amd64-cgo), const ENOANO Errno +pkg syscall (linux-amd64-cgo), const ENOCSI Errno +pkg syscall (linux-amd64-cgo), const ENODATA Errno +pkg syscall (linux-amd64-cgo), const ENOKEY Errno +pkg syscall (linux-amd64-cgo), const ENOLINK Errno +pkg syscall (linux-amd64-cgo), const ENOMEDIUM Errno +pkg syscall (linux-amd64-cgo), const ENONET Errno +pkg syscall (linux-amd64-cgo), const ENOPKG Errno +pkg syscall (linux-amd64-cgo), const ENOSR Errno +pkg syscall (linux-amd64-cgo), const ENOSTR Errno +pkg syscall (linux-amd64-cgo), const ENOTNAM Errno +pkg syscall (linux-amd64-cgo), const ENOTRECOVERABLE Errno +pkg syscall (linux-amd64-cgo), const ENOTUNIQ Errno +pkg syscall (linux-amd64-cgo), const EOWNERDEAD Errno +pkg syscall (linux-amd64-cgo), const EPOLLERR ideal-int +pkg syscall (linux-amd64-cgo), const EPOLLET ideal-int +pkg syscall (linux-amd64-cgo), const EPOLLHUP ideal-int +pkg syscall (linux-amd64-cgo), const EPOLLIN ideal-int +pkg syscall (linux-amd64-cgo), const EPOLLMSG ideal-int +pkg syscall (linux-amd64-cgo), const EPOLLONESHOT ideal-int +pkg syscall (linux-amd64-cgo), const EPOLLOUT ideal-int +pkg syscall (linux-amd64-cgo), const EPOLLPRI ideal-int +pkg syscall (linux-amd64-cgo), const EPOLLRDBAND ideal-int +pkg syscall (linux-amd64-cgo), const EPOLLRDHUP ideal-int +pkg syscall (linux-amd64-cgo), const EPOLLRDNORM ideal-int +pkg syscall (linux-amd64-cgo), const EPOLLWRBAND ideal-int +pkg syscall (linux-amd64-cgo), const EPOLLWRNORM ideal-int +pkg syscall (linux-amd64-cgo), const EPOLL_CLOEXEC ideal-int +pkg syscall (linux-amd64-cgo), const EPOLL_CTL_ADD ideal-int +pkg syscall (linux-amd64-cgo), const EPOLL_CTL_DEL ideal-int +pkg syscall (linux-amd64-cgo), const EPOLL_CTL_MOD ideal-int +pkg syscall (linux-amd64-cgo), const EPOLL_NONBLOCK ideal-int +pkg syscall (linux-amd64-cgo), const EPROTO Errno +pkg syscall (linux-amd64-cgo), const EREMCHG Errno +pkg syscall (linux-amd64-cgo), const EREMOTEIO Errno +pkg syscall (linux-amd64-cgo), const ERESTART Errno +pkg syscall (linux-amd64-cgo), const ERFKILL Errno +pkg syscall (linux-amd64-cgo), const ESRMNT Errno +pkg syscall (linux-amd64-cgo), const ESTRPIPE Errno +pkg syscall (linux-amd64-cgo), const ETH_P_1588 ideal-int +pkg syscall (linux-amd64-cgo), const ETH_P_8021Q ideal-int +pkg syscall (linux-amd64-cgo), const ETH_P_802_2 ideal-int +pkg syscall (linux-amd64-cgo), const ETH_P_802_3 ideal-int +pkg syscall (linux-amd64-cgo), const ETH_P_AARP ideal-int +pkg syscall (linux-amd64-cgo), const ETH_P_ALL ideal-int +pkg syscall (linux-amd64-cgo), const ETH_P_AOE ideal-int +pkg syscall (linux-amd64-cgo), const ETH_P_ARCNET ideal-int +pkg syscall (linux-amd64-cgo), const ETH_P_ARP ideal-int +pkg syscall (linux-amd64-cgo), const ETH_P_ATALK ideal-int +pkg syscall (linux-amd64-cgo), const ETH_P_ATMFATE ideal-int +pkg syscall (linux-amd64-cgo), const ETH_P_ATMMPOA ideal-int +pkg syscall (linux-amd64-cgo), const ETH_P_AX25 ideal-int +pkg syscall (linux-amd64-cgo), const ETH_P_BPQ ideal-int +pkg syscall (linux-amd64-cgo), const ETH_P_CAIF ideal-int +pkg syscall (linux-amd64-cgo), const ETH_P_CAN ideal-int +pkg syscall (linux-amd64-cgo), const ETH_P_CONTROL ideal-int +pkg syscall (linux-amd64-cgo), const ETH_P_CUST ideal-int +pkg syscall (linux-amd64-cgo), const ETH_P_DDCMP ideal-int +pkg syscall (linux-amd64-cgo), const ETH_P_DEC ideal-int +pkg syscall (linux-amd64-cgo), const ETH_P_DIAG ideal-int +pkg syscall (linux-amd64-cgo), const ETH_P_DNA_DL ideal-int +pkg syscall (linux-amd64-cgo), const ETH_P_DNA_RC ideal-int +pkg syscall (linux-amd64-cgo), const ETH_P_DNA_RT ideal-int +pkg syscall (linux-amd64-cgo), const ETH_P_DSA ideal-int +pkg syscall (linux-amd64-cgo), const ETH_P_ECONET ideal-int +pkg syscall (linux-amd64-cgo), const ETH_P_EDSA ideal-int +pkg syscall (linux-amd64-cgo), const ETH_P_FCOE ideal-int +pkg syscall (linux-amd64-cgo), const ETH_P_FIP ideal-int +pkg syscall (linux-amd64-cgo), const ETH_P_HDLC ideal-int +pkg syscall (linux-amd64-cgo), const ETH_P_IEEE802154 ideal-int +pkg syscall (linux-amd64-cgo), const ETH_P_IEEEPUP ideal-int +pkg syscall (linux-amd64-cgo), const ETH_P_IEEEPUPAT ideal-int +pkg syscall (linux-amd64-cgo), const ETH_P_IP ideal-int +pkg syscall (linux-amd64-cgo), const ETH_P_IPV6 ideal-int +pkg syscall (linux-amd64-cgo), const ETH_P_IPX ideal-int +pkg syscall (linux-amd64-cgo), const ETH_P_IRDA ideal-int +pkg syscall (linux-amd64-cgo), const ETH_P_LAT ideal-int +pkg syscall (linux-amd64-cgo), const ETH_P_LINK_CTL ideal-int +pkg syscall (linux-amd64-cgo), const ETH_P_LOCALTALK ideal-int +pkg syscall (linux-amd64-cgo), const ETH_P_LOOP ideal-int +pkg syscall (linux-amd64-cgo), const ETH_P_MOBITEX ideal-int +pkg syscall (linux-amd64-cgo), const ETH_P_MPLS_MC ideal-int +pkg syscall (linux-amd64-cgo), const ETH_P_MPLS_UC ideal-int +pkg syscall (linux-amd64-cgo), const ETH_P_PAE ideal-int +pkg syscall (linux-amd64-cgo), const ETH_P_PAUSE ideal-int +pkg syscall (linux-amd64-cgo), const ETH_P_PHONET ideal-int +pkg syscall (linux-amd64-cgo), const ETH_P_PPPTALK ideal-int +pkg syscall (linux-amd64-cgo), const ETH_P_PPP_DISC ideal-int +pkg syscall (linux-amd64-cgo), const ETH_P_PPP_MP ideal-int +pkg syscall (linux-amd64-cgo), const ETH_P_PPP_SES ideal-int +pkg syscall (linux-amd64-cgo), const ETH_P_PUP ideal-int +pkg syscall (linux-amd64-cgo), const ETH_P_PUPAT ideal-int +pkg syscall (linux-amd64-cgo), const ETH_P_RARP ideal-int +pkg syscall (linux-amd64-cgo), const ETH_P_SCA ideal-int +pkg syscall (linux-amd64-cgo), const ETH_P_SLOW ideal-int +pkg syscall (linux-amd64-cgo), const ETH_P_SNAP ideal-int +pkg syscall (linux-amd64-cgo), const ETH_P_TEB ideal-int +pkg syscall (linux-amd64-cgo), const ETH_P_TIPC ideal-int +pkg syscall (linux-amd64-cgo), const ETH_P_TRAILER ideal-int +pkg syscall (linux-amd64-cgo), const ETH_P_TR_802_2 ideal-int +pkg syscall (linux-amd64-cgo), const ETH_P_WAN_PPP ideal-int +pkg syscall (linux-amd64-cgo), const ETH_P_WCCP ideal-int +pkg syscall (linux-amd64-cgo), const ETH_P_X25 ideal-int +pkg syscall (linux-amd64-cgo), const ETIME Errno +pkg syscall (linux-amd64-cgo), const EUCLEAN Errno +pkg syscall (linux-amd64-cgo), const EUNATCH Errno +pkg syscall (linux-amd64-cgo), const EXFULL Errno +pkg syscall (linux-amd64-cgo), const FD_CLOEXEC ideal-int +pkg syscall (linux-amd64-cgo), const FD_SETSIZE ideal-int +pkg syscall (linux-amd64-cgo), const FLUSHO ideal-int +pkg syscall (linux-amd64-cgo), const F_DUPFD ideal-int +pkg syscall (linux-amd64-cgo), const F_DUPFD_CLOEXEC ideal-int +pkg syscall (linux-amd64-cgo), const F_EXLCK ideal-int +pkg syscall (linux-amd64-cgo), const F_GETFD ideal-int +pkg syscall (linux-amd64-cgo), const F_GETFL ideal-int +pkg syscall (linux-amd64-cgo), const F_GETLEASE ideal-int +pkg syscall (linux-amd64-cgo), const F_GETLK ideal-int +pkg syscall (linux-amd64-cgo), const F_GETLK64 ideal-int +pkg syscall (linux-amd64-cgo), const F_GETOWN ideal-int +pkg syscall (linux-amd64-cgo), const F_GETOWN_EX ideal-int +pkg syscall (linux-amd64-cgo), const F_GETPIPE_SZ ideal-int +pkg syscall (linux-amd64-cgo), const F_GETSIG ideal-int +pkg syscall (linux-amd64-cgo), const F_LOCK ideal-int +pkg syscall (linux-amd64-cgo), const F_NOTIFY ideal-int +pkg syscall (linux-amd64-cgo), const F_OK ideal-int +pkg syscall (linux-amd64-cgo), const F_RDLCK ideal-int +pkg syscall (linux-amd64-cgo), const F_SETFD ideal-int +pkg syscall (linux-amd64-cgo), const F_SETFL ideal-int +pkg syscall (linux-amd64-cgo), const F_SETLEASE ideal-int +pkg syscall (linux-amd64-cgo), const F_SETLK ideal-int +pkg syscall (linux-amd64-cgo), const F_SETLK64 ideal-int +pkg syscall (linux-amd64-cgo), const F_SETLKW ideal-int +pkg syscall (linux-amd64-cgo), const F_SETLKW64 ideal-int +pkg syscall (linux-amd64-cgo), const F_SETOWN ideal-int +pkg syscall (linux-amd64-cgo), const F_SETOWN_EX ideal-int +pkg syscall (linux-amd64-cgo), const F_SETPIPE_SZ ideal-int +pkg syscall (linux-amd64-cgo), const F_SETSIG ideal-int +pkg syscall (linux-amd64-cgo), const F_SHLCK ideal-int +pkg syscall (linux-amd64-cgo), const F_TEST ideal-int +pkg syscall (linux-amd64-cgo), const F_TLOCK ideal-int +pkg syscall (linux-amd64-cgo), const F_ULOCK ideal-int +pkg syscall (linux-amd64-cgo), const F_UNLCK ideal-int +pkg syscall (linux-amd64-cgo), const F_WRLCK ideal-int +pkg syscall (linux-amd64-cgo), const HUPCL ideal-int +pkg syscall (linux-amd64-cgo), const ICANON ideal-int +pkg syscall (linux-amd64-cgo), const ICRNL ideal-int +pkg syscall (linux-amd64-cgo), const IEXTEN ideal-int +pkg syscall (linux-amd64-cgo), const IFA_ADDRESS ideal-int +pkg syscall (linux-amd64-cgo), const IFA_ANYCAST ideal-int +pkg syscall (linux-amd64-cgo), const IFA_BROADCAST ideal-int +pkg syscall (linux-amd64-cgo), const IFA_CACHEINFO ideal-int +pkg syscall (linux-amd64-cgo), const IFA_F_DADFAILED ideal-int +pkg syscall (linux-amd64-cgo), const IFA_F_DEPRECATED ideal-int +pkg syscall (linux-amd64-cgo), const IFA_F_HOMEADDRESS ideal-int +pkg syscall (linux-amd64-cgo), const IFA_F_NODAD ideal-int +pkg syscall (linux-amd64-cgo), const IFA_F_OPTIMISTIC ideal-int +pkg syscall (linux-amd64-cgo), const IFA_F_PERMANENT ideal-int +pkg syscall (linux-amd64-cgo), const IFA_F_SECONDARY ideal-int +pkg syscall (linux-amd64-cgo), const IFA_F_TEMPORARY ideal-int +pkg syscall (linux-amd64-cgo), const IFA_F_TENTATIVE ideal-int +pkg syscall (linux-amd64-cgo), const IFA_LABEL ideal-int +pkg syscall (linux-amd64-cgo), const IFA_LOCAL ideal-int +pkg syscall (linux-amd64-cgo), const IFA_MAX ideal-int +pkg syscall (linux-amd64-cgo), const IFA_MULTICAST ideal-int +pkg syscall (linux-amd64-cgo), const IFA_UNSPEC ideal-int +pkg syscall (linux-amd64-cgo), const IFF_ALLMULTI ideal-int +pkg syscall (linux-amd64-cgo), const IFF_AUTOMEDIA ideal-int +pkg syscall (linux-amd64-cgo), const IFF_DEBUG ideal-int +pkg syscall (linux-amd64-cgo), const IFF_DYNAMIC ideal-int +pkg syscall (linux-amd64-cgo), const IFF_MASTER ideal-int +pkg syscall (linux-amd64-cgo), const IFF_NOARP ideal-int +pkg syscall (linux-amd64-cgo), const IFF_NOTRAILERS ideal-int +pkg syscall (linux-amd64-cgo), const IFF_NO_PI ideal-int +pkg syscall (linux-amd64-cgo), const IFF_ONE_QUEUE ideal-int +pkg syscall (linux-amd64-cgo), const IFF_POINTOPOINT ideal-int +pkg syscall (linux-amd64-cgo), const IFF_PORTSEL ideal-int +pkg syscall (linux-amd64-cgo), const IFF_PROMISC ideal-int +pkg syscall (linux-amd64-cgo), const IFF_RUNNING ideal-int +pkg syscall (linux-amd64-cgo), const IFF_SLAVE ideal-int +pkg syscall (linux-amd64-cgo), const IFF_TAP ideal-int +pkg syscall (linux-amd64-cgo), const IFF_TUN ideal-int +pkg syscall (linux-amd64-cgo), const IFF_TUN_EXCL ideal-int +pkg syscall (linux-amd64-cgo), const IFF_VNET_HDR ideal-int +pkg syscall (linux-amd64-cgo), const IFLA_ADDRESS ideal-int +pkg syscall (linux-amd64-cgo), const IFLA_BROADCAST ideal-int +pkg syscall (linux-amd64-cgo), const IFLA_COST ideal-int +pkg syscall (linux-amd64-cgo), const IFLA_IFALIAS ideal-int +pkg syscall (linux-amd64-cgo), const IFLA_IFNAME ideal-int +pkg syscall (linux-amd64-cgo), const IFLA_LINK ideal-int +pkg syscall (linux-amd64-cgo), const IFLA_LINKINFO ideal-int +pkg syscall (linux-amd64-cgo), const IFLA_LINKMODE ideal-int +pkg syscall (linux-amd64-cgo), const IFLA_MAP ideal-int +pkg syscall (linux-amd64-cgo), const IFLA_MASTER ideal-int +pkg syscall (linux-amd64-cgo), const IFLA_MAX ideal-int +pkg syscall (linux-amd64-cgo), const IFLA_MTU ideal-int +pkg syscall (linux-amd64-cgo), const IFLA_NET_NS_PID ideal-int +pkg syscall (linux-amd64-cgo), const IFLA_OPERSTATE ideal-int +pkg syscall (linux-amd64-cgo), const IFLA_PRIORITY ideal-int +pkg syscall (linux-amd64-cgo), const IFLA_PROTINFO ideal-int +pkg syscall (linux-amd64-cgo), const IFLA_QDISC ideal-int +pkg syscall (linux-amd64-cgo), const IFLA_STATS ideal-int +pkg syscall (linux-amd64-cgo), const IFLA_TXQLEN ideal-int +pkg syscall (linux-amd64-cgo), const IFLA_UNSPEC ideal-int +pkg syscall (linux-amd64-cgo), const IFLA_WEIGHT ideal-int +pkg syscall (linux-amd64-cgo), const IFLA_WIRELESS ideal-int +pkg syscall (linux-amd64-cgo), const IFNAMSIZ ideal-int +pkg syscall (linux-amd64-cgo), const IGNBRK ideal-int +pkg syscall (linux-amd64-cgo), const IGNCR ideal-int +pkg syscall (linux-amd64-cgo), const IGNPAR ideal-int +pkg syscall (linux-amd64-cgo), const IMAXBEL ideal-int +pkg syscall (linux-amd64-cgo), const INLCR ideal-int +pkg syscall (linux-amd64-cgo), const INPCK ideal-int +pkg syscall (linux-amd64-cgo), const IN_ACCESS ideal-int +pkg syscall (linux-amd64-cgo), const IN_ALL_EVENTS ideal-int +pkg syscall (linux-amd64-cgo), const IN_ATTRIB ideal-int +pkg syscall (linux-amd64-cgo), const IN_CLASSA_HOST ideal-int +pkg syscall (linux-amd64-cgo), const IN_CLASSA_MAX ideal-int +pkg syscall (linux-amd64-cgo), const IN_CLASSA_NET ideal-int +pkg syscall (linux-amd64-cgo), const IN_CLASSA_NSHIFT ideal-int +pkg syscall (linux-amd64-cgo), const IN_CLASSB_HOST ideal-int +pkg syscall (linux-amd64-cgo), const IN_CLASSB_MAX ideal-int +pkg syscall (linux-amd64-cgo), const IN_CLASSB_NET ideal-int +pkg syscall (linux-amd64-cgo), const IN_CLASSB_NSHIFT ideal-int +pkg syscall (linux-amd64-cgo), const IN_CLASSC_HOST ideal-int +pkg syscall (linux-amd64-cgo), const IN_CLASSC_NET ideal-int +pkg syscall (linux-amd64-cgo), const IN_CLASSC_NSHIFT ideal-int +pkg syscall (linux-amd64-cgo), const IN_CLOEXEC ideal-int +pkg syscall (linux-amd64-cgo), const IN_CLOSE ideal-int +pkg syscall (linux-amd64-cgo), const IN_CLOSE_NOWRITE ideal-int +pkg syscall (linux-amd64-cgo), const IN_CLOSE_WRITE ideal-int +pkg syscall (linux-amd64-cgo), const IN_CREATE ideal-int +pkg syscall (linux-amd64-cgo), const IN_DELETE ideal-int +pkg syscall (linux-amd64-cgo), const IN_DELETE_SELF ideal-int +pkg syscall (linux-amd64-cgo), const IN_DONT_FOLLOW ideal-int +pkg syscall (linux-amd64-cgo), const IN_EXCL_UNLINK ideal-int +pkg syscall (linux-amd64-cgo), const IN_IGNORED ideal-int +pkg syscall (linux-amd64-cgo), const IN_ISDIR ideal-int +pkg syscall (linux-amd64-cgo), const IN_LOOPBACKNET ideal-int +pkg syscall (linux-amd64-cgo), const IN_MASK_ADD ideal-int +pkg syscall (linux-amd64-cgo), const IN_MODIFY ideal-int +pkg syscall (linux-amd64-cgo), const IN_MOVE ideal-int +pkg syscall (linux-amd64-cgo), const IN_MOVED_FROM ideal-int +pkg syscall (linux-amd64-cgo), const IN_MOVED_TO ideal-int +pkg syscall (linux-amd64-cgo), const IN_MOVE_SELF ideal-int +pkg syscall (linux-amd64-cgo), const IN_NONBLOCK ideal-int +pkg syscall (linux-amd64-cgo), const IN_ONESHOT ideal-int +pkg syscall (linux-amd64-cgo), const IN_ONLYDIR ideal-int +pkg syscall (linux-amd64-cgo), const IN_OPEN ideal-int +pkg syscall (linux-amd64-cgo), const IN_Q_OVERFLOW ideal-int +pkg syscall (linux-amd64-cgo), const IN_UNMOUNT ideal-int +pkg syscall (linux-amd64-cgo), const IPPROTO_AH ideal-int +pkg syscall (linux-amd64-cgo), const IPPROTO_COMP ideal-int +pkg syscall (linux-amd64-cgo), const IPPROTO_DCCP ideal-int +pkg syscall (linux-amd64-cgo), const IPPROTO_DSTOPTS ideal-int +pkg syscall (linux-amd64-cgo), const IPPROTO_EGP ideal-int +pkg syscall (linux-amd64-cgo), const IPPROTO_ENCAP ideal-int +pkg syscall (linux-amd64-cgo), const IPPROTO_ESP ideal-int +pkg syscall (linux-amd64-cgo), const IPPROTO_FRAGMENT ideal-int +pkg syscall (linux-amd64-cgo), const IPPROTO_GRE ideal-int +pkg syscall (linux-amd64-cgo), const IPPROTO_HOPOPTS ideal-int +pkg syscall (linux-amd64-cgo), const IPPROTO_ICMP ideal-int +pkg syscall (linux-amd64-cgo), const IPPROTO_ICMPV6 ideal-int +pkg syscall (linux-amd64-cgo), const IPPROTO_IDP ideal-int +pkg syscall (linux-amd64-cgo), const IPPROTO_IGMP ideal-int +pkg syscall (linux-amd64-cgo), const IPPROTO_IPIP ideal-int +pkg syscall (linux-amd64-cgo), const IPPROTO_MTP ideal-int +pkg syscall (linux-amd64-cgo), const IPPROTO_NONE ideal-int +pkg syscall (linux-amd64-cgo), const IPPROTO_PIM ideal-int +pkg syscall (linux-amd64-cgo), const IPPROTO_PUP ideal-int +pkg syscall (linux-amd64-cgo), const IPPROTO_RAW ideal-int +pkg syscall (linux-amd64-cgo), const IPPROTO_ROUTING ideal-int +pkg syscall (linux-amd64-cgo), const IPPROTO_RSVP ideal-int +pkg syscall (linux-amd64-cgo), const IPPROTO_SCTP ideal-int +pkg syscall (linux-amd64-cgo), const IPPROTO_TP ideal-int +pkg syscall (linux-amd64-cgo), const IPPROTO_UDPLITE ideal-int +pkg syscall (linux-amd64-cgo), const IPV6_2292DSTOPTS ideal-int +pkg syscall (linux-amd64-cgo), const IPV6_2292HOPLIMIT ideal-int +pkg syscall (linux-amd64-cgo), const IPV6_2292HOPOPTS ideal-int +pkg syscall (linux-amd64-cgo), const IPV6_2292PKTINFO ideal-int +pkg syscall (linux-amd64-cgo), const IPV6_2292PKTOPTIONS ideal-int +pkg syscall (linux-amd64-cgo), const IPV6_2292RTHDR ideal-int +pkg syscall (linux-amd64-cgo), const IPV6_ADDRFORM ideal-int +pkg syscall (linux-amd64-cgo), const IPV6_ADD_MEMBERSHIP ideal-int +pkg syscall (linux-amd64-cgo), const IPV6_AUTHHDR ideal-int +pkg syscall (linux-amd64-cgo), const IPV6_CHECKSUM ideal-int +pkg syscall (linux-amd64-cgo), const IPV6_DROP_MEMBERSHIP ideal-int +pkg syscall (linux-amd64-cgo), const IPV6_DSTOPTS ideal-int +pkg syscall (linux-amd64-cgo), const IPV6_HOPLIMIT ideal-int +pkg syscall (linux-amd64-cgo), const IPV6_HOPOPTS ideal-int +pkg syscall (linux-amd64-cgo), const IPV6_IPSEC_POLICY ideal-int +pkg syscall (linux-amd64-cgo), const IPV6_JOIN_ANYCAST ideal-int +pkg syscall (linux-amd64-cgo), const IPV6_LEAVE_ANYCAST ideal-int +pkg syscall (linux-amd64-cgo), const IPV6_MTU ideal-int +pkg syscall (linux-amd64-cgo), const IPV6_MTU_DISCOVER ideal-int +pkg syscall (linux-amd64-cgo), const IPV6_NEXTHOP ideal-int +pkg syscall (linux-amd64-cgo), const IPV6_PKTINFO ideal-int +pkg syscall (linux-amd64-cgo), const IPV6_PMTUDISC_DO ideal-int +pkg syscall (linux-amd64-cgo), const IPV6_PMTUDISC_DONT ideal-int +pkg syscall (linux-amd64-cgo), const IPV6_PMTUDISC_PROBE ideal-int +pkg syscall (linux-amd64-cgo), const IPV6_PMTUDISC_WANT ideal-int +pkg syscall (linux-amd64-cgo), const IPV6_RECVDSTOPTS ideal-int +pkg syscall (linux-amd64-cgo), const IPV6_RECVERR ideal-int +pkg syscall (linux-amd64-cgo), const IPV6_RECVHOPLIMIT ideal-int +pkg syscall (linux-amd64-cgo), const IPV6_RECVHOPOPTS ideal-int +pkg syscall (linux-amd64-cgo), const IPV6_RECVPKTINFO ideal-int +pkg syscall (linux-amd64-cgo), const IPV6_RECVRTHDR ideal-int +pkg syscall (linux-amd64-cgo), const IPV6_RECVTCLASS ideal-int +pkg syscall (linux-amd64-cgo), const IPV6_ROUTER_ALERT ideal-int +pkg syscall (linux-amd64-cgo), const IPV6_RTHDR ideal-int +pkg syscall (linux-amd64-cgo), const IPV6_RTHDRDSTOPTS ideal-int +pkg syscall (linux-amd64-cgo), const IPV6_RTHDR_LOOSE ideal-int +pkg syscall (linux-amd64-cgo), const IPV6_RTHDR_STRICT ideal-int +pkg syscall (linux-amd64-cgo), const IPV6_RTHDR_TYPE_0 ideal-int +pkg syscall (linux-amd64-cgo), const IPV6_RXDSTOPTS ideal-int +pkg syscall (linux-amd64-cgo), const IPV6_RXHOPOPTS ideal-int +pkg syscall (linux-amd64-cgo), const IPV6_TCLASS ideal-int +pkg syscall (linux-amd64-cgo), const IPV6_XFRM_POLICY ideal-int +pkg syscall (linux-amd64-cgo), const IP_ADD_SOURCE_MEMBERSHIP ideal-int +pkg syscall (linux-amd64-cgo), const IP_BLOCK_SOURCE ideal-int +pkg syscall (linux-amd64-cgo), const IP_DEFAULT_MULTICAST_LOOP ideal-int +pkg syscall (linux-amd64-cgo), const IP_DEFAULT_MULTICAST_TTL ideal-int +pkg syscall (linux-amd64-cgo), const IP_DF ideal-int +pkg syscall (linux-amd64-cgo), const IP_DROP_SOURCE_MEMBERSHIP ideal-int +pkg syscall (linux-amd64-cgo), const IP_FREEBIND ideal-int +pkg syscall (linux-amd64-cgo), const IP_HDRINCL ideal-int +pkg syscall (linux-amd64-cgo), const IP_IPSEC_POLICY ideal-int +pkg syscall (linux-amd64-cgo), const IP_MAXPACKET ideal-int +pkg syscall (linux-amd64-cgo), const IP_MAX_MEMBERSHIPS ideal-int +pkg syscall (linux-amd64-cgo), const IP_MF ideal-int +pkg syscall (linux-amd64-cgo), const IP_MINTTL ideal-int +pkg syscall (linux-amd64-cgo), const IP_MSFILTER ideal-int +pkg syscall (linux-amd64-cgo), const IP_MSS ideal-int +pkg syscall (linux-amd64-cgo), const IP_MTU ideal-int +pkg syscall (linux-amd64-cgo), const IP_MTU_DISCOVER ideal-int +pkg syscall (linux-amd64-cgo), const IP_OFFMASK ideal-int +pkg syscall (linux-amd64-cgo), const IP_OPTIONS ideal-int +pkg syscall (linux-amd64-cgo), const IP_ORIGDSTADDR ideal-int +pkg syscall (linux-amd64-cgo), const IP_PASSSEC ideal-int +pkg syscall (linux-amd64-cgo), const IP_PKTINFO ideal-int +pkg syscall (linux-amd64-cgo), const IP_PKTOPTIONS ideal-int +pkg syscall (linux-amd64-cgo), const IP_PMTUDISC ideal-int +pkg syscall (linux-amd64-cgo), const IP_PMTUDISC_DO ideal-int +pkg syscall (linux-amd64-cgo), const IP_PMTUDISC_DONT ideal-int +pkg syscall (linux-amd64-cgo), const IP_PMTUDISC_PROBE ideal-int +pkg syscall (linux-amd64-cgo), const IP_PMTUDISC_WANT ideal-int +pkg syscall (linux-amd64-cgo), const IP_RECVERR ideal-int +pkg syscall (linux-amd64-cgo), const IP_RECVOPTS ideal-int +pkg syscall (linux-amd64-cgo), const IP_RECVORIGDSTADDR ideal-int +pkg syscall (linux-amd64-cgo), const IP_RECVRETOPTS ideal-int +pkg syscall (linux-amd64-cgo), const IP_RECVTOS ideal-int +pkg syscall (linux-amd64-cgo), const IP_RECVTTL ideal-int +pkg syscall (linux-amd64-cgo), const IP_RETOPTS ideal-int +pkg syscall (linux-amd64-cgo), const IP_RF ideal-int +pkg syscall (linux-amd64-cgo), const IP_ROUTER_ALERT ideal-int +pkg syscall (linux-amd64-cgo), const IP_TRANSPARENT ideal-int +pkg syscall (linux-amd64-cgo), const IP_UNBLOCK_SOURCE ideal-int +pkg syscall (linux-amd64-cgo), const IP_XFRM_POLICY ideal-int +pkg syscall (linux-amd64-cgo), const ISIG ideal-int +pkg syscall (linux-amd64-cgo), const ISTRIP ideal-int +pkg syscall (linux-amd64-cgo), const IUCLC ideal-int +pkg syscall (linux-amd64-cgo), const IUTF8 ideal-int +pkg syscall (linux-amd64-cgo), const IXANY ideal-int +pkg syscall (linux-amd64-cgo), const IXOFF ideal-int +pkg syscall (linux-amd64-cgo), const IXON ideal-int +pkg syscall (linux-amd64-cgo), const LINUX_REBOOT_CMD_CAD_OFF ideal-int +pkg syscall (linux-amd64-cgo), const LINUX_REBOOT_CMD_CAD_ON ideal-int +pkg syscall (linux-amd64-cgo), const LINUX_REBOOT_CMD_HALT ideal-int +pkg syscall (linux-amd64-cgo), const LINUX_REBOOT_CMD_KEXEC ideal-int +pkg syscall (linux-amd64-cgo), const LINUX_REBOOT_CMD_POWER_OFF ideal-int +pkg syscall (linux-amd64-cgo), const LINUX_REBOOT_CMD_RESTART ideal-int +pkg syscall (linux-amd64-cgo), const LINUX_REBOOT_CMD_RESTART2 ideal-int +pkg syscall (linux-amd64-cgo), const LINUX_REBOOT_CMD_SW_SUSPEND ideal-int +pkg syscall (linux-amd64-cgo), const LINUX_REBOOT_MAGIC1 ideal-int +pkg syscall (linux-amd64-cgo), const LINUX_REBOOT_MAGIC2 ideal-int +pkg syscall (linux-amd64-cgo), const LOCK_EX ideal-int +pkg syscall (linux-amd64-cgo), const LOCK_NB ideal-int +pkg syscall (linux-amd64-cgo), const LOCK_SH ideal-int +pkg syscall (linux-amd64-cgo), const LOCK_UN ideal-int +pkg syscall (linux-amd64-cgo), const MADV_DOFORK ideal-int +pkg syscall (linux-amd64-cgo), const MADV_DONTFORK ideal-int +pkg syscall (linux-amd64-cgo), const MADV_DONTNEED ideal-int +pkg syscall (linux-amd64-cgo), const MADV_HUGEPAGE ideal-int +pkg syscall (linux-amd64-cgo), const MADV_HWPOISON ideal-int +pkg syscall (linux-amd64-cgo), const MADV_MERGEABLE ideal-int +pkg syscall (linux-amd64-cgo), const MADV_NOHUGEPAGE ideal-int +pkg syscall (linux-amd64-cgo), const MADV_NORMAL ideal-int +pkg syscall (linux-amd64-cgo), const MADV_RANDOM ideal-int +pkg syscall (linux-amd64-cgo), const MADV_REMOVE ideal-int +pkg syscall (linux-amd64-cgo), const MADV_SEQUENTIAL ideal-int +pkg syscall (linux-amd64-cgo), const MADV_UNMERGEABLE ideal-int +pkg syscall (linux-amd64-cgo), const MADV_WILLNEED ideal-int +pkg syscall (linux-amd64-cgo), const MAP_32BIT ideal-int +pkg syscall (linux-amd64-cgo), const MAP_ANON ideal-int +pkg syscall (linux-amd64-cgo), const MAP_ANONYMOUS ideal-int +pkg syscall (linux-amd64-cgo), const MAP_DENYWRITE ideal-int +pkg syscall (linux-amd64-cgo), const MAP_EXECUTABLE ideal-int +pkg syscall (linux-amd64-cgo), const MAP_FILE ideal-int +pkg syscall (linux-amd64-cgo), const MAP_FIXED ideal-int +pkg syscall (linux-amd64-cgo), const MAP_GROWSDOWN ideal-int +pkg syscall (linux-amd64-cgo), const MAP_HUGETLB ideal-int +pkg syscall (linux-amd64-cgo), const MAP_LOCKED ideal-int +pkg syscall (linux-amd64-cgo), const MAP_NONBLOCK ideal-int +pkg syscall (linux-amd64-cgo), const MAP_NORESERVE ideal-int +pkg syscall (linux-amd64-cgo), const MAP_POPULATE ideal-int +pkg syscall (linux-amd64-cgo), const MAP_PRIVATE ideal-int +pkg syscall (linux-amd64-cgo), const MAP_SHARED ideal-int +pkg syscall (linux-amd64-cgo), const MAP_STACK ideal-int +pkg syscall (linux-amd64-cgo), const MAP_TYPE ideal-int +pkg syscall (linux-amd64-cgo), const MCL_CURRENT ideal-int +pkg syscall (linux-amd64-cgo), const MCL_FUTURE ideal-int +pkg syscall (linux-amd64-cgo), const MNT_DETACH ideal-int +pkg syscall (linux-amd64-cgo), const MNT_EXPIRE ideal-int +pkg syscall (linux-amd64-cgo), const MNT_FORCE ideal-int +pkg syscall (linux-amd64-cgo), const MSG_CMSG_CLOEXEC ideal-int +pkg syscall (linux-amd64-cgo), const MSG_CONFIRM ideal-int +pkg syscall (linux-amd64-cgo), const MSG_CTRUNC ideal-int +pkg syscall (linux-amd64-cgo), const MSG_DONTROUTE ideal-int +pkg syscall (linux-amd64-cgo), const MSG_DONTWAIT ideal-int +pkg syscall (linux-amd64-cgo), const MSG_EOR ideal-int +pkg syscall (linux-amd64-cgo), const MSG_ERRQUEUE ideal-int +pkg syscall (linux-amd64-cgo), const MSG_FIN ideal-int +pkg syscall (linux-amd64-cgo), const MSG_MORE ideal-int +pkg syscall (linux-amd64-cgo), const MSG_NOSIGNAL ideal-int +pkg syscall (linux-amd64-cgo), const MSG_OOB ideal-int +pkg syscall (linux-amd64-cgo), const MSG_PEEK ideal-int +pkg syscall (linux-amd64-cgo), const MSG_PROXY ideal-int +pkg syscall (linux-amd64-cgo), const MSG_RST ideal-int +pkg syscall (linux-amd64-cgo), const MSG_SYN ideal-int +pkg syscall (linux-amd64-cgo), const MSG_TRUNC ideal-int +pkg syscall (linux-amd64-cgo), const MSG_TRYHARD ideal-int +pkg syscall (linux-amd64-cgo), const MSG_WAITALL ideal-int +pkg syscall (linux-amd64-cgo), const MSG_WAITFORONE ideal-int +pkg syscall (linux-amd64-cgo), const MS_ACTIVE ideal-int +pkg syscall (linux-amd64-cgo), const MS_ASYNC ideal-int +pkg syscall (linux-amd64-cgo), const MS_BIND ideal-int +pkg syscall (linux-amd64-cgo), const MS_DIRSYNC ideal-int +pkg syscall (linux-amd64-cgo), const MS_INVALIDATE ideal-int +pkg syscall (linux-amd64-cgo), const MS_I_VERSION ideal-int +pkg syscall (linux-amd64-cgo), const MS_KERNMOUNT ideal-int +pkg syscall (linux-amd64-cgo), const MS_MANDLOCK ideal-int +pkg syscall (linux-amd64-cgo), const MS_MGC_MSK ideal-int +pkg syscall (linux-amd64-cgo), const MS_MGC_VAL ideal-int +pkg syscall (linux-amd64-cgo), const MS_MOVE ideal-int +pkg syscall (linux-amd64-cgo), const MS_NOATIME ideal-int +pkg syscall (linux-amd64-cgo), const MS_NODEV ideal-int +pkg syscall (linux-amd64-cgo), const MS_NODIRATIME ideal-int +pkg syscall (linux-amd64-cgo), const MS_NOEXEC ideal-int +pkg syscall (linux-amd64-cgo), const MS_NOSUID ideal-int +pkg syscall (linux-amd64-cgo), const MS_NOUSER ideal-int +pkg syscall (linux-amd64-cgo), const MS_POSIXACL ideal-int +pkg syscall (linux-amd64-cgo), const MS_PRIVATE ideal-int +pkg syscall (linux-amd64-cgo), const MS_RDONLY ideal-int +pkg syscall (linux-amd64-cgo), const MS_REC ideal-int +pkg syscall (linux-amd64-cgo), const MS_RELATIME ideal-int +pkg syscall (linux-amd64-cgo), const MS_REMOUNT ideal-int +pkg syscall (linux-amd64-cgo), const MS_RMT_MASK ideal-int +pkg syscall (linux-amd64-cgo), const MS_SHARED ideal-int +pkg syscall (linux-amd64-cgo), const MS_SILENT ideal-int +pkg syscall (linux-amd64-cgo), const MS_SLAVE ideal-int +pkg syscall (linux-amd64-cgo), const MS_STRICTATIME ideal-int +pkg syscall (linux-amd64-cgo), const MS_SYNC ideal-int +pkg syscall (linux-amd64-cgo), const MS_SYNCHRONOUS ideal-int +pkg syscall (linux-amd64-cgo), const MS_UNBINDABLE ideal-int +pkg syscall (linux-amd64-cgo), const NAME_MAX ideal-int +pkg syscall (linux-amd64-cgo), const NETLINK_ADD_MEMBERSHIP ideal-int +pkg syscall (linux-amd64-cgo), const NETLINK_AUDIT ideal-int +pkg syscall (linux-amd64-cgo), const NETLINK_BROADCAST_ERROR ideal-int +pkg syscall (linux-amd64-cgo), const NETLINK_CONNECTOR ideal-int +pkg syscall (linux-amd64-cgo), const NETLINK_DNRTMSG ideal-int +pkg syscall (linux-amd64-cgo), const NETLINK_DROP_MEMBERSHIP ideal-int +pkg syscall (linux-amd64-cgo), const NETLINK_ECRYPTFS ideal-int +pkg syscall (linux-amd64-cgo), const NETLINK_FIB_LOOKUP ideal-int +pkg syscall (linux-amd64-cgo), const NETLINK_FIREWALL ideal-int +pkg syscall (linux-amd64-cgo), const NETLINK_GENERIC ideal-int +pkg syscall (linux-amd64-cgo), const NETLINK_INET_DIAG ideal-int +pkg syscall (linux-amd64-cgo), const NETLINK_IP6_FW ideal-int +pkg syscall (linux-amd64-cgo), const NETLINK_ISCSI ideal-int +pkg syscall (linux-amd64-cgo), const NETLINK_KOBJECT_UEVENT ideal-int +pkg syscall (linux-amd64-cgo), const NETLINK_NETFILTER ideal-int +pkg syscall (linux-amd64-cgo), const NETLINK_NFLOG ideal-int +pkg syscall (linux-amd64-cgo), const NETLINK_NO_ENOBUFS ideal-int +pkg syscall (linux-amd64-cgo), const NETLINK_PKTINFO ideal-int +pkg syscall (linux-amd64-cgo), const NETLINK_ROUTE ideal-int +pkg syscall (linux-amd64-cgo), const NETLINK_SCSITRANSPORT ideal-int +pkg syscall (linux-amd64-cgo), const NETLINK_SELINUX ideal-int +pkg syscall (linux-amd64-cgo), const NETLINK_UNUSED ideal-int +pkg syscall (linux-amd64-cgo), const NETLINK_USERSOCK ideal-int +pkg syscall (linux-amd64-cgo), const NETLINK_XFRM ideal-int +pkg syscall (linux-amd64-cgo), const NLA_ALIGNTO ideal-int +pkg syscall (linux-amd64-cgo), const NLA_F_NESTED ideal-int +pkg syscall (linux-amd64-cgo), const NLA_F_NET_BYTEORDER ideal-int +pkg syscall (linux-amd64-cgo), const NLA_HDRLEN ideal-int +pkg syscall (linux-amd64-cgo), const NLMSG_ALIGNTO ideal-int +pkg syscall (linux-amd64-cgo), const NLMSG_DONE ideal-int +pkg syscall (linux-amd64-cgo), const NLMSG_ERROR ideal-int +pkg syscall (linux-amd64-cgo), const NLMSG_HDRLEN ideal-int +pkg syscall (linux-amd64-cgo), const NLMSG_MIN_TYPE ideal-int +pkg syscall (linux-amd64-cgo), const NLMSG_NOOP ideal-int +pkg syscall (linux-amd64-cgo), const NLMSG_OVERRUN ideal-int +pkg syscall (linux-amd64-cgo), const NLM_F_ACK ideal-int +pkg syscall (linux-amd64-cgo), const NLM_F_APPEND ideal-int +pkg syscall (linux-amd64-cgo), const NLM_F_ATOMIC ideal-int +pkg syscall (linux-amd64-cgo), const NLM_F_CREATE ideal-int +pkg syscall (linux-amd64-cgo), const NLM_F_DUMP ideal-int +pkg syscall (linux-amd64-cgo), const NLM_F_ECHO ideal-int +pkg syscall (linux-amd64-cgo), const NLM_F_EXCL ideal-int +pkg syscall (linux-amd64-cgo), const NLM_F_MATCH ideal-int +pkg syscall (linux-amd64-cgo), const NLM_F_MULTI ideal-int +pkg syscall (linux-amd64-cgo), const NLM_F_REPLACE ideal-int +pkg syscall (linux-amd64-cgo), const NLM_F_REQUEST ideal-int +pkg syscall (linux-amd64-cgo), const NLM_F_ROOT ideal-int +pkg syscall (linux-amd64-cgo), const NOFLSH ideal-int +pkg syscall (linux-amd64-cgo), const OCRNL ideal-int +pkg syscall (linux-amd64-cgo), const OFDEL ideal-int +pkg syscall (linux-amd64-cgo), const OFILL ideal-int +pkg syscall (linux-amd64-cgo), const OLCUC ideal-int +pkg syscall (linux-amd64-cgo), const ONLCR ideal-int +pkg syscall (linux-amd64-cgo), const ONLRET ideal-int +pkg syscall (linux-amd64-cgo), const ONOCR ideal-int +pkg syscall (linux-amd64-cgo), const OPOST ideal-int +pkg syscall (linux-amd64-cgo), const O_ACCMODE ideal-int +pkg syscall (linux-amd64-cgo), const O_DIRECT ideal-int +pkg syscall (linux-amd64-cgo), const O_DIRECTORY ideal-int +pkg syscall (linux-amd64-cgo), const O_DSYNC ideal-int +pkg syscall (linux-amd64-cgo), const O_FSYNC ideal-int +pkg syscall (linux-amd64-cgo), const O_LARGEFILE ideal-int +pkg syscall (linux-amd64-cgo), const O_NDELAY ideal-int +pkg syscall (linux-amd64-cgo), const O_NOATIME ideal-int +pkg syscall (linux-amd64-cgo), const O_NOFOLLOW ideal-int +pkg syscall (linux-amd64-cgo), const O_RSYNC ideal-int +pkg syscall (linux-amd64-cgo), const PACKET_ADD_MEMBERSHIP ideal-int +pkg syscall (linux-amd64-cgo), const PACKET_BROADCAST ideal-int +pkg syscall (linux-amd64-cgo), const PACKET_DROP_MEMBERSHIP ideal-int +pkg syscall (linux-amd64-cgo), const PACKET_FASTROUTE ideal-int +pkg syscall (linux-amd64-cgo), const PACKET_HOST ideal-int +pkg syscall (linux-amd64-cgo), const PACKET_LOOPBACK ideal-int +pkg syscall (linux-amd64-cgo), const PACKET_MR_ALLMULTI ideal-int +pkg syscall (linux-amd64-cgo), const PACKET_MR_MULTICAST ideal-int +pkg syscall (linux-amd64-cgo), const PACKET_MR_PROMISC ideal-int +pkg syscall (linux-amd64-cgo), const PACKET_MULTICAST ideal-int +pkg syscall (linux-amd64-cgo), const PACKET_OTHERHOST ideal-int +pkg syscall (linux-amd64-cgo), const PACKET_OUTGOING ideal-int +pkg syscall (linux-amd64-cgo), const PACKET_RECV_OUTPUT ideal-int +pkg syscall (linux-amd64-cgo), const PACKET_RX_RING ideal-int +pkg syscall (linux-amd64-cgo), const PACKET_STATISTICS ideal-int +pkg syscall (linux-amd64-cgo), const PARENB ideal-int +pkg syscall (linux-amd64-cgo), const PARMRK ideal-int +pkg syscall (linux-amd64-cgo), const PARODD ideal-int +pkg syscall (linux-amd64-cgo), const PENDIN ideal-int +pkg syscall (linux-amd64-cgo), const PROT_EXEC ideal-int +pkg syscall (linux-amd64-cgo), const PROT_GROWSDOWN ideal-int +pkg syscall (linux-amd64-cgo), const PROT_GROWSUP ideal-int +pkg syscall (linux-amd64-cgo), const PROT_NONE ideal-int +pkg syscall (linux-amd64-cgo), const PROT_READ ideal-int +pkg syscall (linux-amd64-cgo), const PROT_WRITE ideal-int +pkg syscall (linux-amd64-cgo), const PR_CAPBSET_DROP ideal-int +pkg syscall (linux-amd64-cgo), const PR_CAPBSET_READ ideal-int +pkg syscall (linux-amd64-cgo), const PR_ENDIAN_BIG ideal-int +pkg syscall (linux-amd64-cgo), const PR_ENDIAN_LITTLE ideal-int +pkg syscall (linux-amd64-cgo), const PR_ENDIAN_PPC_LITTLE ideal-int +pkg syscall (linux-amd64-cgo), const PR_FPEMU_NOPRINT ideal-int +pkg syscall (linux-amd64-cgo), const PR_FPEMU_SIGFPE ideal-int +pkg syscall (linux-amd64-cgo), const PR_FP_EXC_ASYNC ideal-int +pkg syscall (linux-amd64-cgo), const PR_FP_EXC_DISABLED ideal-int +pkg syscall (linux-amd64-cgo), const PR_FP_EXC_DIV ideal-int +pkg syscall (linux-amd64-cgo), const PR_FP_EXC_INV ideal-int +pkg syscall (linux-amd64-cgo), const PR_FP_EXC_NONRECOV ideal-int +pkg syscall (linux-amd64-cgo), const PR_FP_EXC_OVF ideal-int +pkg syscall (linux-amd64-cgo), const PR_FP_EXC_PRECISE ideal-int +pkg syscall (linux-amd64-cgo), const PR_FP_EXC_RES ideal-int +pkg syscall (linux-amd64-cgo), const PR_FP_EXC_SW_ENABLE ideal-int +pkg syscall (linux-amd64-cgo), const PR_FP_EXC_UND ideal-int +pkg syscall (linux-amd64-cgo), const PR_GET_DUMPABLE ideal-int +pkg syscall (linux-amd64-cgo), const PR_GET_ENDIAN ideal-int +pkg syscall (linux-amd64-cgo), const PR_GET_FPEMU ideal-int +pkg syscall (linux-amd64-cgo), const PR_GET_FPEXC ideal-int +pkg syscall (linux-amd64-cgo), const PR_GET_KEEPCAPS ideal-int +pkg syscall (linux-amd64-cgo), const PR_GET_NAME ideal-int +pkg syscall (linux-amd64-cgo), const PR_GET_PDEATHSIG ideal-int +pkg syscall (linux-amd64-cgo), const PR_GET_SECCOMP ideal-int +pkg syscall (linux-amd64-cgo), const PR_GET_SECUREBITS ideal-int +pkg syscall (linux-amd64-cgo), const PR_GET_TIMERSLACK ideal-int +pkg syscall (linux-amd64-cgo), const PR_GET_TIMING ideal-int +pkg syscall (linux-amd64-cgo), const PR_GET_TSC ideal-int +pkg syscall (linux-amd64-cgo), const PR_GET_UNALIGN ideal-int +pkg syscall (linux-amd64-cgo), const PR_MCE_KILL ideal-int +pkg syscall (linux-amd64-cgo), const PR_MCE_KILL_CLEAR ideal-int +pkg syscall (linux-amd64-cgo), const PR_MCE_KILL_DEFAULT ideal-int +pkg syscall (linux-amd64-cgo), const PR_MCE_KILL_EARLY ideal-int +pkg syscall (linux-amd64-cgo), const PR_MCE_KILL_GET ideal-int +pkg syscall (linux-amd64-cgo), const PR_MCE_KILL_LATE ideal-int +pkg syscall (linux-amd64-cgo), const PR_MCE_KILL_SET ideal-int +pkg syscall (linux-amd64-cgo), const PR_SET_DUMPABLE ideal-int +pkg syscall (linux-amd64-cgo), const PR_SET_ENDIAN ideal-int +pkg syscall (linux-amd64-cgo), const PR_SET_FPEMU ideal-int +pkg syscall (linux-amd64-cgo), const PR_SET_FPEXC ideal-int +pkg syscall (linux-amd64-cgo), const PR_SET_KEEPCAPS ideal-int +pkg syscall (linux-amd64-cgo), const PR_SET_NAME ideal-int +pkg syscall (linux-amd64-cgo), const PR_SET_PDEATHSIG ideal-int +pkg syscall (linux-amd64-cgo), const PR_SET_PTRACER ideal-int +pkg syscall (linux-amd64-cgo), const PR_SET_SECCOMP ideal-int +pkg syscall (linux-amd64-cgo), const PR_SET_SECUREBITS ideal-int +pkg syscall (linux-amd64-cgo), const PR_SET_TIMERSLACK ideal-int +pkg syscall (linux-amd64-cgo), const PR_SET_TIMING ideal-int +pkg syscall (linux-amd64-cgo), const PR_SET_TSC ideal-int +pkg syscall (linux-amd64-cgo), const PR_SET_UNALIGN ideal-int +pkg syscall (linux-amd64-cgo), const PR_TASK_PERF_EVENTS_DISABLE ideal-int +pkg syscall (linux-amd64-cgo), const PR_TASK_PERF_EVENTS_ENABLE ideal-int +pkg syscall (linux-amd64-cgo), const PR_TIMING_STATISTICAL ideal-int +pkg syscall (linux-amd64-cgo), const PR_TIMING_TIMESTAMP ideal-int +pkg syscall (linux-amd64-cgo), const PR_TSC_ENABLE ideal-int +pkg syscall (linux-amd64-cgo), const PR_TSC_SIGSEGV ideal-int +pkg syscall (linux-amd64-cgo), const PR_UNALIGN_NOPRINT ideal-int +pkg syscall (linux-amd64-cgo), const PR_UNALIGN_SIGBUS ideal-int +pkg syscall (linux-amd64-cgo), const PTRACE_ARCH_PRCTL ideal-int +pkg syscall (linux-amd64-cgo), const PTRACE_ATTACH ideal-int +pkg syscall (linux-amd64-cgo), const PTRACE_CONT ideal-int +pkg syscall (linux-amd64-cgo), const PTRACE_DETACH ideal-int +pkg syscall (linux-amd64-cgo), const PTRACE_EVENT_CLONE ideal-int +pkg syscall (linux-amd64-cgo), const PTRACE_EVENT_EXEC ideal-int +pkg syscall (linux-amd64-cgo), const PTRACE_EVENT_EXIT ideal-int +pkg syscall (linux-amd64-cgo), const PTRACE_EVENT_FORK ideal-int +pkg syscall (linux-amd64-cgo), const PTRACE_EVENT_VFORK ideal-int +pkg syscall (linux-amd64-cgo), const PTRACE_EVENT_VFORK_DONE ideal-int +pkg syscall (linux-amd64-cgo), const PTRACE_GETEVENTMSG ideal-int +pkg syscall (linux-amd64-cgo), const PTRACE_GETFPREGS ideal-int +pkg syscall (linux-amd64-cgo), const PTRACE_GETFPXREGS ideal-int +pkg syscall (linux-amd64-cgo), const PTRACE_GETREGS ideal-int +pkg syscall (linux-amd64-cgo), const PTRACE_GETREGSET ideal-int +pkg syscall (linux-amd64-cgo), const PTRACE_GETSIGINFO ideal-int +pkg syscall (linux-amd64-cgo), const PTRACE_GET_THREAD_AREA ideal-int +pkg syscall (linux-amd64-cgo), const PTRACE_KILL ideal-int +pkg syscall (linux-amd64-cgo), const PTRACE_OLDSETOPTIONS ideal-int +pkg syscall (linux-amd64-cgo), const PTRACE_O_MASK ideal-int +pkg syscall (linux-amd64-cgo), const PTRACE_O_TRACECLONE ideal-int +pkg syscall (linux-amd64-cgo), const PTRACE_O_TRACEEXEC ideal-int +pkg syscall (linux-amd64-cgo), const PTRACE_O_TRACEEXIT ideal-int +pkg syscall (linux-amd64-cgo), const PTRACE_O_TRACEFORK ideal-int +pkg syscall (linux-amd64-cgo), const PTRACE_O_TRACESYSGOOD ideal-int +pkg syscall (linux-amd64-cgo), const PTRACE_O_TRACEVFORK ideal-int +pkg syscall (linux-amd64-cgo), const PTRACE_O_TRACEVFORKDONE ideal-int +pkg syscall (linux-amd64-cgo), const PTRACE_PEEKDATA ideal-int +pkg syscall (linux-amd64-cgo), const PTRACE_PEEKTEXT ideal-int +pkg syscall (linux-amd64-cgo), const PTRACE_PEEKUSR ideal-int +pkg syscall (linux-amd64-cgo), const PTRACE_POKEDATA ideal-int +pkg syscall (linux-amd64-cgo), const PTRACE_POKETEXT ideal-int +pkg syscall (linux-amd64-cgo), const PTRACE_POKEUSR ideal-int +pkg syscall (linux-amd64-cgo), const PTRACE_SETFPREGS ideal-int +pkg syscall (linux-amd64-cgo), const PTRACE_SETFPXREGS ideal-int +pkg syscall (linux-amd64-cgo), const PTRACE_SETOPTIONS ideal-int +pkg syscall (linux-amd64-cgo), const PTRACE_SETREGS ideal-int +pkg syscall (linux-amd64-cgo), const PTRACE_SETREGSET ideal-int +pkg syscall (linux-amd64-cgo), const PTRACE_SETSIGINFO ideal-int +pkg syscall (linux-amd64-cgo), const PTRACE_SET_THREAD_AREA ideal-int +pkg syscall (linux-amd64-cgo), const PTRACE_SINGLEBLOCK ideal-int +pkg syscall (linux-amd64-cgo), const PTRACE_SINGLESTEP ideal-int +pkg syscall (linux-amd64-cgo), const PTRACE_SYSCALL ideal-int +pkg syscall (linux-amd64-cgo), const PTRACE_SYSEMU ideal-int +pkg syscall (linux-amd64-cgo), const PTRACE_SYSEMU_SINGLESTEP ideal-int +pkg syscall (linux-amd64-cgo), const PTRACE_TRACEME ideal-int +pkg syscall (linux-amd64-cgo), const PathMax ideal-int +pkg syscall (linux-amd64-cgo), const RLIMIT_AS ideal-int +pkg syscall (linux-amd64-cgo), const RLIMIT_CORE ideal-int +pkg syscall (linux-amd64-cgo), const RLIMIT_CPU ideal-int +pkg syscall (linux-amd64-cgo), const RLIMIT_DATA ideal-int +pkg syscall (linux-amd64-cgo), const RLIMIT_FSIZE ideal-int +pkg syscall (linux-amd64-cgo), const RLIMIT_NOFILE ideal-int +pkg syscall (linux-amd64-cgo), const RLIMIT_STACK ideal-int +pkg syscall (linux-amd64-cgo), const RLIM_INFINITY ideal-int +pkg syscall (linux-amd64-cgo), const RTAX_ADVMSS ideal-int +pkg syscall (linux-amd64-cgo), const RTAX_CWND ideal-int +pkg syscall (linux-amd64-cgo), const RTAX_FEATURES ideal-int +pkg syscall (linux-amd64-cgo), const RTAX_FEATURE_ALLFRAG ideal-int +pkg syscall (linux-amd64-cgo), const RTAX_FEATURE_ECN ideal-int +pkg syscall (linux-amd64-cgo), const RTAX_FEATURE_SACK ideal-int +pkg syscall (linux-amd64-cgo), const RTAX_FEATURE_TIMESTAMP ideal-int +pkg syscall (linux-amd64-cgo), const RTAX_HOPLIMIT ideal-int +pkg syscall (linux-amd64-cgo), const RTAX_INITCWND ideal-int +pkg syscall (linux-amd64-cgo), const RTAX_INITRWND ideal-int +pkg syscall (linux-amd64-cgo), const RTAX_LOCK ideal-int +pkg syscall (linux-amd64-cgo), const RTAX_MAX ideal-int +pkg syscall (linux-amd64-cgo), const RTAX_MTU ideal-int +pkg syscall (linux-amd64-cgo), const RTAX_REORDERING ideal-int +pkg syscall (linux-amd64-cgo), const RTAX_RTO_MIN ideal-int +pkg syscall (linux-amd64-cgo), const RTAX_RTT ideal-int +pkg syscall (linux-amd64-cgo), const RTAX_RTTVAR ideal-int +pkg syscall (linux-amd64-cgo), const RTAX_SSTHRESH ideal-int +pkg syscall (linux-amd64-cgo), const RTAX_UNSPEC ideal-int +pkg syscall (linux-amd64-cgo), const RTAX_WINDOW ideal-int +pkg syscall (linux-amd64-cgo), const RTA_ALIGNTO ideal-int +pkg syscall (linux-amd64-cgo), const RTA_CACHEINFO ideal-int +pkg syscall (linux-amd64-cgo), const RTA_DST ideal-int +pkg syscall (linux-amd64-cgo), const RTA_FLOW ideal-int +pkg syscall (linux-amd64-cgo), const RTA_GATEWAY ideal-int +pkg syscall (linux-amd64-cgo), const RTA_IIF ideal-int +pkg syscall (linux-amd64-cgo), const RTA_MAX ideal-int +pkg syscall (linux-amd64-cgo), const RTA_METRICS ideal-int +pkg syscall (linux-amd64-cgo), const RTA_MULTIPATH ideal-int +pkg syscall (linux-amd64-cgo), const RTA_OIF ideal-int +pkg syscall (linux-amd64-cgo), const RTA_PREFSRC ideal-int +pkg syscall (linux-amd64-cgo), const RTA_PRIORITY ideal-int +pkg syscall (linux-amd64-cgo), const RTA_SRC ideal-int +pkg syscall (linux-amd64-cgo), const RTA_TABLE ideal-int +pkg syscall (linux-amd64-cgo), const RTA_UNSPEC ideal-int +pkg syscall (linux-amd64-cgo), const RTCF_DIRECTSRC ideal-int +pkg syscall (linux-amd64-cgo), const RTCF_DOREDIRECT ideal-int +pkg syscall (linux-amd64-cgo), const RTCF_LOG ideal-int +pkg syscall (linux-amd64-cgo), const RTCF_MASQ ideal-int +pkg syscall (linux-amd64-cgo), const RTCF_NAT ideal-int +pkg syscall (linux-amd64-cgo), const RTCF_VALVE ideal-int +pkg syscall (linux-amd64-cgo), const RTF_ADDRCLASSMASK ideal-int +pkg syscall (linux-amd64-cgo), const RTF_ADDRCONF ideal-int +pkg syscall (linux-amd64-cgo), const RTF_ALLONLINK ideal-int +pkg syscall (linux-amd64-cgo), const RTF_BROADCAST ideal-int +pkg syscall (linux-amd64-cgo), const RTF_CACHE ideal-int +pkg syscall (linux-amd64-cgo), const RTF_DEFAULT ideal-int +pkg syscall (linux-amd64-cgo), const RTF_DYNAMIC ideal-int +pkg syscall (linux-amd64-cgo), const RTF_FLOW ideal-int +pkg syscall (linux-amd64-cgo), const RTF_GATEWAY ideal-int +pkg syscall (linux-amd64-cgo), const RTF_HOST ideal-int +pkg syscall (linux-amd64-cgo), const RTF_INTERFACE ideal-int +pkg syscall (linux-amd64-cgo), const RTF_IRTT ideal-int +pkg syscall (linux-amd64-cgo), const RTF_LINKRT ideal-int +pkg syscall (linux-amd64-cgo), const RTF_LOCAL ideal-int +pkg syscall (linux-amd64-cgo), const RTF_MODIFIED ideal-int +pkg syscall (linux-amd64-cgo), const RTF_MSS ideal-int +pkg syscall (linux-amd64-cgo), const RTF_MTU ideal-int +pkg syscall (linux-amd64-cgo), const RTF_MULTICAST ideal-int +pkg syscall (linux-amd64-cgo), const RTF_NAT ideal-int +pkg syscall (linux-amd64-cgo), const RTF_NOFORWARD ideal-int +pkg syscall (linux-amd64-cgo), const RTF_NONEXTHOP ideal-int +pkg syscall (linux-amd64-cgo), const RTF_NOPMTUDISC ideal-int +pkg syscall (linux-amd64-cgo), const RTF_POLICY ideal-int +pkg syscall (linux-amd64-cgo), const RTF_REINSTATE ideal-int +pkg syscall (linux-amd64-cgo), const RTF_REJECT ideal-int +pkg syscall (linux-amd64-cgo), const RTF_STATIC ideal-int +pkg syscall (linux-amd64-cgo), const RTF_THROW ideal-int +pkg syscall (linux-amd64-cgo), const RTF_UP ideal-int +pkg syscall (linux-amd64-cgo), const RTF_WINDOW ideal-int +pkg syscall (linux-amd64-cgo), const RTF_XRESOLVE ideal-int +pkg syscall (linux-amd64-cgo), const RTM_BASE ideal-int +pkg syscall (linux-amd64-cgo), const RTM_DELACTION ideal-int +pkg syscall (linux-amd64-cgo), const RTM_DELADDR ideal-int +pkg syscall (linux-amd64-cgo), const RTM_DELADDRLABEL ideal-int +pkg syscall (linux-amd64-cgo), const RTM_DELLINK ideal-int +pkg syscall (linux-amd64-cgo), const RTM_DELNEIGH ideal-int +pkg syscall (linux-amd64-cgo), const RTM_DELQDISC ideal-int +pkg syscall (linux-amd64-cgo), const RTM_DELROUTE ideal-int +pkg syscall (linux-amd64-cgo), const RTM_DELRULE ideal-int +pkg syscall (linux-amd64-cgo), const RTM_DELTCLASS ideal-int +pkg syscall (linux-amd64-cgo), const RTM_DELTFILTER ideal-int +pkg syscall (linux-amd64-cgo), const RTM_F_CLONED ideal-int +pkg syscall (linux-amd64-cgo), const RTM_F_EQUALIZE ideal-int +pkg syscall (linux-amd64-cgo), const RTM_F_NOTIFY ideal-int +pkg syscall (linux-amd64-cgo), const RTM_F_PREFIX ideal-int +pkg syscall (linux-amd64-cgo), const RTM_GETACTION ideal-int +pkg syscall (linux-amd64-cgo), const RTM_GETADDR ideal-int +pkg syscall (linux-amd64-cgo), const RTM_GETADDRLABEL ideal-int +pkg syscall (linux-amd64-cgo), const RTM_GETANYCAST ideal-int +pkg syscall (linux-amd64-cgo), const RTM_GETDCB ideal-int +pkg syscall (linux-amd64-cgo), const RTM_GETLINK ideal-int +pkg syscall (linux-amd64-cgo), const RTM_GETMULTICAST ideal-int +pkg syscall (linux-amd64-cgo), const RTM_GETNEIGH ideal-int +pkg syscall (linux-amd64-cgo), const RTM_GETNEIGHTBL ideal-int +pkg syscall (linux-amd64-cgo), const RTM_GETQDISC ideal-int +pkg syscall (linux-amd64-cgo), const RTM_GETROUTE ideal-int +pkg syscall (linux-amd64-cgo), const RTM_GETRULE ideal-int +pkg syscall (linux-amd64-cgo), const RTM_GETTCLASS ideal-int +pkg syscall (linux-amd64-cgo), const RTM_GETTFILTER ideal-int +pkg syscall (linux-amd64-cgo), const RTM_MAX ideal-int +pkg syscall (linux-amd64-cgo), const RTM_NEWACTION ideal-int +pkg syscall (linux-amd64-cgo), const RTM_NEWADDR ideal-int +pkg syscall (linux-amd64-cgo), const RTM_NEWADDRLABEL ideal-int +pkg syscall (linux-amd64-cgo), const RTM_NEWLINK ideal-int +pkg syscall (linux-amd64-cgo), const RTM_NEWNDUSEROPT ideal-int +pkg syscall (linux-amd64-cgo), const RTM_NEWNEIGH ideal-int +pkg syscall (linux-amd64-cgo), const RTM_NEWNEIGHTBL ideal-int +pkg syscall (linux-amd64-cgo), const RTM_NEWPREFIX ideal-int +pkg syscall (linux-amd64-cgo), const RTM_NEWQDISC ideal-int +pkg syscall (linux-amd64-cgo), const RTM_NEWROUTE ideal-int +pkg syscall (linux-amd64-cgo), const RTM_NEWRULE ideal-int +pkg syscall (linux-amd64-cgo), const RTM_NEWTCLASS ideal-int +pkg syscall (linux-amd64-cgo), const RTM_NEWTFILTER ideal-int +pkg syscall (linux-amd64-cgo), const RTM_NR_FAMILIES ideal-int +pkg syscall (linux-amd64-cgo), const RTM_NR_MSGTYPES ideal-int +pkg syscall (linux-amd64-cgo), const RTM_SETDCB ideal-int +pkg syscall (linux-amd64-cgo), const RTM_SETLINK ideal-int +pkg syscall (linux-amd64-cgo), const RTM_SETNEIGHTBL ideal-int +pkg syscall (linux-amd64-cgo), const RTNH_ALIGNTO ideal-int +pkg syscall (linux-amd64-cgo), const RTNH_F_DEAD ideal-int +pkg syscall (linux-amd64-cgo), const RTNH_F_ONLINK ideal-int +pkg syscall (linux-amd64-cgo), const RTNH_F_PERVASIVE ideal-int +pkg syscall (linux-amd64-cgo), const RTN_ANYCAST ideal-int +pkg syscall (linux-amd64-cgo), const RTN_BLACKHOLE ideal-int +pkg syscall (linux-amd64-cgo), const RTN_BROADCAST ideal-int +pkg syscall (linux-amd64-cgo), const RTN_LOCAL ideal-int +pkg syscall (linux-amd64-cgo), const RTN_MAX ideal-int +pkg syscall (linux-amd64-cgo), const RTN_MULTICAST ideal-int +pkg syscall (linux-amd64-cgo), const RTN_NAT ideal-int +pkg syscall (linux-amd64-cgo), const RTN_PROHIBIT ideal-int +pkg syscall (linux-amd64-cgo), const RTN_THROW ideal-int +pkg syscall (linux-amd64-cgo), const RTN_UNICAST ideal-int +pkg syscall (linux-amd64-cgo), const RTN_UNREACHABLE ideal-int +pkg syscall (linux-amd64-cgo), const RTN_UNSPEC ideal-int +pkg syscall (linux-amd64-cgo), const RTN_XRESOLVE ideal-int +pkg syscall (linux-amd64-cgo), const RTPROT_BIRD ideal-int +pkg syscall (linux-amd64-cgo), const RTPROT_BOOT ideal-int +pkg syscall (linux-amd64-cgo), const RTPROT_DHCP ideal-int +pkg syscall (linux-amd64-cgo), const RTPROT_DNROUTED ideal-int +pkg syscall (linux-amd64-cgo), const RTPROT_GATED ideal-int +pkg syscall (linux-amd64-cgo), const RTPROT_KERNEL ideal-int +pkg syscall (linux-amd64-cgo), const RTPROT_MRT ideal-int +pkg syscall (linux-amd64-cgo), const RTPROT_NTK ideal-int +pkg syscall (linux-amd64-cgo), const RTPROT_RA ideal-int +pkg syscall (linux-amd64-cgo), const RTPROT_REDIRECT ideal-int +pkg syscall (linux-amd64-cgo), const RTPROT_STATIC ideal-int +pkg syscall (linux-amd64-cgo), const RTPROT_UNSPEC ideal-int +pkg syscall (linux-amd64-cgo), const RTPROT_XORP ideal-int +pkg syscall (linux-amd64-cgo), const RTPROT_ZEBRA ideal-int +pkg syscall (linux-amd64-cgo), const RT_CLASS_DEFAULT ideal-int +pkg syscall (linux-amd64-cgo), const RT_CLASS_LOCAL ideal-int +pkg syscall (linux-amd64-cgo), const RT_CLASS_MAIN ideal-int +pkg syscall (linux-amd64-cgo), const RT_CLASS_MAX ideal-int +pkg syscall (linux-amd64-cgo), const RT_CLASS_UNSPEC ideal-int +pkg syscall (linux-amd64-cgo), const RT_SCOPE_HOST ideal-int +pkg syscall (linux-amd64-cgo), const RT_SCOPE_LINK ideal-int +pkg syscall (linux-amd64-cgo), const RT_SCOPE_NOWHERE ideal-int +pkg syscall (linux-amd64-cgo), const RT_SCOPE_SITE ideal-int +pkg syscall (linux-amd64-cgo), const RT_SCOPE_UNIVERSE ideal-int +pkg syscall (linux-amd64-cgo), const RT_TABLE_COMPAT ideal-int +pkg syscall (linux-amd64-cgo), const RT_TABLE_DEFAULT ideal-int +pkg syscall (linux-amd64-cgo), const RT_TABLE_LOCAL ideal-int +pkg syscall (linux-amd64-cgo), const RT_TABLE_MAIN ideal-int +pkg syscall (linux-amd64-cgo), const RT_TABLE_MAX ideal-int +pkg syscall (linux-amd64-cgo), const RT_TABLE_UNSPEC ideal-int +pkg syscall (linux-amd64-cgo), const RUSAGE_CHILDREN ideal-int +pkg syscall (linux-amd64-cgo), const RUSAGE_SELF ideal-int +pkg syscall (linux-amd64-cgo), const RUSAGE_THREAD ideal-int +pkg syscall (linux-amd64-cgo), const SCM_CREDENTIALS ideal-int +pkg syscall (linux-amd64-cgo), const SCM_RIGHTS ideal-int +pkg syscall (linux-amd64-cgo), const SCM_TIMESTAMP ideal-int +pkg syscall (linux-amd64-cgo), const SCM_TIMESTAMPING ideal-int +pkg syscall (linux-amd64-cgo), const SCM_TIMESTAMPNS ideal-int +pkg syscall (linux-amd64-cgo), const SIGCHLD Signal +pkg syscall (linux-amd64-cgo), const SIGCLD Signal +pkg syscall (linux-amd64-cgo), const SIGCONT Signal +pkg syscall (linux-amd64-cgo), const SIGIO Signal +pkg syscall (linux-amd64-cgo), const SIGIOT Signal +pkg syscall (linux-amd64-cgo), const SIGPOLL Signal +pkg syscall (linux-amd64-cgo), const SIGPROF Signal +pkg syscall (linux-amd64-cgo), const SIGPWR Signal +pkg syscall (linux-amd64-cgo), const SIGSTKFLT Signal +pkg syscall (linux-amd64-cgo), const SIGSTOP Signal +pkg syscall (linux-amd64-cgo), const SIGSYS Signal +pkg syscall (linux-amd64-cgo), const SIGTSTP Signal +pkg syscall (linux-amd64-cgo), const SIGTTIN Signal +pkg syscall (linux-amd64-cgo), const SIGTTOU Signal +pkg syscall (linux-amd64-cgo), const SIGUNUSED Signal +pkg syscall (linux-amd64-cgo), const SIGURG Signal +pkg syscall (linux-amd64-cgo), const SIGUSR1 Signal +pkg syscall (linux-amd64-cgo), const SIGUSR2 Signal +pkg syscall (linux-amd64-cgo), const SIGVTALRM Signal +pkg syscall (linux-amd64-cgo), const SIGWINCH Signal +pkg syscall (linux-amd64-cgo), const SIGXCPU Signal +pkg syscall (linux-amd64-cgo), const SIGXFSZ Signal +pkg syscall (linux-amd64-cgo), const SIOCADDDLCI ideal-int +pkg syscall (linux-amd64-cgo), const SIOCADDMULTI ideal-int +pkg syscall (linux-amd64-cgo), const SIOCADDRT ideal-int +pkg syscall (linux-amd64-cgo), const SIOCATMARK ideal-int +pkg syscall (linux-amd64-cgo), const SIOCDARP ideal-int +pkg syscall (linux-amd64-cgo), const SIOCDELDLCI ideal-int +pkg syscall (linux-amd64-cgo), const SIOCDELMULTI ideal-int +pkg syscall (linux-amd64-cgo), const SIOCDELRT ideal-int +pkg syscall (linux-amd64-cgo), const SIOCDEVPRIVATE ideal-int +pkg syscall (linux-amd64-cgo), const SIOCDIFADDR ideal-int +pkg syscall (linux-amd64-cgo), const SIOCDRARP ideal-int +pkg syscall (linux-amd64-cgo), const SIOCGARP ideal-int +pkg syscall (linux-amd64-cgo), const SIOCGIFADDR ideal-int +pkg syscall (linux-amd64-cgo), const SIOCGIFBR ideal-int +pkg syscall (linux-amd64-cgo), const SIOCGIFBRDADDR ideal-int +pkg syscall (linux-amd64-cgo), const SIOCGIFCONF ideal-int +pkg syscall (linux-amd64-cgo), const SIOCGIFCOUNT ideal-int +pkg syscall (linux-amd64-cgo), const SIOCGIFDSTADDR ideal-int +pkg syscall (linux-amd64-cgo), const SIOCGIFENCAP ideal-int +pkg syscall (linux-amd64-cgo), const SIOCGIFFLAGS ideal-int +pkg syscall (linux-amd64-cgo), const SIOCGIFHWADDR ideal-int +pkg syscall (linux-amd64-cgo), const SIOCGIFINDEX ideal-int +pkg syscall (linux-amd64-cgo), const SIOCGIFMAP ideal-int +pkg syscall (linux-amd64-cgo), const SIOCGIFMEM ideal-int +pkg syscall (linux-amd64-cgo), const SIOCGIFMETRIC ideal-int +pkg syscall (linux-amd64-cgo), const SIOCGIFMTU ideal-int +pkg syscall (linux-amd64-cgo), const SIOCGIFNAME ideal-int +pkg syscall (linux-amd64-cgo), const SIOCGIFNETMASK ideal-int +pkg syscall (linux-amd64-cgo), const SIOCGIFPFLAGS ideal-int +pkg syscall (linux-amd64-cgo), const SIOCGIFSLAVE ideal-int +pkg syscall (linux-amd64-cgo), const SIOCGIFTXQLEN ideal-int +pkg syscall (linux-amd64-cgo), const SIOCGPGRP ideal-int +pkg syscall (linux-amd64-cgo), const SIOCGRARP ideal-int +pkg syscall (linux-amd64-cgo), const SIOCGSTAMP ideal-int +pkg syscall (linux-amd64-cgo), const SIOCGSTAMPNS ideal-int +pkg syscall (linux-amd64-cgo), const SIOCPROTOPRIVATE ideal-int +pkg syscall (linux-amd64-cgo), const SIOCRTMSG ideal-int +pkg syscall (linux-amd64-cgo), const SIOCSARP ideal-int +pkg syscall (linux-amd64-cgo), const SIOCSIFADDR ideal-int +pkg syscall (linux-amd64-cgo), const SIOCSIFBR ideal-int +pkg syscall (linux-amd64-cgo), const SIOCSIFBRDADDR ideal-int +pkg syscall (linux-amd64-cgo), const SIOCSIFDSTADDR ideal-int +pkg syscall (linux-amd64-cgo), const SIOCSIFENCAP ideal-int +pkg syscall (linux-amd64-cgo), const SIOCSIFFLAGS ideal-int +pkg syscall (linux-amd64-cgo), const SIOCSIFHWADDR ideal-int +pkg syscall (linux-amd64-cgo), const SIOCSIFHWBROADCAST ideal-int +pkg syscall (linux-amd64-cgo), const SIOCSIFLINK ideal-int +pkg syscall (linux-amd64-cgo), const SIOCSIFMAP ideal-int +pkg syscall (linux-amd64-cgo), const SIOCSIFMEM ideal-int +pkg syscall (linux-amd64-cgo), const SIOCSIFMETRIC ideal-int +pkg syscall (linux-amd64-cgo), const SIOCSIFMTU ideal-int +pkg syscall (linux-amd64-cgo), const SIOCSIFNAME ideal-int +pkg syscall (linux-amd64-cgo), const SIOCSIFNETMASK ideal-int +pkg syscall (linux-amd64-cgo), const SIOCSIFPFLAGS ideal-int +pkg syscall (linux-amd64-cgo), const SIOCSIFSLAVE ideal-int +pkg syscall (linux-amd64-cgo), const SIOCSIFTXQLEN ideal-int +pkg syscall (linux-amd64-cgo), const SIOCSPGRP ideal-int +pkg syscall (linux-amd64-cgo), const SIOCSRARP ideal-int +pkg syscall (linux-amd64-cgo), const SOCK_CLOEXEC ideal-int +pkg syscall (linux-amd64-cgo), const SOCK_DCCP ideal-int +pkg syscall (linux-amd64-cgo), const SOCK_NONBLOCK ideal-int +pkg syscall (linux-amd64-cgo), const SOCK_PACKET ideal-int +pkg syscall (linux-amd64-cgo), const SOCK_RDM ideal-int +pkg syscall (linux-amd64-cgo), const SOL_AAL ideal-int +pkg syscall (linux-amd64-cgo), const SOL_ATM ideal-int +pkg syscall (linux-amd64-cgo), const SOL_DECNET ideal-int +pkg syscall (linux-amd64-cgo), const SOL_ICMPV6 ideal-int +pkg syscall (linux-amd64-cgo), const SOL_IP ideal-int +pkg syscall (linux-amd64-cgo), const SOL_IPV6 ideal-int +pkg syscall (linux-amd64-cgo), const SOL_IRDA ideal-int +pkg syscall (linux-amd64-cgo), const SOL_PACKET ideal-int +pkg syscall (linux-amd64-cgo), const SOL_RAW ideal-int +pkg syscall (linux-amd64-cgo), const SOL_TCP ideal-int +pkg syscall (linux-amd64-cgo), const SOL_X25 ideal-int +pkg syscall (linux-amd64-cgo), const SO_ACCEPTCONN ideal-int +pkg syscall (linux-amd64-cgo), const SO_ATTACH_FILTER ideal-int +pkg syscall (linux-amd64-cgo), const SO_BINDTODEVICE ideal-int +pkg syscall (linux-amd64-cgo), const SO_BSDCOMPAT ideal-int +pkg syscall (linux-amd64-cgo), const SO_DEBUG ideal-int +pkg syscall (linux-amd64-cgo), const SO_DETACH_FILTER ideal-int +pkg syscall (linux-amd64-cgo), const SO_DOMAIN ideal-int +pkg syscall (linux-amd64-cgo), const SO_ERROR ideal-int +pkg syscall (linux-amd64-cgo), const SO_MARK ideal-int +pkg syscall (linux-amd64-cgo), const SO_NO_CHECK ideal-int +pkg syscall (linux-amd64-cgo), const SO_OOBINLINE ideal-int +pkg syscall (linux-amd64-cgo), const SO_PASSCRED ideal-int +pkg syscall (linux-amd64-cgo), const SO_PASSSEC ideal-int +pkg syscall (linux-amd64-cgo), const SO_PEERCRED ideal-int +pkg syscall (linux-amd64-cgo), const SO_PEERNAME ideal-int +pkg syscall (linux-amd64-cgo), const SO_PEERSEC ideal-int +pkg syscall (linux-amd64-cgo), const SO_PRIORITY ideal-int +pkg syscall (linux-amd64-cgo), const SO_PROTOCOL ideal-int +pkg syscall (linux-amd64-cgo), const SO_RCVBUFFORCE ideal-int +pkg syscall (linux-amd64-cgo), const SO_RCVLOWAT ideal-int +pkg syscall (linux-amd64-cgo), const SO_RCVTIMEO ideal-int +pkg syscall (linux-amd64-cgo), const SO_RXQ_OVFL ideal-int +pkg syscall (linux-amd64-cgo), const SO_SECURITY_AUTHENTICATION ideal-int +pkg syscall (linux-amd64-cgo), const SO_SECURITY_ENCRYPTION_NETWORK ideal-int +pkg syscall (linux-amd64-cgo), const SO_SECURITY_ENCRYPTION_TRANSPORT ideal-int +pkg syscall (linux-amd64-cgo), const SO_SNDBUFFORCE ideal-int +pkg syscall (linux-amd64-cgo), const SO_SNDLOWAT ideal-int +pkg syscall (linux-amd64-cgo), const SO_SNDTIMEO ideal-int +pkg syscall (linux-amd64-cgo), const SO_TIMESTAMP ideal-int +pkg syscall (linux-amd64-cgo), const SO_TIMESTAMPING ideal-int +pkg syscall (linux-amd64-cgo), const SO_TIMESTAMPNS ideal-int +pkg syscall (linux-amd64-cgo), const SO_TYPE ideal-int +pkg syscall (linux-amd64-cgo), const SYS_ACCEPT ideal-int +pkg syscall (linux-amd64-cgo), const SYS_ACCEPT4 ideal-int +pkg syscall (linux-amd64-cgo), const SYS_ACCESS ideal-int +pkg syscall (linux-amd64-cgo), const SYS_ACCT ideal-int +pkg syscall (linux-amd64-cgo), const SYS_ADD_KEY ideal-int +pkg syscall (linux-amd64-cgo), const SYS_ADJTIMEX ideal-int +pkg syscall (linux-amd64-cgo), const SYS_AFS_SYSCALL ideal-int +pkg syscall (linux-amd64-cgo), const SYS_ALARM ideal-int +pkg syscall (linux-amd64-cgo), const SYS_ARCH_PRCTL ideal-int +pkg syscall (linux-amd64-cgo), const SYS_BIND ideal-int +pkg syscall (linux-amd64-cgo), const SYS_BRK ideal-int +pkg syscall (linux-amd64-cgo), const SYS_CAPGET ideal-int +pkg syscall (linux-amd64-cgo), const SYS_CAPSET ideal-int +pkg syscall (linux-amd64-cgo), const SYS_CHDIR ideal-int +pkg syscall (linux-amd64-cgo), const SYS_CHMOD ideal-int +pkg syscall (linux-amd64-cgo), const SYS_CHOWN ideal-int +pkg syscall (linux-amd64-cgo), const SYS_CHROOT ideal-int +pkg syscall (linux-amd64-cgo), const SYS_CLOCK_GETRES ideal-int +pkg syscall (linux-amd64-cgo), const SYS_CLOCK_GETTIME ideal-int +pkg syscall (linux-amd64-cgo), const SYS_CLOCK_NANOSLEEP ideal-int +pkg syscall (linux-amd64-cgo), const SYS_CLOCK_SETTIME ideal-int +pkg syscall (linux-amd64-cgo), const SYS_CLONE ideal-int +pkg syscall (linux-amd64-cgo), const SYS_CLOSE ideal-int +pkg syscall (linux-amd64-cgo), const SYS_CONNECT ideal-int +pkg syscall (linux-amd64-cgo), const SYS_CREAT ideal-int +pkg syscall (linux-amd64-cgo), const SYS_CREATE_MODULE ideal-int +pkg syscall (linux-amd64-cgo), const SYS_DELETE_MODULE ideal-int +pkg syscall (linux-amd64-cgo), const SYS_DUP ideal-int +pkg syscall (linux-amd64-cgo), const SYS_DUP2 ideal-int +pkg syscall (linux-amd64-cgo), const SYS_DUP3 ideal-int +pkg syscall (linux-amd64-cgo), const SYS_EPOLL_CREATE ideal-int +pkg syscall (linux-amd64-cgo), const SYS_EPOLL_CREATE1 ideal-int +pkg syscall (linux-amd64-cgo), const SYS_EPOLL_CTL ideal-int +pkg syscall (linux-amd64-cgo), const SYS_EPOLL_CTL_OLD ideal-int +pkg syscall (linux-amd64-cgo), const SYS_EPOLL_PWAIT ideal-int +pkg syscall (linux-amd64-cgo), const SYS_EPOLL_WAIT ideal-int +pkg syscall (linux-amd64-cgo), const SYS_EPOLL_WAIT_OLD ideal-int +pkg syscall (linux-amd64-cgo), const SYS_EVENTFD ideal-int +pkg syscall (linux-amd64-cgo), const SYS_EVENTFD2 ideal-int +pkg syscall (linux-amd64-cgo), const SYS_EXECVE ideal-int +pkg syscall (linux-amd64-cgo), const SYS_EXIT ideal-int +pkg syscall (linux-amd64-cgo), const SYS_EXIT_GROUP ideal-int +pkg syscall (linux-amd64-cgo), const SYS_FACCESSAT ideal-int +pkg syscall (linux-amd64-cgo), const SYS_FADVISE64 ideal-int +pkg syscall (linux-amd64-cgo), const SYS_FALLOCATE ideal-int +pkg syscall (linux-amd64-cgo), const SYS_FANOTIFY_INIT ideal-int +pkg syscall (linux-amd64-cgo), const SYS_FANOTIFY_MARK ideal-int +pkg syscall (linux-amd64-cgo), const SYS_FCHDIR ideal-int +pkg syscall (linux-amd64-cgo), const SYS_FCHMOD ideal-int +pkg syscall (linux-amd64-cgo), const SYS_FCHMODAT ideal-int +pkg syscall (linux-amd64-cgo), const SYS_FCHOWN ideal-int +pkg syscall (linux-amd64-cgo), const SYS_FCHOWNAT ideal-int +pkg syscall (linux-amd64-cgo), const SYS_FCNTL ideal-int +pkg syscall (linux-amd64-cgo), const SYS_FDATASYNC ideal-int +pkg syscall (linux-amd64-cgo), const SYS_FGETXATTR ideal-int +pkg syscall (linux-amd64-cgo), const SYS_FLISTXATTR ideal-int +pkg syscall (linux-amd64-cgo), const SYS_FLOCK ideal-int +pkg syscall (linux-amd64-cgo), const SYS_FORK ideal-int +pkg syscall (linux-amd64-cgo), const SYS_FREMOVEXATTR ideal-int +pkg syscall (linux-amd64-cgo), const SYS_FSETXATTR ideal-int +pkg syscall (linux-amd64-cgo), const SYS_FSTAT ideal-int +pkg syscall (linux-amd64-cgo), const SYS_FSTATFS ideal-int +pkg syscall (linux-amd64-cgo), const SYS_FSYNC ideal-int +pkg syscall (linux-amd64-cgo), const SYS_FTRUNCATE ideal-int +pkg syscall (linux-amd64-cgo), const SYS_FUTEX ideal-int +pkg syscall (linux-amd64-cgo), const SYS_FUTIMESAT ideal-int +pkg syscall (linux-amd64-cgo), const SYS_GETCWD ideal-int +pkg syscall (linux-amd64-cgo), const SYS_GETDENTS ideal-int +pkg syscall (linux-amd64-cgo), const SYS_GETDENTS64 ideal-int +pkg syscall (linux-amd64-cgo), const SYS_GETEGID ideal-int +pkg syscall (linux-amd64-cgo), const SYS_GETEUID ideal-int +pkg syscall (linux-amd64-cgo), const SYS_GETGID ideal-int +pkg syscall (linux-amd64-cgo), const SYS_GETGROUPS ideal-int +pkg syscall (linux-amd64-cgo), const SYS_GETITIMER ideal-int +pkg syscall (linux-amd64-cgo), const SYS_GETPEERNAME ideal-int +pkg syscall (linux-amd64-cgo), const SYS_GETPGID ideal-int +pkg syscall (linux-amd64-cgo), const SYS_GETPGRP ideal-int +pkg syscall (linux-amd64-cgo), const SYS_GETPID ideal-int +pkg syscall (linux-amd64-cgo), const SYS_GETPMSG ideal-int +pkg syscall (linux-amd64-cgo), const SYS_GETPPID ideal-int +pkg syscall (linux-amd64-cgo), const SYS_GETPRIORITY ideal-int +pkg syscall (linux-amd64-cgo), const SYS_GETRESGID ideal-int +pkg syscall (linux-amd64-cgo), const SYS_GETRESUID ideal-int +pkg syscall (linux-amd64-cgo), const SYS_GETRLIMIT ideal-int +pkg syscall (linux-amd64-cgo), const SYS_GETRUSAGE ideal-int +pkg syscall (linux-amd64-cgo), const SYS_GETSID ideal-int +pkg syscall (linux-amd64-cgo), const SYS_GETSOCKNAME ideal-int +pkg syscall (linux-amd64-cgo), const SYS_GETSOCKOPT ideal-int +pkg syscall (linux-amd64-cgo), const SYS_GETTID ideal-int +pkg syscall (linux-amd64-cgo), const SYS_GETTIMEOFDAY ideal-int +pkg syscall (linux-amd64-cgo), const SYS_GETUID ideal-int +pkg syscall (linux-amd64-cgo), const SYS_GETXATTR ideal-int +pkg syscall (linux-amd64-cgo), const SYS_GET_KERNEL_SYMS ideal-int +pkg syscall (linux-amd64-cgo), const SYS_GET_MEMPOLICY ideal-int +pkg syscall (linux-amd64-cgo), const SYS_GET_ROBUST_LIST ideal-int +pkg syscall (linux-amd64-cgo), const SYS_GET_THREAD_AREA ideal-int +pkg syscall (linux-amd64-cgo), const SYS_INIT_MODULE ideal-int +pkg syscall (linux-amd64-cgo), const SYS_INOTIFY_ADD_WATCH ideal-int +pkg syscall (linux-amd64-cgo), const SYS_INOTIFY_INIT ideal-int +pkg syscall (linux-amd64-cgo), const SYS_INOTIFY_INIT1 ideal-int +pkg syscall (linux-amd64-cgo), const SYS_INOTIFY_RM_WATCH ideal-int +pkg syscall (linux-amd64-cgo), const SYS_IOCTL ideal-int +pkg syscall (linux-amd64-cgo), const SYS_IOPERM ideal-int +pkg syscall (linux-amd64-cgo), const SYS_IOPL ideal-int +pkg syscall (linux-amd64-cgo), const SYS_IOPRIO_GET ideal-int +pkg syscall (linux-amd64-cgo), const SYS_IOPRIO_SET ideal-int +pkg syscall (linux-amd64-cgo), const SYS_IO_CANCEL ideal-int +pkg syscall (linux-amd64-cgo), const SYS_IO_DESTROY ideal-int +pkg syscall (linux-amd64-cgo), const SYS_IO_GETEVENTS ideal-int +pkg syscall (linux-amd64-cgo), const SYS_IO_SETUP ideal-int +pkg syscall (linux-amd64-cgo), const SYS_IO_SUBMIT ideal-int +pkg syscall (linux-amd64-cgo), const SYS_KEXEC_LOAD ideal-int +pkg syscall (linux-amd64-cgo), const SYS_KEYCTL ideal-int +pkg syscall (linux-amd64-cgo), const SYS_KILL ideal-int +pkg syscall (linux-amd64-cgo), const SYS_LCHOWN ideal-int +pkg syscall (linux-amd64-cgo), const SYS_LGETXATTR ideal-int +pkg syscall (linux-amd64-cgo), const SYS_LINK ideal-int +pkg syscall (linux-amd64-cgo), const SYS_LINKAT ideal-int +pkg syscall (linux-amd64-cgo), const SYS_LISTEN ideal-int +pkg syscall (linux-amd64-cgo), const SYS_LISTXATTR ideal-int +pkg syscall (linux-amd64-cgo), const SYS_LLISTXATTR ideal-int +pkg syscall (linux-amd64-cgo), const SYS_LOOKUP_DCOOKIE ideal-int +pkg syscall (linux-amd64-cgo), const SYS_LREMOVEXATTR ideal-int +pkg syscall (linux-amd64-cgo), const SYS_LSEEK ideal-int +pkg syscall (linux-amd64-cgo), const SYS_LSETXATTR ideal-int +pkg syscall (linux-amd64-cgo), const SYS_LSTAT ideal-int +pkg syscall (linux-amd64-cgo), const SYS_MADVISE ideal-int +pkg syscall (linux-amd64-cgo), const SYS_MBIND ideal-int +pkg syscall (linux-amd64-cgo), const SYS_MIGRATE_PAGES ideal-int +pkg syscall (linux-amd64-cgo), const SYS_MINCORE ideal-int +pkg syscall (linux-amd64-cgo), const SYS_MKDIR ideal-int +pkg syscall (linux-amd64-cgo), const SYS_MKDIRAT ideal-int +pkg syscall (linux-amd64-cgo), const SYS_MKNOD ideal-int +pkg syscall (linux-amd64-cgo), const SYS_MKNODAT ideal-int +pkg syscall (linux-amd64-cgo), const SYS_MLOCK ideal-int +pkg syscall (linux-amd64-cgo), const SYS_MLOCKALL ideal-int +pkg syscall (linux-amd64-cgo), const SYS_MMAP ideal-int +pkg syscall (linux-amd64-cgo), const SYS_MODIFY_LDT ideal-int +pkg syscall (linux-amd64-cgo), const SYS_MOUNT ideal-int +pkg syscall (linux-amd64-cgo), const SYS_MOVE_PAGES ideal-int +pkg syscall (linux-amd64-cgo), const SYS_MPROTECT ideal-int +pkg syscall (linux-amd64-cgo), const SYS_MQ_GETSETATTR ideal-int +pkg syscall (linux-amd64-cgo), const SYS_MQ_NOTIFY ideal-int +pkg syscall (linux-amd64-cgo), const SYS_MQ_OPEN ideal-int +pkg syscall (linux-amd64-cgo), const SYS_MQ_TIMEDRECEIVE ideal-int +pkg syscall (linux-amd64-cgo), const SYS_MQ_TIMEDSEND ideal-int +pkg syscall (linux-amd64-cgo), const SYS_MQ_UNLINK ideal-int +pkg syscall (linux-amd64-cgo), const SYS_MREMAP ideal-int +pkg syscall (linux-amd64-cgo), const SYS_MSGCTL ideal-int +pkg syscall (linux-amd64-cgo), const SYS_MSGGET ideal-int +pkg syscall (linux-amd64-cgo), const SYS_MSGRCV ideal-int +pkg syscall (linux-amd64-cgo), const SYS_MSGSND ideal-int +pkg syscall (linux-amd64-cgo), const SYS_MSYNC ideal-int +pkg syscall (linux-amd64-cgo), const SYS_MUNLOCK ideal-int +pkg syscall (linux-amd64-cgo), const SYS_MUNLOCKALL ideal-int +pkg syscall (linux-amd64-cgo), const SYS_MUNMAP ideal-int +pkg syscall (linux-amd64-cgo), const SYS_NANOSLEEP ideal-int +pkg syscall (linux-amd64-cgo), const SYS_NEWFSTATAT ideal-int +pkg syscall (linux-amd64-cgo), const SYS_NFSSERVCTL ideal-int +pkg syscall (linux-amd64-cgo), const SYS_OPEN ideal-int +pkg syscall (linux-amd64-cgo), const SYS_OPENAT ideal-int +pkg syscall (linux-amd64-cgo), const SYS_PAUSE ideal-int +pkg syscall (linux-amd64-cgo), const SYS_PERF_EVENT_OPEN ideal-int +pkg syscall (linux-amd64-cgo), const SYS_PERSONALITY ideal-int +pkg syscall (linux-amd64-cgo), const SYS_PIPE ideal-int +pkg syscall (linux-amd64-cgo), const SYS_PIPE2 ideal-int +pkg syscall (linux-amd64-cgo), const SYS_PIVOT_ROOT ideal-int +pkg syscall (linux-amd64-cgo), const SYS_POLL ideal-int +pkg syscall (linux-amd64-cgo), const SYS_PPOLL ideal-int +pkg syscall (linux-amd64-cgo), const SYS_PRCTL ideal-int +pkg syscall (linux-amd64-cgo), const SYS_PREAD64 ideal-int +pkg syscall (linux-amd64-cgo), const SYS_PREADV ideal-int +pkg syscall (linux-amd64-cgo), const SYS_PRLIMIT64 ideal-int +pkg syscall (linux-amd64-cgo), const SYS_PSELECT6 ideal-int +pkg syscall (linux-amd64-cgo), const SYS_PTRACE ideal-int +pkg syscall (linux-amd64-cgo), const SYS_PUTPMSG ideal-int +pkg syscall (linux-amd64-cgo), const SYS_PWRITE64 ideal-int +pkg syscall (linux-amd64-cgo), const SYS_PWRITEV ideal-int +pkg syscall (linux-amd64-cgo), const SYS_QUERY_MODULE ideal-int +pkg syscall (linux-amd64-cgo), const SYS_QUOTACTL ideal-int +pkg syscall (linux-amd64-cgo), const SYS_READ ideal-int +pkg syscall (linux-amd64-cgo), const SYS_READAHEAD ideal-int +pkg syscall (linux-amd64-cgo), const SYS_READLINK ideal-int +pkg syscall (linux-amd64-cgo), const SYS_READLINKAT ideal-int +pkg syscall (linux-amd64-cgo), const SYS_READV ideal-int +pkg syscall (linux-amd64-cgo), const SYS_REBOOT ideal-int +pkg syscall (linux-amd64-cgo), const SYS_RECVFROM ideal-int +pkg syscall (linux-amd64-cgo), const SYS_RECVMMSG ideal-int +pkg syscall (linux-amd64-cgo), const SYS_RECVMSG ideal-int +pkg syscall (linux-amd64-cgo), const SYS_REMAP_FILE_PAGES ideal-int +pkg syscall (linux-amd64-cgo), const SYS_REMOVEXATTR ideal-int +pkg syscall (linux-amd64-cgo), const SYS_RENAME ideal-int +pkg syscall (linux-amd64-cgo), const SYS_RENAMEAT ideal-int +pkg syscall (linux-amd64-cgo), const SYS_REQUEST_KEY ideal-int +pkg syscall (linux-amd64-cgo), const SYS_RESTART_SYSCALL ideal-int +pkg syscall (linux-amd64-cgo), const SYS_RMDIR ideal-int +pkg syscall (linux-amd64-cgo), const SYS_RT_SIGACTION ideal-int +pkg syscall (linux-amd64-cgo), const SYS_RT_SIGPENDING ideal-int +pkg syscall (linux-amd64-cgo), const SYS_RT_SIGPROCMASK ideal-int +pkg syscall (linux-amd64-cgo), const SYS_RT_SIGQUEUEINFO ideal-int +pkg syscall (linux-amd64-cgo), const SYS_RT_SIGRETURN ideal-int +pkg syscall (linux-amd64-cgo), const SYS_RT_SIGSUSPEND ideal-int +pkg syscall (linux-amd64-cgo), const SYS_RT_SIGTIMEDWAIT ideal-int +pkg syscall (linux-amd64-cgo), const SYS_RT_TGSIGQUEUEINFO ideal-int +pkg syscall (linux-amd64-cgo), const SYS_SCHED_GETAFFINITY ideal-int +pkg syscall (linux-amd64-cgo), const SYS_SCHED_GETPARAM ideal-int +pkg syscall (linux-amd64-cgo), const SYS_SCHED_GETSCHEDULER ideal-int +pkg syscall (linux-amd64-cgo), const SYS_SCHED_GET_PRIORITY_MAX ideal-int +pkg syscall (linux-amd64-cgo), const SYS_SCHED_GET_PRIORITY_MIN ideal-int +pkg syscall (linux-amd64-cgo), const SYS_SCHED_RR_GET_INTERVAL ideal-int +pkg syscall (linux-amd64-cgo), const SYS_SCHED_SETAFFINITY ideal-int +pkg syscall (linux-amd64-cgo), const SYS_SCHED_SETPARAM ideal-int +pkg syscall (linux-amd64-cgo), const SYS_SCHED_SETSCHEDULER ideal-int +pkg syscall (linux-amd64-cgo), const SYS_SCHED_YIELD ideal-int +pkg syscall (linux-amd64-cgo), const SYS_SECURITY ideal-int +pkg syscall (linux-amd64-cgo), const SYS_SELECT ideal-int +pkg syscall (linux-amd64-cgo), const SYS_SEMCTL ideal-int +pkg syscall (linux-amd64-cgo), const SYS_SEMGET ideal-int +pkg syscall (linux-amd64-cgo), const SYS_SEMOP ideal-int +pkg syscall (linux-amd64-cgo), const SYS_SEMTIMEDOP ideal-int +pkg syscall (linux-amd64-cgo), const SYS_SENDFILE ideal-int +pkg syscall (linux-amd64-cgo), const SYS_SENDMSG ideal-int +pkg syscall (linux-amd64-cgo), const SYS_SENDTO ideal-int +pkg syscall (linux-amd64-cgo), const SYS_SETDOMAINNAME ideal-int +pkg syscall (linux-amd64-cgo), const SYS_SETFSGID ideal-int +pkg syscall (linux-amd64-cgo), const SYS_SETFSUID ideal-int +pkg syscall (linux-amd64-cgo), const SYS_SETGID ideal-int +pkg syscall (linux-amd64-cgo), const SYS_SETGROUPS ideal-int +pkg syscall (linux-amd64-cgo), const SYS_SETHOSTNAME ideal-int +pkg syscall (linux-amd64-cgo), const SYS_SETITIMER ideal-int +pkg syscall (linux-amd64-cgo), const SYS_SETPGID ideal-int +pkg syscall (linux-amd64-cgo), const SYS_SETPRIORITY ideal-int +pkg syscall (linux-amd64-cgo), const SYS_SETREGID ideal-int +pkg syscall (linux-amd64-cgo), const SYS_SETRESGID ideal-int +pkg syscall (linux-amd64-cgo), const SYS_SETRESUID ideal-int +pkg syscall (linux-amd64-cgo), const SYS_SETREUID ideal-int +pkg syscall (linux-amd64-cgo), const SYS_SETRLIMIT ideal-int +pkg syscall (linux-amd64-cgo), const SYS_SETSID ideal-int +pkg syscall (linux-amd64-cgo), const SYS_SETSOCKOPT ideal-int +pkg syscall (linux-amd64-cgo), const SYS_SETTIMEOFDAY ideal-int +pkg syscall (linux-amd64-cgo), const SYS_SETUID ideal-int +pkg syscall (linux-amd64-cgo), const SYS_SETXATTR ideal-int +pkg syscall (linux-amd64-cgo), const SYS_SET_MEMPOLICY ideal-int +pkg syscall (linux-amd64-cgo), const SYS_SET_ROBUST_LIST ideal-int +pkg syscall (linux-amd64-cgo), const SYS_SET_THREAD_AREA ideal-int +pkg syscall (linux-amd64-cgo), const SYS_SET_TID_ADDRESS ideal-int +pkg syscall (linux-amd64-cgo), const SYS_SHMAT ideal-int +pkg syscall (linux-amd64-cgo), const SYS_SHMCTL ideal-int +pkg syscall (linux-amd64-cgo), const SYS_SHMDT ideal-int +pkg syscall (linux-amd64-cgo), const SYS_SHMGET ideal-int +pkg syscall (linux-amd64-cgo), const SYS_SHUTDOWN ideal-int +pkg syscall (linux-amd64-cgo), const SYS_SIGALTSTACK ideal-int +pkg syscall (linux-amd64-cgo), const SYS_SIGNALFD ideal-int +pkg syscall (linux-amd64-cgo), const SYS_SIGNALFD4 ideal-int +pkg syscall (linux-amd64-cgo), const SYS_SOCKET ideal-int +pkg syscall (linux-amd64-cgo), const SYS_SOCKETPAIR ideal-int +pkg syscall (linux-amd64-cgo), const SYS_SPLICE ideal-int +pkg syscall (linux-amd64-cgo), const SYS_STAT ideal-int +pkg syscall (linux-amd64-cgo), const SYS_STATFS ideal-int +pkg syscall (linux-amd64-cgo), const SYS_SWAPOFF ideal-int +pkg syscall (linux-amd64-cgo), const SYS_SWAPON ideal-int +pkg syscall (linux-amd64-cgo), const SYS_SYMLINK ideal-int +pkg syscall (linux-amd64-cgo), const SYS_SYMLINKAT ideal-int +pkg syscall (linux-amd64-cgo), const SYS_SYNC ideal-int +pkg syscall (linux-amd64-cgo), const SYS_SYNC_FILE_RANGE ideal-int +pkg syscall (linux-amd64-cgo), const SYS_SYSFS ideal-int +pkg syscall (linux-amd64-cgo), const SYS_SYSINFO ideal-int +pkg syscall (linux-amd64-cgo), const SYS_SYSLOG ideal-int +pkg syscall (linux-amd64-cgo), const SYS_TEE ideal-int +pkg syscall (linux-amd64-cgo), const SYS_TGKILL ideal-int +pkg syscall (linux-amd64-cgo), const SYS_TIME ideal-int +pkg syscall (linux-amd64-cgo), const SYS_TIMERFD_CREATE ideal-int +pkg syscall (linux-amd64-cgo), const SYS_TIMERFD_GETTIME ideal-int +pkg syscall (linux-amd64-cgo), const SYS_TIMERFD_SETTIME ideal-int +pkg syscall (linux-amd64-cgo), const SYS_TIMER_CREATE ideal-int +pkg syscall (linux-amd64-cgo), const SYS_TIMER_DELETE ideal-int +pkg syscall (linux-amd64-cgo), const SYS_TIMER_GETOVERRUN ideal-int +pkg syscall (linux-amd64-cgo), const SYS_TIMER_GETTIME ideal-int +pkg syscall (linux-amd64-cgo), const SYS_TIMER_SETTIME ideal-int +pkg syscall (linux-amd64-cgo), const SYS_TIMES ideal-int +pkg syscall (linux-amd64-cgo), const SYS_TKILL ideal-int +pkg syscall (linux-amd64-cgo), const SYS_TRUNCATE ideal-int +pkg syscall (linux-amd64-cgo), const SYS_TUXCALL ideal-int +pkg syscall (linux-amd64-cgo), const SYS_UMASK ideal-int +pkg syscall (linux-amd64-cgo), const SYS_UMOUNT2 ideal-int +pkg syscall (linux-amd64-cgo), const SYS_UNAME ideal-int +pkg syscall (linux-amd64-cgo), const SYS_UNLINK ideal-int +pkg syscall (linux-amd64-cgo), const SYS_UNLINKAT ideal-int +pkg syscall (linux-amd64-cgo), const SYS_UNSHARE ideal-int +pkg syscall (linux-amd64-cgo), const SYS_USELIB ideal-int +pkg syscall (linux-amd64-cgo), const SYS_USTAT ideal-int +pkg syscall (linux-amd64-cgo), const SYS_UTIME ideal-int +pkg syscall (linux-amd64-cgo), const SYS_UTIMENSAT ideal-int +pkg syscall (linux-amd64-cgo), const SYS_UTIMES ideal-int +pkg syscall (linux-amd64-cgo), const SYS_VFORK ideal-int +pkg syscall (linux-amd64-cgo), const SYS_VHANGUP ideal-int +pkg syscall (linux-amd64-cgo), const SYS_VMSPLICE ideal-int +pkg syscall (linux-amd64-cgo), const SYS_VSERVER ideal-int +pkg syscall (linux-amd64-cgo), const SYS_WAIT4 ideal-int +pkg syscall (linux-amd64-cgo), const SYS_WAITID ideal-int +pkg syscall (linux-amd64-cgo), const SYS_WRITE ideal-int +pkg syscall (linux-amd64-cgo), const SYS_WRITEV ideal-int +pkg syscall (linux-amd64-cgo), const SYS__SYSCTL ideal-int +pkg syscall (linux-amd64-cgo), const S_BLKSIZE ideal-int +pkg syscall (linux-amd64-cgo), const S_IEXEC ideal-int +pkg syscall (linux-amd64-cgo), const S_IREAD ideal-int +pkg syscall (linux-amd64-cgo), const S_IRGRP ideal-int +pkg syscall (linux-amd64-cgo), const S_IROTH ideal-int +pkg syscall (linux-amd64-cgo), const S_IRWXG ideal-int +pkg syscall (linux-amd64-cgo), const S_IRWXO ideal-int +pkg syscall (linux-amd64-cgo), const S_IRWXU ideal-int +pkg syscall (linux-amd64-cgo), const S_IWGRP ideal-int +pkg syscall (linux-amd64-cgo), const S_IWOTH ideal-int +pkg syscall (linux-amd64-cgo), const S_IWRITE ideal-int +pkg syscall (linux-amd64-cgo), const S_IXGRP ideal-int +pkg syscall (linux-amd64-cgo), const S_IXOTH ideal-int +pkg syscall (linux-amd64-cgo), const SizeofCmsghdr ideal-int +pkg syscall (linux-amd64-cgo), const SizeofIPMreq ideal-int +pkg syscall (linux-amd64-cgo), const SizeofIPMreqn ideal-int +pkg syscall (linux-amd64-cgo), const SizeofIPv6Mreq ideal-int +pkg syscall (linux-amd64-cgo), const SizeofIfAddrmsg ideal-int +pkg syscall (linux-amd64-cgo), const SizeofIfInfomsg ideal-int +pkg syscall (linux-amd64-cgo), const SizeofInet4Pktinfo ideal-int +pkg syscall (linux-amd64-cgo), const SizeofInet6Pktinfo ideal-int +pkg syscall (linux-amd64-cgo), const SizeofInotifyEvent ideal-int +pkg syscall (linux-amd64-cgo), const SizeofLinger ideal-int +pkg syscall (linux-amd64-cgo), const SizeofMsghdr ideal-int +pkg syscall (linux-amd64-cgo), const SizeofNlAttr ideal-int +pkg syscall (linux-amd64-cgo), const SizeofNlMsgerr ideal-int +pkg syscall (linux-amd64-cgo), const SizeofNlMsghdr ideal-int +pkg syscall (linux-amd64-cgo), const SizeofRtAttr ideal-int +pkg syscall (linux-amd64-cgo), const SizeofRtGenmsg ideal-int +pkg syscall (linux-amd64-cgo), const SizeofRtMsg ideal-int +pkg syscall (linux-amd64-cgo), const SizeofRtNexthop ideal-int +pkg syscall (linux-amd64-cgo), const SizeofSockFilter ideal-int +pkg syscall (linux-amd64-cgo), const SizeofSockFprog ideal-int +pkg syscall (linux-amd64-cgo), const SizeofSockaddrAny ideal-int +pkg syscall (linux-amd64-cgo), const SizeofSockaddrInet4 ideal-int +pkg syscall (linux-amd64-cgo), const SizeofSockaddrInet6 ideal-int +pkg syscall (linux-amd64-cgo), const SizeofSockaddrLinklayer ideal-int +pkg syscall (linux-amd64-cgo), const SizeofSockaddrNetlink ideal-int +pkg syscall (linux-amd64-cgo), const SizeofSockaddrUnix ideal-int +pkg syscall (linux-amd64-cgo), const SizeofUcred ideal-int +pkg syscall (linux-amd64-cgo), const TCGETS ideal-int +pkg syscall (linux-amd64-cgo), const TCP_CONGESTION ideal-int +pkg syscall (linux-amd64-cgo), const TCP_CORK ideal-int +pkg syscall (linux-amd64-cgo), const TCP_DEFER_ACCEPT ideal-int +pkg syscall (linux-amd64-cgo), const TCP_INFO ideal-int +pkg syscall (linux-amd64-cgo), const TCP_KEEPCNT ideal-int +pkg syscall (linux-amd64-cgo), const TCP_KEEPIDLE ideal-int +pkg syscall (linux-amd64-cgo), const TCP_KEEPINTVL ideal-int +pkg syscall (linux-amd64-cgo), const TCP_LINGER2 ideal-int +pkg syscall (linux-amd64-cgo), const TCP_MAXSEG ideal-int +pkg syscall (linux-amd64-cgo), const TCP_MAXWIN ideal-int +pkg syscall (linux-amd64-cgo), const TCP_MAX_WINSHIFT ideal-int +pkg syscall (linux-amd64-cgo), const TCP_MD5SIG ideal-int +pkg syscall (linux-amd64-cgo), const TCP_MD5SIG_MAXKEYLEN ideal-int +pkg syscall (linux-amd64-cgo), const TCP_MSS ideal-int +pkg syscall (linux-amd64-cgo), const TCP_QUICKACK ideal-int +pkg syscall (linux-amd64-cgo), const TCP_SYNCNT ideal-int +pkg syscall (linux-amd64-cgo), const TCP_WINDOW_CLAMP ideal-int +pkg syscall (linux-amd64-cgo), const TCSETS ideal-int +pkg syscall (linux-amd64-cgo), const TIOCCBRK ideal-int +pkg syscall (linux-amd64-cgo), const TIOCCONS ideal-int +pkg syscall (linux-amd64-cgo), const TIOCEXCL ideal-int +pkg syscall (linux-amd64-cgo), const TIOCGDEV ideal-int +pkg syscall (linux-amd64-cgo), const TIOCGETD ideal-int +pkg syscall (linux-amd64-cgo), const TIOCGICOUNT ideal-int +pkg syscall (linux-amd64-cgo), const TIOCGLCKTRMIOS ideal-int +pkg syscall (linux-amd64-cgo), const TIOCGPGRP ideal-int +pkg syscall (linux-amd64-cgo), const TIOCGPTN ideal-int +pkg syscall (linux-amd64-cgo), const TIOCGRS485 ideal-int +pkg syscall (linux-amd64-cgo), const TIOCGSERIAL ideal-int +pkg syscall (linux-amd64-cgo), const TIOCGSID ideal-int +pkg syscall (linux-amd64-cgo), const TIOCGSOFTCAR ideal-int +pkg syscall (linux-amd64-cgo), const TIOCGWINSZ ideal-int +pkg syscall (linux-amd64-cgo), const TIOCINQ ideal-int +pkg syscall (linux-amd64-cgo), const TIOCLINUX ideal-int +pkg syscall (linux-amd64-cgo), const TIOCMBIC ideal-int +pkg syscall (linux-amd64-cgo), const TIOCMBIS ideal-int +pkg syscall (linux-amd64-cgo), const TIOCMGET ideal-int +pkg syscall (linux-amd64-cgo), const TIOCMIWAIT ideal-int +pkg syscall (linux-amd64-cgo), const TIOCMSET ideal-int +pkg syscall (linux-amd64-cgo), const TIOCM_CAR ideal-int +pkg syscall (linux-amd64-cgo), const TIOCM_CD ideal-int +pkg syscall (linux-amd64-cgo), const TIOCM_CTS ideal-int +pkg syscall (linux-amd64-cgo), const TIOCM_DSR ideal-int +pkg syscall (linux-amd64-cgo), const TIOCM_DTR ideal-int +pkg syscall (linux-amd64-cgo), const TIOCM_LE ideal-int +pkg syscall (linux-amd64-cgo), const TIOCM_RI ideal-int +pkg syscall (linux-amd64-cgo), const TIOCM_RNG ideal-int +pkg syscall (linux-amd64-cgo), const TIOCM_RTS ideal-int +pkg syscall (linux-amd64-cgo), const TIOCM_SR ideal-int +pkg syscall (linux-amd64-cgo), const TIOCM_ST ideal-int +pkg syscall (linux-amd64-cgo), const TIOCNOTTY ideal-int +pkg syscall (linux-amd64-cgo), const TIOCNXCL ideal-int +pkg syscall (linux-amd64-cgo), const TIOCOUTQ ideal-int +pkg syscall (linux-amd64-cgo), const TIOCPKT ideal-int +pkg syscall (linux-amd64-cgo), const TIOCPKT_DATA ideal-int +pkg syscall (linux-amd64-cgo), const TIOCPKT_DOSTOP ideal-int +pkg syscall (linux-amd64-cgo), const TIOCPKT_FLUSHREAD ideal-int +pkg syscall (linux-amd64-cgo), const TIOCPKT_FLUSHWRITE ideal-int +pkg syscall (linux-amd64-cgo), const TIOCPKT_IOCTL ideal-int +pkg syscall (linux-amd64-cgo), const TIOCPKT_NOSTOP ideal-int +pkg syscall (linux-amd64-cgo), const TIOCPKT_START ideal-int +pkg syscall (linux-amd64-cgo), const TIOCPKT_STOP ideal-int +pkg syscall (linux-amd64-cgo), const TIOCSBRK ideal-int +pkg syscall (linux-amd64-cgo), const TIOCSCTTY ideal-int +pkg syscall (linux-amd64-cgo), const TIOCSERCONFIG ideal-int +pkg syscall (linux-amd64-cgo), const TIOCSERGETLSR ideal-int +pkg syscall (linux-amd64-cgo), const TIOCSERGETMULTI ideal-int +pkg syscall (linux-amd64-cgo), const TIOCSERGSTRUCT ideal-int +pkg syscall (linux-amd64-cgo), const TIOCSERGWILD ideal-int +pkg syscall (linux-amd64-cgo), const TIOCSERSETMULTI ideal-int +pkg syscall (linux-amd64-cgo), const TIOCSERSWILD ideal-int +pkg syscall (linux-amd64-cgo), const TIOCSER_TEMT ideal-int +pkg syscall (linux-amd64-cgo), const TIOCSETD ideal-int +pkg syscall (linux-amd64-cgo), const TIOCSIG ideal-int +pkg syscall (linux-amd64-cgo), const TIOCSLCKTRMIOS ideal-int +pkg syscall (linux-amd64-cgo), const TIOCSPGRP ideal-int +pkg syscall (linux-amd64-cgo), const TIOCSPTLCK ideal-int +pkg syscall (linux-amd64-cgo), const TIOCSRS485 ideal-int +pkg syscall (linux-amd64-cgo), const TIOCSSERIAL ideal-int +pkg syscall (linux-amd64-cgo), const TIOCSSOFTCAR ideal-int +pkg syscall (linux-amd64-cgo), const TIOCSTI ideal-int +pkg syscall (linux-amd64-cgo), const TIOCSWINSZ ideal-int +pkg syscall (linux-amd64-cgo), const TOSTOP ideal-int +pkg syscall (linux-amd64-cgo), const TUNATTACHFILTER ideal-int +pkg syscall (linux-amd64-cgo), const TUNDETACHFILTER ideal-int +pkg syscall (linux-amd64-cgo), const TUNGETFEATURES ideal-int +pkg syscall (linux-amd64-cgo), const TUNGETIFF ideal-int +pkg syscall (linux-amd64-cgo), const TUNGETSNDBUF ideal-int +pkg syscall (linux-amd64-cgo), const TUNGETVNETHDRSZ ideal-int +pkg syscall (linux-amd64-cgo), const TUNSETDEBUG ideal-int +pkg syscall (linux-amd64-cgo), const TUNSETGROUP ideal-int +pkg syscall (linux-amd64-cgo), const TUNSETIFF ideal-int +pkg syscall (linux-amd64-cgo), const TUNSETLINK ideal-int +pkg syscall (linux-amd64-cgo), const TUNSETNOCSUM ideal-int +pkg syscall (linux-amd64-cgo), const TUNSETOFFLOAD ideal-int +pkg syscall (linux-amd64-cgo), const TUNSETOWNER ideal-int +pkg syscall (linux-amd64-cgo), const TUNSETPERSIST ideal-int +pkg syscall (linux-amd64-cgo), const TUNSETSNDBUF ideal-int +pkg syscall (linux-amd64-cgo), const TUNSETTXFILTER ideal-int +pkg syscall (linux-amd64-cgo), const TUNSETVNETHDRSZ ideal-int +pkg syscall (linux-amd64-cgo), const VDISCARD ideal-int +pkg syscall (linux-amd64-cgo), const VEOF ideal-int +pkg syscall (linux-amd64-cgo), const VEOL ideal-int +pkg syscall (linux-amd64-cgo), const VEOL2 ideal-int +pkg syscall (linux-amd64-cgo), const VERASE ideal-int +pkg syscall (linux-amd64-cgo), const VINTR ideal-int +pkg syscall (linux-amd64-cgo), const VKILL ideal-int +pkg syscall (linux-amd64-cgo), const VLNEXT ideal-int +pkg syscall (linux-amd64-cgo), const VMIN ideal-int +pkg syscall (linux-amd64-cgo), const VQUIT ideal-int +pkg syscall (linux-amd64-cgo), const VREPRINT ideal-int +pkg syscall (linux-amd64-cgo), const VSTART ideal-int +pkg syscall (linux-amd64-cgo), const VSTOP ideal-int +pkg syscall (linux-amd64-cgo), const VSUSP ideal-int +pkg syscall (linux-amd64-cgo), const VSWTC ideal-int +pkg syscall (linux-amd64-cgo), const VTIME ideal-int +pkg syscall (linux-amd64-cgo), const VWERASE ideal-int +pkg syscall (linux-amd64-cgo), const WALL ideal-int +pkg syscall (linux-amd64-cgo), const WCLONE ideal-int +pkg syscall (linux-amd64-cgo), const WCONTINUED ideal-int +pkg syscall (linux-amd64-cgo), const WEXITED ideal-int +pkg syscall (linux-amd64-cgo), const WNOHANG ideal-int +pkg syscall (linux-amd64-cgo), const WNOTHREAD ideal-int +pkg syscall (linux-amd64-cgo), const WNOWAIT ideal-int +pkg syscall (linux-amd64-cgo), const WORDSIZE ideal-int +pkg syscall (linux-amd64-cgo), const WSTOPPED ideal-int +pkg syscall (linux-amd64-cgo), const WUNTRACED ideal-int +pkg syscall (linux-amd64-cgo), const XCASE ideal-int +pkg syscall (linux-amd64-cgo), func Accept(int) (int, Sockaddr, error) +pkg syscall (linux-amd64-cgo), func Access(string, uint32) error +pkg syscall (linux-amd64-cgo), func Acct(string) error +pkg syscall (linux-amd64-cgo), func Adjtimex(*Timex) (int, error) +pkg syscall (linux-amd64-cgo), func AttachLsf(int, []SockFilter) error +pkg syscall (linux-amd64-cgo), func Bind(int, Sockaddr) error +pkg syscall (linux-amd64-cgo), func BindToDevice(int, string) error +pkg syscall (linux-amd64-cgo), func Chroot(string) error +pkg syscall (linux-amd64-cgo), func Close(int) error +pkg syscall (linux-amd64-cgo), func CloseOnExec(int) +pkg syscall (linux-amd64-cgo), func CmsgLen(int) int +pkg syscall (linux-amd64-cgo), func CmsgSpace(int) int +pkg syscall (linux-amd64-cgo), func Connect(int, Sockaddr) error +pkg syscall (linux-amd64-cgo), func Creat(string, uint32) (int, error) +pkg syscall (linux-amd64-cgo), func DetachLsf(int) error +pkg syscall (linux-amd64-cgo), func Dup(int) (int, error) +pkg syscall (linux-amd64-cgo), func Dup2(int, int) error +pkg syscall (linux-amd64-cgo), func EpollCreate(int) (int, error) +pkg syscall (linux-amd64-cgo), func EpollCreate1(int) (int, error) +pkg syscall (linux-amd64-cgo), func EpollCtl(int, int, int, *EpollEvent) error +pkg syscall (linux-amd64-cgo), func EpollWait(int, []EpollEvent, int) (int, error) +pkg syscall (linux-amd64-cgo), func Faccessat(int, string, uint32, int) error +pkg syscall (linux-amd64-cgo), func Fallocate(int, uint32, int64, int64) error +pkg syscall (linux-amd64-cgo), func Fchdir(int) error +pkg syscall (linux-amd64-cgo), func Fchmod(int, uint32) error +pkg syscall (linux-amd64-cgo), func Fchmodat(int, string, uint32, int) error +pkg syscall (linux-amd64-cgo), func Fchown(int, int, int) error +pkg syscall (linux-amd64-cgo), func Fchownat(int, string, int, int, int) error +pkg syscall (linux-amd64-cgo), func Fdatasync(int) error +pkg syscall (linux-amd64-cgo), func Flock(int, int) error +pkg syscall (linux-amd64-cgo), func ForkExec(string, []string, *ProcAttr) (int, error) +pkg syscall (linux-amd64-cgo), func Fstat(int, *Stat_t) error +pkg syscall (linux-amd64-cgo), func Fstatfs(int, *Statfs_t) error +pkg syscall (linux-amd64-cgo), func Fsync(int) error +pkg syscall (linux-amd64-cgo), func Ftruncate(int, int64) error +pkg syscall (linux-amd64-cgo), func Futimes(int, []Timeval) error +pkg syscall (linux-amd64-cgo), func Futimesat(int, string, []Timeval) error +pkg syscall (linux-amd64-cgo), func Getcwd([]uint8) (int, error) +pkg syscall (linux-amd64-cgo), func Getdents(int, []uint8) (int, error) +pkg syscall (linux-amd64-cgo), func Getpeername(int) (Sockaddr, error) +pkg syscall (linux-amd64-cgo), func Getpgid(int) (int, error) +pkg syscall (linux-amd64-cgo), func Getpgrp() int +pkg syscall (linux-amd64-cgo), func Getrlimit(int, *Rlimit) error +pkg syscall (linux-amd64-cgo), func Getrusage(int, *Rusage) error +pkg syscall (linux-amd64-cgo), func Getsockname(int) (Sockaddr, error) +pkg syscall (linux-amd64-cgo), func GetsockoptIPMreq(int, int, int) (*IPMreq, error) +pkg syscall (linux-amd64-cgo), func GetsockoptIPMreqn(int, int, int) (*IPMreqn, error) +pkg syscall (linux-amd64-cgo), func GetsockoptIPv6Mreq(int, int, int) (*IPv6Mreq, error) +pkg syscall (linux-amd64-cgo), func GetsockoptInet4Addr(int, int, int) ([4]uint8, error) +pkg syscall (linux-amd64-cgo), func GetsockoptInt(int, int, int) (int, error) +pkg syscall (linux-amd64-cgo), func Gettid() int +pkg syscall (linux-amd64-cgo), func InotifyAddWatch(int, string, uint32) (int, error) +pkg syscall (linux-amd64-cgo), func InotifyInit() (int, error) +pkg syscall (linux-amd64-cgo), func InotifyInit1(int) (int, error) +pkg syscall (linux-amd64-cgo), func InotifyRmWatch(int, uint32) (int, error) +pkg syscall (linux-amd64-cgo), func Ioperm(int, int, int) error +pkg syscall (linux-amd64-cgo), func Iopl(int) error +pkg syscall (linux-amd64-cgo), func Kill(int, Signal) error +pkg syscall (linux-amd64-cgo), func Klogctl(int, []uint8) (int, error) +pkg syscall (linux-amd64-cgo), func Listen(int, int) error +pkg syscall (linux-amd64-cgo), func LsfJump(int, int, int, int) *SockFilter +pkg syscall (linux-amd64-cgo), func LsfSocket(int, int) (int, error) +pkg syscall (linux-amd64-cgo), func LsfStmt(int, int) *SockFilter +pkg syscall (linux-amd64-cgo), func Lstat(string, *Stat_t) error +pkg syscall (linux-amd64-cgo), func Madvise([]uint8, int) error +pkg syscall (linux-amd64-cgo), func Mkdirat(int, string, uint32) error +pkg syscall (linux-amd64-cgo), func Mkfifo(string, uint32) error +pkg syscall (linux-amd64-cgo), func Mknod(string, uint32, int) error +pkg syscall (linux-amd64-cgo), func Mknodat(int, string, uint32, int) error +pkg syscall (linux-amd64-cgo), func Mlock([]uint8) error +pkg syscall (linux-amd64-cgo), func Mlockall(int) error +pkg syscall (linux-amd64-cgo), func Mmap(int, int64, int, int, int) ([]uint8, error) +pkg syscall (linux-amd64-cgo), func Mount(string, string, string, uintptr, string) error +pkg syscall (linux-amd64-cgo), func Mprotect([]uint8, int) error +pkg syscall (linux-amd64-cgo), func Munlock([]uint8) error +pkg syscall (linux-amd64-cgo), func Munlockall() error +pkg syscall (linux-amd64-cgo), func Munmap([]uint8) error +pkg syscall (linux-amd64-cgo), func Nanosleep(*Timespec, *Timespec) error +pkg syscall (linux-amd64-cgo), func NetlinkRIB(int, int) ([]uint8, error) +pkg syscall (linux-amd64-cgo), func NsecToTimespec(int64) Timespec +pkg syscall (linux-amd64-cgo), func Open(string, int, uint32) (int, error) +pkg syscall (linux-amd64-cgo), func Openat(int, string, int, uint32) (int, error) +pkg syscall (linux-amd64-cgo), func ParseDirent([]uint8, int, []string) (int, int, []string) +pkg syscall (linux-amd64-cgo), func ParseNetlinkMessage([]uint8) ([]NetlinkMessage, error) +pkg syscall (linux-amd64-cgo), func ParseNetlinkRouteAttr(*NetlinkMessage) ([]NetlinkRouteAttr, error) +pkg syscall (linux-amd64-cgo), func ParseSocketControlMessage([]uint8) ([]SocketControlMessage, error) +pkg syscall (linux-amd64-cgo), func ParseUnixCredentials(*SocketControlMessage) (*Ucred, error) +pkg syscall (linux-amd64-cgo), func ParseUnixRights(*SocketControlMessage) ([]int, error) +pkg syscall (linux-amd64-cgo), func Pause() error +pkg syscall (linux-amd64-cgo), func Pipe([]int) error +pkg syscall (linux-amd64-cgo), func PivotRoot(string, string) error +pkg syscall (linux-amd64-cgo), func Pread(int, []uint8, int64) (int, error) +pkg syscall (linux-amd64-cgo), func PtraceAttach(int) error +pkg syscall (linux-amd64-cgo), func PtraceCont(int, int) error +pkg syscall (linux-amd64-cgo), func PtraceDetach(int) error +pkg syscall (linux-amd64-cgo), func PtraceGetEventMsg(int) (uint, error) +pkg syscall (linux-amd64-cgo), func PtraceGetRegs(int, *PtraceRegs) error +pkg syscall (linux-amd64-cgo), func PtracePeekData(int, uintptr, []uint8) (int, error) +pkg syscall (linux-amd64-cgo), func PtracePeekText(int, uintptr, []uint8) (int, error) +pkg syscall (linux-amd64-cgo), func PtracePokeData(int, uintptr, []uint8) (int, error) +pkg syscall (linux-amd64-cgo), func PtracePokeText(int, uintptr, []uint8) (int, error) +pkg syscall (linux-amd64-cgo), func PtraceSetOptions(int, int) error +pkg syscall (linux-amd64-cgo), func PtraceSetRegs(int, *PtraceRegs) error +pkg syscall (linux-amd64-cgo), func PtraceSingleStep(int) error +pkg syscall (linux-amd64-cgo), func Pwrite(int, []uint8, int64) (int, error) +pkg syscall (linux-amd64-cgo), func RawSyscall(uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno) +pkg syscall (linux-amd64-cgo), func RawSyscall6(uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno) +pkg syscall (linux-amd64-cgo), func Read(int, []uint8) (int, error) +pkg syscall (linux-amd64-cgo), func ReadDirent(int, []uint8) (int, error) +pkg syscall (linux-amd64-cgo), func Reboot(int) error +pkg syscall (linux-amd64-cgo), func Recvfrom(int, []uint8, int) (int, Sockaddr, error) +pkg syscall (linux-amd64-cgo), func Recvmsg(int, []uint8, []uint8, int) (int, int, int, Sockaddr, error) +pkg syscall (linux-amd64-cgo), func Renameat(int, string, int, string) error +pkg syscall (linux-amd64-cgo), func Seek(int, int64, int) (int64, error) +pkg syscall (linux-amd64-cgo), func Select(int, *FdSet, *FdSet, *FdSet, *Timeval) (int, error) +pkg syscall (linux-amd64-cgo), func Sendfile(int, int, *int64, int) (int, error) +pkg syscall (linux-amd64-cgo), func Sendmsg(int, []uint8, []uint8, Sockaddr, int) error +pkg syscall (linux-amd64-cgo), func Sendto(int, []uint8, int, Sockaddr) error +pkg syscall (linux-amd64-cgo), func SetLsfPromisc(string, bool) error +pkg syscall (linux-amd64-cgo), func SetNonblock(int, bool) error +pkg syscall (linux-amd64-cgo), func Setdomainname([]uint8) error +pkg syscall (linux-amd64-cgo), func Setfsgid(int) error +pkg syscall (linux-amd64-cgo), func Setfsuid(int) error +pkg syscall (linux-amd64-cgo), func Setgid(int) error +pkg syscall (linux-amd64-cgo), func Setgroups([]int) error +pkg syscall (linux-amd64-cgo), func Sethostname([]uint8) error +pkg syscall (linux-amd64-cgo), func Setpgid(int, int) error +pkg syscall (linux-amd64-cgo), func Setregid(int, int) error +pkg syscall (linux-amd64-cgo), func Setresgid(int, int, int) error +pkg syscall (linux-amd64-cgo), func Setresuid(int, int, int) error +pkg syscall (linux-amd64-cgo), func Setreuid(int, int) error +pkg syscall (linux-amd64-cgo), func Setrlimit(int, *Rlimit) error +pkg syscall (linux-amd64-cgo), func Setsid() (int, error) +pkg syscall (linux-amd64-cgo), func SetsockoptIPMreq(int, int, int, *IPMreq) error +pkg syscall (linux-amd64-cgo), func SetsockoptIPMreqn(int, int, int, *IPMreqn) error +pkg syscall (linux-amd64-cgo), func SetsockoptIPv6Mreq(int, int, int, *IPv6Mreq) error +pkg syscall (linux-amd64-cgo), func SetsockoptInet4Addr(int, int, int, [4]uint8) error +pkg syscall (linux-amd64-cgo), func SetsockoptInt(int, int, int, int) error +pkg syscall (linux-amd64-cgo), func SetsockoptLinger(int, int, int, *Linger) error +pkg syscall (linux-amd64-cgo), func SetsockoptString(int, int, int, string) error +pkg syscall (linux-amd64-cgo), func SetsockoptTimeval(int, int, int, *Timeval) error +pkg syscall (linux-amd64-cgo), func Settimeofday(*Timeval) error +pkg syscall (linux-amd64-cgo), func Setuid(int) error +pkg syscall (linux-amd64-cgo), func Shutdown(int, int) error +pkg syscall (linux-amd64-cgo), func Socket(int, int, int) (int, error) +pkg syscall (linux-amd64-cgo), func Socketpair(int, int, int) ([2]int, error) +pkg syscall (linux-amd64-cgo), func Splice(int, *int64, int, *int64, int, int) (int64, error) +pkg syscall (linux-amd64-cgo), func Stat(string, *Stat_t) error +pkg syscall (linux-amd64-cgo), func Statfs(string, *Statfs_t) error +pkg syscall (linux-amd64-cgo), func StringSlicePtr([]string) []*uint8 +pkg syscall (linux-amd64-cgo), func Sync() +pkg syscall (linux-amd64-cgo), func SyncFileRange(int, int64, int64, int) error +pkg syscall (linux-amd64-cgo), func Syscall(uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno) +pkg syscall (linux-amd64-cgo), func Syscall6(uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno) +pkg syscall (linux-amd64-cgo), func Sysinfo(*Sysinfo_t) error +pkg syscall (linux-amd64-cgo), func Tee(int, int, int, int) (int64, error) +pkg syscall (linux-amd64-cgo), func Tgkill(int, int, Signal) error +pkg syscall (linux-amd64-cgo), func Time(*Time_t) (Time_t, error) +pkg syscall (linux-amd64-cgo), func Times(*Tms) (uintptr, error) +pkg syscall (linux-amd64-cgo), func TimespecToNsec(Timespec) int64 +pkg syscall (linux-amd64-cgo), func TimevalToNsec(Timeval) int64 +pkg syscall (linux-amd64-cgo), func Truncate(string, int64) error +pkg syscall (linux-amd64-cgo), func Umask(int) int +pkg syscall (linux-amd64-cgo), func Uname(*Utsname) error +pkg syscall (linux-amd64-cgo), func UnixCredentials(*Ucred) []uint8 +pkg syscall (linux-amd64-cgo), func UnixRights(...int) []uint8 +pkg syscall (linux-amd64-cgo), func Unlinkat(int, string) error +pkg syscall (linux-amd64-cgo), func Unmount(string, int) error +pkg syscall (linux-amd64-cgo), func Unshare(int) error +pkg syscall (linux-amd64-cgo), func Ustat(int, *Ustat_t) error +pkg syscall (linux-amd64-cgo), func Utime(string, *Utimbuf) error +pkg syscall (linux-amd64-cgo), func Wait4(int, *WaitStatus, int, *Rusage) (int, error) +pkg syscall (linux-amd64-cgo), func Write(int, []uint8) (int, error) +pkg syscall (linux-amd64-cgo), method (*Cmsghdr) SetLen(int) +pkg syscall (linux-amd64-cgo), method (*Iovec) SetLen(int) +pkg syscall (linux-amd64-cgo), method (*Msghdr) SetControllen(int) +pkg syscall (linux-amd64-cgo), method (*PtraceRegs) PC() uint64 +pkg syscall (linux-amd64-cgo), method (*PtraceRegs) SetPC(uint64) +pkg syscall (linux-amd64-cgo), type Cmsghdr struct +pkg syscall (linux-amd64-cgo), type Cmsghdr struct, Len uint64 +pkg syscall (linux-amd64-cgo), type Cmsghdr struct, Level int32 +pkg syscall (linux-amd64-cgo), type Cmsghdr struct, Type int32 +pkg syscall (linux-amd64-cgo), type Cmsghdr struct, X__cmsg_data [0]uint8 +pkg syscall (linux-amd64-cgo), type Credential struct +pkg syscall (linux-amd64-cgo), type Credential struct, Gid uint32 +pkg syscall (linux-amd64-cgo), type Credential struct, Groups []uint32 +pkg syscall (linux-amd64-cgo), type Credential struct, Uid uint32 +pkg syscall (linux-amd64-cgo), type Dirent struct +pkg syscall (linux-amd64-cgo), type Dirent struct, Ino uint64 +pkg syscall (linux-amd64-cgo), type Dirent struct, Name [256]int8 +pkg syscall (linux-amd64-cgo), type Dirent struct, Off int64 +pkg syscall (linux-amd64-cgo), type Dirent struct, Pad_cgo_0 [5]uint8 +pkg syscall (linux-amd64-cgo), type Dirent struct, Reclen uint16 +pkg syscall (linux-amd64-cgo), type Dirent struct, Type uint8 +pkg syscall (linux-amd64-cgo), type EpollEvent struct +pkg syscall (linux-amd64-cgo), type EpollEvent struct, Events uint32 +pkg syscall (linux-amd64-cgo), type EpollEvent struct, Fd int32 +pkg syscall (linux-amd64-cgo), type EpollEvent struct, Pad int32 +pkg syscall (linux-amd64-cgo), type FdSet struct +pkg syscall (linux-amd64-cgo), type FdSet struct, Bits [16]int64 +pkg syscall (linux-amd64-cgo), type Fsid struct +pkg syscall (linux-amd64-cgo), type Fsid struct, X__val [2]int32 +pkg syscall (linux-amd64-cgo), type IPMreqn struct +pkg syscall (linux-amd64-cgo), type IPMreqn struct, Address [4]uint8 +pkg syscall (linux-amd64-cgo), type IPMreqn struct, Ifindex int32 +pkg syscall (linux-amd64-cgo), type IPMreqn struct, Multiaddr [4]uint8 +pkg syscall (linux-amd64-cgo), type IfAddrmsg struct +pkg syscall (linux-amd64-cgo), type IfAddrmsg struct, Family uint8 +pkg syscall (linux-amd64-cgo), type IfAddrmsg struct, Flags uint8 +pkg syscall (linux-amd64-cgo), type IfAddrmsg struct, Index uint32 +pkg syscall (linux-amd64-cgo), type IfAddrmsg struct, Prefixlen uint8 +pkg syscall (linux-amd64-cgo), type IfAddrmsg struct, Scope uint8 +pkg syscall (linux-amd64-cgo), type IfInfomsg struct +pkg syscall (linux-amd64-cgo), type IfInfomsg struct, Change uint32 +pkg syscall (linux-amd64-cgo), type IfInfomsg struct, Family uint8 +pkg syscall (linux-amd64-cgo), type IfInfomsg struct, Flags uint32 +pkg syscall (linux-amd64-cgo), type IfInfomsg struct, Index int32 +pkg syscall (linux-amd64-cgo), type IfInfomsg struct, Type uint16 +pkg syscall (linux-amd64-cgo), type IfInfomsg struct, X__ifi_pad uint8 +pkg syscall (linux-amd64-cgo), type Inet4Pktinfo struct +pkg syscall (linux-amd64-cgo), type Inet4Pktinfo struct, Addr [4]uint8 +pkg syscall (linux-amd64-cgo), type Inet4Pktinfo struct, Ifindex int32 +pkg syscall (linux-amd64-cgo), type Inet4Pktinfo struct, Spec_dst [4]uint8 +pkg syscall (linux-amd64-cgo), type Inet6Pktinfo struct +pkg syscall (linux-amd64-cgo), type Inet6Pktinfo struct, Addr [16]uint8 +pkg syscall (linux-amd64-cgo), type Inet6Pktinfo struct, Ifindex uint32 +pkg syscall (linux-amd64-cgo), type InotifyEvent struct +pkg syscall (linux-amd64-cgo), type InotifyEvent struct, Cookie uint32 +pkg syscall (linux-amd64-cgo), type InotifyEvent struct, Len uint32 +pkg syscall (linux-amd64-cgo), type InotifyEvent struct, Mask uint32 +pkg syscall (linux-amd64-cgo), type InotifyEvent struct, Name [0]uint8 +pkg syscall (linux-amd64-cgo), type InotifyEvent struct, Wd int32 +pkg syscall (linux-amd64-cgo), type Iovec struct +pkg syscall (linux-amd64-cgo), type Iovec struct, Base *uint8 +pkg syscall (linux-amd64-cgo), type Iovec struct, Len uint64 +pkg syscall (linux-amd64-cgo), type Msghdr struct +pkg syscall (linux-amd64-cgo), type Msghdr struct, Control *uint8 +pkg syscall (linux-amd64-cgo), type Msghdr struct, Controllen uint64 +pkg syscall (linux-amd64-cgo), type Msghdr struct, Flags int32 +pkg syscall (linux-amd64-cgo), type Msghdr struct, Iov *Iovec +pkg syscall (linux-amd64-cgo), type Msghdr struct, Iovlen uint64 +pkg syscall (linux-amd64-cgo), type Msghdr struct, Name *uint8 +pkg syscall (linux-amd64-cgo), type Msghdr struct, Namelen uint32 +pkg syscall (linux-amd64-cgo), type Msghdr struct, Pad_cgo_0 [4]uint8 +pkg syscall (linux-amd64-cgo), type Msghdr struct, Pad_cgo_1 [4]uint8 +pkg syscall (linux-amd64-cgo), type NetlinkMessage struct +pkg syscall (linux-amd64-cgo), type NetlinkMessage struct, Data []uint8 +pkg syscall (linux-amd64-cgo), type NetlinkMessage struct, Header NlMsghdr +pkg syscall (linux-amd64-cgo), type NetlinkRouteAttr struct +pkg syscall (linux-amd64-cgo), type NetlinkRouteAttr struct, Attr RtAttr +pkg syscall (linux-amd64-cgo), type NetlinkRouteAttr struct, Value []uint8 +pkg syscall (linux-amd64-cgo), type NetlinkRouteRequest struct +pkg syscall (linux-amd64-cgo), type NetlinkRouteRequest struct, Data RtGenmsg +pkg syscall (linux-amd64-cgo), type NetlinkRouteRequest struct, Header NlMsghdr +pkg syscall (linux-amd64-cgo), type NlAttr struct +pkg syscall (linux-amd64-cgo), type NlAttr struct, Len uint16 +pkg syscall (linux-amd64-cgo), type NlAttr struct, Type uint16 +pkg syscall (linux-amd64-cgo), type NlMsgerr struct +pkg syscall (linux-amd64-cgo), type NlMsgerr struct, Error int32 +pkg syscall (linux-amd64-cgo), type NlMsgerr struct, Msg NlMsghdr +pkg syscall (linux-amd64-cgo), type NlMsghdr struct +pkg syscall (linux-amd64-cgo), type NlMsghdr struct, Flags uint16 +pkg syscall (linux-amd64-cgo), type NlMsghdr struct, Len uint32 +pkg syscall (linux-amd64-cgo), type NlMsghdr struct, Pid uint32 +pkg syscall (linux-amd64-cgo), type NlMsghdr struct, Seq uint32 +pkg syscall (linux-amd64-cgo), type NlMsghdr struct, Type uint16 +pkg syscall (linux-amd64-cgo), type PtraceRegs struct +pkg syscall (linux-amd64-cgo), type PtraceRegs struct, Cs uint64 +pkg syscall (linux-amd64-cgo), type PtraceRegs struct, Ds uint64 +pkg syscall (linux-amd64-cgo), type PtraceRegs struct, Eflags uint64 +pkg syscall (linux-amd64-cgo), type PtraceRegs struct, Es uint64 +pkg syscall (linux-amd64-cgo), type PtraceRegs struct, Fs uint64 +pkg syscall (linux-amd64-cgo), type PtraceRegs struct, Fs_base uint64 +pkg syscall (linux-amd64-cgo), type PtraceRegs struct, Gs uint64 +pkg syscall (linux-amd64-cgo), type PtraceRegs struct, Gs_base uint64 +pkg syscall (linux-amd64-cgo), type PtraceRegs struct, Orig_rax uint64 +pkg syscall (linux-amd64-cgo), type PtraceRegs struct, R10 uint64 +pkg syscall (linux-amd64-cgo), type PtraceRegs struct, R11 uint64 +pkg syscall (linux-amd64-cgo), type PtraceRegs struct, R12 uint64 +pkg syscall (linux-amd64-cgo), type PtraceRegs struct, R13 uint64 +pkg syscall (linux-amd64-cgo), type PtraceRegs struct, R14 uint64 +pkg syscall (linux-amd64-cgo), type PtraceRegs struct, R15 uint64 +pkg syscall (linux-amd64-cgo), type PtraceRegs struct, R8 uint64 +pkg syscall (linux-amd64-cgo), type PtraceRegs struct, R9 uint64 +pkg syscall (linux-amd64-cgo), type PtraceRegs struct, Rax uint64 +pkg syscall (linux-amd64-cgo), type PtraceRegs struct, Rbp uint64 +pkg syscall (linux-amd64-cgo), type PtraceRegs struct, Rbx uint64 +pkg syscall (linux-amd64-cgo), type PtraceRegs struct, Rcx uint64 +pkg syscall (linux-amd64-cgo), type PtraceRegs struct, Rdi uint64 +pkg syscall (linux-amd64-cgo), type PtraceRegs struct, Rdx uint64 +pkg syscall (linux-amd64-cgo), type PtraceRegs struct, Rip uint64 +pkg syscall (linux-amd64-cgo), type PtraceRegs struct, Rsi uint64 +pkg syscall (linux-amd64-cgo), type PtraceRegs struct, Rsp uint64 +pkg syscall (linux-amd64-cgo), type PtraceRegs struct, Ss uint64 +pkg syscall (linux-amd64-cgo), type RawSockaddr struct, Data [14]int8 +pkg syscall (linux-amd64-cgo), type RawSockaddr struct, Family uint16 +pkg syscall (linux-amd64-cgo), type RawSockaddrAny struct, Pad [96]int8 +pkg syscall (linux-amd64-cgo), type RawSockaddrInet4 struct, Family uint16 +pkg syscall (linux-amd64-cgo), type RawSockaddrInet4 struct, Zero [8]uint8 +pkg syscall (linux-amd64-cgo), type RawSockaddrInet6 struct +pkg syscall (linux-amd64-cgo), type RawSockaddrInet6 struct, Addr [16]uint8 +pkg syscall (linux-amd64-cgo), type RawSockaddrInet6 struct, Family uint16 +pkg syscall (linux-amd64-cgo), type RawSockaddrInet6 struct, Flowinfo uint32 +pkg syscall (linux-amd64-cgo), type RawSockaddrInet6 struct, Port uint16 +pkg syscall (linux-amd64-cgo), type RawSockaddrInet6 struct, Scope_id uint32 +pkg syscall (linux-amd64-cgo), type RawSockaddrLinklayer struct +pkg syscall (linux-amd64-cgo), type RawSockaddrLinklayer struct, Addr [8]uint8 +pkg syscall (linux-amd64-cgo), type RawSockaddrLinklayer struct, Family uint16 +pkg syscall (linux-amd64-cgo), type RawSockaddrLinklayer struct, Halen uint8 +pkg syscall (linux-amd64-cgo), type RawSockaddrLinklayer struct, Hatype uint16 +pkg syscall (linux-amd64-cgo), type RawSockaddrLinklayer struct, Ifindex int32 +pkg syscall (linux-amd64-cgo), type RawSockaddrLinklayer struct, Pkttype uint8 +pkg syscall (linux-amd64-cgo), type RawSockaddrLinklayer struct, Protocol uint16 +pkg syscall (linux-amd64-cgo), type RawSockaddrNetlink struct +pkg syscall (linux-amd64-cgo), type RawSockaddrNetlink struct, Family uint16 +pkg syscall (linux-amd64-cgo), type RawSockaddrNetlink struct, Groups uint32 +pkg syscall (linux-amd64-cgo), type RawSockaddrNetlink struct, Pad uint16 +pkg syscall (linux-amd64-cgo), type RawSockaddrNetlink struct, Pid uint32 +pkg syscall (linux-amd64-cgo), type RawSockaddrUnix struct +pkg syscall (linux-amd64-cgo), type RawSockaddrUnix struct, Family uint16 +pkg syscall (linux-amd64-cgo), type RawSockaddrUnix struct, Path [108]int8 +pkg syscall (linux-amd64-cgo), type Rlimit struct +pkg syscall (linux-amd64-cgo), type Rlimit struct, Cur uint64 +pkg syscall (linux-amd64-cgo), type Rlimit struct, Max uint64 +pkg syscall (linux-amd64-cgo), type RtAttr struct +pkg syscall (linux-amd64-cgo), type RtAttr struct, Len uint16 +pkg syscall (linux-amd64-cgo), type RtAttr struct, Type uint16 +pkg syscall (linux-amd64-cgo), type RtGenmsg struct +pkg syscall (linux-amd64-cgo), type RtGenmsg struct, Family uint8 +pkg syscall (linux-amd64-cgo), type RtMsg struct +pkg syscall (linux-amd64-cgo), type RtMsg struct, Dst_len uint8 +pkg syscall (linux-amd64-cgo), type RtMsg struct, Family uint8 +pkg syscall (linux-amd64-cgo), type RtMsg struct, Flags uint32 +pkg syscall (linux-amd64-cgo), type RtMsg struct, Protocol uint8 +pkg syscall (linux-amd64-cgo), type RtMsg struct, Scope uint8 +pkg syscall (linux-amd64-cgo), type RtMsg struct, Src_len uint8 +pkg syscall (linux-amd64-cgo), type RtMsg struct, Table uint8 +pkg syscall (linux-amd64-cgo), type RtMsg struct, Tos uint8 +pkg syscall (linux-amd64-cgo), type RtMsg struct, Type uint8 +pkg syscall (linux-amd64-cgo), type RtNexthop struct +pkg syscall (linux-amd64-cgo), type RtNexthop struct, Flags uint8 +pkg syscall (linux-amd64-cgo), type RtNexthop struct, Hops uint8 +pkg syscall (linux-amd64-cgo), type RtNexthop struct, Ifindex int32 +pkg syscall (linux-amd64-cgo), type RtNexthop struct, Len uint16 +pkg syscall (linux-amd64-cgo), type Rusage struct, Idrss int64 +pkg syscall (linux-amd64-cgo), type Rusage struct, Inblock int64 +pkg syscall (linux-amd64-cgo), type Rusage struct, Isrss int64 +pkg syscall (linux-amd64-cgo), type Rusage struct, Ixrss int64 +pkg syscall (linux-amd64-cgo), type Rusage struct, Majflt int64 +pkg syscall (linux-amd64-cgo), type Rusage struct, Maxrss int64 +pkg syscall (linux-amd64-cgo), type Rusage struct, Minflt int64 +pkg syscall (linux-amd64-cgo), type Rusage struct, Msgrcv int64 +pkg syscall (linux-amd64-cgo), type Rusage struct, Msgsnd int64 +pkg syscall (linux-amd64-cgo), type Rusage struct, Nivcsw int64 +pkg syscall (linux-amd64-cgo), type Rusage struct, Nsignals int64 +pkg syscall (linux-amd64-cgo), type Rusage struct, Nswap int64 +pkg syscall (linux-amd64-cgo), type Rusage struct, Nvcsw int64 +pkg syscall (linux-amd64-cgo), type Rusage struct, Oublock int64 +pkg syscall (linux-amd64-cgo), type Rusage struct, Stime Timeval +pkg syscall (linux-amd64-cgo), type Rusage struct, Utime Timeval +pkg syscall (linux-amd64-cgo), type SockFilter struct +pkg syscall (linux-amd64-cgo), type SockFilter struct, Code uint16 +pkg syscall (linux-amd64-cgo), type SockFilter struct, Jf uint8 +pkg syscall (linux-amd64-cgo), type SockFilter struct, Jt uint8 +pkg syscall (linux-amd64-cgo), type SockFilter struct, K uint32 +pkg syscall (linux-amd64-cgo), type SockFprog struct +pkg syscall (linux-amd64-cgo), type SockFprog struct, Filter *SockFilter +pkg syscall (linux-amd64-cgo), type SockFprog struct, Len uint16 +pkg syscall (linux-amd64-cgo), type SockFprog struct, Pad_cgo_0 [6]uint8 +pkg syscall (linux-amd64-cgo), type SockaddrLinklayer struct +pkg syscall (linux-amd64-cgo), type SockaddrLinklayer struct, Addr [8]uint8 +pkg syscall (linux-amd64-cgo), type SockaddrLinklayer struct, Halen uint8 +pkg syscall (linux-amd64-cgo), type SockaddrLinklayer struct, Hatype uint16 +pkg syscall (linux-amd64-cgo), type SockaddrLinklayer struct, Ifindex int +pkg syscall (linux-amd64-cgo), type SockaddrLinklayer struct, Pkttype uint8 +pkg syscall (linux-amd64-cgo), type SockaddrLinklayer struct, Protocol uint16 +pkg syscall (linux-amd64-cgo), type SockaddrNetlink struct +pkg syscall (linux-amd64-cgo), type SockaddrNetlink struct, Family uint16 +pkg syscall (linux-amd64-cgo), type SockaddrNetlink struct, Groups uint32 +pkg syscall (linux-amd64-cgo), type SockaddrNetlink struct, Pad uint16 +pkg syscall (linux-amd64-cgo), type SockaddrNetlink struct, Pid uint32 +pkg syscall (linux-amd64-cgo), type SocketControlMessage struct +pkg syscall (linux-amd64-cgo), type SocketControlMessage struct, Data []uint8 +pkg syscall (linux-amd64-cgo), type SocketControlMessage struct, Header Cmsghdr +pkg syscall (linux-amd64-cgo), type Stat_t struct +pkg syscall (linux-amd64-cgo), type Stat_t struct, Atim Timespec +pkg syscall (linux-amd64-cgo), type Stat_t struct, Blksize int64 +pkg syscall (linux-amd64-cgo), type Stat_t struct, Blocks int64 +pkg syscall (linux-amd64-cgo), type Stat_t struct, Ctim Timespec +pkg syscall (linux-amd64-cgo), type Stat_t struct, Dev uint64 +pkg syscall (linux-amd64-cgo), type Stat_t struct, Gid uint32 +pkg syscall (linux-amd64-cgo), type Stat_t struct, Ino uint64 +pkg syscall (linux-amd64-cgo), type Stat_t struct, Mode uint32 +pkg syscall (linux-amd64-cgo), type Stat_t struct, Mtim Timespec +pkg syscall (linux-amd64-cgo), type Stat_t struct, Nlink uint64 +pkg syscall (linux-amd64-cgo), type Stat_t struct, Rdev uint64 +pkg syscall (linux-amd64-cgo), type Stat_t struct, Size int64 +pkg syscall (linux-amd64-cgo), type Stat_t struct, Uid uint32 +pkg syscall (linux-amd64-cgo), type Stat_t struct, X__pad0 int32 +pkg syscall (linux-amd64-cgo), type Stat_t struct, X__unused [3]int64 +pkg syscall (linux-amd64-cgo), type Statfs_t struct +pkg syscall (linux-amd64-cgo), type Statfs_t struct, Bavail uint64 +pkg syscall (linux-amd64-cgo), type Statfs_t struct, Bfree uint64 +pkg syscall (linux-amd64-cgo), type Statfs_t struct, Blocks uint64 +pkg syscall (linux-amd64-cgo), type Statfs_t struct, Bsize int64 +pkg syscall (linux-amd64-cgo), type Statfs_t struct, Ffree uint64 +pkg syscall (linux-amd64-cgo), type Statfs_t struct, Files uint64 +pkg syscall (linux-amd64-cgo), type Statfs_t struct, Flags int64 +pkg syscall (linux-amd64-cgo), type Statfs_t struct, Frsize int64 +pkg syscall (linux-amd64-cgo), type Statfs_t struct, Fsid Fsid +pkg syscall (linux-amd64-cgo), type Statfs_t struct, Namelen int64 +pkg syscall (linux-amd64-cgo), type Statfs_t struct, Spare [4]int64 +pkg syscall (linux-amd64-cgo), type Statfs_t struct, Type int64 +pkg syscall (linux-amd64-cgo), type SysProcAttr struct, Chroot string +pkg syscall (linux-amd64-cgo), type SysProcAttr struct, Credential *Credential +pkg syscall (linux-amd64-cgo), type SysProcAttr struct, Noctty bool +pkg syscall (linux-amd64-cgo), type SysProcAttr struct, Pdeathsig Signal +pkg syscall (linux-amd64-cgo), type SysProcAttr struct, Ptrace bool +pkg syscall (linux-amd64-cgo), type SysProcAttr struct, Setctty bool +pkg syscall (linux-amd64-cgo), type SysProcAttr struct, Setpgid bool +pkg syscall (linux-amd64-cgo), type SysProcAttr struct, Setsid bool +pkg syscall (linux-amd64-cgo), type Sysinfo_t struct +pkg syscall (linux-amd64-cgo), type Sysinfo_t struct, Bufferram uint64 +pkg syscall (linux-amd64-cgo), type Sysinfo_t struct, Freehigh uint64 +pkg syscall (linux-amd64-cgo), type Sysinfo_t struct, Freeram uint64 +pkg syscall (linux-amd64-cgo), type Sysinfo_t struct, Freeswap uint64 +pkg syscall (linux-amd64-cgo), type Sysinfo_t struct, Loads [3]uint64 +pkg syscall (linux-amd64-cgo), type Sysinfo_t struct, Pad uint16 +pkg syscall (linux-amd64-cgo), type Sysinfo_t struct, Pad_cgo_0 [4]uint8 +pkg syscall (linux-amd64-cgo), type Sysinfo_t struct, Pad_cgo_1 [4]uint8 +pkg syscall (linux-amd64-cgo), type Sysinfo_t struct, Procs uint16 +pkg syscall (linux-amd64-cgo), type Sysinfo_t struct, Sharedram uint64 +pkg syscall (linux-amd64-cgo), type Sysinfo_t struct, Totalhigh uint64 +pkg syscall (linux-amd64-cgo), type Sysinfo_t struct, Totalram uint64 +pkg syscall (linux-amd64-cgo), type Sysinfo_t struct, Totalswap uint64 +pkg syscall (linux-amd64-cgo), type Sysinfo_t struct, Unit uint32 +pkg syscall (linux-amd64-cgo), type Sysinfo_t struct, Uptime int64 +pkg syscall (linux-amd64-cgo), type Sysinfo_t struct, X_f [0]uint8 +pkg syscall (linux-amd64-cgo), type Termios struct +pkg syscall (linux-amd64-cgo), type Termios struct, Cc [32]uint8 +pkg syscall (linux-amd64-cgo), type Termios struct, Cflag uint32 +pkg syscall (linux-amd64-cgo), type Termios struct, Iflag uint32 +pkg syscall (linux-amd64-cgo), type Termios struct, Ispeed uint32 +pkg syscall (linux-amd64-cgo), type Termios struct, Lflag uint32 +pkg syscall (linux-amd64-cgo), type Termios struct, Line uint8 +pkg syscall (linux-amd64-cgo), type Termios struct, Oflag uint32 +pkg syscall (linux-amd64-cgo), type Termios struct, Ospeed uint32 +pkg syscall (linux-amd64-cgo), type Termios struct, Pad_cgo_0 [3]uint8 +pkg syscall (linux-amd64-cgo), type Time_t int64 +pkg syscall (linux-amd64-cgo), type Timespec struct, Nsec int64 +pkg syscall (linux-amd64-cgo), type Timespec struct, Sec int64 +pkg syscall (linux-amd64-cgo), type Timeval struct, Sec int64 +pkg syscall (linux-amd64-cgo), type Timeval struct, Usec int64 +pkg syscall (linux-amd64-cgo), type Timex struct +pkg syscall (linux-amd64-cgo), type Timex struct, Calcnt int64 +pkg syscall (linux-amd64-cgo), type Timex struct, Constant int64 +pkg syscall (linux-amd64-cgo), type Timex struct, Errcnt int64 +pkg syscall (linux-amd64-cgo), type Timex struct, Esterror int64 +pkg syscall (linux-amd64-cgo), type Timex struct, Freq int64 +pkg syscall (linux-amd64-cgo), type Timex struct, Jitcnt int64 +pkg syscall (linux-amd64-cgo), type Timex struct, Jitter int64 +pkg syscall (linux-amd64-cgo), type Timex struct, Maxerror int64 +pkg syscall (linux-amd64-cgo), type Timex struct, Modes uint32 +pkg syscall (linux-amd64-cgo), type Timex struct, Offset int64 +pkg syscall (linux-amd64-cgo), type Timex struct, Pad_cgo_0 [4]uint8 +pkg syscall (linux-amd64-cgo), type Timex struct, Pad_cgo_1 [4]uint8 +pkg syscall (linux-amd64-cgo), type Timex struct, Pad_cgo_2 [4]uint8 +pkg syscall (linux-amd64-cgo), type Timex struct, Pad_cgo_3 [44]uint8 +pkg syscall (linux-amd64-cgo), type Timex struct, Ppsfreq int64 +pkg syscall (linux-amd64-cgo), type Timex struct, Precision int64 +pkg syscall (linux-amd64-cgo), type Timex struct, Shift int32 +pkg syscall (linux-amd64-cgo), type Timex struct, Stabil int64 +pkg syscall (linux-amd64-cgo), type Timex struct, Status int32 +pkg syscall (linux-amd64-cgo), type Timex struct, Stbcnt int64 +pkg syscall (linux-amd64-cgo), type Timex struct, Tai int32 +pkg syscall (linux-amd64-cgo), type Timex struct, Tick int64 +pkg syscall (linux-amd64-cgo), type Timex struct, Time Timeval +pkg syscall (linux-amd64-cgo), type Timex struct, Tolerance int64 +pkg syscall (linux-amd64-cgo), type Tms struct +pkg syscall (linux-amd64-cgo), type Tms struct, Cstime int64 +pkg syscall (linux-amd64-cgo), type Tms struct, Cutime int64 +pkg syscall (linux-amd64-cgo), type Tms struct, Stime int64 +pkg syscall (linux-amd64-cgo), type Tms struct, Utime int64 +pkg syscall (linux-amd64-cgo), type Ucred struct +pkg syscall (linux-amd64-cgo), type Ucred struct, Gid uint32 +pkg syscall (linux-amd64-cgo), type Ucred struct, Pid int32 +pkg syscall (linux-amd64-cgo), type Ucred struct, Uid uint32 +pkg syscall (linux-amd64-cgo), type Ustat_t struct +pkg syscall (linux-amd64-cgo), type Ustat_t struct, Fname [6]int8 +pkg syscall (linux-amd64-cgo), type Ustat_t struct, Fpack [6]int8 +pkg syscall (linux-amd64-cgo), type Ustat_t struct, Pad_cgo_0 [4]uint8 +pkg syscall (linux-amd64-cgo), type Ustat_t struct, Pad_cgo_1 [4]uint8 +pkg syscall (linux-amd64-cgo), type Ustat_t struct, Tfree int32 +pkg syscall (linux-amd64-cgo), type Ustat_t struct, Tinode uint64 +pkg syscall (linux-amd64-cgo), type Utimbuf struct +pkg syscall (linux-amd64-cgo), type Utimbuf struct, Actime int64 +pkg syscall (linux-amd64-cgo), type Utimbuf struct, Modtime int64 +pkg syscall (linux-amd64-cgo), type Utsname struct +pkg syscall (linux-amd64-cgo), type Utsname struct, Domainname [65]int8 +pkg syscall (linux-amd64-cgo), type Utsname struct, Machine [65]int8 +pkg syscall (linux-amd64-cgo), type Utsname struct, Nodename [65]int8 +pkg syscall (linux-amd64-cgo), type Utsname struct, Release [65]int8 +pkg syscall (linux-amd64-cgo), type Utsname struct, Sysname [65]int8 +pkg syscall (linux-amd64-cgo), type Utsname struct, Version [65]int8 +pkg syscall (linux-amd64-cgo), type WaitStatus uint32 +pkg syscall (linux-amd64-cgo), var Stderr int +pkg syscall (linux-amd64-cgo), var Stdin int +pkg syscall (linux-amd64-cgo), var Stdout int +pkg syscall (linux-arm), const AF_ALG ideal-int +pkg syscall (linux-arm), const AF_APPLETALK ideal-int +pkg syscall (linux-arm), const AF_ASH ideal-int +pkg syscall (linux-arm), const AF_ATMPVC ideal-int +pkg syscall (linux-arm), const AF_ATMSVC ideal-int +pkg syscall (linux-arm), const AF_AX25 ideal-int +pkg syscall (linux-arm), const AF_BLUETOOTH ideal-int +pkg syscall (linux-arm), const AF_BRIDGE ideal-int +pkg syscall (linux-arm), const AF_CAIF ideal-int +pkg syscall (linux-arm), const AF_CAN ideal-int +pkg syscall (linux-arm), const AF_DECnet ideal-int +pkg syscall (linux-arm), const AF_ECONET ideal-int +pkg syscall (linux-arm), const AF_FILE ideal-int +pkg syscall (linux-arm), const AF_IEEE802154 ideal-int +pkg syscall (linux-arm), const AF_IPX ideal-int +pkg syscall (linux-arm), const AF_IRDA ideal-int +pkg syscall (linux-arm), const AF_ISDN ideal-int +pkg syscall (linux-arm), const AF_IUCV ideal-int +pkg syscall (linux-arm), const AF_KEY ideal-int +pkg syscall (linux-arm), const AF_LLC ideal-int +pkg syscall (linux-arm), const AF_LOCAL ideal-int +pkg syscall (linux-arm), const AF_MAX ideal-int +pkg syscall (linux-arm), const AF_NETBEUI ideal-int +pkg syscall (linux-arm), const AF_NETLINK ideal-int +pkg syscall (linux-arm), const AF_NETROM ideal-int +pkg syscall (linux-arm), const AF_PACKET ideal-int +pkg syscall (linux-arm), const AF_PHONET ideal-int +pkg syscall (linux-arm), const AF_PPPOX ideal-int +pkg syscall (linux-arm), const AF_RDS ideal-int +pkg syscall (linux-arm), const AF_ROSE ideal-int +pkg syscall (linux-arm), const AF_ROUTE ideal-int +pkg syscall (linux-arm), const AF_RXRPC ideal-int +pkg syscall (linux-arm), const AF_SECURITY ideal-int +pkg syscall (linux-arm), const AF_SNA ideal-int +pkg syscall (linux-arm), const AF_TIPC ideal-int +pkg syscall (linux-arm), const AF_WANPIPE ideal-int +pkg syscall (linux-arm), const AF_X25 ideal-int +pkg syscall (linux-arm), const ARPHRD_ADAPT ideal-int +pkg syscall (linux-arm), const ARPHRD_APPLETLK ideal-int +pkg syscall (linux-arm), const ARPHRD_ARCNET ideal-int +pkg syscall (linux-arm), const ARPHRD_ASH ideal-int +pkg syscall (linux-arm), const ARPHRD_ATM ideal-int +pkg syscall (linux-arm), const ARPHRD_AX25 ideal-int +pkg syscall (linux-arm), const ARPHRD_BIF ideal-int +pkg syscall (linux-arm), const ARPHRD_CHAOS ideal-int +pkg syscall (linux-arm), const ARPHRD_CISCO ideal-int +pkg syscall (linux-arm), const ARPHRD_CSLIP ideal-int +pkg syscall (linux-arm), const ARPHRD_CSLIP6 ideal-int +pkg syscall (linux-arm), const ARPHRD_DDCMP ideal-int +pkg syscall (linux-arm), const ARPHRD_DLCI ideal-int +pkg syscall (linux-arm), const ARPHRD_ECONET ideal-int +pkg syscall (linux-arm), const ARPHRD_EETHER ideal-int +pkg syscall (linux-arm), const ARPHRD_ETHER ideal-int +pkg syscall (linux-arm), const ARPHRD_EUI64 ideal-int +pkg syscall (linux-arm), const ARPHRD_FCAL ideal-int +pkg syscall (linux-arm), const ARPHRD_FCFABRIC ideal-int +pkg syscall (linux-arm), const ARPHRD_FCPL ideal-int +pkg syscall (linux-arm), const ARPHRD_FCPP ideal-int +pkg syscall (linux-arm), const ARPHRD_FDDI ideal-int +pkg syscall (linux-arm), const ARPHRD_FRAD ideal-int +pkg syscall (linux-arm), const ARPHRD_HDLC ideal-int +pkg syscall (linux-arm), const ARPHRD_HIPPI ideal-int +pkg syscall (linux-arm), const ARPHRD_HWX25 ideal-int +pkg syscall (linux-arm), const ARPHRD_IEEE1394 ideal-int +pkg syscall (linux-arm), const ARPHRD_IEEE802 ideal-int +pkg syscall (linux-arm), const ARPHRD_IEEE80211 ideal-int +pkg syscall (linux-arm), const ARPHRD_IEEE80211_PRISM ideal-int +pkg syscall (linux-arm), const ARPHRD_IEEE80211_RADIOTAP ideal-int +pkg syscall (linux-arm), const ARPHRD_IEEE802154 ideal-int +pkg syscall (linux-arm), const ARPHRD_IEEE802154_PHY ideal-int +pkg syscall (linux-arm), const ARPHRD_IEEE802_TR ideal-int +pkg syscall (linux-arm), const ARPHRD_INFINIBAND ideal-int +pkg syscall (linux-arm), const ARPHRD_IPDDP ideal-int +pkg syscall (linux-arm), const ARPHRD_IPGRE ideal-int +pkg syscall (linux-arm), const ARPHRD_IRDA ideal-int +pkg syscall (linux-arm), const ARPHRD_LAPB ideal-int +pkg syscall (linux-arm), const ARPHRD_LOCALTLK ideal-int +pkg syscall (linux-arm), const ARPHRD_LOOPBACK ideal-int +pkg syscall (linux-arm), const ARPHRD_METRICOM ideal-int +pkg syscall (linux-arm), const ARPHRD_NETROM ideal-int +pkg syscall (linux-arm), const ARPHRD_NONE ideal-int +pkg syscall (linux-arm), const ARPHRD_PIMREG ideal-int +pkg syscall (linux-arm), const ARPHRD_PPP ideal-int +pkg syscall (linux-arm), const ARPHRD_PRONET ideal-int +pkg syscall (linux-arm), const ARPHRD_RAWHDLC ideal-int +pkg syscall (linux-arm), const ARPHRD_ROSE ideal-int +pkg syscall (linux-arm), const ARPHRD_RSRVD ideal-int +pkg syscall (linux-arm), const ARPHRD_SIT ideal-int +pkg syscall (linux-arm), const ARPHRD_SKIP ideal-int +pkg syscall (linux-arm), const ARPHRD_SLIP ideal-int +pkg syscall (linux-arm), const ARPHRD_SLIP6 ideal-int +pkg syscall (linux-arm), const ARPHRD_TUNNEL ideal-int +pkg syscall (linux-arm), const ARPHRD_TUNNEL6 ideal-int +pkg syscall (linux-arm), const ARPHRD_VOID ideal-int +pkg syscall (linux-arm), const ARPHRD_X25 ideal-int +pkg syscall (linux-arm), const B0 ideal-int +pkg syscall (linux-arm), const B1000000 ideal-int +pkg syscall (linux-arm), const B110 ideal-int +pkg syscall (linux-arm), const B115200 ideal-int +pkg syscall (linux-arm), const B1152000 ideal-int +pkg syscall (linux-arm), const B1200 ideal-int +pkg syscall (linux-arm), const B134 ideal-int +pkg syscall (linux-arm), const B150 ideal-int +pkg syscall (linux-arm), const B1500000 ideal-int +pkg syscall (linux-arm), const B1800 ideal-int +pkg syscall (linux-arm), const B19200 ideal-int +pkg syscall (linux-arm), const B200 ideal-int +pkg syscall (linux-arm), const B2000000 ideal-int +pkg syscall (linux-arm), const B230400 ideal-int +pkg syscall (linux-arm), const B2400 ideal-int +pkg syscall (linux-arm), const B2500000 ideal-int +pkg syscall (linux-arm), const B300 ideal-int +pkg syscall (linux-arm), const B3000000 ideal-int +pkg syscall (linux-arm), const B3500000 ideal-int +pkg syscall (linux-arm), const B38400 ideal-int +pkg syscall (linux-arm), const B4000000 ideal-int +pkg syscall (linux-arm), const B460800 ideal-int +pkg syscall (linux-arm), const B4800 ideal-int +pkg syscall (linux-arm), const B50 ideal-int +pkg syscall (linux-arm), const B500000 ideal-int +pkg syscall (linux-arm), const B57600 ideal-int +pkg syscall (linux-arm), const B576000 ideal-int +pkg syscall (linux-arm), const B600 ideal-int +pkg syscall (linux-arm), const B75 ideal-int +pkg syscall (linux-arm), const B921600 ideal-int +pkg syscall (linux-arm), const B9600 ideal-int +pkg syscall (linux-arm), const BPF_A ideal-int +pkg syscall (linux-arm), const BPF_ABS ideal-int +pkg syscall (linux-arm), const BPF_ADD ideal-int +pkg syscall (linux-arm), const BPF_ALU ideal-int +pkg syscall (linux-arm), const BPF_AND ideal-int +pkg syscall (linux-arm), const BPF_B ideal-int +pkg syscall (linux-arm), const BPF_DIV ideal-int +pkg syscall (linux-arm), const BPF_H ideal-int +pkg syscall (linux-arm), const BPF_IMM ideal-int +pkg syscall (linux-arm), const BPF_IND ideal-int +pkg syscall (linux-arm), const BPF_JA ideal-int +pkg syscall (linux-arm), const BPF_JEQ ideal-int +pkg syscall (linux-arm), const BPF_JGE ideal-int +pkg syscall (linux-arm), const BPF_JGT ideal-int +pkg syscall (linux-arm), const BPF_JMP ideal-int +pkg syscall (linux-arm), const BPF_JSET ideal-int +pkg syscall (linux-arm), const BPF_K ideal-int +pkg syscall (linux-arm), const BPF_LD ideal-int +pkg syscall (linux-arm), const BPF_LDX ideal-int +pkg syscall (linux-arm), const BPF_LEN ideal-int +pkg syscall (linux-arm), const BPF_LSH ideal-int +pkg syscall (linux-arm), const BPF_MAJOR_VERSION ideal-int +pkg syscall (linux-arm), const BPF_MAXINSNS ideal-int +pkg syscall (linux-arm), const BPF_MEM ideal-int +pkg syscall (linux-arm), const BPF_MEMWORDS ideal-int +pkg syscall (linux-arm), const BPF_MINOR_VERSION ideal-int +pkg syscall (linux-arm), const BPF_MISC ideal-int +pkg syscall (linux-arm), const BPF_MSH ideal-int +pkg syscall (linux-arm), const BPF_MUL ideal-int +pkg syscall (linux-arm), const BPF_NEG ideal-int +pkg syscall (linux-arm), const BPF_OR ideal-int +pkg syscall (linux-arm), const BPF_RET ideal-int +pkg syscall (linux-arm), const BPF_RSH ideal-int +pkg syscall (linux-arm), const BPF_ST ideal-int +pkg syscall (linux-arm), const BPF_STX ideal-int +pkg syscall (linux-arm), const BPF_SUB ideal-int +pkg syscall (linux-arm), const BPF_TAX ideal-int +pkg syscall (linux-arm), const BPF_TXA ideal-int +pkg syscall (linux-arm), const BPF_W ideal-int +pkg syscall (linux-arm), const BPF_X ideal-int +pkg syscall (linux-arm), const BRKINT ideal-int +pkg syscall (linux-arm), const CLOCAL ideal-int +pkg syscall (linux-arm), const CREAD ideal-int +pkg syscall (linux-arm), const CS5 ideal-int +pkg syscall (linux-arm), const CS6 ideal-int +pkg syscall (linux-arm), const CS7 ideal-int +pkg syscall (linux-arm), const CS8 ideal-int +pkg syscall (linux-arm), const CSIZE ideal-int +pkg syscall (linux-arm), const CSTOPB ideal-int +pkg syscall (linux-arm), const DT_BLK ideal-int +pkg syscall (linux-arm), const DT_CHR ideal-int +pkg syscall (linux-arm), const DT_DIR ideal-int +pkg syscall (linux-arm), const DT_FIFO ideal-int +pkg syscall (linux-arm), const DT_LNK ideal-int +pkg syscall (linux-arm), const DT_REG ideal-int +pkg syscall (linux-arm), const DT_SOCK ideal-int +pkg syscall (linux-arm), const DT_UNKNOWN ideal-int +pkg syscall (linux-arm), const DT_WHT ideal-int +pkg syscall (linux-arm), const EADV Errno +pkg syscall (linux-arm), const EBADE Errno +pkg syscall (linux-arm), const EBADFD Errno +pkg syscall (linux-arm), const EBADMSG Errno +pkg syscall (linux-arm), const EBADR Errno +pkg syscall (linux-arm), const EBADRQC Errno +pkg syscall (linux-arm), const EBADSLT Errno +pkg syscall (linux-arm), const EBFONT Errno +pkg syscall (linux-arm), const ECHO ideal-int +pkg syscall (linux-arm), const ECHOCTL ideal-int +pkg syscall (linux-arm), const ECHOE ideal-int +pkg syscall (linux-arm), const ECHOK ideal-int +pkg syscall (linux-arm), const ECHOKE ideal-int +pkg syscall (linux-arm), const ECHONL ideal-int +pkg syscall (linux-arm), const ECHOPRT ideal-int +pkg syscall (linux-arm), const ECHRNG Errno +pkg syscall (linux-arm), const ECOMM Errno +pkg syscall (linux-arm), const EDEADLOCK Errno +pkg syscall (linux-arm), const EDOTDOT Errno +pkg syscall (linux-arm), const EHWPOISON Errno +pkg syscall (linux-arm), const EISNAM Errno +pkg syscall (linux-arm), const EKEYEXPIRED Errno +pkg syscall (linux-arm), const EKEYREJECTED Errno +pkg syscall (linux-arm), const EKEYREVOKED Errno +pkg syscall (linux-arm), const EL2HLT Errno +pkg syscall (linux-arm), const EL2NSYNC Errno +pkg syscall (linux-arm), const EL3HLT Errno +pkg syscall (linux-arm), const EL3RST Errno +pkg syscall (linux-arm), const ELF_NGREG ideal-int +pkg syscall (linux-arm), const ELF_PRARGSZ ideal-int +pkg syscall (linux-arm), const ELIBACC Errno +pkg syscall (linux-arm), const ELIBBAD Errno +pkg syscall (linux-arm), const ELIBEXEC Errno +pkg syscall (linux-arm), const ELIBMAX Errno +pkg syscall (linux-arm), const ELIBSCN Errno +pkg syscall (linux-arm), const ELNRNG Errno +pkg syscall (linux-arm), const EMEDIUMTYPE Errno +pkg syscall (linux-arm), const EMULTIHOP Errno +pkg syscall (linux-arm), const ENAVAIL Errno +pkg syscall (linux-arm), const ENOANO Errno +pkg syscall (linux-arm), const ENOCSI Errno +pkg syscall (linux-arm), const ENODATA Errno +pkg syscall (linux-arm), const ENOKEY Errno +pkg syscall (linux-arm), const ENOLINK Errno +pkg syscall (linux-arm), const ENOMEDIUM Errno +pkg syscall (linux-arm), const ENONET Errno +pkg syscall (linux-arm), const ENOPKG Errno +pkg syscall (linux-arm), const ENOSR Errno +pkg syscall (linux-arm), const ENOSTR Errno +pkg syscall (linux-arm), const ENOTNAM Errno +pkg syscall (linux-arm), const ENOTRECOVERABLE Errno +pkg syscall (linux-arm), const ENOTUNIQ Errno +pkg syscall (linux-arm), const EOWNERDEAD Errno +pkg syscall (linux-arm), const EPOLLERR ideal-int +pkg syscall (linux-arm), const EPOLLET ideal-int +pkg syscall (linux-arm), const EPOLLHUP ideal-int +pkg syscall (linux-arm), const EPOLLIN ideal-int +pkg syscall (linux-arm), const EPOLLMSG ideal-int +pkg syscall (linux-arm), const EPOLLONESHOT ideal-int +pkg syscall (linux-arm), const EPOLLOUT ideal-int +pkg syscall (linux-arm), const EPOLLPRI ideal-int +pkg syscall (linux-arm), const EPOLLRDBAND ideal-int +pkg syscall (linux-arm), const EPOLLRDHUP ideal-int +pkg syscall (linux-arm), const EPOLLRDNORM ideal-int +pkg syscall (linux-arm), const EPOLLWRBAND ideal-int +pkg syscall (linux-arm), const EPOLLWRNORM ideal-int +pkg syscall (linux-arm), const EPOLL_CLOEXEC ideal-int +pkg syscall (linux-arm), const EPOLL_CTL_ADD ideal-int +pkg syscall (linux-arm), const EPOLL_CTL_DEL ideal-int +pkg syscall (linux-arm), const EPOLL_CTL_MOD ideal-int +pkg syscall (linux-arm), const EPOLL_NONBLOCK ideal-int +pkg syscall (linux-arm), const EPROTO Errno +pkg syscall (linux-arm), const EREMCHG Errno +pkg syscall (linux-arm), const EREMOTEIO Errno +pkg syscall (linux-arm), const ERESTART Errno +pkg syscall (linux-arm), const ERFKILL Errno +pkg syscall (linux-arm), const ESRMNT Errno +pkg syscall (linux-arm), const ESTRPIPE Errno +pkg syscall (linux-arm), const ETH_P_1588 ideal-int +pkg syscall (linux-arm), const ETH_P_8021Q ideal-int +pkg syscall (linux-arm), const ETH_P_802_2 ideal-int +pkg syscall (linux-arm), const ETH_P_802_3 ideal-int +pkg syscall (linux-arm), const ETH_P_AARP ideal-int +pkg syscall (linux-arm), const ETH_P_ALL ideal-int +pkg syscall (linux-arm), const ETH_P_AOE ideal-int +pkg syscall (linux-arm), const ETH_P_ARCNET ideal-int +pkg syscall (linux-arm), const ETH_P_ARP ideal-int +pkg syscall (linux-arm), const ETH_P_ATALK ideal-int +pkg syscall (linux-arm), const ETH_P_ATMFATE ideal-int +pkg syscall (linux-arm), const ETH_P_ATMMPOA ideal-int +pkg syscall (linux-arm), const ETH_P_AX25 ideal-int +pkg syscall (linux-arm), const ETH_P_BPQ ideal-int +pkg syscall (linux-arm), const ETH_P_CAIF ideal-int +pkg syscall (linux-arm), const ETH_P_CAN ideal-int +pkg syscall (linux-arm), const ETH_P_CONTROL ideal-int +pkg syscall (linux-arm), const ETH_P_CUST ideal-int +pkg syscall (linux-arm), const ETH_P_DDCMP ideal-int +pkg syscall (linux-arm), const ETH_P_DEC ideal-int +pkg syscall (linux-arm), const ETH_P_DIAG ideal-int +pkg syscall (linux-arm), const ETH_P_DNA_DL ideal-int +pkg syscall (linux-arm), const ETH_P_DNA_RC ideal-int +pkg syscall (linux-arm), const ETH_P_DNA_RT ideal-int +pkg syscall (linux-arm), const ETH_P_DSA ideal-int +pkg syscall (linux-arm), const ETH_P_ECONET ideal-int +pkg syscall (linux-arm), const ETH_P_EDSA ideal-int +pkg syscall (linux-arm), const ETH_P_FCOE ideal-int +pkg syscall (linux-arm), const ETH_P_FIP ideal-int +pkg syscall (linux-arm), const ETH_P_HDLC ideal-int +pkg syscall (linux-arm), const ETH_P_IEEE802154 ideal-int +pkg syscall (linux-arm), const ETH_P_IEEEPUP ideal-int +pkg syscall (linux-arm), const ETH_P_IEEEPUPAT ideal-int +pkg syscall (linux-arm), const ETH_P_IP ideal-int +pkg syscall (linux-arm), const ETH_P_IPV6 ideal-int +pkg syscall (linux-arm), const ETH_P_IPX ideal-int +pkg syscall (linux-arm), const ETH_P_IRDA ideal-int +pkg syscall (linux-arm), const ETH_P_LAT ideal-int +pkg syscall (linux-arm), const ETH_P_LINK_CTL ideal-int +pkg syscall (linux-arm), const ETH_P_LOCALTALK ideal-int +pkg syscall (linux-arm), const ETH_P_LOOP ideal-int +pkg syscall (linux-arm), const ETH_P_MOBITEX ideal-int +pkg syscall (linux-arm), const ETH_P_MPLS_MC ideal-int +pkg syscall (linux-arm), const ETH_P_MPLS_UC ideal-int +pkg syscall (linux-arm), const ETH_P_PAE ideal-int +pkg syscall (linux-arm), const ETH_P_PAUSE ideal-int +pkg syscall (linux-arm), const ETH_P_PHONET ideal-int +pkg syscall (linux-arm), const ETH_P_PPPTALK ideal-int +pkg syscall (linux-arm), const ETH_P_PPP_DISC ideal-int +pkg syscall (linux-arm), const ETH_P_PPP_MP ideal-int +pkg syscall (linux-arm), const ETH_P_PPP_SES ideal-int +pkg syscall (linux-arm), const ETH_P_PUP ideal-int +pkg syscall (linux-arm), const ETH_P_PUPAT ideal-int +pkg syscall (linux-arm), const ETH_P_RARP ideal-int +pkg syscall (linux-arm), const ETH_P_SCA ideal-int +pkg syscall (linux-arm), const ETH_P_SLOW ideal-int +pkg syscall (linux-arm), const ETH_P_SNAP ideal-int +pkg syscall (linux-arm), const ETH_P_TEB ideal-int +pkg syscall (linux-arm), const ETH_P_TIPC ideal-int +pkg syscall (linux-arm), const ETH_P_TRAILER ideal-int +pkg syscall (linux-arm), const ETH_P_TR_802_2 ideal-int +pkg syscall (linux-arm), const ETH_P_WAN_PPP ideal-int +pkg syscall (linux-arm), const ETH_P_WCCP ideal-int +pkg syscall (linux-arm), const ETH_P_X25 ideal-int +pkg syscall (linux-arm), const ETIME Errno +pkg syscall (linux-arm), const EUCLEAN Errno +pkg syscall (linux-arm), const EUNATCH Errno +pkg syscall (linux-arm), const EXFULL Errno +pkg syscall (linux-arm), const FD_CLOEXEC ideal-int +pkg syscall (linux-arm), const FD_SETSIZE ideal-int +pkg syscall (linux-arm), const FLUSHO ideal-int +pkg syscall (linux-arm), const F_DUPFD ideal-int +pkg syscall (linux-arm), const F_DUPFD_CLOEXEC ideal-int +pkg syscall (linux-arm), const F_EXLCK ideal-int +pkg syscall (linux-arm), const F_GETFD ideal-int +pkg syscall (linux-arm), const F_GETFL ideal-int +pkg syscall (linux-arm), const F_GETLEASE ideal-int +pkg syscall (linux-arm), const F_GETLK ideal-int +pkg syscall (linux-arm), const F_GETLK64 ideal-int +pkg syscall (linux-arm), const F_GETOWN ideal-int +pkg syscall (linux-arm), const F_GETOWN_EX ideal-int +pkg syscall (linux-arm), const F_GETPIPE_SZ ideal-int +pkg syscall (linux-arm), const F_GETSIG ideal-int +pkg syscall (linux-arm), const F_LOCK ideal-int +pkg syscall (linux-arm), const F_NOTIFY ideal-int +pkg syscall (linux-arm), const F_OK ideal-int +pkg syscall (linux-arm), const F_RDLCK ideal-int +pkg syscall (linux-arm), const F_SETFD ideal-int +pkg syscall (linux-arm), const F_SETFL ideal-int +pkg syscall (linux-arm), const F_SETLEASE ideal-int +pkg syscall (linux-arm), const F_SETLK ideal-int +pkg syscall (linux-arm), const F_SETLK64 ideal-int +pkg syscall (linux-arm), const F_SETLKW ideal-int +pkg syscall (linux-arm), const F_SETLKW64 ideal-int +pkg syscall (linux-arm), const F_SETOWN ideal-int +pkg syscall (linux-arm), const F_SETOWN_EX ideal-int +pkg syscall (linux-arm), const F_SETPIPE_SZ ideal-int +pkg syscall (linux-arm), const F_SETSIG ideal-int +pkg syscall (linux-arm), const F_SHLCK ideal-int +pkg syscall (linux-arm), const F_TEST ideal-int +pkg syscall (linux-arm), const F_TLOCK ideal-int +pkg syscall (linux-arm), const F_ULOCK ideal-int +pkg syscall (linux-arm), const F_UNLCK ideal-int +pkg syscall (linux-arm), const F_WRLCK ideal-int +pkg syscall (linux-arm), const HUPCL ideal-int +pkg syscall (linux-arm), const ICANON ideal-int +pkg syscall (linux-arm), const ICRNL ideal-int +pkg syscall (linux-arm), const IEXTEN ideal-int +pkg syscall (linux-arm), const IFA_ADDRESS ideal-int +pkg syscall (linux-arm), const IFA_ANYCAST ideal-int +pkg syscall (linux-arm), const IFA_BROADCAST ideal-int +pkg syscall (linux-arm), const IFA_CACHEINFO ideal-int +pkg syscall (linux-arm), const IFA_F_DADFAILED ideal-int +pkg syscall (linux-arm), const IFA_F_DEPRECATED ideal-int +pkg syscall (linux-arm), const IFA_F_HOMEADDRESS ideal-int +pkg syscall (linux-arm), const IFA_F_NODAD ideal-int +pkg syscall (linux-arm), const IFA_F_OPTIMISTIC ideal-int +pkg syscall (linux-arm), const IFA_F_PERMANENT ideal-int +pkg syscall (linux-arm), const IFA_F_SECONDARY ideal-int +pkg syscall (linux-arm), const IFA_F_TEMPORARY ideal-int +pkg syscall (linux-arm), const IFA_F_TENTATIVE ideal-int +pkg syscall (linux-arm), const IFA_LABEL ideal-int +pkg syscall (linux-arm), const IFA_LOCAL ideal-int +pkg syscall (linux-arm), const IFA_MAX ideal-int +pkg syscall (linux-arm), const IFA_MULTICAST ideal-int +pkg syscall (linux-arm), const IFA_UNSPEC ideal-int +pkg syscall (linux-arm), const IFF_ALLMULTI ideal-int +pkg syscall (linux-arm), const IFF_AUTOMEDIA ideal-int +pkg syscall (linux-arm), const IFF_DEBUG ideal-int +pkg syscall (linux-arm), const IFF_DYNAMIC ideal-int +pkg syscall (linux-arm), const IFF_MASTER ideal-int +pkg syscall (linux-arm), const IFF_NOARP ideal-int +pkg syscall (linux-arm), const IFF_NOTRAILERS ideal-int +pkg syscall (linux-arm), const IFF_NO_PI ideal-int +pkg syscall (linux-arm), const IFF_ONE_QUEUE ideal-int +pkg syscall (linux-arm), const IFF_POINTOPOINT ideal-int +pkg syscall (linux-arm), const IFF_PORTSEL ideal-int +pkg syscall (linux-arm), const IFF_PROMISC ideal-int +pkg syscall (linux-arm), const IFF_RUNNING ideal-int +pkg syscall (linux-arm), const IFF_SLAVE ideal-int +pkg syscall (linux-arm), const IFF_TAP ideal-int +pkg syscall (linux-arm), const IFF_TUN ideal-int +pkg syscall (linux-arm), const IFF_TUN_EXCL ideal-int +pkg syscall (linux-arm), const IFF_VNET_HDR ideal-int +pkg syscall (linux-arm), const IFLA_ADDRESS ideal-int +pkg syscall (linux-arm), const IFLA_BROADCAST ideal-int +pkg syscall (linux-arm), const IFLA_COST ideal-int +pkg syscall (linux-arm), const IFLA_IFALIAS ideal-int +pkg syscall (linux-arm), const IFLA_IFNAME ideal-int +pkg syscall (linux-arm), const IFLA_LINK ideal-int +pkg syscall (linux-arm), const IFLA_LINKINFO ideal-int +pkg syscall (linux-arm), const IFLA_LINKMODE ideal-int +pkg syscall (linux-arm), const IFLA_MAP ideal-int +pkg syscall (linux-arm), const IFLA_MASTER ideal-int +pkg syscall (linux-arm), const IFLA_MAX ideal-int +pkg syscall (linux-arm), const IFLA_MTU ideal-int +pkg syscall (linux-arm), const IFLA_NET_NS_PID ideal-int +pkg syscall (linux-arm), const IFLA_OPERSTATE ideal-int +pkg syscall (linux-arm), const IFLA_PRIORITY ideal-int +pkg syscall (linux-arm), const IFLA_PROTINFO ideal-int +pkg syscall (linux-arm), const IFLA_QDISC ideal-int +pkg syscall (linux-arm), const IFLA_STATS ideal-int +pkg syscall (linux-arm), const IFLA_TXQLEN ideal-int +pkg syscall (linux-arm), const IFLA_UNSPEC ideal-int +pkg syscall (linux-arm), const IFLA_WEIGHT ideal-int +pkg syscall (linux-arm), const IFLA_WIRELESS ideal-int +pkg syscall (linux-arm), const IFNAMSIZ ideal-int +pkg syscall (linux-arm), const IGNBRK ideal-int +pkg syscall (linux-arm), const IGNCR ideal-int +pkg syscall (linux-arm), const IGNPAR ideal-int +pkg syscall (linux-arm), const IMAXBEL ideal-int +pkg syscall (linux-arm), const INLCR ideal-int +pkg syscall (linux-arm), const INPCK ideal-int +pkg syscall (linux-arm), const IN_ACCESS ideal-int +pkg syscall (linux-arm), const IN_ALL_EVENTS ideal-int +pkg syscall (linux-arm), const IN_ATTRIB ideal-int +pkg syscall (linux-arm), const IN_CLASSA_HOST ideal-int +pkg syscall (linux-arm), const IN_CLASSA_MAX ideal-int +pkg syscall (linux-arm), const IN_CLASSA_NET ideal-int +pkg syscall (linux-arm), const IN_CLASSA_NSHIFT ideal-int +pkg syscall (linux-arm), const IN_CLASSB_HOST ideal-int +pkg syscall (linux-arm), const IN_CLASSB_MAX ideal-int +pkg syscall (linux-arm), const IN_CLASSB_NET ideal-int +pkg syscall (linux-arm), const IN_CLASSB_NSHIFT ideal-int +pkg syscall (linux-arm), const IN_CLASSC_HOST ideal-int +pkg syscall (linux-arm), const IN_CLASSC_NET ideal-int +pkg syscall (linux-arm), const IN_CLASSC_NSHIFT ideal-int +pkg syscall (linux-arm), const IN_CLOEXEC ideal-int +pkg syscall (linux-arm), const IN_CLOSE ideal-int +pkg syscall (linux-arm), const IN_CLOSE_NOWRITE ideal-int +pkg syscall (linux-arm), const IN_CLOSE_WRITE ideal-int +pkg syscall (linux-arm), const IN_CREATE ideal-int +pkg syscall (linux-arm), const IN_DELETE ideal-int +pkg syscall (linux-arm), const IN_DELETE_SELF ideal-int +pkg syscall (linux-arm), const IN_DONT_FOLLOW ideal-int +pkg syscall (linux-arm), const IN_EXCL_UNLINK ideal-int +pkg syscall (linux-arm), const IN_IGNORED ideal-int +pkg syscall (linux-arm), const IN_ISDIR ideal-int +pkg syscall (linux-arm), const IN_LOOPBACKNET ideal-int +pkg syscall (linux-arm), const IN_MASK_ADD ideal-int +pkg syscall (linux-arm), const IN_MODIFY ideal-int +pkg syscall (linux-arm), const IN_MOVE ideal-int +pkg syscall (linux-arm), const IN_MOVED_FROM ideal-int +pkg syscall (linux-arm), const IN_MOVED_TO ideal-int +pkg syscall (linux-arm), const IN_MOVE_SELF ideal-int +pkg syscall (linux-arm), const IN_NONBLOCK ideal-int +pkg syscall (linux-arm), const IN_ONESHOT ideal-int +pkg syscall (linux-arm), const IN_ONLYDIR ideal-int +pkg syscall (linux-arm), const IN_OPEN ideal-int +pkg syscall (linux-arm), const IN_Q_OVERFLOW ideal-int +pkg syscall (linux-arm), const IN_UNMOUNT ideal-int +pkg syscall (linux-arm), const IPPROTO_AH ideal-int +pkg syscall (linux-arm), const IPPROTO_COMP ideal-int +pkg syscall (linux-arm), const IPPROTO_DCCP ideal-int +pkg syscall (linux-arm), const IPPROTO_DSTOPTS ideal-int +pkg syscall (linux-arm), const IPPROTO_EGP ideal-int +pkg syscall (linux-arm), const IPPROTO_ENCAP ideal-int +pkg syscall (linux-arm), const IPPROTO_ESP ideal-int +pkg syscall (linux-arm), const IPPROTO_FRAGMENT ideal-int +pkg syscall (linux-arm), const IPPROTO_GRE ideal-int +pkg syscall (linux-arm), const IPPROTO_HOPOPTS ideal-int +pkg syscall (linux-arm), const IPPROTO_ICMP ideal-int +pkg syscall (linux-arm), const IPPROTO_ICMPV6 ideal-int +pkg syscall (linux-arm), const IPPROTO_IDP ideal-int +pkg syscall (linux-arm), const IPPROTO_IGMP ideal-int +pkg syscall (linux-arm), const IPPROTO_IPIP ideal-int +pkg syscall (linux-arm), const IPPROTO_MTP ideal-int +pkg syscall (linux-arm), const IPPROTO_NONE ideal-int +pkg syscall (linux-arm), const IPPROTO_PIM ideal-int +pkg syscall (linux-arm), const IPPROTO_PUP ideal-int +pkg syscall (linux-arm), const IPPROTO_RAW ideal-int +pkg syscall (linux-arm), const IPPROTO_ROUTING ideal-int +pkg syscall (linux-arm), const IPPROTO_RSVP ideal-int +pkg syscall (linux-arm), const IPPROTO_SCTP ideal-int +pkg syscall (linux-arm), const IPPROTO_TP ideal-int +pkg syscall (linux-arm), const IPPROTO_UDPLITE ideal-int +pkg syscall (linux-arm), const IPV6_2292DSTOPTS ideal-int +pkg syscall (linux-arm), const IPV6_2292HOPLIMIT ideal-int +pkg syscall (linux-arm), const IPV6_2292HOPOPTS ideal-int +pkg syscall (linux-arm), const IPV6_2292PKTINFO ideal-int +pkg syscall (linux-arm), const IPV6_2292PKTOPTIONS ideal-int +pkg syscall (linux-arm), const IPV6_2292RTHDR ideal-int +pkg syscall (linux-arm), const IPV6_ADDRFORM ideal-int +pkg syscall (linux-arm), const IPV6_ADD_MEMBERSHIP ideal-int +pkg syscall (linux-arm), const IPV6_AUTHHDR ideal-int +pkg syscall (linux-arm), const IPV6_CHECKSUM ideal-int +pkg syscall (linux-arm), const IPV6_DROP_MEMBERSHIP ideal-int +pkg syscall (linux-arm), const IPV6_DSTOPTS ideal-int +pkg syscall (linux-arm), const IPV6_HOPLIMIT ideal-int +pkg syscall (linux-arm), const IPV6_HOPOPTS ideal-int +pkg syscall (linux-arm), const IPV6_IPSEC_POLICY ideal-int +pkg syscall (linux-arm), const IPV6_JOIN_ANYCAST ideal-int +pkg syscall (linux-arm), const IPV6_LEAVE_ANYCAST ideal-int +pkg syscall (linux-arm), const IPV6_MTU ideal-int +pkg syscall (linux-arm), const IPV6_MTU_DISCOVER ideal-int +pkg syscall (linux-arm), const IPV6_NEXTHOP ideal-int +pkg syscall (linux-arm), const IPV6_PKTINFO ideal-int +pkg syscall (linux-arm), const IPV6_PMTUDISC_DO ideal-int +pkg syscall (linux-arm), const IPV6_PMTUDISC_DONT ideal-int +pkg syscall (linux-arm), const IPV6_PMTUDISC_PROBE ideal-int +pkg syscall (linux-arm), const IPV6_PMTUDISC_WANT ideal-int +pkg syscall (linux-arm), const IPV6_RECVDSTOPTS ideal-int +pkg syscall (linux-arm), const IPV6_RECVERR ideal-int +pkg syscall (linux-arm), const IPV6_RECVHOPLIMIT ideal-int +pkg syscall (linux-arm), const IPV6_RECVHOPOPTS ideal-int +pkg syscall (linux-arm), const IPV6_RECVPKTINFO ideal-int +pkg syscall (linux-arm), const IPV6_RECVRTHDR ideal-int +pkg syscall (linux-arm), const IPV6_RECVTCLASS ideal-int +pkg syscall (linux-arm), const IPV6_ROUTER_ALERT ideal-int +pkg syscall (linux-arm), const IPV6_RTHDR ideal-int +pkg syscall (linux-arm), const IPV6_RTHDRDSTOPTS ideal-int +pkg syscall (linux-arm), const IPV6_RTHDR_LOOSE ideal-int +pkg syscall (linux-arm), const IPV6_RTHDR_STRICT ideal-int +pkg syscall (linux-arm), const IPV6_RTHDR_TYPE_0 ideal-int +pkg syscall (linux-arm), const IPV6_RXDSTOPTS ideal-int +pkg syscall (linux-arm), const IPV6_RXHOPOPTS ideal-int +pkg syscall (linux-arm), const IPV6_TCLASS ideal-int +pkg syscall (linux-arm), const IPV6_XFRM_POLICY ideal-int +pkg syscall (linux-arm), const IP_ADD_SOURCE_MEMBERSHIP ideal-int +pkg syscall (linux-arm), const IP_BLOCK_SOURCE ideal-int +pkg syscall (linux-arm), const IP_DEFAULT_MULTICAST_LOOP ideal-int +pkg syscall (linux-arm), const IP_DEFAULT_MULTICAST_TTL ideal-int +pkg syscall (linux-arm), const IP_DF ideal-int +pkg syscall (linux-arm), const IP_DROP_SOURCE_MEMBERSHIP ideal-int +pkg syscall (linux-arm), const IP_FREEBIND ideal-int +pkg syscall (linux-arm), const IP_HDRINCL ideal-int +pkg syscall (linux-arm), const IP_IPSEC_POLICY ideal-int +pkg syscall (linux-arm), const IP_MAXPACKET ideal-int +pkg syscall (linux-arm), const IP_MAX_MEMBERSHIPS ideal-int +pkg syscall (linux-arm), const IP_MF ideal-int +pkg syscall (linux-arm), const IP_MINTTL ideal-int +pkg syscall (linux-arm), const IP_MSFILTER ideal-int +pkg syscall (linux-arm), const IP_MSS ideal-int +pkg syscall (linux-arm), const IP_MTU ideal-int +pkg syscall (linux-arm), const IP_MTU_DISCOVER ideal-int +pkg syscall (linux-arm), const IP_OFFMASK ideal-int +pkg syscall (linux-arm), const IP_OPTIONS ideal-int +pkg syscall (linux-arm), const IP_ORIGDSTADDR ideal-int +pkg syscall (linux-arm), const IP_PASSSEC ideal-int +pkg syscall (linux-arm), const IP_PKTINFO ideal-int +pkg syscall (linux-arm), const IP_PKTOPTIONS ideal-int +pkg syscall (linux-arm), const IP_PMTUDISC ideal-int +pkg syscall (linux-arm), const IP_PMTUDISC_DO ideal-int +pkg syscall (linux-arm), const IP_PMTUDISC_DONT ideal-int +pkg syscall (linux-arm), const IP_PMTUDISC_PROBE ideal-int +pkg syscall (linux-arm), const IP_PMTUDISC_WANT ideal-int +pkg syscall (linux-arm), const IP_RECVERR ideal-int +pkg syscall (linux-arm), const IP_RECVOPTS ideal-int +pkg syscall (linux-arm), const IP_RECVORIGDSTADDR ideal-int +pkg syscall (linux-arm), const IP_RECVRETOPTS ideal-int +pkg syscall (linux-arm), const IP_RECVTOS ideal-int +pkg syscall (linux-arm), const IP_RECVTTL ideal-int +pkg syscall (linux-arm), const IP_RETOPTS ideal-int +pkg syscall (linux-arm), const IP_RF ideal-int +pkg syscall (linux-arm), const IP_ROUTER_ALERT ideal-int +pkg syscall (linux-arm), const IP_TRANSPARENT ideal-int +pkg syscall (linux-arm), const IP_UNBLOCK_SOURCE ideal-int +pkg syscall (linux-arm), const IP_XFRM_POLICY ideal-int +pkg syscall (linux-arm), const ISIG ideal-int +pkg syscall (linux-arm), const ISTRIP ideal-int +pkg syscall (linux-arm), const IUCLC ideal-int +pkg syscall (linux-arm), const IUTF8 ideal-int +pkg syscall (linux-arm), const IXANY ideal-int +pkg syscall (linux-arm), const IXOFF ideal-int +pkg syscall (linux-arm), const IXON ideal-int +pkg syscall (linux-arm), const LINUX_REBOOT_CMD_CAD_OFF ideal-int +pkg syscall (linux-arm), const LINUX_REBOOT_CMD_CAD_ON ideal-int +pkg syscall (linux-arm), const LINUX_REBOOT_CMD_HALT ideal-int +pkg syscall (linux-arm), const LINUX_REBOOT_CMD_KEXEC ideal-int +pkg syscall (linux-arm), const LINUX_REBOOT_CMD_POWER_OFF ideal-int +pkg syscall (linux-arm), const LINUX_REBOOT_CMD_RESTART ideal-int +pkg syscall (linux-arm), const LINUX_REBOOT_CMD_RESTART2 ideal-int +pkg syscall (linux-arm), const LINUX_REBOOT_CMD_SW_SUSPEND ideal-int +pkg syscall (linux-arm), const LINUX_REBOOT_MAGIC1 ideal-int +pkg syscall (linux-arm), const LINUX_REBOOT_MAGIC2 ideal-int +pkg syscall (linux-arm), const LOCK_EX ideal-int +pkg syscall (linux-arm), const LOCK_NB ideal-int +pkg syscall (linux-arm), const LOCK_SH ideal-int +pkg syscall (linux-arm), const LOCK_UN ideal-int +pkg syscall (linux-arm), const MADV_DOFORK ideal-int +pkg syscall (linux-arm), const MADV_DONTFORK ideal-int +pkg syscall (linux-arm), const MADV_DONTNEED ideal-int +pkg syscall (linux-arm), const MADV_HUGEPAGE ideal-int +pkg syscall (linux-arm), const MADV_HWPOISON ideal-int +pkg syscall (linux-arm), const MADV_MERGEABLE ideal-int +pkg syscall (linux-arm), const MADV_NOHUGEPAGE ideal-int +pkg syscall (linux-arm), const MADV_NORMAL ideal-int +pkg syscall (linux-arm), const MADV_RANDOM ideal-int +pkg syscall (linux-arm), const MADV_REMOVE ideal-int +pkg syscall (linux-arm), const MADV_SEQUENTIAL ideal-int +pkg syscall (linux-arm), const MADV_UNMERGEABLE ideal-int +pkg syscall (linux-arm), const MADV_WILLNEED ideal-int +pkg syscall (linux-arm), const MAP_ANON ideal-int +pkg syscall (linux-arm), const MAP_ANONYMOUS ideal-int +pkg syscall (linux-arm), const MAP_DENYWRITE ideal-int +pkg syscall (linux-arm), const MAP_EXECUTABLE ideal-int +pkg syscall (linux-arm), const MAP_FILE ideal-int +pkg syscall (linux-arm), const MAP_FIXED ideal-int +pkg syscall (linux-arm), const MAP_GROWSDOWN ideal-int +pkg syscall (linux-arm), const MAP_LOCKED ideal-int +pkg syscall (linux-arm), const MAP_NONBLOCK ideal-int +pkg syscall (linux-arm), const MAP_NORESERVE ideal-int +pkg syscall (linux-arm), const MAP_POPULATE ideal-int +pkg syscall (linux-arm), const MAP_PRIVATE ideal-int +pkg syscall (linux-arm), const MAP_SHARED ideal-int +pkg syscall (linux-arm), const MAP_TYPE ideal-int +pkg syscall (linux-arm), const MCL_CURRENT ideal-int +pkg syscall (linux-arm), const MCL_FUTURE ideal-int +pkg syscall (linux-arm), const MNT_DETACH ideal-int +pkg syscall (linux-arm), const MNT_EXPIRE ideal-int +pkg syscall (linux-arm), const MNT_FORCE ideal-int +pkg syscall (linux-arm), const MSG_CMSG_CLOEXEC ideal-int +pkg syscall (linux-arm), const MSG_CONFIRM ideal-int +pkg syscall (linux-arm), const MSG_CTRUNC ideal-int +pkg syscall (linux-arm), const MSG_DONTROUTE ideal-int +pkg syscall (linux-arm), const MSG_DONTWAIT ideal-int +pkg syscall (linux-arm), const MSG_EOR ideal-int +pkg syscall (linux-arm), const MSG_ERRQUEUE ideal-int +pkg syscall (linux-arm), const MSG_FIN ideal-int +pkg syscall (linux-arm), const MSG_MORE ideal-int +pkg syscall (linux-arm), const MSG_NOSIGNAL ideal-int +pkg syscall (linux-arm), const MSG_OOB ideal-int +pkg syscall (linux-arm), const MSG_PEEK ideal-int +pkg syscall (linux-arm), const MSG_PROXY ideal-int +pkg syscall (linux-arm), const MSG_RST ideal-int +pkg syscall (linux-arm), const MSG_SYN ideal-int +pkg syscall (linux-arm), const MSG_TRUNC ideal-int +pkg syscall (linux-arm), const MSG_TRYHARD ideal-int +pkg syscall (linux-arm), const MSG_WAITALL ideal-int +pkg syscall (linux-arm), const MSG_WAITFORONE ideal-int +pkg syscall (linux-arm), const MS_ACTIVE ideal-int +pkg syscall (linux-arm), const MS_ASYNC ideal-int +pkg syscall (linux-arm), const MS_BIND ideal-int +pkg syscall (linux-arm), const MS_DIRSYNC ideal-int +pkg syscall (linux-arm), const MS_INVALIDATE ideal-int +pkg syscall (linux-arm), const MS_I_VERSION ideal-int +pkg syscall (linux-arm), const MS_KERNMOUNT ideal-int +pkg syscall (linux-arm), const MS_MANDLOCK ideal-int +pkg syscall (linux-arm), const MS_MGC_MSK ideal-int +pkg syscall (linux-arm), const MS_MGC_VAL ideal-int +pkg syscall (linux-arm), const MS_MOVE ideal-int +pkg syscall (linux-arm), const MS_NOATIME ideal-int +pkg syscall (linux-arm), const MS_NODEV ideal-int +pkg syscall (linux-arm), const MS_NODIRATIME ideal-int +pkg syscall (linux-arm), const MS_NOEXEC ideal-int +pkg syscall (linux-arm), const MS_NOSUID ideal-int +pkg syscall (linux-arm), const MS_NOUSER ideal-int +pkg syscall (linux-arm), const MS_POSIXACL ideal-int +pkg syscall (linux-arm), const MS_PRIVATE ideal-int +pkg syscall (linux-arm), const MS_RDONLY ideal-int +pkg syscall (linux-arm), const MS_REC ideal-int +pkg syscall (linux-arm), const MS_RELATIME ideal-int +pkg syscall (linux-arm), const MS_REMOUNT ideal-int +pkg syscall (linux-arm), const MS_RMT_MASK ideal-int +pkg syscall (linux-arm), const MS_SHARED ideal-int +pkg syscall (linux-arm), const MS_SILENT ideal-int +pkg syscall (linux-arm), const MS_SLAVE ideal-int +pkg syscall (linux-arm), const MS_STRICTATIME ideal-int +pkg syscall (linux-arm), const MS_SYNC ideal-int +pkg syscall (linux-arm), const MS_SYNCHRONOUS ideal-int +pkg syscall (linux-arm), const MS_UNBINDABLE ideal-int +pkg syscall (linux-arm), const NAME_MAX ideal-int +pkg syscall (linux-arm), const NETLINK_ADD_MEMBERSHIP ideal-int +pkg syscall (linux-arm), const NETLINK_AUDIT ideal-int +pkg syscall (linux-arm), const NETLINK_BROADCAST_ERROR ideal-int +pkg syscall (linux-arm), const NETLINK_CONNECTOR ideal-int +pkg syscall (linux-arm), const NETLINK_DNRTMSG ideal-int +pkg syscall (linux-arm), const NETLINK_DROP_MEMBERSHIP ideal-int +pkg syscall (linux-arm), const NETLINK_ECRYPTFS ideal-int +pkg syscall (linux-arm), const NETLINK_FIB_LOOKUP ideal-int +pkg syscall (linux-arm), const NETLINK_FIREWALL ideal-int +pkg syscall (linux-arm), const NETLINK_GENERIC ideal-int +pkg syscall (linux-arm), const NETLINK_INET_DIAG ideal-int +pkg syscall (linux-arm), const NETLINK_IP6_FW ideal-int +pkg syscall (linux-arm), const NETLINK_ISCSI ideal-int +pkg syscall (linux-arm), const NETLINK_KOBJECT_UEVENT ideal-int +pkg syscall (linux-arm), const NETLINK_NETFILTER ideal-int +pkg syscall (linux-arm), const NETLINK_NFLOG ideal-int +pkg syscall (linux-arm), const NETLINK_NO_ENOBUFS ideal-int +pkg syscall (linux-arm), const NETLINK_PKTINFO ideal-int +pkg syscall (linux-arm), const NETLINK_RDMA ideal-int +pkg syscall (linux-arm), const NETLINK_ROUTE ideal-int +pkg syscall (linux-arm), const NETLINK_SCSITRANSPORT ideal-int +pkg syscall (linux-arm), const NETLINK_SELINUX ideal-int +pkg syscall (linux-arm), const NETLINK_UNUSED ideal-int +pkg syscall (linux-arm), const NETLINK_USERSOCK ideal-int +pkg syscall (linux-arm), const NETLINK_XFRM ideal-int +pkg syscall (linux-arm), const NLA_ALIGNTO ideal-int +pkg syscall (linux-arm), const NLA_F_NESTED ideal-int +pkg syscall (linux-arm), const NLA_F_NET_BYTEORDER ideal-int +pkg syscall (linux-arm), const NLA_HDRLEN ideal-int +pkg syscall (linux-arm), const NLMSG_ALIGNTO ideal-int +pkg syscall (linux-arm), const NLMSG_DONE ideal-int +pkg syscall (linux-arm), const NLMSG_ERROR ideal-int +pkg syscall (linux-arm), const NLMSG_HDRLEN ideal-int +pkg syscall (linux-arm), const NLMSG_MIN_TYPE ideal-int +pkg syscall (linux-arm), const NLMSG_NOOP ideal-int +pkg syscall (linux-arm), const NLMSG_OVERRUN ideal-int +pkg syscall (linux-arm), const NLM_F_ACK ideal-int +pkg syscall (linux-arm), const NLM_F_APPEND ideal-int +pkg syscall (linux-arm), const NLM_F_ATOMIC ideal-int +pkg syscall (linux-arm), const NLM_F_CREATE ideal-int +pkg syscall (linux-arm), const NLM_F_DUMP ideal-int +pkg syscall (linux-arm), const NLM_F_ECHO ideal-int +pkg syscall (linux-arm), const NLM_F_EXCL ideal-int +pkg syscall (linux-arm), const NLM_F_MATCH ideal-int +pkg syscall (linux-arm), const NLM_F_MULTI ideal-int +pkg syscall (linux-arm), const NLM_F_REPLACE ideal-int +pkg syscall (linux-arm), const NLM_F_REQUEST ideal-int +pkg syscall (linux-arm), const NLM_F_ROOT ideal-int +pkg syscall (linux-arm), const NOFLSH ideal-int +pkg syscall (linux-arm), const OCRNL ideal-int +pkg syscall (linux-arm), const OFDEL ideal-int +pkg syscall (linux-arm), const OFILL ideal-int +pkg syscall (linux-arm), const OLCUC ideal-int +pkg syscall (linux-arm), const ONLCR ideal-int +pkg syscall (linux-arm), const ONLRET ideal-int +pkg syscall (linux-arm), const ONOCR ideal-int +pkg syscall (linux-arm), const OPOST ideal-int +pkg syscall (linux-arm), const O_ACCMODE ideal-int +pkg syscall (linux-arm), const O_DIRECT ideal-int +pkg syscall (linux-arm), const O_DIRECTORY ideal-int +pkg syscall (linux-arm), const O_DSYNC ideal-int +pkg syscall (linux-arm), const O_FSYNC ideal-int +pkg syscall (linux-arm), const O_LARGEFILE ideal-int +pkg syscall (linux-arm), const O_NDELAY ideal-int +pkg syscall (linux-arm), const O_NOATIME ideal-int +pkg syscall (linux-arm), const O_NOFOLLOW ideal-int +pkg syscall (linux-arm), const O_RSYNC ideal-int +pkg syscall (linux-arm), const PACKET_ADD_MEMBERSHIP ideal-int +pkg syscall (linux-arm), const PACKET_BROADCAST ideal-int +pkg syscall (linux-arm), const PACKET_DROP_MEMBERSHIP ideal-int +pkg syscall (linux-arm), const PACKET_FASTROUTE ideal-int +pkg syscall (linux-arm), const PACKET_HOST ideal-int +pkg syscall (linux-arm), const PACKET_LOOPBACK ideal-int +pkg syscall (linux-arm), const PACKET_MR_ALLMULTI ideal-int +pkg syscall (linux-arm), const PACKET_MR_MULTICAST ideal-int +pkg syscall (linux-arm), const PACKET_MR_PROMISC ideal-int +pkg syscall (linux-arm), const PACKET_MULTICAST ideal-int +pkg syscall (linux-arm), const PACKET_OTHERHOST ideal-int +pkg syscall (linux-arm), const PACKET_OUTGOING ideal-int +pkg syscall (linux-arm), const PACKET_RECV_OUTPUT ideal-int +pkg syscall (linux-arm), const PACKET_RX_RING ideal-int +pkg syscall (linux-arm), const PACKET_STATISTICS ideal-int +pkg syscall (linux-arm), const PARENB ideal-int +pkg syscall (linux-arm), const PARMRK ideal-int +pkg syscall (linux-arm), const PARODD ideal-int +pkg syscall (linux-arm), const PENDIN ideal-int +pkg syscall (linux-arm), const PROT_EXEC ideal-int +pkg syscall (linux-arm), const PROT_GROWSDOWN ideal-int +pkg syscall (linux-arm), const PROT_GROWSUP ideal-int +pkg syscall (linux-arm), const PROT_NONE ideal-int +pkg syscall (linux-arm), const PROT_READ ideal-int +pkg syscall (linux-arm), const PROT_WRITE ideal-int +pkg syscall (linux-arm), const PR_CAPBSET_DROP ideal-int +pkg syscall (linux-arm), const PR_CAPBSET_READ ideal-int +pkg syscall (linux-arm), const PR_CLEAR_SECCOMP_FILTER ideal-int +pkg syscall (linux-arm), const PR_ENDIAN_BIG ideal-int +pkg syscall (linux-arm), const PR_ENDIAN_LITTLE ideal-int +pkg syscall (linux-arm), const PR_ENDIAN_PPC_LITTLE ideal-int +pkg syscall (linux-arm), const PR_FPEMU_NOPRINT ideal-int +pkg syscall (linux-arm), const PR_FPEMU_SIGFPE ideal-int +pkg syscall (linux-arm), const PR_FP_EXC_ASYNC ideal-int +pkg syscall (linux-arm), const PR_FP_EXC_DISABLED ideal-int +pkg syscall (linux-arm), const PR_FP_EXC_DIV ideal-int +pkg syscall (linux-arm), const PR_FP_EXC_INV ideal-int +pkg syscall (linux-arm), const PR_FP_EXC_NONRECOV ideal-int +pkg syscall (linux-arm), const PR_FP_EXC_OVF ideal-int +pkg syscall (linux-arm), const PR_FP_EXC_PRECISE ideal-int +pkg syscall (linux-arm), const PR_FP_EXC_RES ideal-int +pkg syscall (linux-arm), const PR_FP_EXC_SW_ENABLE ideal-int +pkg syscall (linux-arm), const PR_FP_EXC_UND ideal-int +pkg syscall (linux-arm), const PR_GET_DUMPABLE ideal-int +pkg syscall (linux-arm), const PR_GET_ENDIAN ideal-int +pkg syscall (linux-arm), const PR_GET_FPEMU ideal-int +pkg syscall (linux-arm), const PR_GET_FPEXC ideal-int +pkg syscall (linux-arm), const PR_GET_KEEPCAPS ideal-int +pkg syscall (linux-arm), const PR_GET_NAME ideal-int +pkg syscall (linux-arm), const PR_GET_PDEATHSIG ideal-int +pkg syscall (linux-arm), const PR_GET_SECCOMP ideal-int +pkg syscall (linux-arm), const PR_GET_SECCOMP_FILTER ideal-int +pkg syscall (linux-arm), const PR_GET_SECUREBITS ideal-int +pkg syscall (linux-arm), const PR_GET_TIMERSLACK ideal-int +pkg syscall (linux-arm), const PR_GET_TIMING ideal-int +pkg syscall (linux-arm), const PR_GET_TSC ideal-int +pkg syscall (linux-arm), const PR_GET_UNALIGN ideal-int +pkg syscall (linux-arm), const PR_MCE_KILL ideal-int +pkg syscall (linux-arm), const PR_MCE_KILL_CLEAR ideal-int +pkg syscall (linux-arm), const PR_MCE_KILL_DEFAULT ideal-int +pkg syscall (linux-arm), const PR_MCE_KILL_EARLY ideal-int +pkg syscall (linux-arm), const PR_MCE_KILL_GET ideal-int +pkg syscall (linux-arm), const PR_MCE_KILL_LATE ideal-int +pkg syscall (linux-arm), const PR_MCE_KILL_SET ideal-int +pkg syscall (linux-arm), const PR_SECCOMP_FILTER_EVENT ideal-int +pkg syscall (linux-arm), const PR_SECCOMP_FILTER_SYSCALL ideal-int +pkg syscall (linux-arm), const PR_SET_DUMPABLE ideal-int +pkg syscall (linux-arm), const PR_SET_ENDIAN ideal-int +pkg syscall (linux-arm), const PR_SET_FPEMU ideal-int +pkg syscall (linux-arm), const PR_SET_FPEXC ideal-int +pkg syscall (linux-arm), const PR_SET_KEEPCAPS ideal-int +pkg syscall (linux-arm), const PR_SET_NAME ideal-int +pkg syscall (linux-arm), const PR_SET_PDEATHSIG ideal-int +pkg syscall (linux-arm), const PR_SET_PTRACER ideal-int +pkg syscall (linux-arm), const PR_SET_SECCOMP ideal-int +pkg syscall (linux-arm), const PR_SET_SECCOMP_FILTER ideal-int +pkg syscall (linux-arm), const PR_SET_SECUREBITS ideal-int +pkg syscall (linux-arm), const PR_SET_TIMERSLACK ideal-int +pkg syscall (linux-arm), const PR_SET_TIMING ideal-int +pkg syscall (linux-arm), const PR_SET_TSC ideal-int +pkg syscall (linux-arm), const PR_SET_UNALIGN ideal-int +pkg syscall (linux-arm), const PR_TASK_PERF_EVENTS_DISABLE ideal-int +pkg syscall (linux-arm), const PR_TASK_PERF_EVENTS_ENABLE ideal-int +pkg syscall (linux-arm), const PR_TIMING_STATISTICAL ideal-int +pkg syscall (linux-arm), const PR_TIMING_TIMESTAMP ideal-int +pkg syscall (linux-arm), const PR_TSC_ENABLE ideal-int +pkg syscall (linux-arm), const PR_TSC_SIGSEGV ideal-int +pkg syscall (linux-arm), const PR_UNALIGN_NOPRINT ideal-int +pkg syscall (linux-arm), const PR_UNALIGN_SIGBUS ideal-int +pkg syscall (linux-arm), const PTRACE_ATTACH ideal-int +pkg syscall (linux-arm), const PTRACE_CONT ideal-int +pkg syscall (linux-arm), const PTRACE_DETACH ideal-int +pkg syscall (linux-arm), const PTRACE_EVENT_CLONE ideal-int +pkg syscall (linux-arm), const PTRACE_EVENT_EXEC ideal-int +pkg syscall (linux-arm), const PTRACE_EVENT_EXIT ideal-int +pkg syscall (linux-arm), const PTRACE_EVENT_FORK ideal-int +pkg syscall (linux-arm), const PTRACE_EVENT_VFORK ideal-int +pkg syscall (linux-arm), const PTRACE_EVENT_VFORK_DONE ideal-int +pkg syscall (linux-arm), const PTRACE_GETCRUNCHREGS ideal-int +pkg syscall (linux-arm), const PTRACE_GETEVENTMSG ideal-int +pkg syscall (linux-arm), const PTRACE_GETFPREGS ideal-int +pkg syscall (linux-arm), const PTRACE_GETHBPREGS ideal-int +pkg syscall (linux-arm), const PTRACE_GETREGS ideal-int +pkg syscall (linux-arm), const PTRACE_GETREGSET ideal-int +pkg syscall (linux-arm), const PTRACE_GETSIGINFO ideal-int +pkg syscall (linux-arm), const PTRACE_GETVFPREGS ideal-int +pkg syscall (linux-arm), const PTRACE_GETWMMXREGS ideal-int +pkg syscall (linux-arm), const PTRACE_GET_THREAD_AREA ideal-int +pkg syscall (linux-arm), const PTRACE_KILL ideal-int +pkg syscall (linux-arm), const PTRACE_OLDSETOPTIONS ideal-int +pkg syscall (linux-arm), const PTRACE_O_MASK ideal-int +pkg syscall (linux-arm), const PTRACE_O_TRACECLONE ideal-int +pkg syscall (linux-arm), const PTRACE_O_TRACEEXEC ideal-int +pkg syscall (linux-arm), const PTRACE_O_TRACEEXIT ideal-int +pkg syscall (linux-arm), const PTRACE_O_TRACEFORK ideal-int +pkg syscall (linux-arm), const PTRACE_O_TRACESYSGOOD ideal-int +pkg syscall (linux-arm), const PTRACE_O_TRACEVFORK ideal-int +pkg syscall (linux-arm), const PTRACE_O_TRACEVFORKDONE ideal-int +pkg syscall (linux-arm), const PTRACE_PEEKDATA ideal-int +pkg syscall (linux-arm), const PTRACE_PEEKTEXT ideal-int +pkg syscall (linux-arm), const PTRACE_PEEKUSR ideal-int +pkg syscall (linux-arm), const PTRACE_POKEDATA ideal-int +pkg syscall (linux-arm), const PTRACE_POKETEXT ideal-int +pkg syscall (linux-arm), const PTRACE_POKEUSR ideal-int +pkg syscall (linux-arm), const PTRACE_SETCRUNCHREGS ideal-int +pkg syscall (linux-arm), const PTRACE_SETFPREGS ideal-int +pkg syscall (linux-arm), const PTRACE_SETHBPREGS ideal-int +pkg syscall (linux-arm), const PTRACE_SETOPTIONS ideal-int +pkg syscall (linux-arm), const PTRACE_SETREGS ideal-int +pkg syscall (linux-arm), const PTRACE_SETREGSET ideal-int +pkg syscall (linux-arm), const PTRACE_SETSIGINFO ideal-int +pkg syscall (linux-arm), const PTRACE_SETVFPREGS ideal-int +pkg syscall (linux-arm), const PTRACE_SETWMMXREGS ideal-int +pkg syscall (linux-arm), const PTRACE_SET_SYSCALL ideal-int +pkg syscall (linux-arm), const PTRACE_SINGLESTEP ideal-int +pkg syscall (linux-arm), const PTRACE_SYSCALL ideal-int +pkg syscall (linux-arm), const PTRACE_TRACEME ideal-int +pkg syscall (linux-arm), const PT_DATA_ADDR ideal-int +pkg syscall (linux-arm), const PT_TEXT_ADDR ideal-int +pkg syscall (linux-arm), const PT_TEXT_END_ADDR ideal-int +pkg syscall (linux-arm), const PathMax ideal-int +pkg syscall (linux-arm), const RLIMIT_AS ideal-int +pkg syscall (linux-arm), const RLIMIT_CORE ideal-int +pkg syscall (linux-arm), const RLIMIT_CPU ideal-int +pkg syscall (linux-arm), const RLIMIT_DATA ideal-int +pkg syscall (linux-arm), const RLIMIT_FSIZE ideal-int +pkg syscall (linux-arm), const RLIMIT_NOFILE ideal-int +pkg syscall (linux-arm), const RLIMIT_STACK ideal-int +pkg syscall (linux-arm), const RLIM_INFINITY ideal-int +pkg syscall (linux-arm), const RTAX_ADVMSS ideal-int +pkg syscall (linux-arm), const RTAX_CWND ideal-int +pkg syscall (linux-arm), const RTAX_FEATURES ideal-int +pkg syscall (linux-arm), const RTAX_FEATURE_ALLFRAG ideal-int +pkg syscall (linux-arm), const RTAX_FEATURE_ECN ideal-int +pkg syscall (linux-arm), const RTAX_FEATURE_SACK ideal-int +pkg syscall (linux-arm), const RTAX_FEATURE_TIMESTAMP ideal-int +pkg syscall (linux-arm), const RTAX_HOPLIMIT ideal-int +pkg syscall (linux-arm), const RTAX_INITCWND ideal-int +pkg syscall (linux-arm), const RTAX_INITRWND ideal-int +pkg syscall (linux-arm), const RTAX_LOCK ideal-int +pkg syscall (linux-arm), const RTAX_MAX ideal-int +pkg syscall (linux-arm), const RTAX_MTU ideal-int +pkg syscall (linux-arm), const RTAX_REORDERING ideal-int +pkg syscall (linux-arm), const RTAX_RTO_MIN ideal-int +pkg syscall (linux-arm), const RTAX_RTT ideal-int +pkg syscall (linux-arm), const RTAX_RTTVAR ideal-int +pkg syscall (linux-arm), const RTAX_SSTHRESH ideal-int +pkg syscall (linux-arm), const RTAX_UNSPEC ideal-int +pkg syscall (linux-arm), const RTAX_WINDOW ideal-int +pkg syscall (linux-arm), const RTA_ALIGNTO ideal-int +pkg syscall (linux-arm), const RTA_CACHEINFO ideal-int +pkg syscall (linux-arm), const RTA_DST ideal-int +pkg syscall (linux-arm), const RTA_FLOW ideal-int +pkg syscall (linux-arm), const RTA_GATEWAY ideal-int +pkg syscall (linux-arm), const RTA_IIF ideal-int +pkg syscall (linux-arm), const RTA_MAX ideal-int +pkg syscall (linux-arm), const RTA_METRICS ideal-int +pkg syscall (linux-arm), const RTA_MULTIPATH ideal-int +pkg syscall (linux-arm), const RTA_OIF ideal-int +pkg syscall (linux-arm), const RTA_PREFSRC ideal-int +pkg syscall (linux-arm), const RTA_PRIORITY ideal-int +pkg syscall (linux-arm), const RTA_SRC ideal-int +pkg syscall (linux-arm), const RTA_TABLE ideal-int +pkg syscall (linux-arm), const RTA_UNSPEC ideal-int +pkg syscall (linux-arm), const RTCF_DIRECTSRC ideal-int +pkg syscall (linux-arm), const RTCF_DOREDIRECT ideal-int +pkg syscall (linux-arm), const RTCF_LOG ideal-int +pkg syscall (linux-arm), const RTCF_MASQ ideal-int +pkg syscall (linux-arm), const RTCF_NAT ideal-int +pkg syscall (linux-arm), const RTCF_VALVE ideal-int +pkg syscall (linux-arm), const RTF_ADDRCLASSMASK ideal-int +pkg syscall (linux-arm), const RTF_ADDRCONF ideal-int +pkg syscall (linux-arm), const RTF_ALLONLINK ideal-int +pkg syscall (linux-arm), const RTF_BROADCAST ideal-int +pkg syscall (linux-arm), const RTF_CACHE ideal-int +pkg syscall (linux-arm), const RTF_DEFAULT ideal-int +pkg syscall (linux-arm), const RTF_DYNAMIC ideal-int +pkg syscall (linux-arm), const RTF_FLOW ideal-int +pkg syscall (linux-arm), const RTF_GATEWAY ideal-int +pkg syscall (linux-arm), const RTF_HOST ideal-int +pkg syscall (linux-arm), const RTF_INTERFACE ideal-int +pkg syscall (linux-arm), const RTF_IRTT ideal-int +pkg syscall (linux-arm), const RTF_LINKRT ideal-int +pkg syscall (linux-arm), const RTF_LOCAL ideal-int +pkg syscall (linux-arm), const RTF_MODIFIED ideal-int +pkg syscall (linux-arm), const RTF_MSS ideal-int +pkg syscall (linux-arm), const RTF_MTU ideal-int +pkg syscall (linux-arm), const RTF_MULTICAST ideal-int +pkg syscall (linux-arm), const RTF_NAT ideal-int +pkg syscall (linux-arm), const RTF_NOFORWARD ideal-int +pkg syscall (linux-arm), const RTF_NONEXTHOP ideal-int +pkg syscall (linux-arm), const RTF_NOPMTUDISC ideal-int +pkg syscall (linux-arm), const RTF_POLICY ideal-int +pkg syscall (linux-arm), const RTF_REINSTATE ideal-int +pkg syscall (linux-arm), const RTF_REJECT ideal-int +pkg syscall (linux-arm), const RTF_STATIC ideal-int +pkg syscall (linux-arm), const RTF_THROW ideal-int +pkg syscall (linux-arm), const RTF_UP ideal-int +pkg syscall (linux-arm), const RTF_WINDOW ideal-int +pkg syscall (linux-arm), const RTF_XRESOLVE ideal-int +pkg syscall (linux-arm), const RTM_BASE ideal-int +pkg syscall (linux-arm), const RTM_DELACTION ideal-int +pkg syscall (linux-arm), const RTM_DELADDR ideal-int +pkg syscall (linux-arm), const RTM_DELADDRLABEL ideal-int +pkg syscall (linux-arm), const RTM_DELLINK ideal-int +pkg syscall (linux-arm), const RTM_DELNEIGH ideal-int +pkg syscall (linux-arm), const RTM_DELQDISC ideal-int +pkg syscall (linux-arm), const RTM_DELROUTE ideal-int +pkg syscall (linux-arm), const RTM_DELRULE ideal-int +pkg syscall (linux-arm), const RTM_DELTCLASS ideal-int +pkg syscall (linux-arm), const RTM_DELTFILTER ideal-int +pkg syscall (linux-arm), const RTM_F_CLONED ideal-int +pkg syscall (linux-arm), const RTM_F_EQUALIZE ideal-int +pkg syscall (linux-arm), const RTM_F_NOTIFY ideal-int +pkg syscall (linux-arm), const RTM_F_PREFIX ideal-int +pkg syscall (linux-arm), const RTM_GETACTION ideal-int +pkg syscall (linux-arm), const RTM_GETADDR ideal-int +pkg syscall (linux-arm), const RTM_GETADDRLABEL ideal-int +pkg syscall (linux-arm), const RTM_GETANYCAST ideal-int +pkg syscall (linux-arm), const RTM_GETDCB ideal-int +pkg syscall (linux-arm), const RTM_GETLINK ideal-int +pkg syscall (linux-arm), const RTM_GETMULTICAST ideal-int +pkg syscall (linux-arm), const RTM_GETNEIGH ideal-int +pkg syscall (linux-arm), const RTM_GETNEIGHTBL ideal-int +pkg syscall (linux-arm), const RTM_GETQDISC ideal-int +pkg syscall (linux-arm), const RTM_GETROUTE ideal-int +pkg syscall (linux-arm), const RTM_GETRULE ideal-int +pkg syscall (linux-arm), const RTM_GETTCLASS ideal-int +pkg syscall (linux-arm), const RTM_GETTFILTER ideal-int +pkg syscall (linux-arm), const RTM_MAX ideal-int +pkg syscall (linux-arm), const RTM_NEWACTION ideal-int +pkg syscall (linux-arm), const RTM_NEWADDR ideal-int +pkg syscall (linux-arm), const RTM_NEWADDRLABEL ideal-int +pkg syscall (linux-arm), const RTM_NEWLINK ideal-int +pkg syscall (linux-arm), const RTM_NEWNDUSEROPT ideal-int +pkg syscall (linux-arm), const RTM_NEWNEIGH ideal-int +pkg syscall (linux-arm), const RTM_NEWNEIGHTBL ideal-int +pkg syscall (linux-arm), const RTM_NEWPREFIX ideal-int +pkg syscall (linux-arm), const RTM_NEWQDISC ideal-int +pkg syscall (linux-arm), const RTM_NEWROUTE ideal-int +pkg syscall (linux-arm), const RTM_NEWRULE ideal-int +pkg syscall (linux-arm), const RTM_NEWTCLASS ideal-int +pkg syscall (linux-arm), const RTM_NEWTFILTER ideal-int +pkg syscall (linux-arm), const RTM_NR_FAMILIES ideal-int +pkg syscall (linux-arm), const RTM_NR_MSGTYPES ideal-int +pkg syscall (linux-arm), const RTM_SETDCB ideal-int +pkg syscall (linux-arm), const RTM_SETLINK ideal-int +pkg syscall (linux-arm), const RTM_SETNEIGHTBL ideal-int +pkg syscall (linux-arm), const RTNH_ALIGNTO ideal-int +pkg syscall (linux-arm), const RTNH_F_DEAD ideal-int +pkg syscall (linux-arm), const RTNH_F_ONLINK ideal-int +pkg syscall (linux-arm), const RTNH_F_PERVASIVE ideal-int +pkg syscall (linux-arm), const RTN_ANYCAST ideal-int +pkg syscall (linux-arm), const RTN_BLACKHOLE ideal-int +pkg syscall (linux-arm), const RTN_BROADCAST ideal-int +pkg syscall (linux-arm), const RTN_LOCAL ideal-int +pkg syscall (linux-arm), const RTN_MAX ideal-int +pkg syscall (linux-arm), const RTN_MULTICAST ideal-int +pkg syscall (linux-arm), const RTN_NAT ideal-int +pkg syscall (linux-arm), const RTN_PROHIBIT ideal-int +pkg syscall (linux-arm), const RTN_THROW ideal-int +pkg syscall (linux-arm), const RTN_UNICAST ideal-int +pkg syscall (linux-arm), const RTN_UNREACHABLE ideal-int +pkg syscall (linux-arm), const RTN_UNSPEC ideal-int +pkg syscall (linux-arm), const RTN_XRESOLVE ideal-int +pkg syscall (linux-arm), const RTPROT_BIRD ideal-int +pkg syscall (linux-arm), const RTPROT_BOOT ideal-int +pkg syscall (linux-arm), const RTPROT_DHCP ideal-int +pkg syscall (linux-arm), const RTPROT_DNROUTED ideal-int +pkg syscall (linux-arm), const RTPROT_GATED ideal-int +pkg syscall (linux-arm), const RTPROT_KERNEL ideal-int +pkg syscall (linux-arm), const RTPROT_MRT ideal-int +pkg syscall (linux-arm), const RTPROT_NTK ideal-int +pkg syscall (linux-arm), const RTPROT_RA ideal-int +pkg syscall (linux-arm), const RTPROT_REDIRECT ideal-int +pkg syscall (linux-arm), const RTPROT_STATIC ideal-int +pkg syscall (linux-arm), const RTPROT_UNSPEC ideal-int +pkg syscall (linux-arm), const RTPROT_XORP ideal-int +pkg syscall (linux-arm), const RTPROT_ZEBRA ideal-int +pkg syscall (linux-arm), const RT_CLASS_DEFAULT ideal-int +pkg syscall (linux-arm), const RT_CLASS_LOCAL ideal-int +pkg syscall (linux-arm), const RT_CLASS_MAIN ideal-int +pkg syscall (linux-arm), const RT_CLASS_MAX ideal-int +pkg syscall (linux-arm), const RT_CLASS_UNSPEC ideal-int +pkg syscall (linux-arm), const RT_SCOPE_HOST ideal-int +pkg syscall (linux-arm), const RT_SCOPE_LINK ideal-int +pkg syscall (linux-arm), const RT_SCOPE_NOWHERE ideal-int +pkg syscall (linux-arm), const RT_SCOPE_SITE ideal-int +pkg syscall (linux-arm), const RT_SCOPE_UNIVERSE ideal-int +pkg syscall (linux-arm), const RT_TABLE_COMPAT ideal-int +pkg syscall (linux-arm), const RT_TABLE_DEFAULT ideal-int +pkg syscall (linux-arm), const RT_TABLE_LOCAL ideal-int +pkg syscall (linux-arm), const RT_TABLE_MAIN ideal-int +pkg syscall (linux-arm), const RT_TABLE_MAX ideal-int +pkg syscall (linux-arm), const RT_TABLE_UNSPEC ideal-int +pkg syscall (linux-arm), const RUSAGE_CHILDREN ideal-int +pkg syscall (linux-arm), const RUSAGE_SELF ideal-int +pkg syscall (linux-arm), const RUSAGE_THREAD ideal-int +pkg syscall (linux-arm), const SCM_CREDENTIALS ideal-int +pkg syscall (linux-arm), const SCM_RIGHTS ideal-int +pkg syscall (linux-arm), const SCM_TIMESTAMP ideal-int +pkg syscall (linux-arm), const SCM_TIMESTAMPING ideal-int +pkg syscall (linux-arm), const SCM_TIMESTAMPNS ideal-int +pkg syscall (linux-arm), const SIGCHLD Signal +pkg syscall (linux-arm), const SIGCLD Signal +pkg syscall (linux-arm), const SIGCONT Signal +pkg syscall (linux-arm), const SIGIO Signal +pkg syscall (linux-arm), const SIGIOT Signal +pkg syscall (linux-arm), const SIGPOLL Signal +pkg syscall (linux-arm), const SIGPROF Signal +pkg syscall (linux-arm), const SIGPWR Signal +pkg syscall (linux-arm), const SIGSTKFLT Signal +pkg syscall (linux-arm), const SIGSTOP Signal +pkg syscall (linux-arm), const SIGSYS Signal +pkg syscall (linux-arm), const SIGTSTP Signal +pkg syscall (linux-arm), const SIGTTIN Signal +pkg syscall (linux-arm), const SIGTTOU Signal +pkg syscall (linux-arm), const SIGUNUSED Signal +pkg syscall (linux-arm), const SIGURG Signal +pkg syscall (linux-arm), const SIGUSR1 Signal +pkg syscall (linux-arm), const SIGUSR2 Signal +pkg syscall (linux-arm), const SIGVTALRM Signal +pkg syscall (linux-arm), const SIGWINCH Signal +pkg syscall (linux-arm), const SIGXCPU Signal +pkg syscall (linux-arm), const SIGXFSZ Signal +pkg syscall (linux-arm), const SIOCADDDLCI ideal-int +pkg syscall (linux-arm), const SIOCADDMULTI ideal-int +pkg syscall (linux-arm), const SIOCADDRT ideal-int +pkg syscall (linux-arm), const SIOCATMARK ideal-int +pkg syscall (linux-arm), const SIOCDARP ideal-int +pkg syscall (linux-arm), const SIOCDELDLCI ideal-int +pkg syscall (linux-arm), const SIOCDELMULTI ideal-int +pkg syscall (linux-arm), const SIOCDELRT ideal-int +pkg syscall (linux-arm), const SIOCDEVPRIVATE ideal-int +pkg syscall (linux-arm), const SIOCDIFADDR ideal-int +pkg syscall (linux-arm), const SIOCDRARP ideal-int +pkg syscall (linux-arm), const SIOCGARP ideal-int +pkg syscall (linux-arm), const SIOCGIFADDR ideal-int +pkg syscall (linux-arm), const SIOCGIFBR ideal-int +pkg syscall (linux-arm), const SIOCGIFBRDADDR ideal-int +pkg syscall (linux-arm), const SIOCGIFCONF ideal-int +pkg syscall (linux-arm), const SIOCGIFCOUNT ideal-int +pkg syscall (linux-arm), const SIOCGIFDSTADDR ideal-int +pkg syscall (linux-arm), const SIOCGIFENCAP ideal-int +pkg syscall (linux-arm), const SIOCGIFFLAGS ideal-int +pkg syscall (linux-arm), const SIOCGIFHWADDR ideal-int +pkg syscall (linux-arm), const SIOCGIFINDEX ideal-int +pkg syscall (linux-arm), const SIOCGIFMAP ideal-int +pkg syscall (linux-arm), const SIOCGIFMEM ideal-int +pkg syscall (linux-arm), const SIOCGIFMETRIC ideal-int +pkg syscall (linux-arm), const SIOCGIFMTU ideal-int +pkg syscall (linux-arm), const SIOCGIFNAME ideal-int +pkg syscall (linux-arm), const SIOCGIFNETMASK ideal-int +pkg syscall (linux-arm), const SIOCGIFPFLAGS ideal-int +pkg syscall (linux-arm), const SIOCGIFSLAVE ideal-int +pkg syscall (linux-arm), const SIOCGIFTXQLEN ideal-int +pkg syscall (linux-arm), const SIOCGPGRP ideal-int +pkg syscall (linux-arm), const SIOCGRARP ideal-int +pkg syscall (linux-arm), const SIOCGSTAMP ideal-int +pkg syscall (linux-arm), const SIOCGSTAMPNS ideal-int +pkg syscall (linux-arm), const SIOCPROTOPRIVATE ideal-int +pkg syscall (linux-arm), const SIOCRTMSG ideal-int +pkg syscall (linux-arm), const SIOCSARP ideal-int +pkg syscall (linux-arm), const SIOCSIFADDR ideal-int +pkg syscall (linux-arm), const SIOCSIFBR ideal-int +pkg syscall (linux-arm), const SIOCSIFBRDADDR ideal-int +pkg syscall (linux-arm), const SIOCSIFDSTADDR ideal-int +pkg syscall (linux-arm), const SIOCSIFENCAP ideal-int +pkg syscall (linux-arm), const SIOCSIFFLAGS ideal-int +pkg syscall (linux-arm), const SIOCSIFHWADDR ideal-int +pkg syscall (linux-arm), const SIOCSIFHWBROADCAST ideal-int +pkg syscall (linux-arm), const SIOCSIFLINK ideal-int +pkg syscall (linux-arm), const SIOCSIFMAP ideal-int +pkg syscall (linux-arm), const SIOCSIFMEM ideal-int +pkg syscall (linux-arm), const SIOCSIFMETRIC ideal-int +pkg syscall (linux-arm), const SIOCSIFMTU ideal-int +pkg syscall (linux-arm), const SIOCSIFNAME ideal-int +pkg syscall (linux-arm), const SIOCSIFNETMASK ideal-int +pkg syscall (linux-arm), const SIOCSIFPFLAGS ideal-int +pkg syscall (linux-arm), const SIOCSIFSLAVE ideal-int +pkg syscall (linux-arm), const SIOCSIFTXQLEN ideal-int +pkg syscall (linux-arm), const SIOCSPGRP ideal-int +pkg syscall (linux-arm), const SIOCSRARP ideal-int +pkg syscall (linux-arm), const SOCK_CLOEXEC ideal-int +pkg syscall (linux-arm), const SOCK_DCCP ideal-int +pkg syscall (linux-arm), const SOCK_NONBLOCK ideal-int +pkg syscall (linux-arm), const SOCK_PACKET ideal-int +pkg syscall (linux-arm), const SOCK_RDM ideal-int +pkg syscall (linux-arm), const SOL_AAL ideal-int +pkg syscall (linux-arm), const SOL_ATM ideal-int +pkg syscall (linux-arm), const SOL_DECNET ideal-int +pkg syscall (linux-arm), const SOL_ICMPV6 ideal-int +pkg syscall (linux-arm), const SOL_IP ideal-int +pkg syscall (linux-arm), const SOL_IPV6 ideal-int +pkg syscall (linux-arm), const SOL_IRDA ideal-int +pkg syscall (linux-arm), const SOL_PACKET ideal-int +pkg syscall (linux-arm), const SOL_RAW ideal-int +pkg syscall (linux-arm), const SOL_TCP ideal-int +pkg syscall (linux-arm), const SOL_X25 ideal-int +pkg syscall (linux-arm), const SO_ACCEPTCONN ideal-int +pkg syscall (linux-arm), const SO_ATTACH_FILTER ideal-int +pkg syscall (linux-arm), const SO_BINDTODEVICE ideal-int +pkg syscall (linux-arm), const SO_BSDCOMPAT ideal-int +pkg syscall (linux-arm), const SO_DEBUG ideal-int +pkg syscall (linux-arm), const SO_DETACH_FILTER ideal-int +pkg syscall (linux-arm), const SO_DOMAIN ideal-int +pkg syscall (linux-arm), const SO_ERROR ideal-int +pkg syscall (linux-arm), const SO_MARK ideal-int +pkg syscall (linux-arm), const SO_NO_CHECK ideal-int +pkg syscall (linux-arm), const SO_OOBINLINE ideal-int +pkg syscall (linux-arm), const SO_PASSCRED ideal-int +pkg syscall (linux-arm), const SO_PASSSEC ideal-int +pkg syscall (linux-arm), const SO_PEERCRED ideal-int +pkg syscall (linux-arm), const SO_PEERNAME ideal-int +pkg syscall (linux-arm), const SO_PEERSEC ideal-int +pkg syscall (linux-arm), const SO_PRIORITY ideal-int +pkg syscall (linux-arm), const SO_PROTOCOL ideal-int +pkg syscall (linux-arm), const SO_RCVBUFFORCE ideal-int +pkg syscall (linux-arm), const SO_RCVLOWAT ideal-int +pkg syscall (linux-arm), const SO_RCVTIMEO ideal-int +pkg syscall (linux-arm), const SO_RXQ_OVFL ideal-int +pkg syscall (linux-arm), const SO_SECURITY_AUTHENTICATION ideal-int +pkg syscall (linux-arm), const SO_SECURITY_ENCRYPTION_NETWORK ideal-int +pkg syscall (linux-arm), const SO_SECURITY_ENCRYPTION_TRANSPORT ideal-int +pkg syscall (linux-arm), const SO_SNDBUFFORCE ideal-int +pkg syscall (linux-arm), const SO_SNDLOWAT ideal-int +pkg syscall (linux-arm), const SO_SNDTIMEO ideal-int +pkg syscall (linux-arm), const SO_TIMESTAMP ideal-int +pkg syscall (linux-arm), const SO_TIMESTAMPING ideal-int +pkg syscall (linux-arm), const SO_TIMESTAMPNS ideal-int +pkg syscall (linux-arm), const SO_TYPE ideal-int +pkg syscall (linux-arm), const SYS_ACCEPT ideal-int +pkg syscall (linux-arm), const SYS_ACCEPT4 ideal-int +pkg syscall (linux-arm), const SYS_ACCESS ideal-int +pkg syscall (linux-arm), const SYS_ACCT ideal-int +pkg syscall (linux-arm), const SYS_ADD_KEY ideal-int +pkg syscall (linux-arm), const SYS_ADJTIMEX ideal-int +pkg syscall (linux-arm), const SYS_ALARM ideal-int +pkg syscall (linux-arm), const SYS_ARM_FADVISE64_64 ideal-int +pkg syscall (linux-arm), const SYS_ARM_SYNC_FILE_RANGE ideal-int +pkg syscall (linux-arm), const SYS_BDFLUSH ideal-int +pkg syscall (linux-arm), const SYS_BIND ideal-int +pkg syscall (linux-arm), const SYS_BRK ideal-int +pkg syscall (linux-arm), const SYS_CAPGET ideal-int +pkg syscall (linux-arm), const SYS_CAPSET ideal-int +pkg syscall (linux-arm), const SYS_CHDIR ideal-int +pkg syscall (linux-arm), const SYS_CHMOD ideal-int +pkg syscall (linux-arm), const SYS_CHOWN ideal-int +pkg syscall (linux-arm), const SYS_CHOWN32 ideal-int +pkg syscall (linux-arm), const SYS_CHROOT ideal-int +pkg syscall (linux-arm), const SYS_CLOCK_ADJTIME ideal-int +pkg syscall (linux-arm), const SYS_CLOCK_GETRES ideal-int +pkg syscall (linux-arm), const SYS_CLOCK_GETTIME ideal-int +pkg syscall (linux-arm), const SYS_CLOCK_NANOSLEEP ideal-int +pkg syscall (linux-arm), const SYS_CLOCK_SETTIME ideal-int +pkg syscall (linux-arm), const SYS_CLONE ideal-int +pkg syscall (linux-arm), const SYS_CLOSE ideal-int +pkg syscall (linux-arm), const SYS_CONNECT ideal-int +pkg syscall (linux-arm), const SYS_CREAT ideal-int +pkg syscall (linux-arm), const SYS_DELETE_MODULE ideal-int +pkg syscall (linux-arm), const SYS_DUP ideal-int +pkg syscall (linux-arm), const SYS_DUP2 ideal-int +pkg syscall (linux-arm), const SYS_DUP3 ideal-int +pkg syscall (linux-arm), const SYS_EPOLL_CREATE ideal-int +pkg syscall (linux-arm), const SYS_EPOLL_CREATE1 ideal-int +pkg syscall (linux-arm), const SYS_EPOLL_CTL ideal-int +pkg syscall (linux-arm), const SYS_EPOLL_PWAIT ideal-int +pkg syscall (linux-arm), const SYS_EPOLL_WAIT ideal-int +pkg syscall (linux-arm), const SYS_EVENTFD ideal-int +pkg syscall (linux-arm), const SYS_EVENTFD2 ideal-int +pkg syscall (linux-arm), const SYS_EXECVE ideal-int +pkg syscall (linux-arm), const SYS_EXIT ideal-int +pkg syscall (linux-arm), const SYS_EXIT_GROUP ideal-int +pkg syscall (linux-arm), const SYS_FACCESSAT ideal-int +pkg syscall (linux-arm), const SYS_FALLOCATE ideal-int +pkg syscall (linux-arm), const SYS_FANOTIFY_INIT ideal-int +pkg syscall (linux-arm), const SYS_FANOTIFY_MARK ideal-int +pkg syscall (linux-arm), const SYS_FCHDIR ideal-int +pkg syscall (linux-arm), const SYS_FCHMOD ideal-int +pkg syscall (linux-arm), const SYS_FCHMODAT ideal-int +pkg syscall (linux-arm), const SYS_FCHOWN ideal-int +pkg syscall (linux-arm), const SYS_FCHOWN32 ideal-int +pkg syscall (linux-arm), const SYS_FCHOWNAT ideal-int +pkg syscall (linux-arm), const SYS_FCNTL ideal-int +pkg syscall (linux-arm), const SYS_FCNTL64 ideal-int +pkg syscall (linux-arm), const SYS_FDATASYNC ideal-int +pkg syscall (linux-arm), const SYS_FGETXATTR ideal-int +pkg syscall (linux-arm), const SYS_FLISTXATTR ideal-int +pkg syscall (linux-arm), const SYS_FLOCK ideal-int +pkg syscall (linux-arm), const SYS_FORK ideal-int +pkg syscall (linux-arm), const SYS_FREMOVEXATTR ideal-int +pkg syscall (linux-arm), const SYS_FSETXATTR ideal-int +pkg syscall (linux-arm), const SYS_FSTAT ideal-int +pkg syscall (linux-arm), const SYS_FSTAT64 ideal-int +pkg syscall (linux-arm), const SYS_FSTATAT64 ideal-int +pkg syscall (linux-arm), const SYS_FSTATFS ideal-int +pkg syscall (linux-arm), const SYS_FSTATFS64 ideal-int +pkg syscall (linux-arm), const SYS_FSYNC ideal-int +pkg syscall (linux-arm), const SYS_FTRUNCATE ideal-int +pkg syscall (linux-arm), const SYS_FTRUNCATE64 ideal-int +pkg syscall (linux-arm), const SYS_FUTEX ideal-int +pkg syscall (linux-arm), const SYS_FUTIMESAT ideal-int +pkg syscall (linux-arm), const SYS_GETCPU ideal-int +pkg syscall (linux-arm), const SYS_GETCWD ideal-int +pkg syscall (linux-arm), const SYS_GETDENTS ideal-int +pkg syscall (linux-arm), const SYS_GETDENTS64 ideal-int +pkg syscall (linux-arm), const SYS_GETEGID ideal-int +pkg syscall (linux-arm), const SYS_GETEGID32 ideal-int +pkg syscall (linux-arm), const SYS_GETEUID ideal-int +pkg syscall (linux-arm), const SYS_GETEUID32 ideal-int +pkg syscall (linux-arm), const SYS_GETGID ideal-int +pkg syscall (linux-arm), const SYS_GETGID32 ideal-int +pkg syscall (linux-arm), const SYS_GETGROUPS ideal-int +pkg syscall (linux-arm), const SYS_GETGROUPS32 ideal-int +pkg syscall (linux-arm), const SYS_GETITIMER ideal-int +pkg syscall (linux-arm), const SYS_GETPEERNAME ideal-int +pkg syscall (linux-arm), const SYS_GETPGID ideal-int +pkg syscall (linux-arm), const SYS_GETPGRP ideal-int +pkg syscall (linux-arm), const SYS_GETPID ideal-int +pkg syscall (linux-arm), const SYS_GETPPID ideal-int +pkg syscall (linux-arm), const SYS_GETPRIORITY ideal-int +pkg syscall (linux-arm), const SYS_GETRESGID ideal-int +pkg syscall (linux-arm), const SYS_GETRESGID32 ideal-int +pkg syscall (linux-arm), const SYS_GETRESUID ideal-int +pkg syscall (linux-arm), const SYS_GETRESUID32 ideal-int +pkg syscall (linux-arm), const SYS_GETRLIMIT ideal-int +pkg syscall (linux-arm), const SYS_GETRUSAGE ideal-int +pkg syscall (linux-arm), const SYS_GETSID ideal-int +pkg syscall (linux-arm), const SYS_GETSOCKNAME ideal-int +pkg syscall (linux-arm), const SYS_GETSOCKOPT ideal-int +pkg syscall (linux-arm), const SYS_GETTID ideal-int +pkg syscall (linux-arm), const SYS_GETTIMEOFDAY ideal-int +pkg syscall (linux-arm), const SYS_GETUID ideal-int +pkg syscall (linux-arm), const SYS_GETUID32 ideal-int +pkg syscall (linux-arm), const SYS_GETXATTR ideal-int +pkg syscall (linux-arm), const SYS_GET_MEMPOLICY ideal-int +pkg syscall (linux-arm), const SYS_GET_ROBUST_LIST ideal-int +pkg syscall (linux-arm), const SYS_INIT_MODULE ideal-int +pkg syscall (linux-arm), const SYS_INOTIFY_ADD_WATCH ideal-int +pkg syscall (linux-arm), const SYS_INOTIFY_INIT ideal-int +pkg syscall (linux-arm), const SYS_INOTIFY_INIT1 ideal-int +pkg syscall (linux-arm), const SYS_INOTIFY_RM_WATCH ideal-int +pkg syscall (linux-arm), const SYS_IOCTL ideal-int +pkg syscall (linux-arm), const SYS_IOPRIO_GET ideal-int +pkg syscall (linux-arm), const SYS_IOPRIO_SET ideal-int +pkg syscall (linux-arm), const SYS_IO_CANCEL ideal-int +pkg syscall (linux-arm), const SYS_IO_DESTROY ideal-int +pkg syscall (linux-arm), const SYS_IO_GETEVENTS ideal-int +pkg syscall (linux-arm), const SYS_IO_SETUP ideal-int +pkg syscall (linux-arm), const SYS_IO_SUBMIT ideal-int +pkg syscall (linux-arm), const SYS_IPC ideal-int +pkg syscall (linux-arm), const SYS_KEXEC_LOAD ideal-int +pkg syscall (linux-arm), const SYS_KEYCTL ideal-int +pkg syscall (linux-arm), const SYS_KILL ideal-int +pkg syscall (linux-arm), const SYS_LCHOWN ideal-int +pkg syscall (linux-arm), const SYS_LCHOWN32 ideal-int +pkg syscall (linux-arm), const SYS_LGETXATTR ideal-int +pkg syscall (linux-arm), const SYS_LINK ideal-int +pkg syscall (linux-arm), const SYS_LINKAT ideal-int +pkg syscall (linux-arm), const SYS_LISTEN ideal-int +pkg syscall (linux-arm), const SYS_LISTXATTR ideal-int +pkg syscall (linux-arm), const SYS_LLISTXATTR ideal-int +pkg syscall (linux-arm), const SYS_LOOKUP_DCOOKIE ideal-int +pkg syscall (linux-arm), const SYS_LREMOVEXATTR ideal-int +pkg syscall (linux-arm), const SYS_LSEEK ideal-int +pkg syscall (linux-arm), const SYS_LSETXATTR ideal-int +pkg syscall (linux-arm), const SYS_LSTAT ideal-int +pkg syscall (linux-arm), const SYS_LSTAT64 ideal-int +pkg syscall (linux-arm), const SYS_MADVISE ideal-int +pkg syscall (linux-arm), const SYS_MBIND ideal-int +pkg syscall (linux-arm), const SYS_MINCORE ideal-int +pkg syscall (linux-arm), const SYS_MKDIR ideal-int +pkg syscall (linux-arm), const SYS_MKDIRAT ideal-int +pkg syscall (linux-arm), const SYS_MKNOD ideal-int +pkg syscall (linux-arm), const SYS_MKNODAT ideal-int +pkg syscall (linux-arm), const SYS_MLOCK ideal-int +pkg syscall (linux-arm), const SYS_MLOCKALL ideal-int +pkg syscall (linux-arm), const SYS_MMAP ideal-int +pkg syscall (linux-arm), const SYS_MMAP2 ideal-int +pkg syscall (linux-arm), const SYS_MOUNT ideal-int +pkg syscall (linux-arm), const SYS_MOVE_PAGES ideal-int +pkg syscall (linux-arm), const SYS_MPROTECT ideal-int +pkg syscall (linux-arm), const SYS_MQ_GETSETATTR ideal-int +pkg syscall (linux-arm), const SYS_MQ_NOTIFY ideal-int +pkg syscall (linux-arm), const SYS_MQ_OPEN ideal-int +pkg syscall (linux-arm), const SYS_MQ_TIMEDRECEIVE ideal-int +pkg syscall (linux-arm), const SYS_MQ_TIMEDSEND ideal-int +pkg syscall (linux-arm), const SYS_MQ_UNLINK ideal-int +pkg syscall (linux-arm), const SYS_MREMAP ideal-int +pkg syscall (linux-arm), const SYS_MSGCTL ideal-int +pkg syscall (linux-arm), const SYS_MSGGET ideal-int +pkg syscall (linux-arm), const SYS_MSGRCV ideal-int +pkg syscall (linux-arm), const SYS_MSGSND ideal-int +pkg syscall (linux-arm), const SYS_MSYNC ideal-int +pkg syscall (linux-arm), const SYS_MUNLOCK ideal-int +pkg syscall (linux-arm), const SYS_MUNLOCKALL ideal-int +pkg syscall (linux-arm), const SYS_MUNMAP ideal-int +pkg syscall (linux-arm), const SYS_NAME_TO_HANDLE_AT ideal-int +pkg syscall (linux-arm), const SYS_NANOSLEEP ideal-int +pkg syscall (linux-arm), const SYS_NFSSERVCTL ideal-int +pkg syscall (linux-arm), const SYS_NICE ideal-int +pkg syscall (linux-arm), const SYS_OABI_SYSCALL_BASE ideal-int +pkg syscall (linux-arm), const SYS_OPEN ideal-int +pkg syscall (linux-arm), const SYS_OPENAT ideal-int +pkg syscall (linux-arm), const SYS_OPEN_BY_HANDLE_AT ideal-int +pkg syscall (linux-arm), const SYS_PAUSE ideal-int +pkg syscall (linux-arm), const SYS_PCICONFIG_IOBASE ideal-int +pkg syscall (linux-arm), const SYS_PCICONFIG_READ ideal-int +pkg syscall (linux-arm), const SYS_PCICONFIG_WRITE ideal-int +pkg syscall (linux-arm), const SYS_PERF_EVENT_OPEN ideal-int +pkg syscall (linux-arm), const SYS_PERSONALITY ideal-int +pkg syscall (linux-arm), const SYS_PIPE ideal-int +pkg syscall (linux-arm), const SYS_PIPE2 ideal-int +pkg syscall (linux-arm), const SYS_PIVOT_ROOT ideal-int +pkg syscall (linux-arm), const SYS_POLL ideal-int +pkg syscall (linux-arm), const SYS_PPOLL ideal-int +pkg syscall (linux-arm), const SYS_PRCTL ideal-int +pkg syscall (linux-arm), const SYS_PREAD64 ideal-int +pkg syscall (linux-arm), const SYS_PREADV ideal-int +pkg syscall (linux-arm), const SYS_PRLIMIT64 ideal-int +pkg syscall (linux-arm), const SYS_PROCESS_VM_READV ideal-int +pkg syscall (linux-arm), const SYS_PROCESS_VM_WRITEV ideal-int +pkg syscall (linux-arm), const SYS_PSELECT6 ideal-int +pkg syscall (linux-arm), const SYS_PTRACE ideal-int +pkg syscall (linux-arm), const SYS_PWRITE64 ideal-int +pkg syscall (linux-arm), const SYS_PWRITEV ideal-int +pkg syscall (linux-arm), const SYS_QUOTACTL ideal-int +pkg syscall (linux-arm), const SYS_READ ideal-int +pkg syscall (linux-arm), const SYS_READAHEAD ideal-int +pkg syscall (linux-arm), const SYS_READDIR ideal-int +pkg syscall (linux-arm), const SYS_READLINK ideal-int +pkg syscall (linux-arm), const SYS_READLINKAT ideal-int +pkg syscall (linux-arm), const SYS_READV ideal-int +pkg syscall (linux-arm), const SYS_REBOOT ideal-int +pkg syscall (linux-arm), const SYS_RECV ideal-int +pkg syscall (linux-arm), const SYS_RECVFROM ideal-int +pkg syscall (linux-arm), const SYS_RECVMMSG ideal-int +pkg syscall (linux-arm), const SYS_RECVMSG ideal-int +pkg syscall (linux-arm), const SYS_REMAP_FILE_PAGES ideal-int +pkg syscall (linux-arm), const SYS_REMOVEXATTR ideal-int +pkg syscall (linux-arm), const SYS_RENAME ideal-int +pkg syscall (linux-arm), const SYS_RENAMEAT ideal-int +pkg syscall (linux-arm), const SYS_REQUEST_KEY ideal-int +pkg syscall (linux-arm), const SYS_RESTART_SYSCALL ideal-int +pkg syscall (linux-arm), const SYS_RMDIR ideal-int +pkg syscall (linux-arm), const SYS_RT_SIGACTION ideal-int +pkg syscall (linux-arm), const SYS_RT_SIGPENDING ideal-int +pkg syscall (linux-arm), const SYS_RT_SIGPROCMASK ideal-int +pkg syscall (linux-arm), const SYS_RT_SIGQUEUEINFO ideal-int +pkg syscall (linux-arm), const SYS_RT_SIGRETURN ideal-int +pkg syscall (linux-arm), const SYS_RT_SIGSUSPEND ideal-int +pkg syscall (linux-arm), const SYS_RT_SIGTIMEDWAIT ideal-int +pkg syscall (linux-arm), const SYS_RT_TGSIGQUEUEINFO ideal-int +pkg syscall (linux-arm), const SYS_SCHED_GETAFFINITY ideal-int +pkg syscall (linux-arm), const SYS_SCHED_GETPARAM ideal-int +pkg syscall (linux-arm), const SYS_SCHED_GETSCHEDULER ideal-int +pkg syscall (linux-arm), const SYS_SCHED_GET_PRIORITY_MAX ideal-int +pkg syscall (linux-arm), const SYS_SCHED_GET_PRIORITY_MIN ideal-int +pkg syscall (linux-arm), const SYS_SCHED_RR_GET_INTERVAL ideal-int +pkg syscall (linux-arm), const SYS_SCHED_SETAFFINITY ideal-int +pkg syscall (linux-arm), const SYS_SCHED_SETPARAM ideal-int +pkg syscall (linux-arm), const SYS_SCHED_SETSCHEDULER ideal-int +pkg syscall (linux-arm), const SYS_SCHED_YIELD ideal-int +pkg syscall (linux-arm), const SYS_SELECT ideal-int +pkg syscall (linux-arm), const SYS_SEMCTL ideal-int +pkg syscall (linux-arm), const SYS_SEMGET ideal-int +pkg syscall (linux-arm), const SYS_SEMOP ideal-int +pkg syscall (linux-arm), const SYS_SEMTIMEDOP ideal-int +pkg syscall (linux-arm), const SYS_SEND ideal-int +pkg syscall (linux-arm), const SYS_SENDFILE ideal-int +pkg syscall (linux-arm), const SYS_SENDFILE64 ideal-int +pkg syscall (linux-arm), const SYS_SENDMMSG ideal-int +pkg syscall (linux-arm), const SYS_SENDMSG ideal-int +pkg syscall (linux-arm), const SYS_SENDTO ideal-int +pkg syscall (linux-arm), const SYS_SETDOMAINNAME ideal-int +pkg syscall (linux-arm), const SYS_SETFSGID ideal-int +pkg syscall (linux-arm), const SYS_SETFSGID32 ideal-int +pkg syscall (linux-arm), const SYS_SETFSUID ideal-int +pkg syscall (linux-arm), const SYS_SETFSUID32 ideal-int +pkg syscall (linux-arm), const SYS_SETGID ideal-int +pkg syscall (linux-arm), const SYS_SETGID32 ideal-int +pkg syscall (linux-arm), const SYS_SETGROUPS ideal-int +pkg syscall (linux-arm), const SYS_SETGROUPS32 ideal-int +pkg syscall (linux-arm), const SYS_SETHOSTNAME ideal-int +pkg syscall (linux-arm), const SYS_SETITIMER ideal-int +pkg syscall (linux-arm), const SYS_SETNS ideal-int +pkg syscall (linux-arm), const SYS_SETPGID ideal-int +pkg syscall (linux-arm), const SYS_SETPRIORITY ideal-int +pkg syscall (linux-arm), const SYS_SETREGID ideal-int +pkg syscall (linux-arm), const SYS_SETREGID32 ideal-int +pkg syscall (linux-arm), const SYS_SETRESGID ideal-int +pkg syscall (linux-arm), const SYS_SETRESGID32 ideal-int +pkg syscall (linux-arm), const SYS_SETRESUID ideal-int +pkg syscall (linux-arm), const SYS_SETRESUID32 ideal-int +pkg syscall (linux-arm), const SYS_SETREUID ideal-int +pkg syscall (linux-arm), const SYS_SETREUID32 ideal-int +pkg syscall (linux-arm), const SYS_SETRLIMIT ideal-int +pkg syscall (linux-arm), const SYS_SETSID ideal-int +pkg syscall (linux-arm), const SYS_SETSOCKOPT ideal-int +pkg syscall (linux-arm), const SYS_SETTIMEOFDAY ideal-int +pkg syscall (linux-arm), const SYS_SETUID ideal-int +pkg syscall (linux-arm), const SYS_SETUID32 ideal-int +pkg syscall (linux-arm), const SYS_SETXATTR ideal-int +pkg syscall (linux-arm), const SYS_SET_MEMPOLICY ideal-int +pkg syscall (linux-arm), const SYS_SET_ROBUST_LIST ideal-int +pkg syscall (linux-arm), const SYS_SET_TID_ADDRESS ideal-int +pkg syscall (linux-arm), const SYS_SHMAT ideal-int +pkg syscall (linux-arm), const SYS_SHMCTL ideal-int +pkg syscall (linux-arm), const SYS_SHMDT ideal-int +pkg syscall (linux-arm), const SYS_SHMGET ideal-int +pkg syscall (linux-arm), const SYS_SHUTDOWN ideal-int +pkg syscall (linux-arm), const SYS_SIGACTION ideal-int +pkg syscall (linux-arm), const SYS_SIGALTSTACK ideal-int +pkg syscall (linux-arm), const SYS_SIGNALFD ideal-int +pkg syscall (linux-arm), const SYS_SIGNALFD4 ideal-int +pkg syscall (linux-arm), const SYS_SIGPENDING ideal-int +pkg syscall (linux-arm), const SYS_SIGPROCMASK ideal-int +pkg syscall (linux-arm), const SYS_SIGRETURN ideal-int +pkg syscall (linux-arm), const SYS_SIGSUSPEND ideal-int +pkg syscall (linux-arm), const SYS_SOCKET ideal-int +pkg syscall (linux-arm), const SYS_SOCKETCALL ideal-int +pkg syscall (linux-arm), const SYS_SOCKETPAIR ideal-int +pkg syscall (linux-arm), const SYS_SPLICE ideal-int +pkg syscall (linux-arm), const SYS_STAT ideal-int +pkg syscall (linux-arm), const SYS_STAT64 ideal-int +pkg syscall (linux-arm), const SYS_STATFS ideal-int +pkg syscall (linux-arm), const SYS_STATFS64 ideal-int +pkg syscall (linux-arm), const SYS_STIME ideal-int +pkg syscall (linux-arm), const SYS_SWAPOFF ideal-int +pkg syscall (linux-arm), const SYS_SWAPON ideal-int +pkg syscall (linux-arm), const SYS_SYMLINK ideal-int +pkg syscall (linux-arm), const SYS_SYMLINKAT ideal-int +pkg syscall (linux-arm), const SYS_SYNC ideal-int +pkg syscall (linux-arm), const SYS_SYNCFS ideal-int +pkg syscall (linux-arm), const SYS_SYSCALL ideal-int +pkg syscall (linux-arm), const SYS_SYSCALL_BASE ideal-int +pkg syscall (linux-arm), const SYS_SYSFS ideal-int +pkg syscall (linux-arm), const SYS_SYSINFO ideal-int +pkg syscall (linux-arm), const SYS_SYSLOG ideal-int +pkg syscall (linux-arm), const SYS_TEE ideal-int +pkg syscall (linux-arm), const SYS_TGKILL ideal-int +pkg syscall (linux-arm), const SYS_TIME ideal-int +pkg syscall (linux-arm), const SYS_TIMERFD_CREATE ideal-int +pkg syscall (linux-arm), const SYS_TIMERFD_GETTIME ideal-int +pkg syscall (linux-arm), const SYS_TIMERFD_SETTIME ideal-int +pkg syscall (linux-arm), const SYS_TIMER_CREATE ideal-int +pkg syscall (linux-arm), const SYS_TIMER_DELETE ideal-int +pkg syscall (linux-arm), const SYS_TIMER_GETOVERRUN ideal-int +pkg syscall (linux-arm), const SYS_TIMER_GETTIME ideal-int +pkg syscall (linux-arm), const SYS_TIMER_SETTIME ideal-int +pkg syscall (linux-arm), const SYS_TIMES ideal-int +pkg syscall (linux-arm), const SYS_TKILL ideal-int +pkg syscall (linux-arm), const SYS_TRUNCATE ideal-int +pkg syscall (linux-arm), const SYS_TRUNCATE64 ideal-int +pkg syscall (linux-arm), const SYS_UGETRLIMIT ideal-int +pkg syscall (linux-arm), const SYS_UMASK ideal-int +pkg syscall (linux-arm), const SYS_UMOUNT ideal-int +pkg syscall (linux-arm), const SYS_UMOUNT2 ideal-int +pkg syscall (linux-arm), const SYS_UNAME ideal-int +pkg syscall (linux-arm), const SYS_UNLINK ideal-int +pkg syscall (linux-arm), const SYS_UNLINKAT ideal-int +pkg syscall (linux-arm), const SYS_UNSHARE ideal-int +pkg syscall (linux-arm), const SYS_USELIB ideal-int +pkg syscall (linux-arm), const SYS_USTAT ideal-int +pkg syscall (linux-arm), const SYS_UTIME ideal-int +pkg syscall (linux-arm), const SYS_UTIMENSAT ideal-int +pkg syscall (linux-arm), const SYS_UTIMES ideal-int +pkg syscall (linux-arm), const SYS_VFORK ideal-int +pkg syscall (linux-arm), const SYS_VHANGUP ideal-int +pkg syscall (linux-arm), const SYS_VMSPLICE ideal-int +pkg syscall (linux-arm), const SYS_VSERVER ideal-int +pkg syscall (linux-arm), const SYS_WAIT4 ideal-int +pkg syscall (linux-arm), const SYS_WAITID ideal-int +pkg syscall (linux-arm), const SYS_WRITE ideal-int +pkg syscall (linux-arm), const SYS_WRITEV ideal-int +pkg syscall (linux-arm), const SYS__LLSEEK ideal-int +pkg syscall (linux-arm), const SYS__NEWSELECT ideal-int +pkg syscall (linux-arm), const SYS__SYSCTL ideal-int +pkg syscall (linux-arm), const S_BLKSIZE ideal-int +pkg syscall (linux-arm), const S_IEXEC ideal-int +pkg syscall (linux-arm), const S_IREAD ideal-int +pkg syscall (linux-arm), const S_IRGRP ideal-int +pkg syscall (linux-arm), const S_IROTH ideal-int +pkg syscall (linux-arm), const S_IRWXG ideal-int +pkg syscall (linux-arm), const S_IRWXO ideal-int +pkg syscall (linux-arm), const S_IRWXU ideal-int +pkg syscall (linux-arm), const S_IWGRP ideal-int +pkg syscall (linux-arm), const S_IWOTH ideal-int +pkg syscall (linux-arm), const S_IWRITE ideal-int +pkg syscall (linux-arm), const S_IXGRP ideal-int +pkg syscall (linux-arm), const S_IXOTH ideal-int +pkg syscall (linux-arm), const SizeofCmsghdr ideal-int +pkg syscall (linux-arm), const SizeofIPMreq ideal-int +pkg syscall (linux-arm), const SizeofIPMreqn ideal-int +pkg syscall (linux-arm), const SizeofIPv6Mreq ideal-int +pkg syscall (linux-arm), const SizeofIfAddrmsg ideal-int +pkg syscall (linux-arm), const SizeofIfInfomsg ideal-int +pkg syscall (linux-arm), const SizeofInet4Pktinfo ideal-int +pkg syscall (linux-arm), const SizeofInet6Pktinfo ideal-int +pkg syscall (linux-arm), const SizeofInotifyEvent ideal-int +pkg syscall (linux-arm), const SizeofLinger ideal-int +pkg syscall (linux-arm), const SizeofMsghdr ideal-int +pkg syscall (linux-arm), const SizeofNlAttr ideal-int +pkg syscall (linux-arm), const SizeofNlMsgerr ideal-int +pkg syscall (linux-arm), const SizeofNlMsghdr ideal-int +pkg syscall (linux-arm), const SizeofRtAttr ideal-int +pkg syscall (linux-arm), const SizeofRtGenmsg ideal-int +pkg syscall (linux-arm), const SizeofRtMsg ideal-int +pkg syscall (linux-arm), const SizeofRtNexthop ideal-int +pkg syscall (linux-arm), const SizeofSockFilter ideal-int +pkg syscall (linux-arm), const SizeofSockFprog ideal-int +pkg syscall (linux-arm), const SizeofSockaddrAny ideal-int +pkg syscall (linux-arm), const SizeofSockaddrInet4 ideal-int +pkg syscall (linux-arm), const SizeofSockaddrInet6 ideal-int +pkg syscall (linux-arm), const SizeofSockaddrLinklayer ideal-int +pkg syscall (linux-arm), const SizeofSockaddrNetlink ideal-int +pkg syscall (linux-arm), const SizeofSockaddrUnix ideal-int +pkg syscall (linux-arm), const SizeofUcred ideal-int +pkg syscall (linux-arm), const TCGETS ideal-int +pkg syscall (linux-arm), const TCP_CONGESTION ideal-int +pkg syscall (linux-arm), const TCP_CORK ideal-int +pkg syscall (linux-arm), const TCP_DEFER_ACCEPT ideal-int +pkg syscall (linux-arm), const TCP_INFO ideal-int +pkg syscall (linux-arm), const TCP_KEEPCNT ideal-int +pkg syscall (linux-arm), const TCP_KEEPIDLE ideal-int +pkg syscall (linux-arm), const TCP_KEEPINTVL ideal-int +pkg syscall (linux-arm), const TCP_LINGER2 ideal-int +pkg syscall (linux-arm), const TCP_MAXSEG ideal-int +pkg syscall (linux-arm), const TCP_MAXWIN ideal-int +pkg syscall (linux-arm), const TCP_MAX_WINSHIFT ideal-int +pkg syscall (linux-arm), const TCP_MD5SIG ideal-int +pkg syscall (linux-arm), const TCP_MD5SIG_MAXKEYLEN ideal-int +pkg syscall (linux-arm), const TCP_MSS ideal-int +pkg syscall (linux-arm), const TCP_QUICKACK ideal-int +pkg syscall (linux-arm), const TCP_SYNCNT ideal-int +pkg syscall (linux-arm), const TCP_WINDOW_CLAMP ideal-int +pkg syscall (linux-arm), const TCSETS ideal-int +pkg syscall (linux-arm), const TIOCCBRK ideal-int +pkg syscall (linux-arm), const TIOCCONS ideal-int +pkg syscall (linux-arm), const TIOCEXCL ideal-int +pkg syscall (linux-arm), const TIOCGDEV ideal-int +pkg syscall (linux-arm), const TIOCGETD ideal-int +pkg syscall (linux-arm), const TIOCGICOUNT ideal-int +pkg syscall (linux-arm), const TIOCGLCKTRMIOS ideal-int +pkg syscall (linux-arm), const TIOCGPGRP ideal-int +pkg syscall (linux-arm), const TIOCGPTN ideal-int +pkg syscall (linux-arm), const TIOCGRS485 ideal-int +pkg syscall (linux-arm), const TIOCGSERIAL ideal-int +pkg syscall (linux-arm), const TIOCGSID ideal-int +pkg syscall (linux-arm), const TIOCGSOFTCAR ideal-int +pkg syscall (linux-arm), const TIOCGWINSZ ideal-int +pkg syscall (linux-arm), const TIOCINQ ideal-int +pkg syscall (linux-arm), const TIOCLINUX ideal-int +pkg syscall (linux-arm), const TIOCMBIC ideal-int +pkg syscall (linux-arm), const TIOCMBIS ideal-int +pkg syscall (linux-arm), const TIOCMGET ideal-int +pkg syscall (linux-arm), const TIOCMIWAIT ideal-int +pkg syscall (linux-arm), const TIOCMSET ideal-int +pkg syscall (linux-arm), const TIOCM_CAR ideal-int +pkg syscall (linux-arm), const TIOCM_CD ideal-int +pkg syscall (linux-arm), const TIOCM_CTS ideal-int +pkg syscall (linux-arm), const TIOCM_DSR ideal-int +pkg syscall (linux-arm), const TIOCM_DTR ideal-int +pkg syscall (linux-arm), const TIOCM_LE ideal-int +pkg syscall (linux-arm), const TIOCM_RI ideal-int +pkg syscall (linux-arm), const TIOCM_RNG ideal-int +pkg syscall (linux-arm), const TIOCM_RTS ideal-int +pkg syscall (linux-arm), const TIOCM_SR ideal-int +pkg syscall (linux-arm), const TIOCM_ST ideal-int +pkg syscall (linux-arm), const TIOCNOTTY ideal-int +pkg syscall (linux-arm), const TIOCNXCL ideal-int +pkg syscall (linux-arm), const TIOCOUTQ ideal-int +pkg syscall (linux-arm), const TIOCPKT ideal-int +pkg syscall (linux-arm), const TIOCPKT_DATA ideal-int +pkg syscall (linux-arm), const TIOCPKT_DOSTOP ideal-int +pkg syscall (linux-arm), const TIOCPKT_FLUSHREAD ideal-int +pkg syscall (linux-arm), const TIOCPKT_FLUSHWRITE ideal-int +pkg syscall (linux-arm), const TIOCPKT_IOCTL ideal-int +pkg syscall (linux-arm), const TIOCPKT_NOSTOP ideal-int +pkg syscall (linux-arm), const TIOCPKT_START ideal-int +pkg syscall (linux-arm), const TIOCPKT_STOP ideal-int +pkg syscall (linux-arm), const TIOCSBRK ideal-int +pkg syscall (linux-arm), const TIOCSCTTY ideal-int +pkg syscall (linux-arm), const TIOCSERCONFIG ideal-int +pkg syscall (linux-arm), const TIOCSERGETLSR ideal-int +pkg syscall (linux-arm), const TIOCSERGETMULTI ideal-int +pkg syscall (linux-arm), const TIOCSERGSTRUCT ideal-int +pkg syscall (linux-arm), const TIOCSERGWILD ideal-int +pkg syscall (linux-arm), const TIOCSERSETMULTI ideal-int +pkg syscall (linux-arm), const TIOCSERSWILD ideal-int +pkg syscall (linux-arm), const TIOCSER_TEMT ideal-int +pkg syscall (linux-arm), const TIOCSETD ideal-int +pkg syscall (linux-arm), const TIOCSIG ideal-int +pkg syscall (linux-arm), const TIOCSLCKTRMIOS ideal-int +pkg syscall (linux-arm), const TIOCSPGRP ideal-int +pkg syscall (linux-arm), const TIOCSPTLCK ideal-int +pkg syscall (linux-arm), const TIOCSRS485 ideal-int +pkg syscall (linux-arm), const TIOCSSERIAL ideal-int +pkg syscall (linux-arm), const TIOCSSOFTCAR ideal-int +pkg syscall (linux-arm), const TIOCSTI ideal-int +pkg syscall (linux-arm), const TIOCSWINSZ ideal-int +pkg syscall (linux-arm), const TIOCVHANGUP ideal-int +pkg syscall (linux-arm), const TOSTOP ideal-int +pkg syscall (linux-arm), const TUNATTACHFILTER ideal-int +pkg syscall (linux-arm), const TUNDETACHFILTER ideal-int +pkg syscall (linux-arm), const TUNGETFEATURES ideal-int +pkg syscall (linux-arm), const TUNGETIFF ideal-int +pkg syscall (linux-arm), const TUNGETSNDBUF ideal-int +pkg syscall (linux-arm), const TUNGETVNETHDRSZ ideal-int +pkg syscall (linux-arm), const TUNSETDEBUG ideal-int +pkg syscall (linux-arm), const TUNSETGROUP ideal-int +pkg syscall (linux-arm), const TUNSETIFF ideal-int +pkg syscall (linux-arm), const TUNSETLINK ideal-int +pkg syscall (linux-arm), const TUNSETNOCSUM ideal-int +pkg syscall (linux-arm), const TUNSETOFFLOAD ideal-int +pkg syscall (linux-arm), const TUNSETOWNER ideal-int +pkg syscall (linux-arm), const TUNSETPERSIST ideal-int +pkg syscall (linux-arm), const TUNSETSNDBUF ideal-int +pkg syscall (linux-arm), const TUNSETTXFILTER ideal-int +pkg syscall (linux-arm), const TUNSETVNETHDRSZ ideal-int +pkg syscall (linux-arm), const VDISCARD ideal-int +pkg syscall (linux-arm), const VEOF ideal-int +pkg syscall (linux-arm), const VEOL ideal-int +pkg syscall (linux-arm), const VEOL2 ideal-int +pkg syscall (linux-arm), const VERASE ideal-int +pkg syscall (linux-arm), const VINTR ideal-int +pkg syscall (linux-arm), const VKILL ideal-int +pkg syscall (linux-arm), const VLNEXT ideal-int +pkg syscall (linux-arm), const VMIN ideal-int +pkg syscall (linux-arm), const VQUIT ideal-int +pkg syscall (linux-arm), const VREPRINT ideal-int +pkg syscall (linux-arm), const VSTART ideal-int +pkg syscall (linux-arm), const VSTOP ideal-int +pkg syscall (linux-arm), const VSUSP ideal-int +pkg syscall (linux-arm), const VSWTC ideal-int +pkg syscall (linux-arm), const VTIME ideal-int +pkg syscall (linux-arm), const VWERASE ideal-int +pkg syscall (linux-arm), const WALL ideal-int +pkg syscall (linux-arm), const WCLONE ideal-int +pkg syscall (linux-arm), const WCONTINUED ideal-int +pkg syscall (linux-arm), const WEXITED ideal-int +pkg syscall (linux-arm), const WNOHANG ideal-int +pkg syscall (linux-arm), const WNOTHREAD ideal-int +pkg syscall (linux-arm), const WNOWAIT ideal-int +pkg syscall (linux-arm), const WORDSIZE ideal-int +pkg syscall (linux-arm), const WSTOPPED ideal-int +pkg syscall (linux-arm), const WUNTRACED ideal-int +pkg syscall (linux-arm), const XCASE ideal-int +pkg syscall (linux-arm), func Accept(int) (int, Sockaddr, error) +pkg syscall (linux-arm), func Access(string, uint32) error +pkg syscall (linux-arm), func Acct(string) error +pkg syscall (linux-arm), func Adjtimex(*Timex) (int, error) +pkg syscall (linux-arm), func AttachLsf(int, []SockFilter) error +pkg syscall (linux-arm), func Bind(int, Sockaddr) error +pkg syscall (linux-arm), func BindToDevice(int, string) error +pkg syscall (linux-arm), func Chroot(string) error +pkg syscall (linux-arm), func Close(int) error +pkg syscall (linux-arm), func CloseOnExec(int) +pkg syscall (linux-arm), func CmsgLen(int) int +pkg syscall (linux-arm), func CmsgSpace(int) int +pkg syscall (linux-arm), func Connect(int, Sockaddr) error +pkg syscall (linux-arm), func Creat(string, uint32) (int, error) +pkg syscall (linux-arm), func DetachLsf(int) error +pkg syscall (linux-arm), func Dup(int) (int, error) +pkg syscall (linux-arm), func Dup2(int, int) error +pkg syscall (linux-arm), func EpollCreate(int) (int, error) +pkg syscall (linux-arm), func EpollCreate1(int) (int, error) +pkg syscall (linux-arm), func EpollCtl(int, int, int, *EpollEvent) error +pkg syscall (linux-arm), func EpollWait(int, []EpollEvent, int) (int, error) +pkg syscall (linux-arm), func Faccessat(int, string, uint32, int) error +pkg syscall (linux-arm), func Fallocate(int, uint32, int64, int64) error +pkg syscall (linux-arm), func Fchdir(int) error +pkg syscall (linux-arm), func Fchmod(int, uint32) error +pkg syscall (linux-arm), func Fchmodat(int, string, uint32, int) error +pkg syscall (linux-arm), func Fchown(int, int, int) error +pkg syscall (linux-arm), func Fchownat(int, string, int, int, int) error +pkg syscall (linux-arm), func Fdatasync(int) error +pkg syscall (linux-arm), func Flock(int, int) error +pkg syscall (linux-arm), func ForkExec(string, []string, *ProcAttr) (int, error) +pkg syscall (linux-arm), func Fstat(int, *Stat_t) error +pkg syscall (linux-arm), func Fstatfs(int, *Statfs_t) error +pkg syscall (linux-arm), func Fsync(int) error +pkg syscall (linux-arm), func Ftruncate(int, int64) error +pkg syscall (linux-arm), func Futimes(int, []Timeval) error +pkg syscall (linux-arm), func Futimesat(int, string, []Timeval) error +pkg syscall (linux-arm), func Getcwd([]uint8) (int, error) +pkg syscall (linux-arm), func Getdents(int, []uint8) (int, error) +pkg syscall (linux-arm), func Getpeername(int) (Sockaddr, error) +pkg syscall (linux-arm), func Getpgid(int) (int, error) +pkg syscall (linux-arm), func Getpgrp() int +pkg syscall (linux-arm), func Getrlimit(int, *Rlimit) error +pkg syscall (linux-arm), func Getrusage(int, *Rusage) error +pkg syscall (linux-arm), func Getsockname(int) (Sockaddr, error) +pkg syscall (linux-arm), func GetsockoptIPMreq(int, int, int) (*IPMreq, error) +pkg syscall (linux-arm), func GetsockoptIPMreqn(int, int, int) (*IPMreqn, error) +pkg syscall (linux-arm), func GetsockoptIPv6Mreq(int, int, int) (*IPv6Mreq, error) +pkg syscall (linux-arm), func GetsockoptInet4Addr(int, int, int) ([4]uint8, error) +pkg syscall (linux-arm), func GetsockoptInt(int, int, int) (int, error) +pkg syscall (linux-arm), func Gettid() int +pkg syscall (linux-arm), func InotifyAddWatch(int, string, uint32) (int, error) +pkg syscall (linux-arm), func InotifyInit() (int, error) +pkg syscall (linux-arm), func InotifyInit1(int) (int, error) +pkg syscall (linux-arm), func InotifyRmWatch(int, uint32) (int, error) +pkg syscall (linux-arm), func Kill(int, Signal) error +pkg syscall (linux-arm), func Klogctl(int, []uint8) (int, error) +pkg syscall (linux-arm), func Listen(int, int) error +pkg syscall (linux-arm), func LsfJump(int, int, int, int) *SockFilter +pkg syscall (linux-arm), func LsfSocket(int, int) (int, error) +pkg syscall (linux-arm), func LsfStmt(int, int) *SockFilter +pkg syscall (linux-arm), func Lstat(string, *Stat_t) error +pkg syscall (linux-arm), func Madvise([]uint8, int) error +pkg syscall (linux-arm), func Mkdirat(int, string, uint32) error +pkg syscall (linux-arm), func Mkfifo(string, uint32) error +pkg syscall (linux-arm), func Mknod(string, uint32, int) error +pkg syscall (linux-arm), func Mknodat(int, string, uint32, int) error +pkg syscall (linux-arm), func Mlock([]uint8) error +pkg syscall (linux-arm), func Mlockall(int) error +pkg syscall (linux-arm), func Mmap(int, int64, int, int, int) ([]uint8, error) +pkg syscall (linux-arm), func Mount(string, string, string, uintptr, string) error +pkg syscall (linux-arm), func Mprotect([]uint8, int) error +pkg syscall (linux-arm), func Munlock([]uint8) error +pkg syscall (linux-arm), func Munlockall() error +pkg syscall (linux-arm), func Munmap([]uint8) error +pkg syscall (linux-arm), func Nanosleep(*Timespec, *Timespec) error +pkg syscall (linux-arm), func NetlinkRIB(int, int) ([]uint8, error) +pkg syscall (linux-arm), func NsecToTimespec(int64) Timespec +pkg syscall (linux-arm), func Open(string, int, uint32) (int, error) +pkg syscall (linux-arm), func Openat(int, string, int, uint32) (int, error) +pkg syscall (linux-arm), func ParseDirent([]uint8, int, []string) (int, int, []string) +pkg syscall (linux-arm), func ParseNetlinkMessage([]uint8) ([]NetlinkMessage, error) +pkg syscall (linux-arm), func ParseNetlinkRouteAttr(*NetlinkMessage) ([]NetlinkRouteAttr, error) +pkg syscall (linux-arm), func ParseSocketControlMessage([]uint8) ([]SocketControlMessage, error) +pkg syscall (linux-arm), func ParseUnixCredentials(*SocketControlMessage) (*Ucred, error) +pkg syscall (linux-arm), func ParseUnixRights(*SocketControlMessage) ([]int, error) +pkg syscall (linux-arm), func Pause() error +pkg syscall (linux-arm), func Pipe([]int) error +pkg syscall (linux-arm), func PivotRoot(string, string) error +pkg syscall (linux-arm), func Pread(int, []uint8, int64) (int, error) +pkg syscall (linux-arm), func PtraceAttach(int) error +pkg syscall (linux-arm), func PtraceCont(int, int) error +pkg syscall (linux-arm), func PtraceDetach(int) error +pkg syscall (linux-arm), func PtraceGetEventMsg(int) (uint, error) +pkg syscall (linux-arm), func PtraceGetRegs(int, *PtraceRegs) error +pkg syscall (linux-arm), func PtracePeekData(int, uintptr, []uint8) (int, error) +pkg syscall (linux-arm), func PtracePeekText(int, uintptr, []uint8) (int, error) +pkg syscall (linux-arm), func PtracePokeData(int, uintptr, []uint8) (int, error) +pkg syscall (linux-arm), func PtracePokeText(int, uintptr, []uint8) (int, error) +pkg syscall (linux-arm), func PtraceSetOptions(int, int) error +pkg syscall (linux-arm), func PtraceSetRegs(int, *PtraceRegs) error +pkg syscall (linux-arm), func PtraceSingleStep(int) error +pkg syscall (linux-arm), func Pwrite(int, []uint8, int64) (int, error) +pkg syscall (linux-arm), func RawSyscall(uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno) +pkg syscall (linux-arm), func RawSyscall6(uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno) +pkg syscall (linux-arm), func Read(int, []uint8) (int, error) +pkg syscall (linux-arm), func ReadDirent(int, []uint8) (int, error) +pkg syscall (linux-arm), func Reboot(int) error +pkg syscall (linux-arm), func Recvfrom(int, []uint8, int) (int, Sockaddr, error) +pkg syscall (linux-arm), func Recvmsg(int, []uint8, []uint8, int) (int, int, int, Sockaddr, error) +pkg syscall (linux-arm), func Renameat(int, string, int, string) error +pkg syscall (linux-arm), func Seek(int, int64, int) (int64, error) +pkg syscall (linux-arm), func Select(int, *FdSet, *FdSet, *FdSet, *Timeval) (int, error) +pkg syscall (linux-arm), func Sendfile(int, int, *int64, int) (int, error) +pkg syscall (linux-arm), func Sendmsg(int, []uint8, []uint8, Sockaddr, int) error +pkg syscall (linux-arm), func Sendto(int, []uint8, int, Sockaddr) error +pkg syscall (linux-arm), func SetLsfPromisc(string, bool) error +pkg syscall (linux-arm), func SetNonblock(int, bool) error +pkg syscall (linux-arm), func Setdomainname([]uint8) error +pkg syscall (linux-arm), func Setfsgid(int) error +pkg syscall (linux-arm), func Setfsuid(int) error +pkg syscall (linux-arm), func Setgid(int) error +pkg syscall (linux-arm), func Setgroups([]int) error +pkg syscall (linux-arm), func Sethostname([]uint8) error +pkg syscall (linux-arm), func Setpgid(int, int) error +pkg syscall (linux-arm), func Setregid(int, int) error +pkg syscall (linux-arm), func Setresgid(int, int, int) error +pkg syscall (linux-arm), func Setresuid(int, int, int) error +pkg syscall (linux-arm), func Setreuid(int, int) error +pkg syscall (linux-arm), func Setrlimit(int, *Rlimit) error +pkg syscall (linux-arm), func Setsid() (int, error) +pkg syscall (linux-arm), func SetsockoptIPMreq(int, int, int, *IPMreq) error +pkg syscall (linux-arm), func SetsockoptIPMreqn(int, int, int, *IPMreqn) error +pkg syscall (linux-arm), func SetsockoptIPv6Mreq(int, int, int, *IPv6Mreq) error +pkg syscall (linux-arm), func SetsockoptInet4Addr(int, int, int, [4]uint8) error +pkg syscall (linux-arm), func SetsockoptInt(int, int, int, int) error +pkg syscall (linux-arm), func SetsockoptLinger(int, int, int, *Linger) error +pkg syscall (linux-arm), func SetsockoptString(int, int, int, string) error +pkg syscall (linux-arm), func SetsockoptTimeval(int, int, int, *Timeval) error +pkg syscall (linux-arm), func Settimeofday(*Timeval) error +pkg syscall (linux-arm), func Setuid(int) error +pkg syscall (linux-arm), func Shutdown(int, int) error +pkg syscall (linux-arm), func Socket(int, int, int) (int, error) +pkg syscall (linux-arm), func Socketpair(int, int, int) ([2]int, error) +pkg syscall (linux-arm), func Splice(int, *int64, int, *int64, int, int) (int, error) +pkg syscall (linux-arm), func Stat(string, *Stat_t) error +pkg syscall (linux-arm), func Statfs(string, *Statfs_t) error +pkg syscall (linux-arm), func StringSlicePtr([]string) []*uint8 +pkg syscall (linux-arm), func Sync() +pkg syscall (linux-arm), func Syscall(uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno) +pkg syscall (linux-arm), func Syscall6(uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno) +pkg syscall (linux-arm), func Sysinfo(*Sysinfo_t) error +pkg syscall (linux-arm), func Tee(int, int, int, int) (int64, error) +pkg syscall (linux-arm), func Tgkill(int, int, Signal) error +pkg syscall (linux-arm), func Time(*Time_t) (Time_t, error) +pkg syscall (linux-arm), func Times(*Tms) (uintptr, error) +pkg syscall (linux-arm), func TimespecToNsec(Timespec) int64 +pkg syscall (linux-arm), func Truncate(string, int64) error +pkg syscall (linux-arm), func Umask(int) int +pkg syscall (linux-arm), func Uname(*Utsname) error +pkg syscall (linux-arm), func UnixCredentials(*Ucred) []uint8 +pkg syscall (linux-arm), func UnixRights(...int) []uint8 +pkg syscall (linux-arm), func Unlinkat(int, string) error +pkg syscall (linux-arm), func Unmount(string, int) error +pkg syscall (linux-arm), func Unshare(int) error +pkg syscall (linux-arm), func Ustat(int, *Ustat_t) error +pkg syscall (linux-arm), func Utime(string, *Utimbuf) error +pkg syscall (linux-arm), func Wait4(int, *WaitStatus, int, *Rusage) (int, error) +pkg syscall (linux-arm), func Write(int, []uint8) (int, error) +pkg syscall (linux-arm), method (*Cmsghdr) SetLen(int) +pkg syscall (linux-arm), method (*Iovec) SetLen(int) +pkg syscall (linux-arm), method (*Msghdr) SetControllen(int) +pkg syscall (linux-arm), method (*PtraceRegs) PC() uint64 +pkg syscall (linux-arm), method (*PtraceRegs) SetPC(uint64) +pkg syscall (linux-arm), type Cmsghdr struct +pkg syscall (linux-arm), type Cmsghdr struct, Len uint32 +pkg syscall (linux-arm), type Cmsghdr struct, Level int32 +pkg syscall (linux-arm), type Cmsghdr struct, Type int32 +pkg syscall (linux-arm), type Cmsghdr struct, X__cmsg_data [0]uint8 +pkg syscall (linux-arm), type Credential struct +pkg syscall (linux-arm), type Credential struct, Gid uint32 +pkg syscall (linux-arm), type Credential struct, Groups []uint32 +pkg syscall (linux-arm), type Credential struct, Uid uint32 +pkg syscall (linux-arm), type Dirent struct +pkg syscall (linux-arm), type Dirent struct, Ino uint64 +pkg syscall (linux-arm), type Dirent struct, Name [256]uint8 +pkg syscall (linux-arm), type Dirent struct, Off int64 +pkg syscall (linux-arm), type Dirent struct, Pad_cgo_0 [5]uint8 +pkg syscall (linux-arm), type Dirent struct, Reclen uint16 +pkg syscall (linux-arm), type Dirent struct, Type uint8 +pkg syscall (linux-arm), type EpollEvent struct +pkg syscall (linux-arm), type EpollEvent struct, Events uint32 +pkg syscall (linux-arm), type EpollEvent struct, Fd int32 +pkg syscall (linux-arm), type EpollEvent struct, Pad int32 +pkg syscall (linux-arm), type EpollEvent struct, PadFd int32 +pkg syscall (linux-arm), type FdSet struct +pkg syscall (linux-arm), type FdSet struct, Bits [32]int32 +pkg syscall (linux-arm), type Fsid struct +pkg syscall (linux-arm), type Fsid struct, X__val [2]int32 +pkg syscall (linux-arm), type IPMreqn struct +pkg syscall (linux-arm), type IPMreqn struct, Address [4]uint8 +pkg syscall (linux-arm), type IPMreqn struct, Ifindex int32 +pkg syscall (linux-arm), type IPMreqn struct, Multiaddr [4]uint8 +pkg syscall (linux-arm), type IfAddrmsg struct +pkg syscall (linux-arm), type IfAddrmsg struct, Family uint8 +pkg syscall (linux-arm), type IfAddrmsg struct, Flags uint8 +pkg syscall (linux-arm), type IfAddrmsg struct, Index uint32 +pkg syscall (linux-arm), type IfAddrmsg struct, Prefixlen uint8 +pkg syscall (linux-arm), type IfAddrmsg struct, Scope uint8 +pkg syscall (linux-arm), type IfInfomsg struct +pkg syscall (linux-arm), type IfInfomsg struct, Change uint32 +pkg syscall (linux-arm), type IfInfomsg struct, Family uint8 +pkg syscall (linux-arm), type IfInfomsg struct, Flags uint32 +pkg syscall (linux-arm), type IfInfomsg struct, Index int32 +pkg syscall (linux-arm), type IfInfomsg struct, Type uint16 +pkg syscall (linux-arm), type IfInfomsg struct, X__ifi_pad uint8 +pkg syscall (linux-arm), type Inet4Pktinfo struct +pkg syscall (linux-arm), type Inet4Pktinfo struct, Addr [4]uint8 +pkg syscall (linux-arm), type Inet4Pktinfo struct, Ifindex int32 +pkg syscall (linux-arm), type Inet4Pktinfo struct, Spec_dst [4]uint8 +pkg syscall (linux-arm), type Inet6Pktinfo struct +pkg syscall (linux-arm), type Inet6Pktinfo struct, Addr [16]uint8 +pkg syscall (linux-arm), type Inet6Pktinfo struct, Ifindex uint32 +pkg syscall (linux-arm), type InotifyEvent struct +pkg syscall (linux-arm), type InotifyEvent struct, Cookie uint32 +pkg syscall (linux-arm), type InotifyEvent struct, Len uint32 +pkg syscall (linux-arm), type InotifyEvent struct, Mask uint32 +pkg syscall (linux-arm), type InotifyEvent struct, Name [0]uint8 +pkg syscall (linux-arm), type InotifyEvent struct, Wd int32 +pkg syscall (linux-arm), type Iovec struct +pkg syscall (linux-arm), type Iovec struct, Base *uint8 +pkg syscall (linux-arm), type Iovec struct, Len uint32 +pkg syscall (linux-arm), type Msghdr struct +pkg syscall (linux-arm), type Msghdr struct, Control *uint8 +pkg syscall (linux-arm), type Msghdr struct, Controllen uint32 +pkg syscall (linux-arm), type Msghdr struct, Flags int32 +pkg syscall (linux-arm), type Msghdr struct, Iov *Iovec +pkg syscall (linux-arm), type Msghdr struct, Iovlen uint32 +pkg syscall (linux-arm), type Msghdr struct, Name *uint8 +pkg syscall (linux-arm), type Msghdr struct, Namelen uint32 +pkg syscall (linux-arm), type NetlinkMessage struct +pkg syscall (linux-arm), type NetlinkMessage struct, Data []uint8 +pkg syscall (linux-arm), type NetlinkMessage struct, Header NlMsghdr +pkg syscall (linux-arm), type NetlinkRouteAttr struct +pkg syscall (linux-arm), type NetlinkRouteAttr struct, Attr RtAttr +pkg syscall (linux-arm), type NetlinkRouteAttr struct, Value []uint8 +pkg syscall (linux-arm), type NetlinkRouteRequest struct +pkg syscall (linux-arm), type NetlinkRouteRequest struct, Data RtGenmsg +pkg syscall (linux-arm), type NetlinkRouteRequest struct, Header NlMsghdr +pkg syscall (linux-arm), type NlAttr struct +pkg syscall (linux-arm), type NlAttr struct, Len uint16 +pkg syscall (linux-arm), type NlAttr struct, Type uint16 +pkg syscall (linux-arm), type NlMsgerr struct +pkg syscall (linux-arm), type NlMsgerr struct, Error int32 +pkg syscall (linux-arm), type NlMsgerr struct, Msg NlMsghdr +pkg syscall (linux-arm), type NlMsghdr struct +pkg syscall (linux-arm), type NlMsghdr struct, Flags uint16 +pkg syscall (linux-arm), type NlMsghdr struct, Len uint32 +pkg syscall (linux-arm), type NlMsghdr struct, Pid uint32 +pkg syscall (linux-arm), type NlMsghdr struct, Seq uint32 +pkg syscall (linux-arm), type NlMsghdr struct, Type uint16 +pkg syscall (linux-arm), type PtraceRegs struct +pkg syscall (linux-arm), type PtraceRegs struct, Uregs [18]uint32 +pkg syscall (linux-arm), type RawSockaddr struct, Data [14]uint8 +pkg syscall (linux-arm), type RawSockaddr struct, Family uint16 +pkg syscall (linux-arm), type RawSockaddrAny struct, Pad [96]uint8 +pkg syscall (linux-arm), type RawSockaddrInet4 struct, Family uint16 +pkg syscall (linux-arm), type RawSockaddrInet4 struct, Zero [8]uint8 +pkg syscall (linux-arm), type RawSockaddrInet6 struct +pkg syscall (linux-arm), type RawSockaddrInet6 struct, Addr [16]uint8 +pkg syscall (linux-arm), type RawSockaddrInet6 struct, Family uint16 +pkg syscall (linux-arm), type RawSockaddrInet6 struct, Flowinfo uint32 +pkg syscall (linux-arm), type RawSockaddrInet6 struct, Port uint16 +pkg syscall (linux-arm), type RawSockaddrInet6 struct, Scope_id uint32 +pkg syscall (linux-arm), type RawSockaddrLinklayer struct +pkg syscall (linux-arm), type RawSockaddrLinklayer struct, Addr [8]uint8 +pkg syscall (linux-arm), type RawSockaddrLinklayer struct, Family uint16 +pkg syscall (linux-arm), type RawSockaddrLinklayer struct, Halen uint8 +pkg syscall (linux-arm), type RawSockaddrLinklayer struct, Hatype uint16 +pkg syscall (linux-arm), type RawSockaddrLinklayer struct, Ifindex int32 +pkg syscall (linux-arm), type RawSockaddrLinklayer struct, Pkttype uint8 +pkg syscall (linux-arm), type RawSockaddrLinklayer struct, Protocol uint16 +pkg syscall (linux-arm), type RawSockaddrNetlink struct +pkg syscall (linux-arm), type RawSockaddrNetlink struct, Family uint16 +pkg syscall (linux-arm), type RawSockaddrNetlink struct, Groups uint32 +pkg syscall (linux-arm), type RawSockaddrNetlink struct, Pad uint16 +pkg syscall (linux-arm), type RawSockaddrNetlink struct, Pid uint32 +pkg syscall (linux-arm), type RawSockaddrUnix struct +pkg syscall (linux-arm), type RawSockaddrUnix struct, Family uint16 +pkg syscall (linux-arm), type RawSockaddrUnix struct, Path [108]int8 +pkg syscall (linux-arm), type Rlimit struct +pkg syscall (linux-arm), type Rlimit struct, Cur uint64 +pkg syscall (linux-arm), type Rlimit struct, Max uint64 +pkg syscall (linux-arm), type RtAttr struct +pkg syscall (linux-arm), type RtAttr struct, Len uint16 +pkg syscall (linux-arm), type RtAttr struct, Type uint16 +pkg syscall (linux-arm), type RtGenmsg struct +pkg syscall (linux-arm), type RtGenmsg struct, Family uint8 +pkg syscall (linux-arm), type RtMsg struct +pkg syscall (linux-arm), type RtMsg struct, Dst_len uint8 +pkg syscall (linux-arm), type RtMsg struct, Family uint8 +pkg syscall (linux-arm), type RtMsg struct, Flags uint32 +pkg syscall (linux-arm), type RtMsg struct, Protocol uint8 +pkg syscall (linux-arm), type RtMsg struct, Scope uint8 +pkg syscall (linux-arm), type RtMsg struct, Src_len uint8 +pkg syscall (linux-arm), type RtMsg struct, Table uint8 +pkg syscall (linux-arm), type RtMsg struct, Tos uint8 +pkg syscall (linux-arm), type RtMsg struct, Type uint8 +pkg syscall (linux-arm), type RtNexthop struct +pkg syscall (linux-arm), type RtNexthop struct, Flags uint8 +pkg syscall (linux-arm), type RtNexthop struct, Hops uint8 +pkg syscall (linux-arm), type RtNexthop struct, Ifindex int32 +pkg syscall (linux-arm), type RtNexthop struct, Len uint16 +pkg syscall (linux-arm), type Rusage struct, Idrss int32 +pkg syscall (linux-arm), type Rusage struct, Inblock int32 +pkg syscall (linux-arm), type Rusage struct, Isrss int32 +pkg syscall (linux-arm), type Rusage struct, Ixrss int32 +pkg syscall (linux-arm), type Rusage struct, Majflt int32 +pkg syscall (linux-arm), type Rusage struct, Maxrss int32 +pkg syscall (linux-arm), type Rusage struct, Minflt int32 +pkg syscall (linux-arm), type Rusage struct, Msgrcv int32 +pkg syscall (linux-arm), type Rusage struct, Msgsnd int32 +pkg syscall (linux-arm), type Rusage struct, Nivcsw int32 +pkg syscall (linux-arm), type Rusage struct, Nsignals int32 +pkg syscall (linux-arm), type Rusage struct, Nswap int32 +pkg syscall (linux-arm), type Rusage struct, Nvcsw int32 +pkg syscall (linux-arm), type Rusage struct, Oublock int32 +pkg syscall (linux-arm), type Rusage struct, Stime Timeval +pkg syscall (linux-arm), type Rusage struct, Utime Timeval +pkg syscall (linux-arm), type SockFilter struct +pkg syscall (linux-arm), type SockFilter struct, Code uint16 +pkg syscall (linux-arm), type SockFilter struct, Jf uint8 +pkg syscall (linux-arm), type SockFilter struct, Jt uint8 +pkg syscall (linux-arm), type SockFilter struct, K uint32 +pkg syscall (linux-arm), type SockFprog struct +pkg syscall (linux-arm), type SockFprog struct, Filter *SockFilter +pkg syscall (linux-arm), type SockFprog struct, Len uint16 +pkg syscall (linux-arm), type SockFprog struct, Pad_cgo_0 [2]uint8 +pkg syscall (linux-arm), type SockaddrLinklayer struct +pkg syscall (linux-arm), type SockaddrLinklayer struct, Addr [8]uint8 +pkg syscall (linux-arm), type SockaddrLinklayer struct, Halen uint8 +pkg syscall (linux-arm), type SockaddrLinklayer struct, Hatype uint16 +pkg syscall (linux-arm), type SockaddrLinklayer struct, Ifindex int +pkg syscall (linux-arm), type SockaddrLinklayer struct, Pkttype uint8 +pkg syscall (linux-arm), type SockaddrLinklayer struct, Protocol uint16 +pkg syscall (linux-arm), type SockaddrNetlink struct +pkg syscall (linux-arm), type SockaddrNetlink struct, Family uint16 +pkg syscall (linux-arm), type SockaddrNetlink struct, Groups uint32 +pkg syscall (linux-arm), type SockaddrNetlink struct, Pad uint16 +pkg syscall (linux-arm), type SockaddrNetlink struct, Pid uint32 +pkg syscall (linux-arm), type SocketControlMessage struct +pkg syscall (linux-arm), type SocketControlMessage struct, Data []uint8 +pkg syscall (linux-arm), type SocketControlMessage struct, Header Cmsghdr +pkg syscall (linux-arm), type Stat_t struct +pkg syscall (linux-arm), type Stat_t struct, Atim Timespec +pkg syscall (linux-arm), type Stat_t struct, Blksize int32 +pkg syscall (linux-arm), type Stat_t struct, Blocks int64 +pkg syscall (linux-arm), type Stat_t struct, Ctim Timespec +pkg syscall (linux-arm), type Stat_t struct, Dev uint64 +pkg syscall (linux-arm), type Stat_t struct, Gid uint32 +pkg syscall (linux-arm), type Stat_t struct, Ino uint64 +pkg syscall (linux-arm), type Stat_t struct, Mode uint32 +pkg syscall (linux-arm), type Stat_t struct, Mtim Timespec +pkg syscall (linux-arm), type Stat_t struct, Nlink uint32 +pkg syscall (linux-arm), type Stat_t struct, Pad_cgo_0 [2]uint8 +pkg syscall (linux-arm), type Stat_t struct, Pad_cgo_1 [6]uint8 +pkg syscall (linux-arm), type Stat_t struct, Pad_cgo_2 [4]uint8 +pkg syscall (linux-arm), type Stat_t struct, Rdev uint64 +pkg syscall (linux-arm), type Stat_t struct, Size int64 +pkg syscall (linux-arm), type Stat_t struct, Uid uint32 +pkg syscall (linux-arm), type Stat_t struct, X__pad1 uint16 +pkg syscall (linux-arm), type Stat_t struct, X__pad2 uint16 +pkg syscall (linux-arm), type Stat_t struct, X__st_ino uint32 +pkg syscall (linux-arm), type Statfs_t struct +pkg syscall (linux-arm), type Statfs_t struct, Bavail uint64 +pkg syscall (linux-arm), type Statfs_t struct, Bfree uint64 +pkg syscall (linux-arm), type Statfs_t struct, Blocks uint64 +pkg syscall (linux-arm), type Statfs_t struct, Bsize int32 +pkg syscall (linux-arm), type Statfs_t struct, Ffree uint64 +pkg syscall (linux-arm), type Statfs_t struct, Files uint64 +pkg syscall (linux-arm), type Statfs_t struct, Flags int32 +pkg syscall (linux-arm), type Statfs_t struct, Frsize int32 +pkg syscall (linux-arm), type Statfs_t struct, Fsid Fsid +pkg syscall (linux-arm), type Statfs_t struct, Namelen int32 +pkg syscall (linux-arm), type Statfs_t struct, Pad_cgo_0 [4]uint8 +pkg syscall (linux-arm), type Statfs_t struct, Spare [4]int32 +pkg syscall (linux-arm), type Statfs_t struct, Type int32 +pkg syscall (linux-arm), type SysProcAttr struct, Chroot string +pkg syscall (linux-arm), type SysProcAttr struct, Credential *Credential +pkg syscall (linux-arm), type SysProcAttr struct, Noctty bool +pkg syscall (linux-arm), type SysProcAttr struct, Pdeathsig Signal +pkg syscall (linux-arm), type SysProcAttr struct, Ptrace bool +pkg syscall (linux-arm), type SysProcAttr struct, Setctty bool +pkg syscall (linux-arm), type SysProcAttr struct, Setpgid bool +pkg syscall (linux-arm), type SysProcAttr struct, Setsid bool +pkg syscall (linux-arm), type Sysinfo_t struct +pkg syscall (linux-arm), type Sysinfo_t struct, Bufferram uint32 +pkg syscall (linux-arm), type Sysinfo_t struct, Freehigh uint32 +pkg syscall (linux-arm), type Sysinfo_t struct, Freeram uint32 +pkg syscall (linux-arm), type Sysinfo_t struct, Freeswap uint32 +pkg syscall (linux-arm), type Sysinfo_t struct, Loads [3]uint32 +pkg syscall (linux-arm), type Sysinfo_t struct, Pad uint16 +pkg syscall (linux-arm), type Sysinfo_t struct, Procs uint16 +pkg syscall (linux-arm), type Sysinfo_t struct, Sharedram uint32 +pkg syscall (linux-arm), type Sysinfo_t struct, Totalhigh uint32 +pkg syscall (linux-arm), type Sysinfo_t struct, Totalram uint32 +pkg syscall (linux-arm), type Sysinfo_t struct, Totalswap uint32 +pkg syscall (linux-arm), type Sysinfo_t struct, Unit uint32 +pkg syscall (linux-arm), type Sysinfo_t struct, Uptime int32 +pkg syscall (linux-arm), type Sysinfo_t struct, X_f [8]uint8 +pkg syscall (linux-arm), type Termios struct +pkg syscall (linux-arm), type Termios struct, Cc [32]uint8 +pkg syscall (linux-arm), type Termios struct, Cflag uint32 +pkg syscall (linux-arm), type Termios struct, Iflag uint32 +pkg syscall (linux-arm), type Termios struct, Ispeed uint32 +pkg syscall (linux-arm), type Termios struct, Lflag uint32 +pkg syscall (linux-arm), type Termios struct, Line uint8 +pkg syscall (linux-arm), type Termios struct, Oflag uint32 +pkg syscall (linux-arm), type Termios struct, Ospeed uint32 +pkg syscall (linux-arm), type Termios struct, Pad_cgo_0 [3]uint8 +pkg syscall (linux-arm), type Time_t int32 +pkg syscall (linux-arm), type Timespec struct, Nsec int32 +pkg syscall (linux-arm), type Timespec struct, Sec int32 +pkg syscall (linux-arm), type Timeval struct, Sec int32 +pkg syscall (linux-arm), type Timeval struct, Usec int32 +pkg syscall (linux-arm), type Timex struct +pkg syscall (linux-arm), type Timex struct, Calcnt int32 +pkg syscall (linux-arm), type Timex struct, Constant int32 +pkg syscall (linux-arm), type Timex struct, Errcnt int32 +pkg syscall (linux-arm), type Timex struct, Esterror int32 +pkg syscall (linux-arm), type Timex struct, Freq int32 +pkg syscall (linux-arm), type Timex struct, Jitcnt int32 +pkg syscall (linux-arm), type Timex struct, Jitter int32 +pkg syscall (linux-arm), type Timex struct, Maxerror int32 +pkg syscall (linux-arm), type Timex struct, Modes uint32 +pkg syscall (linux-arm), type Timex struct, Offset int32 +pkg syscall (linux-arm), type Timex struct, Pad_cgo_0 [44]uint8 +pkg syscall (linux-arm), type Timex struct, Ppsfreq int32 +pkg syscall (linux-arm), type Timex struct, Precision int32 +pkg syscall (linux-arm), type Timex struct, Shift int32 +pkg syscall (linux-arm), type Timex struct, Stabil int32 +pkg syscall (linux-arm), type Timex struct, Status int32 +pkg syscall (linux-arm), type Timex struct, Stbcnt int32 +pkg syscall (linux-arm), type Timex struct, Tai int32 +pkg syscall (linux-arm), type Timex struct, Tick int32 +pkg syscall (linux-arm), type Timex struct, Time Timeval +pkg syscall (linux-arm), type Timex struct, Tolerance int32 +pkg syscall (linux-arm), type Tms struct +pkg syscall (linux-arm), type Tms struct, Cstime int32 +pkg syscall (linux-arm), type Tms struct, Cutime int32 +pkg syscall (linux-arm), type Tms struct, Stime int32 +pkg syscall (linux-arm), type Tms struct, Utime int32 +pkg syscall (linux-arm), type Ucred struct +pkg syscall (linux-arm), type Ucred struct, Gid uint32 +pkg syscall (linux-arm), type Ucred struct, Pid int32 +pkg syscall (linux-arm), type Ucred struct, Uid uint32 +pkg syscall (linux-arm), type Ustat_t struct +pkg syscall (linux-arm), type Ustat_t struct, Fname [6]uint8 +pkg syscall (linux-arm), type Ustat_t struct, Fpack [6]uint8 +pkg syscall (linux-arm), type Ustat_t struct, Tfree int32 +pkg syscall (linux-arm), type Ustat_t struct, Tinode uint32 +pkg syscall (linux-arm), type Utimbuf struct +pkg syscall (linux-arm), type Utimbuf struct, Actime int32 +pkg syscall (linux-arm), type Utimbuf struct, Modtime int32 +pkg syscall (linux-arm), type Utsname struct +pkg syscall (linux-arm), type Utsname struct, Domainname [65]uint8 +pkg syscall (linux-arm), type Utsname struct, Machine [65]uint8 +pkg syscall (linux-arm), type Utsname struct, Nodename [65]uint8 +pkg syscall (linux-arm), type Utsname struct, Release [65]uint8 +pkg syscall (linux-arm), type Utsname struct, Sysname [65]uint8 +pkg syscall (linux-arm), type Utsname struct, Version [65]uint8 +pkg syscall (linux-arm), type WaitStatus uint32 +pkg syscall (linux-arm), var Stderr int +pkg syscall (linux-arm), var Stdin int +pkg syscall (linux-arm), var Stdout int +pkg syscall (windows-386), const AF_NETBIOS ideal-int +pkg syscall (windows-386), const APPLICATION_ERROR ideal-int +pkg syscall (windows-386), const AUTHTYPE_CLIENT ideal-int +pkg syscall (windows-386), const AUTHTYPE_SERVER ideal-int +pkg syscall (windows-386), const CERT_CHAIN_POLICY_AUTHENTICODE ideal-int +pkg syscall (windows-386), const CERT_CHAIN_POLICY_AUTHENTICODE_TS ideal-int +pkg syscall (windows-386), const CERT_CHAIN_POLICY_BASE ideal-int +pkg syscall (windows-386), const CERT_CHAIN_POLICY_BASIC_CONSTRAINTS ideal-int +pkg syscall (windows-386), const CERT_CHAIN_POLICY_EV ideal-int +pkg syscall (windows-386), const CERT_CHAIN_POLICY_MICROSOFT_ROOT ideal-int +pkg syscall (windows-386), const CERT_CHAIN_POLICY_NT_AUTH ideal-int +pkg syscall (windows-386), const CERT_CHAIN_POLICY_SSL ideal-int +pkg syscall (windows-386), const CERT_E_CN_NO_MATCH ideal-int +pkg syscall (windows-386), const CERT_E_EXPIRED ideal-int +pkg syscall (windows-386), const CERT_E_PURPOSE ideal-int +pkg syscall (windows-386), const CERT_E_ROLE ideal-int +pkg syscall (windows-386), const CERT_E_UNTRUSTEDROOT ideal-int +pkg syscall (windows-386), const CERT_STORE_ADD_ALWAYS ideal-int +pkg syscall (windows-386), const CERT_STORE_DEFER_CLOSE_UNTIL_LAST_FREE_FLAG ideal-int +pkg syscall (windows-386), const CERT_STORE_PROV_MEMORY ideal-int +pkg syscall (windows-386), const CERT_TRUST_HAS_EXCLUDED_NAME_CONSTRAINT ideal-int +pkg syscall (windows-386), const CERT_TRUST_HAS_NOT_DEFINED_NAME_CONSTRAINT ideal-int +pkg syscall (windows-386), const CERT_TRUST_HAS_NOT_PERMITTED_NAME_CONSTRAINT ideal-int +pkg syscall (windows-386), const CERT_TRUST_HAS_NOT_SUPPORTED_CRITICAL_EXT ideal-int +pkg syscall (windows-386), const CERT_TRUST_HAS_NOT_SUPPORTED_NAME_CONSTRAINT ideal-int +pkg syscall (windows-386), const CERT_TRUST_INVALID_BASIC_CONSTRAINTS ideal-int +pkg syscall (windows-386), const CERT_TRUST_INVALID_EXTENSION ideal-int +pkg syscall (windows-386), const CERT_TRUST_INVALID_NAME_CONSTRAINTS ideal-int +pkg syscall (windows-386), const CERT_TRUST_INVALID_POLICY_CONSTRAINTS ideal-int +pkg syscall (windows-386), const CERT_TRUST_IS_CYCLIC ideal-int +pkg syscall (windows-386), const CERT_TRUST_IS_EXPLICIT_DISTRUST ideal-int +pkg syscall (windows-386), const CERT_TRUST_IS_NOT_SIGNATURE_VALID ideal-int +pkg syscall (windows-386), const CERT_TRUST_IS_NOT_TIME_VALID ideal-int +pkg syscall (windows-386), const CERT_TRUST_IS_NOT_VALID_FOR_USAGE ideal-int +pkg syscall (windows-386), const CERT_TRUST_IS_OFFLINE_REVOCATION ideal-int +pkg syscall (windows-386), const CERT_TRUST_IS_REVOKED ideal-int +pkg syscall (windows-386), const CERT_TRUST_IS_UNTRUSTED_ROOT ideal-int +pkg syscall (windows-386), const CERT_TRUST_NO_ERROR ideal-int +pkg syscall (windows-386), const CERT_TRUST_NO_ISSUANCE_CHAIN_POLICY ideal-int +pkg syscall (windows-386), const CERT_TRUST_REVOCATION_STATUS_UNKNOWN ideal-int +pkg syscall (windows-386), const CREATE_ALWAYS ideal-int +pkg syscall (windows-386), const CREATE_NEW ideal-int +pkg syscall (windows-386), const CREATE_UNICODE_ENVIRONMENT ideal-int +pkg syscall (windows-386), const CRYPT_DEFAULT_CONTAINER_OPTIONAL ideal-int +pkg syscall (windows-386), const CRYPT_DELETEKEYSET ideal-int +pkg syscall (windows-386), const CRYPT_MACHINE_KEYSET ideal-int +pkg syscall (windows-386), const CRYPT_NEWKEYSET ideal-int +pkg syscall (windows-386), const CRYPT_SILENT ideal-int +pkg syscall (windows-386), const CRYPT_VERIFYCONTEXT ideal-int +pkg syscall (windows-386), const DNS_TYPE_A ideal-int +pkg syscall (windows-386), const DNS_TYPE_A6 ideal-int +pkg syscall (windows-386), const DNS_TYPE_AAAA ideal-int +pkg syscall (windows-386), const DNS_TYPE_ADDRS ideal-int +pkg syscall (windows-386), const DNS_TYPE_AFSDB ideal-int +pkg syscall (windows-386), const DNS_TYPE_ALL ideal-int +pkg syscall (windows-386), const DNS_TYPE_ANY ideal-int +pkg syscall (windows-386), const DNS_TYPE_ATMA ideal-int +pkg syscall (windows-386), const DNS_TYPE_AXFR ideal-int +pkg syscall (windows-386), const DNS_TYPE_CERT ideal-int +pkg syscall (windows-386), const DNS_TYPE_CNAME ideal-int +pkg syscall (windows-386), const DNS_TYPE_DHCID ideal-int +pkg syscall (windows-386), const DNS_TYPE_DNAME ideal-int +pkg syscall (windows-386), const DNS_TYPE_DNSKEY ideal-int +pkg syscall (windows-386), const DNS_TYPE_DS ideal-int +pkg syscall (windows-386), const DNS_TYPE_EID ideal-int +pkg syscall (windows-386), const DNS_TYPE_GID ideal-int +pkg syscall (windows-386), const DNS_TYPE_GPOS ideal-int +pkg syscall (windows-386), const DNS_TYPE_HINFO ideal-int +pkg syscall (windows-386), const DNS_TYPE_ISDN ideal-int +pkg syscall (windows-386), const DNS_TYPE_IXFR ideal-int +pkg syscall (windows-386), const DNS_TYPE_KEY ideal-int +pkg syscall (windows-386), const DNS_TYPE_KX ideal-int +pkg syscall (windows-386), const DNS_TYPE_LOC ideal-int +pkg syscall (windows-386), const DNS_TYPE_MAILA ideal-int +pkg syscall (windows-386), const DNS_TYPE_MAILB ideal-int +pkg syscall (windows-386), const DNS_TYPE_MB ideal-int +pkg syscall (windows-386), const DNS_TYPE_MD ideal-int +pkg syscall (windows-386), const DNS_TYPE_MF ideal-int +pkg syscall (windows-386), const DNS_TYPE_MG ideal-int +pkg syscall (windows-386), const DNS_TYPE_MINFO ideal-int +pkg syscall (windows-386), const DNS_TYPE_MR ideal-int +pkg syscall (windows-386), const DNS_TYPE_MX ideal-int +pkg syscall (windows-386), const DNS_TYPE_NAPTR ideal-int +pkg syscall (windows-386), const DNS_TYPE_NBSTAT ideal-int +pkg syscall (windows-386), const DNS_TYPE_NIMLOC ideal-int +pkg syscall (windows-386), const DNS_TYPE_NS ideal-int +pkg syscall (windows-386), const DNS_TYPE_NSAP ideal-int +pkg syscall (windows-386), const DNS_TYPE_NSAPPTR ideal-int +pkg syscall (windows-386), const DNS_TYPE_NSEC ideal-int +pkg syscall (windows-386), const DNS_TYPE_NULL ideal-int +pkg syscall (windows-386), const DNS_TYPE_NXT ideal-int +pkg syscall (windows-386), const DNS_TYPE_OPT ideal-int +pkg syscall (windows-386), const DNS_TYPE_PTR ideal-int +pkg syscall (windows-386), const DNS_TYPE_PX ideal-int +pkg syscall (windows-386), const DNS_TYPE_RP ideal-int +pkg syscall (windows-386), const DNS_TYPE_RRSIG ideal-int +pkg syscall (windows-386), const DNS_TYPE_RT ideal-int +pkg syscall (windows-386), const DNS_TYPE_SIG ideal-int +pkg syscall (windows-386), const DNS_TYPE_SINK ideal-int +pkg syscall (windows-386), const DNS_TYPE_SOA ideal-int +pkg syscall (windows-386), const DNS_TYPE_SRV ideal-int +pkg syscall (windows-386), const DNS_TYPE_TEXT ideal-int +pkg syscall (windows-386), const DNS_TYPE_TKEY ideal-int +pkg syscall (windows-386), const DNS_TYPE_TSIG ideal-int +pkg syscall (windows-386), const DNS_TYPE_UID ideal-int +pkg syscall (windows-386), const DNS_TYPE_UINFO ideal-int +pkg syscall (windows-386), const DNS_TYPE_UNSPEC ideal-int +pkg syscall (windows-386), const DNS_TYPE_WINS ideal-int +pkg syscall (windows-386), const DNS_TYPE_WINSR ideal-int +pkg syscall (windows-386), const DNS_TYPE_WKS ideal-int +pkg syscall (windows-386), const DNS_TYPE_X25 ideal-int +pkg syscall (windows-386), const DUPLICATE_CLOSE_SOURCE ideal-int +pkg syscall (windows-386), const DUPLICATE_SAME_ACCESS ideal-int +pkg syscall (windows-386), const EADV Errno +pkg syscall (windows-386), const EBADE Errno +pkg syscall (windows-386), const EBADFD Errno +pkg syscall (windows-386), const EBADMSG Errno +pkg syscall (windows-386), const EBADR Errno +pkg syscall (windows-386), const EBADRQC Errno +pkg syscall (windows-386), const EBADSLT Errno +pkg syscall (windows-386), const EBFONT Errno +pkg syscall (windows-386), const ECHRNG Errno +pkg syscall (windows-386), const ECOMM Errno +pkg syscall (windows-386), const EDEADLOCK Errno +pkg syscall (windows-386), const EDOTDOT Errno +pkg syscall (windows-386), const EISNAM Errno +pkg syscall (windows-386), const EKEYEXPIRED Errno +pkg syscall (windows-386), const EKEYREJECTED Errno +pkg syscall (windows-386), const EKEYREVOKED Errno +pkg syscall (windows-386), const EL2HLT Errno +pkg syscall (windows-386), const EL2NSYNC Errno +pkg syscall (windows-386), const EL3HLT Errno +pkg syscall (windows-386), const EL3RST Errno +pkg syscall (windows-386), const ELIBACC Errno +pkg syscall (windows-386), const ELIBBAD Errno +pkg syscall (windows-386), const ELIBEXEC Errno +pkg syscall (windows-386), const ELIBMAX Errno +pkg syscall (windows-386), const ELIBSCN Errno +pkg syscall (windows-386), const ELNRNG Errno +pkg syscall (windows-386), const EMEDIUMTYPE Errno +pkg syscall (windows-386), const EMULTIHOP Errno +pkg syscall (windows-386), const ENAVAIL Errno +pkg syscall (windows-386), const ENOANO Errno +pkg syscall (windows-386), const ENOCSI Errno +pkg syscall (windows-386), const ENODATA Errno +pkg syscall (windows-386), const ENOKEY Errno +pkg syscall (windows-386), const ENOLINK Errno +pkg syscall (windows-386), const ENOMEDIUM Errno +pkg syscall (windows-386), const ENONET Errno +pkg syscall (windows-386), const ENOPKG Errno +pkg syscall (windows-386), const ENOSR Errno +pkg syscall (windows-386), const ENOSTR Errno +pkg syscall (windows-386), const ENOTNAM Errno +pkg syscall (windows-386), const ENOTRECOVERABLE Errno +pkg syscall (windows-386), const ENOTUNIQ Errno +pkg syscall (windows-386), const EOWNERDEAD Errno +pkg syscall (windows-386), const EPROTO Errno +pkg syscall (windows-386), const EREMCHG Errno +pkg syscall (windows-386), const EREMOTEIO Errno +pkg syscall (windows-386), const ERESTART Errno +pkg syscall (windows-386), const ERROR_ACCESS_DENIED Errno +pkg syscall (windows-386), const ERROR_ALREADY_EXISTS Errno +pkg syscall (windows-386), const ERROR_BROKEN_PIPE Errno +pkg syscall (windows-386), const ERROR_BUFFER_OVERFLOW Errno +pkg syscall (windows-386), const ERROR_ENVVAR_NOT_FOUND Errno +pkg syscall (windows-386), const ERROR_FILE_EXISTS Errno +pkg syscall (windows-386), const ERROR_FILE_NOT_FOUND Errno +pkg syscall (windows-386), const ERROR_INSUFFICIENT_BUFFER Errno +pkg syscall (windows-386), const ERROR_IO_PENDING Errno +pkg syscall (windows-386), const ERROR_MOD_NOT_FOUND Errno +pkg syscall (windows-386), const ERROR_NO_MORE_FILES Errno +pkg syscall (windows-386), const ERROR_OPERATION_ABORTED Errno +pkg syscall (windows-386), const ERROR_PATH_NOT_FOUND Errno +pkg syscall (windows-386), const ERROR_PROC_NOT_FOUND Errno +pkg syscall (windows-386), const ESRMNT Errno +pkg syscall (windows-386), const ESTRPIPE Errno +pkg syscall (windows-386), const ETIME Errno +pkg syscall (windows-386), const EUCLEAN Errno +pkg syscall (windows-386), const EUNATCH Errno +pkg syscall (windows-386), const EWINDOWS Errno +pkg syscall (windows-386), const EXFULL Errno +pkg syscall (windows-386), const FILE_ACTION_ADDED ideal-int +pkg syscall (windows-386), const FILE_ACTION_MODIFIED ideal-int +pkg syscall (windows-386), const FILE_ACTION_REMOVED ideal-int +pkg syscall (windows-386), const FILE_ACTION_RENAMED_NEW_NAME ideal-int +pkg syscall (windows-386), const FILE_ACTION_RENAMED_OLD_NAME ideal-int +pkg syscall (windows-386), const FILE_APPEND_DATA ideal-int +pkg syscall (windows-386), const FILE_ATTRIBUTE_ARCHIVE ideal-int +pkg syscall (windows-386), const FILE_ATTRIBUTE_DIRECTORY ideal-int +pkg syscall (windows-386), const FILE_ATTRIBUTE_HIDDEN ideal-int +pkg syscall (windows-386), const FILE_ATTRIBUTE_NORMAL ideal-int +pkg syscall (windows-386), const FILE_ATTRIBUTE_READONLY ideal-int +pkg syscall (windows-386), const FILE_ATTRIBUTE_SYSTEM ideal-int +pkg syscall (windows-386), const FILE_BEGIN ideal-int +pkg syscall (windows-386), const FILE_CURRENT ideal-int +pkg syscall (windows-386), const FILE_END ideal-int +pkg syscall (windows-386), const FILE_FLAG_BACKUP_SEMANTICS ideal-int +pkg syscall (windows-386), const FILE_FLAG_OVERLAPPED ideal-int +pkg syscall (windows-386), const FILE_LIST_DIRECTORY ideal-int +pkg syscall (windows-386), const FILE_MAP_COPY ideal-int +pkg syscall (windows-386), const FILE_MAP_EXECUTE ideal-int +pkg syscall (windows-386), const FILE_MAP_READ ideal-int +pkg syscall (windows-386), const FILE_MAP_WRITE ideal-int +pkg syscall (windows-386), const FILE_NOTIFY_CHANGE_ATTRIBUTES ideal-int +pkg syscall (windows-386), const FILE_NOTIFY_CHANGE_CREATION ideal-int +pkg syscall (windows-386), const FILE_NOTIFY_CHANGE_DIR_NAME ideal-int +pkg syscall (windows-386), const FILE_NOTIFY_CHANGE_FILE_NAME ideal-int +pkg syscall (windows-386), const FILE_NOTIFY_CHANGE_LAST_ACCESS ideal-int +pkg syscall (windows-386), const FILE_NOTIFY_CHANGE_LAST_WRITE ideal-int +pkg syscall (windows-386), const FILE_NOTIFY_CHANGE_SIZE ideal-int +pkg syscall (windows-386), const FILE_SHARE_DELETE ideal-int +pkg syscall (windows-386), const FILE_SHARE_READ ideal-int +pkg syscall (windows-386), const FILE_SHARE_WRITE ideal-int +pkg syscall (windows-386), const FILE_TYPE_CHAR ideal-int +pkg syscall (windows-386), const FILE_TYPE_DISK ideal-int +pkg syscall (windows-386), const FILE_TYPE_PIPE ideal-int +pkg syscall (windows-386), const FILE_TYPE_REMOTE ideal-int +pkg syscall (windows-386), const FILE_TYPE_UNKNOWN ideal-int +pkg syscall (windows-386), const FILE_WRITE_ATTRIBUTES ideal-int +pkg syscall (windows-386), const FORMAT_MESSAGE_ALLOCATE_BUFFER ideal-int +pkg syscall (windows-386), const FORMAT_MESSAGE_ARGUMENT_ARRAY ideal-int +pkg syscall (windows-386), const FORMAT_MESSAGE_FROM_HMODULE ideal-int +pkg syscall (windows-386), const FORMAT_MESSAGE_FROM_STRING ideal-int +pkg syscall (windows-386), const FORMAT_MESSAGE_FROM_SYSTEM ideal-int +pkg syscall (windows-386), const FORMAT_MESSAGE_IGNORE_INSERTS ideal-int +pkg syscall (windows-386), const FORMAT_MESSAGE_MAX_WIDTH_MASK ideal-int +pkg syscall (windows-386), const GENERIC_ALL ideal-int +pkg syscall (windows-386), const GENERIC_EXECUTE ideal-int +pkg syscall (windows-386), const GENERIC_READ ideal-int +pkg syscall (windows-386), const GENERIC_WRITE ideal-int +pkg syscall (windows-386), const GetFileExInfoStandard ideal-int +pkg syscall (windows-386), const GetFileExMaxInfoLevel ideal-int +pkg syscall (windows-386), const HANDLE_FLAG_INHERIT ideal-int +pkg syscall (windows-386), const HKEY_CLASSES_ROOT ideal-int +pkg syscall (windows-386), const HKEY_CURRENT_CONFIG ideal-int +pkg syscall (windows-386), const HKEY_CURRENT_USER ideal-int +pkg syscall (windows-386), const HKEY_DYN_DATA ideal-int +pkg syscall (windows-386), const HKEY_LOCAL_MACHINE ideal-int +pkg syscall (windows-386), const HKEY_PERFORMANCE_DATA ideal-int +pkg syscall (windows-386), const HKEY_USERS ideal-int +pkg syscall (windows-386), const IFF_POINTTOPOINT ideal-int +pkg syscall (windows-386), const IGNORE ideal-int +pkg syscall (windows-386), const INFINITE ideal-int +pkg syscall (windows-386), const INVALID_FILE_ATTRIBUTES ideal-int +pkg syscall (windows-386), const InvalidHandle Handle +pkg syscall (windows-386), const KEY_ALL_ACCESS ideal-int +pkg syscall (windows-386), const KEY_CREATE_LINK ideal-int +pkg syscall (windows-386), const KEY_CREATE_SUB_KEY ideal-int +pkg syscall (windows-386), const KEY_ENUMERATE_SUB_KEYS ideal-int +pkg syscall (windows-386), const KEY_EXECUTE ideal-int +pkg syscall (windows-386), const KEY_NOTIFY ideal-int +pkg syscall (windows-386), const KEY_QUERY_VALUE ideal-int +pkg syscall (windows-386), const KEY_READ ideal-int +pkg syscall (windows-386), const KEY_SET_VALUE ideal-int +pkg syscall (windows-386), const KEY_WOW64_32KEY ideal-int +pkg syscall (windows-386), const KEY_WOW64_64KEY ideal-int +pkg syscall (windows-386), const KEY_WRITE ideal-int +pkg syscall (windows-386), const LANG_ENGLISH ideal-int +pkg syscall (windows-386), const MAXLEN_IFDESCR ideal-int +pkg syscall (windows-386), const MAXLEN_PHYSADDR ideal-int +pkg syscall (windows-386), const MAX_ADAPTER_ADDRESS_LENGTH ideal-int +pkg syscall (windows-386), const MAX_ADAPTER_DESCRIPTION_LENGTH ideal-int +pkg syscall (windows-386), const MAX_ADAPTER_NAME_LENGTH ideal-int +pkg syscall (windows-386), const MAX_COMPUTERNAME_LENGTH ideal-int +pkg syscall (windows-386), const MAX_INTERFACE_NAME_LEN ideal-int +pkg syscall (windows-386), const MAX_LONG_PATH ideal-int +pkg syscall (windows-386), const MAX_PATH ideal-int +pkg syscall (windows-386), const MaxTokenInfoClass ideal-int +pkg syscall (windows-386), const NameCanonical ideal-int +pkg syscall (windows-386), const NameCanonicalEx ideal-int +pkg syscall (windows-386), const NameDisplay ideal-int +pkg syscall (windows-386), const NameDnsDomain ideal-int +pkg syscall (windows-386), const NameFullyQualifiedDN ideal-int +pkg syscall (windows-386), const NameSamCompatible ideal-int +pkg syscall (windows-386), const NameServicePrincipal ideal-int +pkg syscall (windows-386), const NameUniqueId ideal-int +pkg syscall (windows-386), const NameUnknown ideal-int +pkg syscall (windows-386), const NameUserPrincipal ideal-int +pkg syscall (windows-386), const OPEN_ALWAYS ideal-int +pkg syscall (windows-386), const OPEN_EXISTING ideal-int +pkg syscall (windows-386), const PAGE_EXECUTE_READ ideal-int +pkg syscall (windows-386), const PAGE_EXECUTE_READWRITE ideal-int +pkg syscall (windows-386), const PAGE_EXECUTE_WRITECOPY ideal-int +pkg syscall (windows-386), const PAGE_READONLY ideal-int +pkg syscall (windows-386), const PAGE_READWRITE ideal-int +pkg syscall (windows-386), const PAGE_WRITECOPY ideal-int +pkg syscall (windows-386), const PKCS_7_ASN_ENCODING ideal-int +pkg syscall (windows-386), const PROCESS_QUERY_INFORMATION ideal-int +pkg syscall (windows-386), const PROV_DH_SCHANNEL ideal-int +pkg syscall (windows-386), const PROV_DSS ideal-int +pkg syscall (windows-386), const PROV_DSS_DH ideal-int +pkg syscall (windows-386), const PROV_EC_ECDSA_FULL ideal-int +pkg syscall (windows-386), const PROV_EC_ECDSA_SIG ideal-int +pkg syscall (windows-386), const PROV_EC_ECNRA_FULL ideal-int +pkg syscall (windows-386), const PROV_EC_ECNRA_SIG ideal-int +pkg syscall (windows-386), const PROV_FORTEZZA ideal-int +pkg syscall (windows-386), const PROV_INTEL_SEC ideal-int +pkg syscall (windows-386), const PROV_MS_EXCHANGE ideal-int +pkg syscall (windows-386), const PROV_REPLACE_OWF ideal-int +pkg syscall (windows-386), const PROV_RNG ideal-int +pkg syscall (windows-386), const PROV_RSA_AES ideal-int +pkg syscall (windows-386), const PROV_RSA_FULL ideal-int +pkg syscall (windows-386), const PROV_RSA_SCHANNEL ideal-int +pkg syscall (windows-386), const PROV_RSA_SIG ideal-int +pkg syscall (windows-386), const PROV_SPYRUS_LYNKS ideal-int +pkg syscall (windows-386), const PROV_SSL ideal-int +pkg syscall (windows-386), const REG_BINARY ideal-int +pkg syscall (windows-386), const REG_DWORD ideal-int +pkg syscall (windows-386), const REG_DWORD_BIG_ENDIAN ideal-int +pkg syscall (windows-386), const REG_DWORD_LITTLE_ENDIAN ideal-int +pkg syscall (windows-386), const REG_EXPAND_SZ ideal-int +pkg syscall (windows-386), const REG_FULL_RESOURCE_DESCRIPTOR ideal-int +pkg syscall (windows-386), const REG_LINK ideal-int +pkg syscall (windows-386), const REG_MULTI_SZ ideal-int +pkg syscall (windows-386), const REG_NONE ideal-int +pkg syscall (windows-386), const REG_QWORD ideal-int +pkg syscall (windows-386), const REG_QWORD_LITTLE_ENDIAN ideal-int +pkg syscall (windows-386), const REG_RESOURCE_LIST ideal-int +pkg syscall (windows-386), const REG_RESOURCE_REQUIREMENTS_LIST ideal-int +pkg syscall (windows-386), const REG_SZ ideal-int +pkg syscall (windows-386), const SIO_GET_INTERFACE_LIST ideal-int +pkg syscall (windows-386), const SO_UPDATE_ACCEPT_CONTEXT ideal-int +pkg syscall (windows-386), const STANDARD_RIGHTS_ALL ideal-int +pkg syscall (windows-386), const STANDARD_RIGHTS_EXECUTE ideal-int +pkg syscall (windows-386), const STANDARD_RIGHTS_READ ideal-int +pkg syscall (windows-386), const STANDARD_RIGHTS_REQUIRED ideal-int +pkg syscall (windows-386), const STANDARD_RIGHTS_WRITE ideal-int +pkg syscall (windows-386), const STARTF_USESHOWWINDOW ideal-int +pkg syscall (windows-386), const STARTF_USESTDHANDLES ideal-int +pkg syscall (windows-386), const STD_ERROR_HANDLE ideal-int +pkg syscall (windows-386), const STD_INPUT_HANDLE ideal-int +pkg syscall (windows-386), const STD_OUTPUT_HANDLE ideal-int +pkg syscall (windows-386), const SUBLANG_ENGLISH_US ideal-int +pkg syscall (windows-386), const SW_FORCEMINIMIZE ideal-int +pkg syscall (windows-386), const SW_HIDE ideal-int +pkg syscall (windows-386), const SW_MAXIMIZE ideal-int +pkg syscall (windows-386), const SW_MINIMIZE ideal-int +pkg syscall (windows-386), const SW_NORMAL ideal-int +pkg syscall (windows-386), const SW_RESTORE ideal-int +pkg syscall (windows-386), const SW_SHOW ideal-int +pkg syscall (windows-386), const SW_SHOWDEFAULT ideal-int +pkg syscall (windows-386), const SW_SHOWMAXIMIZED ideal-int +pkg syscall (windows-386), const SW_SHOWMINIMIZED ideal-int +pkg syscall (windows-386), const SW_SHOWMINNOACTIVE ideal-int +pkg syscall (windows-386), const SW_SHOWNA ideal-int +pkg syscall (windows-386), const SW_SHOWNOACTIVATE ideal-int +pkg syscall (windows-386), const SW_SHOWNORMAL ideal-int +pkg syscall (windows-386), const SYNCHRONIZE ideal-int +pkg syscall (windows-386), const S_IWRITE ideal-int +pkg syscall (windows-386), const SidTypeAlias ideal-int +pkg syscall (windows-386), const SidTypeComputer ideal-int +pkg syscall (windows-386), const SidTypeDeletedAccount ideal-int +pkg syscall (windows-386), const SidTypeDomain ideal-int +pkg syscall (windows-386), const SidTypeGroup ideal-int +pkg syscall (windows-386), const SidTypeInvalid ideal-int +pkg syscall (windows-386), const SidTypeLabel ideal-int +pkg syscall (windows-386), const SidTypeUnknown ideal-int +pkg syscall (windows-386), const SidTypeUser ideal-int +pkg syscall (windows-386), const SidTypeWellKnownGroup ideal-int +pkg syscall (windows-386), const TF_DISCONNECT ideal-int +pkg syscall (windows-386), const TF_REUSE_SOCKET ideal-int +pkg syscall (windows-386), const TF_USE_DEFAULT_WORKER ideal-int +pkg syscall (windows-386), const TF_USE_KERNEL_APC ideal-int +pkg syscall (windows-386), const TF_USE_SYSTEM_THREAD ideal-int +pkg syscall (windows-386), const TF_WRITE_BEHIND ideal-int +pkg syscall (windows-386), const TIME_ZONE_ID_DAYLIGHT ideal-int +pkg syscall (windows-386), const TIME_ZONE_ID_STANDARD ideal-int +pkg syscall (windows-386), const TIME_ZONE_ID_UNKNOWN ideal-int +pkg syscall (windows-386), const TOKEN_ADJUST_DEFAULT ideal-int +pkg syscall (windows-386), const TOKEN_ADJUST_GROUPS ideal-int +pkg syscall (windows-386), const TOKEN_ADJUST_PRIVILEGES ideal-int +pkg syscall (windows-386), const TOKEN_ALL_ACCESS ideal-int +pkg syscall (windows-386), const TOKEN_ASSIGN_PRIMARY ideal-int +pkg syscall (windows-386), const TOKEN_DUPLICATE ideal-int +pkg syscall (windows-386), const TOKEN_EXECUTE ideal-int +pkg syscall (windows-386), const TOKEN_IMPERSONATE ideal-int +pkg syscall (windows-386), const TOKEN_QUERY ideal-int +pkg syscall (windows-386), const TOKEN_QUERY_SOURCE ideal-int +pkg syscall (windows-386), const TOKEN_READ ideal-int +pkg syscall (windows-386), const TOKEN_WRITE ideal-int +pkg syscall (windows-386), const TRUNCATE_EXISTING ideal-int +pkg syscall (windows-386), const TokenAccessInformation ideal-int +pkg syscall (windows-386), const TokenAuditPolicy ideal-int +pkg syscall (windows-386), const TokenDefaultDacl ideal-int +pkg syscall (windows-386), const TokenElevation ideal-int +pkg syscall (windows-386), const TokenElevationType ideal-int +pkg syscall (windows-386), const TokenGroups ideal-int +pkg syscall (windows-386), const TokenGroupsAndPrivileges ideal-int +pkg syscall (windows-386), const TokenHasRestrictions ideal-int +pkg syscall (windows-386), const TokenImpersonationLevel ideal-int +pkg syscall (windows-386), const TokenIntegrityLevel ideal-int +pkg syscall (windows-386), const TokenLinkedToken ideal-int +pkg syscall (windows-386), const TokenLogonSid ideal-int +pkg syscall (windows-386), const TokenMandatoryPolicy ideal-int +pkg syscall (windows-386), const TokenOrigin ideal-int +pkg syscall (windows-386), const TokenOwner ideal-int +pkg syscall (windows-386), const TokenPrimaryGroup ideal-int +pkg syscall (windows-386), const TokenPrivileges ideal-int +pkg syscall (windows-386), const TokenRestrictedSids ideal-int +pkg syscall (windows-386), const TokenSandBoxInert ideal-int +pkg syscall (windows-386), const TokenSessionId ideal-int +pkg syscall (windows-386), const TokenSessionReference ideal-int +pkg syscall (windows-386), const TokenSource ideal-int +pkg syscall (windows-386), const TokenStatistics ideal-int +pkg syscall (windows-386), const TokenType ideal-int +pkg syscall (windows-386), const TokenUIAccess ideal-int +pkg syscall (windows-386), const TokenUser ideal-int +pkg syscall (windows-386), const TokenVirtualizationAllowed ideal-int +pkg syscall (windows-386), const TokenVirtualizationEnabled ideal-int +pkg syscall (windows-386), const USAGE_MATCH_TYPE_AND ideal-int +pkg syscall (windows-386), const USAGE_MATCH_TYPE_OR ideal-int +pkg syscall (windows-386), const WAIT_ABANDONED ideal-int +pkg syscall (windows-386), const WAIT_FAILED ideal-int +pkg syscall (windows-386), const WAIT_OBJECT_0 ideal-int +pkg syscall (windows-386), const WAIT_TIMEOUT ideal-int +pkg syscall (windows-386), const WSADESCRIPTION_LEN ideal-int +pkg syscall (windows-386), const WSASYS_STATUS_LEN ideal-int +pkg syscall (windows-386), const X509_ASN_ENCODING ideal-int +pkg syscall (windows-386), func Accept(Handle) (Handle, Sockaddr, error) +pkg syscall (windows-386), func AcceptEx(Handle, Handle, *uint8, uint32, uint32, uint32, *uint32, *Overlapped) error +pkg syscall (windows-386), func Bind(Handle, Sockaddr) error +pkg syscall (windows-386), func CancelIo(Handle) error +pkg syscall (windows-386), func CertAddCertificateContextToStore(Handle, *CertContext, uint32, **CertContext) error +pkg syscall (windows-386), func CertCloseStore(Handle, uint32) error +pkg syscall (windows-386), func CertCreateCertificateContext(uint32, *uint8, uint32) (*CertContext, error) +pkg syscall (windows-386), func CertEnumCertificatesInStore(Handle, *CertContext) (*CertContext, error) +pkg syscall (windows-386), func CertFreeCertificateChain(*CertChainContext) +pkg syscall (windows-386), func CertFreeCertificateContext(*CertContext) error +pkg syscall (windows-386), func CertGetCertificateChain(Handle, *CertContext, *Filetime, Handle, *CertChainPara, uint32, uintptr, **CertChainContext) error +pkg syscall (windows-386), func CertOpenStore(uintptr, uint32, uintptr, uint32, uintptr) (Handle, error) +pkg syscall (windows-386), func CertOpenSystemStore(Handle, *uint16) (Handle, error) +pkg syscall (windows-386), func CertVerifyCertificateChainPolicy(uintptr, *CertChainContext, *CertChainPolicyPara, *CertChainPolicyStatus) error +pkg syscall (windows-386), func Close(Handle) error +pkg syscall (windows-386), func CloseHandle(Handle) error +pkg syscall (windows-386), func CloseOnExec(Handle) +pkg syscall (windows-386), func Closesocket(Handle) error +pkg syscall (windows-386), func CommandLineToArgv(*uint16, *int32) (*[8192]*[8192]uint16, error) +pkg syscall (windows-386), func ComputerName() (string, error) +pkg syscall (windows-386), func Connect(Handle, Sockaddr) error +pkg syscall (windows-386), func ConvertSidToStringSid(*SID, **uint16) error +pkg syscall (windows-386), func ConvertStringSidToSid(*uint16, **SID) error +pkg syscall (windows-386), func CopySid(uint32, *SID, *SID) error +pkg syscall (windows-386), func CreateDirectory(*uint16, *SecurityAttributes) error +pkg syscall (windows-386), func CreateFile(*uint16, uint32, uint32, *SecurityAttributes, uint32, uint32, int32) (Handle, error) +pkg syscall (windows-386), func CreateFileMapping(Handle, *SecurityAttributes, uint32, uint32, uint32, *uint16) (Handle, error) +pkg syscall (windows-386), func CreateIoCompletionPort(Handle, Handle, uint32, uint32) (Handle, error) +pkg syscall (windows-386), func CreatePipe(*Handle, *Handle, *SecurityAttributes, uint32) error +pkg syscall (windows-386), func CreateProcess(*uint16, *uint16, *SecurityAttributes, *SecurityAttributes, bool, uint32, *uint16, *uint16, *StartupInfo, *ProcessInformation) error +pkg syscall (windows-386), func CryptAcquireContext(*Handle, *uint16, *uint16, uint32, uint32) error +pkg syscall (windows-386), func CryptGenRandom(Handle, uint32, *uint8) error +pkg syscall (windows-386), func CryptReleaseContext(Handle, uint32) error +pkg syscall (windows-386), func DeleteFile(*uint16) error +pkg syscall (windows-386), func DnsQuery(string, uint16, uint32, *uint8, **DNSRecord, *uint8) error +pkg syscall (windows-386), func DnsRecordListFree(*DNSRecord, uint32) +pkg syscall (windows-386), func DuplicateHandle(Handle, Handle, Handle, *Handle, uint32, bool, uint32) error +pkg syscall (windows-386), func EscapeArg(string) string +pkg syscall (windows-386), func ExitProcess(uint32) +pkg syscall (windows-386), func Fchdir(Handle) error +pkg syscall (windows-386), func Fchmod(Handle, uint32) error +pkg syscall (windows-386), func Fchown(Handle, int, int) error +pkg syscall (windows-386), func FindClose(Handle) error +pkg syscall (windows-386), func FindFirstFile(*uint16, *Win32finddata) (Handle, error) +pkg syscall (windows-386), func FindNextFile(Handle, *Win32finddata) error +pkg syscall (windows-386), func FlushFileBuffers(Handle) error +pkg syscall (windows-386), func FlushViewOfFile(uintptr, uintptr) error +pkg syscall (windows-386), func FormatMessage(uint32, uint32, uint32, uint32, []uint16, *uint8) (uint32, error) +pkg syscall (windows-386), func FreeEnvironmentStrings(*uint16) error +pkg syscall (windows-386), func FreeLibrary(Handle) error +pkg syscall (windows-386), func Fsync(Handle) error +pkg syscall (windows-386), func Ftruncate(Handle, int64) error +pkg syscall (windows-386), func GetAcceptExSockaddrs(*uint8, uint32, uint32, uint32, **RawSockaddrAny, *int32, **RawSockaddrAny, *int32) +pkg syscall (windows-386), func GetAdaptersInfo(*IpAdapterInfo, *uint32) error +pkg syscall (windows-386), func GetCommandLine() *uint16 +pkg syscall (windows-386), func GetComputerName(*uint16, *uint32) error +pkg syscall (windows-386), func GetCurrentDirectory(uint32, *uint16) (uint32, error) +pkg syscall (windows-386), func GetCurrentProcess() (Handle, error) +pkg syscall (windows-386), func GetEnvironmentStrings() (*uint16, error) +pkg syscall (windows-386), func GetEnvironmentVariable(*uint16, *uint16, uint32) (uint32, error) +pkg syscall (windows-386), func GetExitCodeProcess(Handle, *uint32) error +pkg syscall (windows-386), func GetFileAttributes(*uint16) (uint32, error) +pkg syscall (windows-386), func GetFileAttributesEx(*uint16, uint32, *uint8) error +pkg syscall (windows-386), func GetFileInformationByHandle(Handle, *ByHandleFileInformation) error +pkg syscall (windows-386), func GetFileType(Handle) (uint32, error) +pkg syscall (windows-386), func GetFullPathName(*uint16, uint32, *uint16, **uint16) (uint32, error) +pkg syscall (windows-386), func GetHostByName(string) (*Hostent, error) +pkg syscall (windows-386), func GetIfEntry(*MibIfRow) error +pkg syscall (windows-386), func GetLastError() error +pkg syscall (windows-386), func GetLengthSid(*SID) uint32 +pkg syscall (windows-386), func GetLongPathName(*uint16, *uint16, uint32) (uint32, error) +pkg syscall (windows-386), func GetProcAddress(Handle, string) (uintptr, error) +pkg syscall (windows-386), func GetProcessTimes(Handle, *Filetime, *Filetime, *Filetime, *Filetime) error +pkg syscall (windows-386), func GetProtoByName(string) (*Protoent, error) +pkg syscall (windows-386), func GetQueuedCompletionStatus(Handle, *uint32, *uint32, **Overlapped, uint32) error +pkg syscall (windows-386), func GetServByName(string, string) (*Servent, error) +pkg syscall (windows-386), func GetShortPathName(*uint16, *uint16, uint32) (uint32, error) +pkg syscall (windows-386), func GetStartupInfo(*StartupInfo) error +pkg syscall (windows-386), func GetStdHandle(int) (Handle, error) +pkg syscall (windows-386), func GetSystemTimeAsFileTime(*Filetime) +pkg syscall (windows-386), func GetTempPath(uint32, *uint16) (uint32, error) +pkg syscall (windows-386), func GetTimeZoneInformation(*Timezoneinformation) (uint32, error) +pkg syscall (windows-386), func GetTokenInformation(Token, uint32, *uint8, uint32, *uint32) error +pkg syscall (windows-386), func GetUserNameEx(uint32, *uint16, *uint32) error +pkg syscall (windows-386), func GetUserProfileDirectory(Token, *uint16, *uint32) error +pkg syscall (windows-386), func GetVersion() (uint32, error) +pkg syscall (windows-386), func Getpeername(Handle) (Sockaddr, error) +pkg syscall (windows-386), func Getsockname(Handle) (Sockaddr, error) +pkg syscall (windows-386), func GetsockoptInt(Handle, int, int) (int, error) +pkg syscall (windows-386), func Listen(Handle, int) error +pkg syscall (windows-386), func LoadDLL(string) (*DLL, error) +pkg syscall (windows-386), func LoadLibrary(string) (Handle, error) +pkg syscall (windows-386), func LocalFree(Handle) (Handle, error) +pkg syscall (windows-386), func LookupAccountName(*uint16, *uint16, *SID, *uint32, *uint16, *uint32, *uint32) error +pkg syscall (windows-386), func LookupAccountSid(*uint16, *SID, *uint16, *uint32, *uint16, *uint32, *uint32) error +pkg syscall (windows-386), func LookupSID(string, string) (*SID, string, uint32, error) +pkg syscall (windows-386), func MapViewOfFile(Handle, uint32, uint32, uint32, uintptr) (uintptr, error) +pkg syscall (windows-386), func MoveFile(*uint16, *uint16) error +pkg syscall (windows-386), func MustLoadDLL(string) *DLL +pkg syscall (windows-386), func NetApiBufferFree(*uint8) error +pkg syscall (windows-386), func NetUserGetInfo(*uint16, *uint16, uint32, **uint8) error +pkg syscall (windows-386), func NewCallback(interface{}) uintptr +pkg syscall (windows-386), func NewLazyDLL(string) *LazyDLL +pkg syscall (windows-386), func NsecToFiletime(int64) Filetime +pkg syscall (windows-386), func Ntohs(uint16) uint16 +pkg syscall (windows-386), func Open(string, int, uint32) (Handle, error) +pkg syscall (windows-386), func OpenCurrentProcessToken() (Token, error) +pkg syscall (windows-386), func OpenProcess(uint32, bool, uint32) (Handle, error) +pkg syscall (windows-386), func OpenProcessToken(Handle, uint32, *Token) error +pkg syscall (windows-386), func Pipe([]Handle) error +pkg syscall (windows-386), func PostQueuedCompletionStatus(Handle, uint32, uint32, *Overlapped) error +pkg syscall (windows-386), func Read(Handle, []uint8) (int, error) +pkg syscall (windows-386), func ReadDirectoryChanges(Handle, *uint8, uint32, bool, uint32, *uint32, *Overlapped, uintptr) error +pkg syscall (windows-386), func ReadFile(Handle, []uint8, *uint32, *Overlapped) error +pkg syscall (windows-386), func Recvfrom(Handle, []uint8, int) (int, Sockaddr, error) +pkg syscall (windows-386), func RegCloseKey(Handle) error +pkg syscall (windows-386), func RegEnumKeyEx(Handle, uint32, *uint16, *uint32, *uint32, *uint16, *uint32, *Filetime) error +pkg syscall (windows-386), func RegOpenKeyEx(Handle, *uint16, uint32, uint32, *Handle) error +pkg syscall (windows-386), func RegQueryInfoKey(Handle, *uint16, *uint32, *uint32, *uint32, *uint32, *uint32, *uint32, *uint32, *uint32, *uint32, *Filetime) error +pkg syscall (windows-386), func RegQueryValueEx(Handle, *uint16, *uint32, *uint32, *uint8, *uint32) error +pkg syscall (windows-386), func RemoveDirectory(*uint16) error +pkg syscall (windows-386), func Seek(Handle, int64, int) (int64, error) +pkg syscall (windows-386), func Sendto(Handle, []uint8, int, Sockaddr) error +pkg syscall (windows-386), func SetCurrentDirectory(*uint16) error +pkg syscall (windows-386), func SetEndOfFile(Handle) error +pkg syscall (windows-386), func SetEnvironmentVariable(*uint16, *uint16) error +pkg syscall (windows-386), func SetFileAttributes(*uint16, uint32) error +pkg syscall (windows-386), func SetFilePointer(Handle, int32, *int32, uint32) (uint32, error) +pkg syscall (windows-386), func SetFileTime(Handle, *Filetime, *Filetime, *Filetime) error +pkg syscall (windows-386), func SetHandleInformation(Handle, uint32, uint32) error +pkg syscall (windows-386), func SetNonblock(Handle, bool) error +pkg syscall (windows-386), func Setsockopt(Handle, int32, int32, *uint8, int32) error +pkg syscall (windows-386), func SetsockoptIPMreq(Handle, int, int, *IPMreq) error +pkg syscall (windows-386), func SetsockoptIPv6Mreq(Handle, int, int, *IPv6Mreq) error +pkg syscall (windows-386), func SetsockoptInet4Addr(Handle, int, int, [4]uint8) error +pkg syscall (windows-386), func SetsockoptInt(Handle, int, int, int) error +pkg syscall (windows-386), func SetsockoptLinger(Handle, int, int, *Linger) error +pkg syscall (windows-386), func SetsockoptTimeval(Handle, int, int, *Timeval) error +pkg syscall (windows-386), func Shutdown(Handle, int) error +pkg syscall (windows-386), func Socket(int, int, int) (Handle, error) +pkg syscall (windows-386), func StringToSid(string) (*SID, error) +pkg syscall (windows-386), func StringToUTF16(string) []uint16 +pkg syscall (windows-386), func StringToUTF16Ptr(string) *uint16 +pkg syscall (windows-386), func Syscall(uintptr, uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno) +pkg syscall (windows-386), func Syscall12(uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno) +pkg syscall (windows-386), func Syscall15(uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno) +pkg syscall (windows-386), func Syscall6(uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno) +pkg syscall (windows-386), func Syscall9(uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno) +pkg syscall (windows-386), func TerminateProcess(Handle, uint32) error +pkg syscall (windows-386), func TranslateAccountName(string, uint32, uint32, int) (string, error) +pkg syscall (windows-386), func TranslateName(*uint16, uint32, uint32, *uint16, *uint32) error +pkg syscall (windows-386), func TransmitFile(Handle, Handle, uint32, uint32, *Overlapped, *TransmitFileBuffers, uint32) error +pkg syscall (windows-386), func UTF16ToString([]uint16) string +pkg syscall (windows-386), func UnmapViewOfFile(uintptr) error +pkg syscall (windows-386), func VirtualLock(uintptr, uintptr) error +pkg syscall (windows-386), func VirtualUnlock(uintptr, uintptr) error +pkg syscall (windows-386), func WSACleanup() error +pkg syscall (windows-386), func WSAIoctl(Handle, uint32, *uint8, uint32, *uint8, uint32, *uint32, *Overlapped, uintptr) error +pkg syscall (windows-386), func WSARecv(Handle, *WSABuf, uint32, *uint32, *uint32, *Overlapped, *uint8) error +pkg syscall (windows-386), func WSARecvFrom(Handle, *WSABuf, uint32, *uint32, *uint32, *RawSockaddrAny, *int32, *Overlapped, *uint8) error +pkg syscall (windows-386), func WSASend(Handle, *WSABuf, uint32, *uint32, uint32, *Overlapped, *uint8) error +pkg syscall (windows-386), func WSASendTo(Handle, *WSABuf, uint32, *uint32, uint32, *RawSockaddrAny, int32, *Overlapped, *uint8) error +pkg syscall (windows-386), func WSASendto(Handle, *WSABuf, uint32, *uint32, uint32, Sockaddr, *Overlapped, *uint8) error +pkg syscall (windows-386), func WSAStartup(uint32, *WSAData) error +pkg syscall (windows-386), func WaitForSingleObject(Handle, uint32) (uint32, error) +pkg syscall (windows-386), func Write(Handle, []uint8) (int, error) +pkg syscall (windows-386), func WriteFile(Handle, []uint8, *uint32, *Overlapped) error +pkg syscall (windows-386), method (*DLL) FindProc(string) (*Proc, error) +pkg syscall (windows-386), method (*DLL) MustFindProc(string) *Proc +pkg syscall (windows-386), method (*DLL) Release() error +pkg syscall (windows-386), method (*DLLError) Error() string +pkg syscall (windows-386), method (*Filetime) Nanoseconds() int64 +pkg syscall (windows-386), method (*LazyDLL) Handle() uintptr +pkg syscall (windows-386), method (*LazyDLL) Load() error +pkg syscall (windows-386), method (*LazyDLL) NewProc(string) *LazyProc +pkg syscall (windows-386), method (*LazyProc) Addr() uintptr +pkg syscall (windows-386), method (*LazyProc) Call(...uintptr) (uintptr, uintptr, error) +pkg syscall (windows-386), method (*LazyProc) Find() error +pkg syscall (windows-386), method (*Proc) Addr() uintptr +pkg syscall (windows-386), method (*Proc) Call(...uintptr) (uintptr, uintptr, error) +pkg syscall (windows-386), method (*RawSockaddrAny) Sockaddr() (Sockaddr, error) +pkg syscall (windows-386), method (*SID) Copy() (*SID, error) +pkg syscall (windows-386), method (*SID) Len() int +pkg syscall (windows-386), method (*SID) LookupAccount(string) (string, string, uint32, error) +pkg syscall (windows-386), method (*SID) String() (string, error) +pkg syscall (windows-386), method (*Timeval) Nanoseconds() int64 +pkg syscall (windows-386), method (Token) Close() error +pkg syscall (windows-386), method (Token) GetTokenPrimaryGroup() (*Tokenprimarygroup, error) +pkg syscall (windows-386), method (Token) GetTokenUser() (*Tokenuser, error) +pkg syscall (windows-386), method (Token) GetUserProfileDirectory() (string, error) +pkg syscall (windows-386), type ByHandleFileInformation struct +pkg syscall (windows-386), type ByHandleFileInformation struct, CreationTime Filetime +pkg syscall (windows-386), type ByHandleFileInformation struct, FileAttributes uint32 +pkg syscall (windows-386), type ByHandleFileInformation struct, FileIndexHigh uint32 +pkg syscall (windows-386), type ByHandleFileInformation struct, FileIndexLow uint32 +pkg syscall (windows-386), type ByHandleFileInformation struct, FileSizeHigh uint32 +pkg syscall (windows-386), type ByHandleFileInformation struct, FileSizeLow uint32 +pkg syscall (windows-386), type ByHandleFileInformation struct, LastAccessTime Filetime +pkg syscall (windows-386), type ByHandleFileInformation struct, LastWriteTime Filetime +pkg syscall (windows-386), type ByHandleFileInformation struct, NumberOfLinks uint32 +pkg syscall (windows-386), type ByHandleFileInformation struct, VolumeSerialNumber uint32 +pkg syscall (windows-386), type CertChainContext struct +pkg syscall (windows-386), type CertChainContext struct, ChainCount uint32 +pkg syscall (windows-386), type CertChainContext struct, Chains **CertSimpleChain +pkg syscall (windows-386), type CertChainContext struct, HasRevocationFreshnessTime uint32 +pkg syscall (windows-386), type CertChainContext struct, LowerQualityChainCount uint32 +pkg syscall (windows-386), type CertChainContext struct, LowerQualityChains **CertChainContext +pkg syscall (windows-386), type CertChainContext struct, RevocationFreshnessTime uint32 +pkg syscall (windows-386), type CertChainContext struct, Size uint32 +pkg syscall (windows-386), type CertChainContext struct, TrustStatus CertTrustStatus +pkg syscall (windows-386), type CertChainElement struct +pkg syscall (windows-386), type CertChainElement struct, ApplicationUsage *CertEnhKeyUsage +pkg syscall (windows-386), type CertChainElement struct, CertContext *CertContext +pkg syscall (windows-386), type CertChainElement struct, ExtendedErrorInfo *uint16 +pkg syscall (windows-386), type CertChainElement struct, IssuanceUsage *CertEnhKeyUsage +pkg syscall (windows-386), type CertChainElement struct, RevocationInfo *CertRevocationInfo +pkg syscall (windows-386), type CertChainElement struct, Size uint32 +pkg syscall (windows-386), type CertChainElement struct, TrustStatus CertTrustStatus +pkg syscall (windows-386), type CertChainPara struct +pkg syscall (windows-386), type CertChainPara struct, CacheResync *Filetime +pkg syscall (windows-386), type CertChainPara struct, CheckRevocationFreshnessTime uint32 +pkg syscall (windows-386), type CertChainPara struct, RequestedUsage CertUsageMatch +pkg syscall (windows-386), type CertChainPara struct, RequstedIssuancePolicy CertUsageMatch +pkg syscall (windows-386), type CertChainPara struct, RevocationFreshnessTime uint32 +pkg syscall (windows-386), type CertChainPara struct, Size uint32 +pkg syscall (windows-386), type CertChainPara struct, URLRetrievalTimeout uint32 +pkg syscall (windows-386), type CertChainPolicyPara struct +pkg syscall (windows-386), type CertChainPolicyPara struct, ExtraPolicyPara uintptr +pkg syscall (windows-386), type CertChainPolicyPara struct, Flags uint32 +pkg syscall (windows-386), type CertChainPolicyPara struct, Size uint32 +pkg syscall (windows-386), type CertChainPolicyStatus struct +pkg syscall (windows-386), type CertChainPolicyStatus struct, ChainIndex uint32 +pkg syscall (windows-386), type CertChainPolicyStatus struct, ElementIndex uint32 +pkg syscall (windows-386), type CertChainPolicyStatus struct, Error uint32 +pkg syscall (windows-386), type CertChainPolicyStatus struct, ExtraPolicyStatus uintptr +pkg syscall (windows-386), type CertChainPolicyStatus struct, Size uint32 +pkg syscall (windows-386), type CertContext struct +pkg syscall (windows-386), type CertContext struct, CertInfo uintptr +pkg syscall (windows-386), type CertContext struct, EncodedCert *uint8 +pkg syscall (windows-386), type CertContext struct, EncodingType uint32 +pkg syscall (windows-386), type CertContext struct, Length uint32 +pkg syscall (windows-386), type CertContext struct, Store Handle +pkg syscall (windows-386), type CertEnhKeyUsage struct +pkg syscall (windows-386), type CertEnhKeyUsage struct, Length uint32 +pkg syscall (windows-386), type CertEnhKeyUsage struct, UsageIdentifiers **uint8 +pkg syscall (windows-386), type CertRevocationInfo struct +pkg syscall (windows-386), type CertRevocationInfo struct, CrlInfo uintptr +pkg syscall (windows-386), type CertRevocationInfo struct, FreshnessTime uint32 +pkg syscall (windows-386), type CertRevocationInfo struct, HasFreshnessTime uint32 +pkg syscall (windows-386), type CertRevocationInfo struct, OidSpecificInfo uintptr +pkg syscall (windows-386), type CertRevocationInfo struct, RevocationOid *uint8 +pkg syscall (windows-386), type CertRevocationInfo struct, RevocationResult uint32 +pkg syscall (windows-386), type CertRevocationInfo struct, Size uint32 +pkg syscall (windows-386), type CertSimpleChain struct +pkg syscall (windows-386), type CertSimpleChain struct, Elements **CertChainElement +pkg syscall (windows-386), type CertSimpleChain struct, HasRevocationFreshnessTime uint32 +pkg syscall (windows-386), type CertSimpleChain struct, NumElements uint32 +pkg syscall (windows-386), type CertSimpleChain struct, RevocationFreshnessTime uint32 +pkg syscall (windows-386), type CertSimpleChain struct, Size uint32 +pkg syscall (windows-386), type CertSimpleChain struct, TrustListInfo uintptr +pkg syscall (windows-386), type CertSimpleChain struct, TrustStatus CertTrustStatus +pkg syscall (windows-386), type CertTrustStatus struct +pkg syscall (windows-386), type CertTrustStatus struct, ErrorStatus uint32 +pkg syscall (windows-386), type CertTrustStatus struct, InfoStatus uint32 +pkg syscall (windows-386), type CertUsageMatch struct +pkg syscall (windows-386), type CertUsageMatch struct, Type uint32 +pkg syscall (windows-386), type CertUsageMatch struct, Usage CertEnhKeyUsage +pkg syscall (windows-386), type DLL struct +pkg syscall (windows-386), type DLL struct, Handle Handle +pkg syscall (windows-386), type DLL struct, Name string +pkg syscall (windows-386), type DLLError struct +pkg syscall (windows-386), type DLLError struct, Err error +pkg syscall (windows-386), type DLLError struct, Msg string +pkg syscall (windows-386), type DLLError struct, ObjName string +pkg syscall (windows-386), type DNSMXData struct +pkg syscall (windows-386), type DNSMXData struct, NameExchange *uint16 +pkg syscall (windows-386), type DNSMXData struct, Pad uint16 +pkg syscall (windows-386), type DNSMXData struct, Preference uint16 +pkg syscall (windows-386), type DNSPTRData struct +pkg syscall (windows-386), type DNSPTRData struct, Host *uint16 +pkg syscall (windows-386), type DNSRecord struct +pkg syscall (windows-386), type DNSRecord struct, Data [40]uint8 +pkg syscall (windows-386), type DNSRecord struct, Dw uint32 +pkg syscall (windows-386), type DNSRecord struct, Length uint16 +pkg syscall (windows-386), type DNSRecord struct, Name *uint16 +pkg syscall (windows-386), type DNSRecord struct, Next *DNSRecord +pkg syscall (windows-386), type DNSRecord struct, Reserved uint32 +pkg syscall (windows-386), type DNSRecord struct, Ttl uint32 +pkg syscall (windows-386), type DNSRecord struct, Type uint16 +pkg syscall (windows-386), type DNSSRVData struct +pkg syscall (windows-386), type DNSSRVData struct, Pad uint16 +pkg syscall (windows-386), type DNSSRVData struct, Port uint16 +pkg syscall (windows-386), type DNSSRVData struct, Priority uint16 +pkg syscall (windows-386), type DNSSRVData struct, Target *uint16 +pkg syscall (windows-386), type DNSSRVData struct, Weight uint16 +pkg syscall (windows-386), type DNSTXTData struct +pkg syscall (windows-386), type DNSTXTData struct, StringArray [1]*uint16 +pkg syscall (windows-386), type DNSTXTData struct, StringCount uint16 +pkg syscall (windows-386), type FileNotifyInformation struct +pkg syscall (windows-386), type FileNotifyInformation struct, Action uint32 +pkg syscall (windows-386), type FileNotifyInformation struct, FileName uint16 +pkg syscall (windows-386), type FileNotifyInformation struct, FileNameLength uint32 +pkg syscall (windows-386), type FileNotifyInformation struct, NextEntryOffset uint32 +pkg syscall (windows-386), type Filetime struct +pkg syscall (windows-386), type Filetime struct, HighDateTime uint32 +pkg syscall (windows-386), type Filetime struct, LowDateTime uint32 +pkg syscall (windows-386), type Handle uintptr +pkg syscall (windows-386), type Hostent struct +pkg syscall (windows-386), type Hostent struct, AddrList **uint8 +pkg syscall (windows-386), type Hostent struct, AddrType uint16 +pkg syscall (windows-386), type Hostent struct, Aliases **uint8 +pkg syscall (windows-386), type Hostent struct, Length uint16 +pkg syscall (windows-386), type Hostent struct, Name *uint8 +pkg syscall (windows-386), type InterfaceInfo struct +pkg syscall (windows-386), type InterfaceInfo struct, Address SockaddrGen +pkg syscall (windows-386), type InterfaceInfo struct, BroadcastAddress SockaddrGen +pkg syscall (windows-386), type InterfaceInfo struct, Flags uint32 +pkg syscall (windows-386), type InterfaceInfo struct, Netmask SockaddrGen +pkg syscall (windows-386), type IpAdapterInfo struct +pkg syscall (windows-386), type IpAdapterInfo struct, AdapterName [260]uint8 +pkg syscall (windows-386), type IpAdapterInfo struct, Address [8]uint8 +pkg syscall (windows-386), type IpAdapterInfo struct, AddressLength uint32 +pkg syscall (windows-386), type IpAdapterInfo struct, ComboIndex uint32 +pkg syscall (windows-386), type IpAdapterInfo struct, CurrentIpAddress *IpAddrString +pkg syscall (windows-386), type IpAdapterInfo struct, Description [132]uint8 +pkg syscall (windows-386), type IpAdapterInfo struct, DhcpEnabled uint32 +pkg syscall (windows-386), type IpAdapterInfo struct, DhcpServer IpAddrString +pkg syscall (windows-386), type IpAdapterInfo struct, GatewayList IpAddrString +pkg syscall (windows-386), type IpAdapterInfo struct, HaveWins bool +pkg syscall (windows-386), type IpAdapterInfo struct, Index uint32 +pkg syscall (windows-386), type IpAdapterInfo struct, IpAddressList IpAddrString +pkg syscall (windows-386), type IpAdapterInfo struct, LeaseExpires int64 +pkg syscall (windows-386), type IpAdapterInfo struct, LeaseObtained int64 +pkg syscall (windows-386), type IpAdapterInfo struct, Next *IpAdapterInfo +pkg syscall (windows-386), type IpAdapterInfo struct, PrimaryWinsServer IpAddrString +pkg syscall (windows-386), type IpAdapterInfo struct, SecondaryWinsServer IpAddrString +pkg syscall (windows-386), type IpAdapterInfo struct, Type uint32 +pkg syscall (windows-386), type IpAddrString struct +pkg syscall (windows-386), type IpAddrString struct, Context uint32 +pkg syscall (windows-386), type IpAddrString struct, IpAddress IpAddressString +pkg syscall (windows-386), type IpAddrString struct, IpMask IpMaskString +pkg syscall (windows-386), type IpAddrString struct, Next *IpAddrString +pkg syscall (windows-386), type IpAddressString struct +pkg syscall (windows-386), type IpAddressString struct, String [16]uint8 +pkg syscall (windows-386), type IpMaskString struct +pkg syscall (windows-386), type LazyDLL struct +pkg syscall (windows-386), type LazyDLL struct, Name string +pkg syscall (windows-386), type LazyProc struct +pkg syscall (windows-386), type LazyProc struct, Name string +pkg syscall (windows-386), type MibIfRow struct +pkg syscall (windows-386), type MibIfRow struct, AdminStatus uint32 +pkg syscall (windows-386), type MibIfRow struct, Descr [256]uint8 +pkg syscall (windows-386), type MibIfRow struct, DescrLen uint32 +pkg syscall (windows-386), type MibIfRow struct, InDiscards uint32 +pkg syscall (windows-386), type MibIfRow struct, InErrors uint32 +pkg syscall (windows-386), type MibIfRow struct, InNUcastPkts uint32 +pkg syscall (windows-386), type MibIfRow struct, InOctets uint32 +pkg syscall (windows-386), type MibIfRow struct, InUcastPkts uint32 +pkg syscall (windows-386), type MibIfRow struct, InUnknownProtos uint32 +pkg syscall (windows-386), type MibIfRow struct, Index uint32 +pkg syscall (windows-386), type MibIfRow struct, LastChange uint32 +pkg syscall (windows-386), type MibIfRow struct, Mtu uint32 +pkg syscall (windows-386), type MibIfRow struct, Name [256]uint16 +pkg syscall (windows-386), type MibIfRow struct, OperStatus uint32 +pkg syscall (windows-386), type MibIfRow struct, OutDiscards uint32 +pkg syscall (windows-386), type MibIfRow struct, OutErrors uint32 +pkg syscall (windows-386), type MibIfRow struct, OutNUcastPkts uint32 +pkg syscall (windows-386), type MibIfRow struct, OutOctets uint32 +pkg syscall (windows-386), type MibIfRow struct, OutQLen uint32 +pkg syscall (windows-386), type MibIfRow struct, OutUcastPkts uint32 +pkg syscall (windows-386), type MibIfRow struct, PhysAddr [8]uint8 +pkg syscall (windows-386), type MibIfRow struct, PhysAddrLen uint32 +pkg syscall (windows-386), type MibIfRow struct, Speed uint32 +pkg syscall (windows-386), type MibIfRow struct, Type uint32 +pkg syscall (windows-386), type Overlapped struct +pkg syscall (windows-386), type Overlapped struct, HEvent Handle +pkg syscall (windows-386), type Overlapped struct, Internal uintptr +pkg syscall (windows-386), type Overlapped struct, InternalHigh uintptr +pkg syscall (windows-386), type Overlapped struct, Offset uint32 +pkg syscall (windows-386), type Overlapped struct, OffsetHigh uint32 +pkg syscall (windows-386), type Proc struct +pkg syscall (windows-386), type Proc struct, Dll *DLL +pkg syscall (windows-386), type Proc struct, Name string +pkg syscall (windows-386), type ProcessInformation struct +pkg syscall (windows-386), type ProcessInformation struct, Process Handle +pkg syscall (windows-386), type ProcessInformation struct, ProcessId uint32 +pkg syscall (windows-386), type ProcessInformation struct, Thread Handle +pkg syscall (windows-386), type ProcessInformation struct, ThreadId uint32 +pkg syscall (windows-386), type Protoent struct +pkg syscall (windows-386), type Protoent struct, Aliases **uint8 +pkg syscall (windows-386), type Protoent struct, Name *uint8 +pkg syscall (windows-386), type Protoent struct, Proto uint16 +pkg syscall (windows-386), type RawSockaddr struct, Data [14]int8 +pkg syscall (windows-386), type RawSockaddr struct, Family uint16 +pkg syscall (windows-386), type RawSockaddrAny struct, Pad [96]int8 +pkg syscall (windows-386), type RawSockaddrInet4 struct, Family uint16 +pkg syscall (windows-386), type RawSockaddrInet4 struct, Zero [8]uint8 +pkg syscall (windows-386), type Rusage struct, CreationTime Filetime +pkg syscall (windows-386), type Rusage struct, ExitTime Filetime +pkg syscall (windows-386), type Rusage struct, KernelTime Filetime +pkg syscall (windows-386), type Rusage struct, UserTime Filetime +pkg syscall (windows-386), type SID struct +pkg syscall (windows-386), type SIDAndAttributes struct +pkg syscall (windows-386), type SIDAndAttributes struct, Attributes uint32 +pkg syscall (windows-386), type SIDAndAttributes struct, Sid *SID +pkg syscall (windows-386), type SSLExtraCertChainPolicyPara struct +pkg syscall (windows-386), type SSLExtraCertChainPolicyPara struct, AuthType uint32 +pkg syscall (windows-386), type SSLExtraCertChainPolicyPara struct, Checks uint32 +pkg syscall (windows-386), type SSLExtraCertChainPolicyPara struct, ServerName *uint16 +pkg syscall (windows-386), type SSLExtraCertChainPolicyPara struct, Size uint32 +pkg syscall (windows-386), type SecurityAttributes struct +pkg syscall (windows-386), type SecurityAttributes struct, InheritHandle uint32 +pkg syscall (windows-386), type SecurityAttributes struct, Length uint32 +pkg syscall (windows-386), type SecurityAttributes struct, SecurityDescriptor uintptr +pkg syscall (windows-386), type Servent struct +pkg syscall (windows-386), type Servent struct, Aliases **uint8 +pkg syscall (windows-386), type Servent struct, Name *uint8 +pkg syscall (windows-386), type Servent struct, Port uint16 +pkg syscall (windows-386), type Servent struct, Proto *uint8 +pkg syscall (windows-386), type SockaddrGen [24]uint8 +pkg syscall (windows-386), type StartupInfo struct +pkg syscall (windows-386), type StartupInfo struct, Cb uint32 +pkg syscall (windows-386), type StartupInfo struct, Desktop *uint16 +pkg syscall (windows-386), type StartupInfo struct, FillAttribute uint32 +pkg syscall (windows-386), type StartupInfo struct, Flags uint32 +pkg syscall (windows-386), type StartupInfo struct, ShowWindow uint16 +pkg syscall (windows-386), type StartupInfo struct, StdErr Handle +pkg syscall (windows-386), type StartupInfo struct, StdInput Handle +pkg syscall (windows-386), type StartupInfo struct, StdOutput Handle +pkg syscall (windows-386), type StartupInfo struct, Title *uint16 +pkg syscall (windows-386), type StartupInfo struct, X uint32 +pkg syscall (windows-386), type StartupInfo struct, XCountChars uint32 +pkg syscall (windows-386), type StartupInfo struct, XSize uint32 +pkg syscall (windows-386), type StartupInfo struct, Y uint32 +pkg syscall (windows-386), type StartupInfo struct, YCountChars uint32 +pkg syscall (windows-386), type StartupInfo struct, YSize uint32 +pkg syscall (windows-386), type SysProcAttr struct, CmdLine string +pkg syscall (windows-386), type SysProcAttr struct, HideWindow bool +pkg syscall (windows-386), type Systemtime struct +pkg syscall (windows-386), type Systemtime struct, Day uint16 +pkg syscall (windows-386), type Systemtime struct, DayOfWeek uint16 +pkg syscall (windows-386), type Systemtime struct, Hour uint16 +pkg syscall (windows-386), type Systemtime struct, Milliseconds uint16 +pkg syscall (windows-386), type Systemtime struct, Minute uint16 +pkg syscall (windows-386), type Systemtime struct, Month uint16 +pkg syscall (windows-386), type Systemtime struct, Second uint16 +pkg syscall (windows-386), type Systemtime struct, Year uint16 +pkg syscall (windows-386), type Timespec struct, Nsec int64 +pkg syscall (windows-386), type Timespec struct, Sec int64 +pkg syscall (windows-386), type Timeval struct, Sec int32 +pkg syscall (windows-386), type Timeval struct, Usec int32 +pkg syscall (windows-386), type Timezoneinformation struct +pkg syscall (windows-386), type Timezoneinformation struct, Bias int32 +pkg syscall (windows-386), type Timezoneinformation struct, DaylightBias int32 +pkg syscall (windows-386), type Timezoneinformation struct, DaylightDate Systemtime +pkg syscall (windows-386), type Timezoneinformation struct, DaylightName [32]uint16 +pkg syscall (windows-386), type Timezoneinformation struct, StandardBias int32 +pkg syscall (windows-386), type Timezoneinformation struct, StandardDate Systemtime +pkg syscall (windows-386), type Timezoneinformation struct, StandardName [32]uint16 +pkg syscall (windows-386), type Token uintptr +pkg syscall (windows-386), type Tokenprimarygroup struct +pkg syscall (windows-386), type Tokenprimarygroup struct, PrimaryGroup *SID +pkg syscall (windows-386), type Tokenuser struct +pkg syscall (windows-386), type Tokenuser struct, User SIDAndAttributes +pkg syscall (windows-386), type TransmitFileBuffers struct +pkg syscall (windows-386), type TransmitFileBuffers struct, Head uintptr +pkg syscall (windows-386), type TransmitFileBuffers struct, HeadLength uint32 +pkg syscall (windows-386), type TransmitFileBuffers struct, Tail uintptr +pkg syscall (windows-386), type TransmitFileBuffers struct, TailLength uint32 +pkg syscall (windows-386), type UserInfo10 struct +pkg syscall (windows-386), type UserInfo10 struct, Comment *uint16 +pkg syscall (windows-386), type UserInfo10 struct, FullName *uint16 +pkg syscall (windows-386), type UserInfo10 struct, Name *uint16 +pkg syscall (windows-386), type UserInfo10 struct, UsrComment *uint16 +pkg syscall (windows-386), type WSABuf struct +pkg syscall (windows-386), type WSABuf struct, Buf *uint8 +pkg syscall (windows-386), type WSABuf struct, Len uint32 +pkg syscall (windows-386), type WSAData struct +pkg syscall (windows-386), type WSAData struct, Description [257]uint8 +pkg syscall (windows-386), type WSAData struct, HighVersion uint16 +pkg syscall (windows-386), type WSAData struct, MaxSockets uint16 +pkg syscall (windows-386), type WSAData struct, MaxUdpDg uint16 +pkg syscall (windows-386), type WSAData struct, SystemStatus [129]uint8 +pkg syscall (windows-386), type WSAData struct, VendorInfo *uint8 +pkg syscall (windows-386), type WSAData struct, Version uint16 +pkg syscall (windows-386), type WaitStatus struct +pkg syscall (windows-386), type WaitStatus struct, ExitCode uint32 +pkg syscall (windows-386), type Win32FileAttributeData struct +pkg syscall (windows-386), type Win32FileAttributeData struct, CreationTime Filetime +pkg syscall (windows-386), type Win32FileAttributeData struct, FileAttributes uint32 +pkg syscall (windows-386), type Win32FileAttributeData struct, FileSizeHigh uint32 +pkg syscall (windows-386), type Win32FileAttributeData struct, FileSizeLow uint32 +pkg syscall (windows-386), type Win32FileAttributeData struct, LastAccessTime Filetime +pkg syscall (windows-386), type Win32FileAttributeData struct, LastWriteTime Filetime +pkg syscall (windows-386), type Win32finddata struct +pkg syscall (windows-386), type Win32finddata struct, AlternateFileName [13]uint16 +pkg syscall (windows-386), type Win32finddata struct, CreationTime Filetime +pkg syscall (windows-386), type Win32finddata struct, FileAttributes uint32 +pkg syscall (windows-386), type Win32finddata struct, FileName [259]uint16 +pkg syscall (windows-386), type Win32finddata struct, FileSizeHigh uint32 +pkg syscall (windows-386), type Win32finddata struct, FileSizeLow uint32 +pkg syscall (windows-386), type Win32finddata struct, LastAccessTime Filetime +pkg syscall (windows-386), type Win32finddata struct, LastWriteTime Filetime +pkg syscall (windows-386), type Win32finddata struct, Reserved0 uint32 +pkg syscall (windows-386), type Win32finddata struct, Reserved1 uint32 +pkg syscall (windows-386), var OID_PKIX_KP_SERVER_AUTH []uint8 +pkg syscall (windows-386), var OID_SERVER_GATED_CRYPTO []uint8 +pkg syscall (windows-386), var OID_SGC_NETSCAPE []uint8 +pkg syscall (windows-386), var Stderr Handle +pkg syscall (windows-386), var Stdin Handle +pkg syscall (windows-386), var Stdout Handle +pkg syscall (windows-amd64), const AF_NETBIOS ideal-int +pkg syscall (windows-amd64), const APPLICATION_ERROR ideal-int +pkg syscall (windows-amd64), const AUTHTYPE_CLIENT ideal-int +pkg syscall (windows-amd64), const AUTHTYPE_SERVER ideal-int +pkg syscall (windows-amd64), const CERT_CHAIN_POLICY_AUTHENTICODE ideal-int +pkg syscall (windows-amd64), const CERT_CHAIN_POLICY_AUTHENTICODE_TS ideal-int +pkg syscall (windows-amd64), const CERT_CHAIN_POLICY_BASE ideal-int +pkg syscall (windows-amd64), const CERT_CHAIN_POLICY_BASIC_CONSTRAINTS ideal-int +pkg syscall (windows-amd64), const CERT_CHAIN_POLICY_EV ideal-int +pkg syscall (windows-amd64), const CERT_CHAIN_POLICY_MICROSOFT_ROOT ideal-int +pkg syscall (windows-amd64), const CERT_CHAIN_POLICY_NT_AUTH ideal-int +pkg syscall (windows-amd64), const CERT_CHAIN_POLICY_SSL ideal-int +pkg syscall (windows-amd64), const CERT_E_CN_NO_MATCH ideal-int +pkg syscall (windows-amd64), const CERT_E_EXPIRED ideal-int +pkg syscall (windows-amd64), const CERT_E_PURPOSE ideal-int +pkg syscall (windows-amd64), const CERT_E_ROLE ideal-int +pkg syscall (windows-amd64), const CERT_E_UNTRUSTEDROOT ideal-int +pkg syscall (windows-amd64), const CERT_STORE_ADD_ALWAYS ideal-int +pkg syscall (windows-amd64), const CERT_STORE_DEFER_CLOSE_UNTIL_LAST_FREE_FLAG ideal-int +pkg syscall (windows-amd64), const CERT_STORE_PROV_MEMORY ideal-int +pkg syscall (windows-amd64), const CERT_TRUST_HAS_EXCLUDED_NAME_CONSTRAINT ideal-int +pkg syscall (windows-amd64), const CERT_TRUST_HAS_NOT_DEFINED_NAME_CONSTRAINT ideal-int +pkg syscall (windows-amd64), const CERT_TRUST_HAS_NOT_PERMITTED_NAME_CONSTRAINT ideal-int +pkg syscall (windows-amd64), const CERT_TRUST_HAS_NOT_SUPPORTED_CRITICAL_EXT ideal-int +pkg syscall (windows-amd64), const CERT_TRUST_HAS_NOT_SUPPORTED_NAME_CONSTRAINT ideal-int +pkg syscall (windows-amd64), const CERT_TRUST_INVALID_BASIC_CONSTRAINTS ideal-int +pkg syscall (windows-amd64), const CERT_TRUST_INVALID_EXTENSION ideal-int +pkg syscall (windows-amd64), const CERT_TRUST_INVALID_NAME_CONSTRAINTS ideal-int +pkg syscall (windows-amd64), const CERT_TRUST_INVALID_POLICY_CONSTRAINTS ideal-int +pkg syscall (windows-amd64), const CERT_TRUST_IS_CYCLIC ideal-int +pkg syscall (windows-amd64), const CERT_TRUST_IS_EXPLICIT_DISTRUST ideal-int +pkg syscall (windows-amd64), const CERT_TRUST_IS_NOT_SIGNATURE_VALID ideal-int +pkg syscall (windows-amd64), const CERT_TRUST_IS_NOT_TIME_VALID ideal-int +pkg syscall (windows-amd64), const CERT_TRUST_IS_NOT_VALID_FOR_USAGE ideal-int +pkg syscall (windows-amd64), const CERT_TRUST_IS_OFFLINE_REVOCATION ideal-int +pkg syscall (windows-amd64), const CERT_TRUST_IS_REVOKED ideal-int +pkg syscall (windows-amd64), const CERT_TRUST_IS_UNTRUSTED_ROOT ideal-int +pkg syscall (windows-amd64), const CERT_TRUST_NO_ERROR ideal-int +pkg syscall (windows-amd64), const CERT_TRUST_NO_ISSUANCE_CHAIN_POLICY ideal-int +pkg syscall (windows-amd64), const CERT_TRUST_REVOCATION_STATUS_UNKNOWN ideal-int +pkg syscall (windows-amd64), const CREATE_ALWAYS ideal-int +pkg syscall (windows-amd64), const CREATE_NEW ideal-int +pkg syscall (windows-amd64), const CREATE_UNICODE_ENVIRONMENT ideal-int +pkg syscall (windows-amd64), const CRYPT_DEFAULT_CONTAINER_OPTIONAL ideal-int +pkg syscall (windows-amd64), const CRYPT_DELETEKEYSET ideal-int +pkg syscall (windows-amd64), const CRYPT_MACHINE_KEYSET ideal-int +pkg syscall (windows-amd64), const CRYPT_NEWKEYSET ideal-int +pkg syscall (windows-amd64), const CRYPT_SILENT ideal-int +pkg syscall (windows-amd64), const CRYPT_VERIFYCONTEXT ideal-int +pkg syscall (windows-amd64), const DNS_TYPE_A ideal-int +pkg syscall (windows-amd64), const DNS_TYPE_A6 ideal-int +pkg syscall (windows-amd64), const DNS_TYPE_AAAA ideal-int +pkg syscall (windows-amd64), const DNS_TYPE_ADDRS ideal-int +pkg syscall (windows-amd64), const DNS_TYPE_AFSDB ideal-int +pkg syscall (windows-amd64), const DNS_TYPE_ALL ideal-int +pkg syscall (windows-amd64), const DNS_TYPE_ANY ideal-int +pkg syscall (windows-amd64), const DNS_TYPE_ATMA ideal-int +pkg syscall (windows-amd64), const DNS_TYPE_AXFR ideal-int +pkg syscall (windows-amd64), const DNS_TYPE_CERT ideal-int +pkg syscall (windows-amd64), const DNS_TYPE_CNAME ideal-int +pkg syscall (windows-amd64), const DNS_TYPE_DHCID ideal-int +pkg syscall (windows-amd64), const DNS_TYPE_DNAME ideal-int +pkg syscall (windows-amd64), const DNS_TYPE_DNSKEY ideal-int +pkg syscall (windows-amd64), const DNS_TYPE_DS ideal-int +pkg syscall (windows-amd64), const DNS_TYPE_EID ideal-int +pkg syscall (windows-amd64), const DNS_TYPE_GID ideal-int +pkg syscall (windows-amd64), const DNS_TYPE_GPOS ideal-int +pkg syscall (windows-amd64), const DNS_TYPE_HINFO ideal-int +pkg syscall (windows-amd64), const DNS_TYPE_ISDN ideal-int +pkg syscall (windows-amd64), const DNS_TYPE_IXFR ideal-int +pkg syscall (windows-amd64), const DNS_TYPE_KEY ideal-int +pkg syscall (windows-amd64), const DNS_TYPE_KX ideal-int +pkg syscall (windows-amd64), const DNS_TYPE_LOC ideal-int +pkg syscall (windows-amd64), const DNS_TYPE_MAILA ideal-int +pkg syscall (windows-amd64), const DNS_TYPE_MAILB ideal-int +pkg syscall (windows-amd64), const DNS_TYPE_MB ideal-int +pkg syscall (windows-amd64), const DNS_TYPE_MD ideal-int +pkg syscall (windows-amd64), const DNS_TYPE_MF ideal-int +pkg syscall (windows-amd64), const DNS_TYPE_MG ideal-int +pkg syscall (windows-amd64), const DNS_TYPE_MINFO ideal-int +pkg syscall (windows-amd64), const DNS_TYPE_MR ideal-int +pkg syscall (windows-amd64), const DNS_TYPE_MX ideal-int +pkg syscall (windows-amd64), const DNS_TYPE_NAPTR ideal-int +pkg syscall (windows-amd64), const DNS_TYPE_NBSTAT ideal-int +pkg syscall (windows-amd64), const DNS_TYPE_NIMLOC ideal-int +pkg syscall (windows-amd64), const DNS_TYPE_NS ideal-int +pkg syscall (windows-amd64), const DNS_TYPE_NSAP ideal-int +pkg syscall (windows-amd64), const DNS_TYPE_NSAPPTR ideal-int +pkg syscall (windows-amd64), const DNS_TYPE_NSEC ideal-int +pkg syscall (windows-amd64), const DNS_TYPE_NULL ideal-int +pkg syscall (windows-amd64), const DNS_TYPE_NXT ideal-int +pkg syscall (windows-amd64), const DNS_TYPE_OPT ideal-int +pkg syscall (windows-amd64), const DNS_TYPE_PTR ideal-int +pkg syscall (windows-amd64), const DNS_TYPE_PX ideal-int +pkg syscall (windows-amd64), const DNS_TYPE_RP ideal-int +pkg syscall (windows-amd64), const DNS_TYPE_RRSIG ideal-int +pkg syscall (windows-amd64), const DNS_TYPE_RT ideal-int +pkg syscall (windows-amd64), const DNS_TYPE_SIG ideal-int +pkg syscall (windows-amd64), const DNS_TYPE_SINK ideal-int +pkg syscall (windows-amd64), const DNS_TYPE_SOA ideal-int +pkg syscall (windows-amd64), const DNS_TYPE_SRV ideal-int +pkg syscall (windows-amd64), const DNS_TYPE_TEXT ideal-int +pkg syscall (windows-amd64), const DNS_TYPE_TKEY ideal-int +pkg syscall (windows-amd64), const DNS_TYPE_TSIG ideal-int +pkg syscall (windows-amd64), const DNS_TYPE_UID ideal-int +pkg syscall (windows-amd64), const DNS_TYPE_UINFO ideal-int +pkg syscall (windows-amd64), const DNS_TYPE_UNSPEC ideal-int +pkg syscall (windows-amd64), const DNS_TYPE_WINS ideal-int +pkg syscall (windows-amd64), const DNS_TYPE_WINSR ideal-int +pkg syscall (windows-amd64), const DNS_TYPE_WKS ideal-int +pkg syscall (windows-amd64), const DNS_TYPE_X25 ideal-int +pkg syscall (windows-amd64), const DUPLICATE_CLOSE_SOURCE ideal-int +pkg syscall (windows-amd64), const DUPLICATE_SAME_ACCESS ideal-int +pkg syscall (windows-amd64), const EADV Errno +pkg syscall (windows-amd64), const EBADE Errno +pkg syscall (windows-amd64), const EBADFD Errno +pkg syscall (windows-amd64), const EBADMSG Errno +pkg syscall (windows-amd64), const EBADR Errno +pkg syscall (windows-amd64), const EBADRQC Errno +pkg syscall (windows-amd64), const EBADSLT Errno +pkg syscall (windows-amd64), const EBFONT Errno +pkg syscall (windows-amd64), const ECHRNG Errno +pkg syscall (windows-amd64), const ECOMM Errno +pkg syscall (windows-amd64), const EDEADLOCK Errno +pkg syscall (windows-amd64), const EDOTDOT Errno +pkg syscall (windows-amd64), const EISNAM Errno +pkg syscall (windows-amd64), const EKEYEXPIRED Errno +pkg syscall (windows-amd64), const EKEYREJECTED Errno +pkg syscall (windows-amd64), const EKEYREVOKED Errno +pkg syscall (windows-amd64), const EL2HLT Errno +pkg syscall (windows-amd64), const EL2NSYNC Errno +pkg syscall (windows-amd64), const EL3HLT Errno +pkg syscall (windows-amd64), const EL3RST Errno +pkg syscall (windows-amd64), const ELIBACC Errno +pkg syscall (windows-amd64), const ELIBBAD Errno +pkg syscall (windows-amd64), const ELIBEXEC Errno +pkg syscall (windows-amd64), const ELIBMAX Errno +pkg syscall (windows-amd64), const ELIBSCN Errno +pkg syscall (windows-amd64), const ELNRNG Errno +pkg syscall (windows-amd64), const EMEDIUMTYPE Errno +pkg syscall (windows-amd64), const EMULTIHOP Errno +pkg syscall (windows-amd64), const ENAVAIL Errno +pkg syscall (windows-amd64), const ENOANO Errno +pkg syscall (windows-amd64), const ENOCSI Errno +pkg syscall (windows-amd64), const ENODATA Errno +pkg syscall (windows-amd64), const ENOKEY Errno +pkg syscall (windows-amd64), const ENOLINK Errno +pkg syscall (windows-amd64), const ENOMEDIUM Errno +pkg syscall (windows-amd64), const ENONET Errno +pkg syscall (windows-amd64), const ENOPKG Errno +pkg syscall (windows-amd64), const ENOSR Errno +pkg syscall (windows-amd64), const ENOSTR Errno +pkg syscall (windows-amd64), const ENOTNAM Errno +pkg syscall (windows-amd64), const ENOTRECOVERABLE Errno +pkg syscall (windows-amd64), const ENOTUNIQ Errno +pkg syscall (windows-amd64), const EOWNERDEAD Errno +pkg syscall (windows-amd64), const EPROTO Errno +pkg syscall (windows-amd64), const EREMCHG Errno +pkg syscall (windows-amd64), const EREMOTEIO Errno +pkg syscall (windows-amd64), const ERESTART Errno +pkg syscall (windows-amd64), const ERROR_ACCESS_DENIED Errno +pkg syscall (windows-amd64), const ERROR_ALREADY_EXISTS Errno +pkg syscall (windows-amd64), const ERROR_BROKEN_PIPE Errno +pkg syscall (windows-amd64), const ERROR_BUFFER_OVERFLOW Errno +pkg syscall (windows-amd64), const ERROR_ENVVAR_NOT_FOUND Errno +pkg syscall (windows-amd64), const ERROR_FILE_EXISTS Errno +pkg syscall (windows-amd64), const ERROR_FILE_NOT_FOUND Errno +pkg syscall (windows-amd64), const ERROR_INSUFFICIENT_BUFFER Errno +pkg syscall (windows-amd64), const ERROR_IO_PENDING Errno +pkg syscall (windows-amd64), const ERROR_MOD_NOT_FOUND Errno +pkg syscall (windows-amd64), const ERROR_NO_MORE_FILES Errno +pkg syscall (windows-amd64), const ERROR_OPERATION_ABORTED Errno +pkg syscall (windows-amd64), const ERROR_PATH_NOT_FOUND Errno +pkg syscall (windows-amd64), const ERROR_PROC_NOT_FOUND Errno +pkg syscall (windows-amd64), const ESRMNT Errno +pkg syscall (windows-amd64), const ESTRPIPE Errno +pkg syscall (windows-amd64), const ETIME Errno +pkg syscall (windows-amd64), const EUCLEAN Errno +pkg syscall (windows-amd64), const EUNATCH Errno +pkg syscall (windows-amd64), const EWINDOWS Errno +pkg syscall (windows-amd64), const EXFULL Errno +pkg syscall (windows-amd64), const FILE_ACTION_ADDED ideal-int +pkg syscall (windows-amd64), const FILE_ACTION_MODIFIED ideal-int +pkg syscall (windows-amd64), const FILE_ACTION_REMOVED ideal-int +pkg syscall (windows-amd64), const FILE_ACTION_RENAMED_NEW_NAME ideal-int +pkg syscall (windows-amd64), const FILE_ACTION_RENAMED_OLD_NAME ideal-int +pkg syscall (windows-amd64), const FILE_APPEND_DATA ideal-int +pkg syscall (windows-amd64), const FILE_ATTRIBUTE_ARCHIVE ideal-int +pkg syscall (windows-amd64), const FILE_ATTRIBUTE_DIRECTORY ideal-int +pkg syscall (windows-amd64), const FILE_ATTRIBUTE_HIDDEN ideal-int +pkg syscall (windows-amd64), const FILE_ATTRIBUTE_NORMAL ideal-int +pkg syscall (windows-amd64), const FILE_ATTRIBUTE_READONLY ideal-int +pkg syscall (windows-amd64), const FILE_ATTRIBUTE_SYSTEM ideal-int +pkg syscall (windows-amd64), const FILE_BEGIN ideal-int +pkg syscall (windows-amd64), const FILE_CURRENT ideal-int +pkg syscall (windows-amd64), const FILE_END ideal-int +pkg syscall (windows-amd64), const FILE_FLAG_BACKUP_SEMANTICS ideal-int +pkg syscall (windows-amd64), const FILE_FLAG_OVERLAPPED ideal-int +pkg syscall (windows-amd64), const FILE_LIST_DIRECTORY ideal-int +pkg syscall (windows-amd64), const FILE_MAP_COPY ideal-int +pkg syscall (windows-amd64), const FILE_MAP_EXECUTE ideal-int +pkg syscall (windows-amd64), const FILE_MAP_READ ideal-int +pkg syscall (windows-amd64), const FILE_MAP_WRITE ideal-int +pkg syscall (windows-amd64), const FILE_NOTIFY_CHANGE_ATTRIBUTES ideal-int +pkg syscall (windows-amd64), const FILE_NOTIFY_CHANGE_CREATION ideal-int +pkg syscall (windows-amd64), const FILE_NOTIFY_CHANGE_DIR_NAME ideal-int +pkg syscall (windows-amd64), const FILE_NOTIFY_CHANGE_FILE_NAME ideal-int +pkg syscall (windows-amd64), const FILE_NOTIFY_CHANGE_LAST_ACCESS ideal-int +pkg syscall (windows-amd64), const FILE_NOTIFY_CHANGE_LAST_WRITE ideal-int +pkg syscall (windows-amd64), const FILE_NOTIFY_CHANGE_SIZE ideal-int +pkg syscall (windows-amd64), const FILE_SHARE_DELETE ideal-int +pkg syscall (windows-amd64), const FILE_SHARE_READ ideal-int +pkg syscall (windows-amd64), const FILE_SHARE_WRITE ideal-int +pkg syscall (windows-amd64), const FILE_TYPE_CHAR ideal-int +pkg syscall (windows-amd64), const FILE_TYPE_DISK ideal-int +pkg syscall (windows-amd64), const FILE_TYPE_PIPE ideal-int +pkg syscall (windows-amd64), const FILE_TYPE_REMOTE ideal-int +pkg syscall (windows-amd64), const FILE_TYPE_UNKNOWN ideal-int +pkg syscall (windows-amd64), const FILE_WRITE_ATTRIBUTES ideal-int +pkg syscall (windows-amd64), const FORMAT_MESSAGE_ALLOCATE_BUFFER ideal-int +pkg syscall (windows-amd64), const FORMAT_MESSAGE_ARGUMENT_ARRAY ideal-int +pkg syscall (windows-amd64), const FORMAT_MESSAGE_FROM_HMODULE ideal-int +pkg syscall (windows-amd64), const FORMAT_MESSAGE_FROM_STRING ideal-int +pkg syscall (windows-amd64), const FORMAT_MESSAGE_FROM_SYSTEM ideal-int +pkg syscall (windows-amd64), const FORMAT_MESSAGE_IGNORE_INSERTS ideal-int +pkg syscall (windows-amd64), const FORMAT_MESSAGE_MAX_WIDTH_MASK ideal-int +pkg syscall (windows-amd64), const GENERIC_ALL ideal-int +pkg syscall (windows-amd64), const GENERIC_EXECUTE ideal-int +pkg syscall (windows-amd64), const GENERIC_READ ideal-int +pkg syscall (windows-amd64), const GENERIC_WRITE ideal-int +pkg syscall (windows-amd64), const GetFileExInfoStandard ideal-int +pkg syscall (windows-amd64), const GetFileExMaxInfoLevel ideal-int +pkg syscall (windows-amd64), const HANDLE_FLAG_INHERIT ideal-int +pkg syscall (windows-amd64), const HKEY_CLASSES_ROOT ideal-int +pkg syscall (windows-amd64), const HKEY_CURRENT_CONFIG ideal-int +pkg syscall (windows-amd64), const HKEY_CURRENT_USER ideal-int +pkg syscall (windows-amd64), const HKEY_DYN_DATA ideal-int +pkg syscall (windows-amd64), const HKEY_LOCAL_MACHINE ideal-int +pkg syscall (windows-amd64), const HKEY_PERFORMANCE_DATA ideal-int +pkg syscall (windows-amd64), const HKEY_USERS ideal-int +pkg syscall (windows-amd64), const IFF_POINTTOPOINT ideal-int +pkg syscall (windows-amd64), const IGNORE ideal-int +pkg syscall (windows-amd64), const INFINITE ideal-int +pkg syscall (windows-amd64), const INVALID_FILE_ATTRIBUTES ideal-int +pkg syscall (windows-amd64), const InvalidHandle Handle +pkg syscall (windows-amd64), const KEY_ALL_ACCESS ideal-int +pkg syscall (windows-amd64), const KEY_CREATE_LINK ideal-int +pkg syscall (windows-amd64), const KEY_CREATE_SUB_KEY ideal-int +pkg syscall (windows-amd64), const KEY_ENUMERATE_SUB_KEYS ideal-int +pkg syscall (windows-amd64), const KEY_EXECUTE ideal-int +pkg syscall (windows-amd64), const KEY_NOTIFY ideal-int +pkg syscall (windows-amd64), const KEY_QUERY_VALUE ideal-int +pkg syscall (windows-amd64), const KEY_READ ideal-int +pkg syscall (windows-amd64), const KEY_SET_VALUE ideal-int +pkg syscall (windows-amd64), const KEY_WOW64_32KEY ideal-int +pkg syscall (windows-amd64), const KEY_WOW64_64KEY ideal-int +pkg syscall (windows-amd64), const KEY_WRITE ideal-int +pkg syscall (windows-amd64), const LANG_ENGLISH ideal-int +pkg syscall (windows-amd64), const MAXLEN_IFDESCR ideal-int +pkg syscall (windows-amd64), const MAXLEN_PHYSADDR ideal-int +pkg syscall (windows-amd64), const MAX_ADAPTER_ADDRESS_LENGTH ideal-int +pkg syscall (windows-amd64), const MAX_ADAPTER_DESCRIPTION_LENGTH ideal-int +pkg syscall (windows-amd64), const MAX_ADAPTER_NAME_LENGTH ideal-int +pkg syscall (windows-amd64), const MAX_COMPUTERNAME_LENGTH ideal-int +pkg syscall (windows-amd64), const MAX_INTERFACE_NAME_LEN ideal-int +pkg syscall (windows-amd64), const MAX_LONG_PATH ideal-int +pkg syscall (windows-amd64), const MAX_PATH ideal-int +pkg syscall (windows-amd64), const MaxTokenInfoClass ideal-int +pkg syscall (windows-amd64), const NameCanonical ideal-int +pkg syscall (windows-amd64), const NameCanonicalEx ideal-int +pkg syscall (windows-amd64), const NameDisplay ideal-int +pkg syscall (windows-amd64), const NameDnsDomain ideal-int +pkg syscall (windows-amd64), const NameFullyQualifiedDN ideal-int +pkg syscall (windows-amd64), const NameSamCompatible ideal-int +pkg syscall (windows-amd64), const NameServicePrincipal ideal-int +pkg syscall (windows-amd64), const NameUniqueId ideal-int +pkg syscall (windows-amd64), const NameUnknown ideal-int +pkg syscall (windows-amd64), const NameUserPrincipal ideal-int +pkg syscall (windows-amd64), const OPEN_ALWAYS ideal-int +pkg syscall (windows-amd64), const OPEN_EXISTING ideal-int +pkg syscall (windows-amd64), const PAGE_EXECUTE_READ ideal-int +pkg syscall (windows-amd64), const PAGE_EXECUTE_READWRITE ideal-int +pkg syscall (windows-amd64), const PAGE_EXECUTE_WRITECOPY ideal-int +pkg syscall (windows-amd64), const PAGE_READONLY ideal-int +pkg syscall (windows-amd64), const PAGE_READWRITE ideal-int +pkg syscall (windows-amd64), const PAGE_WRITECOPY ideal-int +pkg syscall (windows-amd64), const PKCS_7_ASN_ENCODING ideal-int +pkg syscall (windows-amd64), const PROCESS_QUERY_INFORMATION ideal-int +pkg syscall (windows-amd64), const PROV_DH_SCHANNEL ideal-int +pkg syscall (windows-amd64), const PROV_DSS ideal-int +pkg syscall (windows-amd64), const PROV_DSS_DH ideal-int +pkg syscall (windows-amd64), const PROV_EC_ECDSA_FULL ideal-int +pkg syscall (windows-amd64), const PROV_EC_ECDSA_SIG ideal-int +pkg syscall (windows-amd64), const PROV_EC_ECNRA_FULL ideal-int +pkg syscall (windows-amd64), const PROV_EC_ECNRA_SIG ideal-int +pkg syscall (windows-amd64), const PROV_FORTEZZA ideal-int +pkg syscall (windows-amd64), const PROV_INTEL_SEC ideal-int +pkg syscall (windows-amd64), const PROV_MS_EXCHANGE ideal-int +pkg syscall (windows-amd64), const PROV_REPLACE_OWF ideal-int +pkg syscall (windows-amd64), const PROV_RNG ideal-int +pkg syscall (windows-amd64), const PROV_RSA_AES ideal-int +pkg syscall (windows-amd64), const PROV_RSA_FULL ideal-int +pkg syscall (windows-amd64), const PROV_RSA_SCHANNEL ideal-int +pkg syscall (windows-amd64), const PROV_RSA_SIG ideal-int +pkg syscall (windows-amd64), const PROV_SPYRUS_LYNKS ideal-int +pkg syscall (windows-amd64), const PROV_SSL ideal-int +pkg syscall (windows-amd64), const REG_BINARY ideal-int +pkg syscall (windows-amd64), const REG_DWORD ideal-int +pkg syscall (windows-amd64), const REG_DWORD_BIG_ENDIAN ideal-int +pkg syscall (windows-amd64), const REG_DWORD_LITTLE_ENDIAN ideal-int +pkg syscall (windows-amd64), const REG_EXPAND_SZ ideal-int +pkg syscall (windows-amd64), const REG_FULL_RESOURCE_DESCRIPTOR ideal-int +pkg syscall (windows-amd64), const REG_LINK ideal-int +pkg syscall (windows-amd64), const REG_MULTI_SZ ideal-int +pkg syscall (windows-amd64), const REG_NONE ideal-int +pkg syscall (windows-amd64), const REG_QWORD ideal-int +pkg syscall (windows-amd64), const REG_QWORD_LITTLE_ENDIAN ideal-int +pkg syscall (windows-amd64), const REG_RESOURCE_LIST ideal-int +pkg syscall (windows-amd64), const REG_RESOURCE_REQUIREMENTS_LIST ideal-int +pkg syscall (windows-amd64), const REG_SZ ideal-int +pkg syscall (windows-amd64), const SIO_GET_INTERFACE_LIST ideal-int +pkg syscall (windows-amd64), const SO_UPDATE_ACCEPT_CONTEXT ideal-int +pkg syscall (windows-amd64), const STANDARD_RIGHTS_ALL ideal-int +pkg syscall (windows-amd64), const STANDARD_RIGHTS_EXECUTE ideal-int +pkg syscall (windows-amd64), const STANDARD_RIGHTS_READ ideal-int +pkg syscall (windows-amd64), const STANDARD_RIGHTS_REQUIRED ideal-int +pkg syscall (windows-amd64), const STANDARD_RIGHTS_WRITE ideal-int +pkg syscall (windows-amd64), const STARTF_USESHOWWINDOW ideal-int +pkg syscall (windows-amd64), const STARTF_USESTDHANDLES ideal-int +pkg syscall (windows-amd64), const STD_ERROR_HANDLE ideal-int +pkg syscall (windows-amd64), const STD_INPUT_HANDLE ideal-int +pkg syscall (windows-amd64), const STD_OUTPUT_HANDLE ideal-int +pkg syscall (windows-amd64), const SUBLANG_ENGLISH_US ideal-int +pkg syscall (windows-amd64), const SW_FORCEMINIMIZE ideal-int +pkg syscall (windows-amd64), const SW_HIDE ideal-int +pkg syscall (windows-amd64), const SW_MAXIMIZE ideal-int +pkg syscall (windows-amd64), const SW_MINIMIZE ideal-int +pkg syscall (windows-amd64), const SW_NORMAL ideal-int +pkg syscall (windows-amd64), const SW_RESTORE ideal-int +pkg syscall (windows-amd64), const SW_SHOW ideal-int +pkg syscall (windows-amd64), const SW_SHOWDEFAULT ideal-int +pkg syscall (windows-amd64), const SW_SHOWMAXIMIZED ideal-int +pkg syscall (windows-amd64), const SW_SHOWMINIMIZED ideal-int +pkg syscall (windows-amd64), const SW_SHOWMINNOACTIVE ideal-int +pkg syscall (windows-amd64), const SW_SHOWNA ideal-int +pkg syscall (windows-amd64), const SW_SHOWNOACTIVATE ideal-int +pkg syscall (windows-amd64), const SW_SHOWNORMAL ideal-int +pkg syscall (windows-amd64), const SYNCHRONIZE ideal-int +pkg syscall (windows-amd64), const S_IWRITE ideal-int +pkg syscall (windows-amd64), const SidTypeAlias ideal-int +pkg syscall (windows-amd64), const SidTypeComputer ideal-int +pkg syscall (windows-amd64), const SidTypeDeletedAccount ideal-int +pkg syscall (windows-amd64), const SidTypeDomain ideal-int +pkg syscall (windows-amd64), const SidTypeGroup ideal-int +pkg syscall (windows-amd64), const SidTypeInvalid ideal-int +pkg syscall (windows-amd64), const SidTypeLabel ideal-int +pkg syscall (windows-amd64), const SidTypeUnknown ideal-int +pkg syscall (windows-amd64), const SidTypeUser ideal-int +pkg syscall (windows-amd64), const SidTypeWellKnownGroup ideal-int +pkg syscall (windows-amd64), const TF_DISCONNECT ideal-int +pkg syscall (windows-amd64), const TF_REUSE_SOCKET ideal-int +pkg syscall (windows-amd64), const TF_USE_DEFAULT_WORKER ideal-int +pkg syscall (windows-amd64), const TF_USE_KERNEL_APC ideal-int +pkg syscall (windows-amd64), const TF_USE_SYSTEM_THREAD ideal-int +pkg syscall (windows-amd64), const TF_WRITE_BEHIND ideal-int +pkg syscall (windows-amd64), const TIME_ZONE_ID_DAYLIGHT ideal-int +pkg syscall (windows-amd64), const TIME_ZONE_ID_STANDARD ideal-int +pkg syscall (windows-amd64), const TIME_ZONE_ID_UNKNOWN ideal-int +pkg syscall (windows-amd64), const TOKEN_ADJUST_DEFAULT ideal-int +pkg syscall (windows-amd64), const TOKEN_ADJUST_GROUPS ideal-int +pkg syscall (windows-amd64), const TOKEN_ADJUST_PRIVILEGES ideal-int +pkg syscall (windows-amd64), const TOKEN_ALL_ACCESS ideal-int +pkg syscall (windows-amd64), const TOKEN_ASSIGN_PRIMARY ideal-int +pkg syscall (windows-amd64), const TOKEN_DUPLICATE ideal-int +pkg syscall (windows-amd64), const TOKEN_EXECUTE ideal-int +pkg syscall (windows-amd64), const TOKEN_IMPERSONATE ideal-int +pkg syscall (windows-amd64), const TOKEN_QUERY ideal-int +pkg syscall (windows-amd64), const TOKEN_QUERY_SOURCE ideal-int +pkg syscall (windows-amd64), const TOKEN_READ ideal-int +pkg syscall (windows-amd64), const TOKEN_WRITE ideal-int +pkg syscall (windows-amd64), const TRUNCATE_EXISTING ideal-int +pkg syscall (windows-amd64), const TokenAccessInformation ideal-int +pkg syscall (windows-amd64), const TokenAuditPolicy ideal-int +pkg syscall (windows-amd64), const TokenDefaultDacl ideal-int +pkg syscall (windows-amd64), const TokenElevation ideal-int +pkg syscall (windows-amd64), const TokenElevationType ideal-int +pkg syscall (windows-amd64), const TokenGroups ideal-int +pkg syscall (windows-amd64), const TokenGroupsAndPrivileges ideal-int +pkg syscall (windows-amd64), const TokenHasRestrictions ideal-int +pkg syscall (windows-amd64), const TokenImpersonationLevel ideal-int +pkg syscall (windows-amd64), const TokenIntegrityLevel ideal-int +pkg syscall (windows-amd64), const TokenLinkedToken ideal-int +pkg syscall (windows-amd64), const TokenLogonSid ideal-int +pkg syscall (windows-amd64), const TokenMandatoryPolicy ideal-int +pkg syscall (windows-amd64), const TokenOrigin ideal-int +pkg syscall (windows-amd64), const TokenOwner ideal-int +pkg syscall (windows-amd64), const TokenPrimaryGroup ideal-int +pkg syscall (windows-amd64), const TokenPrivileges ideal-int +pkg syscall (windows-amd64), const TokenRestrictedSids ideal-int +pkg syscall (windows-amd64), const TokenSandBoxInert ideal-int +pkg syscall (windows-amd64), const TokenSessionId ideal-int +pkg syscall (windows-amd64), const TokenSessionReference ideal-int +pkg syscall (windows-amd64), const TokenSource ideal-int +pkg syscall (windows-amd64), const TokenStatistics ideal-int +pkg syscall (windows-amd64), const TokenType ideal-int +pkg syscall (windows-amd64), const TokenUIAccess ideal-int +pkg syscall (windows-amd64), const TokenUser ideal-int +pkg syscall (windows-amd64), const TokenVirtualizationAllowed ideal-int +pkg syscall (windows-amd64), const TokenVirtualizationEnabled ideal-int +pkg syscall (windows-amd64), const USAGE_MATCH_TYPE_AND ideal-int +pkg syscall (windows-amd64), const USAGE_MATCH_TYPE_OR ideal-int +pkg syscall (windows-amd64), const WAIT_ABANDONED ideal-int +pkg syscall (windows-amd64), const WAIT_FAILED ideal-int +pkg syscall (windows-amd64), const WAIT_OBJECT_0 ideal-int +pkg syscall (windows-amd64), const WAIT_TIMEOUT ideal-int +pkg syscall (windows-amd64), const WSADESCRIPTION_LEN ideal-int +pkg syscall (windows-amd64), const WSASYS_STATUS_LEN ideal-int +pkg syscall (windows-amd64), const X509_ASN_ENCODING ideal-int +pkg syscall (windows-amd64), func Accept(Handle) (Handle, Sockaddr, error) +pkg syscall (windows-amd64), func AcceptEx(Handle, Handle, *uint8, uint32, uint32, uint32, *uint32, *Overlapped) error +pkg syscall (windows-amd64), func Bind(Handle, Sockaddr) error +pkg syscall (windows-amd64), func CancelIo(Handle) error +pkg syscall (windows-amd64), func CertAddCertificateContextToStore(Handle, *CertContext, uint32, **CertContext) error +pkg syscall (windows-amd64), func CertCloseStore(Handle, uint32) error +pkg syscall (windows-amd64), func CertCreateCertificateContext(uint32, *uint8, uint32) (*CertContext, error) +pkg syscall (windows-amd64), func CertEnumCertificatesInStore(Handle, *CertContext) (*CertContext, error) +pkg syscall (windows-amd64), func CertFreeCertificateChain(*CertChainContext) +pkg syscall (windows-amd64), func CertFreeCertificateContext(*CertContext) error +pkg syscall (windows-amd64), func CertGetCertificateChain(Handle, *CertContext, *Filetime, Handle, *CertChainPara, uint32, uintptr, **CertChainContext) error +pkg syscall (windows-amd64), func CertOpenStore(uintptr, uint32, uintptr, uint32, uintptr) (Handle, error) +pkg syscall (windows-amd64), func CertOpenSystemStore(Handle, *uint16) (Handle, error) +pkg syscall (windows-amd64), func CertVerifyCertificateChainPolicy(uintptr, *CertChainContext, *CertChainPolicyPara, *CertChainPolicyStatus) error +pkg syscall (windows-amd64), func Close(Handle) error +pkg syscall (windows-amd64), func CloseHandle(Handle) error +pkg syscall (windows-amd64), func CloseOnExec(Handle) +pkg syscall (windows-amd64), func Closesocket(Handle) error +pkg syscall (windows-amd64), func CommandLineToArgv(*uint16, *int32) (*[8192]*[8192]uint16, error) +pkg syscall (windows-amd64), func ComputerName() (string, error) +pkg syscall (windows-amd64), func Connect(Handle, Sockaddr) error +pkg syscall (windows-amd64), func ConvertSidToStringSid(*SID, **uint16) error +pkg syscall (windows-amd64), func ConvertStringSidToSid(*uint16, **SID) error +pkg syscall (windows-amd64), func CopySid(uint32, *SID, *SID) error +pkg syscall (windows-amd64), func CreateDirectory(*uint16, *SecurityAttributes) error +pkg syscall (windows-amd64), func CreateFile(*uint16, uint32, uint32, *SecurityAttributes, uint32, uint32, int32) (Handle, error) +pkg syscall (windows-amd64), func CreateFileMapping(Handle, *SecurityAttributes, uint32, uint32, uint32, *uint16) (Handle, error) +pkg syscall (windows-amd64), func CreateIoCompletionPort(Handle, Handle, uint32, uint32) (Handle, error) +pkg syscall (windows-amd64), func CreatePipe(*Handle, *Handle, *SecurityAttributes, uint32) error +pkg syscall (windows-amd64), func CreateProcess(*uint16, *uint16, *SecurityAttributes, *SecurityAttributes, bool, uint32, *uint16, *uint16, *StartupInfo, *ProcessInformation) error +pkg syscall (windows-amd64), func CryptAcquireContext(*Handle, *uint16, *uint16, uint32, uint32) error +pkg syscall (windows-amd64), func CryptGenRandom(Handle, uint32, *uint8) error +pkg syscall (windows-amd64), func CryptReleaseContext(Handle, uint32) error +pkg syscall (windows-amd64), func DeleteFile(*uint16) error +pkg syscall (windows-amd64), func DnsQuery(string, uint16, uint32, *uint8, **DNSRecord, *uint8) error +pkg syscall (windows-amd64), func DnsRecordListFree(*DNSRecord, uint32) +pkg syscall (windows-amd64), func DuplicateHandle(Handle, Handle, Handle, *Handle, uint32, bool, uint32) error +pkg syscall (windows-amd64), func EscapeArg(string) string +pkg syscall (windows-amd64), func ExitProcess(uint32) +pkg syscall (windows-amd64), func Fchdir(Handle) error +pkg syscall (windows-amd64), func Fchmod(Handle, uint32) error +pkg syscall (windows-amd64), func Fchown(Handle, int, int) error +pkg syscall (windows-amd64), func FindClose(Handle) error +pkg syscall (windows-amd64), func FindFirstFile(*uint16, *Win32finddata) (Handle, error) +pkg syscall (windows-amd64), func FindNextFile(Handle, *Win32finddata) error +pkg syscall (windows-amd64), func FlushFileBuffers(Handle) error +pkg syscall (windows-amd64), func FlushViewOfFile(uintptr, uintptr) error +pkg syscall (windows-amd64), func FormatMessage(uint32, uint32, uint32, uint32, []uint16, *uint8) (uint32, error) +pkg syscall (windows-amd64), func FreeEnvironmentStrings(*uint16) error +pkg syscall (windows-amd64), func FreeLibrary(Handle) error +pkg syscall (windows-amd64), func Fsync(Handle) error +pkg syscall (windows-amd64), func Ftruncate(Handle, int64) error +pkg syscall (windows-amd64), func GetAcceptExSockaddrs(*uint8, uint32, uint32, uint32, **RawSockaddrAny, *int32, **RawSockaddrAny, *int32) +pkg syscall (windows-amd64), func GetAdaptersInfo(*IpAdapterInfo, *uint32) error +pkg syscall (windows-amd64), func GetCommandLine() *uint16 +pkg syscall (windows-amd64), func GetComputerName(*uint16, *uint32) error +pkg syscall (windows-amd64), func GetCurrentDirectory(uint32, *uint16) (uint32, error) +pkg syscall (windows-amd64), func GetCurrentProcess() (Handle, error) +pkg syscall (windows-amd64), func GetEnvironmentStrings() (*uint16, error) +pkg syscall (windows-amd64), func GetEnvironmentVariable(*uint16, *uint16, uint32) (uint32, error) +pkg syscall (windows-amd64), func GetExitCodeProcess(Handle, *uint32) error +pkg syscall (windows-amd64), func GetFileAttributes(*uint16) (uint32, error) +pkg syscall (windows-amd64), func GetFileAttributesEx(*uint16, uint32, *uint8) error +pkg syscall (windows-amd64), func GetFileInformationByHandle(Handle, *ByHandleFileInformation) error +pkg syscall (windows-amd64), func GetFileType(Handle) (uint32, error) +pkg syscall (windows-amd64), func GetFullPathName(*uint16, uint32, *uint16, **uint16) (uint32, error) +pkg syscall (windows-amd64), func GetHostByName(string) (*Hostent, error) +pkg syscall (windows-amd64), func GetIfEntry(*MibIfRow) error +pkg syscall (windows-amd64), func GetLastError() error +pkg syscall (windows-amd64), func GetLengthSid(*SID) uint32 +pkg syscall (windows-amd64), func GetLongPathName(*uint16, *uint16, uint32) (uint32, error) +pkg syscall (windows-amd64), func GetProcAddress(Handle, string) (uintptr, error) +pkg syscall (windows-amd64), func GetProcessTimes(Handle, *Filetime, *Filetime, *Filetime, *Filetime) error +pkg syscall (windows-amd64), func GetProtoByName(string) (*Protoent, error) +pkg syscall (windows-amd64), func GetQueuedCompletionStatus(Handle, *uint32, *uint32, **Overlapped, uint32) error +pkg syscall (windows-amd64), func GetServByName(string, string) (*Servent, error) +pkg syscall (windows-amd64), func GetShortPathName(*uint16, *uint16, uint32) (uint32, error) +pkg syscall (windows-amd64), func GetStartupInfo(*StartupInfo) error +pkg syscall (windows-amd64), func GetStdHandle(int) (Handle, error) +pkg syscall (windows-amd64), func GetSystemTimeAsFileTime(*Filetime) +pkg syscall (windows-amd64), func GetTempPath(uint32, *uint16) (uint32, error) +pkg syscall (windows-amd64), func GetTimeZoneInformation(*Timezoneinformation) (uint32, error) +pkg syscall (windows-amd64), func GetTokenInformation(Token, uint32, *uint8, uint32, *uint32) error +pkg syscall (windows-amd64), func GetUserNameEx(uint32, *uint16, *uint32) error +pkg syscall (windows-amd64), func GetUserProfileDirectory(Token, *uint16, *uint32) error +pkg syscall (windows-amd64), func GetVersion() (uint32, error) +pkg syscall (windows-amd64), func Getpeername(Handle) (Sockaddr, error) +pkg syscall (windows-amd64), func Getsockname(Handle) (Sockaddr, error) +pkg syscall (windows-amd64), func GetsockoptInt(Handle, int, int) (int, error) +pkg syscall (windows-amd64), func Listen(Handle, int) error +pkg syscall (windows-amd64), func LoadDLL(string) (*DLL, error) +pkg syscall (windows-amd64), func LoadLibrary(string) (Handle, error) +pkg syscall (windows-amd64), func LocalFree(Handle) (Handle, error) +pkg syscall (windows-amd64), func LookupAccountName(*uint16, *uint16, *SID, *uint32, *uint16, *uint32, *uint32) error +pkg syscall (windows-amd64), func LookupAccountSid(*uint16, *SID, *uint16, *uint32, *uint16, *uint32, *uint32) error +pkg syscall (windows-amd64), func LookupSID(string, string) (*SID, string, uint32, error) +pkg syscall (windows-amd64), func MapViewOfFile(Handle, uint32, uint32, uint32, uintptr) (uintptr, error) +pkg syscall (windows-amd64), func MoveFile(*uint16, *uint16) error +pkg syscall (windows-amd64), func MustLoadDLL(string) *DLL +pkg syscall (windows-amd64), func NetApiBufferFree(*uint8) error +pkg syscall (windows-amd64), func NetUserGetInfo(*uint16, *uint16, uint32, **uint8) error +pkg syscall (windows-amd64), func NewCallback(interface{}) uintptr +pkg syscall (windows-amd64), func NewLazyDLL(string) *LazyDLL +pkg syscall (windows-amd64), func NsecToFiletime(int64) Filetime +pkg syscall (windows-amd64), func Ntohs(uint16) uint16 +pkg syscall (windows-amd64), func Open(string, int, uint32) (Handle, error) +pkg syscall (windows-amd64), func OpenCurrentProcessToken() (Token, error) +pkg syscall (windows-amd64), func OpenProcess(uint32, bool, uint32) (Handle, error) +pkg syscall (windows-amd64), func OpenProcessToken(Handle, uint32, *Token) error +pkg syscall (windows-amd64), func Pipe([]Handle) error +pkg syscall (windows-amd64), func PostQueuedCompletionStatus(Handle, uint32, uint32, *Overlapped) error +pkg syscall (windows-amd64), func Read(Handle, []uint8) (int, error) +pkg syscall (windows-amd64), func ReadDirectoryChanges(Handle, *uint8, uint32, bool, uint32, *uint32, *Overlapped, uintptr) error +pkg syscall (windows-amd64), func ReadFile(Handle, []uint8, *uint32, *Overlapped) error +pkg syscall (windows-amd64), func Recvfrom(Handle, []uint8, int) (int, Sockaddr, error) +pkg syscall (windows-amd64), func RegCloseKey(Handle) error +pkg syscall (windows-amd64), func RegEnumKeyEx(Handle, uint32, *uint16, *uint32, *uint32, *uint16, *uint32, *Filetime) error +pkg syscall (windows-amd64), func RegOpenKeyEx(Handle, *uint16, uint32, uint32, *Handle) error +pkg syscall (windows-amd64), func RegQueryInfoKey(Handle, *uint16, *uint32, *uint32, *uint32, *uint32, *uint32, *uint32, *uint32, *uint32, *uint32, *Filetime) error +pkg syscall (windows-amd64), func RegQueryValueEx(Handle, *uint16, *uint32, *uint32, *uint8, *uint32) error +pkg syscall (windows-amd64), func RemoveDirectory(*uint16) error +pkg syscall (windows-amd64), func Seek(Handle, int64, int) (int64, error) +pkg syscall (windows-amd64), func Sendto(Handle, []uint8, int, Sockaddr) error +pkg syscall (windows-amd64), func SetCurrentDirectory(*uint16) error +pkg syscall (windows-amd64), func SetEndOfFile(Handle) error +pkg syscall (windows-amd64), func SetEnvironmentVariable(*uint16, *uint16) error +pkg syscall (windows-amd64), func SetFileAttributes(*uint16, uint32) error +pkg syscall (windows-amd64), func SetFilePointer(Handle, int32, *int32, uint32) (uint32, error) +pkg syscall (windows-amd64), func SetFileTime(Handle, *Filetime, *Filetime, *Filetime) error +pkg syscall (windows-amd64), func SetHandleInformation(Handle, uint32, uint32) error +pkg syscall (windows-amd64), func SetNonblock(Handle, bool) error +pkg syscall (windows-amd64), func Setsockopt(Handle, int32, int32, *uint8, int32) error +pkg syscall (windows-amd64), func SetsockoptIPMreq(Handle, int, int, *IPMreq) error +pkg syscall (windows-amd64), func SetsockoptIPv6Mreq(Handle, int, int, *IPv6Mreq) error +pkg syscall (windows-amd64), func SetsockoptInet4Addr(Handle, int, int, [4]uint8) error +pkg syscall (windows-amd64), func SetsockoptInt(Handle, int, int, int) error +pkg syscall (windows-amd64), func SetsockoptLinger(Handle, int, int, *Linger) error +pkg syscall (windows-amd64), func SetsockoptTimeval(Handle, int, int, *Timeval) error +pkg syscall (windows-amd64), func Shutdown(Handle, int) error +pkg syscall (windows-amd64), func Socket(int, int, int) (Handle, error) +pkg syscall (windows-amd64), func StringToSid(string) (*SID, error) +pkg syscall (windows-amd64), func StringToUTF16(string) []uint16 +pkg syscall (windows-amd64), func StringToUTF16Ptr(string) *uint16 +pkg syscall (windows-amd64), func Syscall(uintptr, uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno) +pkg syscall (windows-amd64), func Syscall12(uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno) +pkg syscall (windows-amd64), func Syscall15(uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno) +pkg syscall (windows-amd64), func Syscall6(uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno) +pkg syscall (windows-amd64), func Syscall9(uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno) +pkg syscall (windows-amd64), func TerminateProcess(Handle, uint32) error +pkg syscall (windows-amd64), func TranslateAccountName(string, uint32, uint32, int) (string, error) +pkg syscall (windows-amd64), func TranslateName(*uint16, uint32, uint32, *uint16, *uint32) error +pkg syscall (windows-amd64), func TransmitFile(Handle, Handle, uint32, uint32, *Overlapped, *TransmitFileBuffers, uint32) error +pkg syscall (windows-amd64), func UTF16ToString([]uint16) string +pkg syscall (windows-amd64), func UnmapViewOfFile(uintptr) error +pkg syscall (windows-amd64), func VirtualLock(uintptr, uintptr) error +pkg syscall (windows-amd64), func VirtualUnlock(uintptr, uintptr) error +pkg syscall (windows-amd64), func WSACleanup() error +pkg syscall (windows-amd64), func WSAIoctl(Handle, uint32, *uint8, uint32, *uint8, uint32, *uint32, *Overlapped, uintptr) error +pkg syscall (windows-amd64), func WSARecv(Handle, *WSABuf, uint32, *uint32, *uint32, *Overlapped, *uint8) error +pkg syscall (windows-amd64), func WSARecvFrom(Handle, *WSABuf, uint32, *uint32, *uint32, *RawSockaddrAny, *int32, *Overlapped, *uint8) error +pkg syscall (windows-amd64), func WSASend(Handle, *WSABuf, uint32, *uint32, uint32, *Overlapped, *uint8) error +pkg syscall (windows-amd64), func WSASendTo(Handle, *WSABuf, uint32, *uint32, uint32, *RawSockaddrAny, int32, *Overlapped, *uint8) error +pkg syscall (windows-amd64), func WSASendto(Handle, *WSABuf, uint32, *uint32, uint32, Sockaddr, *Overlapped, *uint8) error +pkg syscall (windows-amd64), func WSAStartup(uint32, *WSAData) error +pkg syscall (windows-amd64), func WaitForSingleObject(Handle, uint32) (uint32, error) +pkg syscall (windows-amd64), func Write(Handle, []uint8) (int, error) +pkg syscall (windows-amd64), func WriteFile(Handle, []uint8, *uint32, *Overlapped) error +pkg syscall (windows-amd64), method (*DLL) FindProc(string) (*Proc, error) +pkg syscall (windows-amd64), method (*DLL) MustFindProc(string) *Proc +pkg syscall (windows-amd64), method (*DLL) Release() error +pkg syscall (windows-amd64), method (*DLLError) Error() string +pkg syscall (windows-amd64), method (*Filetime) Nanoseconds() int64 +pkg syscall (windows-amd64), method (*LazyDLL) Handle() uintptr +pkg syscall (windows-amd64), method (*LazyDLL) Load() error +pkg syscall (windows-amd64), method (*LazyDLL) NewProc(string) *LazyProc +pkg syscall (windows-amd64), method (*LazyProc) Addr() uintptr +pkg syscall (windows-amd64), method (*LazyProc) Call(...uintptr) (uintptr, uintptr, error) +pkg syscall (windows-amd64), method (*LazyProc) Find() error +pkg syscall (windows-amd64), method (*Proc) Addr() uintptr +pkg syscall (windows-amd64), method (*Proc) Call(...uintptr) (uintptr, uintptr, error) +pkg syscall (windows-amd64), method (*RawSockaddrAny) Sockaddr() (Sockaddr, error) +pkg syscall (windows-amd64), method (*SID) Copy() (*SID, error) +pkg syscall (windows-amd64), method (*SID) Len() int +pkg syscall (windows-amd64), method (*SID) LookupAccount(string) (string, string, uint32, error) +pkg syscall (windows-amd64), method (*SID) String() (string, error) +pkg syscall (windows-amd64), method (*Timeval) Nanoseconds() int64 +pkg syscall (windows-amd64), method (Token) Close() error +pkg syscall (windows-amd64), method (Token) GetTokenPrimaryGroup() (*Tokenprimarygroup, error) +pkg syscall (windows-amd64), method (Token) GetTokenUser() (*Tokenuser, error) +pkg syscall (windows-amd64), method (Token) GetUserProfileDirectory() (string, error) +pkg syscall (windows-amd64), type ByHandleFileInformation struct +pkg syscall (windows-amd64), type ByHandleFileInformation struct, CreationTime Filetime +pkg syscall (windows-amd64), type ByHandleFileInformation struct, FileAttributes uint32 +pkg syscall (windows-amd64), type ByHandleFileInformation struct, FileIndexHigh uint32 +pkg syscall (windows-amd64), type ByHandleFileInformation struct, FileIndexLow uint32 +pkg syscall (windows-amd64), type ByHandleFileInformation struct, FileSizeHigh uint32 +pkg syscall (windows-amd64), type ByHandleFileInformation struct, FileSizeLow uint32 +pkg syscall (windows-amd64), type ByHandleFileInformation struct, LastAccessTime Filetime +pkg syscall (windows-amd64), type ByHandleFileInformation struct, LastWriteTime Filetime +pkg syscall (windows-amd64), type ByHandleFileInformation struct, NumberOfLinks uint32 +pkg syscall (windows-amd64), type ByHandleFileInformation struct, VolumeSerialNumber uint32 +pkg syscall (windows-amd64), type CertChainContext struct +pkg syscall (windows-amd64), type CertChainContext struct, ChainCount uint32 +pkg syscall (windows-amd64), type CertChainContext struct, Chains **CertSimpleChain +pkg syscall (windows-amd64), type CertChainContext struct, HasRevocationFreshnessTime uint32 +pkg syscall (windows-amd64), type CertChainContext struct, LowerQualityChainCount uint32 +pkg syscall (windows-amd64), type CertChainContext struct, LowerQualityChains **CertChainContext +pkg syscall (windows-amd64), type CertChainContext struct, RevocationFreshnessTime uint32 +pkg syscall (windows-amd64), type CertChainContext struct, Size uint32 +pkg syscall (windows-amd64), type CertChainContext struct, TrustStatus CertTrustStatus +pkg syscall (windows-amd64), type CertChainElement struct +pkg syscall (windows-amd64), type CertChainElement struct, ApplicationUsage *CertEnhKeyUsage +pkg syscall (windows-amd64), type CertChainElement struct, CertContext *CertContext +pkg syscall (windows-amd64), type CertChainElement struct, ExtendedErrorInfo *uint16 +pkg syscall (windows-amd64), type CertChainElement struct, IssuanceUsage *CertEnhKeyUsage +pkg syscall (windows-amd64), type CertChainElement struct, RevocationInfo *CertRevocationInfo +pkg syscall (windows-amd64), type CertChainElement struct, Size uint32 +pkg syscall (windows-amd64), type CertChainElement struct, TrustStatus CertTrustStatus +pkg syscall (windows-amd64), type CertChainPara struct +pkg syscall (windows-amd64), type CertChainPara struct, CacheResync *Filetime +pkg syscall (windows-amd64), type CertChainPara struct, CheckRevocationFreshnessTime uint32 +pkg syscall (windows-amd64), type CertChainPara struct, RequestedUsage CertUsageMatch +pkg syscall (windows-amd64), type CertChainPara struct, RequstedIssuancePolicy CertUsageMatch +pkg syscall (windows-amd64), type CertChainPara struct, RevocationFreshnessTime uint32 +pkg syscall (windows-amd64), type CertChainPara struct, Size uint32 +pkg syscall (windows-amd64), type CertChainPara struct, URLRetrievalTimeout uint32 +pkg syscall (windows-amd64), type CertChainPolicyPara struct +pkg syscall (windows-amd64), type CertChainPolicyPara struct, ExtraPolicyPara uintptr +pkg syscall (windows-amd64), type CertChainPolicyPara struct, Flags uint32 +pkg syscall (windows-amd64), type CertChainPolicyPara struct, Size uint32 +pkg syscall (windows-amd64), type CertChainPolicyStatus struct +pkg syscall (windows-amd64), type CertChainPolicyStatus struct, ChainIndex uint32 +pkg syscall (windows-amd64), type CertChainPolicyStatus struct, ElementIndex uint32 +pkg syscall (windows-amd64), type CertChainPolicyStatus struct, Error uint32 +pkg syscall (windows-amd64), type CertChainPolicyStatus struct, ExtraPolicyStatus uintptr +pkg syscall (windows-amd64), type CertChainPolicyStatus struct, Size uint32 +pkg syscall (windows-amd64), type CertContext struct +pkg syscall (windows-amd64), type CertContext struct, CertInfo uintptr +pkg syscall (windows-amd64), type CertContext struct, EncodedCert *uint8 +pkg syscall (windows-amd64), type CertContext struct, EncodingType uint32 +pkg syscall (windows-amd64), type CertContext struct, Length uint32 +pkg syscall (windows-amd64), type CertContext struct, Store Handle +pkg syscall (windows-amd64), type CertEnhKeyUsage struct +pkg syscall (windows-amd64), type CertEnhKeyUsage struct, Length uint32 +pkg syscall (windows-amd64), type CertEnhKeyUsage struct, UsageIdentifiers **uint8 +pkg syscall (windows-amd64), type CertRevocationInfo struct +pkg syscall (windows-amd64), type CertRevocationInfo struct, CrlInfo uintptr +pkg syscall (windows-amd64), type CertRevocationInfo struct, FreshnessTime uint32 +pkg syscall (windows-amd64), type CertRevocationInfo struct, HasFreshnessTime uint32 +pkg syscall (windows-amd64), type CertRevocationInfo struct, OidSpecificInfo uintptr +pkg syscall (windows-amd64), type CertRevocationInfo struct, RevocationOid *uint8 +pkg syscall (windows-amd64), type CertRevocationInfo struct, RevocationResult uint32 +pkg syscall (windows-amd64), type CertRevocationInfo struct, Size uint32 +pkg syscall (windows-amd64), type CertSimpleChain struct +pkg syscall (windows-amd64), type CertSimpleChain struct, Elements **CertChainElement +pkg syscall (windows-amd64), type CertSimpleChain struct, HasRevocationFreshnessTime uint32 +pkg syscall (windows-amd64), type CertSimpleChain struct, NumElements uint32 +pkg syscall (windows-amd64), type CertSimpleChain struct, RevocationFreshnessTime uint32 +pkg syscall (windows-amd64), type CertSimpleChain struct, Size uint32 +pkg syscall (windows-amd64), type CertSimpleChain struct, TrustListInfo uintptr +pkg syscall (windows-amd64), type CertSimpleChain struct, TrustStatus CertTrustStatus +pkg syscall (windows-amd64), type CertTrustStatus struct +pkg syscall (windows-amd64), type CertTrustStatus struct, ErrorStatus uint32 +pkg syscall (windows-amd64), type CertTrustStatus struct, InfoStatus uint32 +pkg syscall (windows-amd64), type CertUsageMatch struct +pkg syscall (windows-amd64), type CertUsageMatch struct, Type uint32 +pkg syscall (windows-amd64), type CertUsageMatch struct, Usage CertEnhKeyUsage +pkg syscall (windows-amd64), type DLL struct +pkg syscall (windows-amd64), type DLL struct, Handle Handle +pkg syscall (windows-amd64), type DLL struct, Name string +pkg syscall (windows-amd64), type DLLError struct +pkg syscall (windows-amd64), type DLLError struct, Err error +pkg syscall (windows-amd64), type DLLError struct, Msg string +pkg syscall (windows-amd64), type DLLError struct, ObjName string +pkg syscall (windows-amd64), type DNSMXData struct +pkg syscall (windows-amd64), type DNSMXData struct, NameExchange *uint16 +pkg syscall (windows-amd64), type DNSMXData struct, Pad uint16 +pkg syscall (windows-amd64), type DNSMXData struct, Preference uint16 +pkg syscall (windows-amd64), type DNSPTRData struct +pkg syscall (windows-amd64), type DNSPTRData struct, Host *uint16 +pkg syscall (windows-amd64), type DNSRecord struct +pkg syscall (windows-amd64), type DNSRecord struct, Data [40]uint8 +pkg syscall (windows-amd64), type DNSRecord struct, Dw uint32 +pkg syscall (windows-amd64), type DNSRecord struct, Length uint16 +pkg syscall (windows-amd64), type DNSRecord struct, Name *uint16 +pkg syscall (windows-amd64), type DNSRecord struct, Next *DNSRecord +pkg syscall (windows-amd64), type DNSRecord struct, Reserved uint32 +pkg syscall (windows-amd64), type DNSRecord struct, Ttl uint32 +pkg syscall (windows-amd64), type DNSRecord struct, Type uint16 +pkg syscall (windows-amd64), type DNSSRVData struct +pkg syscall (windows-amd64), type DNSSRVData struct, Pad uint16 +pkg syscall (windows-amd64), type DNSSRVData struct, Port uint16 +pkg syscall (windows-amd64), type DNSSRVData struct, Priority uint16 +pkg syscall (windows-amd64), type DNSSRVData struct, Target *uint16 +pkg syscall (windows-amd64), type DNSSRVData struct, Weight uint16 +pkg syscall (windows-amd64), type DNSTXTData struct +pkg syscall (windows-amd64), type DNSTXTData struct, StringArray [1]*uint16 +pkg syscall (windows-amd64), type DNSTXTData struct, StringCount uint16 +pkg syscall (windows-amd64), type FileNotifyInformation struct +pkg syscall (windows-amd64), type FileNotifyInformation struct, Action uint32 +pkg syscall (windows-amd64), type FileNotifyInformation struct, FileName uint16 +pkg syscall (windows-amd64), type FileNotifyInformation struct, FileNameLength uint32 +pkg syscall (windows-amd64), type FileNotifyInformation struct, NextEntryOffset uint32 +pkg syscall (windows-amd64), type Filetime struct +pkg syscall (windows-amd64), type Filetime struct, HighDateTime uint32 +pkg syscall (windows-amd64), type Filetime struct, LowDateTime uint32 +pkg syscall (windows-amd64), type Handle uintptr +pkg syscall (windows-amd64), type Hostent struct +pkg syscall (windows-amd64), type Hostent struct, AddrList **uint8 +pkg syscall (windows-amd64), type Hostent struct, AddrType uint16 +pkg syscall (windows-amd64), type Hostent struct, Aliases **uint8 +pkg syscall (windows-amd64), type Hostent struct, Length uint16 +pkg syscall (windows-amd64), type Hostent struct, Name *uint8 +pkg syscall (windows-amd64), type InterfaceInfo struct +pkg syscall (windows-amd64), type InterfaceInfo struct, Address SockaddrGen +pkg syscall (windows-amd64), type InterfaceInfo struct, BroadcastAddress SockaddrGen +pkg syscall (windows-amd64), type InterfaceInfo struct, Flags uint32 +pkg syscall (windows-amd64), type InterfaceInfo struct, Netmask SockaddrGen +pkg syscall (windows-amd64), type IpAdapterInfo struct +pkg syscall (windows-amd64), type IpAdapterInfo struct, AdapterName [260]uint8 +pkg syscall (windows-amd64), type IpAdapterInfo struct, Address [8]uint8 +pkg syscall (windows-amd64), type IpAdapterInfo struct, AddressLength uint32 +pkg syscall (windows-amd64), type IpAdapterInfo struct, ComboIndex uint32 +pkg syscall (windows-amd64), type IpAdapterInfo struct, CurrentIpAddress *IpAddrString +pkg syscall (windows-amd64), type IpAdapterInfo struct, Description [132]uint8 +pkg syscall (windows-amd64), type IpAdapterInfo struct, DhcpEnabled uint32 +pkg syscall (windows-amd64), type IpAdapterInfo struct, DhcpServer IpAddrString +pkg syscall (windows-amd64), type IpAdapterInfo struct, GatewayList IpAddrString +pkg syscall (windows-amd64), type IpAdapterInfo struct, HaveWins bool +pkg syscall (windows-amd64), type IpAdapterInfo struct, Index uint32 +pkg syscall (windows-amd64), type IpAdapterInfo struct, IpAddressList IpAddrString +pkg syscall (windows-amd64), type IpAdapterInfo struct, LeaseExpires int64 +pkg syscall (windows-amd64), type IpAdapterInfo struct, LeaseObtained int64 +pkg syscall (windows-amd64), type IpAdapterInfo struct, Next *IpAdapterInfo +pkg syscall (windows-amd64), type IpAdapterInfo struct, PrimaryWinsServer IpAddrString +pkg syscall (windows-amd64), type IpAdapterInfo struct, SecondaryWinsServer IpAddrString +pkg syscall (windows-amd64), type IpAdapterInfo struct, Type uint32 +pkg syscall (windows-amd64), type IpAddrString struct +pkg syscall (windows-amd64), type IpAddrString struct, Context uint32 +pkg syscall (windows-amd64), type IpAddrString struct, IpAddress IpAddressString +pkg syscall (windows-amd64), type IpAddrString struct, IpMask IpMaskString +pkg syscall (windows-amd64), type IpAddrString struct, Next *IpAddrString +pkg syscall (windows-amd64), type IpAddressString struct +pkg syscall (windows-amd64), type IpAddressString struct, String [16]uint8 +pkg syscall (windows-amd64), type IpMaskString struct +pkg syscall (windows-amd64), type LazyDLL struct +pkg syscall (windows-amd64), type LazyDLL struct, Name string +pkg syscall (windows-amd64), type LazyProc struct +pkg syscall (windows-amd64), type LazyProc struct, Name string +pkg syscall (windows-amd64), type MibIfRow struct +pkg syscall (windows-amd64), type MibIfRow struct, AdminStatus uint32 +pkg syscall (windows-amd64), type MibIfRow struct, Descr [256]uint8 +pkg syscall (windows-amd64), type MibIfRow struct, DescrLen uint32 +pkg syscall (windows-amd64), type MibIfRow struct, InDiscards uint32 +pkg syscall (windows-amd64), type MibIfRow struct, InErrors uint32 +pkg syscall (windows-amd64), type MibIfRow struct, InNUcastPkts uint32 +pkg syscall (windows-amd64), type MibIfRow struct, InOctets uint32 +pkg syscall (windows-amd64), type MibIfRow struct, InUcastPkts uint32 +pkg syscall (windows-amd64), type MibIfRow struct, InUnknownProtos uint32 +pkg syscall (windows-amd64), type MibIfRow struct, Index uint32 +pkg syscall (windows-amd64), type MibIfRow struct, LastChange uint32 +pkg syscall (windows-amd64), type MibIfRow struct, Mtu uint32 +pkg syscall (windows-amd64), type MibIfRow struct, Name [256]uint16 +pkg syscall (windows-amd64), type MibIfRow struct, OperStatus uint32 +pkg syscall (windows-amd64), type MibIfRow struct, OutDiscards uint32 +pkg syscall (windows-amd64), type MibIfRow struct, OutErrors uint32 +pkg syscall (windows-amd64), type MibIfRow struct, OutNUcastPkts uint32 +pkg syscall (windows-amd64), type MibIfRow struct, OutOctets uint32 +pkg syscall (windows-amd64), type MibIfRow struct, OutQLen uint32 +pkg syscall (windows-amd64), type MibIfRow struct, OutUcastPkts uint32 +pkg syscall (windows-amd64), type MibIfRow struct, PhysAddr [8]uint8 +pkg syscall (windows-amd64), type MibIfRow struct, PhysAddrLen uint32 +pkg syscall (windows-amd64), type MibIfRow struct, Speed uint32 +pkg syscall (windows-amd64), type MibIfRow struct, Type uint32 +pkg syscall (windows-amd64), type Overlapped struct +pkg syscall (windows-amd64), type Overlapped struct, HEvent Handle +pkg syscall (windows-amd64), type Overlapped struct, Internal uintptr +pkg syscall (windows-amd64), type Overlapped struct, InternalHigh uintptr +pkg syscall (windows-amd64), type Overlapped struct, Offset uint32 +pkg syscall (windows-amd64), type Overlapped struct, OffsetHigh uint32 +pkg syscall (windows-amd64), type Proc struct +pkg syscall (windows-amd64), type Proc struct, Dll *DLL +pkg syscall (windows-amd64), type Proc struct, Name string +pkg syscall (windows-amd64), type ProcessInformation struct +pkg syscall (windows-amd64), type ProcessInformation struct, Process Handle +pkg syscall (windows-amd64), type ProcessInformation struct, ProcessId uint32 +pkg syscall (windows-amd64), type ProcessInformation struct, Thread Handle +pkg syscall (windows-amd64), type ProcessInformation struct, ThreadId uint32 +pkg syscall (windows-amd64), type Protoent struct +pkg syscall (windows-amd64), type Protoent struct, Aliases **uint8 +pkg syscall (windows-amd64), type Protoent struct, Name *uint8 +pkg syscall (windows-amd64), type Protoent struct, Proto uint16 +pkg syscall (windows-amd64), type RawSockaddr struct, Data [14]int8 +pkg syscall (windows-amd64), type RawSockaddr struct, Family uint16 +pkg syscall (windows-amd64), type RawSockaddrAny struct, Pad [96]int8 +pkg syscall (windows-amd64), type RawSockaddrInet4 struct, Family uint16 +pkg syscall (windows-amd64), type RawSockaddrInet4 struct, Zero [8]uint8 +pkg syscall (windows-amd64), type Rusage struct, CreationTime Filetime +pkg syscall (windows-amd64), type Rusage struct, ExitTime Filetime +pkg syscall (windows-amd64), type Rusage struct, KernelTime Filetime +pkg syscall (windows-amd64), type Rusage struct, UserTime Filetime +pkg syscall (windows-amd64), type SID struct +pkg syscall (windows-amd64), type SIDAndAttributes struct +pkg syscall (windows-amd64), type SIDAndAttributes struct, Attributes uint32 +pkg syscall (windows-amd64), type SIDAndAttributes struct, Sid *SID +pkg syscall (windows-amd64), type SSLExtraCertChainPolicyPara struct +pkg syscall (windows-amd64), type SSLExtraCertChainPolicyPara struct, AuthType uint32 +pkg syscall (windows-amd64), type SSLExtraCertChainPolicyPara struct, Checks uint32 +pkg syscall (windows-amd64), type SSLExtraCertChainPolicyPara struct, ServerName *uint16 +pkg syscall (windows-amd64), type SSLExtraCertChainPolicyPara struct, Size uint32 +pkg syscall (windows-amd64), type SecurityAttributes struct +pkg syscall (windows-amd64), type SecurityAttributes struct, InheritHandle uint32 +pkg syscall (windows-amd64), type SecurityAttributes struct, Length uint32 +pkg syscall (windows-amd64), type SecurityAttributes struct, SecurityDescriptor uintptr +pkg syscall (windows-amd64), type Servent struct +pkg syscall (windows-amd64), type Servent struct, Aliases **uint8 +pkg syscall (windows-amd64), type Servent struct, Name *uint8 +pkg syscall (windows-amd64), type Servent struct, Port uint16 +pkg syscall (windows-amd64), type Servent struct, Proto *uint8 +pkg syscall (windows-amd64), type SockaddrGen [24]uint8 +pkg syscall (windows-amd64), type StartupInfo struct +pkg syscall (windows-amd64), type StartupInfo struct, Cb uint32 +pkg syscall (windows-amd64), type StartupInfo struct, Desktop *uint16 +pkg syscall (windows-amd64), type StartupInfo struct, FillAttribute uint32 +pkg syscall (windows-amd64), type StartupInfo struct, Flags uint32 +pkg syscall (windows-amd64), type StartupInfo struct, ShowWindow uint16 +pkg syscall (windows-amd64), type StartupInfo struct, StdErr Handle +pkg syscall (windows-amd64), type StartupInfo struct, StdInput Handle +pkg syscall (windows-amd64), type StartupInfo struct, StdOutput Handle +pkg syscall (windows-amd64), type StartupInfo struct, Title *uint16 +pkg syscall (windows-amd64), type StartupInfo struct, X uint32 +pkg syscall (windows-amd64), type StartupInfo struct, XCountChars uint32 +pkg syscall (windows-amd64), type StartupInfo struct, XSize uint32 +pkg syscall (windows-amd64), type StartupInfo struct, Y uint32 +pkg syscall (windows-amd64), type StartupInfo struct, YCountChars uint32 +pkg syscall (windows-amd64), type StartupInfo struct, YSize uint32 +pkg syscall (windows-amd64), type SysProcAttr struct, CmdLine string +pkg syscall (windows-amd64), type SysProcAttr struct, HideWindow bool +pkg syscall (windows-amd64), type Systemtime struct +pkg syscall (windows-amd64), type Systemtime struct, Day uint16 +pkg syscall (windows-amd64), type Systemtime struct, DayOfWeek uint16 +pkg syscall (windows-amd64), type Systemtime struct, Hour uint16 +pkg syscall (windows-amd64), type Systemtime struct, Milliseconds uint16 +pkg syscall (windows-amd64), type Systemtime struct, Minute uint16 +pkg syscall (windows-amd64), type Systemtime struct, Month uint16 +pkg syscall (windows-amd64), type Systemtime struct, Second uint16 +pkg syscall (windows-amd64), type Systemtime struct, Year uint16 +pkg syscall (windows-amd64), type Timespec struct, Nsec int64 +pkg syscall (windows-amd64), type Timespec struct, Sec int64 +pkg syscall (windows-amd64), type Timeval struct, Sec int32 +pkg syscall (windows-amd64), type Timeval struct, Usec int32 +pkg syscall (windows-amd64), type Timezoneinformation struct +pkg syscall (windows-amd64), type Timezoneinformation struct, Bias int32 +pkg syscall (windows-amd64), type Timezoneinformation struct, DaylightBias int32 +pkg syscall (windows-amd64), type Timezoneinformation struct, DaylightDate Systemtime +pkg syscall (windows-amd64), type Timezoneinformation struct, DaylightName [32]uint16 +pkg syscall (windows-amd64), type Timezoneinformation struct, StandardBias int32 +pkg syscall (windows-amd64), type Timezoneinformation struct, StandardDate Systemtime +pkg syscall (windows-amd64), type Timezoneinformation struct, StandardName [32]uint16 +pkg syscall (windows-amd64), type Token uintptr +pkg syscall (windows-amd64), type Tokenprimarygroup struct +pkg syscall (windows-amd64), type Tokenprimarygroup struct, PrimaryGroup *SID +pkg syscall (windows-amd64), type Tokenuser struct +pkg syscall (windows-amd64), type Tokenuser struct, User SIDAndAttributes +pkg syscall (windows-amd64), type TransmitFileBuffers struct +pkg syscall (windows-amd64), type TransmitFileBuffers struct, Head uintptr +pkg syscall (windows-amd64), type TransmitFileBuffers struct, HeadLength uint32 +pkg syscall (windows-amd64), type TransmitFileBuffers struct, Tail uintptr +pkg syscall (windows-amd64), type TransmitFileBuffers struct, TailLength uint32 +pkg syscall (windows-amd64), type UserInfo10 struct +pkg syscall (windows-amd64), type UserInfo10 struct, Comment *uint16 +pkg syscall (windows-amd64), type UserInfo10 struct, FullName *uint16 +pkg syscall (windows-amd64), type UserInfo10 struct, Name *uint16 +pkg syscall (windows-amd64), type UserInfo10 struct, UsrComment *uint16 +pkg syscall (windows-amd64), type WSABuf struct +pkg syscall (windows-amd64), type WSABuf struct, Buf *uint8 +pkg syscall (windows-amd64), type WSABuf struct, Len uint32 +pkg syscall (windows-amd64), type WSAData struct +pkg syscall (windows-amd64), type WSAData struct, Description [257]uint8 +pkg syscall (windows-amd64), type WSAData struct, HighVersion uint16 +pkg syscall (windows-amd64), type WSAData struct, MaxSockets uint16 +pkg syscall (windows-amd64), type WSAData struct, MaxUdpDg uint16 +pkg syscall (windows-amd64), type WSAData struct, SystemStatus [129]uint8 +pkg syscall (windows-amd64), type WSAData struct, VendorInfo *uint8 +pkg syscall (windows-amd64), type WSAData struct, Version uint16 +pkg syscall (windows-amd64), type WaitStatus struct +pkg syscall (windows-amd64), type WaitStatus struct, ExitCode uint32 +pkg syscall (windows-amd64), type Win32FileAttributeData struct +pkg syscall (windows-amd64), type Win32FileAttributeData struct, CreationTime Filetime +pkg syscall (windows-amd64), type Win32FileAttributeData struct, FileAttributes uint32 +pkg syscall (windows-amd64), type Win32FileAttributeData struct, FileSizeHigh uint32 +pkg syscall (windows-amd64), type Win32FileAttributeData struct, FileSizeLow uint32 +pkg syscall (windows-amd64), type Win32FileAttributeData struct, LastAccessTime Filetime +pkg syscall (windows-amd64), type Win32FileAttributeData struct, LastWriteTime Filetime +pkg syscall (windows-amd64), type Win32finddata struct +pkg syscall (windows-amd64), type Win32finddata struct, AlternateFileName [13]uint16 +pkg syscall (windows-amd64), type Win32finddata struct, CreationTime Filetime +pkg syscall (windows-amd64), type Win32finddata struct, FileAttributes uint32 +pkg syscall (windows-amd64), type Win32finddata struct, FileName [259]uint16 +pkg syscall (windows-amd64), type Win32finddata struct, FileSizeHigh uint32 +pkg syscall (windows-amd64), type Win32finddata struct, FileSizeLow uint32 +pkg syscall (windows-amd64), type Win32finddata struct, LastAccessTime Filetime +pkg syscall (windows-amd64), type Win32finddata struct, LastWriteTime Filetime +pkg syscall (windows-amd64), type Win32finddata struct, Reserved0 uint32 +pkg syscall (windows-amd64), type Win32finddata struct, Reserved1 uint32 +pkg syscall (windows-amd64), var OID_PKIX_KP_SERVER_AUTH []uint8 +pkg syscall (windows-amd64), var OID_SERVER_GATED_CRYPTO []uint8 +pkg syscall (windows-amd64), var OID_SGC_NETSCAPE []uint8 +pkg syscall (windows-amd64), var Stderr Handle +pkg syscall (windows-amd64), var Stdin Handle +pkg syscall (windows-amd64), var Stdout Handle +pkg syscall, const AF_INET ideal-int +pkg syscall, const AF_INET6 ideal-int +pkg syscall, const AF_UNIX ideal-int +pkg syscall, const AF_UNSPEC ideal-int +pkg syscall, const E2BIG Errno +pkg syscall, const EACCES Errno +pkg syscall, const EADDRINUSE Errno +pkg syscall, const EADDRNOTAVAIL Errno +pkg syscall, const EAFNOSUPPORT Errno +pkg syscall, const EAGAIN Errno +pkg syscall, const EALREADY Errno +pkg syscall, const EBADF Errno +pkg syscall, const EBUSY Errno +pkg syscall, const ECANCELED Errno +pkg syscall, const ECHILD Errno +pkg syscall, const ECONNABORTED Errno +pkg syscall, const ECONNREFUSED Errno +pkg syscall, const ECONNRESET Errno +pkg syscall, const EDEADLK Errno +pkg syscall, const EDESTADDRREQ Errno +pkg syscall, const EDOM Errno +pkg syscall, const EDQUOT Errno +pkg syscall, const EEXIST Errno +pkg syscall, const EFAULT Errno +pkg syscall, const EFBIG Errno +pkg syscall, const EHOSTDOWN Errno +pkg syscall, const EHOSTUNREACH Errno +pkg syscall, const EIDRM Errno +pkg syscall, const EILSEQ Errno +pkg syscall, const EINPROGRESS Errno +pkg syscall, const EINTR Errno +pkg syscall, const EINVAL Errno +pkg syscall, const EIO Errno +pkg syscall, const EISCONN Errno +pkg syscall, const EISDIR Errno +pkg syscall, const ELOOP Errno +pkg syscall, const EMFILE Errno +pkg syscall, const EMLINK Errno +pkg syscall, const EMSGSIZE Errno +pkg syscall, const ENAMETOOLONG Errno +pkg syscall, const ENETDOWN Errno +pkg syscall, const ENETRESET Errno +pkg syscall, const ENETUNREACH Errno +pkg syscall, const ENFILE Errno +pkg syscall, const ENOBUFS Errno +pkg syscall, const ENODEV Errno +pkg syscall, const ENOENT Errno +pkg syscall, const ENOEXEC Errno +pkg syscall, const ENOLCK Errno +pkg syscall, const ENOMEM Errno +pkg syscall, const ENOMSG Errno +pkg syscall, const ENOPROTOOPT Errno +pkg syscall, const ENOSPC Errno +pkg syscall, const ENOSYS Errno +pkg syscall, const ENOTBLK Errno +pkg syscall, const ENOTCONN Errno +pkg syscall, const ENOTDIR Errno +pkg syscall, const ENOTEMPTY Errno +pkg syscall, const ENOTSOCK Errno +pkg syscall, const ENOTSUP Errno +pkg syscall, const ENOTTY Errno +pkg syscall, const ENXIO Errno +pkg syscall, const EOPNOTSUPP Errno +pkg syscall, const EOVERFLOW Errno +pkg syscall, const EPERM Errno +pkg syscall, const EPFNOSUPPORT Errno +pkg syscall, const EPIPE Errno +pkg syscall, const EPROTONOSUPPORT Errno +pkg syscall, const EPROTOTYPE Errno +pkg syscall, const ERANGE Errno +pkg syscall, const EREMOTE Errno +pkg syscall, const EROFS Errno +pkg syscall, const ESHUTDOWN Errno +pkg syscall, const ESOCKTNOSUPPORT Errno +pkg syscall, const ESPIPE Errno +pkg syscall, const ESRCH Errno +pkg syscall, const ESTALE Errno +pkg syscall, const ETIMEDOUT Errno +pkg syscall, const ETOOMANYREFS Errno +pkg syscall, const ETXTBSY Errno +pkg syscall, const EUSERS Errno +pkg syscall, const EWOULDBLOCK Errno +pkg syscall, const EXDEV Errno +pkg syscall, const IFF_BROADCAST ideal-int +pkg syscall, const IFF_LOOPBACK ideal-int +pkg syscall, const IFF_MULTICAST ideal-int +pkg syscall, const IFF_UP ideal-int +pkg syscall, const IPPROTO_IP ideal-int +pkg syscall, const IPPROTO_IPV6 ideal-int +pkg syscall, const IPPROTO_TCP ideal-int +pkg syscall, const IPPROTO_UDP ideal-int +pkg syscall, const IPV6_JOIN_GROUP ideal-int +pkg syscall, const IPV6_LEAVE_GROUP ideal-int +pkg syscall, const IPV6_MULTICAST_HOPS ideal-int +pkg syscall, const IPV6_MULTICAST_IF ideal-int +pkg syscall, const IPV6_MULTICAST_LOOP ideal-int +pkg syscall, const IPV6_UNICAST_HOPS ideal-int +pkg syscall, const IPV6_V6ONLY ideal-int +pkg syscall, const IP_ADD_MEMBERSHIP ideal-int +pkg syscall, const IP_DROP_MEMBERSHIP ideal-int +pkg syscall, const IP_MULTICAST_IF ideal-int +pkg syscall, const IP_MULTICAST_LOOP ideal-int +pkg syscall, const IP_MULTICAST_TTL ideal-int +pkg syscall, const IP_TOS ideal-int +pkg syscall, const IP_TTL ideal-int +pkg syscall, const ImplementsGetwd ideal-bool +pkg syscall, const O_APPEND ideal-int +pkg syscall, const O_ASYNC ideal-int +pkg syscall, const O_CLOEXEC ideal-int +pkg syscall, const O_CREAT ideal-int +pkg syscall, const O_EXCL ideal-int +pkg syscall, const O_NOCTTY ideal-int +pkg syscall, const O_NONBLOCK ideal-int +pkg syscall, const O_RDONLY ideal-int +pkg syscall, const O_RDWR ideal-int +pkg syscall, const O_SYNC ideal-int +pkg syscall, const O_TRUNC ideal-int +pkg syscall, const O_WRONLY ideal-int +pkg syscall, const SHUT_RD ideal-int +pkg syscall, const SHUT_RDWR ideal-int +pkg syscall, const SHUT_WR ideal-int +pkg syscall, const SIGABRT Signal +pkg syscall, const SIGALRM Signal +pkg syscall, const SIGBUS Signal +pkg syscall, const SIGFPE Signal +pkg syscall, const SIGHUP Signal +pkg syscall, const SIGILL Signal +pkg syscall, const SIGINT Signal +pkg syscall, const SIGKILL Signal +pkg syscall, const SIGPIPE Signal +pkg syscall, const SIGQUIT Signal +pkg syscall, const SIGSEGV Signal +pkg syscall, const SIGTERM Signal +pkg syscall, const SIGTRAP Signal +pkg syscall, const SOCK_DGRAM ideal-int +pkg syscall, const SOCK_RAW ideal-int +pkg syscall, const SOCK_SEQPACKET ideal-int +pkg syscall, const SOCK_STREAM ideal-int +pkg syscall, const SOL_SOCKET ideal-int +pkg syscall, const SOMAXCONN ideal-int +pkg syscall, const SO_BROADCAST ideal-int +pkg syscall, const SO_DONTROUTE ideal-int +pkg syscall, const SO_KEEPALIVE ideal-int +pkg syscall, const SO_LINGER ideal-int +pkg syscall, const SO_RCVBUF ideal-int +pkg syscall, const SO_REUSEADDR ideal-int +pkg syscall, const SO_SNDBUF ideal-int +pkg syscall, const S_IFBLK ideal-int +pkg syscall, const S_IFCHR ideal-int +pkg syscall, const S_IFDIR ideal-int +pkg syscall, const S_IFIFO ideal-int +pkg syscall, const S_IFLNK ideal-int +pkg syscall, const S_IFMT ideal-int +pkg syscall, const S_IFREG ideal-int +pkg syscall, const S_IFSOCK ideal-int +pkg syscall, const S_IRUSR ideal-int +pkg syscall, const S_ISGID ideal-int +pkg syscall, const S_ISUID ideal-int +pkg syscall, const S_ISVTX ideal-int +pkg syscall, const S_IWUSR ideal-int +pkg syscall, const S_IXUSR ideal-int +pkg syscall, const TCP_NODELAY ideal-int +pkg syscall, func Chdir(string) error +pkg syscall, func Chmod(string, uint32) error +pkg syscall, func Chown(string, int, int) error +pkg syscall, func Clearenv() +pkg syscall, func Environ() []string +pkg syscall, func Exec(string, []string, []string) error +pkg syscall, func Exit(int) +pkg syscall, func Getegid() int +pkg syscall, func Getenv(string) (string, bool) +pkg syscall, func Geteuid() int +pkg syscall, func Getgid() int +pkg syscall, func Getgroups() ([]int, error) +pkg syscall, func Getpagesize() int +pkg syscall, func Getpid() int +pkg syscall, func Getppid() int +pkg syscall, func Gettimeofday(*Timeval) error +pkg syscall, func Getuid() int +pkg syscall, func Getwd() (string, error) +pkg syscall, func Lchown(string, int, int) error +pkg syscall, func Link(string, string) error +pkg syscall, func Mkdir(string, uint32) error +pkg syscall, func NsecToTimeval(int64) Timeval +pkg syscall, func Readlink(string, []uint8) (int, error) +pkg syscall, func Rename(string, string) error +pkg syscall, func Rmdir(string) error +pkg syscall, func Setenv(string, string) error +pkg syscall, func StartProcess(string, []string, *ProcAttr) (int, uintptr, error) +pkg syscall, func StringBytePtr(string) *uint8 +pkg syscall, func StringByteSlice(string) []uint8 +pkg syscall, func Symlink(string, string) error +pkg syscall, func Unlink(string) error +pkg syscall, func Utimes(string, []Timeval) error +pkg syscall, method (*Timespec) Nano() int64 +pkg syscall, method (*Timespec) Unix() (int64, int64) +pkg syscall, method (*Timeval) Nano() int64 +pkg syscall, method (*Timeval) Unix() (int64, int64) +pkg syscall, method (Errno) Error() string +pkg syscall, method (Errno) Temporary() bool +pkg syscall, method (Errno) Timeout() bool +pkg syscall, method (Signal) Signal() +pkg syscall, method (Signal) String() string +pkg syscall, method (WaitStatus) Continued() bool +pkg syscall, method (WaitStatus) CoreDump() bool +pkg syscall, method (WaitStatus) ExitStatus() int +pkg syscall, method (WaitStatus) Exited() bool +pkg syscall, method (WaitStatus) Signal() Signal +pkg syscall, method (WaitStatus) Signaled() bool +pkg syscall, method (WaitStatus) StopSignal() Signal +pkg syscall, method (WaitStatus) Stopped() bool +pkg syscall, method (WaitStatus) TrapCause() int +pkg syscall, type Errno uintptr +pkg syscall, type IPMreq struct +pkg syscall, type IPMreq struct, Interface [4]uint8 +pkg syscall, type IPMreq struct, Multiaddr [4]uint8 +pkg syscall, type IPv6Mreq struct +pkg syscall, type IPv6Mreq struct, Interface uint32 +pkg syscall, type IPv6Mreq struct, Multiaddr [16]uint8 +pkg syscall, type Linger struct +pkg syscall, type Linger struct, Linger int32 +pkg syscall, type Linger struct, Onoff int32 +pkg syscall, type ProcAttr struct +pkg syscall, type ProcAttr struct, Dir string +pkg syscall, type ProcAttr struct, Env []string +pkg syscall, type ProcAttr struct, Files []uintptr +pkg syscall, type ProcAttr struct, Sys *SysProcAttr +pkg syscall, type RawSockaddr struct +pkg syscall, type RawSockaddrAny struct +pkg syscall, type RawSockaddrAny struct, Addr RawSockaddr +pkg syscall, type RawSockaddrInet4 struct +pkg syscall, type RawSockaddrInet4 struct, Addr [4]uint8 +pkg syscall, type RawSockaddrInet4 struct, Port uint16 +pkg syscall, type Rusage struct +pkg syscall, type Signal int +pkg syscall, type Sockaddr interface, unexported methods +pkg syscall, type SockaddrInet4 struct +pkg syscall, type SockaddrInet4 struct, Addr [4]uint8 +pkg syscall, type SockaddrInet4 struct, Port int +pkg syscall, type SockaddrInet6 struct +pkg syscall, type SockaddrInet6 struct, Addr [16]uint8 +pkg syscall, type SockaddrInet6 struct, Port int +pkg syscall, type SockaddrInet6 struct, ZoneId uint32 +pkg syscall, type SockaddrUnix struct +pkg syscall, type SockaddrUnix struct, Name string +pkg syscall, type SysProcAttr struct +pkg syscall, type Timespec struct +pkg syscall, type Timeval struct +pkg syscall, var ForkLock sync.RWMutex +pkg syscall, var SocketDisableIPv6 bool +pkg testing, func Benchmark(func(*B)) BenchmarkResult +pkg testing, func Main(func(string, string) (bool, error), []InternalTest, []InternalBenchmark, []InternalExample) +pkg testing, func RunBenchmarks(func(string, string) (bool, error), []InternalBenchmark) +pkg testing, func RunExamples(func(string, string) (bool, error), []InternalExample) bool +pkg testing, func RunTests(func(string, string) (bool, error), []InternalTest) bool +pkg testing, func Short() bool +pkg testing, method (*B) Error(...interface{}) +pkg testing, method (*B) Errorf(string, ...interface{}) +pkg testing, method (*B) Fail() +pkg testing, method (*B) FailNow() +pkg testing, method (*B) Failed() bool +pkg testing, method (*B) Fatal(...interface{}) +pkg testing, method (*B) Fatalf(string, ...interface{}) +pkg testing, method (*B) Log(...interface{}) +pkg testing, method (*B) Logf(string, ...interface{}) +pkg testing, method (*B) ResetTimer() +pkg testing, method (*B) SetBytes(int64) +pkg testing, method (*B) StartTimer() +pkg testing, method (*B) StopTimer() +pkg testing, method (*T) Error(...interface{}) +pkg testing, method (*T) Errorf(string, ...interface{}) +pkg testing, method (*T) Fail() +pkg testing, method (*T) FailNow() +pkg testing, method (*T) Failed() bool +pkg testing, method (*T) Fatal(...interface{}) +pkg testing, method (*T) Fatalf(string, ...interface{}) +pkg testing, method (*T) Log(...interface{}) +pkg testing, method (*T) Logf(string, ...interface{}) +pkg testing, method (*T) Parallel() +pkg testing, method (BenchmarkResult) NsPerOp() int64 +pkg testing, method (BenchmarkResult) String() string +pkg testing, type B struct +pkg testing, type B struct, N int +pkg testing, type BenchmarkResult struct +pkg testing, type BenchmarkResult struct, Bytes int64 +pkg testing, type BenchmarkResult struct, N int +pkg testing, type BenchmarkResult struct, T time.Duration +pkg testing, type InternalBenchmark struct +pkg testing, type InternalBenchmark struct, F func(*B) +pkg testing, type InternalBenchmark struct, Name string +pkg testing, type InternalExample struct +pkg testing, type InternalExample struct, F func() +pkg testing, type InternalExample struct, Name string +pkg testing, type InternalExample struct, Output string +pkg testing, type InternalTest struct +pkg testing, type InternalTest struct, F func(*T) +pkg testing, type InternalTest struct, Name string +pkg testing, type T struct +pkg testing/iotest, func DataErrReader(io.Reader) io.Reader +pkg testing/iotest, func HalfReader(io.Reader) io.Reader +pkg testing/iotest, func NewReadLogger(string, io.Reader) io.Reader +pkg testing/iotest, func NewWriteLogger(string, io.Writer) io.Writer +pkg testing/iotest, func OneByteReader(io.Reader) io.Reader +pkg testing/iotest, func TimeoutReader(io.Reader) io.Reader +pkg testing/iotest, func TruncateWriter(io.Writer, int64) io.Writer +pkg testing/iotest, var ErrTimeout error +pkg testing/quick, func Check(interface{}, *Config) error +pkg testing/quick, func CheckEqual(interface{}, interface{}, *Config) error +pkg testing/quick, func Value(reflect.Type, *rand.Rand) (reflect.Value, bool) +pkg testing/quick, method (*CheckEqualError) Error() string +pkg testing/quick, method (*CheckError) Error() string +pkg testing/quick, method (SetupError) Error() string +pkg testing/quick, type CheckEqualError struct +pkg testing/quick, type CheckEqualError struct, Out1 []interface{} +pkg testing/quick, type CheckEqualError struct, Out2 []interface{} +pkg testing/quick, type CheckEqualError struct, embedded CheckError +pkg testing/quick, type CheckError struct +pkg testing/quick, type CheckError struct, Count int +pkg testing/quick, type CheckError struct, In []interface{} +pkg testing/quick, type Config struct +pkg testing/quick, type Config struct, MaxCount int +pkg testing/quick, type Config struct, MaxCountScale float64 +pkg testing/quick, type Config struct, Rand *rand.Rand +pkg testing/quick, type Config struct, Values func([]reflect.Value, *rand.Rand) +pkg testing/quick, type Generator interface { Generate } +pkg testing/quick, type Generator interface, Generate(*rand.Rand, int) reflect.Value +pkg testing/quick, type SetupError string +pkg text/scanner, const Char ideal-int +pkg text/scanner, const Comment ideal-int +pkg text/scanner, const EOF ideal-int +pkg text/scanner, const Float ideal-int +pkg text/scanner, const GoTokens ideal-int +pkg text/scanner, const GoWhitespace ideal-int +pkg text/scanner, const Ident ideal-int +pkg text/scanner, const Int ideal-int +pkg text/scanner, const RawString ideal-int +pkg text/scanner, const ScanChars ideal-int +pkg text/scanner, const ScanComments ideal-int +pkg text/scanner, const ScanFloats ideal-int +pkg text/scanner, const ScanIdents ideal-int +pkg text/scanner, const ScanInts ideal-int +pkg text/scanner, const ScanRawStrings ideal-int +pkg text/scanner, const ScanStrings ideal-int +pkg text/scanner, const SkipComments ideal-int +pkg text/scanner, const String ideal-int +pkg text/scanner, func TokenString(int32) string +pkg text/scanner, method (*Position) IsValid() bool +pkg text/scanner, method (*Scanner) Init(io.Reader) *Scanner +pkg text/scanner, method (*Scanner) IsValid() bool +pkg text/scanner, method (*Scanner) Next() int32 +pkg text/scanner, method (*Scanner) Peek() int32 +pkg text/scanner, method (*Scanner) Pos() Position +pkg text/scanner, method (*Scanner) Scan() int32 +pkg text/scanner, method (*Scanner) TokenText() string +pkg text/scanner, method (Position) String() string +pkg text/scanner, method (Scanner) String() string +pkg text/scanner, type Position struct +pkg text/scanner, type Position struct, Column int +pkg text/scanner, type Position struct, Filename string +pkg text/scanner, type Position struct, Line int +pkg text/scanner, type Position struct, Offset int +pkg text/scanner, type Scanner struct +pkg text/scanner, type Scanner struct, Error func(*Scanner, string) +pkg text/scanner, type Scanner struct, ErrorCount int +pkg text/scanner, type Scanner struct, Mode uint +pkg text/scanner, type Scanner struct, Whitespace uint64 +pkg text/scanner, type Scanner struct, embedded Position +pkg text/tabwriter, const AlignRight uint +pkg text/tabwriter, const Debug uint +pkg text/tabwriter, const DiscardEmptyColumns uint +pkg text/tabwriter, const Escape ideal-char +pkg text/tabwriter, const FilterHTML uint +pkg text/tabwriter, const StripEscape uint +pkg text/tabwriter, const TabIndent uint +pkg text/tabwriter, func NewWriter(io.Writer, int, int, int, uint8, uint) *Writer +pkg text/tabwriter, method (*Writer) Flush() error +pkg text/tabwriter, method (*Writer) Init(io.Writer, int, int, int, uint8, uint) *Writer +pkg text/tabwriter, method (*Writer) Write([]uint8) (int, error) +pkg text/tabwriter, type Writer struct +pkg text/template, func HTMLEscape(io.Writer, []uint8) +pkg text/template, func HTMLEscapeString(string) string +pkg text/template, func HTMLEscaper(...interface{}) string +pkg text/template, func JSEscape(io.Writer, []uint8) +pkg text/template, func JSEscapeString(string) string +pkg text/template, func JSEscaper(...interface{}) string +pkg text/template, func Must(*Template, error) *Template +pkg text/template, func New(string) *Template +pkg text/template, func ParseFiles(...string) (*Template, error) +pkg text/template, func ParseGlob(string) (*Template, error) +pkg text/template, func URLQueryEscaper(...interface{}) string +pkg text/template, method (*Template) AddParseTree(string, *parse.Tree) (*Template, error) +pkg text/template, method (*Template) Clone() (*Template, error) +pkg text/template, method (*Template) Delims(string, string) *Template +pkg text/template, method (*Template) Execute(io.Writer, interface{}) error +pkg text/template, method (*Template) ExecuteTemplate(io.Writer, string, interface{}) error +pkg text/template, method (*Template) Funcs(FuncMap) *Template +pkg text/template, method (*Template) Lookup(string) *Template +pkg text/template, method (*Template) Name() string +pkg text/template, method (*Template) New(string) *Template +pkg text/template, method (*Template) Parse(string) (*Template, error) +pkg text/template, method (*Template) ParseFiles(...string) (*Template, error) +pkg text/template, method (*Template) ParseGlob(string) (*Template, error) +pkg text/template, method (*Template) Templates() []*Template +pkg text/template, type FuncMap map[string]interface{} +pkg text/template, type Template struct +pkg text/template, type Template struct, embedded *parse.Tree +pkg text/template/parse, const NodeAction NodeType +pkg text/template/parse, const NodeBool NodeType +pkg text/template/parse, const NodeCommand NodeType +pkg text/template/parse, const NodeDot NodeType +pkg text/template/parse, const NodeField NodeType +pkg text/template/parse, const NodeIdentifier NodeType +pkg text/template/parse, const NodeIf NodeType +pkg text/template/parse, const NodeList NodeType +pkg text/template/parse, const NodeNumber NodeType +pkg text/template/parse, const NodePipe NodeType +pkg text/template/parse, const NodeRange NodeType +pkg text/template/parse, const NodeString NodeType +pkg text/template/parse, const NodeTemplate NodeType +pkg text/template/parse, const NodeText NodeType +pkg text/template/parse, const NodeVariable NodeType +pkg text/template/parse, const NodeWith NodeType +pkg text/template/parse, func IsEmptyTree(Node) bool +pkg text/template/parse, func New(string, ...map[string]interface{}) *Tree +pkg text/template/parse, func NewIdentifier(string) *IdentifierNode +pkg text/template/parse, func Parse(string, string, string, string, ...map[string]interface{}) (map[string]*Tree, error) +pkg text/template/parse, method (*ActionNode) Copy() Node +pkg text/template/parse, method (*ActionNode) String() string +pkg text/template/parse, method (*BoolNode) Copy() Node +pkg text/template/parse, method (*BoolNode) String() string +pkg text/template/parse, method (*BranchNode) String() string +pkg text/template/parse, method (*CommandNode) Copy() Node +pkg text/template/parse, method (*CommandNode) String() string +pkg text/template/parse, method (*DotNode) Copy() Node +pkg text/template/parse, method (*DotNode) String() string +pkg text/template/parse, method (*DotNode) Type() NodeType +pkg text/template/parse, method (*FieldNode) Copy() Node +pkg text/template/parse, method (*FieldNode) String() string +pkg text/template/parse, method (*IdentifierNode) Copy() Node +pkg text/template/parse, method (*IdentifierNode) String() string +pkg text/template/parse, method (*IfNode) Copy() Node +pkg text/template/parse, method (*IfNode) String() string +pkg text/template/parse, method (*ListNode) Copy() Node +pkg text/template/parse, method (*ListNode) CopyList() *ListNode +pkg text/template/parse, method (*ListNode) String() string +pkg text/template/parse, method (*NumberNode) Copy() Node +pkg text/template/parse, method (*NumberNode) String() string +pkg text/template/parse, method (*PipeNode) Copy() Node +pkg text/template/parse, method (*PipeNode) CopyPipe() *PipeNode +pkg text/template/parse, method (*PipeNode) String() string +pkg text/template/parse, method (*RangeNode) Copy() Node +pkg text/template/parse, method (*RangeNode) String() string +pkg text/template/parse, method (*StringNode) Copy() Node +pkg text/template/parse, method (*StringNode) String() string +pkg text/template/parse, method (*TemplateNode) Copy() Node +pkg text/template/parse, method (*TemplateNode) String() string +pkg text/template/parse, method (*TextNode) Copy() Node +pkg text/template/parse, method (*TextNode) String() string +pkg text/template/parse, method (*Tree) Parse(string, string, string, map[string]*Tree, ...map[string]interface{}) (*Tree, error) +pkg text/template/parse, method (*VariableNode) Copy() Node +pkg text/template/parse, method (*VariableNode) String() string +pkg text/template/parse, method (*WithNode) Copy() Node +pkg text/template/parse, method (*WithNode) String() string +pkg text/template/parse, method (ActionNode) Type() NodeType +pkg text/template/parse, method (BoolNode) Type() NodeType +pkg text/template/parse, method (BranchNode) Type() NodeType +pkg text/template/parse, method (CommandNode) Type() NodeType +pkg text/template/parse, method (FieldNode) Type() NodeType +pkg text/template/parse, method (IdentifierNode) Type() NodeType +pkg text/template/parse, method (IfNode) Type() NodeType +pkg text/template/parse, method (ListNode) Type() NodeType +pkg text/template/parse, method (NodeType) Type() NodeType +pkg text/template/parse, method (NumberNode) Type() NodeType +pkg text/template/parse, method (PipeNode) Type() NodeType +pkg text/template/parse, method (RangeNode) Type() NodeType +pkg text/template/parse, method (StringNode) Type() NodeType +pkg text/template/parse, method (TemplateNode) Type() NodeType +pkg text/template/parse, method (TextNode) Type() NodeType +pkg text/template/parse, method (VariableNode) Type() NodeType +pkg text/template/parse, method (WithNode) Type() NodeType +pkg text/template/parse, type ActionNode struct +pkg text/template/parse, type ActionNode struct, Line int +pkg text/template/parse, type ActionNode struct, Pipe *PipeNode +pkg text/template/parse, type ActionNode struct, embedded NodeType +pkg text/template/parse, type BoolNode struct +pkg text/template/parse, type BoolNode struct, True bool +pkg text/template/parse, type BoolNode struct, embedded NodeType +pkg text/template/parse, type BranchNode struct +pkg text/template/parse, type BranchNode struct, ElseList *ListNode +pkg text/template/parse, type BranchNode struct, Line int +pkg text/template/parse, type BranchNode struct, List *ListNode +pkg text/template/parse, type BranchNode struct, Pipe *PipeNode +pkg text/template/parse, type BranchNode struct, embedded NodeType +pkg text/template/parse, type CommandNode struct +pkg text/template/parse, type CommandNode struct, Args []Node +pkg text/template/parse, type CommandNode struct, embedded NodeType +pkg text/template/parse, type DotNode bool +pkg text/template/parse, type FieldNode struct +pkg text/template/parse, type FieldNode struct, Ident []string +pkg text/template/parse, type FieldNode struct, embedded NodeType +pkg text/template/parse, type IdentifierNode struct +pkg text/template/parse, type IdentifierNode struct, Ident string +pkg text/template/parse, type IdentifierNode struct, embedded NodeType +pkg text/template/parse, type IfNode struct +pkg text/template/parse, type IfNode struct, embedded BranchNode +pkg text/template/parse, type ListNode struct +pkg text/template/parse, type ListNode struct, Nodes []Node +pkg text/template/parse, type ListNode struct, embedded NodeType +pkg text/template/parse, type Node interface { Copy, String, Type } +pkg text/template/parse, type Node interface, Copy() Node +pkg text/template/parse, type Node interface, String() string +pkg text/template/parse, type Node interface, Type() NodeType +pkg text/template/parse, type NodeType int +pkg text/template/parse, type NumberNode struct +pkg text/template/parse, type NumberNode struct, Complex128 complex128 +pkg text/template/parse, type NumberNode struct, Float64 float64 +pkg text/template/parse, type NumberNode struct, Int64 int64 +pkg text/template/parse, type NumberNode struct, IsComplex bool +pkg text/template/parse, type NumberNode struct, IsFloat bool +pkg text/template/parse, type NumberNode struct, IsInt bool +pkg text/template/parse, type NumberNode struct, IsUint bool +pkg text/template/parse, type NumberNode struct, Text string +pkg text/template/parse, type NumberNode struct, Uint64 uint64 +pkg text/template/parse, type NumberNode struct, embedded NodeType +pkg text/template/parse, type PipeNode struct +pkg text/template/parse, type PipeNode struct, Cmds []*CommandNode +pkg text/template/parse, type PipeNode struct, Decl []*VariableNode +pkg text/template/parse, type PipeNode struct, Line int +pkg text/template/parse, type PipeNode struct, embedded NodeType +pkg text/template/parse, type RangeNode struct +pkg text/template/parse, type RangeNode struct, embedded BranchNode +pkg text/template/parse, type StringNode struct +pkg text/template/parse, type StringNode struct, Quoted string +pkg text/template/parse, type StringNode struct, Text string +pkg text/template/parse, type StringNode struct, embedded NodeType +pkg text/template/parse, type TemplateNode struct +pkg text/template/parse, type TemplateNode struct, Line int +pkg text/template/parse, type TemplateNode struct, Name string +pkg text/template/parse, type TemplateNode struct, Pipe *PipeNode +pkg text/template/parse, type TemplateNode struct, embedded NodeType +pkg text/template/parse, type TextNode struct +pkg text/template/parse, type TextNode struct, Text []uint8 +pkg text/template/parse, type TextNode struct, embedded NodeType +pkg text/template/parse, type Tree struct +pkg text/template/parse, type Tree struct, Name string +pkg text/template/parse, type Tree struct, Root *ListNode +pkg text/template/parse, type VariableNode struct +pkg text/template/parse, type VariableNode struct, Ident []string +pkg text/template/parse, type VariableNode struct, embedded NodeType +pkg text/template/parse, type WithNode struct +pkg text/template/parse, type WithNode struct, embedded BranchNode +pkg time, const ANSIC ideal-string +pkg time, const April Month +pkg time, const August Month +pkg time, const December Month +pkg time, const February Month +pkg time, const Friday Weekday +pkg time, const Hour Duration +pkg time, const January Month +pkg time, const July Month +pkg time, const June Month +pkg time, const Kitchen ideal-string +pkg time, const March Month +pkg time, const May Month +pkg time, const Microsecond Duration +pkg time, const Millisecond Duration +pkg time, const Minute Duration +pkg time, const Monday Weekday +pkg time, const Nanosecond Duration +pkg time, const November Month +pkg time, const October Month +pkg time, const RFC1123 ideal-string +pkg time, const RFC1123Z ideal-string +pkg time, const RFC3339 ideal-string +pkg time, const RFC3339Nano ideal-string +pkg time, const RFC822 ideal-string +pkg time, const RFC822Z ideal-string +pkg time, const RFC850 ideal-string +pkg time, const RubyDate ideal-string +pkg time, const Saturday Weekday +pkg time, const Second Duration +pkg time, const September Month +pkg time, const Stamp ideal-string +pkg time, const StampMicro ideal-string +pkg time, const StampMilli ideal-string +pkg time, const StampNano ideal-string +pkg time, const Sunday Weekday +pkg time, const Thursday Weekday +pkg time, const Tuesday Weekday +pkg time, const UnixDate ideal-string +pkg time, const Wednesday Weekday +pkg time, func After(Duration) <-chan Time +pkg time, func AfterFunc(Duration, func()) *Timer +pkg time, func Date(int, Month, int, int, int, int, int, *Location) Time +pkg time, func FixedZone(string, int) *Location +pkg time, func LoadLocation(string) (*Location, error) +pkg time, func NewTicker(Duration) *Ticker +pkg time, func NewTimer(Duration) *Timer +pkg time, func Now() Time +pkg time, func Parse(string, string) (Time, error) +pkg time, func ParseDuration(string) (Duration, error) +pkg time, func Since(Time) Duration +pkg time, func Sleep(Duration) +pkg time, func Tick(Duration) <-chan Time +pkg time, func Unix(int64, int64) Time +pkg time, method (*Location) String() string +pkg time, method (*ParseError) Error() string +pkg time, method (*Ticker) Stop() +pkg time, method (*Time) GobDecode([]uint8) error +pkg time, method (*Time) UnmarshalJSON([]uint8) error +pkg time, method (*Timer) Stop() bool +pkg time, method (Duration) Hours() float64 +pkg time, method (Duration) Minutes() float64 +pkg time, method (Duration) Nanoseconds() int64 +pkg time, method (Duration) Seconds() float64 +pkg time, method (Duration) String() string +pkg time, method (Month) String() string +pkg time, method (Time) Add(Duration) Time +pkg time, method (Time) AddDate(int, int, int) Time +pkg time, method (Time) After(Time) bool +pkg time, method (Time) Before(Time) bool +pkg time, method (Time) Clock() (int, int, int) +pkg time, method (Time) Date() (int, Month, int) +pkg time, method (Time) Day() int +pkg time, method (Time) Equal(Time) bool +pkg time, method (Time) Format(string) string +pkg time, method (Time) GobEncode() ([]uint8, error) +pkg time, method (Time) Hour() int +pkg time, method (Time) ISOWeek() (int, int) +pkg time, method (Time) In(*Location) Time +pkg time, method (Time) IsZero() bool +pkg time, method (Time) Local() Time +pkg time, method (Time) Location() *Location +pkg time, method (Time) MarshalJSON() ([]uint8, error) +pkg time, method (Time) Minute() int +pkg time, method (Time) Month() Month +pkg time, method (Time) Nanosecond() int +pkg time, method (Time) Second() int +pkg time, method (Time) String() string +pkg time, method (Time) Sub(Time) Duration +pkg time, method (Time) UTC() Time +pkg time, method (Time) Unix() int64 +pkg time, method (Time) UnixNano() int64 +pkg time, method (Time) Weekday() Weekday +pkg time, method (Time) Year() int +pkg time, method (Time) Zone() (string, int) +pkg time, method (Weekday) String() string +pkg time, type Duration int64 +pkg time, type Location struct +pkg time, type Month int +pkg time, type ParseError struct +pkg time, type ParseError struct, Layout string +pkg time, type ParseError struct, LayoutElem string +pkg time, type ParseError struct, Message string +pkg time, type ParseError struct, Value string +pkg time, type ParseError struct, ValueElem string +pkg time, type Ticker struct +pkg time, type Ticker struct, C <-chan Time +pkg time, type Time struct +pkg time, type Timer struct +pkg time, type Timer struct, C <-chan Time +pkg time, type Weekday int +pkg time, var Local *Location +pkg time, var UTC *Location +pkg unicode, const LowerCase ideal-int +pkg unicode, const MaxASCII ideal-char +pkg unicode, const MaxCase ideal-int +pkg unicode, const MaxLatin1 ideal-char +pkg unicode, const MaxRune ideal-char +pkg unicode, const ReplacementChar ideal-char +pkg unicode, const TitleCase ideal-int +pkg unicode, const UpperCase ideal-int +pkg unicode, const UpperLower ideal-char +pkg unicode, const Version ideal-string +pkg unicode, func Is(*RangeTable, int32) bool +pkg unicode, func IsControl(int32) bool +pkg unicode, func IsDigit(int32) bool +pkg unicode, func IsGraphic(int32) bool +pkg unicode, func IsLetter(int32) bool +pkg unicode, func IsLower(int32) bool +pkg unicode, func IsMark(int32) bool +pkg unicode, func IsNumber(int32) bool +pkg unicode, func IsOneOf([]*RangeTable, int32) bool +pkg unicode, func IsPrint(int32) bool +pkg unicode, func IsPunct(int32) bool +pkg unicode, func IsSpace(int32) bool +pkg unicode, func IsSymbol(int32) bool +pkg unicode, func IsTitle(int32) bool +pkg unicode, func IsUpper(int32) bool +pkg unicode, func SimpleFold(int32) int32 +pkg unicode, func To(int, int32) int32 +pkg unicode, func ToLower(int32) int32 +pkg unicode, func ToTitle(int32) int32 +pkg unicode, func ToUpper(int32) int32 +pkg unicode, method (SpecialCase) ToLower(int32) int32 +pkg unicode, method (SpecialCase) ToTitle(int32) int32 +pkg unicode, method (SpecialCase) ToUpper(int32) int32 +pkg unicode, type CaseRange struct +pkg unicode, type CaseRange struct, Delta d +pkg unicode, type CaseRange struct, Hi uint32 +pkg unicode, type CaseRange struct, Lo uint32 +pkg unicode, type Range16 struct +pkg unicode, type Range16 struct, Hi uint16 +pkg unicode, type Range16 struct, Lo uint16 +pkg unicode, type Range16 struct, Stride uint16 +pkg unicode, type Range32 struct +pkg unicode, type Range32 struct, Hi uint32 +pkg unicode, type Range32 struct, Lo uint32 +pkg unicode, type Range32 struct, Stride uint32 +pkg unicode, type RangeTable struct +pkg unicode, type RangeTable struct, R16 []Range16 +pkg unicode, type RangeTable struct, R32 []Range32 +pkg unicode, type SpecialCase []CaseRange +pkg unicode, var ASCII_Hex_Digit *RangeTable +pkg unicode, var Arabic *RangeTable +pkg unicode, var Armenian *RangeTable +pkg unicode, var Avestan *RangeTable +pkg unicode, var AzeriCase SpecialCase +pkg unicode, var Balinese *RangeTable +pkg unicode, var Bamum *RangeTable +pkg unicode, var Batak *RangeTable +pkg unicode, var Bengali *RangeTable +pkg unicode, var Bidi_Control *RangeTable +pkg unicode, var Bopomofo *RangeTable +pkg unicode, var Brahmi *RangeTable +pkg unicode, var Braille *RangeTable +pkg unicode, var Buginese *RangeTable +pkg unicode, var Buhid *RangeTable +pkg unicode, var C *RangeTable +pkg unicode, var Canadian_Aboriginal *RangeTable +pkg unicode, var Carian *RangeTable +pkg unicode, var CaseRanges []CaseRange +pkg unicode, var Categories map[string]*RangeTable +pkg unicode, var Cc *RangeTable +pkg unicode, var Cf *RangeTable +pkg unicode, var Cham *RangeTable +pkg unicode, var Cherokee *RangeTable +pkg unicode, var Co *RangeTable +pkg unicode, var Common *RangeTable +pkg unicode, var Coptic *RangeTable +pkg unicode, var Cs *RangeTable +pkg unicode, var Cuneiform *RangeTable +pkg unicode, var Cypriot *RangeTable +pkg unicode, var Cyrillic *RangeTable +pkg unicode, var Dash *RangeTable +pkg unicode, var Deprecated *RangeTable +pkg unicode, var Deseret *RangeTable +pkg unicode, var Devanagari *RangeTable +pkg unicode, var Diacritic *RangeTable +pkg unicode, var Digit *RangeTable +pkg unicode, var Egyptian_Hieroglyphs *RangeTable +pkg unicode, var Ethiopic *RangeTable +pkg unicode, var Extender *RangeTable +pkg unicode, var FoldCategory map[string]*RangeTable +pkg unicode, var FoldScript map[string]*RangeTable +pkg unicode, var Georgian *RangeTable +pkg unicode, var Glagolitic *RangeTable +pkg unicode, var Gothic *RangeTable +pkg unicode, var GraphicRanges []*RangeTable +pkg unicode, var Greek *RangeTable +pkg unicode, var Gujarati *RangeTable +pkg unicode, var Gurmukhi *RangeTable +pkg unicode, var Han *RangeTable +pkg unicode, var Hangul *RangeTable +pkg unicode, var Hanunoo *RangeTable +pkg unicode, var Hebrew *RangeTable +pkg unicode, var Hex_Digit *RangeTable +pkg unicode, var Hiragana *RangeTable +pkg unicode, var Hyphen *RangeTable +pkg unicode, var IDS_Binary_Operator *RangeTable +pkg unicode, var IDS_Trinary_Operator *RangeTable +pkg unicode, var Ideographic *RangeTable +pkg unicode, var Imperial_Aramaic *RangeTable +pkg unicode, var Inherited *RangeTable +pkg unicode, var Inscriptional_Pahlavi *RangeTable +pkg unicode, var Inscriptional_Parthian *RangeTable +pkg unicode, var Javanese *RangeTable +pkg unicode, var Join_Control *RangeTable +pkg unicode, var Kaithi *RangeTable +pkg unicode, var Kannada *RangeTable +pkg unicode, var Katakana *RangeTable +pkg unicode, var Kayah_Li *RangeTable +pkg unicode, var Kharoshthi *RangeTable +pkg unicode, var Khmer *RangeTable +pkg unicode, var L *RangeTable +pkg unicode, var Lao *RangeTable +pkg unicode, var Latin *RangeTable +pkg unicode, var Lepcha *RangeTable +pkg unicode, var Letter *RangeTable +pkg unicode, var Limbu *RangeTable +pkg unicode, var Linear_B *RangeTable +pkg unicode, var Lisu *RangeTable +pkg unicode, var Ll *RangeTable +pkg unicode, var Lm *RangeTable +pkg unicode, var Lo *RangeTable +pkg unicode, var Logical_Order_Exception *RangeTable +pkg unicode, var Lower *RangeTable +pkg unicode, var Lt *RangeTable +pkg unicode, var Lu *RangeTable +pkg unicode, var Lycian *RangeTable +pkg unicode, var Lydian *RangeTable +pkg unicode, var M *RangeTable +pkg unicode, var Malayalam *RangeTable +pkg unicode, var Mandaic *RangeTable +pkg unicode, var Mark *RangeTable +pkg unicode, var Mc *RangeTable +pkg unicode, var Me *RangeTable +pkg unicode, var Meetei_Mayek *RangeTable +pkg unicode, var Mn *RangeTable +pkg unicode, var Mongolian *RangeTable +pkg unicode, var Myanmar *RangeTable +pkg unicode, var N *RangeTable +pkg unicode, var Nd *RangeTable +pkg unicode, var New_Tai_Lue *RangeTable +pkg unicode, var Nko *RangeTable +pkg unicode, var Nl *RangeTable +pkg unicode, var No *RangeTable +pkg unicode, var Noncharacter_Code_Point *RangeTable +pkg unicode, var Number *RangeTable +pkg unicode, var Ogham *RangeTable +pkg unicode, var Ol_Chiki *RangeTable +pkg unicode, var Old_Italic *RangeTable +pkg unicode, var Old_Persian *RangeTable +pkg unicode, var Old_South_Arabian *RangeTable +pkg unicode, var Old_Turkic *RangeTable +pkg unicode, var Oriya *RangeTable +pkg unicode, var Osmanya *RangeTable +pkg unicode, var Other *RangeTable +pkg unicode, var Other_Alphabetic *RangeTable +pkg unicode, var Other_Default_Ignorable_Code_Point *RangeTable +pkg unicode, var Other_Grapheme_Extend *RangeTable +pkg unicode, var Other_ID_Continue *RangeTable +pkg unicode, var Other_ID_Start *RangeTable +pkg unicode, var Other_Lowercase *RangeTable +pkg unicode, var Other_Math *RangeTable +pkg unicode, var Other_Uppercase *RangeTable +pkg unicode, var P *RangeTable +pkg unicode, var Pattern_Syntax *RangeTable +pkg unicode, var Pattern_White_Space *RangeTable +pkg unicode, var Pc *RangeTable +pkg unicode, var Pd *RangeTable +pkg unicode, var Pe *RangeTable +pkg unicode, var Pf *RangeTable +pkg unicode, var Phags_Pa *RangeTable +pkg unicode, var Phoenician *RangeTable +pkg unicode, var Pi *RangeTable +pkg unicode, var Po *RangeTable +pkg unicode, var PrintRanges []*RangeTable +pkg unicode, var Properties map[string]*RangeTable +pkg unicode, var Ps *RangeTable +pkg unicode, var Punct *RangeTable +pkg unicode, var Quotation_Mark *RangeTable +pkg unicode, var Radical *RangeTable +pkg unicode, var Rejang *RangeTable +pkg unicode, var Runic *RangeTable +pkg unicode, var S *RangeTable +pkg unicode, var STerm *RangeTable +pkg unicode, var Samaritan *RangeTable +pkg unicode, var Saurashtra *RangeTable +pkg unicode, var Sc *RangeTable +pkg unicode, var Scripts map[string]*RangeTable +pkg unicode, var Shavian *RangeTable +pkg unicode, var Sinhala *RangeTable +pkg unicode, var Sk *RangeTable +pkg unicode, var Sm *RangeTable +pkg unicode, var So *RangeTable +pkg unicode, var Soft_Dotted *RangeTable +pkg unicode, var Space *RangeTable +pkg unicode, var Sundanese *RangeTable +pkg unicode, var Syloti_Nagri *RangeTable +pkg unicode, var Symbol *RangeTable +pkg unicode, var Syriac *RangeTable +pkg unicode, var Tagalog *RangeTable +pkg unicode, var Tagbanwa *RangeTable +pkg unicode, var Tai_Le *RangeTable +pkg unicode, var Tai_Tham *RangeTable +pkg unicode, var Tai_Viet *RangeTable +pkg unicode, var Tamil *RangeTable +pkg unicode, var Telugu *RangeTable +pkg unicode, var Terminal_Punctuation *RangeTable +pkg unicode, var Thaana *RangeTable +pkg unicode, var Thai *RangeTable +pkg unicode, var Tibetan *RangeTable +pkg unicode, var Tifinagh *RangeTable +pkg unicode, var Title *RangeTable +pkg unicode, var TurkishCase SpecialCase +pkg unicode, var Ugaritic *RangeTable +pkg unicode, var Unified_Ideograph *RangeTable +pkg unicode, var Upper *RangeTable +pkg unicode, var Vai *RangeTable +pkg unicode, var Variation_Selector *RangeTable +pkg unicode, var White_Space *RangeTable +pkg unicode, var Yi *RangeTable +pkg unicode, var Z *RangeTable +pkg unicode, var Zl *RangeTable +pkg unicode, var Zp *RangeTable +pkg unicode, var Zs *RangeTable +pkg unicode/utf16, func Decode([]uint16) []int32 +pkg unicode/utf16, func DecodeRune(int32, int32) int32 +pkg unicode/utf16, func Encode([]int32) []uint16 +pkg unicode/utf16, func EncodeRune(int32) (int32, int32) +pkg unicode/utf16, func IsSurrogate(int32) bool +pkg unicode/utf8, const MaxRune ideal-char +pkg unicode/utf8, const RuneError ideal-char +pkg unicode/utf8, const RuneSelf ideal-int +pkg unicode/utf8, const UTFMax ideal-int +pkg unicode/utf8, func DecodeLastRune([]uint8) (int32, int) +pkg unicode/utf8, func DecodeLastRuneInString(string) (int32, int) +pkg unicode/utf8, func DecodeRune([]uint8) (int32, int) +pkg unicode/utf8, func DecodeRuneInString(string) (int32, int) +pkg unicode/utf8, func EncodeRune([]uint8, int32) int +pkg unicode/utf8, func FullRune([]uint8) bool +pkg unicode/utf8, func FullRuneInString(string) bool +pkg unicode/utf8, func RuneCount([]uint8) int +pkg unicode/utf8, func RuneCountInString(string) int +pkg unicode/utf8, func RuneLen(int32) int +pkg unicode/utf8, func RuneStart(uint8) bool +pkg unicode/utf8, func Valid([]uint8) bool +pkg unicode/utf8, func ValidString(string) bool diff --git a/api/next.txt b/api/next.txt new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/doc/articles/go_command.html b/doc/articles/go_command.html new file mode 100644 index 0000000000000000000000000000000000000000..cc1d86aef43ba3744611ce2d82bb547898330b77 --- /dev/null +++ b/doc/articles/go_command.html @@ -0,0 +1,271 @@ + + +

The Go distribution includes a command, named +"go", that +automates the downloading, building, installation, and testing of Go packages +and commands. This document talks about why we wrote a new command, what it +is, what it's not, and how to use it.

+ +

Motivation

+ +

You might have seen early Go talks in which Rob Pike jokes that the idea +for Go arose while waiting for a large Google server to compile. That +really was the motivation for Go: to build a language that worked well +for building the large software that Google writes and runs. It was +clear from the start that such a language must provide a way to +express dependencies between code libraries clearly, hence the package +grouping and the explicit import blocks. It was also clear from the +start that you might want arbitrary syntax for describing the code +being imported; this is why import paths are string literals.

+ +

An explicit goal for Go from the beginning was to be able to build Go +code using only the information found in the source itself, not +needing to write a makefile or one of the many modern replacements for +makefiles. If Go needed a configuration file to explain how to build +your program, then Go would have failed.

+ +

At first, there was no Go compiler, and the initial development +focused on building one and then building libraries for it. For +expedience, we postponed the automation of building Go code by using +make and writing makefiles. When compiling a single package involved +multiple invocations of the Go compiler, we even used a program to +write the makefiles for us. You can find it if you dig through the +repository history.

+ +

The purpose of the new go command is our return to this ideal, that Go +programs should compile without configuration or additional effort on +the part of the developer beyond writing the necessary import +statements.

+ +

Configuration versus convention

+ +

The way to achieve the simplicity of a configuration-free system is to +establish conventions. The system works only to the extent that those conventions +are followed. When we first launched Go, many people published packages that +had to be installed in certain places, under certain names, using certain build +tools, in order to be used. That's understandable: that's the way it works in +most other languages. Over the last few years we consistently reminded people +about the goinstall command +(now replaced by go get) +and its conventions: first, that the import path is derived in a known way from +the URL of the source code; second, that the place to store the sources in +the local file system is derived in a known way from the import path; third, +that each directory in a source tree corresponds to a single package; and +fourth, that the package is built using only information in the source code. +Today, the vast majority of packages follow these conventions. +The Go ecosystem is simpler and more powerful as a result.

+ +

We received many requests to allow a makefile in a package directory to +provide just a little extra configuration beyond what's in the source code. +But that would have introduced new rules. Because we did not accede to such +requests, we were able to write the go command and eliminate our use of make +or any other build system.

+ +

It is important to understand that the go command is not a general +build tool. It cannot be configured and it does not attempt to build +anything but Go packages. These are important simplifying +assumptions: they simplify not only the implementation but also, more +important, the use of the tool itself.

+ +

Go's conventions

+ +

The go command requires that code adheres to a few key, +well-established conventions.

+ +

First, the import path is derived in an known way from the URL of the +source code. For Bitbucket, GitHub, Google Code, and Launchpad, the +root directory of the repository is identified by the repository's +main URL, without the http:// prefix. Subdirectories are named by +adding to that path. +For example, the Go example programs are obtained by running

+ +
+git clone https://github.com/golang/example
+
+ +

and thus the import path for the root directory of that repository is +"github.com/golang/example". +The stringutil +package is stored in a subdirectory, so its import path is +"github.com/golang/example/stringutil".

+ +

These paths are on the long side, but in exchange we get an +automatically managed name space for import paths and the ability for +a tool like the go command to look at an unfamiliar import path and +deduce where to obtain the source code.

+ +

Second, the place to store sources in the local file system is derived +in a known way from the import path. Specifically, the first choice +is $GOPATH/src/<import-path>. If $GOPATH is +unset, the go command will fall back to storing source code alongside the +standard Go packages, in $GOROOT/src/<import-path>. +If $GOPATH is set to a list of paths, the go command tries +<dir>/src/<import-path> for each of the directories in +that list.

+ +

Each of those trees contains, by convention, a top-level directory named +"bin", for holding compiled executables, and a top-level directory +named "pkg", for holding compiled packages that can be imported, +and the "src" directory, for holding package source files. +Imposing this structure lets us keep each of these directory trees +self-contained: the compiled form and the sources are always near each +other.

+ +

These naming conventions also let us work in the reverse direction, +from a directory name to its import path. This mapping is important +for many of the go command's subcommands, as we'll see below.

+ +

Third, each directory in a source tree corresponds to a single +package. By restricting a directory to a single package, we don't have +to create hybrid import paths that specify first the directory and +then the package within that directory. Also, most file management +tools and UIs work on directories as fundamental units. Tying the +fundamental Go unit—the package—to file system structure means +that file system tools become Go package tools. Copying, moving, or +deleting a package corresponds to copying, moving, or deleting a +directory.

+ +

Fourth, each package is built using only the information present in +the source files. This makes it much more likely that the tool will +be able to adapt to changing build environments and conditions. For +example, if we allowed extra configuration such as compiler flags or +command line recipes, then that configuration would need to be updated +each time the build tools changed; it would also be inherently tied +to the use of a specific tool chain.

+ +

Getting started with the go command

+ +

Finally, a quick tour of how to use the go command, to supplement +the information in How to Write Go Code, +which you might want to read first. Assuming you want +to keep your source code separate from the Go distribution source +tree, the first step is to set $GOPATH, the one piece of global +configuration that the go command needs. The $GOPATH can be a +list of directories, but by far the most common usage should be to set it to a +single directory. In particular, you do not need a separate entry in +$GOPATH for each of your projects. One $GOPATH can +support many projects.

+ +

Here’s an example. Let’s say we decide to keep our Go code in the directory +$HOME/mygo. We need to create that directory and set +$GOPATH accordingly.

+ +
+$ mkdir $HOME/mygo
+$ export GOPATH=$HOME/mygo
+$
+
+ +

Into this directory, we now add some source code. Suppose we want to use +the indexing library from the codesearch project along with a left-leaning +red-black tree. We can install both with the "go get" +subcommand:

+ +
+$ go get code.google.com/p/codesearch/index
+$ go get github.com/petar/GoLLRB/llrb
+$
+
+ +

Both of these projects are now downloaded and installed into our +$GOPATH directory. The one tree now contains the two directories +src/code.google.com/p/codesearch/index/ and +src/github.com/petar/GoLLRB/llrb/, along with the compiled +packages (in pkg/) for those libraries and their dependencies.

+ +

Because we used version control systems (Mercurial and Git) to check +out the sources, the source tree also contains the other files in the +corresponding repositories, such as related packages. The "go list" +subcommand lists the import paths corresponding to its arguments, and +the pattern "./..." means start in the current directory +("./") and find all packages below that directory +("..."):

+ +
+$ go list ./...
+code.google.com/p/codesearch/cmd/cgrep
+code.google.com/p/codesearch/cmd/cindex
+code.google.com/p/codesearch/cmd/csearch
+code.google.com/p/codesearch/index
+code.google.com/p/codesearch/regexp
+code.google.com/p/codesearch/sparse
+github.com/petar/GoLLRB/example
+github.com/petar/GoLLRB/llrb
+$
+
+ +

We can also test those packages:

+ +
+$ go test ./...
+?       code.google.com/p/codesearch/cmd/cgrep   [no test files]
+?       code.google.com/p/codesearch/cmd/cindex  [no test files]
+?       code.google.com/p/codesearch/cmd/csearch [no test files]
+ok      code.google.com/p/codesearch/index       0.239s
+ok      code.google.com/p/codesearch/regexp      0.021s
+?       code.google.com/p/codesearch/sparse      [no test files]
+?       github.com/petar/GoLLRB/example          [no test files]
+ok      github.com/petar/GoLLRB/llrb             0.231s
+$
+
+ +

If a go subcommand is invoked with no paths listed, it operates on the +current directory:

+ +
+$ cd $GOPATH/src/code.google.com/p/codesearch/regexp
+$ go list
+code.google.com/p/codesearch/regexp
+$ go test -v
+=== RUN TestNstateEnc
+--- PASS: TestNstateEnc (0.00 seconds)
+=== RUN TestMatch
+--- PASS: TestMatch (0.01 seconds)
+=== RUN TestGrep
+--- PASS: TestGrep (0.00 seconds)
+PASS
+ok      code.google.com/p/codesearch/regexp     0.021s
+$ go install
+$
+
+ +

That "go install" subcommand installs the latest copy of the +package into the pkg directory. Because the go command can analyze the +dependency graph, "go install" also installs any packages that +this package imports but that are out of date, recursively.

+ +

Notice that "go install" was able to determine the name of the +import path for the package in the current directory, because of the convention +for directory naming. It would be a little more convenient if we could pick +the name of the directory where we kept source code, and we probably wouldn't +pick such a long name, but that ability would require additional configuration +and complexity in the tool. Typing an extra directory name or two is a small +price to pay for the increased simplicity and power.

+ +

As the example shows, it’s fine to work with packages from many different +projects at once within a single $GOPATH root directory.

+ +

Limitations

+ +

As mentioned above, the go command is not a general-purpose build +tool. +In particular, it does not have any facility for generating Go +source files during a build, although it does provide +go +generate, +which can automate the creation of Go files before +the build, such as by running yacc. +For more advanced build setups, you may need to write a +makefile (or a configuration file for the build tool of your choice) +to run whatever tool creates the Go files and then check those generated source files +into your repository. This is more work for you, the package author, +but it is significantly less work for your users, who can use +"go get" without needing to obtain and build +any additional tools.

+ +

More information

+ +

For more information, read How to Write Go Code +and see the go command documentation.

diff --git a/doc/articles/index.html b/doc/articles/index.html new file mode 100644 index 0000000000000000000000000000000000000000..9ddd66973108781831171e2c7956ca3d3575b0e9 --- /dev/null +++ b/doc/articles/index.html @@ -0,0 +1,8 @@ + + +

+See the Documents page and the +Blog index for a complete list of Go articles. +

diff --git a/doc/articles/race_detector.html b/doc/articles/race_detector.html new file mode 100644 index 0000000000000000000000000000000000000000..6defd98f96e51578b4bb7934d63f249c123a306f --- /dev/null +++ b/doc/articles/race_detector.html @@ -0,0 +1,389 @@ + + +

Introduction

+ +

+Data races are among the most common and hardest to debug types of bugs in concurrent systems. +A data race occurs when two goroutines access the same variable concurrently and at least one of the accesses is a write. +See the The Go Memory Model for details. +

+ +

+Here is an example of a data race that can lead to crashes and memory corruption: +

+ +
+func main() {
+	c := make(chan bool)
+	m := make(map[string]string)
+	go func() {
+		m["1"] = "a" // First conflicting access.
+		c <- true
+	}()
+	m["2"] = "b" // Second conflicting access.
+	<-c
+	for k, v := range m {
+		fmt.Println(k, v)
+	}
+}
+
+ +

Usage

+ +

+To help diagnose such bugs, Go includes a built-in data race detector. +To use it, add the -race flag to the go command: +

+ +
+$ go test -race mypkg    // to test the package
+$ go run -race mysrc.go  // to run the source file
+$ go build -race mycmd   // to build the command
+$ go install -race mypkg // to install the package
+
+ +

Report Format

+ +

+When the race detector finds a data race in the program, it prints a report. +The report contains stack traces for conflicting accesses, as well as stacks where the involved goroutines were created. +Here is an example: +

+ +
+WARNING: DATA RACE
+Read by goroutine 185:
+  net.(*pollServer).AddFD()
+      src/net/fd_unix.go:89 +0x398
+  net.(*pollServer).WaitWrite()
+      src/net/fd_unix.go:247 +0x45
+  net.(*netFD).Write()
+      src/net/fd_unix.go:540 +0x4d4
+  net.(*conn).Write()
+      src/net/net.go:129 +0x101
+  net.func·060()
+      src/net/timeout_test.go:603 +0xaf
+
+Previous write by goroutine 184:
+  net.setWriteDeadline()
+      src/net/sockopt_posix.go:135 +0xdf
+  net.setDeadline()
+      src/net/sockopt_posix.go:144 +0x9c
+  net.(*conn).SetDeadline()
+      src/net/net.go:161 +0xe3
+  net.func·061()
+      src/net/timeout_test.go:616 +0x3ed
+
+Goroutine 185 (running) created at:
+  net.func·061()
+      src/net/timeout_test.go:609 +0x288
+
+Goroutine 184 (running) created at:
+  net.TestProlongTimeout()
+      src/net/timeout_test.go:618 +0x298
+  testing.tRunner()
+      src/testing/testing.go:301 +0xe8
+
+ +

Options

+ +

+The GORACE environment variable sets race detector options. +The format is: +

+ +
+GORACE="option1=val1 option2=val2"
+
+ +

+The options are: +

+ +
    +
  • +log_path (default stderr): The race detector writes +its report to a file named log_path.pid. +The special names stdout +and stderr cause reports to be written to standard output and +standard error, respectively. +
  • + +
  • +exitcode (default 66): The exit status to use when +exiting after a detected race. +
  • + +
  • +strip_path_prefix (default ""): Strip this prefix +from all reported file paths, to make reports more concise. +
  • + +
  • +history_size (default 1): The per-goroutine memory +access history is 32K * 2**history_size elements. +Increasing this value can avoid a "failed to restore the stack" error in reports, at the +cost of increased memory usage. +
  • + +
  • +halt_on_error (default 0): Controls whether the program +exits after reporting first data race. +
  • +
+ +

+Example: +

+ +
+$ GORACE="log_path=/tmp/race/report strip_path_prefix=/my/go/sources/" go test -race
+
+ +

Excluding Tests

+ +

+When you build with -race flag, the go command defines additional +build tag race. +You can use the tag to exclude some code and tests when running the race detector. +Some examples: +

+ +
+// +build !race
+
+package foo
+
+// The test contains a data race. See issue 123.
+func TestFoo(t *testing.T) {
+	// ...
+}
+
+// The test fails under the race detector due to timeouts.
+func TestBar(t *testing.T) {
+	// ...
+}
+
+// The test takes too long under the race detector.
+func TestBaz(t *testing.T) {
+	// ...
+}
+
+ +

How To Use

+ +

+To start, run your tests using the race detector (go test -race). +The race detector only finds races that happen at runtime, so it can't find +races in code paths that are not executed. +If your tests have incomplete coverage, +you may find more races by running a binary built with -race under a realistic +workload. +

+ +

Typical Data Races

+ +

+Here are some typical data races. All of them can be detected with the race detector. +

+ +

Race on loop counter

+ +
+func main() {
+	var wg sync.WaitGroup
+	wg.Add(5)
+	for i := 0; i < 5; i++ {
+		go func() {
+			fmt.Println(i) // Not the 'i' you are looking for.
+			wg.Done()
+		}()
+	}
+	wg.Wait()
+}
+
+ +

+The variable i in the function literal is the same variable used by the loop, so +the read in the goroutine races with the loop increment. +(This program typically prints 55555, not 01234.) +The program can be fixed by making a copy of the variable: +

+ +
+func main() {
+	var wg sync.WaitGroup
+	wg.Add(5)
+	for i := 0; i < 5; i++ {
+		go func(j int) {
+			fmt.Println(j) // Good. Read local copy of the loop counter.
+			wg.Done()
+		}(i)
+	}
+	wg.Wait()
+}
+
+ +

Accidentally shared variable

+ +
+// ParallelWrite writes data to file1 and file2, returns the errors.
+func ParallelWrite(data []byte) chan error {
+	res := make(chan error, 2)
+	f1, err := os.Create("file1")
+	if err != nil {
+		res <- err
+	} else {
+		go func() {
+			// This err is shared with the main goroutine,
+			// so the write races with the write below.
+			_, err = f1.Write(data)
+			res <- err
+			f1.Close()
+		}()
+	}
+	f2, err := os.Create("file2") // The second conflicting write to err.
+	if err != nil {
+		res <- err
+	} else {
+		go func() {
+			_, err = f2.Write(data)
+			res <- err
+			f2.Close()
+		}()
+	}
+	return res
+}
+
+ +

+The fix is to introduce new variables in the goroutines (note the use of :=): +

+ +
+			...
+			_, err := f1.Write(data)
+			...
+			_, err := f2.Write(data)
+			...
+
+ +

Unprotected global variable

+ +

+If the following code is called from several goroutines, it leads to races on the service map. +Concurrent reads and writes of the same map are not safe: +

+ +
+var service map[string]net.Addr
+
+func RegisterService(name string, addr net.Addr) {
+	service[name] = addr
+}
+
+func LookupService(name string) net.Addr {
+	return service[name]
+}
+
+ +

+To make the code safe, protect the accesses with a mutex: +

+ +
+var (
+	service   map[string]net.Addr
+	serviceMu sync.Mutex
+)
+
+func RegisterService(name string, addr net.Addr) {
+	serviceMu.Lock()
+	defer serviceMu.Unlock()
+	service[name] = addr
+}
+
+func LookupService(name string) net.Addr {
+	serviceMu.Lock()
+	defer serviceMu.Unlock()
+	return service[name]
+}
+
+ +

Primitive unprotected variable

+ +

+Data races can happen on variables of primitive types as well (bool, int, int64, etc.), +as in this example: +

+ +
+type Watchdog struct{ last int64 }
+
+func (w *Watchdog) KeepAlive() {
+	w.last = time.Now().UnixNano() // First conflicting access.
+}
+
+func (w *Watchdog) Start() {
+	go func() {
+		for {
+			time.Sleep(time.Second)
+			// Second conflicting access.
+			if w.last < time.Now().Add(-10*time.Second).UnixNano() {
+				fmt.Println("No keepalives for 10 seconds. Dying.")
+				os.Exit(1)
+			}
+		}
+	}()
+}
+
+ +

+Even such "innocent" data races can lead to hard-to-debug problems caused by +non-atomicity of the memory accesses, +interference with compiler optimizations, +or reordering issues accessing processor memory . +

+ +

+A typical fix for this race is to use a channel or a mutex. +To preserve the lock-free behavior, one can also use the +sync/atomic package. +

+ +
+type Watchdog struct{ last int64 }
+
+func (w *Watchdog) KeepAlive() {
+	atomic.StoreInt64(&w.last, time.Now().UnixNano())
+}
+
+func (w *Watchdog) Start() {
+	go func() {
+		for {
+			time.Sleep(time.Second)
+			if atomic.LoadInt64(&w.last) < time.Now().Add(-10*time.Second).UnixNano() {
+				fmt.Println("No keepalives for 10 seconds. Dying.")
+				os.Exit(1)
+			}
+		}
+	}()
+}
+
+ +

Supported Systems

+ +

+The race detector runs on darwin/amd64, freebsd/amd64, +linux/amd64, and windows/amd64. +

+ +

Runtime Overhead

+ +

+The cost of race detection varies by program, but for a typical program, memory +usage may increase by 5-10x and execution time by 2-20x. +

diff --git a/doc/articles/wiki/edit.html b/doc/articles/wiki/edit.html new file mode 100644 index 0000000000000000000000000000000000000000..044c3bedea40f3209d415a9b0c4d26c0dd98fbd7 --- /dev/null +++ b/doc/articles/wiki/edit.html @@ -0,0 +1,6 @@ +

Editing {{.Title}}

+ +
+
+
+
diff --git a/doc/articles/wiki/final-noclosure.go b/doc/articles/wiki/final-noclosure.go new file mode 100644 index 0000000000000000000000000000000000000000..d72ca805b8793a2603e406e239dfb6289b5cde74 --- /dev/null +++ b/doc/articles/wiki/final-noclosure.go @@ -0,0 +1,102 @@ +// Copyright 2010 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +import ( + "errors" + "html/template" + "io/ioutil" + "net/http" + "regexp" +) + +type Page struct { + Title string + Body []byte +} + +func (p *Page) save() error { + filename := p.Title + ".txt" + return ioutil.WriteFile(filename, p.Body, 0600) +} + +func loadPage(title string) (*Page, error) { + filename := title + ".txt" + body, err := ioutil.ReadFile(filename) + if err != nil { + return nil, err + } + return &Page{Title: title, Body: body}, nil +} + +func viewHandler(w http.ResponseWriter, r *http.Request) { + title, err := getTitle(w, r) + if err != nil { + return + } + p, err := loadPage(title) + if err != nil { + http.Redirect(w, r, "/edit/"+title, http.StatusFound) + return + } + renderTemplate(w, "view", p) +} + +func editHandler(w http.ResponseWriter, r *http.Request) { + title, err := getTitle(w, r) + if err != nil { + return + } + p, err := loadPage(title) + if err != nil { + p = &Page{Title: title} + } + renderTemplate(w, "edit", p) +} + +func saveHandler(w http.ResponseWriter, r *http.Request) { + title, err := getTitle(w, r) + if err != nil { + return + } + body := r.FormValue("body") + p := &Page{Title: title, Body: []byte(body)} + err = p.save() + if err != nil { + http.Error(w, err.Error(), http.StatusInternalServerError) + return + } + http.Redirect(w, r, "/view/"+title, http.StatusFound) +} + +func renderTemplate(w http.ResponseWriter, tmpl string, p *Page) { + t, err := template.ParseFiles(tmpl + ".html") + if err != nil { + http.Error(w, err.Error(), http.StatusInternalServerError) + return + } + err = t.Execute(w, p) + if err != nil { + http.Error(w, err.Error(), http.StatusInternalServerError) + } +} + +var validPath = regexp.MustCompile("^/(edit|save|view)/([a-zA-Z0-9]+)$") + +func getTitle(w http.ResponseWriter, r *http.Request) (string, error) { + m := validPath.FindStringSubmatch(r.URL.Path) + if m == nil { + http.NotFound(w, r) + return "", errors.New("Invalid Page Title") + } + return m[2], nil // The title is the second subexpression. +} + +func main() { + http.HandleFunc("/view/", viewHandler) + http.HandleFunc("/edit/", editHandler) + http.HandleFunc("/save/", saveHandler) + http.ListenAndServe(":8080", nil) +} diff --git a/doc/articles/wiki/final-noerror.go b/doc/articles/wiki/final-noerror.go new file mode 100644 index 0000000000000000000000000000000000000000..86d8da751f9d5d77e4c602266568f73558b8763a --- /dev/null +++ b/doc/articles/wiki/final-noerror.go @@ -0,0 +1,53 @@ +// Copyright 2010 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +import ( + "html/template" + "io/ioutil" + "net/http" +) + +type Page struct { + Title string + Body []byte +} + +func (p *Page) save() error { + filename := p.Title + ".txt" + return ioutil.WriteFile(filename, p.Body, 0600) +} + +func loadPage(title string) (*Page, error) { + filename := title + ".txt" + body, err := ioutil.ReadFile(filename) + if err != nil { + return nil, err + } + return &Page{Title: title, Body: body}, nil +} + +func editHandler(w http.ResponseWriter, r *http.Request) { + title := r.URL.Path[len("/edit/"):] + p, err := loadPage(title) + if err != nil { + p = &Page{Title: title} + } + t, _ := template.ParseFiles("edit.html") + t.Execute(w, p) +} + +func viewHandler(w http.ResponseWriter, r *http.Request) { + title := r.URL.Path[len("/view/"):] + p, _ := loadPage(title) + t, _ := template.ParseFiles("view.html") + t.Execute(w, p) +} + +func main() { + http.HandleFunc("/view/", viewHandler) + http.HandleFunc("/edit/", editHandler) + http.ListenAndServe(":8080", nil) +} diff --git a/doc/articles/wiki/final-parsetemplate.go b/doc/articles/wiki/final-parsetemplate.go new file mode 100644 index 0000000000000000000000000000000000000000..5ff8bf60c5b02f9a1abc62973a04ef2c06a9cd1c --- /dev/null +++ b/doc/articles/wiki/final-parsetemplate.go @@ -0,0 +1,91 @@ +// Copyright 2010 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +import ( + "html/template" + "io/ioutil" + "net/http" + "regexp" +) + +type Page struct { + Title string + Body []byte +} + +func (p *Page) save() error { + filename := p.Title + ".txt" + return ioutil.WriteFile(filename, p.Body, 0600) +} + +func loadPage(title string) (*Page, error) { + filename := title + ".txt" + body, err := ioutil.ReadFile(filename) + if err != nil { + return nil, err + } + return &Page{Title: title, Body: body}, nil +} + +func viewHandler(w http.ResponseWriter, r *http.Request, title string) { + p, err := loadPage(title) + if err != nil { + http.Redirect(w, r, "/edit/"+title, http.StatusFound) + return + } + renderTemplate(w, "view", p) +} + +func editHandler(w http.ResponseWriter, r *http.Request, title string) { + p, err := loadPage(title) + if err != nil { + p = &Page{Title: title} + } + renderTemplate(w, "edit", p) +} + +func saveHandler(w http.ResponseWriter, r *http.Request, title string) { + body := r.FormValue("body") + p := &Page{Title: title, Body: []byte(body)} + err := p.save() + if err != nil { + http.Error(w, err.Error(), http.StatusInternalServerError) + return + } + http.Redirect(w, r, "/view/"+title, http.StatusFound) +} + +func renderTemplate(w http.ResponseWriter, tmpl string, p *Page) { + t, err := template.ParseFiles(tmpl + ".html") + if err != nil { + http.Error(w, err.Error(), http.StatusInternalServerError) + return + } + err = t.Execute(w, p) + if err != nil { + http.Error(w, err.Error(), http.StatusInternalServerError) + } +} + +var validPath = regexp.MustCompile("^/(edit|save|view)/([a-zA-Z0-9]+)$") + +func makeHandler(fn func(http.ResponseWriter, *http.Request, string)) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + m := validPath.FindStringSubmatch(r.URL.Path) + if m == nil { + http.NotFound(w, r) + return + } + fn(w, r, m[2]) + } +} + +func main() { + http.HandleFunc("/view/", makeHandler(viewHandler)) + http.HandleFunc("/edit/", makeHandler(editHandler)) + http.HandleFunc("/save/", makeHandler(saveHandler)) + http.ListenAndServe(":8080", nil) +} diff --git a/doc/articles/wiki/final-template.go b/doc/articles/wiki/final-template.go new file mode 100644 index 0000000000000000000000000000000000000000..719157da954bd23b4d4048164ae18694284f9b96 --- /dev/null +++ b/doc/articles/wiki/final-template.go @@ -0,0 +1,65 @@ +// Copyright 2010 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +import ( + "html/template" + "io/ioutil" + "net/http" +) + +type Page struct { + Title string + Body []byte +} + +func (p *Page) save() error { + filename := p.Title + ".txt" + return ioutil.WriteFile(filename, p.Body, 0600) +} + +func loadPage(title string) (*Page, error) { + filename := title + ".txt" + body, err := ioutil.ReadFile(filename) + if err != nil { + return nil, err + } + return &Page{Title: title, Body: body}, nil +} + +func editHandler(w http.ResponseWriter, r *http.Request) { + title := r.URL.Path[len("/edit/"):] + p, err := loadPage(title) + if err != nil { + p = &Page{Title: title} + } + renderTemplate(w, "edit", p) +} + +func viewHandler(w http.ResponseWriter, r *http.Request) { + title := r.URL.Path[len("/view/"):] + p, _ := loadPage(title) + renderTemplate(w, "view", p) +} + +func saveHandler(w http.ResponseWriter, r *http.Request) { + title := r.URL.Path[len("/save/"):] + body := r.FormValue("body") + p := &Page{Title: title, Body: []byte(body)} + p.save() + http.Redirect(w, r, "/view/"+title, http.StatusFound) +} + +func renderTemplate(w http.ResponseWriter, tmpl string, p *Page) { + t, _ := template.ParseFiles(tmpl + ".html") + t.Execute(w, p) +} + +func main() { + http.HandleFunc("/view/", viewHandler) + http.HandleFunc("/edit/", editHandler) + http.HandleFunc("/save/", saveHandler) + http.ListenAndServe(":8080", nil) +} diff --git a/doc/articles/wiki/final-test.patch b/doc/articles/wiki/final-test.patch new file mode 100644 index 0000000000000000000000000000000000000000..499ad789b311798e5dba422dea552f3bfe6d56ec --- /dev/null +++ b/doc/articles/wiki/final-test.patch @@ -0,0 +1,36 @@ +*** final.go 2015-06-14 23:59:22.000000000 +0200 +--- final-test.go 2015-06-15 00:15:41.000000000 +0200 +*************** +*** 7,12 **** +--- 7,14 ---- + import ( + "html/template" + "io/ioutil" ++ "log" ++ "net" + "net/http" + "regexp" + ) +*************** +*** 85,89 **** + http.HandleFunc("/edit/", makeHandler(editHandler)) + http.HandleFunc("/save/", makeHandler(saveHandler)) + +! http.ListenAndServe(":8080", nil) + } +--- 87,101 ---- + http.HandleFunc("/edit/", makeHandler(editHandler)) + http.HandleFunc("/save/", makeHandler(saveHandler)) + +! l, err := net.Listen("tcp", "127.0.0.1:0") +! if err != nil { +! log.Fatal(err) +! } +! err = ioutil.WriteFile("final-test-port.txt", []byte(l.Addr().String()), 0644) +! if err != nil { +! log.Fatal(err) +! } +! s := &http.Server{} +! s.Serve(l) +! return + } diff --git a/doc/articles/wiki/final.go b/doc/articles/wiki/final.go new file mode 100644 index 0000000000000000000000000000000000000000..139a323010830e7100b86002bcd866fb15f3f752 --- /dev/null +++ b/doc/articles/wiki/final.go @@ -0,0 +1,89 @@ +// Copyright 2010 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +import ( + "html/template" + "io/ioutil" + "net/http" + "regexp" +) + +type Page struct { + Title string + Body []byte +} + +func (p *Page) save() error { + filename := p.Title + ".txt" + return ioutil.WriteFile(filename, p.Body, 0600) +} + +func loadPage(title string) (*Page, error) { + filename := title + ".txt" + body, err := ioutil.ReadFile(filename) + if err != nil { + return nil, err + } + return &Page{Title: title, Body: body}, nil +} + +func viewHandler(w http.ResponseWriter, r *http.Request, title string) { + p, err := loadPage(title) + if err != nil { + http.Redirect(w, r, "/edit/"+title, http.StatusFound) + return + } + renderTemplate(w, "view", p) +} + +func editHandler(w http.ResponseWriter, r *http.Request, title string) { + p, err := loadPage(title) + if err != nil { + p = &Page{Title: title} + } + renderTemplate(w, "edit", p) +} + +func saveHandler(w http.ResponseWriter, r *http.Request, title string) { + body := r.FormValue("body") + p := &Page{Title: title, Body: []byte(body)} + err := p.save() + if err != nil { + http.Error(w, err.Error(), http.StatusInternalServerError) + return + } + http.Redirect(w, r, "/view/"+title, http.StatusFound) +} + +var templates = template.Must(template.ParseFiles("edit.html", "view.html")) + +func renderTemplate(w http.ResponseWriter, tmpl string, p *Page) { + err := templates.ExecuteTemplate(w, tmpl+".html", p) + if err != nil { + http.Error(w, err.Error(), http.StatusInternalServerError) + } +} + +var validPath = regexp.MustCompile("^/(edit|save|view)/([a-zA-Z0-9]+)$") + +func makeHandler(fn func(http.ResponseWriter, *http.Request, string)) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + m := validPath.FindStringSubmatch(r.URL.Path) + if m == nil { + http.NotFound(w, r) + return + } + fn(w, r, m[2]) + } +} + +func main() { + http.HandleFunc("/view/", makeHandler(viewHandler)) + http.HandleFunc("/edit/", makeHandler(editHandler)) + http.HandleFunc("/save/", makeHandler(saveHandler)) + + http.ListenAndServe(":8080", nil) +} diff --git a/doc/articles/wiki/get.go b/doc/articles/wiki/get.go new file mode 100644 index 0000000000000000000000000000000000000000..b3e464b3442d83103db9eae7515135b623d572e2 --- /dev/null +++ b/doc/articles/wiki/get.go @@ -0,0 +1,63 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +import ( + "flag" + "fmt" + "io" + "log" + "net" + "net/http" + "os" + "strings" + "time" +) + +var ( + post = flag.String("post", "", "urlencoded form data to POST") + addr = flag.Bool("addr", false, "find open address and print to stdout") + wait = flag.Duration("wait_for_port", 0, "if non-zero, the amount of time to wait for the address to become available") +) + +func main() { + flag.Parse() + if *addr { + l, err := net.Listen("tcp", "127.0.0.1:0") + if err != nil { + log.Fatal(err) + } + defer l.Close() + fmt.Print(l.Addr()) + return + } + url := flag.Arg(0) + if url == "" { + log.Fatal("no url supplied") + } + var r *http.Response + var err error + loopUntil := time.Now().Add(*wait) + for { + if *post != "" { + b := strings.NewReader(*post) + r, err = http.Post(url, "application/x-www-form-urlencoded", b) + } else { + r, err = http.Get(url) + } + if err == nil || *wait == 0 || time.Now().After(loopUntil) { + break + } + time.Sleep(100 * time.Millisecond) + } + if err != nil { + log.Fatal(err) + } + defer r.Body.Close() + _, err = io.Copy(os.Stdout, r.Body) + if err != nil { + log.Fatal(err) + } +} diff --git a/doc/articles/wiki/http-sample.go b/doc/articles/wiki/http-sample.go new file mode 100644 index 0000000000000000000000000000000000000000..ac8cc4f2d6739848fd2babaa50dbfb31c151a863 --- /dev/null +++ b/doc/articles/wiki/http-sample.go @@ -0,0 +1,15 @@ +package main + +import ( + "fmt" + "net/http" +) + +func handler(w http.ResponseWriter, r *http.Request) { + fmt.Fprintf(w, "Hi there, I love %s!", r.URL.Path[1:]) +} + +func main() { + http.HandleFunc("/", handler) + http.ListenAndServe(":8080", nil) +} diff --git a/doc/articles/wiki/index.html b/doc/articles/wiki/index.html new file mode 100644 index 0000000000000000000000000000000000000000..b6b080df960362a6f7438b10c223810da0c9747c --- /dev/null +++ b/doc/articles/wiki/index.html @@ -0,0 +1,734 @@ + + +

Introduction

+ +

+Covered in this tutorial: +

+
    +
  • Creating a data structure with load and save methods
  • +
  • Using the net/http package to build web applications +
  • Using the html/template package to process HTML templates
  • +
  • Using the regexp package to validate user input
  • +
  • Using closures
  • +
+ +

+Assumed knowledge: +

+
    +
  • Programming experience
  • +
  • Understanding of basic web technologies (HTTP, HTML)
  • +
  • Some UNIX/DOS command-line knowledge
  • +
+ +

Getting Started

+ +

+At present, you need to have a FreeBSD, Linux, OS X, or Windows machine to run Go. +We will use $ to represent the command prompt. +

+ +

+Install Go (see the Installation Instructions). +

+ +

+Make a new directory for this tutorial inside your GOPATH and cd to it: +

+ +
+$ mkdir gowiki
+$ cd gowiki
+
+ +

+Create a file named wiki.go, open it in your favorite editor, and +add the following lines: +

+ +
+package main
+
+import (
+	"fmt"
+	"io/ioutil"
+)
+
+ +

+We import the fmt and ioutil packages from the Go +standard library. Later, as we implement additional functionality, we will +add more packages to this import declaration. +

+ +

Data Structures

+ +

+Let's start by defining the data structures. A wiki consists of a series of +interconnected pages, each of which has a title and a body (the page content). +Here, we define Page as a struct with two fields representing +the title and body. +

+ +{{code "doc/articles/wiki/part1.go" `/^type Page/` `/}/`}} + +

+The type []byte means "a byte slice". +(See Slices: usage and +internals for more on slices.) +The Body element is a []byte rather than +string because that is the type expected by the io +libraries we will use, as you'll see below. +

+ +

+The Page struct describes how page data will be stored in memory. +But what about persistent storage? We can address that by creating a +save method on Page: +

+ +{{code "doc/articles/wiki/part1.go" `/^func.*Page.*save/` `/}/`}} + +

+This method's signature reads: "This is a method named save that +takes as its receiver p, a pointer to Page . It takes +no parameters, and returns a value of type error." +

+ +

+This method will save the Page's Body to a text +file. For simplicity, we will use the Title as the file name. +

+ +

+The save method returns an error value because +that is the return type of WriteFile (a standard library function +that writes a byte slice to a file). The save method returns the +error value, to let the application handle it should anything go wrong while +writing the file. If all goes well, Page.save() will return +nil (the zero-value for pointers, interfaces, and some other +types). +

+ +

+The octal integer literal 0600, passed as the third parameter to +WriteFile, indicates that the file should be created with +read-write permissions for the current user only. (See the Unix man page +open(2) for details.) +

+ +

+In addition to saving pages, we will want to load pages, too: +

+ +{{code "doc/articles/wiki/part1-noerror.go" `/^func loadPage/` `/^}/`}} + +

+The function loadPage constructs the file name from the title +parameter, reads the file's contents into a new variable body, and +returns a pointer to a Page literal constructed with the proper +title and body values. +

+ +

+Functions can return multiple values. The standard library function +io.ReadFile returns []byte and error. +In loadPage, error isn't being handled yet; the "blank identifier" +represented by the underscore (_) symbol is used to throw away the +error return value (in essence, assigning the value to nothing). +

+ +

+But what happens if ReadFile encounters an error? For example, +the file might not exist. We should not ignore such errors. Let's modify the +function to return *Page and error. +

+ +{{code "doc/articles/wiki/part1.go" `/^func loadPage/` `/^}/`}} + +

+Callers of this function can now check the second parameter; if it is +nil then it has successfully loaded a Page. If not, it will be an +error that can be handled by the caller (see the +language specification for details). +

+ +

+At this point we have a simple data structure and the ability to save to and +load from a file. Let's write a main function to test what we've +written: +

+ +{{code "doc/articles/wiki/part1.go" `/^func main/` `/^}/`}} + +

+After compiling and executing this code, a file named TestPage.txt +would be created, containing the contents of p1. The file would +then be read into the struct p2, and its Body element +printed to the screen. +

+ +

+You can compile and run the program like this: +

+ +
+$ go build wiki.go
+$ ./wiki
+This is a sample page.
+
+ +

+(If you're using Windows you must type "wiki" without the +"./" to run the program.) +

+ +

+Click here to view the code we've written so far. +

+ +

Introducing the net/http package (an interlude)

+ +

+Here's a full working example of a simple web server: +

+ +{{code "doc/articles/wiki/http-sample.go"}} + +

+The main function begins with a call to +http.HandleFunc, which tells the http package to +handle all requests to the web root ("/") with +handler. +

+ +

+It then calls http.ListenAndServe, specifying that it should +listen on port 8080 on any interface (":8080"). (Don't +worry about its second parameter, nil, for now.) +This function will block until the program is terminated. +

+ +

+The function handler is of the type http.HandlerFunc. +It takes an http.ResponseWriter and an http.Request as +its arguments. +

+ +

+An http.ResponseWriter value assembles the HTTP server's response; by writing +to it, we send data to the HTTP client. +

+ +

+An http.Request is a data structure that represents the client +HTTP request. r.URL.Path is the path component +of the request URL. The trailing [1:] means +"create a sub-slice of Path from the 1st character to the end." +This drops the leading "/" from the path name. +

+ +

+If you run this program and access the URL: +

+
http://localhost:8080/monkeys
+

+the program would present a page containing: +

+
Hi there, I love monkeys!
+ +

Using net/http to serve wiki pages

+ +

+To use the net/http package, it must be imported: +

+ +
+import (
+	"fmt"
+	"io/ioutil"
+	"net/http"
+)
+
+ +

+Let's create a handler, viewHandler that will allow users to +view a wiki page. It will handle URLs prefixed with "/view/". +

+ +{{code "doc/articles/wiki/part2.go" `/^func viewHandler/` `/^}/`}} + +

+First, this function extracts the page title from r.URL.Path, +the path component of the request URL. +The Path is re-sliced with [len("/view/"):] to drop +the leading "/view/" component of the request path. +This is because the path will invariably begin with "/view/", +which is not part of the page's title. +

+ +

+The function then loads the page data, formats the page with a string of simple +HTML, and writes it to w, the http.ResponseWriter. +

+ +

+Again, note the use of _ to ignore the error +return value from loadPage. This is done here for simplicity +and generally considered bad practice. We will attend to this later. +

+ +

+To use this handler, we rewrite our main function to +initialize http using the viewHandler to handle +any requests under the path /view/. +

+ +{{code "doc/articles/wiki/part2.go" `/^func main/` `/^}/`}} + +

+Click here to view the code we've written so far. +

+ +

+Let's create some page data (as test.txt), compile our code, and +try serving a wiki page. +

+ +

+Open test.txt file in your editor, and save the string "Hello world" (without quotes) +in it. +

+ +
+$ go build wiki.go
+$ ./wiki
+
+ +

+(If you're using Windows you must type "wiki" without the +"./" to run the program.) +

+ +

+With this web server running, a visit to http://localhost:8080/view/test +should show a page titled "test" containing the words "Hello world". +

+ +

Editing Pages

+ +

+A wiki is not a wiki without the ability to edit pages. Let's create two new +handlers: one named editHandler to display an 'edit page' form, +and the other named saveHandler to save the data entered via the +form. +

+ +

+First, we add them to main(): +

+ +{{code "doc/articles/wiki/final-noclosure.go" `/^func main/` `/^}/`}} + +

+The function editHandler loads the page +(or, if it doesn't exist, create an empty Page struct), +and displays an HTML form. +

+ +{{code "doc/articles/wiki/notemplate.go" `/^func editHandler/` `/^}/`}} + +

+This function will work fine, but all that hard-coded HTML is ugly. +Of course, there is a better way. +

+ +

The html/template package

+ +

+The html/template package is part of the Go standard library. +We can use html/template to keep the HTML in a separate file, +allowing us to change the layout of our edit page without modifying the +underlying Go code. +

+ +

+First, we must add html/template to the list of imports. We +also won't be using fmt anymore, so we have to remove that. +

+ +
+import (
+	"html/template"
+	"io/ioutil"
+	"net/http"
+)
+
+ +

+Let's create a template file containing the HTML form. +Open a new file named edit.html, and add the following lines: +

+ +{{code "doc/articles/wiki/edit.html"}} + +

+Modify editHandler to use the template, instead of the hard-coded +HTML: +

+ +{{code "doc/articles/wiki/final-noerror.go" `/^func editHandler/` `/^}/`}} + +

+The function template.ParseFiles will read the contents of +edit.html and return a *template.Template. +

+ +

+The method t.Execute executes the template, writing the +generated HTML to the http.ResponseWriter. +The .Title and .Body dotted identifiers refer to +p.Title and p.Body. +

+ +

+Template directives are enclosed in double curly braces. +The printf "%s" .Body instruction is a function call +that outputs .Body as a string instead of a stream of bytes, +the same as a call to fmt.Printf. +The html/template package helps guarantee that only safe and +correct-looking HTML is generated by template actions. For instance, it +automatically escapes any greater than sign (>), replacing it +with &gt;, to make sure user data does not corrupt the form +HTML. +

+ +

+Since we're working with templates now, let's create a template for our +viewHandler called view.html: +

+ +{{code "doc/articles/wiki/view.html"}} + +

+Modify viewHandler accordingly: +

+ +{{code "doc/articles/wiki/final-noerror.go" `/^func viewHandler/` `/^}/`}} + +

+Notice that we've used almost exactly the same templating code in both +handlers. Let's remove this duplication by moving the templating code +to its own function: +

+ +{{code "doc/articles/wiki/final-template.go" `/^func renderTemplate/` `/^}/`}} + +

+And modify the handlers to use that function: +

+ +{{code "doc/articles/wiki/final-template.go" `/^func viewHandler/` `/^}/`}} +{{code "doc/articles/wiki/final-template.go" `/^func editHandler/` `/^}/`}} + +

+If we comment out the registration of our unimplemented save handler in +main, we can once again build and test our program. +Click here to view the code we've written so far. +

+ +

Handling non-existent pages

+ +

+What if you visit +/view/APageThatDoesntExist? You'll see a page containing +HTML. This is because it ignores the error return value from +loadPage and continues to try and fill out the template +with no data. Instead, if the requested Page doesn't exist, it should +redirect the client to the edit Page so the content may be created: +

+ +{{code "doc/articles/wiki/part3-errorhandling.go" `/^func viewHandler/` `/^}/`}} + +

+The http.Redirect function adds an HTTP status code of +http.StatusFound (302) and a Location +header to the HTTP response. +

+ +

Saving Pages

+ +

+The function saveHandler will handle the submission of forms +located on the edit pages. After uncommenting the related line in +main, let's implement the handler: +

+ +{{code "doc/articles/wiki/final-template.go" `/^func saveHandler/` `/^}/`}} + +

+The page title (provided in the URL) and the form's only field, +Body, are stored in a new Page. +The save() method is then called to write the data to a file, +and the client is redirected to the /view/ page. +

+ +

+The value returned by FormValue is of type string. +We must convert that value to []byte before it will fit into +the Page struct. We use []byte(body) to perform +the conversion. +

+ +

Error handling

+ +

+There are several places in our program where errors are being ignored. This +is bad practice, not least because when an error does occur the program will +have unintended behavior. A better solution is to handle the errors and return +an error message to the user. That way if something does go wrong, the server +will function exactly how we want and the user can be notified. +

+ +

+First, let's handle the errors in renderTemplate: +

+ +{{code "doc/articles/wiki/final-parsetemplate.go" `/^func renderTemplate/` `/^}/`}} + +

+The http.Error function sends a specified HTTP response code +(in this case "Internal Server Error") and error message. +Already the decision to put this in a separate function is paying off. +

+ +

+Now let's fix up saveHandler: +

+ +{{code "doc/articles/wiki/part3-errorhandling.go" `/^func saveHandler/` `/^}/`}} + +

+Any errors that occur during p.save() will be reported +to the user. +

+ +

Template caching

+ +

+There is an inefficiency in this code: renderTemplate calls +ParseFiles every time a page is rendered. +A better approach would be to call ParseFiles once at program +initialization, parsing all templates into a single *Template. +Then we can use the +ExecuteTemplate +method to render a specific template. +

+ +

+First we create a global variable named templates, and initialize +it with ParseFiles. +

+ +{{code "doc/articles/wiki/final.go" `/var templates/`}} + +

+The function template.Must is a convenience wrapper that panics +when passed a non-nil error value, and otherwise returns the +*Template unaltered. A panic is appropriate here; if the templates +can't be loaded the only sensible thing to do is exit the program. +

+ +

+The ParseFiles function takes any number of string arguments that +identify our template files, and parses those files into templates that are +named after the base file name. If we were to add more templates to our +program, we would add their names to the ParseFiles call's +arguments. +

+ +

+We then modify the renderTemplate function to call the +templates.ExecuteTemplate method with the name of the appropriate +template: +

+ +{{code "doc/articles/wiki/final.go" `/func renderTemplate/` `/^}/`}} + +

+Note that the template name is the template file name, so we must +append ".html" to the tmpl argument. +

+ +

Validation

+ +

+As you may have observed, this program has a serious security flaw: a user +can supply an arbitrary path to be read/written on the server. To mitigate +this, we can write a function to validate the title with a regular expression. +

+ +

+First, add "regexp" to the import list. +Then we can create a global variable to store our validation +expression: +

+ +{{code "doc/articles/wiki/final-noclosure.go" `/^var validPath/`}} + +

+The function regexp.MustCompile will parse and compile the +regular expression, and return a regexp.Regexp. +MustCompile is distinct from Compile in that it will +panic if the expression compilation fails, while Compile returns +an error as a second parameter. +

+ +

+Now, let's write a function that uses the validPath +expression to validate path and extract the page title: +

+ +{{code "doc/articles/wiki/final-noclosure.go" `/func getTitle/` `/^}/`}} + +

+If the title is valid, it will be returned along with a nil +error value. If the title is invalid, the function will write a +"404 Not Found" error to the HTTP connection, and return an error to the +handler. To create a new error, we have to import the errors +package. +

+ +

+Let's put a call to getTitle in each of the handlers: +

+ +{{code "doc/articles/wiki/final-noclosure.go" `/^func viewHandler/` `/^}/`}} +{{code "doc/articles/wiki/final-noclosure.go" `/^func editHandler/` `/^}/`}} +{{code "doc/articles/wiki/final-noclosure.go" `/^func saveHandler/` `/^}/`}} + +

Introducing Function Literals and Closures

+ +

+Catching the error condition in each handler introduces a lot of repeated code. +What if we could wrap each of the handlers in a function that does this +validation and error checking? Go's +function +literals provide a powerful means of abstracting functionality +that can help us here. +

+ +

+First, we re-write the function definition of each of the handlers to accept +a title string: +

+ +
+func viewHandler(w http.ResponseWriter, r *http.Request, title string)
+func editHandler(w http.ResponseWriter, r *http.Request, title string)
+func saveHandler(w http.ResponseWriter, r *http.Request, title string)
+
+ +

+Now let's define a wrapper function that takes a function of the above +type, and returns a function of type http.HandlerFunc +(suitable to be passed to the function http.HandleFunc): +

+ +
+func makeHandler(fn func (http.ResponseWriter, *http.Request, string)) http.HandlerFunc {
+	return func(w http.ResponseWriter, r *http.Request) {
+		// Here we will extract the page title from the Request,
+		// and call the provided handler 'fn'
+	}
+}
+
+ +

+The returned function is called a closure because it encloses values defined +outside of it. In this case, the variable fn (the single argument +to makeHandler) is enclosed by the closure. The variable +fn will be one of our save, edit, or view handlers. +

+ +

+Now we can take the code from getTitle and use it here +(with some minor modifications): +

+ +{{code "doc/articles/wiki/final.go" `/func makeHandler/` `/^}/`}} + +

+The closure returned by makeHandler is a function that takes +an http.ResponseWriter and http.Request (in other +words, an http.HandlerFunc). +The closure extracts the title from the request path, and +validates it with the TitleValidator regexp. If the +title is invalid, an error will be written to the +ResponseWriter using the http.NotFound function. +If the title is valid, the enclosed handler function +fn will be called with the ResponseWriter, +Request, and title as arguments. +

+ +

+Now we can wrap the handler functions with makeHandler in +main, before they are registered with the http +package: +

+ +{{code "doc/articles/wiki/final.go" `/func main/` `/^}/`}} + +

+Finally we remove the calls to getTitle from the handler functions, +making them much simpler: +

+ +{{code "doc/articles/wiki/final.go" `/^func viewHandler/` `/^}/`}} +{{code "doc/articles/wiki/final.go" `/^func editHandler/` `/^}/`}} +{{code "doc/articles/wiki/final.go" `/^func saveHandler/` `/^}/`}} + +

Try it out!

+ +

+Click here to view the final code listing. +

+ +

+Recompile the code, and run the app: +

+ +
+$ go build wiki.go
+$ ./wiki
+
+ +

+Visiting http://localhost:8080/view/ANewPage +should present you with the page edit form. You should then be able to +enter some text, click 'Save', and be redirected to the newly created page. +

+ +

Other tasks

+ +

+Here are some simple tasks you might want to tackle on your own: +

+ +
    +
  • Store templates in tmpl/ and page data in data/. +
  • Add a handler to make the web root redirect to + /view/FrontPage.
  • +
  • Spruce up the page templates by making them valid HTML and adding some + CSS rules.
  • +
  • Implement inter-page linking by converting instances of + [PageName] to
    + <a href="/view/PageName">PageName</a>. + (hint: you could use regexp.ReplaceAllFunc to do this) +
  • +
diff --git a/doc/articles/wiki/notemplate.go b/doc/articles/wiki/notemplate.go new file mode 100644 index 0000000000000000000000000000000000000000..be214d1111d6b6ffed44229f7799c39f2d47601e --- /dev/null +++ b/doc/articles/wiki/notemplate.go @@ -0,0 +1,56 @@ +// Copyright 2010 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +import ( + "fmt" + "io/ioutil" + "net/http" +) + +type Page struct { + Title string + Body []byte +} + +func (p *Page) save() error { + filename := p.Title + ".txt" + return ioutil.WriteFile(filename, p.Body, 0600) +} + +func loadPage(title string) (*Page, error) { + filename := title + ".txt" + body, err := ioutil.ReadFile(filename) + if err != nil { + return nil, err + } + return &Page{Title: title, Body: body}, nil +} + +func viewHandler(w http.ResponseWriter, r *http.Request) { + title := r.URL.Path[len("/view/"):] + p, _ := loadPage(title) + fmt.Fprintf(w, "

%s

%s
", p.Title, p.Body) +} + +func editHandler(w http.ResponseWriter, r *http.Request) { + title := r.URL.Path[len("/edit/"):] + p, err := loadPage(title) + if err != nil { + p = &Page{Title: title} + } + fmt.Fprintf(w, "

Editing %s

"+ + "
"+ + "
"+ + ""+ + "
", + p.Title, p.Title, p.Body) +} + +func main() { + http.HandleFunc("/view/", viewHandler) + http.HandleFunc("/edit/", editHandler) + http.ListenAndServe(":8080", nil) +} diff --git a/doc/articles/wiki/part1-noerror.go b/doc/articles/wiki/part1-noerror.go new file mode 100644 index 0000000000000000000000000000000000000000..7577b7b46839375cf5d7e3f2cefa74ade9e823c7 --- /dev/null +++ b/doc/articles/wiki/part1-noerror.go @@ -0,0 +1,33 @@ +// Copyright 2010 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +import ( + "fmt" + "io/ioutil" +) + +type Page struct { + Title string + Body []byte +} + +func (p *Page) save() error { + filename := p.Title + ".txt" + return ioutil.WriteFile(filename, p.Body, 0600) +} + +func loadPage(title string) *Page { + filename := title + ".txt" + body, _ := ioutil.ReadFile(filename) + return &Page{Title: title, Body: body} +} + +func main() { + p1 := &Page{Title: "TestPage", Body: []byte("This is a sample page.")} + p1.save() + p2 := loadPage("TestPage") + fmt.Println(string(p2.Body)) +} diff --git a/doc/articles/wiki/part1.go b/doc/articles/wiki/part1.go new file mode 100644 index 0000000000000000000000000000000000000000..d7bf1be974b2362192e34bf4d5c8d3173179c320 --- /dev/null +++ b/doc/articles/wiki/part1.go @@ -0,0 +1,36 @@ +// Copyright 2010 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +import ( + "fmt" + "io/ioutil" +) + +type Page struct { + Title string + Body []byte +} + +func (p *Page) save() error { + filename := p.Title + ".txt" + return ioutil.WriteFile(filename, p.Body, 0600) +} + +func loadPage(title string) (*Page, error) { + filename := title + ".txt" + body, err := ioutil.ReadFile(filename) + if err != nil { + return nil, err + } + return &Page{Title: title, Body: body}, nil +} + +func main() { + p1 := &Page{Title: "TestPage", Body: []byte("This is a sample Page.")} + p1.save() + p2, _ := loadPage("TestPage") + fmt.Println(string(p2.Body)) +} diff --git a/doc/articles/wiki/part2.go b/doc/articles/wiki/part2.go new file mode 100644 index 0000000000000000000000000000000000000000..c0231693efbd29373a1a05c2bedd2b2812eadb04 --- /dev/null +++ b/doc/articles/wiki/part2.go @@ -0,0 +1,41 @@ +// Copyright 2010 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +import ( + "fmt" + "io/ioutil" + "net/http" +) + +type Page struct { + Title string + Body []byte +} + +func (p *Page) save() error { + filename := p.Title + ".txt" + return ioutil.WriteFile(filename, p.Body, 0600) +} + +func loadPage(title string) (*Page, error) { + filename := title + ".txt" + body, err := ioutil.ReadFile(filename) + if err != nil { + return nil, err + } + return &Page{Title: title, Body: body}, nil +} + +func viewHandler(w http.ResponseWriter, r *http.Request) { + title := r.URL.Path[len("/view/"):] + p, _ := loadPage(title) + fmt.Fprintf(w, "

%s

%s
", p.Title, p.Body) +} + +func main() { + http.HandleFunc("/view/", viewHandler) + http.ListenAndServe(":8080", nil) +} diff --git a/doc/articles/wiki/part3-errorhandling.go b/doc/articles/wiki/part3-errorhandling.go new file mode 100644 index 0000000000000000000000000000000000000000..bb4ecda84bb90d3015a97d70f333587a77160454 --- /dev/null +++ b/doc/articles/wiki/part3-errorhandling.go @@ -0,0 +1,73 @@ +// Copyright 2010 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +import ( + "html/template" + "io/ioutil" + "net/http" +) + +type Page struct { + Title string + Body []byte +} + +func (p *Page) save() error { + filename := p.Title + ".txt" + return ioutil.WriteFile(filename, p.Body, 0600) +} + +func loadPage(title string) (*Page, error) { + filename := title + ".txt" + body, err := ioutil.ReadFile(filename) + if err != nil { + return nil, err + } + return &Page{Title: title, Body: body}, nil +} + +func renderTemplate(w http.ResponseWriter, tmpl string, p *Page) { + t, _ := template.ParseFiles(tmpl + ".html") + t.Execute(w, p) +} + +func viewHandler(w http.ResponseWriter, r *http.Request) { + title := r.URL.Path[len("/view/"):] + p, err := loadPage(title) + if err != nil { + http.Redirect(w, r, "/edit/"+title, http.StatusFound) + return + } + renderTemplate(w, "view", p) +} + +func editHandler(w http.ResponseWriter, r *http.Request) { + title := r.URL.Path[len("/edit/"):] + p, err := loadPage(title) + if err != nil { + p = &Page{Title: title} + } + renderTemplate(w, "edit", p) +} + +func saveHandler(w http.ResponseWriter, r *http.Request) { + title := r.URL.Path[len("/save/"):] + body := r.FormValue("body") + p := &Page{Title: title, Body: []byte(body)} + err := p.save() + if err != nil { + http.Error(w, err.Error(), http.StatusInternalServerError) + return + } + http.Redirect(w, r, "/view/"+title, http.StatusFound) +} + +func main() { + http.HandleFunc("/view/", viewHandler) + http.HandleFunc("/edit/", editHandler) + http.HandleFunc("/save/", saveHandler) + http.ListenAndServe(":8080", nil) +} diff --git a/doc/articles/wiki/part3.go b/doc/articles/wiki/part3.go new file mode 100644 index 0000000000000000000000000000000000000000..174f3abcd76fa94c7979a7c63aca2e1729660d61 --- /dev/null +++ b/doc/articles/wiki/part3.go @@ -0,0 +1,57 @@ +// Copyright 2010 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +import ( + "html/template" + "io/ioutil" + "net/http" +) + +type Page struct { + Title string + Body []byte +} + +func (p *Page) save() error { + filename := p.Title + ".txt" + return ioutil.WriteFile(filename, p.Body, 0600) +} + +func loadPage(title string) (*Page, error) { + filename := title + ".txt" + body, err := ioutil.ReadFile(filename) + if err != nil { + return nil, err + } + return &Page{Title: title, Body: body}, nil +} + +func renderTemplate(w http.ResponseWriter, tmpl string, p *Page) { + t, _ := template.ParseFiles(tmpl + ".html") + t.Execute(w, p) +} + +func viewHandler(w http.ResponseWriter, r *http.Request) { + title := r.URL.Path[len("/view/"):] + p, _ := loadPage(title) + renderTemplate(w, "view", p) +} + +func editHandler(w http.ResponseWriter, r *http.Request) { + title := r.URL.Path[len("/edit/"):] + p, err := loadPage(title) + if err != nil { + p = &Page{Title: title} + } + renderTemplate(w, "edit", p) +} + +func main() { + http.HandleFunc("/view/", viewHandler) + http.HandleFunc("/edit/", editHandler) + //http.HandleFunc("/save/", saveHandler) + http.ListenAndServe(":8080", nil) +} diff --git a/doc/articles/wiki/test.bash b/doc/articles/wiki/test.bash new file mode 100755 index 0000000000000000000000000000000000000000..8bbb7347501bf9a9a60d4a65a77b1e38f6aa1508 --- /dev/null +++ b/doc/articles/wiki/test.bash @@ -0,0 +1,58 @@ +#!/usr/bin/env bash +# Copyright 2010 The Go Authors. All rights reserved. +# Use of this source code is governed by a BSD-style +# license that can be found in the LICENSE file. + +set -e + +if ! which patch > /dev/null; then + echo "Skipping test; patch command not found." + exit 0 +fi + +wiki_pid= +cleanup() { + kill $wiki_pid + rm -f test_*.out Test.txt final-test.go final-test.bin final-test-port.txt a.out get.bin +} +trap cleanup 0 INT + +rm -f get.bin final-test.bin a.out + +# If called with -all, check that all code snippets compile. +if [ "$1" == "-all" ]; then + for fn in *.go; do + go build -o a.out $fn + done +fi + +go build -o get.bin get.go +cp final.go final-test.go +patch final-test.go final-test.patch > /dev/null +go build -o final-test.bin final-test.go +./final-test.bin & +wiki_pid=$! + +l=0 +while [ ! -f ./final-test-port.txt ] +do + l=$(($l+1)) + if [ "$l" -gt 5 ] + then + echo "port not available within 5 seconds" + exit 1 + break + fi + sleep 1 +done + +addr=$(cat final-test-port.txt) +./get.bin http://$addr/edit/Test > test_edit.out +diff -u test_edit.out test_edit.good +./get.bin -post=body=some%20content http://$addr/save/Test > test_save.out +diff -u test_save.out test_view.good # should be the same as viewing +diff -u Test.txt test_Test.txt.good +./get.bin http://$addr/view/Test > test_view.out +diff -u test_view.out test_view.good + +echo PASS diff --git a/doc/articles/wiki/test_Test.txt.good b/doc/articles/wiki/test_Test.txt.good new file mode 100644 index 0000000000000000000000000000000000000000..f0eec86f614944a81f87d879ebdc9a79aea0d7ea --- /dev/null +++ b/doc/articles/wiki/test_Test.txt.good @@ -0,0 +1 @@ +some content \ No newline at end of file diff --git a/doc/articles/wiki/test_edit.good b/doc/articles/wiki/test_edit.good new file mode 100644 index 0000000000000000000000000000000000000000..36c6dbb7322509dc35995a17b139ba884a3567fd --- /dev/null +++ b/doc/articles/wiki/test_edit.good @@ -0,0 +1,6 @@ +

Editing Test

+ +
+
+
+
diff --git a/doc/articles/wiki/test_view.good b/doc/articles/wiki/test_view.good new file mode 100644 index 0000000000000000000000000000000000000000..07e8edb22e83a87827bb5366a6356030c9462bd9 --- /dev/null +++ b/doc/articles/wiki/test_view.good @@ -0,0 +1,5 @@ +

Test

+ +

[edit]

+ +
some content
diff --git a/doc/articles/wiki/view.html b/doc/articles/wiki/view.html new file mode 100644 index 0000000000000000000000000000000000000000..b1e87efe80652fa9a41e030c1f2b6cf427cc945b --- /dev/null +++ b/doc/articles/wiki/view.html @@ -0,0 +1,5 @@ +

{{.Title}}

+ +

[edit]

+ +
{{printf "%s" .Body}}
diff --git a/doc/asm.html b/doc/asm.html new file mode 100644 index 0000000000000000000000000000000000000000..c992e14ade592275d5bb4c6c8e4fdc50e1cbd241 --- /dev/null +++ b/doc/asm.html @@ -0,0 +1,798 @@ + + +

A Quick Guide to Go's Assembler

+ +

+This document is a quick outline of the unusual form of assembly language used by the gc Go compiler. +The document is not comprehensive. +

+ +

+The assembler is based on the input style of the Plan 9 assemblers, which is documented in detail +elsewhere. +If you plan to write assembly language, you should read that document although much of it is Plan 9-specific. +The current document provides a summary of the syntax and the differences with +what is explained in that document, and +describes the peculiarities that apply when writing assembly code to interact with Go. +

+ +

+The most important thing to know about Go's assembler is that it is not a direct representation of the underlying machine. +Some of the details map precisely to the machine, but some do not. +This is because the compiler suite (see +this description) +needs no assembler pass in the usual pipeline. +Instead, the compiler operates on a kind of semi-abstract instruction set, +and instruction selection occurs partly after code generation. +The assembler works on the semi-abstract form, so +when you see an instruction like MOV +what the tool chain actually generates for that operation might +not be a move instruction at all, perhaps a clear or load. +Or it might correspond exactly to the machine instruction with that name. +In general, machine-specific operations tend to appear as themselves, while more general concepts like +memory move and subroutine call and return are more abstract. +The details vary with architecture, and we apologize for the imprecision; the situation is not well-defined. +

+ +

+The assembler program is a way to parse a description of that +semi-abstract instruction set and turn it into instructions to be +input to the linker. +If you want to see what the instructions look like in assembly for a given architecture, say amd64, there +are many examples in the sources of the standard library, in packages such as +runtime and +math/big. +You can also examine what the compiler emits as assembly code +(the actual output may differ from what you see here): +

+ +
+$ cat x.go
+package main
+
+func main() {
+	println(3)
+}
+$ GOOS=linux GOARCH=amd64 go tool compile -S x.go        # or: go build -gcflags -S x.go
+
+--- prog list "main" ---
+0000 (x.go:3) TEXT    main+0(SB),$8-0
+0001 (x.go:3) FUNCDATA $0,gcargs·0+0(SB)
+0002 (x.go:3) FUNCDATA $1,gclocals·0+0(SB)
+0003 (x.go:4) MOVQ    $3,(SP)
+0004 (x.go:4) PCDATA  $0,$8
+0005 (x.go:4) CALL    ,runtime.printint+0(SB)
+0006 (x.go:4) PCDATA  $0,$-1
+0007 (x.go:4) PCDATA  $0,$0
+0008 (x.go:4) CALL    ,runtime.printnl+0(SB)
+0009 (x.go:4) PCDATA  $0,$-1
+0010 (x.go:5) RET     ,
+...
+
+ +

+The FUNCDATA and PCDATA directives contain information +for use by the garbage collector; they are introduced by the compiler. +

+ + + +

Constants

+ +

+Although the assembler takes its guidance from the Plan 9 assemblers, +it is a distinct program, so there are some differences. +One is in constant evaluation. +Constant expressions in the assembler are parsed using Go's operator +precedence, not the C-like precedence of the original. +Thus 3&1<<2 is 4, not 0—it parses as (3&1)<<2 +not 3&(1<<2). +Also, constants are always evaluated as 64-bit unsigned integers. +Thus -2 is not the integer value minus two, +but the unsigned 64-bit integer with the same bit pattern. +The distinction rarely matters but +to avoid ambiguity, division or right shift where the right operand's +high bit is set is rejected. +

+ +

Symbols

+ +

+Some symbols, such as R1 or LR, +are predefined and refer to registers. +The exact set depends on the architecture. +

+ +

+There are four predeclared symbols that refer to pseudo-registers. +These are not real registers, but rather virtual registers maintained by +the tool chain, such as a frame pointer. +The set of pseudo-registers is the same for all architectures: +

+ +
    + +
  • +FP: Frame pointer: arguments and locals. +
  • + +
  • +PC: Program counter: +jumps and branches. +
  • + +
  • +SB: Static base pointer: global symbols. +
  • + +
  • +SP: Stack pointer: top of stack. +
  • + +
+ +

+All user-defined symbols are written as offsets to the pseudo-registers +FP (arguments and locals) and SB (globals). +

+ +

+The SB pseudo-register can be thought of as the origin of memory, so the symbol foo(SB) +is the name foo as an address in memory. +This form is used to name global functions and data. +Adding <> to the name, as in foo<>(SB), makes the name +visible only in the current source file, like a top-level static declaration in a C file. +Adding an offset to the name refers to that offset from the symbol's address, so +a+4(SB) is four bytes past the start of foo. +

+ +

+The FP pseudo-register is a virtual frame pointer +used to refer to function arguments. +The compilers maintain a virtual frame pointer and refer to the arguments on the stack as offsets from that pseudo-register. +Thus 0(FP) is the first argument to the function, +8(FP) is the second (on a 64-bit machine), and so on. +However, when referring to a function argument this way, it is necessary to place a name +at the beginning, as in first_arg+0(FP) and second_arg+8(FP). +(The meaning of the offset—offset from the frame pointer—distinct +from its use with SB, where it is an offset from the symbol.) +The assembler enforces this convention, rejecting plain 0(FP) and 8(FP). +The actual name is semantically irrelevant but should be used to document +the argument's name. +It is worth stressing that FP is always a +pseudo-register, not a hardware +register, even on architectures with a hardware frame pointer. +

+ +

+For assembly functions with Go prototypes, go vet will check that the argument names +and offsets match. +On 32-bit systems, the low and high 32 bits of a 64-bit value are distinguished by adding +a _lo or _hi suffix to the name, as in arg_lo+0(FP) or arg_hi+4(FP). +If a Go prototype does not name its result, the expected assembly name is ret. +

+ +

+The SP pseudo-register is a virtual stack pointer +used to refer to frame-local variables and the arguments being +prepared for function calls. +It points to the top of the local stack frame, so references should use negative offsets +in the range [−framesize, 0): +x-8(SP), y-4(SP), and so on. +

+ +

+On architectures with a hardware register named SP, +the name prefix distinguishes +references to the virtual stack pointer from references to the architectural +SP register. +That is, x-8(SP) and -8(SP) +are different memory locations: +the first refers to the virtual stack pointer pseudo-register, +while the second refers to the +hardware's SP register. +

+ +

+On machines where SP and PC are +traditionally aliases for a physical, numbered register, +in the Go assembler the names SP and PC +are still treated specially; +for instance, references to SP require a symbol, +much like FP. +To access the actual hardware register use the true R name. +For example, on the ARM architecture the hardware +SP and PC are accessible as +R13 and R15. +

+ +

+Branches and direct jumps are always written as offsets to the PC, or as +jumps to labels: +

+ +
+label:
+	MOVW $0, R1
+	JMP label
+
+ +

+Each label is visible only within the function in which it is defined. +It is therefore permitted for multiple functions in a file to define +and use the same label names. +Direct jumps and call instructions can target text symbols, +such as name(SB), but not offsets from symbols, +such as name+4(SB). +

+ +

+Instructions, registers, and assembler directives are always in UPPER CASE to remind you +that assembly programming is a fraught endeavor. +(Exception: the g register renaming on ARM.) +

+ +

+In Go object files and binaries, the full name of a symbol is the +package path followed by a period and the symbol name: +fmt.Printf or math/rand.Int. +Because the assembler's parser treats period and slash as punctuation, +those strings cannot be used directly as identifier names. +Instead, the assembler allows the middle dot character U+00B7 +and the division slash U+2215 in identifiers and rewrites them to +plain period and slash. +Within an assembler source file, the symbols above are written as +fmt·Printf and math∕rand·Int. +The assembly listings generated by the compilers when using the -S flag +show the period and slash directly instead of the Unicode replacements +required by the assemblers. +

+ +

+Most hand-written assembly files do not include the full package path +in symbol names, because the linker inserts the package path of the current +object file at the beginning of any name starting with a period: +in an assembly source file within the math/rand package implementation, +the package's Int function can be referred to as ·Int. +This convention avoids the need to hard-code a package's import path in its +own source code, making it easier to move the code from one location to another. +

+ +

Directives

+ +

+The assembler uses various directives to bind text and data to symbol names. +For example, here is a simple complete function definition. The TEXT +directive declares the symbol runtime·profileloop and the instructions +that follow form the body of the function. +The last instruction in a TEXT block must be some sort of jump, usually a RET (pseudo-)instruction. +(If it's not, the linker will append a jump-to-itself instruction; there is no fallthrough in TEXTs.) +After the symbol, the arguments are flags (see below) +and the frame size, a constant (but see below): +

+ +
+TEXT runtime·profileloop(SB),NOSPLIT,$8
+	MOVQ	$runtime·profileloop1(SB), CX
+	MOVQ	CX, 0(SP)
+	CALL	runtime·externalthreadhandler(SB)
+	RET
+
+ +

+In the general case, the frame size is followed by an argument size, separated by a minus sign. +(It's not a subtraction, just idiosyncratic syntax.) +The frame size $24-8 states that the function has a 24-byte frame +and is called with 8 bytes of argument, which live on the caller's frame. +If NOSPLIT is not specified for the TEXT, +the argument size must be provided. +For assembly functions with Go prototypes, go vet will check that the +argument size is correct. +

+ +

+Note that the symbol name uses a middle dot to separate the components and is specified as an offset from the +static base pseudo-register SB. +This function would be called from Go source for package runtime using the +simple name profileloop. +

+ +

+Global data symbols are defined by a sequence of initializing +DATA directives followed by a GLOBL directive. +Each DATA directive initializes a section of the +corresponding memory. +The memory not explicitly initialized is zeroed. +The general form of the DATA directive is + +

+DATA	symbol+offset(SB)/width, value
+
+ +

+which initializes the symbol memory at the given offset and width with the given value. +The DATA directives for a given symbol must be written with increasing offsets. +

+ +

+The GLOBL directive declares a symbol to be global. +The arguments are optional flags and the size of the data being declared as a global, +which will have initial value all zeros unless a DATA directive +has initialized it. +The GLOBL directive must follow any corresponding DATA directives. +

+ +

+For example, +

+ +
+DATA divtab<>+0x00(SB)/4, $0xf4f8fcff
+DATA divtab<>+0x04(SB)/4, $0xe6eaedf0
+...
+DATA divtab<>+0x3c(SB)/4, $0x81828384
+GLOBL divtab<>(SB), RODATA, $64
+
+GLOBL runtime·tlsoffset(SB), NOPTR, $4
+
+ +

+declares and initializes divtab<>, a read-only 64-byte table of 4-byte integer values, +and declares runtime·tlsoffset, a 4-byte, implicitly zeroed variable that +contains no pointers. +

+ +

+There may be one or two arguments to the directives. +If there are two, the first is a bit mask of flags, +which can be written as numeric expressions, added or or-ed together, +or can be set symbolically for easier absorption by a human. +Their values, defined in the standard #include file textflag.h, are: +

+ +
    +
  • +NOPROF = 1 +
    +(For TEXT items.) +Don't profile the marked function. This flag is deprecated. +
  • +
  • +DUPOK = 2 +
    +It is legal to have multiple instances of this symbol in a single binary. +The linker will choose one of the duplicates to use. +
  • +
  • +NOSPLIT = 4 +
    +(For TEXT items.) +Don't insert the preamble to check if the stack must be split. +The frame for the routine, plus anything it calls, must fit in the +spare space at the top of the stack segment. +Used to protect routines such as the stack splitting code itself. +
  • +
  • +RODATA = 8 +
    +(For DATA and GLOBL items.) +Put this data in a read-only section. +
  • +
  • +NOPTR = 16 +
    +(For DATA and GLOBL items.) +This data contains no pointers and therefore does not need to be +scanned by the garbage collector. +
  • +
  • +WRAPPER = 32 +
    +(For TEXT items.) +This is a wrapper function and should not count as disabling recover. +
  • +
  • +NEEDCTXT = 64 +
    +(For TEXT items.) +This function is a closure so it uses its incoming context register. +
  • +
+ +

Runtime Coordination

+ +

+For garbage collection to run correctly, the runtime must know the +location of pointers in all global data and in most stack frames. +The Go compiler emits this information when compiling Go source files, +but assembly programs must define it explicitly. +

+ +

+A data symbol marked with the NOPTR flag (see above) +is treated as containing no pointers to runtime-allocated data. +A data symbol with the RODATA flag +is allocated in read-only memory and is therefore treated +as implicitly marked NOPTR. +A data symbol with a total size smaller than a pointer +is also treated as implicitly marked NOPTR. +It is not possible to define a symbol containing pointers in an assembly source file; +such a symbol must be defined in a Go source file instead. +Assembly source can still refer to the symbol by name +even without DATA and GLOBL directives. +A good general rule of thumb is to define all non-RODATA +symbols in Go instead of in assembly. +

+ +

+Each function also needs annotations giving the location of +live pointers in its arguments, results, and local stack frame. +For an assembly function with no pointer results and +either no local stack frame or no function calls, +the only requirement is to define a Go prototype for the function +in a Go source file in the same package. The name of the assembly +function must not contain the package name component (for example, +function Syscall in package syscall should +use the name ·Syscall instead of the equivalent name +syscall·Syscall in its TEXT directive). +For more complex situations, explicit annotation is needed. +These annotations use pseudo-instructions defined in the standard +#include file funcdata.h. +

+ +

+If a function has no arguments and no results, +the pointer information can be omitted. +This is indicated by an argument size annotation of $n-0 +on the TEXT instruction. +Otherwise, pointer information must be provided by +a Go prototype for the function in a Go source file, +even for assembly functions not called directly from Go. +(The prototype will also let go vet check the argument references.) +At the start of the function, the arguments are assumed +to be initialized but the results are assumed uninitialized. +If the results will hold live pointers during a call instruction, +the function should start by zeroing the results and then +executing the pseudo-instruction GO_RESULTS_INITIALIZED. +This instruction records that the results are now initialized +and should be scanned during stack movement and garbage collection. +It is typically easier to arrange that assembly functions do not +return pointers or do not contain call instructions; +no assembly functions in the standard library use +GO_RESULTS_INITIALIZED. +

+ +

+If a function has no local stack frame, +the pointer information can be omitted. +This is indicated by a local frame size annotation of $0-n +on the TEXT instruction. +The pointer information can also be omitted if the +function contains no call instructions. +Otherwise, the local stack frame must not contain pointers, +and the assembly must confirm this fact by executing the +pseudo-instruction NO_LOCAL_POINTERS. +Because stack resizing is implemented by moving the stack, +the stack pointer may change during any function call: +even pointers to stack data must not be kept in local variables. +

+ +

Architecture-specific details

+ +

+It is impractical to list all the instructions and other details for each machine. +To see what instructions are defined for a given machine, say ARM, +look in the source for the obj support library for +that architecture, located in the directory src/cmd/internal/obj/arm. +In that directory is a file a.out.go; it contains +a long list of constants starting with A, like this: +

+ +
+const (
+	AAND = obj.ABaseARM + obj.A_ARCHSPECIFIC + iota
+	AEOR
+	ASUB
+	ARSB
+	AADD
+	...
+
+ +

+This is the list of instructions and their spellings as known to the assembler and linker for that architecture. +Each instruction begins with an initial capital A in this list, so AAND +represents the bitwise and instruction, +AND (without the leading A), +and is written in assembly source as AND. +The enumeration is mostly in alphabetical order. +(The architecture-independent AXXX, defined in the +cmd/internal/obj package, +represents an invalid instruction). +The sequence of the A names has nothing to do with the actual +encoding of the machine instructions. +The cmd/internal/obj package takes care of that detail. +

+ +

+The instructions for both the 386 and AMD64 architectures are listed in +cmd/internal/obj/x86/a.out.go. +

+ +

+The architectures share syntax for common addressing modes such as +(R1) (register indirect), +4(R1) (register indirect with offset), and +$foo(SB) (absolute address). +The assembler also supports some (not necessarily all) addressing modes +specific to each architecture. +The sections below list these. +

+ +

+One detail evident in the examples from the previous sections is that data in the instructions flows from left to right: +MOVQ $0, CX clears CX. +This rule applies even on architectures where the conventional notation uses the opposite direction. +

+ +

+Here follow some descriptions of key Go-specific details for the supported architectures. +

+ +

32-bit Intel 386

+ +

+The runtime pointer to the g structure is maintained +through the value of an otherwise unused (as far as Go is concerned) register in the MMU. +A OS-dependent macro get_tls is defined for the assembler if the source includes +a special header, go_asm.h: +

+ +
+#include "go_asm.h"
+
+ +

+Within the runtime, the get_tls macro loads its argument register +with a pointer to the g pointer, and the g struct +contains the m pointer. +The sequence to load g and m using CX looks like this: +

+ +
+get_tls(CX)
+MOVL	g(CX), AX     // Move g into AX.
+MOVL	g_m(AX), BX   // Move g.m into BX.
+
+ +

+Addressing modes: +

+ +
    + +
  • +(DI)(BX*2): The location at address DI plus BX*2. +
  • + +
  • +64(DI)(BX*2): The location at address DI plus BX*2 plus 64. +These modes accept only 1, 2, 4, and 8 as scale factors. +
  • + +
+ +

64-bit Intel 386 (a.k.a. amd64)

+ +

+The two architectures behave largely the same at the assembler level. +Assembly code to access the m and g +pointers on the 64-bit version is the same as on the 32-bit 386, +except it uses MOVQ rather than MOVL: +

+ +
+get_tls(CX)
+MOVQ	g(CX), AX     // Move g into AX.
+MOVQ	g_m(AX), BX   // Move g.m into BX.
+
+ +

ARM

+ +

+The registers R10 and R11 +are reserved by the compiler and linker. +

+ +

+R10 points to the g (goroutine) structure. +Within assembler source code, this pointer must be referred to as g; +the name R10 is not recognized. +

+ +

+To make it easier for people and compilers to write assembly, the ARM linker +allows general addressing forms and pseudo-operations like DIV or MOD +that may not be expressible using a single hardware instruction. +It implements these forms as multiple instructions, often using the R11 register +to hold temporary values. +Hand-written assembly can use R11, but doing so requires +being sure that the linker is not also using it to implement any of the other +instructions in the function. +

+ +

+When defining a TEXT, specifying frame size $-4 +tells the linker that this is a leaf function that does not need to save LR on entry. +

+ +

+The name SP always refers to the virtual stack pointer described earlier. +For the hardware register, use R13. +

+ +

+Condition code syntax is to append a period and the one- or two-letter code to the instruction, +as in MOVW.EQ. +Multiple codes may be appended: MOVM.IA.W. +The order of the code modifiers is irrelevant. +

+ +

+Addressing modes: +

+ +
    + +
  • +R0->16 +
    +R0>>16 +
    +R0<<16 +
    +R0@>16: +For <<, left shift R0 by 16 bits. +The other codes are -> (arithmetic right shift), +>> (logical right shift), and +@> (rotate right). +
  • + +
  • +R0->R1 +
    +R0>>R1 +
    +R0<<R1 +
    +R0@>R1: +For <<, left shift R0 by the count in R1. +The other codes are -> (arithmetic right shift), +>> (logical right shift), and +@> (rotate right). + +
  • + +
  • +[R0,g,R12-R15]: For multi-register instructions, the set comprising +R0, g, and R12 through R15 inclusive. +
  • + +
  • +(R5, R6): Destination register pair. +
  • + +
+ +

ARM64

+ +

+The ARM64 port is in an experimental state. +

+ +

+Instruction modifiers are appended to the instruction following a period. +The only modifiers are P (postincrement) and W +(preincrement): +MOVW.P, MOVW.W +

+ +

+Addressing modes: +

+ +
    + +
  • +(R5, R6): Register pair for LDP/STP. +
  • + +
+ +

64-bit PowerPC, a.k.a. ppc64

+ +

+The 64-bit PowerPC port is in an experimental state. +

+ +

+Addressing modes: +

+ +
    + +
  • +(R5)(R6*1): The location at R5 plus R6. It is a scaled +mode as on the x86, but the only scale allowed is 1. +
  • + +
  • +(R5+R6): Alias for (R5)(R6*1) +
  • + +
+ +

Unsupported opcodes

+ +

+The assemblers are designed to support the compiler so not all hardware instructions +are defined for all architectures: if the compiler doesn't generate it, it might not be there. +If you need to use a missing instruction, there are two ways to proceed. +One is to update the assembler to support that instruction, which is straightforward +but only worthwhile if it's likely the instruction will be used again. +Instead, for simple one-off cases, it's possible to use the BYTE +and WORD directives +to lay down explicit data into the instruction stream within a TEXT. +Here's how the 386 runtime defines the 64-bit atomic load function. +

+ +
+// uint64 atomicload64(uint64 volatile* addr);
+// so actually
+// void atomicload64(uint64 *res, uint64 volatile *addr);
+TEXT runtime·atomicload64(SB), NOSPLIT, $0-12
+	MOVL	ptr+0(FP), AX
+	TESTL	$7, AX
+	JZ	2(PC)
+	MOVL	0, AX // crash with nil ptr deref
+	LEAL	ret_lo+4(FP), BX
+	// MOVQ (%EAX), %MM0
+	BYTE $0x0f; BYTE $0x6f; BYTE $0x00
+	// MOVQ %MM0, 0(%EBX)
+	BYTE $0x0f; BYTE $0x7f; BYTE $0x03
+	// EMMS
+	BYTE $0x0F; BYTE $0x77
+	RET
+
diff --git a/doc/cmd.html b/doc/cmd.html new file mode 100644 index 0000000000000000000000000000000000000000..5d20d3887ae96cbb841cfb1e50fd0dce77d5ff3c --- /dev/null +++ b/doc/cmd.html @@ -0,0 +1,109 @@ + + +

+There is a suite of programs to build and process Go source code. +Instead of being run directly, programs in the suite are usually invoked +by the go program. +

+ +

+The most common way to run these programs is as a subcommand of the go program, +for instance as go fmt. Run like this, the command operates on +complete packages of Go source code, with the go program invoking the +underlying binary with arguments appropriate to package-level processing. +

+ +

+The programs can also be run as stand-alone binaries, with unmodified arguments, +using the go tool subcommand, such as go tool vet. +This style of invocation allows, for instance, checking a single source file +rather than an entire package: go tool vet myprogram.go as +compared to go vet mypackage. +Some of the commands, such as yacc, are accessible only through +the go tool subcommand. +

+ +

+Finally the fmt and godoc commands are installed +as regular binaries called gofmt and godoc because +they are so often referenced. +

+ +

+Click on the links for more documentation, invocation methods, and usage details. +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Name    Synopsis
go     +The go program manages Go source code and runs the other +commands listed here. +See the command docs for usage +details. +

+
cgo    Cgo enables the creation of Go packages that call C code.
cover    Cover is a program for creating and analyzing the coverage profiles +generated by "go test -coverprofile".
fix    Fix finds Go programs that use old features of the language and libraries +and rewrites them to use newer ones.
fmt    Fmt formats Go packages, it is also available as an independent +gofmt command with more general options.
godoc    Godoc extracts and generates documentation for Go packages.
vet    Vet examines Go source code and reports suspicious constructs, such as Printf +calls whose arguments do not align with the format string.
yacc    Yacc is a version of yacc that generates parsers implemented in Go.
+ +

+This is an abridged list. See the full command reference +for documentation of the compilers and more. +

diff --git a/doc/code.html b/doc/code.html new file mode 100644 index 0000000000000000000000000000000000000000..8cbfba04a02254a3b2def61c19463bb36a28b023 --- /dev/null +++ b/doc/code.html @@ -0,0 +1,637 @@ + + +

Introduction

+ +

+This document demonstrates the development of a simple Go package and +introduces the go tool, the standard way to fetch, +build, and install Go packages and commands. +

+ +

+The go tool requires you to organize your code in a specific +way. Please read this document carefully. +It explains the simplest way to get up and running with your Go installation. +

+ +

+A similar explanation is available as a +screencast. +

+ + +

Code organization

+ +

Workspaces

+ +

+The go tool is designed to work with open source code maintained +in public repositories. Although you don't need to publish your code, the model +for how the environment is set up works the same whether you do or not. +

+ +

+Go code must be kept inside a workspace. +A workspace is a directory hierarchy with three directories at its root: +

+ +
    +
  • src contains Go source files organized into packages (one package per directory), +
  • pkg contains package objects, and +
  • bin contains executable commands. +
+ +

+The go tool builds source packages and installs the resulting +binaries to the pkg and bin directories. +

+ +

+The src subdirectory typically contains multiple version control +repositories (such as for Git or Mercurial) that track the development of one +or more source packages. +

+ +

+To give you an idea of how a workspace looks in practice, here's an example: +

+ +
+bin/
+    hello                          # command executable
+    outyet                         # command executable
+pkg/
+    linux_amd64/
+        github.com/golang/example/
+            stringutil.a           # package object
+src/
+    github.com/golang/example/
+        .git/                      # Git repository metadata
+	hello/
+	    hello.go               # command source
+	outyet/
+	    main.go                # command source
+	    main_test.go           # test source
+	stringutil/
+	    reverse.go             # package source
+	    reverse_test.go        # test source
+
+ +

+This workspace contains one repository (example) +comprising two commands (hello and outyet) +and one library (stringutil). +

+ +

+A typical workspace would contain many source repositories containing many +packages and commands. Most Go programmers keep all their Go source code +and dependencies in a single workspace. +

+ +

+Commands and libraries are built from different kinds of source packages. +We will discuss the distinction later. +

+ + +

The GOPATH environment variable

+ +

+The GOPATH environment variable specifies the location of your +workspace. It is likely the only environment variable you'll need to set +when developing Go code. +

+ +

+To get started, create a workspace directory and set GOPATH +accordingly. Your workspace can be located wherever you like, but we'll use +$HOME/work in this document. Note that this must not be the +same path as your Go installation. +(Another common setup is to set GOPATH=$HOME.) +

+ +
+$ mkdir $HOME/work
+$ export GOPATH=$HOME/work
+
+ +

+For convenience, add the workspace's bin subdirectory +to your PATH: +

+ +
+$ export PATH=$PATH:$GOPATH/bin
+
+ +

+To learn more about setting up the GOPATH environment variable, +please see +go help gopath +

+ +

Package paths

+ +

+The packages from the standard library are given short paths such as +"fmt" and "net/http". +For your own packages, you must choose a base path that is unlikely to +collide with future additions to the standard library or other external +libraries. +

+ +

+If you keep your code in a source repository somewhere, then you should use the +root of that source repository as your base path. +For instance, if you have a GitHub account at +github.com/user, that should be your base path. +

+ +

+Note that you don't need to publish your code to a remote repository before you +can build it. It's just a good habit to organize your code as if you will +publish it someday. In practice you can choose any arbitrary path name, +as long as it is unique to the standard library and greater Go ecosystem. +

+ +

+We'll use github.com/user as our base path. Create a directory +inside your workspace in which to keep source code: +

+ +
+$ mkdir -p $GOPATH/src/github.com/user
+
+ + +

Your first program

+ +

+To compile and run a simple program, first choose a package path (we'll use +github.com/user/hello) and create a corresponding package directory +inside your workspace: +

+ +
+$ mkdir $GOPATH/src/github.com/user/hello
+
+ +

+Next, create a file named hello.go inside that directory, +containing the following Go code. +

+ +
+package main
+
+import "fmt"
+
+func main() {
+	fmt.Printf("Hello, world.\n")
+}
+
+ +

+Now you can build and install that program with the go tool: +

+ +
+$ go install github.com/user/hello
+
+ +

+Note that you can run this command from anywhere on your system. The +go tool finds the source code by looking for the +github.com/user/hello package inside the workspace specified by +GOPATH. +

+ +

+You can also omit the package path if you run go install from the +package directory: +

+ +
+$ cd $GOPATH/src/github.com/user/hello
+$ go install
+
+ +

+This command builds the hello command, producing an executable +binary. It then installs that binary to the workspace's bin +directory as hello (or, under Windows, hello.exe). +In our example, that will be $GOPATH/bin/hello, which is +$HOME/work/bin/hello. +

+ +

+The go tool will only print output when an error occurs, so if +these commands produce no output they have executed successfully. +

+ +

+You can now run the program by typing its full path at the command line: +

+ +
+$ $GOPATH/bin/hello
+Hello, world.
+
+ +

+Or, as you have added $GOPATH/bin to your PATH, +just type the binary name: +

+ +
+$ hello
+Hello, world.
+
+ +

+If you're using a source control system, now would be a good time to initialize +a repository, add the files, and commit your first change. Again, this step is +optional: you do not need to use source control to write Go code. +

+ +
+$ cd $GOPATH/src/github.com/user/hello
+$ git init
+Initialized empty Git repository in /home/user/work/src/github.com/user/hello/.git/
+$ git add hello.go
+$ git commit -m "initial commit"
+[master (root-commit) 0b4507d] initial commit
+ 1 file changed, 1 insertion(+)
+  create mode 100644 hello.go
+
+ +

+Pushing the code to a remote repository is left as an exercise for the reader. +

+ + +

Your first library

+ +

+Let's write a library and use it from the hello program. +

+ +

+Again, the first step is to choose a package path (we'll use +github.com/user/stringutil) and create the package directory: +

+ +
+$ mkdir $GOPATH/src/github.com/user/stringutil
+
+ +

+Next, create a file named reverse.go in that directory with the +following contents. +

+ +
+// Package stringutil contains utility functions for working with strings.
+package stringutil
+
+// Reverse returns its argument string reversed rune-wise left to right.
+func Reverse(s string) string {
+	r := []rune(s)
+	for i, j := 0, len(r)-1; i < len(r)/2; i, j = i+1, j-1 {
+		r[i], r[j] = r[j], r[i]
+	}
+	return string(r)
+}
+
+ +

+Now, test that the package compiles with go build: +

+ +
+$ go build github.com/user/stringutil
+
+ +

+Or, if you are working in the package's source directory, just: +

+ +
+$ go build
+
+ +

+This won't produce an output file. To do that, you must use go +install, which places the package object inside the pkg +directory of the workspace. +

+ +

+After confirming that the stringutil package builds, +modify your original hello.go (which is in +$GOPATH/src/github.com/user/hello) to use it: +

+ +
+package main
+
+import (
+	"fmt"
+
+	"github.com/user/stringutil"
+)
+
+func main() {
+	fmt.Printf(stringutil.Reverse("!oG ,olleH"))
+}
+
+ +

+Whenever the go tool installs a package or binary, it also +installs whatever dependencies it has. +So when you install the hello program +

+ +
+$ go install github.com/user/hello
+
+ +

+the stringutil package will be installed as well, automatically. +

+ +

+Running the new version of the program, you should see a new, reversed message: +

+ +
+$ hello
+Hello, Go!
+
+ +

+After the steps above, your workspace should look like this: +

+ +
+bin/
+    hello                 # command executable
+pkg/
+    linux_amd64/          # this will reflect your OS and architecture
+        github.com/user/
+            stringutil.a  # package object
+src/
+    github.com/user/
+        hello/
+            hello.go      # command source
+        stringutil/
+            reverse.go    # package source
+
+ +

+Note that go install placed the stringutil.a object +in a directory inside pkg/linux_amd64 that mirrors its source +directory. +This is so that future invocations of the go tool can find the +package object and avoid recompiling the package unnecessarily. +The linux_amd64 part is there to aid in cross-compilation, +and will reflect the operating system and architecture of your system. +

+ +

+Go command executables are statically linked; the package objects need not +be present to run Go programs. +

+ + +

Package names

+ +

+The first statement in a Go source file must be +

+ +
+package name
+
+ +

+where name is the package's default name for imports. +(All files in a package must use the same name.) +

+ +

+Go's convention is that the package name is the last element of the +import path: the package imported as "crypto/rot13" +should be named rot13. +

+ +

+Executable commands must always use package main. +

+ +

+There is no requirement that package names be unique +across all packages linked into a single binary, +only that the import paths (their full file names) be unique. +

+ +

+See Effective Go to learn more about +Go's naming conventions. +

+ + +

Testing

+ +

+Go has a lightweight test framework composed of the go test +command and the testing package. +

+ +

+You write a test by creating a file with a name ending in _test.go +that contains functions named TestXXX with signature +func (t *testing.T). +The test framework runs each such function; +if the function calls a failure function such as t.Error or +t.Fail, the test is considered to have failed. +

+ +

+Add a test to the stringutil package by creating the file +$GOPATH/src/github.com/user/stringutil/reverse_test.go containing +the following Go code. +

+ +
+package stringutil
+
+import "testing"
+
+func TestReverse(t *testing.T) {
+	cases := []struct {
+		in, want string
+	}{
+		{"Hello, world", "dlrow ,olleH"},
+		{"Hello, 世界", "界世 ,olleH"},
+		{"", ""},
+	}
+	for _, c := range cases {
+		got := Reverse(c.in)
+		if got != c.want {
+			t.Errorf("Reverse(%q) == %q, want %q", c.in, got, c.want)
+		}
+	}
+}
+
+ +

+Then run the test with go test: +

+ +
+$ go test github.com/user/stringutil
+ok  	github.com/user/stringutil 0.165s
+
+ +

+As always, if you are running the go tool from the package +directory, you can omit the package path: +

+ +
+$ go test
+ok  	github.com/user/stringutil 0.165s
+
+ +

+Run go help test and see the +testing package documentation for more detail. +

+ + +

Remote packages

+ +

+An import path can describe how to obtain the package source code using a +revision control system such as Git or Mercurial. The go tool uses +this property to automatically fetch packages from remote repositories. +For instance, the examples described in this document are also kept in a +Git repository hosted at GitHub +github.com/golang/example. +If you include the repository URL in the package's import path, +go get will fetch, build, and install it automatically: +

+ +
+$ go get github.com/golang/example/hello
+$ $GOPATH/bin/hello
+Hello, Go examples!
+
+ +

+If the specified package is not present in a workspace, go get +will place it inside the first workspace specified by GOPATH. +(If the package does already exist, go get skips the remote +fetch and behaves the same as go install.) +

+ +

+After issuing the above go get command, the workspace directory +tree should now look like this: +

+ +
+bin/
+    hello                           # command executable
+pkg/
+    linux_amd64/
+        github.com/golang/example/
+            stringutil.a            # package object
+        github.com/user/
+            stringutil.a            # package object
+src/
+    github.com/golang/example/
+	.git/                       # Git repository metadata
+        hello/
+            hello.go                # command source
+        stringutil/
+            reverse.go              # package source
+            reverse_test.go         # test source
+    github.com/user/
+        hello/
+            hello.go                # command source
+        stringutil/
+            reverse.go              # package source
+            reverse_test.go         # test source
+
+ +

+The hello command hosted at GitHub depends on the +stringutil package within the same repository. The imports in +hello.go file use the same import path convention, so the +go get command is able to locate and install the dependent +package, too. +

+ +
+import "github.com/golang/example/stringutil"
+
+ +

+This convention is the easiest way to make your Go packages available for +others to use. +The Go Wiki +and godoc.org +provide lists of external Go projects. +

+ +

+For more information on using remote repositories with the go tool, see +go help importpath. +

+ + +

What's next

+ +

+Subscribe to the +golang-announce +mailing list to be notified when a new stable version of Go is released. +

+ +

+See Effective Go for tips on writing +clear, idiomatic Go code. +

+ +

+Take A Tour of Go to learn the language +proper. +

+ +

+Visit the documentation page for a set of in-depth +articles about the Go language and its libraries and tools. +

+ + +

Getting help

+ +

+For real-time help, ask the helpful gophers in #go-nuts on the +Freenode IRC server. +

+ +

+The official mailing list for discussion of the Go language is +Go Nuts. +

+ +

+Report bugs using the +Go issue tracker. +

diff --git a/doc/codewalk/codewalk.css b/doc/codewalk/codewalk.css new file mode 100644 index 0000000000000000000000000000000000000000..a0814e4d2d4b4e3a0c7b5c1c4216409816a7adcf --- /dev/null +++ b/doc/codewalk/codewalk.css @@ -0,0 +1,234 @@ +/* + Copyright 2010 The Go Authors. All rights reserved. + Use of this source code is governed by a BSD-style + license that can be found in the LICENSE file. +*/ + +#codewalk-main { + text-align: left; + width: 100%; + overflow: auto; +} + +#code-display { + border: 0; + width: 100%; +} + +.setting { + font-size: 8pt; + color: #888888; + padding: 5px; +} + +.hotkey { + text-decoration: underline; +} + +/* Style for Comments (the left-hand column) */ + +#comment-column { + margin: 0pt; + width: 30%; +} + +#comment-column.right { + float: right; +} + +#comment-column.left { + float: left; +} + +#comment-area { + overflow-x: hidden; + overflow-y: auto; +} + +.comment { + cursor: pointer; + font-size: 16px; + border: 2px solid #ba9836; + margin-bottom: 10px; + margin-right: 10px; /* yes, for both .left and .right */ +} + +.comment:last-child { + margin-bottom: 0px; +} + +.right .comment { + margin-left: 10px; +} + +.right .comment.first { +} + +.right .comment.last { +} + +.left .comment.first { +} + +.left .comment.last { +} + +.comment.selected { + border-color: #99b2cb; +} + +.right .comment.selected { + border-left-width: 12px; + margin-left: 0px; +} + +.left .comment.selected { + border-right-width: 12px; + margin-right: 0px; +} + +.comment-link { + display: none; +} + +.comment-title { + font-size: small; + font-weight: bold; + background-color: #fffff0; + padding-right: 10px; + padding-left: 10px; + padding-top: 5px; + padding-bottom: 5px; +} + +.right .comment-title { +} + +.left .comment-title { +} + +.comment.selected .comment-title { + background-color: #f8f8ff; +} + +.comment-text { + overflow: auto; + padding-left: 10px; + padding-right: 10px; + padding-top: 10px; + padding-bottom: 5px; + font-size: small; + line-height: 1.3em; +} + +.comment-text p { + margin-top: 0em; + margin-bottom: 0.5em; +} + +.comment-text p:last-child { + margin-bottom: 0em; +} + +.file-name { + font-size: x-small; + padding-top: 0px; + padding-bottom: 5px; +} + +.hidden-filepaths .file-name { + display: none; +} + +.path-dir { + color: #555; +} + +.path-file { + color: #555; +} + + +/* Style for Code (the right-hand column) */ + +/* Wrapper for the code column to make widths get calculated correctly */ +#code-column { + display: block; + position: relative; + margin: 0pt; + width: 70%; +} + +#code-column.left { + float: left; +} + +#code-column.right { + float: right; +} + +#code-area { + background-color: #f8f8ff; + border: 2px solid #99b2cb; + padding: 5px; +} + +.left #code-area { + margin-right: -1px; +} + +.right #code-area { + margin-left: -1px; +} + +#code-header { + margin-bottom: 5px; +} + +#code { + background-color: white; +} + +code { + font-size: 100%; +} + +.codewalkhighlight { + font-weight: bold; + background-color: #f8f8ff; +} + +#code-display { + margin-top: 0px; + margin-bottom: 0px; +} + +#sizer { + position: absolute; + cursor: col-resize; + left: 0px; + top: 0px; + width: 8px; +} + +/* Style for options (bottom strip) */ + +#code-options { + display: none; +} + +#code-options > span { + padding-right: 20px; +} + +#code-options .selected { + border-bottom: 1px dotted; +} + +#comment-options { + text-align: center; +} + +div#content { + padding-bottom: 0em; +} diff --git a/doc/codewalk/codewalk.js b/doc/codewalk/codewalk.js new file mode 100644 index 0000000000000000000000000000000000000000..7bfcd39384144a5d27b6095f1c47bffd7579842c --- /dev/null +++ b/doc/codewalk/codewalk.js @@ -0,0 +1,305 @@ +// Copyright 2010 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +/** + * A class to hold information about the Codewalk Viewer. + * @param {jQuery} context The top element in whose context the viewer should + * operate. It will not touch any elements above this one. + * @constructor + */ + var CodewalkViewer = function(context) { + this.context = context; + + /** + * The div that contains all of the comments and their controls. + */ + this.commentColumn = this.context.find('#comment-column'); + + /** + * The div that contains the comments proper. + */ + this.commentArea = this.context.find('#comment-area'); + + /** + * The div that wraps the iframe with the code, as well as the drop down menu + * listing the different files. + * @type {jQuery} + */ + this.codeColumn = this.context.find('#code-column'); + + /** + * The div that contains the code but excludes the options strip. + * @type {jQuery} + */ + this.codeArea = this.context.find('#code-area'); + + /** + * The iframe that holds the code (from Sourcerer). + * @type {jQuery} + */ + this.codeDisplay = this.context.find('#code-display'); + + /** + * The overlaid div used as a grab handle for sizing the code/comment panes. + * @type {jQuery} + */ + this.sizer = this.context.find('#sizer'); + + /** + * The full-screen overlay that ensures we don't lose track of the mouse + * while dragging. + * @type {jQuery} + */ + this.overlay = this.context.find('#overlay'); + + /** + * The hidden input field that we use to hold the focus so that we can detect + * shortcut keypresses. + * @type {jQuery} + */ + this.shortcutInput = this.context.find('#shortcut-input'); + + /** + * The last comment that was selected. + * @type {jQuery} + */ + this.lastSelected = null; +}; + +/** + * Minimum width of the comments or code pane, in pixels. + * @type {number} + */ +CodewalkViewer.MIN_PANE_WIDTH = 200; + +/** + * Navigate the code iframe to the given url and update the code popout link. + * @param {string} url The target URL. + * @param {Object} opt_window Window dependency injection for testing only. + */ +CodewalkViewer.prototype.navigateToCode = function(url, opt_window) { + if (!opt_window) opt_window = window; + // Each iframe is represented by two distinct objects in the DOM: an iframe + // object and a window object. These do not expose the same capabilities. + // Here we need to get the window representation to get the location member, + // so we access it directly through window[] since jQuery returns the iframe + // representation. + // We replace location rather than set so as not to create a history for code + // navigation. + opt_window['code-display'].location.replace(url); + var k = url.indexOf('&'); + if (k != -1) url = url.slice(0, k); + k = url.indexOf('fileprint='); + if (k != -1) url = url.slice(k+10, url.length); + this.context.find('#code-popout-link').attr('href', url); +}; + +/** + * Selects the first comment from the list and forces a refresh of the code + * view. + */ +CodewalkViewer.prototype.selectFirstComment = function() { + // TODO(rsc): handle case where there are no comments + var firstSourcererLink = this.context.find('.comment:first'); + this.changeSelectedComment(firstSourcererLink); +}; + +/** + * Sets the target on all links nested inside comments to be _blank. + */ +CodewalkViewer.prototype.targetCommentLinksAtBlank = function() { + this.context.find('.comment a[href], #description a[href]').each(function() { + if (!this.target) this.target = '_blank'; + }); +}; + +/** + * Installs event handlers for all the events we care about. + */ +CodewalkViewer.prototype.installEventHandlers = function() { + var self = this; + + this.context.find('.comment') + .click(function(event) { + if (jQuery(event.target).is('a[href]')) return true; + self.changeSelectedComment(jQuery(this)); + return false; + }); + + this.context.find('#code-selector') + .change(function() {self.navigateToCode(jQuery(this).val());}); + + this.context.find('#description-table .quote-feet.setting') + .click(function() {self.toggleDescription(jQuery(this)); return false;}); + + this.sizer + .mousedown(function(ev) {self.startSizerDrag(ev); return false;}); + this.overlay + .mouseup(function(ev) {self.endSizerDrag(ev); return false;}) + .mousemove(function(ev) {self.handleSizerDrag(ev); return false;}); + + this.context.find('#prev-comment') + .click(function() { + self.changeSelectedComment(self.lastSelected.prev()); return false; + }); + + this.context.find('#next-comment') + .click(function() { + self.changeSelectedComment(self.lastSelected.next()); return false; + }); + + // Workaround for Firefox 2 and 3, which steal focus from the main document + // whenever the iframe content is (re)loaded. The input field is not shown, + // but is a way for us to bring focus back to a place where we can detect + // keypresses. + this.context.find('#code-display') + .load(function(ev) {self.shortcutInput.focus();}); + + jQuery(document).keypress(function(ev) { + switch(ev.which) { + case 110: // 'n' + self.changeSelectedComment(self.lastSelected.next()); + return false; + case 112: // 'p' + self.changeSelectedComment(self.lastSelected.prev()); + return false; + default: // ignore + } + }); + + window.onresize = function() {self.updateHeight();}; +}; + +/** + * Starts dragging the pane sizer. + * @param {Object} ev The mousedown event that started us dragging. + */ +CodewalkViewer.prototype.startSizerDrag = function(ev) { + this.initialCodeWidth = this.codeColumn.width(); + this.initialCommentsWidth = this.commentColumn.width(); + this.initialMouseX = ev.pageX; + this.overlay.show(); +}; + +/** + * Handles dragging the pane sizer. + * @param {Object} ev The mousemove event updating dragging position. + */ +CodewalkViewer.prototype.handleSizerDrag = function(ev) { + var delta = ev.pageX - this.initialMouseX; + if (this.codeColumn.is('.right')) delta = -delta; + var proposedCodeWidth = this.initialCodeWidth + delta; + var proposedCommentWidth = this.initialCommentsWidth - delta; + var mw = CodewalkViewer.MIN_PANE_WIDTH; + if (proposedCodeWidth < mw) delta = mw - this.initialCodeWidth; + if (proposedCommentWidth < mw) delta = this.initialCommentsWidth - mw; + proposedCodeWidth = this.initialCodeWidth + delta; + proposedCommentWidth = this.initialCommentsWidth - delta; + // If window is too small, don't even try to resize. + if (proposedCodeWidth < mw || proposedCommentWidth < mw) return; + this.codeColumn.width(proposedCodeWidth); + this.commentColumn.width(proposedCommentWidth); + this.options.codeWidth = parseInt( + this.codeColumn.width() / + (this.codeColumn.width() + this.commentColumn.width()) * 100); + this.context.find('#code-column-width').text(this.options.codeWidth + '%'); +}; + +/** + * Ends dragging the pane sizer. + * @param {Object} ev The mouseup event that caused us to stop dragging. + */ +CodewalkViewer.prototype.endSizerDrag = function(ev) { + this.overlay.hide(); + this.updateHeight(); +}; + +/** + * Toggles the Codewalk description between being shown and hidden. + * @param {jQuery} target The target that was clicked to trigger this function. + */ +CodewalkViewer.prototype.toggleDescription = function(target) { + var description = this.context.find('#description'); + description.toggle(); + target.find('span').text(description.is(':hidden') ? 'show' : 'hide'); + this.updateHeight(); +}; + +/** + * Changes the side of the window on which the code is shown and saves the + * setting in a cookie. + * @param {string?} codeSide The side on which the code should be, either + * 'left' or 'right'. + */ +CodewalkViewer.prototype.changeCodeSide = function(codeSide) { + var commentSide = codeSide == 'left' ? 'right' : 'left'; + this.context.find('#set-code-' + codeSide).addClass('selected'); + this.context.find('#set-code-' + commentSide).removeClass('selected'); + // Remove previous side class and add new one. + this.codeColumn.addClass(codeSide).removeClass(commentSide); + this.commentColumn.addClass(commentSide).removeClass(codeSide); + this.sizer.css(codeSide, 'auto').css(commentSide, 0); + this.options.codeSide = codeSide; +}; + +/** + * Adds selected class to newly selected comment, removes selected style from + * previously selected comment, changes drop down options so that the correct + * file is selected, and updates the code popout link. + * @param {jQuery} target The target that was clicked to trigger this function. + */ +CodewalkViewer.prototype.changeSelectedComment = function(target) { + var currentFile = target.find('.comment-link').attr('href'); + if (!currentFile) return; + + if (!(this.lastSelected && this.lastSelected.get(0) === target.get(0))) { + if (this.lastSelected) this.lastSelected.removeClass('selected'); + target.addClass('selected'); + this.lastSelected = target; + var targetTop = target.position().top; + var parentTop = target.parent().position().top; + if (targetTop + target.height() > parentTop + target.parent().height() || + targetTop < parentTop) { + var delta = targetTop - parentTop; + target.parent().animate( + {'scrollTop': target.parent().scrollTop() + delta}, + Math.max(delta / 2, 200), 'swing'); + } + var fname = currentFile.match(/(?:select=|fileprint=)\/[^&]+/)[0]; + fname = fname.slice(fname.indexOf('=')+2, fname.length); + this.context.find('#code-selector').val(fname); + this.context.find('#prev-comment').toggleClass( + 'disabled', !target.prev().length); + this.context.find('#next-comment').toggleClass( + 'disabled', !target.next().length); + } + + // Force original file even if user hasn't changed comments since they may + // have nagivated away from it within the iframe without us knowing. + this.navigateToCode(currentFile); +}; + +/** + * Updates the viewer by changing the height of the comments and code so that + * they fit within the height of the window. The function is typically called + * after the user changes the window size. + */ +CodewalkViewer.prototype.updateHeight = function() { + var windowHeight = jQuery(window).height() - 5 // GOK + var areaHeight = windowHeight - this.codeArea.offset().top + var footerHeight = this.context.find('#footer').outerHeight(true) + this.commentArea.height(areaHeight - footerHeight - this.context.find('#comment-options').outerHeight(true)) + var codeHeight = areaHeight - footerHeight - 15 // GOK + this.codeArea.height(codeHeight) + this.codeDisplay.height(codeHeight - this.codeDisplay.offset().top + this.codeArea.offset().top); + this.sizer.height(codeHeight); +}; + +window.initFuncs.push(function() { + var viewer = new CodewalkViewer(jQuery('#codewalk-main')); + viewer.selectFirstComment(); + viewer.targetCommentLinksAtBlank(); + viewer.installEventHandlers(); + viewer.updateHeight(); +}); diff --git a/doc/codewalk/codewalk.xml b/doc/codewalk/codewalk.xml new file mode 100644 index 0000000000000000000000000000000000000000..3496db71d76ceed794ad09c96e8684a877a55815 --- /dev/null +++ b/doc/codewalk/codewalk.xml @@ -0,0 +1,124 @@ + + + + A codewalk is a guided tour through a piece of code. + It consists of a sequence of steps, each typically explaining + a highlighted section of code. +

+ + The godoc web server translates + an XML file like the one in the main window pane into the HTML + page that you're viewing now. +

+ + The codewalk with URL path /doc/codewalk/name + is loaded from the input file $GOROOT/doc/codewalk/name.xml. +

+ + This codewalk explains how to write a codewalk by examining + its own source code, + $GOROOT/doc/codewalk/codewalk.xml, + shown in the main window pane to the left. +
+ + + The codewalk input file is an XML file containing a single + <codewalk> element. + That element's title attribute gives the title + that is used both on the codewalk page and in the codewalk list. + + + + Each step in the codewalk is a <step> element + nested inside the main <codewalk>. + The step element's title attribute gives the step's title, + which is shown in a shaded bar above the main step text. + The element's src attribute specifies the source + code to show in the main window pane and, optionally, a range of + lines to highlight. +

+ + The first step in this codewalk does not highlight any lines: + its src is just a file name. +
+ + + The most complex part of the codewalk specification is + saying what lines to highlight. + Instead of ordinary line numbers, + the codewalk uses an address syntax that makes it possible + to describe the match by its content. + As the file gets edited, this descriptive address has a better + chance to continue to refer to the right section of the file. +

+ + To specify a source line, use a src attribute of the form + filename:address, + where address is an address in the syntax used by the text editors sam and acme. +

+ + The simplest address is a single regular expression. + The highlighted line in the main window pane shows that the + address for the “Title” step was /title=/, + which matches the first instance of that regular expression (title=) in the file. +
+ + + To highlight a range of source lines, the simplest address to use is + a pair of regular expressions + /regexp1/,/regexp2/. + The highlight begins with the line containing the first match for regexp1 + and ends with the line containing the first match for regexp2 + after the end of the match for regexp1. + Ignoring the HTML quoting, + The line containing the first match for regexp1 will be the first one highlighted, + and the line containing the first match for regexp2. +

+ + The address /<step/,/step>/ looks for the first instance of + <step in the file, and then starting after that point, + looks for the first instance of step>. + (Click on the “Steps” step above to see the highlight in action.) + Note that the < and > had to be written + using XML escapes in order to be valid XML. +
+ + + The /regexp/ + and /regexp1/,/regexp2/ + forms suffice for most highlighting. +

+ + The full address syntax is summarized in this table + (an excerpt of Table II from + The text editor sam): +

+ + + + + + + + + + + + + + + + + + + + +
Simple addresses
#nThe empty string after character n
nLine n
/regexp/The first following match of the regular expression
$The null string at the end of the file
Compound addresses
a1+a2The address a2 evaluated starting at the right of a1
a1-a2The address a2 evaluated in the reverse direction starting at the left of a1
a1,a2From the left of a1 to the right of a2 (default 0,$).
+
+ + + +
diff --git a/doc/codewalk/functions.xml b/doc/codewalk/functions.xml new file mode 100644 index 0000000000000000000000000000000000000000..db518dcc06c196a70a1890d90911cfc85228bdb6 --- /dev/null +++ b/doc/codewalk/functions.xml @@ -0,0 +1,105 @@ + + + + Go supports first class functions, higher-order functions, user-defined + function types, function literals, closures, and multiple return values. +

+ + This rich feature set supports a functional programming style in a strongly + typed language. +

+ + In this codewalk we will look at a simple program that simulates a dice game + called Pig and evaluates + basic strategies. +
+ + + Pig is a two-player game played with a 6-sided die. Each turn, you may roll or stay. +
    +
  • If you roll a 1, you lose all points for your turn and play passes to + your opponent. Any other roll adds its value to your turn score.
  • +
  • If you stay, your turn score is added to your total score, and play passes + to your opponent.
  • +
+ + The first person to reach 100 total points wins. +

+ + The score type stores the scores of the current and opposing + players, in addition to the points accumulated during the current turn. +
+ + + In Go, functions can be passed around just like any other value. A function's + type signature describes the types of its arguments and return values. +

+ + The action type is a function that takes a score + and returns the resulting score and whether the current turn is + over. +

+ + If the turn is over, the player and opponent fields + in the resulting score should be swapped, as it is now the other player's + turn. +
+ + + Go functions can return multiple values. +

+ + The functions roll and stay each return a pair of + values. They also match the action type signature. These + action functions define the rules of Pig. +
+ + + A function can use other functions as arguments and return values. +

+ + A strategy is a function that takes a score as input + and returns an action to perform.
+ (Remember, an action is itself a function.) +
+ + + Anonymous functions can be declared in Go, as in this example. Function + literals are closures: they inherit the scope of the function in which they + are declared. +

+ + One basic strategy in Pig is to continue rolling until you have accumulated at + least k points in a turn, and then stay. The argument k is + enclosed by this function literal, which matches the strategy type + signature. +
+ + + We simulate a game of Pig by calling an action to update the + score until one player reaches 100 points. Each + action is selected by calling the strategy function + associated with the current player. + + + + The roundRobin function simulates a tournament and tallies wins. + Each strategy plays each other strategy gamesPerSeries times. + + + + Variadic functions like ratioString take a variable number of + arguments. These arguments are available as a slice inside the function. + + + + The main function defines 100 basic strategies, simulates a round + robin tournament, and then prints the win/loss record of each strategy. +

+ + Among these strategies, staying at 25 is best, but the optimal strategy for + Pig is much more complex. +
+ +
diff --git a/doc/codewalk/markov.go b/doc/codewalk/markov.go new file mode 100644 index 0000000000000000000000000000000000000000..a8f322eb6b26370811ddf88376d5db620a3aa30c --- /dev/null +++ b/doc/codewalk/markov.go @@ -0,0 +1,130 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +/* +Generating random text: a Markov chain algorithm + +Based on the program presented in the "Design and Implementation" chapter +of The Practice of Programming (Kernighan and Pike, Addison-Wesley 1999). +See also Computer Recreations, Scientific American 260, 122 - 125 (1989). + +A Markov chain algorithm generates text by creating a statistical model of +potential textual suffixes for a given prefix. Consider this text: + + I am not a number! I am a free man! + +Our Markov chain algorithm would arrange this text into this set of prefixes +and suffixes, or "chain": (This table assumes a prefix length of two words.) + + Prefix Suffix + + "" "" I + "" I am + I am a + I am not + a free man! + am a free + am not a + a number! I + number! I am + not a number! + +To generate text using this table we select an initial prefix ("I am", for +example), choose one of the suffixes associated with that prefix at random +with probability determined by the input statistics ("a"), +and then create a new prefix by removing the first word from the prefix +and appending the suffix (making the new prefix is "am a"). Repeat this process +until we can't find any suffixes for the current prefix or we exceed the word +limit. (The word limit is necessary as the chain table may contain cycles.) + +Our version of this program reads text from standard input, parsing it into a +Markov chain, and writes generated text to standard output. +The prefix and output lengths can be specified using the -prefix and -words +flags on the command-line. +*/ +package main + +import ( + "bufio" + "flag" + "fmt" + "io" + "math/rand" + "os" + "strings" + "time" +) + +// Prefix is a Markov chain prefix of one or more words. +type Prefix []string + +// String returns the Prefix as a string (for use as a map key). +func (p Prefix) String() string { + return strings.Join(p, " ") +} + +// Shift removes the first word from the Prefix and appends the given word. +func (p Prefix) Shift(word string) { + copy(p, p[1:]) + p[len(p)-1] = word +} + +// Chain contains a map ("chain") of prefixes to a list of suffixes. +// A prefix is a string of prefixLen words joined with spaces. +// A suffix is a single word. A prefix can have multiple suffixes. +type Chain struct { + chain map[string][]string + prefixLen int +} + +// NewChain returns a new Chain with prefixes of prefixLen words. +func NewChain(prefixLen int) *Chain { + return &Chain{make(map[string][]string), prefixLen} +} + +// Build reads text from the provided Reader and +// parses it into prefixes and suffixes that are stored in Chain. +func (c *Chain) Build(r io.Reader) { + br := bufio.NewReader(r) + p := make(Prefix, c.prefixLen) + for { + var s string + if _, err := fmt.Fscan(br, &s); err != nil { + break + } + key := p.String() + c.chain[key] = append(c.chain[key], s) + p.Shift(s) + } +} + +// Generate returns a string of at most n words generated from Chain. +func (c *Chain) Generate(n int) string { + p := make(Prefix, c.prefixLen) + var words []string + for i := 0; i < n; i++ { + choices := c.chain[p.String()] + if len(choices) == 0 { + break + } + next := choices[rand.Intn(len(choices))] + words = append(words, next) + p.Shift(next) + } + return strings.Join(words, " ") +} + +func main() { + // Register command-line flags. + numWords := flag.Int("words", 100, "maximum number of words to print") + prefixLen := flag.Int("prefix", 2, "prefix length in words") + + flag.Parse() // Parse command-line flags. + rand.Seed(time.Now().UnixNano()) // Seed the random number generator. + + c := NewChain(*prefixLen) // Initialize a new Chain. + c.Build(os.Stdin) // Build chains from standard input. + text := c.Generate(*numWords) // Generate text. + fmt.Println(text) // Write text to standard output. +} diff --git a/doc/codewalk/markov.xml b/doc/codewalk/markov.xml new file mode 100644 index 0000000000000000000000000000000000000000..76c448ac32a0f1a3dffba647e44290fbe4b05559 --- /dev/null +++ b/doc/codewalk/markov.xml @@ -0,0 +1,307 @@ + + + + + + This codewalk describes a program that generates random text using + a Markov chain algorithm. The package comment describes the algorithm + and the operation of the program. Please read it before continuing. + + + + A chain consists of a prefix and a suffix. Each prefix is a set + number of words, while a suffix is a single word. + A prefix can have an arbitrary number of suffixes. + To model this data, we use a map[string][]string. + Each map key is a prefix (a string) and its values are + lists of suffixes (a slice of strings, []string). +

+ Here is the example table from the package comment + as modeled by this data structure: +
+map[string][]string{
+	" ":          {"I"},
+	" I":         {"am"},
+	"I am":       {"a", "not"},
+	"a free":     {"man!"},
+	"am a":       {"free"},
+	"am not":     {"a"},
+	"a number!":  {"I"},
+	"number! I":  {"am"},
+	"not a":      {"number!"},
+}
+ While each prefix consists of multiple words, we + store prefixes in the map as a single string. + It would seem more natural to store the prefix as a + []string, but we can't do this with a map because the + key type of a map must implement equality (and slices do not). +

+ Therefore, in most of our code we will model prefixes as a + []string and join the strings together with a space + to generate the map key: +
+Prefix               Map key
+
+[]string{"", ""}     " "
+[]string{"", "I"}    " I"
+[]string{"I", "am"}  "I am"
+
+
+ + + The complete state of the chain table consists of the table itself and + the word length of the prefixes. The Chain struct stores + this data. + + + + The Chain struct has two unexported fields (those that + do not begin with an upper case character), and so we write a + NewChain constructor function that initializes the + chain map with make and sets the + prefixLen field. +

+ This is constructor function is not strictly necessary as this entire + program is within a single package (main) and therefore + there is little practical difference between exported and unexported + fields. We could just as easily write out the contents of this function + when we want to construct a new Chain. + But using these unexported fields is good practice; it clearly denotes + that only methods of Chain and its constructor function should access + those fields. Also, structuring Chain like this means we + could easily move it into its own package at some later date. +
+ + + Since we'll be working with prefixes often, we define a + Prefix type with the concrete type []string. + Defining a named type clearly allows us to be explicit when we are + working with a prefix instead of just a []string. + Also, in Go we can define methods on any named type (not just structs), + so we can add methods that operate on Prefix if we need to. + + + + The first method we define on Prefix is + String. It returns a string representation + of a Prefix by joining the slice elements together with + spaces. We will use this method to generate keys when working with + the chain map. + + + + The Build method reads text from an io.Reader + and parses it into prefixes and suffixes that are stored in the + Chain. +

+ The io.Reader is an + interface type that is widely used by the standard library and + other Go code. Our code uses the + fmt.Fscan function, which + reads space-separated values from an io.Reader. +

+ The Build method returns once the Reader's + Read method returns io.EOF (end of file) + or some other read error occurs. +
+ + + This function does many small reads, which can be inefficient for some + Readers. For efficiency we wrap the provided + io.Reader with + bufio.NewReader to create a + new io.Reader that provides buffering. + + + + At the top of the function we make a Prefix slice + p using the Chain's prefixLen + field as its length. + We'll use this variable to hold the current prefix and mutate it with + each new word we encounter. + + + + In our loop we read words from the Reader into a + string variable s using + fmt.Fscan. Since Fscan uses space to + separate each input value, each call will yield just one word + (including punctuation), which is exactly what we need. +

+ Fscan returns an error if it encounters a read error + (io.EOF, for example) or if it can't scan the requested + value (in our case, a single string). In either case we just want to + stop scanning, so we break out of the loop. +
+ + + The word stored in s is a new suffix. We add the new + prefix/suffix combination to the chain map by computing + the map key with p.String and appending the suffix + to the slice stored under that key. +

+ The built-in append function appends elements to a slice + and allocates new storage when necessary. When the provided slice is + nil, append allocates a new slice. + This behavior conveniently ties in with the semantics of our map: + retrieving an unset key returns the zero value of the value type and + the zero value of []string is nil. + When our program encounters a new prefix (yielding a nil + value in the map) append will allocate a new slice. +

+ For more information about the append function and slices + in general see the + Slices: usage and internals article. +
+ + + Before reading the next word our algorithm requires us to drop the + first word from the prefix and push the current suffix onto the prefix. +

+ When in this state +
+p == Prefix{"I", "am"}
+s == "not" 
+ the new value for p would be +
+p == Prefix{"am", "not"}
+ This operation is also required during text generation so we put + the code to perform this mutation of the slice inside a method on + Prefix named Shift. +
+ + + The Shift method uses the built-in copy + function to copy the last len(p)-1 elements of p to + the start of the slice, effectively moving the elements + one index to the left (if you consider zero as the leftmost index). +
+p := Prefix{"I", "am"}
+copy(p, p[1:])
+// p == Prefix{"am", "am"}
+ We then assign the provided word to the last index + of the slice: +
+// suffix == "not"
+p[len(p)-1] = suffix
+// p == Prefix{"am", "not"}
+
+ + + The Generate method is similar to Build + except that instead of reading words from a Reader + and storing them in a map, it reads words from the map and + appends them to a slice (words). +

+ Generate uses a conditional for loop to generate + up to n words. +
+ + + At each iteration of the loop we retrieve a list of potential suffixes + for the current prefix. We access the chain map at key + p.String() and assign its contents to choices. +

+ If len(choices) is zero we break out of the loop as there + are no potential suffixes for that prefix. + This test also works if the key isn't present in the map at all: + in that case, choices will be nil and the + length of a nil slice is zero. +
+ + + To choose a suffix we use the + rand.Intn function. + It returns a random integer up to (but not including) the provided + value. Passing in len(choices) gives us a random index + into the full length of the list. +

+ We use that index to pick our new suffix, assign it to + next and append it to the words slice. +

+ Next, we Shift the new suffix onto the prefix just as + we did in the Build method. +
+ + + Before returning the generated text as a string, we use the + strings.Join function to join the elements of + the words slice together, separated by spaces. + + + + To make it easy to tweak the prefix and generated text lengths we + use the flag package to parse + command-line flags. +

+ These calls to flag.Int register new flags with the + flag package. The arguments to Int are the + flag name, its default value, and a description. The Int + function returns a pointer to an integer that will contain the + user-supplied value (or the default value if the flag was omitted on + the command-line). +
+ + + The main function begins by parsing the command-line + flags with flag.Parse and seeding the rand + package's random number generator with the current time. +

+ If the command-line flags provided by the user are invalid the + flag.Parse function will print an informative usage + message and terminate the program. +
+ + + To create the new Chain we call NewChain + with the value of the prefix flag. +

+ To build the chain we call Build with + os.Stdin (which implements io.Reader) so + that it will read its input from standard input. +
+ + + Finally, to generate text we call Generate with + the value of the words flag and assigning the result + to the variable text. +

+ Then we call fmt.Println to write the text to standard + output, followed by a carriage return. +
+ + + To use this program, first build it with the + go command: +
+$ go build markov.go
+ And then execute it while piping in some input text: +
+$ echo "a man a plan a canal panama" \
+	| ./markov -prefix=1
+a plan a man a plan a canal panama
+ Here's a transcript of generating some text using the Go distribution's + README file as source material: +
+$ ./markov -words=10 < $GOROOT/README
+This is the source code repository for the Go source
+$ ./markov -prefix=1 -words=10 < $GOROOT/README
+This is the go directory (the one containing this README).
+$ ./markov -prefix=1 -words=10 < $GOROOT/README
+This is the variable if you have just untarred a
+
+ + + The Generate function does a lot of allocations when it + builds the words slice. As an exercise, modify it to + take an io.Writer to which it incrementally writes the + generated text with Fprint. + Aside from being more efficient this makes Generate + more symmetrical to Build. + + +
diff --git a/doc/codewalk/pig.go b/doc/codewalk/pig.go new file mode 100644 index 0000000000000000000000000000000000000000..941daaed162eb4fe72879f6729efcb0b09017c77 --- /dev/null +++ b/doc/codewalk/pig.go @@ -0,0 +1,121 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +import ( + "fmt" + "math/rand" +) + +const ( + win = 100 // The winning score in a game of Pig + gamesPerSeries = 10 // The number of games per series to simulate +) + +// A score includes scores accumulated in previous turns for each player, +// as well as the points scored by the current player in this turn. +type score struct { + player, opponent, thisTurn int +} + +// An action transitions stochastically to a resulting score. +type action func(current score) (result score, turnIsOver bool) + +// roll returns the (result, turnIsOver) outcome of simulating a die roll. +// If the roll value is 1, then thisTurn score is abandoned, and the players' +// roles swap. Otherwise, the roll value is added to thisTurn. +func roll(s score) (score, bool) { + outcome := rand.Intn(6) + 1 // A random int in [1, 6] + if outcome == 1 { + return score{s.opponent, s.player, 0}, true + } + return score{s.player, s.opponent, outcome + s.thisTurn}, false +} + +// stay returns the (result, turnIsOver) outcome of staying. +// thisTurn score is added to the player's score, and the players' roles swap. +func stay(s score) (score, bool) { + return score{s.opponent, s.player + s.thisTurn, 0}, true +} + +// A strategy chooses an action for any given score. +type strategy func(score) action + +// stayAtK returns a strategy that rolls until thisTurn is at least k, then stays. +func stayAtK(k int) strategy { + return func(s score) action { + if s.thisTurn >= k { + return stay + } + return roll + } +} + +// play simulates a Pig game and returns the winner (0 or 1). +func play(strategy0, strategy1 strategy) int { + strategies := []strategy{strategy0, strategy1} + var s score + var turnIsOver bool + currentPlayer := rand.Intn(2) // Randomly decide who plays first + for s.player+s.thisTurn < win { + action := strategies[currentPlayer](s) + s, turnIsOver = action(s) + if turnIsOver { + currentPlayer = (currentPlayer + 1) % 2 + } + } + return currentPlayer +} + +// roundRobin simulates a series of games between every pair of strategies. +func roundRobin(strategies []strategy) ([]int, int) { + wins := make([]int, len(strategies)) + for i := 0; i < len(strategies); i++ { + for j := i + 1; j < len(strategies); j++ { + for k := 0; k < gamesPerSeries; k++ { + winner := play(strategies[i], strategies[j]) + if winner == 0 { + wins[i]++ + } else { + wins[j]++ + } + } + } + } + gamesPerStrategy := gamesPerSeries * (len(strategies) - 1) // no self play + return wins, gamesPerStrategy +} + +// ratioString takes a list of integer values and returns a string that lists +// each value and its percentage of the sum of all values. +// e.g., ratios(1, 2, 3) = "1/6 (16.7%), 2/6 (33.3%), 3/6 (50.0%)" +func ratioString(vals ...int) string { + total := 0 + for _, val := range vals { + total += val + } + s := "" + for _, val := range vals { + if s != "" { + s += ", " + } + pct := 100 * float64(val) / float64(total) + s += fmt.Sprintf("%d/%d (%0.1f%%)", val, total, pct) + } + return s +} + +func main() { + strategies := make([]strategy, win) + for k := range strategies { + strategies[k] = stayAtK(k + 1) + } + wins, games := roundRobin(strategies) + + for k := range strategies { + fmt.Printf("Wins, losses staying at k =% 4d: %s\n", + k+1, ratioString(wins[k], games-wins[k])) + } +} diff --git a/doc/codewalk/popout.png b/doc/codewalk/popout.png new file mode 100644 index 0000000000000000000000000000000000000000..9c0c23638bd536fb1ab1bdc7f11e2d86d7671016 Binary files /dev/null and b/doc/codewalk/popout.png differ diff --git a/doc/codewalk/run b/doc/codewalk/run new file mode 100755 index 0000000000000000000000000000000000000000..afc64c1f91d7764081981e27fc531a9b293997e2 --- /dev/null +++ b/doc/codewalk/run @@ -0,0 +1,21 @@ +#!/usr/bin/env bash +# Copyright 2013 The Go Authors. All rights reserved. +# Use of this source code is governed by a BSD-style +# license that can be found in the LICENSE file. + +set -e + +function fail { + echo FAIL: doc/codewalk/$1 + exit 1 +} + +# markov.xml +echo foo | go run markov.go | grep foo > /dev/null || fail markov + +# functions.xml +go run pig.go | grep 'Wins, losses staying at k = 100: 210/990 (21.2%), 780/990 (78.8%)' > /dev/null || fail pig + +# sharemem.xml: only build the example, as it uses the network +go build urlpoll.go || fail urlpoll +rm -f urlpoll diff --git a/doc/codewalk/sharemem.xml b/doc/codewalk/sharemem.xml new file mode 100644 index 0000000000000000000000000000000000000000..8b47f12b7abc6e256f32f77025dcdfbbd1598b91 --- /dev/null +++ b/doc/codewalk/sharemem.xml @@ -0,0 +1,181 @@ + + + +Go's approach to concurrency differs from the traditional use of +threads and shared memory. Philosophically, it can be summarized: +

+Don't communicate by sharing memory; share memory by communicating. +

+Channels allow you to pass references to data structures between goroutines. +If you consider this as passing around ownership of the data (the ability to +read and write it), they become a powerful and expressive synchronization +mechanism. +

+In this codewalk we will look at a simple program that polls a list of +URLs, checking their HTTP response codes and periodically printing their state. +
+ + +The State type represents the state of a URL. +

+The Pollers send State values to the StateMonitor, +which maintains a map of the current state of each URL. +
+ + +A Resource represents the state of a URL to be polled: the URL itself +and the number of errors encountered since the last successful poll. +

+When the program starts, it allocates one Resource for each URL. +The main goroutine and the Poller goroutines send the Resources to +each other on channels. +
+ + +Each Poller receives Resource pointers from an input channel. +In this program, the convention is that sending a Resource pointer on +a channel passes ownership of the underlying data from the sender +to the receiver. Because of this convention, we know that +no two goroutines will access this Resource at the same time. +This means we don't have to worry about locking to prevent concurrent +access to these data structures. +

+The Poller processes the Resource by calling its Poll method. +

+It sends a State value to the status channel, to inform the StateMonitor +of the result of the Poll. +

+Finally, it sends the Resource pointer to the out channel. This can be +interpreted as the Poller saying "I'm done with this Resource" and +returning ownership of it to the main goroutine. +

+Several goroutines run Pollers, processing Resources in parallel. +
+ + +The Poll method (of the Resource type) performs an HTTP HEAD request +for the Resource's URL and returns the HTTP response's status code. +If an error occurs, Poll logs the message to standard error and returns the +error string instead. + + + +The main function starts the Poller and StateMonitor goroutines +and then loops passing completed Resources back to the pending +channel after appropriate delays. + + + +First, main makes two channels of *Resource, pending and complete. +

+Inside main, a new goroutine sends one Resource per URL to pending +and the main goroutine receives completed Resources from complete. +

+The pending and complete channels are passed to each of the Poller +goroutines, within which they are known as in and out. +
+ + +StateMonitor will initialize and launch a goroutine that stores the state +of each Resource. We will look at this function in detail later. +

+For now, the important thing to note is that it returns a channel of State, +which is saved as status and passed to the Poller goroutines. +
+ + +Now that it has the necessary channels, main launches a number of +Poller goroutines, passing the channels as arguments. +The channels provide the means of communication between the main, Poller, and +StateMonitor goroutines. + + + +To add the initial work to the system, main starts a new goroutine +that allocates and sends one Resource per URL to pending. +

+The new goroutine is necessary because unbuffered channel sends and +receives are synchronous. That means these channel sends will block until +the Pollers are ready to read from pending. +

+Were these sends performed in the main goroutine with fewer Pollers than +channel sends, the program would reach a deadlock situation, because +main would not yet be receiving from complete. +

+Exercise for the reader: modify this part of the program to read a list of +URLs from a file. (You may want to move this goroutine into its own +named function.) +
+ + +When a Poller is done with a Resource, it sends it on the complete channel. +This loop receives those Resource pointers from complete. +For each received Resource, it starts a new goroutine calling +the Resource's Sleep method. Using a new goroutine for each +ensures that the sleeps can happen in parallel. +

+Note that any single Resource pointer may only be sent on either pending or +complete at any one time. This ensures that a Resource is either being +handled by a Poller goroutine or sleeping, but never both simultaneously. +In this way, we share our Resource data by communicating. +
+ + +Sleep calls time.Sleep to pause before sending the Resource to done. +The pause will either be of a fixed length (pollInterval) plus an +additional delay proportional to the number of sequential errors (r.errCount). +

+This is an example of a typical Go idiom: a function intended to run inside +a goroutine takes a channel, upon which it sends its return value +(or other indication of completed state). +
+ + +The StateMonitor receives State values on a channel and periodically +outputs the state of all Resources being polled by the program. + + + +The variable updates is a channel of State, on which the Poller goroutines +send State values. +

+This channel is returned by the function. +
+ + +The variable urlStatus is a map of URLs to their most recent status. + + + +A time.Ticker is an object that repeatedly sends a value on a channel at a +specified interval. +

+In this case, ticker triggers the printing of the current state to +standard output every updateInterval nanoseconds. +
+ + +StateMonitor will loop forever, selecting on two channels: +ticker.C and update. The select statement blocks until one of its +communications is ready to proceed. +

+When StateMonitor receives a tick from ticker.C, it calls logState to +print the current state. When it receives a State update from updates, +it records the new status in the urlStatus map. +

+Notice that this goroutine owns the urlStatus data structure, +ensuring that it can only be accessed sequentially. +This prevents memory corruption issues that might arise from parallel reads +and/or writes to a shared map. +
+ + +In this codewalk we have explored a simple example of using Go's concurrency +primitives to share memory through communication. +

+This should provide a starting point from which to explore the ways in which +goroutines and channels can be used to write expressive and concise concurrent +programs. +
+ +
diff --git a/doc/codewalk/urlpoll.go b/doc/codewalk/urlpoll.go new file mode 100644 index 0000000000000000000000000000000000000000..1fb99581f0c6a097cdd007b04ef2458d2b7901fb --- /dev/null +++ b/doc/codewalk/urlpoll.go @@ -0,0 +1,116 @@ +// Copyright 2010 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +import ( + "log" + "net/http" + "time" +) + +const ( + numPollers = 2 // number of Poller goroutines to launch + pollInterval = 60 * time.Second // how often to poll each URL + statusInterval = 10 * time.Second // how often to log status to stdout + errTimeout = 10 * time.Second // back-off timeout on error +) + +var urls = []string{ + "http://www.google.com/", + "http://golang.org/", + "http://blog.golang.org/", +} + +// State represents the last-known state of a URL. +type State struct { + url string + status string +} + +// StateMonitor maintains a map that stores the state of the URLs being +// polled, and prints the current state every updateInterval nanoseconds. +// It returns a chan State to which resource state should be sent. +func StateMonitor(updateInterval time.Duration) chan<- State { + updates := make(chan State) + urlStatus := make(map[string]string) + ticker := time.NewTicker(updateInterval) + go func() { + for { + select { + case <-ticker.C: + logState(urlStatus) + case s := <-updates: + urlStatus[s.url] = s.status + } + } + }() + return updates +} + +// logState prints a state map. +func logState(s map[string]string) { + log.Println("Current state:") + for k, v := range s { + log.Printf(" %s %s", k, v) + } +} + +// Resource represents an HTTP URL to be polled by this program. +type Resource struct { + url string + errCount int +} + +// Poll executes an HTTP HEAD request for url +// and returns the HTTP status string or an error string. +func (r *Resource) Poll() string { + resp, err := http.Head(r.url) + if err != nil { + log.Println("Error", r.url, err) + r.errCount++ + return err.Error() + } + r.errCount = 0 + return resp.Status +} + +// Sleep sleeps for an appropriate interval (dependent on error state) +// before sending the Resource to done. +func (r *Resource) Sleep(done chan<- *Resource) { + time.Sleep(pollInterval + errTimeout*time.Duration(r.errCount)) + done <- r +} + +func Poller(in <-chan *Resource, out chan<- *Resource, status chan<- State) { + for r := range in { + s := r.Poll() + status <- State{r.url, s} + out <- r + } +} + +func main() { + // Create our input and output channels. + pending, complete := make(chan *Resource), make(chan *Resource) + + // Launch the StateMonitor. + status := StateMonitor(statusInterval) + + // Launch some Poller goroutines. + for i := 0; i < numPollers; i++ { + go Poller(pending, complete, status) + } + + // Send some Resources to the pending queue. + go func() { + for _, url := range urls { + pending <- &Resource{url: url} + } + }() + + for r := range complete { + go r.Sleep(pending) + } +} diff --git a/doc/contrib.html b/doc/contrib.html new file mode 100644 index 0000000000000000000000000000000000000000..f5f6f68b5c91e42c0cd7ecff00407f0e8cf7d406 --- /dev/null +++ b/doc/contrib.html @@ -0,0 +1,115 @@ + + + + +
+ +

+Go is an open source project developed by a team at +Google and many +contributors from the open source community. +

+ +

+Go is distributed under a BSD-style license. +

+ +

Announcements Mailing List

+

+A low traffic mailing list for important announcements, such as new releases. +

+

+We encourage all Go users to subscribe to +golang-announce. +

+ + +

Version history

+ +

Release History

+ +

A summary of the changes between Go releases. Notes for the major releases:

+ + + +

Go 1 and the Future of Go Programs

+

+What Go 1 defines and the backwards-compatibility guarantees one can expect as +Go 1 matures. +

+ + +

Developer Resources

+ +

Source Code

+

Check out the Go source code.

+ +

Developer and +Code Review Mailing List

+

The golang-dev +mailing list is for discussing code changes to the Go project. +The golang-codereviews +mailing list is for actual reviewing of the code changes (CLs).

+ +

For general discussion of Go programming, see golang-nuts.

+ +

Checkins Mailing List

+

A mailing list that receives a message summarizing each checkin to the Go repository.

+ +

Bugs Mailing List

+

A mailing list that receives each update to the Go issue tracker.

+ +

Build Status

+

View the status of Go builds across the supported operating +systems and architectures.

+ + +

How you can help

+ +

Reporting issues

+ +

+If you spot bugs, mistakes, or inconsistencies in the Go project's code or +documentation, please let us know by +filing a ticket +on our issue tracker. +(Of course, you should check it's not an existing issue before creating +a new one.) +

+ +

+We pride ourselves on being meticulous; no issue is too small. +

+ +

+Security-related issues should be reported to +security@golang.org. +See the security policy for more details. +

+ +

Contributing code

+ +

+Go is an open source project and we welcome contributions from the community. +

+

+To get started, read these contribution +guidelines for information on design, testing, and our code review process. +

+

+Check the tracker for +open issues that interest you. Those labeled +helpwanted +are particularly in need of outside help. +

diff --git a/doc/contribute.html b/doc/contribute.html new file mode 100644 index 0000000000000000000000000000000000000000..45ed8f1553bc8ffc1f5b678538d5b54e1e9f2f76 --- /dev/null +++ b/doc/contribute.html @@ -0,0 +1,685 @@ + + +

Introduction

+ +

+This document explains how to contribute changes to the Go project. +It assumes you have followed the +installation instructions and +have written and tested your code. +

+ +

+(Note that the gccgo frontend lives elsewhere; +see Contributing to gccgo.) +

+ +

Discuss your design

+ +

+The project welcomes submissions but please let everyone know what +you're working on if you want to change or add to the Go repositories. +

+ +

+Before undertaking to write something new for the Go project, +please file an issue +(or claim an existing issue). +Significant changes must go through the +change proposal process +before they can be accepted. +

+ +

+This process gives everyone a chance to validate the design, +helps prevent duplication of effort, +and ensures that the idea fits inside the goals for the language and tools. +It also checks that the design is sound before code is written; +the code review tool is not the place for high-level discussions. +

+ +

+When planning work, please note that the Go project follows a +six-month +development cycle. The latter half of each cycle is a three-month +feature freeze during which only bug fixes and doc updates are accepted. +New work cannot be submitted during a feature freeze. +

+ +

Testing redux

+ +

+You've written and tested your code, but +before sending code out for review, run all the tests for the whole +tree to make sure the changes don't break other packages or programs: +

+ +
+$ cd go/src
+$ ./all.bash
+
+ +

+(To build under Windows use all.bat.) +

+ +

+After running for a while, the command should print +"ALL TESTS PASSED". +

+ +

Code review

+ +

+Changes to Go must be reviewed before they are accepted, +no matter who makes the change. +A custom git command called git-codereview, +discussed below, helps manage the code review process through a Google-hosted +instance of the code review +system called Gerrit. +

+ +

Set up authentication for code review

+ +

+Gerrit uses Google Accounts for authentication. If you don't have +a Google Account, you can create an account which +includes +a new Gmail email account or create an account associated +with your existing +email address. +

+ +

+The email address associated with the Google Account you use will be recorded in +the change log +and in the contributors file. +

+ +

+To set up your account in Gerrit, visit +go.googlesource.com +and click on "Generate Password" in the page's top right menu bar. +

+ +

+You will be redirected to accounts.google.com to sign in. +

+ +

+Once signed in, you are returned back to go.googlesource.com to "Configure Git". +Follow the instructions on the page. +(If you are on a Windows computer, you should instead follow the instructions +in the yellow box to run the command.) +

+ +

+Your secret authentication token is now in a .gitcookie file +and Git is configured to use this file. +

+ +

Register with Gerrit

+ +

+Now that you have your authentication token, +you need to register your account with Gerrit. +To do this, visit + +go-review.googlesource.com/login/. You will immediately be redirected +to Google Accounts. Sign in using the same Google Account you used above. +That is all that is required. +

+ +

Contributor License Agreement

+ +

Gerrit serves as the gatekeeper and uses your e-mail address as the key. +To send your first change to the Go project from a given address, +you must have completed one of the contributor license agreements: +

    +
  • +If you are the copyright holder, you will need to agree to the +individual +contributor license agreement, which can be completed online. +
  • +
  • +If your organization is the copyright holder, the organization +will need to agree to the +corporate +contributor license agreement. +(If the copyright holder for your code has already completed the +agreement in connection with another Google open source project, +it does not need to be completed again.) +
  • +
+ +

+You can use the links above to create and sign the contributor license agreement +or you can show your current agreements and create new ones through the Gerrit +interface. Log into Gerrit, +click your name in the upper-right, choose "Settings", then select "Agreements" +from the topics on the left. If you do not have a signed agreement listed here, +you can create one by clicking "New Contributor Agreement" and following the steps. +

+ +

+This rigmarole only needs to be done for your first submission for each email address. +

+ +

Install the git-codereview command

+ +

+Now install the git-codereview command by running, +

+ +
+$ go get -u golang.org/x/review/git-codereview
+
+ +

+Make sure git-codereview is installed in your shell path, so that the +git command can find it. Check that +

+ +
+$ git codereview help
+
+ +

+prints help text, not an error. +

+ +

+Note to Git aficionados: The git-codereview command is not required to +upload and manage Gerrit code reviews. For those who prefer plain Git, the text +below gives the Git equivalent of each git-codereview command. If you do use plain +Git, note that you still need the commit hooks that the git-codereview command +configures; those hooks add a Gerrit Change-Id line to the commit +message and check that all Go source files have been formatted with gofmt. Even +if you intend to use plain Git for daily work, install the hooks in a new Git +checkout by running git-codereview hooks. +

+ +

Set up git aliases

+ +

+The git-codereview command can be run directly from the shell +by typing, for instance, +

+ +
+$ git codereview sync
+
+ +

+but it is more convenient to set up aliases for git-codereview's own +subcommands, so that the above becomes, +

+ +
+$ git sync
+
+ +

+The git-codereview subcommands have been chosen to be distinct from +Git's own, so it's safe to do so. +

+ +

+The aliases are optional, but in the rest of this document we will assume +they are installed. +To install them, copy this text into your Git configuration file +(usually .gitconfig in your home directory): +

+ +
+[alias]
+	change = codereview change
+	gofmt = codereview gofmt
+	mail = codereview mail
+	pending = codereview pending
+	submit = codereview submit
+	sync = codereview sync
+
+ +

Understanding the git-codereview command

+ +

After installing the git-codereview command, you can run

+ +
+$ git codereview help
+
+ +

+to learn more about its commands. +You can also read the command documentation. +

+ +

Switch to the master branch

+ +

+Most Go installations use a release branch, but new changes should +only be made based on the master branch. +(They may be applied later to a release branch as part of the release process, +but most contributors won't do this themselves.) +Before making a change, make sure you start on the master branch: +

+ +
+$ git checkout master
+$ git sync
+
+ +

+(In Git terms, git sync runs +git pull -r.) +

+ +

Make a change

+ +

+The entire checked-out tree is writable. +Once you have edited files, you must tell Git that they have been modified. +You must also tell Git about any files that are added, removed, or renamed files. +These operations are done with the usual Git commands, +git add, +git rm, +and +git mv. +

+ +

+If you wish to checkpoint your work, or are ready to send the code out for review, run

+ +
+$ git change <branch>
+
+ +

+from any directory in your Go repository to commit the changes so far. +The name <branch> is an arbitrary one you choose to identify the +local branch containing your changes. +

+ +

+(In Git terms, git change <branch> +runs git checkout -b branch, +then git branch --set-upstream-to origin/master, +then git commit.) +

+ +

+Git will open a change description file in your editor. +(It uses the editor named by the $EDITOR environment variable, +vi by default.) +The file will look like: +

+ +
+
+# Please enter the commit message for your changes. Lines starting
+# with '#' will be ignored, and an empty message aborts the commit.
+# On branch foo
+# Changes not staged for commit:
+#	modified:   editedfile.go
+#
+
+ +

+At the beginning of this file is a blank line; replace it +with a thorough description of your change. +The first line of the change description is conventionally a one-line +summary of the change, prefixed by the primary affected package, +and is used as the subject for code review mail. +The rest of the +description elaborates and should provide context for the +change and explain what it does. +If there is a helpful reference, mention it here. +

+ +

+After editing, the template might now read: +

+ +
+math: improved Sin, Cos and Tan precision for very large arguments
+
+The existing implementation has poor numerical properties for
+large arguments, so use the McGillicutty algorithm to improve
+accuracy above 1e10.
+
+The algorithm is described at http://wikipedia.org/wiki/McGillicutty_Algorithm
+
+Fixes #159
+
+# Please enter the commit message for your changes. Lines starting
+# with '#' will be ignored, and an empty message aborts the commit.
+# On branch foo
+# Changes not staged for commit:
+#	modified:   editedfile.go
+#
+
+ +

+The commented section of the file lists all the modified files in your client. +It is best to keep unrelated changes in different change lists, +so if you see a file listed that should not be included, abort +the command and move that file to a different branch. +

+ +

+The special notation "Fixes #159" associates the change with issue 159 in the +Go issue tracker. +When this change is eventually submitted, the issue +tracker will automatically mark the issue as fixed. +(There are several such conventions, described in detail in the +GitHub Issue Tracker documentation.) +

+ +

+Once you have finished writing the commit message, +save the file and exit the editor. +

+ +

+If you wish to do more editing, re-stage your changes using +git add, and then run +

+ +
+$ git change
+
+ +

+to update the change description and incorporate the staged changes. The +change description contains a Change-Id line near the bottom, +added by a Git commit hook during the initial +git change. +That line is used by Gerrit to match successive uploads of the same change. +Do not edit or delete it. +

+ +

+(In Git terms, git change with no branch name +runs git commit --amend.) +

+ +

Mail the change for review

+ +

+Once the change is ready, mail it out for review: +

+ +
+$ git mail
+
+ +

+You can specify a reviewer or CC interested parties +using the -r or -cc options. +Both accept a comma-separated list of email addresses: +

+ +
+$ git mail -r joe@golang.org -cc mabel@example.com,math-nuts@swtch.com
+
+ +

+Unless explicitly told otherwise, such as in the discussion leading +up to sending in the change list, it's better not to specify a reviewer. +All changes are automatically CC'ed to the +golang-codereviews@googlegroups.com +mailing list. If this is your first ever change, there may be a moderation +delay before it appears on the mailing list, to prevent spam. +

+ +

+(In Git terms, git mail pushes the local committed +changes to Gerrit using git push origin +HEAD:refs/for/master.) +

+ +

+If your change relates to an open issue, please add a comment to the issue +announcing your proposed fix, including a link to your CL. +

+ +

+The code review server assigns your change an issue number and URL, +which git mail will print, something like: +

+ +
+remote: New Changes:
+remote:   https://go-review.googlesource.com/99999 math: improved Sin, Cos and Tan precision for very large arguments
+
+ +

Reviewing code

+ +

+Running git mail will send an email to you and the +reviewers asking them to visit the issue's URL and make comments on the change. +When done, the reviewer adds comments through the Gerrit user interface +and clicks "Reply" to send comments back. +You will receive a mail notification when this happens. +You must reply through the web interface. +(Unlike with the old Rietveld review system, replying by mail has no effect.) +

+ +

Revise and upload

+ +

+You must respond to review comments through the web interface. +(Unlike with the old Rietveld review system, responding by mail has no effect.) +

+ +

+When you have revised the code and are ready for another round of review, +stage those changes and use git change to update the +commit. +To send the update change list for another round of review, +run git mail again. +

+ +

+The reviewer can comment on the new copy, and the process repeats. +The reviewer approves the change by giving it a positive score +(+1 or +2) and replying LGTM: looks good to me. +

+ +

+You can see a list of your pending changes by running git +pending, and switch between change branches with git +change <branch>. +

+ +

Synchronize your client

+ +

+While you were working, others might have submitted changes to the repository. +To update your local branch, run +

+ +
+$ git sync
+
+ +

+(In git terms, git sync runs +git pull -r.) +

+ +

+If files you were editing have changed, Git does its best to merge the +remote changes into your local changes. +It may leave some files to merge by hand. +

+ +

+For example, suppose you have edited sin.go but +someone else has committed an independent change. +When you run git sync, +you will get the (scary-looking) output: + +

+$ git sync
+Failed to merge in the changes.
+Patch failed at 0023 math: improved Sin, Cos and Tan precision for very large arguments
+The copy of the patch that failed is found in:
+   /home/you/repo/.git/rebase-apply/patch
+
+When you have resolved this problem, run "git rebase --continue".
+If you prefer to skip this patch, run "git rebase --skip" instead.
+To check out the original branch and stop rebasing, run "git rebase --abort".
+
+ +

+If this happens, run +

+ +
+$ git status
+
+ +

+to see which files failed to merge. +The output will look something like this: +

+ +
+rebase in progress; onto a24c3eb
+You are currently rebasing branch 'mcgillicutty' on 'a24c3eb'.
+  (fix conflicts and then run "git rebase --continue")
+  (use "git rebase --skip" to skip this patch)
+  (use "git rebase --abort" to check out the original branch)
+
+Unmerged paths:
+  (use "git reset HEAD <file>..." to unstage)
+  (use "git add <file>..." to mark resolution)
+
+	both modified: sin.go
+
+ +

+The only important part in that transcript is the italicized "both modified" +line: Git failed to merge your changes with the conflicting change. +When this happens, Git leaves both sets of edits in the file, +with conflicts marked by <<<<<<< and +>>>>>>>. +It is now your job to edit the file to combine them. +Continuing the example, searching for those strings in sin.go +might turn up: +

+ +
+	arg = scale(arg)
+<<<<<<< HEAD
+	if arg < 1e9 {
+=======
+	if arg &lh; 1e10 {
+>>>>>>> mcgillicutty
+		largeReduce(arg)
+
+ +

+Git doesn't show it, but suppose the original text that both edits +started with was 1e8; you changed it to 1e10 and the other change to 1e9, +so the correct answer might now be 1e10. First, edit the section +to remove the markers and leave the correct code: +

+ +
+	arg = scale(arg)
+	if arg < 1e10 {
+		largeReduce(arg)
+
+ +

+Then tell Git that the conflict is resolved by running +

+ +
+$ git add sin.go
+
+ +

+If you had been editing the file, say for debugging, but do not +care to preserve your changes, you can run +git reset HEAD sin.go +to abandon your changes. +Then run git rebase --continue to +restore the change commit. +

+ +

Reviewing code by others

+ +

+You can import a change proposed by someone else into your local Git repository. +On the Gerrit review page, click the "Download ▼" link in the upper right +corner, copy the "Checkout" command and run it from your local Git repo. +It should look something like this: +

+ +
+$ git fetch https://go.googlesource.com/review refs/changes/21/1221/1 && git checkout FETCH_HEAD
+
+ +

+To revert, change back to the branch you were working in. +

+ +

Submit the change after the review

+ +

+After the code has been LGTM'ed, an approver may +submit it to the master branch using the Gerrit UI. +There is a "Submit" button on the web page for the change +that appears once the change is approved (marked +2). +

+ +

+This checks the change into the repository. +The change description will include a link to the code review, +and the code review will be updated with a link to the change +in the repository. +Since the method used to integrate the changes is "Cherry Pick", +the commit hashes in the repository will be changed by +the submit operation. +

+ +

More information

+ +

+In addition to the information here, the Go community maintains a CodeReview wiki page. +Feel free to contribute to this page as you learn the review process. +

+ + + +

Files in the Go repository don't list author names, +both to avoid clutter and to avoid having to keep the lists up to date. +Instead, your name will appear in the +change log +and in the CONTRIBUTORS file +and perhaps the AUTHORS file. +

+ +

The CONTRIBUTORS file +defines who the Go contributors—the people—are; +the AUTHORS file defines +who “The Go Authors”—the copyright holders—are. +These files will be periodically updated based on the commit logs. + +

Code that you contribute should use the standard copyright header:

+ +
+// Copyright 2015 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+ +

+Files in the repository are copyright the year they are added. It is not +necessary to update the copyright year on files that you change. +

diff --git a/doc/debugging_with_gdb.html b/doc/debugging_with_gdb.html new file mode 100644 index 0000000000000000000000000000000000000000..836816419532d86b5c92f8aae14a89c7d8de80fa --- /dev/null +++ b/doc/debugging_with_gdb.html @@ -0,0 +1,507 @@ + + +

+This applies to the gc toolchain. Gccgo has native gdb support. +Besides this overview you might want to consult the +GDB manual. +

+ +

+GDB does not understand Go programs well. +The stack management, threading, and runtime contain aspects that differ +enough from the execution model GDB expects that they can confuse +the debugger, even when the program is compiled with gccgo. +As a consequence, although GDB can be useful in some situations, it is +not a reliable debugger for Go programs, particularly heavily concurrent ones. +Moreover, it is not a priority for the Go project to address these issues, which +are difficult. +In short, the instructions below should be taken only as a guide to how +to use GDB when it works, not as a guarantee of success. +

+ +

+In time, a more Go-centric debugging architecture may be required. +

+ +

Introduction

+ +

+When you compile and link your Go programs with the gc toolchain +on Linux, Mac OS X, FreeBSD or NetBSD, the resulting binaries contain DWARFv3 +debugging information that recent versions (>7.1) of the GDB debugger can +use to inspect a live process or a core dump. +

+ +

+Pass the '-w' flag to the linker to omit the debug information +(for example, go build -ldflags "-w" prog.go). +

+ +

+The code generated by the gc compiler includes inlining of +function invocations and registerization of variables. These optimizations +can sometimes make debugging with gdb harder. To disable them +when debugging, pass the flags -gcflags "-N -l" to the +go command used to build the code being +debugged. +

+ +

Common Operations

+ +
    +
  • +Show file and line number for code, set breakpoints and disassemble: +
    (gdb) list
    +(gdb) list line
    +(gdb) list file.go:line
    +(gdb) break line
    +(gdb) break file.go:line
    +(gdb) disas
    +
  • +
  • +Show backtraces and unwind stack frames: +
    (gdb) bt
    +(gdb) frame n
    +
  • +
  • +Show the name, type and location on the stack frame of local variables, +arguments and return values: +
    (gdb) info locals
    +(gdb) info args
    +(gdb) p variable
    +(gdb) whatis variable
    +
  • +
  • +Show the name, type and location of global variables: +
    (gdb) info variables regexp
    +
  • +
+ + +

Go Extensions

+ +

+A recent extension mechanism to GDB allows it to load extension scripts for a +given binary. The tool chain uses this to extend GDB with a handful of +commands to inspect internals of the runtime code (such as goroutines) and to +pretty print the built-in map, slice and channel types. +

+ +
    +
  • +Pretty printing a string, slice, map, channel or interface: +
    (gdb) p var
    +
  • +
  • +A $len() and $cap() function for strings, slices and maps: +
    (gdb) p $len(var)
    +
  • +
  • +A function to cast interfaces to their dynamic types: +
    (gdb) p $dtype(var)
    +(gdb) iface var
    +

    Known issue: GDB can’t automatically find the dynamic +type of an interface value if its long name differs from its short name +(annoying when printing stacktraces, the pretty printer falls back to printing +the short type name and a pointer).

    +
  • +
  • +Inspecting goroutines: +
    (gdb) info goroutines
    +(gdb) goroutine n cmd
    +(gdb) help goroutine
    +For example: +
    (gdb) goroutine 12 bt
    +
  • +
+ +

+If you'd like to see how this works, or want to extend it, take a look at src/runtime/runtime-gdb.py in +the Go source distribution. It depends on some special magic types +(hash<T,U>) and variables (runtime.m and +runtime.g) that the linker +(src/cmd/ld/dwarf.c) ensures are described in +the DWARF code. +

+ +

+If you're interested in what the debugging information looks like, run +'objdump -W 6.out' and browse through the .debug_* +sections. +

+ + +

Known Issues

+ +
    +
  1. String pretty printing only triggers for type string, not for types derived +from it.
  2. +
  3. Type information is missing for the C parts of the runtime library.
  4. +
  5. GDB does not understand Go’s name qualifications and treats +"fmt.Print" as an unstructured literal with a "." +that needs to be quoted. It objects even more strongly to method names of +the form pkg.(*MyType).Meth. +
  6. All global variables are lumped into package "main".
  7. +
+ +

Tutorial

+ +

+In this tutorial we will inspect the binary of the +regexp package's unit tests. To build the binary, +change to $GOROOT/src/regexp and run go test -c. +This should produce an executable file named regexp.test. +

+ + +

Getting Started

+ +

+Launch GDB, debugging regexp.test: +

+ +
+$ gdb regexp.test
+GNU gdb (GDB) 7.2-gg8
+Copyright (C) 2010 Free Software Foundation, Inc.
+License GPLv  3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
+Type "show copying" and "show warranty" for licensing/warranty details.
+This GDB was configured as "x86_64-linux".
+
+Reading symbols from  /home/user/go/src/regexp/regexp.test...
+done.
+Loading Go Runtime support.
+(gdb) 
+
+ +

+The message "Loading Go Runtime support" means that GDB loaded the +extension from $GOROOT/src/runtime/runtime-gdb.py. +

+ +

+To help GDB find the Go runtime sources and the accompanying support script, +pass your $GOROOT with the '-d' flag: +

+ +
+$ gdb regexp.test -d $GOROOT
+
+ +

+If for some reason GDB still can't find that directory or that script, you can load +it by hand by telling gdb (assuming you have the go sources in +~/go/): +

+ +
+(gdb) source ~/go/src/runtime/runtime-gdb.py
+Loading Go Runtime support.
+
+ +

Inspecting the source

+ +

+Use the "l" or "list" command to inspect source code. +

+ +
+(gdb) l
+
+ +

+List a specific part of the source parametrizing "list" with a +function name (it must be qualified with its package name). +

+ +
+(gdb) l main.main
+
+ +

+List a specific file and line number: +

+ +
+(gdb) l regexp.go:1
+(gdb) # Hit enter to repeat last command. Here, this lists next 10 lines.
+
+ + +

Naming

+ +

+Variable and function names must be qualified with the name of the packages +they belong to. The Compile function from the regexp +package is known to GDB as 'regexp.Compile'. +

+ +

+Methods must be qualified with the name of their receiver types. For example, +the *Regexp type’s String method is known as +'regexp.(*Regexp).String'. +

+ +

+Variables that shadow other variables are magically suffixed with a number in the debug info. +Variables referenced by closures will appear as pointers magically prefixed with '&'. +

+ +

Setting breakpoints

+ +

+Set a breakpoint at the TestFind function: +

+ +
+(gdb) b 'regexp.TestFind'
+Breakpoint 1 at 0x424908: file /home/user/go/src/regexp/find_test.go, line 148.
+
+ +

+Run the program: +

+ +
+(gdb) run
+Starting program: /home/user/go/src/regexp/regexp.test
+
+Breakpoint 1, regexp.TestFind (t=0xf8404a89c0) at /home/user/go/src/regexp/find_test.go:148
+148	func TestFind(t *testing.T) {
+
+ +

+Execution has paused at the breakpoint. +See which goroutines are running, and what they're doing: +

+ +
+(gdb) info goroutines
+  1  waiting runtime.gosched
+* 13  running runtime.goexit
+
+ +

+the one marked with the * is the current goroutine. +

+ +

Inspecting the stack

+ +

+Look at the stack trace for where we’ve paused the program: +

+ +
+(gdb) bt  # backtrace
+#0  regexp.TestFind (t=0xf8404a89c0) at /home/user/go/src/regexp/find_test.go:148
+#1  0x000000000042f60b in testing.tRunner (t=0xf8404a89c0, test=0x573720) at /home/user/go/src/testing/testing.go:156
+#2  0x000000000040df64 in runtime.initdone () at /home/user/go/src/runtime/proc.c:242
+#3  0x000000f8404a89c0 in ?? ()
+#4  0x0000000000573720 in ?? ()
+#5  0x0000000000000000 in ?? ()
+
+ +

+The other goroutine, number 1, is stuck in runtime.gosched, blocked on a channel receive: +

+ +
+(gdb) goroutine 1 bt
+#0  0x000000000040facb in runtime.gosched () at /home/user/go/src/runtime/proc.c:873
+#1  0x00000000004031c9 in runtime.chanrecv (c=void, ep=void, selected=void, received=void)
+ at  /home/user/go/src/runtime/chan.c:342
+#2  0x0000000000403299 in runtime.chanrecv1 (t=void, c=void) at/home/user/go/src/runtime/chan.c:423
+#3  0x000000000043075b in testing.RunTests (matchString={void (struct string, struct string, bool *, error *)}
+ 0x7ffff7f9ef60, tests=  []testing.InternalTest = {...}) at /home/user/go/src/testing/testing.go:201
+#4  0x00000000004302b1 in testing.Main (matchString={void (struct string, struct string, bool *, error *)} 
+ 0x7ffff7f9ef80, tests= []testing.InternalTest = {...}, benchmarks= []testing.InternalBenchmark = {...})
+at /home/user/go/src/testing/testing.go:168
+#5  0x0000000000400dc1 in main.main () at /home/user/go/src/regexp/_testmain.go:98
+#6  0x00000000004022e7 in runtime.mainstart () at /home/user/go/src/runtime/amd64/asm.s:78
+#7  0x000000000040ea6f in runtime.initdone () at /home/user/go/src/runtime/proc.c:243
+#8  0x0000000000000000 in ?? ()
+
+ +

+The stack frame shows we’re currently executing the regexp.TestFind function, as expected. +

+ +
+(gdb) info frame
+Stack level 0, frame at 0x7ffff7f9ff88:
+ rip = 0x425530 in regexp.TestFind (/home/user/go/src/regexp/find_test.go:148); 
+    saved rip 0x430233
+ called by frame at 0x7ffff7f9ffa8
+ source language minimal.
+ Arglist at 0x7ffff7f9ff78, args: t=0xf840688b60
+ Locals at 0x7ffff7f9ff78, Previous frame's sp is 0x7ffff7f9ff88
+ Saved registers:
+  rip at 0x7ffff7f9ff80
+
+ +

+The command info locals lists all variables local to the function and their values, but is a bit +dangerous to use, since it will also try to print uninitialized variables. Uninitialized slices may cause gdb to try +to print arbitrary large arrays. +

+ +

+The function’s arguments: +

+ +
+(gdb) info args
+t = 0xf840688b60
+
+ +

+When printing the argument, notice that it’s a pointer to a +Regexp value. Note that GDB has incorrectly put the * +on the right-hand side of the type name and made up a 'struct' keyword, in traditional C style. +

+ +
+(gdb) p re
+(gdb) p t
+$1 = (struct testing.T *) 0xf840688b60
+(gdb) p t
+$1 = (struct testing.T *) 0xf840688b60
+(gdb) p *t
+$2 = {errors = "", failed = false, ch = 0xf8406f5690}
+(gdb) p *t->ch
+$3 = struct hchan<*testing.T>
+
+ +

+That struct hchan<*testing.T> is the runtime-internal representation of a channel. It is currently empty, or gdb would have pretty-printed it's contents. +

+ +

+Stepping forward: +

+ +
+(gdb) n  # execute next line
+149             for _, test := range findTests {
+(gdb)    # enter is repeat
+150                     re := MustCompile(test.pat)
+(gdb) p test.pat
+$4 = ""
+(gdb) p re
+$5 = (struct regexp.Regexp *) 0xf84068d070
+(gdb) p *re
+$6 = {expr = "", prog = 0xf840688b80, prefix = "", prefixBytes =  []uint8, prefixComplete = true, 
+  prefixRune = 0, cond = 0 '\000', numSubexp = 0, longest = false, mu = {state = 0, sema = 0}, 
+  machine =  []*regexp.machine}
+(gdb) p *re->prog
+$7 = {Inst =  []regexp/syntax.Inst = {{Op = 5 '\005', Out = 0, Arg = 0, Rune =  []int}, {Op = 
+    6 '\006', Out = 2, Arg = 0, Rune =  []int}, {Op = 4 '\004', Out = 0, Arg = 0, Rune =  []int}}, 
+  Start = 1, NumCap = 2}
+
+ + +

+We can step into the Stringfunction call with "s": +

+ +
+(gdb) s
+regexp.(*Regexp).String (re=0xf84068d070, noname=void) at /home/user/go/src/regexp/regexp.go:97
+97      func (re *Regexp) String() string {
+
+ +

+Get a stack trace to see where we are: +

+ +
+(gdb) bt
+#0  regexp.(*Regexp).String (re=0xf84068d070, noname=void)
+    at /home/user/go/src/regexp/regexp.go:97
+#1  0x0000000000425615 in regexp.TestFind (t=0xf840688b60)
+    at /home/user/go/src/regexp/find_test.go:151
+#2  0x0000000000430233 in testing.tRunner (t=0xf840688b60, test=0x5747b8)
+    at /home/user/go/src/testing/testing.go:156
+#3  0x000000000040ea6f in runtime.initdone () at /home/user/go/src/runtime/proc.c:243
+....
+
+ +

+Look at the source code: +

+ +
+(gdb) l
+92              mu      sync.Mutex
+93              machine []*machine
+94      }
+95
+96      // String returns the source text used to compile the regular expression.
+97      func (re *Regexp) String() string {
+98              return re.expr
+99      }
+100
+101     // Compile parses a regular expression and returns, if successful,
+
+ +

Pretty Printing

+ +

+GDB's pretty printing mechanism is triggered by regexp matches on type names. An example for slices: +

+ +
+(gdb) p utf
+$22 =  []uint8 = {0 '\000', 0 '\000', 0 '\000', 0 '\000'}
+
+ +

+Since slices, arrays and strings are not C pointers, GDB can't interpret the subscripting operation for you, but +you can look inside the runtime representation to do that (tab completion helps here): +

+
+
+(gdb) p slc
+$11 =  []int = {0, 0}
+(gdb) p slc-><TAB>
+array  slc    len    
+(gdb) p slc->array
+$12 = (int *) 0xf84057af00
+(gdb) p slc->array[1]
+$13 = 0
+ + + +

+The extension functions $len and $cap work on strings, arrays and slices: +

+ +
+(gdb) p $len(utf)
+$23 = 4
+(gdb) p $cap(utf)
+$24 = 4
+
+ +

+Channels and maps are 'reference' types, which gdb shows as pointers to C++-like types hash<int,string>*. Dereferencing will trigger prettyprinting +

+ +

+Interfaces are represented in the runtime as a pointer to a type descriptor and a pointer to a value. The Go GDB runtime extension decodes this and automatically triggers pretty printing for the runtime type. The extension function $dtype decodes the dynamic type for you (examples are taken from a breakpoint at regexp.go line 293.) +

+ +
+(gdb) p i
+$4 = {str = "cbb"}
+(gdb) whatis i
+type = regexp.input
+(gdb) p $dtype(i)
+$26 = (struct regexp.inputBytes *) 0xf8400b4930
+(gdb) iface i
+regexp.input: struct regexp.inputBytes *
+
diff --git a/doc/devel/pre_go1.html b/doc/devel/pre_go1.html new file mode 100644 index 0000000000000000000000000000000000000000..813e23cda6f1092b44ca691d5c9189839ce5fd0c --- /dev/null +++ b/doc/devel/pre_go1.html @@ -0,0 +1,455 @@ + + +

+This page summarizes the changes between stable releases of Go prior to Go 1. +See the Release History page for notes on recent releases. +

+ +

r60 (released 2011/09/07)

+ +

+The r60 release corresponds to +weekly.2011-08-17. +This section highlights the most significant changes in this release. +For a more detailed summary, see the +weekly release notes. +For complete information, see the +Mercurial change list. +

+ +

Language

+ +

+An "else" block is now required to have braces except if the body of the "else" +is another "if". Since gofmt always puts those braces in anyway, +gofmt-formatted programs will not be affected. +To fix other programs, run gofmt. +

+ +

Packages

+ +

+Package http's URL parsing and query escaping code +(such as ParseURL and URLEscape) has been moved to +the new url package, with several simplifications to +the names. Client code can be updated automatically with gofix. +

+ +

+Package image has had significant changes made to the +Pix field of struct types such as +image.RGBA and +image.NRGBA. +The image.Image interface type has not changed, +though, and you should not need to change your code if you don't explicitly +refer to Pix fields. For example, if you decode a number of images +using the image/jpeg package, compose them using +image/draw, and then encode the result using +image/png, then your code should still work as +before. +If your code does refer to Pix fields see the +weekly.2011-07-19 +snapshot notes for how to update your code. +

+ +

+Package template has been replaced with a new +templating package (formerly exp/template). The original template +package is still available as old/template. +The old/template package is deprecated and will be removed. +The Go tree has been updated to use the new template package. We encourage +users of the old template package to switch to the new one. Code that uses +template or exp/template will need to change its +import lines to "old/template" or "template", +respectively. +

+ +

Tools

+ +

+Goinstall now uses a new tag selection scheme. +When downloading or updating, goinstall looks for a tag or branch with the +"go." prefix that corresponds to the local Go version. For Go +release.r58 it looks for go.r58. For +weekly.2011-06-03 it looks for go.weekly.2011-06-03. +If the specific go.X tag or branch is not found, it chooses the +closest earlier version. If an appropriate tag or branch is found, goinstall +uses that version of the code. Otherwise it uses the default version selected +by the version control system. Library authors are encouraged to use the +appropriate tag or branch names in their repositories to make their libraries +more accessible. +

+ +

Minor revisions

+ +

+r60.1 includes a +linker +fix, a pair of +goplay +fixes, +and a json package +fix and +a new +struct tag +option. +

+ +

+r60.2 +fixes +a memory leak involving maps. +

+ +

+r60.3 fixes a +reflect bug. +

+ +

r59 (released 2011/08/01)

+ +

+The r59 release corresponds to +weekly.2011-07-07. +This section highlights the most significant changes in this release. +For a more detailed summary, see the +weekly release notes. +For complete information, see the +Mercurial change list. +

+ +

Language

+ +

+This release includes a language change that restricts the use of +goto. In essence, a goto statement outside a block +cannot jump to a label inside that block. Your code may require changes if it +uses goto. +See this +changeset for how the new rule affected the Go tree. +

+ +

Packages

+ +

+As usual, gofix will handle the bulk of the rewrites +necessary for these changes to package APIs. +

+ +

+Package http has a new +FileSystem interface that provides access +to files. The FileServer helper now takes a +FileSystem argument instead of an explicit file system root. By +implementing your own FileSystem you can use the +FileServer to serve arbitrary data. +

+ +

+Package os's ErrorString type has been +hidden. Most uses of os.ErrorString can be replaced with +os.NewError. +

+ +

+Package reflect supports a new struct tag scheme +that enables sharing of struct tags between multiple packages. +In this scheme, the tags must be of the form: +

+
+	`key:"value" key2:"value2"`
+
+

+The StructField type's Tag field now +has type StructTag, which has a +Get method. Clients of json and +xml will need to be updated. Code that says +

+
+	type T struct {
+		X int "name"
+	}
+
+

+should become +

+
+	type T struct {
+		X int `json:"name"`  // or `xml:"name"`
+	}
+
+

+Use govet to identify struct tags that need to be +changed to use the new syntax. +

+ +

+Package sort's IntArray type has been +renamed to IntSlice, and similarly for +Float64Slice and +StringSlice. +

+ +

+Package strings's Split function has +itself been split into Split and +SplitN. +SplitN is the same as the old Split. +The new Split is equivalent to SplitN with a final +argument of -1. +

+ +Package image/draw's +Draw function now takes an additional +argument, a compositing operator. +If in doubt, use draw.Over. +

+ +

Tools

+ +

+Goinstall now installs packages and commands from +arbitrary remote repositories (not just Google Code, Github, and so on). +See the goinstall documentation for details. +

+ +

r58 (released 2011/06/29)

+ +

+The r58 release corresponds to +weekly.2011-06-09 +with additional bug fixes. +This section highlights the most significant changes in this release. +For a more detailed summary, see the +weekly release notes. +For complete information, see the +Mercurial change list. +

+ +

Language

+ +

+This release fixes a use of uninitialized memory in programs that misuse goto. +

+ +

Packages

+ +

+As usual, gofix will handle the bulk of the rewrites +necessary for these changes to package APIs. +

+ +

+Package http drops the finalURL return +value from the Client.Get method. The value +is now available via the new Request field on http.Response. +Most instances of the type map[string][]string in have been +replaced with the new Values type. +

+ +

+Package exec has been redesigned with a more +convenient and succinct API. +

+ +

+Package strconv's Quote +function now escapes only those Unicode code points not classified as printable +by unicode.IsPrint. +Previously Quote would escape all non-ASCII characters. +This also affects the fmt package's "%q" +formatting directive. The previous quoting behavior is still available via +strconv's new QuoteToASCII function. +

+ +

+Package os/signal's +Signal and +UnixSignal types have been moved to the +os package. +

+ +

+Package image/draw is the new name for +exp/draw. The GUI-related code from exp/draw is now +located in the exp/gui package. +

+ +

Tools

+ +

+Goinstall now observes the GOPATH environment +variable to build and install your own code and external libraries outside of +the Go tree (and avoid writing Makefiles). +

+ + +

Minor revisions

+ +

r58.1 adds +build and +runtime +changes to make Go run on OS X 10.7 Lion. +

+ +

r57 (released 2011/05/03)

+ +

+The r57 release corresponds to +weekly.2011-04-27 +with additional bug fixes. +This section highlights the most significant changes in this release. +For a more detailed summary, see the +weekly release notes. +For complete information, see the +Mercurial change list. +

+ +

The new gofix tool finds Go programs that use old APIs and rewrites them to use +newer ones. After you update to a new Go release, gofix helps make the +necessary changes to your programs. Gofix will handle the http, os, and syscall +package changes described below, and we will update the program to keep up with +future changes to the libraries. +Gofix can’t +handle all situations perfectly, so read and test the changes it makes before +committing them. +See the gofix blog post for more +information.

+ +

Language

+ +

+Multiple assignment syntax replaces the closed function. +The syntax for channel +receives allows an optional second assigned value, a boolean value +indicating whether the channel is closed. This code: +

+ +
+	v := <-ch
+	if closed(ch) {
+		// channel is closed
+	}
+
+ +

should now be written as:

+ +
+	v, ok := <-ch
+	if !ok {
+		// channel is closed
+	}
+
+ +

Unused labels are now illegal, just as unused local variables are.

+ +

Packages

+ +

+Package gob will now encode and decode values of types that implement the +GobEncoder and +GobDecoder interfaces. This allows types with unexported +fields to transmit self-consistent descriptions; examples include +big.Int and big.Rat. +

+ +

+Package http has been redesigned. +For clients, there are new +Client and Transport +abstractions that give more control over HTTP details such as headers sent +and redirections followed. These abstractions make it easy to implement +custom clients that add functionality such as OAuth2. +For servers, ResponseWriter +has dropped its non-essential methods. +The Hijack and Flush methods are no longer required; +code can test for them by checking whether a specific value implements +Hijacker or Flusher. +The RemoteAddr and UsingTLS methods are replaced by Request's +RemoteAddr and TLS fields. +The SetHeader method is replaced by a Header method; +its result, of type Header, +implements Set and other methods. +

+ +

+Package net +drops the laddr argument from Dial +and drops the cname return value +from LookupHost. +The implementation now uses cgo to implement +network name lookups using the C library getaddrinfo(3) +function when possible. This ensures that Go and C programs +resolve names the same way and also avoids the OS X +application-level firewall. +

+ +

+Package os +introduces simplified Open +and Create functions. +The original Open is now available as OpenFile. +The final three arguments to StartProcess +have been replaced by a pointer to a ProcAttr. +

+ +

+Package reflect has been redesigned. +Type is now an interface that implements +all the possible type methods. +Instead of a type switch on a Type t, switch on t.Kind(). +Value is now a struct value that +implements all the possible value methods. +Instead of a type switch on a Value v, switch on v.Kind(). +Typeof and NewValue are now called TypeOf and ValueOf +To create a writable Value, use New(t).Elem() instead of Zero(t). +See the change description +for the full details. +The new API allows a more efficient implementation of Value +that avoids many of the allocations required by the previous API. +

+ +

+Remember that gofix will handle the bulk of the rewrites +necessary for these changes to package APIs. +

+ +

Tools

+ +

Gofix, a new command, is described above.

+ +

+Gotest is now a Go program instead of a shell script. +The new -test.short flag in combination with package testing's Short function +allows you to write tests that can be run in normal or “short” mode; +all.bash runs tests in short mode to reduce installation time. +The Makefiles know about the flag: use make testshort. +

+ +

+The run-time support now implements CPU and memory profiling. +Gotest's new +-test.cpuprofile and +-test.memprofile flags make it easy to +profile tests. +To add profiling to your web server, see the http/pprof +documentation. +For other uses, see the runtime/pprof documentation. +

+ +

Minor revisions

+ +

r57.1 fixes a nil pointer dereference in http.FormFile.

+

r57.2 fixes a use of uninitialized memory in programs that misuse goto.

+ +

r56 (released 2011/03/16)

+ +

+The r56 release was the first stable release and corresponds to +weekly.2011-03-07.1. +The numbering starts at 56 because before this release, +what we now consider weekly snapshots were called releases. +

diff --git a/doc/devel/release.html b/doc/devel/release.html new file mode 100644 index 0000000000000000000000000000000000000000..43ead088459b28cd6781f04427acc4ac5964cc3f --- /dev/null +++ b/doc/devel/release.html @@ -0,0 +1,171 @@ + + +

This page summarizes the changes between official stable releases of Go. +The change log has the full details.

+ +

To update to a specific release, use:

+ +
+git pull
+git checkout release-branch
+
+ +

go1.5 (released 2015/08/19)

+ +

+Go 1.5 is a major release of Go. +Read the Go 1.5 Release Notes for more information. +

+ +

Minor revisions

+ +

+go1.5.1 (released 2015/09/08) includes bug fixes to the compiler, assembler, and +the fmt, net/textproto, net/http, and +runtime packages. +See the Go +1.5.1 milestone on our issue tracker for details. +

+ +

go1.4 (released 2014/12/10)

+ +

+Go 1.4 is a major release of Go. +Read the Go 1.4 Release Notes for more information. +

+ +

Minor revisions

+ +

+go1.4.1 (released 2015/01/15) includes bug fixes to the linker and the log, syscall, and runtime packages. +See the Go 1.4.1 milestone on our issue tracker for details. +

+ +

+go1.4.2 (released 2015/02/17) includes bug fixes to the go command, the compiler and linker, and the runtime, syscall, reflect, and math/big packages. +See the Go 1.4.2 milestone on our issue tracker for details. +

+ +

go1.3 (released 2014/06/18)

+ +

+Go 1.3 is a major release of Go. +Read the Go 1.3 Release Notes for more information. +

+ +

Minor revisions

+ +

+go1.3.1 (released 2014/08/13) includes bug fixes to the compiler and the runtime, net, and crypto/rsa packages. +See the change history for details. +

+ +

+go1.3.2 (released 2014/09/25) includes bug fixes to cgo and the crypto/tls packages. +See the change history for details. +

+ +

+go1.3.3 (released 2014/09/30) includes further bug fixes to cgo, the runtime package, and the nacl port. +See the change history for details. +

+ +

go1.2 (released 2013/12/01)

+ +

+Go 1.2 is a major release of Go. +Read the Go 1.2 Release Notes for more information. +

+ +

Minor revisions

+ +

+go1.2.1 (released 2014/03/02) includes bug fixes to the runtime, net, and database/sql packages. +See the change history for details. +

+ +

+go1.2.2 (released 2014/05/05) includes a +security fix +that affects the tour binary included in the binary distributions (thanks to Guillaume T). +

+ +

go1.1 (released 2013/05/13)

+ +

+Go 1.1 is a major release of Go. +Read the Go 1.1 Release Notes for more information. +

+ +

Minor revisions

+ +

+go1.1.1 (released 2013/06/13) includes several compiler and runtime bug fixes. +See the change history for details. +

+ +

+go1.1.2 (released 2013/08/13) includes fixes to the gc compiler +and cgo, and the bufio, runtime, +syscall, and time packages. +See the change history for details. +If you use package syscall's Getrlimit and Setrlimit +functions under Linux on the ARM or 386 architectures, please note change +55ac276af5a7 +that fixes issue 5949. +

+ +

go1 (released 2012/03/28)

+ +

+Go 1 is a major release of Go that will be stable in the long term. +Read the Go 1 Release Notes for more information. +

+ +

+It is intended that programs written for Go 1 will continue to compile and run +correctly, unchanged, under future versions of Go 1. +Read the Go 1 compatibility document for more +about the future of Go 1. +

+ +

+The go1 release corresponds to +weekly.2012-03-27. +

+ +

Minor revisions

+ +

+go1.0.1 (released 2012/04/25) was issued to +fix an +escape analysis bug +that can lead to memory corruption. +It also includes several minor code and documentation fixes. +

+ +

+go1.0.2 (released 2012/06/13) was issued to fix two bugs in the implementation +of maps using struct or array keys: +issue 3695 and +issue 3573. +It also includes many minor code and documentation fixes. +

+ +

+go1.0.3 (released 2012/09/21) includes minor code and documentation fixes. +

+ +

+See the go1 release branch history for the complete list of changes. +

+ +

Older releases

+ +

+See the Pre-Go 1 Release History page for notes +on earlier releases. +

+ diff --git a/doc/devel/weekly.html b/doc/devel/weekly.html new file mode 100644 index 0000000000000000000000000000000000000000..143727fb07509949b11a062ee94d8cb7ebae8978 --- /dev/null +++ b/doc/devel/weekly.html @@ -0,0 +1,6200 @@ + + +

This page summarizes the changes between tagged weekly snapshots of Go. +Such snapshots are no longer created. This page remains as a historical reference only.

+ +

For recent information, see the change log and development mailing list.

+ +

2012-03-27 (Go 1)

+ +
+* cmd/dist: fix detection of go1 version.
+* cmd/go: add missing error check (thanks Evan Shaw),
+	allow underscores in tool name (thanks Shenghou Ma),
+	bug fixes,
+	copy tag_test.go from goinstall,
+	explain versions better,
+	respect $GOBIN always,
+	update for go1 tag format.
+* cmd/godoc: canonicalize custom path redirects,
+	fix app engine version,
+	use virtual filesystem to implement -templates flag.
+* codewalk/sharemem.xml: fix references to files.
+* crypto/tls: don't select ECC ciphersuites with no mutual curve.
+* doc: add JSON-RPC: a tale of interfaces article (thanks Francisco Souza),
+	describe the Windows MSI installer as experimental,
+	link to Go Project Dashboard from package list,
+	update wiki tutorial templates and template discussion,
+	and many minor fixes.
+* exp/types: generalized GCImporter API.
+* go/build: cgoEnabled is not known to cmd/dist anymore (thanks Shenghou Ma),
+	fix import check.
+* godoc: make 'Overview' section collapsible.
+* misc/dist: many fixes and tweaks.
+* misc/emacs: fix indentation bug.
+* misc/goplay: fix error on IE8 (thanks Yasuhiro Matsumoto).
+* net: ignore ECONNABORTED from syscall.Accept (thanks Devon H. O'Dell).
+* os: add missing byte to FileMode buffer (thanks Stefan Nilsson).
+* path/filepath: convert drive letter to upper case in windows EvalSymlinks (thanks Alex Brainman),
+	correct comment in EvalSymlinks (thanks Alex Brainman),
+	use windows GetShortPathName api to force GetLongPathName to do its work (thanks Alex Brainman),
+	windows drive letter cannot be a digit (thanks Alex Brainman).
+* run.bash: compile the codewalks.
+* runtime: restore deadlock detection in the simplest case (thanks Rémy Oudompheng),
+	work around false negative in deadlock detection.
+* text/template: fix typo in package comment.
+* windows: installer fixes (thanks Joe Poirier).
+
+ +

2012-03-22 (Go 1 Release Candidate 2)

+ +
+As with last week's snapshot, this snapshot is another Go 1 release candidate.
+A notable change in this snapshot are Windows installer fixes.
+
+Changes in this snapshot:
+* 5l, 6l, 8l: fix stack split logic for stacks near default segment size.
+* archive/zip: move r.zip off disk, into reader_test.go.
+* build: catch API changes during build,
+	do more during windows build (thanks Alex Brainman),
+	lengthen timeout for the lengthy runtime test (thanks Shenghou Ma),
+	unset GOPATH before tests (thanks Shenghou Ma).
+* cmd/cgo: add support for function export for gccgo (thanks Rémy Oudompheng),
+	fix handling of errno for gccgo.
+* cmd/go: add -fno-common by default on Darwin (thanks Shenghou Ma),
+	don't add detail to errPrintedOutput,
+	fix directory->import path conversion,
+	make build errors more visible,
+	use .o, not .{5,6,8}, for gccgo created object files,
+	work around occasional ETXTBSY running cgo.
+* cmd/godoc: add toys, tour button to playground,
+	inform users that the playground doesn't work via local godoc,
+	style example headings like links,
+	use *goroot as base path in zip file,
+	use FormatText for formating code in html template,
+	use shorter titles for tabs.
+* cmd/gofmt: show ascii in usage (thanks Yasuhiro Matsumoto).
+* cmd/pack: also recognize '\\' as path separator in filenames (thanks Shenghou Ma).
+* crypto/tls: always send a Certificate message if one was requested.
+* doc/install: remove reference to "Go Tutorial" (thanks Shenghou Ma).
+* doc/play: use []rune instead of []int (thanks Yasuhiro Matsumoto).
+* doc: add Go Concurrency Patterns: Timing out, moving on article (thanks Francisco Souza),
+	add Go image/draw package article and convert code snippets to Go1,
+	add Gobs of data article (thanks Francisco Souza),
+	add Godoc: documenting Go code article (thanks Francisco Souza),
+	add JSON and Go article (thanks Francisco Souza),
+	general update of gccgo installation instructions,
+	minor updates to most docs.
+* flag: add examples.
+* gc: fix struct and array comparisons for new bool rules (thanks Anthony Martin),
+	use quoted string format in import error,
+	when expanding append inline, preserve arguments.
+* go/build: clarify why we exclude files starting with '_' or '.' (thanks Shenghou Ma),
+	clearer argument name for Import (src -> srcDir),
+	do not report Target for local imports,
+	fix match.
+* go/printer, gofmt: fix multi-line logic.
+* html/template: add Templates and XXXEscape functions,
+	fix nil pointer bug,
+	fix panic on Clone.
+* io/ioutil: fix crash when Stat fails.
+* make.bat: fix for old files (thanks Christopher Redden),
+	don't show error message if old generated files do not exist (thanks Shenghou Ma),
+	properly handle directories with spaces (thanks Alex Brainman).
+* misc/cgo/gmp: update for Go 1 (thanks Shenghou Ma).
+* misc/dashboard: remove old python package dashboard.
+* misc/dist: don't ship cmd/cov or cmd/prof,
+	force modes to 0755 or 0644 in tarballs,
+	remove exp and old before building.
+* misc/vim: restore fileencodings (thanks Yasuhiro Matsumoto).
+* net/http: couple more triv.go modernizations,
+	ensure triv.go compiles and runs (thanks Robert Hencke).
+* net: drop unnecessary type assertions and fix leak in test (thanks Mikio Hara).
+* os: IsNotExist() should also consider ERROR_PATH_NOT_FOUND on Windows (thanks Shenghou Ma),
+	do not assume syscall.Write will write everything,
+	remove document duplication in error predicate functions (thanks Shenghou Ma),
+	return some invented data from Stat(DevNull) on windows (thanks Alex Brainman).
+* path/filepath: implement Match and Glob on windows (thanks Alex Brainman).
+* reflect: document PkgPath, Method, StructField,
+	panic if MakeSlice is given bad len/cap arguments.
+* run.bat: disable test in test\bench\go1 to fix build (thanks Alex Brainman).
+* runtime/cgo: darwin signal masking (thanks Mikio Hara),
+	linux signal masking (thanks Mikio Hara).
+* runtime: do not handle signals before configuring handler,
+	manage stack by ourselves for badcallback on windows/amd64 (thanks Shenghou Ma),
+	remove unused goc2c.c (thanks Shenghou Ma).
+* sort: add time complexity to doc (thanks Stefan Nilsson),
+	fix computation of maxDepth to avoid infinite loop (thanks Stefan Nilsson).
+* spec: delete references to unsafe.Reflect,Typeof,Unreflect.
+* syscall: Test SCM_CREDENTIALS, SO_PASSCRED on Linux (thanks Albert Strasheim),
+	add a test for passing an fd over a unix socket,
+	delete passfd_test.go.
+* test: use testlib in a few more cases (thanks Shenghou Ma).
+* text/template: fix a couple of parse bugs around identifiers,
+	variables do not take arguments.
+
+ +

2012-03-13 (Go 1 Release Candidate 1)

+ +
+This weekly snapshot is very close to what we expect will be the contents of
+the Go 1 release. There are still a few minor documentation issues to resolve,
+and a handful of bugs that should be addressed before the release, but the vast
+majority of Go programs should be completely unaffected by any changes we make
+between now and the full release.
+
+If you're interested in helping us test, eager to try out Go 1, or just
+curious, this weekly snapshot is the one to try. We'll issue a new App Engine
+Go 1 beta SDK very soon, so if you're an App Engine user you can try it there
+too.
+
+To help us focus on any remaining bugs and avoid introducing new ones, we will
+restrict our attention to critical fixes and issues marked Go1-Must in the
+issue tracker. Everything non-essential will be held until after the Go 1
+release is cut and in the field for a while.
+
+Changes in this snapshot:
+* archive/zip: verify CRC32s in non-streamed files,
+	write data descriptor signature for OS X; fix bugs reading it.
+* build: build correct cmd/dist matching GOHOSTARCH (thanks Shenghou Ma),
+	re-enable some broken tests in run.bash (thanks Shenghou Ma),
+	remove some references to Make.inc etc.
+	use run.go for running tests.
+* builder: use short test for subrepos (thanks Shenghou Ma).
+* cgo, runtime: diagnose callback on non-Go thread.
+* cmd/api: set compiler for all build contexts,
+	work on Windows again, and make gccgo files work a bit more.
+* cmd/cgo: document CGO_LDFLAGS and CGO_CFLAGS,
+	silence const warnings.
+* cmd/dist, cmd/go: move CGO_ENABLED from 'go tool dist env' to 'go env' (thanks Shenghou Ma).
+* cmd/dist: fix build for Linux/ARM (thanks Shenghou Ma),
+	use correct hg tag for go version (thanks Alex Brainman).
+* cmd/fix: add rules for net/http -> net/http/httputil renames.
+* cmd/gc: allow ~ in import paths,
+	delete old map delete in walk,
+	do not confuse unexported methods of same name,
+	if $GOROOT_FINAL is set, rewrite file names in object files,
+	implement len(array) / cap(array) rule,
+	import path cannot start with slash on Windows (thanks Shenghou Ma),
+	must not inline panic, recover,
+	show duplicate key in error,
+	unnamed struct types can have methods.
+* cmd/go: add -compiler,
+	add env command, use to fix misc/cgo/testso,
+	allow go get with arbitrary URLs,
+	allow ssh tunnelled bzr, git and svn (thanks Ingo Oeser),
+	always provide .exe suffix on windows (thanks Shenghou Ma),
+	document import path meta tag discovery in go help remote,
+	honor buildflags in run, test (thanks Rémy Oudompheng),
+	local import fixes,
+	make go get new.code/... work,
+	rebuild external test package dependencies,
+	respect $GOBIN always,
+	support -compiler for go list, fix isStale for gccgo (thanks Rémy Oudompheng).
+* cmd/godoc: add support for serving templates.
+	fix codewalk handler (thanks Francisco Souza).
+	remove extra / in paths (thanks Ugorji Nwoke),
+	support $GOPATH, simplify file system code,
+	switch on +1 buttons.
+* cmd/gofmt: fix race in long test (thanks Mikio Hara).
+* codereview: fix for Mercurial 2.1.
+* crypto/x509: allow server gated crypto in windows systemVerify (thanks Mikkel Krautz),
+	do not forget to free cert context (thanks Alex Brainman),
+	don't include empty additional primes in PKCS#1 private key,
+	enforce path length constraint,
+	new home for root fetchers; build chains using Windows API (thanks Mikkel Krautz).
+* csv: clarify what a negative FieldsPerRecord means.
+* database/sql: add docs about connection state, pooling,
+	ensure Stmts are correctly closed (thanks Gwenael Treguier),
+	fix double connection free on Stmt.Query error,
+	fix typo bug resulting in double-Prepare.
+* database/sql: add ErrBadConn.
+* doc/go1: template packages have changed since r60.
+* doc/go_mem: init-created goroutine behavior changes for Go 1 (thanks Shenghou Ma).
+* doc/gopher: flip frontpage gopher's eyes.
+* doc: add "About the go command" article,
+	add C? Go? Cgo! article (thanks Francisco Souza),
+	add Go's declaration syntax article (thanks Francisco Souza),
+	add more gophers,
+	add note about import . to Go 1 compatibility notes,
+	several doc fixes and improvements,
+	update Effective Go init section,
+	update progs/run (thanks Shenghou Ma),
+	update reference gopher,
+	web site tweaks.
+* encoding/asn1: handle UTCTime before the year 2000.
+* encoding/binary: improve package comment (thanks Stefan Nilsson).
+* encoding/gob: fix memory corruption.
+* encoding/json: document that nil slice encodes as `null`.
+* exp/wingui: moved to code.google.com/p/gowingui.
+* expvar: add locking to String, and use RWMutex properly throughout,
+	add missing locking in String methods.
+* fmt, log: stop using unicode.
+* fmt: minor tweak of package doc to show headings in godoc (thanks Volker Dobler).
+* go/build, cmd/go: add support for .syso files.
+* go/build: add NoGoError,
+	add dependency test,
+	do not parse .syso files (thanks Alex Brainman).
+* go/parser: avoid endless loop in case of internal error,
+	better error synchronization.
+* go/printer, gofmt: nicer formatting of multi-line returns.
+* go/printer: example for Fprint.
+* go/scanner: better panic diagnostic.
+* go spec: no known implementation differences anymore,
+	fix inaccuracy in type identity definition.
+* io: better document WriterAt.
+* misc/dashboard: remove obsolete package builder code.
+* misc/dist: add source archive support,
+	add windows installer and zip support,
+	minimum target requirement is 10.6 for Darwin (thanks Shenghou Ma).
+* misc/emacs: fix extra indentation after comments that end with a period.
+* misc/xcode: example install of language spec for Xcode 4.x (thanks Emil Hessman).
+* net, net/rpc, reflect, time: document concurrency guarantees.
+* net/http: fix crash with Transport.CloseIdleConnections,
+	return appropriate errors from ReadRequest.
+* net: add skip message to test (thanks Mikio Hara),
+	disable use of external listen along with other external network uses,
+	do not use reflect for DNS messages (thanks Rémy Oudompheng),
+	document ReadMsgUnix, WriteMsgUnix,
+	fix TestDialTimeout on windows builder,
+	improve server and file tests (thanks Mikio Hara),
+	make Dial and Listen behavior consistent across over platforms (thanks Mikio Hara),
+	remove dependence on bytes, fmt, strconv,
+	silence another epoll print,
+	use IANA reserved port to test dial timeout (thanks Mikio Hara).
+* os: document FileInfo.Size as system-dependent for irregular files,
+	fix SameFile to work for directories on windows (thanks Alex Brainman).
+* path/filepath/path_test.go: repair and enable TestAbs.
+* path/filepath: disable AbsTest on windows,
+	retrieve real file name in windows EvalSymlinks (thanks Alex Brainman).
+* runtime/pprof: disable test on Leopard 64-bit.
+* runtime: add Compiler,
+	fix windows/amd64 exception handler (thanks Alex Brainman),
+	inline calls to notok,
+	move runtime.write back to C,
+	print error on receipt of signal on non-Go thread,
+	remove unused runtime·signame and runtime·newError,
+	try extending arena size in 32-bit allocator (thanks Rémy Oudompheng),
+	wait for main goroutine before setting GOMAXPROCS (thanks Rémy Oudompheng).
+* strconv: add table-based isPrint, remove dependence on bytes, unicode, and strings.
+* sync/atomic: disable store and load test on a single processor machine (thanks Mikio Hara).
+* syscall: fix mkall.sh, mksyscall_linux.pl, and regen for Linux/ARM (thanks Shenghou Ma).
+* test/run: use all available cores on ARM system (thanks Shenghou Ma).
+* test: actually run them on windows (thanks Alex Brainman),
+	add inherited interface test to ddd.go,
+	enable method expression tests in ddd.go,
+	invoke go command in run.go,
+	match gccgo error messages for bug388.go,
+	skip . files in directory.
+* testing: do not print 'no tests' when there are examples.
+* time: during short test, do not bother tickers take longer than expected (thanks Shenghou Ma),
+	mention receiver in Unix, UnixNano docs.
+* unicode/utf16: remove dependence on package unicode.
+* unicode/utf8: remove dependence on unicode.
+* windows: make background of gopher icon transparent (thanks Volker Dobler).
+
+ +

2012-03-04

+ +
+This snapshot includes a major re-design of the go/build package.
+Its FindTree, ScanDir, Tree, and DirInfo types have been replaced with the
+Import and Package types. There is no gofix. Code that uses go/build will need
+to be updated manually to use the package's new interface.
+
+Other changes:
+* 6a/6l: add IMUL3Q and SHLDL.
+* all: remove unused unexported functions and constants (thanks Rémy Oudompheng).
+* build: add GO_ prefix to LDFLAGS and GCFLAGS (thanks Gustavo Niemeyer).
+* cmd/cc: fix an out of bounds array access (thanks Anthony Martin),
+	grow some global arrays.
+* cmd/dist: force line-buffering stdout/stderr on Unix (thanks Shenghou Ma),
+	recognize CC="ccache clang" as clang.
+* cmd/go: avoid repeated include dirs (thanks Rémy Oudompheng),
+	fix -I flag for gc command (thanks Gustavo Niemeyer),
+	fix verbose command displaying (thanks Gustavo Niemeyer),
+	fixes for gccgo (thanks Rémy Oudompheng),
+	many fixes,
+	test -i should not disable -c (thanks Shenghou Ma).
+* cmd/vet: don't give error for Printf("%+5.2e", x) (thanks Shenghou Ma).
+* cmd/yacc/units.y: update comment, give better error messages when $GOROOT not set (thanks Shenghou Ma).
+* crypto/tls: force OS X target version to 10.6 for API compatibility (thanks Mikkel Krautz).
+* crypto/x509: fix typo in Verify documentation (thanks Mikkel Krautz).
+* dist: treat CC as one unit (thanks Scott Lawrence).
+* doc/go1: add justification discussions to major changes,
+	minor corrections and updates.
+* doc: describe API changes to go/build,
+	elaborate available checks for cmd/vet (thanks Shenghou Ma),
+	expand code.html to discuss the go tool in more depth,
+	instruct FreeBSD/Linux users to rm the old version first,
+	remove Go for C++ Programmers,
+	remove roadmap document,
+	remove tutorial,
+	update codelab/wiki to Go 1 (thanks Shenghou Ma),
+* encoding/gob: fix "// +build" comment for debug.go (thanks Shenghou Ma),
+	more hardening for lengths of input strings.
+* encoding/json: drop MarshalForHTML; gofix calls to Marshal,
+	escape output from Marshalers.
+* encoding/xml: fix anonymous field Unmarshal example (thanks Gustavo Niemeyer),
+	fix xml test tag usage (thanks Gustavo Niemeyer).
+* gc: disallow absolute import paths,
+	fix escape analysis + inlining + closure bug,
+	fix string comparisons for new bool rules (thanks Anthony Martin),
+	reject import paths containing special characters (thanks Anthony Martin).
+* go/ast: examples for ast.Print, ast.Inspect.
+* go/doc, godoc: fix range of type declarations.
+* go/parser: check import path restrictions,
+	expand test cases for bad import.
+* go/printer, gofmt: improved comment placement.
+* go/printer: fix printing of variadic function calls (thanks Anthony Martin),
+	fix test for new import path restrictions (thanks Anthony Martin),
+	replace multiline logic,
+	simpler exprList code, more tests.
+* godoc: add Examples link to top-level index,
+	bring back highlighting, selections, and alerts,
+	consistent placement of documentation sections,
+	don't show directories w/o packages in flat dir mode,
+	don't show testdata directories,
+	fix codewalks.
+* gotype: provide -comments flag.
+* html/template: make doctype check case-insensitive (thanks Scott Lawrence),
+	use correct method signature in introduction example (thanks Mike Rosset).
+* io: document that I/O is not necessarily safe for parallel access.
+* ld: allow more -L options (thanks Shenghou Ma),
+	fix alignment of rodata section.
+* misc: add zsh completion for go tool (thanks Rémy Oudompheng).
+* misc/bash: Completion for go tool (thanks Yissakhar Z. Beck).
+* misc/dashboard: fix bug in UI template,
+	record install counts for external packages.
+* misc/dist: implement binary distribution scripts in go.
+* misc/gobuilder: send commit time in RFC3339 format.
+* misc/xcode: move Xcode3 specific files into sub directory.
+* net/http/cgi: add an empty response test,
+	fix empty response.
+* net/http/httptest: make Server.Close wait for outstanding requests to finish.
+* net/http/httputil: fix DumpRequestOut on https URLs,
+	make https DumpRequestOut less racy.
+* net/http: add overlooked 418 status code, per RFC 2324,
+	fix ProxyFromEnvironment bug, docs, add tests,
+	make a test more paranoid & reliable on Windows.
+* net/rpc: silence read error on closing connection.
+* net: add stubs for NetBSD (thanks Benny Siegert),
+	make -external flag for tests default to true (thanks Mikio Hara),
+	reorganize test files (thanks Mikio Hara).
+* os: diagnose chdir error during StartProcess,
+	implement UserTime/SystemTime on windows (thanks Alex Brainman),
+	implement sameFile on windows (thanks Alex Brainman),
+	release process handle at the end of windows (*Process).Wait (thanks Alex Brainman),
+	sleep 5ms after process has exited on windows (thanks Alex Brainman).
+* path/filepath: note that SplitList is different from strings.Split,
+	steer people away from HasPrefix.
+* reflect: don't panic comparing functions in DeepEqual.
+	make Value.Interface return immutable data.
+* runtime/pprof: support OS X CPU profiling.
+* runtime: add sanity checks to the runtime-gdb.py prettyprinters,
+	check for ARM syscall failures (thanks Shenghou Ma),
+	darwin and linux signal masking,
+	run init on main thread,
+	size arena to fit in virtual address space limit.
+* spec: allow disallow of \uFFFD in import path,
+	apply method sets, embedding to all types, not just named types,
+	clarifications around exports, uniqueness of identifiers,
+	import path implementation restriction,
+	inside functions, variables must be evaluated,
+	use the term "lexical token" (rather then "lexical symbol").
+* sync: add Once example, remove old WaitGroup example.
+* test/bench/shootout: update post-Makefile.
+* test: add documentation, misc fixes.
+* testing: add -test.example flag to control execution of examples.
+* text/template: add example showing use of custom function,
+	add examples that use multiple templates,
+	fix redefinition bugs.
+* time: add a comment about how to use the Duration constants.
+
+ +

2012-02-22

+ +
+This weekly snapshot includes changes to the os and runtime packages.
+
+This should be the last of the significant incompatible changes before Go 1.
+
+There are no longer error constants such as EINVAL in the os package, since the
+set of values varied with the underlying operating system. There are new
+portable functions like IsPermission to test common error properties, plus a
+few new error values with more Go-like names, such as ErrPermission and
+ErrNoEnv.
+
+The os.Getenverror function has been removed. To distinguish between a
+non-existent environment variable and an empty string, use os.Environ or
+syscall.Getenv.
+
+The Process.Wait method has dropped its option argument and the associated
+constants are gone from the package. Also, the function Wait is gone; only the
+method of the Process type persists.
+
+The non-portable Waitmsg type has been replaced with the portable ProcessState.
+
+Much of the API exported by package runtime has been removed in favor of
+functionality provided by other packages. Code using the runtime.Type
+interface or its specific concrete type implementations should now use package
+reflect.  Code using runtime.Semacquire or runtime.Semrelease should use
+channels or the abstractions in package sync.
+
+The runtime.Alloc, runtime.Free, and runtime.Lookup functions, an unsafe API
+created for debugging the memory allocator, have no replacement.
+
+The runtime.Cgocalls and runtime.Goroutines functions have been renamed to
+runtime.NumCgoCall and runtime.NumGoroutine.
+
+The "go fix" command will update code to accommodate most of these changes.
+
+Other changes:
+* 5c, 6c, 8c, 6g, 8g: correct boundary checking (thanks Shenghou Ma).
+* 5g, 6g, 8g: flush modified globals aggressively.
+* 8a, 8l: add EMMS instruction (thanks Evan Shaw).
+* bufio: don't return errors from good Peeks.
+* build: add make.bash --no-clean option,
+	improve Windows support.
+* builder: reuse existing workspace if possible (thanks Shenghou Ma),
+	update for os.Wait changes.
+* bytes: document Compare/Equal semantics for nil arguments, and add tests.
+* cgo: fix definition of opaque types (thanks Gustavo Niemeyer).
+* cmd/api: record return type of functions for variable typecheck (thanks Rémy Oudompheng).
+* cmd/cgo: bug fixes.
+* cmd/dist: add clang specific -Wno options (thanks Bobby Powers),
+	fix install cmd/5g on non-arm system,
+	fix pprof permissions (thanks Bobby Powers),
+	make dir check in defaulttarg() more robust (thanks Shenghou Ma),
+	use correct package target when cross-compiling (thanks Alex Brainman).
+* cmd/gc: correctly typecheck expression lists in returns (thanks Rémy Oudompheng),
+	don't believe that variables mentioned 256 times are unused (thanks Rémy Oudompheng),
+	error on constant shift overflows (thanks Rémy Oudompheng),
+	fix comparison of struct with _ field.
+	fix error for floating-point constant %,
+	new, less strict bool rules.
+* cmd/go: add tool -n flag,
+	go test -i correctly handle cgo packages (thanks Shenghou Ma).
+* codereview: fix submit message for new clone URL (thanks Shenghou Ma).
+* database/sql/driver: API cleanups.
+* doc: many fixes and adjustments.
+* encoding/gob: cache engine for user type, not base type,
+	catch internal error when it happens,
+	fix mutually recursive slices of structs.
+* encoding/json: ignore anonymous fields.
+* go/doc: return Examples in name order.
+* go/parser: imaginary constants and ! may start an expression.
+* go/printer, gofmt: improved comma placement.
+* go/printer: don't lose relevant parentheses when rewriting selector expressions.
+* godoc: adjust line height in pre blocks,
+	don't print spurious suggestion when running "go doc foo",
+	fix absolute->relative mapping,
+	fix tag mismatch validation errors (thanks Scott Lawrence),
+	import example code support,
+	support flat directory view again.
+* html/template: add Clone and AddParseTree,
+	don't indirect past a Stringer,
+	minor tweak to docs to improve HTML typography.
+* image: add Decode example.
+* ld: add NOPTRBSS for large, pointer-free uninitialized data.
+* math/rand: Intn etc. should panic if their argument is <= 0.
+* misc/dist/windows: distro builder updates (thanks Joe Poirier).
+* misc/goplay: remain in work directory, build in temp directory.
+* net, os, syscall: delete os.EPLAN9 (thanks Mikio Hara).
+* net/http: add optional Server.TLSConfig field.
+* net/smtp: use EHLO then HELO.
+* net/textproto: accept bad MIME headers as browsers do.
+* net/url: regularise receiver names.
+* net: make LocalAddr on multicast return group address (thanks Mikio Hara),
+	make parseProcNetIGMP more robust (thanks Mikio Hara),
+	more selfConnect debugging: panic if ra == nil in internetSocket,
+	panic if sockaddrToTCP returns nil incorrectly,
+	other miscellaneous fixes.
+* path, path/filepath: polish documentation (thanks Rémy Oudompheng).
+* pprof: add Profile type.
+* runtime: avoid malloc during malloc,
+	define NSIG to fix plan 9 build (thanks David du Colombier),
+	fix FreeBSD signal handling around thread creation (thanks Devon H. O'Dell),
+	goroutine profile, stack dumps,
+	implement runtime.osyield on FreeBSD 386, amd64 (thanks Devon H. O'Dell),
+	permit default behaviour of SIGTSTP, SIGTTIN, SIGTTOU,
+	release unused memory to the OS (thanks Sébastien Paolacci),
+	remove an obsolete file (thanks Mikio Hara).
+* spec: make all comparison results untyped bool,
+	refine the wording about variables in type switches,
+	struct comparison only compares non-blank fields.
+* syscall: Make Pdeathsig type Signal in SysProcAttr on Linux (thanks Albert Strasheim),
+	fix bounds check in Error,
+	force Windows to always use US English error messages (thanks Shenghou Ma).
+* test: migrated to new go-based testing framework.
+* text/template: evaluate function fields.
+* time: use Go distribution zoneinfo if system copy not found.
+
+ +

2012-02-14

+ +
+This release includes some package changes that require changes to client code.
+
+The flate, gzip and zlib's NewWriterXxx functions no longer return an error.
+The compiler will flag all affected code which must then be updated by hand.
+
+The os package's Exec and Time functions were removed.  Callers should use
+syscall.Exec and time.Now instead. The ShellExpand function was renamed to
+ExpandEnv. The NewFile function now takes a uintptr and the *File.Fd method
+returns a uintptr.
+
+The runtime package's Type type and its methods have been removed.
+Use the reflect package instead.
+
+Other changes:
+* 8a, 8l: add LFENCE, MFENCE, SFENCE (thanks Darren Elwood).
+* all.bat: report error code back to the gobuilder (thanks Alex Brainman).
+* archive/zip: hide Write method from *Writer type.
+* build: create the correct $GOTOOLDIR,
+	get rid of deps.bash (thanks Anthony Martin),
+	reject make.bash on Windows.
+* builder: set $GOBUILDEXIT for Windows (thanks Alex Brainman),
+* bytes: add Reader,
+	return error in WriteTo if buffer is not drained.
+* cgo: add support for returning errno with gccgo (thanks Rémy Oudompheng).
+* cmd/api: follow constant references.
+* cmd/cgo: omit //line in -godefs, -cdefs output.
+* cmd/dist: fixes (thanks Alex Brainman, Gustavo Niemeyer, Mikio Hara, Shenghou Ma).
+* cmd/fix: warn about exp, old, deleted packages.
+* cmd/gc: suspend safemode during typecheck of inlined bodies.
+* cmd/go: a raft of fixes,
+	connect os.Stdin for go run and go tool,
+	go get scheme detection (thanks Daniel Krech),
+	respect test -timeout flag.
+* cmd/vet: warn for construct 'Println(os.Stderr, ...)' (thanks Shenghou Ma).
+* compress/gzip: remove dead code (thanks Alex Brainman).
+* container/heap: add example.
+* dashboard: add gobuilder -fail mode.
+* database/sql: more tests,
+	remove Into from ScannerInto/ScanInto,
+	rename ErrTransactionFinished to ErrTxDone,
+	support ErrSkip in Tx.Exec (thanks Andrew Balholm),
+	treat pointers as nullable types as with encoding/json (thanks Andrew Pritchard).
+* debug/macho: drop terrifyingly monstrous URL from package comment.
+* dist: prevent recusive loop on windows when fatal() is called (thanks Daniel Theophanes).
+* doc: add App Engine docs to 'learn' and 'reference' pages,
+	add playground.js,
+	new document about compatibility of releases,
+	update install.html for binary distros, add install-source.html.
+* effective_go: use new map deletion syntax.
+* encoding/binary: add Size, to replace the functionality of the old TotalSize,
+	another attempt to describe the type of Read and Write's data,
+	slices are allowed; say so.
+* encoding/json: document buffering.
+* encoding/xml: add support for the omitempty flag (thanks Gustavo Niemeyer).
+* exp/norm: merged charinfo and decomposition tables.
+* exp/types: use build.FindTree in GcImporter (thanks James Whitehead).
+* flate: delete WrongValueError type.
+* fmt: diagnose invalid verb applied to pointer,
+	scan FALSE correctly.
+* gc: bug fixes, better error messages.
+* go/doc: handle recursive embedded types (thanks Gary Burd),
+	don't lose exported consts/vars with unexported type,
+	treat predeclared error interface like an exported type.
+* go/printer: implement SourcePos mode.
+* godoc: list examples in index,
+	new design,
+	regard lone examples as "whole file" examples.
+* html/template: added more words about examples and doc (thanks Bjorn Tipling).
+* log/syslog: return length of data provided by the user, not length of header.
+* make.bat: remove double quotes (thanks Alex Brainman).
+* math: fix gamma doc, link to OEIS.
+* mime: unexport some internal details.
+* misc/dist: add binary distribution packaging script for linux,
+	new hierarchy for binary distribution packaging scripts.
+* net/http: add ServeContent,
+	don't spin on temporary accept failure,
+	fix client goroutine leak with persistent connections,
+	fix reference to URL.RawPath in docs (thanks Bjorn Tipling),
+	panic on duplicate registrations,
+	use mtime < t+1s to check for unmodified (thanks Hong Ruiqi).
+* net: avoid Shutdown during Close,
+	avoid TCP self-connect,
+	disable TestDialTimeout on Windows,
+	disable multicast test on Alpha GNU/Linux,
+	disable wild use of SO_REUSEPORT on BSD variants (thanks Mikio Hara),
+	enable flags on stream for multicast listeners (thanks Mikio Hara),
+	make use of listenerBacklog (thanks Mikio Hara),
+	prefer an IPv4 listen if no address given (thanks Mikio Hara).
+* os/exec: add Cmd.Waitmsg.
+* os/signal: revive this package.
+* regexp/syntax: add package and Parse commentary.
+* regexp: allow substitutions in Replace, ReplaceString.
+* runtime, pprof: add profiling of thread creation.
+* runtime, time: accelerate tests in short mode (thanks Rémy Oudompheng).
+* runtime: exit early on OABI systems (thanks Shenghou Ma),
+	drop to 32 bit malloc if 64 bit will not work,
+	fix "SysReserve returned unaligned address" bug on 32-bit systems (thanks Shenghou Ma),
+	fix grsec support (thanks Gustavo Niemeyer),
+	on 386, fix FP control word on all threads, not just initial thread,
+	put lockorder before pollorder in Select memory block,
+	use startpanic so that only one thread handles an incoming SIGQUIT.
+* spec: add forward links from 'method set' to where it gets used,
+	clarify implementation restrictions on untyped floats,
+	disallow recursive embedded interfaces,
+	method names must be unique,
+	send on closed channel counts as "proceeding",
+	strings are more slices than arrays.
+* strconv: handle very large inputs.
+* strings: add Seek and ReadAt methods to Reader.
+* sync/atomic: disable hammer pointer tests on wrong size system.
+* testing: let runtime catch the panic.
+* text/template: refer HTML users to html/template.
+* text/template/parse: deep Copy method for nodes.
+* time: clean up MarshalJSON, add RFC3339 method,
+	use "2006-01-02 15:04:05.999999999 -0700 MST" as String format.
+
+ +

2012-02-07

+ +
+This weekly snapshot includes a re-organization of the Go tools.
+
+Only the go, godoc, and gofmt tools are installed to $GOROOT/bin (or $GOBIN).
+The remainder are installed to $GOROOT/bin/tool.
+This puts the lesser-used tools (6g, cgo, govet, etc.) outside the user PATH.
+Instead these tools may be called through the go tool with 'go tool command'.
+For example, to vet hello.go you would type 'go tool vet hello.go'.
+Type 'go tool' see the list of available tools.
+
+With the move, some tools were given simpler names:
+	6cov    -> cov
+	6nm     -> nm
+	goapi   -> api
+	gofix   -> fix
+	gopack  -> pack
+	gopprof -> pprof
+	govet   -> vet
+	goyacc  -> yacc
+
+The os/signal package has been moved to exp/signal.
+
+A new tool named 'dist' has been introduced to handle building the gc tool
+chain and to bootstrap the go tool. The old build scripts and make files
+have been removed.
+
+Other changes:
+* 5a, 6a, 8a, cc: check in y.tab.[ch].
+* 5l, 6l, 8l, ld: remove memory leaks (thanks Shenghou Ma).
+* 5l, 6l, 8l: implement -X flag.
+* 5l: make -v option output less nonessential clutter (thanks Shenghou Ma),
+	optimize the common case in patch() (thanks Shenghou Ma).
+* 8a, 8l: implement support for RDTSC instruction (thanks Shenghou Ma).
+* 8g: use uintptr for local pc.
+* archive/zip: support full range of FileMode flags (thanks Gustavo Niemeyer).
+* bufio: remove special error type, update docs.
+* build: move the "-c" flag into HOST_CFLAGS (thanks Anthony Martin),
+	remove unnecessary pragmas (thanks Anthony Martin).
+* builder: drop recover blocks.
+* bytes: API tweaks.
+* cgo: accept null pointers in gccgo flavour of C.GoString (thanks Rémy Oudompheng),
+	print line numbers in fatal errors when relevant (thanks Rémy Oudompheng).
+* cmd/dist: add GOBIN to env's output (thanks Gustavo Niemeyer),
+	fix bug in bsubst (thanks Alex Brainman),
+	fix build on openbsd (thanks Mikio Hara),
+	generate files for package runtime,
+	ignore file names beginning with . or _,
+	prevent race on VERSION creation (thanks Gustavo Niemeyer).
+* cmd/gc: another special (%hhS) case for method names,
+	describe debugging flags (thanks Anthony Martin),
+	diagnose \ in import path,
+	disallow switch _ := v.(type),
+	don't print implicit type on struct literal in export,
+	fix codegen reordering for expressions involving && and ||,
+	use octal escapes in mkopnames (thanks Anthony Martin).
+	use original constant expression in error messages (thanks Rémy Oudompheng).
+* cmd/go: add support for release tags via git branches (thanks Gustavo Niemeyer),
+	build: print import errors when invoked on files (thanks Kyle Lemons),
+	clean test directories as they complete,
+	fix error message on non-existing tools (thanks Rémy Oudompheng),
+	fix handling of gccgo standard library (thanks Rémy Oudompheng),
+	fixed panic on `go clean -n` and `go clean -x` (thanks Sanjay Menakuru),
+	introduce support for "go build" with gccgo (thanks Rémy Oudompheng),
+	make vcs command actually gather output (thanks Roger Peppe),
+	pass env CGO_CFLAGS to cgo (thanks Jeff Hodges),
+	record location of failed imports for error reporting (thanks Rémy Oudompheng).
+* cmd/goapi: expand embedded interfaces.
+* cmd/goinstall: remove now that 'go get' works (thanks Gustavo Niemeyer).
+* cmd/ld: fix gdbscript (thanks Wei Guangjing).
+* cmd/pack: change gopack to pack in error messages.
+* codereview: miscellaneous fixes and improvements.
+* crypto/elliptic: p224Contract could produce a non-minimal representation.
+* crypto/tls: better error message when connecting to SSLv3 servers.
+* crypto/x509: use case-insensitive hostname matching.
+* dashboard: support for sub-repositories, update to go1beta.
+* database/sql: permit scanning into interface{}.
+* doc: update go1.html for recent changes.
+* encoding/base32: add DecodeString and EncodeToString helper methods,
+	ignore new line characters during decode.
+* encoding/base64: ignore new line characters during decode.
+* encoding/gob: document CommonType.
+* encoding/hex: canonicalize error type names.
+* encoding/json: call (*T).MarshalJSON for addressable T values.
+* encoding/xml: fix decoding of xml.Name with sub-elements (thanks Gustavo Niemeyer),
+	fix documentation for Decoder.Skip.
+* exp/norm: Added some benchmarks for form-specific performance measurements,
+	a few minor changes in prepration for a table format change.
+* expvar: revise API.
+* fix: add image/{bmp,tiff} to go1pkgrename.
+* flag: allow a FlagSet to not write to os.Stderr,
+	describe valid input for Duration flags.
+* fmt: add test of NaN map keys,
+	fix caching bug in Scan.
+* go/build: put a space between 'generated by make' and package statement,
+	update syslist.go package comment.
+* go/doc: fix URL linking in ToHTML (thanks Gary Burd),
+	added error, rune to list of predeclared types,
+	don't lose factory functions of non-exported types,
+	don't show methods of exported anonymous fields,
+	enable AllMethods flag (and fix logic).
+* go/printer: don't print incorrect programs.
+* go/scanner: idiomatic receiver names.
+* go/spec: update language on map types.
+* go/token: remove dependency on encoding/gob.
+* gob: fuzz testing, plus a fix for very large type names.
+* gobuilder: use go tool to build and test sub-repositories.
+* godoc: add URL mode m=methods,
+	diagnostic for empty FS tree,
+	fix identifier search,
+	fix redirect loop for URL "/",
+	provide link to subdirectories, if any,
+	sort list of "other packages",
+	update metadata in appinit.go.
+* gophertool: fix link to the build status dashboard (thanks Jongmin Kim).
+* hgignore: add VERSION.cache (thanks Gustavo Niemeyer),
+	delete dregs, ignore tmpltohtml.
+* html: add package doc.
+* image: add package docs, rename s/UnknownFormatError/ErrFormat/ and,
+	delete the image.Repeated type,
+	remove image/bmp and image/tiff from std.
+* io/ioutil: document EOF behavior in ReadFile and ReadAll.
+* io: API tweaks.
+* libmach: add stubs for Plan 9 (thanks Anthony Martin).
+* make.bash: don't remove hgpatch.
+* math/big: add raw access to Int bits,
+	API and documentation cleanup.
+* misc/goplay: use go tool "run" (thanks Olivier Duperray).
+* misc/osx: don't set GOROOT or modify profile files,
+	update for dist tool, drop image.bash, update readme.
+* net, syscall: add IPv4 multicast helpers for windows (thanks Mikio Hara).
+* net/http/httputil: fix race in DumpRequestOut,
+	preserve query params in reverse proxy.
+* net/http: don't set Content-Type header for HEAD requests by default (thanks Patrick Mylund Nielsen),
+	fix nil pointer dereference in error case (thanks Volker Dobler),
+	close client fd sooner on response read error,
+	set cookies in client jar on POST requests (thanks Volker Dobler).
+* net/rpc: fix data race on Call.Error.
+* net: ListenMulticastUDP to listen concurrently across multiple listeners (thanks Mikio Hara),
+	disable normal multicast testing on linux/arm (thanks Mikio Hara),
+	fix Plan 9 build (thanks Anthony Martin),
+	fix windows build (thanks Alex Brainman),
+	move DNSConfigError to a portable file,
+	remove types InvalidConnError and UnknownSocketError,
+	replace error variable name e, errno with err (thanks Mikio Hara),
+	run TestDialTimeout on windows (thanks Alex Brainman),
+	update comments to remove redundant "net" prefix (thanks Mikio Hara).
+* os/exec: TestExtraFiles - close any leaked file descriptors,
+	make sure file is not closed early in leaked fd test.
+* os/signal: move to exp/signal.
+* os/user: windows implementation (thanks Alex Brainman).
+* os: Process.handle use syscall.Handle (thanks Wei Guangjing),
+	file windows use syscall.InvalidHandle instead of -1 (thanks Wei Guangjing),
+	remove SIGXXX signals variables,
+	turn FileStat.Sys into a method on FileInfo (thanks Gustavo Niemeyer).
+* path/filepath: repair and simplify the symlink test.
+* reflect: add comment about Type.Field allocation,
+	test that PtrTo returns types that match program types.
+* runtime: add runtime.cputicks() and seed fastrand with it (thanks Damian Gryski),
+	delete UpdateMemStats, replace with ReadMemStats(&stats) (thanks Rémy Oudompheng),
+	fix float64 hash,
+	use GOTRACEBACK to decide whether to show runtime frames,
+	use per-map hash seeds (thanks Damian Gryski).
+* spec: add number to the fibonacci sequence.
+* std: add struct field tags to untagged literals.
+* strings: add Fields example.
+* syscall: add Timeval.Nano, Timespec.Nano, for conversion to Duration,
+	cache environment variables on Plan 9 (thanks Anthony Martin),
+	fix // +build comments in types_*.go,
+	fix build directive in types_linux.go,
+	update bootstrap scripts to sync with new go command (thanks Mikio Hara).
+* test: add import test that caused an incorrect gccgo error,
+	add test for receiver named _,
+	add test of NaN in map,
+	add test which crashed gccgo compiler,
+	don't use package main for files without a main function,
+	fix bug headers,
+	float to integer test case,
+	make map nan timing test more robust,
+	match gccgo error messages,
+	test append with two different named types with same element type,
+	test method expressions with parameters, and with import,
+	test slice beyond len,
+	test that x := <-c accepts a general expression.
+* testing: capture panics, present them, and mark the test as a failure.
+* unicode: document large var blocks and the SpecialCase vars.
+* vet: add a check for untagged struct literals.
+
+ +

2012-01-27

+ +
+This weekly snapshot renamed the html package to exp/html. The package will not
+be present in the Go 1 distribution, but will be installable from source.
+
+Error variables in the archive/tar, archive/zip, compress/gzip, compress/zlib,
+and crypto/bcrypt packages have been renamed from FooError to ErrFoo. 
+There is no gofix, but the compiler will flag code that needs updating.
+
+This weekly snapshot relocates many packages to sub-repositories of the main 
+Go repository. These are the old and new import paths:
+
+	crypto/bcrypt          code.google.com/p/go.crypto/bcrypt
+	crypto/blowfish        code.google.com/p/go.crypto/blowfish
+	crypto/cast5           code.google.com/p/go.crypto/cast5
+	crypto/md4             code.google.com/p/go.crypto/md4
+	crypto/ocsp            code.google.com/p/go.crypto/ocsp
+	crypto/openpgp         code.google.com/p/go.crypto/openpgp
+	crypto/openpgp/armor   code.google.com/p/go.crypto/openpgp/armor
+	crypto/openpgp/elgamal code.google.com/p/go.crypto/openpgp/elgamal
+	crypto/openpgp/errors  code.google.com/p/go.crypto/openpgp/errors
+	crypto/openpgp/packet  code.google.com/p/go.crypto/openpgp/packet
+	crypto/openpgp/s2k     code.google.com/p/go.crypto/openpgp/s2k
+	crypto/ripemd160       code.google.com/p/go.crypto/ripemd160
+	crypto/twofish         code.google.com/p/go.crypto/twofish
+	crypto/xtea            code.google.com/p/go.crypto/xtea
+	exp/ssh                code.google.com/p/go.crypto/ssh
+	net/dict               code.google.com/p/go.net/dict
+	net/websocket          code.google.com/p/go.net/websocket
+	exp/spdy               code.google.com/p/go.net/spdy
+	encoding/git85         code.google.com/p/go.codereview/git85
+	patch                  code.google.com/p/go.codereview/patch
+
+Gofix will update imports of these packages to use the new import paths.
+Installations that depend on these packages will need to install them using a
+'go get' command.
+
+Other changes:
+* 6c, 8c: make floating point code NaN-safe.
+* 6l, 8l: remove unused macro definition (thanks Shenghou Ma).
+* archive/tar: fix race in TestNonSeekable.
+* archive/zip: add functions to convert between os.FileInfo & FileHeader.
+* build: do not build all C compilers (thanks Shenghou Ma),
+	remove code now in subrepositories.
+* bytes: remove dead code, complete documentation,
+	restore panic on out-of-memory,
+	turn buffer size overflows into errors.
+* cgo: -cdefs should translate unsafe.Pointer to void * (thanks Shenghou Ma).
+* cmd/gc: forgotten recursion on ninit itself in order.c.
+* cmd/go: bug fixes, implement go get,
+	correctly handle -n and -x flags for 'go run' (thanks Shenghou Ma),
+	solve ambiguity of get lp.net/project/foo (thanks Gustavo Niemeyer),
+	update doc.go with text generated from the usage strings.
+* cmd/goapi: new tool for tracking exported API over time.
+* codereview: support for subrepositories.
+* compress/flate: fix a typo, improve compression rate by 3-4%,
+	increase the length of hash table from 1<<15 to 1<<17. 0%-16% speedup,
+	make lazy matching work,
+	reduce memory pressure at cost of additional arithmetic operation,
+	use append instead of slice+counter.
+* crypto: rename some FooError to ErrFoo.
+* dashboard: fix -commit for new xml package.
+* database/sql: add NullInt64, NullFloat64, NullBool (thanks James P. Cooper),
+	convert SQL null values to []byte as nil (thanks James P. Cooper),
+	fix Tx.Query (thanks Blake Mizerany).
+* doc: expand FAQ on GOMAXPROCS, update to Go 1.
+* doc/go1: add encoding/xml and net/url changes (thanks Gustavo Niemeyer),
+	add more info about hash and net changes, delete reference to html,
+	add flag, runtime, testing, image , mime, filepath.Walk,
+	document sub-repositories.
+* encoding/binary: document that PutVarint, PutUvarint may panic.
+* encoding/varint: deleted WriteXvarint.
+* encoding/xml: add docs for ignoring tag (thanks Gustavo Niemeyer),
+	bring API closer to other packages (thanks Gustavo Niemeyer),
+	improve []byte handling (thanks Gustavo Niemeyer),
+	remove Marshaler support (thanks Gustavo Niemeyer),
+	support ignoring fields with "-" (thanks Gustavo Niemeyer).
+* exp/ebnflint: test spec during 'go test'.
+* exp/norm: fixes a subtle bug introduced by change 10087: random offset.
+* gc, runtime: handle floating point map keys.
+* gc: avoid DOT in error messages,
+	do not try to add a key with incorrect type to a hash (thanks Jeff R. Allen),
+	fix order of evaluation,
+	fix recursion loop in interface comparison,
+	handle function calls in arguments to builtin complex operations,
+	missed typecheck in subscripting a const string,
+	permit unsafe.Pointer for inlined functions,
+	softer criteria for inlinability,
+	static implements check on typeswitches only applies to concrete case types,
+	test case for recursive interface bug.
+* go/ast: respect ImportSpec.EndPos (thanks Scott Lawrence).
+* go/build: add BuildTags to Context, allow !tag.
+* go/doc: rewrite and add lots of tests.
+* go/parser: use explicit parser.Mode type.
+* go/printer, gofmt: respect line breaks in signatures.
+* go/scanner: use explicit scanner.Mode type.
+* gob: annotate debug.go so it's not normally built,
+	reduce the maximum message size.
+* godoc: log node printing error,
+	move overview before API TOC,
+	update metadata upon launch.
+* gofix: add -debug flag for quicker diagnosis of internal errors,
+	handle xml.Unmarshal in xmlapi fix (thanks Gustavo Niemeyer),
+	update go1pkgrename for subrepositories.
+* goyacc: fix indexing bug when yydebug >= 2.
+* ld: fix Mach-O code signing for non-cgo binaries (thanks Mikkel Krautz).
+* libmach: cross compiling support (thanks Shenghou Ma).
+* math/big: assembly versions of bitLen for x86-64, 386, and ARM (thanks David G. Andersen),
+	return type of bitLen is an int; use MOVL on amd64 (thanks David G. Andersen),
+	add examples for Rat and Int's SetString and Scan methods,
+	slight improvement to algorithm used for internal bitLen function (thanks David G. Andersen),
+	test both bitLen and bitLen_g.
+* net/http: add Request.RequestURI field,
+	disabled test for Transport race / deadlock bug,
+	fix Transport deadlock (thanks Yoshiyuki Kanno),
+	make ParseForm ignore unknown content types (thanks Roger Peppe),
+	parse CONNECT requests (thanks Andrew Balholm).
+* net/rpc: fix data race in benchmark,
+	fix race in TestClientWriteError test,
+	log Call reply discard.
+* net: Dial, ListenPacket with "ip:protocol" network for raw IP sockets (thanks Mikio Hara),
+	actually reset deadline when time is zero,
+	consistent OpError message (thanks Mikio Hara),
+	fix dialing google test (thanks Mikio Hara),
+	make WriteTo fail when UDPConn is already connected (thanks Mikio Hara).
+* regexp: remove vestigial Error type.
+* runtime: add type algorithms for zero-sized types,
+	move NumCPU declaration into debug.go.
+* spec: function invocation, panic on *nil.
+* syscall: add NOTE_* constants on OS X (thanks Robert Figueiredo).
+* test: explicitly use variables to avoid gccgo "not used" error.
+* text/template: add example for Template.
+
+ +

2012-01-20

+ +
+This weekly snapshot renamed the exp/sql package to database/sql, and moved
+utf8.String from unicode/utf8 to exp/utf8string.
+
+Package net's SetTimeout methods were changed to SetDeadline.
+
+Many functions in package os now take a os.FileMode argument instead of a
+plain uint32. An os.ModeSticky constant is also now defined.
+
+The meaning of the first buffer element for image.YCbCr has changed to match
+the semantics of the other image types like image.RGBA.
+
+The NewMD5, NewSHA1 and NewSHA256 functions in crypto/hmac have been
+deprecated. Use New instead, explicitly passing the hash function.
+
+Other changes:
+* buildscripts: move to buildscript directory (thanks Shenghou Ma).
+* bytes: add the usual copyright notice to example_test.go (thanks Olivier Duperray).
+* cmd/go: remove mentions of 'gotest' from the documentation,
+	skip _obj directories in package scans.
+* container/heap: better package documentation.
+* crypto/elliptic: add constant-time P224.
+* crypto/hmac: Add HMAC-SHA224 and HMAC-SHA384/512 (thanks Luit van Drongelen),
+* crypto/tls: add FreeBSD root certificate location (thanks Shenghou Ma).
+* crypto/x509: remove explicit uses of rsa.
+* doc: various updates (thanks Jongmin Kim, Scott Lawrence, Shenghou Ma, Stefan Nilsson).
+* encoding/json: allow / and % in tag names,
+	document angle bracket escaping,
+	fix comments, tweak tests for tag names (thanks Mikio Hara).
+* encoding/xml: marshal/unmarshal xml.Name in field (thanks Gustavo Niemeyer).
+* exp/inotify: fix data race in linux tests.
+* exp/proxy: fix build after URL changes (thanks Gustavo Niemeyer).
+* exp/sql: copy when scanning into []byte by default,
+	rename NullableString to NullString and allow its use as a parameter.
+* exp/ssh: add marshal functions for uint32 and uint64 types,
+	handle versions with just '\n',
+	rename (some) fields (thanks Christopher Wedgwood).
+* exp/terminal: fix build on non-Linux using Makefiles.
+* fmt: enable and fix malloc test,
+* gc: don't emit pkgpath for error type,
+	don't fault on return outside function (thanks Scott Lawrence),
+	fieldnames in structliterals in exported inlines should not be qualified if they're embedded builtin types,
+	fix infinite recursion for embedded interfaces,
+	give esc.c's sink an orig so -mm diagnostics work again,
+	handle printing of string/arrayrune conversions.
+	remove redundant code (thanks Shenghou Ma).
+* go/build: no back slash in FindTree returned pkg name (thanks Alex Brainman).
+* go/doc: collect imports,
+	don't shadow receiver.
+	rewrote and completed test framework.
+	print only one newline between paragraphs
+* go/parser: expressions may have comments.
+* go/scanner: fix example (thanks Olivier Duperray).
+* go/token: replaced Files() with Iterate().
+* godoc: add anchors to cmd documentation headings,
+	remove "need more packages?" link,
+	specify HTML page metadata with a JSON blob,
+	support canonical Paths in HTML metadata.
+* html/template: fix docs after API changes (thanks Gustavo Niemeyer).
+* html: in foreign content, check for HTML integration points in breakout.
+* image/color: rename modelYCbCr to yCbCrModel (thanks Benny Siegert),
+	simplify documentation (thanks David Crawshaw).
+* image: add PixOffset methods.
+* math/rand: decrease test duration in short mode,
+	document default initial seed for global generator (thanks Scott Lawrence).
+* mime: make FormatMediaType take full type for consistency.
+* misc/cgo/test: make tests run on windows (thanks Alex Brainman).
+* net/http/cgi: increase a flaky test timeout.
+* net/http: change test to use override param instead of chan,
+	log handler panic before closing HTTP connection,
+	send cookies in jar on redirect (thanks Jeff Hodges),
+	the documentation should call NewRequest with the right signature (thanks Christoph Hack),
+	update the Client docs a bit.
+* net/url: cleaned up URL interface (v2) (thanks Gustavo Niemeyer).
+* net: consistent log format in test (thanks Mikio Hara),
+	various build fixes (thanks Mikio Hara),
+	use NewTimer, not NewTicker, in fd_windows.go.
+* old/netchan: fix data race on client hashmap.
+* os/exec: trivial allocation removal in LookPath (thanks Gustavo Niemeyer).
+* os: remove old note about NewSyscallError being special (thanks Alex Brainman),
+* path: added examples (thanks Sanjay Menakuru).
+* pkg: Add and fix Copyright of "hand generated" files (thanks Olivier Duperray),
+	add missing godoc comments to windows versions (thanks Alex Brainman).
+* regexp: add SubexpNames.
+* runtime: implement runtime.usleep for FreeBSD/386 and amd64 (thanks Shenghou Ma),
+	madvise and SysUnused for Darwin (thanks Dave Cheney).
+* sync/atomic: fix data race in tests.
+* syscall: add Unix method to TimeSpec, TimeVal,
+	fix plan9 build (thanks Mikio Hara).
+* test: change several tests to not print,
+	fix bug364 to actually run,
+	match gccgo error messages for bug345,
+	split golden.out into expected output per test.
+* testing: do not recover example's panic (thanks Shenghou Ma),
+	document examples.
+* text/template/parse: use human error prints.
+* text/template: fix nil error on redefinition.
+* time: add Since, which returns the time elapsed since some past time t.
+
+ +

2012-01-15

+ +
+This weekly snapshot includes two package changes that may require changes to
+client code.
+
+The image package's Tiled type has been renamed to Repeated.
+
+The encoding/xml package has been changed to make more idiomatic use of struct
+tags, among other things. If you use the xml package please read the change
+description to see if your code is affected:
+	http://code.google.com/p/go/source/detail?r=70e914beb409
+
+Function inlining is now enabled by default in the gc compiler.
+
+Other changes:
+* bytes: Buffer read of 0 bytes at EOF shouldn't be an EOF.
+* cgo: if value for constant did not parse, get it from DWARF info,
+	write _cgo_export.h to object directory, not source dir.
+* cmd/go: add -p flag for parallelism (like make -j),
+	add -v flag to build and install,
+	add ... patterns in import path arguments,
+	fix data race during build,
+	fix import directory list for compilation,
+	fix linker arguments,
+	handle cgo pkg-config pragmas,
+	handle path to cmd directory,
+	include test files in fmt, vet, and fix (thanks Sanjay Menakuru),
+	kill test processes after 10 minutes,
+	pass arguments to command for run (thanks Eric Eisner),
+	rely on exit code to tell if test passed,
+	use relative paths in go fix, go fmt, go vet output.
+* cmd/gofmt: fix simplify.go by running gofmt on cmd/gofmt (thanks Olivier Duperray).
+* crypto/openpgp: assorted cleanups,
+	truncate hashes before checking DSA signatures.
+* crypto/tls: improve TLS Client Authentication (thanks Jeff R. Allen),
+	update generate_cert.go for new time package.
+* dashboard: better caching, bug fixes.
+* doc: update "How to Write Go Code" to use the go tool.
+	fix broken function codewalk examples.
+* encoding/asn1: document support for *big.Int (thanks Florian Weimer).
+* encoding/gob: fix panic when decoding []byte to incompatible slice types (thanks Alexey Borzenkov).
+* encoding/json: don't marshal special float values (thanks Evan Shaw).
+* encoding/xml: major Go 1 fixup (thanks Gustavo Niemeyer).
+* exp/proxy: new package.
+* exp/sql:  add time.Time support,
+	close Rows on EOF,
+	fix potential corruption in QueryRow.Scan into a *[]byte.
+* exp/ssh: various small fixes (thanks Dave Cheney).
+* exp/terminal: add SetPrompt and handle large pastes,
+	add to level Makefile for the (non-Linux?) systems that need it.
+* flag: add Duration flag type,
+	change Set method Value interface to return error instead of bool.
+* gc: better errors messages,
+	avoid false positives when using scalar struct fields (thanks Rémy Oudompheng),
+	closure code gen improvements,
+	disallow declaration of variables outside package,
+	fix switch on interface values (thanks Rémy Oudompheng),
+	inlining bug fixes,
+	improve unsafe.Pointer type-check error messages (thanks Ryan Hitchman),
+	put limit on size of exported recursive interface (thanks Lorenzo Stoakes),
+* go-mode.el: fix syntax highlighting of backticks (thanks Florian Weimer).
+* go/ast: remove unnecessary result value from ast.Fprint/Print.
+* go/build: allow colon in #cgo flags,
+	pass CgoLDFLAGS at end of link command.
+* go/doc: new API, don't ignore anonymous non-exported fields, initial testing support.
+* go/parser: remove unused Parse* functions. Simplified ParseExpr signature.
+* go/printer: don't crash if AST contains BadXXX nodes.
+* go/scanner: 17% faster scanning, remove InsertSemis mode.
+* goinstall: use correct checkout URL for Google Code svn repos.
+* gotest: make _testmain.go conform to gofmt rules (thanks Benny Siegert).
+* goyacc: fix units.y build breakage (thanks Shenghou Ma).
+* html/template: reenable testcases and fix mis-escaped sequences (thanks Mike Samuel).
+* html: "in select in table" insertion mode (thanks Andrew Balholm),
+	adjust foreign attributes,
+	foreign element HTML integration points, tag name adjustment,
+	parse  inside body (thanks Andrew Balholm),
+	propagate foreign namespaces only when adding foreign content.
+* json: better error messages when the ,string option is misused.
+* ld: parse but do not implement -X flag.
+* log/syslog: add Alert method (thanks Vadim Vygonets).
+* make.bash: remove old dregs (thanks Alex Brainman).
+* math/big: simplify fast string conversion.
+* math: fix typo in all_test.go (thanks Charles L. Dorian).
+* misc/windows: add src/pkg/runtime/z* files to installation script (thanks Alex Brainman).
+* net/http: don't ignore Request.Write's Flush error,
+	allow cookies with negative Max-Age attribute as these are (thanks Volker Dobler).
+* net/textproto: avoid corruption when reading a single header.
+* net: add IP-level socket option helpers for Unix variants (thanks Mikio Hara),
+	fix incorrect mode on ListenIP, ListenUDP (thanks Mikio Hara),
+	make use of the kernel state to listen on TCP, Unix (thanks Mikio Hara),
+	platform-dependent default socket options (thanks Mikio Hara).
+* os: add ModeCharDevice.
+* runtime: add NumCPU,
+	delete duplicate implementation of pcln walker,
+	distinct panic message for call of nil func value,
+	enable runtime.ncpu on FreeBSD (thanks Devon H. O'Dell),
+	make garbage collector faster by deleting code,
+	regenerate defs_darwin_{386,amd64}.h (thanks Dave Cheney),
+	runtime.usleep() bugfix on darwin/amd64 and linux/arm (thanks Shenghou Ma).
+* spec: pointer comparison for pointers to 0-sized variables,
+	change the wording regarding select statement choice.
+* strconv: fix round up corner case,
+	faster FormatFloat(x, *, -1, 64) using Grisu3 algorithm (thanks Rémy Oudompheng),
+	implement fast path for rounding already short numbers (thanks Rémy Oudompheng),
+	return ErrSyntax when unquoting illegal octal sequences.
+* syscall: linux-only support for parent death signal (thanks Albert Strasheim),
+	make Environ return original order.
+* testing: fix defer race,
+	use flag.Duration for -timeout flag.
+* text/template: handle panic values that are not errors (thanks Rémy Oudompheng),
+	for range on a map, sort the keys if feasible.
+* time: add ParseDuration,
+	fix docs for After and NewTicker.
+* windows: use ArbitraryUserPointer as TLS slot (thanks Wei Guangjing).
+
+ +

2011-12-22

+ +
+This snapshot includes changes to the images/ycbcr and testing packages, and
+changes to the build system.
+
+The types for managing Y'CbCr images in the image/ycbcr have been moved to the
+image and image/color packages. A gofix module will rewrite affected code.
+
+The testing package's B type (used when running benchmarks) now has the same
+methods as T (used in tests), such as Print, Error, and Fatal.
+
+This weekly adds a new command named 'go' for building and testing go programs.
+For Go 1, the go command will replace the makefile-based approach that we have
+been using. It is not yet ready for general use, but all.bash does use it to
+build the tree. If you have problems building the weekly, you can 'export
+USE_GO_TOOL=false' before running all.bash to fall back to the makefiles.
+
+Other changes:
+* archive/zip: add SetModTime method to FileHeader.
+* build: make use of env (thanks Mikio Hara),
+	fixes to make "go install" work on windows (thanks Alex Brainman).
+* bytes: add two Buffer examples.
+* cgo: support export for built-in types (thanks Maxim Pimenov).
+* cmd/go: avoid infinite loop with package specific flags (thanks Mikio Hara),
+	fixes to build standard library,
+	implement test command,
+	make sure use of pthread for gcc-4.5 and beyond (thanks Mikio Hara),
+	respect $GCFLAGS,
+	use spaces consistently in help message (thanks Roger Peppe),
+	many other improvements.
+* codereview: initialize "found" in codereview.py (thanks Miki Tebeka).
+* crypto/mime/net/time: add netbsd to +build tags (thanks Joel Sing).
+* crypto/tls: don't assume an RSA private key in the API.
+* crypto/x509: don't crash with nil receiver in accessor method.
+* doc/effective_go: discuss redeclaration.
+* doc: delete go course notes,
+	refer to http://build.golang.org/ where applicable (thanks Robert Hencke),
+	suggest code.google.com/p/go instead of go.googlecode.com/hg.
+* encoding/binary: add Write and Read examples,
+	add more benchmarks (thanks Roger Peppe).
+* encoding/gob: arrays are zero only if their elements are zero.
+* encoding/json: cleanup leftover variables in array decoding (thanks Rémy Oudompheng),
+	examples for Marshal and Unmarshal.
+* exp/ssh: rename ClientAuthPublicKey helper ClientAuthKeyring (thanks Dave Cheney),
+	simplify Stdin/out/errPipe methods (thanks Dave Cheney).
+* fmt: speed up floating point print, clean up some code,
+	make the malloc test check its counts.
+* gc: allow use of unsafe.Pointer in generated code,
+	avoid unsafe in defn of package runtime,
+	better linenumbers for inlined functions,
+	better loopdepth analysis for labels,
+	implement and test \r in raw strings,
+	inlining, allow empty bodies, fix _ arguments,
+	omit argument names from function types in error messages.
+* go/ast, parser: remember short variable decls. w/ correspoding ident objects.
+* go/build: add new +build tags 'cgo' and 'nocgo'.
+* go/doc, godoc: move export filtering into go/doc
+* go/printer, gofmt: fine tuning of line spacing.
+* go/scanner: strip CRs from raw literals.
+* gob: isZero for struct values.
+* godoc: allow examples for methods (thanks Volker Dobler),
+	show methods of anonymous fields.
+* goinstall: only suggest -fix for bad imports when appropriate.
+* govet: add checking for printf verbs,
+	divide the program into one file per vetting suite.
+* html: more parser improvements (thanks Andrew Balholm).
+* json: some tests to demonstrate bad error messages,
+	use strconv.Append variants to avoid allocations in encoding.
+* ld: add support for netbsd signature note section (thanks Joel Sing),
+	allow for IMAGE_REL_AMD64_ADDR32NB relocation type (thanks Alex Brainman).
+* math/big: Rand shouldn't hang if argument is also receiver.
+* misc/builder: set default builder host to build.golang.org.
+* misc/dashboard: delete old build dashboard code ,
+	improvements and fixes for the go implementation.
+* misc/vim: fix go filetype detection (thanks Paul Sbarra).
+* net, syscall, os: set CLOEXEC flag on epoll/kqueue descriptor.
+* net, syscall: interface address and mask (thanks Mikio Hara).
+* net/http: added interface for a cookie jar (thanks Volker Dobler),
+	test fixes (thanks Alex Brainman).
+* net: add DialTimeout,
+	sort Makefile entries (thanks Mikio Hara).
+* os, syscall: beginnings of NetBSD support (thanks Christopher Nielsen).
+* os/exec: add test to verify net package's epoll fd doesn't go to child,
+	disable the ExtraFiles test on darwin.
+* os: don't trust O_CLOEXEC on OS X,
+	make sure Remove returns correct error on windows (thanks Alex Brainman).
+* path, path/filepath: add Dir to complement Base.
+* path/filepath.Rel: document that the returned path is always relative.
+* runtime: don't panic on SIGILL, just crash.
+* spec: be precise about newlines.
+* sql: add Rows.Columns.
+* strconv: fix bug in extended-float based conversion,
+	implement faster parsing of decimal numbers, and
+	reduce buffer size for multi-precision decimals (thanks Rémy Oudompheng).
+* syscall: regenerate z-files for linux/arm (thanks Mikio Hara),
+	sort Makefile, mkall.sh and mkerrors.sh entries (thanks Mikio Hara).
+* test/bench/go1: first draft of Go 1 benchmark suite.
+* testing: compare Log to Println (thanks Robert Hencke),
+	make signalling safer for parallel tests.
+* text/template: better error message for empty templates,
+	fix handing of nil arguments to functions (thanks Gustavo Niemeyer).
+* time: add JSON marshaler for Time (thanks Robert Hencke),
+	new AddDate method (thanks Roger Peppe).
+* various: use $GCFLAGS and $GCIMPORTS like Make does (thanks Maxim Pimenov).
+
+ +

2011-12-14

+ +
+This snapshot includes language changes and changes to goinstall and gofmt.
+
+Equality and inequality (== and !=) are now defined for struct and array
+values, respectively, provided the elements of the data structures can
+themselves be compared. See the Go 1 release notes for the details:
+	http://weekly.golang.org/doc/go1.html#equality
+
+The rune type is now an alias for int32 and character literals have the default
+type of rune. Code that uses int where it should use rune will break. 
+See the Go 1 release notes for the details:
+	http://weekly.golang.org/doc/go1.html#rune
+
+Goinstall now expects Google Code import paths to be of the form:
+	"code.google.com/p/go-tour/tree"
+It will reject imports in the old style "go-tour.googlecode.com/hg/tree".
+There is a gofix module to rename such imports.
+Use goinstall -fix to update broken packages.
+
+Gofmt's flags have been modified slightly.
+The -tabintent flag has been renamed -tabs.
+The -spaces flag has been removed.
+
+Other changes:
+* 5c, 6c, 8c: support 64-bit switch value (thanks Anthony Martin).
+* 8c: handle 64-bit switch value.
+* archive/tar: use struct comparison not DeepEqual (thanks Christopher Wedgwood).
+* archive/zip: make zip understand os.FileMode (thanks Roger Peppe).
+* bufio: make the minimum read buffer size 16 bytes.
+* build: disable cgo on Windows/amd64,
+	regularize packages so they may be built without Makefiles.
+* bytes: faster Count, Index, Equal.
+* cgo: add basic gccgo support (thanks Rémy Oudompheng).
+* codereview: fix path slash issue (thanks Yasuhiro Matsumoto).
+* compress/flate: fix out of bounds error.
+* contribute.html: do not fill in the reviewer field (thanks Florian Weimer).
+* crypto/aes: made faster by eliminating some indirection (thanks Taru Karttunen).
+* crypto/dsa: don't truncate input hashes.
+* doc/go_tutorial: make clear the file example is Unix-specific.
+* doc: add Defer, Panic, and Recover article,
+	add Error Handling article,
+	add Go 1 release notes document.
+* encoding/gob: better error messages when types mismatch.
+* env.bash: export CGO_ENABLED so cgo tests run (thanks Alex Brainman).
+* exp/sql: simplify some string conversions.
+* exp/ssh: Wait returns an *ExitError (thanks Gustav Paul).
+* exp/ssh: improve client channel close behavior (thanks Dave Cheney).
+* fmt: don't recur if String method (etc.) misbehaves.
+* gc: better error messages,
+	inlining (disabled without -l),
+	many bug fixes (thanks Lucio De Re and Rémy Oudompheng).
+* go/printer, godoc: print comments in example code.
+* go: implement doc, fmt, fix, list, vet, build, and install.
+* gobuilder: goinstall packages after building go tree.
+* godoc: <pre> must not occur inside <p> (thanks Olivier Duperray),
+	added an opensearch description document (thanks Christoph Hack),
+	text wrapping.
+* gofix: add httputil fix (thanks Yasuhiro Matsumoto).
+* gotest: use go/build more (thanks Robert Hencke).
+* gzip: convert between Latin-1 and Unicode (thanks Vadim Vygonets).
+* html/template: define the FuncMap type locally.
+* html: a first step at parsing foreign content (MathML, SVG),
+	more parser improvements (thanks Andrew Balholm).
+* http: close connection after printing panic stack trace (thanks Roger Peppe),
+	fix failing Transport HEAD request with gzip-looking response.
+* json: treat renamed byte slices the same as []byte.
+* ld: first pass at linker support for NetBSD binaries (thanks Christopher Nielsen),
+	fix memory leaks (thanks Scott Lawrence),
+	increase default stack size on Windows for cgo.
+* math: delete non-Sqrt-based Hypot,
+	implement, document, and fix special cases (thanks Charles L. Dorian),
+* misc/benchcmp: don't require "Benchmark" at beginning of line.
+* misc/osx: rename profile.go to profile_go (thanks Scott Lawrence).
+* net/http: fix trivial example server (thanks Olivier Duperray),
+	net/http: make test remove temporary file and directory.
+* net/smtp: add CRAM-MD5 authentication (thanks Vadim Vygonets).
+* reflect: fix Slice cap (thanks Gustavo Niemeyer).
+* regexp: performance improvements; avoid allocation of input interface.
+* runtime: bump gc 'extra bytes' check (thanks Christopher Wedgwood),
+	madvise and SysUnused for Linux (thanks Sébastien Paolacci),
+	make gc_test test extra allocated space, not total space,
+	support for NetBSD (thanks Christopher Nielsen).
+* spec: adjust complex constant example (thanks Robert Hencke),
+	values of underlying type uintptr can be converted to unsafe.Pointer,
+	var x = 'a' defaults to type rune.
+* strconv: include package and function name in error strings,
+	make QuoteRune etc. take a rune argument,
+	some performance improvements.
+* syscall: add constants for flock() system call under Linux,
+	regenerate z-files for darwin, freebsd (thanks Mikio Hara),
+	regenerate z-files for openbsd,
+	return error, not uintptr, when function returns error (thanks Alex Brainman).
+* test/bench: move to test/bench/shootout.
+* test/garbage: move to test/bench/garbage.
+* test: make array smaller in nilptr test.
+* time: allow sleep tests to run for 200% too long,
+	fix Time.Add (thanks Hector Chu),
+	fix daysIn for December (thanks Peter Mundy),
+	gob marshaler for Time (thanks Robert Hencke),
+	use Duration for AfterFunc.
+* various: a grab-bag of time.Duration cleanups.
+
+ +

2011-12-06

+ +
+This snapshot includes a language change and changes to the strconv and go/doc
+packages. The package changes require changes to client code.
+The language change is backwards-compatible.
+
+Type elision in arrays, slices, or maps of composite literals has been
+extended to include pointers to composite literals. Code like this
+	var t = []*T{&T{}, &T{}}
+may now be written as
+	var t = []*T{{}, {}}
+You can use gofmt -s to simplify such code.
+
+The strconv package has been given a more idiomatic and efficient interface.
+Client code can be updated with gofix. See the docs for the details:
+	http://weekly.golang.org/pkg/strconv/
+
+The go/doc package's ToHTML function now takes a []byte argument instead of a
+string.
+
+Other changes:
+* crypto/aes: eliminate some bounds checking and truncation (thanks Rémy Oudompheng).
+* crypto/x509: if a parent cert has a raw subject, use it.
+* encoding/gob: don't send type info for unexported fields.
+* exp/ssh: allow for msgUserAuthBanner during authentication (thanks Gustav Paul).
+* fmt: benchmark floating point,
+	only use Stringer or Error for strings.
+* gc: changes in export format in preparation of inlining,
+	disallow map/func equality via interface comparison,
+	use gofmt spacing when printing map type.
+* go/doc: exclude lines ending in ':' from possible headings.
+* gobuilder: -commit mode for packages,
+	cripple -package mode temporarily,
+	use new dashboard protocol.
+* godoc: improved output of examples in html (thanks Volker Dobler).
+* gofmt: handle &T in composite literal simplify.
+* goinstall: honour -install=false flag when -make=true.
+* hash: rewrite comment on Hash.Sum method.
+* html: more parser improvements (thanks Andrew Balholm).
+* image: avoid func comparison during ColorModel comparison.
+* math: add special-cases comments to Sinh and Tanh (thanks Charles L. Dorian).
+* misc/dashboard: further implementation work.
+* net, syscall: remove BindToDevice from UDPConn, IPConn (thanks Mikio Hara).
+* net/mail: correctly compare parsed times in the test.
+* os/exec: make LookPath always search CWD under Windows (thanks Benny Siegert).
+* runtime: prep for type-specific algorithms.
+* strconv: 34% to 63% faster conversions.
+
+ +

2011-12-02

+ +
+This weekly snapshot includes changes to the hash package and a gofix for the
+time and os.FileInfo changes in the last snapshot.
+
+The hash.Hash's Sum method has been given a []byte argument,
+permitting the user to append the hash to an existing byte slice.
+Existing code that uses Sum can pass nil as the argument.
+Gofix will make this change automatically.
+
+Other changes:
+* crypto/tls: cleanup certificate load on windows (thanks Alex Brainman).
+* exp/ssh: add Std{in,out,err}Pipe methods to Session (thanks Dave Cheney).
+* dashboard: don't choke on weird builder names.
+* exp/ssh: export type signal, now Signal (thanks Gustav Paul).
+* os: add ModeType constant to mask file type bits (thanks Gustavo Niemeyer).
+* text/template: replace Add with AddParseTree.
+* go/doc: detect headings and format them in html (thanks Volker Dobler).
+
+ +

2011-12-01

+ +
+This weekly snapshot includes changes to the time, os, and text/template
+packages. The changes to the time and os packages are significant and related.
+Code that uses package time, package text/template, or package os's FileInfo
+type will require changes.
+
+In package time, there is now one type - time.Time - to represent times.
+Note that time.Time should be used as a value, in contrast to old code
+which typically used a *time.Time, a pointer to a large struct.  (Drop the *.)
+Any function that previously accepted a *time.Time, an int64
+number of seconds since 1970, or an int64 number of nanoseconds
+since 1970 should now accept a time.Time.  Especially as a replacement
+for the int64s, the type is good documentation about the meaning of
+its value.
+
+Whether you were previously calling time.Seconds, time.Nanoseconds,
+time.LocalTime, or time.UTC, the replacement is the new function
+time.Now.
+
+If you previously wrote code like:
+
+       t0 := time.Nanoseconds()
+       myFunction()
+       t1 := time.Nanoseconds()
+       delta := t1 - t0
+       fmt.Printf("That took %.2f seconds\n", float64(t1-t0)/1e9)
+
+you can now write:
+
+       t0 := time.Now()
+       myFunction()
+       t1 := time.Now()
+       delta := t1.Sub(t0)
+       fmt.Printf("That took %s\n", delta)
+
+In this snippet, the variable delta is of the new type time.Duration, the
+replacement for the many int64 parameters that were nanosecond
+counts (but not since 1970).
+
+Gofix can do the above conversions and some others, but it does not
+rewrite explicit int64 types as time.Time. It is very likely that you will
+need to edit your program to change these types after running gofix.
+As always, be sure to read the changes that gofix makes using your
+version control system's diff feature.
+
+See http://weekly.golang.org/pkg/time/ for details.
+
+In package os, the FileInfo struct is replaced by a FileInfo interface,
+admitting implementations by code beyond the operating system.
+Code that refers to *os.FileInfo (a pointer to the old struct) should
+instead refer to os.FileInfo (the new interface).
+The interface has just a few methods:
+
+       type FileInfo interface {
+               Name() string       // base name of the file
+               Size() int64        // length in bytes
+               Mode() FileMode     // file mode bits
+               ModTime() time.Time // modification time
+               IsDir() bool        // abbreviation for Mode().IsDir()
+       }
+
+If you need access to the underlying stat_t provided by the operating
+system kernel, you can access it by assuming that the FileInfo you are
+holding is actually an *os.FileStat, and that it's Sys field is actually a
+*syscall.Stat_t, as in:
+
+       dev := fi.(*os.FileStat).Sys.(*syscall.Stat_t).Dev
+
+Of course, this is not necessarily portable across different operating
+systems.
+
+Gofix will take care of rewriting *os.FileInfo to os.FileInfo for you,
+and it will also rewrite expressions like fi.Name into calls like fi.Name().
+
+See http://weekly.golang.org/pkg/os/#FileInfo for details.
+
+The template package has been changed to export a new, simpler API.
+The Set type is gone. Instead, templates are automatically associated by
+being parsed together; nested definitions implicitly create associations.
+Only associated templates can invoke one another.
+This approach dramatically reduces the breadth of the construction API.
+The html/template package has been updated also.
+There's a gofix for the simplest and most common uses of the old API.
+Code that doesn't mention the Set type is likely to work after running gofix;
+code that uses Set will need to be updated by hand.
+The template definition language itself is unchanged.
+
+See http://weekly.golang.org/pkg/text/template/ for details.
+
+
+Other changes:
+* cgo: add support for callbacks from dynamic libraries.
+* codereview: gofmt check for non-src/ files (thanks David Crawshaw).
+* crypto/openpgp/packet: fix private key checksum.
+* crypto/tls: add openbsd root certificate location,
+	don't rely on map iteration order.
+* crypto/x509, crypto/tls: support PKCS#8 private keys.
+* dashboard: start of reimplementation in Go for App Engine.
+* encoding/xml: fix copy bug.
+* exp/gui: move exp/gui and exp/gui/x11 to http://code.google.com/p/x-go-binding
+* exp/ssh: various improvements (thanks Dave Cheney and Gustav Paul).
+* filepath/path: fix Rel buffer sizing (thanks Gustavo Niemeyer).
+* gc: fix Nconv bug (thanks Rémy Oudompheng) and other fixes.
+* go/printer, gofmt: performance improvements.
+* gofix: test and fix missorted renames.
+* goinstall: add -fix flag to run gofix on packages on build failure,
+	better error reporting,
+	don't hit network unless a checkout or update is required,
+	support Google Code sub-repositories.
+* html: parser improvements (thanks Andrew Balholm).
+* http: fix sniffing bug causing short writes.
+* json: speed up encoding, caching reflect calls.
+* ld: align ELF data sections.
+* math/big: fix destination leak into result value (thanks Roger Peppe),
+	use recursive subdivision for significant speedup.
+* math: faster Cbrt and Sincos (thanks Charles L. Dorian).
+* misc/osx: scripts to make OS X package and disk image (thanks Scott Lawrence).
+* os: fail if Open("") is called on windows (thanks Alex Brainman).
+* runtime: make sure stack is 16-byte aligned on syscall (thanks Alex Brainman).
+* spec, gc: allow direct conversion between string and named []byte, []rune.
+* sql: add Tx.Stmt to use an existing prepared stmt in a transaction,
+	more driver docs & tests; no functional changes.
+* strings: add ContainsAny and ContainsRune (thanks Scott Lawrence).
+* syscall: add SUSv3 RLIMIT/RUSAGE constants (thanks Sébastien Paolacci),
+	fix openbsd sysctl hostname/domainname workaround,
+	implement Syscall15 (thanks Alex Brainman).
+* time: fix Timer stop.
+
+ +

2011-11-18

+ +
+This snapshot includes some language changes.
+
+Map and function value comparisons are now disallowed (except for comparison
+with nil) as per the Go 1 plan. Function equality was problematic in some
+contexts and map equality compares pointers, not the maps' content.
+
+As an experiment, structs are now allowed to be copied even if they contain
+unexported fields. This gives packages the ability to return opaque values in
+their APIs.
+
+Other changes:
+* 6a, 8a: allow $(-1) for consistency with $1, $(1), $-1.
+* 6l: code generation fixes (thanks Michał Derkacz).
+* build: fix check for selinux allow_execstack on Fedora (thanks Bobby Powers).
+* builtin: document delete.
+* cgo: don't panic on undeclared enums/structs (thanks Rémy Oudompheng),
+	fix g0 stack guard.
+* crypto/tls: fix handshake message test.
+* crypto: update incorrect references to Cipher interface; should be Block.
+* doc: clean ups, additions, and fixes to several documents.
+* doc/install: add openbsd (thanks Joel Sing!).
+* doc: link to Chinese translation of A Tour of Go.
+* encoding/json: add marshal/unmarshal benchmark,
+	decode [] as empty slice, not nil slice,
+	make BenchmarkSkipValue more consistent.
+* env.bash: check for presence of make/gmake (thanks Scott Lawrence).
+* exp/sql: NumInput() allow -1 to ignore checking (thanks Yasuhiro Matsumoto),
+	add DB.Close, fix bugs, remove Execer on Driver (only Conn),
+	document that for drivers, io.EOF means no more rows,
+	add client side support for publickey auth (thanks Dave Cheney),
+	add direct-tcpip client support (thanks Dave Cheney),
+	change test listen address, also exit test if fails,
+	other fixes and improvements (thanks Dave Cheney).
+* exp/terminal: rename shell to terminal and add SetSize.
+* fcgi: fix server capability discovery.
+* fmt: distinguish empty vs nil slice/map in %#v.
+* gc: better error, type checks, and many fixes,
+	remove m[k] = x, false syntax (use delete(m, k) instead),
+	support for building with Plan 9 yacc (thanks Anthony Martin).
+* go/printer: make //line formatting idempotent.
+* godefs: delete, replaced by cgo -godefs.
+* godoc: document -templates flag, fix remote search,
+	provide mode for flat (non-indented) directory listings.
+* gofmt: leave nil nodes of the AST unchanged (thanks Rémy Oudompheng).
+* html/template: indirect top-level values before printing.
+* html: more parser improvements (thanks Andrew Balholm).
+* http: fix serving from CWD with http.ServeFile,
+	make Dir("") equivalent to Dir(".").
+* ld: fix .bss for ldpe (thanks Wei Guangjing).
+* math/big: replace nat{} -> nat(nil).
+* math: faster Lgamma (thanks Charles L. Dorian).
+* mime: implement TypeByExtension for windows.
+* misc/bbedit: error and rune support (thanks Anthony Starks).
+* misc/benchcmp: benchmark comparison script.
+* misc/emacs: add delete builtin (thanks Bobby Powers).
+* misc/kate: add error and rune (thanks Evan Shaw).
+* misc/notepadplus: error and rune support (thanks Anthony Starks).
+* misc/windows: Windows installer in MSI format (thanks Joe Poirier).
+* net, io/ioutil: remove use of os.Time (thanks Anthony Martin).
+* net/http: fix EOF handling on response body (thanks Gustavo Niemeyer),
+	fix sniffing when using ReadFrom,
+	use t.Errorf from alternate goroutine in test.
+* os: remove undocumented Envs (use os.Environ instead).
+* reflect: empty slice/map is not DeepEqual to nil,
+	make Value an opaque struct.
+* runtime, syscall: convert from godefs to cgo.
+* runtime: add nanotime for Plan 9 (thanks Anthony Martin),
+	add timer support, use for package time,
+	avoid allocation for make([]T, 0).
+* strconv: add Ftoa benchmarks, make Ftoa faster.
+* syscall: delete syscall.Sleep, take over env implementation, use error.
+* testing: add file:line stamps to messages, print results to standard output.
+* text/template: refactor set parsing.
+* time: add ISOWeek method to Time (thanks Volker Dobler).
+* various: avoid func compare, reduce overuse of os.EINVAL + others.
+
+ +

2011-11-09

+ +
+This weekly snapshot renames various Go packages as described in the Go 1 plan.
+Import statements in client code can be updated automatically with gofix.
+
+The changes are:
+	asn1              -> encoding/asn1
+	big               -> math/big
+	cmath             -> math/cmplx
+	csv               -> encoding/csv
+	exec              -> os/exec
+	exp/template/html -> html/template
+	gob               -> encoding/gob
+	http              -> net/http
+	http/cgi          -> net/http/cgi
+	http/fcgi         -> net/http/fcgi
+	http/httptest     -> net/http/httptest
+	http/pprof        -> net/http/pprof
+	json              -> encoding/json
+	mail              -> net/mail
+	rpc               -> net/rpc
+	rpc/jsonrpc       -> net/rpc/jsonrpc
+	scanner           -> text/scanner
+	smtp              -> net/smtp
+	syslog            -> log/syslog
+	tabwriter         -> text/tabwriter
+	template          -> text/template
+	template/parse    -> text/template/parse
+	rand              -> math/rand
+	url               -> net/url
+	utf16             -> unicode/utf16
+	utf8              -> unicode/utf8
+	xml               -> encoding/xml
+
+ +

2011-11-08

+ +
+This weekly snapshot includes some package changes.
+
+In preparation for the Go 1 package reorganziation the sources for various
+packages have been moved, but the import paths remain unchanged. This
+inconsistency breaks goinstall at this snapshot. If you use goinstall, please
+stay synced to the previous weekly snapshot until the next one is tagged.
+
+The Error methods in the html, bzip2, and sql packages that return error values
+have been renamed to Err.
+
+Some non-core parts of the http package have been moved to net/http/httputil.
+The Dump* and NewChunked* functions and ClientConn, ServerConn, and
+ReverseProxy types have been moved from http to httputil.
+
+The API for html/template is now a direct copy of the template API, instead of
+exposing a single Escape function. For HTML templates, use the
+html/template package as you would the template package.
+
+Other changes:
+* all: rename os.EOF to io.EOF in non-code contexts (thanks Vincent Vanackere),
+	sort imports with gofix.
+* archive/zip: close file opened with OpenReader (thanks Dmitry Chestnykh).
+* bufio: return nil line from ReadLine on error, as documented.
+* builtin: document basic types and the built-in error type.
+* bytes: add Contains function.
+* exp/sql: finish implementation of transactions, flesh out types, docs.
+* exp/ssh: improved client authentication support (thanks Dave Cheney).
+* gc: better error message for range over non-receive channel,
+	bug fixes and clean-ups,
+	detect type switch variable not used cases,
+	fix escaping of package paths in symbol names,
+	helpful error message on method call on pointer to pointer,
+	portably read archive headers (thanks Ron Minnich).
+* gob: fix bug when registering the same type multiple times.
+* gofix: avoid panic on body-less functions in netudpgroup,
+	make fix order implicit by date.
+* gofmt, gofix: sort imports.
+* goinstall: support launchpad.net/~user branches (thanks Jani Monoses).
+* gopack: do not look for Go metadata in non-Go objects.
+* gotest: don't run examples that have no expected output.
+* html: the parser bug fixing campaign continues (thanks Andrew Balholm).
+* http: fix whitespace handling in sniffer,
+	only recognize application/x-www-form-urlencoded in ParseForm,
+	support Trailers in ReadRequest.
+* lib9: add ctime.
+* math: faster Gamma (thanks Charles L. Dorian),
+	improved accuracy for Tan (thanks Charles L. Dorian),
+	improved high-angle test for Cos, Sin and Tan (thanks Charles L. Dorian).
+* net: implement LookupTXT for windows (thanks Alex Brainman).
+* os,text,unicode: renamings.
+* runtime/cgo: fix data declaration to be extern.
+* runtime: add timespec definition for freebsd,
+	add windows callback tests (thanks Alex Brainman),
+	fix prototype for openbsd thrsleep,
+	fix set and not used,
+	unify mutex code across OSes,
+	windows_386 sighandler to use correct g (thanks Alex Brainman).
+* template: format error with pointer receiver,
+	make redefinition of a template in a set more consistent.
+* test: clear execute bit from source file (thanks Mikio Hara),
+	make closedchan.go exit with failure if something fails.
+* time: faster Nanoseconds call.
+* websocket: return an error HTTP response for bad websocket request.
+* xml: allow parsing of <_> </_>. (thanks David Crawshaw).
+
+ +

2011-11-02 (new error type)

+ +
+This snapshot introduces the built-in error type, defined as
+
+       type error interface {
+               Error() string
+       }
+
+The error type replaces os.Error. Notice that the method name has changed from
+String to Error. Package fmt's Print formats both Stringers and errors:
+in general there is no need to implement both String and Error methods.
+
+Gofix can update most code. If you have split your package across many files,
+it may help to use the -force=error command-line option, which forces gofix to
+apply the error fix even if it is not obvious that a particular file needs it.
+As always, it is a good idea to read and test the changes that gofix made
+before committing them to your version control system.
+
+ +

2011-11-01

+ +
+* 6l: remove mention of -e flag - it does nothing.
+* cc: change cas to newcase (thanks Ron Minnich).
+* crypto/openpgp/error: use Error in names of error impl types.
+* crypto/rsa: change public exponent from 3 to 65537.
+* crypto/tls: add Error method to alert.
+* doc: add link to A Tour of Go in Japanese,
+	add 'all' make rule to build all docs,
+	refer to tour.golang.org instead of go-tour.appspot.com.
+* exp/norm: fixed bug that crept in with moving to the new regexp.
+* exp/ssh: fix length header leaking into channel data (thanks Dave Cheney).
+* fmt: handle os.Error values explicity (as distinct from Stringer).
+* gc: clean up printing,
+	fix [568]g -V crash (thanks Mikio Hara),
+	test + fix escape analysis bug.
+* go/build: avoid os.Error in tests.
+* go/doc: remove os.NewError anti-heuristic.
+* go/parser: test and fix := scoping bug.
+* gob: split uses of gobError, remove unnecessary embedding.
+* gofix: test import insertion, deletion.
+* goinstall: intelligent vcs selection for common sites (thanks Julian Phillips).
+* gopack: change archive file name length back to 16.
+* html: fix print argument in test,
+	more parser improvements (thanks Andrew Balholm).
+* json: properly handle nil slices (thanks Alexander Reece).
+* math: improved accuracy for Sin and Cos (thanks Charles L. Dorian).
+* misc/emacs: fix restoration of windows after gofmt (thanks Jan Newmarch).
+* misc/vim: add rune keyword (thanks Jongmin Kim).
+* misc/windows: can be used for amd64 (thanks Alex Brainman).
+* net: document why we do not use SO_REUSEADDR on windows (thanks Alex Brainman).
+* os: do not interpret 0-length read as EOF.
+* pkg: remove .String() from some print arguments.
+* rpc: avoid infinite loop on input error.
+* runtime/pprof: document OS X being broken.
+* runtime: lock the main goroutine to the main OS thread during init.
+* spec: define that initialization is sequential.
+* strconv: use better errors than os.EINVAL, os.ERANGE.
+* syscall: fix Await msg on Plan 9 (thanks Andrey Mirtchovski).
+* template: do not use error as stringer,
+	fix error checking on execute without parse (thanks Scott Lawrence).
+* test/alias.go: additional tests.
+* test: error-related fixes.
+* textproto: prevent long lines in HTTP headers from causing HTTP 400 responses.
+* time: add RFC1123 with numeric timezone format (thanks Scott Lawrence).
+
+ +

2011-10-26 (new rune type)

+ +
+This snapshot introduces the rune type, an alias for int that
+should be used for Unicode code points.
+
+A future release of Go (after Go 1) will change rune to be an
+alias for int32 instead of int.  Using rune consistently is the way
+to make your code build both before and after this change.
+
+To test your code for rune safety, you can rebuild the Go tree with
+
+	GOEXPERIMENT=rune32 ./all.bash
+
+which builds a compiler in which rune is an alias for int32 instead of int.
+
+Also, run govet on your code to identify methods that might need to have their
+signatures updated.
+
+ +

2011-10-25

+ +
+* big: make SetString return nil if an error occurs,
+	new Rat.Inv method,
+	usable zero Rat values without need for explicit initialization.
+* codereview: show LGTMs in hg p.
+* crypto/x509: fix names in certificate generation.
+* exp/ssh: add experimental ssh client,
+	introduce Session to replace Cmd for interactive commands,
+	server cleanups (thanks Dave Cheney).
+* exp/types: fix crash in parseBasicType on unknown type.
+* fmt: don't panic formatting nil interfaces (thanks Gustavo Niemeyer).
+* go/ast, go/token: actually run tests; fix go/ast test.
+* gotest: explicit -help flag, use $GCFLAGS like make does.
+* govet: check canonical dynamic method signatures.
+* html: improved parsing (thanks Andrew Balholm),
+	parse <select> tags, parse and render comment nodes,
+	remove the Tokenizer.ReturnComments option.
+* http: Transport: with TLS InsecureSkipVerify, skip hostname check.
+* misc/vim: add highlighting for delete (thanks Dave Cheney).
+* net: do not set SO_REUSEADDR for windows (thanks Alex Brainman).
+* os/inotify: move to exp/inotify (thanks Mikio Hara).
+* runtime: include bootstrap m in mcpu accounting (thanks Hector Chu).
+* syscall: use uintptr for Mount flags.
+
+ +

2011-10-18

+ +
+This weekly snapshot includes some language and package changes that may
+require code changes. Please read these notes carefully, as there are many
+changes and your code will likely be affected.
+
+The syntax for map deletion has been changed. Code that looks like:
+	m[x] = 0, false
+should be written as:
+	delete(m, x)
+The compiler still accepts m[x] = 0, false for now; even so, you can use gofix
+to rewrite such assignments into delete(m, x).
+
+The Go compiler will reject a return statement without arguments when any of
+the result variables has been shadowed. Code rejected as a result of this
+change is likely to be buggy.
+
+Receive-only channels (<-chan T) cannot be closed.
+The compiler will diagnose such attempts.
+
+The first element of a map iteration is chosen at random. Code that depends on
+iteration order will need to be updated.
+
+Goroutines may be run during program initialization.
+
+A string may be appended to a byte slice. This code is now legal:
+	var b []byte
+	var s string
+	b = append(b, s...)
+
+The gotry command and its associated try package have been deleted.
+It was a fun experiment that - in the end - didn't carry its weight.
+
+The gotype tool has been moved to exp/gotype and its associated go/types
+package has been moved to exp/types. The deprecated go/typechecker package has
+been deleted.
+
+The enbflint tool has been moved to pkg/exp/ebnflint and its associated ebnf
+package has been moved to pkg/exp/ebnf.
+
+The netchan package has been moved to old/netchan.
+
+The http/spdy package has been moved to exp/spdy.
+
+The exp/datafmt package has been deleted.
+
+The container/vector package has been deleted. Slices are better:
+	http://code.google.com/p/go-wiki/wiki/SliceTricks
+
+Other changes:
+* 5l/6l/8l: correct ELFRESERVE diagnostic (thanks Anthony Martin).
+* 6l/8l: support OS X code signing (thanks Mikkel Krautz).
+* asn1: accept UTF8 strings as ASN.1 ANY values.
+* big: handle aliasing correctly for Rat.SetFrac.
+* build: add missing nuke target (thanks Anthony Martin),
+	catch future accidental dependencies to exp or old packages,
+	more robustly detect gold 2.20 (thanks Christopher Wedgwood),
+	pass $GCFLAGS to compiler,
+	stop on failed deps.bash.
+* crypto/tls: add 3DES ciphersuites,
+	add server side SNI support,
+	fetch root CA from Windows store (thanks Mikkel Krautz),
+	fetch root certificates using Mac OS API (thanks Mikkel Krautz),
+	fix broken looping code in windows root CA fetcher (thanks Mikkel Krautz),
+	more Unix root certificate locations.
+* crypto/x509: add code for dealing with PKIX public keys,
+	keep the raw Subject and Issuer.
+* csv: fix overly aggressive TrimLeadingSpace.
+* exp/ssh: general cleanups for client support (thanks Dave Cheney).
+* exp/template/html: fix bug in cssEscaper.
+* exp/terminal: split terminal handling from exp/ssh.
+* exp/winfsnotify: filesystem watcher for Windows (thanks Hector Chu).
+* fmt: fix test relying on map iteration order.
+* gc: changes to export format in preparation for inlining,
+	pass FlagNoPointers to runtime.new,
+	preserve uint8 and byte distinction in errors and import data,
+	stricter multiple assignment + test,
+	treat uintptr as potentially containing a pointer.
+* go/scanner: remove AllowIllegalChars mode.
+* go/token: document deserialization property.
+* gob: avoid one copy for every message written.
+* godefs: add enum/const testdata (thanks Dave Cheney).
+* godoc: generate package toc in template, not in JavaScript,
+	show "unexported" declarations when executing "godoc builtin",
+	show correct source name with -path.
+* gofix: make fix order explicit, add mapdelete.
+* gofmt: fix //line handling,
+	disallow rewrites for incomplete programs.
+* gotest: avoid conflicts with the name of the tested package (thanks Esko Luontola),
+	test example code.
+* goyacc: clean up after units (thanks Anthony Martin),
+	make more gofmt-compliant.
+* html: add a Render function, various bug fixes and improvements,
+	parser improvements (thanks Andrew Balholm).
+* http: DoS protection: cap non-Handler Request.Body reads,
+	RoundTrippers shouldn't mutate Request,
+	avoid panic caused by nil URL (thanks Anthony Martin),
+	fix read timeouts and closing,
+	remove Request.RawURL.
+* image/tiff: implement PackBits decoding (thanks Benny Siegert).
+* ld: fix "cannot create 8.out.exe" (thanks Jaroslavas Počepko).
+* misc/emacs: add a "godoc" command, like M-x man (thanks Evan Martin).
+* misc/swig: delete binaries (thanks Anthony Martin).
+* misc/windows: automated toolchain packager (thanks Joe Poirier).
+* net/windows: implement ip protocol name to number resolver (thanks Alex Brainman).
+* net: add File method to IPConn (thanks Mikio Hara),
+	allow LookupSRV on non-standard DNS names,
+	fix "unexpected socket family" error from WriteToUDP (thanks Albert Strasheim),
+	fix socket leak in case of Dial failure (thanks Chris Farmiloe),
+	remove duplicate error information in Dial (thanks Andrey Mirtchovski),
+	return error from CloseRead and CloseWrite (thanks Albert Strasheim),
+	skip ICMP test on Windows too unless uid 0.
+* reflect: disallow Interface method on Value obtained via unexported name,
+	make unsafe use of SliceHeader gc-friendly.
+* rpc: don't panic on write error.
+* runtime: faster strings,
+	fix crash if user sets MemProfileRate=0,
+	fix crash when returning from syscall during gc (thanks Hector Chu),
+	fix memory leak in parallel garbage collector.
+* scanner: invalidate scanner.Position when no token is present.
+* spec: define order of multiple assignment.
+* syscall/windows: dll function load and calling changes (thanks Alex Brainman).
+* syscall: add #ifdefs to fix the manual corrections in ztypes_linux_arm.go (thanks Dave Cheney),
+	adjust Mount to accommodate stricter FS implementations.
+* testing: fix time reported for failing tests.
+* utf8: add Valid and ValidString.
+* websocket: tweak hybi ReadHandshake to support Firefox (thanks Luca Greco).
+* xml: match Marshal's XMLName behavior in Unmarshal (thanks Chris Farmiloe).
+
+ +

2011-10-06

+ +
+This weekly snapshot includes changes to the io, image, and math packages that
+may require changes to client code.
+
+The io package's Copyn function has been renamed to CopyN.
+
+The math package's Fabs, Fdim, Fmax, Fmin and Fmod functions
+have been renamed to Abs, Dim, Max, Min, and Mod.
+
+Parts of the image package have been moved to the new image/color package.
+The spin-off renames some types. The new names are simply better:
+	image.Color              -> color.Color
+	image.ColorModel         -> color.Model
+	image.ColorModelFunc     -> color.ModelFunc
+	image.PalettedColorModel -> color.Palette
+	image.RGBAColor          -> color.RGBA
+	image.RGBAColorModel     -> color.RGBAModel
+	image.RGBA64Color        -> color.RGBA64
+	image.RGBA64ColorModel   -> color.RGBA64Model
+(similarly for NRGBAColor, GrayColorModel, etc)
+The image.ColorImage type stays in the image package, but is renamed:
+	image.ColorImage -> image.Uniform
+The image.Image implementations (image.RGBA, image.RGBA64, image.NRGBA,
+image.Alpha, etc) do not change their name, and gain a nice symmetry:
+an image.RGBA is an image of color.RGBA, etc.
+The image.Black, image.Opaque uniform images remain unchanged (although their
+type is renamed from image.ColorImage to image.Uniform).
+The corresponding color types (color.Black, color.Opaque, etc) are new.
+Nothing in the image/ycbcr is renamed yet. The ycbcr.YCbCrColor and
+ycbcr.YCbCrImage types will eventually migrate to color.YCbCr and image.YCbCr,
+at a later date.
+
+* 5g/6g/8g: fix loop finding bug, fix -f(), registerize variables again.
+* 5l/6l/8l: add a DT_DEBUG dynamic tag to a dynamic ELF binary.
+* archive/zip: read and write unix file modes (thanks Gustavo Niemeyer).
+* build: clear execute bit from source files (thanks Mikio Hara).
+* bytes: add EqualFold.
+* cgo: allow Windows path characters in flag directives (thanks Joe Poirier),
+	support for mingw-w64 4.5.1 and newer (thanks Wei Guangjing).
+* codereview: extra repo sanity check,
+	fix for Mercurial 1.9.2,
+	fix hg change in Windows console (thanks Yasuhiro Matsumoto).
+* crypto/elliptic: use %x consistently in error print.
+* doc/spec: remove notes about gccgo limitations, now fixed.
+* doc: add 'Debugging Go code with GDB' tutorial,
+	fix memory model read visibility bug.
+* encoding/binary: PutX functions require buffer of sufficient size,
+	added benchmarks, support for varint encoding.
+* exec: add Command.ExtraFiles.
+* exp/sql{,/driver}: new database packages.
+* exp/ssh: move common code to common.go (thanks Dave Cheney).
+* exp/template/html: work continues.
+* fmt: replace channel cache with slice.
+* gc: limit helper threads based on ncpu.
+* go/doc, godoc, gotest: support for reading example documentation.
+* go: documentation and skeleton implementation of new command.
+* gob: protect against invalid message length,
+	allow sequential decoders on the same input stream.
+* hgpatch: do not use hg exit status (thanks Yasuhiro Matsumoto).
+* http: add Location method to Response,
+	don't send a 400 Bad Request after a client shutdown.
+* index/suffixarray: 4.5x faster index serialization (to memory).
+* io/ioutil: add a comment on why devNull is a ReaderFrom.
+* json: use strings.EqualFold instead of strings.ToLower.
+* misc/emacs: fix indent bug.
+* net: add shutdown: TCPConn.CloseWrite and CloseRead.
+* net: use AF_UNSPEC instead of individual address family (thanks Mikio Hara).
+* path/filepath: added Rel as the complement of Abs (thanks Gustavo Niemeyer).
+* pkg/syscall: add Mkfifo for linux platforms.
+* regexp: move to old/regexp, replace with exp/regexp, speedups.
+* runtime/gdb: fix pretty printing of channels,
+	gracefully handle not being able to find types.
+* runtime: check for nil value pointer in select syncsend case,
+	faster finalizers,
+	fix malloc sampling bug,
+	fix map memory leak,
+	fix spurious deadlock reporting,
+	fix usleep on linux/386 and re-enable parallel gc (thanks Hector Chu),
+	parallelize garbage collector mark + sweep.
+* strconv: faster Unquote in common case.
+* strings: add EqualFold, Replacer, NewReplacer.
+* suffixarray: add benchmarks for construction (thanks Eric Eisner).
+* syscall: add GetsockoptByte, SetsockoptByte for openbsd (thanks Mikio Hara),
+	add IPv4 ancillary data for linux (thanks Mikio Hara),
+	mark stdin, stdout, stderr non-inheritable by child processes (thanks Alex Brainman),
+	mksyscall_windows.pl creates non-syscall packages (thanks Jaroslavas Počepko),
+	update multicast socket options (thanks Mikio Hara).
+* testing: support for running tests in parallel (thanks Miki Tebeka).
+* time: make month/day name comparisons case insenstive.
+* unicode: fix make tables.
+* vim: Send GoFmt errors to a location list (thanks Paul Sbarra).
+* websocket: add hybi-13 support, add mutex to make websocket full-duplex.
+
+ +

2011-09-21

+ +
+This weekly contains several improvements, bug fixes, and new packages.
+
+* archive/tar: document Header fields and Type flags (thanks Mike Rosset).
+* bytes: fix Replace so it actually copies (thanks Gustavo Niemeyer).
+* cgo: use GOARCH from the environment (thanks Jaroslavas Počepko).
+* codereview: save CL messages in $(hg root)/last-change.
+* crypto/bcrypt: new package (thanks Jeff Hodges).
+* crypto/blowfish: exposing the blowfish key schedule (thanks Jeff Hodges).
+* doc: link to golang-france.
+* doc: when configuring gold for gccgo, use --enable-gold=default.
+* exp/norm: changed trie to produce smaller tables.
+* exp/ssh: new package,
+	refactor halfConnection to transport (thanks Dave Cheney).
+* exp/template/html: more fixes and improvements.
+* filepath: fix Glob to return no error on nonmatching patterns.
+* gc: disallow invalid map keys,
+	handle complex CONVNOP.
+* gob: allocation fixes.
+* godoc: simplify internal FileSystem interface.
+* http/cgi: clean up environment (thanks Yasuhiro Matsumoto).
+* http: always include Content-Length header, even for 0 (thanks Dave Grijalva),
+	check explicit wrong Request.ContentLength values,
+	fix TLS handshake blocking server accept loop,
+	prevent DumpRequest from adding implicit headers.
+* httptest: add NewUnstartedServer.
+* json: clearer Unmarshal doc,
+	skip nil in UnmarshalJSON and (for symmetry) MarshalJSON.
+* net: use /etc/hosts first when looking up IP addresses (thanks Andrey Mirtchovski).
+* reflect: add comment about the doubled semantics of Value.String.
+* runtime: implement pprof support for windows (thanks Hector Chu),
+	increase stack system space on windows/amd64 (thanks Hector Chu).
+* suffixarray: generate less garbage during construction (thanks Eric Eisner),
+	improved serialization code using gob instead of encoding/binary.
+* sync/atomic: replace MFENCE with LOCK XADD.
+
+ +

2011-09-16

+ +
+This weekly snapshot includes changes to the image, path/filepath, and time
+packages. Code that uses these packages may need to be updated.
+
+The image package's NewX functions (NewRGBA, NewNRGBA, etc) have been changed
+to take a Rectangle argument instead of a width and height.
+Gofix can make these changes automatically.
+
+The path/filepath package's Walk function has been changed to take a WalkFunc
+function value instead of a Visitor interface value. WalkFunc is like the
+Visitor's VisitDir and VisitFile methods except it handles both files and
+directories:
+	func(path string, info *os.FileInfo, err os.Error) os.Error
+To skip walking a directory (like returning false from VisitDir) the WalkFunc
+must return SkipDir.
+
+The time package's Time struct's Weekday field has been changed to a method.
+The value is calculated on demand, avoiding the need to re-parse
+programmatically-constructed Time values to find the correct weekday.
+
+There are no gofixes for the filepath or time API changes, but instances of the
+old APIs will be caught by the compiler. The Weekday one is easy to update by
+hand. The Walk one may take more consideration, but will have fewer instances
+to fix.
+
+* build: add build comments to core packages.
+* codereview: Mercurial 1.9 fix for hg diff @nnn.
+* crypto/tls: handle non-TLS more robustly,
+	support SSLv3.
+* debug/elf: permit another case of SHT_NOBITS section overlap in test.
+* exm/template/html: more work on this auto-escaping HTML template package.
+* exp/norm: added regression test tool for the standard Unicode test set.
+* exp/regexp/syntax: fix invalid input parser crash,
+	import all RE2 parse tests + fix bugs.
+* exp/regexp: add MustCompilePOSIX, CompilePOSIX, leftmost-longest matching.
+* flag: make zero FlagSet useful.
+* gc: clean up if grammar.
+* go/build: handle cgo, // +build comments.
+* go/printer: use panic/defer instead of goroutine for handling errors.
+* go/token: support to serialize file sets.
+* godoc, suffixarray: switch to exp/regexp.
+* godoc: show packages matching a query at the top,
+	support for complete index serialization,
+	use go/build to find files in a package.
+* gofmt: accept program fragments on standard input, add else test.
+* http/cgi: add openbsd environment configuration.
+* http: document that Response.Body is non-nil.
+* image/png: don't use a goroutine to decode, to permit decode during init.
+* json: if a field's tag is "-", ignore the field for encoding and decoding.
+* ld: grow dwarf includestack on demand.
+* net, syscall: implement SetsockoptIPMReq(), and
+	move to winsock v2.2 for multicast support (thanks Paul Lalonde).
+* net: add a LookupTXT function.
+* os: os.RemoveAll to check for wboth error codes on Windows (thanks Jaroslavas Počepko).
+* path/filepath: fix Visitor doc (thanks Gustavo Niemeyer),
+	make UNC file names work (thanks Yasuhiro Matsumoto).
+* runtime: optimizations to channels on Windows (thanks Hector Chu),
+	syscall to return both AX and DX for windows/386 (thanks Alex Brainman).
+* sync/atomic: add 64-bit Load and Store.
+* syscall: add route flags for linux (thanks Mikio Hara).
+* test: add test for inheriting private method from anonymous field.
+* websocket: fix infinite recursion in Addr.String() (thanks Tarmigan Casebolt),
+	rename websocket.WebSocketAddr to *websocket.Addr.
+
+ +

2011-09-07

+ +
+This weekly snapshot consists of improvements and bug fixes, including fixes
+for issues introduced by escape analysis changes in the gc compiler.
+
+* build: clear execute bit from Go files (thanks Mike Rosset),
+	error out if problem with sudo.bash /usr/local/bin (thanks Mike Rosset).
+* exp/norm: add Reader and Writer,
+	performance improvements of quickSpan.
+* exp/regexp: bug fixes and RE2 tests.
+* exp/template/html: string replacement refactoring,
+	tweaks to js{,_test}.go.
+* gc: add -p flag to catch import cycles earlier,
+	fix label recursion bugs,
+	fix zero-length struct eval,
+	zero stack-allocated slice backing arrays,
+* gc, ld: fix Windows file paths (thanks Hector Chu).
+* go/parser: accept corner cases of signature syntax.
+* gobuilder: ignore _test.go files when looking for docs, more logging.
+* godoc: minor tweaks for App Engine use.
+* gofix: do not convert url in field names (thanks Gustavo Niemeyer).
+* gofmt: indent multi-line signatures.
+* gopprof: regexp fixes (thanks Hector Chu).
+* image/png: check zlib checksum during Decode.
+* libmach: fix incorrect use of memset (thanks Dave Cheney).
+* misc/goplay: fix template output.
+* net: ParseCIDR returns IPNet instead of IPMask (thanks Mikio Hara),
+	sync CIDRMask code, doc.
+* os: use GetFileAttributesEx to implement Stat on windows (thanks Alex Brainman).
+* runtime: fix openbsd 386 raisesigpipe,
+	implement exception handling on windows/amd64 (thanks Hector Chu),
+	test for concurrent channel consumers (thanks Christopher Wedgwood).
+* sort: use heapsort to bail out quicksort (thanks Ziad Hatahet).
+* sync/atomic: add LoadUintptr, add Store functions.
+* syscall: update routing message attributes handling (thanks Mikio Hara).
+* template: fix deadlock,
+	indirect or dereference function arguments if necessary,
+	slightly simplify the test for assignability of arguments.
+* url: handle ; in ParseQuery.
+* websocket: fix incorrect prints found by govet (thanks Robert Hencke).
+
+ +

2011-09-01

+ +
+This weekly contains performance improvements and bug fixes.
+
+The gc compiler now does escape analysis, which improves program performance
+by placing variables on the call stack instead of the heap when it is safe to
+do so.
+
+The container/vector package is deprecated and will be removed at some point
+in the future.
+
+Other changes:
+* archive/tar: support symlinks. (thanks Mike Rosset)
+* big: fix nat.scan bug. (thanks Evan Shaw)
+* bufio: handle a "\r\n" that straddles the buffer.
+	add openbsd.
+	avoid redundant bss declarations.
+	fix unused parameters.
+	fix windows/amd64 build with newest mingw-w64. (thanks Hector Chu)
+* bytes: clarify that NewBuffer is not for beginners.
+* cgo: explain how to free something.
+	fix GoBytes. (thanks Gustavo Niemeyer)
+	fixes callback for windows amd64. (thanks Wei Guangjing)
+	note that CString result must be freed. (thanks Gustavo Niemeyer)
+* cov: remove tautological #defines. (thanks Lucio De Re)
+* dashboard: yet another utf-8 fix.
+* doc/codelab/wiki: fix Makefile.
+* doc/progs: fix windows/amd64. (thanks Jaroslavas Počepko)
+* doc/tmpltohtml: update to new template package.
+* doc: emphasize that environment variables are optional.
+* effective_go: convert to use tmpltohtml.
+* exp/norm: reduced the size of the byte buffer used by reorderBuffer by half by reusing space when combining.
+	a few minor fixes to support the implementation of norm.
+	added implementation for []byte versions of methods.
+* exp/template/html: add some tests for ">" attributes.
+	added handling for URL attributes.
+	differentiate URL-valued attributes (such as href).
+	reworked escapeText to recognize attr boundaries.
+* exp/wingui: made compatible with windows/amd64. (thanks Jaroslavas Počepko)
+* flag: add Parsed, restore Usage.
+* gc: add openbsd.
+	escape analysis.
+	fix build on Plan 9. (thanks Lucio De Re)
+	fix div bug.
+	fix pc/line table. (thanks Julian Phillips)
+	fix some spurious leaks.
+	make static initialization more static.
+	remove JCXZ; add JCXZW, JCXZL, and JCXZQ instructions. (thanks Jaroslavas Počepko)
+	shuffle #includes.
+	simplify escape analysis recursion.
+	tweak and enable escape analysis.
+* go/ast cleanup: base File/PackageExports on FilterFile/FilterPackage code.
+	adjustments to filter function.
+	fix ast.MergePackageFiles to collect infos about imports. (thanks Sebastien Binet)
+	generalize ast.FilterFile.
+* go/build: add test support & use in gotest.
+	separate test imports out when scanning. (thanks Gustavo Niemeyer)
+* go/parser: fix type switch scoping.
+	fix type switch scoping.
+* gob: explain that Debug isn't useful unless it's compiled in.
+* gobuilder: increase log limit.
+* godashboard: fix utf-8 in user names.
+* godoc: first step towards reducing index size.
+	add dummy playground.js to silence godoc warning at start-up.
+	added systematic throttling to indexing goroutine.
+	fix bug in zip.go.
+	support for reading/writing (splitted) index files.
+	use virtual file system when generating package synopses.
+* gofix: forgot to rename the URL type.
+	osopen: fixed=true when changing O_CREAT. (thanks Tarmigan Casebolt)
+* goinstall: error out with paths that end with '/'. (thanks Tarmigan Casebolt)
+	report lack of $GOPATH on errors. (thanks Gustavo Niemeyer)
+	select the tag that is closest to runtime.Version.
+* gotry: add missing $. (thanks Tarmigan Casebolt)
+* http: add MaxBytesReader to limit request body size.
+	add file protocol transport.
+	adjust test threshold for larger suse buffers.
+	delete error kludge.
+	on invalid request, send 400 response.
+	return 413 instead of 400 when the request body is too large. (thanks Dave Cheney)
+	support setting Transport's TLS client config.
+* image/tiff: add a decode benchmark. (thanks Benny Siegert)
+	decoder optimization. (thanks Benny Siegert)
+* image: add PalettedImage interface, and make image/png recognize it. (thanks Jaroslavas Počepko)
+* io: add TeeReader. (thanks Hector Chu)
+* json: add struct tag option to wrap literals in strings.
+	calculate Offset for Indent correctly. (thanks Jeff Hodges)
+	fix decode bug with struct tag names with ,opts being ignored.
+* ld: handle Plan 9 ar format. (thanks Lucio De Re)
+	remove duplicate bss definitions.
+* libmach: support reading symbols from Windows .exe for nm. (thanks Mateusz Czapliński)
+* math: fix Pow10 loop. (thanks Volker Dobler)
+* mime: ParseMediaType returns os.Error now, not a nil map.
+	media type formatter. (thanks Pascal S. de Kloe)
+	text charset defaults. (thanks Pascal S. de Kloe)
+* misc/dashboard: remove limit for json package list.
+* misc/emacs: refine label detection.
+* net: add ParseMAC function. (thanks Paul Borman)
+	change the internal form of IPMask for IPv4. (thanks Mikio Hara)
+	disable "tcp" test on openbsd.
+	fix windows build. (thanks Alex Brainman)
+	join and leave a IPv6 group address, on a specific interface. (thanks Mikio Hara)
+	make use of IPv4len, IPv6len. (thanks Mikio Hara)
+	move internal string manipulation routines to parse.go. (thanks Mikio Hara)
+* os: disable Hostname test on OpenBSD.
+	fix WNOHANG Waitmsg. (thanks Gustavo Niemeyer)
+* reflect: add Value.Bytes, Value.SetBytes methods.
+* rpc: add benchmark for async rpc calls.
+* runtime: add openbsd 386 defs.h.
+	add runtime support for openbsd 386.
+	add runtime· prefix to showframe.
+	ctrlhandler for windows amd64. (thanks Wei Guangjing)
+	fix stack cleanup on windows/amd64. (thanks Hector Chu)
+	fix void warnings.
+	go interface to cdecl calbacks. (thanks Jaroslavas Počepko)
+	handle string + char literals in goc2c.
+	make arm work on Ubuntu Natty qemu.
+	openbsd thread tweaks.
+	simplify stack traces.
+	speed up cgo calls. (thanks Alex Brainman)
+	use cgo runtime functions to call windows syscalls. (thanks Alex Brainman)
+	windows/amd64 callbacks fixed and syscall fixed to allow using it in callbacks. (thanks Jaroslavas Počepko)
+* strconv: put decimal on stack.
+* spec: update section on Implementation Differences.
+* syscall: SOMAXCONN should be 0x7fffffff at winsock2. (thanks Yasuhiro Matsumoto)
+	add openbsd 386.
+	handle RTM_NEWROUTE in ParseNetlinkRouteAttr on Linux. (thanks Albert Strasheim)
+	handle routing entry in ParseRoutingSockaddr on BSD variants. (thanks Mikio Hara)
+	openbsd amd64 syscall support.
+	use the vdso page on linux x86 for faster syscalls instead of int $0x80. (thanks Yuval Pavel Zholkover)
+* template/parse: give if, range, and with a common representation.
+* template: grammar fix for template documentation. (thanks Bill Neubauer)
+	range over channel.
+	remove else and end nodes from public view.
+* test: put GOROOT/bin before all others in run.
+* time: fix Plan 9 build. (thanks Fazlul Shahriar)
+	fix zone during windows test.
+* type switches: test for pathological case.
+* version.bash: update VERSION on -save if already present. (thanks Gustavo Niemeyer)
+* websocket: implements new version of WebSocket protocol. (thanks Fumitoshi Ukai)
+* windows/386: clean stack after syscall. (thanks Jaroslavas Počepko)
+* xml: marshal "parent>child" tags correctly. (thanks Ross Light)
+
+ +

2011-08-17 (base for r60)

+ +
+This weekly contains some package re-shuffling. Users of the http and
+template packages may be affected.
+
+This weekly replaces the template package with exp/template.
+The original template package is still available as old/template.
+The old/template package is deprecated and will be removed at some point
+in the future. The Go tree has been updated to use the new template package.
+We encourage users of the old template package to switch to the new one.
+Code that uses template or exp/template will need to change
+its import lines to "old/template" or "template", respectively.
+
+The http package's URL parsing and query escaping code (such as ParseURL and
+URLEscape) has been moved to the new url package, with several simplifications
+to the names. Client code can be updated automatically with gofix.
+
+* asn1: support unmarshalling structs with int32 members (thanks Dave Cheney).
+* build: allow builds without cgo or hg,
+	support versioning without hg (thanks Gustavo Niemeyer).
+* builtin: add documentation for builtins.
+* cgo: omit duplicate symbols in writeDefs (thanks Julian Phillips).
+* misc: add support for OpenBSD.
+* doc/codewalk: new Markov chain codewalk.
+* exp/norm: added trie lookup code and associated tests,
+	generate trie struct in triegen.go for better encapsulation,
+	implementation of decomposition and composing functionality.
+* exp/template/html: new experimental package for auto-escaping HTML templates.
+* exp/template: don't panic on range of nil interface,
+	rename Parse*File and Parse*Files for clarity,
+	support field syntax on maps (thanks Gustavo Niemeyer), and
+	many other fixes and changes.
+* gc: implement nil chan and nil map support.
+* go/parser: range clause and type literal fixes.
+* godoc: show all top-level decls for (fake) package builtin.
+* goinstall: really report all newly-installed public packages.
+* html: parse more malformed tags.
+* http: fix ParseMultipartForm after MultipartReader error,
+	fix side effects in DefaultTransport's RoundTrip method (thanks Dave Grijalva).
+* json: fix []unmarshaler case.
+* ld: make addaddrplus4 static (thanks Lucio De Re).
+* syscall: move multicast address handling to the net package.
+* net: Plan 9 support (thanks Fazlul Shahriar),
+	add SetTimeout to Listener interface (thanks Aleksandar Dezelin),
+	add multicast stubs for OpenBSD,
+	return correct local address for an accepted TCP connection (thanks Mikio Hara).
+* reflect: panic on Invalid Interface call (thanks Gustavo Niemeyer).
+* rpc: implement ServeRequest to synchronously serve a single request,
+	make Server.Mutex unexported.
+* runtime: better checks for syscall.NewCallback parameter (thanks Alex Brainman),
+	correct SEH installation during callbacks (thanks Alex Brainman),
+	fix GC bitmap corruption,
+	fix pseudo-randomness on some selects (thanks Gustavo Niemeyer).
+* syscall: make LazyDLL/LazyProc.Mutex unexported.
+* test: allow multiple patterns in errchk,
+	new nil semantics.
+* time: take fractional seconds even if not in the format string.
+* url: new package.
+* utf8: rename some internal constants to remove leading underscores.
+* xml: escape string chardata in xml.Marshal.
+
+ +

2011-08-10

+ +
+This weekly contains performance improvements and bug fixes.
+
+There are no outward-facing changes, but imports of the old-style
+container/vector package have also been removed from the core library (thanks
+John Asmuth, Kyle Consalus).
+
+Other changes:
+
+* 5g: fix set but not used error (thanks Dave Cheney).
+* cmd/ld: Corrected mismatched print formats and variables (thanks Lucio De Re).
+* errchk: add -0 flag.
+* exp/norm: fix build by adding a test placeholder,
+	maketables tool for generating tables for normalization.
+* exp/template: bug fixes,
+	ensure that a valid Set is returned even on error (thanks Roger Peppe),
+	make index on maps return zero when key not present (thanks Roger Peppe),
+	split the parse tree into a separate package exp/template/parse,
+	add url query formatting filter.
+* faq: lots of small tweaks plus a couple of new discussions,
+	variant types, unions.
+* fmt: call UpdateMemStats in malloc counter.
+* go/build: use GOBIN as binary path for GOROOT.
+* gob: add UpdateMemStats calls to malloc counter,
+	avoid a couple of init-time allocations,
+	don't invoke GobEncoder on zero values.
+* gofmt: update test script so 'make test' succeeds.
+* html: parse doctype tokens; merge adjacent text nodes.
+* http: add more MPEG-4 MIME types to sniffer, and disable MP4 sniffing,
+	add test to serve content in index.html (thanks Yasuhiro Matsumoto),
+	configurable and default request header size limit,
+	correct format flags when printing errors in tests (thanks Alex Brainman),
+	correct path to serve index.html (thanks Yasuhiro Matsumoto),
+* ld: add one empty symbol into pe to make dumpbin works (thanks Wei Guangjing),
+	fail linking if the top-level package is not main.
+* misc/vim: godoc command (thanks Yasuhiro Matsumoto).
+* net: add support for openbsd (thanks Joel Sing),
+	fix /proc/net/igmp,igmp6 reading bug on linux (thanks Mikio Hara),
+	implement windows LookupMX and LookupAddr (thanks Mikio Hara),
+	sort SRV records before returning from LookupSRV (thanks Alex Brainman),
+* os: add support for openbsd (thanks Joel Sing).
+* runtime: add more specialized type algorithms,
+	correct Note documentation,
+	faster chan creation on Linux/FreeBSD/Plan9,
+	openbsd amd64 runtime support (thanks Joel Sing),
+	remove unnecessary locking (thanks Hector Chu).
+* scanner: correct error position for illegal UTF-8 encodings.
+* syscall: delay load of dll functions on Windows (thanks Alex Brainman),
+	move BSD mmap syscall (thanks Joel Sing),
+	update routing message support for BSD variants (thanks Mikio Hara).
+* test/bench: note changes after recent improvements to locking and runtime.
+* time: add nanoseconds to the Time structure,
+	parse and format fractional seconds.
+
+ +

2011-07-29

+ +
+This weekly contains performance improvements and many bug fixes.
+
+* 6l: OpenBSD support.
+* archive/zip: handle zip files with more than 65535 files,
+	more efficient reader and bug fix.
+* big: refine printf formatting and optimize string conversion.
+* build: fixes for mingw-w64 (thanks Wei Guangjing),
+	miscellaneous fixes.
+* cgo: add GoBytes, fix gmp example.
+* exp/norm: API for normalization library.
+* exp/regexp: implement regexp API using exp/regexp/syntax.
+* exp/template: more tweaks and fixes, convert the tree to use exp/template.
+* fmt: handle precision 0 format strings in standard way.
+* gc: a raft of bug fixes.
+* go/parser: report illegal label declarations at ':'.
+* gob: send empty but non-nil maps.
+* godoc: allow form feed in text files,
+	app engine configuration and updated documentation.
+* goinstall: abort and warn when using any url scheme, not just 'http://',
+	write to goinstall.log in respective GOPATH.
+* html: handle character entities without semicolons (thanks Andrew Balholm),
+	parse misnested formatting tags according to the HTML5 spec,
+	sync html/testdata/webkit with upstream WebKit.
+* http: content-type sniffing,
+	make serveFile redirects relative (thanks Andrew Balholm),
+	other fixes.
+* image/tiff: Do not panic when RowsPerStrip is missing (thanks Benny Siegert).
+* io/ioutil: improve performance of ioutil.Discard (thanks Mike Solomon).
+* ld: detect all import cycles,
+	ldpe fixes (thanks Wei Guangjing),
+	remove cseekend and redo pe writing (thanks Alex Brainman),
+	remove overlap of ELF sections on dynamic binaries (thanks Gustavo Niemeyer).
+* net/textproto: avoid 1 copy in ReadLine, ReadContinuedLine.
+* net: fix memory corruption in windows *netFD.ReadFrom (thanks Alex Brainman).
+* runtime: faster entersyscall/exitsyscall,
+	fix scheduler races (thanks Hector Chu),
+	higher goroutine arg limit, clearer error,
+	parallelism-related performance optimizations and fixes,
+	replace byte-at-a-time zeroing loop with memclr (thanks Quan Yong Zhai).
+* sort: fix Float64Slice sort; NaN smallest value (thanks Florian Uekermann).
+* src: removed some uses of container/vector (thanks John Asmuth).
+* sync: improve Once fast path.
+* unicode: fix case-mapping for roman numerals.
+
+ +

2011-07-19

+ +
+This weekly snapshot includes a language change and a change to the image
+package that may require changes to client code.
+
+The language change is that an "else" block is now required to have braces
+except if the body of the "else" is another "if". Since gofmt always puts those
+braces in anyway, programs will not be affected unless they contain "else for",
+"else switch", or "else select". Run gofmt to fix any such programs.
+
+The image package has had significant changes made to the Pix field of struct
+types such as image.RGBA and image.NRGBA. The image.Image interface type has
+not changed, though, and you should not need to change your code if you don't
+explicitly refer to Pix fields. For example, if you decode a number of images
+using the image/jpeg package, compose them using image/draw, and then encode
+the result using image/png, then your code should still work as before.
+
+If you do explicitly refer to Pix fields, there are two changes.  First, Pix[0]
+now refers to the pixel at Bounds().Min instead of the pixel at (0, 0). Second,
+the element type of the Pix slice is now uint8 instead of image.FooColor. For
+example, for an image.RGBA, the channel values will be packed R, G, B, A, R, G,
+B, A, etc. For 16-bits-per-channel color types, the pixel data will be stored
+as big-endian uint8s.
+
+Most Pix field types have changed, and so if your code still compiles after
+this change, then you probably don't need to make any further changes (unless
+you use an image.Paletted's Pix field). If you do get compiler errors, code
+that used to look like this:
+
+	// Get the R, G, B, A values for the pixel at (x, y).
+	var m *image.RGBA = loadAnImage()
+	c := m.Pix[y*m.Stride + x]
+	r, g, b, a := c.R, c.G, c.B, c.A
+
+should now look like this:
+
+	// Get the R, G, B, A values for the pixel at (x, y).
+	var m *image.RGBA = loadAnImage()
+	i := (y-m.Rect.Min.Y)*m.Stride + (x-m.Rect.Min.X)*4
+	r := m.Pix[i+0]
+	g := m.Pix[i+1]
+	b := m.Pix[i+2]
+	a := m.Pix[i+3]
+
+This image package change will not be fixed by gofix: how best to translate
+code into something efficient and idiomatic depends on the surrounding context,
+and is not easily automatable. Examples of what to do can be found in the
+changes to image/draw/draw.go in http://codereview.appspot.com/4675076/
+
+Other changes:
+* 6l: change default output name to 6.out.exe on windows (thanks Alex Brainman).
+* archive/zip: add Writer,
+	add Mtime_ns function to get modified time in sensible format.
+* cc, ld, gc: fixes for Plan 9 build (thanks Lucio De Re).
+* cgi: close stdout reader pipe when finished.
+* cgo: add missing semicolon in generated struct,
+	windows amd64 port (thanks Wei Guangjing).
+* codereview: fix for Mercurial 1.9.
+* dashboard: list "most installed this week" with rolling count.
+* debug/elf: read ELF Program headers (thanks Matthew Horsnell).
+* debug/pe: fixes ImportedSymbols for Win64 (thanks Wei Guangjing).
+* debug/proc: remove unused package.
+* doc/talks/io2010: update with gofix and handle the errors.
+* exp/eval, exp/ogle: remove packages eval and ogle.
+* exp/regexp/syntax: add Prog.NumCap.
+* exp/template: API changes, bug fixes, and tweaks.
+* flag: make -help nicer.
+* fmt: Scan(&int) was mishandling a lone digit.
+* gc: fix closure bug,
+	fix to build with clang (thanks Dave Cheney),
+	make size of struct{} and [0]byte 0 bytes (thanks Robert Hencke),
+	some enhancements to printing debug info.
+* gif: fix local color map and coordinates.
+* go/build: fixes for windows (thanks Alex Brainman),
+	include processing of .c files for cgo packages (thanks Alex Brainman),
+	less aggressive failure when GOROOT not found.
+* go/printer: changed max. number of newlines from 3 to 2.
+* gob: register more slice types (thanks Bobby Powers).
+* godoc: support for file systems stored in .zip files.
+* goinstall, dashboard: Google Code now supports git (thanks Tarmigan Casebolt).
+* hash/crc32: add SSE4.2 support.
+* html: update section references in comments to the latest HTML5 spec.
+* http: drain the pipe output in TestHandlerPanic to avoid logging deadlock,
+	fix Content-Type of file extension (thanks Yasuhiro Matsumoto),
+	implement http.FileSystem for zip files,
+	let FileServer work when path doesn't begin with a slash,
+	support for periodic flushing in ReverseProxy.
+* image/draw: add benchmarks.
+* json: add omitempty struct tag option,
+	allow using '$' and '-' as the struct field's tag (thanks Mikio Hara),
+	encode \r and \n in strings as e.g. "\n", not "\u000A" (thanks Evan Martin),
+	escape < and > in any JSON string for XSS prevention.
+* ld: allow seek within write buffer<
+	add a PT_LOAD PHDR entry for the PHDR (thanks David Anderson).
+* net: windows/amd64 port (thanks Wei Guangjing).
+* os: plan9: add Process.Signal as a way to send notes (thanks Yuval Pavel Zholkover).
+* os: don't permit Process.Signal after a successful Wait.
+* path/filepath: fixes for windows paths (thanks Alex Brainman).
+* reflect: add Value.NumMethod,
+	panic if Method index is out of range for a type.
+* runtime: faster entersyscall, exitsyscall,
+	fix panic for make(chan [0]byte),
+	fix subtle select bug (thanks Hector Chu),
+	make goc2c build on Plan 9 (thanks Lucio De Re),
+	make TestSideEffectOrder work twice,
+	several parallelism-related optimizations and fixes,
+	stdcall_raw stack 16byte align for Win64 (thanks Wei Guangjing),
+	string-related optimizations (thanks Quan Yong Zhai),
+	track running goroutine count.
+* strconv: handle [-+]Infinity in atof.
+* sync: add fast paths to WaitGroup,
+	improve RWMutex performance.
+* syscall: add Flock on Linux,
+	parse and encode SCM_RIGHTS and SCM_CREDENTIALS (thanks Albert Strasheim).
+
+ +

2011-07-07 (base for r59)

+ +
+This weekly snapshot includes changes to the strings, http, reflect, json, and
+xml packages. Code that uses these packages will need changes. Most of these
+changes can be made automatically with gofix.
+
+The strings package's Split function has itself been split into Split and
+SplitN. SplitN is the same as the old Split. The new Split is equivalent to
+SplitN with a final argument of -1.
+
+The http package has a new FileSystem interface that provides access to files.
+The FileServer helper now takes a FileSystem argument instead of an explicit
+file system root. By implementing your own FileSystem you can use the
+FileServer to serve arbitrary data.
+
+The reflect package supports a new struct tag scheme that enables sharing of
+struct tags between multiple packages.
+In this scheme, the tags must be of the form:
+        key:"value" key2:"value2"
+reflect.StructField's Tag field now has type StructTag (a string type), which
+has method Get(key string) string that returns the associated value.
+Clients of json and xml will need to be updated. Code that says
+        type T struct {
+                X int "name"
+        }
+should become
+        type T struct {
+                X int `json:"name"`  // or `xml:"name"`
+        }
+Use govet to identify struct tags that need to be changed to use the new syntax.
+
+Other changes:
+* 5l, 6l, 8l: drop use of ed during build.
+* asn1: support T61 and UTF8 string.
+* bufio: do not cache Read errors (thanks Graham Miller).
+* build: make version.bash aware of branches.
+* cgi: don't depend on CGI.pm for tests.
+* codereview: make --ignore_hgpatch_failure work again,
+	restrict sync to default branch.
+* crypto/openpgp: add ability to reserialize keys,
+	bug fix (thanks Gideon Jan-Wessel Redelinghuys).
+* crypto/tls: fix generate_cert.go.
+* crypto/x509: prevent chain cycles in Verify.
+* csv: new package.
+* doc: remove ed from apt-get package list.
+* docs: fold the prog.sh scripting from makehtml into htmlgen itself.
+* ebnflint: better handling of stdin.
+* exp/regexp/syntax: new experimental RE2-based regexp implementation.
+* exp/template: a new experimental templating package.
+* fmt: add SkipSpace to fmt's ScanState interface.
+* fmt: rename errno and error to err for doc consistency.
+* gc: avoid package name ambiguity in error messages,
+	fix package quoting logic,
+	fixes for Plan 9 (thanks Lucio De Re).
+* go/build: evaluate symlinks before comparing path to GOPATH.
+* gob: use exported fields in structs in the package documentation.
+* godoc: ignore directories that begin with '.',
+	search GOPATH for documentation.
+* gofix: os/signal, path/filepath, and sort fixes (thanks Robert Hencke),
+* goinstall: add support for generic hosts (thanks Julian Phillips),
+	only report successfully-installed packages to the dashboard,
+	try to access via https (thanks Yasuhiro Matsumoto).
+* gotest: add -test.benchtime and -test.cpu flags.
+* html: fixes and improvements (thanks Yasuhiro Matsumoto).
+* http/cgi: add Handler.Dir to specify working directory (thanks Yasuhiro Matsumoto).
+* http: add StripPrefix handler wrapper,
+	assume ContentLength 0 on GET requests,
+	better handling of 0-length Request.Body,
+	do TLS handshake explicitly before copying TLS state,
+	document that ServerConn and ClientConn are low-level,
+	make NewChunkedReader public (thanks Andrew Balholm),
+	respect Handlers setting Connection: close in their response.
+* image: more tests, Paletted.Opaque optimization.
+* io.WriteString: if the object has a WriteString method, use it (thanks Evan Shaw).
+* ld: elide the Go symbol table when using -s (thanks Anthony Martin).
+* ld: fix ELF strip by removing overlap of sections (thanks Gustavo Niemeyer).
+* mime/multipart: parse LF-delimited messages, not just CRLF.
+* mime: permit lower-case media type parameters (thanks Pascal S. de Kloe).
+* misc/dashboard: new features and improvements (not yet deployed).
+* misc/emacs: update list of builtins (thanks Quan Yong Zhai).
+* misc/vim: allow only utf-8 for file encoding (thanks Yasuhiro Matsumoto).
+* os: fix documentation for FileInfo.Name,
+	simplify WriteString,
+	use a different symbol from syscall in mkunixsignals.sh.
+* path/filepath: enable TestWalk to run on windows (thanks Alex Brainman).
+* reflect: add MethodByName,
+	allow Len on String values.
+* regexp: document that Regexp is thread-safe.
+* runtime/cgo: check for errors from pthread_create (thanks Albert Strasheim).
+* runtime: add Semacquire/Semrelease benchmarks,
+	improved Semacquire/Semrelease implementation,
+	windows/amd64 port (thanks Wei Guangjing).
+* sync: add fast path to Once,
+	improve Mutex to allow successive acquisitions,
+	new and improved benchmarks.
+* syscall: regenerate zerrors for darwin/linux/freebsd,
+	support for tty options in StartProcess (thanks Ken Rockot).
+* testing: make ResetTimer not start/stop the timer,
+	scale benchmark precision to 0.01ns if needed.
+* time: zero-pad two-digit years.
+* unicode/maketables: update debugging data.
+* windows: define and use syscall.Handle (thanks Wei Guangjing).
+* xml: add Marshal and MarshalIndent.
+
+ +

2011-06-23

+ +
+This snapshot includes a language change that restricts the use of goto.
+In essence, a "goto" statement outside a block cannot jump to a label inside
+that block. Your code may require changes if it uses goto.
+This changeset shows how the new rule affected the Go tree:
+	http://code.google.com/p/go/source/detail?r=dc6d3cf9279d
+
+The os.ErrorString type has been hidden. If your code uses os.ErrorString it
+must be changed. Most uses of os.ErrorString can be replaced with os.NewError.
+
+Other changes:
+* 5c: do not use R9 and R10.
+* 8l: more fixes for Plan 9 (thanks Lucio De Re).
+* build: Make.ccmd: link with mach lib (thanks Joe Poirier).
+* build: exclude packages that fail on Plan 9 (thanks Anthony Martin).
+* cc: nit: silence comment warnings (thanks Dave Cheney).
+* codereview.py: note that hg change -d abandons a change list (thanks Robert Hencke).
+* crypto/openpgp: add ElGamal support.
+* doc/faq: add question about converting from []T to []interface{}.
+* doc: Effective Go: fix variadic function example (thanks Ben Lynn).
+* exec: LookPath should not search %PATH% for files like c:cmd.exe (thanks Alex Brainman),
+        add support for Plan 9 (thanks Anthony Martin),
+        better error message for windows LookPath (thanks Alex Brainman).
+* fmt: catch panics from calls to String etc.
+* gc: descriptive panic for nil pointer -> value method call,
+        implement goto restriction,
+        unsafe.Alignof, unsafe.Offsetof, unsafe.Sizeof now return uintptr.
+* go/build: include Import objects in Script Inputs.
+* godefs: rudimentary tests (thanks Robert Hencke).
+* goinstall: refactor and generalize repo handling code (thanks Julian Phillips),
+        temporarily use Makefiles by default (override with -make=false).
+* gopprof: update list of memory allocators.
+* http: add Server.ListenAndServeTLS,
+        buffer request.Write,
+        fix req.Cookie(name) with cookies in one header,
+        permit handlers to explicitly remove the Date header,
+        write Header keys with empty values.
+* image: basic test for the 16-bits-per-color-channel types.
+* io: clarify Read, ReadAt, Copy, Copyn EOF behavior.
+* ld: don't attempt to build dynamic sections unnecessarily (thanks Gustavo Niemeyer).
+* libmach: fix disassembly of FCMOVcc and FCOMI (thanks Anthony Martin),
+        fix tracing on linux (for cov) (thanks Anthony Martin).
+* mime: fix RFC references (thanks Pascal S. de Kloe).
+* misc/gobuilder: run make single-threaded on windows (thanks Alex Brainman).
+* misc/godashboard: Accept sub-directories for goinstall's report (thanks Yasuhiro Matsumoto).
+* nacl, tiny: remove vestiges (thanks Robert Hencke).
+* net, syscall: interface for windows (thanks Yasuhiro Matsumoto).
+* os: change Waitmsg String method to use pointer receiver (thanks Graham Miller).
+* runtime: don't use twice the memory with grsec-like kernels (thanks Gustavo Niemeyer),
+* spec: disallow goto into blocks.
+* sync: restore GOMAXPROCS during benchmarks.
+* syscall: add LSF support for linux (thanks Mikio Hara),
+        add socket control message support for darwin, freebsd, linux (thanks Mikio Hara),
+        add tty support to StartProcess (thanks Ken Rockot),
+        fix build for Sizeof change.
+* test: test of goto restrictions.
+* time: add support for Plan 9 (thanks Anthony Martin).
+
+ +

2011-06-16

+ +
+This snapshot includes changes to the sort and image/draw packages that will
+require changes to client code.
+
+The sort.IntArray type has been renamed to IntSlice, and similarly for
+StringArray and Float64Array.
+
+The image/draw package's Draw function now takes an additional argument,
+a compositing operator. If in doubt, use draw.Over.
+
+Other changes:
+* build: fix header files for Plan 9 (thanks Lucio De Re).
+* cgo: handle new Apple LLVM-based gcc from Xcode 4.2.
+* crypto/openpgp: add ability to encrypt and sign messages.
+* doc/gopher: add goggled gopher logo for App Engine.
+* doc: Update notes for 3-day Go course.
+* exec: make LookPath work when PATHEXT var not set on Windows (thanks Alex Brainman).
+* exp/regexp/syntax: syntax data structures, parser, escapes, character classes.
+* exp/template: lexical scanner for new template package.
+* fmt: debugging formats for characters: %+q %#U.
+* gc: frame compaction for arm,
+        handle go print() and go println(),
+        work around goto bug.
+* go/build: fixes, self-contained tests.
+* go/printer, gofmt: print "select {}" on one line.
+* godoc: replace OS file system accesses in favor of a FileSystem interface.
+* gofix: fix inconsistent indentation in help output (thanks Scott Lawrence).
+* goinstall: use go/build package to scan and build packages.
+* http/spdy: improve error handling (thanks William Chan).
+* http: use runtime/debug.Stack() to dump stack trace on panic.
+* ld: dwarf emit filenames in debug_line header instead of as extended opcodes,
+        fix link Windows PE __declspec(dllimport) symbol (thanks Wei Guangjing),
+        make .rodata section read-only (thanks Gustavo Niemeyer).
+* mail: decode RFC 2047 "B" encoding.
+* mime/multipart: remove temp files after tests on Windows (thanks Alex Brainman).
+* net: export all fields in Interface (thanks Mikio Hara),
+        rearrange source to run more tests on Windows (thanks Alex Brainman),
+        sendfile for win32 (thanks Yasuhiro Matsumoto).
+* os: Plan 9, fix OpenFile & Chmod, add Process.Kill (thanks Yuval Pavel Zholkover).
+* runtime: fix Plan 9 "lingering goroutines bug" (thanks Yuval Pavel Zholkover).
+* spec: clarify rules for append, scope rules for :=,
+        specify constant conversions,
+        unsafe.Alignof/Offsetof/Sizeof return uintptr.
+* syscall, os, exec: add *syscall.SysProcAttr field to os.ProcAttr and exec.Cmd.
+* syscall: add ptrace on darwin (thanks Jeff Hodges),
+        mksyscall_windows.pl should output unix newline (thanks Yasuhiro Matsumoto).
+        update BPF support for BSD variants (thanks Mikio Hara),
+        use strict in perl scripts (thanks Yasuhiro Matsumoto).
+* xml: handle non-string attribute fields (thanks Maxim Ushakov).
+
+ +

2011-06-09 (base for r58)

+ +
+This snapshot includes changes to the strconv, http, and exp/draw packages.
+Client code that uses the http or exp/draw packages will need to be changed,
+and code that uses strconv or fmt's "%q" formatting directive merits checking.
+
+The strconv package's Quote function now escapes only those Unicode code points
+not classified as printable by unicode.IsPrint. Previously Quote would escape
+all non-ASCII characters. This also affects the fmt package's "%q" formatting
+directive. The previous quoting behavior is still available via strconv's new
+QuoteToASCII function.   
+
+Most instances of the type map[string][]string in the http package have been
+replaced with the new Values type. The http.Values type has the Get, Set, Add,
+and Del helper methods to make working with query parameters and form values
+more convenient.
+
+The exp/draw package has been split into the image/draw and exp/gui packages.
+
+Other changes:
+* 8l, ld: initial adjustments for Plan 9 native compilation of 8l (thanks Lucio De Re).
+* arm: floating point improvements (thanks Fan Hongjian).
+* big: Improved speed of nat-to-string conversion (thanks Michael T. Jones),
+        Rat outputs the requested precision from FloatString (thanks Graham Miller),
+        gobs for big.Rats.
+* cgo: support non intel gcc machine flags (thanks Dave Cheney).
+* compress/lzw: do not use background goroutines,
+        reduce decoder buffer size from 3*4096 to 2*4096.
+* crypto/twofish: fix Reset index overflow bug.
+* crypto: reorg, cleanup and add function for generating CRLs.
+* exec: export the underlying *os.Process in Cmd.
+* gc: enable building under clang/2.9 (thanks Dave Cheney),
+        preparatory work toward escape analysis, compact stack frames.
+* go/build: new incomplete package for building go programs.
+* godefs: do not assume forward type references are enums (thanks Robert Hencke).
+* gofix, gofmt: fix diff regression from exec change.
+* html: improve attribute parsing, note package status.
+* http: don't fail on accept hitting EMFILE,
+        fix handling of 0-length HTTP requests.
+* image/draw: fix clipping bug where sp/mp were not shifted when r.Min was.
+* image/gif: fix buglet in graphics extension.
+* image/tiff: support for bit depths other than 8 (thanks Benny Siegert).
+* ld: fix and simplify ELF symbol generation (thanks Anthony Martin)
+* libmach: use the standardized format for designated initializers (thanks Jeff Hodges)
+* mail: address list parsing.
+* net: add network interface identification API (thanks Mikio Hara),
+        fix bug in net.Interfaces: handle elastic sdl_data size correctly (thanks Mikio Hara).
+* netchan: added drain method to importer (thanks David Jakob Fritz).
+* os: add Process.Kill and Process.Signal (thanks Evan Shaw),
+        fix Getenv for Plan 9 (thanks Yuval Pavel Zholkover).
+* runtime: improve memmove by checking memory overlap (thanks Quan Yong Zhai),
+        support for Linux grsecurity systems (thanks Jonathan Mark).
+* spec: handle a corner case for shifts.
+* testing: check that tests and benchmarks do not affect GOMAXPROCS (thanks Dmitriy Vyukov).
+* unicode: add IsPrint and related properties, general categories.
+
+ +

2011-06-02

+ +
+This snapshot includes changes to the exec package that will require changes
+to client code.
+
+The exec package has been re-designed with a more convenient and succinct API.
+This code:
+	args := []string{"diff", "-u", "file1.txt", "file2.txt"}
+	p, err := exec.Run("/usr/bin/diff", args, os.Environ(), "",
+		exec.DevNull, exec.Pipe, exec.DevNull)
+	if err != nil {
+		return nil, err
+	}
+	var buf bytes.Buffer
+	io.Copy(&buf, p.Stdout)
+	w, err := p.Wait(0)
+	p.Close()
+	if err != nil {
+		return nil, err
+	}
+	return buf.Bytes(), err
+can be rewritten as:
+	return exec.Command("diff", "-u", "file1.txt", "file2.txt").Output()
+See the exec package documentation for the details ("godoc exec").
+
+By setting the GOPATH environment variable you can use goinstall to build and
+install your own code and external libraries outside of the Go tree (and avoid
+writing Makefiles).
+See the goinstall command documentation for the details ("godoc goinstall").
+
+Other changes:
+* 5g: alignment fixes.
+* 6l, 8l: fix Mach-O binaries with many dynamic libraries.
+* 8l: emit resources (.rsrc) in Windows PE.  (thanks Wei Guangjing).
+* asn1: fix marshalling of empty optional RawValues (thanks Mikkel Krautz).
+* big: make Int and Rat implement fmt.Scanner (thanks Evan Shaw),
+	~8x faster number scanning,
+	remove some unnecessary conversions.
+* cgo: restrict #cgo directives to prevent shell expansion (thanks Gustavo Niemeyer),
+	support pkg-config for flags and libs (thanks Gustavo Niemeyer).
+* compress/flate: fix Huffman tree bug,
+	do not use background goroutines.
+* crypto/openpgp: add support for symmetrically encrypting files.
+* crypto/tls/generate_cert.go: fix misspelling of O_CREATE.
+* dashboard: send notification emails when the build breaks.
+* doc: mention go/printer instead of container/vector in effective go,
+	put Release History link on 'Documentation' page,
+	put Weekly Snapshot History link on 'Contributing' page.
+* encoding/base64: add DecodeString and EncodeToString.
+* encoding/binary: add a non-reflect fast path for Read,
+	add a non-reflect fast path for Write.
+* encoding/hex: add hex dumping.
+* encoding/line: delete package. Its functionality is now in bufio.
+* filepath: Abs must always return a clean path (thanks Gustavo Niemeyer).
+* fmt: fix bug in UnreadRune,
+	make %q work for integers, printing a quoted character literal,
+	return EOF when out of input in Scan*.
+* gc: check parameter declarations in interface fields (thanks Anthony Martin),
+	disallow ... in type conversions (thanks Anthony Martin),
+	do not force heap allocation on referencing outer variable in a closure,
+	fix m[x], _ = y.(T),
+	implement new shift rules,
+	patch y.tab.c to fix build when using Bison 2.5,
+	relax assignability of method receivers (thanks Anthony Martin),
+	typecheck the whole tree before walking.
+* go/scanner: don't allow "0x" and "0X" as integers (thanks Evan Shaw).
+* gobuilder: fixes for windows (thanks Alex Brainman).
+* godoc: basic setup for running godoc on local app engine emulator,
+	display advert for the package dashboard on package list page.
+* goinstall: fixes for windows (thanks Alex Brainman),
+	more verbose logging with -v.
+* gotest, pkg/exec: use bash to run shell scripts on windows (thanks Alex Brainman).
+* http/spdy: redo interfaces, flesh out implementation & frame types (thanks William Chan).
+* http: Transport hook to register non-http(s) protocols,
+	add client+server benchmark,
+	catch Handler goroutine panics,
+	fix Set-Cookie date parsing,
+	have client set Content-Length when possible,
+	let Transport use a custom net.Dial function,
+	propagate Set-Cookie in reverse proxy,
+	ServeFile shouldn't send Content-Length when Content-Encoding is set.
+* image: add a SubImage method.
+* image/gif: simplify blockReader.Read.
+* image/png: fix encoding of images that don't start at (0, 0).
+* io, net, http: sendfile support.
+* io: add ByteScanner, RuneScanner interfaces.
+* ld: add -w to disable dwarf, make errors obviously from dwarf.
+* mail: new package.
+* mime/multipart: misc code/doc fixes.
+* misc/cgo: remove reference to 'destroy' function.
+* misc/emacs: don't select the mark after gofmt (thanks Eric Eisner).
+* misc/gophertool: Chrome extension to aid in Go development
+* misc/vim: limit Fmt command to Go buffers (thanks Yasuhiro Matsumoto).
+* net: if we stop polling, remove any pending events for the socket,
+	update IP multicast socket options (thanks Mikio Hara).
+* os: Fix test to work on Solaris,
+	fix Readdir(0) on EOF,
+	fix Readdir, Readdirnames (thanks Yuval Pavel Zholkover),
+	fix os.MkdirAll with backslash path separator (thanks Yasuhiro Matsumoto),
+	handle OpenFile flag parameter properly on Windows (thanks Alex Brainman).
+* path/filepath: remove string constants.
+* pkg: spelling tweaks, I-Z (thanks Robert Hencke).
+* quietgcc: fix typo, respect $TMPDIR.
+* runtime: do not garbage collect windows callbacks (thanks Alex Brainman),
+	fix mmap error return on linux (thanks Dmitry Chestnykh),
+	reset GOMAXPROCS during tests,
+	save cdecl registers in Windows SEH handler (thanks Alexey Borzenkov).
+* spec: be precise with the use of the informal ellipsis and the Go token,
+	clarify rules for shifts.
+* strconv: add QuoteRune; analogous to Quote but for runes rather than strings.
+* strings: implement UnreadByte, UnreadRune.
+* sync: always wake up sleeping goroutines on Cond.Signal (thanks Gustavo Niemeyer).
+* sync/atomic: fix check64.
+* syscall: add ProcAttr field to pass an unescaped command line on windows (thanks Vincent Vanackere),
+	add routing messages support for Linux and BSD (thanks Mikio Hara).
+* template: fixes and clean-ups (thanks Gustavo Niemeyer).
+* time: fix Format bug: midnight/noon are 12AM/PM not 0AM/PM.
+* unicode: make the tables smaller.
+
+ +

2011-05-22

+ +
+This snapshot includes changes to the http package that will require changes to
+client code.
+
+The finalURL return value of the Client.Get method has been removed.
+This value is now accessible via the new Request field on http.Response.
+For example, this code:
+
+	res, finalURL, err := http.Get(...)
+
+should be rewritten as:
+
+	res, err := http.Get(...)
+	if err != nil {
+		// ...
+	}
+	finalURL := res.Request.URL.String()
+
+Uses of http.Get that assign the finalURL value to _ can be rewritten
+automatically with gofix.
+
+This snapshot also includes an optimization to the append function that makes it
+between 2 and 5 times faster in typical use cases.
+
+Other changes:
+* 5a, 6a, 8a, cc: remove old environment variables.
+* 5c, 5g: fix build with too-smart gcc.
+* 5l, 8l: add ELF symbol table to binary.
+* 5l: delete pre-ARMv4 instruction implementations, other fixes.
+* 6l, 8l: emit windows dwarf sections like other platforms (thanks Alex Brainman).
+* 6l: fix emit windows dwarf sections (thanks Wei Guangjing).
+* 8g: fix conversion from float to uint64 (thanks Anthony Martin).
+* Make.cmd: create TARGDIR if necessary (thanks Gustavo Niemeyer).
+* asn1: add big support.
+* big: add Int methods to act on numbered bits (thanks Roger Peppe),
+	better support for string conversions,
+	support %v and # modifier, better handling of unknown formats.
+* cgi: export RequestFromMap (thanks Evan Shaw),
+	set Request.TLS and Request.RemoteAddr for children.
+* cgo: use packed struct to fix Windows behavior.
+* codereview: add release branch support,
+	fetch metadata using JSON API, not XML scraping,
+	handle 'null as missing field' in rietveld json.
+* compress/lzw: silently drop implied codes that are too large.
+* compress/zlib: actually use provided dictionary in NewWriterDict
+* crypto/openpgp: add key generation support,
+	change PublicKey.Serialize to include the header.
+* crypto/rand: add utility functions for number generation (thanks Anthony Martin).
+* crypto/tls: export the verified chains.
+* crypto/x509/crl: add package.
+* crypto/x509: export raw SubjectPublicKeyInfo,
+	support DSA public keys in X.509 certs,
+	support parsing and verifying DSA signatures (thanks Jonathan Allie).
+* doc/roadmap: put "App Engine support" under "Done".
+* doc: add I/O 2011 talks to talks/, docs.html, and front page.
+* effective go: explain about values/pointers in String() example,
+	update to new Open signature.
+* exp/draw: fast paths for drawing a YCbCr or an NRGBA onto an RGBA.
+* filepath: make EvalSymlinks work on Windows (thanks Alex Brainman).
+* flag: allow distinct sets of flags.
+* gc: fix type switch error message for invalid cases (thanks Lorenzo Stoakes),
+	fix unsafe.Sizeof,
+	preserve original expression for errors.
+* go/ast, go/doc, godoc: consider struct fields and interface methods when filtering ASTs.
+* go/ast: consider anonymous fields and set Incomplete bit when filtering ASTs,
+	properly maintain map of package global imports.
+* go/doc, godoc: when filtering for godoc, don't remove elements of a declaration.
+* go/parser: accept parenthesized receive operations in select statements,
+	always introduce an ast.Object when declaring an identifier.
+* go/printer, gofmt: fix alignment of "=" in const/var declarations,
+	fix formatting of expression lists (missing blank).
+* go/printer: added simple performance benchmark,
+	make tests follow syntactic restrictions,
+	more accurate comment for incomplete structs/interfaces,
+* go/token: faster FileSet.Position implementation.
+* go/types: type checker API + testing infrastructure.
+* godoc: added -index flag to enable/disable search index,
+	if there is no search box, don't run the respective JS code.
+* gofmt: update test.sh (exclude a file w/ incorrect syntax).
+* html: parse empty, unquoted, and single-quoted attribute values.
+* http/cgi: correctly set request Content-Type (thanks Evan Shaw),
+	pass down environment variables for IRIX and Solaris.
+* http/pprof: fix POST reading bug.
+* http/spdy: new incomplete package (thanks Ross Light).
+* http: Client.Do should follow redirects for GET and HEAD,
+	add Header.Write method (thanks Evan Shaw),
+	add Request.SetBasicAuth method,
+	add Transport.ProxySelector,
+	add http.SetCookie(ResponseWriter, *Cookie),
+	don't Clean query string in relative redirects,
+	fix FormFile nil pointer dereference on missing multipart form,
+	fix racy test with a simpler version,
+	fix two Transport gzip+persist crashes,
+	include Host header in requests,
+	make HEAD client request follow redirects (thanks Eivind Uggedal).
+	update cookie doc to reference new RFC 6265,
+	write cookies according to RFC 6265 (thanks Christian Himpel).
+* image/bmp: implement a BMP decoder.
+* image/gif: new package provides a GIF decoder.
+* image/jpeg: decode grayscale images, not just color images.
+	optimizations and tweaks.
+* image/png: encode paletted images with alpha channel (thanks Dmitry Chestnykh),
+	speed up opaque RGBA encoding.
+* image/tiff: implement a decoder (thanks Benny Siegert).
+* image: add type-specific Set methods and use them when decoding PNG,
+	make AlphaColor.Set conform to usual signature (thanks Roger Peppe),
+	png & jpeg encoding benchmarks.
+* ld: do not emit reference to dynamic library named "",
+	fix alignment of rodata section on Plan 9 (thanks Anthony Martin),
+	make ELF binaries with no shared library dependencies static binaries.
+* make.bash: remove old bash version of gotest on Windows (thanks Alex Brainman).
+* make: add nuke target for C commands and libs (thanks Anthony Martin).
+* mime/multipart: add FileName accessor on Part,
+	add Writer,
+	return an error on Reader EOF, not (nil, nil).
+* misc/cgo/test: run tests.
+* misc/emacs: use UTF-8 when invoking gofmt as a subprocess (thanks Sameer Ajmani).
+* misc/vim: new Vim indentation script.
+* net, http: add and make use of IP address scope identification API (thanks Mikio Hara).
+* net: default to 127.0.0.1, not localhost, in TestICMP,
+	don't crash on unexpected DNS SRV responses,
+	enable SO_REUSEPORT on BSD variants (thanks Mikio Hara),
+	protocol family adaptive address family selection (thanks Mikio Hara),
+	re-enable wildcard listening (thanks Mikio Hara),
+	sort records returned by LookupSRV (thanks Gary Burd).
+* os: make Readdir & Readdirnames return os.EOF at end,
+	make Setenv update C environment variables.
+* reflect: allow unexported key in Value.MapIndex.
+* runtime, sync/atomic: fix arm cas.
+* runtime: add newline to "finalizer already set" error (thanks Albert Strasheim),
+	handle out-of-threads on Linux gracefully (thanks Albert Strasheim),
+	fix function args not checked warning on ARM (thanks Dave Cheney),
+	make StackSystem part of StackGuard (thanks Alexey Borzenkov),
+	maybe fix Windows build broken by cgo setenv CL.
+* spec: clarify semantics of integer division,
+	clarify semantics of range clause,
+	fix error in production syntax,
+	narrow syntax for expression and select statements,
+	newlines cannot be used inside a char or "" string literal,
+	restricted expressions may still be parenthesized.
+* strings: make Reader.Read use copy instead of an explicit loop.
+* syscall: add Windows file mapping functions and constants (thanks Evan Shaw),
+	add IPv6 scope zone ID support (thanks Mikio Hara),
+	add netlink support for linux/386, linux/amd64, linux/arm (thanks Mikio Hara),
+	add Sendfile,
+	adjust freebsd syscalls.master URL properly (thanks Mikio Hara),
+	change Overlapped.HEvent type, it is a handle (thanks Alex Brainman).
+* syslog: fix skipping of net tests (thanks Gustavo Niemeyer).
+* template: support string, int and float literals (thanks Gustavo Niemeyer).
+* xml: fix reflect error.
+
+ +

2011-04-27 (base for r57)

+ +
+This snapshot includes revisions to the reflect package to make it more
+efficient, after the last weekly's major API update. If your code uses reflect
+it may require further changes, not all of which can be made automatically by
+gofix. For the full details of the change, see
+	http://codereview.appspot.com/4435042
+Also, the Typeof and NewValue functions have been renamed to TypeOf and ValueOf.
+
+Other changes:
+* 5c: make alignment rules match 5g, just like 6c matches 6g.
+* 8g, 8l: fix "set but not used" gcc error (thanks Fazlul Shahriar).
+* all-qemu.bash: remove DISABLE_NET_TESTS.
+* build: remove DISABLE_NET_TESTS.
+* builder: build multiple targets in parallel.
+* cgo: avoid "incompatible pointer type" warning (thanks Albert Strasheim).
+* codereview: add 'hg undo' command, various other fixes.
+* compress/flate: dictionary support.
+* compress/zlib: add FDICT flag in Reader/Writer (thanks Ross Light).
+* container/heap: fix circular dependency in test.
+* crypto/openpgp: better handling of keyrings.
+* crypto/rsa: support > 3 primes.
+* crypto/tls: add server-side OCSP stapling support.
+* crypto/x509: memorize chain building.
+* crypto: move certificate verification into x509.
+* dashboard: build most recent revision first.
+* doc: mention make version in install.html.
+* expvar: add Func for functions that return values that are JSON marshalable.
+* fmt: decrease recursion depth in tests to permit them to run under gccgo,
+	tweak the doc for %U.
+* gc: allow complex types to be receiver types (thanks Robert Hencke),
+	correct handling of unexported method names in embedded interfaces,
+	explain why invalid receiver types are invalid,
+	fix copy([]int, string) error message (thanks Quan Yong Zhai),
+	fix 'invalid recursive type' error (thanks Lorenzo Stoakes),
+	many bug fixes.
+* go spec: attempt at clarifying language for "append",
+	for map types, mention indexing operations.
+* go/types: update for export data format change.
+* gob: fix handling of indirect receivers for GobDecoders,
+	fix trivial bug in map marshaling,
+	have errorf always prefix the message with "gob: ",
+	test case for indirection to large field,
+	use new Implements and AssignableTo methods in reflect,
+	when decoding a string, allocate a string, not a []byte.
+* gobuilder: permit builders of the form goos-goarch-foo,
+	respect MAKEFLAGS if provided (thanks Dave Cheney).
+* godoc: use "search" input type for search box (thanks Dmitry Chestnykh).
+* gofix: add support for reflect rename.
+* gofmt: add -d (diff) (thanks David Crawshaw),
+	don't crash when rewriting nil interfaces in AST,
+	exclude test case that doesn't compile w/o errors,
+	gofmt test harness bug fix.
+* goinstall: support GOPATH; building and installing outside the Go tree,
+	support building executable commands.
+* gopack: fix prefix bug,
+	preserve safe flag when not adding unsafe objects to archive.
+* gotest: add timing, respect $GOARCH,
+	generate gofmt-compliant code.
+* http/cgi: copy some PATH environment variables to child,
+	improve Location response handling,
+	pass some default environment variables.
+* http/fcgi: new package (thanks Evan Shaw).
+* http: add NewRequest helper,
+	add MultipartForm, ParseMultipartForm, and FormFile to Request,
+	be clear when failing to connect to a proxy,
+	bug fixes and new tests,
+	consume request bodies before replying,
+	don't quote Set-Cookie Domain and Path (thanks Petar Maymounkov),
+	fix IP confusion in TestServerTimeouts,
+	handler timeout support,
+	ServerConn, ClientConn: add real Close (thanks Petar Maymounkov),
+	make Client redirect policy configurable,
+	put a limit on POST size,
+	reverse proxy handler.
+* image/jpeg: add an encoder,
+	decode to a YCbCr image instead of an RGBA image.
+* ioutil: add Discard.
+* json: keep track of error offset in SyntaxError.
+* ld: defend against some broken object files,
+	do not emit empty dwarf pe sections (thanks Alex Brainman),
+	fix 6l -d on Mac, diagnose invalid use of -d,
+	fix Plan 9 symbol table (thanks Anthony Martin),
+	remove MachoLoad limit.
+* make: prevent rm provoking 'text file busy' errors (thanks Lorenzo Stoakes).
+* mime/multipart: add ReadForm for parsing multipart forms,
+	limit line length to prevent abuse.
+* mime: RFC 2231 continuation / non-ASCII support,
+	bunch more tests, few minor parsing fixes.
+* misc/goplay: fix Tab and Shift+Enter in Firefox (thanks Dmitry Chestnykh).
+* net: disable one more external network test,
+	fix EAI_BADFLAGS error on freebsd (thanks Mikio Hara),
+	fix ParseIP (thanks Quan Yong Zhai),
+	fix dialgoogle_test.go (thanks Quan Yong Zhai),
+	try /etc/hosts before loading DNS config (thanks Dmitry Chestnykh),
+	use C library resolver on FreeBSD, Linux, OS X / amd64, 386.
+* os/user: new package to look up users.
+* os: Open with O_APPEND|O_CREATE to append on Windows (thanks Alex Brainman),
+	fix race in ReadAt/WriteAt on Windows (thanks Alex Brainman),
+	turn EPIPE exit into panic.
+* rc/env.bash: fix to build on windows under msys (thanks Joe Poirier).
+* reflect: allow Slice of arrays,
+	fix Copy of arrays (thanks Gustavo Niemeyer),
+	require package qualifiers to match during interface check,
+	add Type.Implements, Type.AssignableTo, Value.CallSlice,
+	make Set match Go.
+* rpc: allow the first argument of a method to be a value rather than a pointer,
+	run benchmarks over HTTP as well as direct network connections.
+* run.bash: remove redundant rebuilds.
+* runtime/plan9: warning remediation for Plan 9 (thanks Lucio De Re),
+* runtime: many bug fixes,
+	fix GOMAXPROCS vs garbage collection bug (thanks Dmitriy Vyukov),
+	fix mkversion to output valid path separators (thanks Peter Mundy),
+	more graceful out-of-memory crash,
+	require package qualifiers to match during interface check,
+	skip functions with no lines when building src line table,
+	turn "too many EPIPE" into real SIGPIPE.
+* src/pkg: make package doc comments consistently start with "Package foo".
+* syscall: Madvise and Mprotect for Linux (thanks Albert Strasheim),
+	Mlock, Munlock, Mlockall, Munlockall on Linux (thanks Albert Strasheim),
+	add BPF support for darwin/386, darwin/amd64 (thanks Mikio Hara),
+	correct Windows CreateProcess input parameters (thanks Alex Brainman),
+	fix Ftruncate under linux/arm5 (thanks Dave Cheney),
+	permit StartProcess to hide the executed program on windows (thanks Vincent Vanackere).
+* test/bench: update timings; moving to new machine.
+* time: support Irix 6 location for zoneinfo files.
+* tutorial: modernize the definition and use of Open,
+	replace the forever loops with finite counts in sieve programs.
+* websocket: include *http.Request in websocket.Conn.
+* xml: Parser hook for non-UTF-8 charset converters.
+
+ +

2011-04-13

+ +
+weekly.2011-04-13
+
+This weekly snapshot includes major changes to the reflect package and the
+os.Open function.  Code that uses reflect or os.Open will require updating,
+which can be done mechanically using the gofix tool.
+
+The reflect package's Type and Value types have changed.  Type is now an
+interface that implements all the possible type methods.  Instead of a type
+switch on a reflect.Type t, switch on t.Kind().  Value is now a struct value
+that implements all the possible value methods.  Instead of a type switch on a
+reflect.Value v, switch on v.Kind().  See the change for the full details:
+        http://code.google.com/p/go/source/detail?r=843855f3c026
+
+The os package's Open function has been replaced by three functions:
+        OpenFile(name, flag, perm) // same as old Open
+        Open(name) // same as old Open(name, O_RDONLY, 0)
+        Create(name) // same as old Open(name, O_RDWR|O_TRUNC|O_CREAT, 0666)
+
+To update your code to use the new APIs, run "gofix path/to/code".  Gofix can't
+handle all situations perfectly, so read and test the changes it makes before
+committing them.
+
+Other changes:
+* archive/zip: add func OpenReader, type ReadCloser (thanks Dmitry Chestnykh).
+* asn1: Implement correct marshaling of length octets (thanks Luit van Drongelen).
+* big: don't crash when printing nil ints.
+* bufio: add ReadLine, to replace encoding/line.
+* build: make the build faster, quieter.
+* codereview: automatically port old diffs forward,
+        drop Author: line on self-clpatch,
+        recognize code URL without trailing slash.
+* crypto/block: remove deprecated package.
+* crypto/des: new package implementating DES and TDEA (thanks Yasuhiro Matsumoto).
+* crypto/ecdsa, crypto/rsa: use io.ReadFull to read from random source (thanks Dmitry Chestnykh).
+* crypto/rsa: add 3-prime support,
+        add support for precomputing CRT values,
+        flip the CRT code over so that it matches PKCS#1.
+* crypto/x509: expose complete DER data (thanks Mikkel Krautz).
+* doc: new "Functions" codewalk (thanks John DeNero).
+* doc/roadmap: add sections on tools, packages.
+* fmt: allow %U for unsigned integers.
+* gc: fixes and optimizations.
+* go/printer, gofmt: use blank to separate import rename from import path.
+* go/scanner: better TokenString output.
+* go/types: new Go type hierarchy implementation for AST.
+* godashboard: show packages at launchpad.net (thanks Gustavo Niemeyer).
+* gofix: add -diff, various fixes and helpers.
+* gotest: fix a bug in error handling,
+        fixes for [^.]_test file pattern (thanks Peter Mundy),
+        handle \r\n returned by gomake on Windows (thanks Alex Brainman).
+* gotype: use go/types GcImporter.
+* govet: make name-matching for printf etc. case-insensitive.
+* http: allow override of Content-Type for ServeFile,
+        client gzip support,
+        do not listen on 0.0.0.0 during test,
+        flesh out server Expect handling + tests.
+* image/ycbcr: new package.
+* image: allow "?" wildcards when registering image formats.
+* io: fixes for Read with n > 0, os.EOF (thanks Robert Hencke).
+* ld: correct Plan 9 compiler warnings (thanks Lucio De Re),
+        ELF header function declarations (thanks Lucio De Re),
+        fix Mach-O X86_64_RELOC_SIGNED relocations (thanks Mikkel Krautz),
+        fix Mach-O bss bug (thanks Mikkel Krautz),
+        fix dwarf decoding of strings for struct's fieldnames (thanks Luuk van Dijk),
+        fixes and optimizations (25% faster).
+* log: generalize getting and setting flags and prefix.
+* misc/cgo/life: enable build and test on Windows (thanks Alex Brainman).
+* misc/vim: add plugin with Fmt command (thanks Dmitry Chestnykh),
+        update type highlighting for new reflect package.
+* net: disable multicast tests by default (thanks Dave Cheney),
+        sort records returned by LookupMX (thanks Corey Thomasson).
+* openpgp: Fix improper := shadowing (thanks Gustavo Niemeyer).
+* os: rename Open to OpenFile, add new Open, Create,
+        fix Readdir in Plan 9 (thanks Fazlul Shahriar).
+* os/inotify: use _test for test files, not _obj.
+* pkg/path: enable tests on Windows (thanks Alex Brainman).
+* reflect: new Type and Value API.
+* src/pkg/Makefile: trim per-directory make output except on failure.
+* syscall: Add DT_* and MADV_* constants on Linux (thanks Albert Strasheim),
+        add Mmap, Munmap on Linux, FreeBSD, OS X,
+        fix StartProcess in Plan 9 (thanks Fazlul Shahriar),
+        fix Windows Signaled (thanks Alex Brainman).
+* test/bench: enable build and test on Windows (thanks Alex Brainman).
+
+ +

2011-04-04

+ +
+This snapshot includes changes to the net package. Your code will require
+changes if it uses the Dial or LookupHost functions.
+
+The laddr argument has been removed from net.Dial, and the cname return value
+has been removed from net.LookupHost. The new net.LookupCNAME function can be
+used  to find the canonical host for a given name.  You can update your
+networking code with gofix.
+
+The gotest shell script has been replaced by a Go program, making testing
+significantly faster.
+
+Other changes:
+* asn1: extensions needed for parsing Kerberos.
+* bufio: Write and WriteString cleanup (thanks Evan Shaw).
+* bytes, strings: simplify Join (thanks Evan Shaw).
+* crypto/cipher: bad CTR IV length now triggers panic.
+* crypto/tls: extend NPN support to the client,
+	added X509KeyPair function to parse a Certificate from memory.
+* crypto/x509: parse Extended Key Usage extension (thanks Mikkel Krautz).
+* debug/gosym: remove need for gotest to run preparatory commands.
+* fmt: implement precision (length of input) values for %q: %.20q.
+* go/parser: fix scoping for local type declarations (thanks Roger Peppe),
+	package name must not be the blank identifier.
+* go/printer, gofmt: remove special case for multi-line raw strings.
+* gopack: add P flag to remove prefix from filename information.
+* gotest: add -test.timeout option,
+	replace the shell script with the compiled program written in go,
+	execute gomake properly on Windows (thanks Alex Brainman).
+* gotry: move into its own directory, separate from gotest.
+* gotype: support for more tests, added one new test.
+* http: add Transport.MaxIdleConnsPerHost,
+	use upper case hex in URL escaping (thanks Matt Jones).
+* httptest: add NewTLSServer.
+* misc/kate: reorganize, remove closed() (thanks Evan Shaw).
+* misc/notepadplus: support for notepad++ (thanks Anthony Starks).
+* net: implement non-blocking connect (thanks Alexey Borzenkov).
+* os: fix MkdirAll("/thisdoesnotexist") (thanks Albert Strasheim),
+	Plan 9 support (thanks Yuval Pavel Zholkover),
+	add a few missing Plan 9 errors (thanks Andrey Mirtchovski),
+	fix FileInfo.Name returned by Stat (thanks David Forsythe).
+* path/filepath.Glob: add an error return,
+	don't drop known matches on error.
+* path/filepath: add support for Plan 9 (thanks Andrey Mirtchovski).
+* scanner: treat line comments like in Go.
+* syscall: Plan 9 support (thanks Yuval Pavel Zholkover),
+	StartProcess Chroot and Credential (thanks Albert Strasheim),
+	add BPF support for freebsd/386, freebsd/amd64 (thanks Mikio Hara),
+	make [Raw]Syscall6 pass 6th arg on linux/386 (thanks Evan Shaw).
+
+ +

2011-03-28

+ +
+This weekly release includes improved support for testing.
+
+Memory and CPU profiling is now available via the gotest tool. Gotest will
+produce memory and CPU profiling data when invoked with the -test.memprofile
+and -test.cpuprofile flags. Run "godoc gotest" for details.
+
+We have also introduced a way for tests to run quickly when an exhaustive test
+is unnecessary. Gotest's new -test.short flag in combination with the testing
+package's new Short function allows you to write tests that can be run in
+normal or "short" mode; short mode is now used by all.bash to reduce
+installation time.
+The Makefiles know about the flag - you can just run "make testshort".
+
+Other changes:
+* .hgignore: Ignore all goinstalled packages (thanks Evan Shaw).
+* build: add all-qemu.bash, handful of arm fixes,
+        add support for SWIG, and add two SWIG examples,
+        diagnose Ubuntu's buggy copy of gold,
+        handle broken awk in version.bash (thanks Dave Cheney),
+        reenable clean.bash without gomake (thanks Gustavo Niemeyer).
+* cgo: fix index-out-of-bounds bug.
+* codereview: permit CLs of the form weekly.DATE
+* crypto/ecdsa: truncate hash values.
+* crypto/openpgp: add DSA signature support.
+* dashboard: remove old python/bash builder, update README.
+* doc: explain release and weekly tags in install.html.
+* exec: document dir option for Run (thanks Gustavo Niemeyer).
+* flag: document Nflag function (thanks Fazlul Shahriar).
+* gc: remove interim ... error which rejects valid code.
+* go/ast: implemented NewPackage,
+        merge CaseClause and TypeCaseClause.
+* go/parser: fix memory leak by making a copy of token literals,
+        resolve identifiers properly.
+* go/printer, gofmt: avoid exponential layout algorithm,
+        gofmt: simplify struct formatting and respect line breaks.
+* go/scanner: to interpret line comments with Windows filenames (thanks Alex Brainman).
+* go/token: use array instead of map for token->string table.
+* gob: optimizations to reduce allocations,
+        use pointers in bootstrapType so interfaces behave properly.
+* gobuilder: recognize CLs of the form weekly.DATE.
+* godefs: handle volatile.
+* godoc: add -template flag to specify custom templates,
+        fix path problem for windows (thanks Yasuhiro Matsumoto).
+* gofix: httpserver - rewrite rw.SetHeader to rw.Header.Set.
+* gofmt: add profiling flag.
+* gopprof: fix bug: do not rotate 180 degrees for large scrolls,
+        update list of memory allocation functions.
+* gotest: fix gofmt issue in generated _testmain.go.
+* http: add NewProxyClientConn,
+        avoid crash when asked for multiple file ranges,
+        don't chunk 304 responses,
+        export Transport, add keep-alive support.
+* ld: return > 0 exit code on unsafe import.
+* misc/bbedit: remove closed keyword (thanks Anthony Starks).
+* misc/emacs: gofmt: don't clobber the current buffer on failure.
+* misc/vim: remove 'closed' as a builtin function.
+* net: add FileConn, FilePacketConn, FileListener (thanks Albert Strasheim),
+        don't force epoll/kqueue to wake up in order to add new events,
+        let OS-specific AddFD routine wake up polling thread,
+        use preallocated buffer for epoll and kqueue/kevent.
+* path/filepath: add EvalSymlinks function,
+        fix TestEvalSymlinks when run under symlinked GOROOT.
+* path: work for windows (thanks Yasuhiro Matsumoto).
+* rpc: increase server_test timeout (thanks Gustavo Niemeyer),
+        optimizations to reduce allocations.
+* runtime: fix darwin/amd64 thread VM footprint (thanks Alexey Borzenkov),
+        fix gdb support for goroutines,
+        more stack split fixes,
+        os-specific types and code for setitimer,
+        update defs.h for freebsd-386 (thanks Devon H. O'Dell).
+* strings: Map: avoid allocation when string is unchanged.
+* syscall: GetsockoptInt (thanks Albert Strasheim),
+        StartProcess fixes for windows (thanks Alex Brainman),
+        permit non-blocking syscalls,
+        rename from .sh to .pl, because these files are in Perl.
+* test: enable tests using v, ok := <-ch syntax (thanks Robert Hencke).
+* time: give a helpful message when we can't set the time zone for testing.
+        isolate syscall reference in sys.go.
+
+ +

2011-03-15

+ +
+This week's release introduces a new release tagging scheme. We intend to
+continue with our weekly releases, but have renamed the existing tags from
+"release" to "weekly". The "release" tag will now be applied to one hand-picked
+stable release each month or two.
+
+The revision formerly tagged "release.2011-03-07.1" (now "weekly.2011-03-07.1")
+has been nominated our first stable release, and has been given the tag
+"release.r56". As we tag each stable release we will post an announcement to
+the new golang-announce mailing list:
+  http://groups.google.com/group/golang-announce
+
+You can continue to keep your Go installation updated using "hg update
+release", but now you should only need to update once we tag a new stable
+release, which we will announce here. If you wish to stay at the leading edge,
+you should switch to the weekly tag with "hg update weekly".
+
+
+This weekly release includes significant changes to the language spec and the
+http, os, and syscall packages. Your code may need to be changed. It also
+introduces the new gofix tool.
+
+The closed function has been removed from the language. The syntax for channel
+receives has been changed to return an optional second value, a boolean value
+indicating whether the channel is closed. This code:
+	v := <-ch
+	if closed(ch) {
+		// channel is closed
+	}
+should now be written as:
+	v, ok := <-ch
+	if !ok {
+		// channel is closed
+	}
+
+It is now illegal to declare unused labels, just as it is illegal to declare
+unused local variables.
+
+The new gofix tool finds Go programs that use old APIs and rewrites them to use
+newer ones.  After you update to a new Go release, gofix helps make the
+necessary changes to your programs. Gofix will handle the http, os, and syscall
+package changes described below, and we will update the program to keep up with
+future changes to the libraries.
+
+The Hijack and Flush methods have been removed from the http.ResponseWriter
+interface and are accessible via the new http.Hijacker and http.Flusher
+interfaces. The RemoteAddr and UsingTLS methods have been moved from
+http.ResponseWriter to http.Request.
+
+The http.ResponseWriter interface's SetHeader method has been replaced by a
+Header() method that returns the response's http.Header. Caller code needs to
+change. This code:
+	rw.SetHeader("Content-Type", "text/plain")
+should now be written as:
+	rw.Header().Set("Content-Type", "text/plain")
+The os and syscall packages' StartProcess functions now take their final three
+arguments as an *os.ProcAttr and *syscall.ProcAttr values, respectively. This
+code:
+	os.StartProcess(bin, args, env, dir, fds)
+should now be written as:
+	os.StartProcess(bin, args, &os.ProcAttr{Files: fds, Dir: dir, Env: env})
+
+The gob package will now encode and decode values of types that implement the
+gob.GobEncoder and gob.GobDecoder interfaces. This allows types with unexported
+fields to transmit self-consistent descriptions; one instance is big.Int and
+big.Rat.
+
+Other changes:
+* 5l, 6l, 8l: reduce binary size about 40% by omitting symbols for type, string, go.string.
+* 5l, 8l: output missing section symbols (thanks Anthony Martin).
+* 6l, 8l: fix gdb crash.
+* Make.cmd: also clean _test* (thanks Gustavo Niemeyer).
+* big: implemented custom Gob(En/De)coder for Int type.
+* build: remove duplicate dependency in Make.cmd (thanks Robert Hencke),
+        run gotest in misc/cgo/test.
+* codereview.py: don't suggest change -d if user is not CL author (thanks Robert Hencke).
+* compress/lzw: benchmark a range of input sizes.
+* crypto/ecdsa: add package.
+* crypto/elliptic: add the N value of each curve.
+* crypto/openpgp: bug fixes and fix misnamed function.
+* crypto/tls: fix compile error (thanks Dave Cheney).
+* doc: Effective Go: some small cleanups,
+        update FAQ. hello, world is now 1.1MB, down from 1.8MB,
+        update codelab wiki to fix template.Execute argument order.
+* flag: visit the flags in sorted order, for nicer messages.
+* fmt: do not export EOF = -1.
+* fmt: make ScanState.Token more general (thanks Roger Peppe).
+* gc: diagnose unused labels,
+        fix handling of return values named _,
+        include all dependencies in export metadata,
+        make unsafe.Pointer its own kind of type, instead of an equivalent to *any.
+* go/ast, go/parser: populate identifier scopes at parse time.
+* go/ast: add FileSet parameter to ast.Print and ast.Fprint.
+* go/parser: first constant in a constant declaration must have a value.
+* gob: efficiency and reliability fixes.
+* gofmt: remove -trace and -ast flags.
+* goinstall: handle $(GOOS) and $(GOARCH) in filenames,
+        handle .c files with gc when cgo isn't used, and
+        handle .s files with gc (thanks Gustavo Niemeyer).
+* gopack: omit time stamps, makes output deterministic.
+* gotype: commandline tool to typecheck go programs.
+* govet: handle '*' in print format strings.
+* hash: new FNV-1a implementation (thanks Pascal S. de Kloe).
+* http/cgi: child support (e.g. Go CGI under Apache).
+* http: adapt Cookie code to follow IETF draft (thanks Petar Maymounkov),
+        add test for fixed HTTP/1.0 keep-alive issue,
+        don't hit external network in client_test.go,
+        fix transport crash when request URL is nil,
+        rename interface Transport to RoundTripper,
+        run tests even with DISABLE_NET_TESTS=1.
+* httptest: default the Recorder status code to 200 on a Write.
+* io/ioutil: clean-up of ReadAll and ReadFile.
+* ioutil: add NopCloser.
+* ld: preserve symbol sizes during data layout.
+* lib9, libmach: Change GOOS references to GOHOSTOS (thanks Evan Shaw).
+* libmach: correct string comparison to revive 6cov on darwin (thanks Dave Cheney).
+* misc/vim: Add indent script for Vim (thanks Ross Light).
+* net, os, syslog: fixes for Solaris support.
+* net: don't loop to drain wakeup pipe.
+* nm: document -S flag.
+* openpgp: add PublicKey KeyId string accessors.
+* rpc: optimizations, add benchmarks and memory profiling,
+        use httptest.Server for tests (thanks Robert Hencke).
+* runtime: reduce lock contention via wakeup on scheduler unlock,
+        scheduler, cgo reorganization,
+        split non-debugging malloc interface out of debug.go into mem.go.
+* spec: clarify return statement rules.
+* strings: add IndexRune tests, ASCII fast path,
+        better benchmark names; add BenchmarkIndex.
+* syscall: implement Mount and Unmount for linux,
+        implement Reboot for linux.
+* time: fix Time.ZoneOffset documentation (thanks Peter Mundy).
+* tls: move PeerCertificates to ConnectionState.
+
+ +

2011-03-07 (base for r56)

+ +
+This release includes changes to the reflect and path packages.
+Code that uses reflect or path may need to be updated.
+
+The reflect package's Value.Addr method has been renamed to Value.UnsafeAddr.
+Code that uses the Addr method will have to call UnsafeAddr instead.
+
+The path package has been split into two packages: path and path/filepath.
+Package path manipulates slash-separated paths, regardless of operating system.
+Package filepath implements the local operating system's native file paths.
+OS-specific functioanlity in pacakge path, such as Walk, moved to filepath.
+
+Other changes:
+* build: fixes and simplifications (thanks Dave Cheney),
+        move $GOBIN ahead of /bin, /usr/bin in build $PATH.
+* bzip2: speed up decompression.
+* cgo: fix dwarf type parsing (thanks Gustavo Niemeyer),
+        put temporary source files in _obj (thanks Roger Peppe),
+        fix bug involving 0-argument callbacks.
+* compress/lzw: optimizations.
+* doc: add FAQ about "implements",
+        add FAQ about large binaries ,
+        add FAQ about stack vs heap allocation,
+        add internationalization to roadmap,
+        describe platform-specific conventions in code.html.
+* fmt: allow recursive calls to Fscan etc (thanks Roger Peppe),
+        make %#p suppress leading 0x.
+* gc, gopack: add some missing flags to the docs.
+* gc: fix init of packages named main (thanks Gustavo Niemeyer),
+* gob: make recursive map and slice types work, and other fixes.
+        tentative support for GobEncoder/GobDecoder interfaces.
+* gobuilder: add -package flag to build external packages and -v for verbose.
+* gofmt: exclude test file that is not legal Go.
+* goinstall: protect against malicious filenames (thanks Roger Peppe).
+* goyacc: provide -p flag to set prefix for names, documentation update.
+* http: add cookie support (thanks Petar Maymounkov),
+        allow handlers to send non-chunked responses,
+        export ParseHTTPVersion,
+        expose Client's Transport,
+        use WriteProxy,
+        rename ClientTransport to Transport.
+* http/cgi: new package.
+* http/httptest: new package.
+* image: add a decoding test for common file formats.
+* io/ioutil: add TempDir.
+* mime/multipart: Header changed from map to MIMEHeader
+* path/filepath: new OS-specific path support (thanks Gustavo Niemeyer).
+* reflect: add PtrTo, add Value.Addr (old Addr is now UnsafeAddr).
+* runtime: use kernel-supplied compare-and-swap on linux/arm.
+* spec: minor clarification of scope rule for functions.
+* sync/atomic: new package to expose atomic operations.
+* syscall: regenerate zerrors_freebsd_amd64.go (thanks Mikio Hara),
+        work around FreeBSD execve kernel bug (thanks Devon H. O'Dell).
+* template: document the delimiters.
+* testing: run GC before each benchmark run (thanks Roger Peppe).
+* unsafe: fix the documentation.
+* websocket: use httptest.Server for tests (thanks Robert Hencke).
+* xml: permit nested directives (thanks Chris Dollin).
+
+ +

2011-02-24

+ +
+This release includes changes to the http package and a small language change.
+Your code will require changes if it manipulates http Headers or omits the
+condition in if statements.
+
+The new http.Header type replaces map[string]string in the Header and Trailer
+fields of http.Request and http.Response.
+A Header value can be manipulated via its Get, Set, Add, and Del methods.
+See http://golang.org/pkg/http/#Header
+
+The condition is now mandatory in if statements.
+Previously it would default to true, as in switch and for statements.
+This code is now illegal:
+	if x := foo(); {
+		// code that is always executed
+	}
+The same effect can be achieved like this:
+	if x := foo(); true {
+		// code
+	}
+Or, in a simpler form:
+	{
+		x := foo()
+		// code
+	}
+
+Other changes:
+* 6l: new -Hwindowsgui flag allows to build windows gui pe (thanks Alex Brainman),
+	pe fixes (thanks Wei Guangjing).
+* 8l, 6l: allow for more os threads to be created on Windows (thanks Alex Brainman),
+* build: reduce the use of subshells in recursive make, and
+	remove unused NaCl conditional from make.bash (thanks Dave Cheney).
+* codereview: fix clpatch with empty diffs (thanks Gustavo Niemeyer).
+* compress/bzip2: add package.
+* compress/lzw: implement a decoder.
+* crypto/openpgp: add package.
+* crypto/rand: add read buffer to speed up small requests (thanks Albert Strasheim).
+* crypto/rsa: left-pad OAEP results when needed.
+* crypto/tls: make protocol negotiation failure fatal.
+* fmt: stop giving characters to the Scan method of Scanner when we hit a newline in Scanln.
+* gc: interface error message fixes,
+	make string const comparison unsigned (thanks Jeff R. Allen).
+* go spec: minor clarification on channel types.
+* go/ast, parser: condition in if statement is mandatory.
+* gob: compute information about a user's type once.
+	protect against pure recursive types.
+* godoc: accept symbolic links as path names provided to -path,
+	add robots.txt, log errors when reading filter files.
+* html: tokenize HTML comments.
+* http: add proxy support (thanks Yasuhiro Matsumoto),
+	implement with net/textproto (thanks Petar Maymounkov),
+	send full URL in proxy requests,
+	introduce start of Client and ClientTransport.
+* image/png: support for more formats (thanks Mikael Tillenius).
+* json: only use alphanumeric tags,
+	use base64 to encode []byte (thanks Roger Peppe).
+* ld: detect stack overflow due to NOSPLIT, drop rpath, support weak symbols.
+* misc/dashboard/builder: talk to hg with utf-8 encoding.
+* misc/dashboard: notify golang-dev on build failure.
+* net: *netFD.Read to return os.EOF on eof under windows (thanks Alex Brainman),
+	add IPv4 multicast to UDPConn (thanks Dave Cheney),
+	more accurate IPv4-in-IPv6 API test (thanks Mikio Hara),
+	reject invalid net:proto network names (thanks Olivier Antoine).
+* netchan: allow use of arbitrary connections (thanks Roger Peppe).
+* os: add ENODATA and ENOTCONN (thanks Albert Strasheim).
+* reflect: add a couple of sentences explaining how Methods operate,
+	add a secret method to ArrayOrSliceType to ensure it's only implemented by arrays and slices,
+	add pointer word to CommonType (placeholder for future work).
+* runtime-gdb.py: gdb pretty printer for go strings properly handles length.
+* runtime: various bug fixes, more complete stack traces,
+	record $GOROOT_FINAL for runtime.GOROOT.
+* spec: delete incorrect mention of selector working on pointer to interface type.
+* sync: add Cond (thanks Gustavo Niemeyer).
+* syscall: add MCL_* flags for mlockall (thanks Albert Strasheim),
+	implement chmod() for win32 (thanks Yasuhiro Matsumoto).
+* test/bench: update timings for new GC.
+* testing: rename cmdline flags to avoid conflicts (thanks Gustavo Niemeyer).
+* textproto: introduce Header type (thanks Petar Maymounkov).
+* websocket: use new interface to access Header.
+
+ +

2011-02-15

+ +
+This release includes changes to the io, os, and template packages.
+You may need to update your code.
+
+The io.ReadByter and io.ReadRuner interface types have been renamed to
+io.ByteReader and io.RuneReader respectively.
+
+The os package's ForkExec function has been superseded by the new StartProcess
+function and an API built around the Process type:
+	http://golang.org/pkg/os/#Process
+
+The order of arguments to template.Execute has been reversed to be consistent
+the notion of "destination first", as with io.Copy, fmt.Fprint, and others.
+
+Gotest now works for package main in directories using Make.cmd-based makefiles.
+
+The memory allocation runtime problems from the last release are not completely
+fixed.  The virtual memory exhaustion problems encountered by people using
+ulimit -v have been fixed, but there remain known garbage collector problems
+when using GOMAXPROCS > 1.
+
+Other changes:
+* 5l: stopped generating 64-bit eor.
+* 8l: more work on plan9 support (thanks Yuval Pavel Zholkover).
+* archive/zip: handle files with data descriptors.
+* arm: working peep-hole optimizer.
+* asn1: marshal true as 255, not 1.
+* buffer.go: minor optimization, expanded comment.
+* build: drop syslog on DISABLE_NET_TESTS=1 (thanks Gustavo Niemeyer),
+       allow clean.bash to work on fresh checkout,
+       change "all tests pass" message to be more obvious,
+       fix spaces in GOROOT (thanks Christopher Nielsen).
+* bytes: fix bug in buffer.ReadBytes (thanks Evan Shaw).
+* 5g: better int64 code,
+       don't use MVN instruction.
+* cgo: don't run cgo when not compiling (thanks Gustavo Niemeyer),
+       fix _cgo_run timestamp file order (thanks Gustavo Niemeyer),
+       fix handling of signed enumerations (thanks Gustavo Niemeyer),
+       os/arch dependent #cgo directives (thanks Gustavo Niemeyer),
+       rename internal f to avoid conflict with possible C global named f.
+* codereview: fix hgpatch on windows (thanks Yasuhiro Matsumoto),
+       record repository, base revision,
+       use cmd.communicate (thanks Yasuhiro Matsumoto).
+* container/ring: replace Iter() with Do().
+* crypto/cipher: add resync open to OCFB mode.
+* crypto/openpgp/armor: bug fixes.
+* crypto/openpgp/packet: new subpackage.
+* crypto/tls: load a chain of certificates from a file,
+       select best cipher suite, not worst.
+* crypto/x509: add support for name constraints.
+* debug/pe: ImportedSymbols fixes (thanks Wei Guangjing).
+* doc/code: update to reflect that package names need not be unique.
+* doc/codelab/wiki: a bunch of fixes (thanks Andrey Mirtchovski).
+* doc/install: update for new versions of Mercurial.
+* encoding/line: fix line returned after EOF.
+* flag: allow hexadecimal (0xFF) and octal (0377) input for integer flags.
+* fmt.Scan: scan binary-exponent floating format, 2.4p-3,
+       hexadecimal (0xFF) and octal (0377) integers.
+* fmt: document %%; also %b for floating point.
+* gc, ld: detect stale or incompatible object files,
+       package name main no longer reserved.
+* gc: correct receiver in method missing error (thanks Lorenzo Stoakes),
+       correct rounding of denormal constants (thanks Eoghan Sherry),
+       select receive bug fix.
+* go/printer, gofmt: smarter handling of multi-line raw strings.
+* go/printer: line comments must always end in a newline,
+       remove notion of "Styler", remove HTML mode.
+* gob: allow Decode(nil) and have it just discard the next value.
+* godoc: use IsAbs to test for absolute paths (fix for win32) (thanks Yasuhiro Matsumoto),
+       don't hide package lookup error if there's no command with the same name.
+* gotest: enable unit tests for main programs.
+* http: add Server type supporting timeouts,
+       add pipelining to ClientConn, ServerConn (thanks Petar Maymounkov),
+       handle unchunked, un-lengthed HTTP/1.1 responses.
+* io: add RuneReader.
+* json: correct Marshal documentation.
+* netchan: graceful handling of closed connection (thanks Graham Miller).
+* os: implement new Process API (thanks Alex Brainman).
+* regexp tests: make some benchmarks more meaningful.
+* regexp: add support for matching against text read from RuneReader interface.
+* rpc: make more tolerant of errors, properly discard values (thanks Roger Peppe).
+* runtime: detect failed thread creation on Windows,
+       faster allocator, garbage collector,
+       fix virtual memory exhaustion,
+       implemented windows console ctrl handler (SIGINT) (thanks Hector Chu),
+       more detailed panic traces, line number work,
+       improved Windows callback handling (thanks Hector Chu).
+* spec: adjust notion of Assignability,
+       allow import of packages named main,
+       clarification re: method sets of newly declared pointer types,
+       fix a few typos (thanks Anthony Martin),
+       fix Typeof() return type (thanks Gustavo Niemeyer),
+       move to Unicode 6.0.
+* sync: diagnose Unlock of unlocked Mutex,
+       new Waitgroup type (thanks Gustavo Niemeyer).
+* syscall: add SetsockoptIpMreq (thanks Dave Cheney),
+       add sockaddr_dl, sysctl with routing message support for darwin, freebsd (thanks Mikio Hara),
+       do not use NULL for zero-length read, write,
+       implement windows version of Fsync (thanks Alex Brainman),
+       make ForkExec acquire the ForkLock under windows (thanks Hector Chu),
+       make windows API return errno instead of bool (thanks Alex Brainman),
+       remove obsolete socket IO control (thanks Mikio Hara).
+* template: add simple formatter chaining (thanks Kyle Consalus),
+       allow a leading '*' to indirect through a pointer.
+* testing: include elapsed time in test output
+* windows: replace remaining __MINGW32__ instances with _WIN32 (thanks Joe Poirier).
+
+ +

2011-02-01

+ +
+This release includes significant changes to channel operations and minor
+changes to the log package. Your code will require modification if it uses
+channels in non-blocking communications or the log package's Exit functions.
+
+Non-blocking channel operations have been removed from the language.
+The equivalent operations have always been possible using a select statement
+with a default clause.  If a default clause is present in a select, that clause
+will execute (only) if no other is ready, which allows one to avoid blocking on
+a communication.
+
+For example, the old non-blocking send operation,
+
+	if ch <- v {
+		// sent
+	} else {
+		// not sent
+	}
+
+should be rewritten as,
+
+	select {
+	case ch <- v:
+		// sent
+	default:
+		// not sent
+	}
+
+Similarly, this receive,
+
+	v, ok := <-ch
+	if ok {
+		// received
+	} else {
+		// not received
+	}
+
+should be rewritten as,
+
+	select {
+	case v := <-ch:
+		// received
+	default:
+		// not received
+	}
+
+This change is a prelude to redefining the 'comma-ok' syntax for a receive.
+In a later release, a receive expression will return the received value and an
+optional boolean indicating whether the channel has been closed. These changes
+are being made in two stages to prevent this semantic change from silently
+breaking code that uses 'comma-ok' with receives.
+There are no plans to have a boolean expression form for sends.
+
+Sends to a closed channel will panic immediately. Previously, an unspecified
+number of sends would fail silently before causing a panic.
+
+The log package's Exit, Exitf, and Exitln functions have been renamed Fatal,
+Fatalf, and Fatalln respectively. This brings them in line with the naming of
+the testing package. 
+
+The port to the "tiny" operating system has been removed. It is unmaintained
+and untested. It was a toy to show that Go can run on raw hardware and it
+served its purpose. The source code will of course remain in the repository
+history, so it could be brought back if needed later.
+
+This release also changes some of the internal structure of the memory
+allocator in preparation for other garbage collector changes. 
+If you run into problems, please let us know.
+There is one known issue that we are aware of but have not debugged yet:
+	http://code.google.com/p/go/issues/detail?id=1464&.
+
+Other changes in this release:
+* 5l: document -F, force it on old ARMs (software floating point emulation)
+* 6g: fix registerization of temporaries (thanks Eoghan Sherry),
+        fix uint64(uintptr(unsafe.Pointer(&x))).
+* 6l: Relocate CMOV* instructions (thanks Gustavo Niemeyer),
+        windows/amd64 port (thanks Wei Guangjing).
+* 8l: add PE dynexport, emit DWARF in Windows PE, and
+        code generation fixes (thanks Wei Guangjing).
+* bufio: make Flush a no-op when the buffer is empty.
+* bytes: Add Buffer.ReadBytes, Buffer.ReadString (thanks Evan Shaw).
+* cc: mode to generate go-code for types and variables.
+* cgo: define CGO_CFLAGS and CGO_LDFLAGS in Go files (thanks Gustavo Niemeyer),
+        windows/386 port (thanks Wei Guangjing).
+* codereview: fix windows (thanks Hector Chu),
+        handle file patterns better,
+        more ASCII vs. Unicode nonsense.
+* crypto/dsa: add support for DSA.
+* crypto/openpgp: add s2k.
+* crypto/rand: use defer to unlock mutex (thanks Anschel Schaffer-Cohen).
+* crypto/rsa: correct docstring for SignPKCS1v15.
+* crypto: add package, a common place to store identifiers for hash functions.
+* doc/codelab/wiki: update to work with template changes, add to run.bash.
+* doc/spec: clarify address operators.
+* ebnflint: exit with non-zero status on error.
+* encoding/base32: new package (thanks Miek Gieben).
+* encoding/line: make it an io.Reader too.
+* exec: use custom error for LookPath (thanks Gustavo Niemeyer).
+* fmt/doc: define width and precision for strings.
+* gc: clearer error for struct == struct,
+        fix send precedence,
+        handle invalid name in type switch,
+        special case code for single-op blocking and non-blocking selects.
+* go/scanner: fix build (adjust scanner EOF linecount).
+* gob: better debugging, commentary,
+        make nested interfaces work,
+        report an error when encoding a non-empty struct with no public fields.
+* godoc: full text index for whitelisted non-Go files,
+        show line numbers for non-go files (bug fix).
+* gofmt -r: match(...) arguments may be nil; add missing guards.
+* govet: add Panic to the list of functions.
+* http: add host patterns (thanks Jose Luis Vázquez González),
+        follow relative redirect in Get.
+* json: handle capital floating point exponent (1E100) (thanks Pieter Droogendijk).
+* ld: add -I option to set ELF interpreter,
+        more robust decoding of reflection type info in generating dwarf.
+* lib9: update to Unicode 6.0.0.
+* make.bash: stricter selinux test (don't complain unless it is enabled).
+* misc/vim: Import/Drop commands (thanks Gustavo Niemeyer),
+        set 'syntax sync' to a large value (thanks Yasuhiro Matsumoto).
+* net: fix race condition in test,
+        return cname in LookupHost.
+* netchan: avoid race condition in test,
+        fixed documentation for import (thanks Anschel Schaffer-Cohen).
+* os: add ETIMEDOUT (thanks Albert Strasheim).
+* runtime: generate Go defs for C types,
+        implementation of callback functions for windows (thanks Alex Brainman),
+        make Walk web browser example work (thanks Hector Chu),
+        make select fairer,
+        prefer fixed stack allocator over general memory allocator,
+        simpler heap map, memory allocation.
+* scanner: fix Position returned by Scan, Pos,
+        don't read ahead in Init.
+* suffixarray: use binary search for both ends of Lookup (thanks Eric Eisner).
+* syscall: add missing network interface constants (thanks Mikio Hara).
+* template: treat map keys as zero, not non-existent (thanks Roger Peppe).
+* time: allow cancelling of After events (thanks Roger Peppe),
+        support Solaris zoneinfo directory.
+* token/position: added SetLinesForContent.
+* unicode: update to unicode 6.0.0.
+* unsafe: add missing case to doc for Pointer.
+
+ +

2011-01-20

+ +
+This release removes the float and complex types from the language.
+
+The default type for a floating point literal is now float64, and
+the default type for a complex literal is now complex128.
+
+Existing code that uses float or complex must be rewritten to
+use explicitly sized types.
+
+The two-argument constructor cmplx is now spelled complex.
+
+ +

2011-01-19

+ +
+The 5g (ARM) compiler now has registerization enabled.  If you discover it
+causes bugs, use 5g -N to disable the registerizer and please let us know.
+
+The xml package now allows the extraction of nested XML tags by specifying
+struct tags of the form "parent>child". See the XML documentation for an
+example: http://golang.org/pkg/xml/
+
+* 5a, 5l, 6a, 6l, 8a, 8l: handle out of memory, large allocations (thanks Jeff R. Allen).
+* 8l: pe changes (thanks Alex Brainman).
+* arm: fixes and improvements.
+* cc: fix vlong condition.
+* cgo: add complex float, complex double (thanks Sebastien Binet),
+        in _cgo_main.c define all provided symbols as functions.
+* codereview: don't mail change lists with no files (thanks Ryan Hitchman).
+* crypto/cipher: add OFB mode.
+* expvar: add Float.
+* fmt: document %X of string, []byte.
+* gc, runtime: make range on channel safe for multiple goroutines.
+* gc: fix typed constant declarations (thanks Anthony Martin).
+* go spec: adjust language for constant typing.
+* go/scanner: Make Init take a *token.File instead of a *token.FileSet.
+* godoc: bring back "indexing in progress" message,
+        don't double HTML-escape search result snippets,
+        enable qualified identifiers ("math.Sin") as query strings again,
+        peephole optimization for generated HTML,
+        remove tab before formatted section.
+* gofmt, go/printer: do not insert extra line breaks where they may break the code.
+* http: fix Content-Range and Content-Length in response (thanks Clement Skau),
+        fix scheme-relative URL parsing; add ParseRequestURL,
+        handle HEAD requests correctly,
+        support for relative URLs.
+* math: handle denormalized numbers in Frexp, Ilogb, Ldexp, and Logb (thanks Eoghan Sherry).
+* net, syscall: return source address in Recvmsg (thanks Albert Strasheim).
+* net: add LookupAddr (thanks Kyle Lemons),
+        add unixpacket (thanks Albert Strasheim),
+        avoid nil dereference if /etc/services can't be opened (thanks Corey Thomasson),
+        implement windows timeout (thanks Wei Guangjing).
+* netchan: do not block sends; implement flow control (thanks Roger Peppe).
+* regexp: reject bare '?'. (thanks Ben Lynn)
+* runtime/cgo: don't define crosscall2 in dummy _cgo_main.c.
+* runtime/debug: new package for printing stack traces from a running goroutine.
+* runtime: add per-pause gc stats,
+        fix arm reflect.call boundary case,
+        print signal information during panic.
+* spec: specify that int and uint have the same size.
+* syscall: correct WSTOPPED on OS X,
+        correct length of GNU/Linux abstract Unix domain sockaddr,
+        correct length of SockaddrUnix.
+* tutorial: make stdin, stdout, stderr work on Windows.
+* windows: implement exception handling (thanks Hector Chu).
+
+ +

2011-01-12

+ +
+The json, gob, and template packages have changed, and code that uses them
+may need to be updated after this release. They will no longer read or write
+unexported struct fields. When marshalling a struct with json or gob the
+unexported fields will be silently ignored. Attempting to unmarshal json or
+gob data into an unexported field will generate an error. Accessing an
+unexported field from a template will cause the Execute function to return
+an error.
+
+Godoc now supports regular expression full text search, and this
+functionality is now available on golang.org.
+
+Other changes:
+* arm: initial cut at arm optimizer.
+* bytes.Buffer: Fix bug in UnreadByte.
+* cgo: export unsafe.Pointer as void*, fix enum const conflict,
+        output alignment fix (thanks Gustavo Niemeyer).
+* crypto/block: mark as deprecated.
+* crypto/openpgp: add error and armor.
+* crypto: add twofish package (thanks Berengar Lehr).
+* doc/spec: remove Maxalign from spec.
+* encoding/line: new package for reading lines from an io.Reader.
+* go/ast: correct end position for Index and TypeAssert expressions.
+* gob: make (en|dec)code(Ui|I)nt methods rather than functions.
+* godefs: better handling of enums.
+* gofmt: don't attempt certain illegal rewrites,
+        rewriter matches apply to expressions only.
+* goinstall: preliminary support for cgo packages (thanks Gustavo Niemeyer).
+* hg: add cgo/_cgo_* to .hgignore.
+* http: fix text displayed in Redirect.
+* ld: fix exported dynamic symbols on Mach-O,
+        permit a Mach-O symbol to be exported in the dynamic symbol table.
+* log: add methods for exit and panic.
+* net: use closesocket api instead of CloseHandle on Windows (thanks Alex Brainman).
+* netchan: make fields exported for gob change.
+* os: add Sync to *File, wraps syscall.Fsync.
+* runtime/cgo: Add callbacks to support SWIG.
+* runtime: Restore scheduler stack position if cgo callback panics.
+* suffixarray: faster creation algorithm (thanks Eric Eisner).
+* syscall: fix mksysnum_linux.sh (thanks Anthony Martin).
+* time.NewTicker: panic for intervals <= 0.
+* time: add AfterFunc to call a function after a duration (thanks Roger Peppe),
+        fix tick accuracy when using multiple Tickers (thanks Eoghan Sherry).
+ +

2011-01-06

+ +
+This release includes several fixes and changes:
+
+* build: Make.pkg: use installed runtime.h for cgo.
+* cgo: disallow use of C.errno.
+* crypto/cipher: fix OCFB,
+        make NewCBCEncrypter return BlockMode.
+* doc: 6l: fix documentation of -L flag,
+        add golanguage.ru to foreign-language doc list,
+        effective go: explain the effect of repanicking better,
+        update Effective Go for template API change,
+        update contribution guidelines to prefix the change description.
+* encoding/binary: reject types with implementation-dependent sizes (thanks Patrick Gavlin).
+* exp/evalsimple fix handling of slices like s[:2] (thanks Sebastien Binet).
+* fmt: made format string handling more efficient,
+        normalize processing of format string.
+* gc: return constant floats for parts of complex constants (thanks Anthony Martin),
+        rewrite complex /= to l = l / r (thanks Patrick Gavlin),
+        fix &^=.
+* go/ast: provide complete node text range info.
+* gob: generate a better error message in one confusing place.
+* godoc: fix godoc -src (thanks Icarus Sparry).
+* goinstall: add -clean flag (thanks Kyle Lemons),
+        add checkout concept (thanks Caine Tighe),
+        fix -u for bzr (thanks Gustavo Niemeyer).
+* http: permit empty Reason-Phrase in response Status-Line.
+* io: fix Copyn EOF handling.
+* net: fix close of Listener (thanks Michael Hoisie).
+* regexp: fix performance bug, make anchored searches fail fast,
+        fix prefix bug.
+* runtime/cgo: fix stackguard on FreeBSD/amd64 (thanks Anthony Martin).
+* strconv: atof: added 'E' as valid token for exponent (thanks Stefan Nilsson),
+        update ftoa comment for 'E' and 'G'.
+* strings: fix description of FieldsFunc (thanks Roger Peppe).
+* syscall: correct Linux Splice definition,
+        make Access second argument consistently uint32.
+
+ +

2010-12-22

+ +
+A small release this week. The most significant change is that some 
+outstanding cgo issues were resolved.
+
+* cgo: handle references to symbols in shared libraries.
+* crypto/elliptic: add serialisation and key pair generation.
+* crypto/hmac: add HMAC-SHA256 (thanks Anthony Martin).
+* crypto/tls: add ECDHE support ("Elliptic Curve Diffie Hellman Ephemeral"),
+        add support code for generating handshake scripts for testing.
+* darwin, freebsd: ignore write failure (during print, panic).
+* exp/draw: remove Border function.
+* expvar: quote StringFunc output, same as String output.
+* hash/crc64: fix typo in Sum.
+* ld: allow relocations pointing at ELF .bss symbols, ignore stab symbols.
+* misc/cgo/life: fix, add to build.
+* regexp: add HasMeta, HasOperator, and String methods to Regexp.
+* suffixarray: implemented FindAllIndex regexp search.
+* test/bench: update numbers for regex-dna after speedup to regexp.
+* time: explain the formats a little better.
+
+ +

2010-12-15

+ +
+Package crypto/cipher has been started, to replace crypto/block.
+As part of the changes, rc4.Cipher's XORKeyStream method signature has changed from
+        XORKeyStream(buf []byte)
+to
+        XORKeyStream(dst, src []byte)
+to implement the cipher.Stream interface.  If you use crypto/block, you'll need
+to switch to crypto/cipher once it is complete.
+
+Package smtp's StartTLS now takes a *tls.Config argument.
+
+Package reflect's ArrayCopy has been renamed to Copy.  There are new functions
+Append and AppendSlice.
+
+The print/println bootstrapping functions now write to standard error.
+To write to standard output, use fmt.Print[ln].
+
+A new tool, govet, has been added to the Go distribution. Govet is a static
+checker for Go programs. At the moment, and for the foreseeable future,
+it only checks arguments to print calls.
+
+The cgo tool for writing Go bindings for C code has changed so that it no
+longer uses stub .so files (like cgo_stdio.so).  Cgo-based packages using the
+standard Makefiles should build without any changes.  Any alternate build
+mechanisms will need to be updated.
+
+The C and Go compilers (6g, 6c, 8g, 8c, 5g, 5c) now align structs according to
+the maximum alignment of the fields they contain; previously they aligned
+structs to word boundaries.  This may break non-cgo-based code that attempts to
+mix C and Go.
+
+NaCl support has been removed. The recent linker changes broke NaCl support
+a month ago, and there are no known users of it.
+If necessary, the NaCl code can be recovered from the repository history.
+
+* 5g/8g, 8l, ld, prof: fix output of 32-bit values (thanks Eoghan Sherry).
+* [68]l and runtime: GDB support for interfaces and goroutines.
+* 6l, 8l: support for linking ELF and Mach-O .o files.
+* all: simplify two-variable ranges with unused second variable (thanks Ryan Hitchman).
+* arm: updated soft float support.
+* codereview: keep quiet when not in use (thanks Eoghan Sherry).
+* compress/flate: implement Flush, equivalent to zlib's Z_SYNC_FLUSH.
+* crypto/tls: use rand.Reader in cert generation example (thanks Anthony Martin).
+* dashboard: fix project tag filter.
+* debug/elf, debug/macho: add ImportedLibraries, ImportedSymbols.
+* doc/go_mem: goroutine exit is not special.
+* event.go: another print glitch from gocheck.
+* gc: bug fixes,
+        syntax error for incomplete chan type (thanks Ryan Hitchman).
+* go/ast: fix ast.Walk.
+* gob: document the byte count used in the encoding of values,
+        fix bug sending zero-length top-level slices and maps,
+        Register should use the original type, not the indirected one.
+* godashboard: support submitting projects with non-ascii names (thanks Ryan Hitchman)
+* godefs: guard against structs with pad fields
+* godoc: added textual search, to enable use -fulltext flag.
+* gofmt: simplify "x, _ = range y" to "x = range y".
+* gopack: allow ELF/Mach-O objects in .a files without clearing allobj.
+* go/token,scanner: fix comments so godoc aligns properly.
+* govet: on error continue to the next file (thanks Christopher Wedgwood).
+* html: improved parsing.
+* http: ServeFile handles Range header for partial requests.
+* json: check for invalid UTF-8.
+* ld: allow .o files with no symbols,
+        reading of ELF object files,
+        reading of Mach-O object files.
+* math: change float64 bias constant from 1022 to 1023 (thanks Eoghan Sherry),
+        rename the MinFloat constant to SmallestNonzeroFloat.
+* nm: silently ignore .o files in .a files.
+* os: fix test of RemoveAll.
+* os/inotify: new package (thanks Balazs Lecz).
+* os: make MkdirAll work with symlinks (thanks Ryan Hitchman).
+* regexp: speed up by about 30%; also simplify code for brackets.
+* runtime/linux/386: set FPU to 64-bit precision.
+* runtime: remove paranoid mapping at 0.
+* suffixarray: add Bytes function.
+* syscall: add network interface constants for linux/386, linux/amd64 (thanks Mikio Hara).
+* syscall/windows: restrict access rights param of OpenProcess(),
+        remove \r and \n from error messages (thanks Alex Brainman).
+* test/bench: fixes to timing.sh (thanks Anthony Martin).
+* time: fix bug in Ticker: shutdown using channel rather than memory.
+* token/position: provide FileSet.File, provide files iterator.
+* xml: disallow invalid Unicode code points (thanks Nigel Kerr).
+
+ +

2010-12-08

+ +
+This release includes some package changes. If you use the crypto/tls or
+go/parser packages your code may require changes.
+
+The crypto/tls package's Dial function now takes an additional *Config
+argument.  Most uses will pass nil to get the same default behavior as before.
+See the documentation for details:
+        http://golang.org/pkg/crypto/tls/#Config
+        http://golang.org/pkg/crypto/tls/#Dial
+
+The go/parser package's ParseFile function now takes a *token.FileSet as its
+first argument. This is a pointer to a data structure used to store
+position information. If you don't care about position information you
+can pass "token.NewFileSet()". See the documentation for details:
+        http://golang.org/pkg/go/parser/#ParseFile
+
+This release also splits the patent grant text out of the LICENSE file into a
+separate PATENTS file and changes it to be more like the WebM grant.
+These clarifications were made at the request of the Fedora project.
+
+Other changes:
+* [68]l: generate debug info for builtin structured types, prettyprinting in gdb.
+* 8l: add dynimport to import table in Windows PE (thanks Wei Guangjing).
+* 8l, runtime: fix Plan 9 386 build (thanks Yuval Pavel Zholkover).
+* all: fix broken calls to Printf etc.
+* bufio: make Reader.Read implement io.Reader semantics (thanks Roger Peppe).
+* build: allow archiver to be specified by HOST_AR (thanks Albert Strasheim).
+* bytes: add Buffer.UnreadRune, Buffer.UnreadByte (thanks Roger Peppe).
+* crypto/tls: fix build of certificate generation example (thanks Christian Himpel).
+* doc/install: describe GOHOSTOS and GOHOSTARCH.
+* errchk: accept multiple source files (thanks Eoghan Sherry).
+* exec.LookPath: return os.PathError instad of os.ENOENT (thanks Michael Hoisie)..
+* flag: fix format error in boolean error report,
+        handle multiple calls to flag.Parse.
+* fmt: add %U format for standard Unicode representation of code point values.
+* gc: fix method offsets of anonymous interfaces (thanks Eoghan Sherry),
+        skip undefined symbols in import . (thanks Eoghan Sherry).
+* go/scanner: remove Tokenize - was only used in tests
+* gobuilder: add buildroot command-line flag (thanks Devon H. O'Dell).
+* html: unescape numeric entities (thanks Ryan Hitchman).
+* http: Add EncodeQuery, helper for constructing query strings.
+* ld: fix dwarf decoding of 64-bit reflect values (thanks Eoghan Sherry).
+* math: improve accuracy of Exp2 (thanks Eoghan Sherry).
+* runtime: add Goroutines (thanks Keith Rarick).
+* sync: small naming fix for armv5 (thanks Dean Prichard).
+* syscall, net: Add Recvmsg and Sendmsg on Linux (thanks Albert Strasheim).
+* time: make After use fewer goroutines and host processes (thanks Roger Peppe).
+
+ +

2010-12-02

+ +
+Several package changes in this release may require you to update your code if
+you use the bytes, template, or utf8 packages. In all cases, any outdated code
+will fail to compile rather than behave erroneously.
+
+The bytes package has changed. Its Add and AddByte functions have been removed,
+as their functionality is provided by the recently-introduced built-in function
+"append". Any code that uses them will need to be changed:
+s = bytes.Add(s, b)    ->    s = append(s, b...)
+s = bytes.AddByte(b, c)    ->    s = append(s, b)
+s = bytes.Add(nil, c)    ->    append([]byte(nil), c)
+
+The template package has changed. Your code will need to be updated if it calls
+the HTMLFormatter or StringFormatter functions, or implements its own formatter
+functions. The function signature for formatter types has changed to:
+        func(wr io.Writer, formatter string, data ...interface{})
+to allow multiple arguments to the formatter.  No templates will need updating.
+See the change for examples:
+        http://code.google.com/p/go/source/detail?r=2c2be793120e
+
+The template change permits the implementation of multi-word variable
+instantiation for formatters. Before one could say
+        {field}
+or
+        {field|formatter}
+Now one can also say
+        {field1 field2 field3}
+or
+        {field1 field2 field3|formatter}
+and the fields are passed as successive arguments to the formatter,
+by analogy to fmt.Print.
+
+The utf8 package has changed. The order of EncodeRune's arguments has been
+reversed to satisfy the convention of "destination first".
+Any code that uses EncodeRune will need to be updated.
+
+Other changes:
+* [68]l: correct dwarf location for globals and ranges for arrays.
+* big: fix (*Rat) SetFrac64(a, b) when b < 0 (thanks Eoghan Sherry).
+* compress/flate: fix typo in comment (thanks Mathieu Lonjaret).
+* crypto/elliptic: use a Jacobian transform for better performance.
+* doc/code.html: fix reference to "gomake build" (thanks Anschel Schaffer-Cohen).
+* doc/roadmap: update gdb status.
+* doc/spec: fixed some omissions and type errors.
+* doc: some typo fixes (thanks Peter Mundy).
+* exp/eval: build fix for parser.ParseFile API change (thanks Anschel Schaffer-Cohen).
+* fmt: Scan accepts Inf and NaN,
+        allow "% X" as well as "% x".
+* go/printer: preserve newlines in func parameter lists (thanks Jamie Gennis).
+* http: consume request body before next request.
+* log: ensure writes are atomic (thanks Roger Peppe).
+* path: Windows support for Split (thanks Benny Siegert).
+* runtime: fix SysFree to really free memory on Windows (thanks Alex Brainman),
+        parallel definitions in Go for all C structs.
+* sort: avoid overflow in pivot calculation,
+        reduced stack depth to lg(n) in quickSort (thanks Stefan Nilsson).
+* strconv: Atof on Infs and NaNs.
+
+ +

2010-11-23

+ +
+This release includes a backwards-incompatible package change to the
+sort.Search function (introduced in the last release).
+See the change for details and examples of how you might change your code:
+        http://code.google.com/p/go/source/detail?r=102866c369
+
+* build: automatically #define _64BIT in 6c.
+* cgo: print required space after parameter name in wrapper function.
+* crypto/cipher: new package to replace crypto/block (thanks Adam Langley).
+* crypto/elliptic: new package, implements elliptic curves over prime fields (thanks Adam Langley).
+* crypto/x509: policy OID support and fixes (thanks Adam Langley).
+* doc: add link to codewalks,
+        fix recover() documentation (thanks Anschel Schaffer-Cohen),
+        explain how to write Makefiles for commands.
+* exec: enable more tests on windows (thanks Alex Brainman).
+* gc: adjustable hash code in typecheck of composite literals
+        (thanks to vskrap, Andrey Mirtchovski, and Eoghan Sherry).
+* gc: better error message for bad type in channel send (thanks Anthony Martin).
+* godoc: bug fix in relativePath,
+        compute search index for all file systems under godoc's observation,
+        use correct time stamp to indicate accuracy of search result.
+* index/suffixarray: use sort.Search.
+* net: add ReadFrom and WriteTo windows version (thanks Wei Guangjing).
+* reflect: remove unnecessary casts in Get methods.
+* rpc: add RegisterName to allow override of default type name.
+* runtime: free memory allocated by windows CommandLineToArgv (thanks Alex Brainman).
+* sort: simplify Search (thanks Roger Peppe).
+* strings: add LastIndexAny (thanks Benny Siegert).
+
+ +

2010-11-10

+ +
+The birthday release includes a new Search capability inside the sort package.
+It takes an unusual but very general and easy-to-use approach to searching
+arbitrary indexable sorted data.  See the documentation for details:
+    http://golang.org/pkg/sort/#Search
+
+The ARM port now uses the hardware floating point unit (VFP).  It still has a
+few bugs, mostly around conversions between unsigned integer and floating-point
+values, but it's stabilizing.
+
+In addition, there have been many smaller fixes and updates: 
+
+* 6l: generate dwarf variable names with disambiguating suffix.
+* container/list: make Remove return Value of removed element.
+    makes it easier to remove first or last item.
+* crypto: add cast5 (default PGP cipher),
+    switch block cipher methods to be destination first.
+* crypto/tls: use pool building for certificate checking
+* go/ast: change embedded token.Position fields to named fields
+    (preparation for a different position representation)
+* net: provide public access to file descriptors (thanks Keith Rarick)
+* os: add Expand function to evaluate environment variables.
+* path: add Glob (thanks Benny Siegert)
+* runtime: memequal optimization (thanks Graham Miller)
+    prefix all external symbols with "runtime·" to avoid
+    conflicts linking with external C libraries.
+
+ +

2010-11-02

+ +
+This release includes a language change: the new built-in function, append.
+Append makes growing slices much simpler. See the spec for details:
+        http://golang.org/doc/go_spec.html#Appending_and_copying_slices
+
+Other changes:
+* 8l: pe generation fixes (thanks Alex Brainman).
+* doc: Effective Go: append and a few words about "..." args.
+* build: fiddle with make variables.
+* codereview: fix sync and download in Python 2.7 (thanks Fazlul Shahriar).
+* debug/pe, cgo: add windows support (thanks Wei Guangjing).
+* go/ast: add Inspect function for easy AST inspection w/o a visitor.
+* go/printer: do not remove parens around composite literals starting with
+        a type name in control clauses.
+* go/scanner: bug fixes, revisions, and more tests.
+* gob: several fixes and documentation updates.
+* godoc: bug fix (bug introduced with revision 3ee58453e961).
+* gotest: print empty benchmark list in a way that gofmt will leave alone.
+* http server: correctly respond with 304 NotModified (thanks Michael Hoisie).
+* kate: update list of builtins (thanks Evan Shaw).
+* libutf: update to Unicode 5.2.0 to match pkg/unicode (thanks Anthony Martin).
+* misc/bbedit: update list of builtins (thanks Anthony Starks).
+* misc/vim: update list of builtins.
+* mkrunetype: install a Makefile and tweak it slightly so it can be built.
+* netchan: fix locking bug.
+* pidigits: minor improvements (thanks Evan Shaw).
+* rpc: fix client deadlock bug.
+* src: use append where appropriate (often instead of vector).
+* strings: add Contains helper function (thanks Brad Fitzpatrick).
+* syscall: SIO constants for Linux (thanks Albert Strasheim),
+        Stat(path) on windows (thanks Alex Brainman).
+* test/ken/convert.go: add conversion torture test.
+* testing: add Benchmark (thanks Roger Peppe).
+
+ +

2010-10-27

+ +
+*** This release changes the encoding used by package gob. 
+    If you store gobs on disk, see below. ***
+
+The ARM port (5g) now passes all tests. The optimizer is not yet enabled, and
+floating point arithmetic is performed entirely in software. Work is underway
+to address both of these deficiencies.
+
+The syntax for arrays, slices, and maps of composite literals has been
+simplified. Within a composite literal of array, slice, or map type, elements
+that are themselves composite literals may elide the type if it is identical to
+the outer literal's element type. For example, these expressions:
+	[][]int{[]int{1, 2, 3}, []int{4, 5}}
+	map[string]Point{"x": Point{1.5, -3.5}, "y": Point{0, 0}}
+can be simplified to:
+	[][]int{{1, 2, 3}, {4, 5}}
+	map[string]Point{"x": {1.5, -3.5}, "y": {0, 0}}
+Gofmt can make these simplifications mechanically when invoked with the 
+new -s flag.
+
+The built-in copy function can now copy bytes from a string value to a []byte.
+Code like this (for []byte b and string s): 
+	for i := 0; i < len(s); i++ {
+		b[i] = s[i]
+	}
+can be rewritten as:
+	copy(b, s)
+
+The gob package can now encode and decode interface values containing types
+registered ahead of time with the new Register function. These changes required
+a backwards-incompatible change to the wire format.  Data written with the old
+version of the package will not be readable with the new one, and vice versa.
+(Steps were made in this change to make sure this doesn't happen again.) 
+We don't know of anyone using gobs to create permanent data, but if you do this
+and need help converting, please let us know, and do not update to this release
+yet.  We will help you convert your data.
+
+Other changes:
+* 5g, 6g, 8g: generate code for string index instead of calling function.
+* 5l, 6l, 8l: introduce sub-symbols.
+* 6l/8l: global and local variables and type info.
+* Make.inc: delete unnecessary -fno-inline flag to quietgcc.
+* arm: precise float64 software floating point, bug fixes.
+* big: arm assembly, faster software mulWW, divWW.
+* build: only print "You need to add foo to PATH" when needed.
+* container/list: fix Remove bug and use pointer to self as identifier.
+* doc: show page title in browser title bar,
+        update roadmap.
+* encoding/binary: give LittleEndian, BigEndian specific types.
+* go/parser: consume auto-inserted semi when calling ParseExpr().
+* gobuilder: pass GOHOSTOS and GOHOSTARCH to build,
+        write build and benchmarking logs to disk.
+* goinstall: display helpful message when encountering a cgo package,
+        fix test for multiple package names (thanks Fazlul Shahriar).
+* gotest: generate correct gofmt-formatted _testmain.go.
+* image/png: speed up paletted encoding ~25% (thanks Brad Fitzpatrick).
+* misc: update python scripts to specify python2 as python3 is now "python".
+* net: fix comment on Dial to mention unix/unixgram.
+* rpc: expose Server type to allow multiple RPC Server instances.
+* runtime: print unknown types in panic.
+* spec: append built-in (not yet implemented).
+* src: gofmt -s -w src misc.
+        update code to use copy-from-string.
+* test/bench: update numbers.
+* websocket: fix short Read.
+
+ +

2010-10-20

+ +
+This release removes the log package's deprecated functions.
+Code that has not been updated to use the new interface will break.
+See the previous release notes for details:
+	http://golang.org/doc/devel/release.html#2010-10-13
+
+Also included are major improvements to the linker. It is now faster, 
+uses less memory, and more parallelizable (but not yet parallel).
+
+The nntp package has been removed from the standard library.
+Its new home is the nntp-go project at Google Code:
+	http://code.google.com/p/nntp-go
+You can install it with goinstall:
+	goinstall nntp-go.googlecode.com/hg/nntp
+And import it in your code like so:
+	import "nntp-go.googlecode.com/hg/nntp"
+
+Other changes:
+* 6g: avoid too-large immediate constants.
+* 8l, runtime: initial support for Plan 9 (thanks Yuval Pavel Zholkover).
+* 6l, 8l: more improvements on exporting debug information (DWARF).
+* arm: code gen fixes. Most tests now pass, except for floating point code.
+* big: add random number generation (thanks Florian Uekermann).
+* gc: keep track of real actual type of identifiers,
+	report that shift must be unsigned integer,
+	select receive with implicit conversion.
+* goplay: fix to run under windows (thanks Yasuhiro Matsumoto).
+* http: do not close connection after sending HTTP/1.0 request.
+* netchan: add new method Hangup to terminate transmission on a channel.
+* os: change TestForkExec so it can run on windows (thanks Yasuhiro Matsumoto).
+* runtime: don't let select split stack.
+* syscall/arm: correct 64-bit system call arguments.
+
+ +

2010-10-13

+ +
+This release includes changes to the log package, the removal of exp/iterable,
+two new tools (gotry and goplay), one small language change, and many other
+changes and fixes.  If you use the log or iterable packages, you need to make
+changes to your code.
+
+The log package has changed.  Loggers now have only one output, and output to
+standard error by default.  The names have also changed, although the old names
+are still supported.  They will be deleted in the next release, though, so it
+would be good to update now if you can.  For most purposes all you need to do
+is make these substitutions:
+        log.Stderr -> log.Println or log.Print
+        log.Stderrf -> log.Printf
+        log.Crash -> log.Panicln or log.Panic
+        log.Crashf -> log.Panicf
+        log.Exit -> log.Exitln or log.Exit
+        log.Exitf -> log.Exitf (no change)
+Calls to log.New() must drop the second argument.
+Also, custom loggers with exit or panic properties will need to be reworked.
+For full details, see the change description:
+        http://code.google.com/p/go/source/detail?r=d8a3c7563d
+
+The language change is that uses of pointers to interface values no longer
+automatically dereference the pointer.  A pointer to an interface value is more
+often a beginner's bug than correct code.
+
+The package exp/iterable has been removed. It was an interesting experiment,
+but it encourages writing inefficient code and has outlived its utility.
+
+The new tools:
+* gotry: an exercise in reflection and an unusual tool. Run 'gotry' for details.
+* goplay: a stand-alone version of the Go Playground. See misc/goplay.
+
+Other changes:
+* 6l: Mach-O fixes, and fix to work with OS X nm/otool (thanks Jim McGrath).
+* [568]a: correct line numbers for statements.
+* arm: code generation and runtime fixes,
+	adjust recover for new reflect.call,
+	enable 6 more tests after net fix.
+* big: fix panic and round correctly in Rat.FloatString (thanks Anthony Martin).
+* build: Make.cmd: remove $(OFILES) (thanks Eric Clark),
+        Make.pkg: remove .so before installing new one,
+        add GOHOSTOS and GOHOSTARCH environment variables.
+* crypto/tls: better error messages for certificate issues,
+        make SetReadTimeout work.
+* doc: add Sydney University video,
+	add The Expressiveness of Go talk.
+* exp/draw/x11: support X11 vendors other than "The X.Org Foundation".
+* expvar: add (*Int).Set (thanks Sam Thorogood).
+* fmt: add Errorf helper function,
+        allow %d on []byte.
+* gc: O(1) string comparison when lengths differ,
+        various bug fixes.
+* http: return the correct error if a header line is too long.
+* image: add image.Tiled type, the Go equivalent of Plan 9's repl bit.
+* ld: be less picky about bad line number info.
+* misc/cgo/life: fix for new slice rules (thanks Graham Miller).
+* net: allow _ in DNS names.
+* netchan: export before import when testing, and
+        zero out request to ensure correct gob decoding. (thanks Roger Peppe).
+* os: make tests work on windows (thanks Alex Brainman).
+* runtime: bug fix: serialize mcache allocation,
+        correct iteration of large map values,
+        faster strequal, memequal (thanks Graham Miller),
+        fix argument dump in traceback,
+        fix tiny build.
+* smtp: new package (thanks Evan Shaw).
+* syscall: add sockaddr_ll support for linux/386, linux/amd64 (thanks Mikio Hara),
+        add ucred structure for SCM_CREDENTIALS over UNIX sockets. (thanks Albert Strasheim).
+* syscall: implement WaitStatus and Wait4() for windows (thanks Wei Guangjing).
+* time: add After.
+* websocket: enable tests on windows (thanks Alex Brainman).
+
+ +

2010-09-29

+ +
+This release includes some minor language changes and some significant package
+changes. You may need to change your code if you use ...T parameters or the
+http package.
+
+The semantics and syntax of forwarding ...T parameters have changed.
+        func message(f string, s ...interface{}) { fmt.Printf(f, s) }
+Here, s has type []interface{} and contains the parameters passed to message.
+Before this language change, the compiler recognized when a function call
+passed a ... parameter to another ... parameter of the same type, and just
+passed it as though it was a list of arguments.  But this meant that you
+couldn't control whether to pass the slice as a single argument and you
+couldn't pass a regular slice as a ... parameter, which can be handy.  This
+change gives you that control at the cost of a few characters in the call.
+If you want the promotion to ...,  append ... to the argument:
+        func message(f string, s ...interface{}) { fmt.Printf(f, s...) }
+Without the ..., s would be passed to Printf as a single argument of type
+[]interface{}.  The bad news is you might need to fix up some of your code, 
+but the compiler will detect the situation and warn you.
+
+Also, the http.Handler and http.HandlerFunc types have changed. Where http
+handler functions previously accepted an *http.Conn, they now take an interface
+type http.ResponseWriter. ResponseWriter implements the same methods as *Conn,
+so in most cases the only change required will be changing the type signature
+of your handler function's first parameter. See:
+  http://golang.org/pkg/http/#Handler
+
+The utf8 package has a new type, String, that provides efficient indexing 
+into utf8 strings by rune (previously an expensive conversion to []int 
+was required). See:
+  http://golang.org/pkg/utf8/#String
+
+The compiler will now automatically insert a semicolon at the end of a file if
+one is not found. This effect of this is that Go source files are no longer
+required to have a trailing newline.
+
+Other changes:
+* 6prof: more accurate usage message.
+* archive/zip: new package for reading Zip files.
+* arm: fix code generation, 10 more package tests pass.
+* asn1: make interface consistent with json.
+* bufio.UnreadRune: fix bug at EOF.
+* build: clear custom variables like GREP_OPTIONS,
+        silence warnings generated by ubuntu gcc,
+        use full path when compiling libraries.
+* bytes, strings: change lastIndexFunc to use DecodeLastRune (thanks Roger Peppe).
+* doc: add to and consolidate non-english doc references,
+        consolidate FAQs into a single file, go_faq.html,
+        updates for new http interface.
+* fmt/Printf: document and tweak error messages produced for bad formats.
+* gc: allow select case expr = <-c,
+        eliminate duplicates in method table,
+        fix reflect table method receiver,
+        improve error message for x \= 0.
+* go/scanner: treat EOF like a newline for purposes of semicolon insertion.
+* gofmt: stability improvements.
+* gotest: leave _testmain.go for "make clean" to clean up.
+* http: correct escaping of different parts of URL,
+        support HTTP/1.0 Keep-Alive.
+* json: do not write to unexported fields.
+* libcgo: don't build for NaCl,
+        set g, m in thread local storage for windows 386 (thanks Wei Guangjing).
+* math: Fix off-by-one error in Ilogb and Logb.  (thanks Charles L. Dorian).
+* misc/dashboard/builder: remove build files after benchmarking.
+* nacl: update instructions for new SDK.
+* net: enable v4-over-v6 on ip sockets,
+        fix crash in DialIP.
+* os: check for valid arguments in windows Readdir (thanks Peter Mundy).
+* runtime: add mmap of null page just in case,
+        correct stats in SysFree,
+        fix unwindstack crash.
+* syscall: add IPPROTO_IPV6 and IPV6_V6ONLY const to fix nacl and windows build,
+        add inotify on Linux (thanks Balazs Lecz),
+        fix socketpair in syscall_bsd,
+        fix windows value of IPV6_V6ONLY (thanks Alex Brainman),
+        implement windows version of Utimes (thanks Alex Brainman),
+        make mkall.sh work for nacl.
+* test: Add test that causes incorrect error from gccgo.
+* utf8: add DecodeLastRune and DecodeLastRuneInString (thanks Roger Peppe).
+* xml: Allow entities inside CDATA tags (thanks Dan Sinclair).
+
+ +

2010-09-22

+ +
+This release includes new package functionality, and many bug fixes and changes.
+It also improves support for the arm and nacl platforms.
+
+* 5l: avoid fixed buffers in list.
+* 6l, 8l: clean up ELF code, fix NaCl.
+* 6l/8l: emit DWARF frame info.
+* Make.inc: make GOOS detection work on windows (thanks Alex Brainman).
+* build: fixes for native arn build,
+        make all.bash run on Ubuntu ARM.
+* cgo: bug fixes,
+        show preamble gcc errors (thanks Eric Clark).
+* crypto/x509, crypto/tls: improve root matching and observe CA flag.
+* crypto: Fix certificate validation.
+* doc: variable-width layout.
+* env.bash: fix building in directory with spaces in the path (thanks Alex Brainman).
+* exp/4s, exp/nacl/av: sync to recent exp/draw changes.
+* exp/draw/x11: mouse location is a signed integer.
+* exp/nacl/av: update color to max out at 1<<16-1 instead of 1<<32-1.
+* fmt: support '*' for width or precision (thanks Anthony Martin).
+* gc: improvements to static initialization,
+        make sure path names are canonical.
+* gob: make robust when decoding a struct with non-struct data.
+* gobuilder: add -cmd for user-specified build command,
+        add -rev= flag to build specific revision and exit,
+        fix bug that caused old revisions to be rebuilt.
+* godoc: change default filter file name to "",
+        don't use quadratic algorithm to filter paths,
+        show "Last update" info for directory listings.
+* http: new redirect test,
+        URLEscape now escapes all reserved characters as per the RFC.
+* nacl: fix zero-length writes.
+* net/dict: parse response correctly (thanks Fazlul Shahriar).
+* netchan: add a cross-connect test,
+        handle closing of channels,
+        provide a method (Importer.Errors()) to recover protocol errors.
+* os: make Open() O_APPEND flag work on windows (thanks Alex Brainman),
+        make RemoveAll() work on windows (thanks Alex Brainman).
+* pkg/Makefile: disable netchan test to fix windows build (thanks Alex Brainman).
+* regexp: delete Iter methods.
+* runtime: better panic for send to nil channel.
+* strings: fix minor bug in LastIndexFunc (thanks Roger Peppe).
+* suffixarray: a package for creating suffixarray-based indexes.
+* syscall: Use vsyscall for syscall.Gettimeofday and .Time on linux amd64.
+* test: fix NaCl build.
+* windows: fix netchan test by using 127.0.0.1.
+
+ +

2010-09-15

+ +
+This release includes a language change: the lower bound of a subslice may
+now be omitted, in which case the value will default to 0.
+For example, s[0:10] may now be written as s[:10], and s[0:] as s[:].
+
+The release also includes important bug fixes for the ARM architecture,
+as well as the following fixes and changes:
+
+* 5g: register allocation bugs
+* 6c, 8c: show line numbers in -S output
+* 6g, 6l, 8g, 8l: move read-only data to text segment
+* 6l, 8l: make etext accurate; introduce rodata, erodata.
+* arm: fix build bugs.
+        make libcgo build during OS X cross-compile
+        remove reference to deleted file syntax/slice.go
+        use the correct stat syscalls
+        work around reg allocator bug in 5g
+* bufio: add UnreadRune.
+* build: avoid bad environment interactions
+        fix build for tiny
+        generate, clean .exe files on Windows (thanks Joe Poirier)
+        test for _WIN32, not _MINGW32 (thanks Joe Poirier)
+        work with GNU Make 3.82 (thanks Jukka-Pekka Kekkonen)
+* cgo: add typedef for uintptr in generated headers
+        silence warning for C call returning const pointer
+* codereview: convert email address to lower case before checking CONTRIBUTORS
+* crypto/tls: don't return an error from Close()
+* doc/tutorial: update for slice changes.
+* exec: separate LookPath implementations for unix/windows (thanks Joe Poirier)
+* exp/draw/x11: allow clean shutdown when the user closes the window.
+* exp/draw: clip destination rectangle to the image bounds.
+        fast path for drawing overlapping image.RGBAs.
+        fix double-counting of pt.Min for the src and mask points.
+        reintroduce the MouseEvent.Nsec timestamp.
+        rename Context to Window, and add a Close method.
+* exp/debug: preliminary support for 'copy' function (thanks Sebastien Binet)
+* fmt.Fscan: use UnreadRune to preserve data across calls.
+* gc: better printing of named constants, func literals in errors
+        many bug fixes
+        fix line number printing with //line directives
+        fix symbol table generation on windows (thanks Alex Brainman)
+        implement comparison rule from spec change 33abb649cb63
+        implement new slice spec (thanks Scott Lawrence)
+        make string x + y + z + ... + w efficient
+        more accurate line numbers for ATEXT
+        remove &[10]int -> []int conversion
+* go-mode.el: fix highlighting for 'chan' type (thanks Scott Lawrence)
+* godoc: better support for directory trees for user-supplied paths
+        use correct delay time (bug fix)
+* gofmt, go/printer: update internal estimated position correctly
+* goinstall: warn when package name starts with http:// (thanks Scott Lawrence)
+* http: check https certificate against host name
+        do not cache CanonicalHeaderKey (thanks Jukka-Pekka Kekkonen)
+* image: change a ColorImage's minimum point from (0, 0) to (-1e9, -1e9).
+        introduce Intersect and Union rectangle methods.
+* ld: handle quoted spaces in package path (thanks Dan Sinclair)
+* libcgo: fix NaCl build.
+* libmach: fix build on arm host
+        fix new thread race with Linux
+* math: make portable Tan(Pi/2) return NaN
+* misc/dashboard/builder: gobuilder, a continuous build client
+* net: disable tests for functions not available on windows (thanks Alex Brainman)
+* netchan: make -1 unlimited, as advertised.
+* os, exec: rename argv0 to name
+* path: add IsAbs (thanks Ivan Krasin)
+* runtime: fix bug in tracebacks
+        fix crash trace on amd64
+        fix windows build (thanks Alex Brainman)
+        use manual stack for garbage collection
+* spec: add examples for slices with omitted index expressions.
+        allow omission of low slice bound (thanks Scott Lawrence)
+* syscall: fix windows Gettimeofday (thanks Alex Brainman)
+* test(arm): disable zerodivide.go because compilation fails.
+* test(windows): disable tests that cause the build to fail (thanks Joe Poirier)
+* test/garbage/parser: sync with recent parser changes
+* test: Add test for //line
+        Make gccgo believe that the variables can change.
+        Recognize gccgo error messages.
+        Reduce race conditions in chan/nonblock.go.
+        Run garbage collector before testing malloc numbers.
+* websocket: Add support for secure WebSockets (thanks Jukka-Pekka Kekkonen)
+* windows: disable unimplemented tests (thanks Joe Poirier)
+
+ +

2010-09-06

+ +
+This release includes the syntactic modernization of more than 100 files in /test,
+and these additions, changes, and fixes: 
+* 6l/8l: emit DWARF in macho.
+* 8g: use FCHS, not FMUL, for minus float.
+* 8l: emit DWARF in ELF,
+        suppress emitting DWARF in Windows PE (thanks Alex Brainman).
+* big: added RatString, some simplifications.
+* build: create bin and pkg directories as needed; drop from hg,
+        delete Make.386 Make.amd64 Make.arm (obsoleted by Make.inc),
+        fix cgo with -j2,
+        let pkg/Makefile coordinate building of Go commands,
+        never use quietgcc in Make.pkg,
+        remove more references to GOBIN and GOROOT (thanks Christian Himpel).
+* codereview: Fix uploading for Mercurial 1.6.3 (thanks Evan Shaw),
+        consistent indent, cut dead code,
+        fix hang on standard hg commands,
+        print status when tasks take longer than 30 seconds,
+        really disable codereview when not available,
+        upload files in parallel (5x improvement on large CLs).
+* crypto/hmac: make Sum idempotent (thanks Jukka-Pekka Kekkonen).
+* doc: add links to more German docs,
+        add round-robin flag to io2010 balance example,
+        fix a bug in the example in Constants subsection (thanks James Fysh),
+        various changes for validating HTML (thanks Scott Lawrence).
+* fmt: delete erroneous sentence about return value for Sprint*.
+* gc: appease bison version running on FreeBSD builder,
+        fix spurious syntax error.
+* go/doc: use correct escaper for URL.
+* go/printer: align ImportPaths in ImportDecls (thanks Scott Lawrence).
+* go/typechecker: 2nd step towards augmenting AST with full type information.
+* gofmt: permit omission of first index in slice expression.
+* goinstall: added -a flag to mean "all remote packages" (thanks Scott Lawrence),
+        assume go binaries are in path (following new convention),
+        use https for Google Code checkouts.
+* gotest: allow make test of cgo packages (without make install).
+* http: add Date to server, Last-Modified and If-Modified-Since to file server,
+        add PostForm function to post url-encoded key/value data,
+        obscure passwords in return value of URL.String (thanks Scott Lawrence).
+* image: introduce Config type and DecodeConfig function.
+* libcgo: update Makefile to use Make.inc.
+* list: update comment to state that the zero value is ready to use.
+* math: amd64 version of Sincos (thanks Charles L. Dorian).
+* misc/bash: add *.go completion for gofmt (thanks Scott Lawrence).
+* misc/emacs: make _ a word symbol (thanks Scott Lawrence).
+* misc: add zsh completion (using compctl),
+        syntax highlighting for Fraise.app (OS X) (thanks Vincent Ambo).
+* net/textproto: Handle multi-line responses (thanks Evan Shaw).
+* net: add LookupMX (thanks Corey Thomasson).
+* netchan: Fix race condition in test,
+        rather than 0, make -1 mean infinite (a la strings.Split et al),
+        use acknowledgements on export send.
+        new methods Sync and Drain for clean teardown.
+* regexp: interpret all Go characer escapes \a \b \f \n \r \t \v.
+* rpc: fix bug that caused private methods to attempt to be registered.
+* runtime: Correct commonType.kind values to match compiler,
+        add GOOS, GOARCH; fix FuncLine,
+        special case copy, equal for one-word interface values (thanks Kyle Consalus).
+* scanner: fix incorrect reporting of error in Next (thanks Kyle Consalus).
+* spec: clarify that arrays must be addressable to be sliceable.
+* template: fix space handling around actions.
+* test/solitaire: an exercise in backtracking and string conversions.
+* test: Recognize gccgo error messages and other fixes.
+* time: do not crash in String on nil Time.
+* tutorial: regenerate HTML to pick up change to progs/file.go.
+* websocket: fix missing Sec-WebSocket-Protocol on server response (thanks Jukka-Pekka Kekkonen).
+
+ +

2010-08-25

+ +
+This release includes changes to the build system that will likely require you
+to make changes to your environment variables and Makefiles.
+
+All environment variables are now optional:
+ - $GOOS and $GOARCH are now optional; their values should now be inferred 
+   automatically by the build system,
+ - $GOROOT is now optional, but if you choose not to set it you must run
+   'gomake' instead of 'make' or 'gmake' when developing Go programs
+   using the conventional Makefiles,
+ - $GOBIN remains optional and now defaults to $GOROOT/bin;
+   if you wish to use this new default, make sure it is in your $PATH
+   and that you have removed the existing binaries from $HOME/bin.
+
+As a result of these changes, the Go Makefiles have changed. If your Makefiles
+inherit from the Go Makefiles, you must change this line:
+    include ../../Make.$(GOARCH)
+to this:
+    include ../../Make.inc
+
+This release also removes the deprecated functions in regexp and the 
+once package. Any code that still uses them will break.
+See the notes from the last release for details:
+    http://golang.org/doc/devel/release.html#2010-08-11
+
+Other changes:
+* 6g: better registerization for slices, strings, interface values
+* 6l: line number information in DWARF format
+* build: $GOBIN defaults to $GOROOT/bin,
+        no required environment variables
+* cgo: add C.GoStringN (thanks Eric Clark).
+* codereview: fix issues with leading tabs in CL descriptions,
+        do not send "Abandoned" mail if the CL has not been mailed.
+* crypto/ocsp: add missing Makefile.
+* crypto/tls: client certificate support (thanks Mikkel Krautz).
+* doc: update gccgo information for recent changes.
+        fix errors in Effective Go.
+* fmt/print: give %p priority, analogous to %T,
+        honor Formatter in Print, Println.
+* gc: fix parenthesization check.
+* go/ast: facility for printing AST nodes,
+        first step towards augmenting AST with full type information.
+* go/printer: do not modify tabwriter.Escape'd text.
+* gofmt: do not modify multi-line string literals,
+        print AST nodes by setting -ast flag.
+* http: fix typo in http.Request documentation (thanks Scott Lawrence)
+        parse query string always, not just in GET
+* image/png: support 16-bit color.
+* io: ReadAtLeast now errors if min > len(buf).
+* jsonrpc: use `error: null` for success, not `error: ""`.
+* libmach: implement register fetch for 32-bit x86 kernel.
+* net: make IPv6 String method standards-compliant (thanks Mikio Hara).
+* os: FileInfo.Permission() now returns uint32 (thanks Scott Lawrence),
+        implement env using native Windows API (thanks Alex Brainman).
+* reflect: allow PtrValue.PointTo(nil).
+* runtime: correct line numbers for .goc files,
+        fix another stack split bug,
+        fix freebsd/386 mmap.
+* syscall: regenerate syscall/z* files for linux/386, linux/amd64, linux/arm.
+* tabwriter: Introduce a new flag StripEscape.
+* template: fix handling of space around actions,
+        vars preceded by white space parse correctly (thanks Roger Peppe).
+* test: add test case that crashes gccgo.
+* time: parse no longer requires minutes for time zone (thanks Jan H. Hosang)
+* yacc: fix bounds check in error recovery.
+
+ +

2010-08-11

+ +
+This release introduces some package changes. You may need to change your
+code if you use the once, regexp, image, or exp/draw packages.
+
+The type Once has been added to the sync package. The new sync.Once will
+supersede the functionality provided by the once package. We intend to remove
+the once package after this release. See:
+    http://golang.org/pkg/sync/#Once
+All instances of once in the standard library have been replaced with
+sync.Once. Reviewing these changes may help you modify your existing code. 
+The relevant changeset:
+    http://code.google.com/p/go/source/detail?r=fa2c43595119
+
+A new set of methods has been added to the regular expression package, regexp.
+These provide a uniformly named approach to discovering the matches of an
+expression within a piece of text; see the package documentation for details: 
+    http://golang.org/pkg/regexp/
+These new methods will, in a later release, replace the old methods for
+matching substrings.  The following methods are deprecated:
+    Execute (use FindSubmatchIndex)
+    ExecuteString (use FindStringSubmatchIndex)
+    MatchStrings(use FindStringSubmatch)
+    MatchSlices (use FindSubmatch)
+    AllMatches (use FindAll; note that n<0 means 'all matches'; was n<=0)
+    AllMatchesString (use FindAllString; note that n<0 means 'all matches'; was n<=0)
+(Plus there are ten new methods you didn't know you wanted.) 
+Please update your code to use the new routines before the next release.
+
+An image.Image now has a Bounds rectangle, where previously it ranged 
+from (0, 0) to (Width, Height). Loops that previously looked like:
+    for y := 0; y < img.Height(); y++ {
+        for x := 0; x < img.Width(); x++ {
+            // Do something with img.At(x, y)
+        }
+    }
+should instead be:
+    b := img.Bounds()
+    for y := b.Min.Y; y < b.Max.Y; y++ {
+        for x := b.Min.X; x < b.Max.X; x++ {
+            // Do something with img.At(x, y)
+        }
+    }
+The Point and Rectangle types have also moved from exp/draw to image.
+
+Other changes:
+* arm: bugfixes and syscall (thanks Kai Backman).
+* asn1: fix incorrect encoding of signed integers (thanks Nicholas Waples).
+* big: fixes to bitwise functions (thanks Evan Shaw).
+* bytes: add IndexRune, FieldsFunc and To*Special (thanks Christian Himpel).
+* encoding/binary: add complex (thanks Roger Peppe).
+* exp/iterable: add UintArray (thanks Anschel Schaffer-Cohen).
+* godoc: report Status 404 if a pkg or file is not found.
+* gofmt: better reporting for unexpected semicolon errors.
+* html: new package, an HTML tokenizer.
+* image: change image representation from slice-of-slices to linear buffer,
+        introduce Decode and RegisterFormat,
+        introduce Transparent and Opaque,
+        replace Width and Height by Bounds, add the Point and Rect types.
+* libbio: fix Bprint to address 6g issues with large data structures.
+* math: fix amd64 Hypot (thanks Charles L. Dorian).
+* net/textproto: new package, with example net/dict.
+* os: fix ForkExec() handling of envv == nil (thanks Alex Brainman).
+* png: grayscale support (thanks Mathieu Lonjaret).
+* regexp: document that backslashes are the escape character.
+* rpc: catch errors from ReadResponseBody.
+* runtime: memory free fix (thanks Alex Brainman).
+* template: add ParseFile method to template.Template.
+* test/peano: use directly recursive type def.
+
+ +

2010-08-04

+ +
+This release includes a change to os.Open (and co.). The file permission
+argument has been changed to a uint32. Your code may require changes - a simple
+conversion operation at most.
+
+Other changes:
+* amd64: use segment memory for thread-local storage.
+* arm: add gdb support to android launcher script,
+        bugfixes (stack clobbering, indices),
+        disable another flaky test,
+        remove old qemu dependency from gotest.
+* bufio: introduce Peek.
+* bytes: added test case for explode with blank string (thanks Scott Lawrence).
+* cgo: correct multiple return value function invocations (thanks Christian Himpel).
+* crypto/x509: unwrap Subject Key Identifier (thanks Adam Langley).
+* gc: index bounds tests and other fixes.
+* gofmt/go/parser: strengthen syntax checks.
+* goinstall: check for error from exec.*Cmd.Wait() (thanks Alex Brainman).
+* image/png: use image-specific methods for checking opacity.
+* image: introduce Gray and Gray16 types,
+        remove the named colors except for Black and White.
+* json: object members must have a value (thanks Anthony Martin).
+* misc/vim: highlight misspelled words only in comments (thanks Christian Himpel).
+* os: Null device (thanks Peter Mundy).
+* runtime: do not fall through in SIGBUS/SIGSEGV.
+* strings: fix Split("", "", -1) (thanks Scott Lawrence).
+* syscall: make go errors not clash with windows errors (thanks Alex Brainman).
+* test/run: diff old new,
+* websocket: correct challenge response (thanks Tarmigan Casebolt),
+        fix bug involving spaces in header keys (thanks Bill Neubauer). 
+
+ +

2010-07-29

+ +
+* 5g: more soft float support and several bugfixes.
+* asn1: Enumerated, Flag and GeneralizedTime support.
+* build: clean.bash to check that GOOS and GOARCH are set.
+* bytes: add IndexFunc and LastIndexFunc (thanks Fazlul Shahriar),
+	add Title.
+* cgo: If CC is set in environment, use it rather than "gcc",
+	use new command line syntax: -- separates cgo flags from gcc flags.
+* codereview: avoid crash if no config,
+	don't run gofmt with an empty file list,
+	make 'hg submit' work with Mercurial 1.6.
+* crypto/ocsp: add package to parse OCSP responses.
+* crypto/tls: add client-side SNI support and PeerCertificates.
+* exp/bignum: delete package - functionality subsumed by package big.
+* fmt.Print: fix bug in placement of spaces introduced when ...T went in.
+* fmt.Scanf: handle trailing spaces.
+* gc: fix smaller-than-pointer-sized receivers in interfaces,
+	floating point precision/normalization fixes,
+	graceful exit on seg fault,
+	import dot shadowing bug,
+	many fixes including better handling of invalid input,
+	print error detail about failure to open import.
+* gccgo_install.html: add description of the port to RTEMS (thanks Vinu Rajashekhar).
+* gobs: fix bug in singleton arrays.
+* godoc: display synopses for all packages that have some kind of documentation..
+* gofmt: fix some linebreak issues.
+* http: add https client support (thanks Fazlul Shahriar),
+	write body when content length unknown (thanks James Whitehead).
+* io: MultiReader and MultiWriter (thanks Brad Fitzpatrick),
+	fix another race condition in Pipes.
+* ld: many fixes including better handling of invalid input.
+* libmach: correct handling of .5 files with D_REGREG addresses.
+* linux/386: use Xen-friendly ELF TLS instruction sequence.
+* mime: add AddExtensionType (thanks Yuusei Kuwana).
+* misc/vim: syntax file recognizes constants like 1e9 (thanks Petar Maymounkov).
+* net: TCPConn.SetNoDelay, back by popular demand.
+* net(windows): fix crashing Read/Write when passed empty slice on (thanks Alex Brainman),
+	implement LookupHost/Port/SRV (thanks Wei Guangjing),
+	properly handle EOF in (*netFD).Read() (thanks Alex Brainman).
+* runtime: fix bug introduced in revision 4a01b8d28570 (thanks Alex Brainman),
+	rename cgo2c, *.cgo to goc2c, *.goc (thanks Peter Mundy).
+* scanner: better comment.
+* strings: add Title.
+* syscall: add ForkExec, Syscall12 on Windows (thanks Daniel Theophanes),
+	improve windows errno handling (thanks Alex Brainman).
+* syscall(windows): fix FormatMessage (thanks Peter Mundy),
+	implement Pipe() (thanks Wei Guangjing).
+* time: fix parsing of minutes in time zones.
+* utf16(windows): fix cyclic dependency when testing (thanks Peter Mundy).
+
+ +

2010-07-14

+ +
+This release includes a package change. In container/vector, the Iter method
+has been removed from the Vector, IntVector, and StringVector types. Also, the
+Data method has been renamed to Copy to better express its actual behavior.
+Now that Vector is just a slice, any for loops ranging over v.Iter() or
+v.Data() can be changed to range over v instead.
+
+Other changes:
+* big: Improvements to Rat.SetString (thanks Evan Shaw),
+        add sign, abs, Rat.IsInt.
+* cgo: various bug fixes.
+* codereview: Fix for Mercurial >= 1.6 (thanks Evan Shaw).
+* crypto/rand: add Windows implementation (thanks Peter Mundy).
+* crypto/tls: make HTTPS servers easier,
+        add client OCSP stapling support.
+* exp/eval: converted from bignum to big (thanks Evan Shaw).
+* gc: implement new len spec, range bug fix, optimization.
+* go/parser: require that '...' parameters are followed by a type.
+* http: fix ParseURL to handle //relative_path properly.
+* io: fix SectionReader Seek to seek backwards (thanks Peter Mundy).
+* json: Add HTMLEscape (thanks Micah Stetson).
+* ld: bug fixes.
+* math: amd64 version of log (thanks Charles L. Dorian).
+* mime/multipart: new package to parse multipart MIME messages
+        and HTTP multipart/form-data support.
+* os: use TempFile with default TempDir for test files (thanks Peter Mundy).
+* runtime/tiny: add docs for additional VMs, fix build (thanks Markus Duft).
+* runtime: better error for send/recv on nil channel.
+* spec: clarification of channel close(),
+        lock down some details about channels and select,
+        restrict when len(x) is constant,
+        specify len/cap for nil slices, maps, and channels.
+* windows: append .exe to binary names (thanks Joe Poirier).
+
+ +

2010-07-01

+ +
+This release includes some package changes that may require changes to 
+client code.
+
+The Split function in the bytes and strings packages has been changed.
+The count argument, which limits the size of the return, previously treated
+zero as unbounded. It now treats 0 as 0, and will return an empty slice.  
+To request unbounded results, use -1 (or some other negative value).
+The new Replace functions in bytes and strings share this behavior.
+This may require you change your existing code.
+
+The gob package now allows the transmission of non-struct values at the
+top-level. As a result, the rpc and netchan packages have fewer restrictions
+on the types they can handle.  For example, netchan can now share a chan int.
+
+The release also includes a Code Walk: "Share Memory By Communicating".
+It describes an idiomatic Go program that uses goroutines and channels:
+	http://golang.org/doc/codewalk/sharemem/
+
+There is now a Projects page on the Go Dashboard that lists Go programs, 
+tools, and libraries:
+	http://godashboard.appspot.com/project
+
+Other changes:
+* 6a, 6l: bug fixes.
+* bytes, strings: add Replace.
+* cgo: use slash-free relative paths for .so references.
+* cmath: correct IsNaN for argument cmplx(Inf, NaN) (thanks Charles L. Dorian).
+* codereview: allow multiple email addresses in CONTRIBUTORS.
+* doc/codewalk: add Share Memory By Communicating.
+* exp/draw/x11: implement the mapping from keycodes to keysyms.
+* fmt: Printf: fix bug in handling of %#v, allow other verbs for slices
+        Scan: fix handling of EOFs.
+* gc: bug fixes and optimizations.
+* gob: add DecodeValue and EncodeValue,
+        add support for complex numbers.
+* goinstall: support for Bazaar+Launchpad (thanks Gustavo Niemeyer).
+* io/ioutil: add TempFile for Windows (thanks Peter Mundy).
+* ld: add -u flag to check safe bits; discard old -u, -x flags.
+* math: amd64 versions of Exp and Fabs (thanks Charles L. Dorian).
+* misc/vim: always override filetype detection for .go files.
+* net: add support for DNS SRV requests (thanks Kirklin McDonald),
+        initial attempt to implement Windows version (thanks Alex Brainman).
+* netchan: allow chan of basic types now that gob can handle such,
+        eliminate the need for a pointer value in Import and Export.
+* os/signal: only catch all signals if os/signal package imported.
+* regexp: bug fix: need to track whether match begins with fixed prefix.
+* rpc: allow non-struct args and reply (they must still be pointers).
+* runtime: bug fixes and reorganization.
+* strconv: fix bugs in floating-point and base 2 conversions
+* syscall: add syscall_bsd.go to zsycall_freebsd_386.go (thanks Peter Mundy),
+        add socketpair (thanks Ivan Krasin).
+* time: implement time zones for Windows (thanks Alex Brainman).
+* x509: support non-self-signed certs. 
+
+ +

2010-06-21

+ +
+This release includes a language change. The "..." function parameter form is
+gone; "...T" remains. Typically, "...interface{}" can be used instead of "...".
+
+The implementation of Printf has changed in a way that subtly affects its
+handling of the fmt.Stringer interface. You may need to make changes to your
+code. For details, see:
+        https://groups.google.com/group/golang-nuts/msg/6fffba90a3e3dc06
+
+The reflect package has been changed. If you have code that uses reflect, 
+it will need to be updated. For details, see:
+        https://groups.google.com/group/golang-nuts/msg/7a93d07c590e7beb
+
+Other changes:
+* 8l: correct test for sp == top of stack in 8l -K code.
+* asn1: allow '*' in PrintableString.
+* bytes.Buffer.ReadFrom: fix bug.
+* codereview: avoid exception in match (thanks Paolo Giarrusso).
+* complex divide: match C99 implementation.
+* exp/draw: small draw.drawGlyphOver optimization.
+* fmt: Print*: reimplement to switch on type first,
+        Scanf: improve error message when input does not match format.
+* gc: better error messages for interface failures, conversions, undefined symbols.
+* go/scanner: report illegal escape sequences.
+* gob: substitute slice for map.
+* goinstall: process dependencies for package main (thanks Roger Peppe).
+* gopack: add S flag to force marking a package as safe,
+        simplify go metadata code.
+* html: sync testdata/webkit to match WebKit tip.
+* http: reply to Expect 100-continue requests automatically (thanks Brad Fitzpatrick).
+* image: add an Alpha16 type.
+* ld: pad Go symbol table out to page boundary (fixes cgo crash).
+* misc/vim: reorganize plugin to be easier to use (thanks James Whitehead).
+* path: add Base, analogous to Unix basename.
+* pkg/Makefile: allow DISABLE_NET_TESTS=1 to disable network tests.
+* reflect: add Kind, Type.Bits, remove Int8Type, Int8Value, etc.
+* runtime: additional Windows support (thanks Alex Brainman),
+        correct fault for 16-bit divide on Leopard,
+        fix 386 signal handler bug.
+* strconv: add AtofN, FtoaN.
+* string: add IndexFunc and LastIndexFunc (thanks Roger Peppe).
+* syslog: use local network for tests. 
+
+ +

2010-06-09

+ +
+This release contains many fixes and improvements, including several
+clarifications and consolidations to the Language Specification.
+
+The type checking rules around assignments and conversions are simpler but more
+restrictive: assignments no longer convert implicitly from *[10]int to []int
+(write x[0:] instead of &x), and conversions can no longer change the names of
+types inside composite types.
+
+The fmt package now includes flexible type-driven (fmt.Scan) and 
+format-driven (fmt.Scanf) scanners for all basic types.
+
+* big: bug fix for Quo aliasing problem.
+* bufio: change ReadSlice to match description.
+* cgo: bug fixes.
+* doc: add Google I/O talk and programs,
+        codereview + Mercurial Queues info (thanks Peter Williams).
+* exp/draw: Draw fast paths for the Over operator,
+        add Rectangle.Eq and Point.In, fix Rectangle.Clip (thanks Roger Peppe).
+* fmt: Scan fixes and improvements.
+* gc: backslash newline is not a legal escape sequence in strings,
+        better error message when ~ operator is found,
+        fix export of complex types,
+        new typechecking rules.
+* go/parser: correct position of empty statement ';'.
+* gofmt: fix test script.
+* goinstall: use 'git pull' instead of 'git checkout' (thanks Michael Hoisie).
+* http: add Head function for making HTTP HEAD requests,
+        handle status 304 correctly.
+* image: add Opaque method to the image types.
+        make Color.RGBA return 16 bit color instead of 32 bit color.
+* io/ioutil: add TempFile.
+* math: Pow special cases and additional tests (thanks Charles L. Dorian).
+* netchan: improve closing and shutdown.
+* os: implement os.FileInfo.*time_ns for windows (thanks Alex Brainman).
+* os/signal: correct the regexp for finding Unix signal names (thanks Vinu Rajashekhar).
+* regexp: optimizations (thanks Kyle Consalus).
+* runtime: fix printing -Inf (thanks Evan Shaw),
+        finish pchw -> tiny, added gettime for tiny (thanks Daniel Theophanes).
+* spec: clean-ups and consolidation.
+* syscall: additional Windows compatibility fixes (thanks Alex Brainman).
+* test/bench: added regex-dna-parallel.go (thanks Kyle Consalus).
+* vector: type-specific Do functions now take f(type) (thanks Michael Hoisie). 
+
+ +

2010-05-27

+ +
+A sizeable release, including standard library improvements and a slew of
+compiler bug fixes. The three-week interval was largely caused by the team
+preparing for Google I/O. 
+
+* big: add Rat type (thanks Evan Shaw),
+        new features, much performance tuning, cleanups, and more tests.
+* bignum: deprecate by moving into exp directory.
+* build: allow MAKEFLAGS to be set outside the build scripts (thanks Christopher Wedgwood).
+* bytes: add Trim, TrimLeft, TrimRight, and generic functions (thanks Michael Hoisie).
+* cgo: fix to permit cgo callbacks from init code.
+* cmath: update range of Phase and Polar due to signed zero (thanks Charles L. Dorian).
+* codereview: work better with mq (thanks Peter Williams).
+* compress: renamings
+	NewDeflater -> NewWriter
+	NewInflater -> NewReader
+	Deflater -> Compressor
+	Inflater -> Decompressor
+* exp/draw/x11: respect $XAUTHORITY,
+        treat $DISPLAY the same way x-go-bindings does.
+* exp/draw: fast path for glyph images, other optimizations,
+        fix Rectangle.Canon (thanks Roger Peppe).
+* fmt: Scan, Scanln: Start of a simple scanning API in the fmt package,
+        fix Printf crash when given an extra nil argument (thanks Roger Peppe).
+* gc: better error when computing remainder of non-int (thanks Evan Shaw),
+        disallow middot in Go programs,
+        distinguish array, slice literal in error messages,
+        fix shift/reduce conflict in go.y export syntax,
+        fix unsafe.Sizeof on ideal constants,
+        handle use of builtin function outside function call,
+        many other bug fixes.
+* gob: add support for maps,
+        add test for indirect maps, slices, arrays.
+* godoc: collect package comments from all package files.
+* gofmt: don't lose mandatory semicolons,
+        exclude test w/ illegal syntax from test cases,
+        fix printing of labels.
+* http: prevent crash if remote server is not responding with "HTTP/".
+* json: accept escaped slash in string scanner (thanks Michael Hoisie),
+        fix array -> non-array decoding.
+* libmach: skip __nl_symbol_ptr section on OS X.
+* math: amd64 versions of Fdim, Fmax, Fmin,
+        signed zero Sqrt special case (thanks Charles L. Dorian).
+* misc/kate: convert isn't a built in function (thanks Evan Shaw).
+* net: implement BindToDevice,
+        implement raw sockets (thanks Christopher Wedgwood).
+* netFD: fix race between Close and Read/Write (thanks Michael Hoisie).
+* os: add Chtimes function (thanks Brad Fitzpatrick).
+* pkg/Makefile: add netchan to standard package list.
+* runtime: GOMAXPROCS returns previous value,
+        allow large map values,
+        avoid allocation for fixed strings,
+        correct tracebacks for nascent goroutines, even closures,
+        free old hashmap pieces during resizing.
+* spec: added imaginary literal to semicolon rules (was missing),
+        fix and clarify syntax of conversions,
+        simplify section on channel types,
+        other minor tweaks.
+* strconv: Btoui64 optimizations (thanks Kyle Consalus).
+* strings: use copy instead of for loop in Map (thanks Kyle Consalus).
+* syscall: implement BindToDevice (thanks Christopher Wedgwood),
+        add Utimes on Darwin/FreeBSD, add Futimes everywhere,
+        regenerate syscalls for some platforms.
+* template: regularize name lookups of interfaces, pointers, and methods.
+
+ +

2010-05-04

+ +
+In this release we renamed the Windows OS target from 'mingw' to 'windows'.
+If you are currently building for 'mingw' you should set GOOS=windows instead.
+
+* 5l, 6l, 8l, runtime: make -s binaries work.
+* 5l, 6l, 8l: change ELF header so that strip doesn't destroy binary.
+* 8l: fix absolute path detection on Windows.
+* big: new functions, optimizations, and cleanups,
+	add bitwise methods for Int (thanks Evan Shaw).
+* bytes: Change IndexAny to look for UTF-8 encoded characters.
+* darwin: bsdthread_create can fail; print good error.
+* fmt: %T missing print <nil> for nil (thanks Christopher Wedgwood).
+* gc: many fixes.
+* misc/cgo/gmp: fix bug in SetString.
+* net: fix resolv.conf EOF without newline bug (thanks Christopher Wedgwood).
+* spec: some small clarifications (no language changes).
+* syscall: add EWOULDBLOCK to sycall_nacl.go,
+	force O_LARGEFILE in Linux open system call,
+	handle EOF on pipe - special case on Windows (thanks Alex Brainman),
+	mingw Sleep (thanks Joe Poirier).
+* test/bench: import new fasta C reference, update Go, optimizations.
+* test: test of static initialization (fails).
+* vector: use correct capacity in call to make.
+* xml: allow text segments to end at EOF.
+
+ +

2010-04-27

+ +
+This release includes a new Codelab that illustrates the construction of a
+simple wiki web application: 
+	http://golang.org/doc/codelab/wiki/
+
+It also includes a Codewalk framework for documenting code. See:
+	http://golang.org/doc/codewalk/
+
+Other changes:
+* 6g: fix need for parens around array index expression.
+* 6l, 8l: include ELF header in PT_LOAD mapping for text segment.
+* arm: add android runner script,
+	support for printing floats.
+* big: implemented Karatsuba multiplication,
+	many fixes and improvements (thanks Evan Shaw).
+* bytes: add Next method to Buffer, simplify Read,
+	shuffle implementation, making WriteByte 50% faster.
+* crypto/tls: simpler implementation of record layer.
+* exp/eval: fixes (thanks Evan Shaw).
+* flag: eliminate unnecessary structs.
+* gc: better windows support,
+	cmplx typecheck bug fix,
+	more specific error for statements at top level.
+* go/parser: don't require unnecessary parens.
+* godoc: exclude duplicate entries (thanks Andrei Vieru),
+	use int64 for timestamps (thanks Christopher Wedgwood).
+* gofmt: fine-tune stripping of parentheses,
+* json: Marshal, Unmarshal using new scanner,
+	preserve field name case by default,
+	scanner, Compact, Indent, and tests,
+	support for streaming.
+* libmach: disassemble MOVLQZX correctly.
+* math: more special cases for signed zero (thanks Charles L. Dorian).
+* net: add Pipe,
+	fix bugs in packStructValue (thanks Michael Hoisie),
+	introduce net.Error interface.
+* os: FileInfo: regularize the types of some fields,
+	create sys_bsd.go (thanks Giles Lean),
+	mingw bug fixes (thanks Alex Brainman).
+* reflect: add FieldByNameFunc (thanks Raif S. Naffah),
+	implement Set(nil), SetValue(nil) for PtrValue and MapValue.
+* regexp: allow escaping of any punctuation.
+* rpc/jsonrpc: support for jsonrpc wire encoding.
+* rpc: abstract client and server encodings,
+	add Close() method to rpc.Client.
+* runtime: closures, defer bug fix for Native Client,
+	rename cgo2c, *.cgo to goc2c, *.goc to avoid confusion with real cgo.
+	several other fixes.
+* scanner: implement Peek() to look at the next char w/o advancing.
+* strings: add ReadRune to Reader, add FieldsFunc (thanks Kyle Consalus).
+* syscall: match linux Setsid function signature to darwin,
+	mingw bug fixes (thanks Alex Brainman).
+* template: fix handling of pointer inside interface.
+* test/bench: add fannkuch-parallel.go (thanks Kyle Consalus),
+	pidigits ~10% performance win by using adds instead of shifts.
+* time: remove incorrect time.ISO8601 and add time.RFC3339 (thanks Micah Stetson).
+* utf16: add DecodeRune, EncodeRune.
+* xml: add support for XML marshalling embedded structs (thanks Raif S. Naffah),
+	new "innerxml" tag to collect inner XML.
+
+ +

2010-04-13

+ +
+This release contains many changes:
+
+* 8l: add DOS stub to PE binaries (thanks Evan Shaw).
+* cgo: add //export.
+* cmath: new complex math library (thanks Charles L. Dorian).
+* docs: update to match current coding style (thanks Christopher Wedgwood).
+* exp/eval: fix example and add target to Makefile (thanks Evan Shaw).
+* fmt: change behaviour of format verb %b to match %x when negative (thanks Andrei Vieru).
+* gc: compile s == "" as len(s) == 0,
+	distinguish fatal compiler bug from error+exit,
+	fix alignment on non-amd64,
+	good syntax error for defer func() {} - missing fina (),
+	implement panic and recover,
+	zero unnamed return values on entry if func has defer.
+* goyacc: change to be reentrant (thanks Roger Peppe).
+* io/ioutil: fix bug in ReadFile when Open succeeds but Stat fails.
+* kate: update for recent language changes (thanks Evan Shaw).
+* libcgo: initial mingw port work - builds but untested (thanks Joe Poirier).
+* math: new functions and special cases (thanks Charles L. Dorian) 
+* net: use chan bool instead of chan *netFD to avoid cycle.
+* netchan: allow client to send as well as receive.
+* nntp: new package, NNTP client (thanks Conrad Meyer).
+* os: rename os.Dir to os.FileInfo.
+* rpc: don't log normal EOF,
+	fix ServeConn to block as documented.
+* runtime: many bug fixes, better ARM support.
+* strings: add IndexRune, Trim, TrimLeft, TrimRight, etc (thanks Michael Hoisie).
+* syscall: implement some mingw syscalls required by os (thanks Alex Brainman).
+* test/bench: add k-nucleotide-parallel (thanks Kyle Consalus).
+* Unicode: add support for Turkish case mapping.
+* xgb: move from the main repository to http://code.google.com/p/x-go-binding/
+
+ +

2010-03-30

+ +
+This release contains three language changes:
+
+1. Accessing a non-existent key in a map is no longer a run-time error.  
+It now evaluates to the zero value for that type.  For example:
+        x := myMap[i]   is now equivalent to:   x, _ := myMap[i]
+
+2. It is now legal to take the address of a function's return value.  
+The return values are copied back to the caller only after deferred
+functions have run.
+
+3. The functions panic and recover, intended for reporting and recovering from
+failure, have been added to the spec:
+	http://golang.org/doc/go_spec.html#Handling_panics 
+In a related change, panicln is gone, and panic is now a single-argument
+function.  Panic and recover are recognized by the gc compilers but the new
+behavior is not yet implemented.
+
+The ARM build is broken in this release; ARM users should stay at release.2010-03-22.
+
+Other changes:
+* bytes, strings: add IndexAny.
+* cc/ld: Add support for #pragma dynexport,
+        Rename dynld to dynimport throughout. Cgo users will need to rerun cgo.
+* expvar: default publishings for cmdline, memstats
+* flag: add user-defined flag types.
+* gc: usual bug fixes
+* go/ast: generalized ast filtering.
+* go/printer: avoid reflect in print.
+* godefs: fix handling of negative constants.
+* godoc: export pprof debug information, exported variables,
+        support for filtering of command-line output in -src mode,
+        use http GET for remote search instead of rpc.
+* gofmt: don't convert multi-line functions into one-liners,
+        preserve newlines in multiline selector expressions (thanks Risto Jaakko Saarelma).
+* goinstall: include command name in error reporting (thanks Andrey Mirtchovski)
+* http: add HandleFunc as shortcut to Handle(path, HandlerFunc(func))
+* make: use actual dependency for install
+* math: add J1, Y1, Jn, Yn, J0, Y0 (Bessel functions) (thanks Charles L. Dorian)
+* prof: add pprof from google-perftools
+* regexp: don't return non-nil *Regexp if there is an error.
+* runtime: add Callers,
+        add malloc sampling, pprof interface,
+        add memory profiling, more statistics to runtime.MemStats,
+        implement missing destroylock() (thanks Alex Brainman),
+        more malloc statistics,
+        run all finalizers in a single goroutine,
+        Goexit runs deferred calls.
+* strconv: add Atob and Btoa,
+        Unquote could wrongly return a nil error on error (thanks Roger Peppe).
+* syscall: add IPV6 constants,
+        add syscall_bsd.go for Darwin and other *BSDs (thanks Giles Lean),
+        implement SetsockoptString (thanks Christopher Wedgwood).
+* websocket: implement new protocol (thanks Fumitoshi Ukai).
+* xgb: fix request length and request size (thanks Firmansyah Adiputra).
+* xml: add CopyToken (thanks Kyle Consalus),
+        add line numbers to syntax errors (thanks Kyle Consalus),
+        use io.ReadByter in place of local readByter (thanks Raif S. Naffah). 
+
+ +

2010-03-22

+ +
+With this release we announce the launch of the Go Blog:
+	http://blog.golang.org/
+The first post is a brief update covering what has happened since the launch.
+
+This release contains some new packages and functionality, and many fixes:
+* 6g/8g: fix issues with complex data types, other bug fixes.
+* Makefiles: refactored to make writing external Makefiles easier.
+* crypto/rand: new package.
+* godoc: implemented command-line search via RPC,
+	improved comment formatting: recognize URLs.
+* gofmt: more consistent formatting of const/var decls.
+* http: add Error helper function,
+	add ParseQuery (thanks Petar Maymounkov),
+	change RawPath to mean raw path, not raw everything-after-scheme.
+* image/jpeg: fix typos.
+* json: add MarshalIndent (accepts user-specified indent string).
+* math: add Gamma function (thanks Charles L. Dorian).
+* misc/bbedit: support for cmplx, real, imag (thanks Anthony Starks).
+* misc/vim: add new complex types, functions and literals.
+* net: fix IPMask.String not to crash on all-0xff mask.
+* os: drop File finalizer after normal Close.
+* runtime: add GOROOT and Version,
+	lock finalizer table accesses.
+* sha512: add sha384 (truncated version) (thanks Conrad Meyer).
+* syscall: add const ARCH, analogous to OS.
+* syscall: further additions to mingw port (thanks Alex Brainman).
+* template: fixed html formatter []byte input bug.
+* utf16: new package.
+* version.bash: cope with ancient Mercurial.
+* websocket: use URL.RawPath to construct WebSocket-Location: header.
+
+ +

2010-03-15

+ +
+This release includes a language change: support for complex numbers.
+	http://golang.org/doc/go_spec.html#Imaginary_literals
+	http://golang.org/doc/go_spec.html#Complex_numbers
+There is no library support as yet.
+
+This release also includes the goinstall command-line tool. 
+	http://golang.org/cmd/goinstall/
+	http://groups.google.com/group/golang-nuts/t/f091704771128e32
+
+* 5g/6g/8g: fix double function call in slice.
+* arm: cleanup build warnings. (thanks Dean Prichard)
+* big: fix mistakes with probablyPrime.
+* bufio: add WriteRune.
+* bytes: add ReadRune and WriteRune to bytes.Buffer.
+* cc: stack split bug fix.
+* crypto: add SHA-224 to sha256, add sha512 package. (thanks Conrad Meyer)
+* crypto/ripemd160: new package. (thanks Raif S. Naffah)
+* crypto/rsa: don't use safe primes.
+* gc: avoid fixed length buffer cleanbuf. (thanks Dean Prichard)
+	better compilation of floating point +=
+	fix crash on complicated arg to make slice.
+	remove duplicate errors, give better error for I.(T)
+* godoc: support for multiple packages in a directory, other fixes.
+* gofmt: bug fixes.
+* hash: add Sum64 interface.
+* hash/crc32: add Update function.
+* hash/crc64: new package implementing 64-bit CRC.
+* math: add ilogb, logb, remainder. (thanks Charles L. Dorian) 
+* regexp: add ReplaceAllFunc, ReplaceAllStringFunc.
+* runtime: clock garbage collection on bytes allocated, not pages in use.
+* strings: make Split(s, "", n) faster. (thanks Spring Mc)
+* syscall: minimal mingw version of syscall. (thanks Alex Brainman)
+* template: add ParseFile, MustParseFile.
+
+ +

2010-03-04

+ +
+There is one language change: the ability to convert a string to []byte or 
+[]int.  This deprecates the strings.Bytes and strings.Runes functions.
+You can convert your existing sources using these gofmt commands:
+	gofmt -r 'strings.Bytes(x) -> []byte(x)' -w file-or-directory-list
+	gofmt -r 'strings.Runes(x) -> []int(x)' -w file-or-directory-list
+After running these you might need to delete unused imports of the "strings" 
+package.
+
+Other changes and fixes:
+* 6l/8l/5l: add -r option
+* 8g: make a[byte(x)] truncate x
+* codereview.py: fix for compatibility with hg >=1.4.3
+* crypto/blowfish: new package (thanks Raif S. Naffah)
+* dashboard: more performance tuning
+* fmt: use String method in %q to get the value to quote.
+* gofmt: several cosmetic changes
+* http: fix handling of Connection: close, bug in http.Post
+* net: correct DNS configuration,
+	fix network timeout boundary condition,
+	put [ ] around IPv6 addresses for Dial.
+* path: add Match,
+	fix bug in Match with non-greedy stars (thanks Kevin Ballard)
+* strings: delete Bytes, Runes (see above)
+* tests: an Eratosthenesque concurrent prime sieve (thanks Anh Hai Trinh) 
+
+ +

2010-02-23

+ +
+This release is mainly bug fixes and a little new code.
+There are no language changes.
+
+6g/5g/8g: bug fixes
+8a/8l: Added FCMOVcc instructions (thanks Evan Shaw and Charles Dorian)
+crypto/x509: support certificate creation
+dashboard: caching to avoid datastore queries
+exec: add dir argument to Run
+godoc: bug fixes and code cleanups
+http: continued implementation and bug fixes (thanks Petar Maymounkov)
+json: fix quoted strings in Marshal (thanks Sergei Skorobogatov)
+math: more functions, test cases, and benchmarks (thanks Charles L. Dorian)
+misc/bbedit: treat predeclared identifiers as "keywords" (thanks Anthony Starks)
+net: disable UDP server test (flaky on various architectures)
+runtime: work around Linux kernel bug in futex,
+	pchw is now tiny
+sync: fix to work on armv5 (thanks Dean Prichard)
+websocket: fix binary frame size decoding (thanks Timo Savola)
+xml: allow unquoted attribute values in non-Strict mode (thanks Amrut Joshi)
+	treat bool as value in Unmarshal (thanks Michael Hoisie) 
+
+ +

2010-02-17

+ +
+There are two small language changes:
+* NUL bytes may be rejected in souce files, and the tools do reject them.
+* Conversions from string to []int and []byte are defined but not yet implemented.
+
+Other changes and fixes:
+* 5a/6a/8a/5c/6c/8c: remove fixed-size arrays for -I and -D options (thanks Dean Prichard)
+* 5c/6c/8c/5l/6l/8l: add -V flag to display version number
+* 5c/6c/8c: use "cpp" not "/bin/cpp" for external preprocessor (thanks Giles Lean)
+* 8a/8l: Added CMOVcc instructions (thanks Evan Shaw)
+* 8l: pe executable building code changed to include import table for kernel32.dll functions (thanks Alex Brainman)
+* 5g/6g/8g: bug fixes
+* asn1: bug fixes and additions (incl marshalling)
+* build: fix build for Native Client, Linux/ARM
+* dashboard: show benchmarks, add garbage collector benchmarks
+* encoding/pem: add marshalling support
+* exp/draw: fast paths for a nil mask
+* godoc: support for directories outside $GOROOT
+* http: sort header keys when writing Response or Request to wire (thanks Petar Maymounkov)
+* math: special cases and new functions (thanks Charles Dorian)
+* mime: new package, used in http (thanks Michael Hoisie)
+* net: dns bug fix - use random request id
+* os: finalize File, to close fd.
+* path: make Join variadic (thanks Stephen Weinberg)
+* regexp: optimization bug fix
+* runtime: misc fixes and optimizations
+* syscall: make signature of Umask on OS X, FreeBSD match Linux. (thanks Giles Lean)
+
+ +

2010-02-04

+ +
+There is one language change: support for ...T parameters:
+	http://golang.org/doc/go_spec.html#Function_types
+
+You can now check build status on various platforms at the Go Dashboard: 
+	http://godashboard.appspot.com
+
+* 5l/6l/8l: several minor fixes
+* 5a/6a/8a/5l/6l/8l: avoid overflow of symb buffer (thanks Dean Prichard)
+* compress/gzip: gzip deflater (i.e., writer)
+* debug/proc: add mingw specific build stubs (thanks Joe Poirier)
+* exp/draw: separate the source-point and mask-point in Draw
+* fmt: handle nils safely in Printf
+* gccgo: error messages now match those of gc
+* godoc: several fixes
+* http: bug fixes, revision of Request/Response (thanks Petar Maymounkov)
+* image: new image.A type to represent anti-aliased font glyphs
+	add named colors (e.g. image.Blue), suitable for exp/draw
+* io: fixed bugs in Pipe
+* malloc: merge into package runtime
+* math: fix tests on FreeBSD (thanks Devon H. O'Dell)
+	add functions; update tests and special cases (thanks Charles L. Dorian)
+* os/signal: send SIGCHLDs to Incoming (thanks Chris Wedgwood)
+* reflect: add StringHeader to reflect
+* runtime: add SetFinalizer
+* time: Sleep through interruptions (thanks Chris Wedgwood)
+	add RFC822 formats
+	experimental implementation of Ticker using two goroutines for all tickers
+* xml: allow underscores in XML element names (thanks Michael Hoisie)
+	allow any scalar type in xml.Unmarshal
+
+ +

2010-01-27

+ +
+There are two small language changes: the meaning of chan <- chan int
+is now defined, and functions returning functions do not need to 
+parenthesize the result type.
+
+There is one significant implementation change: the compilers can
+handle multiple packages using the same name in a single binary.
+In the gc compilers, this comes at the cost of ensuring that you
+always import a particular package using a consistent import path.
+In the gccgo compiler, the cost is that you must use the -fgo-prefix
+flag to pass a unique prefix (like the eventual import path).
+
+5a/6a/8a: avoid use of fixed-size buffers (thanks Dean Prichard)
+5g, 6g, 8g: many minor bug fixes
+bufio: give Writer.WriteString same signature as bytes.Buffer.WriteString.
+container/list: PushFrontList, PushBackList (thanks Jan Hosang)
+godoc: trim spaces from search query (thanks Christopher Wedgwood)
+hash: document that Sum does not change state, fix crypto hashes
+http: bug fixes, revision of Request/Response (thanks Petar Maymounkov)
+math: more handling of IEEE 754 special cases (thanks Charles Dorian)
+misc/dashboard: new build dashboard
+net: allow UDP broadcast,
+	use /etc/hosts to resolve names (thanks Yves Junqueira, Michael Hoisie)
+netchan: beginnings of new package for connecting channels across a network
+os: allow FQDN in Hostname test (thanks Icarus Sparry)
+reflect: garbage collection bug in Call
+runtime: demo of Go on raw (emulated) hw in runtime/pchw,
+	performance fix on OS X
+spec: clarify meaning of chan <- chan int,
+	func() func() int is allowed now,
+	define ... T (not yet implemented)
+template: can use interface values
+time: fix for +0000 time zone,
+	more robust tick.Stop.
+xgb: support for authenticated connections (thanks Firmansyah Adiputra)
+xml: add Escape (thanks Stephen Weinberg)
+
+ +

2010-01-13

+ +
+This release is mainly bug fixes with a little new code.
+There are no language changes.
+
+build: $GOBIN should no longer be required in $PATH (thanks Devon H. O'Dell),
+	new package target "make bench" to run benchmarks
+8g: faster float -> uint64 conversion (thanks Evan Shaw)
+5g, 6g, 8g:
+	clean opnames.h to avoid stale errors (thanks Yongjian Xu),
+	a handful of small compiler fixes
+5g, 6g, 8g, 5l, 6l, 8l: ignore $GOARCH, which is implied by name of tool
+6prof: support for writing input files for google-perftools's pprof
+asn1: fix a few structure-handling bugs
+cgo: many bug fixes (thanks Devon H. O'Dell)
+codereview: repeated "hg mail" sends "please take another look"
+gob: reserve ids for future expansion
+godoc: distinguish HTML generation from plain text HTML escaping (thanks Roger Peppe)
+gofmt: minor bug fixes, removed -oldprinter flag
+http: add CanonicalPath (thanks Ivan Krasin),
+	avoid header duplication in Response.Write,
+	correctly escape/unescape URL sections
+io: new interface ReadByter
+json: better error, pointer handling in Marshal (thanks Ivan Krasin)
+libmach: disassembly of FUCOMI, etc (thanks Evan Shaw)
+math: special cases for most functions and 386 hardware Sqrt (thanks Charles Dorian)
+misc/dashboard: beginning of a build dashboard at godashboard.appspot.com.
+misc/emacs: handling of new semicolon rules (thanks Austin Clements),
+	empty buffer bug fix (thanks Kevin Ballard)
+misc/kate: highlighting improvements (tahnks Evan Shaw)
+os/signal: add signal names: signal.SIGHUP, etc (thanks David Symonds)
+runtime: preliminary Windows support (thanks Hector Chu),
+	preemption polling to reduce garbage collector pauses
+scanner: new lightweight scanner package
+template: bug fix involving spaces before a delimited block
+test/bench: updated timings
+time: new Format, Parse functions
+
+ +

2010-01-05

+ +
+This release is mainly bug fixes.  There are no language changes.
+
+6prof: now works on 386
+8a, 8l: add FCOMI, FCOMIP, FUCOMI, and FUCOMIP (thanks Evan Shaw)
+big: fix ProbablyPrime on small numbers
+container/vector: faster []-based implementation (thanks Jan Mercl)
+crypto/tls: extensions and Next Protocol Negotiation
+gob: one encoding bug fix, one decoding bug fix
+image/jpeg: support for RST markers
+image/png: support for transparent paletted images
+misc/xcode: improved support (thanks Ken Friedenbach)
+net: return nil Conn on error from Dial (thanks Roger Peppe)
+regexp: add Regexp.NumSubexp (thanks Peter Froehlich)
+syscall: add Nanosleep on FreeBSD (thanks Devon H. O'Dell)
+template: can use map in .repeated section
+
+There is now a public road map, in the repository and online
+at http://golang.org/doc/devel/roadmap.html.
+
+ +

2009-12-22

+ +
+Since the last release there has been one large syntactic change to
+the language, already discussed extensively on this list: semicolons
+are now implied between statement-ending tokens and newline characters.
+See http://groups.google.com/group/golang-nuts/t/5ee32b588d10f2e9 for
+details.
+
+By default, gofmt now parses and prints the new lighter weight syntax.
+To convert programs written in the old syntax, you can use:
+
+	gofmt -oldparser -w *.go
+
+Since everything was being reformatted anyway, we took the opportunity to
+change the way gofmt does alignment.  Now gofmt uses tabs at the start
+of a line for basic code alignment, but it uses spaces for alignment of
+interior columns.  Thus, in an editor with a fixed-width font, you can
+choose your own tab size to change the indentation, and no matter what
+tab size you choose, columns will be aligned properly.
+
+
+In addition to the syntax and formatting changes, there have been many
+smaller fixes and updates:
+
+6g,8g,5g: many bug fixes, better registerization,
+   build process fix involving mkbuiltin (thanks Yongjian Xu),
+   method expressions for concrete types
+8l: support for Windows PE files (thanks Hector Chu)
+bytes: more efficient Buffer handling
+bytes, strings: new function Fields (thanks Andrey Mirtchovski)
+cgo: handling of enums (thanks Moriyoshi Koizumi),
+    handling of structs with bit fields, multiple files (thanks Devon H. O'Dell),
+    installation of .so to non-standard locations
+crypto/sha256: new package for SHA 256 (thanks Andy Davis)
+encoding/binary: support for slices of fixed-size values (thanks Maxim Ushakov)
+exp/vector: experimental alternate vector representation (thanks Jan Mercl)
+fmt: %p for chan, map, slice types
+gob: a couple more bug fixes
+http: support for basic authentication (thanks Ivan Krasin)
+image/jpeg: basic JPEG decoder
+math: correct handling of Inf and NaN in Pow (thanks Charles Dorian)
+misc/bash: completion file for bash (thanks Alex Ray)
+os/signal: support for handling Unix signals (thanks David Symonds)
+rand: Zipf-distributed random values (thanks William Josephson)
+syscall: correct error return bug on 32-bit machines (thanks Christopher Wedgwood)
+syslog: new package for writing to Unix syslog daemon (thanks Yves Junqueira)
+template: will automatically invoke niladic methods
+time: new ISO8601 format generator (thanks Ben Olive)
+xgb: converted generator to new syntax (thanks Tor Andersson)
+xml: better mapping of tag names to Go identifiers (thanks Kei Son),
+    better handling of unexpected EOF (thanks Arvindh Rajesh Tamilmani)
+
+ +

2009-12-09

+ +
+Since the last release there are two changes to the language: 
+
+* new builtin copy(dst, src) copies n = min(len(dst), len(src)) 
+  elements to dst from src and returns n.  It works correctly 
+  even if dst and src overlap.  bytes.Copy is gone. 
+  Convert your programs using: 
+      gofmt -w -r 'bytes.Copy(d, s) -> copy(d, s)' *.go 
+
+* new syntax x[lo:] is shorthand for x[lo:len(x)]. 
+  Convert your programs using: 
+      gofmt -w -r 'a[b:len(a)] -> a[b:]' *.go 
+
+In addition, there have been many smaller fixes and updates: 
+
+* 6g/8g/5g: many bug fixes 
+* 8g: fix 386 floating point stack bug (thanks Charles Dorian) 
+* all.bash: now works even when $GOROOT has spaces (thanks Sergio Luis O. B. Correia), 
+    starting to make build work with mingw (thanks Hector Chu), 
+    FreeBSD support (thanks Devon O'Dell) 
+* big: much faster on 386. 
+* bytes: new function IndexByte, implemented in assembly 
+    new function Runes (thanks Peter Froehlich), 
+    performance tuning in bytes.Buffer. 
+* codereview: various bugs fixed 
+* container/vector: New is gone; just declare a Vector instead. 
+    call Resize to set len and cap. 
+* cgo: many bug fixes (thanks Eden Li) 
+* crypto: added MD4 (thanks Chris Lennert), 
+    added XTEA (thanks Adrian O'Grady). 
+* crypto/tls: basic client 
+* exp/iterable: new functions (thanks Michael Elkins) 
+* exp/nacl: native client tree builds again 
+* fmt: preliminary performance tuning 
+* go/ast: more powerful Visitor (thanks Roger Peppe) 
+* gob: a few bug fixes 
+* gofmt: better handling of standard input, error reporting (thanks Fazlul Shahriar) 
+    new -r flag for rewriting programs 
+* gotest: support for Benchmark functions (thanks Trevor Strohman) 
+* io: ReadFile, WriteFile, ReadDir now in separate package io/ioutil. 
+* json: new Marshal function (thanks Michael Hoisie), 
+    better white space handling (thanks Andrew Skiba), 
+    decoding into native data structures (thanks Sergey Gromov), 
+    handling of nil interface values (thanks Ross Light). 
+* math: correct handling of sin/cos of large angles 
+* net: better handling of Close (thanks Devon O'Dell and Christopher Wedgwood) 
+    support for UDP broadcast (thanks Jonathan Wills), 
+    support for empty packets 
+* rand: top-level functions now safe to call from multiple goroutines 
+(thanks Roger Peppe). 
+* regexp: a few easy optimizations 
+* rpc: better error handling, a few bug fixes 
+* runtime: better signal handling on OS X, malloc fixes, 
+    global channel lock is gone. 
+* sync: RWMutex now allows concurrent readers (thanks Péter Szabó) 
+* template: can use maps as data (thanks James Meneghello) 
+* unicode: updated to Unicode 5.2. 
+* websocket: new package (thanks Fumitoshi Ukai) 
+* xgb: preliminary X Go Bindings (thanks Tor Andersson) 
+* xml: fixed crash (thanks Vish Subramanian) 
+* misc: bbedit config (thanks Anthony Starks), 
+    kate config (thanks Evan Shaw) 
+
diff --git a/doc/docs.html b/doc/docs.html new file mode 100644 index 0000000000000000000000000000000000000000..7eb3a3ad263a76c0da3fb1e0b1154f6290c43d14 --- /dev/null +++ b/doc/docs.html @@ -0,0 +1,199 @@ + + +

+The Go programming language is an open source project to make programmers more +productive. +

+ +

+Go is expressive, concise, clean, and efficient. Its concurrency +mechanisms make it easy to write programs that get the most out of multicore +and networked machines, while its novel type system enables flexible and +modular program construction. Go compiles quickly to machine code yet has the +convenience of garbage collection and the power of run-time reflection. It's a +fast, statically typed, compiled language that feels like a dynamically typed, +interpreted language. +

+ +
+ +

Installing Go

+ +

Getting Started

+

+Instructions for downloading and installing the Go compilers, tools, and +libraries. +

+ + +

Learning Go

+ + + +

A Tour of Go

+

+An interactive introduction to Go in three sections. +The first section covers basic syntax and data structures; the second discusses +methods and interfaces; and the third introduces Go's concurrency primitives. +Each section concludes with a few exercises so you can practice what you've +learned. You can take the tour online or +install it locally. +

+ +

How to write Go code

+

+Also available as a +screencast, this doc +explains how to use the go command to fetch, build, and +install packages, commands, and run tests. +

+ +

Effective Go

+

+A document that gives tips for writing clear, idiomatic Go code. +A must read for any new Go programmer. It augments the tour and +the language specification, both of which should be read first. +

+ +

Frequently Asked Questions (FAQ)

+

+Answers to common questions about Go. +

+ +

The Go Wiki

+

A wiki maintained by the Go community.

+ +

More

+

+See the Learn page at the Wiki +for more Go learning resources. +

+ + +

References

+ +

Package Documentation

+

+The documentation for the Go standard library. +

+ +

Command Documentation

+

+The documentation for the Go tools. +

+ +

Language Specification

+

+The official Go Language specification. +

+ +

The Go Memory Model

+

+A document that specifies the conditions under which reads of a variable in +one goroutine can be guaranteed to observe values produced by writes to the +same variable in a different goroutine. +

+ +

Release History

+

A summary of the changes between Go releases.

+ + +

Articles

+ +

The Go Blog

+

The official blog of the Go project, featuring news and in-depth articles by +the Go team and guests.

+ +

Codewalks

+

+Guided tours of Go programs. +

+ + +

Language

+ + +

Packages

+ + +

Tools

+ + +

More

+

+See the Articles page at the +Wiki for more Go articles. +

+ + +

Talks

+ + + +

A Video Tour of Go

+

+Three things that make Go fast, fun, and productive: +interfaces, reflection, and concurrency. Builds a toy web crawler to +demonstrate these. +

+ +

Code that grows with grace

+

+One of Go's key design goals is code adaptability; that it should be easy to take a simple design and build upon it in a clean and natural way. In this talk Andrew Gerrand describes a simple "chat roulette" server that matches pairs of incoming TCP connections, and then use Go's concurrency mechanisms, interfaces, and standard library to extend it with a web interface and other features. While the function of the program changes dramatically, Go's flexibility preserves the original design as it grows. +

+ +

Go Concurrency Patterns

+

+Concurrency is the key to designing high performance network services. Go's concurrency primitives (goroutines and channels) provide a simple and efficient means of expressing concurrent execution. In this talk we see how tricky concurrency problems can be solved gracefully with simple Go code. +

+ +

Advanced Go Concurrency Patterns

+

+This talk expands on the Go Concurrency Patterns talk to dive deeper into Go's concurrency primitives. +

+ +

More

+

+See the Go Talks site and wiki page for more Go talks. +

+ + +

Non-English Documentation

+ +

+See the NonEnglish page +at the Wiki for localized +documentation. +

diff --git a/doc/effective_go.html b/doc/effective_go.html new file mode 100644 index 0000000000000000000000000000000000000000..5a522f607d2075779f7837f37bb6d5c2cdb1f4b9 --- /dev/null +++ b/doc/effective_go.html @@ -0,0 +1,3668 @@ + + +

Introduction

+ +

+Go is a new language. Although it borrows ideas from +existing languages, +it has unusual properties that make effective Go programs +different in character from programs written in its relatives. +A straightforward translation of a C++ or Java program into Go +is unlikely to produce a satisfactory result—Java programs +are written in Java, not Go. +On the other hand, thinking about the problem from a Go +perspective could produce a successful but quite different +program. +In other words, +to write Go well, it's important to understand its properties +and idioms. +It's also important to know the established conventions for +programming in Go, such as naming, formatting, program +construction, and so on, so that programs you write +will be easy for other Go programmers to understand. +

+ +

+This document gives tips for writing clear, idiomatic Go code. +It augments the language specification, +the Tour of Go, +and How to Write Go Code, +all of which you +should read first. +

+ +

Examples

+ +

+The Go package sources +are intended to serve not +only as the core library but also as examples of how to +use the language. +Moreover, many of the packages contain working, self-contained +executable examples you can run directly from the +golang.org web site, such as +this one (if +necessary, click on the word "Example" to open it up). +If you have a question about how to approach a problem or how something +might be implemented, the documentation, code and examples in the +library can provide answers, ideas and +background. +

+ + +

Formatting

+ +

+Formatting issues are the most contentious +but the least consequential. +People can adapt to different formatting styles +but it's better if they don't have to, and +less time is devoted to the topic +if everyone adheres to the same style. +The problem is how to approach this Utopia without a long +prescriptive style guide. +

+ +

+With Go we take an unusual +approach and let the machine +take care of most formatting issues. +The gofmt program +(also available as go fmt, which +operates at the package level rather than source file level) +reads a Go program +and emits the source in a standard style of indentation +and vertical alignment, retaining and if necessary +reformatting comments. +If you want to know how to handle some new layout +situation, run gofmt; if the answer doesn't +seem right, rearrange your program (or file a bug about gofmt), +don't work around it. +

+ +

+As an example, there's no need to spend time lining up +the comments on the fields of a structure. +Gofmt will do that for you. Given the +declaration +

+ +
+type T struct {
+    name string // name of the object
+    value int // its value
+}
+
+ +

+gofmt will line up the columns: +

+ +
+type T struct {
+    name    string // name of the object
+    value   int    // its value
+}
+
+ +

+All Go code in the standard packages has been formatted with gofmt. +

+ + +

+Some formatting details remain. Very briefly: +

+ +
+
Indentation
+
We use tabs for indentation and gofmt emits them by default. + Use spaces only if you must. +
+
Line length
+
+ Go has no line length limit. Don't worry about overflowing a punched card. + If a line feels too long, wrap it and indent with an extra tab. +
+
Parentheses
+
+ Go needs fewer parentheses than C and Java: control structures (if, + for, switch) do not have parentheses in + their syntax. + Also, the operator precedence hierarchy is shorter and clearer, so +
+x<<8 + y<<16
+
+ means what the spacing implies, unlike in the other languages. +
+
+ +

Commentary

+ +

+Go provides C-style /* */ block comments +and C++-style // line comments. +Line comments are the norm; +block comments appear mostly as package comments, but +are useful within an expression or to disable large swaths of code. +

+ +

+The program—and web server—godoc processes +Go source files to extract documentation about the contents of the +package. +Comments that appear before top-level declarations, with no intervening newlines, +are extracted along with the declaration to serve as explanatory text for the item. +The nature and style of these comments determines the +quality of the documentation godoc produces. +

+ +

+Every package should have a package comment, a block +comment preceding the package clause. +For multi-file packages, the package comment only needs to be +present in one file, and any one will do. +The package comment should introduce the package and +provide information relevant to the package as a whole. +It will appear first on the godoc page and +should set up the detailed documentation that follows. +

+ +
+/*
+Package regexp implements a simple library for regular expressions.
+
+The syntax of the regular expressions accepted is:
+
+    regexp:
+        concatenation { '|' concatenation }
+    concatenation:
+        { closure }
+    closure:
+        term [ '*' | '+' | '?' ]
+    term:
+        '^'
+        '$'
+        '.'
+        character
+        '[' [ '^' ] character-ranges ']'
+        '(' regexp ')'
+*/
+package regexp
+
+ +

+If the package is simple, the package comment can be brief. +

+ +
+// Package path implements utility routines for
+// manipulating slash-separated filename paths.
+
+ +

+Comments do not need extra formatting such as banners of stars. +The generated output may not even be presented in a fixed-width font, so don't depend +on spacing for alignment—godoc, like gofmt, +takes care of that. +The comments are uninterpreted plain text, so HTML and other +annotations such as _this_ will reproduce verbatim and should +not be used. +One adjustment godoc does do is to display indented +text in a fixed-width font, suitable for program snippets. +The package comment for the +fmt package uses this to good effect. +

+ +

+Depending on the context, godoc might not even +reformat comments, so make sure they look good straight up: +use correct spelling, punctuation, and sentence structure, +fold long lines, and so on. +

+ +

+Inside a package, any comment immediately preceding a top-level declaration +serves as a doc comment for that declaration. +Every exported (capitalized) name in a program should +have a doc comment. +

+ +

+Doc comments work best as complete sentences, which allow +a wide variety of automated presentations. +The first sentence should be a one-sentence summary that +starts with the name being declared. +

+ +
+// Compile parses a regular expression and returns, if successful, a Regexp
+// object that can be used to match against text.
+func Compile(str string) (regexp *Regexp, err error) {
+
+ +

+If the name always begins the comment, the output of godoc +can usefully be run through grep. +Imagine you couldn't remember the name "Compile" but were looking for +the parsing function for regular expressions, so you ran +the command, +

+ +
+$ godoc regexp | grep parse
+
+ +

+If all the doc comments in the package began, "This function...", grep +wouldn't help you remember the name. But because the package starts each +doc comment with the name, you'd see something like this, +which recalls the word you're looking for. +

+ +
+$ godoc regexp | grep parse
+    Compile parses a regular expression and returns, if successful, a Regexp
+    parsed. It simplifies safe initialization of global variables holding
+    cannot be parsed. It simplifies safe initialization of global variables
+$
+
+ +

+Go's declaration syntax allows grouping of declarations. +A single doc comment can introduce a group of related constants or variables. +Since the whole declaration is presented, such a comment can often be perfunctory. +

+ +
+// Error codes returned by failures to parse an expression.
+var (
+    ErrInternal      = errors.New("regexp: internal error")
+    ErrUnmatchedLpar = errors.New("regexp: unmatched '('")
+    ErrUnmatchedRpar = errors.New("regexp: unmatched ')'")
+    ...
+)
+
+ +

+Grouping can also indicate relationships between items, +such as the fact that a set of variables is protected by a mutex. +

+ +
+var (
+    countLock   sync.Mutex
+    inputCount  uint32
+    outputCount uint32
+    errorCount  uint32
+)
+
+ +

Names

+ +

+Names are as important in Go as in any other language. +They even have semantic effect: +the visibility of a name outside a package is determined by whether its +first character is upper case. +It's therefore worth spending a little time talking about naming conventions +in Go programs. +

+ + +

Package names

+ +

+When a package is imported, the package name becomes an accessor for the +contents. After +

+ +
+import "bytes"
+
+ +

+the importing package can talk about bytes.Buffer. It's +helpful if everyone using the package can use the same name to refer to +its contents, which implies that the package name should be good: +short, concise, evocative. By convention, packages are given +lower case, single-word names; there should be no need for underscores +or mixedCaps. +Err on the side of brevity, since everyone using your +package will be typing that name. +And don't worry about collisions a priori. +The package name is only the default name for imports; it need not be unique +across all source code, and in the rare case of a collision the +importing package can choose a different name to use locally. +In any case, confusion is rare because the file name in the import +determines just which package is being used. +

+ +

+Another convention is that the package name is the base name of +its source directory; +the package in src/encoding/base64 +is imported as "encoding/base64" but has name base64, +not encoding_base64 and not encodingBase64. +

+ +

+The importer of a package will use the name to refer to its contents, +so exported names in the package can use that fact +to avoid stutter. +(Don't use the import . notation, which can simplify +tests that must run outside the package they are testing, but should otherwise be avoided.) +For instance, the buffered reader type in the bufio package is called Reader, +not BufReader, because users see it as bufio.Reader, +which is a clear, concise name. +Moreover, +because imported entities are always addressed with their package name, bufio.Reader +does not conflict with io.Reader. +Similarly, the function to make new instances of ring.Ring—which +is the definition of a constructor in Go—would +normally be called NewRing, but since +Ring is the only type exported by the package, and since the +package is called ring, it's called just New, +which clients of the package see as ring.New. +Use the package structure to help you choose good names. +

+ +

+Another short example is once.Do; +once.Do(setup) reads well and would not be improved by +writing once.DoOrWaitUntilDone(setup). +Long names don't automatically make things more readable. +A helpful doc comment can often be more valuable than an extra long name. +

+ +

Getters

+ +

+Go doesn't provide automatic support for getters and setters. +There's nothing wrong with providing getters and setters yourself, +and it's often appropriate to do so, but it's neither idiomatic nor necessary +to put Get into the getter's name. If you have a field called +owner (lower case, unexported), the getter method should be +called Owner (upper case, exported), not GetOwner. +The use of upper-case names for export provides the hook to discriminate +the field from the method. +A setter function, if needed, will likely be called SetOwner. +Both names read well in practice: +

+
+owner := obj.Owner()
+if owner != user {
+    obj.SetOwner(user)
+}
+
+ +

Interface names

+ +

+By convention, one-method interfaces are named by +the method name plus an -er suffix or similar modification +to construct an agent noun: Reader, +Writer, Formatter, +CloseNotifier etc. +

+ +

+There are a number of such names and it's productive to honor them and the function +names they capture. +Read, Write, Close, Flush, +String and so on have +canonical signatures and meanings. To avoid confusion, +don't give your method one of those names unless it +has the same signature and meaning. +Conversely, if your type implements a method with the +same meaning as a method on a well-known type, +give it the same name and signature; +call your string-converter method String not ToString. +

+ +

MixedCaps

+ +

+Finally, the convention in Go is to use MixedCaps +or mixedCaps rather than underscores to write +multiword names. +

+ +

Semicolons

+ +

+Like C, Go's formal grammar uses semicolons to terminate statements, +but unlike in C, those semicolons do not appear in the source. +Instead the lexer uses a simple rule to insert semicolons automatically +as it scans, so the input text is mostly free of them. +

+ +

+The rule is this. If the last token before a newline is an identifier +(which includes words like int and float64), +a basic literal such as a number or string constant, or one of the +tokens +

+
+break continue fallthrough return ++ -- ) }
+
+

+the lexer always inserts a semicolon after the token. +This could be summarized as, “if the newline comes +after a token that could end a statement, insert a semicolon”. +

+ +

+A semicolon can also be omitted immediately before a closing brace, +so a statement such as +

+
+    go func() { for { dst <- <-src } }()
+
+

+needs no semicolons. +Idiomatic Go programs have semicolons only in places such as +for loop clauses, to separate the initializer, condition, and +continuation elements. They are also necessary to separate multiple +statements on a line, should you write code that way. +

+ +

+One consequence of the semicolon insertion rules +is that you cannot put the opening brace of a +control structure (if, for, switch, +or select) on the next line. If you do, a semicolon +will be inserted before the brace, which could cause unwanted +effects. Write them like this +

+ +
+if i < f() {
+    g()
+}
+
+

+not like this +

+
+if i < f()  // wrong!
+{           // wrong!
+    g()
+}
+
+ + +

Control structures

+ +

+The control structures of Go are related to those of C but differ +in important ways. +There is no do or while loop, only a +slightly generalized +for; +switch is more flexible; +if and switch accept an optional +initialization statement like that of for; +break and continue statements +take an optional label to identify what to break or continue; +and there are new control structures including a type switch and a +multiway communications multiplexer, select. +The syntax is also slightly different: +there are no parentheses +and the bodies must always be brace-delimited. +

+ +

If

+ +

+In Go a simple if looks like this: +

+
+if x > 0 {
+    return y
+}
+
+ +

+Mandatory braces encourage writing simple if statements +on multiple lines. It's good style to do so anyway, +especially when the body contains a control statement such as a +return or break. +

+ +

+Since if and switch accept an initialization +statement, it's common to see one used to set up a local variable. +

+ +
+if err := file.Chmod(0664); err != nil {
+    log.Print(err)
+    return err
+}
+
+ +

+In the Go libraries, you'll find that +when an if statement doesn't flow into the next statement—that is, +the body ends in break, continue, +goto, or return—the unnecessary +else is omitted. +

+ +
+f, err := os.Open(name)
+if err != nil {
+    return err
+}
+codeUsing(f)
+
+ +

+This is an example of a common situation where code must guard against a +sequence of error conditions. The code reads well if the +successful flow of control runs down the page, eliminating error cases +as they arise. Since error cases tend to end in return +statements, the resulting code needs no else statements. +

+ +
+f, err := os.Open(name)
+if err != nil {
+    return err
+}
+d, err := f.Stat()
+if err != nil {
+    f.Close()
+    return err
+}
+codeUsing(f, d)
+
+ + +

Redeclaration and reassignment

+ +

+An aside: The last example in the previous section demonstrates a detail of how the +:= short declaration form works. +The declaration that calls os.Open reads, +

+ +
+f, err := os.Open(name)
+
+ +

+This statement declares two variables, f and err. +A few lines later, the call to f.Stat reads, +

+ +
+d, err := f.Stat()
+
+ +

+which looks as if it declares d and err. +Notice, though, that err appears in both statements. +This duplication is legal: err is declared by the first statement, +but only re-assigned in the second. +This means that the call to f.Stat uses the existing +err variable declared above, and just gives it a new value. +

+ +

+In a := declaration a variable v may appear even +if it has already been declared, provided: +

+ +
    +
  • this declaration is in the same scope as the existing declaration of v +(if v is already declared in an outer scope, the declaration will create a new variable §),
  • +
  • the corresponding value in the initialization is assignable to v, and
  • +
  • there is at least one other variable in the declaration that is being declared anew.
  • +
+ +

+This unusual property is pure pragmatism, +making it easy to use a single err value, for example, +in a long if-else chain. +You'll see it used often. +

+ +

+§ It's worth noting here that in Go the scope of function parameters and return values +is the same as the function body, even though they appear lexically outside the braces +that enclose the body. +

+ +

For

+ +

+The Go for loop is similar to—but not the same as—C's. +It unifies for +and while and there is no do-while. +There are three forms, only one of which has semicolons. +

+
+// Like a C for
+for init; condition; post { }
+
+// Like a C while
+for condition { }
+
+// Like a C for(;;)
+for { }
+
+ +

+Short declarations make it easy to declare the index variable right in the loop. +

+
+sum := 0
+for i := 0; i < 10; i++ {
+    sum += i
+}
+
+ +

+If you're looping over an array, slice, string, or map, +or reading from a channel, a range clause can +manage the loop. +

+
+for key, value := range oldMap {
+    newMap[key] = value
+}
+
+ +

+If you only need the first item in the range (the key or index), drop the second: +

+
+for key := range m {
+    if key.expired() {
+        delete(m, key)
+    }
+}
+
+ +

+If you only need the second item in the range (the value), use the blank identifier, an underscore, to discard the first: +

+
+sum := 0
+for _, value := range array {
+    sum += value
+}
+
+ +

+The blank identifier has many uses, as described in a later section. +

+ +

+For strings, the range does more work for you, breaking out individual +Unicode code points by parsing the UTF-8. +Erroneous encodings consume one byte and produce the +replacement rune U+FFFD. +(The name (with associated builtin type) rune is Go terminology for a +single Unicode code point. +See the language specification +for details.) +The loop +

+
+for pos, char := range "日本\x80語" { // \x80 is an illegal UTF-8 encoding
+    fmt.Printf("character %#U starts at byte position %d\n", char, pos)
+}
+
+

+prints +

+
+character U+65E5 '日' starts at byte position 0
+character U+672C '本' starts at byte position 3
+character U+FFFD '�' starts at byte position 6
+character U+8A9E '語' starts at byte position 7
+
+ +

+Finally, Go has no comma operator and ++ and -- +are statements not expressions. +Thus if you want to run multiple variables in a for +you should use parallel assignment (although that precludes ++ and --). +

+
+// Reverse a
+for i, j := 0, len(a)-1; i < j; i, j = i+1, j-1 {
+    a[i], a[j] = a[j], a[i]
+}
+
+ +

Switch

+ +

+Go's switch is more general than C's. +The expressions need not be constants or even integers, +the cases are evaluated top to bottom until a match is found, +and if the switch has no expression it switches on +true. +It's therefore possible—and idiomatic—to write an +if-else-if-else +chain as a switch. +

+ +
+func unhex(c byte) byte {
+    switch {
+    case '0' <= c && c <= '9':
+        return c - '0'
+    case 'a' <= c && c <= 'f':
+        return c - 'a' + 10
+    case 'A' <= c && c <= 'F':
+        return c - 'A' + 10
+    }
+    return 0
+}
+
+ +

+There is no automatic fall through, but cases can be presented +in comma-separated lists. +

+
+func shouldEscape(c byte) bool {
+    switch c {
+    case ' ', '?', '&', '=', '#', '+', '%':
+        return true
+    }
+    return false
+}
+
+ +

+Although they are not nearly as common in Go as some other C-like +languages, break statements can be used to terminate +a switch early. +Sometimes, though, it's necessary to break out of a surrounding loop, +not the switch, and in Go that can be accomplished by putting a label +on the loop and "breaking" to that label. +This example shows both uses. +

+ +
+Loop:
+	for n := 0; n < len(src); n += size {
+		switch {
+		case src[n] < sizeOne:
+			if validateOnly {
+				break
+			}
+			size = 1
+			update(src[n])
+
+		case src[n] < sizeTwo:
+			if n+1 >= len(src) {
+				err = errShortInput
+				break Loop
+			}
+			if validateOnly {
+				break
+			}
+			size = 2
+			update(src[n] + src[n+1]<<shift)
+		}
+	}
+
+ +

+Of course, the continue statement also accepts an optional label +but it applies only to loops. +

+ +

+To close this section, here's a comparison routine for byte slices that uses two +switch statements: +

+
+// Compare returns an integer comparing the two byte slices,
+// lexicographically.
+// The result will be 0 if a == b, -1 if a < b, and +1 if a > b
+func Compare(a, b []byte) int {
+    for i := 0; i < len(a) && i < len(b); i++ {
+        switch {
+        case a[i] > b[i]:
+            return 1
+        case a[i] < b[i]:
+            return -1
+        }
+    }
+    switch {
+    case len(a) > len(b):
+        return 1
+    case len(a) < len(b):
+        return -1
+    }
+    return 0
+}
+
+ +

Type switch

+ +

+A switch can also be used to discover the dynamic type of an interface +variable. Such a type switch uses the syntax of a type +assertion with the keyword type inside the parentheses. +If the switch declares a variable in the expression, the variable will +have the corresponding type in each clause. +It's also idiomatic to reuse the name in such cases, in effect declaring +a new variable with the same name but a different type in each case. +

+
+var t interface{}
+t = functionOfSomeType()
+switch t := t.(type) {
+default:
+    fmt.Printf("unexpected type %T\n", t)     // %T prints whatever type t has
+case bool:
+    fmt.Printf("boolean %t\n", t)             // t has type bool
+case int:
+    fmt.Printf("integer %d\n", t)             // t has type int
+case *bool:
+    fmt.Printf("pointer to boolean %t\n", *t) // t has type *bool
+case *int:
+    fmt.Printf("pointer to integer %d\n", *t) // t has type *int
+}
+
+ +

Functions

+ +

Multiple return values

+ +

+One of Go's unusual features is that functions and methods +can return multiple values. This form can be used to +improve on a couple of clumsy idioms in C programs: in-band +error returns such as -1 for EOF +and modifying an argument passed by address. +

+ +

+In C, a write error is signaled by a negative count with the +error code secreted away in a volatile location. +In Go, Write +can return a count and an error: “Yes, you wrote some +bytes but not all of them because you filled the device”. +The signature of the Write method on files from +package os is: +

+ +
+func (file *File) Write(b []byte) (n int, err error)
+
+ +

+and as the documentation says, it returns the number of bytes +written and a non-nil error when n +!= len(b). +This is a common style; see the section on error handling for more examples. +

+ +

+A similar approach obviates the need to pass a pointer to a return +value to simulate a reference parameter. +Here's a simple-minded function to +grab a number from a position in a byte slice, returning the number +and the next position. +

+ +
+func nextInt(b []byte, i int) (int, int) {
+    for ; i < len(b) && !isDigit(b[i]); i++ {
+    }
+    x := 0
+    for ; i < len(b) && isDigit(b[i]); i++ {
+        x = x*10 + int(b[i]) - '0'
+    }
+    return x, i
+}
+
+ +

+You could use it to scan the numbers in an input slice b like this: +

+ +
+    for i := 0; i < len(b); {
+        x, i = nextInt(b, i)
+        fmt.Println(x)
+    }
+
+ +

Named result parameters

+ +

+The return or result "parameters" of a Go function can be given names and +used as regular variables, just like the incoming parameters. +When named, they are initialized to the zero values for their types when +the function begins; if the function executes a return statement +with no arguments, the current values of the result parameters are +used as the returned values. +

+ +

+The names are not mandatory but they can make code shorter and clearer: +they're documentation. +If we name the results of nextInt it becomes +obvious which returned int +is which. +

+ +
+func nextInt(b []byte, pos int) (value, nextPos int) {
+
+ +

+Because named results are initialized and tied to an unadorned return, they can simplify +as well as clarify. Here's a version +of io.ReadFull that uses them well: +

+ +
+func ReadFull(r Reader, buf []byte) (n int, err error) {
+    for len(buf) > 0 && err == nil {
+        var nr int
+        nr, err = r.Read(buf)
+        n += nr
+        buf = buf[nr:]
+    }
+    return
+}
+
+ +

Defer

+ +

+Go's defer statement schedules a function call (the +deferred function) to be run immediately before the function +executing the defer returns. It's an unusual but +effective way to deal with situations such as resources that must be +released regardless of which path a function takes to return. The +canonical examples are unlocking a mutex or closing a file. +

+ +
+// Contents returns the file's contents as a string.
+func Contents(filename string) (string, error) {
+    f, err := os.Open(filename)
+    if err != nil {
+        return "", err
+    }
+    defer f.Close()  // f.Close will run when we're finished.
+
+    var result []byte
+    buf := make([]byte, 100)
+    for {
+        n, err := f.Read(buf[0:])
+        result = append(result, buf[0:n]...) // append is discussed later.
+        if err != nil {
+            if err == io.EOF {
+                break
+            }
+            return "", err  // f will be closed if we return here.
+        }
+    }
+    return string(result), nil // f will be closed if we return here.
+}
+
+ +

+Deferring a call to a function such as Close has two advantages. First, it +guarantees that you will never forget to close the file, a mistake +that's easy to make if you later edit the function to add a new return +path. Second, it means that the close sits near the open, +which is much clearer than placing it at the end of the function. +

+ +

+The arguments to the deferred function (which include the receiver if +the function is a method) are evaluated when the defer +executes, not when the call executes. Besides avoiding worries +about variables changing values as the function executes, this means +that a single deferred call site can defer multiple function +executions. Here's a silly example. +

+ +
+for i := 0; i < 5; i++ {
+    defer fmt.Printf("%d ", i)
+}
+
+ +

+Deferred functions are executed in LIFO order, so this code will cause +4 3 2 1 0 to be printed when the function returns. A +more plausible example is a simple way to trace function execution +through the program. We could write a couple of simple tracing +routines like this: +

+ +
+func trace(s string)   { fmt.Println("entering:", s) }
+func untrace(s string) { fmt.Println("leaving:", s) }
+
+// Use them like this:
+func a() {
+    trace("a")
+    defer untrace("a")
+    // do something....
+}
+
+ +

+We can do better by exploiting the fact that arguments to deferred +functions are evaluated when the defer executes. The +tracing routine can set up the argument to the untracing routine. +This example: +

+ +
+func trace(s string) string {
+    fmt.Println("entering:", s)
+    return s
+}
+
+func un(s string) {
+    fmt.Println("leaving:", s)
+}
+
+func a() {
+    defer un(trace("a"))
+    fmt.Println("in a")
+}
+
+func b() {
+    defer un(trace("b"))
+    fmt.Println("in b")
+    a()
+}
+
+func main() {
+    b()
+}
+
+ +

+prints +

+ +
+entering: b
+in b
+entering: a
+in a
+leaving: a
+leaving: b
+
+ +

+For programmers accustomed to block-level resource management from +other languages, defer may seem peculiar, but its most +interesting and powerful applications come precisely from the fact +that it's not block-based but function-based. In the section on +panic and recover we'll see another +example of its possibilities. +

+ +

Data

+ +

Allocation with new

+ +

+Go has two allocation primitives, the built-in functions +new and make. +They do different things and apply to different types, which can be confusing, +but the rules are simple. +Let's talk about new first. +It's a built-in function that allocates memory, but unlike its namesakes +in some other languages it does not initialize the memory, +it only zeros it. +That is, +new(T) allocates zeroed storage for a new item of type +T and returns its address, a value of type *T. +In Go terminology, it returns a pointer to a newly allocated zero value of type +T. +

+ +

+Since the memory returned by new is zeroed, it's helpful to arrange +when designing your data structures that the +zero value of each type can be used without further initialization. This means a user of +the data structure can create one with new and get right to +work. +For example, the documentation for bytes.Buffer states that +"the zero value for Buffer is an empty buffer ready to use." +Similarly, sync.Mutex does not +have an explicit constructor or Init method. +Instead, the zero value for a sync.Mutex +is defined to be an unlocked mutex. +

+ +

+The zero-value-is-useful property works transitively. Consider this type declaration. +

+ +
+type SyncedBuffer struct {
+    lock    sync.Mutex
+    buffer  bytes.Buffer
+}
+
+ +

+Values of type SyncedBuffer are also ready to use immediately upon allocation +or just declaration. In the next snippet, both p and v will work +correctly without further arrangement. +

+ +
+p := new(SyncedBuffer)  // type *SyncedBuffer
+var v SyncedBuffer      // type  SyncedBuffer
+
+ +

Constructors and composite literals

+ +

+Sometimes the zero value isn't good enough and an initializing +constructor is necessary, as in this example derived from +package os. +

+ +
+func NewFile(fd int, name string) *File {
+    if fd < 0 {
+        return nil
+    }
+    f := new(File)
+    f.fd = fd
+    f.name = name
+    f.dirinfo = nil
+    f.nepipe = 0
+    return f
+}
+
+ +

+There's a lot of boiler plate in there. We can simplify it +using a composite literal, which is +an expression that creates a +new instance each time it is evaluated. +

+ +
+func NewFile(fd int, name string) *File {
+    if fd < 0 {
+        return nil
+    }
+    f := File{fd, name, nil, 0}
+    return &f
+}
+
+ +

+Note that, unlike in C, it's perfectly OK to return the address of a local variable; +the storage associated with the variable survives after the function +returns. +In fact, taking the address of a composite literal +allocates a fresh instance each time it is evaluated, +so we can combine these last two lines. +

+ +
+    return &File{fd, name, nil, 0}
+
+ +

+The fields of a composite literal are laid out in order and must all be present. +However, by labeling the elements explicitly as field:value +pairs, the initializers can appear in any +order, with the missing ones left as their respective zero values. Thus we could say +

+ +
+    return &File{fd: fd, name: name}
+
+ +

+As a limiting case, if a composite literal contains no fields at all, it creates +a zero value for the type. The expressions new(File) and &File{} are equivalent. +

+ +

+Composite literals can also be created for arrays, slices, and maps, +with the field labels being indices or map keys as appropriate. +In these examples, the initializations work regardless of the values of Enone, +Eio, and Einval, as long as they are distinct. +

+ +
+a := [...]string   {Enone: "no error", Eio: "Eio", Einval: "invalid argument"}
+s := []string      {Enone: "no error", Eio: "Eio", Einval: "invalid argument"}
+m := map[int]string{Enone: "no error", Eio: "Eio", Einval: "invalid argument"}
+
+ +

Allocation with make

+ +

+Back to allocation. +The built-in function make(T, args) serves +a purpose different from new(T). +It creates slices, maps, and channels only, and it returns an initialized +(not zeroed) +value of type T (not *T). +The reason for the distinction +is that these three types represent, under the covers, references to data structures that +must be initialized before use. +A slice, for example, is a three-item descriptor +containing a pointer to the data (inside an array), the length, and the +capacity, and until those items are initialized, the slice is nil. +For slices, maps, and channels, +make initializes the internal data structure and prepares +the value for use. +For instance, +

+ +
+make([]int, 10, 100)
+
+ +

+allocates an array of 100 ints and then creates a slice +structure with length 10 and a capacity of 100 pointing at the first +10 elements of the array. +(When making a slice, the capacity can be omitted; see the section on slices +for more information.) +In contrast, new([]int) returns a pointer to a newly allocated, zeroed slice +structure, that is, a pointer to a nil slice value. +

+ +

+These examples illustrate the difference between new and +make. +

+ +
+var p *[]int = new([]int)       // allocates slice structure; *p == nil; rarely useful
+var v  []int = make([]int, 100) // the slice v now refers to a new array of 100 ints
+
+// Unnecessarily complex:
+var p *[]int = new([]int)
+*p = make([]int, 100, 100)
+
+// Idiomatic:
+v := make([]int, 100)
+
+ +

+Remember that make applies only to maps, slices and channels +and does not return a pointer. +To obtain an explicit pointer allocate with new or take the address +of a variable explicitly. +

+ +

Arrays

+ +

+Arrays are useful when planning the detailed layout of memory and sometimes +can help avoid allocation, but primarily +they are a building block for slices, the subject of the next section. +To lay the foundation for that topic, here are a few words about arrays. +

+ +

+There are major differences between the ways arrays work in Go and C. +In Go, +

+
    +
  • +Arrays are values. Assigning one array to another copies all the elements. +
  • +
  • +In particular, if you pass an array to a function, it +will receive a copy of the array, not a pointer to it. +
  • +The size of an array is part of its type. The types [10]int +and [20]int are distinct. +
  • +
+ +

+The value property can be useful but also expensive; if you want C-like behavior and efficiency, +you can pass a pointer to the array. +

+ +
+func Sum(a *[3]float64) (sum float64) {
+    for _, v := range *a {
+        sum += v
+    }
+    return
+}
+
+array := [...]float64{7.0, 8.5, 9.1}
+x := Sum(&array)  // Note the explicit address-of operator
+
+ +

+But even this style isn't idiomatic Go. +Use slices instead. +

+ +

Slices

+ +

+Slices wrap arrays to give a more general, powerful, and convenient +interface to sequences of data. Except for items with explicit +dimension such as transformation matrices, most array programming in +Go is done with slices rather than simple arrays. +

+

+Slices hold references to an underlying array, and if you assign one +slice to another, both refer to the same array. +If a function takes a slice argument, changes it makes to +the elements of the slice will be visible to the caller, analogous to +passing a pointer to the underlying array. A Read +function can therefore accept a slice argument rather than a pointer +and a count; the length within the slice sets an upper +limit of how much data to read. Here is the signature of the +Read method of the File type in package +os: +

+
+func (f *File) Read(buf []byte) (n int, err error)
+
+

+The method returns the number of bytes read and an error value, if +any. +To read into the first 32 bytes of a larger buffer +buf, slice (here used as a verb) the buffer. +

+
+    n, err := f.Read(buf[0:32])
+
+

+Such slicing is common and efficient. In fact, leaving efficiency aside for +the moment, the following snippet would also read the first 32 bytes of the buffer. +

+
+    var n int
+    var err error
+    for i := 0; i < 32; i++ {
+        nbytes, e := f.Read(buf[i:i+1])  // Read one byte.
+        if nbytes == 0 || e != nil {
+            err = e
+            break
+        }
+        n += nbytes
+    }
+
+

+The length of a slice may be changed as long as it still fits within +the limits of the underlying array; just assign it to a slice of +itself. The capacity of a slice, accessible by the built-in +function cap, reports the maximum length the slice may +assume. Here is a function to append data to a slice. If the data +exceeds the capacity, the slice is reallocated. The +resulting slice is returned. The function uses the fact that +len and cap are legal when applied to the +nil slice, and return 0. +

+
+func Append(slice, data []byte) []byte {
+    l := len(slice)
+    if l + len(data) > cap(slice) {  // reallocate
+        // Allocate double what's needed, for future growth.
+        newSlice := make([]byte, (l+len(data))*2)
+        // The copy function is predeclared and works for any slice type.
+        copy(newSlice, slice)
+        slice = newSlice
+    }
+    slice = slice[0:l+len(data)]
+    for i, c := range data {
+        slice[l+i] = c
+    }
+    return slice
+}
+
+

+We must return the slice afterwards because, although Append +can modify the elements of slice, the slice itself (the run-time data +structure holding the pointer, length, and capacity) is passed by value. +

+ +

+The idea of appending to a slice is so useful it's captured by the +append built-in function. To understand that function's +design, though, we need a little more information, so we'll return +to it later. +

+ +

Two-dimensional slices

+ +

+Go's arrays and slices are one-dimensional. +To create the equivalent of a 2D array or slice, it is necessary to define an array-of-arrays +or slice-of-slices, like this: +

+ +
+type Transform [3][3]float64  // A 3x3 array, really an array of arrays.
+type LinesOfText [][]byte     // A slice of byte slices.
+
+ +

+Because slices are variable-length, it is possible to have each inner +slice be a different length. +That can be a common situation, as in our LinesOfText +example: each line has an independent length. +

+ +
+text := LinesOfText{
+	[]byte("Now is the time"),
+	[]byte("for all good gophers"),
+	[]byte("to bring some fun to the party."),
+}
+
+ +

+Sometimes it's necessary to allocate a 2D slice, a situation that can arise when +processing scan lines of pixels, for instance. +There are two ways to achieve this. +One is to allocate each slice independently; the other +is to allocate a single array and point the individual slices into it. +Which to use depends on your application. +If the slices might grow or shrink, they should be allocated independently +to avoid overwriting the next line; if not, it can be more efficient to construct +the object with a single allocation. +For reference, here are sketches of the two methods. +First, a line at a time: +

+ +
+// Allocate the top-level slice.
+picture := make([][]uint8, YSize) // One row per unit of y.
+// Loop over the rows, allocating the slice for each row.
+for i := range picture {
+	picture[i] = make([]uint8, XSize)
+}
+
+ +

+And now as one allocation, sliced into lines: +

+ +
+// Allocate the top-level slice, the same as before.
+picture := make([][]uint8, YSize) // One row per unit of y.
+// Allocate one large slice to hold all the pixels.
+pixels := make([]uint8, XSize*YSize) // Has type []uint8 even though picture is [][]uint8.
+// Loop over the rows, slicing each row from the front of the remaining pixels slice.
+for i := range picture {
+	picture[i], pixels = pixels[:XSize], pixels[XSize:]
+}
+
+ +

Maps

+ +

+Maps are a convenient and powerful built-in data structure that associate +values of one type (the key) with values of another type +(the element or value) +The key can be of any type for which the equality operator is defined, +such as integers, +floating point and complex numbers, +strings, pointers, interfaces (as long as the dynamic type +supports equality), structs and arrays. +Slices cannot be used as map keys, +because equality is not defined on them. +Like slices, maps hold references to an underlying data structure. +If you pass a map to a function +that changes the contents of the map, the changes will be visible +in the caller. +

+

+Maps can be constructed using the usual composite literal syntax +with colon-separated key-value pairs, +so it's easy to build them during initialization. +

+
+var timeZone = map[string]int{
+    "UTC":  0*60*60,
+    "EST": -5*60*60,
+    "CST": -6*60*60,
+    "MST": -7*60*60,
+    "PST": -8*60*60,
+}
+
+

+Assigning and fetching map values looks syntactically just like +doing the same for arrays and slices except that the index doesn't +need to be an integer. +

+
+offset := timeZone["EST"]
+
+

+An attempt to fetch a map value with a key that +is not present in the map will return the zero value for the type +of the entries +in the map. For instance, if the map contains integers, looking +up a non-existent key will return 0. +A set can be implemented as a map with value type bool. +Set the map entry to true to put the value in the set, and then +test it by simple indexing. +

+
+attended := map[string]bool{
+    "Ann": true,
+    "Joe": true,
+    ...
+}
+
+if attended[person] { // will be false if person is not in the map
+    fmt.Println(person, "was at the meeting")
+}
+
+

+Sometimes you need to distinguish a missing entry from +a zero value. Is there an entry for "UTC" +or is that the empty string because it's not in the map at all? +You can discriminate with a form of multiple assignment. +

+
+var seconds int
+var ok bool
+seconds, ok = timeZone[tz]
+
+

+For obvious reasons this is called the “comma ok” idiom. +In this example, if tz is present, seconds +will be set appropriately and ok will be true; if not, +seconds will be set to zero and ok will +be false. +Here's a function that puts it together with a nice error report: +

+
+func offset(tz string) int {
+    if seconds, ok := timeZone[tz]; ok {
+        return seconds
+    }
+    log.Println("unknown time zone:", tz)
+    return 0
+}
+
+

+To test for presence in the map without worrying about the actual value, +you can use the blank identifier (_) +in place of the usual variable for the value. +

+
+_, present := timeZone[tz]
+
+

+To delete a map entry, use the delete +built-in function, whose arguments are the map and the key to be deleted. +It's safe to do this even if the key is already absent +from the map. +

+
+delete(timeZone, "PDT")  // Now on Standard Time
+
+ +

Printing

+ +

+Formatted printing in Go uses a style similar to C's printf +family but is richer and more general. The functions live in the fmt +package and have capitalized names: fmt.Printf, fmt.Fprintf, +fmt.Sprintf and so on. The string functions (Sprintf etc.) +return a string rather than filling in a provided buffer. +

+

+You don't need to provide a format string. For each of Printf, +Fprintf and Sprintf there is another pair +of functions, for instance Print and Println. +These functions do not take a format string but instead generate a default +format for each argument. The Println versions also insert a blank +between arguments and append a newline to the output while +the Print versions add blanks only if the operand on neither side is a string. +In this example each line produces the same output. +

+
+fmt.Printf("Hello %d\n", 23)
+fmt.Fprint(os.Stdout, "Hello ", 23, "\n")
+fmt.Println("Hello", 23)
+fmt.Println(fmt.Sprint("Hello ", 23))
+
+

+The formatted print functions fmt.Fprint +and friends take as a first argument any object +that implements the io.Writer interface; the variables os.Stdout +and os.Stderr are familiar instances. +

+

+Here things start to diverge from C. First, the numeric formats such as %d +do not take flags for signedness or size; instead, the printing routines use the +type of the argument to decide these properties. +

+
+var x uint64 = 1<<64 - 1
+fmt.Printf("%d %x; %d %x\n", x, x, int64(x), int64(x))
+
+

+prints +

+
+18446744073709551615 ffffffffffffffff; -1 -1
+
+

+If you just want the default conversion, such as decimal for integers, you can use +the catchall format %v (for “value”); the result is exactly +what Print and Println would produce. +Moreover, that format can print any value, even arrays, slices, structs, and +maps. Here is a print statement for the time zone map defined in the previous section. +

+
+fmt.Printf("%v\n", timeZone)  // or just fmt.Println(timeZone)
+
+

+which gives output +

+
+map[CST:-21600 PST:-28800 EST:-18000 UTC:0 MST:-25200]
+
+

+For maps the keys may be output in any order, of course. +When printing a struct, the modified format %+v annotates the +fields of the structure with their names, and for any value the alternate +format %#v prints the value in full Go syntax. +

+
+type T struct {
+    a int
+    b float64
+    c string
+}
+t := &T{ 7, -2.35, "abc\tdef" }
+fmt.Printf("%v\n", t)
+fmt.Printf("%+v\n", t)
+fmt.Printf("%#v\n", t)
+fmt.Printf("%#v\n", timeZone)
+
+

+prints +

+
+&{7 -2.35 abc   def}
+&{a:7 b:-2.35 c:abc     def}
+&main.T{a:7, b:-2.35, c:"abc\tdef"}
+map[string] int{"CST":-21600, "PST":-28800, "EST":-18000, "UTC":0, "MST":-25200}
+
+

+(Note the ampersands.) +That quoted string format is also available through %q when +applied to a value of type string or []byte. +The alternate format %#q will use backquotes instead if possible. +(The %q format also applies to integers and runes, producing a +single-quoted rune constant.) +Also, %x works on strings, byte arrays and byte slices as well as +on integers, generating a long hexadecimal string, and with +a space in the format (% x) it puts spaces between the bytes. +

+

+Another handy format is %T, which prints the type of a value. +

+
+fmt.Printf("%T\n", timeZone)
+
+

+prints +

+
+map[string] int
+
+

+If you want to control the default format for a custom type, all that's required is to define +a method with the signature String() string on the type. +For our simple type T, that might look like this. +

+
+func (t *T) String() string {
+    return fmt.Sprintf("%d/%g/%q", t.a, t.b, t.c)
+}
+fmt.Printf("%v\n", t)
+
+

+to print in the format +

+
+7/-2.35/"abc\tdef"
+
+

+(If you need to print values of type T as well as pointers to T, +the receiver for String must be of value type; this example used a pointer because +that's more efficient and idiomatic for struct types. +See the section below on pointers vs. value receivers for more information.) +

+ +

+Our String method is able to call Sprintf because the +print routines are fully reentrant and can be wrapped this way. +There is one important detail to understand about this approach, +however: don't construct a String method by calling +Sprintf in a way that will recur into your String +method indefinitely. This can happen if the Sprintf +call attempts to print the receiver directly as a string, which in +turn will invoke the method again. It's a common and easy mistake +to make, as this example shows. +

+ +
+type MyString string
+
+func (m MyString) String() string {
+    return fmt.Sprintf("MyString=%s", m) // Error: will recur forever.
+}
+
+ +

+It's also easy to fix: convert the argument to the basic string type, which does not have the +method. +

+ +
+type MyString string
+func (m MyString) String() string {
+    return fmt.Sprintf("MyString=%s", string(m)) // OK: note conversion.
+}
+
+ +

+In the initialization section we'll see another technique that avoids this recursion. +

+ +

+Another printing technique is to pass a print routine's arguments directly to another such routine. +The signature of Printf uses the type ...interface{} +for its final argument to specify that an arbitrary number of parameters (of arbitrary type) +can appear after the format. +

+
+func Printf(format string, v ...interface{}) (n int, err error) {
+
+

+Within the function Printf, v acts like a variable of type +[]interface{} but if it is passed to another variadic function, it acts like +a regular list of arguments. +Here is the implementation of the +function log.Println we used above. It passes its arguments directly to +fmt.Sprintln for the actual formatting. +

+
+// Println prints to the standard logger in the manner of fmt.Println.
+func Println(v ...interface{}) {
+    std.Output(2, fmt.Sprintln(v...))  // Output takes parameters (int, string)
+}
+
+

+We write ... after v in the nested call to Sprintln to tell the +compiler to treat v as a list of arguments; otherwise it would just pass +v as a single slice argument. +

+

+There's even more to printing than we've covered here. See the godoc documentation +for package fmt for the details. +

+

+By the way, a ... parameter can be of a specific type, for instance ...int +for a min function that chooses the least of a list of integers: +

+
+func Min(a ...int) int {
+    min := int(^uint(0) >> 1)  // largest int
+    for _, i := range a {
+        if i < min {
+            min = i
+        }
+    }
+    return min
+}
+
+ +

Append

+

+Now we have the missing piece we needed to explain the design of +the append built-in function. The signature of append +is different from our custom Append function above. +Schematically, it's like this: +

+
+func append(slice []T, elements ...T) []T
+
+

+where T is a placeholder for any given type. You can't +actually write a function in Go where the type T +is determined by the caller. +That's why append is built in: it needs support from the +compiler. +

+

+What append does is append the elements to the end of +the slice and return the result. The result needs to be returned +because, as with our hand-written Append, the underlying +array may change. This simple example +

+
+x := []int{1,2,3}
+x = append(x, 4, 5, 6)
+fmt.Println(x)
+
+

+prints [1 2 3 4 5 6]. So append works a +little like Printf, collecting an arbitrary number of +arguments. +

+

+But what if we wanted to do what our Append does and +append a slice to a slice? Easy: use ... at the call +site, just as we did in the call to Output above. This +snippet produces identical output to the one above. +

+
+x := []int{1,2,3}
+y := []int{4,5,6}
+x = append(x, y...)
+fmt.Println(x)
+
+

+Without that ..., it wouldn't compile because the types +would be wrong; y is not of type int. +

+ +

Initialization

+ +

+Although it doesn't look superficially very different from +initialization in C or C++, initialization in Go is more powerful. +Complex structures can be built during initialization and the ordering +issues among initialized objects, even among different packages, are handled +correctly. +

+ +

Constants

+ +

+Constants in Go are just that—constant. +They are created at compile time, even when defined as +locals in functions, +and can only be numbers, characters (runes), strings or booleans. +Because of the compile-time restriction, the expressions +that define them must be constant expressions, +evaluatable by the compiler. For instance, +1<<3 is a constant expression, while +math.Sin(math.Pi/4) is not because +the function call to math.Sin needs +to happen at run time. +

+ +

+In Go, enumerated constants are created using the iota +enumerator. Since iota can be part of an expression and +expressions can be implicitly repeated, it is easy to build intricate +sets of values. +

+{{code "/doc/progs/eff_bytesize.go" `/^type ByteSize/` `/^\)/`}} +

+The ability to attach a method such as String to any +user-defined type makes it possible for arbitrary values to format themselves +automatically for printing. +Although you'll see it most often applied to structs, this technique is also useful for +scalar types such as floating-point types like ByteSize. +

+{{code "/doc/progs/eff_bytesize.go" `/^func.*ByteSize.*String/` `/^}/`}} +

+The expression YB prints as 1.00YB, +while ByteSize(1e13) prints as 9.09TB. +

+ +

+The use here of Sprintf +to implement ByteSize's String method is safe +(avoids recurring indefinitely) not because of a conversion but +because it calls Sprintf with %f, +which is not a string format: Sprintf will only call +the String method when it wants a string, and %f +wants a floating-point value. +

+ +

Variables

+ +

+Variables can be initialized just like constants but the +initializer can be a general expression computed at run time. +

+
+var (
+    home   = os.Getenv("HOME")
+    user   = os.Getenv("USER")
+    gopath = os.Getenv("GOPATH")
+)
+
+ +

The init function

+ +

+Finally, each source file can define its own niladic init function to +set up whatever state is required. (Actually each file can have multiple +init functions.) +And finally means finally: init is called after all the +variable declarations in the package have evaluated their initializers, +and those are evaluated only after all the imported packages have been +initialized. +

+

+Besides initializations that cannot be expressed as declarations, +a common use of init functions is to verify or repair +correctness of the program state before real execution begins. +

+ +
+func init() {
+    if user == "" {
+        log.Fatal("$USER not set")
+    }
+    if home == "" {
+        home = "/home/" + user
+    }
+    if gopath == "" {
+        gopath = home + "/go"
+    }
+    // gopath may be overridden by --gopath flag on command line.
+    flag.StringVar(&gopath, "gopath", gopath, "override default GOPATH")
+}
+
+ +

Methods

+ +

Pointers vs. Values

+

+As we saw with ByteSize, +methods can be defined for any named type (except a pointer or an interface); +the receiver does not have to be a struct. +

+

+In the discussion of slices above, we wrote an Append +function. We can define it as a method on slices instead. To do +this, we first declare a named type to which we can bind the method, and +then make the receiver for the method a value of that type. +

+
+type ByteSlice []byte
+
+func (slice ByteSlice) Append(data []byte) []byte {
+    // Body exactly the same as above
+}
+
+

+This still requires the method to return the updated slice. We can +eliminate that clumsiness by redefining the method to take a +pointer to a ByteSlice as its receiver, so the +method can overwrite the caller's slice. +

+
+func (p *ByteSlice) Append(data []byte) {
+    slice := *p
+    // Body as above, without the return.
+    *p = slice
+}
+
+

+In fact, we can do even better. If we modify our function so it looks +like a standard Write method, like this, +

+
+func (p *ByteSlice) Write(data []byte) (n int, err error) {
+    slice := *p
+    // Again as above.
+    *p = slice
+    return len(data), nil
+}
+
+

+then the type *ByteSlice satisfies the standard interface +io.Writer, which is handy. For instance, we can +print into one. +

+
+    var b ByteSlice
+    fmt.Fprintf(&b, "This hour has %d days\n", 7)
+
+

+We pass the address of a ByteSlice +because only *ByteSlice satisfies io.Writer. +The rule about pointers vs. values for receivers is that value methods +can be invoked on pointers and values, but pointer methods can only be +invoked on pointers. +

+ +

+This rule arises because pointer methods can modify the receiver; invoking +them on a value would cause the method to receive a copy of the value, so +any modifications would be discarded. +The language therefore disallows this mistake. +There is a handy exception, though. When the value is addressable, the +language takes care of the common case of invoking a pointer method on a +value by inserting the address operator automatically. +In our example, the variable b is addressable, so we can call +its Write method with just b.Write. The compiler +will rewrite that to (&b).Write for us. +

+ +

+By the way, the idea of using Write on a slice of bytes +is central to the implementation of bytes.Buffer. +

+ +

Interfaces and other types

+ +

Interfaces

+

+Interfaces in Go provide a way to specify the behavior of an +object: if something can do this, then it can be used +here. We've seen a couple of simple examples already; +custom printers can be implemented by a String method +while Fprintf can generate output to anything +with a Write method. +Interfaces with only one or two methods are common in Go code, and are +usually given a name derived from the method, such as io.Writer +for something that implements Write. +

+

+A type can implement multiple interfaces. +For instance, a collection can be sorted +by the routines in package sort if it implements +sort.Interface, which contains Len(), +Less(i, j int) bool, and Swap(i, j int), +and it could also have a custom formatter. +In this contrived example Sequence satisfies both. +

+{{code "/doc/progs/eff_sequence.go" `/^type/` "$"}} + +

Conversions

+ +

+The String method of Sequence is recreating the +work that Sprint already does for slices. We can share the +effort if we convert the Sequence to a plain +[]int before calling Sprint. +

+
+func (s Sequence) String() string {
+    sort.Sort(s)
+    return fmt.Sprint([]int(s))
+}
+
+

+This method is another example of the conversion technique for calling +Sprintf safely from a String method. +Because the two types (Sequence and []int) +are the same if we ignore the type name, it's legal to convert between them. +The conversion doesn't create a new value, it just temporarily acts +as though the existing value has a new type. +(There are other legal conversions, such as from integer to floating point, that +do create a new value.) +

+

+It's an idiom in Go programs to convert the +type of an expression to access a different +set of methods. As an example, we could use the existing +type sort.IntSlice to reduce the entire example +to this: +

+
+type Sequence []int
+
+// Method for printing - sorts the elements before printing
+func (s Sequence) String() string {
+    sort.IntSlice(s).Sort()
+    return fmt.Sprint([]int(s))
+}
+
+

+Now, instead of having Sequence implement multiple +interfaces (sorting and printing), we're using the ability of a data item to be +converted to multiple types (Sequence, sort.IntSlice +and []int), each of which does some part of the job. +That's more unusual in practice but can be effective. +

+ +

Interface conversions and type assertions

+ +

+Type switches are a form of conversion: they take an interface and, for +each case in the switch, in a sense convert it to the type of that case. +Here's a simplified version of how the code under fmt.Printf turns a value into +a string using a type switch. +If it's already a string, we want the actual string value held by the interface, while if it has a +String method we want the result of calling the method. +

+ +
+type Stringer interface {
+    String() string
+}
+
+var value interface{} // Value provided by caller.
+switch str := value.(type) {
+case string:
+    return str
+case Stringer:
+    return str.String()
+}
+
+ +

+The first case finds a concrete value; the second converts the interface into another interface. +It's perfectly fine to mix types this way. +

+ +

+What if there's only one type we care about? If we know the value holds a string +and we just want to extract it? +A one-case type switch would do, but so would a type assertion. +A type assertion takes an interface value and extracts from it a value of the specified explicit type. +The syntax borrows from the clause opening a type switch, but with an explicit +type rather than the type keyword: +

+ +
+value.(typeName)
+
+ +

+and the result is a new value with the static type typeName. +That type must either be the concrete type held by the interface, or a second interface +type that the value can be converted to. +To extract the string we know is in the value, we could write: +

+ +
+str := value.(string)
+
+ +

+But if it turns out that the value does not contain a string, the program will crash with a run-time error. +To guard against that, use the "comma, ok" idiom to test, safely, whether the value is a string: +

+ +
+str, ok := value.(string)
+if ok {
+    fmt.Printf("string value is: %q\n", str)
+} else {
+    fmt.Printf("value is not a string\n")
+}
+
+ +

+If the type assertion fails, str will still exist and be of type string, but it will have +the zero value, an empty string. +

+ +

+As an illustration of the capability, here's an if-else +statement that's equivalent to the type switch that opened this section. +

+ +
+if str, ok := value.(string); ok {
+    return str
+} else if str, ok := value.(Stringer); ok {
+    return str.String()
+}
+
+ +

Generality

+

+If a type exists only to implement an interface +and has no exported methods beyond that interface, +there is no need to export the type itself. +Exporting just the interface makes it clear that +it's the behavior that matters, not the implementation, +and that other implementations with different properties +can mirror the behavior of the original type. +It also avoids the need to repeat the documentation +on every instance of a common method. +

+

+In such cases, the constructor should return an interface value +rather than the implementing type. +As an example, in the hash libraries +both crc32.NewIEEE and adler32.New +return the interface type hash.Hash32. +Substituting the CRC-32 algorithm for Adler-32 in a Go program +requires only changing the constructor call; +the rest of the code is unaffected by the change of algorithm. +

+

+A similar approach allows the streaming cipher algorithms +in the various crypto packages to be +separated from the block ciphers they chain together. +The Block interface +in the crypto/cipher package specifies the +behavior of a block cipher, which provides encryption +of a single block of data. +Then, by analogy with the bufio package, +cipher packages that implement this interface +can be used to construct streaming ciphers, represented +by the Stream interface, without +knowing the details of the block encryption. +

+

+The crypto/cipher interfaces look like this: +

+
+type Block interface {
+    BlockSize() int
+    Encrypt(src, dst []byte)
+    Decrypt(src, dst []byte)
+}
+
+type Stream interface {
+    XORKeyStream(dst, src []byte)
+}
+
+ +

+Here's the definition of the counter mode (CTR) stream, +which turns a block cipher into a streaming cipher; notice +that the block cipher's details are abstracted away: +

+ +
+// NewCTR returns a Stream that encrypts/decrypts using the given Block in
+// counter mode. The length of iv must be the same as the Block's block size.
+func NewCTR(block Block, iv []byte) Stream
+
+

+NewCTR applies not +just to one specific encryption algorithm and data source but to any +implementation of the Block interface and any +Stream. Because they return +interface values, replacing CTR +encryption with other encryption modes is a localized change. The constructor +calls must be edited, but because the surrounding code must treat the result only +as a Stream, it won't notice the difference. +

+ +

Interfaces and methods

+

+Since almost anything can have methods attached, almost anything can +satisfy an interface. One illustrative example is in the http +package, which defines the Handler interface. Any object +that implements Handler can serve HTTP requests. +

+
+type Handler interface {
+    ServeHTTP(ResponseWriter, *Request)
+}
+
+

+ResponseWriter is itself an interface that provides access +to the methods needed to return the response to the client. +Those methods include the standard Write method, so an +http.ResponseWriter can be used wherever an io.Writer +can be used. +Request is a struct containing a parsed representation +of the request from the client. +

+

+For brevity, let's ignore POSTs and assume HTTP requests are always +GETs; that simplification does not affect the way the handlers are +set up. Here's a trivial but complete implementation of a handler to +count the number of times the +page is visited. +

+
+// Simple counter server.
+type Counter struct {
+    n int
+}
+
+func (ctr *Counter) ServeHTTP(w http.ResponseWriter, req *http.Request) {
+    ctr.n++
+    fmt.Fprintf(w, "counter = %d\n", ctr.n)
+}
+
+

+(Keeping with our theme, note how Fprintf can print to an +http.ResponseWriter.) +For reference, here's how to attach such a server to a node on the URL tree. +

+
+import "net/http"
+...
+ctr := new(Counter)
+http.Handle("/counter", ctr)
+
+

+But why make Counter a struct? An integer is all that's needed. +(The receiver needs to be a pointer so the increment is visible to the caller.) +

+
+// Simpler counter server.
+type Counter int
+
+func (ctr *Counter) ServeHTTP(w http.ResponseWriter, req *http.Request) {
+    *ctr++
+    fmt.Fprintf(w, "counter = %d\n", *ctr)
+}
+
+

+What if your program has some internal state that needs to be notified that a page +has been visited? Tie a channel to the web page. +

+
+// A channel that sends a notification on each visit.
+// (Probably want the channel to be buffered.)
+type Chan chan *http.Request
+
+func (ch Chan) ServeHTTP(w http.ResponseWriter, req *http.Request) {
+    ch <- req
+    fmt.Fprint(w, "notification sent")
+}
+
+

+Finally, let's say we wanted to present on /args the arguments +used when invoking the server binary. +It's easy to write a function to print the arguments. +

+
+func ArgServer() {
+    fmt.Println(os.Args)
+}
+
+

+How do we turn that into an HTTP server? We could make ArgServer +a method of some type whose value we ignore, but there's a cleaner way. +Since we can define a method for any type except pointers and interfaces, +we can write a method for a function. +The http package contains this code: +

+
+// The HandlerFunc type is an adapter to allow the use of
+// ordinary functions as HTTP handlers.  If f is a function
+// with the appropriate signature, HandlerFunc(f) is a
+// Handler object that calls f.
+type HandlerFunc func(ResponseWriter, *Request)
+
+// ServeHTTP calls f(c, req).
+func (f HandlerFunc) ServeHTTP(w ResponseWriter, req *Request) {
+    f(w, req)
+}
+
+

+HandlerFunc is a type with a method, ServeHTTP, +so values of that type can serve HTTP requests. Look at the implementation +of the method: the receiver is a function, f, and the method +calls f. That may seem odd but it's not that different from, say, +the receiver being a channel and the method sending on the channel. +

+

+To make ArgServer into an HTTP server, we first modify it +to have the right signature. +

+
+// Argument server.
+func ArgServer(w http.ResponseWriter, req *http.Request) {
+    fmt.Fprintln(w, os.Args)
+}
+
+

+ArgServer now has same signature as HandlerFunc, +so it can be converted to that type to access its methods, +just as we converted Sequence to IntSlice +to access IntSlice.Sort. +The code to set it up is concise: +

+
+http.Handle("/args", http.HandlerFunc(ArgServer))
+
+

+When someone visits the page /args, +the handler installed at that page has value ArgServer +and type HandlerFunc. +The HTTP server will invoke the method ServeHTTP +of that type, with ArgServer as the receiver, which will in turn call +ArgServer (via the invocation f(c, req) +inside HandlerFunc.ServeHTTP). +The arguments will then be displayed. +

+

+In this section we have made an HTTP server from a struct, an integer, +a channel, and a function, all because interfaces are just sets of +methods, which can be defined for (almost) any type. +

+ +

The blank identifier

+ +

+We've mentioned the blank identifier a couple of times now, in the context of +for range loops +and maps. +The blank identifier can be assigned or declared with any value of any type, with the +value discarded harmlessly. +It's a bit like writing to the Unix /dev/null file: +it represents a write-only value +to be used as a place-holder +where a variable is needed but the actual value is irrelevant. +It has uses beyond those we've seen already. +

+ +

The blank identifier in multiple assignment

+ +

+The use of a blank identifier in a for range loop is a +special case of a general situation: multiple assignment. +

+ +

+If an assignment requires multiple values on the left side, +but one of the values will not be used by the program, +a blank identifier on the left-hand-side of +the assignment avoids the need +to create a dummy variable and makes it clear that the +value is to be discarded. +For instance, when calling a function that returns +a value and an error, but only the error is important, +use the blank identifier to discard the irrelevant value. +

+ +
+if _, err := os.Stat(path); os.IsNotExist(err) {
+	fmt.Printf("%s does not exist\n", path)
+}
+
+ +

+Occasionally you'll see code that discards the error value in order +to ignore the error; this is terrible practice. Always check error returns; +they're provided for a reason. +

+ +
+// Bad! This code will crash if path does not exist.
+fi, _ := os.Stat(path)
+if fi.IsDir() {
+    fmt.Printf("%s is a directory\n", path)
+}
+
+ +

Unused imports and variables

+ +

+It is an error to import a package or to declare a variable without using it. +Unused imports bloat the program and slow compilation, +while a variable that is initialized but not used is at least +a wasted computation and perhaps indicative of a +larger bug. +When a program is under active development, however, +unused imports and variables often arise and it can +be annoying to delete them just to have the compilation proceed, +only to have them be needed again later. +The blank identifier provides a workaround. +

+

+This half-written program has two unused imports +(fmt and io) +and an unused variable (fd), +so it will not compile, but it would be nice to see if the +code so far is correct. +

+{{code "/doc/progs/eff_unused1.go" `/package/` `$`}} +

+To silence complaints about the unused imports, use a +blank identifier to refer to a symbol from the imported package. +Similarly, assigning the unused variable fd +to the blank identifier will silence the unused variable error. +This version of the program does compile. +

+{{code "/doc/progs/eff_unused2.go" `/package/` `$`}} + +

+By convention, the global declarations to silence import errors +should come right after the imports and be commented, +both to make them easy to find and as a reminder to clean things up later. +

+ +

Import for side effect

+ +

+An unused import like fmt or io in the +previous example should eventually be used or removed: +blank assignments identify code as a work in progress. +But sometimes it is useful to import a package only for its +side effects, without any explicit use. +For example, during its init function, +the net/http/pprof +package registers HTTP handlers that provide +debugging information. It has an exported API, but +most clients need only the handler registration and +access the data through a web page. +To import the package only for its side effects, rename the package +to the blank identifier: +

+
+import _ "net/http/pprof"
+
+

+This form of import makes clear that the package is being +imported for its side effects, because there is no other possible +use of the package: in this file, it doesn't have a name. +(If it did, and we didn't use that name, the compiler would reject the program.) +

+ +

Interface checks

+ +

+As we saw in the discussion of interfaces above, +a type need not declare explicitly that it implements an interface. +Instead, a type implements the interface just by implementing the interface's methods. +In practice, most interface conversions are static and therefore checked at compile time. +For example, passing an *os.File to a function +expecting an io.Reader will not compile unless +*os.File implements the io.Reader interface. +

+ +

+Some interface checks do happen at run-time, though. +One instance is in the encoding/json +package, which defines a Marshaler +interface. When the JSON encoder receives a value that implements that interface, +the encoder invokes the value's marshaling method to convert it to JSON +instead of doing the standard conversion. +The encoder checks this property at run time with a type assertion like: +

+ +
+m, ok := val.(json.Marshaler)
+
+ +

+If it's necessary only to ask whether a type implements an interface, without +actually using the interface itself, perhaps as part of an error check, use the blank +identifier to ignore the type-asserted value: +

+ +
+if _, ok := val.(json.Marshaler); ok {
+    fmt.Printf("value %v of type %T implements json.Marshaler\n", val, val)
+}
+
+ +

+One place this situation arises is when it is necessary to guarantee within the package implementing the type that +it actually satisfies the interface. +If a type—for example, +json.RawMessage—needs +a custom JSON representation, it should implement +json.Marshaler, but there are no static conversions that would +cause the compiler to verify this automatically. +If the type inadvertently fails to satisfy the interface, the JSON encoder will still work, +but will not use the custom implementation. +To guarantee that the implementation is correct, +a global declaration using the blank identifier can be used in the package: +

+
+var _ json.Marshaler = (*RawMessage)(nil)
+
+

+In this declaration, the assignment involving a conversion of a +*RawMessage to a Marshaler +requires that *RawMessage implements Marshaler, +and that property will be checked at compile time. +Should the json.Marshaler interface change, this package +will no longer compile and we will be on notice that it needs to be updated. +

+ +

+The appearance of the blank identifier in this construct indicates that +the declaration exists only for the type checking, +not to create a variable. +Don't do this for every type that satisfies an interface, though. +By convention, such declarations are only used +when there are no static conversions already present in the code, +which is a rare event. +

+ + +

Embedding

+ +

+Go does not provide the typical, type-driven notion of subclassing, +but it does have the ability to “borrow” pieces of an +implementation by embedding types within a struct or +interface. +

+

+Interface embedding is very simple. +We've mentioned the io.Reader and io.Writer interfaces before; +here are their definitions. +

+
+type Reader interface {
+    Read(p []byte) (n int, err error)
+}
+
+type Writer interface {
+    Write(p []byte) (n int, err error)
+}
+
+

+The io package also exports several other interfaces +that specify objects that can implement several such methods. +For instance, there is io.ReadWriter, an interface +containing both Read and Write. +We could specify io.ReadWriter by listing the +two methods explicitly, but it's easier and more evocative +to embed the two interfaces to form the new one, like this: +

+
+// ReadWriter is the interface that combines the Reader and Writer interfaces.
+type ReadWriter interface {
+    Reader
+    Writer
+}
+
+

+This says just what it looks like: A ReadWriter can do +what a Reader does and what a Writer +does; it is a union of the embedded interfaces (which must be disjoint +sets of methods). +Only interfaces can be embedded within interfaces. +

+

+The same basic idea applies to structs, but with more far-reaching +implications. The bufio package has two struct types, +bufio.Reader and bufio.Writer, each of +which of course implements the analogous interfaces from package +io. +And bufio also implements a buffered reader/writer, +which it does by combining a reader and a writer into one struct +using embedding: it lists the types within the struct +but does not give them field names. +

+
+// ReadWriter stores pointers to a Reader and a Writer.
+// It implements io.ReadWriter.
+type ReadWriter struct {
+    *Reader  // *bufio.Reader
+    *Writer  // *bufio.Writer
+}
+
+

+The embedded elements are pointers to structs and of course +must be initialized to point to valid structs before they +can be used. +The ReadWriter struct could be written as +

+
+type ReadWriter struct {
+    reader *Reader
+    writer *Writer
+}
+
+

+but then to promote the methods of the fields and to +satisfy the io interfaces, we would also need +to provide forwarding methods, like this: +

+
+func (rw *ReadWriter) Read(p []byte) (n int, err error) {
+    return rw.reader.Read(p)
+}
+
+

+By embedding the structs directly, we avoid this bookkeeping. +The methods of embedded types come along for free, which means that bufio.ReadWriter +not only has the methods of bufio.Reader and bufio.Writer, +it also satisfies all three interfaces: +io.Reader, +io.Writer, and +io.ReadWriter. +

+

+There's an important way in which embedding differs from subclassing. When we embed a type, +the methods of that type become methods of the outer type, +but when they are invoked the receiver of the method is the inner type, not the outer one. +In our example, when the Read method of a bufio.ReadWriter is +invoked, it has exactly the same effect as the forwarding method written out above; +the receiver is the reader field of the ReadWriter, not the +ReadWriter itself. +

+

+Embedding can also be a simple convenience. +This example shows an embedded field alongside a regular, named field. +

+
+type Job struct {
+    Command string
+    *log.Logger
+}
+
+

+The Job type now has the Log, Logf +and other +methods of *log.Logger. We could have given the Logger +a field name, of course, but it's not necessary to do so. And now, once +initialized, we can +log to the Job: +

+
+job.Log("starting now...")
+
+

+The Logger is a regular field of the Job struct, +so we can initialize it in the usual way inside the constructor for Job, like this, +

+
+func NewJob(command string, logger *log.Logger) *Job {
+    return &Job{command, logger}
+}
+
+

+or with a composite literal, +

+
+job := &Job{command, log.New(os.Stderr, "Job: ", log.Ldate)}
+
+

+If we need to refer to an embedded field directly, the type name of the field, +ignoring the package qualifier, serves as a field name, as it did +in the Read method of our ReaderWriter struct. +Here, if we needed to access the +*log.Logger of a Job variable job, +we would write job.Logger, +which would be useful if we wanted to refine the methods of Logger. +

+
+func (job *Job) Logf(format string, args ...interface{}) {
+    job.Logger.Logf("%q: %s", job.Command, fmt.Sprintf(format, args...))
+}
+
+

+Embedding types introduces the problem of name conflicts but the rules to resolve +them are simple. +First, a field or method X hides any other item X in a more deeply +nested part of the type. +If log.Logger contained a field or method called Command, the Command field +of Job would dominate it. +

+

+Second, if the same name appears at the same nesting level, it is usually an error; +it would be erroneous to embed log.Logger if the Job struct +contained another field or method called Logger. +However, if the duplicate name is never mentioned in the program outside the type definition, it is OK. +This qualification provides some protection against changes made to types embedded from outside; there +is no problem if a field is added that conflicts with another field in another subtype if neither field +is ever used. +

+ + +

Concurrency

+ +

Share by communicating

+ +

+Concurrent programming is a large topic and there is space only for some +Go-specific highlights here. +

+

+Concurrent programming in many environments is made difficult by the +subtleties required to implement correct access to shared variables. Go encourages +a different approach in which shared values are passed around on channels +and, in fact, never actively shared by separate threads of execution. +Only one goroutine has access to the value at any given time. +Data races cannot occur, by design. +To encourage this way of thinking we have reduced it to a slogan: +

+
+Do not communicate by sharing memory; +instead, share memory by communicating. +
+

+This approach can be taken too far. Reference counts may be best done +by putting a mutex around an integer variable, for instance. But as a +high-level approach, using channels to control access makes it easier +to write clear, correct programs. +

+

+One way to think about this model is to consider a typical single-threaded +program running on one CPU. It has no need for synchronization primitives. +Now run another such instance; it too needs no synchronization. Now let those +two communicate; if the communication is the synchronizer, there's still no need +for other synchronization. Unix pipelines, for example, fit this model +perfectly. Although Go's approach to concurrency originates in Hoare's +Communicating Sequential Processes (CSP), +it can also be seen as a type-safe generalization of Unix pipes. +

+ +

Goroutines

+ +

+They're called goroutines because the existing +terms—threads, coroutines, processes, and so on—convey +inaccurate connotations. A goroutine has a simple model: it is a +function executing concurrently with other goroutines in the same +address space. It is lightweight, costing little more than the +allocation of stack space. +And the stacks start small, so they are cheap, and grow +by allocating (and freeing) heap storage as required. +

+

+Goroutines are multiplexed onto multiple OS threads so if one should +block, such as while waiting for I/O, others continue to run. Their +design hides many of the complexities of thread creation and +management. +

+

+Prefix a function or method call with the go +keyword to run the call in a new goroutine. +When the call completes, the goroutine +exits, silently. (The effect is similar to the Unix shell's +& notation for running a command in the +background.) +

+
+go list.Sort()  // run list.Sort concurrently; don't wait for it.
+
+

+A function literal can be handy in a goroutine invocation. +

+
+func Announce(message string, delay time.Duration) {
+    go func() {
+        time.Sleep(delay)
+        fmt.Println(message)
+    }()  // Note the parentheses - must call the function.
+}
+
+

+In Go, function literals are closures: the implementation makes +sure the variables referred to by the function survive as long as they are active. +

+

+These examples aren't too practical because the functions have no way of signaling +completion. For that, we need channels. +

+ +

Channels

+ +

+Like maps, channels are allocated with make, and +the resulting value acts as a reference to an underlying data structure. +If an optional integer parameter is provided, it sets the buffer size for the channel. +The default is zero, for an unbuffered or synchronous channel. +

+
+ci := make(chan int)            // unbuffered channel of integers
+cj := make(chan int, 0)         // unbuffered channel of integers
+cs := make(chan *os.File, 100)  // buffered channel of pointers to Files
+
+

+Unbuffered channels combine communication—the exchange of a value—with +synchronization—guaranteeing that two calculations (goroutines) are in +a known state. +

+

+There are lots of nice idioms using channels. Here's one to get us started. +In the previous section we launched a sort in the background. A channel +can allow the launching goroutine to wait for the sort to complete. +

+
+c := make(chan int)  // Allocate a channel.
+// Start the sort in a goroutine; when it completes, signal on the channel.
+go func() {
+    list.Sort()
+    c <- 1  // Send a signal; value does not matter.
+}()
+doSomethingForAWhile()
+<-c   // Wait for sort to finish; discard sent value.
+
+

+Receivers always block until there is data to receive. +If the channel is unbuffered, the sender blocks until the receiver has +received the value. +If the channel has a buffer, the sender blocks only until the +value has been copied to the buffer; if the buffer is full, this +means waiting until some receiver has retrieved a value. +

+

+A buffered channel can be used like a semaphore, for instance to +limit throughput. In this example, incoming requests are passed +to handle, which sends a value into the channel, processes +the request, and then receives a value from the channel +to ready the “semaphore” for the next consumer. +The capacity of the channel buffer limits the number of +simultaneous calls to process. +

+
+var sem = make(chan int, MaxOutstanding)
+
+func handle(r *Request) {
+    sem <- 1    // Wait for active queue to drain.
+    process(r)  // May take a long time.
+    <-sem       // Done; enable next request to run.
+}
+
+func Serve(queue chan *Request) {
+    for {
+        req := <-queue
+        go handle(req)  // Don't wait for handle to finish.
+    }
+}
+
+ +

+Once MaxOutstanding handlers are executing process, +any more will block trying to send into the filled channel buffer, +until one of the existing handlers finishes and receives from the buffer. +

+ +

+This design has a problem, though: Serve +creates a new goroutine for +every incoming request, even though only MaxOutstanding +of them can run at any moment. +As a result, the program can consume unlimited resources if the requests come in too fast. +We can address that deficiency by changing Serve to +gate the creation of the goroutines. +Here's an obvious solution, but beware it has a bug we'll fix subsequently: +

+ +
+func Serve(queue chan *Request) {
+    for req := range queue {
+        sem <- 1
+        go func() {
+            process(req) // Buggy; see explanation below.
+            <-sem
+        }()
+    }
+}
+ +

+The bug is that in a Go for loop, the loop variable +is reused for each iteration, so the req +variable is shared across all goroutines. +That's not what we want. +We need to make sure that req is unique for each goroutine. +Here's one way to do that, passing the value of req as an argument +to the closure in the goroutine: +

+ +
+func Serve(queue chan *Request) {
+    for req := range queue {
+        sem <- 1
+        go func(req *Request) {
+            process(req)
+            <-sem
+        }(req)
+    }
+}
+ +

+Compare this version with the previous to see the difference in how +the closure is declared and run. +Another solution is just to create a new variable with the same +name, as in this example: +

+ +
+func Serve(queue chan *Request) {
+    for req := range queue {
+        req := req // Create new instance of req for the goroutine.
+        sem <- 1
+        go func() {
+            process(req)
+            <-sem
+        }()
+    }
+}
+ +

+It may seem odd to write +

+ +
+req := req
+
+ +

+but it's legal and idiomatic in Go to do this. +You get a fresh version of the variable with the same name, deliberately +shadowing the loop variable locally but unique to each goroutine. +

+ +

+Going back to the general problem of writing the server, +another approach that manages resources well is to start a fixed +number of handle goroutines all reading from the request +channel. +The number of goroutines limits the number of simultaneous +calls to process. +This Serve function also accepts a channel on which +it will be told to exit; after launching the goroutines it blocks +receiving from that channel. +

+ +
+func handle(queue chan *Request) {
+    for r := range queue {
+        process(r)
+    }
+}
+
+func Serve(clientRequests chan *Request, quit chan bool) {
+    // Start handlers
+    for i := 0; i < MaxOutstanding; i++ {
+        go handle(clientRequests)
+    }
+    <-quit  // Wait to be told to exit.
+}
+
+ +

Channels of channels

+

+One of the most important properties of Go is that +a channel is a first-class value that can be allocated and passed +around like any other. A common use of this property is +to implement safe, parallel demultiplexing. +

+

+In the example in the previous section, handle was +an idealized handler for a request but we didn't define the +type it was handling. If that type includes a channel on which +to reply, each client can provide its own path for the answer. +Here's a schematic definition of type Request. +

+
+type Request struct {
+    args        []int
+    f           func([]int) int
+    resultChan  chan int
+}
+
+

+The client provides a function and its arguments, as well as +a channel inside the request object on which to receive the answer. +

+
+func sum(a []int) (s int) {
+    for _, v := range a {
+        s += v
+    }
+    return
+}
+
+request := &Request{[]int{3, 4, 5}, sum, make(chan int)}
+// Send request
+clientRequests <- request
+// Wait for response.
+fmt.Printf("answer: %d\n", <-request.resultChan)
+
+

+On the server side, the handler function is the only thing that changes. +

+
+func handle(queue chan *Request) {
+    for req := range queue {
+        req.resultChan <- req.f(req.args)
+    }
+}
+
+

+There's clearly a lot more to do to make it realistic, but this +code is a framework for a rate-limited, parallel, non-blocking RPC +system, and there's not a mutex in sight. +

+ +

Parallelization

+

+Another application of these ideas is to parallelize a calculation +across multiple CPU cores. If the calculation can be broken into +separate pieces that can execute independently, it can be parallelized, +with a channel to signal when each piece completes. +

+

+Let's say we have an expensive operation to perform on a vector of items, +and that the value of the operation on each item is independent, +as in this idealized example. +

+
+type Vector []float64
+
+// Apply the operation to v[i], v[i+1] ... up to v[n-1].
+func (v Vector) DoSome(i, n int, u Vector, c chan int) {
+    for ; i < n; i++ {
+        v[i] += u.Op(v[i])
+    }
+    c <- 1    // signal that this piece is done
+}
+
+

+We launch the pieces independently in a loop, one per CPU. +They can complete in any order but it doesn't matter; we just +count the completion signals by draining the channel after +launching all the goroutines. +

+
+const numCPU = 4 // number of CPU cores
+
+func (v Vector) DoAll(u Vector) {
+    c := make(chan int, numCPU)  // Buffering optional but sensible.
+    for i := 0; i < numCPU; i++ {
+        go v.DoSome(i*len(v)/numCPU, (i+1)*len(v)/numCPU, u, c)
+    }
+    // Drain the channel.
+    for i := 0; i < numCPU; i++ {
+        <-c    // wait for one task to complete
+    }
+    // All done.
+}
+
+

+Rather than create a constant value for numCPU, we can ask the runtime what +value is appropriate. +The function runtime.NumCPU +returns the number of hardware CPU cores in the machine, so we could write +

+
+var numCPU = runtime.NumCPU()
+
+

+There is also a function +runtime.GOMAXPROCS, +which reports (or sets) +the user-specified number of cores that a Go program can have running +simultaneously. +It defaults to the value of runtime.NumCPU but can be +overridden by setting the similarly named shell environment variable +or by calling the function with a positive number. Calling it with +zero just queries the value. +Therefore if we want to honor the user's resource request, we should write +

+
+var numCPU = runtime.GOMAXPROCS(0)
+
+

+Be sure not to confuse the ideas of concurrency—structuring a program +as independently executing components—and parallelism—executing +calculations in parallel for efficiency on multiple CPUs. +Although the concurrency features of Go can make some problems easy +to structure as parallel computations, Go is a concurrent language, +not a parallel one, and not all parallelization problems fit Go's model. +For a discussion of the distinction, see the talk cited in +this +blog post. + +

A leaky buffer

+ +

+The tools of concurrent programming can even make non-concurrent +ideas easier to express. Here's an example abstracted from an RPC +package. The client goroutine loops receiving data from some source, +perhaps a network. To avoid allocating and freeing buffers, it keeps +a free list, and uses a buffered channel to represent it. If the +channel is empty, a new buffer gets allocated. +Once the message buffer is ready, it's sent to the server on +serverChan. +

+
+var freeList = make(chan *Buffer, 100)
+var serverChan = make(chan *Buffer)
+
+func client() {
+    for {
+        var b *Buffer
+        // Grab a buffer if available; allocate if not.
+        select {
+        case b = <-freeList:
+            // Got one; nothing more to do.
+        default:
+            // None free, so allocate a new one.
+            b = new(Buffer)
+        }
+        load(b)              // Read next message from the net.
+        serverChan <- b      // Send to server.
+    }
+}
+
+

+The server loop receives each message from the client, processes it, +and returns the buffer to the free list. +

+
+func server() {
+    for {
+        b := <-serverChan    // Wait for work.
+        process(b)
+        // Reuse buffer if there's room.
+        select {
+        case freeList <- b:
+            // Buffer on free list; nothing more to do.
+        default:
+            // Free list full, just carry on.
+        }
+    }
+}
+
+

+The client attempts to retrieve a buffer from freeList; +if none is available, it allocates a fresh one. +The server's send to freeList puts b back +on the free list unless the list is full, in which case the +buffer is dropped on the floor to be reclaimed by +the garbage collector. +(The default clauses in the select +statements execute when no other case is ready, +meaning that the selects never block.) +This implementation builds a leaky bucket free list +in just a few lines, relying on the buffered channel and +the garbage collector for bookkeeping. +

+ +

Errors

+ +

+Library routines must often return some sort of error indication to +the caller. +As mentioned earlier, Go's multivalue return makes it +easy to return a detailed error description alongside the normal +return value. +It is good style to use this feature to provide detailed error information. +For example, as we'll see, os.Open doesn't +just return a nil pointer on failure, it also returns an +error value that describes what went wrong. +

+ +

+By convention, errors have type error, +a simple built-in interface. +

+
+type error interface {
+    Error() string
+}
+
+

+A library writer is free to implement this interface with a +richer model under the covers, making it possible not only +to see the error but also to provide some context. +As mentioned, alongside the usual *os.File +return value, os.Open also returns an +error value. +If the file is opened successfully, the error will be nil, +but when there is a problem, it will hold an +os.PathError: +

+
+// PathError records an error and the operation and
+// file path that caused it.
+type PathError struct {
+    Op string    // "open", "unlink", etc.
+    Path string  // The associated file.
+    Err error    // Returned by the system call.
+}
+
+func (e *PathError) Error() string {
+    return e.Op + " " + e.Path + ": " + e.Err.Error()
+}
+
+

+PathError's Error generates +a string like this: +

+
+open /etc/passwx: no such file or directory
+
+

+Such an error, which includes the problematic file name, the +operation, and the operating system error it triggered, is useful even +if printed far from the call that caused it; +it is much more informative than the plain +"no such file or directory". +

+ +

+When feasible, error strings should identify their origin, such as by having +a prefix naming the operation or package that generated the error. For example, in package +image, the string representation for a decoding error due to an +unknown format is "image: unknown format". +

+ +

+Callers that care about the precise error details can +use a type switch or a type assertion to look for specific +errors and extract details. For PathErrors +this might include examining the internal Err +field for recoverable failures. +

+ +
+for try := 0; try < 2; try++ {
+    file, err = os.Create(filename)
+    if err == nil {
+        return
+    }
+    if e, ok := err.(*os.PathError); ok && e.Err == syscall.ENOSPC {
+        deleteTempFiles()  // Recover some space.
+        continue
+    }
+    return
+}
+
+ +

+The second if statement here is another type assertion. +If it fails, ok will be false, and e +will be nil. +If it succeeds, ok will be true, which means the +error was of type *os.PathError, and then so is e, +which we can examine for more information about the error. +

+ +

Panic

+ +

+The usual way to report an error to a caller is to return an +error as an extra return value. The canonical +Read method is a well-known instance; it returns a byte +count and an error. But what if the error is +unrecoverable? Sometimes the program simply cannot continue. +

+ +

+For this purpose, there is a built-in function panic +that in effect creates a run-time error that will stop the program +(but see the next section). The function takes a single argument +of arbitrary type—often a string—to be printed as the +program dies. It's also a way to indicate that something impossible has +happened, such as exiting an infinite loop. +

+ + +
+// A toy implementation of cube root using Newton's method.
+func CubeRoot(x float64) float64 {
+    z := x/3   // Arbitrary initial value
+    for i := 0; i < 1e6; i++ {
+        prevz := z
+        z -= (z*z*z-x) / (3*z*z)
+        if veryClose(z, prevz) {
+            return z
+        }
+    }
+    // A million iterations has not converged; something is wrong.
+    panic(fmt.Sprintf("CubeRoot(%g) did not converge", x))
+}
+
+ +

+This is only an example but real library functions should +avoid panic. If the problem can be masked or worked +around, it's always better to let things continue to run rather +than taking down the whole program. One possible counterexample +is during initialization: if the library truly cannot set itself up, +it might be reasonable to panic, so to speak. +

+ +
+var user = os.Getenv("USER")
+
+func init() {
+    if user == "" {
+        panic("no value for $USER")
+    }
+}
+
+ +

Recover

+ +

+When panic is called, including implicitly for run-time +errors such as indexing a slice out of bounds or failing a type +assertion, it immediately stops execution of the current function +and begins unwinding the stack of the goroutine, running any deferred +functions along the way. If that unwinding reaches the top of the +goroutine's stack, the program dies. However, it is possible to +use the built-in function recover to regain control +of the goroutine and resume normal execution. +

+ +

+A call to recover stops the unwinding and returns the +argument passed to panic. Because the only code that +runs while unwinding is inside deferred functions, recover +is only useful inside deferred functions. +

+ +

+One application of recover is to shut down a failing goroutine +inside a server without killing the other executing goroutines. +

+ +
+func server(workChan <-chan *Work) {
+    for work := range workChan {
+        go safelyDo(work)
+    }
+}
+
+func safelyDo(work *Work) {
+    defer func() {
+        if err := recover(); err != nil {
+            log.Println("work failed:", err)
+        }
+    }()
+    do(work)
+}
+
+ +

+In this example, if do(work) panics, the result will be +logged and the goroutine will exit cleanly without disturbing the +others. There's no need to do anything else in the deferred closure; +calling recover handles the condition completely. +

+ +

+Because recover always returns nil unless called directly +from a deferred function, deferred code can call library routines that themselves +use panic and recover without failing. As an example, +the deferred function in safelyDo might call a logging function before +calling recover, and that logging code would run unaffected +by the panicking state. +

+ +

+With our recovery pattern in place, the do +function (and anything it calls) can get out of any bad situation +cleanly by calling panic. We can use that idea to +simplify error handling in complex software. Let's look at an +idealized version of a regexp package, which reports +parsing errors by calling panic with a local +error type. Here's the definition of Error, +an error method, and the Compile function. +

+ +
+// Error is the type of a parse error; it satisfies the error interface.
+type Error string
+func (e Error) Error() string {
+    return string(e)
+}
+
+// error is a method of *Regexp that reports parsing errors by
+// panicking with an Error.
+func (regexp *Regexp) error(err string) {
+    panic(Error(err))
+}
+
+// Compile returns a parsed representation of the regular expression.
+func Compile(str string) (regexp *Regexp, err error) {
+    regexp = new(Regexp)
+    // doParse will panic if there is a parse error.
+    defer func() {
+        if e := recover(); e != nil {
+            regexp = nil    // Clear return value.
+            err = e.(Error) // Will re-panic if not a parse error.
+        }
+    }()
+    return regexp.doParse(str), nil
+}
+
+ +

+If doParse panics, the recovery block will set the +return value to nil—deferred functions can modify +named return values. It will then check, in the assignment +to err, that the problem was a parse error by asserting +that it has the local type Error. +If it does not, the type assertion will fail, causing a run-time error +that continues the stack unwinding as though nothing had interrupted +it. +This check means that if something unexpected happens, such +as an index out of bounds, the code will fail even though we +are using panic and recover to handle +parse errors. +

+ +

+With error handling in place, the error method (because it's a +method bound to a type, it's fine, even natural, for it to have the same name +as the builtin error type) +makes it easy to report parse errors without worrying about unwinding +the parse stack by hand: +

+ +
+if pos == 0 {
+    re.error("'*' illegal at start of expression")
+}
+
+ +

+Useful though this pattern is, it should be used only within a package. +Parse turns its internal panic calls into +error values; it does not expose panics +to its client. That is a good rule to follow. +

+ +

+By the way, this re-panic idiom changes the panic value if an actual +error occurs. However, both the original and new failures will be +presented in the crash report, so the root cause of the problem will +still be visible. Thus this simple re-panic approach is usually +sufficient—it's a crash after all—but if you want to +display only the original value, you can write a little more code to +filter unexpected problems and re-panic with the original error. +That's left as an exercise for the reader. +

+ + +

A web server

+ +

+Let's finish with a complete Go program, a web server. +This one is actually a kind of web re-server. +Google provides a service at +http://chart.apis.google.com +that does automatic formatting of data into charts and graphs. +It's hard to use interactively, though, +because you need to put the data into the URL as a query. +The program here provides a nicer interface to one form of data: given a short piece of text, +it calls on the chart server to produce a QR code, a matrix of boxes that encode the +text. +That image can be grabbed with your cell phone's camera and interpreted as, +for instance, a URL, saving you typing the URL into the phone's tiny keyboard. +

+

+Here's the complete program. +An explanation follows. +

+{{code "/doc/progs/eff_qr.go" `/package/` `$`}} +

+The pieces up to main should be easy to follow. +The one flag sets a default HTTP port for our server. The template +variable templ is where the fun happens. It builds an HTML template +that will be executed by the server to display the page; more about +that in a moment. +

+

+The main function parses the flags and, using the mechanism +we talked about above, binds the function QR to the root path +for the server. Then http.ListenAndServe is called to start the +server; it blocks while the server runs. +

+

+QR just receives the request, which contains form data, and +executes the template on the data in the form value named s. +

+

+The template package html/template is powerful; +this program just touches on its capabilities. +In essence, it rewrites a piece of HTML text on the fly by substituting elements derived +from data items passed to templ.Execute, in this case the +form value. +Within the template text (templateStr), +double-brace-delimited pieces denote template actions. +The piece from {{html "{{if .}}"}} +to {{html "{{end}}"}} executes only if the value of the current data item, called . (dot), +is non-empty. +That is, when the string is empty, this piece of the template is suppressed. +

+

+The two snippets {{html "{{.}}"}} say to show the data presented to +the template—the query string—on the web page. +The HTML template package automatically provides appropriate escaping so the +text is safe to display. +

+

+The rest of the template string is just the HTML to show when the page loads. +If this is too quick an explanation, see the documentation +for the template package for a more thorough discussion. +

+

+And there you have it: a useful web server in a few lines of code plus some +data-driven HTML text. +Go is powerful enough to make a lot happen in a few lines. +

+ + + diff --git a/doc/gccgo_contribute.html b/doc/gccgo_contribute.html new file mode 100644 index 0000000000000000000000000000000000000000..dd1327ad1fe20f2eeba8040271f47c14c8ab6248 --- /dev/null +++ b/doc/gccgo_contribute.html @@ -0,0 +1,112 @@ + + +

Introduction

+ +

+These are some notes on contributing to the gccgo frontend for GCC. +For information on contributing to parts of Go other than gccgo, +see Contributing to the Go project. For +information on building gccgo for yourself, +see Setting up and using gccgo. +For more of the gritty details on the process of doing development +with the gccgo frontend, +see the +file HACKING in the gofrontend repository. +

+ +

Legal Prerequisites

+ +

+You must follow the Go copyright +rules for all changes to the gccgo frontend and the associated +libgo library. Code that is part of GCC rather than gccgo must follow +the general GCC +contribution rules. +

+ +

Code

+ +

+The master sources for the gccgo frontend may be found at +http://go.googlesource.com/gofrontend. +They are mirrored +at http://github.com/golang/gofrontend. +The master sources are not buildable by themselves, but only in +conjunction with GCC (in the future, other compilers may be +supported). Changes made to the gccgo frontend are also applied to +the GCC source code repository hosted at gcc.gnu.org. In +the gofrontend repository, the go directory +is mirrored to the gcc/go/gofrontend directory in the GCC +repository, and the gofrontend libgo +directory is mirrored to the GCC libgo directory. In +addition, the test directory +from the main Go repository +is mirrored to the gcc/testsuite/go.test/test directory +in the GCC repository. +

+ +

+Changes to these directories always flow from the master sources to +the GCC repository. The files should never be changed in the GCC +repository except by changing them in the master sources and mirroring +them. +

+ +

+The gccgo frontend is written in C++. +It follows the GNU and GCC coding standards for C++. +In writing code for the frontend, follow the formatting of the +surrounding code. +Almost all GCC-specific code is not in the frontend proper and is +instead in the GCC sources in the gcc/go directory. +

+ +

+The run-time library for gccgo is mostly the same as the library +in the main Go repository. +The library code in the Go repository is periodically merged into +the libgo/go directory of the gofrontend and +then the GCC repositories, using the shell +script libgo/merge.sh. Accordingly, most library changes +should be made in the main Go repository. The files outside +of libgo/go are gccgo-specific; that said, some of the +files in libgo/runtime are based on files +in src/runtime in the main Go repository. +

+ +

Testing

+ +

+All patches must be tested. A patch that introduces new failures is +not acceptable. +

+ +

+To run the gccgo test suite, run make check-go in your +build directory. This will run various tests +under gcc/testsuite/go.* and will also run +the libgo testsuite. This copy of the tests from the +main Go repository is run using the DejaGNU script found +in gcc/testsuite/go.test/go-test.exp. +

+ +

+Most new tests should be submitted to the main Go repository for later +mirroring into the GCC repository. If there is a need for specific +tests for gccgo, they should go in +the gcc/testsuite/go.go-torture +or gcc/testsuite/go.dg directories in the GCC repository. +

+ +

Submitting Changes

+ +

+Changes to the Go frontend should follow the same process as for the +main Go repository, only for the gofrontend project and +the gofrontend-dev@googlegroups.com mailing list +rather than the go project and the +golang-dev@googlegroups.com mailing list. Those changes +will then be merged into the GCC sources. +

diff --git a/doc/gccgo_install.html b/doc/gccgo_install.html new file mode 100644 index 0000000000000000000000000000000000000000..ef27fd1818265128e808900067fe71b47072dea1 --- /dev/null +++ b/doc/gccgo_install.html @@ -0,0 +1,540 @@ + + +

+This document explains how to use gccgo, a compiler for +the Go language. The gccgo compiler is a new frontend +for GCC, the widely used GNU compiler. Although the +frontend itself is under a BSD-style license, gccgo is +normally used as part of GCC and is then covered by +the GNU General Public +License (the license covers gccgo itself as part of GCC; it +does not cover code generated by gccgo). +

+ +

+Note that gccgo is not the gc compiler; see +the Installing Go instructions for that +compiler. +

+ +

Releases

+ +

+The simplest way to install gccgo is to install a GCC binary release +built to include Go support. GCC binary releases are available from +various +websites and are typically included as part of GNU/Linux +distributions. We expect that most people who build these binaries +will include Go support. +

+ +

+The GCC 4.7.1 release and all later 4.7 releases include a complete +Go 1 compiler and libraries. +

+ +

+Due to timing, the GCC 4.8.0 and 4.8.1 releases are close to but not +identical to Go 1.1. The GCC 4.8.2 release includes a complete Go +1.1.2 implementation. +

+ +

+The GCC 4.9 releases include a complete Go 1.2 implementation. +

+ +

+The GCC 5 releases include a complete implementation of the Go 1.4 +user libraries. The Go 1.4 runtime is not fully merged, but that +should not be visible to Go programs. +

+ +

Source code

+ +

+If you cannot use a release, or prefer to build gccgo for +yourself, +the gccgo source code is accessible via Subversion. The +GCC web site +has instructions for getting the +GCC source code. The gccgo source code is included. As a +convenience, a stable version of the Go support is available in +a branch of the main GCC code +repository: svn://gcc.gnu.org/svn/gcc/branches/gccgo. +This branch is periodically updated with stable Go compiler sources. +

+ +

+Note that although gcc.gnu.org is the most convenient way +to get the source code for the Go frontend, it is not where the master +sources live. If you want to contribute changes to the Go frontend +compiler, see Contributing to +gccgo. +

+ + +

Building

+ +

+Building gccgo is just like building GCC +with one or two additional options. See +the instructions on the gcc web +site. When you run configure, add the +option --enable-languages=c,c++,go (along with other +languages you may want to build). If you are targeting a 32-bit x86, +then you will want to build gccgo to default to +supporting locked compare and exchange instructions; do this by also +using the configure option --with-arch=i586 +(or a newer architecture, depending on where you need your programs to +run). If you are targeting a 64-bit x86, but sometimes want to use +the -m32 option, then use the configure +option --with-arch-32=i586. +

+ +

Gold

+ +

+On x86 GNU/Linux systems the gccgo compiler is able to +use a small discontiguous stack for goroutines. This permits programs +to run many more goroutines, since each goroutine can use a relatively +small stack. Doing this requires using the gold linker version 2.22 +or later. You can either install GNU binutils 2.22 or later, or you +can build gold yourself. +

+ +

+To build gold yourself, build the GNU binutils, +using --enable-gold=default when you run +the configure script. Before building, you must install +the flex and bison packages. A typical sequence would look like +this (you can replace /opt/gold with any directory to +which you have write access): +

+ +
+cvs -z 9 -d :pserver:anoncvs@sourceware.org:/cvs/src login
+[password is "anoncvs"]
+[The next command will create a directory named src, not binutils]
+cvs -z 9 -d :pserver:anoncvs@sourceware.org:/cvs/src co binutils
+mkdir binutils-objdir
+cd binutils-objdir
+../src/configure --enable-gold=default --prefix=/opt/gold
+make
+make install
+
+ +

+However you install gold, when you configure gccgo, use the +option --with-ld=GOLD_BINARY. +

+ +

Prerequisites

+ +

+A number of prerequisites are required to build GCC, as +described on +the gcc web +site. It is important to install all the prerequisites before +running the gcc configure script. +The prerequisite libraries can be conveniently downloaded using the +script contrib/download_prerequisites in the GCC sources. + +

Build commands

+ +

+Once all the prerequisites are installed, then a typical build and +install sequence would look like this (only use +the --with-ld option if you are using the gold linker as +described above): +

+ +
+svn checkout svn://gcc.gnu.org/svn/gcc/branches/gccgo gccgo
+mkdir objdir
+cd objdir
+../gccgo/configure --prefix=/opt/gccgo --enable-languages=c,c++,go --with-ld=/opt/gold/bin/ld
+make
+make install
+
+ +

A note on Ubuntu

+ +

+Current versions of Ubuntu and versions of GCC before 4.8 disagree on +where system libraries and header files are found. This is not a +gccgo issue. When building older versions of GCC, setting these +environment variables while configuring and building gccgo may fix the +problem. +

+ +
+LIBRARY_PATH=/usr/lib/x86_64-linux-gnu
+C_INCLUDE_PATH=/usr/include/x86_64-linux-gnu
+CPLUS_INCLUDE_PATH=/usr/include/x86_64-linux-gnu
+export LIBRARY_PATH C_INCLUDE_PATH CPLUS_INCLUDE_PATH
+
+ +

Using gccgo

+ +

+The gccgo compiler works like other gcc frontends. As of GCC 5 the gccgo +installation also includes a version of the go command, +which may be used to build Go programs as described at +https://golang.org/cmd/go. +

+ +

+To compile a file without using the go command: +

+ +
+gccgo -c file.go
+
+ +

+That produces file.o. To link files together to form an +executable: +

+ +
+gccgo -o file file.o
+
+ +

+To run the resulting file, you will need to tell the program where to +find the compiled Go packages. There are a few ways to do this: +

+ +
    +
  • +

    +Set the LD_LIBRARY_PATH environment variable: +

    + +
    +LD_LIBRARY_PATH=${prefix}/lib/gcc/MACHINE/VERSION
    +[or]
    +LD_LIBRARY_PATH=${prefix}/lib64/gcc/MACHINE/VERSION
    +export LD_LIBRARY_PATH
    +
    + +

    +Here ${prefix} is the --prefix option used +when building gccgo. For a binary install this is +normally /usr. Whether to use lib +or lib64 depends on the target. +Typically lib64 is correct for x86_64 systems, +and lib is correct for other systems. The idea is to +name the directory where libgo.so is found. +

    + +
  • + +
  • +

    +Passing a -Wl,-R option when you link (replace lib with +lib64 if appropriate for your system): +

    + +
    +go build -gccgoflags -Wl,-R,${prefix}/lib/gcc/MACHINE/VERSION
    +[or]
    +gccgo -o file file.o -Wl,-R,${prefix}/lib/gcc/MACHINE/VERSION
    +
    +
  • + +
  • +

    +Use the -static-libgo option to link statically against +the compiled packages. +

    +
  • + +
  • +

    +Use the -static option to do a fully static link (the +default for the gc compiler). +

    +
  • +
+ +

Options

+ +

+The gccgo compiler supports all GCC options +that are language independent, notably the -O +and -g options. +

+ +

+The -fgo-pkgpath=PKGPATH option may be used to set a +unique prefix for the package being compiled. +This option is automatically used by the go command, but you may want +to use it if you invoke gccgo directly. +This option is intended for use with large +programs that contain many packages, in order to allow multiple +packages to use the same identifier as the package name. +The PKGPATH may be any string; a good choice for the +string is the path used to import the package. +

+ +

+The -I and -L options, which are synonyms +for the compiler, may be used to set the search path for finding +imports. +These options are not needed if you build with the go command. +

+ +

Imports

+ +

+When you compile a file that exports something, the export +information will be stored directly in the object file. +If you build with gccgo directly, rather than with the go command, +then when you import a package, you must tell gccgo how to find the +file. +

+ +

+When you import the package FILE with gccgo, +it will look for the import data in the following files, and use the +first one that it finds. + +

    +
  • FILE.gox +
  • libFILE.so +
  • libFILE.a +
  • FILE.o +
+ +

+FILE.gox, when used, will typically contain +nothing but export data. This can be generated from +FILE.o via +

+ +
+objcopy -j .go_export FILE.o FILE.gox
+
+ +

+The gccgo compiler will look in the current +directory for import files. In more complex scenarios you +may pass the -I or -L option to +gccgo. Both options take directories to search. The +-L option is also passed to the linker. +

+ +

+The gccgo compiler does not currently (2015-06-15) record +the file name of imported packages in the object file. You must +arrange for the imported data to be linked into the program. +Again, this is not necessary when building with the go command. +

+ +
+gccgo -c mypackage.go              # Exports mypackage
+gccgo -c main.go                   # Imports mypackage
+gccgo -o main main.o mypackage.o   # Explicitly links with mypackage.o
+
+ +

Debugging

+ +

+If you use the -g option when you compile, you can run +gdb on your executable. The debugger has only limited +knowledge about Go. You can set breakpoints, single-step, +etc. You can print variables, but they will be printed as though they +had C/C++ types. For numeric types this doesn't matter. Go strings +and interfaces will show up as two-element structures. Go +maps and channels are always represented as C pointers to run-time +structures. +

+ +

C Interoperability

+ +

+When using gccgo there is limited interoperability with C, +or with C++ code compiled using extern "C". +

+ +

Types

+ +

+Basic types map directly: an int in Go is an int +in C, an int32 is an int32_t, +etc. Go byte is equivalent to C unsigned +char. +Pointers in Go are pointers in C. A Go struct is the same as C +struct with the same fields and types. +

+ +

+The Go string type is currently defined as a two-element +structure (this is subject to change): +

+ +
+struct __go_string {
+  const unsigned char *__data;
+  int __length;
+};
+
+ +

+You can't pass arrays between C and Go. However, a pointer to an +array in Go is equivalent to a C pointer to the +equivalent of the element type. +For example, Go *[10]int is equivalent to C int*, +assuming that the C pointer does point to 10 elements. +

+ +

+A slice in Go is a structure. The current definition is +(this is subject to change): +

+ +
+struct __go_slice {
+  void *__values;
+  int __count;
+  int __capacity;
+};
+
+ +

+The type of a Go function is a pointer to a struct (this is +subject to change). The first field in the +struct points to the code of the function, which will be equivalent to +a pointer to a C function whose parameter types are equivalent, with +an additional trailing parameter. The trailing parameter is the +closure, and the argument to pass is a pointer to the Go function +struct. + +When a Go function returns more than one value, the C function returns +a struct. For example, these functions are roughly equivalent: +

+ +
+func GoFunction(int) (int, float64)
+struct { int i; float64 f; } CFunction(int, void*)
+
+ +

+Go interface, channel, and map +types have no corresponding C type (interface is a +two-element struct and channel and map are +pointers to structs in C, but the structs are deliberately undocumented). C +enum types correspond to some integer type, but precisely +which one is difficult to predict in general; use a cast. C union +types have no corresponding Go type. C struct types containing +bitfields have no corresponding Go type. C++ class types have +no corresponding Go type. +

+ +

+Memory allocation is completely different between C and Go, as Go uses +garbage collection. The exact guidelines in this area are undetermined, +but it is likely that it will be permitted to pass a pointer to allocated +memory from C to Go. The responsibility of eventually freeing the pointer +will remain with C side, and of course if the C side frees the pointer +while the Go side still has a copy the program will fail. When passing a +pointer from Go to C, the Go function must retain a visible copy of it in +some Go variable. Otherwise the Go garbage collector may delete the +pointer while the C function is still using it. +

+ +

Function names

+ +

+Go code can call C functions directly using a Go extension implemented +in gccgo: a function declaration may be preceded by +//extern NAME. For example, here is how the C function +open can be declared in Go: +

+ +
+//extern open
+func c_open(name *byte, mode int, perm int) int
+
+ +

+The C function naturally expects a NUL-terminated string, which in +Go is equivalent to a pointer to an array (not a slice!) of +byte with a terminating zero byte. So a sample call +from Go would look like (after importing the syscall package): +

+ +
+var name = [4]byte{'f', 'o', 'o', 0};
+i := c_open(&name[0], syscall.O_RDONLY, 0);
+
+ +

+(this serves as an example only, to open a file in Go please use Go's +os.Open function instead). +

+ +

+Note that if the C function can block, such as in a call +to read, calling the C function may block the Go program. +Unless you have a clear understanding of what you are doing, all calls +between C and Go should be implemented through cgo or SWIG, as for +the gc compiler. +

+ +

+The name of Go functions accessed from C is subject to change. At present +the name of a Go function that does not have a receiver is +prefix.package.Functionname. The prefix is set by +the -fgo-prefix option used when the package is compiled; +if the option is not used, the default is go. +To call the function from C you must set the name using +a GCC extension. +

+ +
+extern int go_function(int) __asm__ ("myprefix.mypackage.Function");
+
+ +

+Automatic generation of Go declarations from C source code

+ +

+The Go version of GCC supports automatically generating +Go declarations from C code. The facility is rather awkward, and most +users should use the cgo program with +the -gccgo option instead. +

+ +

+Compile your C code as usual, and add the option +-fdump-go-spec=FILENAME. This will create the +file FILENAME as a side effect of the +compilation. This file will contain Go declarations for the types, +variables and functions declared in the C code. C types that can not +be represented in Go will be recorded as comments in the Go code. The +generated file will not have a package declaration, but +can otherwise be compiled directly by gccgo. +

+ +

+This procedure is full of unstated caveats and restrictions and we make no +guarantee that it will not change in the future. It is more useful as a +starting point for real Go code than as a regular procedure. +

+ +

RTEMS Port

+

+The gccgo compiler has been ported to +RTEMS. RTEMS is a real-time executive +that provides a high performance environment for embedded applications +on a range of processors and embedded hardware. The current gccgo +port is for x86. The goal is to extend the port to most of the + +architectures supported by RTEMS. For more information on the port, +as well as instructions on how to install it, please see this +RTEMS Wiki page. diff --git a/doc/go-logo-black.png b/doc/go-logo-black.png new file mode 100644 index 0000000000000000000000000000000000000000..3077ebdad0726b3fbf7451897cbeaa33b3cb0bb4 Binary files /dev/null and b/doc/go-logo-black.png differ diff --git a/doc/go-logo-blue.png b/doc/go-logo-blue.png new file mode 100644 index 0000000000000000000000000000000000000000..8d43a567751ce48a29c91b39afff022bd9ab6b69 Binary files /dev/null and b/doc/go-logo-blue.png differ diff --git a/doc/go-logo-white.png b/doc/go-logo-white.png new file mode 100644 index 0000000000000000000000000000000000000000..fa29169fabf7a23f9870d38fd913d9bf91f71f94 Binary files /dev/null and b/doc/go-logo-white.png differ diff --git a/doc/go1.1.html b/doc/go1.1.html new file mode 100644 index 0000000000000000000000000000000000000000..f059fd7f1f9919613dc7cec7422815eee52ad72d --- /dev/null +++ b/doc/go1.1.html @@ -0,0 +1,1099 @@ + + +

Introduction to Go 1.1

+ +

+The release of Go version 1 (Go 1 or Go 1.0 for short) +in March of 2012 introduced a new period +of stability in the Go language and libraries. +That stability has helped nourish a growing community of Go users +and systems around the world. +Several "point" releases since +then—1.0.1, 1.0.2, and 1.0.3—have been issued. +These point releases fixed known bugs but made +no non-critical changes to the implementation. +

+ +

+This new release, Go 1.1, keeps the promise +of compatibility but adds a couple of significant +(backwards-compatible, of course) language changes, has a long list +of (again, compatible) library changes, and +includes major work on the implementation of the compilers, +libraries, and run-time. +The focus is on performance. +Benchmarking is an inexact science at best, but we see significant, +sometimes dramatic speedups for many of our test programs. +We trust that many of our users' programs will also see improvements +just by updating their Go installation and recompiling. +

+ +

+This document summarizes the changes between Go 1 and Go 1.1. +Very little if any code will need modification to run with Go 1.1, +although a couple of rare error cases surface with this release +and need to be addressed if they arise. +Details appear below; see the discussion of +64-bit ints and Unicode literals +in particular. +

+ +

Changes to the language

+ +

+The Go compatibility document promises +that programs written to the Go 1 language specification will continue to operate, +and those promises are maintained. +In the interest of firming up the specification, though, there are +details about some error cases that have been clarified. +There are also some new language features. +

+ +

Integer division by zero

+ +

+In Go 1, integer division by a constant zero produced a run-time panic: +

+ +
+func f(x int) int {
+	return x/0
+}
+
+ +

+In Go 1.1, an integer division by constant zero is not a legal program, so it is a compile-time error. +

+ +

Surrogates in Unicode literals

+ +

+The definition of string and rune literals has been refined to exclude surrogate halves from the +set of valid Unicode code points. +See the Unicode section for more information. +

+ +

Method values

+ +

+Go 1.1 now implements +method values, +which are functions that have been bound to a specific receiver value. +For instance, given a +Writer +value w, +the expression +w.Write, +a method value, is a function that will always write to w; it is equivalent to +a function literal closing over w: +

+ +
+func (p []byte) (n int, err error) {
+	return w.Write(p)
+}
+
+ +

+Method values are distinct from method expressions, which generate functions +from methods of a given type; the method expression (*bufio.Writer).Write +is equivalent to a function with an extra first argument, a receiver of type +(*bufio.Writer): +

+ +
+func (w *bufio.Writer, p []byte) (n int, err error) {
+	return w.Write(p)
+}
+
+ +

+Updating: No existing code is affected; the change is strictly backward-compatible. +

+ +

Return requirements

+ +

+Before Go 1.1, a function that returned a value needed an explicit "return" +or call to panic at +the end of the function; this was a simple way to make the programmer +be explicit about the meaning of the function. But there are many cases +where a final "return" is clearly unnecessary, such as a function with +only an infinite "for" loop. +

+ +

+In Go 1.1, the rule about final "return" statements is more permissive. +It introduces the concept of a +terminating statement, +a statement that is guaranteed to be the last one a function executes. +Examples include +"for" loops with no condition and "if-else" +statements in which each half ends in a "return". +If the final statement of a function can be shown syntactically to +be a terminating statement, no final "return" statement is needed. +

+ +

+Note that the rule is purely syntactic: it pays no attention to the values in the +code and therefore requires no complex analysis. +

+ +

+Updating: The change is backward-compatible, but existing code +with superfluous "return" statements and calls to panic may +be simplified manually. +Such code can be identified by go vet. +

+ +

Changes to the implementations and tools

+ +

Status of gccgo

+ +

+The GCC release schedule does not coincide with the Go release schedule, so some skew is inevitable in +gccgo's releases. +The 4.8.0 version of GCC shipped in March, 2013 and includes a nearly-Go 1.1 version of gccgo. +Its library is a little behind the release, but the biggest difference is that method values are not implemented. +Sometime around July 2013, we expect 4.8.2 of GCC to ship with a gccgo +providing a complete Go 1.1 implementation. +

+ +

Command-line flag parsing

+ +

+In the gc tool chain, the compilers and linkers now use the +same command-line flag parsing rules as the Go flag package, a departure +from the traditional Unix flag parsing. This may affect scripts that invoke +the tool directly. +For example, +go tool 6c -Fw -Dfoo must now be written +go tool 6c -F -w -D foo. +

+ +

Size of int on 64-bit platforms

+ +

+The language allows the implementation to choose whether the int type and +uint types are 32 or 64 bits. Previous Go implementations made int +and uint 32 bits on all systems. Both the gc and gccgo implementations +now make +int and uint 64 bits on 64-bit platforms such as AMD64/x86-64. +Among other things, this enables the allocation of slices with +more than 2 billion elements on 64-bit platforms. +

+ +

+Updating: +Most programs will be unaffected by this change. +Because Go does not allow implicit conversions between distinct +numeric types, +no programs will stop compiling due to this change. +However, programs that contain implicit assumptions +that int is only 32 bits may change behavior. +For example, this code prints a positive number on 64-bit systems and +a negative one on 32-bit systems: +

+ +
+x := ^uint32(0) // x is 0xffffffff
+i := int(x)     // i is -1 on 32-bit systems, 0xffffffff on 64-bit
+fmt.Println(i)
+
+ +

Portable code intending 32-bit sign extension (yielding -1 on all systems) +would instead say: +

+ +
+i := int(int32(x))
+
+ +

Heap size on 64-bit architectures

+ +

+On 64-bit architectures, the maximum heap size has been enlarged substantially, +from a few gigabytes to several tens of gigabytes. +(The exact details depend on the system and may change.) +

+ +

+On 32-bit architectures, the heap size has not changed. +

+ +

+Updating: +This change should have no effect on existing programs beyond allowing them +to run with larger heaps. +

+ +

Unicode

+ +

+To make it possible to represent code points greater than 65535 in UTF-16, +Unicode defines surrogate halves, +a range of code points to be used only in the assembly of large values, and only in UTF-16. +The code points in that surrogate range are illegal for any other purpose. +In Go 1.1, this constraint is honored by the compiler, libraries, and run-time: +a surrogate half is illegal as a rune value, when encoded as UTF-8, or when +encoded in isolation as UTF-16. +When encountered, for example in converting from a rune to UTF-8, it is +treated as an encoding error and will yield the replacement rune, +utf8.RuneError, +U+FFFD. +

+ +

+This program, +

+ +
+import "fmt"
+
+func main() {
+    fmt.Printf("%+q\n", string(0xD800))
+}
+
+ +

+printed "\ud800" in Go 1.0, but prints "\ufffd" in Go 1.1. +

+ +

+Surrogate-half Unicode values are now illegal in rune and string constants, so constants such as +'\ud800' and "\ud800" are now rejected by the compilers. +When written explicitly as UTF-8 encoded bytes, +such strings can still be created, as in "\xed\xa0\x80". +However, when such a string is decoded as a sequence of runes, as in a range loop, it will yield only utf8.RuneError +values. +

+ +

+The Unicode byte order mark U+FEFF, encoded in UTF-8, is now permitted as the first +character of a Go source file. +Even though its appearance in the byte-order-free UTF-8 encoding is clearly unnecessary, +some editors add the mark as a kind of "magic number" identifying a UTF-8 encoded file. +

+ +

+Updating: +Most programs will be unaffected by the surrogate change. +Programs that depend on the old behavior should be modified to avoid the issue. +The byte-order-mark change is strictly backward-compatible. +

+ +

Race detector

+ +

+A major addition to the tools is a race detector, a way to +find bugs in programs caused by concurrent access of the same +variable, where at least one of the accesses is a write. +This new facility is built into the go tool. +For now, it is only available on Linux, Mac OS X, and Windows systems with +64-bit x86 processors. +To enable it, set the -race flag when building or testing your program +(for instance, go test -race). +The race detector is documented in a separate article. +

+ +

The gc assemblers

+ +

+Due to the change of the int to 64 bits and +a new internal representation of functions, +the arrangement of function arguments on the stack has changed in the gc tool chain. +Functions written in assembly will need to be revised at least +to adjust frame pointer offsets. +

+ +

+Updating: +The go vet command now checks that functions implemented in assembly +match the Go function prototypes they implement. +

+ +

Changes to the go command

+ +

+The go command has acquired several +changes intended to improve the experience for new Go users. +

+ +

+First, when compiling, testing, or running Go code, the go command will now give more detailed error messages, +including a list of paths searched, when a package cannot be located. +

+ +
+$ go build foo/quxx
+can't load package: package foo/quxx: cannot find package "foo/quxx" in any of:
+        /home/you/go/src/pkg/foo/quxx (from $GOROOT)
+        /home/you/src/foo/quxx (from $GOPATH)
+
+ +

+Second, the go get command no longer allows $GOROOT +as the default destination when downloading package source. +To use the go get +command, a valid $GOPATH is now required. +

+ +
+$ GOPATH= go get code.google.com/p/foo/quxx
+package code.google.com/p/foo/quxx: cannot download, $GOPATH not set. For more details see: go help gopath
+
+ +

+Finally, as a result of the previous change, the go get command will also fail +when $GOPATH and $GOROOT are set to the same value. +

+ +
+$ GOPATH=$GOROOT go get code.google.com/p/foo/quxx
+warning: GOPATH set to GOROOT (/home/you/go) has no effect
+package code.google.com/p/foo/quxx: cannot download, $GOPATH must not be set to $GOROOT. For more details see: go help gopath
+
+ +

Changes to the go test command

+ +

+The go test +command no longer deletes the binary when run with profiling enabled, +to make it easier to analyze the profile. +The implementation sets the -c flag automatically, so after running, +

+ +
+$ go test -cpuprofile cpuprof.out mypackage
+
+ +

+the file mypackage.test will be left in the directory where go test was run. +

+ +

+The go test +command can now generate profiling information +that reports where goroutines are blocked, that is, +where they tend to stall waiting for an event such as a channel communication. +The information is presented as a +blocking profile +enabled with the +-blockprofile +option of +go test. +Run go help test for more information. +

+ +

Changes to the go fix command

+ +

+The fix command, usually run as +go fix, no longer applies fixes to update code from +before Go 1 to use Go 1 APIs. +To update pre-Go 1 code to Go 1.1, use a Go 1.0 tool chain +to convert the code to Go 1.0 first. +

+ +

Build constraints

+ +

+The "go1.1" tag has been added to the list of default +build constraints. +This permits packages to take advantage of the new features in Go 1.1 while +remaining compatible with earlier versions of Go. +

+ +

+To build a file only with Go 1.1 and above, add this build constraint: +

+ +
+// +build go1.1
+
+ +

+To build a file only with Go 1.0.x, use the converse constraint: +

+ +
+// +build !go1.1
+
+ +

Additional platforms

+ +

+The Go 1.1 tool chain adds experimental support for freebsd/arm, +netbsd/386, netbsd/amd64, netbsd/arm, +openbsd/386 and openbsd/amd64 platforms. +

+ +

+An ARMv6 or later processor is required for freebsd/arm or +netbsd/arm. +

+ +

+Go 1.1 adds experimental support for cgo on linux/arm. +

+ +

Cross compilation

+ +

+When cross-compiling, the go tool will disable cgo +support by default. +

+ +

+To explicitly enable cgo, set CGO_ENABLED=1. +

+ +

Performance

+ +

+The performance of code compiled with the Go 1.1 gc tool suite should be noticeably +better for most Go programs. +Typical improvements relative to Go 1.0 seem to be about 30%-40%, sometimes +much more, but occasionally less or even non-existent. +There are too many small performance-driven tweaks through the tools and libraries +to list them all here, but the following major changes are worth noting: +

+ +
    +
  • The gc compilers generate better code in many cases, most noticeably for +floating point on the 32-bit Intel architecture.
  • +
  • The gc compilers do more in-lining, including for some operations +in the run-time such as append +and interface conversions.
  • +
  • There is a new implementation of Go maps with significant reduction in +memory footprint and CPU time.
  • +
  • The garbage collector has been made more parallel, which can reduce +latencies for programs running on multiple CPUs.
  • +
  • The garbage collector is also more precise, which costs a small amount of +CPU time but can reduce the size of the heap significantly, especially +on 32-bit architectures.
  • +
  • Due to tighter coupling of the run-time and network libraries, fewer +context switches are required on network operations.
  • +
+ +

Changes to the standard library

+ +

bufio.Scanner

+ +

+The various routines to scan textual input in the +bufio +package, +ReadBytes, +ReadString +and particularly +ReadLine, +are needlessly complex to use for simple purposes. +In Go 1.1, a new type, +Scanner, +has been added to make it easier to do simple tasks such as +read the input as a sequence of lines or space-delimited words. +It simplifies the problem by terminating the scan on problematic +input such as pathologically long lines, and having a simple +default: line-oriented input, with each line stripped of its terminator. +Here is code to reproduce the input a line at a time: +

+ +
+scanner := bufio.NewScanner(os.Stdin)
+for scanner.Scan() {
+    fmt.Println(scanner.Text()) // Println will add back the final '\n'
+}
+if err := scanner.Err(); err != nil {
+    fmt.Fprintln(os.Stderr, "reading standard input:", err)
+}
+
+ +

+Scanning behavior can be adjusted through a function to control subdividing the input +(see the documentation for SplitFunc), +but for tough problems or the need to continue past errors, the older interface +may still be required. +

+ +

net

+ +

+The protocol-specific resolvers in the net package were formerly +lax about the network name passed in. +Although the documentation was clear +that the only valid networks for +ResolveTCPAddr +are "tcp", +"tcp4", and "tcp6", the Go 1.0 implementation silently accepted any string. +The Go 1.1 implementation returns an error if the network is not one of those strings. +The same is true of the other protocol-specific resolvers ResolveIPAddr, +ResolveUDPAddr, and +ResolveUnixAddr. +

+ +

+The previous implementation of +ListenUnixgram +returned a +UDPConn as +a representation of the connection endpoint. +The Go 1.1 implementation instead returns a +UnixConn +to allow reading and writing +with its +ReadFrom +and +WriteTo +methods. +

+ +

+The data structures +IPAddr, +TCPAddr, and +UDPAddr +add a new string field called Zone. +Code using untagged composite literals (e.g. net.TCPAddr{ip, port}) +instead of tagged literals (net.TCPAddr{IP: ip, Port: port}) +will break due to the new field. +The Go 1 compatibility rules allow this change: client code must use tagged literals to avoid such breakages. +

+ +

+Updating: +To correct breakage caused by the new struct field, +go fix will rewrite code to add tags for these types. +More generally, go vet will identify composite literals that +should be revised to use field tags. +

+ +

reflect

+ +

+The reflect package has several significant additions. +

+ +

+It is now possible to run a "select" statement using +the reflect package; see the description of +Select +and +SelectCase +for details. +

+ +

+The new method +Value.Convert +(or +Type.ConvertibleTo) +provides functionality to execute a Go conversion or type assertion operation +on a +Value +(or test for its possibility). +

+ +

+The new function +MakeFunc +creates a wrapper function to make it easier to call a function with existing +Values, +doing the standard Go conversions among the arguments, for instance +to pass an actual int to a formal interface{}. +

+ +

+Finally, the new functions +ChanOf, +MapOf +and +SliceOf +construct new +Types +from existing types, for example to construct the type []T given +only T. +

+ + +

time

+

+On FreeBSD, Linux, NetBSD, OS X and OpenBSD, previous versions of the +time package +returned times with microsecond precision. +The Go 1.1 implementation on these +systems now returns times with nanosecond precision. +Programs that write to an external format with microsecond precision +and read it back, expecting to recover the original value, will be affected +by the loss of precision. +There are two new methods of Time, +Round +and +Truncate, +that can be used to remove precision from a time before passing it to +external storage. +

+ +

+The new method +YearDay +returns the one-indexed integral day number of the year specified by the time value. +

+ +

+The +Timer +type has a new method +Reset +that modifies the timer to expire after a specified duration. +

+ +

+Finally, the new function +ParseInLocation +is like the existing +Parse +but parses the time in the context of a location (time zone), ignoring +time zone information in the parsed string. +This function addresses a common source of confusion in the time API. +

+ +

+Updating: +Code that needs to read and write times using an external format with +lower precision should be modified to use the new methods. +

+ +

Exp and old subtrees moved to go.exp and go.text subrepositories

+ +

+To make it easier for binary distributions to access them if desired, the exp +and old source subtrees, which are not included in binary distributions, +have been moved to the new go.exp subrepository at +code.google.com/p/go.exp. To access the ssa package, +for example, run +

+ +
+$ go get code.google.com/p/go.exp/ssa
+
+ +

+and then in Go source, +

+ +
+import "code.google.com/p/go.exp/ssa"
+
+ +

+The old package exp/norm has also been moved, but to a new repository +go.text, where the Unicode APIs and other text-related packages will +be developed. +

+ +

New packages

+ +

+There are three new packages. +

+ +
    +
  • +The go/format package provides +a convenient way for a program to access the formatting capabilities of the +go fmt command. +It has two functions, +Node to format a Go parser +Node, +and +Source +to reformat arbitrary Go source code into the standard format as provided by the +go fmt command. +
  • + +
  • +The net/http/cookiejar package provides the basics for managing HTTP cookies. +
  • + +
  • +The runtime/race package provides low-level facilities for data race detection. +It is internal to the race detector and does not otherwise export any user-visible functionality. +
  • +
+ +

Minor changes to the library

+ +

+The following list summarizes a number of minor changes to the library, mostly additions. +See the relevant package documentation for more information about each change. +

+ +
    +
  • +The bytes package has two new functions, +TrimPrefix +and +TrimSuffix, +with self-evident properties. +Also, the Buffer type +has a new method +Grow that +provides some control over memory allocation inside the buffer. +Finally, the +Reader type now has a +WriteTo method +so it implements the +io.WriterTo interface. +
  • + +
  • +The compress/gzip package has +a new Flush +method for its +Writer +type that flushes its underlying flate.Writer. +
  • + +
  • +The crypto/hmac package has a new function, +Equal, to compare two MACs. +
  • + +
  • +The crypto/x509 package +now supports PEM blocks (see +DecryptPEMBlock for instance), +and a new function +ParseECPrivateKey to parse elliptic curve private keys. +
  • + +
  • +The database/sql package +has a new +Ping +method for its +DB +type that tests the health of the connection. +
  • + +
  • +The database/sql/driver package +has a new +Queryer +interface that a +Conn +may implement to improve performance. +
  • + +
  • +The encoding/json package's +Decoder +has a new method +Buffered +to provide access to the remaining data in its buffer, +as well as a new method +UseNumber +to unmarshal a value into the new type +Number, +a string, rather than a float64. +
  • + +
  • +The encoding/xml package +has a new function, +EscapeText, +which writes escaped XML output, +and a method on +Encoder, +Indent, +to specify indented output. +
  • + +
  • +In the go/ast package, a +new type CommentMap +and associated methods makes it easier to extract and process comments in Go programs. +
  • + +
  • +In the go/doc package, +the parser now keeps better track of stylized annotations such as TODO(joe) +throughout the code, +information that the godoc +command can filter or present according to the value of the -notes flag. +
  • + +
  • +The undocumented and only partially implemented "noescape" feature of the +html/template +package has been removed; programs that depend on it will break. +
  • + +
  • +The image/jpeg package now +reads progressive JPEG files and handles a few more subsampling configurations. +
  • + +
  • +The io package now exports the +io.ByteWriter interface to capture the common +functionality of writing a byte at a time. +It also exports a new error, ErrNoProgress, +used to indicate a Read implementation is looping without delivering data. +
  • + +
  • +The log/syslog package now provides better support +for OS-specific logging features. +
  • + +
  • +The math/big package's +Int type +now has methods +MarshalJSON +and +UnmarshalJSON +to convert to and from a JSON representation. +Also, +Int +can now convert directly to and from a uint64 using +Uint64 +and +SetUint64, +while +Rat +can do the same with float64 using +Float64 +and +SetFloat64. +
  • + +
  • +The mime/multipart package +has a new method for its +Writer, +SetBoundary, +to define the boundary separator used to package the output. +The Reader also now +transparently decodes any quoted-printable parts and removes +the Content-Transfer-Encoding header when doing so. +
  • + +
  • +The +net package's +ListenUnixgram +function has changed return types: it now returns a +UnixConn +rather than a +UDPConn, which was +clearly a mistake in Go 1.0. +Since this API change fixes a bug, it is permitted by the Go 1 compatibility rules. +
  • + +
  • +The net package includes a new type, +Dialer, to supply options to +Dial. +
  • + +
  • +The net package adds support for +link-local IPv6 addresses with zone qualifiers, such as fe80::1%lo0. +The address structures IPAddr, +UDPAddr, and +TCPAddr +record the zone in a new field, and functions that expect string forms of these addresses, such as +Dial, +ResolveIPAddr, +ResolveUDPAddr, and +ResolveTCPAddr, +now accept the zone-qualified form. +
  • + +
  • +The net package adds +LookupNS to its suite of resolving functions. +LookupNS returns the NS records for a host name. +
  • + +
  • +The net package adds protocol-specific +packet reading and writing methods to +IPConn +(ReadMsgIP +and WriteMsgIP) and +UDPConn +(ReadMsgUDP and +WriteMsgUDP). +These are specialized versions of PacketConn's +ReadFrom and WriteTo methods that provide access to out-of-band data associated +with the packets. +
  • + +
  • +The net package adds methods to +UnixConn to allow closing half of the connection +(CloseRead and +CloseWrite), +matching the existing methods of TCPConn. +
  • + +
  • +The net/http package includes several new additions. +ParseTime parses a time string, trying +several common HTTP time formats. +The PostFormValue method of +Request is like +FormValue but ignores URL parameters. +The CloseNotifier interface provides a mechanism +for a server handler to discover when a client has disconnected. +The ServeMux type now has a +Handler method to access a path's +Handler without executing it. +The Transport can now cancel an in-flight request with +CancelRequest. +Finally, the Transport is now more aggressive at closing TCP connections when +a Response.Body is closed before +being fully consumed. +
  • + +
  • +The net/mail package has two new functions, +ParseAddress and +ParseAddressList, +to parse RFC 5322-formatted mail addresses into +Address structures. +
  • + +
  • +The net/smtp package's +Client type has a new method, +Hello, +which transmits a HELO or EHLO message to the server. +
  • + +
  • +The net/textproto package +has two new functions, +TrimBytes and +TrimString, +which do ASCII-only trimming of leading and trailing spaces. +
  • + +
  • +The new method os.FileMode.IsRegular makes it easy to ask if a file is a plain file. +
  • + +
  • +The os/signal package has a new function, +Stop, which stops the package delivering +any further signals to the channel. +
  • + +
  • +The regexp package +now supports Unix-original leftmost-longest matches through the +Regexp.Longest +method, while +Regexp.Split slices +strings into pieces based on separators defined by the regular expression. +
  • + +
  • +The runtime/debug package +has three new functions regarding memory usage. +The FreeOSMemory +function triggers a run of the garbage collector and then attempts to return unused +memory to the operating system; +the ReadGCStats +function retrieves statistics about the collector; and +SetGCPercent +provides a programmatic way to control how often the collector runs, +including disabling it altogether. +
  • + +
  • +The sort package has a new function, +Reverse. +Wrapping the argument of a call to +sort.Sort +with a call to Reverse causes the sort order to be reversed. +
  • + +
  • +The strings package has two new functions, +TrimPrefix +and +TrimSuffix +with self-evident properties, and the new method +Reader.WriteTo so the +Reader +type now implements the +io.WriterTo interface. +
  • + +
  • +The syscall package's +Fchflags function on various BSDs +(including Darwin) has changed signature. +It now takes an int as the first parameter instead of a string. +Since this API change fixes a bug, it is permitted by the Go 1 compatibility rules. +
  • +
  • +The syscall package also has received many updates +to make it more inclusive of constants and system calls for each supported operating system. +
  • + +
  • +The testing package now automates the generation of allocation +statistics in tests and benchmarks using the new +AllocsPerRun function. And the +ReportAllocs +method on testing.B will enable printing of +memory allocation statistics for the calling benchmark. It also introduces the +AllocsPerOp method of +BenchmarkResult. +There is also a new +Verbose function to test the state of the -v +command-line flag, +and a new +Skip method of +testing.B and +testing.T +to simplify skipping an inappropriate test. +
  • + +
  • +In the text/template +and +html/template packages, +templates can now use parentheses to group the elements of pipelines, simplifying the construction of complex pipelines. +Also, as part of the new parser, the +Node interface got two new methods to provide +better error reporting. +Although this violates the Go 1 compatibility rules, +no existing code should be affected because this interface is explicitly intended only to be used +by the +text/template +and +html/template +packages and there are safeguards to guarantee that. +
  • + +
  • +The implementation of the unicode package has been updated to Unicode version 6.2.0. +
  • + +
  • +In the unicode/utf8 package, +the new function ValidRune reports whether the rune is a valid Unicode code point. +To be valid, a rune must be in range and not be a surrogate half. +
  • +
diff --git a/doc/go1.2.html b/doc/go1.2.html new file mode 100644 index 0000000000000000000000000000000000000000..b9d36f29c3dd68c94276bf7995e9c79d16204d94 --- /dev/null +++ b/doc/go1.2.html @@ -0,0 +1,979 @@ + + +

Introduction to Go 1.2

+ +

+Since the release of Go version 1.1 in April, 2013, +the release schedule has been shortened to make the release process more efficient. +This release, Go version 1.2 or Go 1.2 for short, arrives roughly six months after 1.1, +while 1.1 took over a year to appear after 1.0. +Because of the shorter time scale, 1.2 is a smaller delta than the step from 1.0 to 1.1, +but it still has some significant developments, including +a better scheduler and one new language feature. +Of course, Go 1.2 keeps the promise +of compatibility. +The overwhelming majority of programs built with Go 1.1 (or 1.0 for that matter) +will run without any changes whatsoever when moved to 1.2, +although the introduction of one restriction +to a corner of the language may expose already-incorrect code +(see the discussion of the use of nil). +

+ +

Changes to the language

+ +

+In the interest of firming up the specification, one corner case has been clarified, +with consequences for programs. +There is also one new language feature. +

+ +

Use of nil

+ +

+The language now specifies that, for safety reasons, +certain uses of nil pointers are guaranteed to trigger a run-time panic. +For instance, in Go 1.0, given code like +

+ +
+type T struct {
+    X [1<<24]byte
+    Field int32
+}
+
+func main() {
+    var x *T
+    ...
+}
+
+ +

+the nil pointer x could be used to access memory incorrectly: +the expression x.Field could access memory at address 1<<24. +To prevent such unsafe behavior, in Go 1.2 the compilers now guarantee that any indirection through +a nil pointer, such as illustrated here but also in nil pointers to arrays, nil interface values, +nil slices, and so on, will either panic or return a correct, safe non-nil value. +In short, any expression that explicitly or implicitly requires evaluation of a nil address is an error. +The implementation may inject extra tests into the compiled program to enforce this behavior. +

+ +

+Further details are in the +design document. +

+ +

+Updating: +Most code that depended on the old behavior is erroneous and will fail when run. +Such programs will need to be updated by hand. +

+ +

Three-index slices

+ +

+Go 1.2 adds the ability to specify the capacity as well as the length when using a slicing operation +on an existing array or slice. +A slicing operation creates a new slice by describing a contiguous section of an already-created array or slice: +

+ +
+var array [10]int
+slice := array[2:4]
+
+ +

+The capacity of the slice is the maximum number of elements that the slice may hold, even after reslicing; +it reflects the size of the underlying array. +In this example, the capacity of the slice variable is 8. +

+ +

+Go 1.2 adds new syntax to allow a slicing operation to specify the capacity as well as the length. +A second +colon introduces the capacity value, which must be less than or equal to the capacity of the +source slice or array, adjusted for the origin. For instance, +

+ +
+slice = array[2:4:7]
+
+ +

+sets the slice to have the same length as in the earlier example but its capacity is now only 5 elements (7-2). +It is impossible to use this new slice value to access the last three elements of the original array. +

+ +

+In this three-index notation, a missing first index ([:i:j]) defaults to zero but the other +two indices must always be specified explicitly. +It is possible that future releases of Go may introduce default values for these indices. +

+ +

+Further details are in the +design document. +

+ +

+Updating: +This is a backwards-compatible change that affects no existing programs. +

+ +

Changes to the implementations and tools

+ +

Pre-emption in the scheduler

+ +

+In prior releases, a goroutine that was looping forever could starve out other +goroutines on the same thread, a serious problem when GOMAXPROCS +provided only one user thread. +In Go 1.2, this is partially addressed: The scheduler is invoked occasionally +upon entry to a function. +This means that any loop that includes a (non-inlined) function call can +be pre-empted, allowing other goroutines to run on the same thread. +

+ +

Limit on the number of threads

+ +

+Go 1.2 introduces a configurable limit (default 10,000) to the total number of threads +a single program may have in its address space, to avoid resource starvation +issues in some environments. +Note that goroutines are multiplexed onto threads so this limit does not directly +limit the number of goroutines, only the number that may be simultaneously blocked +in a system call. +In practice, the limit is hard to reach. +

+ +

+The new SetMaxThreads function in the +runtime/debug package controls the thread count limit. +

+ +

+Updating: +Few functions will be affected by the limit, but if a program dies because it hits the +limit, it could be modified to call SetMaxThreads to set a higher count. +Even better would be to refactor the program to need fewer threads, reducing consumption +of kernel resources. +

+ +

Stack size

+ +

+In Go 1.2, the minimum size of the stack when a goroutine is created has been lifted from 4KB to 8KB. +Many programs were suffering performance problems with the old size, which had a tendency +to introduce expensive stack-segment switching in performance-critical sections. +The new number was determined by empirical testing. +

+ +

+At the other end, the new function SetMaxStack +in the runtime/debug package controls +the maximum size of a single goroutine's stack. +The default is 1GB on 64-bit systems and 250MB on 32-bit systems. +Before Go 1.2, it was too easy for a runaway recursion to consume all the memory on a machine. +

+ +

+Updating: +The increased minimum stack size may cause programs with many goroutines to use +more memory. There is no workaround, but plans for future releases +include new stack management technology that should address the problem better. +

+ +

Cgo and C++

+ +

+The cgo command will now invoke the C++ +compiler to build any pieces of the linked-to library that are written in C++; +the documentation has more detail. +

+ +

Godoc and vet moved to the go.tools subrepository

+ +

+Both binaries are still included with the distribution, but the source code for the +godoc and vet commands has moved to the +go.tools subrepository. +

+ +

+Also, the core of the godoc program has been split into a +library, +while the command itself is in a separate +directory. +The move allows the code to be updated easily and the separation into a library and command +makes it easier to construct custom binaries for local sites and different deployment methods. +

+ +

+Updating: +Since godoc and vet are not part of the library, +no client Go code depends on the their source and no updating is required. +

+ +

+The binary distributions available from golang.org +include these binaries, so users of these distributions are unaffected. +

+ +

+When building from source, users must use "go get" to install godoc and vet. +(The binaries will continue to be installed in their usual locations, not +$GOPATH/bin.) +

+ +
+$ go get code.google.com/p/go.tools/cmd/godoc
+$ go get code.google.com/p/go.tools/cmd/vet
+
+ +

Status of gccgo

+ +

+We expect the future GCC 4.9 release to include gccgo with full +support for Go 1.2. +In the current (4.8.2) release of GCC, gccgo implements Go 1.1.2. +

+ +

Changes to the gc compiler and linker

+ +

+Go 1.2 has several semantic changes to the workings of the gc compiler suite. +Most users will be unaffected by them. +

+ +

+The cgo command now +works when C++ is included in the library being linked against. +See the cgo documentation +for details. +

+ +

+The gc compiler displayed a vestigial detail of its origins when +a program had no package clause: it assumed +the file was in package main. +The past has been erased, and a missing package clause +is now an error. +

+ +

+On the ARM, the toolchain supports "external linking", which +is a step towards being able to build shared libraries with the gc +tool chain and to provide dynamic linking support for environments +in which that is necessary. +

+ +

+In the runtime for the ARM, with 5a, it used to be possible to refer +to the runtime-internal m (machine) and g +(goroutine) variables using R9 and R10 directly. +It is now necessary to refer to them by their proper names. +

+ +

+Also on the ARM, the 5l linker (sic) now defines the +MOVBS and MOVHS instructions +as synonyms of MOVB and MOVH, +to make clearer the separation between signed and unsigned +sub-word moves; the unsigned versions already existed with a +U suffix. +

+ +

Test coverage

+ +

+One major new feature of go test is +that it can now compute and, with help from a new, separately installed +"go tool cover" program, display test coverage results. +

+ +

+The cover tool is part of the +go.tools +subrepository. +It can be installed by running +

+ +
+$ go get code.google.com/p/go.tools/cmd/cover
+
+ +

+The cover tool does two things. +First, when "go test" is given the -cover flag, it is run automatically +to rewrite the source for the package and insert instrumentation statements. +The test is then compiled and run as usual, and basic coverage statistics are reported: +

+ +
+$ go test -cover fmt
+ok  	fmt	0.060s	coverage: 91.4% of statements
+$
+
+ +

+Second, for more detailed reports, different flags to "go test" can create a coverage profile file, +which the cover program, invoked with "go tool cover", can then analyze. +

+ +

+Details on how to generate and analyze coverage statistics can be found by running the commands +

+ +
+$ go help testflag
+$ go tool cover -help
+
+ +

The go doc command is deleted

+ +

+The "go doc" command is deleted. +Note that the godoc tool itself is not deleted, +just the wrapping of it by the go command. +All it did was show the documents for a package by package path, +which godoc itself already does with more flexibility. +It has therefore been deleted to reduce the number of documentation tools and, +as part of the restructuring of godoc, encourage better options in future. +

+ +

+Updating: For those who still need the precise functionality of running +

+ +
+$ go doc
+
+ +

+in a directory, the behavior is identical to running +

+ +
+$ godoc .
+
+ +

Changes to the go command

+ +

+The go get command +now has a -t flag that causes it to download the dependencies +of the tests run by the package, not just those of the package itself. +By default, as before, dependencies of the tests are not downloaded. +

+ +

Performance

+ +

+There are a number of significant performance improvements in the standard library; here are a few of them. +

+ +
    + +
  • +The compress/bzip2 +decompresses about 30% faster. +
  • + +
  • +The crypto/des package +is about five times faster. +
  • + +
  • +The encoding/json package +encodes about 30% faster. +
  • + +
  • +Networking performance on Windows and BSD systems is about 30% faster through the use +of an integrated network poller in the runtime, similar to what was done for Linux and OS X +in Go 1.1. +
  • + +
+ +

Changes to the standard library

+ + +

The archive/tar and archive/zip packages

+ +

+The +archive/tar +and +archive/zip +packages have had a change to their semantics that may break existing programs. +The issue is that they both provided an implementation of the +os.FileInfo +interface that was not compliant with the specification for that interface. +In particular, their Name method returned the full +path name of the entry, but the interface specification requires that +the method return only the base name (final path element). +

+ +

+Updating: Since this behavior was newly implemented and +a bit obscure, it is possible that no code depends on the broken behavior. +If there are programs that do depend on it, they will need to be identified +and fixed manually. +

+ +

The new encoding package

+ +

+There is a new package, encoding, +that defines a set of standard encoding interfaces that may be used to +build custom marshalers and unmarshalers for packages such as +encoding/xml, +encoding/json, +and +encoding/binary. +These new interfaces have been used to tidy up some implementations in +the standard library. +

+ +

+The new interfaces are called +BinaryMarshaler, +BinaryUnmarshaler, +TextMarshaler, +and +TextUnmarshaler. +Full details are in the documentation for the package +and a separate design document. +

+ +

The fmt package

+ +

+The fmt package's formatted print +routines such as Printf +now allow the data items to be printed to be accessed in arbitrary order +by using an indexing operation in the formatting specifications. +Wherever an argument is to be fetched from the argument list for formatting, +either as the value to be formatted or as a width or specification integer, +a new optional indexing notation [n] +fetches argument n instead. +The value of n is 1-indexed. +After such an indexing operating, the next argument to be fetched by normal +processing will be n+1. +

+ +

+For example, the normal Printf call +

+ +
+fmt.Sprintf("%c %c %c\n", 'a', 'b', 'c')
+
+ +

+would create the string "a b c", but with indexing operations like this, +

+ +
+fmt.Sprintf("%[3]c %[1]c %c\n", 'a', 'b', 'c')
+
+ +

+the result is ""c a b". The [3] index accesses the third formatting +argument, which is 'c', [1] accesses the first, 'a', +and then the next fetch accesses the argument following that one, 'b'. +

+ +

+The motivation for this feature is programmable format statements to access +the arguments in different order for localization, but it has other uses: +

+ +
+log.Printf("trace: value %v of type %[1]T\n", expensiveFunction(a.b[c]))
+
+ +

+Updating: The change to the syntax of format specifications +is strictly backwards compatible, so it affects no working programs. +

+ +

The text/template and html/template packages

+ +

+The +text/template package +has a couple of changes in Go 1.2, both of which are also mirrored in the +html/template package. +

+ +

+First, there are new default functions for comparing basic types. +The functions are listed in this table, which shows their names and +the associated familiar comparison operator. +

+ + + + + + + + + + + + + + + + + + + + + + + +
Name Operator
eq ==
ne !=
lt <
le <=
gt >
ge >=
+ +

+These functions behave slightly differently from the corresponding Go operators. +First, they operate only on basic types (bool, int, +float64, string, etc.). +(Go allows comparison of arrays and structs as well, under some circumstances.) +Second, values can be compared as long as they are the same sort of value: +any signed integer value can be compared to any other signed integer value for example. (Go +does not permit comparing an int8 and an int16). +Finally, the eq function (only) allows comparison of the first +argument with one or more following arguments. The template in this example, +

+ +
+{{"{{"}}if eq .A 1 2 3 {{"}}"}} equal {{"{{"}}else{{"}}"}} not equal {{"{{"}}end{{"}}"}}
+
+ +

+reports "equal" if .A is equal to any of 1, 2, or 3. +

+ +

+The second change is that a small addition to the grammar makes "if else if" chains easier to write. +Instead of writing, +

+ +
+{{"{{"}}if eq .A 1{{"}}"}} X {{"{{"}}else{{"}}"}} {{"{{"}}if eq .A 2{{"}}"}} Y {{"{{"}}end{{"}}"}} {{"{{"}}end{{"}}"}} 
+
+ +

+one can fold the second "if" into the "else" and have only one "end", like this: +

+ +
+{{"{{"}}if eq .A 1{{"}}"}} X {{"{{"}}else if eq .A 2{{"}}"}} Y {{"{{"}}end{{"}}"}}
+
+ +

+The two forms are identical in effect; the difference is just in the syntax. +

+ +

+Updating: Neither the "else if" change nor the comparison functions +affect existing programs. Those that +already define functions called eq and so on through a function +map are unaffected because the associated function map will override the new +default function definitions. +

+ +

New packages

+ +

+There are two new packages. +

+ + + +

Minor changes to the library

+ +

+The following list summarizes a number of minor changes to the library, mostly additions. +See the relevant package documentation for more information about each change. +

+ +
    + +
  • +The archive/zip package +adds the +DataOffset accessor +to return the offset of a file's (possibly compressed) data within the archive. +
  • + +
  • +The bufio package +adds Reset +methods to Reader and +Writer. +These methods allow the Readers +and Writers +to be re-used on new input and output readers and writers, saving +allocation overhead. +
  • + +
  • +The compress/bzip2 +can now decompress concatenated archives. +
  • + +
  • +The compress/flate +package adds a Reset +method on the Writer, +to make it possible to reduce allocation when, for instance, constructing an +archive to hold multiple compressed files. +
  • + +
  • +The compress/gzip package's +Writer type adds a +Reset +so it may be reused. +
  • + +
  • +The compress/zlib package's +Writer type adds a +Reset +so it may be reused. +
  • + +
  • +The container/heap package +adds a Fix +method to provide a more efficient way to update an item's position in the heap. +
  • + +
  • +The container/list package +adds the MoveBefore +and +MoveAfter +methods, which implement the obvious rearrangement. +
  • + +
  • +The crypto/cipher package +adds the a new GCM mode (Galois Counter Mode), which is almost always +used with AES encryption. +
  • + +
  • +The +crypto/md5 package +adds a new Sum function +to simplify hashing without sacrificing performance. +
  • + +
  • +Similarly, the +crypto/sha1 package +adds a new Sum function. +
  • + +
  • +Also, the +crypto/sha256 package +adds Sum256 +and Sum224 functions. +
  • + +
  • +Finally, the crypto/sha512 package +adds Sum512 and +Sum384 functions. +
  • + +
  • +The crypto/x509 package +adds support for reading and writing arbitrary extensions. +
  • + +
  • +The crypto/tls package adds +support for TLS 1.1, 1.2 and AES-GCM. +
  • + +
  • +The database/sql package adds a +SetMaxOpenConns +method on DB to limit the +number of open connections to the database. +
  • + +
  • +The encoding/csv package +now always allows trailing commas on fields. +
  • + +
  • +The encoding/gob package +now treats channel and function fields of structures as if they were unexported, +even if they are not. That is, it ignores them completely. Previously they would +trigger an error, which could cause unexpected compatibility problems if an +embedded structure added such a field. +The package also now supports the generic BinaryMarshaler and +BinaryUnmarshaler interfaces of the +encoding package +described above. +
  • + +
  • +The encoding/json package +now will always escape ampersands as "\u0026" when printing strings. +It will now accept but correct invalid UTF-8 in +Marshal +(such input was previously rejected). +Finally, it now supports the generic encoding interfaces of the +encoding package +described above. +
  • + +
  • +The encoding/xml package +now allows attributes stored in pointers to be marshaled. +It also supports the generic encoding interfaces of the +encoding package +described above through the new +Marshaler, +Unmarshaler, +and related +MarshalerAttr and +UnmarshalerAttr +interfaces. +The package also adds a +Flush method +to the +Encoder +type for use by custom encoders. See the documentation for +EncodeToken +to see how to use it. +
  • + +
  • +The flag package now +has a Getter interface +to allow the value of a flag to be retrieved. Due to the +Go 1 compatibility guidelines, this method cannot be added to the existing +Value +interface, but all the existing standard flag types implement it. +The package also now exports the CommandLine +flag set, which holds the flags from the command line. +
  • + +
  • +The go/ast package's +SliceExpr struct +has a new boolean field, Slice3, which is set to true +when representing a slice expression with three indices (two colons). +The default is false, representing the usual two-index form. +
  • + +
  • +The go/build package adds +the AllTags field +to the Package type, +to make it easier to process build tags. +
  • + +
  • +The image/draw package now +exports an interface, Drawer, +that wraps the standard Draw method. +The Porter-Duff operators now implement this interface, in effect binding an operation to +the draw operator rather than providing it explicitly. +Given a paletted image as its destination, the new +FloydSteinberg +implementation of the +Drawer +interface will use the Floyd-Steinberg error diffusion algorithm to draw the image. +To create palettes suitable for such processing, the new +Quantizer interface +represents implementations of quantization algorithms that choose a palette +given a full-color image. +There are no implementations of this interface in the library. +
  • + +
  • +The image/gif package +can now create GIF files using the new +Encode +and EncodeAll +functions. +Their options argument allows specification of an image +Quantizer to use; +if it is nil, the generated GIF will use the +Plan9 +color map (palette) defined in the new +image/color/palette package. +The options also specify a +Drawer +to use to create the output image; +if it is nil, Floyd-Steinberg error diffusion is used. +
  • + +
  • +The Copy method of the +io package now prioritizes its +arguments differently. +If one argument implements WriterTo +and the other implements ReaderFrom, +Copy will now invoke +WriterTo to do the work, +so that less intermediate buffering is required in general. +
  • + +
  • +The net package requires cgo by default +because the host operating system must in general mediate network call setup. +On some systems, though, it is possible to use the network without cgo, and useful +to do so, for instance to avoid dynamic linking. +The new build tag netgo (off by default) allows the construction of a +net package in pure Go on those systems where it is possible. +
  • + +
  • +The net package adds a new field +DualStack to the Dialer +struct for TCP connection setup using a dual IP stack as described in +RFC 6555. +
  • + +
  • +The net/http package will no longer +transmit cookies that are incorrect according to +RFC 6265. +It just logs an error and sends nothing. +Also, +the net/http package's +ReadResponse +function now permits the *Request parameter to be nil, +whereupon it assumes a GET request. +Finally, an HTTP server will now serve HEAD +requests transparently, without the need for special casing in handler code. +While serving a HEAD request, writes to a +Handler's +ResponseWriter +are absorbed by the +Server +and the client receives an empty body as required by the HTTP specification. +
  • + +
  • +The os/exec package's +Cmd.StdinPipe method +returns an io.WriteCloser, but has changed its concrete +implementation from *os.File to an unexported type that embeds +*os.File, and it is now safe to close the returned value. +Before Go 1.2, there was an unavoidable race that this change fixes. +Code that needs access to the methods of *os.File can use an +interface type assertion, such as wc.(interface{ Sync() error }). +
  • + +
  • +The runtime package relaxes +the constraints on finalizer functions in +SetFinalizer: the +actual argument can now be any type that is assignable to the formal type of +the function, as is the case for any normal function call in Go. +
  • + +
  • +The sort package has a new +Stable function that implements +stable sorting. It is less efficient than the normal sort algorithm, however. +
  • + +
  • +The strings package adds +an IndexByte +function for consistency with the bytes package. +
  • + +
  • +The sync/atomic package +adds a new set of swap functions that atomically exchange the argument with the +value stored in the pointer, returning the old value. +The functions are +SwapInt32, +SwapInt64, +SwapUint32, +SwapUint64, +SwapUintptr, +and +SwapPointer, +which swaps an unsafe.Pointer. +
  • + +
  • +The syscall package now implements +Sendfile for Darwin. +
  • + +
  • +The testing package +now exports the TB interface. +It records the methods in common with the +T +and +B types, +to make it easier to share code between tests and benchmarks. +Also, the +AllocsPerRun +function now quantizes the return value to an integer (although it +still has type float64), to round off any error caused by +initialization and make the result more repeatable. +
  • + +
  • +The text/template package +now automatically dereferences pointer values when evaluating the arguments +to "escape" functions such as "html", to bring the behavior of such functions +in agreement with that of other printing functions such as "printf". +
  • + +
  • +In the time package, the +Parse function +and +Format +method +now handle time zone offsets with seconds, such as in the historical +date "1871-01-01T05:33:02+00:34:08". +Also, pattern matching in the formats for those routines is stricter: a non-lowercase letter +must now follow the standard words such as "Jan" and "Mon". +
  • + +
  • +The unicode package +adds In, +a nicer-to-use but equivalent version of the original +IsOneOf, +to see whether a character is a member of a Unicode category. +
  • + +
diff --git a/doc/go1.3.html b/doc/go1.3.html new file mode 100644 index 0000000000000000000000000000000000000000..d51052b2e5eb0277c2a7046e06f2c6d1e5e506c4 --- /dev/null +++ b/doc/go1.3.html @@ -0,0 +1,608 @@ + + +

Introduction to Go 1.3

+ +

+The latest Go release, version 1.3, arrives six months after 1.2, +and contains no language changes. +It focuses primarily on implementation work, providing +precise garbage collection, +a major refactoring of the compiler tool chain that results in +faster builds, especially for large projects, +significant performance improvements across the board, +and support for DragonFly BSD, Solaris, Plan 9 and Google's Native Client architecture (NaCl). +It also has an important refinement to the memory model regarding synchronization. +As always, Go 1.3 keeps the promise +of compatibility, +and almost everything +will continue to compile and run without change when moved to 1.3. +

+ +

Changes to the supported operating systems and architectures

+ +

Removal of support for Windows 2000

+ +

+Microsoft stopped supporting Windows 2000 in 2010. +Since it has implementation difficulties +regarding exception handling (signals in Unix terminology), +as of Go 1.3 it is not supported by Go either. +

+ +

Support for DragonFly BSD

+ +

+Go 1.3 now includes experimental support for DragonFly BSD on the amd64 (64-bit x86) and 386 (32-bit x86) architectures. +It uses DragonFly BSD 3.6 or above. +

+ +

Support for FreeBSD

+ +

+It was not announced at the time, but since the release of Go 1.2, support for Go on FreeBSD +requires FreeBSD 8 or above. +

+ +

+As of Go 1.3, support for Go on FreeBSD requires that the kernel be compiled with the +COMPAT_FREEBSD32 flag configured. +

+ +

+In concert with the switch to EABI syscalls for ARM platforms, Go 1.3 will run only on FreeBSD 10. +The x86 platforms, 386 and amd64, are unaffected. +

+ +

Support for Native Client

+ +

+Support for the Native Client virtual machine architecture has returned to Go with the 1.3 release. +It runs on the 32-bit Intel architectures (GOARCH=386) and also on 64-bit Intel, but using +32-bit pointers (GOARCH=amd64p32). +There is not yet support for Native Client on ARM. +Note that this is Native Client (NaCl), not Portable Native Client (PNaCl). +Details about Native Client are here; +how to set up the Go version is described here. +

+ +

Support for NetBSD

+ +

+As of Go 1.3, support for Go on NetBSD requires NetBSD 6.0 or above. +

+ +

Support for OpenBSD

+ +

+As of Go 1.3, support for Go on OpenBSD requires OpenBSD 5.5 or above. +

+ +

Support for Plan 9

+ +

+Go 1.3 now includes experimental support for Plan 9 on the 386 (32-bit x86) architecture. +It requires the Tsemacquire syscall, which has been in Plan 9 since June, 2012. +

+ +

Support for Solaris

+ +

+Go 1.3 now includes experimental support for Solaris on the amd64 (64-bit x86) architecture. +It requires illumos, Solaris 11 or above. +

+ +

Changes to the memory model

+ +

+The Go 1.3 memory model adds a new rule +concerning sending and receiving on buffered channels, +to make explicit that a buffered channel can be used as a simple +semaphore, using a send into the +channel to acquire and a receive from the channel to release. +This is not a language change, just a clarification about an expected property of communication. +

+ +

Changes to the implementations and tools

+ +

Stack

+ +

+Go 1.3 has changed the implementation of goroutine stacks away from the old, +"segmented" model to a contiguous model. +When a goroutine needs more stack +than is available, its stack is transferred to a larger single block of memory. +The overhead of this transfer operation amortizes well and eliminates the old "hot spot" +problem when a calculation repeatedly steps across a segment boundary. +Details including performance numbers are in this +design document. +

+ +

Changes to the garbage collector

+ +

+For a while now, the garbage collector has been precise when examining +values in the heap; the Go 1.3 release adds equivalent precision to values on the stack. +This means that a non-pointer Go value such as an integer will never be mistaken for a +pointer and prevent unused memory from being reclaimed. +

+ +

+Starting with Go 1.3, the runtime assumes that values with pointer type +contain pointers and other values do not. +This assumption is fundamental to the precise behavior of both stack expansion +and garbage collection. +Programs that use package unsafe +to store integers in pointer-typed values are illegal and will crash if the runtime detects the behavior. +Programs that use package unsafe to store pointers +in integer-typed values are also illegal but more difficult to diagnose during execution. +Because the pointers are hidden from the runtime, a stack expansion or garbage collection +may reclaim the memory they point at, creating +dangling pointers. +

+ +

+Updating: Code that uses unsafe.Pointer to convert +an integer-typed value held in memory into a pointer is illegal and must be rewritten. +Such code can be identified by go vet. +

+ +

Map iteration

+ +

+Iterations over small maps no longer happen in a consistent order. +Go 1 defines that “The iteration order over maps +is not specified and is not guaranteed to be the same from one iteration to the next.” +To keep code from depending on map iteration order, +Go 1.0 started each map iteration at a random index in the map. +A new map implementation introduced in Go 1.1 neglected to randomize +iteration for maps with eight or fewer entries, although the iteration order +can still vary from system to system. +This has allowed people to write Go 1.1 and Go 1.2 programs that +depend on small map iteration order and therefore only work reliably on certain systems. +Go 1.3 reintroduces random iteration for small maps in order to flush out these bugs. +

+ +

+Updating: If code assumes a fixed iteration order for small maps, +it will break and must be rewritten not to make that assumption. +Because only small maps are affected, the problem arises most often in tests. +

+ + + +

+As part of the general overhaul to +the Go linker, the compilers and linkers have been refactored. +The linker is still a C program, but now the instruction selection phase that +was part of the linker has been moved to the compiler through the creation of a new +library called liblink. +By doing instruction selection only once, when the package is first compiled, +this can speed up compilation of large projects significantly. +

+ +

+Updating: Although this is a major internal change, it should have no +effect on programs. +

+ +

Status of gccgo

+ +

+GCC release 4.9 will contain the Go 1.2 (not 1.3) version of gccgo. +The release schedules for the GCC and Go projects do not coincide, +which means that 1.3 will be available in the development branch but +that the next GCC release, 4.10, will likely have the Go 1.4 version of gccgo. +

+ +

Changes to the go command

+ +

+The cmd/go command has several new +features. +The go run and +go test subcommands +support a new -exec option to specify an alternate +way to run the resulting binary. +Its immediate purpose is to support NaCl. +

+ +

+The test coverage support of the go test +subcommand now automatically sets the coverage mode to -atomic +when the race detector is enabled, to eliminate false reports about unsafe +access to coverage counters. +

+ +

+The go test subcommand +now always builds the package, even if it has no test files. +Previously, it would do nothing if no test files were present. +

+ +

+The go build subcommand +supports a new -i option to install dependencies +of the specified target, but not the target itself. +

+ +

+Cross compiling with cgo enabled +is now supported. +The CC_FOR_TARGET and CXX_FOR_TARGET environment +variables are used when running all.bash to specify the cross compilers +for C and C++ code, respectively. +

+ +

+Finally, the go command now supports packages that import Objective-C +files (suffixed .m) through cgo. +

+ +

Changes to cgo

+ +

+The cmd/cgo command, +which processes import "C" declarations in Go packages, +has corrected a serious bug that may cause some packages to stop compiling. +Previously, all pointers to incomplete struct types translated to the Go type *[0]byte, +with the effect that the Go compiler could not diagnose passing one kind of struct pointer +to a function expecting another. +Go 1.3 corrects this mistake by translating each different +incomplete struct to a different named type. +

+ +

+Given the C declaration typedef struct S T for an incomplete struct S, +some Go code used this bug to refer to the types C.struct_S and C.T interchangeably. +Cgo now explicitly allows this use, even for completed struct types. +However, some Go code also used this bug to pass (for example) a *C.FILE +from one package to another. +This is not legal and no longer works: in general Go packages +should avoid exposing C types and names in their APIs. +

+ +

+Updating: Code confusing pointers to incomplete types or +passing them across package boundaries will no longer compile +and must be rewritten. +If the conversion is correct and must be preserved, +use an explicit conversion via unsafe.Pointer. +

+ +

SWIG 3.0 required for programs that use SWIG

+ +

+For Go programs that use SWIG, SWIG version 3.0 is now required. +The cmd/go command will now link the +SWIG generated object files directly into the binary, rather than +building and linking with a shared library. +

+ +

Command-line flag parsing

+ +

+In the gc tool chain, the assemblers now use the +same command-line flag parsing rules as the Go flag package, a departure +from the traditional Unix flag parsing. +This may affect scripts that invoke the tool directly. +For example, +go tool 6a -SDfoo must now be written +go tool 6a -S -D foo. +(The same change was made to the compilers and linkers in Go 1.1.) +

+ +

Changes to godoc

+

+When invoked with the -analysis flag, +godoc +now performs sophisticated static +analysis of the code it indexes. +The results of analysis are presented in both the source view and the +package documentation view, and include the call graph of each package +and the relationships between +definitions and references, +types and their methods, +interfaces and their implementations, +send and receive operations on channels, +functions and their callers, and +call sites and their callees. +

+ +

Miscellany

+ +

+The program misc/benchcmp that compares +performance across benchmarking runs has been rewritten. +Once a shell and awk script in the main repository, it is now a Go program in the go.tools repo. +Documentation is here. +

+ +

+For the few of us that build Go distributions, the tool misc/dist has been +moved and renamed; it now lives in misc/makerelease, still in the main repository. +

+ +

Performance

+ +

+The performance of Go binaries for this release has improved in many cases due to changes +in the runtime and garbage collection, plus some changes to libraries. +Significant instances include: +

+ +
    + +
  • +The runtime handles defers more efficiently, reducing the memory footprint by about two kilobytes +per goroutine that calls defer. +
  • + +
  • +The garbage collector has been sped up, using a concurrent sweep algorithm, +better parallelization, and larger pages. +The cumulative effect can be a 50-70% reduction in collector pause time. +
  • + +
  • +The race detector (see this guide) +is now about 40% faster. +
  • + +
  • +The regular expression package regexp +is now significantly faster for certain simple expressions due to the implementation of +a second, one-pass execution engine. +The choice of which engine to use is automatic; +the details are hidden from the user. +
  • + +
+ +

+Also, the runtime now includes in stack dumps how long a goroutine has been blocked, +which can be useful information when debugging deadlocks or performance issues. +

+ +

Changes to the standard library

+ +

New packages

+ +

+A new package debug/plan9obj was added to the standard library. +It implements access to Plan 9 a.out object files. +

+ +

Major changes to the library

+ +

+A previous bug in crypto/tls +made it possible to skip verification in TLS inadvertently. +In Go 1.3, the bug is fixed: one must specify either ServerName or +InsecureSkipVerify, and if ServerName is specified it is enforced. +This may break existing code that incorrectly depended on insecure +behavior. +

+ +

+There is an important new type added to the standard library: sync.Pool. +It provides an efficient mechanism for implementing certain types of caches whose memory +can be reclaimed automatically by the system. +

+ +

+The testing package's benchmarking helper, +B, now has a +RunParallel method +to make it easier to run benchmarks that exercise multiple CPUs. +

+ +

+Updating: The crypto/tls fix may break existing code, but such +code was erroneous and should be updated. +

+ +

Minor changes to the library

+ +

+The following list summarizes a number of minor changes to the library, mostly additions. +See the relevant package documentation for more information about each change. +

+ +
    + +
  • In the crypto/tls package, +a new DialWithDialer +function lets one establish a TLS connection using an existing dialer, making it easier +to control dial options such as timeouts. +The package also now reports the TLS version used by the connection in the +ConnectionState +struct. +
  • + +
  • The CreateCertificate +function of the crypto/tls package +now supports parsing (and elsewhere, serialization) of PKCS #10 certificate +signature requests. +
  • + +
  • +The formatted print functions of the fmt package now define %F +as a synonym for %f when printing floating-point values. +
  • + +
  • +The math/big package's +Int and +Rat types +now implement +encoding.TextMarshaler and +encoding.TextUnmarshaler. +
  • + +
  • +The complex power function, Pow, +now specifies the behavior when the first argument is zero. +It was undefined before. +The details are in the documentation for the function. +
  • + +
  • +The net/http package now exposes the +properties of a TLS connection used to make a client request in the new +Response.TLS field. +
  • + +
  • +The net/http package now +allows setting an optional server error logger +with Server.ErrorLog. +The default is still that all errors go to stderr. +
  • + +
  • +The net/http package now +supports disabling HTTP keep-alive connections on the server +with Server.SetKeepAlivesEnabled. +The default continues to be that the server does keep-alive (reuses +connections for multiple requests) by default. +Only resource-constrained servers or those in the process of graceful +shutdown will want to disable them. +
  • + +
  • +The net/http package adds an optional +Transport.TLSHandshakeTimeout +setting to cap the amount of time HTTP client requests will wait for +TLS handshakes to complete. +It's now also set by default +on DefaultTransport. +
  • + +
  • +The net/http package's +DefaultTransport, +used by the HTTP client code, now +enables TCP +keep-alives by default. +Other Transport +values with a nil Dial field continue to function the same +as before: no TCP keep-alives are used. +
  • + +
  • +The net/http package +now enables TCP +keep-alives for incoming server requests when +ListenAndServe +or +ListenAndServeTLS +are used. +When a server is started otherwise, TCP keep-alives are not enabled. +
  • + +
  • +The net/http package now +provides an +optional Server.ConnState +callback to hook various phases of a server connection's lifecycle +(see ConnState). +This can be used to implement rate limiting or graceful shutdown. +
  • + +
  • +The net/http package's HTTP +client now has an +optional Client.Timeout +field to specify an end-to-end timeout on requests made using the +client. +
  • + +
  • +The net/http package's +Request.ParseMultipartForm +method will now return an error if the body's Content-Type +is not mutipart/form-data. +Prior to Go 1.3 it would silently fail and return nil. +Code that relies on the previous behavior should be updated. +
  • + +
  • In the net package, +the Dialer struct now +has a KeepAlive option to specify a keep-alive period for the connection. +
  • + +
  • +The net/http package's +Transport +now closes Request.Body +consistently, even on error. +
  • + +
  • +The os/exec package now implements +what the documentation has always said with regard to relative paths for the binary. +In particular, it only calls LookPath +when the binary's file name contains no path separators. +
  • + +
  • +The SetMapIndex +function in the reflect package +no longer panics when deleting from a nil map. +
  • + +
  • +If the main goroutine calls +runtime.Goexit +and all other goroutines finish execution, the program now always crashes, +reporting a detected deadlock. +Earlier versions of Go handled this situation inconsistently: most instances +were reported as deadlocks, but some trivial cases exited cleanly instead. +
  • + +
  • +The runtime/debug package now has a new function +debug.WriteHeapDump +that writes out a description of the heap. +
  • + +
  • +The CanBackquote +function in the strconv package +now considers the DEL character, U+007F, to be +non-printing. +
  • + +
  • +The syscall package now provides +SendmsgN +as an alternate version of +Sendmsg +that returns the number of bytes written. +
  • + +
  • +On Windows, the syscall package now +supports the cdecl calling convention through the addition of a new function +NewCallbackCDecl +alongside the existing function +NewCallback. +
  • + +
  • +The testing package now +diagnoses tests that call panic(nil), which are almost always erroneous. +Also, tests now write profiles (if invoked with profiling flags) even on failure. +
  • + +
  • +The unicode package and associated +support throughout the system has been upgraded from +Unicode 6.2.0 to Unicode 6.3.0. +
  • + +
diff --git a/doc/go1.4.html b/doc/go1.4.html new file mode 100644 index 0000000000000000000000000000000000000000..ca44d56ceb2b61cfc53d91e3a0f3a13ef0b25e65 --- /dev/null +++ b/doc/go1.4.html @@ -0,0 +1,896 @@ + + +

Introduction to Go 1.4

+ +

+The latest Go release, version 1.4, arrives as scheduled six months after 1.3. +

+ +

+It contains only one tiny language change, +in the form of a backwards-compatible simple variant of for-range loop, +and a possibly breaking change to the compiler involving methods on pointers-to-pointers. +

+ +

+The release focuses primarily on implementation work, improving the garbage collector +and preparing the ground for a fully concurrent collector to be rolled out in the +next few releases. +Stacks are now contiguous, reallocated when necessary rather than linking on new +"segments"; +this release therefore eliminates the notorious "hot stack split" problem. +There are some new tools available including support in the go command +for build-time source code generation. +The release also adds support for ARM processors on Android and Native Client (NaCl) +and for AMD64 on Plan 9. +

+ +

+As always, Go 1.4 keeps the promise +of compatibility, +and almost everything +will continue to compile and run without change when moved to 1.4. +

+ +

Changes to the language

+ +

For-range loops

+

+Up until Go 1.3, for-range loop had two forms +

+ +
+for i, v := range x {
+	...
+}
+
+ +

+and +

+ +
+for i := range x {
+	...
+}
+
+ +

+If one was not interested in the loop values, only the iteration itself, it was still +necessary to mention a variable (probably the blank identifier, as in +for _ = range x), because +the form +

+ +
+for range x {
+	...
+}
+
+ +

+was not syntactically permitted. +

+ +

+This situation seemed awkward, so as of Go 1.4 the variable-free form is now legal. +The pattern arises rarely but the code can be cleaner when it does. +

+ +

+Updating: The change is strictly backwards compatible to existing Go +programs, but tools that analyze Go parse trees may need to be modified to accept +this new form as the +Key field of RangeStmt +may now be nil. +

+ +

Method calls on **T

+ +

+Given these declarations, +

+ +
+type T int
+func (T) M() {}
+var x **T
+
+ +

+both gc and gccgo accepted the method call +

+ +
+x.M()
+
+ +

+which is a double dereference of the pointer-to-pointer x. +The Go specification allows a single dereference to be inserted automatically, +but not two, so this call is erroneous according to the language definition. +It has therefore been disallowed in Go 1.4, which is a breaking change, +although very few programs will be affected. +

+ +

+Updating: Code that depends on the old, erroneous behavior will no longer +compile but is easy to fix by adding an explicit dereference. +

+ +

Changes to the supported operating systems and architectures

+ +

Android

+ +

+Go 1.4 can build binaries for ARM processors running the Android operating system. +It can also build a .so library that can be loaded by an Android application +using the supporting packages in the mobile subrepository. +A brief description of the plans for this experimental port are available +here. +

+ +

NaCl on ARM

+ +

+The previous release introduced Native Client (NaCl) support for the 32-bit x86 +(GOARCH=386) +and 64-bit x86 using 32-bit pointers (GOARCH=amd64p32). +The 1.4 release adds NaCl support for ARM (GOARCH=arm). +

+ +

Plan9 on AMD64

+ +

+This release adds support for the Plan 9 operating system on AMD64 processors, +provided the kernel supports the nsec system call and uses 4K pages. +

+ +

Changes to the compatibility guidelines

+ +

+The unsafe package allows one +to defeat Go's type system by exploiting internal details of the implementation +or machine representation of data. +It was never explicitly specified what use of unsafe meant +with respect to compatibility as specified in the +Go compatibility guidelines. +The answer, of course, is that we can make no promise of compatibility +for code that does unsafe things. +

+ +

+We have clarified this situation in the documentation included in the release. +The Go compatibility guidelines and the +docs for the unsafe package +are now explicit that unsafe code is not guaranteed to remain compatible. +

+ +

+Updating: Nothing technical has changed; this is just a clarification +of the documentation. +

+ + +

Changes to the implementations and tools

+ +

Changes to the runtime

+ +

+Prior to Go 1.4, the runtime (garbage collector, concurrency support, interface management, +maps, slices, strings, ...) was mostly written in C, with some assembler support. +In 1.4, much of the code has been translated to Go so that the garbage collector can scan +the stacks of programs in the runtime and get accurate information about what variables +are active. +This change was large but should have no semantic effect on programs. +

+ +

+This rewrite allows the garbage collector in 1.4 to be fully precise, +meaning that it is aware of the location of all active pointers in the program. +This means the heap will be smaller as there will be no false positives keeping non-pointers alive. +Other related changes also reduce the heap size, which is smaller by 10%-30% overall +relative to the previous release. +

+ +

+A consequence is that stacks are no longer segmented, eliminating the "hot split" problem. +When a stack limit is reached, a new, larger stack is allocated, all active frames for +the goroutine are copied there, and any pointers into the stack are updated. +Performance can be noticeably better in some cases and is always more predictable. +Details are available in the design document. +

+ +

+The use of contiguous stacks means that stacks can start smaller without triggering performance issues, +so the default starting size for a goroutine's stack in 1.4 has been reduced from 8192 bytes to 2048 bytes. +

+ +

+As preparation for the concurrent garbage collector scheduled for the 1.5 release, +writes to pointer values in the heap are now done by a function call, +called a write barrier, rather than directly from the function updating the value. +In this next release, this will permit the garbage collector to mediate writes to the heap while it is running. +This change has no semantic effect on programs in 1.4, but was +included in the release to test the compiler and the resulting performance. +

+ +

+The implementation of interface values has been modified. +In earlier releases, the interface contained a word that was either a pointer or a one-word +scalar value, depending on the type of the concrete object stored. +This implementation was problematical for the garbage collector, +so as of 1.4 interface values always hold a pointer. +In running programs, most interface values were pointers anyway, +so the effect is minimal, but programs that store integers (for example) in +interfaces will see more allocations. +

+ +

+As of Go 1.3, the runtime crashes if it finds a memory word that should contain +a valid pointer but instead contains an obviously invalid pointer (for example, the value 3). +Programs that store integers in pointer values may run afoul of this check and crash. +In Go 1.4, setting the GODEBUG variable +invalidptr=0 disables +the crash as a workaround, but we cannot guarantee that future releases will be +able to avoid the crash; the correct fix is to rewrite code not to alias integers and pointers. +

+ +

Assembly

+ +

+The language accepted by the assemblers cmd/5a, cmd/6a +and cmd/8a has had several changes, +mostly to make it easier to deliver type information to the runtime. +

+ +

+First, the textflag.h file that defines flags for TEXT directives +has been copied from the linker source directory to a standard location so it can be +included with the simple directive +

+ +
+#include "textflag.h"
+
+ +

+The more important changes are in how assembler source can define the necessary +type information. +For most programs it will suffice to move data +definitions (DATA and GLOBL directives) +out of assembly into Go files +and to write a Go declaration for each assembly function. +The assembly document describes what to do. +

+ +

+Updating: +Assembly files that include textflag.h from its old +location will still work, but should be updated. +For the type information, most assembly routines will need no change, +but all should be examined. +Assembly source files that define data, +functions with non-empty stack frames, or functions that return pointers +need particular attention. +A description of the necessary (but simple) changes +is in the assembly document. +

+ +

+More information about these changes is in the assembly document. +

+ +

Status of gccgo

+ +

+The release schedules for the GCC and Go projects do not coincide. +GCC release 4.9 contains the Go 1.2 version of gccgo. +The next release, GCC 5, will likely have the Go 1.4 version of gccgo. +

+ +

Internal packages

+ +

+Go's package system makes it easy to structure programs into components with clean boundaries, +but there are only two forms of access: local (unexported) and global (exported). +Sometimes one wishes to have components that are not exported, +for instance to avoid acquiring clients of interfaces to code that is part of a public repository +but not intended for use outside the program to which it belongs. +

+ +

+The Go language does not have the power to enforce this distinction, but as of Go 1.4 the +go command introduces +a mechanism to define "internal" packages that may not be imported by packages outside +the source subtree in which they reside. +

+ +

+To create such a package, place it in a directory named internal or in a subdirectory of a directory +named internal. +When the go command sees an import of a package with internal in its path, +it verifies that the package doing the import +is within the tree rooted at the parent of the internal directory. +For example, a package .../a/b/c/internal/d/e/f +can be imported only by code in the directory tree rooted at .../a/b/c. +It cannot be imported by code in .../a/b/g or in any other repository. +

+ +

+For Go 1.4, the internal package mechanism is enforced for the main Go repository; +from 1.5 and onward it will be enforced for any repository. +

+ +

+Full details of the mechanism are in +the design document. +

+ +

Canonical import paths

+ +

+Code often lives in repositories hosted by public services such as github.com, +meaning that the import paths for packages begin with the name of the hosting service, +github.com/rsc/pdf for example. +One can use +an existing mechanism +to provide a "custom" or "vanity" import path such as +rsc.io/pdf, but +that creates two valid import paths for the package. +That is a problem: one may inadvertently import the package through the two +distinct paths in a single program, which is wasteful; +miss an update to a package because the path being used is not recognized to be +out of date; +or break clients using the old path by moving the package to a different hosting service. +

+ +

+Go 1.4 introduces an annotation for package clauses in Go source that identify a canonical +import path for the package. +If an import is attempted using a path that is not canonical, +the go command +will refuse to compile the importing package. +

+ +

+The syntax is simple: put an identifying comment on the package line. +For our example, the package clause would read: +

+ +
+package pdf // import "rsc.io/pdf"
+
+ +

+With this in place, +the go command will +refuse to compile a package that imports github.com/rsc/pdf, +ensuring that the code can be moved without breaking users. +

+ +

+The check is at build time, not download time, so if go get +fails because of this check, the mis-imported package has been copied to the local machine +and should be removed manually. +

+ +

+To complement this new feature, a check has been added at update time to verify +that the local package's remote repository matches that of its custom import. +The go get -u command will fail to +update a package if its remote repository has changed since it was first +downloaded. +The new -f flag overrides this check. +

+ +

+Further information is in +the design document. +

+ +

Import paths for the subrepositories

+ +

+The Go project subrepositories (code.google.com/p/go.tools and so on) +are now available under custom import paths replacing code.google.com/p/go. with golang.org/x/, +as in golang.org/x/tools. +We will add canonical import comments to the code around June 1, 2015, +at which point Go 1.4 and later will stop accepting the old code.google.com paths. +

+ +

+Updating: All code that imports from subrepositories should change +to use the new golang.org paths. +Go 1.0 and later can resolve and import the new paths, so updating will not break +compatibility with older releases. +Code that has not updated will stop compiling with Go 1.4 around June 1, 2015. +

+ +

The go generate subcommand

+ +

+The go command has a new subcommand, +go generate, +to automate the running of tools to generate source code before compilation. +For example, it can be used to run the yacc +compiler-compiler on a .y file to produce the Go source file implementing the grammar, +or to automate the generation of String methods for typed constants using the new +stringer +tool in the golang.org/x/tools subrepository. +

+ +

+For more information, see the +design document. +

+ +

Change to file name handling

+ +

+Build constraints, also known as build tags, control compilation by including or excluding files +(see the documentation /go/build). +Compilation can also be controlled by the name of the file itself by "tagging" the file with +a suffix (before the .go or .s extension) with an underscore +and the name of the architecture or operating system. +For instance, the file gopher_arm.go will only be compiled if the target +processor is an ARM. +

+ +

+Before Go 1.4, a file called just arm.go was similarly tagged, but this behavior +can break sources when new architectures are added, causing files to suddenly become tagged. +In 1.4, therefore, a file will be tagged in this manner only if the tag (architecture or operating +system name) is preceded by an underscore. +

+ +

+Updating: Packages that depend on the old behavior will no longer compile correctly. +Files with names like windows.go or amd64.go should either +have explicit build tags added to the source or be renamed to something like +os_windows.go or support_amd64.go. +

+ +

Other changes to the go command

+ +

+There were a number of minor changes to the +cmd/go +command worth noting. +

+ +
    + +
  • +Unless cgo is being used to build the package, +the go command now refuses to compile C source files, +since the relevant C compilers +(6c etc.) +are intended to be removed from the installation in some future release. +(They are used today only to build part of the runtime.) +It is difficult to use them correctly in any case, so any extant uses are likely incorrect, +so we have disabled them. +
  • + +
  • +The go test +subcommand has a new flag, -o, to set the name of the resulting binary, +corresponding to the same flag in other subcommands. +The non-functional -file flag has been removed. +
  • + +
  • +The go test +subcommand will compile and link all *_test.go files in the package, +even when there are no Test functions in them. +It previously ignored such files. +
  • + +
  • +The behavior of the +go build +subcommand's +-a flag has been changed for non-development installations. +For installations running a released distribution, the -a flag will no longer +rebuild the standard library and commands, to avoid overwriting the installation's files. +
  • + +
+ +

Changes to package source layout

+ +

+In the main Go source repository, the source code for the packages was kept in +the directory src/pkg, which made sense but differed from +other repositories, including the Go subrepositories. +In Go 1.4, the pkg level of the source tree is now gone, so for example +the fmt package's source, once kept in +directory src/pkg/fmt, now lives one level higher in src/fmt. +

+ +

+Updating: Tools like godoc that discover source code +need to know about the new location. All tools and services maintained by the Go team +have been updated. +

+ + +

SWIG

+ +

+Due to runtime changes in this release, Go 1.4 requires SWIG 3.0.3. +

+ +

Miscellany

+ +

+The standard repository's top-level misc directory used to contain +Go support for editors and IDEs: plugins, initialization scripts and so on. +Maintaining these was becoming time-consuming +and needed external help because many of the editors listed were not used by +members of the core team. +It also required us to make decisions about which plugin was best for a given +editor, even for editors we do not use. +

+ +

+The Go community at large is much better suited to managing this information. +In Go 1.4, therefore, this support has been removed from the repository. +Instead, there is a curated, informative list of what's available on +a wiki page. +

+ +

Performance

+ +

+Most programs will run about the same speed or slightly faster in 1.4 than in 1.3; +some will be slightly slower. +There are many changes, making it hard to be precise about what to expect. +

+ +

+As mentioned above, much of the runtime was translated to Go from C, +which led to some reduction in heap sizes. +It also improved performance slightly because the Go compiler is better +at optimization, due to things like inlining, than the C compiler used to build +the runtime. +

+ +

+The garbage collector was sped up, leading to measurable improvements for +garbage-heavy programs. +On the other hand, the new write barriers slow things down again, typically +by about the same amount but, depending on their behavior, some programs +may be somewhat slower or faster. +

+ +

+Library changes that affect performance are documented below. +

+ +

Changes to the standard library

+ +

New packages

+ +

+There are no new packages in this release. +

+ +

Major changes to the library

+ +

bufio.Scanner

+ +

+The Scanner type in the +bufio package +has had a bug fixed that may require changes to custom +split functions. +The bug made it impossible to generate an empty token at EOF; the fix +changes the end conditions seen by the split function. +Previously, scanning stopped at EOF if there was no more data. +As of 1.4, the split function will be called once at EOF after input is exhausted, +so the split function can generate a final empty token +as the documentation already promised. +

+ +

+Updating: Custom split functions may need to be modified to +handle empty tokens at EOF as desired. +

+ +

syscall

+ +

+The syscall package is now frozen except +for changes needed to maintain the core repository. +In particular, it will no longer be extended to support new or different system calls +that are not used by the core. +The reasons are described at length in a +separate document. +

+ +

+A new subrepository, golang.org/x/sys, +has been created to serve as the location for new developments to support system +calls on all kernels. +It has a nicer structure, with three packages that each hold the implementation of +system calls for one of +Unix, +Windows and +Plan 9. +These packages will be curated more generously, accepting all reasonable changes +that reflect kernel interfaces in those operating systems. +See the documentation and the article mentioned above for more information. +

+ +

+Updating: Existing programs are not affected as the syscall +package is largely unchanged from the 1.3 release. +Future development that requires system calls not in the syscall package +should build on golang.org/x/sys instead. +

+ +

Minor changes to the library

+ +

+The following list summarizes a number of minor changes to the library, mostly additions. +See the relevant package documentation for more information about each change. +

+ +
    + +
  • +The archive/zip package's +Writer now supports a +Flush method. +
  • + +
  • +The compress/flate, +compress/gzip, +and compress/zlib +packages now support a Reset method +for the decompressors, allowing them to reuse buffers and improve performance. +The compress/gzip package also has a +Multistream method to control support +for multistream files. +
  • + +
  • +The crypto package now has a +Signer interface, implemented by the +PrivateKey types in +crypto/ecdsa and +crypto/rsa. +
  • + +
  • +The crypto/tls package +now supports ALPN as defined in RFC 7301. +
  • + +
  • +The crypto/tls package +now supports programmatic selection of server certificates +through the new CertificateForName function +of the Config struct. +
  • + +
  • +Also in the crypto/tls package, the server now supports +TLS_FALLBACK_SCSV +to help clients detect fallback attacks. +(The Go client does not support fallback at all, so it is not vulnerable to +those attacks.) +
  • + +
  • +The database/sql package can now list all registered +Drivers. +
  • + +
  • +The debug/dwarf package now supports +UnspecifiedTypes. +
  • + +
  • +In the encoding/asn1 package, +optional elements with a default value will now only be omitted if they have that value. +
  • + +
  • +The encoding/csv package no longer +quotes empty strings but does quote the end-of-data marker \. (backslash dot). +This is permitted by the definition of CSV and allows it to work better with Postgres. +
  • + +
  • +The encoding/gob package has been rewritten to eliminate +the use of unsafe operations, allowing it to be used in environments that do not permit use of the +unsafe package. +For typical uses it will be 10-30% slower, but the delta is dependent on the type of the data and +in some cases, especially involving arrays, it can be faster. +There is no functional change. +
  • + +
  • +The encoding/xml package's +Decoder can now report its input offset. +
  • + +
  • +In the fmt package, +formatting of pointers to maps has changed to be consistent with that of pointers +to structs, arrays, and so on. +For instance, &map[string]int{"one": 1} now prints by default as +&map[one: 1] rather than as a hexadecimal pointer value. +
  • + +
  • +The image package's +Image +implementations like +RGBA and +Gray have specialized +RGBAAt and +GrayAt methods alongside the general +At method. +
  • + +
  • +The image/png package now has an +Encoder +type to control the compression level used for encoding. +
  • + +
  • +The math package now has a +Nextafter32 function. +
  • + +
  • +The net/http package's +Request type +has a new BasicAuth method +that returns the username and password from authenticated requests using the +HTTP Basic Authentication +Scheme. +
  • + +
  • The net/http package's +Transport type +has a new DialTLS hook +that allows customizing the behavior of outbound TLS connections. +
  • + +
  • +The net/http/httputil package's +ReverseProxy type +has a new field, +ErrorLog, that +provides user control of logging. +
  • + +
  • +The os package +now implements symbolic links on the Windows operating system +through the Symlink function. +Other operating systems already have this functionality. +There is also a new Unsetenv function. +
  • + +
  • +The reflect package's +Type interface +has a new method, Comparable, +that reports whether the type implements general comparisons. +
  • + +
  • +Also in the reflect package, the +Value interface is now three instead of four words +because of changes to the implementation of interfaces in the runtime. +This saves memory but has no semantic effect. +
  • + +
  • +The runtime package +now implements monotonic clocks on Windows, +as it already did for the other systems. +
  • + +
  • +The runtime package's +Mallocs counter +now counts very small allocations that were missed in Go 1.3. +This may break tests using ReadMemStats +or AllocsPerRun +due to the more accurate answer. +
  • + +
  • +In the runtime package, +an array PauseEnd +has been added to the +MemStats +and GCStats structs. +This array is a circular buffer of times when garbage collection pauses ended. +The corresponding pause durations are already recorded in +PauseNs +
  • + +
  • +The runtime/race package +now supports FreeBSD, which means the +go command's -race +flag now works on FreeBSD. +
  • + +
  • +The sync/atomic package +has a new type, Value. +Value provides an efficient mechanism for atomic loads and +stores of values of arbitrary type. +
  • + +
  • +In the syscall package's +implementation on Linux, the +Setuid +and Setgid have been disabled +because those system calls operate on the calling thread, not the whole process, which is +different from other platforms and not the expected result. +
  • + +
  • +The testing package +has a new facility to provide more control over running a set of tests. +If the test code contains a function +
    +func TestMain(m *testing.M) 
    +
    + +that function will be called instead of running the tests directly. +The M struct contains methods to access and run the tests. +
  • + +
  • +Also in the testing package, +a new Coverage +function reports the current test coverage fraction, +enabling individual tests to report how much they are contributing to the +overall coverage. +
  • + +
  • +The text/scanner package's +Scanner type +has a new function, +IsIdentRune, +allowing one to control the definition of an identifier when scanning. +
  • + +
  • +The text/template package's boolean +functions eq, lt, and so on have been generalized to allow comparison +of signed and unsigned integers, simplifying their use in practice. +(Previously one could only compare values of the same signedness.) +All negative values compare less than all unsigned values. +
  • + +
  • +The time package now uses the standard symbol for the micro prefix, +the micro symbol (U+00B5 'µ'), to print microsecond durations. +ParseDuration still accepts us +but the package no longer prints microseconds as us. +
    +Updating: Code that depends on the output format of durations +but does not use ParseDuration will need to be updated. +
  • + +
diff --git a/doc/go1.5.html b/doc/go1.5.html new file mode 100644 index 0000000000000000000000000000000000000000..693a1857ce980324036bf2ed47b19c772d6c547d --- /dev/null +++ b/doc/go1.5.html @@ -0,0 +1,1310 @@ + + + +

Introduction to Go 1.5

+ +

+The latest Go release, version 1.5, +is a significant release, including major architectural changes to the implementation. +Despite that, we expect almost all Go programs to continue to compile and run as before, +because the release still maintains the Go 1 promise +of compatibility. +

+ +

+The biggest developments in the implementation are: +

+ +
    + +
  • +The compiler and runtime are now written entirely in Go (with a little assembler). +C is no longer involved in the implementation, and so the C compiler that was +once necessary for building the distribution is gone. +
  • + +
  • +The garbage collector is now concurrent and provides dramatically lower +pause times by running, when possible, in parallel with other goroutines. +
  • + +
  • +By default, Go programs run with GOMAXPROCS set to the +number of cores available; in prior releases it defaulted to 1. +
  • + +
  • +Support for internal packages +is now provided for all repositories, not just the Go core. +
  • + +
  • +The go command now provides experimental +support for "vendoring" external dependencies. +
  • + +
  • +A new go tool trace command supports fine-grained +tracing of program execution. +
  • + +
  • +A new go doc command (distinct from godoc) +is customized for command-line use. +
  • + +
+ +

+These and a number of other changes to the implementation and tools +are discussed below. +

+ +

+The release also contains one small language change involving map literals. +

+ +

+Finally, the timing of the release +strays from the usual six-month interval, +both to provide more time to prepare this major release and to shift the schedule thereafter to +time the release dates more conveniently. +

+ +

Changes to the language

+ +

Map literals

+ +

+Due to an oversight, the rule that allowed the element type to be elided from slice literals was not +applied to map keys. +This has been corrected in Go 1.5. +An example will make this clear. +As of Go 1.5, this map literal, +

+ +
+m := map[Point]string{
+    Point{29.935523, 52.891566}:   "Persepolis",
+    Point{-25.352594, 131.034361}: "Uluru",
+    Point{37.422455, -122.084306}: "Googleplex",
+}
+
+ +

+may be written as follows, without the Point type listed explicitly: +

+ +
+m := map[Point]string{
+    {29.935523, 52.891566}:   "Persepolis",
+    {-25.352594, 131.034361}: "Uluru",
+    {37.422455, -122.084306}: "Googleplex",
+}
+
+ +

The Implementation

+ +

No more C

+ +

+The compiler and runtime are now implemented in Go and assembler, without C. +The only C source left in the tree is related to testing or to cgo. +There was a C compiler in the tree in 1.4 and earlier. +It was used to build the runtime; a custom compiler was necessary in part to +guarantee the C code would work with the stack management of goroutines. +Since the runtime is in Go now, there is no need for this C compiler and it is gone. +Details of the process to eliminate C are discussed elsewhere. +

+ +

+The conversion from C was done with the help of custom tools created for the job. +Most important, the compiler was actually moved by automatic translation of +the C code into Go. +It is in effect the same program in a different language. +It is not a new implementation +of the compiler so we expect the process will not have introduced new compiler +bugs. +An overview of this process is available in the slides for +this presentation. +

+ +

Compiler and tools

+ +

+Independent of but encouraged by the move to Go, the names of the tools have changed. +The old names 6g, 8g and so on are gone; instead there +is just one binary, accessible as go tool compile, +that compiles Go source into binaries suitable for the architecture and operating system +specified by $GOARCH and $GOOS. +Similarly, there is now one linker (go tool link) +and one assembler (go tool asm). +The linker was translated automatically from the old C implementation, +but the assembler is a new native Go implementation discussed +in more detail below. +

+ +

+Similar to the drop of the names 6g, 8g, and so on, +the output of the compiler and assembler are now given a plain .o suffix +rather than .8, .6, etc. +

+ + +

Garbage collector

+ +

+The garbage collector has been re-engineered for 1.5 as part of the development +outlined in the design document. +Expected latencies are much lower than with the collector +in prior releases, through a combination of advanced algorithms, +better scheduling of the collector, +and running more of the collection in parallel with the user program. +The "stop the world" phase of the collector +will almost always be under 10 milliseconds and usually much less. +

+ +

+For systems that benefit from low latency, such as user-responsive web sites, +the drop in expected latency with the new collector may be important. +

+ +

+Details of the new collector were presented in a +talk at GopherCon 2015. +

+ +

Runtime

+ +

+In Go 1.5, the order in which goroutines are scheduled has been changed. +The properties of the scheduler were never defined by the language, +but programs that depend on the scheduling order may be broken +by this change. +We have seen a few (erroneous) programs affected by this change. +If you have programs that implicitly depend on the scheduling +order, you will need to update them. +

+ +

+Another potentially breaking change is that the runtime now +sets the default number of threads to run simultaneously, +defined by GOMAXPROCS, to the number +of cores available on the CPU. +In prior releases the default was 1. +Programs that do not expect to run with multiple cores may +break inadvertently. +They can be updated by removing the restriction or by setting +GOMAXPROCS explicitly. +For a more detailed discussion of this change, see +the design document. +

+ +

Build

+ +

+Now that the Go compiler and runtime are implemented in Go, a Go compiler +must be available to compile the distribution from source. +Thus, to build the Go core, a working Go distribution must already be in place. +(Go programmers who do not work on the core are unaffected by this change.) +Any Go 1.4 or later distribution (including gccgo) will serve. +For details, see the design document. +

+ +

Ports

+ +

+Due mostly to the industry's move away from the 32-bit x86 architecture, +the set of binary downloads provided is reduced in 1.5. +A distribution for the OS X operating system is provided only for the +amd64 architecture, not 386. +Similarly, the ports for Snow Leopard (Apple OS X 10.6) still work but are no +longer released as a download or maintained since Apple no longer maintains that version +of the operating system. +Also, the dragonfly/386 port is no longer supported at all +because DragonflyBSD itself no longer supports the 32-bit 386 architecture. +

+ +

+There are however several new ports available to be built from source. +These include darwin/arm and darwin/arm64. +The new port linux/arm64 is mostly in place, but cgo +is only supported using external linking. +

+ +

+Also available as experiments are ppc64 +and ppc64le (64-bit PowerPC, big- and little-endian). +Both these ports support cgo but +only with internal linking. +

+ +

+On FreeBSD, Go 1.5 requires FreeBSD 8-STABLE+ because of its new use of the SYSCALL instruction. +

+ +

+On NaCl, Go 1.5 requires SDK version pepper-41. Later pepper versions are not +compatible due to the removal of the sRPC subsystem from the NaCl runtime. +

+ +

+On Darwin, the use of the system X.509 certificate interface can be disabled +with the ios build tag. +

+ +

+The Solaris port now has full support for cgo and the packages +net and +crypto/x509, +as well as a number of other fixes and improvements. +

+ +

Tools

+ +

Translating

+ +

+As part of the process to eliminate C from the tree, the compiler and +linker were translated from C to Go. +It was a genuine (machine assisted) translation, so the new programs are essentially +the old programs translated rather than new ones with new bugs. +We are confident the translation process has introduced few if any new bugs, +and in fact uncovered a number of previously unknown bugs, now fixed. +

+ +

+The assembler is a new program, however; it is described below. +

+ +

Renaming

+ +

+The suites of programs that were the compilers (6g, 8g, etc.), +the assemblers (6a, 8a, etc.), +and the linkers (6l, 8l, etc.) +have each been consolidated into a single tool that is configured +by the environment variables GOOS and GOARCH. +The old names are gone; the new tools are available through the go tool +mechanism as go tool compile, +go tool asm, +and go tool link. +Also, the file suffixes .6, .8, etc. for the +intermediate object files are also gone; now they are just plain .o files. +

+ +

+For example, to build and link a program on amd64 for Darwin +using the tools directly, rather than through go build, +one would run: +

+ +
+$ export GOOS=darwin GOARCH=amd64
+$ go tool compile program.go
+$ go tool link program.o
+
+ +

Moving

+ +

+Because the go/types package +has now moved into the main repository (see below), +the vet and +cover +tools have also been moved. +They are no longer maintained in the external golang.org/x/tools repository, +although (deprecated) source still resides there for compatibility with old releases. +

+ +

Compiler

+ +

+As described above, the compiler in Go 1.5 is a single Go program, +translated from the old C source, that replaces 6g, 8g, +and so on. +Its target is configured by the environment variables GOOS and GOARCH. +

+ +

+The 1.5 compiler is mostly equivalent to the old, +but some internal details have changed. +One significant change is that evaluation of constants now uses +the math/big package +rather than a custom (and less well tested) implementation of high precision +arithmetic. +We do not expect this to affect the results. +

+ +

+For the amd64 architecture only, the compiler has a new option, -dynlink, +that assists dynamic linking by supporting references to Go symbols +defined in external shared libraries. +

+ +

Assembler

+ +

+Like the compiler and linker, the assembler in Go 1.5 is a single program +that replaces the suite of assemblers (6a, +8a, etc.) and the environment variables +GOARCH and GOOS +configure the architecture and operating system. +Unlike the other programs, the assembler is a wholly new program +written in Go. +

+ +

+The new assembler is very nearly compatible with the previous +ones, but there are a few changes that may affect some +assembler source files. +See the updated assembler guide +for more specific information about these changes. In summary: + +

+ +

+First, the expression evaluation used for constants is a little +different. +It now uses unsigned 64-bit arithmetic and the precedence +of operators (+, -, <<, etc.) +comes from Go, not C. +We expect these changes to affect very few programs but +manual verification may be required. +

+ +

+Perhaps more important is that on machines where +SP or PC is only an alias +for a numbered register, +such as R13 for the stack pointer and +R15 for the hardware program counter +on ARM, +a reference to such a register that does not include a symbol +is now illegal. +For example, SP and 4(SP) are +illegal but sym+4(SP) is fine. +On such machines, to refer to the hardware register use its +true R name. +

+ +

+One minor change is that some of the old assemblers +permitted the notation +

+ +
+constant=value
+
+ +

+to define a named constant. +Since this is always possible to do with the traditional +C-like #define notation, which is still +supported (the assembler includes an implementation +of a simplified C preprocessor), the feature was removed. +

+ + + +

+The linker in Go 1.5 is now one Go program, +that replaces 6l, 8l, etc. +Its operating system and instruction set are specified +by the environment variables GOOS and GOARCH. +

+ +

+There are several other changes. +The most significant is the addition of a -buildmode option that +expands the style of linking; it now supports +situations such as building shared libraries and allowing other languages +to call into Go libraries. +Some of these were outlined in a design document. +For a list of the available build modes and their use, run +

+ +
+$ go help buildmode
+
+ +

+Another minor change is that the linker no longer records build time stamps in +the header of Windows executables. +Also, although this may be fixed, Windows cgo executables are missing some +DWARF information. +

+ +

+Finally, the -X flag, which takes two arguments, +as in +

+ +
+-X importpath.name value
+
+ +

+now also accepts a more common Go flag style with a single argument +that is itself a name=value pair: +

+ +
+-X importpath.name=value
+
+ +

+Although the old syntax still works, it is recommended that uses of this +flag in scripts and the like be updated to the new form. +

+ +

Go command

+ +

+The go command's basic operation +is unchanged, but there are a number of changes worth noting. +

+ +

+The previous release introduced the idea of a directory internal to a package +being unimportable through the go command. +In 1.4, it was tested with the introduction of some internal elements +in the core repository. +As suggested in the design document, +that change is now being made available to all repositories. +The rules are explained in the design document, but in summary any +package in or under a directory named internal may +be imported by packages rooted in the same subtree. +Existing packages with directory elements named internal may be +inadvertently broken by this change, which was why it was advertised +in the last release. +

+ +

+Another change in how packages are handled is the experimental +addition of support for "vendoring". +For details, see the documentation for the go command +and the design document. +

+ +

+There have also been several minor changes. +Read the documentation for full details. +

+ +
    + +
  • +SWIG support has been updated such that +.swig and .swigcxx +now require SWIG 3.0.6 or later. +
  • + +
  • +The install subcommand now removes the +binary created by the build subcommand +in the source directory, if present, +to avoid problems having two binaries present in the tree. +
  • + +
  • +The std (standard library) wildcard package name +now excludes commands. +A new cmd wildcard covers the commands. +
  • + +
  • +A new -asmflags build option +sets flags to pass to the assembler. +However, +the -ccflags build option has been dropped; +it was specific to the old, now deleted C compiler . +
  • + +
  • +A new -buildmode build option +sets the build mode, described above. +
  • + +
  • +A new -pkgdir build option +sets the location of installed package archives, +to help isolate custom builds. +
  • + +
  • +A new -toolexec build option +allows substitution of a different command to invoke +the compiler and so on. +This acts as a custom replacement for go tool. +
  • + +
  • +The test subcommand now has a -count +flag to specify how many times to run each test and benchmark. +The testing package +does the work here, through by the -test.count flag. +
  • + +
  • +The generate subcommand has a couple of new features. +The -run option specifies a regular expression to select which directives +to execute; this was proposed but never implemented in 1.4. +The executing pattern now has access to two new environment variables: +$GOLINE returns the source line number of the directive +and $DOLLAR expands to a dollar sign. +
  • + +
  • +The get subcommand now has a -insecure +flag that must be enabled if fetching from an insecure repository, one that +does not encrypt the connection. +
  • + +
+ +

Go vet command

+ +

+The go tool vet command now does +more thorough validation of struct tags. +

+ +

Trace command

+ +

+A new tool is available for dynamic execution tracing of Go programs. +The usage is analogous to how the test coverage tool works. +Generation of traces is integrated into go test, +and then a separate execution of the tracing tool itself analyzes the results: +

+ +
+$ go test -trace=trace.out path/to/package
+$ go tool trace [flags] pkg.test trace.out
+
+ +

+The flags enable the output to be displayed in a browser window. +For details, run go tool trace -help. +There is also a description of the tracing facility in this +talk +from GopherCon 2015. +

+ +

Go doc command

+ +

+A few releases back, the go doc +command was deleted as being unnecessary. +One could always run "godoc ." instead. +The 1.5 release introduces a new go doc +command with a more convenient command-line interface than +godoc's. +It is designed for command-line usage specifically, and provides a more +compact and focused presentation of the documentation for a package +or its elements, according to the invocation. +It also provides case-insensitive matching and +support for showing the documentation for unexported symbols. +For details run "go help doc". +

+ +

Cgo

+ +

+When parsing #cgo lines, +the invocation ${SRCDIR} is now +expanded into the path to the source directory. +This allows options to be passed to the +compiler and linker that involve file paths relative to the +source code directory. Without the expansion the paths would be +invalid when the current working directory changes. +

+ +

+Solaris now has full cgo support. +

+ +

+On Windows, cgo now uses external linking by default. +

+ +

+When a C struct ends with a zero-sized field, but the struct itself is +not zero-sized, Go code can no longer refer to the zero-sized field. +Any such references will have to be rewritten. +

+ +

Performance

+ +

+As always, the changes are so general and varied that precise statements +about performance are difficult to make. +The changes are even broader ranging than usual in this release, which +includes a new garbage collector and a conversion of the runtime to Go. +Some programs may run faster, some slower. +On average the programs in the Go 1 benchmark suite run a few percent faster in Go 1.5 +than they did in Go 1.4, +while as mentioned above the garbage collector's pauses are +dramatically shorter, and almost always under 10 milliseconds. +

+ +

+Builds in Go 1.5 will be slower by a factor of about two. +The automatic translation of the compiler and linker from C to Go resulted in +unidiomatic Go code that performs poorly compared to well-written Go. +Analysis tools and refactoring helped to improve the code, but much remains to be done. +Further profiling and optimization will continue in Go 1.6 and future releases. +For more details, see these slides +and associated video. +

+ +

Core library

+ +

Flag

+ +

+The flag package's +PrintDefaults +function, and method on FlagSet, +have been modified to create nicer usage messages. +The format has been changed to be more human-friendly and in the usage +messages a word quoted with `backquotes` is taken to be the name of the +flag's operand to display in the usage message. +For instance, a flag created with the invocation, +

+ +
+cpuFlag = flag.Int("cpu", 1, "run `N` processes in parallel")
+
+ +

+will show the help message, +

+ +
+-cpu N
+    	run N processes in parallel (default 1)
+
+ +

+Also, the default is now listed only when it is not the zero value for the type. +

+ +

Floats in math/big

+ +

+The math/big package +has a new, fundamental data type, +Float, +which implements arbitrary-precision floating-point numbers. +A Float value is represented by a boolean sign, +a variable-length mantissa, and a 32-bit fixed-size signed exponent. +The precision of a Float (the mantissa size in bits) +can be specified explicitly or is otherwise determined by the first +operation that creates the value. +Once created, the size of a Float's mantissa may be modified with the +SetPrec method. +Floats support the concept of infinities, such as are created by +overflow, but values that would lead to the equivalent of IEEE 754 NaNs +trigger a panic. +Float operations support all IEEE-754 rounding modes. +When the precision is set to 24 (53) bits, +operations that stay within the range of normalized float32 +(float64) +values produce the same results as the corresponding IEEE-754 +arithmetic on those values. +

+ +

Go types

+ +

+The go/types package +up to now has been maintained in the golang.org/x +repository; as of Go 1.5 it has been relocated to the main repository. +The code at the old location is now deprecated. +There is also a modest API change in the package, discussed below. +

+ +

+Associated with this move, the +go/constant +package also moved to the main repository; +it was golang.org/x/tools/exact before. +The go/importer package +also moved to the main repository, +as well as some tools described above. +

+ +

Net

+ +

+The DNS resolver in the net package has almost always used cgo to access +the system interface. +A change in Go 1.5 means that on most Unix systems DNS resolution +will no longer require cgo, which simplifies execution +on those platforms. +Now, if the system's networking configuration permits, the native Go resolver +will suffice. +The important effect of this change is that each DNS resolution occupies a goroutine +rather than a thread, +so a program with multiple outstanding DNS requests will consume fewer operating +system resources. +

+ +

+The decision of how to run the resolver applies at run time, not build time. +The netgo build tag that has been used to enforce the use +of the Go resolver is no longer necessary, although it still works. +A new netcgo build tag forces the use of the cgo resolver at +build time. +To force cgo resolution at run time set +GODEBUG=netdns=cgo in the environment. +More debug options are documented here. +

+ +

+This change applies to Unix systems only. +Windows, Mac OS X, and Plan 9 systems behave as before. +

+ +

Reflect

+ +

+The reflect package +has two new functions: ArrayOf +and FuncOf. +These functions, analogous to the extant +SliceOf function, +create new types at runtime to describe arrays and functions. +

+ +

Hardening

+ +

+Several dozen bugs were found in the standard library +through randomized testing with the +go-fuzz tool. +Bugs were fixed in the +archive/tar, +archive/zip, +compress/flate, +encoding/gob, +fmt, +html/template, +image/gif, +image/jpeg, +image/png, and +text/template, +packages. +The fixes harden the implementation against incorrect and malicious inputs. +

+ +

Minor changes to the library

+ +
    + +
  • +The archive/zip package's +Writer type now has a +SetOffset +method to specify the location within the output stream at which to write the archive. +
  • + +
  • +The Reader in the +bufio package now has a +Discard +method to discard data from the input. +
  • + +
  • +In the bytes package, +the Buffer type +now has a Cap method +that reports the number of bytes allocated within the buffer. +Similarly, in both the bytes +and strings packages, +the Reader +type now has a Size +method that reports the original length of the underlying slice or string. +
  • + +
  • +Both the bytes and +strings packages +also now have a LastIndexByte +function that locates the rightmost byte with that value in the argument. +
  • + +
  • +The crypto package +has a new interface, Decrypter, +that abstracts the behavior of a private key used in asymmetric decryption. +
  • + +
  • +In the crypto/cipher package, +the documentation for the Stream +interface has been clarified regarding the behavior when the source and destination are +different lengths. +If the destination is shorter than the source, the method will panic. +This is not a change in the implementation, only the documentation. +
  • + +
  • +Also in the crypto/cipher package, +there is now support for nonce lengths other than 96 bytes in AES's Galois/Counter mode (GCM), +which some protocols require. +
  • + +
  • +In the crypto/elliptic package, +there is now a Name field in the +CurveParams struct, +and the curves implemented in the package have been given names. +These names provide a safer way to select a curve, as opposed to +selecting its bit size, for cryptographic systems that are curve-dependent. +
  • + +
  • +Also in the crypto/elliptic package, +the Unmarshal function +now verifies that the point is actually on the curve. +(If it is not, the function returns nils). +This change guards against certain attacks. +
  • + +
  • +The crypto/sha512 +package now has support for the two truncated versions of +the SHA-512 hash algorithm, SHA-512/224 and SHA-512/256. +
  • + +
  • +The crypto/tls package +minimum protocol version now defaults to TLS 1.0. +The old default, SSLv3, is still available through Config if needed. +
  • + +
  • +The crypto/tls package +now supports Signed Certificate Timestamps (SCTs) as specified in RFC 6962. +The server serves them if they are listed in the +Certificate struct, +and the client requests them and exposes them, if present, +in its ConnectionState struct. + +
  • +The stapled OCSP response to a crypto/tls client connection, +previously only available via the +OCSPResponse method, +is now exposed in the ConnectionState struct. +
  • + +
  • +The crypto/tls server implementation +will now always call the +GetCertificate function in +the Config struct +to select a certificate for the connection when none is supplied. +
  • + +
  • +Finally, the session ticket keys in the +crypto/tls package +can now be changed while the server is running. +This is done through the new +SetSessionTicketKeys +method of the +Config type. +
  • + +
  • +In the crypto/x509 package, +wildcards are now accepted only in the leftmost label as defined in +the specification. +
  • + +
  • +Also in the crypto/x509 package, +the handling of unknown critical extensions has been changed. +They used to cause parse errors but now they are parsed and caused errors only +in Verify. +The new field UnhandledCriticalExtensions of +Certificate records these extensions. +
  • + +
  • +The DB type of the +database/sql package +now has a Stats method +to retrieve database statistics. +
  • + +
  • +The debug/dwarf +package has extensive additions to better support DWARF version 4. +See for example the definition of the new type +Class. +
  • + +
  • +The debug/dwarf package +also now supports decoding of DWARF line tables. +
  • + +
  • +The debug/elf +package now has support for the 64-bit PowerPC architecture. +
  • + +
  • +The encoding/base64 package +now supports unpadded encodings through two new encoding variables, +RawStdEncoding and +RawURLEncoding. +
  • + +
  • +The encoding/json package +now returns an UnmarshalTypeError +if a JSON value is not appropriate for the target variable or component +to which it is being unmarshaled. +
  • + +
  • +The encoding/json's +Decoder +type has a new method that provides a streaming interface for decoding +a JSON document: +Token. +It also interoperates with the existing functionality of Decode, +which will continue a decode operation already started with Decoder.Token. +
  • + +
  • +The flag package +has a new function, UnquoteUsage, +to assist in the creation of usage messages using the new convention +described above. +
  • + +
  • +In the fmt package, +a value of type Value now +prints what it holds, rather than use the reflect.Value's Stringer +method, which produces things like <int Value>. +
  • + +
  • +The EmptyStmt type +in the go/ast package now +has a boolean Implicit field that records whether the +semicolon was implicitly added or was present in the source. +
  • + +
  • +For forward compatibility the go/build package +reserves GOARCH values for a number of architectures that Go might support one day. +This is not a promise that it will. +Also, the Package struct +now has a PkgTargetRoot field that stores the +architecture-dependent root directory in which to install, if known. +
  • + +
  • +The (newly migrated) go/types +package allows one to control the prefix attached to package-level names using +the new Qualifier +function type as an argument to several functions. This is an API change for +the package, but since it is new to the core, it is not breaking the Go 1 compatibility +rules since code that uses the package must explicitly ask for it at its new location. +To update, run +go fix on your package. +
  • + +
  • +In the image package, +the Rectangle type +now implements the Image interface, +so a Rectangle can serve as a mask when drawing. +
  • + +
  • +Also in the image package, +to assist in the handling of some JPEG images, +there is now support for 4:1:1 and 4:1:0 YCbCr subsampling and basic +CMYK support, represented by the new image.CMYK struct. +
  • + +
  • +The image/color package +adds basic CMYK support, through the new +CMYK struct, +the CMYKModel color model, and the +CMYKToRGB function, as +needed by some JPEG images. +
  • + +
  • +Also in the image/color package, +the conversion of a YCbCr +value to RGBA has become more precise. +Previously, the low 8 bits were just an echo of the high 8 bits; +now they contain more accurate information. +Because of the echo property of the old code, the operation +uint8(r) to extract an 8-bit red value worked, but is incorrect. +In Go 1.5, that operation may yield a different value. +The correct code is, and always was, to select the high 8 bits: +uint8(r>>8). +Incidentally, the image/draw package +provides better support for such conversions; see +this blog post +for more information. +
  • + +
  • +Finally, as of Go 1.5 the closest match check in +Index +now honors the alpha channel. +
  • + +
  • +The image/gif package +includes a couple of generalizations. +A multiple-frame GIF file can now have an overall bounds different +from all the contained single frames' bounds. +Also, the GIF struct +now has a Disposal field +that specifies the disposal method for each frame. +
  • + +
  • +The io package +adds a CopyBuffer function +that is like Copy but +uses a caller-provided buffer, permitting control of allocation and buffer size. +
  • + +
  • +The log package +has a new LUTC flag +that causes time stamps to be printed in the UTC time zone. +It also adds a SetOutput method +for user-created loggers. +
  • + +
  • +In Go 1.4, Max was not detecting all possible NaN bit patterns. +This is fixed in Go 1.5, so programs that use math.Max on data including NaNs may behave differently, +but now correctly according to the IEEE754 definition of NaNs. +
  • + +
  • +The math/big package +adds a new Jacobi +function for integers and a new +ModSqrt +method for the Int type. +
  • + +
  • +The mime package +adds a new WordDecoder type +to decode MIME headers containing RFC 204-encoded words. +It also provides BEncoding and +QEncoding +as implementations of the encoding schemes of RFC 2045 and RFC 2047. +
  • + +
  • +The mime package also adds an +ExtensionsByType +function that returns the MIME extensions know to be associated with a given MIME type. +
  • + +
  • +There is a new mime/quotedprintable +package that implements the quoted-printable encoding defined by RFC 2045. +
  • + +
  • +The net package will now +Dial hostnames by trying each +IP address in order until one succeeds. +The Dialer.DualStack +mode now implements Happy Eyeballs +(RFC 6555) by giving the +first address family a 300ms head start; this value can be overridden by +the new Dialer.FallbackDelay. +
  • + +
  • +A number of inconsistencies in the types returned by errors in the +net package have been +tidied up. +Most now return an +OpError value +with more information than before. +Also, the OpError +type now includes a Source field that holds the local +network address. +
  • + +
  • +The net/http package now +has support for setting trailers from a server Handler. +For details, see the documentation for +ResponseWriter. +
  • + +
  • +There is a new method to cancel a net/http +Request by setting the new +Request.Cancel +field. +It is supported by http.Transport. +The Cancel field's type is compatible with the +context.Context.Done +return value. +
  • + +
  • +Also in the net/http package, +there is code to ignore the zero Time value +in the ServeContent function. +As of Go 1.5, it now also ignores a time value equal to the Unix epoch. +
  • + +
  • +The net/http/fcgi package +exports two new errors, +ErrConnClosed and +ErrRequestAborted, +to report the corresponding error conditions. +
  • + +
  • +The net/http/cgi package +had a bug that mishandled the values of the environment variables +REMOTE_ADDR and REMOTE_HOST. +This has been fixed. +Also, starting with Go 1.5 the package sets the REMOTE_PORT +variable. +
  • + +
  • +The net/mail package +adds an AddressParser +type that can parse mail addresses. +
  • + +
  • +The net/smtp package +now has a TLSConnectionState +accessor to the Client +type that returns the client's TLS state. +
  • + +
  • +The os package +has a new LookupEnv function +that is similar to Getenv +but can distinguish between an empty environment variable and a missing one. +
  • + +
  • +The os/signal package +adds new Ignore and +Reset functions. +
  • + +
  • +The runtime, +runtime/trace, +and net/http/pprof packages +each have new functions to support the tracing facilities described above: +ReadTrace, +StartTrace, +StopTrace, +Start, +Stop, and +Trace. +See the respective documentation for details. +
  • + +
  • +The runtime/pprof package +by default now includes overall memory statistics in all memory profiles. +
  • + +
  • +The strings package +has a new Compare function. +This is present to provide symmetry with the bytes package +but is otherwise unnecessary as strings support comparison natively. +
  • + +
  • +The WaitGroup implementation in +package sync +now diagnoses code that races a call to Add +against a return from Wait. +If it detects this condition, the implementation panics. +
  • + +
  • +In the syscall package, +the Linux SysProcAttr struct now has a +GidMappingsEnableSetgroups field, made necessary +by security changes in Linux 3.19. +On all Unix systems, the struct also has new Foreground and Pgid fields +to provide more control when exec'ing. +On Darwin, there is now a Syscall9 function +to support calls with too many arguments. +
  • + +
  • +The testing/quick will now +generate nil values for pointer types, +making it possible to use with recursive data structures. +Also, the package now supports generation of array types. +
  • + +
  • +In the text/template and +html/template packages, +integer constants too large to be represented as a Go integer now trigger a +parse error. Before, they were silently converted to floating point, losing +precision. +
  • + +
  • +Also in the text/template and +html/template packages, +a new Option method +allows customization of the behavior of the template during execution. +The sole implemented option allows control over how a missing key is +handled when indexing a map. +The default, which can now be overridden, is as before: to continue with an invalid value. +
  • + +
  • +The time package's +Time type has a new method +AppendFormat, +which can be used to avoid allocation when printing a time value. +
  • + +
  • +The unicode package and associated +support throughout the system has been upgraded from version 7.0 to +Unicode 8.0. +
  • + +
diff --git a/doc/go1.html b/doc/go1.html new file mode 100644 index 0000000000000000000000000000000000000000..1665d74e955d66688f95392ef5673b610eaf357e --- /dev/null +++ b/doc/go1.html @@ -0,0 +1,2038 @@ + + +

Introduction to Go 1

+ +

+Go version 1, Go 1 for short, defines a language and a set of core libraries +that provide a stable foundation for creating reliable products, projects, and +publications. +

+ +

+The driving motivation for Go 1 is stability for its users. People should be able to +write Go programs and expect that they will continue to compile and run without +change, on a time scale of years, including in production environments such as +Google App Engine. Similarly, people should be able to write books about Go, be +able to say which version of Go the book is describing, and have that version +number still be meaningful much later. +

+ +

+Code that compiles in Go 1 should, with few exceptions, continue to compile and +run throughout the lifetime of that version, even as we issue updates and bug +fixes such as Go version 1.1, 1.2, and so on. Other than critical fixes, changes +made to the language and library for subsequent releases of Go 1 may +add functionality but will not break existing Go 1 programs. +The Go 1 compatibility document +explains the compatibility guidelines in more detail. +

+ +

+Go 1 is a representation of Go as it used today, not a wholesale rethinking of +the language. We avoided designing new features and instead focused on cleaning +up problems and inconsistencies and improving portability. There are a number +changes to the Go language and packages that we had considered for some time and +prototyped but not released primarily because they are significant and +backwards-incompatible. Go 1 was an opportunity to get them out, which is +helpful for the long term, but also means that Go 1 introduces incompatibilities +for old programs. Fortunately, the go fix tool can +automate much of the work needed to bring programs up to the Go 1 standard. +

+ +

+This document outlines the major changes in Go 1 that will affect programmers +updating existing code; its reference point is the prior release, r60 (tagged as +r60.3). It also explains how to update code from r60 to run under Go 1. +

+ +

Changes to the language

+ +

Append

+ +

+The append predeclared variadic function makes it easy to grow a slice +by adding elements to the end. +A common use is to add bytes to the end of a byte slice when generating output. +However, append did not provide a way to append a string to a []byte, +which is another common case. +

+ +{{code "/doc/progs/go1.go" `/greeting := ..byte/` `/append.*hello/`}} + +

+By analogy with the similar property of copy, Go 1 +permits a string to be appended (byte-wise) directly to a byte +slice, reducing the friction between strings and byte slices. +The conversion is no longer necessary: +

+ +{{code "/doc/progs/go1.go" `/append.*world/`}} + +

+Updating: +This is a new feature, so existing code needs no changes. +

+ +

Close

+ +

+The close predeclared function provides a mechanism +for a sender to signal that no more values will be sent. +It is important to the implementation of for range +loops over channels and is helpful in other situations. +Partly by design and partly because of race conditions that can occur otherwise, +it is intended for use only by the goroutine sending on the channel, +not by the goroutine receiving data. +However, before Go 1 there was no compile-time checking that close +was being used correctly. +

+ +

+To close this gap, at least in part, Go 1 disallows close on receive-only channels. +Attempting to close such a channel is a compile-time error. +

+ +
+    var c chan int
+    var csend chan<- int = c
+    var crecv <-chan int = c
+    close(c)     // legal
+    close(csend) // legal
+    close(crecv) // illegal
+
+ +

+Updating: +Existing code that attempts to close a receive-only channel was +erroneous even before Go 1 and should be fixed. The compiler will +now reject such code. +

+ +

Composite literals

+ +

+In Go 1, a composite literal of array, slice, or map type can elide the +type specification for the elements' initializers if they are of pointer type. +All four of the initializations in this example are legal; the last one was illegal before Go 1. +

+ +{{code "/doc/progs/go1.go" `/type Date struct/` `/STOP/`}} + +

+Updating: +This change has no effect on existing code, but the command +gofmt -s applied to existing source +will, among other things, elide explicit element types wherever permitted. +

+ + +

Goroutines during init

+ +

+The old language defined that go statements executed during initialization created goroutines but that they did not begin to run until initialization of the entire program was complete. +This introduced clumsiness in many places and, in effect, limited the utility +of the init construct: +if it was possible for another package to use the library during initialization, the library +was forced to avoid goroutines. +This design was done for reasons of simplicity and safety but, +as our confidence in the language grew, it seemed unnecessary. +Running goroutines during initialization is no more complex or unsafe than running them during normal execution. +

+ +

+In Go 1, code that uses goroutines can be called from +init routines and global initialization expressions +without introducing a deadlock. +

+ +{{code "/doc/progs/go1.go" `/PackageGlobal/` `/^}/`}} + +

+Updating: +This is a new feature, so existing code needs no changes, +although it's possible that code that depends on goroutines not starting before main will break. +There was no such code in the standard repository. +

+ +

The rune type

+ +

+The language spec allows the int type to be 32 or 64 bits wide, but current implementations set int to 32 bits even on 64-bit platforms. +It would be preferable to have int be 64 bits on 64-bit platforms. +(There are important consequences for indexing large slices.) +However, this change would waste space when processing Unicode characters with +the old language because the int type was also used to hold Unicode code points: each code point would waste an extra 32 bits of storage if int grew from 32 bits to 64. +

+ +

+To make changing to 64-bit int feasible, +Go 1 introduces a new basic type, rune, to represent +individual Unicode code points. +It is an alias for int32, analogous to byte +as an alias for uint8. +

+ +

+Character literals such as 'a', '語', and '\u0345' +now have default type rune, +analogous to 1.0 having default type float64. +A variable initialized to a character constant will therefore +have type rune unless otherwise specified. +

+ +

+Libraries have been updated to use rune rather than int +when appropriate. For instance, the functions unicode.ToLower and +relatives now take and return a rune. +

+ +{{code "/doc/progs/go1.go" `/STARTRUNE/` `/ENDRUNE/`}} + +

+Updating: +Most source code will be unaffected by this because the type inference from +:= initializers introduces the new type silently, and it propagates +from there. +Some code may get type errors that a trivial conversion will resolve. +

+ +

The error type

+ +

+Go 1 introduces a new built-in type, error, which has the following definition: +

+ +
+    type error interface {
+        Error() string
+    }
+
+ +

+Since the consequences of this type are all in the package library, +it is discussed below. +

+ +

Deleting from maps

+ +

+In the old language, to delete the entry with key k from map m, one wrote the statement, +

+ +
+    m[k] = value, false
+
+ +

+This syntax was a peculiar special case, the only two-to-one assignment. +It required passing a value (usually ignored) that is evaluated but discarded, +plus a boolean that was nearly always the constant false. +It did the job but was odd and a point of contention. +

+ +

+In Go 1, that syntax has gone; instead there is a new built-in +function, delete. The call +

+ +{{code "/doc/progs/go1.go" `/delete\(m, k\)/`}} + +

+will delete the map entry retrieved by the expression m[k]. +There is no return value. Deleting a non-existent entry is a no-op. +

+ +

+Updating: +Running go fix will convert expressions of the form m[k] = value, +false into delete(m, k) when it is clear that +the ignored value can be safely discarded from the program and +false refers to the predefined boolean constant. +The fix tool +will flag other uses of the syntax for inspection by the programmer. +

+ +

Iterating in maps

+ +

+The old language specification did not define the order of iteration for maps, +and in practice it differed across hardware platforms. +This caused tests that iterated over maps to be fragile and non-portable, with the +unpleasant property that a test might always pass on one machine but break on another. +

+ +

+In Go 1, the order in which elements are visited when iterating +over a map using a for range statement +is defined to be unpredictable, even if the same loop is run multiple +times with the same map. +Code should not assume that the elements are visited in any particular order. +

+ +

+This change means that code that depends on iteration order is very likely to break early and be fixed long before it becomes a problem. +Just as important, it allows the map implementation to ensure better map balancing even when programs are using range loops to select an element from a map. +

+ +{{code "/doc/progs/go1.go" `/Sunday/` `/^ }/`}} + +

+Updating: +This is one change where tools cannot help. Most existing code +will be unaffected, but some programs may break or misbehave; we +recommend manual checking of all range statements over maps to +verify they do not depend on iteration order. There were a few such +examples in the standard repository; they have been fixed. +Note that it was already incorrect to depend on the iteration order, which +was unspecified. This change codifies the unpredictability. +

+ +

Multiple assignment

+ +

+The language specification has long guaranteed that in assignments +the right-hand-side expressions are all evaluated before any left-hand-side expressions are assigned. +To guarantee predictable behavior, +Go 1 refines the specification further. +

+ +

+If the left-hand side of the assignment +statement contains expressions that require evaluation, such as +function calls or array indexing operations, these will all be done +using the usual left-to-right rule before any variables are assigned +their value. Once everything is evaluated, the actual assignments +proceed in left-to-right order. +

+ +

+These examples illustrate the behavior. +

+ +{{code "/doc/progs/go1.go" `/sa :=/` `/then sc.0. = 2/`}} + +

+Updating: +This is one change where tools cannot help, but breakage is unlikely. +No code in the standard repository was broken by this change, and code +that depended on the previous unspecified behavior was already incorrect. +

+ +

Returns and shadowed variables

+ +

+A common mistake is to use return (without arguments) after an assignment to a variable that has the same name as a result variable but is not the same variable. +This situation is called shadowing: the result variable has been shadowed by another variable with the same name declared in an inner scope. +

+ +

+In functions with named return values, +the Go 1 compilers disallow return statements without arguments if any of the named return values is shadowed at the point of the return statement. +(It isn't part of the specification, because this is one area we are still exploring; +the situation is analogous to the compilers rejecting functions that do not end with an explicit return statement.) +

+ +

+This function implicitly returns a shadowed return value and will be rejected by the compiler: +

+ +
+    func Bug() (i, j, k int) {
+        for i = 0; i < 5; i++ {
+            for j := 0; j < 5; j++ { // Redeclares j.
+                k += i*j
+                if k > 100 {
+                    return // Rejected: j is shadowed here.
+                }
+            }
+        }
+        return // OK: j is not shadowed here.
+    }
+
+ +

+Updating: +Code that shadows return values in this way will be rejected by the compiler and will need to be fixed by hand. +The few cases that arose in the standard repository were mostly bugs. +

+ +

Copying structs with unexported fields

+ +

+The old language did not allow a package to make a copy of a struct value containing unexported fields belonging to a different package. +There was, however, a required exception for a method receiver; +also, the implementations of copy and append have never honored the restriction. +

+ +

+Go 1 will allow packages to copy struct values containing unexported fields from other packages. +Besides resolving the inconsistency, +this change admits a new kind of API: a package can return an opaque value without resorting to a pointer or interface. +The new implementations of time.Time and +reflect.Value are examples of types taking advantage of this new property. +

+ +

+As an example, if package p includes the definitions, +

+ +
+    type Struct struct {
+        Public int
+        secret int
+    }
+    func NewStruct(a int) Struct {  // Note: not a pointer.
+        return Struct{a, f(a)}
+    }
+    func (s Struct) String() string {
+        return fmt.Sprintf("{%d (secret %d)}", s.Public, s.secret)
+    }
+
+ +

+a package that imports p can assign and copy values of type +p.Struct at will. +Behind the scenes the unexported fields will be assigned and copied just +as if they were exported, +but the client code will never be aware of them. The code +

+ +
+    import "p"
+
+    myStruct := p.NewStruct(23)
+    copyOfMyStruct := myStruct
+    fmt.Println(myStruct, copyOfMyStruct)
+
+ +

+will show that the secret field of the struct has been copied to the new value. +

+ +

+Updating: +This is a new feature, so existing code needs no changes. +

+ +

Equality

+ +

+Before Go 1, the language did not define equality on struct and array values. +This meant, +among other things, that structs and arrays could not be used as map keys. +On the other hand, Go did define equality on function and map values. +Function equality was problematic in the presence of closures +(when are two closures equal?) +while map equality compared pointers, not the maps' content, which was usually +not what the user would want. +

+ +

+Go 1 addressed these issues. +First, structs and arrays can be compared for equality and inequality +(== and !=), +and therefore be used as map keys, +provided they are composed from elements for which equality is also defined, +using element-wise comparison. +

+ +{{code "/doc/progs/go1.go" `/type Day struct/` `/Printf/`}} + +

+Second, Go 1 removes the definition of equality for function values, +except for comparison with nil. +Finally, map equality is gone too, also except for comparison with nil. +

+ +

+Note that equality is still undefined for slices, for which the +calculation is in general infeasible. Also note that the ordered +comparison operators (< <= +> >=) are still undefined for +structs and arrays. + +

+Updating: +Struct and array equality is a new feature, so existing code needs no changes. +Existing code that depends on function or map equality will be +rejected by the compiler and will need to be fixed by hand. +Few programs will be affected, but the fix may require some +redesign. +

+ +

The package hierarchy

+ +

+Go 1 addresses many deficiencies in the old standard library and +cleans up a number of packages, making them more internally consistent +and portable. +

+ +

+This section describes how the packages have been rearranged in Go 1. +Some have moved, some have been renamed, some have been deleted. +New packages are described in later sections. +

+ +

The package hierarchy

+ +

+Go 1 has a rearranged package hierarchy that groups related items +into subdirectories. For instance, utf8 and +utf16 now occupy subdirectories of unicode. +Also, some packages have moved into +subrepositories of +code.google.com/p/go +while others have been deleted outright. +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Old pathNew path

asn1 encoding/asn1
csv encoding/csv
gob encoding/gob
json encoding/json
xml encoding/xml

exp/template/html html/template

big math/big
cmath math/cmplx
rand math/rand

http net/http
http/cgi net/http/cgi
http/fcgi net/http/fcgi
http/httptest net/http/httptest
http/pprof net/http/pprof
mail net/mail
rpc net/rpc
rpc/jsonrpc net/rpc/jsonrpc
smtp net/smtp
url net/url

exec os/exec

scanner text/scanner
tabwriter text/tabwriter
template text/template
template/parse text/template/parse

utf8 unicode/utf8
utf16 unicode/utf16
+ +

+Note that the package names for the old cmath and +exp/template/html packages have changed to cmplx +and template. +

+ +

+Updating: +Running go fix will update all imports and package renames for packages that +remain inside the standard repository. Programs that import packages +that are no longer in the standard repository will need to be edited +by hand. +

+ +

The package tree exp

+ +

+Because they are not standardized, the packages under the exp directory will not be available in the +standard Go 1 release distributions, although they will be available in source code form +in the repository for +developers who wish to use them. +

+ +

+Several packages have moved under exp at the time of Go 1's release: +

+ +
    +
  • ebnf
  • +
  • html
  • +
  • go/types
  • +
+ +

+(The EscapeString and UnescapeString types remain +in package html.) +

+ +

+All these packages are available under the same names, with the prefix exp/: exp/ebnf etc. +

+ +

+Also, the utf8.String type has been moved to its own package, exp/utf8string. +

+ +

+Finally, the gotype command now resides in exp/gotype, while +ebnflint is now in exp/ebnflint. +If they are installed, they now reside in $GOROOT/bin/tool. +

+ +

+Updating: +Code that uses packages in exp will need to be updated by hand, +or else compiled from an installation that has exp available. +The go fix tool or the compiler will complain about such uses. +

+ +

The package tree old

+ +

+Because they are deprecated, the packages under the old directory will not be available in the +standard Go 1 release distributions, although they will be available in source code form for +developers who wish to use them. +

+ +

+The packages in their new locations are: +

+ +
    +
  • old/netchan
  • +
+ +

+Updating: +Code that uses packages now in old will need to be updated by hand, +or else compiled from an installation that has old available. +The go fix tool will warn about such uses. +

+ +

Deleted packages

+ +

+Go 1 deletes several packages outright: +

+ +
    +
  • container/vector
  • +
  • exp/datafmt
  • +
  • go/typechecker
  • +
  • old/regexp
  • +
  • old/template
  • +
  • try
  • +
+ +

+and also the command gotry. +

+ +

+Updating: +Code that uses container/vector should be updated to use +slices directly. See +the Go +Language Community Wiki for some suggestions. +Code that uses the other packages (there should be almost zero) will need to be rethought. +

+ +

Packages moving to subrepositories

+ +

+Go 1 has moved a number of packages into other repositories, usually sub-repositories of +the main Go repository. +This table lists the old and new import paths: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OldNew

crypto/bcrypt code.google.com/p/go.crypto/bcrypt
crypto/blowfish code.google.com/p/go.crypto/blowfish
crypto/cast5 code.google.com/p/go.crypto/cast5
crypto/md4 code.google.com/p/go.crypto/md4
crypto/ocsp code.google.com/p/go.crypto/ocsp
crypto/openpgp code.google.com/p/go.crypto/openpgp
crypto/openpgp/armor code.google.com/p/go.crypto/openpgp/armor
crypto/openpgp/elgamal code.google.com/p/go.crypto/openpgp/elgamal
crypto/openpgp/errors code.google.com/p/go.crypto/openpgp/errors
crypto/openpgp/packet code.google.com/p/go.crypto/openpgp/packet
crypto/openpgp/s2k code.google.com/p/go.crypto/openpgp/s2k
crypto/ripemd160 code.google.com/p/go.crypto/ripemd160
crypto/twofish code.google.com/p/go.crypto/twofish
crypto/xtea code.google.com/p/go.crypto/xtea
exp/ssh code.google.com/p/go.crypto/ssh

image/bmp code.google.com/p/go.image/bmp
image/tiff code.google.com/p/go.image/tiff

net/dict code.google.com/p/go.net/dict
net/websocket code.google.com/p/go.net/websocket
exp/spdy code.google.com/p/go.net/spdy

encoding/git85 code.google.com/p/go.codereview/git85
patch code.google.com/p/go.codereview/patch

exp/wingui code.google.com/p/gowingui
+ +

+Updating: +Running go fix will update imports of these packages to use the new import paths. +Installations that depend on these packages will need to install them using +a go get command. +

+ +

Major changes to the library

+ +

+This section describes significant changes to the core libraries, the ones that +affect the most programs. +

+ +

The error type and errors package

+ +

+The placement of os.Error in package os is mostly historical: errors first came up when implementing package os, and they seemed system-related at the time. +Since then it has become clear that errors are more fundamental than the operating system. For example, it would be nice to use Errors in packages that os depends on, like syscall. +Also, having Error in os introduces many dependencies on os that would otherwise not exist. +

+ +

+Go 1 solves these problems by introducing a built-in error interface type and a separate errors package (analogous to bytes and strings) that contains utility functions. +It replaces os.NewError with +errors.New, +giving errors a more central place in the environment. +

+ +

+So the widely-used String method does not cause accidental satisfaction +of the error interface, the error interface uses instead +the name Error for that method: +

+ +
+    type error interface {
+        Error() string
+    }
+
+ +

+The fmt library automatically invokes Error, as it already +does for String, for easy printing of error values. +

+ +{{code "/doc/progs/go1.go" `/START ERROR EXAMPLE/` `/END ERROR EXAMPLE/`}} + +

+All standard packages have been updated to use the new interface; the old os.Error is gone. +

+ +

+A new package, errors, contains the function +

+ +
+func New(text string) error
+
+ +

+to turn a string into an error. It replaces the old os.NewError. +

+ +{{code "/doc/progs/go1.go" `/ErrSyntax/`}} + +

+Updating: +Running go fix will update almost all code affected by the change. +Code that defines error types with a String method will need to be updated +by hand to rename the methods to Error. +

+ +

System call errors

+ +

+The old syscall package, which predated os.Error +(and just about everything else), +returned errors as int values. +In turn, the os package forwarded many of these errors, such +as EINVAL, but using a different set of errors on each platform. +This behavior was unpleasant and unportable. +

+ +

+In Go 1, the +syscall +package instead returns an error for system call errors. +On Unix, the implementation is done by a +syscall.Errno type +that satisfies error and replaces the old os.Errno. +

+ +

+The changes affecting os.EINVAL and relatives are +described elsewhere. + +

+Updating: +Running go fix will update almost all code affected by the change. +Regardless, most code should use the os package +rather than syscall and so will be unaffected. +

+ +

Time

+ +

+Time is always a challenge to support well in a programming language. +The old Go time package had int64 units, no +real type safety, +and no distinction between absolute times and durations. +

+ +

+One of the most sweeping changes in the Go 1 library is therefore a +complete redesign of the +time package. +Instead of an integer number of nanoseconds as an int64, +and a separate *time.Time type to deal with human +units such as hours and years, +there are now two fundamental types: +time.Time +(a value, so the * is gone), which represents a moment in time; +and time.Duration, +which represents an interval. +Both have nanosecond resolution. +A Time can represent any time into the ancient +past and remote future, while a Duration can +span plus or minus only about 290 years. +There are methods on these types, plus a number of helpful +predefined constant durations such as time.Second. +

+ +

+Among the new methods are things like +Time.Add, +which adds a Duration to a Time, and +Time.Sub, +which subtracts two Times to yield a Duration. +

+ +

+The most important semantic change is that the Unix epoch (Jan 1, 1970) is now +relevant only for those functions and methods that mention Unix: +time.Unix +and the Unix +and UnixNano methods +of the Time type. +In particular, +time.Now +returns a time.Time value rather than, in the old +API, an integer nanosecond count since the Unix epoch. +

+ +{{code "/doc/progs/go1.go" `/sleepUntil/` `/^}/`}} + +

+The new types, methods, and constants have been propagated through +all the standard packages that use time, such as os and +its representation of file time stamps. +

+ +

+Updating: +The go fix tool will update many uses of the old time package to use the new +types and methods, although it does not replace values such as 1e9 +representing nanoseconds per second. +Also, because of type changes in some of the values that arise, +some of the expressions rewritten by the fix tool may require +further hand editing; in such cases the rewrite will include +the correct function or method for the old functionality, but +may have the wrong type or require further analysis. +

+ +

Minor changes to the library

+ +

+This section describes smaller changes, such as those to less commonly +used packages or that affect +few programs beyond the need to run go fix. +This category includes packages that are new in Go 1. +Collectively they improve portability, regularize behavior, and +make the interfaces more modern and Go-like. +

+ +

The archive/zip package

+ +

+In Go 1, *zip.Writer no +longer has a Write method. Its presence was a mistake. +

+ +

+Updating: +What little code is affected will be caught by the compiler and must be updated by hand. +

+ +

The bufio package

+ +

+In Go 1, bufio.NewReaderSize +and +bufio.NewWriterSize +functions no longer return an error for invalid sizes. +If the argument size is too small or invalid, it is adjusted. +

+ +

+Updating: +Running go fix will update calls that assign the error to _. +Calls that aren't fixed will be caught by the compiler and must be updated by hand. +

+ +

The compress/flate, compress/gzip and compress/zlib packages

+ +

+In Go 1, the NewWriterXxx functions in +compress/flate, +compress/gzip and +compress/zlib +all return (*Writer, error) if they take a compression level, +and *Writer otherwise. Package gzip's +Compressor and Decompressor types have been renamed +to Writer and Reader. Package flate's +WrongValueError type has been removed. +

+ +

+Updating +Running go fix will update old names and calls that assign the error to _. +Calls that aren't fixed will be caught by the compiler and must be updated by hand. +

+ +

The crypto/aes and crypto/des packages

+ +

+In Go 1, the Reset method has been removed. Go does not guarantee +that memory is not copied and therefore this method was misleading. +

+ +

+The cipher-specific types *aes.Cipher, *des.Cipher, +and *des.TripleDESCipher have been removed in favor of +cipher.Block. +

+ +

+Updating: +Remove the calls to Reset. Replace uses of the specific cipher types with +cipher.Block. +

+ +

The crypto/elliptic package

+ +

+In Go 1, elliptic.Curve +has been made an interface to permit alternative implementations. The curve +parameters have been moved to the +elliptic.CurveParams +structure. +

+ +

+Updating: +Existing users of *elliptic.Curve will need to change to +simply elliptic.Curve. Calls to Marshal, +Unmarshal and GenerateKey are now functions +in crypto/elliptic that take an elliptic.Curve +as their first argument. +

+ +

The crypto/hmac package

+ +

+In Go 1, the hash-specific functions, such as hmac.NewMD5, have +been removed from crypto/hmac. Instead, hmac.New takes +a function that returns a hash.Hash, such as md5.New. +

+ +

+Updating: +Running go fix will perform the needed changes. +

+ +

The crypto/x509 package

+ +

+In Go 1, the +CreateCertificate +function and +CreateCRL +method in crypto/x509 have been altered to take an +interface{} where they previously took a *rsa.PublicKey +or *rsa.PrivateKey. This will allow other public key algorithms +to be implemented in the future. +

+ +

+Updating: +No changes will be needed. +

+ +

The encoding/binary package

+ +

+In Go 1, the binary.TotalSize function has been replaced by +Size, +which takes an interface{} argument rather than +a reflect.Value. +

+ +

+Updating: +What little code is affected will be caught by the compiler and must be updated by hand. +

+ +

The encoding/xml package

+ +

+In Go 1, the xml package +has been brought closer in design to the other marshaling packages such +as encoding/gob. +

+ +

+The old Parser type is renamed +Decoder and has a new +Decode method. An +Encoder type was also introduced. +

+ +

+The functions Marshal +and Unmarshal +work with []byte values now. To work with streams, +use the new Encoder +and Decoder types. +

+ +

+When marshaling or unmarshaling values, the format of supported flags in +field tags has changed to be closer to the +json package +(`xml:"name,flag"`). The matching done between field tags, field +names, and the XML attribute and element names is now case-sensitive. +The XMLName field tag, if present, must also match the name +of the XML element being marshaled. +

+ +

+Updating: +Running go fix will update most uses of the package except for some calls to +Unmarshal. Special care must be taken with field tags, +since the fix tool will not update them and if not fixed by hand they will +misbehave silently in some cases. For example, the old +"attr" is now written ",attr" while plain +"attr" remains valid but with a different meaning. +

+ +

The expvar package

+ +

+In Go 1, the RemoveAll function has been removed. +The Iter function and Iter method on *Map have +been replaced by +Do +and +(*Map).Do. +

+ +

+Updating: +Most code using expvar will not need changing. The rare code that used +Iter can be updated to pass a closure to Do to achieve the same effect. +

+ +

The flag package

+ +

+In Go 1, the interface flag.Value has changed slightly. +The Set method now returns an error instead of +a bool to indicate success or failure. +

+ +

+There is also a new kind of flag, Duration, to support argument +values specifying time intervals. +Values for such flags must be given units, just as time.Duration +formats them: 10s, 1h30m, etc. +

+ +{{code "/doc/progs/go1.go" `/timeout/`}} + +

+Updating: +Programs that implement their own flags will need minor manual fixes to update their +Set methods. +The Duration flag is new and affects no existing code. +

+ + +

The go/* packages

+ +

+Several packages under go have slightly revised APIs. +

+ +

+A concrete Mode type was introduced for configuration mode flags +in the packages +go/scanner, +go/parser, +go/printer, and +go/doc. +

+ +

+The modes AllowIllegalChars and InsertSemis have been removed +from the go/scanner package. They were mostly +useful for scanning text other then Go source files. Instead, the +text/scanner package should be used +for that purpose. +

+ +

+The ErrorHandler provided +to the scanner's Init method is +now simply a function rather than an interface. The ErrorVector type has +been removed in favor of the (existing) ErrorList +type, and the ErrorVector methods have been migrated. Instead of embedding +an ErrorVector in a client of the scanner, now a client should maintain +an ErrorList. +

+ +

+The set of parse functions provided by the go/parser +package has been reduced to the primary parse function +ParseFile, and a couple of +convenience functions ParseDir +and ParseExpr. +

+ +

+The go/printer package supports an additional +configuration mode SourcePos; +if set, the printer will emit //line comments such that the generated +output contains the original source code position information. The new type +CommentedNode can be +used to provide comments associated with an arbitrary +ast.Node (until now only +ast.File carried comment information). +

+ +

+The type names of the go/doc package have been +streamlined by removing the Doc suffix: PackageDoc +is now Package, ValueDoc is Value, etc. +Also, all types now consistently have a Name field (or Names, +in the case of type Value) and Type.Factories has become +Type.Funcs. +Instead of calling doc.NewPackageDoc(pkg, importpath), +documentation for a package is created with: +

+ +
+    doc.New(pkg, importpath, mode)
+
+ +

+where the new mode parameter specifies the operation mode: +if set to AllDecls, all declarations +(not just exported ones) are considered. +The function NewFileDoc was removed, and the function +CommentText has become the method +Text of +ast.CommentGroup. +

+ +

+In package go/token, the +token.FileSet method Files +(which originally returned a channel of *token.Files) has been replaced +with the iterator Iterate that +accepts a function argument instead. +

+ +

+In package go/build, the API +has been nearly completely replaced. +The package still computes Go package information +but it does not run the build: the Cmd and Script +types are gone. +(To build code, use the new +go command instead.) +The DirInfo type is now named +Package. +FindTree and ScanDir are replaced by +Import +and +ImportDir. +

+ +

+Updating: +Code that uses packages in go will have to be updated by hand; the +compiler will reject incorrect uses. Templates used in conjunction with any of the +go/doc types may need manual fixes; the renamed fields will lead +to run-time errors. +

+ +

The hash package

+ +

+In Go 1, the definition of hash.Hash includes +a new method, BlockSize. This new method is used primarily in the +cryptographic libraries. +

+ +

+The Sum method of the +hash.Hash interface now takes a +[]byte argument, to which the hash value will be appended. +The previous behavior can be recreated by adding a nil argument to the call. +

+ +

+Updating: +Existing implementations of hash.Hash will need to add a +BlockSize method. Hashes that process the input one byte at +a time can implement BlockSize to return 1. +Running go fix will update calls to the Sum methods of the various +implementations of hash.Hash. +

+ +

+Updating: +Since the package's functionality is new, no updating is necessary. +

+ +

The http package

+ +

+In Go 1 the http package is refactored, +putting some of the utilities into a +httputil subdirectory. +These pieces are only rarely needed by HTTP clients. +The affected items are: +

+ +
    +
  • ClientConn
  • +
  • DumpRequest
  • +
  • DumpRequestOut
  • +
  • DumpResponse
  • +
  • NewChunkedReader
  • +
  • NewChunkedWriter
  • +
  • NewClientConn
  • +
  • NewProxyClientConn
  • +
  • NewServerConn
  • +
  • NewSingleHostReverseProxy
  • +
  • ReverseProxy
  • +
  • ServerConn
  • +
+ +

+The Request.RawURL field has been removed; it was a +historical artifact. +

+ +

+The Handle and HandleFunc +functions, and the similarly-named methods of ServeMux, +now panic if an attempt is made to register the same pattern twice. +

+ +

+Updating: +Running go fix will update the few programs that are affected except for +uses of RawURL, which must be fixed by hand. +

+ +

The image package

+ +

+The image package has had a number of +minor changes, rearrangements and renamings. +

+ +

+Most of the color handling code has been moved into its own package, +image/color. +For the elements that moved, a symmetry arises; for instance, +each pixel of an +image.RGBA +is a +color.RGBA. +

+ +

+The old image/ycbcr package has been folded, with some +renamings, into the +image +and +image/color +packages. +

+ +

+The old image.ColorImage type is still in the image +package but has been renamed +image.Uniform, +while image.Tiled has been removed. +

+ +

+This table lists the renamings. +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OldNew

image.Color color.Color
image.ColorModel color.Model
image.ColorModelFunc color.ModelFunc
image.PalettedColorModel color.Palette

image.RGBAColor color.RGBA
image.RGBA64Color color.RGBA64
image.NRGBAColor color.NRGBA
image.NRGBA64Color color.NRGBA64
image.AlphaColor color.Alpha
image.Alpha16Color color.Alpha16
image.GrayColor color.Gray
image.Gray16Color color.Gray16

image.RGBAColorModel color.RGBAModel
image.RGBA64ColorModel color.RGBA64Model
image.NRGBAColorModel color.NRGBAModel
image.NRGBA64ColorModel color.NRGBA64Model
image.AlphaColorModel color.AlphaModel
image.Alpha16ColorModel color.Alpha16Model
image.GrayColorModel color.GrayModel
image.Gray16ColorModel color.Gray16Model

ycbcr.RGBToYCbCr color.RGBToYCbCr
ycbcr.YCbCrToRGB color.YCbCrToRGB
ycbcr.YCbCrColorModel color.YCbCrModel
ycbcr.YCbCrColor color.YCbCr
ycbcr.YCbCr image.YCbCr

ycbcr.SubsampleRatio444 image.YCbCrSubsampleRatio444
ycbcr.SubsampleRatio422 image.YCbCrSubsampleRatio422
ycbcr.SubsampleRatio420 image.YCbCrSubsampleRatio420

image.ColorImage image.Uniform
+ +

+The image package's New functions +(NewRGBA, +NewRGBA64, etc.) +take an image.Rectangle as an argument +instead of four integers. +

+ +

+Finally, there are new predefined color.Color variables +color.Black, +color.White, +color.Opaque +and +color.Transparent. +

+ +

+Updating: +Running go fix will update almost all code affected by the change. +

+ +

The log/syslog package

+ +

+In Go 1, the syslog.NewLogger +function returns an error as well as a log.Logger. +

+ +

+Updating: +What little code is affected will be caught by the compiler and must be updated by hand. +

+ +

The mime package

+ +

+In Go 1, the FormatMediaType function +of the mime package has been simplified to make it +consistent with +ParseMediaType. +It now takes "text/html" rather than "text" and "html". +

+ +

+Updating: +What little code is affected will be caught by the compiler and must be updated by hand. +

+ +

The net package

+ +

+In Go 1, the various SetTimeout, +SetReadTimeout, and SetWriteTimeout methods +have been replaced with +SetDeadline, +SetReadDeadline, and +SetWriteDeadline, +respectively. Rather than taking a timeout value in nanoseconds that +apply to any activity on the connection, the new methods set an +absolute deadline (as a time.Time value) after which +reads and writes will time out and no longer block. +

+ +

+There are also new functions +net.DialTimeout +to simplify timing out dialing a network address and +net.ListenMulticastUDP +to allow multicast UDP to listen concurrently across multiple listeners. +The net.ListenMulticastUDP function replaces the old +JoinGroup and LeaveGroup methods. +

+ +

+Updating: +Code that uses the old methods will fail to compile and must be updated by hand. +The semantic change makes it difficult for the fix tool to update automatically. +

+ +

The os package

+ +

+The Time function has been removed; callers should use +the Time type from the +time package. +

+ +

+The Exec function has been removed; callers should use +Exec from the syscall package, where available. +

+ +

+The ShellExpand function has been renamed to ExpandEnv. +

+ +

+The NewFile function +now takes a uintptr fd, instead of an int. +The Fd method on files now +also returns a uintptr. +

+ +

+There are no longer error constants such as EINVAL +in the os package, since the set of values varied with +the underlying operating system. There are new portable functions like +IsPermission +to test common error properties, plus a few new error values +with more Go-like names, such as +ErrPermission +and +ErrNotExist. +

+ +

+The Getenverror function has been removed. To distinguish +between a non-existent environment variable and an empty string, +use os.Environ or +syscall.Getenv. +

+ + +

+The Process.Wait method has +dropped its option argument and the associated constants are gone +from the package. +Also, the function Wait is gone; only the method of +the Process type persists. +

+ +

+The Waitmsg type returned by +Process.Wait +has been replaced with a more portable +ProcessState +type with accessor methods to recover information about the +process. +Because of changes to Wait, the ProcessState +value always describes an exited process. +Portability concerns simplified the interface in other ways, but the values returned by the +ProcessState.Sys and +ProcessState.SysUsage +methods can be type-asserted to underlying system-specific data structures such as +syscall.WaitStatus and +syscall.Rusage on Unix. +

+ +

+Updating: +Running go fix will drop a zero argument to Process.Wait. +All other changes will be caught by the compiler and must be updated by hand. +

+ +

The os.FileInfo type

+ +

+Go 1 redefines the os.FileInfo type, +changing it from a struct to an interface: +

+ +
+    type FileInfo interface {
+        Name() string       // base name of the file
+        Size() int64        // length in bytes
+        Mode() FileMode     // file mode bits
+        ModTime() time.Time // modification time
+        IsDir() bool        // abbreviation for Mode().IsDir()
+        Sys() interface{}   // underlying data source (can return nil)
+    }
+
+ +

+The file mode information has been moved into a subtype called +os.FileMode, +a simple integer type with IsDir, Perm, and String +methods. +

+ +

+The system-specific details of file modes and properties such as (on Unix) +i-number have been removed from FileInfo altogether. +Instead, each operating system's os package provides an +implementation of the FileInfo interface, which +has a Sys method that returns the +system-specific representation of file metadata. +For instance, to discover the i-number of a file on a Unix system, unpack +the FileInfo like this: +

+ +
+    fi, err := os.Stat("hello.go")
+    if err != nil {
+        log.Fatal(err)
+    }
+    // Check that it's a Unix file.
+    unixStat, ok := fi.Sys().(*syscall.Stat_t)
+    if !ok {
+        log.Fatal("hello.go: not a Unix file")
+    }
+    fmt.Printf("file i-number: %d\n", unixStat.Ino)
+
+ +

+Assuming (which is unwise) that "hello.go" is a Unix file, +the i-number expression could be contracted to +

+ +
+    fi.Sys().(*syscall.Stat_t).Ino
+
+ +

+The vast majority of uses of FileInfo need only the methods +of the standard interface. +

+ +

+The os package no longer contains wrappers for the POSIX errors +such as ENOENT. +For the few programs that need to verify particular error conditions, there are +now the boolean functions +IsExist, +IsNotExist +and +IsPermission. +

+ +{{code "/doc/progs/go1.go" `/os\.Open/` `/}/`}} + +

+Updating: +Running go fix will update code that uses the old equivalent of the current os.FileInfo +and os.FileMode API. +Code that needs system-specific file details will need to be updated by hand. +Code that uses the old POSIX error values from the os package +will fail to compile and will also need to be updated by hand. +

+ +

The os/signal package

+ +

+The os/signal package in Go 1 replaces the +Incoming function, which returned a channel +that received all incoming signals, +with the selective Notify function, which asks +for delivery of specific signals on an existing channel. +

+ +

+Updating: +Code must be updated by hand. +A literal translation of +

+
+c := signal.Incoming()
+
+

+is +

+
+c := make(chan os.Signal)
+signal.Notify(c) // ask for all signals
+
+

+but most code should list the specific signals it wants to handle instead: +

+
+c := make(chan os.Signal)
+signal.Notify(c, syscall.SIGHUP, syscall.SIGQUIT)
+
+ +

The path/filepath package

+ +

+In Go 1, the Walk function of the +path/filepath package +has been changed to take a function value of type +WalkFunc +instead of a Visitor interface value. +WalkFunc unifies the handling of both files and directories. +

+ +
+    type WalkFunc func(path string, info os.FileInfo, err error) error
+
+ +

+The WalkFunc function will be called even for files or directories that could not be opened; +in such cases the error argument will describe the failure. +If a directory's contents are to be skipped, +the function should return the value filepath.SkipDir +

+ +{{code "/doc/progs/go1.go" `/STARTWALK/` `/ENDWALK/`}} + +

+Updating: +The change simplifies most code but has subtle consequences, so affected programs +will need to be updated by hand. +The compiler will catch code using the old interface. +

+ +

The regexp package

+ +

+The regexp package has been rewritten. +It has the same interface but the specification of the regular expressions +it supports has changed from the old "egrep" form to that of +RE2. +

+ +

+Updating: +Code that uses the package should have its regular expressions checked by hand. +

+ +

The runtime package

+ +

+In Go 1, much of the API exported by package +runtime has been removed in favor of +functionality provided by other packages. +Code using the runtime.Type interface +or its specific concrete type implementations should +now use package reflect. +Code using runtime.Semacquire or runtime.Semrelease +should use channels or the abstractions in package sync. +The runtime.Alloc, runtime.Free, +and runtime.Lookup functions, an unsafe API created for +debugging the memory allocator, have no replacement. +

+ +

+Before, runtime.MemStats was a global variable holding +statistics about memory allocation, and calls to runtime.UpdateMemStats +ensured that it was up to date. +In Go 1, runtime.MemStats is a struct type, and code should use +runtime.ReadMemStats +to obtain the current statistics. +

+ +

+The package adds a new function, +runtime.NumCPU, that returns the number of CPUs available +for parallel execution, as reported by the operating system kernel. +Its value can inform the setting of GOMAXPROCS. +The runtime.Cgocalls and runtime.Goroutines functions +have been renamed to runtime.NumCgoCall and runtime.NumGoroutine. +

+ +

+Updating: +Running go fix will update code for the function renamings. +Other code will need to be updated by hand. +

+ +

The strconv package

+ +

+In Go 1, the +strconv +package has been significantly reworked to make it more Go-like and less C-like, +although Atoi lives on (it's similar to +int(ParseInt(x, 10, 0)), as does +Itoa(x) (FormatInt(int64(x), 10)). +There are also new variants of some of the functions that append to byte slices rather than +return strings, to allow control over allocation. +

+ +

+This table summarizes the renamings; see the +package documentation +for full details. +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Old callNew call

Atob(x) ParseBool(x)

Atof32(x) ParseFloat(x, 32)§
Atof64(x) ParseFloat(x, 64)
AtofN(x, n) ParseFloat(x, n)

Atoi(x) Atoi(x)
Atoi(x) ParseInt(x, 10, 0)§
Atoi64(x) ParseInt(x, 10, 64)

Atoui(x) ParseUint(x, 10, 0)§
Atoui64(x) ParseUint(x, 10, 64)

Btoi64(x, b) ParseInt(x, b, 64)
Btoui64(x, b) ParseUint(x, b, 64)

Btoa(x) FormatBool(x)

Ftoa32(x, f, p) FormatFloat(float64(x), f, p, 32)
Ftoa64(x, f, p) FormatFloat(x, f, p, 64)
FtoaN(x, f, p, n) FormatFloat(x, f, p, n)

Itoa(x) Itoa(x)
Itoa(x) FormatInt(int64(x), 10)
Itoa64(x) FormatInt(x, 10)

Itob(x, b) FormatInt(int64(x), b)
Itob64(x, b) FormatInt(x, b)

Uitoa(x) FormatUint(uint64(x), 10)
Uitoa64(x) FormatUint(x, 10)

Uitob(x, b) FormatUint(uint64(x), b)
Uitob64(x, b) FormatUint(x, b)
+ +

+Updating: +Running go fix will update almost all code affected by the change. +
Atoi persists but Atoui and Atof32 do not, so +they may require +a cast that must be added by hand; the go fix tool will warn about it. +

+ + +

The template packages

+ +

+The template and exp/template/html packages have moved to +text/template and +html/template. +More significant, the interface to these packages has been simplified. +The template language is the same, but the concept of "template set" is gone +and the functions and methods of the packages have changed accordingly, +often by elimination. +

+ +

+Instead of sets, a Template object +may contain multiple named template definitions, +in effect constructing +name spaces for template invocation. +A template can invoke any other template associated with it, but only those +templates associated with it. +The simplest way to associate templates is to parse them together, something +made easier with the new structure of the packages. +

+ +

+Updating: +The imports will be updated by fix tool. +Single-template uses will be otherwise be largely unaffected. +Code that uses multiple templates in concert will need to be updated by hand. +The examples in +the documentation for text/template can provide guidance. +

+ +

The testing package

+ +

+The testing package has a type, B, passed as an argument to benchmark functions. +In Go 1, B has new methods, analogous to those of T, enabling +logging and failure reporting. +

+ +{{code "/doc/progs/go1.go" `/func.*Benchmark/` `/^}/`}} + +

+Updating: +Existing code is unaffected, although benchmarks that use println +or panic should be updated to use the new methods. +

+ +

The testing/script package

+ +

+The testing/script package has been deleted. It was a dreg. +

+ +

+Updating: +No code is likely to be affected. +

+ +

The unsafe package

+ +

+In Go 1, the functions +unsafe.Typeof, unsafe.Reflect, +unsafe.Unreflect, unsafe.New, and +unsafe.NewArray have been removed; +they duplicated safer functionality provided by +package reflect. +

+ +

+Updating: +Code using these functions must be rewritten to use +package reflect. +The changes to encoding/gob and the protocol buffer library +may be helpful as examples. +

+ +

The url package

+ +

+In Go 1 several fields from the url.URL type +were removed or replaced. +

+ +

+The String method now +predictably rebuilds an encoded URL string using all of URL's +fields as necessary. The resulting string will also no longer have +passwords escaped. +

+ +

+The Raw field has been removed. In most cases the String +method may be used in its place. +

+ +

+The old RawUserinfo field is replaced by the User +field, of type *net.Userinfo. +Values of this type may be created using the new net.User +and net.UserPassword +functions. The EscapeUserinfo and UnescapeUserinfo +functions are also gone. +

+ +

+The RawAuthority field has been removed. The same information is +available in the Host and User fields. +

+ +

+The RawPath field and the EncodedPath method have +been removed. The path information in rooted URLs (with a slash following the +schema) is now available only in decoded form in the Path field. +Occasionally, the encoded data may be required to obtain information that +was lost in the decoding process. These cases must be handled by accessing +the data the URL was built from. +

+ +

+URLs with non-rooted paths, such as "mailto:dev@golang.org?subject=Hi", +are also handled differently. The OpaquePath boolean field has been +removed and a new Opaque string field introduced to hold the encoded +path for such URLs. In Go 1, the cited URL parses as: +

+ +
+    URL{
+        Scheme: "mailto",
+        Opaque: "dev@golang.org",
+        RawQuery: "subject=Hi",
+    }
+
+ +

+A new RequestURI method was +added to URL. +

+ +

+The ParseWithReference function has been renamed to ParseWithFragment. +

+ +

+Updating: +Code that uses the old fields will fail to compile and must be updated by hand. +The semantic changes make it difficult for the fix tool to update automatically. +

+ +

The go command

+ +

+Go 1 introduces the go command, a tool for fetching, +building, and installing Go packages and commands. The go command +does away with makefiles, instead using Go source code to find dependencies and +determine build conditions. Most existing Go programs will no longer require +makefiles to be built. +

+ +

+See How to Write Go Code for a primer on the +go command and the go command documentation +for the full details. +

+ +

+Updating: +Projects that depend on the Go project's old makefile-based build +infrastructure (Make.pkg, Make.cmd, and so on) should +switch to using the go command for building Go code and, if +necessary, rewrite their makefiles to perform any auxiliary build tasks. +

+ +

The cgo command

+ +

+In Go 1, the cgo command +uses a different _cgo_export.h +file, which is generated for packages containing //export lines. +The _cgo_export.h file now begins with the C preamble comment, +so that exported function definitions can use types defined there. +This has the effect of compiling the preamble multiple times, so a +package using //export must not put function definitions +or variable initializations in the C preamble. +

+ +

Packaged releases

+ +

+One of the most significant changes associated with Go 1 is the availability +of prepackaged, downloadable distributions. +They are available for many combinations of architecture and operating system +(including Windows) and the list will grow. +Installation details are described on the +Getting Started page, while +the distributions themselves are listed on the +downloads page. diff --git a/doc/go1compat.html b/doc/go1compat.html new file mode 100644 index 0000000000000000000000000000000000000000..607d35468764c3c356b1a63e887426718d8085b7 --- /dev/null +++ b/doc/go1compat.html @@ -0,0 +1,202 @@ + + +

Introduction

+

+The release of Go version 1, Go 1 for short, is a major milestone +in the development of the language. Go 1 is a stable platform for +the growth of programs and projects written in Go. +

+ +

+Go 1 defines two things: first, the specification of the language; +and second, the specification of a set of core APIs, the "standard +packages" of the Go library. The Go 1 release includes their +implementation in the form of two compiler suites (gc and gccgo), +and the core libraries themselves. +

+ +

+It is intended that programs written to the Go 1 specification will +continue to compile and run correctly, unchanged, over the lifetime +of that specification. At some indefinite point, a Go 2 specification +may arise, but until that time, Go programs that work today should +continue to work even as future "point" releases of Go 1 arise (Go +1.1, Go 1.2, etc.). +

+ +

+Compatibility is at the source level. Binary compatibility for +compiled packages is not guaranteed between releases. After a point +release, Go source will need to be recompiled to link against the +new release. +

+ +

+The APIs may grow, acquiring new packages and features, but not in +a way that breaks existing Go 1 code. +

+ +

Expectations

+ +

+Although we expect that the vast majority of programs will maintain +this compatibility over time, it is impossible to guarantee that +no future change will break any program. This document is an attempt +to set expectations for the compatibility of Go 1 software in the +future. There are a number of ways in which a program that compiles +and runs today may fail to do so after a future point release. They +are all unlikely but worth recording. +

+ +
    +
  • +Security. A security issue in the specification or implementation +may come to light whose resolution requires breaking compatibility. +We reserve the right to address such security issues. +
  • + +
  • +Unspecified behavior. The Go specification tries to be explicit +about most properties of the language, but there are some aspects +that are undefined. Programs that depend on such unspecified behavior +may break in future releases. +
  • + +
  • +Specification errors. If it becomes necessary to address an +inconsistency or incompleteness in the specification, resolving the +issue could affect the meaning or legality of existing programs. +We reserve the right to address such issues, including updating the +implementations. Except for security issues, no incompatible changes +to the specification would be made. +
  • + +
  • +Bugs. If a compiler or library has a bug that violates the +specification, a program that depends on the buggy behavior may +break if the bug is fixed. We reserve the right to fix such bugs. +
  • + +
  • +Struct literals. For the addition of features in later point +releases, it may be necessary to add fields to exported structs in +the API. Code that uses unkeyed struct literals (such as pkg.T{3, +"x"}) to create values of these types would fail to compile after +such a change. However, code that uses keyed literals (pkg.T{A: +3, B: "x"}) will continue to compile after such a change. We will +update such data structures in a way that allows keyed struct +literals to remain compatible, although unkeyed literals may fail +to compile. (There are also more intricate cases involving nested +data structures or interfaces, but they have the same resolution.) +We therefore recommend that composite literals whose type is defined +in a separate package should use the keyed notation. +
  • + +
  • +Methods. As with struct fields, it may be necessary to add methods +to types. +Under some circumstances, such as when the type is embedded in +a struct along with another type, +the addition of the new method may break +the struct by creating a conflict with an existing method of the other +embedded type. +We cannot protect against this rare case and do not guarantee compatibility +should it arise. +
  • + +
  • +Dot imports. If a program imports a standard package +using import . "path", additional names defined in the +imported package in future releases may conflict with other names +defined in the program. We do not recommend the use of import . +outside of tests, and using it may cause a program to fail +to compile in future releases. +
  • + +
  • +Use of package unsafe. Packages that import +unsafe +may depend on internal properties of the Go implementation. +We reserve the right to make changes to the implementation +that may break such programs. +
  • + +
+ +

+Of course, for all of these possibilities, should they arise, we +would endeavor whenever feasible to update the specification, +compilers, or libraries without affecting existing code. +

+ +

+These same considerations apply to successive point releases. For +instance, code that runs under Go 1.2 should be compatible with Go +1.2.1, Go 1.3, Go 1.4, etc., although not necessarily with Go 1.1 +since it may use features added only in Go 1.2 +

+ +

+Features added between releases, available in the source repository +but not part of the numbered binary releases, are under active +development. No promise of compatibility is made for software using +such features until they have been released. +

+ +

+Finally, although it is not a correctness issue, it is possible +that the performance of a program may be affected by +changes in the implementation of the compilers or libraries upon +which it depends. +No guarantee can be made about the performance of a +given program between releases. +

+ +

+Although these expectations apply to Go 1 itself, we hope similar +considerations would be made for the development of externally +developed software based on Go 1. +

+ +

Sub-repositories

+ +

+Code in sub-repositories of the main go tree, such as +golang.org/x/net, +may be developed under +looser compatibility requirements. However, the sub-repositories +will be tagged as appropriate to identify versions that are compatible +with the Go 1 point releases. +

+ +

Operating systems

+ +

+It is impossible to guarantee long-term compatibility with operating +system interfaces, which are changed by outside parties. +The syscall package +is therefore outside the purview of the guarantees made here. +As of Go version 1.4, the syscall package is frozen. +Any evolution of the system call interface must be supported elsewhere, +such as in the +go.sys subrepository. +For details and background, see +this document. +

+ +

Tools

+ +

+Finally, the Go tool chain (compilers, linkers, build tools, and so +on) are under active development and may change behavior. This +means, for instance, that scripts that depend on the location and +properties of the tools may be broken by a point release. +

+ +

+These caveats aside, we believe that Go 1 will be a firm foundation +for the development of Go and its ecosystem. +

diff --git a/doc/go_faq.html b/doc/go_faq.html new file mode 100644 index 0000000000000000000000000000000000000000..33636fca3970c5ea80587086a16c0e78b4545245 --- /dev/null +++ b/doc/go_faq.html @@ -0,0 +1,1978 @@ + + +

Origins

+ +

+What is the purpose of the project?

+ +

+No major systems language has emerged in over a decade, but over that time +the computing landscape has changed tremendously. There are several trends: +

+ +
    +
  • +Computers are enormously quicker but software development is not faster. +
  • +Dependency management is a big part of software development today but the +“header files” of languages in the C tradition are antithetical to clean +dependency analysis—and fast compilation. +
  • +There is a growing rebellion against cumbersome type systems like those of +Java and C++, pushing people towards dynamically typed languages such as +Python and JavaScript. +
  • +Some fundamental concepts such as garbage collection and parallel computation +are not well supported by popular systems languages. +
  • +The emergence of multicore computers has generated worry and confusion. +
+ +

+We believe it's worth trying again with a new language, a concurrent, +garbage-collected language with fast compilation. Regarding the points above: +

+ +
    +
  • +It is possible to compile a large Go program in a few seconds on a single computer. +
  • +Go provides a model for software construction that makes dependency +analysis easy and avoids much of the overhead of C-style include files and +libraries. +
  • +Go's type system has no hierarchy, so no time is spent defining the +relationships between types. Also, although Go has static types the language +attempts to make types feel lighter weight than in typical OO languages. +
  • +Go is fully garbage-collected and provides fundamental support for +concurrent execution and communication. +
  • +By its design, Go proposes an approach for the construction of system +software on multicore machines. +
+ +

+A much more expansive answer to this question is available in the article, +Go at Google: +Language Design in the Service of Software Engineering. + +

+What is the status of the project?

+ +

+Go became a public open source project on November 10, 2009. +After a couple of years of very active design and development, stability was called for and +Go 1 was released +on March 28, 2012. +Go 1, which includes a language specification, +standard libraries, +and custom tools, +provides a stable foundation for creating reliable products, projects, and publications. +

+ +

+With that stability established, we are using Go to develop programs, products, and tools rather than +actively changing the language and libraries. +In fact, the purpose of Go 1 is to provide long-term stability. +Backwards-incompatible changes will not be made to any Go 1 point release. +We want to use what we have to learn how a future version of Go might look, rather than to play with +the language underfoot. +

+ +

+Of course, development will continue on Go itself, but the focus will be on performance, reliability, +portability and the addition of new functionality such as improved support for internationalization. +

+ +

+There may well be a Go 2 one day, but not for a few years and it will be influenced by what we learn using Go 1 as it is today. +

+ +

+What's the origin of the mascot?

+ +

+The mascot and logo were designed by +Renée French, who also designed +Glenda, +the Plan 9 bunny. +The gopher +is derived from one she used for an WFMU +T-shirt design some years ago. +The logo and mascot are covered by the +Creative Commons Attribution 3.0 +license. +

+ +

+What is the history of the project?

+

+Robert Griesemer, Rob Pike and Ken Thompson started sketching the +goals for a new language on the white board on September 21, 2007. +Within a few days the goals had settled into a plan to do something +and a fair idea of what it would be. Design continued part-time in +parallel with unrelated work. By January 2008, Ken had started work +on a compiler with which to explore ideas; it generated C code as its +output. By mid-year the language had become a full-time project and +had settled enough to attempt a production compiler. In May 2008, +Ian Taylor independently started on a GCC front end for Go using the +draft specification. Russ Cox joined in late 2008 and helped move the language +and libraries from prototype to reality. +

+ +

+Go became a public open source project on November 10, 2009. +Many people from the community have contributed ideas, discussions, and code. +

+ +

+Why are you creating a new language?

+

+Go was born out of frustration with existing languages and +environments for systems programming. Programming had become too +difficult and the choice of languages was partly to blame. One had to +choose either efficient compilation, efficient execution, or ease of +programming; all three were not available in the same mainstream +language. Programmers who could were choosing ease over +safety and efficiency by moving to dynamically typed languages such as +Python and JavaScript rather than C++ or, to a lesser extent, Java. +

+ +

+Go is an attempt to combine the ease of programming of an interpreted, +dynamically typed +language with the efficiency and safety of a statically typed, compiled language. +It also aims to be modern, with support for networked and multicore +computing. Finally, working with Go is intended to be fast: it should take +at most a few seconds to build a large executable on a single computer. +To meet these goals required addressing a number of +linguistic issues: an expressive but lightweight type system; +concurrency and garbage collection; rigid dependency specification; +and so on. These cannot be addressed well by libraries or tools; a new +language was called for. +

+ +

+The article Go at Google +discusses the background and motivation behind the design of the Go language, +as well as providing more detail about many of the answers presented in this FAQ. +

+ +

+What are Go's ancestors?

+

+Go is mostly in the C family (basic syntax), +with significant input from the Pascal/Modula/Oberon +family (declarations, packages), +plus some ideas from languages +inspired by Tony Hoare's CSP, +such as Newsqueak and Limbo (concurrency). +However, it is a new language across the board. +In every respect the language was designed by thinking +about what programmers do and how to make programming, at least the +kind of programming we do, more effective, which means more fun. +

+ +

+What are the guiding principles in the design?

+

+Programming today involves too much bookkeeping, repetition, and +clerical work. As Dick Gabriel says, “Old programs read +like quiet conversations between a well-spoken research worker and a +well-studied mechanical colleague, not as a debate with a compiler. +Who'd have guessed sophistication bought such noise?” +The sophistication is worthwhile—no one wants to go back to +the old languages—but can it be more quietly achieved? +

+

+Go attempts to reduce the amount of typing in both senses of the word. +Throughout its design, we have tried to reduce clutter and +complexity. There are no forward declarations and no header files; +everything is declared exactly once. Initialization is expressive, +automatic, and easy to use. Syntax is clean and light on keywords. +Stuttering (foo.Foo* myFoo = new(foo.Foo)) is reduced by +simple type derivation using the := +declare-and-initialize construct. And perhaps most radically, there +is no type hierarchy: types just are, they don't have to +announce their relationships. These simplifications allow Go to be +expressive yet comprehensible without sacrificing, well, sophistication. +

+

+Another important principle is to keep the concepts orthogonal. +Methods can be implemented for any type; structures represent data while +interfaces represent abstraction; and so on. Orthogonality makes it +easier to understand what happens when things combine. +

+ +

Usage

+ +

Is Google using Go internally?

+ +

+Yes. There are now several Go programs deployed in +production inside Google. A public example is the server behind +golang.org. +It's just the godoc +document server running in a production configuration on +Google App Engine. +

+ +

+Other examples include the Vitess +system for large-scale SQL installations and Google's download server, dl.google.com, +which delivers Chrome binaries and other large installables such as apt-get +packages. +

+ + + +

+There are two Go compiler implementations, gc +and gccgo. +Gc uses a different calling convention and linker and can +therefore only be linked with C programs using the same convention. +There is such a C compiler but no C++ compiler. +Gccgo is a GCC front-end that can, with care, be linked with +GCC-compiled C or C++ programs. +

+ +

+The cgo program provides the mechanism for a +“foreign function interface” to allow safe calling of +C libraries from Go code. SWIG extends this capability to C++ libraries. +

+ + +

+Does Go support Google's protocol buffers?

+ +

+A separate open source project provides the necessary compiler plugin and library. +It is available at +github.com/golang/protobuf/ +

+ + +

+Can I translate the Go home page into another language?

+ +

+Absolutely. We encourage developers to make Go Language sites in their own languages. +However, if you choose to add the Google logo or branding to your site +(it does not appear on golang.org), +you will need to abide by the guidelines at +www.google.com/permissions/guidelines.html +

+ +

Design

+ +

+What's up with Unicode identifiers?

+ +

+It was important to us to extend the space of identifiers from the +confines of ASCII. Go's rule—identifier characters must be +letters or digits as defined by Unicode—is simple to understand +and to implement but has restrictions. Combining characters are +excluded by design, for instance. +Until there +is an agreed external definition of what an identifier might be, +plus a definition of canonicalization of identifiers that guarantees +no ambiguity, it seemed better to keep combining characters out of +the mix. Thus we have a simple rule that can be expanded later +without breaking programs, one that avoids bugs that would surely arise +from a rule that admits ambiguous identifiers. +

+ +

+On a related note, since an exported identifier must begin with an +upper-case letter, identifiers created from “letters” +in some languages can, by definition, not be exported. For now the +only solution is to use something like X日本語, which +is clearly unsatisfactory; we are considering other options. The +case-for-visibility rule is unlikely to change however; it's one +of our favorite features of Go. +

+ +

Why does Go not have feature X?

+ +

+Every language contains novel features and omits someone's favorite +feature. Go was designed with an eye on felicity of programming, speed of +compilation, orthogonality of concepts, and the need to support features +such as concurrency and garbage collection. Your favorite feature may be +missing because it doesn't fit, because it affects compilation speed or +clarity of design, or because it would make the fundamental system model +too difficult. +

+ +

+If it bothers you that Go is missing feature X, +please forgive us and investigate the features that Go does have. You might find that +they compensate in interesting ways for the lack of X. +

+ +

+Why does Go not have generic types?

+

+Generics may well be added at some point. We don't feel an urgency for +them, although we understand some programmers do. +

+ +

+Generics are convenient but they come at a cost in +complexity in the type system and run-time. We haven't yet found a +design that gives value proportionate to the complexity, although we +continue to think about it. Meanwhile, Go's built-in maps and slices, +plus the ability to use the empty interface to construct containers +(with explicit unboxing) mean in many cases it is possible to write +code that does what generics would enable, if less smoothly. +

+ +

+This remains an open issue. +

+ +

+Why does Go not have exceptions?

+

+We believe that coupling exceptions to a control +structure, as in the try-catch-finally idiom, results in +convoluted code. It also tends to encourage programmers to label +too many ordinary errors, such as failing to open a file, as +exceptional. +

+ +

+Go takes a different approach. For plain error handling, Go's multi-value +returns make it easy to report an error without overloading the return value. +A canonical error type, coupled +with Go's other features, makes error handling pleasant but quite different +from that in other languages. +

+ +

+Go also has a couple +of built-in functions to signal and recover from truly exceptional +conditions. The recovery mechanism is executed only as part of a +function's state being torn down after an error, which is sufficient +to handle catastrophe but requires no extra control structures and, +when used well, can result in clean error-handling code. +

+ +

+See the Defer, Panic, and Recover article for details. +

+ +

+Why does Go not have assertions?

+ +

+Go doesn't provide assertions. They are undeniably convenient, but our +experience has been that programmers use them as a crutch to avoid thinking +about proper error handling and reporting. Proper error handling means that +servers continue operation after non-fatal errors instead of crashing. +Proper error reporting means that errors are direct and to the point, +saving the programmer from interpreting a large crash trace. Precise +errors are particularly important when the programmer seeing the errors is +not familiar with the code. +

+ +

+We understand that this is a point of contention. There are many things in +the Go language and libraries that differ from modern practices, simply +because we feel it's sometimes worth trying a different approach. +

+ +

+Why build concurrency on the ideas of CSP?

+

+Concurrency and multi-threaded programming have a reputation +for difficulty. We believe this is due partly to complex +designs such as pthreads and partly to overemphasis on low-level details +such as mutexes, condition variables, and memory barriers. +Higher-level interfaces enable much simpler code, even if there are still +mutexes and such under the covers. +

+ +

+One of the most successful models for providing high-level linguistic support +for concurrency comes from Hoare's Communicating Sequential Processes, or CSP. +Occam and Erlang are two well known languages that stem from CSP. +Go's concurrency primitives derive from a different part of the family tree +whose main contribution is the powerful notion of channels as first class objects. +Experience with several earlier languages has shown that the CSP model +fits well into a procedural language framework. +

+ +

+Why goroutines instead of threads?

+

+Goroutines are part of making concurrency easy to use. The idea, which has +been around for a while, is to multiplex independently executing +functions—coroutines—onto a set of threads. +When a coroutine blocks, such as by calling a blocking system call, +the run-time automatically moves other coroutines on the same operating +system thread to a different, runnable thread so they won't be blocked. +The programmer sees none of this, which is the point. +The result, which we call goroutines, can be very cheap: they have little +overhead beyond the memory for the stack, which is just a few kilobytes. +

+ +

+To make the stacks small, Go's run-time uses resizable, bounded stacks. A newly +minted goroutine is given a few kilobytes, which is almost always enough. +When it isn't, the run-time grows (and shrinks) the memory for storing +the stack automatically, allowing many goroutines to live in a modest +amount of memory. +The CPU overhead averages about three cheap instructions per function call. +It is practical to create hundreds of thousands of goroutines in the same +address space. +If goroutines were just threads, system resources would +run out at a much smaller number. +

+ +

+Why are map operations not defined to be atomic?

+ +

+After long discussion it was decided that the typical use of maps did not require +safe access from multiple goroutines, and in those cases where it did, the map was +probably part of some larger data structure or computation that was already +synchronized. Therefore requiring that all map operations grab a mutex would slow +down most programs and add safety to few. This was not an easy decision, +however, since it means uncontrolled map access can crash the program. +

+ +

+The language does not preclude atomic map updates. When required, such +as when hosting an untrusted program, the implementation could interlock +map access. +

+ +

+Will you accept my language change?

+ +

+People often suggest improvements to the language—the +mailing list +contains a rich history of such discussions—but very few of these changes have +been accepted. +

+ +

+Although Go is an open source project, the language and libraries are protected +by a compatibility promise that prevents +changes that break existing programs. +If your proposal violates the Go 1 specification we cannot even entertain the +idea, regardless of its merit. +A future major release of Go may be incompatible with Go 1, but we're not ready +to start talking about what that might be. +

+ +

+Even if your proposal is compatible with the Go 1 spec, it might +not be in the spirit of Go's design goals. +The article Go +at Google: Language Design in the Service of Software Engineering +explains Go's origins and the motivation behind its design. +

+ +

Types

+ +

+Is Go an object-oriented language?

+ +

+Yes and no. Although Go has types and methods and allows an +object-oriented style of programming, there is no type hierarchy. +The concept of “interface” in Go provides a different approach that +we believe is easy to use and in some ways more general. There are +also ways to embed types in other types to provide something +analogous—but not identical—to subclassing. +Moreover, methods in Go are more general than in C++ or Java: +they can be defined for any sort of data, even built-in types such +as plain, “unboxed” integers. +They are not restricted to structs (classes). +

+ +

+Also, the lack of a type hierarchy makes “objects” in Go feel much more +lightweight than in languages such as C++ or Java. +

+ +

+How do I get dynamic dispatch of methods?

+ +

+The only way to have dynamically dispatched methods is through an +interface. Methods on a struct or any other concrete type are always resolved statically. +

+ +

+Why is there no type inheritance?

+

+Object-oriented programming, at least in the best-known languages, +involves too much discussion of the relationships between types, +relationships that often could be derived automatically. Go takes a +different approach. +

+ +

+Rather than requiring the programmer to declare ahead of time that two +types are related, in Go a type automatically satisfies any interface +that specifies a subset of its methods. Besides reducing the +bookkeeping, this approach has real advantages. Types can satisfy +many interfaces at once, without the complexities of traditional +multiple inheritance. +Interfaces can be very lightweight—an interface with +one or even zero methods can express a useful concept. +Interfaces can be added after the fact if a new idea comes along +or for testing—without annotating the original types. +Because there are no explicit relationships between types +and interfaces, there is no type hierarchy to manage or discuss. +

+ +

+It's possible to use these ideas to construct something analogous to +type-safe Unix pipes. For instance, see how fmt.Fprintf +enables formatted printing to any output, not just a file, or how the +bufio package can be completely separate from file I/O, +or how the image packages generate compressed +image files. All these ideas stem from a single interface +(io.Writer) representing a single method +(Write). And that's only scratching the surface. +Go's interfaces have a profound influence on how programs are structured. +

+ +

+It takes some getting used to but this implicit style of type +dependency is one of the most productive things about Go. +

+ +

+Why is len a function and not a method?

+

+We debated this issue but decided +implementing len and friends as functions was fine in practice and +didn't complicate questions about the interface (in the Go type sense) +of basic types. +

+ +

+Why does Go not support overloading of methods and operators?

+

+Method dispatch is simplified if it doesn't need to do type matching as well. +Experience with other languages told us that having a variety of +methods with the same name but different signatures was occasionally useful +but that it could also be confusing and fragile in practice. Matching only by name +and requiring consistency in the types was a major simplifying decision +in Go's type system. +

+ +

+Regarding operator overloading, it seems more a convenience than an absolute +requirement. Again, things are simpler without it. +

+ +

+Why doesn't Go have "implements" declarations?

+ +

+A Go type satisfies an interface by implementing the methods of that interface, +nothing more. This property allows interfaces to be defined and used without +having to modify existing code. It enables a kind of structural typing that +promotes separation of concerns and improves code re-use, and makes it easier +to build on patterns that emerge as the code develops. +The semantics of interfaces is one of the main reasons for Go's nimble, +lightweight feel. +

+ +

+See the question on type inheritance for more detail. +

+ +

+How can I guarantee my type satisfies an interface?

+ +

+You can ask the compiler to check that the type T implements the +interface I by attempting an assignment using the zero value for +T or pointer to T, as appropriate: +

+ +
+type T struct{}
+var _ I = T{}       // Verify that T implements I.
+var _ I = (*T)(nil) // Verify that *T implements I.
+
+ +

+If T (or *T, accordingly) doesn't implement +I, the mistake will be caught at compile time. +

+ +

+If you wish the users of an interface to explicitly declare that they implement +it, you can add a method with a descriptive name to the interface's method set. +For example: +

+ +
+type Fooer interface {
+    Foo()
+    ImplementsFooer()
+}
+
+ +

+A type must then implement the ImplementsFooer method to be a +Fooer, clearly documenting the fact and announcing it in +godoc's output. +

+ +
+type Bar struct{}
+func (b Bar) ImplementsFooer() {}
+func (b Bar) Foo() {}
+
+ +

+Most code doesn't make use of such constraints, since they limit the utility of +the interface idea. Sometimes, though, they're necessary to resolve ambiguities +among similar interfaces. +

+ +

+Why doesn't type T satisfy the Equal interface?

+ +

+Consider this simple interface to represent an object that can compare +itself with another value: +

+ +
+type Equaler interface {
+    Equal(Equaler) bool
+}
+
+ +

+and this type, T: +

+ +
+type T int
+func (t T) Equal(u T) bool { return t == u } // does not satisfy Equaler
+
+ +

+Unlike the analogous situation in some polymorphic type systems, +T does not implement Equaler. +The argument type of T.Equal is T, +not literally the required type Equaler. +

+ +

+In Go, the type system does not promote the argument of +Equal; that is the programmer's responsibility, as +illustrated by the type T2, which does implement +Equaler: +

+ +
+type T2 int
+func (t T2) Equal(u Equaler) bool { return t == u.(T2) }  // satisfies Equaler
+
+ +

+Even this isn't like other type systems, though, because in Go any +type that satisfies Equaler could be passed as the +argument to T2.Equal, and at run time we must +check that the argument is of type T2. +Some languages arrange to make that guarantee at compile time. +

+ +

+A related example goes the other way: +

+ +
+type Opener interface {
+   Open() Reader
+}
+
+func (t T3) Open() *os.File
+
+ +

+In Go, T3 does not satisfy Opener, +although it might in another language. +

+ +

+While it is true that Go's type system does less for the programmer +in such cases, the lack of subtyping makes the rules about +interface satisfaction very easy to state: are the function's names +and signatures exactly those of the interface? +Go's rule is also easy to implement efficiently. +We feel these benefits offset the lack of +automatic type promotion. Should Go one day adopt some form of polymorphic +typing, we expect there would be a way to express the idea of these +examples and also have them be statically checked. +

+ +

+Can I convert a []T to an []interface{}?

+ +

+Not directly, because they do not have the same representation in memory. +It is necessary to copy the elements individually to the destination +slice. This example converts a slice of int to a slice of +interface{}: +

+ +
+t := []int{1, 2, 3, 4}
+s := make([]interface{}, len(t))
+for i, v := range t {
+    s[i] = v
+}
+
+ +

+Why is my nil error value not equal to nil? +

+ +

+Under the covers, interfaces are implemented as two elements, a type and a value. +The value, called the interface's dynamic value, +is an arbitrary concrete value and the type is that of the value. +For the int value 3, an interface value contains, +schematically, (int, 3). +

+ +

+An interface value is nil only if the inner value and type are both unset, +(nil, nil). +In particular, a nil interface will always hold a nil type. +If we store a nil pointer of type *int inside +an interface value, the inner type will be *int regardless of the value of the pointer: +(*int, nil). +Such an interface value will therefore be non-nil +even when the pointer inside is nil. +

+ +

+This situation can be confusing, and arises when a nil value is +stored inside an interface value such as an error return: +

+ +
+func returnsError() error {
+	var p *MyError = nil
+	if bad() {
+		p = ErrBad
+	}
+	return p // Will always return a non-nil error.
+}
+
+ +

+If all goes well, the function returns a nil p, +so the return value is an error interface +value holding (*MyError, nil). +This means that if the caller compares the returned error to nil, +it will always look as if there was an error even if nothing bad happened. +To return a proper nil error to the caller, +the function must return an explicit nil: +

+ + +
+func returnsError() error {
+	if bad() {
+		return ErrBad
+	}
+	return nil
+}
+
+ +

+It's a good idea for functions +that return errors always to use the error type in +their signature (as we did above) rather than a concrete type such +as *MyError, to help guarantee the error is +created correctly. As an example, +os.Open +returns an error even though, if not nil, +it's always of concrete type +*os.PathError. +

+ +

+Similar situations to those described here can arise whenever interfaces are used. +Just keep in mind that if any concrete value +has been stored in the interface, the interface will not be nil. +For more information, see +The Laws of Reflection. +

+ + +

+Why are there no untagged unions, as in C?

+ +

+Untagged unions would violate Go's memory safety +guarantees. +

+ +

+Why does Go not have variant types?

+ +

+Variant types, also known as algebraic types, provide a way to specify +that a value might take one of a set of other types, but only those +types. A common example in systems programming would specify that an +error is, say, a network error, a security error or an application +error and allow the caller to discriminate the source of the problem +by examining the type of the error. Another example is a syntax tree +in which each node can be a different type: declaration, statement, +assignment and so on. +

+ +

+We considered adding variant types to Go, but after discussion +decided to leave them out because they overlap in confusing ways +with interfaces. What would happen if the elements of a variant type +were themselves interfaces? +

+ +

+Also, some of what variant types address is already covered by the +language. The error example is easy to express using an interface +value to hold the error and a type switch to discriminate cases. The +syntax tree example is also doable, although not as elegantly. +

+ +

Values

+ +

+Why does Go not provide implicit numeric conversions?

+

+The convenience of automatic conversion between numeric types in C is +outweighed by the confusion it causes. When is an expression unsigned? +How big is the value? Does it overflow? Is the result portable, independent +of the machine on which it executes? +It also complicates the compiler; “the usual arithmetic conversions” +are not easy to implement and inconsistent across architectures. +For reasons of portability, we decided to make things clear and straightforward +at the cost of some explicit conversions in the code. +The definition of constants in Go—arbitrary precision values free +of signedness and size annotations—ameliorates matters considerably, +though. +

+ +

+A related detail is that, unlike in C, int and int64 +are distinct types even if int is a 64-bit type. The int +type is generic; if you care about how many bits an integer holds, Go +encourages you to be explicit. +

+ +

+A blog post titled Constants +explores this topic in more detail. +

+ +

+Why are maps built in?

+

+The same reason strings are: they are such a powerful and important data +structure that providing one excellent implementation with syntactic support +makes programming more pleasant. We believe that Go's implementation of maps +is strong enough that it will serve for the vast majority of uses. +If a specific application can benefit from a custom implementation, it's possible +to write one but it will not be as convenient syntactically; this seems a reasonable tradeoff. +

+ +

+Why don't maps allow slices as keys?

+

+Map lookup requires an equality operator, which slices do not implement. +They don't implement equality because equality is not well defined on such types; +there are multiple considerations involving shallow vs. deep comparison, pointer vs. +value comparison, how to deal with recursive types, and so on. +We may revisit this issue—and implementing equality for slices +will not invalidate any existing programs—but without a clear idea of what +equality of slices should mean, it was simpler to leave it out for now. +

+ +

+In Go 1, unlike prior releases, equality is defined for structs and arrays, so such +types can be used as map keys. Slices still do not have a definition of equality, though. +

+ +

+Why are maps, slices, and channels references while arrays are values?

+

+There's a lot of history on that topic. Early on, maps and channels +were syntactically pointers and it was impossible to declare or use a +non-pointer instance. Also, we struggled with how arrays should work. +Eventually we decided that the strict separation of pointers and +values made the language harder to use. Changing these +types to act as references to the associated, shared data structures resolved +these issues. This change added some regrettable complexity to the +language but had a large effect on usability: Go became a more +productive, comfortable language when it was introduced. +

+ +

Writing Code

+ +

+How are libraries documented?

+ +

+There is a program, godoc, written in Go, that extracts +package documentation from the source code. It can be used on the +command line or on the web. An instance is running at +golang.org/pkg/. +In fact, godoc implements the full site at +golang.org/. +

+ +

+A godoc instance may be configured to provide rich, +interactive static analyses of symbols in the programs it displays; details are +listed here. +

+ +

+For access to documentation from the command line, the +go tool has a +doc +subcommand that provides a textual interface to the same information. +

+ +

+Is there a Go programming style guide?

+ +

+Eventually, there may be a small number of rules to guide things +like naming, layout, and file organization. +The document Effective Go +contains some style advice. +More directly, the program gofmt is a pretty-printer +whose purpose is to enforce layout rules; it replaces the usual +compendium of do's and don'ts that allows interpretation. +All the Go code in the repository has been run through gofmt. +

+ +

+The document titled +Go Code Review Comments +is a collection of very short essays about details of Go idiom that are often +missed by programmers. +It is a handy reference for people doing code reviews for Go projects. +

+ +

+How do I submit patches to the Go libraries?

+ +

+The library sources are in the src directory of the repository. +If you want to make a significant change, please discuss on the mailing list before embarking. +

+ +

+See the document +Contributing to the Go project +for more information about how to proceed. +

+ +

+Why does "go get" use HTTPS when cloning a repository?

+ +

+Companies often permit outgoing traffic only on the standard TCP ports 80 (HTTP) +and 443 (HTTPS), blocking outgoing traffic on other ports, including TCP port 9418 +(git) and TCP port 22 (SSH). +When using HTTPS instead of HTTP, git enforces certificate validation by +default, providing protection against man-in-the-middle, eavesdropping and tampering attacks. +The go get command therefore uses HTTPS for safety. +

+ +

+If you use git and prefer to push changes through SSH using your existing key +it's easy to work around this. For GitHub, try one of these solutions: +

+
    +
  • Manually clone the repository in the expected package directory: +
    +$ cd $GOPATH/src/github.com/username
    +$ git clone git@github.com:username/package.git
    +
    +
  • +
  • Force git push to use the SSH protocol by appending +these two lines to ~/.gitconfig: +
    +[url "git@github.com:"]
    +	pushInsteadOf = https://github.com/
    +
    +
  • +
+ +

+How should I manage package versions using "go get"?

+ +

+"Go get" does not have any explicit concept of package versions. +Versioning is a source of significant complexity, especially in large code bases, +and we are unaware of any approach that works well at scale in a large enough +variety of situations to be appropriate to force on all Go users. +What "go get" and the larger Go toolchain do provide is isolation of +packages with different import paths. +For example, the standard library's html/template and text/template +coexist even though both are "package template". +This observation leads to some advice for package authors and package users. +

+ +

+Packages intended for public use should try to maintain backwards compatibility as they evolve. +The Go 1 compatibility guidelines are a good reference here: +don't remove exported names, encourage tagged composite literals, and so on. +If different functionality is required, add a new name instead of changing an old one. +If a complete break is required, create a new package with a new import path.

+ +

+If you're using an externally supplied package and worry that it might change in +unexpected ways, the simplest solution is to copy it to your local repository. +(This is the approach Google takes internally.) +Store the copy under a new import path that identifies it as a local copy. +For example, you might copy "original.com/pkg" to "you.com/external/original.com/pkg". +The gomvpkg +program is one tool to help automate this process. +

+ +

+The Go 1.5 release includes an experimental facility to the +go command +that makes it easier to manage external dependencies by "vendoring" +them into a special directory near the package that depends upon them. +See the design +document for details. +

+ +

Pointers and Allocation

+ +

+When are function parameters passed by value?

+ +

+As in all languages in the C family, everything in Go is passed by value. +That is, a function always gets a copy of the +thing being passed, as if there were an assignment statement assigning the +value to the parameter. For instance, passing an int value +to a function makes a copy of the int, and passing a pointer +value makes a copy of the pointer, but not the data it points to. +(See a later +section for a discussion of how this affects method receivers.) +

+ +

+Map and slice values behave like pointers: they are descriptors that +contain pointers to the underlying map or slice data. Copying a map or +slice value doesn't copy the data it points to. Copying an interface value +makes a copy of the thing stored in the interface value. If the interface +value holds a struct, copying the interface value makes a copy of the +struct. If the interface value holds a pointer, copying the interface value +makes a copy of the pointer, but again not the data it points to. +

+ +

+When should I use a pointer to an interface?

+ +

+Almost never. Pointers to interface values arise only in rare, tricky situations involving +disguising an interface value's type for delayed evaluation. +

+ +

+It is however a common mistake to pass a pointer to an interface value +to a function expecting an interface. The compiler will complain about this +error but the situation can still be confusing, because sometimes a +pointer +is necessary to satisfy an interface. +The insight is that although a pointer to a concrete type can satisfy +an interface, with one exception a pointer to an interface can never satisfy an interface. +

+ +

+Consider the variable declaration, +

+ +
+var w io.Writer
+
+ +

+The printing function fmt.Fprintf takes as its first argument +a value that satisfies io.Writer—something that implements +the canonical Write method. Thus we can write +

+ +
+fmt.Fprintf(w, "hello, world\n")
+
+ +

+If however we pass the address of w, the program will not compile. +

+ +
+fmt.Fprintf(&w, "hello, world\n") // Compile-time error.
+
+ +

+The one exception is that any value, even a pointer to an interface, can be assigned to +a variable of empty interface type (interface{}). +Even so, it's almost certainly a mistake if the value is a pointer to an interface; +the result can be confusing. +

+ +

+Should I define methods on values or pointers?

+ +
+func (s *MyStruct) pointerMethod() { } // method on pointer
+func (s MyStruct)  valueMethod()   { } // method on value
+
+ +

+For programmers unaccustomed to pointers, the distinction between these +two examples can be confusing, but the situation is actually very simple. +When defining a method on a type, the receiver (s in the above +examples) behaves exactly as if it were an argument to the method. +Whether to define the receiver as a value or as a pointer is the same +question, then, as whether a function argument should be a value or +a pointer. +There are several considerations. +

+ +

+First, and most important, does the method need to modify the +receiver? +If it does, the receiver must be a pointer. +(Slices and maps act as references, so their story is a little +more subtle, but for instance to change the length of a slice +in a method the receiver must still be a pointer.) +In the examples above, if pointerMethod modifies +the fields of s, +the caller will see those changes, but valueMethod +is called with a copy of the caller's argument (that's the definition +of passing a value), so changes it makes will be invisible to the caller. +

+ +

+By the way, pointer receivers are identical to the situation in Java, +although in Java the pointers are hidden under the covers; it's Go's +value receivers that are unusual. +

+ +

+Second is the consideration of efficiency. If the receiver is large, +a big struct for instance, it will be much cheaper to +use a pointer receiver. +

+ +

+Next is consistency. If some of the methods of the type must have +pointer receivers, the rest should too, so the method set is +consistent regardless of how the type is used. +See the section on method sets +for details. +

+ +

+For types such as basic types, slices, and small structs, +a value receiver is very cheap so unless the semantics of the method +requires a pointer, a value receiver is efficient and clear. +

+ + +

+What's the difference between new and make?

+ +

+In short: new allocates memory, make initializes +the slice, map, and channel types. +

+ +

+See the relevant section +of Effective Go for more details. +

+ +

+What is the size of an int on a 64 bit machine?

+ +

+The sizes of int and uint are implementation-specific +but the same as each other on a given platform. +For portability, code that relies on a particular +size of value should use an explicitly sized type, like int64. +Prior to Go 1.1, the 64-bit Go compilers (both gc and gccgo) used +a 32-bit representation for int. As of Go 1.1 they use +a 64-bit representation. +On the other hand, floating-point scalars and complex +numbers are always sized: float32, complex64, +etc., because programmers should be aware of precision when using +floating-point numbers. +The default size of a floating-point constant is float64. +

+ +

+How do I know whether a variable is allocated on the heap or the stack?

+ +

+From a correctness standpoint, you don't need to know. +Each variable in Go exists as long as there are references to it. +The storage location chosen by the implementation is irrelevant to the +semantics of the language. +

+ +

+The storage location does have an effect on writing efficient programs. +When possible, the Go compilers will allocate variables that are +local to a function in that function's stack frame. However, if the +compiler cannot prove that the variable is not referenced after the +function returns, then the compiler must allocate the variable on the +garbage-collected heap to avoid dangling pointer errors. +Also, if a local variable is very large, it might make more sense +to store it on the heap rather than the stack. +

+ +

+In the current compilers, if a variable has its address taken, that variable +is a candidate for allocation on the heap. However, a basic escape +analysis recognizes some cases when such variables will not +live past the return from the function and can reside on the stack. +

+ +

+Why does my Go process use so much virtual memory?

+ +

+The Go memory allocator reserves a large region of virtual memory as an arena +for allocations. This virtual memory is local to the specific Go process; the +reservation does not deprive other processes of memory. +

+ +

+To find the amount of actual memory allocated to a Go process, use the Unix +top command and consult the RES (Linux) or +RSIZE (Mac OS X) columns. + +

+ +

Concurrency

+ +

+What operations are atomic? What about mutexes?

+ +

+We haven't fully defined it all yet, but some details about atomicity are +available in the Go Memory Model specification. +

+ +

+Regarding mutexes, the sync +package implements them, but we hope Go programming style will +encourage people to try higher-level techniques. In particular, consider +structuring your program so that only one goroutine at a time is ever +responsible for a particular piece of data. +

+ +

+Do not communicate by sharing memory. Instead, share memory by communicating. +

+ +

+See the Share Memory By Communicating code walk and its associated article for a detailed discussion of this concept. +

+ +

+Why doesn't my multi-goroutine program use multiple CPUs?

+ +

+The number of CPUs available simultaneously to executing goroutines is +controlled by the GOMAXPROCS shell environment variable. +In earlier releases of Go, the default value was 1, but as of Go 1.5 the default +value is the number of cores available. +Therefore programs compiled after 1.5 should demonstrate parallel execution +of multiple goroutines. +To change the behavior, set the environment variable or use the similarly-named +function +of the runtime package to configure the +run-time support to utilize a different number of threads. +

+ +

+Programs that perform parallel computation might benefit from a further increase in +GOMAXPROCS. +However, be aware that +concurrency +is not parallelism. +

+ +

+Why does using GOMAXPROCS > 1 sometimes make my program +slower?

+ +

+It depends on the nature of your program. +Problems that are intrinsically sequential cannot be sped up by adding +more goroutines. +Concurrency only becomes parallelism when the problem is +intrinsically parallel. +

+ +

+In practical terms, programs that spend more time +communicating on channels than doing computation +may experience performance degradation when using +multiple OS threads. +This is because sending data between threads involves switching +contexts, which has significant cost. +For instance, the prime sieve example +from the Go specification has no significant parallelism although it launches many +goroutines; increasing GOMAXPROCS is more likely to slow it down than +to speed it up. +

+ +

+Go's goroutine scheduler is not as good as it needs to be, although it +has improved in recent releases. +In the future, it may better optimize its use of OS threads. +For now, if there are performance issues, +setting GOMAXPROCS on a per-application basis may help. +

+ +

+For more detail on this topic see the talk entitled, +Concurrency +is not Parallelism. + +

Functions and Methods

+ +

+Why do T and *T have different method sets?

+ +

+From the Go Spec: +

+ +
+The method set of any other named type T consists of all methods +with receiver type T. The method set of the corresponding pointer +type *T is the set of all methods with receiver *T or +T (that is, it also contains the method set of T). +
+ +

+If an interface value contains a pointer *T, +a method call can obtain a value by dereferencing the pointer, +but if an interface value contains a value T, +there is no useful way for a method call to obtain a pointer. +

+ +

+Even in cases where the compiler could take the address of a value +to pass to the method, if the method modifies the value the changes +will be lost in the caller. +As an example, if the Write method of +bytes.Buffer +used a value receiver rather than a pointer, +this code: +

+ +
+var buf bytes.Buffer
+io.Copy(buf, os.Stdin)
+
+ +

+would copy standard input into a copy of buf, +not into buf itself. +This is almost never the desired behavior. +

+ +

+What happens with closures running as goroutines?

+ +

+Some confusion may arise when using closures with concurrency. +Consider the following program: +

+ +
+func main() {
+    done := make(chan bool)
+
+    values := []string{"a", "b", "c"}
+    for _, v := range values {
+        go func() {
+            fmt.Println(v)
+            done <- true
+        }()
+    }
+
+    // wait for all goroutines to complete before exiting
+    for _ = range values {
+        <-done
+    }
+}
+
+ +

+One might mistakenly expect to see a, b, c as the output. +What you'll probably see instead is c, c, c. This is because +each iteration of the loop uses the same instance of the variable v, so +each closure shares that single variable. When the closure runs, it prints the +value of v at the time fmt.Println is executed, +but v may have been modified since the goroutine was launched. +To help detect this and other problems before they happen, run +go vet. +

+ +

+To bind the current value of v to each closure as it is launched, one +must modify the inner loop to create a new variable each iteration. +One way is to pass the variable as an argument to the closure: +

+ +
+    for _, v := range values {
+        go func(u string) {
+            fmt.Println(u)
+            done <- true
+        }(v)
+    }
+
+ +

+In this example, the value of v is passed as an argument to the +anonymous function. That value is then accessible inside the function as +the variable u. +

+ +

+Even easier is just to create a new variable, using a declaration style that may +seem odd but works fine in Go: +

+ +
+    for _, v := range values {
+        v := v // create a new 'v'.
+        go func() {
+            fmt.Println(v)
+            done <- true
+        }()
+    }
+
+ +

Control flow

+ +

+Does Go have the ?: operator?

+ +

+There is no ternary testing operation in Go. You may use the following to achieve the same +result: +

+ +
+if expr {
+    n = trueVal
+} else {
+    n = falseVal
+}
+
+ +

Packages and Testing

+ +

+How do I create a multifile package?

+ +

+Put all the source files for the package in a directory by themselves. +Source files can refer to items from different files at will; there is +no need for forward declarations or a header file. +

+ +

+Other than being split into multiple files, the package will compile and test +just like a single-file package. +

+ +

+How do I write a unit test?

+ +

+Create a new file ending in _test.go in the same directory +as your package sources. Inside that file, import "testing" +and write functions of the form +

+ +
+func TestFoo(t *testing.T) {
+    ...
+}
+
+ +

+Run go test in that directory. +That script finds the Test functions, +builds a test binary, and runs it. +

+ +

See the How to Write Go Code document, +the testing package +and the go test subcommand for more details. +

+ +

+Where is my favorite helper function for testing?

+ +

+Go's standard testing package makes it easy to write unit tests, but it lacks +features provided in other language's testing frameworks such as assertion functions. +An earlier section of this document explained why Go +doesn't have assertions, and +the same arguments apply to the use of assert in tests. +Proper error handling means letting other tests run after one has failed, so +that the person debugging the failure gets a complete picture of what is +wrong. It is more useful for a test to report that +isPrime gives the wrong answer for 2, 3, 5, and 7 (or for +2, 4, 8, and 16) than to report that isPrime gives the wrong +answer for 2 and therefore no more tests were run. The programmer who +triggers the test failure may not be familiar with the code that fails. +Time invested writing a good error message now pays off later when the +test breaks. +

+ +

+A related point is that testing frameworks tend to develop into mini-languages +of their own, with conditionals and controls and printing mechanisms, +but Go already has all those capabilities; why recreate them? +We'd rather write tests in Go; it's one fewer language to learn and the +approach keeps the tests straightforward and easy to understand. +

+ +

+If the amount of extra code required to write +good errors seems repetitive and overwhelming, the test might work better if +table-driven, iterating over a list of inputs and outputs defined +in a data structure (Go has excellent support for data structure literals). +The work to write a good test and good error messages will then be amortized over many +test cases. The standard Go library is full of illustrative examples, such as in +the formatting tests for the fmt package. +

+ +

+Why isn't X in the standard library?

+ +

+The standard library's purpose is to support the runtime, connect to +the operating system, and provide key functionality that many Go +programs require, such as formatted I/O and networking. +It also contains elements important for web programming, including +cryptography and support for standards like HTTP, JSON, and XML. +

+ +

+There is no clear criterion that defines what is included because for +a long time, this was the only Go library. +There are criteria that define what gets added today, however. +

+ +

+New additions to the standard library are rare and the bar for +inclusion is high. +Code included in the standard library bears a large ongoing maintenance cost +(often borne by those other than the original author), +is subject to the Go 1 compatibility promise +(blocking fixes to any flaws in the API), +and is subject to the Go +release schedule, +preventing bug fixes from being available to users quickly. +

+ +

+Most new code should live outside of the standard library and be accessible +via the go tool's +go get command. +Such code can have its own maintainers, release cycle, +and compatibility guarantees. +Users can find packages and read their documentation at +godoc.org. +

+ +

+Although there are pieces in the standard library that don't really belong, +such as log/syslog, we continue to maintain everything in the +library because of the Go 1 compatibility promise. +But we encourage most new code to live elsewhere. +

+ +

Implementation

+ +

+What compiler technology is used to build the compilers?

+ +

+Gccgo has a front end written in C++, with a recursive descent parser coupled to the +standard GCC back end. Gc is written in Go using +yacc/bison for the parser +and uses a custom loader, also written in Go but +based on the Plan 9 loader, to generate ELF/Mach-O/PE binaries. +

+ +

+We considered using LLVM for gc but we felt it was too large and +slow to meet our performance goals. +

+ +

+The original gc, the Go compiler, was written in C +because of the difficulties of bootstrapping—you'd need a Go compiler to +set up a Go environment. +But things have advanced and as of Go 1.5 the compiler is written in Go. +It was converted from C to Go using automatic translation tools, as +described in this design document +and a recent talk. +Thus the compiler is now "self-hosting", which means we must face +the bootstrapping problem. +The solution, naturally, is to have a working Go installation already, +just as one normally has a working C installation in place. +The story of how to bring up a new Go installation from source +is described separately. +

+ +

+Go is a fine language in which to implement a Go compiler. +Although gc does not use them (yet?), a native lexer and +parser are available in the go package +and there is also a type checker. +

+ +

+How is the run-time support implemented?

+ +

+Again due to bootstrapping issues, the run-time code was originally written mostly in C (with a +tiny bit of assembler) but it has since been translated to Go +(except for some assembler bits). +Gccgo's run-time support uses glibc. +The gccgo compiler implements goroutines using +a technique called segmented stacks, +supported by recent modifications to the gold linker. +

+ +

+Why is my trivial program such a large binary?

+ +

+The linker in the gc tool chain +creates statically-linked binaries by default. All Go binaries therefore include the Go +run-time, along with the run-time type information necessary to support dynamic +type checks, reflection, and even panic-time stack traces. +

+ +

+A simple C "hello, world" program compiled and linked statically using gcc +on Linux is around 750 kB, +including an implementation of printf. +An equivalent Go program using fmt.Printf +is around 2.3 MB, but +that includes more powerful run-time support and type information. +

+ +

+Can I stop these complaints about my unused variable/import?

+ +

+The presence of an unused variable may indicate a bug, while +unused imports just slow down compilation, +an effect that can become substantial as a program accumulates +code and programmers over time. +For these reasons, Go refuses to compile programs with unused +variables or imports, +trading short-term convenience for long-term build speed and +program clarity. +

+ +

+Still, when developing code, it's common to create these situations +temporarily and it can be annoying to have to edit them out before the +program will compile. +

+ +

+Some have asked for a compiler option to turn those checks off +or at least reduce them to warnings. +Such an option has not been added, though, +because compiler options should not affect the semantics of the +language and because the Go compiler does not report warnings, only +errors that prevent compilation. +

+ +

+There are two reasons for having no warnings. First, if it's worth +complaining about, it's worth fixing in the code. (And if it's not +worth fixing, it's not worth mentioning.) Second, having the compiler +generate warnings encourages the implementation to warn about weak +cases that can make compilation noisy, masking real errors that +should be fixed. +

+ +

+It's easy to address the situation, though. Use the blank identifier +to let unused things persist while you're developing. +

+ +
+import "unused"
+
+// This declaration marks the import as used by referencing an
+// item from the package.
+var _ = unused.Item  // TODO: Delete before committing!
+
+func main() {
+    debugData := debug.Profile()
+    _ = debugData // Used only during debugging.
+    ....
+}
+
+ +

+Nowadays, most Go programmers use a tool, +goimports, +which automatically rewrites a Go source file to have the correct imports, +eliminating the unused imports issue in practice. +This program is easily connected to most editors to run automatically when a Go source file is written. +

+ +

Performance

+ +

+Why does Go perform badly on benchmark X?

+ +

+One of Go's design goals is to approach the performance of C for comparable +programs, yet on some benchmarks it does quite poorly, including several +in test/bench/shootout. The slowest depend on libraries +for which versions of comparable performance are not available in Go. +For instance, pidigits.go +depends on a multi-precision math package, and the C +versions, unlike Go's, use GMP (which is +written in optimized assembler). +Benchmarks that depend on regular expressions +(regex-dna.go, for instance) are +essentially comparing Go's native regexp package to +mature, highly optimized regular expression libraries like PCRE. +

+ +

+Benchmark games are won by extensive tuning and the Go versions of most +of the benchmarks need attention. If you measure comparable C +and Go programs +(reverse-complement.go is one example), you'll see the two +languages are much closer in raw performance than this suite would +indicate. +

+ +

+Still, there is room for improvement. The compilers are good but could be +better, many libraries need major performance work, and the garbage collector +isn't fast enough yet. (Even if it were, taking care not to generate unnecessary +garbage can have a huge effect.) +

+ +

+In any case, Go can often be very competitive. +There has been significant improvement in the performance of many programs +as the language and tools have developed. +See the blog post about +profiling +Go programs for an informative example. + +

Changes from C

+ +

+Why is the syntax so different from C?

+

+Other than declaration syntax, the differences are not major and stem +from two desires. First, the syntax should feel light, without too +many mandatory keywords, repetition, or arcana. Second, the language +has been designed to be easy to analyze +and can be parsed without a symbol table. This makes it much easier +to build tools such as debuggers, dependency analyzers, automated +documentation extractors, IDE plug-ins, and so on. C and its +descendants are notoriously difficult in this regard. +

+ +

+Why are declarations backwards?

+

+They're only backwards if you're used to C. In C, the notion is that a +variable is declared like an expression denoting its type, which is a +nice idea, but the type and expression grammars don't mix very well and +the results can be confusing; consider function pointers. Go mostly +separates expression and type syntax and that simplifies things (using +prefix * for pointers is an exception that proves the rule). In C, +the declaration +

+
+    int* a, b;
+
+

+declares a to be a pointer but not b; in Go +

+
+    var a, b *int
+
+

+declares both to be pointers. This is clearer and more regular. +Also, the := short declaration form argues that a full variable +declaration should present the same order as := so +

+
+    var a uint64 = 1
+
+

+has the same effect as +

+
+    a := uint64(1)
+
+

+Parsing is also simplified by having a distinct grammar for types that +is not just the expression grammar; keywords such as func +and chan keep things clear. +

+ +

+See the article about +Go's Declaration Syntax +for more details. +

+ +

+Why is there no pointer arithmetic?

+

+Safety. Without pointer arithmetic it's possible to create a +language that can never derive an illegal address that succeeds +incorrectly. Compiler and hardware technology have advanced to the +point where a loop using array indices can be as efficient as a loop +using pointer arithmetic. Also, the lack of pointer arithmetic can +simplify the implementation of the garbage collector. +

+ +

+Why are ++ and -- statements and not expressions? And why postfix, not prefix?

+

+Without pointer arithmetic, the convenience value of pre- and postfix +increment operators drops. By removing them from the expression +hierarchy altogether, expression syntax is simplified and the messy +issues around order of evaluation of ++ and -- +(consider f(i++) and p[i] = q[++i]) +are eliminated as well. The simplification is +significant. As for postfix vs. prefix, either would work fine but +the postfix version is more traditional; insistence on prefix arose +with the STL, a library for a language whose name contains, ironically, a +postfix increment. +

+ +

+Why are there braces but no semicolons? And why can't I put the opening +brace on the next line?

+

+Go uses brace brackets for statement grouping, a syntax familiar to +programmers who have worked with any language in the C family. +Semicolons, however, are for parsers, not for people, and we wanted to +eliminate them as much as possible. To achieve this goal, Go borrows +a trick from BCPL: the semicolons that separate statements are in the +formal grammar but are injected automatically, without lookahead, by +the lexer at the end of any line that could be the end of a statement. +This works very well in practice but has the effect that it forces a +brace style. For instance, the opening brace of a function cannot +appear on a line by itself. +

+ +

+Some have argued that the lexer should do lookahead to permit the +brace to live on the next line. We disagree. Since Go code is meant +to be formatted automatically by +gofmt, +some style must be chosen. That style may differ from what +you've used in C or Java, but Go is a new language and +gofmt's style is as good as any other. More +important—much more important—the advantages of a single, +programmatically mandated format for all Go programs greatly outweigh +any perceived disadvantages of the particular style. +Note too that Go's style means that an interactive implementation of +Go can use the standard syntax one line at a time without special rules. +

+ +

+Why do garbage collection? Won't it be too expensive?

+

+One of the biggest sources of bookkeeping in systems programs is +memory management. We feel it's critical to eliminate that +programmer overhead, and advances in garbage collection +technology in the last few years give us confidence that we can +implement it with low enough overhead and no significant +latency. +

+ +

+Another point is that a large part of the difficulty of concurrent +and multi-threaded programming is memory management; +as objects get passed among threads it becomes cumbersome +to guarantee they become freed safely. +Automatic garbage collection makes concurrent code far easier to write. +Of course, implementing garbage collection in a concurrent environment is +itself a challenge, but meeting it once rather than in every +program helps everyone. +

+ +

+Finally, concurrency aside, garbage collection makes interfaces +simpler because they don't need to specify how memory is managed across them. +

+ +

+The current implementation is a parallel mark-and-sweep collector. +Recent improvements, documented in +this design document, +have introduced bounded pause times and improved the +parallelism. +Future versions might attempt new approaches. +

+ +

+On the topic of performance, keep in mind that Go gives the programmer +considerable control over memory layout and allocation, much more than +is typical in garbage-collected languages. A careful programmer can reduce +the garbage collection overhead dramatically by using the language well; +see the article about +profiling +Go programs for a worked example, including a demonstration of Go's +profiling tools. +

diff --git a/doc/go_mem.html b/doc/go_mem.html new file mode 100644 index 0000000000000000000000000000000000000000..143f3b2ff22e9d52047b05954f8e37aa1ff19b50 --- /dev/null +++ b/doc/go_mem.html @@ -0,0 +1,566 @@ + + + + +

Introduction

+ +

+The Go memory model specifies the conditions under which +reads of a variable in one goroutine can be guaranteed to +observe values produced by writes to the same variable in a different goroutine. +

+ + +

Advice

+ +

+Programs that modify data being simultaneously accessed by multiple goroutines +must serialize such access. +

+ +

+To serialize access, protect the data with channel operations or other synchronization primitives +such as those in the sync +and sync/atomic packages. +

+ +

+If you must read the rest of this document to understand the behavior of your program, +you are being too clever. +

+ +

+Don't be clever. +

+ +

Happens Before

+ +

+Within a single goroutine, reads and writes must behave +as if they executed in the order specified by the program. +That is, compilers and processors may reorder the reads and writes +executed within a single goroutine only when the reordering +does not change the behavior within that goroutine +as defined by the language specification. +Because of this reordering, the execution order observed +by one goroutine may differ from the order perceived +by another. For example, if one goroutine +executes a = 1; b = 2;, another might observe +the updated value of b before the updated value of a. +

+ +

+To specify the requirements of reads and writes, we define +happens before, a partial order on the execution +of memory operations in a Go program. If event e1 happens +before event e2, then we say that e2 happens after e1. +Also, if e1 does not happen before e2 and does not happen +after e2, then we say that e1 and e2 happen concurrently. +

+ +

+Within a single goroutine, the happens-before order is the +order expressed by the program. +

+ +

+A read r of a variable v is allowed to observe a write w to v +if both of the following hold: +

+ +
    +
  1. r does not happen before w.
  2. +
  3. There is no other write w' to v that happens + after w but before r.
  4. +
+ +

+To guarantee that a read r of a variable v observes a +particular write w to v, ensure that w is the only +write r is allowed to observe. +That is, r is guaranteed to observe w if both of the following hold: +

+ +
    +
  1. w happens before r.
  2. +
  3. Any other write to the shared variable v +either happens before w or after r.
  4. +
+ +

+This pair of conditions is stronger than the first pair; +it requires that there are no other writes happening +concurrently with w or r. +

+ +

+Within a single goroutine, +there is no concurrency, so the two definitions are equivalent: +a read r observes the value written by the most recent write w to v. +When multiple goroutines access a shared variable v, +they must use synchronization events to establish +happens-before conditions that ensure reads observe the +desired writes. +

+ +

+The initialization of variable v with the zero value +for v's type behaves as a write in the memory model. +

+ +

+Reads and writes of values larger than a single machine word +behave as multiple machine-word-sized operations in an +unspecified order. +

+ +

Synchronization

+ +

Initialization

+ +

+Program initialization runs in a single goroutine, +but that goroutine may create other goroutines, +which run concurrently. +

+ +

+If a package p imports package q, the completion of +q's init functions happens before the start of any of p's. +

+ +

+The start of the function main.main happens after +all init functions have finished. +

+ +

Goroutine creation

+ +

+The go statement that starts a new goroutine +happens before the goroutine's execution begins. +

+ +

+For example, in this program: +

+ +
+var a string
+
+func f() {
+	print(a)
+}
+
+func hello() {
+	a = "hello, world"
+	go f()
+}
+
+ +

+calling hello will print "hello, world" +at some point in the future (perhaps after hello has returned). +

+ +

Goroutine destruction

+ +

+The exit of a goroutine is not guaranteed to happen before +any event in the program. For example, in this program: +

+ +
+var a string
+
+func hello() {
+	go func() { a = "hello" }()
+	print(a)
+}
+
+ +

+the assignment to a is not followed by +any synchronization event, so it is not guaranteed to be +observed by any other goroutine. +In fact, an aggressive compiler might delete the entire go statement. +

+ +

+If the effects of a goroutine must be observed by another goroutine, +use a synchronization mechanism such as a lock or channel +communication to establish a relative ordering. +

+ +

Channel communication

+ +

+Channel communication is the main method of synchronization +between goroutines. Each send on a particular channel +is matched to a corresponding receive from that channel, +usually in a different goroutine. +

+ +

+A send on a channel happens before the corresponding +receive from that channel completes. +

+ +

+This program: +

+ +
+var c = make(chan int, 10)
+var a string
+
+func f() {
+	a = "hello, world"
+	c <- 0
+}
+
+func main() {
+	go f()
+	<-c
+	print(a)
+}
+
+ +

+is guaranteed to print "hello, world". The write to a +happens before the send on c, which happens before +the corresponding receive on c completes, which happens before +the print. +

+ +

+The closing of a channel happens before a receive that returns a zero value +because the channel is closed. +

+ +

+In the previous example, replacing +c <- 0 with close(c) +yields a program with the same guaranteed behavior. +

+ +

+A receive from an unbuffered channel happens before +the send on that channel completes. +

+ +

+This program (as above, but with the send and receive statements swapped and +using an unbuffered channel): +

+ +
+var c = make(chan int)
+var a string
+
+func f() {
+	a = "hello, world"
+	<-c
+}
+
+ +
+func main() {
+	go f()
+	c <- 0
+	print(a)
+}
+
+ +

+is also guaranteed to print "hello, world". The write to a +happens before the receive on c, which happens before +the corresponding send on c completes, which happens +before the print. +

+ +

+If the channel were buffered (e.g., c = make(chan int, 1)) +then the program would not be guaranteed to print +"hello, world". (It might print the empty string, +crash, or do something else.) +

+ +

+The kth receive on a channel with capacity C happens before the k+Cth send from that channel completes. +

+ +

+This rule generalizes the previous rule to buffered channels. +It allows a counting semaphore to be modeled by a buffered channel: +the number of items in the channel corresponds to the number of active uses, +the capacity of the channel corresponds to the maximum number of simultaneous uses, +sending an item acquires the semaphore, and receiving an item releases +the semaphore. +This is a common idiom for limiting concurrency. +

+ +

+This program starts a goroutine for every entry in the work list, but the +goroutines coordinate using the limit channel to ensure +that at most three are running work functions at a time. +

+ +
+var limit = make(chan int, 3)
+
+func main() {
+	for _, w := range work {
+		go func(w func()) {
+			limit <- 1
+			w()
+			<-limit
+		}(w)
+	}
+	select{}
+}
+
+ +

Locks

+ +

+The sync package implements two lock data types, +sync.Mutex and sync.RWMutex. +

+ +

+For any sync.Mutex or sync.RWMutex variable l and n < m, +call n of l.Unlock() happens before call m of l.Lock() returns. +

+ +

+This program: +

+ +
+var l sync.Mutex
+var a string
+
+func f() {
+	a = "hello, world"
+	l.Unlock()
+}
+
+func main() {
+	l.Lock()
+	go f()
+	l.Lock()
+	print(a)
+}
+
+ +

+is guaranteed to print "hello, world". +The first call to l.Unlock() (in f) happens +before the second call to l.Lock() (in main) returns, +which happens before the print. +

+ +

+For any call to l.RLock on a sync.RWMutex variable l, +there is an n such that the l.RLock happens (returns) after call n to +l.Unlock and the matching l.RUnlock happens +before call n+1 to l.Lock. +

+ +

Once

+ +

+The sync package provides a safe mechanism for +initialization in the presence of multiple goroutines +through the use of the Once type. +Multiple threads can execute once.Do(f) for a particular f, +but only one will run f(), and the other calls block +until f() has returned. +

+ +

+A single call of f() from once.Do(f) happens (returns) before any call of once.Do(f) returns. +

+ +

+In this program: +

+ +
+var a string
+var once sync.Once
+
+func setup() {
+	a = "hello, world"
+}
+
+func doprint() {
+	once.Do(setup)
+	print(a)
+}
+
+func twoprint() {
+	go doprint()
+	go doprint()
+}
+
+ +

+calling twoprint causes "hello, world" to be printed twice. +The first call to doprint runs setup once. +

+ +

Incorrect synchronization

+ +

+Note that a read r may observe the value written by a write w +that happens concurrently with r. +Even if this occurs, it does not imply that reads happening after r +will observe writes that happened before w. +

+ +

+In this program: +

+ +
+var a, b int
+
+func f() {
+	a = 1
+	b = 2
+}
+
+func g() {
+	print(b)
+	print(a)
+}
+
+func main() {
+	go f()
+	g()
+}
+
+ +

+it can happen that g prints 2 and then 0. +

+ +

+This fact invalidates a few common idioms. +

+ +

+Double-checked locking is an attempt to avoid the overhead of synchronization. +For example, the twoprint program might be +incorrectly written as: +

+ +
+var a string
+var done bool
+
+func setup() {
+	a = "hello, world"
+	done = true
+}
+
+func doprint() {
+	if !done {
+		once.Do(setup)
+	}
+	print(a)
+}
+
+func twoprint() {
+	go doprint()
+	go doprint()
+}
+
+ +

+but there is no guarantee that, in doprint, observing the write to done +implies observing the write to a. This +version can (incorrectly) print an empty string +instead of "hello, world". +

+ +

+Another incorrect idiom is busy waiting for a value, as in: +

+ +
+var a string
+var done bool
+
+func setup() {
+	a = "hello, world"
+	done = true
+}
+
+func main() {
+	go setup()
+	for !done {
+	}
+	print(a)
+}
+
+ +

+As before, there is no guarantee that, in main, +observing the write to done +implies observing the write to a, so this program could +print an empty string too. +Worse, there is no guarantee that the write to done will ever +be observed by main, since there are no synchronization +events between the two threads. The loop in main is not +guaranteed to finish. +

+ +

+There are subtler variants on this theme, such as this program. +

+ +
+type T struct {
+	msg string
+}
+
+var g *T
+
+func setup() {
+	t := new(T)
+	t.msg = "hello, world"
+	g = t
+}
+
+func main() {
+	go setup()
+	for g == nil {
+	}
+	print(g.msg)
+}
+
+ +

+Even if main observes g != nil and exits its loop, +there is no guarantee that it will observe the initialized +value for g.msg. +

+ +

+In all these examples, the solution is the same: +use explicit synchronization. +

diff --git a/doc/go_spec.html b/doc/go_spec.html new file mode 100644 index 0000000000000000000000000000000000000000..22f9701a750a70c6307f367bb94deaf84b974fac --- /dev/null +++ b/doc/go_spec.html @@ -0,0 +1,6374 @@ + + +

Introduction

+ +

+This is a reference manual for the Go programming language. For +more information and other documents, see golang.org. +

+ +

+Go is a general-purpose language designed with systems programming +in mind. It is strongly typed and garbage-collected and has explicit +support for concurrent programming. Programs are constructed from +packages, whose properties allow efficient management of +dependencies. The existing implementations use a traditional +compile/link model to generate executable binaries. +

+ +

+The grammar is compact and regular, allowing for easy analysis by +automatic tools such as integrated development environments. +

+ +

Notation

+

+The syntax is specified using Extended Backus-Naur Form (EBNF): +

+ +
+Production  = production_name "=" [ Expression ] "." .
+Expression  = Alternative { "|" Alternative } .
+Alternative = Term { Term } .
+Term        = production_name | token [ "…" token ] | Group | Option | Repetition .
+Group       = "(" Expression ")" .
+Option      = "[" Expression "]" .
+Repetition  = "{" Expression "}" .
+
+ +

+Productions are expressions constructed from terms and the following +operators, in increasing precedence: +

+
+|   alternation
+()  grouping
+[]  option (0 or 1 times)
+{}  repetition (0 to n times)
+
+ +

+Lower-case production names are used to identify lexical tokens. +Non-terminals are in CamelCase. Lexical tokens are enclosed in +double quotes "" or back quotes ``. +

+ +

+The form a … b represents the set of characters from +a through b as alternatives. The horizontal +ellipsis is also used elsewhere in the spec to informally denote various +enumerations or code snippets that are not further specified. The character +(as opposed to the three characters ...) is not a token of the Go +language. +

+ +

Source code representation

+ +

+Source code is Unicode text encoded in +UTF-8. The text is not +canonicalized, so a single accented code point is distinct from the +same character constructed from combining an accent and a letter; +those are treated as two code points. For simplicity, this document +will use the unqualified term character to refer to a Unicode code point +in the source text. +

+

+Each code point is distinct; for instance, upper and lower case letters +are different characters. +

+

+Implementation restriction: For compatibility with other tools, a +compiler may disallow the NUL character (U+0000) in the source text. +

+

+Implementation restriction: For compatibility with other tools, a +compiler may ignore a UTF-8-encoded byte order mark +(U+FEFF) if it is the first Unicode code point in the source text. +A byte order mark may be disallowed anywhere else in the source. +

+ +

Characters

+ +

+The following terms are used to denote specific Unicode character classes: +

+
+newline        = /* the Unicode code point U+000A */ .
+unicode_char   = /* an arbitrary Unicode code point except newline */ .
+unicode_letter = /* a Unicode code point classified as "Letter" */ .
+unicode_digit  = /* a Unicode code point classified as "Decimal Digit" */ .
+
+ +

+In The Unicode Standard 6.3, +Section 4.5 "General Category" +defines a set of character categories. Go treats +those characters in category Lu, Ll, Lt, Lm, or Lo as Unicode letters, +and those in category Nd as Unicode digits. +

+ +

Letters and digits

+ +

+The underscore character _ (U+005F) is considered a letter. +

+
+letter        = unicode_letter | "_" .
+decimal_digit = "0" … "9" .
+octal_digit   = "0" … "7" .
+hex_digit     = "0" … "9" | "A" … "F" | "a" … "f" .
+
+ +

Lexical elements

+ +

Comments

+ +

+Comments serve as program documentation. There are two forms: +

+ +
    +
  1. +Line comments start with the character sequence // +and stop at the end of the line. +
  2. +
  3. +General comments start with the character sequence /* +and stop with the first subsequent character sequence */. +
  4. +
+ +

+A comment cannot start inside a rune or +string literal, or inside a comment. +A general comment containing no newlines acts like a space. +Any other comment acts like a newline. +

+ +

Tokens

+ +

+Tokens form the vocabulary of the Go language. +There are four classes: identifiers, keywords, operators +and delimiters, and literals. White space, formed from +spaces (U+0020), horizontal tabs (U+0009), +carriage returns (U+000D), and newlines (U+000A), +is ignored except as it separates tokens +that would otherwise combine into a single token. Also, a newline or end of file +may trigger the insertion of a semicolon. +While breaking the input into tokens, +the next token is the longest sequence of characters that form a +valid token. +

+ +

Semicolons

+ +

+The formal grammar uses semicolons ";" as terminators in +a number of productions. Go programs may omit most of these semicolons +using the following two rules: +

+ +
    +
  1. +When the input is broken into tokens, a semicolon is automatically inserted +into the token stream immediately after a line's final token if that token is + +
  2. + +
  3. +To allow complex statements to occupy a single line, a semicolon +may be omitted before a closing ")" or "}". +
  4. +
+ +

+To reflect idiomatic use, code examples in this document elide semicolons +using these rules. +

+ + +

Identifiers

+ +

+Identifiers name program entities such as variables and types. +An identifier is a sequence of one or more letters and digits. +The first character in an identifier must be a letter. +

+
+identifier = letter { letter | unicode_digit } .
+
+
+a
+_x9
+ThisVariableIsExported
+αβ
+
+ +

+Some identifiers are predeclared. +

+ + +

Keywords

+ +

+The following keywords are reserved and may not be used as identifiers. +

+
+break        default      func         interface    select
+case         defer        go           map          struct
+chan         else         goto         package      switch
+const        fallthrough  if           range        type
+continue     for          import       return       var
+
+ +

Operators and Delimiters

+ +

+The following character sequences represent operators, delimiters, and other special tokens: +

+
++    &     +=    &=     &&    ==    !=    (    )
+-    |     -=    |=     ||    <     <=    [    ]
+*    ^     *=    ^=     <-    >     >=    {    }
+/    <<    /=    <<=    ++    =     :=    ,    ;
+%    >>    %=    >>=    --    !     ...   .    :
+     &^          &^=
+
+ +

Integer literals

+ +

+An integer literal is a sequence of digits representing an +integer constant. +An optional prefix sets a non-decimal base: 0 for octal, 0x or +0X for hexadecimal. In hexadecimal literals, letters +a-f and A-F represent values 10 through 15. +

+
+int_lit     = decimal_lit | octal_lit | hex_lit .
+decimal_lit = ( "1" … "9" ) { decimal_digit } .
+octal_lit   = "0" { octal_digit } .
+hex_lit     = "0" ( "x" | "X" ) hex_digit { hex_digit } .
+
+ +
+42
+0600
+0xBadFace
+170141183460469231731687303715884105727
+
+ +

Floating-point literals

+

+A floating-point literal is a decimal representation of a +floating-point constant. +It has an integer part, a decimal point, a fractional part, +and an exponent part. The integer and fractional part comprise +decimal digits; the exponent part is an e or E +followed by an optionally signed decimal exponent. One of the +integer part or the fractional part may be elided; one of the decimal +point or the exponent may be elided. +

+
+float_lit = decimals "." [ decimals ] [ exponent ] |
+            decimals exponent |
+            "." decimals [ exponent ] .
+decimals  = decimal_digit { decimal_digit } .
+exponent  = ( "e" | "E" ) [ "+" | "-" ] decimals .
+
+ +
+0.
+72.40
+072.40  // == 72.40
+2.71828
+1.e+0
+6.67428e-11
+1E6
+.25
+.12345E+5
+
+ +

Imaginary literals

+

+An imaginary literal is a decimal representation of the imaginary part of a +complex constant. +It consists of a +floating-point literal +or decimal integer followed +by the lower-case letter i. +

+
+imaginary_lit = (decimals | float_lit) "i" .
+
+ +
+0i
+011i  // == 11i
+0.i
+2.71828i
+1.e+0i
+6.67428e-11i
+1E6i
+.25i
+.12345E+5i
+
+ + +

Rune literals

+ +

+A rune literal represents a rune constant, +an integer value identifying a Unicode code point. +A rune literal is expressed as one or more characters enclosed in single quotes, +as in 'x' or '\n'. +Within the quotes, any character may appear except newline and unescaped single +quote. A single quoted character represents the Unicode value +of the character itself, +while multi-character sequences beginning with a backslash encode +values in various formats. +

+

+The simplest form represents the single character within the quotes; +since Go source text is Unicode characters encoded in UTF-8, multiple +UTF-8-encoded bytes may represent a single integer value. For +instance, the literal 'a' holds a single byte representing +a literal a, Unicode U+0061, value 0x61, while +'ä' holds two bytes (0xc3 0xa4) representing +a literal a-dieresis, U+00E4, value 0xe4. +

+

+Several backslash escapes allow arbitrary values to be encoded as +ASCII text. There are four ways to represent the integer value +as a numeric constant: \x followed by exactly two hexadecimal +digits; \u followed by exactly four hexadecimal digits; +\U followed by exactly eight hexadecimal digits, and a +plain backslash \ followed by exactly three octal digits. +In each case the value of the literal is the value represented by +the digits in the corresponding base. +

+

+Although these representations all result in an integer, they have +different valid ranges. Octal escapes must represent a value between +0 and 255 inclusive. Hexadecimal escapes satisfy this condition +by construction. The escapes \u and \U +represent Unicode code points so within them some values are illegal, +in particular those above 0x10FFFF and surrogate halves. +

+

+After a backslash, certain single-character escapes represent special values: +

+
+\a   U+0007 alert or bell
+\b   U+0008 backspace
+\f   U+000C form feed
+\n   U+000A line feed or newline
+\r   U+000D carriage return
+\t   U+0009 horizontal tab
+\v   U+000b vertical tab
+\\   U+005c backslash
+\'   U+0027 single quote  (valid escape only within rune literals)
+\"   U+0022 double quote  (valid escape only within string literals)
+
+

+All other sequences starting with a backslash are illegal inside rune literals. +

+
+rune_lit         = "'" ( unicode_value | byte_value ) "'" .
+unicode_value    = unicode_char | little_u_value | big_u_value | escaped_char .
+byte_value       = octal_byte_value | hex_byte_value .
+octal_byte_value = `\` octal_digit octal_digit octal_digit .
+hex_byte_value   = `\` "x" hex_digit hex_digit .
+little_u_value   = `\` "u" hex_digit hex_digit hex_digit hex_digit .
+big_u_value      = `\` "U" hex_digit hex_digit hex_digit hex_digit
+                           hex_digit hex_digit hex_digit hex_digit .
+escaped_char     = `\` ( "a" | "b" | "f" | "n" | "r" | "t" | "v" | `\` | "'" | `"` ) .
+
+ +
+'a'
+'ä'
+'本'
+'\t'
+'\000'
+'\007'
+'\377'
+'\x07'
+'\xff'
+'\u12e4'
+'\U00101234'
+'\''         // rune literal containing single quote character
+'aa'         // illegal: too many characters
+'\xa'        // illegal: too few hexadecimal digits
+'\0'         // illegal: too few octal digits
+'\uDFFF'     // illegal: surrogate half
+'\U00110000' // illegal: invalid Unicode code point
+
+ + +

String literals

+ +

+A string literal represents a string constant +obtained from concatenating a sequence of characters. There are two forms: +raw string literals and interpreted string literals. +

+

+Raw string literals are character sequences between back quotes, as in +`foo`. Within the quotes, any character may appear except +back quote. The value of a raw string literal is the +string composed of the uninterpreted (implicitly UTF-8-encoded) characters +between the quotes; +in particular, backslashes have no special meaning and the string may +contain newlines. +Carriage return characters ('\r') inside raw string literals +are discarded from the raw string value. +

+

+Interpreted string literals are character sequences between double +quotes, as in "bar". +Within the quotes, any character may appear except newline and unescaped double quote. +The text between the quotes forms the +value of the literal, with backslash escapes interpreted as they +are in rune literals (except that \' is illegal and +\" is legal), with the same restrictions. +The three-digit octal (\nnn) +and two-digit hexadecimal (\xnn) escapes represent individual +bytes of the resulting string; all other escapes represent +the (possibly multi-byte) UTF-8 encoding of individual characters. +Thus inside a string literal \377 and \xFF represent +a single byte of value 0xFF=255, while ÿ, +\u00FF, \U000000FF and \xc3\xbf represent +the two bytes 0xc3 0xbf of the UTF-8 encoding of character +U+00FF. +

+ +
+string_lit             = raw_string_lit | interpreted_string_lit .
+raw_string_lit         = "`" { unicode_char | newline } "`" .
+interpreted_string_lit = `"` { unicode_value | byte_value } `"` .
+
+ +
+`abc`                // same as "abc"
+`\n
+\n`                  // same as "\\n\n\\n"
+"\n"
+"\""                 // same as `"`
+"Hello, world!\n"
+"日本語"
+"\u65e5本\U00008a9e"
+"\xff\u00FF"
+"\uD800"             // illegal: surrogate half
+"\U00110000"         // illegal: invalid Unicode code point
+
+ +

+These examples all represent the same string: +

+ +
+"日本語"                                 // UTF-8 input text
+`日本語`                                 // UTF-8 input text as a raw literal
+"\u65e5\u672c\u8a9e"                    // the explicit Unicode code points
+"\U000065e5\U0000672c\U00008a9e"        // the explicit Unicode code points
+"\xe6\x97\xa5\xe6\x9c\xac\xe8\xaa\x9e"  // the explicit UTF-8 bytes
+
+ +

+If the source code represents a character as two code points, such as +a combining form involving an accent and a letter, the result will be +an error if placed in a rune literal (it is not a single code +point), and will appear as two code points if placed in a string +literal. +

+ + +

Constants

+ +

There are boolean constants, +rune constants, +integer constants, +floating-point constants, complex constants, +and string constants. Rune, integer, floating-point, +and complex constants are +collectively called numeric constants. +

+ +

+A constant value is represented by a +rune, +integer, +floating-point, +imaginary, +or +string literal, +an identifier denoting a constant, +a constant expression, +a conversion with a result that is a constant, or +the result value of some built-in functions such as +unsafe.Sizeof applied to any value, +cap or len applied to +some expressions, +real and imag applied to a complex constant +and complex applied to numeric constants. +The boolean truth values are represented by the predeclared constants +true and false. The predeclared identifier +iota denotes an integer constant. +

+ +

+In general, complex constants are a form of +constant expression +and are discussed in that section. +

+ +

+Numeric constants represent values of arbitrary precision and do not overflow. +

+ +

+Constants may be typed or untyped. +Literal constants, true, false, iota, +and certain constant expressions +containing only untyped constant operands are untyped. +

+ +

+A constant may be given a type explicitly by a constant declaration +or conversion, or implicitly when used in a +variable declaration or an +assignment or as an +operand in an expression. +It is an error if the constant value +cannot be represented as a value of the respective type. +For instance, 3.0 can be given any integer or any +floating-point type, while 2147483648.0 (equal to 1<<31) +can be given the types float32, float64, or uint32 but +not int32 or string. +

+ +

+An untyped constant has a default type which is the type to which the +constant is implicitly converted in contexts where a typed value is required, +for instance, in a short variable declaration +such as i := 0 where there is no explicit type. +The default type of an untyped constant is bool, rune, +int, float64, complex128 or string +respectively, depending on whether it is a boolean, rune, integer, floating-point, +complex, or string constant. +

+ +

+There are no constants denoting the IEEE-754 infinity and not-a-number values, +but the math package's +Inf, +NaN, +IsInf, and +IsNaN +functions return and test for those values at run time. +

+ +

+Implementation restriction: Although numeric constants have arbitrary +precision in the language, a compiler may implement them using an +internal representation with limited precision. That said, every +implementation must: +

+
    +
  • Represent integer constants with at least 256 bits.
  • + +
  • Represent floating-point constants, including the parts of + a complex constant, with a mantissa of at least 256 bits + and a signed exponent of at least 32 bits.
  • + +
  • Give an error if unable to represent an integer constant + precisely.
  • + +
  • Give an error if unable to represent a floating-point or + complex constant due to overflow.
  • + +
  • Round to the nearest representable constant if unable to + represent a floating-point or complex constant due to limits + on precision.
  • +
+

+These requirements apply both to literal constants and to the result +of evaluating constant +expressions. +

+ +

Variables

+ +

+A variable is a storage location for holding a value. +The set of permissible values is determined by the +variable's type. +

+ +

+A variable declaration +or, for function parameters and results, the signature +of a function declaration +or function literal reserves +storage for a named variable. + +Calling the built-in function new +or taking the address of a composite literal +allocates storage for a variable at run time. +Such an anonymous variable is referred to via a (possibly implicit) +pointer indirection. +

+ +

+Structured variables of array, slice, +and struct types have elements and fields that may +be addressed individually. Each such element +acts like a variable. +

+ +

+The static type (or just type) of a variable is the +type given in its declaration, the type provided in the +new call or composite literal, or the type of +an element of a structured variable. +Variables of interface type also have a distinct dynamic type, +which is the concrete type of the value assigned to the variable at run time +(unless the value is the predeclared identifier nil, +which has no type). +The dynamic type may vary during execution but values stored in interface +variables are always assignable +to the static type of the variable. +

+ +
+var x interface{}  // x is nil and has static type interface{}
+var v *T           // v has value nil, static type *T
+x = 42             // x has value 42 and dynamic type int
+x = v              // x has value (*T)(nil) and dynamic type *T
+
+ +

+A variable's value is retrieved by referring to the variable in an +expression; it is the most recent value +assigned to the variable. +If a variable has not yet been assigned a value, its value is the +zero value for its type. +

+ + +

Types

+ +

+A type determines the set of values and operations specific to values of that +type. Types may be named or unnamed. Named types are specified +by a (possibly qualified) +type name; unnamed types are specified +using a type literal, which composes a new type from existing types. +

+ +
+Type      = TypeName | TypeLit | "(" Type ")" .
+TypeName  = identifier | QualifiedIdent .
+TypeLit   = ArrayType | StructType | PointerType | FunctionType | InterfaceType |
+	    SliceType | MapType | ChannelType .
+
+ +

+Named instances of the boolean, numeric, and string types are +predeclared. +Composite types—array, struct, pointer, function, +interface, slice, map, and channel types—may be constructed using +type literals. +

+ +

+Each type T has an underlying type: If T +is one of the predeclared boolean, numeric, or string types, or a type literal, +the corresponding underlying +type is T itself. Otherwise, T's underlying type +is the underlying type of the type to which T refers in its +type declaration. +

+ +
+   type T1 string
+   type T2 T1
+   type T3 []T1
+   type T4 T3
+
+ +

+The underlying type of string, T1, and T2 +is string. The underlying type of []T1, T3, +and T4 is []T1. +

+ +

Method sets

+

+A type may have a method set associated with it. +The method set of an interface type is its interface. +The method set of any other type T consists of all +methods declared with receiver type T. +The method set of the corresponding pointer type *T +is the set of all methods declared with receiver *T or T +(that is, it also contains the method set of T). +Further rules apply to structs containing anonymous fields, as described +in the section on struct types. +Any other type has an empty method set. +In a method set, each method must have a +unique +non-blank method name. +

+ +

+The method set of a type determines the interfaces that the +type implements +and the methods that can be called +using a receiver of that type. +

+ +

Boolean types

+ +

+A boolean type represents the set of Boolean truth values +denoted by the predeclared constants true +and false. The predeclared boolean type is bool. +

+ +

Numeric types

+ +

+A numeric type represents sets of integer or floating-point values. +The predeclared architecture-independent numeric types are: +

+ +
+uint8       the set of all unsigned  8-bit integers (0 to 255)
+uint16      the set of all unsigned 16-bit integers (0 to 65535)
+uint32      the set of all unsigned 32-bit integers (0 to 4294967295)
+uint64      the set of all unsigned 64-bit integers (0 to 18446744073709551615)
+
+int8        the set of all signed  8-bit integers (-128 to 127)
+int16       the set of all signed 16-bit integers (-32768 to 32767)
+int32       the set of all signed 32-bit integers (-2147483648 to 2147483647)
+int64       the set of all signed 64-bit integers (-9223372036854775808 to 9223372036854775807)
+
+float32     the set of all IEEE-754 32-bit floating-point numbers
+float64     the set of all IEEE-754 64-bit floating-point numbers
+
+complex64   the set of all complex numbers with float32 real and imaginary parts
+complex128  the set of all complex numbers with float64 real and imaginary parts
+
+byte        alias for uint8
+rune        alias for int32
+
+ +

+The value of an n-bit integer is n bits wide and represented using +two's complement arithmetic. +

+ +

+There is also a set of predeclared numeric types with implementation-specific sizes: +

+ +
+uint     either 32 or 64 bits
+int      same size as uint
+uintptr  an unsigned integer large enough to store the uninterpreted bits of a pointer value
+
+ +

+To avoid portability issues all numeric types are distinct except +byte, which is an alias for uint8, and +rune, which is an alias for int32. +Conversions +are required when different numeric types are mixed in an expression +or assignment. For instance, int32 and int +are not the same type even though they may have the same size on a +particular architecture. + + +

String types

+ +

+A string type represents the set of string values. +A string value is a (possibly empty) sequence of bytes. +Strings are immutable: once created, +it is impossible to change the contents of a string. +The predeclared string type is string. +

+ +

+The length of a string s (its size in bytes) can be discovered using +the built-in function len. +The length is a compile-time constant if the string is a constant. +A string's bytes can be accessed by integer indices +0 through len(s)-1. +It is illegal to take the address of such an element; if +s[i] is the i'th byte of a +string, &s[i] is invalid. +

+ + +

Array types

+ +

+An array is a numbered sequence of elements of a single +type, called the element type. +The number of elements is called the length and is never +negative. +

+ +
+ArrayType   = "[" ArrayLength "]" ElementType .
+ArrayLength = Expression .
+ElementType = Type .
+
+ +

+The length is part of the array's type; it must evaluate to a +non-negative constant representable by a value +of type int. +The length of array a can be discovered +using the built-in function len. +The elements can be addressed by integer indices +0 through len(a)-1. +Array types are always one-dimensional but may be composed to form +multi-dimensional types. +

+ +
+[32]byte
+[2*N] struct { x, y int32 }
+[1000]*float64
+[3][5]int
+[2][2][2]float64  // same as [2]([2]([2]float64))
+
+ +

Slice types

+ +

+A slice is a descriptor for a contiguous segment of an underlying array and +provides access to a numbered sequence of elements from that array. +A slice type denotes the set of all slices of arrays of its element type. +The value of an uninitialized slice is nil. +

+ +
+SliceType = "[" "]" ElementType .
+
+ +

+Like arrays, slices are indexable and have a length. The length of a +slice s can be discovered by the built-in function +len; unlike with arrays it may change during +execution. The elements can be addressed by integer indices +0 through len(s)-1. The slice index of a +given element may be less than the index of the same element in the +underlying array. +

+

+A slice, once initialized, is always associated with an underlying +array that holds its elements. A slice therefore shares storage +with its array and with other slices of the same array; by contrast, +distinct arrays always represent distinct storage. +

+

+The array underlying a slice may extend past the end of the slice. +The capacity is a measure of that extent: it is the sum of +the length of the slice and the length of the array beyond the slice; +a slice of length up to that capacity can be created by +slicing a new one from the original slice. +The capacity of a slice a can be discovered using the +built-in function cap(a). +

+ +

+A new, initialized slice value for a given element type T is +made using the built-in function +make, +which takes a slice type +and parameters specifying the length and optionally the capacity. +A slice created with make always allocates a new, hidden array +to which the returned slice value refers. That is, executing +

+ +
+make([]T, length, capacity)
+
+ +

+produces the same slice as allocating an array and slicing +it, so these two expressions are equivalent: +

+ +
+make([]int, 50, 100)
+new([100]int)[0:50]
+
+ +

+Like arrays, slices are always one-dimensional but may be composed to construct +higher-dimensional objects. +With arrays of arrays, the inner arrays are, by construction, always the same length; +however with slices of slices (or arrays of slices), the inner lengths may vary dynamically. +Moreover, the inner slices must be initialized individually. +

+ +

Struct types

+ +

+A struct is a sequence of named elements, called fields, each of which has a +name and a type. Field names may be specified explicitly (IdentifierList) or +implicitly (AnonymousField). +Within a struct, non-blank field names must +be unique. +

+ +
+StructType     = "struct" "{" { FieldDecl ";" } "}" .
+FieldDecl      = (IdentifierList Type | AnonymousField) [ Tag ] .
+AnonymousField = [ "*" ] TypeName .
+Tag            = string_lit .
+
+ +
+// An empty struct.
+struct {}
+
+// A struct with 6 fields.
+struct {
+	x, y int
+	u float32
+	_ float32  // padding
+	A *[]int
+	F func()
+}
+
+ +

+A field declared with a type but no explicit field name is an anonymous field, +also called an embedded field or an embedding of the type in the struct. +An embedded type must be specified as +a type name T or as a pointer to a non-interface type name *T, +and T itself may not be +a pointer type. The unqualified type name acts as the field name. +

+ +
+// A struct with four anonymous fields of type T1, *T2, P.T3 and *P.T4
+struct {
+	T1        // field name is T1
+	*T2       // field name is T2
+	P.T3      // field name is T3
+	*P.T4     // field name is T4
+	x, y int  // field names are x and y
+}
+
+ +

+The following declaration is illegal because field names must be unique +in a struct type: +

+ +
+struct {
+	T     // conflicts with anonymous field *T and *P.T
+	*T    // conflicts with anonymous field T and *P.T
+	*P.T  // conflicts with anonymous field T and *T
+}
+
+ +

+A field or method f of an +anonymous field in a struct x is called promoted if +x.f is a legal selector that denotes +that field or method f. +

+ +

+Promoted fields act like ordinary fields +of a struct except that they cannot be used as field names in +composite literals of the struct. +

+ +

+Given a struct type S and a type named T, +promoted methods are included in the method set of the struct as follows: +

+
    +
  • + If S contains an anonymous field T, + the method sets of S + and *S both include promoted methods with receiver + T. The method set of *S also + includes promoted methods with receiver *T. +
  • + +
  • + If S contains an anonymous field *T, + the method sets of S and *S both + include promoted methods with receiver T or + *T. +
  • +
+ +

+A field declaration may be followed by an optional string literal tag, +which becomes an attribute for all the fields in the corresponding +field declaration. The tags are made +visible through a reflection interface +and take part in type identity for structs +but are otherwise ignored. +

+ +
+// A struct corresponding to the TimeStamp protocol buffer.
+// The tag strings define the protocol buffer field numbers.
+struct {
+	microsec  uint64 "field 1"
+	serverIP6 uint64 "field 2"
+	process   string "field 3"
+}
+
+ +

Pointer types

+ +

+A pointer type denotes the set of all pointers to variables of a given +type, called the base type of the pointer. +The value of an uninitialized pointer is nil. +

+ +
+PointerType = "*" BaseType .
+BaseType    = Type .
+
+ +
+*Point
+*[4]int
+
+ +

Function types

+ +

+A function type denotes the set of all functions with the same parameter +and result types. The value of an uninitialized variable of function type +is nil. +

+ +
+FunctionType   = "func" Signature .
+Signature      = Parameters [ Result ] .
+Result         = Parameters | Type .
+Parameters     = "(" [ ParameterList [ "," ] ] ")" .
+ParameterList  = ParameterDecl { "," ParameterDecl } .
+ParameterDecl  = [ IdentifierList ] [ "..." ] Type .
+
+ +

+Within a list of parameters or results, the names (IdentifierList) +must either all be present or all be absent. If present, each name +stands for one item (parameter or result) of the specified type and +all non-blank names in the signature +must be unique. +If absent, each type stands for one item of that type. +Parameter and result +lists are always parenthesized except that if there is exactly +one unnamed result it may be written as an unparenthesized type. +

+ +

+The final parameter in a function signature may have +a type prefixed with .... +A function with such a parameter is called variadic and +may be invoked with zero or more arguments for that parameter. +

+ +
+func()
+func(x int) int
+func(a, _ int, z float32) bool
+func(a, b int, z float32) (bool)
+func(prefix string, values ...int)
+func(a, b int, z float64, opt ...interface{}) (success bool)
+func(int, int, float64) (float64, *[]int)
+func(n int) func(p *T)
+
+ + +

Interface types

+ +

+An interface type specifies a method set called its interface. +A variable of interface type can store a value of any type with a method set +that is any superset of the interface. Such a type is said to +implement the interface. +The value of an uninitialized variable of interface type is nil. +

+ +
+InterfaceType      = "interface" "{" { MethodSpec ";" } "}" .
+MethodSpec         = MethodName Signature | InterfaceTypeName .
+MethodName         = identifier .
+InterfaceTypeName  = TypeName .
+
+ +

+As with all method sets, in an interface type, each method must have a +unique +non-blank name. +

+ +
+// A simple File interface
+interface {
+	Read(b Buffer) bool
+	Write(b Buffer) bool
+	Close()
+}
+
+ +

+More than one type may implement an interface. +For instance, if two types S1 and S2 +have the method set +

+ +
+func (p T) Read(b Buffer) bool { return … }
+func (p T) Write(b Buffer) bool { return … }
+func (p T) Close() { … }
+
+ +

+(where T stands for either S1 or S2) +then the File interface is implemented by both S1 and +S2, regardless of what other methods +S1 and S2 may have or share. +

+ +

+A type implements any interface comprising any subset of its methods +and may therefore implement several distinct interfaces. For +instance, all types implement the empty interface: +

+ +
+interface{}
+
+ +

+Similarly, consider this interface specification, +which appears within a type declaration +to define an interface called Locker: +

+ +
+type Locker interface {
+	Lock()
+	Unlock()
+}
+
+ +

+If S1 and S2 also implement +

+ +
+func (p T) Lock() { … }
+func (p T) Unlock() { … }
+
+ +

+they implement the Locker interface as well +as the File interface. +

+ +

+An interface T may use a (possibly qualified) interface type +name E in place of a method specification. This is called +embedding interface E in T; it adds +all (exported and non-exported) methods of E to the interface +T. +

+ +
+type ReadWriter interface {
+	Read(b Buffer) bool
+	Write(b Buffer) bool
+}
+
+type File interface {
+	ReadWriter  // same as adding the methods of ReadWriter
+	Locker      // same as adding the methods of Locker
+	Close()
+}
+
+type LockedFile interface {
+	Locker
+	File        // illegal: Lock, Unlock not unique
+	Lock()      // illegal: Lock not unique
+}
+
+ +

+An interface type T may not embed itself +or any interface type that embeds T, recursively. +

+ +
+// illegal: Bad cannot embed itself
+type Bad interface {
+	Bad
+}
+
+// illegal: Bad1 cannot embed itself using Bad2
+type Bad1 interface {
+	Bad2
+}
+type Bad2 interface {
+	Bad1
+}
+
+ +

Map types

+ +

+A map is an unordered group of elements of one type, called the +element type, indexed by a set of unique keys of another type, +called the key type. +The value of an uninitialized map is nil. +

+ +
+MapType     = "map" "[" KeyType "]" ElementType .
+KeyType     = Type .
+
+ +

+The comparison operators +== and != must be fully defined +for operands of the key type; thus the key type must not be a function, map, or +slice. +If the key type is an interface type, these +comparison operators must be defined for the dynamic key values; +failure will cause a run-time panic. + +

+ +
+map[string]int
+map[*T]struct{ x, y float64 }
+map[string]interface{}
+
+ +

+The number of map elements is called its length. +For a map m, it can be discovered using the +built-in function len +and may change during execution. Elements may be added during execution +using assignments and retrieved with +index expressions; they may be removed with the +delete built-in function. +

+

+A new, empty map value is made using the built-in +function make, +which takes the map type and an optional capacity hint as arguments: +

+ +
+make(map[string]int)
+make(map[string]int, 100)
+
+ +

+The initial capacity does not bound its size: +maps grow to accommodate the number of items +stored in them, with the exception of nil maps. +A nil map is equivalent to an empty map except that no elements +may be added. + +

Channel types

+ +

+A channel provides a mechanism for +concurrently executing functions +to communicate by +sending and +receiving +values of a specified element type. +The value of an uninitialized channel is nil. +

+ +
+ChannelType = ( "chan" | "chan" "<-" | "<-" "chan" ) ElementType .
+
+ +

+The optional <- operator specifies the channel direction, +send or receive. If no direction is given, the channel is +bidirectional. +A channel may be constrained only to send or only to receive by +conversion or assignment. +

+ +
+chan T          // can be used to send and receive values of type T
+chan<- float64  // can only be used to send float64s
+<-chan int      // can only be used to receive ints
+
+ +

+The <- operator associates with the leftmost chan +possible: +

+ +
+chan<- chan int    // same as chan<- (chan int)
+chan<- <-chan int  // same as chan<- (<-chan int)
+<-chan <-chan int  // same as <-chan (<-chan int)
+chan (<-chan int)
+
+ +

+A new, initialized channel +value can be made using the built-in function +make, +which takes the channel type and an optional capacity as arguments: +

+ +
+make(chan int, 100)
+
+ +

+The capacity, in number of elements, sets the size of the buffer in the channel. +If the capacity is zero or absent, the channel is unbuffered and communication +succeeds only when both a sender and receiver are ready. Otherwise, the channel +is buffered and communication succeeds without blocking if the buffer +is not full (sends) or not empty (receives). +A nil channel is never ready for communication. +

+ +

+A channel may be closed with the built-in function +close. +The multi-valued assignment form of the +receive operator +reports whether a received value was sent before +the channel was closed. +

+ +

+A single channel may be used in +send statements, +receive operations, +and calls to the built-in functions +cap and +len +by any number of goroutines without further synchronization. +Channels act as first-in-first-out queues. +For example, if one goroutine sends values on a channel +and a second goroutine receives them, the values are +received in the order sent. +

+ +

Properties of types and values

+ +

Type identity

+ +

+Two types are either identical or different. +

+ +

+Two named types are identical if their type names originate in the same +TypeSpec. +A named and an unnamed type are always different. Two unnamed types are identical +if the corresponding type literals are identical, that is, if they have the same +literal structure and corresponding components have identical types. In detail: +

+ +
    +
  • Two array types are identical if they have identical element types and + the same array length.
  • + +
  • Two slice types are identical if they have identical element types.
  • + +
  • Two struct types are identical if they have the same sequence of fields, + and if corresponding fields have the same names, and identical types, + and identical tags. + Two anonymous fields are considered to have the same name. Lower-case field + names from different packages are always different.
  • + +
  • Two pointer types are identical if they have identical base types.
  • + +
  • Two function types are identical if they have the same number of parameters + and result values, corresponding parameter and result types are + identical, and either both functions are variadic or neither is. + Parameter and result names are not required to match.
  • + +
  • Two interface types are identical if they have the same set of methods + with the same names and identical function types. Lower-case method names from + different packages are always different. The order of the methods is irrelevant.
  • + +
  • Two map types are identical if they have identical key and value types.
  • + +
  • Two channel types are identical if they have identical value types and + the same direction.
  • +
+ +

+Given the declarations +

+ +
+type (
+	T0 []string
+	T1 []string
+	T2 struct{ a, b int }
+	T3 struct{ a, c int }
+	T4 func(int, float64) *T0
+	T5 func(x int, y float64) *[]string
+)
+
+ +

+these types are identical: +

+ +
+T0 and T0
+[]int and []int
+struct{ a, b *T5 } and struct{ a, b *T5 }
+func(x int, y float64) *[]string and func(int, float64) (result *[]string)
+
+ +

+T0 and T1 are different because they are named types +with distinct declarations; func(int, float64) *T0 and +func(x int, y float64) *[]string are different because T0 +is different from []string. +

+ + +

Assignability

+ +

+A value x is assignable to a variable of type T +("x is assignable to T") in any of these cases: +

+ +
    +
  • +x's type is identical to T. +
  • +
  • +x's type V and T have identical +underlying types and at least one of V +or T is not a named type. +
  • +
  • +T is an interface type and +x implements T. +
  • +
  • +x is a bidirectional channel value, T is a channel type, +x's type V and T have identical element types, +and at least one of V or T is not a named type. +
  • +
  • +x is the predeclared identifier nil and T +is a pointer, function, slice, map, channel, or interface type. +
  • +
  • +x is an untyped constant representable +by a value of type T. +
  • +
+ + +

Blocks

+ +

+A block is a possibly empty sequence of declarations and statements +within matching brace brackets. +

+ +
+Block = "{" StatementList "}" .
+StatementList = { Statement ";" } .
+
+ +

+In addition to explicit blocks in the source code, there are implicit blocks: +

+ +
    +
  1. The universe block encompasses all Go source text.
  2. + +
  3. Each package has a package block containing all + Go source text for that package.
  4. + +
  5. Each file has a file block containing all Go source text + in that file.
  6. + +
  7. Each "if", + "for", and + "switch" + statement is considered to be in its own implicit block.
  8. + +
  9. Each clause in a "switch" + or "select" statement + acts as an implicit block.
  10. +
+ +

+Blocks nest and influence scoping. +

+ + +

Declarations and scope

+ +

+A declaration binds a non-blank identifier to a +constant, +type, +variable, +function, +label, or +package. +Every identifier in a program must be declared. +No identifier may be declared twice in the same block, and +no identifier may be declared in both the file and package block. +

+ +

+The blank identifier may be used like any other identifier +in a declaration, but it does not introduce a binding and thus is not declared. +In the package block, the identifier init may only be used for +init function declarations, +and like the blank identifier it does not introduce a new binding. +

+ +
+Declaration   = ConstDecl | TypeDecl | VarDecl .
+TopLevelDecl  = Declaration | FunctionDecl | MethodDecl .
+
+ +

+The scope of a declared identifier is the extent of source text in which +the identifier denotes the specified constant, type, variable, function, label, or package. +

+ +

+Go is lexically scoped using blocks: +

+ +
    +
  1. The scope of a predeclared identifier is the universe block.
  2. + +
  3. The scope of an identifier denoting a constant, type, variable, + or function (but not method) declared at top level (outside any + function) is the package block.
  4. + +
  5. The scope of the package name of an imported package is the file block + of the file containing the import declaration.
  6. + +
  7. The scope of an identifier denoting a method receiver, function parameter, + or result variable is the function body.
  8. + +
  9. The scope of a constant or variable identifier declared + inside a function begins at the end of the ConstSpec or VarSpec + (ShortVarDecl for short variable declarations) + and ends at the end of the innermost containing block.
  10. + +
  11. The scope of a type identifier declared inside a function + begins at the identifier in the TypeSpec + and ends at the end of the innermost containing block.
  12. +
+ +

+An identifier declared in a block may be redeclared in an inner block. +While the identifier of the inner declaration is in scope, it denotes +the entity declared by the inner declaration. +

+ +

+The package clause is not a declaration; the package name +does not appear in any scope. Its purpose is to identify the files belonging +to the same package and to specify the default package name for import +declarations. +

+ + +

Label scopes

+ +

+Labels are declared by labeled statements and are +used in the "break", +"continue", and +"goto" statements. +It is illegal to define a label that is never used. +In contrast to other identifiers, labels are not block scoped and do +not conflict with identifiers that are not labels. The scope of a label +is the body of the function in which it is declared and excludes +the body of any nested function. +

+ + +

Blank identifier

+ +

+The blank identifier is represented by the underscore character _. +It serves as an anonymous placeholder instead of a regular (non-blank) +identifier and has special meaning in declarations, +as an operand, and in assignments. +

+ + +

Predeclared identifiers

+ +

+The following identifiers are implicitly declared in the +universe block: +

+
+Types:
+	bool byte complex64 complex128 error float32 float64
+	int int8 int16 int32 int64 rune string
+	uint uint8 uint16 uint32 uint64 uintptr
+
+Constants:
+	true false iota
+
+Zero value:
+	nil
+
+Functions:
+	append cap close complex copy delete imag len
+	make new panic print println real recover
+
+ + +

Exported identifiers

+ +

+An identifier may be exported to permit access to it from another package. +An identifier is exported if both: +

+
    +
  1. the first character of the identifier's name is a Unicode upper case + letter (Unicode class "Lu"); and
  2. +
  3. the identifier is declared in the package block + or it is a field name or + method name.
  4. +
+

+All other identifiers are not exported. +

+ + +

Uniqueness of identifiers

+ +

+Given a set of identifiers, an identifier is called unique if it is +different from every other in the set. +Two identifiers are different if they are spelled differently, or if they +appear in different packages and are not +exported. Otherwise, they are the same. +

+ +

Constant declarations

+ +

+A constant declaration binds a list of identifiers (the names of +the constants) to the values of a list of constant expressions. +The number of identifiers must be equal +to the number of expressions, and the nth identifier on +the left is bound to the value of the nth expression on the +right. +

+ +
+ConstDecl      = "const" ( ConstSpec | "(" { ConstSpec ";" } ")" ) .
+ConstSpec      = IdentifierList [ [ Type ] "=" ExpressionList ] .
+
+IdentifierList = identifier { "," identifier } .
+ExpressionList = Expression { "," Expression } .
+
+ +

+If the type is present, all constants take the type specified, and +the expressions must be assignable to that type. +If the type is omitted, the constants take the +individual types of the corresponding expressions. +If the expression values are untyped constants, +the declared constants remain untyped and the constant identifiers +denote the constant values. For instance, if the expression is a +floating-point literal, the constant identifier denotes a floating-point +constant, even if the literal's fractional part is zero. +

+ +
+const Pi float64 = 3.14159265358979323846
+const zero = 0.0         // untyped floating-point constant
+const (
+	size int64 = 1024
+	eof        = -1  // untyped integer constant
+)
+const a, b, c = 3, 4, "foo"  // a = 3, b = 4, c = "foo", untyped integer and string constants
+const u, v float32 = 0, 3    // u = 0.0, v = 3.0
+
+ +

+Within a parenthesized const declaration list the +expression list may be omitted from any but the first declaration. +Such an empty list is equivalent to the textual substitution of the +first preceding non-empty expression list and its type if any. +Omitting the list of expressions is therefore equivalent to +repeating the previous list. The number of identifiers must be equal +to the number of expressions in the previous list. +Together with the iota constant generator +this mechanism permits light-weight declaration of sequential values: +

+ +
+const (
+	Sunday = iota
+	Monday
+	Tuesday
+	Wednesday
+	Thursday
+	Friday
+	Partyday
+	numberOfDays  // this constant is not exported
+)
+
+ + +

Iota

+ +

+Within a constant declaration, the predeclared identifier +iota represents successive untyped integer +constants. It is reset to 0 whenever the reserved word const +appears in the source and increments after each ConstSpec. +It can be used to construct a set of related constants: +

+ +
+const (  // iota is reset to 0
+	c0 = iota  // c0 == 0
+	c1 = iota  // c1 == 1
+	c2 = iota  // c2 == 2
+)
+
+const (
+	a = 1 << iota  // a == 1 (iota has been reset)
+	b = 1 << iota  // b == 2
+	c = 1 << iota  // c == 4
+)
+
+const (
+	u         = iota * 42  // u == 0     (untyped integer constant)
+	v float64 = iota * 42  // v == 42.0  (float64 constant)
+	w         = iota * 42  // w == 84    (untyped integer constant)
+)
+
+const x = iota  // x == 0 (iota has been reset)
+const y = iota  // y == 0 (iota has been reset)
+
+ +

+Within an ExpressionList, the value of each iota is the same because +it is only incremented after each ConstSpec: +

+ +
+const (
+	bit0, mask0 = 1 << iota, 1<<iota - 1  // bit0 == 1, mask0 == 0
+	bit1, mask1                           // bit1 == 2, mask1 == 1
+	_, _                                  // skips iota == 2
+	bit3, mask3                           // bit3 == 8, mask3 == 7
+)
+
+ +

+This last example exploits the implicit repetition of the +last non-empty expression list. +

+ + +

Type declarations

+ +

+A type declaration binds an identifier, the type name, to a new type +that has the same underlying type as an existing type, +and operations defined for the existing type are also defined for the new type. +The new type is different from the existing type. +

+ +
+TypeDecl     = "type" ( TypeSpec | "(" { TypeSpec ";" } ")" ) .
+TypeSpec     = identifier Type .
+
+ +
+type IntArray [16]int
+
+type (
+	Point struct{ x, y float64 }
+	Polar Point
+)
+
+type TreeNode struct {
+	left, right *TreeNode
+	value *Comparable
+}
+
+type Block interface {
+	BlockSize() int
+	Encrypt(src, dst []byte)
+	Decrypt(src, dst []byte)
+}
+
+ +

+The declared type does not inherit any methods +bound to the existing type, but the method set +of an interface type or of elements of a composite type remains unchanged: +

+ +
+// A Mutex is a data type with two methods, Lock and Unlock.
+type Mutex struct         { /* Mutex fields */ }
+func (m *Mutex) Lock()    { /* Lock implementation */ }
+func (m *Mutex) Unlock()  { /* Unlock implementation */ }
+
+// NewMutex has the same composition as Mutex but its method set is empty.
+type NewMutex Mutex
+
+// The method set of the base type of PtrMutex remains unchanged,
+// but the method set of PtrMutex is empty.
+type PtrMutex *Mutex
+
+// The method set of *PrintableMutex contains the methods
+// Lock and Unlock bound to its anonymous field Mutex.
+type PrintableMutex struct {
+	Mutex
+}
+
+// MyBlock is an interface type that has the same method set as Block.
+type MyBlock Block
+
+ +

+A type declaration may be used to define a different boolean, numeric, or string +type and attach methods to it: +

+ +
+type TimeZone int
+
+const (
+	EST TimeZone = -(5 + iota)
+	CST
+	MST
+	PST
+)
+
+func (tz TimeZone) String() string {
+	return fmt.Sprintf("GMT%+dh", tz)
+}
+
+ + +

Variable declarations

+ +

+A variable declaration creates one or more variables, binds corresponding +identifiers to them, and gives each a type and an initial value. +

+ +
+VarDecl     = "var" ( VarSpec | "(" { VarSpec ";" } ")" ) .
+VarSpec     = IdentifierList ( Type [ "=" ExpressionList ] | "=" ExpressionList ) .
+
+ +
+var i int
+var U, V, W float64
+var k = 0
+var x, y float32 = -1, -2
+var (
+	i       int
+	u, v, s = 2.0, 3.0, "bar"
+)
+var re, im = complexSqrt(-1)
+var _, found = entries[name]  // map lookup; only interested in "found"
+
+ +

+If a list of expressions is given, the variables are initialized +with the expressions following the rules for assignments. +Otherwise, each variable is initialized to its zero value. +

+ +

+If a type is present, each variable is given that type. +Otherwise, each variable is given the type of the corresponding +initialization value in the assignment. +If that value is an untyped constant, it is first +converted to its default type; +if it is an untyped boolean value, it is first converted to type bool. +The predeclared value nil cannot be used to initialize a variable +with no explicit type. +

+ +
+var d = math.Sin(0.5)  // d is float64
+var i = 42             // i is int
+var t, ok = x.(T)      // t is T, ok is bool
+var n = nil            // illegal
+
+ +

+Implementation restriction: A compiler may make it illegal to declare a variable +inside a function body if the variable is +never used. +

+ +

Short variable declarations

+ +

+A short variable declaration uses the syntax: +

+ +
+ShortVarDecl = IdentifierList ":=" ExpressionList .
+
+ +

+It is shorthand for a regular variable declaration +with initializer expressions but no types: +

+ +
+"var" IdentifierList = ExpressionList .
+
+ +
+i, j := 0, 10
+f := func() int { return 7 }
+ch := make(chan int)
+r, w := os.Pipe(fd)  // os.Pipe() returns two values
+_, y, _ := coord(p)  // coord() returns three values; only interested in y coordinate
+
+ +

+Unlike regular variable declarations, a short variable declaration may redeclare +variables provided they were originally declared earlier in the same block +(or the parameter lists if the block is the function body) with the same type, +and at least one of the non-blank variables is new. +As a consequence, redeclaration can only appear in a multi-variable short declaration. +Redeclaration does not introduce a new variable; it just assigns a new value to the original. +

+ +
+field1, offset := nextField(str, 0)
+field2, offset := nextField(str, offset)  // redeclares offset
+a, a := 1, 2                              // illegal: double declaration of a or no new variable if a was declared elsewhere
+
+ +

+Short variable declarations may appear only inside functions. +In some contexts such as the initializers for +"if", +"for", or +"switch" statements, +they can be used to declare local temporary variables. +

+ +

Function declarations

+ +

+A function declaration binds an identifier, the function name, +to a function. +

+ +
+FunctionDecl = "func" FunctionName ( Function | Signature ) .
+FunctionName = identifier .
+Function     = Signature FunctionBody .
+FunctionBody = Block .
+
+ +

+If the function's signature declares +result parameters, the function body's statement list must end in +a terminating statement. +

+ +
+func IndexRune(s string, r rune) int {
+	for i, c := range s {
+		if c == r {
+			return i
+		}
+	}
+	// invalid: missing return statement
+}
+
+ +

+A function declaration may omit the body. Such a declaration provides the +signature for a function implemented outside Go, such as an assembly routine. +

+ +
+func min(x int, y int) int {
+	if x < y {
+		return x
+	}
+	return y
+}
+
+func flushICache(begin, end uintptr)  // implemented externally
+
+ +

Method declarations

+ +

+A method is a function with a receiver. +A method declaration binds an identifier, the method name, to a method, +and associates the method with the receiver's base type. +

+ +
+MethodDecl   = "func" Receiver MethodName ( Function | Signature ) .
+Receiver     = Parameters .
+
+ +

+The receiver is specified via an extra parameter section preceding the method +name. That parameter section must declare a single parameter, the receiver. +Its type must be of the form T or *T (possibly using +parentheses) where T is a type name. The type denoted by T is called +the receiver base type; it must not be a pointer or interface type and +it must be declared in the same package as the method. +The method is said to be bound to the base type and the method name +is visible only within selectors for type T +or *T. +

+ +

+A non-blank receiver identifier must be +unique in the method signature. +If the receiver's value is not referenced inside the body of the method, +its identifier may be omitted in the declaration. The same applies in +general to parameters of functions and methods. +

+ +

+For a base type, the non-blank names of methods bound to it must be unique. +If the base type is a struct type, +the non-blank method and field names must be distinct. +

+ +

+Given type Point, the declarations +

+ +
+func (p *Point) Length() float64 {
+	return math.Sqrt(p.x * p.x + p.y * p.y)
+}
+
+func (p *Point) Scale(factor float64) {
+	p.x *= factor
+	p.y *= factor
+}
+
+ +

+bind the methods Length and Scale, +with receiver type *Point, +to the base type Point. +

+ +

+The type of a method is the type of a function with the receiver as first +argument. For instance, the method Scale has type +

+ +
+func(p *Point, factor float64)
+
+ +

+However, a function declared this way is not a method. +

+ + +

Expressions

+ +

+An expression specifies the computation of a value by applying +operators and functions to operands. +

+ +

Operands

+ +

+Operands denote the elementary values in an expression. An operand may be a +literal, a (possibly qualified) +non-blank identifier denoting a +constant, +variable, or +function, +a method expression yielding a function, +or a parenthesized expression. +

+ +

+The blank identifier may appear as an +operand only on the left-hand side of an assignment. +

+ +
+Operand     = Literal | OperandName | MethodExpr | "(" Expression ")" .
+Literal     = BasicLit | CompositeLit | FunctionLit .
+BasicLit    = int_lit | float_lit | imaginary_lit | rune_lit | string_lit .
+OperandName = identifier | QualifiedIdent.
+
+ +

Qualified identifiers

+ +

+A qualified identifier is an identifier qualified with a package name prefix. +Both the package name and the identifier must not be +blank. +

+ +
+QualifiedIdent = PackageName "." identifier .
+
+ +

+A qualified identifier accesses an identifier in a different package, which +must be imported. +The identifier must be exported and +declared in the package block of that package. +

+ +
+math.Sin	// denotes the Sin function in package math
+
+ +

Composite literals

+ +

+Composite literals construct values for structs, arrays, slices, and maps +and create a new value each time they are evaluated. +They consist of the type of the value +followed by a brace-bound list of composite elements. An element may be +a single expression or a key-value pair. +

+ +
+CompositeLit  = LiteralType LiteralValue .
+LiteralType   = StructType | ArrayType | "[" "..." "]" ElementType |
+                SliceType | MapType | TypeName .
+LiteralValue  = "{" [ ElementList [ "," ] ] "}" .
+ElementList   = Element { "," Element } .
+Element       = [ Key ":" ] Value .
+Key           = FieldName | Expression | LiteralValue .
+FieldName     = identifier .
+Value         = Expression | LiteralValue .
+
+ +

+The LiteralType must be a struct, array, slice, or map type +(the grammar enforces this constraint except when the type is given +as a TypeName). +The types of the expressions must be assignable +to the respective field, element, and key types of the LiteralType; +there is no additional conversion. +The key is interpreted as a field name for struct literals, +an index for array and slice literals, and a key for map literals. +For map literals, all elements must have a key. It is an error +to specify multiple elements with the same field name or +constant key value. +

+ +

+For struct literals the following rules apply: +

+
    +
  • A key must be a field name declared in the LiteralType. +
  • +
  • An element list that does not contain any keys must + list an element for each struct field in the + order in which the fields are declared. +
  • +
  • If any element has a key, every element must have a key. +
  • +
  • An element list that contains keys does not need to + have an element for each struct field. Omitted fields + get the zero value for that field. +
  • +
  • A literal may omit the element list; such a literal evaluates + to the zero value for its type. +
  • +
  • It is an error to specify an element for a non-exported + field of a struct belonging to a different package. +
  • +
+ +

+Given the declarations +

+
+type Point3D struct { x, y, z float64 }
+type Line struct { p, q Point3D }
+
+ +

+one may write +

+ +
+origin := Point3D{}                            // zero value for Point3D
+line := Line{origin, Point3D{y: -4, z: 12.3}}  // zero value for line.q.x
+
+ +

+For array and slice literals the following rules apply: +

+
    +
  • Each element has an associated integer index marking + its position in the array. +
  • +
  • An element with a key uses the key as its index; the + key must be a constant integer expression. +
  • +
  • An element without a key uses the previous element's index plus one. + If the first element has no key, its index is zero. +
  • +
+ +

+Taking the address of a composite literal +generates a pointer to a unique variable initialized +with the literal's value. +

+
+var pointer *Point3D = &Point3D{y: 1000}
+
+ +

+The length of an array literal is the length specified in the LiteralType. +If fewer elements than the length are provided in the literal, the missing +elements are set to the zero value for the array element type. +It is an error to provide elements with index values outside the index range +of the array. The notation ... specifies an array length equal +to the maximum element index plus one. +

+ +
+buffer := [10]string{}             // len(buffer) == 10
+intSet := [6]int{1, 2, 3, 5}       // len(intSet) == 6
+days := [...]string{"Sat", "Sun"}  // len(days) == 2
+
+ +

+A slice literal describes the entire underlying array literal. +Thus, the length and capacity of a slice literal are the maximum +element index plus one. A slice literal has the form +

+ +
+[]T{x1, x2, … xn}
+
+ +

+and is shorthand for a slice operation applied to an array: +

+ +
+tmp := [n]T{x1, x2, … xn}
+tmp[0 : n]
+
+ +

+Within a composite literal of array, slice, or map type T, +elements or map keys that are themselves composite literals may elide the respective +literal type if it is identical to the element or key type of T. +Similarly, elements or keys that are addresses of composite literals may elide +the &T when the element or key type is *T. +

+ +
+[...]Point{{1.5, -3.5}, {0, 0}}     // same as [...]Point{Point{1.5, -3.5}, Point{0, 0}}
+[][]int{{1, 2, 3}, {4, 5}}          // same as [][]int{[]int{1, 2, 3}, []int{4, 5}}
+[][]Point{{{0, 1}, {1, 2}}}         // same as [][]Point{[]Point{Point{0, 1}, Point{1, 2}}}
+map[string]Point{"orig": {0, 0}}    // same as map[string]Point{"orig": Point{0, 0}}
+
+[...]*Point{{1.5, -3.5}, {0, 0}}    // same as [...]*Point{&Point{1.5, -3.5}, &Point{0, 0}}
+
+map[Point]string{{0, 0}: "orig"}    // same as map[Point]string{Point{0, 0}: "orig"}
+
+ +

+A parsing ambiguity arises when a composite literal using the +TypeName form of the LiteralType appears as an operand between the +keyword and the opening brace of the block +of an "if", "for", or "switch" statement, and the composite literal +is not enclosed in parentheses, square brackets, or curly braces. +In this rare case, the opening brace of the literal is erroneously parsed +as the one introducing the block of statements. To resolve the ambiguity, +the composite literal must appear within parentheses. +

+ +
+if x == (T{a,b,c}[i]) { … }
+if (x == T{a,b,c}[i]) { … }
+
+ +

+Examples of valid array, slice, and map literals: +

+ +
+// list of prime numbers
+primes := []int{2, 3, 5, 7, 9, 2147483647}
+
+// vowels[ch] is true if ch is a vowel
+vowels := [128]bool{'a': true, 'e': true, 'i': true, 'o': true, 'u': true, 'y': true}
+
+// the array [10]float32{-1, 0, 0, 0, -0.1, -0.1, 0, 0, 0, -1}
+filter := [10]float32{-1, 4: -0.1, -0.1, 9: -1}
+
+// frequencies in Hz for equal-tempered scale (A4 = 440Hz)
+noteFrequency := map[string]float32{
+	"C0": 16.35, "D0": 18.35, "E0": 20.60, "F0": 21.83,
+	"G0": 24.50, "A0": 27.50, "B0": 30.87,
+}
+
+ + +

Function literals

+ +

+A function literal represents an anonymous function. +

+ +
+FunctionLit = "func" Function .
+
+ +
+func(a, b int, z float64) bool { return a*b < int(z) }
+
+ +

+A function literal can be assigned to a variable or invoked directly. +

+ +
+f := func(x, y int) int { return x + y }
+func(ch chan int) { ch <- ACK }(replyChan)
+
+ +

+Function literals are closures: they may refer to variables +defined in a surrounding function. Those variables are then shared between +the surrounding function and the function literal, and they survive as long +as they are accessible. +

+ + +

Primary expressions

+ +

+Primary expressions are the operands for unary and binary expressions. +

+ +
+PrimaryExpr =
+	Operand |
+	Conversion |
+	PrimaryExpr Selector |
+	PrimaryExpr Index |
+	PrimaryExpr Slice |
+	PrimaryExpr TypeAssertion |
+	PrimaryExpr Arguments .
+
+Selector       = "." identifier .
+Index          = "[" Expression "]" .
+Slice          = "[" ( [ Expression ] ":" [ Expression ] ) |
+                     ( [ Expression ] ":" Expression ":" Expression )
+                 "]" .
+TypeAssertion  = "." "(" Type ")" .
+Arguments      = "(" [ ( ExpressionList | Type [ "," ExpressionList ] ) [ "..." ] [ "," ] ] ")" .
+
+ + +
+x
+2
+(s + ".txt")
+f(3.1415, true)
+Point{1, 2}
+m["foo"]
+s[i : j + 1]
+obj.color
+f.p[i].x()
+
+ + +

Selectors

+ +

+For a primary expression x +that is not a package name, the +selector expression +

+ +
+x.f
+
+ +

+denotes the field or method f of the value x +(or sometimes *x; see below). +The identifier f is called the (field or method) selector; +it must not be the blank identifier. +The type of the selector expression is the type of f. +If x is a package name, see the section on +qualified identifiers. +

+ +

+A selector f may denote a field or method f of +a type T, or it may refer +to a field or method f of a nested +anonymous field of T. +The number of anonymous fields traversed +to reach f is called its depth in T. +The depth of a field or method f +declared in T is zero. +The depth of a field or method f declared in +an anonymous field A in T is the +depth of f in A plus one. +

+ +

+The following rules apply to selectors: +

+ +
    +
  1. +For a value x of type T or *T +where T is not a pointer or interface type, +x.f denotes the field or method at the shallowest depth +in T where there +is such an f. +If there is not exactly one f +with shallowest depth, the selector expression is illegal. +
  2. + +
  3. +For a value x of type I where I +is an interface type, x.f denotes the actual method with name +f of the dynamic value of x. +If there is no method with name f in the +method set of I, the selector +expression is illegal. +
  4. + +
  5. +As an exception, if the type of x is a named pointer type +and (*x).f is a valid selector expression denoting a field +(but not a method), x.f is shorthand for (*x).f. +
  6. + +
  7. +In all other cases, x.f is illegal. +
  8. + +
  9. +If x is of pointer type and has the value +nil and x.f denotes a struct field, +assigning to or evaluating x.f +causes a run-time panic. +
  10. + +
  11. +If x is of interface type and has the value +nil, calling or +evaluating the method x.f +causes a run-time panic. +
  12. +
+ +

+For example, given the declarations: +

+ +
+type T0 struct {
+	x int
+}
+
+func (*T0) M0()
+
+type T1 struct {
+	y int
+}
+
+func (T1) M1()
+
+type T2 struct {
+	z int
+	T1
+	*T0
+}
+
+func (*T2) M2()
+
+type Q *T2
+
+var t T2     // with t.T0 != nil
+var p *T2    // with p != nil and (*p).T0 != nil
+var q Q = p
+
+ +

+one may write: +

+ +
+t.z          // t.z
+t.y          // t.T1.y
+t.x          // (*t.T0).x
+
+p.z          // (*p).z
+p.y          // (*p).T1.y
+p.x          // (*(*p).T0).x
+
+q.x          // (*(*q).T0).x        (*q).x is a valid field selector
+
+p.M0()       // ((*p).T0).M0()      M0 expects *T0 receiver
+p.M1()       // ((*p).T1).M1()      M1 expects T1 receiver
+p.M2()       // p.M2()              M2 expects *T2 receiver
+t.M2()       // (&t).M2()           M2 expects *T2 receiver, see section on Calls
+
+ +

+but the following is invalid: +

+ +
+q.M0()       // (*q).M0 is valid but not a field selector
+
+ + +

Method expressions

+ +

+If M is in the method set of type T, +T.M is a function that is callable as a regular function +with the same arguments as M prefixed by an additional +argument that is the receiver of the method. +

+ +
+MethodExpr    = ReceiverType "." MethodName .
+ReceiverType  = TypeName | "(" "*" TypeName ")" | "(" ReceiverType ")" .
+
+ +

+Consider a struct type T with two methods, +Mv, whose receiver is of type T, and +Mp, whose receiver is of type *T. +

+ +
+type T struct {
+	a int
+}
+func (tv  T) Mv(a int) int         { return 0 }  // value receiver
+func (tp *T) Mp(f float32) float32 { return 1 }  // pointer receiver
+
+var t T
+
+ +

+The expression +

+ +
+T.Mv
+
+ +

+yields a function equivalent to Mv but +with an explicit receiver as its first argument; it has signature +

+ +
+func(tv T, a int) int
+
+ +

+That function may be called normally with an explicit receiver, so +these five invocations are equivalent: +

+ +
+t.Mv(7)
+T.Mv(t, 7)
+(T).Mv(t, 7)
+f1 := T.Mv; f1(t, 7)
+f2 := (T).Mv; f2(t, 7)
+
+ +

+Similarly, the expression +

+ +
+(*T).Mp
+
+ +

+yields a function value representing Mp with signature +

+ +
+func(tp *T, f float32) float32
+
+ +

+For a method with a value receiver, one can derive a function +with an explicit pointer receiver, so +

+ +
+(*T).Mv
+
+ +

+yields a function value representing Mv with signature +

+ +
+func(tv *T, a int) int
+
+ +

+Such a function indirects through the receiver to create a value +to pass as the receiver to the underlying method; +the method does not overwrite the value whose address is passed in +the function call. +

+ +

+The final case, a value-receiver function for a pointer-receiver method, +is illegal because pointer-receiver methods are not in the method set +of the value type. +

+ +

+Function values derived from methods are called with function call syntax; +the receiver is provided as the first argument to the call. +That is, given f := T.Mv, f is invoked +as f(t, 7) not t.f(7). +To construct a function that binds the receiver, use a +function literal or +method value. +

+ +

+It is legal to derive a function value from a method of an interface type. +The resulting function takes an explicit receiver of that interface type. +

+ +

Method values

+ +

+If the expression x has static type T and +M is in the method set of type T, +x.M is called a method value. +The method value x.M is a function value that is callable +with the same arguments as a method call of x.M. +The expression x is evaluated and saved during the evaluation of the +method value; the saved copy is then used as the receiver in any calls, +which may be executed later. +

+ +

+The type T may be an interface or non-interface type. +

+ +

+As in the discussion of method expressions above, +consider a struct type T with two methods, +Mv, whose receiver is of type T, and +Mp, whose receiver is of type *T. +

+ +
+type T struct {
+	a int
+}
+func (tv  T) Mv(a int) int         { return 0 }  // value receiver
+func (tp *T) Mp(f float32) float32 { return 1 }  // pointer receiver
+
+var t T
+var pt *T
+func makeT() T
+
+ +

+The expression +

+ +
+t.Mv
+
+ +

+yields a function value of type +

+ +
+func(int) int
+
+ +

+These two invocations are equivalent: +

+ +
+t.Mv(7)
+f := t.Mv; f(7)
+
+ +

+Similarly, the expression +

+ +
+pt.Mp
+
+ +

+yields a function value of type +

+ +
+func(float32) float32
+
+ +

+As with selectors, a reference to a non-interface method with a value receiver +using a pointer will automatically dereference that pointer: pt.Mv is equivalent to (*pt).Mv. +

+ +

+As with method calls, a reference to a non-interface method with a pointer receiver +using an addressable value will automatically take the address of that value: t.Mp is equivalent to (&t).Mp. +

+ +
+f := t.Mv; f(7)   // like t.Mv(7)
+f := pt.Mp; f(7)  // like pt.Mp(7)
+f := pt.Mv; f(7)  // like (*pt).Mv(7)
+f := t.Mp; f(7)   // like (&t).Mp(7)
+f := makeT().Mp   // invalid: result of makeT() is not addressable
+
+ +

+Although the examples above use non-interface types, it is also legal to create a method value +from a value of interface type. +

+ +
+var i interface { M(int) } = myVal
+f := i.M; f(7)  // like i.M(7)
+
+ + +

Index expressions

+ +

+A primary expression of the form +

+ +
+a[x]
+
+ +

+denotes the element of the array, pointer to array, slice, string or map a indexed by x. +The value x is called the index or map key, respectively. +The following rules apply: +

+ +

+If a is not a map: +

+
    +
  • the index x must be of integer type or untyped; + it is in range if 0 <= x < len(a), + otherwise it is out of range
  • +
  • a constant index must be non-negative + and representable by a value of type int +
+ +

+For a of array type A: +

+
    +
  • a constant index must be in range
  • +
  • if x is out of range at run time, + a run-time panic occurs
  • +
  • a[x] is the array element at index x and the type of + a[x] is the element type of A
  • +
+ +

+For a of pointer to array type: +

+
    +
  • a[x] is shorthand for (*a)[x]
  • +
+ +

+For a of slice type S: +

+
    +
  • if x is out of range at run time, + a run-time panic occurs
  • +
  • a[x] is the slice element at index x and the type of + a[x] is the element type of S
  • +
+ +

+For a of string type: +

+
    +
  • a constant index must be in range + if the string a is also constant
  • +
  • if x is out of range at run time, + a run-time panic occurs
  • +
  • a[x] is the non-constant byte value at index x and the type of + a[x] is byte
  • +
  • a[x] may not be assigned to
  • +
+ +

+For a of map type M: +

+
    +
  • x's type must be + assignable + to the key type of M
  • +
  • if the map contains an entry with key x, + a[x] is the map value with key x + and the type of a[x] is the value type of M
  • +
  • if the map is nil or does not contain such an entry, + a[x] is the zero value + for the value type of M
  • +
+ +

+Otherwise a[x] is illegal. +

+ +

+An index expression on a map a of type map[K]V +used in an assignment or initialization of the special form +

+ +
+v, ok = a[x]
+v, ok := a[x]
+var v, ok = a[x]
+
+ +

+yields an additional untyped boolean value. The value of ok is +true if the key x is present in the map, and +false otherwise. +

+ +

+Assigning to an element of a nil map causes a +run-time panic. +

+ + +

Slice expressions

+ +

+Slice expressions construct a substring or slice from a string, array, pointer +to array, or slice. There are two variants: a simple form that specifies a low +and high bound, and a full form that also specifies a bound on the capacity. +

+ +

Simple slice expressions

+ +

+For a string, array, pointer to array, or slice a, the primary expression +

+ +
+a[low : high]
+
+ +

+constructs a substring or slice. The indices low and +high select which elements of operand a appear +in the result. The result has indices starting at 0 and length equal to +high - low. +After slicing the array a +

+ +
+a := [5]int{1, 2, 3, 4, 5}
+s := a[1:4]
+
+ +

+the slice s has type []int, length 3, capacity 4, and elements +

+ +
+s[0] == 2
+s[1] == 3
+s[2] == 4
+
+ +

+For convenience, any of the indices may be omitted. A missing low +index defaults to zero; a missing high index defaults to the length of the +sliced operand: +

+ +
+a[2:]  // same as a[2 : len(a)]
+a[:3]  // same as a[0 : 3]
+a[:]   // same as a[0 : len(a)]
+
+ +

+If a is a pointer to an array, a[low : high] is shorthand for +(*a)[low : high]. +

+ +

+For arrays or strings, the indices are in range if +0 <= low <= high <= len(a), +otherwise they are out of range. +For slices, the upper index bound is the slice capacity cap(a) rather than the length. +A constant index must be non-negative and representable by a value of type +int; for arrays or constant strings, constant indices must also be in range. +If both indices are constant, they must satisfy low <= high. +If the indices are out of range at run time, a run-time panic occurs. +

+ +

+Except for untyped strings, if the sliced operand is a string or slice, +the result of the slice operation is a non-constant value of the same type as the operand. +For untyped string operands the result is a non-constant value of type string. +If the sliced operand is an array, it must be addressable +and the result of the slice operation is a slice with the same element type as the array. +

+ +

+If the sliced operand of a valid slice expression is a nil slice, the result +is a nil slice. Otherwise, the result shares its underlying array with the +operand. +

+ +

Full slice expressions

+ +

+For an array, pointer to array, or slice a (but not a string), the primary expression +

+ +
+a[low : high : max]
+
+ +

+constructs a slice of the same type, and with the same length and elements as the simple slice +expression a[low : high]. Additionally, it controls the resulting slice's capacity +by setting it to max - low. Only the first index may be omitted; it defaults to 0. +After slicing the array a +

+ +
+a := [5]int{1, 2, 3, 4, 5}
+t := a[1:3:5]
+
+ +

+the slice t has type []int, length 2, capacity 4, and elements +

+ +
+t[0] == 2
+t[1] == 3
+
+ +

+As for simple slice expressions, if a is a pointer to an array, +a[low : high : max] is shorthand for (*a)[low : high : max]. +If the sliced operand is an array, it must be addressable. +

+ +

+The indices are in range if 0 <= low <= high <= max <= cap(a), +otherwise they are out of range. +A constant index must be non-negative and representable by a value of type +int; for arrays, constant indices must also be in range. +If multiple indices are constant, the constants that are present must be in range relative to each +other. +If the indices are out of range at run time, a run-time panic occurs. +

+ +

Type assertions

+ +

+For an expression x of interface type +and a type T, the primary expression +

+ +
+x.(T)
+
+ +

+asserts that x is not nil +and that the value stored in x is of type T. +The notation x.(T) is called a type assertion. +

+

+More precisely, if T is not an interface type, x.(T) asserts +that the dynamic type of x is identical +to the type T. +In this case, T must implement the (interface) type of x; +otherwise the type assertion is invalid since it is not possible for x +to store a value of type T. +If T is an interface type, x.(T) asserts that the dynamic type +of x implements the interface T. +

+

+If the type assertion holds, the value of the expression is the value +stored in x and its type is T. If the type assertion is false, +a run-time panic occurs. +In other words, even though the dynamic type of x +is known only at run time, the type of x.(T) is +known to be T in a correct program. +

+ +
+var x interface{} = 7  // x has dynamic type int and value 7
+i := x.(int)           // i has type int and value 7
+
+type I interface { m() }
+var y I
+s := y.(string)        // illegal: string does not implement I (missing method m)
+r := y.(io.Reader)     // r has type io.Reader and y must implement both I and io.Reader
+
+ +

+A type assertion used in an assignment or initialization of the special form +

+ +
+v, ok = x.(T)
+v, ok := x.(T)
+var v, ok = x.(T)
+
+ +

+yields an additional untyped boolean value. The value of ok is true +if the assertion holds. Otherwise it is false and the value of v is +the zero value for type T. +No run-time panic occurs in this case. +

+ + +

Calls

+ +

+Given an expression f of function type +F, +

+ +
+f(a1, a2, … an)
+
+ +

+calls f with arguments a1, a2, … an. +Except for one special case, arguments must be single-valued expressions +assignable to the parameter types of +F and are evaluated before the function is called. +The type of the expression is the result type +of F. +A method invocation is similar but the method itself +is specified as a selector upon a value of the receiver type for +the method. +

+ +
+math.Atan2(x, y)  // function call
+var pt *Point
+pt.Scale(3.5)     // method call with receiver pt
+
+ +

+In a function call, the function value and arguments are evaluated in +the usual order. +After they are evaluated, the parameters of the call are passed by value to the function +and the called function begins execution. +The return parameters of the function are passed by value +back to the calling function when the function returns. +

+ +

+Calling a nil function value +causes a run-time panic. +

+ +

+As a special case, if the return values of a function or method +g are equal in number and individually +assignable to the parameters of another function or method +f, then the call f(g(parameters_of_g)) +will invoke f after binding the return values of +g to the parameters of f in order. The call +of f must contain no parameters other than the call of g, +and g must have at least one return value. +If f has a final ... parameter, it is +assigned the return values of g that remain after +assignment of regular parameters. +

+ +
+func Split(s string, pos int) (string, string) {
+	return s[0:pos], s[pos:]
+}
+
+func Join(s, t string) string {
+	return s + t
+}
+
+if Join(Split(value, len(value)/2)) != value {
+	log.Panic("test fails")
+}
+
+ +

+A method call x.m() is valid if the method set +of (the type of) x contains m and the +argument list can be assigned to the parameter list of m. +If x is addressable and &x's method +set contains m, x.m() is shorthand +for (&x).m(): +

+ +
+var p Point
+p.Scale(3.5)
+
+ +

+There is no distinct method type and there are no method literals. +

+ +

Passing arguments to ... parameters

+ +

+If f is variadic with a final +parameter p of type ...T, then within f +the type of p is equivalent to type []T. +If f is invoked with no actual arguments for p, +the value passed to p is nil. +Otherwise, the value passed is a new slice +of type []T with a new underlying array whose successive elements +are the actual arguments, which all must be assignable +to T. The length and capacity of the slice is therefore +the number of arguments bound to p and may differ for each +call site. +

+ +

+Given the function and calls +

+
+func Greeting(prefix string, who ...string)
+Greeting("nobody")
+Greeting("hello:", "Joe", "Anna", "Eileen")
+
+ +

+within Greeting, who will have the value +nil in the first call, and +[]string{"Joe", "Anna", "Eileen"} in the second. +

+ +

+If the final argument is assignable to a slice type []T, it may be +passed unchanged as the value for a ...T parameter if the argument +is followed by .... In this case no new slice is created. +

+ +

+Given the slice s and call +

+ +
+s := []string{"James", "Jasmine"}
+Greeting("goodbye:", s...)
+
+ +

+within Greeting, who will have the same value as s +with the same underlying array. +

+ + +

Operators

+ +

+Operators combine operands into expressions. +

+ +
+Expression = UnaryExpr | Expression binary_op Expression .
+UnaryExpr  = PrimaryExpr | unary_op UnaryExpr .
+
+binary_op  = "||" | "&&" | rel_op | add_op | mul_op .
+rel_op     = "==" | "!=" | "<" | "<=" | ">" | ">=" .
+add_op     = "+" | "-" | "|" | "^" .
+mul_op     = "*" | "/" | "%" | "<<" | ">>" | "&" | "&^" .
+
+unary_op   = "+" | "-" | "!" | "^" | "*" | "&" | "<-" .
+
+ +

+Comparisons are discussed elsewhere. +For other binary operators, the operand types must be identical +unless the operation involves shifts or untyped constants. +For operations involving constants only, see the section on +constant expressions. +

+ +

+Except for shift operations, if one operand is an untyped constant +and the other operand is not, the constant is converted +to the type of the other operand. +

+ +

+The right operand in a shift expression must have unsigned integer type +or be an untyped constant that can be converted to unsigned integer type. +If the left operand of a non-constant shift expression is an untyped constant, +it is first converted to the type it would assume if the shift expression were +replaced by its left operand alone. +

+ +
+var s uint = 33
+var i = 1<<s           // 1 has type int
+var j int32 = 1<<s     // 1 has type int32; j == 0
+var k = uint64(1<<s)   // 1 has type uint64; k == 1<<33
+var m int = 1.0<<s     // 1.0 has type int
+var n = 1.0<<s != i    // 1.0 has type int; n == false if ints are 32bits in size
+var o = 1<<s == 2<<s   // 1 and 2 have type int; o == true if ints are 32bits in size
+var p = 1<<s == 1<<33  // illegal if ints are 32bits in size: 1 has type int, but 1<<33 overflows int
+var u = 1.0<<s         // illegal: 1.0 has type float64, cannot shift
+var u1 = 1.0<<s != 0   // illegal: 1.0 has type float64, cannot shift
+var u2 = 1<<s != 1.0   // illegal: 1 has type float64, cannot shift
+var v float32 = 1<<s   // illegal: 1 has type float32, cannot shift
+var w int64 = 1.0<<33  // 1.0<<33 is a constant shift expression
+
+ + +

Operator precedence

+

+Unary operators have the highest precedence. +As the ++ and -- operators form +statements, not expressions, they fall +outside the operator hierarchy. +As a consequence, statement *p++ is the same as (*p)++. +

+There are five precedence levels for binary operators. +Multiplication operators bind strongest, followed by addition +operators, comparison operators, && (logical AND), +and finally || (logical OR): +

+ +
+Precedence    Operator
+    5             *  /  %  <<  >>  &  &^
+    4             +  -  |  ^
+    3             ==  !=  <  <=  >  >=
+    2             &&
+    1             ||
+
+ +

+Binary operators of the same precedence associate from left to right. +For instance, x / y * z is the same as (x / y) * z. +

+ +
++x
+23 + 3*x[i]
+x <= f()
+^a >> b
+f() || g()
+x == y+1 && <-chanPtr > 0
+
+ + +

Arithmetic operators

+

+Arithmetic operators apply to numeric values and yield a result of the same +type as the first operand. The four standard arithmetic operators (+, +-, *, /) apply to integer, +floating-point, and complex types; + also applies to strings. +The bitwise logical and shift operators apply to integers only. +

+ +
++    sum                    integers, floats, complex values, strings
+-    difference             integers, floats, complex values
+*    product                integers, floats, complex values
+/    quotient               integers, floats, complex values
+%    remainder              integers
+
+&    bitwise AND            integers
+|    bitwise OR             integers
+^    bitwise XOR            integers
+&^   bit clear (AND NOT)    integers
+
+<<   left shift             integer << unsigned integer
+>>   right shift            integer >> unsigned integer
+
+ + +

Integer operators

+ +

+For two integer values x and y, the integer quotient +q = x / y and remainder r = x % y satisfy the following +relationships: +

+ +
+x = q*y + r  and  |r| < |y|
+
+ +

+with x / y truncated towards zero +("truncated division"). +

+ +
+ x     y     x / y     x % y
+ 5     3       1         2
+-5     3      -1        -2
+ 5    -3      -1         2
+-5    -3       1        -2
+
+ +

+As an exception to this rule, if the dividend x is the most +negative value for the int type of x, the quotient +q = x / -1 is equal to x (and r = 0). +

+ +
+			 x, q
+int8                     -128
+int16                  -32768
+int32             -2147483648
+int64    -9223372036854775808
+
+ +

+If the divisor is a constant, it must not be zero. +If the divisor is zero at run time, a run-time panic occurs. +If the dividend is non-negative and the divisor is a constant power of 2, +the division may be replaced by a right shift, and computing the remainder may +be replaced by a bitwise AND operation: +

+ +
+ x     x / 4     x % 4     x >> 2     x & 3
+ 11      2         3         2          3
+-11     -2        -3        -3          1
+
+ +

+The shift operators shift the left operand by the shift count specified by the +right operand. They implement arithmetic shifts if the left operand is a signed +integer and logical shifts if it is an unsigned integer. +There is no upper limit on the shift count. Shifts behave +as if the left operand is shifted n times by 1 for a shift +count of n. +As a result, x << 1 is the same as x*2 +and x >> 1 is the same as +x/2 but truncated towards negative infinity. +

+ +

+For integer operands, the unary operators ++, -, and ^ are defined as +follows: +

+ +
++x                          is 0 + x
+-x    negation              is 0 - x
+^x    bitwise complement    is m ^ x  with m = "all bits set to 1" for unsigned x
+                                      and  m = -1 for signed x
+
+ + +

Integer overflow

+ +

+For unsigned integer values, the operations +, +-, *, and << are +computed modulo 2n, where n is the bit width of +the unsigned integer's type. +Loosely speaking, these unsigned integer operations +discard high bits upon overflow, and programs may rely on ``wrap around''. +

+

+For signed integers, the operations +, +-, *, and << may legally +overflow and the resulting value exists and is deterministically defined +by the signed integer representation, the operation, and its operands. +No exception is raised as a result of overflow. A +compiler may not optimize code under the assumption that overflow does +not occur. For instance, it may not assume that x < x + 1 is always true. +

+ + +

Floating-point operators

+ +

+For floating-point and complex numbers, ++x is the same as x, +while -x is the negation of x. +The result of a floating-point or complex division by zero is not specified beyond the +IEEE-754 standard; whether a run-time panic +occurs is implementation-specific. +

+ + +

String concatenation

+ +

+Strings can be concatenated using the + operator +or the += assignment operator: +

+ +
+s := "hi" + string(c)
+s += " and good bye"
+
+ +

+String addition creates a new string by concatenating the operands. +

+ + +

Comparison operators

+ +

+Comparison operators compare two operands and yield an untyped boolean value. +

+ +
+==    equal
+!=    not equal
+<     less
+<=    less or equal
+>     greater
+>=    greater or equal
+
+ +

+In any comparison, the first operand +must be assignable +to the type of the second operand, or vice versa. +

+

+The equality operators == and != apply +to operands that are comparable. +The ordering operators <, <=, >, and >= +apply to operands that are ordered. +These terms and the result of the comparisons are defined as follows: +

+ +
    +
  • + Boolean values are comparable. + Two boolean values are equal if they are either both + true or both false. +
  • + +
  • + Integer values are comparable and ordered, in the usual way. +
  • + +
  • + Floating point values are comparable and ordered, + as defined by the IEEE-754 standard. +
  • + +
  • + Complex values are comparable. + Two complex values u and v are + equal if both real(u) == real(v) and + imag(u) == imag(v). +
  • + +
  • + String values are comparable and ordered, lexically byte-wise. +
  • + +
  • + Pointer values are comparable. + Two pointer values are equal if they point to the same variable or if both have value nil. + Pointers to distinct zero-size variables may or may not be equal. +
  • + +
  • + Channel values are comparable. + Two channel values are equal if they were created by the same call to + make + or if both have value nil. +
  • + +
  • + Interface values are comparable. + Two interface values are equal if they have identical dynamic types + and equal dynamic values or if both have value nil. +
  • + +
  • + A value x of non-interface type X and + a value t of interface type T are comparable when values + of type X are comparable and + X implements T. + They are equal if t's dynamic type is identical to X + and t's dynamic value is equal to x. +
  • + +
  • + Struct values are comparable if all their fields are comparable. + Two struct values are equal if their corresponding + non-blank fields are equal. +
  • + +
  • + Array values are comparable if values of the array element type are comparable. + Two array values are equal if their corresponding elements are equal. +
  • +
+ +

+A comparison of two interface values with identical dynamic types +causes a run-time panic if values +of that type are not comparable. This behavior applies not only to direct interface +value comparisons but also when comparing arrays of interface values +or structs with interface-valued fields. +

+ +

+Slice, map, and function values are not comparable. +However, as a special case, a slice, map, or function value may +be compared to the predeclared identifier nil. +Comparison of pointer, channel, and interface values to nil +is also allowed and follows from the general rules above. +

+ +
+const c = 3 < 4            // c is the untyped bool constant true
+
+type MyBool bool
+var x, y int
+var (
+	// The result of a comparison is an untyped bool.
+	// The usual assignment rules apply.
+	b3        = x == y // b3 has type bool
+	b4 bool   = x == y // b4 has type bool
+	b5 MyBool = x == y // b5 has type MyBool
+)
+
+ +

Logical operators

+ +

+Logical operators apply to boolean values +and yield a result of the same type as the operands. +The right operand is evaluated conditionally. +

+ +
+&&    conditional AND    p && q  is  "if p then q else false"
+||    conditional OR     p || q  is  "if p then true else q"
+!     NOT                !p      is  "not p"
+
+ + +

Address operators

+ +

+For an operand x of type T, the address operation +&x generates a pointer of type *T to x. +The operand must be addressable, +that is, either a variable, pointer indirection, or slice indexing +operation; or a field selector of an addressable struct operand; +or an array indexing operation of an addressable array. +As an exception to the addressability requirement, x may also be a +(possibly parenthesized) +composite literal. +If the evaluation of x would cause a run-time panic, +then the evaluation of &x does too. +

+ +

+For an operand x of pointer type *T, the pointer +indirection *x denotes the variable of type T pointed +to by x. +If x is nil, an attempt to evaluate *x +will cause a run-time panic. +

+ +
+&x
+&a[f(2)]
+&Point{2, 3}
+*p
+*pf(x)
+
+var x *int = nil
+*x   // causes a run-time panic
+&*x  // causes a run-time panic
+
+ + +

Receive operator

+ +

+For an operand ch of channel type, +the value of the receive operation <-ch is the value received +from the channel ch. The channel direction must permit receive operations, +and the type of the receive operation is the element type of the channel. +The expression blocks until a value is available. +Receiving from a nil channel blocks forever. +A receive operation on a closed channel can always proceed +immediately, yielding the element type's zero value +after any previously sent values have been received. +

+ +
+v1 := <-ch
+v2 = <-ch
+f(<-ch)
+<-strobe  // wait until clock pulse and discard received value
+
+ +

+A receive expression used in an assignment or initialization of the special form +

+ +
+x, ok = <-ch
+x, ok := <-ch
+var x, ok = <-ch
+
+ +

+yields an additional untyped boolean result reporting whether the +communication succeeded. The value of ok is true +if the value received was delivered by a successful send operation to the +channel, or false if it is a zero value generated because the +channel is closed and empty. +

+ + +

Conversions

+ +

+Conversions are expressions of the form T(x) +where T is a type and x is an expression +that can be converted to type T. +

+ +
+Conversion = Type "(" Expression [ "," ] ")" .
+
+ +

+If the type starts with the operator * or <-, +or if the type starts with the keyword func +and has no result list, it must be parenthesized when +necessary to avoid ambiguity: +

+ +
+*Point(p)        // same as *(Point(p))
+(*Point)(p)      // p is converted to *Point
+<-chan int(c)    // same as <-(chan int(c))
+(<-chan int)(c)  // c is converted to <-chan int
+func()(x)        // function signature func() x
+(func())(x)      // x is converted to func()
+(func() int)(x)  // x is converted to func() int
+func() int(x)    // x is converted to func() int (unambiguous)
+
+ +

+A constant value x can be converted to +type T in any of these cases: +

+ +
    +
  • + x is representable by a value of type T. +
  • +
  • + x is a floating-point constant, + T is a floating-point type, + and x is representable by a value + of type T after rounding using + IEEE 754 round-to-even rules. + The constant T(x) is the rounded value. +
  • +
  • + x is an integer constant and T is a + string type. + The same rule + as for non-constant x applies in this case. +
  • +
+ +

+Converting a constant yields a typed constant as result. +

+ +
+uint(iota)               // iota value of type uint
+float32(2.718281828)     // 2.718281828 of type float32
+complex128(1)            // 1.0 + 0.0i of type complex128
+float32(0.49999999)      // 0.5 of type float32
+string('x')              // "x" of type string
+string(0x266c)           // "♬" of type string
+MyString("foo" + "bar")  // "foobar" of type MyString
+string([]byte{'a'})      // not a constant: []byte{'a'} is not a constant
+(*int)(nil)              // not a constant: nil is not a constant, *int is not a boolean, numeric, or string type
+int(1.2)                 // illegal: 1.2 cannot be represented as an int
+string(65.0)             // illegal: 65.0 is not an integer constant
+
+ +

+A non-constant value x can be converted to type T +in any of these cases: +

+ +
    +
  • + x is assignable + to T. +
  • +
  • + x's type and T have identical + underlying types. +
  • +
  • + x's type and T are unnamed pointer types + and their pointer base types have identical underlying types. +
  • +
  • + x's type and T are both integer or floating + point types. +
  • +
  • + x's type and T are both complex types. +
  • +
  • + x is an integer or a slice of bytes or runes + and T is a string type. +
  • +
  • + x is a string and T is a slice of bytes or runes. +
  • +
+ +

+Specific rules apply to (non-constant) conversions between numeric types or +to and from a string type. +These conversions may change the representation of x +and incur a run-time cost. +All other conversions only change the type but not the representation +of x. +

+ +

+There is no linguistic mechanism to convert between pointers and integers. +The package unsafe +implements this functionality under +restricted circumstances. +

+ +

Conversions between numeric types

+ +

+For the conversion of non-constant numeric values, the following rules apply: +

+ +
    +
  1. +When converting between integer types, if the value is a signed integer, it is +sign extended to implicit infinite precision; otherwise it is zero extended. +It is then truncated to fit in the result type's size. +For example, if v := uint16(0x10F0), then uint32(int8(v)) == 0xFFFFFFF0. +The conversion always yields a valid value; there is no indication of overflow. +
  2. +
  3. +When converting a floating-point number to an integer, the fraction is discarded +(truncation towards zero). +
  4. +
  5. +When converting an integer or floating-point number to a floating-point type, +or a complex number to another complex type, the result value is rounded +to the precision specified by the destination type. +For instance, the value of a variable x of type float32 +may be stored using additional precision beyond that of an IEEE-754 32-bit number, +but float32(x) represents the result of rounding x's value to +32-bit precision. Similarly, x + 0.1 may use more than 32 bits +of precision, but float32(x + 0.1) does not. +
  6. +
+ +

+In all non-constant conversions involving floating-point or complex values, +if the result type cannot represent the value the conversion +succeeds but the result value is implementation-dependent. +

+ +

Conversions to and from a string type

+ +
    +
  1. +Converting a signed or unsigned integer value to a string type yields a +string containing the UTF-8 representation of the integer. Values outside +the range of valid Unicode code points are converted to "\uFFFD". + +
    +string('a')       // "a"
    +string(-1)        // "\ufffd" == "\xef\xbf\xbd"
    +string(0xf8)      // "\u00f8" == "ø" == "\xc3\xb8"
    +type MyString string
    +MyString(0x65e5)  // "\u65e5" == "日" == "\xe6\x97\xa5"
    +
    +
  2. + +
  3. +Converting a slice of bytes to a string type yields +a string whose successive bytes are the elements of the slice. + +
    +string([]byte{'h', 'e', 'l', 'l', '\xc3', '\xb8'})   // "hellø"
    +string([]byte{})                                     // ""
    +string([]byte(nil))                                  // ""
    +
    +type MyBytes []byte
    +string(MyBytes{'h', 'e', 'l', 'l', '\xc3', '\xb8'})  // "hellø"
    +
    +
  4. + +
  5. +Converting a slice of runes to a string type yields +a string that is the concatenation of the individual rune values +converted to strings. + +
    +string([]rune{0x767d, 0x9d6c, 0x7fd4})   // "\u767d\u9d6c\u7fd4" == "白鵬翔"
    +string([]rune{})                         // ""
    +string([]rune(nil))                      // ""
    +
    +type MyRunes []rune
    +string(MyRunes{0x767d, 0x9d6c, 0x7fd4})  // "\u767d\u9d6c\u7fd4" == "白鵬翔"
    +
    +
  6. + +
  7. +Converting a value of a string type to a slice of bytes type +yields a slice whose successive elements are the bytes of the string. + +
    +[]byte("hellø")   // []byte{'h', 'e', 'l', 'l', '\xc3', '\xb8'}
    +[]byte("")        // []byte{}
    +
    +MyBytes("hellø")  // []byte{'h', 'e', 'l', 'l', '\xc3', '\xb8'}
    +
    +
  8. + +
  9. +Converting a value of a string type to a slice of runes type +yields a slice containing the individual Unicode code points of the string. + +
    +[]rune(MyString("白鵬翔"))  // []rune{0x767d, 0x9d6c, 0x7fd4}
    +[]rune("")                 // []rune{}
    +
    +MyRunes("白鵬翔")           // []rune{0x767d, 0x9d6c, 0x7fd4}
    +
    +
  10. +
+ + +

Constant expressions

+ +

+Constant expressions may contain only constant +operands and are evaluated at compile time. +

+ +

+Untyped boolean, numeric, and string constants may be used as operands +wherever it is legal to use an operand of boolean, numeric, or string type, +respectively. +Except for shift operations, if the operands of a binary operation are +different kinds of untyped constants, the operation and, for non-boolean operations, the result use +the kind that appears later in this list: integer, rune, floating-point, complex. +For example, an untyped integer constant divided by an +untyped complex constant yields an untyped complex constant. +

+ +

+A constant comparison always yields +an untyped boolean constant. If the left operand of a constant +shift expression is an untyped constant, the +result is an integer constant; otherwise it is a constant of the same +type as the left operand, which must be of +integer type. +Applying all other operators to untyped constants results in an untyped +constant of the same kind (that is, a boolean, integer, floating-point, +complex, or string constant). +

+ +
+const a = 2 + 3.0          // a == 5.0   (untyped floating-point constant)
+const b = 15 / 4           // b == 3     (untyped integer constant)
+const c = 15 / 4.0         // c == 3.75  (untyped floating-point constant)
+const Θ float64 = 3/2      // Θ == 1.0   (type float64, 3/2 is integer division)
+const Π float64 = 3/2.     // Π == 1.5   (type float64, 3/2. is float division)
+const d = 1 << 3.0         // d == 8     (untyped integer constant)
+const e = 1.0 << 3         // e == 8     (untyped integer constant)
+const f = int32(1) << 33   // illegal    (constant 8589934592 overflows int32)
+const g = float64(2) >> 1  // illegal    (float64(2) is a typed floating-point constant)
+const h = "foo" > "bar"    // h == true  (untyped boolean constant)
+const j = true             // j == true  (untyped boolean constant)
+const k = 'w' + 1          // k == 'x'   (untyped rune constant)
+const l = "hi"             // l == "hi"  (untyped string constant)
+const m = string(k)        // m == "x"   (type string)
+const Σ = 1 - 0.707i       //            (untyped complex constant)
+const Δ = Σ + 2.0e-4       //            (untyped complex constant)
+const Φ = iota*1i - 1/1i   //            (untyped complex constant)
+
+ +

+Applying the built-in function complex to untyped +integer, rune, or floating-point constants yields +an untyped complex constant. +

+ +
+const ic = complex(0, c)   // ic == 3.75i  (untyped complex constant)
+const iΘ = complex(0, Θ)   // iΘ == 1i     (type complex128)
+
+ +

+Constant expressions are always evaluated exactly; intermediate values and the +constants themselves may require precision significantly larger than supported +by any predeclared type in the language. The following are legal declarations: +

+ +
+const Huge = 1 << 100         // Huge == 1267650600228229401496703205376  (untyped integer constant)
+const Four int8 = Huge >> 98  // Four == 4                                (type int8)
+
+ +

+The divisor of a constant division or remainder operation must not be zero: +

+ +
+3.14 / 0.0   // illegal: division by zero
+
+ +

+The values of typed constants must always be accurately representable as values +of the constant type. The following constant expressions are illegal: +

+ +
+uint(-1)     // -1 cannot be represented as a uint
+int(3.14)    // 3.14 cannot be represented as an int
+int64(Huge)  // 1267650600228229401496703205376 cannot be represented as an int64
+Four * 300   // operand 300 cannot be represented as an int8 (type of Four)
+Four * 100   // product 400 cannot be represented as an int8 (type of Four)
+
+ +

+The mask used by the unary bitwise complement operator ^ matches +the rule for non-constants: the mask is all 1s for unsigned constants +and -1 for signed and untyped constants. +

+ +
+^1         // untyped integer constant, equal to -2
+uint8(^1)  // illegal: same as uint8(-2), -2 cannot be represented as a uint8
+^uint8(1)  // typed uint8 constant, same as 0xFF ^ uint8(1) = uint8(0xFE)
+int8(^1)   // same as int8(-2)
+^int8(1)   // same as -1 ^ int8(1) = -2
+
+ +

+Implementation restriction: A compiler may use rounding while +computing untyped floating-point or complex constant expressions; see +the implementation restriction in the section +on constants. This rounding may cause a +floating-point constant expression to be invalid in an integer +context, even if it would be integral when calculated using infinite +precision, and vice versa. +

+ + +

Order of evaluation

+ +

+At package level, initialization dependencies +determine the evaluation order of individual initialization expressions in +variable declarations. +Otherwise, when evaluating the operands of an +expression, assignment, or +return statement, +all function calls, method calls, and +communication operations are evaluated in lexical left-to-right +order. +

+ +

+For example, in the (function-local) assignment +

+
+y[f()], ok = g(h(), i()+x[j()], <-c), k()
+
+

+the function calls and communication happen in the order +f(), h(), i(), j(), +<-c, g(), and k(). +However, the order of those events compared to the evaluation +and indexing of x and the evaluation +of y is not specified. +

+ +
+a := 1
+f := func() int { a++; return a }
+x := []int{a, f()}            // x may be [1, 2] or [2, 2]: evaluation order between a and f() is not specified
+m := map[int]int{a: 1, a: 2}  // m may be {2: 1} or {2: 2}: evaluation order between the two map assignments is not specified
+n := map[int]int{a: f()}      // n may be {2: 3} or {3: 3}: evaluation order between the key and the value is not specified
+
+ +

+At package level, initialization dependencies override the left-to-right rule +for individual initialization expressions, but not for operands within each +expression: +

+ +
+var a, b, c = f() + v(), g(), sqr(u()) + v()
+
+func f() int        { return c }
+func g() int        { return a }
+func sqr(x int) int { return x*x }
+
+// functions u and v are independent of all other variables and functions
+
+ +

+The function calls happen in the order +u(), sqr(), v(), +f(), v(), and g(). +

+ +

+Floating-point operations within a single expression are evaluated according to +the associativity of the operators. Explicit parentheses affect the evaluation +by overriding the default associativity. +In the expression x + (y + z) the addition y + z +is performed before adding x. +

+ +

Statements

+ +

+Statements control execution. +

+ +
+Statement =
+	Declaration | LabeledStmt | SimpleStmt |
+	GoStmt | ReturnStmt | BreakStmt | ContinueStmt | GotoStmt |
+	FallthroughStmt | Block | IfStmt | SwitchStmt | SelectStmt | ForStmt |
+	DeferStmt .
+
+SimpleStmt = EmptyStmt | ExpressionStmt | SendStmt | IncDecStmt | Assignment | ShortVarDecl .
+
+ +

Terminating statements

+ +

+A terminating statement is one of the following: +

+ +
    +
  1. + A "return" or + "goto" statement. + +
    +
  2. + +
  3. + A call to the built-in function + panic. + +
    +
  4. + +
  5. + A block in which the statement list ends in a terminating statement. + +
    +
  6. + +
  7. + An "if" statement in which: +
      +
    • the "else" branch is present, and
    • +
    • both branches are terminating statements.
    • +
    +
  8. + +
  9. + A "for" statement in which: +
      +
    • there are no "break" statements referring to the "for" statement, and
    • +
    • the loop condition is absent.
    • +
    +
  10. + +
  11. + A "switch" statement in which: +
      +
    • there are no "break" statements referring to the "switch" statement,
    • +
    • there is a default case, and
    • +
    • the statement lists in each case, including the default, end in a terminating + statement, or a possibly labeled "fallthrough" + statement.
    • +
    +
  12. + +
  13. + A "select" statement in which: +
      +
    • there are no "break" statements referring to the "select" statement, and
    • +
    • the statement lists in each case, including the default if present, + end in a terminating statement.
    • +
    +
  14. + +
  15. + A labeled statement labeling + a terminating statement. +
  16. +
+ +

+All other statements are not terminating. +

+ +

+A statement list ends in a terminating statement if the list +is not empty and its final statement is terminating. +

+ + +

Empty statements

+ +

+The empty statement does nothing. +

+ +
+EmptyStmt = .
+
+ + +

Labeled statements

+ +

+A labeled statement may be the target of a goto, +break or continue statement. +

+ +
+LabeledStmt = Label ":" Statement .
+Label       = identifier .
+
+ +
+Error: log.Panic("error encountered")
+
+ + +

Expression statements

+ +

+With the exception of specific built-in functions, +function and method calls and +receive operations +can appear in statement context. Such statements may be parenthesized. +

+ +
+ExpressionStmt = Expression .
+
+ +

+The following built-in functions are not permitted in statement context: +

+ +
+append cap complex imag len make new real
+unsafe.Alignof unsafe.Offsetof unsafe.Sizeof
+
+ +
+h(x+y)
+f.Close()
+<-ch
+(<-ch)
+len("foo")  // illegal if len is the built-in function
+
+ + +

Send statements

+ +

+A send statement sends a value on a channel. +The channel expression must be of channel type, +the channel direction must permit send operations, +and the type of the value to be sent must be assignable +to the channel's element type. +

+ +
+SendStmt = Channel "<-" Expression .
+Channel  = Expression .
+
+ +

+Both the channel and the value expression are evaluated before communication +begins. Communication blocks until the send can proceed. +A send on an unbuffered channel can proceed if a receiver is ready. +A send on a buffered channel can proceed if there is room in the buffer. +A send on a closed channel proceeds by causing a run-time panic. +A send on a nil channel blocks forever. +

+ +
+ch <- 3  // send value 3 to channel ch
+
+ + +

IncDec statements

+ +

+The "++" and "--" statements increment or decrement their operands +by the untyped constant 1. +As with an assignment, the operand must be addressable +or a map index expression. +

+ +
+IncDecStmt = Expression ( "++" | "--" ) .
+
+ +

+The following assignment statements are semantically +equivalent: +

+ +
+IncDec statement    Assignment
+x++                 x += 1
+x--                 x -= 1
+
+ + +

Assignments

+ +
+Assignment = ExpressionList assign_op ExpressionList .
+
+assign_op = [ add_op | mul_op ] "=" .
+
+ +

+Each left-hand side operand must be addressable, +a map index expression, or (for = assignments only) the +blank identifier. +Operands may be parenthesized. +

+ +
+x = 1
+*p = f()
+a[i] = 23
+(k) = <-ch  // same as: k = <-ch
+
+ +

+An assignment operation x op= +y where op is a binary arithmetic operation is equivalent +to x = x op +(y) but evaluates x +only once. The op= construct is a single token. +In assignment operations, both the left- and right-hand expression lists +must contain exactly one single-valued expression, and the left-hand +expression must not be the blank identifier. +

+ +
+a[i] <<= 2
+i &^= 1<<n
+
+ +

+A tuple assignment assigns the individual elements of a multi-valued +operation to a list of variables. There are two forms. In the +first, the right hand operand is a single multi-valued expression +such as a function call, a channel or +map operation, or a type assertion. +The number of operands on the left +hand side must match the number of values. For instance, if +f is a function returning two values, +

+ +
+x, y = f()
+
+ +

+assigns the first value to x and the second to y. +In the second form, the number of operands on the left must equal the number +of expressions on the right, each of which must be single-valued, and the +nth expression on the right is assigned to the nth +operand on the left: +

+ +
+one, two, three = '一', '二', '三'
+
+ +

+The blank identifier provides a way to +ignore right-hand side values in an assignment: +

+ +
+_ = x       // evaluate x but ignore it
+x, _ = f()  // evaluate f() but ignore second result value
+
+ +

+The assignment proceeds in two phases. +First, the operands of index expressions +and pointer indirections +(including implicit pointer indirections in selectors) +on the left and the expressions on the right are all +evaluated in the usual order. +Second, the assignments are carried out in left-to-right order. +

+ +
+a, b = b, a  // exchange a and b
+
+x := []int{1, 2, 3}
+i := 0
+i, x[i] = 1, 2  // set i = 1, x[0] = 2
+
+i = 0
+x[i], i = 2, 1  // set x[0] = 2, i = 1
+
+x[0], x[0] = 1, 2  // set x[0] = 1, then x[0] = 2 (so x[0] == 2 at end)
+
+x[1], x[3] = 4, 5  // set x[1] = 4, then panic setting x[3] = 5.
+
+type Point struct { x, y int }
+var p *Point
+x[2], p.x = 6, 7  // set x[2] = 6, then panic setting p.x = 7
+
+i = 2
+x = []int{3, 5, 7}
+for i, x[i] = range x {  // set i, x[2] = 0, x[0]
+	break
+}
+// after this loop, i == 0 and x == []int{3, 5, 3}
+
+ +

+In assignments, each value must be assignable +to the type of the operand to which it is assigned, with the following special cases: +

+ +
    +
  1. + Any typed value may be assigned to the blank identifier. +
  2. + +
  3. + If an untyped constant + is assigned to a variable of interface type or the blank identifier, + the constant is first converted to its + default type. +
  4. + +
  5. + If an untyped boolean value is assigned to a variable of interface type or + the blank identifier, it is first converted to type bool. +
  6. +
+ +

If statements

+ +

+"If" statements specify the conditional execution of two branches +according to the value of a boolean expression. If the expression +evaluates to true, the "if" branch is executed, otherwise, if +present, the "else" branch is executed. +

+ +
+IfStmt = "if" [ SimpleStmt ";" ] Expression Block [ "else" ( IfStmt | Block ) ] .
+
+ +
+if x > max {
+	x = max
+}
+
+ +

+The expression may be preceded by a simple statement, which +executes before the expression is evaluated. +

+ +
+if x := f(); x < y {
+	return x
+} else if x > z {
+	return z
+} else {
+	return y
+}
+
+ + +

Switch statements

+ +

+"Switch" statements provide multi-way execution. +An expression or type specifier is compared to the "cases" +inside the "switch" to determine which branch +to execute. +

+ +
+SwitchStmt = ExprSwitchStmt | TypeSwitchStmt .
+
+ +

+There are two forms: expression switches and type switches. +In an expression switch, the cases contain expressions that are compared +against the value of the switch expression. +In a type switch, the cases contain types that are compared against the +type of a specially annotated switch expression. +The switch expression is evaluated exactly once in a switch statement. +

+ +

Expression switches

+ +

+In an expression switch, +the switch expression is evaluated and +the case expressions, which need not be constants, +are evaluated left-to-right and top-to-bottom; the first one that equals the +switch expression +triggers execution of the statements of the associated case; +the other cases are skipped. +If no case matches and there is a "default" case, +its statements are executed. +There can be at most one default case and it may appear anywhere in the +"switch" statement. +A missing switch expression is equivalent to the boolean value +true. +

+ +
+ExprSwitchStmt = "switch" [ SimpleStmt ";" ] [ Expression ] "{" { ExprCaseClause } "}" .
+ExprCaseClause = ExprSwitchCase ":" StatementList .
+ExprSwitchCase = "case" ExpressionList | "default" .
+
+ +

+If the switch expression evaluates to an untyped constant, it is first +converted to its default type; +if it is an untyped boolean value, it is first converted to type bool. +The predeclared untyped value nil cannot be used as a switch expression. +

+ +

+If a case expression is untyped, it is first converted +to the type of the switch expression. +For each (possibly converted) case expression x and the value t +of the switch expression, x == t must be a valid comparison. +

+ +

+In other words, the switch expression is treated as if it were used to declare and +initialize a temporary variable t without explicit type; it is that +value of t against which each case expression x is tested +for equality. +

+ +

+In a case or default clause, the last non-empty statement +may be a (possibly labeled) +"fallthrough" statement to +indicate that control should flow from the end of this clause to +the first statement of the next clause. +Otherwise control flows to the end of the "switch" statement. +A "fallthrough" statement may appear as the last statement of all +but the last clause of an expression switch. +

+ +

+The switch expression may be preceded by a simple statement, which +executes before the expression is evaluated. +

+ +
+switch tag {
+default: s3()
+case 0, 1, 2, 3: s1()
+case 4, 5, 6, 7: s2()
+}
+
+switch x := f(); {  // missing switch expression means "true"
+case x < 0: return -x
+default: return x
+}
+
+switch {
+case x < y: f1()
+case x < z: f2()
+case x == 4: f3()
+}
+
+ +

+Implementation restriction: A compiler may disallow multiple case +expressions evaluating to the same constant. +For instance, the current compilers disallow duplicate integer, +floating point, or string constants in case expressions. +

+ +

Type switches

+ +

+A type switch compares types rather than values. It is otherwise similar +to an expression switch. It is marked by a special switch expression that +has the form of a type assertion +using the reserved word type rather than an actual type: +

+ +
+switch x.(type) {
+// cases
+}
+
+ +

+Cases then match actual types T against the dynamic type of the +expression x. As with type assertions, x must be of +interface type, and each non-interface type +T listed in a case must implement the type of x. +

+ +
+TypeSwitchStmt  = "switch" [ SimpleStmt ";" ] TypeSwitchGuard "{" { TypeCaseClause } "}" .
+TypeSwitchGuard = [ identifier ":=" ] PrimaryExpr "." "(" "type" ")" .
+TypeCaseClause  = TypeSwitchCase ":" StatementList .
+TypeSwitchCase  = "case" TypeList | "default" .
+TypeList        = Type { "," Type } .
+
+ +

+The TypeSwitchGuard may include a +short variable declaration. +When that form is used, the variable is declared at the beginning of +the implicit block in each clause. +In clauses with a case listing exactly one type, the variable +has that type; otherwise, the variable has the type of the expression +in the TypeSwitchGuard. +

+ +

+The type in a case may be nil; +that case is used when the expression in the TypeSwitchGuard +is a nil interface value. +

+ +

+Given an expression x of type interface{}, +the following type switch: +

+ +
+switch i := x.(type) {
+case nil:
+	printString("x is nil")                // type of i is type of x (interface{})
+case int:
+	printInt(i)                            // type of i is int
+case float64:
+	printFloat64(i)                        // type of i is float64
+case func(int) float64:
+	printFunction(i)                       // type of i is func(int) float64
+case bool, string:
+	printString("type is bool or string")  // type of i is type of x (interface{})
+default:
+	printString("don't know the type")     // type of i is type of x (interface{})
+}
+
+ +

+could be rewritten: +

+ +
+v := x  // x is evaluated exactly once
+if v == nil {
+	i := v                                 // type of i is type of x (interface{})
+	printString("x is nil")
+} else if i, isInt := v.(int); isInt {
+	printInt(i)                            // type of i is int
+} else if i, isFloat64 := v.(float64); isFloat64 {
+	printFloat64(i)                        // type of i is float64
+} else if i, isFunc := v.(func(int) float64); isFunc {
+	printFunction(i)                       // type of i is func(int) float64
+} else {
+	_, isBool := v.(bool)
+	_, isString := v.(string)
+	if isBool || isString {
+		i := v                         // type of i is type of x (interface{})
+		printString("type is bool or string")
+	} else {
+		i := v                         // type of i is type of x (interface{})
+		printString("don't know the type")
+	}
+}
+
+ +

+The type switch guard may be preceded by a simple statement, which +executes before the guard is evaluated. +

+ +

+The "fallthrough" statement is not permitted in a type switch. +

+ +

For statements

+ +

+A "for" statement specifies repeated execution of a block. The iteration is +controlled by a condition, a "for" clause, or a "range" clause. +

+ +
+ForStmt = "for" [ Condition | ForClause | RangeClause ] Block .
+Condition = Expression .
+
+ +

+In its simplest form, a "for" statement specifies the repeated execution of +a block as long as a boolean condition evaluates to true. +The condition is evaluated before each iteration. +If the condition is absent, it is equivalent to the boolean value +true. +

+ +
+for a < b {
+	a *= 2
+}
+
+ +

+A "for" statement with a ForClause is also controlled by its condition, but +additionally it may specify an init +and a post statement, such as an assignment, +an increment or decrement statement. The init statement may be a +short variable declaration, but the post statement must not. +Variables declared by the init statement are re-used in each iteration. +

+ +
+ForClause = [ InitStmt ] ";" [ Condition ] ";" [ PostStmt ] .
+InitStmt = SimpleStmt .
+PostStmt = SimpleStmt .
+
+ +
+for i := 0; i < 10; i++ {
+	f(i)
+}
+
+ +

+If non-empty, the init statement is executed once before evaluating the +condition for the first iteration; +the post statement is executed after each execution of the block (and +only if the block was executed). +Any element of the ForClause may be empty but the +semicolons are +required unless there is only a condition. +If the condition is absent, it is equivalent to the boolean value +true. +

+ +
+for cond { S() }    is the same as    for ; cond ; { S() }
+for      { S() }    is the same as    for true     { S() }
+
+ +

+A "for" statement with a "range" clause +iterates through all entries of an array, slice, string or map, +or values received on a channel. For each entry it assigns iteration values +to corresponding iteration variables if present and then executes the block. +

+ +
+RangeClause = [ ExpressionList "=" | IdentifierList ":=" ] "range" Expression .
+
+ +

+The expression on the right in the "range" clause is called the range expression, +which may be an array, pointer to an array, slice, string, map, or channel permitting +receive operations. +As with an assignment, if present the operands on the left must be +addressable or map index expressions; they +denote the iteration variables. If the range expression is a channel, at most +one iteration variable is permitted, otherwise there may be up to two. +If the last iteration variable is the blank identifier, +the range clause is equivalent to the same clause without that identifier. +

+ +

+The range expression is evaluated once before beginning the loop, +with one exception: if the range expression is an array or a pointer to an array +and at most one iteration variable is present, only the range expression's +length is evaluated; if that length is constant, +by definition +the range expression itself will not be evaluated. +

+ +

+Function calls on the left are evaluated once per iteration. +For each iteration, iteration values are produced as follows +if the respective iteration variables are present: +

+ +
+Range expression                          1st value          2nd value
+
+array or slice  a  [n]E, *[n]E, or []E    index    i  int    a[i]       E
+string          s  string type            index    i  int    see below  rune
+map             m  map[K]V                key      k  K      m[k]       V
+channel         c  chan E, <-chan E       element  e  E
+
+ +
    +
  1. +For an array, pointer to array, or slice value a, the index iteration +values are produced in increasing order, starting at element index 0. +If at most one iteration variable is present, the range loop produces +iteration values from 0 up to len(a)-1 and does not index into the array +or slice itself. For a nil slice, the number of iterations is 0. +
  2. + +
  3. +For a string value, the "range" clause iterates over the Unicode code points +in the string starting at byte index 0. On successive iterations, the index value will be the +index of the first byte of successive UTF-8-encoded code points in the string, +and the second value, of type rune, will be the value of +the corresponding code point. If the iteration encounters an invalid +UTF-8 sequence, the second value will be 0xFFFD, +the Unicode replacement character, and the next iteration will advance +a single byte in the string. +
  4. + +
  5. +The iteration order over maps is not specified +and is not guaranteed to be the same from one iteration to the next. +If map entries that have not yet been reached are removed during iteration, +the corresponding iteration values will not be produced. If map entries are +created during iteration, that entry may be produced during the iteration or +may be skipped. The choice may vary for each entry created and from one +iteration to the next. +If the map is nil, the number of iterations is 0. +
  6. + +
  7. +For channels, the iteration values produced are the successive values sent on +the channel until the channel is closed. If the channel +is nil, the range expression blocks forever. +
  8. +
+ +

+The iteration values are assigned to the respective +iteration variables as in an assignment statement. +

+ +

+The iteration variables may be declared by the "range" clause using a form of +short variable declaration +(:=). +In this case their types are set to the types of the respective iteration values +and their scope is the block of the "for" +statement; they are re-used in each iteration. +If the iteration variables are declared outside the "for" statement, +after execution their values will be those of the last iteration. +

+ +
+var testdata *struct {
+	a *[7]int
+}
+for i, _ := range testdata.a {
+	// testdata.a is never evaluated; len(testdata.a) is constant
+	// i ranges from 0 to 6
+	f(i)
+}
+
+var a [10]string
+for i, s := range a {
+	// type of i is int
+	// type of s is string
+	// s == a[i]
+	g(i, s)
+}
+
+var key string
+var val interface {}  // value type of m is assignable to val
+m := map[string]int{"mon":0, "tue":1, "wed":2, "thu":3, "fri":4, "sat":5, "sun":6}
+for key, val = range m {
+	h(key, val)
+}
+// key == last map key encountered in iteration
+// val == map[key]
+
+var ch chan Work = producer()
+for w := range ch {
+	doWork(w)
+}
+
+// empty a channel
+for range ch {}
+
+ + +

Go statements

+ +

+A "go" statement starts the execution of a function call +as an independent concurrent thread of control, or goroutine, +within the same address space. +

+ +
+GoStmt = "go" Expression .
+
+ +

+The expression must be a function or method call; it cannot be parenthesized. +Calls of built-in functions are restricted as for +expression statements. +

+ +

+The function value and parameters are +evaluated as usual +in the calling goroutine, but +unlike with a regular call, program execution does not wait +for the invoked function to complete. +Instead, the function begins executing independently +in a new goroutine. +When the function terminates, its goroutine also terminates. +If the function has any return values, they are discarded when the +function completes. +

+ +
+go Server()
+go func(ch chan<- bool) { for { sleep(10); ch <- true; }} (c)
+
+ + +

Select statements

+ +

+A "select" statement chooses which of a set of possible +send or +receive +operations will proceed. +It looks similar to a +"switch" statement but with the +cases all referring to communication operations. +

+ +
+SelectStmt = "select" "{" { CommClause } "}" .
+CommClause = CommCase ":" StatementList .
+CommCase   = "case" ( SendStmt | RecvStmt ) | "default" .
+RecvStmt   = [ ExpressionList "=" | IdentifierList ":=" ] RecvExpr .
+RecvExpr   = Expression .
+
+ +

+A case with a RecvStmt may assign the result of a RecvExpr to one or +two variables, which may be declared using a +short variable declaration. +The RecvExpr must be a (possibly parenthesized) receive operation. +There can be at most one default case and it may appear anywhere +in the list of cases. +

+ +

+Execution of a "select" statement proceeds in several steps: +

+ +
    +
  1. +For all the cases in the statement, the channel operands of receive operations +and the channel and right-hand-side expressions of send statements are +evaluated exactly once, in source order, upon entering the "select" statement. +The result is a set of channels to receive from or send to, +and the corresponding values to send. +Any side effects in that evaluation will occur irrespective of which (if any) +communication operation is selected to proceed. +Expressions on the left-hand side of a RecvStmt with a short variable declaration +or assignment are not yet evaluated. +
  2. + +
  3. +If one or more of the communications can proceed, +a single one that can proceed is chosen via a uniform pseudo-random selection. +Otherwise, if there is a default case, that case is chosen. +If there is no default case, the "select" statement blocks until +at least one of the communications can proceed. +
  4. + +
  5. +Unless the selected case is the default case, the respective communication +operation is executed. +
  6. + +
  7. +If the selected case is a RecvStmt with a short variable declaration or +an assignment, the left-hand side expressions are evaluated and the +received value (or values) are assigned. +
  8. + +
  9. +The statement list of the selected case is executed. +
  10. +
+ +

+Since communication on nil channels can never proceed, +a select with only nil channels and no default case blocks forever. +

+ +
+var a []int
+var c, c1, c2, c3, c4 chan int
+var i1, i2 int
+select {
+case i1 = <-c1:
+	print("received ", i1, " from c1\n")
+case c2 <- i2:
+	print("sent ", i2, " to c2\n")
+case i3, ok := (<-c3):  // same as: i3, ok := <-c3
+	if ok {
+		print("received ", i3, " from c3\n")
+	} else {
+		print("c3 is closed\n")
+	}
+case a[f()] = <-c4:
+	// same as:
+	// case t := <-c4
+	//	a[f()] = t
+default:
+	print("no communication\n")
+}
+
+for {  // send random sequence of bits to c
+	select {
+	case c <- 0:  // note: no statement, no fallthrough, no folding of cases
+	case c <- 1:
+	}
+}
+
+select {}  // block forever
+
+ + +

Return statements

+ +

+A "return" statement in a function F terminates the execution +of F, and optionally provides one or more result values. +Any functions deferred by F +are executed before F returns to its caller. +

+ +
+ReturnStmt = "return" [ ExpressionList ] .
+
+ +

+In a function without a result type, a "return" statement must not +specify any result values. +

+
+func noResult() {
+	return
+}
+
+ +

+There are three ways to return values from a function with a result +type: +

+ +
    +
  1. The return value or values may be explicitly listed + in the "return" statement. Each expression must be single-valued + and assignable + to the corresponding element of the function's result type. +
    +func simpleF() int {
    +	return 2
    +}
    +
    +func complexF1() (re float64, im float64) {
    +	return -7.0, -4.0
    +}
    +
    +
  2. +
  3. The expression list in the "return" statement may be a single + call to a multi-valued function. The effect is as if each value + returned from that function were assigned to a temporary + variable with the type of the respective value, followed by a + "return" statement listing these variables, at which point the + rules of the previous case apply. +
    +func complexF2() (re float64, im float64) {
    +	return complexF1()
    +}
    +
    +
  4. +
  5. The expression list may be empty if the function's result + type specifies names for its result parameters. + The result parameters act as ordinary local variables + and the function may assign values to them as necessary. + The "return" statement returns the values of these variables. +
    +func complexF3() (re float64, im float64) {
    +	re = 7.0
    +	im = 4.0
    +	return
    +}
    +
    +func (devnull) Write(p []byte) (n int, _ error) {
    +	n = len(p)
    +	return
    +}
    +
    +
  6. +
+ +

+Regardless of how they are declared, all the result values are initialized to +the zero values for their type upon entry to the +function. A "return" statement that specifies results sets the result parameters before +any deferred functions are executed. +

+ +

+Implementation restriction: A compiler may disallow an empty expression list +in a "return" statement if a different entity (constant, type, or variable) +with the same name as a result parameter is in +scope at the place of the return. +

+ +
+func f(n int) (res int, err error) {
+	if _, err := f(n-1); err != nil {
+		return  // invalid return statement: err is shadowed
+	}
+	return
+}
+
+ +

Break statements

+ +

+A "break" statement terminates execution of the innermost +"for", +"switch", or +"select" statement +within the same function. +

+ +
+BreakStmt = "break" [ Label ] .
+
+ +

+If there is a label, it must be that of an enclosing +"for", "switch", or "select" statement, +and that is the one whose execution terminates. +

+ +
+OuterLoop:
+	for i = 0; i < n; i++ {
+		for j = 0; j < m; j++ {
+			switch a[i][j] {
+			case nil:
+				state = Error
+				break OuterLoop
+			case item:
+				state = Found
+				break OuterLoop
+			}
+		}
+	}
+
+ +

Continue statements

+ +

+A "continue" statement begins the next iteration of the +innermost "for" loop at its post statement. +The "for" loop must be within the same function. +

+ +
+ContinueStmt = "continue" [ Label ] .
+
+ +

+If there is a label, it must be that of an enclosing +"for" statement, and that is the one whose execution +advances. +

+ +
+RowLoop:
+	for y, row := range rows {
+		for x, data := range row {
+			if data == endOfRow {
+				continue RowLoop
+			}
+			row[x] = data + bias(x, y)
+		}
+	}
+
+ +

Goto statements

+ +

+A "goto" statement transfers control to the statement with the corresponding label +within the same function. +

+ +
+GotoStmt = "goto" Label .
+
+ +
+goto Error
+
+ +

+Executing the "goto" statement must not cause any variables to come into +scope that were not already in scope at the point of the goto. +For instance, this example: +

+ +
+	goto L  // BAD
+	v := 3
+L:
+
+ +

+is erroneous because the jump to label L skips +the creation of v. +

+ +

+A "goto" statement outside a block cannot jump to a label inside that block. +For instance, this example: +

+ +
+if n%2 == 1 {
+	goto L1
+}
+for n > 0 {
+	f()
+	n--
+L1:
+	f()
+	n--
+}
+
+ +

+is erroneous because the label L1 is inside +the "for" statement's block but the goto is not. +

+ +

Fallthrough statements

+ +

+A "fallthrough" statement transfers control to the first statement of the +next case clause in a expression "switch" statement. +It may be used only as the final non-empty statement in such a clause. +

+ +
+FallthroughStmt = "fallthrough" .
+
+ + +

Defer statements

+ +

+A "defer" statement invokes a function whose execution is deferred +to the moment the surrounding function returns, either because the +surrounding function executed a return statement, +reached the end of its function body, +or because the corresponding goroutine is panicking. +

+ +
+DeferStmt = "defer" Expression .
+
+ +

+The expression must be a function or method call; it cannot be parenthesized. +Calls of built-in functions are restricted as for +expression statements. +

+ +

+Each time a "defer" statement +executes, the function value and parameters to the call are +evaluated as usual +and saved anew but the actual function is not invoked. +Instead, deferred functions are invoked immediately before +the surrounding function returns, in the reverse order +they were deferred. +If a deferred function value evaluates +to nil, execution panics +when the function is invoked, not when the "defer" statement is executed. +

+ +

+For instance, if the deferred function is +a function literal and the surrounding +function has named result parameters that +are in scope within the literal, the deferred function may access and modify +the result parameters before they are returned. +If the deferred function has any return values, they are discarded when +the function completes. +(See also the section on handling panics.) +

+ +
+lock(l)
+defer unlock(l)  // unlocking happens before surrounding function returns
+
+// prints 3 2 1 0 before surrounding function returns
+for i := 0; i <= 3; i++ {
+	defer fmt.Print(i)
+}
+
+// f returns 1
+func f() (result int) {
+	defer func() {
+		result++
+	}()
+	return 0
+}
+
+ +

Built-in functions

+ +

+Built-in functions are +predeclared. +They are called like any other function but some of them +accept a type instead of an expression as the first argument. +

+ +

+The built-in functions do not have standard Go types, +so they can only appear in call expressions; +they cannot be used as function values. +

+ +

Close

+ +

+For a channel c, the built-in function close(c) +records that no more values will be sent on the channel. +It is an error if c is a receive-only channel. +Sending to or closing a closed channel causes a run-time panic. +Closing the nil channel also causes a run-time panic. +After calling close, and after any previously +sent values have been received, receive operations will return +the zero value for the channel's type without blocking. +The multi-valued receive operation +returns a received value along with an indication of whether the channel is closed. +

+ + +

Length and capacity

+ +

+The built-in functions len and cap take arguments +of various types and return a result of type int. +The implementation guarantees that the result always fits into an int. +

+ +
+Call      Argument type    Result
+
+len(s)    string type      string length in bytes
+          [n]T, *[n]T      array length (== n)
+          []T              slice length
+          map[K]T          map length (number of defined keys)
+          chan T           number of elements queued in channel buffer
+
+cap(s)    [n]T, *[n]T      array length (== n)
+          []T              slice capacity
+          chan T           channel buffer capacity
+
+ +

+The capacity of a slice is the number of elements for which there is +space allocated in the underlying array. +At any time the following relationship holds: +

+ +
+0 <= len(s) <= cap(s)
+
+ +

+The length of a nil slice, map or channel is 0. +The capacity of a nil slice or channel is 0. +

+ +

+The expression len(s) is constant if +s is a string constant. The expressions len(s) and +cap(s) are constants if the type of s is an array +or pointer to an array and the expression s does not contain +channel receives or (non-constant) +function calls; in this case s is not evaluated. +Otherwise, invocations of len and cap are not +constant and s is evaluated. +

+ +
+const (
+	c1 = imag(2i)                    // imag(2i) = 2.0 is a constant
+	c2 = len([10]float64{2})         // [10]float64{2} contains no function calls
+	c3 = len([10]float64{c1})        // [10]float64{c1} contains no function calls
+	c4 = len([10]float64{imag(2i)})  // imag(2i) is a constant and no function call is issued
+	c5 = len([10]float64{imag(z)})   // invalid: imag(z) is a (non-constant) function call
+)
+var z complex128
+
+ +

Allocation

+ +

+The built-in function new takes a type T, +allocates storage for a variable of that type +at run time, and returns a value of type *T +pointing to it. +The variable is initialized as described in the section on +initial values. +

+ +
+new(T)
+
+ +

+For instance +

+ +
+type S struct { a int; b float64 }
+new(S)
+
+ +

+allocates storage for a variable of type S, +initializes it (a=0, b=0.0), +and returns a value of type *S containing the address +of the location. +

+ +

Making slices, maps and channels

+ +

+The built-in function make takes a type T, +which must be a slice, map or channel type, +optionally followed by a type-specific list of expressions. +It returns a value of type T (not *T). +The memory is initialized as described in the section on +initial values. +

+ +
+Call             Type T     Result
+
+make(T, n)       slice      slice of type T with length n and capacity n
+make(T, n, m)    slice      slice of type T with length n and capacity m
+
+make(T)          map        map of type T
+make(T, n)       map        map of type T with initial space for n elements
+
+make(T)          channel    unbuffered channel of type T
+make(T, n)       channel    buffered channel of type T, buffer size n
+
+ + +

+The size arguments n and m must be of integer type or untyped. +A constant size argument must be non-negative and +representable by a value of type int. +If both n and m are provided and are constant, then +n must be no larger than m. +If n is negative or larger than m at run time, +a run-time panic occurs. +

+ +
+s := make([]int, 10, 100)       // slice with len(s) == 10, cap(s) == 100
+s := make([]int, 1e3)           // slice with len(s) == cap(s) == 1000
+s := make([]int, 1<<63)         // illegal: len(s) is not representable by a value of type int
+s := make([]int, 10, 0)         // illegal: len(s) > cap(s)
+c := make(chan int, 10)         // channel with a buffer size of 10
+m := make(map[string]int, 100)  // map with initial space for 100 elements
+
+ + +

Appending to and copying slices

+ +

+The built-in functions append and copy assist in +common slice operations. +For both functions, the result is independent of whether the memory referenced +by the arguments overlaps. +

+ +

+The variadic function append +appends zero or more values x +to s of type S, which must be a slice type, and +returns the resulting slice, also of type S. +The values x are passed to a parameter of type ...T +where T is the element type of +S and the respective +parameter passing rules apply. +As a special case, append also accepts a first argument +assignable to type []byte with a second argument of +string type followed by .... This form appends the +bytes of the string. +

+ +
+append(s S, x ...T) S  // T is the element type of S
+
+ +

+If the capacity of s is not large enough to fit the additional +values, append allocates a new, sufficiently large underlying +array that fits both the existing slice elements and the additional values. +Otherwise, append re-uses the underlying array. +

+ +
+s0 := []int{0, 0}
+s1 := append(s0, 2)                // append a single element     s1 == []int{0, 0, 2}
+s2 := append(s1, 3, 5, 7)          // append multiple elements    s2 == []int{0, 0, 2, 3, 5, 7}
+s3 := append(s2, s0...)            // append a slice              s3 == []int{0, 0, 2, 3, 5, 7, 0, 0}
+s4 := append(s3[3:6], s3[2:]...)   // append overlapping slice    s4 == []int{3, 5, 7, 2, 3, 5, 7, 0, 0}
+
+var t []interface{}
+t = append(t, 42, 3.1415, "foo")   //                             t == []interface{}{42, 3.1415, "foo"}
+
+var b []byte
+b = append(b, "bar"...)            // append string contents      b == []byte{'b', 'a', 'r' }
+
+ +

+The function copy copies slice elements from +a source src to a destination dst and returns the +number of elements copied. +Both arguments must have identical element type T and must be +assignable to a slice of type []T. +The number of elements copied is the minimum of +len(src) and len(dst). +As a special case, copy also accepts a destination argument assignable +to type []byte with a source argument of a string type. +This form copies the bytes from the string into the byte slice. +

+ +
+copy(dst, src []T) int
+copy(dst []byte, src string) int
+
+ +

+Examples: +

+ +
+var a = [...]int{0, 1, 2, 3, 4, 5, 6, 7}
+var s = make([]int, 6)
+var b = make([]byte, 5)
+n1 := copy(s, a[0:])            // n1 == 6, s == []int{0, 1, 2, 3, 4, 5}
+n2 := copy(s, s[2:])            // n2 == 4, s == []int{2, 3, 4, 5, 4, 5}
+n3 := copy(b, "Hello, World!")  // n3 == 5, b == []byte("Hello")
+
+ + +

Deletion of map elements

+ +

+The built-in function delete removes the element with key +k from a map m. The +type of k must be assignable +to the key type of m. +

+ +
+delete(m, k)  // remove element m[k] from map m
+
+ +

+If the map m is nil or the element m[k] +does not exist, delete is a no-op. +

+ + +

Manipulating complex numbers

+ +

+Three functions assemble and disassemble complex numbers. +The built-in function complex constructs a complex +value from a floating-point real and imaginary part, while +real and imag +extract the real and imaginary parts of a complex value. +

+ +
+complex(realPart, imaginaryPart floatT) complexT
+real(complexT) floatT
+imag(complexT) floatT
+
+ +

+The type of the arguments and return value correspond. +For complex, the two arguments must be of the same +floating-point type and the return type is the complex type +with the corresponding floating-point constituents: +complex64 for float32 arguments, and +complex128 for float64 arguments. +If one of the arguments evaluates to an untyped constant, it is first +converted to the type of the other argument. +If both arguments evaluate to untyped constants, they must be non-complex +numbers or their imaginary parts must be zero, and the return value of +the function is an untyped complex constant. +

+ +

+For real and imag, the argument must be +of complex type, and the return type is the corresponding floating-point +type: float32 for a complex64 argument, and +float64 for a complex128 argument. +If the argument evaluates to an untyped constant, it must be a number, +and the return value of the function is an untyped floating-point constant. +

+ +

+The real and imag functions together form the inverse of +complex, so for a value z of a complex type Z, +z == Z(complex(real(z), imag(z))). +

+ +

+If the operands of these functions are all constants, the return +value is a constant. +

+ +
+var a = complex(2, -2)             // complex128
+const b = complex(1.0, -1.4)       // untyped complex constant 1 - 1.4i
+x := float32(math.Cos(math.Pi/2))  // float32
+var c64 = complex(5, -x)           // complex64
+const s uint = complex(1, 0)       // untyped complex constant 1 + 0i can be converted to uint
+_ = complex(1, 2<<s)               // illegal: 2 has floating-point type, cannot shift
+var rl = real(c64)                 // float32
+var im = imag(a)                   // float64
+const c = imag(b)                  // untyped constant -1.4
+_ = imag(3 << s)                   // illegal: 3 has complex type, cannot shift
+
+ +

Handling panics

+ +

Two built-in functions, panic and recover, +assist in reporting and handling run-time panics +and program-defined error conditions. +

+ +
+func panic(interface{})
+func recover() interface{}
+
+ +

+While executing a function F, +an explicit call to panic or a run-time panic +terminates the execution of F. +Any functions deferred by F +are then executed as usual. +Next, any deferred functions run by F's caller are run, +and so on up to any deferred by the top-level function in the executing goroutine. +At that point, the program is terminated and the error +condition is reported, including the value of the argument to panic. +This termination sequence is called panicking. +

+ +
+panic(42)
+panic("unreachable")
+panic(Error("cannot parse"))
+
+ +

+The recover function allows a program to manage behavior +of a panicking goroutine. +Suppose a function G defers a function D that calls +recover and a panic occurs in a function on the same goroutine in which G +is executing. +When the running of deferred functions reaches D, +the return value of D's call to recover will be the value passed to the call of panic. +If D returns normally, without starting a new +panic, the panicking sequence stops. In that case, +the state of functions called between G and the call to panic +is discarded, and normal execution resumes. +Any functions deferred by G before D are then run and G's +execution terminates by returning to its caller. +

+ +

+The return value of recover is nil if any of the following conditions holds: +

+
    +
  • +panic's argument was nil; +
  • +
  • +the goroutine is not panicking; +
  • +
  • +recover was not called directly by a deferred function. +
  • +
+ +

+The protect function in the example below invokes +the function argument g and protects callers from +run-time panics raised by g. +

+ +
+func protect(g func()) {
+	defer func() {
+		log.Println("done")  // Println executes normally even if there is a panic
+		if x := recover(); x != nil {
+			log.Printf("run time panic: %v", x)
+		}
+	}()
+	log.Println("start")
+	g()
+}
+
+ + +

Bootstrapping

+ +

+Current implementations provide several built-in functions useful during +bootstrapping. These functions are documented for completeness but are not +guaranteed to stay in the language. They do not return a result. +

+ +
+Function   Behavior
+
+print      prints all arguments; formatting of arguments is implementation-specific
+println    like print but prints spaces between arguments and a newline at the end
+
+ + +

Packages

+ +

+Go programs are constructed by linking together packages. +A package in turn is constructed from one or more source files +that together declare constants, types, variables and functions +belonging to the package and which are accessible in all files +of the same package. Those elements may be +exported and used in another package. +

+ +

Source file organization

+ +

+Each source file consists of a package clause defining the package +to which it belongs, followed by a possibly empty set of import +declarations that declare packages whose contents it wishes to use, +followed by a possibly empty set of declarations of functions, +types, variables, and constants. +

+ +
+SourceFile       = PackageClause ";" { ImportDecl ";" } { TopLevelDecl ";" } .
+
+ +

Package clause

+ +

+A package clause begins each source file and defines the package +to which the file belongs. +

+ +
+PackageClause  = "package" PackageName .
+PackageName    = identifier .
+
+ +

+The PackageName must not be the blank identifier. +

+ +
+package math
+
+ +

+A set of files sharing the same PackageName form the implementation of a package. +An implementation may require that all source files for a package inhabit the same directory. +

+ +

Import declarations

+ +

+An import declaration states that the source file containing the declaration +depends on functionality of the imported package +(§Program initialization and execution) +and enables access to exported identifiers +of that package. +The import names an identifier (PackageName) to be used for access and an ImportPath +that specifies the package to be imported. +

+ +
+ImportDecl       = "import" ( ImportSpec | "(" { ImportSpec ";" } ")" ) .
+ImportSpec       = [ "." | PackageName ] ImportPath .
+ImportPath       = string_lit .
+
+ +

+The PackageName is used in qualified identifiers +to access exported identifiers of the package within the importing source file. +It is declared in the file block. +If the PackageName is omitted, it defaults to the identifier specified in the +package clause of the imported package. +If an explicit period (.) appears instead of a name, all the +package's exported identifiers declared in that package's +package block will be declared in the importing source +file's file block and must be accessed without a qualifier. +

+ +

+The interpretation of the ImportPath is implementation-dependent but +it is typically a substring of the full file name of the compiled +package and may be relative to a repository of installed packages. +

+ +

+Implementation restriction: A compiler may restrict ImportPaths to +non-empty strings using only characters belonging to +Unicode's +L, M, N, P, and S general categories (the Graphic characters without +spaces) and may also exclude the characters +!"#$%&'()*,:;<=>?[\]^`{|} +and the Unicode replacement character U+FFFD. +

+ +

+Assume we have compiled a package containing the package clause +package math, which exports function Sin, and +installed the compiled package in the file identified by +"lib/math". +This table illustrates how Sin is accessed in files +that import the package after the +various types of import declaration. +

+ +
+Import declaration          Local name of Sin
+
+import   "lib/math"         math.Sin
+import m "lib/math"         m.Sin
+import . "lib/math"         Sin
+
+ +

+An import declaration declares a dependency relation between +the importing and imported package. +It is illegal for a package to import itself, directly or indirectly, +or to directly import a package without +referring to any of its exported identifiers. To import a package solely for +its side-effects (initialization), use the blank +identifier as explicit package name: +

+ +
+import _ "lib/math"
+
+ + +

An example package

+ +

+Here is a complete Go package that implements a concurrent prime sieve. +

+ +
+package main
+
+import "fmt"
+
+// Send the sequence 2, 3, 4, … to channel 'ch'.
+func generate(ch chan<- int) {
+	for i := 2; ; i++ {
+		ch <- i  // Send 'i' to channel 'ch'.
+	}
+}
+
+// Copy the values from channel 'src' to channel 'dst',
+// removing those divisible by 'prime'.
+func filter(src <-chan int, dst chan<- int, prime int) {
+	for i := range src {  // Loop over values received from 'src'.
+		if i%prime != 0 {
+			dst <- i  // Send 'i' to channel 'dst'.
+		}
+	}
+}
+
+// The prime sieve: Daisy-chain filter processes together.
+func sieve() {
+	ch := make(chan int)  // Create a new channel.
+	go generate(ch)       // Start generate() as a subprocess.
+	for {
+		prime := <-ch
+		fmt.Print(prime, "\n")
+		ch1 := make(chan int)
+		go filter(ch, ch1, prime)
+		ch = ch1
+	}
+}
+
+func main() {
+	sieve()
+}
+
+ +

Program initialization and execution

+ +

The zero value

+

+When storage is allocated for a variable, +either through a declaration or a call of new, or when +a new value is created, either through a composite literal or a call +of make, +and no explicit initialization is provided, the variable or value is +given a default value. Each element of such a variable or value is +set to the zero value for its type: false for booleans, +0 for integers, 0.0 for floats, "" +for strings, and nil for pointers, functions, interfaces, slices, channels, and maps. +This initialization is done recursively, so for instance each element of an +array of structs will have its fields zeroed if no value is specified. +

+

+These two simple declarations are equivalent: +

+ +
+var i int
+var i int = 0
+
+ +

+After +

+ +
+type T struct { i int; f float64; next *T }
+t := new(T)
+
+ +

+the following holds: +

+ +
+t.i == 0
+t.f == 0.0
+t.next == nil
+
+ +

+The same would also be true after +

+ +
+var t T
+
+ +

Package initialization

+ +

+Within a package, package-level variables are initialized in +declaration order but after any of the variables +they depend on. +

+ +

+More precisely, a package-level variable is considered ready for +initialization if it is not yet initialized and either has +no initialization expression or +its initialization expression has no dependencies on uninitialized variables. +Initialization proceeds by repeatedly initializing the next package-level +variable that is earliest in declaration order and ready for initialization, +until there are no variables ready for initialization. +

+ +

+If any variables are still uninitialized when this +process ends, those variables are part of one or more initialization cycles, +and the program is not valid. +

+ +

+The declaration order of variables declared in multiple files is determined +by the order in which the files are presented to the compiler: Variables +declared in the first file are declared before any of the variables declared +in the second file, and so on. +

+ +

+Dependency analysis does not rely on the actual values of the +variables, only on lexical references to them in the source, +analyzed transitively. For instance, if a variable x's +initialization expression refers to a function whose body refers to +variable y then x depends on y. +Specifically: +

+ +
    +
  • +A reference to a variable or function is an identifier denoting that +variable or function. +
  • + +
  • +A reference to a method m is a +method value or +method expression of the form +t.m, where the (static) type of t is +not an interface type, and the method m is in the +method set of t. +It is immaterial whether the resulting function value +t.m is invoked. +
  • + +
  • +A variable, function, or method x depends on a variable +y if x's initialization expression or body +(for functions and methods) contains a reference to y +or to a function or method that depends on y. +
  • +
+ +

+Dependency analysis is performed per package; only references referring +to variables, functions, and methods declared in the current package +are considered. +

+ +

+For example, given the declarations +

+ +
+var (
+	a = c + b
+	b = f()
+	c = f()
+	d = 3
+)
+
+func f() int {
+	d++
+	return d
+}
+
+ +

+the initialization order is d, b, c, a. +

+ +

+Variables may also be initialized using functions named init +declared in the package block, with no arguments and no result parameters. +

+ +
+func init() { … }
+
+ +

+Multiple such functions may be defined, even within a single +source file. The init identifier is not +declared and thus +init functions cannot be referred to from anywhere +in a program. +

+ +

+A package with no imports is initialized by assigning initial values +to all its package-level variables followed by calling all init +functions in the order they appear in the source, possibly in multiple files, +as presented to the compiler. +If a package has imports, the imported packages are initialized +before initializing the package itself. If multiple packages import +a package, the imported package will be initialized only once. +The importing of packages, by construction, guarantees that there +can be no cyclic initialization dependencies. +

+ +

+Package initialization—variable initialization and the invocation of +init functions—happens in a single goroutine, +sequentially, one package at a time. +An init function may launch other goroutines, which can run +concurrently with the initialization code. However, initialization +always sequences +the init functions: it will not invoke the next one +until the previous one has returned. +

+ +

+To ensure reproducible initialization behavior, build systems are encouraged +to present multiple files belonging to the same package in lexical file name +order to a compiler. +

+ + +

Program execution

+

+A complete program is created by linking a single, unimported package +called the main package with all the packages it imports, transitively. +The main package must +have package name main and +declare a function main that takes no +arguments and returns no value. +

+ +
+func main() { … }
+
+ +

+Program execution begins by initializing the main package and then +invoking the function main. +When that function invocation returns, the program exits. +It does not wait for other (non-main) goroutines to complete. +

+ +

Errors

+ +

+The predeclared type error is defined as +

+ +
+type error interface {
+	Error() string
+}
+
+ +

+It is the conventional interface for representing an error condition, +with the nil value representing no error. +For instance, a function to read data from a file might be defined: +

+ +
+func Read(f *File, b []byte) (n int, err error)
+
+ +

Run-time panics

+ +

+Execution errors such as attempting to index an array out +of bounds trigger a run-time panic equivalent to a call of +the built-in function panic +with a value of the implementation-defined interface type runtime.Error. +That type satisfies the predeclared interface type +error. +The exact error values that +represent distinct run-time error conditions are unspecified. +

+ +
+package runtime
+
+type Error interface {
+	error
+	// and perhaps other methods
+}
+
+ +

System considerations

+ +

Package unsafe

+ +

+The built-in package unsafe, known to the compiler, +provides facilities for low-level programming including operations +that violate the type system. A package using unsafe +must be vetted manually for type safety and may not be portable. +The package provides the following interface: +

+ +
+package unsafe
+
+type ArbitraryType int  // shorthand for an arbitrary Go type; it is not a real type
+type Pointer *ArbitraryType
+
+func Alignof(variable ArbitraryType) uintptr
+func Offsetof(selector ArbitraryType) uintptr
+func Sizeof(variable ArbitraryType) uintptr
+
+ +

+A Pointer is a pointer type but a Pointer +value may not be dereferenced. +Any pointer or value of underlying type uintptr can be converted to +a Pointer type and vice versa. +The effect of converting between Pointer and uintptr is implementation-defined. +

+ +
+var f float64
+bits = *(*uint64)(unsafe.Pointer(&f))
+
+type ptr unsafe.Pointer
+bits = *(*uint64)(ptr(&f))
+
+var p ptr = nil
+
+ +

+The functions Alignof and Sizeof take an expression x +of any type and return the alignment or size, respectively, of a hypothetical variable v +as if v was declared via var v = x. +

+

+The function Offsetof takes a (possibly parenthesized) selector +s.f, denoting a field f of the struct denoted by s +or *s, and returns the field offset in bytes relative to the struct's address. +If f is an embedded field, it must be reachable +without pointer indirections through fields of the struct. +For a struct s with field f: +

+ +
+uintptr(unsafe.Pointer(&s)) + unsafe.Offsetof(s.f) == uintptr(unsafe.Pointer(&s.f))
+
+ +

+Computer architectures may require memory addresses to be aligned; +that is, for addresses of a variable to be a multiple of a factor, +the variable's type's alignment. The function Alignof +takes an expression denoting a variable of any type and returns the +alignment of the (type of the) variable in bytes. For a variable +x: +

+ +
+uintptr(unsafe.Pointer(&x)) % unsafe.Alignof(x) == 0
+
+ +

+Calls to Alignof, Offsetof, and +Sizeof are compile-time constant expressions of type uintptr. +

+ +

Size and alignment guarantees

+ +

+For the numeric types, the following sizes are guaranteed: +

+ +
+type                                 size in bytes
+
+byte, uint8, int8                     1
+uint16, int16                         2
+uint32, int32, float32                4
+uint64, int64, float64, complex64     8
+complex128                           16
+
+ +

+The following minimal alignment properties are guaranteed: +

+
    +
  1. For a variable x of any type: unsafe.Alignof(x) is at least 1. +
  2. + +
  3. For a variable x of struct type: unsafe.Alignof(x) is the largest of + all the values unsafe.Alignof(x.f) for each field f of x, but at least 1. +
  4. + +
  5. For a variable x of array type: unsafe.Alignof(x) is the same as + unsafe.Alignof(x[0]), but at least 1. +
  6. +
+ +

+A struct or array type has size zero if it contains no fields (or elements, respectively) that have a size greater than zero. Two distinct zero-size variables may have the same address in memory. +

diff --git a/doc/gopher/README b/doc/gopher/README new file mode 100644 index 0000000000000000000000000000000000000000..d4ca8a1c2dc1ef2354e1a3c6861271572ae67005 --- /dev/null +++ b/doc/gopher/README @@ -0,0 +1,3 @@ +The Go gopher was designed by Renee French. (http://reneefrench.blogspot.com/) +The design is licensed under the Creative Commons 3.0 Attributions license. +Read this article for more details: https://blog.golang.org/gopher diff --git a/doc/gopher/appenginegopher.jpg b/doc/gopher/appenginegopher.jpg new file mode 100644 index 0000000000000000000000000000000000000000..0a64306666a6f9506c551760718cd3af71cd0e69 Binary files /dev/null and b/doc/gopher/appenginegopher.jpg differ diff --git a/doc/gopher/appenginegophercolor.jpg b/doc/gopher/appenginegophercolor.jpg new file mode 100644 index 0000000000000000000000000000000000000000..68795a99b3d84712f638ef577789655d1e2dc7ef Binary files /dev/null and b/doc/gopher/appenginegophercolor.jpg differ diff --git a/doc/gopher/appenginelogo.gif b/doc/gopher/appenginelogo.gif new file mode 100644 index 0000000000000000000000000000000000000000..46b3c1eeb8884cf9b8cb7d8e1d698dab8b6b2c80 Binary files /dev/null and b/doc/gopher/appenginelogo.gif differ diff --git a/doc/gopher/biplane.jpg b/doc/gopher/biplane.jpg new file mode 100644 index 0000000000000000000000000000000000000000..d5e666f963281db3fa1f05df6c24bdf375e1c2f0 Binary files /dev/null and b/doc/gopher/biplane.jpg differ diff --git a/doc/gopher/bumper.png b/doc/gopher/bumper.png new file mode 100644 index 0000000000000000000000000000000000000000..b357cdf47d5ba30da0f54b853fbf4afa9429790d Binary files /dev/null and b/doc/gopher/bumper.png differ diff --git a/doc/gopher/bumper192x108.png b/doc/gopher/bumper192x108.png new file mode 100644 index 0000000000000000000000000000000000000000..925474e7638d7fc18bcf4accf53eeaec3d6dc447 Binary files /dev/null and b/doc/gopher/bumper192x108.png differ diff --git a/doc/gopher/bumper320x180.png b/doc/gopher/bumper320x180.png new file mode 100644 index 0000000000000000000000000000000000000000..611c417c4f341bb5cf1d6ab8981cc16d04c055a5 Binary files /dev/null and b/doc/gopher/bumper320x180.png differ diff --git a/doc/gopher/bumper480x270.png b/doc/gopher/bumper480x270.png new file mode 100644 index 0000000000000000000000000000000000000000..cf187151fd6a5ae7e1333b7286020e6965fdc9b8 Binary files /dev/null and b/doc/gopher/bumper480x270.png differ diff --git a/doc/gopher/bumper640x360.png b/doc/gopher/bumper640x360.png new file mode 100644 index 0000000000000000000000000000000000000000..a5073e0d1a5adb1bd7ef8778ba90d04e560dfad4 Binary files /dev/null and b/doc/gopher/bumper640x360.png differ diff --git a/doc/gopher/doc.png b/doc/gopher/doc.png new file mode 100644 index 0000000000000000000000000000000000000000..e15a3234d5d2c87e4e6afc226d971e8ab0c65d2b Binary files /dev/null and b/doc/gopher/doc.png differ diff --git a/doc/gopher/fiveyears.jpg b/doc/gopher/fiveyears.jpg new file mode 100644 index 0000000000000000000000000000000000000000..df1064868ef8fac1d0b3d66617e470266d70e7f1 Binary files /dev/null and b/doc/gopher/fiveyears.jpg differ diff --git a/doc/gopher/frontpage.png b/doc/gopher/frontpage.png new file mode 100644 index 0000000000000000000000000000000000000000..1eb81f0bef7b8dd192528e979b942584086ee112 Binary files /dev/null and b/doc/gopher/frontpage.png differ diff --git a/doc/gopher/gopherbw.png b/doc/gopher/gopherbw.png new file mode 100644 index 0000000000000000000000000000000000000000..3bfe85dc16fc7c691010a088ea467f8159697d08 Binary files /dev/null and b/doc/gopher/gopherbw.png differ diff --git a/doc/gopher/gophercolor.png b/doc/gopher/gophercolor.png new file mode 100644 index 0000000000000000000000000000000000000000..b5f8d01ff6a06b1beaeb11ad50d472f56dff7cd6 Binary files /dev/null and b/doc/gopher/gophercolor.png differ diff --git a/doc/gopher/gophercolor16x16.png b/doc/gopher/gophercolor16x16.png new file mode 100644 index 0000000000000000000000000000000000000000..ec7028cc111e97129b9067aebd500df2bde39f0a Binary files /dev/null and b/doc/gopher/gophercolor16x16.png differ diff --git a/doc/gopher/help.png b/doc/gopher/help.png new file mode 100644 index 0000000000000000000000000000000000000000..6ee523898d7f1bacb4264b949bf92e8b6c5fa01a Binary files /dev/null and b/doc/gopher/help.png differ diff --git a/doc/gopher/pencil/gopherhat.jpg b/doc/gopher/pencil/gopherhat.jpg new file mode 100644 index 0000000000000000000000000000000000000000..f34d7b3258b4e17df7b2110ce0669d4a534a7238 Binary files /dev/null and b/doc/gopher/pencil/gopherhat.jpg differ diff --git a/doc/gopher/pencil/gopherhelmet.jpg b/doc/gopher/pencil/gopherhelmet.jpg new file mode 100644 index 0000000000000000000000000000000000000000..c7b6c61b2be5de19e784f43131979d55981418ff Binary files /dev/null and b/doc/gopher/pencil/gopherhelmet.jpg differ diff --git a/doc/gopher/pencil/gophermega.jpg b/doc/gopher/pencil/gophermega.jpg new file mode 100644 index 0000000000000000000000000000000000000000..779fb073accf312eed597ef9571f200dc6034a23 Binary files /dev/null and b/doc/gopher/pencil/gophermega.jpg differ diff --git a/doc/gopher/pencil/gopherrunning.jpg b/doc/gopher/pencil/gopherrunning.jpg new file mode 100644 index 0000000000000000000000000000000000000000..eeeddf106f4c0742ccaaa9cd5c9b4c2c6e5f57ee Binary files /dev/null and b/doc/gopher/pencil/gopherrunning.jpg differ diff --git a/doc/gopher/pencil/gopherswim.jpg b/doc/gopher/pencil/gopherswim.jpg new file mode 100644 index 0000000000000000000000000000000000000000..2f32877121b120778ed3e360b8f9f089c59487a5 Binary files /dev/null and b/doc/gopher/pencil/gopherswim.jpg differ diff --git a/doc/gopher/pencil/gopherswrench.jpg b/doc/gopher/pencil/gopherswrench.jpg new file mode 100644 index 0000000000000000000000000000000000000000..93005f42a8abe71ffca9dde40be041dcf62381a2 Binary files /dev/null and b/doc/gopher/pencil/gopherswrench.jpg differ diff --git a/doc/gopher/pkg.png b/doc/gopher/pkg.png new file mode 100644 index 0000000000000000000000000000000000000000..ac96551b5560ae794b87e46c6882743483fb6d58 Binary files /dev/null and b/doc/gopher/pkg.png differ diff --git a/doc/gopher/project.png b/doc/gopher/project.png new file mode 100644 index 0000000000000000000000000000000000000000..24603f30689c9e360729fbb881128131049b62e0 Binary files /dev/null and b/doc/gopher/project.png differ diff --git a/doc/gopher/ref.png b/doc/gopher/ref.png new file mode 100644 index 0000000000000000000000000000000000000000..0508f6ec6164c9fcabebb999737e602826341e01 Binary files /dev/null and b/doc/gopher/ref.png differ diff --git a/doc/gopher/run.png b/doc/gopher/run.png new file mode 100644 index 0000000000000000000000000000000000000000..eb690e3f22a749bb4f2e64d002bb94b45871a7a7 Binary files /dev/null and b/doc/gopher/run.png differ diff --git a/doc/gopher/talks.png b/doc/gopher/talks.png new file mode 100644 index 0000000000000000000000000000000000000000..589db470a70e31bf4fccc8b664d871694f270c1e Binary files /dev/null and b/doc/gopher/talks.png differ diff --git a/doc/help.html b/doc/help.html new file mode 100644 index 0000000000000000000000000000000000000000..2cc47806c50f9f27dc8e9f930053d24c08273e0f --- /dev/null +++ b/doc/help.html @@ -0,0 +1,50 @@ + + + + +

+Need help with Go? Try these resources. +

+ +
+ +

Frequently Asked Questions (FAQ)

+

Answers to common questions about Go.

+ +

The Go Playground

+

A place to write, run, and share Go code.

+ +

The Go Wiki

+

A wiki maintained by the Go community.

+ +

Go Nuts Mailing List

+

+Search the golang-nuts +archives and consult the FAQ and +wiki before posting. +

+ +

Go IRC Channel

+

Get live support at #go-nuts on irc.freenode.net, the official +Go IRC channel.

+ +

The Go+ community

+

The Google+ community for Go enthusiasts.

+ +

The Go Programming Language at Google+

+

The Go project's Google+ page.

+ +

@golang at Twitter

+

The Go project's official Twitter account.

+

Tweeting about your problem with the #golang hashtag usually +generates some helpful responses.

+ +

Go User Groups

+

+Each month in places around the world, groups of Go programmers ("gophers") +meet to talk about Go. Find a chapter near you. +

+ diff --git a/doc/ie.css b/doc/ie.css new file mode 100644 index 0000000000000000000000000000000000000000..bb89d54be2236e29b5ac01be249627a83144c3a5 --- /dev/null +++ b/doc/ie.css @@ -0,0 +1 @@ +#nav-main li { display: inline; } diff --git a/doc/install-source.html b/doc/install-source.html new file mode 100644 index 0000000000000000000000000000000000000000..e71fff710f408b681ea091b535a152fc68777b4e --- /dev/null +++ b/doc/install-source.html @@ -0,0 +1,577 @@ + + +

Introduction

+ +

+Go is an open source project, distributed under a +BSD-style license. +This document explains how to check out the sources, +build them on your own machine, and run them. +

+ +

+Most users don't need to do this, and will instead install +from precompiled binary packages as described in +Getting Started, +a much simpler process. +If you want to help develop what goes into those precompiled +packages, though, read on. +

+ +
+ +

+There are two official Go compiler tool chains. +This document focuses on the gc Go +compiler and tools. +For information on how to work on gccgo, a more traditional +compiler using the GCC back end, see +Setting up and using gccgo. +

+ +

+The Go compilers support five instruction sets. +There are important differences in the quality of the compilers for the different +architectures. +

+ +
+
+ amd64 (also known as x86-64) +
+
+ A mature implementation. The compiler has an effective + optimizer (registerizer) and generates good code (although + gccgo can do noticeably better sometimes). +
+
+ 386 (x86 or x86-32) +
+
+ Comparable to the amd64 port. +
+
+ arm (ARM) +
+
+ Supports Linux, FreeBSD, NetBSD and Darwin binaries. Less widely used than the other ports. +
+
+ arm64 (AArch64) +
+
+ Supports Linux and Darwin binaries. New in 1.5 and not as well excercised as other ports. +
+
+ ppc64, ppc64le (64-bit PowerPC big- and little-endian) +
+
+ Supports Linux binaries. New in 1.5 and not as well excercised as other ports. +
+
+ +

+Except for things like low-level operating system interface code, the run-time +support is the same in all ports and includes a mark-and-sweep garbage +collector, efficient array and string slicing, and support for efficient +goroutines, such as stacks that grow and shrink on demand. +

+ +

+The compilers can target the DragonFly BSD, FreeBSD, Linux, NetBSD, OpenBSD, +OS X (Darwin), Plan 9, Solaris and Windows operating systems. +The full set of supported combinations is listed in the discussion of +environment variables below. +

+ +
+ +

Install Go compiler binaries

+ +

+The Go tool chain is written in Go. To build it, you need a Go compiler installed. +The scripts that do the initial build of the tools look for an existing Go tool +chain in $HOME/go1.4. +(This path may be overridden by setting the GOROOT_BOOTSTRAP +environment variable.) +

+ +

+Build the tools with Go version 1.4 or a point release (1.4.1, 1.4.2 etc.). +Go 1.4 binaries can be found at the downloads page. +

+ +

+Download the zip or tarball of Go 1.4 for your platform and extract it to +$HOME/go1.4 (or your nominated GOROOT_BOOTSTRAP +location). +

+ +

+If you want to install Go 1.5 on a system that is not supported by Go 1.4 (such +as linux/ppc64) you can either use +bootstrap.bash on a system that can bootstrap Go +1.5 normally, or bootstrap with gccgo 5. +

+ +

+When run as (for example) +

+ +
+$ GOOS=linux GOARCH=ppc64 ./bootstrap.bash
+
+ +

+bootstrap.bash cross-compiles a toolchain for that GOOS/GOARCH +combination, leaving the resulting tree in ../../go-${GOOS}-${GOARCH}-bootstrap. +That tree can be copied to a machine of the given target type +and used as GOROOT_BOOTSTRAP to bootstrap a local build. +

+ +

+To use gccgo, you need to arrange for $GOROOT_BOOSTRAP/bin/go to be +the go tool that comes as part of gccgo 5. For example on Ubuntu Vivid: +

+ +
+$ sudo apt-get install gccgo-5
+$ sudo update-alternatives --set go /usr/bin/go-5
+$ GOROOT_BOOTSTRAP=/usr ./make.bash
+
+ +

Install Git, if needed

+ +

+To perform the next step you must have Git installed. (Check that you +have a git command before proceeding.) +

+ +

+If you do not have a working Git installation, +follow the instructions on the +Git downloads page. +

+ + +

Fetch the repository

+ +

Go will install to a directory named go. +Change to the directory that will be its parent +and make sure the go directory does not exist. +Then clone the repository and check out the latest release tag:

+ +
+$ git clone https://go.googlesource.com/go
+$ cd go
+$ git checkout go1.5
+
+ + + +

If you intend to modify the go source code, and +contribute your changes +to the project, then move your repository +off the release branch, and onto the master (development) branch. +Otherwise, skip this step.

+ +
+$ git checkout master
+
+ +

Install Go

+ +

+To build the Go distribution, run +

+ +
+$ cd src
+$ ./all.bash
+
+ +

+(To build under Windows use all.bat.) +

+ +

+If all goes well, it will finish by printing output like: +

+ +
+ALL TESTS PASSED
+
+---
+Installed Go for linux/amd64 in /home/you/go.
+Installed commands in /home/you/go/bin.
+*** You need to add /home/you/go/bin to your $PATH. ***
+
+ +

+where the details on the last few lines reflect the operating system, +architecture, and root directory used during the install. +

+ +
+

+For more information about ways to control the build, see the discussion of +environment variables below. +all.bash (or all.bat) runs important tests for Go, +which can take more time than simply building Go. If you do not want to run +the test suite use make.bash (or make.bat) +instead. +

+
+ + +

Testing your installation

+ +

+Check that Go is installed correctly by building a simple program. +

+ +

+Create a file named hello.go and put the following program in it: +

+ +
+package main
+
+import "fmt"
+
+func main() {
+    fmt.Printf("hello, world\n")
+}
+
+ +

+Then run it with the go tool: +

+ +
+$ go run hello.go
+hello, world
+
+ +

+If you see the "hello, world" message then Go is installed correctly. +

+ +

Set up your work environment

+ +

+You're almost done. +You just need to do a little more setup. +

+ +

+ +How to Write Go Code +Learn how to set up and use the Go tools + +

+ +

+The How to Write Go Code document +provides essential setup instructions for using the Go tools. +

+ + +

Install additional tools

+ +

+The source code for several Go tools (including godoc) +is kept in the go.tools repository. +To install all of them, run the go get command: +

+ +
+$ go get golang.org/x/tools/cmd/...
+
+ +

+Or if you just want to install a specific command (godoc in this case): +

+ +
+$ go get golang.org/x/tools/cmd/godoc
+
+ +

+To install these tools, the go get command requires +that Git be installed locally. +

+ +

+You must also have a workspace (GOPATH) set up; +see How to Write Go Code for the details. +

+ +

+Note: The go command will install the godoc +binary to $GOROOT/bin (or $GOBIN) and the +cover and vet binaries to +$GOROOT/pkg/tool/$GOOS_$GOARCH. +You can access the latter commands with +"go tool cover" and +"go tool vet". +

+ +

Community resources

+ +

+The usual community resources such as +#go-nuts on the Freenode IRC server +and the +Go Nuts +mailing list have active developers that can help you with problems +with your installation or your development work. +For those who wish to keep up to date, +there is another mailing list, golang-checkins, +that receives a message summarizing each checkin to the Go repository. +

+ +

+Bugs can be reported using the Go issue tracker. +

+ + +

Keeping up with releases

+ +

+New releases are announced on the +golang-announce +mailing list. +Each announcement mentions the latest release tag, for instance, +go1.5. +

+ +

+To update an existing tree to the latest release, you can run: +

+ +
+$ cd go/src
+$ git fetch
+$ git checkout <tag>
+$ ./all.bash
+
+ +Where <tag> is the version string of the release. + + +

Optional environment variables

+ +

+The Go compilation environment can be customized by environment variables. +None is required by the build, but you may wish to set some +to override the defaults. +

+ +
    +
  • $GOROOT +

    +The root of the Go tree, often $HOME/go. +Its value is built into the tree when it is compiled, and +defaults to the parent of the directory where all.bash was run. +There is no need to set this unless you want to switch between multiple +local copies of the repository. +

    + +
  • $GOROOT_FINAL +

    +The value assumed by installed binaries and scripts when +$GOROOT is not set explicitly. +It defaults to the value of $GOROOT. +If you want to build the Go tree in one location +but move it elsewhere after the build, set +$GOROOT_FINAL to the eventual location. +

    + +
  • $GOOS and $GOARCH +

    +The name of the target operating system and compilation architecture. +These default to the values of $GOHOSTOS and +$GOHOSTARCH respectively (described below). + +

    +Choices for $GOOS are +darwin (Mac OS X 10.7 and above and iOS), dragonfly, freebsd, +linux, netbsd, openbsd, +plan9, solaris and windows. +Choices for $GOARCH are +amd64 (64-bit x86, the most mature port), +386 (32-bit x86), arm (32-bit ARM), arm64 (64-bit ARM), +ppc64le (PowerPC 64-bit, little-endian), and ppc64 (PowerPC 64-bit, big-endian). +The valid combinations of $GOOS and $GOARCH are: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    $GOOS $GOARCH
    darwin 386
    darwin amd64
    darwin arm
    darwin arm64
    dragonfly amd64
    freebsd 386
    freebsd amd64
    freebsd arm
    linux 386
    linux amd64
    linux arm
    linux arm64
    linux ppc64
    linux ppc64le
    netbsd 386
    netbsd amd64
    netbsd arm
    openbsd 386
    openbsd amd64
    openbsd arm
    plan9 386
    plan9 amd64
    solaris amd64
    windows 386
    windows amd64
    +
    + +

  • $GOHOSTOS and $GOHOSTARCH +

    +The name of the host operating system and compilation architecture. +These default to the local system's operating system and +architecture. +

    + +

    +Valid choices are the same as for $GOOS and +$GOARCH, listed above. +The specified values must be compatible with the local system. +For example, you should not set $GOHOSTARCH to +arm on an x86 system. +

    + +
  • $GOBIN +

    +The location where Go binaries will be installed. +The default is $GOROOT/bin. +After installing, you will want to arrange to add this +directory to your $PATH, so you can use the tools. +If $GOBIN is set, the go command +installs all commands there. +

    + +
  • $GO386 (for 386 only, default is auto-detected +if built on either 386 or amd64, 387 otherwise) +

    +This controls the code generated by gc to use either the 387 floating-point unit +(set to 387) or SSE2 instructions (set to sse2) for +floating point computations. +

    +
      +
    • GO386=387: use x87 for floating point operations; should support all x86 chips (Pentium MMX or later). +
    • GO386=sse2: use SSE2 for floating point operations; has better performance than 387, but only available on Pentium 4/Opteron/Athlon 64 or later. +
    + +
  • $GOARM (for arm only; default is auto-detected if building +on the target processor, 6 if not) +

    +This sets the ARM floating point co-processor architecture version the run-time +should target. If you are compiling on the target system, its value will be auto-detected. +

    +
      +
    • GOARM=5: use software floating point; when CPU doesn't have VFP co-processor +
    • GOARM=6: use VFPv1 only; default if cross compiling; usually ARM11 or better cores (VFPv2 or better is also supported) +
    • GOARM=7: use VFPv3; usually Cortex-A cores +
    +

    +If in doubt, leave this variable unset, and adjust it if required +when you first run the Go executable. +The GoARM page +on the Go community wiki +contains further details regarding Go's ARM support. +

    + +
+ +

+Note that $GOARCH and $GOOS identify the +target environment, not the environment you are running on. +In effect, you are always cross-compiling. +By architecture, we mean the kind of binaries +that the target environment can run: +an x86-64 system running a 32-bit-only operating system +must set GOARCH to 386, +not amd64. +

+ +

+If you choose to override the defaults, +set these variables in your shell profile ($HOME/.bashrc, +$HOME/.profile, or equivalent). The settings might look +something like this: +

+ +
+export GOROOT=$HOME/go
+export GOARCH=amd64
+export GOOS=linux
+
+ +

+although, to reiterate, none of these variables needs to be set to build, +install, and develop the Go tree. +

diff --git a/doc/install.html b/doc/install.html new file mode 100644 index 0000000000000000000000000000000000000000..e9f0f0dc095c5c920aab6d855196dbdda2c5d449 --- /dev/null +++ b/doc/install.html @@ -0,0 +1,321 @@ + + +
+ +

Download the Go distribution

+ +

+ +Download Go +Click here to visit the downloads page + +

+ +

+Official binary +distributions are available for the FreeBSD (release 8-STABLE and above), +Linux, Mac OS X (10.7 and above), and Windows operating systems and +the 32-bit (386) and 64-bit (amd64) x86 processor +architectures. +

+ +

+If a binary distribution is not available for your combination of operating +system and architecture, try +installing from source or +installing gccgo instead of gc. +

+ + +

System requirements

+ +

+Go binary distributions are available for these supported operating systems and architectures. +Please ensure your system meets these requirements before proceeding. +If your OS or architecture is not on the list, you may be able to +install from source or +use gccgo instead. +

+ + + + + + + + + + + + +
Operating systemArchitecturesNotes

FreeBSD 8-STABLE or later amd64 Debian GNU/kFreeBSD not supported
Linux 2.6.23 or later with glibc amd64, 386, arm CentOS/RHEL 5.x not supported; install from source for ARM
Mac OS X 10.7 or later amd64 use the clang or gcc that comes with Xcode
Windows XP or later amd64, 386 use MinGW gcc. No need for cygwin or msys.
+ +

+gcc is required only if you plan to use +cgo.
+You only need to install the command line tools for +Xcode. If you have already +installed Xcode 4.3+, you can install it from the Components tab of the +Downloads preferences panel. +

+ +
+ + +

Install the Go tools

+ +

+If you are upgrading from an older version of Go you must +first remove the existing version. +

+ +
+ +

Linux, Mac OS X, and FreeBSD tarballs

+ +

+Download the archive +and extract it into /usr/local, creating a Go tree in +/usr/local/go. For example: +

+ +
+tar -C /usr/local -xzf go$VERSION.$OS-$ARCH.tar.gz
+
+ +

+Choose the archive file appropriate for your installation. +For instance, if you are installing Go version 1.2.1 for 64-bit x86 on Linux, +the archive you want is called go1.2.1.linux-amd64.tar.gz. +

+ +

+(Typically these commands must be run as root or through sudo.) +

+ +

+Add /usr/local/go/bin to the PATH environment +variable. You can do this by adding this line to your /etc/profile +(for a system-wide installation) or $HOME/.profile: +

+ +
+export PATH=$PATH:/usr/local/go/bin
+
+ +

Installing to a custom location

+ +

+The Go binary distributions assume they will be installed in +/usr/local/go (or c:\Go under Windows), +but it is possible to install the Go tools to a different location. +In this case you must set the GOROOT environment variable +to point to the directory in which it was installed. +

+ +

+For example, if you installed Go to your home directory you should add the +following commands to $HOME/.profile: +

+ +
+export GOROOT=$HOME/go
+export PATH=$PATH:$GOROOT/bin
+
+ +

+Note: GOROOT must be set only when installing to a custom +location. +

+ +
+ +
+ +

Mac OS X package installer

+ +

+Download the package file, +open it, and follow the prompts to install the Go tools. +The package installs the Go distribution to /usr/local/go. +

+ +

+The package should put the /usr/local/go/bin directory in your +PATH environment variable. You may need to restart any open +Terminal sessions for the change to take effect. +

+ +
+ +
+ +

Windows

+ +

+The Go project provides two installation options for Windows users +(besides installing from source): +a zip archive that requires you to set some environment variables and an +MSI installer that configures your installation automatically. +

+ +
+ +

MSI installer

+ +

+Open the MSI file +and follow the prompts to install the Go tools. +By default, the installer puts the Go distribution in c:\Go. +

+ +

+The installer should put the c:\Go\bin directory in your +PATH environment variable. You may need to restart any open +command prompts for the change to take effect. +

+ +
+ +
+ +

Zip archive

+ +

+Download the zip file and extract it into the directory of your choice (we suggest c:\Go). +

+ +

+If you chose a directory other than c:\Go, +you must set the GOROOT environment variable to your chosen path. +

+ +

+Add the bin subdirectory of your Go root (for example, c:\Go\bin) to your PATH environment variable. +

+ +
+ +

Setting environment variables under Windows

+ +

+Under Windows, you may set environment variables through the "Environment +Variables" button on the "Advanced" tab of the "System" control panel. Some +versions of Windows provide this control panel through the "Advanced System +Settings" option inside the "System" control panel. +

+ +
+ + +

Test your installation

+ +

+Check that Go is installed correctly by setting up a workspace +and building a simple program, as follows. +

+ +

+Create a directory to contain your workspace, +$HOME/work for example, and set the GOPATH environment +variable to point to that location. +

+ +
+$ export GOPATH=$HOME/work
+
+ +

+You should put the above command in your shell startup script +($HOME/.profile for example) or, if you use Windows, +follow the instructions above to set the +GOPATH environment variable on your system. +

+ +

+Next, make the directories src/github.com/user/hello inside your +workspace (if you use GitHub, substitute your user name for user), +and inside the hello directory create a file named hello.go +with the following contents: +

+ +
+package main
+
+import "fmt"
+
+func main() {
+    fmt.Printf("hello, world\n")
+}
+
+ +

+Then compile it with the go tool: +

+ +
+$ go install github.com/user/hello
+
+ +

+The above command will put an executable command named hello +(or hello.exe) inside the bin directory of your workspace. +Execute the command to see the greeting: +

+ +
+$ $GOPATH/bin/hello
+hello, world
+
+ +

+If you see the "hello, world" message then your Go installation is working. +

+ +

+Before rushing off to write Go code please read the +How to Write Go Code document, +which describes some essential concepts about using the Go tools. +

+ + +

Uninstalling Go

+ +

+To remove an existing Go installation from your system delete the +go directory. This is usually /usr/local/go +under Linux, Mac OS X, and FreeBSD or c:\Go +under Windows. +

+ +

+You should also remove the Go bin directory from your +PATH environment variable. +Under Linux and FreeBSD you should edit /etc/profile or +$HOME/.profile. +If you installed Go with the Mac OS X package then you +should remove the /etc/paths.d/go file. +Windows users should read the section about setting +environment variables under Windows. +

+ + +

Getting help

+ +

+For real-time help, ask the helpful gophers in #go-nuts on the +Freenode IRC server. +

+ +

+The official mailing list for discussion of the Go language is +Go Nuts. +

+ +

+Report bugs using the +Go issue tracker. +

diff --git a/doc/play/fib.go b/doc/play/fib.go new file mode 100644 index 0000000000000000000000000000000000000000..19e4721028685f99d54eec4719001d2544afd3d8 --- /dev/null +++ b/doc/play/fib.go @@ -0,0 +1,19 @@ +package main + +import "fmt" + +// fib returns a function that returns +// successive Fibonacci numbers. +func fib() func() int { + a, b := 0, 1 + return func() int { + a, b = b, a+b + return a + } +} + +func main() { + f := fib() + // Function calls are evaluated left-to-right. + fmt.Println(f(), f(), f(), f(), f()) +} diff --git a/doc/play/hello.go b/doc/play/hello.go new file mode 100644 index 0000000000000000000000000000000000000000..078ddff8f414f4fca4bac1fad017cedafd6681b1 --- /dev/null +++ b/doc/play/hello.go @@ -0,0 +1,7 @@ +package main + +import "fmt" + +func main() { + fmt.Println("Hello, 世界") +} diff --git a/doc/play/life.go b/doc/play/life.go new file mode 100644 index 0000000000000000000000000000000000000000..51afb61f3dea979f35983dbf8c26b685e67c8184 --- /dev/null +++ b/doc/play/life.go @@ -0,0 +1,113 @@ +// An implementation of Conway's Game of Life. +package main + +import ( + "bytes" + "fmt" + "math/rand" + "time" +) + +// Field represents a two-dimensional field of cells. +type Field struct { + s [][]bool + w, h int +} + +// NewField returns an empty field of the specified width and height. +func NewField(w, h int) *Field { + s := make([][]bool, h) + for i := range s { + s[i] = make([]bool, w) + } + return &Field{s: s, w: w, h: h} +} + +// Set sets the state of the specified cell to the given value. +func (f *Field) Set(x, y int, b bool) { + f.s[y][x] = b +} + +// Alive reports whether the specified cell is alive. +// If the x or y coordinates are outside the field boundaries they are wrapped +// toroidally. For instance, an x value of -1 is treated as width-1. +func (f *Field) Alive(x, y int) bool { + x += f.w + x %= f.w + y += f.h + y %= f.h + return f.s[y][x] +} + +// Next returns the state of the specified cell at the next time step. +func (f *Field) Next(x, y int) bool { + // Count the adjacent cells that are alive. + alive := 0 + for i := -1; i <= 1; i++ { + for j := -1; j <= 1; j++ { + if (j != 0 || i != 0) && f.Alive(x+i, y+j) { + alive++ + } + } + } + // Return next state according to the game rules: + // exactly 3 neighbors: on, + // exactly 2 neighbors: maintain current state, + // otherwise: off. + return alive == 3 || alive == 2 && f.Alive(x, y) +} + +// Life stores the state of a round of Conway's Game of Life. +type Life struct { + a, b *Field + w, h int +} + +// NewLife returns a new Life game state with a random initial state. +func NewLife(w, h int) *Life { + a := NewField(w, h) + for i := 0; i < (w * h / 4); i++ { + a.Set(rand.Intn(w), rand.Intn(h), true) + } + return &Life{ + a: a, b: NewField(w, h), + w: w, h: h, + } +} + +// Step advances the game by one instant, recomputing and updating all cells. +func (l *Life) Step() { + // Update the state of the next field (b) from the current field (a). + for y := 0; y < l.h; y++ { + for x := 0; x < l.w; x++ { + l.b.Set(x, y, l.a.Next(x, y)) + } + } + // Swap fields a and b. + l.a, l.b = l.b, l.a +} + +// String returns the game board as a string. +func (l *Life) String() string { + var buf bytes.Buffer + for y := 0; y < l.h; y++ { + for x := 0; x < l.w; x++ { + b := byte(' ') + if l.a.Alive(x, y) { + b = '*' + } + buf.WriteByte(b) + } + buf.WriteByte('\n') + } + return buf.String() +} + +func main() { + l := NewLife(40, 15) + for i := 0; i < 300; i++ { + l.Step() + fmt.Print("\x0c", l) // Clear screen and print field. + time.Sleep(time.Second / 30) + } +} diff --git a/doc/play/peano.go b/doc/play/peano.go new file mode 100644 index 0000000000000000000000000000000000000000..214fe1b6133db13558172e1740d8b7547beee464 --- /dev/null +++ b/doc/play/peano.go @@ -0,0 +1,88 @@ +// Peano integers are represented by a linked +// list whose nodes contain no data +// (the nodes are the data). +// http://en.wikipedia.org/wiki/Peano_axioms + +// This program demonstrates that Go's automatic +// stack management can handle heavily recursive +// computations. + +package main + +import "fmt" + +// Number is a pointer to a Number +type Number *Number + +// The arithmetic value of a Number is the +// count of the nodes comprising the list. +// (See the count function below.) + +// ------------------------------------- +// Peano primitives + +func zero() *Number { + return nil +} + +func isZero(x *Number) bool { + return x == nil +} + +func add1(x *Number) *Number { + e := new(Number) + *e = x + return e +} + +func sub1(x *Number) *Number { + return *x +} + +func add(x, y *Number) *Number { + if isZero(y) { + return x + } + return add(add1(x), sub1(y)) +} + +func mul(x, y *Number) *Number { + if isZero(x) || isZero(y) { + return zero() + } + return add(mul(x, sub1(y)), x) +} + +func fact(n *Number) *Number { + if isZero(n) { + return add1(zero()) + } + return mul(fact(sub1(n)), n) +} + +// ------------------------------------- +// Helpers to generate/count Peano integers + +func gen(n int) *Number { + if n > 0 { + return add1(gen(n - 1)) + } + return zero() +} + +func count(x *Number) int { + if isZero(x) { + return 0 + } + return count(sub1(x)) + 1 +} + +// ------------------------------------- +// Print i! for i in [0,9] + +func main() { + for i := 0; i <= 9; i++ { + f := count(fact(gen(i))) + fmt.Println(i, "! =", f) + } +} diff --git a/doc/play/pi.go b/doc/play/pi.go new file mode 100644 index 0000000000000000000000000000000000000000..f2f5dca748f5163f2ec14b3ff98bb3c346b48dec --- /dev/null +++ b/doc/play/pi.go @@ -0,0 +1,34 @@ +// Concurrent computation of pi. +// See http://goo.gl/ZuTZM. +// +// This demonstrates Go's ability to handle +// large numbers of concurrent processes. +// It is an unreasonable way to calculate pi. +package main + +import ( + "fmt" + "math" +) + +func main() { + fmt.Println(pi(5000)) +} + +// pi launches n goroutines to compute an +// approximation of pi. +func pi(n int) float64 { + ch := make(chan float64) + for k := 0; k <= n; k++ { + go term(ch, float64(k)) + } + f := 0.0 + for k := 0; k <= n; k++ { + f += <-ch + } + return f +} + +func term(ch chan float64, k float64) { + ch <- 4 * math.Pow(-1, k) / (2*k + 1) +} diff --git a/doc/play/sieve.go b/doc/play/sieve.go new file mode 100644 index 0000000000000000000000000000000000000000..519093453f7d272f71fbc02e065d2987f2a953f9 --- /dev/null +++ b/doc/play/sieve.go @@ -0,0 +1,36 @@ +// A concurrent prime sieve + +package main + +import "fmt" + +// Send the sequence 2, 3, 4, ... to channel 'ch'. +func Generate(ch chan<- int) { + for i := 2; ; i++ { + ch <- i // Send 'i' to channel 'ch'. + } +} + +// Copy the values from channel 'in' to channel 'out', +// removing those divisible by 'prime'. +func Filter(in <-chan int, out chan<- int, prime int) { + for { + i := <-in // Receive value from 'in'. + if i%prime != 0 { + out <- i // Send 'i' to 'out'. + } + } +} + +// The prime sieve: Daisy-chain Filter processes. +func main() { + ch := make(chan int) // Create a new channel. + go Generate(ch) // Launch Generate goroutine. + for i := 0; i < 10; i++ { + prime := <-ch + fmt.Println(prime) + ch1 := make(chan int) + go Filter(ch, ch1, prime) + ch = ch1 + } +} diff --git a/doc/play/solitaire.go b/doc/play/solitaire.go new file mode 100644 index 0000000000000000000000000000000000000000..15022aa1949dcd17017b8cd74c853fc047295a8c --- /dev/null +++ b/doc/play/solitaire.go @@ -0,0 +1,117 @@ +// This program solves the (English) peg +// solitaire board game. +// http://en.wikipedia.org/wiki/Peg_solitaire + +package main + +import "fmt" + +const N = 11 + 1 // length of a row (+1 for \n) + +// The board must be surrounded by 2 illegal +// fields in each direction so that move() +// doesn't need to check the board boundaries. +// Periods represent illegal fields, +// ● are pegs, and ○ are holes. + +var board = []rune( + `........... +........... +....●●●.... +....●●●.... +..●●●●●●●.. +..●●●○●●●.. +..●●●●●●●.. +....●●●.... +....●●●.... +........... +........... +`) + +// center is the position of the center hole if +// there is a single one; otherwise it is -1. +var center int + +func init() { + n := 0 + for pos, field := range board { + if field == '○' { + center = pos + n++ + } + } + if n != 1 { + center = -1 // no single hole + } +} + +var moves int // number of times move is called + +// move tests if there is a peg at position pos that +// can jump over another peg in direction dir. If the +// move is valid, it is executed and move returns true. +// Otherwise, move returns false. +func move(pos, dir int) bool { + moves++ + if board[pos] == '●' && board[pos+dir] == '●' && board[pos+2*dir] == '○' { + board[pos] = '○' + board[pos+dir] = '○' + board[pos+2*dir] = '●' + return true + } + return false +} + +// unmove reverts a previously executed valid move. +func unmove(pos, dir int) { + board[pos] = '●' + board[pos+dir] = '●' + board[pos+2*dir] = '○' +} + +// solve tries to find a sequence of moves such that +// there is only one peg left at the end; if center is +// >= 0, that last peg must be in the center position. +// If a solution is found, solve prints the board after +// each move in a backward fashion (i.e., the last +// board position is printed first, all the way back to +// the starting board position). +func solve() bool { + var last, n int + for pos, field := range board { + // try each board position + if field == '●' { + // found a peg + for _, dir := range [...]int{-1, -N, +1, +N} { + // try each direction + if move(pos, dir) { + // a valid move was found and executed, + // see if this new board has a solution + if solve() { + unmove(pos, dir) + fmt.Println(string(board)) + return true + } + unmove(pos, dir) + } + } + last = pos + n++ + } + } + // tried each possible move + if n == 1 && (center < 0 || last == center) { + // there's only one peg left + fmt.Println(string(board)) + return true + } + // no solution found for this board + return false +} + +func main() { + if !solve() { + fmt.Println("no solution found") + } + fmt.Println(moves, "moves tried") +} diff --git a/doc/play/tree.go b/doc/play/tree.go new file mode 100644 index 0000000000000000000000000000000000000000..3790e6cda50fae2f3cdcd270a9f123439618df8d --- /dev/null +++ b/doc/play/tree.go @@ -0,0 +1,100 @@ +// Go's concurrency primitives make it easy to +// express concurrent concepts, such as +// this binary tree comparison. +// +// Trees may be of different shapes, +// but have the same contents. For example: +// +// 4 6 +// 2 6 4 7 +// 1 3 5 7 2 5 +// 1 3 +// +// This program compares a pair of trees by +// walking each in its own goroutine, +// sending their contents through a channel +// to a third goroutine that compares them. + +package main + +import ( + "fmt" + "math/rand" +) + +// A Tree is a binary tree with integer values. +type Tree struct { + Left *Tree + Value int + Right *Tree +} + +// Walk traverses a tree depth-first, +// sending each Value on a channel. +func Walk(t *Tree, ch chan int) { + if t == nil { + return + } + Walk(t.Left, ch) + ch <- t.Value + Walk(t.Right, ch) +} + +// Walker launches Walk in a new goroutine, +// and returns a read-only channel of values. +func Walker(t *Tree) <-chan int { + ch := make(chan int) + go func() { + Walk(t, ch) + close(ch) + }() + return ch +} + +// Compare reads values from two Walkers +// that run simultaneously, and returns true +// if t1 and t2 have the same contents. +func Compare(t1, t2 *Tree) bool { + c1, c2 := Walker(t1), Walker(t2) + for { + v1, ok1 := <-c1 + v2, ok2 := <-c2 + if !ok1 || !ok2 { + return ok1 == ok2 + } + if v1 != v2 { + break + } + } + return false +} + +// New returns a new, random binary tree +// holding the values 1k, 2k, ..., nk. +func New(n, k int) *Tree { + var t *Tree + for _, v := range rand.Perm(n) { + t = insert(t, (1+v)*k) + } + return t +} + +func insert(t *Tree, v int) *Tree { + if t == nil { + return &Tree{nil, v, nil} + } + if v < t.Value { + t.Left = insert(t.Left, v) + return t + } + t.Right = insert(t.Right, v) + return t +} + +func main() { + t1 := New(100, 1) + fmt.Println(Compare(t1, New(100, 1)), "Same Contents") + fmt.Println(Compare(t1, New(99, 1)), "Differing Sizes") + fmt.Println(Compare(t1, New(100, 2)), "Differing Values") + fmt.Println(Compare(t1, New(101, 2)), "Dissimilar") +} diff --git a/doc/progs/cgo1.go b/doc/progs/cgo1.go new file mode 100644 index 0000000000000000000000000000000000000000..d559e13931933da1910e11ed2f352471e645a18b --- /dev/null +++ b/doc/progs/cgo1.go @@ -0,0 +1,22 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package rand + +/* +#include +*/ +import "C" + +// STOP OMIT +func Random() int { + return int(C.rand()) +} + +// STOP OMIT +func Seed(i int) { + C.srand(C.uint(i)) +} + +// END OMIT diff --git a/doc/progs/cgo2.go b/doc/progs/cgo2.go new file mode 100644 index 0000000000000000000000000000000000000000..da07aa49e6ed3c1ec76de962b27b0e261ef9e653 --- /dev/null +++ b/doc/progs/cgo2.go @@ -0,0 +1,22 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package rand2 + +/* +#include +*/ +import "C" + +func Random() int { + var r C.int = C.rand() + return int(r) +} + +// STOP OMIT +func Seed(i int) { + C.srand(C.uint(i)) +} + +// END OMIT diff --git a/doc/progs/cgo3.go b/doc/progs/cgo3.go new file mode 100644 index 0000000000000000000000000000000000000000..d5cedf4960a51f38ac6d503631225ef5f43cf438 --- /dev/null +++ b/doc/progs/cgo3.go @@ -0,0 +1,18 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package print + +// #include +// #include +import "C" +import "unsafe" + +func Print(s string) { + cs := C.CString(s) + C.fputs(cs, (*C.FILE)(C.stdout)) + C.free(unsafe.Pointer(cs)) +} + +// END OMIT diff --git a/doc/progs/cgo4.go b/doc/progs/cgo4.go new file mode 100644 index 0000000000000000000000000000000000000000..dbb07e84fe43cb4e8dbe03213acd114d64955963 --- /dev/null +++ b/doc/progs/cgo4.go @@ -0,0 +1,18 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package print + +// #include +// #include +import "C" +import "unsafe" + +func Print(s string) { + cs := C.CString(s) + defer C.free(unsafe.Pointer(cs)) + C.fputs(cs, (*C.FILE)(C.stdout)) +} + +// END OMIT diff --git a/doc/progs/defer.go b/doc/progs/defer.go new file mode 100644 index 0000000000000000000000000000000000000000..2e11020abf54ce4506afc68e80ee70cdb8db7a91 --- /dev/null +++ b/doc/progs/defer.go @@ -0,0 +1,64 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// This file contains the code snippets included in "Defer, Panic, and Recover." + +package main + +import ( + "fmt" + "io" + "os" +) + +func a() { + i := 0 + defer fmt.Println(i) + i++ + return +} + +// STOP OMIT + +func b() { + for i := 0; i < 4; i++ { + defer fmt.Print(i) + } +} + +// STOP OMIT + +func c() (i int) { + defer func() { i++ }() + return 1 +} + +// STOP OMIT + +// Initial version. +func CopyFile(dstName, srcName string) (written int64, err error) { + src, err := os.Open(srcName) + if err != nil { + return + } + + dst, err := os.Create(dstName) + if err != nil { + return + } + + written, err = io.Copy(dst, src) + dst.Close() + src.Close() + return +} + +// STOP OMIT + +func main() { + a() + b() + fmt.Println() + fmt.Println(c()) +} diff --git a/doc/progs/defer2.go b/doc/progs/defer2.go new file mode 100644 index 0000000000000000000000000000000000000000..cad66b0702b3d49c0f338ef0c627fa8940452508 --- /dev/null +++ b/doc/progs/defer2.go @@ -0,0 +1,58 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// This file contains the code snippets included in "Defer, Panic, and Recover." + +package main + +import "fmt" +import "io" // OMIT +import "os" // OMIT + +func main() { + f() + fmt.Println("Returned normally from f.") +} + +func f() { + defer func() { + if r := recover(); r != nil { + fmt.Println("Recovered in f", r) + } + }() + fmt.Println("Calling g.") + g(0) + fmt.Println("Returned normally from g.") +} + +func g(i int) { + if i > 3 { + fmt.Println("Panicking!") + panic(fmt.Sprintf("%v", i)) + } + defer fmt.Println("Defer in g", i) + fmt.Println("Printing in g", i) + g(i + 1) +} + +// STOP OMIT + +// Revised version. +func CopyFile(dstName, srcName string) (written int64, err error) { + src, err := os.Open(srcName) + if err != nil { + return + } + defer src.Close() + + dst, err := os.Create(dstName) + if err != nil { + return + } + defer dst.Close() + + return io.Copy(dst, src) +} + +// STOP OMIT diff --git a/doc/progs/eff_bytesize.go b/doc/progs/eff_bytesize.go new file mode 100644 index 0000000000000000000000000000000000000000..b45961114dd3bd81d0d3e2f587bf3ad67561a8df --- /dev/null +++ b/doc/progs/eff_bytesize.go @@ -0,0 +1,47 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +import "fmt" + +type ByteSize float64 + +const ( + _ = iota // ignore first value by assigning to blank identifier + KB ByteSize = 1 << (10 * iota) + MB + GB + TB + PB + EB + ZB + YB +) + +func (b ByteSize) String() string { + switch { + case b >= YB: + return fmt.Sprintf("%.2fYB", b/YB) + case b >= ZB: + return fmt.Sprintf("%.2fZB", b/ZB) + case b >= EB: + return fmt.Sprintf("%.2fEB", b/EB) + case b >= PB: + return fmt.Sprintf("%.2fPB", b/PB) + case b >= TB: + return fmt.Sprintf("%.2fTB", b/TB) + case b >= GB: + return fmt.Sprintf("%.2fGB", b/GB) + case b >= MB: + return fmt.Sprintf("%.2fMB", b/MB) + case b >= KB: + return fmt.Sprintf("%.2fKB", b/KB) + } + return fmt.Sprintf("%.2fB", b) +} + +func main() { + fmt.Println(YB, ByteSize(1e13)) +} diff --git a/doc/progs/eff_qr.go b/doc/progs/eff_qr.go new file mode 100644 index 0000000000000000000000000000000000000000..89de459f7da370af072b4d45679d2744b9e9c2db --- /dev/null +++ b/doc/progs/eff_qr.go @@ -0,0 +1,50 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +import ( + "flag" + "html/template" + "log" + "net/http" +) + +var addr = flag.String("addr", ":1718", "http service address") // Q=17, R=18 + +var templ = template.Must(template.New("qr").Parse(templateStr)) + +func main() { + flag.Parse() + http.Handle("/", http.HandlerFunc(QR)) + err := http.ListenAndServe(*addr, nil) + if err != nil { + log.Fatal("ListenAndServe:", err) + } +} + +func QR(w http.ResponseWriter, req *http.Request) { + templ.Execute(w, req.FormValue("s")) +} + +const templateStr = ` + + +QR Link Generator + + +{{if .}} + +
+{{.}} +
+
+{{end}} +
+
+ + +` diff --git a/doc/progs/eff_sequence.go b/doc/progs/eff_sequence.go new file mode 100644 index 0000000000000000000000000000000000000000..11c885abf82a34013248c5246167434f4f8776da --- /dev/null +++ b/doc/progs/eff_sequence.go @@ -0,0 +1,42 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +import ( + "fmt" + "sort" +) + +func main() { + seq := Sequence{6, 2, -1, 44, 16} + sort.Sort(seq) + fmt.Println(seq) +} + +type Sequence []int + +// Methods required by sort.Interface. +func (s Sequence) Len() int { + return len(s) +} +func (s Sequence) Less(i, j int) bool { + return s[i] < s[j] +} +func (s Sequence) Swap(i, j int) { + s[i], s[j] = s[j], s[i] +} + +// Method for printing - sorts the elements before printing. +func (s Sequence) String() string { + sort.Sort(s) + str := "[" + for i, elem := range s { + if i > 0 { + str += " " + } + str += fmt.Sprint(elem) + } + return str + "]" +} diff --git a/doc/progs/eff_unused1.go b/doc/progs/eff_unused1.go new file mode 100644 index 0000000000000000000000000000000000000000..285d55eee53a5338ca0966edae2176f56e72146a --- /dev/null +++ b/doc/progs/eff_unused1.go @@ -0,0 +1,16 @@ +package main + +import ( + "fmt" + "io" + "log" + "os" +) + +func main() { + fd, err := os.Open("test.go") + if err != nil { + log.Fatal(err) + } + // TODO: use fd. +} diff --git a/doc/progs/eff_unused2.go b/doc/progs/eff_unused2.go new file mode 100644 index 0000000000000000000000000000000000000000..92eb74e0534f3b54b56e56aeda75294bdf879a01 --- /dev/null +++ b/doc/progs/eff_unused2.go @@ -0,0 +1,20 @@ +package main + +import ( + "fmt" + "io" + "log" + "os" +) + +var _ = fmt.Printf // For debugging; delete when done. +var _ io.Reader // For debugging; delete when done. + +func main() { + fd, err := os.Open("test.go") + if err != nil { + log.Fatal(err) + } + // TODO: use fd. + _ = fd +} diff --git a/doc/progs/error.go b/doc/progs/error.go new file mode 100644 index 0000000000000000000000000000000000000000..e776cdba17738fe9974806e231f4a29922149c85 --- /dev/null +++ b/doc/progs/error.go @@ -0,0 +1,127 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// This file contains the code snippets included in "Error Handling and Go." + +package main + +import ( + "encoding/json" + "errors" + "fmt" + "log" + "net" + "os" + "time" +) + +type File struct{} + +func Open(name string) (file *File, err error) { + // OMIT + panic(1) + // STOP OMIT +} + +func openFile() { // OMIT + f, err := os.Open("filename.ext") + if err != nil { + log.Fatal(err) + } + // do something with the open *File f + // STOP OMIT + _ = f +} + +// errorString is a trivial implementation of error. +type errorString struct { + s string +} + +func (e *errorString) Error() string { + return e.s +} + +// STOP OMIT + +// New returns an error that formats as the given text. +func New(text string) error { + return &errorString{text} +} + +// STOP OMIT + +func Sqrt(f float64) (float64, error) { + if f < 0 { + return 0, errors.New("math: square root of negative number") + } + // implementation + return 0, nil // OMIT +} + +// STOP OMIT + +func printErr() (int, error) { // OMIT + f, err := Sqrt(-1) + if err != nil { + fmt.Println(err) + } + // STOP OMIT + // fmtError OMIT + if f < 0 { + return 0, fmt.Errorf("math: square root of negative number %g", f) + } + // STOP OMIT + return 0, nil +} + +type NegativeSqrtError float64 + +func (f NegativeSqrtError) Error() string { + return fmt.Sprintf("math: square root of negative number %g", float64(f)) +} + +// STOP OMIT + +type SyntaxError struct { + msg string // description of error + Offset int64 // error occurred after reading Offset bytes +} + +func (e *SyntaxError) Error() string { return e.msg } + +// STOP OMIT + +func decodeError(dec *json.Decoder, val struct{}) error { // OMIT + var f os.FileInfo // OMIT + if err := dec.Decode(&val); err != nil { + if serr, ok := err.(*json.SyntaxError); ok { + line, col := findLine(f, serr.Offset) + return fmt.Errorf("%s:%d:%d: %v", f.Name(), line, col, err) + } + return err + } + // STOP OMIT + return nil +} + +func findLine(os.FileInfo, int64) (int, int) { + // place holder; no need to run + return 0, 0 +} + +func netError(err error) { // OMIT + for { // OMIT + if nerr, ok := err.(net.Error); ok && nerr.Temporary() { + time.Sleep(1e9) + continue + } + if err != nil { + log.Fatal(err) + } + // STOP OMIT + } +} + +func main() {} diff --git a/doc/progs/error2.go b/doc/progs/error2.go new file mode 100644 index 0000000000000000000000000000000000000000..2b0e0c3563a56d4738ec6deadcb850e2490624a1 --- /dev/null +++ b/doc/progs/error2.go @@ -0,0 +1,54 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// This file contains the code snippets included in "Error Handling and Go." + +package main + +import ( + "net/http" + "text/template" +) + +func init() { + http.HandleFunc("/view", viewRecord) +} + +func viewRecord(w http.ResponseWriter, r *http.Request) { + c := appengine.NewContext(r) + key := datastore.NewKey(c, "Record", r.FormValue("id"), 0, nil) + record := new(Record) + if err := datastore.Get(c, key, record); err != nil { + http.Error(w, err.Error(), 500) + return + } + if err := viewTemplate.Execute(w, record); err != nil { + http.Error(w, err.Error(), 500) + } +} + +// STOP OMIT + +type ap struct{} + +func (ap) NewContext(*http.Request) *ctx { return nil } + +type ctx struct{} + +func (*ctx) Errorf(string, ...interface{}) {} + +var appengine ap + +type ds struct{} + +func (ds) NewKey(*ctx, string, string, int, *int) string { return "" } +func (ds) Get(*ctx, string, *Record) error { return nil } + +var datastore ds + +type Record struct{} + +var viewTemplate *template.Template + +func main() {} diff --git a/doc/progs/error3.go b/doc/progs/error3.go new file mode 100644 index 0000000000000000000000000000000000000000..e4e57e077b52ace4126868985272fe060e5d9b5d --- /dev/null +++ b/doc/progs/error3.go @@ -0,0 +1,63 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// This file contains the code snippets included in "Error Handling and Go." + +package main + +import ( + "net/http" + "text/template" +) + +func init() { + http.Handle("/view", appHandler(viewRecord)) +} + +// STOP OMIT + +func viewRecord(w http.ResponseWriter, r *http.Request) error { + c := appengine.NewContext(r) + key := datastore.NewKey(c, "Record", r.FormValue("id"), 0, nil) + record := new(Record) + if err := datastore.Get(c, key, record); err != nil { + return err + } + return viewTemplate.Execute(w, record) +} + +// STOP OMIT + +type appHandler func(http.ResponseWriter, *http.Request) error + +func (fn appHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { + if err := fn(w, r); err != nil { + http.Error(w, err.Error(), 500) + } +} + +// STOP OMIT + +type ap struct{} + +func (ap) NewContext(*http.Request) *ctx { return nil } + +type ctx struct{} + +func (*ctx) Errorf(string, ...interface{}) {} + +var appengine ap + +type ds struct{} + +func (ds) NewKey(*ctx, string, string, int, *int) string { return "" } +func (ds) Get(*ctx, string, *Record) error { return nil } + +var datastore ds + +type Record struct{} + +var viewTemplate *template.Template + +func main() {} diff --git a/doc/progs/error4.go b/doc/progs/error4.go new file mode 100644 index 0000000000000000000000000000000000000000..8b2f3049de272a1b0152f0c05b5c19f6fcc340e7 --- /dev/null +++ b/doc/progs/error4.go @@ -0,0 +1,74 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// This file contains the code snippets included in "Error Handling and Go." + +package main + +import ( + "net/http" + "text/template" +) + +type appError struct { + Error error + Message string + Code int +} + +// STOP OMIT + +type appHandler func(http.ResponseWriter, *http.Request) *appError + +func (fn appHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { + if e := fn(w, r); e != nil { // e is *appError, not error. + c := appengine.NewContext(r) + c.Errorf("%v", e.Error) + http.Error(w, e.Message, e.Code) + } +} + +// STOP OMIT + +func viewRecord(w http.ResponseWriter, r *http.Request) *appError { + c := appengine.NewContext(r) + key := datastore.NewKey(c, "Record", r.FormValue("id"), 0, nil) + record := new(Record) + if err := datastore.Get(c, key, record); err != nil { + return &appError{err, "Record not found", 404} + } + if err := viewTemplate.Execute(w, record); err != nil { + return &appError{err, "Can't display record", 500} + } + return nil +} + +// STOP OMIT + +func init() { + http.Handle("/view", appHandler(viewRecord)) +} + +type ap struct{} + +func (ap) NewContext(*http.Request) *ctx { return nil } + +type ctx struct{} + +func (*ctx) Errorf(string, ...interface{}) {} + +var appengine ap + +type ds struct{} + +func (ds) NewKey(*ctx, string, string, int, *int) string { return "" } +func (ds) Get(*ctx, string, *Record) error { return nil } + +var datastore ds + +type Record struct{} + +var viewTemplate *template.Template + +func main() {} diff --git a/doc/progs/go1.go b/doc/progs/go1.go new file mode 100644 index 0000000000000000000000000000000000000000..50fd93441f477e636e4a0274b09448717ceddff5 --- /dev/null +++ b/doc/progs/go1.go @@ -0,0 +1,245 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// This file contains examples to embed in the Go 1 release notes document. + +package main + +import ( + "errors" + "flag" + "fmt" + "log" + "os" + "path/filepath" + "testing" + "time" + "unicode" +) + +func main() { + flag.Parse() + stringAppend() + mapDelete() + mapIteration() + multipleAssignment() + structEquality() + compositeLiterals() + runeType() + errorExample() + timePackage() + walkExample() + osIsExist() +} + +var timeout = flag.Duration("timeout", 30*time.Second, "how long to wait for completion") + +func init() { + // canonicalize the logging + log.SetFlags(0) +} + +func mapDelete() { + m := map[string]int{"7": 7, "23": 23} + k := "7" + delete(m, k) + if m["7"] != 0 || m["23"] != 23 { + log.Fatal("mapDelete:", m) + } +} + +func stringAppend() { + greeting := []byte{} + greeting = append(greeting, []byte("hello ")...) + greeting = append(greeting, "world"...) + if string(greeting) != "hello world" { + log.Fatal("stringAppend: ", string(greeting)) + } +} + +func mapIteration() { + m := map[string]int{"Sunday": 0, "Monday": 1} + for name, value := range m { + // This loop should not assume Sunday will be visited first. + f(name, value) + } +} + +func f(string, int) { +} + +func assert(t bool) { + if !t { + log.Panic("assertion fail") + } +} + +func multipleAssignment() { + sa := []int{1, 2, 3} + i := 0 + i, sa[i] = 1, 2 // sets i = 1, sa[0] = 2 + + sb := []int{1, 2, 3} + j := 0 + sb[j], j = 2, 1 // sets sb[0] = 2, j = 1 + + sc := []int{1, 2, 3} + sc[0], sc[0] = 1, 2 // sets sc[0] = 1, then sc[0] = 2 (so sc[0] = 2 at end) + + assert(i == 1 && sa[0] == 2) + assert(j == 1 && sb[0] == 2) + assert(sc[0] == 2) +} + +func structEquality() { + type Day struct { + long string + short string + } + Christmas := Day{"Christmas", "XMas"} + Thanksgiving := Day{"Thanksgiving", "Turkey"} + holiday := map[Day]bool{ + Christmas: true, + Thanksgiving: true, + } + fmt.Printf("Christmas is a holiday: %t\n", holiday[Christmas]) +} + +func compositeLiterals() { + type Date struct { + month string + day int + } + // Struct values, fully qualified; always legal. + holiday1 := []Date{ + Date{"Feb", 14}, + Date{"Nov", 11}, + Date{"Dec", 25}, + } + // Struct values, type name elided; always legal. + holiday2 := []Date{ + {"Feb", 14}, + {"Nov", 11}, + {"Dec", 25}, + } + // Pointers, fully qualified, always legal. + holiday3 := []*Date{ + &Date{"Feb", 14}, + &Date{"Nov", 11}, + &Date{"Dec", 25}, + } + // Pointers, type name elided; legal in Go 1. + holiday4 := []*Date{ + {"Feb", 14}, + {"Nov", 11}, + {"Dec", 25}, + } + // STOP OMIT + _, _, _, _ = holiday1, holiday2, holiday3, holiday4 +} + +func runeType() { + // STARTRUNE OMIT + delta := 'δ' // delta has type rune. + var DELTA rune + DELTA = unicode.ToUpper(delta) + epsilon := unicode.ToLower(DELTA + 1) + if epsilon != 'δ'+1 { + log.Fatal("inconsistent casing for Greek") + } + // ENDRUNE OMIT +} + +// START ERROR EXAMPLE OMIT +type SyntaxError struct { + File string + Line int + Message string +} + +func (se *SyntaxError) Error() string { + return fmt.Sprintf("%s:%d: %s", se.File, se.Line, se.Message) +} + +// END ERROR EXAMPLE OMIT + +func errorExample() { + var ErrSyntax = errors.New("syntax error") + _ = ErrSyntax + se := &SyntaxError{"file", 7, "error"} + got := fmt.Sprint(se) + const expect = "file:7: error" + if got != expect { + log.Fatalf("errorsPackage: expected %q got %q", expect, got) + } +} + +// sleepUntil sleeps until the specified time. It returns immediately if it's too late. +func sleepUntil(wakeup time.Time) { + now := time.Now() // A Time. + if !wakeup.After(now) { + return + } + delta := wakeup.Sub(now) // A Duration. + fmt.Printf("Sleeping for %.3fs\n", delta.Seconds()) + time.Sleep(delta) +} + +func timePackage() { + sleepUntil(time.Now().Add(123 * time.Millisecond)) +} + +func walkExample() { + // STARTWALK OMIT + markFn := func(path string, info os.FileInfo, err error) error { + if path == "pictures" { // Will skip walking of directory pictures and its contents. + return filepath.SkipDir + } + if err != nil { + return err + } + log.Println(path) + return nil + } + err := filepath.Walk(".", markFn) + if err != nil { + log.Fatal(err) + } + // ENDWALK OMIT +} + +func initializationFunction(c chan int) { + c <- 1 +} + +var PackageGlobal int + +func init() { + c := make(chan int) + go initializationFunction(c) + PackageGlobal = <-c +} + +func BenchmarkSprintf(b *testing.B) { + // Verify correctness before running benchmark. + b.StopTimer() + got := fmt.Sprintf("%x", 23) + const expect = "17" + if expect != got { + b.Fatalf("expected %q; got %q", expect, got) + } + b.StartTimer() + for i := 0; i < b.N; i++ { + fmt.Sprintf("%x", 23) + } +} + +func osIsExist() { + name := "go1.go" + f, err := os.OpenFile(name, os.O_RDWR|os.O_CREATE|os.O_EXCL, 0600) + if os.IsExist(err) { + log.Printf("%s already exists", name) + } + _ = f +} diff --git a/doc/progs/gobs1.go b/doc/progs/gobs1.go new file mode 100644 index 0000000000000000000000000000000000000000..7077ca159f994d78aadd3e516d804403f6dbd9fe --- /dev/null +++ b/doc/progs/gobs1.go @@ -0,0 +1,22 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package gobs1 + +type T struct{ X, Y, Z int } // Only exported fields are encoded and decoded. +var t = T{X: 7, Y: 0, Z: 8} + +// STOP OMIT + +type U struct{ X, Y *int8 } // Note: pointers to int8s +var u U + +// STOP OMIT + +type Node struct { + Value int + Left, Right *Node +} + +// STOP OMIT diff --git a/doc/progs/gobs2.go b/doc/progs/gobs2.go new file mode 100644 index 0000000000000000000000000000000000000000..85bb41cdca72f1c357794dc7b46b16b6dbfba274 --- /dev/null +++ b/doc/progs/gobs2.go @@ -0,0 +1,43 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +import ( + "bytes" + "encoding/gob" + "fmt" + "log" +) + +type P struct { + X, Y, Z int + Name string +} + +type Q struct { + X, Y *int32 + Name string +} + +func main() { + // Initialize the encoder and decoder. Normally enc and dec would be + // bound to network connections and the encoder and decoder would + // run in different processes. + var network bytes.Buffer // Stand-in for a network connection + enc := gob.NewEncoder(&network) // Will write to network. + dec := gob.NewDecoder(&network) // Will read from network. + // Encode (send) the value. + err := enc.Encode(P{3, 4, 5, "Pythagoras"}) + if err != nil { + log.Fatal("encode error:", err) + } + // Decode (receive) the value. + var q Q + err = dec.Decode(&q) + if err != nil { + log.Fatal("decode error:", err) + } + fmt.Printf("%q: {%d,%d}\n", q.Name, *q.X, *q.Y) +} diff --git a/doc/progs/image_draw.go b/doc/progs/image_draw.go new file mode 100644 index 0000000000000000000000000000000000000000..bb73c8a714f0fc752d34a12445b91023bf27f0f7 --- /dev/null +++ b/doc/progs/image_draw.go @@ -0,0 +1,142 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// This file contains the code snippets included in "The Go image/draw package." + +package main + +import ( + "image" + "image/color" + "image/draw" +) + +func main() { + Color() + Rect() + RectAndScroll() + ConvAndCircle() + Glyph() +} + +func Color() { + c := color.RGBA{255, 0, 255, 255} + r := image.Rect(0, 0, 640, 480) + dst := image.NewRGBA(r) + + // ZERO OMIT + // image.ZP is the zero point -- the origin. + draw.Draw(dst, r, &image.Uniform{c}, image.ZP, draw.Src) + // STOP OMIT + + // BLUE OMIT + m := image.NewRGBA(image.Rect(0, 0, 640, 480)) + blue := color.RGBA{0, 0, 255, 255} + draw.Draw(m, m.Bounds(), &image.Uniform{blue}, image.ZP, draw.Src) + // STOP OMIT + + // RESET OMIT + draw.Draw(m, m.Bounds(), image.Transparent, image.ZP, draw.Src) + // STOP OMIT +} + +func Rect() { + dst := image.NewRGBA(image.Rect(0, 0, 640, 480)) + sr := image.Rect(0, 0, 200, 200) + src := image.Black + dp := image.Point{100, 100} + + // RECT OMIT + r := image.Rectangle{dp, dp.Add(sr.Size())} + draw.Draw(dst, r, src, sr.Min, draw.Src) + // STOP OMIT +} + +func RectAndScroll() { + dst := image.NewRGBA(image.Rect(0, 0, 640, 480)) + sr := image.Rect(0, 0, 200, 200) + src := image.Black + dp := image.Point{100, 100} + + // RECT2 OMIT + r := sr.Sub(sr.Min).Add(dp) + draw.Draw(dst, r, src, sr.Min, draw.Src) + // STOP OMIT + + m := dst + + // SCROLL OMIT + b := m.Bounds() + p := image.Pt(0, 20) + // Note that even though the second argument is b, + // the effective rectangle is smaller due to clipping. + draw.Draw(m, b, m, b.Min.Add(p), draw.Src) + dirtyRect := b.Intersect(image.Rect(b.Min.X, b.Max.Y-20, b.Max.X, b.Max.Y)) + // STOP OMIT + + _ = dirtyRect // noop +} + +func ConvAndCircle() { + src := image.NewRGBA(image.Rect(0, 0, 640, 480)) + dst := image.NewRGBA(image.Rect(0, 0, 640, 480)) + + // CONV OMIT + b := src.Bounds() + m := image.NewRGBA(b) + draw.Draw(m, b, src, b.Min, draw.Src) + // STOP OMIT + + p := image.Point{100, 100} + r := 50 + + // CIRCLE2 OMIT + draw.DrawMask(dst, dst.Bounds(), src, image.ZP, &circle{p, r}, image.ZP, draw.Over) + // STOP OMIT +} + +func theGlyphImageForAFont() image.Image { + return image.NewRGBA(image.Rect(0, 0, 640, 480)) +} + +func theBoundsFor(index int) image.Rectangle { + return image.Rect(0, 0, 32, 32) +} + +func Glyph() { + p := image.Point{100, 100} + dst := image.NewRGBA(image.Rect(0, 0, 640, 480)) + glyphIndex := 42 + + // GLYPH OMIT + src := &image.Uniform{color.RGBA{0, 0, 255, 255}} + mask := theGlyphImageForAFont() + mr := theBoundsFor(glyphIndex) + draw.DrawMask(dst, mr.Sub(mr.Min).Add(p), src, image.ZP, mask, mr.Min, draw.Over) + // STOP OMIT +} + +//CIRCLESTRUCT OMIT +type circle struct { + p image.Point + r int +} + +func (c *circle) ColorModel() color.Model { + return color.AlphaModel +} + +func (c *circle) Bounds() image.Rectangle { + return image.Rect(c.p.X-c.r, c.p.Y-c.r, c.p.X+c.r, c.p.Y+c.r) +} + +func (c *circle) At(x, y int) color.Color { + xx, yy, rr := float64(x-c.p.X)+0.5, float64(y-c.p.Y)+0.5, float64(c.r) + if xx*xx+yy*yy < rr*rr { + return color.Alpha{255} + } + return color.Alpha{0} +} + +//STOP OMIT diff --git a/doc/progs/image_package1.go b/doc/progs/image_package1.go new file mode 100644 index 0000000000000000000000000000000000000000..c4c401e729e9eab6ea8e77ce7d1edb32d0758b6b --- /dev/null +++ b/doc/progs/image_package1.go @@ -0,0 +1,15 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +import ( + "fmt" + "image" +) + +func main() { + p := image.Point{2, 1} + fmt.Println("X is", p.X, "Y is", p.Y) +} diff --git a/doc/progs/image_package2.go b/doc/progs/image_package2.go new file mode 100644 index 0000000000000000000000000000000000000000..fcb5d9fd039298abb26458b868d95a1b056e8588 --- /dev/null +++ b/doc/progs/image_package2.go @@ -0,0 +1,16 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +import ( + "fmt" + "image" +) + +func main() { + r := image.Rect(2, 1, 5, 5) + // Dx and Dy return a rectangle's width and height. + fmt.Println(r.Dx(), r.Dy(), image.Pt(0, 0).In(r)) // prints 3 4 false +} diff --git a/doc/progs/image_package3.go b/doc/progs/image_package3.go new file mode 100644 index 0000000000000000000000000000000000000000..13d0f08079c7b361599a864607f9a86488e11547 --- /dev/null +++ b/doc/progs/image_package3.go @@ -0,0 +1,15 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +import ( + "fmt" + "image" +) + +func main() { + r := image.Rect(2, 1, 5, 5).Add(image.Pt(-4, -2)) + fmt.Println(r.Dx(), r.Dy(), image.Pt(0, 0).In(r)) // prints 3 4 true +} diff --git a/doc/progs/image_package4.go b/doc/progs/image_package4.go new file mode 100644 index 0000000000000000000000000000000000000000..c46fddf07a1b869239000f31635bcc0a23b68adb --- /dev/null +++ b/doc/progs/image_package4.go @@ -0,0 +1,16 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +import ( + "fmt" + "image" +) + +func main() { + r := image.Rect(0, 0, 4, 3).Intersect(image.Rect(2, 2, 5, 5)) + // Size returns a rectangle's width and height, as a Point. + fmt.Printf("%#v\n", r.Size()) // prints image.Point{X:2, Y:1} +} diff --git a/doc/progs/image_package5.go b/doc/progs/image_package5.go new file mode 100644 index 0000000000000000000000000000000000000000..0bb5c7608e1a39801afeac17d522d42e22bdb759 --- /dev/null +++ b/doc/progs/image_package5.go @@ -0,0 +1,17 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +import ( + "fmt" + "image" + "image/color" +) + +func main() { + m := image.NewRGBA(image.Rect(0, 0, 640, 480)) + m.Set(5, 5, color.RGBA{255, 0, 0, 255}) + fmt.Println(m.At(5, 5)) +} diff --git a/doc/progs/image_package6.go b/doc/progs/image_package6.go new file mode 100644 index 0000000000000000000000000000000000000000..62eeecdb9230e35dd53711c94eb392169dd26109 --- /dev/null +++ b/doc/progs/image_package6.go @@ -0,0 +1,17 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +import ( + "fmt" + "image" +) + +func main() { + m0 := image.NewRGBA(image.Rect(0, 0, 8, 5)) + m1 := m0.SubImage(image.Rect(1, 2, 5, 5)).(*image.RGBA) + fmt.Println(m0.Bounds().Dx(), m1.Bounds().Dx()) // prints 8, 4 + fmt.Println(m0.Stride == m1.Stride) // prints true +} diff --git a/doc/progs/interface.go b/doc/progs/interface.go new file mode 100644 index 0000000000000000000000000000000000000000..c2925d590d5659cb3c5a9566a87059f06cd6a484 --- /dev/null +++ b/doc/progs/interface.go @@ -0,0 +1,62 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// This file contains the code snippets included in "The Laws of Reflection." + +package main + +import ( + "bufio" + "bytes" + "io" + "os" +) + +type MyInt int + +var i int +var j MyInt + +// STOP OMIT + +// Reader is the interface that wraps the basic Read method. +type Reader interface { + Read(p []byte) (n int, err error) +} + +// Writer is the interface that wraps the basic Write method. +type Writer interface { + Write(p []byte) (n int, err error) +} + +// STOP OMIT + +func readers() { // OMIT + var r io.Reader + r = os.Stdin + r = bufio.NewReader(r) + r = new(bytes.Buffer) + // and so on + // STOP OMIT +} + +func typeAssertions() (interface{}, error) { // OMIT + var r io.Reader + tty, err := os.OpenFile("/dev/tty", os.O_RDWR, 0) + if err != nil { + return nil, err + } + r = tty + // STOP OMIT + var w io.Writer + w = r.(io.Writer) + // STOP OMIT + var empty interface{} + empty = w + // STOP OMIT + return empty, err +} + +func main() { +} diff --git a/doc/progs/interface2.go b/doc/progs/interface2.go new file mode 100644 index 0000000000000000000000000000000000000000..a541d94e4839815564a68e7f5b7848f1809e8c20 --- /dev/null +++ b/doc/progs/interface2.go @@ -0,0 +1,132 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// This file contains the code snippets included in "The Laws of Reflection." + +package main + +import ( + "fmt" + "reflect" +) + +func main() { + var x float64 = 3.4 + fmt.Println("type:", reflect.TypeOf(x)) + // STOP OMIT + // TODO(proppy): test output OMIT +} + +// STOP main OMIT + +func f1() { + // START f1 OMIT + var x float64 = 3.4 + v := reflect.ValueOf(x) + fmt.Println("type:", v.Type()) + fmt.Println("kind is float64:", v.Kind() == reflect.Float64) + fmt.Println("value:", v.Float()) + // STOP OMIT +} + +func f2() { + // START f2 OMIT + var x uint8 = 'x' + v := reflect.ValueOf(x) + fmt.Println("type:", v.Type()) // uint8. + fmt.Println("kind is uint8: ", v.Kind() == reflect.Uint8) // true. + x = uint8(v.Uint()) // v.Uint returns a uint64. + // STOP OMIT +} + +func f3() { + // START f3 OMIT + type MyInt int + var x MyInt = 7 + v := reflect.ValueOf(x) + // STOP OMIT + // START f3b OMIT + y := v.Interface().(float64) // y will have type float64. + fmt.Println(y) + // STOP OMIT + // START f3c OMIT + fmt.Println(v.Interface()) + // STOP OMIT + // START f3d OMIT + fmt.Printf("value is %7.1e\n", v.Interface()) + // STOP OMIT +} + +func f4() { + // START f4 OMIT + var x float64 = 3.4 + v := reflect.ValueOf(x) + v.SetFloat(7.1) // Error: will panic. + // STOP OMIT +} + +func f5() { + // START f5 OMIT + var x float64 = 3.4 + v := reflect.ValueOf(x) + fmt.Println("settability of v:", v.CanSet()) + // STOP OMIT +} + +func f6() { + // START f6 OMIT + var x float64 = 3.4 + v := reflect.ValueOf(x) + // STOP OMIT + // START f6b OMIT + v.SetFloat(7.1) + // STOP OMIT +} + +func f7() { + // START f7 OMIT + var x float64 = 3.4 + p := reflect.ValueOf(&x) // Note: take the address of x. + fmt.Println("type of p:", p.Type()) + fmt.Println("settability of p:", p.CanSet()) + // STOP OMIT + // START f7b OMIT + v := p.Elem() + fmt.Println("settability of v:", v.CanSet()) + // STOP OMIT + // START f7c OMIT + v.SetFloat(7.1) + fmt.Println(v.Interface()) + fmt.Println(x) + // STOP OMIT +} + +func f8() { + // START f8 OMIT + type T struct { + A int + B string + } + t := T{23, "skidoo"} + s := reflect.ValueOf(&t).Elem() + typeOfT := s.Type() + for i := 0; i < s.NumField(); i++ { + f := s.Field(i) + fmt.Printf("%d: %s %s = %v\n", i, + typeOfT.Field(i).Name, f.Type(), f.Interface()) + } + // STOP OMIT + // START f8b OMIT + s.Field(0).SetInt(77) + s.Field(1).SetString("Sunset Strip") + fmt.Println("t is now", t) + // STOP OMIT +} + +func f9() { + // START f9 OMIT + var x float64 = 3.4 + fmt.Println("value:", reflect.ValueOf(x)) + // STOP OMIT +} diff --git a/doc/progs/json1.go b/doc/progs/json1.go new file mode 100644 index 0000000000000000000000000000000000000000..9e10f4743df7ffe68a80935fadfb8671cf62f89a --- /dev/null +++ b/doc/progs/json1.go @@ -0,0 +1,88 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +import ( + "encoding/json" + "log" + "reflect" +) + +type Message struct { + Name string + Body string + Time int64 +} + +// STOP OMIT + +func Encode() { + m := Message{"Alice", "Hello", 1294706395881547000} + b, err := json.Marshal(m) + + if err != nil { + panic(err) + } + + expected := []byte(`{"Name":"Alice","Body":"Hello","Time":1294706395881547000}`) + if !reflect.DeepEqual(b, expected) { + log.Panicf("Error marshalling %q, expected %q, got %q.", m, expected, b) + } + +} + +func Decode() { + b := []byte(`{"Name":"Alice","Body":"Hello","Time":1294706395881547000}`) + var m Message + err := json.Unmarshal(b, &m) + + if err != nil { + panic(err) + } + + expected := Message{ + Name: "Alice", + Body: "Hello", + Time: 1294706395881547000, + } + + if !reflect.DeepEqual(m, expected) { + log.Panicf("Error unmarshalling %q, expected %q, got %q.", b, expected, m) + } + + m = Message{ + Name: "Alice", + Body: "Hello", + Time: 1294706395881547000, + } + + // STOP OMIT +} + +func PartialDecode() { + b := []byte(`{"Name":"Bob","Food":"Pickle"}`) + var m Message + err := json.Unmarshal(b, &m) + + // STOP OMIT + + if err != nil { + panic(err) + } + + expected := Message{ + Name: "Bob", + } + + if !reflect.DeepEqual(expected, m) { + log.Panicf("Error unmarshalling %q, expected %q, got %q.", b, expected, m) + } +} + +func main() { + Encode() + Decode() + PartialDecode() +} diff --git a/doc/progs/json2.go b/doc/progs/json2.go new file mode 100644 index 0000000000000000000000000000000000000000..6089ae6710c80181e4fb80218279046a72bbec0d --- /dev/null +++ b/doc/progs/json2.go @@ -0,0 +1,42 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +import ( + "fmt" + "math" +) + +func InterfaceExample() { + var i interface{} + i = "a string" + i = 2011 + i = 2.777 + + // STOP OMIT + + r := i.(float64) + fmt.Println("the circle's area", math.Pi*r*r) + + // STOP OMIT + + switch v := i.(type) { + case int: + fmt.Println("twice i is", v*2) + case float64: + fmt.Println("the reciprocal of i is", 1/v) + case string: + h := len(v) / 2 + fmt.Println("i swapped by halves is", v[h:]+v[:h]) + default: + // i isn't one of the types above + } + + // STOP OMIT +} + +func main() { + InterfaceExample() +} diff --git a/doc/progs/json3.go b/doc/progs/json3.go new file mode 100644 index 0000000000000000000000000000000000000000..a04fdfa506a8dfeec2d6057b4cfc6ab464e492cd --- /dev/null +++ b/doc/progs/json3.go @@ -0,0 +1,73 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +import ( + "encoding/json" + "fmt" + "log" + "reflect" +) + +func Decode() { + b := []byte(`{"Name":"Wednesday","Age":6,"Parents":["Gomez","Morticia"]}`) + + var f interface{} + err := json.Unmarshal(b, &f) + + // STOP OMIT + + if err != nil { + panic(err) + } + + expected := map[string]interface{}{ + "Name": "Wednesday", + "Age": float64(6), + "Parents": []interface{}{ + "Gomez", + "Morticia", + }, + } + + if !reflect.DeepEqual(f, expected) { + log.Panicf("Error unmarshalling %q, expected %q, got %q", b, expected, f) + } + + f = map[string]interface{}{ + "Name": "Wednesday", + "Age": 6, + "Parents": []interface{}{ + "Gomez", + "Morticia", + }, + } + + // STOP OMIT + + m := f.(map[string]interface{}) + + for k, v := range m { + switch vv := v.(type) { + case string: + fmt.Println(k, "is string", vv) + case int: + fmt.Println(k, "is int", vv) + case []interface{}: + fmt.Println(k, "is an array:") + for i, u := range vv { + fmt.Println(i, u) + } + default: + fmt.Println(k, "is of a type I don't know how to handle") + } + } + + // STOP OMIT +} + +func main() { + Decode() +} diff --git a/doc/progs/json4.go b/doc/progs/json4.go new file mode 100644 index 0000000000000000000000000000000000000000..49263022065fc96b48e86b043377d1ca5ae0d4ba --- /dev/null +++ b/doc/progs/json4.go @@ -0,0 +1,45 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +import ( + "encoding/json" + "log" + "reflect" +) + +type FamilyMember struct { + Name string + Age int + Parents []string +} + +// STOP OMIT + +func Decode() { + b := []byte(`{"Name":"Bob","Age":20,"Parents":["Morticia", "Gomez"]}`) + var m FamilyMember + err := json.Unmarshal(b, &m) + + // STOP OMIT + + if err != nil { + panic(err) + } + + expected := FamilyMember{ + Name: "Bob", + Age: 20, + Parents: []string{"Morticia", "Gomez"}, + } + + if !reflect.DeepEqual(expected, m) { + log.Panicf("Error unmarshalling %q, expected %q, got %q", b, expected, m) + } +} + +func main() { + Decode() +} diff --git a/doc/progs/json5.go b/doc/progs/json5.go new file mode 100644 index 0000000000000000000000000000000000000000..6d7a4ca8c47dd3c65638b696c3af8035204ba3ca --- /dev/null +++ b/doc/progs/json5.go @@ -0,0 +1,31 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +import ( + "encoding/json" + "log" + "os" +) + +func main() { + dec := json.NewDecoder(os.Stdin) + enc := json.NewEncoder(os.Stdout) + for { + var v map[string]interface{} + if err := dec.Decode(&v); err != nil { + log.Println(err) + return + } + for k := range v { + if k != "Name" { + delete(v, k) + } + } + if err := enc.Encode(&v); err != nil { + log.Println(err) + } + } +} diff --git a/doc/progs/run.go b/doc/progs/run.go new file mode 100755 index 0000000000000000000000000000000000000000..8479a66b675b0b95ffffc8c0222de96df322d5a0 --- /dev/null +++ b/doc/progs/run.go @@ -0,0 +1,230 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// run runs the docs tests found in this directory. +package main + +import ( + "bytes" + "flag" + "fmt" + "io/ioutil" + "os" + "os/exec" + "path/filepath" + "regexp" + "runtime" + "strings" +) + +const usage = `go run run.go [tests] + +run.go runs the docs tests in this directory. +If no tests are provided, it runs all tests. +Tests may be specified without their .go suffix. +` + +func main() { + flag.Usage = func() { + fmt.Fprintf(os.Stderr, usage) + flag.PrintDefaults() + os.Exit(2) + } + + flag.Parse() + if flag.NArg() == 0 { + // run all tests + fixcgo() + } else { + // run specified tests + onlyTest(flag.Args()...) + } + + tmpdir, err := ioutil.TempDir("", "go-progs") + if err != nil { + fmt.Fprintln(os.Stderr, err) + os.Exit(1) + } + + // ratec limits the number of tests running concurrently. + // None of the tests are intensive, so don't bother + // trying to manually adjust for slow builders. + ratec := make(chan bool, runtime.NumCPU()) + errc := make(chan error, len(tests)) + + for _, tt := range tests { + tt := tt + ratec <- true + go func() { + errc <- test(tmpdir, tt.file, tt.want) + <-ratec + }() + } + + var rc int + for range tests { + if err := <-errc; err != nil { + fmt.Fprintln(os.Stderr, err) + rc = 1 + } + } + os.Remove(tmpdir) + os.Exit(rc) +} + +// test builds the test in the given file. +// If want is non-empty, test also runs the test +// and checks that the output matches the regexp want. +func test(tmpdir, file, want string) error { + // Build the program. + prog := filepath.Join(tmpdir, file) + cmd := exec.Command("go", "build", "-o", prog, file+".go") + out, err := cmd.CombinedOutput() + if err != nil { + return fmt.Errorf("go build %s.go failed: %v\nOutput:\n%s", file, err, out) + } + defer os.Remove(prog) + + // Only run the test if we have output to check. + if want == "" { + return nil + } + + cmd = exec.Command(prog) + out, err = cmd.CombinedOutput() + if err != nil { + return fmt.Errorf("%s failed: %v\nOutput:\n%s", file, err, out) + } + + // Canonicalize output. + out = bytes.TrimRight(out, "\n") + out = bytes.Replace(out, []byte{'\n'}, []byte{' '}, -1) + + // Check the result. + match, err := regexp.Match(want, out) + if err != nil { + return fmt.Errorf("failed to parse regexp %q: %v", want, err) + } + if !match { + return fmt.Errorf("%s.go:\n%q\ndoes not match %s", file, out, want) + } + + return nil +} + +type testcase struct { + file string + want string +} + +var tests = []testcase{ + // defer_panic_recover + {"defer", `^0 3210 2$`}, + {"defer2", `^Calling g. Printing in g 0 Printing in g 1 Printing in g 2 Printing in g 3 Panicking! Defer in g 3 Defer in g 2 Defer in g 1 Defer in g 0 Recovered in f 4 Returned normally from f.$`}, + + // effective_go + {"eff_bytesize", `^1.00YB 9.09TB$`}, + {"eff_qr", ""}, + {"eff_sequence", `^\[-1 2 6 16 44\]$`}, + {"eff_unused2", ""}, + + // error_handling + {"error", ""}, + {"error2", ""}, + {"error3", ""}, + {"error4", ""}, + + // law_of_reflection + {"interface", ""}, + {"interface2", `^type: float64$`}, + + // c_go_cgo + {"cgo1", ""}, + {"cgo2", ""}, + {"cgo3", ""}, + {"cgo4", ""}, + + // timeout + {"timeout1", ""}, + {"timeout2", ""}, + + // gobs + {"gobs1", ""}, + {"gobs2", ""}, + + // json + {"json1", `^$`}, + {"json2", `the reciprocal of i is`}, + {"json3", `Age is int 6`}, + {"json4", `^$`}, + {"json5", ""}, + + // image_package + {"image_package1", `^X is 2 Y is 1$`}, + {"image_package2", `^3 4 false$`}, + {"image_package3", `^3 4 true$`}, + {"image_package4", `^image.Point{X:2, Y:1}$`}, + {"image_package5", `^{255 0 0 255}$`}, + {"image_package6", `^8 4 true$`}, + + // other + {"go1", `^Christmas is a holiday: true .*go1.go already exists$`}, + {"slices", ""}, +} + +func onlyTest(files ...string) { + var new []testcase +NextFile: + for _, file := range files { + file = strings.TrimSuffix(file, ".go") + for _, tt := range tests { + if tt.file == file { + new = append(new, tt) + continue NextFile + } + } + fmt.Fprintf(os.Stderr, "test %s.go not found\n", file) + os.Exit(1) + } + tests = new +} + +func skipTest(file string) { + for i, tt := range tests { + if tt.file == file { + copy(tests[i:], tests[i+1:]) + tests = tests[:len(tests)-1] + return + } + } + panic("delete(" + file + "): not found") +} + +func fixcgo() { + if os.Getenv("CGO_ENABLED") != "1" { + skipTest("cgo1") + skipTest("cgo2") + skipTest("cgo3") + skipTest("cgo4") + return + } + + switch runtime.GOOS { + case "freebsd": + // cgo1 and cgo2 don't run on freebsd, srandom has a different signature + skipTest("cgo1") + skipTest("cgo2") + case "netbsd": + // cgo1 and cgo2 don't run on netbsd, srandom has a different signature + skipTest("cgo1") + skipTest("cgo2") + // cgo3 and cgo4 don't run on netbsd, since cgo cannot handle stdout correctly, see issue #10715. + skipTest("cgo3") + skipTest("cgo4") + case "openbsd", "solaris": + // cgo3 and cgo4 don't run on openbsd and solaris, since cgo cannot handle stdout correctly, see issue #10715. + skipTest("cgo3") + skipTest("cgo4") + } +} diff --git a/doc/progs/slices.go b/doc/progs/slices.go new file mode 100644 index 0000000000000000000000000000000000000000..967a3e76bde2dfa3238ad94c0cdbaf03884ce332 --- /dev/null +++ b/doc/progs/slices.go @@ -0,0 +1,63 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +import ( + "io/ioutil" + "regexp" +) + +func AppendByte(slice []byte, data ...byte) []byte { + m := len(slice) + n := m + len(data) + if n > cap(slice) { // if necessary, reallocate + // allocate double what's needed, for future growth. + newSlice := make([]byte, (n+1)*2) + copy(newSlice, slice) + slice = newSlice + } + slice = slice[0:n] + copy(slice[m:n], data) + return slice +} + +// STOP OMIT + +// Filter returns a new slice holding only +// the elements of s that satisfy fn. +func Filter(s []int, fn func(int) bool) []int { + var p []int // == nil + for _, i := range s { + if fn(i) { + p = append(p, i) + } + } + return p +} + +// STOP OMIT + +var digitRegexp = regexp.MustCompile("[0-9]+") + +func FindDigits(filename string) []byte { + b, _ := ioutil.ReadFile(filename) + return digitRegexp.Find(b) +} + +// STOP OMIT + +func CopyDigits(filename string) []byte { + b, _ := ioutil.ReadFile(filename) + b = digitRegexp.Find(b) + c := make([]byte, len(b)) + copy(c, b) + return c +} + +// STOP OMIT + +func main() { + // place holder; no need to run +} diff --git a/doc/progs/timeout1.go b/doc/progs/timeout1.go new file mode 100644 index 0000000000000000000000000000000000000000..353ba6908e5f1a4f152a3e76eadf7ac0baefa28c --- /dev/null +++ b/doc/progs/timeout1.go @@ -0,0 +1,29 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package timeout + +import ( + "time" +) + +func Timeout() { + ch := make(chan bool, 1) + timeout := make(chan bool, 1) + go func() { + time.Sleep(1 * time.Second) + timeout <- true + }() + + // STOP OMIT + + select { + case <-ch: + // a read from ch has occurred + case <-timeout: + // the read from ch has timed out + } + + // STOP OMIT +} diff --git a/doc/progs/timeout2.go b/doc/progs/timeout2.go new file mode 100644 index 0000000000000000000000000000000000000000..b0d34eabf8e37468cab71d04c2c76a66a468e110 --- /dev/null +++ b/doc/progs/timeout2.go @@ -0,0 +1,28 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package query + +type Conn string + +func (c Conn) DoQuery(query string) Result { + return Result("result") +} + +type Result string + +func Query(conns []Conn, query string) Result { + ch := make(chan Result, 1) + for _, conn := range conns { + go func(c Conn) { + select { + case ch <- c.DoQuery(query): + default: + } + }(conn) + } + return <-ch +} + +// STOP OMIT diff --git a/doc/root.html b/doc/root.html new file mode 100644 index 0000000000000000000000000000000000000000..27dbc74ab67d360aaa9d1661a7bbdc39235a16bc --- /dev/null +++ b/doc/root.html @@ -0,0 +1,152 @@ + + +
+ +
+ +
Try Go
+
+ +
+
+
+Hello, 世界
+
+
+
+Run +{{if $.Share}} + +{{end}} +Tour +
+
+ +
+
+ +
+ +
+ +
+Go is an open source programming language that makes it easy to build +simple, reliable, and efficient software. +
+ +
+ + +Download Go + +Binary distributions available for
+Linux, Mac OS X, Windows, and more. +
+
+ +
+ +
+ +
+ +
+
Featured video
+ +
+ +
+ +
+ +
+
Featured articles
+ +
+ +
+ +
+ + diff --git a/doc/security.html b/doc/security.html new file mode 100644 index 0000000000000000000000000000000000000000..1879ccfa6066202c38bde40f5a13c86331776dd3 --- /dev/null +++ b/doc/security.html @@ -0,0 +1,174 @@ + + +

Implementation

+ +

Reporting a Security Bug

+ +

+Please report to us any issues you find. +This document explains how to do that and what to expect in return. +

+ +

+All security bugs in the Go distribution should be reported by email to +security@golang.org. +This mail is delivered to a small security team. +Your email will be acknowledged within 24 hours, and you'll receive a more +detailed response to your email within 72 hours indicating the next steps in +handling your report. +If you would like, you can encrypt your report using our PGP key (listed below). +

+ +

+Please use a descriptive subject line for your report email. +After the initial reply to your report, the security team will endeavor to keep +you informed of the progress being made towards a fix and full announcement. +These updates will be sent at least every five days. +In reality, this is more likely to be every 24-48 hours. +

+ +

+If you have not received a reply to your email within 48 hours or you have not +heard from the security team for the past five days please contact the Go +security team directly: +

+ + + +

+Please note that golang-dev is a public discussion forum. +When escalating on this list, please do not disclose the details of the issue. +Simply state that you're trying to reach a member of the security team. +

+ +

Flagging Existing Issues as Security-related

+ +

+If you believe that an existing issue +is security-related, we ask that you send an email to +security@golang.org. +The email should include the issue ID and a short description of why it should +be handled according to this security policy. +

+ +

Disclosure Process

+ +

The Go project uses the following disclosure process:

+ +
    +
  1. Once the security report is received it is assigned a primary handler. +This person coordinates the fix and release process.
  2. +
  3. The issue is confirmed and a list of affected software is determined.
  4. +
  5. Code is audited to find any potential similar problems.
  6. +
  7. If it is determined, in consultation with the submitter, that a CVE-ID is +required, the primary handler obtains one via email to +oss-distros.
  8. +
  9. Fixes are prepared for the current stable release and the head/master +revision. These fixes are not yet committed to the public repository.
  10. +
  11. A notification is sent to the +golang-announce +mailing list to give users time to prepare their systems for the update.
  12. +
  13. Three working days following this notification, the fixes are applied to +the public repository and a new +Go release is issued.
  14. +
  15. On the date that the fixes are applied, announcements are sent to +golang-announce, +golang-dev, and +golang-nuts. +
+ +

+This process can take some time, especially when coordination is required with +maintainers of other projects. Every effort will be made to handle the bug in +as timely a manner as possible, however it's important that we follow the +process described above to ensure that disclosures are handled consistently. +

+ +

+For security issues that include the assignment of a CVE-ID, +the issue is listed publicly under the +"Golang" product on the CVEDetails website +as well as the +National Vulnerability Disclosure site. +

+ +

Receiving Security Updates

+ +

+The best way to receive security announcements is to subscribe to the +golang-announce +mailing list. Any messages pertaining to a security issue will be prefixed +with [security]. +

+ +

Comments on This Policy

+ +

+If you have any suggestions to improve this policy, please send an email to +golang-dev@golang.org for discussion. +

+ +

PGP Key for security@golang.org

+ +
+-----BEGIN PGP PUBLIC KEY BLOCK-----
+Comment: GPGTools - https://gpgtools.org
+
+mQINBFXI1h0BEADZdm05GDFWvjmQKutUVb0cJKS+VR+6XU3g/YQZGC8tnIL6i7te
++fPJHfQc2uIw0xeBgZX4Ni/S8yIqsbIjqYeaToX7QFUufJDQwrmlQRDVAvvT5HBT
+J80JEs7yHRreFoLzB6dnWehWXzWle4gFKeIy+hvLrYquZVvbeEYTnX7fNzZg0+5L
+ksvj7lnQlJIy1l3sL/7uPr9qsm45/hzd0WjTQS85Ry6Na3tMwRpqGENDh25Blz75
+8JgK9JmtTJa00my1zzeCXU04CKKEMRbkMLozzudOH4ZLiLWcFiKRpeCn860wC8l3
+oJcyyObuTSbr9o05ra3On+epjCEFkknGX1WxPv+TV34i0a23AtuVyTCloKb7RYXc
+7mUaskZpU2rFBqIkzZ4MQJ7RDtGlm5oBy36j2QL63jAZ1cKoT/yvjJNp2ObmWaVF
+X3tk/nYw2H0YDjTkTCgGtyAOj3Cfqrtsa5L0jG5K2p4RY8mtVgQ5EOh7QxuS+rmN
+JiA39SWh7O6uFCwkz/OCXzqeh6/nP10HAb9S9IC34QQxm7Fhd0ZXzEv9IlBTIRzk
+xddSdACPnLE1gJcFHxBd2LTqS/lmAFShCsf8S252kagKJfHRebQJZHCIs6kT9PfE
+0muq6KRKeDXv01afAUvoB4QW/3chUrtgL2HryyO8ugMu7leVGmoZhFkIrQARAQAB
+tCZHbyBTZWN1cml0eSBUZWFtIDxzZWN1cml0eUBnb2xhbmcub3JnPokCPQQTAQoA
+JwUCVcjWHQIbAwUJB4YfgAULCQgHAwUVCgkICwUWAgMBAAIeAQIXgAAKCRA6RtGR
+eVpYOLnDD/9YVTd6DTwdJq6irVfM/ICPlPTXB0JLERqCI1Veptcp56eQoJ0XWGQp
+tkGlgbvmCzFo0B+65Te7YA4R3oyBCXd6JgyWQQPy5p60FHyuuCPVAReclSWyt9f2
+Yj/u4DjghKhELOvPiI96egcU3g9jrEEcPjm7JYkc9M2gVSNOnnJvcD7wpQJNCzon
+51eMZ1ZyfA5UCBTa0SaT9eXg5zwNlYQnB6ZF6TjXezkhLqlTsBuHxoNVf+9vCC0o
+ZKIM2ovptMx9eEguTDKWaQ7tero7Zs/q5fwk/MDzM/LGJ9aXy2RCtqBxv46vDS7G
+fCNq+aPD/wyFd6hxQkvkua6hgZwYT+cJWHYA2Yv0LO3BYOJdjfc+j2hjv+mC9lF0
+UpWhCVJv3hHoFaxnz62GdROzf2wXz6aR9Saj1rYSvqT9jC20VInxqMufXNN2sbpo
+Kyk6MTbAeepphQpfAWQv+ltWgBiEjuFxYdwv/vmw20996JV7O8nqkeCUW84B6su+
+Y3bbdP9o3DBtOT0j9LTB/FucmdNCNHoO+EnNBKJd6FoYTGLWi3Rq9DLx2V9tdJHo
+Bn67dymcl+iyp337HJNY+qS+KCgoqAWlxkzXRiXKb/yluhXdIkqhg4kL8JPAJvfS
+cs7Zn67Mx04ixJnRMYCDmxtD4xPsFMzM7g8m3PQp+nE7WhujM/ImM7kCDQRVyNYd
+ARAAlw9H/1ybQs4K3XKA1joII16rta9KS7ew76+agXo0jeSRwMEQfItOxYvfhmo8
++ydn5TWsTbifGU8L3+EBTMRRyzWhbaGO0Wizw7BTVJ7n5JW+ndPrcUpp/ilUk6AU
+VxaO/8/R+9+VJZpoeoLHXYloFGNuX58GLIy1jSBvLsLl/Ki5IOrHvD1GK6TftOl5
+j8IPC1LSBrwGJO803x7wUdQP/tsKN/QPR8pnBntrEgrQFSI+Q3qrCvVMmXnBlYum
+jfOBt8pKMgB9/ix+HWN8piQNQiJxD+XjEM6XwUmQqIR7y5GINKWgundCmtYIzVgY
+9p2Br6UPrTJi12LfKv5s2R6NnxFHv/ad29CpPTeLJRsSqFfqBL969BCpj/isXmQE
+m4FtziZidARXo12KiGAnPF9otirNHp4+8hwNB3scf7cI53y8nZivO9cwI7BoClY6
+ZIabjDcJxjK+24emoz3mJ5SHpZpQLSb9o8GbLLfXOq+4uzEX2A30fhrtsQb/x0GM
+4v3EU1aP2mjuksyYbgldtY64tD35wqAA9mVl5Ux+g1HoUBvLw0h+lzwh370NJw//
+ITvBQVUtDMB96rfIP4fL5pYl5pmRz+vsuJ0iXzm05qBgKfSqO7To9SWxQPdX89R4
+u0/XVAlw0Ak9Zceq3W96vseEUTR3aoZCMIPiwfcDaq60rWUAEQEAAYkCJQQYAQoA
+DwUCVcjWHQIbDAUJB4YfgAAKCRA6RtGReVpYOEg/EADZcIYw4q1jAbDkDy3LQG07
+AR8QmLp/RDp72RKbCSIYyvyXEnmrhUg98lUG676qTH+Y7dlEX107dLhFuKEYyV8D
+ZalrFQO/3WpLWdIAmWrj/wq14qii1rgmy96Nh3EqG3CS50HEMGkW1llRx2rgBvGl
+pgoTcwOfT+h8s0HlZdIS/cv2wXqwPgMWr1PIk3as1fu1OH8n/BjeGQQnNJEaoBV7
+El2C/hz3oqf2uYQ1QvpU23F1NrstekxukO8o2Y/fqsgMJqAiNJApUCl/dNhK+W57
+iicjvPirUQk8MUVEHXKhWIzYxon6aEUTx+xyNMBpRJIZlJ61FxtnZhoPiAFtXVPb
++95BRJA9npidlVFjqz9QDK/4NSnJ3KaERR9tTDcvq4zqT22Z1Ai5gWQKqogTz5Mk
+F+nZwVizW0yi33id9qDpAuApp8o6AiyH5Ql1Bo23bvqS2lMrXPIS/QmPPsA76CBs
+lYjQwwz8abUD1pPdzyYtMKZUMwhicSFOHFDM4oQN16k2KJuntuih8BKVDCzIOq+E
+KHyeh1BqWplUtFh1ckxZlXW9p9F7TsWjtfcKaY8hkX0Cr4uVjwAFIjLcAxk67ROe
+huEb3Gt+lwJz6aNnZUU87ukMAxRVR2LL0btdxgc6z8spl66GXro/LUkXmAdyOEMV
+UDrmjf9pr7o00hC7lCHFzw==
+=WE0r
+-----END PGP PUBLIC KEY BLOCK-----
+
diff --git a/doc/share.png b/doc/share.png new file mode 100644 index 0000000000000000000000000000000000000000..c04f0c71aa3de279e176974ca5dfc43d297791e7 Binary files /dev/null and b/doc/share.png differ diff --git a/doc/tos.html b/doc/tos.html new file mode 100644 index 0000000000000000000000000000000000000000..fff46428ecfb484617adeb86d57414f75a6f4217 --- /dev/null +++ b/doc/tos.html @@ -0,0 +1,11 @@ + + +

+The Go website (the "Website") is hosted by Google. +By using and/or visiting the Website, you consent to be bound by Google's general +Terms of Service +and Google's general +Privacy Policy. +

diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..d287722d806eed6369720b3cb073ce678e9390bc Binary files /dev/null and b/favicon.ico differ diff --git a/lib/time/README b/lib/time/README new file mode 100644 index 0000000000000000000000000000000000000000..ffce9b0e08508f2b0e7c495b7132f41f857e4460 --- /dev/null +++ b/lib/time/README @@ -0,0 +1,10 @@ +The zoneinfo.zip archive contains time zone files compiled using +the code and data maintained as part of the IANA Time Zone Database. +The IANA asserts that the database is in the public domain. + +For more information, see +http://www.iana.org/time-zones +ftp://ftp.iana.org/tz/code/tz-link.htm +http://tools.ietf.org/html/rfc6557 + +To rebuild the archive, read and run update.bash. diff --git a/lib/time/update.bash b/lib/time/update.bash new file mode 100755 index 0000000000000000000000000000000000000000..3ef1df582cf2adab68dea006c0098cb7068873c0 --- /dev/null +++ b/lib/time/update.bash @@ -0,0 +1,50 @@ +#!/bin/sh +# Copyright 2012 The Go Authors. All rights reserved. +# Use of this source code is governed by a BSD-style +# license that can be found in the LICENSE file. + +# This script rebuilds the time zone files using files +# downloaded from the ICANN/IANA distribution. + +# Versions to use. +CODE=2015e +DATA=2015e + +set -e +rm -rf work +mkdir work +cd work +mkdir zoneinfo +curl -O http://www.iana.org/time-zones/repository/releases/tzcode$CODE.tar.gz +curl -O http://www.iana.org/time-zones/repository/releases/tzdata$DATA.tar.gz +tar xzf tzcode$CODE.tar.gz +tar xzf tzdata$DATA.tar.gz + +# Turn off 64-bit output in time zone files. +# We don't need those until 2037. +perl -p -i -e 's/pass <= 2/pass <= 1/' zic.c + +make CFLAGS=-DSTD_INSPIRED AWK=awk TZDIR=zoneinfo posix_only + +# America/Los_Angeles should not be bigger than 1100 bytes. +# If it is, we probably failed to disable the 64-bit output, which +# triples the size of the files. +size=$(ls -l zoneinfo/America/Los_Angeles | awk '{print $5}') +if [ $size -gt 1200 ]; then + echo 'zone file too large; 64-bit edit failed?' >&2 + exit 2 +fi + +cd zoneinfo +rm -f ../../zoneinfo.zip +zip -0 -r ../../zoneinfo.zip * +cd ../.. + +echo +if [ "$1" == "-work" ]; then + echo Left workspace behind in work/. +else + rm -rf work +fi +echo New time zone files in zoneinfo.zip. + diff --git a/lib/time/zoneinfo.zip b/lib/time/zoneinfo.zip new file mode 100644 index 0000000000000000000000000000000000000000..73c30b45970f489c9b8b7bea0f1ccdfa958b5d49 Binary files /dev/null and b/lib/time/zoneinfo.zip differ diff --git a/misc/android/README b/misc/android/README new file mode 100644 index 0000000000000000000000000000000000000000..7b17d879e864df5b02123b207e9d26001ab832d1 --- /dev/null +++ b/misc/android/README @@ -0,0 +1,11 @@ +Android +======= + +For details on developing Go for Android, see the documentation in the +mobile subrepository: + + https://github.com/golang/mobile + +To run the standard library tests, see androidtest.bash. Run it as + + CC_FOR_TARGET=.../ndk-gcc GOARCH=arm GOARM=7 ./androidtest.bash diff --git a/misc/android/cleaner.go b/misc/android/cleaner.go new file mode 100644 index 0000000000000000000000000000000000000000..dafb1626976a25b5143c8abb05ba8ac21a9aaf11 --- /dev/null +++ b/misc/android/cleaner.go @@ -0,0 +1,39 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Cleaner removes anything from /data/local/tmp/goroot not on a builtin list. +// Used by androidtest.bash. +package main + +import ( + "log" + "os" + "path/filepath" + "strings" +) + +func main() { + const goroot = "/data/local/tmp/goroot" + expect := make(map[string]bool) + for _, f := range strings.Split(files, "\n") { + expect[filepath.Join(goroot, f)] = true + } + + err := filepath.Walk(goroot, func(path string, info os.FileInfo, err error) error { + if expect[path] { + return nil + } + log.Printf("removing %s", path) + if err := os.RemoveAll(path); err != nil { + return err + } + if info.IsDir() { + return filepath.SkipDir + } + return nil + }) + if err != nil { + log.Fatal(err) + } +} diff --git a/misc/android/go_android_exec.go b/misc/android/go_android_exec.go new file mode 100644 index 0000000000000000000000000000000000000000..a67e990c349890eb4b127a65bc91fb48b961c1f9 --- /dev/null +++ b/misc/android/go_android_exec.go @@ -0,0 +1,132 @@ +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// This program can be used as go_android_GOARCH_exec by the Go tool. +// It executes binaries on an android device using adb. +package main + +import ( + "bytes" + "fmt" + "go/build" + "io" + "log" + "os" + "os/exec" + "path/filepath" + "runtime" + "strconv" + "strings" +) + +func run(args ...string) string { + buf := new(bytes.Buffer) + cmd := exec.Command("adb", args...) + cmd.Stdout = io.MultiWriter(os.Stdout, buf) + cmd.Stderr = os.Stderr + log.Printf("adb %s", strings.Join(args, " ")) + err := cmd.Run() + if err != nil { + log.Fatalf("adb %s: %v", strings.Join(args, " "), err) + } + return buf.String() +} + +const ( + // Directory structure on the target device androidtest.bash assumes. + deviceGoroot = "/data/local/tmp/goroot" + deviceGopath = "/data/local/tmp/gopath" +) + +func main() { + log.SetFlags(0) + log.SetPrefix("go_android_exec: ") + + // Prepare a temporary directory that will be cleaned up at the end. + deviceGotmp := fmt.Sprintf("/data/local/tmp/%s-%d", + filepath.Base(os.Args[1]), os.Getpid()) + run("shell", "mkdir", "-p", deviceGotmp) + + // Determine the package by examining the current working + // directory, which will look something like + // "$GOROOT/src/mime/multipart" or "$GOPATH/src/golang.org/x/mobile". + // We extract everything after the $GOROOT or $GOPATH to run on the + // same relative directory on the target device. + subdir, inGoRoot := subdir() + deviceCwd := filepath.Join(deviceGoroot, subdir) + if !inGoRoot { + deviceCwd = filepath.Join(deviceGopath, subdir) + } + + // Binary names can conflict. + // E.g. template.test from the {html,text}/template packages. + binName := filepath.Base(os.Args[1]) + deviceBin := fmt.Sprintf("%s/%s-%d", deviceGotmp, binName, os.Getpid()) + + // The push of the binary happens in parallel with other tests. + // Unfortunately, a simultaneous call to adb shell hold open + // file descriptors, so it is necessary to push then move to + // avoid a "text file busy" error on execution. + // https://code.google.com/p/android/issues/detail?id=65857 + run("push", os.Args[1], deviceBin+"-tmp") + run("shell", "cp '"+deviceBin+"-tmp' '"+deviceBin+"'") + run("shell", "rm '"+deviceBin+"-tmp'") + + // The adb shell command will return an exit code of 0 regardless + // of the command run. E.g. + // $ adb shell false + // $ echo $? + // 0 + // https://code.google.com/p/android/issues/detail?id=3254 + // So we append the exitcode to the output and parse it from there. + const exitstr = "exitcode=" + cmd := `export TMPDIR="` + deviceGotmp + `"` + + `; export GOROOT="` + deviceGoroot + `"` + + `; export GOPATH="` + deviceGopath + `"` + + `; cd "` + deviceCwd + `"` + + "; '" + deviceBin + "' " + strings.Join(os.Args[2:], " ") + + "; echo -n " + exitstr + "$?" + output := run("shell", cmd) + + run("shell", "rm", "-rf", deviceGotmp) // Clean up. + + output = output[strings.LastIndex(output, "\n")+1:] + if !strings.HasPrefix(output, exitstr) { + log.Fatalf("no exit code: %q", output) + } + code, err := strconv.Atoi(output[len(exitstr):]) + if err != nil { + log.Fatalf("bad exit code: %v", err) + } + os.Exit(code) +} + +// subdir determines the package based on the current working directory, +// and returns the path to the package source relative to $GOROOT (or $GOPATH). +func subdir() (pkgpath string, underGoRoot bool) { + cwd, err := os.Getwd() + if err != nil { + log.Fatal(err) + } + if root := runtime.GOROOT(); strings.HasPrefix(cwd, root) { + subdir, err := filepath.Rel(root, cwd) + if err != nil { + log.Fatal(err) + } + return subdir, true + } + + for _, p := range filepath.SplitList(build.Default.GOPATH) { + if !strings.HasPrefix(cwd, p) { + continue + } + subdir, err := filepath.Rel(p, cwd) + if err == nil { + return subdir, false + } + } + log.Fatalf("the current path %q is not in either GOROOT(%q) or GOPATH(%q)", + cwd, runtime.GOROOT(), build.Default.GOPATH) + return "", false +} diff --git a/misc/arm/a b/misc/arm/a new file mode 100755 index 0000000000000000000000000000000000000000..701f4941ffbddec49c90b832b00c60f09f914526 --- /dev/null +++ b/misc/arm/a @@ -0,0 +1,58 @@ +#!/usr/bin/env bash + +# Copyright 2010 The Go Authors. All rights reserved. +# Use of this source code is governed by a BSD-style +# license that can be found in the LICENSE file. + +# This is a small script for executing go binaries on the android platform. +# +# example: +# ./a 5.out foo bar baz +# +# The script exports the local values of GOARCH, GOTRACEBACK and GOGC +# to the android environment. +# +# Known issues: +# The script fails unless the last character output by the program is "\n" +# +# TODO(kaib): add gdb bridge support + +exp () +{ + if [ ${!1} ]; then + echo "export $1=\"${!1}\"; " + fi +} + +# adb does not correctly return the exit value of the executed program. use this +# wrapper to manually extract the exit value +rloc=/data/local/tmp/retval +rsize=$(adb shell "ls -l $rloc"|tr -s ' '|cut -d' ' -f4) +rcheck=38 +if [ "$rsize" != "$rcheck" ]; then +# echo "debug: retval size incorrect want $rcheck, got $rsize. uploading" + echo >/tmp/adb.retval '#!/system/bin/sh +"$@" +echo RETVAL: $?' + adb push /tmp/adb.retval $rloc >/dev/null 2>&1 + adb shell chmod 755 $rloc +fi + +# run the main binary +if [ "-g" == "$1" ]; then + adb forward tcp:$2 tcp:$2 + args=$(echo $*| cut -d' ' -f4-) + adb push $3 /data/local/tmp/$3 >/dev/null 2>&1 + adb shell "$(exp GOARCH) $(exp GOTRACEBACK) $(exp GOGC) \ + gdbserver :$2 /data/local/tmp/retval /data/local/tmp/$3 $args" \ + 2>&1|tr -d '\r' |tee /tmp/adb.out|grep -v RETVAL +else + if [ "$*" != "$1" ]; then + args=$(echo $*| cut -d' ' -f2-) + fi + adb push $1 /data/local/tmp/$1 >/dev/null 2>&1 + adb shell "$(exp GOARCH) $(exp GOTRACEBACK) $(exp GOGC) \ + /data/local/tmp/retval /data/local/tmp/$1 $args" \ + 2>&1|tr -d '\r' |tee /tmp/adb.out|grep -v RETVAL +fi +exit $(grep RETVAL /tmp/adb.out|tr -d '\n\r'| cut -d' ' -f2) diff --git a/misc/benchcmp b/misc/benchcmp new file mode 100755 index 0000000000000000000000000000000000000000..84d92eefd40c6730e8ab4e48a641cea93ada9ac3 --- /dev/null +++ b/misc/benchcmp @@ -0,0 +1,5 @@ +#!/bin/bash + +echo 'misc/benchcmp has moved:' >&2 +echo ' go get -u golang.org/x/tools/cmd/benchcmp' >&2 +exit 2 diff --git a/misc/cgo/errors/err1.go b/misc/cgo/errors/err1.go new file mode 100644 index 0000000000000000000000000000000000000000..8e674dce7dfaf388f8648b6c0c2b8a33523e3e50 --- /dev/null +++ b/misc/cgo/errors/err1.go @@ -0,0 +1,18 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +/* +#cgo LDFLAGS: -c + +void test() { + xxx; // ERROR HERE +} +*/ +import "C" + +func main() { + C.test() +} diff --git a/misc/cgo/errors/err2.go b/misc/cgo/errors/err2.go new file mode 100644 index 0000000000000000000000000000000000000000..0c64ffeebf85b80c282ed0a5c0223b71219f8541 --- /dev/null +++ b/misc/cgo/errors/err2.go @@ -0,0 +1,13 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +import "C" + +func main() { + s := "" + _ = s + C.malloc(s) // ERROR HERE +} diff --git a/misc/cgo/errors/err3.go b/misc/cgo/errors/err3.go new file mode 100644 index 0000000000000000000000000000000000000000..3680a4a4c1e5f39113bcf5cb03a0cdd25bf9150a --- /dev/null +++ b/misc/cgo/errors/err3.go @@ -0,0 +1,18 @@ +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +/* +typedef struct foo foo_t; +typedef struct bar bar_t; + +foo_t *foop; +*/ +import "C" + +func main() { + x := (*C.bar_t)(nil) + C.foop = x // ERROR HERE +} diff --git a/misc/cgo/errors/issue7757.go b/misc/cgo/errors/issue7757.go new file mode 100644 index 0000000000000000000000000000000000000000..5eafd22e8a894603f5b8613187412217f67239b5 --- /dev/null +++ b/misc/cgo/errors/issue7757.go @@ -0,0 +1,14 @@ +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +/* +void foo() {} +*/ +import "C" + +func main() { + C.foo = C.foo // ERROR HERE +} diff --git a/misc/cgo/errors/issue8442.go b/misc/cgo/errors/issue8442.go new file mode 100644 index 0000000000000000000000000000000000000000..45daf8e59ecf95fcdfa99355723f426bae03b2f7 --- /dev/null +++ b/misc/cgo/errors/issue8442.go @@ -0,0 +1,17 @@ +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +// Issue 8442. Cgo output unhelpful error messages for +// invalid C preambles. + +/* +void issue8442foo(UNDEF*); // ERROR HERE +*/ +import "C" + +func main() { + C.issue8442foo(nil) +} diff --git a/misc/cgo/errors/test.bash b/misc/cgo/errors/test.bash new file mode 100755 index 0000000000000000000000000000000000000000..c880ad65c279a3ed1d3c82ef18298f703513bfc5 --- /dev/null +++ b/misc/cgo/errors/test.bash @@ -0,0 +1,36 @@ +#!/usr/bin/env bash + +# Copyright 2013 The Go Authors. All rights reserved. +# Use of this source code is governed by a BSD-style +# license that can be found in the LICENSE file. + +check() { + file=$1 + line=$(grep -n 'ERROR HERE' $file | sed 's/:.*//') + if [ "$line" = "" ]; then + echo 1>&2 misc/cgo/errors/test.bash: BUG: cannot find ERROR HERE in $file + exit 1 + fi + if go build $file >errs 2>&1; then + echo 1>&2 misc/cgo/errors/test.bash: BUG: expected cgo to fail but it succeeded + exit 1 + fi + if ! test -s errs; then + echo 1>&2 misc/cgo/errors/test.bash: BUG: expected error output but saw none + exit 1 + fi + if ! fgrep $file:$line: errs >/dev/null 2>&1; then + echo 1>&2 misc/cgo/errors/test.bash: BUG: expected error on line $line but saw: + cat 1>&2 errs + exit 1 + fi +} + +check err1.go +check err2.go +check err3.go +check issue7757.go +check issue8442.go + +rm -rf errs _obj +exit 0 diff --git a/misc/cgo/gmp/fib.go b/misc/cgo/gmp/fib.go new file mode 100644 index 0000000000000000000000000000000000000000..18434beaf35871d163a697c0f734dac6d5961d2a --- /dev/null +++ b/misc/cgo/gmp/fib.go @@ -0,0 +1,45 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build ignore + +// Compute Fibonacci numbers with two goroutines +// that pass integers back and forth. No actual +// concurrency, just threads and synchronization +// and foreign code on multiple pthreads. + +package main + +import ( + big "." + "runtime" +) + +func fibber(c chan *big.Int, out chan string, n int64) { + // Keep the fibbers in dedicated operating system + // threads, so that this program tests coordination + // between pthreads and not just goroutines. + runtime.LockOSThread() + + i := big.NewInt(n) + if n == 0 { + c <- i + } + for { + j := <-c + out <- j.String() + i.Add(i, j) + c <- i + } +} + +func main() { + c := make(chan *big.Int) + out := make(chan string) + go fibber(c, out, 0) + go fibber(c, out, 1) + for i := 0; i < 200; i++ { + println(<-out) + } +} diff --git a/misc/cgo/gmp/gmp.go b/misc/cgo/gmp/gmp.go new file mode 100644 index 0000000000000000000000000000000000000000..d39bfe64083afa2b6c80b247b96a83bc15340f1c --- /dev/null +++ b/misc/cgo/gmp/gmp.go @@ -0,0 +1,380 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +/* +An example of wrapping a C library in Go. This is the GNU +multiprecision library gmp's integer type mpz_t wrapped to look like +the Go package big's integer type Int. + +This is a syntactically valid Go program—it can be parsed with the Go +parser and processed by godoc—but it is not compiled directly by gc. +Instead, a separate tool, cgo, processes it to produce three output +files. The first two, 6g.go and 6c.c, are a Go source file for 6g and +a C source file for 6c; both compile as part of the named package +(gmp, in this example). The third, gcc.c, is a C source file for gcc; +it compiles into a shared object (.so) that is dynamically linked into +any 6.out that imports the first two files. + +The stanza + + // #include + import "C" + +is a signal to cgo. The doc comment on the import of "C" provides +additional context for the C file. Here it is just a single #include +but it could contain arbitrary C definitions to be imported and used. + +Cgo recognizes any use of a qualified identifier C.xxx and uses gcc to +find the definition of xxx. If xxx is a type, cgo replaces C.xxx with +a Go translation. C arithmetic types translate to precisely-sized Go +arithmetic types. A C struct translates to a Go struct, field by +field; unrepresentable fields are replaced with opaque byte arrays. A +C union translates into a struct containing the first union member and +perhaps additional padding. C arrays become Go arrays. C pointers +become Go pointers. C function pointers become Go's uintptr. +C void pointers become Go's unsafe.Pointer. + +For example, mpz_t is defined in as: + + typedef unsigned long int mp_limb_t; + + typedef struct + { + int _mp_alloc; + int _mp_size; + mp_limb_t *_mp_d; + } __mpz_struct; + + typedef __mpz_struct mpz_t[1]; + +Cgo generates: + + type _C_int int32 + type _C_mp_limb_t uint64 + type _C___mpz_struct struct { + _mp_alloc _C_int; + _mp_size _C_int; + _mp_d *_C_mp_limb_t; + } + type _C_mpz_t [1]_C___mpz_struct + +and then replaces each occurrence of a type C.xxx with _C_xxx. + +If xxx is data, cgo arranges for C.xxx to refer to the C variable, +with the type translated as described above. To do this, cgo must +introduce a Go variable that points at the C variable (the linker can +be told to initialize this pointer). For example, if the gmp library +provided + + mpz_t zero; + +then cgo would rewrite a reference to C.zero by introducing + + var _C_zero *C.mpz_t + +and then replacing all instances of C.zero with (*_C_zero). + +Cgo's most interesting translation is for functions. If xxx is a C +function, then cgo rewrites C.xxx into a new function _C_xxx that +calls the C xxx in a standard pthread. The new function translates +its arguments, calls xxx, and translates the return value. + +Translation of parameters and the return value follows the type +translation above except that arrays passed as parameters translate +explicitly in Go to pointers to arrays, as they do (implicitly) in C. + +Garbage collection is the big problem. It is fine for the Go world to +have pointers into the C world and to free those pointers when they +are no longer needed. To help, the Go code can define Go objects +holding the C pointers and use runtime.SetFinalizer on those Go objects. + +It is much more difficult for the C world to have pointers into the Go +world, because the Go garbage collector is unaware of the memory +allocated by C. The most important consideration is not to +constrain future implementations, so the rule is that Go code can +hand a Go pointer to C code but must separately arrange for +Go to hang on to a reference to the pointer until C is done with it. +*/ +package gmp + +/* +#cgo LDFLAGS: -lgmp +#include +#include + +// gmp 5.0.0+ changed the type of the 3rd argument to mp_bitcnt_t, +// so, to support older versions, we wrap these two functions. +void _mpz_mul_2exp(mpz_ptr a, mpz_ptr b, unsigned long n) { + mpz_mul_2exp(a, b, n); +} +void _mpz_div_2exp(mpz_ptr a, mpz_ptr b, unsigned long n) { + mpz_div_2exp(a, b, n); +} +*/ +import "C" + +import ( + "os" + "unsafe" +) + +/* + * one of a kind + */ + +// An Int represents a signed multi-precision integer. +// The zero value for an Int represents the value 0. +type Int struct { + i C.mpz_t + init bool +} + +// NewInt returns a new Int initialized to x. +func NewInt(x int64) *Int { return new(Int).SetInt64(x) } + +// Int promises that the zero value is a 0, but in gmp +// the zero value is a crash. To bridge the gap, the +// init bool says whether this is a valid gmp value. +// doinit initializes z.i if it needs it. This is not inherent +// to FFI, just a mismatch between Go's convention of +// making zero values useful and gmp's decision not to. +func (z *Int) doinit() { + if z.init { + return + } + z.init = true + C.mpz_init(&z.i[0]) +} + +// Bytes returns z's representation as a big-endian byte array. +func (z *Int) Bytes() []byte { + b := make([]byte, (z.Len()+7)/8) + n := C.size_t(len(b)) + C.mpz_export(unsafe.Pointer(&b[0]), &n, 1, 1, 1, 0, &z.i[0]) + return b[0:n] +} + +// Len returns the length of z in bits. 0 is considered to have length 1. +func (z *Int) Len() int { + z.doinit() + return int(C.mpz_sizeinbase(&z.i[0], 2)) +} + +// Set sets z = x and returns z. +func (z *Int) Set(x *Int) *Int { + z.doinit() + C.mpz_set(&z.i[0], &x.i[0]) + return z +} + +// SetBytes interprets b as the bytes of a big-endian integer +// and sets z to that value. +func (z *Int) SetBytes(b []byte) *Int { + z.doinit() + if len(b) == 0 { + z.SetInt64(0) + } else { + C.mpz_import(&z.i[0], C.size_t(len(b)), 1, 1, 1, 0, unsafe.Pointer(&b[0])) + } + return z +} + +// SetInt64 sets z = x and returns z. +func (z *Int) SetInt64(x int64) *Int { + z.doinit() + // TODO(rsc): more work on 32-bit platforms + C.mpz_set_si(&z.i[0], C.long(x)) + return z +} + +// SetString interprets s as a number in the given base +// and sets z to that value. The base must be in the range [2,36]. +// SetString returns an error if s cannot be parsed or the base is invalid. +func (z *Int) SetString(s string, base int) error { + z.doinit() + if base < 2 || base > 36 { + return os.ErrInvalid + } + p := C.CString(s) + defer C.free(unsafe.Pointer(p)) + if C.mpz_set_str(&z.i[0], p, C.int(base)) < 0 { + return os.ErrInvalid + } + return nil +} + +// String returns the decimal representation of z. +func (z *Int) String() string { + if z == nil { + return "nil" + } + z.doinit() + p := C.mpz_get_str(nil, 10, &z.i[0]) + s := C.GoString(p) + C.free(unsafe.Pointer(p)) + return s +} + +func (z *Int) destroy() { + if z.init { + C.mpz_clear(&z.i[0]) + } + z.init = false +} + +/* + * arithmetic + */ + +// Add sets z = x + y and returns z. +func (z *Int) Add(x, y *Int) *Int { + x.doinit() + y.doinit() + z.doinit() + C.mpz_add(&z.i[0], &x.i[0], &y.i[0]) + return z +} + +// Sub sets z = x - y and returns z. +func (z *Int) Sub(x, y *Int) *Int { + x.doinit() + y.doinit() + z.doinit() + C.mpz_sub(&z.i[0], &x.i[0], &y.i[0]) + return z +} + +// Mul sets z = x * y and returns z. +func (z *Int) Mul(x, y *Int) *Int { + x.doinit() + y.doinit() + z.doinit() + C.mpz_mul(&z.i[0], &x.i[0], &y.i[0]) + return z +} + +// Div sets z = x / y, rounding toward zero, and returns z. +func (z *Int) Div(x, y *Int) *Int { + x.doinit() + y.doinit() + z.doinit() + C.mpz_tdiv_q(&z.i[0], &x.i[0], &y.i[0]) + return z +} + +// Mod sets z = x % y and returns z. +// Like the result of the Go % operator, z has the same sign as x. +func (z *Int) Mod(x, y *Int) *Int { + x.doinit() + y.doinit() + z.doinit() + C.mpz_tdiv_r(&z.i[0], &x.i[0], &y.i[0]) + return z +} + +// Lsh sets z = x << s and returns z. +func (z *Int) Lsh(x *Int, s uint) *Int { + x.doinit() + z.doinit() + C._mpz_mul_2exp(&z.i[0], &x.i[0], C.ulong(s)) + return z +} + +// Rsh sets z = x >> s and returns z. +func (z *Int) Rsh(x *Int, s uint) *Int { + x.doinit() + z.doinit() + C._mpz_div_2exp(&z.i[0], &x.i[0], C.ulong(s)) + return z +} + +// Exp sets z = x^y % m and returns z. +// If m == nil, Exp sets z = x^y. +func (z *Int) Exp(x, y, m *Int) *Int { + m.doinit() + x.doinit() + y.doinit() + z.doinit() + if m == nil { + C.mpz_pow_ui(&z.i[0], &x.i[0], C.mpz_get_ui(&y.i[0])) + } else { + C.mpz_powm(&z.i[0], &x.i[0], &y.i[0], &m.i[0]) + } + return z +} + +func (z *Int) Int64() int64 { + if !z.init { + return 0 + } + return int64(C.mpz_get_si(&z.i[0])) +} + +// Neg sets z = -x and returns z. +func (z *Int) Neg(x *Int) *Int { + x.doinit() + z.doinit() + C.mpz_neg(&z.i[0], &x.i[0]) + return z +} + +// Abs sets z to the absolute value of x and returns z. +func (z *Int) Abs(x *Int) *Int { + x.doinit() + z.doinit() + C.mpz_abs(&z.i[0], &x.i[0]) + return z +} + +/* + * functions without a clear receiver + */ + +// CmpInt compares x and y. The result is +// +// -1 if x < y +// 0 if x == y +// +1 if x > y +// +func CmpInt(x, y *Int) int { + x.doinit() + y.doinit() + switch cmp := C.mpz_cmp(&x.i[0], &y.i[0]); { + case cmp < 0: + return -1 + case cmp == 0: + return 0 + } + return +1 +} + +// DivModInt sets q = x / y and r = x % y. +func DivModInt(q, r, x, y *Int) { + q.doinit() + r.doinit() + x.doinit() + y.doinit() + C.mpz_tdiv_qr(&q.i[0], &r.i[0], &x.i[0], &y.i[0]) +} + +// GcdInt sets d to the greatest common divisor of a and b, +// which must be positive numbers. +// If x and y are not nil, GcdInt sets x and y such that d = a*x + b*y. +// If either a or b is not positive, GcdInt sets d = x = y = 0. +func GcdInt(d, x, y, a, b *Int) { + d.doinit() + x.doinit() + y.doinit() + a.doinit() + b.doinit() + C.mpz_gcdext(&d.i[0], &x.i[0], &y.i[0], &a.i[0], &b.i[0]) +} + +// ProbablyPrime performs n Miller-Rabin tests to check whether z is prime. +// If it returns true, z is prime with probability 1 - 1/4^n. +// If it returns false, z is not prime. +func (z *Int) ProbablyPrime(n int) bool { + z.doinit() + return int(C.mpz_probab_prime_p(&z.i[0], C.int(n))) > 0 +} diff --git a/misc/cgo/gmp/pi.go b/misc/cgo/gmp/pi.go new file mode 100644 index 0000000000000000000000000000000000000000..1914cf214fe8e4a1e2453682ad767566cb8a6d82 --- /dev/null +++ b/misc/cgo/gmp/pi.go @@ -0,0 +1,106 @@ +// +build ignore + +/* +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + * Neither the name of "The Computer Language Benchmarks Game" nor the + name of "The Computer Language Shootout Benchmarks" nor the names of + its contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +*/ + +/* The Computer Language Benchmarks Game + * http://shootout.alioth.debian.org/ + * + * contributed by The Go Authors. + * based on pidigits.c (by Paolo Bonzini & Sean Bartlett, + * modified by Michael Mellor) + */ + +package main + +import ( + big "." + "fmt" + "runtime" +) + +var ( + tmp1 = big.NewInt(0) + tmp2 = big.NewInt(0) + numer = big.NewInt(1) + accum = big.NewInt(0) + denom = big.NewInt(1) + ten = big.NewInt(10) +) + +func extractDigit() int64 { + if big.CmpInt(numer, accum) > 0 { + return -1 + } + tmp1.Lsh(numer, 1).Add(tmp1, numer).Add(tmp1, accum) + big.DivModInt(tmp1, tmp2, tmp1, denom) + tmp2.Add(tmp2, numer) + if big.CmpInt(tmp2, denom) >= 0 { + return -1 + } + return tmp1.Int64() +} + +func nextTerm(k int64) { + y2 := k*2 + 1 + accum.Add(accum, tmp1.Lsh(numer, 1)) + accum.Mul(accum, tmp1.SetInt64(y2)) + numer.Mul(numer, tmp1.SetInt64(k)) + denom.Mul(denom, tmp1.SetInt64(y2)) +} + +func eliminateDigit(d int64) { + accum.Sub(accum, tmp1.Mul(denom, tmp1.SetInt64(d))) + accum.Mul(accum, ten) + numer.Mul(numer, ten) +} + +func main() { + i := 0 + k := int64(0) + for { + d := int64(-1) + for d < 0 { + k++ + nextTerm(k) + d = extractDigit() + } + eliminateDigit(d) + fmt.Printf("%c", d+'0') + + if i++; i%50 == 0 { + fmt.Printf("\n") + if i >= 1000 { + break + } + } + } + + fmt.Printf("\n%d calls; bit sizes: %d %d %d\n", runtime.NumCgoCall(), numer.Len(), accum.Len(), denom.Len()) +} diff --git a/misc/cgo/life/c-life.c b/misc/cgo/life/c-life.c new file mode 100644 index 0000000000000000000000000000000000000000..6572455951ca243fa437ebf7aa49b48563be47d6 --- /dev/null +++ b/misc/cgo/life/c-life.c @@ -0,0 +1,56 @@ +// Copyright 2010 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +#include +#include "life.h" +#include "_cgo_export.h" + +const int MYCONST = 0; + +// Do the actual manipulation of the life board in C. This could be +// done easily in Go, we are just using C for demonstration +// purposes. +void +Step(int x, int y, int *a, int *n) +{ + struct GoStart_return r; + + // Use Go to start 4 goroutines each of which handles 1/4 of the + // board. + r = GoStart(0, x, y, 0, x / 2, 0, y / 2, a, n); + assert(r.r0 == 0 && r.r1 == 100); // test multiple returns + r = GoStart(1, x, y, x / 2, x, 0, y / 2, a, n); + assert(r.r0 == 1 && r.r1 == 101); // test multiple returns + GoStart(2, x, y, 0, x / 2, y / 2, y, a, n); + GoStart(3, x, y, x / 2, x, y / 2, y, a, n); + GoWait(0); + GoWait(1); + GoWait(2); + GoWait(3); +} + +// The actual computation. This is called in parallel. +void +DoStep(int xdim, int ydim, int xstart, int xend, int ystart, int yend, int *a, int *n) +{ + int x, y, c, i, j; + + for(x = xstart; x < xend; x++) { + for(y = ystart; y < yend; y++) { + c = 0; + for(i = -1; i <= 1; i++) { + for(j = -1; j <= 1; j++) { + if(x+i >= 0 && x+i < xdim && + y+j >= 0 && y+j < ydim && + (i != 0 || j != 0)) + c += a[(x+i)*xdim + (y+j)] != 0; + } + } + if(c == 3 || (c == 2 && a[x*xdim + y] != 0)) + n[x*xdim + y] = 1; + else + n[x*xdim + y] = 0; + } + } +} diff --git a/misc/cgo/life/life.go b/misc/cgo/life/life.go new file mode 100644 index 0000000000000000000000000000000000000000..fda5495e5f4e77da4e1778c50cbb0d3d2d44825e --- /dev/null +++ b/misc/cgo/life/life.go @@ -0,0 +1,41 @@ +// skip + +// Copyright 2010 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package life + +// #include "life.h" +import "C" + +import "unsafe" + +func Run(gen, x, y int, a []int32) { + n := make([]int32, x*y) + for i := 0; i < gen; i++ { + C.Step(C.int(x), C.int(y), (*C.int)(unsafe.Pointer(&a[0])), (*C.int)(unsafe.Pointer(&n[0]))) + copy(a, n) + } +} + +// Keep the channels visible from Go. +var chans [4]chan bool + +//export GoStart +// Double return value is just for testing. +func GoStart(i, xdim, ydim, xstart, xend, ystart, yend C.int, a *C.int, n *C.int) (int, int) { + c := make(chan bool, int(C.MYCONST)) + go func() { + C.DoStep(xdim, ydim, xstart, xend, ystart, yend, a, n) + c <- true + }() + chans[i] = c + return int(i), int(i + 100) +} + +//export GoWait +func GoWait(i C.int) { + <-chans[i] + chans[i] = nil +} diff --git a/misc/cgo/life/life.h b/misc/cgo/life/life.h new file mode 100644 index 0000000000000000000000000000000000000000..b2011b25fc8a80fc99b6e494f34dd1978c80e411 --- /dev/null +++ b/misc/cgo/life/life.h @@ -0,0 +1,7 @@ +// Copyright 2010 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +extern void Step(int, int, int *, int *); +extern void DoStep(int, int, int, int, int, int, int *, int *); +extern const int MYCONST; diff --git a/misc/cgo/life/main.go b/misc/cgo/life/main.go new file mode 100644 index 0000000000000000000000000000000000000000..725e10f76c262b3ce11a78bb7b92ec6c064f262d --- /dev/null +++ b/misc/cgo/life/main.go @@ -0,0 +1,48 @@ +// cmpout + +// Copyright 2010 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build ignore + +// Run the game of life in C using Go for parallelization. + +package main + +import ( + "." + "flag" + "fmt" +) + +const MAXDIM = 100 + +var dim = flag.Int("dim", 16, "board dimensions") +var gen = flag.Int("gen", 10, "generations") + +func main() { + flag.Parse() + + var a [MAXDIM * MAXDIM]int32 + for i := 2; i < *dim; i += 8 { + for j := 2; j < *dim-3; j += 8 { + for y := 0; y < 3; y++ { + a[i**dim+j+y] = 1 + } + } + } + + life.Run(*gen, *dim, *dim, a[:]) + + for i := 0; i < *dim; i++ { + for j := 0; j < *dim; j++ { + if a[i**dim+j] == 0 { + fmt.Print(" ") + } else { + fmt.Print("X") + } + } + fmt.Print("\n") + } +} diff --git a/misc/cgo/life/main.out b/misc/cgo/life/main.out new file mode 100644 index 0000000000000000000000000000000000000000..26fc9c6e3ff6d126734a1608560c8efccb95cc1f --- /dev/null +++ b/misc/cgo/life/main.out @@ -0,0 +1,16 @@ + + + XXX XXX + + + + + + + + XXX XXX + + + + + diff --git a/misc/cgo/nocgo/nocgo.go b/misc/cgo/nocgo/nocgo.go new file mode 100644 index 0000000000000000000000000000000000000000..00ae5e9c86282e2e370265d889203f634316313c --- /dev/null +++ b/misc/cgo/nocgo/nocgo.go @@ -0,0 +1,22 @@ +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Test that -static works when not using cgo. This test is in +// misc/cgo to take advantage of the testing framework support for +// when -static is expected to work. + +package nocgo + +func NoCgo() int { + c := make(chan int) + + // The test is run with external linking, which means that + // goroutines will be created via the runtime/cgo package. + // Make sure that works. + go func() { + c <- 42 + }() + + return <-c +} diff --git a/misc/cgo/nocgo/nocgo_test.go b/misc/cgo/nocgo/nocgo_test.go new file mode 100644 index 0000000000000000000000000000000000000000..45d247cf9545a644e54b09735779a33c62397850 --- /dev/null +++ b/misc/cgo/nocgo/nocgo_test.go @@ -0,0 +1,14 @@ +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package nocgo + +import "testing" + +func TestNop(t *testing.T) { + i := NoCgo() + if i != 42 { + t.Errorf("got %d, want %d", i, 42) + } +} diff --git a/misc/cgo/stdio/chain.go b/misc/cgo/stdio/chain.go new file mode 100644 index 0000000000000000000000000000000000000000..a55cefa40c20dbb98388b7ca8262ef8b106303c3 --- /dev/null +++ b/misc/cgo/stdio/chain.go @@ -0,0 +1,47 @@ +// cmpout + +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build ignore + +// Pass numbers along a chain of threads. + +package main + +import ( + "../stdio" + "runtime" + "strconv" +) + +const N = 10 +const R = 5 + +func link(left chan<- int, right <-chan int) { + // Keep the links in dedicated operating system + // threads, so that this program tests coordination + // between pthreads and not just goroutines. + runtime.LockOSThread() + for { + v := <-right + stdio.Stdout.WriteString(strconv.Itoa(v) + "\n") + left <- 1 + v + } +} + +func main() { + leftmost := make(chan int) + var left chan int + right := leftmost + for i := 0; i < N; i++ { + left, right = right, make(chan int) + go link(left, right) + } + for i := 0; i < R; i++ { + right <- 0 + x := <-leftmost + stdio.Stdout.WriteString(strconv.Itoa(x) + "\n") + } +} diff --git a/misc/cgo/stdio/chain.out b/misc/cgo/stdio/chain.out new file mode 100644 index 0000000000000000000000000000000000000000..963cf9b6679b180a5f6423d847cbd8104bcd7a8c --- /dev/null +++ b/misc/cgo/stdio/chain.out @@ -0,0 +1,55 @@ +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 diff --git a/misc/cgo/stdio/fib.go b/misc/cgo/stdio/fib.go new file mode 100644 index 0000000000000000000000000000000000000000..981ffeb9abd5b9579c96dd829ae517969901edc5 --- /dev/null +++ b/misc/cgo/stdio/fib.go @@ -0,0 +1,51 @@ +// cmpout + +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build ignore + +// Compute Fibonacci numbers with two goroutines +// that pass integers back and forth. No actual +// concurrency, just threads and synchronization +// and foreign code on multiple pthreads. + +package main + +import ( + "../stdio" + "runtime" + "strconv" +) + +func fibber(c, out chan int64, i int64) { + // Keep the fibbers in dedicated operating system + // threads, so that this program tests coordination + // between pthreads and not just goroutines. + runtime.LockOSThread() + + if i == 0 { + c <- i + } + for { + j := <-c + stdio.Stdout.WriteString(strconv.FormatInt(j, 10) + "\n") + out <- j + <-out + i += j + c <- i + } +} + +func main() { + c := make(chan int64) + out := make(chan int64) + go fibber(c, out, 0) + go fibber(c, out, 1) + <-out + for i := 0; i < 90; i++ { + out <- 1 + <-out + } +} diff --git a/misc/cgo/stdio/fib.out b/misc/cgo/stdio/fib.out new file mode 100644 index 0000000000000000000000000000000000000000..17ff503356d8e40e12ed97ed51b5675299d4879c --- /dev/null +++ b/misc/cgo/stdio/fib.out @@ -0,0 +1,91 @@ +0 +1 +1 +2 +3 +5 +8 +13 +21 +34 +55 +89 +144 +233 +377 +610 +987 +1597 +2584 +4181 +6765 +10946 +17711 +28657 +46368 +75025 +121393 +196418 +317811 +514229 +832040 +1346269 +2178309 +3524578 +5702887 +9227465 +14930352 +24157817 +39088169 +63245986 +102334155 +165580141 +267914296 +433494437 +701408733 +1134903170 +1836311903 +2971215073 +4807526976 +7778742049 +12586269025 +20365011074 +32951280099 +53316291173 +86267571272 +139583862445 +225851433717 +365435296162 +591286729879 +956722026041 +1548008755920 +2504730781961 +4052739537881 +6557470319842 +10610209857723 +17167680177565 +27777890035288 +44945570212853 +72723460248141 +117669030460994 +190392490709135 +308061521170129 +498454011879264 +806515533049393 +1304969544928657 +2111485077978050 +3416454622906707 +5527939700884757 +8944394323791464 +14472334024676221 +23416728348467685 +37889062373143906 +61305790721611591 +99194853094755497 +160500643816367088 +259695496911122585 +420196140727489673 +679891637638612258 +1100087778366101931 +1779979416004714189 +2880067194370816120 diff --git a/misc/cgo/stdio/file.go b/misc/cgo/stdio/file.go new file mode 100644 index 0000000000000000000000000000000000000000..e7bb906a54b354f0e8264f16a08267dbcb854a2c --- /dev/null +++ b/misc/cgo/stdio/file.go @@ -0,0 +1,44 @@ +// skip + +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +/* +A trivial example of wrapping a C library in Go. +For a more complex example and explanation, +see ../gmp/gmp.go. +*/ + +package stdio + +/* +#include +#include +#include +#include + +char* greeting = "hello, world"; +*/ +import "C" +import "unsafe" + +type File C.FILE + +// Test reference to library symbol. +// Stdout and stderr are too special to be a reliable test. +//var = C.environ + +func (f *File) WriteString(s string) { + p := C.CString(s) + C.fputs(p, (*C.FILE)(f)) + C.free(unsafe.Pointer(p)) + f.Flush() +} + +func (f *File) Flush() { + C.fflush((*C.FILE)(f)) +} + +var Greeting = C.GoString(C.greeting) +var Gbytes = C.GoBytes(unsafe.Pointer(C.greeting), C.int(len(Greeting))) diff --git a/misc/cgo/stdio/hello.go b/misc/cgo/stdio/hello.go new file mode 100644 index 0000000000000000000000000000000000000000..9cfeefbba701b8b90da893ea5ba2018054166f9f --- /dev/null +++ b/misc/cgo/stdio/hello.go @@ -0,0 +1,15 @@ +// cmpout + +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build ignore + +package main + +import "../stdio" + +func main() { + stdio.Stdout.WriteString(stdio.Greeting + "\n") +} diff --git a/misc/cgo/stdio/hello.out b/misc/cgo/stdio/hello.out new file mode 100644 index 0000000000000000000000000000000000000000..4b5fa63702dd96796042e92787f464e28f09f17d --- /dev/null +++ b/misc/cgo/stdio/hello.out @@ -0,0 +1 @@ +hello, world diff --git a/misc/cgo/stdio/run.out b/misc/cgo/stdio/run.out new file mode 100644 index 0000000000000000000000000000000000000000..c0e496547ed8b59f67b049e95bbdfd5b81544d9e --- /dev/null +++ b/misc/cgo/stdio/run.out @@ -0,0 +1,150 @@ +* hello +hello, world +* fib +0 +1 +1 +2 +3 +5 +8 +13 +21 +34 +55 +89 +144 +233 +377 +610 +987 +1597 +2584 +4181 +6765 +10946 +17711 +28657 +46368 +75025 +121393 +196418 +317811 +514229 +832040 +1346269 +2178309 +3524578 +5702887 +9227465 +14930352 +24157817 +39088169 +63245986 +102334155 +165580141 +267914296 +433494437 +701408733 +1134903170 +1836311903 +2971215073 +4807526976 +7778742049 +12586269025 +20365011074 +32951280099 +53316291173 +86267571272 +139583862445 +225851433717 +365435296162 +591286729879 +956722026041 +1548008755920 +2504730781961 +4052739537881 +6557470319842 +10610209857723 +17167680177565 +27777890035288 +44945570212853 +72723460248141 +117669030460994 +190392490709135 +308061521170129 +498454011879264 +806515533049393 +1304969544928657 +2111485077978050 +3416454622906707 +5527939700884757 +8944394323791464 +14472334024676221 +23416728348467685 +37889062373143906 +61305790721611591 +99194853094755497 +160500643816367088 +259695496911122585 +420196140727489673 +679891637638612258 +1100087778366101931 +1779979416004714189 +2880067194370816120 +* chain +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 diff --git a/misc/cgo/stdio/stdio.go b/misc/cgo/stdio/stdio.go new file mode 100644 index 0000000000000000000000000000000000000000..76cb8ad80d65f730314b559508769bd2e1f33adf --- /dev/null +++ b/misc/cgo/stdio/stdio.go @@ -0,0 +1,22 @@ +// skip + +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package stdio + +/* +#include + +// on mingw, stderr and stdout are defined as &_iob[FILENO] +// on netbsd, they are defined as &__sF[FILENO] +// and cgo doesn't recognize them, so write a function to get them, +// instead of depending on internals of libc implementation. +FILE *getStdout(void) { return stdout; } +FILE *getStderr(void) { return stderr; } +*/ +import "C" + +var Stdout = (*File)(C.getStdout()) +var Stderr = (*File)(C.getStderr()) diff --git a/misc/cgo/test/align.go b/misc/cgo/test/align.go new file mode 100644 index 0000000000000000000000000000000000000000..a23b44fc38c83bf872944c71dc55cc0558ef1ae5 --- /dev/null +++ b/misc/cgo/test/align.go @@ -0,0 +1,76 @@ +// Copyright 2010 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package cgotest + +/* +#include + +typedef unsigned char Uint8; +typedef unsigned short Uint16; + +typedef enum { + MOD1 = 0x0000, + MODX = 0x8000 +} SDLMod; + +typedef enum { + A = 1, + B = 322, + SDLK_LAST +} SDLKey; + +typedef struct SDL_keysym { + Uint8 scancode; + SDLKey sym; + SDLMod mod; + Uint16 unicode; +} SDL_keysym; + +typedef struct SDL_KeyboardEvent { + Uint8 typ; + Uint8 which; + Uint8 state; + SDL_keysym keysym; +} SDL_KeyboardEvent; + +void makeEvent(SDL_KeyboardEvent *event) { + unsigned char *p; + int i; + + p = (unsigned char*)event; + for (i=0; ityp == typ && e->which == which && e->state == state && e->keysym.scancode == scan && e->keysym.sym == sym && e->keysym.mod == mod && e->keysym.unicode == uni; +} + +void cTest(SDL_KeyboardEvent *event) { + printf("C: %#x %#x %#x %#x %#x %#x %#x\n", event->typ, event->which, event->state, + event->keysym.scancode, event->keysym.sym, event->keysym.mod, event->keysym.unicode); + fflush(stdout); +} + +*/ +import "C" + +import ( + "testing" +) + +func testAlign(t *testing.T) { + var evt C.SDL_KeyboardEvent + C.makeEvent(&evt) + if C.same(&evt, evt.typ, evt.which, evt.state, evt.keysym.scancode, evt.keysym.sym, evt.keysym.mod, evt.keysym.unicode) == 0 { + t.Error("*** bad alignment") + C.cTest(&evt) + t.Errorf("Go: %#x %#x %#x %#x %#x %#x %#x\n", + evt.typ, evt.which, evt.state, evt.keysym.scancode, + evt.keysym.sym, evt.keysym.mod, evt.keysym.unicode) + t.Error(evt) + } +} diff --git a/misc/cgo/test/api.go b/misc/cgo/test/api.go new file mode 100644 index 0000000000000000000000000000000000000000..f5a85946fb09f2b581a7e9f13f32e4bada2f4a2a --- /dev/null +++ b/misc/cgo/test/api.go @@ -0,0 +1,24 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// API Compatibility Checks for cgo + +package cgotest + +// #include +// const char *api_hello = "hello!"; +import "C" +import "unsafe" + +func testAPI() { + var cs *C.char + cs = C.CString("hello") + defer C.free(unsafe.Pointer(cs)) + var s string + s = C.GoString((*C.char)(C.api_hello)) + s = C.GoStringN((*C.char)(C.api_hello), C.int(6)) + var b []byte + b = C.GoBytes(unsafe.Pointer(C.api_hello), C.int(6)) + _, _ = s, b +} diff --git a/misc/cgo/test/backdoor.go b/misc/cgo/test/backdoor.go new file mode 100644 index 0000000000000000000000000000000000000000..6fb33d66cb2cf43f72acff28e46bfbb343a25b67 --- /dev/null +++ b/misc/cgo/test/backdoor.go @@ -0,0 +1,11 @@ +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package cgotest + +import _ "unsafe" + +//go:linkname lockedOSThread runtime.lockedOSThread +//extern runtime_lockedOSThread +func lockedOSThread() bool diff --git a/misc/cgo/test/basic.go b/misc/cgo/test/basic.go new file mode 100644 index 0000000000000000000000000000000000000000..019139d01046247fa71684e1d0f4f3eed15e54d9 --- /dev/null +++ b/misc/cgo/test/basic.go @@ -0,0 +1,164 @@ +// Copyright 2010 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Basic test cases for cgo. + +package cgotest + +/* +#include +#include +#include +#include + +#define SHIFT(x, y) ((x)<<(y)) +#define KILO SHIFT(1, 10) +#define UINT32VAL 0xc008427bU + +enum E { + Enum1 = 1, + Enum2 = 2, +}; + +typedef unsigned char cgo_uuid_t[20]; + +void uuid_generate(cgo_uuid_t x) { + x[0] = 0; +} + +struct S { + int x; +}; + +extern enum E myConstFunc(struct S* const ctx, int const id, struct S **const filter); + +enum E myConstFunc(struct S *const ctx, int const id, struct S **const filter) { return 0; } + +// issue 1222 +typedef union { + long align; +} xxpthread_mutex_t; + +struct ibv_async_event { + union { + int x; + } element; +}; + +struct ibv_context { + xxpthread_mutex_t mutex; +}; + +int add(int x, int y) { + return x+y; +}; +*/ +import "C" +import ( + "runtime" + "syscall" + "testing" + "unsafe" +) + +const EINVAL = C.EINVAL /* test #define */ + +var KILO = C.KILO + +func uuidgen() { + var uuid C.cgo_uuid_t + C.uuid_generate(&uuid[0]) +} + +func Strtol(s string, base int) (int, error) { + p := C.CString(s) + n, err := C.strtol(p, nil, C.int(base)) + C.free(unsafe.Pointer(p)) + return int(n), err +} + +func Atol(s string) int { + p := C.CString(s) + n := C.atol(p) + C.free(unsafe.Pointer(p)) + return int(n) +} + +func testConst(t *testing.T) { + C.myConstFunc(nil, 0, nil) +} + +func testEnum(t *testing.T) { + if C.Enum1 != 1 || C.Enum2 != 2 { + t.Error("bad enum", C.Enum1, C.Enum2) + } +} + +func testAtol(t *testing.T) { + l := Atol("123") + if l != 123 { + t.Error("Atol 123: ", l) + } +} + +func testErrno(t *testing.T) { + p := C.CString("no-such-file") + m := C.CString("r") + f, err := C.fopen(p, m) + C.free(unsafe.Pointer(p)) + C.free(unsafe.Pointer(m)) + if err == nil { + C.fclose(f) + t.Fatalf("C.fopen: should fail") + } + if err != syscall.ENOENT { + t.Fatalf("C.fopen: unexpected error: %v", err) + } +} + +func testMultipleAssign(t *testing.T) { + p := C.CString("234") + n, m := C.strtol(p, nil, 345), C.strtol(p, nil, 10) + if runtime.GOOS == "openbsd" { + // Bug in OpenBSD strtol(3) - base > 36 succeeds. + if (n != 0 && n != 239089) || m != 234 { + t.Fatal("Strtol x2: ", n, m) + } + } else if n != 0 || m != 234 { + t.Fatal("Strtol x2: ", n, m) + } + C.free(unsafe.Pointer(p)) +} + +var ( + cuint = (C.uint)(0) + culong C.ulong + cchar C.char +) + +type Context struct { + ctx *C.struct_ibv_context +} + +func benchCgoCall(b *testing.B) { + const x = C.int(2) + const y = C.int(3) + for i := 0; i < b.N; i++ { + C.add(x, y) + } +} + +// Issue 2470. +func testUnsignedInt(t *testing.T) { + a := (int64)(C.UINT32VAL) + b := (int64)(0xc008427b) + if a != b { + t.Errorf("Incorrect unsigned int - got %x, want %x", a, b) + } +} + +// Static (build-time) test that syntax traversal visits all operands of s[i:j:k]. +func sliceOperands(array [2000]int) { + _ = array[C.KILO:C.KILO:C.KILO] // no type error +} diff --git a/misc/cgo/test/buildid_linux.go b/misc/cgo/test/buildid_linux.go new file mode 100644 index 0000000000000000000000000000000000000000..a3a86edfca883dc651bd2ec16efeb2f27159ca8f --- /dev/null +++ b/misc/cgo/test/buildid_linux.go @@ -0,0 +1,77 @@ +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package cgotest + +// Test that we have no more than one build ID. In the past we used +// to generate a separate build ID for each package using cgo, and the +// linker concatenated them all. We don't want that--we only want +// one. + +import ( + "bytes" + "debug/elf" + "os" + "testing" +) + +func testBuildID(t *testing.T) { + f, err := elf.Open("/proc/self/exe") + if err != nil { + if os.IsNotExist(err) { + t.Skip("no /proc/self/exe") + } + t.Fatalf("opening /proc/self/exe: ", err) + } + defer f.Close() + + c := 0 + for i, s := range f.Sections { + if s.Type != elf.SHT_NOTE { + continue + } + + d, err := s.Data() + if err != nil { + t.Logf("reading data of note section %d: %v", i, err) + continue + } + + for len(d) > 0 { + + // ELF standards differ as to the sizes in + // note sections. Both the GNU linker and + // gold always generate 32-bit sizes, so that + // is what we assume here. + + if len(d) < 12 { + t.Logf("note section %d too short (%d < 12)", i, len(d)) + continue + } + + namesz := f.ByteOrder.Uint32(d) + descsz := f.ByteOrder.Uint32(d[4:]) + typ := f.ByteOrder.Uint32(d[8:]) + + an := (namesz + 3) &^ 3 + ad := (descsz + 3) &^ 3 + + if int(12+an+ad) > len(d) { + t.Logf("note section %d too short for header (%d < 12 + align(%d,4) + align(%d,4))", i, len(d), namesz, descsz) + continue + } + + // 3 == NT_GNU_BUILD_ID + if typ == 3 && namesz == 4 && bytes.Equal(d[12:16], []byte("GNU\000")) { + c++ + } + + d = d[12+an+ad:] + } + } + + if c > 1 { + t.Errorf("found %d build ID notes", c) + } +} diff --git a/misc/cgo/test/callback.go b/misc/cgo/test/callback.go new file mode 100644 index 0000000000000000000000000000000000000000..bff770fa8d97e9f474177224f7a75d37ac5338c2 --- /dev/null +++ b/misc/cgo/test/callback.go @@ -0,0 +1,1738 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package cgotest + +/* +void callback(void *f); +void callGoFoo(void); +void callGoStackCheck(void); +void callPanic(void); +int callGoReturnVal(void); +int returnAfterGrow(void); +int returnAfterGrowFromGo(void); +*/ +import "C" + +import ( + "path" + "runtime" + "strings" + "testing" + "unsafe" +) + +// nestedCall calls into C, back into Go, and finally to f. +func nestedCall(f func()) { + // NOTE: Depends on representation of f. + // callback(x) calls goCallback(x) + C.callback(*(*unsafe.Pointer)(unsafe.Pointer(&f))) +} + +//export goCallback +func goCallback(p unsafe.Pointer) { + (*(*func())(unsafe.Pointer(&p)))() +} + +func testCallback(t *testing.T) { + var x = false + nestedCall(func() { x = true }) + if !x { + t.Fatal("nestedCall did not call func") + } +} + +func testCallbackGC(t *testing.T) { + nestedCall(runtime.GC) +} + +func testCallbackPanic(t *testing.T) { + // Make sure panic during callback unwinds properly. + if lockedOSThread() { + t.Fatal("locked OS thread on entry to TestCallbackPanic") + } + defer func() { + s := recover() + if s == nil { + t.Fatal("did not panic") + } + if s.(string) != "callback panic" { + t.Fatal("wrong panic:", s) + } + if lockedOSThread() { + t.Fatal("locked OS thread on exit from TestCallbackPanic") + } + }() + nestedCall(func() { panic("callback panic") }) + panic("nestedCall returned") +} + +func testCallbackPanicLoop(t *testing.T) { + // Make sure we don't blow out m->g0 stack. + for i := 0; i < 100000; i++ { + testCallbackPanic(t) + } +} + +func testCallbackPanicLocked(t *testing.T) { + runtime.LockOSThread() + defer runtime.UnlockOSThread() + + if !lockedOSThread() { + t.Fatal("runtime.LockOSThread didn't") + } + defer func() { + s := recover() + if s == nil { + t.Fatal("did not panic") + } + if s.(string) != "callback panic" { + t.Fatal("wrong panic:", s) + } + if !lockedOSThread() { + t.Fatal("lost lock on OS thread after panic") + } + }() + nestedCall(func() { panic("callback panic") }) + panic("nestedCall returned") +} + +// Callback with zero arguments used to make the stack misaligned, +// which broke the garbage collector and other things. +func testZeroArgCallback(t *testing.T) { + defer func() { + s := recover() + if s != nil { + t.Fatal("panic during callback:", s) + } + }() + C.callGoFoo() +} + +//export goFoo +func goFoo() { + x := 1 + for i := 0; i < 10000; i++ { + // variadic call mallocs + writes to + variadic(x, x, x) + if x != 1 { + panic("bad x") + } + } +} + +func variadic(x ...interface{}) {} + +func testBlocking(t *testing.T) { + c := make(chan int) + go func() { + for i := 0; i < 10; i++ { + c <- <-c + } + }() + nestedCall(func() { + for i := 0; i < 10; i++ { + c <- i + if j := <-c; j != i { + t.Errorf("out of sync %d != %d", j, i) + } + } + }) +} + +// Test that the stack can be unwound through a call out and call back +// into Go. +func testCallbackCallers(t *testing.T) { + if runtime.Compiler != "gc" { + // The exact function names are not going to be the same. + t.Skip("skipping for non-gc toolchain") + } + pc := make([]uintptr, 100) + n := 0 + name := []string{ + "test.goCallback", + "runtime.call16", + "runtime.cgocallbackg1", + "runtime.cgocallbackg", + "runtime.cgocallback_gofunc", + "runtime.asmcgocall", + "runtime.cgocall", + "test._Cfunc_callback", + "test.nestedCall", + "test.testCallbackCallers", + "test.TestCallbackCallers", + "testing.tRunner", + "runtime.goexit", + } + if unsafe.Sizeof((*byte)(nil)) == 8 { + name[1] = "runtime.call32" + } + nestedCall(func() { + n = runtime.Callers(2, pc) + }) + if n != len(name) { + t.Errorf("expected %d frames, got %d", len(name), n) + } + for i := 0; i < n; i++ { + f := runtime.FuncForPC(pc[i]) + if f == nil { + t.Fatalf("expected non-nil Func for pc %p", pc[i]) + } + fname := f.Name() + // Remove the prepended pathname from automatically + // generated cgo function names. + if strings.HasPrefix(fname, "_") { + fname = path.Base(f.Name()[1:]) + } + namei := "" + if i < len(name) { + namei = name[i] + } + if fname != namei { + t.Errorf("stk[%d] = %q, want %q", i, fname, namei) + } + } +} + +func testPanicFromC(t *testing.T) { + defer func() { + r := recover() + if r == nil { + t.Fatal("did not panic") + } + if r.(string) != "panic from C" { + t.Fatal("wrong panic:", r) + } + }() + C.callPanic() +} + +// Test that C code can return a value if it calls a Go function that +// causes a stack copy. +func testReturnAfterGrow(t *testing.T) { + // Use a new goroutine so that we get a small stack. + c := make(chan int) + go func() { + c <- int(C.returnAfterGrow()) + }() + if got, want := <-c, 123456; got != want { + t.Errorf("got %d want %d", got, want) + } +} + +// Test that we can return a value from Go->C->Go if the Go code +// causes a stack copy. +func testReturnAfterGrowFromGo(t *testing.T) { + // Use a new goroutine so that we get a small stack. + c := make(chan int) + go func() { + c <- int(C.returnAfterGrowFromGo()) + }() + if got, want := <-c, 129*128/2; got != want { + t.Errorf("got %d want %d", got, want) + } +} + +//export goReturnVal +func goReturnVal() (r C.int) { + // Force a stack copy. + var f func(int) int + f = func(i int) int { + var buf [256]byte + use(buf[:]) + if i == 0 { + return 0 + } + return i + f(i-1) + } + r = C.int(f(128)) + return +} + +func testCallbackStack(t *testing.T) { + // Make cgo call and callback with different amount of stack stack available. + // We do not do any explicit checks, just ensure that it does not crash. + for _, f := range splitTests { + f() + } +} + +//export goStackCheck +func goStackCheck() { + // use some stack memory to trigger split stack check + var buf [256]byte + use(buf[:]) +} + +var Used byte + +func use(buf []byte) { + for _, c := range buf { + Used += c + } +} + +var splitTests = []func(){ + // Edit .+1,/^}/-1|seq 4 4 5000 | sed 's/.*/ stack&,/' | fmt + stack4, stack8, stack12, stack16, stack20, stack24, stack28, + stack32, stack36, stack40, stack44, stack48, stack52, stack56, + stack60, stack64, stack68, stack72, stack76, stack80, stack84, + stack88, stack92, stack96, stack100, stack104, stack108, stack112, + stack116, stack120, stack124, stack128, stack132, stack136, + stack140, stack144, stack148, stack152, stack156, stack160, + stack164, stack168, stack172, stack176, stack180, stack184, + stack188, stack192, stack196, stack200, stack204, stack208, + stack212, stack216, stack220, stack224, stack228, stack232, + stack236, stack240, stack244, stack248, stack252, stack256, + stack260, stack264, stack268, stack272, stack276, stack280, + stack284, stack288, stack292, stack296, stack300, stack304, + stack308, stack312, stack316, stack320, stack324, stack328, + stack332, stack336, stack340, stack344, stack348, stack352, + stack356, stack360, stack364, stack368, stack372, stack376, + stack380, stack384, stack388, stack392, stack396, stack400, + stack404, stack408, stack412, stack416, stack420, stack424, + stack428, stack432, stack436, stack440, stack444, stack448, + stack452, stack456, stack460, stack464, stack468, stack472, + stack476, stack480, stack484, stack488, stack492, stack496, + stack500, stack504, stack508, stack512, stack516, stack520, + stack524, stack528, stack532, stack536, stack540, stack544, + stack548, stack552, stack556, stack560, stack564, stack568, + stack572, stack576, stack580, stack584, stack588, stack592, + stack596, stack600, stack604, stack608, stack612, stack616, + stack620, stack624, stack628, stack632, stack636, stack640, + stack644, stack648, stack652, stack656, stack660, stack664, + stack668, stack672, stack676, stack680, stack684, stack688, + stack692, stack696, stack700, stack704, stack708, stack712, + stack716, stack720, stack724, stack728, stack732, stack736, + stack740, stack744, stack748, stack752, stack756, stack760, + stack764, stack768, stack772, stack776, stack780, stack784, + stack788, stack792, stack796, stack800, stack804, stack808, + stack812, stack816, stack820, stack824, stack828, stack832, + stack836, stack840, stack844, stack848, stack852, stack856, + stack860, stack864, stack868, stack872, stack876, stack880, + stack884, stack888, stack892, stack896, stack900, stack904, + stack908, stack912, stack916, stack920, stack924, stack928, + stack932, stack936, stack940, stack944, stack948, stack952, + stack956, stack960, stack964, stack968, stack972, stack976, + stack980, stack984, stack988, stack992, stack996, stack1000, + stack1004, stack1008, stack1012, stack1016, stack1020, stack1024, + stack1028, stack1032, stack1036, stack1040, stack1044, stack1048, + stack1052, stack1056, stack1060, stack1064, stack1068, stack1072, + stack1076, stack1080, stack1084, stack1088, stack1092, stack1096, + stack1100, stack1104, stack1108, stack1112, stack1116, stack1120, + stack1124, stack1128, stack1132, stack1136, stack1140, stack1144, + stack1148, stack1152, stack1156, stack1160, stack1164, stack1168, + stack1172, stack1176, stack1180, stack1184, stack1188, stack1192, + stack1196, stack1200, stack1204, stack1208, stack1212, stack1216, + stack1220, stack1224, stack1228, stack1232, stack1236, stack1240, + stack1244, stack1248, stack1252, stack1256, stack1260, stack1264, + stack1268, stack1272, stack1276, stack1280, stack1284, stack1288, + stack1292, stack1296, stack1300, stack1304, stack1308, stack1312, + stack1316, stack1320, stack1324, stack1328, stack1332, stack1336, + stack1340, stack1344, stack1348, stack1352, stack1356, stack1360, + stack1364, stack1368, stack1372, stack1376, stack1380, stack1384, + stack1388, stack1392, stack1396, stack1400, stack1404, stack1408, + stack1412, stack1416, stack1420, stack1424, stack1428, stack1432, + stack1436, stack1440, stack1444, stack1448, stack1452, stack1456, + stack1460, stack1464, stack1468, stack1472, stack1476, stack1480, + stack1484, stack1488, stack1492, stack1496, stack1500, stack1504, + stack1508, stack1512, stack1516, stack1520, stack1524, stack1528, + stack1532, stack1536, stack1540, stack1544, stack1548, stack1552, + stack1556, stack1560, stack1564, stack1568, stack1572, stack1576, + stack1580, stack1584, stack1588, stack1592, stack1596, stack1600, + stack1604, stack1608, stack1612, stack1616, stack1620, stack1624, + stack1628, stack1632, stack1636, stack1640, stack1644, stack1648, + stack1652, stack1656, stack1660, stack1664, stack1668, stack1672, + stack1676, stack1680, stack1684, stack1688, stack1692, stack1696, + stack1700, stack1704, stack1708, stack1712, stack1716, stack1720, + stack1724, stack1728, stack1732, stack1736, stack1740, stack1744, + stack1748, stack1752, stack1756, stack1760, stack1764, stack1768, + stack1772, stack1776, stack1780, stack1784, stack1788, stack1792, + stack1796, stack1800, stack1804, stack1808, stack1812, stack1816, + stack1820, stack1824, stack1828, stack1832, stack1836, stack1840, + stack1844, stack1848, stack1852, stack1856, stack1860, stack1864, + stack1868, stack1872, stack1876, stack1880, stack1884, stack1888, + stack1892, stack1896, stack1900, stack1904, stack1908, stack1912, + stack1916, stack1920, stack1924, stack1928, stack1932, stack1936, + stack1940, stack1944, stack1948, stack1952, stack1956, stack1960, + stack1964, stack1968, stack1972, stack1976, stack1980, stack1984, + stack1988, stack1992, stack1996, stack2000, stack2004, stack2008, + stack2012, stack2016, stack2020, stack2024, stack2028, stack2032, + stack2036, stack2040, stack2044, stack2048, stack2052, stack2056, + stack2060, stack2064, stack2068, stack2072, stack2076, stack2080, + stack2084, stack2088, stack2092, stack2096, stack2100, stack2104, + stack2108, stack2112, stack2116, stack2120, stack2124, stack2128, + stack2132, stack2136, stack2140, stack2144, stack2148, stack2152, + stack2156, stack2160, stack2164, stack2168, stack2172, stack2176, + stack2180, stack2184, stack2188, stack2192, stack2196, stack2200, + stack2204, stack2208, stack2212, stack2216, stack2220, stack2224, + stack2228, stack2232, stack2236, stack2240, stack2244, stack2248, + stack2252, stack2256, stack2260, stack2264, stack2268, stack2272, + stack2276, stack2280, stack2284, stack2288, stack2292, stack2296, + stack2300, stack2304, stack2308, stack2312, stack2316, stack2320, + stack2324, stack2328, stack2332, stack2336, stack2340, stack2344, + stack2348, stack2352, stack2356, stack2360, stack2364, stack2368, + stack2372, stack2376, stack2380, stack2384, stack2388, stack2392, + stack2396, stack2400, stack2404, stack2408, stack2412, stack2416, + stack2420, stack2424, stack2428, stack2432, stack2436, stack2440, + stack2444, stack2448, stack2452, stack2456, stack2460, stack2464, + stack2468, stack2472, stack2476, stack2480, stack2484, stack2488, + stack2492, stack2496, stack2500, stack2504, stack2508, stack2512, + stack2516, stack2520, stack2524, stack2528, stack2532, stack2536, + stack2540, stack2544, stack2548, stack2552, stack2556, stack2560, + stack2564, stack2568, stack2572, stack2576, stack2580, stack2584, + stack2588, stack2592, stack2596, stack2600, stack2604, stack2608, + stack2612, stack2616, stack2620, stack2624, stack2628, stack2632, + stack2636, stack2640, stack2644, stack2648, stack2652, stack2656, + stack2660, stack2664, stack2668, stack2672, stack2676, stack2680, + stack2684, stack2688, stack2692, stack2696, stack2700, stack2704, + stack2708, stack2712, stack2716, stack2720, stack2724, stack2728, + stack2732, stack2736, stack2740, stack2744, stack2748, stack2752, + stack2756, stack2760, stack2764, stack2768, stack2772, stack2776, + stack2780, stack2784, stack2788, stack2792, stack2796, stack2800, + stack2804, stack2808, stack2812, stack2816, stack2820, stack2824, + stack2828, stack2832, stack2836, stack2840, stack2844, stack2848, + stack2852, stack2856, stack2860, stack2864, stack2868, stack2872, + stack2876, stack2880, stack2884, stack2888, stack2892, stack2896, + stack2900, stack2904, stack2908, stack2912, stack2916, stack2920, + stack2924, stack2928, stack2932, stack2936, stack2940, stack2944, + stack2948, stack2952, stack2956, stack2960, stack2964, stack2968, + stack2972, stack2976, stack2980, stack2984, stack2988, stack2992, + stack2996, stack3000, stack3004, stack3008, stack3012, stack3016, + stack3020, stack3024, stack3028, stack3032, stack3036, stack3040, + stack3044, stack3048, stack3052, stack3056, stack3060, stack3064, + stack3068, stack3072, stack3076, stack3080, stack3084, stack3088, + stack3092, stack3096, stack3100, stack3104, stack3108, stack3112, + stack3116, stack3120, stack3124, stack3128, stack3132, stack3136, + stack3140, stack3144, stack3148, stack3152, stack3156, stack3160, + stack3164, stack3168, stack3172, stack3176, stack3180, stack3184, + stack3188, stack3192, stack3196, stack3200, stack3204, stack3208, + stack3212, stack3216, stack3220, stack3224, stack3228, stack3232, + stack3236, stack3240, stack3244, stack3248, stack3252, stack3256, + stack3260, stack3264, stack3268, stack3272, stack3276, stack3280, + stack3284, stack3288, stack3292, stack3296, stack3300, stack3304, + stack3308, stack3312, stack3316, stack3320, stack3324, stack3328, + stack3332, stack3336, stack3340, stack3344, stack3348, stack3352, + stack3356, stack3360, stack3364, stack3368, stack3372, stack3376, + stack3380, stack3384, stack3388, stack3392, stack3396, stack3400, + stack3404, stack3408, stack3412, stack3416, stack3420, stack3424, + stack3428, stack3432, stack3436, stack3440, stack3444, stack3448, + stack3452, stack3456, stack3460, stack3464, stack3468, stack3472, + stack3476, stack3480, stack3484, stack3488, stack3492, stack3496, + stack3500, stack3504, stack3508, stack3512, stack3516, stack3520, + stack3524, stack3528, stack3532, stack3536, stack3540, stack3544, + stack3548, stack3552, stack3556, stack3560, stack3564, stack3568, + stack3572, stack3576, stack3580, stack3584, stack3588, stack3592, + stack3596, stack3600, stack3604, stack3608, stack3612, stack3616, + stack3620, stack3624, stack3628, stack3632, stack3636, stack3640, + stack3644, stack3648, stack3652, stack3656, stack3660, stack3664, + stack3668, stack3672, stack3676, stack3680, stack3684, stack3688, + stack3692, stack3696, stack3700, stack3704, stack3708, stack3712, + stack3716, stack3720, stack3724, stack3728, stack3732, stack3736, + stack3740, stack3744, stack3748, stack3752, stack3756, stack3760, + stack3764, stack3768, stack3772, stack3776, stack3780, stack3784, + stack3788, stack3792, stack3796, stack3800, stack3804, stack3808, + stack3812, stack3816, stack3820, stack3824, stack3828, stack3832, + stack3836, stack3840, stack3844, stack3848, stack3852, stack3856, + stack3860, stack3864, stack3868, stack3872, stack3876, stack3880, + stack3884, stack3888, stack3892, stack3896, stack3900, stack3904, + stack3908, stack3912, stack3916, stack3920, stack3924, stack3928, + stack3932, stack3936, stack3940, stack3944, stack3948, stack3952, + stack3956, stack3960, stack3964, stack3968, stack3972, stack3976, + stack3980, stack3984, stack3988, stack3992, stack3996, stack4000, + stack4004, stack4008, stack4012, stack4016, stack4020, stack4024, + stack4028, stack4032, stack4036, stack4040, stack4044, stack4048, + stack4052, stack4056, stack4060, stack4064, stack4068, stack4072, + stack4076, stack4080, stack4084, stack4088, stack4092, stack4096, + stack4100, stack4104, stack4108, stack4112, stack4116, stack4120, + stack4124, stack4128, stack4132, stack4136, stack4140, stack4144, + stack4148, stack4152, stack4156, stack4160, stack4164, stack4168, + stack4172, stack4176, stack4180, stack4184, stack4188, stack4192, + stack4196, stack4200, stack4204, stack4208, stack4212, stack4216, + stack4220, stack4224, stack4228, stack4232, stack4236, stack4240, + stack4244, stack4248, stack4252, stack4256, stack4260, stack4264, + stack4268, stack4272, stack4276, stack4280, stack4284, stack4288, + stack4292, stack4296, stack4300, stack4304, stack4308, stack4312, + stack4316, stack4320, stack4324, stack4328, stack4332, stack4336, + stack4340, stack4344, stack4348, stack4352, stack4356, stack4360, + stack4364, stack4368, stack4372, stack4376, stack4380, stack4384, + stack4388, stack4392, stack4396, stack4400, stack4404, stack4408, + stack4412, stack4416, stack4420, stack4424, stack4428, stack4432, + stack4436, stack4440, stack4444, stack4448, stack4452, stack4456, + stack4460, stack4464, stack4468, stack4472, stack4476, stack4480, + stack4484, stack4488, stack4492, stack4496, stack4500, stack4504, + stack4508, stack4512, stack4516, stack4520, stack4524, stack4528, + stack4532, stack4536, stack4540, stack4544, stack4548, stack4552, + stack4556, stack4560, stack4564, stack4568, stack4572, stack4576, + stack4580, stack4584, stack4588, stack4592, stack4596, stack4600, + stack4604, stack4608, stack4612, stack4616, stack4620, stack4624, + stack4628, stack4632, stack4636, stack4640, stack4644, stack4648, + stack4652, stack4656, stack4660, stack4664, stack4668, stack4672, + stack4676, stack4680, stack4684, stack4688, stack4692, stack4696, + stack4700, stack4704, stack4708, stack4712, stack4716, stack4720, + stack4724, stack4728, stack4732, stack4736, stack4740, stack4744, + stack4748, stack4752, stack4756, stack4760, stack4764, stack4768, + stack4772, stack4776, stack4780, stack4784, stack4788, stack4792, + stack4796, stack4800, stack4804, stack4808, stack4812, stack4816, + stack4820, stack4824, stack4828, stack4832, stack4836, stack4840, + stack4844, stack4848, stack4852, stack4856, stack4860, stack4864, + stack4868, stack4872, stack4876, stack4880, stack4884, stack4888, + stack4892, stack4896, stack4900, stack4904, stack4908, stack4912, + stack4916, stack4920, stack4924, stack4928, stack4932, stack4936, + stack4940, stack4944, stack4948, stack4952, stack4956, stack4960, + stack4964, stack4968, stack4972, stack4976, stack4980, stack4984, + stack4988, stack4992, stack4996, stack5000, +} + +// Edit .+1,$ | seq 4 4 5000 | sed 's/.*/func stack&() { var buf [&]byte; use(buf[:]); C.callGoStackCheck() }/' +func stack4() { var buf [4]byte; use(buf[:]); C.callGoStackCheck() } +func stack8() { var buf [8]byte; use(buf[:]); C.callGoStackCheck() } +func stack12() { var buf [12]byte; use(buf[:]); C.callGoStackCheck() } +func stack16() { var buf [16]byte; use(buf[:]); C.callGoStackCheck() } +func stack20() { var buf [20]byte; use(buf[:]); C.callGoStackCheck() } +func stack24() { var buf [24]byte; use(buf[:]); C.callGoStackCheck() } +func stack28() { var buf [28]byte; use(buf[:]); C.callGoStackCheck() } +func stack32() { var buf [32]byte; use(buf[:]); C.callGoStackCheck() } +func stack36() { var buf [36]byte; use(buf[:]); C.callGoStackCheck() } +func stack40() { var buf [40]byte; use(buf[:]); C.callGoStackCheck() } +func stack44() { var buf [44]byte; use(buf[:]); C.callGoStackCheck() } +func stack48() { var buf [48]byte; use(buf[:]); C.callGoStackCheck() } +func stack52() { var buf [52]byte; use(buf[:]); C.callGoStackCheck() } +func stack56() { var buf [56]byte; use(buf[:]); C.callGoStackCheck() } +func stack60() { var buf [60]byte; use(buf[:]); C.callGoStackCheck() } +func stack64() { var buf [64]byte; use(buf[:]); C.callGoStackCheck() } +func stack68() { var buf [68]byte; use(buf[:]); C.callGoStackCheck() } +func stack72() { var buf [72]byte; use(buf[:]); C.callGoStackCheck() } +func stack76() { var buf [76]byte; use(buf[:]); C.callGoStackCheck() } +func stack80() { var buf [80]byte; use(buf[:]); C.callGoStackCheck() } +func stack84() { var buf [84]byte; use(buf[:]); C.callGoStackCheck() } +func stack88() { var buf [88]byte; use(buf[:]); C.callGoStackCheck() } +func stack92() { var buf [92]byte; use(buf[:]); C.callGoStackCheck() } +func stack96() { var buf [96]byte; use(buf[:]); C.callGoStackCheck() } +func stack100() { var buf [100]byte; use(buf[:]); C.callGoStackCheck() } +func stack104() { var buf [104]byte; use(buf[:]); C.callGoStackCheck() } +func stack108() { var buf [108]byte; use(buf[:]); C.callGoStackCheck() } +func stack112() { var buf [112]byte; use(buf[:]); C.callGoStackCheck() } +func stack116() { var buf [116]byte; use(buf[:]); C.callGoStackCheck() } +func stack120() { var buf [120]byte; use(buf[:]); C.callGoStackCheck() } +func stack124() { var buf [124]byte; use(buf[:]); C.callGoStackCheck() } +func stack128() { var buf [128]byte; use(buf[:]); C.callGoStackCheck() } +func stack132() { var buf [132]byte; use(buf[:]); C.callGoStackCheck() } +func stack136() { var buf [136]byte; use(buf[:]); C.callGoStackCheck() } +func stack140() { var buf [140]byte; use(buf[:]); C.callGoStackCheck() } +func stack144() { var buf [144]byte; use(buf[:]); C.callGoStackCheck() } +func stack148() { var buf [148]byte; use(buf[:]); C.callGoStackCheck() } +func stack152() { var buf [152]byte; use(buf[:]); C.callGoStackCheck() } +func stack156() { var buf [156]byte; use(buf[:]); C.callGoStackCheck() } +func stack160() { var buf [160]byte; use(buf[:]); C.callGoStackCheck() } +func stack164() { var buf [164]byte; use(buf[:]); C.callGoStackCheck() } +func stack168() { var buf [168]byte; use(buf[:]); C.callGoStackCheck() } +func stack172() { var buf [172]byte; use(buf[:]); C.callGoStackCheck() } +func stack176() { var buf [176]byte; use(buf[:]); C.callGoStackCheck() } +func stack180() { var buf [180]byte; use(buf[:]); C.callGoStackCheck() } +func stack184() { var buf [184]byte; use(buf[:]); C.callGoStackCheck() } +func stack188() { var buf [188]byte; use(buf[:]); C.callGoStackCheck() } +func stack192() { var buf [192]byte; use(buf[:]); C.callGoStackCheck() } +func stack196() { var buf [196]byte; use(buf[:]); C.callGoStackCheck() } +func stack200() { var buf [200]byte; use(buf[:]); C.callGoStackCheck() } +func stack204() { var buf [204]byte; use(buf[:]); C.callGoStackCheck() } +func stack208() { var buf [208]byte; use(buf[:]); C.callGoStackCheck() } +func stack212() { var buf [212]byte; use(buf[:]); C.callGoStackCheck() } +func stack216() { var buf [216]byte; use(buf[:]); C.callGoStackCheck() } +func stack220() { var buf [220]byte; use(buf[:]); C.callGoStackCheck() } +func stack224() { var buf [224]byte; use(buf[:]); C.callGoStackCheck() } +func stack228() { var buf [228]byte; use(buf[:]); C.callGoStackCheck() } +func stack232() { var buf [232]byte; use(buf[:]); C.callGoStackCheck() } +func stack236() { var buf [236]byte; use(buf[:]); C.callGoStackCheck() } +func stack240() { var buf [240]byte; use(buf[:]); C.callGoStackCheck() } +func stack244() { var buf [244]byte; use(buf[:]); C.callGoStackCheck() } +func stack248() { var buf [248]byte; use(buf[:]); C.callGoStackCheck() } +func stack252() { var buf [252]byte; use(buf[:]); C.callGoStackCheck() } +func stack256() { var buf [256]byte; use(buf[:]); C.callGoStackCheck() } +func stack260() { var buf [260]byte; use(buf[:]); C.callGoStackCheck() } +func stack264() { var buf [264]byte; use(buf[:]); C.callGoStackCheck() } +func stack268() { var buf [268]byte; use(buf[:]); C.callGoStackCheck() } +func stack272() { var buf [272]byte; use(buf[:]); C.callGoStackCheck() } +func stack276() { var buf [276]byte; use(buf[:]); C.callGoStackCheck() } +func stack280() { var buf [280]byte; use(buf[:]); C.callGoStackCheck() } +func stack284() { var buf [284]byte; use(buf[:]); C.callGoStackCheck() } +func stack288() { var buf [288]byte; use(buf[:]); C.callGoStackCheck() } +func stack292() { var buf [292]byte; use(buf[:]); C.callGoStackCheck() } +func stack296() { var buf [296]byte; use(buf[:]); C.callGoStackCheck() } +func stack300() { var buf [300]byte; use(buf[:]); C.callGoStackCheck() } +func stack304() { var buf [304]byte; use(buf[:]); C.callGoStackCheck() } +func stack308() { var buf [308]byte; use(buf[:]); C.callGoStackCheck() } +func stack312() { var buf [312]byte; use(buf[:]); C.callGoStackCheck() } +func stack316() { var buf [316]byte; use(buf[:]); C.callGoStackCheck() } +func stack320() { var buf [320]byte; use(buf[:]); C.callGoStackCheck() } +func stack324() { var buf [324]byte; use(buf[:]); C.callGoStackCheck() } +func stack328() { var buf [328]byte; use(buf[:]); C.callGoStackCheck() } +func stack332() { var buf [332]byte; use(buf[:]); C.callGoStackCheck() } +func stack336() { var buf [336]byte; use(buf[:]); C.callGoStackCheck() } +func stack340() { var buf [340]byte; use(buf[:]); C.callGoStackCheck() } +func stack344() { var buf [344]byte; use(buf[:]); C.callGoStackCheck() } +func stack348() { var buf [348]byte; use(buf[:]); C.callGoStackCheck() } +func stack352() { var buf [352]byte; use(buf[:]); C.callGoStackCheck() } +func stack356() { var buf [356]byte; use(buf[:]); C.callGoStackCheck() } +func stack360() { var buf [360]byte; use(buf[:]); C.callGoStackCheck() } +func stack364() { var buf [364]byte; use(buf[:]); C.callGoStackCheck() } +func stack368() { var buf [368]byte; use(buf[:]); C.callGoStackCheck() } +func stack372() { var buf [372]byte; use(buf[:]); C.callGoStackCheck() } +func stack376() { var buf [376]byte; use(buf[:]); C.callGoStackCheck() } +func stack380() { var buf [380]byte; use(buf[:]); C.callGoStackCheck() } +func stack384() { var buf [384]byte; use(buf[:]); C.callGoStackCheck() } +func stack388() { var buf [388]byte; use(buf[:]); C.callGoStackCheck() } +func stack392() { var buf [392]byte; use(buf[:]); C.callGoStackCheck() } +func stack396() { var buf [396]byte; use(buf[:]); C.callGoStackCheck() } +func stack400() { var buf [400]byte; use(buf[:]); C.callGoStackCheck() } +func stack404() { var buf [404]byte; use(buf[:]); C.callGoStackCheck() } +func stack408() { var buf [408]byte; use(buf[:]); C.callGoStackCheck() } +func stack412() { var buf [412]byte; use(buf[:]); C.callGoStackCheck() } +func stack416() { var buf [416]byte; use(buf[:]); C.callGoStackCheck() } +func stack420() { var buf [420]byte; use(buf[:]); C.callGoStackCheck() } +func stack424() { var buf [424]byte; use(buf[:]); C.callGoStackCheck() } +func stack428() { var buf [428]byte; use(buf[:]); C.callGoStackCheck() } +func stack432() { var buf [432]byte; use(buf[:]); C.callGoStackCheck() } +func stack436() { var buf [436]byte; use(buf[:]); C.callGoStackCheck() } +func stack440() { var buf [440]byte; use(buf[:]); C.callGoStackCheck() } +func stack444() { var buf [444]byte; use(buf[:]); C.callGoStackCheck() } +func stack448() { var buf [448]byte; use(buf[:]); C.callGoStackCheck() } +func stack452() { var buf [452]byte; use(buf[:]); C.callGoStackCheck() } +func stack456() { var buf [456]byte; use(buf[:]); C.callGoStackCheck() } +func stack460() { var buf [460]byte; use(buf[:]); C.callGoStackCheck() } +func stack464() { var buf [464]byte; use(buf[:]); C.callGoStackCheck() } +func stack468() { var buf [468]byte; use(buf[:]); C.callGoStackCheck() } +func stack472() { var buf [472]byte; use(buf[:]); C.callGoStackCheck() } +func stack476() { var buf [476]byte; use(buf[:]); C.callGoStackCheck() } +func stack480() { var buf [480]byte; use(buf[:]); C.callGoStackCheck() } +func stack484() { var buf [484]byte; use(buf[:]); C.callGoStackCheck() } +func stack488() { var buf [488]byte; use(buf[:]); C.callGoStackCheck() } +func stack492() { var buf [492]byte; use(buf[:]); C.callGoStackCheck() } +func stack496() { var buf [496]byte; use(buf[:]); C.callGoStackCheck() } +func stack500() { var buf [500]byte; use(buf[:]); C.callGoStackCheck() } +func stack504() { var buf [504]byte; use(buf[:]); C.callGoStackCheck() } +func stack508() { var buf [508]byte; use(buf[:]); C.callGoStackCheck() } +func stack512() { var buf [512]byte; use(buf[:]); C.callGoStackCheck() } +func stack516() { var buf [516]byte; use(buf[:]); C.callGoStackCheck() } +func stack520() { var buf [520]byte; use(buf[:]); C.callGoStackCheck() } +func stack524() { var buf [524]byte; use(buf[:]); C.callGoStackCheck() } +func stack528() { var buf [528]byte; use(buf[:]); C.callGoStackCheck() } +func stack532() { var buf [532]byte; use(buf[:]); C.callGoStackCheck() } +func stack536() { var buf [536]byte; use(buf[:]); C.callGoStackCheck() } +func stack540() { var buf [540]byte; use(buf[:]); C.callGoStackCheck() } +func stack544() { var buf [544]byte; use(buf[:]); C.callGoStackCheck() } +func stack548() { var buf [548]byte; use(buf[:]); C.callGoStackCheck() } +func stack552() { var buf [552]byte; use(buf[:]); C.callGoStackCheck() } +func stack556() { var buf [556]byte; use(buf[:]); C.callGoStackCheck() } +func stack560() { var buf [560]byte; use(buf[:]); C.callGoStackCheck() } +func stack564() { var buf [564]byte; use(buf[:]); C.callGoStackCheck() } +func stack568() { var buf [568]byte; use(buf[:]); C.callGoStackCheck() } +func stack572() { var buf [572]byte; use(buf[:]); C.callGoStackCheck() } +func stack576() { var buf [576]byte; use(buf[:]); C.callGoStackCheck() } +func stack580() { var buf [580]byte; use(buf[:]); C.callGoStackCheck() } +func stack584() { var buf [584]byte; use(buf[:]); C.callGoStackCheck() } +func stack588() { var buf [588]byte; use(buf[:]); C.callGoStackCheck() } +func stack592() { var buf [592]byte; use(buf[:]); C.callGoStackCheck() } +func stack596() { var buf [596]byte; use(buf[:]); C.callGoStackCheck() } +func stack600() { var buf [600]byte; use(buf[:]); C.callGoStackCheck() } +func stack604() { var buf [604]byte; use(buf[:]); C.callGoStackCheck() } +func stack608() { var buf [608]byte; use(buf[:]); C.callGoStackCheck() } +func stack612() { var buf [612]byte; use(buf[:]); C.callGoStackCheck() } +func stack616() { var buf [616]byte; use(buf[:]); C.callGoStackCheck() } +func stack620() { var buf [620]byte; use(buf[:]); C.callGoStackCheck() } +func stack624() { var buf [624]byte; use(buf[:]); C.callGoStackCheck() } +func stack628() { var buf [628]byte; use(buf[:]); C.callGoStackCheck() } +func stack632() { var buf [632]byte; use(buf[:]); C.callGoStackCheck() } +func stack636() { var buf [636]byte; use(buf[:]); C.callGoStackCheck() } +func stack640() { var buf [640]byte; use(buf[:]); C.callGoStackCheck() } +func stack644() { var buf [644]byte; use(buf[:]); C.callGoStackCheck() } +func stack648() { var buf [648]byte; use(buf[:]); C.callGoStackCheck() } +func stack652() { var buf [652]byte; use(buf[:]); C.callGoStackCheck() } +func stack656() { var buf [656]byte; use(buf[:]); C.callGoStackCheck() } +func stack660() { var buf [660]byte; use(buf[:]); C.callGoStackCheck() } +func stack664() { var buf [664]byte; use(buf[:]); C.callGoStackCheck() } +func stack668() { var buf [668]byte; use(buf[:]); C.callGoStackCheck() } +func stack672() { var buf [672]byte; use(buf[:]); C.callGoStackCheck() } +func stack676() { var buf [676]byte; use(buf[:]); C.callGoStackCheck() } +func stack680() { var buf [680]byte; use(buf[:]); C.callGoStackCheck() } +func stack684() { var buf [684]byte; use(buf[:]); C.callGoStackCheck() } +func stack688() { var buf [688]byte; use(buf[:]); C.callGoStackCheck() } +func stack692() { var buf [692]byte; use(buf[:]); C.callGoStackCheck() } +func stack696() { var buf [696]byte; use(buf[:]); C.callGoStackCheck() } +func stack700() { var buf [700]byte; use(buf[:]); C.callGoStackCheck() } +func stack704() { var buf [704]byte; use(buf[:]); C.callGoStackCheck() } +func stack708() { var buf [708]byte; use(buf[:]); C.callGoStackCheck() } +func stack712() { var buf [712]byte; use(buf[:]); C.callGoStackCheck() } +func stack716() { var buf [716]byte; use(buf[:]); C.callGoStackCheck() } +func stack720() { var buf [720]byte; use(buf[:]); C.callGoStackCheck() } +func stack724() { var buf [724]byte; use(buf[:]); C.callGoStackCheck() } +func stack728() { var buf [728]byte; use(buf[:]); C.callGoStackCheck() } +func stack732() { var buf [732]byte; use(buf[:]); C.callGoStackCheck() } +func stack736() { var buf [736]byte; use(buf[:]); C.callGoStackCheck() } +func stack740() { var buf [740]byte; use(buf[:]); C.callGoStackCheck() } +func stack744() { var buf [744]byte; use(buf[:]); C.callGoStackCheck() } +func stack748() { var buf [748]byte; use(buf[:]); C.callGoStackCheck() } +func stack752() { var buf [752]byte; use(buf[:]); C.callGoStackCheck() } +func stack756() { var buf [756]byte; use(buf[:]); C.callGoStackCheck() } +func stack760() { var buf [760]byte; use(buf[:]); C.callGoStackCheck() } +func stack764() { var buf [764]byte; use(buf[:]); C.callGoStackCheck() } +func stack768() { var buf [768]byte; use(buf[:]); C.callGoStackCheck() } +func stack772() { var buf [772]byte; use(buf[:]); C.callGoStackCheck() } +func stack776() { var buf [776]byte; use(buf[:]); C.callGoStackCheck() } +func stack780() { var buf [780]byte; use(buf[:]); C.callGoStackCheck() } +func stack784() { var buf [784]byte; use(buf[:]); C.callGoStackCheck() } +func stack788() { var buf [788]byte; use(buf[:]); C.callGoStackCheck() } +func stack792() { var buf [792]byte; use(buf[:]); C.callGoStackCheck() } +func stack796() { var buf [796]byte; use(buf[:]); C.callGoStackCheck() } +func stack800() { var buf [800]byte; use(buf[:]); C.callGoStackCheck() } +func stack804() { var buf [804]byte; use(buf[:]); C.callGoStackCheck() } +func stack808() { var buf [808]byte; use(buf[:]); C.callGoStackCheck() } +func stack812() { var buf [812]byte; use(buf[:]); C.callGoStackCheck() } +func stack816() { var buf [816]byte; use(buf[:]); C.callGoStackCheck() } +func stack820() { var buf [820]byte; use(buf[:]); C.callGoStackCheck() } +func stack824() { var buf [824]byte; use(buf[:]); C.callGoStackCheck() } +func stack828() { var buf [828]byte; use(buf[:]); C.callGoStackCheck() } +func stack832() { var buf [832]byte; use(buf[:]); C.callGoStackCheck() } +func stack836() { var buf [836]byte; use(buf[:]); C.callGoStackCheck() } +func stack840() { var buf [840]byte; use(buf[:]); C.callGoStackCheck() } +func stack844() { var buf [844]byte; use(buf[:]); C.callGoStackCheck() } +func stack848() { var buf [848]byte; use(buf[:]); C.callGoStackCheck() } +func stack852() { var buf [852]byte; use(buf[:]); C.callGoStackCheck() } +func stack856() { var buf [856]byte; use(buf[:]); C.callGoStackCheck() } +func stack860() { var buf [860]byte; use(buf[:]); C.callGoStackCheck() } +func stack864() { var buf [864]byte; use(buf[:]); C.callGoStackCheck() } +func stack868() { var buf [868]byte; use(buf[:]); C.callGoStackCheck() } +func stack872() { var buf [872]byte; use(buf[:]); C.callGoStackCheck() } +func stack876() { var buf [876]byte; use(buf[:]); C.callGoStackCheck() } +func stack880() { var buf [880]byte; use(buf[:]); C.callGoStackCheck() } +func stack884() { var buf [884]byte; use(buf[:]); C.callGoStackCheck() } +func stack888() { var buf [888]byte; use(buf[:]); C.callGoStackCheck() } +func stack892() { var buf [892]byte; use(buf[:]); C.callGoStackCheck() } +func stack896() { var buf [896]byte; use(buf[:]); C.callGoStackCheck() } +func stack900() { var buf [900]byte; use(buf[:]); C.callGoStackCheck() } +func stack904() { var buf [904]byte; use(buf[:]); C.callGoStackCheck() } +func stack908() { var buf [908]byte; use(buf[:]); C.callGoStackCheck() } +func stack912() { var buf [912]byte; use(buf[:]); C.callGoStackCheck() } +func stack916() { var buf [916]byte; use(buf[:]); C.callGoStackCheck() } +func stack920() { var buf [920]byte; use(buf[:]); C.callGoStackCheck() } +func stack924() { var buf [924]byte; use(buf[:]); C.callGoStackCheck() } +func stack928() { var buf [928]byte; use(buf[:]); C.callGoStackCheck() } +func stack932() { var buf [932]byte; use(buf[:]); C.callGoStackCheck() } +func stack936() { var buf [936]byte; use(buf[:]); C.callGoStackCheck() } +func stack940() { var buf [940]byte; use(buf[:]); C.callGoStackCheck() } +func stack944() { var buf [944]byte; use(buf[:]); C.callGoStackCheck() } +func stack948() { var buf [948]byte; use(buf[:]); C.callGoStackCheck() } +func stack952() { var buf [952]byte; use(buf[:]); C.callGoStackCheck() } +func stack956() { var buf [956]byte; use(buf[:]); C.callGoStackCheck() } +func stack960() { var buf [960]byte; use(buf[:]); C.callGoStackCheck() } +func stack964() { var buf [964]byte; use(buf[:]); C.callGoStackCheck() } +func stack968() { var buf [968]byte; use(buf[:]); C.callGoStackCheck() } +func stack972() { var buf [972]byte; use(buf[:]); C.callGoStackCheck() } +func stack976() { var buf [976]byte; use(buf[:]); C.callGoStackCheck() } +func stack980() { var buf [980]byte; use(buf[:]); C.callGoStackCheck() } +func stack984() { var buf [984]byte; use(buf[:]); C.callGoStackCheck() } +func stack988() { var buf [988]byte; use(buf[:]); C.callGoStackCheck() } +func stack992() { var buf [992]byte; use(buf[:]); C.callGoStackCheck() } +func stack996() { var buf [996]byte; use(buf[:]); C.callGoStackCheck() } +func stack1000() { var buf [1000]byte; use(buf[:]); C.callGoStackCheck() } +func stack1004() { var buf [1004]byte; use(buf[:]); C.callGoStackCheck() } +func stack1008() { var buf [1008]byte; use(buf[:]); C.callGoStackCheck() } +func stack1012() { var buf [1012]byte; use(buf[:]); C.callGoStackCheck() } +func stack1016() { var buf [1016]byte; use(buf[:]); C.callGoStackCheck() } +func stack1020() { var buf [1020]byte; use(buf[:]); C.callGoStackCheck() } +func stack1024() { var buf [1024]byte; use(buf[:]); C.callGoStackCheck() } +func stack1028() { var buf [1028]byte; use(buf[:]); C.callGoStackCheck() } +func stack1032() { var buf [1032]byte; use(buf[:]); C.callGoStackCheck() } +func stack1036() { var buf [1036]byte; use(buf[:]); C.callGoStackCheck() } +func stack1040() { var buf [1040]byte; use(buf[:]); C.callGoStackCheck() } +func stack1044() { var buf [1044]byte; use(buf[:]); C.callGoStackCheck() } +func stack1048() { var buf [1048]byte; use(buf[:]); C.callGoStackCheck() } +func stack1052() { var buf [1052]byte; use(buf[:]); C.callGoStackCheck() } +func stack1056() { var buf [1056]byte; use(buf[:]); C.callGoStackCheck() } +func stack1060() { var buf [1060]byte; use(buf[:]); C.callGoStackCheck() } +func stack1064() { var buf [1064]byte; use(buf[:]); C.callGoStackCheck() } +func stack1068() { var buf [1068]byte; use(buf[:]); C.callGoStackCheck() } +func stack1072() { var buf [1072]byte; use(buf[:]); C.callGoStackCheck() } +func stack1076() { var buf [1076]byte; use(buf[:]); C.callGoStackCheck() } +func stack1080() { var buf [1080]byte; use(buf[:]); C.callGoStackCheck() } +func stack1084() { var buf [1084]byte; use(buf[:]); C.callGoStackCheck() } +func stack1088() { var buf [1088]byte; use(buf[:]); C.callGoStackCheck() } +func stack1092() { var buf [1092]byte; use(buf[:]); C.callGoStackCheck() } +func stack1096() { var buf [1096]byte; use(buf[:]); C.callGoStackCheck() } +func stack1100() { var buf [1100]byte; use(buf[:]); C.callGoStackCheck() } +func stack1104() { var buf [1104]byte; use(buf[:]); C.callGoStackCheck() } +func stack1108() { var buf [1108]byte; use(buf[:]); C.callGoStackCheck() } +func stack1112() { var buf [1112]byte; use(buf[:]); C.callGoStackCheck() } +func stack1116() { var buf [1116]byte; use(buf[:]); C.callGoStackCheck() } +func stack1120() { var buf [1120]byte; use(buf[:]); C.callGoStackCheck() } +func stack1124() { var buf [1124]byte; use(buf[:]); C.callGoStackCheck() } +func stack1128() { var buf [1128]byte; use(buf[:]); C.callGoStackCheck() } +func stack1132() { var buf [1132]byte; use(buf[:]); C.callGoStackCheck() } +func stack1136() { var buf [1136]byte; use(buf[:]); C.callGoStackCheck() } +func stack1140() { var buf [1140]byte; use(buf[:]); C.callGoStackCheck() } +func stack1144() { var buf [1144]byte; use(buf[:]); C.callGoStackCheck() } +func stack1148() { var buf [1148]byte; use(buf[:]); C.callGoStackCheck() } +func stack1152() { var buf [1152]byte; use(buf[:]); C.callGoStackCheck() } +func stack1156() { var buf [1156]byte; use(buf[:]); C.callGoStackCheck() } +func stack1160() { var buf [1160]byte; use(buf[:]); C.callGoStackCheck() } +func stack1164() { var buf [1164]byte; use(buf[:]); C.callGoStackCheck() } +func stack1168() { var buf [1168]byte; use(buf[:]); C.callGoStackCheck() } +func stack1172() { var buf [1172]byte; use(buf[:]); C.callGoStackCheck() } +func stack1176() { var buf [1176]byte; use(buf[:]); C.callGoStackCheck() } +func stack1180() { var buf [1180]byte; use(buf[:]); C.callGoStackCheck() } +func stack1184() { var buf [1184]byte; use(buf[:]); C.callGoStackCheck() } +func stack1188() { var buf [1188]byte; use(buf[:]); C.callGoStackCheck() } +func stack1192() { var buf [1192]byte; use(buf[:]); C.callGoStackCheck() } +func stack1196() { var buf [1196]byte; use(buf[:]); C.callGoStackCheck() } +func stack1200() { var buf [1200]byte; use(buf[:]); C.callGoStackCheck() } +func stack1204() { var buf [1204]byte; use(buf[:]); C.callGoStackCheck() } +func stack1208() { var buf [1208]byte; use(buf[:]); C.callGoStackCheck() } +func stack1212() { var buf [1212]byte; use(buf[:]); C.callGoStackCheck() } +func stack1216() { var buf [1216]byte; use(buf[:]); C.callGoStackCheck() } +func stack1220() { var buf [1220]byte; use(buf[:]); C.callGoStackCheck() } +func stack1224() { var buf [1224]byte; use(buf[:]); C.callGoStackCheck() } +func stack1228() { var buf [1228]byte; use(buf[:]); C.callGoStackCheck() } +func stack1232() { var buf [1232]byte; use(buf[:]); C.callGoStackCheck() } +func stack1236() { var buf [1236]byte; use(buf[:]); C.callGoStackCheck() } +func stack1240() { var buf [1240]byte; use(buf[:]); C.callGoStackCheck() } +func stack1244() { var buf [1244]byte; use(buf[:]); C.callGoStackCheck() } +func stack1248() { var buf [1248]byte; use(buf[:]); C.callGoStackCheck() } +func stack1252() { var buf [1252]byte; use(buf[:]); C.callGoStackCheck() } +func stack1256() { var buf [1256]byte; use(buf[:]); C.callGoStackCheck() } +func stack1260() { var buf [1260]byte; use(buf[:]); C.callGoStackCheck() } +func stack1264() { var buf [1264]byte; use(buf[:]); C.callGoStackCheck() } +func stack1268() { var buf [1268]byte; use(buf[:]); C.callGoStackCheck() } +func stack1272() { var buf [1272]byte; use(buf[:]); C.callGoStackCheck() } +func stack1276() { var buf [1276]byte; use(buf[:]); C.callGoStackCheck() } +func stack1280() { var buf [1280]byte; use(buf[:]); C.callGoStackCheck() } +func stack1284() { var buf [1284]byte; use(buf[:]); C.callGoStackCheck() } +func stack1288() { var buf [1288]byte; use(buf[:]); C.callGoStackCheck() } +func stack1292() { var buf [1292]byte; use(buf[:]); C.callGoStackCheck() } +func stack1296() { var buf [1296]byte; use(buf[:]); C.callGoStackCheck() } +func stack1300() { var buf [1300]byte; use(buf[:]); C.callGoStackCheck() } +func stack1304() { var buf [1304]byte; use(buf[:]); C.callGoStackCheck() } +func stack1308() { var buf [1308]byte; use(buf[:]); C.callGoStackCheck() } +func stack1312() { var buf [1312]byte; use(buf[:]); C.callGoStackCheck() } +func stack1316() { var buf [1316]byte; use(buf[:]); C.callGoStackCheck() } +func stack1320() { var buf [1320]byte; use(buf[:]); C.callGoStackCheck() } +func stack1324() { var buf [1324]byte; use(buf[:]); C.callGoStackCheck() } +func stack1328() { var buf [1328]byte; use(buf[:]); C.callGoStackCheck() } +func stack1332() { var buf [1332]byte; use(buf[:]); C.callGoStackCheck() } +func stack1336() { var buf [1336]byte; use(buf[:]); C.callGoStackCheck() } +func stack1340() { var buf [1340]byte; use(buf[:]); C.callGoStackCheck() } +func stack1344() { var buf [1344]byte; use(buf[:]); C.callGoStackCheck() } +func stack1348() { var buf [1348]byte; use(buf[:]); C.callGoStackCheck() } +func stack1352() { var buf [1352]byte; use(buf[:]); C.callGoStackCheck() } +func stack1356() { var buf [1356]byte; use(buf[:]); C.callGoStackCheck() } +func stack1360() { var buf [1360]byte; use(buf[:]); C.callGoStackCheck() } +func stack1364() { var buf [1364]byte; use(buf[:]); C.callGoStackCheck() } +func stack1368() { var buf [1368]byte; use(buf[:]); C.callGoStackCheck() } +func stack1372() { var buf [1372]byte; use(buf[:]); C.callGoStackCheck() } +func stack1376() { var buf [1376]byte; use(buf[:]); C.callGoStackCheck() } +func stack1380() { var buf [1380]byte; use(buf[:]); C.callGoStackCheck() } +func stack1384() { var buf [1384]byte; use(buf[:]); C.callGoStackCheck() } +func stack1388() { var buf [1388]byte; use(buf[:]); C.callGoStackCheck() } +func stack1392() { var buf [1392]byte; use(buf[:]); C.callGoStackCheck() } +func stack1396() { var buf [1396]byte; use(buf[:]); C.callGoStackCheck() } +func stack1400() { var buf [1400]byte; use(buf[:]); C.callGoStackCheck() } +func stack1404() { var buf [1404]byte; use(buf[:]); C.callGoStackCheck() } +func stack1408() { var buf [1408]byte; use(buf[:]); C.callGoStackCheck() } +func stack1412() { var buf [1412]byte; use(buf[:]); C.callGoStackCheck() } +func stack1416() { var buf [1416]byte; use(buf[:]); C.callGoStackCheck() } +func stack1420() { var buf [1420]byte; use(buf[:]); C.callGoStackCheck() } +func stack1424() { var buf [1424]byte; use(buf[:]); C.callGoStackCheck() } +func stack1428() { var buf [1428]byte; use(buf[:]); C.callGoStackCheck() } +func stack1432() { var buf [1432]byte; use(buf[:]); C.callGoStackCheck() } +func stack1436() { var buf [1436]byte; use(buf[:]); C.callGoStackCheck() } +func stack1440() { var buf [1440]byte; use(buf[:]); C.callGoStackCheck() } +func stack1444() { var buf [1444]byte; use(buf[:]); C.callGoStackCheck() } +func stack1448() { var buf [1448]byte; use(buf[:]); C.callGoStackCheck() } +func stack1452() { var buf [1452]byte; use(buf[:]); C.callGoStackCheck() } +func stack1456() { var buf [1456]byte; use(buf[:]); C.callGoStackCheck() } +func stack1460() { var buf [1460]byte; use(buf[:]); C.callGoStackCheck() } +func stack1464() { var buf [1464]byte; use(buf[:]); C.callGoStackCheck() } +func stack1468() { var buf [1468]byte; use(buf[:]); C.callGoStackCheck() } +func stack1472() { var buf [1472]byte; use(buf[:]); C.callGoStackCheck() } +func stack1476() { var buf [1476]byte; use(buf[:]); C.callGoStackCheck() } +func stack1480() { var buf [1480]byte; use(buf[:]); C.callGoStackCheck() } +func stack1484() { var buf [1484]byte; use(buf[:]); C.callGoStackCheck() } +func stack1488() { var buf [1488]byte; use(buf[:]); C.callGoStackCheck() } +func stack1492() { var buf [1492]byte; use(buf[:]); C.callGoStackCheck() } +func stack1496() { var buf [1496]byte; use(buf[:]); C.callGoStackCheck() } +func stack1500() { var buf [1500]byte; use(buf[:]); C.callGoStackCheck() } +func stack1504() { var buf [1504]byte; use(buf[:]); C.callGoStackCheck() } +func stack1508() { var buf [1508]byte; use(buf[:]); C.callGoStackCheck() } +func stack1512() { var buf [1512]byte; use(buf[:]); C.callGoStackCheck() } +func stack1516() { var buf [1516]byte; use(buf[:]); C.callGoStackCheck() } +func stack1520() { var buf [1520]byte; use(buf[:]); C.callGoStackCheck() } +func stack1524() { var buf [1524]byte; use(buf[:]); C.callGoStackCheck() } +func stack1528() { var buf [1528]byte; use(buf[:]); C.callGoStackCheck() } +func stack1532() { var buf [1532]byte; use(buf[:]); C.callGoStackCheck() } +func stack1536() { var buf [1536]byte; use(buf[:]); C.callGoStackCheck() } +func stack1540() { var buf [1540]byte; use(buf[:]); C.callGoStackCheck() } +func stack1544() { var buf [1544]byte; use(buf[:]); C.callGoStackCheck() } +func stack1548() { var buf [1548]byte; use(buf[:]); C.callGoStackCheck() } +func stack1552() { var buf [1552]byte; use(buf[:]); C.callGoStackCheck() } +func stack1556() { var buf [1556]byte; use(buf[:]); C.callGoStackCheck() } +func stack1560() { var buf [1560]byte; use(buf[:]); C.callGoStackCheck() } +func stack1564() { var buf [1564]byte; use(buf[:]); C.callGoStackCheck() } +func stack1568() { var buf [1568]byte; use(buf[:]); C.callGoStackCheck() } +func stack1572() { var buf [1572]byte; use(buf[:]); C.callGoStackCheck() } +func stack1576() { var buf [1576]byte; use(buf[:]); C.callGoStackCheck() } +func stack1580() { var buf [1580]byte; use(buf[:]); C.callGoStackCheck() } +func stack1584() { var buf [1584]byte; use(buf[:]); C.callGoStackCheck() } +func stack1588() { var buf [1588]byte; use(buf[:]); C.callGoStackCheck() } +func stack1592() { var buf [1592]byte; use(buf[:]); C.callGoStackCheck() } +func stack1596() { var buf [1596]byte; use(buf[:]); C.callGoStackCheck() } +func stack1600() { var buf [1600]byte; use(buf[:]); C.callGoStackCheck() } +func stack1604() { var buf [1604]byte; use(buf[:]); C.callGoStackCheck() } +func stack1608() { var buf [1608]byte; use(buf[:]); C.callGoStackCheck() } +func stack1612() { var buf [1612]byte; use(buf[:]); C.callGoStackCheck() } +func stack1616() { var buf [1616]byte; use(buf[:]); C.callGoStackCheck() } +func stack1620() { var buf [1620]byte; use(buf[:]); C.callGoStackCheck() } +func stack1624() { var buf [1624]byte; use(buf[:]); C.callGoStackCheck() } +func stack1628() { var buf [1628]byte; use(buf[:]); C.callGoStackCheck() } +func stack1632() { var buf [1632]byte; use(buf[:]); C.callGoStackCheck() } +func stack1636() { var buf [1636]byte; use(buf[:]); C.callGoStackCheck() } +func stack1640() { var buf [1640]byte; use(buf[:]); C.callGoStackCheck() } +func stack1644() { var buf [1644]byte; use(buf[:]); C.callGoStackCheck() } +func stack1648() { var buf [1648]byte; use(buf[:]); C.callGoStackCheck() } +func stack1652() { var buf [1652]byte; use(buf[:]); C.callGoStackCheck() } +func stack1656() { var buf [1656]byte; use(buf[:]); C.callGoStackCheck() } +func stack1660() { var buf [1660]byte; use(buf[:]); C.callGoStackCheck() } +func stack1664() { var buf [1664]byte; use(buf[:]); C.callGoStackCheck() } +func stack1668() { var buf [1668]byte; use(buf[:]); C.callGoStackCheck() } +func stack1672() { var buf [1672]byte; use(buf[:]); C.callGoStackCheck() } +func stack1676() { var buf [1676]byte; use(buf[:]); C.callGoStackCheck() } +func stack1680() { var buf [1680]byte; use(buf[:]); C.callGoStackCheck() } +func stack1684() { var buf [1684]byte; use(buf[:]); C.callGoStackCheck() } +func stack1688() { var buf [1688]byte; use(buf[:]); C.callGoStackCheck() } +func stack1692() { var buf [1692]byte; use(buf[:]); C.callGoStackCheck() } +func stack1696() { var buf [1696]byte; use(buf[:]); C.callGoStackCheck() } +func stack1700() { var buf [1700]byte; use(buf[:]); C.callGoStackCheck() } +func stack1704() { var buf [1704]byte; use(buf[:]); C.callGoStackCheck() } +func stack1708() { var buf [1708]byte; use(buf[:]); C.callGoStackCheck() } +func stack1712() { var buf [1712]byte; use(buf[:]); C.callGoStackCheck() } +func stack1716() { var buf [1716]byte; use(buf[:]); C.callGoStackCheck() } +func stack1720() { var buf [1720]byte; use(buf[:]); C.callGoStackCheck() } +func stack1724() { var buf [1724]byte; use(buf[:]); C.callGoStackCheck() } +func stack1728() { var buf [1728]byte; use(buf[:]); C.callGoStackCheck() } +func stack1732() { var buf [1732]byte; use(buf[:]); C.callGoStackCheck() } +func stack1736() { var buf [1736]byte; use(buf[:]); C.callGoStackCheck() } +func stack1740() { var buf [1740]byte; use(buf[:]); C.callGoStackCheck() } +func stack1744() { var buf [1744]byte; use(buf[:]); C.callGoStackCheck() } +func stack1748() { var buf [1748]byte; use(buf[:]); C.callGoStackCheck() } +func stack1752() { var buf [1752]byte; use(buf[:]); C.callGoStackCheck() } +func stack1756() { var buf [1756]byte; use(buf[:]); C.callGoStackCheck() } +func stack1760() { var buf [1760]byte; use(buf[:]); C.callGoStackCheck() } +func stack1764() { var buf [1764]byte; use(buf[:]); C.callGoStackCheck() } +func stack1768() { var buf [1768]byte; use(buf[:]); C.callGoStackCheck() } +func stack1772() { var buf [1772]byte; use(buf[:]); C.callGoStackCheck() } +func stack1776() { var buf [1776]byte; use(buf[:]); C.callGoStackCheck() } +func stack1780() { var buf [1780]byte; use(buf[:]); C.callGoStackCheck() } +func stack1784() { var buf [1784]byte; use(buf[:]); C.callGoStackCheck() } +func stack1788() { var buf [1788]byte; use(buf[:]); C.callGoStackCheck() } +func stack1792() { var buf [1792]byte; use(buf[:]); C.callGoStackCheck() } +func stack1796() { var buf [1796]byte; use(buf[:]); C.callGoStackCheck() } +func stack1800() { var buf [1800]byte; use(buf[:]); C.callGoStackCheck() } +func stack1804() { var buf [1804]byte; use(buf[:]); C.callGoStackCheck() } +func stack1808() { var buf [1808]byte; use(buf[:]); C.callGoStackCheck() } +func stack1812() { var buf [1812]byte; use(buf[:]); C.callGoStackCheck() } +func stack1816() { var buf [1816]byte; use(buf[:]); C.callGoStackCheck() } +func stack1820() { var buf [1820]byte; use(buf[:]); C.callGoStackCheck() } +func stack1824() { var buf [1824]byte; use(buf[:]); C.callGoStackCheck() } +func stack1828() { var buf [1828]byte; use(buf[:]); C.callGoStackCheck() } +func stack1832() { var buf [1832]byte; use(buf[:]); C.callGoStackCheck() } +func stack1836() { var buf [1836]byte; use(buf[:]); C.callGoStackCheck() } +func stack1840() { var buf [1840]byte; use(buf[:]); C.callGoStackCheck() } +func stack1844() { var buf [1844]byte; use(buf[:]); C.callGoStackCheck() } +func stack1848() { var buf [1848]byte; use(buf[:]); C.callGoStackCheck() } +func stack1852() { var buf [1852]byte; use(buf[:]); C.callGoStackCheck() } +func stack1856() { var buf [1856]byte; use(buf[:]); C.callGoStackCheck() } +func stack1860() { var buf [1860]byte; use(buf[:]); C.callGoStackCheck() } +func stack1864() { var buf [1864]byte; use(buf[:]); C.callGoStackCheck() } +func stack1868() { var buf [1868]byte; use(buf[:]); C.callGoStackCheck() } +func stack1872() { var buf [1872]byte; use(buf[:]); C.callGoStackCheck() } +func stack1876() { var buf [1876]byte; use(buf[:]); C.callGoStackCheck() } +func stack1880() { var buf [1880]byte; use(buf[:]); C.callGoStackCheck() } +func stack1884() { var buf [1884]byte; use(buf[:]); C.callGoStackCheck() } +func stack1888() { var buf [1888]byte; use(buf[:]); C.callGoStackCheck() } +func stack1892() { var buf [1892]byte; use(buf[:]); C.callGoStackCheck() } +func stack1896() { var buf [1896]byte; use(buf[:]); C.callGoStackCheck() } +func stack1900() { var buf [1900]byte; use(buf[:]); C.callGoStackCheck() } +func stack1904() { var buf [1904]byte; use(buf[:]); C.callGoStackCheck() } +func stack1908() { var buf [1908]byte; use(buf[:]); C.callGoStackCheck() } +func stack1912() { var buf [1912]byte; use(buf[:]); C.callGoStackCheck() } +func stack1916() { var buf [1916]byte; use(buf[:]); C.callGoStackCheck() } +func stack1920() { var buf [1920]byte; use(buf[:]); C.callGoStackCheck() } +func stack1924() { var buf [1924]byte; use(buf[:]); C.callGoStackCheck() } +func stack1928() { var buf [1928]byte; use(buf[:]); C.callGoStackCheck() } +func stack1932() { var buf [1932]byte; use(buf[:]); C.callGoStackCheck() } +func stack1936() { var buf [1936]byte; use(buf[:]); C.callGoStackCheck() } +func stack1940() { var buf [1940]byte; use(buf[:]); C.callGoStackCheck() } +func stack1944() { var buf [1944]byte; use(buf[:]); C.callGoStackCheck() } +func stack1948() { var buf [1948]byte; use(buf[:]); C.callGoStackCheck() } +func stack1952() { var buf [1952]byte; use(buf[:]); C.callGoStackCheck() } +func stack1956() { var buf [1956]byte; use(buf[:]); C.callGoStackCheck() } +func stack1960() { var buf [1960]byte; use(buf[:]); C.callGoStackCheck() } +func stack1964() { var buf [1964]byte; use(buf[:]); C.callGoStackCheck() } +func stack1968() { var buf [1968]byte; use(buf[:]); C.callGoStackCheck() } +func stack1972() { var buf [1972]byte; use(buf[:]); C.callGoStackCheck() } +func stack1976() { var buf [1976]byte; use(buf[:]); C.callGoStackCheck() } +func stack1980() { var buf [1980]byte; use(buf[:]); C.callGoStackCheck() } +func stack1984() { var buf [1984]byte; use(buf[:]); C.callGoStackCheck() } +func stack1988() { var buf [1988]byte; use(buf[:]); C.callGoStackCheck() } +func stack1992() { var buf [1992]byte; use(buf[:]); C.callGoStackCheck() } +func stack1996() { var buf [1996]byte; use(buf[:]); C.callGoStackCheck() } +func stack2000() { var buf [2000]byte; use(buf[:]); C.callGoStackCheck() } +func stack2004() { var buf [2004]byte; use(buf[:]); C.callGoStackCheck() } +func stack2008() { var buf [2008]byte; use(buf[:]); C.callGoStackCheck() } +func stack2012() { var buf [2012]byte; use(buf[:]); C.callGoStackCheck() } +func stack2016() { var buf [2016]byte; use(buf[:]); C.callGoStackCheck() } +func stack2020() { var buf [2020]byte; use(buf[:]); C.callGoStackCheck() } +func stack2024() { var buf [2024]byte; use(buf[:]); C.callGoStackCheck() } +func stack2028() { var buf [2028]byte; use(buf[:]); C.callGoStackCheck() } +func stack2032() { var buf [2032]byte; use(buf[:]); C.callGoStackCheck() } +func stack2036() { var buf [2036]byte; use(buf[:]); C.callGoStackCheck() } +func stack2040() { var buf [2040]byte; use(buf[:]); C.callGoStackCheck() } +func stack2044() { var buf [2044]byte; use(buf[:]); C.callGoStackCheck() } +func stack2048() { var buf [2048]byte; use(buf[:]); C.callGoStackCheck() } +func stack2052() { var buf [2052]byte; use(buf[:]); C.callGoStackCheck() } +func stack2056() { var buf [2056]byte; use(buf[:]); C.callGoStackCheck() } +func stack2060() { var buf [2060]byte; use(buf[:]); C.callGoStackCheck() } +func stack2064() { var buf [2064]byte; use(buf[:]); C.callGoStackCheck() } +func stack2068() { var buf [2068]byte; use(buf[:]); C.callGoStackCheck() } +func stack2072() { var buf [2072]byte; use(buf[:]); C.callGoStackCheck() } +func stack2076() { var buf [2076]byte; use(buf[:]); C.callGoStackCheck() } +func stack2080() { var buf [2080]byte; use(buf[:]); C.callGoStackCheck() } +func stack2084() { var buf [2084]byte; use(buf[:]); C.callGoStackCheck() } +func stack2088() { var buf [2088]byte; use(buf[:]); C.callGoStackCheck() } +func stack2092() { var buf [2092]byte; use(buf[:]); C.callGoStackCheck() } +func stack2096() { var buf [2096]byte; use(buf[:]); C.callGoStackCheck() } +func stack2100() { var buf [2100]byte; use(buf[:]); C.callGoStackCheck() } +func stack2104() { var buf [2104]byte; use(buf[:]); C.callGoStackCheck() } +func stack2108() { var buf [2108]byte; use(buf[:]); C.callGoStackCheck() } +func stack2112() { var buf [2112]byte; use(buf[:]); C.callGoStackCheck() } +func stack2116() { var buf [2116]byte; use(buf[:]); C.callGoStackCheck() } +func stack2120() { var buf [2120]byte; use(buf[:]); C.callGoStackCheck() } +func stack2124() { var buf [2124]byte; use(buf[:]); C.callGoStackCheck() } +func stack2128() { var buf [2128]byte; use(buf[:]); C.callGoStackCheck() } +func stack2132() { var buf [2132]byte; use(buf[:]); C.callGoStackCheck() } +func stack2136() { var buf [2136]byte; use(buf[:]); C.callGoStackCheck() } +func stack2140() { var buf [2140]byte; use(buf[:]); C.callGoStackCheck() } +func stack2144() { var buf [2144]byte; use(buf[:]); C.callGoStackCheck() } +func stack2148() { var buf [2148]byte; use(buf[:]); C.callGoStackCheck() } +func stack2152() { var buf [2152]byte; use(buf[:]); C.callGoStackCheck() } +func stack2156() { var buf [2156]byte; use(buf[:]); C.callGoStackCheck() } +func stack2160() { var buf [2160]byte; use(buf[:]); C.callGoStackCheck() } +func stack2164() { var buf [2164]byte; use(buf[:]); C.callGoStackCheck() } +func stack2168() { var buf [2168]byte; use(buf[:]); C.callGoStackCheck() } +func stack2172() { var buf [2172]byte; use(buf[:]); C.callGoStackCheck() } +func stack2176() { var buf [2176]byte; use(buf[:]); C.callGoStackCheck() } +func stack2180() { var buf [2180]byte; use(buf[:]); C.callGoStackCheck() } +func stack2184() { var buf [2184]byte; use(buf[:]); C.callGoStackCheck() } +func stack2188() { var buf [2188]byte; use(buf[:]); C.callGoStackCheck() } +func stack2192() { var buf [2192]byte; use(buf[:]); C.callGoStackCheck() } +func stack2196() { var buf [2196]byte; use(buf[:]); C.callGoStackCheck() } +func stack2200() { var buf [2200]byte; use(buf[:]); C.callGoStackCheck() } +func stack2204() { var buf [2204]byte; use(buf[:]); C.callGoStackCheck() } +func stack2208() { var buf [2208]byte; use(buf[:]); C.callGoStackCheck() } +func stack2212() { var buf [2212]byte; use(buf[:]); C.callGoStackCheck() } +func stack2216() { var buf [2216]byte; use(buf[:]); C.callGoStackCheck() } +func stack2220() { var buf [2220]byte; use(buf[:]); C.callGoStackCheck() } +func stack2224() { var buf [2224]byte; use(buf[:]); C.callGoStackCheck() } +func stack2228() { var buf [2228]byte; use(buf[:]); C.callGoStackCheck() } +func stack2232() { var buf [2232]byte; use(buf[:]); C.callGoStackCheck() } +func stack2236() { var buf [2236]byte; use(buf[:]); C.callGoStackCheck() } +func stack2240() { var buf [2240]byte; use(buf[:]); C.callGoStackCheck() } +func stack2244() { var buf [2244]byte; use(buf[:]); C.callGoStackCheck() } +func stack2248() { var buf [2248]byte; use(buf[:]); C.callGoStackCheck() } +func stack2252() { var buf [2252]byte; use(buf[:]); C.callGoStackCheck() } +func stack2256() { var buf [2256]byte; use(buf[:]); C.callGoStackCheck() } +func stack2260() { var buf [2260]byte; use(buf[:]); C.callGoStackCheck() } +func stack2264() { var buf [2264]byte; use(buf[:]); C.callGoStackCheck() } +func stack2268() { var buf [2268]byte; use(buf[:]); C.callGoStackCheck() } +func stack2272() { var buf [2272]byte; use(buf[:]); C.callGoStackCheck() } +func stack2276() { var buf [2276]byte; use(buf[:]); C.callGoStackCheck() } +func stack2280() { var buf [2280]byte; use(buf[:]); C.callGoStackCheck() } +func stack2284() { var buf [2284]byte; use(buf[:]); C.callGoStackCheck() } +func stack2288() { var buf [2288]byte; use(buf[:]); C.callGoStackCheck() } +func stack2292() { var buf [2292]byte; use(buf[:]); C.callGoStackCheck() } +func stack2296() { var buf [2296]byte; use(buf[:]); C.callGoStackCheck() } +func stack2300() { var buf [2300]byte; use(buf[:]); C.callGoStackCheck() } +func stack2304() { var buf [2304]byte; use(buf[:]); C.callGoStackCheck() } +func stack2308() { var buf [2308]byte; use(buf[:]); C.callGoStackCheck() } +func stack2312() { var buf [2312]byte; use(buf[:]); C.callGoStackCheck() } +func stack2316() { var buf [2316]byte; use(buf[:]); C.callGoStackCheck() } +func stack2320() { var buf [2320]byte; use(buf[:]); C.callGoStackCheck() } +func stack2324() { var buf [2324]byte; use(buf[:]); C.callGoStackCheck() } +func stack2328() { var buf [2328]byte; use(buf[:]); C.callGoStackCheck() } +func stack2332() { var buf [2332]byte; use(buf[:]); C.callGoStackCheck() } +func stack2336() { var buf [2336]byte; use(buf[:]); C.callGoStackCheck() } +func stack2340() { var buf [2340]byte; use(buf[:]); C.callGoStackCheck() } +func stack2344() { var buf [2344]byte; use(buf[:]); C.callGoStackCheck() } +func stack2348() { var buf [2348]byte; use(buf[:]); C.callGoStackCheck() } +func stack2352() { var buf [2352]byte; use(buf[:]); C.callGoStackCheck() } +func stack2356() { var buf [2356]byte; use(buf[:]); C.callGoStackCheck() } +func stack2360() { var buf [2360]byte; use(buf[:]); C.callGoStackCheck() } +func stack2364() { var buf [2364]byte; use(buf[:]); C.callGoStackCheck() } +func stack2368() { var buf [2368]byte; use(buf[:]); C.callGoStackCheck() } +func stack2372() { var buf [2372]byte; use(buf[:]); C.callGoStackCheck() } +func stack2376() { var buf [2376]byte; use(buf[:]); C.callGoStackCheck() } +func stack2380() { var buf [2380]byte; use(buf[:]); C.callGoStackCheck() } +func stack2384() { var buf [2384]byte; use(buf[:]); C.callGoStackCheck() } +func stack2388() { var buf [2388]byte; use(buf[:]); C.callGoStackCheck() } +func stack2392() { var buf [2392]byte; use(buf[:]); C.callGoStackCheck() } +func stack2396() { var buf [2396]byte; use(buf[:]); C.callGoStackCheck() } +func stack2400() { var buf [2400]byte; use(buf[:]); C.callGoStackCheck() } +func stack2404() { var buf [2404]byte; use(buf[:]); C.callGoStackCheck() } +func stack2408() { var buf [2408]byte; use(buf[:]); C.callGoStackCheck() } +func stack2412() { var buf [2412]byte; use(buf[:]); C.callGoStackCheck() } +func stack2416() { var buf [2416]byte; use(buf[:]); C.callGoStackCheck() } +func stack2420() { var buf [2420]byte; use(buf[:]); C.callGoStackCheck() } +func stack2424() { var buf [2424]byte; use(buf[:]); C.callGoStackCheck() } +func stack2428() { var buf [2428]byte; use(buf[:]); C.callGoStackCheck() } +func stack2432() { var buf [2432]byte; use(buf[:]); C.callGoStackCheck() } +func stack2436() { var buf [2436]byte; use(buf[:]); C.callGoStackCheck() } +func stack2440() { var buf [2440]byte; use(buf[:]); C.callGoStackCheck() } +func stack2444() { var buf [2444]byte; use(buf[:]); C.callGoStackCheck() } +func stack2448() { var buf [2448]byte; use(buf[:]); C.callGoStackCheck() } +func stack2452() { var buf [2452]byte; use(buf[:]); C.callGoStackCheck() } +func stack2456() { var buf [2456]byte; use(buf[:]); C.callGoStackCheck() } +func stack2460() { var buf [2460]byte; use(buf[:]); C.callGoStackCheck() } +func stack2464() { var buf [2464]byte; use(buf[:]); C.callGoStackCheck() } +func stack2468() { var buf [2468]byte; use(buf[:]); C.callGoStackCheck() } +func stack2472() { var buf [2472]byte; use(buf[:]); C.callGoStackCheck() } +func stack2476() { var buf [2476]byte; use(buf[:]); C.callGoStackCheck() } +func stack2480() { var buf [2480]byte; use(buf[:]); C.callGoStackCheck() } +func stack2484() { var buf [2484]byte; use(buf[:]); C.callGoStackCheck() } +func stack2488() { var buf [2488]byte; use(buf[:]); C.callGoStackCheck() } +func stack2492() { var buf [2492]byte; use(buf[:]); C.callGoStackCheck() } +func stack2496() { var buf [2496]byte; use(buf[:]); C.callGoStackCheck() } +func stack2500() { var buf [2500]byte; use(buf[:]); C.callGoStackCheck() } +func stack2504() { var buf [2504]byte; use(buf[:]); C.callGoStackCheck() } +func stack2508() { var buf [2508]byte; use(buf[:]); C.callGoStackCheck() } +func stack2512() { var buf [2512]byte; use(buf[:]); C.callGoStackCheck() } +func stack2516() { var buf [2516]byte; use(buf[:]); C.callGoStackCheck() } +func stack2520() { var buf [2520]byte; use(buf[:]); C.callGoStackCheck() } +func stack2524() { var buf [2524]byte; use(buf[:]); C.callGoStackCheck() } +func stack2528() { var buf [2528]byte; use(buf[:]); C.callGoStackCheck() } +func stack2532() { var buf [2532]byte; use(buf[:]); C.callGoStackCheck() } +func stack2536() { var buf [2536]byte; use(buf[:]); C.callGoStackCheck() } +func stack2540() { var buf [2540]byte; use(buf[:]); C.callGoStackCheck() } +func stack2544() { var buf [2544]byte; use(buf[:]); C.callGoStackCheck() } +func stack2548() { var buf [2548]byte; use(buf[:]); C.callGoStackCheck() } +func stack2552() { var buf [2552]byte; use(buf[:]); C.callGoStackCheck() } +func stack2556() { var buf [2556]byte; use(buf[:]); C.callGoStackCheck() } +func stack2560() { var buf [2560]byte; use(buf[:]); C.callGoStackCheck() } +func stack2564() { var buf [2564]byte; use(buf[:]); C.callGoStackCheck() } +func stack2568() { var buf [2568]byte; use(buf[:]); C.callGoStackCheck() } +func stack2572() { var buf [2572]byte; use(buf[:]); C.callGoStackCheck() } +func stack2576() { var buf [2576]byte; use(buf[:]); C.callGoStackCheck() } +func stack2580() { var buf [2580]byte; use(buf[:]); C.callGoStackCheck() } +func stack2584() { var buf [2584]byte; use(buf[:]); C.callGoStackCheck() } +func stack2588() { var buf [2588]byte; use(buf[:]); C.callGoStackCheck() } +func stack2592() { var buf [2592]byte; use(buf[:]); C.callGoStackCheck() } +func stack2596() { var buf [2596]byte; use(buf[:]); C.callGoStackCheck() } +func stack2600() { var buf [2600]byte; use(buf[:]); C.callGoStackCheck() } +func stack2604() { var buf [2604]byte; use(buf[:]); C.callGoStackCheck() } +func stack2608() { var buf [2608]byte; use(buf[:]); C.callGoStackCheck() } +func stack2612() { var buf [2612]byte; use(buf[:]); C.callGoStackCheck() } +func stack2616() { var buf [2616]byte; use(buf[:]); C.callGoStackCheck() } +func stack2620() { var buf [2620]byte; use(buf[:]); C.callGoStackCheck() } +func stack2624() { var buf [2624]byte; use(buf[:]); C.callGoStackCheck() } +func stack2628() { var buf [2628]byte; use(buf[:]); C.callGoStackCheck() } +func stack2632() { var buf [2632]byte; use(buf[:]); C.callGoStackCheck() } +func stack2636() { var buf [2636]byte; use(buf[:]); C.callGoStackCheck() } +func stack2640() { var buf [2640]byte; use(buf[:]); C.callGoStackCheck() } +func stack2644() { var buf [2644]byte; use(buf[:]); C.callGoStackCheck() } +func stack2648() { var buf [2648]byte; use(buf[:]); C.callGoStackCheck() } +func stack2652() { var buf [2652]byte; use(buf[:]); C.callGoStackCheck() } +func stack2656() { var buf [2656]byte; use(buf[:]); C.callGoStackCheck() } +func stack2660() { var buf [2660]byte; use(buf[:]); C.callGoStackCheck() } +func stack2664() { var buf [2664]byte; use(buf[:]); C.callGoStackCheck() } +func stack2668() { var buf [2668]byte; use(buf[:]); C.callGoStackCheck() } +func stack2672() { var buf [2672]byte; use(buf[:]); C.callGoStackCheck() } +func stack2676() { var buf [2676]byte; use(buf[:]); C.callGoStackCheck() } +func stack2680() { var buf [2680]byte; use(buf[:]); C.callGoStackCheck() } +func stack2684() { var buf [2684]byte; use(buf[:]); C.callGoStackCheck() } +func stack2688() { var buf [2688]byte; use(buf[:]); C.callGoStackCheck() } +func stack2692() { var buf [2692]byte; use(buf[:]); C.callGoStackCheck() } +func stack2696() { var buf [2696]byte; use(buf[:]); C.callGoStackCheck() } +func stack2700() { var buf [2700]byte; use(buf[:]); C.callGoStackCheck() } +func stack2704() { var buf [2704]byte; use(buf[:]); C.callGoStackCheck() } +func stack2708() { var buf [2708]byte; use(buf[:]); C.callGoStackCheck() } +func stack2712() { var buf [2712]byte; use(buf[:]); C.callGoStackCheck() } +func stack2716() { var buf [2716]byte; use(buf[:]); C.callGoStackCheck() } +func stack2720() { var buf [2720]byte; use(buf[:]); C.callGoStackCheck() } +func stack2724() { var buf [2724]byte; use(buf[:]); C.callGoStackCheck() } +func stack2728() { var buf [2728]byte; use(buf[:]); C.callGoStackCheck() } +func stack2732() { var buf [2732]byte; use(buf[:]); C.callGoStackCheck() } +func stack2736() { var buf [2736]byte; use(buf[:]); C.callGoStackCheck() } +func stack2740() { var buf [2740]byte; use(buf[:]); C.callGoStackCheck() } +func stack2744() { var buf [2744]byte; use(buf[:]); C.callGoStackCheck() } +func stack2748() { var buf [2748]byte; use(buf[:]); C.callGoStackCheck() } +func stack2752() { var buf [2752]byte; use(buf[:]); C.callGoStackCheck() } +func stack2756() { var buf [2756]byte; use(buf[:]); C.callGoStackCheck() } +func stack2760() { var buf [2760]byte; use(buf[:]); C.callGoStackCheck() } +func stack2764() { var buf [2764]byte; use(buf[:]); C.callGoStackCheck() } +func stack2768() { var buf [2768]byte; use(buf[:]); C.callGoStackCheck() } +func stack2772() { var buf [2772]byte; use(buf[:]); C.callGoStackCheck() } +func stack2776() { var buf [2776]byte; use(buf[:]); C.callGoStackCheck() } +func stack2780() { var buf [2780]byte; use(buf[:]); C.callGoStackCheck() } +func stack2784() { var buf [2784]byte; use(buf[:]); C.callGoStackCheck() } +func stack2788() { var buf [2788]byte; use(buf[:]); C.callGoStackCheck() } +func stack2792() { var buf [2792]byte; use(buf[:]); C.callGoStackCheck() } +func stack2796() { var buf [2796]byte; use(buf[:]); C.callGoStackCheck() } +func stack2800() { var buf [2800]byte; use(buf[:]); C.callGoStackCheck() } +func stack2804() { var buf [2804]byte; use(buf[:]); C.callGoStackCheck() } +func stack2808() { var buf [2808]byte; use(buf[:]); C.callGoStackCheck() } +func stack2812() { var buf [2812]byte; use(buf[:]); C.callGoStackCheck() } +func stack2816() { var buf [2816]byte; use(buf[:]); C.callGoStackCheck() } +func stack2820() { var buf [2820]byte; use(buf[:]); C.callGoStackCheck() } +func stack2824() { var buf [2824]byte; use(buf[:]); C.callGoStackCheck() } +func stack2828() { var buf [2828]byte; use(buf[:]); C.callGoStackCheck() } +func stack2832() { var buf [2832]byte; use(buf[:]); C.callGoStackCheck() } +func stack2836() { var buf [2836]byte; use(buf[:]); C.callGoStackCheck() } +func stack2840() { var buf [2840]byte; use(buf[:]); C.callGoStackCheck() } +func stack2844() { var buf [2844]byte; use(buf[:]); C.callGoStackCheck() } +func stack2848() { var buf [2848]byte; use(buf[:]); C.callGoStackCheck() } +func stack2852() { var buf [2852]byte; use(buf[:]); C.callGoStackCheck() } +func stack2856() { var buf [2856]byte; use(buf[:]); C.callGoStackCheck() } +func stack2860() { var buf [2860]byte; use(buf[:]); C.callGoStackCheck() } +func stack2864() { var buf [2864]byte; use(buf[:]); C.callGoStackCheck() } +func stack2868() { var buf [2868]byte; use(buf[:]); C.callGoStackCheck() } +func stack2872() { var buf [2872]byte; use(buf[:]); C.callGoStackCheck() } +func stack2876() { var buf [2876]byte; use(buf[:]); C.callGoStackCheck() } +func stack2880() { var buf [2880]byte; use(buf[:]); C.callGoStackCheck() } +func stack2884() { var buf [2884]byte; use(buf[:]); C.callGoStackCheck() } +func stack2888() { var buf [2888]byte; use(buf[:]); C.callGoStackCheck() } +func stack2892() { var buf [2892]byte; use(buf[:]); C.callGoStackCheck() } +func stack2896() { var buf [2896]byte; use(buf[:]); C.callGoStackCheck() } +func stack2900() { var buf [2900]byte; use(buf[:]); C.callGoStackCheck() } +func stack2904() { var buf [2904]byte; use(buf[:]); C.callGoStackCheck() } +func stack2908() { var buf [2908]byte; use(buf[:]); C.callGoStackCheck() } +func stack2912() { var buf [2912]byte; use(buf[:]); C.callGoStackCheck() } +func stack2916() { var buf [2916]byte; use(buf[:]); C.callGoStackCheck() } +func stack2920() { var buf [2920]byte; use(buf[:]); C.callGoStackCheck() } +func stack2924() { var buf [2924]byte; use(buf[:]); C.callGoStackCheck() } +func stack2928() { var buf [2928]byte; use(buf[:]); C.callGoStackCheck() } +func stack2932() { var buf [2932]byte; use(buf[:]); C.callGoStackCheck() } +func stack2936() { var buf [2936]byte; use(buf[:]); C.callGoStackCheck() } +func stack2940() { var buf [2940]byte; use(buf[:]); C.callGoStackCheck() } +func stack2944() { var buf [2944]byte; use(buf[:]); C.callGoStackCheck() } +func stack2948() { var buf [2948]byte; use(buf[:]); C.callGoStackCheck() } +func stack2952() { var buf [2952]byte; use(buf[:]); C.callGoStackCheck() } +func stack2956() { var buf [2956]byte; use(buf[:]); C.callGoStackCheck() } +func stack2960() { var buf [2960]byte; use(buf[:]); C.callGoStackCheck() } +func stack2964() { var buf [2964]byte; use(buf[:]); C.callGoStackCheck() } +func stack2968() { var buf [2968]byte; use(buf[:]); C.callGoStackCheck() } +func stack2972() { var buf [2972]byte; use(buf[:]); C.callGoStackCheck() } +func stack2976() { var buf [2976]byte; use(buf[:]); C.callGoStackCheck() } +func stack2980() { var buf [2980]byte; use(buf[:]); C.callGoStackCheck() } +func stack2984() { var buf [2984]byte; use(buf[:]); C.callGoStackCheck() } +func stack2988() { var buf [2988]byte; use(buf[:]); C.callGoStackCheck() } +func stack2992() { var buf [2992]byte; use(buf[:]); C.callGoStackCheck() } +func stack2996() { var buf [2996]byte; use(buf[:]); C.callGoStackCheck() } +func stack3000() { var buf [3000]byte; use(buf[:]); C.callGoStackCheck() } +func stack3004() { var buf [3004]byte; use(buf[:]); C.callGoStackCheck() } +func stack3008() { var buf [3008]byte; use(buf[:]); C.callGoStackCheck() } +func stack3012() { var buf [3012]byte; use(buf[:]); C.callGoStackCheck() } +func stack3016() { var buf [3016]byte; use(buf[:]); C.callGoStackCheck() } +func stack3020() { var buf [3020]byte; use(buf[:]); C.callGoStackCheck() } +func stack3024() { var buf [3024]byte; use(buf[:]); C.callGoStackCheck() } +func stack3028() { var buf [3028]byte; use(buf[:]); C.callGoStackCheck() } +func stack3032() { var buf [3032]byte; use(buf[:]); C.callGoStackCheck() } +func stack3036() { var buf [3036]byte; use(buf[:]); C.callGoStackCheck() } +func stack3040() { var buf [3040]byte; use(buf[:]); C.callGoStackCheck() } +func stack3044() { var buf [3044]byte; use(buf[:]); C.callGoStackCheck() } +func stack3048() { var buf [3048]byte; use(buf[:]); C.callGoStackCheck() } +func stack3052() { var buf [3052]byte; use(buf[:]); C.callGoStackCheck() } +func stack3056() { var buf [3056]byte; use(buf[:]); C.callGoStackCheck() } +func stack3060() { var buf [3060]byte; use(buf[:]); C.callGoStackCheck() } +func stack3064() { var buf [3064]byte; use(buf[:]); C.callGoStackCheck() } +func stack3068() { var buf [3068]byte; use(buf[:]); C.callGoStackCheck() } +func stack3072() { var buf [3072]byte; use(buf[:]); C.callGoStackCheck() } +func stack3076() { var buf [3076]byte; use(buf[:]); C.callGoStackCheck() } +func stack3080() { var buf [3080]byte; use(buf[:]); C.callGoStackCheck() } +func stack3084() { var buf [3084]byte; use(buf[:]); C.callGoStackCheck() } +func stack3088() { var buf [3088]byte; use(buf[:]); C.callGoStackCheck() } +func stack3092() { var buf [3092]byte; use(buf[:]); C.callGoStackCheck() } +func stack3096() { var buf [3096]byte; use(buf[:]); C.callGoStackCheck() } +func stack3100() { var buf [3100]byte; use(buf[:]); C.callGoStackCheck() } +func stack3104() { var buf [3104]byte; use(buf[:]); C.callGoStackCheck() } +func stack3108() { var buf [3108]byte; use(buf[:]); C.callGoStackCheck() } +func stack3112() { var buf [3112]byte; use(buf[:]); C.callGoStackCheck() } +func stack3116() { var buf [3116]byte; use(buf[:]); C.callGoStackCheck() } +func stack3120() { var buf [3120]byte; use(buf[:]); C.callGoStackCheck() } +func stack3124() { var buf [3124]byte; use(buf[:]); C.callGoStackCheck() } +func stack3128() { var buf [3128]byte; use(buf[:]); C.callGoStackCheck() } +func stack3132() { var buf [3132]byte; use(buf[:]); C.callGoStackCheck() } +func stack3136() { var buf [3136]byte; use(buf[:]); C.callGoStackCheck() } +func stack3140() { var buf [3140]byte; use(buf[:]); C.callGoStackCheck() } +func stack3144() { var buf [3144]byte; use(buf[:]); C.callGoStackCheck() } +func stack3148() { var buf [3148]byte; use(buf[:]); C.callGoStackCheck() } +func stack3152() { var buf [3152]byte; use(buf[:]); C.callGoStackCheck() } +func stack3156() { var buf [3156]byte; use(buf[:]); C.callGoStackCheck() } +func stack3160() { var buf [3160]byte; use(buf[:]); C.callGoStackCheck() } +func stack3164() { var buf [3164]byte; use(buf[:]); C.callGoStackCheck() } +func stack3168() { var buf [3168]byte; use(buf[:]); C.callGoStackCheck() } +func stack3172() { var buf [3172]byte; use(buf[:]); C.callGoStackCheck() } +func stack3176() { var buf [3176]byte; use(buf[:]); C.callGoStackCheck() } +func stack3180() { var buf [3180]byte; use(buf[:]); C.callGoStackCheck() } +func stack3184() { var buf [3184]byte; use(buf[:]); C.callGoStackCheck() } +func stack3188() { var buf [3188]byte; use(buf[:]); C.callGoStackCheck() } +func stack3192() { var buf [3192]byte; use(buf[:]); C.callGoStackCheck() } +func stack3196() { var buf [3196]byte; use(buf[:]); C.callGoStackCheck() } +func stack3200() { var buf [3200]byte; use(buf[:]); C.callGoStackCheck() } +func stack3204() { var buf [3204]byte; use(buf[:]); C.callGoStackCheck() } +func stack3208() { var buf [3208]byte; use(buf[:]); C.callGoStackCheck() } +func stack3212() { var buf [3212]byte; use(buf[:]); C.callGoStackCheck() } +func stack3216() { var buf [3216]byte; use(buf[:]); C.callGoStackCheck() } +func stack3220() { var buf [3220]byte; use(buf[:]); C.callGoStackCheck() } +func stack3224() { var buf [3224]byte; use(buf[:]); C.callGoStackCheck() } +func stack3228() { var buf [3228]byte; use(buf[:]); C.callGoStackCheck() } +func stack3232() { var buf [3232]byte; use(buf[:]); C.callGoStackCheck() } +func stack3236() { var buf [3236]byte; use(buf[:]); C.callGoStackCheck() } +func stack3240() { var buf [3240]byte; use(buf[:]); C.callGoStackCheck() } +func stack3244() { var buf [3244]byte; use(buf[:]); C.callGoStackCheck() } +func stack3248() { var buf [3248]byte; use(buf[:]); C.callGoStackCheck() } +func stack3252() { var buf [3252]byte; use(buf[:]); C.callGoStackCheck() } +func stack3256() { var buf [3256]byte; use(buf[:]); C.callGoStackCheck() } +func stack3260() { var buf [3260]byte; use(buf[:]); C.callGoStackCheck() } +func stack3264() { var buf [3264]byte; use(buf[:]); C.callGoStackCheck() } +func stack3268() { var buf [3268]byte; use(buf[:]); C.callGoStackCheck() } +func stack3272() { var buf [3272]byte; use(buf[:]); C.callGoStackCheck() } +func stack3276() { var buf [3276]byte; use(buf[:]); C.callGoStackCheck() } +func stack3280() { var buf [3280]byte; use(buf[:]); C.callGoStackCheck() } +func stack3284() { var buf [3284]byte; use(buf[:]); C.callGoStackCheck() } +func stack3288() { var buf [3288]byte; use(buf[:]); C.callGoStackCheck() } +func stack3292() { var buf [3292]byte; use(buf[:]); C.callGoStackCheck() } +func stack3296() { var buf [3296]byte; use(buf[:]); C.callGoStackCheck() } +func stack3300() { var buf [3300]byte; use(buf[:]); C.callGoStackCheck() } +func stack3304() { var buf [3304]byte; use(buf[:]); C.callGoStackCheck() } +func stack3308() { var buf [3308]byte; use(buf[:]); C.callGoStackCheck() } +func stack3312() { var buf [3312]byte; use(buf[:]); C.callGoStackCheck() } +func stack3316() { var buf [3316]byte; use(buf[:]); C.callGoStackCheck() } +func stack3320() { var buf [3320]byte; use(buf[:]); C.callGoStackCheck() } +func stack3324() { var buf [3324]byte; use(buf[:]); C.callGoStackCheck() } +func stack3328() { var buf [3328]byte; use(buf[:]); C.callGoStackCheck() } +func stack3332() { var buf [3332]byte; use(buf[:]); C.callGoStackCheck() } +func stack3336() { var buf [3336]byte; use(buf[:]); C.callGoStackCheck() } +func stack3340() { var buf [3340]byte; use(buf[:]); C.callGoStackCheck() } +func stack3344() { var buf [3344]byte; use(buf[:]); C.callGoStackCheck() } +func stack3348() { var buf [3348]byte; use(buf[:]); C.callGoStackCheck() } +func stack3352() { var buf [3352]byte; use(buf[:]); C.callGoStackCheck() } +func stack3356() { var buf [3356]byte; use(buf[:]); C.callGoStackCheck() } +func stack3360() { var buf [3360]byte; use(buf[:]); C.callGoStackCheck() } +func stack3364() { var buf [3364]byte; use(buf[:]); C.callGoStackCheck() } +func stack3368() { var buf [3368]byte; use(buf[:]); C.callGoStackCheck() } +func stack3372() { var buf [3372]byte; use(buf[:]); C.callGoStackCheck() } +func stack3376() { var buf [3376]byte; use(buf[:]); C.callGoStackCheck() } +func stack3380() { var buf [3380]byte; use(buf[:]); C.callGoStackCheck() } +func stack3384() { var buf [3384]byte; use(buf[:]); C.callGoStackCheck() } +func stack3388() { var buf [3388]byte; use(buf[:]); C.callGoStackCheck() } +func stack3392() { var buf [3392]byte; use(buf[:]); C.callGoStackCheck() } +func stack3396() { var buf [3396]byte; use(buf[:]); C.callGoStackCheck() } +func stack3400() { var buf [3400]byte; use(buf[:]); C.callGoStackCheck() } +func stack3404() { var buf [3404]byte; use(buf[:]); C.callGoStackCheck() } +func stack3408() { var buf [3408]byte; use(buf[:]); C.callGoStackCheck() } +func stack3412() { var buf [3412]byte; use(buf[:]); C.callGoStackCheck() } +func stack3416() { var buf [3416]byte; use(buf[:]); C.callGoStackCheck() } +func stack3420() { var buf [3420]byte; use(buf[:]); C.callGoStackCheck() } +func stack3424() { var buf [3424]byte; use(buf[:]); C.callGoStackCheck() } +func stack3428() { var buf [3428]byte; use(buf[:]); C.callGoStackCheck() } +func stack3432() { var buf [3432]byte; use(buf[:]); C.callGoStackCheck() } +func stack3436() { var buf [3436]byte; use(buf[:]); C.callGoStackCheck() } +func stack3440() { var buf [3440]byte; use(buf[:]); C.callGoStackCheck() } +func stack3444() { var buf [3444]byte; use(buf[:]); C.callGoStackCheck() } +func stack3448() { var buf [3448]byte; use(buf[:]); C.callGoStackCheck() } +func stack3452() { var buf [3452]byte; use(buf[:]); C.callGoStackCheck() } +func stack3456() { var buf [3456]byte; use(buf[:]); C.callGoStackCheck() } +func stack3460() { var buf [3460]byte; use(buf[:]); C.callGoStackCheck() } +func stack3464() { var buf [3464]byte; use(buf[:]); C.callGoStackCheck() } +func stack3468() { var buf [3468]byte; use(buf[:]); C.callGoStackCheck() } +func stack3472() { var buf [3472]byte; use(buf[:]); C.callGoStackCheck() } +func stack3476() { var buf [3476]byte; use(buf[:]); C.callGoStackCheck() } +func stack3480() { var buf [3480]byte; use(buf[:]); C.callGoStackCheck() } +func stack3484() { var buf [3484]byte; use(buf[:]); C.callGoStackCheck() } +func stack3488() { var buf [3488]byte; use(buf[:]); C.callGoStackCheck() } +func stack3492() { var buf [3492]byte; use(buf[:]); C.callGoStackCheck() } +func stack3496() { var buf [3496]byte; use(buf[:]); C.callGoStackCheck() } +func stack3500() { var buf [3500]byte; use(buf[:]); C.callGoStackCheck() } +func stack3504() { var buf [3504]byte; use(buf[:]); C.callGoStackCheck() } +func stack3508() { var buf [3508]byte; use(buf[:]); C.callGoStackCheck() } +func stack3512() { var buf [3512]byte; use(buf[:]); C.callGoStackCheck() } +func stack3516() { var buf [3516]byte; use(buf[:]); C.callGoStackCheck() } +func stack3520() { var buf [3520]byte; use(buf[:]); C.callGoStackCheck() } +func stack3524() { var buf [3524]byte; use(buf[:]); C.callGoStackCheck() } +func stack3528() { var buf [3528]byte; use(buf[:]); C.callGoStackCheck() } +func stack3532() { var buf [3532]byte; use(buf[:]); C.callGoStackCheck() } +func stack3536() { var buf [3536]byte; use(buf[:]); C.callGoStackCheck() } +func stack3540() { var buf [3540]byte; use(buf[:]); C.callGoStackCheck() } +func stack3544() { var buf [3544]byte; use(buf[:]); C.callGoStackCheck() } +func stack3548() { var buf [3548]byte; use(buf[:]); C.callGoStackCheck() } +func stack3552() { var buf [3552]byte; use(buf[:]); C.callGoStackCheck() } +func stack3556() { var buf [3556]byte; use(buf[:]); C.callGoStackCheck() } +func stack3560() { var buf [3560]byte; use(buf[:]); C.callGoStackCheck() } +func stack3564() { var buf [3564]byte; use(buf[:]); C.callGoStackCheck() } +func stack3568() { var buf [3568]byte; use(buf[:]); C.callGoStackCheck() } +func stack3572() { var buf [3572]byte; use(buf[:]); C.callGoStackCheck() } +func stack3576() { var buf [3576]byte; use(buf[:]); C.callGoStackCheck() } +func stack3580() { var buf [3580]byte; use(buf[:]); C.callGoStackCheck() } +func stack3584() { var buf [3584]byte; use(buf[:]); C.callGoStackCheck() } +func stack3588() { var buf [3588]byte; use(buf[:]); C.callGoStackCheck() } +func stack3592() { var buf [3592]byte; use(buf[:]); C.callGoStackCheck() } +func stack3596() { var buf [3596]byte; use(buf[:]); C.callGoStackCheck() } +func stack3600() { var buf [3600]byte; use(buf[:]); C.callGoStackCheck() } +func stack3604() { var buf [3604]byte; use(buf[:]); C.callGoStackCheck() } +func stack3608() { var buf [3608]byte; use(buf[:]); C.callGoStackCheck() } +func stack3612() { var buf [3612]byte; use(buf[:]); C.callGoStackCheck() } +func stack3616() { var buf [3616]byte; use(buf[:]); C.callGoStackCheck() } +func stack3620() { var buf [3620]byte; use(buf[:]); C.callGoStackCheck() } +func stack3624() { var buf [3624]byte; use(buf[:]); C.callGoStackCheck() } +func stack3628() { var buf [3628]byte; use(buf[:]); C.callGoStackCheck() } +func stack3632() { var buf [3632]byte; use(buf[:]); C.callGoStackCheck() } +func stack3636() { var buf [3636]byte; use(buf[:]); C.callGoStackCheck() } +func stack3640() { var buf [3640]byte; use(buf[:]); C.callGoStackCheck() } +func stack3644() { var buf [3644]byte; use(buf[:]); C.callGoStackCheck() } +func stack3648() { var buf [3648]byte; use(buf[:]); C.callGoStackCheck() } +func stack3652() { var buf [3652]byte; use(buf[:]); C.callGoStackCheck() } +func stack3656() { var buf [3656]byte; use(buf[:]); C.callGoStackCheck() } +func stack3660() { var buf [3660]byte; use(buf[:]); C.callGoStackCheck() } +func stack3664() { var buf [3664]byte; use(buf[:]); C.callGoStackCheck() } +func stack3668() { var buf [3668]byte; use(buf[:]); C.callGoStackCheck() } +func stack3672() { var buf [3672]byte; use(buf[:]); C.callGoStackCheck() } +func stack3676() { var buf [3676]byte; use(buf[:]); C.callGoStackCheck() } +func stack3680() { var buf [3680]byte; use(buf[:]); C.callGoStackCheck() } +func stack3684() { var buf [3684]byte; use(buf[:]); C.callGoStackCheck() } +func stack3688() { var buf [3688]byte; use(buf[:]); C.callGoStackCheck() } +func stack3692() { var buf [3692]byte; use(buf[:]); C.callGoStackCheck() } +func stack3696() { var buf [3696]byte; use(buf[:]); C.callGoStackCheck() } +func stack3700() { var buf [3700]byte; use(buf[:]); C.callGoStackCheck() } +func stack3704() { var buf [3704]byte; use(buf[:]); C.callGoStackCheck() } +func stack3708() { var buf [3708]byte; use(buf[:]); C.callGoStackCheck() } +func stack3712() { var buf [3712]byte; use(buf[:]); C.callGoStackCheck() } +func stack3716() { var buf [3716]byte; use(buf[:]); C.callGoStackCheck() } +func stack3720() { var buf [3720]byte; use(buf[:]); C.callGoStackCheck() } +func stack3724() { var buf [3724]byte; use(buf[:]); C.callGoStackCheck() } +func stack3728() { var buf [3728]byte; use(buf[:]); C.callGoStackCheck() } +func stack3732() { var buf [3732]byte; use(buf[:]); C.callGoStackCheck() } +func stack3736() { var buf [3736]byte; use(buf[:]); C.callGoStackCheck() } +func stack3740() { var buf [3740]byte; use(buf[:]); C.callGoStackCheck() } +func stack3744() { var buf [3744]byte; use(buf[:]); C.callGoStackCheck() } +func stack3748() { var buf [3748]byte; use(buf[:]); C.callGoStackCheck() } +func stack3752() { var buf [3752]byte; use(buf[:]); C.callGoStackCheck() } +func stack3756() { var buf [3756]byte; use(buf[:]); C.callGoStackCheck() } +func stack3760() { var buf [3760]byte; use(buf[:]); C.callGoStackCheck() } +func stack3764() { var buf [3764]byte; use(buf[:]); C.callGoStackCheck() } +func stack3768() { var buf [3768]byte; use(buf[:]); C.callGoStackCheck() } +func stack3772() { var buf [3772]byte; use(buf[:]); C.callGoStackCheck() } +func stack3776() { var buf [3776]byte; use(buf[:]); C.callGoStackCheck() } +func stack3780() { var buf [3780]byte; use(buf[:]); C.callGoStackCheck() } +func stack3784() { var buf [3784]byte; use(buf[:]); C.callGoStackCheck() } +func stack3788() { var buf [3788]byte; use(buf[:]); C.callGoStackCheck() } +func stack3792() { var buf [3792]byte; use(buf[:]); C.callGoStackCheck() } +func stack3796() { var buf [3796]byte; use(buf[:]); C.callGoStackCheck() } +func stack3800() { var buf [3800]byte; use(buf[:]); C.callGoStackCheck() } +func stack3804() { var buf [3804]byte; use(buf[:]); C.callGoStackCheck() } +func stack3808() { var buf [3808]byte; use(buf[:]); C.callGoStackCheck() } +func stack3812() { var buf [3812]byte; use(buf[:]); C.callGoStackCheck() } +func stack3816() { var buf [3816]byte; use(buf[:]); C.callGoStackCheck() } +func stack3820() { var buf [3820]byte; use(buf[:]); C.callGoStackCheck() } +func stack3824() { var buf [3824]byte; use(buf[:]); C.callGoStackCheck() } +func stack3828() { var buf [3828]byte; use(buf[:]); C.callGoStackCheck() } +func stack3832() { var buf [3832]byte; use(buf[:]); C.callGoStackCheck() } +func stack3836() { var buf [3836]byte; use(buf[:]); C.callGoStackCheck() } +func stack3840() { var buf [3840]byte; use(buf[:]); C.callGoStackCheck() } +func stack3844() { var buf [3844]byte; use(buf[:]); C.callGoStackCheck() } +func stack3848() { var buf [3848]byte; use(buf[:]); C.callGoStackCheck() } +func stack3852() { var buf [3852]byte; use(buf[:]); C.callGoStackCheck() } +func stack3856() { var buf [3856]byte; use(buf[:]); C.callGoStackCheck() } +func stack3860() { var buf [3860]byte; use(buf[:]); C.callGoStackCheck() } +func stack3864() { var buf [3864]byte; use(buf[:]); C.callGoStackCheck() } +func stack3868() { var buf [3868]byte; use(buf[:]); C.callGoStackCheck() } +func stack3872() { var buf [3872]byte; use(buf[:]); C.callGoStackCheck() } +func stack3876() { var buf [3876]byte; use(buf[:]); C.callGoStackCheck() } +func stack3880() { var buf [3880]byte; use(buf[:]); C.callGoStackCheck() } +func stack3884() { var buf [3884]byte; use(buf[:]); C.callGoStackCheck() } +func stack3888() { var buf [3888]byte; use(buf[:]); C.callGoStackCheck() } +func stack3892() { var buf [3892]byte; use(buf[:]); C.callGoStackCheck() } +func stack3896() { var buf [3896]byte; use(buf[:]); C.callGoStackCheck() } +func stack3900() { var buf [3900]byte; use(buf[:]); C.callGoStackCheck() } +func stack3904() { var buf [3904]byte; use(buf[:]); C.callGoStackCheck() } +func stack3908() { var buf [3908]byte; use(buf[:]); C.callGoStackCheck() } +func stack3912() { var buf [3912]byte; use(buf[:]); C.callGoStackCheck() } +func stack3916() { var buf [3916]byte; use(buf[:]); C.callGoStackCheck() } +func stack3920() { var buf [3920]byte; use(buf[:]); C.callGoStackCheck() } +func stack3924() { var buf [3924]byte; use(buf[:]); C.callGoStackCheck() } +func stack3928() { var buf [3928]byte; use(buf[:]); C.callGoStackCheck() } +func stack3932() { var buf [3932]byte; use(buf[:]); C.callGoStackCheck() } +func stack3936() { var buf [3936]byte; use(buf[:]); C.callGoStackCheck() } +func stack3940() { var buf [3940]byte; use(buf[:]); C.callGoStackCheck() } +func stack3944() { var buf [3944]byte; use(buf[:]); C.callGoStackCheck() } +func stack3948() { var buf [3948]byte; use(buf[:]); C.callGoStackCheck() } +func stack3952() { var buf [3952]byte; use(buf[:]); C.callGoStackCheck() } +func stack3956() { var buf [3956]byte; use(buf[:]); C.callGoStackCheck() } +func stack3960() { var buf [3960]byte; use(buf[:]); C.callGoStackCheck() } +func stack3964() { var buf [3964]byte; use(buf[:]); C.callGoStackCheck() } +func stack3968() { var buf [3968]byte; use(buf[:]); C.callGoStackCheck() } +func stack3972() { var buf [3972]byte; use(buf[:]); C.callGoStackCheck() } +func stack3976() { var buf [3976]byte; use(buf[:]); C.callGoStackCheck() } +func stack3980() { var buf [3980]byte; use(buf[:]); C.callGoStackCheck() } +func stack3984() { var buf [3984]byte; use(buf[:]); C.callGoStackCheck() } +func stack3988() { var buf [3988]byte; use(buf[:]); C.callGoStackCheck() } +func stack3992() { var buf [3992]byte; use(buf[:]); C.callGoStackCheck() } +func stack3996() { var buf [3996]byte; use(buf[:]); C.callGoStackCheck() } +func stack4000() { var buf [4000]byte; use(buf[:]); C.callGoStackCheck() } +func stack4004() { var buf [4004]byte; use(buf[:]); C.callGoStackCheck() } +func stack4008() { var buf [4008]byte; use(buf[:]); C.callGoStackCheck() } +func stack4012() { var buf [4012]byte; use(buf[:]); C.callGoStackCheck() } +func stack4016() { var buf [4016]byte; use(buf[:]); C.callGoStackCheck() } +func stack4020() { var buf [4020]byte; use(buf[:]); C.callGoStackCheck() } +func stack4024() { var buf [4024]byte; use(buf[:]); C.callGoStackCheck() } +func stack4028() { var buf [4028]byte; use(buf[:]); C.callGoStackCheck() } +func stack4032() { var buf [4032]byte; use(buf[:]); C.callGoStackCheck() } +func stack4036() { var buf [4036]byte; use(buf[:]); C.callGoStackCheck() } +func stack4040() { var buf [4040]byte; use(buf[:]); C.callGoStackCheck() } +func stack4044() { var buf [4044]byte; use(buf[:]); C.callGoStackCheck() } +func stack4048() { var buf [4048]byte; use(buf[:]); C.callGoStackCheck() } +func stack4052() { var buf [4052]byte; use(buf[:]); C.callGoStackCheck() } +func stack4056() { var buf [4056]byte; use(buf[:]); C.callGoStackCheck() } +func stack4060() { var buf [4060]byte; use(buf[:]); C.callGoStackCheck() } +func stack4064() { var buf [4064]byte; use(buf[:]); C.callGoStackCheck() } +func stack4068() { var buf [4068]byte; use(buf[:]); C.callGoStackCheck() } +func stack4072() { var buf [4072]byte; use(buf[:]); C.callGoStackCheck() } +func stack4076() { var buf [4076]byte; use(buf[:]); C.callGoStackCheck() } +func stack4080() { var buf [4080]byte; use(buf[:]); C.callGoStackCheck() } +func stack4084() { var buf [4084]byte; use(buf[:]); C.callGoStackCheck() } +func stack4088() { var buf [4088]byte; use(buf[:]); C.callGoStackCheck() } +func stack4092() { var buf [4092]byte; use(buf[:]); C.callGoStackCheck() } +func stack4096() { var buf [4096]byte; use(buf[:]); C.callGoStackCheck() } +func stack4100() { var buf [4100]byte; use(buf[:]); C.callGoStackCheck() } +func stack4104() { var buf [4104]byte; use(buf[:]); C.callGoStackCheck() } +func stack4108() { var buf [4108]byte; use(buf[:]); C.callGoStackCheck() } +func stack4112() { var buf [4112]byte; use(buf[:]); C.callGoStackCheck() } +func stack4116() { var buf [4116]byte; use(buf[:]); C.callGoStackCheck() } +func stack4120() { var buf [4120]byte; use(buf[:]); C.callGoStackCheck() } +func stack4124() { var buf [4124]byte; use(buf[:]); C.callGoStackCheck() } +func stack4128() { var buf [4128]byte; use(buf[:]); C.callGoStackCheck() } +func stack4132() { var buf [4132]byte; use(buf[:]); C.callGoStackCheck() } +func stack4136() { var buf [4136]byte; use(buf[:]); C.callGoStackCheck() } +func stack4140() { var buf [4140]byte; use(buf[:]); C.callGoStackCheck() } +func stack4144() { var buf [4144]byte; use(buf[:]); C.callGoStackCheck() } +func stack4148() { var buf [4148]byte; use(buf[:]); C.callGoStackCheck() } +func stack4152() { var buf [4152]byte; use(buf[:]); C.callGoStackCheck() } +func stack4156() { var buf [4156]byte; use(buf[:]); C.callGoStackCheck() } +func stack4160() { var buf [4160]byte; use(buf[:]); C.callGoStackCheck() } +func stack4164() { var buf [4164]byte; use(buf[:]); C.callGoStackCheck() } +func stack4168() { var buf [4168]byte; use(buf[:]); C.callGoStackCheck() } +func stack4172() { var buf [4172]byte; use(buf[:]); C.callGoStackCheck() } +func stack4176() { var buf [4176]byte; use(buf[:]); C.callGoStackCheck() } +func stack4180() { var buf [4180]byte; use(buf[:]); C.callGoStackCheck() } +func stack4184() { var buf [4184]byte; use(buf[:]); C.callGoStackCheck() } +func stack4188() { var buf [4188]byte; use(buf[:]); C.callGoStackCheck() } +func stack4192() { var buf [4192]byte; use(buf[:]); C.callGoStackCheck() } +func stack4196() { var buf [4196]byte; use(buf[:]); C.callGoStackCheck() } +func stack4200() { var buf [4200]byte; use(buf[:]); C.callGoStackCheck() } +func stack4204() { var buf [4204]byte; use(buf[:]); C.callGoStackCheck() } +func stack4208() { var buf [4208]byte; use(buf[:]); C.callGoStackCheck() } +func stack4212() { var buf [4212]byte; use(buf[:]); C.callGoStackCheck() } +func stack4216() { var buf [4216]byte; use(buf[:]); C.callGoStackCheck() } +func stack4220() { var buf [4220]byte; use(buf[:]); C.callGoStackCheck() } +func stack4224() { var buf [4224]byte; use(buf[:]); C.callGoStackCheck() } +func stack4228() { var buf [4228]byte; use(buf[:]); C.callGoStackCheck() } +func stack4232() { var buf [4232]byte; use(buf[:]); C.callGoStackCheck() } +func stack4236() { var buf [4236]byte; use(buf[:]); C.callGoStackCheck() } +func stack4240() { var buf [4240]byte; use(buf[:]); C.callGoStackCheck() } +func stack4244() { var buf [4244]byte; use(buf[:]); C.callGoStackCheck() } +func stack4248() { var buf [4248]byte; use(buf[:]); C.callGoStackCheck() } +func stack4252() { var buf [4252]byte; use(buf[:]); C.callGoStackCheck() } +func stack4256() { var buf [4256]byte; use(buf[:]); C.callGoStackCheck() } +func stack4260() { var buf [4260]byte; use(buf[:]); C.callGoStackCheck() } +func stack4264() { var buf [4264]byte; use(buf[:]); C.callGoStackCheck() } +func stack4268() { var buf [4268]byte; use(buf[:]); C.callGoStackCheck() } +func stack4272() { var buf [4272]byte; use(buf[:]); C.callGoStackCheck() } +func stack4276() { var buf [4276]byte; use(buf[:]); C.callGoStackCheck() } +func stack4280() { var buf [4280]byte; use(buf[:]); C.callGoStackCheck() } +func stack4284() { var buf [4284]byte; use(buf[:]); C.callGoStackCheck() } +func stack4288() { var buf [4288]byte; use(buf[:]); C.callGoStackCheck() } +func stack4292() { var buf [4292]byte; use(buf[:]); C.callGoStackCheck() } +func stack4296() { var buf [4296]byte; use(buf[:]); C.callGoStackCheck() } +func stack4300() { var buf [4300]byte; use(buf[:]); C.callGoStackCheck() } +func stack4304() { var buf [4304]byte; use(buf[:]); C.callGoStackCheck() } +func stack4308() { var buf [4308]byte; use(buf[:]); C.callGoStackCheck() } +func stack4312() { var buf [4312]byte; use(buf[:]); C.callGoStackCheck() } +func stack4316() { var buf [4316]byte; use(buf[:]); C.callGoStackCheck() } +func stack4320() { var buf [4320]byte; use(buf[:]); C.callGoStackCheck() } +func stack4324() { var buf [4324]byte; use(buf[:]); C.callGoStackCheck() } +func stack4328() { var buf [4328]byte; use(buf[:]); C.callGoStackCheck() } +func stack4332() { var buf [4332]byte; use(buf[:]); C.callGoStackCheck() } +func stack4336() { var buf [4336]byte; use(buf[:]); C.callGoStackCheck() } +func stack4340() { var buf [4340]byte; use(buf[:]); C.callGoStackCheck() } +func stack4344() { var buf [4344]byte; use(buf[:]); C.callGoStackCheck() } +func stack4348() { var buf [4348]byte; use(buf[:]); C.callGoStackCheck() } +func stack4352() { var buf [4352]byte; use(buf[:]); C.callGoStackCheck() } +func stack4356() { var buf [4356]byte; use(buf[:]); C.callGoStackCheck() } +func stack4360() { var buf [4360]byte; use(buf[:]); C.callGoStackCheck() } +func stack4364() { var buf [4364]byte; use(buf[:]); C.callGoStackCheck() } +func stack4368() { var buf [4368]byte; use(buf[:]); C.callGoStackCheck() } +func stack4372() { var buf [4372]byte; use(buf[:]); C.callGoStackCheck() } +func stack4376() { var buf [4376]byte; use(buf[:]); C.callGoStackCheck() } +func stack4380() { var buf [4380]byte; use(buf[:]); C.callGoStackCheck() } +func stack4384() { var buf [4384]byte; use(buf[:]); C.callGoStackCheck() } +func stack4388() { var buf [4388]byte; use(buf[:]); C.callGoStackCheck() } +func stack4392() { var buf [4392]byte; use(buf[:]); C.callGoStackCheck() } +func stack4396() { var buf [4396]byte; use(buf[:]); C.callGoStackCheck() } +func stack4400() { var buf [4400]byte; use(buf[:]); C.callGoStackCheck() } +func stack4404() { var buf [4404]byte; use(buf[:]); C.callGoStackCheck() } +func stack4408() { var buf [4408]byte; use(buf[:]); C.callGoStackCheck() } +func stack4412() { var buf [4412]byte; use(buf[:]); C.callGoStackCheck() } +func stack4416() { var buf [4416]byte; use(buf[:]); C.callGoStackCheck() } +func stack4420() { var buf [4420]byte; use(buf[:]); C.callGoStackCheck() } +func stack4424() { var buf [4424]byte; use(buf[:]); C.callGoStackCheck() } +func stack4428() { var buf [4428]byte; use(buf[:]); C.callGoStackCheck() } +func stack4432() { var buf [4432]byte; use(buf[:]); C.callGoStackCheck() } +func stack4436() { var buf [4436]byte; use(buf[:]); C.callGoStackCheck() } +func stack4440() { var buf [4440]byte; use(buf[:]); C.callGoStackCheck() } +func stack4444() { var buf [4444]byte; use(buf[:]); C.callGoStackCheck() } +func stack4448() { var buf [4448]byte; use(buf[:]); C.callGoStackCheck() } +func stack4452() { var buf [4452]byte; use(buf[:]); C.callGoStackCheck() } +func stack4456() { var buf [4456]byte; use(buf[:]); C.callGoStackCheck() } +func stack4460() { var buf [4460]byte; use(buf[:]); C.callGoStackCheck() } +func stack4464() { var buf [4464]byte; use(buf[:]); C.callGoStackCheck() } +func stack4468() { var buf [4468]byte; use(buf[:]); C.callGoStackCheck() } +func stack4472() { var buf [4472]byte; use(buf[:]); C.callGoStackCheck() } +func stack4476() { var buf [4476]byte; use(buf[:]); C.callGoStackCheck() } +func stack4480() { var buf [4480]byte; use(buf[:]); C.callGoStackCheck() } +func stack4484() { var buf [4484]byte; use(buf[:]); C.callGoStackCheck() } +func stack4488() { var buf [4488]byte; use(buf[:]); C.callGoStackCheck() } +func stack4492() { var buf [4492]byte; use(buf[:]); C.callGoStackCheck() } +func stack4496() { var buf [4496]byte; use(buf[:]); C.callGoStackCheck() } +func stack4500() { var buf [4500]byte; use(buf[:]); C.callGoStackCheck() } +func stack4504() { var buf [4504]byte; use(buf[:]); C.callGoStackCheck() } +func stack4508() { var buf [4508]byte; use(buf[:]); C.callGoStackCheck() } +func stack4512() { var buf [4512]byte; use(buf[:]); C.callGoStackCheck() } +func stack4516() { var buf [4516]byte; use(buf[:]); C.callGoStackCheck() } +func stack4520() { var buf [4520]byte; use(buf[:]); C.callGoStackCheck() } +func stack4524() { var buf [4524]byte; use(buf[:]); C.callGoStackCheck() } +func stack4528() { var buf [4528]byte; use(buf[:]); C.callGoStackCheck() } +func stack4532() { var buf [4532]byte; use(buf[:]); C.callGoStackCheck() } +func stack4536() { var buf [4536]byte; use(buf[:]); C.callGoStackCheck() } +func stack4540() { var buf [4540]byte; use(buf[:]); C.callGoStackCheck() } +func stack4544() { var buf [4544]byte; use(buf[:]); C.callGoStackCheck() } +func stack4548() { var buf [4548]byte; use(buf[:]); C.callGoStackCheck() } +func stack4552() { var buf [4552]byte; use(buf[:]); C.callGoStackCheck() } +func stack4556() { var buf [4556]byte; use(buf[:]); C.callGoStackCheck() } +func stack4560() { var buf [4560]byte; use(buf[:]); C.callGoStackCheck() } +func stack4564() { var buf [4564]byte; use(buf[:]); C.callGoStackCheck() } +func stack4568() { var buf [4568]byte; use(buf[:]); C.callGoStackCheck() } +func stack4572() { var buf [4572]byte; use(buf[:]); C.callGoStackCheck() } +func stack4576() { var buf [4576]byte; use(buf[:]); C.callGoStackCheck() } +func stack4580() { var buf [4580]byte; use(buf[:]); C.callGoStackCheck() } +func stack4584() { var buf [4584]byte; use(buf[:]); C.callGoStackCheck() } +func stack4588() { var buf [4588]byte; use(buf[:]); C.callGoStackCheck() } +func stack4592() { var buf [4592]byte; use(buf[:]); C.callGoStackCheck() } +func stack4596() { var buf [4596]byte; use(buf[:]); C.callGoStackCheck() } +func stack4600() { var buf [4600]byte; use(buf[:]); C.callGoStackCheck() } +func stack4604() { var buf [4604]byte; use(buf[:]); C.callGoStackCheck() } +func stack4608() { var buf [4608]byte; use(buf[:]); C.callGoStackCheck() } +func stack4612() { var buf [4612]byte; use(buf[:]); C.callGoStackCheck() } +func stack4616() { var buf [4616]byte; use(buf[:]); C.callGoStackCheck() } +func stack4620() { var buf [4620]byte; use(buf[:]); C.callGoStackCheck() } +func stack4624() { var buf [4624]byte; use(buf[:]); C.callGoStackCheck() } +func stack4628() { var buf [4628]byte; use(buf[:]); C.callGoStackCheck() } +func stack4632() { var buf [4632]byte; use(buf[:]); C.callGoStackCheck() } +func stack4636() { var buf [4636]byte; use(buf[:]); C.callGoStackCheck() } +func stack4640() { var buf [4640]byte; use(buf[:]); C.callGoStackCheck() } +func stack4644() { var buf [4644]byte; use(buf[:]); C.callGoStackCheck() } +func stack4648() { var buf [4648]byte; use(buf[:]); C.callGoStackCheck() } +func stack4652() { var buf [4652]byte; use(buf[:]); C.callGoStackCheck() } +func stack4656() { var buf [4656]byte; use(buf[:]); C.callGoStackCheck() } +func stack4660() { var buf [4660]byte; use(buf[:]); C.callGoStackCheck() } +func stack4664() { var buf [4664]byte; use(buf[:]); C.callGoStackCheck() } +func stack4668() { var buf [4668]byte; use(buf[:]); C.callGoStackCheck() } +func stack4672() { var buf [4672]byte; use(buf[:]); C.callGoStackCheck() } +func stack4676() { var buf [4676]byte; use(buf[:]); C.callGoStackCheck() } +func stack4680() { var buf [4680]byte; use(buf[:]); C.callGoStackCheck() } +func stack4684() { var buf [4684]byte; use(buf[:]); C.callGoStackCheck() } +func stack4688() { var buf [4688]byte; use(buf[:]); C.callGoStackCheck() } +func stack4692() { var buf [4692]byte; use(buf[:]); C.callGoStackCheck() } +func stack4696() { var buf [4696]byte; use(buf[:]); C.callGoStackCheck() } +func stack4700() { var buf [4700]byte; use(buf[:]); C.callGoStackCheck() } +func stack4704() { var buf [4704]byte; use(buf[:]); C.callGoStackCheck() } +func stack4708() { var buf [4708]byte; use(buf[:]); C.callGoStackCheck() } +func stack4712() { var buf [4712]byte; use(buf[:]); C.callGoStackCheck() } +func stack4716() { var buf [4716]byte; use(buf[:]); C.callGoStackCheck() } +func stack4720() { var buf [4720]byte; use(buf[:]); C.callGoStackCheck() } +func stack4724() { var buf [4724]byte; use(buf[:]); C.callGoStackCheck() } +func stack4728() { var buf [4728]byte; use(buf[:]); C.callGoStackCheck() } +func stack4732() { var buf [4732]byte; use(buf[:]); C.callGoStackCheck() } +func stack4736() { var buf [4736]byte; use(buf[:]); C.callGoStackCheck() } +func stack4740() { var buf [4740]byte; use(buf[:]); C.callGoStackCheck() } +func stack4744() { var buf [4744]byte; use(buf[:]); C.callGoStackCheck() } +func stack4748() { var buf [4748]byte; use(buf[:]); C.callGoStackCheck() } +func stack4752() { var buf [4752]byte; use(buf[:]); C.callGoStackCheck() } +func stack4756() { var buf [4756]byte; use(buf[:]); C.callGoStackCheck() } +func stack4760() { var buf [4760]byte; use(buf[:]); C.callGoStackCheck() } +func stack4764() { var buf [4764]byte; use(buf[:]); C.callGoStackCheck() } +func stack4768() { var buf [4768]byte; use(buf[:]); C.callGoStackCheck() } +func stack4772() { var buf [4772]byte; use(buf[:]); C.callGoStackCheck() } +func stack4776() { var buf [4776]byte; use(buf[:]); C.callGoStackCheck() } +func stack4780() { var buf [4780]byte; use(buf[:]); C.callGoStackCheck() } +func stack4784() { var buf [4784]byte; use(buf[:]); C.callGoStackCheck() } +func stack4788() { var buf [4788]byte; use(buf[:]); C.callGoStackCheck() } +func stack4792() { var buf [4792]byte; use(buf[:]); C.callGoStackCheck() } +func stack4796() { var buf [4796]byte; use(buf[:]); C.callGoStackCheck() } +func stack4800() { var buf [4800]byte; use(buf[:]); C.callGoStackCheck() } +func stack4804() { var buf [4804]byte; use(buf[:]); C.callGoStackCheck() } +func stack4808() { var buf [4808]byte; use(buf[:]); C.callGoStackCheck() } +func stack4812() { var buf [4812]byte; use(buf[:]); C.callGoStackCheck() } +func stack4816() { var buf [4816]byte; use(buf[:]); C.callGoStackCheck() } +func stack4820() { var buf [4820]byte; use(buf[:]); C.callGoStackCheck() } +func stack4824() { var buf [4824]byte; use(buf[:]); C.callGoStackCheck() } +func stack4828() { var buf [4828]byte; use(buf[:]); C.callGoStackCheck() } +func stack4832() { var buf [4832]byte; use(buf[:]); C.callGoStackCheck() } +func stack4836() { var buf [4836]byte; use(buf[:]); C.callGoStackCheck() } +func stack4840() { var buf [4840]byte; use(buf[:]); C.callGoStackCheck() } +func stack4844() { var buf [4844]byte; use(buf[:]); C.callGoStackCheck() } +func stack4848() { var buf [4848]byte; use(buf[:]); C.callGoStackCheck() } +func stack4852() { var buf [4852]byte; use(buf[:]); C.callGoStackCheck() } +func stack4856() { var buf [4856]byte; use(buf[:]); C.callGoStackCheck() } +func stack4860() { var buf [4860]byte; use(buf[:]); C.callGoStackCheck() } +func stack4864() { var buf [4864]byte; use(buf[:]); C.callGoStackCheck() } +func stack4868() { var buf [4868]byte; use(buf[:]); C.callGoStackCheck() } +func stack4872() { var buf [4872]byte; use(buf[:]); C.callGoStackCheck() } +func stack4876() { var buf [4876]byte; use(buf[:]); C.callGoStackCheck() } +func stack4880() { var buf [4880]byte; use(buf[:]); C.callGoStackCheck() } +func stack4884() { var buf [4884]byte; use(buf[:]); C.callGoStackCheck() } +func stack4888() { var buf [4888]byte; use(buf[:]); C.callGoStackCheck() } +func stack4892() { var buf [4892]byte; use(buf[:]); C.callGoStackCheck() } +func stack4896() { var buf [4896]byte; use(buf[:]); C.callGoStackCheck() } +func stack4900() { var buf [4900]byte; use(buf[:]); C.callGoStackCheck() } +func stack4904() { var buf [4904]byte; use(buf[:]); C.callGoStackCheck() } +func stack4908() { var buf [4908]byte; use(buf[:]); C.callGoStackCheck() } +func stack4912() { var buf [4912]byte; use(buf[:]); C.callGoStackCheck() } +func stack4916() { var buf [4916]byte; use(buf[:]); C.callGoStackCheck() } +func stack4920() { var buf [4920]byte; use(buf[:]); C.callGoStackCheck() } +func stack4924() { var buf [4924]byte; use(buf[:]); C.callGoStackCheck() } +func stack4928() { var buf [4928]byte; use(buf[:]); C.callGoStackCheck() } +func stack4932() { var buf [4932]byte; use(buf[:]); C.callGoStackCheck() } +func stack4936() { var buf [4936]byte; use(buf[:]); C.callGoStackCheck() } +func stack4940() { var buf [4940]byte; use(buf[:]); C.callGoStackCheck() } +func stack4944() { var buf [4944]byte; use(buf[:]); C.callGoStackCheck() } +func stack4948() { var buf [4948]byte; use(buf[:]); C.callGoStackCheck() } +func stack4952() { var buf [4952]byte; use(buf[:]); C.callGoStackCheck() } +func stack4956() { var buf [4956]byte; use(buf[:]); C.callGoStackCheck() } +func stack4960() { var buf [4960]byte; use(buf[:]); C.callGoStackCheck() } +func stack4964() { var buf [4964]byte; use(buf[:]); C.callGoStackCheck() } +func stack4968() { var buf [4968]byte; use(buf[:]); C.callGoStackCheck() } +func stack4972() { var buf [4972]byte; use(buf[:]); C.callGoStackCheck() } +func stack4976() { var buf [4976]byte; use(buf[:]); C.callGoStackCheck() } +func stack4980() { var buf [4980]byte; use(buf[:]); C.callGoStackCheck() } +func stack4984() { var buf [4984]byte; use(buf[:]); C.callGoStackCheck() } +func stack4988() { var buf [4988]byte; use(buf[:]); C.callGoStackCheck() } +func stack4992() { var buf [4992]byte; use(buf[:]); C.callGoStackCheck() } +func stack4996() { var buf [4996]byte; use(buf[:]); C.callGoStackCheck() } +func stack5000() { var buf [5000]byte; use(buf[:]); C.callGoStackCheck() } diff --git a/misc/cgo/test/callback_c.c b/misc/cgo/test/callback_c.c new file mode 100644 index 0000000000000000000000000000000000000000..5bb642534019ad545a87ee6d97a96d0796085dcc --- /dev/null +++ b/misc/cgo/test/callback_c.c @@ -0,0 +1,82 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +#include +#include +#include "_cgo_export.h" + +void +callback(void *f) +{ + // use some stack space + volatile char data[64*1024]; + + data[0] = 0; + goCallback(f); + data[sizeof(data)-1] = 0; +} + +void +callGoFoo(void) +{ + extern void goFoo(void); + goFoo(); +} + +void +IntoC(void) +{ + BackIntoGo(); +} + +#ifdef WIN32 +#include +long long +mysleep(int seconds) { + long long st = GetTickCount(); + sleep(seconds); + return st; +} +#else +#include +long long +mysleep(int seconds) { + long long st; + struct timeval tv; + gettimeofday(&tv, NULL); + st = tv.tv_sec * 1000 + tv.tv_usec / 1000; + sleep(seconds); + return st; +} +#endif + +long long +twoSleep(int n) +{ + BackgroundSleep(n); + return mysleep(n); +} + +void +callGoStackCheck(void) +{ + extern void goStackCheck(void); + goStackCheck(); +} + +int +returnAfterGrow(void) +{ + extern int goReturnVal(void); + goReturnVal(); + return 123456; +} + +int +returnAfterGrowFromGo(void) +{ + extern int goReturnVal(void); + return goReturnVal(); +} + diff --git a/misc/cgo/test/callback_c_gc.c b/misc/cgo/test/callback_c_gc.c new file mode 100644 index 0000000000000000000000000000000000000000..c6ea3c58ba87f2c81e66037d5a44b556e90cc420 --- /dev/null +++ b/misc/cgo/test/callback_c_gc.c @@ -0,0 +1,25 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build gc + +#include "_cgo_export.h" +#include +#include +#include + +/* Test calling panic from C. This is what SWIG does. */ + +extern void crosscall2(void (*fn)(void *, int), void *, int); +extern void _cgo_panic(void *, int); +extern void _cgo_allocate(void *, int); + +void +callPanic(void) +{ + struct { const char *p; } a; + a.p = "panic from C"; + crosscall2(_cgo_panic, &a, sizeof a); + *(int*)1 = 1; +} diff --git a/misc/cgo/test/callback_c_gccgo.c b/misc/cgo/test/callback_c_gccgo.c new file mode 100644 index 0000000000000000000000000000000000000000..ff5dbbb2d9f0556e773814b6bebc675b31967721 --- /dev/null +++ b/misc/cgo/test/callback_c_gccgo.c @@ -0,0 +1,21 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build gccgo + +#include "_cgo_export.h" +#include +#include +#include + +/* Test calling panic from C. This is what SWIG does. */ + +extern void _cgo_panic(const char *); +extern void *_cgo_allocate(size_t); + +void +callPanic(void) +{ + _cgo_panic("panic from C"); +} diff --git a/misc/cgo/test/cflags.go b/misc/cgo/test/cflags.go new file mode 100644 index 0000000000000000000000000000000000000000..6571fe02dcefa2b615d0c8ca860bd3f786a3dbb7 --- /dev/null +++ b/misc/cgo/test/cflags.go @@ -0,0 +1,32 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Test that the #cgo CFLAGS directive works, +// with and without platform filters. +// See https://golang.org/issue/5224 for details. +package cgotest + +/* +#cgo CFLAGS: -DCOMMON_VALUE=123 +#cgo windows CFLAGS: -DIS_WINDOWS=1 +#cgo !windows CFLAGS: -DIS_WINDOWS=0 +int common = COMMON_VALUE; +int is_windows = IS_WINDOWS; +*/ +import "C" + +import ( + "runtime" + "testing" +) + +func testCflags(t *testing.T) { + is_windows := C.is_windows == 1 + if is_windows != (runtime.GOOS == "windows") { + t.Errorf("is_windows: %v, runtime.GOOS: %s", is_windows, runtime.GOOS) + } + if C.common != 123 { + t.Errorf("common: %v (expected 123)", C.common) + } +} diff --git a/misc/cgo/test/cgo_linux_test.go b/misc/cgo/test/cgo_linux_test.go new file mode 100644 index 0000000000000000000000000000000000000000..3cc2af5919c21ac31d55376afbaccee41c87926b --- /dev/null +++ b/misc/cgo/test/cgo_linux_test.go @@ -0,0 +1,13 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package cgotest + +import "testing" + +func TestSetgid(t *testing.T) { testSetgid(t) } +func Test6997(t *testing.T) { test6997(t) } +func TestBuildID(t *testing.T) { testBuildID(t) } +func Test9400(t *testing.T) { test9400(t) } +func TestSigProcMask(t *testing.T) { testSigProcMask(t) } diff --git a/misc/cgo/test/cgo_test.go b/misc/cgo/test/cgo_test.go new file mode 100644 index 0000000000000000000000000000000000000000..9af31e8a20407f3cad2b01c68a2843ad70f37aa4 --- /dev/null +++ b/misc/cgo/test/cgo_test.go @@ -0,0 +1,69 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package cgotest + +import "testing" + +// The actual test functions are in non-_test.go files +// so that they can use cgo (import "C"). +// These wrappers are here for gotest to find. + +func TestAlign(t *testing.T) { testAlign(t) } +func TestConst(t *testing.T) { testConst(t) } +func TestEnum(t *testing.T) { testEnum(t) } +func TestAtol(t *testing.T) { testAtol(t) } +func TestErrno(t *testing.T) { testErrno(t) } +func TestMultipleAssign(t *testing.T) { testMultipleAssign(t) } +func TestUnsignedInt(t *testing.T) { testUnsignedInt(t) } +func TestCallback(t *testing.T) { testCallback(t) } +func TestCallbackGC(t *testing.T) { testCallbackGC(t) } +func TestCallbackPanic(t *testing.T) { testCallbackPanic(t) } +func TestCallbackPanicLoop(t *testing.T) { testCallbackPanicLoop(t) } +func TestCallbackPanicLocked(t *testing.T) { testCallbackPanicLocked(t) } +func TestPanicFromC(t *testing.T) { testPanicFromC(t) } +func TestZeroArgCallback(t *testing.T) { testZeroArgCallback(t) } +func TestBlocking(t *testing.T) { testBlocking(t) } +func Test1328(t *testing.T) { test1328(t) } +func TestParallelSleep(t *testing.T) { testParallelSleep(t) } +func TestSetEnv(t *testing.T) { testSetEnv(t) } +func TestHelpers(t *testing.T) { testHelpers(t) } +func TestLibgcc(t *testing.T) { testLibgcc(t) } +func Test1635(t *testing.T) { test1635(t) } +func TestPrintf(t *testing.T) { testPrintf(t) } +func Test4029(t *testing.T) { test4029(t) } +func TestBoolAlign(t *testing.T) { testBoolAlign(t) } +func Test3729(t *testing.T) { test3729(t) } +func Test3775(t *testing.T) { test3775(t) } +func TestCthread(t *testing.T) { testCthread(t) } +func TestCallbackCallers(t *testing.T) { testCallbackCallers(t) } +func Test5227(t *testing.T) { test5227(t) } +func TestCflags(t *testing.T) { testCflags(t) } +func Test5337(t *testing.T) { test5337(t) } +func Test5548(t *testing.T) { test5548(t) } +func Test5603(t *testing.T) { test5603(t) } +func Test6833(t *testing.T) { test6833(t) } +func Test3250(t *testing.T) { test3250(t) } +func TestCallbackStack(t *testing.T) { testCallbackStack(t) } +func TestFpVar(t *testing.T) { testFpVar(t) } +func Test4339(t *testing.T) { test4339(t) } +func Test6390(t *testing.T) { test6390(t) } +func Test5986(t *testing.T) { test5986(t) } +func Test7665(t *testing.T) { test7665(t) } +func TestNaming(t *testing.T) { testNaming(t) } +func Test7560(t *testing.T) { test7560(t) } +func Test5242(t *testing.T) { test5242(t) } +func Test8092(t *testing.T) { test8092(t) } +func Test7978(t *testing.T) { test7978(t) } +func Test8694(t *testing.T) { test8694(t) } +func Test8517(t *testing.T) { test8517(t) } +func Test8811(t *testing.T) { test8811(t) } +func TestReturnAfterGrow(t *testing.T) { testReturnAfterGrow(t) } +func TestReturnAfterGrowFromGo(t *testing.T) { testReturnAfterGrowFromGo(t) } +func Test9026(t *testing.T) { test9026(t) } +func Test9557(t *testing.T) { test9557(t) } +func Test10303(t *testing.T) { test10303(t, 10) } +func Test11925(t *testing.T) { test11925(t) } + +func BenchmarkCgoCall(b *testing.B) { benchCgoCall(b) } diff --git a/misc/cgo/test/cthread.go b/misc/cgo/test/cthread.go new file mode 100644 index 0000000000000000000000000000000000000000..68d4a03eacfee187755c9f31250f4415c81dcf10 --- /dev/null +++ b/misc/cgo/test/cthread.go @@ -0,0 +1,40 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package cgotest + +// extern void doAdd(int, int); +import "C" + +import ( + "sync" + "testing" +) + +var sum struct { + sync.Mutex + i int +} + +//export Add +func Add(x int) { + defer func() { + recover() + }() + sum.Lock() + sum.i += x + sum.Unlock() + var p *int + *p = 2 +} + +func testCthread(t *testing.T) { + sum.i = 0 + C.doAdd(10, 6) + + want := 10 * (10 - 1) / 2 * 6 + if sum.i != want { + t.Fatalf("sum=%d, want %d", sum.i, want) + } +} diff --git a/misc/cgo/test/cthread_unix.c b/misc/cgo/test/cthread_unix.c new file mode 100644 index 0000000000000000000000000000000000000000..d29f2fc5f22c1b5daa00898a9b3bcc9e3b27aadb --- /dev/null +++ b/misc/cgo/test/cthread_unix.c @@ -0,0 +1,34 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build darwin dragonfly freebsd linux netbsd openbsd solaris + +#include +#include "_cgo_export.h" + +static void* +addThread(void *p) +{ + int i, max; + + max = *(int*)p; + for(i=0; i MaxThread) + nthread = MaxThread; + for(i=0; i +#include +#include "_cgo_export.h" + +__stdcall +static unsigned int +addThread(void *p) +{ + int i, max; + + max = *(int*)p; + for(i=0; i MaxThread) + nthread = MaxThread; + for(i=0; i +*/ +import "C" +import ( + "os" + "runtime" + "testing" + "unsafe" +) + +// This is really an os package test but here for convenience. +func testSetEnv(t *testing.T) { + if runtime.GOOS == "windows" { + // Go uses SetEnvironmentVariable on windows. Howerver, + // C runtime takes a *copy* at process startup of thei + // OS environment, and stores it in environ/envp. + // It is this copy that getenv/putenv manipulate. + t.Logf("skipping test") + return + } + const key = "CGO_OS_TEST_KEY" + const val = "CGO_OS_TEST_VALUE" + os.Setenv(key, val) + keyc := C.CString(key) + defer C.free(unsafe.Pointer(keyc)) + v := C.getenv(keyc) + if v == (*C.char)(unsafe.Pointer(uintptr(0))) { + t.Fatal("getenv returned NULL") + } + vs := C.GoString(v) + if vs != val { + t.Fatalf("getenv() = %q; want %q", vs, val) + } +} diff --git a/misc/cgo/test/exports.go b/misc/cgo/test/exports.go new file mode 100644 index 0000000000000000000000000000000000000000..4fe1703a60db6058150cd375312e40a5c73bf750 --- /dev/null +++ b/misc/cgo/test/exports.go @@ -0,0 +1,18 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package cgotest + +import "C" +import "runtime" + +//export ReturnIntLong +func ReturnIntLong() (int, C.long) { + return 1, 2 +} + +//export gc +func gc() { + runtime.GC() +} diff --git a/misc/cgo/test/fpvar.go b/misc/cgo/test/fpvar.go new file mode 100644 index 0000000000000000000000000000000000000000..c0ec6f68d710c01ca4e5ebcbbfb47394a07f868f --- /dev/null +++ b/misc/cgo/test/fpvar.go @@ -0,0 +1,50 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// This file contains test cases for cgo with function pointer variables. + +package cgotest + +/* +typedef int (*intFunc) (); + +int +bridge_int_func(intFunc f) +{ + return f(); +} + +int fortytwo() +{ + return 42; +} + +*/ +import "C" +import "testing" + +func callBridge(f C.intFunc) int { + return int(C.bridge_int_func(f)) +} + +func callCBridge(f C.intFunc) C.int { + return C.bridge_int_func(f) +} + +func testFpVar(t *testing.T) { + const expected = 42 + f := C.intFunc(C.fortytwo) + res1 := C.bridge_int_func(f) + if r1 := int(res1); r1 != expected { + t.Errorf("got %d, want %d", r1, expected) + } + res2 := callCBridge(f) + if r2 := int(res2); r2 != expected { + t.Errorf("got %d, want %d", r2, expected) + } + r3 := callBridge(f) + if r3 != expected { + t.Errorf("got %d, want %d", r3, expected) + } +} diff --git a/misc/cgo/test/helpers.go b/misc/cgo/test/helpers.go new file mode 100644 index 0000000000000000000000000000000000000000..890dcbdf1d8486d59c309e875eef11bf75b7ea6b --- /dev/null +++ b/misc/cgo/test/helpers.go @@ -0,0 +1,35 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package cgotest + +// const char *greeting = "hello, world"; +import "C" + +import ( + "reflect" + "testing" + "unsafe" +) + +const greeting = "hello, world" + +type testPair struct { + Name string + Got, Want interface{} +} + +var testPairs = []testPair{ + {"GoString", C.GoString(C.greeting), greeting}, + {"GoStringN", C.GoStringN(C.greeting, 5), greeting[:5]}, + {"GoBytes", C.GoBytes(unsafe.Pointer(C.greeting), 5), []byte(greeting[:5])}, +} + +func testHelpers(t *testing.T) { + for _, pair := range testPairs { + if !reflect.DeepEqual(pair.Got, pair.Want) { + t.Errorf("%s: got %#v, want %#v", pair.Name, pair.Got, pair.Want) + } + } +} diff --git a/misc/cgo/test/issue10303.go b/misc/cgo/test/issue10303.go new file mode 100644 index 0000000000000000000000000000000000000000..ea623d7379fdac932225fcd15ce688e126535f5f --- /dev/null +++ b/misc/cgo/test/issue10303.go @@ -0,0 +1,70 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Issue 10303. Pointers passed to C were not marked as escaping (bug in cgo). + +package cgotest + +/* +typedef int *intptr; + +void setintstar(int *x) { + *x = 1; +} + +void setintptr(intptr x) { + *x = 1; +} + +void setvoidptr(void *x) { + *(int*)x = 1; +} + +typedef struct Struct Struct; +struct Struct { + int *P; +}; + +void setstruct(Struct s) { + *s.P = 1; +} + +*/ +import "C" + +import ( + "testing" + "unsafe" +) + +func test10303(t *testing.T, n int) { + // Run at a few different stack depths just to avoid an unlucky pass + // due to variables ending up on different pages. + if n > 0 { + test10303(t, n-1) + } + if t.Failed() { + return + } + var x, y, z, v, si C.int + var s C.Struct + C.setintstar(&x) + C.setintptr(&y) + C.setvoidptr(unsafe.Pointer(&v)) + s.P = &si + C.setstruct(s) + + if uintptr(unsafe.Pointer(&x))&^0xfff == uintptr(unsafe.Pointer(&z))&^0xfff { + t.Error("C int* argument on stack") + } + if uintptr(unsafe.Pointer(&y))&^0xfff == uintptr(unsafe.Pointer(&z))&^0xfff { + t.Error("C intptr argument on stack") + } + if uintptr(unsafe.Pointer(&v))&^0xfff == uintptr(unsafe.Pointer(&z))&^0xfff { + t.Error("C void* argument on stack") + } + if uintptr(unsafe.Pointer(&si))&^0xfff == uintptr(unsafe.Pointer(&z))&^0xfff { + t.Error("C struct field pointer on stack") + } +} diff --git a/misc/cgo/test/issue11925.go b/misc/cgo/test/issue11925.go new file mode 100644 index 0000000000000000000000000000000000000000..9e50fb7027cb99db06d15c70e9c7dbcc73a1884a --- /dev/null +++ b/misc/cgo/test/issue11925.go @@ -0,0 +1,37 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Issue 11925. Structs with zero-length trailing fields are now +// padded by the Go compiler. + +package cgotest + +/* +struct a11925 { + int i; + char a[0]; + char b[0]; +}; + +struct b11925 { + int i; + char a[0]; + char b[]; +}; +*/ +import "C" + +import ( + "testing" + "unsafe" +) + +func test11925(t *testing.T) { + if C.sizeof_struct_a11925 != unsafe.Sizeof(C.struct_a11925{}) { + t.Errorf("size of a changed: C %d, Go %d", C.sizeof_struct_a11925, unsafe.Sizeof(C.struct_a11925{})) + } + if C.sizeof_struct_b11925 != unsafe.Sizeof(C.struct_b11925{}) { + t.Errorf("size of b changed: C %d, Go %d", C.sizeof_struct_b11925, unsafe.Sizeof(C.struct_b11925{})) + } +} diff --git a/misc/cgo/test/issue1222.go b/misc/cgo/test/issue1222.go new file mode 100644 index 0000000000000000000000000000000000000000..c396a0c4182b41853c57e1c75dfdb4ad366e77a1 --- /dev/null +++ b/misc/cgo/test/issue1222.go @@ -0,0 +1,29 @@ +// Copyright 2010 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// This file contains test cases for cgo. + +package cgotest + +/* +// issue 1222 +typedef union { + long align; +} xxpthread_mutex_t; + +struct ibv_async_event { + union { + int x; + } element; +}; + +struct ibv_context { + xxpthread_mutex_t mutex; +}; +*/ +import "C" + +type AsyncEvent struct { + event C.struct_ibv_async_event +} diff --git a/misc/cgo/test/issue1328.go b/misc/cgo/test/issue1328.go new file mode 100644 index 0000000000000000000000000000000000000000..e1796d6f723751ef3b3c7d71ebff69ae0755102f --- /dev/null +++ b/misc/cgo/test/issue1328.go @@ -0,0 +1,30 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package cgotest + +import "testing" + +// extern void BackIntoGo(void); +// void IntoC(void); +import "C" + +//export BackIntoGo +func BackIntoGo() { + x := 1 + + for i := 0; i < 10000; i++ { + xvariadic(x) + if x != 1 { + panic("x is not 1?") + } + } +} + +func xvariadic(x ...interface{}) { +} + +func test1328(t *testing.T) { + C.IntoC() +} diff --git a/misc/cgo/test/issue1560.go b/misc/cgo/test/issue1560.go new file mode 100644 index 0000000000000000000000000000000000000000..c46954b0747e0ebd2ef44ad2687fe3d9de4210cc --- /dev/null +++ b/misc/cgo/test/issue1560.go @@ -0,0 +1,50 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package cgotest + +/* +// mysleep returns the absolute start time in ms. +long long mysleep(int seconds); + +// twoSleep returns the absolute start time of the first sleep +// in ms. +long long twoSleep(int); +*/ +import "C" + +import ( + "testing" + "time" +) + +var sleepDone = make(chan int64) + +// parallelSleep returns the absolute difference between the start time +// of the two sleeps. +func parallelSleep(n int) int64 { + t := int64(C.twoSleep(C.int(n))) - <-sleepDone + if t < 0 { + return -t + } + return t +} + +//export BackgroundSleep +func BackgroundSleep(n int32) { + go func() { + sleepDone <- int64(C.mysleep(C.int(n))) + }() +} + +func testParallelSleep(t *testing.T) { + sleepSec := 1 + dt := time.Duration(parallelSleep(sleepSec)) * time.Millisecond + t.Logf("difference in start time for two sleep(%d) is %v", sleepSec, dt) + // bug used to run sleeps in serial, producing a 2*sleepSec-second delay. + // we detect if the start times of those sleeps are > 0.5*sleepSec-second. + if dt >= time.Duration(sleepSec)*time.Second/2 { + t.Fatalf("parallel %d-second sleeps slept for %f seconds", sleepSec, dt.Seconds()) + } +} diff --git a/misc/cgo/test/issue1635.go b/misc/cgo/test/issue1635.go new file mode 100644 index 0000000000000000000000000000000000000000..6bfe110fdf40bb0001a045c8f8c1f76a33472135 --- /dev/null +++ b/misc/cgo/test/issue1635.go @@ -0,0 +1,33 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package cgotest + +/* +// Mac OS X's gcc will generate scattered relocation 2/1 for +// this function on Darwin/386, and 8l couldn't handle it. +// this example is in issue 1635 +#include +void scatter() { + void *p = scatter; + printf("scatter = %p\n", p); +} + +// this example is in issue 3253 +int hola = 0; +int testHola() { return hola; } +*/ +import "C" + +import "testing" + +func test1635(t *testing.T) { + C.scatter() + if v := C.hola; v != 0 { + t.Fatalf("C.hola is %d, should be 0", v) + } + if v := C.testHola(); v != 0 { + t.Fatalf("C.testHola() is %d, should be 0", v) + } +} diff --git a/misc/cgo/test/issue2462.go b/misc/cgo/test/issue2462.go new file mode 100644 index 0000000000000000000000000000000000000000..12cd91d0563e0719e043cbb01e392f7d93cc5f48 --- /dev/null +++ b/misc/cgo/test/issue2462.go @@ -0,0 +1,102 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package cgotest + +import "C" + +//export exportbyte +func exportbyte() byte { + return 0 +} + +//export exportbool +func exportbool() bool { + return false +} + +//export exportrune +func exportrune() rune { + return 0 +} + +//export exporterror +func exporterror() error { + return nil +} + +//export exportint +func exportint() int { + return 0 +} + +//export exportuint +func exportuint() uint { + return 0 +} + +//export exportuintptr +func exportuintptr() uintptr { + return (uintptr)(0) +} + +//export exportint8 +func exportint8() int8 { + return 0 +} + +//export exportuint8 +func exportuint8() uint8 { + return 0 +} + +//export exportint16 +func exportint16() int16 { + return 0 +} + +//export exportuint16 +func exportuint16() uint16 { + return 0 +} + +//export exportint32 +func exportint32() int32 { + return 0 +} + +//export exportuint32 +func exportuint32() uint32 { + return 0 +} + +//export exportint64 +func exportint64() int64 { + return 0 +} + +//export exportuint64 +func exportuint64() uint64 { + return 0 +} + +//export exportfloat32 +func exportfloat32() float32 { + return 0 +} + +//export exportfloat64 +func exportfloat64() float64 { + return 0 +} + +//export exportcomplex64 +func exportcomplex64() complex64 { + return 0 +} + +//export exportcomplex128 +func exportcomplex128() complex128 { + return 0 +} diff --git a/misc/cgo/test/issue3250.go b/misc/cgo/test/issue3250.go new file mode 100644 index 0000000000000000000000000000000000000000..b1ff03941d70f85fa2902e7b2d725c611bc7d511 --- /dev/null +++ b/misc/cgo/test/issue3250.go @@ -0,0 +1,95 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build !windows + +package cgotest + +/* +#include +#include +#include +#include + +static void *thread(void *p) { + (void)p; + const int M = 100; + int i; + for (i = 0; i < M; i++) { + pthread_kill(pthread_self(), SIGCHLD); + usleep(rand() % 20 + 5); + } + return NULL; +} +void testSendSIG() { + const int N = 20; + int i; + pthread_t tid[N]; + for (i = 0; i < N; i++) { + usleep(rand() % 200 + 100); + pthread_create(&tid[i], 0, thread, NULL); + } + for (i = 0; i < N; i++) + pthread_join(tid[i], 0); +} +*/ +import "C" + +import ( + "os" + "os/signal" + "syscall" + "testing" + "time" +) + +func test3250(t *testing.T) { + t.Skip("skipped, see golang.org/issue/5885") + const ( + thres = 1 + sig = syscall.SIGCHLD + ) + type result struct { + n int + sig os.Signal + } + var ( + sigCh = make(chan os.Signal, 10) + waitStart = make(chan struct{}) + waitDone = make(chan result) + ) + + signal.Notify(sigCh, sig) + + go func() { + n := 0 + alarm := time.After(time.Second * 3) + for { + select { + case <-waitStart: + waitStart = nil + case v := <-sigCh: + n++ + if v != sig || n > thres { + waitDone <- result{n, v} + return + } + case <-alarm: + waitDone <- result{n, sig} + return + } + } + }() + + waitStart <- struct{}{} + C.testSendSIG() + r := <-waitDone + if r.sig != sig { + t.Fatalf("received signal %v, but want %v", r.sig, sig) + } + t.Logf("got %d signals\n", r.n) + if r.n <= thres { + t.Fatalf("expected more than %d", thres) + } +} diff --git a/misc/cgo/test/issue3250w.go b/misc/cgo/test/issue3250w.go new file mode 100644 index 0000000000000000000000000000000000000000..e3cb161db076448a1a9071e2a4697d5ff97fa690 --- /dev/null +++ b/misc/cgo/test/issue3250w.go @@ -0,0 +1,11 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build windows + +package cgotest + +import "testing" + +func test3250(t *testing.T) {} diff --git a/misc/cgo/test/issue3261.go b/misc/cgo/test/issue3261.go new file mode 100644 index 0000000000000000000000000000000000000000..32cb06b8c7acdcfbe5e1596add3bc0c72af71e95 --- /dev/null +++ b/misc/cgo/test/issue3261.go @@ -0,0 +1,49 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package cgotest + +/* +// libgcc on ARM might be compiled as thumb code, but our 5l +// can't handle that, so we have to disable this test on arm. +#ifdef __ARMEL__ +#include +int vabs(int x) { + puts("testLibgcc is disabled on ARM because 5l cannot handle thumb library."); + return (x < 0) ? -x : x; +} +#elif defined(__arm64__) && defined(__clang__) +#include +int vabs(int x) { + puts("testLibgcc is disabled on ARM64 with clang due to lack of libgcc."); + return (x < 0) ? -x : x; +} +#else +int __absvsi2(int); // dummy prototype for libgcc function +// we shouldn't name the function abs, as gcc might use +// the builtin one. +int vabs(int x) { return __absvsi2(x); } +#endif +*/ +import "C" + +import "testing" + +func testLibgcc(t *testing.T) { + var table = []struct { + in, out C.int + }{ + {0, 0}, + {1, 1}, + {-42, 42}, + {1000300, 1000300}, + {1 - 1<<31, 1<<31 - 1}, + } + for _, v := range table { + if o := C.vabs(v.in); o != v.out { + t.Fatalf("abs(%d) got %d, should be %d", v.in, o, v.out) + return + } + } +} diff --git a/misc/cgo/test/issue3729.go b/misc/cgo/test/issue3729.go new file mode 100644 index 0000000000000000000000000000000000000000..1bea38b6e8a61fc254a6f8830a250c80867875c6 --- /dev/null +++ b/misc/cgo/test/issue3729.go @@ -0,0 +1,47 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Issue 3729: cmd/cgo: access errno from void C function +// void f(void) returns [0]byte, error in Go world. + +// +build !windows + +package cgotest + +/* +#include + +void g(void) { + errno = E2BIG; +} + +// try to pass some non-trivial arguments to function g2 +const char _expA = 0x42; +const float _expB = 3.14159; +const short _expC = 0x55aa; +const int _expD = 0xdeadbeef; +void g2(int x, char a, float b, short c, int d) { + if (a == _expA && b == _expB && c == _expC && d == _expD) + errno = x; + else + errno = -1; +} +*/ +import "C" + +import ( + "syscall" + "testing" +) + +func test3729(t *testing.T) { + _, e := C.g() + if e != syscall.E2BIG { + t.Errorf("got %q, expect %q", e, syscall.E2BIG) + } + _, e = C.g2(C.EINVAL, C._expA, C._expB, C._expC, C._expD) + if e != syscall.EINVAL { + t.Errorf("got %q, expect %q", e, syscall.EINVAL) + } +} diff --git a/misc/cgo/test/issue3729w.go b/misc/cgo/test/issue3729w.go new file mode 100644 index 0000000000000000000000000000000000000000..702115b811d50b520a84e25650e78d1365732dd8 --- /dev/null +++ b/misc/cgo/test/issue3729w.go @@ -0,0 +1,16 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Issue 3729: cmd/cgo: access errno from void C function +// void f(void) returns [0]byte, error in Go world. + +// +build windows + +package cgotest + +import "testing" + +func test3729(t *testing.T) { + t.Log("skip errno test on Windows") +} diff --git a/misc/cgo/test/issue3741.go b/misc/cgo/test/issue3741.go new file mode 100644 index 0000000000000000000000000000000000000000..3d3bbf951e6566049688a259a3f271ef8a51d47e --- /dev/null +++ b/misc/cgo/test/issue3741.go @@ -0,0 +1,22 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package cgotest + +import "C" + +//export exportSliceIn +func exportSliceIn(s []byte) bool { + return len(s) == cap(s) +} + +//export exportSliceOut +func exportSliceOut() []byte { + return []byte{1} +} + +//export exportSliceInOut +func exportSliceInOut(s []byte) []byte { + return s +} diff --git a/misc/cgo/test/issue3775.go b/misc/cgo/test/issue3775.go new file mode 100644 index 0000000000000000000000000000000000000000..8f8185419532005249a17b678e0f5b56a6d3decf --- /dev/null +++ b/misc/cgo/test/issue3775.go @@ -0,0 +1,37 @@ +package cgotest + +/* +void lockOSThreadCallback(void); +inline static void lockOSThreadC(void) +{ + lockOSThreadCallback(); +} +int usleep(unsigned usec); +*/ +import "C" + +import ( + "runtime" + "testing" +) + +func init() { + // Same as test3775 but run during init so that + // there are two levels of internal runtime lock + // (1 for init, 1 for cgo). + // This would have been broken by CL 11663043. + C.lockOSThreadC() +} + +func test3775(t *testing.T) { + // Used to panic because of the UnlockOSThread below. + C.lockOSThreadC() +} + +//export lockOSThreadCallback +func lockOSThreadCallback() { + runtime.LockOSThread() + runtime.UnlockOSThread() + go C.usleep(10000) + runtime.Gosched() +} diff --git a/misc/cgo/test/issue3945.go b/misc/cgo/test/issue3945.go new file mode 100644 index 0000000000000000000000000000000000000000..7e6863f7b6b1a7af9c66245dd689ab0f59193a74 --- /dev/null +++ b/misc/cgo/test/issue3945.go @@ -0,0 +1,22 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package cgotest + +// Test that cgo reserves enough stack space during cgo call. +// See https://golang.org/issue/3945 for details. + +// #include +// +// void say() { +// printf("%s from C\n", "hello"); +// } +// +import "C" + +import "testing" + +func testPrintf(t *testing.T) { + C.say() +} diff --git a/misc/cgo/test/issue4029.go b/misc/cgo/test/issue4029.go new file mode 100644 index 0000000000000000000000000000000000000000..b0385eb8574f40c1a8bea295c0b3713ca7aab615 --- /dev/null +++ b/misc/cgo/test/issue4029.go @@ -0,0 +1,61 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build !windows + +package cgotest + +/* +#include +#cgo linux LDFLAGS: -ldl +*/ +import "C" + +import ( + "fmt" + "testing" +) + +//export IMPIsOpaque +func IMPIsOpaque() { + fmt.Println("isOpaque") +} + +//export IMPInitWithFrame +func IMPInitWithFrame() { + fmt.Println("IInitWithFrame") +} + +//export IMPDrawRect +func IMPDrawRect() { + fmt.Println("drawRect:") +} + +//export IMPWindowResize +func IMPWindowResize() { + fmt.Println("windowDidResize:") +} + +func test4029(t *testing.T) { + loadThySelf(t, "IMPWindowResize") + loadThySelf(t, "IMPDrawRect") + loadThySelf(t, "IMPInitWithFrame") + loadThySelf(t, "IMPIsOpaque") +} + +func loadThySelf(t *testing.T, symbol string) { + this_process := C.dlopen(nil, C.RTLD_NOW) + if this_process == nil { + t.Error("dlopen:", C.GoString(C.dlerror())) + return + } + defer C.dlclose(this_process) + + symbol_address := C.dlsym(this_process, C.CString(symbol)) + if symbol_address == nil { + t.Error("dlsym:", C.GoString(C.dlerror())) + return + } + t.Log(symbol, symbol_address) +} diff --git a/misc/cgo/test/issue4029w.go b/misc/cgo/test/issue4029w.go new file mode 100644 index 0000000000000000000000000000000000000000..1cf43df37b601cc04530ebd1d792242e041d5df3 --- /dev/null +++ b/misc/cgo/test/issue4029w.go @@ -0,0 +1,12 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build windows + +package cgotest + +import "testing" + +func test4029(t *testing.T) { +} diff --git a/misc/cgo/test/issue4054a.go b/misc/cgo/test/issue4054a.go new file mode 100644 index 0000000000000000000000000000000000000000..2abdac590471479d48efd1474c01666e68d71f36 --- /dev/null +++ b/misc/cgo/test/issue4054a.go @@ -0,0 +1,23 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package cgotest + +/* +typedef enum { + A = 0, + B, + C, + D, + E, + F, + G, + H, + I, + J, +} issue4054a; +*/ +import "C" + +var issue4054a = []int{C.A, C.B, C.C, C.D, C.E, C.F, C.G, C.H, C.I, C.J} diff --git a/misc/cgo/test/issue4054b.go b/misc/cgo/test/issue4054b.go new file mode 100644 index 0000000000000000000000000000000000000000..048964c89372ee37593c24ba6473dbd90e019dff --- /dev/null +++ b/misc/cgo/test/issue4054b.go @@ -0,0 +1,23 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package cgotest + +/* +typedef enum { + A = 0, + B, + C, + D, + E, + F, + G, + H, + I, + J, +} issue4054b; +*/ +import "C" + +var issue4054b = []int{C.A, C.B, C.C, C.D, C.E, C.F, C.G, C.H, C.I, C.J} diff --git a/misc/cgo/test/issue4273.c b/misc/cgo/test/issue4273.c new file mode 100644 index 0000000000000000000000000000000000000000..a3fcf3b0a87c53dc0aecb0cb254715cbf515de23 --- /dev/null +++ b/misc/cgo/test/issue4273.c @@ -0,0 +1,10 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +#ifdef __ELF__ +__attribute__((weak)) +__attribute__((visibility("hidden"))) +void _compilerrt_abort_impl(const char *file, int line, const char *func) { +} +#endif diff --git a/misc/cgo/test/issue4273b.c b/misc/cgo/test/issue4273b.c new file mode 100644 index 0000000000000000000000000000000000000000..93e2f4fab5b901124c8b54eb823d6ba35bac47ba --- /dev/null +++ b/misc/cgo/test/issue4273b.c @@ -0,0 +1,11 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +#ifdef __ELF__ +extern void _compilerrt_abort_impl(const char *file, int line, const char *func); + +void __my_abort(const char *file, int line, const char *func) { + _compilerrt_abort_impl(file, line, func); +} +#endif diff --git a/misc/cgo/test/issue4339.c b/misc/cgo/test/issue4339.c new file mode 100644 index 0000000000000000000000000000000000000000..15d0004078cfd1cb175e24ff3945082650aba044 --- /dev/null +++ b/misc/cgo/test/issue4339.c @@ -0,0 +1,18 @@ +#include +#include "issue4339.h" + +static void +impl(void) +{ + //printf("impl\n"); +} + +Issue4339 exported4339 = {"bar", impl}; + +void +handle4339(Issue4339 *x) +{ + //printf("handle\n"); + x->bar(); + //printf("done\n"); +} diff --git a/misc/cgo/test/issue4339.go b/misc/cgo/test/issue4339.go new file mode 100644 index 0000000000000000000000000000000000000000..f734a25da3fb0b731ceff32dc19845a2e4ad5439 --- /dev/null +++ b/misc/cgo/test/issue4339.go @@ -0,0 +1,16 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package cgotest + +/* +#include "issue4339.h" +*/ +import "C" + +import "testing" + +func test4339(t *testing.T) { + C.handle4339(&C.exported4339) +} diff --git a/misc/cgo/test/issue4339.h b/misc/cgo/test/issue4339.h new file mode 100644 index 0000000000000000000000000000000000000000..20f6cebb6b5b3165d3b0cb429e1172e592e8a975 --- /dev/null +++ b/misc/cgo/test/issue4339.h @@ -0,0 +1,9 @@ +typedef struct Issue4339 Issue4339; + +struct Issue4339 { + char *name; + void (*bar)(void); +}; + +extern Issue4339 exported4339; +void handle4339(Issue4339*); diff --git a/misc/cgo/test/issue4417.go b/misc/cgo/test/issue4417.go new file mode 100644 index 0000000000000000000000000000000000000000..0b48071d4d6551fd088b83ff3d50ec38a8ed467b --- /dev/null +++ b/misc/cgo/test/issue4417.go @@ -0,0 +1,42 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Issue 4417: cmd/cgo: bool alignment/padding issue. +// bool alignment is wrong and causing wrong arguments when calling functions. +// + +package cgotest + +/* +#include + +static int c_bool(bool a, bool b, int c, bool d, bool e) { + return c; +} +*/ +import "C" +import "testing" + +func testBoolAlign(t *testing.T) { + b := C.c_bool(true, true, 10, true, false) + if b != 10 { + t.Fatalf("found %d expected 10\n", b) + } + b = C.c_bool(true, true, 5, true, true) + if b != 5 { + t.Fatalf("found %d expected 5\n", b) + } + b = C.c_bool(true, true, 3, true, false) + if b != 3 { + t.Fatalf("found %d expected 3\n", b) + } + b = C.c_bool(false, false, 1, true, false) + if b != 1 { + t.Fatalf("found %d expected 1\n", b) + } + b = C.c_bool(false, true, 200, true, false) + if b != 200 { + t.Fatalf("found %d expected 200\n", b) + } +} diff --git a/misc/cgo/test/issue4857.go b/misc/cgo/test/issue4857.go new file mode 100644 index 0000000000000000000000000000000000000000..54dc39f8d1e0fc89404bdc728d51470e8bdc09c6 --- /dev/null +++ b/misc/cgo/test/issue4857.go @@ -0,0 +1,15 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package cgotest + +/* +#cgo CFLAGS: -Werror +const struct { int a; } *issue4857() { return (void *)0; } +*/ +import "C" + +func test4857() { + _ = C.issue4857() +} diff --git a/misc/cgo/test/issue5227.go b/misc/cgo/test/issue5227.go new file mode 100644 index 0000000000000000000000000000000000000000..336c4c6091003be45d09731633bac478de025ee4 --- /dev/null +++ b/misc/cgo/test/issue5227.go @@ -0,0 +1,38 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Issue 5227: linker incorrectly treats common symbols and +// leaves them undefined. + +package cgotest + +/* +typedef struct { + int Count; +} Fontinfo; + +Fontinfo SansTypeface; + +extern void init(); + +Fontinfo loadfont() { + Fontinfo f = {0}; + return f; +} + +void init() { + SansTypeface = loadfont(); +} +*/ +import "C" + +import "testing" + +func test5227(t *testing.T) { + C.init() +} + +func selectfont() C.Fontinfo { + return C.SansTypeface +} diff --git a/misc/cgo/test/issue5242.go b/misc/cgo/test/issue5242.go new file mode 100644 index 0000000000000000000000000000000000000000..fe0a6321c1fd0377f5e45cfa3ecc3601b24fc70f --- /dev/null +++ b/misc/cgo/test/issue5242.go @@ -0,0 +1,31 @@ +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Issue 5242. Cgo incorrectly computed the alignment of structs +// with no Go accessible fields as 0, and then panicked on +// modulo-by-zero computations. + +package cgotest + +/* +typedef struct { +} foo; + +typedef struct { + int x : 1; +} bar; + +int issue5242(foo f, bar b) { + return 5242; +} +*/ +import "C" + +import "testing" + +func test5242(t *testing.T) { + if got := C.issue5242(C.foo{}, C.bar{}); got != 5242 { + t.Errorf("got %v", got) + } +} diff --git a/misc/cgo/test/issue5337.go b/misc/cgo/test/issue5337.go new file mode 100644 index 0000000000000000000000000000000000000000..8013b66a7480690e36cb04d98cd19e55fc5a525b --- /dev/null +++ b/misc/cgo/test/issue5337.go @@ -0,0 +1,31 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build !windows + +package cgotest + +/* +#include +#include + +static void *thread1(void *p) { + (void)p; + pthread_kill(pthread_self(), SIGPROF); + return NULL; +} +void test5337() { + pthread_t tid; + pthread_create(&tid, 0, thread1, NULL); + pthread_join(tid, 0); +} +*/ +import "C" + +import "testing" + +// Verify that we can withstand SIGPROF received on foreign threads +func test5337(t *testing.T) { + C.test5337() +} diff --git a/misc/cgo/test/issue5337w.go b/misc/cgo/test/issue5337w.go new file mode 100644 index 0000000000000000000000000000000000000000..14720a94d5aeb1879ac3d71adcb8b2385f03192e --- /dev/null +++ b/misc/cgo/test/issue5337w.go @@ -0,0 +1,11 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build windows + +package cgotest + +import "testing" + +func test5337(t *testing.T) {} diff --git a/misc/cgo/test/issue5548.go b/misc/cgo/test/issue5548.go new file mode 100644 index 0000000000000000000000000000000000000000..c879f2ae91d59d5f9ec5da1cb3c3f23b25786e88 --- /dev/null +++ b/misc/cgo/test/issue5548.go @@ -0,0 +1,27 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package cgotest + +import "testing" + +/* +extern int issue5548_in_c(void); +*/ +import "C" + +//export issue5548FromC +func issue5548FromC(s string, i int) int { + if len(s) == 4 && s == "test" && i == 42 { + return 12345 + } + println("got", len(s), i) + return 9876 +} + +func test5548(t *testing.T) { + if x := C.issue5548_in_c(); x != 12345 { + t.Errorf("issue5548_in_c = %d, want %d", x, 12345) + } +} diff --git a/misc/cgo/test/issue5548_c.c b/misc/cgo/test/issue5548_c.c new file mode 100644 index 0000000000000000000000000000000000000000..ee9c45934d29a68a622ff100e893b449aa2ccd5b --- /dev/null +++ b/misc/cgo/test/issue5548_c.c @@ -0,0 +1,24 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +#include "_cgo_export.h" + +static void clobber_stack() { + volatile char a[1024]; + int i; + for(i = 0; i < sizeof a; i++) + a[i] = 0xff; +} + +static int call_go() { + GoString s; + s.p = "test"; + s.n = 4; + return issue5548FromC(s, 42); +} + +int issue5548_in_c() { + clobber_stack(); + return call_go(); +} diff --git a/misc/cgo/test/issue5603.go b/misc/cgo/test/issue5603.go new file mode 100644 index 0000000000000000000000000000000000000000..ecb2aa32ecb7b5e140a0afbfd25dd81c00e31990 --- /dev/null +++ b/misc/cgo/test/issue5603.go @@ -0,0 +1,32 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package cgotest + +/* +const long long issue5603exp = 0x12345678; +long long issue5603foo0() { return issue5603exp; } +long long issue5603foo1(void *p) { return issue5603exp; } +long long issue5603foo2(void *p, void *q) { return issue5603exp; } +long long issue5603foo3(void *p, void *q, void *r) { return issue5603exp; } +long long issue5603foo4(void *p, void *q, void *r, void *s) { return issue5603exp; } +*/ +import "C" + +import "testing" + +func test5603(t *testing.T) { + var x [5]int64 + exp := int64(C.issue5603exp) + x[0] = int64(C.issue5603foo0()) + x[1] = int64(C.issue5603foo1(nil)) + x[2] = int64(C.issue5603foo2(nil, nil)) + x[3] = int64(C.issue5603foo3(nil, nil, nil)) + x[4] = int64(C.issue5603foo4(nil, nil, nil, nil)) + for i, v := range x { + if v != exp { + t.Errorf("issue5603foo%d() returns %v, expected %v", i, v, exp) + } + } +} diff --git a/misc/cgo/test/issue5740.go b/misc/cgo/test/issue5740.go new file mode 100644 index 0000000000000000000000000000000000000000..25c86153fd5dff4efa77447b58d011896cd3e3f2 --- /dev/null +++ b/misc/cgo/test/issue5740.go @@ -0,0 +1,15 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package cgotest + +// int test5740a(void), test5740b(void); +import "C" +import "testing" + +func test5740(t *testing.T) { + if v := C.test5740a() + C.test5740b(); v != 5 { + t.Errorf("expected 5, got %v", v) + } +} diff --git a/misc/cgo/test/issue5740a.c b/misc/cgo/test/issue5740a.c new file mode 100644 index 0000000000000000000000000000000000000000..25f18e2a455b95ef18a62b71d17a2d024666a966 --- /dev/null +++ b/misc/cgo/test/issue5740a.c @@ -0,0 +1,9 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +static int volatile val = 2; + +int test5740a() { + return val; +} diff --git a/misc/cgo/test/issue5740b.c b/misc/cgo/test/issue5740b.c new file mode 100644 index 0000000000000000000000000000000000000000..22893f35bd8a6b92ade0800dbd2b6a2745099c3d --- /dev/null +++ b/misc/cgo/test/issue5740b.c @@ -0,0 +1,9 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +static int volatile val = 3; + +int test5740b() { + return val; +} diff --git a/misc/cgo/test/issue5986.go b/misc/cgo/test/issue5986.go new file mode 100644 index 0000000000000000000000000000000000000000..4f772cdb967c9ae91b952794242b4e5a91f942c0 --- /dev/null +++ b/misc/cgo/test/issue5986.go @@ -0,0 +1,32 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package cgotest + +/* +#cgo LDFLAGS: -lm +#include +#include + +static void output5986() +{ + int current_row = 0, row_count = 0; + double sum_squares = 0; + do { + if (current_row == 10) { + current_row = 0; + } + ++row_count; + } + while (current_row++ != 1); + double d = sqrt(sum_squares / row_count); + printf("sqrt is: %g\n", d); +} +*/ +import "C" +import "testing" + +func test5986(t *testing.T) { + C.output5986() +} diff --git a/misc/cgo/test/issue6128.go b/misc/cgo/test/issue6128.go new file mode 100644 index 0000000000000000000000000000000000000000..4afba244fd59b99159e2cb734068ede9bd14d5d9 --- /dev/null +++ b/misc/cgo/test/issue6128.go @@ -0,0 +1,20 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package cgotest + +// Test handling of #defined names in clang. +// golang.org/issue/6128. + +/* +// NOTE: Must use hex, or else a shortcut for decimals +// in cgo avoids trying to pass this to clang. +#define X 0x1 +*/ +import "C" + +func test6128() { + // nothing to run, just make sure this compiles. + _ = C.X +} diff --git a/misc/cgo/test/issue6390.go b/misc/cgo/test/issue6390.go new file mode 100644 index 0000000000000000000000000000000000000000..6f5715b05d849b7925fc0bfa311f6cd4e88ec6d8 --- /dev/null +++ b/misc/cgo/test/issue6390.go @@ -0,0 +1,23 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package cgotest + +// #include +import "C" + +import "testing" + +func test6390(t *testing.T) { + p1 := C.malloc(1024) + if p1 == nil { + t.Fatalf("C.malloc(1024) returned nil") + } + p2 := C.malloc(0) + if p2 == nil { + t.Fatalf("C.malloc(0) returned nil") + } + C.free(p1) + C.free(p2) +} diff --git a/misc/cgo/test/issue6472.go b/misc/cgo/test/issue6472.go new file mode 100644 index 0000000000000000000000000000000000000000..cd94cac376f41e95a40c1d7f0b28bbbee303d53a --- /dev/null +++ b/misc/cgo/test/issue6472.go @@ -0,0 +1,22 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package cgotest + +/* +typedef struct +{ + struct + { + int x; + } y[16]; +} z; +*/ +import "C" + +func test6472() { + // nothing to run, just make sure this compiles + s := new(C.z) + println(s.y[0].x) +} diff --git a/misc/cgo/test/issue6506.go b/misc/cgo/test/issue6506.go new file mode 100644 index 0000000000000000000000000000000000000000..b79e242e9ccd6cffdf2f35b07e35c0b90cee5cbc --- /dev/null +++ b/misc/cgo/test/issue6506.go @@ -0,0 +1,36 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package cgotest + +// Test handling of size_t in the face of incorrect clang debug information. +// golang.org/issue/6506. + +/* +#include +#include +*/ +import "C" + +func test6506() { + // nothing to run, just make sure this compiles + var x C.size_t + + C.calloc(x, x) + C.malloc(x) + C.realloc(nil, x) + C.memcpy(nil, nil, x) + C.memcmp(nil, nil, x) + C.memmove(nil, nil, x) + C.strncpy(nil, nil, x) + C.strncmp(nil, nil, x) + C.strncat(nil, nil, x) + x = C.strxfrm(nil, nil, x) + C.memchr(nil, 0, x) + x = C.strcspn(nil, nil) + x = C.strspn(nil, nil) + C.memset(nil, 0, x) + x = C.strlen(nil) + _ = x +} diff --git a/misc/cgo/test/issue6612.go b/misc/cgo/test/issue6612.go new file mode 100644 index 0000000000000000000000000000000000000000..902878c25928e586d7555b33d8e7fc47f5763cf8 --- /dev/null +++ b/misc/cgo/test/issue6612.go @@ -0,0 +1,93 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// golang.org/issue/6612 +// Test new scheme for deciding whether C.name is an expression, type, constant. +// Clang silences some warnings when the name is a #defined macro, so test those too +// (even though we now use errors exclusively, not warnings). + +package cgotest + +/* +void myfunc(void) {} +int myvar = 5; +const char *mytext = "abcdef"; +typedef int mytype; +enum { + myenum = 1234, +}; + +#define myfunc_def myfunc +#define myvar_def myvar +#define mytext_def mytext +#define mytype_def mytype +#define myenum_def myenum +#define myint_def 12345 +#define myfloat_def 1.5 +#define mystring_def "hello" +*/ +import "C" + +import "testing" + +func testNaming(t *testing.T) { + C.myfunc() + C.myfunc_def() + if v := C.myvar; v != 5 { + t.Errorf("C.myvar = %d, want 5", v) + } + if v := C.myvar_def; v != 5 { + t.Errorf("C.myvar_def = %d, want 5", v) + } + if s := C.GoString(C.mytext); s != "abcdef" { + t.Errorf("C.mytext = %q, want %q", s, "abcdef") + } + if s := C.GoString(C.mytext_def); s != "abcdef" { + t.Errorf("C.mytext_def = %q, want %q", s, "abcdef") + } + if c := C.myenum; c != 1234 { + t.Errorf("C.myenum = %v, want 1234", c) + } + if c := C.myenum_def; c != 1234 { + t.Errorf("C.myenum_def = %v, want 1234", c) + } + { + const c = C.myenum + if c != 1234 { + t.Errorf("C.myenum as const = %v, want 1234", c) + } + } + { + const c = C.myenum_def + if c != 1234 { + t.Errorf("C.myenum as const = %v, want 1234", c) + } + } + if c := C.myint_def; c != 12345 { + t.Errorf("C.myint_def = %v, want 12345", c) + } + { + const c = C.myint_def + if c != 12345 { + t.Errorf("C.myint as const = %v, want 12345", c) + } + } + + // This would be nice, but it has never worked. + /* + if c := C.myfloat_def; c != 1.5 { + t.Errorf("C.myint_def = %v, want 1.5", c) + } + { + const c = C.myfloat_def + if c != 1.5 { + t.Errorf("C.myint as const = %v, want 1.5", c) + } + } + */ + + if s := C.mystring_def; s != "hello" { + t.Errorf("C.mystring_def = %q, want %q", s, "hello") + } +} diff --git a/misc/cgo/test/issue6833.go b/misc/cgo/test/issue6833.go new file mode 100644 index 0000000000000000000000000000000000000000..e12d53422213244a1974dce43ca5203be0afc5bd --- /dev/null +++ b/misc/cgo/test/issue6833.go @@ -0,0 +1,27 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package cgotest + +/* +extern unsigned long long issue6833Func(unsigned int, unsigned long long); +*/ +import "C" + +import "testing" + +//export GoIssue6833Func +func GoIssue6833Func(aui uint, aui64 uint64) uint64 { + return aui64 + uint64(aui) +} + +func test6833(t *testing.T) { + ui := 7 + ull := uint64(0x4000300020001000) + v := uint64(C.issue6833Func(C.uint(ui), C.ulonglong(ull))) + exp := uint64(ui) + ull + if v != exp { + t.Errorf("issue6833Func() returns %x, expected %x", v, exp) + } +} diff --git a/misc/cgo/test/issue6833_c.c b/misc/cgo/test/issue6833_c.c new file mode 100644 index 0000000000000000000000000000000000000000..a77b425b5cf67fb1ccb4834e367a76bc1ab62464 --- /dev/null +++ b/misc/cgo/test/issue6833_c.c @@ -0,0 +1,10 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +#include "_cgo_export.h" + +unsigned long long +issue6833Func(unsigned int aui, unsigned long long aull) { + return GoIssue6833Func(aui, aull); +} diff --git a/misc/cgo/test/issue6997_linux.c b/misc/cgo/test/issue6997_linux.c new file mode 100644 index 0000000000000000000000000000000000000000..897cdd081c693557f0050166b20d103abfb70393 --- /dev/null +++ b/misc/cgo/test/issue6997_linux.c @@ -0,0 +1,26 @@ +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +#include +#include +#include + +static pthread_t thread; + +static void* threadfunc(void* dummy) { + while(1) { + sleep(1); + } +} + +int StartThread() { + return pthread_create(&thread, NULL, &threadfunc, NULL); +} + +int CancelThread() { + void *r; + pthread_cancel(thread); + pthread_join(thread, &r); + return (r == PTHREAD_CANCELED); +} diff --git a/misc/cgo/test/issue6997_linux.go b/misc/cgo/test/issue6997_linux.go new file mode 100644 index 0000000000000000000000000000000000000000..07fd58e399cfbc39c80931df2de81b36162ecb33 --- /dev/null +++ b/misc/cgo/test/issue6997_linux.go @@ -0,0 +1,40 @@ +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Test that pthread_cancel works as expected +// (NPTL uses SIGRTMIN to implement thread cancellation) +// See https://golang.org/issue/6997 +package cgotest + +/* +#cgo CFLAGS: -pthread +#cgo LDFLAGS: -pthread +extern int StartThread(); +extern int CancelThread(); +*/ +import "C" + +import "testing" +import "time" + +func test6997(t *testing.T) { + r := C.StartThread() + if r != 0 { + t.Error("pthread_create failed") + } + c := make(chan C.int) + go func() { + time.Sleep(500 * time.Millisecond) + c <- C.CancelThread() + }() + + select { + case r = <-c: + if r == 0 { + t.Error("pthread finished but wasn't cancelled??") + } + case <-time.After(30 * time.Second): + t.Error("hung in pthread_cancel/pthread_join") + } +} diff --git a/misc/cgo/test/issue7234_test.go b/misc/cgo/test/issue7234_test.go new file mode 100644 index 0000000000000000000000000000000000000000..a020b6a724994ecbaf921a8d6661e06bd7653ab9 --- /dev/null +++ b/misc/cgo/test/issue7234_test.go @@ -0,0 +1,21 @@ +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package cgotest + +import "testing" + +// This test actually doesn't have anything to do with cgo. It is a +// test of https://golang.org/issue/7234, a compiler/linker bug in +// handling string constants when using -linkmode=external. The test +// is in this directory because we routinely test -linkmode=external +// here. + +var v7234 = [...]string{"runtime/cgo"} + +func Test7234(t *testing.T) { + if v7234[0] != "runtime/cgo" { + t.Errorf("bad string constant %q", v7234[0]) + } +} diff --git a/misc/cgo/test/issue7560.go b/misc/cgo/test/issue7560.go new file mode 100644 index 0000000000000000000000000000000000000000..4bea6e357367c9b2d9db71077d5ac9e457421a75 --- /dev/null +++ b/misc/cgo/test/issue7560.go @@ -0,0 +1,44 @@ +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package cgotest + +/* +#include + +typedef struct { + char x; + long y; +} __attribute__((__packed__)) misaligned; + +int +offset7560(void) +{ + return (uintptr_t)&((misaligned*)0)->y; +} +*/ +import "C" + +import ( + "reflect" + "testing" +) + +func test7560(t *testing.T) { + // some mingw don't implement __packed__ correctly. + if C.offset7560() != 1 { + t.Skip("C compiler did not pack struct") + } + + // C.misaligned should have x but then a padding field to get to the end of the struct. + // There should not be a field named 'y'. + var v C.misaligned + rt := reflect.TypeOf(&v).Elem() + if rt.NumField() != 2 || rt.Field(0).Name != "x" || rt.Field(1).Name != "_" { + t.Errorf("unexpected fields in C.misaligned:\n") + for i := 0; i < rt.NumField(); i++ { + t.Logf("%+v\n", rt.Field(i)) + } + } +} diff --git a/misc/cgo/test/issue7665.go b/misc/cgo/test/issue7665.go new file mode 100644 index 0000000000000000000000000000000000000000..4f36dce7566f81e49bc99664c5f043fbb52f9eb8 --- /dev/null +++ b/misc/cgo/test/issue7665.go @@ -0,0 +1,25 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package cgotest + +import ( + "testing" + "unsafe" +) + +// extern void f7665(void); +import "C" + +//export f7665 +func f7665() {} + +var bad7665 unsafe.Pointer = C.f7665 +var good7665 uintptr = uintptr(C.f7665) + +func test7665(t *testing.T) { + if bad7665 == nil || bad7665 != unsafe.Pointer(good7665) { + t.Errorf("ptrs = %p, %#x, want same non-nil pointer", bad7665, good7665) + } +} diff --git a/misc/cgo/test/issue7786.go b/misc/cgo/test/issue7786.go new file mode 100644 index 0000000000000000000000000000000000000000..b92763789b21867c68a5f1981fe28039a7749459 --- /dev/null +++ b/misc/cgo/test/issue7786.go @@ -0,0 +1,51 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Issue 7786. No runtime test, just make sure that typedef and struct/union/class are interchangeable at compile time. + +package cgotest + +// struct test7786; +// typedef struct test7786 typedef_test7786; +// void f7786(struct test7786 *ctx) {} +// void g7786(typedef_test7786 *ctx) {} +// +// typedef struct body7786 typedef_body7786; +// struct body7786 { int x; }; +// void b7786(struct body7786 *ctx) {} +// void c7786(typedef_body7786 *ctx) {} +// +// typedef union union7786 typedef_union7786; +// void u7786(union union7786 *ctx) {} +// void v7786(typedef_union7786 *ctx) {} +import "C" + +func f() { + var x1 *C.typedef_test7786 + var x2 *C.struct_test7786 + x1 = x2 + x2 = x1 + C.f7786(x1) + C.f7786(x2) + C.g7786(x1) + C.g7786(x2) + + var b1 *C.typedef_body7786 + var b2 *C.struct_body7786 + b1 = b2 + b2 = b1 + C.b7786(b1) + C.b7786(b2) + C.c7786(b1) + C.c7786(b2) + + var u1 *C.typedef_union7786 + var u2 *C.union_union7786 + u1 = u2 + u2 = u1 + C.u7786(u1) + C.u7786(u2) + C.v7786(u1) + C.v7786(u2) +} diff --git a/misc/cgo/test/issue7978.go b/misc/cgo/test/issue7978.go new file mode 100644 index 0000000000000000000000000000000000000000..094ccc18397114d17c01ab058e2eb2db8fdb03f5 --- /dev/null +++ b/misc/cgo/test/issue7978.go @@ -0,0 +1,124 @@ +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Issue 7978. Stack tracing didn't work during cgo code after calling a Go +// callback. Make sure GC works and the stack trace is correct. + +package cgotest + +/* +#include + +void issue7978cb(void); + +#if defined(__APPLE__) && defined(__arm__) +// on Darwin/ARM, libSystem doesn't provide implementation of the __sync_fetch_and_add +// primitive, and although gcc supports it, it doesn't inline its definition. +// Clang could inline its definition, so we require clang on Darwin/ARM. +#if defined(__clang__) +#define HAS_SYNC_FETCH_AND_ADD 1 +#else +#define HAS_SYNC_FETCH_AND_ADD 0 +#endif +#else +#define HAS_SYNC_FETCH_AND_ADD 1 +#endif + +// use ugly atomic variable sync since that doesn't require calling back into +// Go code or OS dependencies +static void issue7978c(uint32_t *sync) { +#if HAS_SYNC_FETCH_AND_ADD + while(__sync_fetch_and_add(sync, 0) != 0) + ; + __sync_fetch_and_add(sync, 1); + while(__sync_fetch_and_add(sync, 0) != 2) + ; + issue7978cb(); + __sync_fetch_and_add(sync, 1); + while(__sync_fetch_and_add(sync, 0) != 6) + ; +#endif +} +*/ +import "C" + +import ( + "os" + "runtime" + "strings" + "sync/atomic" + "testing" +) + +var issue7978sync uint32 + +func issue7978check(t *testing.T, wantFunc string, badFunc string, depth int) { + runtime.GC() + buf := make([]byte, 65536) + trace := string(buf[:runtime.Stack(buf, true)]) + for _, goroutine := range strings.Split(trace, "\n\n") { + if strings.Contains(goroutine, "test.issue7978go") { + trace := strings.Split(goroutine, "\n") + // look for the expected function in the stack + for i := 0; i < depth; i++ { + if badFunc != "" && strings.Contains(trace[1+2*i], badFunc) { + t.Errorf("bad stack: found %s in the stack:\n%s", badFunc, goroutine) + return + } + if strings.Contains(trace[1+2*i], wantFunc) { + return + } + } + t.Errorf("bad stack: didn't find %s in the stack:\n%s", wantFunc, goroutine) + return + } + } + t.Errorf("bad stack: goroutine not found. Full stack dump:\n%s", trace) +} + +func issue7978wait(store uint32, wait uint32) { + if store != 0 { + atomic.StoreUint32(&issue7978sync, store) + } + for atomic.LoadUint32(&issue7978sync) != wait { + runtime.Gosched() + } +} + +//export issue7978cb +func issue7978cb() { + issue7978wait(3, 4) +} + +func issue7978go() { + C.issue7978c((*C.uint32_t)(&issue7978sync)) + issue7978wait(7, 8) +} + +func test7978(t *testing.T) { + if runtime.Compiler == "gccgo" { + t.Skip("gccgo can not do stack traces of C code") + } + if C.HAS_SYNC_FETCH_AND_ADD == 0 { + t.Skip("clang required for __sync_fetch_and_add support on darwin/arm") + } + if os.Getenv("GOTRACEBACK") != "2" { + t.Fatalf("GOTRACEBACK must be 2") + } + issue7978sync = 0 + go issue7978go() + // test in c code, before callback + issue7978wait(0, 1) + issue7978check(t, "runtime.cgocall(", "", 1) + // test in go code, during callback + issue7978wait(2, 3) + issue7978check(t, "test.issue7978cb(", "test.issue7978go", 3) + // test in c code, after callback + issue7978wait(4, 5) + issue7978check(t, "runtime.cgocall(", "runtime.cgocallback", 1) + // test in go code, after return from cgo + issue7978wait(6, 7) + issue7978check(t, "test.issue7978go(", "", 3) + atomic.StoreUint32(&issue7978sync, 8) +} diff --git a/misc/cgo/test/issue8092.go b/misc/cgo/test/issue8092.go new file mode 100644 index 0000000000000000000000000000000000000000..8a14ce6d7aa48b3f525b93301248cf5545ebe4f0 --- /dev/null +++ b/misc/cgo/test/issue8092.go @@ -0,0 +1,36 @@ +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Issue 8092. Test that linker defined symbols (e.g., text, data) don't +// conflict with C symbols. + +package cgotest + +/* +char text[] = "text"; +char data[] = "data"; +char *ctext(void) { return text; } +char *cdata(void) { return data; } +*/ +import "C" + +import "testing" + +func test8092(t *testing.T) { + tests := []struct { + s string + a, b *C.char + }{ + {"text", &C.text[0], C.ctext()}, + {"data", &C.data[0], C.cdata()}, + } + for _, test := range tests { + if test.a != test.b { + t.Errorf("%s: pointer mismatch: %v != %v", test.s, test.a, test.b) + } + if got := C.GoString(test.a); got != test.s { + t.Errorf("%s: points at %#v, want %#v", test.s, got, test.s) + } + } +} diff --git a/misc/cgo/test/issue8148.go b/misc/cgo/test/issue8148.go new file mode 100644 index 0000000000000000000000000000000000000000..8e4190848941b648dd4a994dcfa8bad8067463a0 --- /dev/null +++ b/misc/cgo/test/issue8148.go @@ -0,0 +1,31 @@ +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Issue 8148. A typedef of an unnamed struct didn't work when used +// with an exported Go function. No runtime test; just make sure it +// compiles. + +package cgotest + +/* +typedef struct { int i; } T; + +int issue8148Callback(T*); + +static int get() { + T t; + t.i = 42; + return issue8148Callback(&t); +} +*/ +import "C" + +//export issue8148Callback +func issue8148Callback(t *C.T) C.int { + return t.i +} + +func Issue8148() int { + return int(C.get()) +} diff --git a/misc/cgo/test/issue8331.h b/misc/cgo/test/issue8331.h new file mode 100644 index 0000000000000000000000000000000000000000..936ae9d5c1e236324f6dbed2623bfad35ea35ce9 --- /dev/null +++ b/misc/cgo/test/issue8331.h @@ -0,0 +1,7 @@ +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +typedef struct { + int i; +} issue8331; diff --git a/misc/cgo/test/issue8331a.go b/misc/cgo/test/issue8331a.go new file mode 100644 index 0000000000000000000000000000000000000000..7fa55be4355f3835423bb0b4222badd85c3d81d7 --- /dev/null +++ b/misc/cgo/test/issue8331a.go @@ -0,0 +1,15 @@ +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Issue 8331. A typedef of an unnamed struct is the same struct when +// #include'd twice. No runtime test; just make sure it compiles. + +package cgotest + +// #include "issue8331.h" +import "C" + +func issue8331a() C.issue8331 { + return issue8331Var +} diff --git a/misc/cgo/test/issue8331b.go b/misc/cgo/test/issue8331b.go new file mode 100644 index 0000000000000000000000000000000000000000..d52aed63e4b1c8d00af7a52887a3c284cf5ca1d0 --- /dev/null +++ b/misc/cgo/test/issue8331b.go @@ -0,0 +1,13 @@ +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Issue 8331. A typedef of an unnamed struct is the same struct when +// #include'd twice. No runtime test; just make sure it compiles. + +package cgotest + +// #include "issue8331.h" +import "C" + +var issue8331Var C.issue8331 diff --git a/misc/cgo/test/issue8428.go b/misc/cgo/test/issue8428.go new file mode 100644 index 0000000000000000000000000000000000000000..16fa7cc6ec3d308809f0846a2f36bc93d61ed506 --- /dev/null +++ b/misc/cgo/test/issue8428.go @@ -0,0 +1,55 @@ +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// This test fails on older versions of OS X because they use older buggy +// versions of Clang that emit ambiguous DWARF info. See issue 8611. +// +build !darwin + +package cgotest + +// Issue 8428. Cgo inconsistently translated zero size arrays. + +/* +struct issue8428one { + char b; + char rest[]; +}; + +struct issue8428two { + void *p; + char b; + char rest[0]; + char pad; +}; + +struct issue8428three { + char w[1][2][3][0]; + char x[2][3][0][1]; + char y[3][0][1][2]; + char z[0][1][2][3]; +}; +*/ +import "C" + +import "unsafe" + +var _ = C.struct_issue8428one{ + b: C.char(0), + // The trailing rest field is not available in cgo. + // See issue 11925. + // rest: [0]C.char{}, +} + +var _ = C.struct_issue8428two{ + p: unsafe.Pointer(nil), + b: C.char(0), + rest: [0]C.char{}, +} + +var _ = C.struct_issue8428three{ + w: [1][2][3][0]C.char{}, + x: [2][3][0][1]C.char{}, + y: [3][0][1][2]C.char{}, + z: [0][1][2][3]C.char{}, +} diff --git a/misc/cgo/test/issue8441.go b/misc/cgo/test/issue8441.go new file mode 100644 index 0000000000000000000000000000000000000000..2d871f0832bd9c6658eae14e30b9742258254172 --- /dev/null +++ b/misc/cgo/test/issue8441.go @@ -0,0 +1,27 @@ +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Issue 8368 and 8441. Recursive struct definitions didn't work. +// No runtime test; just make sure it compiles. + +package cgotest + +/* +typedef struct one one; +typedef struct two two; +struct one { + two *x; +}; +struct two { + one *x; +}; +*/ +import "C" + +func issue8368(one *C.struct_one, two *C.struct_two) { +} + +func issue8441(one *C.one, two *C.two) { + issue8441(two.x, one.x) +} diff --git a/misc/cgo/test/issue8517.go b/misc/cgo/test/issue8517.go new file mode 100644 index 0000000000000000000000000000000000000000..4e431df921d1e33d4ca79faf9ea26e302a4aa6d9 --- /dev/null +++ b/misc/cgo/test/issue8517.go @@ -0,0 +1,13 @@ +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build !windows + +package cgotest + +import "testing" + +func test8517(t *testing.T) { + t.Skip("skipping windows only test") +} diff --git a/misc/cgo/test/issue8517_windows.c b/misc/cgo/test/issue8517_windows.c new file mode 100644 index 0000000000000000000000000000000000000000..a0b94c126f6330ed2fa5915b69e88a12d12d2872 --- /dev/null +++ b/misc/cgo/test/issue8517_windows.c @@ -0,0 +1,24 @@ +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +#include "windows.h" + +extern void testHandleLeaksCallback(); + +DWORD WINAPI testHandleLeaksFunc(LPVOID lpThreadParameter) +{ + int i; + for(i = 0; i < 100; i++) { + testHandleLeaksCallback(); + } + return 0; +} + +void testHandleLeaks() +{ + HANDLE h; + h = CreateThread(NULL, 0, &testHandleLeaksFunc, 0, 0, NULL); + WaitForSingleObject(h, INFINITE); + CloseHandle(h); +} diff --git a/misc/cgo/test/issue8517_windows.go b/misc/cgo/test/issue8517_windows.go new file mode 100644 index 0000000000000000000000000000000000000000..3782631e91b46488115fec94bdbcd4e8bc73e9f1 --- /dev/null +++ b/misc/cgo/test/issue8517_windows.go @@ -0,0 +1,45 @@ +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package cgotest + +//void testHandleLeaks(); +import "C" + +import ( + "syscall" + "testing" + "unsafe" +) + +var issue8517counter int + +var ( + kernel32 = syscall.MustLoadDLL("kernel32.dll") + getProcessHandleCount = kernel32.MustFindProc("GetProcessHandleCount") +) + +func processHandleCount(t *testing.T) int { + const current_process = ^uintptr(0) + var c uint32 + r, _, err := getProcessHandleCount.Call(current_process, uintptr(unsafe.Pointer(&c))) + if r == 0 { + t.Fatal(err) + } + return int(c) +} + +func test8517(t *testing.T) { + c1 := processHandleCount(t) + C.testHandleLeaks() + c2 := processHandleCount(t) + if c1+issue8517counter <= c2 { + t.Fatalf("too many handles leaked: issue8517counter=%v c1=%v c2=%v", issue8517counter, c1, c2) + } +} + +//export testHandleLeaksCallback +func testHandleLeaksCallback() { + issue8517counter++ +} diff --git a/misc/cgo/test/issue8694.go b/misc/cgo/test/issue8694.go new file mode 100644 index 0000000000000000000000000000000000000000..1876f782d96939905c6598d92513f185fb1d852c --- /dev/null +++ b/misc/cgo/test/issue8694.go @@ -0,0 +1,38 @@ +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package cgotest + +/* +#include + +complex float complexFloatSquared(complex float a) { return a*a; } +complex double complexDoubleSquared(complex double a) { return a*a; } +*/ +import "C" + +import ( + "runtime" + "testing" +) + +func test8694(t *testing.T) { + if runtime.GOARCH == "arm" { + t.Skip("test8694 is disabled on ARM because 5l cannot handle thumb library.") + } + // Really just testing that this compiles, but check answer anyway. + x := complex64(2 + 3i) + x2 := x * x + cx2 := C.complexFloatSquared(x) + if cx2 != x2 { + t.Errorf("C.complexFloatSquared(%v) = %v, want %v", x, cx2, x2) + } + + y := complex128(2 + 3i) + y2 := y * y + cy2 := C.complexDoubleSquared(y) + if cy2 != y2 { + t.Errorf("C.complexDoubleSquared(%v) = %v, want %v", y, cy2, y2) + } +} diff --git a/misc/cgo/test/issue8811.c b/misc/cgo/test/issue8811.c new file mode 100644 index 0000000000000000000000000000000000000000..584bb39342e4df25ca07c6a5095c9ed3feb42dd9 --- /dev/null +++ b/misc/cgo/test/issue8811.c @@ -0,0 +1,8 @@ +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +int issue8811Initialized = 0; + +void issue8811Init() { +} diff --git a/misc/cgo/test/issue8811.go b/misc/cgo/test/issue8811.go new file mode 100644 index 0000000000000000000000000000000000000000..2e217d9356ad3b37d752ce8bd0bc8bddb3405d2d --- /dev/null +++ b/misc/cgo/test/issue8811.go @@ -0,0 +1,22 @@ +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package cgotest + +/* +extern int issue8811Initialized; +extern void issue8811Init(); + +void issue8811Execute() { + if(!issue8811Initialized) + issue8811Init(); +} +*/ +import "C" + +import "testing" + +func test8811(t *testing.T) { + C.issue8811Execute() +} diff --git a/misc/cgo/test/issue8828.go b/misc/cgo/test/issue8828.go new file mode 100644 index 0000000000000000000000000000000000000000..304797c929cc5019a37d505bf8bb349a377b9962 --- /dev/null +++ b/misc/cgo/test/issue8828.go @@ -0,0 +1,16 @@ +// compile + +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Issue 8828: compiling a file with -compiler=gccgo fails if a .c file +// has the same name as compiled directory. + +package cgotest + +import "./issue8828" + +func p() { + issue8828.Bar() +} diff --git a/misc/cgo/test/issue8828/issue8828.c b/misc/cgo/test/issue8828/issue8828.c new file mode 100644 index 0000000000000000000000000000000000000000..2950f87cfb81bda2ab1b7cecbe0b3db0d6e9b552 --- /dev/null +++ b/misc/cgo/test/issue8828/issue8828.c @@ -0,0 +1,7 @@ +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +void foo() +{ +} diff --git a/misc/cgo/test/issue8828/trivial.go b/misc/cgo/test/issue8828/trivial.go new file mode 100644 index 0000000000000000000000000000000000000000..e7b9a4e573dc0935f09e5a8bd065f9f0b32edcfd --- /dev/null +++ b/misc/cgo/test/issue8828/trivial.go @@ -0,0 +1,8 @@ +package issue8828 + +//void foo(); +import "C" + +func Bar() { + C.foo() +} diff --git a/misc/cgo/test/issue8945.go b/misc/cgo/test/issue8945.go new file mode 100644 index 0000000000000000000000000000000000000000..572b8155d80a731da42ab703cd0e8e275fad4bca --- /dev/null +++ b/misc/cgo/test/issue8945.go @@ -0,0 +1,16 @@ +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build gccgo + +package cgotest + +//typedef void (*PFunc)(); +//PFunc success_cb; +import "C" + +//export Test +func Test() { + _ = C.success_cb +} diff --git a/misc/cgo/test/issue9026.go b/misc/cgo/test/issue9026.go new file mode 100644 index 0000000000000000000000000000000000000000..8848d0e811818e690d64a127d04b2dd6510a1a97 --- /dev/null +++ b/misc/cgo/test/issue9026.go @@ -0,0 +1,9 @@ +package cgotest + +import ( + "testing" + + "./issue9026" +) + +func test9026(t *testing.T) { issue9026.Test(t) } diff --git a/misc/cgo/test/issue9026/issue9026.go b/misc/cgo/test/issue9026/issue9026.go new file mode 100644 index 0000000000000000000000000000000000000000..0af86e64da487a44bc342f8c3bfd1aeea8d465fb --- /dev/null +++ b/misc/cgo/test/issue9026/issue9026.go @@ -0,0 +1,36 @@ +package issue9026 + +// This file appears in its own package since the assertion tests the +// per-package counter used to create fresh identifiers. + +/* +typedef struct {} git_merge_file_input; + +typedef struct {} git_merge_file_options; + +void git_merge_file( + git_merge_file_input *in, + git_merge_file_options *opts) {} +*/ +import "C" +import ( + "fmt" + "testing" +) + +func Test(t *testing.T) { + var in C.git_merge_file_input + var opts *C.git_merge_file_options + C.git_merge_file(&in, opts) + + // Test that the generated type names are deterministic. + // (Previously this would fail about 10% of the time.) + // + // Brittle: the assertion may fail spuriously when the algorithm + // changes, but should remain stable otherwise. + got := fmt.Sprintf("%T %T", in, opts) + want := "issue9026._Ctype_struct___0 *issue9026._Ctype_struct___1" + if got != want { + t.Errorf("Non-deterministic type names: got %s, want %s", got, want) + } +} diff --git a/misc/cgo/test/issue9400/asm_386.s b/misc/cgo/test/issue9400/asm_386.s new file mode 100644 index 0000000000000000000000000000000000000000..e37a54f2af9591d0e76eaec495948fc0f900d190 --- /dev/null +++ b/misc/cgo/test/issue9400/asm_386.s @@ -0,0 +1,26 @@ +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build !gccgo + +#include "textflag.h" + +TEXT ·RewindAndSetgid(SB),NOSPLIT,$0-0 + // Rewind stack pointer so anything that happens on the stack + // will clobber the test pattern created by the caller + ADDL $(1024 * 8), SP + + // Ask signaller to setgid + MOVL $1, ·Baton(SB) + + // Wait for setgid completion +loop: + PAUSE + MOVL ·Baton(SB), AX + CMPL AX, $0 + JNE loop + + // Restore stack + SUBL $(1024 * 8), SP + RET diff --git a/misc/cgo/test/issue9400/asm_amd64x.s b/misc/cgo/test/issue9400/asm_amd64x.s new file mode 100644 index 0000000000000000000000000000000000000000..f09e95d4cf65a85e51e2a8b137fc868de53a8a74 --- /dev/null +++ b/misc/cgo/test/issue9400/asm_amd64x.s @@ -0,0 +1,27 @@ +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build amd64 amd64p32 +// +build !gccgo + +#include "textflag.h" + +TEXT ·RewindAndSetgid(SB),NOSPLIT,$0-0 + // Rewind stack pointer so anything that happens on the stack + // will clobber the test pattern created by the caller + ADDQ $(1024 * 8), SP + + // Ask signaller to setgid + MOVL $1, ·Baton(SB) + + // Wait for setgid completion +loop: + PAUSE + MOVL ·Baton(SB), AX + CMPL AX, $0 + JNE loop + + // Restore stack + SUBQ $(1024 * 8), SP + RET diff --git a/misc/cgo/test/issue9400/asm_arm.s b/misc/cgo/test/issue9400/asm_arm.s new file mode 100644 index 0000000000000000000000000000000000000000..5c5983d4c2020107aec81b41cb1fee5e3d6db331 --- /dev/null +++ b/misc/cgo/test/issue9400/asm_arm.s @@ -0,0 +1,39 @@ +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build !gccgo + +#include "textflag.h" + +TEXT cas<>(SB),NOSPLIT,$0 + MOVW $0xffff0fc0, R15 // R15 is PC + +TEXT ·RewindAndSetgid(SB),NOSPLIT,$-4-0 + // Save link register + MOVW R14, R4 + + // Rewind stack pointer so anything that happens on the stack + // will clobber the test pattern created by the caller + ADD $(1024 * 8), R13 + + // Ask signaller to setgid + MOVW $·Baton(SB), R2 +storeloop: + MOVW 0(R2), R0 + MOVW $1, R1 + BL cas<>(SB) + BCC storeloop + + // Wait for setgid completion +loop: + MOVW $0, R0 + MOVW $0, R1 + BL cas<>(SB) + BCC loop + + // Restore stack + SUB $(1024 * 8), R13 + + MOVW R4, R14 + RET diff --git a/misc/cgo/test/issue9400/asm_arm64.s b/misc/cgo/test/issue9400/asm_arm64.s new file mode 100644 index 0000000000000000000000000000000000000000..cba525f4c0d5fbc34eea11233f59106857ef69af --- /dev/null +++ b/misc/cgo/test/issue9400/asm_arm64.s @@ -0,0 +1,39 @@ +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build !gccgo + +#include "textflag.h" + +TEXT ·RewindAndSetgid(SB),NOSPLIT,$-8-0 + // Save link register + MOVD R30, R9 + + // Rewind stack pointer so anything that happens on the stack + // will clobber the test pattern created by the caller + ADD $(1024 * 8), RSP + + // Ask signaller to setgid + MOVD $·Baton(SB), R0 + MOVD $1, R1 +storeloop: + LDAXRW (R0), R2 + STLXRW R1, (R0), R3 + CBNZ R3, storeloop + + // Wait for setgid completion + MOVW $0, R1 + MOVW $0, R2 +loop: + LDAXRW (R0), R3 + CMPW R1, R3 + BNE loop + STLXRW R2, (R0), R3 + CBNZ R3, loop + + // Restore stack + SUB $(1024 * 8), RSP + + MOVD R9, R30 + RET diff --git a/misc/cgo/test/issue9400/asm_ppc64x.s b/misc/cgo/test/issue9400/asm_ppc64x.s new file mode 100644 index 0000000000000000000000000000000000000000..7dfe37e7c6e7b1abc42c12acf008856e306bf559 --- /dev/null +++ b/misc/cgo/test/issue9400/asm_ppc64x.s @@ -0,0 +1,32 @@ +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build ppc64 ppc64le +// +build !gccgo + +#include "textflag.h" + +TEXT ·RewindAndSetgid(SB),NOSPLIT,$-8-0 + // Rewind stack pointer so anything that happens on the stack + // will clobber the test pattern created by the caller + ADD $(1024 * 8), R1 + + // Ask signaller to setgid + MOVW $1, R3 + SYNC + MOVW R3, ·Baton(SB) + + // Wait for setgid completion +loop: + SYNC + MOVW ·Baton(SB), R3 + CMP R3, $0 + // Hint that we're in a spin loop + OR R1, R1, R1 + BNE loop + ISYNC + + // Restore stack + SUB $(1024 * 8), R1 + RET diff --git a/misc/cgo/test/issue9400/gccgo.go b/misc/cgo/test/issue9400/gccgo.go new file mode 100644 index 0000000000000000000000000000000000000000..6b9d5fa3a73396237a27e263489f356982b8f722 --- /dev/null +++ b/misc/cgo/test/issue9400/gccgo.go @@ -0,0 +1,24 @@ +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build gccgo + +package issue9400 + +import ( + "runtime" + "sync/atomic" +) + +// The test for the gc compiler resets the stack pointer so that the +// stack gets modified. We don't have a way to do that for gccgo +// without writing more assembly code, which we haven't bothered to +// do. So this is not much of a test. + +func RewindAndSetgid() { + atomic.StoreInt32(&Baton, 1) + for atomic.LoadInt32(&Baton) != 0 { + runtime.Gosched() + } +} diff --git a/misc/cgo/test/issue9400/stubs.go b/misc/cgo/test/issue9400/stubs.go new file mode 100644 index 0000000000000000000000000000000000000000..1dd8ccd333ae75a6f88854d57edd6c4fb2062b47 --- /dev/null +++ b/misc/cgo/test/issue9400/stubs.go @@ -0,0 +1,9 @@ +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package issue9400 + +var Baton int32 + +func RewindAndSetgid() diff --git a/misc/cgo/test/issue9400_linux.go b/misc/cgo/test/issue9400_linux.go new file mode 100644 index 0000000000000000000000000000000000000000..b3b4b7952c35cdfad08ab50ee38f2f899e4f12ec --- /dev/null +++ b/misc/cgo/test/issue9400_linux.go @@ -0,0 +1,58 @@ +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Test that SIGSETXID runs on signal stack, since it's likely to +// overflow if it runs on the Go stack. + +package cgotest + +/* +#include +#include +*/ +import "C" + +import ( + "runtime" + "sync/atomic" + "testing" + + "./issue9400" +) + +func test9400(t *testing.T) { + // We synchronize through a shared variable, so we need two procs + defer runtime.GOMAXPROCS(runtime.GOMAXPROCS(2)) + + // Start signaller + atomic.StoreInt32(&issue9400.Baton, 0) + go func() { + // Wait for RewindAndSetgid + for atomic.LoadInt32(&issue9400.Baton) == 0 { + runtime.Gosched() + } + // Broadcast SIGSETXID + runtime.LockOSThread() + C.setgid(0) + // Indicate that signalling is done + atomic.StoreInt32(&issue9400.Baton, 0) + }() + + // Grow the stack and put down a test pattern + const pattern = 0x123456789abcdef + var big [1024]uint64 // len must match assmebly + for i := range big { + big[i] = pattern + } + + // Temporarily rewind the stack and trigger SIGSETXID + issue9400.RewindAndSetgid() + + // Check test pattern + for i := range big { + if big[i] != pattern { + t.Fatalf("entry %d of test pattern is wrong; %#x != %#x", i, big[i], uint64(pattern)) + } + } +} diff --git a/misc/cgo/test/issue9557.go b/misc/cgo/test/issue9557.go new file mode 100644 index 0000000000000000000000000000000000000000..b29bacdfff4e5c2327fcb3c644ebd36f7b55e31d --- /dev/null +++ b/misc/cgo/test/issue9557.go @@ -0,0 +1,36 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// cgo rewrote C.var to *_Cvar_var, but left +// C.var.field as _Cvar.var.field. It now rewrites +// the latter as (*_Cvar_var).field. +// See https://golang.org/issue/9557. + +package cgotest + +// struct issue9557_t { +// int a; +// } test9557bar = { 42 }; +// +// struct issue9557_t *issue9557foo = &test9557bar; +import "C" +import "testing" + +func test9557(t *testing.T) { + // implicitly dereference a Go variable + foo := C.issue9557foo + if v := foo.a; v != 42 { + t.Fatalf("foo.a expected 42, but got %d", v) + } + + // explicitly dereference a C variable + if v := (*C.issue9557foo).a; v != 42 { + t.Fatalf("(*C.issue9557foo).a expected 42, but is %d", v) + } + + // implicitly dereference a C variable + if v := C.issue9557foo.a; v != 42 { + t.Fatalf("C.issue9557foo.a expected 42, but is %d", v) + } +} diff --git a/misc/cgo/test/setgid_linux.go b/misc/cgo/test/setgid_linux.go new file mode 100644 index 0000000000000000000000000000000000000000..197f01fb7e1366e260f187b9325d15baf4c4458d --- /dev/null +++ b/misc/cgo/test/setgid_linux.go @@ -0,0 +1,32 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Test that setgid does not hang on GNU/Linux. +// See https://golang.org/issue/3871 for details. + +package cgotest + +/* +#include +#include +*/ +import "C" + +import ( + "testing" + "time" +) + +func testSetgid(t *testing.T) { + c := make(chan bool) + go func() { + C.setgid(0) + c <- true + }() + select { + case <-c: + case <-time.After(5 * time.Second): + t.Error("setgid hung") + } +} diff --git a/misc/cgo/test/sigprocmask_linux.c b/misc/cgo/test/sigprocmask_linux.c new file mode 100644 index 0000000000000000000000000000000000000000..518c533fa4d31b7d0e9a08b7b0fc841e63172fb6 --- /dev/null +++ b/misc/cgo/test/sigprocmask_linux.c @@ -0,0 +1,36 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +#include +#include +#include +#include +#include + +extern void IntoGoAndBack(); + +int CheckBlocked() { + sigset_t mask; + sigprocmask(SIG_BLOCK, NULL, &mask); + return sigismember(&mask, SIGIO); +} + +static void* sigthreadfunc(void* unused) { + sigset_t mask; + sigemptyset(&mask); + sigaddset(&mask, SIGIO); + sigprocmask(SIG_BLOCK, &mask, NULL); + IntoGoAndBack(); + return NULL; +} + +int RunSigThread() { + pthread_t thread; + int r; + + r = pthread_create(&thread, NULL, &sigthreadfunc, NULL); + if (r != 0) + return r; + return pthread_join(thread, NULL); +} diff --git a/misc/cgo/test/sigprocmask_linux.go b/misc/cgo/test/sigprocmask_linux.go new file mode 100644 index 0000000000000000000000000000000000000000..7d343e92c458fdc6d24df48e0ced7a53ebd02247 --- /dev/null +++ b/misc/cgo/test/sigprocmask_linux.go @@ -0,0 +1,38 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package cgotest + +/* +#cgo CFLAGS: -pthread +#cgo LDFLAGS: -pthread +extern int RunSigThread(); +extern int CheckBlocked(); +*/ +import "C" +import ( + "os" + "os/signal" + "syscall" + "testing" +) + +var blocked bool + +//export IntoGoAndBack +func IntoGoAndBack() { + // Verify that SIGIO stays blocked on the C thread + // even when unblocked for signal.Notify(). + signal.Notify(make(chan os.Signal), syscall.SIGIO) + blocked = C.CheckBlocked() != 0 +} + +func testSigProcMask(t *testing.T) { + if r := C.RunSigThread(); r != 0 { + t.Error("pthread_create/pthread_join failed") + } + if !blocked { + t.Error("Go runtime unblocked SIGIO") + } +} diff --git a/misc/cgo/test/sleep_windows_386.go b/misc/cgo/test/sleep_windows_386.go new file mode 100644 index 0000000000000000000000000000000000000000..75687d7831aa41107b9842ef2c622de7cc841bf8 --- /dev/null +++ b/misc/cgo/test/sleep_windows_386.go @@ -0,0 +1,20 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package cgotest + +/* +// mingw32 on windows/386 provides usleep() but not sleep(), +// as we don't want to require all other OSes to provide usleep, +// we emulate sleep(int s) using win32 API Sleep(int ms). + +#include + +unsigned int sleep(unsigned int seconds) { + Sleep(1000 * seconds); + return 0; +} + +*/ +import "C" diff --git a/misc/cgo/testasan/main.go b/misc/cgo/testasan/main.go new file mode 100644 index 0000000000000000000000000000000000000000..1837c6cc81de34fc5f8d4552360fd834e6d750da --- /dev/null +++ b/misc/cgo/testasan/main.go @@ -0,0 +1,49 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +/* +#include +#include +#include + +void ctor(void) __attribute__((constructor)); +static void* thread(void*); + +void +ctor(void) +{ + // occupy memory where Go runtime would normally map heap + mmap((void*)0x00c000000000, 64<<10, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_FIXED, -1, 0); + + // allocate 4K every 10us + pthread_t t; + pthread_create(&t, 0, thread, 0); +} + +static void* +thread(void *p) +{ + for(;;) { + usleep(10000); + mmap(0, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0); + } + return 0; +} +*/ +import "C" + +import ( + "time" +) + +func main() { + // ensure that we can function normally + var v [][]byte + for i := 0; i < 1000; i++ { + time.Sleep(10 * time.Microsecond) + v = append(v, make([]byte, 64<<10)) + } +} diff --git a/misc/cgo/testcarchive/main.c b/misc/cgo/testcarchive/main.c new file mode 100644 index 0000000000000000000000000000000000000000..cc3170de89a21ec89a97e95692493720f280b69b --- /dev/null +++ b/misc/cgo/testcarchive/main.c @@ -0,0 +1,34 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +#include +#include + +#include "p.h" +#include "libgo.h" + +int main(void) { + int32_t res; + + if (!DidInitRun()) { + fprintf(stderr, "ERROR: buildmode=c-archive init should run\n"); + return 2; + } + + if (DidMainRun()) { + fprintf(stderr, "ERROR: buildmode=c-archive should not run main\n"); + return 2; + } + + res = FromPkg(); + if (res != 1024) { + fprintf(stderr, "ERROR: FromPkg()=%d, want 1024\n", res); + return 2; + } + + CheckArgs(); + + fprintf(stderr, "PASS\n"); + return 0; +} diff --git a/misc/cgo/testcarchive/src/libgo/libgo.go b/misc/cgo/testcarchive/src/libgo/libgo.go new file mode 100644 index 0000000000000000000000000000000000000000..45958a546cb0e4667fdb121077feb9a4b84a176d --- /dev/null +++ b/misc/cgo/testcarchive/src/libgo/libgo.go @@ -0,0 +1,53 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +import ( + "fmt" + "os" + "syscall" + "time" + + _ "p" +) + +import "C" + +var initCh = make(chan int, 1) +var ranMain bool + +func init() { + // emulate an exceedingly slow package initialization function + time.Sleep(100 * time.Millisecond) + initCh <- 42 +} + +func main() { ranMain = true } + +//export DidInitRun +func DidInitRun() bool { + select { + case x := <-initCh: + if x != 42 { + // Just in case initCh was not correctly made. + println("want init value of 42, got: ", x) + syscall.Exit(2) + } + return true + default: + return false + } +} + +//export DidMainRun +func DidMainRun() bool { return ranMain } + +//export CheckArgs +func CheckArgs() { + if len(os.Args) != 3 || os.Args[1] != "arg1" || os.Args[2] != "arg2" { + fmt.Printf("CheckArgs: want [_, arg1, arg2], got: %v\n", os.Args) + os.Exit(2) + } +} diff --git a/misc/cgo/testcarchive/src/p/p.go b/misc/cgo/testcarchive/src/p/p.go new file mode 100644 index 0000000000000000000000000000000000000000..82b445c12109cb3a01f3ec59a2534d5d97768a3e --- /dev/null +++ b/misc/cgo/testcarchive/src/p/p.go @@ -0,0 +1,10 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package p + +import "C" + +//export FromPkg +func FromPkg() int32 { return 1024 } diff --git a/misc/cgo/testcarchive/test.bash b/misc/cgo/testcarchive/test.bash new file mode 100755 index 0000000000000000000000000000000000000000..89b761bddbe7f09c8c01d68bf4fc063f6949b6f8 --- /dev/null +++ b/misc/cgo/testcarchive/test.bash @@ -0,0 +1,44 @@ +#!/usr/bin/env bash +# Copyright 2015 The Go Authors. All rights reserved. +# Use of this source code is governed by a BSD-style +# license that can be found in the LICENSE file. + +set -e + +ccargs= +if [ "$(go env GOOS)" == "darwin" ]; then + ccargs="-Wl,-no_pie" + # For darwin/arm. + # TODO(crawshaw): Can we do better? + ccargs="$ccargs -framework CoreFoundation -framework Foundation" +fi +ccargs="$ccargs -I pkg/$(go env GOOS)_$(go env GOARCH)" + +# TODO(crawshaw): Consider a go env for exec script name. +bin=./testp +exec_script=go_$(go env GOOS)_$(go env GOARCH)_exec +if [ "$(which $exec_script)" != "" ]; then + bin="$exec_script ./testp" +fi + +rm -rf libgo.a libgo.h testp pkg + +# Installing first will create the header files we want. + +GOPATH=$(pwd) go install -buildmode=c-archive libgo +$(go env CC) $(go env GOGCCFLAGS) $ccargs -o testp main.c pkg/$(go env GOOS)_$(go env GOARCH)/libgo.a +$bin arg1 arg2 +rm -f libgo.a libgo.h testp + +# Test building libgo other than installing it. +# Header files are now present. + +GOPATH=$(pwd) go build -buildmode=c-archive src/libgo/libgo.go +$(go env CC) $(go env GOGCCFLAGS) $ccargs -o testp main.c libgo.a +$bin arg1 arg2 +rm -f libgo.a libgo.h testp + +GOPATH=$(pwd) go build -buildmode=c-archive -o libgo.a libgo +$(go env CC) $(go env GOGCCFLAGS) $ccargs -o testp main.c libgo.a +$bin arg1 arg2 +rm -rf libgo.a libgo.h testp pkg diff --git a/misc/cgo/testcshared/main0.c b/misc/cgo/testcshared/main0.c new file mode 100644 index 0000000000000000000000000000000000000000..1274b8950ebef787ed16f8c7e487ad7a58af4cb5 --- /dev/null +++ b/misc/cgo/testcshared/main0.c @@ -0,0 +1,36 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +#include +#include + +#include "p.h" +#include "libgo.h" + +// Tests libgo.so to export the following functions. +// int8_t DidInitRun(); +// int8_t DidMainRun(); +// int32_t FromPkg(); +int main(void) { + int8_t ran_init = DidInitRun(); + if (!ran_init) { + fprintf(stderr, "ERROR: DidInitRun returned unexpected results: %d\n", + ran_init); + return 1; + } + int8_t ran_main = DidMainRun(); + if (ran_main) { + fprintf(stderr, "ERROR: DidMainRun returned unexpected results: %d\n", + ran_main); + return 1; + } + int32_t from_pkg = FromPkg(); + if (from_pkg != 1024) { + fprintf(stderr, "ERROR: FromPkg=%d, want %d\n", from_pkg, 1024); + return 1; + } + // test.bash looks for "PASS" to ensure this program has reached the end. + printf("PASS\n"); + return 0; +} diff --git a/misc/cgo/testcshared/main1.c b/misc/cgo/testcshared/main1.c new file mode 100644 index 0000000000000000000000000000000000000000..420dd1ea97459aa7cf26dd2a1d56e892a6d279f6 --- /dev/null +++ b/misc/cgo/testcshared/main1.c @@ -0,0 +1,69 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +#include +#include +#include + +int check_int8(void* handle, const char* fname, int8_t want) { + int8_t (*fn)(); + fn = (int8_t (*)())dlsym(handle, fname); + if (!fn) { + fprintf(stderr, "ERROR: missing %s: %s\n", fname, dlerror()); + return 1; + } + signed char ret = fn(); + if (ret != want) { + fprintf(stderr, "ERROR: %s=%d, want %d\n", fname, ret, want); + return 1; + } + return 0; +} + +int check_int32(void* handle, const char* fname, int32_t want) { + int32_t (*fn)(); + fn = (int32_t (*)())dlsym(handle, fname); + if (!fn) { + fprintf(stderr, "ERROR: missing %s: %s\n", fname, dlerror()); + return 1; + } + int32_t ret = fn(); + if (ret != want) { + fprintf(stderr, "ERROR: %s=%d, want %d\n", fname, ret, want); + return 1; + } + return 0; +} + +// Tests libgo.so to export the following functions. +// int8_t DidInitRun() // returns true +// int8_t DidMainRun() // returns true +// int32_t FromPkg() // returns 1024 +int main(int argc, char** argv) { + void* handle = dlopen(argv[1], RTLD_LAZY | RTLD_GLOBAL); + if (!handle) { + fprintf(stderr, "ERROR: failed to open the shared library: %s\n", + dlerror()); + return 2; + } + + int ret = 0; + ret = check_int8(handle, "DidInitRun", 1); + if (ret != 0) { + return ret; + } + + ret = check_int8(handle, "DidMainRun", 0); + if (ret != 0) { + return ret; + } + + ret = check_int32(handle, "FromPkg", 1024); + if (ret != 0) { + return ret; + } + // test.bash looks for "PASS" to ensure this program has reached the end. + printf("PASS\n"); + return 0; +} diff --git a/misc/cgo/testcshared/main2.c b/misc/cgo/testcshared/main2.c new file mode 100644 index 0000000000000000000000000000000000000000..402338339ff646054623f3856c6b87bfdbd5aac6 --- /dev/null +++ b/misc/cgo/testcshared/main2.c @@ -0,0 +1,56 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +#include +#include +#include +#include +#include +#include + +#define fd (10) + +// Tests libgo2.so, which does not export any functions. +// Read a string from the file descriptor and print it. +int main(void) { + int i; + ssize_t n; + char buf[20]; + struct timespec ts; + + // The descriptor will be initialized in a thread, so we have to + // give a chance to get opened. + for (i = 0; i < 100; i++) { + n = read(fd, buf, sizeof buf); + if (n >= 0) + break; + if (errno != EBADF) { + fprintf(stderr, "BUG: read: %s\n", strerror(errno)); + return 2; + } + + // An EBADF error means that the shared library has not opened the + // descriptor yet. + ts.tv_sec = 0; + ts.tv_nsec = 1000000; + nanosleep(&ts, NULL); + } + + if (n < 0) { + fprintf(stderr, "BUG: failed to read any data from pipe\n"); + return 2; + } + + if (n == 0) { + fprintf(stderr, "BUG: unexpected EOF\n"); + return 2; + } + + if (n == sizeof buf) { + n--; + } + buf[n] = '\0'; + printf("%s\n", buf); + return 0; +} diff --git a/misc/cgo/testcshared/main3.c b/misc/cgo/testcshared/main3.c new file mode 100644 index 0000000000000000000000000000000000000000..49cc0558a01a328b59959ba25724b6bcf5962dc3 --- /dev/null +++ b/misc/cgo/testcshared/main3.c @@ -0,0 +1,29 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +#include +#include +#include + +// Tests "main.main" is exported on android/arm, +// which golang.org/x/mobile/app depends on. +int main(int argc, char** argv) { + void* handle = dlopen(argv[1], RTLD_LAZY | RTLD_GLOBAL); + if (!handle) { + fprintf(stderr, "ERROR: failed to open the shared library: %s\n", + dlerror()); + return 2; + } + + uintptr_t main_fn = (uintptr_t)dlsym(handle, "main.main"); + if (!main_fn) { + fprintf(stderr, "ERROR: missing main.main: %s\n", dlerror()); + return 2; + } + + // TODO(hyangah): check that main.main can run. + + printf("PASS\n"); + return 0; +} diff --git a/misc/cgo/testcshared/src/libgo/libgo.go b/misc/cgo/testcshared/src/libgo/libgo.go new file mode 100644 index 0000000000000000000000000000000000000000..8a4bf795e9146586cf83da0140ab0579327773bd --- /dev/null +++ b/misc/cgo/testcshared/src/libgo/libgo.go @@ -0,0 +1,46 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +import ( + _ "p" + "syscall" + "time" +) + +import "C" + +var initCh = make(chan int, 1) +var ranMain bool + +func init() { + // emulate an exceedingly slow package initialization function + time.Sleep(100 * time.Millisecond) + initCh <- 42 +} + +func main() { + ranMain = true +} + +//export DidInitRun +func DidInitRun() bool { + select { + case x := <-initCh: + if x != 42 { + // Just in case initCh was not correctly made. + println("want init value of 42, got: ", x) + syscall.Exit(2) + } + return true + default: + return false + } +} + +//export DidMainRun +func DidMainRun() bool { + return ranMain +} diff --git a/misc/cgo/testcshared/src/libgo2/libgo2.go b/misc/cgo/testcshared/src/libgo2/libgo2.go new file mode 100644 index 0000000000000000000000000000000000000000..6096860d637986f2dc654697841a344416526e96 --- /dev/null +++ b/misc/cgo/testcshared/src/libgo2/libgo2.go @@ -0,0 +1,52 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build darwin dragonfly freebsd linux netbsd openbsd solaris + +package main + +// Test a shared library created by -buildmode=c-shared that does not +// export anything. + +import ( + "fmt" + "os" + "syscall" +) + +// To test this we want to communicate between the main program and +// the shared library without using any exported symbols. The init +// function creates a pipe and Dups the read end to a known number +// that the C code can also use. + +const ( + fd = 10 +) + +func init() { + var p [2]int + if e := syscall.Pipe(p[0:]); e != nil { + fmt.Fprintf(os.Stderr, "pipe: %v\n", e) + os.Exit(2) + } + + if e := syscall.Dup2(p[0], fd); e != nil { + fmt.Fprintf(os.Stderr, "dup2: %v\n", e) + os.Exit(2) + } + + const str = "PASS" + if n, e := syscall.Write(p[1], []byte(str)); e != nil || n != len(str) { + fmt.Fprintf(os.Stderr, "write: %d %v\n", n, e) + os.Exit(2) + } + + if e := syscall.Close(p[1]); e != nil { + fmt.Fprintf(os.Stderr, "close: %v\n", e) + os.Exit(2) + } +} + +func main() { +} diff --git a/misc/cgo/testcshared/src/p/p.go b/misc/cgo/testcshared/src/p/p.go new file mode 100644 index 0000000000000000000000000000000000000000..82b445c12109cb3a01f3ec59a2534d5d97768a3e --- /dev/null +++ b/misc/cgo/testcshared/src/p/p.go @@ -0,0 +1,10 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package p + +import "C" + +//export FromPkg +func FromPkg() int32 { return 1024 } diff --git a/misc/cgo/testcshared/test.bash b/misc/cgo/testcshared/test.bash new file mode 100755 index 0000000000000000000000000000000000000000..57221bc36d4a93dda0b5e678d4b510e9a27ba7c1 --- /dev/null +++ b/misc/cgo/testcshared/test.bash @@ -0,0 +1,129 @@ +#!/usr/bin/env bash +# Copyright 2015 The Go Authors. All rights reserved. +# Use of this source code is governed by a BSD-style +# license that can be found in the LICENSE file. + +# For testing Android, this script requires adb to push and run compiled +# binaries on a target device. + +set -e + +if [ ! -f src/libgo/libgo.go ]; then + cwd=$(pwd) + echo 'misc/cgo/testcshared/test.bash is running in $cwd' 1>&2 + exit 1 +fi + +goos=$(go env GOOS) +goarch=$(go env GOARCH) + +# Directory where cgo headers and outputs will be installed. +# The installation directory format varies depending on the platform. +installdir=pkg/${goos}_${goarch}_testcshared_shared +if [ "${goos}/${goarch}" == "android/arm" ] || [ "${goos}/${goarch}" == "darwin/amd64" ]; then + installdir=pkg/${goos}_${goarch}_testcshared +fi + +# Temporary directory on the android device. +androidpath=/data/local/tmp/testcshared-$$ + +function cleanup() { + rm -rf libgo.$libext libgo2.$libext libgo.h testp testp2 testp3 pkg + + rm -rf $(go env GOROOT)/${installdir} + + if [ "$goos" == "android" ]; then + adb shell rm -rf $androidpath + fi +} +trap cleanup EXIT + +if [ "$goos" == "android" ]; then + adb shell mkdir -p "$androidpath" +fi + +function run() { + case "$goos" in + "android") + local args=$@ + output=$(adb shell "cd ${androidpath}; $@") + output=$(echo $output|tr -d '\r') + case $output in + *PASS) echo "PASS";; + *) echo "$output";; + esac + ;; + *) + echo $(env $@) + ;; + esac +} + +function binpush() { + bin=${1} + if [ "$goos" == "android" ]; then + adb push "$bin" "${androidpath}/${bin}" 2>/dev/null + fi +} + +rm -rf pkg + +suffix="-installsuffix testcshared" + +libext="so" +if [ "$goos" == "darwin" ]; then + libext="dylib" +fi + +# Create the header files. +GOPATH=$(pwd) go install -buildmode=c-shared $suffix libgo + +GOPATH=$(pwd) go build -buildmode=c-shared $suffix -o libgo.$libext src/libgo/libgo.go +binpush libgo.$libext + +# test0: exported symbols in shared lib are accessible. +# TODO(iant): using _shared here shouldn't really be necessary. +$(go env CC) $(go env GOGCCFLAGS) -I ${installdir} -o testp main0.c libgo.$libext +binpush testp + +output=$(run LD_LIBRARY_PATH=. ./testp) +if [ "$output" != "PASS" ]; then + echo "FAIL test0 got ${output}" + exit 1 +fi + +# test1: shared library can be dynamically loaded and exported symbols are accessible. +$(go env CC) $(go env GOGCCFLAGS) -o testp main1.c -ldl +binpush testp +output=$(run ./testp ./libgo.$libext) +if [ "$output" != "PASS" ]; then + echo "FAIL test1 got ${output}" + exit 1 +fi + +# test2: tests libgo2 which does not export any functions. +GOPATH=$(pwd) go build -buildmode=c-shared $suffix -o libgo2.$libext src/libgo2/libgo2.go +binpush libgo2.$libext +linkflags="-Wl,--no-as-needed" +if [ "$goos" == "darwin" ]; then + linkflags="" +fi +$(go env CC) $(go env GOGCCFLAGS) -o testp2 main2.c $linkflags libgo2.$libext +binpush testp2 +output=$(run LD_LIBRARY_PATH=. ./testp2) +if [ "$output" != "PASS" ]; then + echo "FAIL test2 got ${output}" + exit 1 +fi + +# test3: tests main.main is exported on android. +if [ "$goos" == "android" ]; then + $(go env CC) $(go env GOGCCFLAGS) -o testp3 main3.c -ldl + binpush testp3 + output=$(run ./testp ./libgo.so) + if [ "$output" != "PASS" ]; then + echo "FAIL test3 got ${output}" + exit 1 + fi +fi +echo "ok" diff --git a/misc/cgo/testgodefs/anonunion.go b/misc/cgo/testgodefs/anonunion.go new file mode 100644 index 0000000000000000000000000000000000000000..7bc736b9d1127b3fe4b6825e53159ac36672d676 --- /dev/null +++ b/misc/cgo/testgodefs/anonunion.go @@ -0,0 +1,26 @@ +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. +// +// +build ignore + +package main + +// This file tests that when cgo -godefs sees a struct with a field +// that is an anonymous union, the first field in the union is +// promoted to become a field of the struct. See issue 6677 for +// background. + +/* +typedef struct { + union { + long l; + int c; + }; +} t; +*/ +import "C" + +// Input for cgo -godefs. + +type T C.t diff --git a/misc/cgo/testgodefs/issue8478.go b/misc/cgo/testgodefs/issue8478.go new file mode 100644 index 0000000000000000000000000000000000000000..92258fde7250ee9143b6acc2410a54850414ba70 --- /dev/null +++ b/misc/cgo/testgodefs/issue8478.go @@ -0,0 +1,20 @@ +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. +// +// +build ignore + +package main + +// Issue 8478. Test that void* is consistently mapped to *byte. + +/* +typedef struct { + void *p; + void **q; + void ***r; +} s; +*/ +import "C" + +type Issue8478 C.s diff --git a/misc/cgo/testgodefs/main.go b/misc/cgo/testgodefs/main.go new file mode 100644 index 0000000000000000000000000000000000000000..7faccf2654ab87da8fee7c478f7e404c8f02bd4e --- /dev/null +++ b/misc/cgo/testgodefs/main.go @@ -0,0 +1,15 @@ +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +// Test that the struct field in anonunion.go was promoted. +var v1 T +var v2 = v1.L + +// Test that P, Q, and R all point to byte. +var v3 = Issue8478{P: (*byte)(nil), Q: (**byte)(nil), R: (***byte)(nil)} + +func main() { +} diff --git a/misc/cgo/testgodefs/test.bash b/misc/cgo/testgodefs/test.bash new file mode 100755 index 0000000000000000000000000000000000000000..14235c05cb46ecb8e3c4cc3726a5935bad1ed0a9 --- /dev/null +++ b/misc/cgo/testgodefs/test.bash @@ -0,0 +1,22 @@ +#!/usr/bin/env bash + +# Copyright 2014 The Go Authors. All rights reserved. +# Use of this source code is governed by a BSD-style +# license that can be found in the LICENSE file. + +# We are testing cgo -godefs, which translates Go files that use +# import "C" into Go files with Go definitions of types defined in the +# import "C" block. Add more tests here. +FILE_PREFIXES="anonunion issue8478" + +RM= +for FP in $FILE_PREFIXES +do + go tool cgo -godefs ${FP}.go > ${FP}_defs.go + RM="${RM} ${FP}_defs.go" +done + +go build . && ./testgodefs +EXIT=$? +rm -rf _obj testgodefs ${RM} +exit $EXIT diff --git a/misc/cgo/testshared/shared_test.go b/misc/cgo/testshared/shared_test.go new file mode 100644 index 0000000000000000000000000000000000000000..6ef448c4f2759417fb632009f8d85f3478b75291 --- /dev/null +++ b/misc/cgo/testshared/shared_test.go @@ -0,0 +1,674 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package shared_test + +import ( + "bufio" + "bytes" + "debug/elf" + "encoding/binary" + "errors" + "flag" + "fmt" + "go/build" + "io" + "io/ioutil" + "log" + "math/rand" + "os" + "os/exec" + "path/filepath" + "regexp" + "strings" + "testing" + "time" +) + +var gopathInstallDir, gorootInstallDir, suffix string + +// This is the smallest set of packages we can link into a shared +// library (runtime/cgo is built implicitly). +var minpkgs = []string{"runtime", "sync/atomic"} +var soname = "libruntime,sync-atomic.so" + +// run runs a command and calls t.Errorf if it fails. +func run(t *testing.T, msg string, args ...string) { + c := exec.Command(args[0], args[1:]...) + if output, err := c.CombinedOutput(); err != nil { + t.Errorf("executing %s (%s) failed %s:\n%s", strings.Join(args, " "), msg, err, output) + } +} + +// goCmd invokes the go tool with the installsuffix set up by TestMain. It calls +// t.Errorf if the command fails. +func goCmd(t *testing.T, args ...string) { + newargs := []string{args[0], "-installsuffix=" + suffix} + if testing.Verbose() { + newargs = append(newargs, "-v") + } + newargs = append(newargs, args[1:]...) + c := exec.Command("go", newargs...) + var output []byte + var err error + if testing.Verbose() { + fmt.Printf("+ go %s\n", strings.Join(newargs, " ")) + c.Stdout = os.Stdout + c.Stderr = os.Stderr + err = c.Run() + } else { + output, err = c.CombinedOutput() + } + if err != nil { + if t != nil { + t.Errorf("executing %s failed %v:\n%s", strings.Join(c.Args, " "), err, output) + } else { + log.Fatalf("executing %s failed %v:\n%s", strings.Join(c.Args, " "), err, output) + } + } +} + +// TestMain calls testMain so that the latter can use defer (TestMain exits with os.Exit). +func testMain(m *testing.M) (int, error) { + // Because go install -buildmode=shared $standard_library_package always + // installs into $GOROOT, here are some gymnastics to come up with a unique + // installsuffix to use in this test that we can clean up afterwards. + myContext := build.Default + runtimeP, err := myContext.Import("runtime", ".", build.ImportComment) + if err != nil { + return 0, fmt.Errorf("import failed: %v", err) + } + for i := 0; i < 10000; i++ { + try := fmt.Sprintf("%s_%d_dynlink", runtimeP.PkgTargetRoot, rand.Int63()) + err = os.Mkdir(try, 0700) + if os.IsExist(err) { + continue + } + if err == nil { + gorootInstallDir = try + } + break + } + if err != nil { + return 0, fmt.Errorf("can't create temporary directory: %v", err) + } + if gorootInstallDir == "" { + return 0, errors.New("could not create temporary directory after 10000 tries") + } + defer os.RemoveAll(gorootInstallDir) + + // Some tests need to edit the source in GOPATH, so copy this directory to a + // temporary directory and chdir to that. + scratchDir, err := ioutil.TempDir("", "testshared") + if err != nil { + return 0, fmt.Errorf("TempDir failed: %v", err) + } + defer os.RemoveAll(scratchDir) + err = filepath.Walk(".", func(path string, info os.FileInfo, err error) error { + scratchPath := filepath.Join(scratchDir, path) + if info.IsDir() { + if path == "." { + return nil + } + return os.Mkdir(scratchPath, info.Mode()) + } else { + fromBytes, err := ioutil.ReadFile(path) + if err != nil { + return err + } + return ioutil.WriteFile(scratchPath, fromBytes, info.Mode()) + } + }) + if err != nil { + return 0, fmt.Errorf("walk failed: %v", err) + } + os.Setenv("GOPATH", scratchDir) + myContext.GOPATH = scratchDir + os.Chdir(scratchDir) + + // All tests depend on runtime being built into a shared library. Because + // that takes a few seconds, do it here and have all tests use the version + // built here. + suffix = strings.Split(filepath.Base(gorootInstallDir), "_")[2] + goCmd(nil, append([]string{"install", "-buildmode=shared"}, minpkgs...)...) + + myContext.InstallSuffix = suffix + "_dynlink" + depP, err := myContext.Import("dep", ".", build.ImportComment) + if err != nil { + return 0, fmt.Errorf("import failed: %v", err) + } + gopathInstallDir = depP.PkgTargetRoot + return m.Run(), nil +} + +func TestMain(m *testing.M) { + // Some of the tests install binaries into a custom GOPATH. + // That won't work if GOBIN is set. + os.Unsetenv("GOBIN") + + flag.Parse() + exitCode, err := testMain(m) + if err != nil { + log.Fatal(err) + } + os.Exit(exitCode) +} + +// The shared library was built at the expected location. +func TestSOBuilt(t *testing.T) { + _, err := os.Stat(filepath.Join(gorootInstallDir, soname)) + if err != nil { + t.Error(err) + } +} + +// The install command should have created a "shlibname" file for the +// listed packages (and runtime/cgo) indicating the name of the shared +// library containing it. +func TestShlibnameFiles(t *testing.T) { + pkgs := append([]string{}, minpkgs...) + pkgs = append(pkgs, "runtime/cgo") + for _, pkg := range pkgs { + shlibnamefile := filepath.Join(gorootInstallDir, pkg+".shlibname") + contentsb, err := ioutil.ReadFile(shlibnamefile) + if err != nil { + t.Errorf("error reading shlibnamefile for %s: %v", pkg, err) + continue + } + contents := strings.TrimSpace(string(contentsb)) + if contents != soname { + t.Errorf("shlibnamefile for %s has wrong contents: %q", pkg, contents) + } + } +} + +// Is a given offset into the file contained in a loaded segment? +func isOffsetLoaded(f *elf.File, offset uint64) bool { + for _, prog := range f.Progs { + if prog.Type == elf.PT_LOAD { + if prog.Off <= offset && offset < prog.Off+prog.Filesz { + return true + } + } + } + return false +} + +func rnd(v int32, r int32) int32 { + if r <= 0 { + return v + } + v += r - 1 + c := v % r + if c < 0 { + c += r + } + v -= c + return v +} + +func readwithpad(r io.Reader, sz int32) ([]byte, error) { + data := make([]byte, rnd(sz, 4)) + _, err := io.ReadFull(r, data) + if err != nil { + return nil, err + } + data = data[:sz] + return data, nil +} + +type note struct { + name string + tag int32 + desc string + section *elf.Section +} + +// Read all notes from f. As ELF section names are not supposed to be special, one +// looks for a particular note by scanning all SHT_NOTE sections looking for a note +// with a particular "name" and "tag". +func readNotes(f *elf.File) ([]*note, error) { + var notes []*note + for _, sect := range f.Sections { + if sect.Type != elf.SHT_NOTE { + continue + } + r := sect.Open() + for { + var namesize, descsize, tag int32 + err := binary.Read(r, f.ByteOrder, &namesize) + if err != nil { + if err == io.EOF { + break + } + return nil, fmt.Errorf("read namesize failed:", err) + } + err = binary.Read(r, f.ByteOrder, &descsize) + if err != nil { + return nil, fmt.Errorf("read descsize failed:", err) + } + err = binary.Read(r, f.ByteOrder, &tag) + if err != nil { + return nil, fmt.Errorf("read type failed:", err) + } + name, err := readwithpad(r, namesize) + if err != nil { + return nil, fmt.Errorf("read name failed:", err) + } + desc, err := readwithpad(r, descsize) + if err != nil { + return nil, fmt.Errorf("read desc failed:", err) + } + notes = append(notes, ¬e{name: string(name), tag: tag, desc: string(desc), section: sect}) + } + } + return notes, nil +} + +func dynStrings(path string, flag elf.DynTag) []string { + f, err := elf.Open(path) + defer f.Close() + if err != nil { + log.Fatal("elf.Open failed: ", err) + } + dynstrings, err := f.DynString(flag) + if err != nil { + log.Fatal("dynstring failed: ", err) + } + return dynstrings +} + +func AssertIsLinkedToRegexp(t *testing.T, path string, re *regexp.Regexp) { + for _, dynstring := range dynStrings(path, elf.DT_NEEDED) { + if re.MatchString(dynstring) { + return + } + } + t.Errorf("%s is not linked to anything matching %v", path, re) +} + +func AssertIsLinkedTo(t *testing.T, path, lib string) { + AssertIsLinkedToRegexp(t, path, regexp.MustCompile(regexp.QuoteMeta(lib))) +} + +func AssertHasRPath(t *testing.T, path, dir string) { + for _, tag := range []elf.DynTag{elf.DT_RPATH, elf.DT_RUNPATH} { + for _, dynstring := range dynStrings(path, tag) { + for _, rpath := range strings.Split(dynstring, ":") { + if filepath.Clean(rpath) == filepath.Clean(dir) { + return + } + } + } + } + t.Errorf("%s does not have rpath %s", path, dir) +} + +// Build a trivial program that links against the shared runtime and check it runs. +func TestTrivialExecutable(t *testing.T) { + goCmd(t, "install", "-linkshared", "trivial") + run(t, "trivial executable", "./bin/trivial") + AssertIsLinkedTo(t, "./bin/trivial", soname) + AssertHasRPath(t, "./bin/trivial", gorootInstallDir) +} + +// Build an executable that uses cgo linked against the shared runtime and check it +// runs. +func TestCgoExecutable(t *testing.T) { + goCmd(t, "install", "-linkshared", "execgo") + run(t, "cgo executable", "./bin/execgo") +} + +// Build a GOPATH package into a shared library that links against the goroot runtime +// and an executable that links against both. +func TestGopathShlib(t *testing.T) { + goCmd(t, "install", "-buildmode=shared", "-linkshared", "dep") + AssertIsLinkedTo(t, filepath.Join(gopathInstallDir, "libdep.so"), soname) + goCmd(t, "install", "-linkshared", "exe") + AssertIsLinkedTo(t, "./bin/exe", soname) + AssertIsLinkedTo(t, "./bin/exe", "libdep.so") + AssertHasRPath(t, "./bin/exe", gorootInstallDir) + AssertHasRPath(t, "./bin/exe", gopathInstallDir) + // And check it runs. + run(t, "executable linked to GOPATH library", "./bin/exe") +} + +// The shared library contains a note listing the packages it contains in a section +// that is not mapped into memory. +func testPkgListNote(t *testing.T, f *elf.File, note *note) { + if note.section.Flags != 0 { + t.Errorf("package list section has flags %v", note.section.Flags) + } + if isOffsetLoaded(f, note.section.Offset) { + t.Errorf("package list section contained in PT_LOAD segment") + } + if note.desc != "dep\n" { + t.Errorf("incorrect package list %q", note.desc) + } +} + +// The shared library contains a note containing the ABI hash that is mapped into +// memory and there is a local symbol called go.link.abihashbytes that points 16 +// bytes into it. +func testABIHashNote(t *testing.T, f *elf.File, note *note) { + if note.section.Flags != elf.SHF_ALLOC { + t.Errorf("abi hash section has flags %v", note.section.Flags) + } + if !isOffsetLoaded(f, note.section.Offset) { + t.Errorf("abihash section not contained in PT_LOAD segment") + } + var hashbytes elf.Symbol + symbols, err := f.Symbols() + if err != nil { + t.Errorf("error reading symbols %v", err) + return + } + for _, sym := range symbols { + if sym.Name == "go.link.abihashbytes" { + hashbytes = sym + } + } + if hashbytes.Name == "" { + t.Errorf("no symbol called go.link.abihashbytes") + return + } + if elf.ST_BIND(hashbytes.Info) != elf.STB_LOCAL { + t.Errorf("%s has incorrect binding %v", hashbytes.Name, elf.ST_BIND(hashbytes.Info)) + } + if f.Sections[hashbytes.Section] != note.section { + t.Errorf("%s has incorrect section %v", hashbytes.Name, f.Sections[hashbytes.Section].Name) + } + if hashbytes.Value-note.section.Addr != 16 { + t.Errorf("%s has incorrect offset into section %d", hashbytes.Name, hashbytes.Value-note.section.Addr) + } +} + +// A Go shared library contains a note indicating which other Go shared libraries it +// was linked against in an unmapped section. +func testDepsNote(t *testing.T, f *elf.File, note *note) { + if note.section.Flags != 0 { + t.Errorf("package list section has flags %v", note.section.Flags) + } + if isOffsetLoaded(f, note.section.Offset) { + t.Errorf("package list section contained in PT_LOAD segment") + } + // libdep.so just links against the lib containing the runtime. + if note.desc != soname { + t.Errorf("incorrect dependency list %q", note.desc) + } +} + +// The shared library contains notes with defined contents; see above. +func TestNotes(t *testing.T) { + goCmd(t, "install", "-buildmode=shared", "-linkshared", "dep") + f, err := elf.Open(filepath.Join(gopathInstallDir, "libdep.so")) + if err != nil { + t.Fatal(err) + } + defer f.Close() + notes, err := readNotes(f) + if err != nil { + t.Fatal(err) + } + pkgListNoteFound := false + abiHashNoteFound := false + depsNoteFound := false + for _, note := range notes { + if note.name != "Go\x00\x00" { + continue + } + switch note.tag { + case 1: // ELF_NOTE_GOPKGLIST_TAG + if pkgListNoteFound { + t.Error("multiple package list notes") + } + testPkgListNote(t, f, note) + pkgListNoteFound = true + case 2: // ELF_NOTE_GOABIHASH_TAG + if abiHashNoteFound { + t.Error("multiple abi hash notes") + } + testABIHashNote(t, f, note) + abiHashNoteFound = true + case 3: // ELF_NOTE_GODEPS_TAG + if depsNoteFound { + t.Error("multiple abi hash notes") + } + testDepsNote(t, f, note) + depsNoteFound = true + } + } + if !pkgListNoteFound { + t.Error("package list note not found") + } + if !abiHashNoteFound { + t.Error("abi hash note not found") + } + if !depsNoteFound { + t.Error("deps note not found") + } +} + +// Build a GOPATH package (dep) into a shared library that links against the goroot +// runtime, another package (dep2) that links against the first, and and an +// executable that links against dep2. +func TestTwoGopathShlibs(t *testing.T) { + goCmd(t, "install", "-buildmode=shared", "-linkshared", "dep") + goCmd(t, "install", "-buildmode=shared", "-linkshared", "dep2") + goCmd(t, "install", "-linkshared", "exe2") + run(t, "executable linked to GOPATH library", "./bin/exe2") +} + +// Build a GOPATH package into a shared library with gccgo and an executable that +// links against it. +func TestGoPathShlibGccgo(t *testing.T) { + gccgoName := os.Getenv("GCCGO") + if gccgoName == "" { + gccgoName = "gccgo" + } + _, err := exec.LookPath(gccgoName) + if err != nil { + t.Skip("gccgo not found") + } + + libgoRE := regexp.MustCompile("libgo.so.[0-9]+") + + gccgoContext := build.Default + gccgoContext.InstallSuffix = suffix + "_fPIC" + gccgoContext.Compiler = "gccgo" + gccgoContext.GOPATH = os.Getenv("GOPATH") + depP, err := gccgoContext.Import("dep", ".", build.ImportComment) + if err != nil { + t.Fatalf("import failed: %v", err) + } + gccgoInstallDir := filepath.Join(depP.PkgTargetRoot, "shlibs") + goCmd(t, "install", "-compiler=gccgo", "-buildmode=shared", "-linkshared", "dep") + AssertIsLinkedToRegexp(t, filepath.Join(gccgoInstallDir, "libdep.so"), libgoRE) + goCmd(t, "install", "-compiler=gccgo", "-linkshared", "exe") + AssertIsLinkedToRegexp(t, "./bin/exe", libgoRE) + AssertIsLinkedTo(t, "./bin/exe", "libdep.so") + AssertHasRPath(t, "./bin/exe", gccgoInstallDir) + // And check it runs. + run(t, "gccgo-built", "./bin/exe") +} + +// The gccgo version of TestTwoGopathShlibs: build a GOPATH package into a shared +// library with gccgo, another GOPATH package that depends on the first and an +// executable that links the second library. +func TestTwoGopathShlibsGccgo(t *testing.T) { + gccgoName := os.Getenv("GCCGO") + if gccgoName == "" { + gccgoName = "gccgo" + } + _, err := exec.LookPath(gccgoName) + if err != nil { + t.Skip("gccgo not found") + } + + libgoRE := regexp.MustCompile("libgo.so.[0-9]+") + + gccgoContext := build.Default + gccgoContext.InstallSuffix = suffix + "_fPIC" + gccgoContext.Compiler = "gccgo" + gccgoContext.GOPATH = os.Getenv("GOPATH") + depP, err := gccgoContext.Import("dep", ".", build.ImportComment) + if err != nil { + t.Fatalf("import failed: %v", err) + } + gccgoInstallDir := filepath.Join(depP.PkgTargetRoot, "shlibs") + goCmd(t, "install", "-compiler=gccgo", "-buildmode=shared", "-linkshared", "dep") + goCmd(t, "install", "-compiler=gccgo", "-buildmode=shared", "-linkshared", "dep2") + goCmd(t, "install", "-compiler=gccgo", "-linkshared", "exe2") + + AssertIsLinkedToRegexp(t, filepath.Join(gccgoInstallDir, "libdep.so"), libgoRE) + AssertIsLinkedToRegexp(t, filepath.Join(gccgoInstallDir, "libdep2.so"), libgoRE) + AssertIsLinkedTo(t, filepath.Join(gccgoInstallDir, "libdep2.so"), "libdep.so") + AssertIsLinkedToRegexp(t, "./bin/exe2", libgoRE) + AssertIsLinkedTo(t, "./bin/exe2", "libdep2") + AssertIsLinkedTo(t, "./bin/exe2", "libdep.so") + + // And check it runs. + run(t, "gccgo-built", "./bin/exe2") +} + +// Testing rebuilding of shared libraries when they are stale is a bit more +// complicated that it seems like it should be. First, we make everything "old": but +// only a few seconds old, or it might be older than gc (or the runtime source) and +// everything will get rebuilt. Then define a timestamp slightly newer than this +// time, which is what we set the mtime to of a file to cause it to be seen as new, +// and finally another slightly even newer one that we can compare files against to +// see if they have been rebuilt. +var oldTime = time.Now().Add(-9 * time.Second) +var nearlyNew = time.Now().Add(-6 * time.Second) +var stampTime = time.Now().Add(-3 * time.Second) + +// resetFileStamps makes "everything" (bin, src, pkg from GOPATH and the +// test-specific parts of GOROOT) appear old. +func resetFileStamps() { + chtime := func(path string, info os.FileInfo, err error) error { + return os.Chtimes(path, oldTime, oldTime) + } + reset := func(path string) { + if err := filepath.Walk(path, chtime); err != nil { + log.Fatalf("resetFileStamps failed: %v", err) + } + + } + reset("bin") + reset("pkg") + reset("src") + reset(gorootInstallDir) +} + +// touch makes path newer than the "old" time stamp used by resetFileStamps. +func touch(path string) { + if err := os.Chtimes(path, nearlyNew, nearlyNew); err != nil { + log.Fatalf("os.Chtimes failed: %v", err) + } +} + +// isNew returns if the path is newer than the time stamp used by touch. +func isNew(path string) bool { + fi, err := os.Stat(path) + if err != nil { + log.Fatalf("os.Stat failed: %v", err) + } + return fi.ModTime().After(stampTime) +} + +// Fail unless path has been rebuilt (i.e. is newer than the time stamp used by +// isNew) +func AssertRebuilt(t *testing.T, msg, path string) { + if !isNew(path) { + t.Errorf("%s was not rebuilt (%s)", msg, path) + } +} + +// Fail if path has been rebuilt (i.e. is newer than the time stamp used by isNew) +func AssertNotRebuilt(t *testing.T, msg, path string) { + if isNew(path) { + t.Errorf("%s was rebuilt (%s)", msg, path) + } +} + +func TestRebuilding(t *testing.T) { + goCmd(t, "install", "-buildmode=shared", "-linkshared", "dep") + goCmd(t, "install", "-linkshared", "exe") + + // If the source is newer than both the .a file and the .so, both are rebuilt. + resetFileStamps() + touch("src/dep/dep.go") + goCmd(t, "install", "-linkshared", "exe") + AssertRebuilt(t, "new source", filepath.Join(gopathInstallDir, "dep.a")) + AssertRebuilt(t, "new source", filepath.Join(gopathInstallDir, "libdep.so")) + + // If the .a file is newer than the .so, the .so is rebuilt (but not the .a) + resetFileStamps() + touch(filepath.Join(gopathInstallDir, "dep.a")) + goCmd(t, "install", "-linkshared", "exe") + AssertNotRebuilt(t, "new .a file", filepath.Join(gopathInstallDir, "dep.a")) + AssertRebuilt(t, "new .a file", filepath.Join(gopathInstallDir, "libdep.so")) +} + +func appendFile(path, content string) { + f, err := os.OpenFile(path, os.O_WRONLY|os.O_APPEND, 0660) + if err != nil { + log.Fatalf("os.OpenFile failed: %v", err) + } + defer func() { + err := f.Close() + if err != nil { + log.Fatalf("f.Close failed: %v", err) + } + }() + _, err = f.WriteString(content) + if err != nil { + log.Fatalf("f.WriteString failed: %v", err) + } +} + +func TestABIChecking(t *testing.T) { + goCmd(t, "install", "-buildmode=shared", "-linkshared", "dep") + goCmd(t, "install", "-linkshared", "exe") + + // If we make an ABI-breaking change to dep and rebuild libp.so but not exe, + // exe will abort with a complaint on startup. + // This assumes adding an exported function breaks ABI, which is not true in + // some senses but suffices for the narrow definition of ABI compatiblity the + // toolchain uses today. + resetFileStamps() + appendFile("src/dep/dep.go", "func ABIBreak() {}\n") + goCmd(t, "install", "-buildmode=shared", "-linkshared", "dep") + c := exec.Command("./bin/exe") + output, err := c.CombinedOutput() + if err == nil { + t.Fatal("executing exe did not fail after ABI break") + } + scanner := bufio.NewScanner(bytes.NewReader(output)) + foundMsg := false + const wantLine = "abi mismatch detected between the executable and libdep.so" + for scanner.Scan() { + if scanner.Text() == wantLine { + foundMsg = true + break + } + } + if err = scanner.Err(); err != nil { + t.Errorf("scanner encountered error: %v", err) + } + if !foundMsg { + t.Fatalf("exe failed, but without line %q; got output:\n%s", wantLine, output) + } + + // Rebuilding exe makes it work again. + goCmd(t, "install", "-linkshared", "exe") + run(t, "rebuilt exe", "./bin/exe") + + // If we make a change which does not break ABI (such as adding an unexported + // function) and rebuild libdep.so, exe still works. + resetFileStamps() + appendFile("src/dep/dep.go", "func noABIBreak() {}\n") + goCmd(t, "install", "-buildmode=shared", "-linkshared", "dep") + run(t, "after non-ABI breaking change", "./bin/exe") +} diff --git a/misc/cgo/testshared/src/dep/asm.s b/misc/cgo/testshared/src/dep/asm.s new file mode 100644 index 0000000000000000000000000000000000000000..8069ebb7497a113e255557fd88ec23acbeabfc58 --- /dev/null +++ b/misc/cgo/testshared/src/dep/asm.s @@ -0,0 +1,10 @@ +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//+build !gccgo + +#include "textflag.h" + +TEXT ·ImplementedInAsm(SB),NOSPLIT,$0-0 + RET diff --git a/misc/cgo/testshared/src/dep/dep.go b/misc/cgo/testshared/src/dep/dep.go new file mode 100644 index 0000000000000000000000000000000000000000..d3bed3f8ff501c409fb1f468406e08dc49071a8a --- /dev/null +++ b/misc/cgo/testshared/src/dep/dep.go @@ -0,0 +1,13 @@ +package dep + +var V int = 1 + +var HasMask []string = []string{"hi"} + +type HasProg struct { + array [1024]*byte +} + +func F() int { + return V +} diff --git a/misc/cgo/testshared/src/dep/gccgo.go b/misc/cgo/testshared/src/dep/gccgo.go new file mode 100644 index 0000000000000000000000000000000000000000..552ec303faf92dea8576af4ec78559c65ffd7da4 --- /dev/null +++ b/misc/cgo/testshared/src/dep/gccgo.go @@ -0,0 +1,5 @@ +//+build gccgo + +package dep + +func ImplementedInAsm() {} diff --git a/misc/cgo/testshared/src/dep/stubs.go b/misc/cgo/testshared/src/dep/stubs.go new file mode 100644 index 0000000000000000000000000000000000000000..036296a2fc67725deb7710e043ad3efae7c0eb8b --- /dev/null +++ b/misc/cgo/testshared/src/dep/stubs.go @@ -0,0 +1,5 @@ +//+build !gccgo + +package dep + +func ImplementedInAsm() diff --git a/misc/cgo/testshared/src/dep2/dep2.go b/misc/cgo/testshared/src/dep2/dep2.go new file mode 100644 index 0000000000000000000000000000000000000000..bac1086a4a6760fd19419e613094be989492a70d --- /dev/null +++ b/misc/cgo/testshared/src/dep2/dep2.go @@ -0,0 +1,11 @@ +package dep2 + +import "dep" + +var W int = 1 + +var hasProg dep.HasProg + +func G() int { + return dep.F() + 1 +} diff --git a/misc/cgo/testshared/src/exe/exe.go b/misc/cgo/testshared/src/exe/exe.go new file mode 100644 index 0000000000000000000000000000000000000000..f64477613a853c74664e190b05c60fa377a42a0d --- /dev/null +++ b/misc/cgo/testshared/src/exe/exe.go @@ -0,0 +1,12 @@ +package main + +import ( + "dep" + "runtime" +) + +func main() { + defer dep.ImplementedInAsm() + runtime.GC() + dep.V = dep.F() + 1 +} diff --git a/misc/cgo/testshared/src/exe2/exe2.go b/misc/cgo/testshared/src/exe2/exe2.go new file mode 100644 index 0000000000000000000000000000000000000000..acdb4ddcc569012649584b2bddbd3f80a07285b4 --- /dev/null +++ b/misc/cgo/testshared/src/exe2/exe2.go @@ -0,0 +1,7 @@ +package main + +import "dep2" + +func main() { + dep2.W = dep2.G() + 1 +} diff --git a/misc/cgo/testshared/src/execgo/exe.go b/misc/cgo/testshared/src/execgo/exe.go new file mode 100644 index 0000000000000000000000000000000000000000..0427be8bdfdfcb18d00ffe0b0e69a674a091aa62 --- /dev/null +++ b/misc/cgo/testshared/src/execgo/exe.go @@ -0,0 +1,8 @@ +package main + +/* + */ +import "C" + +func main() { +} diff --git a/misc/cgo/testshared/src/trivial/trivial.go b/misc/cgo/testshared/src/trivial/trivial.go new file mode 100644 index 0000000000000000000000000000000000000000..da29a2cadf1e00b14b1a4bd0a52780888bf3e532 --- /dev/null +++ b/misc/cgo/testshared/src/trivial/trivial.go @@ -0,0 +1,4 @@ +package main + +func main() { +} diff --git a/misc/cgo/testsigfwd/main.go b/misc/cgo/testsigfwd/main.go new file mode 100644 index 0000000000000000000000000000000000000000..6641c9d4ee0cd413f2d6374e64720fe5dbf0576c --- /dev/null +++ b/misc/cgo/testsigfwd/main.go @@ -0,0 +1,58 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +import "fmt" + +/* +#include +#include +#include + +int *p; +static void sigsegv() { + *p = 1; + fprintf(stderr, "ERROR: C SIGSEGV not thrown on caught?.\n"); + exit(2); +} + +static void sighandler(int signum) { + if (signum == SIGSEGV) { + exit(0); // success + } +} + +static void __attribute__ ((constructor)) sigsetup(void) { + struct sigaction act; + act.sa_handler = &sighandler; + sigaction(SIGSEGV, &act, 0); +} +*/ +import "C" + +var p *byte + +func f() (ret bool) { + defer func() { + if recover() == nil { + fmt.Errorf("ERROR: couldn't raise SIGSEGV in Go.") + C.exit(2) + } + ret = true + }() + *p = 1 + return false +} + +func main() { + // Test that the signal originating in Go is handled (and recovered) by Go. + if !f() { + fmt.Errorf("couldn't recover from SIGSEGV in Go.") + C.exit(2) + } + + // Test that the signal originating in C is handled by C. + C.sigsegv() +} diff --git a/misc/cgo/testso/cgoso.c b/misc/cgo/testso/cgoso.c new file mode 100644 index 0000000000000000000000000000000000000000..917f472d3684bc9f7bd90ea0ab28150027291161 --- /dev/null +++ b/misc/cgo/testso/cgoso.c @@ -0,0 +1,14 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +#include "_cgo_export.h" + +#ifdef WIN32 +extern void setCallback(void *); +void init() { + setCallback(goCallback); +} +#else +void init() {} +#endif diff --git a/misc/cgo/testso/cgoso.go b/misc/cgo/testso/cgoso.go new file mode 100644 index 0000000000000000000000000000000000000000..29814fa43aeafe3f0250ef216b2301c29359735a --- /dev/null +++ b/misc/cgo/testso/cgoso.go @@ -0,0 +1,31 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package cgosotest + +/* +// intentionally write the same LDFLAGS differently +// to test correct handling of LDFLAGS. +#cgo linux LDFLAGS: -L. -lcgosotest +#cgo dragonfly LDFLAGS: -L. -l cgosotest +#cgo freebsd LDFLAGS: -L. -l cgosotest +#cgo openbsd LDFLAGS: -L. -l cgosotest +#cgo solaris LDFLAGS: -L. -lcgosotest +#cgo netbsd LDFLAGS: -L. libcgosotest.so +#cgo darwin LDFLAGS: -L. libcgosotest.dylib +#cgo windows LDFLAGS: -L. libcgosotest.dll + +void init(void); +void sofunc(void); +*/ +import "C" + +func Test() { + C.init() + C.sofunc() +} + +//export goCallback +func goCallback() { +} diff --git a/misc/cgo/testso/cgoso_c.c b/misc/cgo/testso/cgoso_c.c new file mode 100644 index 0000000000000000000000000000000000000000..7a38022b54736e1c51b48d36b48323c4ea6ecd2a --- /dev/null +++ b/misc/cgo/testso/cgoso_c.c @@ -0,0 +1,30 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build ignore + +#ifdef WIN32 +// A Windows DLL is unable to call an arbitrary function in +// the main executable. Work around that by making the main +// executable pass the callback function pointer to us. +void (*goCallback)(void); +__declspec(dllexport) void setCallback(void *f) +{ + goCallback = (void (*)())f; +} +__declspec(dllexport) void sofunc(void); +#else +extern void goCallback(void); +void setCallback(void *f) { (void)f; } +#endif + +// OpenBSD and older Darwin lack TLS support +#if !defined(__OpenBSD__) && !defined(__APPLE__) +__thread int tlsvar = 12345; +#endif + +void sofunc(void) +{ + goCallback(); +} diff --git a/misc/cgo/testso/cgoso_unix.go b/misc/cgo/testso/cgoso_unix.go new file mode 100644 index 0000000000000000000000000000000000000000..49cdeaa2f59d899fe11f1a7efcec1cbb9d9839fd --- /dev/null +++ b/misc/cgo/testso/cgoso_unix.go @@ -0,0 +1,20 @@ +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build dragonfly freebsd linux netbsd solaris + +package cgosotest + +/* +extern int __thread tlsvar; +int *getTLS() { return &tlsvar; } +*/ +import "C" + +func init() { + if v := *C.getTLS(); v != 12345 { + println("got", v) + panic("BAD TLS value") + } +} diff --git a/misc/cgo/testso/main.go b/misc/cgo/testso/main.go new file mode 100644 index 0000000000000000000000000000000000000000..88aa4322d242cf7adc33c0d57b4aa727166f6640 --- /dev/null +++ b/misc/cgo/testso/main.go @@ -0,0 +1,13 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build ignore + +package main + +import "." + +func main() { + cgosotest.Test() +} diff --git a/misc/cgo/testsovar/cgoso.go b/misc/cgo/testsovar/cgoso.go new file mode 100644 index 0000000000000000000000000000000000000000..88d44c2c6ee29b1a3e7de66fc29dcc636609bc4b --- /dev/null +++ b/misc/cgo/testsovar/cgoso.go @@ -0,0 +1,43 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package cgosotest + +// This test verifies that Go can access C variables +// in shared object file via cgo. + +/* +// intentionally write the same LDFLAGS differently +// to test correct handling of LDFLAGS. +#cgo windows CFLAGS: -DIMPORT_DLL +#cgo linux LDFLAGS: -L. -lcgosotest +#cgo dragonfly LDFLAGS: -L. -l cgosotest +#cgo freebsd LDFLAGS: -L. -l cgosotest +#cgo openbsd LDFLAGS: -L. -l cgosotest +#cgo solaris LDFLAGS: -L. -lcgosotest +#cgo netbsd LDFLAGS: -L. libcgosotest.so +#cgo darwin LDFLAGS: -L. libcgosotest.dylib +#cgo windows LDFLAGS: -L. libcgosotest.dll + +#include "cgoso_c.h" + +const char* getVar() { + return exported_var; +} +*/ +import "C" + +import "fmt" + +func Test() { + const want = "Hello world" + got := C.GoString(C.getVar()) + if got != want { + panic(fmt.Sprintf("testExportedVar: got %q, but want %q", got, want)) + } + got = C.GoString(C.exported_var) + if got != want { + panic(fmt.Sprintf("testExportedVar: got %q, but want %q", got, want)) + } +} diff --git a/misc/cgo/testsovar/cgoso_c.c b/misc/cgo/testsovar/cgoso_c.c new file mode 100644 index 0000000000000000000000000000000000000000..a448c013428c9807dcec8a76217383ea82808a19 --- /dev/null +++ b/misc/cgo/testsovar/cgoso_c.c @@ -0,0 +1,7 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build ignore + +const char *exported_var = "Hello world"; diff --git a/misc/cgo/testsovar/cgoso_c.h b/misc/cgo/testsovar/cgoso_c.h new file mode 100644 index 0000000000000000000000000000000000000000..640db7b396a1cc8e832baeafa7327b43545fd8e7 --- /dev/null +++ b/misc/cgo/testsovar/cgoso_c.h @@ -0,0 +1,17 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build ignore + +#ifdef WIN32 +#if defined(EXPORT_DLL) +# define VAR __declspec(dllexport) +#elif defined(IMPORT_DLL) +# define VAR __declspec(dllimport) +#endif +#else +# define VAR extern +#endif + +VAR const char *exported_var; diff --git a/misc/cgo/testsovar/main.go b/misc/cgo/testsovar/main.go new file mode 100644 index 0000000000000000000000000000000000000000..9c8a1c4e66e630766b4dc4f2ed2d1f4c9f53ef0e --- /dev/null +++ b/misc/cgo/testsovar/main.go @@ -0,0 +1,13 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build ignore + +package main + +import "." + +func main() { + cgosotest.Test() +} diff --git a/misc/cgo/testtls/tls.go b/misc/cgo/testtls/tls.go new file mode 100644 index 0000000000000000000000000000000000000000..8e9ee70033a4dc654e32ecd5b6d1d2d042b20219 --- /dev/null +++ b/misc/cgo/testtls/tls.go @@ -0,0 +1,30 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package cgotlstest + +// #include +// extern void setTLS(int); +// extern int getTLS(); +import "C" + +import ( + "runtime" + "testing" +) + +func testTLS(t *testing.T) { + runtime.LockOSThread() + defer runtime.UnlockOSThread() + + if val := C.getTLS(); val != 0 { + t.Fatalf("at start, C.getTLS() = %#x, want 0", val) + } + + const keyVal = 0x1234 + C.setTLS(keyVal) + if val := C.getTLS(); val != keyVal { + t.Fatalf("at end, C.getTLS() = %#x, want %#x", val, keyVal) + } +} diff --git a/misc/cgo/testtls/tls_test.go b/misc/cgo/testtls/tls_test.go new file mode 100644 index 0000000000000000000000000000000000000000..3076c2d5943b5cbc1482f504e7bbbe016ac71642 --- /dev/null +++ b/misc/cgo/testtls/tls_test.go @@ -0,0 +1,13 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build !windows + +package cgotlstest + +import "testing" + +func TestTLS(t *testing.T) { + testTLS(t) +} diff --git a/misc/cgo/testtls/tls_unix.c b/misc/cgo/testtls/tls_unix.c new file mode 100644 index 0000000000000000000000000000000000000000..545951631e63f494c7adbd97a263c35785583422 --- /dev/null +++ b/misc/cgo/testtls/tls_unix.c @@ -0,0 +1,19 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +#include + +static __thread int tls; + +void +setTLS(int v) +{ + tls = v; +} + +int +getTLS() +{ + return tls; +} diff --git a/misc/chrome/gophertool/README.txt b/misc/chrome/gophertool/README.txt new file mode 100644 index 0000000000000000000000000000000000000000..a7c0b4b26817e1561b17a956277516c5e1a54c1f --- /dev/null +++ b/misc/chrome/gophertool/README.txt @@ -0,0 +1,8 @@ +To install: + +1) chrome://extensions/ +2) click "[+] Developer Mode" in top right +3) "Load unpacked extension..." +4) pick $GOROOT/misc/chrome/gophertool + +Done. It'll now auto-reload from source. diff --git a/misc/chrome/gophertool/background.html b/misc/chrome/gophertool/background.html new file mode 100644 index 0000000000000000000000000000000000000000..06daa98b1420ea2955c32e1a0a86f996be392472 --- /dev/null +++ b/misc/chrome/gophertool/background.html @@ -0,0 +1,12 @@ + + + + + + + + diff --git a/misc/chrome/gophertool/background.js b/misc/chrome/gophertool/background.js new file mode 100644 index 0000000000000000000000000000000000000000..d18faa986ff53de6fef1702721f01ce61c039436 --- /dev/null +++ b/misc/chrome/gophertool/background.js @@ -0,0 +1,9 @@ +chrome.omnibox.onInputEntered.addListener(function(t) { + var url = urlForInput(t); + if (url) { + chrome.tabs.getSelected(null, function(tab) { + if (!tab) return; + chrome.tabs.update(tab.id, { "url": url, "selected": true }); + }); + } +}); diff --git a/misc/chrome/gophertool/gopher.js b/misc/chrome/gophertool/gopher.js new file mode 100644 index 0000000000000000000000000000000000000000..09edb2957bdeadc11f57a7968ca145fce7bbd8c3 --- /dev/null +++ b/misc/chrome/gophertool/gopher.js @@ -0,0 +1,41 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +var numericRE = /^\d+$/; +var commitRE = /^(?:\d+:)?([0-9a-f]{6,40})$/; // e.g "8486:ab29d2698a47" or "ab29d2698a47" +var gerritChangeIdRE = /^I[0-9a-f]{4,40}$/; // e.g. Id69c00d908d18151486007ec03da5495b34b05f5 +var pkgRE = /^[a-z0-9_\/]+$/; + +function urlForInput(t) { + if (!t) { + return null; + } + + if (numericRE.test(t)) { + if (t < 150000) { + // We could use the golang.org/cl/ handler here, but + // avoid some redirect latency and go right there, since + // one is easy. (no server-side mapping) + return "https://github.com/golang/go/issues/" + t; + } + return "https://golang.org/cl/" + t; + } + + if (gerritChangeIdRE.test(t)) { + return "https://golang.org/cl/" + t; + } + + var match = commitRE.exec(t); + if (match) { + return "https://golang.org/change/" + match[1]; + } + + if (pkgRE.test(t)) { + // TODO: make this smarter, using a list of packages + substring matches. + // Get the list from godoc itself in JSON format? + return "https://golang.org/pkg/" + t; + } + + return null; +} diff --git a/misc/chrome/gophertool/gopher.png b/misc/chrome/gophertool/gopher.png new file mode 100644 index 0000000000000000000000000000000000000000..0d1abb7418cfcff2718c32f1226447f1d298f8e4 Binary files /dev/null and b/misc/chrome/gophertool/gopher.png differ diff --git a/misc/chrome/gophertool/manifest.json b/misc/chrome/gophertool/manifest.json new file mode 100644 index 0000000000000000000000000000000000000000..04386594ae57902e6dd665dff7acf58eaa6798f5 --- /dev/null +++ b/misc/chrome/gophertool/manifest.json @@ -0,0 +1,20 @@ +{ + "name": "Hacking Gopher", + "version": "1.0", + "manifest_version": 2, + "description": "Go Hacking utility", + "background": { + "page": "background.html" + }, + "browser_action": { + "default_icon": "gopher.png", + "default_popup": "popup.html" + }, + "omnibox": { "keyword": "golang" }, + "icons": { + "16": "gopher.png" + }, + "permissions": [ + "tabs" + ] +} diff --git a/misc/chrome/gophertool/popup.html b/misc/chrome/gophertool/popup.html new file mode 100644 index 0000000000000000000000000000000000000000..97404062761126972a9e8c8de0d6c4ddde4d9b7f --- /dev/null +++ b/misc/chrome/gophertool/popup.html @@ -0,0 +1,21 @@ + + + + + + + +issue, +codereview, +commit, or +pkg id/name: + +Also: buildbots +Github + + + diff --git a/misc/chrome/gophertool/popup.js b/misc/chrome/gophertool/popup.js new file mode 100644 index 0000000000000000000000000000000000000000..410d65120e6f067023f1c407b5dc76adfdae4e15 --- /dev/null +++ b/misc/chrome/gophertool/popup.js @@ -0,0 +1,46 @@ +function openURL(url) { + chrome.tabs.create({ "url": url }) +} + +function addLinks() { + var links = document.getElementsByTagName("a"); + for (var i = 0; i < links.length; i++) { + var url = links[i].getAttribute("url"); + if (url) + links[i].addEventListener("click", function () { + openURL(this.getAttribute("url")); + }); + } +} + +window.addEventListener("load", function () { + addLinks(); + console.log("hacking gopher pop-up loaded."); + document.getElementById("inputbox").focus(); +}); + +window.addEventListener("submit", function () { + console.log("submitting form"); + var box = document.getElementById("inputbox"); + box.focus(); + + var t = box.value; + if (t == "") { + return false; + } + + var success = function(url) { + console.log("matched " + t + " to: " + url) + box.value = ""; + openURL(url); + return false; // cancel form submission + }; + + var url = urlForInput(t); + if (url) { + return success(url); + } + + console.log("no match for text: " + t) + return false; +}); diff --git a/misc/editors b/misc/editors new file mode 100644 index 0000000000000000000000000000000000000000..3a0f73fd7a2cd2555a306d93da3e0af741b8224a --- /dev/null +++ b/misc/editors @@ -0,0 +1,5 @@ +For information about plugins and other support for Go in editors and shells, +see this page on the Go Wiki: + +https://golang.org/wiki/IDEsAndTextEditorPlugins + diff --git a/misc/git/pre-commit b/misc/git/pre-commit new file mode 100755 index 0000000000000000000000000000000000000000..18b7f832f36ec4ed349bd71fa67ee15fdf5bbd1c --- /dev/null +++ b/misc/git/pre-commit @@ -0,0 +1,26 @@ +#!/bin/sh +# Copyright 2012 The Go Authors. All rights reserved. +# Use of this source code is governed by a BSD-style +# license that can be found in the LICENSE file. + +# git gofmt pre-commit hook +# +# To use, store as .git/hooks/pre-commit inside your repository and make sure +# it has execute permissions. +# +# This script does not handle file names that contain spaces. + +gofiles=$(git diff --cached --name-only --diff-filter=ACM | grep '.go$') +[ -z "$gofiles" ] && exit 0 + +unformatted=$(gofmt -l $gofiles) +[ -z "$unformatted" ] && exit 0 + +# Some files are not gofmt'd. Print message and fail. + +echo >&2 "Go files must be formatted with gofmt. Please run:" +for fn in $unformatted; do + echo >&2 " gofmt -w $PWD/$fn" +done + +exit 1 diff --git a/misc/ios/README b/misc/ios/README new file mode 100644 index 0000000000000000000000000000000000000000..417a217892c4d8c9b926442e0bf10d8030363963 --- /dev/null +++ b/misc/ios/README @@ -0,0 +1,44 @@ +Go on iOS +========= + +To build a cross compiling toolchain for iOS on OS X, first modify clangwrap.sh +in misc/ios to match your setup. And then run: + + GOARM=7 CGO_ENABLED=1 GOARCH=arm CC_FOR_TARGET=`pwd`/../misc/ios/clangwrap.sh \ + CXX_FOR_TARGET=`pwd`/../misc/ios/clangwrap.sh ./make.bash + +To build a program, use the normal go build command: + + CGO_ENABLED=1 GOARCH=arm go build import/path + +To run a program on an iDevice, first make sure you have a valid developer +certificate and have setup your iDevice properly to run apps signed by your +developer certificate. Then install https://github.com/phonegap/ios-deploy. +At a first step, you can try building the famous hello world program to run +on your test device. +(The needed files are provided at https://github.com/minux/go-ios-examples.) + + # assume your program binary is helloworld.go, build it into the + # example hello.app bundle. + CGO_ENABLED=1 GOARCH=arm go build -o hello.app/hello helloworld.go + # sign the executable using your developer certificate + codesign -f -s "iPhone Developer" --entitlements hello.app/Entitlements.plist hello.app/hello + # run the program inside lldb on iDevice, run `ios-deploy` for more + # command options + ios-deploy --debug --uninstall --bundle hello.app + # Depending on your ios-deploy version, you might need to enter "run" + # into lldb to run your program, and its output will be shown by lldb. + +Notes: + - A dummy hello.app bundle is provided in this directory to help you get started. + - Running the program on an iDevice requires code sign and thus external linking, + if your program uses cgo, then it will automatically use external linking. + However, if your program does not use cgo, please make sure to add + import _ "runtime/cgo" + so that external linking will be used. + +Known issues +============ + - crypto/x509 won't build, I don't yet know how to get system root on iOS. + - Because I still want to be able to do native build, CGO_ENABLED=1 is not the + default, yet. diff --git a/misc/ios/clangwrap.sh b/misc/ios/clangwrap.sh new file mode 100755 index 0000000000000000000000000000000000000000..9cad49fe7d86f5fda9a6fff0497e2d092a9baaff --- /dev/null +++ b/misc/ios/clangwrap.sh @@ -0,0 +1,20 @@ +#!/bin/sh +# This uses the latest available iOS SDK, which is recommended. +# To select a specific SDK, run 'xcodebuild -showsdks' +# to see the available SDKs and replace iphoneos with one of them. +SDK=iphoneos +SDK_PATH=`xcrun --sdk $SDK --show-sdk-path` +export IPHONEOS_DEPLOYMENT_TARGET=5.1 +# cmd/cgo doesn't support llvm-gcc-4.2, so we have to use clang. +CLANG=`xcrun --sdk $SDK --find clang` + +if [ "$GOARCH" == "arm" ]; then + CLANGARCH="armv7" +elif [ "$GOARCH" == "arm64" ]; then + CLANGARCH="arm64" +else + echo "unknown GOARCH=$GOARCH" >&2 + exit 1 +fi + +exec $CLANG -arch $CLANGARCH -isysroot $SDK_PATH "$@" diff --git a/misc/ios/detect.go b/misc/ios/detect.go new file mode 100644 index 0000000000000000000000000000000000000000..d3054581083161b794009f65057be711ffe5d694 --- /dev/null +++ b/misc/ios/detect.go @@ -0,0 +1,135 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build ignore + +// detect attempts to autodetect the correct +// values of the environment variables +// used by go_darwin_arm_exec. +// detect shells out to ideviceinfo, a third party program that can +// be obtained by following the instructions at +// https://github.com/libimobiledevice/libimobiledevice. +package main + +import ( + "bytes" + "fmt" + "io/ioutil" + "os" + "os/exec" + "strings" +) + +func main() { + devID := detectDevID() + fmt.Printf("export GOIOS_DEV_ID=%s\n", devID) + + udid := detectUDID() + mp := detectMobileProvisionFile(udid) + + f, err := ioutil.TempFile("", "go_ios_detect_") + check(err) + fname := f.Name() + defer os.Remove(fname) + + out := combinedOutput(parseMobileProvision(mp)) + _, err = f.Write(out) + check(err) + check(f.Close()) + + appID, err := plistExtract(fname, "ApplicationIdentifierPrefix:0") + check(err) + fmt.Printf("export GOIOS_APP_ID=%s\n", appID) + + teamID, err := plistExtract(fname, "Entitlements:com.apple.developer.team-identifier") + check(err) + fmt.Printf("export GOIOS_TEAM_ID=%s\n", teamID) +} + +func detectDevID() string { + cmd := exec.Command("security", "find-identity", "-p", "codesigning", "-v") + lines := getLines(cmd) + + for _, line := range lines { + if !bytes.Contains(line, []byte("iPhone Developer")) { + continue + } + fields := bytes.Fields(line) + return string(fields[1]) + } + fail("no code signing identity found") + panic("unreachable") +} + +var udidPrefix = []byte("UniqueDeviceID: ") + +func detectUDID() []byte { + cmd := exec.Command("ideviceinfo") + lines := getLines(cmd) + for _, line := range lines { + if bytes.HasPrefix(line, udidPrefix) { + return bytes.TrimPrefix(line, udidPrefix) + } + } + fail("udid not found; is the device connected?") + panic("unreachable") +} + +func detectMobileProvisionFile(udid []byte) string { + cmd := exec.Command("mdfind", "-name", ".mobileprovision") + lines := getLines(cmd) + + for _, line := range lines { + if len(line) == 0 { + continue + } + xmlLines := getLines(parseMobileProvision(string(line))) + for _, xmlLine := range xmlLines { + if bytes.Contains(xmlLine, udid) { + return string(line) + } + } + } + fail("did not find mobile provision matching device udid %s", udid) + panic("ureachable") +} + +func parseMobileProvision(fname string) *exec.Cmd { + return exec.Command("security", "cms", "-D", "-i", string(fname)) +} + +func plistExtract(fname string, path string) ([]byte, error) { + out, err := exec.Command("/usr/libexec/PlistBuddy", "-c", "Print "+path, fname).CombinedOutput() + if err != nil { + return nil, err + } + return bytes.TrimSpace(out), nil +} + +func getLines(cmd *exec.Cmd) [][]byte { + out := combinedOutput(cmd) + return bytes.Split(out, []byte("\n")) +} + +func combinedOutput(cmd *exec.Cmd) []byte { + out, err := cmd.CombinedOutput() + if err != nil { + fmt.Println(strings.Join(cmd.Args, "\n")) + fmt.Fprintln(os.Stderr, err) + os.Exit(1) + } + return out +} + +func check(err error) { + if err != nil { + fail(err.Error()) + } +} + +func fail(msg string, v ...interface{}) { + fmt.Fprintf(os.Stderr, msg, v...) + fmt.Fprintln(os.Stderr) + os.Exit(1) +} diff --git a/misc/ios/go_darwin_arm_exec.go b/misc/ios/go_darwin_arm_exec.go new file mode 100644 index 0000000000000000000000000000000000000000..debd2cdb3062bb94c97689bee497db28fadafdd2 --- /dev/null +++ b/misc/ios/go_darwin_arm_exec.go @@ -0,0 +1,665 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// This program can be used as go_darwin_arm_exec by the Go tool. +// It executes binaries on an iOS device using the XCode toolchain +// and the ios-deploy program: https://github.com/phonegap/ios-deploy +// +// This script supports an extra flag, -lldb, that pauses execution +// just before the main program begins and allows the user to control +// the remote lldb session. This flag is appended to the end of the +// script's arguments and is not passed through to the underlying +// binary. +// +// This script requires that three environment variables be set: +// GOIOS_DEV_ID: The codesigning developer id or certificate identifier +// GOIOS_APP_ID: The provisioning app id prefix. Must support wildcard app ids. +// GOIOS_TEAM_ID: The team id that owns the app id prefix. +// $GOROOT/misc/ios contains a script, detect.go, that attempts to autodetect these. +package main + +import ( + "bytes" + "errors" + "flag" + "fmt" + "go/build" + "io" + "io/ioutil" + "log" + "os" + "os/exec" + "path/filepath" + "runtime" + "strings" + "sync" + "time" +) + +const debug = false + +var errRetry = errors.New("failed to start test harness (retry attempted)") + +var tmpdir string + +var ( + devID string + appID string + teamID string +) + +func main() { + log.SetFlags(0) + log.SetPrefix("go_darwin_arm_exec: ") + if debug { + log.Println(strings.Join(os.Args, " ")) + } + if len(os.Args) < 2 { + log.Fatal("usage: go_darwin_arm_exec a.out") + } + + // e.g. B393DDEB490947F5A463FD074299B6C0AXXXXXXX + devID = getenv("GOIOS_DEV_ID") + + // e.g. Z8B3JBXXXX.org.golang.sample, Z8B3JBXXXX prefix is available at + // https://developer.apple.com/membercenter/index.action#accountSummary as Team ID. + appID = getenv("GOIOS_APP_ID") + + // e.g. Z8B3JBXXXX, available at + // https://developer.apple.com/membercenter/index.action#accountSummary as Team ID. + teamID = getenv("GOIOS_TEAM_ID") + + var err error + tmpdir, err = ioutil.TempDir("", "go_darwin_arm_exec_") + if err != nil { + log.Fatal(err) + } + + // Approximately 1 in a 100 binaries fail to start. If it happens, + // try again. These failures happen for several reasons beyond + // our control, but all of them are safe to retry as they happen + // before lldb encounters the initial getwd breakpoint. As we + // know the tests haven't started, we are not hiding flaky tests + // with this retry. + for i := 0; i < 5; i++ { + if i > 0 { + fmt.Fprintln(os.Stderr, "start timeout, trying again") + } + err = run(os.Args[1], os.Args[2:]) + if err == nil || err != errRetry { + break + } + } + if !debug { + os.RemoveAll(tmpdir) + } + if err != nil { + fmt.Fprintf(os.Stderr, "go_darwin_arm_exec: %v\n", err) + os.Exit(1) + } +} + +func getenv(envvar string) string { + s := os.Getenv(envvar) + if s == "" { + log.Fatalf("%s not set\nrun $GOROOT/misc/ios/detect.go to attempt to autodetect", s) + } + return s +} + +func run(bin string, args []string) (err error) { + appdir := filepath.Join(tmpdir, "gotest.app") + os.RemoveAll(appdir) + if err := os.MkdirAll(appdir, 0755); err != nil { + return err + } + + if err := cp(filepath.Join(appdir, "gotest"), bin); err != nil { + return err + } + + entitlementsPath := filepath.Join(tmpdir, "Entitlements.plist") + if err := ioutil.WriteFile(entitlementsPath, []byte(entitlementsPlist()), 0744); err != nil { + return err + } + if err := ioutil.WriteFile(filepath.Join(appdir, "Info.plist"), []byte(infoPlist), 0744); err != nil { + return err + } + if err := ioutil.WriteFile(filepath.Join(appdir, "ResourceRules.plist"), []byte(resourceRules), 0744); err != nil { + return err + } + + pkgpath, err := copyLocalData(appdir) + if err != nil { + return err + } + + cmd := exec.Command( + "codesign", + "-f", + "-s", devID, + "--entitlements", entitlementsPath, + appdir, + ) + if debug { + log.Println(strings.Join(cmd.Args, " ")) + } + cmd.Stdout = os.Stdout + cmd.Stderr = os.Stderr + if err := cmd.Run(); err != nil { + return fmt.Errorf("codesign: %v", err) + } + + oldwd, err := os.Getwd() + if err != nil { + return err + } + if err := os.Chdir(filepath.Join(appdir, "..")); err != nil { + return err + } + defer os.Chdir(oldwd) + + type waitPanic struct { + err error + } + defer func() { + if r := recover(); r != nil { + if w, ok := r.(waitPanic); ok { + err = w.err + return + } + panic(r) + } + }() + + defer exec.Command("killall", "ios-deploy").Run() // cleanup + + exec.Command("killall", "ios-deploy").Run() + + var opts options + opts, args = parseArgs(args) + + // ios-deploy invokes lldb to give us a shell session with the app. + cmd = exec.Command( + // lldb tries to be clever with terminals. + // So we wrap it in script(1) and be clever + // right back at it. + "script", + "-q", "-t", "0", + "/dev/null", + + "ios-deploy", + "--debug", + "-u", + "-r", + "-n", + `--args=`+strings.Join(args, " ")+``, + "--bundle", appdir, + ) + if debug { + log.Println(strings.Join(cmd.Args, " ")) + } + + lldbr, lldb, err := os.Pipe() + if err != nil { + return err + } + w := new(bufWriter) + if opts.lldb { + mw := io.MultiWriter(w, os.Stderr) + cmd.Stdout = mw + cmd.Stderr = mw + } else { + cmd.Stdout = w + cmd.Stderr = w // everything of interest is on stderr + } + cmd.Stdin = lldbr + + if err := cmd.Start(); err != nil { + return fmt.Errorf("ios-deploy failed to start: %v", err) + } + + // Manage the -test.timeout here, outside of the test. There is a lot + // of moving parts in an iOS test harness (notably lldb) that can + // swallow useful stdio or cause its own ruckus. + var timedout chan struct{} + if opts.timeout > 1*time.Second { + timedout = make(chan struct{}) + time.AfterFunc(opts.timeout-1*time.Second, func() { + close(timedout) + }) + } + + exited := make(chan error) + go func() { + exited <- cmd.Wait() + }() + + waitFor := func(stage, str string, timeout time.Duration) error { + select { + case <-timedout: + w.printBuf() + if p := cmd.Process; p != nil { + p.Kill() + } + return fmt.Errorf("timeout (stage %s)", stage) + case err := <-exited: + w.printBuf() + return fmt.Errorf("failed (stage %s): %v", stage, err) + case i := <-w.find(str, timeout): + if i < 0 { + log.Printf("timed out on stage %q, retrying", stage) + return errRetry + } + w.clearTo(i + len(str)) + return nil + } + } + do := func(cmd string) { + fmt.Fprintln(lldb, cmd) + if err := waitFor(fmt.Sprintf("prompt after %q", cmd), "(lldb)", 0); err != nil { + panic(waitPanic{err}) + } + } + + // Wait for installation and connection. + if err := waitFor("ios-deploy before run", "(lldb)", 0); err != nil { + // Retry if we see a rare and longstanding ios-deploy bug. + // https://github.com/phonegap/ios-deploy/issues/11 + // Assertion failed: (AMDeviceStartService(device, CFSTR("com.apple.debugserver"), &gdbfd, NULL) == 0) + log.Printf("%v, retrying", err) + return errRetry + } + + // Script LLDB. Oh dear. + do(`process handle SIGHUP --stop false --pass true --notify false`) + do(`process handle SIGPIPE --stop false --pass true --notify false`) + do(`process handle SIGUSR1 --stop false --pass true --notify false`) + do(`process handle SIGSEGV --stop false --pass true --notify false`) // does not work + do(`process handle SIGBUS --stop false --pass true --notify false`) // does not work + + if opts.lldb { + _, err := io.Copy(lldb, os.Stdin) + if err != io.EOF { + return err + } + return nil + } + + do(`breakpoint set -n getwd`) // in runtime/cgo/gcc_darwin_arm.go + + fmt.Fprintln(lldb, `run`) + if err := waitFor("br getwd", "stop reason = breakpoint", 20*time.Second); err != nil { + // At this point we see several flaky errors from the iOS + // build infrastructure. The most common is never reaching + // the breakpoint, which we catch with a timeout. Very + // occasionally lldb can produce errors like: + // + // Breakpoint 1: no locations (pending). + // WARNING: Unable to resolve breakpoint to any actual locations. + // + // As no actual test code has been executed by this point, + // we treat all errors as recoverable. + if err != errRetry { + log.Printf("%v, retrying", err) + err = errRetry + } + return err + } + if err := waitFor("br getwd prompt", "(lldb)", 0); err != nil { + return err + } + + // Move the current working directory into the faux gopath. + if pkgpath != "src" { + do(`breakpoint delete 1`) + do(`expr char* $mem = (char*)malloc(512)`) + do(`expr $mem = (char*)getwd($mem, 512)`) + do(`expr $mem = (char*)strcat($mem, "/` + pkgpath + `")`) + do(`call (void)chdir($mem)`) + } + + // Run the tests. + w.trimSuffix("(lldb) ") + fmt.Fprintln(lldb, `process continue`) + + // Wait for the test to complete. + select { + case <-timedout: + w.printBuf() + if p := cmd.Process; p != nil { + p.Kill() + } + return errors.New("timeout running tests") + case <-w.find("\nPASS", 0): + passed := w.isPass() + w.printBuf() + if passed { + return nil + } + return errors.New("test failure") + case err := <-exited: + // The returned lldb error code is usually non-zero. + // We check for test success by scanning for the final + // PASS returned by the test harness, assuming the worst + // in its absence. + if w.isPass() { + err = nil + } else if err == nil { + err = errors.New("test failure") + } + w.printBuf() + return err + } +} + +type bufWriter struct { + mu sync.Mutex + buf []byte + suffix []byte // remove from each Write + + findTxt []byte // search buffer on each Write + findCh chan int // report find position + findAfter *time.Timer +} + +func (w *bufWriter) Write(in []byte) (n int, err error) { + w.mu.Lock() + defer w.mu.Unlock() + + n = len(in) + in = bytes.TrimSuffix(in, w.suffix) + + if debug { + inTxt := strings.Replace(string(in), "\n", "\\n", -1) + findTxt := strings.Replace(string(w.findTxt), "\n", "\\n", -1) + fmt.Printf("debug --> %s <-- debug (findTxt='%s')\n", inTxt, findTxt) + } + + w.buf = append(w.buf, in...) + + if len(w.findTxt) > 0 { + if i := bytes.Index(w.buf, w.findTxt); i >= 0 { + w.findCh <- i + close(w.findCh) + w.findTxt = nil + w.findCh = nil + if w.findAfter != nil { + w.findAfter.Stop() + w.findAfter = nil + } + } + } + return n, nil +} + +func (w *bufWriter) trimSuffix(p string) { + w.mu.Lock() + defer w.mu.Unlock() + w.suffix = []byte(p) +} + +func (w *bufWriter) printBuf() { + w.mu.Lock() + defer w.mu.Unlock() + fmt.Fprintf(os.Stderr, "%s", w.buf) + w.buf = nil +} + +func (w *bufWriter) clearTo(i int) { + w.mu.Lock() + defer w.mu.Unlock() + w.buf = w.buf[i:] +} + +// find returns a channel that will have exactly one byte index sent +// to it when the text str appears in the buffer. If the text does not +// appear before timeout, -1 is sent. +// +// A timeout of zero means no timeout. +func (w *bufWriter) find(str string, timeout time.Duration) <-chan int { + w.mu.Lock() + defer w.mu.Unlock() + if len(w.findTxt) > 0 { + panic(fmt.Sprintf("find(%s): already trying to find %s", str, w.findTxt)) + } + txt := []byte(str) + ch := make(chan int, 1) + if i := bytes.Index(w.buf, txt); i >= 0 { + ch <- i + close(ch) + } else { + w.findTxt = txt + w.findCh = ch + if timeout > 0 { + w.findAfter = time.AfterFunc(timeout, func() { + w.mu.Lock() + defer w.mu.Unlock() + if w.findCh == ch { + w.findTxt = nil + w.findCh = nil + w.findAfter = nil + ch <- -1 + close(ch) + } + }) + } + } + return ch +} + +func (w *bufWriter) isPass() bool { + w.mu.Lock() + defer w.mu.Unlock() + + // The final stdio of lldb is non-deterministic, so we + // scan the whole buffer. + // + // Just to make things fun, lldb sometimes translates \n + // into \r\n. + return bytes.Contains(w.buf, []byte("\nPASS\n")) || bytes.Contains(w.buf, []byte("\nPASS\r")) +} + +type options struct { + timeout time.Duration + lldb bool +} + +func parseArgs(binArgs []string) (opts options, remainingArgs []string) { + var flagArgs []string + for _, arg := range binArgs { + if strings.Contains(arg, "-test.timeout") { + flagArgs = append(flagArgs, arg) + } + if strings.Contains(arg, "-lldb") { + flagArgs = append(flagArgs, arg) + continue + } + remainingArgs = append(remainingArgs, arg) + } + f := flag.NewFlagSet("", flag.ContinueOnError) + f.DurationVar(&opts.timeout, "test.timeout", 0, "") + f.BoolVar(&opts.lldb, "lldb", false, "") + f.Parse(flagArgs) + return opts, remainingArgs + +} + +func copyLocalDir(dst, src string) error { + if err := os.Mkdir(dst, 0755); err != nil { + return err + } + + d, err := os.Open(src) + if err != nil { + return err + } + defer d.Close() + fi, err := d.Readdir(-1) + if err != nil { + return err + } + + for _, f := range fi { + if f.IsDir() { + if f.Name() == "testdata" { + if err := cp(dst, filepath.Join(src, f.Name())); err != nil { + return err + } + } + continue + } + if err := cp(dst, filepath.Join(src, f.Name())); err != nil { + return err + } + } + return nil +} + +func cp(dst, src string) error { + out, err := exec.Command("cp", "-a", src, dst).CombinedOutput() + if err != nil { + os.Stderr.Write(out) + } + return err +} + +func copyLocalData(dstbase string) (pkgpath string, err error) { + cwd, err := os.Getwd() + if err != nil { + return "", err + } + + finalPkgpath, underGoRoot, err := subdir() + if err != nil { + return "", err + } + cwd = strings.TrimSuffix(cwd, finalPkgpath) + + // Copy all immediate files and testdata directories between + // the package being tested and the source root. + pkgpath = "" + for _, element := range strings.Split(finalPkgpath, string(filepath.Separator)) { + if debug { + log.Printf("copying %s", pkgpath) + } + pkgpath = filepath.Join(pkgpath, element) + dst := filepath.Join(dstbase, pkgpath) + src := filepath.Join(cwd, pkgpath) + if err := copyLocalDir(dst, src); err != nil { + return "", err + } + } + + // Copy timezone file. + // + // Typical apps have the zoneinfo.zip in the root of their app bundle, + // read by the time package as the working directory at initialization. + // As we move the working directory to the GOROOT pkg directory, we + // install the zoneinfo.zip file in the pkgpath. + if underGoRoot { + err := cp( + filepath.Join(dstbase, pkgpath), + filepath.Join(cwd, "lib", "time", "zoneinfo.zip"), + ) + if err != nil { + return "", err + } + } + + return finalPkgpath, nil +} + +// subdir determines the package based on the current working directory, +// and returns the path to the package source relative to $GOROOT (or $GOPATH). +func subdir() (pkgpath string, underGoRoot bool, err error) { + cwd, err := os.Getwd() + if err != nil { + return "", false, err + } + if root := runtime.GOROOT(); strings.HasPrefix(cwd, root) { + subdir, err := filepath.Rel(root, cwd) + if err != nil { + return "", false, err + } + return subdir, true, nil + } + + for _, p := range filepath.SplitList(build.Default.GOPATH) { + if !strings.HasPrefix(cwd, p) { + continue + } + subdir, err := filepath.Rel(p, cwd) + if err == nil { + return subdir, false, nil + } + } + return "", false, fmt.Errorf( + "working directory %q is not in either GOROOT(%q) or GOPATH(%q)", + cwd, + runtime.GOROOT(), + build.Default.GOPATH, + ) +} + +const infoPlist = ` + + + +CFBundleNamegolang.gotest +CFBundleSupportedPlatformsiPhoneOS +CFBundleExecutablegotest +CFBundleVersion1.0 +CFBundleIdentifiergolang.gotest +CFBundleResourceSpecificationResourceRules.plist +LSRequiresIPhoneOS +CFBundleDisplayNamegotest + + +` + +func entitlementsPlist() string { + return ` + + + + keychain-access-groups + ` + appID + `.golang.gotest + get-task-allow + + application-identifier + ` + appID + `.golang.gotest + com.apple.developer.team-identifier + ` + teamID + ` + + +` +} + +const resourceRules = ` + + + + rules + + .* + + Info.plist + + omit + + weight + 10 + + ResourceRules.plist + + omit + + weight + 100 + + + + +` diff --git a/misc/linkcheck/linkcheck.go b/misc/linkcheck/linkcheck.go new file mode 100644 index 0000000000000000000000000000000000000000..d9bfd2f767eb190cff1cb75170c5ebbd549aeb99 --- /dev/null +++ b/misc/linkcheck/linkcheck.go @@ -0,0 +1,193 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// The linkcheck command finds missing links in the godoc website. +// It crawls a URL recursively and notes URLs and URL fragments +// that it's seen and prints a report of missing links at the end. +package main + +import ( + "errors" + "flag" + "fmt" + "io/ioutil" + "log" + "net/http" + "os" + "regexp" + "strings" + "sync" +) + +var ( + root = flag.String("root", "http://localhost:6060", "Root to crawl") + verbose = flag.Bool("verbose", false, "verbose") +) + +var wg sync.WaitGroup // outstanding fetches +var urlq = make(chan string) // URLs to crawl + +// urlFrag is a URL and its optional #fragment (without the #) +type urlFrag struct { + url, frag string +} + +var ( + mu sync.Mutex + crawled = make(map[string]bool) // URL without fragment -> true + neededFrags = make(map[urlFrag][]string) // URL#frag -> who needs it +) + +var aRx = regexp.MustCompile(`]+)`) + +// Owned by crawlLoop goroutine: +var ( + linkSources = make(map[string][]string) // url no fragment -> sources + fragExists = make(map[urlFrag]bool) + problems []string +) + +func localLinks(body string) (links []string) { + seen := map[string]bool{} + mv := aRx.FindAllStringSubmatch(body, -1) + for _, m := range mv { + ref := m[1] + if strings.HasPrefix(ref, "/src/") { + continue + } + if !seen[ref] { + seen[ref] = true + links = append(links, m[1]) + } + } + return +} + +var idRx = regexp.MustCompile(`\bid=['"]?([^\s'">]+)`) + +func pageIDs(body string) (ids []string) { + mv := idRx.FindAllStringSubmatch(body, -1) + for _, m := range mv { + ids = append(ids, m[1]) + } + return +} + +// url may contain a #fragment, and the fragment is then noted as needing to exist. +func crawl(url string, sourceURL string) { + if strings.Contains(url, "/devel/release") { + return + } + mu.Lock() + defer mu.Unlock() + var frag string + if i := strings.Index(url, "#"); i >= 0 { + frag = url[i+1:] + url = url[:i] + if frag != "" { + uf := urlFrag{url, frag} + neededFrags[uf] = append(neededFrags[uf], sourceURL) + } + } + if crawled[url] { + return + } + crawled[url] = true + + wg.Add(1) + go func() { + urlq <- url + }() +} + +func addProblem(url, errmsg string) { + msg := fmt.Sprintf("Error on %s: %s (from %s)", url, errmsg, linkSources[url]) + if *verbose { + log.Print(msg) + } + problems = append(problems, msg) +} + +func crawlLoop() { + for url := range urlq { + if err := doCrawl(url); err != nil { + addProblem(url, err.Error()) + } + } +} + +func doCrawl(url string) error { + defer wg.Done() + + req, err := http.NewRequest("GET", url, nil) + if err != nil { + return err + } + res, err := http.DefaultTransport.RoundTrip(req) + if err != nil { + return err + } + // Handle redirects. + if res.StatusCode/100 == 3 { + newURL, err := res.Location() + if err != nil { + return fmt.Errorf("resolving redirect: %v", err) + } + if !strings.HasPrefix(newURL.String(), *root) { + // Skip off-site redirects. + return nil + } + crawl(newURL.String(), url) + return nil + } + if res.StatusCode != 200 { + return errors.New(res.Status) + } + slurp, err := ioutil.ReadAll(res.Body) + res.Body.Close() + if err != nil { + log.Fatalf("Error reading %s body: %v", url, err) + } + if *verbose { + log.Printf("Len of %s: %d", url, len(slurp)) + } + body := string(slurp) + for _, ref := range localLinks(body) { + if *verbose { + log.Printf(" links to %s", ref) + } + dest := *root + ref + linkSources[dest] = append(linkSources[dest], url) + crawl(dest, url) + } + for _, id := range pageIDs(body) { + if *verbose { + log.Printf(" url %s has #%s", url, id) + } + fragExists[urlFrag{url, id}] = true + } + return nil +} + +func main() { + flag.Parse() + + go crawlLoop() + crawl(*root, "") + + wg.Wait() + close(urlq) + for uf, needers := range neededFrags { + if !fragExists[uf] { + problems = append(problems, fmt.Sprintf("Missing fragment for %+v from %v", uf, needers)) + } + } + + for _, s := range problems { + fmt.Println(s) + } + if len(problems) > 0 { + os.Exit(1) + } +} diff --git a/misc/nacl/README b/misc/nacl/README new file mode 100644 index 0000000000000000000000000000000000000000..99b94dc90ae425357424ff4a731f2442fa1ef3e9 --- /dev/null +++ b/misc/nacl/README @@ -0,0 +1,121 @@ +Native Client +============= + +This document outlines the basics of building and developing the Go runtime and +programs in the Native Client (NaCl) environment. + +Go 1.3 supports three architectures + + * nacl/386 which is standard 386. + * nacl/amd64p32 which is a 64 bit architecture, where the address space is + limited to a 4gb window. + * nacl/arm which is 32-bit ARMv7A architecture with 1GB address space. + +For background it is recommended that you read https://golang.org/s/go13nacl. + +Prerequisites +------------- + +Native Client programs are executed inside a sandbox, the NaCl runtime. This +runtime must be installed before you can use NaCl programs. + +The NaCl distribution comes with an installer which ensures you have access to +the latest version of the runtime. The version tracks the Chrome numbering +scheme. + +# Download NaCl + +Download nacl_sdk.zip file from + https://developers.google.com/native-client/dev/sdk/download +and unpack it. I chose /opt/nacl_sdk. + +# Update + +The zip file contains a small skeleton that can be used to download the correct +sdk. These are released every 6-8 weeks, in line with Chrome releases. + + % cd /opt/nacl_sdk + % ./naclsdk update + +At this time pepper_40 is the stable version. The NaCl port needs at least pepper_39 +to work. If naclsdk downloads a later version, please adjust accordingly. + +The cmd/go helper scripts expect that the loaders sel_ldr_{x86_{32,64},arm} and +nacl_helper_bootstrap_arm are in your path. I find it easiest to make a symlink +from the NaCl distribution to my $GOPATH/bin directory. + + % ln -nfs /opt/nacl_sdk/pepper_39/tools/sel_ldr_x86_32 $GOPATH/bin/sel_ldr_x86_32 + % ln -nfs /opt/nacl_sdk/pepper_39/tools/sel_ldr_x86_64 $GOPATH/bin/sel_ldr_x86_64 + % ln -nfs /opt/nacl_sdk/pepper_39/tools/sel_ldr_arm $GOPATH/bin/sel_ldr_arm + +Additionally, for NaCl/ARM only: + + % ln -nfs /opt/nacl_sdk/pepper_39/tools/nacl_helper_bootstrap_arm $GOPATH/bin/nacl_helper_bootstrap_arm + +Support scripts +--------------- + +Symlink the two scripts in this directory into your $PATH, just as you did with +NaCl sdk above. + + % ln -nfs $GOROOT/misc/nacl/go_nacl_amd64p32_exec $GOPATH/bin/go_nacl_amd64p32_exec + % ln -nfs $GOROOT/misc/nacl/go_nacl_386_exec $GOPATH/bin/go_nacl_386_exec + % ln -nfs $GOROOT/misc/nacl/go_nacl_arm_exec $GOPATH/bin/go_nacl_arm_exec + +Building and testing +-------------------- + +Building for NaCl is similar to cross compiling for other platforms. However, +as it is not possible to ever build in a `native` NaCl environment, the cmd/go +tool has been enhanced to allow the full build, all.bash, to be executed, +rather than just the compile stage, make.bash. + +The cmd/go tool knows that if GOOS is set to `nacl` it should not try to +execute any binaries itself. Instead it passes their execution to a support +script which sets up a Native Client environment and invokes the NaCl sandbox. + +The script's name has a special format, go_$GOOS_$GOARCH_exec, so cmd/go can +find it. + +In short, if the support scripts are in place, the cmd/go tool can be used as +per normal. + +# Build and test Go for NaCl + +NaCl does not permit direct file system access. Instead, package syscall +provides a simulated file system served by in-memory data. The script +nacltest.bash is the NaCl equivalent of all.bash. It builds NaCl with an +in-memory file system containing files needed for tests, and then it runs the +tests. + + % cd go/src + % env GOARCH=amd64p32 ./nacltest.bash + +Debugging +--------- + +Assuming that you have built nacl/amd64p32 binary ./mybin and can run as: + + % sel_ldr_x86_64 -l /dev/null -S -e ./mybin + +Create the nacl manifest file mybin.manifest with the following contents: + + { "program": { "x86-64": { "url": "mybin" } } } + +url is the path to the binary relative to the manifest file. +Then, run the program as: + + % sel_ldr_x86_64 -g -l /dev/null -S -e ./mybin + +The -g flag instructs the loader to stop at startup. Then, in another console: + + % /opt/nacl_sdk/pepper_39/toolchain/linux_x86_glibc/bin/x86_64-nacl-gdb + % nacl-manifest mybin.manifest + % target remote :4014 + +If you see that the program is stopped in _rt0_amd64p32_nacl, then symbols are +loaded successfully and you can type 'c' to start the program. +Next time you can automate it as: + + % /opt/nacl_sdk/pepper_39/toolchain/linux_x86_glibc/bin/x86_64-nacl-gdb \ + -ex 'nacl-manifest mybin.manifest' -ex 'target remote :4014' diff --git a/misc/nacl/go_nacl_386_exec b/misc/nacl/go_nacl_386_exec new file mode 100755 index 0000000000000000000000000000000000000000..9cff63556579cfd54bbb6a3666fe6ab236430efc --- /dev/null +++ b/misc/nacl/go_nacl_386_exec @@ -0,0 +1,10 @@ +#!/bin/bash + +eval $(go env) + +export NACLENV_GOARCH=$GOARCH +export NACLENV_GOOS=$GOOS +export NACLENV_GOROOT=/go +export NACLENV_NACLPWD=$(pwd | sed "s;$GOROOT;/go;") + +exec sel_ldr_x86_32 -l /dev/null -S -e "$@" diff --git a/misc/nacl/go_nacl_amd64p32_exec b/misc/nacl/go_nacl_amd64p32_exec new file mode 100755 index 0000000000000000000000000000000000000000..0a5ed651f141bf6c5d1b449cb302ea0ad49cf5f0 --- /dev/null +++ b/misc/nacl/go_nacl_amd64p32_exec @@ -0,0 +1,10 @@ +#!/bin/bash + +eval $(go env) + +export NACLENV_GOARCH=$GOARCH +export NACLENV_GOOS=$GOOS +export NACLENV_GOROOT=/go +export NACLENV_NACLPWD=$(pwd | sed "s;$GOROOT;/go;") + +exec sel_ldr_x86_64 -l /dev/null -S -e "$@" diff --git a/misc/nacl/go_nacl_arm_exec b/misc/nacl/go_nacl_arm_exec new file mode 100755 index 0000000000000000000000000000000000000000..4275cb1111c091fbcc0d03d99a9b8ce3d0587325 --- /dev/null +++ b/misc/nacl/go_nacl_arm_exec @@ -0,0 +1,10 @@ +#!/bin/bash + +eval $(go env) + +export NACLENV_GOARCH=$GOARCH +export NACLENV_GOOS=$GOOS +export NACLENV_GOROOT=/go +export NACLENV_NACLPWD=$(pwd | sed "s;$GOROOT;/go;") + +exec nacl_helper_bootstrap_arm $(which sel_ldr_arm) --reserved_at_zero=0xXXXXXXXXXXXXXXXX -l /dev/null -S -e "$@" diff --git a/misc/nacl/mkzip.go b/misc/nacl/mkzip.go new file mode 100644 index 0000000000000000000000000000000000000000..aaf37f120fccd6d8d2f81c26efec2253c21e6cf9 --- /dev/null +++ b/misc/nacl/mkzip.go @@ -0,0 +1,226 @@ +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Mkzip creates a zip file from a 'proto' file describing the contents. +// +// The proto file is inspired by the Plan 9 mkfs prototype file format. +// It describes a file tree, one directory per line, with leading tab +// indentation marking the tree structure. Each line contains a leading +// name field giving the name of the file to copy into the zip file, +// and then a sequence of optional key=value attributes to control +// the copy. The only known attribute is src=foo, meaning copy the +// actual data for the file (or directory) from an alternate location. +package main + +import ( + "archive/zip" + "bufio" + "flag" + "fmt" + "io" + "io/ioutil" + "log" + "os" + "path" + "path/filepath" + "strings" +) + +func usage() { + fmt.Fprintf(os.Stderr, "usage: mkzip [-r root] src.proto out.zip\n") + os.Exit(2) +} + +func sysfatal(format string, args ...interface{}) { + fmt.Fprintf(os.Stderr, "mkzip: %s\n", fmt.Sprintf(format, args...)) + os.Exit(2) +} + +var ( + root = flag.String("r", ".", "interpret source paths relative to this directory") + gopackage = flag.String("p", "", "write Go source file in this package") +) + +type stack struct { + name string + src string + depth int +} + +func main() { + log.SetFlags(0) + flag.Usage = usage + flag.Parse() + + args := flag.Args() + if len(args) != 2 { + usage() + } + + rf, err := os.Open(args[0]) + if err != nil { + sysfatal("%v", err) + } + r := bufio.NewScanner(rf) + + zf, err := os.Create(args[1]) + if err != nil { + sysfatal("%v", err) + } + + var w io.Writer = zf + if *gopackage != "" { + fmt.Fprintf(zf, `package %s +import "sync" +func init() { + var once sync.Once + fsinit = func() { + once.Do(func() { + unzip("`, *gopackage) + gw := &goWriter{b: bufio.NewWriter(w)} + defer func() { + if err := gw.Close(); err != nil { + sysfatal("finishing Go output: %v", err) + } + }() + w = gw + } + z := zip.NewWriter(w) + + lineno := 0 + + addfile := func(info os.FileInfo, dst string, src string) { + zh, err := zip.FileInfoHeader(info) + if err != nil { + sysfatal("%s:%d: %s: %v", args[0], lineno, src, err) + } + zh.Name = dst + zh.Method = zip.Deflate + if info.IsDir() && !strings.HasSuffix(dst, "/") { + zh.Name += "/" + } + w, err := z.CreateHeader(zh) + if err != nil { + sysfatal("%s:%d: %s: %v", args[0], lineno, src, err) + } + if info.IsDir() { + return + } + r, err := os.Open(src) + if err != nil { + sysfatal("%s:%d: %s: %v", args[0], lineno, src, err) + } + defer r.Close() + if _, err := io.Copy(w, r); err != nil { + sysfatal("%s:%d: %s: %v", args[0], lineno, src, err) + } + } + + var stk []stack + + for r.Scan() { + line := r.Text() + lineno++ + s := strings.TrimLeft(line, "\t") + prefix, line := line[:len(line)-len(s)], s + if i := strings.Index(line, "#"); i >= 0 { + line = line[:i] + } + f := strings.Fields(line) + if len(f) == 0 { + continue + } + if strings.HasPrefix(line, " ") { + sysfatal("%s:%d: must use tabs for indentation", args[0], lineno) + } + depth := len(prefix) + for len(stk) > 0 && depth <= stk[len(stk)-1].depth { + stk = stk[:len(stk)-1] + } + parent := "" + psrc := *root + if len(stk) > 0 { + parent = stk[len(stk)-1].name + psrc = stk[len(stk)-1].src + } + if strings.Contains(f[0], "/") { + sysfatal("%s:%d: destination name cannot contain slash", args[0], lineno) + } + name := path.Join(parent, f[0]) + src := filepath.Join(psrc, f[0]) + for _, attr := range f[1:] { + i := strings.Index(attr, "=") + if i < 0 { + sysfatal("%s:%d: malformed attribute %q", args[0], lineno, attr) + } + key, val := attr[:i], attr[i+1:] + switch key { + case "src": + src = val + default: + sysfatal("%s:%d: unknown attribute %q", args[0], lineno, attr) + } + } + + stk = append(stk, stack{name: name, src: src, depth: depth}) + + if f[0] == "*" || f[0] == "+" { + if f[0] == "*" { + dir, err := ioutil.ReadDir(psrc) + if err != nil { + sysfatal("%s:%d: %v", args[0], lineno, err) + } + for _, d := range dir { + addfile(d, path.Join(parent, d.Name()), filepath.Join(psrc, d.Name())) + } + } else { + err := filepath.Walk(psrc, func(src string, info os.FileInfo, err error) error { + if err != nil { + return err + } + if src == psrc { + return nil + } + if psrc == "." { + psrc = "" + } + name := path.Join(parent, filepath.ToSlash(src[len(psrc):])) + addfile(info, name, src) + return nil + }) + if err != nil { + sysfatal("%s:%d: %v", args[0], lineno, err) + } + } + continue + } + + fi, err := os.Stat(src) + if err != nil { + sysfatal("%s:%d: %v", args[0], lineno, err) + } + addfile(fi, name, src) + } + + if err := z.Close(); err != nil { + sysfatal("finishing zip file: %v", err) + } +} + +type goWriter struct { + b *bufio.Writer +} + +func (w *goWriter) Write(b []byte) (int, error) { + for _, c := range b { + fmt.Fprintf(w.b, "\\x%02x", c) + } + return len(b), nil +} + +func (w *goWriter) Close() error { + fmt.Fprintf(w.b, "\")\n\t\t})\n\t}\n}") + w.b.Flush() + return nil +} diff --git a/misc/nacl/testdata/bin/placeholder b/misc/nacl/testdata/bin/placeholder new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/misc/nacl/testdata/empty b/misc/nacl/testdata/empty new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/misc/nacl/testdata/group b/misc/nacl/testdata/group new file mode 100644 index 0000000000000000000000000000000000000000..eb7f9a3072faf1f83ff09addda8a810998d95d81 --- /dev/null +++ b/misc/nacl/testdata/group @@ -0,0 +1,8 @@ +nobody:*:-2: +nogroup:*:-1: +wheel:*:0:root +daemon:*:1:root +kmem:*:2:root +sys:*:3:root +tty:*:4:root +operator:*:5:root diff --git a/misc/nacl/testdata/hosts b/misc/nacl/testdata/hosts new file mode 100644 index 0000000000000000000000000000000000000000..75721cd5afd69ad22111ed437cd4fe7ecfd6393c --- /dev/null +++ b/misc/nacl/testdata/hosts @@ -0,0 +1 @@ +127.0.0.1 localhost diff --git a/misc/nacl/testdata/mime.types b/misc/nacl/testdata/mime.types new file mode 100644 index 0000000000000000000000000000000000000000..2c41bd2c005e08ee5ab7ceb12c44b9b4cac9bb01 --- /dev/null +++ b/misc/nacl/testdata/mime.types @@ -0,0 +1,1596 @@ +# This file maps Internet media types to unique file extension(s). +# Although created for httpd, this file is used by many software systems +# and has been placed in the public domain for unlimited redisribution. +# +# The table below contains both registered and (common) unregistered types. +# A type that has no unique extension can be ignored -- they are listed +# here to guide configurations toward known types and to make it easier to +# identify "new" types. File extensions are also commonly used to indicate +# content languages and encodings, so choose them carefully. +# +# Internet media types should be registered as described in RFC 4288. +# The registry is at . +# +# MIME type (lowercased) Extensions +# ============================================ ========== +# application/1d-interleaved-parityfec +# application/3gpp-ims+xml +# application/activemessage +application/andrew-inset ez +# application/applefile +application/applixware aw +application/atom+xml atom +application/atomcat+xml atomcat +# application/atomicmail +application/atomsvc+xml atomsvc +# application/auth-policy+xml +# application/batch-smtp +# application/beep+xml +# application/calendar+xml +# application/cals-1840 +# application/ccmp+xml +application/ccxml+xml ccxml +application/cdmi-capability cdmia +application/cdmi-container cdmic +application/cdmi-domain cdmid +application/cdmi-object cdmio +application/cdmi-queue cdmiq +# application/cea-2018+xml +# application/cellml+xml +# application/cfw +# application/cnrp+xml +# application/commonground +# application/conference-info+xml +# application/cpl+xml +# application/csta+xml +# application/cstadata+xml +application/cu-seeme cu +# application/cybercash +application/davmount+xml davmount +# application/dca-rft +# application/dec-dx +# application/dialog-info+xml +# application/dicom +# application/dns +application/docbook+xml dbk +# application/dskpp+xml +application/dssc+der dssc +application/dssc+xml xdssc +# application/dvcs +application/ecmascript ecma +# application/edi-consent +# application/edi-x12 +# application/edifact +application/emma+xml emma +# application/epp+xml +application/epub+zip epub +# application/eshop +# application/example +application/exi exi +# application/fastinfoset +# application/fastsoap +# application/fits +application/font-tdpfr pfr +# application/framework-attributes+xml +application/gml+xml gml +application/gpx+xml gpx +application/gxf gxf +# application/h224 +# application/held+xml +# application/http +application/hyperstudio stk +# application/ibe-key-request+xml +# application/ibe-pkg-reply+xml +# application/ibe-pp-data +# application/iges +# application/im-iscomposing+xml +# application/index +# application/index.cmd +# application/index.obj +# application/index.response +# application/index.vnd +application/inkml+xml ink inkml +# application/iotp +application/ipfix ipfix +# application/ipp +# application/isup +application/java-archive jar +application/java-serialized-object ser +application/java-vm class +application/javascript js +application/json json +application/jsonml+json jsonml +# application/kpml-request+xml +# application/kpml-response+xml +application/lost+xml lostxml +application/mac-binhex40 hqx +application/mac-compactpro cpt +# application/macwriteii +application/mads+xml mads +application/marc mrc +application/marcxml+xml mrcx +application/mathematica ma nb mb +# application/mathml-content+xml +# application/mathml-presentation+xml +application/mathml+xml mathml +# application/mbms-associated-procedure-description+xml +# application/mbms-deregister+xml +# application/mbms-envelope+xml +# application/mbms-msk+xml +# application/mbms-msk-response+xml +# application/mbms-protection-description+xml +# application/mbms-reception-report+xml +# application/mbms-register+xml +# application/mbms-register-response+xml +# application/mbms-user-service-description+xml +application/mbox mbox +# application/media_control+xml +application/mediaservercontrol+xml mscml +application/metalink+xml metalink +application/metalink4+xml meta4 +application/mets+xml mets +# application/mikey +application/mods+xml mods +# application/moss-keys +# application/moss-signature +# application/mosskey-data +# application/mosskey-request +application/mp21 m21 mp21 +application/mp4 mp4s +# application/mpeg4-generic +# application/mpeg4-iod +# application/mpeg4-iod-xmt +# application/msc-ivr+xml +# application/msc-mixer+xml +application/msword doc dot +application/mxf mxf +# application/nasdata +# application/news-checkgroups +# application/news-groupinfo +# application/news-transmission +# application/nss +# application/ocsp-request +# application/ocsp-response +application/octet-stream bin dms lrf mar so dist distz pkg bpk dump elc deploy mobipocket-ebook +application/oda oda +application/oebps-package+xml opf +application/ogg ogx +application/omdoc+xml omdoc +application/onenote onetoc onetoc2 onetmp onepkg +application/oxps oxps +# application/parityfec +application/patch-ops-error+xml xer +application/pdf pdf +application/pgp-encrypted pgp +# application/pgp-keys +application/pgp-signature asc sig +application/pics-rules prf +# application/pidf+xml +# application/pidf-diff+xml +application/pkcs10 p10 +application/pkcs7-mime p7m p7c +application/pkcs7-signature p7s +application/pkcs8 p8 +application/pkix-attr-cert ac +application/pkix-cert cer +application/pkix-crl crl +application/pkix-pkipath pkipath +application/pkixcmp pki +application/pls+xml pls +# application/poc-settings+xml +application/postscript ai eps ps +# application/prs.alvestrand.titrax-sheet +application/prs.cww cww +# application/prs.nprend +# application/prs.plucker +# application/prs.rdf-xml-crypt +# application/prs.xsf+xml +application/pskc+xml pskcxml +# application/qsig +application/rdf+xml rdf +application/reginfo+xml rif +application/relax-ng-compact-syntax rnc +# application/remote-printing +application/resource-lists+xml rl +application/resource-lists-diff+xml rld +# application/riscos +# application/rlmi+xml +application/rls-services+xml rs +application/rpki-ghostbusters gbr +application/rpki-manifest mft +application/rpki-roa roa +# application/rpki-updown +application/rsd+xml rsd +application/rss+xml rss +application/rtf rtf +# application/rtx +# application/samlassertion+xml +# application/samlmetadata+xml +application/sbml+xml sbml +application/scvp-cv-request scq +application/scvp-cv-response scs +application/scvp-vp-request spq +application/scvp-vp-response spp +application/sdp sdp +# application/set-payment +application/set-payment-initiation setpay +# application/set-registration +application/set-registration-initiation setreg +# application/sgml +# application/sgml-open-catalog +application/shf+xml shf +# application/sieve +# application/simple-filter+xml +# application/simple-message-summary +# application/simplesymbolcontainer +# application/slate +# application/smil +application/smil+xml smi smil +# application/soap+fastinfoset +# application/soap+xml +application/sparql-query rq +application/sparql-results+xml srx +# application/spirits-event+xml +application/srgs gram +application/srgs+xml grxml +application/sru+xml sru +application/ssdl+xml ssdl +application/ssml+xml ssml +# application/tamp-apex-update +# application/tamp-apex-update-confirm +# application/tamp-community-update +# application/tamp-community-update-confirm +# application/tamp-error +# application/tamp-sequence-adjust +# application/tamp-sequence-adjust-confirm +# application/tamp-status-query +# application/tamp-status-response +# application/tamp-update +# application/tamp-update-confirm +application/tei+xml tei teicorpus +application/thraud+xml tfi +# application/timestamp-query +# application/timestamp-reply +application/timestamped-data tsd +# application/tve-trigger +# application/ulpfec +# application/vcard+xml +# application/vemmi +# application/vividence.scriptfile +# application/vnd.3gpp.bsf+xml +application/vnd.3gpp.pic-bw-large plb +application/vnd.3gpp.pic-bw-small psb +application/vnd.3gpp.pic-bw-var pvb +# application/vnd.3gpp.sms +# application/vnd.3gpp2.bcmcsinfo+xml +# application/vnd.3gpp2.sms +application/vnd.3gpp2.tcap tcap +application/vnd.3m.post-it-notes pwn +application/vnd.accpac.simply.aso aso +application/vnd.accpac.simply.imp imp +application/vnd.acucobol acu +application/vnd.acucorp atc acutc +application/vnd.adobe.air-application-installer-package+zip air +application/vnd.adobe.formscentral.fcdt fcdt +application/vnd.adobe.fxp fxp fxpl +# application/vnd.adobe.partial-upload +application/vnd.adobe.xdp+xml xdp +application/vnd.adobe.xfdf xfdf +# application/vnd.aether.imp +# application/vnd.ah-barcode +application/vnd.ahead.space ahead +application/vnd.airzip.filesecure.azf azf +application/vnd.airzip.filesecure.azs azs +application/vnd.amazon.ebook azw +application/vnd.americandynamics.acc acc +application/vnd.amiga.ami ami +# application/vnd.amundsen.maze+xml +application/vnd.android.package-archive apk +application/vnd.anser-web-certificate-issue-initiation cii +application/vnd.anser-web-funds-transfer-initiation fti +application/vnd.antix.game-component atx +application/vnd.apple.installer+xml mpkg +application/vnd.apple.mpegurl m3u8 +# application/vnd.arastra.swi +application/vnd.aristanetworks.swi swi +application/vnd.astraea-software.iota iota +application/vnd.audiograph aep +# application/vnd.autopackage +# application/vnd.avistar+xml +application/vnd.blueice.multipass mpm +# application/vnd.bluetooth.ep.oob +application/vnd.bmi bmi +application/vnd.businessobjects rep +# application/vnd.cab-jscript +# application/vnd.canon-cpdl +# application/vnd.canon-lips +# application/vnd.cendio.thinlinc.clientconf +application/vnd.chemdraw+xml cdxml +application/vnd.chipnuts.karaoke-mmd mmd +application/vnd.cinderella cdy +# application/vnd.cirpack.isdn-ext +application/vnd.claymore cla +application/vnd.cloanto.rp9 rp9 +application/vnd.clonk.c4group c4g c4d c4f c4p c4u +application/vnd.cluetrust.cartomobile-config c11amc +application/vnd.cluetrust.cartomobile-config-pkg c11amz +# application/vnd.collection+json +# application/vnd.commerce-battelle +application/vnd.commonspace csp +application/vnd.contact.cmsg cdbcmsg +application/vnd.cosmocaller cmc +application/vnd.crick.clicker clkx +application/vnd.crick.clicker.keyboard clkk +application/vnd.crick.clicker.palette clkp +application/vnd.crick.clicker.template clkt +application/vnd.crick.clicker.wordbank clkw +application/vnd.criticaltools.wbs+xml wbs +application/vnd.ctc-posml pml +# application/vnd.ctct.ws+xml +# application/vnd.cups-pdf +# application/vnd.cups-postscript +application/vnd.cups-ppd ppd +# application/vnd.cups-raster +# application/vnd.cups-raw +# application/vnd.curl +application/vnd.curl.car car +application/vnd.curl.pcurl pcurl +# application/vnd.cybank +application/vnd.dart dart +application/vnd.data-vision.rdz rdz +application/vnd.dece.data uvf uvvf uvd uvvd +application/vnd.dece.ttml+xml uvt uvvt +application/vnd.dece.unspecified uvx uvvx +application/vnd.dece.zip uvz uvvz +application/vnd.denovo.fcselayout-link fe_launch +# application/vnd.dir-bi.plate-dl-nosuffix +application/vnd.dna dna +application/vnd.dolby.mlp mlp +# application/vnd.dolby.mobile.1 +# application/vnd.dolby.mobile.2 +application/vnd.dpgraph dpg +application/vnd.dreamfactory dfac +application/vnd.ds-keypoint kpxx +application/vnd.dvb.ait ait +# application/vnd.dvb.dvbj +# application/vnd.dvb.esgcontainer +# application/vnd.dvb.ipdcdftnotifaccess +# application/vnd.dvb.ipdcesgaccess +# application/vnd.dvb.ipdcesgaccess2 +# application/vnd.dvb.ipdcesgpdd +# application/vnd.dvb.ipdcroaming +# application/vnd.dvb.iptv.alfec-base +# application/vnd.dvb.iptv.alfec-enhancement +# application/vnd.dvb.notif-aggregate-root+xml +# application/vnd.dvb.notif-container+xml +# application/vnd.dvb.notif-generic+xml +# application/vnd.dvb.notif-ia-msglist+xml +# application/vnd.dvb.notif-ia-registration-request+xml +# application/vnd.dvb.notif-ia-registration-response+xml +# application/vnd.dvb.notif-init+xml +# application/vnd.dvb.pfr +application/vnd.dvb.service svc +# application/vnd.dxr +application/vnd.dynageo geo +# application/vnd.easykaraoke.cdgdownload +# application/vnd.ecdis-update +application/vnd.ecowin.chart mag +# application/vnd.ecowin.filerequest +# application/vnd.ecowin.fileupdate +# application/vnd.ecowin.series +# application/vnd.ecowin.seriesrequest +# application/vnd.ecowin.seriesupdate +# application/vnd.emclient.accessrequest+xml +application/vnd.enliven nml +# application/vnd.eprints.data+xml +application/vnd.epson.esf esf +application/vnd.epson.msf msf +application/vnd.epson.quickanime qam +application/vnd.epson.salt slt +application/vnd.epson.ssf ssf +# application/vnd.ericsson.quickcall +application/vnd.eszigno3+xml es3 et3 +# application/vnd.etsi.aoc+xml +# application/vnd.etsi.cug+xml +# application/vnd.etsi.iptvcommand+xml +# application/vnd.etsi.iptvdiscovery+xml +# application/vnd.etsi.iptvprofile+xml +# application/vnd.etsi.iptvsad-bc+xml +# application/vnd.etsi.iptvsad-cod+xml +# application/vnd.etsi.iptvsad-npvr+xml +# application/vnd.etsi.iptvservice+xml +# application/vnd.etsi.iptvsync+xml +# application/vnd.etsi.iptvueprofile+xml +# application/vnd.etsi.mcid+xml +# application/vnd.etsi.overload-control-policy-dataset+xml +# application/vnd.etsi.sci+xml +# application/vnd.etsi.simservs+xml +# application/vnd.etsi.tsl+xml +# application/vnd.etsi.tsl.der +# application/vnd.eudora.data +application/vnd.ezpix-album ez2 +application/vnd.ezpix-package ez3 +# application/vnd.f-secure.mobile +application/vnd.fdf fdf +application/vnd.fdsn.mseed mseed +application/vnd.fdsn.seed seed dataless +# application/vnd.ffsns +# application/vnd.fints +application/vnd.flographit gph +application/vnd.fluxtime.clip ftc +# application/vnd.font-fontforge-sfd +application/vnd.framemaker fm frame maker book +application/vnd.frogans.fnc fnc +application/vnd.frogans.ltf ltf +application/vnd.fsc.weblaunch fsc +application/vnd.fujitsu.oasys oas +application/vnd.fujitsu.oasys2 oa2 +application/vnd.fujitsu.oasys3 oa3 +application/vnd.fujitsu.oasysgp fg5 +application/vnd.fujitsu.oasysprs bh2 +# application/vnd.fujixerox.art-ex +# application/vnd.fujixerox.art4 +# application/vnd.fujixerox.hbpl +application/vnd.fujixerox.ddd ddd +application/vnd.fujixerox.docuworks xdw +application/vnd.fujixerox.docuworks.binder xbd +# application/vnd.fut-misnet +application/vnd.fuzzysheet fzs +application/vnd.genomatix.tuxedo txd +# application/vnd.geocube+xml +application/vnd.geogebra.file ggb +application/vnd.geogebra.tool ggt +application/vnd.geometry-explorer gex gre +application/vnd.geonext gxt +application/vnd.geoplan g2w +application/vnd.geospace g3w +# application/vnd.globalplatform.card-content-mgt +# application/vnd.globalplatform.card-content-mgt-response +application/vnd.gmx gmx +application/vnd.google-earth.kml+xml kml +application/vnd.google-earth.kmz kmz +application/vnd.grafeq gqf gqs +# application/vnd.gridmp +application/vnd.groove-account gac +application/vnd.groove-help ghf +application/vnd.groove-identity-message gim +application/vnd.groove-injector grv +application/vnd.groove-tool-message gtm +application/vnd.groove-tool-template tpl +application/vnd.groove-vcard vcg +# application/vnd.hal+json +application/vnd.hal+xml hal +application/vnd.handheld-entertainment+xml zmm +application/vnd.hbci hbci +# application/vnd.hcl-bireports +application/vnd.hhe.lesson-player les +application/vnd.hp-hpgl hpgl +application/vnd.hp-hpid hpid +application/vnd.hp-hps hps +application/vnd.hp-jlyt jlt +application/vnd.hp-pcl pcl +application/vnd.hp-pclxl pclxl +# application/vnd.httphone +application/vnd.hydrostatix.sof-data sfd-hdstx +# application/vnd.hzn-3d-crossword +# application/vnd.ibm.afplinedata +# application/vnd.ibm.electronic-media +application/vnd.ibm.minipay mpy +application/vnd.ibm.modcap afp listafp list3820 +application/vnd.ibm.rights-management irm +application/vnd.ibm.secure-container sc +application/vnd.iccprofile icc icm +application/vnd.igloader igl +application/vnd.immervision-ivp ivp +application/vnd.immervision-ivu ivu +# application/vnd.informedcontrol.rms+xml +# application/vnd.informix-visionary +# application/vnd.infotech.project +# application/vnd.infotech.project+xml +# application/vnd.innopath.wamp.notification +application/vnd.insors.igm igm +application/vnd.intercon.formnet xpw xpx +application/vnd.intergeo i2g +# application/vnd.intertrust.digibox +# application/vnd.intertrust.nncp +application/vnd.intu.qbo qbo +application/vnd.intu.qfx qfx +# application/vnd.iptc.g2.conceptitem+xml +# application/vnd.iptc.g2.knowledgeitem+xml +# application/vnd.iptc.g2.newsitem+xml +# application/vnd.iptc.g2.newsmessage+xml +# application/vnd.iptc.g2.packageitem+xml +# application/vnd.iptc.g2.planningitem+xml +application/vnd.ipunplugged.rcprofile rcprofile +application/vnd.irepository.package+xml irp +application/vnd.is-xpr xpr +application/vnd.isac.fcs fcs +application/vnd.jam jam +# application/vnd.japannet-directory-service +# application/vnd.japannet-jpnstore-wakeup +# application/vnd.japannet-payment-wakeup +# application/vnd.japannet-registration +# application/vnd.japannet-registration-wakeup +# application/vnd.japannet-setstore-wakeup +# application/vnd.japannet-verification +# application/vnd.japannet-verification-wakeup +application/vnd.jcp.javame.midlet-rms rms +application/vnd.jisp jisp +application/vnd.joost.joda-archive joda +application/vnd.kahootz ktz ktr +application/vnd.kde.karbon karbon +application/vnd.kde.kchart chrt +application/vnd.kde.kformula kfo +application/vnd.kde.kivio flw +application/vnd.kde.kontour kon +application/vnd.kde.kpresenter kpr kpt +application/vnd.kde.kspread ksp +application/vnd.kde.kword kwd kwt +application/vnd.kenameaapp htke +application/vnd.kidspiration kia +application/vnd.kinar kne knp +application/vnd.koan skp skd skt skm +application/vnd.kodak-descriptor sse +application/vnd.las.las+xml lasxml +# application/vnd.liberty-request+xml +application/vnd.llamagraphics.life-balance.desktop lbd +application/vnd.llamagraphics.life-balance.exchange+xml lbe +application/vnd.lotus-1-2-3 123 +application/vnd.lotus-approach apr +application/vnd.lotus-freelance pre +application/vnd.lotus-notes nsf +application/vnd.lotus-organizer org +application/vnd.lotus-screencam scm +application/vnd.lotus-wordpro lwp +application/vnd.macports.portpkg portpkg +# application/vnd.marlin.drm.actiontoken+xml +# application/vnd.marlin.drm.conftoken+xml +# application/vnd.marlin.drm.license+xml +# application/vnd.marlin.drm.mdcf +application/vnd.mcd mcd +application/vnd.medcalcdata mc1 +application/vnd.mediastation.cdkey cdkey +# application/vnd.meridian-slingshot +application/vnd.mfer mwf +application/vnd.mfmp mfm +application/vnd.micrografx.flo flo +application/vnd.micrografx.igx igx +application/vnd.mif mif +# application/vnd.minisoft-hp3000-save +# application/vnd.mitsubishi.misty-guard.trustweb +application/vnd.mobius.daf daf +application/vnd.mobius.dis dis +application/vnd.mobius.mbk mbk +application/vnd.mobius.mqy mqy +application/vnd.mobius.msl msl +application/vnd.mobius.plc plc +application/vnd.mobius.txf txf +application/vnd.mophun.application mpn +application/vnd.mophun.certificate mpc +# application/vnd.motorola.flexsuite +# application/vnd.motorola.flexsuite.adsi +# application/vnd.motorola.flexsuite.fis +# application/vnd.motorola.flexsuite.gotap +# application/vnd.motorola.flexsuite.kmr +# application/vnd.motorola.flexsuite.ttc +# application/vnd.motorola.flexsuite.wem +# application/vnd.motorola.iprm +application/vnd.mozilla.xul+xml xul +application/vnd.ms-artgalry cil +# application/vnd.ms-asf +application/vnd.ms-cab-compressed cab +# application/vnd.ms-color.iccprofile +application/vnd.ms-excel xls xlm xla xlc xlt xlw +application/vnd.ms-excel.addin.macroenabled.12 xlam +application/vnd.ms-excel.sheet.binary.macroenabled.12 xlsb +application/vnd.ms-excel.sheet.macroenabled.12 xlsm +application/vnd.ms-excel.template.macroenabled.12 xltm +application/vnd.ms-fontobject eot +application/vnd.ms-htmlhelp chm +application/vnd.ms-ims ims +application/vnd.ms-lrm lrm +# application/vnd.ms-office.activex+xml +application/vnd.ms-officetheme thmx +# application/vnd.ms-opentype +# application/vnd.ms-package.obfuscated-opentype +application/vnd.ms-pki.seccat cat +application/vnd.ms-pki.stl stl +# application/vnd.ms-playready.initiator+xml +application/vnd.ms-powerpoint ppt pps pot +application/vnd.ms-powerpoint.addin.macroenabled.12 ppam +application/vnd.ms-powerpoint.presentation.macroenabled.12 pptm +application/vnd.ms-powerpoint.slide.macroenabled.12 sldm +application/vnd.ms-powerpoint.slideshow.macroenabled.12 ppsm +application/vnd.ms-powerpoint.template.macroenabled.12 potm +# application/vnd.ms-printing.printticket+xml +application/vnd.ms-project mpp mpt +# application/vnd.ms-tnef +# application/vnd.ms-wmdrm.lic-chlg-req +# application/vnd.ms-wmdrm.lic-resp +# application/vnd.ms-wmdrm.meter-chlg-req +# application/vnd.ms-wmdrm.meter-resp +application/vnd.ms-word.document.macroenabled.12 docm +application/vnd.ms-word.template.macroenabled.12 dotm +application/vnd.ms-works wps wks wcm wdb +application/vnd.ms-wpl wpl +application/vnd.ms-xpsdocument xps +application/vnd.mseq mseq +# application/vnd.msign +# application/vnd.multiad.creator +# application/vnd.multiad.creator.cif +# application/vnd.music-niff +application/vnd.musician mus +application/vnd.muvee.style msty +application/vnd.mynfc taglet +# application/vnd.ncd.control +# application/vnd.ncd.reference +# application/vnd.nervana +# application/vnd.netfpx +application/vnd.neurolanguage.nlu nlu +application/vnd.nitf ntf nitf +application/vnd.noblenet-directory nnd +application/vnd.noblenet-sealer nns +application/vnd.noblenet-web nnw +# application/vnd.nokia.catalogs +# application/vnd.nokia.conml+wbxml +# application/vnd.nokia.conml+xml +# application/vnd.nokia.isds-radio-presets +# application/vnd.nokia.iptv.config+xml +# application/vnd.nokia.landmark+wbxml +# application/vnd.nokia.landmark+xml +# application/vnd.nokia.landmarkcollection+xml +# application/vnd.nokia.n-gage.ac+xml +application/vnd.nokia.n-gage.data ngdat +application/vnd.nokia.n-gage.symbian.install n-gage +# application/vnd.nokia.ncd +# application/vnd.nokia.pcd+wbxml +# application/vnd.nokia.pcd+xml +application/vnd.nokia.radio-preset rpst +application/vnd.nokia.radio-presets rpss +application/vnd.novadigm.edm edm +application/vnd.novadigm.edx edx +application/vnd.novadigm.ext ext +# application/vnd.ntt-local.file-transfer +# application/vnd.ntt-local.sip-ta_remote +# application/vnd.ntt-local.sip-ta_tcp_stream +application/vnd.oasis.opendocument.chart odc +application/vnd.oasis.opendocument.chart-template otc +application/vnd.oasis.opendocument.database odb +application/vnd.oasis.opendocument.formula odf +application/vnd.oasis.opendocument.formula-template odft +application/vnd.oasis.opendocument.graphics odg +application/vnd.oasis.opendocument.graphics-template otg +application/vnd.oasis.opendocument.image odi +application/vnd.oasis.opendocument.image-template oti +application/vnd.oasis.opendocument.presentation odp +application/vnd.oasis.opendocument.presentation-template otp +application/vnd.oasis.opendocument.spreadsheet ods +application/vnd.oasis.opendocument.spreadsheet-template ots +application/vnd.oasis.opendocument.text odt +application/vnd.oasis.opendocument.text-master odm +application/vnd.oasis.opendocument.text-template ott +application/vnd.oasis.opendocument.text-web oth +# application/vnd.obn +# application/vnd.oftn.l10n+json +# application/vnd.oipf.contentaccessdownload+xml +# application/vnd.oipf.contentaccessstreaming+xml +# application/vnd.oipf.cspg-hexbinary +# application/vnd.oipf.dae.svg+xml +# application/vnd.oipf.dae.xhtml+xml +# application/vnd.oipf.mippvcontrolmessage+xml +# application/vnd.oipf.pae.gem +# application/vnd.oipf.spdiscovery+xml +# application/vnd.oipf.spdlist+xml +# application/vnd.oipf.ueprofile+xml +# application/vnd.oipf.userprofile+xml +application/vnd.olpc-sugar xo +# application/vnd.oma-scws-config +# application/vnd.oma-scws-http-request +# application/vnd.oma-scws-http-response +# application/vnd.oma.bcast.associated-procedure-parameter+xml +# application/vnd.oma.bcast.drm-trigger+xml +# application/vnd.oma.bcast.imd+xml +# application/vnd.oma.bcast.ltkm +# application/vnd.oma.bcast.notification+xml +# application/vnd.oma.bcast.provisioningtrigger +# application/vnd.oma.bcast.sgboot +# application/vnd.oma.bcast.sgdd+xml +# application/vnd.oma.bcast.sgdu +# application/vnd.oma.bcast.simple-symbol-container +# application/vnd.oma.bcast.smartcard-trigger+xml +# application/vnd.oma.bcast.sprov+xml +# application/vnd.oma.bcast.stkm +# application/vnd.oma.cab-address-book+xml +# application/vnd.oma.cab-feature-handler+xml +# application/vnd.oma.cab-pcc+xml +# application/vnd.oma.cab-user-prefs+xml +# application/vnd.oma.dcd +# application/vnd.oma.dcdc +application/vnd.oma.dd2+xml dd2 +# application/vnd.oma.drm.risd+xml +# application/vnd.oma.group-usage-list+xml +# application/vnd.oma.pal+xml +# application/vnd.oma.poc.detailed-progress-report+xml +# application/vnd.oma.poc.final-report+xml +# application/vnd.oma.poc.groups+xml +# application/vnd.oma.poc.invocation-descriptor+xml +# application/vnd.oma.poc.optimized-progress-report+xml +# application/vnd.oma.push +# application/vnd.oma.scidm.messages+xml +# application/vnd.oma.xcap-directory+xml +# application/vnd.omads-email+xml +# application/vnd.omads-file+xml +# application/vnd.omads-folder+xml +# application/vnd.omaloc-supl-init +application/vnd.openofficeorg.extension oxt +# application/vnd.openxmlformats-officedocument.custom-properties+xml +# application/vnd.openxmlformats-officedocument.customxmlproperties+xml +# application/vnd.openxmlformats-officedocument.drawing+xml +# application/vnd.openxmlformats-officedocument.drawingml.chart+xml +# application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml +# application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml +# application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml +# application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml +# application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml +# application/vnd.openxmlformats-officedocument.extended-properties+xml +# application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml +# application/vnd.openxmlformats-officedocument.presentationml.comments+xml +# application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml +# application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml +# application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml +application/vnd.openxmlformats-officedocument.presentationml.presentation pptx +# application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml +# application/vnd.openxmlformats-officedocument.presentationml.presprops+xml +application/vnd.openxmlformats-officedocument.presentationml.slide sldx +# application/vnd.openxmlformats-officedocument.presentationml.slide+xml +# application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml +# application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml +application/vnd.openxmlformats-officedocument.presentationml.slideshow ppsx +# application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml +# application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml +# application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml +# application/vnd.openxmlformats-officedocument.presentationml.tags+xml +application/vnd.openxmlformats-officedocument.presentationml.template potx +# application/vnd.openxmlformats-officedocument.presentationml.template.main+xml +# application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml +# application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml +# application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml +# application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml +# application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml +# application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml +# application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml +# application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml +# application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml +# application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml +# application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml +# application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml +# application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml +# application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml +application/vnd.openxmlformats-officedocument.spreadsheetml.sheet xlsx +# application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml +# application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml +# application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml +# application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml +# application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml +application/vnd.openxmlformats-officedocument.spreadsheetml.template xltx +# application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml +# application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml +# application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml +# application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml +# application/vnd.openxmlformats-officedocument.theme+xml +# application/vnd.openxmlformats-officedocument.themeoverride+xml +# application/vnd.openxmlformats-officedocument.vmldrawing +# application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml +application/vnd.openxmlformats-officedocument.wordprocessingml.document docx +# application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml +# application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml +# application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml +# application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml +# application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml +# application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml +# application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml +# application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml +# application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml +application/vnd.openxmlformats-officedocument.wordprocessingml.template dotx +# application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml +# application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml +# application/vnd.openxmlformats-package.core-properties+xml +# application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml +# application/vnd.openxmlformats-package.relationships+xml +# application/vnd.quobject-quoxdocument +# application/vnd.osa.netdeploy +application/vnd.osgeo.mapguide.package mgp +# application/vnd.osgi.bundle +application/vnd.osgi.dp dp +application/vnd.osgi.subsystem esa +# application/vnd.otps.ct-kip+xml +application/vnd.palm pdb pqa oprc +# application/vnd.paos.xml +application/vnd.pawaafile paw +application/vnd.pg.format str +application/vnd.pg.osasli ei6 +# application/vnd.piaccess.application-licence +application/vnd.picsel efif +application/vnd.pmi.widget wg +# application/vnd.poc.group-advertisement+xml +application/vnd.pocketlearn plf +application/vnd.powerbuilder6 pbd +# application/vnd.powerbuilder6-s +# application/vnd.powerbuilder7 +# application/vnd.powerbuilder7-s +# application/vnd.powerbuilder75 +# application/vnd.powerbuilder75-s +# application/vnd.preminet +application/vnd.previewsystems.box box +application/vnd.proteus.magazine mgz +application/vnd.publishare-delta-tree qps +application/vnd.pvi.ptid1 ptid +# application/vnd.pwg-multiplexed +# application/vnd.pwg-xhtml-print+xml +# application/vnd.qualcomm.brew-app-res +application/vnd.quark.quarkxpress qxd qxt qwd qwt qxl qxb +# application/vnd.radisys.moml+xml +# application/vnd.radisys.msml+xml +# application/vnd.radisys.msml-audit+xml +# application/vnd.radisys.msml-audit-conf+xml +# application/vnd.radisys.msml-audit-conn+xml +# application/vnd.radisys.msml-audit-dialog+xml +# application/vnd.radisys.msml-audit-stream+xml +# application/vnd.radisys.msml-conf+xml +# application/vnd.radisys.msml-dialog+xml +# application/vnd.radisys.msml-dialog-base+xml +# application/vnd.radisys.msml-dialog-fax-detect+xml +# application/vnd.radisys.msml-dialog-fax-sendrecv+xml +# application/vnd.radisys.msml-dialog-group+xml +# application/vnd.radisys.msml-dialog-speech+xml +# application/vnd.radisys.msml-dialog-transform+xml +# application/vnd.rainstor.data +# application/vnd.rapid +application/vnd.realvnc.bed bed +application/vnd.recordare.musicxml mxl +application/vnd.recordare.musicxml+xml musicxml +# application/vnd.renlearn.rlprint +application/vnd.rig.cryptonote cryptonote +application/vnd.rim.cod cod +application/vnd.rn-realmedia rm +application/vnd.rn-realmedia-vbr rmvb +application/vnd.route66.link66+xml link66 +# application/vnd.rs-274x +# application/vnd.ruckus.download +# application/vnd.s3sms +application/vnd.sailingtracker.track st +# application/vnd.sbm.cid +# application/vnd.sbm.mid2 +# application/vnd.scribus +# application/vnd.sealed.3df +# application/vnd.sealed.csf +# application/vnd.sealed.doc +# application/vnd.sealed.eml +# application/vnd.sealed.mht +# application/vnd.sealed.net +# application/vnd.sealed.ppt +# application/vnd.sealed.tiff +# application/vnd.sealed.xls +# application/vnd.sealedmedia.softseal.html +# application/vnd.sealedmedia.softseal.pdf +application/vnd.seemail see +application/vnd.sema sema +application/vnd.semd semd +application/vnd.semf semf +application/vnd.shana.informed.formdata ifm +application/vnd.shana.informed.formtemplate itp +application/vnd.shana.informed.interchange iif +application/vnd.shana.informed.package ipk +application/vnd.simtech-mindmapper twd twds +application/vnd.smaf mmf +# application/vnd.smart.notebook +application/vnd.smart.teacher teacher +# application/vnd.software602.filler.form+xml +# application/vnd.software602.filler.form-xml-zip +application/vnd.solent.sdkm+xml sdkm sdkd +application/vnd.spotfire.dxp dxp +application/vnd.spotfire.sfs sfs +# application/vnd.sss-cod +# application/vnd.sss-dtf +# application/vnd.sss-ntf +application/vnd.stardivision.calc sdc +application/vnd.stardivision.draw sda +application/vnd.stardivision.impress sdd +application/vnd.stardivision.math smf +application/vnd.stardivision.writer sdw vor +application/vnd.stardivision.writer-global sgl +application/vnd.stepmania.package smzip +application/vnd.stepmania.stepchart sm +# application/vnd.street-stream +application/vnd.sun.xml.calc sxc +application/vnd.sun.xml.calc.template stc +application/vnd.sun.xml.draw sxd +application/vnd.sun.xml.draw.template std +application/vnd.sun.xml.impress sxi +application/vnd.sun.xml.impress.template sti +application/vnd.sun.xml.math sxm +application/vnd.sun.xml.writer sxw +application/vnd.sun.xml.writer.global sxg +application/vnd.sun.xml.writer.template stw +# application/vnd.sun.wadl+xml +application/vnd.sus-calendar sus susp +application/vnd.svd svd +# application/vnd.swiftview-ics +application/vnd.symbian.install sis sisx +application/vnd.syncml+xml xsm +application/vnd.syncml.dm+wbxml bdm +application/vnd.syncml.dm+xml xdm +# application/vnd.syncml.dm.notification +# application/vnd.syncml.ds.notification +application/vnd.tao.intent-module-archive tao +application/vnd.tcpdump.pcap pcap cap dmp +application/vnd.tmobile-livetv tmo +application/vnd.trid.tpt tpt +application/vnd.triscape.mxs mxs +application/vnd.trueapp tra +# application/vnd.truedoc +# application/vnd.ubisoft.webplayer +application/vnd.ufdl ufd ufdl +application/vnd.uiq.theme utz +application/vnd.umajin umj +application/vnd.unity unityweb +application/vnd.uoml+xml uoml +# application/vnd.uplanet.alert +# application/vnd.uplanet.alert-wbxml +# application/vnd.uplanet.bearer-choice +# application/vnd.uplanet.bearer-choice-wbxml +# application/vnd.uplanet.cacheop +# application/vnd.uplanet.cacheop-wbxml +# application/vnd.uplanet.channel +# application/vnd.uplanet.channel-wbxml +# application/vnd.uplanet.list +# application/vnd.uplanet.list-wbxml +# application/vnd.uplanet.listcmd +# application/vnd.uplanet.listcmd-wbxml +# application/vnd.uplanet.signal +application/vnd.vcx vcx +# application/vnd.vd-study +# application/vnd.vectorworks +# application/vnd.verimatrix.vcas +# application/vnd.vidsoft.vidconference +application/vnd.visio vsd vst vss vsw +application/vnd.visionary vis +# application/vnd.vividence.scriptfile +application/vnd.vsf vsf +# application/vnd.wap.sic +# application/vnd.wap.slc +application/vnd.wap.wbxml wbxml +application/vnd.wap.wmlc wmlc +application/vnd.wap.wmlscriptc wmlsc +application/vnd.webturbo wtb +# application/vnd.wfa.wsc +# application/vnd.wmc +# application/vnd.wmf.bootstrap +# application/vnd.wolfram.mathematica +# application/vnd.wolfram.mathematica.package +application/vnd.wolfram.player nbp +application/vnd.wordperfect wpd +application/vnd.wqd wqd +# application/vnd.wrq-hp3000-labelled +application/vnd.wt.stf stf +# application/vnd.wv.csp+wbxml +# application/vnd.wv.csp+xml +# application/vnd.wv.ssp+xml +application/vnd.xara xar +application/vnd.xfdl xfdl +# application/vnd.xfdl.webform +# application/vnd.xmi+xml +# application/vnd.xmpie.cpkg +# application/vnd.xmpie.dpkg +# application/vnd.xmpie.plan +# application/vnd.xmpie.ppkg +# application/vnd.xmpie.xlim +application/vnd.yamaha.hv-dic hvd +application/vnd.yamaha.hv-script hvs +application/vnd.yamaha.hv-voice hvp +application/vnd.yamaha.openscoreformat osf +application/vnd.yamaha.openscoreformat.osfpvg+xml osfpvg +# application/vnd.yamaha.remote-setup +application/vnd.yamaha.smaf-audio saf +application/vnd.yamaha.smaf-phrase spf +# application/vnd.yamaha.through-ngn +# application/vnd.yamaha.tunnel-udpencap +application/vnd.yellowriver-custom-menu cmp +application/vnd.zul zir zirz +application/vnd.zzazz.deck+xml zaz +application/voicexml+xml vxml +# application/vq-rtcpxr +# application/watcherinfo+xml +# application/whoispp-query +# application/whoispp-response +application/widget wgt +application/winhlp hlp +# application/wita +# application/wordperfect5.1 +application/wsdl+xml wsdl +application/wspolicy+xml wspolicy +application/x-7z-compressed 7z +application/x-abiword abw +application/x-ace-compressed ace +# application/x-amf +application/x-apple-diskimage dmg +application/x-authorware-bin aab x32 u32 vox +application/x-authorware-map aam +application/x-authorware-seg aas +application/x-bcpio bcpio +application/x-bittorrent torrent +application/x-blorb blb blorb +application/x-bzip bz +application/x-bzip2 bz2 boz +application/x-cbr cbr cba cbt cbz cb7 +application/x-cdlink vcd +application/x-cfs-compressed cfs +application/x-chat chat +application/x-chess-pgn pgn +application/x-conference nsc +# application/x-compress +application/x-cpio cpio +application/x-csh csh +application/x-debian-package deb udeb +application/x-dgc-compressed dgc +application/x-director dir dcr dxr cst cct cxt w3d fgd swa +application/x-doom wad +application/x-dtbncx+xml ncx +application/x-dtbook+xml dtb +application/x-dtbresource+xml res +application/x-dvi dvi +application/x-envoy evy +application/x-eva eva +application/x-font-bdf bdf +# application/x-font-dos +# application/x-font-framemaker +application/x-font-ghostscript gsf +# application/x-font-libgrx +application/x-font-linux-psf psf +application/x-font-otf otf +application/x-font-pcf pcf +application/x-font-snf snf +# application/x-font-speedo +# application/x-font-sunos-news +application/x-font-ttf ttf ttc +application/x-font-type1 pfa pfb pfm afm +application/x-font-woff woff +# application/x-font-vfont +application/x-freearc arc +application/x-futuresplash spl +application/x-gca-compressed gca +application/x-glulx ulx +application/x-gnumeric gnumeric +application/x-gramps-xml gramps +application/x-gtar gtar +# application/x-gzip +application/x-hdf hdf +application/x-install-instructions install +application/x-iso9660-image iso +application/x-java-jnlp-file jnlp +application/x-latex latex +application/x-lzh-compressed lzh lha +application/x-mie mie +application/x-mobipocket-ebook prc mobi +application/x-mpegurl m3u8 +application/x-ms-application application +application/x-ms-shortcut lnk +application/x-ms-wmd wmd +application/x-ms-wmz wmz +application/x-ms-xbap xbap +application/x-msaccess mdb +application/x-msbinder obd +application/x-mscardfile crd +application/x-msclip clp +application/x-msdownload exe dll com bat msi +application/x-msmediaview mvb m13 m14 +application/x-msmetafile wmf wmz emf emz +application/x-msmoney mny +application/x-mspublisher pub +application/x-msschedule scd +application/x-msterminal trm +application/x-mswrite wri +application/x-netcdf nc cdf +application/x-nzb nzb +application/x-pkcs12 p12 pfx +application/x-pkcs7-certificates p7b spc +application/x-pkcs7-certreqresp p7r +application/x-rar-compressed rar +application/x-research-info-systems ris +application/x-sh sh +application/x-shar shar +application/x-shockwave-flash swf +application/x-silverlight-app xap +application/x-sql sql +application/x-stuffit sit +application/x-stuffitx sitx +application/x-subrip srt +application/x-sv4cpio sv4cpio +application/x-sv4crc sv4crc +application/x-t3vm-image t3 +application/x-tads gam +application/x-tar tar +application/x-tcl tcl +application/x-tex tex +application/x-tex-tfm tfm +application/x-texinfo texinfo texi +application/x-tgif obj +application/x-ustar ustar +application/x-wais-source src +application/x-x509-ca-cert der crt +application/x-xfig fig +application/x-xliff+xml xlf +application/x-xpinstall xpi +application/x-xz xz +application/x-zmachine z1 z2 z3 z4 z5 z6 z7 z8 +# application/x400-bp +application/xaml+xml xaml +# application/xcap-att+xml +# application/xcap-caps+xml +application/xcap-diff+xml xdf +# application/xcap-el+xml +# application/xcap-error+xml +# application/xcap-ns+xml +# application/xcon-conference-info-diff+xml +# application/xcon-conference-info+xml +application/xenc+xml xenc +application/xhtml+xml xhtml xht +# application/xhtml-voice+xml +application/xml xml xsl +application/xml-dtd dtd +# application/xml-external-parsed-entity +# application/xmpp+xml +application/xop+xml xop +application/xproc+xml xpl +application/xslt+xml xslt +application/xspf+xml xspf +application/xv+xml mxml xhvml xvml xvm +application/yang yang +application/yin+xml yin +application/zip zip +# audio/1d-interleaved-parityfec +# audio/32kadpcm +# audio/3gpp +# audio/3gpp2 +# audio/ac3 +audio/adpcm adp +# audio/amr +# audio/amr-wb +# audio/amr-wb+ +# audio/asc +# audio/atrac-advanced-lossless +# audio/atrac-x +# audio/atrac3 +audio/basic au snd +# audio/bv16 +# audio/bv32 +# audio/clearmode +# audio/cn +# audio/dat12 +# audio/dls +# audio/dsr-es201108 +# audio/dsr-es202050 +# audio/dsr-es202211 +# audio/dsr-es202212 +# audio/dv +# audio/dvi4 +# audio/eac3 +# audio/evrc +# audio/evrc-qcp +# audio/evrc0 +# audio/evrc1 +# audio/evrcb +# audio/evrcb0 +# audio/evrcb1 +# audio/evrcwb +# audio/evrcwb0 +# audio/evrcwb1 +# audio/example +# audio/fwdred +# audio/g719 +# audio/g722 +# audio/g7221 +# audio/g723 +# audio/g726-16 +# audio/g726-24 +# audio/g726-32 +# audio/g726-40 +# audio/g728 +# audio/g729 +# audio/g7291 +# audio/g729d +# audio/g729e +# audio/gsm +# audio/gsm-efr +# audio/gsm-hr-08 +# audio/ilbc +# audio/ip-mr_v2.5 +# audio/isac +# audio/l16 +# audio/l20 +# audio/l24 +# audio/l8 +# audio/lpc +audio/midi mid midi kar rmi +# audio/mobile-xmf +audio/mp4 mp4a +# audio/mp4a-latm +audio/mp4a-latm m4a m4p +# audio/mpa +# audio/mpa-robust +audio/mpeg mpga mp2 mp2a mp3 m2a m3a +# audio/mpeg4-generic +# audio/musepack +audio/ogg oga ogg spx +# audio/opus +# audio/parityfec +# audio/pcma +# audio/pcma-wb +# audio/pcmu-wb +# audio/pcmu +# audio/prs.sid +# audio/qcelp +# audio/red +# audio/rtp-enc-aescm128 +# audio/rtp-midi +# audio/rtx +audio/s3m s3m +audio/silk sil +# audio/smv +# audio/smv0 +# audio/smv-qcp +# audio/sp-midi +# audio/speex +# audio/t140c +# audio/t38 +# audio/telephone-event +# audio/tone +# audio/uemclip +# audio/ulpfec +# audio/vdvi +# audio/vmr-wb +# audio/vnd.3gpp.iufp +# audio/vnd.4sb +# audio/vnd.audiokoz +# audio/vnd.celp +# audio/vnd.cisco.nse +# audio/vnd.cmles.radio-events +# audio/vnd.cns.anp1 +# audio/vnd.cns.inf1 +audio/vnd.dece.audio uva uvva +audio/vnd.digital-winds eol +# audio/vnd.dlna.adts +# audio/vnd.dolby.heaac.1 +# audio/vnd.dolby.heaac.2 +# audio/vnd.dolby.mlp +# audio/vnd.dolby.mps +# audio/vnd.dolby.pl2 +# audio/vnd.dolby.pl2x +# audio/vnd.dolby.pl2z +# audio/vnd.dolby.pulse.1 +audio/vnd.dra dra +audio/vnd.dts dts +audio/vnd.dts.hd dtshd +# audio/vnd.dvb.file +# audio/vnd.everad.plj +# audio/vnd.hns.audio +audio/vnd.lucent.voice lvp +audio/vnd.ms-playready.media.pya pya +# audio/vnd.nokia.mobile-xmf +# audio/vnd.nortel.vbk +audio/vnd.nuera.ecelp4800 ecelp4800 +audio/vnd.nuera.ecelp7470 ecelp7470 +audio/vnd.nuera.ecelp9600 ecelp9600 +# audio/vnd.octel.sbc +# audio/vnd.qcelp +# audio/vnd.rhetorex.32kadpcm +audio/vnd.rip rip +# audio/vnd.sealedmedia.softseal.mpeg +# audio/vnd.vmx.cvsd +# audio/vorbis +# audio/vorbis-config +audio/webm weba +audio/x-aac aac +audio/x-aiff aif aiff aifc +audio/x-caf caf +audio/x-flac flac +audio/x-matroska mka +audio/x-mpegurl m3u +audio/x-ms-wax wax +audio/x-ms-wma wma +audio/x-pn-realaudio ram ra +audio/x-pn-realaudio-plugin rmp +# audio/x-tta +audio/x-wav wav +audio/xm xm +chemical/x-cdx cdx +chemical/x-cif cif +chemical/x-cmdf cmdf +chemical/x-cml cml +chemical/x-csml csml +# chemical/x-pdb +chemical/x-xyz xyz +image/bmp bmp +image/cgm cgm +# image/example +# image/fits +image/g3fax g3 +image/gif gif +image/ief ief +# image/jp2 +image/jp2 jp2 +image/jpeg jpeg jpg jpe +# image/jpm +# image/jpx +image/ktx ktx +# image/naplps +image/pict pict pic pct +image/png png +image/prs.btif btif +# image/prs.pti +image/sgi sgi +image/svg+xml svg svgz +# image/t38 +image/tiff tiff tif +# image/tiff-fx +image/vnd.adobe.photoshop psd +# image/vnd.cns.inf2 +image/vnd.dece.graphic uvi uvvi uvg uvvg +image/vnd.dvb.subtitle sub +image/vnd.djvu djvu djv +image/vnd.dwg dwg +image/vnd.dxf dxf +image/vnd.fastbidsheet fbs +image/vnd.fpx fpx +image/vnd.fst fst +image/vnd.fujixerox.edmics-mmr mmr +image/vnd.fujixerox.edmics-rlc rlc +# image/vnd.globalgraphics.pgb +# image/vnd.microsoft.icon +# image/vnd.mix +image/vnd.ms-modi mdi +image/vnd.ms-photo wdp +image/vnd.net-fpx npx +# image/vnd.radiance +# image/vnd.sealed.png +# image/vnd.sealedmedia.softseal.gif +# image/vnd.sealedmedia.softseal.jpg +# image/vnd.svf +image/vnd.wap.wbmp wbmp +image/vnd.xiff xif +image/webp webp +image/x-3ds 3ds +image/x-cmu-raster ras +image/x-cmx cmx +image/x-freehand fh fhc fh4 fh5 fh7 +image/x-icon ico +image/x-macpaint pntg pnt mac +image/x-mrsid-image sid +image/x-pcx pcx +image/x-pict pic pct +image/x-portable-anymap pnm +image/x-portable-bitmap pbm +image/x-portable-graymap pgm +image/x-portable-pixmap ppm +image/x-quicktime qtif qti +image/x-rgb rgb +image/x-tga tga +image/x-xbitmap xbm +image/x-xpixmap xpm +image/x-xwindowdump xwd +# message/cpim +# message/delivery-status +# message/disposition-notification +# message/example +# message/external-body +# message/feedback-report +# message/global +# message/global-delivery-status +# message/global-disposition-notification +# message/global-headers +# message/http +# message/imdn+xml +# message/news +# message/partial +message/rfc822 eml mime +# message/s-http +# message/sip +# message/sipfrag +# message/tracking-status +# message/vnd.si.simp +# model/example +model/iges igs iges +model/mesh msh mesh silo +model/vnd.collada+xml dae +model/vnd.dwf dwf +# model/vnd.flatland.3dml +model/vnd.gdl gdl +# model/vnd.gs-gdl +# model/vnd.gs.gdl +model/vnd.gtw gtw +# model/vnd.moml+xml +model/vnd.mts mts +# model/vnd.parasolid.transmit.binary +# model/vnd.parasolid.transmit.text +model/vnd.vtu vtu +model/vrml wrl vrml +model/x3d+binary x3db x3dbz +model/x3d+vrml x3dv x3dvz +model/x3d+xml x3d x3dz +# multipart/alternative +# multipart/appledouble +# multipart/byteranges +# multipart/digest +# multipart/encrypted +# multipart/example +# multipart/form-data +# multipart/header-set +# multipart/mixed +# multipart/parallel +# multipart/related +# multipart/report +# multipart/signed +# multipart/voice-message +text/cache-manifest manifest +# text/1d-interleaved-parityfec +text/cache-manifest appcache +text/calendar ics ifb +text/css css +text/csv csv +# text/directory +# text/dns +# text/ecmascript +# text/enriched +# text/example +# text/fwdred +text/html html htm +# text/javascript +text/n3 n3 +# text/parityfec +text/plain txt text conf def list log in +# text/prs.fallenstein.rst +text/prs.lines.tag dsc +# text/vnd.radisys.msml-basic-layout +# text/red +# text/rfc822-headers +text/richtext rtx +# text/rtf +# text/rtp-enc-aescm128 +# text/rtx +text/sgml sgml sgm +# text/t140 +text/tab-separated-values tsv +text/troff t tr roff man me ms +text/turtle ttl +# text/ulpfec +text/uri-list uri uris urls +text/vcard vcard +# text/vnd.abc +text/vnd.curl curl +text/vnd.curl.dcurl dcurl +text/vnd.curl.scurl scurl +text/vnd.curl.mcurl mcurl +# text/vnd.dmclientscript +text/vnd.dvb.subtitle sub +# text/vnd.esmertec.theme-descriptor +text/vnd.fly fly +text/vnd.fmi.flexstor flx +text/vnd.graphviz gv +text/vnd.in3d.3dml 3dml +text/vnd.in3d.spot spot +# text/vnd.iptc.newsml +# text/vnd.iptc.nitf +# text/vnd.latex-z +# text/vnd.motorola.reflex +# text/vnd.ms-mediapackage +# text/vnd.net2phone.commcenter.command +# text/vnd.si.uricatalogue +text/vnd.sun.j2me.app-descriptor jad +# text/vnd.trolltech.linguist +# text/vnd.wap.si +# text/vnd.wap.sl +text/vnd.wap.wml wml +text/vnd.wap.wmlscript wmls +text/x-asm s asm +text/x-c c cc cxx cpp h hh dic +text/x-fortran f for f77 f90 +text/x-java-source java +text/x-opml opml +text/x-pascal p pas +text/x-nfo nfo +text/x-setext etx +text/x-sfv sfv +text/x-uuencode uu +text/x-vcalendar vcs +text/x-vcard vcf +# text/xml +# text/xml-external-parsed-entity +# video/1d-interleaved-parityfec +video/3gpp 3gp +# video/3gpp-tt +video/3gpp2 3g2 +# video/bmpeg +# video/bt656 +# video/celb +# video/dv +# video/example +video/h261 h261 +video/h263 h263 +# video/h263-1998 +# video/h263-2000 +video/h264 h264 +# video/h264-rcdo +# video/h264-svc +video/jpeg jpgv +# video/jpeg2000 +video/jpm jpm jpgm +video/mj2 mj2 mjp2 +# video/mp1s +# video/mp2p +# video/mp4v-es +video/mp2t ts +video/mp4 mp4 mp4v mpg4 m4v +video/mpeg mpeg mpg mpe m1v m2v +# video/mpeg4-generic +# video/mpv +# video/nv +video/ogg ogv +# video/parityfec +# video/pointer +video/quicktime qt mov +# video/raw +# video/rtp-enc-aescm128 +# video/rtx +# video/smpte292m +# video/ulpfec +# video/vc1 +# video/vnd.cctv +video/vnd.dece.hd uvh uvvh +video/vnd.dece.mobile uvm uvvm +# video/vnd.dece.mp4 +video/vnd.dece.pd uvp uvvp +video/vnd.dece.sd uvs uvvs +video/vnd.dece.video uvv uvvv +# video/vnd.directv.mpeg +# video/vnd.directv.mpeg-tts +# video/vnd.dlna.mpeg-tts +video/vnd.dvb.file dvb +video/vnd.fvt fvt +# video/vnd.hns.video +# video/vnd.iptvforum.1dparityfec-1010 +# video/vnd.iptvforum.1dparityfec-2005 +# video/vnd.iptvforum.2dparityfec-1010 +# video/vnd.iptvforum.2dparityfec-2005 +# video/vnd.iptvforum.ttsavc +# video/vnd.iptvforum.ttsmpeg2 +# video/vnd.motorola.video +# video/vnd.motorola.videop +video/vnd.mpegurl mxu m4u +video/vnd.ms-playready.media.pyv pyv +# video/vnd.nokia.interleaved-multimedia +# video/vnd.nokia.videovoip +# video/vnd.objectvideo +# video/vnd.sealed.mpeg1 +# video/vnd.sealed.mpeg4 +# video/vnd.sealed.swf +# video/vnd.sealedmedia.softseal.mov +video/vnd.uvvu.mp4 uvu uvvu +video/vnd.vivo viv +video/x-dv dv dif +video/webm webm +video/x-f4v f4v +video/x-fli fli +video/x-flv flv +video/x-m4v m4v +video/x-matroska mkv mk3d mks +video/x-mng mng +video/x-ms-asf asf asx +video/x-ms-vob vob +video/x-ms-wm wm +video/x-ms-wmv wmv +video/x-ms-wmx wmx +video/x-ms-wvx wvx +video/x-msvideo avi +video/x-sgi-movie movie +video/x-smv smv +x-conference/x-cooltalk ice diff --git a/misc/nacl/testzip.proto b/misc/nacl/testzip.proto new file mode 100644 index 0000000000000000000000000000000000000000..bc382d50a87feda1f1e39e4063e70ba1f5ba27df --- /dev/null +++ b/misc/nacl/testzip.proto @@ -0,0 +1,140 @@ +etc src=/etc + mime.types src=../misc/nacl/testdata/mime.types + resolv.conf src=../misc/nacl/testdata/empty + group src=../misc/nacl/testdata/group + passwd src=../misc/nacl/testdata/empty + hosts src=../misc/nacl/testdata/hosts + services +usr src=../misc/nacl/testdata + bin +go src=.. + src + cmd + api + testdata + + + asm + internal + asm + testdata + + + doc + main.go + pkg.go + doc_test.go + testdata + + + internal + objfile + objfile.go + rsc.io + arm + armasm + testdata + + + x86 + x86asm + testdata + + + gofmt + gofmt.go + gofmt_test.go + testdata + + + archive + tar + testdata + + + zip + testdata + + + compress + bzip2 + testdata + + + flate + gzip + testdata + + + lzw + testdata + + + zlib + crypto + rsa + testdata + + + tls + testdata + + + debug + dwarf + testdata + + + elf + testdata + + + macho + testdata + + + pe + testdata + + + plan9obj + testdata + + + go + build + + + doc + testdata + + + format + + + parser + + + printer + + + image + testdata + + + draw + gif + jpeg + png + testdata + + + io + + + mime + testdata + + + multipart + testdata + + + net + http + + + testdata + + + os + + + path + filepath + + + regexp + testdata + + + strconv + testdata + + + text + template + testdata + + + lib + time + zoneinfo.zip + + test + + diff --git a/misc/swig/callback/callback.cc b/misc/swig/callback/callback.cc new file mode 100644 index 0000000000000000000000000000000000000000..eac24fba0d5af5fa1cc70ef42c7aae7b75a0ff18 --- /dev/null +++ b/misc/swig/callback/callback.cc @@ -0,0 +1,15 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// This .cc file will be automatically compiled by the go tool and +// included in the package. + +#include +#include "callback.h" + +std::string Caller::call() { + if (callback_ != 0) + return callback_->run(); + return ""; +} diff --git a/misc/swig/callback/callback.go b/misc/swig/callback/callback.go new file mode 100644 index 0000000000000000000000000000000000000000..39c1719d2479c639599aa31eb5980f5dfee3f196 --- /dev/null +++ b/misc/swig/callback/callback.go @@ -0,0 +1,11 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package callback + +type GoCallback struct{} + +func (p *GoCallback) Run() string { + return "GoCallback.Run" +} diff --git a/misc/swig/callback/callback.h b/misc/swig/callback/callback.h new file mode 100644 index 0000000000000000000000000000000000000000..97bf73cc287814ab083d09bc11839d27724a2c4c --- /dev/null +++ b/misc/swig/callback/callback.h @@ -0,0 +1,20 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +class Callback { +public: + virtual ~Callback() { } + virtual std::string run() { return "Callback::run"; } +}; + +class Caller { +private: + Callback *callback_; +public: + Caller(): callback_(0) { } + ~Caller() { delCallback(); } + void delCallback() { delete callback_; callback_ = 0; } + void setCallback(Callback *cb) { delCallback(); callback_ = cb; } + std::string call(); +}; diff --git a/misc/swig/callback/callback.swigcxx b/misc/swig/callback/callback.swigcxx new file mode 100644 index 0000000000000000000000000000000000000000..0c97ef1016c0322f23c29157575ec4df1345ec99 --- /dev/null +++ b/misc/swig/callback/callback.swigcxx @@ -0,0 +1,18 @@ +/* Copyright 2011 The Go Authors. All rights reserved. + Use of this source code is governed by a BSD-style + license that can be found in the LICENSE file. */ + +/* An example of writing a C++ virtual function in Go. */ + +%module(directors="1") callback + +%{ +#include +#include "callback.h" +%} + +%include "std_string.i" + +%feature("director"); + +%include "callback.h" diff --git a/misc/swig/callback/callback_test.go b/misc/swig/callback/callback_test.go new file mode 100644 index 0000000000000000000000000000000000000000..dbbbab5760e2959e1a889697ef706cbdfe25d5f1 --- /dev/null +++ b/misc/swig/callback/callback_test.go @@ -0,0 +1,33 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package callback + +import ( + "testing" +) + +func TestCall(t *testing.T) { + c := NewCaller() + cb := NewCallback() + + c.SetCallback(cb) + s := c.Call() + if s != "Callback::run" { + t.Errorf("unexpected string from Call: %q", s) + } + c.DelCallback() +} + +func TestCallback(t *testing.T) { + c := NewCaller() + cb := NewDirectorCallback(&GoCallback{}) + c.SetCallback(cb) + s := c.Call() + if s != "GoCallback.Run" { + t.Errorf("unexpected string from Call with callback: %q", s) + } + c.DelCallback() + DeleteDirectorCallback(cb) +} diff --git a/misc/swig/stdio/file.swig b/misc/swig/stdio/file.swig new file mode 100644 index 0000000000000000000000000000000000000000..8ba341d08932ebec6e4d3be1c8a149dc78ac4753 --- /dev/null +++ b/misc/swig/stdio/file.swig @@ -0,0 +1,24 @@ +/* Copyright 2011 The Go Authors. All rights reserved. + Use of this source code is governed by a BSD-style + license that can be found in the LICENSE file. */ + +/* A trivial example of wrapping a C library using SWIG. */ + +%{ +#include +#include +%} + +%typemap(gotype) const char * "string" +%typemap(in) const char * %{ + $1 = malloc($input.n + 1); + memcpy($1, $input.p, $input.n); + $1[$input.n] = '\0'; +%} +%typemap(freearg) const char * %{ + free($1); +%} + +FILE *fopen(const char *name, const char *mode); +int fclose(FILE *); +int fgetc(FILE *); diff --git a/misc/swig/stdio/file_test.go b/misc/swig/stdio/file_test.go new file mode 100644 index 0000000000000000000000000000000000000000..38d0746768e33a82563d2bcb9c72f64b7cf87172 --- /dev/null +++ b/misc/swig/stdio/file_test.go @@ -0,0 +1,22 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package file + +import "testing" + +// Open this file itself and verify that the first few characters are +// as expected. +func TestRead(t *testing.T) { + f := Fopen("file_test.go", "r") + if f.Swigcptr() == 0 { + t.Fatal("fopen failed") + } + if Fgetc(f) != '/' || Fgetc(f) != '/' || Fgetc(f) != ' ' || Fgetc(f) != 'C' { + t.Error("read unexpected characters") + } + if Fclose(f) != 0 { + t.Error("fclose failed") + } +} diff --git a/misc/trace/README.md b/misc/trace/README.md new file mode 100644 index 0000000000000000000000000000000000000000..8561c79bfd20f944ee1fa1cef7e544021b8e8dec --- /dev/null +++ b/misc/trace/README.md @@ -0,0 +1,38 @@ +This directory contains helper file for trace viewer (`go tool trace`). + +`trace_viewer_lean.html` was generated by following +[instructions](https://github.com/google/trace-viewer/wiki/Embedding) +on revision `280626ef607decf36291e290d5f0322b173e8a7f` using: +``` +trace-viewer$ ./vulcanize_trace_viewer --config=lean +trace-viewer$ cp bin/trace_viewer_lean.html $GOROOT/misc/trace/ +``` + +The license for trace-viewer is as follows: +// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/misc/trace/trace_viewer_lean.html b/misc/trace/trace_viewer_lean.html new file mode 100644 index 0000000000000000000000000000000000000000..5d40bc58050e35d56529a20fc9f01c13b2979156 --- /dev/null +++ b/misc/trace/trace_viewer_lean.html @@ -0,0 +1,4043 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/robots.txt b/robots.txt new file mode 100644 index 0000000000000000000000000000000000000000..1f53798bb4fe33c86020be7f10c44f29486fd190 --- /dev/null +++ b/robots.txt @@ -0,0 +1,2 @@ +User-agent: * +Disallow: / diff --git a/src/Make.dist b/src/Make.dist new file mode 100644 index 0000000000000000000000000000000000000000..cae892de9cab2e118df8b03dc3ca83dcc16f39b4 --- /dev/null +++ b/src/Make.dist @@ -0,0 +1,19 @@ +# Copyright 2012 The Go Authors. All rights reserved. +# Use of this source code is governed by a BSD-style +# license that can be found in the LICENSE file. + +# Run go tool dist to install a command. +# The -v causes dist to print the name of each directory as it runs. +# The -vv causes dist to print each build command as it runs. +# go tool dist clean cleans all directories, not just this one, +# but it's as close as we can get. + +# Default target (first). +install: + go tool dist install -v + +verbose: + go tool dist install -vv + +clean: + go tool dist clean diff --git a/src/all.bash b/src/all.bash new file mode 100755 index 0000000000000000000000000000000000000000..5d994d3d0dae97f070d4299a90443519d387ffd4 --- /dev/null +++ b/src/all.bash @@ -0,0 +1,15 @@ +#!/usr/bin/env bash +# Copyright 2009 The Go Authors. All rights reserved. +# Use of this source code is governed by a BSD-style +# license that can be found in the LICENSE file. + +set -e +if [ ! -f make.bash ]; then + echo 'all.bash must be run from $GOROOT/src' 1>&2 + exit 1 +fi +OLDPATH="$PATH" +. ./make.bash "$@" --no-banner +bash run.bash --no-rebuild +PATH="$OLDPATH" +$GOTOOLDIR/dist banner # print build info diff --git a/src/all.bat b/src/all.bat new file mode 100644 index 0000000000000000000000000000000000000000..0647a715ba2463718b385800d1de0f53f005b29e --- /dev/null +++ b/src/all.bat @@ -0,0 +1,26 @@ +:: Copyright 2012 The Go Authors. All rights reserved. +:: Use of this source code is governed by a BSD-style +:: license that can be found in the LICENSE file. +@echo off + +setlocal + +if exist make.bat goto ok +echo all.bat must be run from go\src +:: cannot exit: would kill parent command interpreter +goto end +:ok + +set OLDPATH=%PATH% +call make.bat --no-banner --no-local +if %GOBUILDFAIL%==1 goto end +call run.bat --no-rebuild --no-local +if %GOBUILDFAIL%==1 goto end +:: we must restore %PATH% before running "dist banner" so that the latter +:: can get the original %PATH% and give suggestion to add %GOROOT%/bin +:: to %PATH% if necessary. +set PATH=%OLDPATH% +"%GOTOOLDIR%/dist" banner + +:end +if x%GOBUILDEXIT%==x1 exit %GOBUILDFAIL% diff --git a/src/all.rc b/src/all.rc new file mode 100755 index 0000000000000000000000000000000000000000..14e2f5565aebaabeeef51566b985a1c2677e928d --- /dev/null +++ b/src/all.rc @@ -0,0 +1,16 @@ +#!/bin/rc -e +# Copyright 2012 The Go Authors. All rights reserved. +# Use of this source code is governed by a BSD-style +# license that can be found in the LICENSE file. + +rfork n + +if(! test -f make.rc){ + echo 'all.rc must be run from $GOROOT/src' >[1=2] + exit wrongdir +} + +. ./make.rc --no-banner +bind -b $GOROOT/bin /bin +./run.rc --no-rebuild +$GOTOOLDIR/dist banner # print build info diff --git a/src/androidtest.bash b/src/androidtest.bash new file mode 100755 index 0000000000000000000000000000000000000000..00107386149712684db9b1d114cb107adfa40b86 --- /dev/null +++ b/src/androidtest.bash @@ -0,0 +1,76 @@ +#!/usr/bin/env bash +# Copyright 2014 The Go Authors. All rights reserved. +# Use of this source code is governed by a BSD-style +# license that can be found in the LICENSE file. + +# For testing Android. +# The compiler runs locally, then a copy of the GOROOT is pushed to a +# target device using adb, and the tests are run there. + +set -e +ulimit -c 0 # no core files + +if [ ! -f make.bash ]; then + echo 'androidtest.bash must be run from $GOROOT/src' 1>&2 + exit 1 +fi + +if [ -z $GOOS ]; then + export GOOS=android +fi +if [ "$GOOS" != "android" ]; then + echo "androidtest.bash requires GOOS=android, got GOOS=$GOOS" 1>&2 + exit 1 +fi + +export CGO_ENABLED=1 +unset GOBIN + +# Do the build first, so we can build go_android_exec and cleaner. +# Also lets us fail early before the (slow) adb push if the build is broken. +. ./make.bash --no-banner +export GOROOT=$(dirname $(pwd)) +export PATH=$GOROOT/bin:$PATH +GOOS=$GOHOSTOS GOARCH=$GOHOSTARCH go build \ + -o ../bin/go_android_${GOARCH}_exec \ + ../misc/android/go_android_exec.go + +export ANDROID_TEST_DIR=/tmp/androidtest-$$ + +function cleanup() { + rm -rf ${ANDROID_TEST_DIR} +} +trap cleanup EXIT + +# Push GOROOT to target device. +# +# The adb sync command will sync either the /system or /data +# directories of an android device from a similar directory +# on the host. We copy the files required for running tests under +# /data/local/tmp/goroot. The adb sync command does not follow +# symlinks so we have to copy. +export ANDROID_PRODUCT_OUT="${ANDROID_TEST_DIR}/out" +FAKE_GOROOT=$ANDROID_PRODUCT_OUT/data/local/tmp/goroot +mkdir -p $FAKE_GOROOT +mkdir -p $FAKE_GOROOT/pkg +cp -a "${GOROOT}/src" "${FAKE_GOROOT}/" +cp -a "${GOROOT}/test" "${FAKE_GOROOT}/" +cp -a "${GOROOT}/lib" "${FAKE_GOROOT}/" +cp -a "${GOROOT}/pkg/android_$GOARCH" "${FAKE_GOROOT}/pkg/" +echo '# Syncing test files to android device' +adb shell mkdir -p /data/local/tmp/goroot +time adb sync data &> /dev/null + +export CLEANER=${ANDROID_TEST_DIR}/androidcleaner-$$ +cp ../misc/android/cleaner.go $CLEANER.go +echo 'var files = `' >> $CLEANER.go +(cd $ANDROID_PRODUCT_OUT/data/local/tmp/goroot; find . >> $CLEANER.go) +echo '`' >> $CLEANER.go +go build -o $CLEANER $CLEANER.go +adb push $CLEANER /data/local/tmp/cleaner +adb shell /data/local/tmp/cleaner + +echo '' + +# Run standard tests. +bash run.bash --no-rebuild diff --git a/src/archive/tar/common.go b/src/archive/tar/common.go new file mode 100644 index 0000000000000000000000000000000000000000..c31df062f7ea54577bafe6eb25dfb06ef2a2a55f --- /dev/null +++ b/src/archive/tar/common.go @@ -0,0 +1,329 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package tar implements access to tar archives. +// It aims to cover most of the variations, including those produced +// by GNU and BSD tars. +// +// References: +// http://www.freebsd.org/cgi/man.cgi?query=tar&sektion=5 +// http://www.gnu.org/software/tar/manual/html_node/Standard.html +// http://pubs.opengroup.org/onlinepubs/9699919799/utilities/pax.html +package tar + +import ( + "bytes" + "errors" + "fmt" + "os" + "path" + "time" +) + +const ( + blockSize = 512 + + // Types + TypeReg = '0' // regular file + TypeRegA = '\x00' // regular file + TypeLink = '1' // hard link + TypeSymlink = '2' // symbolic link + TypeChar = '3' // character device node + TypeBlock = '4' // block device node + TypeDir = '5' // directory + TypeFifo = '6' // fifo node + TypeCont = '7' // reserved + TypeXHeader = 'x' // extended header + TypeXGlobalHeader = 'g' // global extended header + TypeGNULongName = 'L' // Next file has a long name + TypeGNULongLink = 'K' // Next file symlinks to a file w/ a long name + TypeGNUSparse = 'S' // sparse file +) + +// A Header represents a single header in a tar archive. +// Some fields may not be populated. +type Header struct { + Name string // name of header file entry + Mode int64 // permission and mode bits + Uid int // user id of owner + Gid int // group id of owner + Size int64 // length in bytes + ModTime time.Time // modified time + Typeflag byte // type of header entry + Linkname string // target name of link + Uname string // user name of owner + Gname string // group name of owner + Devmajor int64 // major number of character or block device + Devminor int64 // minor number of character or block device + AccessTime time.Time // access time + ChangeTime time.Time // status change time + Xattrs map[string]string +} + +// File name constants from the tar spec. +const ( + fileNameSize = 100 // Maximum number of bytes in a standard tar name. + fileNamePrefixSize = 155 // Maximum number of ustar extension bytes. +) + +// FileInfo returns an os.FileInfo for the Header. +func (h *Header) FileInfo() os.FileInfo { + return headerFileInfo{h} +} + +// headerFileInfo implements os.FileInfo. +type headerFileInfo struct { + h *Header +} + +func (fi headerFileInfo) Size() int64 { return fi.h.Size } +func (fi headerFileInfo) IsDir() bool { return fi.Mode().IsDir() } +func (fi headerFileInfo) ModTime() time.Time { return fi.h.ModTime } +func (fi headerFileInfo) Sys() interface{} { return fi.h } + +// Name returns the base name of the file. +func (fi headerFileInfo) Name() string { + if fi.IsDir() { + return path.Base(path.Clean(fi.h.Name)) + } + return path.Base(fi.h.Name) +} + +// Mode returns the permission and mode bits for the headerFileInfo. +func (fi headerFileInfo) Mode() (mode os.FileMode) { + // Set file permission bits. + mode = os.FileMode(fi.h.Mode).Perm() + + // Set setuid, setgid and sticky bits. + if fi.h.Mode&c_ISUID != 0 { + // setuid + mode |= os.ModeSetuid + } + if fi.h.Mode&c_ISGID != 0 { + // setgid + mode |= os.ModeSetgid + } + if fi.h.Mode&c_ISVTX != 0 { + // sticky + mode |= os.ModeSticky + } + + // Set file mode bits. + // clear perm, setuid, setgid and sticky bits. + m := os.FileMode(fi.h.Mode) &^ 07777 + if m == c_ISDIR { + // directory + mode |= os.ModeDir + } + if m == c_ISFIFO { + // named pipe (FIFO) + mode |= os.ModeNamedPipe + } + if m == c_ISLNK { + // symbolic link + mode |= os.ModeSymlink + } + if m == c_ISBLK { + // device file + mode |= os.ModeDevice + } + if m == c_ISCHR { + // Unix character device + mode |= os.ModeDevice + mode |= os.ModeCharDevice + } + if m == c_ISSOCK { + // Unix domain socket + mode |= os.ModeSocket + } + + switch fi.h.Typeflag { + case TypeSymlink: + // symbolic link + mode |= os.ModeSymlink + case TypeChar: + // character device node + mode |= os.ModeDevice + mode |= os.ModeCharDevice + case TypeBlock: + // block device node + mode |= os.ModeDevice + case TypeDir: + // directory + mode |= os.ModeDir + case TypeFifo: + // fifo node + mode |= os.ModeNamedPipe + } + + return mode +} + +// sysStat, if non-nil, populates h from system-dependent fields of fi. +var sysStat func(fi os.FileInfo, h *Header) error + +// Mode constants from the tar spec. +const ( + c_ISUID = 04000 // Set uid + c_ISGID = 02000 // Set gid + c_ISVTX = 01000 // Save text (sticky bit) + c_ISDIR = 040000 // Directory + c_ISFIFO = 010000 // FIFO + c_ISREG = 0100000 // Regular file + c_ISLNK = 0120000 // Symbolic link + c_ISBLK = 060000 // Block special file + c_ISCHR = 020000 // Character special file + c_ISSOCK = 0140000 // Socket +) + +// Keywords for the PAX Extended Header +const ( + paxAtime = "atime" + paxCharset = "charset" + paxComment = "comment" + paxCtime = "ctime" // please note that ctime is not a valid pax header. + paxGid = "gid" + paxGname = "gname" + paxLinkpath = "linkpath" + paxMtime = "mtime" + paxPath = "path" + paxSize = "size" + paxUid = "uid" + paxUname = "uname" + paxXattr = "SCHILY.xattr." + paxNone = "" +) + +// FileInfoHeader creates a partially-populated Header from fi. +// If fi describes a symlink, FileInfoHeader records link as the link target. +// If fi describes a directory, a slash is appended to the name. +// Because os.FileInfo's Name method returns only the base name of +// the file it describes, it may be necessary to modify the Name field +// of the returned header to provide the full path name of the file. +func FileInfoHeader(fi os.FileInfo, link string) (*Header, error) { + if fi == nil { + return nil, errors.New("tar: FileInfo is nil") + } + fm := fi.Mode() + h := &Header{ + Name: fi.Name(), + ModTime: fi.ModTime(), + Mode: int64(fm.Perm()), // or'd with c_IS* constants later + } + switch { + case fm.IsRegular(): + h.Mode |= c_ISREG + h.Typeflag = TypeReg + h.Size = fi.Size() + case fi.IsDir(): + h.Typeflag = TypeDir + h.Mode |= c_ISDIR + h.Name += "/" + case fm&os.ModeSymlink != 0: + h.Typeflag = TypeSymlink + h.Mode |= c_ISLNK + h.Linkname = link + case fm&os.ModeDevice != 0: + if fm&os.ModeCharDevice != 0 { + h.Mode |= c_ISCHR + h.Typeflag = TypeChar + } else { + h.Mode |= c_ISBLK + h.Typeflag = TypeBlock + } + case fm&os.ModeNamedPipe != 0: + h.Typeflag = TypeFifo + h.Mode |= c_ISFIFO + case fm&os.ModeSocket != 0: + h.Mode |= c_ISSOCK + default: + return nil, fmt.Errorf("archive/tar: unknown file mode %v", fm) + } + if fm&os.ModeSetuid != 0 { + h.Mode |= c_ISUID + } + if fm&os.ModeSetgid != 0 { + h.Mode |= c_ISGID + } + if fm&os.ModeSticky != 0 { + h.Mode |= c_ISVTX + } + // If possible, populate additional fields from OS-specific + // FileInfo fields. + if sys, ok := fi.Sys().(*Header); ok { + // This FileInfo came from a Header (not the OS). Use the + // original Header to populate all remaining fields. + h.Uid = sys.Uid + h.Gid = sys.Gid + h.Uname = sys.Uname + h.Gname = sys.Gname + h.AccessTime = sys.AccessTime + h.ChangeTime = sys.ChangeTime + if sys.Xattrs != nil { + h.Xattrs = make(map[string]string) + for k, v := range sys.Xattrs { + h.Xattrs[k] = v + } + } + if sys.Typeflag == TypeLink { + // hard link + h.Typeflag = TypeLink + h.Size = 0 + h.Linkname = sys.Linkname + } + } + if sysStat != nil { + return h, sysStat(fi, h) + } + return h, nil +} + +var zeroBlock = make([]byte, blockSize) + +// POSIX specifies a sum of the unsigned byte values, but the Sun tar uses signed byte values. +// We compute and return both. +func checksum(header []byte) (unsigned int64, signed int64) { + for i := 0; i < len(header); i++ { + if i == 148 { + // The chksum field (header[148:156]) is special: it should be treated as space bytes. + unsigned += ' ' * 8 + signed += ' ' * 8 + i += 7 + continue + } + unsigned += int64(header[i]) + signed += int64(int8(header[i])) + } + return +} + +type slicer []byte + +func (sp *slicer) next(n int) (b []byte) { + s := *sp + b, *sp = s[0:n], s[n:] + return +} + +func isASCII(s string) bool { + for _, c := range s { + if c >= 0x80 { + return false + } + } + return true +} + +func toASCII(s string) string { + if isASCII(s) { + return s + } + var buf bytes.Buffer + for _, c := range s { + if c < 0x80 { + buf.WriteByte(byte(c)) + } + } + return buf.String() +} diff --git a/src/archive/tar/example_test.go b/src/archive/tar/example_test.go new file mode 100644 index 0000000000000000000000000000000000000000..2317f44e9632436498980111d0f90f7080372d55 --- /dev/null +++ b/src/archive/tar/example_test.go @@ -0,0 +1,80 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package tar_test + +import ( + "archive/tar" + "bytes" + "fmt" + "io" + "log" + "os" +) + +func Example() { + // Create a buffer to write our archive to. + buf := new(bytes.Buffer) + + // Create a new tar archive. + tw := tar.NewWriter(buf) + + // Add some files to the archive. + var files = []struct { + Name, Body string + }{ + {"readme.txt", "This archive contains some text files."}, + {"gopher.txt", "Gopher names:\nGeorge\nGeoffrey\nGonzo"}, + {"todo.txt", "Get animal handling licence."}, + } + for _, file := range files { + hdr := &tar.Header{ + Name: file.Name, + Mode: 0600, + Size: int64(len(file.Body)), + } + if err := tw.WriteHeader(hdr); err != nil { + log.Fatalln(err) + } + if _, err := tw.Write([]byte(file.Body)); err != nil { + log.Fatalln(err) + } + } + // Make sure to check the error on Close. + if err := tw.Close(); err != nil { + log.Fatalln(err) + } + + // Open the tar archive for reading. + r := bytes.NewReader(buf.Bytes()) + tr := tar.NewReader(r) + + // Iterate through the files in the archive. + for { + hdr, err := tr.Next() + if err == io.EOF { + // end of tar archive + break + } + if err != nil { + log.Fatalln(err) + } + fmt.Printf("Contents of %s:\n", hdr.Name) + if _, err := io.Copy(os.Stdout, tr); err != nil { + log.Fatalln(err) + } + fmt.Println() + } + + // Output: + // Contents of readme.txt: + // This archive contains some text files. + // Contents of gopher.txt: + // Gopher names: + // George + // Geoffrey + // Gonzo + // Contents of todo.txt: + // Get animal handling licence. +} diff --git a/src/archive/tar/reader.go b/src/archive/tar/reader.go new file mode 100644 index 0000000000000000000000000000000000000000..67daca27a95b4aa9d4968c66bad117165d6e278b --- /dev/null +++ b/src/archive/tar/reader.go @@ -0,0 +1,835 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package tar + +// TODO(dsymonds): +// - pax extensions + +import ( + "bytes" + "errors" + "io" + "io/ioutil" + "os" + "strconv" + "strings" + "time" +) + +var ( + ErrHeader = errors.New("archive/tar: invalid tar header") +) + +const maxNanoSecondIntSize = 9 + +// A Reader provides sequential access to the contents of a tar archive. +// A tar archive consists of a sequence of files. +// The Next method advances to the next file in the archive (including the first), +// and then it can be treated as an io.Reader to access the file's data. +type Reader struct { + r io.Reader + err error + pad int64 // amount of padding (ignored) after current file entry + curr numBytesReader // reader for current file entry + hdrBuff [blockSize]byte // buffer to use in readHeader +} + +// A numBytesReader is an io.Reader with a numBytes method, returning the number +// of bytes remaining in the underlying encoded data. +type numBytesReader interface { + io.Reader + numBytes() int64 +} + +// A regFileReader is a numBytesReader for reading file data from a tar archive. +type regFileReader struct { + r io.Reader // underlying reader + nb int64 // number of unread bytes for current file entry +} + +// A sparseFileReader is a numBytesReader for reading sparse file data from a tar archive. +type sparseFileReader struct { + rfr *regFileReader // reads the sparse-encoded file data + sp []sparseEntry // the sparse map for the file + pos int64 // keeps track of file position + tot int64 // total size of the file +} + +// Keywords for GNU sparse files in a PAX extended header +const ( + paxGNUSparseNumBlocks = "GNU.sparse.numblocks" + paxGNUSparseOffset = "GNU.sparse.offset" + paxGNUSparseNumBytes = "GNU.sparse.numbytes" + paxGNUSparseMap = "GNU.sparse.map" + paxGNUSparseName = "GNU.sparse.name" + paxGNUSparseMajor = "GNU.sparse.major" + paxGNUSparseMinor = "GNU.sparse.minor" + paxGNUSparseSize = "GNU.sparse.size" + paxGNUSparseRealSize = "GNU.sparse.realsize" +) + +// Keywords for old GNU sparse headers +const ( + oldGNUSparseMainHeaderOffset = 386 + oldGNUSparseMainHeaderIsExtendedOffset = 482 + oldGNUSparseMainHeaderNumEntries = 4 + oldGNUSparseExtendedHeaderIsExtendedOffset = 504 + oldGNUSparseExtendedHeaderNumEntries = 21 + oldGNUSparseOffsetSize = 12 + oldGNUSparseNumBytesSize = 12 +) + +// NewReader creates a new Reader reading from r. +func NewReader(r io.Reader) *Reader { return &Reader{r: r} } + +// Next advances to the next entry in the tar archive. +// +// io.EOF is returned at the end of the input. +func (tr *Reader) Next() (*Header, error) { + var hdr *Header + if tr.err == nil { + tr.skipUnread() + } + if tr.err != nil { + return hdr, tr.err + } + hdr = tr.readHeader() + if hdr == nil { + return hdr, tr.err + } + // Check for PAX/GNU header. + switch hdr.Typeflag { + case TypeXHeader: + // PAX extended header + headers, err := parsePAX(tr) + if err != nil { + return nil, err + } + // We actually read the whole file, + // but this skips alignment padding + tr.skipUnread() + if tr.err != nil { + return nil, tr.err + } + hdr = tr.readHeader() + if hdr == nil { + return nil, tr.err + } + mergePAX(hdr, headers) + + // Check for a PAX format sparse file + sp, err := tr.checkForGNUSparsePAXHeaders(hdr, headers) + if err != nil { + tr.err = err + return nil, err + } + if sp != nil { + // Current file is a PAX format GNU sparse file. + // Set the current file reader to a sparse file reader. + tr.curr = &sparseFileReader{rfr: tr.curr.(*regFileReader), sp: sp, tot: hdr.Size} + } + return hdr, nil + case TypeGNULongName: + // We have a GNU long name header. Its contents are the real file name. + realname, err := ioutil.ReadAll(tr) + if err != nil { + return nil, err + } + hdr, err := tr.Next() + hdr.Name = cString(realname) + return hdr, err + case TypeGNULongLink: + // We have a GNU long link header. + realname, err := ioutil.ReadAll(tr) + if err != nil { + return nil, err + } + hdr, err := tr.Next() + hdr.Linkname = cString(realname) + return hdr, err + } + return hdr, tr.err +} + +// checkForGNUSparsePAXHeaders checks the PAX headers for GNU sparse headers. If they are found, then +// this function reads the sparse map and returns it. Unknown sparse formats are ignored, causing the file to +// be treated as a regular file. +func (tr *Reader) checkForGNUSparsePAXHeaders(hdr *Header, headers map[string]string) ([]sparseEntry, error) { + var sparseFormat string + + // Check for sparse format indicators + major, majorOk := headers[paxGNUSparseMajor] + minor, minorOk := headers[paxGNUSparseMinor] + sparseName, sparseNameOk := headers[paxGNUSparseName] + _, sparseMapOk := headers[paxGNUSparseMap] + sparseSize, sparseSizeOk := headers[paxGNUSparseSize] + sparseRealSize, sparseRealSizeOk := headers[paxGNUSparseRealSize] + + // Identify which, if any, sparse format applies from which PAX headers are set + if majorOk && minorOk { + sparseFormat = major + "." + minor + } else if sparseNameOk && sparseMapOk { + sparseFormat = "0.1" + } else if sparseSizeOk { + sparseFormat = "0.0" + } else { + // Not a PAX format GNU sparse file. + return nil, nil + } + + // Check for unknown sparse format + if sparseFormat != "0.0" && sparseFormat != "0.1" && sparseFormat != "1.0" { + return nil, nil + } + + // Update hdr from GNU sparse PAX headers + if sparseNameOk { + hdr.Name = sparseName + } + if sparseSizeOk { + realSize, err := strconv.ParseInt(sparseSize, 10, 0) + if err != nil { + return nil, ErrHeader + } + hdr.Size = realSize + } else if sparseRealSizeOk { + realSize, err := strconv.ParseInt(sparseRealSize, 10, 0) + if err != nil { + return nil, ErrHeader + } + hdr.Size = realSize + } + + // Set up the sparse map, according to the particular sparse format in use + var sp []sparseEntry + var err error + switch sparseFormat { + case "0.0", "0.1": + sp, err = readGNUSparseMap0x1(headers) + case "1.0": + sp, err = readGNUSparseMap1x0(tr.curr) + } + return sp, err +} + +// mergePAX merges well known headers according to PAX standard. +// In general headers with the same name as those found +// in the header struct overwrite those found in the header +// struct with higher precision or longer values. Esp. useful +// for name and linkname fields. +func mergePAX(hdr *Header, headers map[string]string) error { + for k, v := range headers { + switch k { + case paxPath: + hdr.Name = v + case paxLinkpath: + hdr.Linkname = v + case paxGname: + hdr.Gname = v + case paxUname: + hdr.Uname = v + case paxUid: + uid, err := strconv.ParseInt(v, 10, 0) + if err != nil { + return err + } + hdr.Uid = int(uid) + case paxGid: + gid, err := strconv.ParseInt(v, 10, 0) + if err != nil { + return err + } + hdr.Gid = int(gid) + case paxAtime: + t, err := parsePAXTime(v) + if err != nil { + return err + } + hdr.AccessTime = t + case paxMtime: + t, err := parsePAXTime(v) + if err != nil { + return err + } + hdr.ModTime = t + case paxCtime: + t, err := parsePAXTime(v) + if err != nil { + return err + } + hdr.ChangeTime = t + case paxSize: + size, err := strconv.ParseInt(v, 10, 0) + if err != nil { + return err + } + hdr.Size = int64(size) + default: + if strings.HasPrefix(k, paxXattr) { + if hdr.Xattrs == nil { + hdr.Xattrs = make(map[string]string) + } + hdr.Xattrs[k[len(paxXattr):]] = v + } + } + } + return nil +} + +// parsePAXTime takes a string of the form %d.%d as described in +// the PAX specification. +func parsePAXTime(t string) (time.Time, error) { + buf := []byte(t) + pos := bytes.IndexByte(buf, '.') + var seconds, nanoseconds int64 + var err error + if pos == -1 { + seconds, err = strconv.ParseInt(t, 10, 0) + if err != nil { + return time.Time{}, err + } + } else { + seconds, err = strconv.ParseInt(string(buf[:pos]), 10, 0) + if err != nil { + return time.Time{}, err + } + nano_buf := string(buf[pos+1:]) + // Pad as needed before converting to a decimal. + // For example .030 -> .030000000 -> 30000000 nanoseconds + if len(nano_buf) < maxNanoSecondIntSize { + // Right pad + nano_buf += strings.Repeat("0", maxNanoSecondIntSize-len(nano_buf)) + } else if len(nano_buf) > maxNanoSecondIntSize { + // Right truncate + nano_buf = nano_buf[:maxNanoSecondIntSize] + } + nanoseconds, err = strconv.ParseInt(string(nano_buf), 10, 0) + if err != nil { + return time.Time{}, err + } + } + ts := time.Unix(seconds, nanoseconds) + return ts, nil +} + +// parsePAX parses PAX headers. +// If an extended header (type 'x') is invalid, ErrHeader is returned +func parsePAX(r io.Reader) (map[string]string, error) { + buf, err := ioutil.ReadAll(r) + if err != nil { + return nil, err + } + + // For GNU PAX sparse format 0.0 support. + // This function transforms the sparse format 0.0 headers into sparse format 0.1 headers. + var sparseMap bytes.Buffer + + headers := make(map[string]string) + // Each record is constructed as + // "%d %s=%s\n", length, keyword, value + for len(buf) > 0 { + // or the header was empty to start with. + var sp int + // The size field ends at the first space. + sp = bytes.IndexByte(buf, ' ') + if sp == -1 { + return nil, ErrHeader + } + // Parse the first token as a decimal integer. + n, err := strconv.ParseInt(string(buf[:sp]), 10, 0) + if err != nil || n < 5 || int64(len(buf)) < n { + return nil, ErrHeader + } + // Extract everything between the decimal and the n -1 on the + // beginning to eat the ' ', -1 on the end to skip the newline. + var record []byte + record, buf = buf[sp+1:n-1], buf[n:] + // The first equals is guaranteed to mark the end of the key. + // Everything else is value. + eq := bytes.IndexByte(record, '=') + if eq == -1 { + return nil, ErrHeader + } + key, value := record[:eq], record[eq+1:] + + keyStr := string(key) + if keyStr == paxGNUSparseOffset || keyStr == paxGNUSparseNumBytes { + // GNU sparse format 0.0 special key. Write to sparseMap instead of using the headers map. + sparseMap.Write(value) + sparseMap.Write([]byte{','}) + } else { + // Normal key. Set the value in the headers map. + headers[keyStr] = string(value) + } + } + if sparseMap.Len() != 0 { + // Add sparse info to headers, chopping off the extra comma + sparseMap.Truncate(sparseMap.Len() - 1) + headers[paxGNUSparseMap] = sparseMap.String() + } + return headers, nil +} + +// cString parses bytes as a NUL-terminated C-style string. +// If a NUL byte is not found then the whole slice is returned as a string. +func cString(b []byte) string { + n := 0 + for n < len(b) && b[n] != 0 { + n++ + } + return string(b[0:n]) +} + +func (tr *Reader) octal(b []byte) int64 { + // Check for binary format first. + if len(b) > 0 && b[0]&0x80 != 0 { + var x int64 + for i, c := range b { + if i == 0 { + c &= 0x7f // ignore signal bit in first byte + } + x = x<<8 | int64(c) + } + return x + } + + // Because unused fields are filled with NULs, we need + // to skip leading NULs. Fields may also be padded with + // spaces or NULs. + // So we remove leading and trailing NULs and spaces to + // be sure. + b = bytes.Trim(b, " \x00") + + if len(b) == 0 { + return 0 + } + x, err := strconv.ParseUint(cString(b), 8, 64) + if err != nil { + tr.err = err + } + return int64(x) +} + +// skipUnread skips any unread bytes in the existing file entry, as well as any alignment padding. +func (tr *Reader) skipUnread() { + nr := tr.numBytes() + tr.pad // number of bytes to skip + tr.curr, tr.pad = nil, 0 + if sr, ok := tr.r.(io.Seeker); ok { + if _, err := sr.Seek(nr, os.SEEK_CUR); err == nil { + return + } + } + _, tr.err = io.CopyN(ioutil.Discard, tr.r, nr) +} + +func (tr *Reader) verifyChecksum(header []byte) bool { + if tr.err != nil { + return false + } + + given := tr.octal(header[148:156]) + unsigned, signed := checksum(header) + return given == unsigned || given == signed +} + +func (tr *Reader) readHeader() *Header { + header := tr.hdrBuff[:] + copy(header, zeroBlock) + + if _, tr.err = io.ReadFull(tr.r, header); tr.err != nil { + return nil + } + + // Two blocks of zero bytes marks the end of the archive. + if bytes.Equal(header, zeroBlock[0:blockSize]) { + if _, tr.err = io.ReadFull(tr.r, header); tr.err != nil { + return nil + } + if bytes.Equal(header, zeroBlock[0:blockSize]) { + tr.err = io.EOF + } else { + tr.err = ErrHeader // zero block and then non-zero block + } + return nil + } + + if !tr.verifyChecksum(header) { + tr.err = ErrHeader + return nil + } + + // Unpack + hdr := new(Header) + s := slicer(header) + + hdr.Name = cString(s.next(100)) + hdr.Mode = tr.octal(s.next(8)) + hdr.Uid = int(tr.octal(s.next(8))) + hdr.Gid = int(tr.octal(s.next(8))) + hdr.Size = tr.octal(s.next(12)) + if hdr.Size < 0 { + tr.err = ErrHeader + return nil + } + hdr.ModTime = time.Unix(tr.octal(s.next(12)), 0) + s.next(8) // chksum + hdr.Typeflag = s.next(1)[0] + hdr.Linkname = cString(s.next(100)) + + // The remainder of the header depends on the value of magic. + // The original (v7) version of tar had no explicit magic field, + // so its magic bytes, like the rest of the block, are NULs. + magic := string(s.next(8)) // contains version field as well. + var format string + switch { + case magic[:6] == "ustar\x00": // POSIX tar (1003.1-1988) + if string(header[508:512]) == "tar\x00" { + format = "star" + } else { + format = "posix" + } + case magic == "ustar \x00": // old GNU tar + format = "gnu" + } + + switch format { + case "posix", "gnu", "star": + hdr.Uname = cString(s.next(32)) + hdr.Gname = cString(s.next(32)) + devmajor := s.next(8) + devminor := s.next(8) + if hdr.Typeflag == TypeChar || hdr.Typeflag == TypeBlock { + hdr.Devmajor = tr.octal(devmajor) + hdr.Devminor = tr.octal(devminor) + } + var prefix string + switch format { + case "posix", "gnu": + prefix = cString(s.next(155)) + case "star": + prefix = cString(s.next(131)) + hdr.AccessTime = time.Unix(tr.octal(s.next(12)), 0) + hdr.ChangeTime = time.Unix(tr.octal(s.next(12)), 0) + } + if len(prefix) > 0 { + hdr.Name = prefix + "/" + hdr.Name + } + } + + if tr.err != nil { + tr.err = ErrHeader + return nil + } + + // Maximum value of hdr.Size is 64 GB (12 octal digits), + // so there's no risk of int64 overflowing. + nb := int64(hdr.Size) + tr.pad = -nb & (blockSize - 1) // blockSize is a power of two + + // Set the current file reader. + tr.curr = ®FileReader{r: tr.r, nb: nb} + + // Check for old GNU sparse format entry. + if hdr.Typeflag == TypeGNUSparse { + // Get the real size of the file. + hdr.Size = tr.octal(header[483:495]) + + // Read the sparse map. + sp := tr.readOldGNUSparseMap(header) + if tr.err != nil { + return nil + } + // Current file is a GNU sparse file. Update the current file reader. + tr.curr = &sparseFileReader{rfr: tr.curr.(*regFileReader), sp: sp, tot: hdr.Size} + } + + return hdr +} + +// A sparseEntry holds a single entry in a sparse file's sparse map. +// A sparse entry indicates the offset and size in a sparse file of a +// block of data. +type sparseEntry struct { + offset int64 + numBytes int64 +} + +// readOldGNUSparseMap reads the sparse map as stored in the old GNU sparse format. +// The sparse map is stored in the tar header if it's small enough. If it's larger than four entries, +// then one or more extension headers are used to store the rest of the sparse map. +func (tr *Reader) readOldGNUSparseMap(header []byte) []sparseEntry { + isExtended := header[oldGNUSparseMainHeaderIsExtendedOffset] != 0 + spCap := oldGNUSparseMainHeaderNumEntries + if isExtended { + spCap += oldGNUSparseExtendedHeaderNumEntries + } + sp := make([]sparseEntry, 0, spCap) + s := slicer(header[oldGNUSparseMainHeaderOffset:]) + + // Read the four entries from the main tar header + for i := 0; i < oldGNUSparseMainHeaderNumEntries; i++ { + offset := tr.octal(s.next(oldGNUSparseOffsetSize)) + numBytes := tr.octal(s.next(oldGNUSparseNumBytesSize)) + if tr.err != nil { + tr.err = ErrHeader + return nil + } + if offset == 0 && numBytes == 0 { + break + } + sp = append(sp, sparseEntry{offset: offset, numBytes: numBytes}) + } + + for isExtended { + // There are more entries. Read an extension header and parse its entries. + sparseHeader := make([]byte, blockSize) + if _, tr.err = io.ReadFull(tr.r, sparseHeader); tr.err != nil { + return nil + } + isExtended = sparseHeader[oldGNUSparseExtendedHeaderIsExtendedOffset] != 0 + s = slicer(sparseHeader) + for i := 0; i < oldGNUSparseExtendedHeaderNumEntries; i++ { + offset := tr.octal(s.next(oldGNUSparseOffsetSize)) + numBytes := tr.octal(s.next(oldGNUSparseNumBytesSize)) + if tr.err != nil { + tr.err = ErrHeader + return nil + } + if offset == 0 && numBytes == 0 { + break + } + sp = append(sp, sparseEntry{offset: offset, numBytes: numBytes}) + } + } + return sp +} + +// readGNUSparseMap1x0 reads the sparse map as stored in GNU's PAX sparse format version 1.0. +// The sparse map is stored just before the file data and padded out to the nearest block boundary. +func readGNUSparseMap1x0(r io.Reader) ([]sparseEntry, error) { + buf := make([]byte, 2*blockSize) + sparseHeader := buf[:blockSize] + + // readDecimal is a helper function to read a decimal integer from the sparse map + // while making sure to read from the file in blocks of size blockSize + readDecimal := func() (int64, error) { + // Look for newline + nl := bytes.IndexByte(sparseHeader, '\n') + if nl == -1 { + if len(sparseHeader) >= blockSize { + // This is an error + return 0, ErrHeader + } + oldLen := len(sparseHeader) + newLen := oldLen + blockSize + if cap(sparseHeader) < newLen { + // There's more header, but we need to make room for the next block + copy(buf, sparseHeader) + sparseHeader = buf[:newLen] + } else { + // There's more header, and we can just reslice + sparseHeader = sparseHeader[:newLen] + } + + // Now that sparseHeader is large enough, read next block + if _, err := io.ReadFull(r, sparseHeader[oldLen:newLen]); err != nil { + return 0, err + } + + // Look for a newline in the new data + nl = bytes.IndexByte(sparseHeader[oldLen:newLen], '\n') + if nl == -1 { + // This is an error + return 0, ErrHeader + } + nl += oldLen // We want the position from the beginning + } + // Now that we've found a newline, read a number + n, err := strconv.ParseInt(string(sparseHeader[:nl]), 10, 0) + if err != nil { + return 0, ErrHeader + } + + // Update sparseHeader to consume this number + sparseHeader = sparseHeader[nl+1:] + return n, nil + } + + // Read the first block + if _, err := io.ReadFull(r, sparseHeader); err != nil { + return nil, err + } + + // The first line contains the number of entries + numEntries, err := readDecimal() + if err != nil { + return nil, err + } + + // Read all the entries + sp := make([]sparseEntry, 0, numEntries) + for i := int64(0); i < numEntries; i++ { + // Read the offset + offset, err := readDecimal() + if err != nil { + return nil, err + } + // Read numBytes + numBytes, err := readDecimal() + if err != nil { + return nil, err + } + + sp = append(sp, sparseEntry{offset: offset, numBytes: numBytes}) + } + + return sp, nil +} + +// readGNUSparseMap0x1 reads the sparse map as stored in GNU's PAX sparse format version 0.1. +// The sparse map is stored in the PAX headers. +func readGNUSparseMap0x1(headers map[string]string) ([]sparseEntry, error) { + // Get number of entries + numEntriesStr, ok := headers[paxGNUSparseNumBlocks] + if !ok { + return nil, ErrHeader + } + numEntries, err := strconv.ParseInt(numEntriesStr, 10, 0) + if err != nil { + return nil, ErrHeader + } + + sparseMap := strings.Split(headers[paxGNUSparseMap], ",") + + // There should be two numbers in sparseMap for each entry + if int64(len(sparseMap)) != 2*numEntries { + return nil, ErrHeader + } + + // Loop through the entries in the sparse map + sp := make([]sparseEntry, 0, numEntries) + for i := int64(0); i < numEntries; i++ { + offset, err := strconv.ParseInt(sparseMap[2*i], 10, 0) + if err != nil { + return nil, ErrHeader + } + numBytes, err := strconv.ParseInt(sparseMap[2*i+1], 10, 0) + if err != nil { + return nil, ErrHeader + } + sp = append(sp, sparseEntry{offset: offset, numBytes: numBytes}) + } + + return sp, nil +} + +// numBytes returns the number of bytes left to read in the current file's entry +// in the tar archive, or 0 if there is no current file. +func (tr *Reader) numBytes() int64 { + if tr.curr == nil { + // No current file, so no bytes + return 0 + } + return tr.curr.numBytes() +} + +// Read reads from the current entry in the tar archive. +// It returns 0, io.EOF when it reaches the end of that entry, +// until Next is called to advance to the next entry. +func (tr *Reader) Read(b []byte) (n int, err error) { + if tr.curr == nil { + return 0, io.EOF + } + n, err = tr.curr.Read(b) + if err != nil && err != io.EOF { + tr.err = err + } + return +} + +func (rfr *regFileReader) Read(b []byte) (n int, err error) { + if rfr.nb == 0 { + // file consumed + return 0, io.EOF + } + if int64(len(b)) > rfr.nb { + b = b[0:rfr.nb] + } + n, err = rfr.r.Read(b) + rfr.nb -= int64(n) + + if err == io.EOF && rfr.nb > 0 { + err = io.ErrUnexpectedEOF + } + return +} + +// numBytes returns the number of bytes left to read in the file's data in the tar archive. +func (rfr *regFileReader) numBytes() int64 { + return rfr.nb +} + +// readHole reads a sparse file hole ending at offset toOffset +func (sfr *sparseFileReader) readHole(b []byte, toOffset int64) int { + n64 := toOffset - sfr.pos + if n64 > int64(len(b)) { + n64 = int64(len(b)) + } + n := int(n64) + for i := 0; i < n; i++ { + b[i] = 0 + } + sfr.pos += n64 + return n +} + +// Read reads the sparse file data in expanded form. +func (sfr *sparseFileReader) Read(b []byte) (n int, err error) { + if len(sfr.sp) == 0 { + // No more data fragments to read from. + if sfr.pos < sfr.tot { + // We're in the last hole + n = sfr.readHole(b, sfr.tot) + return + } + // Otherwise, we're at the end of the file + return 0, io.EOF + } + if sfr.tot < sfr.sp[0].offset { + return 0, io.ErrUnexpectedEOF + } + if sfr.pos < sfr.sp[0].offset { + // We're in a hole + n = sfr.readHole(b, sfr.sp[0].offset) + return + } + + // We're not in a hole, so we'll read from the next data fragment + posInFragment := sfr.pos - sfr.sp[0].offset + bytesLeft := sfr.sp[0].numBytes - posInFragment + if int64(len(b)) > bytesLeft { + b = b[0:bytesLeft] + } + + n, err = sfr.rfr.Read(b) + sfr.pos += int64(n) + + if int64(n) == bytesLeft { + // We're done with this fragment + sfr.sp = sfr.sp[1:] + } + + if err == io.EOF && sfr.pos < sfr.tot { + // We reached the end of the last fragment's data, but there's a final hole + err = nil + } + return +} + +// numBytes returns the number of bytes left to read in the sparse file's +// sparse-encoded data in the tar archive. +func (sfr *sparseFileReader) numBytes() int64 { + return sfr.rfr.nb +} diff --git a/src/archive/tar/reader_test.go b/src/archive/tar/reader_test.go new file mode 100644 index 0000000000000000000000000000000000000000..da01f265911806985c60c2be78a5fa67301fe875 --- /dev/null +++ b/src/archive/tar/reader_test.go @@ -0,0 +1,798 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package tar + +import ( + "bytes" + "crypto/md5" + "fmt" + "io" + "io/ioutil" + "os" + "reflect" + "strings" + "testing" + "time" +) + +type untarTest struct { + file string + headers []*Header + cksums []string +} + +var gnuTarTest = &untarTest{ + file: "testdata/gnu.tar", + headers: []*Header{ + { + Name: "small.txt", + Mode: 0640, + Uid: 73025, + Gid: 5000, + Size: 5, + ModTime: time.Unix(1244428340, 0), + Typeflag: '0', + Uname: "dsymonds", + Gname: "eng", + }, + { + Name: "small2.txt", + Mode: 0640, + Uid: 73025, + Gid: 5000, + Size: 11, + ModTime: time.Unix(1244436044, 0), + Typeflag: '0', + Uname: "dsymonds", + Gname: "eng", + }, + }, + cksums: []string{ + "e38b27eaccb4391bdec553a7f3ae6b2f", + "c65bd2e50a56a2138bf1716f2fd56fe9", + }, +} + +var sparseTarTest = &untarTest{ + file: "testdata/sparse-formats.tar", + headers: []*Header{ + { + Name: "sparse-gnu", + Mode: 420, + Uid: 1000, + Gid: 1000, + Size: 200, + ModTime: time.Unix(1392395740, 0), + Typeflag: 0x53, + Linkname: "", + Uname: "david", + Gname: "david", + Devmajor: 0, + Devminor: 0, + }, + { + Name: "sparse-posix-0.0", + Mode: 420, + Uid: 1000, + Gid: 1000, + Size: 200, + ModTime: time.Unix(1392342187, 0), + Typeflag: 0x30, + Linkname: "", + Uname: "david", + Gname: "david", + Devmajor: 0, + Devminor: 0, + }, + { + Name: "sparse-posix-0.1", + Mode: 420, + Uid: 1000, + Gid: 1000, + Size: 200, + ModTime: time.Unix(1392340456, 0), + Typeflag: 0x30, + Linkname: "", + Uname: "david", + Gname: "david", + Devmajor: 0, + Devminor: 0, + }, + { + Name: "sparse-posix-1.0", + Mode: 420, + Uid: 1000, + Gid: 1000, + Size: 200, + ModTime: time.Unix(1392337404, 0), + Typeflag: 0x30, + Linkname: "", + Uname: "david", + Gname: "david", + Devmajor: 0, + Devminor: 0, + }, + { + Name: "end", + Mode: 420, + Uid: 1000, + Gid: 1000, + Size: 4, + ModTime: time.Unix(1392398319, 0), + Typeflag: 0x30, + Linkname: "", + Uname: "david", + Gname: "david", + Devmajor: 0, + Devminor: 0, + }, + }, + cksums: []string{ + "6f53234398c2449fe67c1812d993012f", + "6f53234398c2449fe67c1812d993012f", + "6f53234398c2449fe67c1812d993012f", + "6f53234398c2449fe67c1812d993012f", + "b0061974914468de549a2af8ced10316", + }, +} + +var untarTests = []*untarTest{ + gnuTarTest, + sparseTarTest, + { + file: "testdata/star.tar", + headers: []*Header{ + { + Name: "small.txt", + Mode: 0640, + Uid: 73025, + Gid: 5000, + Size: 5, + ModTime: time.Unix(1244592783, 0), + Typeflag: '0', + Uname: "dsymonds", + Gname: "eng", + AccessTime: time.Unix(1244592783, 0), + ChangeTime: time.Unix(1244592783, 0), + }, + { + Name: "small2.txt", + Mode: 0640, + Uid: 73025, + Gid: 5000, + Size: 11, + ModTime: time.Unix(1244592783, 0), + Typeflag: '0', + Uname: "dsymonds", + Gname: "eng", + AccessTime: time.Unix(1244592783, 0), + ChangeTime: time.Unix(1244592783, 0), + }, + }, + }, + { + file: "testdata/v7.tar", + headers: []*Header{ + { + Name: "small.txt", + Mode: 0444, + Uid: 73025, + Gid: 5000, + Size: 5, + ModTime: time.Unix(1244593104, 0), + Typeflag: '\x00', + }, + { + Name: "small2.txt", + Mode: 0444, + Uid: 73025, + Gid: 5000, + Size: 11, + ModTime: time.Unix(1244593104, 0), + Typeflag: '\x00', + }, + }, + }, + { + file: "testdata/pax.tar", + headers: []*Header{ + { + Name: "a/123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100", + Mode: 0664, + Uid: 1000, + Gid: 1000, + Uname: "shane", + Gname: "shane", + Size: 7, + ModTime: time.Unix(1350244992, 23960108), + ChangeTime: time.Unix(1350244992, 23960108), + AccessTime: time.Unix(1350244992, 23960108), + Typeflag: TypeReg, + }, + { + Name: "a/b", + Mode: 0777, + Uid: 1000, + Gid: 1000, + Uname: "shane", + Gname: "shane", + Size: 0, + ModTime: time.Unix(1350266320, 910238425), + ChangeTime: time.Unix(1350266320, 910238425), + AccessTime: time.Unix(1350266320, 910238425), + Typeflag: TypeSymlink, + Linkname: "123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100", + }, + }, + }, + { + file: "testdata/nil-uid.tar", // golang.org/issue/5290 + headers: []*Header{ + { + Name: "P1050238.JPG.log", + Mode: 0664, + Uid: 0, + Gid: 0, + Size: 14, + ModTime: time.Unix(1365454838, 0), + Typeflag: TypeReg, + Linkname: "", + Uname: "eyefi", + Gname: "eyefi", + Devmajor: 0, + Devminor: 0, + }, + }, + }, + { + file: "testdata/xattrs.tar", + headers: []*Header{ + { + Name: "small.txt", + Mode: 0644, + Uid: 1000, + Gid: 10, + Size: 5, + ModTime: time.Unix(1386065770, 448252320), + Typeflag: '0', + Uname: "alex", + Gname: "wheel", + AccessTime: time.Unix(1389782991, 419875220), + ChangeTime: time.Unix(1389782956, 794414986), + Xattrs: map[string]string{ + "user.key": "value", + "user.key2": "value2", + // Interestingly, selinux encodes the terminating null inside the xattr + "security.selinux": "unconfined_u:object_r:default_t:s0\x00", + }, + }, + { + Name: "small2.txt", + Mode: 0644, + Uid: 1000, + Gid: 10, + Size: 11, + ModTime: time.Unix(1386065770, 449252304), + Typeflag: '0', + Uname: "alex", + Gname: "wheel", + AccessTime: time.Unix(1389782991, 419875220), + ChangeTime: time.Unix(1386065770, 449252304), + Xattrs: map[string]string{ + "security.selinux": "unconfined_u:object_r:default_t:s0\x00", + }, + }, + }, + }, +} + +func TestReader(t *testing.T) { +testLoop: + for i, test := range untarTests { + f, err := os.Open(test.file) + if err != nil { + t.Errorf("test %d: Unexpected error: %v", i, err) + continue + } + defer f.Close() + tr := NewReader(f) + for j, header := range test.headers { + hdr, err := tr.Next() + if err != nil || hdr == nil { + t.Errorf("test %d, entry %d: Didn't get entry: %v", i, j, err) + f.Close() + continue testLoop + } + if !reflect.DeepEqual(*hdr, *header) { + t.Errorf("test %d, entry %d: Incorrect header:\nhave %+v\nwant %+v", + i, j, *hdr, *header) + } + } + hdr, err := tr.Next() + if err == io.EOF { + continue testLoop + } + if hdr != nil || err != nil { + t.Errorf("test %d: Unexpected entry or error: hdr=%v err=%v", i, hdr, err) + } + } +} + +func TestPartialRead(t *testing.T) { + f, err := os.Open("testdata/gnu.tar") + if err != nil { + t.Fatalf("Unexpected error: %v", err) + } + defer f.Close() + + tr := NewReader(f) + + // Read the first four bytes; Next() should skip the last byte. + hdr, err := tr.Next() + if err != nil || hdr == nil { + t.Fatalf("Didn't get first file: %v", err) + } + buf := make([]byte, 4) + if _, err := io.ReadFull(tr, buf); err != nil { + t.Fatalf("Unexpected error: %v", err) + } + if expected := []byte("Kilt"); !bytes.Equal(buf, expected) { + t.Errorf("Contents = %v, want %v", buf, expected) + } + + // Second file + hdr, err = tr.Next() + if err != nil || hdr == nil { + t.Fatalf("Didn't get second file: %v", err) + } + buf = make([]byte, 6) + if _, err := io.ReadFull(tr, buf); err != nil { + t.Fatalf("Unexpected error: %v", err) + } + if expected := []byte("Google"); !bytes.Equal(buf, expected) { + t.Errorf("Contents = %v, want %v", buf, expected) + } +} + +func TestIncrementalRead(t *testing.T) { + test := gnuTarTest + f, err := os.Open(test.file) + if err != nil { + t.Fatalf("Unexpected error: %v", err) + } + defer f.Close() + + tr := NewReader(f) + + headers := test.headers + cksums := test.cksums + nread := 0 + + // loop over all files + for ; ; nread++ { + hdr, err := tr.Next() + if hdr == nil || err == io.EOF { + break + } + + // check the header + if !reflect.DeepEqual(*hdr, *headers[nread]) { + t.Errorf("Incorrect header:\nhave %+v\nwant %+v", + *hdr, headers[nread]) + } + + // read file contents in little chunks EOF, + // checksumming all the way + h := md5.New() + rdbuf := make([]uint8, 8) + for { + nr, err := tr.Read(rdbuf) + if err == io.EOF { + break + } + if err != nil { + t.Errorf("Read: unexpected error %v\n", err) + break + } + h.Write(rdbuf[0:nr]) + } + // verify checksum + have := fmt.Sprintf("%x", h.Sum(nil)) + want := cksums[nread] + if want != have { + t.Errorf("Bad checksum on file %s:\nhave %+v\nwant %+v", hdr.Name, have, want) + } + } + if nread != len(headers) { + t.Errorf("Didn't process all files\nexpected: %d\nprocessed %d\n", len(headers), nread) + } +} + +func TestNonSeekable(t *testing.T) { + test := gnuTarTest + f, err := os.Open(test.file) + if err != nil { + t.Fatalf("Unexpected error: %v", err) + } + defer f.Close() + + type readerOnly struct { + io.Reader + } + tr := NewReader(readerOnly{f}) + nread := 0 + + for ; ; nread++ { + _, err := tr.Next() + if err == io.EOF { + break + } + if err != nil { + t.Fatalf("Unexpected error: %v", err) + } + } + + if nread != len(test.headers) { + t.Errorf("Didn't process all files\nexpected: %d\nprocessed %d\n", len(test.headers), nread) + } +} + +func TestParsePAXHeader(t *testing.T) { + paxTests := [][3]string{ + {"a", "a=name", "10 a=name\n"}, // Test case involving multiple acceptable lengths + {"a", "a=name", "9 a=name\n"}, // Test case involving multiple acceptable length + {"mtime", "mtime=1350244992.023960108", "30 mtime=1350244992.023960108\n"}} + for _, test := range paxTests { + key, expected, raw := test[0], test[1], test[2] + reader := bytes.NewReader([]byte(raw)) + headers, err := parsePAX(reader) + if err != nil { + t.Errorf("Couldn't parse correctly formatted headers: %v", err) + continue + } + if strings.EqualFold(headers[key], expected) { + t.Errorf("mtime header incorrectly parsed: got %s, wanted %s", headers[key], expected) + continue + } + trailer := make([]byte, 100) + n, err := reader.Read(trailer) + if err != io.EOF || n != 0 { + t.Error("Buffer wasn't consumed") + } + } + badHeaderTests := [][]byte{ + []byte("3 somelongkey=\n"), + []byte("50 tooshort=\n"), + } + for _, test := range badHeaderTests { + if _, err := parsePAX(bytes.NewReader(test)); err != ErrHeader { + t.Fatal("Unexpected success when parsing bad header") + } + } +} + +func TestParsePAXTime(t *testing.T) { + // Some valid PAX time values + timestamps := map[string]time.Time{ + "1350244992.023960108": time.Unix(1350244992, 23960108), // The common case + "1350244992.02396010": time.Unix(1350244992, 23960100), // Lower precision value + "1350244992.0239601089": time.Unix(1350244992, 23960108), // Higher precision value + "1350244992": time.Unix(1350244992, 0), // Low precision value + } + for input, expected := range timestamps { + ts, err := parsePAXTime(input) + if err != nil { + t.Fatal(err) + } + if !ts.Equal(expected) { + t.Fatalf("Time parsing failure %s %s", ts, expected) + } + } +} + +func TestMergePAX(t *testing.T) { + hdr := new(Header) + // Test a string, integer, and time based value. + headers := map[string]string{ + "path": "a/b/c", + "uid": "1000", + "mtime": "1350244992.023960108", + } + err := mergePAX(hdr, headers) + if err != nil { + t.Fatal(err) + } + want := &Header{ + Name: "a/b/c", + Uid: 1000, + ModTime: time.Unix(1350244992, 23960108), + } + if !reflect.DeepEqual(hdr, want) { + t.Errorf("incorrect merge: got %+v, want %+v", hdr, want) + } +} + +func TestSparseEndToEnd(t *testing.T) { + test := sparseTarTest + f, err := os.Open(test.file) + if err != nil { + t.Fatalf("Unexpected error: %v", err) + } + defer f.Close() + + tr := NewReader(f) + + headers := test.headers + cksums := test.cksums + nread := 0 + + // loop over all files + for ; ; nread++ { + hdr, err := tr.Next() + if hdr == nil || err == io.EOF { + break + } + + // check the header + if !reflect.DeepEqual(*hdr, *headers[nread]) { + t.Errorf("Incorrect header:\nhave %+v\nwant %+v", + *hdr, headers[nread]) + } + + // read and checksum the file data + h := md5.New() + _, err = io.Copy(h, tr) + if err != nil { + t.Fatalf("Unexpected error: %v", err) + } + + // verify checksum + have := fmt.Sprintf("%x", h.Sum(nil)) + want := cksums[nread] + if want != have { + t.Errorf("Bad checksum on file %s:\nhave %+v\nwant %+v", hdr.Name, have, want) + } + } + if nread != len(headers) { + t.Errorf("Didn't process all files\nexpected: %d\nprocessed %d\n", len(headers), nread) + } +} + +type sparseFileReadTest struct { + sparseData []byte + sparseMap []sparseEntry + realSize int64 + expected []byte +} + +var sparseFileReadTests = []sparseFileReadTest{ + { + sparseData: []byte("abcde"), + sparseMap: []sparseEntry{ + {offset: 0, numBytes: 2}, + {offset: 5, numBytes: 3}, + }, + realSize: 8, + expected: []byte("ab\x00\x00\x00cde"), + }, + { + sparseData: []byte("abcde"), + sparseMap: []sparseEntry{ + {offset: 0, numBytes: 2}, + {offset: 5, numBytes: 3}, + }, + realSize: 10, + expected: []byte("ab\x00\x00\x00cde\x00\x00"), + }, + { + sparseData: []byte("abcde"), + sparseMap: []sparseEntry{ + {offset: 1, numBytes: 3}, + {offset: 6, numBytes: 2}, + }, + realSize: 8, + expected: []byte("\x00abc\x00\x00de"), + }, + { + sparseData: []byte("abcde"), + sparseMap: []sparseEntry{ + {offset: 1, numBytes: 3}, + {offset: 6, numBytes: 2}, + }, + realSize: 10, + expected: []byte("\x00abc\x00\x00de\x00\x00"), + }, + { + sparseData: []byte(""), + sparseMap: nil, + realSize: 2, + expected: []byte("\x00\x00"), + }, +} + +func TestSparseFileReader(t *testing.T) { + for i, test := range sparseFileReadTests { + r := bytes.NewReader(test.sparseData) + nb := int64(r.Len()) + sfr := &sparseFileReader{ + rfr: ®FileReader{r: r, nb: nb}, + sp: test.sparseMap, + pos: 0, + tot: test.realSize, + } + if sfr.numBytes() != nb { + t.Errorf("test %d: Before reading, sfr.numBytes() = %d, want %d", i, sfr.numBytes(), nb) + } + buf, err := ioutil.ReadAll(sfr) + if err != nil { + t.Errorf("test %d: Unexpected error: %v", i, err) + } + if e := test.expected; !bytes.Equal(buf, e) { + t.Errorf("test %d: Contents = %v, want %v", i, buf, e) + } + if sfr.numBytes() != 0 { + t.Errorf("test %d: After draining the reader, numBytes() was nonzero", i) + } + } +} + +func TestSparseIncrementalRead(t *testing.T) { + sparseMap := []sparseEntry{{10, 2}} + sparseData := []byte("Go") + expected := "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00Go\x00\x00\x00\x00\x00\x00\x00\x00" + + r := bytes.NewReader(sparseData) + nb := int64(r.Len()) + sfr := &sparseFileReader{ + rfr: ®FileReader{r: r, nb: nb}, + sp: sparseMap, + pos: 0, + tot: int64(len(expected)), + } + + // We'll read the data 6 bytes at a time, with a hole of size 10 at + // the beginning and one of size 8 at the end. + var outputBuf bytes.Buffer + buf := make([]byte, 6) + for { + n, err := sfr.Read(buf) + if err == io.EOF { + break + } + if err != nil { + t.Errorf("Read: unexpected error %v\n", err) + } + if n > 0 { + _, err := outputBuf.Write(buf[:n]) + if err != nil { + t.Errorf("Write: unexpected error %v\n", err) + } + } + } + got := outputBuf.String() + if got != expected { + t.Errorf("Contents = %v, want %v", got, expected) + } +} + +func TestReadGNUSparseMap0x1(t *testing.T) { + headers := map[string]string{ + paxGNUSparseNumBlocks: "4", + paxGNUSparseMap: "0,5,10,5,20,5,30,5", + } + expected := []sparseEntry{ + {offset: 0, numBytes: 5}, + {offset: 10, numBytes: 5}, + {offset: 20, numBytes: 5}, + {offset: 30, numBytes: 5}, + } + + sp, err := readGNUSparseMap0x1(headers) + if err != nil { + t.Errorf("Unexpected error: %v", err) + } + if !reflect.DeepEqual(sp, expected) { + t.Errorf("Incorrect sparse map: got %v, wanted %v", sp, expected) + } +} + +func TestReadGNUSparseMap1x0(t *testing.T) { + // This test uses lots of holes so the sparse header takes up more than two blocks + numEntries := 100 + expected := make([]sparseEntry, 0, numEntries) + sparseMap := new(bytes.Buffer) + + fmt.Fprintf(sparseMap, "%d\n", numEntries) + for i := 0; i < numEntries; i++ { + offset := int64(2048 * i) + numBytes := int64(1024) + expected = append(expected, sparseEntry{offset: offset, numBytes: numBytes}) + fmt.Fprintf(sparseMap, "%d\n%d\n", offset, numBytes) + } + + // Make the header the smallest multiple of blockSize that fits the sparseMap + headerBlocks := (sparseMap.Len() + blockSize - 1) / blockSize + bufLen := blockSize * headerBlocks + buf := make([]byte, bufLen) + copy(buf, sparseMap.Bytes()) + + // Get an reader to read the sparse map + r := bytes.NewReader(buf) + + // Read the sparse map + sp, err := readGNUSparseMap1x0(r) + if err != nil { + t.Errorf("Unexpected error: %v", err) + } + if !reflect.DeepEqual(sp, expected) { + t.Errorf("Incorrect sparse map: got %v, wanted %v", sp, expected) + } +} + +func TestUninitializedRead(t *testing.T) { + test := gnuTarTest + f, err := os.Open(test.file) + if err != nil { + t.Fatalf("Unexpected error: %v", err) + } + defer f.Close() + + tr := NewReader(f) + _, err = tr.Read([]byte{}) + if err == nil || err != io.EOF { + t.Errorf("Unexpected error: %v, wanted %v", err, io.EOF) + } + +} + +// Negative header size should not cause panic. +// Issues 10959 and 10960. +func TestNegativeHdrSize(t *testing.T) { + f, err := os.Open("testdata/neg-size.tar") + if err != nil { + t.Fatal(err) + } + defer f.Close() + r := NewReader(f) + _, err = r.Next() + if err != ErrHeader { + t.Error("want ErrHeader, got", err) + } + io.Copy(ioutil.Discard, r) +} + +// This used to hang in (*sparseFileReader).readHole due to missing +// verification of sparse offsets against file size. +func TestIssue10968(t *testing.T) { + f, err := os.Open("testdata/issue10968.tar") + if err != nil { + t.Fatal(err) + } + defer f.Close() + r := NewReader(f) + _, err = r.Next() + if err != nil { + t.Fatal(err) + } + _, err = io.Copy(ioutil.Discard, r) + if err != io.ErrUnexpectedEOF { + t.Fatalf("expected %q, got %q", io.ErrUnexpectedEOF, err) + } +} + +// Do not panic if there are errors in header blocks after the pax header. +// Issue 11169 +func TestIssue11169(t *testing.T) { + f, err := os.Open("testdata/issue11169.tar") + if err != nil { + t.Fatal(err) + } + defer f.Close() + r := NewReader(f) + _, err = r.Next() + if err == nil { + t.Fatal("Unexpected success") + } +} diff --git a/src/archive/tar/stat_atim.go b/src/archive/tar/stat_atim.go new file mode 100644 index 0000000000000000000000000000000000000000..cf9cc79c5915bace0af0e81fa4df961f3a68553c --- /dev/null +++ b/src/archive/tar/stat_atim.go @@ -0,0 +1,20 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build linux dragonfly openbsd solaris + +package tar + +import ( + "syscall" + "time" +) + +func statAtime(st *syscall.Stat_t) time.Time { + return time.Unix(st.Atim.Unix()) +} + +func statCtime(st *syscall.Stat_t) time.Time { + return time.Unix(st.Ctim.Unix()) +} diff --git a/src/archive/tar/stat_atimespec.go b/src/archive/tar/stat_atimespec.go new file mode 100644 index 0000000000000000000000000000000000000000..6f17dbe30725c120218885cc662587b8c7dcb4d2 --- /dev/null +++ b/src/archive/tar/stat_atimespec.go @@ -0,0 +1,20 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build darwin freebsd netbsd + +package tar + +import ( + "syscall" + "time" +) + +func statAtime(st *syscall.Stat_t) time.Time { + return time.Unix(st.Atimespec.Unix()) +} + +func statCtime(st *syscall.Stat_t) time.Time { + return time.Unix(st.Ctimespec.Unix()) +} diff --git a/src/archive/tar/stat_unix.go b/src/archive/tar/stat_unix.go new file mode 100644 index 0000000000000000000000000000000000000000..cb843db4cfd65815830128cc0aa285dee36f7123 --- /dev/null +++ b/src/archive/tar/stat_unix.go @@ -0,0 +1,32 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build linux darwin dragonfly freebsd openbsd netbsd solaris + +package tar + +import ( + "os" + "syscall" +) + +func init() { + sysStat = statUnix +} + +func statUnix(fi os.FileInfo, h *Header) error { + sys, ok := fi.Sys().(*syscall.Stat_t) + if !ok { + return nil + } + h.Uid = int(sys.Uid) + h.Gid = int(sys.Gid) + // TODO(bradfitz): populate username & group. os/user + // doesn't cache LookupId lookups, and lacks group + // lookup functions. + h.AccessTime = statAtime(sys) + h.ChangeTime = statCtime(sys) + // TODO(bradfitz): major/minor device numbers? + return nil +} diff --git a/src/archive/tar/tar_test.go b/src/archive/tar/tar_test.go new file mode 100644 index 0000000000000000000000000000000000000000..d63c072eb9aaa489c5ec76552db060fa50f2a3ef --- /dev/null +++ b/src/archive/tar/tar_test.go @@ -0,0 +1,325 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package tar + +import ( + "bytes" + "io/ioutil" + "os" + "path" + "reflect" + "strings" + "testing" + "time" +) + +func TestFileInfoHeader(t *testing.T) { + fi, err := os.Stat("testdata/small.txt") + if err != nil { + t.Fatal(err) + } + h, err := FileInfoHeader(fi, "") + if err != nil { + t.Fatalf("FileInfoHeader: %v", err) + } + if g, e := h.Name, "small.txt"; g != e { + t.Errorf("Name = %q; want %q", g, e) + } + if g, e := h.Mode, int64(fi.Mode().Perm())|c_ISREG; g != e { + t.Errorf("Mode = %#o; want %#o", g, e) + } + if g, e := h.Size, int64(5); g != e { + t.Errorf("Size = %v; want %v", g, e) + } + if g, e := h.ModTime, fi.ModTime(); !g.Equal(e) { + t.Errorf("ModTime = %v; want %v", g, e) + } + // FileInfoHeader should error when passing nil FileInfo + if _, err := FileInfoHeader(nil, ""); err == nil { + t.Fatalf("Expected error when passing nil to FileInfoHeader") + } +} + +func TestFileInfoHeaderDir(t *testing.T) { + fi, err := os.Stat("testdata") + if err != nil { + t.Fatal(err) + } + h, err := FileInfoHeader(fi, "") + if err != nil { + t.Fatalf("FileInfoHeader: %v", err) + } + if g, e := h.Name, "testdata/"; g != e { + t.Errorf("Name = %q; want %q", g, e) + } + // Ignoring c_ISGID for golang.org/issue/4867 + if g, e := h.Mode&^c_ISGID, int64(fi.Mode().Perm())|c_ISDIR; g != e { + t.Errorf("Mode = %#o; want %#o", g, e) + } + if g, e := h.Size, int64(0); g != e { + t.Errorf("Size = %v; want %v", g, e) + } + if g, e := h.ModTime, fi.ModTime(); !g.Equal(e) { + t.Errorf("ModTime = %v; want %v", g, e) + } +} + +func TestFileInfoHeaderSymlink(t *testing.T) { + h, err := FileInfoHeader(symlink{}, "some-target") + if err != nil { + t.Fatal(err) + } + if g, e := h.Name, "some-symlink"; g != e { + t.Errorf("Name = %q; want %q", g, e) + } + if g, e := h.Linkname, "some-target"; g != e { + t.Errorf("Linkname = %q; want %q", g, e) + } +} + +type symlink struct{} + +func (symlink) Name() string { return "some-symlink" } +func (symlink) Size() int64 { return 0 } +func (symlink) Mode() os.FileMode { return os.ModeSymlink } +func (symlink) ModTime() time.Time { return time.Time{} } +func (symlink) IsDir() bool { return false } +func (symlink) Sys() interface{} { return nil } + +func TestRoundTrip(t *testing.T) { + data := []byte("some file contents") + + var b bytes.Buffer + tw := NewWriter(&b) + hdr := &Header{ + Name: "file.txt", + Uid: 1 << 21, // too big for 8 octal digits + Size: int64(len(data)), + ModTime: time.Now(), + } + // tar only supports second precision. + hdr.ModTime = hdr.ModTime.Add(-time.Duration(hdr.ModTime.Nanosecond()) * time.Nanosecond) + if err := tw.WriteHeader(hdr); err != nil { + t.Fatalf("tw.WriteHeader: %v", err) + } + if _, err := tw.Write(data); err != nil { + t.Fatalf("tw.Write: %v", err) + } + if err := tw.Close(); err != nil { + t.Fatalf("tw.Close: %v", err) + } + + // Read it back. + tr := NewReader(&b) + rHdr, err := tr.Next() + if err != nil { + t.Fatalf("tr.Next: %v", err) + } + if !reflect.DeepEqual(rHdr, hdr) { + t.Errorf("Header mismatch.\n got %+v\nwant %+v", rHdr, hdr) + } + rData, err := ioutil.ReadAll(tr) + if err != nil { + t.Fatalf("Read: %v", err) + } + if !bytes.Equal(rData, data) { + t.Errorf("Data mismatch.\n got %q\nwant %q", rData, data) + } +} + +type headerRoundTripTest struct { + h *Header + fm os.FileMode +} + +func TestHeaderRoundTrip(t *testing.T) { + golden := []headerRoundTripTest{ + // regular file. + { + h: &Header{ + Name: "test.txt", + Mode: 0644 | c_ISREG, + Size: 12, + ModTime: time.Unix(1360600916, 0), + Typeflag: TypeReg, + }, + fm: 0644, + }, + // symbolic link. + { + h: &Header{ + Name: "link.txt", + Mode: 0777 | c_ISLNK, + Size: 0, + ModTime: time.Unix(1360600852, 0), + Typeflag: TypeSymlink, + }, + fm: 0777 | os.ModeSymlink, + }, + // character device node. + { + h: &Header{ + Name: "dev/null", + Mode: 0666 | c_ISCHR, + Size: 0, + ModTime: time.Unix(1360578951, 0), + Typeflag: TypeChar, + }, + fm: 0666 | os.ModeDevice | os.ModeCharDevice, + }, + // block device node. + { + h: &Header{ + Name: "dev/sda", + Mode: 0660 | c_ISBLK, + Size: 0, + ModTime: time.Unix(1360578954, 0), + Typeflag: TypeBlock, + }, + fm: 0660 | os.ModeDevice, + }, + // directory. + { + h: &Header{ + Name: "dir/", + Mode: 0755 | c_ISDIR, + Size: 0, + ModTime: time.Unix(1360601116, 0), + Typeflag: TypeDir, + }, + fm: 0755 | os.ModeDir, + }, + // fifo node. + { + h: &Header{ + Name: "dev/initctl", + Mode: 0600 | c_ISFIFO, + Size: 0, + ModTime: time.Unix(1360578949, 0), + Typeflag: TypeFifo, + }, + fm: 0600 | os.ModeNamedPipe, + }, + // setuid. + { + h: &Header{ + Name: "bin/su", + Mode: 0755 | c_ISREG | c_ISUID, + Size: 23232, + ModTime: time.Unix(1355405093, 0), + Typeflag: TypeReg, + }, + fm: 0755 | os.ModeSetuid, + }, + // setguid. + { + h: &Header{ + Name: "group.txt", + Mode: 0750 | c_ISREG | c_ISGID, + Size: 0, + ModTime: time.Unix(1360602346, 0), + Typeflag: TypeReg, + }, + fm: 0750 | os.ModeSetgid, + }, + // sticky. + { + h: &Header{ + Name: "sticky.txt", + Mode: 0600 | c_ISREG | c_ISVTX, + Size: 7, + ModTime: time.Unix(1360602540, 0), + Typeflag: TypeReg, + }, + fm: 0600 | os.ModeSticky, + }, + // hard link. + { + h: &Header{ + Name: "hard.txt", + Mode: 0644 | c_ISREG, + Size: 0, + Linkname: "file.txt", + ModTime: time.Unix(1360600916, 0), + Typeflag: TypeLink, + }, + fm: 0644, + }, + // More information. + { + h: &Header{ + Name: "info.txt", + Mode: 0600 | c_ISREG, + Size: 0, + Uid: 1000, + Gid: 1000, + ModTime: time.Unix(1360602540, 0), + Uname: "slartibartfast", + Gname: "users", + Typeflag: TypeReg, + }, + fm: 0600, + }, + } + + for i, g := range golden { + fi := g.h.FileInfo() + h2, err := FileInfoHeader(fi, "") + if err != nil { + t.Error(err) + continue + } + if strings.Contains(fi.Name(), "/") { + t.Errorf("FileInfo of %q contains slash: %q", g.h.Name, fi.Name()) + } + name := path.Base(g.h.Name) + if fi.IsDir() { + name += "/" + } + if got, want := h2.Name, name; got != want { + t.Errorf("i=%d: Name: got %v, want %v", i, got, want) + } + if got, want := h2.Size, g.h.Size; got != want { + t.Errorf("i=%d: Size: got %v, want %v", i, got, want) + } + if got, want := h2.Uid, g.h.Uid; got != want { + t.Errorf("i=%d: Uid: got %d, want %d", i, got, want) + } + if got, want := h2.Gid, g.h.Gid; got != want { + t.Errorf("i=%d: Gid: got %d, want %d", i, got, want) + } + if got, want := h2.Uname, g.h.Uname; got != want { + t.Errorf("i=%d: Uname: got %q, want %q", i, got, want) + } + if got, want := h2.Gname, g.h.Gname; got != want { + t.Errorf("i=%d: Gname: got %q, want %q", i, got, want) + } + if got, want := h2.Linkname, g.h.Linkname; got != want { + t.Errorf("i=%d: Linkname: got %v, want %v", i, got, want) + } + if got, want := h2.Typeflag, g.h.Typeflag; got != want { + t.Logf("%#v %#v", g.h, fi.Sys()) + t.Errorf("i=%d: Typeflag: got %q, want %q", i, got, want) + } + if got, want := h2.Mode, g.h.Mode; got != want { + t.Errorf("i=%d: Mode: got %o, want %o", i, got, want) + } + if got, want := fi.Mode(), g.fm; got != want { + t.Errorf("i=%d: fi.Mode: got %o, want %o", i, got, want) + } + if got, want := h2.AccessTime, g.h.AccessTime; got != want { + t.Errorf("i=%d: AccessTime: got %v, want %v", i, got, want) + } + if got, want := h2.ChangeTime, g.h.ChangeTime; got != want { + t.Errorf("i=%d: ChangeTime: got %v, want %v", i, got, want) + } + if got, want := h2.ModTime, g.h.ModTime; got != want { + t.Errorf("i=%d: ModTime: got %v, want %v", i, got, want) + } + if sysh, ok := fi.Sys().(*Header); !ok || sysh != g.h { + t.Errorf("i=%d: Sys didn't return original *Header", i) + } + } +} diff --git a/src/archive/tar/testdata/gnu.tar b/src/archive/tar/testdata/gnu.tar new file mode 100644 index 0000000000000000000000000000000000000000..fc899dc8dc2ad9952f5c5f67a0c76ca2d87249e9 Binary files /dev/null and b/src/archive/tar/testdata/gnu.tar differ diff --git a/src/archive/tar/testdata/hardlink.tar b/src/archive/tar/testdata/hardlink.tar new file mode 100644 index 0000000000000000000000000000000000000000..9cd1a26572e44150ded8a628fefb28fa089645d1 Binary files /dev/null and b/src/archive/tar/testdata/hardlink.tar differ diff --git a/src/archive/tar/testdata/issue10968.tar b/src/archive/tar/testdata/issue10968.tar new file mode 100644 index 0000000000000000000000000000000000000000..1cc837bcff14cd822a26e43034955c82e852ab29 Binary files /dev/null and b/src/archive/tar/testdata/issue10968.tar differ diff --git a/src/archive/tar/testdata/issue11169.tar b/src/archive/tar/testdata/issue11169.tar new file mode 100644 index 0000000000000000000000000000000000000000..4d71fa15260609ecee0c8c751cfebf49be8763ac Binary files /dev/null and b/src/archive/tar/testdata/issue11169.tar differ diff --git a/src/archive/tar/testdata/neg-size.tar b/src/archive/tar/testdata/neg-size.tar new file mode 100644 index 0000000000000000000000000000000000000000..5deea3d05c4da5a4ddda34ef7ad781088464e71b Binary files /dev/null and b/src/archive/tar/testdata/neg-size.tar differ diff --git a/src/archive/tar/testdata/nil-uid.tar b/src/archive/tar/testdata/nil-uid.tar new file mode 100644 index 0000000000000000000000000000000000000000..cc9cfaa33cc5de0a28b4183c1705d801f788c96a Binary files /dev/null and b/src/archive/tar/testdata/nil-uid.tar differ diff --git a/src/archive/tar/testdata/pax.tar b/src/archive/tar/testdata/pax.tar new file mode 100644 index 0000000000000000000000000000000000000000..9bc24b6587d726c7fca4e533d9c61a3801a34688 Binary files /dev/null and b/src/archive/tar/testdata/pax.tar differ diff --git a/src/archive/tar/testdata/small.txt b/src/archive/tar/testdata/small.txt new file mode 100644 index 0000000000000000000000000000000000000000..b249bfc518a8c96f83747c9fde1ad3529fa3672d --- /dev/null +++ b/src/archive/tar/testdata/small.txt @@ -0,0 +1 @@ +Kilts \ No newline at end of file diff --git a/src/archive/tar/testdata/small2.txt b/src/archive/tar/testdata/small2.txt new file mode 100644 index 0000000000000000000000000000000000000000..394ee3ecd0edf3e17799ced62c774d17c1e57d31 --- /dev/null +++ b/src/archive/tar/testdata/small2.txt @@ -0,0 +1 @@ +Google.com diff --git a/src/archive/tar/testdata/sparse-formats.tar b/src/archive/tar/testdata/sparse-formats.tar new file mode 100644 index 0000000000000000000000000000000000000000..8bd4e74d50f9c8961f80a887ab7d6449e032048b Binary files /dev/null and b/src/archive/tar/testdata/sparse-formats.tar differ diff --git a/src/archive/tar/testdata/star.tar b/src/archive/tar/testdata/star.tar new file mode 100644 index 0000000000000000000000000000000000000000..59e2d4e604611eeac3e2a0f3d6f71d2623c50449 Binary files /dev/null and b/src/archive/tar/testdata/star.tar differ diff --git a/src/archive/tar/testdata/ustar.tar b/src/archive/tar/testdata/ustar.tar new file mode 100644 index 0000000000000000000000000000000000000000..29679d9a305fc0293f31212541335af824ab32c7 Binary files /dev/null and b/src/archive/tar/testdata/ustar.tar differ diff --git a/src/archive/tar/testdata/v7.tar b/src/archive/tar/testdata/v7.tar new file mode 100644 index 0000000000000000000000000000000000000000..eb65fc9410721efd98cb7c5e274f547ec530252d Binary files /dev/null and b/src/archive/tar/testdata/v7.tar differ diff --git a/src/archive/tar/testdata/writer-big-long.tar b/src/archive/tar/testdata/writer-big-long.tar new file mode 100644 index 0000000000000000000000000000000000000000..5960ee824784ffeacb976a9c648be41b0281508b Binary files /dev/null and b/src/archive/tar/testdata/writer-big-long.tar differ diff --git a/src/archive/tar/testdata/writer-big.tar b/src/archive/tar/testdata/writer-big.tar new file mode 100644 index 0000000000000000000000000000000000000000..753e883cebf52ac1291f1b7bf1b7a37ae517b2d9 Binary files /dev/null and b/src/archive/tar/testdata/writer-big.tar differ diff --git a/src/archive/tar/testdata/writer.tar b/src/archive/tar/testdata/writer.tar new file mode 100644 index 0000000000000000000000000000000000000000..e6d816ad0775d56d09242d6f5d1dbe56af310a32 Binary files /dev/null and b/src/archive/tar/testdata/writer.tar differ diff --git a/src/archive/tar/testdata/xattrs.tar b/src/archive/tar/testdata/xattrs.tar new file mode 100644 index 0000000000000000000000000000000000000000..9701950edd1f0dc82858b7117136b37391be0b08 Binary files /dev/null and b/src/archive/tar/testdata/xattrs.tar differ diff --git a/src/archive/tar/writer.go b/src/archive/tar/writer.go new file mode 100644 index 0000000000000000000000000000000000000000..9dbc01a2ffbc4b223e0a28cfff3a40dc4817ca19 --- /dev/null +++ b/src/archive/tar/writer.go @@ -0,0 +1,396 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package tar + +// TODO(dsymonds): +// - catch more errors (no first header, etc.) + +import ( + "bytes" + "errors" + "fmt" + "io" + "os" + "path" + "strconv" + "strings" + "time" +) + +var ( + ErrWriteTooLong = errors.New("archive/tar: write too long") + ErrFieldTooLong = errors.New("archive/tar: header field too long") + ErrWriteAfterClose = errors.New("archive/tar: write after close") + errNameTooLong = errors.New("archive/tar: name too long") + errInvalidHeader = errors.New("archive/tar: header field too long or contains invalid values") +) + +// A Writer provides sequential writing of a tar archive in POSIX.1 format. +// A tar archive consists of a sequence of files. +// Call WriteHeader to begin a new file, and then call Write to supply that file's data, +// writing at most hdr.Size bytes in total. +type Writer struct { + w io.Writer + err error + nb int64 // number of unwritten bytes for current file entry + pad int64 // amount of padding to write after current file entry + closed bool + usedBinary bool // whether the binary numeric field extension was used + preferPax bool // use pax header instead of binary numeric header + hdrBuff [blockSize]byte // buffer to use in writeHeader when writing a regular header + paxHdrBuff [blockSize]byte // buffer to use in writeHeader when writing a pax header +} + +// NewWriter creates a new Writer writing to w. +func NewWriter(w io.Writer) *Writer { return &Writer{w: w} } + +// Flush finishes writing the current file (optional). +func (tw *Writer) Flush() error { + if tw.nb > 0 { + tw.err = fmt.Errorf("archive/tar: missed writing %d bytes", tw.nb) + return tw.err + } + + n := tw.nb + tw.pad + for n > 0 && tw.err == nil { + nr := n + if nr > blockSize { + nr = blockSize + } + var nw int + nw, tw.err = tw.w.Write(zeroBlock[0:nr]) + n -= int64(nw) + } + tw.nb = 0 + tw.pad = 0 + return tw.err +} + +// Write s into b, terminating it with a NUL if there is room. +// If the value is too long for the field and allowPax is true add a paxheader record instead +func (tw *Writer) cString(b []byte, s string, allowPax bool, paxKeyword string, paxHeaders map[string]string) { + needsPaxHeader := allowPax && len(s) > len(b) || !isASCII(s) + if needsPaxHeader { + paxHeaders[paxKeyword] = s + return + } + if len(s) > len(b) { + if tw.err == nil { + tw.err = ErrFieldTooLong + } + return + } + ascii := toASCII(s) + copy(b, ascii) + if len(ascii) < len(b) { + b[len(ascii)] = 0 + } +} + +// Encode x as an octal ASCII string and write it into b with leading zeros. +func (tw *Writer) octal(b []byte, x int64) { + s := strconv.FormatInt(x, 8) + // leading zeros, but leave room for a NUL. + for len(s)+1 < len(b) { + s = "0" + s + } + tw.cString(b, s, false, paxNone, nil) +} + +// Write x into b, either as octal or as binary (GNUtar/star extension). +// If the value is too long for the field and writingPax is enabled both for the field and the add a paxheader record instead +func (tw *Writer) numeric(b []byte, x int64, allowPax bool, paxKeyword string, paxHeaders map[string]string) { + // Try octal first. + s := strconv.FormatInt(x, 8) + if len(s) < len(b) { + tw.octal(b, x) + return + } + + // If it is too long for octal, and pax is preferred, use a pax header + if allowPax && tw.preferPax { + tw.octal(b, 0) + s := strconv.FormatInt(x, 10) + paxHeaders[paxKeyword] = s + return + } + + // Too big: use binary (big-endian). + tw.usedBinary = true + for i := len(b) - 1; x > 0 && i >= 0; i-- { + b[i] = byte(x) + x >>= 8 + } + b[0] |= 0x80 // highest bit indicates binary format +} + +var ( + minTime = time.Unix(0, 0) + // There is room for 11 octal digits (33 bits) of mtime. + maxTime = minTime.Add((1<<33 - 1) * time.Second) +) + +// WriteHeader writes hdr and prepares to accept the file's contents. +// WriteHeader calls Flush if it is not the first header. +// Calling after a Close will return ErrWriteAfterClose. +func (tw *Writer) WriteHeader(hdr *Header) error { + return tw.writeHeader(hdr, true) +} + +// WriteHeader writes hdr and prepares to accept the file's contents. +// WriteHeader calls Flush if it is not the first header. +// Calling after a Close will return ErrWriteAfterClose. +// As this method is called internally by writePax header to allow it to +// suppress writing the pax header. +func (tw *Writer) writeHeader(hdr *Header, allowPax bool) error { + if tw.closed { + return ErrWriteAfterClose + } + if tw.err == nil { + tw.Flush() + } + if tw.err != nil { + return tw.err + } + + // a map to hold pax header records, if any are needed + paxHeaders := make(map[string]string) + + // TODO(shanemhansen): we might want to use PAX headers for + // subsecond time resolution, but for now let's just capture + // too long fields or non ascii characters + + var header []byte + + // We need to select which scratch buffer to use carefully, + // since this method is called recursively to write PAX headers. + // If allowPax is true, this is the non-recursive call, and we will use hdrBuff. + // If allowPax is false, we are being called by writePAXHeader, and hdrBuff is + // already being used by the non-recursive call, so we must use paxHdrBuff. + header = tw.hdrBuff[:] + if !allowPax { + header = tw.paxHdrBuff[:] + } + copy(header, zeroBlock) + s := slicer(header) + + // keep a reference to the filename to allow to overwrite it later if we detect that we can use ustar longnames instead of pax + pathHeaderBytes := s.next(fileNameSize) + + tw.cString(pathHeaderBytes, hdr.Name, true, paxPath, paxHeaders) + + // Handle out of range ModTime carefully. + var modTime int64 + if !hdr.ModTime.Before(minTime) && !hdr.ModTime.After(maxTime) { + modTime = hdr.ModTime.Unix() + } + + tw.octal(s.next(8), hdr.Mode) // 100:108 + tw.numeric(s.next(8), int64(hdr.Uid), true, paxUid, paxHeaders) // 108:116 + tw.numeric(s.next(8), int64(hdr.Gid), true, paxGid, paxHeaders) // 116:124 + tw.numeric(s.next(12), hdr.Size, true, paxSize, paxHeaders) // 124:136 + tw.numeric(s.next(12), modTime, false, paxNone, nil) // 136:148 --- consider using pax for finer granularity + s.next(8) // chksum (148:156) + s.next(1)[0] = hdr.Typeflag // 156:157 + + tw.cString(s.next(100), hdr.Linkname, true, paxLinkpath, paxHeaders) + + copy(s.next(8), []byte("ustar\x0000")) // 257:265 + tw.cString(s.next(32), hdr.Uname, true, paxUname, paxHeaders) // 265:297 + tw.cString(s.next(32), hdr.Gname, true, paxGname, paxHeaders) // 297:329 + tw.numeric(s.next(8), hdr.Devmajor, false, paxNone, nil) // 329:337 + tw.numeric(s.next(8), hdr.Devminor, false, paxNone, nil) // 337:345 + + // keep a reference to the prefix to allow to overwrite it later if we detect that we can use ustar longnames instead of pax + prefixHeaderBytes := s.next(155) + tw.cString(prefixHeaderBytes, "", false, paxNone, nil) // 345:500 prefix + + // Use the GNU magic instead of POSIX magic if we used any GNU extensions. + if tw.usedBinary { + copy(header[257:265], []byte("ustar \x00")) + } + + _, paxPathUsed := paxHeaders[paxPath] + // try to use a ustar header when only the name is too long + if !tw.preferPax && len(paxHeaders) == 1 && paxPathUsed { + suffix := hdr.Name + prefix := "" + if len(hdr.Name) > fileNameSize && isASCII(hdr.Name) { + var err error + prefix, suffix, err = tw.splitUSTARLongName(hdr.Name) + if err == nil { + // ok we can use a ustar long name instead of pax, now correct the fields + + // remove the path field from the pax header. this will suppress the pax header + delete(paxHeaders, paxPath) + + // update the path fields + tw.cString(pathHeaderBytes, suffix, false, paxNone, nil) + tw.cString(prefixHeaderBytes, prefix, false, paxNone, nil) + + // Use the ustar magic if we used ustar long names. + if len(prefix) > 0 && !tw.usedBinary { + copy(header[257:265], []byte("ustar\x00")) + } + } + } + } + + // The chksum field is terminated by a NUL and a space. + // This is different from the other octal fields. + chksum, _ := checksum(header) + tw.octal(header[148:155], chksum) + header[155] = ' ' + + if tw.err != nil { + // problem with header; probably integer too big for a field. + return tw.err + } + + if allowPax { + for k, v := range hdr.Xattrs { + paxHeaders[paxXattr+k] = v + } + } + + if len(paxHeaders) > 0 { + if !allowPax { + return errInvalidHeader + } + if err := tw.writePAXHeader(hdr, paxHeaders); err != nil { + return err + } + } + tw.nb = int64(hdr.Size) + tw.pad = (blockSize - (tw.nb % blockSize)) % blockSize + + _, tw.err = tw.w.Write(header) + return tw.err +} + +// writeUSTARLongName splits a USTAR long name hdr.Name. +// name must be < 256 characters. errNameTooLong is returned +// if hdr.Name can't be split. The splitting heuristic +// is compatible with gnu tar. +func (tw *Writer) splitUSTARLongName(name string) (prefix, suffix string, err error) { + length := len(name) + if length > fileNamePrefixSize+1 { + length = fileNamePrefixSize + 1 + } else if name[length-1] == '/' { + length-- + } + i := strings.LastIndex(name[:length], "/") + // nlen contains the resulting length in the name field. + // plen contains the resulting length in the prefix field. + nlen := len(name) - i - 1 + plen := i + if i <= 0 || nlen > fileNameSize || nlen == 0 || plen > fileNamePrefixSize { + err = errNameTooLong + return + } + prefix, suffix = name[:i], name[i+1:] + return +} + +// writePaxHeader writes an extended pax header to the +// archive. +func (tw *Writer) writePAXHeader(hdr *Header, paxHeaders map[string]string) error { + // Prepare extended header + ext := new(Header) + ext.Typeflag = TypeXHeader + // Setting ModTime is required for reader parsing to + // succeed, and seems harmless enough. + ext.ModTime = hdr.ModTime + // The spec asks that we namespace our pseudo files + // with the current pid. + pid := os.Getpid() + dir, file := path.Split(hdr.Name) + fullName := path.Join(dir, + fmt.Sprintf("PaxHeaders.%d", pid), file) + + ascii := toASCII(fullName) + if len(ascii) > 100 { + ascii = ascii[:100] + } + ext.Name = ascii + // Construct the body + var buf bytes.Buffer + + for k, v := range paxHeaders { + fmt.Fprint(&buf, paxHeader(k+"="+v)) + } + + ext.Size = int64(len(buf.Bytes())) + if err := tw.writeHeader(ext, false); err != nil { + return err + } + if _, err := tw.Write(buf.Bytes()); err != nil { + return err + } + if err := tw.Flush(); err != nil { + return err + } + return nil +} + +// paxHeader formats a single pax record, prefixing it with the appropriate length +func paxHeader(msg string) string { + const padding = 2 // Extra padding for space and newline + size := len(msg) + padding + size += len(strconv.Itoa(size)) + record := fmt.Sprintf("%d %s\n", size, msg) + if len(record) != size { + // Final adjustment if adding size increased + // the number of digits in size + size = len(record) + record = fmt.Sprintf("%d %s\n", size, msg) + } + return record +} + +// Write writes to the current entry in the tar archive. +// Write returns the error ErrWriteTooLong if more than +// hdr.Size bytes are written after WriteHeader. +func (tw *Writer) Write(b []byte) (n int, err error) { + if tw.closed { + err = ErrWriteAfterClose + return + } + overwrite := false + if int64(len(b)) > tw.nb { + b = b[0:tw.nb] + overwrite = true + } + n, err = tw.w.Write(b) + tw.nb -= int64(n) + if err == nil && overwrite { + err = ErrWriteTooLong + return + } + tw.err = err + return +} + +// Close closes the tar archive, flushing any unwritten +// data to the underlying writer. +func (tw *Writer) Close() error { + if tw.err != nil || tw.closed { + return tw.err + } + tw.Flush() + tw.closed = true + if tw.err != nil { + return tw.err + } + + // trailer: two zero blocks + for i := 0; i < 2; i++ { + _, tw.err = tw.w.Write(zeroBlock) + if tw.err != nil { + break + } + } + return tw.err +} diff --git a/src/archive/tar/writer_test.go b/src/archive/tar/writer_test.go new file mode 100644 index 0000000000000000000000000000000000000000..fe46a67ce38b1ce4c5943553b146ffb3b2e5e395 --- /dev/null +++ b/src/archive/tar/writer_test.go @@ -0,0 +1,546 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package tar + +import ( + "bytes" + "fmt" + "io" + "io/ioutil" + "os" + "reflect" + "strings" + "testing" + "testing/iotest" + "time" +) + +type writerTestEntry struct { + header *Header + contents string +} + +type writerTest struct { + file string // filename of expected output + entries []*writerTestEntry +} + +var writerTests = []*writerTest{ + // The writer test file was produced with this command: + // tar (GNU tar) 1.26 + // ln -s small.txt link.txt + // tar -b 1 --format=ustar -c -f writer.tar small.txt small2.txt link.txt + { + file: "testdata/writer.tar", + entries: []*writerTestEntry{ + { + header: &Header{ + Name: "small.txt", + Mode: 0640, + Uid: 73025, + Gid: 5000, + Size: 5, + ModTime: time.Unix(1246508266, 0), + Typeflag: '0', + Uname: "dsymonds", + Gname: "eng", + }, + contents: "Kilts", + }, + { + header: &Header{ + Name: "small2.txt", + Mode: 0640, + Uid: 73025, + Gid: 5000, + Size: 11, + ModTime: time.Unix(1245217492, 0), + Typeflag: '0', + Uname: "dsymonds", + Gname: "eng", + }, + contents: "Google.com\n", + }, + { + header: &Header{ + Name: "link.txt", + Mode: 0777, + Uid: 1000, + Gid: 1000, + Size: 0, + ModTime: time.Unix(1314603082, 0), + Typeflag: '2', + Linkname: "small.txt", + Uname: "strings", + Gname: "strings", + }, + // no contents + }, + }, + }, + // The truncated test file was produced using these commands: + // dd if=/dev/zero bs=1048576 count=16384 > /tmp/16gig.txt + // tar -b 1 -c -f- /tmp/16gig.txt | dd bs=512 count=8 > writer-big.tar + { + file: "testdata/writer-big.tar", + entries: []*writerTestEntry{ + { + header: &Header{ + Name: "tmp/16gig.txt", + Mode: 0640, + Uid: 73025, + Gid: 5000, + Size: 16 << 30, + ModTime: time.Unix(1254699560, 0), + Typeflag: '0', + Uname: "dsymonds", + Gname: "eng", + }, + // fake contents + contents: strings.Repeat("\x00", 4<<10), + }, + }, + }, + // The truncated test file was produced using these commands: + // dd if=/dev/zero bs=1048576 count=16384 > (longname/)*15 /16gig.txt + // tar -b 1 -c -f- (longname/)*15 /16gig.txt | dd bs=512 count=8 > writer-big-long.tar + { + file: "testdata/writer-big-long.tar", + entries: []*writerTestEntry{ + { + header: &Header{ + Name: strings.Repeat("longname/", 15) + "16gig.txt", + Mode: 0644, + Uid: 1000, + Gid: 1000, + Size: 16 << 30, + ModTime: time.Unix(1399583047, 0), + Typeflag: '0', + Uname: "guillaume", + Gname: "guillaume", + }, + // fake contents + contents: strings.Repeat("\x00", 4<<10), + }, + }, + }, + // This file was produced using gnu tar 1.17 + // gnutar -b 4 --format=ustar (longname/)*15 + file.txt + { + file: "testdata/ustar.tar", + entries: []*writerTestEntry{ + { + header: &Header{ + Name: strings.Repeat("longname/", 15) + "file.txt", + Mode: 0644, + Uid: 0765, + Gid: 024, + Size: 06, + ModTime: time.Unix(1360135598, 0), + Typeflag: '0', + Uname: "shane", + Gname: "staff", + }, + contents: "hello\n", + }, + }, + }, + // This file was produced using gnu tar 1.26 + // echo "Slartibartfast" > file.txt + // ln file.txt hard.txt + // tar -b 1 --format=ustar -c -f hardlink.tar file.txt hard.txt + { + file: "testdata/hardlink.tar", + entries: []*writerTestEntry{ + { + header: &Header{ + Name: "file.txt", + Mode: 0644, + Uid: 1000, + Gid: 100, + Size: 15, + ModTime: time.Unix(1425484303, 0), + Typeflag: '0', + Uname: "vbatts", + Gname: "users", + }, + contents: "Slartibartfast\n", + }, + { + header: &Header{ + Name: "hard.txt", + Mode: 0644, + Uid: 1000, + Gid: 100, + Size: 0, + ModTime: time.Unix(1425484303, 0), + Typeflag: '1', + Linkname: "file.txt", + Uname: "vbatts", + Gname: "users", + }, + // no contents + }, + }, + }, +} + +// Render byte array in a two-character hexadecimal string, spaced for easy visual inspection. +func bytestr(offset int, b []byte) string { + const rowLen = 32 + s := fmt.Sprintf("%04x ", offset) + for _, ch := range b { + switch { + case '0' <= ch && ch <= '9', 'A' <= ch && ch <= 'Z', 'a' <= ch && ch <= 'z': + s += fmt.Sprintf(" %c", ch) + default: + s += fmt.Sprintf(" %02x", ch) + } + } + return s +} + +// Render a pseudo-diff between two blocks of bytes. +func bytediff(a []byte, b []byte) string { + const rowLen = 32 + s := fmt.Sprintf("(%d bytes vs. %d bytes)\n", len(a), len(b)) + for offset := 0; len(a)+len(b) > 0; offset += rowLen { + na, nb := rowLen, rowLen + if na > len(a) { + na = len(a) + } + if nb > len(b) { + nb = len(b) + } + sa := bytestr(offset, a[0:na]) + sb := bytestr(offset, b[0:nb]) + if sa != sb { + s += fmt.Sprintf("-%v\n+%v\n", sa, sb) + } + a = a[na:] + b = b[nb:] + } + return s +} + +func TestWriter(t *testing.T) { +testLoop: + for i, test := range writerTests { + expected, err := ioutil.ReadFile(test.file) + if err != nil { + t.Errorf("test %d: Unexpected error: %v", i, err) + continue + } + + buf := new(bytes.Buffer) + tw := NewWriter(iotest.TruncateWriter(buf, 4<<10)) // only catch the first 4 KB + big := false + for j, entry := range test.entries { + big = big || entry.header.Size > 1<<10 + if err := tw.WriteHeader(entry.header); err != nil { + t.Errorf("test %d, entry %d: Failed writing header: %v", i, j, err) + continue testLoop + } + if _, err := io.WriteString(tw, entry.contents); err != nil { + t.Errorf("test %d, entry %d: Failed writing contents: %v", i, j, err) + continue testLoop + } + } + // Only interested in Close failures for the small tests. + if err := tw.Close(); err != nil && !big { + t.Errorf("test %d: Failed closing archive: %v", i, err) + continue testLoop + } + + actual := buf.Bytes() + if !bytes.Equal(expected, actual) { + t.Errorf("test %d: Incorrect result: (-=expected, +=actual)\n%v", + i, bytediff(expected, actual)) + } + if testing.Short() { // The second test is expensive. + break + } + } +} + +func TestPax(t *testing.T) { + // Create an archive with a large name + fileinfo, err := os.Stat("testdata/small.txt") + if err != nil { + t.Fatal(err) + } + hdr, err := FileInfoHeader(fileinfo, "") + if err != nil { + t.Fatalf("os.Stat: %v", err) + } + // Force a PAX long name to be written + longName := strings.Repeat("ab", 100) + contents := strings.Repeat(" ", int(hdr.Size)) + hdr.Name = longName + var buf bytes.Buffer + writer := NewWriter(&buf) + if err := writer.WriteHeader(hdr); err != nil { + t.Fatal(err) + } + if _, err = writer.Write([]byte(contents)); err != nil { + t.Fatal(err) + } + if err := writer.Close(); err != nil { + t.Fatal(err) + } + // Simple test to make sure PAX extensions are in effect + if !bytes.Contains(buf.Bytes(), []byte("PaxHeaders.")) { + t.Fatal("Expected at least one PAX header to be written.") + } + // Test that we can get a long name back out of the archive. + reader := NewReader(&buf) + hdr, err = reader.Next() + if err != nil { + t.Fatal(err) + } + if hdr.Name != longName { + t.Fatal("Couldn't recover long file name") + } +} + +func TestPaxSymlink(t *testing.T) { + // Create an archive with a large linkname + fileinfo, err := os.Stat("testdata/small.txt") + if err != nil { + t.Fatal(err) + } + hdr, err := FileInfoHeader(fileinfo, "") + hdr.Typeflag = TypeSymlink + if err != nil { + t.Fatalf("os.Stat:1 %v", err) + } + // Force a PAX long linkname to be written + longLinkname := strings.Repeat("1234567890/1234567890", 10) + hdr.Linkname = longLinkname + + hdr.Size = 0 + var buf bytes.Buffer + writer := NewWriter(&buf) + if err := writer.WriteHeader(hdr); err != nil { + t.Fatal(err) + } + if err := writer.Close(); err != nil { + t.Fatal(err) + } + // Simple test to make sure PAX extensions are in effect + if !bytes.Contains(buf.Bytes(), []byte("PaxHeaders.")) { + t.Fatal("Expected at least one PAX header to be written.") + } + // Test that we can get a long name back out of the archive. + reader := NewReader(&buf) + hdr, err = reader.Next() + if err != nil { + t.Fatal(err) + } + if hdr.Linkname != longLinkname { + t.Fatal("Couldn't recover long link name") + } +} + +func TestPaxNonAscii(t *testing.T) { + // Create an archive with non ascii. These should trigger a pax header + // because pax headers have a defined utf-8 encoding. + fileinfo, err := os.Stat("testdata/small.txt") + if err != nil { + t.Fatal(err) + } + + hdr, err := FileInfoHeader(fileinfo, "") + if err != nil { + t.Fatalf("os.Stat:1 %v", err) + } + + // some sample data + chineseFilename := "文件名" + chineseGroupname := "組" + chineseUsername := "用戶名" + + hdr.Name = chineseFilename + hdr.Gname = chineseGroupname + hdr.Uname = chineseUsername + + contents := strings.Repeat(" ", int(hdr.Size)) + + var buf bytes.Buffer + writer := NewWriter(&buf) + if err := writer.WriteHeader(hdr); err != nil { + t.Fatal(err) + } + if _, err = writer.Write([]byte(contents)); err != nil { + t.Fatal(err) + } + if err := writer.Close(); err != nil { + t.Fatal(err) + } + // Simple test to make sure PAX extensions are in effect + if !bytes.Contains(buf.Bytes(), []byte("PaxHeaders.")) { + t.Fatal("Expected at least one PAX header to be written.") + } + // Test that we can get a long name back out of the archive. + reader := NewReader(&buf) + hdr, err = reader.Next() + if err != nil { + t.Fatal(err) + } + if hdr.Name != chineseFilename { + t.Fatal("Couldn't recover unicode name") + } + if hdr.Gname != chineseGroupname { + t.Fatal("Couldn't recover unicode group") + } + if hdr.Uname != chineseUsername { + t.Fatal("Couldn't recover unicode user") + } +} + +func TestPaxXattrs(t *testing.T) { + xattrs := map[string]string{ + "user.key": "value", + } + + // Create an archive with an xattr + fileinfo, err := os.Stat("testdata/small.txt") + if err != nil { + t.Fatal(err) + } + hdr, err := FileInfoHeader(fileinfo, "") + if err != nil { + t.Fatalf("os.Stat: %v", err) + } + contents := "Kilts" + hdr.Xattrs = xattrs + var buf bytes.Buffer + writer := NewWriter(&buf) + if err := writer.WriteHeader(hdr); err != nil { + t.Fatal(err) + } + if _, err = writer.Write([]byte(contents)); err != nil { + t.Fatal(err) + } + if err := writer.Close(); err != nil { + t.Fatal(err) + } + // Test that we can get the xattrs back out of the archive. + reader := NewReader(&buf) + hdr, err = reader.Next() + if err != nil { + t.Fatal(err) + } + if !reflect.DeepEqual(hdr.Xattrs, xattrs) { + t.Fatalf("xattrs did not survive round trip: got %+v, want %+v", + hdr.Xattrs, xattrs) + } +} + +func TestPAXHeader(t *testing.T) { + medName := strings.Repeat("CD", 50) + longName := strings.Repeat("AB", 100) + paxTests := [][2]string{ + {paxPath + "=/etc/hosts", "19 path=/etc/hosts\n"}, + {"a=b", "6 a=b\n"}, // Single digit length + {"a=names", "11 a=names\n"}, // Test case involving carries + {paxPath + "=" + longName, fmt.Sprintf("210 path=%s\n", longName)}, + {paxPath + "=" + medName, fmt.Sprintf("110 path=%s\n", medName)}} + + for _, test := range paxTests { + key, expected := test[0], test[1] + if result := paxHeader(key); result != expected { + t.Fatalf("paxHeader: got %s, expected %s", result, expected) + } + } +} + +func TestUSTARLongName(t *testing.T) { + // Create an archive with a path that failed to split with USTAR extension in previous versions. + fileinfo, err := os.Stat("testdata/small.txt") + if err != nil { + t.Fatal(err) + } + hdr, err := FileInfoHeader(fileinfo, "") + hdr.Typeflag = TypeDir + if err != nil { + t.Fatalf("os.Stat:1 %v", err) + } + // Force a PAX long name to be written. The name was taken from a practical example + // that fails and replaced ever char through numbers to anonymize the sample. + longName := "/0000_0000000/00000-000000000/0000_0000000/00000-0000000000000/0000_0000000/00000-0000000-00000000/0000_0000000/00000000/0000_0000000/000/0000_0000000/00000000v00/0000_0000000/000000/0000_0000000/0000000/0000_0000000/00000y-00/0000/0000/00000000/0x000000/" + hdr.Name = longName + + hdr.Size = 0 + var buf bytes.Buffer + writer := NewWriter(&buf) + if err := writer.WriteHeader(hdr); err != nil { + t.Fatal(err) + } + if err := writer.Close(); err != nil { + t.Fatal(err) + } + // Test that we can get a long name back out of the archive. + reader := NewReader(&buf) + hdr, err = reader.Next() + if err != nil { + t.Fatal(err) + } + if hdr.Name != longName { + t.Fatal("Couldn't recover long name") + } +} + +func TestValidTypeflagWithPAXHeader(t *testing.T) { + var buffer bytes.Buffer + tw := NewWriter(&buffer) + + fileName := strings.Repeat("ab", 100) + + hdr := &Header{ + Name: fileName, + Size: 4, + Typeflag: 0, + } + if err := tw.WriteHeader(hdr); err != nil { + t.Fatalf("Failed to write header: %s", err) + } + if _, err := tw.Write([]byte("fooo")); err != nil { + t.Fatalf("Failed to write the file's data: %s", err) + } + tw.Close() + + tr := NewReader(&buffer) + + for { + header, err := tr.Next() + if err == io.EOF { + break + } + if err != nil { + t.Fatalf("Failed to read header: %s", err) + } + if header.Typeflag != 0 { + t.Fatalf("Typeflag should've been 0, found %d", header.Typeflag) + } + } +} + +func TestWriteAfterClose(t *testing.T) { + var buffer bytes.Buffer + tw := NewWriter(&buffer) + + hdr := &Header{ + Name: "small.txt", + Size: 5, + } + if err := tw.WriteHeader(hdr); err != nil { + t.Fatalf("Failed to write header: %s", err) + } + tw.Close() + if _, err := tw.Write([]byte("Kilts")); err != ErrWriteAfterClose { + t.Fatalf("Write: got %v; want ErrWriteAfterClose", err) + } +} diff --git a/src/archive/zip/example_test.go b/src/archive/zip/example_test.go new file mode 100644 index 0000000000000000000000000000000000000000..c2ed9e79ca62dd0ff6a2a6181393468c7b3faa73 --- /dev/null +++ b/src/archive/zip/example_test.go @@ -0,0 +1,75 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package zip_test + +import ( + "archive/zip" + "bytes" + "fmt" + "io" + "log" + "os" +) + +func ExampleWriter() { + // Create a buffer to write our archive to. + buf := new(bytes.Buffer) + + // Create a new zip archive. + w := zip.NewWriter(buf) + + // Add some files to the archive. + var files = []struct { + Name, Body string + }{ + {"readme.txt", "This archive contains some text files."}, + {"gopher.txt", "Gopher names:\nGeorge\nGeoffrey\nGonzo"}, + {"todo.txt", "Get animal handling licence.\nWrite more examples."}, + } + for _, file := range files { + f, err := w.Create(file.Name) + if err != nil { + log.Fatal(err) + } + _, err = f.Write([]byte(file.Body)) + if err != nil { + log.Fatal(err) + } + } + + // Make sure to check the error on Close. + err := w.Close() + if err != nil { + log.Fatal(err) + } +} + +func ExampleReader() { + // Open a zip archive for reading. + r, err := zip.OpenReader("testdata/readme.zip") + if err != nil { + log.Fatal(err) + } + defer r.Close() + + // Iterate through the files in the archive, + // printing some of their contents. + for _, f := range r.File { + fmt.Printf("Contents of %s:\n", f.Name) + rc, err := f.Open() + if err != nil { + log.Fatal(err) + } + _, err = io.CopyN(os.Stdout, rc, 68) + if err != nil { + log.Fatal(err) + } + rc.Close() + fmt.Println() + } + // Output: + // Contents of README: + // This is the source code repository for the Go programming language. +} diff --git a/src/archive/zip/reader.go b/src/archive/zip/reader.go new file mode 100644 index 0000000000000000000000000000000000000000..519748bac4006325228819074c7c984b9865063b --- /dev/null +++ b/src/archive/zip/reader.go @@ -0,0 +1,471 @@ +// Copyright 2010 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package zip + +import ( + "bufio" + "encoding/binary" + "errors" + "fmt" + "hash" + "hash/crc32" + "io" + "os" +) + +var ( + ErrFormat = errors.New("zip: not a valid zip file") + ErrAlgorithm = errors.New("zip: unsupported compression algorithm") + ErrChecksum = errors.New("zip: checksum error") +) + +type Reader struct { + r io.ReaderAt + File []*File + Comment string +} + +type ReadCloser struct { + f *os.File + Reader +} + +type File struct { + FileHeader + zipr io.ReaderAt + zipsize int64 + headerOffset int64 +} + +func (f *File) hasDataDescriptor() bool { + return f.Flags&0x8 != 0 +} + +// OpenReader will open the Zip file specified by name and return a ReadCloser. +func OpenReader(name string) (*ReadCloser, error) { + f, err := os.Open(name) + if err != nil { + return nil, err + } + fi, err := f.Stat() + if err != nil { + f.Close() + return nil, err + } + r := new(ReadCloser) + if err := r.init(f, fi.Size()); err != nil { + f.Close() + return nil, err + } + r.f = f + return r, nil +} + +// NewReader returns a new Reader reading from r, which is assumed to +// have the given size in bytes. +func NewReader(r io.ReaderAt, size int64) (*Reader, error) { + zr := new(Reader) + if err := zr.init(r, size); err != nil { + return nil, err + } + return zr, nil +} + +func (z *Reader) init(r io.ReaderAt, size int64) error { + end, err := readDirectoryEnd(r, size) + if err != nil { + return err + } + if end.directoryRecords > uint64(size)/fileHeaderLen { + return fmt.Errorf("archive/zip: TOC declares impossible %d files in %d byte zip", end.directoryRecords, size) + } + z.r = r + z.File = make([]*File, 0, end.directoryRecords) + z.Comment = end.comment + rs := io.NewSectionReader(r, 0, size) + if _, err = rs.Seek(int64(end.directoryOffset), os.SEEK_SET); err != nil { + return err + } + buf := bufio.NewReader(rs) + + // The count of files inside a zip is truncated to fit in a uint16. + // Gloss over this by reading headers until we encounter + // a bad one, and then only report a ErrFormat or UnexpectedEOF if + // the file count modulo 65536 is incorrect. + for { + f := &File{zipr: r, zipsize: size} + err = readDirectoryHeader(f, buf) + if err == ErrFormat || err == io.ErrUnexpectedEOF { + break + } + if err != nil { + return err + } + z.File = append(z.File, f) + } + if uint16(len(z.File)) != uint16(end.directoryRecords) { // only compare 16 bits here + // Return the readDirectoryHeader error if we read + // the wrong number of directory entries. + return err + } + return nil +} + +// Close closes the Zip file, rendering it unusable for I/O. +func (rc *ReadCloser) Close() error { + return rc.f.Close() +} + +// DataOffset returns the offset of the file's possibly-compressed +// data, relative to the beginning of the zip file. +// +// Most callers should instead use Open, which transparently +// decompresses data and verifies checksums. +func (f *File) DataOffset() (offset int64, err error) { + bodyOffset, err := f.findBodyOffset() + if err != nil { + return + } + return f.headerOffset + bodyOffset, nil +} + +// Open returns a ReadCloser that provides access to the File's contents. +// Multiple files may be read concurrently. +func (f *File) Open() (rc io.ReadCloser, err error) { + bodyOffset, err := f.findBodyOffset() + if err != nil { + return + } + size := int64(f.CompressedSize64) + r := io.NewSectionReader(f.zipr, f.headerOffset+bodyOffset, size) + dcomp := decompressor(f.Method) + if dcomp == nil { + err = ErrAlgorithm + return + } + rc = dcomp(r) + var desr io.Reader + if f.hasDataDescriptor() { + desr = io.NewSectionReader(f.zipr, f.headerOffset+bodyOffset+size, dataDescriptorLen) + } + rc = &checksumReader{ + rc: rc, + hash: crc32.NewIEEE(), + f: f, + desr: desr, + } + return +} + +type checksumReader struct { + rc io.ReadCloser + hash hash.Hash32 + nread uint64 // number of bytes read so far + f *File + desr io.Reader // if non-nil, where to read the data descriptor + err error // sticky error +} + +func (r *checksumReader) Read(b []byte) (n int, err error) { + if r.err != nil { + return 0, r.err + } + n, err = r.rc.Read(b) + r.hash.Write(b[:n]) + r.nread += uint64(n) + if err == nil { + return + } + if err == io.EOF { + if r.nread != r.f.UncompressedSize64 { + return 0, io.ErrUnexpectedEOF + } + if r.desr != nil { + if err1 := readDataDescriptor(r.desr, r.f); err1 != nil { + if err1 == io.EOF { + err = io.ErrUnexpectedEOF + } else { + err = err1 + } + } else if r.hash.Sum32() != r.f.CRC32 { + err = ErrChecksum + } + } else { + // If there's not a data descriptor, we still compare + // the CRC32 of what we've read against the file header + // or TOC's CRC32, if it seems like it was set. + if r.f.CRC32 != 0 && r.hash.Sum32() != r.f.CRC32 { + err = ErrChecksum + } + } + } + r.err = err + return +} + +func (r *checksumReader) Close() error { return r.rc.Close() } + +// findBodyOffset does the minimum work to verify the file has a header +// and returns the file body offset. +func (f *File) findBodyOffset() (int64, error) { + var buf [fileHeaderLen]byte + if _, err := f.zipr.ReadAt(buf[:], f.headerOffset); err != nil { + return 0, err + } + b := readBuf(buf[:]) + if sig := b.uint32(); sig != fileHeaderSignature { + return 0, ErrFormat + } + b = b[22:] // skip over most of the header + filenameLen := int(b.uint16()) + extraLen := int(b.uint16()) + return int64(fileHeaderLen + filenameLen + extraLen), nil +} + +// readDirectoryHeader attempts to read a directory header from r. +// It returns io.ErrUnexpectedEOF if it cannot read a complete header, +// and ErrFormat if it doesn't find a valid header signature. +func readDirectoryHeader(f *File, r io.Reader) error { + var buf [directoryHeaderLen]byte + if _, err := io.ReadFull(r, buf[:]); err != nil { + return err + } + b := readBuf(buf[:]) + if sig := b.uint32(); sig != directoryHeaderSignature { + return ErrFormat + } + f.CreatorVersion = b.uint16() + f.ReaderVersion = b.uint16() + f.Flags = b.uint16() + f.Method = b.uint16() + f.ModifiedTime = b.uint16() + f.ModifiedDate = b.uint16() + f.CRC32 = b.uint32() + f.CompressedSize = b.uint32() + f.UncompressedSize = b.uint32() + f.CompressedSize64 = uint64(f.CompressedSize) + f.UncompressedSize64 = uint64(f.UncompressedSize) + filenameLen := int(b.uint16()) + extraLen := int(b.uint16()) + commentLen := int(b.uint16()) + b = b[4:] // skipped start disk number and internal attributes (2x uint16) + f.ExternalAttrs = b.uint32() + f.headerOffset = int64(b.uint32()) + d := make([]byte, filenameLen+extraLen+commentLen) + if _, err := io.ReadFull(r, d); err != nil { + return err + } + f.Name = string(d[:filenameLen]) + f.Extra = d[filenameLen : filenameLen+extraLen] + f.Comment = string(d[filenameLen+extraLen:]) + + if len(f.Extra) > 0 { + b := readBuf(f.Extra) + for len(b) >= 4 { // need at least tag and size + tag := b.uint16() + size := b.uint16() + if int(size) > len(b) { + return ErrFormat + } + if tag == zip64ExtraId { + // update directory values from the zip64 extra block + eb := readBuf(b[:size]) + if len(eb) >= 8 { + f.UncompressedSize64 = eb.uint64() + } + if len(eb) >= 8 { + f.CompressedSize64 = eb.uint64() + } + if len(eb) >= 8 { + f.headerOffset = int64(eb.uint64()) + } + } + b = b[size:] + } + // Should have consumed the whole header. + // But popular zip & JAR creation tools are broken and + // may pad extra zeros at the end, so accept those + // too. See golang.org/issue/8186. + for _, v := range b { + if v != 0 { + return ErrFormat + } + } + } + return nil +} + +func readDataDescriptor(r io.Reader, f *File) error { + var buf [dataDescriptorLen]byte + + // The spec says: "Although not originally assigned a + // signature, the value 0x08074b50 has commonly been adopted + // as a signature value for the data descriptor record. + // Implementers should be aware that ZIP files may be + // encountered with or without this signature marking data + // descriptors and should account for either case when reading + // ZIP files to ensure compatibility." + // + // dataDescriptorLen includes the size of the signature but + // first read just those 4 bytes to see if it exists. + if _, err := io.ReadFull(r, buf[:4]); err != nil { + return err + } + off := 0 + maybeSig := readBuf(buf[:4]) + if maybeSig.uint32() != dataDescriptorSignature { + // No data descriptor signature. Keep these four + // bytes. + off += 4 + } + if _, err := io.ReadFull(r, buf[off:12]); err != nil { + return err + } + b := readBuf(buf[:12]) + if b.uint32() != f.CRC32 { + return ErrChecksum + } + + // The two sizes that follow here can be either 32 bits or 64 bits + // but the spec is not very clear on this and different + // interpretations has been made causing incompatibilities. We + // already have the sizes from the central directory so we can + // just ignore these. + + return nil +} + +func readDirectoryEnd(r io.ReaderAt, size int64) (dir *directoryEnd, err error) { + // look for directoryEndSignature in the last 1k, then in the last 65k + var buf []byte + var directoryEndOffset int64 + for i, bLen := range []int64{1024, 65 * 1024} { + if bLen > size { + bLen = size + } + buf = make([]byte, int(bLen)) + if _, err := r.ReadAt(buf, size-bLen); err != nil && err != io.EOF { + return nil, err + } + if p := findSignatureInBlock(buf); p >= 0 { + buf = buf[p:] + directoryEndOffset = size - bLen + int64(p) + break + } + if i == 1 || bLen == size { + return nil, ErrFormat + } + } + + // read header into struct + b := readBuf(buf[4:]) // skip signature + d := &directoryEnd{ + diskNbr: uint32(b.uint16()), + dirDiskNbr: uint32(b.uint16()), + dirRecordsThisDisk: uint64(b.uint16()), + directoryRecords: uint64(b.uint16()), + directorySize: uint64(b.uint32()), + directoryOffset: uint64(b.uint32()), + commentLen: b.uint16(), + } + l := int(d.commentLen) + if l > len(b) { + return nil, errors.New("zip: invalid comment length") + } + d.comment = string(b[:l]) + + p, err := findDirectory64End(r, directoryEndOffset) + if err == nil && p >= 0 { + err = readDirectory64End(r, p, d) + } + if err != nil { + return nil, err + } + + // Make sure directoryOffset points to somewhere in our file. + if o := int64(d.directoryOffset); o < 0 || o >= size { + return nil, ErrFormat + } + return d, nil +} + +// findDirectory64End tries to read the zip64 locator just before the +// directory end and returns the offset of the zip64 directory end if +// found. +func findDirectory64End(r io.ReaderAt, directoryEndOffset int64) (int64, error) { + locOffset := directoryEndOffset - directory64LocLen + if locOffset < 0 { + return -1, nil // no need to look for a header outside the file + } + buf := make([]byte, directory64LocLen) + if _, err := r.ReadAt(buf, locOffset); err != nil { + return -1, err + } + b := readBuf(buf) + if sig := b.uint32(); sig != directory64LocSignature { + return -1, nil + } + b = b[4:] // skip number of the disk with the start of the zip64 end of central directory + p := b.uint64() // relative offset of the zip64 end of central directory record + return int64(p), nil +} + +// readDirectory64End reads the zip64 directory end and updates the +// directory end with the zip64 directory end values. +func readDirectory64End(r io.ReaderAt, offset int64, d *directoryEnd) (err error) { + buf := make([]byte, directory64EndLen) + if _, err := r.ReadAt(buf, offset); err != nil { + return err + } + + b := readBuf(buf) + if sig := b.uint32(); sig != directory64EndSignature { + return ErrFormat + } + + b = b[12:] // skip dir size, version and version needed (uint64 + 2x uint16) + d.diskNbr = b.uint32() // number of this disk + d.dirDiskNbr = b.uint32() // number of the disk with the start of the central directory + d.dirRecordsThisDisk = b.uint64() // total number of entries in the central directory on this disk + d.directoryRecords = b.uint64() // total number of entries in the central directory + d.directorySize = b.uint64() // size of the central directory + d.directoryOffset = b.uint64() // offset of start of central directory with respect to the starting disk number + + return nil +} + +func findSignatureInBlock(b []byte) int { + for i := len(b) - directoryEndLen; i >= 0; i-- { + // defined from directoryEndSignature in struct.go + if b[i] == 'P' && b[i+1] == 'K' && b[i+2] == 0x05 && b[i+3] == 0x06 { + // n is length of comment + n := int(b[i+directoryEndLen-2]) | int(b[i+directoryEndLen-1])<<8 + if n+directoryEndLen+i <= len(b) { + return i + } + } + } + return -1 +} + +type readBuf []byte + +func (b *readBuf) uint16() uint16 { + v := binary.LittleEndian.Uint16(*b) + *b = (*b)[2:] + return v +} + +func (b *readBuf) uint32() uint32 { + v := binary.LittleEndian.Uint32(*b) + *b = (*b)[4:] + return v +} + +func (b *readBuf) uint64() uint64 { + v := binary.LittleEndian.Uint64(*b) + *b = (*b)[8:] + return v +} diff --git a/src/archive/zip/reader_test.go b/src/archive/zip/reader_test.go new file mode 100644 index 0000000000000000000000000000000000000000..547dd39048e21749faa6bebb159734bc4caf1599 --- /dev/null +++ b/src/archive/zip/reader_test.go @@ -0,0 +1,607 @@ +// Copyright 2010 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package zip + +import ( + "bytes" + "encoding/binary" + "encoding/hex" + "io" + "io/ioutil" + "os" + "path/filepath" + "regexp" + "strings" + "testing" + "time" +) + +type ZipTest struct { + Name string + Source func() (r io.ReaderAt, size int64) // if non-nil, used instead of testdata/ file + Comment string + File []ZipTestFile + Error error // the error that Opening this file should return +} + +type ZipTestFile struct { + Name string + Content []byte // if blank, will attempt to compare against File + ContentErr error + File string // name of file to compare to (relative to testdata/) + Mtime string // modified time in format "mm-dd-yy hh:mm:ss" + Mode os.FileMode +} + +// Caution: The Mtime values found for the test files should correspond to +// the values listed with unzip -l . However, the values +// listed by unzip appear to be off by some hours. When creating +// fresh test files and testing them, this issue is not present. +// The test files were created in Sydney, so there might be a time +// zone issue. The time zone information does have to be encoded +// somewhere, because otherwise unzip -l could not provide a different +// time from what the archive/zip package provides, but there appears +// to be no documentation about this. + +var tests = []ZipTest{ + { + Name: "test.zip", + Comment: "This is a zipfile comment.", + File: []ZipTestFile{ + { + Name: "test.txt", + Content: []byte("This is a test text file.\n"), + Mtime: "09-05-10 12:12:02", + Mode: 0644, + }, + { + Name: "gophercolor16x16.png", + File: "gophercolor16x16.png", + Mtime: "09-05-10 15:52:58", + Mode: 0644, + }, + }, + }, + { + Name: "test-trailing-junk.zip", + Comment: "This is a zipfile comment.", + File: []ZipTestFile{ + { + Name: "test.txt", + Content: []byte("This is a test text file.\n"), + Mtime: "09-05-10 12:12:02", + Mode: 0644, + }, + { + Name: "gophercolor16x16.png", + File: "gophercolor16x16.png", + Mtime: "09-05-10 15:52:58", + Mode: 0644, + }, + }, + }, + { + Name: "r.zip", + Source: returnRecursiveZip, + File: []ZipTestFile{ + { + Name: "r/r.zip", + Content: rZipBytes(), + Mtime: "03-04-10 00:24:16", + Mode: 0666, + }, + }, + }, + { + Name: "symlink.zip", + File: []ZipTestFile{ + { + Name: "symlink", + Content: []byte("../target"), + Mode: 0777 | os.ModeSymlink, + }, + }, + }, + { + Name: "readme.zip", + }, + { + Name: "readme.notzip", + Error: ErrFormat, + }, + { + Name: "dd.zip", + File: []ZipTestFile{ + { + Name: "filename", + Content: []byte("This is a test textfile.\n"), + Mtime: "02-02-11 13:06:20", + Mode: 0666, + }, + }, + }, + { + // created in windows XP file manager. + Name: "winxp.zip", + File: crossPlatform, + }, + { + // created by Zip 3.0 under Linux + Name: "unix.zip", + File: crossPlatform, + }, + { + // created by Go, before we wrote the "optional" data + // descriptor signatures (which are required by OS X) + Name: "go-no-datadesc-sig.zip", + File: []ZipTestFile{ + { + Name: "foo.txt", + Content: []byte("foo\n"), + Mtime: "03-08-12 16:59:10", + Mode: 0644, + }, + { + Name: "bar.txt", + Content: []byte("bar\n"), + Mtime: "03-08-12 16:59:12", + Mode: 0644, + }, + }, + }, + { + // created by Go, after we wrote the "optional" data + // descriptor signatures (which are required by OS X) + Name: "go-with-datadesc-sig.zip", + File: []ZipTestFile{ + { + Name: "foo.txt", + Content: []byte("foo\n"), + Mode: 0666, + }, + { + Name: "bar.txt", + Content: []byte("bar\n"), + Mode: 0666, + }, + }, + }, + { + Name: "Bad-CRC32-in-data-descriptor", + Source: returnCorruptCRC32Zip, + File: []ZipTestFile{ + { + Name: "foo.txt", + Content: []byte("foo\n"), + Mode: 0666, + ContentErr: ErrChecksum, + }, + { + Name: "bar.txt", + Content: []byte("bar\n"), + Mode: 0666, + }, + }, + }, + // Tests that we verify (and accept valid) crc32s on files + // with crc32s in their file header (not in data descriptors) + { + Name: "crc32-not-streamed.zip", + File: []ZipTestFile{ + { + Name: "foo.txt", + Content: []byte("foo\n"), + Mtime: "03-08-12 16:59:10", + Mode: 0644, + }, + { + Name: "bar.txt", + Content: []byte("bar\n"), + Mtime: "03-08-12 16:59:12", + Mode: 0644, + }, + }, + }, + // Tests that we verify (and reject invalid) crc32s on files + // with crc32s in their file header (not in data descriptors) + { + Name: "crc32-not-streamed.zip", + Source: returnCorruptNotStreamedZip, + File: []ZipTestFile{ + { + Name: "foo.txt", + Content: []byte("foo\n"), + Mtime: "03-08-12 16:59:10", + Mode: 0644, + ContentErr: ErrChecksum, + }, + { + Name: "bar.txt", + Content: []byte("bar\n"), + Mtime: "03-08-12 16:59:12", + Mode: 0644, + }, + }, + }, + { + Name: "zip64.zip", + File: []ZipTestFile{ + { + Name: "README", + Content: []byte("This small file is in ZIP64 format.\n"), + Mtime: "08-10-12 14:33:32", + Mode: 0644, + }, + }, + }, + // Another zip64 file with different Extras fields. (golang.org/issue/7069) + { + Name: "zip64-2.zip", + File: []ZipTestFile{ + { + Name: "README", + Content: []byte("This small file is in ZIP64 format.\n"), + Mtime: "08-10-12 14:33:32", + Mode: 0644, + }, + }, + }, +} + +var crossPlatform = []ZipTestFile{ + { + Name: "hello", + Content: []byte("world \r\n"), + Mode: 0666, + }, + { + Name: "dir/bar", + Content: []byte("foo \r\n"), + Mode: 0666, + }, + { + Name: "dir/empty/", + Content: []byte{}, + Mode: os.ModeDir | 0777, + }, + { + Name: "readonly", + Content: []byte("important \r\n"), + Mode: 0444, + }, +} + +func TestReader(t *testing.T) { + for _, zt := range tests { + readTestZip(t, zt) + } +} + +func readTestZip(t *testing.T, zt ZipTest) { + var z *Reader + var err error + if zt.Source != nil { + rat, size := zt.Source() + z, err = NewReader(rat, size) + } else { + var rc *ReadCloser + rc, err = OpenReader(filepath.Join("testdata", zt.Name)) + if err == nil { + defer rc.Close() + z = &rc.Reader + } + } + if err != zt.Error { + t.Errorf("%s: error=%v, want %v", zt.Name, err, zt.Error) + return + } + + // bail if file is not zip + if err == ErrFormat { + return + } + + // bail here if no Files expected to be tested + // (there may actually be files in the zip, but we don't care) + if zt.File == nil { + return + } + + if z.Comment != zt.Comment { + t.Errorf("%s: comment=%q, want %q", zt.Name, z.Comment, zt.Comment) + } + if len(z.File) != len(zt.File) { + t.Fatalf("%s: file count=%d, want %d", zt.Name, len(z.File), len(zt.File)) + } + + // test read of each file + for i, ft := range zt.File { + readTestFile(t, zt, ft, z.File[i]) + } + + // test simultaneous reads + n := 0 + done := make(chan bool) + for i := 0; i < 5; i++ { + for j, ft := range zt.File { + go func(j int, ft ZipTestFile) { + readTestFile(t, zt, ft, z.File[j]) + done <- true + }(j, ft) + n++ + } + } + for ; n > 0; n-- { + <-done + } +} + +func readTestFile(t *testing.T, zt ZipTest, ft ZipTestFile, f *File) { + if f.Name != ft.Name { + t.Errorf("%s: name=%q, want %q", zt.Name, f.Name, ft.Name) + } + + if ft.Mtime != "" { + mtime, err := time.Parse("01-02-06 15:04:05", ft.Mtime) + if err != nil { + t.Error(err) + return + } + if ft := f.ModTime(); !ft.Equal(mtime) { + t.Errorf("%s: %s: mtime=%s, want %s", zt.Name, f.Name, ft, mtime) + } + } + + testFileMode(t, zt.Name, f, ft.Mode) + + var b bytes.Buffer + r, err := f.Open() + if err != nil { + t.Errorf("%s: %v", zt.Name, err) + return + } + + _, err = io.Copy(&b, r) + if err != ft.ContentErr { + t.Errorf("%s: copying contents: %v (want %v)", zt.Name, err, ft.ContentErr) + } + if err != nil { + return + } + r.Close() + + size := uint64(f.UncompressedSize) + if size == uint32max { + size = f.UncompressedSize64 + } + if g := uint64(b.Len()); g != size { + t.Errorf("%v: read %v bytes but f.UncompressedSize == %v", f.Name, g, size) + } + + var c []byte + if ft.Content != nil { + c = ft.Content + } else if c, err = ioutil.ReadFile("testdata/" + ft.File); err != nil { + t.Error(err) + return + } + + if b.Len() != len(c) { + t.Errorf("%s: len=%d, want %d", f.Name, b.Len(), len(c)) + return + } + + for i, b := range b.Bytes() { + if b != c[i] { + t.Errorf("%s: content[%d]=%q want %q", f.Name, i, b, c[i]) + return + } + } +} + +func testFileMode(t *testing.T, zipName string, f *File, want os.FileMode) { + mode := f.Mode() + if want == 0 { + t.Errorf("%s: %s mode: got %v, want none", zipName, f.Name, mode) + } else if mode != want { + t.Errorf("%s: %s mode: want %v, got %v", zipName, f.Name, want, mode) + } +} + +func TestInvalidFiles(t *testing.T) { + const size = 1024 * 70 // 70kb + b := make([]byte, size) + + // zeroes + _, err := NewReader(bytes.NewReader(b), size) + if err != ErrFormat { + t.Errorf("zeroes: error=%v, want %v", err, ErrFormat) + } + + // repeated directoryEndSignatures + sig := make([]byte, 4) + binary.LittleEndian.PutUint32(sig, directoryEndSignature) + for i := 0; i < size-4; i += 4 { + copy(b[i:i+4], sig) + } + _, err = NewReader(bytes.NewReader(b), size) + if err != ErrFormat { + t.Errorf("sigs: error=%v, want %v", err, ErrFormat) + } +} + +func messWith(fileName string, corrupter func(b []byte)) (r io.ReaderAt, size int64) { + data, err := ioutil.ReadFile(filepath.Join("testdata", fileName)) + if err != nil { + panic("Error reading " + fileName + ": " + err.Error()) + } + corrupter(data) + return bytes.NewReader(data), int64(len(data)) +} + +func returnCorruptCRC32Zip() (r io.ReaderAt, size int64) { + return messWith("go-with-datadesc-sig.zip", func(b []byte) { + // Corrupt one of the CRC32s in the data descriptor: + b[0x2d]++ + }) +} + +func returnCorruptNotStreamedZip() (r io.ReaderAt, size int64) { + return messWith("crc32-not-streamed.zip", func(b []byte) { + // Corrupt foo.txt's final crc32 byte, in both + // the file header and TOC. (0x7e -> 0x7f) + b[0x11]++ + b[0x9d]++ + + // TODO(bradfitz): add a new test that only corrupts + // one of these values, and verify that that's also an + // error. Currently, the reader code doesn't verify the + // fileheader and TOC's crc32 match if they're both + // non-zero and only the second line above, the TOC, + // is what matters. + }) +} + +// rZipBytes returns the bytes of a recursive zip file, without +// putting it on disk and triggering certain virus scanners. +func rZipBytes() []byte { + s := ` +0000000 50 4b 03 04 14 00 00 00 08 00 08 03 64 3c f9 f4 +0000010 89 64 48 01 00 00 b8 01 00 00 07 00 00 00 72 2f +0000020 72 2e 7a 69 70 00 25 00 da ff 50 4b 03 04 14 00 +0000030 00 00 08 00 08 03 64 3c f9 f4 89 64 48 01 00 00 +0000040 b8 01 00 00 07 00 00 00 72 2f 72 2e 7a 69 70 00 +0000050 2f 00 d0 ff 00 25 00 da ff 50 4b 03 04 14 00 00 +0000060 00 08 00 08 03 64 3c f9 f4 89 64 48 01 00 00 b8 +0000070 01 00 00 07 00 00 00 72 2f 72 2e 7a 69 70 00 2f +0000080 00 d0 ff c2 54 8e 57 39 00 05 00 fa ff c2 54 8e +0000090 57 39 00 05 00 fa ff 00 05 00 fa ff 00 14 00 eb +00000a0 ff c2 54 8e 57 39 00 05 00 fa ff 00 05 00 fa ff +00000b0 00 14 00 eb ff 42 88 21 c4 00 00 14 00 eb ff 42 +00000c0 88 21 c4 00 00 14 00 eb ff 42 88 21 c4 00 00 14 +00000d0 00 eb ff 42 88 21 c4 00 00 14 00 eb ff 42 88 21 +00000e0 c4 00 00 00 00 ff ff 00 00 00 ff ff 00 34 00 cb +00000f0 ff 42 88 21 c4 00 00 00 00 ff ff 00 00 00 ff ff +0000100 00 34 00 cb ff 42 e8 21 5e 0f 00 00 00 ff ff 0a +0000110 f0 66 64 12 61 c0 15 dc e8 a0 48 bf 48 af 2a b3 +0000120 20 c0 9b 95 0d c4 67 04 42 53 06 06 06 40 00 06 +0000130 00 f9 ff 6d 01 00 00 00 00 42 e8 21 5e 0f 00 00 +0000140 00 ff ff 0a f0 66 64 12 61 c0 15 dc e8 a0 48 bf +0000150 48 af 2a b3 20 c0 9b 95 0d c4 67 04 42 53 06 06 +0000160 06 40 00 06 00 f9 ff 6d 01 00 00 00 00 50 4b 01 +0000170 02 14 00 14 00 00 00 08 00 08 03 64 3c f9 f4 89 +0000180 64 48 01 00 00 b8 01 00 00 07 00 00 00 00 00 00 +0000190 00 00 00 00 00 00 00 00 00 00 00 72 2f 72 2e 7a +00001a0 69 70 50 4b 05 06 00 00 00 00 01 00 01 00 35 00 +00001b0 00 00 6d 01 00 00 00 00` + s = regexp.MustCompile(`[0-9a-f]{7}`).ReplaceAllString(s, "") + s = regexp.MustCompile(`\s+`).ReplaceAllString(s, "") + b, err := hex.DecodeString(s) + if err != nil { + panic(err) + } + return b +} + +func returnRecursiveZip() (r io.ReaderAt, size int64) { + b := rZipBytes() + return bytes.NewReader(b), int64(len(b)) +} + +func TestIssue8186(t *testing.T) { + // Directory headers & data found in the TOC of a JAR file. + dirEnts := []string{ + "PK\x01\x02\n\x00\n\x00\x00\b\x00\x004\x9d3?\xaa\x1b\x06\xf0\x81\x02\x00\x00\x81\x02\x00\x00-\x00\x05\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00res/drawable-xhdpi-v4/ic_actionbar_accept.png\xfe\xca\x00\x00\x00", + "PK\x01\x02\n\x00\n\x00\x00\b\x00\x004\x9d3?\x90K\x89\xc7t\n\x00\x00t\n\x00\x00\x0e\x00\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xd1\x02\x00\x00resources.arsc\x00\x00\x00", + "PK\x01\x02\x14\x00\x14\x00\b\b\b\x004\x9d3?\xff$\x18\xed3\x03\x00\x00\xb4\b\x00\x00\x13\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00t\r\x00\x00AndroidManifest.xml", + "PK\x01\x02\x14\x00\x14\x00\b\b\b\x004\x9d3?\x14\xc5K\xab\x192\x02\x00\xc8\xcd\x04\x00\v\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xe8\x10\x00\x00classes.dex", + "PK\x01\x02\x14\x00\x14\x00\b\b\b\x004\x9d3?E\x96\nD\xac\x01\x00\x00P\x03\x00\x00&\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00:C\x02\x00res/layout/actionbar_set_wallpaper.xml", + "PK\x01\x02\x14\x00\x14\x00\b\b\b\x004\x9d3?Ļ\x14\xe3\xd8\x01\x00\x00\xd8\x03\x00\x00 \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00:E\x02\x00res/layout/wallpaper_cropper.xml", + "PK\x01\x02\x14\x00\x14\x00\b\b\b\x004\x9d3?}\xc1\x15\x9eZ\x01\x00\x00!\x02\x00\x00\x14\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00`G\x02\x00META-INF/MANIFEST.MF", + "PK\x01\x02\x14\x00\x14\x00\b\b\b\x004\x9d3?\xe6\x98Ьo\x01\x00\x00\x84\x02\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xfcH\x02\x00META-INF/CERT.SF", + "PK\x01\x02\x14\x00\x14\x00\b\b\b\x004\x9d3?\xbfP\x96b\x86\x04\x00\x00\xb2\x06\x00\x00\x11\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xa9J\x02\x00META-INF/CERT.RSA", + } + for i, s := range dirEnts { + var f File + err := readDirectoryHeader(&f, strings.NewReader(s)) + if err != nil { + t.Errorf("error reading #%d: %v", i, err) + } + } +} + +// Verify we return ErrUnexpectedEOF when length is short. +func TestIssue10957(t *testing.T) { + data := []byte("PK\x03\x040000000PK\x01\x0200000" + + "0000000000000000000\x00" + + "\x00\x00\x00\x00\x00000000000000PK\x01" + + "\x020000000000000000000" + + "00000\v\x00\x00\x00\x00\x00000000000" + + "00000000000000PK\x01\x0200" + + "00000000000000000000" + + "00\v\x00\x00\x00\x00\x00000000000000" + + "00000000000PK\x01\x020000<" + + "0\x00\x0000000000000000\v\x00\v" + + "\x00\x00\x00\x00\x0000000000\x00\x00\x00\x00000" + + "00000000PK\x01\x0200000000" + + "0000000000000000\v\x00\x00\x00" + + "\x00\x0000PK\x05\x06000000\x05\x000000" + + "\v\x00\x00\x00\x00\x00") + z, err := NewReader(bytes.NewReader(data), int64(len(data))) + if err != nil { + t.Fatal(err) + } + for i, f := range z.File { + r, err := f.Open() + if err != nil { + continue + } + if f.UncompressedSize64 < 1e6 { + n, err := io.Copy(ioutil.Discard, r) + if i == 3 && err != io.ErrUnexpectedEOF { + t.Errorf("File[3] error = %v; want io.ErrUnexpectedEOF", err) + } + if err == nil && uint64(n) != f.UncompressedSize64 { + t.Errorf("file %d: bad size: copied=%d; want=%d", i, n, f.UncompressedSize64) + } + } + r.Close() + } +} + +// Verify the number of files is sane. +func TestIssue10956(t *testing.T) { + data := []byte("PK\x06\x06PK\x06\a0000\x00\x00\x00\x00\x00\x00\x00\x00" + + "0000PK\x05\x06000000000000" + + "0000\v\x00000\x00\x00\x00\x00\x00\x00\x000") + _, err := NewReader(bytes.NewReader(data), int64(len(data))) + const want = "TOC declares impossible 3472328296227680304 files in 57 byte" + if err == nil && !strings.Contains(err.Error(), want) { + t.Errorf("error = %v; want %q", err, want) + } +} + +// Verify we return ErrUnexpectedEOF when reading truncated data descriptor. +func TestIssue11146(t *testing.T) { + data := []byte("PK\x03\x040000000000000000" + + "000000\x01\x00\x00\x000\x01\x00\x00\xff\xff0000" + + "0000000000000000PK\x01\x02" + + "0000\b0\b\x00000000000000" + + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x000000PK\x05\x06\x00\x00" + + "\x00\x0000\x01\x0000008\x00\x00\x00\x00\x00") + z, err := NewReader(bytes.NewReader(data), int64(len(data))) + if err != nil { + t.Fatal(err) + } + r, err := z.File[0].Open() + if err != nil { + t.Fatal(err) + } + _, err = ioutil.ReadAll(r) + if err != io.ErrUnexpectedEOF { + t.Errorf("File[0] error = %v; want io.ErrUnexpectedEOF", err) + } + r.Close() +} diff --git a/src/archive/zip/register.go b/src/archive/zip/register.go new file mode 100644 index 0000000000000000000000000000000000000000..4211ec7af7ba8ee56c5dcd194959230c5a000e07 --- /dev/null +++ b/src/archive/zip/register.go @@ -0,0 +1,110 @@ +// Copyright 2010 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package zip + +import ( + "compress/flate" + "errors" + "io" + "io/ioutil" + "sync" +) + +// A Compressor returns a compressing writer, writing to the +// provided writer. On Close, any pending data should be flushed. +type Compressor func(io.Writer) (io.WriteCloser, error) + +// Decompressor is a function that wraps a Reader with a decompressing Reader. +// The decompressed ReadCloser is returned to callers who open files from +// within the archive. These callers are responsible for closing this reader +// when they're finished reading. +type Decompressor func(io.Reader) io.ReadCloser + +var flateWriterPool sync.Pool + +func newFlateWriter(w io.Writer) io.WriteCloser { + fw, ok := flateWriterPool.Get().(*flate.Writer) + if ok { + fw.Reset(w) + } else { + fw, _ = flate.NewWriter(w, 5) + } + return &pooledFlateWriter{fw: fw} +} + +type pooledFlateWriter struct { + mu sync.Mutex // guards Close and Write + fw *flate.Writer +} + +func (w *pooledFlateWriter) Write(p []byte) (n int, err error) { + w.mu.Lock() + defer w.mu.Unlock() + if w.fw == nil { + return 0, errors.New("Write after Close") + } + return w.fw.Write(p) +} + +func (w *pooledFlateWriter) Close() error { + w.mu.Lock() + defer w.mu.Unlock() + var err error + if w.fw != nil { + err = w.fw.Close() + flateWriterPool.Put(w.fw) + w.fw = nil + } + return err +} + +var ( + mu sync.RWMutex // guards compressor and decompressor maps + + compressors = map[uint16]Compressor{ + Store: func(w io.Writer) (io.WriteCloser, error) { return &nopCloser{w}, nil }, + Deflate: func(w io.Writer) (io.WriteCloser, error) { return newFlateWriter(w), nil }, + } + + decompressors = map[uint16]Decompressor{ + Store: ioutil.NopCloser, + Deflate: flate.NewReader, + } +) + +// RegisterDecompressor allows custom decompressors for a specified method ID. +func RegisterDecompressor(method uint16, d Decompressor) { + mu.Lock() + defer mu.Unlock() + + if _, ok := decompressors[method]; ok { + panic("decompressor already registered") + } + decompressors[method] = d +} + +// RegisterCompressor registers custom compressors for a specified method ID. +// The common methods Store and Deflate are built in. +func RegisterCompressor(method uint16, comp Compressor) { + mu.Lock() + defer mu.Unlock() + + if _, ok := compressors[method]; ok { + panic("compressor already registered") + } + compressors[method] = comp +} + +func compressor(method uint16) Compressor { + mu.RLock() + defer mu.RUnlock() + return compressors[method] +} + +func decompressor(method uint16) Decompressor { + mu.RLock() + defer mu.RUnlock() + return decompressors[method] +} diff --git a/src/archive/zip/struct.go b/src/archive/zip/struct.go new file mode 100644 index 0000000000000000000000000000000000000000..137d0495fd993439b32cc151a67be54017cb6270 --- /dev/null +++ b/src/archive/zip/struct.go @@ -0,0 +1,313 @@ +// Copyright 2010 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +/* +Package zip provides support for reading and writing ZIP archives. + +See: http://www.pkware.com/documents/casestudies/APPNOTE.TXT + +This package does not support disk spanning. + +A note about ZIP64: + +To be backwards compatible the FileHeader has both 32 and 64 bit Size +fields. The 64 bit fields will always contain the correct value and +for normal archives both fields will be the same. For files requiring +the ZIP64 format the 32 bit fields will be 0xffffffff and the 64 bit +fields must be used instead. +*/ +package zip + +import ( + "os" + "path" + "time" +) + +// Compression methods. +const ( + Store uint16 = 0 + Deflate uint16 = 8 +) + +const ( + fileHeaderSignature = 0x04034b50 + directoryHeaderSignature = 0x02014b50 + directoryEndSignature = 0x06054b50 + directory64LocSignature = 0x07064b50 + directory64EndSignature = 0x06064b50 + dataDescriptorSignature = 0x08074b50 // de-facto standard; required by OS X Finder + fileHeaderLen = 30 // + filename + extra + directoryHeaderLen = 46 // + filename + extra + comment + directoryEndLen = 22 // + comment + dataDescriptorLen = 16 // four uint32: descriptor signature, crc32, compressed size, size + dataDescriptor64Len = 24 // descriptor with 8 byte sizes + directory64LocLen = 20 // + directory64EndLen = 56 // + extra + + // Constants for the first byte in CreatorVersion + creatorFAT = 0 + creatorUnix = 3 + creatorNTFS = 11 + creatorVFAT = 14 + creatorMacOSX = 19 + + // version numbers + zipVersion20 = 20 // 2.0 + zipVersion45 = 45 // 4.5 (reads and writes zip64 archives) + + // limits for non zip64 files + uint16max = (1 << 16) - 1 + uint32max = (1 << 32) - 1 + + // extra header id's + zip64ExtraId = 0x0001 // zip64 Extended Information Extra Field +) + +// FileHeader describes a file within a zip file. +// See the zip spec for details. +type FileHeader struct { + // Name is the name of the file. + // It must be a relative path: it must not start with a drive + // letter (e.g. C:) or leading slash, and only forward slashes + // are allowed. + Name string + + CreatorVersion uint16 + ReaderVersion uint16 + Flags uint16 + Method uint16 + ModifiedTime uint16 // MS-DOS time + ModifiedDate uint16 // MS-DOS date + CRC32 uint32 + CompressedSize uint32 // Deprecated: Use CompressedSize64 instead. + UncompressedSize uint32 // Deprecated: Use UncompressedSize64 instead. + CompressedSize64 uint64 + UncompressedSize64 uint64 + Extra []byte + ExternalAttrs uint32 // Meaning depends on CreatorVersion + Comment string +} + +// FileInfo returns an os.FileInfo for the FileHeader. +func (h *FileHeader) FileInfo() os.FileInfo { + return headerFileInfo{h} +} + +// headerFileInfo implements os.FileInfo. +type headerFileInfo struct { + fh *FileHeader +} + +func (fi headerFileInfo) Name() string { return path.Base(fi.fh.Name) } +func (fi headerFileInfo) Size() int64 { + if fi.fh.UncompressedSize64 > 0 { + return int64(fi.fh.UncompressedSize64) + } + return int64(fi.fh.UncompressedSize) +} +func (fi headerFileInfo) IsDir() bool { return fi.Mode().IsDir() } +func (fi headerFileInfo) ModTime() time.Time { return fi.fh.ModTime() } +func (fi headerFileInfo) Mode() os.FileMode { return fi.fh.Mode() } +func (fi headerFileInfo) Sys() interface{} { return fi.fh } + +// FileInfoHeader creates a partially-populated FileHeader from an +// os.FileInfo. +// Because os.FileInfo's Name method returns only the base name of +// the file it describes, it may be necessary to modify the Name field +// of the returned header to provide the full path name of the file. +func FileInfoHeader(fi os.FileInfo) (*FileHeader, error) { + size := fi.Size() + fh := &FileHeader{ + Name: fi.Name(), + UncompressedSize64: uint64(size), + } + fh.SetModTime(fi.ModTime()) + fh.SetMode(fi.Mode()) + if fh.UncompressedSize64 > uint32max { + fh.UncompressedSize = uint32max + } else { + fh.UncompressedSize = uint32(fh.UncompressedSize64) + } + return fh, nil +} + +type directoryEnd struct { + diskNbr uint32 // unused + dirDiskNbr uint32 // unused + dirRecordsThisDisk uint64 // unused + directoryRecords uint64 + directorySize uint64 + directoryOffset uint64 // relative to file + commentLen uint16 + comment string +} + +// msDosTimeToTime converts an MS-DOS date and time into a time.Time. +// The resolution is 2s. +// See: http://msdn.microsoft.com/en-us/library/ms724247(v=VS.85).aspx +func msDosTimeToTime(dosDate, dosTime uint16) time.Time { + return time.Date( + // date bits 0-4: day of month; 5-8: month; 9-15: years since 1980 + int(dosDate>>9+1980), + time.Month(dosDate>>5&0xf), + int(dosDate&0x1f), + + // time bits 0-4: second/2; 5-10: minute; 11-15: hour + int(dosTime>>11), + int(dosTime>>5&0x3f), + int(dosTime&0x1f*2), + 0, // nanoseconds + + time.UTC, + ) +} + +// timeToMsDosTime converts a time.Time to an MS-DOS date and time. +// The resolution is 2s. +// See: http://msdn.microsoft.com/en-us/library/ms724274(v=VS.85).aspx +func timeToMsDosTime(t time.Time) (fDate uint16, fTime uint16) { + t = t.In(time.UTC) + fDate = uint16(t.Day() + int(t.Month())<<5 + (t.Year()-1980)<<9) + fTime = uint16(t.Second()/2 + t.Minute()<<5 + t.Hour()<<11) + return +} + +// ModTime returns the modification time in UTC. +// The resolution is 2s. +func (h *FileHeader) ModTime() time.Time { + return msDosTimeToTime(h.ModifiedDate, h.ModifiedTime) +} + +// SetModTime sets the ModifiedTime and ModifiedDate fields to the given time in UTC. +// The resolution is 2s. +func (h *FileHeader) SetModTime(t time.Time) { + h.ModifiedDate, h.ModifiedTime = timeToMsDosTime(t) +} + +const ( + // Unix constants. The specification doesn't mention them, + // but these seem to be the values agreed on by tools. + s_IFMT = 0xf000 + s_IFSOCK = 0xc000 + s_IFLNK = 0xa000 + s_IFREG = 0x8000 + s_IFBLK = 0x6000 + s_IFDIR = 0x4000 + s_IFCHR = 0x2000 + s_IFIFO = 0x1000 + s_ISUID = 0x800 + s_ISGID = 0x400 + s_ISVTX = 0x200 + + msdosDir = 0x10 + msdosReadOnly = 0x01 +) + +// Mode returns the permission and mode bits for the FileHeader. +func (h *FileHeader) Mode() (mode os.FileMode) { + switch h.CreatorVersion >> 8 { + case creatorUnix, creatorMacOSX: + mode = unixModeToFileMode(h.ExternalAttrs >> 16) + case creatorNTFS, creatorVFAT, creatorFAT: + mode = msdosModeToFileMode(h.ExternalAttrs) + } + if len(h.Name) > 0 && h.Name[len(h.Name)-1] == '/' { + mode |= os.ModeDir + } + return mode +} + +// SetMode changes the permission and mode bits for the FileHeader. +func (h *FileHeader) SetMode(mode os.FileMode) { + h.CreatorVersion = h.CreatorVersion&0xff | creatorUnix<<8 + h.ExternalAttrs = fileModeToUnixMode(mode) << 16 + + // set MSDOS attributes too, as the original zip does. + if mode&os.ModeDir != 0 { + h.ExternalAttrs |= msdosDir + } + if mode&0200 == 0 { + h.ExternalAttrs |= msdosReadOnly + } +} + +// isZip64 reports whether the file size exceeds the 32 bit limit +func (fh *FileHeader) isZip64() bool { + return fh.CompressedSize64 > uint32max || fh.UncompressedSize64 > uint32max +} + +func msdosModeToFileMode(m uint32) (mode os.FileMode) { + if m&msdosDir != 0 { + mode = os.ModeDir | 0777 + } else { + mode = 0666 + } + if m&msdosReadOnly != 0 { + mode &^= 0222 + } + return mode +} + +func fileModeToUnixMode(mode os.FileMode) uint32 { + var m uint32 + switch mode & os.ModeType { + default: + m = s_IFREG + case os.ModeDir: + m = s_IFDIR + case os.ModeSymlink: + m = s_IFLNK + case os.ModeNamedPipe: + m = s_IFIFO + case os.ModeSocket: + m = s_IFSOCK + case os.ModeDevice: + if mode&os.ModeCharDevice != 0 { + m = s_IFCHR + } else { + m = s_IFBLK + } + } + if mode&os.ModeSetuid != 0 { + m |= s_ISUID + } + if mode&os.ModeSetgid != 0 { + m |= s_ISGID + } + if mode&os.ModeSticky != 0 { + m |= s_ISVTX + } + return m | uint32(mode&0777) +} + +func unixModeToFileMode(m uint32) os.FileMode { + mode := os.FileMode(m & 0777) + switch m & s_IFMT { + case s_IFBLK: + mode |= os.ModeDevice + case s_IFCHR: + mode |= os.ModeDevice | os.ModeCharDevice + case s_IFDIR: + mode |= os.ModeDir + case s_IFIFO: + mode |= os.ModeNamedPipe + case s_IFLNK: + mode |= os.ModeSymlink + case s_IFREG: + // nothing to do + case s_IFSOCK: + mode |= os.ModeSocket + } + if m&s_ISGID != 0 { + mode |= os.ModeSetgid + } + if m&s_ISUID != 0 { + mode |= os.ModeSetuid + } + if m&s_ISVTX != 0 { + mode |= os.ModeSticky + } + return mode +} diff --git a/src/archive/zip/testdata/crc32-not-streamed.zip b/src/archive/zip/testdata/crc32-not-streamed.zip new file mode 100644 index 0000000000000000000000000000000000000000..f268d88732f837723525285c0922231d9c3fcb46 Binary files /dev/null and b/src/archive/zip/testdata/crc32-not-streamed.zip differ diff --git a/src/archive/zip/testdata/dd.zip b/src/archive/zip/testdata/dd.zip new file mode 100644 index 0000000000000000000000000000000000000000..e53378b0b0e56203a08c139b83c67a9b918c0b81 Binary files /dev/null and b/src/archive/zip/testdata/dd.zip differ diff --git a/src/archive/zip/testdata/go-no-datadesc-sig.zip b/src/archive/zip/testdata/go-no-datadesc-sig.zip new file mode 100644 index 0000000000000000000000000000000000000000..c3d593f44f988ab96b59549096903a5c7f7a10d2 Binary files /dev/null and b/src/archive/zip/testdata/go-no-datadesc-sig.zip differ diff --git a/src/archive/zip/testdata/go-with-datadesc-sig.zip b/src/archive/zip/testdata/go-with-datadesc-sig.zip new file mode 100644 index 0000000000000000000000000000000000000000..bcfe121bb63c79be6849ca64589feea612015512 Binary files /dev/null and b/src/archive/zip/testdata/go-with-datadesc-sig.zip differ diff --git a/src/archive/zip/testdata/gophercolor16x16.png b/src/archive/zip/testdata/gophercolor16x16.png new file mode 100644 index 0000000000000000000000000000000000000000..48854ff3b7225c8b4e8aa8a25754e1d0b7c77b6e Binary files /dev/null and b/src/archive/zip/testdata/gophercolor16x16.png differ diff --git a/src/archive/zip/testdata/readme.notzip b/src/archive/zip/testdata/readme.notzip new file mode 100644 index 0000000000000000000000000000000000000000..81737275c6ebf5ea69b992753ab4050f031f31b8 Binary files /dev/null and b/src/archive/zip/testdata/readme.notzip differ diff --git a/src/archive/zip/testdata/readme.zip b/src/archive/zip/testdata/readme.zip new file mode 100644 index 0000000000000000000000000000000000000000..5642a67e77d5f5a45c92ea701801ae0b993f4724 Binary files /dev/null and b/src/archive/zip/testdata/readme.zip differ diff --git a/src/archive/zip/testdata/symlink.zip b/src/archive/zip/testdata/symlink.zip new file mode 100644 index 0000000000000000000000000000000000000000..af846938cde293ccc3dfb310fdfbda641382dd3f Binary files /dev/null and b/src/archive/zip/testdata/symlink.zip differ diff --git a/src/archive/zip/testdata/test-trailing-junk.zip b/src/archive/zip/testdata/test-trailing-junk.zip new file mode 100644 index 0000000000000000000000000000000000000000..42281b4e3053eec7924b58d234d04e492c3baa38 Binary files /dev/null and b/src/archive/zip/testdata/test-trailing-junk.zip differ diff --git a/src/archive/zip/testdata/test.zip b/src/archive/zip/testdata/test.zip new file mode 100644 index 0000000000000000000000000000000000000000..03890c05d4c12196086a99b7f6f51276156b4394 Binary files /dev/null and b/src/archive/zip/testdata/test.zip differ diff --git a/src/archive/zip/testdata/unix.zip b/src/archive/zip/testdata/unix.zip new file mode 100644 index 0000000000000000000000000000000000000000..ce1a981b2806d7e7a4026383622bf033aac426a4 Binary files /dev/null and b/src/archive/zip/testdata/unix.zip differ diff --git a/src/archive/zip/testdata/winxp.zip b/src/archive/zip/testdata/winxp.zip new file mode 100644 index 0000000000000000000000000000000000000000..3919322f0c5f8be8f1a214af712b6e86b4d04aef Binary files /dev/null and b/src/archive/zip/testdata/winxp.zip differ diff --git a/src/archive/zip/testdata/zip64-2.zip b/src/archive/zip/testdata/zip64-2.zip new file mode 100644 index 0000000000000000000000000000000000000000..f844e35373e8a28289f8556032bc8d6f6ee92ec2 Binary files /dev/null and b/src/archive/zip/testdata/zip64-2.zip differ diff --git a/src/archive/zip/testdata/zip64.zip b/src/archive/zip/testdata/zip64.zip new file mode 100644 index 0000000000000000000000000000000000000000..a2ee1fa33dca48e1ec8dfc7507640bfa09bddeb6 Binary files /dev/null and b/src/archive/zip/testdata/zip64.zip differ diff --git a/src/archive/zip/writer.go b/src/archive/zip/writer.go new file mode 100644 index 0000000000000000000000000000000000000000..3be2b5fdb2f29417c0e9b384407fc56cad6bdc3e --- /dev/null +++ b/src/archive/zip/writer.go @@ -0,0 +1,374 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package zip + +import ( + "bufio" + "encoding/binary" + "errors" + "hash" + "hash/crc32" + "io" +) + +// TODO(adg): support zip file comments +// TODO(adg): support specifying deflate level + +// Writer implements a zip file writer. +type Writer struct { + cw *countWriter + dir []*header + last *fileWriter + closed bool +} + +type header struct { + *FileHeader + offset uint64 +} + +// NewWriter returns a new Writer writing a zip file to w. +func NewWriter(w io.Writer) *Writer { + return &Writer{cw: &countWriter{w: bufio.NewWriter(w)}} +} + +// SetOffset sets the offset of the beginning of the zip data within the +// underlying writer. It should be used when the zip data is appended to an +// existing file, such as a binary executable. +// It must be called before any data is written. +func (w *Writer) SetOffset(n int64) { + if w.cw.count != 0 { + panic("zip: SetOffset called after data was written") + } + w.cw.count = n +} + +// Flush flushes any buffered data to the underlying writer. +// Calling Flush is not normally necessary; calling Close is sufficient. +func (w *Writer) Flush() error { + return w.cw.w.(*bufio.Writer).Flush() +} + +// Close finishes writing the zip file by writing the central directory. +// It does not (and can not) close the underlying writer. +func (w *Writer) Close() error { + if w.last != nil && !w.last.closed { + if err := w.last.close(); err != nil { + return err + } + w.last = nil + } + if w.closed { + return errors.New("zip: writer closed twice") + } + w.closed = true + + // write central directory + start := w.cw.count + for _, h := range w.dir { + var buf [directoryHeaderLen]byte + b := writeBuf(buf[:]) + b.uint32(uint32(directoryHeaderSignature)) + b.uint16(h.CreatorVersion) + b.uint16(h.ReaderVersion) + b.uint16(h.Flags) + b.uint16(h.Method) + b.uint16(h.ModifiedTime) + b.uint16(h.ModifiedDate) + b.uint32(h.CRC32) + if h.isZip64() || h.offset > uint32max { + // the file needs a zip64 header. store maxint in both + // 32 bit size fields (and offset later) to signal that the + // zip64 extra header should be used. + b.uint32(uint32max) // compressed size + b.uint32(uint32max) // uncompressed size + + // append a zip64 extra block to Extra + var buf [28]byte // 2x uint16 + 3x uint64 + eb := writeBuf(buf[:]) + eb.uint16(zip64ExtraId) + eb.uint16(24) // size = 3x uint64 + eb.uint64(h.UncompressedSize64) + eb.uint64(h.CompressedSize64) + eb.uint64(h.offset) + h.Extra = append(h.Extra, buf[:]...) + } else { + b.uint32(h.CompressedSize) + b.uint32(h.UncompressedSize) + } + b.uint16(uint16(len(h.Name))) + b.uint16(uint16(len(h.Extra))) + b.uint16(uint16(len(h.Comment))) + b = b[4:] // skip disk number start and internal file attr (2x uint16) + b.uint32(h.ExternalAttrs) + if h.offset > uint32max { + b.uint32(uint32max) + } else { + b.uint32(uint32(h.offset)) + } + if _, err := w.cw.Write(buf[:]); err != nil { + return err + } + if _, err := io.WriteString(w.cw, h.Name); err != nil { + return err + } + if _, err := w.cw.Write(h.Extra); err != nil { + return err + } + if _, err := io.WriteString(w.cw, h.Comment); err != nil { + return err + } + } + end := w.cw.count + + records := uint64(len(w.dir)) + size := uint64(end - start) + offset := uint64(start) + + if records > uint16max || size > uint32max || offset > uint32max { + var buf [directory64EndLen + directory64LocLen]byte + b := writeBuf(buf[:]) + + // zip64 end of central directory record + b.uint32(directory64EndSignature) + b.uint64(directory64EndLen - 12) // length minus signature (uint32) and length fields (uint64) + b.uint16(zipVersion45) // version made by + b.uint16(zipVersion45) // version needed to extract + b.uint32(0) // number of this disk + b.uint32(0) // number of the disk with the start of the central directory + b.uint64(records) // total number of entries in the central directory on this disk + b.uint64(records) // total number of entries in the central directory + b.uint64(size) // size of the central directory + b.uint64(offset) // offset of start of central directory with respect to the starting disk number + + // zip64 end of central directory locator + b.uint32(directory64LocSignature) + b.uint32(0) // number of the disk with the start of the zip64 end of central directory + b.uint64(uint64(end)) // relative offset of the zip64 end of central directory record + b.uint32(1) // total number of disks + + if _, err := w.cw.Write(buf[:]); err != nil { + return err + } + + // store max values in the regular end record to signal that + // that the zip64 values should be used instead + records = uint16max + size = uint32max + offset = uint32max + } + + // write end record + var buf [directoryEndLen]byte + b := writeBuf(buf[:]) + b.uint32(uint32(directoryEndSignature)) + b = b[4:] // skip over disk number and first disk number (2x uint16) + b.uint16(uint16(records)) // number of entries this disk + b.uint16(uint16(records)) // number of entries total + b.uint32(uint32(size)) // size of directory + b.uint32(uint32(offset)) // start of directory + // skipped size of comment (always zero) + if _, err := w.cw.Write(buf[:]); err != nil { + return err + } + + return w.cw.w.(*bufio.Writer).Flush() +} + +// Create adds a file to the zip file using the provided name. +// It returns a Writer to which the file contents should be written. +// The name must be a relative path: it must not start with a drive +// letter (e.g. C:) or leading slash, and only forward slashes are +// allowed. +// The file's contents must be written to the io.Writer before the next +// call to Create, CreateHeader, or Close. +func (w *Writer) Create(name string) (io.Writer, error) { + header := &FileHeader{ + Name: name, + Method: Deflate, + } + return w.CreateHeader(header) +} + +// CreateHeader adds a file to the zip file using the provided FileHeader +// for the file metadata. +// It returns a Writer to which the file contents should be written. +// +// The file's contents must be written to the io.Writer before the next +// call to Create, CreateHeader, or Close. The provided FileHeader fh +// must not be modified after a call to CreateHeader. +func (w *Writer) CreateHeader(fh *FileHeader) (io.Writer, error) { + if w.last != nil && !w.last.closed { + if err := w.last.close(); err != nil { + return nil, err + } + } + if len(w.dir) > 0 && w.dir[len(w.dir)-1].FileHeader == fh { + // See https://golang.org/issue/11144 confusion. + return nil, errors.New("archive/zip: invalid duplicate FileHeader") + } + + fh.Flags |= 0x8 // we will write a data descriptor + + fh.CreatorVersion = fh.CreatorVersion&0xff00 | zipVersion20 // preserve compatibility byte + fh.ReaderVersion = zipVersion20 + + fw := &fileWriter{ + zipw: w.cw, + compCount: &countWriter{w: w.cw}, + crc32: crc32.NewIEEE(), + } + comp := compressor(fh.Method) + if comp == nil { + return nil, ErrAlgorithm + } + var err error + fw.comp, err = comp(fw.compCount) + if err != nil { + return nil, err + } + fw.rawCount = &countWriter{w: fw.comp} + + h := &header{ + FileHeader: fh, + offset: uint64(w.cw.count), + } + w.dir = append(w.dir, h) + fw.header = h + + if err := writeHeader(w.cw, fh); err != nil { + return nil, err + } + + w.last = fw + return fw, nil +} + +func writeHeader(w io.Writer, h *FileHeader) error { + var buf [fileHeaderLen]byte + b := writeBuf(buf[:]) + b.uint32(uint32(fileHeaderSignature)) + b.uint16(h.ReaderVersion) + b.uint16(h.Flags) + b.uint16(h.Method) + b.uint16(h.ModifiedTime) + b.uint16(h.ModifiedDate) + b.uint32(0) // since we are writing a data descriptor crc32, + b.uint32(0) // compressed size, + b.uint32(0) // and uncompressed size should be zero + b.uint16(uint16(len(h.Name))) + b.uint16(uint16(len(h.Extra))) + if _, err := w.Write(buf[:]); err != nil { + return err + } + if _, err := io.WriteString(w, h.Name); err != nil { + return err + } + _, err := w.Write(h.Extra) + return err +} + +type fileWriter struct { + *header + zipw io.Writer + rawCount *countWriter + comp io.WriteCloser + compCount *countWriter + crc32 hash.Hash32 + closed bool +} + +func (w *fileWriter) Write(p []byte) (int, error) { + if w.closed { + return 0, errors.New("zip: write to closed file") + } + w.crc32.Write(p) + return w.rawCount.Write(p) +} + +func (w *fileWriter) close() error { + if w.closed { + return errors.New("zip: file closed twice") + } + w.closed = true + if err := w.comp.Close(); err != nil { + return err + } + + // update FileHeader + fh := w.header.FileHeader + fh.CRC32 = w.crc32.Sum32() + fh.CompressedSize64 = uint64(w.compCount.count) + fh.UncompressedSize64 = uint64(w.rawCount.count) + + if fh.isZip64() { + fh.CompressedSize = uint32max + fh.UncompressedSize = uint32max + fh.ReaderVersion = zipVersion45 // requires 4.5 - File uses ZIP64 format extensions + } else { + fh.CompressedSize = uint32(fh.CompressedSize64) + fh.UncompressedSize = uint32(fh.UncompressedSize64) + } + + // Write data descriptor. This is more complicated than one would + // think, see e.g. comments in zipfile.c:putextended() and + // http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7073588. + // The approach here is to write 8 byte sizes if needed without + // adding a zip64 extra in the local header (too late anyway). + var buf []byte + if fh.isZip64() { + buf = make([]byte, dataDescriptor64Len) + } else { + buf = make([]byte, dataDescriptorLen) + } + b := writeBuf(buf) + b.uint32(dataDescriptorSignature) // de-facto standard, required by OS X + b.uint32(fh.CRC32) + if fh.isZip64() { + b.uint64(fh.CompressedSize64) + b.uint64(fh.UncompressedSize64) + } else { + b.uint32(fh.CompressedSize) + b.uint32(fh.UncompressedSize) + } + _, err := w.zipw.Write(buf) + return err +} + +type countWriter struct { + w io.Writer + count int64 +} + +func (w *countWriter) Write(p []byte) (int, error) { + n, err := w.w.Write(p) + w.count += int64(n) + return n, err +} + +type nopCloser struct { + io.Writer +} + +func (w nopCloser) Close() error { + return nil +} + +type writeBuf []byte + +func (b *writeBuf) uint16(v uint16) { + binary.LittleEndian.PutUint16(*b, v) + *b = (*b)[2:] +} + +func (b *writeBuf) uint32(v uint32) { + binary.LittleEndian.PutUint32(*b, v) + *b = (*b)[4:] +} + +func (b *writeBuf) uint64(v uint64) { + binary.LittleEndian.PutUint64(*b, v) + *b = (*b)[8:] +} diff --git a/src/archive/zip/writer_test.go b/src/archive/zip/writer_test.go new file mode 100644 index 0000000000000000000000000000000000000000..01b63f2358d41c258baf08b1f5206b11f41dfcc9 --- /dev/null +++ b/src/archive/zip/writer_test.go @@ -0,0 +1,199 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package zip + +import ( + "bytes" + "io" + "io/ioutil" + "math/rand" + "os" + "testing" +) + +// TODO(adg): a more sophisticated test suite + +type WriteTest struct { + Name string + Data []byte + Method uint16 + Mode os.FileMode +} + +var writeTests = []WriteTest{ + { + Name: "foo", + Data: []byte("Rabbits, guinea pigs, gophers, marsupial rats, and quolls."), + Method: Store, + Mode: 0666, + }, + { + Name: "bar", + Data: nil, // large data set in the test + Method: Deflate, + Mode: 0644, + }, + { + Name: "setuid", + Data: []byte("setuid file"), + Method: Deflate, + Mode: 0755 | os.ModeSetuid, + }, + { + Name: "setgid", + Data: []byte("setgid file"), + Method: Deflate, + Mode: 0755 | os.ModeSetgid, + }, + { + Name: "symlink", + Data: []byte("../link/target"), + Method: Deflate, + Mode: 0755 | os.ModeSymlink, + }, +} + +func TestWriter(t *testing.T) { + largeData := make([]byte, 1<<17) + for i := range largeData { + largeData[i] = byte(rand.Int()) + } + writeTests[1].Data = largeData + defer func() { + writeTests[1].Data = nil + }() + + // write a zip file + buf := new(bytes.Buffer) + w := NewWriter(buf) + + for _, wt := range writeTests { + testCreate(t, w, &wt) + } + + if err := w.Close(); err != nil { + t.Fatal(err) + } + + // read it back + r, err := NewReader(bytes.NewReader(buf.Bytes()), int64(buf.Len())) + if err != nil { + t.Fatal(err) + } + for i, wt := range writeTests { + testReadFile(t, r.File[i], &wt) + } +} + +func TestWriterOffset(t *testing.T) { + largeData := make([]byte, 1<<17) + for i := range largeData { + largeData[i] = byte(rand.Int()) + } + writeTests[1].Data = largeData + defer func() { + writeTests[1].Data = nil + }() + + // write a zip file + buf := new(bytes.Buffer) + existingData := []byte{1, 2, 3, 1, 2, 3, 1, 2, 3} + n, _ := buf.Write(existingData) + w := NewWriter(buf) + w.SetOffset(int64(n)) + + for _, wt := range writeTests { + testCreate(t, w, &wt) + } + + if err := w.Close(); err != nil { + t.Fatal(err) + } + + // read it back + r, err := NewReader(bytes.NewReader(buf.Bytes()), int64(buf.Len())) + if err != nil { + t.Fatal(err) + } + for i, wt := range writeTests { + testReadFile(t, r.File[i], &wt) + } +} + +func TestWriterFlush(t *testing.T) { + var buf bytes.Buffer + w := NewWriter(struct{ io.Writer }{&buf}) + _, err := w.Create("foo") + if err != nil { + t.Fatal(err) + } + if buf.Len() > 0 { + t.Fatalf("Unexpected %d bytes already in buffer", buf.Len()) + } + if err := w.Flush(); err != nil { + t.Fatal(err) + } + if buf.Len() == 0 { + t.Fatal("No bytes written after Flush") + } +} + +func testCreate(t *testing.T, w *Writer, wt *WriteTest) { + header := &FileHeader{ + Name: wt.Name, + Method: wt.Method, + } + if wt.Mode != 0 { + header.SetMode(wt.Mode) + } + f, err := w.CreateHeader(header) + if err != nil { + t.Fatal(err) + } + _, err = f.Write(wt.Data) + if err != nil { + t.Fatal(err) + } +} + +func testReadFile(t *testing.T, f *File, wt *WriteTest) { + if f.Name != wt.Name { + t.Fatalf("File name: got %q, want %q", f.Name, wt.Name) + } + testFileMode(t, wt.Name, f, wt.Mode) + rc, err := f.Open() + if err != nil { + t.Fatal("opening:", err) + } + b, err := ioutil.ReadAll(rc) + if err != nil { + t.Fatal("reading:", err) + } + err = rc.Close() + if err != nil { + t.Fatal("closing:", err) + } + if !bytes.Equal(b, wt.Data) { + t.Errorf("File contents %q, want %q", b, wt.Data) + } +} + +func BenchmarkCompressedZipGarbage(b *testing.B) { + b.ReportAllocs() + var buf bytes.Buffer + bigBuf := bytes.Repeat([]byte("a"), 1<<20) + for i := 0; i < b.N; i++ { + buf.Reset() + zw := NewWriter(&buf) + for j := 0; j < 3; j++ { + w, _ := zw.CreateHeader(&FileHeader{ + Name: "foo", + Method: Deflate, + }) + w.Write(bigBuf) + } + zw.Close() + } +} diff --git a/src/archive/zip/zip_test.go b/src/archive/zip/zip_test.go new file mode 100644 index 0000000000000000000000000000000000000000..f00ff47d37ecb29d0fa89cb303a6a17f01cdb812 --- /dev/null +++ b/src/archive/zip/zip_test.go @@ -0,0 +1,427 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Tests that involve both reading and writing. + +package zip + +import ( + "bytes" + "fmt" + "hash" + "io" + "io/ioutil" + "sort" + "strings" + "testing" + "time" +) + +func TestOver65kFiles(t *testing.T) { + buf := new(bytes.Buffer) + w := NewWriter(buf) + const nFiles = (1 << 16) + 42 + for i := 0; i < nFiles; i++ { + _, err := w.CreateHeader(&FileHeader{ + Name: fmt.Sprintf("%d.dat", i), + Method: Store, // avoid Issue 6136 and Issue 6138 + }) + if err != nil { + t.Fatalf("creating file %d: %v", i, err) + } + } + if err := w.Close(); err != nil { + t.Fatalf("Writer.Close: %v", err) + } + s := buf.String() + zr, err := NewReader(strings.NewReader(s), int64(len(s))) + if err != nil { + t.Fatalf("NewReader: %v", err) + } + if got := len(zr.File); got != nFiles { + t.Fatalf("File contains %d files, want %d", got, nFiles) + } + for i := 0; i < nFiles; i++ { + want := fmt.Sprintf("%d.dat", i) + if zr.File[i].Name != want { + t.Fatalf("File(%d) = %q, want %q", i, zr.File[i].Name, want) + } + } +} + +func TestModTime(t *testing.T) { + var testTime = time.Date(2009, time.November, 10, 23, 45, 58, 0, time.UTC) + fh := new(FileHeader) + fh.SetModTime(testTime) + outTime := fh.ModTime() + if !outTime.Equal(testTime) { + t.Errorf("times don't match: got %s, want %s", outTime, testTime) + } +} + +func testHeaderRoundTrip(fh *FileHeader, wantUncompressedSize uint32, wantUncompressedSize64 uint64, t *testing.T) { + fi := fh.FileInfo() + fh2, err := FileInfoHeader(fi) + if err != nil { + t.Fatal(err) + } + if got, want := fh2.Name, fh.Name; got != want { + t.Errorf("Name: got %s, want %s\n", got, want) + } + if got, want := fh2.UncompressedSize, wantUncompressedSize; got != want { + t.Errorf("UncompressedSize: got %d, want %d\n", got, want) + } + if got, want := fh2.UncompressedSize64, wantUncompressedSize64; got != want { + t.Errorf("UncompressedSize64: got %d, want %d\n", got, want) + } + if got, want := fh2.ModifiedTime, fh.ModifiedTime; got != want { + t.Errorf("ModifiedTime: got %d, want %d\n", got, want) + } + if got, want := fh2.ModifiedDate, fh.ModifiedDate; got != want { + t.Errorf("ModifiedDate: got %d, want %d\n", got, want) + } + + if sysfh, ok := fi.Sys().(*FileHeader); !ok && sysfh != fh { + t.Errorf("Sys didn't return original *FileHeader") + } +} + +func TestFileHeaderRoundTrip(t *testing.T) { + fh := &FileHeader{ + Name: "foo.txt", + UncompressedSize: 987654321, + ModifiedTime: 1234, + ModifiedDate: 5678, + } + testHeaderRoundTrip(fh, fh.UncompressedSize, uint64(fh.UncompressedSize), t) +} + +func TestFileHeaderRoundTrip64(t *testing.T) { + fh := &FileHeader{ + Name: "foo.txt", + UncompressedSize64: 9876543210, + ModifiedTime: 1234, + ModifiedDate: 5678, + } + testHeaderRoundTrip(fh, uint32max, fh.UncompressedSize64, t) +} + +type repeatedByte struct { + off int64 + b byte + n int64 +} + +// rleBuffer is a run-length-encoded byte buffer. +// It's an io.Writer (like a bytes.Buffer) and also an io.ReaderAt, +// allowing random-access reads. +type rleBuffer struct { + buf []repeatedByte +} + +func (r *rleBuffer) Size() int64 { + if len(r.buf) == 0 { + return 0 + } + last := &r.buf[len(r.buf)-1] + return last.off + last.n +} + +func (r *rleBuffer) Write(p []byte) (n int, err error) { + var rp *repeatedByte + if len(r.buf) > 0 { + rp = &r.buf[len(r.buf)-1] + // Fast path, if p is entirely the same byte repeated. + if lastByte := rp.b; len(p) > 0 && p[0] == lastByte { + all := true + for _, b := range p { + if b != lastByte { + all = false + break + } + } + if all { + rp.n += int64(len(p)) + return len(p), nil + } + } + } + + for _, b := range p { + if rp == nil || rp.b != b { + r.buf = append(r.buf, repeatedByte{r.Size(), b, 1}) + rp = &r.buf[len(r.buf)-1] + } else { + rp.n++ + } + } + return len(p), nil +} + +func (r *rleBuffer) ReadAt(p []byte, off int64) (n int, err error) { + if len(p) == 0 { + return + } + skipParts := sort.Search(len(r.buf), func(i int) bool { + part := &r.buf[i] + return part.off+part.n > off + }) + parts := r.buf[skipParts:] + if len(parts) > 0 { + skipBytes := off - parts[0].off + for len(parts) > 0 { + part := parts[0] + for i := skipBytes; i < part.n; i++ { + if n == len(p) { + return + } + p[n] = part.b + n++ + } + parts = parts[1:] + skipBytes = 0 + } + } + if n != len(p) { + err = io.ErrUnexpectedEOF + } + return +} + +// Just testing the rleBuffer used in the Zip64 test above. Not used by the zip code. +func TestRLEBuffer(t *testing.T) { + b := new(rleBuffer) + var all []byte + writes := []string{"abcdeee", "eeeeeee", "eeeefghaaiii"} + for _, w := range writes { + b.Write([]byte(w)) + all = append(all, w...) + } + if len(b.buf) != 10 { + t.Fatalf("len(b.buf) = %d; want 10", len(b.buf)) + } + + for i := 0; i < len(all); i++ { + for j := 0; j < len(all)-i; j++ { + buf := make([]byte, j) + n, err := b.ReadAt(buf, int64(i)) + if err != nil || n != len(buf) { + t.Errorf("ReadAt(%d, %d) = %d, %v; want %d, nil", i, j, n, err, len(buf)) + } + if !bytes.Equal(buf, all[i:i+j]) { + t.Errorf("ReadAt(%d, %d) = %q; want %q", i, j, buf, all[i:i+j]) + } + } + } +} + +// fakeHash32 is a dummy Hash32 that always returns 0. +type fakeHash32 struct { + hash.Hash32 +} + +func (fakeHash32) Write(p []byte) (int, error) { return len(p), nil } +func (fakeHash32) Sum32() uint32 { return 0 } + +func TestZip64(t *testing.T) { + if testing.Short() { + t.Skip("slow test; skipping") + } + const size = 1 << 32 // before the "END\n" part + buf := testZip64(t, size) + testZip64DirectoryRecordLength(buf, t) +} + +func testZip64(t testing.TB, size int64) *rleBuffer { + const chunkSize = 1024 + chunks := int(size / chunkSize) + // write 2^32 bytes plus "END\n" to a zip file + buf := new(rleBuffer) + w := NewWriter(buf) + f, err := w.CreateHeader(&FileHeader{ + Name: "huge.txt", + Method: Store, + }) + if err != nil { + t.Fatal(err) + } + f.(*fileWriter).crc32 = fakeHash32{} + chunk := make([]byte, chunkSize) + for i := range chunk { + chunk[i] = '.' + } + for i := 0; i < chunks; i++ { + _, err := f.Write(chunk) + if err != nil { + t.Fatal("write chunk:", err) + } + } + end := []byte("END\n") + _, err = f.Write(end) + if err != nil { + t.Fatal("write end:", err) + } + if err := w.Close(); err != nil { + t.Fatal(err) + } + + // read back zip file and check that we get to the end of it + r, err := NewReader(buf, int64(buf.Size())) + if err != nil { + t.Fatal("reader:", err) + } + f0 := r.File[0] + rc, err := f0.Open() + if err != nil { + t.Fatal("opening:", err) + } + rc.(*checksumReader).hash = fakeHash32{} + for i := 0; i < chunks; i++ { + _, err := io.ReadFull(rc, chunk) + if err != nil { + t.Fatal("read:", err) + } + } + gotEnd, err := ioutil.ReadAll(rc) + if err != nil { + t.Fatal("read end:", err) + } + if !bytes.Equal(gotEnd, end) { + t.Errorf("End of zip64 archive %q, want %q", gotEnd, end) + } + err = rc.Close() + if err != nil { + t.Fatal("closing:", err) + } + if size == 1<<32 { + if got, want := f0.UncompressedSize, uint32(uint32max); got != want { + t.Errorf("UncompressedSize %d, want %d", got, want) + } + } + + if got, want := f0.UncompressedSize64, uint64(size)+uint64(len(end)); got != want { + t.Errorf("UncompressedSize64 %d, want %d", got, want) + } + + return buf +} + +// Issue 9857 +func testZip64DirectoryRecordLength(buf *rleBuffer, t *testing.T) { + d := make([]byte, 1024) + if _, err := buf.ReadAt(d, buf.Size()-int64(len(d))); err != nil { + t.Fatal("read:", err) + } + + sigOff := findSignatureInBlock(d) + dirOff, err := findDirectory64End(buf, buf.Size()-int64(len(d))+int64(sigOff)) + if err != nil { + t.Fatal("findDirectory64End:", err) + } + + d = make([]byte, directory64EndLen) + if _, err := buf.ReadAt(d, dirOff); err != nil { + t.Fatal("read:", err) + } + + b := readBuf(d) + if sig := b.uint32(); sig != directory64EndSignature { + t.Fatalf("Expected directory64EndSignature (%d), got %d", directory64EndSignature, sig) + } + + size := b.uint64() + if size != directory64EndLen-12 { + t.Fatalf("Expected length of %d, got %d", directory64EndLen-12, size) + } +} + +func testInvalidHeader(h *FileHeader, t *testing.T) { + var buf bytes.Buffer + z := NewWriter(&buf) + + f, err := z.CreateHeader(h) + if err != nil { + t.Fatalf("error creating header: %v", err) + } + if _, err := f.Write([]byte("hi")); err != nil { + t.Fatalf("error writing content: %v", err) + } + if err := z.Close(); err != nil { + t.Fatalf("error closing zip writer: %v", err) + } + + b := buf.Bytes() + if _, err = NewReader(bytes.NewReader(b), int64(len(b))); err != ErrFormat { + t.Fatalf("got %v, expected ErrFormat", err) + } +} + +func testValidHeader(h *FileHeader, t *testing.T) { + var buf bytes.Buffer + z := NewWriter(&buf) + + f, err := z.CreateHeader(h) + if err != nil { + t.Fatalf("error creating header: %v", err) + } + if _, err := f.Write([]byte("hi")); err != nil { + t.Fatalf("error writing content: %v", err) + } + if err := z.Close(); err != nil { + t.Fatalf("error closing zip writer: %v", err) + } + + b := buf.Bytes() + if _, err = NewReader(bytes.NewReader(b), int64(len(b))); err != nil { + t.Fatalf("got %v, expected nil", err) + } +} + +// Issue 4302. +func TestHeaderInvalidTagAndSize(t *testing.T) { + const timeFormat = "20060102T150405.000.txt" + + ts := time.Now() + filename := ts.Format(timeFormat) + + h := FileHeader{ + Name: filename, + Method: Deflate, + Extra: []byte(ts.Format(time.RFC3339Nano)), // missing tag and len + } + h.SetModTime(ts) + + testInvalidHeader(&h, t) +} + +func TestHeaderTooShort(t *testing.T) { + h := FileHeader{ + Name: "foo.txt", + Method: Deflate, + Extra: []byte{zip64ExtraId}, // missing size + } + testInvalidHeader(&h, t) +} + +// Issue 4393. It is valid to have an extra data header +// which contains no body. +func TestZeroLengthHeader(t *testing.T) { + h := FileHeader{ + Name: "extadata.txt", + Method: Deflate, + Extra: []byte{ + 85, 84, 5, 0, 3, 154, 144, 195, 77, // tag 21589 size 5 + 85, 120, 0, 0, // tag 30805 size 0 + }, + } + testValidHeader(&h, t) +} + +// Just benchmarking how fast the Zip64 test above is. Not related to +// our zip performance, since the test above disabled CRC32 and flate. +func BenchmarkZip64Test(b *testing.B) { + for i := 0; i < b.N; i++ { + testZip64(b, 1<<26) + } +} diff --git a/src/bootstrap.bash b/src/bootstrap.bash new file mode 100755 index 0000000000000000000000000000000000000000..1b5ba7c536cd63b3fba0763cbb973c3bf1ecc414 --- /dev/null +++ b/src/bootstrap.bash @@ -0,0 +1,73 @@ +#!/bin/bash +# Copyright 2015 The Go Authors. All rights reserved. +# Use of this source code is governed by a BSD-style +# license that can be found in the LICENSE file. + +# When run as (for example) +# +# GOOS=linux GOARCH=ppc64 bootstrap.bash +# +# this script cross-compiles a toolchain for that GOOS/GOARCH +# combination, leaving the resulting tree in ../../go-${GOOS}-${GOARCH}-bootstrap. +# That tree can be copied to a machine of the given target type +# and used as $GOROOT_BOOTSTRAP to bootstrap a local build. +# +# Only changes that have been committed to Git (at least locally, +# not necessary reviewed and submitted to master) are included in the tree. + +set -e + +if [ "$GOOS" = "" -o "$GOARCH" = "" ]; then + echo "usage: GOOS=os GOARCH=arch ./bootstrap.bash" >&2 + exit 2 +fi + +targ="../../go-${GOOS}-${GOARCH}-bootstrap" +if [ -e $targ ]; then + echo "$targ already exists; remove before continuing" + exit 2 +fi + +unset GOROOT +src=$(cd .. && pwd) +echo "#### Copying to $targ" +cp -R "$src" "$targ" +cd "$targ" +echo +echo "#### Cleaning $targ" +rm -f .gitignore +if [ -e .git ]; then + git clean -f -d +fi +echo +echo "#### Building $targ" +echo +cd src +./make.bash --no-banner +gohostos="$(../bin/go env GOHOSTOS)" +gohostarch="$(../bin/go env GOHOSTARCH)" +goos="$(../bin/go env GOOS)" +goarch="$(../bin/go env GOARCH)" + +# NOTE: Cannot invoke go command after this point. +# We're about to delete all but the cross-compiled binaries. +cd .. +if [ "$goos" = "$gohostos" -a "$goarch" = "$gohostarch" ]; then + # cross-compile for local system. nothing to copy. + # useful if you've bootstrapped yourself but want to + # prepare a clean toolchain for others. + true +else + mv bin/*_*/* bin + rmdir bin/*_* + rm -rf "pkg/${gohostos}_${gohostarch}" "pkg/tool/${gohostos}_${gohostarch}" +fi +rm -rf pkg/bootstrap pkg/obj .git + +echo ---- +echo Bootstrap toolchain for "$GOOS/$GOARCH" installed in "$(pwd)". +echo Building tbz. +cd .. +tar cf - "go-${GOOS}-${GOARCH}-bootstrap" | bzip2 -9 >"go-${GOOS}-${GOARCH}-bootstrap.tbz" +ls -l "$(pwd)/go-${GOOS}-${GOARCH}-bootstrap.tbz" +exit 0 diff --git a/src/bufio/bufio.go b/src/bufio/bufio.go new file mode 100644 index 0000000000000000000000000000000000000000..3bbb933df3569886ade4c370144d08ae63101c86 --- /dev/null +++ b/src/bufio/bufio.go @@ -0,0 +1,730 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package bufio implements buffered I/O. It wraps an io.Reader or io.Writer +// object, creating another object (Reader or Writer) that also implements +// the interface but provides buffering and some help for textual I/O. +package bufio + +import ( + "bytes" + "errors" + "io" + "unicode/utf8" +) + +const ( + defaultBufSize = 4096 +) + +var ( + ErrInvalidUnreadByte = errors.New("bufio: invalid use of UnreadByte") + ErrInvalidUnreadRune = errors.New("bufio: invalid use of UnreadRune") + ErrBufferFull = errors.New("bufio: buffer full") + ErrNegativeCount = errors.New("bufio: negative count") +) + +// Buffered input. + +// Reader implements buffering for an io.Reader object. +type Reader struct { + buf []byte + rd io.Reader // reader provided by the client + r, w int // buf read and write positions + err error + lastByte int + lastRuneSize int +} + +const minReadBufferSize = 16 +const maxConsecutiveEmptyReads = 100 + +// NewReaderSize returns a new Reader whose buffer has at least the specified +// size. If the argument io.Reader is already a Reader with large enough +// size, it returns the underlying Reader. +func NewReaderSize(rd io.Reader, size int) *Reader { + // Is it already a Reader? + b, ok := rd.(*Reader) + if ok && len(b.buf) >= size { + return b + } + if size < minReadBufferSize { + size = minReadBufferSize + } + r := new(Reader) + r.reset(make([]byte, size), rd) + return r +} + +// NewReader returns a new Reader whose buffer has the default size. +func NewReader(rd io.Reader) *Reader { + return NewReaderSize(rd, defaultBufSize) +} + +// Reset discards any buffered data, resets all state, and switches +// the buffered reader to read from r. +func (b *Reader) Reset(r io.Reader) { + b.reset(b.buf, r) +} + +func (b *Reader) reset(buf []byte, r io.Reader) { + *b = Reader{ + buf: buf, + rd: r, + lastByte: -1, + lastRuneSize: -1, + } +} + +var errNegativeRead = errors.New("bufio: reader returned negative count from Read") + +// fill reads a new chunk into the buffer. +func (b *Reader) fill() { + // Slide existing data to beginning. + if b.r > 0 { + copy(b.buf, b.buf[b.r:b.w]) + b.w -= b.r + b.r = 0 + } + + if b.w >= len(b.buf) { + panic("bufio: tried to fill full buffer") + } + + // Read new data: try a limited number of times. + for i := maxConsecutiveEmptyReads; i > 0; i-- { + n, err := b.rd.Read(b.buf[b.w:]) + if n < 0 { + panic(errNegativeRead) + } + b.w += n + if err != nil { + b.err = err + return + } + if n > 0 { + return + } + } + b.err = io.ErrNoProgress +} + +func (b *Reader) readErr() error { + err := b.err + b.err = nil + return err +} + +// Peek returns the next n bytes without advancing the reader. The bytes stop +// being valid at the next read call. If Peek returns fewer than n bytes, it +// also returns an error explaining why the read is short. The error is +// ErrBufferFull if n is larger than b's buffer size. +func (b *Reader) Peek(n int) ([]byte, error) { + if n < 0 { + return nil, ErrNegativeCount + } + if n > len(b.buf) { + return nil, ErrBufferFull + } + // 0 <= n <= len(b.buf) + for b.w-b.r < n && b.err == nil { + b.fill() // b.w-b.r < len(b.buf) => buffer is not full + } + + var err error + if avail := b.w - b.r; avail < n { + // not enough data in buffer + n = avail + err = b.readErr() + if err == nil { + err = ErrBufferFull + } + } + return b.buf[b.r : b.r+n], err +} + +// Discard skips the next n bytes, returning the number of bytes discarded. +// +// If Discard skips fewer than n bytes, it also returns an error. +// If 0 <= n <= b.Buffered(), Discard is guaranteed to succeed without +// reading from the underlying io.Reader. +func (b *Reader) Discard(n int) (discarded int, err error) { + if n < 0 { + return 0, ErrNegativeCount + } + if n == 0 { + return + } + remain := n + for { + skip := b.Buffered() + if skip == 0 { + b.fill() + skip = b.Buffered() + } + if skip > remain { + skip = remain + } + b.r += skip + remain -= skip + if remain == 0 { + return n, nil + } + if b.err != nil { + return n - remain, b.readErr() + } + } +} + +// Read reads data into p. +// It returns the number of bytes read into p. +// It calls Read at most once on the underlying Reader, +// hence n may be less than len(p). +// At EOF, the count will be zero and err will be io.EOF. +func (b *Reader) Read(p []byte) (n int, err error) { + n = len(p) + if n == 0 { + return 0, b.readErr() + } + if b.r == b.w { + if b.err != nil { + return 0, b.readErr() + } + if len(p) >= len(b.buf) { + // Large read, empty buffer. + // Read directly into p to avoid copy. + n, b.err = b.rd.Read(p) + if n < 0 { + panic(errNegativeRead) + } + if n > 0 { + b.lastByte = int(p[n-1]) + b.lastRuneSize = -1 + } + return n, b.readErr() + } + b.fill() // buffer is empty + if b.r == b.w { + return 0, b.readErr() + } + } + + // copy as much as we can + n = copy(p, b.buf[b.r:b.w]) + b.r += n + b.lastByte = int(b.buf[b.r-1]) + b.lastRuneSize = -1 + return n, nil +} + +// ReadByte reads and returns a single byte. +// If no byte is available, returns an error. +func (b *Reader) ReadByte() (c byte, err error) { + b.lastRuneSize = -1 + for b.r == b.w { + if b.err != nil { + return 0, b.readErr() + } + b.fill() // buffer is empty + } + c = b.buf[b.r] + b.r++ + b.lastByte = int(c) + return c, nil +} + +// UnreadByte unreads the last byte. Only the most recently read byte can be unread. +func (b *Reader) UnreadByte() error { + if b.lastByte < 0 || b.r == 0 && b.w > 0 { + return ErrInvalidUnreadByte + } + // b.r > 0 || b.w == 0 + if b.r > 0 { + b.r-- + } else { + // b.r == 0 && b.w == 0 + b.w = 1 + } + b.buf[b.r] = byte(b.lastByte) + b.lastByte = -1 + b.lastRuneSize = -1 + return nil +} + +// ReadRune reads a single UTF-8 encoded Unicode character and returns the +// rune and its size in bytes. If the encoded rune is invalid, it consumes one byte +// and returns unicode.ReplacementChar (U+FFFD) with a size of 1. +func (b *Reader) ReadRune() (r rune, size int, err error) { + for b.r+utf8.UTFMax > b.w && !utf8.FullRune(b.buf[b.r:b.w]) && b.err == nil && b.w-b.r < len(b.buf) { + b.fill() // b.w-b.r < len(buf) => buffer is not full + } + b.lastRuneSize = -1 + if b.r == b.w { + return 0, 0, b.readErr() + } + r, size = rune(b.buf[b.r]), 1 + if r >= 0x80 { + r, size = utf8.DecodeRune(b.buf[b.r:b.w]) + } + b.r += size + b.lastByte = int(b.buf[b.r-1]) + b.lastRuneSize = size + return r, size, nil +} + +// UnreadRune unreads the last rune. If the most recent read operation on +// the buffer was not a ReadRune, UnreadRune returns an error. (In this +// regard it is stricter than UnreadByte, which will unread the last byte +// from any read operation.) +func (b *Reader) UnreadRune() error { + if b.lastRuneSize < 0 || b.r < b.lastRuneSize { + return ErrInvalidUnreadRune + } + b.r -= b.lastRuneSize + b.lastByte = -1 + b.lastRuneSize = -1 + return nil +} + +// Buffered returns the number of bytes that can be read from the current buffer. +func (b *Reader) Buffered() int { return b.w - b.r } + +// ReadSlice reads until the first occurrence of delim in the input, +// returning a slice pointing at the bytes in the buffer. +// The bytes stop being valid at the next read. +// If ReadSlice encounters an error before finding a delimiter, +// it returns all the data in the buffer and the error itself (often io.EOF). +// ReadSlice fails with error ErrBufferFull if the buffer fills without a delim. +// Because the data returned from ReadSlice will be overwritten +// by the next I/O operation, most clients should use +// ReadBytes or ReadString instead. +// ReadSlice returns err != nil if and only if line does not end in delim. +func (b *Reader) ReadSlice(delim byte) (line []byte, err error) { + for { + // Search buffer. + if i := bytes.IndexByte(b.buf[b.r:b.w], delim); i >= 0 { + line = b.buf[b.r : b.r+i+1] + b.r += i + 1 + break + } + + // Pending error? + if b.err != nil { + line = b.buf[b.r:b.w] + b.r = b.w + err = b.readErr() + break + } + + // Buffer full? + if b.Buffered() >= len(b.buf) { + b.r = b.w + line = b.buf + err = ErrBufferFull + break + } + + b.fill() // buffer is not full + } + + // Handle last byte, if any. + if i := len(line) - 1; i >= 0 { + b.lastByte = int(line[i]) + b.lastRuneSize = -1 + } + + return +} + +// ReadLine is a low-level line-reading primitive. Most callers should use +// ReadBytes('\n') or ReadString('\n') instead or use a Scanner. +// +// ReadLine tries to return a single line, not including the end-of-line bytes. +// If the line was too long for the buffer then isPrefix is set and the +// beginning of the line is returned. The rest of the line will be returned +// from future calls. isPrefix will be false when returning the last fragment +// of the line. The returned buffer is only valid until the next call to +// ReadLine. ReadLine either returns a non-nil line or it returns an error, +// never both. +// +// The text returned from ReadLine does not include the line end ("\r\n" or "\n"). +// No indication or error is given if the input ends without a final line end. +// Calling UnreadByte after ReadLine will always unread the last byte read +// (possibly a character belonging to the line end) even if that byte is not +// part of the line returned by ReadLine. +func (b *Reader) ReadLine() (line []byte, isPrefix bool, err error) { + line, err = b.ReadSlice('\n') + if err == ErrBufferFull { + // Handle the case where "\r\n" straddles the buffer. + if len(line) > 0 && line[len(line)-1] == '\r' { + // Put the '\r' back on buf and drop it from line. + // Let the next call to ReadLine check for "\r\n". + if b.r == 0 { + // should be unreachable + panic("bufio: tried to rewind past start of buffer") + } + b.r-- + line = line[:len(line)-1] + } + return line, true, nil + } + + if len(line) == 0 { + if err != nil { + line = nil + } + return + } + err = nil + + if line[len(line)-1] == '\n' { + drop := 1 + if len(line) > 1 && line[len(line)-2] == '\r' { + drop = 2 + } + line = line[:len(line)-drop] + } + return +} + +// ReadBytes reads until the first occurrence of delim in the input, +// returning a slice containing the data up to and including the delimiter. +// If ReadBytes encounters an error before finding a delimiter, +// it returns the data read before the error and the error itself (often io.EOF). +// ReadBytes returns err != nil if and only if the returned data does not end in +// delim. +// For simple uses, a Scanner may be more convenient. +func (b *Reader) ReadBytes(delim byte) (line []byte, err error) { + // Use ReadSlice to look for array, + // accumulating full buffers. + var frag []byte + var full [][]byte + + for { + var e error + frag, e = b.ReadSlice(delim) + if e == nil { // got final fragment + break + } + if e != ErrBufferFull { // unexpected error + err = e + break + } + + // Make a copy of the buffer. + buf := make([]byte, len(frag)) + copy(buf, frag) + full = append(full, buf) + } + + // Allocate new buffer to hold the full pieces and the fragment. + n := 0 + for i := range full { + n += len(full[i]) + } + n += len(frag) + + // Copy full pieces and fragment in. + buf := make([]byte, n) + n = 0 + for i := range full { + n += copy(buf[n:], full[i]) + } + copy(buf[n:], frag) + return buf, err +} + +// ReadString reads until the first occurrence of delim in the input, +// returning a string containing the data up to and including the delimiter. +// If ReadString encounters an error before finding a delimiter, +// it returns the data read before the error and the error itself (often io.EOF). +// ReadString returns err != nil if and only if the returned data does not end in +// delim. +// For simple uses, a Scanner may be more convenient. +func (b *Reader) ReadString(delim byte) (line string, err error) { + bytes, err := b.ReadBytes(delim) + line = string(bytes) + return line, err +} + +// WriteTo implements io.WriterTo. +func (b *Reader) WriteTo(w io.Writer) (n int64, err error) { + n, err = b.writeBuf(w) + if err != nil { + return + } + + if r, ok := b.rd.(io.WriterTo); ok { + m, err := r.WriteTo(w) + n += m + return n, err + } + + if w, ok := w.(io.ReaderFrom); ok { + m, err := w.ReadFrom(b.rd) + n += m + return n, err + } + + if b.w-b.r < len(b.buf) { + b.fill() // buffer not full + } + + for b.r < b.w { + // b.r < b.w => buffer is not empty + m, err := b.writeBuf(w) + n += m + if err != nil { + return n, err + } + b.fill() // buffer is empty + } + + if b.err == io.EOF { + b.err = nil + } + + return n, b.readErr() +} + +var errNegativeWrite = errors.New("bufio: writer returned negative count from Write") + +// writeBuf writes the Reader's buffer to the writer. +func (b *Reader) writeBuf(w io.Writer) (int64, error) { + n, err := w.Write(b.buf[b.r:b.w]) + if n < 0 { + panic(errNegativeWrite) + } + b.r += n + return int64(n), err +} + +// buffered output + +// Writer implements buffering for an io.Writer object. +// If an error occurs writing to a Writer, no more data will be +// accepted and all subsequent writes will return the error. +// After all data has been written, the client should call the +// Flush method to guarantee all data has been forwarded to +// the underlying io.Writer. +type Writer struct { + err error + buf []byte + n int + wr io.Writer +} + +// NewWriterSize returns a new Writer whose buffer has at least the specified +// size. If the argument io.Writer is already a Writer with large enough +// size, it returns the underlying Writer. +func NewWriterSize(w io.Writer, size int) *Writer { + // Is it already a Writer? + b, ok := w.(*Writer) + if ok && len(b.buf) >= size { + return b + } + if size <= 0 { + size = defaultBufSize + } + return &Writer{ + buf: make([]byte, size), + wr: w, + } +} + +// NewWriter returns a new Writer whose buffer has the default size. +func NewWriter(w io.Writer) *Writer { + return NewWriterSize(w, defaultBufSize) +} + +// Reset discards any unflushed buffered data, clears any error, and +// resets b to write its output to w. +func (b *Writer) Reset(w io.Writer) { + b.err = nil + b.n = 0 + b.wr = w +} + +// Flush writes any buffered data to the underlying io.Writer. +func (b *Writer) Flush() error { + err := b.flush() + return err +} + +func (b *Writer) flush() error { + if b.err != nil { + return b.err + } + if b.n == 0 { + return nil + } + n, err := b.wr.Write(b.buf[0:b.n]) + if n < b.n && err == nil { + err = io.ErrShortWrite + } + if err != nil { + if n > 0 && n < b.n { + copy(b.buf[0:b.n-n], b.buf[n:b.n]) + } + b.n -= n + b.err = err + return err + } + b.n = 0 + return nil +} + +// Available returns how many bytes are unused in the buffer. +func (b *Writer) Available() int { return len(b.buf) - b.n } + +// Buffered returns the number of bytes that have been written into the current buffer. +func (b *Writer) Buffered() int { return b.n } + +// Write writes the contents of p into the buffer. +// It returns the number of bytes written. +// If nn < len(p), it also returns an error explaining +// why the write is short. +func (b *Writer) Write(p []byte) (nn int, err error) { + for len(p) > b.Available() && b.err == nil { + var n int + if b.Buffered() == 0 { + // Large write, empty buffer. + // Write directly from p to avoid copy. + n, b.err = b.wr.Write(p) + } else { + n = copy(b.buf[b.n:], p) + b.n += n + b.flush() + } + nn += n + p = p[n:] + } + if b.err != nil { + return nn, b.err + } + n := copy(b.buf[b.n:], p) + b.n += n + nn += n + return nn, nil +} + +// WriteByte writes a single byte. +func (b *Writer) WriteByte(c byte) error { + if b.err != nil { + return b.err + } + if b.Available() <= 0 && b.flush() != nil { + return b.err + } + b.buf[b.n] = c + b.n++ + return nil +} + +// WriteRune writes a single Unicode code point, returning +// the number of bytes written and any error. +func (b *Writer) WriteRune(r rune) (size int, err error) { + if r < utf8.RuneSelf { + err = b.WriteByte(byte(r)) + if err != nil { + return 0, err + } + return 1, nil + } + if b.err != nil { + return 0, b.err + } + n := b.Available() + if n < utf8.UTFMax { + if b.flush(); b.err != nil { + return 0, b.err + } + n = b.Available() + if n < utf8.UTFMax { + // Can only happen if buffer is silly small. + return b.WriteString(string(r)) + } + } + size = utf8.EncodeRune(b.buf[b.n:], r) + b.n += size + return size, nil +} + +// WriteString writes a string. +// It returns the number of bytes written. +// If the count is less than len(s), it also returns an error explaining +// why the write is short. +func (b *Writer) WriteString(s string) (int, error) { + nn := 0 + for len(s) > b.Available() && b.err == nil { + n := copy(b.buf[b.n:], s) + b.n += n + nn += n + s = s[n:] + b.flush() + } + if b.err != nil { + return nn, b.err + } + n := copy(b.buf[b.n:], s) + b.n += n + nn += n + return nn, nil +} + +// ReadFrom implements io.ReaderFrom. +func (b *Writer) ReadFrom(r io.Reader) (n int64, err error) { + if b.Buffered() == 0 { + if w, ok := b.wr.(io.ReaderFrom); ok { + return w.ReadFrom(r) + } + } + var m int + for { + if b.Available() == 0 { + if err1 := b.flush(); err1 != nil { + return n, err1 + } + } + nr := 0 + for nr < maxConsecutiveEmptyReads { + m, err = r.Read(b.buf[b.n:]) + if m != 0 || err != nil { + break + } + nr++ + } + if nr == maxConsecutiveEmptyReads { + return n, io.ErrNoProgress + } + b.n += m + n += int64(m) + if err != nil { + break + } + } + if err == io.EOF { + // If we filled the buffer exactly, flush pre-emptively. + if b.Available() == 0 { + err = b.flush() + } else { + err = nil + } + } + return n, err +} + +// buffered input and output + +// ReadWriter stores pointers to a Reader and a Writer. +// It implements io.ReadWriter. +type ReadWriter struct { + *Reader + *Writer +} + +// NewReadWriter allocates a new ReadWriter that dispatches to r and w. +func NewReadWriter(r *Reader, w *Writer) *ReadWriter { + return &ReadWriter{r, w} +} diff --git a/src/bufio/bufio_test.go b/src/bufio/bufio_test.go new file mode 100644 index 0000000000000000000000000000000000000000..666c44e15a938be90bb2f9095fea82a18e9401e7 --- /dev/null +++ b/src/bufio/bufio_test.go @@ -0,0 +1,1572 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package bufio_test + +import ( + . "bufio" + "bytes" + "errors" + "fmt" + "io" + "io/ioutil" + "strings" + "testing" + "testing/iotest" + "time" + "unicode/utf8" +) + +// Reads from a reader and rot13s the result. +type rot13Reader struct { + r io.Reader +} + +func newRot13Reader(r io.Reader) *rot13Reader { + r13 := new(rot13Reader) + r13.r = r + return r13 +} + +func (r13 *rot13Reader) Read(p []byte) (int, error) { + n, err := r13.r.Read(p) + for i := 0; i < n; i++ { + c := p[i] | 0x20 // lowercase byte + if 'a' <= c && c <= 'm' { + p[i] += 13 + } else if 'n' <= c && c <= 'z' { + p[i] -= 13 + } + } + return n, err +} + +// Call ReadByte to accumulate the text of a file +func readBytes(buf *Reader) string { + var b [1000]byte + nb := 0 + for { + c, err := buf.ReadByte() + if err == io.EOF { + break + } + if err == nil { + b[nb] = c + nb++ + } else if err != iotest.ErrTimeout { + panic("Data: " + err.Error()) + } + } + return string(b[0:nb]) +} + +func TestReaderSimple(t *testing.T) { + data := "hello world" + b := NewReader(strings.NewReader(data)) + if s := readBytes(b); s != "hello world" { + t.Errorf("simple hello world test failed: got %q", s) + } + + b = NewReader(newRot13Reader(strings.NewReader(data))) + if s := readBytes(b); s != "uryyb jbeyq" { + t.Errorf("rot13 hello world test failed: got %q", s) + } +} + +type readMaker struct { + name string + fn func(io.Reader) io.Reader +} + +var readMakers = []readMaker{ + {"full", func(r io.Reader) io.Reader { return r }}, + {"byte", iotest.OneByteReader}, + {"half", iotest.HalfReader}, + {"data+err", iotest.DataErrReader}, + {"timeout", iotest.TimeoutReader}, +} + +// Call ReadString (which ends up calling everything else) +// to accumulate the text of a file. +func readLines(b *Reader) string { + s := "" + for { + s1, err := b.ReadString('\n') + if err == io.EOF { + break + } + if err != nil && err != iotest.ErrTimeout { + panic("GetLines: " + err.Error()) + } + s += s1 + } + return s +} + +// Call Read to accumulate the text of a file +func reads(buf *Reader, m int) string { + var b [1000]byte + nb := 0 + for { + n, err := buf.Read(b[nb : nb+m]) + nb += n + if err == io.EOF { + break + } + } + return string(b[0:nb]) +} + +type bufReader struct { + name string + fn func(*Reader) string +} + +var bufreaders = []bufReader{ + {"1", func(b *Reader) string { return reads(b, 1) }}, + {"2", func(b *Reader) string { return reads(b, 2) }}, + {"3", func(b *Reader) string { return reads(b, 3) }}, + {"4", func(b *Reader) string { return reads(b, 4) }}, + {"5", func(b *Reader) string { return reads(b, 5) }}, + {"7", func(b *Reader) string { return reads(b, 7) }}, + {"bytes", readBytes}, + {"lines", readLines}, +} + +const minReadBufferSize = 16 + +var bufsizes = []int{ + 0, minReadBufferSize, 23, 32, 46, 64, 93, 128, 1024, 4096, +} + +func TestReader(t *testing.T) { + var texts [31]string + str := "" + all := "" + for i := 0; i < len(texts)-1; i++ { + texts[i] = str + "\n" + all += texts[i] + str += string(i%26 + 'a') + } + texts[len(texts)-1] = all + + for h := 0; h < len(texts); h++ { + text := texts[h] + for i := 0; i < len(readMakers); i++ { + for j := 0; j < len(bufreaders); j++ { + for k := 0; k < len(bufsizes); k++ { + readmaker := readMakers[i] + bufreader := bufreaders[j] + bufsize := bufsizes[k] + read := readmaker.fn(strings.NewReader(text)) + buf := NewReaderSize(read, bufsize) + s := bufreader.fn(buf) + if s != text { + t.Errorf("reader=%s fn=%s bufsize=%d want=%q got=%q", + readmaker.name, bufreader.name, bufsize, text, s) + } + } + } + } + } +} + +type zeroReader struct{} + +func (zeroReader) Read(p []byte) (int, error) { + return 0, nil +} + +func TestZeroReader(t *testing.T) { + var z zeroReader + r := NewReader(z) + + c := make(chan error) + go func() { + _, err := r.ReadByte() + c <- err + }() + + select { + case err := <-c: + if err == nil { + t.Error("error expected") + } else if err != io.ErrNoProgress { + t.Error("unexpected error:", err) + } + case <-time.After(time.Second): + t.Error("test timed out (endless loop in ReadByte?)") + } +} + +// A StringReader delivers its data one string segment at a time via Read. +type StringReader struct { + data []string + step int +} + +func (r *StringReader) Read(p []byte) (n int, err error) { + if r.step < len(r.data) { + s := r.data[r.step] + n = copy(p, s) + r.step++ + } else { + err = io.EOF + } + return +} + +func readRuneSegments(t *testing.T, segments []string) { + got := "" + want := strings.Join(segments, "") + r := NewReader(&StringReader{data: segments}) + for { + r, _, err := r.ReadRune() + if err != nil { + if err != io.EOF { + return + } + break + } + got += string(r) + } + if got != want { + t.Errorf("segments=%v got=%s want=%s", segments, got, want) + } +} + +var segmentList = [][]string{ + {}, + {""}, + {"日", "本語"}, + {"\u65e5", "\u672c", "\u8a9e"}, + {"\U000065e5", "\U0000672c", "\U00008a9e"}, + {"\xe6", "\x97\xa5\xe6", "\x9c\xac\xe8\xaa\x9e"}, + {"Hello", ", ", "World", "!"}, + {"Hello", ", ", "", "World", "!"}, +} + +func TestReadRune(t *testing.T) { + for _, s := range segmentList { + readRuneSegments(t, s) + } +} + +func TestUnreadRune(t *testing.T) { + segments := []string{"Hello, world:", "日本語"} + r := NewReader(&StringReader{data: segments}) + got := "" + want := strings.Join(segments, "") + // Normal execution. + for { + r1, _, err := r.ReadRune() + if err != nil { + if err != io.EOF { + t.Error("unexpected error on ReadRune:", err) + } + break + } + got += string(r1) + // Put it back and read it again. + if err = r.UnreadRune(); err != nil { + t.Fatal("unexpected error on UnreadRune:", err) + } + r2, _, err := r.ReadRune() + if err != nil { + t.Fatal("unexpected error reading after unreading:", err) + } + if r1 != r2 { + t.Fatalf("incorrect rune after unread: got %c, want %c", r1, r2) + } + } + if got != want { + t.Errorf("got %q, want %q", got, want) + } +} + +func TestUnreadByte(t *testing.T) { + segments := []string{"Hello, ", "world"} + r := NewReader(&StringReader{data: segments}) + got := "" + want := strings.Join(segments, "") + // Normal execution. + for { + b1, err := r.ReadByte() + if err != nil { + if err != io.EOF { + t.Error("unexpected error on ReadByte:", err) + } + break + } + got += string(b1) + // Put it back and read it again. + if err = r.UnreadByte(); err != nil { + t.Fatal("unexpected error on UnreadByte:", err) + } + b2, err := r.ReadByte() + if err != nil { + t.Fatal("unexpected error reading after unreading:", err) + } + if b1 != b2 { + t.Fatalf("incorrect byte after unread: got %q, want %q", b1, b2) + } + } + if got != want { + t.Errorf("got %q, want %q", got, want) + } +} + +func TestUnreadByteMultiple(t *testing.T) { + segments := []string{"Hello, ", "world"} + data := strings.Join(segments, "") + for n := 0; n <= len(data); n++ { + r := NewReader(&StringReader{data: segments}) + // Read n bytes. + for i := 0; i < n; i++ { + b, err := r.ReadByte() + if err != nil { + t.Fatalf("n = %d: unexpected error on ReadByte: %v", n, err) + } + if b != data[i] { + t.Fatalf("n = %d: incorrect byte returned from ReadByte: got %q, want %q", n, b, data[i]) + } + } + // Unread one byte if there is one. + if n > 0 { + if err := r.UnreadByte(); err != nil { + t.Errorf("n = %d: unexpected error on UnreadByte: %v", n, err) + } + } + // Test that we cannot unread any further. + if err := r.UnreadByte(); err == nil { + t.Errorf("n = %d: expected error on UnreadByte", n) + } + } +} + +func TestUnreadByteOthers(t *testing.T) { + // A list of readers to use in conjunction with UnreadByte. + var readers = []func(*Reader, byte) ([]byte, error){ + (*Reader).ReadBytes, + (*Reader).ReadSlice, + func(r *Reader, delim byte) ([]byte, error) { + data, err := r.ReadString(delim) + return []byte(data), err + }, + // ReadLine doesn't fit the data/pattern easily + // so we leave it out. It should be covered via + // the ReadSlice test since ReadLine simply calls + // ReadSlice, and it's that function that handles + // the last byte. + } + + // Try all readers with UnreadByte. + for rno, read := range readers { + // Some input data that is longer than the minimum reader buffer size. + const n = 10 + var buf bytes.Buffer + for i := 0; i < n; i++ { + buf.WriteString("abcdefg") + } + + r := NewReaderSize(&buf, minReadBufferSize) + readTo := func(delim byte, want string) { + data, err := read(r, delim) + if err != nil { + t.Fatalf("#%d: unexpected error reading to %c: %v", rno, delim, err) + } + if got := string(data); got != want { + t.Fatalf("#%d: got %q, want %q", rno, got, want) + } + } + + // Read the data with occasional UnreadByte calls. + for i := 0; i < n; i++ { + readTo('d', "abcd") + for j := 0; j < 3; j++ { + if err := r.UnreadByte(); err != nil { + t.Fatalf("#%d: unexpected error on UnreadByte: %v", rno, err) + } + readTo('d', "d") + } + readTo('g', "efg") + } + + // All data should have been read. + _, err := r.ReadByte() + if err != io.EOF { + t.Errorf("#%d: got error %v; want EOF", rno, err) + } + } +} + +// Test that UnreadRune fails if the preceding operation was not a ReadRune. +func TestUnreadRuneError(t *testing.T) { + buf := make([]byte, 3) // All runes in this test are 3 bytes long + r := NewReader(&StringReader{data: []string{"日本語日本語日本語"}}) + if r.UnreadRune() == nil { + t.Error("expected error on UnreadRune from fresh buffer") + } + _, _, err := r.ReadRune() + if err != nil { + t.Error("unexpected error on ReadRune (1):", err) + } + if err = r.UnreadRune(); err != nil { + t.Error("unexpected error on UnreadRune (1):", err) + } + if r.UnreadRune() == nil { + t.Error("expected error after UnreadRune (1)") + } + // Test error after Read. + _, _, err = r.ReadRune() // reset state + if err != nil { + t.Error("unexpected error on ReadRune (2):", err) + } + _, err = r.Read(buf) + if err != nil { + t.Error("unexpected error on Read (2):", err) + } + if r.UnreadRune() == nil { + t.Error("expected error after Read (2)") + } + // Test error after ReadByte. + _, _, err = r.ReadRune() // reset state + if err != nil { + t.Error("unexpected error on ReadRune (2):", err) + } + for range buf { + _, err = r.ReadByte() + if err != nil { + t.Error("unexpected error on ReadByte (2):", err) + } + } + if r.UnreadRune() == nil { + t.Error("expected error after ReadByte") + } + // Test error after UnreadByte. + _, _, err = r.ReadRune() // reset state + if err != nil { + t.Error("unexpected error on ReadRune (3):", err) + } + _, err = r.ReadByte() + if err != nil { + t.Error("unexpected error on ReadByte (3):", err) + } + err = r.UnreadByte() + if err != nil { + t.Error("unexpected error on UnreadByte (3):", err) + } + if r.UnreadRune() == nil { + t.Error("expected error after UnreadByte (3)") + } + // Test error after ReadSlice. + _, _, err = r.ReadRune() // reset state + if err != nil { + t.Error("unexpected error on ReadRune (4):", err) + } + _, err = r.ReadSlice(0) + if err != io.EOF { + t.Error("unexpected error on ReadSlice (4):", err) + } + if r.UnreadRune() == nil { + t.Error("expected error after ReadSlice (4)") + } +} + +func TestUnreadRuneAtEOF(t *testing.T) { + // UnreadRune/ReadRune should error at EOF (was a bug; used to panic) + r := NewReader(strings.NewReader("x")) + r.ReadRune() + r.ReadRune() + r.UnreadRune() + _, _, err := r.ReadRune() + if err == nil { + t.Error("expected error at EOF") + } else if err != io.EOF { + t.Error("expected EOF; got", err) + } +} + +func TestReadWriteRune(t *testing.T) { + const NRune = 1000 + byteBuf := new(bytes.Buffer) + w := NewWriter(byteBuf) + // Write the runes out using WriteRune + buf := make([]byte, utf8.UTFMax) + for r := rune(0); r < NRune; r++ { + size := utf8.EncodeRune(buf, r) + nbytes, err := w.WriteRune(r) + if err != nil { + t.Fatalf("WriteRune(0x%x) error: %s", r, err) + } + if nbytes != size { + t.Fatalf("WriteRune(0x%x) expected %d, got %d", r, size, nbytes) + } + } + w.Flush() + + r := NewReader(byteBuf) + // Read them back with ReadRune + for r1 := rune(0); r1 < NRune; r1++ { + size := utf8.EncodeRune(buf, r1) + nr, nbytes, err := r.ReadRune() + if nr != r1 || nbytes != size || err != nil { + t.Fatalf("ReadRune(0x%x) got 0x%x,%d not 0x%x,%d (err=%s)", r1, nr, nbytes, r1, size, err) + } + } +} + +func TestWriter(t *testing.T) { + var data [8192]byte + + for i := 0; i < len(data); i++ { + data[i] = byte(' ' + i%('~'-' ')) + } + w := new(bytes.Buffer) + for i := 0; i < len(bufsizes); i++ { + for j := 0; j < len(bufsizes); j++ { + nwrite := bufsizes[i] + bs := bufsizes[j] + + // Write nwrite bytes using buffer size bs. + // Check that the right amount makes it out + // and that the data is correct. + + w.Reset() + buf := NewWriterSize(w, bs) + context := fmt.Sprintf("nwrite=%d bufsize=%d", nwrite, bs) + n, e1 := buf.Write(data[0:nwrite]) + if e1 != nil || n != nwrite { + t.Errorf("%s: buf.Write %d = %d, %v", context, nwrite, n, e1) + continue + } + if e := buf.Flush(); e != nil { + t.Errorf("%s: buf.Flush = %v", context, e) + } + + written := w.Bytes() + if len(written) != nwrite { + t.Errorf("%s: %d bytes written", context, len(written)) + } + for l := 0; l < len(written); l++ { + if written[i] != data[i] { + t.Errorf("wrong bytes written") + t.Errorf("want=%q", data[0:len(written)]) + t.Errorf("have=%q", written) + } + } + } + } +} + +// Check that write errors are returned properly. + +type errorWriterTest struct { + n, m int + err error + expect error +} + +func (w errorWriterTest) Write(p []byte) (int, error) { + return len(p) * w.n / w.m, w.err +} + +var errorWriterTests = []errorWriterTest{ + {0, 1, nil, io.ErrShortWrite}, + {1, 2, nil, io.ErrShortWrite}, + {1, 1, nil, nil}, + {0, 1, io.ErrClosedPipe, io.ErrClosedPipe}, + {1, 2, io.ErrClosedPipe, io.ErrClosedPipe}, + {1, 1, io.ErrClosedPipe, io.ErrClosedPipe}, +} + +func TestWriteErrors(t *testing.T) { + for _, w := range errorWriterTests { + buf := NewWriter(w) + _, e := buf.Write([]byte("hello world")) + if e != nil { + t.Errorf("Write hello to %v: %v", w, e) + continue + } + // Two flushes, to verify the error is sticky. + for i := 0; i < 2; i++ { + e = buf.Flush() + if e != w.expect { + t.Errorf("Flush %d/2 %v: got %v, wanted %v", i+1, w, e, w.expect) + } + } + } +} + +func TestNewReaderSizeIdempotent(t *testing.T) { + const BufSize = 1000 + b := NewReaderSize(strings.NewReader("hello world"), BufSize) + // Does it recognize itself? + b1 := NewReaderSize(b, BufSize) + if b1 != b { + t.Error("NewReaderSize did not detect underlying Reader") + } + // Does it wrap if existing buffer is too small? + b2 := NewReaderSize(b, 2*BufSize) + if b2 == b { + t.Error("NewReaderSize did not enlarge buffer") + } +} + +func TestNewWriterSizeIdempotent(t *testing.T) { + const BufSize = 1000 + b := NewWriterSize(new(bytes.Buffer), BufSize) + // Does it recognize itself? + b1 := NewWriterSize(b, BufSize) + if b1 != b { + t.Error("NewWriterSize did not detect underlying Writer") + } + // Does it wrap if existing buffer is too small? + b2 := NewWriterSize(b, 2*BufSize) + if b2 == b { + t.Error("NewWriterSize did not enlarge buffer") + } +} + +func TestWriteString(t *testing.T) { + const BufSize = 8 + buf := new(bytes.Buffer) + b := NewWriterSize(buf, BufSize) + b.WriteString("0") // easy + b.WriteString("123456") // still easy + b.WriteString("7890") // easy after flush + b.WriteString("abcdefghijklmnopqrstuvwxy") // hard + b.WriteString("z") + if err := b.Flush(); err != nil { + t.Error("WriteString", err) + } + s := "01234567890abcdefghijklmnopqrstuvwxyz" + if string(buf.Bytes()) != s { + t.Errorf("WriteString wants %q gets %q", s, string(buf.Bytes())) + } +} + +func TestBufferFull(t *testing.T) { + const longString = "And now, hello, world! It is the time for all good men to come to the aid of their party" + buf := NewReaderSize(strings.NewReader(longString), minReadBufferSize) + line, err := buf.ReadSlice('!') + if string(line) != "And now, hello, " || err != ErrBufferFull { + t.Errorf("first ReadSlice(,) = %q, %v", line, err) + } + line, err = buf.ReadSlice('!') + if string(line) != "world!" || err != nil { + t.Errorf("second ReadSlice(,) = %q, %v", line, err) + } +} + +func TestPeek(t *testing.T) { + p := make([]byte, 10) + // string is 16 (minReadBufferSize) long. + buf := NewReaderSize(strings.NewReader("abcdefghijklmnop"), minReadBufferSize) + if s, err := buf.Peek(1); string(s) != "a" || err != nil { + t.Fatalf("want %q got %q, err=%v", "a", string(s), err) + } + if s, err := buf.Peek(4); string(s) != "abcd" || err != nil { + t.Fatalf("want %q got %q, err=%v", "abcd", string(s), err) + } + if _, err := buf.Peek(-1); err != ErrNegativeCount { + t.Fatalf("want ErrNegativeCount got %v", err) + } + if _, err := buf.Peek(32); err != ErrBufferFull { + t.Fatalf("want ErrBufFull got %v", err) + } + if _, err := buf.Read(p[0:3]); string(p[0:3]) != "abc" || err != nil { + t.Fatalf("want %q got %q, err=%v", "abc", string(p[0:3]), err) + } + if s, err := buf.Peek(1); string(s) != "d" || err != nil { + t.Fatalf("want %q got %q, err=%v", "d", string(s), err) + } + if s, err := buf.Peek(2); string(s) != "de" || err != nil { + t.Fatalf("want %q got %q, err=%v", "de", string(s), err) + } + if _, err := buf.Read(p[0:3]); string(p[0:3]) != "def" || err != nil { + t.Fatalf("want %q got %q, err=%v", "def", string(p[0:3]), err) + } + if s, err := buf.Peek(4); string(s) != "ghij" || err != nil { + t.Fatalf("want %q got %q, err=%v", "ghij", string(s), err) + } + if _, err := buf.Read(p[0:]); string(p[0:]) != "ghijklmnop" || err != nil { + t.Fatalf("want %q got %q, err=%v", "ghijklmnop", string(p[0:minReadBufferSize]), err) + } + if s, err := buf.Peek(0); string(s) != "" || err != nil { + t.Fatalf("want %q got %q, err=%v", "", string(s), err) + } + if _, err := buf.Peek(1); err != io.EOF { + t.Fatalf("want EOF got %v", err) + } + + // Test for issue 3022, not exposing a reader's error on a successful Peek. + buf = NewReaderSize(dataAndEOFReader("abcd"), 32) + if s, err := buf.Peek(2); string(s) != "ab" || err != nil { + t.Errorf(`Peek(2) on "abcd", EOF = %q, %v; want "ab", nil`, string(s), err) + } + if s, err := buf.Peek(4); string(s) != "abcd" || err != nil { + t.Errorf(`Peek(4) on "abcd", EOF = %q, %v; want "abcd", nil`, string(s), err) + } + if n, err := buf.Read(p[0:5]); string(p[0:n]) != "abcd" || err != nil { + t.Fatalf("Read after peek = %q, %v; want abcd, EOF", p[0:n], err) + } + if n, err := buf.Read(p[0:1]); string(p[0:n]) != "" || err != io.EOF { + t.Fatalf(`second Read after peek = %q, %v; want "", EOF`, p[0:n], err) + } +} + +type dataAndEOFReader string + +func (r dataAndEOFReader) Read(p []byte) (int, error) { + return copy(p, r), io.EOF +} + +func TestPeekThenUnreadRune(t *testing.T) { + // This sequence used to cause a crash. + r := NewReader(strings.NewReader("x")) + r.ReadRune() + r.Peek(1) + r.UnreadRune() + r.ReadRune() // Used to panic here +} + +var testOutput = []byte("0123456789abcdefghijklmnopqrstuvwxy") +var testInput = []byte("012\n345\n678\n9ab\ncde\nfgh\nijk\nlmn\nopq\nrst\nuvw\nxy") +var testInputrn = []byte("012\r\n345\r\n678\r\n9ab\r\ncde\r\nfgh\r\nijk\r\nlmn\r\nopq\r\nrst\r\nuvw\r\nxy\r\n\n\r\n") + +// TestReader wraps a []byte and returns reads of a specific length. +type testReader struct { + data []byte + stride int +} + +func (t *testReader) Read(buf []byte) (n int, err error) { + n = t.stride + if n > len(t.data) { + n = len(t.data) + } + if n > len(buf) { + n = len(buf) + } + copy(buf, t.data) + t.data = t.data[n:] + if len(t.data) == 0 { + err = io.EOF + } + return +} + +func testReadLine(t *testing.T, input []byte) { + //for stride := 1; stride < len(input); stride++ { + for stride := 1; stride < 2; stride++ { + done := 0 + reader := testReader{input, stride} + l := NewReaderSize(&reader, len(input)+1) + for { + line, isPrefix, err := l.ReadLine() + if len(line) > 0 && err != nil { + t.Errorf("ReadLine returned both data and error: %s", err) + } + if isPrefix { + t.Errorf("ReadLine returned prefix") + } + if err != nil { + if err != io.EOF { + t.Fatalf("Got unknown error: %s", err) + } + break + } + if want := testOutput[done : done+len(line)]; !bytes.Equal(want, line) { + t.Errorf("Bad line at stride %d: want: %x got: %x", stride, want, line) + } + done += len(line) + } + if done != len(testOutput) { + t.Errorf("ReadLine didn't return everything: got: %d, want: %d (stride: %d)", done, len(testOutput), stride) + } + } +} + +func TestReadLine(t *testing.T) { + testReadLine(t, testInput) + testReadLine(t, testInputrn) +} + +func TestLineTooLong(t *testing.T) { + data := make([]byte, 0) + for i := 0; i < minReadBufferSize*5/2; i++ { + data = append(data, '0'+byte(i%10)) + } + buf := bytes.NewReader(data) + l := NewReaderSize(buf, minReadBufferSize) + line, isPrefix, err := l.ReadLine() + if !isPrefix || !bytes.Equal(line, data[:minReadBufferSize]) || err != nil { + t.Errorf("bad result for first line: got %q want %q %v", line, data[:minReadBufferSize], err) + } + data = data[len(line):] + line, isPrefix, err = l.ReadLine() + if !isPrefix || !bytes.Equal(line, data[:minReadBufferSize]) || err != nil { + t.Errorf("bad result for second line: got %q want %q %v", line, data[:minReadBufferSize], err) + } + data = data[len(line):] + line, isPrefix, err = l.ReadLine() + if isPrefix || !bytes.Equal(line, data[:minReadBufferSize/2]) || err != nil { + t.Errorf("bad result for third line: got %q want %q %v", line, data[:minReadBufferSize/2], err) + } + line, isPrefix, err = l.ReadLine() + if isPrefix || err == nil { + t.Errorf("expected no more lines: %x %s", line, err) + } +} + +func TestReadAfterLines(t *testing.T) { + line1 := "this is line1" + restData := "this is line2\nthis is line 3\n" + inbuf := bytes.NewReader([]byte(line1 + "\n" + restData)) + outbuf := new(bytes.Buffer) + maxLineLength := len(line1) + len(restData)/2 + l := NewReaderSize(inbuf, maxLineLength) + line, isPrefix, err := l.ReadLine() + if isPrefix || err != nil || string(line) != line1 { + t.Errorf("bad result for first line: isPrefix=%v err=%v line=%q", isPrefix, err, string(line)) + } + n, err := io.Copy(outbuf, l) + if int(n) != len(restData) || err != nil { + t.Errorf("bad result for Read: n=%d err=%v", n, err) + } + if outbuf.String() != restData { + t.Errorf("bad result for Read: got %q; expected %q", outbuf.String(), restData) + } +} + +func TestReadEmptyBuffer(t *testing.T) { + l := NewReaderSize(new(bytes.Buffer), minReadBufferSize) + line, isPrefix, err := l.ReadLine() + if err != io.EOF { + t.Errorf("expected EOF from ReadLine, got '%s' %t %s", line, isPrefix, err) + } +} + +func TestLinesAfterRead(t *testing.T) { + l := NewReaderSize(bytes.NewReader([]byte("foo")), minReadBufferSize) + _, err := ioutil.ReadAll(l) + if err != nil { + t.Error(err) + return + } + + line, isPrefix, err := l.ReadLine() + if err != io.EOF { + t.Errorf("expected EOF from ReadLine, got '%s' %t %s", line, isPrefix, err) + } +} + +func TestReadLineNonNilLineOrError(t *testing.T) { + r := NewReader(strings.NewReader("line 1\n")) + for i := 0; i < 2; i++ { + l, _, err := r.ReadLine() + if l != nil && err != nil { + t.Fatalf("on line %d/2; ReadLine=%#v, %v; want non-nil line or Error, but not both", + i+1, l, err) + } + } +} + +type readLineResult struct { + line []byte + isPrefix bool + err error +} + +var readLineNewlinesTests = []struct { + input string + expect []readLineResult +}{ + {"012345678901234\r\n012345678901234\r\n", []readLineResult{ + {[]byte("012345678901234"), true, nil}, + {nil, false, nil}, + {[]byte("012345678901234"), true, nil}, + {nil, false, nil}, + {nil, false, io.EOF}, + }}, + {"0123456789012345\r012345678901234\r", []readLineResult{ + {[]byte("0123456789012345"), true, nil}, + {[]byte("\r012345678901234"), true, nil}, + {[]byte("\r"), false, nil}, + {nil, false, io.EOF}, + }}, +} + +func TestReadLineNewlines(t *testing.T) { + for _, e := range readLineNewlinesTests { + testReadLineNewlines(t, e.input, e.expect) + } +} + +func testReadLineNewlines(t *testing.T, input string, expect []readLineResult) { + b := NewReaderSize(strings.NewReader(input), minReadBufferSize) + for i, e := range expect { + line, isPrefix, err := b.ReadLine() + if !bytes.Equal(line, e.line) { + t.Errorf("%q call %d, line == %q, want %q", input, i, line, e.line) + return + } + if isPrefix != e.isPrefix { + t.Errorf("%q call %d, isPrefix == %v, want %v", input, i, isPrefix, e.isPrefix) + return + } + if err != e.err { + t.Errorf("%q call %d, err == %v, want %v", input, i, err, e.err) + return + } + } +} + +func createTestInput(n int) []byte { + input := make([]byte, n) + for i := range input { + // 101 and 251 are arbitrary prime numbers. + // The idea is to create an input sequence + // which doesn't repeat too frequently. + input[i] = byte(i % 251) + if i%101 == 0 { + input[i] ^= byte(i / 101) + } + } + return input +} + +func TestReaderWriteTo(t *testing.T) { + input := createTestInput(8192) + r := NewReader(onlyReader{bytes.NewReader(input)}) + w := new(bytes.Buffer) + if n, err := r.WriteTo(w); err != nil || n != int64(len(input)) { + t.Fatalf("r.WriteTo(w) = %d, %v, want %d, nil", n, err, len(input)) + } + + for i, val := range w.Bytes() { + if val != input[i] { + t.Errorf("after write: out[%d] = %#x, want %#x", i, val, input[i]) + } + } +} + +type errorWriterToTest struct { + rn, wn int + rerr, werr error + expected error +} + +func (r errorWriterToTest) Read(p []byte) (int, error) { + return len(p) * r.rn, r.rerr +} + +func (w errorWriterToTest) Write(p []byte) (int, error) { + return len(p) * w.wn, w.werr +} + +var errorWriterToTests = []errorWriterToTest{ + {1, 0, nil, io.ErrClosedPipe, io.ErrClosedPipe}, + {0, 1, io.ErrClosedPipe, nil, io.ErrClosedPipe}, + {0, 0, io.ErrUnexpectedEOF, io.ErrClosedPipe, io.ErrClosedPipe}, + {0, 1, io.EOF, nil, nil}, +} + +func TestReaderWriteToErrors(t *testing.T) { + for i, rw := range errorWriterToTests { + r := NewReader(rw) + if _, err := r.WriteTo(rw); err != rw.expected { + t.Errorf("r.WriteTo(errorWriterToTests[%d]) = _, %v, want _,%v", i, err, rw.expected) + } + } +} + +func TestWriterReadFrom(t *testing.T) { + ws := []func(io.Writer) io.Writer{ + func(w io.Writer) io.Writer { return onlyWriter{w} }, + func(w io.Writer) io.Writer { return w }, + } + + rs := []func(io.Reader) io.Reader{ + iotest.DataErrReader, + func(r io.Reader) io.Reader { return r }, + } + + for ri, rfunc := range rs { + for wi, wfunc := range ws { + input := createTestInput(8192) + b := new(bytes.Buffer) + w := NewWriter(wfunc(b)) + r := rfunc(bytes.NewReader(input)) + if n, err := w.ReadFrom(r); err != nil || n != int64(len(input)) { + t.Errorf("ws[%d],rs[%d]: w.ReadFrom(r) = %d, %v, want %d, nil", wi, ri, n, err, len(input)) + continue + } + if err := w.Flush(); err != nil { + t.Errorf("Flush returned %v", err) + continue + } + if got, want := b.String(), string(input); got != want { + t.Errorf("ws[%d], rs[%d]:\ngot %q\nwant %q\n", wi, ri, got, want) + } + } + } +} + +type errorReaderFromTest struct { + rn, wn int + rerr, werr error + expected error +} + +func (r errorReaderFromTest) Read(p []byte) (int, error) { + return len(p) * r.rn, r.rerr +} + +func (w errorReaderFromTest) Write(p []byte) (int, error) { + return len(p) * w.wn, w.werr +} + +var errorReaderFromTests = []errorReaderFromTest{ + {0, 1, io.EOF, nil, nil}, + {1, 1, io.EOF, nil, nil}, + {0, 1, io.ErrClosedPipe, nil, io.ErrClosedPipe}, + {0, 0, io.ErrClosedPipe, io.ErrShortWrite, io.ErrClosedPipe}, + {1, 0, nil, io.ErrShortWrite, io.ErrShortWrite}, +} + +func TestWriterReadFromErrors(t *testing.T) { + for i, rw := range errorReaderFromTests { + w := NewWriter(rw) + if _, err := w.ReadFrom(rw); err != rw.expected { + t.Errorf("w.ReadFrom(errorReaderFromTests[%d]) = _, %v, want _,%v", i, err, rw.expected) + } + } +} + +// TestWriterReadFromCounts tests that using io.Copy to copy into a +// bufio.Writer does not prematurely flush the buffer. For example, when +// buffering writes to a network socket, excessive network writes should be +// avoided. +func TestWriterReadFromCounts(t *testing.T) { + var w0 writeCountingDiscard + b0 := NewWriterSize(&w0, 1234) + b0.WriteString(strings.Repeat("x", 1000)) + if w0 != 0 { + t.Fatalf("write 1000 'x's: got %d writes, want 0", w0) + } + b0.WriteString(strings.Repeat("x", 200)) + if w0 != 0 { + t.Fatalf("write 1200 'x's: got %d writes, want 0", w0) + } + io.Copy(b0, onlyReader{strings.NewReader(strings.Repeat("x", 30))}) + if w0 != 0 { + t.Fatalf("write 1230 'x's: got %d writes, want 0", w0) + } + io.Copy(b0, onlyReader{strings.NewReader(strings.Repeat("x", 9))}) + if w0 != 1 { + t.Fatalf("write 1239 'x's: got %d writes, want 1", w0) + } + + var w1 writeCountingDiscard + b1 := NewWriterSize(&w1, 1234) + b1.WriteString(strings.Repeat("x", 1200)) + b1.Flush() + if w1 != 1 { + t.Fatalf("flush 1200 'x's: got %d writes, want 1", w1) + } + b1.WriteString(strings.Repeat("x", 89)) + if w1 != 1 { + t.Fatalf("write 1200 + 89 'x's: got %d writes, want 1", w1) + } + io.Copy(b1, onlyReader{strings.NewReader(strings.Repeat("x", 700))}) + if w1 != 1 { + t.Fatalf("write 1200 + 789 'x's: got %d writes, want 1", w1) + } + io.Copy(b1, onlyReader{strings.NewReader(strings.Repeat("x", 600))}) + if w1 != 2 { + t.Fatalf("write 1200 + 1389 'x's: got %d writes, want 2", w1) + } + b1.Flush() + if w1 != 3 { + t.Fatalf("flush 1200 + 1389 'x's: got %d writes, want 3", w1) + } +} + +// A writeCountingDiscard is like ioutil.Discard and counts the number of times +// Write is called on it. +type writeCountingDiscard int + +func (w *writeCountingDiscard) Write(p []byte) (int, error) { + *w++ + return len(p), nil +} + +type negativeReader int + +func (r *negativeReader) Read([]byte) (int, error) { return -1, nil } + +func TestNegativeRead(t *testing.T) { + // should panic with a description pointing at the reader, not at itself. + // (should NOT panic with slice index error, for example.) + b := NewReader(new(negativeReader)) + defer func() { + switch err := recover().(type) { + case nil: + t.Fatal("read did not panic") + case error: + if !strings.Contains(err.Error(), "reader returned negative count from Read") { + t.Fatalf("wrong panic: %v", err) + } + default: + t.Fatalf("unexpected panic value: %T(%v)", err, err) + } + }() + b.Read(make([]byte, 100)) +} + +var errFake = errors.New("fake error") + +type errorThenGoodReader struct { + didErr bool + nread int +} + +func (r *errorThenGoodReader) Read(p []byte) (int, error) { + r.nread++ + if !r.didErr { + r.didErr = true + return 0, errFake + } + return len(p), nil +} + +func TestReaderClearError(t *testing.T) { + r := &errorThenGoodReader{} + b := NewReader(r) + buf := make([]byte, 1) + if _, err := b.Read(nil); err != nil { + t.Fatalf("1st nil Read = %v; want nil", err) + } + if _, err := b.Read(buf); err != errFake { + t.Fatalf("1st Read = %v; want errFake", err) + } + if _, err := b.Read(nil); err != nil { + t.Fatalf("2nd nil Read = %v; want nil", err) + } + if _, err := b.Read(buf); err != nil { + t.Fatalf("3rd Read with buffer = %v; want nil", err) + } + if r.nread != 2 { + t.Errorf("num reads = %d; want 2", r.nread) + } +} + +// Test for golang.org/issue/5947 +func TestWriterReadFromWhileFull(t *testing.T) { + buf := new(bytes.Buffer) + w := NewWriterSize(buf, 10) + + // Fill buffer exactly. + n, err := w.Write([]byte("0123456789")) + if n != 10 || err != nil { + t.Fatalf("Write returned (%v, %v), want (10, nil)", n, err) + } + + // Use ReadFrom to read in some data. + n2, err := w.ReadFrom(strings.NewReader("abcdef")) + if n2 != 6 || err != nil { + t.Fatalf("ReadFrom returned (%v, %v), want (6, nil)", n2, err) + } +} + +type emptyThenNonEmptyReader struct { + r io.Reader + n int +} + +func (r *emptyThenNonEmptyReader) Read(p []byte) (int, error) { + if r.n <= 0 { + return r.r.Read(p) + } + r.n-- + return 0, nil +} + +// Test for golang.org/issue/7611 +func TestWriterReadFromUntilEOF(t *testing.T) { + buf := new(bytes.Buffer) + w := NewWriterSize(buf, 5) + + // Partially fill buffer + n, err := w.Write([]byte("0123")) + if n != 4 || err != nil { + t.Fatalf("Write returned (%v, %v), want (4, nil)", n, err) + } + + // Use ReadFrom to read in some data. + r := &emptyThenNonEmptyReader{r: strings.NewReader("abcd"), n: 3} + n2, err := w.ReadFrom(r) + if n2 != 4 || err != nil { + t.Fatalf("ReadFrom returned (%v, %v), want (4, nil)", n2, err) + } + w.Flush() + if got, want := string(buf.Bytes()), "0123abcd"; got != want { + t.Fatalf("buf.Bytes() returned %q, want %q", got, want) + } +} + +func TestWriterReadFromErrNoProgress(t *testing.T) { + buf := new(bytes.Buffer) + w := NewWriterSize(buf, 5) + + // Partially fill buffer + n, err := w.Write([]byte("0123")) + if n != 4 || err != nil { + t.Fatalf("Write returned (%v, %v), want (4, nil)", n, err) + } + + // Use ReadFrom to read in some data. + r := &emptyThenNonEmptyReader{r: strings.NewReader("abcd"), n: 100} + n2, err := w.ReadFrom(r) + if n2 != 0 || err != io.ErrNoProgress { + t.Fatalf("buf.Bytes() returned (%v, %v), want (0, io.ErrNoProgress)", n2, err) + } +} + +func TestReaderReset(t *testing.T) { + r := NewReader(strings.NewReader("foo foo")) + buf := make([]byte, 3) + r.Read(buf) + if string(buf) != "foo" { + t.Errorf("buf = %q; want foo", buf) + } + r.Reset(strings.NewReader("bar bar")) + all, err := ioutil.ReadAll(r) + if err != nil { + t.Fatal(err) + } + if string(all) != "bar bar" { + t.Errorf("ReadAll = %q; want bar bar", all) + } +} + +func TestWriterReset(t *testing.T) { + var buf1, buf2 bytes.Buffer + w := NewWriter(&buf1) + w.WriteString("foo") + w.Reset(&buf2) // and not flushed + w.WriteString("bar") + w.Flush() + if buf1.String() != "" { + t.Errorf("buf1 = %q; want empty", buf1.String()) + } + if buf2.String() != "bar" { + t.Errorf("buf2 = %q; want bar", buf2.String()) + } +} + +func TestReaderDiscard(t *testing.T) { + tests := []struct { + name string + r io.Reader + bufSize int // 0 means 16 + peekSize int + + n int // input to Discard + + want int // from Discard + wantErr error // from Discard + + wantBuffered int + }{ + { + name: "normal case", + r: strings.NewReader("abcdefghijklmnopqrstuvwxyz"), + peekSize: 16, + n: 6, + want: 6, + wantBuffered: 10, + }, + { + name: "discard causing read", + r: strings.NewReader("abcdefghijklmnopqrstuvwxyz"), + n: 6, + want: 6, + wantBuffered: 10, + }, + { + name: "discard all without peek", + r: strings.NewReader("abcdefghijklmnopqrstuvwxyz"), + n: 26, + want: 26, + wantBuffered: 0, + }, + { + name: "discard more than end", + r: strings.NewReader("abcdefghijklmnopqrstuvwxyz"), + n: 27, + want: 26, + wantErr: io.EOF, + wantBuffered: 0, + }, + // Any error from filling shouldn't show up until we + // get past the valid bytes. Here we return we return 5 valid bytes at the same time + // as an error, but test that we don't see the error from Discard. + { + name: "fill error, discard less", + r: newScriptedReader(func(p []byte) (n int, err error) { + if len(p) < 5 { + panic("unexpected small read") + } + return 5, errors.New("5-then-error") + }), + n: 4, + want: 4, + wantErr: nil, + wantBuffered: 1, + }, + { + name: "fill error, discard equal", + r: newScriptedReader(func(p []byte) (n int, err error) { + if len(p) < 5 { + panic("unexpected small read") + } + return 5, errors.New("5-then-error") + }), + n: 5, + want: 5, + wantErr: nil, + wantBuffered: 0, + }, + { + name: "fill error, discard more", + r: newScriptedReader(func(p []byte) (n int, err error) { + if len(p) < 5 { + panic("unexpected small read") + } + return 5, errors.New("5-then-error") + }), + n: 6, + want: 5, + wantErr: errors.New("5-then-error"), + wantBuffered: 0, + }, + // Discard of 0 shouldn't cause a read: + { + name: "discard zero", + r: newScriptedReader(), // will panic on Read + n: 0, + want: 0, + wantErr: nil, + wantBuffered: 0, + }, + { + name: "discard negative", + r: newScriptedReader(), // will panic on Read + n: -1, + want: 0, + wantErr: ErrNegativeCount, + wantBuffered: 0, + }, + } + for _, tt := range tests { + br := NewReaderSize(tt.r, tt.bufSize) + if tt.peekSize > 0 { + peekBuf, err := br.Peek(tt.peekSize) + if err != nil { + t.Errorf("%s: Peek(%d): %v", tt.name, tt.peekSize, err) + continue + } + if len(peekBuf) != tt.peekSize { + t.Errorf("%s: len(Peek(%d)) = %v; want %v", tt.name, tt.peekSize, len(peekBuf), tt.peekSize) + continue + } + } + discarded, err := br.Discard(tt.n) + if ge, we := fmt.Sprint(err), fmt.Sprint(tt.wantErr); discarded != tt.want || ge != we { + t.Errorf("%s: Discard(%d) = (%v, %v); want (%v, %v)", tt.name, tt.n, discarded, ge, tt.want, we) + continue + } + if bn := br.Buffered(); bn != tt.wantBuffered { + t.Errorf("%s: after Discard, Buffered = %d; want %d", tt.name, bn, tt.wantBuffered) + } + } + +} + +// An onlyReader only implements io.Reader, no matter what other methods the underlying implementation may have. +type onlyReader struct { + io.Reader +} + +// An onlyWriter only implements io.Writer, no matter what other methods the underlying implementation may have. +type onlyWriter struct { + io.Writer +} + +// A scriptedReader is an io.Reader that executes its steps sequentially. +type scriptedReader []func(p []byte) (n int, err error) + +func (sr *scriptedReader) Read(p []byte) (n int, err error) { + if len(*sr) == 0 { + panic("too many Read calls on scripted Reader. No steps remain.") + } + step := (*sr)[0] + *sr = (*sr)[1:] + return step(p) +} + +func newScriptedReader(steps ...func(p []byte) (n int, err error)) io.Reader { + sr := scriptedReader(steps) + return &sr +} + +func BenchmarkReaderCopyOptimal(b *testing.B) { + // Optimal case is where the underlying reader implements io.WriterTo + srcBuf := bytes.NewBuffer(make([]byte, 8192)) + src := NewReader(srcBuf) + dstBuf := new(bytes.Buffer) + dst := onlyWriter{dstBuf} + for i := 0; i < b.N; i++ { + srcBuf.Reset() + src.Reset(srcBuf) + dstBuf.Reset() + io.Copy(dst, src) + } +} + +func BenchmarkReaderCopyUnoptimal(b *testing.B) { + // Unoptimal case is where the underlying reader doesn't implement io.WriterTo + srcBuf := bytes.NewBuffer(make([]byte, 8192)) + src := NewReader(onlyReader{srcBuf}) + dstBuf := new(bytes.Buffer) + dst := onlyWriter{dstBuf} + for i := 0; i < b.N; i++ { + srcBuf.Reset() + src.Reset(onlyReader{srcBuf}) + dstBuf.Reset() + io.Copy(dst, src) + } +} + +func BenchmarkReaderCopyNoWriteTo(b *testing.B) { + srcBuf := bytes.NewBuffer(make([]byte, 8192)) + srcReader := NewReader(srcBuf) + src := onlyReader{srcReader} + dstBuf := new(bytes.Buffer) + dst := onlyWriter{dstBuf} + for i := 0; i < b.N; i++ { + srcBuf.Reset() + srcReader.Reset(srcBuf) + dstBuf.Reset() + io.Copy(dst, src) + } +} + +func BenchmarkReaderWriteToOptimal(b *testing.B) { + const bufSize = 16 << 10 + buf := make([]byte, bufSize) + r := bytes.NewReader(buf) + srcReader := NewReaderSize(onlyReader{r}, 1<<10) + if _, ok := ioutil.Discard.(io.ReaderFrom); !ok { + b.Fatal("ioutil.Discard doesn't support ReaderFrom") + } + for i := 0; i < b.N; i++ { + r.Seek(0, 0) + srcReader.Reset(onlyReader{r}) + n, err := srcReader.WriteTo(ioutil.Discard) + if err != nil { + b.Fatal(err) + } + if n != bufSize { + b.Fatalf("n = %d; want %d", n, bufSize) + } + } +} + +func BenchmarkWriterCopyOptimal(b *testing.B) { + // Optimal case is where the underlying writer implements io.ReaderFrom + srcBuf := bytes.NewBuffer(make([]byte, 8192)) + src := onlyReader{srcBuf} + dstBuf := new(bytes.Buffer) + dst := NewWriter(dstBuf) + for i := 0; i < b.N; i++ { + srcBuf.Reset() + dstBuf.Reset() + dst.Reset(dstBuf) + io.Copy(dst, src) + } +} + +func BenchmarkWriterCopyUnoptimal(b *testing.B) { + srcBuf := bytes.NewBuffer(make([]byte, 8192)) + src := onlyReader{srcBuf} + dstBuf := new(bytes.Buffer) + dst := NewWriter(onlyWriter{dstBuf}) + for i := 0; i < b.N; i++ { + srcBuf.Reset() + dstBuf.Reset() + dst.Reset(onlyWriter{dstBuf}) + io.Copy(dst, src) + } +} + +func BenchmarkWriterCopyNoReadFrom(b *testing.B) { + srcBuf := bytes.NewBuffer(make([]byte, 8192)) + src := onlyReader{srcBuf} + dstBuf := new(bytes.Buffer) + dstWriter := NewWriter(dstBuf) + dst := onlyWriter{dstWriter} + for i := 0; i < b.N; i++ { + srcBuf.Reset() + dstBuf.Reset() + dstWriter.Reset(dstBuf) + io.Copy(dst, src) + } +} + +func BenchmarkReaderEmpty(b *testing.B) { + b.ReportAllocs() + str := strings.Repeat("x", 16<<10) + for i := 0; i < b.N; i++ { + br := NewReader(strings.NewReader(str)) + n, err := io.Copy(ioutil.Discard, br) + if err != nil { + b.Fatal(err) + } + if n != int64(len(str)) { + b.Fatal("wrong length") + } + } +} + +func BenchmarkWriterEmpty(b *testing.B) { + b.ReportAllocs() + str := strings.Repeat("x", 1<<10) + bs := []byte(str) + for i := 0; i < b.N; i++ { + bw := NewWriter(ioutil.Discard) + bw.Flush() + bw.WriteByte('a') + bw.Flush() + bw.WriteRune('B') + bw.Flush() + bw.Write(bs) + bw.Flush() + bw.WriteString(str) + bw.Flush() + } +} + +func BenchmarkWriterFlush(b *testing.B) { + b.ReportAllocs() + bw := NewWriter(ioutil.Discard) + str := strings.Repeat("x", 50) + for i := 0; i < b.N; i++ { + bw.WriteString(str) + bw.Flush() + } +} diff --git a/src/bufio/example_test.go b/src/bufio/example_test.go new file mode 100644 index 0000000000000000000000000000000000000000..3da914142194895ea37e660c621d3835fb251a86 --- /dev/null +++ b/src/bufio/example_test.go @@ -0,0 +1,82 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package bufio_test + +import ( + "bufio" + "fmt" + "os" + "strconv" + "strings" +) + +func ExampleWriter() { + w := bufio.NewWriter(os.Stdout) + fmt.Fprint(w, "Hello, ") + fmt.Fprint(w, "world!") + w.Flush() // Don't forget to flush! + // Output: Hello, world! +} + +// The simplest use of a Scanner, to read standard input as a set of lines. +func ExampleScanner_lines() { + scanner := bufio.NewScanner(os.Stdin) + for scanner.Scan() { + fmt.Println(scanner.Text()) // Println will add back the final '\n' + } + if err := scanner.Err(); err != nil { + fmt.Fprintln(os.Stderr, "reading standard input:", err) + } +} + +// Use a Scanner to implement a simple word-count utility by scanning the +// input as a sequence of space-delimited tokens. +func ExampleScanner_words() { + // An artificial input source. + const input = "Now is the winter of our discontent,\nMade glorious summer by this sun of York.\n" + scanner := bufio.NewScanner(strings.NewReader(input)) + // Set the split function for the scanning operation. + scanner.Split(bufio.ScanWords) + // Count the words. + count := 0 + for scanner.Scan() { + count++ + } + if err := scanner.Err(); err != nil { + fmt.Fprintln(os.Stderr, "reading input:", err) + } + fmt.Printf("%d\n", count) + // Output: 15 +} + +// Use a Scanner with a custom split function (built by wrapping ScanWords) to validate +// 32-bit decimal input. +func ExampleScanner_custom() { + // An artificial input source. + const input = "1234 5678 1234567901234567890" + scanner := bufio.NewScanner(strings.NewReader(input)) + // Create a custom split function by wrapping the existing ScanWords function. + split := func(data []byte, atEOF bool) (advance int, token []byte, err error) { + advance, token, err = bufio.ScanWords(data, atEOF) + if err == nil && token != nil { + _, err = strconv.ParseInt(string(token), 10, 32) + } + return + } + // Set the split function for the scanning operation. + scanner.Split(split) + // Validate the input + for scanner.Scan() { + fmt.Printf("%s\n", scanner.Text()) + } + + if err := scanner.Err(); err != nil { + fmt.Printf("Invalid input: %s", err) + } + // Output: + // 1234 + // 5678 + // Invalid input: strconv.ParseInt: parsing "1234567901234567890": value out of range +} diff --git a/src/bufio/export_test.go b/src/bufio/export_test.go new file mode 100644 index 0000000000000000000000000000000000000000..3d3bb27d8da51b72e343579b1e54b115b3becb9a --- /dev/null +++ b/src/bufio/export_test.go @@ -0,0 +1,27 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package bufio + +// Exported for testing only. +import ( + "unicode/utf8" +) + +var IsSpace = isSpace + +func (s *Scanner) MaxTokenSize(n int) { + if n < utf8.UTFMax || n > 1e9 { + panic("bad max token size") + } + if n < len(s.buf) { + s.buf = make([]byte, n) + } + s.maxTokenSize = n +} + +// ErrOrEOF is like Err, but returns EOF. Used to test a corner case. +func (s *Scanner) ErrOrEOF() error { + return s.err +} diff --git a/src/bufio/scan.go b/src/bufio/scan.go new file mode 100644 index 0000000000000000000000000000000000000000..7a349fa8fab7e5d0a7dc37c12af4cb8279b2a612 --- /dev/null +++ b/src/bufio/scan.go @@ -0,0 +1,359 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package bufio + +import ( + "bytes" + "errors" + "io" + "unicode/utf8" +) + +// Scanner provides a convenient interface for reading data such as +// a file of newline-delimited lines of text. Successive calls to +// the Scan method will step through the 'tokens' of a file, skipping +// the bytes between the tokens. The specification of a token is +// defined by a split function of type SplitFunc; the default split +// function breaks the input into lines with line termination stripped. Split +// functions are defined in this package for scanning a file into +// lines, bytes, UTF-8-encoded runes, and space-delimited words. The +// client may instead provide a custom split function. +// +// Scanning stops unrecoverably at EOF, the first I/O error, or a token too +// large to fit in the buffer. When a scan stops, the reader may have +// advanced arbitrarily far past the last token. Programs that need more +// control over error handling or large tokens, or must run sequential scans +// on a reader, should use bufio.Reader instead. +// +type Scanner struct { + r io.Reader // The reader provided by the client. + split SplitFunc // The function to split the tokens. + maxTokenSize int // Maximum size of a token; modified by tests. + token []byte // Last token returned by split. + buf []byte // Buffer used as argument to split. + start int // First non-processed byte in buf. + end int // End of data in buf. + err error // Sticky error. + empties int // Count of successive empty tokens. +} + +// SplitFunc is the signature of the split function used to tokenize the +// input. The arguments are an initial substring of the remaining unprocessed +// data and a flag, atEOF, that reports whether the Reader has no more data +// to give. The return values are the number of bytes to advance the input +// and the next token to return to the user, plus an error, if any. If the +// data does not yet hold a complete token, for instance if it has no newline +// while scanning lines, SplitFunc can return (0, nil, nil) to signal the +// Scanner to read more data into the slice and try again with a longer slice +// starting at the same point in the input. +// +// If the returned error is non-nil, scanning stops and the error +// is returned to the client. +// +// The function is never called with an empty data slice unless atEOF +// is true. If atEOF is true, however, data may be non-empty and, +// as always, holds unprocessed text. +type SplitFunc func(data []byte, atEOF bool) (advance int, token []byte, err error) + +// Errors returned by Scanner. +var ( + ErrTooLong = errors.New("bufio.Scanner: token too long") + ErrNegativeAdvance = errors.New("bufio.Scanner: SplitFunc returns negative advance count") + ErrAdvanceTooFar = errors.New("bufio.Scanner: SplitFunc returns advance count beyond input") +) + +const ( + // MaxScanTokenSize is the maximum size used to buffer a token. + // The actual maximum token size may be smaller as the buffer + // may need to include, for instance, a newline. + MaxScanTokenSize = 64 * 1024 +) + +// NewScanner returns a new Scanner to read from r. +// The split function defaults to ScanLines. +func NewScanner(r io.Reader) *Scanner { + return &Scanner{ + r: r, + split: ScanLines, + maxTokenSize: MaxScanTokenSize, + buf: make([]byte, 4096), // Plausible starting size; needn't be large. + } +} + +// Err returns the first non-EOF error that was encountered by the Scanner. +func (s *Scanner) Err() error { + if s.err == io.EOF { + return nil + } + return s.err +} + +// Bytes returns the most recent token generated by a call to Scan. +// The underlying array may point to data that will be overwritten +// by a subsequent call to Scan. It does no allocation. +func (s *Scanner) Bytes() []byte { + return s.token +} + +// Text returns the most recent token generated by a call to Scan +// as a newly allocated string holding its bytes. +func (s *Scanner) Text() string { + return string(s.token) +} + +// Scan advances the Scanner to the next token, which will then be +// available through the Bytes or Text method. It returns false when the +// scan stops, either by reaching the end of the input or an error. +// After Scan returns false, the Err method will return any error that +// occurred during scanning, except that if it was io.EOF, Err +// will return nil. +// Scan panics if the split function returns 100 empty tokens without +// advancing the input. This is a common error mode for scanners. +func (s *Scanner) Scan() bool { + // Loop until we have a token. + for { + // See if we can get a token with what we already have. + // If we've run out of data but have an error, give the split function + // a chance to recover any remaining, possibly empty token. + if s.end > s.start || s.err != nil { + advance, token, err := s.split(s.buf[s.start:s.end], s.err != nil) + if err != nil { + s.setErr(err) + return false + } + if !s.advance(advance) { + return false + } + s.token = token + if token != nil { + if s.err == nil || advance > 0 { + s.empties = 0 + } else { + // Returning tokens not advancing input at EOF. + s.empties++ + if s.empties > 100 { + panic("bufio.Scan: 100 empty tokens without progressing") + } + } + return true + } + } + // We cannot generate a token with what we are holding. + // If we've already hit EOF or an I/O error, we are done. + if s.err != nil { + // Shut it down. + s.start = 0 + s.end = 0 + return false + } + // Must read more data. + // First, shift data to beginning of buffer if there's lots of empty space + // or space is needed. + if s.start > 0 && (s.end == len(s.buf) || s.start > len(s.buf)/2) { + copy(s.buf, s.buf[s.start:s.end]) + s.end -= s.start + s.start = 0 + } + // Is the buffer full? If so, resize. + if s.end == len(s.buf) { + if len(s.buf) >= s.maxTokenSize { + s.setErr(ErrTooLong) + return false + } + newSize := len(s.buf) * 2 + if newSize > s.maxTokenSize { + newSize = s.maxTokenSize + } + newBuf := make([]byte, newSize) + copy(newBuf, s.buf[s.start:s.end]) + s.buf = newBuf + s.end -= s.start + s.start = 0 + continue + } + // Finally we can read some input. Make sure we don't get stuck with + // a misbehaving Reader. Officially we don't need to do this, but let's + // be extra careful: Scanner is for safe, simple jobs. + for loop := 0; ; { + n, err := s.r.Read(s.buf[s.end:len(s.buf)]) + s.end += n + if err != nil { + s.setErr(err) + break + } + if n > 0 { + s.empties = 0 + break + } + loop++ + if loop > maxConsecutiveEmptyReads { + s.setErr(io.ErrNoProgress) + break + } + } + } +} + +// advance consumes n bytes of the buffer. It reports whether the advance was legal. +func (s *Scanner) advance(n int) bool { + if n < 0 { + s.setErr(ErrNegativeAdvance) + return false + } + if n > s.end-s.start { + s.setErr(ErrAdvanceTooFar) + return false + } + s.start += n + return true +} + +// setErr records the first error encountered. +func (s *Scanner) setErr(err error) { + if s.err == nil || s.err == io.EOF { + s.err = err + } +} + +// Split sets the split function for the Scanner. If called, it must be +// called before Scan. The default split function is ScanLines. +func (s *Scanner) Split(split SplitFunc) { + s.split = split +} + +// Split functions + +// ScanBytes is a split function for a Scanner that returns each byte as a token. +func ScanBytes(data []byte, atEOF bool) (advance int, token []byte, err error) { + if atEOF && len(data) == 0 { + return 0, nil, nil + } + return 1, data[0:1], nil +} + +var errorRune = []byte(string(utf8.RuneError)) + +// ScanRunes is a split function for a Scanner that returns each +// UTF-8-encoded rune as a token. The sequence of runes returned is +// equivalent to that from a range loop over the input as a string, which +// means that erroneous UTF-8 encodings translate to U+FFFD = "\xef\xbf\xbd". +// Because of the Scan interface, this makes it impossible for the client to +// distinguish correctly encoded replacement runes from encoding errors. +func ScanRunes(data []byte, atEOF bool) (advance int, token []byte, err error) { + if atEOF && len(data) == 0 { + return 0, nil, nil + } + + // Fast path 1: ASCII. + if data[0] < utf8.RuneSelf { + return 1, data[0:1], nil + } + + // Fast path 2: Correct UTF-8 decode without error. + _, width := utf8.DecodeRune(data) + if width > 1 { + // It's a valid encoding. Width cannot be one for a correctly encoded + // non-ASCII rune. + return width, data[0:width], nil + } + + // We know it's an error: we have width==1 and implicitly r==utf8.RuneError. + // Is the error because there wasn't a full rune to be decoded? + // FullRune distinguishes correctly between erroneous and incomplete encodings. + if !atEOF && !utf8.FullRune(data) { + // Incomplete; get more bytes. + return 0, nil, nil + } + + // We have a real UTF-8 encoding error. Return a properly encoded error rune + // but advance only one byte. This matches the behavior of a range loop over + // an incorrectly encoded string. + return 1, errorRune, nil +} + +// dropCR drops a terminal \r from the data. +func dropCR(data []byte) []byte { + if len(data) > 0 && data[len(data)-1] == '\r' { + return data[0 : len(data)-1] + } + return data +} + +// ScanLines is a split function for a Scanner that returns each line of +// text, stripped of any trailing end-of-line marker. The returned line may +// be empty. The end-of-line marker is one optional carriage return followed +// by one mandatory newline. In regular expression notation, it is `\r?\n`. +// The last non-empty line of input will be returned even if it has no +// newline. +func ScanLines(data []byte, atEOF bool) (advance int, token []byte, err error) { + if atEOF && len(data) == 0 { + return 0, nil, nil + } + if i := bytes.IndexByte(data, '\n'); i >= 0 { + // We have a full newline-terminated line. + return i + 1, dropCR(data[0:i]), nil + } + // If we're at EOF, we have a final, non-terminated line. Return it. + if atEOF { + return len(data), dropCR(data), nil + } + // Request more data. + return 0, nil, nil +} + +// isSpace reports whether the character is a Unicode white space character. +// We avoid dependency on the unicode package, but check validity of the implementation +// in the tests. +func isSpace(r rune) bool { + if r <= '\u00FF' { + // Obvious ASCII ones: \t through \r plus space. Plus two Latin-1 oddballs. + switch r { + case ' ', '\t', '\n', '\v', '\f', '\r': + return true + case '\u0085', '\u00A0': + return true + } + return false + } + // High-valued ones. + if '\u2000' <= r && r <= '\u200a' { + return true + } + switch r { + case '\u1680', '\u2028', '\u2029', '\u202f', '\u205f', '\u3000': + return true + } + return false +} + +// ScanWords is a split function for a Scanner that returns each +// space-separated word of text, with surrounding spaces deleted. It will +// never return an empty string. The definition of space is set by +// unicode.IsSpace. +func ScanWords(data []byte, atEOF bool) (advance int, token []byte, err error) { + // Skip leading spaces. + start := 0 + for width := 0; start < len(data); start += width { + var r rune + r, width = utf8.DecodeRune(data[start:]) + if !isSpace(r) { + break + } + } + // Scan until space, marking end of word. + for width, i := 0, start; i < len(data); i += width { + var r rune + r, width = utf8.DecodeRune(data[i:]) + if isSpace(r) { + return i + width, data[start:i], nil + } + } + // If we're at EOF, we have a final, non-empty, non-terminated word. Return it. + if atEOF && len(data) > start { + return len(data), data[start:], nil + } + // Request more data. + return start, nil, nil +} diff --git a/src/bufio/scan_test.go b/src/bufio/scan_test.go new file mode 100644 index 0000000000000000000000000000000000000000..eea87cbf7b39de26059bb7f1dd673b37820d868e --- /dev/null +++ b/src/bufio/scan_test.go @@ -0,0 +1,524 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package bufio_test + +import ( + . "bufio" + "bytes" + "errors" + "io" + "strings" + "testing" + "unicode" + "unicode/utf8" +) + +const smallMaxTokenSize = 256 // Much smaller for more efficient testing. + +// Test white space table matches the Unicode definition. +func TestSpace(t *testing.T) { + for r := rune(0); r <= utf8.MaxRune; r++ { + if IsSpace(r) != unicode.IsSpace(r) { + t.Fatalf("white space property disagrees: %#U should be %t", r, unicode.IsSpace(r)) + } + } +} + +var scanTests = []string{ + "", + "a", + "¼", + "☹", + "\x81", // UTF-8 error + "\uFFFD", // correctly encoded RuneError + "abcdefgh", + "abc def\n\t\tgh ", + "abc¼☹\x81\uFFFD日本語\x82abc", +} + +func TestScanByte(t *testing.T) { + for n, test := range scanTests { + buf := strings.NewReader(test) + s := NewScanner(buf) + s.Split(ScanBytes) + var i int + for i = 0; s.Scan(); i++ { + if b := s.Bytes(); len(b) != 1 || b[0] != test[i] { + t.Errorf("#%d: %d: expected %q got %q", n, i, test, b) + } + } + if i != len(test) { + t.Errorf("#%d: termination expected at %d; got %d", n, len(test), i) + } + err := s.Err() + if err != nil { + t.Errorf("#%d: %v", n, err) + } + } +} + +// Test that the rune splitter returns same sequence of runes (not bytes) as for range string. +func TestScanRune(t *testing.T) { + for n, test := range scanTests { + buf := strings.NewReader(test) + s := NewScanner(buf) + s.Split(ScanRunes) + var i, runeCount int + var expect rune + // Use a string range loop to validate the sequence of runes. + for i, expect = range string(test) { + if !s.Scan() { + break + } + runeCount++ + got, _ := utf8.DecodeRune(s.Bytes()) + if got != expect { + t.Errorf("#%d: %d: expected %q got %q", n, i, expect, got) + } + } + if s.Scan() { + t.Errorf("#%d: scan ran too long, got %q", n, s.Text()) + } + testRuneCount := utf8.RuneCountInString(test) + if runeCount != testRuneCount { + t.Errorf("#%d: termination expected at %d; got %d", n, testRuneCount, runeCount) + } + err := s.Err() + if err != nil { + t.Errorf("#%d: %v", n, err) + } + } +} + +var wordScanTests = []string{ + "", + " ", + "\n", + "a", + " a ", + "abc def", + " abc def ", + " abc\tdef\nghi\rjkl\fmno\vpqr\u0085stu\u00a0\n", +} + +// Test that the word splitter returns the same data as strings.Fields. +func TestScanWords(t *testing.T) { + for n, test := range wordScanTests { + buf := strings.NewReader(test) + s := NewScanner(buf) + s.Split(ScanWords) + words := strings.Fields(test) + var wordCount int + for wordCount = 0; wordCount < len(words); wordCount++ { + if !s.Scan() { + break + } + got := s.Text() + if got != words[wordCount] { + t.Errorf("#%d: %d: expected %q got %q", n, wordCount, words[wordCount], got) + } + } + if s.Scan() { + t.Errorf("#%d: scan ran too long, got %q", n, s.Text()) + } + if wordCount != len(words) { + t.Errorf("#%d: termination expected at %d; got %d", n, len(words), wordCount) + } + err := s.Err() + if err != nil { + t.Errorf("#%d: %v", n, err) + } + } +} + +// slowReader is a reader that returns only a few bytes at a time, to test the incremental +// reads in Scanner.Scan. +type slowReader struct { + max int + buf io.Reader +} + +func (sr *slowReader) Read(p []byte) (n int, err error) { + if len(p) > sr.max { + p = p[0:sr.max] + } + return sr.buf.Read(p) +} + +// genLine writes to buf a predictable but non-trivial line of text of length +// n, including the terminal newline and an occasional carriage return. +// If addNewline is false, the \r and \n are not emitted. +func genLine(buf *bytes.Buffer, lineNum, n int, addNewline bool) { + buf.Reset() + doCR := lineNum%5 == 0 + if doCR { + n-- + } + for i := 0; i < n-1; i++ { // Stop early for \n. + c := 'a' + byte(lineNum+i) + if c == '\n' || c == '\r' { // Don't confuse us. + c = 'N' + } + buf.WriteByte(c) + } + if addNewline { + if doCR { + buf.WriteByte('\r') + } + buf.WriteByte('\n') + } + return +} + +// Test the line splitter, including some carriage returns but no long lines. +func TestScanLongLines(t *testing.T) { + // Build a buffer of lots of line lengths up to but not exceeding smallMaxTokenSize. + tmp := new(bytes.Buffer) + buf := new(bytes.Buffer) + lineNum := 0 + j := 0 + for i := 0; i < 2*smallMaxTokenSize; i++ { + genLine(tmp, lineNum, j, true) + if j < smallMaxTokenSize { + j++ + } else { + j-- + } + buf.Write(tmp.Bytes()) + lineNum++ + } + s := NewScanner(&slowReader{1, buf}) + s.Split(ScanLines) + s.MaxTokenSize(smallMaxTokenSize) + j = 0 + for lineNum := 0; s.Scan(); lineNum++ { + genLine(tmp, lineNum, j, false) + if j < smallMaxTokenSize { + j++ + } else { + j-- + } + line := tmp.String() // We use the string-valued token here, for variety. + if s.Text() != line { + t.Errorf("%d: bad line: %d %d\n%.100q\n%.100q\n", lineNum, len(s.Bytes()), len(line), s.Text(), line) + } + } + err := s.Err() + if err != nil { + t.Fatal(err) + } +} + +// Test that the line splitter errors out on a long line. +func TestScanLineTooLong(t *testing.T) { + const smallMaxTokenSize = 256 // Much smaller for more efficient testing. + // Build a buffer of lots of line lengths up to but not exceeding smallMaxTokenSize. + tmp := new(bytes.Buffer) + buf := new(bytes.Buffer) + lineNum := 0 + j := 0 + for i := 0; i < 2*smallMaxTokenSize; i++ { + genLine(tmp, lineNum, j, true) + j++ + buf.Write(tmp.Bytes()) + lineNum++ + } + s := NewScanner(&slowReader{3, buf}) + s.Split(ScanLines) + s.MaxTokenSize(smallMaxTokenSize) + j = 0 + for lineNum := 0; s.Scan(); lineNum++ { + genLine(tmp, lineNum, j, false) + if j < smallMaxTokenSize { + j++ + } else { + j-- + } + line := tmp.Bytes() + if !bytes.Equal(s.Bytes(), line) { + t.Errorf("%d: bad line: %d %d\n%.100q\n%.100q\n", lineNum, len(s.Bytes()), len(line), s.Bytes(), line) + } + } + err := s.Err() + if err != ErrTooLong { + t.Fatalf("expected ErrTooLong; got %s", err) + } +} + +// Test that the line splitter handles a final line without a newline. +func testNoNewline(text string, lines []string, t *testing.T) { + buf := strings.NewReader(text) + s := NewScanner(&slowReader{7, buf}) + s.Split(ScanLines) + for lineNum := 0; s.Scan(); lineNum++ { + line := lines[lineNum] + if s.Text() != line { + t.Errorf("%d: bad line: %d %d\n%.100q\n%.100q\n", lineNum, len(s.Bytes()), len(line), s.Bytes(), line) + } + } + err := s.Err() + if err != nil { + t.Fatal(err) + } +} + +var noNewlineLines = []string{ + "abcdefghijklmn\nopqrstuvwxyz", +} + +// Test that the line splitter handles a final line without a newline. +func TestScanLineNoNewline(t *testing.T) { + const text = "abcdefghijklmn\nopqrstuvwxyz" + lines := []string{ + "abcdefghijklmn", + "opqrstuvwxyz", + } + testNoNewline(text, lines, t) +} + +// Test that the line splitter handles a final line with a carriage return but no newline. +func TestScanLineReturnButNoNewline(t *testing.T) { + const text = "abcdefghijklmn\nopqrstuvwxyz\r" + lines := []string{ + "abcdefghijklmn", + "opqrstuvwxyz", + } + testNoNewline(text, lines, t) +} + +// Test that the line splitter handles a final empty line. +func TestScanLineEmptyFinalLine(t *testing.T) { + const text = "abcdefghijklmn\nopqrstuvwxyz\n\n" + lines := []string{ + "abcdefghijklmn", + "opqrstuvwxyz", + "", + } + testNoNewline(text, lines, t) +} + +// Test that the line splitter handles a final empty line with a carriage return but no newline. +func TestScanLineEmptyFinalLineWithCR(t *testing.T) { + const text = "abcdefghijklmn\nopqrstuvwxyz\n\r" + lines := []string{ + "abcdefghijklmn", + "opqrstuvwxyz", + "", + } + testNoNewline(text, lines, t) +} + +var testError = errors.New("testError") + +// Test the correct error is returned when the split function errors out. +func TestSplitError(t *testing.T) { + // Create a split function that delivers a little data, then a predictable error. + numSplits := 0 + const okCount = 7 + errorSplit := func(data []byte, atEOF bool) (advance int, token []byte, err error) { + if atEOF { + panic("didn't get enough data") + } + if numSplits >= okCount { + return 0, nil, testError + } + numSplits++ + return 1, data[0:1], nil + } + // Read the data. + const text = "abcdefghijklmnopqrstuvwxyz" + buf := strings.NewReader(text) + s := NewScanner(&slowReader{1, buf}) + s.Split(errorSplit) + var i int + for i = 0; s.Scan(); i++ { + if len(s.Bytes()) != 1 || text[i] != s.Bytes()[0] { + t.Errorf("#%d: expected %q got %q", i, text[i], s.Bytes()[0]) + } + } + // Check correct termination location and error. + if i != okCount { + t.Errorf("unexpected termination; expected %d tokens got %d", okCount, i) + } + err := s.Err() + if err != testError { + t.Fatalf("expected %q got %v", testError, err) + } +} + +// Test that an EOF is overridden by a user-generated scan error. +func TestErrAtEOF(t *testing.T) { + s := NewScanner(strings.NewReader("1 2 33")) + // This spitter will fail on last entry, after s.err==EOF. + split := func(data []byte, atEOF bool) (advance int, token []byte, err error) { + advance, token, err = ScanWords(data, atEOF) + if len(token) > 1 { + if s.ErrOrEOF() != io.EOF { + t.Fatal("not testing EOF") + } + err = testError + } + return + } + s.Split(split) + for s.Scan() { + } + if s.Err() != testError { + t.Fatal("wrong error:", s.Err()) + } +} + +// Test for issue 5268. +type alwaysError struct{} + +func (alwaysError) Read(p []byte) (int, error) { + return 0, io.ErrUnexpectedEOF +} + +func TestNonEOFWithEmptyRead(t *testing.T) { + scanner := NewScanner(alwaysError{}) + for scanner.Scan() { + t.Fatal("read should fail") + } + err := scanner.Err() + if err != io.ErrUnexpectedEOF { + t.Errorf("unexpected error: %v", err) + } +} + +// Test that Scan finishes if we have endless empty reads. +type endlessZeros struct{} + +func (endlessZeros) Read(p []byte) (int, error) { + return 0, nil +} + +func TestBadReader(t *testing.T) { + scanner := NewScanner(endlessZeros{}) + for scanner.Scan() { + t.Fatal("read should fail") + } + err := scanner.Err() + if err != io.ErrNoProgress { + t.Errorf("unexpected error: %v", err) + } +} + +func TestScanWordsExcessiveWhiteSpace(t *testing.T) { + const word = "ipsum" + s := strings.Repeat(" ", 4*smallMaxTokenSize) + word + scanner := NewScanner(strings.NewReader(s)) + scanner.MaxTokenSize(smallMaxTokenSize) + scanner.Split(ScanWords) + if !scanner.Scan() { + t.Fatalf("scan failed: %v", scanner.Err()) + } + if token := scanner.Text(); token != word { + t.Fatalf("unexpected token: %v", token) + } +} + +// Test that empty tokens, including at end of line or end of file, are found by the scanner. +// Issue 8672: Could miss final empty token. + +func commaSplit(data []byte, atEOF bool) (advance int, token []byte, err error) { + for i := 0; i < len(data); i++ { + if data[i] == ',' { + return i + 1, data[:i], nil + } + } + if !atEOF { + return 0, nil, nil + } + return 0, data, nil +} + +func TestEmptyTokens(t *testing.T) { + s := NewScanner(strings.NewReader("1,2,3,")) + values := []string{"1", "2", "3", ""} + s.Split(commaSplit) + var i int + for i = 0; i < len(values); i++ { + if !s.Scan() { + break + } + if s.Text() != values[i] { + t.Errorf("%d: expected %q got %q", i, values[i], s.Text()) + } + } + if i != len(values) { + t.Errorf("got %d fields, expected %d", i, len(values)) + } + if err := s.Err(); err != nil { + t.Fatal(err) + } +} + +func loopAtEOFSplit(data []byte, atEOF bool) (advance int, token []byte, err error) { + if len(data) > 0 { + return 1, data[:1], nil + } + return 0, data, nil +} + +func TestDontLoopForever(t *testing.T) { + s := NewScanner(strings.NewReader("abc")) + s.Split(loopAtEOFSplit) + // Expect a panic + defer func() { + err := recover() + if err == nil { + t.Fatal("should have panicked") + } + if msg, ok := err.(string); !ok || !strings.Contains(msg, "empty tokens") { + panic(err) + } + }() + for count := 0; s.Scan(); count++ { + if count > 1000 { + t.Fatal("looping") + } + } + if s.Err() != nil { + t.Fatal("after scan:", s.Err()) + } +} + +func TestBlankLines(t *testing.T) { + s := NewScanner(strings.NewReader(strings.Repeat("\n", 1000))) + for count := 0; s.Scan(); count++ { + if count > 2000 { + t.Fatal("looping") + } + } + if s.Err() != nil { + t.Fatal("after scan:", s.Err()) + } +} + +type countdown int + +func (c *countdown) split(data []byte, atEOF bool) (advance int, token []byte, err error) { + if *c > 0 { + *c-- + return 1, data[:1], nil + } + return 0, nil, nil +} + +// Check that the looping-at-EOF check doesn't trigger for merely empty tokens. +func TestEmptyLinesOK(t *testing.T) { + c := countdown(10000) + s := NewScanner(strings.NewReader(strings.Repeat("\n", 10000))) + s.Split(c.split) + for s.Scan() { + } + if s.Err() != nil { + t.Fatal("after scan:", s.Err()) + } + if c != 0 { + t.Fatalf("stopped with %d left to process", c) + } +} diff --git a/src/buildall.bash b/src/buildall.bash new file mode 100755 index 0000000000000000000000000000000000000000..ba23d31a50c5e29120093985bae6671d638014f5 --- /dev/null +++ b/src/buildall.bash @@ -0,0 +1,70 @@ +#!/usr/bin/env bash +# Copyright 2015 The Go Authors. All rights reserved. +# Use of this source code is governed by a BSD-style +# license that can be found in the LICENSE file. + +# Usage: buildall.sh [-e] [pattern] +# +# buildall.bash builds the standard library for all Go-supported +# architectures. It is used by the "all-compile" trybot builder, +# as a smoke test to quickly flag portability issues. +# +# Options: +# -e: stop at first failure + +if [ ! -f run.bash ]; then + echo 'buildall.bash must be run from $GOROOT/src' 1>&2 + exit 1 +fi + +sete=false +if [ "$1" = "-e" ]; then + sete=true + shift +fi + +if [ "$sete" = true ]; then + set -e +fi + +pattern="$1" +if [ "$pattern" = "" ]; then + pattern=. +fi + +# put linux, nacl first in the target list to get all the architectures up front. +targets="$((ls runtime | sed -n 's/^rt0_\(.*\)_\(.*\)\.s/\1-\2/p'; echo linux-386-387 linux-arm-arm5) | sort | egrep -v android-arm | egrep "$pattern" | egrep 'linux|nacl') +$(ls runtime | sed -n 's/^rt0_\(.*\)_\(.*\)\.s/\1-\2/p' | egrep -v 'android-arm|darwin-arm' | egrep "$pattern" | egrep -v 'linux|nacl')" + +./make.bash || exit 1 +GOROOT="$(cd .. && pwd)" + +failed=false +for target in $targets +do + echo "" + echo "### Building $target" + export GOOS=$(echo $target | sed 's/-.*//') + export GOARCH=$(echo $target | sed 's/.*-//') + unset GO386 GOARM + if [ "$GOARCH" = "arm5" ]; then + export GOARCH=arm + export GOARM=5 + fi + if [ "$GOARCH" = "387" ]; then + export GOARCH=386 + export GO386=387 + fi + if ! "$GOROOT/bin/go" build -a std cmd; then + failed=true + if $sete; then + exit 1 + fi + fi +done + +if [ "$failed" = "true" ]; then + echo "" 1>&2 + echo "Build(s) failed." 1>&2 + exit 1 +fi diff --git a/src/builtin/builtin.go b/src/builtin/builtin.go new file mode 100644 index 0000000000000000000000000000000000000000..d63ad22c32d46d7fbf68702c7d08113a6830a328 --- /dev/null +++ b/src/builtin/builtin.go @@ -0,0 +1,256 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +/* + Package builtin provides documentation for Go's predeclared identifiers. + The items documented here are not actually in package builtin + but their descriptions here allow godoc to present documentation + for the language's special identifiers. +*/ +package builtin + +// bool is the set of boolean values, true and false. +type bool bool + +// true and false are the two untyped boolean values. +const ( + true = 0 == 0 // Untyped bool. + false = 0 != 0 // Untyped bool. +) + +// uint8 is the set of all unsigned 8-bit integers. +// Range: 0 through 255. +type uint8 uint8 + +// uint16 is the set of all unsigned 16-bit integers. +// Range: 0 through 65535. +type uint16 uint16 + +// uint32 is the set of all unsigned 32-bit integers. +// Range: 0 through 4294967295. +type uint32 uint32 + +// uint64 is the set of all unsigned 64-bit integers. +// Range: 0 through 18446744073709551615. +type uint64 uint64 + +// int8 is the set of all signed 8-bit integers. +// Range: -128 through 127. +type int8 int8 + +// int16 is the set of all signed 16-bit integers. +// Range: -32768 through 32767. +type int16 int16 + +// int32 is the set of all signed 32-bit integers. +// Range: -2147483648 through 2147483647. +type int32 int32 + +// int64 is the set of all signed 64-bit integers. +// Range: -9223372036854775808 through 9223372036854775807. +type int64 int64 + +// float32 is the set of all IEEE-754 32-bit floating-point numbers. +type float32 float32 + +// float64 is the set of all IEEE-754 64-bit floating-point numbers. +type float64 float64 + +// complex64 is the set of all complex numbers with float32 real and +// imaginary parts. +type complex64 complex64 + +// complex128 is the set of all complex numbers with float64 real and +// imaginary parts. +type complex128 complex128 + +// string is the set of all strings of 8-bit bytes, conventionally but not +// necessarily representing UTF-8-encoded text. A string may be empty, but +// not nil. Values of string type are immutable. +type string string + +// int is a signed integer type that is at least 32 bits in size. It is a +// distinct type, however, and not an alias for, say, int32. +type int int + +// uint is an unsigned integer type that is at least 32 bits in size. It is a +// distinct type, however, and not an alias for, say, uint32. +type uint uint + +// uintptr is an integer type that is large enough to hold the bit pattern of +// any pointer. +type uintptr uintptr + +// byte is an alias for uint8 and is equivalent to uint8 in all ways. It is +// used, by convention, to distinguish byte values from 8-bit unsigned +// integer values. +type byte byte + +// rune is an alias for int32 and is equivalent to int32 in all ways. It is +// used, by convention, to distinguish character values from integer values. +type rune rune + +// iota is a predeclared identifier representing the untyped integer ordinal +// number of the current const specification in a (usually parenthesized) +// const declaration. It is zero-indexed. +const iota = 0 // Untyped int. + +// nil is a predeclared identifier representing the zero value for a +// pointer, channel, func, interface, map, or slice type. +var nil Type // Type must be a pointer, channel, func, interface, map, or slice type + +// Type is here for the purposes of documentation only. It is a stand-in +// for any Go type, but represents the same type for any given function +// invocation. +type Type int + +// Type1 is here for the purposes of documentation only. It is a stand-in +// for any Go type, but represents the same type for any given function +// invocation. +type Type1 int + +// IntegerType is here for the purposes of documentation only. It is a stand-in +// for any integer type: int, uint, int8 etc. +type IntegerType int + +// FloatType is here for the purposes of documentation only. It is a stand-in +// for either float type: float32 or float64. +type FloatType float32 + +// ComplexType is here for the purposes of documentation only. It is a +// stand-in for either complex type: complex64 or complex128. +type ComplexType complex64 + +// The append built-in function appends elements to the end of a slice. If +// it has sufficient capacity, the destination is resliced to accommodate the +// new elements. If it does not, a new underlying array will be allocated. +// Append returns the updated slice. It is therefore necessary to store the +// result of append, often in the variable holding the slice itself: +// slice = append(slice, elem1, elem2) +// slice = append(slice, anotherSlice...) +// As a special case, it is legal to append a string to a byte slice, like this: +// slice = append([]byte("hello "), "world"...) +func append(slice []Type, elems ...Type) []Type + +// The copy built-in function copies elements from a source slice into a +// destination slice. (As a special case, it also will copy bytes from a +// string to a slice of bytes.) The source and destination may overlap. Copy +// returns the number of elements copied, which will be the minimum of +// len(src) and len(dst). +func copy(dst, src []Type) int + +// The delete built-in function deletes the element with the specified key +// (m[key]) from the map. If m is nil or there is no such element, delete +// is a no-op. +func delete(m map[Type]Type1, key Type) + +// The len built-in function returns the length of v, according to its type: +// Array: the number of elements in v. +// Pointer to array: the number of elements in *v (even if v is nil). +// Slice, or map: the number of elements in v; if v is nil, len(v) is zero. +// String: the number of bytes in v. +// Channel: the number of elements queued (unread) in the channel buffer; +// if v is nil, len(v) is zero. +func len(v Type) int + +// The cap built-in function returns the capacity of v, according to its type: +// Array: the number of elements in v (same as len(v)). +// Pointer to array: the number of elements in *v (same as len(v)). +// Slice: the maximum length the slice can reach when resliced; +// if v is nil, cap(v) is zero. +// Channel: the channel buffer capacity, in units of elements; +// if v is nil, cap(v) is zero. +func cap(v Type) int + +// The make built-in function allocates and initializes an object of type +// slice, map, or chan (only). Like new, the first argument is a type, not a +// value. Unlike new, make's return type is the same as the type of its +// argument, not a pointer to it. The specification of the result depends on +// the type: +// Slice: The size specifies the length. The capacity of the slice is +// equal to its length. A second integer argument may be provided to +// specify a different capacity; it must be no smaller than the +// length, so make([]int, 0, 10) allocates a slice of length 0 and +// capacity 10. +// Map: An initial allocation is made according to the size but the +// resulting map has length 0. The size may be omitted, in which case +// a small starting size is allocated. +// Channel: The channel's buffer is initialized with the specified +// buffer capacity. If zero, or the size is omitted, the channel is +// unbuffered. +func make(Type, size IntegerType) Type + +// The new built-in function allocates memory. The first argument is a type, +// not a value, and the value returned is a pointer to a newly +// allocated zero value of that type. +func new(Type) *Type + +// The complex built-in function constructs a complex value from two +// floating-point values. The real and imaginary parts must be of the same +// size, either float32 or float64 (or assignable to them), and the return +// value will be the corresponding complex type (complex64 for float32, +// complex128 for float64). +func complex(r, i FloatType) ComplexType + +// The real built-in function returns the real part of the complex number c. +// The return value will be floating point type corresponding to the type of c. +func real(c ComplexType) FloatType + +// The imag built-in function returns the imaginary part of the complex +// number c. The return value will be floating point type corresponding to +// the type of c. +func imag(c ComplexType) FloatType + +// The close built-in function closes a channel, which must be either +// bidirectional or send-only. It should be executed only by the sender, +// never the receiver, and has the effect of shutting down the channel after +// the last sent value is received. After the last value has been received +// from a closed channel c, any receive from c will succeed without +// blocking, returning the zero value for the channel element. The form +// x, ok := <-c +// will also set ok to false for a closed channel. +func close(c chan<- Type) + +// The panic built-in function stops normal execution of the current +// goroutine. When a function F calls panic, normal execution of F stops +// immediately. Any functions whose execution was deferred by F are run in +// the usual way, and then F returns to its caller. To the caller G, the +// invocation of F then behaves like a call to panic, terminating G's +// execution and running any deferred functions. This continues until all +// functions in the executing goroutine have stopped, in reverse order. At +// that point, the program is terminated and the error condition is reported, +// including the value of the argument to panic. This termination sequence +// is called panicking and can be controlled by the built-in function +// recover. +func panic(v interface{}) + +// The recover built-in function allows a program to manage behavior of a +// panicking goroutine. Executing a call to recover inside a deferred +// function (but not any function called by it) stops the panicking sequence +// by restoring normal execution and retrieves the error value passed to the +// call of panic. If recover is called outside the deferred function it will +// not stop a panicking sequence. In this case, or when the goroutine is not +// panicking, or if the argument supplied to panic was nil, recover returns +// nil. Thus the return value from recover reports whether the goroutine is +// panicking. +func recover() interface{} + +// The print built-in function formats its arguments in an +// implementation-specific way and writes the result to standard error. +// Print is useful for bootstrapping and debugging; it is not guaranteed +// to stay in the language. +func print(args ...Type) + +// The println built-in function formats its arguments in an +// implementation-specific way and writes the result to standard error. +// Spaces are always added between arguments and a newline is appended. +// Println is useful for bootstrapping and debugging; it is not guaranteed +// to stay in the language. +func println(args ...Type) + +// The error built-in interface type is the conventional interface for +// representing an error condition, with the nil value representing no error. +type error interface { + Error() string +} diff --git a/src/bytes/buffer.go b/src/bytes/buffer.go new file mode 100644 index 0000000000000000000000000000000000000000..4db93867d9aa890faed03430b8d9116714e4c9ea --- /dev/null +++ b/src/bytes/buffer.go @@ -0,0 +1,416 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package bytes + +// Simple byte buffer for marshaling data. + +import ( + "errors" + "io" + "unicode/utf8" +) + +// A Buffer is a variable-sized buffer of bytes with Read and Write methods. +// The zero value for Buffer is an empty buffer ready to use. +type Buffer struct { + buf []byte // contents are the bytes buf[off : len(buf)] + off int // read at &buf[off], write at &buf[len(buf)] + runeBytes [utf8.UTFMax]byte // avoid allocation of slice on each WriteByte or Rune + bootstrap [64]byte // memory to hold first slice; helps small buffers (Printf) avoid allocation. + lastRead readOp // last read operation, so that Unread* can work correctly. +} + +// The readOp constants describe the last action performed on +// the buffer, so that UnreadRune and UnreadByte can +// check for invalid usage. +type readOp int + +const ( + opInvalid readOp = iota // Non-read operation. + opReadRune // Read rune. + opRead // Any other read operation. +) + +// ErrTooLarge is passed to panic if memory cannot be allocated to store data in a buffer. +var ErrTooLarge = errors.New("bytes.Buffer: too large") + +// Bytes returns a slice of the contents of the unread portion of the buffer; +// len(b.Bytes()) == b.Len(). If the caller changes the contents of the +// returned slice, the contents of the buffer will change provided there +// are no intervening method calls on the Buffer. +func (b *Buffer) Bytes() []byte { return b.buf[b.off:] } + +// String returns the contents of the unread portion of the buffer +// as a string. If the Buffer is a nil pointer, it returns "". +func (b *Buffer) String() string { + if b == nil { + // Special case, useful in debugging. + return "" + } + return string(b.buf[b.off:]) +} + +// Len returns the number of bytes of the unread portion of the buffer; +// b.Len() == len(b.Bytes()). +func (b *Buffer) Len() int { return len(b.buf) - b.off } + +// Cap returns the capacity of the buffer's underlying byte slice, that is, the +// total space allocated for the buffer's data. +func (b *Buffer) Cap() int { return cap(b.buf) } + +// Truncate discards all but the first n unread bytes from the buffer. +// It panics if n is negative or greater than the length of the buffer. +func (b *Buffer) Truncate(n int) { + b.lastRead = opInvalid + switch { + case n < 0 || n > b.Len(): + panic("bytes.Buffer: truncation out of range") + case n == 0: + // Reuse buffer space. + b.off = 0 + } + b.buf = b.buf[0 : b.off+n] +} + +// Reset resets the buffer so it has no content. +// b.Reset() is the same as b.Truncate(0). +func (b *Buffer) Reset() { b.Truncate(0) } + +// grow grows the buffer to guarantee space for n more bytes. +// It returns the index where bytes should be written. +// If the buffer can't grow it will panic with ErrTooLarge. +func (b *Buffer) grow(n int) int { + m := b.Len() + // If buffer is empty, reset to recover space. + if m == 0 && b.off != 0 { + b.Truncate(0) + } + if len(b.buf)+n > cap(b.buf) { + var buf []byte + if b.buf == nil && n <= len(b.bootstrap) { + buf = b.bootstrap[0:] + } else if m+n <= cap(b.buf)/2 { + // We can slide things down instead of allocating a new + // slice. We only need m+n <= cap(b.buf) to slide, but + // we instead let capacity get twice as large so we + // don't spend all our time copying. + copy(b.buf[:], b.buf[b.off:]) + buf = b.buf[:m] + } else { + // not enough space anywhere + buf = makeSlice(2*cap(b.buf) + n) + copy(buf, b.buf[b.off:]) + } + b.buf = buf + b.off = 0 + } + b.buf = b.buf[0 : b.off+m+n] + return b.off + m +} + +// Grow grows the buffer's capacity, if necessary, to guarantee space for +// another n bytes. After Grow(n), at least n bytes can be written to the +// buffer without another allocation. +// If n is negative, Grow will panic. +// If the buffer can't grow it will panic with ErrTooLarge. +func (b *Buffer) Grow(n int) { + if n < 0 { + panic("bytes.Buffer.Grow: negative count") + } + m := b.grow(n) + b.buf = b.buf[0:m] +} + +// Write appends the contents of p to the buffer, growing the buffer as +// needed. The return value n is the length of p; err is always nil. If the +// buffer becomes too large, Write will panic with ErrTooLarge. +func (b *Buffer) Write(p []byte) (n int, err error) { + b.lastRead = opInvalid + m := b.grow(len(p)) + return copy(b.buf[m:], p), nil +} + +// WriteString appends the contents of s to the buffer, growing the buffer as +// needed. The return value n is the length of s; err is always nil. If the +// buffer becomes too large, WriteString will panic with ErrTooLarge. +func (b *Buffer) WriteString(s string) (n int, err error) { + b.lastRead = opInvalid + m := b.grow(len(s)) + return copy(b.buf[m:], s), nil +} + +// MinRead is the minimum slice size passed to a Read call by +// Buffer.ReadFrom. As long as the Buffer has at least MinRead bytes beyond +// what is required to hold the contents of r, ReadFrom will not grow the +// underlying buffer. +const MinRead = 512 + +// ReadFrom reads data from r until EOF and appends it to the buffer, growing +// the buffer as needed. The return value n is the number of bytes read. Any +// error except io.EOF encountered during the read is also returned. If the +// buffer becomes too large, ReadFrom will panic with ErrTooLarge. +func (b *Buffer) ReadFrom(r io.Reader) (n int64, err error) { + b.lastRead = opInvalid + // If buffer is empty, reset to recover space. + if b.off >= len(b.buf) { + b.Truncate(0) + } + for { + if free := cap(b.buf) - len(b.buf); free < MinRead { + // not enough space at end + newBuf := b.buf + if b.off+free < MinRead { + // not enough space using beginning of buffer; + // double buffer capacity + newBuf = makeSlice(2*cap(b.buf) + MinRead) + } + copy(newBuf, b.buf[b.off:]) + b.buf = newBuf[:len(b.buf)-b.off] + b.off = 0 + } + m, e := r.Read(b.buf[len(b.buf):cap(b.buf)]) + b.buf = b.buf[0 : len(b.buf)+m] + n += int64(m) + if e == io.EOF { + break + } + if e != nil { + return n, e + } + } + return n, nil // err is EOF, so return nil explicitly +} + +// makeSlice allocates a slice of size n. If the allocation fails, it panics +// with ErrTooLarge. +func makeSlice(n int) []byte { + // If the make fails, give a known error. + defer func() { + if recover() != nil { + panic(ErrTooLarge) + } + }() + return make([]byte, n) +} + +// WriteTo writes data to w until the buffer is drained or an error occurs. +// The return value n is the number of bytes written; it always fits into an +// int, but it is int64 to match the io.WriterTo interface. Any error +// encountered during the write is also returned. +func (b *Buffer) WriteTo(w io.Writer) (n int64, err error) { + b.lastRead = opInvalid + if b.off < len(b.buf) { + nBytes := b.Len() + m, e := w.Write(b.buf[b.off:]) + if m > nBytes { + panic("bytes.Buffer.WriteTo: invalid Write count") + } + b.off += m + n = int64(m) + if e != nil { + return n, e + } + // all bytes should have been written, by definition of + // Write method in io.Writer + if m != nBytes { + return n, io.ErrShortWrite + } + } + // Buffer is now empty; reset. + b.Truncate(0) + return +} + +// WriteByte appends the byte c to the buffer, growing the buffer as needed. +// The returned error is always nil, but is included to match bufio.Writer's +// WriteByte. If the buffer becomes too large, WriteByte will panic with +// ErrTooLarge. +func (b *Buffer) WriteByte(c byte) error { + b.lastRead = opInvalid + m := b.grow(1) + b.buf[m] = c + return nil +} + +// WriteRune appends the UTF-8 encoding of Unicode code point r to the +// buffer, returning its length and an error, which is always nil but is +// included to match bufio.Writer's WriteRune. The buffer is grown as needed; +// if it becomes too large, WriteRune will panic with ErrTooLarge. +func (b *Buffer) WriteRune(r rune) (n int, err error) { + if r < utf8.RuneSelf { + b.WriteByte(byte(r)) + return 1, nil + } + n = utf8.EncodeRune(b.runeBytes[0:], r) + b.Write(b.runeBytes[0:n]) + return n, nil +} + +// Read reads the next len(p) bytes from the buffer or until the buffer +// is drained. The return value n is the number of bytes read. If the +// buffer has no data to return, err is io.EOF (unless len(p) is zero); +// otherwise it is nil. +func (b *Buffer) Read(p []byte) (n int, err error) { + b.lastRead = opInvalid + if b.off >= len(b.buf) { + // Buffer is empty, reset to recover space. + b.Truncate(0) + if len(p) == 0 { + return + } + return 0, io.EOF + } + n = copy(p, b.buf[b.off:]) + b.off += n + if n > 0 { + b.lastRead = opRead + } + return +} + +// Next returns a slice containing the next n bytes from the buffer, +// advancing the buffer as if the bytes had been returned by Read. +// If there are fewer than n bytes in the buffer, Next returns the entire buffer. +// The slice is only valid until the next call to a read or write method. +func (b *Buffer) Next(n int) []byte { + b.lastRead = opInvalid + m := b.Len() + if n > m { + n = m + } + data := b.buf[b.off : b.off+n] + b.off += n + if n > 0 { + b.lastRead = opRead + } + return data +} + +// ReadByte reads and returns the next byte from the buffer. +// If no byte is available, it returns error io.EOF. +func (b *Buffer) ReadByte() (c byte, err error) { + b.lastRead = opInvalid + if b.off >= len(b.buf) { + // Buffer is empty, reset to recover space. + b.Truncate(0) + return 0, io.EOF + } + c = b.buf[b.off] + b.off++ + b.lastRead = opRead + return c, nil +} + +// ReadRune reads and returns the next UTF-8-encoded +// Unicode code point from the buffer. +// If no bytes are available, the error returned is io.EOF. +// If the bytes are an erroneous UTF-8 encoding, it +// consumes one byte and returns U+FFFD, 1. +func (b *Buffer) ReadRune() (r rune, size int, err error) { + b.lastRead = opInvalid + if b.off >= len(b.buf) { + // Buffer is empty, reset to recover space. + b.Truncate(0) + return 0, 0, io.EOF + } + b.lastRead = opReadRune + c := b.buf[b.off] + if c < utf8.RuneSelf { + b.off++ + return rune(c), 1, nil + } + r, n := utf8.DecodeRune(b.buf[b.off:]) + b.off += n + return r, n, nil +} + +// UnreadRune unreads the last rune returned by ReadRune. +// If the most recent read or write operation on the buffer was +// not a ReadRune, UnreadRune returns an error. (In this regard +// it is stricter than UnreadByte, which will unread the last byte +// from any read operation.) +func (b *Buffer) UnreadRune() error { + if b.lastRead != opReadRune { + return errors.New("bytes.Buffer: UnreadRune: previous operation was not ReadRune") + } + b.lastRead = opInvalid + if b.off > 0 { + _, n := utf8.DecodeLastRune(b.buf[0:b.off]) + b.off -= n + } + return nil +} + +// UnreadByte unreads the last byte returned by the most recent +// read operation. If write has happened since the last read, UnreadByte +// returns an error. +func (b *Buffer) UnreadByte() error { + if b.lastRead != opReadRune && b.lastRead != opRead { + return errors.New("bytes.Buffer: UnreadByte: previous operation was not a read") + } + b.lastRead = opInvalid + if b.off > 0 { + b.off-- + } + return nil +} + +// ReadBytes reads until the first occurrence of delim in the input, +// returning a slice containing the data up to and including the delimiter. +// If ReadBytes encounters an error before finding a delimiter, +// it returns the data read before the error and the error itself (often io.EOF). +// ReadBytes returns err != nil if and only if the returned data does not end in +// delim. +func (b *Buffer) ReadBytes(delim byte) (line []byte, err error) { + slice, err := b.readSlice(delim) + // return a copy of slice. The buffer's backing array may + // be overwritten by later calls. + line = append(line, slice...) + return +} + +// readSlice is like ReadBytes but returns a reference to internal buffer data. +func (b *Buffer) readSlice(delim byte) (line []byte, err error) { + i := IndexByte(b.buf[b.off:], delim) + end := b.off + i + 1 + if i < 0 { + end = len(b.buf) + err = io.EOF + } + line = b.buf[b.off:end] + b.off = end + b.lastRead = opRead + return line, err +} + +// ReadString reads until the first occurrence of delim in the input, +// returning a string containing the data up to and including the delimiter. +// If ReadString encounters an error before finding a delimiter, +// it returns the data read before the error and the error itself (often io.EOF). +// ReadString returns err != nil if and only if the returned data does not end +// in delim. +func (b *Buffer) ReadString(delim byte) (line string, err error) { + slice, err := b.readSlice(delim) + return string(slice), err +} + +// NewBuffer creates and initializes a new Buffer using buf as its initial +// contents. It is intended to prepare a Buffer to read existing data. It +// can also be used to size the internal buffer for writing. To do that, +// buf should have the desired capacity but a length of zero. +// +// In most cases, new(Buffer) (or just declaring a Buffer variable) is +// sufficient to initialize a Buffer. +func NewBuffer(buf []byte) *Buffer { return &Buffer{buf: buf} } + +// NewBufferString creates and initializes a new Buffer using string s as its +// initial contents. It is intended to prepare a buffer to read an existing +// string. +// +// In most cases, new(Buffer) (or just declaring a Buffer variable) is +// sufficient to initialize a Buffer. +func NewBufferString(s string) *Buffer { + return &Buffer{buf: []byte(s)} +} diff --git a/src/bytes/buffer_test.go b/src/bytes/buffer_test.go new file mode 100644 index 0000000000000000000000000000000000000000..7de17ae47e28ff00f00dd295637a9917779e9e32 --- /dev/null +++ b/src/bytes/buffer_test.go @@ -0,0 +1,544 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package bytes_test + +import ( + . "bytes" + "io" + "math/rand" + "runtime" + "testing" + "unicode/utf8" +) + +const N = 10000 // make this bigger for a larger (and slower) test +var data string // test data for write tests +var testBytes []byte // test data; same as data but as a slice. + +func init() { + testBytes = make([]byte, N) + for i := 0; i < N; i++ { + testBytes[i] = 'a' + byte(i%26) + } + data = string(testBytes) +} + +// Verify that contents of buf match the string s. +func check(t *testing.T, testname string, buf *Buffer, s string) { + bytes := buf.Bytes() + str := buf.String() + if buf.Len() != len(bytes) { + t.Errorf("%s: buf.Len() == %d, len(buf.Bytes()) == %d", testname, buf.Len(), len(bytes)) + } + + if buf.Len() != len(str) { + t.Errorf("%s: buf.Len() == %d, len(buf.String()) == %d", testname, buf.Len(), len(str)) + } + + if buf.Len() != len(s) { + t.Errorf("%s: buf.Len() == %d, len(s) == %d", testname, buf.Len(), len(s)) + } + + if string(bytes) != s { + t.Errorf("%s: string(buf.Bytes()) == %q, s == %q", testname, string(bytes), s) + } +} + +// Fill buf through n writes of string fus. +// The initial contents of buf corresponds to the string s; +// the result is the final contents of buf returned as a string. +func fillString(t *testing.T, testname string, buf *Buffer, s string, n int, fus string) string { + check(t, testname+" (fill 1)", buf, s) + for ; n > 0; n-- { + m, err := buf.WriteString(fus) + if m != len(fus) { + t.Errorf(testname+" (fill 2): m == %d, expected %d", m, len(fus)) + } + if err != nil { + t.Errorf(testname+" (fill 3): err should always be nil, found err == %s", err) + } + s += fus + check(t, testname+" (fill 4)", buf, s) + } + return s +} + +// Fill buf through n writes of byte slice fub. +// The initial contents of buf corresponds to the string s; +// the result is the final contents of buf returned as a string. +func fillBytes(t *testing.T, testname string, buf *Buffer, s string, n int, fub []byte) string { + check(t, testname+" (fill 1)", buf, s) + for ; n > 0; n-- { + m, err := buf.Write(fub) + if m != len(fub) { + t.Errorf(testname+" (fill 2): m == %d, expected %d", m, len(fub)) + } + if err != nil { + t.Errorf(testname+" (fill 3): err should always be nil, found err == %s", err) + } + s += string(fub) + check(t, testname+" (fill 4)", buf, s) + } + return s +} + +func TestNewBuffer(t *testing.T) { + buf := NewBuffer(testBytes) + check(t, "NewBuffer", buf, data) +} + +func TestNewBufferString(t *testing.T) { + buf := NewBufferString(data) + check(t, "NewBufferString", buf, data) +} + +// Empty buf through repeated reads into fub. +// The initial contents of buf corresponds to the string s. +func empty(t *testing.T, testname string, buf *Buffer, s string, fub []byte) { + check(t, testname+" (empty 1)", buf, s) + + for { + n, err := buf.Read(fub) + if n == 0 { + break + } + if err != nil { + t.Errorf(testname+" (empty 2): err should always be nil, found err == %s", err) + } + s = s[n:] + check(t, testname+" (empty 3)", buf, s) + } + + check(t, testname+" (empty 4)", buf, "") +} + +func TestBasicOperations(t *testing.T) { + var buf Buffer + + for i := 0; i < 5; i++ { + check(t, "TestBasicOperations (1)", &buf, "") + + buf.Reset() + check(t, "TestBasicOperations (2)", &buf, "") + + buf.Truncate(0) + check(t, "TestBasicOperations (3)", &buf, "") + + n, err := buf.Write([]byte(data[0:1])) + if n != 1 { + t.Errorf("wrote 1 byte, but n == %d", n) + } + if err != nil { + t.Errorf("err should always be nil, but err == %s", err) + } + check(t, "TestBasicOperations (4)", &buf, "a") + + buf.WriteByte(data[1]) + check(t, "TestBasicOperations (5)", &buf, "ab") + + n, err = buf.Write([]byte(data[2:26])) + if n != 24 { + t.Errorf("wrote 25 bytes, but n == %d", n) + } + check(t, "TestBasicOperations (6)", &buf, string(data[0:26])) + + buf.Truncate(26) + check(t, "TestBasicOperations (7)", &buf, string(data[0:26])) + + buf.Truncate(20) + check(t, "TestBasicOperations (8)", &buf, string(data[0:20])) + + empty(t, "TestBasicOperations (9)", &buf, string(data[0:20]), make([]byte, 5)) + empty(t, "TestBasicOperations (10)", &buf, "", make([]byte, 100)) + + buf.WriteByte(data[1]) + c, err := buf.ReadByte() + if err != nil { + t.Error("ReadByte unexpected eof") + } + if c != data[1] { + t.Errorf("ReadByte wrong value c=%v", c) + } + c, err = buf.ReadByte() + if err == nil { + t.Error("ReadByte unexpected not eof") + } + } +} + +func TestLargeStringWrites(t *testing.T) { + var buf Buffer + limit := 30 + if testing.Short() { + limit = 9 + } + for i := 3; i < limit; i += 3 { + s := fillString(t, "TestLargeWrites (1)", &buf, "", 5, data) + empty(t, "TestLargeStringWrites (2)", &buf, s, make([]byte, len(data)/i)) + } + check(t, "TestLargeStringWrites (3)", &buf, "") +} + +func TestLargeByteWrites(t *testing.T) { + var buf Buffer + limit := 30 + if testing.Short() { + limit = 9 + } + for i := 3; i < limit; i += 3 { + s := fillBytes(t, "TestLargeWrites (1)", &buf, "", 5, testBytes) + empty(t, "TestLargeByteWrites (2)", &buf, s, make([]byte, len(data)/i)) + } + check(t, "TestLargeByteWrites (3)", &buf, "") +} + +func TestLargeStringReads(t *testing.T) { + var buf Buffer + for i := 3; i < 30; i += 3 { + s := fillString(t, "TestLargeReads (1)", &buf, "", 5, data[0:len(data)/i]) + empty(t, "TestLargeReads (2)", &buf, s, make([]byte, len(data))) + } + check(t, "TestLargeStringReads (3)", &buf, "") +} + +func TestLargeByteReads(t *testing.T) { + var buf Buffer + for i := 3; i < 30; i += 3 { + s := fillBytes(t, "TestLargeReads (1)", &buf, "", 5, testBytes[0:len(testBytes)/i]) + empty(t, "TestLargeReads (2)", &buf, s, make([]byte, len(data))) + } + check(t, "TestLargeByteReads (3)", &buf, "") +} + +func TestMixedReadsAndWrites(t *testing.T) { + var buf Buffer + s := "" + for i := 0; i < 50; i++ { + wlen := rand.Intn(len(data)) + if i%2 == 0 { + s = fillString(t, "TestMixedReadsAndWrites (1)", &buf, s, 1, data[0:wlen]) + } else { + s = fillBytes(t, "TestMixedReadsAndWrites (1)", &buf, s, 1, testBytes[0:wlen]) + } + + rlen := rand.Intn(len(data)) + fub := make([]byte, rlen) + n, _ := buf.Read(fub) + s = s[n:] + } + empty(t, "TestMixedReadsAndWrites (2)", &buf, s, make([]byte, buf.Len())) +} + +func TestCapWithPreallocatedSlice(t *testing.T) { + buf := NewBuffer(make([]byte, 10)) + n := buf.Cap() + if n != 10 { + t.Errorf("expected 10, got %d", n) + } +} + +func TestCapWithSliceAndWrittenData(t *testing.T) { + buf := NewBuffer(make([]byte, 0, 10)) + buf.Write([]byte("test")) + n := buf.Cap() + if n != 10 { + t.Errorf("expected 10, got %d", n) + } +} + +func TestNil(t *testing.T) { + var b *Buffer + if b.String() != "" { + t.Errorf("expected ; got %q", b.String()) + } +} + +func TestReadFrom(t *testing.T) { + var buf Buffer + for i := 3; i < 30; i += 3 { + s := fillBytes(t, "TestReadFrom (1)", &buf, "", 5, testBytes[0:len(testBytes)/i]) + var b Buffer + b.ReadFrom(&buf) + empty(t, "TestReadFrom (2)", &b, s, make([]byte, len(data))) + } +} + +func TestWriteTo(t *testing.T) { + var buf Buffer + for i := 3; i < 30; i += 3 { + s := fillBytes(t, "TestWriteTo (1)", &buf, "", 5, testBytes[0:len(testBytes)/i]) + var b Buffer + buf.WriteTo(&b) + empty(t, "TestWriteTo (2)", &b, s, make([]byte, len(data))) + } +} + +func TestRuneIO(t *testing.T) { + const NRune = 1000 + // Built a test slice while we write the data + b := make([]byte, utf8.UTFMax*NRune) + var buf Buffer + n := 0 + for r := rune(0); r < NRune; r++ { + size := utf8.EncodeRune(b[n:], r) + nbytes, err := buf.WriteRune(r) + if err != nil { + t.Fatalf("WriteRune(%U) error: %s", r, err) + } + if nbytes != size { + t.Fatalf("WriteRune(%U) expected %d, got %d", r, size, nbytes) + } + n += size + } + b = b[0:n] + + // Check the resulting bytes + if !Equal(buf.Bytes(), b) { + t.Fatalf("incorrect result from WriteRune: %q not %q", buf.Bytes(), b) + } + + p := make([]byte, utf8.UTFMax) + // Read it back with ReadRune + for r := rune(0); r < NRune; r++ { + size := utf8.EncodeRune(p, r) + nr, nbytes, err := buf.ReadRune() + if nr != r || nbytes != size || err != nil { + t.Fatalf("ReadRune(%U) got %U,%d not %U,%d (err=%s)", r, nr, nbytes, r, size, err) + } + } + + // Check that UnreadRune works + buf.Reset() + buf.Write(b) + for r := rune(0); r < NRune; r++ { + r1, size, _ := buf.ReadRune() + if err := buf.UnreadRune(); err != nil { + t.Fatalf("UnreadRune(%U) got error %q", r, err) + } + r2, nbytes, err := buf.ReadRune() + if r1 != r2 || r1 != r || nbytes != size || err != nil { + t.Fatalf("ReadRune(%U) after UnreadRune got %U,%d not %U,%d (err=%s)", r, r2, nbytes, r, size, err) + } + } +} + +func TestNext(t *testing.T) { + b := []byte{0, 1, 2, 3, 4} + tmp := make([]byte, 5) + for i := 0; i <= 5; i++ { + for j := i; j <= 5; j++ { + for k := 0; k <= 6; k++ { + // 0 <= i <= j <= 5; 0 <= k <= 6 + // Check that if we start with a buffer + // of length j at offset i and ask for + // Next(k), we get the right bytes. + buf := NewBuffer(b[0:j]) + n, _ := buf.Read(tmp[0:i]) + if n != i { + t.Fatalf("Read %d returned %d", i, n) + } + bb := buf.Next(k) + want := k + if want > j-i { + want = j - i + } + if len(bb) != want { + t.Fatalf("in %d,%d: len(Next(%d)) == %d", i, j, k, len(bb)) + } + for l, v := range bb { + if v != byte(l+i) { + t.Fatalf("in %d,%d: Next(%d)[%d] = %d, want %d", i, j, k, l, v, l+i) + } + } + } + } + } +} + +var readBytesTests = []struct { + buffer string + delim byte + expected []string + err error +}{ + {"", 0, []string{""}, io.EOF}, + {"a\x00", 0, []string{"a\x00"}, nil}, + {"abbbaaaba", 'b', []string{"ab", "b", "b", "aaab"}, nil}, + {"hello\x01world", 1, []string{"hello\x01"}, nil}, + {"foo\nbar", 0, []string{"foo\nbar"}, io.EOF}, + {"alpha\nbeta\ngamma\n", '\n', []string{"alpha\n", "beta\n", "gamma\n"}, nil}, + {"alpha\nbeta\ngamma", '\n', []string{"alpha\n", "beta\n", "gamma"}, io.EOF}, +} + +func TestReadBytes(t *testing.T) { + for _, test := range readBytesTests { + buf := NewBufferString(test.buffer) + var err error + for _, expected := range test.expected { + var bytes []byte + bytes, err = buf.ReadBytes(test.delim) + if string(bytes) != expected { + t.Errorf("expected %q, got %q", expected, bytes) + } + if err != nil { + break + } + } + if err != test.err { + t.Errorf("expected error %v, got %v", test.err, err) + } + } +} + +func TestReadString(t *testing.T) { + for _, test := range readBytesTests { + buf := NewBufferString(test.buffer) + var err error + for _, expected := range test.expected { + var s string + s, err = buf.ReadString(test.delim) + if s != expected { + t.Errorf("expected %q, got %q", expected, s) + } + if err != nil { + break + } + } + if err != test.err { + t.Errorf("expected error %v, got %v", test.err, err) + } + } +} + +func BenchmarkReadString(b *testing.B) { + const n = 32 << 10 + + data := make([]byte, n) + data[n-1] = 'x' + b.SetBytes(int64(n)) + for i := 0; i < b.N; i++ { + buf := NewBuffer(data) + _, err := buf.ReadString('x') + if err != nil { + b.Fatal(err) + } + } +} + +func TestGrow(t *testing.T) { + x := []byte{'x'} + y := []byte{'y'} + tmp := make([]byte, 72) + for _, startLen := range []int{0, 100, 1000, 10000, 100000} { + xBytes := Repeat(x, startLen) + for _, growLen := range []int{0, 100, 1000, 10000, 100000} { + buf := NewBuffer(xBytes) + // If we read, this affects buf.off, which is good to test. + readBytes, _ := buf.Read(tmp) + buf.Grow(growLen) + yBytes := Repeat(y, growLen) + // Check no allocation occurs in write, as long as we're single-threaded. + var m1, m2 runtime.MemStats + runtime.ReadMemStats(&m1) + buf.Write(yBytes) + runtime.ReadMemStats(&m2) + if runtime.GOMAXPROCS(-1) == 1 && m1.Mallocs != m2.Mallocs { + t.Errorf("allocation occurred during write") + } + // Check that buffer has correct data. + if !Equal(buf.Bytes()[0:startLen-readBytes], xBytes[readBytes:]) { + t.Errorf("bad initial data at %d %d", startLen, growLen) + } + if !Equal(buf.Bytes()[startLen-readBytes:startLen-readBytes+growLen], yBytes) { + t.Errorf("bad written data at %d %d", startLen, growLen) + } + } + } +} + +// Was a bug: used to give EOF reading empty slice at EOF. +func TestReadEmptyAtEOF(t *testing.T) { + b := new(Buffer) + slice := make([]byte, 0) + n, err := b.Read(slice) + if err != nil { + t.Errorf("read error: %v", err) + } + if n != 0 { + t.Errorf("wrong count; got %d want 0", n) + } +} + +func TestUnreadByte(t *testing.T) { + b := new(Buffer) + b.WriteString("abcdefghijklmnopqrstuvwxyz") + + _, err := b.ReadBytes('m') + if err != nil { + t.Fatalf("ReadBytes: %v", err) + } + + err = b.UnreadByte() + if err != nil { + t.Fatalf("UnreadByte: %v", err) + } + c, err := b.ReadByte() + if err != nil { + t.Fatalf("ReadByte: %v", err) + } + if c != 'm' { + t.Errorf("ReadByte = %q; want %q", c, 'm') + } +} + +// Tests that we occasionally compact. Issue 5154. +func TestBufferGrowth(t *testing.T) { + var b Buffer + buf := make([]byte, 1024) + b.Write(buf[0:1]) + var cap0 int + for i := 0; i < 5<<10; i++ { + b.Write(buf) + b.Read(buf) + if i == 0 { + cap0 = b.Cap() + } + } + cap1 := b.Cap() + // (*Buffer).grow allows for 2x capacity slop before sliding, + // so set our error threshold at 3x. + if cap1 > cap0*3 { + t.Errorf("buffer cap = %d; too big (grew from %d)", cap1, cap0) + } +} + +// From Issue 5154. +func BenchmarkBufferNotEmptyWriteRead(b *testing.B) { + buf := make([]byte, 1024) + for i := 0; i < b.N; i++ { + var b Buffer + b.Write(buf[0:1]) + for i := 0; i < 5<<10; i++ { + b.Write(buf) + b.Read(buf) + } + } +} + +// Check that we don't compact too often. From Issue 5154. +func BenchmarkBufferFullSmallReads(b *testing.B) { + buf := make([]byte, 1024) + for i := 0; i < b.N; i++ { + var b Buffer + b.Write(buf) + for b.Len()+20 < b.Cap() { + b.Write(buf[:10]) + } + for i := 0; i < 5<<10; i++ { + b.Read(buf[:1]) + b.Write(buf[:1]) + } + } +} diff --git a/src/bytes/bytes.go b/src/bytes/bytes.go new file mode 100644 index 0000000000000000000000000000000000000000..b86824087e5356405855d4581aeb728fa50f8ae1 --- /dev/null +++ b/src/bytes/bytes.go @@ -0,0 +1,714 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package bytes implements functions for the manipulation of byte slices. +// It is analogous to the facilities of the strings package. +package bytes + +import ( + "unicode" + "unicode/utf8" +) + +func equalPortable(a, b []byte) bool { + if len(a) != len(b) { + return false + } + for i, c := range a { + if c != b[i] { + return false + } + } + return true +} + +// explode splits s into a slice of UTF-8 sequences, one per Unicode code point (still slices of bytes), +// up to a maximum of n byte slices. Invalid UTF-8 sequences are chopped into individual bytes. +func explode(s []byte, n int) [][]byte { + if n <= 0 { + n = len(s) + } + a := make([][]byte, n) + var size int + na := 0 + for len(s) > 0 { + if na+1 >= n { + a[na] = s + na++ + break + } + _, size = utf8.DecodeRune(s) + a[na] = s[0:size] + s = s[size:] + na++ + } + return a[0:na] +} + +// Count counts the number of non-overlapping instances of sep in s. +// If sep is an empty slice, Count returns 1 + the number of Unicode code points in s. +func Count(s, sep []byte) int { + n := len(sep) + if n == 0 { + return utf8.RuneCount(s) + 1 + } + if n > len(s) { + return 0 + } + count := 0 + c := sep[0] + i := 0 + t := s[:len(s)-n+1] + for i < len(t) { + if t[i] != c { + o := IndexByte(t[i:], c) + if o < 0 { + break + } + i += o + } + if n == 1 || Equal(s[i:i+n], sep) { + count++ + i += n + continue + } + i++ + } + return count +} + +// Contains reports whether subslice is within b. +func Contains(b, subslice []byte) bool { + return Index(b, subslice) != -1 +} + +// Index returns the index of the first instance of sep in s, or -1 if sep is not present in s. +func Index(s, sep []byte) int { + n := len(sep) + if n == 0 { + return 0 + } + if n > len(s) { + return -1 + } + c := sep[0] + if n == 1 { + return IndexByte(s, c) + } + i := 0 + t := s[:len(s)-n+1] + for i < len(t) { + if t[i] != c { + o := IndexByte(t[i:], c) + if o < 0 { + break + } + i += o + } + if Equal(s[i:i+n], sep) { + return i + } + i++ + } + return -1 +} + +func indexBytePortable(s []byte, c byte) int { + for i, b := range s { + if b == c { + return i + } + } + return -1 +} + +// LastIndex returns the index of the last instance of sep in s, or -1 if sep is not present in s. +func LastIndex(s, sep []byte) int { + n := len(sep) + if n == 0 { + return len(s) + } + c := sep[0] + for i := len(s) - n; i >= 0; i-- { + if s[i] == c && (n == 1 || Equal(s[i:i+n], sep)) { + return i + } + } + return -1 +} + +// LastIndexByte returns the index of the last instance of c in s, or -1 if c is not present in s. +func LastIndexByte(s []byte, c byte) int { + for i := len(s) - 1; i >= 0; i-- { + if s[i] == c { + return i + } + } + return -1 +} + +// IndexRune interprets s as a sequence of UTF-8-encoded Unicode code points. +// It returns the byte index of the first occurrence in s of the given rune. +// It returns -1 if rune is not present in s. +func IndexRune(s []byte, r rune) int { + for i := 0; i < len(s); { + r1, size := utf8.DecodeRune(s[i:]) + if r == r1 { + return i + } + i += size + } + return -1 +} + +// IndexAny interprets s as a sequence of UTF-8-encoded Unicode code points. +// It returns the byte index of the first occurrence in s of any of the Unicode +// code points in chars. It returns -1 if chars is empty or if there is no code +// point in common. +func IndexAny(s []byte, chars string) int { + if len(chars) > 0 { + var r rune + var width int + for i := 0; i < len(s); i += width { + r = rune(s[i]) + if r < utf8.RuneSelf { + width = 1 + } else { + r, width = utf8.DecodeRune(s[i:]) + } + for _, ch := range chars { + if r == ch { + return i + } + } + } + } + return -1 +} + +// LastIndexAny interprets s as a sequence of UTF-8-encoded Unicode code +// points. It returns the byte index of the last occurrence in s of any of +// the Unicode code points in chars. It returns -1 if chars is empty or if +// there is no code point in common. +func LastIndexAny(s []byte, chars string) int { + if len(chars) > 0 { + for i := len(s); i > 0; { + r, size := utf8.DecodeLastRune(s[0:i]) + i -= size + for _, ch := range chars { + if r == ch { + return i + } + } + } + } + return -1 +} + +// Generic split: splits after each instance of sep, +// including sepSave bytes of sep in the subslices. +func genSplit(s, sep []byte, sepSave, n int) [][]byte { + if n == 0 { + return nil + } + if len(sep) == 0 { + return explode(s, n) + } + if n < 0 { + n = Count(s, sep) + 1 + } + c := sep[0] + start := 0 + a := make([][]byte, n) + na := 0 + for i := 0; i+len(sep) <= len(s) && na+1 < n; i++ { + if s[i] == c && (len(sep) == 1 || Equal(s[i:i+len(sep)], sep)) { + a[na] = s[start : i+sepSave] + na++ + start = i + len(sep) + i += len(sep) - 1 + } + } + a[na] = s[start:] + return a[0 : na+1] +} + +// SplitN slices s into subslices separated by sep and returns a slice of +// the subslices between those separators. +// If sep is empty, SplitN splits after each UTF-8 sequence. +// The count determines the number of subslices to return: +// n > 0: at most n subslices; the last subslice will be the unsplit remainder. +// n == 0: the result is nil (zero subslices) +// n < 0: all subslices +func SplitN(s, sep []byte, n int) [][]byte { return genSplit(s, sep, 0, n) } + +// SplitAfterN slices s into subslices after each instance of sep and +// returns a slice of those subslices. +// If sep is empty, SplitAfterN splits after each UTF-8 sequence. +// The count determines the number of subslices to return: +// n > 0: at most n subslices; the last subslice will be the unsplit remainder. +// n == 0: the result is nil (zero subslices) +// n < 0: all subslices +func SplitAfterN(s, sep []byte, n int) [][]byte { + return genSplit(s, sep, len(sep), n) +} + +// Split slices s into all subslices separated by sep and returns a slice of +// the subslices between those separators. +// If sep is empty, Split splits after each UTF-8 sequence. +// It is equivalent to SplitN with a count of -1. +func Split(s, sep []byte) [][]byte { return genSplit(s, sep, 0, -1) } + +// SplitAfter slices s into all subslices after each instance of sep and +// returns a slice of those subslices. +// If sep is empty, SplitAfter splits after each UTF-8 sequence. +// It is equivalent to SplitAfterN with a count of -1. +func SplitAfter(s, sep []byte) [][]byte { + return genSplit(s, sep, len(sep), -1) +} + +// Fields splits the slice s around each instance of one or more consecutive white space +// characters, returning a slice of subslices of s or an empty list if s contains only white space. +func Fields(s []byte) [][]byte { + return FieldsFunc(s, unicode.IsSpace) +} + +// FieldsFunc interprets s as a sequence of UTF-8-encoded Unicode code points. +// It splits the slice s at each run of code points c satisfying f(c) and +// returns a slice of subslices of s. If all code points in s satisfy f(c), or +// len(s) == 0, an empty slice is returned. +// FieldsFunc makes no guarantees about the order in which it calls f(c). +// If f does not return consistent results for a given c, FieldsFunc may crash. +func FieldsFunc(s []byte, f func(rune) bool) [][]byte { + n := 0 + inField := false + for i := 0; i < len(s); { + r, size := utf8.DecodeRune(s[i:]) + wasInField := inField + inField = !f(r) + if inField && !wasInField { + n++ + } + i += size + } + + a := make([][]byte, n) + na := 0 + fieldStart := -1 + for i := 0; i <= len(s) && na < n; { + r, size := utf8.DecodeRune(s[i:]) + if fieldStart < 0 && size > 0 && !f(r) { + fieldStart = i + i += size + continue + } + if fieldStart >= 0 && (size == 0 || f(r)) { + a[na] = s[fieldStart:i] + na++ + fieldStart = -1 + } + if size == 0 { + break + } + i += size + } + return a[0:na] +} + +// Join concatenates the elements of s to create a new byte slice. The separator +// sep is placed between elements in the resulting slice. +func Join(s [][]byte, sep []byte) []byte { + if len(s) == 0 { + return []byte{} + } + if len(s) == 1 { + // Just return a copy. + return append([]byte(nil), s[0]...) + } + n := len(sep) * (len(s) - 1) + for _, v := range s { + n += len(v) + } + + b := make([]byte, n) + bp := copy(b, s[0]) + for _, v := range s[1:] { + bp += copy(b[bp:], sep) + bp += copy(b[bp:], v) + } + return b +} + +// HasPrefix tests whether the byte slice s begins with prefix. +func HasPrefix(s, prefix []byte) bool { + return len(s) >= len(prefix) && Equal(s[0:len(prefix)], prefix) +} + +// HasSuffix tests whether the byte slice s ends with suffix. +func HasSuffix(s, suffix []byte) bool { + return len(s) >= len(suffix) && Equal(s[len(s)-len(suffix):], suffix) +} + +// Map returns a copy of the byte slice s with all its characters modified +// according to the mapping function. If mapping returns a negative value, the character is +// dropped from the string with no replacement. The characters in s and the +// output are interpreted as UTF-8-encoded Unicode code points. +func Map(mapping func(r rune) rune, s []byte) []byte { + // In the worst case, the slice can grow when mapped, making + // things unpleasant. But it's so rare we barge in assuming it's + // fine. It could also shrink but that falls out naturally. + maxbytes := len(s) // length of b + nbytes := 0 // number of bytes encoded in b + b := make([]byte, maxbytes) + for i := 0; i < len(s); { + wid := 1 + r := rune(s[i]) + if r >= utf8.RuneSelf { + r, wid = utf8.DecodeRune(s[i:]) + } + r = mapping(r) + if r >= 0 { + rl := utf8.RuneLen(r) + if rl < 0 { + rl = len(string(utf8.RuneError)) + } + if nbytes+rl > maxbytes { + // Grow the buffer. + maxbytes = maxbytes*2 + utf8.UTFMax + nb := make([]byte, maxbytes) + copy(nb, b[0:nbytes]) + b = nb + } + nbytes += utf8.EncodeRune(b[nbytes:maxbytes], r) + } + i += wid + } + return b[0:nbytes] +} + +// Repeat returns a new byte slice consisting of count copies of b. +func Repeat(b []byte, count int) []byte { + nb := make([]byte, len(b)*count) + bp := copy(nb, b) + for bp < len(nb) { + copy(nb[bp:], nb[:bp]) + bp *= 2 + } + return nb +} + +// ToUpper returns a copy of the byte slice s with all Unicode letters mapped to their upper case. +func ToUpper(s []byte) []byte { return Map(unicode.ToUpper, s) } + +// ToLower returns a copy of the byte slice s with all Unicode letters mapped to their lower case. +func ToLower(s []byte) []byte { return Map(unicode.ToLower, s) } + +// ToTitle returns a copy of the byte slice s with all Unicode letters mapped to their title case. +func ToTitle(s []byte) []byte { return Map(unicode.ToTitle, s) } + +// ToUpperSpecial returns a copy of the byte slice s with all Unicode letters mapped to their +// upper case, giving priority to the special casing rules. +func ToUpperSpecial(_case unicode.SpecialCase, s []byte) []byte { + return Map(func(r rune) rune { return _case.ToUpper(r) }, s) +} + +// ToLowerSpecial returns a copy of the byte slice s with all Unicode letters mapped to their +// lower case, giving priority to the special casing rules. +func ToLowerSpecial(_case unicode.SpecialCase, s []byte) []byte { + return Map(func(r rune) rune { return _case.ToLower(r) }, s) +} + +// ToTitleSpecial returns a copy of the byte slice s with all Unicode letters mapped to their +// title case, giving priority to the special casing rules. +func ToTitleSpecial(_case unicode.SpecialCase, s []byte) []byte { + return Map(func(r rune) rune { return _case.ToTitle(r) }, s) +} + +// isSeparator reports whether the rune could mark a word boundary. +// TODO: update when package unicode captures more of the properties. +func isSeparator(r rune) bool { + // ASCII alphanumerics and underscore are not separators + if r <= 0x7F { + switch { + case '0' <= r && r <= '9': + return false + case 'a' <= r && r <= 'z': + return false + case 'A' <= r && r <= 'Z': + return false + case r == '_': + return false + } + return true + } + // Letters and digits are not separators + if unicode.IsLetter(r) || unicode.IsDigit(r) { + return false + } + // Otherwise, all we can do for now is treat spaces as separators. + return unicode.IsSpace(r) +} + +// Title returns a copy of s with all Unicode letters that begin words +// mapped to their title case. +// +// BUG(rsc): The rule Title uses for word boundaries does not handle Unicode punctuation properly. +func Title(s []byte) []byte { + // Use a closure here to remember state. + // Hackish but effective. Depends on Map scanning in order and calling + // the closure once per rune. + prev := ' ' + return Map( + func(r rune) rune { + if isSeparator(prev) { + prev = r + return unicode.ToTitle(r) + } + prev = r + return r + }, + s) +} + +// TrimLeftFunc returns a subslice of s by slicing off all leading UTF-8-encoded +// Unicode code points c that satisfy f(c). +func TrimLeftFunc(s []byte, f func(r rune) bool) []byte { + i := indexFunc(s, f, false) + if i == -1 { + return nil + } + return s[i:] +} + +// TrimRightFunc returns a subslice of s by slicing off all trailing UTF-8 +// encoded Unicode code points c that satisfy f(c). +func TrimRightFunc(s []byte, f func(r rune) bool) []byte { + i := lastIndexFunc(s, f, false) + if i >= 0 && s[i] >= utf8.RuneSelf { + _, wid := utf8.DecodeRune(s[i:]) + i += wid + } else { + i++ + } + return s[0:i] +} + +// TrimFunc returns a subslice of s by slicing off all leading and trailing +// UTF-8-encoded Unicode code points c that satisfy f(c). +func TrimFunc(s []byte, f func(r rune) bool) []byte { + return TrimRightFunc(TrimLeftFunc(s, f), f) +} + +// TrimPrefix returns s without the provided leading prefix string. +// If s doesn't start with prefix, s is returned unchanged. +func TrimPrefix(s, prefix []byte) []byte { + if HasPrefix(s, prefix) { + return s[len(prefix):] + } + return s +} + +// TrimSuffix returns s without the provided trailing suffix string. +// If s doesn't end with suffix, s is returned unchanged. +func TrimSuffix(s, suffix []byte) []byte { + if HasSuffix(s, suffix) { + return s[:len(s)-len(suffix)] + } + return s +} + +// IndexFunc interprets s as a sequence of UTF-8-encoded Unicode code points. +// It returns the byte index in s of the first Unicode +// code point satisfying f(c), or -1 if none do. +func IndexFunc(s []byte, f func(r rune) bool) int { + return indexFunc(s, f, true) +} + +// LastIndexFunc interprets s as a sequence of UTF-8-encoded Unicode code points. +// It returns the byte index in s of the last Unicode +// code point satisfying f(c), or -1 if none do. +func LastIndexFunc(s []byte, f func(r rune) bool) int { + return lastIndexFunc(s, f, true) +} + +// indexFunc is the same as IndexFunc except that if +// truth==false, the sense of the predicate function is +// inverted. +func indexFunc(s []byte, f func(r rune) bool, truth bool) int { + start := 0 + for start < len(s) { + wid := 1 + r := rune(s[start]) + if r >= utf8.RuneSelf { + r, wid = utf8.DecodeRune(s[start:]) + } + if f(r) == truth { + return start + } + start += wid + } + return -1 +} + +// lastIndexFunc is the same as LastIndexFunc except that if +// truth==false, the sense of the predicate function is +// inverted. +func lastIndexFunc(s []byte, f func(r rune) bool, truth bool) int { + for i := len(s); i > 0; { + r, size := rune(s[i-1]), 1 + if r >= utf8.RuneSelf { + r, size = utf8.DecodeLastRune(s[0:i]) + } + i -= size + if f(r) == truth { + return i + } + } + return -1 +} + +func makeCutsetFunc(cutset string) func(r rune) bool { + return func(r rune) bool { + for _, c := range cutset { + if c == r { + return true + } + } + return false + } +} + +// Trim returns a subslice of s by slicing off all leading and +// trailing UTF-8-encoded Unicode code points contained in cutset. +func Trim(s []byte, cutset string) []byte { + return TrimFunc(s, makeCutsetFunc(cutset)) +} + +// TrimLeft returns a subslice of s by slicing off all leading +// UTF-8-encoded Unicode code points contained in cutset. +func TrimLeft(s []byte, cutset string) []byte { + return TrimLeftFunc(s, makeCutsetFunc(cutset)) +} + +// TrimRight returns a subslice of s by slicing off all trailing +// UTF-8-encoded Unicode code points that are contained in cutset. +func TrimRight(s []byte, cutset string) []byte { + return TrimRightFunc(s, makeCutsetFunc(cutset)) +} + +// TrimSpace returns a subslice of s by slicing off all leading and +// trailing white space, as defined by Unicode. +func TrimSpace(s []byte) []byte { + return TrimFunc(s, unicode.IsSpace) +} + +// Runes returns a slice of runes (Unicode code points) equivalent to s. +func Runes(s []byte) []rune { + t := make([]rune, utf8.RuneCount(s)) + i := 0 + for len(s) > 0 { + r, l := utf8.DecodeRune(s) + t[i] = r + i++ + s = s[l:] + } + return t +} + +// Replace returns a copy of the slice s with the first n +// non-overlapping instances of old replaced by new. +// If old is empty, it matches at the beginning of the slice +// and after each UTF-8 sequence, yielding up to k+1 replacements +// for a k-rune slice. +// If n < 0, there is no limit on the number of replacements. +func Replace(s, old, new []byte, n int) []byte { + m := 0 + if n != 0 { + // Compute number of replacements. + m = Count(s, old) + } + if m == 0 { + // Just return a copy. + return append([]byte(nil), s...) + } + if n < 0 || m < n { + n = m + } + + // Apply replacements to buffer. + t := make([]byte, len(s)+n*(len(new)-len(old))) + w := 0 + start := 0 + for i := 0; i < n; i++ { + j := start + if len(old) == 0 { + if i > 0 { + _, wid := utf8.DecodeRune(s[start:]) + j += wid + } + } else { + j += Index(s[start:], old) + } + w += copy(t[w:], s[start:j]) + w += copy(t[w:], new) + start = j + len(old) + } + w += copy(t[w:], s[start:]) + return t[0:w] +} + +// EqualFold reports whether s and t, interpreted as UTF-8 strings, +// are equal under Unicode case-folding. +func EqualFold(s, t []byte) bool { + for len(s) != 0 && len(t) != 0 { + // Extract first rune from each. + var sr, tr rune + if s[0] < utf8.RuneSelf { + sr, s = rune(s[0]), s[1:] + } else { + r, size := utf8.DecodeRune(s) + sr, s = r, s[size:] + } + if t[0] < utf8.RuneSelf { + tr, t = rune(t[0]), t[1:] + } else { + r, size := utf8.DecodeRune(t) + tr, t = r, t[size:] + } + + // If they match, keep going; if not, return false. + + // Easy case. + if tr == sr { + continue + } + + // Make sr < tr to simplify what follows. + if tr < sr { + tr, sr = sr, tr + } + // Fast check for ASCII. + if tr < utf8.RuneSelf && 'A' <= sr && sr <= 'Z' { + // ASCII, and sr is upper case. tr must be lower case. + if tr == sr+'a'-'A' { + continue + } + return false + } + + // General case. SimpleFold(x) returns the next equivalent rune > x + // or wraps around to smaller values. + r := unicode.SimpleFold(sr) + for r != sr && r < tr { + r = unicode.SimpleFold(r) + } + if r == tr { + continue + } + return false + } + + // One string is empty. Are both? + return len(s) == len(t) +} diff --git a/src/bytes/bytes_decl.go b/src/bytes/bytes_decl.go new file mode 100644 index 0000000000000000000000000000000000000000..b453f21aa4352d33e8e32443e221e22fb2fee613 --- /dev/null +++ b/src/bytes/bytes_decl.go @@ -0,0 +1,24 @@ +// Copyright 2010 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package bytes + +//go:noescape + +// IndexByte returns the index of the first instance of c in s, or -1 if c is not present in s. +func IndexByte(s []byte, c byte) int // ../runtime/asm_$GOARCH.s + +//go:noescape + +// Equal returns a boolean reporting whether a and b +// are the same length and contain the same bytes. +// A nil argument is equivalent to an empty slice. +func Equal(a, b []byte) bool // ../runtime/asm_$GOARCH.s + +//go:noescape + +// Compare returns an integer comparing two byte slices lexicographically. +// The result will be 0 if a==b, -1 if a < b, and +1 if a > b. +// A nil argument is equivalent to an empty slice. +func Compare(a, b []byte) int // ../runtime/noasm.go or ../runtime/asm_{386,amd64}.s diff --git a/src/bytes/bytes_test.go b/src/bytes/bytes_test.go new file mode 100644 index 0000000000000000000000000000000000000000..6245e481805779e8665965053bde7cae4ce31e78 --- /dev/null +++ b/src/bytes/bytes_test.go @@ -0,0 +1,1257 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package bytes_test + +import ( + . "bytes" + "math/rand" + "reflect" + "testing" + "unicode" + "unicode/utf8" +) + +func eq(a, b []string) bool { + if len(a) != len(b) { + return false + } + for i := 0; i < len(a); i++ { + if a[i] != b[i] { + return false + } + } + return true +} + +func sliceOfString(s [][]byte) []string { + result := make([]string, len(s)) + for i, v := range s { + result[i] = string(v) + } + return result +} + +// For ease of reading, the test cases use strings that are converted to byte +// slices before invoking the functions. + +var abcd = "abcd" +var faces = "☺☻☹" +var commas = "1,2,3,4" +var dots = "1....2....3....4" + +type BinOpTest struct { + a string + b string + i int +} + +var equalTests = []struct { + a, b []byte + i int +}{ + {[]byte(""), []byte(""), 0}, + {[]byte("a"), []byte(""), 1}, + {[]byte(""), []byte("a"), -1}, + {[]byte("abc"), []byte("abc"), 0}, + {[]byte("ab"), []byte("abc"), -1}, + {[]byte("abc"), []byte("ab"), 1}, + {[]byte("x"), []byte("ab"), 1}, + {[]byte("ab"), []byte("x"), -1}, + {[]byte("x"), []byte("a"), 1}, + {[]byte("b"), []byte("x"), -1}, + // test runtime·memeq's chunked implementation + {[]byte("abcdefgh"), []byte("abcdefgh"), 0}, + {[]byte("abcdefghi"), []byte("abcdefghi"), 0}, + {[]byte("abcdefghi"), []byte("abcdefghj"), -1}, + // nil tests + {nil, nil, 0}, + {[]byte(""), nil, 0}, + {nil, []byte(""), 0}, + {[]byte("a"), nil, 1}, + {nil, []byte("a"), -1}, +} + +func TestEqual(t *testing.T) { + for _, tt := range compareTests { + eql := Equal(tt.a, tt.b) + if eql != (tt.i == 0) { + t.Errorf(`Equal(%q, %q) = %v`, tt.a, tt.b, eql) + } + eql = EqualPortable(tt.a, tt.b) + if eql != (tt.i == 0) { + t.Errorf(`EqualPortable(%q, %q) = %v`, tt.a, tt.b, eql) + } + } +} + +func TestEqualExhaustive(t *testing.T) { + var size = 128 + if testing.Short() { + size = 32 + } + a := make([]byte, size) + b := make([]byte, size) + b_init := make([]byte, size) + // randomish but deterministic data + for i := 0; i < size; i++ { + a[i] = byte(17 * i) + b_init[i] = byte(23*i + 100) + } + + for len := 0; len <= size; len++ { + for x := 0; x <= size-len; x++ { + for y := 0; y <= size-len; y++ { + copy(b, b_init) + copy(b[y:y+len], a[x:x+len]) + if !Equal(a[x:x+len], b[y:y+len]) || !Equal(b[y:y+len], a[x:x+len]) { + t.Errorf("Equal(%d, %d, %d) = false", len, x, y) + } + } + } + } +} + +// make sure Equal returns false for minimally different strings. The data +// is all zeros except for a single one in one location. +func TestNotEqual(t *testing.T) { + var size = 128 + if testing.Short() { + size = 32 + } + a := make([]byte, size) + b := make([]byte, size) + + for len := 0; len <= size; len++ { + for x := 0; x <= size-len; x++ { + for y := 0; y <= size-len; y++ { + for diffpos := x; diffpos < x+len; diffpos++ { + a[diffpos] = 1 + if Equal(a[x:x+len], b[y:y+len]) || Equal(b[y:y+len], a[x:x+len]) { + t.Errorf("NotEqual(%d, %d, %d, %d) = true", len, x, y, diffpos) + } + a[diffpos] = 0 + } + } + } + } +} + +var indexTests = []BinOpTest{ + {"", "", 0}, + {"", "a", -1}, + {"", "foo", -1}, + {"fo", "foo", -1}, + {"foo", "baz", -1}, + {"foo", "foo", 0}, + {"oofofoofooo", "f", 2}, + {"oofofoofooo", "foo", 4}, + {"barfoobarfoo", "foo", 3}, + {"foo", "", 0}, + {"foo", "o", 1}, + {"abcABCabc", "A", 3}, + // cases with one byte strings - test IndexByte and special case in Index() + {"", "a", -1}, + {"x", "a", -1}, + {"x", "x", 0}, + {"abc", "a", 0}, + {"abc", "b", 1}, + {"abc", "c", 2}, + {"abc", "x", -1}, + {"barfoobarfooyyyzzzyyyzzzyyyzzzyyyxxxzzzyyy", "x", 33}, + {"foofyfoobarfoobar", "y", 4}, + {"oooooooooooooooooooooo", "r", -1}, +} + +var lastIndexTests = []BinOpTest{ + {"", "", 0}, + {"", "a", -1}, + {"", "foo", -1}, + {"fo", "foo", -1}, + {"foo", "foo", 0}, + {"foo", "f", 0}, + {"oofofoofooo", "f", 7}, + {"oofofoofooo", "foo", 7}, + {"barfoobarfoo", "foo", 9}, + {"foo", "", 3}, + {"foo", "o", 2}, + {"abcABCabc", "A", 3}, + {"abcABCabc", "a", 6}, +} + +var indexAnyTests = []BinOpTest{ + {"", "", -1}, + {"", "a", -1}, + {"", "abc", -1}, + {"a", "", -1}, + {"a", "a", 0}, + {"aaa", "a", 0}, + {"abc", "xyz", -1}, + {"abc", "xcz", 2}, + {"ab☺c", "x☺yz", 2}, + {"aRegExp*", ".(|)*+?^$[]", 7}, + {dots + dots + dots, " ", -1}, +} + +var lastIndexAnyTests = []BinOpTest{ + {"", "", -1}, + {"", "a", -1}, + {"", "abc", -1}, + {"a", "", -1}, + {"a", "a", 0}, + {"aaa", "a", 2}, + {"abc", "xyz", -1}, + {"abc", "ab", 1}, + {"a☺b☻c☹d", "uvw☻xyz", 2 + len("☺")}, + {"a.RegExp*", ".(|)*+?^$[]", 8}, + {dots + dots + dots, " ", -1}, +} + +var indexRuneTests = []BinOpTest{ + {"", "a", -1}, + {"", "☺", -1}, + {"foo", "☹", -1}, + {"foo", "o", 1}, + {"foo☺bar", "☺", 3}, + {"foo☺☻☹bar", "☹", 9}, +} + +// Execute f on each test case. funcName should be the name of f; it's used +// in failure reports. +func runIndexTests(t *testing.T, f func(s, sep []byte) int, funcName string, testCases []BinOpTest) { + for _, test := range testCases { + a := []byte(test.a) + b := []byte(test.b) + actual := f(a, b) + if actual != test.i { + t.Errorf("%s(%q,%q) = %v; want %v", funcName, a, b, actual, test.i) + } + } +} + +func runIndexAnyTests(t *testing.T, f func(s []byte, chars string) int, funcName string, testCases []BinOpTest) { + for _, test := range testCases { + a := []byte(test.a) + actual := f(a, test.b) + if actual != test.i { + t.Errorf("%s(%q,%q) = %v; want %v", funcName, a, test.b, actual, test.i) + } + } +} + +func TestIndex(t *testing.T) { runIndexTests(t, Index, "Index", indexTests) } +func TestLastIndex(t *testing.T) { runIndexTests(t, LastIndex, "LastIndex", lastIndexTests) } +func TestIndexAny(t *testing.T) { runIndexAnyTests(t, IndexAny, "IndexAny", indexAnyTests) } +func TestLastIndexAny(t *testing.T) { + runIndexAnyTests(t, LastIndexAny, "LastIndexAny", lastIndexAnyTests) +} + +func TestIndexByte(t *testing.T) { + for _, tt := range indexTests { + if len(tt.b) != 1 { + continue + } + a := []byte(tt.a) + b := tt.b[0] + pos := IndexByte(a, b) + if pos != tt.i { + t.Errorf(`IndexByte(%q, '%c') = %v`, tt.a, b, pos) + } + posp := IndexBytePortable(a, b) + if posp != tt.i { + t.Errorf(`indexBytePortable(%q, '%c') = %v`, tt.a, b, posp) + } + } +} + +func TestLastIndexByte(t *testing.T) { + testCases := []BinOpTest{ + {"", "q", -1}, + {"abcdef", "q", -1}, + {"abcdefabcdef", "a", len("abcdef")}, // something in the middle + {"abcdefabcdef", "f", len("abcdefabcde")}, // last byte + {"zabcdefabcdef", "z", 0}, // first byte + {"a☺b☻c☹d", "b", len("a☺")}, // non-ascii + } + for _, test := range testCases { + actual := LastIndexByte([]byte(test.a), test.b[0]) + if actual != test.i { + t.Errorf("LastIndexByte(%q,%c) = %v; want %v", test.a, test.b[0], actual, test.i) + } + } +} + +// test a larger buffer with different sizes and alignments +func TestIndexByteBig(t *testing.T) { + var n = 1024 + if testing.Short() { + n = 128 + } + b := make([]byte, n) + for i := 0; i < n; i++ { + // different start alignments + b1 := b[i:] + for j := 0; j < len(b1); j++ { + b1[j] = 'x' + pos := IndexByte(b1, 'x') + if pos != j { + t.Errorf("IndexByte(%q, 'x') = %v", b1, pos) + } + b1[j] = 0 + pos = IndexByte(b1, 'x') + if pos != -1 { + t.Errorf("IndexByte(%q, 'x') = %v", b1, pos) + } + } + // different end alignments + b1 = b[:i] + for j := 0; j < len(b1); j++ { + b1[j] = 'x' + pos := IndexByte(b1, 'x') + if pos != j { + t.Errorf("IndexByte(%q, 'x') = %v", b1, pos) + } + b1[j] = 0 + pos = IndexByte(b1, 'x') + if pos != -1 { + t.Errorf("IndexByte(%q, 'x') = %v", b1, pos) + } + } + // different start and end alignments + b1 = b[i/2 : n-(i+1)/2] + for j := 0; j < len(b1); j++ { + b1[j] = 'x' + pos := IndexByte(b1, 'x') + if pos != j { + t.Errorf("IndexByte(%q, 'x') = %v", b1, pos) + } + b1[j] = 0 + pos = IndexByte(b1, 'x') + if pos != -1 { + t.Errorf("IndexByte(%q, 'x') = %v", b1, pos) + } + } + } +} + +func TestIndexRune(t *testing.T) { + for _, tt := range indexRuneTests { + a := []byte(tt.a) + r, _ := utf8.DecodeRuneInString(tt.b) + pos := IndexRune(a, r) + if pos != tt.i { + t.Errorf(`IndexRune(%q, '%c') = %v`, tt.a, r, pos) + } + } +} + +var bmbuf []byte + +func BenchmarkIndexByte32(b *testing.B) { bmIndexByte(b, IndexByte, 32) } +func BenchmarkIndexByte4K(b *testing.B) { bmIndexByte(b, IndexByte, 4<<10) } +func BenchmarkIndexByte4M(b *testing.B) { bmIndexByte(b, IndexByte, 4<<20) } +func BenchmarkIndexByte64M(b *testing.B) { bmIndexByte(b, IndexByte, 64<<20) } +func BenchmarkIndexBytePortable32(b *testing.B) { bmIndexByte(b, IndexBytePortable, 32) } +func BenchmarkIndexBytePortable4K(b *testing.B) { bmIndexByte(b, IndexBytePortable, 4<<10) } +func BenchmarkIndexBytePortable4M(b *testing.B) { bmIndexByte(b, IndexBytePortable, 4<<20) } +func BenchmarkIndexBytePortable64M(b *testing.B) { bmIndexByte(b, IndexBytePortable, 64<<20) } + +func bmIndexByte(b *testing.B, index func([]byte, byte) int, n int) { + if len(bmbuf) < n { + bmbuf = make([]byte, n) + } + b.SetBytes(int64(n)) + buf := bmbuf[0:n] + buf[n-1] = 'x' + for i := 0; i < b.N; i++ { + j := index(buf, 'x') + if j != n-1 { + b.Fatal("bad index", j) + } + } + buf[n-1] = '\x00' +} + +func BenchmarkEqual0(b *testing.B) { + var buf [4]byte + buf1 := buf[0:0] + buf2 := buf[1:1] + for i := 0; i < b.N; i++ { + eq := Equal(buf1, buf2) + if !eq { + b.Fatal("bad equal") + } + } +} + +func BenchmarkEqual1(b *testing.B) { bmEqual(b, Equal, 1) } +func BenchmarkEqual6(b *testing.B) { bmEqual(b, Equal, 6) } +func BenchmarkEqual9(b *testing.B) { bmEqual(b, Equal, 9) } +func BenchmarkEqual15(b *testing.B) { bmEqual(b, Equal, 15) } +func BenchmarkEqual16(b *testing.B) { bmEqual(b, Equal, 16) } +func BenchmarkEqual20(b *testing.B) { bmEqual(b, Equal, 20) } +func BenchmarkEqual32(b *testing.B) { bmEqual(b, Equal, 32) } +func BenchmarkEqual4K(b *testing.B) { bmEqual(b, Equal, 4<<10) } +func BenchmarkEqual4M(b *testing.B) { bmEqual(b, Equal, 4<<20) } +func BenchmarkEqual64M(b *testing.B) { bmEqual(b, Equal, 64<<20) } +func BenchmarkEqualPort1(b *testing.B) { bmEqual(b, EqualPortable, 1) } +func BenchmarkEqualPort6(b *testing.B) { bmEqual(b, EqualPortable, 6) } +func BenchmarkEqualPort32(b *testing.B) { bmEqual(b, EqualPortable, 32) } +func BenchmarkEqualPort4K(b *testing.B) { bmEqual(b, EqualPortable, 4<<10) } +func BenchmarkEqualPortable4M(b *testing.B) { bmEqual(b, EqualPortable, 4<<20) } +func BenchmarkEqualPortable64M(b *testing.B) { bmEqual(b, EqualPortable, 64<<20) } + +func bmEqual(b *testing.B, equal func([]byte, []byte) bool, n int) { + if len(bmbuf) < 2*n { + bmbuf = make([]byte, 2*n) + } + b.SetBytes(int64(n)) + buf1 := bmbuf[0:n] + buf2 := bmbuf[n : 2*n] + buf1[n-1] = 'x' + buf2[n-1] = 'x' + for i := 0; i < b.N; i++ { + eq := equal(buf1, buf2) + if !eq { + b.Fatal("bad equal") + } + } + buf1[n-1] = '\x00' + buf2[n-1] = '\x00' +} + +func BenchmarkIndex32(b *testing.B) { bmIndex(b, Index, 32) } +func BenchmarkIndex4K(b *testing.B) { bmIndex(b, Index, 4<<10) } +func BenchmarkIndex4M(b *testing.B) { bmIndex(b, Index, 4<<20) } +func BenchmarkIndex64M(b *testing.B) { bmIndex(b, Index, 64<<20) } + +func bmIndex(b *testing.B, index func([]byte, []byte) int, n int) { + if len(bmbuf) < n { + bmbuf = make([]byte, n) + } + b.SetBytes(int64(n)) + buf := bmbuf[0:n] + buf[n-1] = 'x' + for i := 0; i < b.N; i++ { + j := index(buf, buf[n-7:]) + if j != n-7 { + b.Fatal("bad index", j) + } + } + buf[n-1] = '\x00' +} + +func BenchmarkIndexEasy32(b *testing.B) { bmIndexEasy(b, Index, 32) } +func BenchmarkIndexEasy4K(b *testing.B) { bmIndexEasy(b, Index, 4<<10) } +func BenchmarkIndexEasy4M(b *testing.B) { bmIndexEasy(b, Index, 4<<20) } +func BenchmarkIndexEasy64M(b *testing.B) { bmIndexEasy(b, Index, 64<<20) } + +func bmIndexEasy(b *testing.B, index func([]byte, []byte) int, n int) { + if len(bmbuf) < n { + bmbuf = make([]byte, n) + } + b.SetBytes(int64(n)) + buf := bmbuf[0:n] + buf[n-1] = 'x' + buf[n-7] = 'x' + for i := 0; i < b.N; i++ { + j := index(buf, buf[n-7:]) + if j != n-7 { + b.Fatal("bad index", j) + } + } + buf[n-1] = '\x00' + buf[n-7] = '\x00' +} + +func BenchmarkCount32(b *testing.B) { bmCount(b, Count, 32) } +func BenchmarkCount4K(b *testing.B) { bmCount(b, Count, 4<<10) } +func BenchmarkCount4M(b *testing.B) { bmCount(b, Count, 4<<20) } +func BenchmarkCount64M(b *testing.B) { bmCount(b, Count, 64<<20) } + +func bmCount(b *testing.B, count func([]byte, []byte) int, n int) { + if len(bmbuf) < n { + bmbuf = make([]byte, n) + } + b.SetBytes(int64(n)) + buf := bmbuf[0:n] + buf[n-1] = 'x' + for i := 0; i < b.N; i++ { + j := count(buf, buf[n-7:]) + if j != 1 { + b.Fatal("bad count", j) + } + } + buf[n-1] = '\x00' +} + +func BenchmarkCountEasy32(b *testing.B) { bmCountEasy(b, Count, 32) } +func BenchmarkCountEasy4K(b *testing.B) { bmCountEasy(b, Count, 4<<10) } +func BenchmarkCountEasy4M(b *testing.B) { bmCountEasy(b, Count, 4<<20) } +func BenchmarkCountEasy64M(b *testing.B) { bmCountEasy(b, Count, 64<<20) } + +func bmCountEasy(b *testing.B, count func([]byte, []byte) int, n int) { + if len(bmbuf) < n { + bmbuf = make([]byte, n) + } + b.SetBytes(int64(n)) + buf := bmbuf[0:n] + buf[n-1] = 'x' + buf[n-7] = 'x' + for i := 0; i < b.N; i++ { + j := count(buf, buf[n-7:]) + if j != 1 { + b.Fatal("bad count", j) + } + } + buf[n-1] = '\x00' + buf[n-7] = '\x00' +} + +type ExplodeTest struct { + s string + n int + a []string +} + +var explodetests = []ExplodeTest{ + {"", -1, []string{}}, + {abcd, -1, []string{"a", "b", "c", "d"}}, + {faces, -1, []string{"☺", "☻", "☹"}}, + {abcd, 2, []string{"a", "bcd"}}, +} + +func TestExplode(t *testing.T) { + for _, tt := range explodetests { + a := SplitN([]byte(tt.s), nil, tt.n) + result := sliceOfString(a) + if !eq(result, tt.a) { + t.Errorf(`Explode("%s", %d) = %v; want %v`, tt.s, tt.n, result, tt.a) + continue + } + s := Join(a, []byte{}) + if string(s) != tt.s { + t.Errorf(`Join(Explode("%s", %d), "") = "%s"`, tt.s, tt.n, s) + } + } +} + +type SplitTest struct { + s string + sep string + n int + a []string +} + +var splittests = []SplitTest{ + {abcd, "a", 0, nil}, + {abcd, "a", -1, []string{"", "bcd"}}, + {abcd, "z", -1, []string{"abcd"}}, + {abcd, "", -1, []string{"a", "b", "c", "d"}}, + {commas, ",", -1, []string{"1", "2", "3", "4"}}, + {dots, "...", -1, []string{"1", ".2", ".3", ".4"}}, + {faces, "☹", -1, []string{"☺☻", ""}}, + {faces, "~", -1, []string{faces}}, + {faces, "", -1, []string{"☺", "☻", "☹"}}, + {"1 2 3 4", " ", 3, []string{"1", "2", "3 4"}}, + {"1 2", " ", 3, []string{"1", "2"}}, + {"123", "", 2, []string{"1", "23"}}, + {"123", "", 17, []string{"1", "2", "3"}}, +} + +func TestSplit(t *testing.T) { + for _, tt := range splittests { + a := SplitN([]byte(tt.s), []byte(tt.sep), tt.n) + result := sliceOfString(a) + if !eq(result, tt.a) { + t.Errorf(`Split(%q, %q, %d) = %v; want %v`, tt.s, tt.sep, tt.n, result, tt.a) + continue + } + if tt.n == 0 { + continue + } + s := Join(a, []byte(tt.sep)) + if string(s) != tt.s { + t.Errorf(`Join(Split(%q, %q, %d), %q) = %q`, tt.s, tt.sep, tt.n, tt.sep, s) + } + if tt.n < 0 { + b := Split([]byte(tt.s), []byte(tt.sep)) + if !reflect.DeepEqual(a, b) { + t.Errorf("Split disagrees withSplitN(%q, %q, %d) = %v; want %v", tt.s, tt.sep, tt.n, b, a) + } + } + if len(a) > 0 { + in, out := a[0], s + if cap(in) == cap(out) && &in[:1][0] == &out[:1][0] { + t.Errorf("Join(%#v, %q) didn't copy", a, tt.sep) + } + } + } +} + +var splitaftertests = []SplitTest{ + {abcd, "a", -1, []string{"a", "bcd"}}, + {abcd, "z", -1, []string{"abcd"}}, + {abcd, "", -1, []string{"a", "b", "c", "d"}}, + {commas, ",", -1, []string{"1,", "2,", "3,", "4"}}, + {dots, "...", -1, []string{"1...", ".2...", ".3...", ".4"}}, + {faces, "☹", -1, []string{"☺☻☹", ""}}, + {faces, "~", -1, []string{faces}}, + {faces, "", -1, []string{"☺", "☻", "☹"}}, + {"1 2 3 4", " ", 3, []string{"1 ", "2 ", "3 4"}}, + {"1 2 3", " ", 3, []string{"1 ", "2 ", "3"}}, + {"1 2", " ", 3, []string{"1 ", "2"}}, + {"123", "", 2, []string{"1", "23"}}, + {"123", "", 17, []string{"1", "2", "3"}}, +} + +func TestSplitAfter(t *testing.T) { + for _, tt := range splitaftertests { + a := SplitAfterN([]byte(tt.s), []byte(tt.sep), tt.n) + result := sliceOfString(a) + if !eq(result, tt.a) { + t.Errorf(`Split(%q, %q, %d) = %v; want %v`, tt.s, tt.sep, tt.n, result, tt.a) + continue + } + s := Join(a, nil) + if string(s) != tt.s { + t.Errorf(`Join(Split(%q, %q, %d), %q) = %q`, tt.s, tt.sep, tt.n, tt.sep, s) + } + if tt.n < 0 { + b := SplitAfter([]byte(tt.s), []byte(tt.sep)) + if !reflect.DeepEqual(a, b) { + t.Errorf("SplitAfter disagrees withSplitAfterN(%q, %q, %d) = %v; want %v", tt.s, tt.sep, tt.n, b, a) + } + } + } +} + +type FieldsTest struct { + s string + a []string +} + +var fieldstests = []FieldsTest{ + {"", []string{}}, + {" ", []string{}}, + {" \t ", []string{}}, + {" abc ", []string{"abc"}}, + {"1 2 3 4", []string{"1", "2", "3", "4"}}, + {"1 2 3 4", []string{"1", "2", "3", "4"}}, + {"1\t\t2\t\t3\t4", []string{"1", "2", "3", "4"}}, + {"1\u20002\u20013\u20024", []string{"1", "2", "3", "4"}}, + {"\u2000\u2001\u2002", []string{}}, + {"\n™\t™\n", []string{"™", "™"}}, + {faces, []string{faces}}, +} + +func TestFields(t *testing.T) { + for _, tt := range fieldstests { + a := Fields([]byte(tt.s)) + result := sliceOfString(a) + if !eq(result, tt.a) { + t.Errorf("Fields(%q) = %v; want %v", tt.s, a, tt.a) + continue + } + } +} + +func TestFieldsFunc(t *testing.T) { + for _, tt := range fieldstests { + a := FieldsFunc([]byte(tt.s), unicode.IsSpace) + result := sliceOfString(a) + if !eq(result, tt.a) { + t.Errorf("FieldsFunc(%q, unicode.IsSpace) = %v; want %v", tt.s, a, tt.a) + continue + } + } + pred := func(c rune) bool { return c == 'X' } + var fieldsFuncTests = []FieldsTest{ + {"", []string{}}, + {"XX", []string{}}, + {"XXhiXXX", []string{"hi"}}, + {"aXXbXXXcX", []string{"a", "b", "c"}}, + } + for _, tt := range fieldsFuncTests { + a := FieldsFunc([]byte(tt.s), pred) + result := sliceOfString(a) + if !eq(result, tt.a) { + t.Errorf("FieldsFunc(%q) = %v, want %v", tt.s, a, tt.a) + } + } +} + +// Test case for any function which accepts and returns a byte slice. +// For ease of creation, we write the byte slices as strings. +type StringTest struct { + in, out string +} + +var upperTests = []StringTest{ + {"", ""}, + {"abc", "ABC"}, + {"AbC123", "ABC123"}, + {"azAZ09_", "AZAZ09_"}, + {"\u0250\u0250\u0250\u0250\u0250", "\u2C6F\u2C6F\u2C6F\u2C6F\u2C6F"}, // grows one byte per char +} + +var lowerTests = []StringTest{ + {"", ""}, + {"abc", "abc"}, + {"AbC123", "abc123"}, + {"azAZ09_", "azaz09_"}, + {"\u2C6D\u2C6D\u2C6D\u2C6D\u2C6D", "\u0251\u0251\u0251\u0251\u0251"}, // shrinks one byte per char +} + +const space = "\t\v\r\f\n\u0085\u00a0\u2000\u3000" + +var trimSpaceTests = []StringTest{ + {"", ""}, + {"abc", "abc"}, + {space + "abc" + space, "abc"}, + {" ", ""}, + {" \t\r\n \t\t\r\r\n\n ", ""}, + {" \t\r\n x\t\t\r\r\n\n ", "x"}, + {" \u2000\t\r\n x\t\t\r\r\ny\n \u3000", "x\t\t\r\r\ny"}, + {"1 \t\r\n2", "1 \t\r\n2"}, + {" x\x80", "x\x80"}, + {" x\xc0", "x\xc0"}, + {"x \xc0\xc0 ", "x \xc0\xc0"}, + {"x \xc0", "x \xc0"}, + {"x \xc0 ", "x \xc0"}, + {"x \xc0\xc0 ", "x \xc0\xc0"}, + {"x ☺\xc0\xc0 ", "x ☺\xc0\xc0"}, + {"x ☺ ", "x ☺"}, +} + +// Execute f on each test case. funcName should be the name of f; it's used +// in failure reports. +func runStringTests(t *testing.T, f func([]byte) []byte, funcName string, testCases []StringTest) { + for _, tc := range testCases { + actual := string(f([]byte(tc.in))) + if actual != tc.out { + t.Errorf("%s(%q) = %q; want %q", funcName, tc.in, actual, tc.out) + } + } +} + +func tenRunes(r rune) string { + runes := make([]rune, 10) + for i := range runes { + runes[i] = r + } + return string(runes) +} + +// User-defined self-inverse mapping function +func rot13(r rune) rune { + const step = 13 + if r >= 'a' && r <= 'z' { + return ((r - 'a' + step) % 26) + 'a' + } + if r >= 'A' && r <= 'Z' { + return ((r - 'A' + step) % 26) + 'A' + } + return r +} + +func TestMap(t *testing.T) { + // Run a couple of awful growth/shrinkage tests + a := tenRunes('a') + + // 1. Grow. This triggers two reallocations in Map. + maxRune := func(r rune) rune { return unicode.MaxRune } + m := Map(maxRune, []byte(a)) + expect := tenRunes(unicode.MaxRune) + if string(m) != expect { + t.Errorf("growing: expected %q got %q", expect, m) + } + + // 2. Shrink + minRune := func(r rune) rune { return 'a' } + m = Map(minRune, []byte(tenRunes(unicode.MaxRune))) + expect = a + if string(m) != expect { + t.Errorf("shrinking: expected %q got %q", expect, m) + } + + // 3. Rot13 + m = Map(rot13, []byte("a to zed")) + expect = "n gb mrq" + if string(m) != expect { + t.Errorf("rot13: expected %q got %q", expect, m) + } + + // 4. Rot13^2 + m = Map(rot13, Map(rot13, []byte("a to zed"))) + expect = "a to zed" + if string(m) != expect { + t.Errorf("rot13: expected %q got %q", expect, m) + } + + // 5. Drop + dropNotLatin := func(r rune) rune { + if unicode.Is(unicode.Latin, r) { + return r + } + return -1 + } + m = Map(dropNotLatin, []byte("Hello, 세계")) + expect = "Hello" + if string(m) != expect { + t.Errorf("drop: expected %q got %q", expect, m) + } + + // 6. Invalid rune + invalidRune := func(r rune) rune { + return utf8.MaxRune + 1 + } + m = Map(invalidRune, []byte("x")) + expect = "\uFFFD" + if string(m) != expect { + t.Errorf("invalidRune: expected %q got %q", expect, m) + } +} + +func TestToUpper(t *testing.T) { runStringTests(t, ToUpper, "ToUpper", upperTests) } + +func TestToLower(t *testing.T) { runStringTests(t, ToLower, "ToLower", lowerTests) } + +func TestTrimSpace(t *testing.T) { runStringTests(t, TrimSpace, "TrimSpace", trimSpaceTests) } + +type RepeatTest struct { + in, out string + count int +} + +var RepeatTests = []RepeatTest{ + {"", "", 0}, + {"", "", 1}, + {"", "", 2}, + {"-", "", 0}, + {"-", "-", 1}, + {"-", "----------", 10}, + {"abc ", "abc abc abc ", 3}, +} + +func TestRepeat(t *testing.T) { + for _, tt := range RepeatTests { + tin := []byte(tt.in) + tout := []byte(tt.out) + a := Repeat(tin, tt.count) + if !Equal(a, tout) { + t.Errorf("Repeat(%q, %d) = %q; want %q", tin, tt.count, a, tout) + continue + } + } +} + +func runesEqual(a, b []rune) bool { + if len(a) != len(b) { + return false + } + for i, r := range a { + if r != b[i] { + return false + } + } + return true +} + +type RunesTest struct { + in string + out []rune + lossy bool +} + +var RunesTests = []RunesTest{ + {"", []rune{}, false}, + {" ", []rune{32}, false}, + {"ABC", []rune{65, 66, 67}, false}, + {"abc", []rune{97, 98, 99}, false}, + {"\u65e5\u672c\u8a9e", []rune{26085, 26412, 35486}, false}, + {"ab\x80c", []rune{97, 98, 0xFFFD, 99}, true}, + {"ab\xc0c", []rune{97, 98, 0xFFFD, 99}, true}, +} + +func TestRunes(t *testing.T) { + for _, tt := range RunesTests { + tin := []byte(tt.in) + a := Runes(tin) + if !runesEqual(a, tt.out) { + t.Errorf("Runes(%q) = %v; want %v", tin, a, tt.out) + continue + } + if !tt.lossy { + // can only test reassembly if we didn't lose information + s := string(a) + if s != tt.in { + t.Errorf("string(Runes(%q)) = %x; want %x", tin, s, tin) + } + } + } +} + +type TrimTest struct { + f string + in, arg, out string +} + +var trimTests = []TrimTest{ + {"Trim", "abba", "a", "bb"}, + {"Trim", "abba", "ab", ""}, + {"TrimLeft", "abba", "ab", ""}, + {"TrimRight", "abba", "ab", ""}, + {"TrimLeft", "abba", "a", "bba"}, + {"TrimRight", "abba", "a", "abb"}, + {"Trim", "", "<>", "tag"}, + {"Trim", "* listitem", " *", "listitem"}, + {"Trim", `"quote"`, `"`, "quote"}, + {"Trim", "\u2C6F\u2C6F\u0250\u0250\u2C6F\u2C6F", "\u2C6F", "\u0250\u0250"}, + //empty string tests + {"Trim", "abba", "", "abba"}, + {"Trim", "", "123", ""}, + {"Trim", "", "", ""}, + {"TrimLeft", "abba", "", "abba"}, + {"TrimLeft", "", "123", ""}, + {"TrimLeft", "", "", ""}, + {"TrimRight", "abba", "", "abba"}, + {"TrimRight", "", "123", ""}, + {"TrimRight", "", "", ""}, + {"TrimRight", "☺\xc0", "☺", "☺\xc0"}, + {"TrimPrefix", "aabb", "a", "abb"}, + {"TrimPrefix", "aabb", "b", "aabb"}, + {"TrimSuffix", "aabb", "a", "aabb"}, + {"TrimSuffix", "aabb", "b", "aab"}, +} + +func TestTrim(t *testing.T) { + for _, tc := range trimTests { + name := tc.f + var f func([]byte, string) []byte + var fb func([]byte, []byte) []byte + switch name { + case "Trim": + f = Trim + case "TrimLeft": + f = TrimLeft + case "TrimRight": + f = TrimRight + case "TrimPrefix": + fb = TrimPrefix + case "TrimSuffix": + fb = TrimSuffix + default: + t.Errorf("Undefined trim function %s", name) + } + var actual string + if f != nil { + actual = string(f([]byte(tc.in), tc.arg)) + } else { + actual = string(fb([]byte(tc.in), []byte(tc.arg))) + } + if actual != tc.out { + t.Errorf("%s(%q, %q) = %q; want %q", name, tc.in, tc.arg, actual, tc.out) + } + } +} + +type predicate struct { + f func(r rune) bool + name string +} + +var isSpace = predicate{unicode.IsSpace, "IsSpace"} +var isDigit = predicate{unicode.IsDigit, "IsDigit"} +var isUpper = predicate{unicode.IsUpper, "IsUpper"} +var isValidRune = predicate{ + func(r rune) bool { + return r != utf8.RuneError + }, + "IsValidRune", +} + +type TrimFuncTest struct { + f predicate + in, out string +} + +func not(p predicate) predicate { + return predicate{ + func(r rune) bool { + return !p.f(r) + }, + "not " + p.name, + } +} + +var trimFuncTests = []TrimFuncTest{ + {isSpace, space + " hello " + space, "hello"}, + {isDigit, "\u0e50\u0e5212hello34\u0e50\u0e51", "hello"}, + {isUpper, "\u2C6F\u2C6F\u2C6F\u2C6FABCDhelloEF\u2C6F\u2C6FGH\u2C6F\u2C6F", "hello"}, + {not(isSpace), "hello" + space + "hello", space}, + {not(isDigit), "hello\u0e50\u0e521234\u0e50\u0e51helo", "\u0e50\u0e521234\u0e50\u0e51"}, + {isValidRune, "ab\xc0a\xc0cd", "\xc0a\xc0"}, + {not(isValidRune), "\xc0a\xc0", "a"}, +} + +func TestTrimFunc(t *testing.T) { + for _, tc := range trimFuncTests { + actual := string(TrimFunc([]byte(tc.in), tc.f.f)) + if actual != tc.out { + t.Errorf("TrimFunc(%q, %q) = %q; want %q", tc.in, tc.f.name, actual, tc.out) + } + } +} + +type IndexFuncTest struct { + in string + f predicate + first, last int +} + +var indexFuncTests = []IndexFuncTest{ + {"", isValidRune, -1, -1}, + {"abc", isDigit, -1, -1}, + {"0123", isDigit, 0, 3}, + {"a1b", isDigit, 1, 1}, + {space, isSpace, 0, len(space) - 3}, // last rune in space is 3 bytes + {"\u0e50\u0e5212hello34\u0e50\u0e51", isDigit, 0, 18}, + {"\u2C6F\u2C6F\u2C6F\u2C6FABCDhelloEF\u2C6F\u2C6FGH\u2C6F\u2C6F", isUpper, 0, 34}, + {"12\u0e50\u0e52hello34\u0e50\u0e51", not(isDigit), 8, 12}, + + // tests of invalid UTF-8 + {"\x801", isDigit, 1, 1}, + {"\x80abc", isDigit, -1, -1}, + {"\xc0a\xc0", isValidRune, 1, 1}, + {"\xc0a\xc0", not(isValidRune), 0, 2}, + {"\xc0☺\xc0", not(isValidRune), 0, 4}, + {"\xc0☺\xc0\xc0", not(isValidRune), 0, 5}, + {"ab\xc0a\xc0cd", not(isValidRune), 2, 4}, + {"a\xe0\x80cd", not(isValidRune), 1, 2}, +} + +func TestIndexFunc(t *testing.T) { + for _, tc := range indexFuncTests { + first := IndexFunc([]byte(tc.in), tc.f.f) + if first != tc.first { + t.Errorf("IndexFunc(%q, %s) = %d; want %d", tc.in, tc.f.name, first, tc.first) + } + last := LastIndexFunc([]byte(tc.in), tc.f.f) + if last != tc.last { + t.Errorf("LastIndexFunc(%q, %s) = %d; want %d", tc.in, tc.f.name, last, tc.last) + } + } +} + +type ReplaceTest struct { + in string + old, new string + n int + out string +} + +var ReplaceTests = []ReplaceTest{ + {"hello", "l", "L", 0, "hello"}, + {"hello", "l", "L", -1, "heLLo"}, + {"hello", "x", "X", -1, "hello"}, + {"", "x", "X", -1, ""}, + {"radar", "r", "", -1, "ada"}, + {"", "", "<>", -1, "<>"}, + {"banana", "a", "<>", -1, "b<>n<>n<>"}, + {"banana", "a", "<>", 1, "b<>nana"}, + {"banana", "a", "<>", 1000, "b<>n<>n<>"}, + {"banana", "an", "<>", -1, "b<><>a"}, + {"banana", "ana", "<>", -1, "b<>na"}, + {"banana", "", "<>", -1, "<>b<>a<>n<>a<>n<>a<>"}, + {"banana", "", "<>", 10, "<>b<>a<>n<>a<>n<>a<>"}, + {"banana", "", "<>", 6, "<>b<>a<>n<>a<>n<>a"}, + {"banana", "", "<>", 5, "<>b<>a<>n<>a<>na"}, + {"banana", "", "<>", 1, "<>banana"}, + {"banana", "a", "a", -1, "banana"}, + {"banana", "a", "a", 1, "banana"}, + {"☺☻☹", "", "<>", -1, "<>☺<>☻<>☹<>"}, +} + +func TestReplace(t *testing.T) { + for _, tt := range ReplaceTests { + in := append([]byte(tt.in), ""...) + in = in[:len(tt.in)] + out := Replace(in, []byte(tt.old), []byte(tt.new), tt.n) + if s := string(out); s != tt.out { + t.Errorf("Replace(%q, %q, %q, %d) = %q, want %q", tt.in, tt.old, tt.new, tt.n, s, tt.out) + } + if cap(in) == cap(out) && &in[:1][0] == &out[:1][0] { + t.Errorf("Replace(%q, %q, %q, %d) didn't copy", tt.in, tt.old, tt.new, tt.n) + } + } +} + +type TitleTest struct { + in, out string +} + +var TitleTests = []TitleTest{ + {"", ""}, + {"a", "A"}, + {" aaa aaa aaa ", " Aaa Aaa Aaa "}, + {" Aaa Aaa Aaa ", " Aaa Aaa Aaa "}, + {"123a456", "123a456"}, + {"double-blind", "Double-Blind"}, + {"ÿøû", "Ÿøû"}, + {"with_underscore", "With_underscore"}, + {"unicode \xe2\x80\xa8 line separator", "Unicode \xe2\x80\xa8 Line Separator"}, +} + +func TestTitle(t *testing.T) { + for _, tt := range TitleTests { + if s := string(Title([]byte(tt.in))); s != tt.out { + t.Errorf("Title(%q) = %q, want %q", tt.in, s, tt.out) + } + } +} + +var ToTitleTests = []TitleTest{ + {"", ""}, + {"a", "A"}, + {" aaa aaa aaa ", " AAA AAA AAA "}, + {" Aaa Aaa Aaa ", " AAA AAA AAA "}, + {"123a456", "123A456"}, + {"double-blind", "DOUBLE-BLIND"}, + {"ÿøû", "ŸØÛ"}, +} + +func TestToTitle(t *testing.T) { + for _, tt := range ToTitleTests { + if s := string(ToTitle([]byte(tt.in))); s != tt.out { + t.Errorf("ToTitle(%q) = %q, want %q", tt.in, s, tt.out) + } + } +} + +var EqualFoldTests = []struct { + s, t string + out bool +}{ + {"abc", "abc", true}, + {"ABcd", "ABcd", true}, + {"123abc", "123ABC", true}, + {"αβδ", "ΑΒΔ", true}, + {"abc", "xyz", false}, + {"abc", "XYZ", false}, + {"abcdefghijk", "abcdefghijX", false}, + {"abcdefghijk", "abcdefghij\u212A", true}, + {"abcdefghijK", "abcdefghij\u212A", true}, + {"abcdefghijkz", "abcdefghij\u212Ay", false}, + {"abcdefghijKz", "abcdefghij\u212Ay", false}, +} + +func TestEqualFold(t *testing.T) { + for _, tt := range EqualFoldTests { + if out := EqualFold([]byte(tt.s), []byte(tt.t)); out != tt.out { + t.Errorf("EqualFold(%#q, %#q) = %v, want %v", tt.s, tt.t, out, tt.out) + } + if out := EqualFold([]byte(tt.t), []byte(tt.s)); out != tt.out { + t.Errorf("EqualFold(%#q, %#q) = %v, want %v", tt.t, tt.s, out, tt.out) + } + } +} + +func TestBufferGrowNegative(t *testing.T) { + defer func() { + if err := recover(); err == nil { + t.Fatal("Grow(-1) should have panicked") + } + }() + var b Buffer + b.Grow(-1) +} + +func TestBufferTruncateNegative(t *testing.T) { + defer func() { + if err := recover(); err == nil { + t.Fatal("Truncate(-1) should have panicked") + } + }() + var b Buffer + b.Truncate(-1) +} + +func TestBufferTruncateOutOfRange(t *testing.T) { + defer func() { + if err := recover(); err == nil { + t.Fatal("Truncate(20) should have panicked") + } + }() + var b Buffer + b.Write(make([]byte, 10)) + b.Truncate(20) +} + +var containsTests = []struct { + b, subslice []byte + want bool +}{ + {[]byte("hello"), []byte("hel"), true}, + {[]byte("日本語"), []byte("日本"), true}, + {[]byte("hello"), []byte("Hello, world"), false}, + {[]byte("東京"), []byte("京東"), false}, +} + +func TestContains(t *testing.T) { + for _, tt := range containsTests { + if got := Contains(tt.b, tt.subslice); got != tt.want { + t.Errorf("Contains(%q, %q) = %v, want %v", tt.b, tt.subslice, got, tt.want) + } + } +} + +var makeFieldsInput = func() []byte { + x := make([]byte, 1<<20) + // Input is ~10% space, ~10% 2-byte UTF-8, rest ASCII non-space. + for i := range x { + switch rand.Intn(10) { + case 0: + x[i] = ' ' + case 1: + if i > 0 && x[i-1] == 'x' { + copy(x[i-1:], "χ") + break + } + fallthrough + default: + x[i] = 'x' + } + } + return x +} + +var fieldsInput = makeFieldsInput() + +func BenchmarkFields(b *testing.B) { + b.SetBytes(int64(len(fieldsInput))) + for i := 0; i < b.N; i++ { + Fields(fieldsInput) + } +} + +func BenchmarkFieldsFunc(b *testing.B) { + b.SetBytes(int64(len(fieldsInput))) + for i := 0; i < b.N; i++ { + FieldsFunc(fieldsInput, unicode.IsSpace) + } +} + +func BenchmarkTrimSpace(b *testing.B) { + s := []byte(" Some text. \n") + for i := 0; i < b.N; i++ { + TrimSpace(s) + } +} + +func BenchmarkRepeat(b *testing.B) { + for i := 0; i < b.N; i++ { + Repeat([]byte("-"), 80) + } +} diff --git a/src/bytes/compare_test.go b/src/bytes/compare_test.go new file mode 100644 index 0000000000000000000000000000000000000000..f2d81d5310c0b915eeb304a8bae03f4b60d47d82 --- /dev/null +++ b/src/bytes/compare_test.go @@ -0,0 +1,211 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package bytes_test + +import ( + . "bytes" + "testing" +) + +var compareTests = []struct { + a, b []byte + i int +}{ + {[]byte(""), []byte(""), 0}, + {[]byte("a"), []byte(""), 1}, + {[]byte(""), []byte("a"), -1}, + {[]byte("abc"), []byte("abc"), 0}, + {[]byte("abd"), []byte("abc"), 1}, + {[]byte("abc"), []byte("abd"), -1}, + {[]byte("ab"), []byte("abc"), -1}, + {[]byte("abc"), []byte("ab"), 1}, + {[]byte("x"), []byte("ab"), 1}, + {[]byte("ab"), []byte("x"), -1}, + {[]byte("x"), []byte("a"), 1}, + {[]byte("b"), []byte("x"), -1}, + // test runtime·memeq's chunked implementation + {[]byte("abcdefgh"), []byte("abcdefgh"), 0}, + {[]byte("abcdefghi"), []byte("abcdefghi"), 0}, + {[]byte("abcdefghi"), []byte("abcdefghj"), -1}, + {[]byte("abcdefghj"), []byte("abcdefghi"), 1}, + // nil tests + {nil, nil, 0}, + {[]byte(""), nil, 0}, + {nil, []byte(""), 0}, + {[]byte("a"), nil, 1}, + {nil, []byte("a"), -1}, +} + +func TestCompare(t *testing.T) { + for _, tt := range compareTests { + cmp := Compare(tt.a, tt.b) + if cmp != tt.i { + t.Errorf(`Compare(%q, %q) = %v`, tt.a, tt.b, cmp) + } + } +} + +func TestCompareIdenticalSlice(t *testing.T) { + var b = []byte("Hello Gophers!") + if Compare(b, b) != 0 { + t.Error("b != b") + } + if Compare(b, b[:1]) != 1 { + t.Error("b > b[:1] failed") + } +} + +func TestCompareBytes(t *testing.T) { + n := 128 + a := make([]byte, n+1) + b := make([]byte, n+1) + for len := 0; len < 128; len++ { + // randomish but deterministic data. No 0 or 255. + for i := 0; i < len; i++ { + a[i] = byte(1 + 31*i%254) + b[i] = byte(1 + 31*i%254) + } + // data past the end is different + for i := len; i <= n; i++ { + a[i] = 8 + b[i] = 9 + } + cmp := Compare(a[:len], b[:len]) + if cmp != 0 { + t.Errorf(`CompareIdentical(%d) = %d`, len, cmp) + } + if len > 0 { + cmp = Compare(a[:len-1], b[:len]) + if cmp != -1 { + t.Errorf(`CompareAshorter(%d) = %d`, len, cmp) + } + cmp = Compare(a[:len], b[:len-1]) + if cmp != 1 { + t.Errorf(`CompareBshorter(%d) = %d`, len, cmp) + } + } + for k := 0; k < len; k++ { + b[k] = a[k] - 1 + cmp = Compare(a[:len], b[:len]) + if cmp != 1 { + t.Errorf(`CompareAbigger(%d,%d) = %d`, len, k, cmp) + } + b[k] = a[k] + 1 + cmp = Compare(a[:len], b[:len]) + if cmp != -1 { + t.Errorf(`CompareBbigger(%d,%d) = %d`, len, k, cmp) + } + b[k] = a[k] + } + } +} + +func BenchmarkCompareBytesEqual(b *testing.B) { + b1 := []byte("Hello Gophers!") + b2 := []byte("Hello Gophers!") + for i := 0; i < b.N; i++ { + if Compare(b1, b2) != 0 { + b.Fatal("b1 != b2") + } + } +} + +func BenchmarkCompareBytesToNil(b *testing.B) { + b1 := []byte("Hello Gophers!") + var b2 []byte + for i := 0; i < b.N; i++ { + if Compare(b1, b2) != 1 { + b.Fatal("b1 > b2 failed") + } + } +} + +func BenchmarkCompareBytesEmpty(b *testing.B) { + b1 := []byte("") + b2 := b1 + for i := 0; i < b.N; i++ { + if Compare(b1, b2) != 0 { + b.Fatal("b1 != b2") + } + } +} + +func BenchmarkCompareBytesIdentical(b *testing.B) { + b1 := []byte("Hello Gophers!") + b2 := b1 + for i := 0; i < b.N; i++ { + if Compare(b1, b2) != 0 { + b.Fatal("b1 != b2") + } + } +} + +func BenchmarkCompareBytesSameLength(b *testing.B) { + b1 := []byte("Hello Gophers!") + b2 := []byte("Hello, Gophers") + for i := 0; i < b.N; i++ { + if Compare(b1, b2) != -1 { + b.Fatal("b1 < b2 failed") + } + } +} + +func BenchmarkCompareBytesDifferentLength(b *testing.B) { + b1 := []byte("Hello Gophers!") + b2 := []byte("Hello, Gophers!") + for i := 0; i < b.N; i++ { + if Compare(b1, b2) != -1 { + b.Fatal("b1 < b2 failed") + } + } +} + +func BenchmarkCompareBytesBigUnaligned(b *testing.B) { + b.StopTimer() + b1 := make([]byte, 0, 1<<20) + for len(b1) < 1<<20 { + b1 = append(b1, "Hello Gophers!"...) + } + b2 := append([]byte("hello"), b1...) + b.StartTimer() + for i := 0; i < b.N; i++ { + if Compare(b1, b2[len("hello"):]) != 0 { + b.Fatal("b1 != b2") + } + } + b.SetBytes(int64(len(b1))) +} + +func BenchmarkCompareBytesBig(b *testing.B) { + b.StopTimer() + b1 := make([]byte, 0, 1<<20) + for len(b1) < 1<<20 { + b1 = append(b1, "Hello Gophers!"...) + } + b2 := append([]byte{}, b1...) + b.StartTimer() + for i := 0; i < b.N; i++ { + if Compare(b1, b2) != 0 { + b.Fatal("b1 != b2") + } + } + b.SetBytes(int64(len(b1))) +} + +func BenchmarkCompareBytesBigIdentical(b *testing.B) { + b.StopTimer() + b1 := make([]byte, 0, 1<<20) + for len(b1) < 1<<20 { + b1 = append(b1, "Hello Gophers!"...) + } + b2 := b1 + b.StartTimer() + for i := 0; i < b.N; i++ { + if Compare(b1, b2) != 0 { + b.Fatal("b1 != b2") + } + } + b.SetBytes(int64(len(b1))) +} diff --git a/src/bytes/equal_test.go b/src/bytes/equal_test.go new file mode 100644 index 0000000000000000000000000000000000000000..1bf19a74b80193c8be4d7952b18981ec0228e153 --- /dev/null +++ b/src/bytes/equal_test.go @@ -0,0 +1,47 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. +// +// +build linux + +package bytes_test + +import ( + . "bytes" + "syscall" + "testing" + "unsafe" +) + +// This file tests the situation where memeq is checking +// data very near to a page boundary. We want to make sure +// equal does not read across the boundary and cause a page +// fault where it shouldn't. + +// This test runs only on linux. The code being tested is +// not OS-specific, so it does not need to be tested on all +// operating systems. + +func TestEqualNearPageBoundary(t *testing.T) { + pagesize := syscall.Getpagesize() + b := make([]byte, 4*pagesize) + i := pagesize + for ; uintptr(unsafe.Pointer(&b[i]))%uintptr(pagesize) != 0; i++ { + } + syscall.Mprotect(b[i-pagesize:i], 0) + syscall.Mprotect(b[i+pagesize:i+2*pagesize], 0) + defer syscall.Mprotect(b[i-pagesize:i], syscall.PROT_READ|syscall.PROT_WRITE) + defer syscall.Mprotect(b[i+pagesize:i+2*pagesize], syscall.PROT_READ|syscall.PROT_WRITE) + + // both of these should fault + //pagesize += int(b[i-1]) + //pagesize += int(b[i+pagesize]) + + for j := 0; j < pagesize; j++ { + b[i+j] = 'A' + } + for j := 0; j <= pagesize; j++ { + Equal(b[i:i+j], b[i+pagesize-j:i+pagesize]) + Equal(b[i+pagesize-j:i+pagesize], b[i:i+j]) + } +} diff --git a/src/bytes/example_test.go b/src/bytes/example_test.go new file mode 100644 index 0000000000000000000000000000000000000000..ad2dbc69b77a73362fbd79dfe318c61b0ae0c026 --- /dev/null +++ b/src/bytes/example_test.go @@ -0,0 +1,85 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package bytes_test + +import ( + "bytes" + "encoding/base64" + "fmt" + "io" + "os" + "sort" +) + +func ExampleBuffer() { + var b bytes.Buffer // A Buffer needs no initialization. + b.Write([]byte("Hello ")) + fmt.Fprintf(&b, "world!") + b.WriteTo(os.Stdout) + // Output: Hello world! +} + +func ExampleBuffer_reader() { + // A Buffer can turn a string or a []byte into an io.Reader. + buf := bytes.NewBufferString("R29waGVycyBydWxlIQ==") + dec := base64.NewDecoder(base64.StdEncoding, buf) + io.Copy(os.Stdout, dec) + // Output: Gophers rule! +} + +func ExampleCompare() { + // Interpret Compare's result by comparing it to zero. + var a, b []byte + if bytes.Compare(a, b) < 0 { + // a less b + } + if bytes.Compare(a, b) <= 0 { + // a less or equal b + } + if bytes.Compare(a, b) > 0 { + // a greater b + } + if bytes.Compare(a, b) >= 0 { + // a greater or equal b + } + + // Prefer Equal to Compare for equality comparisons. + if bytes.Equal(a, b) { + // a equal b + } + if !bytes.Equal(a, b) { + // a not equal b + } +} + +func ExampleCompare_search() { + // Binary search to find a matching byte slice. + var needle []byte + var haystack [][]byte // Assume sorted + i := sort.Search(len(haystack), func(i int) bool { + // Return haystack[i] >= needle. + return bytes.Compare(haystack[i], needle) >= 0 + }) + if i < len(haystack) && bytes.Equal(haystack[i], needle) { + // Found it! + } +} + +func ExampleTrimSuffix() { + var b = []byte("Hello, goodbye, etc!") + b = bytes.TrimSuffix(b, []byte("goodbye, etc!")) + b = bytes.TrimSuffix(b, []byte("gopher")) + b = append(b, bytes.TrimSuffix([]byte("world!"), []byte("x!"))...) + os.Stdout.Write(b) + // Output: Hello, world! +} + +func ExampleTrimPrefix() { + var b = []byte("Goodbye,, world!") + b = bytes.TrimPrefix(b, []byte("Goodbye,")) + b = bytes.TrimPrefix(b, []byte("See ya,")) + fmt.Printf("Hello%s", b) + // Output: Hello, world! +} diff --git a/src/bytes/export_test.go b/src/bytes/export_test.go new file mode 100644 index 0000000000000000000000000000000000000000..f61523e60bbb3fd209594912ebcaa76cde9acd20 --- /dev/null +++ b/src/bytes/export_test.go @@ -0,0 +1,9 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package bytes + +// Export func for testing +var IndexBytePortable = indexBytePortable +var EqualPortable = equalPortable diff --git a/src/bytes/reader.go b/src/bytes/reader.go new file mode 100644 index 0000000000000000000000000000000000000000..b89d1548f1b78ea16e5fa1bdb25e4228a5c684c9 --- /dev/null +++ b/src/bytes/reader.go @@ -0,0 +1,150 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package bytes + +import ( + "errors" + "io" + "unicode/utf8" +) + +// A Reader implements the io.Reader, io.ReaderAt, io.WriterTo, io.Seeker, +// io.ByteScanner, and io.RuneScanner interfaces by reading from +// a byte slice. +// Unlike a Buffer, a Reader is read-only and supports seeking. +type Reader struct { + s []byte + i int64 // current reading index + prevRune int // index of previous rune; or < 0 +} + +// Len returns the number of bytes of the unread portion of the +// slice. +func (r *Reader) Len() int { + if r.i >= int64(len(r.s)) { + return 0 + } + return int(int64(len(r.s)) - r.i) +} + +// Size returns the original length of the underlying byte slice. +// Size is the number of bytes available for reading via ReadAt. +// The returned value is always the same and is not affected by calls +// to any other method. +func (r *Reader) Size() int64 { return int64(len(r.s)) } + +func (r *Reader) Read(b []byte) (n int, err error) { + if len(b) == 0 { + return 0, nil + } + if r.i >= int64(len(r.s)) { + return 0, io.EOF + } + r.prevRune = -1 + n = copy(b, r.s[r.i:]) + r.i += int64(n) + return +} + +func (r *Reader) ReadAt(b []byte, off int64) (n int, err error) { + // cannot modify state - see io.ReaderAt + if off < 0 { + return 0, errors.New("bytes.Reader.ReadAt: negative offset") + } + if off >= int64(len(r.s)) { + return 0, io.EOF + } + n = copy(b, r.s[off:]) + if n < len(b) { + err = io.EOF + } + return +} + +func (r *Reader) ReadByte() (b byte, err error) { + r.prevRune = -1 + if r.i >= int64(len(r.s)) { + return 0, io.EOF + } + b = r.s[r.i] + r.i++ + return +} + +func (r *Reader) UnreadByte() error { + r.prevRune = -1 + if r.i <= 0 { + return errors.New("bytes.Reader.UnreadByte: at beginning of slice") + } + r.i-- + return nil +} + +func (r *Reader) ReadRune() (ch rune, size int, err error) { + if r.i >= int64(len(r.s)) { + r.prevRune = -1 + return 0, 0, io.EOF + } + r.prevRune = int(r.i) + if c := r.s[r.i]; c < utf8.RuneSelf { + r.i++ + return rune(c), 1, nil + } + ch, size = utf8.DecodeRune(r.s[r.i:]) + r.i += int64(size) + return +} + +func (r *Reader) UnreadRune() error { + if r.prevRune < 0 { + return errors.New("bytes.Reader.UnreadRune: previous operation was not ReadRune") + } + r.i = int64(r.prevRune) + r.prevRune = -1 + return nil +} + +// Seek implements the io.Seeker interface. +func (r *Reader) Seek(offset int64, whence int) (int64, error) { + r.prevRune = -1 + var abs int64 + switch whence { + case 0: + abs = offset + case 1: + abs = int64(r.i) + offset + case 2: + abs = int64(len(r.s)) + offset + default: + return 0, errors.New("bytes.Reader.Seek: invalid whence") + } + if abs < 0 { + return 0, errors.New("bytes.Reader.Seek: negative position") + } + r.i = abs + return abs, nil +} + +// WriteTo implements the io.WriterTo interface. +func (r *Reader) WriteTo(w io.Writer) (n int64, err error) { + r.prevRune = -1 + if r.i >= int64(len(r.s)) { + return 0, nil + } + b := r.s[r.i:] + m, err := w.Write(b) + if m > len(b) { + panic("bytes.Reader.WriteTo: invalid Write count") + } + r.i += int64(m) + n = int64(m) + if m != len(b) && err == nil { + err = io.ErrShortWrite + } + return +} + +// NewReader returns a new Reader reading from b. +func NewReader(b []byte) *Reader { return &Reader{b, 0, -1} } diff --git a/src/bytes/reader_test.go b/src/bytes/reader_test.go new file mode 100644 index 0000000000000000000000000000000000000000..b929a2826096d501966925b00244c3af79dee42a --- /dev/null +++ b/src/bytes/reader_test.go @@ -0,0 +1,258 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package bytes_test + +import ( + . "bytes" + "fmt" + "io" + "io/ioutil" + "os" + "sync" + "testing" +) + +func TestReader(t *testing.T) { + r := NewReader([]byte("0123456789")) + tests := []struct { + off int64 + seek int + n int + want string + wantpos int64 + seekerr string + }{ + {seek: os.SEEK_SET, off: 0, n: 20, want: "0123456789"}, + {seek: os.SEEK_SET, off: 1, n: 1, want: "1"}, + {seek: os.SEEK_CUR, off: 1, wantpos: 3, n: 2, want: "34"}, + {seek: os.SEEK_SET, off: -1, seekerr: "bytes.Reader.Seek: negative position"}, + {seek: os.SEEK_SET, off: 1 << 33, wantpos: 1 << 33}, + {seek: os.SEEK_CUR, off: 1, wantpos: 1<<33 + 1}, + {seek: os.SEEK_SET, n: 5, want: "01234"}, + {seek: os.SEEK_CUR, n: 5, want: "56789"}, + {seek: os.SEEK_END, off: -1, n: 1, wantpos: 9, want: "9"}, + } + + for i, tt := range tests { + pos, err := r.Seek(tt.off, tt.seek) + if err == nil && tt.seekerr != "" { + t.Errorf("%d. want seek error %q", i, tt.seekerr) + continue + } + if err != nil && err.Error() != tt.seekerr { + t.Errorf("%d. seek error = %q; want %q", i, err.Error(), tt.seekerr) + continue + } + if tt.wantpos != 0 && tt.wantpos != pos { + t.Errorf("%d. pos = %d, want %d", i, pos, tt.wantpos) + } + buf := make([]byte, tt.n) + n, err := r.Read(buf) + if err != nil { + t.Errorf("%d. read = %v", i, err) + continue + } + got := string(buf[:n]) + if got != tt.want { + t.Errorf("%d. got %q; want %q", i, got, tt.want) + } + } +} + +func TestReadAfterBigSeek(t *testing.T) { + r := NewReader([]byte("0123456789")) + if _, err := r.Seek(1<<31+5, os.SEEK_SET); err != nil { + t.Fatal(err) + } + if n, err := r.Read(make([]byte, 10)); n != 0 || err != io.EOF { + t.Errorf("Read = %d, %v; want 0, EOF", n, err) + } +} + +func TestReaderAt(t *testing.T) { + r := NewReader([]byte("0123456789")) + tests := []struct { + off int64 + n int + want string + wanterr interface{} + }{ + {0, 10, "0123456789", nil}, + {1, 10, "123456789", io.EOF}, + {1, 9, "123456789", nil}, + {11, 10, "", io.EOF}, + {0, 0, "", nil}, + {-1, 0, "", "bytes.Reader.ReadAt: negative offset"}, + } + for i, tt := range tests { + b := make([]byte, tt.n) + rn, err := r.ReadAt(b, tt.off) + got := string(b[:rn]) + if got != tt.want { + t.Errorf("%d. got %q; want %q", i, got, tt.want) + } + if fmt.Sprintf("%v", err) != fmt.Sprintf("%v", tt.wanterr) { + t.Errorf("%d. got error = %v; want %v", i, err, tt.wanterr) + } + } +} + +func TestReaderAtConcurrent(t *testing.T) { + // Test for the race detector, to verify ReadAt doesn't mutate + // any state. + r := NewReader([]byte("0123456789")) + var wg sync.WaitGroup + for i := 0; i < 5; i++ { + wg.Add(1) + go func(i int) { + defer wg.Done() + var buf [1]byte + r.ReadAt(buf[:], int64(i)) + }(i) + } + wg.Wait() +} + +func TestEmptyReaderConcurrent(t *testing.T) { + // Test for the race detector, to verify a Read that doesn't yield any bytes + // is okay to use from multiple goroutines. This was our historic behavior. + // See golang.org/issue/7856 + r := NewReader([]byte{}) + var wg sync.WaitGroup + for i := 0; i < 5; i++ { + wg.Add(2) + go func() { + defer wg.Done() + var buf [1]byte + r.Read(buf[:]) + }() + go func() { + defer wg.Done() + r.Read(nil) + }() + } + wg.Wait() +} + +func TestReaderWriteTo(t *testing.T) { + for i := 0; i < 30; i += 3 { + var l int + if i > 0 { + l = len(data) / i + } + s := data[:l] + r := NewReader(testBytes[:l]) + var b Buffer + n, err := r.WriteTo(&b) + if expect := int64(len(s)); n != expect { + t.Errorf("got %v; want %v", n, expect) + } + if err != nil { + t.Errorf("for length %d: got error = %v; want nil", l, err) + } + if b.String() != s { + t.Errorf("got string %q; want %q", b.String(), s) + } + if r.Len() != 0 { + t.Errorf("reader contains %v bytes; want 0", r.Len()) + } + } +} + +func TestReaderLen(t *testing.T) { + const data = "hello world" + r := NewReader([]byte(data)) + if got, want := r.Len(), 11; got != want { + t.Errorf("r.Len(): got %d, want %d", got, want) + } + if n, err := r.Read(make([]byte, 10)); err != nil || n != 10 { + t.Errorf("Read failed: read %d %v", n, err) + } + if got, want := r.Len(), 1; got != want { + t.Errorf("r.Len(): got %d, want %d", got, want) + } + if n, err := r.Read(make([]byte, 1)); err != nil || n != 1 { + t.Errorf("Read failed: read %d %v", n, err) + } + if got, want := r.Len(), 0; got != want { + t.Errorf("r.Len(): got %d, want %d", got, want) + } +} + +var UnreadRuneErrorTests = []struct { + name string + f func(*Reader) +}{ + {"Read", func(r *Reader) { r.Read([]byte{0}) }}, + {"ReadByte", func(r *Reader) { r.ReadByte() }}, + {"UnreadRune", func(r *Reader) { r.UnreadRune() }}, + {"Seek", func(r *Reader) { r.Seek(0, 1) }}, + {"WriteTo", func(r *Reader) { r.WriteTo(&Buffer{}) }}, +} + +func TestUnreadRuneError(t *testing.T) { + for _, tt := range UnreadRuneErrorTests { + reader := NewReader([]byte("0123456789")) + if _, _, err := reader.ReadRune(); err != nil { + // should not happen + t.Fatal(err) + } + tt.f(reader) + err := reader.UnreadRune() + if err == nil { + t.Errorf("Unreading after %s: expected error", tt.name) + } + } +} + +func TestReaderDoubleUnreadRune(t *testing.T) { + buf := NewBuffer([]byte("groucho")) + if _, _, err := buf.ReadRune(); err != nil { + // should not happen + t.Fatal(err) + } + if err := buf.UnreadByte(); err != nil { + // should not happen + t.Fatal(err) + } + if err := buf.UnreadByte(); err == nil { + t.Fatal("UnreadByte: expected error, got nil") + } +} + +// verify that copying from an empty reader always has the same results, +// regardless of the presence of a WriteTo method. +func TestReaderCopyNothing(t *testing.T) { + type nErr struct { + n int64 + err error + } + type justReader struct { + io.Reader + } + type justWriter struct { + io.Writer + } + discard := justWriter{ioutil.Discard} // hide ReadFrom + + var with, withOut nErr + with.n, with.err = io.Copy(discard, NewReader(nil)) + withOut.n, withOut.err = io.Copy(discard, justReader{NewReader(nil)}) + if with != withOut { + t.Errorf("behavior differs: with = %#v; without: %#v", with, withOut) + } +} + +// tests that Len is affected by reads, but Size is not. +func TestReaderLenSize(t *testing.T) { + r := NewReader([]byte("abc")) + io.CopyN(ioutil.Discard, r, 1) + if r.Len() != 2 { + t.Errorf("Len = %d; want 2", r.Len()) + } + if r.Size() != 3 { + t.Errorf("Size = %d; want 3", r.Size()) + } +} diff --git a/src/clean.bash b/src/clean.bash new file mode 100755 index 0000000000000000000000000000000000000000..39fe36d46df2713cad0632847f9552dc0d8474d6 --- /dev/null +++ b/src/clean.bash @@ -0,0 +1,22 @@ +#!/usr/bin/env bash +# Copyright 2009 The Go Authors. All rights reserved. +# Use of this source code is governed by a BSD-style +# license that can be found in the LICENSE file. + +set -e + +if [ ! -f run.bash ]; then + echo 'clean.bash must be run from $GOROOT/src' 1>&2 + exit 1 +fi +export GOROOT="$(cd .. && pwd)" + +gobin="${GOBIN:-../bin}" +if ! "$gobin"/go help >/dev/null 2>&1; then + echo 'cannot find go command; nothing to clean' >&2 + exit 1 +fi + +"$gobin/go" clean -i std +"$gobin/go" tool dist clean +"$gobin/go" clean -i cmd diff --git a/src/clean.bat b/src/clean.bat new file mode 100644 index 0000000000000000000000000000000000000000..3cc6a689bc2e46537106fac196aa28c93eb7c68b --- /dev/null +++ b/src/clean.bat @@ -0,0 +1,31 @@ +:: Copyright 2012 The Go Authors. All rights reserved. +:: Use of this source code is governed by a BSD-style +:: license that can be found in the LICENSE file. +@echo off + +setlocal + +set GOBUILDFAIL=0 + +go tool dist env -w -p >env.bat +if errorlevel 1 goto fail +call env.bat +del env.bat +echo. + +if exist %GOTOOLDIR%\dist.exe goto distok +echo cannot find %GOTOOLDIR%\dist; nothing to clean +goto fail +:distok + +"%GOBIN%\go" clean -i std +"%GOBIN%\go" tool dist clean +"%GOBIN%\go" clean -i cmd + +goto end + +:fail +set GOBUILDFAIL=1 + +:end +if x%GOBUILDEXIT%==x1 exit %GOBUILDFAIL% diff --git a/src/clean.rc b/src/clean.rc new file mode 100755 index 0000000000000000000000000000000000000000..23bbd6032683747f25ca9676cd47c3c203362170 --- /dev/null +++ b/src/clean.rc @@ -0,0 +1,15 @@ +#!/bin/rc -e +# Copyright 2012 The Go Authors. All rights reserved. +# Use of this source code is governed by a BSD-style +# license that can be found in the LICENSE file. + +eval `{go tool dist env -9} + +if(! test -x $GOTOOLDIR/dist){ + echo 'cannot find $GOTOOLDIR/dist; nothing to clean' >[1=2] + exit noclean +} + +$GOBIN/go clean -i std +$GOBIN/go tool dist clean +$GOBIN/go clean -i cmd diff --git a/src/cmd/addr2line/addr2line_test.go b/src/cmd/addr2line/addr2line_test.go new file mode 100644 index 0000000000000000000000000000000000000000..620b416c2cca8eb7f53e2106e718af6b5ab2faf2 --- /dev/null +++ b/src/cmd/addr2line/addr2line_test.go @@ -0,0 +1,108 @@ +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +import ( + "bufio" + "bytes" + "internal/testenv" + "io/ioutil" + "os" + "os/exec" + "path/filepath" + "runtime" + "strings" + "testing" +) + +func loadSyms(t *testing.T) map[string]string { + cmd := exec.Command("go", "tool", "nm", os.Args[0]) + out, err := cmd.CombinedOutput() + if err != nil { + t.Fatalf("go tool nm %v: %v\n%s", os.Args[0], err, string(out)) + } + syms := make(map[string]string) + scanner := bufio.NewScanner(bytes.NewReader(out)) + for scanner.Scan() { + f := strings.Fields(scanner.Text()) + if len(f) < 3 { + continue + } + syms[f[2]] = f[0] + } + if err := scanner.Err(); err != nil { + t.Fatalf("error reading symbols: %v", err) + } + return syms +} + +func runAddr2Line(t *testing.T, exepath, addr string) (funcname, path, lineno string) { + cmd := exec.Command(exepath, os.Args[0]) + cmd.Stdin = strings.NewReader(addr) + out, err := cmd.CombinedOutput() + if err != nil { + t.Fatalf("go tool addr2line %v: %v\n%s", os.Args[0], err, string(out)) + } + f := strings.Split(string(out), "\n") + if len(f) < 3 && f[2] == "" { + t.Fatal("addr2line output must have 2 lines") + } + funcname = f[0] + pathAndLineNo := f[1] + f = strings.Split(pathAndLineNo, ":") + if runtime.GOOS == "windows" && len(f) == 3 { + // Reattach drive letter. + f = []string{f[0] + ":" + f[1], f[2]} + } + if len(f) != 2 { + t.Fatalf("no line number found in %q", pathAndLineNo) + } + return funcname, f[0], f[1] +} + +const symName = "cmd/addr2line.TestAddr2Line" + +func testAddr2Line(t *testing.T, exepath, addr string) { + funcName, srcPath, srcLineNo := runAddr2Line(t, exepath, addr) + if symName != funcName { + t.Fatalf("expected function name %v; got %v", symName, funcName) + } + fi1, err := os.Stat("addr2line_test.go") + if err != nil { + t.Fatalf("Stat failed: %v", err) + } + fi2, err := os.Stat(srcPath) + if err != nil { + t.Fatalf("Stat failed: %v", err) + } + if !os.SameFile(fi1, fi2) { + t.Fatalf("addr2line_test.go and %s are not same file", srcPath) + } + if srcLineNo != "89" { + t.Fatalf("line number = %v; want 89", srcLineNo) + } +} + +// This is line 88. The test depends on that. +func TestAddr2Line(t *testing.T) { + testenv.MustHaveGoBuild(t) + + syms := loadSyms(t) + + tmpDir, err := ioutil.TempDir("", "TestAddr2Line") + if err != nil { + t.Fatal("TempDir failed: ", err) + } + defer os.RemoveAll(tmpDir) + + exepath := filepath.Join(tmpDir, "testaddr2line.exe") + out, err := exec.Command("go", "build", "-o", exepath, "cmd/addr2line").CombinedOutput() + if err != nil { + t.Fatalf("go build -o %v cmd/addr2line: %v\n%s", exepath, err, string(out)) + } + + testAddr2Line(t, exepath, syms[symName]) + testAddr2Line(t, exepath, "0x"+syms[symName]) +} diff --git a/src/cmd/addr2line/main.go b/src/cmd/addr2line/main.go new file mode 100644 index 0000000000000000000000000000000000000000..267f4170a82faad46d68f03b75860d87ecf3b192 --- /dev/null +++ b/src/cmd/addr2line/main.go @@ -0,0 +1,95 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Addr2line is a minimal simulation of the GNU addr2line tool, +// just enough to support pprof. +// +// Usage: +// go tool addr2line binary +// +// Addr2line reads hexadecimal addresses, one per line and with optional 0x prefix, +// from standard input. For each input address, addr2line prints two output lines, +// first the name of the function containing the address and second the file:line +// of the source code corresponding to that address. +// +// This tool is intended for use only by pprof; its interface may change or +// it may be deleted entirely in future releases. +package main + +import ( + "bufio" + "flag" + "fmt" + "log" + "os" + "strconv" + "strings" + + "cmd/internal/objfile" +) + +func printUsage(w *os.File) { + fmt.Fprintf(w, "usage: addr2line binary\n") + fmt.Fprintf(w, "reads addresses from standard input and writes two lines for each:\n") + fmt.Fprintf(w, "\tfunction name\n") + fmt.Fprintf(w, "\tfile:line\n") +} + +func usage() { + printUsage(os.Stderr) + os.Exit(2) +} + +func main() { + log.SetFlags(0) + log.SetPrefix("addr2line: ") + + // pprof expects this behavior when checking for addr2line + if len(os.Args) > 1 && os.Args[1] == "--help" { + printUsage(os.Stdout) + os.Exit(0) + } + + flag.Usage = usage + flag.Parse() + if flag.NArg() != 1 { + usage() + } + + f, err := objfile.Open(flag.Arg(0)) + if err != nil { + log.Fatal(err) + } + + tab, err := f.PCLineTable() + if err != nil { + log.Fatalf("reading %s: %v", flag.Arg(0), err) + } + + stdin := bufio.NewScanner(os.Stdin) + stdout := bufio.NewWriter(os.Stdout) + + for stdin.Scan() { + p := stdin.Text() + if strings.Contains(p, ":") { + // Reverse translate file:line to pc. + // This was an extension in the old C version of 'go tool addr2line' + // and is probably not used by anyone, but recognize the syntax. + // We don't have an implementation. + fmt.Fprintf(stdout, "!reverse translation not implemented\n") + continue + } + pc, _ := strconv.ParseUint(strings.TrimPrefix(p, "0x"), 16, 64) + file, line, fn := tab.PCToLine(pc) + name := "?" + if fn != nil { + name = fn.Name + } else { + file = "?" + line = 0 + } + fmt.Fprintf(stdout, "%s\n%s:%d\n", name, file, line) + } + stdout.Flush() +} diff --git a/src/cmd/api/goapi.go b/src/cmd/api/goapi.go new file mode 100644 index 0000000000000000000000000000000000000000..01b6defb5ff9ef271849179af753e729dd21caf0 --- /dev/null +++ b/src/cmd/api/goapi.go @@ -0,0 +1,828 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Binary api computes the exported API of a set of Go packages. +package main + +import ( + "bufio" + "bytes" + "flag" + "fmt" + "go/ast" + "go/build" + "go/parser" + "go/token" + "go/types" + "io" + "io/ioutil" + "log" + "os" + "os/exec" + "path/filepath" + "regexp" + "runtime" + "sort" + "strings" +) + +// Flags +var ( + checkFile = flag.String("c", "", "optional comma-separated filename(s) to check API against") + allowNew = flag.Bool("allow_new", true, "allow API additions") + exceptFile = flag.String("except", "", "optional filename of packages that are allowed to change without triggering a failure in the tool") + nextFile = flag.String("next", "", "optional filename of tentative upcoming API features for the next release. This file can be lazily maintained. It only affects the delta warnings from the -c file printed on success.") + verbose = flag.Bool("v", false, "verbose debugging") + forceCtx = flag.String("contexts", "", "optional comma-separated list of -[-cgo] to override default contexts.") +) + +// contexts are the default contexts which are scanned, unless +// overridden by the -contexts flag. +var contexts = []*build.Context{ + {GOOS: "linux", GOARCH: "386", CgoEnabled: true}, + {GOOS: "linux", GOARCH: "386"}, + {GOOS: "linux", GOARCH: "amd64", CgoEnabled: true}, + {GOOS: "linux", GOARCH: "amd64"}, + {GOOS: "linux", GOARCH: "arm", CgoEnabled: true}, + {GOOS: "linux", GOARCH: "arm"}, + {GOOS: "darwin", GOARCH: "386", CgoEnabled: true}, + {GOOS: "darwin", GOARCH: "386"}, + {GOOS: "darwin", GOARCH: "amd64", CgoEnabled: true}, + {GOOS: "darwin", GOARCH: "amd64"}, + {GOOS: "windows", GOARCH: "amd64"}, + {GOOS: "windows", GOARCH: "386"}, + {GOOS: "freebsd", GOARCH: "386", CgoEnabled: true}, + {GOOS: "freebsd", GOARCH: "386"}, + {GOOS: "freebsd", GOARCH: "amd64", CgoEnabled: true}, + {GOOS: "freebsd", GOARCH: "amd64"}, + {GOOS: "freebsd", GOARCH: "arm", CgoEnabled: true}, + {GOOS: "freebsd", GOARCH: "arm"}, + {GOOS: "netbsd", GOARCH: "386", CgoEnabled: true}, + {GOOS: "netbsd", GOARCH: "386"}, + {GOOS: "netbsd", GOARCH: "amd64", CgoEnabled: true}, + {GOOS: "netbsd", GOARCH: "amd64"}, + {GOOS: "netbsd", GOARCH: "arm", CgoEnabled: true}, + {GOOS: "netbsd", GOARCH: "arm"}, + {GOOS: "openbsd", GOARCH: "386", CgoEnabled: true}, + {GOOS: "openbsd", GOARCH: "386"}, + {GOOS: "openbsd", GOARCH: "amd64", CgoEnabled: true}, + {GOOS: "openbsd", GOARCH: "amd64"}, +} + +func contextName(c *build.Context) string { + s := c.GOOS + "-" + c.GOARCH + if c.CgoEnabled { + return s + "-cgo" + } + return s +} + +func parseContext(c string) *build.Context { + parts := strings.Split(c, "-") + if len(parts) < 2 { + log.Fatalf("bad context: %q", c) + } + bc := &build.Context{ + GOOS: parts[0], + GOARCH: parts[1], + } + if len(parts) == 3 { + if parts[2] == "cgo" { + bc.CgoEnabled = true + } else { + log.Fatalf("bad context: %q", c) + } + } + return bc +} + +func setContexts() { + contexts = []*build.Context{} + for _, c := range strings.Split(*forceCtx, ",") { + contexts = append(contexts, parseContext(c)) + } +} + +var internalPkg = regexp.MustCompile(`(^|/)internal($|/)`) + +func main() { + flag.Parse() + + if !strings.Contains(runtime.Version(), "weekly") && !strings.Contains(runtime.Version(), "devel") { + if *nextFile != "" { + fmt.Printf("Go version is %q, ignoring -next %s\n", runtime.Version(), *nextFile) + *nextFile = "" + } + } + + if *forceCtx != "" { + setContexts() + } + for _, c := range contexts { + c.Compiler = build.Default.Compiler + } + + var pkgNames []string + if flag.NArg() > 0 { + pkgNames = flag.Args() + } else { + stds, err := exec.Command("go", "list", "std").Output() + if err != nil { + log.Fatal(err) + } + for _, pkg := range strings.Fields(string(stds)) { + if !internalPkg.MatchString(pkg) { + pkgNames = append(pkgNames, pkg) + } + } + } + + var featureCtx = make(map[string]map[string]bool) // feature -> context name -> true + for _, context := range contexts { + w := NewWalker(context, filepath.Join(build.Default.GOROOT, "src")) + + for _, name := range pkgNames { + // - Package "unsafe" contains special signatures requiring + // extra care when printing them - ignore since it is not + // going to change w/o a language change. + // - We don't care about the API of commands. + if name != "unsafe" && !strings.HasPrefix(name, "cmd/") { + if name == "runtime/cgo" && !context.CgoEnabled { + // w.Import(name) will return nil + continue + } + pkg, _ := w.Import(name) + w.export(pkg) + } + } + + ctxName := contextName(context) + for _, f := range w.Features() { + if featureCtx[f] == nil { + featureCtx[f] = make(map[string]bool) + } + featureCtx[f][ctxName] = true + } + } + + var features []string + for f, cmap := range featureCtx { + if len(cmap) == len(contexts) { + features = append(features, f) + continue + } + comma := strings.Index(f, ",") + for cname := range cmap { + f2 := fmt.Sprintf("%s (%s)%s", f[:comma], cname, f[comma:]) + features = append(features, f2) + } + } + + fail := false + defer func() { + if fail { + os.Exit(1) + } + }() + + bw := bufio.NewWriter(os.Stdout) + defer bw.Flush() + + if *checkFile == "" { + sort.Strings(features) + for _, f := range features { + fmt.Fprintln(bw, f) + } + return + } + + var required []string + for _, file := range strings.Split(*checkFile, ",") { + required = append(required, fileFeatures(file)...) + } + optional := fileFeatures(*nextFile) + exception := fileFeatures(*exceptFile) + fail = !compareAPI(bw, features, required, optional, exception, + *allowNew && strings.Contains(runtime.Version(), "devel")) +} + +// export emits the exported package features. +func (w *Walker) export(pkg *types.Package) { + if *verbose { + log.Println(pkg) + } + pop := w.pushScope("pkg " + pkg.Path()) + w.current = pkg + scope := pkg.Scope() + for _, name := range scope.Names() { + if ast.IsExported(name) { + w.emitObj(scope.Lookup(name)) + } + } + pop() +} + +func set(items []string) map[string]bool { + s := make(map[string]bool) + for _, v := range items { + s[v] = true + } + return s +} + +var spaceParensRx = regexp.MustCompile(` \(\S+?\)`) + +func featureWithoutContext(f string) string { + if !strings.Contains(f, "(") { + return f + } + return spaceParensRx.ReplaceAllString(f, "") +} + +func compareAPI(w io.Writer, features, required, optional, exception []string, allowAdd bool) (ok bool) { + ok = true + + optionalSet := set(optional) + exceptionSet := set(exception) + featureSet := set(features) + + sort.Strings(features) + sort.Strings(required) + + take := func(sl *[]string) string { + s := (*sl)[0] + *sl = (*sl)[1:] + return s + } + + for len(required) > 0 || len(features) > 0 { + switch { + case len(features) == 0 || (len(required) > 0 && required[0] < features[0]): + feature := take(&required) + if exceptionSet[feature] { + // An "unfortunate" case: the feature was once + // included in the API (e.g. go1.txt), but was + // subsequently removed. These are already + // acknowledged by being in the file + // "api/except.txt". No need to print them out + // here. + } else if featureSet[featureWithoutContext(feature)] { + // okay. + } else { + fmt.Fprintf(w, "-%s\n", feature) + ok = false // broke compatibility + } + case len(required) == 0 || (len(features) > 0 && required[0] > features[0]): + newFeature := take(&features) + if optionalSet[newFeature] { + // Known added feature to the upcoming release. + // Delete it from the map so we can detect any upcoming features + // which were never seen. (so we can clean up the nextFile) + delete(optionalSet, newFeature) + } else { + fmt.Fprintf(w, "+%s\n", newFeature) + if !allowAdd { + ok = false // we're in lock-down mode for next release + } + } + default: + take(&required) + take(&features) + } + } + + // In next file, but not in API. + var missing []string + for feature := range optionalSet { + missing = append(missing, feature) + } + sort.Strings(missing) + for _, feature := range missing { + fmt.Fprintf(w, "±%s\n", feature) + } + return +} + +func fileFeatures(filename string) []string { + if filename == "" { + return nil + } + bs, err := ioutil.ReadFile(filename) + if err != nil { + log.Fatalf("Error reading file %s: %v", filename, err) + } + lines := strings.Split(string(bs), "\n") + var nonblank []string + for _, line := range lines { + line = strings.TrimSpace(line) + if line != "" && !strings.HasPrefix(line, "#") { + nonblank = append(nonblank, line) + } + } + return nonblank +} + +var fset = token.NewFileSet() + +type Walker struct { + context *build.Context + root string + scope []string + current *types.Package + features map[string]bool // set + imported map[string]*types.Package // packages already imported +} + +func NewWalker(context *build.Context, root string) *Walker { + return &Walker{ + context: context, + root: root, + features: map[string]bool{}, + imported: map[string]*types.Package{"unsafe": types.Unsafe}, + } +} + +func (w *Walker) Features() (fs []string) { + for f := range w.features { + fs = append(fs, f) + } + sort.Strings(fs) + return +} + +var parsedFileCache = make(map[string]*ast.File) + +func (w *Walker) parseFile(dir, file string) (*ast.File, error) { + filename := filepath.Join(dir, file) + if f := parsedFileCache[filename]; f != nil { + return f, nil + } + + f, err := parser.ParseFile(fset, filename, nil, 0) + if err != nil { + return nil, err + } + parsedFileCache[filename] = f + + return f, nil +} + +func contains(list []string, s string) bool { + for _, t := range list { + if t == s { + return true + } + } + return false +} + +// The package cache doesn't operate correctly in rare (so far artificial) +// circumstances (issue 8425). Disable before debugging non-obvious errors +// from the type-checker. +const usePkgCache = true + +var ( + pkgCache = map[string]*types.Package{} // map tagKey to package + pkgTags = map[string][]string{} // map import dir to list of relevant tags +) + +// tagKey returns the tag-based key to use in the pkgCache. +// It is a comma-separated string; the first part is dir, the rest tags. +// The satisfied tags are derived from context but only those that +// matter (the ones listed in the tags argument) are used. +// The tags list, which came from go/build's Package.AllTags, +// is known to be sorted. +func tagKey(dir string, context *build.Context, tags []string) string { + ctags := map[string]bool{ + context.GOOS: true, + context.GOARCH: true, + } + if context.CgoEnabled { + ctags["cgo"] = true + } + for _, tag := range context.BuildTags { + ctags[tag] = true + } + // TODO: ReleaseTags (need to load default) + key := dir + for _, tag := range tags { + if ctags[tag] { + key += "," + tag + } + } + return key +} + +// Importing is a sentinel taking the place in Walker.imported +// for a package that is in the process of being imported. +var importing types.Package + +func (w *Walker) Import(name string) (*types.Package, error) { + pkg := w.imported[name] + if pkg != nil { + if pkg == &importing { + log.Fatalf("cycle importing package %q", name) + } + return pkg, nil + } + w.imported[name] = &importing + + // Determine package files. + dir := filepath.Join(w.root, filepath.FromSlash(name)) + if fi, err := os.Stat(dir); err != nil || !fi.IsDir() { + log.Fatalf("no source in tree for package %q", pkg) + } + + context := w.context + if context == nil { + context = &build.Default + } + + // Look in cache. + // If we've already done an import with the same set + // of relevant tags, reuse the result. + var key string + if usePkgCache { + if tags, ok := pkgTags[dir]; ok { + key = tagKey(dir, context, tags) + if pkg := pkgCache[key]; pkg != nil { + w.imported[name] = pkg + return pkg, nil + } + } + } + + info, err := context.ImportDir(dir, 0) + if err != nil { + if _, nogo := err.(*build.NoGoError); nogo { + return nil, nil + } + log.Fatalf("pkg %q, dir %q: ScanDir: %v", name, dir, err) + } + + // Save tags list first time we see a directory. + if usePkgCache { + if _, ok := pkgTags[dir]; !ok { + pkgTags[dir] = info.AllTags + key = tagKey(dir, context, info.AllTags) + } + } + + filenames := append(append([]string{}, info.GoFiles...), info.CgoFiles...) + + // Parse package files. + var files []*ast.File + for _, file := range filenames { + f, err := w.parseFile(dir, file) + if err != nil { + log.Fatalf("error parsing package %s: %s", name, err) + } + files = append(files, f) + } + + // Type-check package files. + conf := types.Config{ + IgnoreFuncBodies: true, + FakeImportC: true, + Importer: w, + } + pkg, err = conf.Check(name, fset, files, nil) + if err != nil { + ctxt := "" + if w.context != nil { + ctxt = fmt.Sprintf("%s-%s", w.context.GOOS, w.context.GOARCH) + } + log.Fatalf("error typechecking package %s: %s (%s)", name, err, ctxt) + } + + if usePkgCache { + pkgCache[key] = pkg + } + + w.imported[name] = pkg + return pkg, nil +} + +// pushScope enters a new scope (walking a package, type, node, etc) +// and returns a function that will leave the scope (with sanity checking +// for mismatched pushes & pops) +func (w *Walker) pushScope(name string) (popFunc func()) { + w.scope = append(w.scope, name) + return func() { + if len(w.scope) == 0 { + log.Fatalf("attempt to leave scope %q with empty scope list", name) + } + if w.scope[len(w.scope)-1] != name { + log.Fatalf("attempt to leave scope %q, but scope is currently %#v", name, w.scope) + } + w.scope = w.scope[:len(w.scope)-1] + } +} + +func sortedMethodNames(typ *types.Interface) []string { + n := typ.NumMethods() + list := make([]string, n) + for i := range list { + list[i] = typ.Method(i).Name() + } + sort.Strings(list) + return list +} + +func (w *Walker) writeType(buf *bytes.Buffer, typ types.Type) { + switch typ := typ.(type) { + case *types.Basic: + s := typ.Name() + switch typ.Kind() { + case types.UnsafePointer: + s = "unsafe.Pointer" + case types.UntypedBool: + s = "ideal-bool" + case types.UntypedInt: + s = "ideal-int" + case types.UntypedRune: + // "ideal-char" for compatibility with old tool + // TODO(gri) change to "ideal-rune" + s = "ideal-char" + case types.UntypedFloat: + s = "ideal-float" + case types.UntypedComplex: + s = "ideal-complex" + case types.UntypedString: + s = "ideal-string" + case types.UntypedNil: + panic("should never see untyped nil type") + default: + switch s { + case "byte": + s = "uint8" + case "rune": + s = "int32" + } + } + buf.WriteString(s) + + case *types.Array: + fmt.Fprintf(buf, "[%d]", typ.Len()) + w.writeType(buf, typ.Elem()) + + case *types.Slice: + buf.WriteString("[]") + w.writeType(buf, typ.Elem()) + + case *types.Struct: + buf.WriteString("struct") + + case *types.Pointer: + buf.WriteByte('*') + w.writeType(buf, typ.Elem()) + + case *types.Tuple: + panic("should never see a tuple type") + + case *types.Signature: + buf.WriteString("func") + w.writeSignature(buf, typ) + + case *types.Interface: + buf.WriteString("interface{") + if typ.NumMethods() > 0 { + buf.WriteByte(' ') + buf.WriteString(strings.Join(sortedMethodNames(typ), ", ")) + buf.WriteByte(' ') + } + buf.WriteString("}") + + case *types.Map: + buf.WriteString("map[") + w.writeType(buf, typ.Key()) + buf.WriteByte(']') + w.writeType(buf, typ.Elem()) + + case *types.Chan: + var s string + switch typ.Dir() { + case types.SendOnly: + s = "chan<- " + case types.RecvOnly: + s = "<-chan " + case types.SendRecv: + s = "chan " + default: + panic("unreachable") + } + buf.WriteString(s) + w.writeType(buf, typ.Elem()) + + case *types.Named: + obj := typ.Obj() + pkg := obj.Pkg() + if pkg != nil && pkg != w.current { + buf.WriteString(pkg.Name()) + buf.WriteByte('.') + } + buf.WriteString(typ.Obj().Name()) + + default: + panic(fmt.Sprintf("unknown type %T", typ)) + } +} + +func (w *Walker) writeSignature(buf *bytes.Buffer, sig *types.Signature) { + w.writeParams(buf, sig.Params(), sig.Variadic()) + switch res := sig.Results(); res.Len() { + case 0: + // nothing to do + case 1: + buf.WriteByte(' ') + w.writeType(buf, res.At(0).Type()) + default: + buf.WriteByte(' ') + w.writeParams(buf, res, false) + } +} + +func (w *Walker) writeParams(buf *bytes.Buffer, t *types.Tuple, variadic bool) { + buf.WriteByte('(') + for i, n := 0, t.Len(); i < n; i++ { + if i > 0 { + buf.WriteString(", ") + } + typ := t.At(i).Type() + if variadic && i+1 == n { + buf.WriteString("...") + typ = typ.(*types.Slice).Elem() + } + w.writeType(buf, typ) + } + buf.WriteByte(')') +} + +func (w *Walker) typeString(typ types.Type) string { + var buf bytes.Buffer + w.writeType(&buf, typ) + return buf.String() +} + +func (w *Walker) signatureString(sig *types.Signature) string { + var buf bytes.Buffer + w.writeSignature(&buf, sig) + return buf.String() +} + +func (w *Walker) emitObj(obj types.Object) { + switch obj := obj.(type) { + case *types.Const: + w.emitf("const %s %s", obj.Name(), w.typeString(obj.Type())) + w.emitf("const %s = %s", obj.Name(), obj.Val()) + case *types.Var: + w.emitf("var %s %s", obj.Name(), w.typeString(obj.Type())) + case *types.TypeName: + w.emitType(obj) + case *types.Func: + w.emitFunc(obj) + default: + panic("unknown object: " + obj.String()) + } +} + +func (w *Walker) emitType(obj *types.TypeName) { + name := obj.Name() + typ := obj.Type() + switch typ := typ.Underlying().(type) { + case *types.Struct: + w.emitStructType(name, typ) + case *types.Interface: + w.emitIfaceType(name, typ) + return // methods are handled by emitIfaceType + default: + w.emitf("type %s %s", name, w.typeString(typ.Underlying())) + } + + // emit methods with value receiver + var methodNames map[string]bool + vset := types.NewMethodSet(typ) + for i, n := 0, vset.Len(); i < n; i++ { + m := vset.At(i) + if m.Obj().Exported() { + w.emitMethod(m) + if methodNames == nil { + methodNames = make(map[string]bool) + } + methodNames[m.Obj().Name()] = true + } + } + + // emit methods with pointer receiver; exclude + // methods that we have emitted already + // (the method set of *T includes the methods of T) + pset := types.NewMethodSet(types.NewPointer(typ)) + for i, n := 0, pset.Len(); i < n; i++ { + m := pset.At(i) + if m.Obj().Exported() && !methodNames[m.Obj().Name()] { + w.emitMethod(m) + } + } +} + +func (w *Walker) emitStructType(name string, typ *types.Struct) { + typeStruct := fmt.Sprintf("type %s struct", name) + w.emitf(typeStruct) + defer w.pushScope(typeStruct)() + + for i := 0; i < typ.NumFields(); i++ { + f := typ.Field(i) + if !f.Exported() { + continue + } + typ := f.Type() + if f.Anonymous() { + w.emitf("embedded %s", w.typeString(typ)) + continue + } + w.emitf("%s %s", f.Name(), w.typeString(typ)) + } +} + +func (w *Walker) emitIfaceType(name string, typ *types.Interface) { + pop := w.pushScope("type " + name + " interface") + + var methodNames []string + complete := true + mset := types.NewMethodSet(typ) + for i, n := 0, mset.Len(); i < n; i++ { + m := mset.At(i).Obj().(*types.Func) + if !m.Exported() { + complete = false + continue + } + methodNames = append(methodNames, m.Name()) + w.emitf("%s%s", m.Name(), w.signatureString(m.Type().(*types.Signature))) + } + + if !complete { + // The method set has unexported methods, so all the + // implementations are provided by the same package, + // so the method set can be extended. Instead of recording + // the full set of names (below), record only that there were + // unexported methods. (If the interface shrinks, we will notice + // because a method signature emitted during the last loop + // will disappear.) + w.emitf("unexported methods") + } + + pop() + + if !complete { + return + } + + if len(methodNames) == 0 { + w.emitf("type %s interface {}", name) + return + } + + sort.Strings(methodNames) + w.emitf("type %s interface { %s }", name, strings.Join(methodNames, ", ")) +} + +func (w *Walker) emitFunc(f *types.Func) { + sig := f.Type().(*types.Signature) + if sig.Recv() != nil { + panic("method considered a regular function: " + f.String()) + } + w.emitf("func %s%s", f.Name(), w.signatureString(sig)) +} + +func (w *Walker) emitMethod(m *types.Selection) { + sig := m.Type().(*types.Signature) + recv := sig.Recv().Type() + // report exported methods with unexported receiver base type + if true { + base := recv + if p, _ := recv.(*types.Pointer); p != nil { + base = p.Elem() + } + if obj := base.(*types.Named).Obj(); !obj.Exported() { + log.Fatalf("exported method with unexported receiver base type: %s", m) + } + } + w.emitf("method (%s) %s%s", w.typeString(recv), m.Obj().Name(), w.signatureString(sig)) +} + +func (w *Walker) emitf(format string, args ...interface{}) { + f := strings.Join(w.scope, ", ") + ", " + fmt.Sprintf(format, args...) + if strings.Contains(f, "\n") { + panic("feature contains newlines: " + f) + } + + if _, dup := w.features[f]; dup { + panic("duplicate feature inserted: " + f) + } + w.features[f] = true + + if *verbose { + log.Printf("feature: %s", f) + } +} diff --git a/src/cmd/api/goapi_test.go b/src/cmd/api/goapi_test.go new file mode 100644 index 0000000000000000000000000000000000000000..1d2cc9ac8214d50bffb962f96c2b9615ff7ed2dd --- /dev/null +++ b/src/cmd/api/goapi_test.go @@ -0,0 +1,189 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +import ( + "bytes" + "flag" + "fmt" + "go/build" + "io/ioutil" + "os" + "os/exec" + "path/filepath" + "sort" + "strings" + "testing" +) + +var ( + updateGolden = flag.Bool("updategolden", false, "update golden files") +) + +func TestGolden(t *testing.T) { + td, err := os.Open("testdata/src/pkg") + if err != nil { + t.Fatal(err) + } + fis, err := td.Readdir(0) + if err != nil { + t.Fatal(err) + } + for _, fi := range fis { + if !fi.IsDir() { + continue + } + + // TODO(gri) remove extra pkg directory eventually + goldenFile := filepath.Join("testdata", "src", "pkg", fi.Name(), "golden.txt") + w := NewWalker(nil, "testdata/src/pkg") + pkg, _ := w.Import(fi.Name()) + w.export(pkg) + + if *updateGolden { + os.Remove(goldenFile) + f, err := os.Create(goldenFile) + if err != nil { + t.Fatal(err) + } + for _, feat := range w.Features() { + fmt.Fprintf(f, "%s\n", feat) + } + f.Close() + } + + bs, err := ioutil.ReadFile(goldenFile) + if err != nil { + t.Fatalf("opening golden.txt for package %q: %v", fi.Name(), err) + } + wanted := strings.Split(string(bs), "\n") + sort.Strings(wanted) + for _, feature := range wanted { + if feature == "" { + continue + } + _, ok := w.features[feature] + if !ok { + t.Errorf("package %s: missing feature %q", fi.Name(), feature) + } + delete(w.features, feature) + } + + for _, feature := range w.Features() { + t.Errorf("package %s: extra feature not in golden file: %q", fi.Name(), feature) + } + } +} + +func TestCompareAPI(t *testing.T) { + tests := []struct { + name string + features, required, optional, exception []string + ok bool // want + out string // want + }{ + { + name: "feature added", + features: []string{"A", "B", "C", "D", "E", "F"}, + required: []string{"B", "D"}, + ok: true, + out: "+A\n+C\n+E\n+F\n", + }, + { + name: "feature removed", + features: []string{"C", "A"}, + required: []string{"A", "B", "C"}, + ok: false, + out: "-B\n", + }, + { + name: "feature added then removed", + features: []string{"A", "C"}, + optional: []string{"B"}, + required: []string{"A", "C"}, + ok: true, + out: "±B\n", + }, + { + name: "exception removal", + required: []string{"A", "B", "C"}, + features: []string{"A", "C"}, + exception: []string{"B"}, + ok: true, + out: "", + }, + { + // https://golang.org/issue/4303 + name: "contexts reconverging", + required: []string{ + "A", + "pkg syscall (darwin-386), type RawSockaddrInet6 struct", + "pkg syscall (darwin-amd64), type RawSockaddrInet6 struct", + }, + features: []string{ + "A", + "pkg syscall, type RawSockaddrInet6 struct", + }, + ok: true, + out: "+pkg syscall, type RawSockaddrInet6 struct\n", + }, + } + for _, tt := range tests { + buf := new(bytes.Buffer) + gotok := compareAPI(buf, tt.features, tt.required, tt.optional, tt.exception, true) + if gotok != tt.ok { + t.Errorf("%s: ok = %v; want %v", tt.name, gotok, tt.ok) + } + if got := buf.String(); got != tt.out { + t.Errorf("%s: output differs\nGOT:\n%s\nWANT:\n%s", tt.name, got, tt.out) + } + } +} + +func TestSkipInternal(t *testing.T) { + tests := []struct { + pkg string + want bool + }{ + {"net/http", true}, + {"net/http/internal-foo", true}, + {"net/http/internal", false}, + {"net/http/internal/bar", false}, + {"internal/foo", false}, + {"internal", false}, + } + for _, tt := range tests { + got := !internalPkg.MatchString(tt.pkg) + if got != tt.want { + t.Errorf("%s is internal = %v; want %v", tt.pkg, got, tt.want) + } + } +} + +func BenchmarkAll(b *testing.B) { + stds, err := exec.Command("go", "list", "std").Output() + if err != nil { + b.Fatal(err) + } + b.ResetTimer() + pkgNames := strings.Fields(string(stds)) + + for _, c := range contexts { + c.Compiler = build.Default.Compiler + } + + for i := 0; i < b.N; i++ { + for _, context := range contexts { + w := NewWalker(context, filepath.Join(build.Default.GOROOT, "src")) + for _, name := range pkgNames { + if name != "unsafe" && !strings.HasPrefix(name, "cmd/") { + pkg, _ := w.Import(name) + w.export(pkg) + } + } + w.Features() + } + } +} diff --git a/src/cmd/api/run.go b/src/cmd/api/run.go new file mode 100644 index 0000000000000000000000000000000000000000..eaffa0a57cb359f71744c543f139139c7ff70d57 --- /dev/null +++ b/src/cmd/api/run.go @@ -0,0 +1,45 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build ignore + +// The run program is invoked via the dist tool. +// To invoke manually: go tool dist test -run api --no-rebuild +package main + +import ( + "fmt" + "log" + "os" + "os/exec" + "path/filepath" +) + +var goroot string + +func main() { + log.SetFlags(0) + goroot = os.Getenv("GOROOT") // should be set by run.{bash,bat} + if goroot == "" { + log.Fatal("No $GOROOT set.") + } + + out, err := exec.Command("go", "tool", "api", + "-c", file("go1", "go1.1", "go1.2", "go1.3", "go1.4", "go1.5"), + "-next", file("next"), + "-except", file("except")).CombinedOutput() + if err != nil { + log.Fatalf("Error running API checker: %v\n%s", err, out) + } + fmt.Print(string(out)) +} + +// file expands s to $GOROOT/api/s.txt. +// If there are more than 1, they're comma-separated. +func file(s ...string) string { + if len(s) > 1 { + return file(s[0]) + "," + file(s[1:]...) + } + return filepath.Join(goroot, "api", s[0]+".txt") +} diff --git a/src/cmd/api/testdata/src/pkg/p1/golden.txt b/src/cmd/api/testdata/src/pkg/p1/golden.txt new file mode 100644 index 0000000000000000000000000000000000000000..3c43a226ff7bd663c7848c37d0b5263c395aebc3 --- /dev/null +++ b/src/cmd/api/testdata/src/pkg/p1/golden.txt @@ -0,0 +1,96 @@ +pkg p1, const A = 1 +pkg p1, const A ideal-int +pkg p1, const A64 = 1 +pkg p1, const A64 int64 +pkg p1, const AIsLowerA = 11 +pkg p1, const AIsLowerA ideal-int +pkg p1, const B0 = 2 +pkg p1, const B0 ideal-int +pkg p1, const ConstChase2 = 11 +pkg p1, const ConstChase2 ideal-int +pkg p1, const ConversionConst = 5 +pkg p1, const ConversionConst MyInt +pkg p1, const FloatConst = 3/2 +pkg p1, const FloatConst ideal-float +pkg p1, const StrConst = "foo" +pkg p1, const StrConst ideal-string +pkg p1, func Bar(int8, int16, int64) +pkg p1, func Bar1(int8, int16, int64) uint64 +pkg p1, func Bar2(int8, int16, int64) (uint8, uint64) +pkg p1, func BarE() Error +pkg p1, func Now() Time +pkg p1, func PlainFunc(int, int, string) (*B, error) +pkg p1, func TakesFunc(func(int) int) +pkg p1, method (*B) JustOnB() +pkg p1, method (*B) OnBothTandBPtr() +pkg p1, method (*Embedded) OnEmbedded() +pkg p1, method (*S2) SMethod(int8, int16, int64) +pkg p1, method (*T) JustOnT() +pkg p1, method (*T) OnBothTandBPtr() +pkg p1, method (B) OnBothTandBVal() +pkg p1, method (S) StructValueMethod() +pkg p1, method (S) StructValueMethodNamedRecv() +pkg p1, method (S2) StructValueMethod() +pkg p1, method (S2) StructValueMethodNamedRecv() +pkg p1, method (T) OnBothTandBVal() +pkg p1, method (TPtrExported) OnEmbedded() +pkg p1, method (TPtrUnexported) OnBothTandBPtr() +pkg p1, method (TPtrUnexported) OnBothTandBVal() +pkg p1, type B struct +pkg p1, type ByteStruct struct +pkg p1, type ByteStruct struct, B uint8 +pkg p1, type ByteStruct struct, R int32 +pkg p1, type Codec struct +pkg p1, type Codec struct, Func func(int, int) int +pkg p1, type EmbedSelector struct +pkg p1, type EmbedSelector struct, embedded Time +pkg p1, type EmbedURLPtr struct +pkg p1, type EmbedURLPtr struct, embedded *URL +pkg p1, type Embedded struct +pkg p1, type Error interface { Error, Temporary } +pkg p1, type Error interface, Error() string +pkg p1, type Error interface, Temporary() bool +pkg p1, type FuncType func(int, int, string) (*B, error) +pkg p1, type I interface, Get(string) int64 +pkg p1, type I interface, GetNamed(string) int64 +pkg p1, type I interface, Name() string +pkg p1, type I interface, PackageTwoMeth() +pkg p1, type I interface, Set(string, int64) +pkg p1, type I interface, unexported methods +pkg p1, type MyInt int +pkg p1, type Namer interface { Name } +pkg p1, type Namer interface, Name() string +pkg p1, type Private interface, X() +pkg p1, type Private interface, unexported methods +pkg p1, type Public interface { X, Y } +pkg p1, type Public interface, X() +pkg p1, type Public interface, Y() +pkg p1, type S struct +pkg p1, type S struct, Public *int +pkg p1, type S struct, PublicTime Time +pkg p1, type S2 struct +pkg p1, type S2 struct, Extra bool +pkg p1, type S2 struct, embedded S +pkg p1, type SI struct +pkg p1, type SI struct, I int +pkg p1, type T struct +pkg p1, type TPtrExported struct +pkg p1, type TPtrExported struct, embedded *Embedded +pkg p1, type TPtrUnexported struct +pkg p1, type Time struct +pkg p1, type URL struct +pkg p1, var Byte uint8 +pkg p1, var ByteConv []uint8 +pkg p1, var ByteFunc func(uint8) int32 +pkg p1, var ChecksumError error +pkg p1, var SIPtr *SI +pkg p1, var SIPtr2 *SI +pkg p1, var SIVal SI +pkg p1, var StrConv string +pkg p1, var V string +pkg p1, var V1 uint64 +pkg p1, var V2 p2.Twoer +pkg p1, var VError Error +pkg p1, var X I +pkg p1, var X0 int64 +pkg p1, var Y int diff --git a/src/cmd/api/testdata/src/pkg/p1/p1.go b/src/cmd/api/testdata/src/pkg/p1/p1.go new file mode 100644 index 0000000000000000000000000000000000000000..65181b248a30388d9901e00eeca9ae1ea71ed769 --- /dev/null +++ b/src/cmd/api/testdata/src/pkg/p1/p1.go @@ -0,0 +1,212 @@ +package p1 + +import ( + ptwo "p2" +) + +const ( + ConstChase2 = constChase // forward declaration to unexported ident + constChase = AIsLowerA // forward declaration to exported ident + + A = 1 + a = 11 + A64 int64 = 1 + + AIsLowerA = a // previously declared +) + +const ( + ConversionConst = MyInt(5) +) + +// Variables from function calls. +var ( + V = ptwo.F() + VError = BarE() + V1 = Bar1(1, 2, 3) + V2 = ptwo.G() +) + +// Variables with conversions: +var ( + StrConv = string("foo") + ByteConv = []byte("foo") +) + +var ChecksumError = ptwo.NewError("gzip checksum error") + +const B0 = 2 +const StrConst = "foo" +const FloatConst = 1.5 + +type myInt int + +type MyInt int + +type Time struct{} + +type S struct { + Public *int + private *int + PublicTime Time +} + +type URL struct{} + +type EmbedURLPtr struct { + *URL +} + +type S2 struct { + S + Extra bool +} + +var X0 int64 + +var ( + Y int + X I +) + +type Namer interface { + Name() string +} + +type I interface { + Namer + ptwo.Twoer + Set(name string, balance int64) + Get(string) int64 + GetNamed(string) (balance int64) + private() +} + +type Public interface { + X() + Y() +} + +type Private interface { + X() + y() +} + +type Error interface { + error + Temporary() bool +} + +func (myInt) privateTypeMethod() {} +func (myInt) CapitalMethodUnexportedType() {} + +func (s *S2) SMethod(x int8, y int16, z int64) {} + +type s struct{} + +func (s) method() +func (s) Method() + +func (S) StructValueMethod() +func (ignored S) StructValueMethodNamedRecv() + +func (s *S2) unexported(x int8, y int16, z int64) {} + +func Bar(x int8, y int16, z int64) {} +func Bar1(x int8, y int16, z int64) uint64 {} +func Bar2(x int8, y int16, z int64) (uint8, uint64) {} +func BarE() Error {} + +func unexported(x int8, y int16, z int64) {} + +func TakesFunc(f func(dontWantName int) int) + +type Codec struct { + Func func(x int, y int) (z int) +} + +type SI struct { + I int +} + +var SIVal = SI{} +var SIPtr = &SI{} +var SIPtr2 *SI + +type T struct { + common +} + +type B struct { + common +} + +type common struct { + i int +} + +type TPtrUnexported struct { + *common +} + +type TPtrExported struct { + *Embedded +} + +type FuncType func(x, y int, s string) (b *B, err error) + +type Embedded struct{} + +func PlainFunc(x, y int, s string) (b *B, err error) + +func (*Embedded) OnEmbedded() {} + +func (*T) JustOnT() {} +func (*B) JustOnB() {} +func (*common) OnBothTandBPtr() {} +func (common) OnBothTandBVal() {} + +type EmbedSelector struct { + Time +} + +const ( + foo = "foo" + foo2 string = "foo2" + truth = foo == "foo" || foo2 == "foo2" +) + +func ellipsis(...string) {} + +func Now() Time { + var now Time + return now +} + +var x = &S{ + Public: nil, + private: nil, + PublicTime: Now(), +} + +var parenExpr = (1 + 5) + +var funcLit = func() {} + +var m map[string]int + +var chanVar chan int + +var ifaceVar interface{} = 5 + +var assertVar = ifaceVar.(int) + +var indexVar = m["foo"] + +var Byte byte +var ByteFunc func(byte) rune + +type ByteStruct struct { + B byte + R rune +} diff --git a/src/cmd/api/testdata/src/pkg/p2/golden.txt b/src/cmd/api/testdata/src/pkg/p2/golden.txt new file mode 100644 index 0000000000000000000000000000000000000000..4271620c74848bb593b6f8dfd1e11ecfda830849 --- /dev/null +++ b/src/cmd/api/testdata/src/pkg/p2/golden.txt @@ -0,0 +1,5 @@ +pkg p2, func F() string +pkg p2, func G() Twoer +pkg p2, func NewError(string) error +pkg p2, type Twoer interface { PackageTwoMeth } +pkg p2, type Twoer interface, PackageTwoMeth() diff --git a/src/cmd/api/testdata/src/pkg/p2/p2.go b/src/cmd/api/testdata/src/pkg/p2/p2.go new file mode 100644 index 0000000000000000000000000000000000000000..6b107b50790459a497fc34ec52567dd7e419333c --- /dev/null +++ b/src/cmd/api/testdata/src/pkg/p2/p2.go @@ -0,0 +1,9 @@ +package p2 + +type Twoer interface { + PackageTwoMeth() +} + +func F() string {} +func G() Twoer {} +func NewError(s string) error {} diff --git a/src/cmd/api/testdata/src/pkg/p3/golden.txt b/src/cmd/api/testdata/src/pkg/p3/golden.txt new file mode 100644 index 0000000000000000000000000000000000000000..a7dcccd1bdb7dd50ce888340fbb279cb0c8674c0 --- /dev/null +++ b/src/cmd/api/testdata/src/pkg/p3/golden.txt @@ -0,0 +1,3 @@ +pkg p3, func BadHop(int, int, int) (bool, bool, *ThirdBase, *ThirdBase, error) +pkg p3, method (*ThirdBase) GoodPlayer() (int, int, int) +pkg p3, type ThirdBase struct diff --git a/src/cmd/api/testdata/src/pkg/p3/p3.go b/src/cmd/api/testdata/src/pkg/p3/p3.go new file mode 100644 index 0000000000000000000000000000000000000000..1b2b1a4262e16b3e75e7fc161528cb465be6e8ce --- /dev/null +++ b/src/cmd/api/testdata/src/pkg/p3/p3.go @@ -0,0 +1,6 @@ +package p3 + +type ThirdBase struct{} + +func (tb *ThirdBase) GoodPlayer() (i, j, k int) +func BadHop(i, j, k int) (l, m bool, n, o *ThirdBase, err error) diff --git a/src/cmd/asm/internal/arch/arch.go b/src/cmd/asm/internal/arch/arch.go new file mode 100644 index 0000000000000000000000000000000000000000..e6901ebfc2a1d7881eab3cdffe1be6941de7f7a9 --- /dev/null +++ b/src/cmd/asm/internal/arch/arch.go @@ -0,0 +1,363 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package arch + +import ( + "cmd/internal/obj" + "cmd/internal/obj/arm" + "cmd/internal/obj/arm64" + "cmd/internal/obj/ppc64" + "cmd/internal/obj/x86" + "fmt" + "strings" +) + +// Pseudo-registers whose names are the constant name without the leading R. +const ( + RFP = -(iota + 1) + RSB + RSP + RPC +) + +// Arch wraps the link architecture object with more architecture-specific information. +type Arch struct { + *obj.LinkArch + // Map of instruction names to enumeration. + Instructions map[string]int + // Map of register names to enumeration. + Register map[string]int16 + // Table of register prefix names. These are things like R for R(0) and SPR for SPR(268). + RegisterPrefix map[string]bool + // RegisterNumber converts R(10) into arm.REG_R10. + RegisterNumber func(string, int16) (int16, bool) + // Instruction is a jump. + IsJump func(word string) bool +} + +// nilRegisterNumber is the register number function for architectures +// that do not accept the R(N) notation. It always returns failure. +func nilRegisterNumber(name string, n int16) (int16, bool) { + return 0, false +} + +var Pseudos = map[string]int{ + "DATA": obj.ADATA, + "FUNCDATA": obj.AFUNCDATA, + "GLOBL": obj.AGLOBL, + "PCDATA": obj.APCDATA, + "TEXT": obj.ATEXT, +} + +// Set configures the architecture specified by GOARCH and returns its representation. +// It returns nil if GOARCH is not recognized. +func Set(GOARCH string) *Arch { + switch GOARCH { + case "386": + return archX86(&x86.Link386) + case "amd64": + return archX86(&x86.Linkamd64) + case "amd64p32": + return archX86(&x86.Linkamd64p32) + case "arm": + return archArm() + case "arm64": + return archArm64() + case "ppc64": + a := archPPC64() + a.LinkArch = &ppc64.Linkppc64 + return a + case "ppc64le": + a := archPPC64() + a.LinkArch = &ppc64.Linkppc64le + return a + } + return nil +} + +func jumpX86(word string) bool { + return word[0] == 'J' || word == "CALL" || strings.HasPrefix(word, "LOOP") +} + +func archX86(linkArch *obj.LinkArch) *Arch { + register := make(map[string]int16) + // Create maps for easy lookup of instruction names etc. + for i, s := range x86.Register { + register[s] = int16(i + x86.REG_AL) + } + // Pseudo-registers. + register["SB"] = RSB + register["FP"] = RFP + register["PC"] = RPC + // Register prefix not used on this architecture. + + instructions := make(map[string]int) + for i, s := range obj.Anames { + instructions[s] = i + } + for i, s := range x86.Anames { + if i >= obj.A_ARCHSPECIFIC { + instructions[s] = i + obj.ABaseAMD64 + } + } + // Annoying aliases. + instructions["JA"] = x86.AJHI /* alternate */ + instructions["JAE"] = x86.AJCC /* alternate */ + instructions["JB"] = x86.AJCS /* alternate */ + instructions["JBE"] = x86.AJLS /* alternate */ + instructions["JC"] = x86.AJCS /* alternate */ + instructions["JCC"] = x86.AJCC /* carry clear (CF = 0) */ + instructions["JCS"] = x86.AJCS /* carry set (CF = 1) */ + instructions["JE"] = x86.AJEQ /* alternate */ + instructions["JEQ"] = x86.AJEQ /* equal (ZF = 1) */ + instructions["JG"] = x86.AJGT /* alternate */ + instructions["JGE"] = x86.AJGE /* greater than or equal (signed) (SF = OF) */ + instructions["JGT"] = x86.AJGT /* greater than (signed) (ZF = 0 && SF = OF) */ + instructions["JHI"] = x86.AJHI /* higher (unsigned) (CF = 0 && ZF = 0) */ + instructions["JHS"] = x86.AJCC /* alternate */ + instructions["JL"] = x86.AJLT /* alternate */ + instructions["JLE"] = x86.AJLE /* less than or equal (signed) (ZF = 1 || SF != OF) */ + instructions["JLO"] = x86.AJCS /* alternate */ + instructions["JLS"] = x86.AJLS /* lower or same (unsigned) (CF = 1 || ZF = 1) */ + instructions["JLT"] = x86.AJLT /* less than (signed) (SF != OF) */ + instructions["JMI"] = x86.AJMI /* negative (minus) (SF = 1) */ + instructions["JNA"] = x86.AJLS /* alternate */ + instructions["JNAE"] = x86.AJCS /* alternate */ + instructions["JNB"] = x86.AJCC /* alternate */ + instructions["JNBE"] = x86.AJHI /* alternate */ + instructions["JNC"] = x86.AJCC /* alternate */ + instructions["JNE"] = x86.AJNE /* not equal (ZF = 0) */ + instructions["JNG"] = x86.AJLE /* alternate */ + instructions["JNGE"] = x86.AJLT /* alternate */ + instructions["JNL"] = x86.AJGE /* alternate */ + instructions["JNLE"] = x86.AJGT /* alternate */ + instructions["JNO"] = x86.AJOC /* alternate */ + instructions["JNP"] = x86.AJPC /* alternate */ + instructions["JNS"] = x86.AJPL /* alternate */ + instructions["JNZ"] = x86.AJNE /* alternate */ + instructions["JO"] = x86.AJOS /* alternate */ + instructions["JOC"] = x86.AJOC /* overflow clear (OF = 0) */ + instructions["JOS"] = x86.AJOS /* overflow set (OF = 1) */ + instructions["JP"] = x86.AJPS /* alternate */ + instructions["JPC"] = x86.AJPC /* parity clear (PF = 0) */ + instructions["JPE"] = x86.AJPS /* alternate */ + instructions["JPL"] = x86.AJPL /* non-negative (plus) (SF = 0) */ + instructions["JPO"] = x86.AJPC /* alternate */ + instructions["JPS"] = x86.AJPS /* parity set (PF = 1) */ + instructions["JS"] = x86.AJMI /* alternate */ + instructions["JZ"] = x86.AJEQ /* alternate */ + instructions["MASKMOVDQU"] = x86.AMASKMOVOU + instructions["MOVD"] = x86.AMOVQ + instructions["MOVDQ2Q"] = x86.AMOVQ + instructions["MOVNTDQ"] = x86.AMOVNTO + instructions["MOVOA"] = x86.AMOVO + instructions["MOVOA"] = x86.AMOVO + instructions["PF2ID"] = x86.APF2IL + instructions["PI2FD"] = x86.API2FL + instructions["PSLLDQ"] = x86.APSLLO + instructions["PSRLDQ"] = x86.APSRLO + + return &Arch{ + LinkArch: linkArch, + Instructions: instructions, + Register: register, + RegisterPrefix: nil, + RegisterNumber: nilRegisterNumber, + IsJump: jumpX86, + } +} + +func archArm() *Arch { + register := make(map[string]int16) + // Create maps for easy lookup of instruction names etc. + // Note that there is no list of names as there is for x86. + for i := arm.REG_R0; i < arm.REG_SPSR; i++ { + register[obj.Rconv(i)] = int16(i) + } + // Avoid unintentionally clobbering g using R10. + delete(register, "R10") + register["g"] = arm.REG_R10 + for i := 0; i < 16; i++ { + register[fmt.Sprintf("C%d", i)] = int16(i) + } + + // Pseudo-registers. + register["SB"] = RSB + register["FP"] = RFP + register["PC"] = RPC + register["SP"] = RSP + registerPrefix := map[string]bool{ + "F": true, + "R": true, + } + + instructions := make(map[string]int) + for i, s := range obj.Anames { + instructions[s] = i + } + for i, s := range arm.Anames { + if i >= obj.A_ARCHSPECIFIC { + instructions[s] = i + obj.ABaseARM + } + } + // Annoying aliases. + instructions["B"] = obj.AJMP + instructions["BL"] = obj.ACALL + // MCR differs from MRC by the way fields of the word are encoded. + // (Details in arm.go). Here we add the instruction so parse will find + // it, but give it an opcode number known only to us. + instructions["MCR"] = aMCR + + return &Arch{ + LinkArch: &arm.Linkarm, + Instructions: instructions, + Register: register, + RegisterPrefix: registerPrefix, + RegisterNumber: armRegisterNumber, + IsJump: jumpArm, + } +} + +func archArm64() *Arch { + register := make(map[string]int16) + // Create maps for easy lookup of instruction names etc. + // Note that there is no list of names as there is for 386 and amd64. + register[arm64.Rconv(arm64.REGSP)] = int16(arm64.REGSP) + for i := arm64.REG_R0; i <= arm64.REG_R31; i++ { + register[arm64.Rconv(i)] = int16(i) + } + for i := arm64.REG_F0; i <= arm64.REG_F31; i++ { + register[arm64.Rconv(i)] = int16(i) + } + for i := arm64.REG_V0; i <= arm64.REG_V31; i++ { + register[arm64.Rconv(i)] = int16(i) + } + register["LR"] = arm64.REGLINK + register["DAIF"] = arm64.REG_DAIF + register["NZCV"] = arm64.REG_NZCV + register["FPSR"] = arm64.REG_FPSR + register["FPCR"] = arm64.REG_FPCR + register["SPSR_EL1"] = arm64.REG_SPSR_EL1 + register["ELR_EL1"] = arm64.REG_ELR_EL1 + register["SPSR_EL2"] = arm64.REG_SPSR_EL2 + register["ELR_EL2"] = arm64.REG_ELR_EL2 + register["CurrentEL"] = arm64.REG_CurrentEL + register["SP_EL0"] = arm64.REG_SP_EL0 + register["SPSel"] = arm64.REG_SPSel + register["DAIFSet"] = arm64.REG_DAIFSet + register["DAIFClr"] = arm64.REG_DAIFClr + // Conditional operators, like EQ, NE, etc. + register["EQ"] = arm64.COND_EQ + register["NE"] = arm64.COND_NE + register["HS"] = arm64.COND_HS + register["LO"] = arm64.COND_LO + register["MI"] = arm64.COND_MI + register["PL"] = arm64.COND_PL + register["VS"] = arm64.COND_VS + register["VC"] = arm64.COND_VC + register["HI"] = arm64.COND_HI + register["LS"] = arm64.COND_LS + register["GE"] = arm64.COND_GE + register["LT"] = arm64.COND_LT + register["GT"] = arm64.COND_GT + register["LE"] = arm64.COND_LE + register["AL"] = arm64.COND_AL + register["NV"] = arm64.COND_NV + // Pseudo-registers. + register["SB"] = RSB + register["FP"] = RFP + register["PC"] = RPC + register["SP"] = RSP + // Avoid unintentionally clobbering g using R28. + delete(register, "R28") + register["g"] = arm64.REG_R28 + registerPrefix := map[string]bool{ + "F": true, + "R": true, + "V": true, + } + + instructions := make(map[string]int) + for i, s := range obj.Anames { + instructions[s] = i + } + for i, s := range arm64.Anames { + if i >= obj.A_ARCHSPECIFIC { + instructions[s] = i + obj.ABaseARM64 + } + } + // Annoying aliases. + instructions["B"] = arm64.AB + instructions["BL"] = arm64.ABL + + return &Arch{ + LinkArch: &arm64.Linkarm64, + Instructions: instructions, + Register: register, + RegisterPrefix: registerPrefix, + RegisterNumber: arm64RegisterNumber, + IsJump: jumpArm64, + } + +} + +func archPPC64() *Arch { + register := make(map[string]int16) + // Create maps for easy lookup of instruction names etc. + // Note that there is no list of names as there is for x86. + for i := ppc64.REG_R0; i <= ppc64.REG_R31; i++ { + register[obj.Rconv(i)] = int16(i) + } + for i := ppc64.REG_F0; i <= ppc64.REG_F31; i++ { + register[obj.Rconv(i)] = int16(i) + } + for i := ppc64.REG_CR0; i <= ppc64.REG_CR7; i++ { + register[obj.Rconv(i)] = int16(i) + } + for i := ppc64.REG_MSR; i <= ppc64.REG_CR; i++ { + register[obj.Rconv(i)] = int16(i) + } + register["CR"] = ppc64.REG_CR + register["XER"] = ppc64.REG_XER + register["LR"] = ppc64.REG_LR + register["CTR"] = ppc64.REG_CTR + register["FPSCR"] = ppc64.REG_FPSCR + register["MSR"] = ppc64.REG_MSR + // Pseudo-registers. + register["SB"] = RSB + register["FP"] = RFP + register["PC"] = RPC + // Avoid unintentionally clobbering g using R30. + delete(register, "R30") + register["g"] = ppc64.REG_R30 + registerPrefix := map[string]bool{ + "CR": true, + "F": true, + "R": true, + "SPR": true, + } + + instructions := make(map[string]int) + for i, s := range obj.Anames { + instructions[s] = i + } + for i, s := range ppc64.Anames { + if i >= obj.A_ARCHSPECIFIC { + instructions[s] = i + obj.ABasePPC64 + } + } + // Annoying aliases. + instructions["BR"] = ppc64.ABR + instructions["BL"] = ppc64.ABL + + return &Arch{ + LinkArch: &ppc64.Linkppc64, + Instructions: instructions, + Register: register, + RegisterPrefix: registerPrefix, + RegisterNumber: ppc64RegisterNumber, + IsJump: jumpPPC64, + } +} diff --git a/src/cmd/asm/internal/arch/arm.go b/src/cmd/asm/internal/arch/arm.go new file mode 100644 index 0000000000000000000000000000000000000000..8df994e8d19ee7a8d2835ca3abee6939f054bbf2 --- /dev/null +++ b/src/cmd/asm/internal/arch/arm.go @@ -0,0 +1,248 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// This file encapsulates some of the odd characteristics of the ARM +// instruction set, to minimize its interaction with the core of the +// assembler. + +package arch + +import ( + "strings" + + "cmd/internal/obj" + "cmd/internal/obj/arm" +) + +var armLS = map[string]uint8{ + "U": arm.C_UBIT, + "S": arm.C_SBIT, + "W": arm.C_WBIT, + "P": arm.C_PBIT, + "PW": arm.C_WBIT | arm.C_PBIT, + "WP": arm.C_WBIT | arm.C_PBIT, +} + +var armSCOND = map[string]uint8{ + "EQ": arm.C_SCOND_EQ, + "NE": arm.C_SCOND_NE, + "CS": arm.C_SCOND_HS, + "HS": arm.C_SCOND_HS, + "CC": arm.C_SCOND_LO, + "LO": arm.C_SCOND_LO, + "MI": arm.C_SCOND_MI, + "PL": arm.C_SCOND_PL, + "VS": arm.C_SCOND_VS, + "VC": arm.C_SCOND_VC, + "HI": arm.C_SCOND_HI, + "LS": arm.C_SCOND_LS, + "GE": arm.C_SCOND_GE, + "LT": arm.C_SCOND_LT, + "GT": arm.C_SCOND_GT, + "LE": arm.C_SCOND_LE, + "AL": arm.C_SCOND_NONE, + "U": arm.C_UBIT, + "S": arm.C_SBIT, + "W": arm.C_WBIT, + "P": arm.C_PBIT, + "PW": arm.C_WBIT | arm.C_PBIT, + "WP": arm.C_WBIT | arm.C_PBIT, + "F": arm.C_FBIT, + "IBW": arm.C_WBIT | arm.C_PBIT | arm.C_UBIT, + "IAW": arm.C_WBIT | arm.C_UBIT, + "DBW": arm.C_WBIT | arm.C_PBIT, + "DAW": arm.C_WBIT, + "IB": arm.C_PBIT | arm.C_UBIT, + "IA": arm.C_UBIT, + "DB": arm.C_PBIT, + "DA": 0, +} + +var armJump = map[string]bool{ + "B": true, + "BL": true, + "BEQ": true, + "BNE": true, + "BCS": true, + "BHS": true, + "BCC": true, + "BLO": true, + "BMI": true, + "BPL": true, + "BVS": true, + "BVC": true, + "BHI": true, + "BLS": true, + "BGE": true, + "BLT": true, + "BGT": true, + "BLE": true, + "CALL": true, + "JMP": true, +} + +func jumpArm(word string) bool { + return armJump[word] +} + +// IsARMCMP reports whether the op (as defined by an arm.A* constant) is +// one of the comparison instructions that require special handling. +func IsARMCMP(op int) bool { + switch op { + case arm.ACMN, arm.ACMP, arm.ATEQ, arm.ATST: + return true + } + return false +} + +// IsARMSTREX reports whether the op (as defined by an arm.A* constant) is +// one of the STREX-like instructions that require special handling. +func IsARMSTREX(op int) bool { + switch op { + case arm.ASTREX, arm.ASTREXD, arm.ASWPW, arm.ASWPBU: + return true + } + return false +} + +// MCR is not defined by the obj/arm; instead we define it privately here. +// It is encoded as an MRC with a bit inside the instruction word, +// passed to arch.ARMMRCOffset. +const aMCR = arm.ALAST + 1 + +// IsARMMRC reports whether the op (as defined by an arm.A* constant) is +// MRC or MCR +func IsARMMRC(op int) bool { + switch op { + case arm.AMRC, aMCR: // Note: aMCR is defined in this package. + return true + } + return false +} + +// IsARMFloatCmp reports whether the op is a floating comparison instruction. +func IsARMFloatCmp(op int) bool { + switch op { + case arm.ACMPF, arm.ACMPD: + return true + } + return false +} + +// ARMMRCOffset implements the peculiar encoding of the MRC and MCR instructions. +// The difference between MRC and MCR is represented by a bit high in the word, not +// in the usual way by the opcode itself. Asm must use AMRC for both instructions, so +// we return the opcode for MRC so that asm doesn't need to import obj/arm. +func ARMMRCOffset(op int, cond string, x0, x1, x2, x3, x4, x5 int64) (offset int64, op0 int16, ok bool) { + op1 := int64(0) + if op == arm.AMRC { + op1 = 1 + } + bits, ok := ParseARMCondition(cond) + if !ok { + return + } + offset = (0xe << 24) | // opcode + (op1 << 20) | // MCR/MRC + ((int64(bits) ^ arm.C_SCOND_XOR) << 28) | // scond + ((x0 & 15) << 8) | //coprocessor number + ((x1 & 7) << 21) | // coprocessor operation + ((x2 & 15) << 12) | // ARM register + ((x3 & 15) << 16) | // Crn + ((x4 & 15) << 0) | // Crm + ((x5 & 7) << 5) | // coprocessor information + (1 << 4) /* must be set */ + return offset, arm.AMRC, true +} + +// IsARMMULA reports whether the op (as defined by an arm.A* constant) is +// MULA, MULAWT or MULAWB, the 4-operand instructions. +func IsARMMULA(op int) bool { + switch op { + case arm.AMULA, arm.AMULAWB, arm.AMULAWT: + return true + } + return false +} + +var bcode = []int{ + arm.ABEQ, + arm.ABNE, + arm.ABCS, + arm.ABCC, + arm.ABMI, + arm.ABPL, + arm.ABVS, + arm.ABVC, + arm.ABHI, + arm.ABLS, + arm.ABGE, + arm.ABLT, + arm.ABGT, + arm.ABLE, + arm.AB, + obj.ANOP, +} + +// ARMConditionCodes handles the special condition code situation for the ARM. +// It returns a boolean to indicate success; failure means cond was unrecognized. +func ARMConditionCodes(prog *obj.Prog, cond string) bool { + if cond == "" { + return true + } + bits, ok := ParseARMCondition(cond) + if !ok { + return false + } + /* hack to make B.NE etc. work: turn it into the corresponding conditional */ + if prog.As == arm.AB { + prog.As = int16(bcode[(bits^arm.C_SCOND_XOR)&0xf]) + bits = (bits &^ 0xf) | arm.C_SCOND_NONE + } + prog.Scond = bits + return true +} + +// ParseARMCondition parses the conditions attached to an ARM instruction. +// The input is a single string consisting of period-separated condition +// codes, such as ".P.W". An initial period is ignored. +func ParseARMCondition(cond string) (uint8, bool) { + return parseARMCondition(cond, armLS, armSCOND) +} + +func parseARMCondition(cond string, ls, scond map[string]uint8) (uint8, bool) { + if strings.HasPrefix(cond, ".") { + cond = cond[1:] + } + if cond == "" { + return arm.C_SCOND_NONE, true + } + names := strings.Split(cond, ".") + bits := uint8(0) + for _, name := range names { + if b, present := ls[name]; present { + bits |= b + continue + } + if b, present := scond[name]; present { + bits = (bits &^ arm.C_SCOND) | b + continue + } + return 0, false + } + return bits, true +} + +func armRegisterNumber(name string, n int16) (int16, bool) { + if n < 0 || 15 < n { + return 0, false + } + switch name { + case "R": + return arm.REG_R0 + n, true + case "F": + return arm.REG_F0 + n, true + } + return 0, false +} diff --git a/src/cmd/asm/internal/arch/arm64.go b/src/cmd/asm/internal/arch/arm64.go new file mode 100644 index 0000000000000000000000000000000000000000..0f29e81e2e1d36874c421ff61ddd023949e72adc --- /dev/null +++ b/src/cmd/asm/internal/arch/arm64.go @@ -0,0 +1,115 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// This file encapsulates some of the odd characteristics of the ARM64 +// instruction set, to minimize its interaction with the core of the +// assembler. + +package arch + +import ( + "cmd/internal/obj" + "cmd/internal/obj/arm64" +) + +var arm64LS = map[string]uint8{ + "P": arm64.C_XPOST, + "W": arm64.C_XPRE, +} + +var arm64Jump = map[string]bool{ + "B": true, + "BL": true, + "BEQ": true, + "BNE": true, + "BCS": true, + "BHS": true, + "BCC": true, + "BLO": true, + "BMI": true, + "BPL": true, + "BVS": true, + "BVC": true, + "BHI": true, + "BLS": true, + "BGE": true, + "BLT": true, + "BGT": true, + "BLE": true, + "CALL": true, + "CBZ": true, + "CBZW": true, + "CBNZ": true, + "CBNZW": true, + "JMP": true, +} + +func jumpArm64(word string) bool { + return arm64Jump[word] +} + +// IsARM64CMP reports whether the op (as defined by an arm.A* constant) is +// one of the comparison instructions that require special handling. +func IsARM64CMP(op int) bool { + switch op { + case arm64.ACMN, arm64.ACMP, arm64.ATST, + arm64.ACMNW, arm64.ACMPW, arm64.ATSTW: + return true + } + return false +} + +// IsARM64STLXR reports whether the op (as defined by an arm64.A* +// constant) is one of the STLXR-like instructions that require special +// handling. +func IsARM64STLXR(op int) bool { + switch op { + case arm64.ASTLXRB, arm64.ASTLXRH, arm64.ASTLXRW, arm64.ASTLXR: + return true + } + return false +} + +// ARM64Suffix handles the special suffix for the ARM64. +// It returns a boolean to indicate success; failure means +// cond was unrecognized. +func ARM64Suffix(prog *obj.Prog, cond string) bool { + if cond == "" { + return true + } + bits, ok := ParseARM64Suffix(cond) + if !ok { + return false + } + prog.Scond = bits + return true +} + +// ParseARM64Suffix parses the suffix attached to an ARM64 instruction. +// The input is a single string consisting of period-separated condition +// codes, such as ".P.W". An initial period is ignored. +func ParseARM64Suffix(cond string) (uint8, bool) { + if cond == "" { + return 0, true + } + return parseARMCondition(cond, arm64LS, nil) +} + +func arm64RegisterNumber(name string, n int16) (int16, bool) { + switch name { + case "F": + if 0 <= n && n <= 31 { + return arm64.REG_F0 + n, true + } + case "R": + if 0 <= n && n <= 30 { // not 31 + return arm64.REG_R0 + n, true + } + case "V": + if 0 <= n && n <= 31 { + return arm64.REG_V0 + n, true + } + } + return 0, false +} diff --git a/src/cmd/asm/internal/arch/ppc64.go b/src/cmd/asm/internal/arch/ppc64.go new file mode 100644 index 0000000000000000000000000000000000000000..6523fbf134f9f650b9d17353d8b3834d44bb3467 --- /dev/null +++ b/src/cmd/asm/internal/arch/ppc64.go @@ -0,0 +1,87 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// This file encapsulates some of the odd characteristics of the +// 64-bit PowerPC (PPC64) instruction set, to minimize its interaction +// with the core of the assembler. + +package arch + +import "cmd/internal/obj/ppc64" + +func jumpPPC64(word string) bool { + switch word { + case "BC", "BCL", "BEQ", "BGE", "BGT", "BL", "BLE", "BLT", "BNE", "BR", "BVC", "BVS", "CALL", "JMP": + return true + } + return false +} + +// IsPPC64RLD reports whether the op (as defined by an ppc64.A* constant) is +// one of the RLD-like instructions that require special handling. +// The FMADD-like instructions behave similarly. +func IsPPC64RLD(op int) bool { + switch op { + case ppc64.ARLDC, ppc64.ARLDCCC, ppc64.ARLDCL, ppc64.ARLDCLCC, + ppc64.ARLDCR, ppc64.ARLDCRCC, ppc64.ARLDMI, ppc64.ARLDMICC, + ppc64.ARLWMI, ppc64.ARLWMICC, ppc64.ARLWNM, ppc64.ARLWNMCC: + return true + case ppc64.AFMADD, ppc64.AFMADDCC, ppc64.AFMADDS, ppc64.AFMADDSCC, + ppc64.AFMSUB, ppc64.AFMSUBCC, ppc64.AFMSUBS, ppc64.AFMSUBSCC, + ppc64.AFNMADD, ppc64.AFNMADDCC, ppc64.AFNMADDS, ppc64.AFNMADDSCC, + ppc64.AFNMSUB, ppc64.AFNMSUBCC, ppc64.AFNMSUBS, ppc64.AFNMSUBSCC: + return true + } + return false +} + +// IsPPC64CMP reports whether the op (as defined by an ppc64.A* constant) is +// one of the CMP instructions that require special handling. +func IsPPC64CMP(op int) bool { + switch op { + case ppc64.ACMP, ppc64.ACMPU, ppc64.ACMPW, ppc64.ACMPWU: + return true + } + return false +} + +// IsPPC64NEG reports whether the op (as defined by an ppc64.A* constant) is +// one of the NEG-like instructions that require special handling. +func IsPPC64NEG(op int) bool { + switch op { + case ppc64.AADDMECC, ppc64.AADDMEVCC, ppc64.AADDMEV, ppc64.AADDME, + ppc64.AADDZECC, ppc64.AADDZEVCC, ppc64.AADDZEV, ppc64.AADDZE, + ppc64.ACNTLZDCC, ppc64.ACNTLZD, ppc64.ACNTLZWCC, ppc64.ACNTLZW, + ppc64.AEXTSBCC, ppc64.AEXTSB, ppc64.AEXTSHCC, ppc64.AEXTSH, + ppc64.AEXTSWCC, ppc64.AEXTSW, ppc64.ANEGCC, ppc64.ANEGVCC, + ppc64.ANEGV, ppc64.ANEG, ppc64.ASLBMFEE, ppc64.ASLBMFEV, + ppc64.ASLBMTE, ppc64.ASUBMECC, ppc64.ASUBMEVCC, ppc64.ASUBMEV, + ppc64.ASUBME, ppc64.ASUBZECC, ppc64.ASUBZEVCC, ppc64.ASUBZEV, + ppc64.ASUBZE: + return true + } + return false +} + +func ppc64RegisterNumber(name string, n int16) (int16, bool) { + switch name { + case "CR": + if 0 <= n && n <= 7 { + return ppc64.REG_CR0 + n, true + } + case "F": + if 0 <= n && n <= 31 { + return ppc64.REG_F0 + n, true + } + case "R": + if 0 <= n && n <= 31 { + return ppc64.REG_R0 + n, true + } + case "SPR": + if 0 <= n && n <= 1024 { + return ppc64.REG_SPR0 + n, true + } + } + return 0, false +} diff --git a/src/cmd/asm/internal/asm/asm.go b/src/cmd/asm/internal/asm/asm.go new file mode 100644 index 0000000000000000000000000000000000000000..3563c1a34c636e95d52ff34e65c65f24d4e6d54e --- /dev/null +++ b/src/cmd/asm/internal/asm/asm.go @@ -0,0 +1,662 @@ +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package asm + +import ( + "bytes" + "fmt" + "text/scanner" + + "cmd/asm/internal/arch" + "cmd/asm/internal/flags" + "cmd/asm/internal/lex" + "cmd/internal/obj" +) + +// TODO: configure the architecture + +var testOut *bytes.Buffer // Gathers output when testing. + +// append adds the Prog to the end of the program-thus-far. +// If doLabel is set, it also defines the labels collect for this Prog. +func (p *Parser) append(prog *obj.Prog, cond string, doLabel bool) { + if cond != "" { + switch p.arch.Thechar { + case '5': + if !arch.ARMConditionCodes(prog, cond) { + p.errorf("unrecognized condition code .%q", cond) + } + + case '7': + if !arch.ARM64Suffix(prog, cond) { + p.errorf("unrecognized suffix .%q", cond) + } + + default: + p.errorf("unrecognized suffix .%q", cond) + } + } + if p.firstProg == nil { + p.firstProg = prog + } else { + p.lastProg.Link = prog + } + p.lastProg = prog + if doLabel { + p.pc++ + for _, label := range p.pendingLabels { + if p.labels[label] != nil { + p.errorf("label %q multiply defined", label) + } + p.labels[label] = prog + } + p.pendingLabels = p.pendingLabels[0:0] + } + prog.Pc = int64(p.pc) + if *flags.Debug { + fmt.Println(p.histLineNum, prog) + } + if testOut != nil { + fmt.Fprintln(testOut, p.histLineNum, prog) + } +} + +// validateSymbol checks that addr represents a valid name for a pseudo-op. +func (p *Parser) validateSymbol(pseudo string, addr *obj.Addr, offsetOk bool) { + if addr.Name != obj.NAME_EXTERN && addr.Name != obj.NAME_STATIC || addr.Scale != 0 || addr.Reg != 0 { + p.errorf("%s symbol %q must be a symbol(SB)", pseudo, addr.Sym.Name) + } + if !offsetOk && addr.Offset != 0 { + p.errorf("%s symbol %q must not be offset from SB", pseudo, addr.Sym.Name) + } +} + +// evalInteger evaluates an integer constant for a pseudo-op. +func (p *Parser) evalInteger(pseudo string, operands []lex.Token) int64 { + addr := p.address(operands) + return p.getConstantPseudo(pseudo, &addr) +} + +// validateImmediate checks that addr represents an immediate constant. +func (p *Parser) validateImmediate(pseudo string, addr *obj.Addr) { + if addr.Type != obj.TYPE_CONST || addr.Name != 0 || addr.Reg != 0 || addr.Index != 0 { + p.errorf("%s: expected immediate constant; found %s", pseudo, obj.Dconv(&emptyProg, addr)) + } +} + +// asmText assembles a TEXT pseudo-op. +// TEXT runtime·sigtramp(SB),4,$0-0 +func (p *Parser) asmText(word string, operands [][]lex.Token) { + if len(operands) != 2 && len(operands) != 3 { + p.errorf("expect two or three operands for TEXT") + } + + // Labels are function scoped. Patch existing labels and + // create a new label space for this TEXT. + p.patch() + p.labels = make(map[string]*obj.Prog) + + // Operand 0 is the symbol name in the form foo(SB). + // That means symbol plus indirect on SB and no offset. + nameAddr := p.address(operands[0]) + p.validateSymbol("TEXT", &nameAddr, false) + name := nameAddr.Sym.Name + next := 1 + + // Next operand is the optional text flag, a literal integer. + var flag = int64(0) + if len(operands) == 3 { + flag = p.evalInteger("TEXT", operands[1]) + next++ + } + + // Next operand is the frame and arg size. + // Bizarre syntax: $frameSize-argSize is two words, not subtraction. + // Both frameSize and argSize must be simple integers; only frameSize + // can be negative. + // The "-argSize" may be missing; if so, set it to obj.ArgsSizeUnknown. + // Parse left to right. + op := operands[next] + if len(op) < 2 || op[0].ScanToken != '$' { + p.errorf("TEXT %s: frame size must be an immediate constant", name) + return + } + op = op[1:] + negative := false + if op[0].ScanToken == '-' { + negative = true + op = op[1:] + } + if len(op) == 0 || op[0].ScanToken != scanner.Int { + p.errorf("TEXT %s: frame size must be an immediate constant", name) + return + } + frameSize := p.positiveAtoi(op[0].String()) + if negative { + frameSize = -frameSize + } + op = op[1:] + argSize := int64(obj.ArgsSizeUnknown) + if len(op) > 0 { + // There is an argument size. It must be a minus sign followed by a non-negative integer literal. + if len(op) != 2 || op[0].ScanToken != '-' || op[1].ScanToken != scanner.Int { + p.errorf("TEXT %s: argument size must be of form -integer", name) + } + argSize = p.positiveAtoi(op[1].String()) + } + prog := &obj.Prog{ + Ctxt: p.ctxt, + As: obj.ATEXT, + Lineno: p.histLineNum, + From: nameAddr, + From3: &obj.Addr{ + Type: obj.TYPE_CONST, + Offset: flag, + }, + To: obj.Addr{ + Type: obj.TYPE_TEXTSIZE, + Offset: frameSize, + // Argsize set below. + }, + } + prog.To.Val = int32(argSize) + + p.append(prog, "", true) +} + +// asmData assembles a DATA pseudo-op. +// DATA masks<>+0x00(SB)/4, $0x00000000 +func (p *Parser) asmData(word string, operands [][]lex.Token) { + if len(operands) != 2 { + p.errorf("expect two operands for DATA") + } + + // Operand 0 has the general form foo<>+0x04(SB)/4. + op := operands[0] + n := len(op) + if n < 3 || op[n-2].ScanToken != '/' || op[n-1].ScanToken != scanner.Int { + p.errorf("expect /size for DATA argument") + } + scale := p.parseScale(op[n-1].String()) + op = op[:n-2] + nameAddr := p.address(op) + p.validateSymbol("DATA", &nameAddr, true) + name := nameAddr.Sym.Name + + // Operand 1 is an immediate constant or address. + valueAddr := p.address(operands[1]) + switch valueAddr.Type { + case obj.TYPE_CONST, obj.TYPE_FCONST, obj.TYPE_SCONST, obj.TYPE_ADDR: + // OK + default: + p.errorf("DATA value must be an immediate constant or address") + } + + // The addresses must not overlap. Easiest test: require monotonicity. + if lastAddr, ok := p.dataAddr[name]; ok && nameAddr.Offset < lastAddr { + p.errorf("overlapping DATA entry for %s", name) + } + p.dataAddr[name] = nameAddr.Offset + int64(scale) + + prog := &obj.Prog{ + Ctxt: p.ctxt, + As: obj.ADATA, + Lineno: p.histLineNum, + From: nameAddr, + From3: &obj.Addr{ + Offset: int64(scale), + }, + To: valueAddr, + } + + p.append(prog, "", false) +} + +// asmGlobl assembles a GLOBL pseudo-op. +// GLOBL shifts<>(SB),8,$256 +// GLOBL shifts<>(SB),$256 +func (p *Parser) asmGlobl(word string, operands [][]lex.Token) { + if len(operands) != 2 && len(operands) != 3 { + p.errorf("expect two or three operands for GLOBL") + } + + // Operand 0 has the general form foo<>+0x04(SB). + nameAddr := p.address(operands[0]) + p.validateSymbol("GLOBL", &nameAddr, false) + next := 1 + + // Next operand is the optional flag, a literal integer. + var flag = int64(0) + if len(operands) == 3 { + flag = p.evalInteger("GLOBL", operands[1]) + next++ + } + + // Final operand is an immediate constant. + addr := p.address(operands[next]) + p.validateImmediate("GLOBL", &addr) + + // log.Printf("GLOBL %s %d, $%d", name, flag, size) + prog := &obj.Prog{ + Ctxt: p.ctxt, + As: obj.AGLOBL, + Lineno: p.histLineNum, + From: nameAddr, + From3: &obj.Addr{ + Offset: flag, + }, + To: addr, + } + p.append(prog, "", false) +} + +// asmPCData assembles a PCDATA pseudo-op. +// PCDATA $2, $705 +func (p *Parser) asmPCData(word string, operands [][]lex.Token) { + if len(operands) != 2 { + p.errorf("expect two operands for PCDATA") + } + + // Operand 0 must be an immediate constant. + key := p.address(operands[0]) + p.validateImmediate("PCDATA", &key) + + // Operand 1 must be an immediate constant. + value := p.address(operands[1]) + p.validateImmediate("PCDATA", &value) + + // log.Printf("PCDATA $%d, $%d", key.Offset, value.Offset) + prog := &obj.Prog{ + Ctxt: p.ctxt, + As: obj.APCDATA, + Lineno: p.histLineNum, + From: key, + To: value, + } + p.append(prog, "", true) +} + +// asmFuncData assembles a FUNCDATA pseudo-op. +// FUNCDATA $1, funcdata<>+4(SB) +func (p *Parser) asmFuncData(word string, operands [][]lex.Token) { + if len(operands) != 2 { + p.errorf("expect two operands for FUNCDATA") + } + + // Operand 0 must be an immediate constant. + valueAddr := p.address(operands[0]) + p.validateImmediate("FUNCDATA", &valueAddr) + + // Operand 1 is a symbol name in the form foo(SB). + nameAddr := p.address(operands[1]) + p.validateSymbol("FUNCDATA", &nameAddr, true) + + prog := &obj.Prog{ + Ctxt: p.ctxt, + As: obj.AFUNCDATA, + Lineno: p.histLineNum, + From: valueAddr, + To: nameAddr, + } + p.append(prog, "", true) +} + +// asmJump assembles a jump instruction. +// JMP R1 +// JMP exit +// JMP 3(PC) +func (p *Parser) asmJump(op int, cond string, a []obj.Addr) { + var target *obj.Addr + prog := &obj.Prog{ + Ctxt: p.ctxt, + Lineno: p.histLineNum, + As: int16(op), + } + switch len(a) { + case 1: + target = &a[0] + case 2: + // Special 2-operand jumps. + target = &a[1] + prog.From = a[0] + case 3: + if p.arch.Thechar == '9' { + // Special 3-operand jumps. + // First two must be constants; a[1] is a register number. + target = &a[2] + prog.From = obj.Addr{ + Type: obj.TYPE_CONST, + Offset: p.getConstant(prog, op, &a[0]), + } + reg := int16(p.getConstant(prog, op, &a[1])) + reg, ok := p.arch.RegisterNumber("R", int16(reg)) + if !ok { + p.errorf("bad register number %d", reg) + } + prog.Reg = reg + break + } + fallthrough + default: + p.errorf("wrong number of arguments to %s instruction", obj.Aconv(op)) + return + } + switch { + case target.Type == obj.TYPE_BRANCH: + // JMP 4(PC) + prog.To = obj.Addr{ + Type: obj.TYPE_BRANCH, + Offset: p.pc + 1 + target.Offset, // +1 because p.pc is incremented in append, below. + } + case target.Type == obj.TYPE_REG: + // JMP R1 + prog.To = *target + case target.Type == obj.TYPE_MEM && (target.Name == obj.NAME_EXTERN || target.Name == obj.NAME_STATIC): + // JMP main·morestack(SB) + prog.To = *target + case target.Type == obj.TYPE_INDIR && (target.Name == obj.NAME_EXTERN || target.Name == obj.NAME_STATIC): + // JMP *main·morestack(SB) + prog.To = *target + prog.To.Type = obj.TYPE_INDIR + case target.Type == obj.TYPE_MEM && target.Reg == 0 && target.Offset == 0: + // JMP exit + if target.Sym == nil { + // Parse error left name unset. + return + } + targetProg := p.labels[target.Sym.Name] + if targetProg == nil { + p.toPatch = append(p.toPatch, Patch{prog, target.Sym.Name}) + } else { + p.branch(prog, targetProg) + } + case target.Type == obj.TYPE_MEM && target.Name == obj.NAME_NONE: + // JMP 4(R0) + prog.To = *target + // On the ppc64, 9a encodes BR (CTR) as BR CTR. We do the same. + if p.arch.Thechar == '9' && target.Offset == 0 { + prog.To.Type = obj.TYPE_REG + } + case target.Type == obj.TYPE_CONST: + // JMP $4 + prog.To = a[0] + default: + p.errorf("cannot assemble jump %+v", target) + } + + p.append(prog, cond, true) +} + +func (p *Parser) patch() { + for _, patch := range p.toPatch { + targetProg := p.labels[patch.label] + if targetProg == nil { + p.errorf("undefined label %s", patch.label) + } else { + p.branch(patch.prog, targetProg) + } + } + p.toPatch = p.toPatch[:0] +} + +func (p *Parser) branch(jmp, target *obj.Prog) { + jmp.To = obj.Addr{ + Type: obj.TYPE_BRANCH, + Index: 0, + } + jmp.To.Val = target +} + +// asmInstruction assembles an instruction. +// MOVW R9, (R10) +func (p *Parser) asmInstruction(op int, cond string, a []obj.Addr) { + // fmt.Printf("%s %+v\n", obj.Aconv(op), a) + prog := &obj.Prog{ + Ctxt: p.ctxt, + Lineno: p.histLineNum, + As: int16(op), + } + switch len(a) { + case 0: + // Nothing to do. + case 1: + if p.arch.UnaryDst[op] { + // prog.From is no address. + prog.To = a[0] + } else { + prog.From = a[0] + // prog.To is no address. + } + if p.arch.Thechar == '9' && arch.IsPPC64NEG(op) { + // NEG: From and To are both a[0]. + prog.To = a[0] + prog.From = a[0] + break + } + case 2: + if p.arch.Thechar == '5' { + if arch.IsARMCMP(op) { + prog.From = a[0] + prog.Reg = p.getRegister(prog, op, &a[1]) + break + } + // Strange special cases. + if arch.IsARMSTREX(op) { + /* + STREX x, (y) + from=(y) reg=x to=x + STREX (x), y + from=(x) reg=y to=y + */ + if a[0].Type == obj.TYPE_REG && a[1].Type != obj.TYPE_REG { + prog.From = a[1] + prog.Reg = a[0].Reg + prog.To = a[0] + break + } else if a[0].Type != obj.TYPE_REG && a[1].Type == obj.TYPE_REG { + prog.From = a[0] + prog.Reg = a[1].Reg + prog.To = a[1] + break + } + p.errorf("unrecognized addressing for %s", obj.Aconv(op)) + } + if arch.IsARMFloatCmp(op) { + prog.From = a[0] + prog.Reg = p.getRegister(prog, op, &a[1]) + break + } + } else if p.arch.Thechar == '7' && arch.IsARM64CMP(op) { + prog.From = a[0] + prog.Reg = p.getRegister(prog, op, &a[1]) + break + } + prog.From = a[0] + prog.To = a[1] + case 3: + switch p.arch.Thechar { + case '5': + // Special cases. + if arch.IsARMSTREX(op) { + /* + STREX x, (y), z + from=(y) reg=x to=z + */ + prog.From = a[1] + prog.Reg = p.getRegister(prog, op, &a[0]) + prog.To = a[2] + break + } + // Otherwise the 2nd operand (a[1]) must be a register. + prog.From = a[0] + prog.Reg = p.getRegister(prog, op, &a[1]) + prog.To = a[2] + case '7': + // ARM64 instructions with one input and two outputs. + if arch.IsARM64STLXR(op) { + prog.From = a[0] + prog.To = a[1] + if a[2].Type != obj.TYPE_REG { + p.errorf("invalid addressing modes for third operand to %s instruction, must be register", obj.Aconv(op)) + } + prog.RegTo2 = a[2].Reg + break + } + prog.From = a[0] + prog.Reg = p.getRegister(prog, op, &a[1]) + prog.To = a[2] + case '6', '8': + prog.From = a[0] + prog.From3 = newAddr(a[1]) + prog.To = a[2] + case '9': + if arch.IsPPC64CMP(op) { + // CMPW etc.; third argument is a CR register that goes into prog.Reg. + prog.From = a[0] + prog.Reg = p.getRegister(prog, op, &a[2]) + prog.To = a[1] + break + } + // Arithmetic. Choices are: + // reg reg reg + // imm reg reg + // reg imm reg + // If the immediate is the middle argument, use From3. + switch a[1].Type { + case obj.TYPE_REG: + prog.From = a[0] + prog.Reg = p.getRegister(prog, op, &a[1]) + prog.To = a[2] + case obj.TYPE_CONST: + prog.From = a[0] + prog.From3 = newAddr(a[1]) + prog.To = a[2] + default: + p.errorf("invalid addressing modes for %s instruction", obj.Aconv(op)) + } + default: + p.errorf("TODO: implement three-operand instructions for this architecture") + } + case 4: + if p.arch.Thechar == '5' && arch.IsARMMULA(op) { + // All must be registers. + p.getRegister(prog, op, &a[0]) + r1 := p.getRegister(prog, op, &a[1]) + p.getRegister(prog, op, &a[2]) + r3 := p.getRegister(prog, op, &a[3]) + prog.From = a[0] + prog.To = a[2] + prog.To.Type = obj.TYPE_REGREG2 + prog.To.Offset = int64(r3) + prog.Reg = r1 + break + } + if p.arch.Thechar == '7' { + prog.From = a[0] + prog.Reg = p.getRegister(prog, op, &a[1]) + prog.From3 = newAddr(a[2]) + prog.To = a[3] + break + } + if p.arch.Thechar == '9' && arch.IsPPC64RLD(op) { + // 2nd operand must always be a register. + // TODO: Do we need to guard this with the instruction type? + // That is, are there 4-operand instructions without this property? + prog.From = a[0] + prog.Reg = p.getRegister(prog, op, &a[1]) + prog.From3 = newAddr(a[2]) + prog.To = a[3] + break + } + p.errorf("can't handle %s instruction with 4 operands", obj.Aconv(op)) + case 5: + if p.arch.Thechar == '9' && arch.IsPPC64RLD(op) { + // Always reg, reg, con, con, reg. (con, con is a 'mask'). + prog.From = a[0] + prog.Reg = p.getRegister(prog, op, &a[1]) + mask1 := p.getConstant(prog, op, &a[2]) + mask2 := p.getConstant(prog, op, &a[3]) + var mask uint32 + if mask1 < mask2 { + mask = (^uint32(0) >> uint(mask1)) & (^uint32(0) << uint(31-mask2)) + } else { + mask = (^uint32(0) >> uint(mask2+1)) & (^uint32(0) << uint(31-(mask1-1))) + } + prog.From3 = &obj.Addr{ + Type: obj.TYPE_CONST, + Offset: int64(mask), + } + prog.To = a[4] + break + } + p.errorf("can't handle %s instruction with 5 operands", obj.Aconv(op)) + case 6: + if p.arch.Thechar == '5' && arch.IsARMMRC(op) { + // Strange special case: MCR, MRC. + prog.To.Type = obj.TYPE_CONST + x0 := p.getConstant(prog, op, &a[0]) + x1 := p.getConstant(prog, op, &a[1]) + x2 := int64(p.getRegister(prog, op, &a[2])) + x3 := int64(p.getRegister(prog, op, &a[3])) + x4 := int64(p.getRegister(prog, op, &a[4])) + x5 := p.getConstant(prog, op, &a[5]) + // Cond is handled specially for this instruction. + offset, MRC, ok := arch.ARMMRCOffset(op, cond, x0, x1, x2, x3, x4, x5) + if !ok { + p.errorf("unrecognized condition code .%q", cond) + } + prog.To.Offset = offset + cond = "" + prog.As = MRC // Both instructions are coded as MRC. + break + } + fallthrough + default: + p.errorf("can't handle %s instruction with %d operands", obj.Aconv(op), len(a)) + } + + p.append(prog, cond, true) +} + +// newAddr returns a new(Addr) initialized to x. +func newAddr(x obj.Addr) *obj.Addr { + p := new(obj.Addr) + *p = x + return p +} + +var emptyProg obj.Prog + +// getConstantPseudo checks that addr represents a plain constant and returns its value. +func (p *Parser) getConstantPseudo(pseudo string, addr *obj.Addr) int64 { + if addr.Type != obj.TYPE_MEM || addr.Name != 0 || addr.Reg != 0 || addr.Index != 0 { + p.errorf("%s: expected integer constant; found %s", pseudo, obj.Dconv(&emptyProg, addr)) + } + return addr.Offset +} + +// getConstant checks that addr represents a plain constant and returns its value. +func (p *Parser) getConstant(prog *obj.Prog, op int, addr *obj.Addr) int64 { + if addr.Type != obj.TYPE_MEM || addr.Name != 0 || addr.Reg != 0 || addr.Index != 0 { + p.errorf("%s: expected integer constant; found %s", obj.Aconv(op), obj.Dconv(prog, addr)) + } + return addr.Offset +} + +// getImmediate checks that addr represents an immediate constant and returns its value. +func (p *Parser) getImmediate(prog *obj.Prog, op int, addr *obj.Addr) int64 { + if addr.Type != obj.TYPE_CONST || addr.Name != 0 || addr.Reg != 0 || addr.Index != 0 { + p.errorf("%s: expected immediate constant; found %s", obj.Aconv(op), obj.Dconv(prog, addr)) + } + return addr.Offset +} + +// getRegister checks that addr represents a register and returns its value. +func (p *Parser) getRegister(prog *obj.Prog, op int, addr *obj.Addr) int16 { + if addr.Type != obj.TYPE_REG || addr.Offset != 0 || addr.Name != 0 || addr.Index != 0 { + p.errorf("%s: expected register; found %s", obj.Aconv(op), obj.Dconv(prog, addr)) + } + return addr.Reg +} diff --git a/src/cmd/asm/internal/asm/endtoend_test.go b/src/cmd/asm/internal/asm/endtoend_test.go new file mode 100644 index 0000000000000000000000000000000000000000..abe4e4efbc9a5c6659e4c244150c2e49206859bb --- /dev/null +++ b/src/cmd/asm/internal/asm/endtoend_test.go @@ -0,0 +1,91 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package asm + +import ( + "bytes" + "fmt" + "io/ioutil" + "log" + "os" + "path/filepath" + "strings" + "testing" + + "cmd/asm/internal/lex" + "cmd/internal/obj" +) + +// An end-to-end test for the assembler: Do we print what we parse? +// Output is generated by, in effect, turning on -S and comparing the +// result against a golden file. + +func testEndToEnd(t *testing.T, goarch string) { + lex.InitHist() + input := filepath.Join("testdata", goarch+".s") + output := filepath.Join("testdata", goarch+".out") + architecture, ctxt := setArch(goarch) + lexer := lex.NewLexer(input, ctxt) + parser := NewParser(ctxt, architecture, lexer) + pList := obj.Linknewplist(ctxt) + var ok bool + testOut = new(bytes.Buffer) // The assembler writes -S output to this buffer. + ctxt.Bso = obj.Binitw(os.Stdout) + defer ctxt.Bso.Flush() + ctxt.Diag = log.Fatalf + obj.Binitw(ioutil.Discard) + pList.Firstpc, ok = parser.Parse() + if !ok { + t.Fatalf("asm: %s assembly failed", goarch) + } + result := string(testOut.Bytes()) + expect, err := ioutil.ReadFile(output) + // For Windows. + result = strings.Replace(result, `testdata\`, `testdata/`, -1) + if err != nil { + t.Fatal(err) + } + if result != string(expect) { + if false { // Enable to capture output. + fmt.Printf("%s", result) + os.Exit(1) + } + t.Errorf("%s failed: output differs", goarch) + r := strings.Split(result, "\n") + e := strings.Split(string(expect), "\n") + if len(r) != len(e) { + t.Errorf("%s: expected %d lines, got %d", goarch, len(e), len(r)) + } + n := len(e) + if n > len(r) { + n = len(r) + } + for i := 0; i < n; i++ { + if r[i] != e[i] { + t.Errorf("%s:%d:\nexpected\n\t%s\ngot\n\t%s", output, i, e[i], r[i]) + } + } + } +} + +func TestPPC64EndToEnd(t *testing.T) { + testEndToEnd(t, "ppc64") +} + +func TestARMEndToEnd(t *testing.T) { + testEndToEnd(t, "arm") +} + +func TestARM64EndToEnd(t *testing.T) { + testEndToEnd(t, "arm64") +} + +func TestAMD64EndToEnd(t *testing.T) { + testEndToEnd(t, "amd64") +} + +func Test386EndToEnd(t *testing.T) { + testEndToEnd(t, "386") +} diff --git a/src/cmd/asm/internal/asm/expr_test.go b/src/cmd/asm/internal/asm/expr_test.go new file mode 100644 index 0000000000000000000000000000000000000000..eafbc5fee715910a73b7f2f9d7148c959736bdfe --- /dev/null +++ b/src/cmd/asm/internal/asm/expr_test.go @@ -0,0 +1,131 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package asm + +import ( + "cmd/asm/internal/lex" + "strings" + "testing" + "text/scanner" +) + +type exprTest struct { + input string + output int64 + atEOF bool +} + +var exprTests = []exprTest{ + // Simple + {"0", 0, true}, + {"3", 3, true}, + {"070", 8 * 7, true}, + {"0x0f", 15, true}, + {"0xFF", 255, true}, + {"9223372036854775807", 9223372036854775807, true}, // max int64 + // Unary + {"-0", 0, true}, + {"~0", -1, true}, + {"~0*0", 0, true}, + {"+3", 3, true}, + {"-3", -3, true}, + {"-9223372036854775808", -9223372036854775808, true}, // min int64 + // Binary + {"3+4", 3 + 4, true}, + {"3-4", 3 - 4, true}, + {"2|5", 2 | 5, true}, + {"3^4", 3 ^ 4, true}, + {"3*4", 3 * 4, true}, + {"14/4", 14 / 4, true}, + {"3<<4", 3 << 4, true}, + {"48>>3", 48 >> 3, true}, + {"3&9", 3 & 9, true}, + // General + {"3*2+3", 3*2 + 3, true}, + {"3+2*3", 3 + 2*3, true}, + {"3*(2+3)", 3 * (2 + 3), true}, + {"3*-(2+3)", 3 * -(2 + 3), true}, + {"3<<2+4", 3<<2 + 4, true}, + {"3<<2+4", 3<<2 + 4, true}, + {"3<<(2+4)", 3 << (2 + 4), true}, + // Junk at EOF. + {"3 x", 3, false}, + // Big number + {"4611686018427387904", 4611686018427387904, true}, +} + +func TestExpr(t *testing.T) { + p := NewParser(nil, nil, nil) // Expression evaluation uses none of these fields of the parser. + for i, test := range exprTests { + p.start(lex.Tokenize(test.input)) + result := int64(p.expr()) + if result != test.output { + t.Errorf("%d: %q evaluated to %d; expected %d", i, test.input, result, test.output) + } + tok := p.next() + if test.atEOF && tok.ScanToken != scanner.EOF { + t.Errorf("%d: %q: at EOF got %s", i, test.input, tok) + } else if !test.atEOF && tok.ScanToken == scanner.EOF { + t.Errorf("%d: %q: expected not EOF but at EOF", i, test.input) + } + } +} + +type badExprTest struct { + input string + error string // Empty means no error. +} + +var badExprTests = []badExprTest{ + {"0/0", "division by zero"}, + {"3/0", "division by zero"}, + {"(1<<63)/0", "divide of value with high bit set"}, + {"3%0", "modulo by zero"}, + {"(1<<63)%0", "modulo of value with high bit set"}, + {"3<<-4", "negative left shift count"}, + {"3<<(1<<63)", "negative left shift count"}, + {"3>>-4", "negative right shift count"}, + {"3>>(1<<63)", "negative right shift count"}, + {"(1<<63)>>2", "right shift of value with high bit set"}, + {"(1<<62)>>2", ""}, + {`'\x80'`, "illegal UTF-8 encoding for character constant"}, + {"(23*4", "missing closing paren"}, + {")23*4", "unexpected ) evaluating expression"}, + {"18446744073709551616", "value out of range"}, +} + +func TestBadExpr(t *testing.T) { + panicOnError = true + defer func() { + panicOnError = false + }() + for i, test := range badExprTests { + err := runBadTest(i, test, t) + if err == nil { + if test.error != "" { + t.Errorf("#%d: %q: expected error %q; got none", i, test.input, test.error) + } + continue + } + if !strings.Contains(err.Error(), test.error) { + t.Errorf("#%d: expected error %q; got %q", i, test.error, err) + continue + } + } +} + +func runBadTest(i int, test badExprTest, t *testing.T) (err error) { + p := NewParser(nil, nil, nil) // Expression evaluation uses none of these fields of the parser. + p.start(lex.Tokenize(test.input)) + defer func() { + e := recover() + var ok bool + if err, ok = e.(error); e != nil && !ok { + t.Fatal(e) + } + }() + p.expr() + return nil +} diff --git a/src/cmd/asm/internal/asm/operand_test.go b/src/cmd/asm/internal/asm/operand_test.go new file mode 100644 index 0000000000000000000000000000000000000000..01335ed38b429967f28a19682bd178c34f39ec56 --- /dev/null +++ b/src/cmd/asm/internal/asm/operand_test.go @@ -0,0 +1,430 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package asm + +import ( + "os" + "testing" + + "cmd/asm/internal/arch" + "cmd/asm/internal/lex" + "cmd/internal/obj" +) + +// A simple in-out test: Do we print what we parse? + +func setArch(goarch string) (*arch.Arch, *obj.Link) { + os.Setenv("GOOS", "linux") // obj can handle this OS for all architectures. + architecture := arch.Set(goarch) + if architecture == nil { + panic("asm: unrecognized architecture " + goarch) + } + return architecture, obj.Linknew(architecture.LinkArch) +} + +func newParser(goarch string) *Parser { + architecture, ctxt := setArch(goarch) + return NewParser(ctxt, architecture, nil) +} + +func testOperandParser(t *testing.T, parser *Parser, tests []operandTest) { + for _, test := range tests { + parser.start(lex.Tokenize(test.input)) + addr := obj.Addr{} + parser.operand(&addr) + result := obj.Dconv(&emptyProg, &addr) + if result != test.output { + t.Errorf("fail at %s: got %s; expected %s\n", test.input, result, test.output) + } + } +} + +func TestAMD64OperandParser(t *testing.T) { + parser := newParser("amd64") + testOperandParser(t, parser, amd64OperandTests) +} + +func Test386OperandParser(t *testing.T) { + parser := newParser("386") + testOperandParser(t, parser, x86OperandTests) +} + +func TestARMOperandParser(t *testing.T) { + parser := newParser("arm") + testOperandParser(t, parser, armOperandTests) +} +func TestARM64OperandParser(t *testing.T) { + parser := newParser("arm64") + testOperandParser(t, parser, arm64OperandTests) +} + +func TestPPC64OperandParser(t *testing.T) { + parser := newParser("ppc64") + testOperandParser(t, parser, ppc64OperandTests) +} + +type operandTest struct { + input, output string +} + +// Examples collected by scanning all the assembly in the standard repo. + +var amd64OperandTests = []operandTest{ + {"$(-1.0)", "$(-1.0)"}, + {"$(0.0)", "$(0.0)"}, + {"$(0x2000000+116)", "$33554548"}, + {"$(0x3F<<7)", "$8064"}, + {"$(112+8)", "$120"}, + {"$(1<<63)", "$-9223372036854775808"}, + {"$-1", "$-1"}, + {"$0", "$0"}, + {"$0-0", "$0"}, + {"$0-16", "$-16"}, + {"$0x000FFFFFFFFFFFFF", "$4503599627370495"}, + {"$0x01", "$1"}, + {"$0x02", "$2"}, + {"$0x04", "$4"}, + {"$0x3FE", "$1022"}, + {"$0x7fffffe00000", "$140737486258176"}, + {"$0xfffffffffffff001", "$-4095"}, + {"$1", "$1"}, + {"$1.0", "$(1.0)"}, + {"$10", "$10"}, + {"$1000", "$1000"}, + {"$1000000", "$1000000"}, + {"$1000000000", "$1000000000"}, + {"$__tsan_func_enter(SB)", "$__tsan_func_enter(SB)"}, + {"$main(SB)", "$main(SB)"}, + {"$masks<>(SB)", "$masks<>(SB)"}, + {"$setg_gcc<>(SB)", "$setg_gcc<>(SB)"}, + {"$shifts<>(SB)", "$shifts<>(SB)"}, + {"$~(1<<63)", "$9223372036854775807"}, + {"$~0x3F", "$-64"}, + {"$~15", "$-16"}, + {"(((8)&0xf)*4)(SP)", "32(SP)"}, + {"(((8-14)&0xf)*4)(SP)", "40(SP)"}, + {"(6+8)(AX)", "14(AX)"}, + {"(8*4)(BP)", "32(BP)"}, + {"(AX)", "(AX)"}, + {"(AX)(CX*8)", "(AX)(CX*8)"}, + {"(BP)(CX*4)", "(BP)(CX*4)"}, + {"(BP)(DX*4)", "(BP)(DX*4)"}, + {"(BP)(R8*4)", "(BP)(R8*4)"}, + {"(BX)", "(BX)"}, + {"(DI)", "(DI)"}, + {"(DI)(BX*1)", "(DI)(BX*1)"}, + {"(DX)", "(DX)"}, + {"(R9)", "(R9)"}, + {"(R9)(BX*8)", "(R9)(BX*8)"}, + {"(SI)", "(SI)"}, + {"(SI)(BX*1)", "(SI)(BX*1)"}, + {"(SI)(DX*1)", "(SI)(DX*1)"}, + {"(SP)", "(SP)"}, + {"+3(PC)", "3(PC)"}, + {"-1(DI)(BX*1)", "-1(DI)(BX*1)"}, + {"-3(PC)", "-3(PC)"}, + {"-64(SI)(BX*1)", "-64(SI)(BX*1)"}, + {"-96(SI)(BX*1)", "-96(SI)(BX*1)"}, + {"AL", "AL"}, + {"AX", "AX"}, + {"BP", "BP"}, + {"BX", "BX"}, + {"CX", "CX"}, + {"DI", "DI"}, + {"DX", "DX"}, + {"R10", "R10"}, + {"R10", "R10"}, + {"R11", "R11"}, + {"R12", "R12"}, + {"R13", "R13"}, + {"R14", "R14"}, + {"R15", "R15"}, + {"R8", "R8"}, + {"R9", "R9"}, + {"SI", "SI"}, + {"SP", "SP"}, + {"X0", "X0"}, + {"X1", "X1"}, + {"X10", "X10"}, + {"X11", "X11"}, + {"X12", "X12"}, + {"X13", "X13"}, + {"X14", "X14"}, + {"X15", "X15"}, + {"X2", "X2"}, + {"X3", "X3"}, + {"X4", "X4"}, + {"X5", "X5"}, + {"X6", "X6"}, + {"X7", "X7"}, + {"X8", "X8"}, + {"X9", "X9"}, + {"_expand_key_128<>(SB)", "_expand_key_128<>(SB)"}, + {"_seek<>(SB)", "_seek<>(SB)"}, + {"a2+16(FP)", "a2+16(FP)"}, + {"addr2+24(FP)", "addr2+24(FP)"}, + {"asmcgocall<>(SB)", "asmcgocall<>(SB)"}, + {"b+24(FP)", "b+24(FP)"}, + {"b_len+32(FP)", "b_len+32(FP)"}, + {"racecall<>(SB)", "racecall<>(SB)"}, + {"rcv_name+20(FP)", "rcv_name+20(FP)"}, + {"retoffset+28(FP)", "retoffset+28(FP)"}, + {"runtime·_GetStdHandle(SB)", "runtime._GetStdHandle(SB)"}, + {"sync\u2215atomic·AddInt64(SB)", "sync/atomic.AddInt64(SB)"}, + {"timeout+20(FP)", "timeout+20(FP)"}, + {"ts+16(FP)", "ts+16(FP)"}, + {"x+24(FP)", "x+24(FP)"}, + {"x·y(SB)", "x.y(SB)"}, + {"x·y(SP)", "x.y(SP)"}, + {"x·y+8(SB)", "x.y+8(SB)"}, + {"x·y+8(SP)", "x.y+8(SP)"}, + {"y+56(FP)", "y+56(FP)"}, + {"·AddUint32(SB)", "\"\".AddUint32(SB)"}, + {"·callReflect(SB)", "\"\".callReflect(SB)"}, +} + +var x86OperandTests = []operandTest{ + {"$(2.928932188134524e-01)", "$(0.29289321881345243)"}, + {"$-1", "$-1"}, + {"$0", "$0"}, + {"$0x00000000", "$0"}, + {"$runtime·badmcall(SB)", "$runtime.badmcall(SB)"}, + {"$setg_gcc<>(SB)", "$setg_gcc<>(SB)"}, + {"$~15", "$-16"}, + {"(-64*1024+104)(SP)", "-65432(SP)"}, + {"(0*4)(BP)", "(BP)"}, + {"(1*4)(DI)", "4(DI)"}, + {"(4*4)(BP)", "16(BP)"}, + {"(AX)", "(AX)"}, + {"(BP)(CX*4)", "(BP)(CX*4)"}, + {"(BP*8)", "0(BP*8)"}, + {"(BX)", "(BX)"}, + {"(SP)", "(SP)"}, + {"*AX", "AX"}, // TODO: Should make * illegal here; a simple alias for JMP AX. + {"*runtime·_GetStdHandle(SB)", "*runtime._GetStdHandle(SB)"}, + {"-(4+12)(DI)", "-16(DI)"}, + {"-1(DI)(BX*1)", "-1(DI)(BX*1)"}, + {"-96(DI)(BX*1)", "-96(DI)(BX*1)"}, + {"0(AX)", "(AX)"}, + {"0(BP)", "(BP)"}, + {"0(BX)", "(BX)"}, + {"4(AX)", "4(AX)"}, + {"AL", "AL"}, + {"AX", "AX"}, + {"BP", "BP"}, + {"BX", "BX"}, + {"CX", "CX"}, + {"DI", "DI"}, + {"DX", "DX"}, + {"F0", "F0"}, + {"GS", "GS"}, + {"SI", "SI"}, + {"SP", "SP"}, + {"X0", "X0"}, + {"X1", "X1"}, + {"X2", "X2"}, + {"X3", "X3"}, + {"X4", "X4"}, + {"X5", "X5"}, + {"X6", "X6"}, + {"X7", "X7"}, + {"asmcgocall<>(SB)", "asmcgocall<>(SB)"}, + {"ax+4(FP)", "ax+4(FP)"}, + {"ptime-12(SP)", "ptime-12(SP)"}, + {"runtime·_NtWaitForSingleObject(SB)", "runtime._NtWaitForSingleObject(SB)"}, + {"s(FP)", "s(FP)"}, + {"sec+4(FP)", "sec+4(FP)"}, + {"shifts<>(SB)(CX*8)", "shifts<>(SB)(CX*8)"}, + {"x+4(FP)", "x+4(FP)"}, + {"·AddUint32(SB)", "\"\".AddUint32(SB)"}, + {"·reflectcall(SB)", "\"\".reflectcall(SB)"}, +} + +var armOperandTests = []operandTest{ + {"$0", "$0"}, + {"$256", "$256"}, + {"(R0)", "(R0)"}, + {"(R11)", "(R11)"}, + {"(g)", "(g)"}, + {"-12(R4)", "-12(R4)"}, + {"0(PC)", "0(PC)"}, + {"1024", "1024"}, + {"12(R(1))", "12(R1)"}, + {"12(R13)", "12(R13)"}, + {"R0", "R0"}, + {"R0->(32-1)", "R0->31"}, + {"R0<>R(1)", "R0>>R1"}, + {"R0@>(32-1)", "R0@>31"}, + {"R1", "R1"}, + {"R11", "R11"}, + {"R12", "R12"}, + {"R13", "R13"}, + {"R14", "R14"}, + {"R15", "R15"}, + {"R1<<2(R3)", "R1<<2(R3)"}, + {"R(1)<<2(R(3))", "R1<<2(R3)"}, + {"R2", "R2"}, + {"R3", "R3"}, + {"R4", "R4"}, + {"R(4)", "R4"}, + {"R5", "R5"}, + {"R6", "R6"}, + {"R7", "R7"}, + {"R8", "R8"}, + {"[R0,R1,g,R15]", "[R0,R1,g,R15]"}, + {"[R0-R7]", "[R0,R1,R2,R3,R4,R5,R6,R7]"}, + {"[R(0)-R(7)]", "[R0,R1,R2,R3,R4,R5,R6,R7]"}, + {"[R0]", "[R0]"}, + {"[R1-R12]", "[R1,R2,R3,R4,R5,R6,R7,R8,R9,g,R11,R12]"}, + {"armCAS64(SB)", "armCAS64(SB)"}, + {"asmcgocall<>(SB)", "asmcgocall<>(SB)"}, + {"c+28(FP)", "c+28(FP)"}, + {"g", "g"}, + {"gosave<>(SB)", "gosave<>(SB)"}, + {"retlo+12(FP)", "retlo+12(FP)"}, + {"runtime·_sfloat2(SB)", "runtime._sfloat2(SB)"}, + {"·AddUint32(SB)", "\"\".AddUint32(SB)"}, + {"(R1, R3)", "(R1, R3)"}, + {"[R0,R1,g,R15", ""}, // Issue 11764 - previously asm just hung parsing ']' missing register lists +} + +var ppc64OperandTests = []operandTest{ + {"$((1<<63)-1)", "$9223372036854775807"}, + {"$(-64*1024)", "$-65536"}, + {"$(1024 * 8)", "$8192"}, + {"$-1", "$-1"}, + {"$-24(R4)", "$-24(R4)"}, + {"$0", "$0"}, + {"$0(R1)", "$(R1)"}, + {"$0.5", "$(0.5)"}, + {"$0x7000", "$28672"}, + {"$0x88888eef", "$2290650863"}, + {"$1", "$1"}, + {"$_main<>(SB)", "$_main<>(SB)"}, + {"$argframe(FP)", "$argframe(FP)"}, + {"$runtime·tlsg(SB)", "$runtime.tlsg(SB)"}, + {"$~3", "$-4"}, + {"(-288-3*8)(R1)", "-312(R1)"}, + {"(16)(R7)", "16(R7)"}, + {"(8)(g)", "8(g)"}, + {"(CTR)", "(CTR)"}, + {"(R0)", "(R0)"}, + {"(R3)", "(R3)"}, + {"(R4)", "(R4)"}, + {"(R5)", "(R5)"}, + {"(R5)(R6*1)", "(R5)(R6*1)"}, + {"(R5+R6)", "(R5)(R6*1)"}, // Old syntax. + {"-1(R4)", "-1(R4)"}, + {"-1(R5)", "-1(R5)"}, + {"6(PC)", "6(PC)"}, + {"CR7", "CR7"}, + {"CTR", "CTR"}, + {"F14", "F14"}, + {"F15", "F15"}, + {"F16", "F16"}, + {"F17", "F17"}, + {"F18", "F18"}, + {"F19", "F19"}, + {"F20", "F20"}, + {"F21", "F21"}, + {"F22", "F22"}, + {"F23", "F23"}, + {"F24", "F24"}, + {"F25", "F25"}, + {"F26", "F26"}, + {"F27", "F27"}, + {"F28", "F28"}, + {"F29", "F29"}, + {"F30", "F30"}, + {"F31", "F31"}, + {"LR", "LR"}, + {"R0", "R0"}, + {"R1", "R1"}, + {"R11", "R11"}, + {"R12", "R12"}, + {"R13", "R13"}, + {"R14", "R14"}, + {"R15", "R15"}, + {"R16", "R16"}, + {"R17", "R17"}, + {"R18", "R18"}, + {"R19", "R19"}, + {"R2", "R2"}, + {"R20", "R20"}, + {"R21", "R21"}, + {"R22", "R22"}, + {"R23", "R23"}, + {"R24", "R24"}, + {"R25", "R25"}, + {"R26", "R26"}, + {"R27", "R27"}, + {"R28", "R28"}, + {"R29", "R29"}, + {"R3", "R3"}, + {"R31", "R31"}, + {"R4", "R4"}, + {"R5", "R5"}, + {"R6", "R6"}, + {"R7", "R7"}, + {"R8", "R8"}, + {"R9", "R9"}, + {"SPR(269)", "SPR(269)"}, + {"a(FP)", "a(FP)"}, + {"g", "g"}, + {"ret+8(FP)", "ret+8(FP)"}, + {"runtime·abort(SB)", "runtime.abort(SB)"}, + {"·AddUint32(SB)", "\"\".AddUint32(SB)"}, + {"·trunc(SB)", "\"\".trunc(SB)"}, +} + +var arm64OperandTests = []operandTest{ + {"$0", "$0"}, + {"$0.5", "$(0.5)"}, + {"0(R26)", "(R26)"}, + {"0(RSP)", "(RSP)"}, + {"$1", "$1"}, + {"$-1", "$-1"}, + {"$1000", "$1000"}, + {"$1000000000", "$1000000000"}, + {"$0x7fff3c000", "$34358935552"}, + {"$1234", "$1234"}, + {"$~15", "$-16"}, + {"$16", "$16"}, + {"-16(RSP)", "-16(RSP)"}, + {"16(RSP)", "16(RSP)"}, + {"1(R1)", "1(R1)"}, + {"-1(R4)", "-1(R4)"}, + {"18740(R5)", "18740(R5)"}, + {"$2", "$2"}, + {"$-24(R4)", "$-24(R4)"}, + {"-24(RSP)", "-24(RSP)"}, + {"$24(RSP)", "$24(RSP)"}, + {"-32(RSP)", "-32(RSP)"}, + {"$48", "$48"}, + {"$(-64*1024)(R7)", "$-65536(R7)"}, + {"$(8-1)", "$7"}, + {"a+0(FP)", "a(FP)"}, + {"a1+8(FP)", "a1+8(FP)"}, + {"·AddInt32(SB)", `"".AddInt32(SB)`}, + {"runtime·divWVW(SB)", "runtime.divWVW(SB)"}, + {"$argframe+0(FP)", "$argframe(FP)"}, + {"$asmcgocall<>(SB)", "$asmcgocall<>(SB)"}, + {"EQ", "EQ"}, + {"F29", "F29"}, + {"F3", "F3"}, + {"F30", "F30"}, + {"g", "g"}, + {"LR", "R30"}, + {"(LR)", "(R30)"}, + {"R0", "R0"}, + {"R10", "R10"}, + {"R11", "R11"}, + {"$4503601774854144.0", "$(4503601774854144.0)"}, + {"$runtime·badsystemstack(SB)", "$runtime.badsystemstack(SB)"}, + {"ZR", "ZR"}, + {"(ZR)", "(ZR)"}, + {"(R29, RSP)", "(R29, RSP)"}, +} diff --git a/src/cmd/asm/internal/asm/parse.go b/src/cmd/asm/internal/asm/parse.go new file mode 100644 index 0000000000000000000000000000000000000000..6cf50df5bb2f42cbd3e12bcd924a49be0e9ee7d5 --- /dev/null +++ b/src/cmd/asm/internal/asm/parse.go @@ -0,0 +1,988 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package asm implements the parser and instruction generator for the assembler. +// TODO: Split apart? +package asm + +import ( + "fmt" + "log" + "os" + "strconv" + "text/scanner" + "unicode/utf8" + + "cmd/asm/internal/arch" + "cmd/asm/internal/lex" + "cmd/internal/obj" +) + +type Parser struct { + lex lex.TokenReader + lineNum int // Line number in source file. + histLineNum int32 // Cumulative line number across source files. + errorLine int32 // (Cumulative) line number of last error. + errorCount int // Number of errors. + pc int64 // virtual PC; count of Progs; doesn't advance for GLOBL or DATA. + input []lex.Token + inputPos int + pendingLabels []string // Labels to attach to next instruction. + labels map[string]*obj.Prog + toPatch []Patch + addr []obj.Addr + arch *arch.Arch + ctxt *obj.Link + firstProg *obj.Prog + lastProg *obj.Prog + dataAddr map[string]int64 // Most recent address for DATA for this symbol. +} + +type Patch struct { + prog *obj.Prog + label string +} + +func NewParser(ctxt *obj.Link, ar *arch.Arch, lexer lex.TokenReader) *Parser { + return &Parser{ + ctxt: ctxt, + arch: ar, + lex: lexer, + labels: make(map[string]*obj.Prog), + dataAddr: make(map[string]int64), + } +} + +// panicOnError is enable when testing to abort execution on the first error +// and turn it into a recoverable panic. +var panicOnError bool + +func (p *Parser) errorf(format string, args ...interface{}) { + if panicOnError { + panic(fmt.Errorf(format, args...)) + } + if p.histLineNum == p.errorLine { + // Only one error per line. + return + } + p.errorLine = p.histLineNum + // Put file and line information on head of message. + format = "%s:%d: " + format + "\n" + args = append([]interface{}{p.lex.File(), p.lineNum}, args...) + fmt.Fprintf(os.Stderr, format, args...) + p.errorCount++ + if p.errorCount > 10 { + log.Fatal("too many errors") + } +} + +func (p *Parser) Parse() (*obj.Prog, bool) { + for p.line() { + } + if p.errorCount > 0 { + return nil, false + } + p.patch() + return p.firstProg, true +} + +// WORD [ arg {, arg} ] (';' | '\n') +func (p *Parser) line() bool { + // Skip newlines. + var tok lex.ScanToken + for { + tok = p.lex.Next() + // We save the line number here so error messages from this instruction + // are labeled with this line. Otherwise we complain after we've absorbed + // the terminating newline and the line numbers are off by one in errors. + p.lineNum = p.lex.Line() + p.histLineNum = lex.HistLine() + switch tok { + case '\n', ';': + continue + case scanner.EOF: + return false + } + break + } + // First item must be an identifier. + if tok != scanner.Ident { + p.errorf("expected identifier, found %q", p.lex.Text()) + return false // Might as well stop now. + } + word := p.lex.Text() + var cond string + operands := make([][]lex.Token, 0, 3) + // Zero or more comma-separated operands, one per loop. + nesting := 0 + colon := -1 + for tok != '\n' && tok != ';' { + // Process one operand. + items := make([]lex.Token, 0, 3) + for { + tok = p.lex.Next() + if len(operands) == 0 && len(items) == 0 { + if (p.arch.Thechar == '5' || p.arch.Thechar == '7') && tok == '.' { + // ARM conditionals. + tok = p.lex.Next() + str := p.lex.Text() + if tok != scanner.Ident { + p.errorf("ARM condition expected identifier, found %s", str) + } + cond = cond + "." + str + continue + } + if tok == ':' { + // Labels. + p.pendingLabels = append(p.pendingLabels, word) + return true + } + } + if tok == scanner.EOF { + p.errorf("unexpected EOF") + return false + } + // Split operands on comma. Also, the old syntax on x86 for a "register pair" + // was AX:DX, for which the new syntax is DX, AX. Note the reordering. + if tok == '\n' || tok == ';' || (nesting == 0 && (tok == ',' || tok == ':')) { + if tok == ':' { + // Remember this location so we can swap the operands below. + if colon >= 0 { + p.errorf("invalid ':' in operand") + } + colon = len(operands) + } + break + } + if tok == '(' || tok == '[' { + nesting++ + } + if tok == ')' || tok == ']' { + nesting-- + } + items = append(items, lex.Make(tok, p.lex.Text())) + } + if len(items) > 0 { + operands = append(operands, items) + if colon >= 0 && len(operands) == colon+2 { + // AX:DX becomes DX, AX. + operands[colon], operands[colon+1] = operands[colon+1], operands[colon] + colon = -1 + } + } else if len(operands) > 0 || tok == ',' || colon >= 0 { + // Had a separator with nothing after. + p.errorf("missing operand") + } + } + i, present := arch.Pseudos[word] + if present { + p.pseudo(i, word, operands) + return true + } + i, present = p.arch.Instructions[word] + if present { + p.instruction(i, word, cond, operands) + return true + } + p.errorf("unrecognized instruction %q", word) + return true +} + +func (p *Parser) instruction(op int, word, cond string, operands [][]lex.Token) { + p.addr = p.addr[0:0] + isJump := p.arch.IsJump(word) + for _, op := range operands { + addr := p.address(op) + if !isJump && addr.Reg < 0 { // Jumps refer to PC, a pseudo. + p.errorf("illegal use of pseudo-register in %s", word) + } + p.addr = append(p.addr, addr) + } + if isJump { + p.asmJump(op, cond, p.addr) + return + } + p.asmInstruction(op, cond, p.addr) +} + +func (p *Parser) pseudo(op int, word string, operands [][]lex.Token) { + switch op { + case obj.ATEXT: + p.asmText(word, operands) + case obj.ADATA: + p.asmData(word, operands) + case obj.AGLOBL: + p.asmGlobl(word, operands) + case obj.APCDATA: + p.asmPCData(word, operands) + case obj.AFUNCDATA: + p.asmFuncData(word, operands) + default: + p.errorf("unimplemented: %s", word) + } +} + +func (p *Parser) start(operand []lex.Token) { + p.input = operand + p.inputPos = 0 +} + +// address parses the operand into a link address structure. +func (p *Parser) address(operand []lex.Token) obj.Addr { + p.start(operand) + addr := obj.Addr{} + p.operand(&addr) + return addr +} + +// parseScale converts a decimal string into a valid scale factor. +func (p *Parser) parseScale(s string) int8 { + switch s { + case "1", "2", "4", "8": + return int8(s[0] - '0') + } + p.errorf("bad scale: %s", s) + return 0 +} + +// operand parses a general operand and stores the result in *a. +func (p *Parser) operand(a *obj.Addr) bool { + //fmt.Printf("Operand: %v\n", p.input) + if len(p.input) == 0 { + p.errorf("empty operand: cannot happen") + return false + } + // General address (with a few exceptions) looks like + // $sym±offset(SB)(reg)(index*scale) + // Exceptions are: + // + // R1 + // offset + // $offset + // Every piece is optional, so we scan left to right and what + // we discover tells us where we are. + + // Prefix: $. + var prefix rune + switch tok := p.peek(); tok { + case '$', '*': + prefix = rune(tok) + p.next() + } + + // Symbol: sym±offset(SB) + tok := p.next() + name := tok.String() + if tok.ScanToken == scanner.Ident && !p.atStartOfRegister(name) { + // We have a symbol. Parse $sym±offset(symkind) + p.symbolReference(a, name, prefix) + // fmt.Printf("SYM %s\n", obj.Dconv(&emptyProg, 0, a)) + if p.peek() == scanner.EOF { + return true + } + } + + // Special register list syntax for arm: [R1,R3-R7] + if tok.ScanToken == '[' { + if prefix != 0 { + p.errorf("illegal use of register list") + } + p.registerList(a) + p.expect(scanner.EOF) + return true + } + + // Register: R1 + if tok.ScanToken == scanner.Ident && p.atStartOfRegister(name) { + if p.atRegisterShift() { + // ARM shifted register such as R1<>2. + a.Type = obj.TYPE_SHIFT + a.Offset = p.registerShift(tok.String(), prefix) + if p.peek() == '(' { + // Can only be a literal register here. + p.next() + tok := p.next() + name := tok.String() + if !p.atStartOfRegister(name) { + p.errorf("expected register; found %s", name) + } + a.Reg, _ = p.registerReference(name) + p.get(')') + } + } else if r1, r2, scale, ok := p.register(tok.String(), prefix); ok { + if scale != 0 { + p.errorf("expected simple register reference") + } + a.Type = obj.TYPE_REG + a.Reg = r1 + if r2 != 0 { + // Form is R1:R2. It is on RHS and the second register + // needs to go into the LHS. + panic("cannot happen (Addr.Reg2)") + } + } + // fmt.Printf("REG %s\n", obj.Dconv(&emptyProg, 0, a)) + p.expect(scanner.EOF) + return true + } + + // Constant. + haveConstant := false + switch tok.ScanToken { + case scanner.Int, scanner.Float, scanner.String, scanner.Char, '+', '-', '~': + haveConstant = true + case '(': + // Could be parenthesized expression or (R). + rname := p.next().String() + p.back() + haveConstant = !p.atStartOfRegister(rname) + if !haveConstant { + p.back() // Put back the '('. + } + } + if haveConstant { + p.back() + if p.have(scanner.Float) { + if prefix != '$' { + p.errorf("floating-point constant must be an immediate") + } + a.Type = obj.TYPE_FCONST + a.Val = p.floatExpr() + // fmt.Printf("FCONST %s\n", obj.Dconv(&emptyProg, 0, a)) + p.expect(scanner.EOF) + return true + } + if p.have(scanner.String) { + if prefix != '$' { + p.errorf("string constant must be an immediate") + } + str, err := strconv.Unquote(p.get(scanner.String).String()) + if err != nil { + p.errorf("string parse error: %s", err) + } + a.Type = obj.TYPE_SCONST + a.Val = str + // fmt.Printf("SCONST %s\n", obj.Dconv(&emptyProg, 0, a)) + p.expect(scanner.EOF) + return true + } + a.Offset = int64(p.expr()) + if p.peek() != '(' { + switch prefix { + case '$': + a.Type = obj.TYPE_CONST + case '*': + a.Type = obj.TYPE_INDIR // Can appear but is illegal, will be rejected by the linker. + default: + a.Type = obj.TYPE_MEM + } + // fmt.Printf("CONST %d %s\n", a.Offset, obj.Dconv(&emptyProg, 0, a)) + p.expect(scanner.EOF) + return true + } + // fmt.Printf("offset %d \n", a.Offset) + } + + // Register indirection: (reg) or (index*scale). We are on the opening paren. + p.registerIndirect(a, prefix) + // fmt.Printf("DONE %s\n", p.arch.Dconv(&emptyProg, 0, a)) + + p.expect(scanner.EOF) + return true +} + +// atStartOfRegister reports whether the parser is at the start of a register definition. +func (p *Parser) atStartOfRegister(name string) bool { + // Simple register: R10. + _, present := p.arch.Register[name] + if present { + return true + } + // Parenthesized register: R(10). + return p.arch.RegisterPrefix[name] && p.peek() == '(' +} + +// atRegisterShift reports whether we are at the start of an ARM shifted register. +// We have consumed the register or R prefix. +func (p *Parser) atRegisterShift() bool { + // ARM only. + if p.arch.Thechar != '5' { + return false + } + // R1<<... + if lex.IsRegisterShift(p.peek()) { + return true + } + // R(1)<<... Ugly check. TODO: Rethink how we handle ARM register shifts to be + // less special. + if p.peek() != '(' || len(p.input)-p.inputPos < 4 { + return false + } + return p.at('(', scanner.Int, ')') && lex.IsRegisterShift(p.input[p.inputPos+3].ScanToken) +} + +// registerReference parses a register given either the name, R10, or a parenthesized form, SPR(10). +func (p *Parser) registerReference(name string) (int16, bool) { + r, present := p.arch.Register[name] + if present { + return r, true + } + if !p.arch.RegisterPrefix[name] { + p.errorf("expected register; found %s", name) + return 0, false + } + p.get('(') + tok := p.get(scanner.Int) + num, err := strconv.ParseInt(tok.String(), 10, 16) + p.get(')') + if err != nil { + p.errorf("parsing register list: %s", err) + return 0, false + } + r, ok := p.arch.RegisterNumber(name, int16(num)) + if !ok { + p.errorf("illegal register %s(%d)", name, r) + return 0, false + } + return r, true +} + +// register parses a full register reference where there is no symbol present (as in 4(R0) or R(10) but not sym(SB)) +// including forms involving multiple registers such as R1:R2. +func (p *Parser) register(name string, prefix rune) (r1, r2 int16, scale int8, ok bool) { + // R1 or R(1) R1:R2 R1,R2 R1+R2, or R1*scale. + r1, ok = p.registerReference(name) + if !ok { + return + } + if prefix != 0 && prefix != '*' { // *AX is OK. + p.errorf("prefix %c not allowed for register: %c%s", prefix, prefix, name) + } + c := p.peek() + if c == ':' || c == ',' || c == '+' { + // 2nd register; syntax (R1+R2) etc. No two architectures agree. + // Check the architectures match the syntax. + char := p.arch.Thechar + switch p.next().ScanToken { + case ',': + if char != '5' && char != '7' { + p.errorf("(register,register) not supported on this architecture") + return + } + case '+': + if char != '9' { + p.errorf("(register+register) not supported on this architecture") + return + } + } + name := p.next().String() + r2, ok = p.registerReference(name) + if !ok { + return + } + } + if p.peek() == '*' { + // Scale + p.next() + scale = p.parseScale(p.next().String()) + } + return r1, r2, scale, true +} + +// registerShift parses an ARM shifted register reference and returns the encoded representation. +// There is known to be a register (current token) and a shift operator (peeked token). +func (p *Parser) registerShift(name string, prefix rune) int64 { + if prefix != 0 { + p.errorf("prefix %c not allowed for shifted register: $%s", prefix, name) + } + // R1 op R2 or r1 op constant. + // op is: + // "<<" == 0 + // ">>" == 1 + // "->" == 2 + // "@>" == 3 + r1, ok := p.registerReference(name) + if !ok { + return 0 + } + var op int16 + switch p.next().ScanToken { + case lex.LSH: + op = 0 + case lex.RSH: + op = 1 + case lex.ARR: + op = 2 + case lex.ROT: + op = 3 + } + tok := p.next() + str := tok.String() + var count int16 + switch tok.ScanToken { + case scanner.Ident: + r2, ok := p.registerReference(str) + if !ok { + p.errorf("rhs of shift must be register or integer: %s", str) + } + count = (r2&15)<<8 | 1<<4 + case scanner.Int, '(': + p.back() + x := int64(p.expr()) + if x >= 32 { + p.errorf("register shift count too large: %s", str) + } + count = int16((x & 31) << 7) + default: + p.errorf("unexpected %s in register shift", tok.String()) + } + return int64((r1 & 15) | op<<5 | count) +} + +// symbolReference parses a symbol that is known not to be a register. +func (p *Parser) symbolReference(a *obj.Addr, name string, prefix rune) { + // Identifier is a name. + switch prefix { + case 0: + a.Type = obj.TYPE_MEM + case '$': + a.Type = obj.TYPE_ADDR + case '*': + a.Type = obj.TYPE_INDIR + } + // Weirdness with statics: Might now have "<>". + isStatic := 0 // TODO: Really a boolean, but Linklookup wants a "version" integer. + if p.peek() == '<' { + isStatic = 1 + p.next() + p.get('>') + } + if p.peek() == '+' || p.peek() == '-' { + a.Offset = int64(p.expr()) + } + a.Sym = obj.Linklookup(p.ctxt, name, isStatic) + if p.peek() == scanner.EOF { + if prefix != 0 { + p.errorf("illegal addressing mode for symbol %s", name) + } + return + } + // Expect (SB) or (FP), (PC), (SB), or (SP) + p.get('(') + reg := p.get(scanner.Ident).String() + p.get(')') + p.setPseudoRegister(a, reg, isStatic != 0, prefix) +} + +// setPseudoRegister sets the NAME field of addr for a pseudo-register reference such as (SB). +func (p *Parser) setPseudoRegister(addr *obj.Addr, reg string, isStatic bool, prefix rune) { + if addr.Reg != 0 { + p.errorf("internal error: reg %s already set in pseudo", reg) + } + switch reg { + case "FP": + addr.Name = obj.NAME_PARAM + case "PC": + if prefix != 0 { + p.errorf("illegal addressing mode for PC") + } + addr.Type = obj.TYPE_BRANCH // We set the type and leave NAME untouched. See asmJump. + case "SB": + addr.Name = obj.NAME_EXTERN + if isStatic { + addr.Name = obj.NAME_STATIC + } + case "SP": + addr.Name = obj.NAME_AUTO // The pseudo-stack. + default: + p.errorf("expected pseudo-register; found %s", reg) + } + if prefix == '$' { + addr.Type = obj.TYPE_ADDR + } +} + +// registerIndirect parses the general form of a register indirection. +// It is can be (R1), (R2*scale), or (R1)(R2*scale) where R1 may be a simple +// register or register pair R:R or (R, R) or (R+R). +// Or it might be a pseudo-indirection like (FP). +// We are sitting on the opening parenthesis. +func (p *Parser) registerIndirect(a *obj.Addr, prefix rune) { + p.get('(') + tok := p.next() + name := tok.String() + r1, r2, scale, ok := p.register(name, 0) + if !ok { + p.errorf("indirect through non-register %s", tok) + } + p.get(')') + a.Type = obj.TYPE_MEM + if r1 < 0 { + // Pseudo-register reference. + if r2 != 0 { + p.errorf("cannot use pseudo-register in pair") + return + } + // For SB, SP, and FP, there must be a name here. 0(FP) is not legal. + if name != "PC" && a.Name == obj.NAME_NONE { + p.errorf("cannot reference %s without a symbol", name) + } + p.setPseudoRegister(a, name, false, prefix) + return + } + a.Reg = r1 + if r2 != 0 { + // TODO: Consistency in the encoding would be nice here. + if p.arch.Thechar == '5' || p.arch.Thechar == '7' { + // Special form + // ARM: destination register pair (R1, R2). + // ARM64: register pair (R1, R2) for LDP/STP. + if prefix != 0 || scale != 0 { + p.errorf("illegal address mode for register pair") + return + } + a.Type = obj.TYPE_REGREG + a.Offset = int64(r2) + // Nothing may follow + return + } + if p.arch.Thechar == '9' { + // Special form for PPC64: (R1+R2); alias for (R1)(R2*1). + if prefix != 0 || scale != 0 { + p.errorf("illegal address mode for register+register") + return + } + a.Type = obj.TYPE_MEM + a.Scale = 1 + a.Index = r2 + // Nothing may follow. + return + } + } + if r2 != 0 { + p.errorf("indirect through register pair") + } + if prefix == '$' { + a.Type = obj.TYPE_ADDR + } + if r1 == arch.RPC && prefix != 0 { + p.errorf("illegal addressing mode for PC") + } + if scale == 0 && p.peek() == '(' { + // General form (R)(R*scale). + p.next() + tok := p.next() + r1, r2, scale, ok = p.register(tok.String(), 0) + if !ok { + p.errorf("indirect through non-register %s", tok) + } + if r2 != 0 { + p.errorf("unimplemented two-register form") + } + a.Index = r1 + a.Scale = int16(scale) + p.get(')') + } else if scale != 0 { + // First (R) was missing, all we have is (R*scale). + a.Reg = 0 + a.Index = r1 + a.Scale = int16(scale) + } +} + +// registerList parses an ARM register list expression, a list of registers in []. +// There may be comma-separated ranges or individual registers, as in +// [R1,R3-R5]. Only R0 through R15 may appear. +// The opening bracket has been consumed. +func (p *Parser) registerList(a *obj.Addr) { + // One range per loop. + var bits uint16 +ListLoop: + for { + tok := p.next() + switch tok.ScanToken { + case ']': + break ListLoop + case scanner.EOF: + p.errorf("missing ']' in register list") + return + } + lo := p.registerNumber(tok.String()) + hi := lo + if p.peek() == '-' { + p.next() + hi = p.registerNumber(p.next().String()) + } + if hi < lo { + lo, hi = hi, lo + } + for lo <= hi { + if bits&(1<>' | '<<' | '&') factor +func (p *Parser) term() uint64 { + value := p.factor() + for { + switch p.peek() { + case '*': + p.next() + value *= p.factor() + case '/': + p.next() + if int64(value) < 0 { + p.errorf("divide of value with high bit set") + } + divisor := p.factor() + if divisor == 0 { + p.errorf("division by zero") + } else { + value /= divisor + } + case '%': + p.next() + divisor := p.factor() + if int64(value) < 0 { + p.errorf("modulo of value with high bit set") + } + if divisor == 0 { + p.errorf("modulo by zero") + } else { + value %= divisor + } + case lex.LSH: + p.next() + shift := p.factor() + if int64(shift) < 0 { + p.errorf("negative left shift count") + } + return value << shift + case lex.RSH: + p.next() + shift := p.term() + if int64(shift) < 0 { + p.errorf("negative right shift count") + } + if int64(value) < 0 { + p.errorf("right shift of value with high bit set") + } + value >>= shift + case '&': + p.next() + value &= p.factor() + default: + return value + } + } +} + +// factor = const | '+' factor | '-' factor | '~' factor | '(' expr ')' +func (p *Parser) factor() uint64 { + tok := p.next() + switch tok.ScanToken { + case scanner.Int: + return p.atoi(tok.String()) + case scanner.Char: + str, err := strconv.Unquote(tok.String()) + if err != nil { + p.errorf("%s", err) + } + r, w := utf8.DecodeRuneInString(str) + if w == 1 && r == utf8.RuneError { + p.errorf("illegal UTF-8 encoding for character constant") + } + return uint64(r) + case '+': + return +p.factor() + case '-': + return -p.factor() + case '~': + return ^p.factor() + case '(': + v := p.expr() + if p.next().ScanToken != ')' { + p.errorf("missing closing paren") + } + return v + } + p.errorf("unexpected %s evaluating expression", tok) + return 0 +} + +// positiveAtoi returns an int64 that must be >= 0. +func (p *Parser) positiveAtoi(str string) int64 { + value, err := strconv.ParseInt(str, 0, 64) + if err != nil { + p.errorf("%s", err) + } + if value < 0 { + p.errorf("%s overflows int64", str) + } + return value +} + +func (p *Parser) atoi(str string) uint64 { + value, err := strconv.ParseUint(str, 0, 64) + if err != nil { + p.errorf("%s", err) + } + return value +} + +func (p *Parser) atof(str string) float64 { + value, err := strconv.ParseFloat(str, 64) + if err != nil { + p.errorf("%s", err) + } + return value +} + +func (p *Parser) atos(str string) string { + value, err := strconv.Unquote(str) + if err != nil { + p.errorf("%s", err) + } + return value +} + +// EOF represents the end of input. +var EOF = lex.Make(scanner.EOF, "EOF") + +func (p *Parser) next() lex.Token { + if !p.more() { + return EOF + } + tok := p.input[p.inputPos] + p.inputPos++ + return tok +} + +func (p *Parser) back() { + p.inputPos-- +} + +func (p *Parser) peek() lex.ScanToken { + if p.more() { + return p.input[p.inputPos].ScanToken + } + return scanner.EOF +} + +func (p *Parser) more() bool { + return p.inputPos < len(p.input) +} + +// get verifies that the next item has the expected type and returns it. +func (p *Parser) get(expected lex.ScanToken) lex.Token { + p.expect(expected) + return p.next() +} + +// expect verifies that the next item has the expected type. It does not consume it. +func (p *Parser) expect(expected lex.ScanToken) { + if p.peek() != expected { + p.errorf("expected %s, found %s", expected, p.next()) + } +} + +// have reports whether the remaining tokens (including the current one) contain the specified token. +func (p *Parser) have(token lex.ScanToken) bool { + for i := p.inputPos; i < len(p.input); i++ { + if p.input[i].ScanToken == token { + return true + } + } + return false +} + +// at reports whether the next tokens are as requested. +func (p *Parser) at(next ...lex.ScanToken) bool { + if len(p.input)-p.inputPos < len(next) { + return false + } + for i, r := range next { + if p.input[p.inputPos+i].ScanToken != r { + return false + } + } + return true +} diff --git a/src/cmd/asm/internal/asm/testdata/386.out b/src/cmd/asm/internal/asm/testdata/386.out new file mode 100644 index 0000000000000000000000000000000000000000..be43ccbfbb695b984ddfd6461d47bbe1b3810a9e --- /dev/null +++ b/src/cmd/asm/internal/asm/testdata/386.out @@ -0,0 +1,49 @@ +5 00001 (testdata/386.s:5) TEXT foo(SB), 0, $0 +8 00002 (testdata/386.s:8) SETCC AX +9 00003 (testdata/386.s:9) SETCC foo+4(SB) +12 00004 (testdata/386.s:12) DIVB AX +13 00005 (testdata/386.s:13) DIVB foo+4(SB) +14 00006 (testdata/386.s:14) PUSHL $foo+4(SB) +15 00007 (testdata/386.s:15) POPL AX +18 00008 (testdata/386.s:18) SUBB $1, AX +19 00009 (testdata/386.s:19) SUBB $1, foo+4(SB) +20 00010 (testdata/386.s:20) SUBB BX, AX +21 00011 (testdata/386.s:21) SUBB BX, foo+4(SB) +24 00012 (testdata/386.s:24) CMPB AX, $1 +25 00013 (testdata/386.s:25) CMPB foo+4(SB), $4 +26 00014 (testdata/386.s:26) CMPB BX, AX +27 00015 (testdata/386.s:27) CMPB foo+4(SB), BX +31 00016 (testdata/386.s:31) JCS +32 00017 (testdata/386.s:32) JCS 16(PC) +35 00018 (testdata/386.s:35) CALL AX +36 00019 (testdata/386.s:36) JMP AX +37 00020 (testdata/386.s:37) CALL *foo(SB) +38 00021 (testdata/386.s:38) JMP $4 +39 00022 (testdata/386.s:39) JMP 16 +40 00023 (testdata/386.s:40) CALL foo(SB) +42 00024 (testdata/386.s:42) CALL foo+4(SB)(AX*4) +43 00025 (testdata/386.s:43) CALL 4(SP) +44 00026 (testdata/386.s:44) CALL (AX) +45 00027 (testdata/386.s:45) CALL (SP) +47 00028 (testdata/386.s:47) CALL (AX)(AX*4) +48 00029 (testdata/386.s:48) CALL 4(SP) +49 00030 (testdata/386.s:49) CALL (AX) +50 00031 (testdata/386.s:50) CALL (SP) +52 00032 (testdata/386.s:52) JMP (AX)(AX*4) +55 00033 (testdata/386.s:55) NOP +56 00034 (testdata/386.s:56) NOP AX +57 00035 (testdata/386.s:57) NOP foo+4(SB) +60 00036 (testdata/386.s:60) SHLL $4, BX +61 00037 (testdata/386.s:61) SHLL $4, foo+4(SB) +62 00038 (testdata/386.s:62) SHLL $4, AX, foo+4(SB) +65 00039 (testdata/386.s:65) MOVL AX, BX +66 00040 (testdata/386.s:66) MOVL $4, BX +69 00041 (testdata/386.s:69) IMULL AX +70 00042 (testdata/386.s:70) IMULL $4, CX +71 00043 (testdata/386.s:71) IMULL AX, BX +74 00044 (testdata/386.s:74) CMPPD X0, X1, 4 +75 00045 (testdata/386.s:75) CMPPD X0, foo+4(SB), 4 +78 00046 (testdata/386.s:78) PINSRD $1, (AX), X0 +79 00047 (testdata/386.s:79) PINSRD $2, foo+4(FP), X0 +83 00048 (testdata/386.s:83) LOOP +86 00049 (testdata/386.s:86) RET diff --git a/src/cmd/asm/internal/asm/testdata/386.s b/src/cmd/asm/internal/asm/testdata/386.s new file mode 100644 index 0000000000000000000000000000000000000000..6bee39f3d4162e4f167ebcae05159ee2f6da5a87 --- /dev/null +++ b/src/cmd/asm/internal/asm/testdata/386.s @@ -0,0 +1,86 @@ +// This input was created by taking the instruction productions in +// the old assembler's (8a's) grammar and hand-writing complete +// instructions for each rule, to guarantee we cover the same space. + +TEXT foo(SB), 0, $0 + +// LTYPE1 nonrem { outcode(int($1), &$2); } + SETCC AX + SETCC foo+4(SB) + +// LTYPE2 rimnon { outcode(int($1), &$2); } + DIVB AX + DIVB foo+4(SB) + PUSHL $foo+4(SB) + POPL AX // balance PUSHL + +// LTYPE3 rimrem { outcode(int($1), &$2); } + SUBB $1, AX + SUBB $1, foo+4(SB) + SUBB BX, AX + SUBB BX, foo+4(SB) + +// LTYPE4 remrim { outcode(int($1), &$2); } + CMPB AX, $1 + CMPB foo+4(SB), $4 + CMPB BX, AX + CMPB foo+4(SB), BX + +// LTYPER nonrel { outcode(int($1), &$2); } +label: + JC label + JC -1(PC) + +// LTYPEC spec3 { outcode(int($1), &$2); } + CALL AX + JMP *AX + CALL *foo(SB) + JMP $4 + JMP label + CALL foo(SB) + CALL (AX*4) + CALL foo+4(SB)(AX*4) + CALL *4(SP) + CALL *(AX) + CALL *(SP) + CALL *(AX*4) + CALL *(AX)(AX*4) + CALL 4(SP) + CALL (AX) + CALL (SP) + CALL (AX*4) + JMP (AX)(AX*4) + +// LTYPEN spec4 { outcode(int($1), &$2); } + NOP + NOP AX + NOP foo+4(SB) + +// LTYPES spec5 { outcode(int($1), &$2); } + SHLL $4, BX + SHLL $4, foo+4(SB) + SHLL $4, foo+4(SB):AX + +// LTYPEM spec6 { outcode(int($1), &$2); } + MOVL AX, BX + MOVL $4, BX + +// LTYPEI spec7 { outcode(int($1), &$2); } + IMULL AX + IMULL $4, CX + IMULL AX, BX + +// LTYPEXC spec9 { outcode(int($1), &$2); } + CMPPD X0, X1, 4 + CMPPD X0, foo+4(SB), 4 + +// LTYPEX spec10 { outcode(int($1), &$2); } + PINSRD $1, (AX), X0 + PINSRD $2, foo+4(FP), X0 + +// Was bug: LOOP is a branch instruction. +loop: + LOOP loop + +// LTYPE0 nonnon { outcode(int($1), &$2); } + RET diff --git a/src/cmd/asm/internal/asm/testdata/amd64.out b/src/cmd/asm/internal/asm/testdata/amd64.out new file mode 100644 index 0000000000000000000000000000000000000000..850a78eb43511a74afba3c4bb4345ca47df5b77a --- /dev/null +++ b/src/cmd/asm/internal/asm/testdata/amd64.out @@ -0,0 +1,57 @@ +9 00001 (testdata/amd64.s:9) TEXT foo(SB), 0, $0 +12 00002 (testdata/amd64.s:12) NEGQ R11 +13 00003 (testdata/amd64.s:13) NEGQ 4(R11) +14 00004 (testdata/amd64.s:14) NEGQ foo+4(SB) +17 00005 (testdata/amd64.s:17) INT $4 +18 00006 (testdata/amd64.s:18) DIVB R11 +19 00007 (testdata/amd64.s:19) DIVB 4(R11) +20 00008 (testdata/amd64.s:20) DIVB foo+4(SB) +23 00009 (testdata/amd64.s:23) SUBQ $4, DI +24 00010 (testdata/amd64.s:24) SUBQ R11, DI +25 00011 (testdata/amd64.s:25) SUBQ 4(R11), DI +26 00012 (testdata/amd64.s:26) SUBQ foo+4(SB), DI +27 00013 (testdata/amd64.s:27) SUBQ $4, 8(R12) +28 00014 (testdata/amd64.s:28) SUBQ R11, 8(R12) +29 00015 (testdata/amd64.s:29) SUBQ R11, foo+4(SB) +32 00016 (testdata/amd64.s:32) CMPB CX, $4 +36 00017 (testdata/amd64.s:36) JCS 13(PC) +37 00018 (testdata/amd64.s:37) JCS 17 +40 00019 (testdata/amd64.s:40) JMP 15(PC) +41 00020 (testdata/amd64.s:41) JMP 17 +42 00021 (testdata/amd64.s:42) JMP foo+4(SB) +43 00022 (testdata/amd64.s:43) JMP bar<>+4(SB) +44 00023 (testdata/amd64.s:44) JMP bar<>+4(SB)(R11*4) +45 00024 (testdata/amd64.s:45) JMP 4(SP) +46 00025 (testdata/amd64.s:46) JMP (R12) +48 00026 (testdata/amd64.s:48) JMP (R12)(R13*4) +49 00027 (testdata/amd64.s:49) JMP (AX) +50 00028 (testdata/amd64.s:50) JMP (SP) +52 00029 (testdata/amd64.s:52) JMP (AX)(AX*4) +53 00030 (testdata/amd64.s:53) JMP 4(SP) +54 00031 (testdata/amd64.s:54) JMP (R12) +56 00032 (testdata/amd64.s:56) JMP (R12)(R13*4) +57 00033 (testdata/amd64.s:57) JMP (AX) +58 00034 (testdata/amd64.s:58) JMP (SP) +60 00035 (testdata/amd64.s:60) JMP (AX)(AX*4) +61 00036 (testdata/amd64.s:61) JMP R13 +64 00037 (testdata/amd64.s:64) NOP +65 00038 (testdata/amd64.s:65) NOP AX +66 00039 (testdata/amd64.s:66) NOP foo+4(SB) +69 00040 (testdata/amd64.s:69) SHLL R11, R12 +70 00041 (testdata/amd64.s:70) SHLL R11, foo+4(SB) +71 00042 (testdata/amd64.s:71) SHLL R11, AX, R11 +74 00043 (testdata/amd64.s:74) MOVL AX, R11 +75 00044 (testdata/amd64.s:75) MOVL $4, R11 +76 00045 (testdata/amd64.s:76) MOVL AX, CS, AX +79 00046 (testdata/amd64.s:79) IMULB $4 +80 00047 (testdata/amd64.s:80) IMULB R11 +81 00048 (testdata/amd64.s:81) IMULB $4, R11 +82 00049 (testdata/amd64.s:82) IMULB R11, R12 +83 00050 (testdata/amd64.s:83) IMULB R11, foo+4(SB) +86 00051 (testdata/amd64.s:86) CMPPD R11, R12, 4 +87 00052 (testdata/amd64.s:87) CMPPD R11, foo+4(SB), 4 +90 00053 (testdata/amd64.s:90) PINSRW $4, R11, AX +91 00054 (testdata/amd64.s:91) PINSRW $4, foo+4(SB), AX +94 00055 (testdata/amd64.s:94) RETFL $4 +98 00056 (testdata/amd64.s:98) LOOP +101 00057 (testdata/amd64.s:101) RET diff --git a/src/cmd/asm/internal/asm/testdata/amd64.s b/src/cmd/asm/internal/asm/testdata/amd64.s new file mode 100644 index 0000000000000000000000000000000000000000..1b32ac459544f2e6173deb0a7a27d6025f01daa6 --- /dev/null +++ b/src/cmd/asm/internal/asm/testdata/amd64.s @@ -0,0 +1,101 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// This input was created by taking the instruction productions in +// the old assembler's (6a's) grammar and hand-writing complete +// instructions for each rule, to guarantee we cover the same space. + +TEXT foo(SB), 0, $0 + +// LTYPE1 nonrem { outcode($1, &$2); } + NEGQ R11 + NEGQ 4(R11) + NEGQ foo+4(SB) + +// LTYPE2 rimnon { outcode($1, &$2); } + INT $4 + DIVB R11 + DIVB 4(R11) + DIVB foo+4(SB) + +// LTYPE3 rimrem { outcode($1, &$2); } + SUBQ $4, DI + SUBQ R11, DI + SUBQ 4(R11), DI + SUBQ foo+4(SB), DI + SUBQ $4, 8(R12) + SUBQ R11, 8(R12) + SUBQ R11, foo+4(SB) + +// LTYPE4 remrim { outcode($1, &$2); } + CMPB CX, $4 + +// LTYPER nonrel { outcode($1, &$2); } +label: + JB -4(PC) + JB label + +// LTYPEC spec3 { outcode($1, &$2); } + JMP -4(PC) + JMP label + JMP foo+4(SB) + JMP bar<>+4(SB) + JMP bar<>+4(SB)(R11*4) + JMP *4(SP) + JMP *(R12) + JMP *(R12*4) + JMP *(R12)(R13*4) + JMP *(AX) + JMP *(SP) + JMP *(AX*4) + JMP *(AX)(AX*4) + JMP 4(SP) + JMP (R12) + JMP (R12*4) + JMP (R12)(R13*4) + JMP (AX) + JMP (SP) + JMP (AX*4) + JMP (AX)(AX*4) + JMP R13 + +// LTYPEN spec4 { outcode($1, &$2); } + NOP + NOP AX + NOP foo+4(SB) + +// LTYPES spec5 { outcode($1, &$2); } + SHLL R11, R12 + SHLL R11, foo+4(SB) + SHLL R11, R11:AX // Old syntax, still accepted. + +// LTYPEM spec6 { outcode($1, &$2); } + MOVL AX, R11 + MOVL $4, R11 + MOVL AX, AX:CS + +// LTYPEI spec7 { outcode($1, &$2); } + IMULB $4 + IMULB R11 + IMULB $4, R11 + IMULB R11, R12 + IMULB R11, foo+4(SB) + +// LTYPEXC spec8 { outcode($1, &$2); } + CMPPD R11, R12, 4 + CMPPD R11, foo+4(SB), 4 + +// LTYPEX spec9 { outcode($1, &$2); } + PINSRW $4, R11, AX + PINSRW $4, foo+4(SB), AX + +// LTYPERT spec10 { outcode($1, &$2); } + RETFL $4 + +// Was bug: LOOP is a branch instruction. +loop: + LOOP loop + +// LTYPE0 nonnon { outcode($1, &$2); } + RET diff --git a/src/cmd/asm/internal/asm/testdata/arm.out b/src/cmd/asm/internal/asm/testdata/arm.out new file mode 100644 index 0000000000000000000000000000000000000000..1af3999783b9faaecd81faa0ebab967ce1e3e3ed --- /dev/null +++ b/src/cmd/asm/internal/asm/testdata/arm.out @@ -0,0 +1,61 @@ +9 00001 (testdata/arm.s:9) TEXT foo(SB), 0, $0 +18 00002 (testdata/arm.s:18) ADD $1, R2, R3 +19 00003 (testdata/arm.s:19) ADD R1<>R2, R3, R4 +21 00005 (testdata/arm.s:21) ADD R1@>R2, R3, R4 +22 00006 (testdata/arm.s:22) ADD R1->R2, R3, R4 +23 00007 (testdata/arm.s:23) ADD R1, R2, R3 +24 00008 (testdata/arm.s:24) ADD R1<>R2, R3 +37 00012 (testdata/arm.s:37) ADD R1@>R2, R3 +38 00013 (testdata/arm.s:38) ADD R1->R2, R3 +39 00014 (testdata/arm.s:39) ADD R1, R2 +48 00015 (testdata/arm.s:48) CLZ.S R1, R2 +57 00016 (testdata/arm.s:57) MOVW.S R1, R2 +58 00017 (testdata/arm.s:58) MOVW.S $1, R2 +59 00018 (testdata/arm.s:59) MOVW.S R1<(SB) +85 00023 (testdata/arm.s:85) BX (R2) +94 00024 (testdata/arm.s:94) BEQ 25(PC) +103 00025 (testdata/arm.s:103) SWI.S R1 +104 00026 (testdata/arm.s:104) SWI.S (R1) +105 00027 (testdata/arm.s:105) SWI.S foo(SB) +114 00028 (testdata/arm.s:114) CMP.S $1, R2 +115 00029 (testdata/arm.s:115) CMP.S R1<>R2, R3, R4 + ADD R1@>R2, R3, R4 + ADD R1->R2, R3, R4 + ADD R1, R2, R3 + ADD R(1)<>R2, R3 + ADD R1@>R2, R3 + ADD R1->R2, R3 + ADD R1, R2 + +// +// MVN +// +// LTYPE2 cond imsr ',' reg +// { +// outcode($1, $2, &$3, 0, &$5); +// } + CLZ.S R1, R2 + +// +// MOVW +// +// LTYPE3 cond gen ',' gen +// { +// outcode($1, $2, &$3, 0, &$5); +// } + MOVW.S R1, R2 + MOVW.S $1, R2 + MOVW.S R1<(SB) + +// +// BX +// +// LTYPEBX comma ireg +// { +// outcode($1, Always, &nullgen, 0, &$3); +// } + BX (R2) + +// +// BEQ +// +// LTYPE5 comma rel +// { +// outcode($1, Always, &nullgen, 0, &$3); +// } + BEQ 1(PC) + +// +// SWI +// +// LTYPE6 cond comma gen +// { +// outcode($1, $2, &nullgen, 0, &$4); +// } + SWI.S R1 + SWI.S (R1) + SWI.S foo(SB) + +// +// CMP +// +// LTYPE7 cond imsr ',' spreg +// { +// outcode($1, $2, &$3, $5, &nullgen); +// } + CMP.S $1, R2 + CMP.S R1<(SB) +102 00031 (testdata/arm64.s:102) BEQ 32(PC) +110 00032 (testdata/arm64.s:110) SVC +119 00033 (testdata/arm64.s:119) CMP $3, R2 +120 00034 (testdata/arm64.s:120) CMP R1, R2 +130 00035 (testdata/arm64.s:130) CBZ R1 +139 00036 (testdata/arm64.s:139) CSET GT, R1 +147 00037 (testdata/arm64.s:147) CSEL LT, R1, R2, ZR +148 00038 (testdata/arm64.s:148) CSINC GT, R1, ZR, R3 +149 00039 (testdata/arm64.s:149) CSNEG MI, R1, R2, R3 +150 00040 (testdata/arm64.s:150) CSINV 0, R1, R2, R3 +156 00041 (testdata/arm64.s:156) CSEL LT, R1, R2 +164 00042 (testdata/arm64.s:164) CCMN MI, ZR, R1, $4 +173 00043 (testdata/arm64.s:173) FADDD $(0.5), F1 +174 00044 (testdata/arm64.s:174) FADDD F1, F2 +180 00045 (testdata/arm64.s:180) FADDD $(0.69999999999999996), F1, F2 +181 00046 (testdata/arm64.s:181) FADDD F1, F2, F3 +233 00047 (testdata/arm64.s:233) DMB $1 +242 00048 (testdata/arm64.s:242) LDAXRW (R0), R2 +243 00049 (testdata/arm64.s:243) STLXRW R1, (R0), R3 +251 00050 (testdata/arm64.s:251) RET +255 00051 (testdata/arm64.s:255) JMP foo(SB) +256 00052 (testdata/arm64.s:256) CALL foo(SB) +257 00053 (testdata/arm64.s:257) JMP foo(SB) +258 00054 (testdata/arm64.s:258) CALL foo(SB) +266 00055 (testdata/arm64.s:266) END diff --git a/src/cmd/asm/internal/asm/testdata/arm64.s b/src/cmd/asm/internal/asm/testdata/arm64.s new file mode 100644 index 0000000000000000000000000000000000000000..2c8720bd3b9511389597a91d155497441e7fbca5 --- /dev/null +++ b/src/cmd/asm/internal/asm/testdata/arm64.s @@ -0,0 +1,266 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// This input was created by taking the instruction productions in +// the old assembler's (7a's) grammar and hand-writing complete +// instructions for each rule, to guarantee we cover the same space. + +TEXT foo(SB), 7, $-8 + +// +// ADD +// +// LTYPE1 imsr ',' spreg ',' reg +// { +// outcode($1, &$2, $4, &$6); +// } +// imsr comes from the old 7a, we only support immediates and registers +// at the moment, no shifted registers. + ADDW $1, R2, R3 + ADDW R1, R2, R3 + ADDW R1, ZR, R3 + ADD $1, R2, R3 + ADD R1, R2, R3 + ADD R1, ZR, R3 + ADD $1, R2, R3 + +// LTYPE1 imsr ',' spreg ',' +// { +// outcode($1, &$2, $4, &nullgen); +// } +// LTYPE1 imsr ',' reg +// { +// outcode($1, &$2, NREG, &$4); +// } + ADDW $1, R2 + ADDW R1, R2 + ADD $1, R2 + ADD R1, R2 + +// +// CLS +// +// LTYPE2 imsr ',' reg +// { +// outcode($1, &$2, NREG, &$4); +// } + CLSW R1, R2 + CLS R1, R2 + +// +// MOV +// +// LTYPE3 addr ',' addr +// { +// outcode($1, &$2, NREG, &$4); +// } + MOVW R1, R2 + MOVW ZR, R1 + MOVW R1, ZR + MOVW $1, ZR + MOVW $1, R1 + MOVW ZR, (R1) + MOVD R1, R2 + MOVD ZR, R1 + MOVD $1, ZR + MOVD $1, R1 + MOVD ZR, (R1) + +// +// MOVK +// +// LMOVK imm ',' reg +// { +// outcode($1, &$2, NREG, &$4); +// } + MOVK $1, R1 + +// +// B/BL +// +// LTYPE4 comma rel +// { +// outcode($1, &nullgen, NREG, &$3); +// } + BL 1(PC) + +// LTYPE4 comma nireg +// { +// outcode($1, &nullgen, NREG, &$3); +// } + BL (R2) + BL foo(SB) + BL bar<>(SB) +// +// BEQ +// +// LTYPE5 comma rel +// { +// outcode($1, &nullgen, NREG, &$3); +// } + BEQ 1(PC) +// +// SVC +// +// LTYPE6 +// { +// outcode($1, &nullgen, NREG, &nullgen); +// } + SVC + +// +// CMP +// +// LTYPE7 imsr ',' spreg comma +// { +// outcode($1, &$2, $4, &nullgen); +// } + CMP $3, R2 + CMP R1, R2 + +// +// CBZ +// +// LTYPE8 reg ',' rel +// { +// outcode($1, &$2, NREG, &$4); +// } +again: + CBZ R1, again + +// +// CSET +// +// LTYPER cond ',' reg +// { +// outcode($1, &$2, NREG, &$4); +// } + CSET GT, R1 +// +// CSEL/CSINC/CSNEG/CSINV +// +// LTYPES cond ',' reg ',' reg ',' reg +// { +// outgcode($1, &$2, $6.reg, &$4, &$8); +// } + CSEL LT, R1, R2, ZR + CSINC GT, R1, ZR, R3 + CSNEG MI, R1, R2, R3 + CSINV CS, R1, R2, R3 + +// LTYPES cond ',' reg ',' reg +// { +// outcode($1, &$2, $4.reg, &$6); +// } + CSEL LT, R1, R2 +// +// CCMN +// +// LTYPEU cond ',' imsr ',' reg ',' imm comma +// { +// outgcode($1, &$2, $6.reg, &$4, &$8); +// } + CCMN MI, ZR, R1, $4 + +// +// FADDD +// +// LTYPEK frcon ',' freg +// { +// outcode($1, &$2, NREG, &$4); +// } + FADDD $0.5, F1 + FADDD F1, F2 + +// LTYPEK frcon ',' freg ',' freg +// { +// outcode($1, &$2, $4.reg, &$6); +// } + FADDD $0.7, F1, F2 + FADDD F1, F2, F3 + +// +// FCMP +// +// LTYPEL frcon ',' freg comma +// { +// outcode($1, &$2, $4.reg, &nullgen); +// } +// FCMP $0.2, F1 +// FCMP F1, F2 + +// +// FCCMP +// +// LTYPEF cond ',' freg ',' freg ',' imm comma +// { +// outgcode($1, &$2, $6.reg, &$4, &$8); +// } +// FCCMP LT, F1, F2, $1 + +// +// FMULA +// +// LTYPE9 freg ',' freg ',' freg ',' freg comma +// { +// outgcode($1, &$2, $4.reg, &$6, &$8); +// } +// FMULA F1, F2, F3, F4 + +// +// FCSEL +// +// LFCSEL cond ',' freg ',' freg ',' freg +// { +// outgcode($1, &$2, $6.reg, &$4, &$8); +// } +// +// MADD Rn,Rm,Ra,Rd +// +// LTYPEM reg ',' reg ',' sreg ',' reg +// { +// outgcode($1, &$2, $6, &$4, &$8); +// } +// MADD R1, R2, R3, R4 + +// DMB, HINT +// +// LDMB imm +// { +// outcode($1, &$2, NREG, &nullgen); +// } + DMB $1 + +// +// STXR +// +// LSTXR reg ',' addr ',' reg +// { +// outtcode($1, &$2, &$4, &$6); +// } + LDAXRW (R0), R2 + STLXRW R1, (R0), R3 + +// RET +// +// LTYPEA comma +// { +// outcode($1, &nullgen, NREG, &nullgen); +// } + RET + +// More B/BL cases, and canonical names JMP, CALL. + + B foo(SB) + BL foo(SB) + JMP foo(SB) + CALL foo(SB) + +// END +// +// LTYPEE comma +// { +// outcode($1, &nullgen, NREG, &nullgen); +// } + END diff --git a/src/cmd/asm/internal/asm/testdata/ppc64.out b/src/cmd/asm/internal/asm/testdata/ppc64.out new file mode 100644 index 0000000000000000000000000000000000000000..2a5d1753338e1b1f09daeae95d4a19ff826fdd55 --- /dev/null +++ b/src/cmd/asm/internal/asm/testdata/ppc64.out @@ -0,0 +1,114 @@ +9 00001 (testdata/ppc64.s:9) TEXT foo(SB), 0, $0 +19 00002 (testdata/ppc64.s:19) MOVW R1, R2 +25 00003 (testdata/ppc64.s:25) MOVW foo<>+3(SB), R2 +26 00004 (testdata/ppc64.s:26) MOVW 16(R1), R2 +32 00005 (testdata/ppc64.s:32) MOVW (R1), R2 +33 00006 (testdata/ppc64.s:33) MOVW (R1)(R2*1), R3 +39 00007 (testdata/ppc64.s:39) MOVW R1, R2 +45 00008 (testdata/ppc64.s:45) MOVB foo<>+3(SB), R2 +46 00009 (testdata/ppc64.s:46) MOVB 16(R1), R2 +52 00010 (testdata/ppc64.s:52) MOVB (R1), R2 +53 00011 (testdata/ppc64.s:53) MOVB (R1)(R2*1), R3 +62 00012 (testdata/ppc64.s:62) FMOVD foo<>+3(SB), F2 +63 00013 (testdata/ppc64.s:63) FMOVD 16(R1), F2 +69 00014 (testdata/ppc64.s:69) FMOVD (R1), F2 +75 00015 (testdata/ppc64.s:75) FMOVD $(0.10000000000000001), F2 +81 00016 (testdata/ppc64.s:81) FMOVD F1, F2 +87 00017 (testdata/ppc64.s:87) FMOVD F2, foo<>+3(SB) +88 00018 (testdata/ppc64.s:88) FMOVD F2, 16(R1) +94 00019 (testdata/ppc64.s:94) FMOVD F2, (R1) +103 00020 (testdata/ppc64.s:103) MOVW R1, foo<>+3(SB) +104 00021 (testdata/ppc64.s:104) MOVW R1, 16(R2) +110 00022 (testdata/ppc64.s:110) MOVW R1, (R1) +111 00023 (testdata/ppc64.s:111) MOVW R1, (R2)(R3*1) +117 00024 (testdata/ppc64.s:117) MOVB R1, foo<>+3(SB) +118 00025 (testdata/ppc64.s:118) MOVB R1, 16(R2) +124 00026 (testdata/ppc64.s:124) MOVB R1, (R1) +125 00027 (testdata/ppc64.s:125) MOVB R1, (R2)(R3*1) +133 00028 (testdata/ppc64.s:133) FMOVD F1, foo<>+3(SB) +134 00029 (testdata/ppc64.s:134) FMOVD F1, 16(R2) +140 00030 (testdata/ppc64.s:140) FMOVD F1, (R1) +149 00031 (testdata/ppc64.s:149) MOVFL FPSCR, F1 +155 00032 (testdata/ppc64.s:155) MOVFL F1, FPSCR +161 00033 (testdata/ppc64.s:161) MOVFL F1, $4, FPSCR +167 00034 (testdata/ppc64.s:167) MOVFL FPSCR, CR0 +188 00035 (testdata/ppc64.s:188) MOVW R1, CR1 +194 00036 (testdata/ppc64.s:194) MOVW R1, CR +206 00037 (testdata/ppc64.s:206) ADD R1, R2, R3 +212 00038 (testdata/ppc64.s:212) ADD $1, R2, R3 +224 00039 (testdata/ppc64.s:224) ADD R1, R2 +230 00040 (testdata/ppc64.s:230) ADD $4, R1 +236 00041 (testdata/ppc64.s:236) ADDE R1, R2, R3 +242 00042 (testdata/ppc64.s:242) ADDE R1, R2 +248 00043 (testdata/ppc64.s:248) SLW R1, R2, R3 +254 00044 (testdata/ppc64.s:254) SLW R1, R2 +260 00045 (testdata/ppc64.s:260) SLW $4, R1, R2 +266 00046 (testdata/ppc64.s:266) SLW $4, R1 +272 00047 (testdata/ppc64.s:272) SLW $4, R1 +278 00048 (testdata/ppc64.s:278) SUBME R1, R1 +296 00049 (testdata/ppc64.s:296) MOVW $1, R1 +302 00050 (testdata/ppc64.s:302) MOVW $1, R1 +303 00051 (testdata/ppc64.s:303) MOVW $foo(SB), R1 +327 00052 (testdata/ppc64.s:327) MOVFL CR0, CR1 +339 00053 (testdata/ppc64.s:339) MOVW CR, R1 +345 00054 (testdata/ppc64.s:345) MOVW SPR(0), R1 +346 00055 (testdata/ppc64.s:346) MOVW SPR(7), R1 +352 00056 (testdata/ppc64.s:352) MOVW LR, R1 +353 00057 (testdata/ppc64.s:353) MOVW CTR, R1 +359 00058 (testdata/ppc64.s:359) MOVW R1, LR +360 00059 (testdata/ppc64.s:360) MOVW R1, CTR +372 00060 (testdata/ppc64.s:372) MOVW R1, SPR(7) +384 00061 (testdata/ppc64.s:384) JMP 62(PC) +385 00062 (testdata/ppc64.s:385) JMP 61 +391 00063 (testdata/ppc64.s:391) JMP 4(R1) +392 00064 (testdata/ppc64.s:392) JMP foo(SB) +398 00065 (testdata/ppc64.s:398) JMP CTR +417 00066 (testdata/ppc64.s:417) BEQ CR1, 67(PC) +418 00067 (testdata/ppc64.s:418) BEQ CR1, 66 +444 00068 (testdata/ppc64.s:444) BC 4, CTR +454 00069 (testdata/ppc64.s:454) BC $3, R4, 66 +474 00070 (testdata/ppc64.s:474) BC $3, R3, LR +504 00071 (testdata/ppc64.s:504) FABS F1, F2 +510 00072 (testdata/ppc64.s:510) FADD F1, F2 +516 00073 (testdata/ppc64.s:516) FADD F1, F2, F3 +522 00074 (testdata/ppc64.s:522) FMADD F1, F2, F3, F4 +528 00075 (testdata/ppc64.s:528) FCMPU F1, F2 +534 00076 (testdata/ppc64.s:534) FCMPU F1, F2, CR0 +543 00077 (testdata/ppc64.s:543) CMP R1, R2 +549 00078 (testdata/ppc64.s:549) CMP R1, $4 +555 00079 (testdata/ppc64.s:555) CMP R1, CR0, R2 +561 00080 (testdata/ppc64.s:561) CMP R1, CR0, $4 +570 00081 (testdata/ppc64.s:570) RLDC $4, R1, $5, R2 +576 00082 (testdata/ppc64.s:576) RLDC $26, R1, $201326592, R2 +582 00083 (testdata/ppc64.s:582) RLDC R1, R2, $4, R3 +588 00084 (testdata/ppc64.s:588) RLWMI R1, R2, $201326592, R3 +597 00085 (testdata/ppc64.s:597) MOVMW foo(SB), R2 +598 00086 (testdata/ppc64.s:598) MOVMW 4(R1), R2 +604 00087 (testdata/ppc64.s:604) MOVMW R1, foo(SB) +605 00088 (testdata/ppc64.s:605) MOVMW R1, 4(R2) +615 00089 (testdata/ppc64.s:615) LSW (R1), R2 +616 00090 (testdata/ppc64.s:616) LSW (R1)(R2*1), R3 +622 00091 (testdata/ppc64.s:622) LSW (R1), $1, R2 +623 00092 (testdata/ppc64.s:623) LSW (R1)(R2*1), $1, R3 +629 00093 (testdata/ppc64.s:629) STSW R1, (R2) +630 00094 (testdata/ppc64.s:630) STSW R1, (R2)(R3*1) +636 00095 (testdata/ppc64.s:636) STSW R1, $1, (R2) +637 00096 (testdata/ppc64.s:637) STSW R1, $1, (R2)(R3*1) +643 00097 (testdata/ppc64.s:643) MOVHBR (R1), R2 +644 00098 (testdata/ppc64.s:644) MOVHBR (R1)(R2*1), R3 +650 00099 (testdata/ppc64.s:650) MOVHBR R1, (R2) +651 00100 (testdata/ppc64.s:651) MOVHBR R1, (R2)(R3*1) +657 00101 (testdata/ppc64.s:657) DCBF (R1) +658 00102 (testdata/ppc64.s:658) DCBF (R1)(R2*1) +667 00103 (testdata/ppc64.s:667) NOP +673 00104 (testdata/ppc64.s:673) NOP R2 +679 00105 (testdata/ppc64.s:679) NOP F2 +685 00106 (testdata/ppc64.s:685) NOP R2 +691 00107 (testdata/ppc64.s:691) NOP F2 +697 00108 (testdata/ppc64.s:697) NOP $4 +705 00109 (testdata/ppc64.s:705) RET +709 00110 (testdata/ppc64.s:709) JMP foo(SB) +710 00111 (testdata/ppc64.s:710) CALL foo(SB) +711 00112 (testdata/ppc64.s:711) JMP foo(SB) +712 00113 (testdata/ppc64.s:712) CALL foo(SB) +720 00114 (testdata/ppc64.s:720) END diff --git a/src/cmd/asm/internal/asm/testdata/ppc64.s b/src/cmd/asm/internal/asm/testdata/ppc64.s new file mode 100644 index 0000000000000000000000000000000000000000..46c1ee6d95d9d7b6b08c8125b91a4ec49e8c8519 --- /dev/null +++ b/src/cmd/asm/internal/asm/testdata/ppc64.s @@ -0,0 +1,720 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// This input was created by taking the instruction productions in +// the old assembler's (9a's) grammar and hand-writing complete +// instructions for each rule, to guarantee we cover the same space. + +TEXT foo(SB),0,$0 + +//inst: +// +// load ints and bytes +// +// LMOVW rreg ',' rreg +// { +// outcode(int($1), &$2, 0, &$4); +// } + MOVW R1, R2 + +// LMOVW addr ',' rreg +// { +// outcode(int($1), &$2, 0, &$4); +// } + MOVW foo<>+3(SB), R2 + MOVW 16(R1), R2 + +// LMOVW regaddr ',' rreg +// { +// outcode(int($1), &$2, 0, &$4); +// } + MOVW (R1), R2 + MOVW (R1+R2), R3 + +// LMOVB rreg ',' rreg +// { +// outcode(int($1), &$2, 0, &$4); +// } + MOVW R1, R2 + +// LMOVB addr ',' rreg +// { +// outcode(int($1), &$2, 0, &$4); +// } + MOVB foo<>+3(SB), R2 + MOVB 16(R1), R2 + +// LMOVB regaddr ',' rreg +// { +// outcode(int($1), &$2, 0, &$4); +// } + MOVB (R1), R2 + MOVB (R1+R2), R3 + +// +// load floats +// +// LFMOV addr ',' freg +// { +// outcode(int($1), &$2, 0, &$4); +// } + FMOVD foo<>+3(SB), F2 + FMOVD 16(R1), F2 + +// LFMOV regaddr ',' freg +// { +// outcode(int($1), &$2, 0, &$4); +// } + FMOVD (R1), F2 + +// LFMOV fimm ',' freg +// { +// outcode(int($1), &$2, 0, &$4); +// } + FMOVD $0.1, F2 + +// LFMOV freg ',' freg +// { +// outcode(int($1), &$2, 0, &$4); +// } + FMOVD F1, F2 + +// LFMOV freg ',' addr +// { +// outcode(int($1), &$2, 0, &$4); +// } + FMOVD F2, foo<>+3(SB) + FMOVD F2, 16(R1) + +// LFMOV freg ',' regaddr +// { +// outcode(int($1), &$2, 0, &$4); +// } + FMOVD F2, (R1) + +// +// store ints and bytes +// +// LMOVW rreg ',' addr +// { +// outcode(int($1), &$2, 0, &$4); +// } + MOVW R1, foo<>+3(SB) + MOVW R1, 16(R2) + +// LMOVW rreg ',' regaddr +// { +// outcode(int($1), &$2, 0, &$4); +// } + MOVW R1, (R1) + MOVW R1, (R2+R3) + +// LMOVB rreg ',' addr +// { +// outcode(int($1), &$2, 0, &$4); +// } + MOVB R1, foo<>+3(SB) + MOVB R1, 16(R2) + +// LMOVB rreg ',' regaddr +// { +// outcode(int($1), &$2, 0, &$4); +// } + MOVB R1, (R1) + MOVB R1, (R2+R3) +// +// store floats +// +// LMOVW freg ',' addr +// { +// outcode(int($1), &$2, 0, &$4); +// } + FMOVD F1, foo<>+3(SB) + FMOVD F1, 16(R2) + +// LMOVW freg ',' regaddr +// { +// outcode(int($1), &$2, 0, &$4); +// } + FMOVD F1, (R1) + +// +// floating point status +// +// LMOVW fpscr ',' freg +// { +// outcode(int($1), &$2, 0, &$4); +// } + MOVFL FPSCR, F1 + +// LMOVW freg ',' fpscr +// { +// outcode(int($1), &$2, 0, &$4); +// } + MOVFL F1, FPSCR + +// LMOVW freg ',' imm ',' fpscr +// { +// outgcode(int($1), &$2, 0, &$4, &$6); +// } + MOVFL F1, $4, FPSCR + +// LMOVW fpscr ',' creg +// { +// outcode(int($1), &$2, 0, &$4); +// } + MOVFL FPSCR, CR0 + +// LMTFSB imm ',' con +// { +// outcode(int($1), &$2, int($4), &nullgen); +// } +//TODO 9a doesn't work MTFSB0 $4, 4 + +// +// field moves (mtcrf) +// +// LMOVW rreg ',' imm ',' lcr +// { +// outgcode(int($1), &$2, 0, &$4, &$6); +// } +// TODO 9a doesn't work MOVFL R1,$4,CR + +// LMOVW rreg ',' creg +// { +// outcode(int($1), &$2, 0, &$4); +// } + MOVW R1, CR1 + +// LMOVW rreg ',' lcr +// { +// outcode(int($1), &$2, 0, &$4); +// } + MOVW R1, CR + +// +// integer operations +// logical instructions +// shift instructions +// unary instructions +// +// LADDW rreg ',' sreg ',' rreg +// { +// outcode(int($1), &$2, int($4), &$6); +// } + ADD R1, R2, R3 + +// LADDW imm ',' sreg ',' rreg +// { +// outcode(int($1), &$2, int($4), &$6); +// } + ADD $1, R2, R3 + +// LADDW rreg ',' imm ',' rreg +// { +// outgcode(int($1), &$2, 0, &$4, &$6); +// } +//TODO 9a trouble ADD R1, $2, R3 maybe swap rreg and imm + +// LADDW rreg ',' rreg +// { +// outcode(int($1), &$2, 0, &$4); +// } + ADD R1, R2 + +// LADDW imm ',' rreg +// { +// outcode(int($1), &$2, 0, &$4); +// } + ADD $4, R1 + +// LLOGW rreg ',' sreg ',' rreg +// { +// outcode(int($1), &$2, int($4), &$6); +// } + ADDE R1, R2, R3 + +// LLOGW rreg ',' rreg +// { +// outcode(int($1), &$2, 0, &$4); +// } + ADDE R1, R2 + +// LSHW rreg ',' sreg ',' rreg +// { +// outcode(int($1), &$2, int($4), &$6); +// } + SLW R1, R2, R3 + +// LSHW rreg ',' rreg +// { +// outcode(int($1), &$2, 0, &$4); +// } + SLW R1, R2 + +// LSHW imm ',' sreg ',' rreg +// { +// outcode(int($1), &$2, int($4), &$6); +// } + SLW $4, R1, R2 + +// LSHW imm ',' rreg +// { +// outcode(int($1), &$2, 0, &$4); +// } + SLW $4, R1 + +// LABS rreg ',' rreg +// { +// outcode(int($1), &$2, 0, &$4); +// } + SLW $4, R1 + +// LABS rreg +// { +// outcode(int($1), &$2, 0, &$2); +// } + SUBME R1 + +// +// multiply-accumulate +// +// LMA rreg ',' sreg ',' rreg +// { +// outcode(int($1), &$2, int($4), &$6); +// } +//TODO this instruction is undefined in lex.go LMA R1, R2, R3 NOT SUPPORTED (called MAC) + +// +// move immediate: macro for cau+or, addi, addis, and other combinations +// +// LMOVW imm ',' rreg +// { +// outcode(int($1), &$2, 0, &$4); +// } + MOVW $1, R1 + +// LMOVW ximm ',' rreg +// { +// outcode(int($1), &$2, 0, &$4); +// } + MOVW $1, R1 + MOVW $foo(SB), R1 + +// condition register operations +// +// LCROP cbit ',' cbit +// { +// outcode(int($1), &$2, int($4.Reg), &$4); +// } +//TODO 9a trouble CREQV 1, 2 delete? liblink encodes like a divide (maybe wrong too) + +// LCROP cbit ',' con ',' cbit +// { +// outcode(int($1), &$2, int($4), &$6); +// } +//TODO 9a trouble CREQV 1, 2, 3 + +// +// condition register moves +// move from machine state register +// +// LMOVW creg ',' creg +// { +// outcode(int($1), &$2, 0, &$4); +// } + MOVFL CR0, CR1 + +// LMOVW psr ',' creg // TODO: should psr should be fpscr +// { +// outcode(int($1), &$2, 0, &$4); +// } +//TODO 9a trouble MOVW FPSCR, CR1 + +// LMOVW lcr ',' rreg +// { +// outcode(int($1), &$2, 0, &$4); +// } + MOVW CR, R1 + +// LMOVW psr ',' rreg +// { +// outcode(int($1), &$2, 0, &$4); +// } + MOVW SPR(0), R1 + MOVW SPR(7), R1 + +// LMOVW xlreg ',' rreg +// { +// outcode(int($1), &$2, 0, &$4); +// } + MOVW LR, R1 + MOVW CTR, R1 + +// LMOVW rreg ',' xlreg +// { +// outcode(int($1), &$2, 0, &$4); +// } + MOVW R1, LR + MOVW R1, CTR + +// LMOVW creg ',' psr // TODO doesn't exist +// { +// outcode(int($1), &$2, 0, &$4); +// } +//TODO 9a trouble MOVW CR1, SPR(7) + +// LMOVW rreg ',' psr +// { +// outcode(int($1), &$2, 0, &$4); +// } + MOVW R1, SPR(7) + +// +// branch, branch conditional +// branch conditional register +// branch conditional to count register +// +// LBRA rel +// { +// outcode(int($1), &nullgen, 0, &$2); +// } +label0: + BR 1(PC) + BR label0+0 + +// LBRA addr +// { +// outcode(int($1), &nullgen, 0, &$2); +// } + BR 4(R1) + BR foo+0(SB) + +// LBRA '(' xlreg ')' +// { +// outcode(int($1), &nullgen, 0, &$3); +// } + BR (CTR) + +// LBRA ',' rel // asm doesn't support the leading comma +// { +// outcode(int($1), &nullgen, 0, &$3); +// } +// LBRA ',' addr // asm doesn't support the leading comma +// { +// outcode(int($1), &nullgen, 0, &$3); +// } +// LBRA ',' '(' xlreg ')' // asm doesn't support the leading comma +// { +// outcode(int($1), &nullgen, 0, &$4); +// } +// LBRA creg ',' rel +// { +// outcode(int($1), &$2, 0, &$4); +// } +label1: + BEQ CR1, 1(PC) + BEQ CR1, label1 + +// LBRA creg ',' addr // TODO DOES NOT WORK in 9a +// { +// outcode(int($1), &$2, 0, &$4); +// } + +// LBRA creg ',' '(' xlreg ')' // TODO DOES NOT WORK in 9a +// { +// outcode(int($1), &$2, 0, &$5); +// } + +// LBRA con ',' rel // TODO DOES NOT WORK in 9a +// { +// outcode(int($1), &nullgen, int($2), &$4); +// } + +// LBRA con ',' addr // TODO DOES NOT WORK in 9a +// { +// outcode(int($1), &nullgen, int($2), &$4); +// } + +// LBRA con ',' '(' xlreg ')' +// { +// outcode(int($1), &nullgen, int($2), &$5); +// } + BC 4, (CTR) + +// LBRA con ',' con ',' rel +// { +// var g obj.Addr +// g = nullgen; +// g.Type = obj.TYPE_CONST; +// g.Offset = $2; +// outcode(int($1), &g, int(REG_R0+$4), &$6); +// } + BC 3, 4, label1 + +// LBRA con ',' con ',' addr // TODO mystery +// { +// var g obj.Addr +// g = nullgen; +// g.Type = obj.TYPE_CONST; +// g.Offset = $2; +// outcode(int($1), &g, int(REG_R0+$4), &$6); +// } +//TODO 9a trouble BC 3, 3, 4(R1) + +// LBRA con ',' con ',' '(' xlreg ')' +// { +// var g obj.Addr +// g = nullgen; +// g.Type = obj.TYPE_CONST; +// g.Offset = $2; +// outcode(int($1), &g, int(REG_R0+$4), &$7); +// } + BC 3, 3, (LR) + +// +// conditional trap // TODO NOT DEFINED +// TODO these instructions are not in lex.go +// +// LTRAP rreg ',' sreg +// { +// outcode(int($1), &$2, int($4), &nullgen); +// } +// LTRAP imm ',' sreg +// { +// outcode(int($1), &$2, int($4), &nullgen); +// } +// LTRAP rreg comma +// { +// outcode(int($1), &$2, 0, &nullgen); +// } +// LTRAP comma +// { +// outcode(int($1), &nullgen, 0, &nullgen); +// } + +// +// floating point operate +// +// LFCONV freg ',' freg +// { +// outcode(int($1), &$2, 0, &$4); +// } + FABS F1, F2 + +// LFADD freg ',' freg +// { +// outcode(int($1), &$2, 0, &$4); +// } + FADD F1, F2 + +// LFADD freg ',' freg ',' freg +// { +// outcode(int($1), &$2, int($4.Reg), &$6); +// } + FADD F1, F2, F3 + +// LFMA freg ',' freg ',' freg ',' freg +// { +// outgcode(int($1), &$2, int($4.Reg), &$6, &$8); +// } + FMADD F1, F2, F3, F4 + +// LFCMP freg ',' freg +// { +// outcode(int($1), &$2, 0, &$4); +// } + FCMPU F1, F2 + +// LFCMP freg ',' freg ',' creg +// { +// outcode(int($1), &$2, int($6.Reg), &$4); +// } + FCMPU F1, F2, CR0 + +// +// CMP +// +// LCMP rreg ',' rreg +// { +// outcode(int($1), &$2, 0, &$4); +// } + CMP R1, R2 + +// LCMP rreg ',' imm +// { +// outcode(int($1), &$2, 0, &$4); +// } + CMP R1, $4 + +// LCMP rreg ',' rreg ',' creg +// { +// outcode(int($1), &$2, int($6.Reg), &$4); +// } + CMP R1, R2, CR0 + +// LCMP rreg ',' imm ',' creg +// { +// outcode(int($1), &$2, int($6.Reg), &$4); +// } + CMP R1, $4, CR0 + +// +// rotate and mask +// +// LRLWM imm ',' rreg ',' imm ',' rreg +// { +// outgcode(int($1), &$2, int($4.Reg), &$6, &$8); +// } + RLDC $4, R1, $5, R2 + +// LRLWM imm ',' rreg ',' mask ',' rreg +// { +// outgcode(int($1), &$2, int($4.Reg), &$6, &$8); +// } + RLDC $26, R1, 4, 5, R2 + +// LRLWM rreg ',' rreg ',' imm ',' rreg +// { +// outgcode(int($1), &$2, int($4.Reg), &$6, &$8); +// } + RLDC R1, R2, $4, R3 + +// LRLWM rreg ',' rreg ',' mask ',' rreg +// { +// outgcode(int($1), &$2, int($4.Reg), &$6, &$8); +// } + RLWMI R1, R2, 4, 5, R3 + +// +// load/store multiple +// +// LMOVMW addr ',' rreg +// { +// outcode(int($1), &$2, 0, &$4); +// } + MOVMW foo+0(SB), R2 + MOVMW 4(R1), R2 + +// LMOVMW rreg ',' addr +// { +// outcode(int($1), &$2, 0, &$4); +// } + MOVMW R1, foo+0(SB) + MOVMW R1, 4(R2) + +// +// various indexed load/store +// indexed unary (eg, cache clear) +// +// LXLD regaddr ',' rreg +// { +// outcode(int($1), &$2, 0, &$4); +// } + LSW (R1), R2 + LSW (R1+R2), R3 + +// LXLD regaddr ',' imm ',' rreg +// { +// outgcode(int($1), &$2, 0, &$4, &$6); +// } + LSW (R1), $1, R2 + LSW (R1+R2), $1, R3 + +// LXST rreg ',' regaddr +// { +// outcode(int($1), &$2, 0, &$4); +// } + STSW R1, (R2) + STSW R1, (R2+R3) + +// LXST rreg ',' imm ',' regaddr +// { +// outgcode(int($1), &$2, 0, &$4, &$6); +// } + STSW R1, $1, (R2) + STSW R1, $1, (R2+R3) + +// LXMV regaddr ',' rreg +// { +// outcode(int($1), &$2, 0, &$4); +// } + MOVHBR (R1), R2 + MOVHBR (R1+R2), R3 + +// LXMV rreg ',' regaddr +// { +// outcode(int($1), &$2, 0, &$4); +// } + MOVHBR R1, (R2) + MOVHBR R1, (R2+R3) + +// LXOP regaddr +// { +// outcode(int($1), &$2, 0, &nullgen); +// } + DCBF (R1) + DCBF (R1+R2) + +// +// NOP +// +// LNOP comma // asm doesn't support the trailing comma. +// { +// outcode(int($1), &nullgen, 0, &nullgen); +// } + NOP + +// LNOP rreg comma // asm doesn't support the trailing comma. +// { +// outcode(int($1), &$2, 0, &nullgen); +// } + NOP R2 + +// LNOP freg comma // asm doesn't support the trailing comma. +// { +// outcode(int($1), &$2, 0, &nullgen); +// } + NOP F2 + +// LNOP ',' rreg // asm doesn't support the leading comma. +// { +// outcode(int($1), &nullgen, 0, &$3); +// } + NOP R2 + +// LNOP ',' freg // asm doesn't support the leading comma. +// { +// outcode(int($1), &nullgen, 0, &$3); +// } + NOP F2 + +// LNOP imm // SYSCALL $num: load $num to R0 before syscall and restore R0 to 0 afterwards. +// { +// outcode(int($1), &$2, 0, &nullgen); +// } + NOP $4 + +// RET +// +// LRETRN comma // asm doesn't support the trailing comma. +// { +// outcode(int($1), &nullgen, 0, &nullgen); +// } + RET + +// More BR/BL cases, and canonical names JMP, CALL. + + BR foo(SB) + BL foo(SB) + JMP foo(SB) + CALL foo(SB) + +// END +// +// LEND comma // asm doesn't support the trailing comma. +// { +// outcode(int($1), &nullgen, 0, &nullgen); +// } + END diff --git a/src/cmd/asm/internal/flags/flags.go b/src/cmd/asm/internal/flags/flags.go new file mode 100644 index 0000000000000000000000000000000000000000..bf5cb1eef3d5e75cc3f01bbe1f462d3c063219da --- /dev/null +++ b/src/cmd/asm/internal/flags/flags.go @@ -0,0 +1,69 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package flags implements top-level flags and the usage message for the assembler. +package flags + +import ( + "flag" + "fmt" + "os" + "path/filepath" + "strings" +) + +var ( + Debug = flag.Bool("debug", false, "dump instructions as they are parsed") + OutputFile = flag.String("o", "", "output file; default foo.6 for /a/b/c/foo.s on amd64") + PrintOut = flag.Bool("S", false, "print assembly and machine code") + TrimPath = flag.String("trimpath", "", "remove prefix from recorded source file paths") + Shared = flag.Bool("shared", false, "generate code that can be linked into a shared library") + Dynlink = flag.Bool("dynlink", false, "support references to Go symbols defined in other shared libraries") +) + +var ( + D MultiFlag + I MultiFlag +) + +func init() { + flag.Var(&D, "D", "predefined symbol with optional simple value -D=identifer=value; can be set multiple times") + flag.Var(&I, "I", "include directory; can be set multiple times") +} + +// MultiFlag allows setting a value multiple times to collect a list, as in -I=dir1 -I=dir2. +type MultiFlag []string + +func (m *MultiFlag) String() string { + return fmt.Sprint(*m) +} + +func (m *MultiFlag) Set(val string) error { + (*m) = append(*m, val) + return nil +} + +func Usage() { + fmt.Fprintf(os.Stderr, "usage: asm [options] file.s\n") + fmt.Fprintf(os.Stderr, "Flags:\n") + flag.PrintDefaults() + os.Exit(2) +} + +func Parse() { + flag.Usage = Usage + flag.Parse() + if flag.NArg() != 1 { + flag.Usage() + } + + // Flag refinement. + if *OutputFile == "" { + input := filepath.Base(flag.Arg(0)) + if strings.HasSuffix(input, ".s") { + input = input[:len(input)-2] + } + *OutputFile = fmt.Sprintf("%s.o", input) + } +} diff --git a/src/cmd/asm/internal/lex/input.go b/src/cmd/asm/internal/lex/input.go new file mode 100644 index 0000000000000000000000000000000000000000..7e495b8edf99552ffeeafb41c6d07cb5d2846e02 --- /dev/null +++ b/src/cmd/asm/internal/lex/input.go @@ -0,0 +1,464 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package lex + +import ( + "fmt" + "os" + "path/filepath" + "strconv" + "strings" + "text/scanner" + + "cmd/asm/internal/flags" +) + +// Input is the main input: a stack of readers and some macro definitions. +// It also handles #include processing (by pushing onto the input stack) +// and parses and instantiates macro definitions. +type Input struct { + Stack + includes []string + beginningOfLine bool + ifdefStack []bool + macros map[string]*Macro + text string // Text of last token returned by Next. + peek bool + peekToken ScanToken + peekText string +} + +// NewInput returns a +func NewInput(name string) *Input { + return &Input{ + // include directories: look in source dir, then -I directories. + includes: append([]string{filepath.Dir(name)}, flags.I...), + beginningOfLine: true, + macros: predefine(flags.D), + } +} + +// predefine installs the macros set by the -D flag on the command line. +func predefine(defines flags.MultiFlag) map[string]*Macro { + macros := make(map[string]*Macro) + for _, name := range defines { + value := "1" + i := strings.IndexRune(name, '=') + if i > 0 { + name, value = name[:i], name[i+1:] + } + tokens := Tokenize(name) + if len(tokens) != 1 || tokens[0].ScanToken != scanner.Ident { + fmt.Fprintf(os.Stderr, "asm: parsing -D: %q is not a valid identifier name\n", tokens[0]) + flags.Usage() + } + macros[name] = &Macro{ + name: name, + args: nil, + tokens: Tokenize(value), + } + } + return macros +} + +func (in *Input) Error(args ...interface{}) { + fmt.Fprintf(os.Stderr, "%s:%d: %s", in.File(), in.Line(), fmt.Sprintln(args...)) + os.Exit(1) +} + +// expectText is like Error but adds "got XXX" where XXX is a quoted representation of the most recent token. +func (in *Input) expectText(args ...interface{}) { + in.Error(append(args, "; got", strconv.Quote(in.Stack.Text()))...) +} + +// enabled reports whether the input is enabled by an ifdef, or is at the top level. +func (in *Input) enabled() bool { + return len(in.ifdefStack) == 0 || in.ifdefStack[len(in.ifdefStack)-1] +} + +func (in *Input) expectNewline(directive string) { + tok := in.Stack.Next() + if tok != '\n' { + in.expectText("expected newline after", directive) + } +} + +func (in *Input) Next() ScanToken { + if in.peek { + in.peek = false + tok := in.peekToken + in.text = in.peekText + return tok + } + // If we cannot generate a token after 100 macro invocations, we're in trouble. + // The usual case is caught by Push, below, but be safe. + for nesting := 0; nesting < 100; { + tok := in.Stack.Next() + switch tok { + case '#': + if !in.beginningOfLine { + in.Error("'#' must be first item on line") + } + in.beginningOfLine = in.hash() + case scanner.Ident: + // Is it a macro name? + name := in.Stack.Text() + macro := in.macros[name] + if macro != nil { + nesting++ + in.invokeMacro(macro) + continue + } + fallthrough + default: + in.beginningOfLine = tok == '\n' + if in.enabled() { + in.text = in.Stack.Text() + return tok + } + } + } + in.Error("recursive macro invocation") + return 0 +} + +func (in *Input) Text() string { + return in.text +} + +// hash processes a # preprocessor directive. It returns true iff it completes. +func (in *Input) hash() bool { + // We have a '#'; it must be followed by a known word (define, include, etc.). + tok := in.Stack.Next() + if tok != scanner.Ident { + in.expectText("expected identifier after '#'") + } + if !in.enabled() { + // Can only start including again if we are at #else or #endif. + // We let #line through because it might affect errors. + switch in.Stack.Text() { + case "else", "endif", "line": + // Press on. + default: + return false + } + } + switch in.Stack.Text() { + case "define": + in.define() + case "else": + in.else_() + case "endif": + in.endif() + case "ifdef": + in.ifdef(true) + case "ifndef": + in.ifdef(false) + case "include": + in.include() + case "line": + in.line() + case "undef": + in.undef() + default: + in.Error("unexpected token after '#':", in.Stack.Text()) + } + return true +} + +// macroName returns the name for the macro being referenced. +func (in *Input) macroName() string { + // We use the Stack's input method; no macro processing at this stage. + tok := in.Stack.Next() + if tok != scanner.Ident { + in.expectText("expected identifier after # directive") + } + // Name is alphanumeric by definition. + return in.Stack.Text() +} + +// #define processing. +func (in *Input) define() { + name := in.macroName() + args, tokens := in.macroDefinition(name) + in.defineMacro(name, args, tokens) +} + +// defineMacro stores the macro definition in the Input. +func (in *Input) defineMacro(name string, args []string, tokens []Token) { + if in.macros[name] != nil { + in.Error("redefinition of macro:", name) + } + in.macros[name] = &Macro{ + name: name, + args: args, + tokens: tokens, + } +} + +// macroDefinition returns the list of formals and the tokens of the definition. +// The argument list is nil for no parens on the definition; otherwise a list of +// formal argument names. +func (in *Input) macroDefinition(name string) ([]string, []Token) { + prevCol := in.Stack.Col() + tok := in.Stack.Next() + if tok == '\n' || tok == scanner.EOF { + return nil, nil // No definition for macro + } + var args []string + // The C preprocessor treats + // #define A(x) + // and + // #define A (x) + // distinctly: the first is a macro with arguments, the second without. + // Distinguish these cases using the column number, since we don't + // see the space itself. Note that text/scanner reports the position at the + // end of the token. It's where you are now, and you just read this token. + if tok == '(' && in.Stack.Col() == prevCol+1 { + // Macro has arguments. Scan list of formals. + acceptArg := true + args = []string{} // Zero length but not nil. + Loop: + for { + tok = in.Stack.Next() + switch tok { + case ')': + tok = in.Stack.Next() // First token of macro definition. + break Loop + case ',': + if acceptArg { + in.Error("bad syntax in definition for macro:", name) + } + acceptArg = true + case scanner.Ident: + if !acceptArg { + in.Error("bad syntax in definition for macro:", name) + } + arg := in.Stack.Text() + if i := lookup(args, arg); i >= 0 { + in.Error("duplicate argument", arg, "in definition for macro:", name) + } + args = append(args, arg) + acceptArg = false + default: + in.Error("bad definition for macro:", name) + } + } + } + var tokens []Token + // Scan to newline. Backslashes escape newlines. + for tok != '\n' { + if tok == '\\' { + tok = in.Stack.Next() + if tok != '\n' && tok != '\\' { + in.Error(`can only escape \ or \n in definition for macro:`, name) + } + } + tokens = append(tokens, Make(tok, in.Stack.Text())) + tok = in.Stack.Next() + } + return args, tokens +} + +func lookup(args []string, arg string) int { + for i, a := range args { + if a == arg { + return i + } + } + return -1 +} + +// invokeMacro pushes onto the input Stack a Slice that holds the macro definition with the actual +// parameters substituted for the formals. +// Invoking a macro does not touch the PC/line history. +func (in *Input) invokeMacro(macro *Macro) { + // If the macro has no arguments, just substitute the text. + if macro.args == nil { + in.Push(NewSlice(in.File(), in.Line(), macro.tokens)) + return + } + tok := in.Stack.Next() + if tok != '(' { + // If the macro has arguments but is invoked without them, all we push is the macro name. + // First, put back the token. + in.peekToken = tok + in.peekText = in.text + in.peek = true + in.Push(NewSlice(in.File(), in.Line(), []Token{Make(macroName, macro.name)})) + return + } + actuals := in.argsFor(macro) + var tokens []Token + for _, tok := range macro.tokens { + if tok.ScanToken != scanner.Ident { + tokens = append(tokens, tok) + continue + } + substitution := actuals[tok.text] + if substitution == nil { + tokens = append(tokens, tok) + continue + } + tokens = append(tokens, substitution...) + } + in.Push(NewSlice(in.File(), in.Line(), tokens)) +} + +// argsFor returns a map from formal name to actual value for this argumented macro invocation. +// The opening parenthesis has been absorbed. +func (in *Input) argsFor(macro *Macro) map[string][]Token { + var args [][]Token + // One macro argument per iteration. Collect them all and check counts afterwards. + for argNum := 0; ; argNum++ { + tokens, tok := in.collectArgument(macro) + args = append(args, tokens) + if tok == ')' { + break + } + } + // Zero-argument macros are tricky. + if len(macro.args) == 0 && len(args) == 1 && args[0] == nil { + args = nil + } else if len(args) != len(macro.args) { + in.Error("wrong arg count for macro", macro.name) + } + argMap := make(map[string][]Token) + for i, arg := range args { + argMap[macro.args[i]] = arg + } + return argMap +} + +// collectArgument returns the actual tokens for a single argument of a macro. +// It also returns the token that terminated the argument, which will always +// be either ',' or ')'. The starting '(' has been scanned. +func (in *Input) collectArgument(macro *Macro) ([]Token, ScanToken) { + nesting := 0 + var tokens []Token + for { + tok := in.Stack.Next() + if tok == scanner.EOF || tok == '\n' { + in.Error("unterminated arg list invoking macro:", macro.name) + } + if nesting == 0 && (tok == ')' || tok == ',') { + return tokens, tok + } + if tok == '(' { + nesting++ + } + if tok == ')' { + nesting-- + } + tokens = append(tokens, Make(tok, in.Stack.Text())) + } +} + +// #ifdef and #ifndef processing. +func (in *Input) ifdef(truth bool) { + name := in.macroName() + in.expectNewline("#if[n]def") + if _, defined := in.macros[name]; !defined { + truth = !truth + } + in.ifdefStack = append(in.ifdefStack, truth) +} + +// #else processing +func (in *Input) else_() { + in.expectNewline("#else") + if len(in.ifdefStack) == 0 { + in.Error("unmatched #else") + } + in.ifdefStack[len(in.ifdefStack)-1] = !in.ifdefStack[len(in.ifdefStack)-1] +} + +// #endif processing. +func (in *Input) endif() { + in.expectNewline("#endif") + if len(in.ifdefStack) == 0 { + in.Error("unmatched #endif") + } + in.ifdefStack = in.ifdefStack[:len(in.ifdefStack)-1] +} + +// #include processing. +func (in *Input) include() { + // Find and parse string. + tok := in.Stack.Next() + if tok != scanner.String { + in.expectText("expected string after #include") + } + name, err := strconv.Unquote(in.Stack.Text()) + if err != nil { + in.Error("unquoting include file name: ", err) + } + in.expectNewline("#include") + // Push tokenizer for file onto stack. + fd, err := os.Open(name) + if err != nil { + for _, dir := range in.includes { + fd, err = os.Open(filepath.Join(dir, name)) + if err == nil { + break + } + } + if err != nil { + in.Error("#include:", err) + } + } + in.Push(NewTokenizer(name, fd, fd)) +} + +// #line processing. +func (in *Input) line() { + // Only need to handle Plan 9 format: #line 337 "filename" + tok := in.Stack.Next() + if tok != scanner.Int { + in.expectText("expected line number after #line") + } + line, err := strconv.Atoi(in.Stack.Text()) + if err != nil { + in.Error("error parsing #line (cannot happen):", err) + } + tok = in.Stack.Next() + if tok != scanner.String { + in.expectText("expected file name in #line") + } + file, err := strconv.Unquote(in.Stack.Text()) + if err != nil { + in.Error("unquoting #line file name: ", err) + } + tok = in.Stack.Next() + if tok != '\n' { + in.Error("unexpected token at end of #line: ", tok) + } + linkCtxt.LineHist.Update(histLine, file, line) + in.Stack.SetPos(line, file) +} + +// #undef processing +func (in *Input) undef() { + name := in.macroName() + if in.macros[name] == nil { + in.Error("#undef for undefined macro:", name) + } + // Newline must be next. + tok := in.Stack.Next() + if tok != '\n' { + in.Error("syntax error in #undef for macro:", name) + } + delete(in.macros, name) +} + +func (in *Input) Push(r TokenReader) { + if len(in.tr) > 100 { + in.Error("input recursion") + } + in.Stack.Push(r) +} + +func (in *Input) Close() { +} diff --git a/src/cmd/asm/internal/lex/lex.go b/src/cmd/asm/internal/lex/lex.go new file mode 100644 index 0000000000000000000000000000000000000000..6fce55f7f4041f4349b71b0d57533be5f71f7d3e --- /dev/null +++ b/src/cmd/asm/internal/lex/lex.go @@ -0,0 +1,157 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package lex implements lexical analysis for the assembler. +package lex + +import ( + "fmt" + "log" + "os" + "strings" + "text/scanner" + + "cmd/internal/obj" +) + +// A ScanToken represents an input item. It is a simple wrapping of rune, as +// returned by text/scanner.Scanner, plus a couple of extra values. +type ScanToken rune + +const ( + // Asm defines some two-character lexemes. We make up + // a rune/ScanToken value for them - ugly but simple. + LSH ScanToken = -1000 - iota // << Left shift. + RSH // >> Logical right shift. + ARR // -> Used on ARM for shift type 3, arithmetic right shift. + ROT // @> Used on ARM for shift type 4, rotate right. + macroName // name of macro that should not be expanded +) + +// IsRegisterShift reports whether the token is one of the ARM register shift operators. +func IsRegisterShift(r ScanToken) bool { + return ROT <= r && r <= LSH // Order looks backwards because these are negative. +} + +func (t ScanToken) String() string { + switch t { + case scanner.EOF: + return "EOF" + case scanner.Ident: + return "identifier" + case scanner.Int: + return "integer constant" + case scanner.Float: + return "float constant" + case scanner.Char: + return "rune constant" + case scanner.String: + return "string constant" + case scanner.RawString: + return "raw string constant" + case scanner.Comment: + return "comment" + default: + return fmt.Sprintf("%q", rune(t)) + } +} + +var ( + // It might be nice if these weren't global. + linkCtxt *obj.Link // The link context for all instructions. + histLine int = 1 // The cumulative count of lines processed. +) + +// HistLine reports the cumulative source line number of the token, +// for use in the Prog structure for the linker. (It's always handling the +// instruction from the current lex line.) +// It returns int32 because that's what type ../asm prefers. +func HistLine() int32 { + return int32(histLine) +} + +// NewLexer returns a lexer for the named file and the given link context. +func NewLexer(name string, ctxt *obj.Link) TokenReader { + linkCtxt = ctxt + input := NewInput(name) + fd, err := os.Open(name) + if err != nil { + log.Fatalf("asm: %s\n", err) + } + input.Push(NewTokenizer(name, fd, fd)) + return input +} + +// InitHist sets the line count to 1, for reproducible testing. +func InitHist() { + histLine = 1 +} + +// The other files in this directory each contain an implementation of TokenReader. + +// A TokenReader is like a reader, but returns lex tokens of type Token. It also can tell you what +// the text of the most recently returned token is, and where it was found. +// The underlying scanner elides all spaces except newline, so the input looks like a stream of +// Tokens; original spacing is lost but we don't need it. +type TokenReader interface { + // Next returns the next token. + Next() ScanToken + // The following methods all refer to the most recent token returned by Next. + // Text returns the original string representation of the token. + Text() string + // File reports the source file name of the token. + File() string + // Line reports the source line number of the token. + Line() int + // Col reports the source column number of the token. + Col() int + // SetPos sets the file and line number. + SetPos(line int, file string) + // Close does any teardown required. + Close() +} + +// A Token is a scan token plus its string value. +// A macro is stored as a sequence of Tokens with spaces stripped. +type Token struct { + ScanToken + text string +} + +// Make returns a Token with the given rune (ScanToken) and text representation. +func Make(token ScanToken, text string) Token { + // If the symbol starts with center dot, as in ·x, rewrite it as ""·x + if token == scanner.Ident && strings.HasPrefix(text, "\u00B7") { + text = `""` + text + } + // Substitute the substitutes for . and /. + text = strings.Replace(text, "\u00B7", ".", -1) + text = strings.Replace(text, "\u2215", "/", -1) + return Token{ScanToken: token, text: text} +} + +func (l Token) String() string { + return l.text +} + +// A Macro represents the definition of a #defined macro. +type Macro struct { + name string // The #define name. + args []string // Formal arguments. + tokens []Token // Body of macro. +} + +// Tokenize turns a string into a list of Tokens; used to parse the -D flag and in tests. +func Tokenize(str string) []Token { + t := NewTokenizer("command line", strings.NewReader(str), nil) + var tokens []Token + for { + tok := t.Next() + if tok == scanner.EOF { + break + } + tokens = append(tokens, Make(tok, t.Text())) + } + return tokens +} diff --git a/src/cmd/asm/internal/lex/lex_test.go b/src/cmd/asm/internal/lex/lex_test.go new file mode 100644 index 0000000000000000000000000000000000000000..f034d69c368c73d3ebf905f8c7060afdbbcb8d1e --- /dev/null +++ b/src/cmd/asm/internal/lex/lex_test.go @@ -0,0 +1,154 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package lex + +import ( + "bytes" + "strings" + "testing" + "text/scanner" +) + +type lexTest struct { + name string + input string + output string +} + +var lexTests = []lexTest{ + { + "empty", + "", + "", + }, + { + "simple", + "1 (a)", + "1.(.a.)", + }, + { + "simple define", + lines( + "#define A 1234", + "A", + ), + "1234.\n", + }, + { + "define without value", + "#define A", + "", + }, + { + "macro without arguments", + "#define A() 1234\n" + "A()\n", + "1234.\n", + }, + { + "macro with just parens as body", + "#define A () \n" + "A\n", + "(.).\n", + }, + { + "macro with parens but no arguments", + "#define A (x) \n" + "A\n", + "(.x.).\n", + }, + { + "macro with arguments", + "#define A(x, y, z) x+z+y\n" + "A(1, 2, 3)\n", + "1.+.3.+.2.\n", + }, + { + "argumented macro invoked without arguments", + lines( + "#define X() foo ", + "X()", + "X", + ), + "foo.\n.X.\n", + }, + { + "multiline macro without arguments", + lines( + "#define A 1\\", + "\t2\\", + "\t3", + "before", + "A", + "after", + ), + "before.\n.1.\n.2.\n.3.\n.after.\n", + }, + { + "multiline macro with arguments", + lines( + "#define A(a, b, c) a\\", + "\tb\\", + "\tc", + "before", + "A(1, 2, 3)", + "after", + ), + "before.\n.1.\n.2.\n.3.\n.after.\n", + }, + { + "LOAD macro", + lines( + "#define LOAD(off, reg) \\", + "\tMOVBLZX (off*4)(R12), reg \\", + "\tADDB reg, DX", + "", + "LOAD(8, AX)", + ), + "\n.\n.MOVBLZX.(.8.*.4.).(.R12.).,.AX.\n.ADDB.AX.,.DX.\n", + }, + { + "nested multiline macro", + lines( + "#define KEYROUND(xmm, load, off, r1, r2, index) \\", + "\tMOVBLZX (BP)(DX*4), R8 \\", + "\tload((off+1), r2) \\", + "\tMOVB R8, (off*4)(R12) \\", + "\tPINSRW $index, (BP)(R8*4), xmm", + "#define LOAD(off, reg) \\", + "\tMOVBLZX (off*4)(R12), reg \\", + "\tADDB reg, DX", + "KEYROUND(X0, LOAD, 8, AX, BX, 0)", + ), + "\n.MOVBLZX.(.BP.).(.DX.*.4.).,.R8.\n.\n.MOVBLZX.(.(.8.+.1.).*.4.).(.R12.).,.BX.\n.ADDB.BX.,.DX.\n.MOVB.R8.,.(.8.*.4.).(.R12.).\n.PINSRW.$.0.,.(.BP.).(.R8.*.4.).,.X0.\n", + }, +} + +func TestLex(t *testing.T) { + for _, test := range lexTests { + input := NewInput(test.name) + input.Push(NewTokenizer(test.name, strings.NewReader(test.input), nil)) + result := drain(input) + if result != test.output { + t.Errorf("%s: got %q expected %q", test.name, result, test.output) + } + } +} + +// lines joins the arguments together as complete lines. +func lines(a ...string) string { + return strings.Join(a, "\n") + "\n" +} + +// drain returns a single string representing the processed input tokens. +func drain(input *Input) string { + var buf bytes.Buffer + for { + tok := input.Next() + if tok == scanner.EOF { + return buf.String() + } + if buf.Len() > 0 { + buf.WriteByte('.') + } + buf.WriteString(input.Text()) + } +} diff --git a/src/cmd/asm/internal/lex/slice.go b/src/cmd/asm/internal/lex/slice.go new file mode 100644 index 0000000000000000000000000000000000000000..e94106b0af5a34a196ce4aa7078368d83b0c253d --- /dev/null +++ b/src/cmd/asm/internal/lex/slice.go @@ -0,0 +1,59 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package lex + +import "text/scanner" + +// A Slice reads from a slice of Tokens. +type Slice struct { + tokens []Token + fileName string + line int + pos int +} + +func NewSlice(fileName string, line int, tokens []Token) *Slice { + return &Slice{ + tokens: tokens, + fileName: fileName, + line: line, + pos: -1, // Next will advance to zero. + } +} + +func (s *Slice) Next() ScanToken { + s.pos++ + if s.pos >= len(s.tokens) { + return scanner.EOF + } + return s.tokens[s.pos].ScanToken +} + +func (s *Slice) Text() string { + return s.tokens[s.pos].text +} + +func (s *Slice) File() string { + return s.fileName +} + +func (s *Slice) Line() int { + return s.line +} + +func (s *Slice) Col() int { + // Col is only called when defining a macro, which can't reach here. + panic("cannot happen: slice col") +} + +func (s *Slice) SetPos(line int, file string) { + // Cannot happen because we only have slices of already-scanned + // text, but be prepared. + s.line = line + s.fileName = file +} + +func (s *Slice) Close() { +} diff --git a/src/cmd/asm/internal/lex/stack.go b/src/cmd/asm/internal/lex/stack.go new file mode 100644 index 0000000000000000000000000000000000000000..72d7f8a165f28c991cac858bc9f99381d2c31008 --- /dev/null +++ b/src/cmd/asm/internal/lex/stack.go @@ -0,0 +1,53 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package lex + +import "text/scanner" + +// A Stack is a stack of TokenReaders. As the top TokenReader hits EOF, +// it resumes reading the next one down. +type Stack struct { + tr []TokenReader +} + +// Push adds tr to the top (end) of the input stack. (Popping happens automatically.) +func (s *Stack) Push(tr TokenReader) { + s.tr = append(s.tr, tr) +} + +func (s *Stack) Next() ScanToken { + tos := s.tr[len(s.tr)-1] + tok := tos.Next() + for tok == scanner.EOF && len(s.tr) > 1 { + tos.Close() + // Pop the topmost item from the stack and resume with the next one down. + s.tr = s.tr[:len(s.tr)-1] + tok = s.Next() + } + return tok +} + +func (s *Stack) Text() string { + return s.tr[len(s.tr)-1].Text() +} + +func (s *Stack) File() string { + return s.tr[len(s.tr)-1].File() +} + +func (s *Stack) Line() int { + return s.tr[len(s.tr)-1].Line() +} + +func (s *Stack) Col() int { + return s.tr[len(s.tr)-1].Col() +} + +func (s *Stack) SetPos(line int, file string) { + s.tr[len(s.tr)-1].SetPos(line, file) +} + +func (s *Stack) Close() { // Unused. +} diff --git a/src/cmd/asm/internal/lex/tokenizer.go b/src/cmd/asm/internal/lex/tokenizer.go new file mode 100644 index 0000000000000000000000000000000000000000..6a4d95491f32fd5e521b22739ce717bc3df50a7c --- /dev/null +++ b/src/cmd/asm/internal/lex/tokenizer.go @@ -0,0 +1,152 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package lex + +import ( + "io" + "os" + "strings" + "text/scanner" + "unicode" +) + +// A Tokenizer is a simple wrapping of text/scanner.Scanner, configured +// for our purposes and made a TokenReader. It forms the lowest level, +// turning text from readers into tokens. +type Tokenizer struct { + tok ScanToken + s *scanner.Scanner + line int + fileName string + file *os.File // If non-nil, file descriptor to close. +} + +func NewTokenizer(name string, r io.Reader, file *os.File) *Tokenizer { + var s scanner.Scanner + s.Init(r) + // Newline is like a semicolon; other space characters are fine. + s.Whitespace = 1<<'\t' | 1<<'\r' | 1<<' ' + // Don't skip comments: we need to count newlines. + s.Mode = scanner.ScanChars | + scanner.ScanFloats | + scanner.ScanIdents | + scanner.ScanInts | + scanner.ScanStrings | + scanner.ScanComments + s.Position.Filename = name + s.IsIdentRune = isIdentRune + if file != nil { + linkCtxt.LineHist.Push(histLine, name) + } + return &Tokenizer{ + s: &s, + line: 1, + fileName: name, + file: file, + } +} + +// We want center dot (·) and division slash (∕) to work as identifier characters. +func isIdentRune(ch rune, i int) bool { + if unicode.IsLetter(ch) { + return true + } + switch ch { + case '_': // Underscore; traditional. + return true + case '\u00B7': // Represents the period in runtime.exit. U+00B7 '·' middle dot + return true + case '\u2215': // Represents the slash in runtime/debug.setGCPercent. U+2215 '∕' division slash + return true + } + // Digits are OK only after the first character. + return i > 0 && unicode.IsDigit(ch) +} + +func (t *Tokenizer) Text() string { + switch t.tok { + case LSH: + return "<<" + case RSH: + return ">>" + case ARR: + return "->" + case ROT: + return "@>" + } + return t.s.TokenText() +} + +func (t *Tokenizer) File() string { + return t.fileName +} + +func (t *Tokenizer) Line() int { + return t.line +} + +func (t *Tokenizer) Col() int { + return t.s.Pos().Column +} + +func (t *Tokenizer) SetPos(line int, file string) { + t.line = line + t.fileName = file +} + +func (t *Tokenizer) Next() ScanToken { + s := t.s + for { + t.tok = ScanToken(s.Scan()) + if t.tok != scanner.Comment { + break + } + length := strings.Count(s.TokenText(), "\n") + t.line += length + histLine += length + // TODO: If we ever have //go: comments in assembly, will need to keep them here. + // For now, just discard all comments. + } + switch t.tok { + case '\n': + if t.file != nil { + histLine++ + } + t.line++ + case '-': + if s.Peek() == '>' { + s.Next() + t.tok = ARR + return ARR + } + case '@': + if s.Peek() == '>' { + s.Next() + t.tok = ROT + return ROT + } + case '<': + if s.Peek() == '<' { + s.Next() + t.tok = LSH + return LSH + } + case '>': + if s.Peek() == '>' { + s.Next() + t.tok = RSH + return RSH + } + } + return t.tok +} + +func (t *Tokenizer) Close() { + if t.file != nil { + t.file.Close() + // It's an open file, so pop the line history. + linkCtxt.LineHist.Pop(histLine) + } +} diff --git a/src/cmd/asm/main.go b/src/cmd/asm/main.go new file mode 100644 index 0000000000000000000000000000000000000000..db0e28e2e59862b00e186aa69a4c6428982ceb68 --- /dev/null +++ b/src/cmd/asm/main.go @@ -0,0 +1,67 @@ +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +import ( + "flag" + "fmt" + "log" + "os" + + "cmd/asm/internal/arch" + "cmd/asm/internal/asm" + "cmd/asm/internal/flags" + "cmd/asm/internal/lex" + + "cmd/internal/obj" +) + +func main() { + log.SetFlags(0) + log.SetPrefix("asm: ") + + GOARCH := obj.Getgoarch() + + architecture := arch.Set(GOARCH) + if architecture == nil { + log.Fatalf("asm: unrecognized architecture %s", GOARCH) + } + + flags.Parse() + + // Create object file, write header. + fd, err := os.Create(*flags.OutputFile) + if err != nil { + log.Fatal(err) + } + ctxt := obj.Linknew(architecture.LinkArch) + if *flags.PrintOut { + ctxt.Debugasm = 1 + } + ctxt.LineHist.TrimPathPrefix = *flags.TrimPath + ctxt.Flag_dynlink = *flags.Dynlink + if *flags.Shared || *flags.Dynlink { + ctxt.Flag_shared = 1 + } + ctxt.Bso = obj.Binitw(os.Stdout) + defer ctxt.Bso.Flush() + ctxt.Diag = log.Fatalf + output := obj.Binitw(fd) + fmt.Fprintf(output, "go object %s %s %s\n", obj.Getgoos(), obj.Getgoarch(), obj.Getgoversion()) + fmt.Fprintf(output, "!\n") + + lexer := lex.NewLexer(flag.Arg(0), ctxt) + parser := asm.NewParser(ctxt, architecture, lexer) + pList := obj.Linknewplist(ctxt) + var ok bool + pList.Firstpc, ok = parser.Parse() + if !ok { + log.Printf("asm: assembly of %s failed", flag.Arg(0)) + os.Remove(*flags.OutputFile) + os.Exit(1) + } + obj.Writeobjdirect(ctxt, output) + output.Flush() +} diff --git a/src/cmd/cgo/ast.go b/src/cmd/cgo/ast.go new file mode 100644 index 0000000000000000000000000000000000000000..8bbd1cc52e66e06edf8ec04665b9da2757d9ac03 --- /dev/null +++ b/src/cmd/cgo/ast.go @@ -0,0 +1,471 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Parse input AST and prepare Prog structure. + +package main + +import ( + "fmt" + "go/ast" + "go/parser" + "go/scanner" + "go/token" + "os" + "path/filepath" + "strings" +) + +func parse(name string, flags parser.Mode) *ast.File { + ast1, err := parser.ParseFile(fset, name, nil, flags) + if err != nil { + if list, ok := err.(scanner.ErrorList); ok { + // If err is a scanner.ErrorList, its String will print just + // the first error and then (+n more errors). + // Instead, turn it into a new Error that will return + // details for all the errors. + for _, e := range list { + fmt.Fprintln(os.Stderr, e) + } + os.Exit(2) + } + fatalf("parsing %s: %s", name, err) + } + return ast1 +} + +func sourceLine(n ast.Node) int { + return fset.Position(n.Pos()).Line +} + +// ReadGo populates f with information learned from reading the +// Go source file with the given file name. It gathers the C preamble +// attached to the import "C" comment, a list of references to C.xxx, +// a list of exported functions, and the actual AST, to be rewritten and +// printed. +func (f *File) ReadGo(name string) { + // Create absolute path for file, so that it will be used in error + // messages and recorded in debug line number information. + // This matches the rest of the toolchain. See golang.org/issue/5122. + if aname, err := filepath.Abs(name); err == nil { + name = aname + } + + // Two different parses: once with comments, once without. + // The printer is not good enough at printing comments in the + // right place when we start editing the AST behind its back, + // so we use ast1 to look for the doc comments on import "C" + // and on exported functions, and we use ast2 for translating + // and reprinting. + ast1 := parse(name, parser.ParseComments) + ast2 := parse(name, 0) + + f.Package = ast1.Name.Name + f.Name = make(map[string]*Name) + + // In ast1, find the import "C" line and get any extra C preamble. + sawC := false + for _, decl := range ast1.Decls { + d, ok := decl.(*ast.GenDecl) + if !ok { + continue + } + for _, spec := range d.Specs { + s, ok := spec.(*ast.ImportSpec) + if !ok || string(s.Path.Value) != `"C"` { + continue + } + sawC = true + if s.Name != nil { + error_(s.Path.Pos(), `cannot rename import "C"`) + } + cg := s.Doc + if cg == nil && len(d.Specs) == 1 { + cg = d.Doc + } + if cg != nil { + f.Preamble += fmt.Sprintf("#line %d %q\n", sourceLine(cg), name) + f.Preamble += commentText(cg) + "\n" + } + } + } + if !sawC { + error_(token.NoPos, `cannot find import "C"`) + } + + // In ast2, strip the import "C" line. + w := 0 + for _, decl := range ast2.Decls { + d, ok := decl.(*ast.GenDecl) + if !ok { + ast2.Decls[w] = decl + w++ + continue + } + ws := 0 + for _, spec := range d.Specs { + s, ok := spec.(*ast.ImportSpec) + if !ok || string(s.Path.Value) != `"C"` { + d.Specs[ws] = spec + ws++ + } + } + if ws == 0 { + continue + } + d.Specs = d.Specs[0:ws] + ast2.Decls[w] = d + w++ + } + ast2.Decls = ast2.Decls[0:w] + + // Accumulate pointers to uses of C.x. + if f.Ref == nil { + f.Ref = make([]*Ref, 0, 8) + } + f.walk(ast2, "prog", (*File).saveRef) + + // Accumulate exported functions. + // The comments are only on ast1 but we need to + // save the function bodies from ast2. + // The first walk fills in ExpFunc, and the + // second walk changes the entries to + // refer to ast2 instead. + f.walk(ast1, "prog", (*File).saveExport) + f.walk(ast2, "prog", (*File).saveExport2) + + f.Comments = ast1.Comments + f.AST = ast2 +} + +// Like ast.CommentGroup's Text method but preserves +// leading blank lines, so that line numbers line up. +func commentText(g *ast.CommentGroup) string { + if g == nil { + return "" + } + var pieces []string + for _, com := range g.List { + c := string(com.Text) + // Remove comment markers. + // The parser has given us exactly the comment text. + switch c[1] { + case '/': + //-style comment (no newline at the end) + c = c[2:] + "\n" + case '*': + /*-style comment */ + c = c[2 : len(c)-2] + } + pieces = append(pieces, c) + } + return strings.Join(pieces, "") +} + +// Save references to C.xxx for later processing. +func (f *File) saveRef(x interface{}, context string) { + n, ok := x.(*ast.Expr) + if !ok { + return + } + if sel, ok := (*n).(*ast.SelectorExpr); ok { + // For now, assume that the only instance of capital C is + // when used as the imported package identifier. + // The parser should take care of scoping in the future, + // so that we will be able to distinguish a "top-level C" + // from a local C. + if l, ok := sel.X.(*ast.Ident); ok && l.Name == "C" { + if context == "as2" { + context = "expr" + } + if context == "embed-type" { + error_(sel.Pos(), "cannot embed C type") + } + goname := sel.Sel.Name + if goname == "errno" { + error_(sel.Pos(), "cannot refer to errno directly; see documentation") + return + } + if goname == "_CMalloc" { + error_(sel.Pos(), "cannot refer to C._CMalloc; use C.malloc") + return + } + if goname == "malloc" { + goname = "_CMalloc" + } + name := f.Name[goname] + if name == nil { + name = &Name{ + Go: goname, + } + f.Name[goname] = name + } + f.Ref = append(f.Ref, &Ref{ + Name: name, + Expr: n, + Context: context, + }) + return + } + } +} + +// If a function should be exported add it to ExpFunc. +func (f *File) saveExport(x interface{}, context string) { + n, ok := x.(*ast.FuncDecl) + if !ok { + return + } + + if n.Doc == nil { + return + } + for _, c := range n.Doc.List { + if !strings.HasPrefix(string(c.Text), "//export ") { + continue + } + + name := strings.TrimSpace(string(c.Text[9:])) + if name == "" { + error_(c.Pos(), "export missing name") + } + + if name != n.Name.Name { + error_(c.Pos(), "export comment has wrong name %q, want %q", name, n.Name.Name) + } + + doc := "" + for _, c1 := range n.Doc.List { + if c1 != c { + doc += c1.Text + "\n" + } + } + + f.ExpFunc = append(f.ExpFunc, &ExpFunc{ + Func: n, + ExpName: name, + Doc: doc, + }) + break + } +} + +// Make f.ExpFunc[i] point at the Func from this AST instead of the other one. +func (f *File) saveExport2(x interface{}, context string) { + n, ok := x.(*ast.FuncDecl) + if !ok { + return + } + + for _, exp := range f.ExpFunc { + if exp.Func.Name.Name == n.Name.Name { + exp.Func = n + break + } + } +} + +// walk walks the AST x, calling visit(f, x, context) for each node. +func (f *File) walk(x interface{}, context string, visit func(*File, interface{}, string)) { + visit(f, x, context) + switch n := x.(type) { + case *ast.Expr: + f.walk(*n, context, visit) + + // everything else just recurs + default: + error_(token.NoPos, "unexpected type %T in walk", x, visit) + panic("unexpected type") + + case nil: + + // These are ordered and grouped to match ../../go/ast/ast.go + case *ast.Field: + if len(n.Names) == 0 && context == "field" { + f.walk(&n.Type, "embed-type", visit) + } else { + f.walk(&n.Type, "type", visit) + } + case *ast.FieldList: + for _, field := range n.List { + f.walk(field, context, visit) + } + case *ast.BadExpr: + case *ast.Ident: + case *ast.Ellipsis: + case *ast.BasicLit: + case *ast.FuncLit: + f.walk(n.Type, "type", visit) + f.walk(n.Body, "stmt", visit) + case *ast.CompositeLit: + f.walk(&n.Type, "type", visit) + f.walk(n.Elts, "expr", visit) + case *ast.ParenExpr: + f.walk(&n.X, context, visit) + case *ast.SelectorExpr: + f.walk(&n.X, "selector", visit) + case *ast.IndexExpr: + f.walk(&n.X, "expr", visit) + f.walk(&n.Index, "expr", visit) + case *ast.SliceExpr: + f.walk(&n.X, "expr", visit) + if n.Low != nil { + f.walk(&n.Low, "expr", visit) + } + if n.High != nil { + f.walk(&n.High, "expr", visit) + } + if n.Max != nil { + f.walk(&n.Max, "expr", visit) + } + case *ast.TypeAssertExpr: + f.walk(&n.X, "expr", visit) + f.walk(&n.Type, "type", visit) + case *ast.CallExpr: + if context == "as2" { + f.walk(&n.Fun, "call2", visit) + } else { + f.walk(&n.Fun, "call", visit) + } + f.walk(n.Args, "expr", visit) + case *ast.StarExpr: + f.walk(&n.X, context, visit) + case *ast.UnaryExpr: + f.walk(&n.X, "expr", visit) + case *ast.BinaryExpr: + f.walk(&n.X, "expr", visit) + f.walk(&n.Y, "expr", visit) + case *ast.KeyValueExpr: + f.walk(&n.Key, "expr", visit) + f.walk(&n.Value, "expr", visit) + + case *ast.ArrayType: + f.walk(&n.Len, "expr", visit) + f.walk(&n.Elt, "type", visit) + case *ast.StructType: + f.walk(n.Fields, "field", visit) + case *ast.FuncType: + f.walk(n.Params, "param", visit) + if n.Results != nil { + f.walk(n.Results, "param", visit) + } + case *ast.InterfaceType: + f.walk(n.Methods, "field", visit) + case *ast.MapType: + f.walk(&n.Key, "type", visit) + f.walk(&n.Value, "type", visit) + case *ast.ChanType: + f.walk(&n.Value, "type", visit) + + case *ast.BadStmt: + case *ast.DeclStmt: + f.walk(n.Decl, "decl", visit) + case *ast.EmptyStmt: + case *ast.LabeledStmt: + f.walk(n.Stmt, "stmt", visit) + case *ast.ExprStmt: + f.walk(&n.X, "expr", visit) + case *ast.SendStmt: + f.walk(&n.Chan, "expr", visit) + f.walk(&n.Value, "expr", visit) + case *ast.IncDecStmt: + f.walk(&n.X, "expr", visit) + case *ast.AssignStmt: + f.walk(n.Lhs, "expr", visit) + if len(n.Lhs) == 2 && len(n.Rhs) == 1 { + f.walk(n.Rhs, "as2", visit) + } else { + f.walk(n.Rhs, "expr", visit) + } + case *ast.GoStmt: + f.walk(n.Call, "expr", visit) + case *ast.DeferStmt: + f.walk(n.Call, "expr", visit) + case *ast.ReturnStmt: + f.walk(n.Results, "expr", visit) + case *ast.BranchStmt: + case *ast.BlockStmt: + f.walk(n.List, context, visit) + case *ast.IfStmt: + f.walk(n.Init, "stmt", visit) + f.walk(&n.Cond, "expr", visit) + f.walk(n.Body, "stmt", visit) + f.walk(n.Else, "stmt", visit) + case *ast.CaseClause: + if context == "typeswitch" { + context = "type" + } else { + context = "expr" + } + f.walk(n.List, context, visit) + f.walk(n.Body, "stmt", visit) + case *ast.SwitchStmt: + f.walk(n.Init, "stmt", visit) + f.walk(&n.Tag, "expr", visit) + f.walk(n.Body, "switch", visit) + case *ast.TypeSwitchStmt: + f.walk(n.Init, "stmt", visit) + f.walk(n.Assign, "stmt", visit) + f.walk(n.Body, "typeswitch", visit) + case *ast.CommClause: + f.walk(n.Comm, "stmt", visit) + f.walk(n.Body, "stmt", visit) + case *ast.SelectStmt: + f.walk(n.Body, "stmt", visit) + case *ast.ForStmt: + f.walk(n.Init, "stmt", visit) + f.walk(&n.Cond, "expr", visit) + f.walk(n.Post, "stmt", visit) + f.walk(n.Body, "stmt", visit) + case *ast.RangeStmt: + f.walk(&n.Key, "expr", visit) + f.walk(&n.Value, "expr", visit) + f.walk(&n.X, "expr", visit) + f.walk(n.Body, "stmt", visit) + + case *ast.ImportSpec: + case *ast.ValueSpec: + f.walk(&n.Type, "type", visit) + f.walk(n.Values, "expr", visit) + case *ast.TypeSpec: + f.walk(&n.Type, "type", visit) + + case *ast.BadDecl: + case *ast.GenDecl: + f.walk(n.Specs, "spec", visit) + case *ast.FuncDecl: + if n.Recv != nil { + f.walk(n.Recv, "param", visit) + } + f.walk(n.Type, "type", visit) + if n.Body != nil { + f.walk(n.Body, "stmt", visit) + } + + case *ast.File: + f.walk(n.Decls, "decl", visit) + + case *ast.Package: + for _, file := range n.Files { + f.walk(file, "file", visit) + } + + case []ast.Decl: + for _, d := range n { + f.walk(d, context, visit) + } + case []ast.Expr: + for i := range n { + f.walk(&n[i], context, visit) + } + case []ast.Stmt: + for _, s := range n { + f.walk(s, context, visit) + } + case []ast.Spec: + for _, s := range n { + f.walk(s, context, visit) + } + } +} diff --git a/src/cmd/cgo/doc.go b/src/cmd/cgo/doc.go new file mode 100644 index 0000000000000000000000000000000000000000..b2a5428f3f4dfac7c42356014e3fd0cc7a85fa4a --- /dev/null +++ b/src/cmd/cgo/doc.go @@ -0,0 +1,771 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +/* + +Cgo enables the creation of Go packages that call C code. + +Using cgo with the go command + +To use cgo write normal Go code that imports a pseudo-package "C". +The Go code can then refer to types such as C.size_t, variables such +as C.stdout, or functions such as C.putchar. + +If the import of "C" is immediately preceded by a comment, that +comment, called the preamble, is used as a header when compiling +the C parts of the package. For example: + + // #include + // #include + import "C" + +The preamble may contain any C code, including function and variable +declarations and definitions. These may then be referred to from Go +code as though they were defined in the package "C". All names +declared in the preamble may be used, even if they start with a +lower-case letter. Exception: static variables in the preamble may +not be referenced from Go code; static functions are permitted. + +See $GOROOT/misc/cgo/stdio and $GOROOT/misc/cgo/gmp for examples. See +"C? Go? Cgo!" for an introduction to using cgo: +https://golang.org/doc/articles/c_go_cgo.html. + +CFLAGS, CPPFLAGS, CXXFLAGS and LDFLAGS may be defined with pseudo #cgo +directives within these comments to tweak the behavior of the C or C++ +compiler. Values defined in multiple directives are concatenated +together. The directive can include a list of build constraints limiting its +effect to systems satisfying one of the constraints +(see https://golang.org/pkg/go/build/#hdr-Build_Constraints for details about the constraint syntax). +For example: + + // #cgo CFLAGS: -DPNG_DEBUG=1 + // #cgo amd64 386 CFLAGS: -DX86=1 + // #cgo LDFLAGS: -lpng + // #include + import "C" + +Alternatively, CPPFLAGS and LDFLAGS may be obtained via the pkg-config +tool using a '#cgo pkg-config:' directive followed by the package names. +For example: + + // #cgo pkg-config: png cairo + // #include + import "C" + +When building, the CGO_CFLAGS, CGO_CPPFLAGS, CGO_CXXFLAGS and +CGO_LDFLAGS environment variables are added to the flags derived from +these directives. Package-specific flags should be set using the +directives, not the environment variables, so that builds work in +unmodified environments. + +All the cgo CPPFLAGS and CFLAGS directives in a package are concatenated and +used to compile C files in that package. All the CPPFLAGS and CXXFLAGS +directives in a package are concatenated and used to compile C++ files in that +package. All the LDFLAGS directives in any package in the program are +concatenated and used at link time. All the pkg-config directives are +concatenated and sent to pkg-config simultaneously to add to each appropriate +set of command-line flags. + +When the cgo directives are parsed, any occurrence of the string ${SRCDIR} +will be replaced by the absolute path to the directory containing the source +file. This allows pre-compiled static libraries to be included in the package +directory and linked properly. +For example if package foo is in the directory /go/src/foo: + + // #cgo LDFLAGS: -L${SRCDIR}/libs -lfoo + +Will be expanded to: + + // #cgo LDFLAGS: -L/go/src/foo/libs -lfoo + +When the Go tool sees that one or more Go files use the special import +"C", it will look for other non-Go files in the directory and compile +them as part of the Go package. Any .c, .s, or .S files will be +compiled with the C compiler. Any .cc, .cpp, or .cxx files will be +compiled with the C++ compiler. Any .h, .hh, .hpp, or .hxx files will +not be compiled separately, but, if these header files are changed, +the C and C++ files will be recompiled. The default C and C++ +compilers may be changed by the CC and CXX environment variables, +respectively; those environment variables may include command line +options. + +The cgo tool is enabled by default for native builds on systems where +it is expected to work. It is disabled by default when +cross-compiling. You can control this by setting the CGO_ENABLED +environment variable when running the go tool: set it to 1 to enable +the use of cgo, and to 0 to disable it. The go tool will set the +build constraint "cgo" if cgo is enabled. + +When cross-compiling, you must specify a C cross-compiler for cgo to +use. You can do this by setting the CC_FOR_TARGET environment +variable when building the toolchain using make.bash, or by setting +the CC environment variable any time you run the go tool. The +CXX_FOR_TARGET and CXX environment variables work in a similar way for +C++ code. + +Go references to C + +Within the Go file, C's struct field names that are keywords in Go +can be accessed by prefixing them with an underscore: if x points at a C +struct with a field named "type", x._type accesses the field. +C struct fields that cannot be expressed in Go, such as bit fields +or misaligned data, are omitted in the Go struct, replaced by +appropriate padding to reach the next field or the end of the struct. + +The standard C numeric types are available under the names +C.char, C.schar (signed char), C.uchar (unsigned char), +C.short, C.ushort (unsigned short), C.int, C.uint (unsigned int), +C.long, C.ulong (unsigned long), C.longlong (long long), +C.ulonglong (unsigned long long), C.float, C.double. +The C type void* is represented by Go's unsafe.Pointer. + +To access a struct, union, or enum type directly, prefix it with +struct_, union_, or enum_, as in C.struct_stat. + +As Go doesn't have support for C's union type in the general case, +C's union types are represented as a Go byte array with the same length. + +Go structs cannot embed fields with C types. + +Cgo translates C types into equivalent unexported Go types. +Because the translations are unexported, a Go package should not +expose C types in its exported API: a C type used in one Go package +is different from the same C type used in another. + +Any C function (even void functions) may be called in a multiple +assignment context to retrieve both the return value (if any) and the +C errno variable as an error (use _ to skip the result value if the +function returns void). For example: + + n, err := C.sqrt(-1) + _, err := C.voidFunc() + +Calling C function pointers is currently not supported, however you can +declare Go variables which hold C function pointers and pass them +back and forth between Go and C. C code may call function pointers +received from Go. For example: + + package main + + // typedef int (*intFunc) (); + // + // int + // bridge_int_func(intFunc f) + // { + // return f(); + // } + // + // int fortytwo() + // { + // return 42; + // } + import "C" + import "fmt" + + func main() { + f := C.intFunc(C.fortytwo) + fmt.Println(int(C.bridge_int_func(f))) + // Output: 42 + } + +In C, a function argument written as a fixed size array +actually requires a pointer to the first element of the array. +C compilers are aware of this calling convention and adjust +the call accordingly, but Go cannot. In Go, you must pass +the pointer to the first element explicitly: C.f(&C.x[0]). + +A few special functions convert between Go and C types +by making copies of the data. In pseudo-Go definitions: + + // Go string to C string + // The C string is allocated in the C heap using malloc. + // It is the caller's responsibility to arrange for it to be + // freed, such as by calling C.free (be sure to include stdlib.h + // if C.free is needed). + func C.CString(string) *C.char + + // C string to Go string + func C.GoString(*C.char) string + + // C string, length to Go string + func C.GoStringN(*C.char, C.int) string + + // C pointer, length to Go []byte + func C.GoBytes(unsafe.Pointer, C.int) []byte + +C references to Go + +Go functions can be exported for use by C code in the following way: + + //export MyFunction + func MyFunction(arg1, arg2 int, arg3 string) int64 {...} + + //export MyFunction2 + func MyFunction2(arg1, arg2 int, arg3 string) (int64, *C.char) {...} + +They will be available in the C code as: + + extern int64 MyFunction(int arg1, int arg2, GoString arg3); + extern struct MyFunction2_return MyFunction2(int arg1, int arg2, GoString arg3); + +found in the _cgo_export.h generated header, after any preambles +copied from the cgo input files. Functions with multiple +return values are mapped to functions returning a struct. +Not all Go types can be mapped to C types in a useful way. + +Using //export in a file places a restriction on the preamble: +since it is copied into two different C output files, it must not +contain any definitions, only declarations. If a file contains both +definitions and declarations, then the two output files will produce +duplicate symbols and the linker will fail. To avoid this, definitions +must be placed in preambles in other files, or in C source files. + +Using cgo directly + +Usage: + go tool cgo [cgo options] [-- compiler options] gofiles... + +Cgo transforms the specified input Go source files into several output +Go and C source files. + +The compiler options are passed through uninterpreted when +invoking the C compiler to compile the C parts of the package. + +The following options are available when running cgo directly: + + -dynimport file + Write list of symbols imported by file. Write to + -dynout argument or to standard output. Used by go + build when building a cgo package. + -dynout file + Write -dynimport output to file. + -dynpackage package + Set Go package for -dynimport output. + -dynlinker + Write dynamic linker as part of -dynimport output. + -godefs + Write out input file in Go syntax replacing C package + names with real values. Used to generate files in the + syscall package when bootstrapping a new target. + -objdir directory + Put all generated files in directory. + -importpath string + The import path for the Go package. Optional; used for + nicer comments in the generated files. + -exportheader file + If there are any exported functions, write the + generated export declarations to file. + C code can #include this to see the declarations. + -gccgo + Generate output for the gccgo compiler rather than the + gc compiler. + -gccgoprefix prefix + The -fgo-prefix option to be used with gccgo. + -gccgopkgpath path + The -fgo-pkgpath option to be used with gccgo. + -import_runtime_cgo + If set (which it is by default) import runtime/cgo in + generated output. + -import_syscall + If set (which it is by default) import syscall in + generated output. + -debug-define + Debugging option. Print #defines. + -debug-gcc + Debugging option. Trace C compiler execution and output. +*/ +package main + +/* +Implementation details. + +Cgo provides a way for Go programs to call C code linked into the same +address space. This comment explains the operation of cgo. + +Cgo reads a set of Go source files and looks for statements saying +import "C". If the import has a doc comment, that comment is +taken as literal C code to be used as a preamble to any C code +generated by cgo. A typical preamble #includes necessary definitions: + + // #include + import "C" + +For more details about the usage of cgo, see the documentation +comment at the top of this file. + +Understanding C + +Cgo scans the Go source files that import "C" for uses of that +package, such as C.puts. It collects all such identifiers. The next +step is to determine each kind of name. In C.xxx the xxx might refer +to a type, a function, a constant, or a global variable. Cgo must +decide which. + +The obvious thing for cgo to do is to process the preamble, expanding +#includes and processing the corresponding C code. That would require +a full C parser and type checker that was also aware of any extensions +known to the system compiler (for example, all the GNU C extensions) as +well as the system-specific header locations and system-specific +pre-#defined macros. This is certainly possible to do, but it is an +enormous amount of work. + +Cgo takes a different approach. It determines the meaning of C +identifiers not by parsing C code but by feeding carefully constructed +programs into the system C compiler and interpreting the generated +error messages, debug information, and object files. In practice, +parsing these is significantly less work and more robust than parsing +C source. + +Cgo first invokes gcc -E -dM on the preamble, in order to find out +about simple #defines for constants and the like. These are recorded +for later use. + +Next, cgo needs to identify the kinds for each identifier. For the +identifiers C.foo and C.bar, cgo generates this C program: + + + #line 1 "not-declared" + void __cgo_f_xxx_1(void) { __typeof__(foo) *__cgo_undefined__; } + #line 1 "not-type" + void __cgo_f_xxx_2(void) { foo *__cgo_undefined__; } + #line 1 "not-const" + void __cgo_f_xxx_3(void) { enum { __cgo_undefined__ = (foo)*1 }; } + #line 2 "not-declared" + void __cgo_f_xxx_1(void) { __typeof__(bar) *__cgo_undefined__; } + #line 2 "not-type" + void __cgo_f_xxx_2(void) { bar *__cgo_undefined__; } + #line 2 "not-const" + void __cgo_f_xxx_3(void) { enum { __cgo_undefined__ = (bar)*1 }; } + +This program will not compile, but cgo can use the presence or absence +of an error message on a given line to deduce the information it +needs. The program is syntactically valid regardless of whether each +name is a type or an ordinary identifier, so there will be no syntax +errors that might stop parsing early. + +An error on not-declared:1 indicates that foo is undeclared. +An error on not-type:1 indicates that foo is not a type (if declared at all, it is an identifier). +An error on not-const:1 indicates that foo is not an integer constant. + +The line number specifies the name involved. In the example, 1 is foo and 2 is bar. + +Next, cgo must learn the details of each type, variable, function, or +constant. It can do this by reading object files. If cgo has decided +that t1 is a type, v2 and v3 are variables or functions, and c4, c5, +and c6 are constants, it generates: + + + __typeof__(t1) *__cgo__1; + __typeof__(v2) *__cgo__2; + __typeof__(v3) *__cgo__3; + __typeof__(c4) *__cgo__4; + enum { __cgo_enum__4 = c4 }; + __typeof__(c5) *__cgo__5; + enum { __cgo_enum__5 = c5 }; + __typeof__(c6) *__cgo__6; + enum { __cgo_enum__6 = c6 }; + + long long __cgo_debug_data[] = { + 0, // t1 + 0, // v2 + 0, // v3 + c4, + c5, + c6, + 1 + }; + +and again invokes the system C compiler, to produce an object file +containing debug information. Cgo parses the DWARF debug information +for __cgo__N to learn the type of each identifier. (The types also +distinguish functions from global variables.) If using a standard gcc, +cgo can parse the DWARF debug information for the __cgo_enum__N to +learn the identifier's value. The LLVM-based gcc on OS X emits +incomplete DWARF information for enums; in that case cgo reads the +constant values from the __cgo_debug_data from the object file's data +segment. + +At this point cgo knows the meaning of each C.xxx well enough to start +the translation process. + +Translating Go + +[The rest of this comment refers to 6g, the Go compiler that is part +of the amd64 port of the gc Go toolchain. Everything here applies to +another architecture's compilers as well.] + +Given the input Go files x.go and y.go, cgo generates these source +files: + + x.cgo1.go # for 6g + y.cgo1.go # for 6g + _cgo_gotypes.go # for 6g + _cgo_import.go # for 6g (if -dynout _cgo_import.go) + x.cgo2.c # for gcc + y.cgo2.c # for gcc + _cgo_defun.c # for gcc (if -gccgo) + _cgo_export.c # for gcc + _cgo_export.h # for gcc + _cgo_main.c # for gcc + _cgo_flags # for alternative build tools + +The file x.cgo1.go is a copy of x.go with the import "C" removed and +references to C.xxx replaced with names like _Cfunc_xxx or _Ctype_xxx. +The definitions of those identifiers, written as Go functions, types, +or variables, are provided in _cgo_gotypes.go. + +Here is a _cgo_gotypes.go containing definitions for needed C types: + + type _Ctype_char int8 + type _Ctype_int int32 + type _Ctype_void [0]byte + +The _cgo_gotypes.go file also contains the definitions of the +functions. They all have similar bodies that invoke runtime·cgocall +to make a switch from the Go runtime world to the system C (GCC-based) +world. + +For example, here is the definition of _Cfunc_puts: + + //go:cgo_import_static _cgo_be59f0f25121_Cfunc_puts + //go:linkname __cgofn__cgo_be59f0f25121_Cfunc_puts _cgo_be59f0f25121_Cfunc_puts + var __cgofn__cgo_be59f0f25121_Cfunc_puts byte + var _cgo_be59f0f25121_Cfunc_puts = unsafe.Pointer(&__cgofn__cgo_be59f0f25121_Cfunc_puts) + + func _Cfunc_puts(p0 *_Ctype_char) (r1 _Ctype_int) { + _cgo_runtime_cgocall(_cgo_be59f0f25121_Cfunc_puts, uintptr(unsafe.Pointer(&p0))) + return + } + +The hexadecimal number is a hash of cgo's input, chosen to be +deterministic yet unlikely to collide with other uses. The actual +function _cgo_be59f0f25121_Cfunc_puts is implemented in a C source +file compiled by gcc, the file x.cgo2.c: + + void + _cgo_be59f0f25121_Cfunc_puts(void *v) + { + _cgo_wait_runtime_init_done(); + struct { + char* p0; + int r; + char __pad12[4]; + } __attribute__((__packed__, __gcc_struct__)) *a = v; + a->r = puts((void*)a->p0); + } + +It waits for Go runtime to be initialized (required for shared libraries), +extracts the arguments from the pointer to _Cfunc_puts's argument +frame, invokes the system C function (in this case, puts), stores the +result in the frame, and returns. + +Linking + +Once the _cgo_export.c and *.cgo2.c files have been compiled with gcc, +they need to be linked into the final binary, along with the libraries +they might depend on (in the case of puts, stdio). 6l has been +extended to understand basic ELF files, but it does not understand ELF +in the full complexity that modern C libraries embrace, so it cannot +in general generate direct references to the system libraries. + +Instead, the build process generates an object file using dynamic +linkage to the desired libraries. The main function is provided by +_cgo_main.c: + + int main() { return 0; } + void crosscall2(void(*fn)(void*, int), void *a, int c) { } + void _cgo_wait_runtime_init_done() { } + void _cgo_allocate(void *a, int c) { } + void _cgo_panic(void *a, int c) { } + +The extra functions here are stubs to satisfy the references in the C +code generated for gcc. The build process links this stub, along with +_cgo_export.c and *.cgo2.c, into a dynamic executable and then lets +cgo examine the executable. Cgo records the list of shared library +references and resolved names and writes them into a new file +_cgo_import.go, which looks like: + + //go:cgo_dynamic_linker "/lib64/ld-linux-x86-64.so.2" + //go:cgo_import_dynamic puts puts#GLIBC_2.2.5 "libc.so.6" + //go:cgo_import_dynamic __libc_start_main __libc_start_main#GLIBC_2.2.5 "libc.so.6" + //go:cgo_import_dynamic stdout stdout#GLIBC_2.2.5 "libc.so.6" + //go:cgo_import_dynamic fflush fflush#GLIBC_2.2.5 "libc.so.6" + //go:cgo_import_dynamic _ _ "libpthread.so.0" + //go:cgo_import_dynamic _ _ "libc.so.6" + +In the end, the compiled Go package, which will eventually be +presented to 6l as part of a larger program, contains: + + _go_.6 # 6g-compiled object for _cgo_gotypes.go, _cgo_import.go, *.cgo1.go + _all.o # gcc-compiled object for _cgo_export.c, *.cgo2.c + +The final program will be a dynamic executable, so that 6l can avoid +needing to process arbitrary .o files. It only needs to process the .o +files generated from C files that cgo writes, and those are much more +limited in the ELF or other features that they use. + +In essence, the _cgo_import.6 file includes the extra linking +directives that 6l is not sophisticated enough to derive from _all.o +on its own. Similarly, the _all.o uses dynamic references to real +system object code because 6l is not sophisticated enough to process +the real code. + +The main benefits of this system are that 6l remains relatively simple +(it does not need to implement a complete ELF and Mach-O linker) and +that gcc is not needed after the package is compiled. For example, +package net uses cgo for access to name resolution functions provided +by libc. Although gcc is needed to compile package net, gcc is not +needed to link programs that import package net. + +Runtime + +When using cgo, Go must not assume that it owns all details of the +process. In particular it needs to coordinate with C in the use of +threads and thread-local storage. The runtime package declares a few +variables: + + var ( + iscgo bool + _cgo_init unsafe.Pointer + _cgo_thread_start unsafe.Pointer + ) + +Any package using cgo imports "runtime/cgo", which provides +initializations for these variables. It sets iscgo to true, _cgo_init +to a gcc-compiled function that can be called early during program +startup, and _cgo_thread_start to a gcc-compiled function that can be +used to create a new thread, in place of the runtime's usual direct +system calls. + +Internal and External Linking + +The text above describes "internal" linking, in which 6l parses and +links host object files (ELF, Mach-O, PE, and so on) into the final +executable itself. Keeping 6l simple means we cannot possibly +implement the full semantics of the host linker, so the kinds of +objects that can be linked directly into the binary is limited (other +code can only be used as a dynamic library). On the other hand, when +using internal linking, 6l can generate Go binaries by itself. + +In order to allow linking arbitrary object files without requiring +dynamic libraries, cgo supports an "external" linking mode too. In +external linking mode, 6l does not process any host object files. +Instead, it collects all the Go code and writes a single go.o object +file containing it. Then it invokes the host linker (usually gcc) to +combine the go.o object file and any supporting non-Go code into a +final executable. External linking avoids the dynamic library +requirement but introduces a requirement that the host linker be +present to create such a binary. + +Most builds both compile source code and invoke the linker to create a +binary. When cgo is involved, the compile step already requires gcc, so +it is not problematic for the link step to require gcc too. + +An important exception is builds using a pre-compiled copy of the +standard library. In particular, package net uses cgo on most systems, +and we want to preserve the ability to compile pure Go code that +imports net without requiring gcc to be present at link time. (In this +case, the dynamic library requirement is less significant, because the +only library involved is libc.so, which can usually be assumed +present.) + +This conflict between functionality and the gcc requirement means we +must support both internal and external linking, depending on the +circumstances: if net is the only cgo-using package, then internal +linking is probably fine, but if other packages are involved, so that there +are dependencies on libraries beyond libc, external linking is likely +to work better. The compilation of a package records the relevant +information to support both linking modes, leaving the decision +to be made when linking the final binary. + +Linking Directives + +In either linking mode, package-specific directives must be passed +through to 6l. These are communicated by writing //go: directives in a +Go source file compiled by 6g. The directives are copied into the .6 +object file and then processed by the linker. + +The directives are: + +//go:cgo_import_dynamic [ [""]] + + In internal linking mode, allow an unresolved reference to + , assuming it will be resolved by a dynamic library + symbol. The optional specifies the symbol's name and + possibly version in the dynamic library, and the optional "" + names the specific library where the symbol should be found. + + In the , # or @ can be used to introduce a symbol version. + + Examples: + //go:cgo_import_dynamic puts + //go:cgo_import_dynamic puts puts#GLIBC_2.2.5 + //go:cgo_import_dynamic puts puts#GLIBC_2.2.5 "libc.so.6" + + A side effect of the cgo_import_dynamic directive with a + library is to make the final binary depend on that dynamic + library. To get the dependency without importing any specific + symbols, use _ for local and remote. + + Example: + //go:cgo_import_dynamic _ _ "libc.so.6" + + For compatibility with current versions of SWIG, + #pragma dynimport is an alias for //go:cgo_import_dynamic. + +//go:cgo_dynamic_linker "" + + In internal linking mode, use "" as the dynamic linker + in the final binary. This directive is only needed from one + package when constructing a binary; by convention it is + supplied by runtime/cgo. + + Example: + //go:cgo_dynamic_linker "/lib/ld-linux.so.2" + +//go:cgo_export_dynamic + + In internal linking mode, put the Go symbol + named into the program's exported symbol table as + , so that C code can refer to it by that name. This + mechanism makes it possible for C code to call back into Go or + to share Go's data. + + For compatibility with current versions of SWIG, + #pragma dynexport is an alias for //go:cgo_export_dynamic. + +//go:cgo_import_static + + In external linking mode, allow unresolved references to + in the go.o object file prepared for the host linker, + under the assumption that will be supplied by the + other object files that will be linked with go.o. + + Example: + //go:cgo_import_static puts_wrapper + +//go:cgo_export_static + + In external linking mode, put the Go symbol + named into the program's exported symbol table as + , so that C code can refer to it by that name. This + mechanism makes it possible for C code to call back into Go or + to share Go's data. + +//go:cgo_ldflag "" + + In external linking mode, invoke the host linker (usually gcc) + with "" as a command-line argument following the .o files. + Note that the arguments are for "gcc", not "ld". + + Example: + //go:cgo_ldflag "-lpthread" + //go:cgo_ldflag "-L/usr/local/sqlite3/lib" + +A package compiled with cgo will include directives for both +internal and external linking; the linker will select the appropriate +subset for the chosen linking mode. + +Example + +As a simple example, consider a package that uses cgo to call C.sin. +The following code will be generated by cgo: + + // compiled by 6g + + //go:cgo_ldflag "-lm" + + type _Ctype_double float64 + + //go:cgo_import_static _cgo_gcc_Cfunc_sin + //go:linkname __cgo_gcc_Cfunc_sin _cgo_gcc_Cfunc_sin + var __cgo_gcc_Cfunc_sin byte + var _cgo_gcc_Cfunc_sin = unsafe.Pointer(&__cgo_gcc_Cfunc_sin) + + func _Cfunc_sin(p0 _Ctype_double) (r1 _Ctype_double) { + _cgo_runtime_cgocall(_cgo_gcc_Cfunc_sin, uintptr(unsafe.Pointer(&p0))) + return + } + + // compiled by gcc, into foo.cgo2.o + + void + _cgo_gcc_Cfunc_sin(void *v) + { + struct { + double p0; + double r; + } __attribute__((__packed__)) *a = v; + a->r = sin(a->p0); + } + +What happens at link time depends on whether the final binary is linked +using the internal or external mode. If other packages are compiled in +"external only" mode, then the final link will be an external one. +Otherwise the link will be an internal one. + +The linking directives are used according to the kind of final link +used. + +In internal mode, 6l itself processes all the host object files, in +particular foo.cgo2.o. To do so, it uses the cgo_import_dynamic and +cgo_dynamic_linker directives to learn that the otherwise undefined +reference to sin in foo.cgo2.o should be rewritten to refer to the +symbol sin with version GLIBC_2.2.5 from the dynamic library +"libm.so.6", and the binary should request "/lib/ld-linux.so.2" as its +runtime dynamic linker. + +In external mode, 6l does not process any host object files, in +particular foo.cgo2.o. It links together the 6g-generated object +files, along with any other Go code, into a go.o file. While doing +that, 6l will discover that there is no definition for +_cgo_gcc_Cfunc_sin, referred to by the 6g-compiled source file. This +is okay, because 6l also processes the cgo_import_static directive and +knows that _cgo_gcc_Cfunc_sin is expected to be supplied by a host +object file, so 6l does not treat the missing symbol as an error when +creating go.o. Indeed, the definition for _cgo_gcc_Cfunc_sin will be +provided to the host linker by foo2.cgo.o, which in turn will need the +symbol 'sin'. 6l also processes the cgo_ldflag directives, so that it +knows that the eventual host link command must include the -lm +argument, so that the host linker will be able to find 'sin' in the +math library. + +6l Command Line Interface + +The go command and any other Go-aware build systems invoke 6l +to link a collection of packages into a single binary. By default, 6l will +present the same interface it does today: + + 6l main.a + +produces a file named 6.out, even if 6l does so by invoking the host +linker in external linking mode. + +By default, 6l will decide the linking mode as follows: if the only +packages using cgo are those on a whitelist of standard library +packages (net, os/user, runtime/cgo), 6l will use internal linking +mode. Otherwise, there are non-standard cgo packages involved, and 6l +will use external linking mode. The first rule means that a build of +the godoc binary, which uses net but no other cgo, can run without +needing gcc available. The second rule means that a build of a +cgo-wrapped library like sqlite3 can generate a standalone executable +instead of needing to refer to a dynamic library. The specific choice +can be overridden using a command line flag: 6l -linkmode=internal or +6l -linkmode=external. + +In an external link, 6l will create a temporary directory, write any +host object files found in package archives to that directory (renamed +to avoid conflicts), write the go.o file to that directory, and invoke +the host linker. The default value for the host linker is $CC, split +into fields, or else "gcc". The specific host linker command line can +be overridden using command line flags: 6l -extld=clang +-extldflags='-ggdb -O3'. If any package in a build includes a .cc or +other file compiled by the C++ compiler, the go tool will use the +-extld option to set the host linker to the C++ compiler. + +These defaults mean that Go-aware build systems can ignore the linking +changes and keep running plain '6l' and get reasonable results, but +they can also control the linking details if desired. + +*/ diff --git a/src/cmd/cgo/gcc.go b/src/cmd/cgo/gcc.go new file mode 100644 index 0000000000000000000000000000000000000000..b64849a8d16f37f577cad456b40b8822f4371b6c --- /dev/null +++ b/src/cmd/cgo/gcc.go @@ -0,0 +1,1765 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Annotate Ref in Prog with C types by parsing gcc debug output. +// Conversion of debug output to Go types. + +package main + +import ( + "bytes" + "debug/dwarf" + "debug/elf" + "debug/macho" + "debug/pe" + "encoding/binary" + "errors" + "flag" + "fmt" + "go/ast" + "go/parser" + "go/token" + "os" + "strconv" + "strings" + "unicode" + "unicode/utf8" +) + +var debugDefine = flag.Bool("debug-define", false, "print relevant #defines") +var debugGcc = flag.Bool("debug-gcc", false, "print gcc invocations") + +var nameToC = map[string]string{ + "schar": "signed char", + "uchar": "unsigned char", + "ushort": "unsigned short", + "uint": "unsigned int", + "ulong": "unsigned long", + "longlong": "long long", + "ulonglong": "unsigned long long", + "complexfloat": "float complex", + "complexdouble": "double complex", +} + +// cname returns the C name to use for C.s. +// The expansions are listed in nameToC and also +// struct_foo becomes "struct foo", and similarly for +// union and enum. +func cname(s string) string { + if t, ok := nameToC[s]; ok { + return t + } + + if strings.HasPrefix(s, "struct_") { + return "struct " + s[len("struct_"):] + } + if strings.HasPrefix(s, "union_") { + return "union " + s[len("union_"):] + } + if strings.HasPrefix(s, "enum_") { + return "enum " + s[len("enum_"):] + } + if strings.HasPrefix(s, "sizeof_") { + return "sizeof(" + cname(s[len("sizeof_"):]) + ")" + } + return s +} + +// DiscardCgoDirectives processes the import C preamble, and discards +// all #cgo CFLAGS and LDFLAGS directives, so they don't make their +// way into _cgo_export.h. +func (f *File) DiscardCgoDirectives() { + linesIn := strings.Split(f.Preamble, "\n") + linesOut := make([]string, 0, len(linesIn)) + for _, line := range linesIn { + l := strings.TrimSpace(line) + if len(l) < 5 || l[:4] != "#cgo" || !unicode.IsSpace(rune(l[4])) { + linesOut = append(linesOut, line) + } else { + linesOut = append(linesOut, "") + } + } + f.Preamble = strings.Join(linesOut, "\n") +} + +// addToFlag appends args to flag. All flags are later written out onto the +// _cgo_flags file for the build system to use. +func (p *Package) addToFlag(flag string, args []string) { + p.CgoFlags[flag] = append(p.CgoFlags[flag], args...) + if flag == "CFLAGS" { + // We'll also need these when preprocessing for dwarf information. + p.GccOptions = append(p.GccOptions, args...) + } +} + +// splitQuoted splits the string s around each instance of one or more consecutive +// white space characters while taking into account quotes and escaping, and +// returns an array of substrings of s or an empty list if s contains only white space. +// Single quotes and double quotes are recognized to prevent splitting within the +// quoted region, and are removed from the resulting substrings. If a quote in s +// isn't closed err will be set and r will have the unclosed argument as the +// last element. The backslash is used for escaping. +// +// For example, the following string: +// +// `a b:"c d" 'e''f' "g\""` +// +// Would be parsed as: +// +// []string{"a", "b:c d", "ef", `g"`} +// +func splitQuoted(s string) (r []string, err error) { + var args []string + arg := make([]rune, len(s)) + escaped := false + quoted := false + quote := '\x00' + i := 0 + for _, r := range s { + switch { + case escaped: + escaped = false + case r == '\\': + escaped = true + continue + case quote != 0: + if r == quote { + quote = 0 + continue + } + case r == '"' || r == '\'': + quoted = true + quote = r + continue + case unicode.IsSpace(r): + if quoted || i > 0 { + quoted = false + args = append(args, string(arg[:i])) + i = 0 + } + continue + } + arg[i] = r + i++ + } + if quoted || i > 0 { + args = append(args, string(arg[:i])) + } + if quote != 0 { + err = errors.New("unclosed quote") + } else if escaped { + err = errors.New("unfinished escaping") + } + return args, err +} + +// Translate rewrites f.AST, the original Go input, to remove +// references to the imported package C, replacing them with +// references to the equivalent Go types, functions, and variables. +func (p *Package) Translate(f *File) { + for _, cref := range f.Ref { + // Convert C.ulong to C.unsigned long, etc. + cref.Name.C = cname(cref.Name.Go) + } + p.loadDefines(f) + needType := p.guessKinds(f) + if len(needType) > 0 { + p.loadDWARF(f, needType) + } + p.rewriteRef(f) +} + +// loadDefines coerces gcc into spitting out the #defines in use +// in the file f and saves relevant renamings in f.Name[name].Define. +func (p *Package) loadDefines(f *File) { + var b bytes.Buffer + b.WriteString(f.Preamble) + b.WriteString(builtinProlog) + stdout := p.gccDefines(b.Bytes()) + + for _, line := range strings.Split(stdout, "\n") { + if len(line) < 9 || line[0:7] != "#define" { + continue + } + + line = strings.TrimSpace(line[8:]) + + var key, val string + spaceIndex := strings.Index(line, " ") + tabIndex := strings.Index(line, "\t") + + if spaceIndex == -1 && tabIndex == -1 { + continue + } else if tabIndex == -1 || (spaceIndex != -1 && spaceIndex < tabIndex) { + key = line[0:spaceIndex] + val = strings.TrimSpace(line[spaceIndex:]) + } else { + key = line[0:tabIndex] + val = strings.TrimSpace(line[tabIndex:]) + } + + if key == "__clang__" { + p.GccIsClang = true + } + + if n := f.Name[key]; n != nil { + if *debugDefine { + fmt.Fprintf(os.Stderr, "#define %s %s\n", key, val) + } + n.Define = val + } + } +} + +// guessKinds tricks gcc into revealing the kind of each +// name xxx for the references C.xxx in the Go input. +// The kind is either a constant, type, or variable. +func (p *Package) guessKinds(f *File) []*Name { + // Determine kinds for names we already know about, + // like #defines or 'struct foo', before bothering with gcc. + var names, needType []*Name + for _, key := range nameKeys(f.Name) { + n := f.Name[key] + // If we've already found this name as a #define + // and we can translate it as a constant value, do so. + if n.Define != "" { + isConst := false + if _, err := strconv.Atoi(n.Define); err == nil { + isConst = true + } else if n.Define[0] == '"' || n.Define[0] == '\'' { + if _, err := parser.ParseExpr(n.Define); err == nil { + isConst = true + } + } + if isConst { + n.Kind = "const" + // Turn decimal into hex, just for consistency + // with enum-derived constants. Otherwise + // in the cgo -godefs output half the constants + // are in hex and half are in whatever the #define used. + i, err := strconv.ParseInt(n.Define, 0, 64) + if err == nil { + n.Const = fmt.Sprintf("%#x", i) + } else { + n.Const = n.Define + } + continue + } + + if isName(n.Define) { + n.C = n.Define + } + } + + needType = append(needType, n) + + // If this is a struct, union, or enum type name, no need to guess the kind. + if strings.HasPrefix(n.C, "struct ") || strings.HasPrefix(n.C, "union ") || strings.HasPrefix(n.C, "enum ") { + n.Kind = "type" + continue + } + + // Otherwise, we'll need to find out from gcc. + names = append(names, n) + } + + // Bypass gcc if there's nothing left to find out. + if len(names) == 0 { + return needType + } + + // Coerce gcc into telling us whether each name is a type, a value, or undeclared. + // For names, find out whether they are integer constants. + // We used to look at specific warning or error messages here, but that tied the + // behavior too closely to specific versions of the compilers. + // Instead, arrange that we can infer what we need from only the presence or absence + // of an error on a specific line. + // + // For each name, we generate these lines, where xxx is the index in toSniff plus one. + // + // #line xxx "not-declared" + // void __cgo_f_xxx_1(void) { __typeof__(name) *__cgo_undefined__; } + // #line xxx "not-type" + // void __cgo_f_xxx_2(void) { name *__cgo_undefined__; } + // #line xxx "not-const" + // void __cgo_f_xxx_3(void) { enum { __cgo_undefined__ = (name)*1 }; } + // + // If we see an error at not-declared:xxx, the corresponding name is not declared. + // If we see an error at not-type:xxx, the corresponding name is a type. + // If we see an error at not-const:xxx, the corresponding name is not an integer constant. + // If we see no errors, we assume the name is an expression but not a constant + // (so a variable or a function). + // + // The specific input forms are chosen so that they are valid C syntax regardless of + // whether name denotes a type or an expression. + + var b bytes.Buffer + b.WriteString(f.Preamble) + b.WriteString(builtinProlog) + + for i, n := range names { + fmt.Fprintf(&b, "#line %d \"not-declared\"\n"+ + "void __cgo_f_%d_1(void) { __typeof__(%s) *__cgo_undefined__; }\n"+ + "#line %d \"not-type\"\n"+ + "void __cgo_f_%d_2(void) { %s *__cgo_undefined__; }\n"+ + "#line %d \"not-const\"\n"+ + "void __cgo_f_%d_3(void) { enum { __cgo__undefined__ = (%s)*1 }; }\n", + i+1, i+1, n.C, + i+1, i+1, n.C, + i+1, i+1, n.C) + } + fmt.Fprintf(&b, "#line 1 \"completed\"\n"+ + "int __cgo__1 = __cgo__2;\n") + + stderr := p.gccErrors(b.Bytes()) + if stderr == "" { + fatalf("%s produced no output\non input:\n%s", p.gccBaseCmd()[0], b.Bytes()) + } + + completed := false + sniff := make([]int, len(names)) + const ( + notType = 1 << iota + notConst + notDeclared + ) + for _, line := range strings.Split(stderr, "\n") { + if !strings.Contains(line, ": error:") { + // we only care about errors. + // we tried to turn off warnings on the command line, but one never knows. + continue + } + + c1 := strings.Index(line, ":") + if c1 < 0 { + continue + } + c2 := strings.Index(line[c1+1:], ":") + if c2 < 0 { + continue + } + c2 += c1 + 1 + + filename := line[:c1] + i, _ := strconv.Atoi(line[c1+1 : c2]) + i-- + if i < 0 || i >= len(names) { + continue + } + + switch filename { + case "completed": + // Strictly speaking, there is no guarantee that seeing the error at completed:1 + // (at the end of the file) means we've seen all the errors from earlier in the file, + // but usually it does. Certainly if we don't see the completed:1 error, we did + // not get all the errors we expected. + completed = true + + case "not-declared": + sniff[i] |= notDeclared + case "not-type": + sniff[i] |= notType + case "not-const": + sniff[i] |= notConst + } + } + + if !completed { + fatalf("%s did not produce error at completed:1\non input:\n%s\nfull error output:\n%s", p.gccBaseCmd()[0], b.Bytes(), stderr) + } + + for i, n := range names { + switch sniff[i] { + default: + error_(token.NoPos, "could not determine kind of name for C.%s", fixGo(n.Go)) + case notType: + n.Kind = "const" + case notConst: + n.Kind = "type" + case notConst | notType: + n.Kind = "not-type" + } + } + if nerrors > 0 { + // Check if compiling the preamble by itself causes any errors, + // because the messages we've printed out so far aren't helpful + // to users debugging preamble mistakes. See issue 8442. + preambleErrors := p.gccErrors([]byte(f.Preamble)) + if len(preambleErrors) > 0 { + error_(token.NoPos, "\n%s errors for preamble:\n%s", p.gccBaseCmd()[0], preambleErrors) + } + + fatalf("unresolved names") + } + + needType = append(needType, names...) + return needType +} + +// loadDWARF parses the DWARF debug information generated +// by gcc to learn the details of the constants, variables, and types +// being referred to as C.xxx. +func (p *Package) loadDWARF(f *File, names []*Name) { + // Extract the types from the DWARF section of an object + // from a well-formed C program. Gcc only generates DWARF info + // for symbols in the object file, so it is not enough to print the + // preamble and hope the symbols we care about will be there. + // Instead, emit + // __typeof__(names[i]) *__cgo__i; + // for each entry in names and then dereference the type we + // learn for __cgo__i. + var b bytes.Buffer + b.WriteString(f.Preamble) + b.WriteString(builtinProlog) + for i, n := range names { + fmt.Fprintf(&b, "__typeof__(%s) *__cgo__%d;\n", n.C, i) + if n.Kind == "const" { + fmt.Fprintf(&b, "enum { __cgo_enum__%d = %s };\n", i, n.C) + } + } + + // Apple's LLVM-based gcc does not include the enumeration + // names and values in its DWARF debug output. In case we're + // using such a gcc, create a data block initialized with the values. + // We can read them out of the object file. + fmt.Fprintf(&b, "long long __cgodebug_data[] = {\n") + for _, n := range names { + if n.Kind == "const" { + fmt.Fprintf(&b, "\t%s,\n", n.C) + } else { + fmt.Fprintf(&b, "\t0,\n") + } + } + // for the last entry, we can not use 0, otherwise + // in case all __cgodebug_data is zero initialized, + // LLVM-based gcc will place the it in the __DATA.__common + // zero-filled section (our debug/macho doesn't support + // this) + fmt.Fprintf(&b, "\t1\n") + fmt.Fprintf(&b, "};\n") + + d, bo, debugData := p.gccDebug(b.Bytes()) + enumVal := make([]int64, len(debugData)/8) + for i := range enumVal { + enumVal[i] = int64(bo.Uint64(debugData[i*8:])) + } + + // Scan DWARF info for top-level TagVariable entries with AttrName __cgo__i. + types := make([]dwarf.Type, len(names)) + enums := make([]dwarf.Offset, len(names)) + nameToIndex := make(map[*Name]int) + for i, n := range names { + nameToIndex[n] = i + } + nameToRef := make(map[*Name]*Ref) + for _, ref := range f.Ref { + nameToRef[ref.Name] = ref + } + r := d.Reader() + for { + e, err := r.Next() + if err != nil { + fatalf("reading DWARF entry: %s", err) + } + if e == nil { + break + } + switch e.Tag { + case dwarf.TagEnumerationType: + offset := e.Offset + for { + e, err := r.Next() + if err != nil { + fatalf("reading DWARF entry: %s", err) + } + if e.Tag == 0 { + break + } + if e.Tag == dwarf.TagEnumerator { + entryName := e.Val(dwarf.AttrName).(string) + if strings.HasPrefix(entryName, "__cgo_enum__") { + n, _ := strconv.Atoi(entryName[len("__cgo_enum__"):]) + if 0 <= n && n < len(names) { + enums[n] = offset + } + } + } + } + case dwarf.TagVariable: + name, _ := e.Val(dwarf.AttrName).(string) + typOff, _ := e.Val(dwarf.AttrType).(dwarf.Offset) + if name == "" || typOff == 0 { + fatalf("malformed DWARF TagVariable entry") + } + if !strings.HasPrefix(name, "__cgo__") { + break + } + typ, err := d.Type(typOff) + if err != nil { + fatalf("loading DWARF type: %s", err) + } + t, ok := typ.(*dwarf.PtrType) + if !ok || t == nil { + fatalf("internal error: %s has non-pointer type", name) + } + i, err := strconv.Atoi(name[7:]) + if err != nil { + fatalf("malformed __cgo__ name: %s", name) + } + if enums[i] != 0 { + t, err := d.Type(enums[i]) + if err != nil { + fatalf("loading DWARF type: %s", err) + } + types[i] = t + } else { + types[i] = t.Type + } + } + if e.Tag != dwarf.TagCompileUnit { + r.SkipChildren() + } + } + + // Record types and typedef information. + var conv typeConv + conv.Init(p.PtrSize, p.IntSize) + for i, n := range names { + if types[i] == nil { + continue + } + pos := token.NoPos + if ref, ok := nameToRef[n]; ok { + pos = ref.Pos() + } + f, fok := types[i].(*dwarf.FuncType) + if n.Kind != "type" && fok { + n.Kind = "func" + n.FuncType = conv.FuncType(f, pos) + } else { + n.Type = conv.Type(types[i], pos) + if enums[i] != 0 && n.Type.EnumValues != nil { + k := fmt.Sprintf("__cgo_enum__%d", i) + n.Kind = "const" + n.Const = fmt.Sprintf("%#x", n.Type.EnumValues[k]) + // Remove injected enum to ensure the value will deep-compare + // equally in future loads of the same constant. + delete(n.Type.EnumValues, k) + } + // Prefer debug data over DWARF debug output, if we have it. + if n.Kind == "const" && i < len(enumVal) { + n.Const = fmt.Sprintf("%#x", enumVal[i]) + } + } + conv.FinishType(pos) + } +} + +// mangleName does name mangling to translate names +// from the original Go source files to the names +// used in the final Go files generated by cgo. +func (p *Package) mangleName(n *Name) { + // When using gccgo variables have to be + // exported so that they become global symbols + // that the C code can refer to. + prefix := "_C" + if *gccgo && n.IsVar() { + prefix = "C" + } + n.Mangle = prefix + n.Kind + "_" + n.Go +} + +// rewriteRef rewrites all the C.xxx references in f.AST to refer to the +// Go equivalents, now that we have figured out the meaning of all +// the xxx. In *godefs mode, rewriteRef replaces the names +// with full definitions instead of mangled names. +func (p *Package) rewriteRef(f *File) { + // Keep a list of all the functions, to remove the ones + // only used as expressions and avoid generating bridge + // code for them. + functions := make(map[string]bool) + + // Assign mangled names. + for _, n := range f.Name { + if n.Kind == "not-type" { + n.Kind = "var" + } + if n.Mangle == "" { + p.mangleName(n) + } + if n.Kind == "func" { + functions[n.Go] = false + } + } + + // Now that we have all the name types filled in, + // scan through the Refs to identify the ones that + // are trying to do a ,err call. Also check that + // functions are only used in calls. + for _, r := range f.Ref { + if r.Name.Kind == "const" && r.Name.Const == "" { + error_(r.Pos(), "unable to find value of constant C.%s", fixGo(r.Name.Go)) + } + var expr ast.Expr = ast.NewIdent(r.Name.Mangle) // default + switch r.Context { + case "call", "call2": + if r.Name.Kind != "func" { + if r.Name.Kind == "type" { + r.Context = "type" + expr = r.Name.Type.Go + break + } + error_(r.Pos(), "call of non-function C.%s", fixGo(r.Name.Go)) + break + } + functions[r.Name.Go] = true + if r.Context == "call2" { + if r.Name.Go == "_CMalloc" { + error_(r.Pos(), "no two-result form for C.malloc") + break + } + // Invent new Name for the two-result function. + n := f.Name["2"+r.Name.Go] + if n == nil { + n = new(Name) + *n = *r.Name + n.AddError = true + n.Mangle = "_C2func_" + n.Go + f.Name["2"+r.Name.Go] = n + } + expr = ast.NewIdent(n.Mangle) + r.Name = n + break + } + case "expr": + if r.Name.Kind == "func" { + // Function is being used in an expression, to e.g. pass around a C function pointer. + // Create a new Name for this Ref which causes the variable to be declared in Go land. + fpName := "fp_" + r.Name.Go + name := f.Name[fpName] + if name == nil { + name = &Name{ + Go: fpName, + C: r.Name.C, + Kind: "fpvar", + Type: &Type{Size: p.PtrSize, Align: p.PtrSize, C: c("void*"), Go: ast.NewIdent("unsafe.Pointer")}, + } + p.mangleName(name) + f.Name[fpName] = name + } + r.Name = name + // Rewrite into call to _Cgo_ptr to prevent assignments. The _Cgo_ptr + // function is defined in out.go and simply returns its argument. See + // issue 7757. + expr = &ast.CallExpr{ + Fun: &ast.Ident{NamePos: (*r.Expr).Pos(), Name: "_Cgo_ptr"}, + Args: []ast.Expr{ast.NewIdent(name.Mangle)}, + } + } else if r.Name.Kind == "type" { + // Okay - might be new(T) + expr = r.Name.Type.Go + } else if r.Name.Kind == "var" { + expr = &ast.StarExpr{Star: (*r.Expr).Pos(), X: expr} + } + + case "selector": + if r.Name.Kind == "var" { + expr = &ast.StarExpr{Star: (*r.Expr).Pos(), X: expr} + } else { + error_(r.Pos(), "only C variables allowed in selector expression", fixGo(r.Name.Go)) + } + + case "type": + if r.Name.Kind != "type" { + error_(r.Pos(), "expression C.%s used as type", fixGo(r.Name.Go)) + } else if r.Name.Type == nil { + // Use of C.enum_x, C.struct_x or C.union_x without C definition. + // GCC won't raise an error when using pointers to such unknown types. + error_(r.Pos(), "type C.%s: undefined C type '%s'", fixGo(r.Name.Go), r.Name.C) + } else { + expr = r.Name.Type.Go + } + default: + if r.Name.Kind == "func" { + error_(r.Pos(), "must call C.%s", fixGo(r.Name.Go)) + } + } + if *godefs { + // Substitute definition for mangled type name. + if id, ok := expr.(*ast.Ident); ok { + if t := typedef[id.Name]; t != nil { + expr = t.Go + } + if id.Name == r.Name.Mangle && r.Name.Const != "" { + expr = ast.NewIdent(r.Name.Const) + } + } + } + + // Copy position information from old expr into new expr, + // in case expression being replaced is first on line. + // See golang.org/issue/6563. + pos := (*r.Expr).Pos() + switch x := expr.(type) { + case *ast.Ident: + expr = &ast.Ident{NamePos: pos, Name: x.Name} + } + + *r.Expr = expr + } + + // Remove functions only used as expressions, so their respective + // bridge functions are not generated. + for name, used := range functions { + if !used { + delete(f.Name, name) + } + } +} + +// gccBaseCmd returns the start of the compiler command line. +// It uses $CC if set, or else $GCC, or else the compiler recorded +// during the initial build as defaultCC. +// defaultCC is defined in zdefaultcc.go, written by cmd/dist. +func (p *Package) gccBaseCmd() []string { + // Use $CC if set, since that's what the build uses. + if ret := strings.Fields(os.Getenv("CC")); len(ret) > 0 { + return ret + } + // Try $GCC if set, since that's what we used to use. + if ret := strings.Fields(os.Getenv("GCC")); len(ret) > 0 { + return ret + } + return strings.Fields(defaultCC) +} + +// gccMachine returns the gcc -m flag to use, either "-m32", "-m64" or "-marm". +func (p *Package) gccMachine() []string { + switch goarch { + case "amd64": + return []string{"-m64"} + case "386": + return []string{"-m32"} + case "arm": + return []string{"-marm"} // not thumb + case "s390": + return []string{"-m31"} + case "s390x": + return []string{"-m64"} + } + return nil +} + +func gccTmp() string { + return *objDir + "_cgo_.o" +} + +// gccCmd returns the gcc command line to use for compiling +// the input. +func (p *Package) gccCmd() []string { + c := append(p.gccBaseCmd(), + "-w", // no warnings + "-Wno-error", // warnings are not errors + "-o"+gccTmp(), // write object to tmp + "-gdwarf-2", // generate DWARF v2 debugging symbols + "-c", // do not link + "-xc", // input language is C + ) + if p.GccIsClang { + c = append(c, + "-ferror-limit=0", + // Apple clang version 1.7 (tags/Apple/clang-77) (based on LLVM 2.9svn) + // doesn't have -Wno-unneeded-internal-declaration, so we need yet another + // flag to disable the warning. Yes, really good diagnostics, clang. + "-Wno-unknown-warning-option", + "-Wno-unneeded-internal-declaration", + "-Wno-unused-function", + "-Qunused-arguments", + // Clang embeds prototypes for some builtin functions, + // like malloc and calloc, but all size_t parameters are + // incorrectly typed unsigned long. We work around that + // by disabling the builtin functions (this is safe as + // it won't affect the actual compilation of the C code). + // See: https://golang.org/issue/6506. + "-fno-builtin", + ) + } + + c = append(c, p.GccOptions...) + c = append(c, p.gccMachine()...) + c = append(c, "-") //read input from standard input + return c +} + +// gccDebug runs gcc -gdwarf-2 over the C program stdin and +// returns the corresponding DWARF data and, if present, debug data block. +func (p *Package) gccDebug(stdin []byte) (*dwarf.Data, binary.ByteOrder, []byte) { + runGcc(stdin, p.gccCmd()) + + isDebugData := func(s string) bool { + // Some systems use leading _ to denote non-assembly symbols. + return s == "__cgodebug_data" || s == "___cgodebug_data" + } + + if f, err := macho.Open(gccTmp()); err == nil { + defer f.Close() + d, err := f.DWARF() + if err != nil { + fatalf("cannot load DWARF output from %s: %v", gccTmp(), err) + } + var data []byte + if f.Symtab != nil { + for i := range f.Symtab.Syms { + s := &f.Symtab.Syms[i] + if isDebugData(s.Name) { + // Found it. Now find data section. + if i := int(s.Sect) - 1; 0 <= i && i < len(f.Sections) { + sect := f.Sections[i] + if sect.Addr <= s.Value && s.Value < sect.Addr+sect.Size { + if sdat, err := sect.Data(); err == nil { + data = sdat[s.Value-sect.Addr:] + } + } + } + } + } + } + return d, f.ByteOrder, data + } + + if f, err := elf.Open(gccTmp()); err == nil { + defer f.Close() + d, err := f.DWARF() + if err != nil { + fatalf("cannot load DWARF output from %s: %v", gccTmp(), err) + } + var data []byte + symtab, err := f.Symbols() + if err == nil { + for i := range symtab { + s := &symtab[i] + if isDebugData(s.Name) { + // Found it. Now find data section. + if i := int(s.Section); 0 <= i && i < len(f.Sections) { + sect := f.Sections[i] + if sect.Addr <= s.Value && s.Value < sect.Addr+sect.Size { + if sdat, err := sect.Data(); err == nil { + data = sdat[s.Value-sect.Addr:] + } + } + } + } + } + } + return d, f.ByteOrder, data + } + + if f, err := pe.Open(gccTmp()); err == nil { + defer f.Close() + d, err := f.DWARF() + if err != nil { + fatalf("cannot load DWARF output from %s: %v", gccTmp(), err) + } + var data []byte + for _, s := range f.Symbols { + if isDebugData(s.Name) { + if i := int(s.SectionNumber) - 1; 0 <= i && i < len(f.Sections) { + sect := f.Sections[i] + if s.Value < sect.Size { + if sdat, err := sect.Data(); err == nil { + data = sdat[s.Value:] + } + } + } + } + } + return d, binary.LittleEndian, data + } + + fatalf("cannot parse gcc output %s as ELF, Mach-O, PE object", gccTmp()) + panic("not reached") +} + +// gccDefines runs gcc -E -dM -xc - over the C program stdin +// and returns the corresponding standard output, which is the +// #defines that gcc encountered while processing the input +// and its included files. +func (p *Package) gccDefines(stdin []byte) string { + base := append(p.gccBaseCmd(), "-E", "-dM", "-xc") + base = append(base, p.gccMachine()...) + stdout, _ := runGcc(stdin, append(append(base, p.GccOptions...), "-")) + return stdout +} + +// gccErrors runs gcc over the C program stdin and returns +// the errors that gcc prints. That is, this function expects +// gcc to fail. +func (p *Package) gccErrors(stdin []byte) string { + // TODO(rsc): require failure + args := p.gccCmd() + + if *debugGcc { + fmt.Fprintf(os.Stderr, "$ %s < 0 { + dtype := c.ptrKeys[0] + c.ptrKeys = c.ptrKeys[1:] + + // Note Type might invalidate c.ptrs[dtype]. + t := c.Type(dtype, pos) + for _, ptr := range c.ptrs[dtype] { + ptr.Go.(*ast.StarExpr).X = t.Go + ptr.C.Set("%s*", t.C) + } + c.ptrs[dtype] = nil // retain the map key + } +} + +// Type returns a *Type with the same memory layout as +// dtype when used as the type of a variable or a struct field. +func (c *typeConv) Type(dtype dwarf.Type, pos token.Pos) *Type { + if t, ok := c.m[dtype]; ok { + if t.Go == nil { + fatalf("%s: type conversion loop at %s", lineno(pos), dtype) + } + return t + } + + t := new(Type) + t.Size = dtype.Size() // note: wrong for array of pointers, corrected below + t.Align = -1 + t.C = &TypeRepr{Repr: dtype.Common().Name} + c.m[dtype] = t + + switch dt := dtype.(type) { + default: + fatalf("%s: unexpected type: %s", lineno(pos), dtype) + + case *dwarf.AddrType: + if t.Size != c.ptrSize { + fatalf("%s: unexpected: %d-byte address type - %s", lineno(pos), t.Size, dtype) + } + t.Go = c.uintptr + t.Align = t.Size + + case *dwarf.ArrayType: + if dt.StrideBitSize > 0 { + // Cannot represent bit-sized elements in Go. + t.Go = c.Opaque(t.Size) + break + } + count := dt.Count + if count == -1 { + // Indicates flexible array member, which Go doesn't support. + // Translate to zero-length array instead. + count = 0 + } + sub := c.Type(dt.Type, pos) + t.Align = sub.Align + t.Go = &ast.ArrayType{ + Len: c.intExpr(count), + Elt: sub.Go, + } + // Recalculate t.Size now that we know sub.Size. + t.Size = count * sub.Size + t.C.Set("__typeof__(%s[%d])", sub.C, dt.Count) + + case *dwarf.BoolType: + t.Go = c.bool + t.Align = 1 + + case *dwarf.CharType: + if t.Size != 1 { + fatalf("%s: unexpected: %d-byte char type - %s", lineno(pos), t.Size, dtype) + } + t.Go = c.int8 + t.Align = 1 + + case *dwarf.EnumType: + if t.Align = t.Size; t.Align >= c.ptrSize { + t.Align = c.ptrSize + } + t.C.Set("enum " + dt.EnumName) + signed := 0 + t.EnumValues = make(map[string]int64) + for _, ev := range dt.Val { + t.EnumValues[ev.Name] = ev.Val + if ev.Val < 0 { + signed = signedDelta + } + } + switch t.Size + int64(signed) { + default: + fatalf("%s: unexpected: %d-byte enum type - %s", lineno(pos), t.Size, dtype) + case 1: + t.Go = c.uint8 + case 2: + t.Go = c.uint16 + case 4: + t.Go = c.uint32 + case 8: + t.Go = c.uint64 + case 1 + signedDelta: + t.Go = c.int8 + case 2 + signedDelta: + t.Go = c.int16 + case 4 + signedDelta: + t.Go = c.int32 + case 8 + signedDelta: + t.Go = c.int64 + } + + case *dwarf.FloatType: + switch t.Size { + default: + fatalf("%s: unexpected: %d-byte float type - %s", lineno(pos), t.Size, dtype) + case 4: + t.Go = c.float32 + case 8: + t.Go = c.float64 + } + if t.Align = t.Size; t.Align >= c.ptrSize { + t.Align = c.ptrSize + } + + case *dwarf.ComplexType: + switch t.Size { + default: + fatalf("%s: unexpected: %d-byte complex type - %s", lineno(pos), t.Size, dtype) + case 8: + t.Go = c.complex64 + case 16: + t.Go = c.complex128 + } + if t.Align = t.Size; t.Align >= c.ptrSize { + t.Align = c.ptrSize + } + + case *dwarf.FuncType: + // No attempt at translation: would enable calls + // directly between worlds, but we need to moderate those. + t.Go = c.uintptr + t.Align = c.ptrSize + + case *dwarf.IntType: + if dt.BitSize > 0 { + fatalf("%s: unexpected: %d-bit int type - %s", lineno(pos), dt.BitSize, dtype) + } + switch t.Size { + default: + fatalf("%s: unexpected: %d-byte int type - %s", lineno(pos), t.Size, dtype) + case 1: + t.Go = c.int8 + case 2: + t.Go = c.int16 + case 4: + t.Go = c.int32 + case 8: + t.Go = c.int64 + } + if t.Align = t.Size; t.Align >= c.ptrSize { + t.Align = c.ptrSize + } + + case *dwarf.PtrType: + // Clang doesn't emit DW_AT_byte_size for pointer types. + if t.Size != c.ptrSize && t.Size != -1 { + fatalf("%s: unexpected: %d-byte pointer type - %s", lineno(pos), t.Size, dtype) + } + t.Size = c.ptrSize + t.Align = c.ptrSize + + if _, ok := base(dt.Type).(*dwarf.VoidType); ok { + t.Go = c.goVoidPtr + t.C.Set("void*") + break + } + + // Placeholder initialization; completed in FinishType. + t.Go = &ast.StarExpr{} + t.C.Set("*") + if _, ok := c.ptrs[dt.Type]; !ok { + c.ptrKeys = append(c.ptrKeys, dt.Type) + } + c.ptrs[dt.Type] = append(c.ptrs[dt.Type], t) + + case *dwarf.QualType: + // Ignore qualifier. + t = c.Type(dt.Type, pos) + c.m[dtype] = t + return t + + case *dwarf.StructType: + // Convert to Go struct, being careful about alignment. + // Have to give it a name to simulate C "struct foo" references. + tag := dt.StructName + if dt.ByteSize < 0 && tag == "" { // opaque unnamed struct - should not be possible + break + } + if tag == "" { + tag = "__" + strconv.Itoa(tagGen) + tagGen++ + } else if t.C.Empty() { + t.C.Set(dt.Kind + " " + tag) + } + name := c.Ident("_Ctype_" + dt.Kind + "_" + tag) + t.Go = name // publish before recursive calls + goIdent[name.Name] = name + if dt.ByteSize < 0 { + // Size calculation in c.Struct/c.Opaque will die with size=-1 (unknown), + // so execute the basic things that the struct case would do + // other than try to determine a Go representation. + tt := *t + tt.C = &TypeRepr{"%s %s", []interface{}{dt.Kind, tag}} + tt.Go = c.Ident("struct{}") + typedef[name.Name] = &tt + break + } + switch dt.Kind { + case "class", "union": + t.Go = c.Opaque(t.Size) + if t.C.Empty() { + t.C.Set("__typeof__(unsigned char[%d])", t.Size) + } + t.Align = 1 // TODO: should probably base this on field alignment. + typedef[name.Name] = t + case "struct": + g, csyntax, align := c.Struct(dt, pos) + if t.C.Empty() { + t.C.Set(csyntax) + } + t.Align = align + tt := *t + if tag != "" { + tt.C = &TypeRepr{"struct %s", []interface{}{tag}} + } + tt.Go = g + typedef[name.Name] = &tt + } + + case *dwarf.TypedefType: + // Record typedef for printing. + if dt.Name == "_GoString_" { + // Special C name for Go string type. + // Knows string layout used by compilers: pointer plus length, + // which rounds up to 2 pointers after alignment. + t.Go = c.string + t.Size = c.ptrSize * 2 + t.Align = c.ptrSize + break + } + if dt.Name == "_GoBytes_" { + // Special C name for Go []byte type. + // Knows slice layout used by compilers: pointer, length, cap. + t.Go = c.Ident("[]byte") + t.Size = c.ptrSize + 4 + 4 + t.Align = c.ptrSize + break + } + name := c.Ident("_Ctype_" + dt.Name) + goIdent[name.Name] = name + sub := c.Type(dt.Type, pos) + t.Go = name + t.Size = sub.Size + t.Align = sub.Align + oldType := typedef[name.Name] + if oldType == nil { + tt := *t + tt.Go = sub.Go + typedef[name.Name] = &tt + } + + // If sub.Go.Name is "_Ctype_struct_foo" or "_Ctype_union_foo" or "_Ctype_class_foo", + // use that as the Go form for this typedef too, so that the typedef will be interchangeable + // with the base type. + // In -godefs mode, do this for all typedefs. + if isStructUnionClass(sub.Go) || *godefs { + t.Go = sub.Go + + if isStructUnionClass(sub.Go) { + // Use the typedef name for C code. + typedef[sub.Go.(*ast.Ident).Name].C = t.C + } + + // If we've seen this typedef before, and it + // was an anonymous struct/union/class before + // too, use the old definition. + // TODO: it would be safer to only do this if + // we verify that the types are the same. + if oldType != nil && isStructUnionClass(oldType.Go) { + t.Go = oldType.Go + } + } + + case *dwarf.UcharType: + if t.Size != 1 { + fatalf("%s: unexpected: %d-byte uchar type - %s", lineno(pos), t.Size, dtype) + } + t.Go = c.uint8 + t.Align = 1 + + case *dwarf.UintType: + if dt.BitSize > 0 { + fatalf("%s: unexpected: %d-bit uint type - %s", lineno(pos), dt.BitSize, dtype) + } + switch t.Size { + default: + fatalf("%s: unexpected: %d-byte uint type - %s", lineno(pos), t.Size, dtype) + case 1: + t.Go = c.uint8 + case 2: + t.Go = c.uint16 + case 4: + t.Go = c.uint32 + case 8: + t.Go = c.uint64 + } + if t.Align = t.Size; t.Align >= c.ptrSize { + t.Align = c.ptrSize + } + + case *dwarf.VoidType: + t.Go = c.goVoid + t.C.Set("void") + t.Align = 1 + } + + switch dtype.(type) { + case *dwarf.AddrType, *dwarf.BoolType, *dwarf.CharType, *dwarf.IntType, *dwarf.FloatType, *dwarf.UcharType, *dwarf.UintType: + s := dtype.Common().Name + if s != "" { + if ss, ok := dwarfToName[s]; ok { + s = ss + } + s = strings.Join(strings.Split(s, " "), "") // strip spaces + name := c.Ident("_Ctype_" + s) + tt := *t + typedef[name.Name] = &tt + if !*godefs { + t.Go = name + } + } + } + + if t.Size < 0 { + // Unsized types are [0]byte, unless they're typedefs of other types + // or structs with tags. + // if so, use the name we've already defined. + t.Size = 0 + switch dt := dtype.(type) { + case *dwarf.TypedefType: + // ok + case *dwarf.StructType: + if dt.StructName != "" { + break + } + t.Go = c.Opaque(0) + default: + t.Go = c.Opaque(0) + } + if t.C.Empty() { + t.C.Set("void") + } + } + + if t.C.Empty() { + fatalf("%s: internal error: did not create C name for %s", lineno(pos), dtype) + } + + return t +} + +// isStructUnionClass reports whether the type described by the Go syntax x +// is a struct, union, or class with a tag. +func isStructUnionClass(x ast.Expr) bool { + id, ok := x.(*ast.Ident) + if !ok { + return false + } + name := id.Name + return strings.HasPrefix(name, "_Ctype_struct_") || + strings.HasPrefix(name, "_Ctype_union_") || + strings.HasPrefix(name, "_Ctype_class_") +} + +// FuncArg returns a Go type with the same memory layout as +// dtype when used as the type of a C function argument. +func (c *typeConv) FuncArg(dtype dwarf.Type, pos token.Pos) *Type { + t := c.Type(dtype, pos) + switch dt := dtype.(type) { + case *dwarf.ArrayType: + // Arrays are passed implicitly as pointers in C. + // In Go, we must be explicit. + tr := &TypeRepr{} + tr.Set("%s*", t.C) + return &Type{ + Size: c.ptrSize, + Align: c.ptrSize, + Go: &ast.StarExpr{X: t.Go}, + C: tr, + } + case *dwarf.TypedefType: + // C has much more relaxed rules than Go for + // implicit type conversions. When the parameter + // is type T defined as *X, simulate a little of the + // laxness of C by making the argument *X instead of T. + if ptr, ok := base(dt.Type).(*dwarf.PtrType); ok { + // Unless the typedef happens to point to void* since + // Go has special rules around using unsafe.Pointer. + if _, void := base(ptr.Type).(*dwarf.VoidType); void { + break + } + + t = c.Type(ptr, pos) + if t == nil { + return nil + } + + // Remember the C spelling, in case the struct + // has __attribute__((unavailable)) on it. See issue 2888. + t.Typedef = dt.Name + } + } + return t +} + +// FuncType returns the Go type analogous to dtype. +// There is no guarantee about matching memory layout. +func (c *typeConv) FuncType(dtype *dwarf.FuncType, pos token.Pos) *FuncType { + p := make([]*Type, len(dtype.ParamType)) + gp := make([]*ast.Field, len(dtype.ParamType)) + for i, f := range dtype.ParamType { + // gcc's DWARF generator outputs a single DotDotDotType parameter for + // function pointers that specify no parameters (e.g. void + // (*__cgo_0)()). Treat this special case as void. This case is + // invalid according to ISO C anyway (i.e. void (*__cgo_1)(...) is not + // legal). + if _, ok := f.(*dwarf.DotDotDotType); ok && i == 0 { + p, gp = nil, nil + break + } + p[i] = c.FuncArg(f, pos) + gp[i] = &ast.Field{Type: p[i].Go} + } + var r *Type + var gr []*ast.Field + if _, ok := dtype.ReturnType.(*dwarf.VoidType); ok { + gr = []*ast.Field{{Type: c.goVoid}} + } else if dtype.ReturnType != nil { + r = c.Type(dtype.ReturnType, pos) + gr = []*ast.Field{{Type: r.Go}} + } + return &FuncType{ + Params: p, + Result: r, + Go: &ast.FuncType{ + Params: &ast.FieldList{List: gp}, + Results: &ast.FieldList{List: gr}, + }, + } +} + +// Identifier +func (c *typeConv) Ident(s string) *ast.Ident { + return ast.NewIdent(s) +} + +// Opaque type of n bytes. +func (c *typeConv) Opaque(n int64) ast.Expr { + return &ast.ArrayType{ + Len: c.intExpr(n), + Elt: c.byte, + } +} + +// Expr for integer n. +func (c *typeConv) intExpr(n int64) ast.Expr { + return &ast.BasicLit{ + Kind: token.INT, + Value: strconv.FormatInt(n, 10), + } +} + +// Add padding of given size to fld. +func (c *typeConv) pad(fld []*ast.Field, sizes []int64, size int64) ([]*ast.Field, []int64) { + n := len(fld) + fld = fld[0 : n+1] + fld[n] = &ast.Field{Names: []*ast.Ident{c.Ident("_")}, Type: c.Opaque(size)} + sizes = sizes[0 : n+1] + sizes[n] = size + return fld, sizes +} + +// Struct conversion: return Go and (gc) C syntax for type. +func (c *typeConv) Struct(dt *dwarf.StructType, pos token.Pos) (expr *ast.StructType, csyntax string, align int64) { + // Minimum alignment for a struct is 1 byte. + align = 1 + + var buf bytes.Buffer + buf.WriteString("struct {") + fld := make([]*ast.Field, 0, 2*len(dt.Field)+1) // enough for padding around every field + sizes := make([]int64, 0, 2*len(dt.Field)+1) + off := int64(0) + + // Rename struct fields that happen to be named Go keywords into + // _{keyword}. Create a map from C ident -> Go ident. The Go ident will + // be mangled. Any existing identifier that already has the same name on + // the C-side will cause the Go-mangled version to be prefixed with _. + // (e.g. in a struct with fields '_type' and 'type', the latter would be + // rendered as '__type' in Go). + ident := make(map[string]string) + used := make(map[string]bool) + for _, f := range dt.Field { + ident[f.Name] = f.Name + used[f.Name] = true + } + + if !*godefs { + for cid, goid := range ident { + if token.Lookup(goid).IsKeyword() { + // Avoid keyword + goid = "_" + goid + + // Also avoid existing fields + for _, exist := used[goid]; exist; _, exist = used[goid] { + goid = "_" + goid + } + + used[goid] = true + ident[cid] = goid + } + } + } + + anon := 0 + for _, f := range dt.Field { + if f.ByteOffset > off { + fld, sizes = c.pad(fld, sizes, f.ByteOffset-off) + off = f.ByteOffset + } + + name := f.Name + ft := f.Type + + // In godefs mode, if this field is a C11 + // anonymous union then treat the first field in the + // union as the field in the struct. This handles + // cases like the glibc file; see + // issue 6677. + if *godefs { + if st, ok := f.Type.(*dwarf.StructType); ok && name == "" && st.Kind == "union" && len(st.Field) > 0 && !used[st.Field[0].Name] { + name = st.Field[0].Name + ident[name] = name + ft = st.Field[0].Type + } + } + + // TODO: Handle fields that are anonymous structs by + // promoting the fields of the inner struct. + + t := c.Type(ft, pos) + tgo := t.Go + size := t.Size + talign := t.Align + if f.BitSize > 0 { + if f.BitSize%8 != 0 { + continue + } + size = f.BitSize / 8 + name := tgo.(*ast.Ident).String() + if strings.HasPrefix(name, "int") { + name = "int" + } else { + name = "uint" + } + tgo = ast.NewIdent(name + fmt.Sprint(f.BitSize)) + talign = size + } + + if talign > 0 && f.ByteOffset%talign != 0 { + // Drop misaligned fields, the same way we drop integer bit fields. + // The goal is to make available what can be made available. + // Otherwise one bad and unneeded field in an otherwise okay struct + // makes the whole program not compile. Much of the time these + // structs are in system headers that cannot be corrected. + continue + } + n := len(fld) + fld = fld[0 : n+1] + if name == "" { + name = fmt.Sprintf("anon%d", anon) + anon++ + ident[name] = name + } + fld[n] = &ast.Field{Names: []*ast.Ident{c.Ident(ident[name])}, Type: tgo} + sizes = sizes[0 : n+1] + sizes[n] = size + off += size + buf.WriteString(t.C.String()) + buf.WriteString(" ") + buf.WriteString(name) + buf.WriteString("; ") + if talign > align { + align = talign + } + } + if off < dt.ByteSize { + fld, sizes = c.pad(fld, sizes, dt.ByteSize-off) + off = dt.ByteSize + } + + // If the last field in a non-zero-sized struct is zero-sized + // the compiler is going to pad it by one (see issue 9401). + // We can't permit that, because then the size of the Go + // struct will not be the same as the size of the C struct. + // Our only option in such a case is to remove the field, + // which means that it can not be referenced from Go. + for off > 0 && sizes[len(sizes)-1] == 0 { + n := len(sizes) + fld = fld[0 : n-1] + sizes = sizes[0 : n-1] + } + + if off != dt.ByteSize { + fatalf("%s: struct size calculation error off=%d bytesize=%d", lineno(pos), off, dt.ByteSize) + } + buf.WriteString("}") + csyntax = buf.String() + + if *godefs { + godefsFields(fld) + } + expr = &ast.StructType{Fields: &ast.FieldList{List: fld}} + return +} + +func upper(s string) string { + if s == "" { + return "" + } + r, size := utf8.DecodeRuneInString(s) + if r == '_' { + return "X" + s + } + return string(unicode.ToUpper(r)) + s[size:] +} + +// godefsFields rewrites field names for use in Go or C definitions. +// It strips leading common prefixes (like tv_ in tv_sec, tv_usec) +// converts names to upper case, and rewrites _ into Pad_godefs_n, +// so that all fields are exported. +func godefsFields(fld []*ast.Field) { + prefix := fieldPrefix(fld) + npad := 0 + for _, f := range fld { + for _, n := range f.Names { + if n.Name != prefix { + n.Name = strings.TrimPrefix(n.Name, prefix) + } + if n.Name == "_" { + // Use exported name instead. + n.Name = "Pad_cgo_" + strconv.Itoa(npad) + npad++ + } + n.Name = upper(n.Name) + } + } +} + +// fieldPrefix returns the prefix that should be removed from all the +// field names when generating the C or Go code. For generated +// C, we leave the names as is (tv_sec, tv_usec), since that's what +// people are used to seeing in C. For generated Go code, such as +// package syscall's data structures, we drop a common prefix +// (so sec, usec, which will get turned into Sec, Usec for exporting). +func fieldPrefix(fld []*ast.Field) string { + prefix := "" + for _, f := range fld { + for _, n := range f.Names { + // Ignore field names that don't have the prefix we're + // looking for. It is common in C headers to have fields + // named, say, _pad in an otherwise prefixed header. + // If the struct has 3 fields tv_sec, tv_usec, _pad1, then we + // still want to remove the tv_ prefix. + // The check for "orig_" here handles orig_eax in the + // x86 ptrace register sets, which otherwise have all fields + // with reg_ prefixes. + if strings.HasPrefix(n.Name, "orig_") || strings.HasPrefix(n.Name, "_") { + continue + } + i := strings.Index(n.Name, "_") + if i < 0 { + continue + } + if prefix == "" { + prefix = n.Name[:i+1] + } else if prefix != n.Name[:i+1] { + return "" + } + } + } + return prefix +} diff --git a/src/cmd/cgo/godefs.go b/src/cmd/cgo/godefs.go new file mode 100644 index 0000000000000000000000000000000000000000..1b0ece29ef4895d03aa3ca7d2eb3550c3e16d694 --- /dev/null +++ b/src/cmd/cgo/godefs.go @@ -0,0 +1,127 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +import ( + "bytes" + "fmt" + "go/ast" + "go/printer" + "go/token" + "os" + "strings" +) + +// godefs returns the output for -godefs mode. +func (p *Package) godefs(f *File, srcfile string) string { + var buf bytes.Buffer + + fmt.Fprintf(&buf, "// Created by cgo -godefs - DO NOT EDIT\n") + fmt.Fprintf(&buf, "// %s\n", strings.Join(os.Args, " ")) + fmt.Fprintf(&buf, "\n") + + override := make(map[string]string) + + // Allow source file to specify override mappings. + // For example, the socket data structures refer + // to in_addr and in_addr6 structs but we want to be + // able to treat them as byte arrays, so the godefs + // inputs in package syscall say + // + // // +godefs map struct_in_addr [4]byte + // // +godefs map struct_in_addr6 [16]byte + // + for _, g := range f.Comments { + for _, c := range g.List { + i := strings.Index(c.Text, "+godefs map") + if i < 0 { + continue + } + s := strings.TrimSpace(c.Text[i+len("+godefs map"):]) + i = strings.Index(s, " ") + if i < 0 { + fmt.Fprintf(os.Stderr, "invalid +godefs map comment: %s\n", c.Text) + continue + } + override["_Ctype_"+strings.TrimSpace(s[:i])] = strings.TrimSpace(s[i:]) + } + } + for _, n := range f.Name { + if s := override[n.Go]; s != "" { + override[n.Mangle] = s + } + } + + // Otherwise, if the source file says type T C.whatever, + // use "T" as the mangling of C.whatever, + // except in the definition (handled at end of function). + refName := make(map[*ast.Expr]*Name) + for _, r := range f.Ref { + refName[r.Expr] = r.Name + } + for _, d := range f.AST.Decls { + d, ok := d.(*ast.GenDecl) + if !ok || d.Tok != token.TYPE { + continue + } + for _, s := range d.Specs { + s := s.(*ast.TypeSpec) + n := refName[&s.Type] + if n != nil && n.Mangle != "" { + override[n.Mangle] = s.Name.Name + } + } + } + + // Extend overrides using typedefs: + // If we know that C.xxx should format as T + // and xxx is a typedef for yyy, make C.yyy format as T. + for typ, def := range typedef { + if new := override[typ]; new != "" { + if id, ok := def.Go.(*ast.Ident); ok { + override[id.Name] = new + } + } + } + + // Apply overrides. + for old, new := range override { + if id := goIdent[old]; id != nil { + id.Name = new + } + } + + // Any names still using the _C syntax are not going to compile, + // although in general we don't know whether they all made it + // into the file, so we can't warn here. + // + // The most common case is union types, which begin with + // _Ctype_union and for which typedef[name] is a Go byte + // array of the appropriate size (such as [4]byte). + // Substitute those union types with byte arrays. + for name, id := range goIdent { + if id.Name == name && strings.Contains(name, "_Ctype_union") { + if def := typedef[name]; def != nil { + id.Name = gofmt(def) + } + } + } + + conf.Fprint(&buf, fset, f.AST) + + return buf.String() +} + +var gofmtBuf bytes.Buffer + +// gofmt returns the gofmt-formatted string for an AST node. +func gofmt(n interface{}) string { + gofmtBuf.Reset() + err := printer.Fprint(&gofmtBuf, fset, n) + if err != nil { + return "<" + err.Error() + ">" + } + return gofmtBuf.String() +} diff --git a/src/cmd/cgo/main.go b/src/cmd/cgo/main.go new file mode 100644 index 0000000000000000000000000000000000000000..02d297ce8bd4ba6e33990ea8d5900839ca4008a1 --- /dev/null +++ b/src/cmd/cgo/main.go @@ -0,0 +1,362 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Cgo; see gmp.go for an overview. + +// TODO(rsc): +// Emit correct line number annotations. +// Make gc understand the annotations. + +package main + +import ( + "crypto/md5" + "flag" + "fmt" + "go/ast" + "go/printer" + "go/token" + "io" + "os" + "path/filepath" + "reflect" + "runtime" + "sort" + "strings" +) + +// A Package collects information about the package we're going to write. +type Package struct { + PackageName string // name of package + PackagePath string + PtrSize int64 + IntSize int64 + GccOptions []string + GccIsClang bool + CgoFlags map[string][]string // #cgo flags (CFLAGS, LDFLAGS) + Written map[string]bool + Name map[string]*Name // accumulated Name from Files + ExpFunc []*ExpFunc // accumulated ExpFunc from Files + Decl []ast.Decl + GoFiles []string // list of Go files + GccFiles []string // list of gcc output files + Preamble string // collected preamble for _cgo_export.h +} + +// A File collects information about a single Go input file. +type File struct { + AST *ast.File // parsed AST + Comments []*ast.CommentGroup // comments from file + Package string // Package name + Preamble string // C preamble (doc comment on import "C") + Ref []*Ref // all references to C.xxx in AST + ExpFunc []*ExpFunc // exported functions for this file + Name map[string]*Name // map from Go name to Name +} + +func nameKeys(m map[string]*Name) []string { + var ks []string + for k := range m { + ks = append(ks, k) + } + sort.Strings(ks) + return ks +} + +// A Ref refers to an expression of the form C.xxx in the AST. +type Ref struct { + Name *Name + Expr *ast.Expr + Context string // "type", "expr", "call", or "call2" +} + +func (r *Ref) Pos() token.Pos { + return (*r.Expr).Pos() +} + +// A Name collects information about C.xxx. +type Name struct { + Go string // name used in Go referring to package C + Mangle string // name used in generated Go + C string // name used in C + Define string // #define expansion + Kind string // "const", "type", "var", "fpvar", "func", "not-type" + Type *Type // the type of xxx + FuncType *FuncType + AddError bool + Const string // constant definition +} + +// IsVar reports whether Kind is either "var" or "fpvar" +func (n *Name) IsVar() bool { + return n.Kind == "var" || n.Kind == "fpvar" +} + +// A ExpFunc is an exported function, callable from C. +// Such functions are identified in the Go input file +// by doc comments containing the line //export ExpName +type ExpFunc struct { + Func *ast.FuncDecl + ExpName string // name to use from C + Doc string +} + +// A TypeRepr contains the string representation of a type. +type TypeRepr struct { + Repr string + FormatArgs []interface{} +} + +// A Type collects information about a type in both the C and Go worlds. +type Type struct { + Size int64 + Align int64 + C *TypeRepr + Go ast.Expr + EnumValues map[string]int64 + Typedef string +} + +// A FuncType collects information about a function type in both the C and Go worlds. +type FuncType struct { + Params []*Type + Result *Type + Go *ast.FuncType +} + +func usage() { + fmt.Fprint(os.Stderr, "usage: cgo -- [compiler options] file.go ...\n") + flag.PrintDefaults() + os.Exit(2) +} + +var ptrSizeMap = map[string]int64{ + "386": 4, + "amd64": 8, + "arm": 4, + "arm64": 8, + "ppc64": 8, + "ppc64le": 8, + "s390": 4, + "s390x": 8, +} + +var intSizeMap = map[string]int64{ + "386": 4, + "amd64": 8, + "arm": 4, + "arm64": 8, + "ppc64": 8, + "ppc64le": 8, + "s390": 4, + "s390x": 4, +} + +var cPrefix string + +var fset = token.NewFileSet() + +var dynobj = flag.String("dynimport", "", "if non-empty, print dynamic import data for that file") +var dynout = flag.String("dynout", "", "write -dynimport output to this file") +var dynpackage = flag.String("dynpackage", "main", "set Go package for -dynimport output") +var dynlinker = flag.Bool("dynlinker", false, "record dynamic linker information in -dynimport mode") + +// This flag is for bootstrapping a new Go implementation, +// to generate Go types that match the data layout and +// constant values used in the host's C libraries and system calls. +var godefs = flag.Bool("godefs", false, "for bootstrap: write Go definitions for C file to standard output") + +var objDir = flag.String("objdir", "", "object directory") +var importPath = flag.String("importpath", "", "import path of package being built (for comments in generated files)") +var exportHeader = flag.String("exportheader", "", "where to write export header if any exported functions") + +var gccgo = flag.Bool("gccgo", false, "generate files for use with gccgo") +var gccgoprefix = flag.String("gccgoprefix", "", "-fgo-prefix option used with gccgo") +var gccgopkgpath = flag.String("gccgopkgpath", "", "-fgo-pkgpath option used with gccgo") +var importRuntimeCgo = flag.Bool("import_runtime_cgo", true, "import runtime/cgo in generated code") +var importSyscall = flag.Bool("import_syscall", true, "import syscall in generated code") +var goarch, goos string + +func main() { + flag.Usage = usage + flag.Parse() + + if *dynobj != "" { + // cgo -dynimport is essentially a separate helper command + // built into the cgo binary. It scans a gcc-produced executable + // and dumps information about the imported symbols and the + // imported libraries. The 'go build' rules for cgo prepare an + // appropriate executable and then use its import information + // instead of needing to make the linkers duplicate all the + // specialized knowledge gcc has about where to look for imported + // symbols and which ones to use. + dynimport(*dynobj) + return + } + + if *godefs { + // Generating definitions pulled from header files, + // to be checked into Go repositories. + // Line numbers are just noise. + conf.Mode &^= printer.SourcePos + } + + args := flag.Args() + if len(args) < 1 { + usage() + } + + // Find first arg that looks like a go file and assume everything before + // that are options to pass to gcc. + var i int + for i = len(args); i > 0; i-- { + if !strings.HasSuffix(args[i-1], ".go") { + break + } + } + if i == len(args) { + usage() + } + + goFiles := args[i:] + + p := newPackage(args[:i]) + + // Record CGO_LDFLAGS from the environment for external linking. + if ldflags := os.Getenv("CGO_LDFLAGS"); ldflags != "" { + args, err := splitQuoted(ldflags) + if err != nil { + fatalf("bad CGO_LDFLAGS: %q (%s)", ldflags, err) + } + p.addToFlag("LDFLAGS", args) + } + + // Need a unique prefix for the global C symbols that + // we use to coordinate between gcc and ourselves. + // We already put _cgo_ at the beginning, so the main + // concern is other cgo wrappers for the same functions. + // Use the beginning of the md5 of the input to disambiguate. + h := md5.New() + for _, input := range goFiles { + f, err := os.Open(input) + if err != nil { + fatalf("%s", err) + } + io.Copy(h, f) + f.Close() + } + cPrefix = fmt.Sprintf("_%x", h.Sum(nil)[0:6]) + + fs := make([]*File, len(goFiles)) + for i, input := range goFiles { + f := new(File) + f.ReadGo(input) + f.DiscardCgoDirectives() + fs[i] = f + } + + if *objDir == "" { + // make sure that _obj directory exists, so that we can write + // all the output files there. + os.Mkdir("_obj", 0777) + *objDir = "_obj" + } + *objDir += string(filepath.Separator) + + for i, input := range goFiles { + f := fs[i] + p.Translate(f) + for _, cref := range f.Ref { + switch cref.Context { + case "call", "call2": + if cref.Name.Kind != "type" { + break + } + *cref.Expr = cref.Name.Type.Go + } + } + if nerrors > 0 { + os.Exit(2) + } + pkg := f.Package + if dir := os.Getenv("CGOPKGPATH"); dir != "" { + pkg = filepath.Join(dir, pkg) + } + p.PackagePath = pkg + p.Record(f) + if *godefs { + os.Stdout.WriteString(p.godefs(f, input)) + } else { + p.writeOutput(f, input) + } + } + + if !*godefs { + p.writeDefs() + } + if nerrors > 0 { + os.Exit(2) + } +} + +// newPackage returns a new Package that will invoke +// gcc with the additional arguments specified in args. +func newPackage(args []string) *Package { + goarch = runtime.GOARCH + if s := os.Getenv("GOARCH"); s != "" { + goarch = s + } + goos = runtime.GOOS + if s := os.Getenv("GOOS"); s != "" { + goos = s + } + ptrSize := ptrSizeMap[goarch] + if ptrSize == 0 { + fatalf("unknown ptrSize for $GOARCH %q", goarch) + } + intSize := intSizeMap[goarch] + if intSize == 0 { + fatalf("unknown intSize for $GOARCH %q", goarch) + } + + // Reset locale variables so gcc emits English errors [sic]. + os.Setenv("LANG", "en_US.UTF-8") + os.Setenv("LC_ALL", "C") + + p := &Package{ + PtrSize: ptrSize, + IntSize: intSize, + CgoFlags: make(map[string][]string), + Written: make(map[string]bool), + } + p.addToFlag("CFLAGS", args) + return p +} + +// Record what needs to be recorded about f. +func (p *Package) Record(f *File) { + if p.PackageName == "" { + p.PackageName = f.Package + } else if p.PackageName != f.Package { + error_(token.NoPos, "inconsistent package names: %s, %s", p.PackageName, f.Package) + } + + if p.Name == nil { + p.Name = f.Name + } else { + for k, v := range f.Name { + if p.Name[k] == nil { + p.Name[k] = v + } else if !reflect.DeepEqual(p.Name[k], v) { + error_(token.NoPos, "inconsistent definitions for C.%s", fixGo(k)) + } + } + } + + if f.ExpFunc != nil { + p.ExpFunc = append(p.ExpFunc, f.ExpFunc...) + p.Preamble += "\n" + f.Preamble + } + p.Decl = append(p.Decl, f.AST.Decls...) +} diff --git a/src/cmd/cgo/out.go b/src/cmd/cgo/out.go new file mode 100644 index 0000000000000000000000000000000000000000..90a744196228e1e93c53e97a01984adb64efde02 --- /dev/null +++ b/src/cmd/cgo/out.go @@ -0,0 +1,1419 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +import ( + "bytes" + "debug/elf" + "debug/macho" + "debug/pe" + "fmt" + "go/ast" + "go/printer" + "go/token" + "io" + "os" + "sort" + "strings" +) + +var conf = printer.Config{Mode: printer.SourcePos, Tabwidth: 8} + +// writeDefs creates output files to be compiled by gc and gcc. +func (p *Package) writeDefs() { + var fgo2, fc io.Writer + f := creat(*objDir + "_cgo_gotypes.go") + defer f.Close() + fgo2 = f + if *gccgo { + f := creat(*objDir + "_cgo_defun.c") + defer f.Close() + fc = f + } + fm := creat(*objDir + "_cgo_main.c") + + var gccgoInit bytes.Buffer + + fflg := creat(*objDir + "_cgo_flags") + for k, v := range p.CgoFlags { + fmt.Fprintf(fflg, "_CGO_%s=%s\n", k, strings.Join(v, " ")) + if k == "LDFLAGS" && !*gccgo { + for _, arg := range v { + fmt.Fprintf(fgo2, "//go:cgo_ldflag %q\n", arg) + } + } + } + fflg.Close() + + // Write C main file for using gcc to resolve imports. + fmt.Fprintf(fm, "int main() { return 0; }\n") + if *importRuntimeCgo { + fmt.Fprintf(fm, "void crosscall2(void(*fn)(void*, int), void *a, int c) { }\n") + fmt.Fprintf(fm, "void _cgo_wait_runtime_init_done() { }\n") + fmt.Fprintf(fm, "char* _cgo_topofstack(void) { return (char*)0; }\n") + } else { + // If we're not importing runtime/cgo, we *are* runtime/cgo, + // which provides these functions. We just need a prototype. + fmt.Fprintf(fm, "void crosscall2(void(*fn)(void*, int), void *a, int c);\n") + fmt.Fprintf(fm, "void _cgo_wait_runtime_init_done();\n") + } + fmt.Fprintf(fm, "void _cgo_allocate(void *a, int c) { }\n") + fmt.Fprintf(fm, "void _cgo_panic(void *a, int c) { }\n") + fmt.Fprintf(fm, "void _cgo_reginit(void) { }\n") + + // Write second Go output: definitions of _C_xxx. + // In a separate file so that the import of "unsafe" does not + // pollute the original file. + fmt.Fprintf(fgo2, "// Created by cgo - DO NOT EDIT\n\n") + fmt.Fprintf(fgo2, "package %s\n\n", p.PackageName) + fmt.Fprintf(fgo2, "import \"unsafe\"\n\n") + if !*gccgo && *importRuntimeCgo { + fmt.Fprintf(fgo2, "import _ \"runtime/cgo\"\n\n") + } + if *importSyscall { + fmt.Fprintf(fgo2, "import \"syscall\"\n\n") + fmt.Fprintf(fgo2, "var _ syscall.Errno\n") + } + fmt.Fprintf(fgo2, "func _Cgo_ptr(ptr unsafe.Pointer) unsafe.Pointer { return ptr }\n\n") + + if !*gccgo { + fmt.Fprintf(fgo2, "//go:linkname _Cgo_always_false runtime.cgoAlwaysFalse\n") + fmt.Fprintf(fgo2, "var _Cgo_always_false bool\n") + fmt.Fprintf(fgo2, "//go:linkname _Cgo_use runtime.cgoUse\n") + fmt.Fprintf(fgo2, "func _Cgo_use(interface{})\n") + } + + typedefNames := make([]string, 0, len(typedef)) + for name := range typedef { + typedefNames = append(typedefNames, name) + } + sort.Strings(typedefNames) + for _, name := range typedefNames { + def := typedef[name] + fmt.Fprintf(fgo2, "type %s ", name) + conf.Fprint(fgo2, fset, def.Go) + fmt.Fprintf(fgo2, "\n\n") + } + if *gccgo { + fmt.Fprintf(fgo2, "type _Ctype_void byte\n") + } else { + fmt.Fprintf(fgo2, "type _Ctype_void [0]byte\n") + } + + if *gccgo { + fmt.Fprint(fc, p.cPrologGccgo()) + } else { + fmt.Fprint(fgo2, goProlog) + } + + gccgoSymbolPrefix := p.gccgoSymbolPrefix() + + cVars := make(map[string]bool) + for _, key := range nameKeys(p.Name) { + n := p.Name[key] + if !n.IsVar() { + continue + } + + if !cVars[n.C] { + if *gccgo { + fmt.Fprintf(fc, "extern byte *%s;\n", n.C) + } else { + fmt.Fprintf(fm, "extern char %s[];\n", n.C) + fmt.Fprintf(fm, "void *_cgohack_%s = %s;\n\n", n.C, n.C) + fmt.Fprintf(fgo2, "//go:linkname __cgo_%s %s\n", n.C, n.C) + fmt.Fprintf(fgo2, "//go:cgo_import_static %s\n", n.C) + fmt.Fprintf(fgo2, "var __cgo_%s byte\n", n.C) + } + cVars[n.C] = true + } + + var node ast.Node + if n.Kind == "var" { + node = &ast.StarExpr{X: n.Type.Go} + } else if n.Kind == "fpvar" { + node = n.Type.Go + } else { + panic(fmt.Errorf("invalid var kind %q", n.Kind)) + } + if *gccgo { + fmt.Fprintf(fc, `extern void *%s __asm__("%s.%s");`, n.Mangle, gccgoSymbolPrefix, n.Mangle) + fmt.Fprintf(&gccgoInit, "\t%s = &%s;\n", n.Mangle, n.C) + fmt.Fprintf(fc, "\n") + } + + fmt.Fprintf(fgo2, "var %s ", n.Mangle) + conf.Fprint(fgo2, fset, node) + if !*gccgo { + fmt.Fprintf(fgo2, " = (") + conf.Fprint(fgo2, fset, node) + fmt.Fprintf(fgo2, ")(unsafe.Pointer(&__cgo_%s))", n.C) + } + fmt.Fprintf(fgo2, "\n") + } + if *gccgo { + fmt.Fprintf(fc, "\n") + } + + for _, key := range nameKeys(p.Name) { + n := p.Name[key] + if n.Const != "" { + fmt.Fprintf(fgo2, "const _Cconst_%s = %s\n", n.Go, n.Const) + } + } + fmt.Fprintf(fgo2, "\n") + + for _, key := range nameKeys(p.Name) { + n := p.Name[key] + if n.FuncType != nil { + p.writeDefsFunc(fgo2, n) + } + } + + fgcc := creat(*objDir + "_cgo_export.c") + fgcch := creat(*objDir + "_cgo_export.h") + if *gccgo { + p.writeGccgoExports(fgo2, fm, fgcc, fgcch) + } else { + p.writeExports(fgo2, fm, fgcc, fgcch) + } + if err := fgcc.Close(); err != nil { + fatalf("%s", err) + } + if err := fgcch.Close(); err != nil { + fatalf("%s", err) + } + + if *exportHeader != "" && len(p.ExpFunc) > 0 { + fexp := creat(*exportHeader) + fgcch, err := os.Open(*objDir + "_cgo_export.h") + if err != nil { + fatalf("%s", err) + } + _, err = io.Copy(fexp, fgcch) + if err != nil { + fatalf("%s", err) + } + if err = fexp.Close(); err != nil { + fatalf("%s", err) + } + } + + init := gccgoInit.String() + if init != "" { + fmt.Fprintln(fc, "static void init(void) __attribute__ ((constructor));") + fmt.Fprintln(fc, "static void init(void) {") + fmt.Fprint(fc, init) + fmt.Fprintln(fc, "}") + } +} + +func dynimport(obj string) { + stdout := os.Stdout + if *dynout != "" { + f, err := os.Create(*dynout) + if err != nil { + fatalf("%s", err) + } + stdout = f + } + + fmt.Fprintf(stdout, "package %s\n", *dynpackage) + + if f, err := elf.Open(obj); err == nil { + if *dynlinker { + // Emit the cgo_dynamic_linker line. + if sec := f.Section(".interp"); sec != nil { + if data, err := sec.Data(); err == nil && len(data) > 1 { + // skip trailing \0 in data + fmt.Fprintf(stdout, "//go:cgo_dynamic_linker %q\n", string(data[:len(data)-1])) + } + } + } + sym, err := f.ImportedSymbols() + if err != nil { + fatalf("cannot load imported symbols from ELF file %s: %v", obj, err) + } + for _, s := range sym { + targ := s.Name + if s.Version != "" { + targ += "#" + s.Version + } + fmt.Fprintf(stdout, "//go:cgo_import_dynamic %s %s %q\n", s.Name, targ, s.Library) + } + lib, err := f.ImportedLibraries() + if err != nil { + fatalf("cannot load imported libraries from ELF file %s: %v", obj, err) + } + for _, l := range lib { + fmt.Fprintf(stdout, "//go:cgo_import_dynamic _ _ %q\n", l) + } + return + } + + if f, err := macho.Open(obj); err == nil { + sym, err := f.ImportedSymbols() + if err != nil { + fatalf("cannot load imported symbols from Mach-O file %s: %v", obj, err) + } + for _, s := range sym { + if len(s) > 0 && s[0] == '_' { + s = s[1:] + } + fmt.Fprintf(stdout, "//go:cgo_import_dynamic %s %s %q\n", s, s, "") + } + lib, err := f.ImportedLibraries() + if err != nil { + fatalf("cannot load imported libraries from Mach-O file %s: %v", obj, err) + } + for _, l := range lib { + fmt.Fprintf(stdout, "//go:cgo_import_dynamic _ _ %q\n", l) + } + return + } + + if f, err := pe.Open(obj); err == nil { + sym, err := f.ImportedSymbols() + if err != nil { + fatalf("cannot load imported symbols from PE file %s: %v", obj, err) + } + for _, s := range sym { + ss := strings.Split(s, ":") + name := strings.Split(ss[0], "@")[0] + fmt.Fprintf(stdout, "//go:cgo_import_dynamic %s %s %q\n", name, ss[0], strings.ToLower(ss[1])) + } + return + } + + fatalf("cannot parse %s as ELF, Mach-O or PE", obj) +} + +// Construct a gcc struct matching the gc argument frame. +// Assumes that in gcc, char is 1 byte, short 2 bytes, int 4 bytes, long long 8 bytes. +// These assumptions are checked by the gccProlog. +// Also assumes that gc convention is to word-align the +// input and output parameters. +func (p *Package) structType(n *Name) (string, int64) { + var buf bytes.Buffer + fmt.Fprint(&buf, "struct {\n") + off := int64(0) + for i, t := range n.FuncType.Params { + if off%t.Align != 0 { + pad := t.Align - off%t.Align + fmt.Fprintf(&buf, "\t\tchar __pad%d[%d];\n", off, pad) + off += pad + } + c := t.Typedef + if c == "" { + c = t.C.String() + } + fmt.Fprintf(&buf, "\t\t%s p%d;\n", c, i) + off += t.Size + } + if off%p.PtrSize != 0 { + pad := p.PtrSize - off%p.PtrSize + fmt.Fprintf(&buf, "\t\tchar __pad%d[%d];\n", off, pad) + off += pad + } + if t := n.FuncType.Result; t != nil { + if off%t.Align != 0 { + pad := t.Align - off%t.Align + fmt.Fprintf(&buf, "\t\tchar __pad%d[%d];\n", off, pad) + off += pad + } + qual := "" + if c := t.C.String(); c[len(c)-1] == '*' { + qual = "const " + } + fmt.Fprintf(&buf, "\t\t%s%s r;\n", qual, t.C) + off += t.Size + } + if off%p.PtrSize != 0 { + pad := p.PtrSize - off%p.PtrSize + fmt.Fprintf(&buf, "\t\tchar __pad%d[%d];\n", off, pad) + off += pad + } + if off == 0 { + fmt.Fprintf(&buf, "\t\tchar unused;\n") // avoid empty struct + } + fmt.Fprintf(&buf, "\t}") + return buf.String(), off +} + +func (p *Package) writeDefsFunc(fgo2 io.Writer, n *Name) { + name := n.Go + gtype := n.FuncType.Go + void := gtype.Results == nil || len(gtype.Results.List) == 0 + if n.AddError { + // Add "error" to return type list. + // Type list is known to be 0 or 1 element - it's a C function. + err := &ast.Field{Type: ast.NewIdent("error")} + l := gtype.Results.List + if len(l) == 0 { + l = []*ast.Field{err} + } else { + l = []*ast.Field{l[0], err} + } + t := new(ast.FuncType) + *t = *gtype + t.Results = &ast.FieldList{List: l} + gtype = t + } + + // Go func declaration. + d := &ast.FuncDecl{ + Name: ast.NewIdent(n.Mangle), + Type: gtype, + } + + // Builtins defined in the C prolog. + inProlog := builtinDefs[name] != "" + cname := fmt.Sprintf("_cgo%s%s", cPrefix, n.Mangle) + paramnames := []string(nil) + for i, param := range d.Type.Params.List { + paramName := fmt.Sprintf("p%d", i) + param.Names = []*ast.Ident{ast.NewIdent(paramName)} + paramnames = append(paramnames, paramName) + } + + if *gccgo { + // Gccgo style hooks. + fmt.Fprint(fgo2, "\n") + conf.Fprint(fgo2, fset, d) + fmt.Fprint(fgo2, " {\n") + if !inProlog { + fmt.Fprint(fgo2, "\tdefer syscall.CgocallDone()\n") + fmt.Fprint(fgo2, "\tsyscall.Cgocall()\n") + } + if n.AddError { + fmt.Fprint(fgo2, "\tsyscall.SetErrno(0)\n") + } + fmt.Fprint(fgo2, "\t") + if !void { + fmt.Fprint(fgo2, "r := ") + } + fmt.Fprintf(fgo2, "%s(%s)\n", cname, strings.Join(paramnames, ", ")) + + if n.AddError { + fmt.Fprint(fgo2, "\te := syscall.GetErrno()\n") + fmt.Fprint(fgo2, "\tif e != 0 {\n") + fmt.Fprint(fgo2, "\t\treturn ") + if !void { + fmt.Fprint(fgo2, "r, ") + } + fmt.Fprint(fgo2, "e\n") + fmt.Fprint(fgo2, "\t}\n") + fmt.Fprint(fgo2, "\treturn ") + if !void { + fmt.Fprint(fgo2, "r, ") + } + fmt.Fprint(fgo2, "nil\n") + } else if !void { + fmt.Fprint(fgo2, "\treturn r\n") + } + + fmt.Fprint(fgo2, "}\n") + + // declare the C function. + fmt.Fprintf(fgo2, "//extern %s\n", cname) + d.Name = ast.NewIdent(cname) + if n.AddError { + l := d.Type.Results.List + d.Type.Results.List = l[:len(l)-1] + } + conf.Fprint(fgo2, fset, d) + fmt.Fprint(fgo2, "\n") + + return + } + + if inProlog { + fmt.Fprint(fgo2, builtinDefs[name]) + return + } + + // Wrapper calls into gcc, passing a pointer to the argument frame. + fmt.Fprintf(fgo2, "//go:cgo_import_static %s\n", cname) + fmt.Fprintf(fgo2, "//go:linkname __cgofn_%s %s\n", cname, cname) + fmt.Fprintf(fgo2, "var __cgofn_%s byte\n", cname) + fmt.Fprintf(fgo2, "var %s = unsafe.Pointer(&__cgofn_%s)\n", cname, cname) + + nret := 0 + if !void { + d.Type.Results.List[0].Names = []*ast.Ident{ast.NewIdent("r1")} + nret = 1 + } + if n.AddError { + d.Type.Results.List[nret].Names = []*ast.Ident{ast.NewIdent("r2")} + } + + fmt.Fprint(fgo2, "\n") + conf.Fprint(fgo2, fset, d) + fmt.Fprint(fgo2, " {\n") + + // NOTE: Using uintptr to hide from escape analysis. + arg := "0" + if len(paramnames) > 0 { + arg = "uintptr(unsafe.Pointer(&p0))" + } else if !void { + arg = "uintptr(unsafe.Pointer(&r1))" + } + + prefix := "" + if n.AddError { + prefix = "errno := " + } + fmt.Fprintf(fgo2, "\t%s_cgo_runtime_cgocall(%s, %s)\n", prefix, cname, arg) + if n.AddError { + fmt.Fprintf(fgo2, "\tif errno != 0 { r2 = syscall.Errno(errno) }\n") + } + fmt.Fprintf(fgo2, "\tif _Cgo_always_false {\n") + for i := range d.Type.Params.List { + fmt.Fprintf(fgo2, "\t\t_Cgo_use(p%d)\n", i) + } + fmt.Fprintf(fgo2, "\t}\n") + fmt.Fprintf(fgo2, "\treturn\n") + fmt.Fprintf(fgo2, "}\n") +} + +// writeOutput creates stubs for a specific source file to be compiled by gc +func (p *Package) writeOutput(f *File, srcfile string) { + base := srcfile + if strings.HasSuffix(base, ".go") { + base = base[0 : len(base)-3] + } + base = strings.Map(slashToUnderscore, base) + fgo1 := creat(*objDir + base + ".cgo1.go") + fgcc := creat(*objDir + base + ".cgo2.c") + + p.GoFiles = append(p.GoFiles, base+".cgo1.go") + p.GccFiles = append(p.GccFiles, base+".cgo2.c") + + // Write Go output: Go input with rewrites of C.xxx to _C_xxx. + fmt.Fprintf(fgo1, "// Created by cgo - DO NOT EDIT\n\n") + conf.Fprint(fgo1, fset, f.AST) + + // While we process the vars and funcs, also write gcc output. + // Gcc output starts with the preamble. + fmt.Fprintf(fgcc, "%s\n", f.Preamble) + fmt.Fprintf(fgcc, "%s\n", gccProlog) + + for _, key := range nameKeys(f.Name) { + n := f.Name[key] + if n.FuncType != nil { + p.writeOutputFunc(fgcc, n) + } + } + + fgo1.Close() + fgcc.Close() +} + +// fixGo converts the internal Name.Go field into the name we should show +// to users in error messages. There's only one for now: on input we rewrite +// C.malloc into C._CMalloc, so change it back here. +func fixGo(name string) string { + if name == "_CMalloc" { + return "malloc" + } + return name +} + +var isBuiltin = map[string]bool{ + "_Cfunc_CString": true, + "_Cfunc_GoString": true, + "_Cfunc_GoStringN": true, + "_Cfunc_GoBytes": true, + "_Cfunc__CMalloc": true, +} + +func (p *Package) writeOutputFunc(fgcc *os.File, n *Name) { + name := n.Mangle + if isBuiltin[name] || p.Written[name] { + // The builtins are already defined in the C prolog, and we don't + // want to duplicate function definitions we've already done. + return + } + p.Written[name] = true + + if *gccgo { + p.writeGccgoOutputFunc(fgcc, n) + return + } + + ctype, _ := p.structType(n) + + // Gcc wrapper unpacks the C argument struct + // and calls the actual C function. + if n.AddError { + fmt.Fprintf(fgcc, "int\n") + } else { + fmt.Fprintf(fgcc, "void\n") + } + fmt.Fprintf(fgcc, "_cgo%s%s(void *v)\n", cPrefix, n.Mangle) + fmt.Fprintf(fgcc, "{\n") + if n.AddError { + fmt.Fprintf(fgcc, "\terrno = 0;\n") + } + // We're trying to write a gcc struct that matches gc's layout. + // Use packed attribute to force no padding in this struct in case + // gcc has different packing requirements. + fmt.Fprintf(fgcc, "\t%s %v *a = v;\n", ctype, p.packedAttribute()) + if n.FuncType.Result != nil { + // Save the stack top for use below. + fmt.Fprintf(fgcc, "\tchar *stktop = _cgo_topofstack();\n") + } + fmt.Fprintf(fgcc, "\t") + if t := n.FuncType.Result; t != nil { + fmt.Fprintf(fgcc, "__typeof__(a->r) r = ") + if c := t.C.String(); c[len(c)-1] == '*' { + fmt.Fprint(fgcc, "(__typeof__(a->r)) ") + } + } + fmt.Fprintf(fgcc, "%s(", n.C) + for i, t := range n.FuncType.Params { + if i > 0 { + fmt.Fprintf(fgcc, ", ") + } + // We know the type params are correct, because + // the Go equivalents had good type params. + // However, our version of the type omits the magic + // words const and volatile, which can provoke + // C compiler warnings. Silence them by casting + // all pointers to void*. (Eventually that will produce + // other warnings.) + if c := t.C.String(); c[len(c)-1] == '*' { + fmt.Fprintf(fgcc, "(void*)") + } + fmt.Fprintf(fgcc, "a->p%d", i) + } + fmt.Fprintf(fgcc, ");\n") + if n.FuncType.Result != nil { + // The cgo call may have caused a stack copy (via a callback). + // Adjust the return value pointer appropriately. + fmt.Fprintf(fgcc, "\ta = (void*)((char*)a + (_cgo_topofstack() - stktop));\n") + // Save the return value. + fmt.Fprintf(fgcc, "\ta->r = r;\n") + } + if n.AddError { + fmt.Fprintf(fgcc, "\treturn errno;\n") + } + fmt.Fprintf(fgcc, "}\n") + fmt.Fprintf(fgcc, "\n") +} + +// Write out a wrapper for a function when using gccgo. This is a +// simple wrapper that just calls the real function. We only need a +// wrapper to support static functions in the prologue--without a +// wrapper, we can't refer to the function, since the reference is in +// a different file. +func (p *Package) writeGccgoOutputFunc(fgcc *os.File, n *Name) { + if t := n.FuncType.Result; t != nil { + fmt.Fprintf(fgcc, "%s\n", t.C.String()) + } else { + fmt.Fprintf(fgcc, "void\n") + } + fmt.Fprintf(fgcc, "_cgo%s%s(", cPrefix, n.Mangle) + for i, t := range n.FuncType.Params { + if i > 0 { + fmt.Fprintf(fgcc, ", ") + } + c := t.Typedef + if c == "" { + c = t.C.String() + } + fmt.Fprintf(fgcc, "%s p%d", c, i) + } + fmt.Fprintf(fgcc, ")\n") + fmt.Fprintf(fgcc, "{\n") + fmt.Fprintf(fgcc, "\t") + if t := n.FuncType.Result; t != nil { + fmt.Fprintf(fgcc, "return ") + // Cast to void* to avoid warnings due to omitted qualifiers. + if c := t.C.String(); c[len(c)-1] == '*' { + fmt.Fprintf(fgcc, "(void*)") + } + } + fmt.Fprintf(fgcc, "%s(", n.C) + for i, t := range n.FuncType.Params { + if i > 0 { + fmt.Fprintf(fgcc, ", ") + } + // Cast to void* to avoid warnings due to omitted qualifiers. + if c := t.C.String(); c[len(c)-1] == '*' { + fmt.Fprintf(fgcc, "(void*)") + } + fmt.Fprintf(fgcc, "p%d", i) + } + fmt.Fprintf(fgcc, ");\n") + fmt.Fprintf(fgcc, "}\n") + fmt.Fprintf(fgcc, "\n") +} + +// packedAttribute returns host compiler struct attribute that will be +// used to match gc's struct layout. For example, on 386 Windows, +// gcc wants to 8-align int64s, but gc does not. +// Use __gcc_struct__ to work around http://gcc.gnu.org/PR52991 on x86, +// and https://golang.org/issue/5603. +func (p *Package) packedAttribute() string { + s := "__attribute__((__packed__" + if !p.GccIsClang && (goarch == "amd64" || goarch == "386") { + s += ", __gcc_struct__" + } + return s + "))" +} + +// Write out the various stubs we need to support functions exported +// from Go so that they are callable from C. +func (p *Package) writeExports(fgo2, fm, fgcc, fgcch io.Writer) { + p.writeExportHeader(fgcch) + + fmt.Fprintf(fgcc, "/* Created by cgo - DO NOT EDIT. */\n") + fmt.Fprintf(fgcc, "#include \"_cgo_export.h\"\n\n") + + fmt.Fprintf(fgcc, "extern void crosscall2(void (*fn)(void *, int), void *, int);\n") + fmt.Fprintf(fgcc, "extern void _cgo_wait_runtime_init_done();\n\n") + + for _, exp := range p.ExpFunc { + fn := exp.Func + + // Construct a gcc struct matching the gc argument and + // result frame. The gcc struct will be compiled with + // __attribute__((packed)) so all padding must be accounted + // for explicitly. + ctype := "struct {\n" + off := int64(0) + npad := 0 + if fn.Recv != nil { + t := p.cgoType(fn.Recv.List[0].Type) + ctype += fmt.Sprintf("\t\t%s recv;\n", t.C) + off += t.Size + } + fntype := fn.Type + forFieldList(fntype.Params, + func(i int, atype ast.Expr) { + t := p.cgoType(atype) + if off%t.Align != 0 { + pad := t.Align - off%t.Align + ctype += fmt.Sprintf("\t\tchar __pad%d[%d];\n", npad, pad) + off += pad + npad++ + } + ctype += fmt.Sprintf("\t\t%s p%d;\n", t.C, i) + off += t.Size + }) + if off%p.PtrSize != 0 { + pad := p.PtrSize - off%p.PtrSize + ctype += fmt.Sprintf("\t\tchar __pad%d[%d];\n", npad, pad) + off += pad + npad++ + } + forFieldList(fntype.Results, + func(i int, atype ast.Expr) { + t := p.cgoType(atype) + if off%t.Align != 0 { + pad := t.Align - off%t.Align + ctype += fmt.Sprintf("\t\tchar __pad%d[%d];\n", npad, pad) + off += pad + npad++ + } + ctype += fmt.Sprintf("\t\t%s r%d;\n", t.C, i) + off += t.Size + }) + if off%p.PtrSize != 0 { + pad := p.PtrSize - off%p.PtrSize + ctype += fmt.Sprintf("\t\tchar __pad%d[%d];\n", npad, pad) + off += pad + npad++ + } + if ctype == "struct {\n" { + ctype += "\t\tchar unused;\n" // avoid empty struct + } + ctype += "\t}" + + // Get the return type of the wrapper function + // compiled by gcc. + gccResult := "" + if fntype.Results == nil || len(fntype.Results.List) == 0 { + gccResult = "void" + } else if len(fntype.Results.List) == 1 && len(fntype.Results.List[0].Names) <= 1 { + gccResult = p.cgoType(fntype.Results.List[0].Type).C.String() + } else { + fmt.Fprintf(fgcch, "\n/* Return type for %s */\n", exp.ExpName) + fmt.Fprintf(fgcch, "struct %s_return {\n", exp.ExpName) + forFieldList(fntype.Results, + func(i int, atype ast.Expr) { + fmt.Fprintf(fgcch, "\t%s r%d;\n", p.cgoType(atype).C, i) + }) + fmt.Fprintf(fgcch, "};\n") + gccResult = "struct " + exp.ExpName + "_return" + } + + // Build the wrapper function compiled by gcc. + s := fmt.Sprintf("%s %s(", gccResult, exp.ExpName) + if fn.Recv != nil { + s += p.cgoType(fn.Recv.List[0].Type).C.String() + s += " recv" + } + forFieldList(fntype.Params, + func(i int, atype ast.Expr) { + if i > 0 || fn.Recv != nil { + s += ", " + } + s += fmt.Sprintf("%s p%d", p.cgoType(atype).C, i) + }) + s += ")" + + if len(exp.Doc) > 0 { + fmt.Fprintf(fgcch, "\n%s", exp.Doc) + } + fmt.Fprintf(fgcch, "\nextern %s;\n", s) + + fmt.Fprintf(fgcc, "extern void _cgoexp%s_%s(void *, int);\n", cPrefix, exp.ExpName) + fmt.Fprintf(fgcc, "\n%s\n", s) + fmt.Fprintf(fgcc, "{\n") + fmt.Fprintf(fgcc, "\t_cgo_wait_runtime_init_done();\n") + fmt.Fprintf(fgcc, "\t%s %v a;\n", ctype, p.packedAttribute()) + if gccResult != "void" && (len(fntype.Results.List) > 1 || len(fntype.Results.List[0].Names) > 1) { + fmt.Fprintf(fgcc, "\t%s r;\n", gccResult) + } + if fn.Recv != nil { + fmt.Fprintf(fgcc, "\ta.recv = recv;\n") + } + forFieldList(fntype.Params, + func(i int, atype ast.Expr) { + fmt.Fprintf(fgcc, "\ta.p%d = p%d;\n", i, i) + }) + fmt.Fprintf(fgcc, "\tcrosscall2(_cgoexp%s_%s, &a, %d);\n", cPrefix, exp.ExpName, off) + if gccResult != "void" { + if len(fntype.Results.List) == 1 && len(fntype.Results.List[0].Names) <= 1 { + fmt.Fprintf(fgcc, "\treturn a.r0;\n") + } else { + forFieldList(fntype.Results, + func(i int, atype ast.Expr) { + fmt.Fprintf(fgcc, "\tr.r%d = a.r%d;\n", i, i) + }) + fmt.Fprintf(fgcc, "\treturn r;\n") + } + } + fmt.Fprintf(fgcc, "}\n") + + // Build the wrapper function compiled by gc. + goname := exp.Func.Name.Name + if fn.Recv != nil { + goname = "_cgoexpwrap" + cPrefix + "_" + fn.Recv.List[0].Names[0].Name + "_" + goname + } + fmt.Fprintf(fgo2, "//go:cgo_export_dynamic %s\n", goname) + fmt.Fprintf(fgo2, "//go:linkname _cgoexp%s_%s _cgoexp%s_%s\n", cPrefix, exp.ExpName, cPrefix, exp.ExpName) + fmt.Fprintf(fgo2, "//go:cgo_export_static _cgoexp%s_%s\n", cPrefix, exp.ExpName) + fmt.Fprintf(fgo2, "//go:nosplit\n") // no split stack, so no use of m or g + fmt.Fprintf(fgo2, "//go:norace\n") // must not have race detector calls inserted + fmt.Fprintf(fgo2, "func _cgoexp%s_%s(a unsafe.Pointer, n int32) {", cPrefix, exp.ExpName) + fmt.Fprintf(fgo2, "\tfn := %s\n", goname) + // The indirect here is converting from a Go function pointer to a C function pointer. + fmt.Fprintf(fgo2, "\t_cgo_runtime_cgocallback(**(**unsafe.Pointer)(unsafe.Pointer(&fn)), a, uintptr(n));\n") + fmt.Fprintf(fgo2, "}\n") + + fmt.Fprintf(fm, "int _cgoexp%s_%s;\n", cPrefix, exp.ExpName) + + // Calling a function with a receiver from C requires + // a Go wrapper function. + if fn.Recv != nil { + fmt.Fprintf(fgo2, "func %s(recv ", goname) + conf.Fprint(fgo2, fset, fn.Recv.List[0].Type) + forFieldList(fntype.Params, + func(i int, atype ast.Expr) { + fmt.Fprintf(fgo2, ", p%d ", i) + conf.Fprint(fgo2, fset, atype) + }) + fmt.Fprintf(fgo2, ")") + if gccResult != "void" { + fmt.Fprint(fgo2, " (") + forFieldList(fntype.Results, + func(i int, atype ast.Expr) { + if i > 0 { + fmt.Fprint(fgo2, ", ") + } + conf.Fprint(fgo2, fset, atype) + }) + fmt.Fprint(fgo2, ")") + } + fmt.Fprint(fgo2, " {\n") + fmt.Fprint(fgo2, "\t") + if gccResult != "void" { + fmt.Fprint(fgo2, "return ") + } + fmt.Fprintf(fgo2, "recv.%s(", exp.Func.Name) + forFieldList(fntype.Params, + func(i int, atype ast.Expr) { + if i > 0 { + fmt.Fprint(fgo2, ", ") + } + fmt.Fprintf(fgo2, "p%d", i) + }) + fmt.Fprint(fgo2, ")\n") + fmt.Fprint(fgo2, "}\n") + } + } + + fmt.Fprintf(fgcch, "%s", gccExportHeaderEpilog) +} + +// Write out the C header allowing C code to call exported gccgo functions. +func (p *Package) writeGccgoExports(fgo2, fm, fgcc, fgcch io.Writer) { + gccgoSymbolPrefix := p.gccgoSymbolPrefix() + + p.writeExportHeader(fgcch) + + fmt.Fprintf(fgcc, "/* Created by cgo - DO NOT EDIT. */\n") + fmt.Fprintf(fgcc, "#include \"_cgo_export.h\"\n") + + fmt.Fprintf(fgcc, "%s\n", gccgoExportFileProlog) + + for _, exp := range p.ExpFunc { + fn := exp.Func + fntype := fn.Type + + cdeclBuf := new(bytes.Buffer) + resultCount := 0 + forFieldList(fntype.Results, + func(i int, atype ast.Expr) { resultCount++ }) + switch resultCount { + case 0: + fmt.Fprintf(cdeclBuf, "void") + case 1: + forFieldList(fntype.Results, + func(i int, atype ast.Expr) { + t := p.cgoType(atype) + fmt.Fprintf(cdeclBuf, "%s", t.C) + }) + default: + // Declare a result struct. + fmt.Fprintf(fgcch, "\n/* Return type for %s */\n", exp.ExpName) + fmt.Fprintf(fgcch, "struct %s_result {\n", exp.ExpName) + forFieldList(fntype.Results, + func(i int, atype ast.Expr) { + t := p.cgoType(atype) + fmt.Fprintf(fgcch, "\t%s r%d;\n", t.C, i) + }) + fmt.Fprintf(fgcch, "};\n") + fmt.Fprintf(cdeclBuf, "struct %s_result", exp.ExpName) + } + + cRet := cdeclBuf.String() + + cdeclBuf = new(bytes.Buffer) + fmt.Fprintf(cdeclBuf, "(") + if fn.Recv != nil { + fmt.Fprintf(cdeclBuf, "%s recv", p.cgoType(fn.Recv.List[0].Type).C.String()) + } + // Function parameters. + forFieldList(fntype.Params, + func(i int, atype ast.Expr) { + if i > 0 || fn.Recv != nil { + fmt.Fprintf(cdeclBuf, ", ") + } + t := p.cgoType(atype) + fmt.Fprintf(cdeclBuf, "%s p%d", t.C, i) + }) + fmt.Fprintf(cdeclBuf, ")") + cParams := cdeclBuf.String() + + if len(exp.Doc) > 0 { + fmt.Fprintf(fgcch, "\n%s", exp.Doc) + } + + // We need to use a name that will be exported by the + // Go code; otherwise gccgo will make it static and we + // will not be able to link against it from the C + // code. + goName := "Cgoexp_" + exp.ExpName + fmt.Fprintf(fgcch, `extern %s %s %s __asm__("%s.%s");`, cRet, goName, cParams, gccgoSymbolPrefix, goName) + fmt.Fprint(fgcch, "\n") + + // Use a #define so that the C code that includes + // cgo_export.h will be able to refer to the Go + // function using the expected name. + fmt.Fprintf(fgcch, "#define %s %s\n", exp.ExpName, goName) + + // Use a #undef in _cgo_export.c so that we ignore the + // #define from cgo_export.h, since here we are + // defining the real function. + fmt.Fprintf(fgcc, "#undef %s\n", exp.ExpName) + + fmt.Fprint(fgcc, "\n") + fmt.Fprintf(fgcc, "%s %s %s {\n", cRet, exp.ExpName, cParams) + fmt.Fprintf(fgcc, "\tif(_cgo_wait_runtime_init_done)\n") + fmt.Fprintf(fgcc, "\t\t_cgo_wait_runtime_init_done();\n") + fmt.Fprint(fgcc, "\t") + if resultCount > 0 { + fmt.Fprint(fgcc, "return ") + } + fmt.Fprintf(fgcc, "%s(", goName) + if fn.Recv != nil { + fmt.Fprint(fgcc, "recv") + } + forFieldList(fntype.Params, + func(i int, atype ast.Expr) { + if i > 0 || fn.Recv != nil { + fmt.Fprintf(fgcc, ", ") + } + fmt.Fprintf(fgcc, "p%d", i) + }) + fmt.Fprint(fgcc, ");\n") + fmt.Fprint(fgcc, "}\n") + + // Dummy declaration for _cgo_main.c + fmt.Fprintf(fm, `char %s[1] __asm__("%s.%s");`, goName, gccgoSymbolPrefix, goName) + fmt.Fprint(fm, "\n") + + // For gccgo we use a wrapper function in Go, in order + // to call CgocallBack and CgocallBackDone. + + // This code uses printer.Fprint, not conf.Fprint, + // because we don't want //line comments in the middle + // of the function types. + fmt.Fprint(fgo2, "\n") + fmt.Fprintf(fgo2, "func %s(", goName) + if fn.Recv != nil { + fmt.Fprint(fgo2, "recv ") + printer.Fprint(fgo2, fset, fn.Recv.List[0].Type) + } + forFieldList(fntype.Params, + func(i int, atype ast.Expr) { + if i > 0 || fn.Recv != nil { + fmt.Fprintf(fgo2, ", ") + } + fmt.Fprintf(fgo2, "p%d ", i) + printer.Fprint(fgo2, fset, atype) + }) + fmt.Fprintf(fgo2, ")") + if resultCount > 0 { + fmt.Fprintf(fgo2, " (") + forFieldList(fntype.Results, + func(i int, atype ast.Expr) { + if i > 0 { + fmt.Fprint(fgo2, ", ") + } + printer.Fprint(fgo2, fset, atype) + }) + fmt.Fprint(fgo2, ")") + } + fmt.Fprint(fgo2, " {\n") + fmt.Fprint(fgo2, "\tsyscall.CgocallBack()\n") + fmt.Fprint(fgo2, "\tdefer syscall.CgocallBackDone()\n") + fmt.Fprint(fgo2, "\t") + if resultCount > 0 { + fmt.Fprint(fgo2, "return ") + } + if fn.Recv != nil { + fmt.Fprint(fgo2, "recv.") + } + fmt.Fprintf(fgo2, "%s(", exp.Func.Name) + forFieldList(fntype.Params, + func(i int, atype ast.Expr) { + if i > 0 { + fmt.Fprint(fgo2, ", ") + } + fmt.Fprintf(fgo2, "p%d", i) + }) + fmt.Fprint(fgo2, ")\n") + fmt.Fprint(fgo2, "}\n") + } + + fmt.Fprintf(fgcch, "%s", gccExportHeaderEpilog) +} + +// writeExportHeader writes out the start of the _cgo_export.h file. +func (p *Package) writeExportHeader(fgcch io.Writer) { + fmt.Fprintf(fgcch, "/* Created by \"go tool cgo\" - DO NOT EDIT. */\n\n") + pkg := *importPath + if pkg == "" { + pkg = p.PackagePath + } + fmt.Fprintf(fgcch, "/* package %s */\n\n", pkg) + + fmt.Fprintf(fgcch, "/* Start of preamble from import \"C\" comments. */\n\n") + fmt.Fprintf(fgcch, "%s\n", p.Preamble) + fmt.Fprintf(fgcch, "\n/* End of preamble from import \"C\" comments. */\n\n") + + fmt.Fprintf(fgcch, "%s\n", p.gccExportHeaderProlog()) +} + +// Return the package prefix when using gccgo. +func (p *Package) gccgoSymbolPrefix() string { + if !*gccgo { + return "" + } + + clean := func(r rune) rune { + switch { + case 'A' <= r && r <= 'Z', 'a' <= r && r <= 'z', + '0' <= r && r <= '9': + return r + } + return '_' + } + + if *gccgopkgpath != "" { + return strings.Map(clean, *gccgopkgpath) + } + if *gccgoprefix == "" && p.PackageName == "main" { + return "main" + } + prefix := strings.Map(clean, *gccgoprefix) + if prefix == "" { + prefix = "go" + } + return prefix + "." + p.PackageName +} + +// Call a function for each entry in an ast.FieldList, passing the +// index into the list and the type. +func forFieldList(fl *ast.FieldList, fn func(int, ast.Expr)) { + if fl == nil { + return + } + i := 0 + for _, r := range fl.List { + if r.Names == nil { + fn(i, r.Type) + i++ + } else { + for range r.Names { + fn(i, r.Type) + i++ + } + } + } +} + +func c(repr string, args ...interface{}) *TypeRepr { + return &TypeRepr{repr, args} +} + +// Map predeclared Go types to Type. +var goTypes = map[string]*Type{ + "bool": {Size: 1, Align: 1, C: c("GoUint8")}, + "byte": {Size: 1, Align: 1, C: c("GoUint8")}, + "int": {Size: 0, Align: 0, C: c("GoInt")}, + "uint": {Size: 0, Align: 0, C: c("GoUint")}, + "rune": {Size: 4, Align: 4, C: c("GoInt32")}, + "int8": {Size: 1, Align: 1, C: c("GoInt8")}, + "uint8": {Size: 1, Align: 1, C: c("GoUint8")}, + "int16": {Size: 2, Align: 2, C: c("GoInt16")}, + "uint16": {Size: 2, Align: 2, C: c("GoUint16")}, + "int32": {Size: 4, Align: 4, C: c("GoInt32")}, + "uint32": {Size: 4, Align: 4, C: c("GoUint32")}, + "int64": {Size: 8, Align: 8, C: c("GoInt64")}, + "uint64": {Size: 8, Align: 8, C: c("GoUint64")}, + "float32": {Size: 4, Align: 4, C: c("GoFloat32")}, + "float64": {Size: 8, Align: 8, C: c("GoFloat64")}, + "complex64": {Size: 8, Align: 8, C: c("GoComplex64")}, + "complex128": {Size: 16, Align: 16, C: c("GoComplex128")}, +} + +// Map an ast type to a Type. +func (p *Package) cgoType(e ast.Expr) *Type { + switch t := e.(type) { + case *ast.StarExpr: + x := p.cgoType(t.X) + return &Type{Size: p.PtrSize, Align: p.PtrSize, C: c("%s*", x.C)} + case *ast.ArrayType: + if t.Len == nil { + // Slice: pointer, len, cap. + return &Type{Size: p.PtrSize * 3, Align: p.PtrSize, C: c("GoSlice")} + } + case *ast.StructType: + // TODO + case *ast.FuncType: + return &Type{Size: p.PtrSize, Align: p.PtrSize, C: c("void*")} + case *ast.InterfaceType: + return &Type{Size: 2 * p.PtrSize, Align: p.PtrSize, C: c("GoInterface")} + case *ast.MapType: + return &Type{Size: p.PtrSize, Align: p.PtrSize, C: c("GoMap")} + case *ast.ChanType: + return &Type{Size: p.PtrSize, Align: p.PtrSize, C: c("GoChan")} + case *ast.Ident: + // Look up the type in the top level declarations. + // TODO: Handle types defined within a function. + for _, d := range p.Decl { + gd, ok := d.(*ast.GenDecl) + if !ok || gd.Tok != token.TYPE { + continue + } + for _, spec := range gd.Specs { + ts, ok := spec.(*ast.TypeSpec) + if !ok { + continue + } + if ts.Name.Name == t.Name { + return p.cgoType(ts.Type) + } + } + } + if def := typedef[t.Name]; def != nil { + return def + } + if t.Name == "uintptr" { + return &Type{Size: p.PtrSize, Align: p.PtrSize, C: c("GoUintptr")} + } + if t.Name == "string" { + // The string data is 1 pointer + 1 (pointer-sized) int. + return &Type{Size: 2 * p.PtrSize, Align: p.PtrSize, C: c("GoString")} + } + if t.Name == "error" { + return &Type{Size: 2 * p.PtrSize, Align: p.PtrSize, C: c("GoInterface")} + } + if r, ok := goTypes[t.Name]; ok { + if r.Size == 0 { // int or uint + rr := new(Type) + *rr = *r + rr.Size = p.IntSize + rr.Align = p.IntSize + r = rr + } + if r.Align > p.PtrSize { + r.Align = p.PtrSize + } + return r + } + error_(e.Pos(), "unrecognized Go type %s", t.Name) + return &Type{Size: 4, Align: 4, C: c("int")} + case *ast.SelectorExpr: + id, ok := t.X.(*ast.Ident) + if ok && id.Name == "unsafe" && t.Sel.Name == "Pointer" { + return &Type{Size: p.PtrSize, Align: p.PtrSize, C: c("void*")} + } + } + error_(e.Pos(), "Go type not supported in export: %s", gofmt(e)) + return &Type{Size: 4, Align: 4, C: c("int")} +} + +const gccProlog = ` +// Usual nonsense: if x and y are not equal, the type will be invalid +// (have a negative array count) and an inscrutable error will come +// out of the compiler and hopefully mention "name". +#define __cgo_compile_assert_eq(x, y, name) typedef char name[(x-y)*(x-y)*-2+1]; + +// Check at compile time that the sizes we use match our expectations. +#define __cgo_size_assert(t, n) __cgo_compile_assert_eq(sizeof(t), n, _cgo_sizeof_##t##_is_not_##n) + +__cgo_size_assert(char, 1) +__cgo_size_assert(short, 2) +__cgo_size_assert(int, 4) +typedef long long __cgo_long_long; +__cgo_size_assert(__cgo_long_long, 8) +__cgo_size_assert(float, 4) +__cgo_size_assert(double, 8) + +extern char* _cgo_topofstack(void); + +#include +#include +` + +const builtinProlog = ` +#include /* for ptrdiff_t and size_t below */ + +/* Define intgo when compiling with GCC. */ +typedef ptrdiff_t intgo; + +typedef struct { char *p; intgo n; } _GoString_; +typedef struct { char *p; intgo n; intgo c; } _GoBytes_; +_GoString_ GoString(char *p); +_GoString_ GoStringN(char *p, int l); +_GoBytes_ GoBytes(void *p, int n); +char *CString(_GoString_); +void *_CMalloc(size_t); +` + +const goProlog = ` +//go:linkname _cgo_runtime_cgocall runtime.cgocall +func _cgo_runtime_cgocall(unsafe.Pointer, uintptr) int32 + +//go:linkname _cgo_runtime_cmalloc runtime.cmalloc +func _cgo_runtime_cmalloc(uintptr) unsafe.Pointer + +//go:linkname _cgo_runtime_cgocallback runtime.cgocallback +func _cgo_runtime_cgocallback(unsafe.Pointer, unsafe.Pointer, uintptr) +` + +const goStringDef = ` +//go:linkname _cgo_runtime_gostring runtime.gostring +func _cgo_runtime_gostring(*_Ctype_char) string + +func _Cfunc_GoString(p *_Ctype_char) string { + return _cgo_runtime_gostring(p) +} +` + +const goStringNDef = ` +//go:linkname _cgo_runtime_gostringn runtime.gostringn +func _cgo_runtime_gostringn(*_Ctype_char, int) string + +func _Cfunc_GoStringN(p *_Ctype_char, l _Ctype_int) string { + return _cgo_runtime_gostringn(p, int(l)) +} +` + +const goBytesDef = ` +//go:linkname _cgo_runtime_gobytes runtime.gobytes +func _cgo_runtime_gobytes(unsafe.Pointer, int) []byte + +func _Cfunc_GoBytes(p unsafe.Pointer, l _Ctype_int) []byte { + return _cgo_runtime_gobytes(p, int(l)) +} +` + +const cStringDef = ` +func _Cfunc_CString(s string) *_Ctype_char { + p := _cgo_runtime_cmalloc(uintptr(len(s)+1)) + pp := (*[1<<30]byte)(p) + copy(pp[:], s) + pp[len(s)] = 0 + return (*_Ctype_char)(p) +} +` + +const cMallocDef = ` +func _Cfunc__CMalloc(n _Ctype_size_t) unsafe.Pointer { + return _cgo_runtime_cmalloc(uintptr(n)) +} +` + +var builtinDefs = map[string]string{ + "GoString": goStringDef, + "GoStringN": goStringNDef, + "GoBytes": goBytesDef, + "CString": cStringDef, + "_CMalloc": cMallocDef, +} + +func (p *Package) cPrologGccgo() string { + return strings.Replace(cPrologGccgo, "PREFIX", cPrefix, -1) +} + +const cPrologGccgo = ` +#include +#include +#include + +typedef unsigned char byte; +typedef intptr_t intgo; + +struct __go_string { + const unsigned char *__data; + intgo __length; +}; + +typedef struct __go_open_array { + void* __values; + intgo __count; + intgo __capacity; +} Slice; + +struct __go_string __go_byte_array_to_string(const void* p, intgo len); +struct __go_open_array __go_string_to_byte_array (struct __go_string str); + +const char *_cgoPREFIX_Cfunc_CString(struct __go_string s) { + char *p = malloc(s.__length+1); + memmove(p, s.__data, s.__length); + p[s.__length] = 0; + return p; +} + +struct __go_string _cgoPREFIX_Cfunc_GoString(char *p) { + intgo len = (p != NULL) ? strlen(p) : 0; + return __go_byte_array_to_string(p, len); +} + +struct __go_string _cgoPREFIX_Cfunc_GoStringN(char *p, int32_t n) { + return __go_byte_array_to_string(p, n); +} + +Slice _cgoPREFIX_Cfunc_GoBytes(char *p, int32_t n) { + struct __go_string s = { (const unsigned char *)p, n }; + return __go_string_to_byte_array(s); +} + +extern void runtime_throw(const char *); +void *_cgoPREFIX_Cfunc__CMalloc(size_t n) { + void *p = malloc(n); + if(p == NULL && n == 0) + p = malloc(1); + if(p == NULL) + runtime_throw("runtime: C malloc failed"); + return p; +} +` + +func (p *Package) gccExportHeaderProlog() string { + return strings.Replace(gccExportHeaderProlog, "GOINTBITS", fmt.Sprint(8*p.IntSize), -1) +} + +const gccExportHeaderProlog = ` +/* Start of boilerplate cgo prologue. */ + +#ifndef GO_CGO_PROLOGUE_H +#define GO_CGO_PROLOGUE_H + +typedef signed char GoInt8; +typedef unsigned char GoUint8; +typedef short GoInt16; +typedef unsigned short GoUint16; +typedef int GoInt32; +typedef unsigned int GoUint32; +typedef long long GoInt64; +typedef unsigned long long GoUint64; +typedef GoIntGOINTBITS GoInt; +typedef GoUintGOINTBITS GoUint; +typedef __SIZE_TYPE__ GoUintptr; +typedef float GoFloat32; +typedef double GoFloat64; +typedef __complex float GoComplex64; +typedef __complex double GoComplex128; + +// static assertion to make sure the file is being used on architecture +// at least with matching size of GoInt. +typedef char _check_for_GOINTBITS_bit_pointer_matching_GoInt[sizeof(void*)==GOINTBITS/8 ? 1:-1]; + +typedef struct { char *p; GoInt n; } GoString; +typedef void *GoMap; +typedef void *GoChan; +typedef struct { void *t; void *v; } GoInterface; +typedef struct { void *data; GoInt len; GoInt cap; } GoSlice; + +#endif + +/* End of boilerplate cgo prologue. */ + +#ifdef __cplusplus +extern "C" { +#endif +` + +// gccExportHeaderEpilog goes at the end of the generated header file. +const gccExportHeaderEpilog = ` +#ifdef __cplusplus +} +#endif +` + +// gccgoExportFileProlog is written to the _cgo_export.c file when +// using gccgo. +// We use weak declarations, and test the addresses, so that this code +// works with older versions of gccgo. +const gccgoExportFileProlog = ` +extern _Bool runtime_iscgo __attribute__ ((weak)); + +static void GoInit(void) __attribute__ ((constructor)); +static void GoInit(void) { + if(&runtime_iscgo) + runtime_iscgo = 1; +} + +extern void _cgo_wait_runtime_init_done() __attribute__ ((weak)); +` diff --git a/src/cmd/cgo/util.go b/src/cmd/cgo/util.go new file mode 100644 index 0000000000000000000000000000000000000000..3adb8e87836c21adc289b70711ebfbb326370b81 --- /dev/null +++ b/src/cmd/cgo/util.go @@ -0,0 +1,84 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +import ( + "bytes" + "fmt" + "go/token" + "os" + "os/exec" +) + +// run runs the command argv, feeding in stdin on standard input. +// It returns the output to standard output and standard error. +// ok indicates whether the command exited successfully. +func run(stdin []byte, argv []string) (stdout, stderr []byte, ok bool) { + p := exec.Command(argv[0], argv[1:]...) + p.Stdin = bytes.NewReader(stdin) + var bout, berr bytes.Buffer + p.Stdout = &bout + p.Stderr = &berr + err := p.Run() + if _, ok := err.(*exec.ExitError); err != nil && !ok { + fatalf("%s", err) + } + ok = p.ProcessState.Success() + stdout, stderr = bout.Bytes(), berr.Bytes() + return +} + +func lineno(pos token.Pos) string { + return fset.Position(pos).String() +} + +// Die with an error message. +func fatalf(msg string, args ...interface{}) { + // If we've already printed other errors, they might have + // caused the fatal condition. Assume they're enough. + if nerrors == 0 { + fmt.Fprintf(os.Stderr, msg+"\n", args...) + } + os.Exit(2) +} + +var nerrors int + +func error_(pos token.Pos, msg string, args ...interface{}) { + nerrors++ + if pos.IsValid() { + fmt.Fprintf(os.Stderr, "%s: ", fset.Position(pos).String()) + } + fmt.Fprintf(os.Stderr, msg, args...) + fmt.Fprintf(os.Stderr, "\n") +} + +// isName reports whether s is a valid C identifier +func isName(s string) bool { + for i, v := range s { + if v != '_' && (v < 'A' || v > 'Z') && (v < 'a' || v > 'z') && (v < '0' || v > '9') { + return false + } + if i == 0 && '0' <= v && v <= '9' { + return false + } + } + return s != "" +} + +func creat(name string) *os.File { + f, err := os.Create(name) + if err != nil { + fatalf("%s", err) + } + return f +} + +func slashToUnderscore(c rune) rune { + if c == '/' || c == '\\' || c == ':' { + c = '_' + } + return c +} diff --git a/src/cmd/compile/doc.go b/src/cmd/compile/doc.go new file mode 100644 index 0000000000000000000000000000000000000000..e362657a006de85bc8fb142a02754ba9fdb46b2e --- /dev/null +++ b/src/cmd/compile/doc.go @@ -0,0 +1,127 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +/* +Compile, typically invoked as ``go tool compile,'' compiles a single Go package +comprising the files named on the command line. It then writes a single +object file named for the basename of the first source file with a .o suffix. +The object file can then be combined with other objects into a package archive +or passed directly to the linker (``go tool link''). If invoked with -pack, the compiler +writes an archive directly, bypassing the intermediate object file. + +The generated files contain type information about the symbols exported by +the package and about types used by symbols imported by the package from +other packages. It is therefore not necessary when compiling client C of +package P to read the files of P's dependencies, only the compiled output of P. + +Command Line + +Usage: + + go tool compile [flags] file... + +The specified files must be Go source files and all part of the same package. +The same compiler is used for all target operating systems and architectures. +The GOOS and GOARCH environment variables set the desired target. + +Flags: + + -D path + Set relative path for local imports. + -I dir1 -I dir2 + Search for imported packages in dir1, dir2, etc, + after consulting $GOROOT/pkg/$GOOS_$GOARCH. + -L + Show complete file path in error messages. + -N + Disable optimizations. + -S + Print assembly listing to standard output (code only). + -S -S + Print assembly listing to standard output (code and data). + -V + Print compiler version and exit. + -asmhdr file + Write assembly header to file. + -complete + Assume package has no non-Go components. + -cpuprofile file + Write a CPU profile for the compilation to file. + -dynlink + Allow references to Go symbols in shared libraries (experimental). + -e + Remove the limit on the number of errors reported (default limit is 10). + -h + Halt with a stack trace at the first error detected. + -importmap old=new + Interpret import "old" as import "new" during compilation. + The option may be repeated to add multiple mappings. + -installsuffix suffix + Look for packages in $GOROOT/pkg/$GOOS_$GOARCH_suffix + instead of $GOROOT/pkg/$GOOS_$GOARCH. + -largemodel + Generated code that assumes a large memory model. + -memprofile file + Write memory profile for the compilation to file. + -memprofilerate rate + Set runtime.MemProfileRate for the compilation to rate. + -nolocalimports + Disallow local (relative) imports. + -o file + Write object to file (default file.o or, with -pack, file.a). + -p path + Set expected package import path for the code being compiled, + and diagnose imports that would cause a circular dependency. + -pack + Write a package (archive) file rather than an object file + -race + Compile with race detector enabled. + -u + Disallow importing packages not marked as safe; implies -nolocalimports. + +There are also a number of debugging flags; run the command with no arguments +for a usage message. + +Compiler Directives + +The compiler accepts compiler directives in the form of // comments at the +beginning of a line. To distinguish them from non-directive comments, the directives +require no space between the slashes and the name of the directive. However, since +they are comments, tools unaware of the directive convention or of a particular +directive can skip over a directive like any other comment. + + //line path/to/file:linenumber + +The //line directive specifies that the source line that follows should be recorded +as having come from the given file path and line number. Successive lines are +recorded using increasing line numbers, until the next directive. This directive +typically appears in machine-generated code, so that compilers and debuggers +will show lines in the original input to the generator. + +The //line directive is an historical special case; all other directives are of the form +//go:name, indicating that the directive is defined by the Go toolchain. + + //go:noescape + +The //go:noescape directive specifies that the next declaration in the file, which +must be a func without a body (meaning that it has an implementation not written +in Go) does not allow any of the pointers passed as arguments to escape into the +heap or into the values returned from the function. This information can be used as +during the compiler's escape analysis of Go code calling the function. + + //go:nosplit + +The //go:nosplit directive specifies that the next function declared in the file must +not include a stack overflow check. This is most commonly used by low-level +runtime sources invoked at times when it is unsafe for the calling goroutine to be +preempted. + + //go:linkname localname importpath.name + +The //go:linkname directive instructs the compiler to use ``importpath.name'' as the +object file symbol name for the variable or function declared as ``localname'' in the +source code. Because this directive can subvert the type system and package +modularity, it is only enabled in files that have imported "unsafe". +*/ +package main diff --git a/src/cmd/compile/internal/amd64/cgen.go b/src/cmd/compile/internal/amd64/cgen.go new file mode 100644 index 0000000000000000000000000000000000000000..71f8f8832280e1193b2109a434608a512bf4fddb --- /dev/null +++ b/src/cmd/compile/internal/amd64/cgen.go @@ -0,0 +1,151 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package amd64 + +import ( + "cmd/compile/internal/gc" + "cmd/internal/obj" + "cmd/internal/obj/x86" +) + +func blockcopy(n, ns *gc.Node, osrc, odst, w int64) { + var noddi gc.Node + gc.Nodreg(&noddi, gc.Types[gc.Tptr], x86.REG_DI) + var nodsi gc.Node + gc.Nodreg(&nodsi, gc.Types[gc.Tptr], x86.REG_SI) + + var nodl gc.Node + var nodr gc.Node + if n.Ullman >= ns.Ullman { + gc.Agenr(n, &nodr, &nodsi) + if ns.Op == gc.ONAME { + gc.Gvardef(ns) + } + gc.Agenr(ns, &nodl, &noddi) + } else { + if ns.Op == gc.ONAME { + gc.Gvardef(ns) + } + gc.Agenr(ns, &nodl, &noddi) + gc.Agenr(n, &nodr, &nodsi) + } + + if nodl.Reg != x86.REG_DI { + gmove(&nodl, &noddi) + } + if nodr.Reg != x86.REG_SI { + gmove(&nodr, &nodsi) + } + gc.Regfree(&nodl) + gc.Regfree(&nodr) + + c := w % 8 // bytes + q := w / 8 // quads + + var oldcx gc.Node + var cx gc.Node + savex(x86.REG_CX, &cx, &oldcx, nil, gc.Types[gc.TINT64]) + + // if we are copying forward on the stack and + // the src and dst overlap, then reverse direction + if osrc < odst && odst < osrc+w { + // reverse direction + gins(x86.ASTD, nil, nil) // set direction flag + if c > 0 { + gconreg(addptr, w-1, x86.REG_SI) + gconreg(addptr, w-1, x86.REG_DI) + + gconreg(movptr, c, x86.REG_CX) + gins(x86.AREP, nil, nil) // repeat + gins(x86.AMOVSB, nil, nil) // MOVB *(SI)-,*(DI)- + } + + if q > 0 { + if c > 0 { + gconreg(addptr, -7, x86.REG_SI) + gconreg(addptr, -7, x86.REG_DI) + } else { + gconreg(addptr, w-8, x86.REG_SI) + gconreg(addptr, w-8, x86.REG_DI) + } + + gconreg(movptr, q, x86.REG_CX) + gins(x86.AREP, nil, nil) // repeat + gins(x86.AMOVSQ, nil, nil) // MOVQ *(SI)-,*(DI)- + } + + // we leave with the flag clear + gins(x86.ACLD, nil, nil) + } else { + // normal direction + if q > 128 || (gc.Nacl && q >= 4) { + gconreg(movptr, q, x86.REG_CX) + gins(x86.AREP, nil, nil) // repeat + gins(x86.AMOVSQ, nil, nil) // MOVQ *(SI)+,*(DI)+ + } else if q >= 4 { + p := gins(obj.ADUFFCOPY, nil, nil) + p.To.Type = obj.TYPE_ADDR + p.To.Sym = gc.Linksym(gc.Pkglookup("duffcopy", gc.Runtimepkg)) + + // 14 and 128 = magic constants: see ../../runtime/asm_amd64.s + p.To.Offset = 14 * (128 - q) + } else if !gc.Nacl && c == 0 { + // We don't need the MOVSQ side-effect of updating SI and DI, + // and issuing a sequence of MOVQs directly is faster. + nodsi.Op = gc.OINDREG + + noddi.Op = gc.OINDREG + for q > 0 { + gmove(&nodsi, &cx) // MOVQ x+(SI),CX + gmove(&cx, &noddi) // MOVQ CX,x+(DI) + nodsi.Xoffset += 8 + noddi.Xoffset += 8 + q-- + } + } else { + for q > 0 { + gins(x86.AMOVSQ, nil, nil) // MOVQ *(SI)+,*(DI)+ + q-- + } + } + + // copy the remaining c bytes + if w < 4 || c <= 1 || (odst < osrc && osrc < odst+w) { + for c > 0 { + gins(x86.AMOVSB, nil, nil) // MOVB *(SI)+,*(DI)+ + c-- + } + } else if w < 8 || c <= 4 { + nodsi.Op = gc.OINDREG + noddi.Op = gc.OINDREG + cx.Type = gc.Types[gc.TINT32] + nodsi.Type = gc.Types[gc.TINT32] + noddi.Type = gc.Types[gc.TINT32] + if c > 4 { + nodsi.Xoffset = 0 + noddi.Xoffset = 0 + gmove(&nodsi, &cx) + gmove(&cx, &noddi) + } + + nodsi.Xoffset = c - 4 + noddi.Xoffset = c - 4 + gmove(&nodsi, &cx) + gmove(&cx, &noddi) + } else { + nodsi.Op = gc.OINDREG + noddi.Op = gc.OINDREG + cx.Type = gc.Types[gc.TINT64] + nodsi.Type = gc.Types[gc.TINT64] + noddi.Type = gc.Types[gc.TINT64] + nodsi.Xoffset = c - 8 + noddi.Xoffset = c - 8 + gmove(&nodsi, &cx) + gmove(&cx, &noddi) + } + } + + restx(&cx, &oldcx) +} diff --git a/src/cmd/compile/internal/amd64/galign.go b/src/cmd/compile/internal/amd64/galign.go new file mode 100644 index 0000000000000000000000000000000000000000..79bf94a0752e36cb4b8f1e4a4406b452901aa7dc --- /dev/null +++ b/src/cmd/compile/internal/amd64/galign.go @@ -0,0 +1,129 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package amd64 + +import ( + "cmd/compile/internal/gc" + "cmd/internal/obj" + "cmd/internal/obj/x86" +) + +var ( + thechar int = '6' + thestring string = "amd64" + thelinkarch *obj.LinkArch = &x86.Linkamd64 +) + +func linkarchinit() { + if obj.Getgoarch() == "amd64p32" { + thelinkarch = &x86.Linkamd64p32 + gc.Thearch.Thelinkarch = thelinkarch + thestring = "amd64p32" + gc.Thearch.Thestring = "amd64p32" + } +} + +var MAXWIDTH int64 = 1 << 50 + +var ( + addptr int = x86.AADDQ + movptr int = x86.AMOVQ + leaptr int = x86.ALEAQ + cmpptr int = x86.ACMPQ +) + +/* + * go declares several platform-specific type aliases: + * int, uint, and uintptr + */ +var typedefs = []gc.Typedef{ + gc.Typedef{"int", gc.TINT, gc.TINT64}, + gc.Typedef{"uint", gc.TUINT, gc.TUINT64}, + gc.Typedef{"uintptr", gc.TUINTPTR, gc.TUINT64}, +} + +func betypeinit() { + gc.Widthptr = 8 + gc.Widthint = 8 + gc.Widthreg = 8 + if obj.Getgoarch() == "amd64p32" { + gc.Widthptr = 4 + gc.Widthint = 4 + addptr = x86.AADDL + movptr = x86.AMOVL + leaptr = x86.ALEAL + cmpptr = x86.ACMPL + typedefs[0].Sameas = gc.TINT32 + typedefs[1].Sameas = gc.TUINT32 + typedefs[2].Sameas = gc.TUINT32 + } + + if gc.Ctxt.Flag_dynlink { + gc.Thearch.ReservedRegs = append(gc.Thearch.ReservedRegs, x86.REG_R15) + } +} + +func Main() { + if obj.Getgoos() == "nacl" { + resvd = append(resvd, x86.REG_BP, x86.REG_R15) + } else if obj.Framepointer_enabled != 0 { + resvd = append(resvd, x86.REG_BP) + } + + gc.Thearch.Thechar = thechar + gc.Thearch.Thestring = thestring + gc.Thearch.Thelinkarch = thelinkarch + gc.Thearch.Typedefs = typedefs + gc.Thearch.REGSP = x86.REGSP + gc.Thearch.REGCTXT = x86.REGCTXT + gc.Thearch.REGCALLX = x86.REG_BX + gc.Thearch.REGCALLX2 = x86.REG_AX + gc.Thearch.REGRETURN = x86.REG_AX + gc.Thearch.REGMIN = x86.REG_AX + gc.Thearch.REGMAX = x86.REG_R15 + gc.Thearch.FREGMIN = x86.REG_X0 + gc.Thearch.FREGMAX = x86.REG_X15 + gc.Thearch.MAXWIDTH = MAXWIDTH + gc.Thearch.ReservedRegs = resvd + + gc.Thearch.AddIndex = addindex + gc.Thearch.Betypeinit = betypeinit + gc.Thearch.Cgen_bmul = cgen_bmul + gc.Thearch.Cgen_hmul = cgen_hmul + gc.Thearch.Cgen_shift = cgen_shift + gc.Thearch.Clearfat = clearfat + gc.Thearch.Defframe = defframe + gc.Thearch.Dodiv = dodiv + gc.Thearch.Excise = excise + gc.Thearch.Expandchecks = expandchecks + gc.Thearch.Getg = getg + gc.Thearch.Gins = gins + gc.Thearch.Ginsboolval = ginsboolval + gc.Thearch.Ginscmp = ginscmp + gc.Thearch.Ginscon = ginscon + gc.Thearch.Ginsnop = ginsnop + gc.Thearch.Gmove = gmove + gc.Thearch.Linkarchinit = linkarchinit + gc.Thearch.Peep = peep + gc.Thearch.Proginfo = proginfo + gc.Thearch.Regtyp = regtyp + gc.Thearch.Sameaddr = sameaddr + gc.Thearch.Smallindir = smallindir + gc.Thearch.Stackaddr = stackaddr + gc.Thearch.Blockcopy = blockcopy + gc.Thearch.Sudoaddable = sudoaddable + gc.Thearch.Sudoclean = sudoclean + gc.Thearch.Excludedregs = excludedregs + gc.Thearch.RtoB = RtoB + gc.Thearch.FtoB = FtoB + gc.Thearch.BtoR = BtoR + gc.Thearch.BtoF = BtoF + gc.Thearch.Optoas = optoas + gc.Thearch.Doregbits = doregbits + gc.Thearch.Regnames = regnames + + gc.Main() + gc.Exit(0) +} diff --git a/src/cmd/compile/internal/amd64/ggen.go b/src/cmd/compile/internal/amd64/ggen.go new file mode 100644 index 0000000000000000000000000000000000000000..65cf6947bed6db24ae4a934b1ddd40c4c07384aa --- /dev/null +++ b/src/cmd/compile/internal/amd64/ggen.go @@ -0,0 +1,743 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package amd64 + +import ( + "cmd/compile/internal/gc" + "cmd/internal/obj" + "cmd/internal/obj/x86" +) + +func defframe(ptxt *obj.Prog) { + var n *gc.Node + + // fill in argument size, stack size + ptxt.To.Type = obj.TYPE_TEXTSIZE + + ptxt.To.Val = int32(gc.Rnd(gc.Curfn.Type.Argwid, int64(gc.Widthptr))) + frame := uint32(gc.Rnd(gc.Stksize+gc.Maxarg, int64(gc.Widthreg))) + ptxt.To.Offset = int64(frame) + + // insert code to zero ambiguously live variables + // so that the garbage collector only sees initialized values + // when it looks for pointers. + p := ptxt + + hi := int64(0) + lo := hi + ax := uint32(0) + + // iterate through declarations - they are sorted in decreasing xoffset order. + for l := gc.Curfn.Func.Dcl; l != nil; l = l.Next { + n = l.N + if !n.Name.Needzero { + continue + } + if n.Class != gc.PAUTO { + gc.Fatal("needzero class %d", n.Class) + } + if n.Type.Width%int64(gc.Widthptr) != 0 || n.Xoffset%int64(gc.Widthptr) != 0 || n.Type.Width == 0 { + gc.Fatal("var %v has size %d offset %d", gc.Nconv(n, obj.FmtLong), int(n.Type.Width), int(n.Xoffset)) + } + + if lo != hi && n.Xoffset+n.Type.Width >= lo-int64(2*gc.Widthreg) { + // merge with range we already have + lo = n.Xoffset + + continue + } + + // zero old range + p = zerorange(p, int64(frame), lo, hi, &ax) + + // set new range + hi = n.Xoffset + n.Type.Width + + lo = n.Xoffset + } + + // zero final range + zerorange(p, int64(frame), lo, hi, &ax) +} + +// DUFFZERO consists of repeated blocks of 4 MOVs + ADD, +// with 4 STOSQs at the very end. +// The trailing STOSQs prevent the need for a DI preadjustment +// for small numbers of words to clear. +// See runtime/mkduff.go. +const ( + dzBlocks = 31 // number of MOV/ADD blocks + dzBlockLen = 4 // number of clears per block + dzBlockSize = 19 // size of instructions in a single block + dzMovSize = 4 // size of single MOV instruction w/ offset + dzAddSize = 4 // size of single ADD instruction + dzDIStep = 8 // number of bytes cleared by each MOV instruction + + dzTailLen = 4 // number of final STOSQ instructions + dzTailSize = 2 // size of single STOSQ instruction + + dzSize = dzBlocks*dzBlockSize + dzTailLen*dzTailSize // total size of DUFFZERO routine +) + +// duffzeroDI returns the pre-adjustment to DI for a call to DUFFZERO. +// q is the number of words to zero. +func dzDI(q int64) int64 { + if q < dzTailLen { + return 0 + } + q -= dzTailLen + if q%dzBlockLen == 0 { + return 0 + } + return -dzDIStep * (dzBlockLen - q%dzBlockLen) +} + +// dzOff returns the offset for a jump into DUFFZERO. +// q is the number of words to zero. +func dzOff(q int64) int64 { + off := int64(dzSize) + if q < dzTailLen { + return off - q*dzTailSize + } + off -= dzTailLen * dzTailSize + q -= dzTailLen + blocks, steps := q/dzBlockLen, q%dzBlockLen + off -= dzBlockSize * blocks + if steps > 0 { + off -= dzAddSize + dzMovSize*steps + } + return off +} + +func zerorange(p *obj.Prog, frame int64, lo int64, hi int64, ax *uint32) *obj.Prog { + cnt := hi - lo + if cnt == 0 { + return p + } + if *ax == 0 { + p = appendpp(p, x86.AMOVQ, obj.TYPE_CONST, 0, 0, obj.TYPE_REG, x86.REG_AX, 0) + *ax = 1 + } + + if cnt%int64(gc.Widthreg) != 0 { + // should only happen with nacl + if cnt%int64(gc.Widthptr) != 0 { + gc.Fatal("zerorange count not a multiple of widthptr %d", cnt) + } + p = appendpp(p, x86.AMOVL, obj.TYPE_REG, x86.REG_AX, 0, obj.TYPE_MEM, x86.REG_SP, frame+lo) + lo += int64(gc.Widthptr) + cnt -= int64(gc.Widthptr) + } + + if cnt <= int64(4*gc.Widthreg) { + for i := int64(0); i < cnt; i += int64(gc.Widthreg) { + p = appendpp(p, x86.AMOVQ, obj.TYPE_REG, x86.REG_AX, 0, obj.TYPE_MEM, x86.REG_SP, frame+lo+i) + } + } else if !gc.Nacl && (cnt <= int64(128*gc.Widthreg)) { + q := cnt / int64(gc.Widthreg) + p = appendpp(p, leaptr, obj.TYPE_MEM, x86.REG_SP, frame+lo+dzDI(q), obj.TYPE_REG, x86.REG_DI, 0) + p = appendpp(p, obj.ADUFFZERO, obj.TYPE_NONE, 0, 0, obj.TYPE_ADDR, 0, dzOff(q)) + p.To.Sym = gc.Linksym(gc.Pkglookup("duffzero", gc.Runtimepkg)) + } else { + p = appendpp(p, x86.AMOVQ, obj.TYPE_CONST, 0, cnt/int64(gc.Widthreg), obj.TYPE_REG, x86.REG_CX, 0) + p = appendpp(p, leaptr, obj.TYPE_MEM, x86.REG_SP, frame+lo, obj.TYPE_REG, x86.REG_DI, 0) + p = appendpp(p, x86.AREP, obj.TYPE_NONE, 0, 0, obj.TYPE_NONE, 0, 0) + p = appendpp(p, x86.ASTOSQ, obj.TYPE_NONE, 0, 0, obj.TYPE_NONE, 0, 0) + } + + return p +} + +func appendpp(p *obj.Prog, as int, ftype int, freg int, foffset int64, ttype int, treg int, toffset int64) *obj.Prog { + q := gc.Ctxt.NewProg() + gc.Clearp(q) + q.As = int16(as) + q.Lineno = p.Lineno + q.From.Type = int16(ftype) + q.From.Reg = int16(freg) + q.From.Offset = foffset + q.To.Type = int16(ttype) + q.To.Reg = int16(treg) + q.To.Offset = toffset + q.Link = p.Link + p.Link = q + return q +} + +var panicdiv *gc.Node + +/* + * generate division. + * generates one of: + * res = nl / nr + * res = nl % nr + * according to op. + */ +func dodiv(op int, nl *gc.Node, nr *gc.Node, res *gc.Node) { + // Have to be careful about handling + // most negative int divided by -1 correctly. + // The hardware will trap. + // Also the byte divide instruction needs AH, + // which we otherwise don't have to deal with. + // Easiest way to avoid for int8, int16: use int32. + // For int32 and int64, use explicit test. + // Could use int64 hw for int32. + t := nl.Type + + t0 := t + check := 0 + if gc.Issigned[t.Etype] { + check = 1 + if gc.Isconst(nl, gc.CTINT) && nl.Int() != -(1<= nr.Ullman { + savex(x86.REG_AX, &ax, &oldax, res, t0) + gc.Cgen(nl, &ax) + gc.Regalloc(&ax, t0, &ax) // mark ax live during cgen + gc.Cgen(nr, &n3) + gc.Regfree(&ax) + } else { + gc.Cgen(nr, &n3) + savex(x86.REG_AX, &ax, &oldax, res, t0) + gc.Cgen(nl, &ax) + } + + if t != t0 { + // Convert + ax1 := ax + + n31 := n3 + ax.Type = t + n3.Type = t + gmove(&ax1, &ax) + gmove(&n31, &n3) + } + + var n4 gc.Node + if gc.Nacl { + // Native Client does not relay the divide-by-zero trap + // to the executing program, so we must insert a check + // for ourselves. + gc.Nodconst(&n4, t, 0) + + gins(optoas(gc.OCMP, t), &n3, &n4) + p1 := gc.Gbranch(optoas(gc.ONE, t), nil, +1) + if panicdiv == nil { + panicdiv = gc.Sysfunc("panicdivide") + } + gc.Ginscall(panicdiv, -1) + gc.Patch(p1, gc.Pc) + } + + var p2 *obj.Prog + if check != 0 { + gc.Nodconst(&n4, t, -1) + gins(optoas(gc.OCMP, t), &n3, &n4) + p1 := gc.Gbranch(optoas(gc.ONE, t), nil, +1) + if op == gc.ODIV { + // a / (-1) is -a. + gins(optoas(gc.OMINUS, t), nil, &ax) + + gmove(&ax, res) + } else { + // a % (-1) is 0. + gc.Nodconst(&n4, t, 0) + + gmove(&n4, res) + } + + p2 = gc.Gbranch(obj.AJMP, nil, 0) + gc.Patch(p1, gc.Pc) + } + + var olddx gc.Node + var dx gc.Node + savex(x86.REG_DX, &dx, &olddx, res, t) + if !gc.Issigned[t.Etype] { + gc.Nodconst(&n4, t, 0) + gmove(&n4, &dx) + } else { + gins(optoas(gc.OEXTEND, t), nil, nil) + } + gins(a, &n3, nil) + gc.Regfree(&n3) + if op == gc.ODIV { + gmove(&ax, res) + } else { + gmove(&dx, res) + } + restx(&dx, &olddx) + if check != 0 { + gc.Patch(p2, gc.Pc) + } + restx(&ax, &oldax) +} + +/* + * register dr is one of the special ones (AX, CX, DI, SI, etc.). + * we need to use it. if it is already allocated as a temporary + * (r > 1; can only happen if a routine like sgen passed a + * special as cgen's res and then cgen used regalloc to reuse + * it as its own temporary), then move it for now to another + * register. caller must call restx to move it back. + * the move is not necessary if dr == res, because res is + * known to be dead. + */ +func savex(dr int, x *gc.Node, oldx *gc.Node, res *gc.Node, t *gc.Type) { + r := uint8(gc.GetReg(dr)) + + // save current ax and dx if they are live + // and not the destination + *oldx = gc.Node{} + + gc.Nodreg(x, t, dr) + if r > 1 && !gc.Samereg(x, res) { + gc.Regalloc(oldx, gc.Types[gc.TINT64], nil) + x.Type = gc.Types[gc.TINT64] + gmove(x, oldx) + x.Type = t + oldx.Etype = r // squirrel away old r value + gc.SetReg(dr, 1) + } +} + +func restx(x *gc.Node, oldx *gc.Node) { + if oldx.Op != 0 { + x.Type = gc.Types[gc.TINT64] + gc.SetReg(int(x.Reg), int(oldx.Etype)) + gmove(oldx, x) + gc.Regfree(oldx) + } +} + +/* + * generate high multiply: + * res = (nl*nr) >> width + */ +func cgen_hmul(nl *gc.Node, nr *gc.Node, res *gc.Node) { + t := nl.Type + a := optoas(gc.OHMUL, t) + if nl.Ullman < nr.Ullman { + tmp := nl + nl = nr + nr = tmp + } + + var n1 gc.Node + gc.Cgenr(nl, &n1, res) + var n2 gc.Node + gc.Cgenr(nr, &n2, nil) + var ax gc.Node + gc.Nodreg(&ax, t, x86.REG_AX) + gmove(&n1, &ax) + gins(a, &n2, nil) + gc.Regfree(&n2) + gc.Regfree(&n1) + + var dx gc.Node + if t.Width == 1 { + // byte multiply behaves differently. + gc.Nodreg(&ax, t, x86.REG_AH) + + gc.Nodreg(&dx, t, x86.REG_DX) + gmove(&ax, &dx) + } + + gc.Nodreg(&dx, t, x86.REG_DX) + gmove(&dx, res) +} + +/* + * generate shift according to op, one of: + * res = nl << nr + * res = nl >> nr + */ +func cgen_shift(op int, bounded bool, nl *gc.Node, nr *gc.Node, res *gc.Node) { + a := optoas(op, nl.Type) + + if nr.Op == gc.OLITERAL { + var n1 gc.Node + gc.Regalloc(&n1, nl.Type, res) + gc.Cgen(nl, &n1) + sc := uint64(nr.Int()) + if sc >= uint64(nl.Type.Width*8) { + // large shift gets 2 shifts by width-1 + var n3 gc.Node + gc.Nodconst(&n3, gc.Types[gc.TUINT32], nl.Type.Width*8-1) + + gins(a, &n3, &n1) + gins(a, &n3, &n1) + } else { + gins(a, nr, &n1) + } + gmove(&n1, res) + gc.Regfree(&n1) + return + } + + if nl.Ullman >= gc.UINF { + var n4 gc.Node + gc.Tempname(&n4, nl.Type) + gc.Cgen(nl, &n4) + nl = &n4 + } + + if nr.Ullman >= gc.UINF { + var n5 gc.Node + gc.Tempname(&n5, nr.Type) + gc.Cgen(nr, &n5) + nr = &n5 + } + + rcx := gc.GetReg(x86.REG_CX) + var n1 gc.Node + gc.Nodreg(&n1, gc.Types[gc.TUINT32], x86.REG_CX) + + // Allow either uint32 or uint64 as shift type, + // to avoid unnecessary conversion from uint32 to uint64 + // just to do the comparison. + tcount := gc.Types[gc.Simtype[nr.Type.Etype]] + + if tcount.Etype < gc.TUINT32 { + tcount = gc.Types[gc.TUINT32] + } + + gc.Regalloc(&n1, nr.Type, &n1) // to hold the shift type in CX + var n3 gc.Node + gc.Regalloc(&n3, tcount, &n1) // to clear high bits of CX + + var cx gc.Node + gc.Nodreg(&cx, gc.Types[gc.TUINT64], x86.REG_CX) + + var oldcx gc.Node + if rcx > 0 && !gc.Samereg(&cx, res) { + gc.Regalloc(&oldcx, gc.Types[gc.TUINT64], nil) + gmove(&cx, &oldcx) + } + + cx.Type = tcount + + var n2 gc.Node + if gc.Samereg(&cx, res) { + gc.Regalloc(&n2, nl.Type, nil) + } else { + gc.Regalloc(&n2, nl.Type, res) + } + if nl.Ullman >= nr.Ullman { + gc.Cgen(nl, &n2) + gc.Cgen(nr, &n1) + gmove(&n1, &n3) + } else { + gc.Cgen(nr, &n1) + gmove(&n1, &n3) + gc.Cgen(nl, &n2) + } + + gc.Regfree(&n3) + + // test and fix up large shifts + if !bounded { + gc.Nodconst(&n3, tcount, nl.Type.Width*8) + gins(optoas(gc.OCMP, tcount), &n1, &n3) + p1 := gc.Gbranch(optoas(gc.OLT, tcount), nil, +1) + if op == gc.ORSH && gc.Issigned[nl.Type.Etype] { + gc.Nodconst(&n3, gc.Types[gc.TUINT32], nl.Type.Width*8-1) + gins(a, &n3, &n2) + } else { + gc.Nodconst(&n3, nl.Type, 0) + gmove(&n3, &n2) + } + + gc.Patch(p1, gc.Pc) + } + + gins(a, &n1, &n2) + + if oldcx.Op != 0 { + cx.Type = gc.Types[gc.TUINT64] + gmove(&oldcx, &cx) + gc.Regfree(&oldcx) + } + + gmove(&n2, res) + + gc.Regfree(&n1) + gc.Regfree(&n2) +} + +/* + * generate byte multiply: + * res = nl * nr + * there is no 2-operand byte multiply instruction so + * we do a full-width multiplication and truncate afterwards. + */ +func cgen_bmul(op int, nl *gc.Node, nr *gc.Node, res *gc.Node) bool { + if optoas(op, nl.Type) != x86.AIMULB { + return false + } + + // largest ullman on left. + if nl.Ullman < nr.Ullman { + tmp := nl + nl = nr + nr = tmp + } + + // generate operands in "8-bit" registers. + var n1b gc.Node + gc.Regalloc(&n1b, nl.Type, res) + + gc.Cgen(nl, &n1b) + var n2b gc.Node + gc.Regalloc(&n2b, nr.Type, nil) + gc.Cgen(nr, &n2b) + + // perform full-width multiplication. + t := gc.Types[gc.TUINT64] + + if gc.Issigned[nl.Type.Etype] { + t = gc.Types[gc.TINT64] + } + var n1 gc.Node + gc.Nodreg(&n1, t, int(n1b.Reg)) + var n2 gc.Node + gc.Nodreg(&n2, t, int(n2b.Reg)) + a := optoas(op, t) + gins(a, &n2, &n1) + + // truncate. + gmove(&n1, res) + + gc.Regfree(&n1b) + gc.Regfree(&n2b) + return true +} + +func clearfat(nl *gc.Node) { + /* clear a fat object */ + if gc.Debug['g'] != 0 { + gc.Dump("\nclearfat", nl) + } + + w := nl.Type.Width + + // Avoid taking the address for simple enough types. + if gc.Componentgen(nil, nl) { + return + } + + c := w % 8 // bytes + q := w / 8 // quads + + if q < 4 { + // Write sequence of MOV 0, off(base) instead of using STOSQ. + // The hope is that although the code will be slightly longer, + // the MOVs will have no dependencies and pipeline better + // than the unrolled STOSQ loop. + // NOTE: Must use agen, not igen, so that optimizer sees address + // being taken. We are not writing on field boundaries. + var n1 gc.Node + gc.Agenr(nl, &n1, nil) + + n1.Op = gc.OINDREG + var z gc.Node + gc.Nodconst(&z, gc.Types[gc.TUINT64], 0) + for { + tmp14 := q + q-- + if tmp14 <= 0 { + break + } + n1.Type = z.Type + gins(x86.AMOVQ, &z, &n1) + n1.Xoffset += 8 + } + + if c >= 4 { + gc.Nodconst(&z, gc.Types[gc.TUINT32], 0) + n1.Type = z.Type + gins(x86.AMOVL, &z, &n1) + n1.Xoffset += 4 + c -= 4 + } + + gc.Nodconst(&z, gc.Types[gc.TUINT8], 0) + for { + tmp15 := c + c-- + if tmp15 <= 0 { + break + } + n1.Type = z.Type + gins(x86.AMOVB, &z, &n1) + n1.Xoffset++ + } + + gc.Regfree(&n1) + return + } + + var oldn1 gc.Node + var n1 gc.Node + savex(x86.REG_DI, &n1, &oldn1, nil, gc.Types[gc.Tptr]) + gc.Agen(nl, &n1) + + var ax gc.Node + var oldax gc.Node + savex(x86.REG_AX, &ax, &oldax, nil, gc.Types[gc.Tptr]) + gconreg(x86.AMOVL, 0, x86.REG_AX) + + if q > 128 || gc.Nacl { + gconreg(movptr, q, x86.REG_CX) + gins(x86.AREP, nil, nil) // repeat + gins(x86.ASTOSQ, nil, nil) // STOQ AL,*(DI)+ + } else { + if di := dzDI(q); di != 0 { + gconreg(addptr, di, x86.REG_DI) + } + p := gins(obj.ADUFFZERO, nil, nil) + p.To.Type = obj.TYPE_ADDR + p.To.Sym = gc.Linksym(gc.Pkglookup("duffzero", gc.Runtimepkg)) + p.To.Offset = dzOff(q) + } + + z := ax + di := n1 + if w >= 8 && c >= 4 { + di.Op = gc.OINDREG + z.Type = gc.Types[gc.TINT64] + di.Type = z.Type + p := gins(x86.AMOVQ, &z, &di) + p.To.Scale = 1 + p.To.Offset = c - 8 + } else if c >= 4 { + di.Op = gc.OINDREG + z.Type = gc.Types[gc.TINT32] + di.Type = z.Type + gins(x86.AMOVL, &z, &di) + if c > 4 { + p := gins(x86.AMOVL, &z, &di) + p.To.Scale = 1 + p.To.Offset = c - 4 + } + } else { + for c > 0 { + gins(x86.ASTOSB, nil, nil) // STOB AL,*(DI)+ + c-- + } + } + + restx(&n1, &oldn1) + restx(&ax, &oldax) +} + +// Called after regopt and peep have run. +// Expand CHECKNIL pseudo-op into actual nil pointer check. +func expandchecks(firstp *obj.Prog) { + var p1 *obj.Prog + var p2 *obj.Prog + + for p := firstp; p != nil; p = p.Link { + if p.As != obj.ACHECKNIL { + continue + } + if gc.Debug_checknil != 0 && p.Lineno > 1 { // p->lineno==1 in generated wrappers + gc.Warnl(int(p.Lineno), "generated nil check") + } + + // check is + // CMP arg, $0 + // JNE 2(PC) (likely) + // MOV AX, 0 + p1 = gc.Ctxt.NewProg() + + p2 = gc.Ctxt.NewProg() + gc.Clearp(p1) + gc.Clearp(p2) + p1.Link = p2 + p2.Link = p.Link + p.Link = p1 + p1.Lineno = p.Lineno + p2.Lineno = p.Lineno + p1.Pc = 9999 + p2.Pc = 9999 + p.As = int16(cmpptr) + p.To.Type = obj.TYPE_CONST + p.To.Offset = 0 + p1.As = x86.AJNE + p1.From.Type = obj.TYPE_CONST + p1.From.Offset = 1 // likely + p1.To.Type = obj.TYPE_BRANCH + p1.To.Val = p2.Link + + // crash by write to memory address 0. + // if possible, since we know arg is 0, use 0(arg), + // which will be shorter to encode than plain 0. + p2.As = x86.AMOVL + + p2.From.Type = obj.TYPE_REG + p2.From.Reg = x86.REG_AX + if regtyp(&p.From) { + p2.To.Type = obj.TYPE_MEM + p2.To.Reg = p.From.Reg + } else { + p2.To.Type = obj.TYPE_MEM + p2.To.Reg = x86.REG_NONE + } + + p2.To.Offset = 0 + } +} + +// addr += index*width if possible. +func addindex(index *gc.Node, width int64, addr *gc.Node) bool { + switch width { + case 1, 2, 4, 8: + p1 := gins(x86.ALEAQ, index, addr) + p1.From.Type = obj.TYPE_MEM + p1.From.Scale = int16(width) + p1.From.Index = p1.From.Reg + p1.From.Reg = p1.To.Reg + return true + } + return false +} + +// res = runtime.getg() +func getg(res *gc.Node) { + var n1 gc.Node + gc.Regalloc(&n1, res.Type, res) + mov := optoas(gc.OAS, gc.Types[gc.Tptr]) + p := gins(mov, nil, &n1) + p.From.Type = obj.TYPE_REG + p.From.Reg = x86.REG_TLS + p = gins(mov, nil, &n1) + p.From = p.To + p.From.Type = obj.TYPE_MEM + p.From.Index = x86.REG_TLS + p.From.Scale = 1 + gmove(&n1, res) + gc.Regfree(&n1) +} diff --git a/src/cmd/compile/internal/amd64/gsubr.go b/src/cmd/compile/internal/amd64/gsubr.go new file mode 100644 index 0000000000000000000000000000000000000000..a8e4170bee54647887849e8ac91c44dc96effdf4 --- /dev/null +++ b/src/cmd/compile/internal/amd64/gsubr.go @@ -0,0 +1,1380 @@ +// Derived from Inferno utils/6c/txt.c +// http://code.google.com/p/inferno-os/source/browse/utils/6c/txt.c +// +// Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved. +// Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net) +// Portions Copyright © 1997-1999 Vita Nuova Limited +// Portions Copyright © 2000-2007 Vita Nuova Holdings Limited (www.vitanuova.com) +// Portions Copyright © 2004,2006 Bruce Ellis +// Portions Copyright © 2005-2007 C H Forsyth (forsyth@terzarima.net) +// Revisions Copyright © 2000-2007 Lucent Technologies Inc. and others +// Portions Copyright © 2009 The Go Authors. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +package amd64 + +import ( + "cmd/compile/internal/big" + "cmd/compile/internal/gc" + "cmd/internal/obj" + "cmd/internal/obj/x86" + "fmt" +) + +var resvd = []int{ + x86.REG_DI, // for movstring + x86.REG_SI, // for movstring + + x86.REG_AX, // for divide + x86.REG_CX, // for shift + x86.REG_DX, // for divide + x86.REG_SP, // for stack +} + +/* + * generate + * as $c, reg + */ +func gconreg(as int, c int64, reg int) { + var nr gc.Node + + switch as { + case x86.AADDL, + x86.AMOVL, + x86.ALEAL: + gc.Nodreg(&nr, gc.Types[gc.TINT32], reg) + + default: + gc.Nodreg(&nr, gc.Types[gc.TINT64], reg) + } + + ginscon(as, c, &nr) +} + +/* + * generate + * as $c, n + */ +func ginscon(as int, c int64, n2 *gc.Node) { + var n1 gc.Node + + switch as { + case x86.AADDL, + x86.AMOVL, + x86.ALEAL: + gc.Nodconst(&n1, gc.Types[gc.TINT32], c) + + default: + gc.Nodconst(&n1, gc.Types[gc.TINT64], c) + } + + if as != x86.AMOVQ && (c < -(1<<31) || c >= 1<<31) { + // cannot have 64-bit immediate in ADD, etc. + // instead, MOV into register first. + var ntmp gc.Node + gc.Regalloc(&ntmp, gc.Types[gc.TINT64], nil) + + gins(x86.AMOVQ, &n1, &ntmp) + gins(as, &ntmp, n2) + gc.Regfree(&ntmp) + return + } + + gins(as, &n1, n2) +} + +func ginscmp(op int, t *gc.Type, n1, n2 *gc.Node, likely int) *obj.Prog { + if gc.Isint[t.Etype] && n1.Op == gc.OLITERAL && gc.Smallintconst(n1) && n2.Op != gc.OLITERAL { + // Reverse comparison to place constant last. + op = gc.Brrev(op) + n1, n2 = n2, n1 + } + // General case. + var r1, r2, g1, g2 gc.Node + if n1.Op == gc.ONAME && n1.Class&gc.PHEAP == 0 || n1.Op == gc.OINDREG { + r1 = *n1 + } else { + gc.Regalloc(&r1, t, n1) + gc.Regalloc(&g1, n1.Type, &r1) + gc.Cgen(n1, &g1) + gmove(&g1, &r1) + } + if n2.Op == gc.OLITERAL && gc.Isint[t.Etype] && gc.Smallintconst(n2) { + r2 = *n2 + } else { + gc.Regalloc(&r2, t, n2) + gc.Regalloc(&g2, n1.Type, &r2) + gc.Cgen(n2, &g2) + gmove(&g2, &r2) + } + gins(optoas(gc.OCMP, t), &r1, &r2) + if r1.Op == gc.OREGISTER { + gc.Regfree(&g1) + gc.Regfree(&r1) + } + if r2.Op == gc.OREGISTER { + gc.Regfree(&g2) + gc.Regfree(&r2) + } + return gc.Gbranch(optoas(op, t), nil, likely) +} + +func ginsboolval(a int, n *gc.Node) { + gins(jmptoset(a), nil, n) +} + +// set up nodes representing 2^63 +var ( + bigi gc.Node + bigf gc.Node + bignodes_did bool +) + +func bignodes() { + if bignodes_did { + return + } + bignodes_did = true + + var i big.Int + i.SetInt64(1) + i.Lsh(&i, 63) + + gc.Nodconst(&bigi, gc.Types[gc.TUINT64], 0) + bigi.SetBigInt(&i) + + bigi.Convconst(&bigf, gc.Types[gc.TFLOAT64]) +} + +/* + * generate move: + * t = f + * hard part is conversions. + */ +func gmove(f *gc.Node, t *gc.Node) { + if gc.Debug['M'] != 0 { + fmt.Printf("gmove %v -> %v\n", gc.Nconv(f, obj.FmtLong), gc.Nconv(t, obj.FmtLong)) + } + + ft := gc.Simsimtype(f.Type) + tt := gc.Simsimtype(t.Type) + cvt := t.Type + + if gc.Iscomplex[ft] || gc.Iscomplex[tt] { + gc.Complexmove(f, t) + return + } + + // cannot have two memory operands + var a int + if gc.Ismem(f) && gc.Ismem(t) { + goto hard + } + + // convert constant to desired type + if f.Op == gc.OLITERAL { + var con gc.Node + f.Convconst(&con, t.Type) + f = &con + ft = tt // so big switch will choose a simple mov + + // some constants can't move directly to memory. + if gc.Ismem(t) { + // float constants come from memory. + if gc.Isfloat[tt] { + goto hard + } + + // 64-bit immediates are really 32-bit sign-extended + // unless moving into a register. + if gc.Isint[tt] { + if i := con.Int(); int64(int32(i)) != i { + goto hard + } + } + } + } + + // value -> value copy, only one memory operand. + // figure out the instruction to use. + // break out of switch for one-instruction gins. + // goto rdst for "destination must be register". + // goto hard for "convert to cvt type first". + // otherwise handle and return. + + switch uint32(ft)<<16 | uint32(tt) { + default: + gc.Fatal("gmove %v -> %v", gc.Tconv(f.Type, obj.FmtLong), gc.Tconv(t.Type, obj.FmtLong)) + + /* + * integer copy and truncate + */ + case gc.TINT8<<16 | gc.TINT8, // same size + gc.TINT8<<16 | gc.TUINT8, + gc.TUINT8<<16 | gc.TINT8, + gc.TUINT8<<16 | gc.TUINT8, + gc.TINT16<<16 | gc.TINT8, + // truncate + gc.TUINT16<<16 | gc.TINT8, + gc.TINT32<<16 | gc.TINT8, + gc.TUINT32<<16 | gc.TINT8, + gc.TINT64<<16 | gc.TINT8, + gc.TUINT64<<16 | gc.TINT8, + gc.TINT16<<16 | gc.TUINT8, + gc.TUINT16<<16 | gc.TUINT8, + gc.TINT32<<16 | gc.TUINT8, + gc.TUINT32<<16 | gc.TUINT8, + gc.TINT64<<16 | gc.TUINT8, + gc.TUINT64<<16 | gc.TUINT8: + a = x86.AMOVB + + case gc.TINT16<<16 | gc.TINT16, // same size + gc.TINT16<<16 | gc.TUINT16, + gc.TUINT16<<16 | gc.TINT16, + gc.TUINT16<<16 | gc.TUINT16, + gc.TINT32<<16 | gc.TINT16, + // truncate + gc.TUINT32<<16 | gc.TINT16, + gc.TINT64<<16 | gc.TINT16, + gc.TUINT64<<16 | gc.TINT16, + gc.TINT32<<16 | gc.TUINT16, + gc.TUINT32<<16 | gc.TUINT16, + gc.TINT64<<16 | gc.TUINT16, + gc.TUINT64<<16 | gc.TUINT16: + a = x86.AMOVW + + case gc.TINT32<<16 | gc.TINT32, // same size + gc.TINT32<<16 | gc.TUINT32, + gc.TUINT32<<16 | gc.TINT32, + gc.TUINT32<<16 | gc.TUINT32: + a = x86.AMOVL + + case gc.TINT64<<16 | gc.TINT32, // truncate + gc.TUINT64<<16 | gc.TINT32, + gc.TINT64<<16 | gc.TUINT32, + gc.TUINT64<<16 | gc.TUINT32: + a = x86.AMOVQL + + case gc.TINT64<<16 | gc.TINT64, // same size + gc.TINT64<<16 | gc.TUINT64, + gc.TUINT64<<16 | gc.TINT64, + gc.TUINT64<<16 | gc.TUINT64: + a = x86.AMOVQ + + /* + * integer up-conversions + */ + case gc.TINT8<<16 | gc.TINT16, // sign extend int8 + gc.TINT8<<16 | gc.TUINT16: + a = x86.AMOVBWSX + + goto rdst + + case gc.TINT8<<16 | gc.TINT32, + gc.TINT8<<16 | gc.TUINT32: + a = x86.AMOVBLSX + goto rdst + + case gc.TINT8<<16 | gc.TINT64, + gc.TINT8<<16 | gc.TUINT64: + a = x86.AMOVBQSX + goto rdst + + case gc.TUINT8<<16 | gc.TINT16, // zero extend uint8 + gc.TUINT8<<16 | gc.TUINT16: + a = x86.AMOVBWZX + + goto rdst + + case gc.TUINT8<<16 | gc.TINT32, + gc.TUINT8<<16 | gc.TUINT32: + a = x86.AMOVBLZX + goto rdst + + case gc.TUINT8<<16 | gc.TINT64, + gc.TUINT8<<16 | gc.TUINT64: + a = x86.AMOVBQZX + goto rdst + + case gc.TINT16<<16 | gc.TINT32, // sign extend int16 + gc.TINT16<<16 | gc.TUINT32: + a = x86.AMOVWLSX + + goto rdst + + case gc.TINT16<<16 | gc.TINT64, + gc.TINT16<<16 | gc.TUINT64: + a = x86.AMOVWQSX + goto rdst + + case gc.TUINT16<<16 | gc.TINT32, // zero extend uint16 + gc.TUINT16<<16 | gc.TUINT32: + a = x86.AMOVWLZX + + goto rdst + + case gc.TUINT16<<16 | gc.TINT64, + gc.TUINT16<<16 | gc.TUINT64: + a = x86.AMOVWQZX + goto rdst + + case gc.TINT32<<16 | gc.TINT64, // sign extend int32 + gc.TINT32<<16 | gc.TUINT64: + a = x86.AMOVLQSX + + goto rdst + + // AMOVL into a register zeros the top of the register, + // so this is not always necessary, but if we rely on AMOVL + // the optimizer is almost certain to screw with us. + case gc.TUINT32<<16 | gc.TINT64, // zero extend uint32 + gc.TUINT32<<16 | gc.TUINT64: + a = x86.AMOVLQZX + + goto rdst + + /* + * float to integer + */ + case gc.TFLOAT32<<16 | gc.TINT32: + a = x86.ACVTTSS2SL + + goto rdst + + case gc.TFLOAT64<<16 | gc.TINT32: + a = x86.ACVTTSD2SL + goto rdst + + case gc.TFLOAT32<<16 | gc.TINT64: + a = x86.ACVTTSS2SQ + goto rdst + + case gc.TFLOAT64<<16 | gc.TINT64: + a = x86.ACVTTSD2SQ + goto rdst + + // convert via int32. + case gc.TFLOAT32<<16 | gc.TINT16, + gc.TFLOAT32<<16 | gc.TINT8, + gc.TFLOAT32<<16 | gc.TUINT16, + gc.TFLOAT32<<16 | gc.TUINT8, + gc.TFLOAT64<<16 | gc.TINT16, + gc.TFLOAT64<<16 | gc.TINT8, + gc.TFLOAT64<<16 | gc.TUINT16, + gc.TFLOAT64<<16 | gc.TUINT8: + cvt = gc.Types[gc.TINT32] + + goto hard + + // convert via int64. + case gc.TFLOAT32<<16 | gc.TUINT32, + gc.TFLOAT64<<16 | gc.TUINT32: + cvt = gc.Types[gc.TINT64] + + goto hard + + // algorithm is: + // if small enough, use native float64 -> int64 conversion. + // otherwise, subtract 2^63, convert, and add it back. + case gc.TFLOAT32<<16 | gc.TUINT64, + gc.TFLOAT64<<16 | gc.TUINT64: + a := x86.ACVTTSS2SQ + + if ft == gc.TFLOAT64 { + a = x86.ACVTTSD2SQ + } + bignodes() + var r1 gc.Node + gc.Regalloc(&r1, gc.Types[ft], nil) + var r2 gc.Node + gc.Regalloc(&r2, gc.Types[tt], t) + var r3 gc.Node + gc.Regalloc(&r3, gc.Types[ft], nil) + var r4 gc.Node + gc.Regalloc(&r4, gc.Types[tt], nil) + gins(optoas(gc.OAS, f.Type), f, &r1) + gins(optoas(gc.OCMP, f.Type), &bigf, &r1) + p1 := gc.Gbranch(optoas(gc.OLE, f.Type), nil, +1) + gins(a, &r1, &r2) + p2 := gc.Gbranch(obj.AJMP, nil, 0) + gc.Patch(p1, gc.Pc) + gins(optoas(gc.OAS, f.Type), &bigf, &r3) + gins(optoas(gc.OSUB, f.Type), &r3, &r1) + gins(a, &r1, &r2) + gins(x86.AMOVQ, &bigi, &r4) + gins(x86.AXORQ, &r4, &r2) + gc.Patch(p2, gc.Pc) + gmove(&r2, t) + gc.Regfree(&r4) + gc.Regfree(&r3) + gc.Regfree(&r2) + gc.Regfree(&r1) + return + + /* + * integer to float + */ + case gc.TINT32<<16 | gc.TFLOAT32: + a = x86.ACVTSL2SS + + goto rdst + + case gc.TINT32<<16 | gc.TFLOAT64: + a = x86.ACVTSL2SD + goto rdst + + case gc.TINT64<<16 | gc.TFLOAT32: + a = x86.ACVTSQ2SS + goto rdst + + case gc.TINT64<<16 | gc.TFLOAT64: + a = x86.ACVTSQ2SD + goto rdst + + // convert via int32 + case gc.TINT16<<16 | gc.TFLOAT32, + gc.TINT16<<16 | gc.TFLOAT64, + gc.TINT8<<16 | gc.TFLOAT32, + gc.TINT8<<16 | gc.TFLOAT64, + gc.TUINT16<<16 | gc.TFLOAT32, + gc.TUINT16<<16 | gc.TFLOAT64, + gc.TUINT8<<16 | gc.TFLOAT32, + gc.TUINT8<<16 | gc.TFLOAT64: + cvt = gc.Types[gc.TINT32] + + goto hard + + // convert via int64. + case gc.TUINT32<<16 | gc.TFLOAT32, + gc.TUINT32<<16 | gc.TFLOAT64: + cvt = gc.Types[gc.TINT64] + + goto hard + + // algorithm is: + // if small enough, use native int64 -> uint64 conversion. + // otherwise, halve (rounding to odd?), convert, and double. + case gc.TUINT64<<16 | gc.TFLOAT32, + gc.TUINT64<<16 | gc.TFLOAT64: + a := x86.ACVTSQ2SS + + if tt == gc.TFLOAT64 { + a = x86.ACVTSQ2SD + } + var zero gc.Node + gc.Nodconst(&zero, gc.Types[gc.TUINT64], 0) + var one gc.Node + gc.Nodconst(&one, gc.Types[gc.TUINT64], 1) + var r1 gc.Node + gc.Regalloc(&r1, f.Type, f) + var r2 gc.Node + gc.Regalloc(&r2, t.Type, t) + var r3 gc.Node + gc.Regalloc(&r3, f.Type, nil) + var r4 gc.Node + gc.Regalloc(&r4, f.Type, nil) + gmove(f, &r1) + gins(x86.ACMPQ, &r1, &zero) + p1 := gc.Gbranch(x86.AJLT, nil, +1) + gins(a, &r1, &r2) + p2 := gc.Gbranch(obj.AJMP, nil, 0) + gc.Patch(p1, gc.Pc) + gmove(&r1, &r3) + gins(x86.ASHRQ, &one, &r3) + gmove(&r1, &r4) + gins(x86.AANDL, &one, &r4) + gins(x86.AORQ, &r4, &r3) + gins(a, &r3, &r2) + gins(optoas(gc.OADD, t.Type), &r2, &r2) + gc.Patch(p2, gc.Pc) + gmove(&r2, t) + gc.Regfree(&r4) + gc.Regfree(&r3) + gc.Regfree(&r2) + gc.Regfree(&r1) + return + + /* + * float to float + */ + case gc.TFLOAT32<<16 | gc.TFLOAT32: + a = x86.AMOVSS + + case gc.TFLOAT64<<16 | gc.TFLOAT64: + a = x86.AMOVSD + + case gc.TFLOAT32<<16 | gc.TFLOAT64: + a = x86.ACVTSS2SD + goto rdst + + case gc.TFLOAT64<<16 | gc.TFLOAT32: + a = x86.ACVTSD2SS + goto rdst + } + + gins(a, f, t) + return + + // requires register destination +rdst: + { + var r1 gc.Node + gc.Regalloc(&r1, t.Type, t) + + gins(a, f, &r1) + gmove(&r1, t) + gc.Regfree(&r1) + return + } + + // requires register intermediate +hard: + var r1 gc.Node + gc.Regalloc(&r1, cvt, t) + + gmove(f, &r1) + gmove(&r1, t) + gc.Regfree(&r1) + return +} + +func samaddr(f *gc.Node, t *gc.Node) bool { + if f.Op != t.Op { + return false + } + + switch f.Op { + case gc.OREGISTER: + if f.Reg != t.Reg { + break + } + return true + } + + return false +} + +/* + * generate one instruction: + * as f, t + */ +func gins(as int, f *gc.Node, t *gc.Node) *obj.Prog { + // Node nod; + + // if(f != N && f->op == OINDEX) { + // gc.Regalloc(&nod, ®node, Z); + // v = constnode.vconst; + // gc.Cgen(f->right, &nod); + // constnode.vconst = v; + // idx.reg = nod.reg; + // gc.Regfree(&nod); + // } + // if(t != N && t->op == OINDEX) { + // gc.Regalloc(&nod, ®node, Z); + // v = constnode.vconst; + // gc.Cgen(t->right, &nod); + // constnode.vconst = v; + // idx.reg = nod.reg; + // gc.Regfree(&nod); + // } + + if f != nil && f.Op == gc.OADDR && (as == x86.AMOVL || as == x86.AMOVQ) { + // Turn MOVL $xxx into LEAL xxx. + // These should be equivalent but most of the backend + // only expects to see LEAL, because that's what we had + // historically generated. Various hidden assumptions are baked in by now. + if as == x86.AMOVL { + as = x86.ALEAL + } else { + as = x86.ALEAQ + } + f = f.Left + } + + switch as { + case x86.AMOVB, + x86.AMOVW, + x86.AMOVL, + x86.AMOVQ, + x86.AMOVSS, + x86.AMOVSD: + if f != nil && t != nil && samaddr(f, t) { + return nil + } + + case x86.ALEAQ: + if f != nil && gc.Isconst(f, gc.CTNIL) { + gc.Fatal("gins LEAQ nil %v", f.Type) + } + } + + p := gc.Prog(as) + gc.Naddr(&p.From, f) + gc.Naddr(&p.To, t) + + if gc.Debug['g'] != 0 { + fmt.Printf("%v\n", p) + } + + w := int32(0) + switch as { + case x86.AMOVB: + w = 1 + + case x86.AMOVW: + w = 2 + + case x86.AMOVL: + w = 4 + + case x86.AMOVQ: + w = 8 + } + + if w != 0 && ((f != nil && p.From.Width < int64(w)) || (t != nil && p.To.Width > int64(w))) { + gc.Dump("f", f) + gc.Dump("t", t) + gc.Fatal("bad width: %v (%d, %d)\n", p, p.From.Width, p.To.Width) + } + + if p.To.Type == obj.TYPE_ADDR && w > 0 { + gc.Fatal("bad use of addr: %v", p) + } + + return p +} + +func ginsnop() { + // This is actually not the x86 NOP anymore, + // but at the point where it gets used, AX is dead + // so it's okay if we lose the high bits. + var reg gc.Node + gc.Nodreg(®, gc.Types[gc.TINT], x86.REG_AX) + gins(x86.AXCHGL, ®, ®) +} + +/* + * return Axxx for Oxxx on type t. + */ +func optoas(op int, t *gc.Type) int { + if t == nil { + gc.Fatal("optoas: t is nil") + } + + a := obj.AXXX + switch uint32(op)<<16 | uint32(gc.Simtype[t.Etype]) { + default: + gc.Fatal("optoas: no entry %v-%v", gc.Oconv(int(op), 0), t) + + case gc.OADDR<<16 | gc.TPTR32: + a = x86.ALEAL + + case gc.OADDR<<16 | gc.TPTR64: + a = x86.ALEAQ + + case gc.OEQ<<16 | gc.TBOOL, + gc.OEQ<<16 | gc.TINT8, + gc.OEQ<<16 | gc.TUINT8, + gc.OEQ<<16 | gc.TINT16, + gc.OEQ<<16 | gc.TUINT16, + gc.OEQ<<16 | gc.TINT32, + gc.OEQ<<16 | gc.TUINT32, + gc.OEQ<<16 | gc.TINT64, + gc.OEQ<<16 | gc.TUINT64, + gc.OEQ<<16 | gc.TPTR32, + gc.OEQ<<16 | gc.TPTR64, + gc.OEQ<<16 | gc.TFLOAT32, + gc.OEQ<<16 | gc.TFLOAT64: + a = x86.AJEQ + + case gc.ONE<<16 | gc.TBOOL, + gc.ONE<<16 | gc.TINT8, + gc.ONE<<16 | gc.TUINT8, + gc.ONE<<16 | gc.TINT16, + gc.ONE<<16 | gc.TUINT16, + gc.ONE<<16 | gc.TINT32, + gc.ONE<<16 | gc.TUINT32, + gc.ONE<<16 | gc.TINT64, + gc.ONE<<16 | gc.TUINT64, + gc.ONE<<16 | gc.TPTR32, + gc.ONE<<16 | gc.TPTR64, + gc.ONE<<16 | gc.TFLOAT32, + gc.ONE<<16 | gc.TFLOAT64: + a = x86.AJNE + + case gc.OPS<<16 | gc.TBOOL, + gc.OPS<<16 | gc.TINT8, + gc.OPS<<16 | gc.TUINT8, + gc.OPS<<16 | gc.TINT16, + gc.OPS<<16 | gc.TUINT16, + gc.OPS<<16 | gc.TINT32, + gc.OPS<<16 | gc.TUINT32, + gc.OPS<<16 | gc.TINT64, + gc.OPS<<16 | gc.TUINT64, + gc.OPS<<16 | gc.TPTR32, + gc.OPS<<16 | gc.TPTR64, + gc.OPS<<16 | gc.TFLOAT32, + gc.OPS<<16 | gc.TFLOAT64: + a = x86.AJPS + + case gc.OPC<<16 | gc.TBOOL, + gc.OPC<<16 | gc.TINT8, + gc.OPC<<16 | gc.TUINT8, + gc.OPC<<16 | gc.TINT16, + gc.OPC<<16 | gc.TUINT16, + gc.OPC<<16 | gc.TINT32, + gc.OPC<<16 | gc.TUINT32, + gc.OPC<<16 | gc.TINT64, + gc.OPC<<16 | gc.TUINT64, + gc.OPC<<16 | gc.TPTR32, + gc.OPC<<16 | gc.TPTR64, + gc.OPC<<16 | gc.TFLOAT32, + gc.OPC<<16 | gc.TFLOAT64: + a = x86.AJPC + + case gc.OLT<<16 | gc.TINT8, + gc.OLT<<16 | gc.TINT16, + gc.OLT<<16 | gc.TINT32, + gc.OLT<<16 | gc.TINT64: + a = x86.AJLT + + case gc.OLT<<16 | gc.TUINT8, + gc.OLT<<16 | gc.TUINT16, + gc.OLT<<16 | gc.TUINT32, + gc.OLT<<16 | gc.TUINT64: + a = x86.AJCS + + case gc.OLE<<16 | gc.TINT8, + gc.OLE<<16 | gc.TINT16, + gc.OLE<<16 | gc.TINT32, + gc.OLE<<16 | gc.TINT64: + a = x86.AJLE + + case gc.OLE<<16 | gc.TUINT8, + gc.OLE<<16 | gc.TUINT16, + gc.OLE<<16 | gc.TUINT32, + gc.OLE<<16 | gc.TUINT64: + a = x86.AJLS + + case gc.OGT<<16 | gc.TINT8, + gc.OGT<<16 | gc.TINT16, + gc.OGT<<16 | gc.TINT32, + gc.OGT<<16 | gc.TINT64: + a = x86.AJGT + + case gc.OGT<<16 | gc.TUINT8, + gc.OGT<<16 | gc.TUINT16, + gc.OGT<<16 | gc.TUINT32, + gc.OGT<<16 | gc.TUINT64, + gc.OLT<<16 | gc.TFLOAT32, + gc.OLT<<16 | gc.TFLOAT64: + a = x86.AJHI + + case gc.OGE<<16 | gc.TINT8, + gc.OGE<<16 | gc.TINT16, + gc.OGE<<16 | gc.TINT32, + gc.OGE<<16 | gc.TINT64: + a = x86.AJGE + + case gc.OGE<<16 | gc.TUINT8, + gc.OGE<<16 | gc.TUINT16, + gc.OGE<<16 | gc.TUINT32, + gc.OGE<<16 | gc.TUINT64, + gc.OLE<<16 | gc.TFLOAT32, + gc.OLE<<16 | gc.TFLOAT64: + a = x86.AJCC + + case gc.OCMP<<16 | gc.TBOOL, + gc.OCMP<<16 | gc.TINT8, + gc.OCMP<<16 | gc.TUINT8: + a = x86.ACMPB + + case gc.OCMP<<16 | gc.TINT16, + gc.OCMP<<16 | gc.TUINT16: + a = x86.ACMPW + + case gc.OCMP<<16 | gc.TINT32, + gc.OCMP<<16 | gc.TUINT32, + gc.OCMP<<16 | gc.TPTR32: + a = x86.ACMPL + + case gc.OCMP<<16 | gc.TINT64, + gc.OCMP<<16 | gc.TUINT64, + gc.OCMP<<16 | gc.TPTR64: + a = x86.ACMPQ + + case gc.OCMP<<16 | gc.TFLOAT32: + a = x86.AUCOMISS + + case gc.OCMP<<16 | gc.TFLOAT64: + a = x86.AUCOMISD + + case gc.OAS<<16 | gc.TBOOL, + gc.OAS<<16 | gc.TINT8, + gc.OAS<<16 | gc.TUINT8: + a = x86.AMOVB + + case gc.OAS<<16 | gc.TINT16, + gc.OAS<<16 | gc.TUINT16: + a = x86.AMOVW + + case gc.OAS<<16 | gc.TINT32, + gc.OAS<<16 | gc.TUINT32, + gc.OAS<<16 | gc.TPTR32: + a = x86.AMOVL + + case gc.OAS<<16 | gc.TINT64, + gc.OAS<<16 | gc.TUINT64, + gc.OAS<<16 | gc.TPTR64: + a = x86.AMOVQ + + case gc.OAS<<16 | gc.TFLOAT32: + a = x86.AMOVSS + + case gc.OAS<<16 | gc.TFLOAT64: + a = x86.AMOVSD + + case gc.OADD<<16 | gc.TINT8, + gc.OADD<<16 | gc.TUINT8: + a = x86.AADDB + + case gc.OADD<<16 | gc.TINT16, + gc.OADD<<16 | gc.TUINT16: + a = x86.AADDW + + case gc.OADD<<16 | gc.TINT32, + gc.OADD<<16 | gc.TUINT32, + gc.OADD<<16 | gc.TPTR32: + a = x86.AADDL + + case gc.OADD<<16 | gc.TINT64, + gc.OADD<<16 | gc.TUINT64, + gc.OADD<<16 | gc.TPTR64: + a = x86.AADDQ + + case gc.OADD<<16 | gc.TFLOAT32: + a = x86.AADDSS + + case gc.OADD<<16 | gc.TFLOAT64: + a = x86.AADDSD + + case gc.OSUB<<16 | gc.TINT8, + gc.OSUB<<16 | gc.TUINT8: + a = x86.ASUBB + + case gc.OSUB<<16 | gc.TINT16, + gc.OSUB<<16 | gc.TUINT16: + a = x86.ASUBW + + case gc.OSUB<<16 | gc.TINT32, + gc.OSUB<<16 | gc.TUINT32, + gc.OSUB<<16 | gc.TPTR32: + a = x86.ASUBL + + case gc.OSUB<<16 | gc.TINT64, + gc.OSUB<<16 | gc.TUINT64, + gc.OSUB<<16 | gc.TPTR64: + a = x86.ASUBQ + + case gc.OSUB<<16 | gc.TFLOAT32: + a = x86.ASUBSS + + case gc.OSUB<<16 | gc.TFLOAT64: + a = x86.ASUBSD + + case gc.OINC<<16 | gc.TINT8, + gc.OINC<<16 | gc.TUINT8: + a = x86.AINCB + + case gc.OINC<<16 | gc.TINT16, + gc.OINC<<16 | gc.TUINT16: + a = x86.AINCW + + case gc.OINC<<16 | gc.TINT32, + gc.OINC<<16 | gc.TUINT32, + gc.OINC<<16 | gc.TPTR32: + a = x86.AINCL + + case gc.OINC<<16 | gc.TINT64, + gc.OINC<<16 | gc.TUINT64, + gc.OINC<<16 | gc.TPTR64: + a = x86.AINCQ + + case gc.ODEC<<16 | gc.TINT8, + gc.ODEC<<16 | gc.TUINT8: + a = x86.ADECB + + case gc.ODEC<<16 | gc.TINT16, + gc.ODEC<<16 | gc.TUINT16: + a = x86.ADECW + + case gc.ODEC<<16 | gc.TINT32, + gc.ODEC<<16 | gc.TUINT32, + gc.ODEC<<16 | gc.TPTR32: + a = x86.ADECL + + case gc.ODEC<<16 | gc.TINT64, + gc.ODEC<<16 | gc.TUINT64, + gc.ODEC<<16 | gc.TPTR64: + a = x86.ADECQ + + case gc.OMINUS<<16 | gc.TINT8, + gc.OMINUS<<16 | gc.TUINT8: + a = x86.ANEGB + + case gc.OMINUS<<16 | gc.TINT16, + gc.OMINUS<<16 | gc.TUINT16: + a = x86.ANEGW + + case gc.OMINUS<<16 | gc.TINT32, + gc.OMINUS<<16 | gc.TUINT32, + gc.OMINUS<<16 | gc.TPTR32: + a = x86.ANEGL + + case gc.OMINUS<<16 | gc.TINT64, + gc.OMINUS<<16 | gc.TUINT64, + gc.OMINUS<<16 | gc.TPTR64: + a = x86.ANEGQ + + case gc.OAND<<16 | gc.TBOOL, + gc.OAND<<16 | gc.TINT8, + gc.OAND<<16 | gc.TUINT8: + a = x86.AANDB + + case gc.OAND<<16 | gc.TINT16, + gc.OAND<<16 | gc.TUINT16: + a = x86.AANDW + + case gc.OAND<<16 | gc.TINT32, + gc.OAND<<16 | gc.TUINT32, + gc.OAND<<16 | gc.TPTR32: + a = x86.AANDL + + case gc.OAND<<16 | gc.TINT64, + gc.OAND<<16 | gc.TUINT64, + gc.OAND<<16 | gc.TPTR64: + a = x86.AANDQ + + case gc.OOR<<16 | gc.TBOOL, + gc.OOR<<16 | gc.TINT8, + gc.OOR<<16 | gc.TUINT8: + a = x86.AORB + + case gc.OOR<<16 | gc.TINT16, + gc.OOR<<16 | gc.TUINT16: + a = x86.AORW + + case gc.OOR<<16 | gc.TINT32, + gc.OOR<<16 | gc.TUINT32, + gc.OOR<<16 | gc.TPTR32: + a = x86.AORL + + case gc.OOR<<16 | gc.TINT64, + gc.OOR<<16 | gc.TUINT64, + gc.OOR<<16 | gc.TPTR64: + a = x86.AORQ + + case gc.OXOR<<16 | gc.TINT8, + gc.OXOR<<16 | gc.TUINT8: + a = x86.AXORB + + case gc.OXOR<<16 | gc.TINT16, + gc.OXOR<<16 | gc.TUINT16: + a = x86.AXORW + + case gc.OXOR<<16 | gc.TINT32, + gc.OXOR<<16 | gc.TUINT32, + gc.OXOR<<16 | gc.TPTR32: + a = x86.AXORL + + case gc.OXOR<<16 | gc.TINT64, + gc.OXOR<<16 | gc.TUINT64, + gc.OXOR<<16 | gc.TPTR64: + a = x86.AXORQ + + case gc.OLROT<<16 | gc.TINT8, + gc.OLROT<<16 | gc.TUINT8: + a = x86.AROLB + + case gc.OLROT<<16 | gc.TINT16, + gc.OLROT<<16 | gc.TUINT16: + a = x86.AROLW + + case gc.OLROT<<16 | gc.TINT32, + gc.OLROT<<16 | gc.TUINT32, + gc.OLROT<<16 | gc.TPTR32: + a = x86.AROLL + + case gc.OLROT<<16 | gc.TINT64, + gc.OLROT<<16 | gc.TUINT64, + gc.OLROT<<16 | gc.TPTR64: + a = x86.AROLQ + + case gc.OLSH<<16 | gc.TINT8, + gc.OLSH<<16 | gc.TUINT8: + a = x86.ASHLB + + case gc.OLSH<<16 | gc.TINT16, + gc.OLSH<<16 | gc.TUINT16: + a = x86.ASHLW + + case gc.OLSH<<16 | gc.TINT32, + gc.OLSH<<16 | gc.TUINT32, + gc.OLSH<<16 | gc.TPTR32: + a = x86.ASHLL + + case gc.OLSH<<16 | gc.TINT64, + gc.OLSH<<16 | gc.TUINT64, + gc.OLSH<<16 | gc.TPTR64: + a = x86.ASHLQ + + case gc.ORSH<<16 | gc.TUINT8: + a = x86.ASHRB + + case gc.ORSH<<16 | gc.TUINT16: + a = x86.ASHRW + + case gc.ORSH<<16 | gc.TUINT32, + gc.ORSH<<16 | gc.TPTR32: + a = x86.ASHRL + + case gc.ORSH<<16 | gc.TUINT64, + gc.ORSH<<16 | gc.TPTR64: + a = x86.ASHRQ + + case gc.ORSH<<16 | gc.TINT8: + a = x86.ASARB + + case gc.ORSH<<16 | gc.TINT16: + a = x86.ASARW + + case gc.ORSH<<16 | gc.TINT32: + a = x86.ASARL + + case gc.ORSH<<16 | gc.TINT64: + a = x86.ASARQ + + case gc.ORROTC<<16 | gc.TINT8, + gc.ORROTC<<16 | gc.TUINT8: + a = x86.ARCRB + + case gc.ORROTC<<16 | gc.TINT16, + gc.ORROTC<<16 | gc.TUINT16: + a = x86.ARCRW + + case gc.ORROTC<<16 | gc.TINT32, + gc.ORROTC<<16 | gc.TUINT32: + a = x86.ARCRL + + case gc.ORROTC<<16 | gc.TINT64, + gc.ORROTC<<16 | gc.TUINT64: + a = x86.ARCRQ + + case gc.OHMUL<<16 | gc.TINT8, + gc.OMUL<<16 | gc.TINT8, + gc.OMUL<<16 | gc.TUINT8: + a = x86.AIMULB + + case gc.OHMUL<<16 | gc.TINT16, + gc.OMUL<<16 | gc.TINT16, + gc.OMUL<<16 | gc.TUINT16: + a = x86.AIMULW + + case gc.OHMUL<<16 | gc.TINT32, + gc.OMUL<<16 | gc.TINT32, + gc.OMUL<<16 | gc.TUINT32, + gc.OMUL<<16 | gc.TPTR32: + a = x86.AIMULL + + case gc.OHMUL<<16 | gc.TINT64, + gc.OMUL<<16 | gc.TINT64, + gc.OMUL<<16 | gc.TUINT64, + gc.OMUL<<16 | gc.TPTR64: + a = x86.AIMULQ + + case gc.OHMUL<<16 | gc.TUINT8: + a = x86.AMULB + + case gc.OHMUL<<16 | gc.TUINT16: + a = x86.AMULW + + case gc.OHMUL<<16 | gc.TUINT32, + gc.OHMUL<<16 | gc.TPTR32: + a = x86.AMULL + + case gc.OHMUL<<16 | gc.TUINT64, + gc.OHMUL<<16 | gc.TPTR64: + a = x86.AMULQ + + case gc.OMUL<<16 | gc.TFLOAT32: + a = x86.AMULSS + + case gc.OMUL<<16 | gc.TFLOAT64: + a = x86.AMULSD + + case gc.ODIV<<16 | gc.TINT8, + gc.OMOD<<16 | gc.TINT8: + a = x86.AIDIVB + + case gc.ODIV<<16 | gc.TUINT8, + gc.OMOD<<16 | gc.TUINT8: + a = x86.ADIVB + + case gc.ODIV<<16 | gc.TINT16, + gc.OMOD<<16 | gc.TINT16: + a = x86.AIDIVW + + case gc.ODIV<<16 | gc.TUINT16, + gc.OMOD<<16 | gc.TUINT16: + a = x86.ADIVW + + case gc.ODIV<<16 | gc.TINT32, + gc.OMOD<<16 | gc.TINT32: + a = x86.AIDIVL + + case gc.ODIV<<16 | gc.TUINT32, + gc.ODIV<<16 | gc.TPTR32, + gc.OMOD<<16 | gc.TUINT32, + gc.OMOD<<16 | gc.TPTR32: + a = x86.ADIVL + + case gc.ODIV<<16 | gc.TINT64, + gc.OMOD<<16 | gc.TINT64: + a = x86.AIDIVQ + + case gc.ODIV<<16 | gc.TUINT64, + gc.ODIV<<16 | gc.TPTR64, + gc.OMOD<<16 | gc.TUINT64, + gc.OMOD<<16 | gc.TPTR64: + a = x86.ADIVQ + + case gc.OEXTEND<<16 | gc.TINT16: + a = x86.ACWD + + case gc.OEXTEND<<16 | gc.TINT32: + a = x86.ACDQ + + case gc.OEXTEND<<16 | gc.TINT64: + a = x86.ACQO + + case gc.ODIV<<16 | gc.TFLOAT32: + a = x86.ADIVSS + + case gc.ODIV<<16 | gc.TFLOAT64: + a = x86.ADIVSD + + case gc.OSQRT<<16 | gc.TFLOAT64: + a = x86.ASQRTSD + } + + return a +} + +// jmptoset returns ASETxx for AJxx. +func jmptoset(jmp int) int { + switch jmp { + case x86.AJEQ: + return x86.ASETEQ + case x86.AJNE: + return x86.ASETNE + case x86.AJLT: + return x86.ASETLT + case x86.AJCS: + return x86.ASETCS + case x86.AJLE: + return x86.ASETLE + case x86.AJLS: + return x86.ASETLS + case x86.AJGT: + return x86.ASETGT + case x86.AJHI: + return x86.ASETHI + case x86.AJGE: + return x86.ASETGE + case x86.AJCC: + return x86.ASETCC + case x86.AJMI: + return x86.ASETMI + case x86.AJOC: + return x86.ASETOC + case x86.AJOS: + return x86.ASETOS + case x86.AJPC: + return x86.ASETPC + case x86.AJPL: + return x86.ASETPL + case x86.AJPS: + return x86.ASETPS + } + gc.Fatal("jmptoset: no entry for %v", gc.Oconv(jmp, 0)) + panic("unreachable") +} + +const ( + ODynam = 1 << 0 + OAddable = 1 << 1 +) + +var clean [20]gc.Node + +var cleani int = 0 + +func sudoclean() { + if clean[cleani-1].Op != gc.OEMPTY { + gc.Regfree(&clean[cleani-1]) + } + if clean[cleani-2].Op != gc.OEMPTY { + gc.Regfree(&clean[cleani-2]) + } + cleani -= 2 +} + +/* + * generate code to compute address of n, + * a reference to a (perhaps nested) field inside + * an array or struct. + * return 0 on failure, 1 on success. + * on success, leaves usable address in a. + * + * caller is responsible for calling sudoclean + * after successful sudoaddable, + * to release the register used for a. + */ +func sudoaddable(as int, n *gc.Node, a *obj.Addr) bool { + if n.Type == nil { + return false + } + + *a = obj.Addr{} + + switch n.Op { + case gc.OLITERAL: + if !gc.Isconst(n, gc.CTINT) { + break + } + v := n.Int() + if v >= 32000 || v <= -32000 { + break + } + switch as { + default: + return false + + case x86.AADDB, + x86.AADDW, + x86.AADDL, + x86.AADDQ, + x86.ASUBB, + x86.ASUBW, + x86.ASUBL, + x86.ASUBQ, + x86.AANDB, + x86.AANDW, + x86.AANDL, + x86.AANDQ, + x86.AORB, + x86.AORW, + x86.AORL, + x86.AORQ, + x86.AXORB, + x86.AXORW, + x86.AXORL, + x86.AXORQ, + x86.AINCB, + x86.AINCW, + x86.AINCL, + x86.AINCQ, + x86.ADECB, + x86.ADECW, + x86.ADECL, + x86.ADECQ, + x86.AMOVB, + x86.AMOVW, + x86.AMOVL, + x86.AMOVQ: + break + } + + cleani += 2 + reg := &clean[cleani-1] + reg1 := &clean[cleani-2] + reg.Op = gc.OEMPTY + reg1.Op = gc.OEMPTY + gc.Naddr(a, n) + return true + + case gc.ODOT, + gc.ODOTPTR: + cleani += 2 + reg := &clean[cleani-1] + reg1 := &clean[cleani-2] + reg.Op = gc.OEMPTY + reg1.Op = gc.OEMPTY + var nn *gc.Node + var oary [10]int64 + o := gc.Dotoffset(n, oary[:], &nn) + if nn == nil { + sudoclean() + return false + } + + if nn.Addable && o == 1 && oary[0] >= 0 { + // directly addressable set of DOTs + n1 := *nn + + n1.Type = n.Type + n1.Xoffset += oary[0] + gc.Naddr(a, &n1) + return true + } + + gc.Regalloc(reg, gc.Types[gc.Tptr], nil) + n1 := *reg + n1.Op = gc.OINDREG + if oary[0] >= 0 { + gc.Agen(nn, reg) + n1.Xoffset = oary[0] + } else { + gc.Cgen(nn, reg) + gc.Cgen_checknil(reg) + n1.Xoffset = -(oary[0] + 1) + } + + for i := 1; i < o; i++ { + if oary[i] >= 0 { + gc.Fatal("can't happen") + } + gins(movptr, &n1, reg) + gc.Cgen_checknil(reg) + n1.Xoffset = -(oary[i] + 1) + } + + a.Type = obj.TYPE_NONE + a.Index = obj.TYPE_NONE + gc.Fixlargeoffset(&n1) + gc.Naddr(a, &n1) + return true + + case gc.OINDEX: + return false + } + + return false +} diff --git a/src/cmd/compile/internal/amd64/peep.go b/src/cmd/compile/internal/amd64/peep.go new file mode 100644 index 0000000000000000000000000000000000000000..19db68e944981e67f834627dfee304eabcdf987f --- /dev/null +++ b/src/cmd/compile/internal/amd64/peep.go @@ -0,0 +1,1038 @@ +// Derived from Inferno utils/6c/peep.c +// http://code.google.com/p/inferno-os/source/browse/utils/6c/peep.c +// +// Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved. +// Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net) +// Portions Copyright © 1997-1999 Vita Nuova Limited +// Portions Copyright © 2000-2007 Vita Nuova Holdings Limited (www.vitanuova.com) +// Portions Copyright © 2004,2006 Bruce Ellis +// Portions Copyright © 2005-2007 C H Forsyth (forsyth@terzarima.net) +// Revisions Copyright © 2000-2007 Lucent Technologies Inc. and others +// Portions Copyright © 2009 The Go Authors. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +package amd64 + +import ( + "cmd/compile/internal/gc" + "cmd/internal/obj" + "cmd/internal/obj/x86" + "fmt" +) + +var gactive uint32 + +const ( + exregoffset = x86.REG_R15 +) + +// do we need the carry bit +func needc(p *obj.Prog) bool { + for p != nil { + flags := progcarryflags(p) + if flags&gc.UseCarry != 0 { + return true + } + if flags&(gc.SetCarry|gc.KillCarry) != 0 { + return false + } + p = p.Link + } + + return false +} + +func rnops(r *gc.Flow) *gc.Flow { + if r != nil { + var p *obj.Prog + var r1 *gc.Flow + for { + p = r.Prog + if p.As != obj.ANOP || p.From.Type != obj.TYPE_NONE || p.To.Type != obj.TYPE_NONE { + break + } + r1 = gc.Uniqs(r) + if r1 == nil { + break + } + r = r1 + } + } + + return r +} + +func peep(firstp *obj.Prog) { + g := (*gc.Graph)(gc.Flowstart(firstp, nil)) + if g == nil { + return + } + gactive = 0 + + // byte, word arithmetic elimination. + elimshortmov(g) + + // constant propagation + // find MOV $con,R followed by + // another MOV $con,R without + // setting R in the interim + var p *obj.Prog + for r := (*gc.Flow)(g.Start); r != nil; r = r.Link { + p = r.Prog + switch p.As { + case x86.ALEAL, + x86.ALEAQ: + if regtyp(&p.To) { + if p.From.Sym != nil { + if p.From.Index == x86.REG_NONE { + conprop(r) + } + } + } + + case x86.AMOVB, + x86.AMOVW, + x86.AMOVL, + x86.AMOVQ, + x86.AMOVSS, + x86.AMOVSD: + if regtyp(&p.To) { + if p.From.Type == obj.TYPE_CONST || p.From.Type == obj.TYPE_FCONST { + conprop(r) + } + } + } + } + + var r *gc.Flow + var r1 *gc.Flow + var p1 *obj.Prog + var t int +loop1: + if gc.Debug['P'] != 0 && gc.Debug['v'] != 0 { + gc.Dumpit("loop1", g.Start, 0) + } + + t = 0 + for r = g.Start; r != nil; r = r.Link { + p = r.Prog + switch p.As { + case x86.AMOVL, + x86.AMOVQ, + x86.AMOVSS, + x86.AMOVSD: + if regtyp(&p.To) { + if regtyp(&p.From) { + if copyprop(g, r) { + excise(r) + t++ + } else if subprop(r) && copyprop(g, r) { + excise(r) + t++ + } + } + } + + case x86.AMOVBLZX, + x86.AMOVWLZX, + x86.AMOVBLSX, + x86.AMOVWLSX: + if regtyp(&p.To) { + r1 = rnops(gc.Uniqs(r)) + if r1 != nil { + p1 = r1.Prog + if p.As == p1.As && p.To.Type == p1.From.Type && p.To.Reg == p1.From.Reg { + p1.As = x86.AMOVL + t++ + } + } + } + + case x86.AMOVBQSX, + x86.AMOVBQZX, + x86.AMOVWQSX, + x86.AMOVWQZX, + x86.AMOVLQSX, + x86.AMOVLQZX, + x86.AMOVQL: + if regtyp(&p.To) { + r1 = rnops(gc.Uniqs(r)) + if r1 != nil { + p1 = r1.Prog + if p.As == p1.As && p.To.Type == p1.From.Type && p.To.Reg == p1.From.Reg { + p1.As = x86.AMOVQ + t++ + } + } + } + + case x86.AADDL, + x86.AADDQ, + x86.AADDW: + if p.From.Type != obj.TYPE_CONST || needc(p.Link) { + break + } + if p.From.Offset == -1 { + if p.As == x86.AADDQ { + p.As = x86.ADECQ + } else if p.As == x86.AADDL { + p.As = x86.ADECL + } else { + p.As = x86.ADECW + } + p.From = obj.Addr{} + break + } + + if p.From.Offset == 1 { + if p.As == x86.AADDQ { + p.As = x86.AINCQ + } else if p.As == x86.AADDL { + p.As = x86.AINCL + } else { + p.As = x86.AINCW + } + p.From = obj.Addr{} + break + } + + case x86.ASUBL, + x86.ASUBQ, + x86.ASUBW: + if p.From.Type != obj.TYPE_CONST || needc(p.Link) { + break + } + if p.From.Offset == -1 { + if p.As == x86.ASUBQ { + p.As = x86.AINCQ + } else if p.As == x86.ASUBL { + p.As = x86.AINCL + } else { + p.As = x86.AINCW + } + p.From = obj.Addr{} + break + } + + if p.From.Offset == 1 { + if p.As == x86.ASUBQ { + p.As = x86.ADECQ + } else if p.As == x86.ASUBL { + p.As = x86.ADECL + } else { + p.As = x86.ADECW + } + p.From = obj.Addr{} + break + } + } + } + + if t != 0 { + goto loop1 + } + + // MOVLQZX removal. + // The MOVLQZX exists to avoid being confused for a + // MOVL that is just copying 32-bit data around during + // copyprop. Now that copyprop is done, remov MOVLQZX R1, R2 + // if it is dominated by an earlier ADDL/MOVL/etc into R1 that + // will have already cleared the high bits. + // + // MOVSD removal. + // We never use packed registers, so a MOVSD between registers + // can be replaced by MOVAPD, which moves the pair of float64s + // instead of just the lower one. We only use the lower one, but + // the processor can do better if we do moves using both. + for r := (*gc.Flow)(g.Start); r != nil; r = r.Link { + p = r.Prog + if p.As == x86.AMOVLQZX { + if regtyp(&p.From) { + if p.From.Type == p.To.Type && p.From.Reg == p.To.Reg { + if prevl(r, int(p.From.Reg)) { + excise(r) + } + } + } + } + + if p.As == x86.AMOVSD { + if regtyp(&p.From) { + if regtyp(&p.To) { + p.As = x86.AMOVAPD + } + } + } + } + + // load pipelining + // push any load from memory as early as possible + // to give it time to complete before use. + for r := (*gc.Flow)(g.Start); r != nil; r = r.Link { + p = r.Prog + switch p.As { + case x86.AMOVB, + x86.AMOVW, + x86.AMOVL, + x86.AMOVQ, + x86.AMOVLQZX: + if regtyp(&p.To) && !regconsttyp(&p.From) { + pushback(r) + } + } + } + + gc.Flowend(g) +} + +func pushback(r0 *gc.Flow) { + var r *gc.Flow + var p *obj.Prog + + var b *gc.Flow + p0 := (*obj.Prog)(r0.Prog) + for r = gc.Uniqp(r0); r != nil && gc.Uniqs(r) != nil; r = gc.Uniqp(r) { + p = r.Prog + if p.As != obj.ANOP { + if !regconsttyp(&p.From) || !regtyp(&p.To) { + break + } + if copyu(p, &p0.To, nil) != 0 || copyu(p0, &p.To, nil) != 0 { + break + } + } + + if p.As == obj.ACALL { + break + } + b = r + } + + if b == nil { + if gc.Debug['P'] != 0 && gc.Debug['v'] != 0 { + fmt.Printf("no pushback: %v\n", r0.Prog) + if r != nil { + fmt.Printf("\t%v [%v]\n", r.Prog, gc.Uniqs(r) != nil) + } + } + + return + } + + if gc.Debug['P'] != 0 && gc.Debug['v'] != 0 { + fmt.Printf("pushback\n") + for r := (*gc.Flow)(b); ; r = r.Link { + fmt.Printf("\t%v\n", r.Prog) + if r == r0 { + break + } + } + } + + t := obj.Prog(*r0.Prog) + for r = gc.Uniqp(r0); ; r = gc.Uniqp(r) { + p0 = r.Link.Prog + p = r.Prog + p0.As = p.As + p0.Lineno = p.Lineno + p0.From = p.From + p0.To = p.To + + if r == b { + break + } + } + + p0 = r.Prog + p0.As = t.As + p0.Lineno = t.Lineno + p0.From = t.From + p0.To = t.To + + if gc.Debug['P'] != 0 && gc.Debug['v'] != 0 { + fmt.Printf("\tafter\n") + for r := (*gc.Flow)(b); ; r = r.Link { + fmt.Printf("\t%v\n", r.Prog) + if r == r0 { + break + } + } + } +} + +func excise(r *gc.Flow) { + p := (*obj.Prog)(r.Prog) + if gc.Debug['P'] != 0 && gc.Debug['v'] != 0 { + fmt.Printf("%v ===delete===\n", p) + } + + obj.Nopout(p) + + gc.Ostats.Ndelmov++ +} + +func regtyp(a *obj.Addr) bool { + return a.Type == obj.TYPE_REG && (x86.REG_AX <= a.Reg && a.Reg <= x86.REG_R15 || x86.REG_X0 <= a.Reg && a.Reg <= x86.REG_X15) +} + +// movb elimination. +// movb is simulated by the linker +// when a register other than ax, bx, cx, dx +// is used, so rewrite to other instructions +// when possible. a movb into a register +// can smash the entire 32-bit register without +// causing any trouble. +// +// TODO: Using the Q forms here instead of the L forms +// seems unnecessary, and it makes the instructions longer. +func elimshortmov(g *gc.Graph) { + var p *obj.Prog + + for r := (*gc.Flow)(g.Start); r != nil; r = r.Link { + p = r.Prog + if regtyp(&p.To) { + switch p.As { + case x86.AINCB, + x86.AINCW: + p.As = x86.AINCQ + + case x86.ADECB, + x86.ADECW: + p.As = x86.ADECQ + + case x86.ANEGB, + x86.ANEGW: + p.As = x86.ANEGQ + + case x86.ANOTB, + x86.ANOTW: + p.As = x86.ANOTQ + } + + if regtyp(&p.From) || p.From.Type == obj.TYPE_CONST { + // move or artihmetic into partial register. + // from another register or constant can be movl. + // we don't switch to 64-bit arithmetic if it can + // change how the carry bit is set (and the carry bit is needed). + switch p.As { + case x86.AMOVB, + x86.AMOVW: + p.As = x86.AMOVQ + + case x86.AADDB, + x86.AADDW: + if !needc(p.Link) { + p.As = x86.AADDQ + } + + case x86.ASUBB, + x86.ASUBW: + if !needc(p.Link) { + p.As = x86.ASUBQ + } + + case x86.AMULB, + x86.AMULW: + p.As = x86.AMULQ + + case x86.AIMULB, + x86.AIMULW: + p.As = x86.AIMULQ + + case x86.AANDB, + x86.AANDW: + p.As = x86.AANDQ + + case x86.AORB, + x86.AORW: + p.As = x86.AORQ + + case x86.AXORB, + x86.AXORW: + p.As = x86.AXORQ + + case x86.ASHLB, + x86.ASHLW: + p.As = x86.ASHLQ + } + } else if p.From.Type != obj.TYPE_REG { + // explicit zero extension, but don't + // do that if source is a byte register + // (only AH can occur and it's forbidden). + switch p.As { + case x86.AMOVB: + p.As = x86.AMOVBQZX + + case x86.AMOVW: + p.As = x86.AMOVWQZX + } + } + } + } +} + +// is 'a' a register or constant? +func regconsttyp(a *obj.Addr) bool { + if regtyp(a) { + return true + } + switch a.Type { + case obj.TYPE_CONST, + obj.TYPE_FCONST, + obj.TYPE_SCONST, + obj.TYPE_ADDR: // TODO(rsc): Not all TYPE_ADDRs are constants. + return true + } + + return false +} + +// is reg guaranteed to be truncated by a previous L instruction? +func prevl(r0 *gc.Flow, reg int) bool { + for r := (*gc.Flow)(gc.Uniqp(r0)); r != nil; r = gc.Uniqp(r) { + p := r.Prog + if p.To.Type == obj.TYPE_REG && int(p.To.Reg) == reg { + flags := progflags(p) + if flags&gc.RightWrite != 0 { + if flags&gc.SizeL != 0 { + return true + } + return false + } + } + } + + return false +} + +/* + * the idea is to substitute + * one register for another + * from one MOV to another + * MOV a, R0 + * ADD b, R0 / no use of R1 + * MOV R0, R1 + * would be converted to + * MOV a, R1 + * ADD b, R1 + * MOV R1, R0 + * hopefully, then the former or latter MOV + * will be eliminated by copy propagation. + */ +func subprop(r0 *gc.Flow) bool { + if gc.Debug['P'] != 0 && gc.Debug['v'] != 0 { + fmt.Printf("subprop %v\n", r0.Prog) + } + p := (*obj.Prog)(r0.Prog) + v1 := (*obj.Addr)(&p.From) + if !regtyp(v1) { + if gc.Debug['P'] != 0 && gc.Debug['v'] != 0 { + fmt.Printf("\tnot regtype %v; return 0\n", gc.Ctxt.Dconv(v1)) + } + return false + } + + v2 := (*obj.Addr)(&p.To) + if !regtyp(v2) { + if gc.Debug['P'] != 0 && gc.Debug['v'] != 0 { + fmt.Printf("\tnot regtype %v; return 0\n", gc.Ctxt.Dconv(v2)) + } + return false + } + + for r := gc.Uniqp(r0); r != nil; r = gc.Uniqp(r) { + if gc.Debug['P'] != 0 && gc.Debug['v'] != 0 { + fmt.Printf("\t? %v\n", r.Prog) + } + if gc.Uniqs(r) == nil { + if gc.Debug['P'] != 0 && gc.Debug['v'] != 0 { + fmt.Printf("\tno unique successor\n") + } + break + } + + p = r.Prog + if p.As == obj.AVARDEF || p.As == obj.AVARKILL { + continue + } + if p.Info.Flags&gc.Call != 0 { + if gc.Debug['P'] != 0 && gc.Debug['v'] != 0 { + fmt.Printf("\tfound %v; return 0\n", p) + } + return false + } + + if p.Info.Reguse|p.Info.Regset != 0 { + if gc.Debug['P'] != 0 && gc.Debug['v'] != 0 { + fmt.Printf("\tfound %v; return 0\n", p) + } + return false + } + + if (p.Info.Flags&gc.Move != 0) && (p.Info.Flags&(gc.SizeL|gc.SizeQ|gc.SizeF|gc.SizeD) != 0) && p.To.Type == v1.Type && p.To.Reg == v1.Reg { + copysub(&p.To, v1, v2, 1) + if gc.Debug['P'] != 0 { + fmt.Printf("gotit: %v->%v\n%v", gc.Ctxt.Dconv(v1), gc.Ctxt.Dconv(v2), r.Prog) + if p.From.Type == v2.Type && p.From.Reg == v2.Reg { + fmt.Printf(" excise") + } + fmt.Printf("\n") + } + + for r = gc.Uniqs(r); r != r0; r = gc.Uniqs(r) { + p = r.Prog + copysub(&p.From, v1, v2, 1) + copysub(&p.To, v1, v2, 1) + if gc.Debug['P'] != 0 { + fmt.Printf("%v\n", r.Prog) + } + } + + t := int(int(v1.Reg)) + v1.Reg = v2.Reg + v2.Reg = int16(t) + if gc.Debug['P'] != 0 { + fmt.Printf("%v last\n", r.Prog) + } + return true + } + + if copyau(&p.From, v2) || copyau(&p.To, v2) { + if gc.Debug['P'] != 0 && gc.Debug['v'] != 0 { + fmt.Printf("\tcopyau %v failed\n", gc.Ctxt.Dconv(v2)) + } + break + } + + if copysub(&p.From, v1, v2, 0) != 0 || copysub(&p.To, v1, v2, 0) != 0 { + if gc.Debug['P'] != 0 && gc.Debug['v'] != 0 { + fmt.Printf("\tcopysub failed\n") + } + break + } + } + + if gc.Debug['P'] != 0 && gc.Debug['v'] != 0 { + fmt.Printf("\tran off end; return 0\n") + } + return false +} + +/* + * The idea is to remove redundant copies. + * v1->v2 F=0 + * (use v2 s/v2/v1/)* + * set v1 F=1 + * use v2 return fail + * ----------------- + * v1->v2 F=0 + * (use v2 s/v2/v1/)* + * set v1 F=1 + * set v2 return success + */ +func copyprop(g *gc.Graph, r0 *gc.Flow) bool { + if gc.Debug['P'] != 0 && gc.Debug['v'] != 0 { + fmt.Printf("copyprop %v\n", r0.Prog) + } + p := (*obj.Prog)(r0.Prog) + v1 := (*obj.Addr)(&p.From) + v2 := (*obj.Addr)(&p.To) + if copyas(v1, v2) { + return true + } + gactive++ + return copy1(v1, v2, r0.S1, 0) +} + +func copy1(v1 *obj.Addr, v2 *obj.Addr, r *gc.Flow, f int) bool { + if uint32(r.Active) == gactive { + if gc.Debug['P'] != 0 { + fmt.Printf("act set; return 1\n") + } + return true + } + + r.Active = int32(gactive) + if gc.Debug['P'] != 0 { + fmt.Printf("copy %v->%v f=%d\n", gc.Ctxt.Dconv(v1), gc.Ctxt.Dconv(v2), f) + } + var t int + var p *obj.Prog + for ; r != nil; r = r.S1 { + p = r.Prog + if gc.Debug['P'] != 0 { + fmt.Printf("%v", p) + } + if f == 0 && gc.Uniqp(r) == nil { + f = 1 + if gc.Debug['P'] != 0 { + fmt.Printf("; merge; f=%d", f) + } + } + + t = copyu(p, v2, nil) + switch t { + case 2: /* rar, can't split */ + if gc.Debug['P'] != 0 { + fmt.Printf("; %v rar; return 0\n", gc.Ctxt.Dconv(v2)) + } + return false + + case 3: /* set */ + if gc.Debug['P'] != 0 { + fmt.Printf("; %v set; return 1\n", gc.Ctxt.Dconv(v2)) + } + return true + + case 1, /* used, substitute */ + 4: /* use and set */ + if f != 0 { + if gc.Debug['P'] == 0 { + return false + } + if t == 4 { + fmt.Printf("; %v used+set and f=%d; return 0\n", gc.Ctxt.Dconv(v2), f) + } else { + fmt.Printf("; %v used and f=%d; return 0\n", gc.Ctxt.Dconv(v2), f) + } + return false + } + + if copyu(p, v2, v1) != 0 { + if gc.Debug['P'] != 0 { + fmt.Printf("; sub fail; return 0\n") + } + return false + } + + if gc.Debug['P'] != 0 { + fmt.Printf("; sub %v/%v", gc.Ctxt.Dconv(v2), gc.Ctxt.Dconv(v1)) + } + if t == 4 { + if gc.Debug['P'] != 0 { + fmt.Printf("; %v used+set; return 1\n", gc.Ctxt.Dconv(v2)) + } + return true + } + } + + if f == 0 { + t = copyu(p, v1, nil) + if f == 0 && (t == 2 || t == 3 || t == 4) { + f = 1 + if gc.Debug['P'] != 0 { + fmt.Printf("; %v set and !f; f=%d", gc.Ctxt.Dconv(v1), f) + } + } + } + + if gc.Debug['P'] != 0 { + fmt.Printf("\n") + } + if r.S2 != nil { + if !copy1(v1, v2, r.S2, f) { + return false + } + } + } + + return true +} + +/* + * return + * 1 if v only used (and substitute), + * 2 if read-alter-rewrite + * 3 if set + * 4 if set and used + * 0 otherwise (not touched) + */ +func copyu(p *obj.Prog, v *obj.Addr, s *obj.Addr) int { + switch p.As { + case obj.AJMP: + if s != nil { + if copysub(&p.To, v, s, 1) != 0 { + return 1 + } + return 0 + } + + if copyau(&p.To, v) { + return 1 + } + return 0 + + case obj.ARET: + if s != nil { + return 1 + } + return 3 + + case obj.ACALL: + if x86.REGEXT != 0 /*TypeKind(100016)*/ && v.Type == obj.TYPE_REG && v.Reg <= x86.REGEXT && v.Reg > exregoffset { + return 2 + } + if x86.REGARG >= 0 && v.Type == obj.TYPE_REG && v.Reg == x86.REGARG { + return 2 + } + if v.Type == p.From.Type && v.Reg == p.From.Reg { + return 2 + } + + if s != nil { + if copysub(&p.To, v, s, 1) != 0 { + return 1 + } + return 0 + } + + if copyau(&p.To, v) { + return 4 + } + return 3 + + case obj.ATEXT: + if x86.REGARG >= 0 && v.Type == obj.TYPE_REG && v.Reg == x86.REGARG { + return 3 + } + return 0 + } + + if p.As == obj.AVARDEF || p.As == obj.AVARKILL { + return 0 + } + + if (p.Info.Reguse|p.Info.Regset)&RtoB(int(v.Reg)) != 0 { + return 2 + } + + if p.Info.Flags&gc.LeftAddr != 0 { + if copyas(&p.From, v) { + return 2 + } + } + + if p.Info.Flags&(gc.RightRead|gc.RightWrite) == gc.RightRead|gc.RightWrite { + if copyas(&p.To, v) { + return 2 + } + } + + if p.Info.Flags&gc.RightWrite != 0 { + if copyas(&p.To, v) { + if s != nil { + return copysub(&p.From, v, s, 1) + } + if copyau(&p.From, v) { + return 4 + } + return 3 + } + } + + if p.Info.Flags&(gc.LeftAddr|gc.LeftRead|gc.LeftWrite|gc.RightAddr|gc.RightRead|gc.RightWrite) != 0 { + if s != nil { + if copysub(&p.From, v, s, 1) != 0 { + return 1 + } + return copysub(&p.To, v, s, 1) + } + + if copyau(&p.From, v) { + return 1 + } + if copyau(&p.To, v) { + return 1 + } + } + + return 0 +} + +/* + * direct reference, + * could be set/use depending on + * semantics + */ +func copyas(a *obj.Addr, v *obj.Addr) bool { + if x86.REG_AL <= a.Reg && a.Reg <= x86.REG_R15B { + gc.Fatal("use of byte register") + } + if x86.REG_AL <= v.Reg && v.Reg <= x86.REG_R15B { + gc.Fatal("use of byte register") + } + + if a.Type != v.Type || a.Name != v.Name || a.Reg != v.Reg { + return false + } + if regtyp(v) { + return true + } + if v.Type == obj.TYPE_MEM && (v.Name == obj.NAME_AUTO || v.Name == obj.NAME_PARAM) { + if v.Offset == a.Offset { + return true + } + } + return false +} + +func sameaddr(a *obj.Addr, v *obj.Addr) bool { + if a.Type != v.Type || a.Name != v.Name || a.Reg != v.Reg { + return false + } + if regtyp(v) { + return true + } + if v.Type == obj.TYPE_MEM && (v.Name == obj.NAME_AUTO || v.Name == obj.NAME_PARAM) { + if v.Offset == a.Offset { + return true + } + } + return false +} + +/* + * either direct or indirect + */ +func copyau(a *obj.Addr, v *obj.Addr) bool { + if copyas(a, v) { + if gc.Debug['P'] != 0 && gc.Debug['v'] != 0 { + fmt.Printf("\tcopyau: copyas returned 1\n") + } + return true + } + + if regtyp(v) { + if a.Type == obj.TYPE_MEM && a.Reg == v.Reg { + if gc.Debug['P'] != 0 && gc.Debug['v'] != 0 { + fmt.Printf("\tcopyau: found indir use - return 1\n") + } + return true + } + + if a.Index == v.Reg { + if gc.Debug['P'] != 0 && gc.Debug['v'] != 0 { + fmt.Printf("\tcopyau: found index use - return 1\n") + } + return true + } + } + + return false +} + +/* + * substitute s for v in a + * return failure to substitute + */ +func copysub(a *obj.Addr, v *obj.Addr, s *obj.Addr, f int) int { + if copyas(a, v) { + reg := int(int(s.Reg)) + if reg >= x86.REG_AX && reg <= x86.REG_R15 || reg >= x86.REG_X0 && reg <= x86.REG_X0+15 { + if f != 0 { + a.Reg = int16(reg) + } + } + + return 0 + } + + if regtyp(v) { + reg := int(int(v.Reg)) + if a.Type == obj.TYPE_MEM && int(a.Reg) == reg { + if (s.Reg == x86.REG_BP || s.Reg == x86.REG_R13) && a.Index != x86.REG_NONE { + return 1 /* can't use BP-base with index */ + } + if f != 0 { + a.Reg = s.Reg + } + } + + // return 0; + if int(a.Index) == reg { + if f != 0 { + a.Index = s.Reg + } + return 0 + } + + return 0 + } + + return 0 +} + +func conprop(r0 *gc.Flow) { + var p *obj.Prog + var t int + + p0 := (*obj.Prog)(r0.Prog) + v0 := (*obj.Addr)(&p0.To) + r := (*gc.Flow)(r0) + +loop: + r = gc.Uniqs(r) + if r == nil || r == r0 { + return + } + if gc.Uniqp(r) == nil { + return + } + + p = r.Prog + t = copyu(p, v0, nil) + switch t { + case 0, // miss + 1: // use + goto loop + + case 2, // rar + 4: // use and set + break + + case 3: // set + if p.As == p0.As { + if p.From.Type == p0.From.Type { + if p.From.Reg == p0.From.Reg { + if p.From.Node == p0.From.Node { + if p.From.Offset == p0.From.Offset { + if p.From.Scale == p0.From.Scale { + if p.From.Type == obj.TYPE_FCONST && p.From.Val.(float64) == p0.From.Val.(float64) { + if p.From.Index == p0.From.Index { + excise(r) + goto loop + } + } + } + } + } + } + } + } + } +} + +func smallindir(a *obj.Addr, reg *obj.Addr) bool { + return regtyp(reg) && a.Type == obj.TYPE_MEM && a.Reg == reg.Reg && a.Index == x86.REG_NONE && 0 <= a.Offset && a.Offset < 4096 +} + +func stackaddr(a *obj.Addr) bool { + return a.Type == obj.TYPE_REG && a.Reg == x86.REG_SP +} diff --git a/src/cmd/compile/internal/amd64/prog.go b/src/cmd/compile/internal/amd64/prog.go new file mode 100644 index 0000000000000000000000000000000000000000..00918c869185d21e86c551a0e318ff9879721be7 --- /dev/null +++ b/src/cmd/compile/internal/amd64/prog.go @@ -0,0 +1,308 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package amd64 + +import ( + "cmd/compile/internal/gc" + "cmd/internal/obj" + "cmd/internal/obj/x86" +) + +const ( + LeftRdwr uint32 = gc.LeftRead | gc.LeftWrite + RightRdwr uint32 = gc.RightRead | gc.RightWrite +) + +// This table gives the basic information about instruction +// generated by the compiler and processed in the optimizer. +// See opt.h for bit definitions. +// +// Instructions not generated need not be listed. +// As an exception to that rule, we typically write down all the +// size variants of an operation even if we just use a subset. +// +// The table is formatted for 8-space tabs. +var progtable = [x86.ALAST]obj.ProgInfo{ + obj.ATYPE: {gc.Pseudo | gc.Skip, 0, 0, 0}, + obj.ATEXT: {gc.Pseudo, 0, 0, 0}, + obj.AFUNCDATA: {gc.Pseudo, 0, 0, 0}, + obj.APCDATA: {gc.Pseudo, 0, 0, 0}, + obj.AUNDEF: {gc.Break, 0, 0, 0}, + obj.AUSEFIELD: {gc.OK, 0, 0, 0}, + obj.ACHECKNIL: {gc.LeftRead, 0, 0, 0}, + obj.AVARDEF: {gc.Pseudo | gc.RightWrite, 0, 0, 0}, + obj.AVARKILL: {gc.Pseudo | gc.RightWrite, 0, 0, 0}, + + // NOP is an internal no-op that also stands + // for USED and SET annotations, not the Intel opcode. + obj.ANOP: {gc.LeftRead | gc.RightWrite, 0, 0, 0}, + x86.AADCL: {gc.SizeL | gc.LeftRead | RightRdwr | gc.SetCarry | gc.UseCarry, 0, 0, 0}, + x86.AADCQ: {gc.SizeQ | gc.LeftRead | RightRdwr | gc.SetCarry | gc.UseCarry, 0, 0, 0}, + x86.AADCW: {gc.SizeW | gc.LeftRead | RightRdwr | gc.SetCarry | gc.UseCarry, 0, 0, 0}, + x86.AADDB: {gc.SizeB | gc.LeftRead | RightRdwr | gc.SetCarry, 0, 0, 0}, + x86.AADDL: {gc.SizeL | gc.LeftRead | RightRdwr | gc.SetCarry, 0, 0, 0}, + x86.AADDW: {gc.SizeW | gc.LeftRead | RightRdwr | gc.SetCarry, 0, 0, 0}, + x86.AADDQ: {gc.SizeQ | gc.LeftRead | RightRdwr | gc.SetCarry, 0, 0, 0}, + x86.AADDSD: {gc.SizeD | gc.LeftRead | RightRdwr, 0, 0, 0}, + x86.AADDSS: {gc.SizeF | gc.LeftRead | RightRdwr, 0, 0, 0}, + x86.AANDB: {gc.SizeB | gc.LeftRead | RightRdwr | gc.SetCarry, 0, 0, 0}, + x86.AANDL: {gc.SizeL | gc.LeftRead | RightRdwr | gc.SetCarry, 0, 0, 0}, + x86.AANDQ: {gc.SizeQ | gc.LeftRead | RightRdwr | gc.SetCarry, 0, 0, 0}, + x86.AANDW: {gc.SizeW | gc.LeftRead | RightRdwr | gc.SetCarry, 0, 0, 0}, + obj.ACALL: {gc.RightAddr | gc.Call | gc.KillCarry, 0, 0, 0}, + x86.ACDQ: {gc.OK, AX, AX | DX, 0}, + x86.ACQO: {gc.OK, AX, AX | DX, 0}, + x86.ACWD: {gc.OK, AX, AX | DX, 0}, + x86.ACLD: {gc.OK, 0, 0, 0}, + x86.ASTD: {gc.OK, 0, 0, 0}, + x86.ACMPB: {gc.SizeB | gc.LeftRead | gc.RightRead | gc.SetCarry, 0, 0, 0}, + x86.ACMPL: {gc.SizeL | gc.LeftRead | gc.RightRead | gc.SetCarry, 0, 0, 0}, + x86.ACMPQ: {gc.SizeQ | gc.LeftRead | gc.RightRead | gc.SetCarry, 0, 0, 0}, + x86.ACMPW: {gc.SizeW | gc.LeftRead | gc.RightRead | gc.SetCarry, 0, 0, 0}, + x86.ACOMISD: {gc.SizeD | gc.LeftRead | gc.RightRead | gc.SetCarry, 0, 0, 0}, + x86.ACOMISS: {gc.SizeF | gc.LeftRead | gc.RightRead | gc.SetCarry, 0, 0, 0}, + x86.ACVTSD2SL: {gc.SizeL | gc.LeftRead | gc.RightWrite | gc.Conv, 0, 0, 0}, + x86.ACVTSD2SQ: {gc.SizeQ | gc.LeftRead | gc.RightWrite | gc.Conv, 0, 0, 0}, + x86.ACVTSD2SS: {gc.SizeF | gc.LeftRead | gc.RightWrite | gc.Conv, 0, 0, 0}, + x86.ACVTSL2SD: {gc.SizeD | gc.LeftRead | gc.RightWrite | gc.Conv, 0, 0, 0}, + x86.ACVTSL2SS: {gc.SizeF | gc.LeftRead | gc.RightWrite | gc.Conv, 0, 0, 0}, + x86.ACVTSQ2SD: {gc.SizeD | gc.LeftRead | gc.RightWrite | gc.Conv, 0, 0, 0}, + x86.ACVTSQ2SS: {gc.SizeF | gc.LeftRead | gc.RightWrite | gc.Conv, 0, 0, 0}, + x86.ACVTSS2SD: {gc.SizeD | gc.LeftRead | gc.RightWrite | gc.Conv, 0, 0, 0}, + x86.ACVTSS2SL: {gc.SizeL | gc.LeftRead | gc.RightWrite | gc.Conv, 0, 0, 0}, + x86.ACVTSS2SQ: {gc.SizeQ | gc.LeftRead | gc.RightWrite | gc.Conv, 0, 0, 0}, + x86.ACVTTSD2SL: {gc.SizeL | gc.LeftRead | gc.RightWrite | gc.Conv, 0, 0, 0}, + x86.ACVTTSD2SQ: {gc.SizeQ | gc.LeftRead | gc.RightWrite | gc.Conv, 0, 0, 0}, + x86.ACVTTSS2SL: {gc.SizeL | gc.LeftRead | gc.RightWrite | gc.Conv, 0, 0, 0}, + x86.ACVTTSS2SQ: {gc.SizeQ | gc.LeftRead | gc.RightWrite | gc.Conv, 0, 0, 0}, + x86.ADECB: {gc.SizeB | RightRdwr, 0, 0, 0}, + x86.ADECL: {gc.SizeL | RightRdwr, 0, 0, 0}, + x86.ADECQ: {gc.SizeQ | RightRdwr, 0, 0, 0}, + x86.ADECW: {gc.SizeW | RightRdwr, 0, 0, 0}, + x86.ADIVB: {gc.SizeB | gc.LeftRead | gc.SetCarry, AX, AX, 0}, + x86.ADIVL: {gc.SizeL | gc.LeftRead | gc.SetCarry, AX | DX, AX | DX, 0}, + x86.ADIVQ: {gc.SizeQ | gc.LeftRead | gc.SetCarry, AX | DX, AX | DX, 0}, + x86.ADIVW: {gc.SizeW | gc.LeftRead | gc.SetCarry, AX | DX, AX | DX, 0}, + x86.ADIVSD: {gc.SizeD | gc.LeftRead | RightRdwr, 0, 0, 0}, + x86.ADIVSS: {gc.SizeF | gc.LeftRead | RightRdwr, 0, 0, 0}, + x86.AIDIVB: {gc.SizeB | gc.LeftRead | gc.SetCarry, AX, AX, 0}, + x86.AIDIVL: {gc.SizeL | gc.LeftRead | gc.SetCarry, AX | DX, AX | DX, 0}, + x86.AIDIVQ: {gc.SizeQ | gc.LeftRead | gc.SetCarry, AX | DX, AX | DX, 0}, + x86.AIDIVW: {gc.SizeW | gc.LeftRead | gc.SetCarry, AX | DX, AX | DX, 0}, + x86.AIMULB: {gc.SizeB | gc.LeftRead | gc.SetCarry, AX, AX, 0}, + x86.AIMULL: {gc.SizeL | gc.LeftRead | gc.ImulAXDX | gc.SetCarry, 0, 0, 0}, + x86.AIMULQ: {gc.SizeQ | gc.LeftRead | gc.ImulAXDX | gc.SetCarry, 0, 0, 0}, + x86.AIMULW: {gc.SizeW | gc.LeftRead | gc.ImulAXDX | gc.SetCarry, 0, 0, 0}, + x86.AINCB: {gc.SizeB | RightRdwr, 0, 0, 0}, + x86.AINCL: {gc.SizeL | RightRdwr, 0, 0, 0}, + x86.AINCQ: {gc.SizeQ | RightRdwr, 0, 0, 0}, + x86.AINCW: {gc.SizeW | RightRdwr, 0, 0, 0}, + x86.AJCC: {gc.Cjmp | gc.UseCarry, 0, 0, 0}, + x86.AJCS: {gc.Cjmp | gc.UseCarry, 0, 0, 0}, + x86.AJEQ: {gc.Cjmp | gc.UseCarry, 0, 0, 0}, + x86.AJGE: {gc.Cjmp | gc.UseCarry, 0, 0, 0}, + x86.AJGT: {gc.Cjmp | gc.UseCarry, 0, 0, 0}, + x86.AJHI: {gc.Cjmp | gc.UseCarry, 0, 0, 0}, + x86.AJLE: {gc.Cjmp | gc.UseCarry, 0, 0, 0}, + x86.AJLS: {gc.Cjmp | gc.UseCarry, 0, 0, 0}, + x86.AJLT: {gc.Cjmp | gc.UseCarry, 0, 0, 0}, + x86.AJMI: {gc.Cjmp | gc.UseCarry, 0, 0, 0}, + x86.AJNE: {gc.Cjmp | gc.UseCarry, 0, 0, 0}, + x86.AJOC: {gc.Cjmp | gc.UseCarry, 0, 0, 0}, + x86.AJOS: {gc.Cjmp | gc.UseCarry, 0, 0, 0}, + x86.AJPC: {gc.Cjmp | gc.UseCarry, 0, 0, 0}, + x86.AJPL: {gc.Cjmp | gc.UseCarry, 0, 0, 0}, + x86.AJPS: {gc.Cjmp | gc.UseCarry, 0, 0, 0}, + obj.AJMP: {gc.Jump | gc.Break | gc.KillCarry, 0, 0, 0}, + x86.ALEAL: {gc.LeftAddr | gc.RightWrite, 0, 0, 0}, + x86.ALEAQ: {gc.LeftAddr | gc.RightWrite, 0, 0, 0}, + x86.AMOVBLSX: {gc.SizeL | gc.LeftRead | gc.RightWrite | gc.Conv, 0, 0, 0}, + x86.AMOVBLZX: {gc.SizeL | gc.LeftRead | gc.RightWrite | gc.Conv, 0, 0, 0}, + x86.AMOVBQSX: {gc.SizeQ | gc.LeftRead | gc.RightWrite | gc.Conv, 0, 0, 0}, + x86.AMOVBQZX: {gc.SizeQ | gc.LeftRead | gc.RightWrite | gc.Conv, 0, 0, 0}, + x86.AMOVBWSX: {gc.SizeW | gc.LeftRead | gc.RightWrite | gc.Conv, 0, 0, 0}, + x86.AMOVBWZX: {gc.SizeW | gc.LeftRead | gc.RightWrite | gc.Conv, 0, 0, 0}, + x86.AMOVLQSX: {gc.SizeQ | gc.LeftRead | gc.RightWrite | gc.Conv, 0, 0, 0}, + x86.AMOVLQZX: {gc.SizeQ | gc.LeftRead | gc.RightWrite | gc.Conv, 0, 0, 0}, + x86.AMOVWLSX: {gc.SizeL | gc.LeftRead | gc.RightWrite | gc.Conv, 0, 0, 0}, + x86.AMOVWLZX: {gc.SizeL | gc.LeftRead | gc.RightWrite | gc.Conv, 0, 0, 0}, + x86.AMOVWQSX: {gc.SizeQ | gc.LeftRead | gc.RightWrite | gc.Conv, 0, 0, 0}, + x86.AMOVWQZX: {gc.SizeQ | gc.LeftRead | gc.RightWrite | gc.Conv, 0, 0, 0}, + x86.AMOVQL: {gc.SizeL | gc.LeftRead | gc.RightWrite | gc.Conv, 0, 0, 0}, + x86.AMOVB: {gc.SizeB | gc.LeftRead | gc.RightWrite | gc.Move, 0, 0, 0}, + x86.AMOVL: {gc.SizeL | gc.LeftRead | gc.RightWrite | gc.Move, 0, 0, 0}, + x86.AMOVQ: {gc.SizeQ | gc.LeftRead | gc.RightWrite | gc.Move, 0, 0, 0}, + x86.AMOVW: {gc.SizeW | gc.LeftRead | gc.RightWrite | gc.Move, 0, 0, 0}, + x86.AMOVSB: {gc.OK, DI | SI, DI | SI, 0}, + x86.AMOVSL: {gc.OK, DI | SI, DI | SI, 0}, + x86.AMOVSQ: {gc.OK, DI | SI, DI | SI, 0}, + x86.AMOVSW: {gc.OK, DI | SI, DI | SI, 0}, + obj.ADUFFCOPY: {gc.OK, DI | SI, DI | SI | CX, 0}, + x86.AMOVSD: {gc.SizeD | gc.LeftRead | gc.RightWrite | gc.Move, 0, 0, 0}, + x86.AMOVSS: {gc.SizeF | gc.LeftRead | gc.RightWrite | gc.Move, 0, 0, 0}, + + // We use MOVAPD as a faster synonym for MOVSD. + x86.AMOVAPD: {gc.SizeD | gc.LeftRead | gc.RightWrite | gc.Move, 0, 0, 0}, + x86.AMULB: {gc.SizeB | gc.LeftRead | gc.SetCarry, AX, AX, 0}, + x86.AMULL: {gc.SizeL | gc.LeftRead | gc.SetCarry, AX, AX | DX, 0}, + x86.AMULQ: {gc.SizeQ | gc.LeftRead | gc.SetCarry, AX, AX | DX, 0}, + x86.AMULW: {gc.SizeW | gc.LeftRead | gc.SetCarry, AX, AX | DX, 0}, + x86.AMULSD: {gc.SizeD | gc.LeftRead | RightRdwr, 0, 0, 0}, + x86.AMULSS: {gc.SizeF | gc.LeftRead | RightRdwr, 0, 0, 0}, + x86.ANEGB: {gc.SizeB | RightRdwr | gc.SetCarry, 0, 0, 0}, + x86.ANEGL: {gc.SizeL | RightRdwr | gc.SetCarry, 0, 0, 0}, + x86.ANEGQ: {gc.SizeQ | RightRdwr | gc.SetCarry, 0, 0, 0}, + x86.ANEGW: {gc.SizeW | RightRdwr | gc.SetCarry, 0, 0, 0}, + x86.ANOTB: {gc.SizeB | RightRdwr, 0, 0, 0}, + x86.ANOTL: {gc.SizeL | RightRdwr, 0, 0, 0}, + x86.ANOTQ: {gc.SizeQ | RightRdwr, 0, 0, 0}, + x86.ANOTW: {gc.SizeW | RightRdwr, 0, 0, 0}, + x86.AORB: {gc.SizeB | gc.LeftRead | RightRdwr | gc.SetCarry, 0, 0, 0}, + x86.AORL: {gc.SizeL | gc.LeftRead | RightRdwr | gc.SetCarry, 0, 0, 0}, + x86.AORQ: {gc.SizeQ | gc.LeftRead | RightRdwr | gc.SetCarry, 0, 0, 0}, + x86.AORW: {gc.SizeW | gc.LeftRead | RightRdwr | gc.SetCarry, 0, 0, 0}, + x86.APOPQ: {gc.SizeQ | gc.RightWrite, 0, 0, 0}, + x86.APUSHQ: {gc.SizeQ | gc.LeftRead, 0, 0, 0}, + x86.ARCLB: {gc.SizeB | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry | gc.UseCarry, 0, 0, 0}, + x86.ARCLL: {gc.SizeL | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry | gc.UseCarry, 0, 0, 0}, + x86.ARCLQ: {gc.SizeQ | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry | gc.UseCarry, 0, 0, 0}, + x86.ARCLW: {gc.SizeW | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry | gc.UseCarry, 0, 0, 0}, + x86.ARCRB: {gc.SizeB | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry | gc.UseCarry, 0, 0, 0}, + x86.ARCRL: {gc.SizeL | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry | gc.UseCarry, 0, 0, 0}, + x86.ARCRQ: {gc.SizeQ | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry | gc.UseCarry, 0, 0, 0}, + x86.ARCRW: {gc.SizeW | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry | gc.UseCarry, 0, 0, 0}, + x86.AREP: {gc.OK, CX, CX, 0}, + x86.AREPN: {gc.OK, CX, CX, 0}, + obj.ARET: {gc.Break | gc.KillCarry, 0, 0, 0}, + x86.AROLB: {gc.SizeB | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry, 0, 0, 0}, + x86.AROLL: {gc.SizeL | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry, 0, 0, 0}, + x86.AROLQ: {gc.SizeQ | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry, 0, 0, 0}, + x86.AROLW: {gc.SizeW | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry, 0, 0, 0}, + x86.ARORB: {gc.SizeB | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry, 0, 0, 0}, + x86.ARORL: {gc.SizeL | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry, 0, 0, 0}, + x86.ARORQ: {gc.SizeQ | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry, 0, 0, 0}, + x86.ARORW: {gc.SizeW | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry, 0, 0, 0}, + x86.ASALB: {gc.SizeB | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry, 0, 0, 0}, + x86.ASALL: {gc.SizeL | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry, 0, 0, 0}, + x86.ASALQ: {gc.SizeQ | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry, 0, 0, 0}, + x86.ASALW: {gc.SizeW | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry, 0, 0, 0}, + x86.ASARB: {gc.SizeB | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry, 0, 0, 0}, + x86.ASARL: {gc.SizeL | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry, 0, 0, 0}, + x86.ASARQ: {gc.SizeQ | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry, 0, 0, 0}, + x86.ASARW: {gc.SizeW | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry, 0, 0, 0}, + x86.ASBBB: {gc.SizeB | gc.LeftRead | RightRdwr | gc.SetCarry | gc.UseCarry, 0, 0, 0}, + x86.ASBBL: {gc.SizeL | gc.LeftRead | RightRdwr | gc.SetCarry | gc.UseCarry, 0, 0, 0}, + x86.ASBBQ: {gc.SizeQ | gc.LeftRead | RightRdwr | gc.SetCarry | gc.UseCarry, 0, 0, 0}, + x86.ASBBW: {gc.SizeW | gc.LeftRead | RightRdwr | gc.SetCarry | gc.UseCarry, 0, 0, 0}, + x86.ASETCC: {gc.SizeB | gc.RightWrite | gc.UseCarry, 0, 0, 0}, + x86.ASETCS: {gc.SizeB | gc.RightWrite | gc.UseCarry, 0, 0, 0}, + x86.ASETEQ: {gc.SizeB | gc.RightWrite | gc.UseCarry, 0, 0, 0}, + x86.ASETGE: {gc.SizeB | gc.RightWrite | gc.UseCarry, 0, 0, 0}, + x86.ASETGT: {gc.SizeB | gc.RightWrite | gc.UseCarry, 0, 0, 0}, + x86.ASETHI: {gc.SizeB | gc.RightWrite | gc.UseCarry, 0, 0, 0}, + x86.ASETLE: {gc.SizeB | gc.RightWrite | gc.UseCarry, 0, 0, 0}, + x86.ASETLS: {gc.SizeB | gc.RightWrite | gc.UseCarry, 0, 0, 0}, + x86.ASETLT: {gc.SizeB | gc.RightWrite | gc.UseCarry, 0, 0, 0}, + x86.ASETMI: {gc.SizeB | gc.RightWrite | gc.UseCarry, 0, 0, 0}, + x86.ASETNE: {gc.SizeB | gc.RightWrite | gc.UseCarry, 0, 0, 0}, + x86.ASETOC: {gc.SizeB | gc.RightWrite | gc.UseCarry, 0, 0, 0}, + x86.ASETOS: {gc.SizeB | gc.RightWrite | gc.UseCarry, 0, 0, 0}, + x86.ASETPC: {gc.SizeB | gc.RightWrite | gc.UseCarry, 0, 0, 0}, + x86.ASETPL: {gc.SizeB | gc.RightWrite | gc.UseCarry, 0, 0, 0}, + x86.ASETPS: {gc.SizeB | gc.RightWrite | gc.UseCarry, 0, 0, 0}, + x86.ASHLB: {gc.SizeB | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry, 0, 0, 0}, + x86.ASHLL: {gc.SizeL | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry, 0, 0, 0}, + x86.ASHLQ: {gc.SizeQ | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry, 0, 0, 0}, + x86.ASHLW: {gc.SizeW | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry, 0, 0, 0}, + x86.ASHRB: {gc.SizeB | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry, 0, 0, 0}, + x86.ASHRL: {gc.SizeL | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry, 0, 0, 0}, + x86.ASHRQ: {gc.SizeQ | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry, 0, 0, 0}, + x86.ASHRW: {gc.SizeW | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry, 0, 0, 0}, + x86.ASQRTSD: {gc.SizeD | gc.LeftRead | RightRdwr, 0, 0, 0}, + x86.ASTOSB: {gc.OK, AX | DI, DI, 0}, + x86.ASTOSL: {gc.OK, AX | DI, DI, 0}, + x86.ASTOSQ: {gc.OK, AX | DI, DI, 0}, + x86.ASTOSW: {gc.OK, AX | DI, DI, 0}, + obj.ADUFFZERO: {gc.OK, AX | DI, DI, 0}, + x86.ASUBB: {gc.SizeB | gc.LeftRead | RightRdwr | gc.SetCarry, 0, 0, 0}, + x86.ASUBL: {gc.SizeL | gc.LeftRead | RightRdwr | gc.SetCarry, 0, 0, 0}, + x86.ASUBQ: {gc.SizeQ | gc.LeftRead | RightRdwr | gc.SetCarry, 0, 0, 0}, + x86.ASUBW: {gc.SizeW | gc.LeftRead | RightRdwr | gc.SetCarry, 0, 0, 0}, + x86.ASUBSD: {gc.SizeD | gc.LeftRead | RightRdwr, 0, 0, 0}, + x86.ASUBSS: {gc.SizeF | gc.LeftRead | RightRdwr, 0, 0, 0}, + x86.ATESTB: {gc.SizeB | gc.LeftRead | gc.RightRead | gc.SetCarry, 0, 0, 0}, + x86.ATESTL: {gc.SizeL | gc.LeftRead | gc.RightRead | gc.SetCarry, 0, 0, 0}, + x86.ATESTQ: {gc.SizeQ | gc.LeftRead | gc.RightRead | gc.SetCarry, 0, 0, 0}, + x86.ATESTW: {gc.SizeW | gc.LeftRead | gc.RightRead | gc.SetCarry, 0, 0, 0}, + x86.AUCOMISD: {gc.SizeD | gc.LeftRead | gc.RightRead, 0, 0, 0}, + x86.AUCOMISS: {gc.SizeF | gc.LeftRead | gc.RightRead, 0, 0, 0}, + x86.AXCHGB: {gc.SizeB | LeftRdwr | RightRdwr, 0, 0, 0}, + x86.AXCHGL: {gc.SizeL | LeftRdwr | RightRdwr, 0, 0, 0}, + x86.AXCHGQ: {gc.SizeQ | LeftRdwr | RightRdwr, 0, 0, 0}, + x86.AXCHGW: {gc.SizeW | LeftRdwr | RightRdwr, 0, 0, 0}, + x86.AXORB: {gc.SizeB | gc.LeftRead | RightRdwr | gc.SetCarry, 0, 0, 0}, + x86.AXORL: {gc.SizeL | gc.LeftRead | RightRdwr | gc.SetCarry, 0, 0, 0}, + x86.AXORQ: {gc.SizeQ | gc.LeftRead | RightRdwr | gc.SetCarry, 0, 0, 0}, + x86.AXORW: {gc.SizeW | gc.LeftRead | RightRdwr | gc.SetCarry, 0, 0, 0}, +} + +func progflags(p *obj.Prog) uint32 { + flags := progtable[p.As].Flags + if flags&gc.ImulAXDX != 0 && p.To.Type != obj.TYPE_NONE { + flags |= RightRdwr + } + return flags +} + +func progcarryflags(p *obj.Prog) uint32 { + return progtable[p.As].Flags +} + +func proginfo(p *obj.Prog) { + info := &p.Info + *info = progtable[p.As] + if info.Flags == 0 { + gc.Fatal("unknown instruction %v", p) + } + + if (info.Flags&gc.ShiftCX != 0) && p.From.Type != obj.TYPE_CONST { + info.Reguse |= CX + } + + if info.Flags&gc.ImulAXDX != 0 { + if p.To.Type == obj.TYPE_NONE { + info.Reguse |= AX + info.Regset |= AX | DX + } else { + info.Flags |= RightRdwr + } + } + + // Addressing makes some registers used. + if p.From.Type == obj.TYPE_MEM && p.From.Name == obj.NAME_NONE { + info.Regindex |= RtoB(int(p.From.Reg)) + } + if p.From.Index != x86.REG_NONE { + info.Regindex |= RtoB(int(p.From.Index)) + } + if p.To.Type == obj.TYPE_MEM && p.To.Name == obj.NAME_NONE { + info.Regindex |= RtoB(int(p.To.Reg)) + } + if p.To.Index != x86.REG_NONE { + info.Regindex |= RtoB(int(p.To.Index)) + } + if gc.Ctxt.Flag_dynlink { + // When -dynlink is passed, many operations on external names (and + // also calling duffzero/duffcopy) use R15 as a scratch register. + if p.As == x86.ALEAQ || info.Flags == gc.Pseudo || p.As == obj.ACALL || p.As == obj.ARET || p.As == obj.AJMP { + return + } + if p.As == obj.ADUFFZERO || p.As == obj.ADUFFCOPY || (p.From.Name == obj.NAME_EXTERN && !p.From.Sym.Local) || (p.To.Name == obj.NAME_EXTERN && !p.To.Sym.Local) { + info.Reguse |= R15 + info.Regset |= R15 + return + } + } +} diff --git a/src/cmd/compile/internal/amd64/reg.go b/src/cmd/compile/internal/amd64/reg.go new file mode 100644 index 0000000000000000000000000000000000000000..8fab6399b1d88c86a08ca92b980eade55f7b0b95 --- /dev/null +++ b/src/cmd/compile/internal/amd64/reg.go @@ -0,0 +1,152 @@ +// Derived from Inferno utils/6c/reg.c +// http://code.google.com/p/inferno-os/source/browse/utils/6c/reg.c +// +// Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved. +// Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net) +// Portions Copyright © 1997-1999 Vita Nuova Limited +// Portions Copyright © 2000-2007 Vita Nuova Holdings Limited (www.vitanuova.com) +// Portions Copyright © 2004,2006 Bruce Ellis +// Portions Copyright © 2005-2007 C H Forsyth (forsyth@terzarima.net) +// Revisions Copyright © 2000-2007 Lucent Technologies Inc. and others +// Portions Copyright © 2009 The Go Authors. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +package amd64 + +import ( + "cmd/compile/internal/gc" + "cmd/internal/obj" + "cmd/internal/obj/x86" +) + +const ( + NREGVAR = 32 +) + +var regname = []string{ + ".AX", + ".CX", + ".DX", + ".BX", + ".SP", + ".BP", + ".SI", + ".DI", + ".R8", + ".R9", + ".R10", + ".R11", + ".R12", + ".R13", + ".R14", + ".R15", + ".X0", + ".X1", + ".X2", + ".X3", + ".X4", + ".X5", + ".X6", + ".X7", + ".X8", + ".X9", + ".X10", + ".X11", + ".X12", + ".X13", + ".X14", + ".X15", +} + +func regnames(n *int) []string { + *n = NREGVAR + return regname +} + +func excludedregs() uint64 { + return RtoB(x86.REG_SP) +} + +func doregbits(r int) uint64 { + b := uint64(0) + if r >= x86.REG_AX && r <= x86.REG_R15 { + b |= RtoB(r) + } else if r >= x86.REG_AL && r <= x86.REG_R15B { + b |= RtoB(r - x86.REG_AL + x86.REG_AX) + } else if r >= x86.REG_AH && r <= x86.REG_BH { + b |= RtoB(r - x86.REG_AH + x86.REG_AX) + } else if r >= x86.REG_X0 && r <= x86.REG_X0+15 { + b |= FtoB(r) + } + return b +} + +// For ProgInfo. +const ( + AX = 1 << (x86.REG_AX - x86.REG_AX) + BX = 1 << (x86.REG_BX - x86.REG_AX) + CX = 1 << (x86.REG_CX - x86.REG_AX) + DX = 1 << (x86.REG_DX - x86.REG_AX) + DI = 1 << (x86.REG_DI - x86.REG_AX) + SI = 1 << (x86.REG_SI - x86.REG_AX) + R15 = 1 << (x86.REG_R15 - x86.REG_AX) +) + +func RtoB(r int) uint64 { + if r < x86.REG_AX || r > x86.REG_R15 { + return 0 + } + return 1 << uint(r-x86.REG_AX) +} + +func BtoR(b uint64) int { + b &= 0xffff + if gc.Nacl { + b &^= (1<<(x86.REG_BP-x86.REG_AX) | 1<<(x86.REG_R15-x86.REG_AX)) + } else if obj.Framepointer_enabled != 0 { + // BP is part of the calling convention if framepointer_enabled. + b &^= (1 << (x86.REG_BP - x86.REG_AX)) + } + if b == 0 { + return 0 + } + return gc.Bitno(b) + x86.REG_AX +} + +/* + * bit reg + * 16 X0 + * ... + * 31 X15 + */ +func FtoB(f int) uint64 { + if f < x86.REG_X0 || f > x86.REG_X15 { + return 0 + } + return 1 << uint(f-x86.REG_X0+16) +} + +func BtoF(b uint64) int { + b &= 0xFFFF0000 + if b == 0 { + return 0 + } + return gc.Bitno(b) - 16 + x86.REG_X0 +} diff --git a/src/cmd/compile/internal/arm/cgen.go b/src/cmd/compile/internal/arm/cgen.go new file mode 100644 index 0000000000000000000000000000000000000000..8ea6c5f3f2d4e870846bcc09f8292894bcc423e2 --- /dev/null +++ b/src/cmd/compile/internal/arm/cgen.go @@ -0,0 +1,229 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package arm + +import ( + "cmd/compile/internal/gc" + "cmd/internal/obj" + "cmd/internal/obj/arm" +) + +/* + * generate array index into res. + * n might be any size; res is 32-bit. + * returns Prog* to patch to panic call. + */ +func cgenindex(n *gc.Node, res *gc.Node, bounded bool) *obj.Prog { + if !gc.Is64(n.Type) { + gc.Cgen(n, res) + return nil + } + + var tmp gc.Node + gc.Tempname(&tmp, gc.Types[gc.TINT64]) + gc.Cgen(n, &tmp) + var lo gc.Node + var hi gc.Node + split64(&tmp, &lo, &hi) + gmove(&lo, res) + if bounded { + splitclean() + return nil + } + + var n1 gc.Node + gc.Regalloc(&n1, gc.Types[gc.TINT32], nil) + var n2 gc.Node + gc.Regalloc(&n2, gc.Types[gc.TINT32], nil) + var zero gc.Node + gc.Nodconst(&zero, gc.Types[gc.TINT32], 0) + gmove(&hi, &n1) + gmove(&zero, &n2) + gins(arm.ACMP, &n1, &n2) + gc.Regfree(&n2) + gc.Regfree(&n1) + splitclean() + return gc.Gbranch(arm.ABNE, nil, -1) +} + +func igenindex(n *gc.Node, res *gc.Node, bounded bool) *obj.Prog { + gc.Tempname(res, n.Type) + return cgenindex(n, res, bounded) +} + +func blockcopy(n, res *gc.Node, osrc, odst, w int64) { + // determine alignment. + // want to avoid unaligned access, so have to use + // smaller operations for less aligned types. + // for example moving [4]byte must use 4 MOVB not 1 MOVW. + align := int(n.Type.Align) + + var op int + switch align { + default: + gc.Fatal("sgen: invalid alignment %d for %v", align, n.Type) + + case 1: + op = arm.AMOVB + + case 2: + op = arm.AMOVH + + case 4: + op = arm.AMOVW + } + + if w%int64(align) != 0 { + gc.Fatal("sgen: unaligned size %d (align=%d) for %v", w, align, n.Type) + } + c := int32(w / int64(align)) + + if osrc%int64(align) != 0 || odst%int64(align) != 0 { + gc.Fatal("sgen: unaligned offset src %d or dst %d (align %d)", osrc, odst, align) + } + + // if we are copying forward on the stack and + // the src and dst overlap, then reverse direction + dir := align + if osrc < odst && int64(odst) < int64(osrc)+w { + dir = -dir + } + + if op == arm.AMOVW && !gc.Nacl && dir > 0 && c >= 4 && c <= 128 { + var r0 gc.Node + r0.Op = gc.OREGISTER + r0.Reg = arm.REG_R0 + var r1 gc.Node + r1.Op = gc.OREGISTER + r1.Reg = arm.REG_R0 + 1 + var r2 gc.Node + r2.Op = gc.OREGISTER + r2.Reg = arm.REG_R0 + 2 + + var src gc.Node + gc.Regalloc(&src, gc.Types[gc.Tptr], &r1) + var dst gc.Node + gc.Regalloc(&dst, gc.Types[gc.Tptr], &r2) + if n.Ullman >= res.Ullman { + // eval n first + gc.Agen(n, &src) + + if res.Op == gc.ONAME { + gc.Gvardef(res) + } + gc.Agen(res, &dst) + } else { + // eval res first + if res.Op == gc.ONAME { + gc.Gvardef(res) + } + gc.Agen(res, &dst) + gc.Agen(n, &src) + } + + var tmp gc.Node + gc.Regalloc(&tmp, gc.Types[gc.Tptr], &r0) + f := gc.Sysfunc("duffcopy") + p := gins(obj.ADUFFCOPY, nil, f) + gc.Afunclit(&p.To, f) + + // 8 and 128 = magic constants: see ../../runtime/asm_arm.s + p.To.Offset = 8 * (128 - int64(c)) + + gc.Regfree(&tmp) + gc.Regfree(&src) + gc.Regfree(&dst) + return + } + + var dst gc.Node + var src gc.Node + if n.Ullman >= res.Ullman { + gc.Agenr(n, &dst, res) // temporarily use dst + gc.Regalloc(&src, gc.Types[gc.Tptr], nil) + gins(arm.AMOVW, &dst, &src) + if res.Op == gc.ONAME { + gc.Gvardef(res) + } + gc.Agen(res, &dst) + } else { + if res.Op == gc.ONAME { + gc.Gvardef(res) + } + gc.Agenr(res, &dst, res) + gc.Agenr(n, &src, nil) + } + + var tmp gc.Node + gc.Regalloc(&tmp, gc.Types[gc.TUINT32], nil) + + // set up end marker + var nend gc.Node + + if c >= 4 { + gc.Regalloc(&nend, gc.Types[gc.TUINT32], nil) + + p := gins(arm.AMOVW, &src, &nend) + p.From.Type = obj.TYPE_ADDR + if dir < 0 { + p.From.Offset = int64(dir) + } else { + p.From.Offset = w + } + } + + // move src and dest to the end of block if necessary + if dir < 0 { + p := gins(arm.AMOVW, &src, &src) + p.From.Type = obj.TYPE_ADDR + p.From.Offset = w + int64(dir) + + p = gins(arm.AMOVW, &dst, &dst) + p.From.Type = obj.TYPE_ADDR + p.From.Offset = w + int64(dir) + } + + // move + if c >= 4 { + p := gins(op, &src, &tmp) + p.From.Type = obj.TYPE_MEM + p.From.Offset = int64(dir) + p.Scond |= arm.C_PBIT + ploop := p + + p = gins(op, &tmp, &dst) + p.To.Type = obj.TYPE_MEM + p.To.Offset = int64(dir) + p.Scond |= arm.C_PBIT + + p = gins(arm.ACMP, &src, nil) + raddr(&nend, p) + + gc.Patch(gc.Gbranch(arm.ABNE, nil, 0), ploop) + gc.Regfree(&nend) + } else { + var p *obj.Prog + for { + tmp14 := c + c-- + if tmp14 <= 0 { + break + } + p = gins(op, &src, &tmp) + p.From.Type = obj.TYPE_MEM + p.From.Offset = int64(dir) + p.Scond |= arm.C_PBIT + + p = gins(op, &tmp, &dst) + p.To.Type = obj.TYPE_MEM + p.To.Offset = int64(dir) + p.Scond |= arm.C_PBIT + } + } + + gc.Regfree(&dst) + gc.Regfree(&src) + gc.Regfree(&tmp) +} diff --git a/src/cmd/compile/internal/arm/cgen64.go b/src/cmd/compile/internal/arm/cgen64.go new file mode 100644 index 0000000000000000000000000000000000000000..cc969b8414e86547e9f1ddc0ec75f8d80af40f6d --- /dev/null +++ b/src/cmd/compile/internal/arm/cgen64.go @@ -0,0 +1,859 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package arm + +import ( + "cmd/compile/internal/gc" + "cmd/internal/obj" + "cmd/internal/obj/arm" +) + +/* + * attempt to generate 64-bit + * res = n + * return 1 on success, 0 if op not handled. + */ +func cgen64(n *gc.Node, res *gc.Node) { + if res.Op != gc.OINDREG && res.Op != gc.ONAME { + gc.Dump("n", n) + gc.Dump("res", res) + gc.Fatal("cgen64 %v of %v", gc.Oconv(int(n.Op), 0), gc.Oconv(int(res.Op), 0)) + } + + l := n.Left + var t1 gc.Node + if !l.Addable { + gc.Tempname(&t1, l.Type) + gc.Cgen(l, &t1) + l = &t1 + } + + var hi1 gc.Node + var lo1 gc.Node + split64(l, &lo1, &hi1) + switch n.Op { + default: + gc.Fatal("cgen64 %v", gc.Oconv(int(n.Op), 0)) + + case gc.OMINUS: + var lo2 gc.Node + var hi2 gc.Node + split64(res, &lo2, &hi2) + + gc.Regalloc(&t1, lo1.Type, nil) + var al gc.Node + gc.Regalloc(&al, lo1.Type, nil) + var ah gc.Node + gc.Regalloc(&ah, hi1.Type, nil) + + gins(arm.AMOVW, &lo1, &al) + gins(arm.AMOVW, &hi1, &ah) + + gmove(ncon(0), &t1) + p1 := gins(arm.ASUB, &al, &t1) + p1.Scond |= arm.C_SBIT + gins(arm.AMOVW, &t1, &lo2) + + gmove(ncon(0), &t1) + gins(arm.ASBC, &ah, &t1) + gins(arm.AMOVW, &t1, &hi2) + + gc.Regfree(&t1) + gc.Regfree(&al) + gc.Regfree(&ah) + splitclean() + splitclean() + return + + case gc.OCOM: + gc.Regalloc(&t1, lo1.Type, nil) + gmove(ncon(^uint32(0)), &t1) + + var lo2 gc.Node + var hi2 gc.Node + split64(res, &lo2, &hi2) + var n1 gc.Node + gc.Regalloc(&n1, lo1.Type, nil) + + gins(arm.AMOVW, &lo1, &n1) + gins(arm.AEOR, &t1, &n1) + gins(arm.AMOVW, &n1, &lo2) + + gins(arm.AMOVW, &hi1, &n1) + gins(arm.AEOR, &t1, &n1) + gins(arm.AMOVW, &n1, &hi2) + + gc.Regfree(&t1) + gc.Regfree(&n1) + splitclean() + splitclean() + return + + // binary operators. + // common setup below. + case gc.OADD, + gc.OSUB, + gc.OMUL, + gc.OLSH, + gc.ORSH, + gc.OAND, + gc.OOR, + gc.OXOR, + gc.OLROT: + break + } + + // setup for binary operators + r := n.Right + + if r != nil && !r.Addable { + var t2 gc.Node + gc.Tempname(&t2, r.Type) + gc.Cgen(r, &t2) + r = &t2 + } + + var hi2 gc.Node + var lo2 gc.Node + if gc.Is64(r.Type) { + split64(r, &lo2, &hi2) + } + + var al gc.Node + gc.Regalloc(&al, lo1.Type, nil) + var ah gc.Node + gc.Regalloc(&ah, hi1.Type, nil) + + // Do op. Leave result in ah:al. + switch n.Op { + default: + gc.Fatal("cgen64: not implemented: %v\n", n) + + // TODO: Constants + case gc.OADD: + var bl gc.Node + gc.Regalloc(&bl, gc.Types[gc.TPTR32], nil) + + var bh gc.Node + gc.Regalloc(&bh, gc.Types[gc.TPTR32], nil) + gins(arm.AMOVW, &hi1, &ah) + gins(arm.AMOVW, &lo1, &al) + gins(arm.AMOVW, &hi2, &bh) + gins(arm.AMOVW, &lo2, &bl) + p1 := gins(arm.AADD, &bl, &al) + p1.Scond |= arm.C_SBIT + gins(arm.AADC, &bh, &ah) + gc.Regfree(&bl) + gc.Regfree(&bh) + + // TODO: Constants. + case gc.OSUB: + var bl gc.Node + gc.Regalloc(&bl, gc.Types[gc.TPTR32], nil) + + var bh gc.Node + gc.Regalloc(&bh, gc.Types[gc.TPTR32], nil) + gins(arm.AMOVW, &lo1, &al) + gins(arm.AMOVW, &hi1, &ah) + gins(arm.AMOVW, &lo2, &bl) + gins(arm.AMOVW, &hi2, &bh) + p1 := gins(arm.ASUB, &bl, &al) + p1.Scond |= arm.C_SBIT + gins(arm.ASBC, &bh, &ah) + gc.Regfree(&bl) + gc.Regfree(&bh) + + // TODO(kaib): this can be done with 4 regs and does not need 6 + case gc.OMUL: + var bl gc.Node + gc.Regalloc(&bl, gc.Types[gc.TPTR32], nil) + + var bh gc.Node + gc.Regalloc(&bh, gc.Types[gc.TPTR32], nil) + var cl gc.Node + gc.Regalloc(&cl, gc.Types[gc.TPTR32], nil) + var ch gc.Node + gc.Regalloc(&ch, gc.Types[gc.TPTR32], nil) + + // load args into bh:bl and bh:bl. + gins(arm.AMOVW, &hi1, &bh) + + gins(arm.AMOVW, &lo1, &bl) + gins(arm.AMOVW, &hi2, &ch) + gins(arm.AMOVW, &lo2, &cl) + + // bl * cl -> ah al + p1 := gins(arm.AMULLU, nil, nil) + + p1.From.Type = obj.TYPE_REG + p1.From.Reg = bl.Reg + p1.Reg = cl.Reg + p1.To.Type = obj.TYPE_REGREG + p1.To.Reg = ah.Reg + p1.To.Offset = int64(al.Reg) + + //print("%v\n", p1); + + // bl * ch + ah -> ah + p1 = gins(arm.AMULA, nil, nil) + + p1.From.Type = obj.TYPE_REG + p1.From.Reg = bl.Reg + p1.Reg = ch.Reg + p1.To.Type = obj.TYPE_REGREG2 + p1.To.Reg = ah.Reg + p1.To.Offset = int64(ah.Reg) + + //print("%v\n", p1); + + // bh * cl + ah -> ah + p1 = gins(arm.AMULA, nil, nil) + + p1.From.Type = obj.TYPE_REG + p1.From.Reg = bh.Reg + p1.Reg = cl.Reg + p1.To.Type = obj.TYPE_REGREG2 + p1.To.Reg = ah.Reg + p1.To.Offset = int64(ah.Reg) + + //print("%v\n", p1); + + gc.Regfree(&bh) + + gc.Regfree(&bl) + gc.Regfree(&ch) + gc.Regfree(&cl) + + // We only rotate by a constant c in [0,64). + // if c >= 32: + // lo, hi = hi, lo + // c -= 32 + // if c == 0: + // no-op + // else: + // t = hi + // shld hi:lo, c + // shld lo:t, c + case gc.OLROT: + v := uint64(r.Int()) + + var bl gc.Node + gc.Regalloc(&bl, lo1.Type, nil) + var bh gc.Node + gc.Regalloc(&bh, hi1.Type, nil) + if v >= 32 { + // reverse during load to do the first 32 bits of rotate + v -= 32 + + gins(arm.AMOVW, &hi1, &bl) + gins(arm.AMOVW, &lo1, &bh) + } else { + gins(arm.AMOVW, &hi1, &bh) + gins(arm.AMOVW, &lo1, &bl) + } + + if v == 0 { + gins(arm.AMOVW, &bh, &ah) + gins(arm.AMOVW, &bl, &al) + } else { + // rotate by 1 <= v <= 31 + // MOVW bl<>(32-v), ah + // OR bh>>(32-v), al + gshift(arm.AMOVW, &bl, arm.SHIFT_LL, int32(v), &al) + + gshift(arm.AMOVW, &bh, arm.SHIFT_LL, int32(v), &ah) + gshift(arm.AORR, &bl, arm.SHIFT_LR, int32(32-v), &ah) + gshift(arm.AORR, &bh, arm.SHIFT_LR, int32(32-v), &al) + } + + gc.Regfree(&bl) + gc.Regfree(&bh) + + case gc.OLSH: + var bl gc.Node + gc.Regalloc(&bl, lo1.Type, nil) + var bh gc.Node + gc.Regalloc(&bh, hi1.Type, nil) + gins(arm.AMOVW, &hi1, &bh) + gins(arm.AMOVW, &lo1, &bl) + + var p6 *obj.Prog + var s gc.Node + var n1 gc.Node + var creg gc.Node + var p1 *obj.Prog + var p2 *obj.Prog + var p3 *obj.Prog + var p4 *obj.Prog + var p5 *obj.Prog + if r.Op == gc.OLITERAL { + v := uint64(r.Int()) + if v >= 64 { + // TODO(kaib): replace with gins(AMOVW, nodintconst(0), &al) + // here and below (verify it optimizes to EOR) + gins(arm.AEOR, &al, &al) + + gins(arm.AEOR, &ah, &ah) + } else if v > 32 { + gins(arm.AEOR, &al, &al) + + // MOVW bl<<(v-32), ah + gshift(arm.AMOVW, &bl, arm.SHIFT_LL, int32(v-32), &ah) + } else if v == 32 { + gins(arm.AEOR, &al, &al) + gins(arm.AMOVW, &bl, &ah) + } else if v > 0 { + // MOVW bl<>(32-v), ah + gshift(arm.AORR, &bl, arm.SHIFT_LR, int32(32-v), &ah) + } else { + gins(arm.AMOVW, &bl, &al) + gins(arm.AMOVW, &bh, &ah) + } + + goto olsh_break + } + + gc.Regalloc(&s, gc.Types[gc.TUINT32], nil) + gc.Regalloc(&creg, gc.Types[gc.TUINT32], nil) + if gc.Is64(r.Type) { + // shift is >= 1<<32 + var cl gc.Node + var ch gc.Node + split64(r, &cl, &ch) + + gmove(&ch, &s) + gins(arm.ATST, &s, nil) + p6 = gc.Gbranch(arm.ABNE, nil, 0) + gmove(&cl, &s) + splitclean() + } else { + gmove(r, &s) + p6 = nil + } + + gins(arm.ATST, &s, nil) + + // shift == 0 + p1 = gins(arm.AMOVW, &bl, &al) + + p1.Scond = arm.C_SCOND_EQ + p1 = gins(arm.AMOVW, &bh, &ah) + p1.Scond = arm.C_SCOND_EQ + p2 = gc.Gbranch(arm.ABEQ, nil, 0) + + // shift is < 32 + gc.Nodconst(&n1, gc.Types[gc.TUINT32], 32) + + gmove(&n1, &creg) + gins(arm.ACMP, &s, &creg) + + // MOVW.LO bl<>creg, ah + p1 = gregshift(arm.AORR, &bl, arm.SHIFT_LR, &creg, &ah) + + p1.Scond = arm.C_SCOND_LO + + // BLO end + p3 = gc.Gbranch(arm.ABLO, nil, 0) + + // shift == 32 + p1 = gins(arm.AEOR, &al, &al) + + p1.Scond = arm.C_SCOND_EQ + p1 = gins(arm.AMOVW, &bl, &ah) + p1.Scond = arm.C_SCOND_EQ + p4 = gc.Gbranch(arm.ABEQ, nil, 0) + + // shift is < 64 + gc.Nodconst(&n1, gc.Types[gc.TUINT32], 64) + + gmove(&n1, &creg) + gins(arm.ACMP, &s, &creg) + + // EOR.LO al, al + p1 = gins(arm.AEOR, &al, &al) + + p1.Scond = arm.C_SCOND_LO + + // MOVW.LO creg>>1, creg + p1 = gshift(arm.AMOVW, &creg, arm.SHIFT_LR, 1, &creg) + + p1.Scond = arm.C_SCOND_LO + + // SUB.LO creg, s + p1 = gins(arm.ASUB, &creg, &s) + + p1.Scond = arm.C_SCOND_LO + + // MOVW bl<= 64 + if p6 != nil { + gc.Patch(p6, gc.Pc) + } + gins(arm.AEOR, &al, &al) + gins(arm.AEOR, &ah, &ah) + + gc.Patch(p2, gc.Pc) + gc.Patch(p3, gc.Pc) + gc.Patch(p4, gc.Pc) + gc.Patch(p5, gc.Pc) + gc.Regfree(&s) + gc.Regfree(&creg) + + olsh_break: + gc.Regfree(&bl) + gc.Regfree(&bh) + + case gc.ORSH: + var bl gc.Node + gc.Regalloc(&bl, lo1.Type, nil) + var bh gc.Node + gc.Regalloc(&bh, hi1.Type, nil) + gins(arm.AMOVW, &hi1, &bh) + gins(arm.AMOVW, &lo1, &bl) + + var p4 *obj.Prog + var p5 *obj.Prog + var n1 gc.Node + var p6 *obj.Prog + var s gc.Node + var p1 *obj.Prog + var p2 *obj.Prog + var creg gc.Node + var p3 *obj.Prog + if r.Op == gc.OLITERAL { + v := uint64(r.Int()) + if v >= 64 { + if bh.Type.Etype == gc.TINT32 { + // MOVW bh->31, al + gshift(arm.AMOVW, &bh, arm.SHIFT_AR, 31, &al) + + // MOVW bh->31, ah + gshift(arm.AMOVW, &bh, arm.SHIFT_AR, 31, &ah) + } else { + gins(arm.AEOR, &al, &al) + gins(arm.AEOR, &ah, &ah) + } + } else if v > 32 { + if bh.Type.Etype == gc.TINT32 { + // MOVW bh->(v-32), al + gshift(arm.AMOVW, &bh, arm.SHIFT_AR, int32(v-32), &al) + + // MOVW bh->31, ah + gshift(arm.AMOVW, &bh, arm.SHIFT_AR, 31, &ah) + } else { + // MOVW bh>>(v-32), al + gshift(arm.AMOVW, &bh, arm.SHIFT_LR, int32(v-32), &al) + + gins(arm.AEOR, &ah, &ah) + } + } else if v == 32 { + gins(arm.AMOVW, &bh, &al) + if bh.Type.Etype == gc.TINT32 { + // MOVW bh->31, ah + gshift(arm.AMOVW, &bh, arm.SHIFT_AR, 31, &ah) + } else { + gins(arm.AEOR, &ah, &ah) + } + } else if v > 0 { + // MOVW bl>>v, al + gshift(arm.AMOVW, &bl, arm.SHIFT_LR, int32(v), &al) + + // OR bh<<(32-v), al + gshift(arm.AORR, &bh, arm.SHIFT_LL, int32(32-v), &al) + + if bh.Type.Etype == gc.TINT32 { + // MOVW bh->v, ah + gshift(arm.AMOVW, &bh, arm.SHIFT_AR, int32(v), &ah) + } else { + // MOVW bh>>v, ah + gshift(arm.AMOVW, &bh, arm.SHIFT_LR, int32(v), &ah) + } + } else { + gins(arm.AMOVW, &bl, &al) + gins(arm.AMOVW, &bh, &ah) + } + + goto orsh_break + } + + gc.Regalloc(&s, gc.Types[gc.TUINT32], nil) + gc.Regalloc(&creg, gc.Types[gc.TUINT32], nil) + if gc.Is64(r.Type) { + // shift is >= 1<<32 + var ch gc.Node + var cl gc.Node + split64(r, &cl, &ch) + + gmove(&ch, &s) + gins(arm.ATST, &s, nil) + var p1 *obj.Prog + if bh.Type.Etype == gc.TINT32 { + p1 = gshift(arm.AMOVW, &bh, arm.SHIFT_AR, 31, &ah) + } else { + p1 = gins(arm.AEOR, &ah, &ah) + } + p1.Scond = arm.C_SCOND_NE + p6 = gc.Gbranch(arm.ABNE, nil, 0) + gmove(&cl, &s) + splitclean() + } else { + gmove(r, &s) + p6 = nil + } + + gins(arm.ATST, &s, nil) + + // shift == 0 + p1 = gins(arm.AMOVW, &bl, &al) + + p1.Scond = arm.C_SCOND_EQ + p1 = gins(arm.AMOVW, &bh, &ah) + p1.Scond = arm.C_SCOND_EQ + p2 = gc.Gbranch(arm.ABEQ, nil, 0) + + // check if shift is < 32 + gc.Nodconst(&n1, gc.Types[gc.TUINT32], 32) + + gmove(&n1, &creg) + gins(arm.ACMP, &s, &creg) + + // MOVW.LO bl>>s, al + p1 = gregshift(arm.AMOVW, &bl, arm.SHIFT_LR, &s, &al) + + p1.Scond = arm.C_SCOND_LO + + // SUB.LO s,creg + p1 = gins(arm.ASUB, &s, &creg) + + p1.Scond = arm.C_SCOND_LO + + // OR.LO bh<<(32-s), al + p1 = gregshift(arm.AORR, &bh, arm.SHIFT_LL, &creg, &al) + + p1.Scond = arm.C_SCOND_LO + + if bh.Type.Etype == gc.TINT32 { + // MOVW bh->s, ah + p1 = gregshift(arm.AMOVW, &bh, arm.SHIFT_AR, &s, &ah) + } else { + // MOVW bh>>s, ah + p1 = gregshift(arm.AMOVW, &bh, arm.SHIFT_LR, &s, &ah) + } + + p1.Scond = arm.C_SCOND_LO + + // BLO end + p3 = gc.Gbranch(arm.ABLO, nil, 0) + + // shift == 32 + p1 = gins(arm.AMOVW, &bh, &al) + + p1.Scond = arm.C_SCOND_EQ + if bh.Type.Etype == gc.TINT32 { + gshift(arm.AMOVW, &bh, arm.SHIFT_AR, 31, &ah) + } else { + gins(arm.AEOR, &ah, &ah) + } + p4 = gc.Gbranch(arm.ABEQ, nil, 0) + + // check if shift is < 64 + gc.Nodconst(&n1, gc.Types[gc.TUINT32], 64) + + gmove(&n1, &creg) + gins(arm.ACMP, &s, &creg) + + // MOVW.LO creg>>1, creg + p1 = gshift(arm.AMOVW, &creg, arm.SHIFT_LR, 1, &creg) + + p1.Scond = arm.C_SCOND_LO + + // SUB.LO creg, s + p1 = gins(arm.ASUB, &creg, &s) + + p1.Scond = arm.C_SCOND_LO + + if bh.Type.Etype == gc.TINT32 { + // MOVW bh->(s-32), al + p1 := gregshift(arm.AMOVW, &bh, arm.SHIFT_AR, &s, &al) + + p1.Scond = arm.C_SCOND_LO + } else { + // MOVW bh>>(v-32), al + p1 := gregshift(arm.AMOVW, &bh, arm.SHIFT_LR, &s, &al) + + p1.Scond = arm.C_SCOND_LO + } + + // BLO end + p5 = gc.Gbranch(arm.ABLO, nil, 0) + + // s >= 64 + if p6 != nil { + gc.Patch(p6, gc.Pc) + } + if bh.Type.Etype == gc.TINT32 { + // MOVW bh->31, al + gshift(arm.AMOVW, &bh, arm.SHIFT_AR, 31, &al) + } else { + gins(arm.AEOR, &al, &al) + } + + gc.Patch(p2, gc.Pc) + gc.Patch(p3, gc.Pc) + gc.Patch(p4, gc.Pc) + gc.Patch(p5, gc.Pc) + gc.Regfree(&s) + gc.Regfree(&creg) + + orsh_break: + gc.Regfree(&bl) + gc.Regfree(&bh) + + // TODO(kaib): literal optimizations + // make constant the right side (it usually is anyway). + // if(lo1.op == OLITERAL) { + // nswap(&lo1, &lo2); + // nswap(&hi1, &hi2); + // } + // if(lo2.op == OLITERAL) { + // // special cases for constants. + // lv = mpgetfix(lo2.val.u.xval); + // hv = mpgetfix(hi2.val.u.xval); + // splitclean(); // right side + // split64(res, &lo2, &hi2); + // switch(n->op) { + // case OXOR: + // gmove(&lo1, &lo2); + // gmove(&hi1, &hi2); + // switch(lv) { + // case 0: + // break; + // case 0xffffffffu: + // gins(ANOTL, N, &lo2); + // break; + // default: + // gins(AXORL, ncon(lv), &lo2); + // break; + // } + // switch(hv) { + // case 0: + // break; + // case 0xffffffffu: + // gins(ANOTL, N, &hi2); + // break; + // default: + // gins(AXORL, ncon(hv), &hi2); + // break; + // } + // break; + + // case OAND: + // switch(lv) { + // case 0: + // gins(AMOVL, ncon(0), &lo2); + // break; + // default: + // gmove(&lo1, &lo2); + // if(lv != 0xffffffffu) + // gins(AANDL, ncon(lv), &lo2); + // break; + // } + // switch(hv) { + // case 0: + // gins(AMOVL, ncon(0), &hi2); + // break; + // default: + // gmove(&hi1, &hi2); + // if(hv != 0xffffffffu) + // gins(AANDL, ncon(hv), &hi2); + // break; + // } + // break; + + // case OOR: + // switch(lv) { + // case 0: + // gmove(&lo1, &lo2); + // break; + // case 0xffffffffu: + // gins(AMOVL, ncon(0xffffffffu), &lo2); + // break; + // default: + // gmove(&lo1, &lo2); + // gins(AORL, ncon(lv), &lo2); + // break; + // } + // switch(hv) { + // case 0: + // gmove(&hi1, &hi2); + // break; + // case 0xffffffffu: + // gins(AMOVL, ncon(0xffffffffu), &hi2); + // break; + // default: + // gmove(&hi1, &hi2); + // gins(AORL, ncon(hv), &hi2); + // break; + // } + // break; + // } + // splitclean(); + // splitclean(); + // goto out; + // } + case gc.OXOR, + gc.OAND, + gc.OOR: + var n1 gc.Node + gc.Regalloc(&n1, lo1.Type, nil) + + gins(arm.AMOVW, &lo1, &al) + gins(arm.AMOVW, &hi1, &ah) + gins(arm.AMOVW, &lo2, &n1) + gins(optoas(int(n.Op), lo1.Type), &n1, &al) + gins(arm.AMOVW, &hi2, &n1) + gins(optoas(int(n.Op), lo1.Type), &n1, &ah) + gc.Regfree(&n1) + } + + if gc.Is64(r.Type) { + splitclean() + } + splitclean() + + split64(res, &lo1, &hi1) + gins(arm.AMOVW, &al, &lo1) + gins(arm.AMOVW, &ah, &hi1) + splitclean() + + //out: + gc.Regfree(&al) + + gc.Regfree(&ah) +} + +/* + * generate comparison of nl, nr, both 64-bit. + * nl is memory; nr is constant or memory. + */ +func cmp64(nl *gc.Node, nr *gc.Node, op int, likely int, to *obj.Prog) { + var lo1 gc.Node + var hi1 gc.Node + var lo2 gc.Node + var hi2 gc.Node + var r1 gc.Node + var r2 gc.Node + + split64(nl, &lo1, &hi1) + split64(nr, &lo2, &hi2) + + // compare most significant word; + // if they differ, we're done. + t := hi1.Type + + gc.Regalloc(&r1, gc.Types[gc.TINT32], nil) + gc.Regalloc(&r2, gc.Types[gc.TINT32], nil) + gins(arm.AMOVW, &hi1, &r1) + gins(arm.AMOVW, &hi2, &r2) + gins(arm.ACMP, &r1, &r2) + gc.Regfree(&r1) + gc.Regfree(&r2) + + var br *obj.Prog + switch op { + default: + gc.Fatal("cmp64 %v %v", gc.Oconv(int(op), 0), t) + + // cmp hi + // bne L + // cmp lo + // beq to + // L: + case gc.OEQ: + br = gc.Gbranch(arm.ABNE, nil, -likely) + + // cmp hi + // bne to + // cmp lo + // bne to + case gc.ONE: + gc.Patch(gc.Gbranch(arm.ABNE, nil, likely), to) + + // cmp hi + // bgt to + // blt L + // cmp lo + // bge to (or bgt to) + // L: + case gc.OGE, + gc.OGT: + gc.Patch(gc.Gbranch(optoas(gc.OGT, t), nil, likely), to) + + br = gc.Gbranch(optoas(gc.OLT, t), nil, -likely) + + // cmp hi + // blt to + // bgt L + // cmp lo + // ble to (or jlt to) + // L: + case gc.OLE, + gc.OLT: + gc.Patch(gc.Gbranch(optoas(gc.OLT, t), nil, likely), to) + + br = gc.Gbranch(optoas(gc.OGT, t), nil, -likely) + } + + // compare least significant word + t = lo1.Type + + gc.Regalloc(&r1, gc.Types[gc.TINT32], nil) + gc.Regalloc(&r2, gc.Types[gc.TINT32], nil) + gins(arm.AMOVW, &lo1, &r1) + gins(arm.AMOVW, &lo2, &r2) + gins(arm.ACMP, &r1, &r2) + gc.Regfree(&r1) + gc.Regfree(&r2) + + // jump again + gc.Patch(gc.Gbranch(optoas(op, t), nil, likely), to) + + // point first branch down here if appropriate + if br != nil { + gc.Patch(br, gc.Pc) + } + + splitclean() + splitclean() +} diff --git a/src/cmd/compile/internal/arm/galign.go b/src/cmd/compile/internal/arm/galign.go new file mode 100644 index 0000000000000000000000000000000000000000..60a39d3fe48f2c70dc61b3113b1309113deb6a77 --- /dev/null +++ b/src/cmd/compile/internal/arm/galign.go @@ -0,0 +1,94 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package arm + +import ( + "cmd/compile/internal/gc" + "cmd/internal/obj" + "cmd/internal/obj/arm" +) + +var thechar int = '5' + +var thestring string = "arm" + +var thelinkarch *obj.LinkArch = &arm.Linkarm + +func linkarchinit() { +} + +var MAXWIDTH int64 = (1 << 32) - 1 + +/* + * go declares several platform-specific type aliases: + * int, uint, and uintptr + */ +var typedefs = []gc.Typedef{ + gc.Typedef{"int", gc.TINT, gc.TINT32}, + gc.Typedef{"uint", gc.TUINT, gc.TUINT32}, + gc.Typedef{"uintptr", gc.TUINTPTR, gc.TUINT32}, +} + +func betypeinit() { + gc.Widthptr = 4 + gc.Widthint = 4 + gc.Widthreg = 4 +} + +func Main() { + gc.Thearch.Thechar = thechar + gc.Thearch.Thestring = thestring + gc.Thearch.Thelinkarch = thelinkarch + gc.Thearch.Typedefs = typedefs + gc.Thearch.REGSP = arm.REGSP + gc.Thearch.REGCTXT = arm.REGCTXT + gc.Thearch.REGCALLX = arm.REG_R1 + gc.Thearch.REGCALLX2 = arm.REG_R2 + gc.Thearch.REGRETURN = arm.REG_R0 + gc.Thearch.REGMIN = arm.REG_R0 + gc.Thearch.REGMAX = arm.REGEXT + gc.Thearch.FREGMIN = arm.REG_F0 + gc.Thearch.FREGMAX = arm.FREGEXT + gc.Thearch.MAXWIDTH = MAXWIDTH + gc.Thearch.ReservedRegs = resvd + + gc.Thearch.Betypeinit = betypeinit + gc.Thearch.Cgen64 = cgen64 + gc.Thearch.Cgen_hmul = cgen_hmul + gc.Thearch.Cgen_shift = cgen_shift + gc.Thearch.Clearfat = clearfat + gc.Thearch.Cmp64 = cmp64 + gc.Thearch.Defframe = defframe + gc.Thearch.Excise = excise + gc.Thearch.Expandchecks = expandchecks + gc.Thearch.Getg = getg + gc.Thearch.Gins = gins + gc.Thearch.Ginscmp = ginscmp + gc.Thearch.Ginscon = ginscon + gc.Thearch.Ginsnop = ginsnop + gc.Thearch.Gmove = gmove + gc.Thearch.Cgenindex = cgenindex + gc.Thearch.Linkarchinit = linkarchinit + gc.Thearch.Peep = peep + gc.Thearch.Proginfo = proginfo + gc.Thearch.Regtyp = regtyp + gc.Thearch.Sameaddr = sameaddr + gc.Thearch.Smallindir = smallindir + gc.Thearch.Stackaddr = stackaddr + gc.Thearch.Blockcopy = blockcopy + gc.Thearch.Sudoaddable = sudoaddable + gc.Thearch.Sudoclean = sudoclean + gc.Thearch.Excludedregs = excludedregs + gc.Thearch.RtoB = RtoB + gc.Thearch.FtoB = RtoB + gc.Thearch.BtoR = BtoR + gc.Thearch.BtoF = BtoF + gc.Thearch.Optoas = optoas + gc.Thearch.Doregbits = doregbits + gc.Thearch.Regnames = regnames + + gc.Main() + gc.Exit(0) +} diff --git a/src/cmd/compile/internal/arm/ggen.go b/src/cmd/compile/internal/arm/ggen.go new file mode 100644 index 0000000000000000000000000000000000000000..2d19d750efc24825b36ee863a25a9932f3f0c886 --- /dev/null +++ b/src/cmd/compile/internal/arm/ggen.go @@ -0,0 +1,529 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package arm + +import ( + "cmd/compile/internal/gc" + "cmd/internal/obj" + "cmd/internal/obj/arm" +) + +func defframe(ptxt *obj.Prog) { + var n *gc.Node + + // fill in argument size, stack size + ptxt.To.Type = obj.TYPE_TEXTSIZE + + ptxt.To.Val = int32(gc.Rnd(gc.Curfn.Type.Argwid, int64(gc.Widthptr))) + frame := uint32(gc.Rnd(gc.Stksize+gc.Maxarg, int64(gc.Widthreg))) + ptxt.To.Offset = int64(frame) + + // insert code to contain ambiguously live variables + // so that garbage collector only sees initialized values + // when it looks for pointers. + p := ptxt + + hi := int64(0) + lo := hi + r0 := uint32(0) + for l := gc.Curfn.Func.Dcl; l != nil; l = l.Next { + n = l.N + if !n.Name.Needzero { + continue + } + if n.Class != gc.PAUTO { + gc.Fatal("needzero class %d", n.Class) + } + if n.Type.Width%int64(gc.Widthptr) != 0 || n.Xoffset%int64(gc.Widthptr) != 0 || n.Type.Width == 0 { + gc.Fatal("var %v has size %d offset %d", gc.Nconv(n, obj.FmtLong), int(n.Type.Width), int(n.Xoffset)) + } + if lo != hi && n.Xoffset+n.Type.Width >= lo-int64(2*gc.Widthptr) { + // merge with range we already have + lo = gc.Rnd(n.Xoffset, int64(gc.Widthptr)) + + continue + } + + // zero old range + p = zerorange(p, int64(frame), lo, hi, &r0) + + // set new range + hi = n.Xoffset + n.Type.Width + + lo = n.Xoffset + } + + // zero final range + zerorange(p, int64(frame), lo, hi, &r0) +} + +func zerorange(p *obj.Prog, frame int64, lo int64, hi int64, r0 *uint32) *obj.Prog { + cnt := hi - lo + if cnt == 0 { + return p + } + if *r0 == 0 { + p = appendpp(p, arm.AMOVW, obj.TYPE_CONST, 0, 0, obj.TYPE_REG, arm.REG_R0, 0) + *r0 = 1 + } + + if cnt < int64(4*gc.Widthptr) { + for i := int64(0); i < cnt; i += int64(gc.Widthptr) { + p = appendpp(p, arm.AMOVW, obj.TYPE_REG, arm.REG_R0, 0, obj.TYPE_MEM, arm.REGSP, int32(4+frame+lo+i)) + } + } else if !gc.Nacl && (cnt <= int64(128*gc.Widthptr)) { + p = appendpp(p, arm.AADD, obj.TYPE_CONST, 0, int32(4+frame+lo), obj.TYPE_REG, arm.REG_R1, 0) + p.Reg = arm.REGSP + p = appendpp(p, obj.ADUFFZERO, obj.TYPE_NONE, 0, 0, obj.TYPE_MEM, 0, 0) + f := gc.Sysfunc("duffzero") + gc.Naddr(&p.To, f) + gc.Afunclit(&p.To, f) + p.To.Offset = 4 * (128 - cnt/int64(gc.Widthptr)) + } else { + p = appendpp(p, arm.AADD, obj.TYPE_CONST, 0, int32(4+frame+lo), obj.TYPE_REG, arm.REG_R1, 0) + p.Reg = arm.REGSP + p = appendpp(p, arm.AADD, obj.TYPE_CONST, 0, int32(cnt), obj.TYPE_REG, arm.REG_R2, 0) + p.Reg = arm.REG_R1 + p = appendpp(p, arm.AMOVW, obj.TYPE_REG, arm.REG_R0, 0, obj.TYPE_MEM, arm.REG_R1, 4) + p1 := p + p.Scond |= arm.C_PBIT + p = appendpp(p, arm.ACMP, obj.TYPE_REG, arm.REG_R1, 0, obj.TYPE_NONE, 0, 0) + p.Reg = arm.REG_R2 + p = appendpp(p, arm.ABNE, obj.TYPE_NONE, 0, 0, obj.TYPE_BRANCH, 0, 0) + gc.Patch(p, p1) + } + + return p +} + +func appendpp(p *obj.Prog, as int, ftype int, freg int, foffset int32, ttype int, treg int, toffset int32) *obj.Prog { + q := gc.Ctxt.NewProg() + gc.Clearp(q) + q.As = int16(as) + q.Lineno = p.Lineno + q.From.Type = int16(ftype) + q.From.Reg = int16(freg) + q.From.Offset = int64(foffset) + q.To.Type = int16(ttype) + q.To.Reg = int16(treg) + q.To.Offset = int64(toffset) + q.Link = p.Link + p.Link = q + return q +} + +/* + * generate high multiply + * res = (nl * nr) >> wordsize + */ +func cgen_hmul(nl *gc.Node, nr *gc.Node, res *gc.Node) { + if nl.Ullman < nr.Ullman { + tmp := nl + nl = nr + nr = tmp + } + + t := nl.Type + w := int(t.Width * 8) + var n1 gc.Node + gc.Regalloc(&n1, t, res) + gc.Cgen(nl, &n1) + var n2 gc.Node + gc.Regalloc(&n2, t, nil) + gc.Cgen(nr, &n2) + switch gc.Simtype[t.Etype] { + case gc.TINT8, + gc.TINT16: + gins(optoas(gc.OMUL, t), &n2, &n1) + gshift(arm.AMOVW, &n1, arm.SHIFT_AR, int32(w), &n1) + + case gc.TUINT8, + gc.TUINT16: + gins(optoas(gc.OMUL, t), &n2, &n1) + gshift(arm.AMOVW, &n1, arm.SHIFT_LR, int32(w), &n1) + + // perform a long multiplication. + case gc.TINT32, + gc.TUINT32: + var p *obj.Prog + if gc.Issigned[t.Etype] { + p = gins(arm.AMULL, &n2, nil) + } else { + p = gins(arm.AMULLU, &n2, nil) + } + + // n2 * n1 -> (n1 n2) + p.Reg = n1.Reg + + p.To.Type = obj.TYPE_REGREG + p.To.Reg = n1.Reg + p.To.Offset = int64(n2.Reg) + + default: + gc.Fatal("cgen_hmul %v", t) + } + + gc.Cgen(&n1, res) + gc.Regfree(&n1) + gc.Regfree(&n2) +} + +/* + * generate shift according to op, one of: + * res = nl << nr + * res = nl >> nr + */ +func cgen_shift(op int, bounded bool, nl *gc.Node, nr *gc.Node, res *gc.Node) { + if nl.Type.Width > 4 { + gc.Fatal("cgen_shift %v", nl.Type) + } + + w := int(nl.Type.Width * 8) + + if op == gc.OLROT { + v := nr.Int() + var n1 gc.Node + gc.Regalloc(&n1, nl.Type, res) + if w == 32 { + gc.Cgen(nl, &n1) + gshift(arm.AMOVW, &n1, arm.SHIFT_RR, int32(w)-int32(v), &n1) + } else { + var n2 gc.Node + gc.Regalloc(&n2, nl.Type, nil) + gc.Cgen(nl, &n2) + gshift(arm.AMOVW, &n2, arm.SHIFT_LL, int32(v), &n1) + gshift(arm.AORR, &n2, arm.SHIFT_LR, int32(w)-int32(v), &n1) + gc.Regfree(&n2) + + // Ensure sign/zero-extended result. + gins(optoas(gc.OAS, nl.Type), &n1, &n1) + } + + gmove(&n1, res) + gc.Regfree(&n1) + return + } + + if nr.Op == gc.OLITERAL { + var n1 gc.Node + gc.Regalloc(&n1, nl.Type, res) + gc.Cgen(nl, &n1) + sc := uint64(nr.Int()) + if sc == 0 { + } else // nothing to do + if sc >= uint64(nl.Type.Width*8) { + if op == gc.ORSH && gc.Issigned[nl.Type.Etype] { + gshift(arm.AMOVW, &n1, arm.SHIFT_AR, int32(w), &n1) + } else { + gins(arm.AEOR, &n1, &n1) + } + } else { + if op == gc.ORSH && gc.Issigned[nl.Type.Etype] { + gshift(arm.AMOVW, &n1, arm.SHIFT_AR, int32(sc), &n1) + } else if op == gc.ORSH { + gshift(arm.AMOVW, &n1, arm.SHIFT_LR, int32(sc), &n1) // OLSH + } else { + gshift(arm.AMOVW, &n1, arm.SHIFT_LL, int32(sc), &n1) + } + } + + if w < 32 && op == gc.OLSH { + gins(optoas(gc.OAS, nl.Type), &n1, &n1) + } + gmove(&n1, res) + gc.Regfree(&n1) + return + } + + tr := nr.Type + var t gc.Node + var n1 gc.Node + var n2 gc.Node + var n3 gc.Node + if tr.Width > 4 { + var nt gc.Node + gc.Tempname(&nt, nr.Type) + if nl.Ullman >= nr.Ullman { + gc.Regalloc(&n2, nl.Type, res) + gc.Cgen(nl, &n2) + gc.Cgen(nr, &nt) + n1 = nt + } else { + gc.Cgen(nr, &nt) + gc.Regalloc(&n2, nl.Type, res) + gc.Cgen(nl, &n2) + } + + var hi gc.Node + var lo gc.Node + split64(&nt, &lo, &hi) + gc.Regalloc(&n1, gc.Types[gc.TUINT32], nil) + gc.Regalloc(&n3, gc.Types[gc.TUINT32], nil) + gmove(&lo, &n1) + gmove(&hi, &n3) + splitclean() + gins(arm.ATST, &n3, nil) + gc.Nodconst(&t, gc.Types[gc.TUINT32], int64(w)) + p1 := gins(arm.AMOVW, &t, &n1) + p1.Scond = arm.C_SCOND_NE + tr = gc.Types[gc.TUINT32] + gc.Regfree(&n3) + } else { + if nl.Ullman >= nr.Ullman { + gc.Regalloc(&n2, nl.Type, res) + gc.Cgen(nl, &n2) + gc.Regalloc(&n1, nr.Type, nil) + gc.Cgen(nr, &n1) + } else { + gc.Regalloc(&n1, nr.Type, nil) + gc.Cgen(nr, &n1) + gc.Regalloc(&n2, nl.Type, res) + gc.Cgen(nl, &n2) + } + } + + // test for shift being 0 + gins(arm.ATST, &n1, nil) + + p3 := gc.Gbranch(arm.ABEQ, nil, -1) + + // test and fix up large shifts + // TODO: if(!bounded), don't emit some of this. + gc.Regalloc(&n3, tr, nil) + + gc.Nodconst(&t, gc.Types[gc.TUINT32], int64(w)) + gmove(&t, &n3) + gins(arm.ACMP, &n1, &n3) + if op == gc.ORSH { + var p1 *obj.Prog + var p2 *obj.Prog + if gc.Issigned[nl.Type.Etype] { + p1 = gshift(arm.AMOVW, &n2, arm.SHIFT_AR, int32(w)-1, &n2) + p2 = gregshift(arm.AMOVW, &n2, arm.SHIFT_AR, &n1, &n2) + } else { + p1 = gins(arm.AEOR, &n2, &n2) + p2 = gregshift(arm.AMOVW, &n2, arm.SHIFT_LR, &n1, &n2) + } + + p1.Scond = arm.C_SCOND_HS + p2.Scond = arm.C_SCOND_LO + } else { + p1 := gins(arm.AEOR, &n2, &n2) + p2 := gregshift(arm.AMOVW, &n2, arm.SHIFT_LL, &n1, &n2) + p1.Scond = arm.C_SCOND_HS + p2.Scond = arm.C_SCOND_LO + } + + gc.Regfree(&n3) + + gc.Patch(p3, gc.Pc) + + // Left-shift of smaller word must be sign/zero-extended. + if w < 32 && op == gc.OLSH { + gins(optoas(gc.OAS, nl.Type), &n2, &n2) + } + gmove(&n2, res) + + gc.Regfree(&n1) + gc.Regfree(&n2) +} + +func clearfat(nl *gc.Node) { + /* clear a fat object */ + if gc.Debug['g'] != 0 { + gc.Dump("\nclearfat", nl) + } + + w := uint32(nl.Type.Width) + + // Avoid taking the address for simple enough types. + if gc.Componentgen(nil, nl) { + return + } + + c := w % 4 // bytes + q := w / 4 // quads + + var r0 gc.Node + r0.Op = gc.OREGISTER + + r0.Reg = arm.REG_R0 + var r1 gc.Node + r1.Op = gc.OREGISTER + r1.Reg = arm.REG_R1 + var dst gc.Node + gc.Regalloc(&dst, gc.Types[gc.Tptr], &r1) + gc.Agen(nl, &dst) + var nc gc.Node + gc.Nodconst(&nc, gc.Types[gc.TUINT32], 0) + var nz gc.Node + gc.Regalloc(&nz, gc.Types[gc.TUINT32], &r0) + gc.Cgen(&nc, &nz) + + if q > 128 { + var end gc.Node + gc.Regalloc(&end, gc.Types[gc.Tptr], nil) + p := gins(arm.AMOVW, &dst, &end) + p.From.Type = obj.TYPE_ADDR + p.From.Offset = int64(q) * 4 + + p = gins(arm.AMOVW, &nz, &dst) + p.To.Type = obj.TYPE_MEM + p.To.Offset = 4 + p.Scond |= arm.C_PBIT + pl := p + + p = gins(arm.ACMP, &dst, nil) + raddr(&end, p) + gc.Patch(gc.Gbranch(arm.ABNE, nil, 0), pl) + + gc.Regfree(&end) + } else if q >= 4 && !gc.Nacl { + f := gc.Sysfunc("duffzero") + p := gins(obj.ADUFFZERO, nil, f) + gc.Afunclit(&p.To, f) + + // 4 and 128 = magic constants: see ../../runtime/asm_arm.s + p.To.Offset = 4 * (128 - int64(q)) + } else { + var p *obj.Prog + for q > 0 { + p = gins(arm.AMOVW, &nz, &dst) + p.To.Type = obj.TYPE_MEM + p.To.Offset = 4 + p.Scond |= arm.C_PBIT + + //print("1. %v\n", p); + q-- + } + } + + var p *obj.Prog + for c > 0 { + p = gins(arm.AMOVB, &nz, &dst) + p.To.Type = obj.TYPE_MEM + p.To.Offset = 1 + p.Scond |= arm.C_PBIT + + //print("2. %v\n", p); + c-- + } + + gc.Regfree(&dst) + gc.Regfree(&nz) +} + +// Called after regopt and peep have run. +// Expand CHECKNIL pseudo-op into actual nil pointer check. +func expandchecks(firstp *obj.Prog) { + var reg int + var p1 *obj.Prog + + for p := firstp; p != nil; p = p.Link { + if p.As != obj.ACHECKNIL { + continue + } + if gc.Debug_checknil != 0 && p.Lineno > 1 { // p->lineno==1 in generated wrappers + gc.Warnl(int(p.Lineno), "generated nil check") + } + if p.From.Type != obj.TYPE_REG { + gc.Fatal("invalid nil check %v", p) + } + reg = int(p.From.Reg) + + // check is + // CMP arg, $0 + // MOV.EQ arg, 0(arg) + p1 = gc.Ctxt.NewProg() + + gc.Clearp(p1) + p1.Link = p.Link + p.Link = p1 + p1.Lineno = p.Lineno + p1.Pc = 9999 + p1.As = arm.AMOVW + p1.From.Type = obj.TYPE_REG + p1.From.Reg = int16(reg) + p1.To.Type = obj.TYPE_MEM + p1.To.Reg = int16(reg) + p1.To.Offset = 0 + p1.Scond = arm.C_SCOND_EQ + p.As = arm.ACMP + p.From.Type = obj.TYPE_CONST + p.From.Reg = 0 + p.From.Offset = 0 + p.Reg = int16(reg) + } +} + +func ginsnop() { + var r gc.Node + gc.Nodreg(&r, gc.Types[gc.TINT], arm.REG_R0) + p := gins(arm.AAND, &r, &r) + p.Scond = arm.C_SCOND_EQ +} + +/* + * generate + * as $c, n + */ +func ginscon(as int, c int64, n *gc.Node) { + var n1 gc.Node + gc.Nodconst(&n1, gc.Types[gc.TINT32], c) + var n2 gc.Node + gc.Regalloc(&n2, gc.Types[gc.TINT32], nil) + gmove(&n1, &n2) + gins(as, &n2, n) + gc.Regfree(&n2) +} + +func ginscmp(op int, t *gc.Type, n1, n2 *gc.Node, likely int) *obj.Prog { + if gc.Isint[t.Etype] && n1.Op == gc.OLITERAL && n1.Int() == 0 && n2.Op != gc.OLITERAL { + op = gc.Brrev(op) + n1, n2 = n2, n1 + } + var r1, r2, g1, g2 gc.Node + gc.Regalloc(&r1, t, n1) + gc.Regalloc(&g1, n1.Type, &r1) + gc.Cgen(n1, &g1) + gmove(&g1, &r1) + if gc.Isint[t.Etype] && n2.Op == gc.OLITERAL && n2.Int() == 0 { + gins(arm.ACMP, &r1, n2) + } else { + gc.Regalloc(&r2, t, n2) + gc.Regalloc(&g2, n1.Type, &r2) + gc.Cgen(n2, &g2) + gmove(&g2, &r2) + gins(optoas(gc.OCMP, t), &r1, &r2) + gc.Regfree(&g2) + gc.Regfree(&r2) + } + gc.Regfree(&g1) + gc.Regfree(&r1) + return gc.Gbranch(optoas(op, t), nil, likely) +} + +// addr += index*width if possible. +func addindex(index *gc.Node, width int64, addr *gc.Node) bool { + switch width { + case 2: + gshift(arm.AADD, index, arm.SHIFT_LL, 1, addr) + return true + case 4: + gshift(arm.AADD, index, arm.SHIFT_LL, 2, addr) + return true + case 8: + gshift(arm.AADD, index, arm.SHIFT_LL, 3, addr) + return true + } + return false +} + +// res = runtime.getg() +func getg(res *gc.Node) { + var n1 gc.Node + gc.Nodreg(&n1, res.Type, arm.REGG) + gmove(&n1, res) +} diff --git a/src/cmd/compile/internal/arm/gsubr.go b/src/cmd/compile/internal/arm/gsubr.go new file mode 100644 index 0000000000000000000000000000000000000000..a0a7ba223d6f7bca3d7527103320a5a5b22ca669 --- /dev/null +++ b/src/cmd/compile/internal/arm/gsubr.go @@ -0,0 +1,1209 @@ +// Derived from Inferno utils/5c/txt.c +// http://code.google.com/p/inferno-os/source/browse/utils/5c/txt.c +// +// Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved. +// Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net) +// Portions Copyright © 1997-1999 Vita Nuova Limited +// Portions Copyright © 2000-2007 Vita Nuova Holdings Limited (www.vitanuova.com) +// Portions Copyright © 2004,2006 Bruce Ellis +// Portions Copyright © 2005-2007 C H Forsyth (forsyth@terzarima.net) +// Revisions Copyright © 2000-2007 Lucent Technologies Inc. and others +// Portions Copyright © 2009 The Go Authors. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +package arm + +import ( + "cmd/compile/internal/gc" + "cmd/internal/obj" + "cmd/internal/obj/arm" + "fmt" +) + +var resvd = []int{ + arm.REG_R9, // formerly reserved for m; might be okay to reuse now; not sure about NaCl + arm.REG_R10, // reserved for g +} + +/* + * return constant i node. + * overwritten by next call, but useful in calls to gins. + */ + +var ncon_n gc.Node + +func ncon(i uint32) *gc.Node { + if ncon_n.Type == nil { + gc.Nodconst(&ncon_n, gc.Types[gc.TUINT32], 0) + } + ncon_n.SetInt(int64(i)) + return &ncon_n +} + +var sclean [10]gc.Node + +var nsclean int + +/* + * n is a 64-bit value. fill in lo and hi to refer to its 32-bit halves. + */ +func split64(n *gc.Node, lo *gc.Node, hi *gc.Node) { + if !gc.Is64(n.Type) { + gc.Fatal("split64 %v", n.Type) + } + + if nsclean >= len(sclean) { + gc.Fatal("split64 clean") + } + sclean[nsclean].Op = gc.OEMPTY + nsclean++ + switch n.Op { + default: + switch n.Op { + default: + var n1 gc.Node + if !dotaddable(n, &n1) { + gc.Igen(n, &n1, nil) + sclean[nsclean-1] = n1 + } + + n = &n1 + + case gc.ONAME: + if n.Class == gc.PPARAMREF { + var n1 gc.Node + gc.Cgen(n.Name.Heapaddr, &n1) + sclean[nsclean-1] = n1 + n = &n1 + } + + // nothing + case gc.OINDREG: + break + } + + *lo = *n + *hi = *n + lo.Type = gc.Types[gc.TUINT32] + if n.Type.Etype == gc.TINT64 { + hi.Type = gc.Types[gc.TINT32] + } else { + hi.Type = gc.Types[gc.TUINT32] + } + hi.Xoffset += 4 + + case gc.OLITERAL: + var n1 gc.Node + n.Convconst(&n1, n.Type) + i := n1.Int() + gc.Nodconst(lo, gc.Types[gc.TUINT32], int64(uint32(i))) + i >>= 32 + if n.Type.Etype == gc.TINT64 { + gc.Nodconst(hi, gc.Types[gc.TINT32], int64(int32(i))) + } else { + gc.Nodconst(hi, gc.Types[gc.TUINT32], int64(uint32(i))) + } + } +} + +func splitclean() { + if nsclean <= 0 { + gc.Fatal("splitclean") + } + nsclean-- + if sclean[nsclean].Op != gc.OEMPTY { + gc.Regfree(&sclean[nsclean]) + } +} + +func gmove(f *gc.Node, t *gc.Node) { + if gc.Debug['M'] != 0 { + fmt.Printf("gmove %v -> %v\n", f, t) + } + + ft := gc.Simsimtype(f.Type) + tt := gc.Simsimtype(t.Type) + cvt := t.Type + + if gc.Iscomplex[ft] || gc.Iscomplex[tt] { + gc.Complexmove(f, t) + return + } + + // cannot have two memory operands; + // except 64-bit, which always copies via registers anyway. + var a int + var r1 gc.Node + if !gc.Is64(f.Type) && !gc.Is64(t.Type) && gc.Ismem(f) && gc.Ismem(t) { + goto hard + } + + // convert constant to desired type + if f.Op == gc.OLITERAL { + var con gc.Node + switch tt { + default: + f.Convconst(&con, t.Type) + + case gc.TINT16, + gc.TINT8: + var con gc.Node + f.Convconst(&con, gc.Types[gc.TINT32]) + var r1 gc.Node + gc.Regalloc(&r1, con.Type, t) + gins(arm.AMOVW, &con, &r1) + gmove(&r1, t) + gc.Regfree(&r1) + return + + case gc.TUINT16, + gc.TUINT8: + var con gc.Node + f.Convconst(&con, gc.Types[gc.TUINT32]) + var r1 gc.Node + gc.Regalloc(&r1, con.Type, t) + gins(arm.AMOVW, &con, &r1) + gmove(&r1, t) + gc.Regfree(&r1) + return + } + + f = &con + ft = gc.Simsimtype(con.Type) + + // constants can't move directly to memory + if gc.Ismem(t) && !gc.Is64(t.Type) { + goto hard + } + } + + // value -> value copy, only one memory operand. + // figure out the instruction to use. + // break out of switch for one-instruction gins. + // goto rdst for "destination must be register". + // goto hard for "convert to cvt type first". + // otherwise handle and return. + + switch uint32(ft)<<16 | uint32(tt) { + default: + // should not happen + gc.Fatal("gmove %v -> %v", f, t) + return + + /* + * integer copy and truncate + */ + case gc.TINT8<<16 | gc.TINT8: // same size + if !gc.Ismem(f) { + a = arm.AMOVB + break + } + fallthrough + + case gc.TUINT8<<16 | gc.TINT8, + gc.TINT16<<16 | gc.TINT8, // truncate + gc.TUINT16<<16 | gc.TINT8, + gc.TINT32<<16 | gc.TINT8, + gc.TUINT32<<16 | gc.TINT8: + a = arm.AMOVBS + + case gc.TUINT8<<16 | gc.TUINT8: + if !gc.Ismem(f) { + a = arm.AMOVB + break + } + fallthrough + + case gc.TINT8<<16 | gc.TUINT8, + gc.TINT16<<16 | gc.TUINT8, + gc.TUINT16<<16 | gc.TUINT8, + gc.TINT32<<16 | gc.TUINT8, + gc.TUINT32<<16 | gc.TUINT8: + a = arm.AMOVBU + + case gc.TINT64<<16 | gc.TINT8, // truncate low word + gc.TUINT64<<16 | gc.TINT8: + a = arm.AMOVBS + + goto trunc64 + + case gc.TINT64<<16 | gc.TUINT8, + gc.TUINT64<<16 | gc.TUINT8: + a = arm.AMOVBU + goto trunc64 + + case gc.TINT16<<16 | gc.TINT16: // same size + if !gc.Ismem(f) { + a = arm.AMOVH + break + } + fallthrough + + case gc.TUINT16<<16 | gc.TINT16, + gc.TINT32<<16 | gc.TINT16, // truncate + gc.TUINT32<<16 | gc.TINT16: + a = arm.AMOVHS + + case gc.TUINT16<<16 | gc.TUINT16: + if !gc.Ismem(f) { + a = arm.AMOVH + break + } + fallthrough + + case gc.TINT16<<16 | gc.TUINT16, + gc.TINT32<<16 | gc.TUINT16, + gc.TUINT32<<16 | gc.TUINT16: + a = arm.AMOVHU + + case gc.TINT64<<16 | gc.TINT16, // truncate low word + gc.TUINT64<<16 | gc.TINT16: + a = arm.AMOVHS + + goto trunc64 + + case gc.TINT64<<16 | gc.TUINT16, + gc.TUINT64<<16 | gc.TUINT16: + a = arm.AMOVHU + goto trunc64 + + case gc.TINT32<<16 | gc.TINT32, // same size + gc.TINT32<<16 | gc.TUINT32, + gc.TUINT32<<16 | gc.TINT32, + gc.TUINT32<<16 | gc.TUINT32: + a = arm.AMOVW + + case gc.TINT64<<16 | gc.TINT32, // truncate + gc.TUINT64<<16 | gc.TINT32, + gc.TINT64<<16 | gc.TUINT32, + gc.TUINT64<<16 | gc.TUINT32: + var flo gc.Node + var fhi gc.Node + split64(f, &flo, &fhi) + + var r1 gc.Node + gc.Regalloc(&r1, t.Type, nil) + gins(arm.AMOVW, &flo, &r1) + gins(arm.AMOVW, &r1, t) + gc.Regfree(&r1) + splitclean() + return + + case gc.TINT64<<16 | gc.TINT64, // same size + gc.TINT64<<16 | gc.TUINT64, + gc.TUINT64<<16 | gc.TINT64, + gc.TUINT64<<16 | gc.TUINT64: + var fhi gc.Node + var flo gc.Node + split64(f, &flo, &fhi) + + var tlo gc.Node + var thi gc.Node + split64(t, &tlo, &thi) + var r1 gc.Node + gc.Regalloc(&r1, flo.Type, nil) + var r2 gc.Node + gc.Regalloc(&r2, fhi.Type, nil) + gins(arm.AMOVW, &flo, &r1) + gins(arm.AMOVW, &fhi, &r2) + gins(arm.AMOVW, &r1, &tlo) + gins(arm.AMOVW, &r2, &thi) + gc.Regfree(&r1) + gc.Regfree(&r2) + splitclean() + splitclean() + return + + /* + * integer up-conversions + */ + case gc.TINT8<<16 | gc.TINT16, // sign extend int8 + gc.TINT8<<16 | gc.TUINT16, + gc.TINT8<<16 | gc.TINT32, + gc.TINT8<<16 | gc.TUINT32: + a = arm.AMOVBS + + goto rdst + + case gc.TINT8<<16 | gc.TINT64, // convert via int32 + gc.TINT8<<16 | gc.TUINT64: + cvt = gc.Types[gc.TINT32] + + goto hard + + case gc.TUINT8<<16 | gc.TINT16, // zero extend uint8 + gc.TUINT8<<16 | gc.TUINT16, + gc.TUINT8<<16 | gc.TINT32, + gc.TUINT8<<16 | gc.TUINT32: + a = arm.AMOVBU + + goto rdst + + case gc.TUINT8<<16 | gc.TINT64, // convert via uint32 + gc.TUINT8<<16 | gc.TUINT64: + cvt = gc.Types[gc.TUINT32] + + goto hard + + case gc.TINT16<<16 | gc.TINT32, // sign extend int16 + gc.TINT16<<16 | gc.TUINT32: + a = arm.AMOVHS + + goto rdst + + case gc.TINT16<<16 | gc.TINT64, // convert via int32 + gc.TINT16<<16 | gc.TUINT64: + cvt = gc.Types[gc.TINT32] + + goto hard + + case gc.TUINT16<<16 | gc.TINT32, // zero extend uint16 + gc.TUINT16<<16 | gc.TUINT32: + a = arm.AMOVHU + + goto rdst + + case gc.TUINT16<<16 | gc.TINT64, // convert via uint32 + gc.TUINT16<<16 | gc.TUINT64: + cvt = gc.Types[gc.TUINT32] + + goto hard + + case gc.TINT32<<16 | gc.TINT64, // sign extend int32 + gc.TINT32<<16 | gc.TUINT64: + var tlo gc.Node + var thi gc.Node + split64(t, &tlo, &thi) + + var r1 gc.Node + gc.Regalloc(&r1, tlo.Type, nil) + var r2 gc.Node + gc.Regalloc(&r2, thi.Type, nil) + gmove(f, &r1) + p1 := gins(arm.AMOVW, &r1, &r2) + p1.From.Type = obj.TYPE_SHIFT + p1.From.Offset = 2<<5 | 31<<7 | int64(r1.Reg)&15 // r1->31 + p1.From.Reg = 0 + + //print("gmove: %v\n", p1); + gins(arm.AMOVW, &r1, &tlo) + + gins(arm.AMOVW, &r2, &thi) + gc.Regfree(&r1) + gc.Regfree(&r2) + splitclean() + return + + case gc.TUINT32<<16 | gc.TINT64, // zero extend uint32 + gc.TUINT32<<16 | gc.TUINT64: + var thi gc.Node + var tlo gc.Node + split64(t, &tlo, &thi) + + gmove(f, &tlo) + var r1 gc.Node + gc.Regalloc(&r1, thi.Type, nil) + gins(arm.AMOVW, ncon(0), &r1) + gins(arm.AMOVW, &r1, &thi) + gc.Regfree(&r1) + splitclean() + return + + // case CASE(TFLOAT64, TUINT64): + /* + * float to integer + */ + case gc.TFLOAT32<<16 | gc.TINT8, + gc.TFLOAT32<<16 | gc.TUINT8, + gc.TFLOAT32<<16 | gc.TINT16, + gc.TFLOAT32<<16 | gc.TUINT16, + gc.TFLOAT32<<16 | gc.TINT32, + gc.TFLOAT32<<16 | gc.TUINT32, + + // case CASE(TFLOAT32, TUINT64): + + gc.TFLOAT64<<16 | gc.TINT8, + gc.TFLOAT64<<16 | gc.TUINT8, + gc.TFLOAT64<<16 | gc.TINT16, + gc.TFLOAT64<<16 | gc.TUINT16, + gc.TFLOAT64<<16 | gc.TINT32, + gc.TFLOAT64<<16 | gc.TUINT32: + fa := arm.AMOVF + + a := arm.AMOVFW + if ft == gc.TFLOAT64 { + fa = arm.AMOVD + a = arm.AMOVDW + } + + ta := arm.AMOVW + switch tt { + case gc.TINT8: + ta = arm.AMOVBS + + case gc.TUINT8: + ta = arm.AMOVBU + + case gc.TINT16: + ta = arm.AMOVHS + + case gc.TUINT16: + ta = arm.AMOVHU + } + + var r1 gc.Node + gc.Regalloc(&r1, gc.Types[ft], f) + var r2 gc.Node + gc.Regalloc(&r2, gc.Types[tt], t) + gins(fa, f, &r1) // load to fpu + p1 := gins(a, &r1, &r1) // convert to w + switch tt { + case gc.TUINT8, + gc.TUINT16, + gc.TUINT32: + p1.Scond |= arm.C_UBIT + } + + gins(arm.AMOVW, &r1, &r2) // copy to cpu + gins(ta, &r2, t) // store + gc.Regfree(&r1) + gc.Regfree(&r2) + return + + /* + * integer to float + */ + case gc.TINT8<<16 | gc.TFLOAT32, + gc.TUINT8<<16 | gc.TFLOAT32, + gc.TINT16<<16 | gc.TFLOAT32, + gc.TUINT16<<16 | gc.TFLOAT32, + gc.TINT32<<16 | gc.TFLOAT32, + gc.TUINT32<<16 | gc.TFLOAT32, + gc.TINT8<<16 | gc.TFLOAT64, + gc.TUINT8<<16 | gc.TFLOAT64, + gc.TINT16<<16 | gc.TFLOAT64, + gc.TUINT16<<16 | gc.TFLOAT64, + gc.TINT32<<16 | gc.TFLOAT64, + gc.TUINT32<<16 | gc.TFLOAT64: + fa := arm.AMOVW + + switch ft { + case gc.TINT8: + fa = arm.AMOVBS + + case gc.TUINT8: + fa = arm.AMOVBU + + case gc.TINT16: + fa = arm.AMOVHS + + case gc.TUINT16: + fa = arm.AMOVHU + } + + a := arm.AMOVWF + ta := arm.AMOVF + if tt == gc.TFLOAT64 { + a = arm.AMOVWD + ta = arm.AMOVD + } + + var r1 gc.Node + gc.Regalloc(&r1, gc.Types[ft], f) + var r2 gc.Node + gc.Regalloc(&r2, gc.Types[tt], t) + gins(fa, f, &r1) // load to cpu + gins(arm.AMOVW, &r1, &r2) // copy to fpu + p1 := gins(a, &r2, &r2) // convert + switch ft { + case gc.TUINT8, + gc.TUINT16, + gc.TUINT32: + p1.Scond |= arm.C_UBIT + } + + gins(ta, &r2, t) // store + gc.Regfree(&r1) + gc.Regfree(&r2) + return + + case gc.TUINT64<<16 | gc.TFLOAT32, + gc.TUINT64<<16 | gc.TFLOAT64: + gc.Fatal("gmove UINT64, TFLOAT not implemented") + return + + /* + * float to float + */ + case gc.TFLOAT32<<16 | gc.TFLOAT32: + a = arm.AMOVF + + case gc.TFLOAT64<<16 | gc.TFLOAT64: + a = arm.AMOVD + + case gc.TFLOAT32<<16 | gc.TFLOAT64: + var r1 gc.Node + gc.Regalloc(&r1, gc.Types[gc.TFLOAT64], t) + gins(arm.AMOVF, f, &r1) + gins(arm.AMOVFD, &r1, &r1) + gins(arm.AMOVD, &r1, t) + gc.Regfree(&r1) + return + + case gc.TFLOAT64<<16 | gc.TFLOAT32: + var r1 gc.Node + gc.Regalloc(&r1, gc.Types[gc.TFLOAT64], t) + gins(arm.AMOVD, f, &r1) + gins(arm.AMOVDF, &r1, &r1) + gins(arm.AMOVF, &r1, t) + gc.Regfree(&r1) + return + } + + gins(a, f, t) + return + + // TODO(kaib): we almost always require a register dest anyway, this can probably be + // removed. + // requires register destination +rdst: + { + gc.Regalloc(&r1, t.Type, t) + + gins(a, f, &r1) + gmove(&r1, t) + gc.Regfree(&r1) + return + } + + // requires register intermediate +hard: + gc.Regalloc(&r1, cvt, t) + + gmove(f, &r1) + gmove(&r1, t) + gc.Regfree(&r1) + return + + // truncate 64 bit integer +trunc64: + var fhi gc.Node + var flo gc.Node + split64(f, &flo, &fhi) + + gc.Regalloc(&r1, t.Type, nil) + gins(a, &flo, &r1) + gins(a, &r1, t) + gc.Regfree(&r1) + splitclean() + return +} + +func samaddr(f *gc.Node, t *gc.Node) bool { + if f.Op != t.Op { + return false + } + + switch f.Op { + case gc.OREGISTER: + if f.Reg != t.Reg { + break + } + return true + } + + return false +} + +/* + * generate one instruction: + * as f, t + */ +func gins(as int, f *gc.Node, t *gc.Node) *obj.Prog { + // Node nod; + // int32 v; + + if f != nil && f.Op == gc.OINDEX { + gc.Fatal("gins OINDEX not implemented") + } + + // gc.Regalloc(&nod, ®node, Z); + // v = constnode.vconst; + // gc.Cgen(f->right, &nod); + // constnode.vconst = v; + // idx.reg = nod.reg; + // gc.Regfree(&nod); + if t != nil && t.Op == gc.OINDEX { + gc.Fatal("gins OINDEX not implemented") + } + + // gc.Regalloc(&nod, ®node, Z); + // v = constnode.vconst; + // gc.Cgen(t->right, &nod); + // constnode.vconst = v; + // idx.reg = nod.reg; + // gc.Regfree(&nod); + + p := gc.Prog(as) + gc.Naddr(&p.From, f) + gc.Naddr(&p.To, t) + + switch as { + case arm.ABL: + if p.To.Type == obj.TYPE_REG { + p.To.Type = obj.TYPE_MEM + } + + case arm.ACMP, arm.ACMPF, arm.ACMPD: + if t != nil { + if f.Op != gc.OREGISTER { + /* generate a comparison + TODO(kaib): one of the args can actually be a small constant. relax the constraint and fix call sites. + */ + gc.Fatal("bad operands to gcmp") + } + p.From = p.To + p.To = obj.Addr{} + raddr(f, p) + } + + case arm.AMULU: + if f != nil && f.Op != gc.OREGISTER { + gc.Fatal("bad operands to mul") + } + + case arm.AMOVW: + if (p.From.Type == obj.TYPE_MEM || p.From.Type == obj.TYPE_ADDR || p.From.Type == obj.TYPE_CONST) && (p.To.Type == obj.TYPE_MEM || p.To.Type == obj.TYPE_ADDR) { + gc.Fatal("gins double memory") + } + + case arm.AADD: + if p.To.Type == obj.TYPE_MEM { + gc.Fatal("gins arith to mem") + } + + case arm.ARSB: + if p.From.Type == obj.TYPE_NONE { + gc.Fatal("rsb with no from") + } + } + + if gc.Debug['g'] != 0 { + fmt.Printf("%v\n", p) + } + return p +} + +/* + * insert n into reg slot of p + */ +func raddr(n *gc.Node, p *obj.Prog) { + var a obj.Addr + gc.Naddr(&a, n) + if a.Type != obj.TYPE_REG { + if n != nil { + gc.Fatal("bad in raddr: %v", gc.Oconv(int(n.Op), 0)) + } else { + gc.Fatal("bad in raddr: ") + } + p.Reg = 0 + } else { + p.Reg = a.Reg + } +} + +/* generate a constant shift + * arm encodes a shift by 32 as 0, thus asking for 0 shift is illegal. + */ +func gshift(as int, lhs *gc.Node, stype int32, sval int32, rhs *gc.Node) *obj.Prog { + if sval <= 0 || sval > 32 { + gc.Fatal("bad shift value: %d", sval) + } + + sval = sval & 0x1f + + p := gins(as, nil, rhs) + p.From.Type = obj.TYPE_SHIFT + p.From.Offset = int64(stype) | int64(sval)<<7 | int64(lhs.Reg)&15 + return p +} + +/* generate a register shift + */ +func gregshift(as int, lhs *gc.Node, stype int32, reg *gc.Node, rhs *gc.Node) *obj.Prog { + p := gins(as, nil, rhs) + p.From.Type = obj.TYPE_SHIFT + p.From.Offset = int64(stype) | (int64(reg.Reg)&15)<<8 | 1<<4 | int64(lhs.Reg)&15 + return p +} + +/* + * return Axxx for Oxxx on type t. + */ +func optoas(op int, t *gc.Type) int { + if t == nil { + gc.Fatal("optoas: t is nil") + } + + a := obj.AXXX + switch uint32(op)<<16 | uint32(gc.Simtype[t.Etype]) { + default: + gc.Fatal("optoas: no entry %v-%v etype %v simtype %v", gc.Oconv(int(op), 0), t, gc.Types[t.Etype], gc.Types[gc.Simtype[t.Etype]]) + + /* case CASE(OADDR, TPTR32): + a = ALEAL; + break; + + case CASE(OADDR, TPTR64): + a = ALEAQ; + break; + */ + // TODO(kaib): make sure the conditional branches work on all edge cases + case gc.OEQ<<16 | gc.TBOOL, + gc.OEQ<<16 | gc.TINT8, + gc.OEQ<<16 | gc.TUINT8, + gc.OEQ<<16 | gc.TINT16, + gc.OEQ<<16 | gc.TUINT16, + gc.OEQ<<16 | gc.TINT32, + gc.OEQ<<16 | gc.TUINT32, + gc.OEQ<<16 | gc.TINT64, + gc.OEQ<<16 | gc.TUINT64, + gc.OEQ<<16 | gc.TPTR32, + gc.OEQ<<16 | gc.TPTR64, + gc.OEQ<<16 | gc.TFLOAT32, + gc.OEQ<<16 | gc.TFLOAT64: + a = arm.ABEQ + + case gc.ONE<<16 | gc.TBOOL, + gc.ONE<<16 | gc.TINT8, + gc.ONE<<16 | gc.TUINT8, + gc.ONE<<16 | gc.TINT16, + gc.ONE<<16 | gc.TUINT16, + gc.ONE<<16 | gc.TINT32, + gc.ONE<<16 | gc.TUINT32, + gc.ONE<<16 | gc.TINT64, + gc.ONE<<16 | gc.TUINT64, + gc.ONE<<16 | gc.TPTR32, + gc.ONE<<16 | gc.TPTR64, + gc.ONE<<16 | gc.TFLOAT32, + gc.ONE<<16 | gc.TFLOAT64: + a = arm.ABNE + + case gc.OLT<<16 | gc.TINT8, + gc.OLT<<16 | gc.TINT16, + gc.OLT<<16 | gc.TINT32, + gc.OLT<<16 | gc.TINT64, + gc.OLT<<16 | gc.TFLOAT32, + gc.OLT<<16 | gc.TFLOAT64: + a = arm.ABLT + + case gc.OLT<<16 | gc.TUINT8, + gc.OLT<<16 | gc.TUINT16, + gc.OLT<<16 | gc.TUINT32, + gc.OLT<<16 | gc.TUINT64: + a = arm.ABLO + + case gc.OLE<<16 | gc.TINT8, + gc.OLE<<16 | gc.TINT16, + gc.OLE<<16 | gc.TINT32, + gc.OLE<<16 | gc.TINT64, + gc.OLE<<16 | gc.TFLOAT32, + gc.OLE<<16 | gc.TFLOAT64: + a = arm.ABLE + + case gc.OLE<<16 | gc.TUINT8, + gc.OLE<<16 | gc.TUINT16, + gc.OLE<<16 | gc.TUINT32, + gc.OLE<<16 | gc.TUINT64: + a = arm.ABLS + + case gc.OGT<<16 | gc.TINT8, + gc.OGT<<16 | gc.TINT16, + gc.OGT<<16 | gc.TINT32, + gc.OGT<<16 | gc.TINT64, + gc.OGT<<16 | gc.TFLOAT32, + gc.OGT<<16 | gc.TFLOAT64: + a = arm.ABGT + + case gc.OGT<<16 | gc.TUINT8, + gc.OGT<<16 | gc.TUINT16, + gc.OGT<<16 | gc.TUINT32, + gc.OGT<<16 | gc.TUINT64: + a = arm.ABHI + + case gc.OGE<<16 | gc.TINT8, + gc.OGE<<16 | gc.TINT16, + gc.OGE<<16 | gc.TINT32, + gc.OGE<<16 | gc.TINT64, + gc.OGE<<16 | gc.TFLOAT32, + gc.OGE<<16 | gc.TFLOAT64: + a = arm.ABGE + + case gc.OGE<<16 | gc.TUINT8, + gc.OGE<<16 | gc.TUINT16, + gc.OGE<<16 | gc.TUINT32, + gc.OGE<<16 | gc.TUINT64: + a = arm.ABHS + + case gc.OCMP<<16 | gc.TBOOL, + gc.OCMP<<16 | gc.TINT8, + gc.OCMP<<16 | gc.TUINT8, + gc.OCMP<<16 | gc.TINT16, + gc.OCMP<<16 | gc.TUINT16, + gc.OCMP<<16 | gc.TINT32, + gc.OCMP<<16 | gc.TUINT32, + gc.OCMP<<16 | gc.TPTR32: + a = arm.ACMP + + case gc.OCMP<<16 | gc.TFLOAT32: + a = arm.ACMPF + + case gc.OCMP<<16 | gc.TFLOAT64: + a = arm.ACMPD + + case gc.OPS<<16 | gc.TFLOAT32, + gc.OPS<<16 | gc.TFLOAT64: + a = arm.ABVS + + case gc.OAS<<16 | gc.TBOOL: + a = arm.AMOVB + + case gc.OAS<<16 | gc.TINT8: + a = arm.AMOVBS + + case gc.OAS<<16 | gc.TUINT8: + a = arm.AMOVBU + + case gc.OAS<<16 | gc.TINT16: + a = arm.AMOVHS + + case gc.OAS<<16 | gc.TUINT16: + a = arm.AMOVHU + + case gc.OAS<<16 | gc.TINT32, + gc.OAS<<16 | gc.TUINT32, + gc.OAS<<16 | gc.TPTR32: + a = arm.AMOVW + + case gc.OAS<<16 | gc.TFLOAT32: + a = arm.AMOVF + + case gc.OAS<<16 | gc.TFLOAT64: + a = arm.AMOVD + + case gc.OADD<<16 | gc.TINT8, + gc.OADD<<16 | gc.TUINT8, + gc.OADD<<16 | gc.TINT16, + gc.OADD<<16 | gc.TUINT16, + gc.OADD<<16 | gc.TINT32, + gc.OADD<<16 | gc.TUINT32, + gc.OADD<<16 | gc.TPTR32: + a = arm.AADD + + case gc.OADD<<16 | gc.TFLOAT32: + a = arm.AADDF + + case gc.OADD<<16 | gc.TFLOAT64: + a = arm.AADDD + + case gc.OSUB<<16 | gc.TINT8, + gc.OSUB<<16 | gc.TUINT8, + gc.OSUB<<16 | gc.TINT16, + gc.OSUB<<16 | gc.TUINT16, + gc.OSUB<<16 | gc.TINT32, + gc.OSUB<<16 | gc.TUINT32, + gc.OSUB<<16 | gc.TPTR32: + a = arm.ASUB + + case gc.OSUB<<16 | gc.TFLOAT32: + a = arm.ASUBF + + case gc.OSUB<<16 | gc.TFLOAT64: + a = arm.ASUBD + + case gc.OMINUS<<16 | gc.TINT8, + gc.OMINUS<<16 | gc.TUINT8, + gc.OMINUS<<16 | gc.TINT16, + gc.OMINUS<<16 | gc.TUINT16, + gc.OMINUS<<16 | gc.TINT32, + gc.OMINUS<<16 | gc.TUINT32, + gc.OMINUS<<16 | gc.TPTR32: + a = arm.ARSB + + case gc.OAND<<16 | gc.TINT8, + gc.OAND<<16 | gc.TUINT8, + gc.OAND<<16 | gc.TINT16, + gc.OAND<<16 | gc.TUINT16, + gc.OAND<<16 | gc.TINT32, + gc.OAND<<16 | gc.TUINT32, + gc.OAND<<16 | gc.TPTR32: + a = arm.AAND + + case gc.OOR<<16 | gc.TINT8, + gc.OOR<<16 | gc.TUINT8, + gc.OOR<<16 | gc.TINT16, + gc.OOR<<16 | gc.TUINT16, + gc.OOR<<16 | gc.TINT32, + gc.OOR<<16 | gc.TUINT32, + gc.OOR<<16 | gc.TPTR32: + a = arm.AORR + + case gc.OXOR<<16 | gc.TINT8, + gc.OXOR<<16 | gc.TUINT8, + gc.OXOR<<16 | gc.TINT16, + gc.OXOR<<16 | gc.TUINT16, + gc.OXOR<<16 | gc.TINT32, + gc.OXOR<<16 | gc.TUINT32, + gc.OXOR<<16 | gc.TPTR32: + a = arm.AEOR + + case gc.OLSH<<16 | gc.TINT8, + gc.OLSH<<16 | gc.TUINT8, + gc.OLSH<<16 | gc.TINT16, + gc.OLSH<<16 | gc.TUINT16, + gc.OLSH<<16 | gc.TINT32, + gc.OLSH<<16 | gc.TUINT32, + gc.OLSH<<16 | gc.TPTR32: + a = arm.ASLL + + case gc.ORSH<<16 | gc.TUINT8, + gc.ORSH<<16 | gc.TUINT16, + gc.ORSH<<16 | gc.TUINT32, + gc.ORSH<<16 | gc.TPTR32: + a = arm.ASRL + + case gc.ORSH<<16 | gc.TINT8, + gc.ORSH<<16 | gc.TINT16, + gc.ORSH<<16 | gc.TINT32: + a = arm.ASRA + + case gc.OMUL<<16 | gc.TUINT8, + gc.OMUL<<16 | gc.TUINT16, + gc.OMUL<<16 | gc.TUINT32, + gc.OMUL<<16 | gc.TPTR32: + a = arm.AMULU + + case gc.OMUL<<16 | gc.TINT8, + gc.OMUL<<16 | gc.TINT16, + gc.OMUL<<16 | gc.TINT32: + a = arm.AMUL + + case gc.OMUL<<16 | gc.TFLOAT32: + a = arm.AMULF + + case gc.OMUL<<16 | gc.TFLOAT64: + a = arm.AMULD + + case gc.ODIV<<16 | gc.TUINT8, + gc.ODIV<<16 | gc.TUINT16, + gc.ODIV<<16 | gc.TUINT32, + gc.ODIV<<16 | gc.TPTR32: + a = arm.ADIVU + + case gc.ODIV<<16 | gc.TINT8, + gc.ODIV<<16 | gc.TINT16, + gc.ODIV<<16 | gc.TINT32: + a = arm.ADIV + + case gc.OMOD<<16 | gc.TUINT8, + gc.OMOD<<16 | gc.TUINT16, + gc.OMOD<<16 | gc.TUINT32, + gc.OMOD<<16 | gc.TPTR32: + a = arm.AMODU + + case gc.OMOD<<16 | gc.TINT8, + gc.OMOD<<16 | gc.TINT16, + gc.OMOD<<16 | gc.TINT32: + a = arm.AMOD + + // case CASE(OEXTEND, TINT16): + // a = ACWD; + // break; + + // case CASE(OEXTEND, TINT32): + // a = ACDQ; + // break; + + // case CASE(OEXTEND, TINT64): + // a = ACQO; + // break; + + case gc.ODIV<<16 | gc.TFLOAT32: + a = arm.ADIVF + + case gc.ODIV<<16 | gc.TFLOAT64: + a = arm.ADIVD + + case gc.OSQRT<<16 | gc.TFLOAT64: + a = arm.ASQRTD + } + + return a +} + +const ( + ODynam = 1 << 0 + OPtrto = 1 << 1 +) + +var clean [20]gc.Node + +var cleani int = 0 + +func sudoclean() { + if clean[cleani-1].Op != gc.OEMPTY { + gc.Regfree(&clean[cleani-1]) + } + if clean[cleani-2].Op != gc.OEMPTY { + gc.Regfree(&clean[cleani-2]) + } + cleani -= 2 +} + +func dotaddable(n *gc.Node, n1 *gc.Node) bool { + if n.Op != gc.ODOT { + return false + } + + var oary [10]int64 + var nn *gc.Node + o := gc.Dotoffset(n, oary[:], &nn) + if nn != nil && nn.Addable && o == 1 && oary[0] >= 0 { + *n1 = *nn + n1.Type = n.Type + n1.Xoffset += oary[0] + return true + } + + return false +} + +/* + * generate code to compute address of n, + * a reference to a (perhaps nested) field inside + * an array or struct. + * return 0 on failure, 1 on success. + * on success, leaves usable address in a. + * + * caller is responsible for calling sudoclean + * after successful sudoaddable, + * to release the register used for a. + */ +func sudoaddable(as int, n *gc.Node, a *obj.Addr) bool { + if n.Type == nil { + return false + } + + *a = obj.Addr{} + + switch n.Op { + case gc.OLITERAL: + if !gc.Isconst(n, gc.CTINT) { + break + } + v := n.Int() + if v >= 32000 || v <= -32000 { + break + } + switch as { + default: + return false + + case arm.AADD, + arm.ASUB, + arm.AAND, + arm.AORR, + arm.AEOR, + arm.AMOVB, + arm.AMOVBS, + arm.AMOVBU, + arm.AMOVH, + arm.AMOVHS, + arm.AMOVHU, + arm.AMOVW: + break + } + + cleani += 2 + reg := &clean[cleani-1] + reg1 := &clean[cleani-2] + reg.Op = gc.OEMPTY + reg1.Op = gc.OEMPTY + gc.Naddr(a, n) + return true + + case gc.ODOT, + gc.ODOTPTR: + cleani += 2 + reg := &clean[cleani-1] + reg1 := &clean[cleani-2] + reg.Op = gc.OEMPTY + reg1.Op = gc.OEMPTY + var nn *gc.Node + var oary [10]int64 + o := gc.Dotoffset(n, oary[:], &nn) + if nn == nil { + sudoclean() + return false + } + + if nn.Addable && o == 1 && oary[0] >= 0 { + // directly addressable set of DOTs + n1 := *nn + + n1.Type = n.Type + n1.Xoffset += oary[0] + gc.Naddr(a, &n1) + return true + } + + gc.Regalloc(reg, gc.Types[gc.Tptr], nil) + n1 := *reg + n1.Op = gc.OINDREG + if oary[0] >= 0 { + gc.Agen(nn, reg) + n1.Xoffset = oary[0] + } else { + gc.Cgen(nn, reg) + gc.Cgen_checknil(reg) + n1.Xoffset = -(oary[0] + 1) + } + + for i := 1; i < o; i++ { + if oary[i] >= 0 { + gc.Fatal("can't happen") + } + gins(arm.AMOVW, &n1, reg) + gc.Cgen_checknil(reg) + n1.Xoffset = -(oary[i] + 1) + } + + a.Type = obj.TYPE_NONE + a.Name = obj.NAME_NONE + n1.Type = n.Type + gc.Naddr(a, &n1) + return true + + case gc.OINDEX: + return false + } + + return false +} diff --git a/src/cmd/compile/internal/arm/peep.go b/src/cmd/compile/internal/arm/peep.go new file mode 100644 index 0000000000000000000000000000000000000000..66eba417c02f231b1ee42b80a7fcd247b9081e76 --- /dev/null +++ b/src/cmd/compile/internal/arm/peep.go @@ -0,0 +1,1748 @@ +// Inferno utils/5c/peep.c +// http://code.google.com/p/inferno-os/source/browse/utils/5c/peep.c +// +// Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved. +// Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net) +// Portions Copyright © 1997-1999 Vita Nuova Limited +// Portions Copyright © 2000-2007 Vita Nuova Holdings Limited (www.vitanuova.com) +// Portions Copyright © 2004,2006 Bruce Ellis +// Portions Copyright © 2005-2007 C H Forsyth (forsyth@terzarima.net) +// Revisions Copyright © 2000-2007 Lucent Technologies Inc. and others +// Portions Copyright © 2009 The Go Authors. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +package arm + +import ( + "cmd/compile/internal/gc" + "cmd/internal/obj" + "cmd/internal/obj/arm" + "fmt" +) + +var gactive uint32 + +// UNUSED +func peep(firstp *obj.Prog) { + g := (*gc.Graph)(gc.Flowstart(firstp, nil)) + if g == nil { + return + } + gactive = 0 + + var r *gc.Flow + var p *obj.Prog + var t int +loop1: + if gc.Debug['P'] != 0 && gc.Debug['v'] != 0 { + gc.Dumpit("loop1", g.Start, 0) + } + + t = 0 + for r = g.Start; r != nil; r = r.Link { + p = r.Prog + switch p.As { + /* + * elide shift into TYPE_SHIFT operand of subsequent instruction + */ + // if(shiftprop(r)) { + // excise(r); + // t++; + // break; + // } + case arm.ASLL, + arm.ASRL, + arm.ASRA: + break + + case arm.AMOVB, + arm.AMOVH, + arm.AMOVW, + arm.AMOVF, + arm.AMOVD: + if regtyp(&p.From) { + if p.From.Type == p.To.Type && isfloatreg(&p.From) == isfloatreg(&p.To) { + if p.Scond == arm.C_SCOND_NONE { + if copyprop(g, r) { + excise(r) + t++ + break + } + + if subprop(r) && copyprop(g, r) { + excise(r) + t++ + break + } + } + } + } + + case arm.AMOVHS, + arm.AMOVHU, + arm.AMOVBS, + arm.AMOVBU: + if p.From.Type == obj.TYPE_REG { + if shortprop(r) { + t++ + } + } + } + } + + /* + if(p->scond == C_SCOND_NONE) + if(regtyp(&p->to)) + if(isdconst(&p->from)) { + constprop(&p->from, &p->to, r->s1); + } + break; + */ + if t != 0 { + goto loop1 + } + + for r := (*gc.Flow)(g.Start); r != nil; r = r.Link { + p = r.Prog + switch p.As { + /* + * EOR -1,x,y => MVN x,y + */ + case arm.AEOR: + if isdconst(&p.From) && p.From.Offset == -1 { + p.As = arm.AMVN + p.From.Type = obj.TYPE_REG + if p.Reg != 0 { + p.From.Reg = p.Reg + } else { + p.From.Reg = p.To.Reg + } + p.Reg = 0 + } + } + } + + for r := (*gc.Flow)(g.Start); r != nil; r = r.Link { + p = r.Prog + switch p.As { + case arm.AMOVW, + arm.AMOVB, + arm.AMOVBS, + arm.AMOVBU: + if p.From.Type == obj.TYPE_MEM && p.From.Offset == 0 { + xtramodes(g, r, &p.From) + } else if p.To.Type == obj.TYPE_MEM && p.To.Offset == 0 { + xtramodes(g, r, &p.To) + } else { + continue + } + } + } + + // case ACMP: + // /* + // * elide CMP $0,x if calculation of x can set condition codes + // */ + // if(isdconst(&p->from) || p->from.offset != 0) + // continue; + // r2 = r->s1; + // if(r2 == nil) + // continue; + // t = r2->prog->as; + // switch(t) { + // default: + // continue; + // case ABEQ: + // case ABNE: + // case ABMI: + // case ABPL: + // break; + // case ABGE: + // t = ABPL; + // break; + // case ABLT: + // t = ABMI; + // break; + // case ABHI: + // t = ABNE; + // break; + // case ABLS: + // t = ABEQ; + // break; + // } + // r1 = r; + // do + // r1 = uniqp(r1); + // while (r1 != nil && r1->prog->as == ANOP); + // if(r1 == nil) + // continue; + // p1 = r1->prog; + // if(p1->to.type != TYPE_REG) + // continue; + // if(p1->to.reg != p->reg) + // if(!(p1->as == AMOVW && p1->from.type == TYPE_REG && p1->from.reg == p->reg)) + // continue; + // + // switch(p1->as) { + // default: + // continue; + // case AMOVW: + // if(p1->from.type != TYPE_REG) + // continue; + // case AAND: + // case AEOR: + // case AORR: + // case ABIC: + // case AMVN: + // case ASUB: + // case ARSB: + // case AADD: + // case AADC: + // case ASBC: + // case ARSC: + // break; + // } + // p1->scond |= C_SBIT; + // r2->prog->as = t; + // excise(r); + // continue; + + // predicate(g); + + gc.Flowend(g) +} + +func regtyp(a *obj.Addr) bool { + return a.Type == obj.TYPE_REG && (arm.REG_R0 <= a.Reg && a.Reg <= arm.REG_R15 || arm.REG_F0 <= a.Reg && a.Reg <= arm.REG_F15) +} + +/* + * the idea is to substitute + * one register for another + * from one MOV to another + * MOV a, R0 + * ADD b, R0 / no use of R1 + * MOV R0, R1 + * would be converted to + * MOV a, R1 + * ADD b, R1 + * MOV R1, R0 + * hopefully, then the former or latter MOV + * will be eliminated by copy propagation. + */ +func subprop(r0 *gc.Flow) bool { + p := (*obj.Prog)(r0.Prog) + v1 := (*obj.Addr)(&p.From) + if !regtyp(v1) { + return false + } + v2 := (*obj.Addr)(&p.To) + if !regtyp(v2) { + return false + } + for r := gc.Uniqp(r0); r != nil; r = gc.Uniqp(r) { + if gc.Uniqs(r) == nil { + break + } + p = r.Prog + if p.As == obj.AVARDEF || p.As == obj.AVARKILL { + continue + } + if p.Info.Flags&gc.Call != 0 { + return false + } + + // TODO(rsc): Whatever invalidated the info should have done this call. + proginfo(p) + + if (p.Info.Flags&gc.CanRegRead != 0) && p.To.Type == obj.TYPE_REG { + p.Info.Flags |= gc.RegRead + p.Info.Flags &^= (gc.CanRegRead | gc.RightRead) + p.Reg = p.To.Reg + } + + switch p.As { + case arm.AMULLU, + arm.AMULA, + arm.AMVN: + return false + } + + if p.Info.Flags&(gc.RightRead|gc.RightWrite) == gc.RightWrite { + if p.To.Type == v1.Type { + if p.To.Reg == v1.Reg { + if p.Scond == arm.C_SCOND_NONE { + copysub(&p.To, v1, v2, 1) + if gc.Debug['P'] != 0 { + fmt.Printf("gotit: %v->%v\n%v", gc.Ctxt.Dconv(v1), gc.Ctxt.Dconv(v2), r.Prog) + if p.From.Type == v2.Type { + fmt.Printf(" excise") + } + fmt.Printf("\n") + } + + for r = gc.Uniqs(r); r != r0; r = gc.Uniqs(r) { + p = r.Prog + copysub(&p.From, v1, v2, 1) + copysub1(p, v1, v2, 1) + copysub(&p.To, v1, v2, 1) + if gc.Debug['P'] != 0 { + fmt.Printf("%v\n", r.Prog) + } + } + + t := int(int(v1.Reg)) + v1.Reg = v2.Reg + v2.Reg = int16(t) + if gc.Debug['P'] != 0 { + fmt.Printf("%v last\n", r.Prog) + } + return true + } + } + } + } + + if copyau(&p.From, v2) || copyau1(p, v2) || copyau(&p.To, v2) { + break + } + if copysub(&p.From, v1, v2, 0) != 0 || copysub1(p, v1, v2, 0) != 0 || copysub(&p.To, v1, v2, 0) != 0 { + break + } + } + + return false +} + +/* + * The idea is to remove redundant copies. + * v1->v2 F=0 + * (use v2 s/v2/v1/)* + * set v1 F=1 + * use v2 return fail + * ----------------- + * v1->v2 F=0 + * (use v2 s/v2/v1/)* + * set v1 F=1 + * set v2 return success + */ +func copyprop(g *gc.Graph, r0 *gc.Flow) bool { + p := (*obj.Prog)(r0.Prog) + v1 := (*obj.Addr)(&p.From) + v2 := (*obj.Addr)(&p.To) + if copyas(v1, v2) { + return true + } + gactive++ + return copy1(v1, v2, r0.S1, 0) +} + +func copy1(v1 *obj.Addr, v2 *obj.Addr, r *gc.Flow, f int) bool { + if uint32(r.Active) == gactive { + if gc.Debug['P'] != 0 { + fmt.Printf("act set; return 1\n") + } + return true + } + + r.Active = int32(gactive) + if gc.Debug['P'] != 0 { + fmt.Printf("copy %v->%v f=%d\n", gc.Ctxt.Dconv(v1), gc.Ctxt.Dconv(v2), f) + } + var t int + var p *obj.Prog + for ; r != nil; r = r.S1 { + p = r.Prog + if gc.Debug['P'] != 0 { + fmt.Printf("%v", p) + } + if f == 0 && gc.Uniqp(r) == nil { + f = 1 + if gc.Debug['P'] != 0 { + fmt.Printf("; merge; f=%d", f) + } + } + + t = copyu(p, v2, nil) + switch t { + case 2: /* rar, can't split */ + if gc.Debug['P'] != 0 { + fmt.Printf("; %vrar; return 0\n", gc.Ctxt.Dconv(v2)) + } + return false + + case 3: /* set */ + if gc.Debug['P'] != 0 { + fmt.Printf("; %vset; return 1\n", gc.Ctxt.Dconv(v2)) + } + return true + + case 1, /* used, substitute */ + 4: /* use and set */ + if f != 0 { + if gc.Debug['P'] == 0 { + return false + } + if t == 4 { + fmt.Printf("; %vused+set and f=%d; return 0\n", gc.Ctxt.Dconv(v2), f) + } else { + fmt.Printf("; %vused and f=%d; return 0\n", gc.Ctxt.Dconv(v2), f) + } + return false + } + + if copyu(p, v2, v1) != 0 { + if gc.Debug['P'] != 0 { + fmt.Printf("; sub fail; return 0\n") + } + return false + } + + if gc.Debug['P'] != 0 { + fmt.Printf("; sub%v/%v", gc.Ctxt.Dconv(v2), gc.Ctxt.Dconv(v1)) + } + if t == 4 { + if gc.Debug['P'] != 0 { + fmt.Printf("; %vused+set; return 1\n", gc.Ctxt.Dconv(v2)) + } + return true + } + } + + if f == 0 { + t = copyu(p, v1, nil) + if f == 0 && (t == 2 || t == 3 || t == 4) { + f = 1 + if gc.Debug['P'] != 0 { + fmt.Printf("; %vset and !f; f=%d", gc.Ctxt.Dconv(v1), f) + } + } + } + + if gc.Debug['P'] != 0 { + fmt.Printf("\n") + } + if r.S2 != nil { + if !copy1(v1, v2, r.S2, f) { + return false + } + } + } + + return true +} + +// UNUSED +/* + * The idea is to remove redundant constants. + * $c1->v1 + * ($c1->v2 s/$c1/v1)* + * set v1 return + * The v1->v2 should be eliminated by copy propagation. + */ +func constprop(c1 *obj.Addr, v1 *obj.Addr, r *gc.Flow) { + if gc.Debug['P'] != 0 { + fmt.Printf("constprop %v->%v\n", gc.Ctxt.Dconv(c1), gc.Ctxt.Dconv(v1)) + } + var p *obj.Prog + for ; r != nil; r = r.S1 { + p = r.Prog + if gc.Debug['P'] != 0 { + fmt.Printf("%v", p) + } + if gc.Uniqp(r) == nil { + if gc.Debug['P'] != 0 { + fmt.Printf("; merge; return\n") + } + return + } + + if p.As == arm.AMOVW && copyas(&p.From, c1) { + if gc.Debug['P'] != 0 { + fmt.Printf("; sub%v/%v", gc.Ctxt.Dconv(&p.From), gc.Ctxt.Dconv(v1)) + } + p.From = *v1 + } else if copyu(p, v1, nil) > 1 { + if gc.Debug['P'] != 0 { + fmt.Printf("; %vset; return\n", gc.Ctxt.Dconv(v1)) + } + return + } + + if gc.Debug['P'] != 0 { + fmt.Printf("\n") + } + if r.S2 != nil { + constprop(c1, v1, r.S2) + } + } +} + +/* + * shortprop eliminates redundant zero/sign extensions. + * + * MOVBS x, R + * + * MOVBS R, R' + * + * changed to + * + * MOVBS x, R + * ... + * MOVB R, R' (compiled to mov) + * + * MOVBS above can be a MOVBS, MOVBU, MOVHS or MOVHU. + */ +func shortprop(r *gc.Flow) bool { + p := (*obj.Prog)(r.Prog) + r1 := (*gc.Flow)(findpre(r, &p.From)) + if r1 == nil { + return false + } + + p1 := (*obj.Prog)(r1.Prog) + if p1.As == p.As { + // Two consecutive extensions. + goto gotit + } + + if p1.As == arm.AMOVW && isdconst(&p1.From) && p1.From.Offset >= 0 && p1.From.Offset < 128 { + // Loaded an immediate. + goto gotit + } + + return false + +gotit: + if gc.Debug['P'] != 0 { + fmt.Printf("shortprop\n%v\n%v", p1, p) + } + switch p.As { + case arm.AMOVBS, + arm.AMOVBU: + p.As = arm.AMOVB + + case arm.AMOVHS, + arm.AMOVHU: + p.As = arm.AMOVH + } + + if gc.Debug['P'] != 0 { + fmt.Printf(" => %v\n", obj.Aconv(int(p.As))) + } + return true +} + +// UNUSED +/* + * ASLL x,y,w + * .. (not use w, not set x y w) + * AXXX w,a,b (a != w) + * .. (not use w) + * (set w) + * ----------- changed to + * .. + * AXXX (x< 1) || (a.Type == obj.TYPE_REG && copyu(p1, &a, nil) > 1) { + if gc.Debug['P'] != 0 { + fmt.Printf("\targs modified; FAILURE\n") + } + return false + } + + continue + case 3: /* set, not used */ + { + if gc.Debug['P'] != 0 { + fmt.Printf("\tBOTCH: noref; FAILURE\n") + } + return false + } + } + + break + } + + /* check whether substitution can be done */ + switch p1.As { + default: + if gc.Debug['P'] != 0 { + fmt.Printf("\tnon-dpi; FAILURE\n") + } + return false + + case arm.AAND, + arm.AEOR, + arm.AADD, + arm.AADC, + arm.AORR, + arm.ASUB, + arm.ASBC, + arm.ARSB, + arm.ARSC: + if int(p1.Reg) == n || (p1.Reg == 0 && p1.To.Type == obj.TYPE_REG && int(p1.To.Reg) == n) { + if p1.From.Type != obj.TYPE_REG { + if gc.Debug['P'] != 0 { + fmt.Printf("\tcan't swap; FAILURE\n") + } + return false + } + + p1.Reg = p1.From.Reg + p1.From.Reg = int16(n) + switch p1.As { + case arm.ASUB: + p1.As = arm.ARSB + + case arm.ARSB: + p1.As = arm.ASUB + + case arm.ASBC: + p1.As = arm.ARSC + + case arm.ARSC: + p1.As = arm.ASBC + } + + if gc.Debug['P'] != 0 { + fmt.Printf("\t=>%v", p1) + } + } + fallthrough + + case arm.ABIC, + arm.ATST, + arm.ACMP, + arm.ACMN: + if int(p1.Reg) == n { + if gc.Debug['P'] != 0 { + fmt.Printf("\tcan't swap; FAILURE\n") + } + return false + } + + if p1.Reg == 0 && int(p1.To.Reg) == n { + if gc.Debug['P'] != 0 { + fmt.Printf("\tshift result used twice; FAILURE\n") + } + return false + } + + // case AMVN: + if p1.From.Type == obj.TYPE_SHIFT { + if gc.Debug['P'] != 0 { + fmt.Printf("\tshift result used in shift; FAILURE\n") + } + return false + } + + if p1.From.Type != obj.TYPE_REG || int(p1.From.Reg) != n { + if gc.Debug['P'] != 0 { + fmt.Printf("\tBOTCH: where is it used?; FAILURE\n") + } + return false + } + } + + /* check whether shift result is used subsequently */ + p2 := (*obj.Prog)(p1) + + if int(p1.To.Reg) != n { + var p1 *obj.Prog + for { + r1 = gc.Uniqs(r1) + if r1 == nil { + if gc.Debug['P'] != 0 { + fmt.Printf("\tinconclusive; FAILURE\n") + } + return false + } + + p1 = r1.Prog + if gc.Debug['P'] != 0 { + fmt.Printf("\n%v", p1) + } + switch copyu(p1, &p.To, nil) { + case 0: /* not used or set */ + continue + + case 3: /* set, not used */ + break + + default: /* used */ + if gc.Debug['P'] != 0 { + fmt.Printf("\treused; FAILURE\n") + } + return false + } + + break + } + } + + /* make the substitution */ + p2.From.Reg = 0 + + o := int(int(p.Reg)) + if o == 0 { + o = int(p.To.Reg) + } + o &= 15 + + switch p.From.Type { + case obj.TYPE_CONST: + o |= int((p.From.Offset & 0x1f) << 7) + + case obj.TYPE_REG: + o |= 1<<4 | (int(p.From.Reg)&15)<<8 + } + + switch p.As { + case arm.ASLL: + o |= 0 << 5 + + case arm.ASRL: + o |= 1 << 5 + + case arm.ASRA: + o |= 2 << 5 + } + + p2.From = obj.Addr{} + p2.From.Type = obj.TYPE_SHIFT + p2.From.Offset = int64(o) + if gc.Debug['P'] != 0 { + fmt.Printf("\t=>%v\tSUCCEED\n", p2) + } + return true +} + +/* + * findpre returns the last instruction mentioning v + * before r. It must be a set, and there must be + * a unique path from that instruction to r. + */ +func findpre(r *gc.Flow, v *obj.Addr) *gc.Flow { + var r1 *gc.Flow + + for r1 = gc.Uniqp(r); r1 != nil; r, r1 = r1, gc.Uniqp(r1) { + if gc.Uniqs(r1) != r { + return nil + } + switch copyu(r1.Prog, v, nil) { + case 1, /* used */ + 2: /* read-alter-rewrite */ + return nil + + case 3, /* set */ + 4: /* set and used */ + return r1 + } + } + + return nil +} + +/* + * findinc finds ADD instructions with a constant + * argument which falls within the immed_12 range. + */ +func findinc(r *gc.Flow, r2 *gc.Flow, v *obj.Addr) *gc.Flow { + var r1 *gc.Flow + var p *obj.Prog + + for r1 = gc.Uniqs(r); r1 != nil && r1 != r2; r, r1 = r1, gc.Uniqs(r1) { + if gc.Uniqp(r1) != r { + return nil + } + switch copyu(r1.Prog, v, nil) { + case 0: /* not touched */ + continue + + case 4: /* set and used */ + p = r1.Prog + + if p.As == arm.AADD { + if isdconst(&p.From) { + if p.From.Offset > -4096 && p.From.Offset < 4096 { + return r1 + } + } + } + fallthrough + + default: + return nil + } + } + + return nil +} + +func nochange(r *gc.Flow, r2 *gc.Flow, p *obj.Prog) bool { + if r == r2 { + return true + } + n := int(0) + var a [3]obj.Addr + if p.Reg != 0 && p.Reg != p.To.Reg { + a[n].Type = obj.TYPE_REG + a[n].Reg = p.Reg + n++ + } + + switch p.From.Type { + case obj.TYPE_SHIFT: + a[n].Type = obj.TYPE_REG + a[n].Reg = int16(arm.REG_R0 + (p.From.Offset & 0xf)) + n++ + fallthrough + + case obj.TYPE_REG: + a[n].Type = obj.TYPE_REG + a[n].Reg = p.From.Reg + n++ + } + + if n == 0 { + return true + } + var i int + for ; r != nil && r != r2; r = gc.Uniqs(r) { + p = r.Prog + for i = 0; i < n; i++ { + if copyu(p, &a[i], nil) > 1 { + return false + } + } + } + + return true +} + +func findu1(r *gc.Flow, v *obj.Addr) bool { + for ; r != nil; r = r.S1 { + if r.Active != 0 { + return false + } + r.Active = 1 + switch copyu(r.Prog, v, nil) { + case 1, /* used */ + 2, /* read-alter-rewrite */ + 4: /* set and used */ + return true + + case 3: /* set */ + return false + } + + if r.S2 != nil { + if findu1(r.S2, v) { + return true + } + } + } + + return false +} + +func finduse(g *gc.Graph, r *gc.Flow, v *obj.Addr) bool { + for r1 := (*gc.Flow)(g.Start); r1 != nil; r1 = r1.Link { + r1.Active = 0 + } + return findu1(r, v) +} + +/* + * xtramodes enables the ARM post increment and + * shift offset addressing modes to transform + * MOVW 0(R3),R1 + * ADD $4,R3,R3 + * into + * MOVW.P 4(R3),R1 + * and + * ADD R0,R1 + * MOVBU 0(R1),R0 + * into + * MOVBU R0<<0(R1),R0 + */ +func xtramodes(g *gc.Graph, r *gc.Flow, a *obj.Addr) bool { + p := (*obj.Prog)(r.Prog) + v := obj.Addr(*a) + v.Type = obj.TYPE_REG + r1 := (*gc.Flow)(findpre(r, &v)) + if r1 != nil { + p1 := r1.Prog + if p1.To.Type == obj.TYPE_REG && p1.To.Reg == v.Reg { + switch p1.As { + case arm.AADD: + if p1.Scond&arm.C_SBIT != 0 { + // avoid altering ADD.S/ADC sequences. + break + } + + if p1.From.Type == obj.TYPE_REG || (p1.From.Type == obj.TYPE_SHIFT && p1.From.Offset&(1<<4) == 0 && ((p.As != arm.AMOVB && p.As != arm.AMOVBS) || (a == &p.From && p1.From.Offset&^0xf == 0))) || ((p1.From.Type == obj.TYPE_ADDR || p1.From.Type == obj.TYPE_CONST) && p1.From.Offset > -4096 && p1.From.Offset < 4096) { + if nochange(gc.Uniqs(r1), r, p1) { + if a != &p.From || v.Reg != p.To.Reg { + if finduse(g, r.S1, &v) { + if p1.Reg == 0 || p1.Reg == v.Reg { + /* pre-indexing */ + p.Scond |= arm.C_WBIT + } else { + return false + } + } + } + + switch p1.From.Type { + /* register offset */ + case obj.TYPE_REG: + if gc.Nacl { + return false + } + *a = obj.Addr{} + a.Type = obj.TYPE_SHIFT + a.Offset = int64(p1.From.Reg) & 15 + + /* scaled register offset */ + case obj.TYPE_SHIFT: + if gc.Nacl { + return false + } + *a = obj.Addr{} + a.Type = obj.TYPE_SHIFT + fallthrough + + /* immediate offset */ + case obj.TYPE_CONST, + obj.TYPE_ADDR: + a.Offset = p1.From.Offset + } + + if p1.Reg != 0 { + a.Reg = p1.Reg + } + excise(r1) + return true + } + } + + case arm.AMOVW: + if p1.From.Type == obj.TYPE_REG { + r2 := (*gc.Flow)(findinc(r1, r, &p1.From)) + if r2 != nil { + var r3 *gc.Flow + for r3 = gc.Uniqs(r2); r3.Prog.As == obj.ANOP; r3 = gc.Uniqs(r3) { + } + if r3 == r { + /* post-indexing */ + p1 := r2.Prog + + a.Reg = p1.To.Reg + a.Offset = p1.From.Offset + p.Scond |= arm.C_PBIT + if !finduse(g, r, &r1.Prog.To) { + excise(r1) + } + excise(r2) + return true + } + } + } + } + } + } + + if a != &p.From || a.Reg != p.To.Reg { + r1 := (*gc.Flow)(findinc(r, nil, &v)) + if r1 != nil { + /* post-indexing */ + p1 := r1.Prog + + a.Offset = p1.From.Offset + p.Scond |= arm.C_PBIT + excise(r1) + return true + } + } + + return false +} + +/* + * return + * 1 if v only used (and substitute), + * 2 if read-alter-rewrite + * 3 if set + * 4 if set and used + * 0 otherwise (not touched) + */ +func copyu(p *obj.Prog, v *obj.Addr, s *obj.Addr) int { + switch p.As { + default: + fmt.Printf("copyu: can't find %v\n", obj.Aconv(int(p.As))) + return 2 + + case arm.AMOVM: + if v.Type != obj.TYPE_REG { + return 0 + } + if p.From.Type == obj.TYPE_CONST { /* read reglist, read/rar */ + if s != nil { + if p.From.Offset&(1<type to v->name and enable. + //if(v->type == NAME_AUTO || v->type == NAME_PARAM) { + // if(v->offset == a->offset) + // return 1; + //} + return false +} + +/* + * either direct or indirect + */ +func copyau(a *obj.Addr, v *obj.Addr) bool { + if copyas(a, v) { + return true + } + if v.Type == obj.TYPE_REG { + if a.Type == obj.TYPE_ADDR && a.Reg != 0 { + if a.Reg == v.Reg { + return true + } + } else if a.Type == obj.TYPE_MEM { + if a.Reg == v.Reg { + return true + } + } else if a.Type == obj.TYPE_REGREG || a.Type == obj.TYPE_REGREG2 { + if a.Reg == v.Reg { + return true + } + if a.Offset == int64(v.Reg) { + return true + } + } else if a.Type == obj.TYPE_SHIFT { + if a.Offset&0xf == int64(v.Reg-arm.REG_R0) { + return true + } + if (a.Offset&(1<<4) != 0) && (a.Offset>>8)&0xf == int64(v.Reg-arm.REG_R0) { + return true + } + } + } + + return false +} + +/* + * compare v to the center + * register in p (p->reg) + */ +func copyau1(p *obj.Prog, v *obj.Addr) bool { + if v.Type == obj.TYPE_REG && v.Reg == 0 { + return false + } + return p.Reg == v.Reg +} + +/* + * substitute s for v in a + * return failure to substitute + */ +func copysub(a *obj.Addr, v *obj.Addr, s *obj.Addr, f int) int { + if f != 0 { + if copyau(a, v) { + if a.Type == obj.TYPE_SHIFT { + if a.Offset&0xf == int64(v.Reg-arm.REG_R0) { + a.Offset = a.Offset&^0xf | int64(s.Reg)&0xf + } + if (a.Offset&(1<<4) != 0) && (a.Offset>>8)&0xf == int64(v.Reg-arm.REG_R0) { + a.Offset = a.Offset&^(0xf<<8) | (int64(s.Reg)&0xf)<<8 + } + } else if a.Type == obj.TYPE_REGREG || a.Type == obj.TYPE_REGREG2 { + if a.Offset == int64(v.Reg) { + a.Offset = int64(s.Reg) + } + if a.Reg == v.Reg { + a.Reg = s.Reg + } + } else { + a.Reg = s.Reg + } + } + } + + return 0 +} + +func copysub1(p1 *obj.Prog, v *obj.Addr, s *obj.Addr, f int) int { + if f != 0 { + if copyau1(p1, v) { + p1.Reg = s.Reg + } + } + return 0 +} + +var predinfo = []struct { + opcode int + notopcode int + scond int + notscond int +}{ + {arm.ABEQ, arm.ABNE, 0x0, 0x1}, + {arm.ABNE, arm.ABEQ, 0x1, 0x0}, + {arm.ABCS, arm.ABCC, 0x2, 0x3}, + {arm.ABHS, arm.ABLO, 0x2, 0x3}, + {arm.ABCC, arm.ABCS, 0x3, 0x2}, + {arm.ABLO, arm.ABHS, 0x3, 0x2}, + {arm.ABMI, arm.ABPL, 0x4, 0x5}, + {arm.ABPL, arm.ABMI, 0x5, 0x4}, + {arm.ABVS, arm.ABVC, 0x6, 0x7}, + {arm.ABVC, arm.ABVS, 0x7, 0x6}, + {arm.ABHI, arm.ABLS, 0x8, 0x9}, + {arm.ABLS, arm.ABHI, 0x9, 0x8}, + {arm.ABGE, arm.ABLT, 0xA, 0xB}, + {arm.ABLT, arm.ABGE, 0xB, 0xA}, + {arm.ABGT, arm.ABLE, 0xC, 0xD}, + {arm.ABLE, arm.ABGT, 0xD, 0xC}, +} + +type Joininfo struct { + start *gc.Flow + last *gc.Flow + end *gc.Flow + len int +} + +const ( + Join = iota + Split + End + Branch + Setcond + Toolong +) + +const ( + Falsecond = iota + Truecond + Delbranch + Keepbranch +) + +func isbranch(p *obj.Prog) bool { + return (arm.ABEQ <= p.As) && (p.As <= arm.ABLE) +} + +func predicable(p *obj.Prog) bool { + switch p.As { + case obj.ANOP, + obj.AXXX, + obj.ADATA, + obj.AGLOBL, + obj.ATEXT, + arm.AWORD, + arm.ABCASE, + arm.ACASE: + return false + } + + if isbranch(p) { + return false + } + return true +} + +/* + * Depends on an analysis of the encodings performed by 5l. + * These seem to be all of the opcodes that lead to the "S" bit + * being set in the instruction encodings. + * + * C_SBIT may also have been set explicitly in p->scond. + */ +func modifiescpsr(p *obj.Prog) bool { + switch p.As { + case arm.AMULLU, + arm.AMULA, + arm.AMULU, + arm.ADIVU, + arm.ATEQ, + arm.ACMN, + arm.ATST, + arm.ACMP, + arm.AMUL, + arm.ADIV, + arm.AMOD, + arm.AMODU, + arm.ABL: + return true + } + + if p.Scond&arm.C_SBIT != 0 { + return true + } + return false +} + +/* + * Find the maximal chain of instructions starting with r which could + * be executed conditionally + */ +func joinsplit(r *gc.Flow, j *Joininfo) int { + j.start = r + j.last = r + j.len = 0 + for { + if r.P2 != nil && (r.P1 != nil || r.P2.P2link != nil) { + j.end = r + return Join + } + + if r.S1 != nil && r.S2 != nil { + j.end = r + return Split + } + + j.last = r + if r.Prog.As != obj.ANOP { + j.len++ + } + if r.S1 == nil && r.S2 == nil { + j.end = r.Link + return End + } + + if r.S2 != nil { + j.end = r.S2 + return Branch + } + + if modifiescpsr(r.Prog) { + j.end = r.S1 + return Setcond + } + + r = r.S1 + if j.len >= 4 { + break + } + } + + j.end = r + return Toolong +} + +func successor(r *gc.Flow) *gc.Flow { + if r.S1 != nil { + return r.S1 + } else { + return r.S2 + } +} + +func applypred(rstart *gc.Flow, j *Joininfo, cond int, branch int) { + if j.len == 0 { + return + } + var pred int + if cond == Truecond { + pred = predinfo[rstart.Prog.As-arm.ABEQ].scond + } else { + pred = predinfo[rstart.Prog.As-arm.ABEQ].notscond + } + + for r := (*gc.Flow)(j.start); ; r = successor(r) { + if r.Prog.As == arm.AB { + if r != j.last || branch == Delbranch { + excise(r) + } else { + if cond == Truecond { + r.Prog.As = int16(predinfo[rstart.Prog.As-arm.ABEQ].opcode) + } else { + r.Prog.As = int16(predinfo[rstart.Prog.As-arm.ABEQ].notopcode) + } + } + } else if predicable(r.Prog) { + r.Prog.Scond = uint8(int(r.Prog.Scond&^arm.C_SCOND) | pred) + } + if r.S1 != r.Link { + r.S1 = r.Link + r.Link.P1 = r + } + + if r == j.last { + break + } + } +} + +func predicate(g *gc.Graph) { + var t1 int + var t2 int + var j1 Joininfo + var j2 Joininfo + + for r := (*gc.Flow)(g.Start); r != nil; r = r.Link { + if isbranch(r.Prog) { + t1 = joinsplit(r.S1, &j1) + t2 = joinsplit(r.S2, &j2) + if j1.last.Link != j2.start { + continue + } + if j1.end == j2.end { + if (t1 == Branch && (t2 == Join || t2 == Setcond)) || (t2 == Join && (t1 == Join || t1 == Setcond)) { + applypred(r, &j1, Falsecond, Delbranch) + applypred(r, &j2, Truecond, Delbranch) + excise(r) + continue + } + } + + if t1 == End || t1 == Branch { + applypred(r, &j1, Falsecond, Keepbranch) + excise(r) + continue + } + } + } +} + +func isdconst(a *obj.Addr) bool { + return a.Type == obj.TYPE_CONST +} + +func isfloatreg(a *obj.Addr) bool { + return arm.REG_F0 <= a.Reg && a.Reg <= arm.REG_F15 +} + +func stackaddr(a *obj.Addr) bool { + return regtyp(a) && a.Reg == arm.REGSP +} + +func smallindir(a *obj.Addr, reg *obj.Addr) bool { + return reg.Type == obj.TYPE_REG && a.Type == obj.TYPE_MEM && a.Reg == reg.Reg && 0 <= a.Offset && a.Offset < 4096 +} + +func excise(r *gc.Flow) { + p := (*obj.Prog)(r.Prog) + obj.Nopout(p) +} diff --git a/src/cmd/compile/internal/arm/prog.go b/src/cmd/compile/internal/arm/prog.go new file mode 100644 index 0000000000000000000000000000000000000000..cdf9d29192ac4ccbec26f1ae10fe6bd56269c100 --- /dev/null +++ b/src/cmd/compile/internal/arm/prog.go @@ -0,0 +1,165 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package arm + +import ( + "cmd/compile/internal/gc" + "cmd/internal/obj" + "cmd/internal/obj/arm" +) + +const ( + RightRdwr = gc.RightRead | gc.RightWrite +) + +// This table gives the basic information about instruction +// generated by the compiler and processed in the optimizer. +// See opt.h for bit definitions. +// +// Instructions not generated need not be listed. +// As an exception to that rule, we typically write down all the +// size variants of an operation even if we just use a subset. +// +// The table is formatted for 8-space tabs. +var progtable = [arm.ALAST]obj.ProgInfo{ + obj.ATYPE: {gc.Pseudo | gc.Skip, 0, 0, 0}, + obj.ATEXT: {gc.Pseudo, 0, 0, 0}, + obj.AFUNCDATA: {gc.Pseudo, 0, 0, 0}, + obj.APCDATA: {gc.Pseudo, 0, 0, 0}, + obj.AUNDEF: {gc.Break, 0, 0, 0}, + obj.AUSEFIELD: {gc.OK, 0, 0, 0}, + obj.ACHECKNIL: {gc.LeftRead, 0, 0, 0}, + obj.AVARDEF: {gc.Pseudo | gc.RightWrite, 0, 0, 0}, + obj.AVARKILL: {gc.Pseudo | gc.RightWrite, 0, 0, 0}, + + // NOP is an internal no-op that also stands + // for USED and SET annotations, not the Intel opcode. + obj.ANOP: {gc.LeftRead | gc.RightWrite, 0, 0, 0}, + + // Integer. + arm.AADC: {gc.SizeL | gc.LeftRead | gc.RegRead | gc.RightWrite, 0, 0, 0}, + arm.AADD: {gc.SizeL | gc.LeftRead | gc.RegRead | gc.RightWrite, 0, 0, 0}, + arm.AAND: {gc.SizeL | gc.LeftRead | gc.RegRead | gc.RightWrite, 0, 0, 0}, + arm.ABIC: {gc.SizeL | gc.LeftRead | gc.RegRead | gc.RightWrite, 0, 0, 0}, + arm.ACMN: {gc.SizeL | gc.LeftRead | gc.RightRead, 0, 0, 0}, + arm.ACMP: {gc.SizeL | gc.LeftRead | gc.RightRead, 0, 0, 0}, + arm.ADIVU: {gc.SizeL | gc.LeftRead | gc.RegRead | gc.RightWrite, 0, 0, 0}, + arm.ADIV: {gc.SizeL | gc.LeftRead | gc.RegRead | gc.RightWrite, 0, 0, 0}, + arm.AEOR: {gc.SizeL | gc.LeftRead | gc.RegRead | gc.RightWrite, 0, 0, 0}, + arm.AMODU: {gc.SizeL | gc.LeftRead | gc.RegRead | gc.RightWrite, 0, 0, 0}, + arm.AMOD: {gc.SizeL | gc.LeftRead | gc.RegRead | gc.RightWrite, 0, 0, 0}, + arm.AMULALU: {gc.SizeL | gc.LeftRead | gc.RegRead | RightRdwr, 0, 0, 0}, + arm.AMULAL: {gc.SizeL | gc.LeftRead | gc.RegRead | RightRdwr, 0, 0, 0}, + arm.AMULA: {gc.SizeL | gc.LeftRead | gc.RegRead | RightRdwr, 0, 0, 0}, + arm.AMULU: {gc.SizeL | gc.LeftRead | gc.RegRead | gc.RightWrite, 0, 0, 0}, + arm.AMUL: {gc.SizeL | gc.LeftRead | gc.RegRead | gc.RightWrite, 0, 0, 0}, + arm.AMULL: {gc.SizeL | gc.LeftRead | gc.RegRead | gc.RightWrite, 0, 0, 0}, + arm.AMULLU: {gc.SizeL | gc.LeftRead | gc.RegRead | gc.RightWrite, 0, 0, 0}, + arm.AMVN: {gc.SizeL | gc.LeftRead | gc.RightWrite, 0, 0, 0}, + arm.AORR: {gc.SizeL | gc.LeftRead | gc.RegRead | gc.RightWrite, 0, 0, 0}, + arm.ARSB: {gc.SizeL | gc.LeftRead | gc.RegRead | gc.RightWrite, 0, 0, 0}, + arm.ARSC: {gc.SizeL | gc.LeftRead | gc.RegRead | gc.RightWrite, 0, 0, 0}, + arm.ASBC: {gc.SizeL | gc.LeftRead | gc.RegRead | gc.RightWrite, 0, 0, 0}, + arm.ASLL: {gc.SizeL | gc.LeftRead | gc.RegRead | gc.RightWrite, 0, 0, 0}, + arm.ASRA: {gc.SizeL | gc.LeftRead | gc.RegRead | gc.RightWrite, 0, 0, 0}, + arm.ASRL: {gc.SizeL | gc.LeftRead | gc.RegRead | gc.RightWrite, 0, 0, 0}, + arm.ASUB: {gc.SizeL | gc.LeftRead | gc.RegRead | gc.RightWrite, 0, 0, 0}, + arm.ATEQ: {gc.SizeL | gc.LeftRead | gc.RightRead, 0, 0, 0}, + arm.ATST: {gc.SizeL | gc.LeftRead | gc.RightRead, 0, 0, 0}, + + // Floating point. + arm.AADDD: {gc.SizeD | gc.LeftRead | RightRdwr, 0, 0, 0}, + arm.AADDF: {gc.SizeF | gc.LeftRead | RightRdwr, 0, 0, 0}, + arm.ACMPD: {gc.SizeD | gc.LeftRead | gc.RightRead, 0, 0, 0}, + arm.ACMPF: {gc.SizeF | gc.LeftRead | gc.RightRead, 0, 0, 0}, + arm.ADIVD: {gc.SizeD | gc.LeftRead | RightRdwr, 0, 0, 0}, + arm.ADIVF: {gc.SizeF | gc.LeftRead | RightRdwr, 0, 0, 0}, + arm.AMULD: {gc.SizeD | gc.LeftRead | RightRdwr, 0, 0, 0}, + arm.AMULF: {gc.SizeF | gc.LeftRead | RightRdwr, 0, 0, 0}, + arm.ASUBD: {gc.SizeD | gc.LeftRead | RightRdwr, 0, 0, 0}, + arm.ASUBF: {gc.SizeF | gc.LeftRead | RightRdwr, 0, 0, 0}, + arm.ASQRTD: {gc.SizeD | gc.LeftRead | RightRdwr, 0, 0, 0}, + + // Conversions. + arm.AMOVWD: {gc.SizeD | gc.LeftRead | gc.RightWrite | gc.Conv, 0, 0, 0}, + arm.AMOVWF: {gc.SizeF | gc.LeftRead | gc.RightWrite | gc.Conv, 0, 0, 0}, + arm.AMOVDF: {gc.SizeF | gc.LeftRead | gc.RightWrite | gc.Conv, 0, 0, 0}, + arm.AMOVDW: {gc.SizeL | gc.LeftRead | gc.RightWrite | gc.Conv, 0, 0, 0}, + arm.AMOVFD: {gc.SizeD | gc.LeftRead | gc.RightWrite | gc.Conv, 0, 0, 0}, + arm.AMOVFW: {gc.SizeL | gc.LeftRead | gc.RightWrite | gc.Conv, 0, 0, 0}, + + // Moves. + arm.AMOVB: {gc.SizeB | gc.LeftRead | gc.RightWrite | gc.Move, 0, 0, 0}, + arm.AMOVD: {gc.SizeD | gc.LeftRead | gc.RightWrite | gc.Move, 0, 0, 0}, + arm.AMOVF: {gc.SizeF | gc.LeftRead | gc.RightWrite | gc.Move, 0, 0, 0}, + arm.AMOVH: {gc.SizeW | gc.LeftRead | gc.RightWrite | gc.Move, 0, 0, 0}, + arm.AMOVW: {gc.SizeL | gc.LeftRead | gc.RightWrite | gc.Move, 0, 0, 0}, + + // In addtion, duffzero reads R0,R1 and writes R1. This fact is + // encoded in peep.c + obj.ADUFFZERO: {gc.Call, 0, 0, 0}, + + // In addtion, duffcopy reads R1,R2 and writes R0,R1,R2. This fact is + // encoded in peep.c + obj.ADUFFCOPY: {gc.Call, 0, 0, 0}, + + // These should be split into the two different conversions instead + // of overloading the one. + arm.AMOVBS: {gc.SizeB | gc.LeftRead | gc.RightWrite | gc.Conv, 0, 0, 0}, + arm.AMOVBU: {gc.SizeB | gc.LeftRead | gc.RightWrite | gc.Conv, 0, 0, 0}, + arm.AMOVHS: {gc.SizeW | gc.LeftRead | gc.RightWrite | gc.Conv, 0, 0, 0}, + arm.AMOVHU: {gc.SizeW | gc.LeftRead | gc.RightWrite | gc.Conv, 0, 0, 0}, + + // Jumps. + arm.AB: {gc.Jump | gc.Break, 0, 0, 0}, + arm.ABL: {gc.Call, 0, 0, 0}, + arm.ABEQ: {gc.Cjmp, 0, 0, 0}, + arm.ABNE: {gc.Cjmp, 0, 0, 0}, + arm.ABCS: {gc.Cjmp, 0, 0, 0}, + arm.ABHS: {gc.Cjmp, 0, 0, 0}, + arm.ABCC: {gc.Cjmp, 0, 0, 0}, + arm.ABLO: {gc.Cjmp, 0, 0, 0}, + arm.ABMI: {gc.Cjmp, 0, 0, 0}, + arm.ABPL: {gc.Cjmp, 0, 0, 0}, + arm.ABVS: {gc.Cjmp, 0, 0, 0}, + arm.ABVC: {gc.Cjmp, 0, 0, 0}, + arm.ABHI: {gc.Cjmp, 0, 0, 0}, + arm.ABLS: {gc.Cjmp, 0, 0, 0}, + arm.ABGE: {gc.Cjmp, 0, 0, 0}, + arm.ABLT: {gc.Cjmp, 0, 0, 0}, + arm.ABGT: {gc.Cjmp, 0, 0, 0}, + arm.ABLE: {gc.Cjmp, 0, 0, 0}, + obj.ARET: {gc.Break, 0, 0, 0}, +} + +func proginfo(p *obj.Prog) { + info := &p.Info + *info = progtable[p.As] + if info.Flags == 0 { + gc.Fatal("unknown instruction %v", p) + } + + if p.From.Type == obj.TYPE_ADDR && p.From.Sym != nil && (info.Flags&gc.LeftRead != 0) { + info.Flags &^= gc.LeftRead + info.Flags |= gc.LeftAddr + } + + if (info.Flags&gc.RegRead != 0) && p.Reg == 0 { + info.Flags &^= gc.RegRead + info.Flags |= gc.CanRegRead | gc.RightRead + } + + if (p.Scond&arm.C_SCOND != arm.C_SCOND_NONE) && (info.Flags&gc.RightWrite != 0) { + info.Flags |= gc.RightRead + } + + switch p.As { + case arm.ADIV, + arm.ADIVU, + arm.AMOD, + arm.AMODU: + info.Regset |= RtoB(arm.REG_R12) + } +} diff --git a/src/cmd/compile/internal/arm/reg.go b/src/cmd/compile/internal/arm/reg.go new file mode 100644 index 0000000000000000000000000000000000000000..b72ccc98158479c1f677cb041219ac36685f9af2 --- /dev/null +++ b/src/cmd/compile/internal/arm/reg.go @@ -0,0 +1,136 @@ +// Inferno utils/5c/reg.c +// http://code.google.com/p/inferno-os/source/browse/utils/5c/reg.c +// +// Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved. +// Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net) +// Portions Copyright © 1997-1999 Vita Nuova Limited +// Portions Copyright © 2000-2007 Vita Nuova Holdings Limited (www.vitanuova.com) +// Portions Copyright © 2004,2006 Bruce Ellis +// Portions Copyright © 2005-2007 C H Forsyth (forsyth@terzarima.net) +// Revisions Copyright © 2000-2007 Lucent Technologies Inc. and others +// Portions Copyright © 2009 The Go Authors. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +package arm + +import "cmd/internal/obj/arm" +import "cmd/compile/internal/gc" + +const ( + NREGVAR = 32 +) + +var regname = []string{ + ".R0", + ".R1", + ".R2", + ".R3", + ".R4", + ".R5", + ".R6", + ".R7", + ".R8", + ".R9", + ".R10", + ".R11", + ".R12", + ".R13", + ".R14", + ".R15", + ".F0", + ".F1", + ".F2", + ".F3", + ".F4", + ".F5", + ".F6", + ".F7", + ".F8", + ".F9", + ".F10", + ".F11", + ".F12", + ".F13", + ".F14", + ".F15", +} + +func regnames(n *int) []string { + *n = NREGVAR + return regname +} + +func excludedregs() uint64 { + return RtoB(arm.REGSP) | RtoB(arm.REGLINK) | RtoB(arm.REGPC) +} + +func doregbits(r int) uint64 { + return 0 +} + +/* + * bit reg + * 0 R0 + * 1 R1 + * ... ... + * 10 R10 + * 12 R12 + * + * bit reg + * 18 F2 + * 19 F3 + * ... ... + * 31 F15 + */ +func RtoB(r int) uint64 { + if arm.REG_R0 <= r && r <= arm.REG_R15 { + if r >= arm.REGTMP-2 && r != arm.REG_R12 { // excluded R9 and R10 for m and g, but not R12 + return 0 + } + return 1 << uint(r-arm.REG_R0) + } + + if arm.REG_F0 <= r && r <= arm.REG_F15 { + if r < arm.REG_F2 || r > arm.REG_F0+arm.NFREG-1 { + return 0 + } + return 1 << uint((r-arm.REG_F0)+16) + } + + return 0 +} + +func BtoR(b uint64) int { + // TODO Allow R0 and R1, but be careful with a 0 return + // TODO Allow R9. Only R10 is reserved now (just g, not m). + b &= 0x11fc // excluded R9 and R10 for m and g, but not R12 + if b == 0 { + return 0 + } + return gc.Bitno(b) + arm.REG_R0 +} + +func BtoF(b uint64) int { + b &= 0xfffc0000 + if b == 0 { + return 0 + } + return gc.Bitno(b) - 16 + arm.REG_F0 +} diff --git a/src/cmd/compile/internal/arm64/cgen.go b/src/cmd/compile/internal/arm64/cgen.go new file mode 100644 index 0000000000000000000000000000000000000000..30326d73e27b205d6f16bfd6ce204a3d97ce549c --- /dev/null +++ b/src/cmd/compile/internal/arm64/cgen.go @@ -0,0 +1,157 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package arm64 + +import ( + "cmd/compile/internal/gc" + "cmd/internal/obj" + "cmd/internal/obj/arm64" +) + +func blockcopy(n, res *gc.Node, osrc, odst, w int64) { + // determine alignment. + // want to avoid unaligned access, so have to use + // smaller operations for less aligned types. + // for example moving [4]byte must use 4 MOVB not 1 MOVW. + align := int(n.Type.Align) + + var op int + switch align { + default: + gc.Fatal("sgen: invalid alignment %d for %v", align, n.Type) + + case 1: + op = arm64.AMOVB + + case 2: + op = arm64.AMOVH + + case 4: + op = arm64.AMOVW + + case 8: + op = arm64.AMOVD + } + + if w%int64(align) != 0 { + gc.Fatal("sgen: unaligned size %d (align=%d) for %v", w, align, n.Type) + } + c := int32(w / int64(align)) + + if osrc%int64(align) != 0 || odst%int64(align) != 0 { + gc.Fatal("sgen: unaligned offset src %d or dst %d (align %d)", osrc, odst, align) + } + + // if we are copying forward on the stack and + // the src and dst overlap, then reverse direction + dir := align + + if osrc < odst && int64(odst) < int64(osrc)+w { + dir = -dir + } + + var dst gc.Node + var src gc.Node + if n.Ullman >= res.Ullman { + gc.Agenr(n, &dst, res) // temporarily use dst + gc.Regalloc(&src, gc.Types[gc.Tptr], nil) + gins(arm64.AMOVD, &dst, &src) + if res.Op == gc.ONAME { + gc.Gvardef(res) + } + gc.Agen(res, &dst) + } else { + if res.Op == gc.ONAME { + gc.Gvardef(res) + } + gc.Agenr(res, &dst, res) + gc.Agenr(n, &src, nil) + } + + var tmp gc.Node + gc.Regalloc(&tmp, gc.Types[gc.Tptr], nil) + + // set up end marker + var nend gc.Node + + // move src and dest to the end of block if necessary + if dir < 0 { + if c >= 4 { + gc.Regalloc(&nend, gc.Types[gc.Tptr], nil) + gins(arm64.AMOVD, &src, &nend) + } + + p := gins(arm64.AADD, nil, &src) + p.From.Type = obj.TYPE_CONST + p.From.Offset = w + + p = gins(arm64.AADD, nil, &dst) + p.From.Type = obj.TYPE_CONST + p.From.Offset = w + } else { + p := gins(arm64.AADD, nil, &src) + p.From.Type = obj.TYPE_CONST + p.From.Offset = int64(-dir) + + p = gins(arm64.AADD, nil, &dst) + p.From.Type = obj.TYPE_CONST + p.From.Offset = int64(-dir) + + if c >= 4 { + gc.Regalloc(&nend, gc.Types[gc.Tptr], nil) + p := gins(arm64.AMOVD, &src, &nend) + p.From.Type = obj.TYPE_ADDR + p.From.Offset = w + } + } + + // move + // TODO: enable duffcopy for larger copies. + if c >= 4 { + p := gins(op, &src, &tmp) + p.From.Type = obj.TYPE_MEM + p.From.Offset = int64(dir) + p.Scond = arm64.C_XPRE + ploop := p + + p = gins(op, &tmp, &dst) + p.To.Type = obj.TYPE_MEM + p.To.Offset = int64(dir) + p.Scond = arm64.C_XPRE + + p = gcmp(arm64.ACMP, &src, &nend) + + gc.Patch(gc.Gbranch(arm64.ABNE, nil, 0), ploop) + gc.Regfree(&nend) + } else { + // TODO(austin): Instead of generating ADD $-8,R8; ADD + // $-8,R7; n*(MOVDU 8(R8),R9; MOVDU R9,8(R7);) just + // generate the offsets directly and eliminate the + // ADDs. That will produce shorter, more + // pipeline-able code. + var p *obj.Prog + for { + tmp14 := c + c-- + if tmp14 <= 0 { + break + } + + p = gins(op, &src, &tmp) + p.From.Type = obj.TYPE_MEM + p.From.Offset = int64(dir) + p.Scond = arm64.C_XPRE + + p = gins(op, &tmp, &dst) + p.To.Type = obj.TYPE_MEM + p.To.Offset = int64(dir) + p.Scond = arm64.C_XPRE + } + } + + gc.Regfree(&dst) + gc.Regfree(&src) + gc.Regfree(&tmp) +} diff --git a/src/cmd/compile/internal/arm64/galign.go b/src/cmd/compile/internal/arm64/galign.go new file mode 100644 index 0000000000000000000000000000000000000000..38def8f5a496e9049eb610ab898f7dbdcfe89b4f --- /dev/null +++ b/src/cmd/compile/internal/arm64/galign.go @@ -0,0 +1,93 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package arm64 + +import ( + "cmd/compile/internal/gc" + "cmd/internal/obj" + "cmd/internal/obj/arm64" +) + +var thechar int = '7' + +var thestring string = "arm64" + +var thelinkarch *obj.LinkArch = &arm64.Linkarm64 + +func linkarchinit() { +} + +var MAXWIDTH int64 = 1 << 50 + +/* + * go declares several platform-specific type aliases: + * int, uint, and uintptr + */ +var typedefs = []gc.Typedef{ + gc.Typedef{"int", gc.TINT, gc.TINT64}, + gc.Typedef{"uint", gc.TUINT, gc.TUINT64}, + gc.Typedef{"uintptr", gc.TUINTPTR, gc.TUINT64}, +} + +func betypeinit() { + gc.Widthptr = 8 + gc.Widthint = 8 + gc.Widthreg = 8 +} + +func Main() { + gc.Thearch.Thechar = thechar + gc.Thearch.Thestring = thestring + gc.Thearch.Thelinkarch = thelinkarch + gc.Thearch.Typedefs = typedefs + gc.Thearch.REGSP = arm64.REGSP + gc.Thearch.REGCTXT = arm64.REGCTXT + gc.Thearch.REGCALLX = arm64.REGRT1 + gc.Thearch.REGCALLX2 = arm64.REGRT2 + gc.Thearch.REGRETURN = arm64.REG_R0 + gc.Thearch.REGMIN = arm64.REG_R0 + gc.Thearch.REGMAX = arm64.REG_R31 + gc.Thearch.REGZERO = arm64.REGZERO + gc.Thearch.FREGMIN = arm64.REG_F0 + gc.Thearch.FREGMAX = arm64.REG_F31 + gc.Thearch.MAXWIDTH = MAXWIDTH + gc.Thearch.ReservedRegs = resvd + + gc.Thearch.Betypeinit = betypeinit + gc.Thearch.Cgen_hmul = cgen_hmul + gc.Thearch.Cgen_shift = cgen_shift + gc.Thearch.Clearfat = clearfat + gc.Thearch.Defframe = defframe + gc.Thearch.Dodiv = dodiv + gc.Thearch.Excise = excise + gc.Thearch.Expandchecks = expandchecks + gc.Thearch.Getg = getg + gc.Thearch.Gins = gins + gc.Thearch.Ginscmp = ginscmp + gc.Thearch.Ginscon = ginscon + gc.Thearch.Ginsnop = ginsnop + gc.Thearch.Gmove = gmove + gc.Thearch.Linkarchinit = linkarchinit + gc.Thearch.Peep = peep + gc.Thearch.Proginfo = proginfo + gc.Thearch.Regtyp = regtyp + gc.Thearch.Sameaddr = sameaddr + gc.Thearch.Smallindir = smallindir + gc.Thearch.Stackaddr = stackaddr + gc.Thearch.Blockcopy = blockcopy + gc.Thearch.Sudoaddable = sudoaddable + gc.Thearch.Sudoclean = sudoclean + gc.Thearch.Excludedregs = excludedregs + gc.Thearch.RtoB = RtoB + gc.Thearch.FtoB = RtoB + gc.Thearch.BtoR = BtoR + gc.Thearch.BtoF = BtoF + gc.Thearch.Optoas = optoas + gc.Thearch.Doregbits = doregbits + gc.Thearch.Regnames = regnames + + gc.Main() + gc.Exit(0) +} diff --git a/src/cmd/compile/internal/arm64/ggen.go b/src/cmd/compile/internal/arm64/ggen.go new file mode 100644 index 0000000000000000000000000000000000000000..cba4d991513216120dbeb13baa129daf0fd77fad --- /dev/null +++ b/src/cmd/compile/internal/arm64/ggen.go @@ -0,0 +1,534 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package arm64 + +import ( + "cmd/compile/internal/gc" + "cmd/internal/obj" + "cmd/internal/obj/arm64" + "fmt" +) + +func defframe(ptxt *obj.Prog) { + var n *gc.Node + + // fill in argument size, stack size + ptxt.To.Type = obj.TYPE_TEXTSIZE + + ptxt.To.Val = int32(gc.Rnd(gc.Curfn.Type.Argwid, int64(gc.Widthptr))) + frame := uint32(gc.Rnd(gc.Stksize+gc.Maxarg, int64(gc.Widthreg))) + + // arm64 requires that the frame size (not counting saved LR) + // be empty or be 8 mod 16. If not, pad it. + if frame != 0 && frame%16 != 8 { + frame += 8 + } + + ptxt.To.Offset = int64(frame) + + // insert code to zero ambiguously live variables + // so that the garbage collector only sees initialized values + // when it looks for pointers. + p := ptxt + + hi := int64(0) + lo := hi + + // iterate through declarations - they are sorted in decreasing xoffset order. + for l := gc.Curfn.Func.Dcl; l != nil; l = l.Next { + n = l.N + if !n.Name.Needzero { + continue + } + if n.Class != gc.PAUTO { + gc.Fatal("needzero class %d", n.Class) + } + if n.Type.Width%int64(gc.Widthptr) != 0 || n.Xoffset%int64(gc.Widthptr) != 0 || n.Type.Width == 0 { + gc.Fatal("var %v has size %d offset %d", gc.Nconv(n, obj.FmtLong), int(n.Type.Width), int(n.Xoffset)) + } + + if lo != hi && n.Xoffset+n.Type.Width >= lo-int64(2*gc.Widthreg) { + // merge with range we already have + lo = n.Xoffset + + continue + } + + // zero old range + p = zerorange(p, int64(frame), lo, hi) + + // set new range + hi = n.Xoffset + n.Type.Width + + lo = n.Xoffset + } + + // zero final range + zerorange(p, int64(frame), lo, hi) +} + +var darwin = obj.Getgoos() == "darwin" + +func zerorange(p *obj.Prog, frame int64, lo int64, hi int64) *obj.Prog { + cnt := hi - lo + if cnt == 0 { + return p + } + if cnt < int64(4*gc.Widthptr) { + for i := int64(0); i < cnt; i += int64(gc.Widthptr) { + p = appendpp(p, arm64.AMOVD, obj.TYPE_REG, arm64.REGZERO, 0, obj.TYPE_MEM, arm64.REGSP, 8+frame+lo+i) + } + } else if cnt <= int64(128*gc.Widthptr) && !darwin { // darwin ld64 cannot handle BR26 reloc with non-zero addend + p = appendpp(p, arm64.AMOVD, obj.TYPE_REG, arm64.REGSP, 0, obj.TYPE_REG, arm64.REGRT1, 0) + p = appendpp(p, arm64.AADD, obj.TYPE_CONST, 0, 8+frame+lo-8, obj.TYPE_REG, arm64.REGRT1, 0) + p.Reg = arm64.REGRT1 + p = appendpp(p, obj.ADUFFZERO, obj.TYPE_NONE, 0, 0, obj.TYPE_MEM, 0, 0) + f := gc.Sysfunc("duffzero") + gc.Naddr(&p.To, f) + gc.Afunclit(&p.To, f) + p.To.Offset = 4 * (128 - cnt/int64(gc.Widthptr)) + } else { + p = appendpp(p, arm64.AMOVD, obj.TYPE_CONST, 0, 8+frame+lo-8, obj.TYPE_REG, arm64.REGTMP, 0) + p = appendpp(p, arm64.AMOVD, obj.TYPE_REG, arm64.REGSP, 0, obj.TYPE_REG, arm64.REGRT1, 0) + p = appendpp(p, arm64.AADD, obj.TYPE_REG, arm64.REGTMP, 0, obj.TYPE_REG, arm64.REGRT1, 0) + p.Reg = arm64.REGRT1 + p = appendpp(p, arm64.AMOVD, obj.TYPE_CONST, 0, cnt, obj.TYPE_REG, arm64.REGTMP, 0) + p = appendpp(p, arm64.AADD, obj.TYPE_REG, arm64.REGTMP, 0, obj.TYPE_REG, arm64.REGRT2, 0) + p.Reg = arm64.REGRT1 + p = appendpp(p, arm64.AMOVD, obj.TYPE_REG, arm64.REGZERO, 0, obj.TYPE_MEM, arm64.REGRT1, int64(gc.Widthptr)) + p.Scond = arm64.C_XPRE + p1 := p + p = appendpp(p, arm64.ACMP, obj.TYPE_REG, arm64.REGRT1, 0, obj.TYPE_NONE, 0, 0) + p.Reg = arm64.REGRT2 + p = appendpp(p, arm64.ABNE, obj.TYPE_NONE, 0, 0, obj.TYPE_BRANCH, 0, 0) + gc.Patch(p, p1) + } + + return p +} + +func appendpp(p *obj.Prog, as int, ftype int, freg int, foffset int64, ttype int, treg int, toffset int64) *obj.Prog { + q := gc.Ctxt.NewProg() + gc.Clearp(q) + q.As = int16(as) + q.Lineno = p.Lineno + q.From.Type = int16(ftype) + q.From.Reg = int16(freg) + q.From.Offset = foffset + q.To.Type = int16(ttype) + q.To.Reg = int16(treg) + q.To.Offset = toffset + q.Link = p.Link + p.Link = q + return q +} + +func ginsnop() { + var con gc.Node + gc.Nodconst(&con, gc.Types[gc.TINT], 0) + gins(arm64.AHINT, &con, nil) +} + +var panicdiv *gc.Node + +/* + * generate division. + * generates one of: + * res = nl / nr + * res = nl % nr + * according to op. + */ +func dodiv(op int, nl *gc.Node, nr *gc.Node, res *gc.Node) { + // Have to be careful about handling + // most negative int divided by -1 correctly. + // The hardware will generate undefined result. + // Also need to explicitly trap on division on zero, + // the hardware will silently generate undefined result. + // DIVW will leave unpredicable result in higher 32-bit, + // so always use DIVD/DIVDU. + t := nl.Type + + t0 := t + check := 0 + if gc.Issigned[t.Etype] { + check = 1 + if gc.Isconst(nl, gc.CTINT) && nl.Int() != -(1<= nr.Ullman { + gc.Cgen(nl, &tl) + gc.Cgen(nr, &tr) + } else { + gc.Cgen(nr, &tr) + gc.Cgen(nl, &tl) + } + + if t != t0 { + // Convert + tl2 := tl + + tr2 := tr + tl.Type = t + tr.Type = t + gmove(&tl2, &tl) + gmove(&tr2, &tr) + } + + // Handle divide-by-zero panic. + p1 := gins(optoas(gc.OCMP, t), &tr, nil) + p1.Reg = arm64.REGZERO + p1 = gc.Gbranch(optoas(gc.ONE, t), nil, +1) + if panicdiv == nil { + panicdiv = gc.Sysfunc("panicdivide") + } + gc.Ginscall(panicdiv, -1) + gc.Patch(p1, gc.Pc) + + var p2 *obj.Prog + if check != 0 { + var nm1 gc.Node + gc.Nodconst(&nm1, t, -1) + gcmp(optoas(gc.OCMP, t), &tr, &nm1) + p1 := gc.Gbranch(optoas(gc.ONE, t), nil, +1) + if op == gc.ODIV { + // a / (-1) is -a. + gins(optoas(gc.OMINUS, t), &tl, &tl) + + gmove(&tl, res) + } else { + // a % (-1) is 0. + var nz gc.Node + gc.Nodconst(&nz, t, 0) + + gmove(&nz, res) + } + + p2 = gc.Gbranch(obj.AJMP, nil, 0) + gc.Patch(p1, gc.Pc) + } + + p1 = gins(a, &tr, &tl) + if op == gc.ODIV { + gc.Regfree(&tr) + gmove(&tl, res) + } else { + // A%B = A-(A/B*B) + var tm gc.Node + gc.Regalloc(&tm, t, nil) + + // patch div to use the 3 register form + // TODO(minux): add gins3? + p1.Reg = p1.To.Reg + + p1.To.Reg = tm.Reg + gins(optoas(gc.OMUL, t), &tr, &tm) + gc.Regfree(&tr) + gins(optoas(gc.OSUB, t), &tm, &tl) + gc.Regfree(&tm) + gmove(&tl, res) + } + + gc.Regfree(&tl) + if check != 0 { + gc.Patch(p2, gc.Pc) + } +} + +/* + * generate high multiply: + * res = (nl*nr) >> width + */ +func cgen_hmul(nl *gc.Node, nr *gc.Node, res *gc.Node) { + // largest ullman on left. + if nl.Ullman < nr.Ullman { + tmp := (*gc.Node)(nl) + nl = nr + nr = tmp + } + + t := (*gc.Type)(nl.Type) + w := int(int(t.Width * 8)) + var n1 gc.Node + gc.Cgenr(nl, &n1, res) + var n2 gc.Node + gc.Cgenr(nr, &n2, nil) + switch gc.Simtype[t.Etype] { + case gc.TINT8, + gc.TINT16, + gc.TINT32: + gins(optoas(gc.OMUL, t), &n2, &n1) + p := (*obj.Prog)(gins(arm64.AASR, nil, &n1)) + p.From.Type = obj.TYPE_CONST + p.From.Offset = int64(w) + + case gc.TUINT8, + gc.TUINT16, + gc.TUINT32: + gins(optoas(gc.OMUL, t), &n2, &n1) + p := (*obj.Prog)(gins(arm64.ALSR, nil, &n1)) + p.From.Type = obj.TYPE_CONST + p.From.Offset = int64(w) + + case gc.TINT64, + gc.TUINT64: + if gc.Issigned[t.Etype] { + gins(arm64.ASMULH, &n2, &n1) + } else { + gins(arm64.AUMULH, &n2, &n1) + } + + default: + gc.Fatal("cgen_hmul %v", t) + } + + gc.Cgen(&n1, res) + gc.Regfree(&n1) + gc.Regfree(&n2) +} + +/* + * generate shift according to op, one of: + * res = nl << nr + * res = nl >> nr + */ +func cgen_shift(op int, bounded bool, nl *gc.Node, nr *gc.Node, res *gc.Node) { + a := int(optoas(op, nl.Type)) + + if nr.Op == gc.OLITERAL { + var n1 gc.Node + gc.Regalloc(&n1, nl.Type, res) + gc.Cgen(nl, &n1) + sc := uint64(nr.Int()) + if sc >= uint64(nl.Type.Width*8) { + // large shift gets 2 shifts by width-1 + var n3 gc.Node + gc.Nodconst(&n3, gc.Types[gc.TUINT32], nl.Type.Width*8-1) + + gins(a, &n3, &n1) + gins(a, &n3, &n1) + } else { + gins(a, nr, &n1) + } + gmove(&n1, res) + gc.Regfree(&n1) + return + } + + if nl.Ullman >= gc.UINF { + var n4 gc.Node + gc.Tempname(&n4, nl.Type) + gc.Cgen(nl, &n4) + nl = &n4 + } + + if nr.Ullman >= gc.UINF { + var n5 gc.Node + gc.Tempname(&n5, nr.Type) + gc.Cgen(nr, &n5) + nr = &n5 + } + + // Allow either uint32 or uint64 as shift type, + // to avoid unnecessary conversion from uint32 to uint64 + // just to do the comparison. + tcount := gc.Types[gc.Simtype[nr.Type.Etype]] + + if tcount.Etype < gc.TUINT32 { + tcount = gc.Types[gc.TUINT32] + } + + var n1 gc.Node + gc.Regalloc(&n1, nr.Type, nil) // to hold the shift type in CX + var n3 gc.Node + gc.Regalloc(&n3, tcount, &n1) // to clear high bits of CX + + var n2 gc.Node + gc.Regalloc(&n2, nl.Type, res) + + if nl.Ullman >= nr.Ullman { + gc.Cgen(nl, &n2) + gc.Cgen(nr, &n1) + gmove(&n1, &n3) + } else { + gc.Cgen(nr, &n1) + gmove(&n1, &n3) + gc.Cgen(nl, &n2) + } + + gc.Regfree(&n3) + + // test and fix up large shifts + if !bounded { + gc.Nodconst(&n3, tcount, nl.Type.Width*8) + gcmp(optoas(gc.OCMP, tcount), &n1, &n3) + p1 := (*obj.Prog)(gc.Gbranch(optoas(gc.OLT, tcount), nil, +1)) + if op == gc.ORSH && gc.Issigned[nl.Type.Etype] { + gc.Nodconst(&n3, gc.Types[gc.TUINT32], nl.Type.Width*8-1) + gins(a, &n3, &n2) + } else { + gc.Nodconst(&n3, nl.Type, 0) + gmove(&n3, &n2) + } + + gc.Patch(p1, gc.Pc) + } + + gins(a, &n1, &n2) + + gmove(&n2, res) + + gc.Regfree(&n1) + gc.Regfree(&n2) +} + +func clearfat(nl *gc.Node) { + /* clear a fat object */ + if gc.Debug['g'] != 0 { + fmt.Printf("clearfat %v (%v, size: %d)\n", nl, nl.Type, nl.Type.Width) + } + + w := uint64(uint64(nl.Type.Width)) + + // Avoid taking the address for simple enough types. + if gc.Componentgen(nil, nl) { + return + } + + c := uint64(w % 8) // bytes + q := uint64(w / 8) // dwords + + var r0 gc.Node + gc.Nodreg(&r0, gc.Types[gc.TUINT64], arm64.REGZERO) + var dst gc.Node + + // REGRT1 is reserved on arm64, see arm64/gsubr.go. + gc.Nodreg(&dst, gc.Types[gc.Tptr], arm64.REGRT1) + gc.Agen(nl, &dst) + + var boff uint64 + if q > 128 { + p := gins(arm64.ASUB, nil, &dst) + p.From.Type = obj.TYPE_CONST + p.From.Offset = 8 + + var end gc.Node + gc.Regalloc(&end, gc.Types[gc.Tptr], nil) + p = gins(arm64.AMOVD, &dst, &end) + p.From.Type = obj.TYPE_ADDR + p.From.Offset = int64(q * 8) + + p = gins(arm64.AMOVD, &r0, &dst) + p.To.Type = obj.TYPE_MEM + p.To.Offset = 8 + p.Scond = arm64.C_XPRE + pl := (*obj.Prog)(p) + + p = gcmp(arm64.ACMP, &dst, &end) + gc.Patch(gc.Gbranch(arm64.ABNE, nil, 0), pl) + + gc.Regfree(&end) + + // The loop leaves R16 on the last zeroed dword + boff = 8 + } else if q >= 4 && !darwin { // darwin ld64 cannot handle BR26 reloc with non-zero addend + p := gins(arm64.ASUB, nil, &dst) + p.From.Type = obj.TYPE_CONST + p.From.Offset = 8 + f := (*gc.Node)(gc.Sysfunc("duffzero")) + p = gins(obj.ADUFFZERO, nil, f) + gc.Afunclit(&p.To, f) + + // 4 and 128 = magic constants: see ../../runtime/asm_arm64x.s + p.To.Offset = int64(4 * (128 - q)) + + // duffzero leaves R16 on the last zeroed dword + boff = 8 + } else { + var p *obj.Prog + for t := uint64(0); t < q; t++ { + p = gins(arm64.AMOVD, &r0, &dst) + p.To.Type = obj.TYPE_MEM + p.To.Offset = int64(8 * t) + } + + boff = 8 * q + } + + var p *obj.Prog + for t := uint64(0); t < c; t++ { + p = gins(arm64.AMOVB, &r0, &dst) + p.To.Type = obj.TYPE_MEM + p.To.Offset = int64(t + boff) + } +} + +// Called after regopt and peep have run. +// Expand CHECKNIL pseudo-op into actual nil pointer check. +func expandchecks(firstp *obj.Prog) { + var p1 *obj.Prog + + for p := (*obj.Prog)(firstp); p != nil; p = p.Link { + if gc.Debug_checknil != 0 && gc.Ctxt.Debugvlog != 0 { + fmt.Printf("expandchecks: %v\n", p) + } + if p.As != obj.ACHECKNIL { + continue + } + if gc.Debug_checknil != 0 && p.Lineno > 1 { // p->lineno==1 in generated wrappers + gc.Warnl(int(p.Lineno), "generated nil check") + } + if p.From.Type != obj.TYPE_REG { + gc.Fatal("invalid nil check %v\n", p) + } + + // check is + // CBNZ arg, 2(PC) + // MOVD ZR, 0(arg) + p1 = gc.Ctxt.NewProg() + gc.Clearp(p1) + p1.Link = p.Link + p.Link = p1 + p1.Lineno = p.Lineno + p1.Pc = 9999 + + p.As = arm64.ACBNZ + p.To.Type = obj.TYPE_BRANCH + p.To.Val = p1.Link + + // crash by write to memory address 0. + p1.As = arm64.AMOVD + p1.From.Type = obj.TYPE_REG + p1.From.Reg = arm64.REGZERO + p1.To.Type = obj.TYPE_MEM + p1.To.Reg = p.From.Reg + p1.To.Offset = 0 + } +} + +// res = runtime.getg() +func getg(res *gc.Node) { + var n1 gc.Node + gc.Nodreg(&n1, res.Type, arm64.REGG) + gmove(&n1, res) +} diff --git a/src/cmd/compile/internal/arm64/gsubr.go b/src/cmd/compile/internal/arm64/gsubr.go new file mode 100644 index 0000000000000000000000000000000000000000..0a14654d83758b9e8f210e25bb76a40ee9c73df1 --- /dev/null +++ b/src/cmd/compile/internal/arm64/gsubr.go @@ -0,0 +1,983 @@ +// Derived from Inferno utils/6c/txt.c +// http://code.google.com/p/inferno-os/source/browse/utils/6c/txt.c +// +// Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved. +// Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net) +// Portions Copyright © 1997-1999 Vita Nuova Limited +// Portions Copyright © 2000-2007 Vita Nuova Holdings Limited (www.vitanuova.com) +// Portions Copyright © 2004,2006 Bruce Ellis +// Portions Copyright © 2005-2007 C H Forsyth (forsyth@terzarima.net) +// Revisions Copyright © 2000-2007 Lucent Technologies Inc. and others +// Portions Copyright © 2009 The Go Authors. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +package arm64 + +import ( + "cmd/compile/internal/gc" + "cmd/internal/obj" + "cmd/internal/obj/arm64" + "fmt" +) + +var resvd = []int{ + arm64.REGTMP, + arm64.REGG, + arm64.REGRT1, + arm64.REGRT2, + arm64.REG_R31, // REGZERO and REGSP + arm64.FREGZERO, + arm64.FREGHALF, + arm64.FREGONE, + arm64.FREGTWO, +} + +/* + * generate + * as $c, n + */ +func ginscon(as int, c int64, n2 *gc.Node) { + var n1 gc.Node + + gc.Nodconst(&n1, gc.Types[gc.TINT64], c) + + if as != arm64.AMOVD && (c < -arm64.BIG || c > arm64.BIG) || as == arm64.AMUL || n2 != nil && n2.Op != gc.OREGISTER { + // cannot have more than 16-bit of immediate in ADD, etc. + // instead, MOV into register first. + var ntmp gc.Node + gc.Regalloc(&ntmp, gc.Types[gc.TINT64], nil) + + gins(arm64.AMOVD, &n1, &ntmp) + gins(as, &ntmp, n2) + gc.Regfree(&ntmp) + return + } + + rawgins(as, &n1, n2) +} + +/* + * generate + * as n, $c (CMP) + */ +func ginscon2(as int, n2 *gc.Node, c int64) { + var n1 gc.Node + + gc.Nodconst(&n1, gc.Types[gc.TINT64], c) + + switch as { + default: + gc.Fatal("ginscon2") + + case arm64.ACMP: + if -arm64.BIG <= c && c <= arm64.BIG { + gcmp(as, n2, &n1) + return + } + } + + // MOV n1 into register first + var ntmp gc.Node + gc.Regalloc(&ntmp, gc.Types[gc.TINT64], nil) + + rawgins(arm64.AMOVD, &n1, &ntmp) + gcmp(as, n2, &ntmp) + gc.Regfree(&ntmp) +} + +func ginscmp(op int, t *gc.Type, n1, n2 *gc.Node, likely int) *obj.Prog { + if gc.Isint[t.Etype] && n1.Op == gc.OLITERAL && n2.Op != gc.OLITERAL { + // Reverse comparison to place constant last. + op = gc.Brrev(op) + n1, n2 = n2, n1 + } + + var r1, r2, g1, g2 gc.Node + gc.Regalloc(&r1, t, n1) + gc.Regalloc(&g1, n1.Type, &r1) + gc.Cgen(n1, &g1) + gmove(&g1, &r1) + if gc.Isint[t.Etype] && gc.Isconst(n2, gc.CTINT) { + ginscon2(optoas(gc.OCMP, t), &r1, n2.Int()) + } else { + gc.Regalloc(&r2, t, n2) + gc.Regalloc(&g2, n1.Type, &r2) + gc.Cgen(n2, &g2) + gmove(&g2, &r2) + gcmp(optoas(gc.OCMP, t), &r1, &r2) + gc.Regfree(&g2) + gc.Regfree(&r2) + } + gc.Regfree(&g1) + gc.Regfree(&r1) + return gc.Gbranch(optoas(op, t), nil, likely) +} + +/* + * generate move: + * t = f + * hard part is conversions. + */ +func gmove(f *gc.Node, t *gc.Node) { + if gc.Debug['M'] != 0 { + fmt.Printf("gmove %v -> %v\n", gc.Nconv(f, obj.FmtLong), gc.Nconv(t, obj.FmtLong)) + } + + ft := int(gc.Simsimtype(f.Type)) + tt := int(gc.Simsimtype(t.Type)) + cvt := (*gc.Type)(t.Type) + + if gc.Iscomplex[ft] || gc.Iscomplex[tt] { + gc.Complexmove(f, t) + return + } + + // cannot have two memory operands + var r1 gc.Node + var a int + if gc.Ismem(f) && gc.Ismem(t) { + goto hard + } + + // convert constant to desired type + if f.Op == gc.OLITERAL { + var con gc.Node + switch tt { + default: + f.Convconst(&con, t.Type) + + case gc.TINT32, + gc.TINT16, + gc.TINT8: + var con gc.Node + f.Convconst(&con, gc.Types[gc.TINT64]) + var r1 gc.Node + gc.Regalloc(&r1, con.Type, t) + gins(arm64.AMOVD, &con, &r1) + gmove(&r1, t) + gc.Regfree(&r1) + return + + case gc.TUINT32, + gc.TUINT16, + gc.TUINT8: + var con gc.Node + f.Convconst(&con, gc.Types[gc.TUINT64]) + var r1 gc.Node + gc.Regalloc(&r1, con.Type, t) + gins(arm64.AMOVD, &con, &r1) + gmove(&r1, t) + gc.Regfree(&r1) + return + } + + f = &con + ft = tt // so big switch will choose a simple mov + + // constants can't move directly to memory. + if gc.Ismem(t) { + goto hard + } + } + + // value -> value copy, first operand in memory. + // any floating point operand requires register + // src, so goto hard to copy to register first. + if gc.Ismem(f) && ft != tt && (gc.Isfloat[ft] || gc.Isfloat[tt]) { + cvt = gc.Types[ft] + goto hard + } + + // value -> value copy, only one memory operand. + // figure out the instruction to use. + // break out of switch for one-instruction gins. + // goto rdst for "destination must be register". + // goto hard for "convert to cvt type first". + // otherwise handle and return. + + switch uint32(ft)<<16 | uint32(tt) { + default: + gc.Fatal("gmove %v -> %v", gc.Tconv(f.Type, obj.FmtLong), gc.Tconv(t.Type, obj.FmtLong)) + + /* + * integer copy and truncate + */ + case gc.TINT8<<16 | gc.TINT8, // same size + gc.TUINT8<<16 | gc.TINT8, + gc.TINT16<<16 | gc.TINT8, + // truncate + gc.TUINT16<<16 | gc.TINT8, + gc.TINT32<<16 | gc.TINT8, + gc.TUINT32<<16 | gc.TINT8, + gc.TINT64<<16 | gc.TINT8, + gc.TUINT64<<16 | gc.TINT8: + a = arm64.AMOVB + + case gc.TINT8<<16 | gc.TUINT8, // same size + gc.TUINT8<<16 | gc.TUINT8, + gc.TINT16<<16 | gc.TUINT8, + // truncate + gc.TUINT16<<16 | gc.TUINT8, + gc.TINT32<<16 | gc.TUINT8, + gc.TUINT32<<16 | gc.TUINT8, + gc.TINT64<<16 | gc.TUINT8, + gc.TUINT64<<16 | gc.TUINT8: + a = arm64.AMOVBU + + case gc.TINT16<<16 | gc.TINT16, // same size + gc.TUINT16<<16 | gc.TINT16, + gc.TINT32<<16 | gc.TINT16, + // truncate + gc.TUINT32<<16 | gc.TINT16, + gc.TINT64<<16 | gc.TINT16, + gc.TUINT64<<16 | gc.TINT16: + a = arm64.AMOVH + + case gc.TINT16<<16 | gc.TUINT16, // same size + gc.TUINT16<<16 | gc.TUINT16, + gc.TINT32<<16 | gc.TUINT16, + // truncate + gc.TUINT32<<16 | gc.TUINT16, + gc.TINT64<<16 | gc.TUINT16, + gc.TUINT64<<16 | gc.TUINT16: + a = arm64.AMOVHU + + case gc.TINT32<<16 | gc.TINT32, // same size + gc.TUINT32<<16 | gc.TINT32, + gc.TINT64<<16 | gc.TINT32, + // truncate + gc.TUINT64<<16 | gc.TINT32: + a = arm64.AMOVW + + case gc.TINT32<<16 | gc.TUINT32, // same size + gc.TUINT32<<16 | gc.TUINT32, + gc.TINT64<<16 | gc.TUINT32, + gc.TUINT64<<16 | gc.TUINT32: + a = arm64.AMOVWU + + case gc.TINT64<<16 | gc.TINT64, // same size + gc.TINT64<<16 | gc.TUINT64, + gc.TUINT64<<16 | gc.TINT64, + gc.TUINT64<<16 | gc.TUINT64: + a = arm64.AMOVD + + /* + * integer up-conversions + */ + case gc.TINT8<<16 | gc.TINT16, // sign extend int8 + gc.TINT8<<16 | gc.TUINT16, + gc.TINT8<<16 | gc.TINT32, + gc.TINT8<<16 | gc.TUINT32, + gc.TINT8<<16 | gc.TINT64, + gc.TINT8<<16 | gc.TUINT64: + a = arm64.AMOVB + + goto rdst + + case gc.TUINT8<<16 | gc.TINT16, // zero extend uint8 + gc.TUINT8<<16 | gc.TUINT16, + gc.TUINT8<<16 | gc.TINT32, + gc.TUINT8<<16 | gc.TUINT32, + gc.TUINT8<<16 | gc.TINT64, + gc.TUINT8<<16 | gc.TUINT64: + a = arm64.AMOVBU + + goto rdst + + case gc.TINT16<<16 | gc.TINT32, // sign extend int16 + gc.TINT16<<16 | gc.TUINT32, + gc.TINT16<<16 | gc.TINT64, + gc.TINT16<<16 | gc.TUINT64: + a = arm64.AMOVH + + goto rdst + + case gc.TUINT16<<16 | gc.TINT32, // zero extend uint16 + gc.TUINT16<<16 | gc.TUINT32, + gc.TUINT16<<16 | gc.TINT64, + gc.TUINT16<<16 | gc.TUINT64: + a = arm64.AMOVHU + + goto rdst + + case gc.TINT32<<16 | gc.TINT64, // sign extend int32 + gc.TINT32<<16 | gc.TUINT64: + a = arm64.AMOVW + + goto rdst + + case gc.TUINT32<<16 | gc.TINT64, // zero extend uint32 + gc.TUINT32<<16 | gc.TUINT64: + a = arm64.AMOVWU + + goto rdst + + /* + * float to integer + */ + case gc.TFLOAT32<<16 | gc.TINT32: + a = arm64.AFCVTZSSW + goto rdst + + case gc.TFLOAT64<<16 | gc.TINT32: + a = arm64.AFCVTZSDW + goto rdst + + case gc.TFLOAT32<<16 | gc.TINT64: + a = arm64.AFCVTZSS + goto rdst + + case gc.TFLOAT64<<16 | gc.TINT64: + a = arm64.AFCVTZSD + goto rdst + + case gc.TFLOAT32<<16 | gc.TUINT32: + a = arm64.AFCVTZUSW + goto rdst + + case gc.TFLOAT64<<16 | gc.TUINT32: + a = arm64.AFCVTZUDW + goto rdst + + case gc.TFLOAT32<<16 | gc.TUINT64: + a = arm64.AFCVTZUS + goto rdst + + case gc.TFLOAT64<<16 | gc.TUINT64: + a = arm64.AFCVTZUD + goto rdst + + case gc.TFLOAT32<<16 | gc.TINT16, + gc.TFLOAT32<<16 | gc.TINT8, + gc.TFLOAT64<<16 | gc.TINT16, + gc.TFLOAT64<<16 | gc.TINT8: + cvt = gc.Types[gc.TINT32] + + goto hard + + case gc.TFLOAT32<<16 | gc.TUINT16, + gc.TFLOAT32<<16 | gc.TUINT8, + gc.TFLOAT64<<16 | gc.TUINT16, + gc.TFLOAT64<<16 | gc.TUINT8: + cvt = gc.Types[gc.TUINT32] + + goto hard + + /* + * integer to float + */ + case gc.TINT8<<16 | gc.TFLOAT32, + gc.TINT16<<16 | gc.TFLOAT32, + gc.TINT32<<16 | gc.TFLOAT32: + a = arm64.ASCVTFWS + + goto rdst + + case gc.TINT8<<16 | gc.TFLOAT64, + gc.TINT16<<16 | gc.TFLOAT64, + gc.TINT32<<16 | gc.TFLOAT64: + a = arm64.ASCVTFWD + + goto rdst + + case gc.TINT64<<16 | gc.TFLOAT32: + a = arm64.ASCVTFS + goto rdst + + case gc.TINT64<<16 | gc.TFLOAT64: + a = arm64.ASCVTFD + goto rdst + + case gc.TUINT8<<16 | gc.TFLOAT32, + gc.TUINT16<<16 | gc.TFLOAT32, + gc.TUINT32<<16 | gc.TFLOAT32: + a = arm64.AUCVTFWS + + goto rdst + + case gc.TUINT8<<16 | gc.TFLOAT64, + gc.TUINT16<<16 | gc.TFLOAT64, + gc.TUINT32<<16 | gc.TFLOAT64: + a = arm64.AUCVTFWD + + goto rdst + + case gc.TUINT64<<16 | gc.TFLOAT32: + a = arm64.AUCVTFS + goto rdst + + case gc.TUINT64<<16 | gc.TFLOAT64: + a = arm64.AUCVTFD + goto rdst + + /* + * float to float + */ + case gc.TFLOAT32<<16 | gc.TFLOAT32: + a = arm64.AFMOVS + + case gc.TFLOAT64<<16 | gc.TFLOAT64: + a = arm64.AFMOVD + + case gc.TFLOAT32<<16 | gc.TFLOAT64: + a = arm64.AFCVTSD + goto rdst + + case gc.TFLOAT64<<16 | gc.TFLOAT32: + a = arm64.AFCVTDS + goto rdst + } + + gins(a, f, t) + return + + // requires register destination +rdst: + gc.Regalloc(&r1, t.Type, t) + + gins(a, f, &r1) + gmove(&r1, t) + gc.Regfree(&r1) + return + + // requires register intermediate +hard: + gc.Regalloc(&r1, cvt, t) + + gmove(f, &r1) + gmove(&r1, t) + gc.Regfree(&r1) + return +} + +func intLiteral(n *gc.Node) (x int64, ok bool) { + switch { + case n == nil: + return + case gc.Isconst(n, gc.CTINT): + return n.Int(), true + case gc.Isconst(n, gc.CTBOOL): + return int64(obj.Bool2int(n.Bool())), true + } + return +} + +// gins is called by the front end. +// It synthesizes some multiple-instruction sequences +// so the front end can stay simpler. +func gins(as int, f, t *gc.Node) *obj.Prog { + if as >= obj.A_ARCHSPECIFIC { + if x, ok := intLiteral(f); ok { + ginscon(as, x, t) + return nil // caller must not use + } + } + if as == arm64.ACMP { + if x, ok := intLiteral(t); ok { + ginscon2(as, f, x) + return nil // caller must not use + } + } + return rawgins(as, f, t) +} + +/* + * generate one instruction: + * as f, t + */ +func rawgins(as int, f *gc.Node, t *gc.Node) *obj.Prog { + // TODO(austin): Add self-move test like in 6g (but be careful + // of truncation moves) + + p := gc.Prog(as) + gc.Naddr(&p.From, f) + gc.Naddr(&p.To, t) + + switch as { + case arm64.ACMP, arm64.AFCMPS, arm64.AFCMPD: + if t != nil { + if f.Op != gc.OREGISTER { + gc.Fatal("bad operands to gcmp") + } + p.From = p.To + p.To = obj.Addr{} + raddr(f, p) + } + } + + // Bad things the front end has done to us. Crash to find call stack. + switch as { + case arm64.AAND, arm64.AMUL: + if p.From.Type == obj.TYPE_CONST { + gc.Debug['h'] = 1 + gc.Fatal("bad inst: %v", p) + } + case arm64.ACMP: + if p.From.Type == obj.TYPE_MEM || p.To.Type == obj.TYPE_MEM { + gc.Debug['h'] = 1 + gc.Fatal("bad inst: %v", p) + } + } + + if gc.Debug['g'] != 0 { + fmt.Printf("%v\n", p) + } + + w := int32(0) + switch as { + case arm64.AMOVB, + arm64.AMOVBU: + w = 1 + + case arm64.AMOVH, + arm64.AMOVHU: + w = 2 + + case arm64.AMOVW, + arm64.AMOVWU: + w = 4 + + case arm64.AMOVD: + if p.From.Type == obj.TYPE_CONST || p.From.Type == obj.TYPE_ADDR { + break + } + w = 8 + } + + if w != 0 && ((f != nil && p.From.Width < int64(w)) || (t != nil && p.To.Type != obj.TYPE_REG && p.To.Width > int64(w))) { + gc.Dump("f", f) + gc.Dump("t", t) + gc.Fatal("bad width: %v (%d, %d)\n", p, p.From.Width, p.To.Width) + } + + return p +} + +/* + * insert n into reg slot of p + */ +func raddr(n *gc.Node, p *obj.Prog) { + var a obj.Addr + + gc.Naddr(&a, n) + if a.Type != obj.TYPE_REG { + if n != nil { + gc.Fatal("bad in raddr: %v", gc.Oconv(int(n.Op), 0)) + } else { + gc.Fatal("bad in raddr: ") + } + p.Reg = 0 + } else { + p.Reg = a.Reg + } +} + +func gcmp(as int, lhs *gc.Node, rhs *gc.Node) *obj.Prog { + if lhs.Op != gc.OREGISTER { + gc.Fatal("bad operands to gcmp: %v %v", gc.Oconv(int(lhs.Op), 0), gc.Oconv(int(rhs.Op), 0)) + } + + p := rawgins(as, rhs, nil) + raddr(lhs, p) + return p +} + +/* + * return Axxx for Oxxx on type t. + */ +func optoas(op int, t *gc.Type) int { + if t == nil { + gc.Fatal("optoas: t is nil") + } + + a := int(obj.AXXX) + switch uint32(op)<<16 | uint32(gc.Simtype[t.Etype]) { + default: + gc.Fatal("optoas: no entry for op=%v type=%v", gc.Oconv(int(op), 0), t) + + case gc.OEQ<<16 | gc.TBOOL, + gc.OEQ<<16 | gc.TINT8, + gc.OEQ<<16 | gc.TUINT8, + gc.OEQ<<16 | gc.TINT16, + gc.OEQ<<16 | gc.TUINT16, + gc.OEQ<<16 | gc.TINT32, + gc.OEQ<<16 | gc.TUINT32, + gc.OEQ<<16 | gc.TINT64, + gc.OEQ<<16 | gc.TUINT64, + gc.OEQ<<16 | gc.TPTR32, + gc.OEQ<<16 | gc.TPTR64, + gc.OEQ<<16 | gc.TFLOAT32, + gc.OEQ<<16 | gc.TFLOAT64: + a = arm64.ABEQ + + case gc.ONE<<16 | gc.TBOOL, + gc.ONE<<16 | gc.TINT8, + gc.ONE<<16 | gc.TUINT8, + gc.ONE<<16 | gc.TINT16, + gc.ONE<<16 | gc.TUINT16, + gc.ONE<<16 | gc.TINT32, + gc.ONE<<16 | gc.TUINT32, + gc.ONE<<16 | gc.TINT64, + gc.ONE<<16 | gc.TUINT64, + gc.ONE<<16 | gc.TPTR32, + gc.ONE<<16 | gc.TPTR64, + gc.ONE<<16 | gc.TFLOAT32, + gc.ONE<<16 | gc.TFLOAT64: + a = arm64.ABNE + + case gc.OLT<<16 | gc.TINT8, + gc.OLT<<16 | gc.TINT16, + gc.OLT<<16 | gc.TINT32, + gc.OLT<<16 | gc.TINT64: + a = arm64.ABLT + + case gc.OLT<<16 | gc.TUINT8, + gc.OLT<<16 | gc.TUINT16, + gc.OLT<<16 | gc.TUINT32, + gc.OLT<<16 | gc.TUINT64, + gc.OLT<<16 | gc.TFLOAT32, + gc.OLT<<16 | gc.TFLOAT64: + a = arm64.ABLO + + case gc.OLE<<16 | gc.TINT8, + gc.OLE<<16 | gc.TINT16, + gc.OLE<<16 | gc.TINT32, + gc.OLE<<16 | gc.TINT64: + a = arm64.ABLE + + case gc.OLE<<16 | gc.TUINT8, + gc.OLE<<16 | gc.TUINT16, + gc.OLE<<16 | gc.TUINT32, + gc.OLE<<16 | gc.TUINT64, + gc.OLE<<16 | gc.TFLOAT32, + gc.OLE<<16 | gc.TFLOAT64: + a = arm64.ABLS + + case gc.OGT<<16 | gc.TINT8, + gc.OGT<<16 | gc.TINT16, + gc.OGT<<16 | gc.TINT32, + gc.OGT<<16 | gc.TINT64, + gc.OGT<<16 | gc.TFLOAT32, + gc.OGT<<16 | gc.TFLOAT64: + a = arm64.ABGT + + case gc.OGT<<16 | gc.TUINT8, + gc.OGT<<16 | gc.TUINT16, + gc.OGT<<16 | gc.TUINT32, + gc.OGT<<16 | gc.TUINT64: + a = arm64.ABHI + + case gc.OGE<<16 | gc.TINT8, + gc.OGE<<16 | gc.TINT16, + gc.OGE<<16 | gc.TINT32, + gc.OGE<<16 | gc.TINT64, + gc.OGE<<16 | gc.TFLOAT32, + gc.OGE<<16 | gc.TFLOAT64: + a = arm64.ABGE + + case gc.OGE<<16 | gc.TUINT8, + gc.OGE<<16 | gc.TUINT16, + gc.OGE<<16 | gc.TUINT32, + gc.OGE<<16 | gc.TUINT64: + a = arm64.ABHS + + case gc.OCMP<<16 | gc.TBOOL, + gc.OCMP<<16 | gc.TINT8, + gc.OCMP<<16 | gc.TINT16, + gc.OCMP<<16 | gc.TINT32, + gc.OCMP<<16 | gc.TPTR32, + gc.OCMP<<16 | gc.TINT64, + gc.OCMP<<16 | gc.TUINT8, + gc.OCMP<<16 | gc.TUINT16, + gc.OCMP<<16 | gc.TUINT32, + gc.OCMP<<16 | gc.TUINT64, + gc.OCMP<<16 | gc.TPTR64: + a = arm64.ACMP + + case gc.OCMP<<16 | gc.TFLOAT32: + a = arm64.AFCMPS + + case gc.OCMP<<16 | gc.TFLOAT64: + a = arm64.AFCMPD + + case gc.OAS<<16 | gc.TBOOL, + gc.OAS<<16 | gc.TINT8: + a = arm64.AMOVB + + case gc.OAS<<16 | gc.TUINT8: + a = arm64.AMOVBU + + case gc.OAS<<16 | gc.TINT16: + a = arm64.AMOVH + + case gc.OAS<<16 | gc.TUINT16: + a = arm64.AMOVHU + + case gc.OAS<<16 | gc.TINT32: + a = arm64.AMOVW + + case gc.OAS<<16 | gc.TUINT32, + gc.OAS<<16 | gc.TPTR32: + a = arm64.AMOVWU + + case gc.OAS<<16 | gc.TINT64, + gc.OAS<<16 | gc.TUINT64, + gc.OAS<<16 | gc.TPTR64: + a = arm64.AMOVD + + case gc.OAS<<16 | gc.TFLOAT32: + a = arm64.AFMOVS + + case gc.OAS<<16 | gc.TFLOAT64: + a = arm64.AFMOVD + + case gc.OADD<<16 | gc.TINT8, + gc.OADD<<16 | gc.TUINT8, + gc.OADD<<16 | gc.TINT16, + gc.OADD<<16 | gc.TUINT16, + gc.OADD<<16 | gc.TINT32, + gc.OADD<<16 | gc.TUINT32, + gc.OADD<<16 | gc.TPTR32, + gc.OADD<<16 | gc.TINT64, + gc.OADD<<16 | gc.TUINT64, + gc.OADD<<16 | gc.TPTR64: + a = arm64.AADD + + case gc.OADD<<16 | gc.TFLOAT32: + a = arm64.AFADDS + + case gc.OADD<<16 | gc.TFLOAT64: + a = arm64.AFADDD + + case gc.OSUB<<16 | gc.TINT8, + gc.OSUB<<16 | gc.TUINT8, + gc.OSUB<<16 | gc.TINT16, + gc.OSUB<<16 | gc.TUINT16, + gc.OSUB<<16 | gc.TINT32, + gc.OSUB<<16 | gc.TUINT32, + gc.OSUB<<16 | gc.TPTR32, + gc.OSUB<<16 | gc.TINT64, + gc.OSUB<<16 | gc.TUINT64, + gc.OSUB<<16 | gc.TPTR64: + a = arm64.ASUB + + case gc.OSUB<<16 | gc.TFLOAT32: + a = arm64.AFSUBS + + case gc.OSUB<<16 | gc.TFLOAT64: + a = arm64.AFSUBD + + case gc.OMINUS<<16 | gc.TINT8, + gc.OMINUS<<16 | gc.TUINT8, + gc.OMINUS<<16 | gc.TINT16, + gc.OMINUS<<16 | gc.TUINT16, + gc.OMINUS<<16 | gc.TINT32, + gc.OMINUS<<16 | gc.TUINT32, + gc.OMINUS<<16 | gc.TPTR32, + gc.OMINUS<<16 | gc.TINT64, + gc.OMINUS<<16 | gc.TUINT64, + gc.OMINUS<<16 | gc.TPTR64: + a = arm64.ANEG + + case gc.OMINUS<<16 | gc.TFLOAT32: + a = arm64.AFNEGS + + case gc.OMINUS<<16 | gc.TFLOAT64: + a = arm64.AFNEGD + + case gc.OAND<<16 | gc.TINT8, + gc.OAND<<16 | gc.TUINT8, + gc.OAND<<16 | gc.TINT16, + gc.OAND<<16 | gc.TUINT16, + gc.OAND<<16 | gc.TINT32, + gc.OAND<<16 | gc.TUINT32, + gc.OAND<<16 | gc.TPTR32, + gc.OAND<<16 | gc.TINT64, + gc.OAND<<16 | gc.TUINT64, + gc.OAND<<16 | gc.TPTR64: + a = arm64.AAND + + case gc.OOR<<16 | gc.TINT8, + gc.OOR<<16 | gc.TUINT8, + gc.OOR<<16 | gc.TINT16, + gc.OOR<<16 | gc.TUINT16, + gc.OOR<<16 | gc.TINT32, + gc.OOR<<16 | gc.TUINT32, + gc.OOR<<16 | gc.TPTR32, + gc.OOR<<16 | gc.TINT64, + gc.OOR<<16 | gc.TUINT64, + gc.OOR<<16 | gc.TPTR64: + a = arm64.AORR + + case gc.OXOR<<16 | gc.TINT8, + gc.OXOR<<16 | gc.TUINT8, + gc.OXOR<<16 | gc.TINT16, + gc.OXOR<<16 | gc.TUINT16, + gc.OXOR<<16 | gc.TINT32, + gc.OXOR<<16 | gc.TUINT32, + gc.OXOR<<16 | gc.TPTR32, + gc.OXOR<<16 | gc.TINT64, + gc.OXOR<<16 | gc.TUINT64, + gc.OXOR<<16 | gc.TPTR64: + a = arm64.AEOR + + // TODO(minux): handle rotates + //case CASE(OLROT, TINT8): + //case CASE(OLROT, TUINT8): + //case CASE(OLROT, TINT16): + //case CASE(OLROT, TUINT16): + //case CASE(OLROT, TINT32): + //case CASE(OLROT, TUINT32): + //case CASE(OLROT, TPTR32): + //case CASE(OLROT, TINT64): + //case CASE(OLROT, TUINT64): + //case CASE(OLROT, TPTR64): + // a = 0//???; RLDC? + // break; + + case gc.OLSH<<16 | gc.TINT8, + gc.OLSH<<16 | gc.TUINT8, + gc.OLSH<<16 | gc.TINT16, + gc.OLSH<<16 | gc.TUINT16, + gc.OLSH<<16 | gc.TINT32, + gc.OLSH<<16 | gc.TUINT32, + gc.OLSH<<16 | gc.TPTR32, + gc.OLSH<<16 | gc.TINT64, + gc.OLSH<<16 | gc.TUINT64, + gc.OLSH<<16 | gc.TPTR64: + a = arm64.ALSL + + case gc.ORSH<<16 | gc.TUINT8, + gc.ORSH<<16 | gc.TUINT16, + gc.ORSH<<16 | gc.TUINT32, + gc.ORSH<<16 | gc.TPTR32, + gc.ORSH<<16 | gc.TUINT64, + gc.ORSH<<16 | gc.TPTR64: + a = arm64.ALSR + + case gc.ORSH<<16 | gc.TINT8, + gc.ORSH<<16 | gc.TINT16, + gc.ORSH<<16 | gc.TINT32, + gc.ORSH<<16 | gc.TINT64: + a = arm64.AASR + + // TODO(minux): handle rotates + //case CASE(ORROTC, TINT8): + //case CASE(ORROTC, TUINT8): + //case CASE(ORROTC, TINT16): + //case CASE(ORROTC, TUINT16): + //case CASE(ORROTC, TINT32): + //case CASE(ORROTC, TUINT32): + //case CASE(ORROTC, TINT64): + //case CASE(ORROTC, TUINT64): + // a = 0//??? RLDC?? + // break; + + case gc.OHMUL<<16 | gc.TINT64: + a = arm64.ASMULH + + case gc.OHMUL<<16 | gc.TUINT64, + gc.OHMUL<<16 | gc.TPTR64: + a = arm64.AUMULH + + case gc.OMUL<<16 | gc.TINT8, + gc.OMUL<<16 | gc.TINT16, + gc.OMUL<<16 | gc.TINT32: + a = arm64.ASMULL + + case gc.OMUL<<16 | gc.TINT64: + a = arm64.AMUL + + case gc.OMUL<<16 | gc.TUINT8, + gc.OMUL<<16 | gc.TUINT16, + gc.OMUL<<16 | gc.TUINT32, + gc.OMUL<<16 | gc.TPTR32: + // don't use word multiply, the high 32-bit are undefined. + a = arm64.AUMULL + + case gc.OMUL<<16 | gc.TUINT64, + gc.OMUL<<16 | gc.TPTR64: + a = arm64.AMUL // for 64-bit multiplies, signedness doesn't matter. + + case gc.OMUL<<16 | gc.TFLOAT32: + a = arm64.AFMULS + + case gc.OMUL<<16 | gc.TFLOAT64: + a = arm64.AFMULD + + case gc.ODIV<<16 | gc.TINT8, + gc.ODIV<<16 | gc.TINT16, + gc.ODIV<<16 | gc.TINT32, + gc.ODIV<<16 | gc.TINT64: + a = arm64.ASDIV + + case gc.ODIV<<16 | gc.TUINT8, + gc.ODIV<<16 | gc.TUINT16, + gc.ODIV<<16 | gc.TUINT32, + gc.ODIV<<16 | gc.TPTR32, + gc.ODIV<<16 | gc.TUINT64, + gc.ODIV<<16 | gc.TPTR64: + a = arm64.AUDIV + + case gc.ODIV<<16 | gc.TFLOAT32: + a = arm64.AFDIVS + + case gc.ODIV<<16 | gc.TFLOAT64: + a = arm64.AFDIVD + + case gc.OSQRT<<16 | gc.TFLOAT64: + a = arm64.AFSQRTD + } + + return a +} + +const ( + ODynam = 1 << 0 + OAddable = 1 << 1 +) + +func xgen(n *gc.Node, a *gc.Node, o int) bool { + // TODO(minux) + + return -1 != 0 /*TypeKind(100016)*/ +} + +func sudoclean() { + return +} + +/* + * generate code to compute address of n, + * a reference to a (perhaps nested) field inside + * an array or struct. + * return 0 on failure, 1 on success. + * on success, leaves usable address in a. + * + * caller is responsible for calling sudoclean + * after successful sudoaddable, + * to release the register used for a. + */ +func sudoaddable(as int, n *gc.Node, a *obj.Addr) bool { + // TODO(minux) + + *a = obj.Addr{} + return false +} diff --git a/src/cmd/compile/internal/arm64/peep.go b/src/cmd/compile/internal/arm64/peep.go new file mode 100644 index 0000000000000000000000000000000000000000..387a30ec295c18591687352abe90a37dd57272e9 --- /dev/null +++ b/src/cmd/compile/internal/arm64/peep.go @@ -0,0 +1,809 @@ +// Derived from Inferno utils/6c/peep.c +// http://code.google.com/p/inferno-os/source/browse/utils/6c/peep.c +// +// Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved. +// Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net) +// Portions Copyright © 1997-1999 Vita Nuova Limited +// Portions Copyright © 2000-2007 Vita Nuova Holdings Limited (www.vitanuova.com) +// Portions Copyright © 2004,2006 Bruce Ellis +// Portions Copyright © 2005-2007 C H Forsyth (forsyth@terzarima.net) +// Revisions Copyright © 2000-2007 Lucent Technologies Inc. and others +// Portions Copyright © 2009 The Go Authors. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +package arm64 + +import ( + "cmd/compile/internal/gc" + "cmd/internal/obj" + "cmd/internal/obj/arm64" + "fmt" +) + +var gactive uint32 + +func peep(firstp *obj.Prog) { + g := (*gc.Graph)(gc.Flowstart(firstp, nil)) + if g == nil { + return + } + gactive = 0 + + var p *obj.Prog + var r *gc.Flow + var t int +loop1: + if gc.Debug['P'] != 0 && gc.Debug['v'] != 0 { + gc.Dumpit("loop1", g.Start, 0) + } + + t = 0 + for r = g.Start; r != nil; r = r.Link { + p = r.Prog + + // TODO(minux) Handle smaller moves. arm and amd64 + // distinguish between moves that *must* sign/zero + // extend and moves that don't care so they + // can eliminate moves that don't care without + // breaking moves that do care. This might let us + // simplify or remove the next peep loop, too. + if p.As == arm64.AMOVD || p.As == arm64.AFMOVD { + if regtyp(&p.To) { + // Try to eliminate reg->reg moves + if regtyp(&p.From) { + if p.From.Type == p.To.Type { + if copyprop(r) { + excise(r) + t++ + } else if subprop(r) && copyprop(r) { + excise(r) + t++ + } + } + } + } + } + } + + if t != 0 { + goto loop1 + } + + /* + * look for MOVB x,R; MOVB R,R (for small MOVs not handled above) + */ + var p1 *obj.Prog + var r1 *gc.Flow + for r := (*gc.Flow)(g.Start); r != nil; r = r.Link { + p = r.Prog + switch p.As { + default: + continue + + case arm64.AMOVH, + arm64.AMOVHU, + arm64.AMOVB, + arm64.AMOVBU, + arm64.AMOVW, + arm64.AMOVWU: + if p.To.Type != obj.TYPE_REG { + continue + } + } + + r1 = r.Link + if r1 == nil { + continue + } + p1 = r1.Prog + if p1.As != p.As { + continue + } + if p1.From.Type != obj.TYPE_REG || p1.From.Reg != p.To.Reg { + continue + } + if p1.To.Type != obj.TYPE_REG || p1.To.Reg != p.To.Reg { + continue + } + excise(r1) + } + + if gc.Debug['D'] > 1 { + goto ret /* allow following code improvement to be suppressed */ + } + + // MOVD $c, R'; ADD R', R (R' unused) -> ADD $c, R + for r := (*gc.Flow)(g.Start); r != nil; r = r.Link { + p = r.Prog + switch p.As { + default: + continue + + case arm64.AMOVD: + if p.To.Type != obj.TYPE_REG { + continue + } + if p.From.Type != obj.TYPE_CONST { + continue + } + if p.From.Offset < 0 || 4096 <= p.From.Offset { + continue + } + } + r1 = r.Link + if r1 == nil { + continue + } + p1 = r1.Prog + if p1.As != arm64.AADD && p1.As != arm64.ASUB { // TODO(aram): also logical after we have bimm. + continue + } + if p1.From.Type != obj.TYPE_REG || p1.From.Reg != p.To.Reg { + continue + } + if p1.To.Type != obj.TYPE_REG { + continue + } + if gc.Debug['P'] != 0 { + fmt.Printf("encoding $%d directly into %v in:\n%v\n%v\n", p.From.Offset, obj.Aconv(int(p1.As)), p, p1) + } + p1.From.Type = obj.TYPE_CONST + p1.From = p.From + excise(r) + } + + /* TODO(minux): + * look for OP x,y,R; CMP R, $0 -> OP.S x,y,R + * when OP can set condition codes correctly + */ + +ret: + gc.Flowend(g) +} + +func excise(r *gc.Flow) { + p := (*obj.Prog)(r.Prog) + if gc.Debug['P'] != 0 && gc.Debug['v'] != 0 { + fmt.Printf("%v ===delete===\n", p) + } + obj.Nopout(p) + gc.Ostats.Ndelmov++ +} + +func regtyp(a *obj.Addr) bool { + // TODO(rsc): Floating point register exclusions? + return a.Type == obj.TYPE_REG && arm64.REG_R0 <= a.Reg && a.Reg <= arm64.REG_F31 && a.Reg != arm64.REGZERO +} + +/* + * the idea is to substitute + * one register for another + * from one MOV to another + * MOV a, R1 + * ADD b, R1 / no use of R2 + * MOV R1, R2 + * would be converted to + * MOV a, R2 + * ADD b, R2 + * MOV R2, R1 + * hopefully, then the former or latter MOV + * will be eliminated by copy propagation. + * + * r0 (the argument, not the register) is the MOV at the end of the + * above sequences. This returns 1 if it modified any instructions. + */ +func subprop(r0 *gc.Flow) bool { + p := (*obj.Prog)(r0.Prog) + v1 := (*obj.Addr)(&p.From) + if !regtyp(v1) { + return false + } + v2 := (*obj.Addr)(&p.To) + if !regtyp(v2) { + return false + } + for r := gc.Uniqp(r0); r != nil; r = gc.Uniqp(r) { + if gc.Uniqs(r) == nil { + break + } + p = r.Prog + if p.As == obj.AVARDEF || p.As == obj.AVARKILL { + continue + } + if p.Info.Flags&gc.Call != 0 { + return false + } + + if p.Info.Flags&(gc.RightRead|gc.RightWrite) == gc.RightWrite { + if p.To.Type == v1.Type { + if p.To.Reg == v1.Reg { + copysub(&p.To, v1, v2, 1) + if gc.Debug['P'] != 0 { + fmt.Printf("gotit: %v->%v\n%v", gc.Ctxt.Dconv(v1), gc.Ctxt.Dconv(v2), r.Prog) + if p.From.Type == v2.Type { + fmt.Printf(" excise") + } + fmt.Printf("\n") + } + + for r = gc.Uniqs(r); r != r0; r = gc.Uniqs(r) { + p = r.Prog + copysub(&p.From, v1, v2, 1) + copysub1(p, v1, v2, 1) + copysub(&p.To, v1, v2, 1) + if gc.Debug['P'] != 0 { + fmt.Printf("%v\n", r.Prog) + } + } + + t := int(int(v1.Reg)) + v1.Reg = v2.Reg + v2.Reg = int16(t) + if gc.Debug['P'] != 0 { + fmt.Printf("%v last\n", r.Prog) + } + return true + } + } + } + + if copyau(&p.From, v2) || copyau1(p, v2) || copyau(&p.To, v2) { + break + } + if copysub(&p.From, v1, v2, 0) != 0 || copysub1(p, v1, v2, 0) != 0 || copysub(&p.To, v1, v2, 0) != 0 { + break + } + } + + return false +} + +/* + * The idea is to remove redundant copies. + * v1->v2 F=0 + * (use v2 s/v2/v1/)* + * set v1 F=1 + * use v2 return fail (v1->v2 move must remain) + * ----------------- + * v1->v2 F=0 + * (use v2 s/v2/v1/)* + * set v1 F=1 + * set v2 return success (caller can remove v1->v2 move) + */ +func copyprop(r0 *gc.Flow) bool { + p := (*obj.Prog)(r0.Prog) + v1 := (*obj.Addr)(&p.From) + v2 := (*obj.Addr)(&p.To) + if copyas(v1, v2) { + if gc.Debug['P'] != 0 { + fmt.Printf("eliminating self-move: %v\n", r0.Prog) + } + return true + } + + gactive++ + if gc.Debug['P'] != 0 { + fmt.Printf("trying to eliminate %v->%v move from:\n%v\n", gc.Ctxt.Dconv(v1), gc.Ctxt.Dconv(v2), r0.Prog) + } + return copy1(v1, v2, r0.S1, 0) +} + +// copy1 replaces uses of v2 with v1 starting at r and returns 1 if +// all uses were rewritten. +func copy1(v1 *obj.Addr, v2 *obj.Addr, r *gc.Flow, f int) bool { + if uint32(r.Active) == gactive { + if gc.Debug['P'] != 0 { + fmt.Printf("act set; return 1\n") + } + return true + } + + r.Active = int32(gactive) + if gc.Debug['P'] != 0 { + fmt.Printf("copy1 replace %v with %v f=%d\n", gc.Ctxt.Dconv(v2), gc.Ctxt.Dconv(v1), f) + } + var t int + var p *obj.Prog + for ; r != nil; r = r.S1 { + p = r.Prog + if gc.Debug['P'] != 0 { + fmt.Printf("%v", p) + } + if f == 0 && gc.Uniqp(r) == nil { + // Multiple predecessors; conservatively + // assume v1 was set on other path + f = 1 + + if gc.Debug['P'] != 0 { + fmt.Printf("; merge; f=%d", f) + } + } + + t = copyu(p, v2, nil) + switch t { + case 2: /* rar, can't split */ + if gc.Debug['P'] != 0 { + fmt.Printf("; %v rar; return 0\n", gc.Ctxt.Dconv(v2)) + } + return false + + case 3: /* set */ + if gc.Debug['P'] != 0 { + fmt.Printf("; %v set; return 1\n", gc.Ctxt.Dconv(v2)) + } + return true + + case 1, /* used, substitute */ + 4: /* use and set */ + if f != 0 { + if gc.Debug['P'] == 0 { + return false + } + if t == 4 { + fmt.Printf("; %v used+set and f=%d; return 0\n", gc.Ctxt.Dconv(v2), f) + } else { + fmt.Printf("; %v used and f=%d; return 0\n", gc.Ctxt.Dconv(v2), f) + } + return false + } + + if copyu(p, v2, v1) != 0 { + if gc.Debug['P'] != 0 { + fmt.Printf("; sub fail; return 0\n") + } + return false + } + + if gc.Debug['P'] != 0 { + fmt.Printf("; sub %v->%v\n => %v", gc.Ctxt.Dconv(v2), gc.Ctxt.Dconv(v1), p) + } + if t == 4 { + if gc.Debug['P'] != 0 { + fmt.Printf("; %v used+set; return 1\n", gc.Ctxt.Dconv(v2)) + } + return true + } + } + + if f == 0 { + t = copyu(p, v1, nil) + if f == 0 && (t == 2 || t == 3 || t == 4) { + f = 1 + if gc.Debug['P'] != 0 { + fmt.Printf("; %v set and !f; f=%d", gc.Ctxt.Dconv(v1), f) + } + } + } + + if gc.Debug['P'] != 0 { + fmt.Printf("\n") + } + if r.S2 != nil { + if !copy1(v1, v2, r.S2, f) { + return false + } + } + } + + return true +} + +// If s==nil, copyu returns the set/use of v in p; otherwise, it +// modifies p to replace reads of v with reads of s and returns 0 for +// success or non-zero for failure. +// +// If s==nil, copy returns one of the following values: +// 1 if v only used +// 2 if v is set and used in one address (read-alter-rewrite; +// can't substitute) +// 3 if v is only set +// 4 if v is set in one address and used in another (so addresses +// can be rewritten independently) +// 0 otherwise (not touched) +func copyu(p *obj.Prog, v *obj.Addr, s *obj.Addr) int { + if p.From3Type() != obj.TYPE_NONE { + // 7g never generates a from3 + fmt.Printf("copyu: from3 (%v) not implemented\n", gc.Ctxt.Dconv(p.From3)) + } + if p.RegTo2 != obj.REG_NONE { + // 7g never generates a to2 + fmt.Printf("copyu: RegTo2 (%v) not implemented\n", obj.Rconv(int(p.RegTo2))) + } + + switch p.As { + default: + fmt.Printf("copyu: can't find %v\n", obj.Aconv(int(p.As))) + return 2 + + case obj.ANOP, /* read p->from, write p->to */ + arm64.ANEG, + arm64.AFNEGD, + arm64.AFNEGS, + arm64.AFSQRTD, + arm64.AFCVTZSD, + arm64.AFCVTZSS, + arm64.AFCVTZSDW, + arm64.AFCVTZSSW, + arm64.AFCVTZUD, + arm64.AFCVTZUS, + arm64.AFCVTZUDW, + arm64.AFCVTZUSW, + arm64.AFCVTSD, + arm64.AFCVTDS, + arm64.ASCVTFD, + arm64.ASCVTFS, + arm64.ASCVTFWD, + arm64.ASCVTFWS, + arm64.AUCVTFD, + arm64.AUCVTFS, + arm64.AUCVTFWD, + arm64.AUCVTFWS, + arm64.AMOVB, + arm64.AMOVBU, + arm64.AMOVH, + arm64.AMOVHU, + arm64.AMOVW, + arm64.AMOVWU, + arm64.AMOVD, + arm64.AFMOVS, + arm64.AFMOVD: + if p.Scond == 0 { + if s != nil { + if copysub(&p.From, v, s, 1) != 0 { + return 1 + } + + // Update only indirect uses of v in p->to + if !copyas(&p.To, v) { + if copysub(&p.To, v, s, 1) != 0 { + return 1 + } + } + return 0 + } + + if copyas(&p.To, v) { + // Fix up implicit from + if p.From.Type == obj.TYPE_NONE { + p.From = p.To + } + if copyau(&p.From, v) { + return 4 + } + return 3 + } + + if copyau(&p.From, v) { + return 1 + } + if copyau(&p.To, v) { + // p->to only indirectly uses v + return 1 + } + + return 0 + } + + /* rar p->from, write p->to or read p->from, rar p->to */ + if p.From.Type == obj.TYPE_MEM { + if copyas(&p.From, v) { + // No s!=nil check; need to fail + // anyway in that case + return 2 + } + + if s != nil { + if copysub(&p.To, v, s, 1) != 0 { + return 1 + } + return 0 + } + + if copyas(&p.To, v) { + return 3 + } + } else if p.To.Type == obj.TYPE_MEM { + if copyas(&p.To, v) { + return 2 + } + if s != nil { + if copysub(&p.From, v, s, 1) != 0 { + return 1 + } + return 0 + } + + if copyau(&p.From, v) { + return 1 + } + } else { + fmt.Printf("copyu: bad %v\n", p) + } + + return 0 + + case arm64.AADD, /* read p->from, read p->reg, write p->to */ + arm64.ASUB, + arm64.AAND, + arm64.AORR, + arm64.AEOR, + arm64.AMUL, + arm64.ASMULL, + arm64.AUMULL, + arm64.ASMULH, + arm64.AUMULH, + arm64.ASDIV, + arm64.AUDIV, + arm64.ALSL, + arm64.ALSR, + arm64.AASR, + arm64.AFADDD, + arm64.AFADDS, + arm64.AFSUBD, + arm64.AFSUBS, + arm64.AFMULD, + arm64.AFMULS, + arm64.AFDIVD, + arm64.AFDIVS: + if s != nil { + if copysub(&p.From, v, s, 1) != 0 { + return 1 + } + if copysub1(p, v, s, 1) != 0 { + return 1 + } + + // Update only indirect uses of v in p->to + if !copyas(&p.To, v) { + if copysub(&p.To, v, s, 1) != 0 { + return 1 + } + } + return 0 + } + + if copyas(&p.To, v) { + if p.Reg == 0 { + // Fix up implicit reg (e.g., ADD + // R3,R4 -> ADD R3,R4,R4) so we can + // update reg and to separately. + p.Reg = p.To.Reg + } + + if copyau(&p.From, v) { + return 4 + } + if copyau1(p, v) { + return 4 + } + return 3 + } + + if copyau(&p.From, v) { + return 1 + } + if copyau1(p, v) { + return 1 + } + if copyau(&p.To, v) { + return 1 + } + return 0 + + case arm64.ABEQ, + arm64.ABNE, + arm64.ABGE, + arm64.ABLT, + arm64.ABGT, + arm64.ABLE, + arm64.ABLO, + arm64.ABLS, + arm64.ABHI, + arm64.ABHS: + return 0 + + case obj.ACHECKNIL, /* read p->from */ + arm64.ACMP, /* read p->from, read p->reg */ + arm64.AFCMPD, + arm64.AFCMPS: + if s != nil { + if copysub(&p.From, v, s, 1) != 0 { + return 1 + } + return copysub1(p, v, s, 1) + } + + if copyau(&p.From, v) { + return 1 + } + if copyau1(p, v) { + return 1 + } + return 0 + + case arm64.AB: /* read p->to */ + if s != nil { + if copysub(&p.To, v, s, 1) != 0 { + return 1 + } + return 0 + } + + if copyau(&p.To, v) { + return 1 + } + return 0 + + case obj.ARET: /* funny */ + if s != nil { + return 0 + } + + // All registers die at this point, so claim + // everything is set (and not used). + return 3 + + case arm64.ABL: /* funny */ + if p.From.Type == obj.TYPE_REG && v.Type == obj.TYPE_REG && p.From.Reg == v.Reg { + return 2 + } + + if s != nil { + if copysub(&p.To, v, s, 1) != 0 { + return 1 + } + return 0 + } + + if copyau(&p.To, v) { + return 4 + } + return 3 + + // R31 is zero, used by DUFFZERO, cannot be substituted. + // R16 is ptr to memory, used and set, cannot be substituted. + case obj.ADUFFZERO: + if v.Type == obj.TYPE_REG { + if v.Reg == 31 { + return 1 + } + if v.Reg == 16 { + return 2 + } + } + + return 0 + + // R16, R17 are ptr to src, dst, used and set, cannot be substituted. + // R27 is scratch, set by DUFFCOPY, cannot be substituted. + case obj.ADUFFCOPY: + if v.Type == obj.TYPE_REG { + if v.Reg == 16 || v.Reg == 17 { + return 2 + } + if v.Reg == 27 { + return 3 + } + } + + return 0 + + case arm64.AHINT, + obj.ATEXT, + obj.APCDATA, + obj.AFUNCDATA, + obj.AVARDEF, + obj.AVARKILL: + return 0 + } +} + +// copyas returns 1 if a and v address the same register. +// +// If a is the from operand, this means this operation reads the +// register in v. If a is the to operand, this means this operation +// writes the register in v. +func copyas(a *obj.Addr, v *obj.Addr) bool { + if regtyp(v) { + if a.Type == v.Type { + if a.Reg == v.Reg { + return true + } + } + } + return false +} + +// copyau returns 1 if a either directly or indirectly addresses the +// same register as v. +// +// If a is the from operand, this means this operation reads the +// register in v. If a is the to operand, this means the operation +// either reads or writes the register in v (if !copyas(a, v), then +// the operation reads the register in v). +func copyau(a *obj.Addr, v *obj.Addr) bool { + if copyas(a, v) { + return true + } + if v.Type == obj.TYPE_REG { + if a.Type == obj.TYPE_MEM || (a.Type == obj.TYPE_ADDR && a.Reg != 0) { + if v.Reg == a.Reg { + return true + } + } + } + return false +} + +// copyau1 returns 1 if p->reg references the same register as v and v +// is a direct reference. +func copyau1(p *obj.Prog, v *obj.Addr) bool { + if regtyp(v) && v.Reg != 0 { + if p.Reg == v.Reg { + return true + } + } + return false +} + +// copysub replaces v with s in a if f!=0 or indicates it if could if f==0. +// Returns 1 on failure to substitute (it always succeeds on arm64). +func copysub(a *obj.Addr, v *obj.Addr, s *obj.Addr, f int) int { + if f != 0 { + if copyau(a, v) { + a.Reg = s.Reg + } + } + return 0 +} + +// copysub1 replaces v with s in p1->reg if f!=0 or indicates if it could if f==0. +// Returns 1 on failure to substitute (it always succeeds on arm64). +func copysub1(p1 *obj.Prog, v *obj.Addr, s *obj.Addr, f int) int { + if f != 0 { + if copyau1(p1, v) { + p1.Reg = s.Reg + } + } + return 0 +} + +func sameaddr(a *obj.Addr, v *obj.Addr) bool { + if a.Type != v.Type { + return false + } + if regtyp(v) && a.Reg == v.Reg { + return true + } + if v.Type == obj.NAME_AUTO || v.Type == obj.NAME_PARAM { + if v.Offset == a.Offset { + return true + } + } + return false +} + +func smallindir(a *obj.Addr, reg *obj.Addr) bool { + return reg.Type == obj.TYPE_REG && a.Type == obj.TYPE_MEM && a.Reg == reg.Reg && 0 <= a.Offset && a.Offset < 4096 +} + +func stackaddr(a *obj.Addr) bool { + return a.Type == obj.TYPE_REG && a.Reg == arm64.REGSP +} diff --git a/src/cmd/compile/internal/arm64/prog.go b/src/cmd/compile/internal/arm64/prog.go new file mode 100644 index 0000000000000000000000000000000000000000..1106e788a53141bc98672f9d76df157118a28a6e --- /dev/null +++ b/src/cmd/compile/internal/arm64/prog.go @@ -0,0 +1,174 @@ +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package arm64 + +import ( + "cmd/compile/internal/gc" + "cmd/internal/obj" + "cmd/internal/obj/arm64" +) + +const ( + LeftRdwr uint32 = gc.LeftRead | gc.LeftWrite + RightRdwr uint32 = gc.RightRead | gc.RightWrite +) + +// This table gives the basic information about instruction +// generated by the compiler and processed in the optimizer. +// See opt.h for bit definitions. +// +// Instructions not generated need not be listed. +// As an exception to that rule, we typically write down all the +// size variants of an operation even if we just use a subset. +// +// The table is formatted for 8-space tabs. +var progtable = [arm64.ALAST]obj.ProgInfo{ + obj.ATYPE: {gc.Pseudo | gc.Skip, 0, 0, 0}, + obj.ATEXT: {gc.Pseudo, 0, 0, 0}, + obj.AFUNCDATA: {gc.Pseudo, 0, 0, 0}, + obj.APCDATA: {gc.Pseudo, 0, 0, 0}, + obj.AUNDEF: {gc.Break, 0, 0, 0}, + obj.AUSEFIELD: {gc.OK, 0, 0, 0}, + obj.ACHECKNIL: {gc.LeftRead, 0, 0, 0}, + obj.AVARDEF: {gc.Pseudo | gc.RightWrite, 0, 0, 0}, + obj.AVARKILL: {gc.Pseudo | gc.RightWrite, 0, 0, 0}, + + // NOP is an internal no-op that also stands + // for USED and SET annotations, not the Power opcode. + obj.ANOP: {gc.LeftRead | gc.RightWrite, 0, 0, 0}, + arm64.AHINT: {gc.OK, 0, 0, 0}, + + // Integer + arm64.AADD: {gc.SizeQ | gc.LeftRead | gc.RegRead | gc.RightWrite, 0, 0, 0}, + arm64.ASUB: {gc.SizeQ | gc.LeftRead | gc.RegRead | gc.RightWrite, 0, 0, 0}, + arm64.ANEG: {gc.SizeQ | gc.LeftRead | gc.RegRead | gc.RightWrite, 0, 0, 0}, + arm64.AAND: {gc.SizeQ | gc.LeftRead | gc.RegRead | gc.RightWrite, 0, 0, 0}, + arm64.AORR: {gc.SizeQ | gc.LeftRead | gc.RegRead | gc.RightWrite, 0, 0, 0}, + arm64.AEOR: {gc.SizeQ | gc.LeftRead | gc.RegRead | gc.RightWrite, 0, 0, 0}, + arm64.AMUL: {gc.SizeQ | gc.LeftRead | gc.RegRead | gc.RightWrite, 0, 0, 0}, + arm64.ASMULL: {gc.SizeQ | gc.LeftRead | gc.RegRead | gc.RightWrite, 0, 0, 0}, + arm64.AUMULL: {gc.SizeQ | gc.LeftRead | gc.RegRead | gc.RightWrite, 0, 0, 0}, + arm64.ASMULH: {gc.SizeL | gc.LeftRead | gc.RegRead | gc.RightWrite, 0, 0, 0}, + arm64.AUMULH: {gc.SizeL | gc.LeftRead | gc.RegRead | gc.RightWrite, 0, 0, 0}, + arm64.ASDIV: {gc.SizeQ | gc.LeftRead | gc.RegRead | gc.RightWrite, 0, 0, 0}, + arm64.AUDIV: {gc.SizeQ | gc.LeftRead | gc.RegRead | gc.RightWrite, 0, 0, 0}, + arm64.ALSL: {gc.SizeQ | gc.LeftRead | gc.RegRead | gc.RightWrite, 0, 0, 0}, + arm64.ALSR: {gc.SizeQ | gc.LeftRead | gc.RegRead | gc.RightWrite, 0, 0, 0}, + arm64.AASR: {gc.SizeQ | gc.LeftRead | gc.RegRead | gc.RightWrite, 0, 0, 0}, + arm64.ACMP: {gc.SizeQ | gc.LeftRead | gc.RegRead, 0, 0, 0}, + + // Floating point. + arm64.AFADDD: {gc.SizeD | gc.LeftRead | gc.RegRead | gc.RightWrite, 0, 0, 0}, + arm64.AFADDS: {gc.SizeF | gc.LeftRead | gc.RegRead | gc.RightWrite, 0, 0, 0}, + arm64.AFSUBD: {gc.SizeD | gc.LeftRead | gc.RegRead | gc.RightWrite, 0, 0, 0}, + arm64.AFSUBS: {gc.SizeF | gc.LeftRead | gc.RegRead | gc.RightWrite, 0, 0, 0}, + arm64.AFNEGD: {gc.SizeD | gc.LeftRead | gc.RightWrite, 0, 0, 0}, + arm64.AFNEGS: {gc.SizeF | gc.LeftRead | gc.RightWrite, 0, 0, 0}, + arm64.AFSQRTD: {gc.SizeD | gc.LeftRead | gc.RightWrite, 0, 0, 0}, + arm64.AFMULD: {gc.SizeD | gc.LeftRead | gc.RegRead | gc.RightWrite, 0, 0, 0}, + arm64.AFMULS: {gc.SizeF | gc.LeftRead | gc.RegRead | gc.RightWrite, 0, 0, 0}, + arm64.AFDIVD: {gc.SizeD | gc.LeftRead | gc.RegRead | gc.RightWrite, 0, 0, 0}, + arm64.AFDIVS: {gc.SizeF | gc.LeftRead | gc.RegRead | gc.RightWrite, 0, 0, 0}, + arm64.AFCMPD: {gc.SizeD | gc.LeftRead | gc.RegRead, 0, 0, 0}, + arm64.AFCMPS: {gc.SizeF | gc.LeftRead | gc.RegRead, 0, 0, 0}, + + // float -> integer + arm64.AFCVTZSD: {gc.SizeD | gc.LeftRead | gc.RightWrite | gc.Conv, 0, 0, 0}, + arm64.AFCVTZSS: {gc.SizeF | gc.LeftRead | gc.RightWrite | gc.Conv, 0, 0, 0}, + arm64.AFCVTZSDW: {gc.SizeD | gc.LeftRead | gc.RightWrite | gc.Conv, 0, 0, 0}, + arm64.AFCVTZSSW: {gc.SizeF | gc.LeftRead | gc.RightWrite | gc.Conv, 0, 0, 0}, + arm64.AFCVTZUD: {gc.SizeD | gc.LeftRead | gc.RightWrite | gc.Conv, 0, 0, 0}, + arm64.AFCVTZUS: {gc.SizeF | gc.LeftRead | gc.RightWrite | gc.Conv, 0, 0, 0}, + arm64.AFCVTZUDW: {gc.SizeD | gc.LeftRead | gc.RightWrite | gc.Conv, 0, 0, 0}, + arm64.AFCVTZUSW: {gc.SizeF | gc.LeftRead | gc.RightWrite | gc.Conv, 0, 0, 0}, + + // float -> float + arm64.AFCVTSD: {gc.SizeD | gc.LeftRead | gc.RightWrite | gc.Conv, 0, 0, 0}, + arm64.AFCVTDS: {gc.SizeD | gc.LeftRead | gc.RightWrite | gc.Conv, 0, 0, 0}, + + // integer -> float + arm64.ASCVTFD: {gc.SizeQ | gc.LeftRead | gc.RightWrite | gc.Conv, 0, 0, 0}, + arm64.ASCVTFS: {gc.SizeQ | gc.LeftRead | gc.RightWrite | gc.Conv, 0, 0, 0}, + arm64.ASCVTFWD: {gc.SizeL | gc.LeftRead | gc.RightWrite | gc.Conv, 0, 0, 0}, + arm64.ASCVTFWS: {gc.SizeL | gc.LeftRead | gc.RightWrite | gc.Conv, 0, 0, 0}, + arm64.AUCVTFD: {gc.SizeQ | gc.LeftRead | gc.RightWrite | gc.Conv, 0, 0, 0}, + arm64.AUCVTFS: {gc.SizeQ | gc.LeftRead | gc.RightWrite | gc.Conv, 0, 0, 0}, + arm64.AUCVTFWD: {gc.SizeL | gc.LeftRead | gc.RightWrite | gc.Conv, 0, 0, 0}, + arm64.AUCVTFWS: {gc.SizeL | gc.LeftRead | gc.RightWrite | gc.Conv, 0, 0, 0}, + + // Moves + arm64.AMOVB: {gc.SizeB | gc.LeftRead | gc.RightWrite | gc.Move | gc.Conv, 0, 0, 0}, + arm64.AMOVBU: {gc.SizeB | gc.LeftRead | gc.RightWrite | gc.Move | gc.Conv, 0, 0, 0}, + arm64.AMOVH: {gc.SizeW | gc.LeftRead | gc.RightWrite | gc.Move | gc.Conv, 0, 0, 0}, + arm64.AMOVHU: {gc.SizeW | gc.LeftRead | gc.RightWrite | gc.Move | gc.Conv, 0, 0, 0}, + arm64.AMOVW: {gc.SizeL | gc.LeftRead | gc.RightWrite | gc.Move | gc.Conv, 0, 0, 0}, + arm64.AMOVWU: {gc.SizeL | gc.LeftRead | gc.RightWrite | gc.Move | gc.Conv, 0, 0, 0}, + arm64.AMOVD: {gc.SizeQ | gc.LeftRead | gc.RightWrite | gc.Move, 0, 0, 0}, + arm64.AFMOVS: {gc.SizeF | gc.LeftRead | gc.RightWrite | gc.Move | gc.Conv, 0, 0, 0}, + arm64.AFMOVD: {gc.SizeD | gc.LeftRead | gc.RightWrite | gc.Move, 0, 0, 0}, + + // Jumps + arm64.AB: {gc.Jump | gc.Break, 0, 0, 0}, + arm64.ABL: {gc.Call, 0, 0, 0}, + arm64.ABEQ: {gc.Cjmp, 0, 0, 0}, + arm64.ABNE: {gc.Cjmp, 0, 0, 0}, + arm64.ABGE: {gc.Cjmp, 0, 0, 0}, + arm64.ABLT: {gc.Cjmp, 0, 0, 0}, + arm64.ABGT: {gc.Cjmp, 0, 0, 0}, + arm64.ABLE: {gc.Cjmp, 0, 0, 0}, + arm64.ABLO: {gc.Cjmp, 0, 0, 0}, + arm64.ABLS: {gc.Cjmp, 0, 0, 0}, + arm64.ABHI: {gc.Cjmp, 0, 0, 0}, + arm64.ABHS: {gc.Cjmp, 0, 0, 0}, + arm64.ACBZ: {gc.Cjmp, 0, 0, 0}, + arm64.ACBNZ: {gc.Cjmp, 0, 0, 0}, + obj.ARET: {gc.Break, 0, 0, 0}, + obj.ADUFFZERO: {gc.Call, 0, 0, 0}, + obj.ADUFFCOPY: {gc.Call, 0, 0, 0}, +} + +func proginfo(p *obj.Prog) { + info := &p.Info + *info = progtable[p.As] + if info.Flags == 0 { + gc.Fatal("proginfo: unknown instruction %v", p) + } + + if (info.Flags&gc.RegRead != 0) && p.Reg == 0 { + info.Flags &^= gc.RegRead + info.Flags |= gc.RightRead /*CanRegRead |*/ + } + + if (p.From.Type == obj.TYPE_MEM || p.From.Type == obj.TYPE_ADDR) && p.From.Reg != 0 { + info.Regindex |= RtoB(int(p.From.Reg)) + if p.Scond != 0 { + info.Regset |= RtoB(int(p.From.Reg)) + } + } + + if (p.To.Type == obj.TYPE_MEM || p.To.Type == obj.TYPE_ADDR) && p.To.Reg != 0 { + info.Regindex |= RtoB(int(p.To.Reg)) + if p.Scond != 0 { + info.Regset |= RtoB(int(p.To.Reg)) + } + } + + if p.From.Type == obj.TYPE_ADDR && p.From.Sym != nil && (info.Flags&gc.LeftRead != 0) { + info.Flags &^= gc.LeftRead + info.Flags |= gc.LeftAddr + } + + if p.As == obj.ADUFFZERO { + info.Reguse |= RtoB(arm64.REGRT1) + info.Regset |= RtoB(arm64.REGRT1) + } + + if p.As == obj.ADUFFCOPY { + // TODO(austin) Revisit when duffcopy is implemented + info.Reguse |= RtoB(arm64.REGRT1) | RtoB(arm64.REGRT2) | RtoB(arm64.REG_R5) + + info.Regset |= RtoB(arm64.REGRT1) | RtoB(arm64.REGRT2) + } +} diff --git a/src/cmd/compile/internal/arm64/reg.go b/src/cmd/compile/internal/arm64/reg.go new file mode 100644 index 0000000000000000000000000000000000000000..b84359a63764297bab882636f1bb71798a2ef89f --- /dev/null +++ b/src/cmd/compile/internal/arm64/reg.go @@ -0,0 +1,169 @@ +// Derived from Inferno utils/6c/reg.c +// http://code.google.com/p/inferno-os/source/browse/utils/6c/reg.c +// +// Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved. +// Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net) +// Portions Copyright © 1997-1999 Vita Nuova Limited +// Portions Copyright © 2000-2007 Vita Nuova Holdings Limited (www.vitanuova.com) +// Portions Copyright © 2004,2006 Bruce Ellis +// Portions Copyright © 2005-2007 C H Forsyth (forsyth@terzarima.net) +// Revisions Copyright © 2000-2007 Lucent Technologies Inc. and others +// Portions Copyright © 2009 The Go Authors. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +package arm64 + +import ( + "cmd/compile/internal/gc" + "cmd/internal/obj/arm64" +) + +const ( + NREGVAR = 64 /* 32 general + 32 floating */ +) + +var regname = []string{ + ".R0", + ".R1", + ".R2", + ".R3", + ".R4", + ".R5", + ".R6", + ".R7", + ".R8", + ".R9", + ".R10", + ".R11", + ".R12", + ".R13", + ".R14", + ".R15", + ".R16", + ".R17", + ".R18", + ".R19", + ".R20", + ".R21", + ".R22", + ".R23", + ".R24", + ".R25", + ".R26", + ".R27", + ".R28", + ".R29", + ".R30", + ".R31", + ".F0", + ".F1", + ".F2", + ".F3", + ".F4", + ".F5", + ".F6", + ".F7", + ".F8", + ".F9", + ".F10", + ".F11", + ".F12", + ".F13", + ".F14", + ".F15", + ".F16", + ".F17", + ".F18", + ".F19", + ".F20", + ".F21", + ".F22", + ".F23", + ".F24", + ".F25", + ".F26", + ".F27", + ".F28", + ".F29", + ".F30", + ".F31", +} + +func regnames(n *int) []string { + *n = NREGVAR + return regname +} + +func excludedregs() uint64 { + // Exclude registers with fixed functions + regbits := uint64(RtoB(arm64.REGRT1) | RtoB(arm64.REGRT2) | RtoB(arm64.REGPR)) + + // Exclude R26 - R31. + for r := arm64.REGMAX + 1; r <= arm64.REGZERO; r++ { + regbits |= RtoB(r) + } + + // Also exclude floating point registers with fixed constants + regbits |= RtoB(arm64.REG_F27) | RtoB(arm64.REG_F28) | RtoB(arm64.REG_F29) | RtoB(arm64.REG_F30) | RtoB(arm64.REG_F31) + + return regbits +} + +func doregbits(r int) uint64 { + return 0 +} + +/* + * track register variables including external registers: + * bit reg + * 0 R0 + * 1 R1 + * ... ... + * 31 R31 + * 32+0 F0 + * 32+1 F1 + * ... ... + * 32+31 F31 + */ +func RtoB(r int) uint64 { + if r >= arm64.REG_R0 && r <= arm64.REG_R31 { + return 1 << uint(r-arm64.REG_R0) + } + if r >= arm64.REG_F0 && r <= arm64.REG_F31 { + return 1 << uint(32+r-arm64.REG_F0) + } + return 0 +} + +func BtoR(b uint64) int { + b &= 0xffffffff + if b == 0 { + return 0 + } + return gc.Bitno(b) + arm64.REG_R0 +} + +func BtoF(b uint64) int { + b >>= 32 + if b == 0 { + return 0 + } + return gc.Bitno(b) + arm64.REG_F0 +} diff --git a/src/cmd/compile/internal/big/accuracy_string.go b/src/cmd/compile/internal/big/accuracy_string.go new file mode 100644 index 0000000000000000000000000000000000000000..24ef7f10770026a6199ed4218c27c12783da3054 --- /dev/null +++ b/src/cmd/compile/internal/big/accuracy_string.go @@ -0,0 +1,17 @@ +// generated by stringer -type=Accuracy; DO NOT EDIT + +package big + +import "fmt" + +const _Accuracy_name = "BelowExactAbove" + +var _Accuracy_index = [...]uint8{0, 5, 10, 15} + +func (i Accuracy) String() string { + i -= -1 + if i < 0 || i+1 >= Accuracy(len(_Accuracy_index)) { + return fmt.Sprintf("Accuracy(%d)", i+-1) + } + return _Accuracy_name[_Accuracy_index[i]:_Accuracy_index[i+1]] +} diff --git a/src/cmd/compile/internal/big/arith.go b/src/cmd/compile/internal/big/arith.go new file mode 100644 index 0000000000000000000000000000000000000000..d7ea8381e7ce59c2c865375bbf935ece5f78ad49 --- /dev/null +++ b/src/cmd/compile/internal/big/arith.go @@ -0,0 +1,305 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// This file provides Go implementations of elementary multi-precision +// arithmetic operations on word vectors. Needed for platforms without +// assembly implementations of these routines. + +package big + +// A Word represents a single digit of a multi-precision unsigned integer. +type Word uintptr + +const ( + // Compute the size _S of a Word in bytes. + _m = ^Word(0) + _logS = _m>>8&1 + _m>>16&1 + _m>>32&1 + _S = 1 << _logS + + _W = _S << 3 // word size in bits + _B = 1 << _W // digit base + _M = _B - 1 // digit mask + + _W2 = _W / 2 // half word size in bits + _B2 = 1 << _W2 // half digit base + _M2 = _B2 - 1 // half digit mask +) + +// ---------------------------------------------------------------------------- +// Elementary operations on words +// +// These operations are used by the vector operations below. + +// z1<<_W + z0 = x+y+c, with c == 0 or 1 +func addWW_g(x, y, c Word) (z1, z0 Word) { + yc := y + c + z0 = x + yc + if z0 < x || yc < y { + z1 = 1 + } + return +} + +// z1<<_W + z0 = x-y-c, with c == 0 or 1 +func subWW_g(x, y, c Word) (z1, z0 Word) { + yc := y + c + z0 = x - yc + if z0 > x || yc < y { + z1 = 1 + } + return +} + +// z1<<_W + z0 = x*y +// Adapted from Warren, Hacker's Delight, p. 132. +func mulWW_g(x, y Word) (z1, z0 Word) { + x0 := x & _M2 + x1 := x >> _W2 + y0 := y & _M2 + y1 := y >> _W2 + w0 := x0 * y0 + t := x1*y0 + w0>>_W2 + w1 := t & _M2 + w2 := t >> _W2 + w1 += x0 * y1 + z1 = x1*y1 + w2 + w1>>_W2 + z0 = x * y + return +} + +// z1<<_W + z0 = x*y + c +func mulAddWWW_g(x, y, c Word) (z1, z0 Word) { + z1, zz0 := mulWW_g(x, y) + if z0 = zz0 + c; z0 < zz0 { + z1++ + } + return +} + +// Length of x in bits. +func bitLen_g(x Word) (n int) { + for ; x >= 0x8000; x >>= 16 { + n += 16 + } + if x >= 0x80 { + x >>= 8 + n += 8 + } + if x >= 0x8 { + x >>= 4 + n += 4 + } + if x >= 0x2 { + x >>= 2 + n += 2 + } + if x >= 0x1 { + n++ + } + return +} + +// log2 computes the integer binary logarithm of x. +// The result is the integer n for which 2^n <= x < 2^(n+1). +// If x == 0, the result is -1. +func log2(x Word) int { + return bitLen(x) - 1 +} + +// nlz returns the number of leading zeros in x. +func nlz(x Word) uint { + return uint(_W - bitLen(x)) +} + +// nlz64 returns the number of leading zeros in x. +func nlz64(x uint64) uint { + switch _W { + case 32: + w := x >> 32 + if w == 0 { + return 32 + nlz(Word(x)) + } + return nlz(Word(w)) + case 64: + return nlz(Word(x)) + } + panic("unreachable") +} + +// q = (u1<<_W + u0 - r)/y +// Adapted from Warren, Hacker's Delight, p. 152. +func divWW_g(u1, u0, v Word) (q, r Word) { + if u1 >= v { + return 1<<_W - 1, 1<<_W - 1 + } + + s := nlz(v) + v <<= s + + vn1 := v >> _W2 + vn0 := v & _M2 + un32 := u1<>(_W-s) + un10 := u0 << s + un1 := un10 >> _W2 + un0 := un10 & _M2 + q1 := un32 / vn1 + rhat := un32 - q1*vn1 + + for q1 >= _B2 || q1*vn0 > _B2*rhat+un1 { + q1-- + rhat += vn1 + if rhat >= _B2 { + break + } + } + + un21 := un32*_B2 + un1 - q1*v + q0 := un21 / vn1 + rhat = un21 - q0*vn1 + + for q0 >= _B2 || q0*vn0 > _B2*rhat+un0 { + q0-- + rhat += vn1 + if rhat >= _B2 { + break + } + } + + return q1*_B2 + q0, (un21*_B2 + un0 - q0*v) >> s +} + +// Keep for performance debugging. +// Using addWW_g is likely slower. +const use_addWW_g = false + +// The resulting carry c is either 0 or 1. +func addVV_g(z, x, y []Word) (c Word) { + if use_addWW_g { + for i := range z { + c, z[i] = addWW_g(x[i], y[i], c) + } + return + } + + for i, xi := range x[:len(z)] { + yi := y[i] + zi := xi + yi + c + z[i] = zi + // see "Hacker's Delight", section 2-12 (overflow detection) + c = (xi&yi | (xi|yi)&^zi) >> (_W - 1) + } + return +} + +// The resulting carry c is either 0 or 1. +func subVV_g(z, x, y []Word) (c Word) { + if use_addWW_g { + for i := range z { + c, z[i] = subWW_g(x[i], y[i], c) + } + return + } + + for i, xi := range x[:len(z)] { + yi := y[i] + zi := xi - yi - c + z[i] = zi + // see "Hacker's Delight", section 2-12 (overflow detection) + c = (yi&^xi | (yi|^xi)&zi) >> (_W - 1) + } + return +} + +// The resulting carry c is either 0 or 1. +func addVW_g(z, x []Word, y Word) (c Word) { + if use_addWW_g { + c = y + for i := range z { + c, z[i] = addWW_g(x[i], c, 0) + } + return + } + + c = y + for i, xi := range x[:len(z)] { + zi := xi + c + z[i] = zi + c = xi &^ zi >> (_W - 1) + } + return +} + +func subVW_g(z, x []Word, y Word) (c Word) { + if use_addWW_g { + c = y + for i := range z { + c, z[i] = subWW_g(x[i], c, 0) + } + return + } + + c = y + for i, xi := range x[:len(z)] { + zi := xi - c + z[i] = zi + c = (zi &^ xi) >> (_W - 1) + } + return +} + +func shlVU_g(z, x []Word, s uint) (c Word) { + if n := len(z); n > 0 { + ŝ := _W - s + w1 := x[n-1] + c = w1 >> ŝ + for i := n - 1; i > 0; i-- { + w := w1 + w1 = x[i-1] + z[i] = w<>ŝ + } + z[0] = w1 << s + } + return +} + +func shrVU_g(z, x []Word, s uint) (c Word) { + if n := len(z); n > 0 { + ŝ := _W - s + w1 := x[0] + c = w1 << ŝ + for i := 0; i < n-1; i++ { + w := w1 + w1 = x[i+1] + z[i] = w>>s | w1<<ŝ + } + z[n-1] = w1 >> s + } + return +} + +func mulAddVWW_g(z, x []Word, y, r Word) (c Word) { + c = r + for i := range z { + c, z[i] = mulAddWWW_g(x[i], y, c) + } + return +} + +// TODO(gri) Remove use of addWW_g here and then we can remove addWW_g and subWW_g. +func addMulVVW_g(z, x []Word, y Word) (c Word) { + for i := range z { + z1, z0 := mulAddWWW_g(x[i], y, z[i]) + c, z[i] = addWW_g(z0, c, 0) + c += z1 + } + return +} + +func divWVW_g(z []Word, xn Word, x []Word, y Word) (r Word) { + r = xn + for i := len(z) - 1; i >= 0; i-- { + z[i], r = divWW_g(r, x[i], y) + } + return +} diff --git a/src/cmd/compile/internal/big/arith_decl.go b/src/cmd/compile/internal/big/arith_decl.go new file mode 100644 index 0000000000000000000000000000000000000000..fe135772032556bc18a19733138415613d5f3d50 --- /dev/null +++ b/src/cmd/compile/internal/big/arith_decl.go @@ -0,0 +1,53 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package big + +func mulWW(x, y Word) (z1, z0 Word) { + return mulWW_g(x, y) +} + +func divWW(x1, x0, y Word) (q, r Word) { + return divWW_g(x1, x0, y) +} + +func addVV(z, x, y []Word) (c Word) { + return addVV_g(z, x, y) +} + +func subVV(z, x, y []Word) (c Word) { + return subVV_g(z, x, y) +} + +func addVW(z, x []Word, y Word) (c Word) { + return addVW_g(z, x, y) +} + +func subVW(z, x []Word, y Word) (c Word) { + return subVW_g(z, x, y) +} + +func shlVU(z, x []Word, s uint) (c Word) { + return shlVU_g(z, x, s) +} + +func shrVU(z, x []Word, s uint) (c Word) { + return shrVU_g(z, x, s) +} + +func mulAddVWW(z, x []Word, y, r Word) (c Word) { + return mulAddVWW_g(z, x, y, r) +} + +func addMulVVW(z, x []Word, y Word) (c Word) { + return addMulVVW_g(z, x, y) +} + +func divWVW(z []Word, xn Word, x []Word, y Word) (r Word) { + return divWVW_g(z, xn, x, y) +} + +func bitLen(x Word) (n int) { + return bitLen_g(x) +} diff --git a/src/cmd/compile/internal/big/arith_test.go b/src/cmd/compile/internal/big/arith_test.go new file mode 100644 index 0000000000000000000000000000000000000000..f46a494f175b0dcf2eedaf56df65850701b561e4 --- /dev/null +++ b/src/cmd/compile/internal/big/arith_test.go @@ -0,0 +1,457 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package big + +import ( + "math/rand" + "testing" +) + +type funWW func(x, y, c Word) (z1, z0 Word) +type argWW struct { + x, y, c, z1, z0 Word +} + +var sumWW = []argWW{ + {0, 0, 0, 0, 0}, + {0, 1, 0, 0, 1}, + {0, 0, 1, 0, 1}, + {0, 1, 1, 0, 2}, + {12345, 67890, 0, 0, 80235}, + {12345, 67890, 1, 0, 80236}, + {_M, 1, 0, 1, 0}, + {_M, 0, 1, 1, 0}, + {_M, 1, 1, 1, 1}, + {_M, _M, 0, 1, _M - 1}, + {_M, _M, 1, 1, _M}, +} + +func testFunWW(t *testing.T, msg string, f funWW, a argWW) { + z1, z0 := f(a.x, a.y, a.c) + if z1 != a.z1 || z0 != a.z0 { + t.Errorf("%s%+v\n\tgot z1:z0 = %#x:%#x; want %#x:%#x", msg, a, z1, z0, a.z1, a.z0) + } +} + +func TestFunWW(t *testing.T) { + for _, a := range sumWW { + arg := a + testFunWW(t, "addWW_g", addWW_g, arg) + + arg = argWW{a.y, a.x, a.c, a.z1, a.z0} + testFunWW(t, "addWW_g symmetric", addWW_g, arg) + + arg = argWW{a.z0, a.x, a.c, a.z1, a.y} + testFunWW(t, "subWW_g", subWW_g, arg) + + arg = argWW{a.z0, a.y, a.c, a.z1, a.x} + testFunWW(t, "subWW_g symmetric", subWW_g, arg) + } +} + +type funVV func(z, x, y []Word) (c Word) +type argVV struct { + z, x, y nat + c Word +} + +var sumVV = []argVV{ + {}, + {nat{0}, nat{0}, nat{0}, 0}, + {nat{1}, nat{1}, nat{0}, 0}, + {nat{0}, nat{_M}, nat{1}, 1}, + {nat{80235}, nat{12345}, nat{67890}, 0}, + {nat{_M - 1}, nat{_M}, nat{_M}, 1}, + {nat{0, 0, 0, 0}, nat{_M, _M, _M, _M}, nat{1, 0, 0, 0}, 1}, + {nat{0, 0, 0, _M}, nat{_M, _M, _M, _M - 1}, nat{1, 0, 0, 0}, 0}, + {nat{0, 0, 0, 0}, nat{_M, 0, _M, 0}, nat{1, _M, 0, _M}, 1}, +} + +func testFunVV(t *testing.T, msg string, f funVV, a argVV) { + z := make(nat, len(a.z)) + c := f(z, a.x, a.y) + for i, zi := range z { + if zi != a.z[i] { + t.Errorf("%s%+v\n\tgot z[%d] = %#x; want %#x", msg, a, i, zi, a.z[i]) + break + } + } + if c != a.c { + t.Errorf("%s%+v\n\tgot c = %#x; want %#x", msg, a, c, a.c) + } +} + +func TestFunVV(t *testing.T) { + for _, a := range sumVV { + arg := a + testFunVV(t, "addVV_g", addVV_g, arg) + testFunVV(t, "addVV", addVV, arg) + + arg = argVV{a.z, a.y, a.x, a.c} + testFunVV(t, "addVV_g symmetric", addVV_g, arg) + testFunVV(t, "addVV symmetric", addVV, arg) + + arg = argVV{a.x, a.z, a.y, a.c} + testFunVV(t, "subVV_g", subVV_g, arg) + testFunVV(t, "subVV", subVV, arg) + + arg = argVV{a.y, a.z, a.x, a.c} + testFunVV(t, "subVV_g symmetric", subVV_g, arg) + testFunVV(t, "subVV symmetric", subVV, arg) + } +} + +// Always the same seed for reproducible results. +var rnd = rand.New(rand.NewSource(0)) + +func rndW() Word { + return Word(rnd.Int63()<<1 | rnd.Int63n(2)) +} + +func rndV(n int) []Word { + v := make([]Word, n) + for i := range v { + v[i] = rndW() + } + return v +} + +func benchmarkFunVV(b *testing.B, f funVV, n int) { + x := rndV(n) + y := rndV(n) + z := make([]Word, n) + b.SetBytes(int64(n * _W)) + b.ResetTimer() + for i := 0; i < b.N; i++ { + f(z, x, y) + } +} + +func BenchmarkAddVV_1(b *testing.B) { benchmarkFunVV(b, addVV, 1) } +func BenchmarkAddVV_2(b *testing.B) { benchmarkFunVV(b, addVV, 2) } +func BenchmarkAddVV_3(b *testing.B) { benchmarkFunVV(b, addVV, 3) } +func BenchmarkAddVV_4(b *testing.B) { benchmarkFunVV(b, addVV, 4) } +func BenchmarkAddVV_5(b *testing.B) { benchmarkFunVV(b, addVV, 5) } +func BenchmarkAddVV_1e1(b *testing.B) { benchmarkFunVV(b, addVV, 1e1) } +func BenchmarkAddVV_1e2(b *testing.B) { benchmarkFunVV(b, addVV, 1e2) } +func BenchmarkAddVV_1e3(b *testing.B) { benchmarkFunVV(b, addVV, 1e3) } +func BenchmarkAddVV_1e4(b *testing.B) { benchmarkFunVV(b, addVV, 1e4) } +func BenchmarkAddVV_1e5(b *testing.B) { benchmarkFunVV(b, addVV, 1e5) } + +type funVW func(z, x []Word, y Word) (c Word) +type argVW struct { + z, x nat + y Word + c Word +} + +var sumVW = []argVW{ + {}, + {nil, nil, 2, 2}, + {nat{0}, nat{0}, 0, 0}, + {nat{1}, nat{0}, 1, 0}, + {nat{1}, nat{1}, 0, 0}, + {nat{0}, nat{_M}, 1, 1}, + {nat{0, 0, 0, 0}, nat{_M, _M, _M, _M}, 1, 1}, + {nat{585}, nat{314}, 271, 0}, +} + +var prodVW = []argVW{ + {}, + {nat{0}, nat{0}, 0, 0}, + {nat{0}, nat{_M}, 0, 0}, + {nat{0}, nat{0}, _M, 0}, + {nat{1}, nat{1}, 1, 0}, + {nat{22793}, nat{991}, 23, 0}, + {nat{0, 0, 0, 22793}, nat{0, 0, 0, 991}, 23, 0}, + {nat{0, 0, 0, 0}, nat{7893475, 7395495, 798547395, 68943}, 0, 0}, + {nat{0, 0, 0, 0}, nat{0, 0, 0, 0}, 894375984, 0}, + {nat{_M << 1 & _M}, nat{_M}, 1 << 1, _M >> (_W - 1)}, + {nat{_M << 7 & _M}, nat{_M}, 1 << 7, _M >> (_W - 7)}, + {nat{_M << 7 & _M, _M, _M, _M}, nat{_M, _M, _M, _M}, 1 << 7, _M >> (_W - 7)}, +} + +var lshVW = []argVW{ + {}, + {nat{0}, nat{0}, 0, 0}, + {nat{0}, nat{0}, 1, 0}, + {nat{0}, nat{0}, 20, 0}, + + {nat{_M}, nat{_M}, 0, 0}, + {nat{_M << 1 & _M}, nat{_M}, 1, 1}, + {nat{_M << 20 & _M}, nat{_M}, 20, _M >> (_W - 20)}, + + {nat{_M, _M, _M}, nat{_M, _M, _M}, 0, 0}, + {nat{_M << 1 & _M, _M, _M}, nat{_M, _M, _M}, 1, 1}, + {nat{_M << 20 & _M, _M, _M}, nat{_M, _M, _M}, 20, _M >> (_W - 20)}, +} + +var rshVW = []argVW{ + {}, + {nat{0}, nat{0}, 0, 0}, + {nat{0}, nat{0}, 1, 0}, + {nat{0}, nat{0}, 20, 0}, + + {nat{_M}, nat{_M}, 0, 0}, + {nat{_M >> 1}, nat{_M}, 1, _M << (_W - 1) & _M}, + {nat{_M >> 20}, nat{_M}, 20, _M << (_W - 20) & _M}, + + {nat{_M, _M, _M}, nat{_M, _M, _M}, 0, 0}, + {nat{_M, _M, _M >> 1}, nat{_M, _M, _M}, 1, _M << (_W - 1) & _M}, + {nat{_M, _M, _M >> 20}, nat{_M, _M, _M}, 20, _M << (_W - 20) & _M}, +} + +func testFunVW(t *testing.T, msg string, f funVW, a argVW) { + z := make(nat, len(a.z)) + c := f(z, a.x, a.y) + for i, zi := range z { + if zi != a.z[i] { + t.Errorf("%s%+v\n\tgot z[%d] = %#x; want %#x", msg, a, i, zi, a.z[i]) + break + } + } + if c != a.c { + t.Errorf("%s%+v\n\tgot c = %#x; want %#x", msg, a, c, a.c) + } +} + +func makeFunVW(f func(z, x []Word, s uint) (c Word)) funVW { + return func(z, x []Word, s Word) (c Word) { + return f(z, x, uint(s)) + } +} + +func TestFunVW(t *testing.T) { + for _, a := range sumVW { + arg := a + testFunVW(t, "addVW_g", addVW_g, arg) + testFunVW(t, "addVW", addVW, arg) + + arg = argVW{a.x, a.z, a.y, a.c} + testFunVW(t, "subVW_g", subVW_g, arg) + testFunVW(t, "subVW", subVW, arg) + } + + shlVW_g := makeFunVW(shlVU_g) + shlVW := makeFunVW(shlVU) + for _, a := range lshVW { + arg := a + testFunVW(t, "shlVU_g", shlVW_g, arg) + testFunVW(t, "shlVU", shlVW, arg) + } + + shrVW_g := makeFunVW(shrVU_g) + shrVW := makeFunVW(shrVU) + for _, a := range rshVW { + arg := a + testFunVW(t, "shrVU_g", shrVW_g, arg) + testFunVW(t, "shrVU", shrVW, arg) + } +} + +func benchmarkFunVW(b *testing.B, f funVW, n int) { + x := rndV(n) + y := rndW() + z := make([]Word, n) + b.SetBytes(int64(n * _S)) + b.ResetTimer() + for i := 0; i < b.N; i++ { + f(z, x, y) + } +} + +func BenchmarkAddVW_1(b *testing.B) { benchmarkFunVW(b, addVW, 1) } +func BenchmarkAddVW_2(b *testing.B) { benchmarkFunVW(b, addVW, 2) } +func BenchmarkAddVW_3(b *testing.B) { benchmarkFunVW(b, addVW, 3) } +func BenchmarkAddVW_4(b *testing.B) { benchmarkFunVW(b, addVW, 4) } +func BenchmarkAddVW_5(b *testing.B) { benchmarkFunVW(b, addVW, 5) } +func BenchmarkAddVW_1e1(b *testing.B) { benchmarkFunVW(b, addVW, 1e1) } +func BenchmarkAddVW_1e2(b *testing.B) { benchmarkFunVW(b, addVW, 1e2) } +func BenchmarkAddVW_1e3(b *testing.B) { benchmarkFunVW(b, addVW, 1e3) } +func BenchmarkAddVW_1e4(b *testing.B) { benchmarkFunVW(b, addVW, 1e4) } +func BenchmarkAddVW_1e5(b *testing.B) { benchmarkFunVW(b, addVW, 1e5) } + +type funVWW func(z, x []Word, y, r Word) (c Word) +type argVWW struct { + z, x nat + y, r Word + c Word +} + +var prodVWW = []argVWW{ + {}, + {nat{0}, nat{0}, 0, 0, 0}, + {nat{991}, nat{0}, 0, 991, 0}, + {nat{0}, nat{_M}, 0, 0, 0}, + {nat{991}, nat{_M}, 0, 991, 0}, + {nat{0}, nat{0}, _M, 0, 0}, + {nat{991}, nat{0}, _M, 991, 0}, + {nat{1}, nat{1}, 1, 0, 0}, + {nat{992}, nat{1}, 1, 991, 0}, + {nat{22793}, nat{991}, 23, 0, 0}, + {nat{22800}, nat{991}, 23, 7, 0}, + {nat{0, 0, 0, 22793}, nat{0, 0, 0, 991}, 23, 0, 0}, + {nat{7, 0, 0, 22793}, nat{0, 0, 0, 991}, 23, 7, 0}, + {nat{0, 0, 0, 0}, nat{7893475, 7395495, 798547395, 68943}, 0, 0, 0}, + {nat{991, 0, 0, 0}, nat{7893475, 7395495, 798547395, 68943}, 0, 991, 0}, + {nat{0, 0, 0, 0}, nat{0, 0, 0, 0}, 894375984, 0, 0}, + {nat{991, 0, 0, 0}, nat{0, 0, 0, 0}, 894375984, 991, 0}, + {nat{_M << 1 & _M}, nat{_M}, 1 << 1, 0, _M >> (_W - 1)}, + {nat{_M<<1&_M + 1}, nat{_M}, 1 << 1, 1, _M >> (_W - 1)}, + {nat{_M << 7 & _M}, nat{_M}, 1 << 7, 0, _M >> (_W - 7)}, + {nat{_M<<7&_M + 1<<6}, nat{_M}, 1 << 7, 1 << 6, _M >> (_W - 7)}, + {nat{_M << 7 & _M, _M, _M, _M}, nat{_M, _M, _M, _M}, 1 << 7, 0, _M >> (_W - 7)}, + {nat{_M<<7&_M + 1<<6, _M, _M, _M}, nat{_M, _M, _M, _M}, 1 << 7, 1 << 6, _M >> (_W - 7)}, +} + +func testFunVWW(t *testing.T, msg string, f funVWW, a argVWW) { + z := make(nat, len(a.z)) + c := f(z, a.x, a.y, a.r) + for i, zi := range z { + if zi != a.z[i] { + t.Errorf("%s%+v\n\tgot z[%d] = %#x; want %#x", msg, a, i, zi, a.z[i]) + break + } + } + if c != a.c { + t.Errorf("%s%+v\n\tgot c = %#x; want %#x", msg, a, c, a.c) + } +} + +// TODO(gri) mulAddVWW and divWVW are symmetric operations but +// their signature is not symmetric. Try to unify. + +type funWVW func(z []Word, xn Word, x []Word, y Word) (r Word) +type argWVW struct { + z nat + xn Word + x nat + y Word + r Word +} + +func testFunWVW(t *testing.T, msg string, f funWVW, a argWVW) { + z := make(nat, len(a.z)) + r := f(z, a.xn, a.x, a.y) + for i, zi := range z { + if zi != a.z[i] { + t.Errorf("%s%+v\n\tgot z[%d] = %#x; want %#x", msg, a, i, zi, a.z[i]) + break + } + } + if r != a.r { + t.Errorf("%s%+v\n\tgot r = %#x; want %#x", msg, a, r, a.r) + } +} + +func TestFunVWW(t *testing.T) { + for _, a := range prodVWW { + arg := a + testFunVWW(t, "mulAddVWW_g", mulAddVWW_g, arg) + testFunVWW(t, "mulAddVWW", mulAddVWW, arg) + + if a.y != 0 && a.r < a.y { + arg := argWVW{a.x, a.c, a.z, a.y, a.r} + testFunWVW(t, "divWVW_g", divWVW_g, arg) + testFunWVW(t, "divWVW", divWVW, arg) + } + } +} + +var mulWWTests = []struct { + x, y Word + q, r Word +}{ + {_M, _M, _M - 1, 1}, + // 32 bit only: {0xc47dfa8c, 50911, 0x98a4, 0x998587f4}, +} + +func TestMulWW(t *testing.T) { + for i, test := range mulWWTests { + q, r := mulWW_g(test.x, test.y) + if q != test.q || r != test.r { + t.Errorf("#%d got (%x, %x) want (%x, %x)", i, q, r, test.q, test.r) + } + } +} + +var mulAddWWWTests = []struct { + x, y, c Word + q, r Word +}{ + // TODO(agl): These will only work on 64-bit platforms. + // {15064310297182388543, 0xe7df04d2d35d5d80, 13537600649892366549, 13644450054494335067, 10832252001440893781}, + // {15064310297182388543, 0xdab2f18048baa68d, 13644450054494335067, 12869334219691522700, 14233854684711418382}, + {_M, _M, 0, _M - 1, 1}, + {_M, _M, _M, _M, 0}, +} + +func TestMulAddWWW(t *testing.T) { + for i, test := range mulAddWWWTests { + q, r := mulAddWWW_g(test.x, test.y, test.c) + if q != test.q || r != test.r { + t.Errorf("#%d got (%x, %x) want (%x, %x)", i, q, r, test.q, test.r) + } + } +} + +func benchmarkAddMulVVW(b *testing.B, n int) { + x := rndV(n) + y := rndW() + z := make([]Word, n) + b.SetBytes(int64(n * _W)) + b.ResetTimer() + for i := 0; i < b.N; i++ { + addMulVVW(z, x, y) + } +} + +func BenchmarkAddMulVVW_1(b *testing.B) { benchmarkAddMulVVW(b, 1) } +func BenchmarkAddMulVVW_2(b *testing.B) { benchmarkAddMulVVW(b, 2) } +func BenchmarkAddMulVVW_3(b *testing.B) { benchmarkAddMulVVW(b, 3) } +func BenchmarkAddMulVVW_4(b *testing.B) { benchmarkAddMulVVW(b, 4) } +func BenchmarkAddMulVVW_5(b *testing.B) { benchmarkAddMulVVW(b, 5) } +func BenchmarkAddMulVVW_1e1(b *testing.B) { benchmarkAddMulVVW(b, 1e1) } +func BenchmarkAddMulVVW_1e2(b *testing.B) { benchmarkAddMulVVW(b, 1e2) } +func BenchmarkAddMulVVW_1e3(b *testing.B) { benchmarkAddMulVVW(b, 1e3) } +func BenchmarkAddMulVVW_1e4(b *testing.B) { benchmarkAddMulVVW(b, 1e4) } +func BenchmarkAddMulVVW_1e5(b *testing.B) { benchmarkAddMulVVW(b, 1e5) } + +func testWordBitLen(t *testing.T, fname string, f func(Word) int) { + for i := 0; i <= _W; i++ { + x := Word(1) << uint(i-1) // i == 0 => x == 0 + n := f(x) + if n != i { + t.Errorf("got %d; want %d for %s(%#x)", n, i, fname, x) + } + } +} + +func TestWordBitLen(t *testing.T) { + testWordBitLen(t, "bitLen", bitLen) + testWordBitLen(t, "bitLen_g", bitLen_g) +} + +// runs b.N iterations of bitLen called on a Word containing (1 << nbits)-1. +func benchmarkBitLenN(b *testing.B, nbits uint) { + testword := Word((uint64(1) << nbits) - 1) + for i := 0; i < b.N; i++ { + bitLen(testword) + } +} + +// Individual bitLen tests. Numbers chosen to examine both sides +// of powers-of-two boundaries. +func BenchmarkBitLen0(b *testing.B) { benchmarkBitLenN(b, 0) } +func BenchmarkBitLen1(b *testing.B) { benchmarkBitLenN(b, 1) } +func BenchmarkBitLen2(b *testing.B) { benchmarkBitLenN(b, 2) } +func BenchmarkBitLen3(b *testing.B) { benchmarkBitLenN(b, 3) } +func BenchmarkBitLen4(b *testing.B) { benchmarkBitLenN(b, 4) } +func BenchmarkBitLen5(b *testing.B) { benchmarkBitLenN(b, 5) } +func BenchmarkBitLen8(b *testing.B) { benchmarkBitLenN(b, 8) } +func BenchmarkBitLen9(b *testing.B) { benchmarkBitLenN(b, 9) } +func BenchmarkBitLen16(b *testing.B) { benchmarkBitLenN(b, 16) } +func BenchmarkBitLen17(b *testing.B) { benchmarkBitLenN(b, 17) } +func BenchmarkBitLen31(b *testing.B) { benchmarkBitLenN(b, 31) } diff --git a/src/cmd/compile/internal/big/bits_test.go b/src/cmd/compile/internal/big/bits_test.go new file mode 100644 index 0000000000000000000000000000000000000000..985b60bd4b742708775ac39c532e91ccefdcd8bd --- /dev/null +++ b/src/cmd/compile/internal/big/bits_test.go @@ -0,0 +1,224 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// This file implements the Bits type used for testing Float operations +// via an independent (albeit slower) representations for floating-point +// numbers. + +package big + +import ( + "fmt" + "sort" + "testing" +) + +// A Bits value b represents a finite floating-point number x of the form +// +// x = 2**b[0] + 2**b[1] + ... 2**b[len(b)-1] +// +// The order of slice elements is not significant. Negative elements may be +// used to form fractions. A Bits value is normalized if each b[i] occurs at +// most once. For instance Bits{0, 0, 1} is not normalized but represents the +// same floating-point number as Bits{2}, which is normalized. The zero (nil) +// value of Bits is a ready to use Bits value and represents the value 0. +type Bits []int + +func (x Bits) add(y Bits) Bits { + return append(x, y...) +} + +func (x Bits) mul(y Bits) Bits { + var p Bits + for _, x := range x { + for _, y := range y { + p = append(p, x+y) + } + } + return p +} + +func TestMulBits(t *testing.T) { + for _, test := range []struct { + x, y, want Bits + }{ + {nil, nil, nil}, + {Bits{}, Bits{}, nil}, + {Bits{0}, Bits{0}, Bits{0}}, + {Bits{0}, Bits{1}, Bits{1}}, + {Bits{1}, Bits{1, 2, 3}, Bits{2, 3, 4}}, + {Bits{-1}, Bits{1}, Bits{0}}, + {Bits{-10, -1, 0, 1, 10}, Bits{1, 2, 3}, Bits{-9, -8, -7, 0, 1, 2, 1, 2, 3, 2, 3, 4, 11, 12, 13}}, + } { + got := fmt.Sprintf("%v", test.x.mul(test.y)) + want := fmt.Sprintf("%v", test.want) + if got != want { + t.Errorf("%v * %v = %s; want %s", test.x, test.y, got, want) + } + + } +} + +// norm returns the normalized bits for x: It removes multiple equal entries +// by treating them as an addition (e.g., Bits{5, 5} => Bits{6}), and it sorts +// the result list for reproducible results. +func (x Bits) norm() Bits { + m := make(map[int]bool) + for _, b := range x { + for m[b] { + m[b] = false + b++ + } + m[b] = true + } + var z Bits + for b, set := range m { + if set { + z = append(z, b) + } + } + sort.Ints([]int(z)) + return z +} + +func TestNormBits(t *testing.T) { + for _, test := range []struct { + x, want Bits + }{ + {nil, nil}, + {Bits{}, Bits{}}, + {Bits{0}, Bits{0}}, + {Bits{0, 0}, Bits{1}}, + {Bits{3, 1, 1}, Bits{2, 3}}, + {Bits{10, 9, 8, 7, 6, 6}, Bits{11}}, + } { + got := fmt.Sprintf("%v", test.x.norm()) + want := fmt.Sprintf("%v", test.want) + if got != want { + t.Errorf("normBits(%v) = %s; want %s", test.x, got, want) + } + + } +} + +// round returns the Float value corresponding to x after rounding x +// to prec bits according to mode. +func (x Bits) round(prec uint, mode RoundingMode) *Float { + x = x.norm() + + // determine range + var min, max int + for i, b := range x { + if i == 0 || b < min { + min = b + } + if i == 0 || b > max { + max = b + } + } + prec0 := uint(max + 1 - min) + if prec >= prec0 { + return x.Float() + } + // prec < prec0 + + // determine bit 0, rounding, and sticky bit, and result bits z + var bit0, rbit, sbit uint + var z Bits + r := max - int(prec) + for _, b := range x { + switch { + case b == r: + rbit = 1 + case b < r: + sbit = 1 + default: + // b > r + if b == r+1 { + bit0 = 1 + } + z = append(z, b) + } + } + + // round + f := z.Float() // rounded to zero + if mode == ToNearestAway { + panic("not yet implemented") + } + if mode == ToNearestEven && rbit == 1 && (sbit == 1 || sbit == 0 && bit0 != 0) || mode == AwayFromZero { + // round away from zero + f.SetMode(ToZero).SetPrec(prec) + f.Add(f, Bits{int(r) + 1}.Float()) + } + return f +} + +// Float returns the *Float z of the smallest possible precision such that +// z = sum(2**bits[i]), with i = range bits. If multiple bits[i] are equal, +// they are added: Bits{0, 1, 0}.Float() == 2**0 + 2**1 + 2**0 = 4. +func (bits Bits) Float() *Float { + // handle 0 + if len(bits) == 0 { + return new(Float) + } + // len(bits) > 0 + + // determine lsb exponent + var min int + for i, b := range bits { + if i == 0 || b < min { + min = b + } + } + + // create bit pattern + x := NewInt(0) + for _, b := range bits { + badj := b - min + // propagate carry if necessary + for x.Bit(badj) != 0 { + x.SetBit(x, badj, 0) + badj++ + } + x.SetBit(x, badj, 1) + } + + // create corresponding float + z := new(Float).SetInt(x) // normalized + if e := int64(z.exp) + int64(min); MinExp <= e && e <= MaxExp { + z.exp = int32(e) + } else { + // this should never happen for our test cases + panic("exponent out of range") + } + return z +} + +func TestFromBits(t *testing.T) { + for _, test := range []struct { + bits Bits + want string + }{ + // all different bit numbers + {nil, "0"}, + {Bits{0}, "0x.8p+1"}, + {Bits{1}, "0x.8p+2"}, + {Bits{-1}, "0x.8p+0"}, + {Bits{63}, "0x.8p+64"}, + {Bits{33, -30}, "0x.8000000000000001p+34"}, + {Bits{255, 0}, "0x.8000000000000000000000000000000000000000000000000000000000000001p+256"}, + + // multiple equal bit numbers + {Bits{0, 0}, "0x.8p+2"}, + {Bits{0, 0, 0, 0}, "0x.8p+3"}, + {Bits{0, 1, 0}, "0x.8p+3"}, + {append(Bits{2, 1, 0} /* 7 */, Bits{3, 1} /* 10 */ ...), "0x.88p+5" /* 17 */}, + } { + f := test.bits.Float() + if got := f.Text('p', 0); got != test.want { + t.Errorf("setBits(%v) = %s; want %s", test.bits, got, test.want) + } + } +} diff --git a/src/cmd/compile/internal/big/calibrate_test.go b/src/cmd/compile/internal/big/calibrate_test.go new file mode 100644 index 0000000000000000000000000000000000000000..f69ffbf5cf13b8d6f0e8b0190038c3d868298872 --- /dev/null +++ b/src/cmd/compile/internal/big/calibrate_test.go @@ -0,0 +1,88 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// This file prints execution times for the Mul benchmark +// given different Karatsuba thresholds. The result may be +// used to manually fine-tune the threshold constant. The +// results are somewhat fragile; use repeated runs to get +// a clear picture. + +// Usage: go test -run=TestCalibrate -calibrate + +package big + +import ( + "flag" + "fmt" + "testing" + "time" +) + +var calibrate = flag.Bool("calibrate", false, "run calibration test") + +func karatsubaLoad(b *testing.B) { + BenchmarkMul(b) +} + +// measureKaratsuba returns the time to run a Karatsuba-relevant benchmark +// given Karatsuba threshold th. +func measureKaratsuba(th int) time.Duration { + th, karatsubaThreshold = karatsubaThreshold, th + res := testing.Benchmark(karatsubaLoad) + karatsubaThreshold = th + return time.Duration(res.NsPerOp()) +} + +func computeThresholds() { + fmt.Printf("Multiplication times for varying Karatsuba thresholds\n") + fmt.Printf("(run repeatedly for good results)\n") + + // determine Tk, the work load execution time using basic multiplication + Tb := measureKaratsuba(1e9) // th == 1e9 => Karatsuba multiplication disabled + fmt.Printf("Tb = %10s\n", Tb) + + // thresholds + th := 4 + th1 := -1 + th2 := -1 + + var deltaOld time.Duration + for count := -1; count != 0 && th < 128; count-- { + // determine Tk, the work load execution time using Karatsuba multiplication + Tk := measureKaratsuba(th) + + // improvement over Tb + delta := (Tb - Tk) * 100 / Tb + + fmt.Printf("th = %3d Tk = %10s %4d%%", th, Tk, delta) + + // determine break-even point + if Tk < Tb && th1 < 0 { + th1 = th + fmt.Print(" break-even point") + } + + // determine diminishing return + if 0 < delta && delta < deltaOld && th2 < 0 { + th2 = th + fmt.Print(" diminishing return") + } + deltaOld = delta + + fmt.Println() + + // trigger counter + if th1 >= 0 && th2 >= 0 && count < 0 { + count = 10 // this many extra measurements after we got both thresholds + } + + th++ + } +} + +func TestCalibrate(t *testing.T) { + if *calibrate { + computeThresholds() + } +} diff --git a/src/cmd/compile/internal/big/decimal.go b/src/cmd/compile/internal/big/decimal.go new file mode 100644 index 0000000000000000000000000000000000000000..2595e5f8c121fb096a25977a21f1dbd646f525b3 --- /dev/null +++ b/src/cmd/compile/internal/big/decimal.go @@ -0,0 +1,264 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// This file implements multi-precision decimal numbers. +// The implementation is for float to decimal conversion only; +// not general purpose use. +// The only operations are precise conversion from binary to +// decimal and rounding. +// +// The key observation and some code (shr) is borrowed from +// strconv/decimal.go: conversion of binary fractional values can be done +// precisely in multi-precision decimal because 2 divides 10 (required for +// >> of mantissa); but conversion of decimal floating-point values cannot +// be done precisely in binary representation. +// +// In contrast to strconv/decimal.go, only right shift is implemented in +// decimal format - left shift can be done precisely in binary format. + +package big + +// A decimal represents an unsigned floating-point number in decimal representation. +// The value of a non-zero decimal x is x.mant * 10 ** x.exp with 0.5 <= x.mant < 1, +// with the most-significant mantissa digit at index 0. For the zero decimal, the +// mantissa length and exponent are 0. +// The zero value for decimal represents a ready-to-use 0.0. +type decimal struct { + mant []byte // mantissa ASCII digits, big-endian + exp int // exponent +} + +// Maximum shift amount that can be done in one pass without overflow. +// A Word has _W bits and (1<= 0), or m >> -shift (for shift < 0). +func (x *decimal) init(m nat, shift int) { + // special case 0 + if len(m) == 0 { + x.mant = x.mant[:0] + x.exp = 0 + return + } + + // Optimization: If we need to shift right, first remove any trailing + // zero bits from m to reduce shift amount that needs to be done in + // decimal format (since that is likely slower). + if shift < 0 { + ntz := m.trailingZeroBits() + s := uint(-shift) + if s >= ntz { + s = ntz // shift at most ntz bits + } + m = nat(nil).shr(m, s) + shift += int(s) + } + + // Do any shift left in binary representation. + if shift > 0 { + m = nat(nil).shl(m, uint(shift)) + shift = 0 + } + + // Convert mantissa into decimal representation. + s := m.decimalString() // TODO(gri) avoid string conversion here + n := len(s) + x.exp = n + // Trim trailing zeros; instead the exponent is tracking + // the decimal point independent of the number of digits. + for n > 0 && s[n-1] == '0' { + n-- + } + x.mant = append(x.mant[:0], s[:n]...) + + // Do any (remaining) shift right in decimal representation. + if shift < 0 { + for shift < -maxShift { + shr(x, maxShift) + shift += maxShift + } + shr(x, uint(-shift)) + } +} + +// Possibly optimization: The current implementation of nat.string takes +// a charset argument. When a right shift is needed, we could provide +// "\x00\x01...\x09" instead of "012..9" (as in nat.decimalString) and +// avoid the repeated +'0' and -'0' operations in decimal.shr (and do a +// single +'0' pass at the end). + +// shr implements x >> s, for s <= maxShift. +func shr(x *decimal, s uint) { + // Division by 1<>s == 0 && r < len(x.mant) { + ch := Word(x.mant[r]) + r++ + n = n*10 + ch - '0' + } + if n == 0 { + // x == 0; shouldn't get here, but handle anyway + x.mant = x.mant[:0] + return + } + for n>>s == 0 { + r++ + n *= 10 + } + x.exp += 1 - r + + // read a digit, write a digit + w := 0 // write index + for r < len(x.mant) { + ch := Word(x.mant[r]) + r++ + d := n >> s + n -= d << s + x.mant[w] = byte(d + '0') + w++ + n = n*10 + ch - '0' + } + + // write extra digits that still fit + for n > 0 && w < len(x.mant) { + d := n >> s + n -= d << s + x.mant[w] = byte(d + '0') + w++ + n = n * 10 + } + x.mant = x.mant[:w] // the number may be shorter (e.g. 1024 >> 10) + + // append additional digits that didn't fit + for n > 0 { + d := n >> s + n -= d << s + x.mant = append(x.mant, byte(d+'0')) + n = n * 10 + } + + trim(x) +} + +func (x *decimal) String() string { + if len(x.mant) == 0 { + return "0" + } + + var buf []byte + switch { + case x.exp <= 0: + // 0.00ddd + buf = append(buf, "0."...) + buf = appendZeros(buf, -x.exp) + buf = append(buf, x.mant...) + + case /* 0 < */ x.exp < len(x.mant): + // dd.ddd + buf = append(buf, x.mant[:x.exp]...) + buf = append(buf, '.') + buf = append(buf, x.mant[x.exp:]...) + + default: // len(x.mant) <= x.exp + // ddd00 + buf = append(buf, x.mant...) + buf = appendZeros(buf, x.exp-len(x.mant)) + } + + return string(buf) +} + +// appendZeros appends n 0 digits to buf and returns buf. +func appendZeros(buf []byte, n int) []byte { + for ; n > 0; n-- { + buf = append(buf, '0') + } + return buf +} + +// shouldRoundUp reports if x should be rounded up +// if shortened to n digits. n must be a valid index +// for x.mant. +func shouldRoundUp(x *decimal, n int) bool { + if x.mant[n] == '5' && n+1 == len(x.mant) { + // exactly halfway - round to even + return n > 0 && (x.mant[n-1]-'0')&1 != 0 + } + // not halfway - digit tells all (x.mant has no trailing zeros) + return x.mant[n] >= '5' +} + +// round sets x to (at most) n mantissa digits by rounding it +// to the nearest even value with n (or fever) mantissa digits. +// If n < 0, x remains unchanged. +func (x *decimal) round(n int) { + if n < 0 || n >= len(x.mant) { + return // nothing to do + } + + if shouldRoundUp(x, n) { + x.roundUp(n) + } else { + x.roundDown(n) + } +} + +func (x *decimal) roundUp(n int) { + if n < 0 || n >= len(x.mant) { + return // nothing to do + } + // 0 <= n < len(x.mant) + + // find first digit < '9' + for n > 0 && x.mant[n-1] >= '9' { + n-- + } + + if n == 0 { + // all digits are '9's => round up to '1' and update exponent + x.mant[0] = '1' // ok since len(x.mant) > n + x.mant = x.mant[:1] + x.exp++ + return + } + + // n > 0 && x.mant[n-1] < '9' + x.mant[n-1]++ + x.mant = x.mant[:n] + // x already trimmed +} + +func (x *decimal) roundDown(n int) { + if n < 0 || n >= len(x.mant) { + return // nothing to do + } + x.mant = x.mant[:n] + trim(x) +} + +// trim cuts off any trailing zeros from x's mantissa; +// they are meaningless for the value of x. +func trim(x *decimal) { + i := len(x.mant) + for i > 0 && x.mant[i-1] == '0' { + i-- + } + x.mant = x.mant[:i] + if i == 0 { + x.exp = 0 + } +} diff --git a/src/cmd/compile/internal/big/decimal_test.go b/src/cmd/compile/internal/big/decimal_test.go new file mode 100644 index 0000000000000000000000000000000000000000..81e022a47dd60848e06cf8b802ce7e8979520f9e --- /dev/null +++ b/src/cmd/compile/internal/big/decimal_test.go @@ -0,0 +1,106 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package big + +import "testing" + +func TestDecimalString(t *testing.T) { + for _, test := range []struct { + x decimal + want string + }{ + {want: "0"}, + {decimal{nil, 1000}, "0"}, // exponent of 0 is ignored + {decimal{[]byte("12345"), 0}, "0.12345"}, + {decimal{[]byte("12345"), -3}, "0.00012345"}, + {decimal{[]byte("12345"), +3}, "123.45"}, + {decimal{[]byte("12345"), +10}, "1234500000"}, + } { + if got := test.x.String(); got != test.want { + t.Errorf("%v == %s; want %s", test.x, got, test.want) + } + } +} + +func TestDecimalInit(t *testing.T) { + for _, test := range []struct { + x Word + shift int + want string + }{ + {0, 0, "0"}, + {0, -100, "0"}, + {0, 100, "0"}, + {1, 0, "1"}, + {1, 10, "1024"}, + {1, 100, "1267650600228229401496703205376"}, + {1, -100, "0.0000000000000000000000000000007888609052210118054117285652827862296732064351090230047702789306640625"}, + {12345678, 8, "3160493568"}, + {12345678, -8, "48225.3046875"}, + {195312, 9, "99999744"}, + {1953125, 9, "1000000000"}, + } { + var d decimal + d.init(nat{test.x}.norm(), test.shift) + if got := d.String(); got != test.want { + t.Errorf("%d << %d == %s; want %s", test.x, test.shift, got, test.want) + } + } +} + +func TestDecimalRounding(t *testing.T) { + for _, test := range []struct { + x uint64 + n int + down, even, up string + }{ + {0, 0, "0", "0", "0"}, + {0, 1, "0", "0", "0"}, + + {1, 0, "0", "0", "10"}, + {5, 0, "0", "0", "10"}, + {9, 0, "0", "10", "10"}, + + {15, 1, "10", "20", "20"}, + {45, 1, "40", "40", "50"}, + {95, 1, "90", "100", "100"}, + + {12344999, 4, "12340000", "12340000", "12350000"}, + {12345000, 4, "12340000", "12340000", "12350000"}, + {12345001, 4, "12340000", "12350000", "12350000"}, + {23454999, 4, "23450000", "23450000", "23460000"}, + {23455000, 4, "23450000", "23460000", "23460000"}, + {23455001, 4, "23450000", "23460000", "23460000"}, + + {99994999, 4, "99990000", "99990000", "100000000"}, + {99995000, 4, "99990000", "100000000", "100000000"}, + {99999999, 4, "99990000", "100000000", "100000000"}, + + {12994999, 4, "12990000", "12990000", "13000000"}, + {12995000, 4, "12990000", "13000000", "13000000"}, + {12999999, 4, "12990000", "13000000", "13000000"}, + } { + x := nat(nil).setUint64(test.x) + + var d decimal + d.init(x, 0) + d.roundDown(test.n) + if got := d.String(); got != test.down { + t.Errorf("roundDown(%d, %d) = %s; want %s", test.x, test.n, got, test.down) + } + + d.init(x, 0) + d.round(test.n) + if got := d.String(); got != test.even { + t.Errorf("round(%d, %d) = %s; want %s", test.x, test.n, got, test.even) + } + + d.init(x, 0) + d.roundUp(test.n) + if got := d.String(); got != test.up { + t.Errorf("roundUp(%d, %d) = %s; want %s", test.x, test.n, got, test.up) + } + } +} diff --git a/src/cmd/compile/internal/big/example_test.go b/src/cmd/compile/internal/big/example_test.go new file mode 100644 index 0000000000000000000000000000000000000000..cb91bc23bdfc2f4fa5d49e5381e3d9bc22986cfa --- /dev/null +++ b/src/cmd/compile/internal/big/example_test.go @@ -0,0 +1,51 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package big_test + +import ( + "cmd/compile/internal/big" + "fmt" + "log" +) + +func ExampleRat_SetString() { + r := new(big.Rat) + r.SetString("355/113") + fmt.Println(r.FloatString(3)) + // Output: 3.142 +} + +func ExampleInt_SetString() { + i := new(big.Int) + i.SetString("644", 8) // octal + fmt.Println(i) + // Output: 420 +} + +func ExampleRat_Scan() { + // The Scan function is rarely used directly; + // the fmt package recognizes it as an implementation of fmt.Scanner. + r := new(big.Rat) + _, err := fmt.Sscan("1.5000", r) + if err != nil { + log.Println("error scanning value:", err) + } else { + fmt.Println(r) + } + // Output: 3/2 +} + +func ExampleInt_Scan() { + // The Scan function is rarely used directly; + // the fmt package recognizes it as an implementation of fmt.Scanner. + i := new(big.Int) + _, err := fmt.Sscan("18446744073709551617", i) + if err != nil { + log.Println("error scanning value:", err) + } else { + fmt.Println(i) + } + // Output: 18446744073709551617 +} diff --git a/src/cmd/compile/internal/big/float.go b/src/cmd/compile/internal/big/float.go new file mode 100644 index 0000000000000000000000000000000000000000..d7aa8953c435ce45684a7d58770e1644028c2224 --- /dev/null +++ b/src/cmd/compile/internal/big/float.go @@ -0,0 +1,1693 @@ +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// This file implements multi-precision floating-point numbers. +// Like in the GNU MPFR library (http://www.mpfr.org/), operands +// can be of mixed precision. Unlike MPFR, the rounding mode is +// not specified with each operation, but with each operand. The +// rounding mode of the result operand determines the rounding +// mode of an operation. This is a from-scratch implementation. + +package big + +import ( + "fmt" + "math" +) + +const debugFloat = false // enable for debugging + +// A nonzero finite Float represents a multi-precision floating point number +// +// sign × mantissa × 2**exponent +// +// with 0.5 <= mantissa < 1.0, and MinExp <= exponent <= MaxExp. +// A Float may also be zero (+0, -0) or infinite (+Inf, -Inf). +// All Floats are ordered, and the ordering of two Floats x and y +// is defined by x.Cmp(y). +// +// Each Float value also has a precision, rounding mode, and accuracy. +// The precision is the maximum number of mantissa bits available to +// represent the value. The rounding mode specifies how a result should +// be rounded to fit into the mantissa bits, and accuracy describes the +// rounding error with respect to the exact result. +// +// Unless specified otherwise, all operations (including setters) that +// specify a *Float variable for the result (usually via the receiver +// with the exception of MantExp), round the numeric result according +// to the precision and rounding mode of the result variable. +// +// If the provided result precision is 0 (see below), it is set to the +// precision of the argument with the largest precision value before any +// rounding takes place, and the rounding mode remains unchanged. Thus, +// uninitialized Floats provided as result arguments will have their +// precision set to a reasonable value determined by the operands and +// their mode is the zero value for RoundingMode (ToNearestEven). +// +// By setting the desired precision to 24 or 53 and using matching rounding +// mode (typically ToNearestEven), Float operations produce the same results +// as the corresponding float32 or float64 IEEE-754 arithmetic for operands +// that correspond to normal (i.e., not denormal) float32 or float64 numbers. +// Exponent underflow and overflow lead to a 0 or an Infinity for different +// values than IEEE-754 because Float exponents have a much larger range. +// +// The zero (uninitialized) value for a Float is ready to use and represents +// the number +0.0 exactly, with precision 0 and rounding mode ToNearestEven. +// +type Float struct { + prec uint32 + mode RoundingMode + acc Accuracy + form form + neg bool + mant nat + exp int32 +} + +// An ErrNaN panic is raised by a Float operation that would lead to +// a NaN under IEEE-754 rules. An ErrNaN implements the error interface. +type ErrNaN struct { + msg string +} + +func (err ErrNaN) Error() string { + return err.msg +} + +// NewFloat allocates and returns a new Float set to x, +// with precision 53 and rounding mode ToNearestEven. +// NewFloat panics with ErrNaN if x is a NaN. +func NewFloat(x float64) *Float { + if math.IsNaN(x) { + panic(ErrNaN{"NewFloat(NaN)"}) + } + return new(Float).SetFloat64(x) +} + +// Exponent and precision limits. +const ( + MaxExp = math.MaxInt32 // largest supported exponent + MinExp = math.MinInt32 // smallest supported exponent + MaxPrec = math.MaxUint32 // largest (theoretically) supported precision; likely memory-limited +) + +// Internal representation: The mantissa bits x.mant of a nonzero finite +// Float x are stored in a nat slice long enough to hold up to x.prec bits; +// the slice may (but doesn't have to) be shorter if the mantissa contains +// trailing 0 bits. x.mant is normalized if the msb of x.mant == 1 (i.e., +// the msb is shifted all the way "to the left"). Thus, if the mantissa has +// trailing 0 bits or x.prec is not a multiple of the the Word size _W, +// x.mant[0] has trailing zero bits. The msb of the mantissa corresponds +// to the value 0.5; the exponent x.exp shifts the binary point as needed. +// +// A zero or non-finite Float x ignores x.mant and x.exp. +// +// x form neg mant exp +// ---------------------------------------------------------- +// ±0 zero sign - - +// 0 < |x| < +Inf finite sign mantissa exponent +// ±Inf inf sign - - + +// A form value describes the internal representation. +type form byte + +// The form value order is relevant - do not change! +const ( + zero form = iota + finite + inf +) + +// RoundingMode determines how a Float value is rounded to the +// desired precision. Rounding may change the Float value; the +// rounding error is described by the Float's Accuracy. +type RoundingMode byte + +// The following rounding modes are supported. +const ( + ToNearestEven RoundingMode = iota // == IEEE 754-2008 roundTiesToEven + ToNearestAway // == IEEE 754-2008 roundTiesToAway + ToZero // == IEEE 754-2008 roundTowardZero + AwayFromZero // no IEEE 754-2008 equivalent + ToNegativeInf // == IEEE 754-2008 roundTowardNegative + ToPositiveInf // == IEEE 754-2008 roundTowardPositive +) + +//go:generate stringer -type=RoundingMode + +// Accuracy describes the rounding error produced by the most recent +// operation that generated a Float value, relative to the exact value. +type Accuracy int8 + +// Constants describing the Accuracy of a Float. +const ( + Below Accuracy = -1 + Exact Accuracy = 0 + Above Accuracy = +1 +) + +//go:generate stringer -type=Accuracy + +// SetPrec sets z's precision to prec and returns the (possibly) rounded +// value of z. Rounding occurs according to z's rounding mode if the mantissa +// cannot be represented in prec bits without loss of precision. +// SetPrec(0) maps all finite values to ±0; infinite values remain unchanged. +// If prec > MaxPrec, it is set to MaxPrec. +func (z *Float) SetPrec(prec uint) *Float { + z.acc = Exact // optimistically assume no rounding is needed + + // special case + if prec == 0 { + z.prec = 0 + if z.form == finite { + // truncate z to 0 + z.acc = makeAcc(z.neg) + z.form = zero + } + return z + } + + // general case + if prec > MaxPrec { + prec = MaxPrec + } + old := z.prec + z.prec = uint32(prec) + if z.prec < old { + z.round(0) + } + return z +} + +func makeAcc(above bool) Accuracy { + if above { + return Above + } + return Below +} + +// SetMode sets z's rounding mode to mode and returns an exact z. +// z remains unchanged otherwise. +// z.SetMode(z.Mode()) is a cheap way to set z's accuracy to Exact. +func (z *Float) SetMode(mode RoundingMode) *Float { + z.mode = mode + z.acc = Exact + return z +} + +// Prec returns the mantissa precision of x in bits. +// The result may be 0 for |x| == 0 and |x| == Inf. +func (x *Float) Prec() uint { + return uint(x.prec) +} + +// MinPrec returns the minimum precision required to represent x exactly +// (i.e., the smallest prec before x.SetPrec(prec) would start rounding x). +// The result is 0 for |x| == 0 and |x| == Inf. +func (x *Float) MinPrec() uint { + if x.form != finite { + return 0 + } + return uint(len(x.mant))*_W - x.mant.trailingZeroBits() +} + +// Mode returns the rounding mode of x. +func (x *Float) Mode() RoundingMode { + return x.mode +} + +// Acc returns the accuracy of x produced by the most recent operation. +func (x *Float) Acc() Accuracy { + return x.acc +} + +// Sign returns: +// +// -1 if x < 0 +// 0 if x is ±0 +// +1 if x > 0 +// +func (x *Float) Sign() int { + if debugFloat { + x.validate() + } + if x.form == zero { + return 0 + } + if x.neg { + return -1 + } + return 1 +} + +// MantExp breaks x into its mantissa and exponent components +// and returns the exponent. If a non-nil mant argument is +// provided its value is set to the mantissa of x, with the +// same precision and rounding mode as x. The components +// satisfy x == mant × 2**exp, with 0.5 <= |mant| < 1.0. +// Calling MantExp with a nil argument is an efficient way to +// get the exponent of the receiver. +// +// Special cases are: +// +// ( ±0).MantExp(mant) = 0, with mant set to ±0 +// (±Inf).MantExp(mant) = 0, with mant set to ±Inf +// +// x and mant may be the same in which case x is set to its +// mantissa value. +func (x *Float) MantExp(mant *Float) (exp int) { + if debugFloat { + x.validate() + } + if x.form == finite { + exp = int(x.exp) + } + if mant != nil { + mant.Copy(x) + if mant.form == finite { + mant.exp = 0 + } + } + return +} + +func (z *Float) setExpAndRound(exp int64, sbit uint) { + if exp < MinExp { + // underflow + z.acc = makeAcc(z.neg) + z.form = zero + return + } + + if exp > MaxExp { + // overflow + z.acc = makeAcc(!z.neg) + z.form = inf + return + } + + z.form = finite + z.exp = int32(exp) + z.round(sbit) +} + +// SetMantExp sets z to mant × 2**exp and and returns z. +// The result z has the same precision and rounding mode +// as mant. SetMantExp is an inverse of MantExp but does +// not require 0.5 <= |mant| < 1.0. Specifically: +// +// mant := new(Float) +// new(Float).SetMantExp(mant, x.SetMantExp(mant)).Cmp(x).Eql() is true +// +// Special cases are: +// +// z.SetMantExp( ±0, exp) = ±0 +// z.SetMantExp(±Inf, exp) = ±Inf +// +// z and mant may be the same in which case z's exponent +// is set to exp. +func (z *Float) SetMantExp(mant *Float, exp int) *Float { + if debugFloat { + z.validate() + mant.validate() + } + z.Copy(mant) + if z.form != finite { + return z + } + z.setExpAndRound(int64(z.exp)+int64(exp), 0) + return z +} + +// Signbit returns true if x is negative or negative zero. +func (x *Float) Signbit() bool { + return x.neg +} + +// IsInf reports whether x is +Inf or -Inf. +func (x *Float) IsInf() bool { + return x.form == inf +} + +// IsInt reports whether x is an integer. +// ±Inf values are not integers. +func (x *Float) IsInt() bool { + if debugFloat { + x.validate() + } + // special cases + if x.form != finite { + return x.form == zero + } + // x.form == finite + if x.exp <= 0 { + return false + } + // x.exp > 0 + return x.prec <= uint32(x.exp) || x.MinPrec() <= uint(x.exp) // not enough bits for fractional mantissa +} + +// debugging support +func (x *Float) validate() { + if !debugFloat { + // avoid performance bugs + panic("validate called but debugFloat is not set") + } + if x.form != finite { + return + } + m := len(x.mant) + if m == 0 { + panic("nonzero finite number with empty mantissa") + } + const msb = 1 << (_W - 1) + if x.mant[m-1]&msb == 0 { + panic(fmt.Sprintf("msb not set in last word %#x of %s", x.mant[m-1], x.Text('p', 0))) + } + if x.prec == 0 { + panic("zero precision finite number") + } +} + +// round rounds z according to z.mode to z.prec bits and sets z.acc accordingly. +// sbit must be 0 or 1 and summarizes any "sticky bit" information one might +// have before calling round. z's mantissa must be normalized (with the msb set) +// or empty. +// +// CAUTION: The rounding modes ToNegativeInf, ToPositiveInf are affected by the +// sign of z. For correct rounding, the sign of z must be set correctly before +// calling round. +func (z *Float) round(sbit uint) { + if debugFloat { + z.validate() + } + + z.acc = Exact + if z.form != finite { + // ±0 or ±Inf => nothing left to do + return + } + // z.form == finite && len(z.mant) > 0 + // m > 0 implies z.prec > 0 (checked by validate) + + m := uint32(len(z.mant)) // present mantissa length in words + bits := m * _W // present mantissa bits + if bits <= z.prec { + // mantissa fits => nothing to do + return + } + // bits > z.prec + + n := (z.prec + (_W - 1)) / _W // mantissa length in words for desired precision + + // Rounding is based on two bits: the rounding bit (rbit) and the + // sticky bit (sbit). The rbit is the bit immediately before the + // z.prec leading mantissa bits (the "0.5"). The sbit is set if any + // of the bits before the rbit are set (the "0.25", "0.125", etc.): + // + // rbit sbit => "fractional part" + // + // 0 0 == 0 + // 0 1 > 0 , < 0.5 + // 1 0 == 0.5 + // 1 1 > 0.5, < 1.0 + + // bits > z.prec: mantissa too large => round + r := uint(bits - z.prec - 1) // rounding bit position; r >= 0 + rbit := z.mant.bit(r) // rounding bit + if sbit == 0 { + sbit = z.mant.sticky(r) + } + if debugFloat && sbit&^1 != 0 { + panic(fmt.Sprintf("invalid sbit %#x", sbit)) + } + + // convert ToXInf rounding modes + mode := z.mode + switch mode { + case ToNegativeInf: + mode = ToZero + if z.neg { + mode = AwayFromZero + } + case ToPositiveInf: + mode = AwayFromZero + if z.neg { + mode = ToZero + } + } + + // cut off extra words + if m > n { + copy(z.mant, z.mant[m-n:]) // move n last words to front + z.mant = z.mant[:n] + } + + // determine number of trailing zero bits t + t := n*_W - z.prec // 0 <= t < _W + lsb := Word(1) << t + + // make rounding decision + // TODO(gri) This can be simplified (see Bits.round in bits_test.go). + switch mode { + case ToZero: + // nothing to do + case ToNearestEven, ToNearestAway: + if rbit == 0 { + // rounding bits == 0b0x + mode = ToZero + } else if sbit == 1 { + // rounding bits == 0b11 + mode = AwayFromZero + } + case AwayFromZero: + if rbit|sbit == 0 { + mode = ToZero + } + default: + // ToXInf modes have been converted to ToZero or AwayFromZero + panic("unreachable") + } + + // round and determine accuracy + switch mode { + case ToZero: + if rbit|sbit != 0 { + z.acc = Below + } + + case ToNearestEven, ToNearestAway: + if debugFloat && rbit != 1 { + panic("internal error in rounding") + } + if mode == ToNearestEven && sbit == 0 && z.mant[0]&lsb == 0 { + z.acc = Below + break + } + // mode == ToNearestAway || sbit == 1 || z.mant[0]&lsb != 0 + fallthrough + + case AwayFromZero: + // add 1 to mantissa + if addVW(z.mant, z.mant, lsb) != 0 { + // overflow => shift mantissa right by 1 and add msb + shrVU(z.mant, z.mant, 1) + z.mant[n-1] |= 1 << (_W - 1) + // adjust exponent + if z.exp < MaxExp { + z.exp++ + } else { + // exponent overflow + z.acc = makeAcc(!z.neg) + z.form = inf + return + } + } + z.acc = Above + } + + // zero out trailing bits in least-significant word + z.mant[0] &^= lsb - 1 + + // update accuracy + if z.acc != Exact && z.neg { + z.acc = -z.acc + } + + if debugFloat { + z.validate() + } + + return +} + +func (z *Float) setBits64(neg bool, x uint64) *Float { + if z.prec == 0 { + z.prec = 64 + } + z.acc = Exact + z.neg = neg + if x == 0 { + z.form = zero + return z + } + // x != 0 + z.form = finite + s := nlz64(x) + z.mant = z.mant.setUint64(x << s) + z.exp = int32(64 - s) // always fits + if z.prec < 64 { + z.round(0) + } + return z +} + +// SetUint64 sets z to the (possibly rounded) value of x and returns z. +// If z's precision is 0, it is changed to 64 (and rounding will have +// no effect). +func (z *Float) SetUint64(x uint64) *Float { + return z.setBits64(false, x) +} + +// SetInt64 sets z to the (possibly rounded) value of x and returns z. +// If z's precision is 0, it is changed to 64 (and rounding will have +// no effect). +func (z *Float) SetInt64(x int64) *Float { + u := x + if u < 0 { + u = -u + } + // We cannot simply call z.SetUint64(uint64(u)) and change + // the sign afterwards because the sign affects rounding. + return z.setBits64(x < 0, uint64(u)) +} + +// SetFloat64 sets z to the (possibly rounded) value of x and returns z. +// If z's precision is 0, it is changed to 53 (and rounding will have +// no effect). SetFloat64 panics with ErrNaN if x is a NaN. +func (z *Float) SetFloat64(x float64) *Float { + if z.prec == 0 { + z.prec = 53 + } + if math.IsNaN(x) { + panic(ErrNaN{"Float.SetFloat64(NaN)"}) + } + z.acc = Exact + z.neg = math.Signbit(x) // handle -0, -Inf correctly + if x == 0 { + z.form = zero + return z + } + if math.IsInf(x, 0) { + z.form = inf + return z + } + // normalized x != 0 + z.form = finite + fmant, exp := math.Frexp(x) // get normalized mantissa + z.mant = z.mant.setUint64(1<<63 | math.Float64bits(fmant)<<11) + z.exp = int32(exp) // always fits + if z.prec < 53 { + z.round(0) + } + return z +} + +// fnorm normalizes mantissa m by shifting it to the left +// such that the msb of the most-significant word (msw) is 1. +// It returns the shift amount. It assumes that len(m) != 0. +func fnorm(m nat) int64 { + if debugFloat && (len(m) == 0 || m[len(m)-1] == 0) { + panic("msw of mantissa is 0") + } + s := nlz(m[len(m)-1]) + if s > 0 { + c := shlVU(m, m, s) + if debugFloat && c != 0 { + panic("nlz or shlVU incorrect") + } + } + return int64(s) +} + +// SetInt sets z to the (possibly rounded) value of x and returns z. +// If z's precision is 0, it is changed to the larger of x.BitLen() +// or 64 (and rounding will have no effect). +func (z *Float) SetInt(x *Int) *Float { + // TODO(gri) can be more efficient if z.prec > 0 + // but small compared to the size of x, or if there + // are many trailing 0's. + bits := uint32(x.BitLen()) + if z.prec == 0 { + z.prec = umax32(bits, 64) + } + z.acc = Exact + z.neg = x.neg + if len(x.abs) == 0 { + z.form = zero + return z + } + // x != 0 + z.mant = z.mant.set(x.abs) + fnorm(z.mant) + z.setExpAndRound(int64(bits), 0) + return z +} + +// SetRat sets z to the (possibly rounded) value of x and returns z. +// If z's precision is 0, it is changed to the largest of a.BitLen(), +// b.BitLen(), or 64; with x = a/b. +func (z *Float) SetRat(x *Rat) *Float { + if x.IsInt() { + return z.SetInt(x.Num()) + } + var a, b Float + a.SetInt(x.Num()) + b.SetInt(x.Denom()) + if z.prec == 0 { + z.prec = umax32(a.prec, b.prec) + } + return z.Quo(&a, &b) +} + +// SetInf sets z to the infinite Float -Inf if signbit is +// set, or +Inf if signbit is not set, and returns z. The +// precision of z is unchanged and the result is always +// Exact. +func (z *Float) SetInf(signbit bool) *Float { + z.acc = Exact + z.form = inf + z.neg = signbit + return z +} + +// Set sets z to the (possibly rounded) value of x and returns z. +// If z's precision is 0, it is changed to the precision of x +// before setting z (and rounding will have no effect). +// Rounding is performed according to z's precision and rounding +// mode; and z's accuracy reports the result error relative to the +// exact (not rounded) result. +func (z *Float) Set(x *Float) *Float { + if debugFloat { + x.validate() + } + z.acc = Exact + if z != x { + z.form = x.form + z.neg = x.neg + if x.form == finite { + z.exp = x.exp + z.mant = z.mant.set(x.mant) + } + if z.prec == 0 { + z.prec = x.prec + } else if z.prec < x.prec { + z.round(0) + } + } + return z +} + +// Copy sets z to x, with the same precision, rounding mode, and +// accuracy as x, and returns z. x is not changed even if z and +// x are the same. +func (z *Float) Copy(x *Float) *Float { + if debugFloat { + x.validate() + } + if z != x { + z.prec = x.prec + z.mode = x.mode + z.acc = x.acc + z.form = x.form + z.neg = x.neg + if z.form == finite { + z.mant = z.mant.set(x.mant) + z.exp = x.exp + } + } + return z +} + +// msb32 returns the 32 most significant bits of x. +func msb32(x nat) uint32 { + i := len(x) - 1 + if i < 0 { + return 0 + } + if debugFloat && x[i]&(1<<(_W-1)) == 0 { + panic("x not normalized") + } + switch _W { + case 32: + return uint32(x[i]) + case 64: + return uint32(x[i] >> 32) + } + panic("unreachable") +} + +// msb64 returns the 64 most significant bits of x. +func msb64(x nat) uint64 { + i := len(x) - 1 + if i < 0 { + return 0 + } + if debugFloat && x[i]&(1<<(_W-1)) == 0 { + panic("x not normalized") + } + switch _W { + case 32: + v := uint64(x[i]) << 32 + if i > 0 { + v |= uint64(x[i-1]) + } + return v + case 64: + return uint64(x[i]) + } + panic("unreachable") +} + +// Uint64 returns the unsigned integer resulting from truncating x +// towards zero. If 0 <= x <= math.MaxUint64, the result is Exact +// if x is an integer and Below otherwise. +// The result is (0, Above) for x < 0, and (math.MaxUint64, Below) +// for x > math.MaxUint64. +func (x *Float) Uint64() (uint64, Accuracy) { + if debugFloat { + x.validate() + } + + switch x.form { + case finite: + if x.neg { + return 0, Above + } + // 0 < x < +Inf + if x.exp <= 0 { + // 0 < x < 1 + return 0, Below + } + // 1 <= x < Inf + if x.exp <= 64 { + // u = trunc(x) fits into a uint64 + u := msb64(x.mant) >> (64 - uint32(x.exp)) + if x.MinPrec() <= 64 { + return u, Exact + } + return u, Below // x truncated + } + // x too large + return math.MaxUint64, Below + + case zero: + return 0, Exact + + case inf: + if x.neg { + return 0, Above + } + return math.MaxUint64, Below + } + + panic("unreachable") +} + +// Int64 returns the integer resulting from truncating x towards zero. +// If math.MinInt64 <= x <= math.MaxInt64, the result is Exact if x is +// an integer, and Above (x < 0) or Below (x > 0) otherwise. +// The result is (math.MinInt64, Above) for x < math.MinInt64, +// and (math.MaxInt64, Below) for x > math.MaxInt64. +func (x *Float) Int64() (int64, Accuracy) { + if debugFloat { + x.validate() + } + + switch x.form { + case finite: + // 0 < |x| < +Inf + acc := makeAcc(x.neg) + if x.exp <= 0 { + // 0 < |x| < 1 + return 0, acc + } + // x.exp > 0 + + // 1 <= |x| < +Inf + if x.exp <= 63 { + // i = trunc(x) fits into an int64 (excluding math.MinInt64) + i := int64(msb64(x.mant) >> (64 - uint32(x.exp))) + if x.neg { + i = -i + } + if x.MinPrec() <= uint(x.exp) { + return i, Exact + } + return i, acc // x truncated + } + if x.neg { + // check for special case x == math.MinInt64 (i.e., x == -(0.5 << 64)) + if x.exp == 64 && x.MinPrec() == 1 { + acc = Exact + } + return math.MinInt64, acc + } + // x too large + return math.MaxInt64, Below + + case zero: + return 0, Exact + + case inf: + if x.neg { + return math.MinInt64, Above + } + return math.MaxInt64, Below + } + + panic("unreachable") +} + +// Float32 returns the float32 value nearest to x. If x is too small to be +// represented by a float32 (|x| < math.SmallestNonzeroFloat32), the result +// is (0, Below) or (-0, Above), respectively, depending on the sign of x. +// If x is too large to be represented by a float32 (|x| > math.MaxFloat32), +// the result is (+Inf, Above) or (-Inf, Below), depending on the sign of x. +func (x *Float) Float32() (float32, Accuracy) { + if debugFloat { + x.validate() + } + + switch x.form { + case finite: + // 0 < |x| < +Inf + + const ( + fbits = 32 // float size + mbits = 23 // mantissa size (excluding implicit msb) + ebits = fbits - mbits - 1 // 8 exponent size + bias = 1<<(ebits-1) - 1 // 127 exponent bias + dmin = 1 - bias - mbits // -149 smallest unbiased exponent (denormal) + emin = 1 - bias // -126 smallest unbiased exponent (normal) + emax = bias // 127 largest unbiased exponent (normal) + ) + + // Float mantissa m is 0.5 <= m < 1.0; compute exponent for floatxx mantissa. + e := x.exp - 1 // exponent for mantissa m with 1.0 <= m < 2.0 + p := mbits + 1 // precision of normal float + + // If the exponent is too small, we may have a denormal number + // in which case we have fewer mantissa bits available: reduce + // precision accordingly. + if e < emin { + p -= emin - int(e) + // Make sure we have at least 1 bit so that we don't + // lose numbers rounded up to the smallest denormal. + if p < 1 { + p = 1 + } + } + + // round + var r Float + r.prec = uint32(p) + r.Set(x) + e = r.exp - 1 + + // Rounding may have caused r to overflow to ±Inf + // (rounding never causes underflows to 0). + if r.form == inf { + e = emax + 1 // cause overflow below + } + + // If the exponent is too large, overflow to ±Inf. + if e > emax { + // overflow + if x.neg { + return float32(math.Inf(-1)), Below + } + return float32(math.Inf(+1)), Above + } + // e <= emax + + // Determine sign, biased exponent, and mantissa. + var sign, bexp, mant uint32 + if x.neg { + sign = 1 << (fbits - 1) + } + + // Rounding may have caused a denormal number to + // become normal. Check again. + if e < emin { + // denormal number + if e < dmin { + // underflow to ±0 + if x.neg { + var z float32 + return -z, Above + } + return 0.0, Below + } + // bexp = 0 + mant = msb32(r.mant) >> (fbits - r.prec) + } else { + // normal number: emin <= e <= emax + bexp = uint32(e+bias) << mbits + mant = msb32(r.mant) >> ebits & (1< math.MaxFloat64), +// the result is (+Inf, Above) or (-Inf, Below), depending on the sign of x. +func (x *Float) Float64() (float64, Accuracy) { + if debugFloat { + x.validate() + } + + switch x.form { + case finite: + // 0 < |x| < +Inf + + const ( + fbits = 64 // float size + mbits = 52 // mantissa size (excluding implicit msb) + ebits = fbits - mbits - 1 // 11 exponent size + bias = 1<<(ebits-1) - 1 // 1023 exponent bias + dmin = 1 - bias - mbits // -1074 smallest unbiased exponent (denormal) + emin = 1 - bias // -1022 smallest unbiased exponent (normal) + emax = bias // 1023 largest unbiased exponent (normal) + ) + + // Float mantissa m is 0.5 <= m < 1.0; compute exponent for floatxx mantissa. + e := x.exp - 1 // exponent for mantissa m with 1.0 <= m < 2.0 + p := mbits + 1 // precision of normal float + + // If the exponent is too small, we may have a denormal number + // in which case we have fewer mantissa bits available: reduce + // precision accordingly. + if e < emin { + p -= emin - int(e) + // Make sure we have at least 1 bit so that we don't + // lose numbers rounded up to the smallest denormal. + if p < 1 { + p = 1 + } + } + + // round + var r Float + r.prec = uint32(p) + r.Set(x) + e = r.exp - 1 + + // Rounding may have caused r to overflow to ±Inf + // (rounding never causes underflows to 0). + if r.form == inf { + e = emax + 1 // cause overflow below + } + + // If the exponent is too large, overflow to ±Inf. + if e > emax { + // overflow + if x.neg { + return math.Inf(-1), Below + } + return math.Inf(+1), Above + } + // e <= emax + + // Determine sign, biased exponent, and mantissa. + var sign, bexp, mant uint64 + if x.neg { + sign = 1 << (fbits - 1) + } + + // Rounding may have caused a denormal number to + // become normal. Check again. + if e < emin { + // denormal number + if e < dmin { + // underflow to ±0 + if x.neg { + var z float64 + return -z, Above + } + return 0.0, Below + } + // bexp = 0 + mant = msb64(r.mant) >> (fbits - r.prec) + } else { + // normal number: emin <= e <= emax + bexp = uint64(e+bias) << mbits + mant = msb64(r.mant) >> ebits & (1< 0, and Above for x < 0. +// If a non-nil *Int argument z is provided, Int stores +// the result in z instead of allocating a new Int. +func (x *Float) Int(z *Int) (*Int, Accuracy) { + if debugFloat { + x.validate() + } + + if z == nil && x.form <= finite { + z = new(Int) + } + + switch x.form { + case finite: + // 0 < |x| < +Inf + acc := makeAcc(x.neg) + if x.exp <= 0 { + // 0 < |x| < 1 + return z.SetInt64(0), acc + } + // x.exp > 0 + + // 1 <= |x| < +Inf + // determine minimum required precision for x + allBits := uint(len(x.mant)) * _W + exp := uint(x.exp) + if x.MinPrec() <= exp { + acc = Exact + } + // shift mantissa as needed + if z == nil { + z = new(Int) + } + z.neg = x.neg + switch { + case exp > allBits: + z.abs = z.abs.shl(x.mant, exp-allBits) + default: + z.abs = z.abs.set(x.mant) + case exp < allBits: + z.abs = z.abs.shr(x.mant, allBits-exp) + } + return z, acc + + case zero: + return z.SetInt64(0), Exact + + case inf: + return nil, makeAcc(x.neg) + } + + panic("unreachable") +} + +// Rat returns the rational number corresponding to x; +// or nil if x is an infinity. +// The result is Exact is x is not an Inf. +// If a non-nil *Rat argument z is provided, Rat stores +// the result in z instead of allocating a new Rat. +func (x *Float) Rat(z *Rat) (*Rat, Accuracy) { + if debugFloat { + x.validate() + } + + if z == nil && x.form <= finite { + z = new(Rat) + } + + switch x.form { + case finite: + // 0 < |x| < +Inf + allBits := int32(len(x.mant)) * _W + // build up numerator and denominator + z.a.neg = x.neg + switch { + case x.exp > allBits: + z.a.abs = z.a.abs.shl(x.mant, uint(x.exp-allBits)) + z.b.abs = z.b.abs[:0] // == 1 (see Rat) + // z already in normal form + default: + z.a.abs = z.a.abs.set(x.mant) + z.b.abs = z.b.abs[:0] // == 1 (see Rat) + // z already in normal form + case x.exp < allBits: + z.a.abs = z.a.abs.set(x.mant) + t := z.b.abs.setUint64(1) + z.b.abs = t.shl(t, uint(allBits-x.exp)) + z.norm() + } + return z, Exact + + case zero: + return z.SetInt64(0), Exact + + case inf: + return nil, makeAcc(x.neg) + } + + panic("unreachable") +} + +// Abs sets z to the (possibly rounded) value |x| (the absolute value of x) +// and returns z. +func (z *Float) Abs(x *Float) *Float { + z.Set(x) + z.neg = false + return z +} + +// Neg sets z to the (possibly rounded) value of x with its sign negated, +// and returns z. +func (z *Float) Neg(x *Float) *Float { + z.Set(x) + z.neg = !z.neg + return z +} + +func validateBinaryOperands(x, y *Float) { + if !debugFloat { + // avoid performance bugs + panic("validateBinaryOperands called but debugFloat is not set") + } + if len(x.mant) == 0 { + panic("empty mantissa for x") + } + if len(y.mant) == 0 { + panic("empty mantissa for y") + } +} + +// z = x + y, ignoring signs of x and y for the addition +// but using the sign of z for rounding the result. +// x and y must have a non-empty mantissa and valid exponent. +func (z *Float) uadd(x, y *Float) { + // Note: This implementation requires 2 shifts most of the + // time. It is also inefficient if exponents or precisions + // differ by wide margins. The following article describes + // an efficient (but much more complicated) implementation + // compatible with the internal representation used here: + // + // Vincent Lefèvre: "The Generic Multiple-Precision Floating- + // Point Addition With Exact Rounding (as in the MPFR Library)" + // http://www.vinc17.net/research/papers/rnc6.pdf + + if debugFloat { + validateBinaryOperands(x, y) + } + + // compute exponents ex, ey for mantissa with "binary point" + // on the right (mantissa.0) - use int64 to avoid overflow + ex := int64(x.exp) - int64(len(x.mant))*_W + ey := int64(y.exp) - int64(len(y.mant))*_W + + // TODO(gri) having a combined add-and-shift primitive + // could make this code significantly faster + switch { + case ex < ey: + // cannot re-use z.mant w/o testing for aliasing + t := nat(nil).shl(y.mant, uint(ey-ex)) + z.mant = z.mant.add(x.mant, t) + default: + // ex == ey, no shift needed + z.mant = z.mant.add(x.mant, y.mant) + case ex > ey: + // cannot re-use z.mant w/o testing for aliasing + t := nat(nil).shl(x.mant, uint(ex-ey)) + z.mant = z.mant.add(t, y.mant) + ex = ey + } + // len(z.mant) > 0 + + z.setExpAndRound(ex+int64(len(z.mant))*_W-fnorm(z.mant), 0) +} + +// z = x - y for |x| > |y|, ignoring signs of x and y for the subtraction +// but using the sign of z for rounding the result. +// x and y must have a non-empty mantissa and valid exponent. +func (z *Float) usub(x, y *Float) { + // This code is symmetric to uadd. + // We have not factored the common code out because + // eventually uadd (and usub) should be optimized + // by special-casing, and the code will diverge. + + if debugFloat { + validateBinaryOperands(x, y) + } + + ex := int64(x.exp) - int64(len(x.mant))*_W + ey := int64(y.exp) - int64(len(y.mant))*_W + + switch { + case ex < ey: + // cannot re-use z.mant w/o testing for aliasing + t := nat(nil).shl(y.mant, uint(ey-ex)) + z.mant = t.sub(x.mant, t) + default: + // ex == ey, no shift needed + z.mant = z.mant.sub(x.mant, y.mant) + case ex > ey: + // cannot re-use z.mant w/o testing for aliasing + t := nat(nil).shl(x.mant, uint(ex-ey)) + z.mant = t.sub(t, y.mant) + ex = ey + } + + // operands may have cancelled each other out + if len(z.mant) == 0 { + z.acc = Exact + z.form = zero + z.neg = false + return + } + // len(z.mant) > 0 + + z.setExpAndRound(ex+int64(len(z.mant))*_W-fnorm(z.mant), 0) +} + +// z = x * y, ignoring signs of x and y for the multiplication +// but using the sign of z for rounding the result. +// x and y must have a non-empty mantissa and valid exponent. +func (z *Float) umul(x, y *Float) { + if debugFloat { + validateBinaryOperands(x, y) + } + + // Note: This is doing too much work if the precision + // of z is less than the sum of the precisions of x + // and y which is often the case (e.g., if all floats + // have the same precision). + // TODO(gri) Optimize this for the common case. + + e := int64(x.exp) + int64(y.exp) + z.mant = z.mant.mul(x.mant, y.mant) + + z.setExpAndRound(e-fnorm(z.mant), 0) +} + +// z = x / y, ignoring signs of x and y for the division +// but using the sign of z for rounding the result. +// x and y must have a non-empty mantissa and valid exponent. +func (z *Float) uquo(x, y *Float) { + if debugFloat { + validateBinaryOperands(x, y) + } + + // mantissa length in words for desired result precision + 1 + // (at least one extra bit so we get the rounding bit after + // the division) + n := int(z.prec/_W) + 1 + + // compute adjusted x.mant such that we get enough result precision + xadj := x.mant + if d := n - len(x.mant) + len(y.mant); d > 0 { + // d extra words needed => add d "0 digits" to x + xadj = make(nat, len(x.mant)+d) + copy(xadj[d:], x.mant) + } + // TODO(gri): If we have too many digits (d < 0), we should be able + // to shorten x for faster division. But we must be extra careful + // with rounding in that case. + + // Compute d before division since there may be aliasing of x.mant + // (via xadj) or y.mant with z.mant. + d := len(xadj) - len(y.mant) + + // divide + var r nat + z.mant, r = z.mant.div(nil, xadj, y.mant) + e := int64(x.exp) - int64(y.exp) - int64(d-len(z.mant))*_W + + // The result is long enough to include (at least) the rounding bit. + // If there's a non-zero remainder, the corresponding fractional part + // (if it were computed), would have a non-zero sticky bit (if it were + // zero, it couldn't have a non-zero remainder). + var sbit uint + if len(r) > 0 { + sbit = 1 + } + + z.setExpAndRound(e-fnorm(z.mant), sbit) +} + +// ucmp returns -1, 0, or +1, depending on whether +// |x| < |y|, |x| == |y|, or |x| > |y|. +// x and y must have a non-empty mantissa and valid exponent. +func (x *Float) ucmp(y *Float) int { + if debugFloat { + validateBinaryOperands(x, y) + } + + switch { + case x.exp < y.exp: + return -1 + case x.exp > y.exp: + return +1 + } + // x.exp == y.exp + + // compare mantissas + i := len(x.mant) + j := len(y.mant) + for i > 0 || j > 0 { + var xm, ym Word + if i > 0 { + i-- + xm = x.mant[i] + } + if j > 0 { + j-- + ym = y.mant[j] + } + switch { + case xm < ym: + return -1 + case xm > ym: + return +1 + } + } + + return 0 +} + +// Handling of sign bit as defined by IEEE 754-2008, section 6.3: +// +// When neither the inputs nor result are NaN, the sign of a product or +// quotient is the exclusive OR of the operands’ signs; the sign of a sum, +// or of a difference x−y regarded as a sum x+(−y), differs from at most +// one of the addends’ signs; and the sign of the result of conversions, +// the quantize operation, the roundToIntegral operations, and the +// roundToIntegralExact (see 5.3.1) is the sign of the first or only operand. +// These rules shall apply even when operands or results are zero or infinite. +// +// When the sum of two operands with opposite signs (or the difference of +// two operands with like signs) is exactly zero, the sign of that sum (or +// difference) shall be +0 in all rounding-direction attributes except +// roundTowardNegative; under that attribute, the sign of an exact zero +// sum (or difference) shall be −0. However, x+x = x−(−x) retains the same +// sign as x even when x is zero. +// +// See also: https://play.golang.org/p/RtH3UCt5IH + +// Add sets z to the rounded sum x+y and returns z. If z's precision is 0, +// it is changed to the larger of x's or y's precision before the operation. +// Rounding is performed according to z's precision and rounding mode; and +// z's accuracy reports the result error relative to the exact (not rounded) +// result. Add panics with ErrNaN if x and y are infinities with opposite +// signs. The value of z is undefined in that case. +// +// BUG(gri) When rounding ToNegativeInf, the sign of Float values rounded to 0 is incorrect. +func (z *Float) Add(x, y *Float) *Float { + if debugFloat { + x.validate() + y.validate() + } + + if z.prec == 0 { + z.prec = umax32(x.prec, y.prec) + } + + if x.form == finite && y.form == finite { + // x + y (commom case) + z.neg = x.neg + if x.neg == y.neg { + // x + y == x + y + // (-x) + (-y) == -(x + y) + z.uadd(x, y) + } else { + // x + (-y) == x - y == -(y - x) + // (-x) + y == y - x == -(x - y) + if x.ucmp(y) > 0 { + z.usub(x, y) + } else { + z.neg = !z.neg + z.usub(y, x) + } + } + return z + } + + if x.form == inf && y.form == inf && x.neg != y.neg { + // +Inf + -Inf + // -Inf + +Inf + // value of z is undefined but make sure it's valid + z.acc = Exact + z.form = zero + z.neg = false + panic(ErrNaN{"addition of infinities with opposite signs"}) + } + + if x.form == zero && y.form == zero { + // ±0 + ±0 + z.acc = Exact + z.form = zero + z.neg = x.neg && y.neg // -0 + -0 == -0 + return z + } + + if x.form == inf || y.form == zero { + // ±Inf + y + // x + ±0 + return z.Set(x) + } + + // ±0 + y + // x + ±Inf + return z.Set(y) +} + +// Sub sets z to the rounded difference x-y and returns z. +// Precision, rounding, and accuracy reporting are as for Add. +// Sub panics with ErrNaN if x and y are infinities with equal +// signs. The value of z is undefined in that case. +func (z *Float) Sub(x, y *Float) *Float { + if debugFloat { + x.validate() + y.validate() + } + + if z.prec == 0 { + z.prec = umax32(x.prec, y.prec) + } + + if x.form == finite && y.form == finite { + // x - y (common case) + z.neg = x.neg + if x.neg != y.neg { + // x - (-y) == x + y + // (-x) - y == -(x + y) + z.uadd(x, y) + } else { + // x - y == x - y == -(y - x) + // (-x) - (-y) == y - x == -(x - y) + if x.ucmp(y) > 0 { + z.usub(x, y) + } else { + z.neg = !z.neg + z.usub(y, x) + } + } + return z + } + + if x.form == inf && y.form == inf && x.neg == y.neg { + // +Inf - +Inf + // -Inf - -Inf + // value of z is undefined but make sure it's valid + z.acc = Exact + z.form = zero + z.neg = false + panic(ErrNaN{"subtraction of infinities with equal signs"}) + } + + if x.form == zero && y.form == zero { + // ±0 - ±0 + z.acc = Exact + z.form = zero + z.neg = x.neg && !y.neg // -0 - +0 == -0 + return z + } + + if x.form == inf || y.form == zero { + // ±Inf - y + // x - ±0 + return z.Set(x) + } + + // ±0 - y + // x - ±Inf + return z.Neg(y) +} + +// Mul sets z to the rounded product x*y and returns z. +// Precision, rounding, and accuracy reporting are as for Add. +// Mul panics with ErrNaN if one operand is zero and the other +// operand an infinity. The value of z is undefined in that case. +func (z *Float) Mul(x, y *Float) *Float { + if debugFloat { + x.validate() + y.validate() + } + + if z.prec == 0 { + z.prec = umax32(x.prec, y.prec) + } + + z.neg = x.neg != y.neg + + if x.form == finite && y.form == finite { + // x * y (common case) + z.umul(x, y) + return z + } + + z.acc = Exact + if x.form == zero && y.form == inf || x.form == inf && y.form == zero { + // ±0 * ±Inf + // ±Inf * ±0 + // value of z is undefined but make sure it's valid + z.form = zero + z.neg = false + panic(ErrNaN{"multiplication of zero with infinity"}) + } + + if x.form == inf || y.form == inf { + // ±Inf * y + // x * ±Inf + z.form = inf + return z + } + + // ±0 * y + // x * ±0 + z.form = zero + return z +} + +// Quo sets z to the rounded quotient x/y and returns z. +// Precision, rounding, and accuracy reporting are as for Add. +// Quo panics with ErrNaN if both operands are zero or infinities. +// The value of z is undefined in that case. +func (z *Float) Quo(x, y *Float) *Float { + if debugFloat { + x.validate() + y.validate() + } + + if z.prec == 0 { + z.prec = umax32(x.prec, y.prec) + } + + z.neg = x.neg != y.neg + + if x.form == finite && y.form == finite { + // x / y (common case) + z.uquo(x, y) + return z + } + + z.acc = Exact + if x.form == zero && y.form == zero || x.form == inf && y.form == inf { + // ±0 / ±0 + // ±Inf / ±Inf + // value of z is undefined but make sure it's valid + z.form = zero + z.neg = false + panic(ErrNaN{"division of zero by zero or infinity by infinity"}) + } + + if x.form == zero || y.form == inf { + // ±0 / y + // x / ±Inf + z.form = zero + return z + } + + // x / ±0 + // ±Inf / y + z.form = inf + return z +} + +// Cmp compares x and y and returns: +// +// -1 if x < y +// 0 if x == y (incl. -0 == 0, -Inf == -Inf, and +Inf == +Inf) +// +1 if x > y +// +func (x *Float) Cmp(y *Float) int { + if debugFloat { + x.validate() + y.validate() + } + + mx := x.ord() + my := y.ord() + switch { + case mx < my: + return -1 + case mx > my: + return +1 + } + // mx == my + + // only if |mx| == 1 we have to compare the mantissae + switch mx { + case -1: + return y.ucmp(x) + case +1: + return x.ucmp(y) + } + + return 0 +} + +// ord classifies x and returns: +// +// -2 if -Inf == x +// -1 if -Inf < x < 0 +// 0 if x == 0 (signed or unsigned) +// +1 if 0 < x < +Inf +// +2 if x == +Inf +// +func (x *Float) ord() int { + var m int + switch x.form { + case finite: + m = 1 + case zero: + return 0 + case inf: + m = 2 + } + if x.neg { + m = -m + } + return m +} + +func umax32(x, y uint32) uint32 { + if x > y { + return x + } + return y +} diff --git a/src/cmd/compile/internal/big/float_test.go b/src/cmd/compile/internal/big/float_test.go new file mode 100644 index 0000000000000000000000000000000000000000..d3b214b631db1e3b5c437a7daa1e5a4855a44a7f --- /dev/null +++ b/src/cmd/compile/internal/big/float_test.go @@ -0,0 +1,1694 @@ +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package big + +import ( + "fmt" + "math" + "strconv" + "strings" + "testing" +) + +// Verify that ErrNaN implements the error interface. +var _ error = ErrNaN{} + +func (x *Float) uint64() uint64 { + u, acc := x.Uint64() + if acc != Exact { + panic(fmt.Sprintf("%s is not a uint64", x.Text('g', 10))) + } + return u +} + +func (x *Float) int64() int64 { + i, acc := x.Int64() + if acc != Exact { + panic(fmt.Sprintf("%s is not an int64", x.Text('g', 10))) + } + return i +} + +func TestFloatZeroValue(t *testing.T) { + // zero (uninitialized) value is a ready-to-use 0.0 + var x Float + if s := x.Text('f', 1); s != "0.0" { + t.Errorf("zero value = %s; want 0.0", s) + } + + // zero value has precision 0 + if prec := x.Prec(); prec != 0 { + t.Errorf("prec = %d; want 0", prec) + } + + // zero value can be used in any and all positions of binary operations + make := func(x int) *Float { + var f Float + if x != 0 { + f.SetInt64(int64(x)) + } + // x == 0 translates into the zero value + return &f + } + for _, test := range []struct { + z, x, y, want int + opname rune + op func(z, x, y *Float) *Float + }{ + {0, 0, 0, 0, '+', (*Float).Add}, + {0, 1, 2, 3, '+', (*Float).Add}, + {1, 2, 0, 2, '+', (*Float).Add}, + {2, 0, 1, 1, '+', (*Float).Add}, + + {0, 0, 0, 0, '-', (*Float).Sub}, + {0, 1, 2, -1, '-', (*Float).Sub}, + {1, 2, 0, 2, '-', (*Float).Sub}, + {2, 0, 1, -1, '-', (*Float).Sub}, + + {0, 0, 0, 0, '*', (*Float).Mul}, + {0, 1, 2, 2, '*', (*Float).Mul}, + {1, 2, 0, 0, '*', (*Float).Mul}, + {2, 0, 1, 0, '*', (*Float).Mul}, + + // {0, 0, 0, 0, '/', (*Float).Quo}, // panics + {0, 2, 1, 2, '/', (*Float).Quo}, + {1, 2, 0, 0, '/', (*Float).Quo}, // = +Inf + {2, 0, 1, 0, '/', (*Float).Quo}, + } { + z := make(test.z) + test.op(z, make(test.x), make(test.y)) + got := 0 + if !z.IsInf() { + got = int(z.int64()) + } + if got != test.want { + t.Errorf("%d %c %d = %d; want %d", test.x, test.opname, test.y, got, test.want) + } + } + + // TODO(gri) test how precision is set for zero value results +} + +func makeFloat(s string) *Float { + x, _, err := ParseFloat(s, 0, 1000, ToNearestEven) + if err != nil { + panic(err) + } + return x +} + +func TestFloatSetPrec(t *testing.T) { + for _, test := range []struct { + x string + prec uint + want string + acc Accuracy + }{ + // prec 0 + {"0", 0, "0", Exact}, + {"-0", 0, "-0", Exact}, + {"-Inf", 0, "-Inf", Exact}, + {"+Inf", 0, "+Inf", Exact}, + {"123", 0, "0", Below}, + {"-123", 0, "-0", Above}, + + // prec at upper limit + {"0", MaxPrec, "0", Exact}, + {"-0", MaxPrec, "-0", Exact}, + {"-Inf", MaxPrec, "-Inf", Exact}, + {"+Inf", MaxPrec, "+Inf", Exact}, + + // just a few regular cases - general rounding is tested elsewhere + {"1.5", 1, "2", Above}, + {"-1.5", 1, "-2", Below}, + {"123", 1e6, "123", Exact}, + {"-123", 1e6, "-123", Exact}, + } { + x := makeFloat(test.x).SetPrec(test.prec) + prec := test.prec + if prec > MaxPrec { + prec = MaxPrec + } + if got := x.Prec(); got != prec { + t.Errorf("%s.SetPrec(%d).Prec() == %d; want %d", test.x, test.prec, got, prec) + } + if got, acc := x.String(), x.Acc(); got != test.want || acc != test.acc { + t.Errorf("%s.SetPrec(%d) = %s (%s); want %s (%s)", test.x, test.prec, got, acc, test.want, test.acc) + } + } +} + +func TestFloatMinPrec(t *testing.T) { + const max = 100 + for _, test := range []struct { + x string + want uint + }{ + {"0", 0}, + {"-0", 0}, + {"+Inf", 0}, + {"-Inf", 0}, + {"1", 1}, + {"2", 1}, + {"3", 2}, + {"0x8001", 16}, + {"0x8001p-1000", 16}, + {"0x8001p+1000", 16}, + {"0.1", max}, + } { + x := makeFloat(test.x).SetPrec(max) + if got := x.MinPrec(); got != test.want { + t.Errorf("%s.MinPrec() = %d; want %d", test.x, got, test.want) + } + } +} + +func TestFloatSign(t *testing.T) { + for _, test := range []struct { + x string + s int + }{ + {"-Inf", -1}, + {"-1", -1}, + {"-0", 0}, + {"+0", 0}, + {"+1", +1}, + {"+Inf", +1}, + } { + x := makeFloat(test.x) + s := x.Sign() + if s != test.s { + t.Errorf("%s.Sign() = %d; want %d", test.x, s, test.s) + } + } +} + +// alike(x, y) is like x.Cmp(y) == 0 but also considers the sign of 0 (0 != -0). +func alike(x, y *Float) bool { + return x.Cmp(y) == 0 && x.Signbit() == y.Signbit() +} + +func alike32(x, y float32) bool { + // we can ignore NaNs + return x == y && math.Signbit(float64(x)) == math.Signbit(float64(y)) + +} + +func alike64(x, y float64) bool { + // we can ignore NaNs + return x == y && math.Signbit(x) == math.Signbit(y) + +} + +func TestFloatMantExp(t *testing.T) { + for _, test := range []struct { + x string + mant string + exp int + }{ + {"0", "0", 0}, + {"+0", "0", 0}, + {"-0", "-0", 0}, + {"Inf", "+Inf", 0}, + {"+Inf", "+Inf", 0}, + {"-Inf", "-Inf", 0}, + {"1.5", "0.75", 1}, + {"1.024e3", "0.5", 11}, + {"-0.125", "-0.5", -2}, + } { + x := makeFloat(test.x) + mant := makeFloat(test.mant) + m := new(Float) + e := x.MantExp(m) + if !alike(m, mant) || e != test.exp { + t.Errorf("%s.MantExp() = %s, %d; want %s, %d", test.x, m.Text('g', 10), e, test.mant, test.exp) + } + } +} + +func TestFloatMantExpAliasing(t *testing.T) { + x := makeFloat("0.5p10") + if e := x.MantExp(x); e != 10 { + t.Fatalf("Float.MantExp aliasing error: got %d; want 10", e) + } + if want := makeFloat("0.5"); !alike(x, want) { + t.Fatalf("Float.MantExp aliasing error: got %s; want %s", x.Text('g', 10), want.Text('g', 10)) + } +} + +func TestFloatSetMantExp(t *testing.T) { + for _, test := range []struct { + frac string + exp int + z string + }{ + {"0", 0, "0"}, + {"+0", 0, "0"}, + {"-0", 0, "-0"}, + {"Inf", 1234, "+Inf"}, + {"+Inf", -1234, "+Inf"}, + {"-Inf", -1234, "-Inf"}, + {"0", MinExp, "0"}, + {"0.25", MinExp, "+0"}, // exponent underflow + {"-0.25", MinExp, "-0"}, // exponent underflow + {"1", MaxExp, "+Inf"}, // exponent overflow + {"2", MaxExp - 1, "+Inf"}, // exponent overflow + {"0.75", 1, "1.5"}, + {"0.5", 11, "1024"}, + {"-0.5", -2, "-0.125"}, + {"32", 5, "1024"}, + {"1024", -10, "1"}, + } { + frac := makeFloat(test.frac) + want := makeFloat(test.z) + var z Float + z.SetMantExp(frac, test.exp) + if !alike(&z, want) { + t.Errorf("SetMantExp(%s, %d) = %s; want %s", test.frac, test.exp, z.Text('g', 10), test.z) + } + // test inverse property + mant := new(Float) + if z.SetMantExp(mant, want.MantExp(mant)).Cmp(want) != 0 { + t.Errorf("Inverse property not satisfied: got %s; want %s", z.Text('g', 10), test.z) + } + } +} + +func TestFloatPredicates(t *testing.T) { + for _, test := range []struct { + x string + sign int + signbit, inf bool + }{ + {x: "-Inf", sign: -1, signbit: true, inf: true}, + {x: "-1", sign: -1, signbit: true}, + {x: "-0", signbit: true}, + {x: "0"}, + {x: "1", sign: 1}, + {x: "+Inf", sign: 1, inf: true}, + } { + x := makeFloat(test.x) + if got := x.Signbit(); got != test.signbit { + t.Errorf("(%s).Signbit() = %v; want %v", test.x, got, test.signbit) + } + if got := x.Sign(); got != test.sign { + t.Errorf("(%s).Sign() = %d; want %d", test.x, got, test.sign) + } + if got := x.IsInf(); got != test.inf { + t.Errorf("(%s).IsInf() = %v; want %v", test.x, got, test.inf) + } + } +} + +func TestFloatIsInt(t *testing.T) { + for _, test := range []string{ + "0 int", + "-0 int", + "1 int", + "-1 int", + "0.5", + "1.23", + "1.23e1", + "1.23e2 int", + "0.000000001e+8", + "0.000000001e+9 int", + "1.2345e200 int", + "Inf", + "+Inf", + "-Inf", + } { + s := strings.TrimSuffix(test, " int") + want := s != test + if got := makeFloat(s).IsInt(); got != want { + t.Errorf("%s.IsInt() == %t", s, got) + } + } +} + +func fromBinary(s string) int64 { + x, err := strconv.ParseInt(s, 2, 64) + if err != nil { + panic(err) + } + return x +} + +func toBinary(x int64) string { + return strconv.FormatInt(x, 2) +} + +func testFloatRound(t *testing.T, x, r int64, prec uint, mode RoundingMode) { + // verify test data + var ok bool + switch mode { + case ToNearestEven, ToNearestAway: + ok = true // nothing to do for now + case ToZero: + if x < 0 { + ok = r >= x + } else { + ok = r <= x + } + case AwayFromZero: + if x < 0 { + ok = r <= x + } else { + ok = r >= x + } + case ToNegativeInf: + ok = r <= x + case ToPositiveInf: + ok = r >= x + default: + panic("unreachable") + } + if !ok { + t.Fatalf("incorrect test data for prec = %d, %s: x = %s, r = %s", prec, mode, toBinary(x), toBinary(r)) + } + + // compute expected accuracy + a := Exact + switch { + case r < x: + a = Below + case r > x: + a = Above + } + + // round + f := new(Float).SetMode(mode).SetInt64(x).SetPrec(prec) + + // check result + r1 := f.int64() + p1 := f.Prec() + a1 := f.Acc() + if r1 != r || p1 != prec || a1 != a { + t.Errorf("round %s (%d bits, %s) incorrect: got %s (%d bits, %s); want %s (%d bits, %s)", + toBinary(x), prec, mode, + toBinary(r1), p1, a1, + toBinary(r), prec, a) + return + } + + // g and f should be the same + // (rounding by SetPrec after SetInt64 using default precision + // should be the same as rounding by SetInt64 after setting the + // precision) + g := new(Float).SetMode(mode).SetPrec(prec).SetInt64(x) + if !alike(g, f) { + t.Errorf("round %s (%d bits, %s) not symmetric: got %s and %s; want %s", + toBinary(x), prec, mode, + toBinary(g.int64()), + toBinary(r1), + toBinary(r), + ) + return + } + + // h and f should be the same + // (repeated rounding should be idempotent) + h := new(Float).SetMode(mode).SetPrec(prec).Set(f) + if !alike(h, f) { + t.Errorf("round %s (%d bits, %s) not idempotent: got %s and %s; want %s", + toBinary(x), prec, mode, + toBinary(h.int64()), + toBinary(r1), + toBinary(r), + ) + return + } +} + +// TestFloatRound tests basic rounding. +func TestFloatRound(t *testing.T) { + for _, test := range []struct { + prec uint + x, zero, neven, naway, away string // input, results rounded to prec bits + }{ + {5, "1000", "1000", "1000", "1000", "1000"}, + {5, "1001", "1001", "1001", "1001", "1001"}, + {5, "1010", "1010", "1010", "1010", "1010"}, + {5, "1011", "1011", "1011", "1011", "1011"}, + {5, "1100", "1100", "1100", "1100", "1100"}, + {5, "1101", "1101", "1101", "1101", "1101"}, + {5, "1110", "1110", "1110", "1110", "1110"}, + {5, "1111", "1111", "1111", "1111", "1111"}, + + {4, "1000", "1000", "1000", "1000", "1000"}, + {4, "1001", "1001", "1001", "1001", "1001"}, + {4, "1010", "1010", "1010", "1010", "1010"}, + {4, "1011", "1011", "1011", "1011", "1011"}, + {4, "1100", "1100", "1100", "1100", "1100"}, + {4, "1101", "1101", "1101", "1101", "1101"}, + {4, "1110", "1110", "1110", "1110", "1110"}, + {4, "1111", "1111", "1111", "1111", "1111"}, + + {3, "1000", "1000", "1000", "1000", "1000"}, + {3, "1001", "1000", "1000", "1010", "1010"}, + {3, "1010", "1010", "1010", "1010", "1010"}, + {3, "1011", "1010", "1100", "1100", "1100"}, + {3, "1100", "1100", "1100", "1100", "1100"}, + {3, "1101", "1100", "1100", "1110", "1110"}, + {3, "1110", "1110", "1110", "1110", "1110"}, + {3, "1111", "1110", "10000", "10000", "10000"}, + + {3, "1000001", "1000000", "1000000", "1000000", "1010000"}, + {3, "1001001", "1000000", "1010000", "1010000", "1010000"}, + {3, "1010001", "1010000", "1010000", "1010000", "1100000"}, + {3, "1011001", "1010000", "1100000", "1100000", "1100000"}, + {3, "1100001", "1100000", "1100000", "1100000", "1110000"}, + {3, "1101001", "1100000", "1110000", "1110000", "1110000"}, + {3, "1110001", "1110000", "1110000", "1110000", "10000000"}, + {3, "1111001", "1110000", "10000000", "10000000", "10000000"}, + + {2, "1000", "1000", "1000", "1000", "1000"}, + {2, "1001", "1000", "1000", "1000", "1100"}, + {2, "1010", "1000", "1000", "1100", "1100"}, + {2, "1011", "1000", "1100", "1100", "1100"}, + {2, "1100", "1100", "1100", "1100", "1100"}, + {2, "1101", "1100", "1100", "1100", "10000"}, + {2, "1110", "1100", "10000", "10000", "10000"}, + {2, "1111", "1100", "10000", "10000", "10000"}, + + {2, "1000001", "1000000", "1000000", "1000000", "1100000"}, + {2, "1001001", "1000000", "1000000", "1000000", "1100000"}, + {2, "1010001", "1000000", "1100000", "1100000", "1100000"}, + {2, "1011001", "1000000", "1100000", "1100000", "1100000"}, + {2, "1100001", "1100000", "1100000", "1100000", "10000000"}, + {2, "1101001", "1100000", "1100000", "1100000", "10000000"}, + {2, "1110001", "1100000", "10000000", "10000000", "10000000"}, + {2, "1111001", "1100000", "10000000", "10000000", "10000000"}, + + {1, "1000", "1000", "1000", "1000", "1000"}, + {1, "1001", "1000", "1000", "1000", "10000"}, + {1, "1010", "1000", "1000", "1000", "10000"}, + {1, "1011", "1000", "1000", "1000", "10000"}, + {1, "1100", "1000", "10000", "10000", "10000"}, + {1, "1101", "1000", "10000", "10000", "10000"}, + {1, "1110", "1000", "10000", "10000", "10000"}, + {1, "1111", "1000", "10000", "10000", "10000"}, + + {1, "1000001", "1000000", "1000000", "1000000", "10000000"}, + {1, "1001001", "1000000", "1000000", "1000000", "10000000"}, + {1, "1010001", "1000000", "1000000", "1000000", "10000000"}, + {1, "1011001", "1000000", "1000000", "1000000", "10000000"}, + {1, "1100001", "1000000", "10000000", "10000000", "10000000"}, + {1, "1101001", "1000000", "10000000", "10000000", "10000000"}, + {1, "1110001", "1000000", "10000000", "10000000", "10000000"}, + {1, "1111001", "1000000", "10000000", "10000000", "10000000"}, + } { + x := fromBinary(test.x) + z := fromBinary(test.zero) + e := fromBinary(test.neven) + n := fromBinary(test.naway) + a := fromBinary(test.away) + prec := test.prec + + testFloatRound(t, x, z, prec, ToZero) + testFloatRound(t, x, e, prec, ToNearestEven) + testFloatRound(t, x, n, prec, ToNearestAway) + testFloatRound(t, x, a, prec, AwayFromZero) + + testFloatRound(t, x, z, prec, ToNegativeInf) + testFloatRound(t, x, a, prec, ToPositiveInf) + + testFloatRound(t, -x, -a, prec, ToNegativeInf) + testFloatRound(t, -x, -z, prec, ToPositiveInf) + } +} + +// TestFloatRound24 tests that rounding a float64 to 24 bits +// matches IEEE-754 rounding to nearest when converting a +// float64 to a float32 (excluding denormal numbers). +func TestFloatRound24(t *testing.T) { + const x0 = 1<<26 - 0x10 // 11...110000 (26 bits) + for d := 0; d <= 0x10; d++ { + x := float64(x0 + d) + f := new(Float).SetPrec(24).SetFloat64(x) + got, _ := f.Float32() + want := float32(x) + if got != want { + t.Errorf("Round(%g, 24) = %g; want %g", x, got, want) + } + } +} + +func TestFloatSetUint64(t *testing.T) { + for _, want := range []uint64{ + 0, + 1, + 2, + 10, + 100, + 1<<32 - 1, + 1 << 32, + 1<<64 - 1, + } { + var f Float + f.SetUint64(want) + if got := f.uint64(); got != want { + t.Errorf("got %#x (%s); want %#x", got, f.Text('p', 0), want) + } + } + + // test basic rounding behavior (exhaustive rounding testing is done elsewhere) + const x uint64 = 0x8765432187654321 // 64 bits needed + for prec := uint(1); prec <= 64; prec++ { + f := new(Float).SetPrec(prec).SetMode(ToZero).SetUint64(x) + got := f.uint64() + want := x &^ (1<<(64-prec) - 1) // cut off (round to zero) low 64-prec bits + if got != want { + t.Errorf("got %#x (%s); want %#x", got, f.Text('p', 0), want) + } + } +} + +func TestFloatSetInt64(t *testing.T) { + for _, want := range []int64{ + 0, + 1, + 2, + 10, + 100, + 1<<32 - 1, + 1 << 32, + 1<<63 - 1, + } { + for i := range [2]int{} { + if i&1 != 0 { + want = -want + } + var f Float + f.SetInt64(want) + if got := f.int64(); got != want { + t.Errorf("got %#x (%s); want %#x", got, f.Text('p', 0), want) + } + } + } + + // test basic rounding behavior (exhaustive rounding testing is done elsewhere) + const x int64 = 0x7654321076543210 // 63 bits needed + for prec := uint(1); prec <= 63; prec++ { + f := new(Float).SetPrec(prec).SetMode(ToZero).SetInt64(x) + got := f.int64() + want := x &^ (1<<(63-prec) - 1) // cut off (round to zero) low 63-prec bits + if got != want { + t.Errorf("got %#x (%s); want %#x", got, f.Text('p', 0), want) + } + } +} + +func TestFloatSetFloat64(t *testing.T) { + for _, want := range []float64{ + 0, + 1, + 2, + 12345, + 1e10, + 1e100, + 3.14159265e10, + 2.718281828e-123, + 1.0 / 3, + math.MaxFloat32, + math.MaxFloat64, + math.SmallestNonzeroFloat32, + math.SmallestNonzeroFloat64, + math.Inf(-1), + math.Inf(0), + -math.Inf(1), + } { + for i := range [2]int{} { + if i&1 != 0 { + want = -want + } + var f Float + f.SetFloat64(want) + if got, acc := f.Float64(); got != want || acc != Exact { + t.Errorf("got %g (%s, %s); want %g (Exact)", got, f.Text('p', 0), acc, want) + } + } + } + + // test basic rounding behavior (exhaustive rounding testing is done elsewhere) + const x uint64 = 0x8765432143218 // 53 bits needed + for prec := uint(1); prec <= 52; prec++ { + f := new(Float).SetPrec(prec).SetMode(ToZero).SetFloat64(float64(x)) + got, _ := f.Float64() + want := float64(x &^ (1<<(52-prec) - 1)) // cut off (round to zero) low 53-prec bits + if got != want { + t.Errorf("got %g (%s); want %g", got, f.Text('p', 0), want) + } + } + + // test NaN + defer func() { + if p, ok := recover().(ErrNaN); !ok { + t.Errorf("got %v; want ErrNaN panic", p) + } + }() + var f Float + f.SetFloat64(math.NaN()) + // should not reach here + t.Errorf("got %s; want ErrNaN panic", f.Text('p', 0)) +} + +func TestFloatSetInt(t *testing.T) { + for _, want := range []string{ + "0", + "1", + "-1", + "1234567890", + "123456789012345678901234567890", + "123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", + } { + var x Int + _, ok := x.SetString(want, 0) + if !ok { + t.Errorf("invalid integer %s", want) + continue + } + n := x.BitLen() + + var f Float + f.SetInt(&x) + + // check precision + if n < 64 { + n = 64 + } + if prec := f.Prec(); prec != uint(n) { + t.Errorf("got prec = %d; want %d", prec, n) + } + + // check value + got := f.Text('g', 100) + if got != want { + t.Errorf("got %s (%s); want %s", got, f.Text('p', 0), want) + } + } + + // TODO(gri) test basic rounding behavior +} + +func TestFloatSetRat(t *testing.T) { + for _, want := range []string{ + "0", + "1", + "-1", + "1234567890", + "123456789012345678901234567890", + "123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", + "1.2", + "3.14159265", + // TODO(gri) expand + } { + var x Rat + _, ok := x.SetString(want) + if !ok { + t.Errorf("invalid fraction %s", want) + continue + } + n := max(x.Num().BitLen(), x.Denom().BitLen()) + + var f1, f2 Float + f2.SetPrec(1000) + f1.SetRat(&x) + f2.SetRat(&x) + + // check precision when set automatically + if n < 64 { + n = 64 + } + if prec := f1.Prec(); prec != uint(n) { + t.Errorf("got prec = %d; want %d", prec, n) + } + + got := f2.Text('g', 100) + if got != want { + t.Errorf("got %s (%s); want %s", got, f2.Text('p', 0), want) + } + } +} + +func TestFloatSetInf(t *testing.T) { + var f Float + for _, test := range []struct { + signbit bool + prec uint + want string + }{ + {false, 0, "+Inf"}, + {true, 0, "-Inf"}, + {false, 10, "+Inf"}, + {true, 30, "-Inf"}, + } { + x := f.SetPrec(test.prec).SetInf(test.signbit) + if got := x.String(); got != test.want || x.Prec() != test.prec { + t.Errorf("SetInf(%v) = %s (prec = %d); want %s (prec = %d)", test.signbit, got, x.Prec(), test.want, test.prec) + } + } +} + +func TestFloatUint64(t *testing.T) { + for _, test := range []struct { + x string + out uint64 + acc Accuracy + }{ + {"-Inf", 0, Above}, + {"-1", 0, Above}, + {"-1e-1000", 0, Above}, + {"-0", 0, Exact}, + {"0", 0, Exact}, + {"1e-1000", 0, Below}, + {"1", 1, Exact}, + {"1.000000000000000000001", 1, Below}, + {"12345.0", 12345, Exact}, + {"12345.000000000000000000001", 12345, Below}, + {"18446744073709551615", 18446744073709551615, Exact}, + {"18446744073709551615.000000000000000000001", math.MaxUint64, Below}, + {"18446744073709551616", math.MaxUint64, Below}, + {"1e10000", math.MaxUint64, Below}, + {"+Inf", math.MaxUint64, Below}, + } { + x := makeFloat(test.x) + out, acc := x.Uint64() + if out != test.out || acc != test.acc { + t.Errorf("%s: got %d (%s); want %d (%s)", test.x, out, acc, test.out, test.acc) + } + } +} + +func TestFloatInt64(t *testing.T) { + for _, test := range []struct { + x string + out int64 + acc Accuracy + }{ + {"-Inf", math.MinInt64, Above}, + {"-1e10000", math.MinInt64, Above}, + {"-9223372036854775809", math.MinInt64, Above}, + {"-9223372036854775808.000000000000000000001", math.MinInt64, Above}, + {"-9223372036854775808", -9223372036854775808, Exact}, + {"-9223372036854775807.000000000000000000001", -9223372036854775807, Above}, + {"-9223372036854775807", -9223372036854775807, Exact}, + {"-12345.000000000000000000001", -12345, Above}, + {"-12345.0", -12345, Exact}, + {"-1.000000000000000000001", -1, Above}, + {"-1.5", -1, Above}, + {"-1", -1, Exact}, + {"-1e-1000", 0, Above}, + {"0", 0, Exact}, + {"1e-1000", 0, Below}, + {"1", 1, Exact}, + {"1.000000000000000000001", 1, Below}, + {"1.5", 1, Below}, + {"12345.0", 12345, Exact}, + {"12345.000000000000000000001", 12345, Below}, + {"9223372036854775807", 9223372036854775807, Exact}, + {"9223372036854775807.000000000000000000001", math.MaxInt64, Below}, + {"9223372036854775808", math.MaxInt64, Below}, + {"1e10000", math.MaxInt64, Below}, + {"+Inf", math.MaxInt64, Below}, + } { + x := makeFloat(test.x) + out, acc := x.Int64() + if out != test.out || acc != test.acc { + t.Errorf("%s: got %d (%s); want %d (%s)", test.x, out, acc, test.out, test.acc) + } + } +} + +func TestFloatFloat32(t *testing.T) { + for _, test := range []struct { + x string + out float32 + acc Accuracy + }{ + {"0", 0, Exact}, + + // underflow + {"1e-1000", 0, Below}, + {"0x0.000002p-127", 0, Below}, + {"0x.0000010p-126", 0, Below}, + + // denormals + {"1.401298464e-45", math.SmallestNonzeroFloat32, Above}, // rounded up to smallest denormal + {"0x.ffffff8p-149", math.SmallestNonzeroFloat32, Above}, // rounded up to smallest denormal + {"0x.0000018p-126", math.SmallestNonzeroFloat32, Above}, // rounded up to smallest denormal + {"0x.0000020p-126", math.SmallestNonzeroFloat32, Exact}, + {"0x.8p-148", math.SmallestNonzeroFloat32, Exact}, + {"1p-149", math.SmallestNonzeroFloat32, Exact}, + {"0x.fffffep-126", math.Float32frombits(0x7fffff), Exact}, // largest denormal + + // normals + {"0x.ffffffp-126", math.Float32frombits(0x00800000), Above}, // rounded up to smallest normal + {"1p-126", math.Float32frombits(0x00800000), Exact}, // smallest normal + {"0x1.fffffep-126", math.Float32frombits(0x00ffffff), Exact}, + {"0x1.ffffffp-126", math.Float32frombits(0x01000000), Above}, // rounded up + {"1", 1, Exact}, + {"1.000000000000000000001", 1, Below}, + {"12345.0", 12345, Exact}, + {"12345.000000000000000000001", 12345, Below}, + {"0x1.fffffe0p127", math.MaxFloat32, Exact}, + {"0x1.fffffe8p127", math.MaxFloat32, Below}, + + // overflow + {"0x1.ffffff0p127", float32(math.Inf(+1)), Above}, + {"0x1p128", float32(math.Inf(+1)), Above}, + {"1e10000", float32(math.Inf(+1)), Above}, + {"0x1.ffffff0p2147483646", float32(math.Inf(+1)), Above}, // overflow in rounding + + // inf + {"Inf", float32(math.Inf(+1)), Exact}, + } { + for i := 0; i < 2; i++ { + // test both signs + tx, tout, tacc := test.x, test.out, test.acc + if i != 0 { + tx = "-" + tx + tout = -tout + tacc = -tacc + } + + // conversion should match strconv where syntax is agreeable + if f, err := strconv.ParseFloat(tx, 32); err == nil && !alike32(float32(f), tout) { + t.Errorf("%s: got %g; want %g (incorrect test data)", tx, f, tout) + } + + x := makeFloat(tx) + out, acc := x.Float32() + if !alike32(out, tout) || acc != tacc { + t.Errorf("%s: got %g (%#x, %s); want %g (%#x, %s)", tx, out, math.Float32bits(out), acc, test.out, math.Float32bits(test.out), tacc) + } + + // test that x.SetFloat64(float64(f)).Float32() == f + var x2 Float + out2, acc2 := x2.SetFloat64(float64(out)).Float32() + if !alike32(out2, out) || acc2 != Exact { + t.Errorf("idempotency test: got %g (%s); want %g (Exact)", out2, acc2, out) + } + } + } +} + +func TestFloatFloat64(t *testing.T) { + const smallestNormalFloat64 = 2.2250738585072014e-308 // 1p-1022 + for _, test := range []struct { + x string + out float64 + acc Accuracy + }{ + {"0", 0, Exact}, + + // underflow + {"1e-1000", 0, Below}, + {"0x0.0000000000001p-1023", 0, Below}, + {"0x0.00000000000008p-1022", 0, Below}, + + // denormals + {"0x0.0000000000000cp-1022", math.SmallestNonzeroFloat64, Above}, // rounded up to smallest denormal + {"0x0.0000000000001p-1022", math.SmallestNonzeroFloat64, Exact}, // smallest denormal + {"0x.8p-1073", math.SmallestNonzeroFloat64, Exact}, + {"1p-1074", math.SmallestNonzeroFloat64, Exact}, + {"0x.fffffffffffffp-1022", math.Float64frombits(0x000fffffffffffff), Exact}, // largest denormal + + // normals + {"0x.fffffffffffff8p-1022", math.Float64frombits(0x0010000000000000), Above}, // rounded up to smallest normal + {"1p-1022", math.Float64frombits(0x0010000000000000), Exact}, // smallest normal + {"1", 1, Exact}, + {"1.000000000000000000001", 1, Below}, + {"12345.0", 12345, Exact}, + {"12345.000000000000000000001", 12345, Below}, + {"0x1.fffffffffffff0p1023", math.MaxFloat64, Exact}, + {"0x1.fffffffffffff4p1023", math.MaxFloat64, Below}, + + // overflow + {"0x1.fffffffffffff8p1023", math.Inf(+1), Above}, + {"0x1p1024", math.Inf(+1), Above}, + {"1e10000", math.Inf(+1), Above}, + {"0x1.fffffffffffff8p2147483646", math.Inf(+1), Above}, // overflow in rounding + {"Inf", math.Inf(+1), Exact}, + + // selected denormalized values that were handled incorrectly in the past + {"0x.fffffffffffffp-1022", smallestNormalFloat64 - math.SmallestNonzeroFloat64, Exact}, + {"4503599627370495p-1074", smallestNormalFloat64 - math.SmallestNonzeroFloat64, Exact}, + + // http://www.exploringbinary.com/php-hangs-on-numeric-value-2-2250738585072011e-308/ + {"2.2250738585072011e-308", 2.225073858507201e-308, Below}, + // http://www.exploringbinary.com/java-hangs-when-converting-2-2250738585072012e-308/ + {"2.2250738585072012e-308", 2.2250738585072014e-308, Above}, + } { + for i := 0; i < 2; i++ { + // test both signs + tx, tout, tacc := test.x, test.out, test.acc + if i != 0 { + tx = "-" + tx + tout = -tout + tacc = -tacc + } + + // conversion should match strconv where syntax is agreeable + if f, err := strconv.ParseFloat(tx, 64); err == nil && !alike64(f, tout) { + t.Errorf("%s: got %g; want %g (incorrect test data)", tx, f, tout) + } + + x := makeFloat(tx) + out, acc := x.Float64() + if !alike64(out, tout) || acc != tacc { + t.Errorf("%s: got %g (%#x, %s); want %g (%#x, %s)", tx, out, math.Float64bits(out), acc, test.out, math.Float64bits(test.out), tacc) + } + + // test that x.SetFloat64(f).Float64() == f + var x2 Float + out2, acc2 := x2.SetFloat64(out).Float64() + if !alike64(out2, out) || acc2 != Exact { + t.Errorf("idempotency test: got %g (%s); want %g (Exact)", out2, acc2, out) + } + } + } +} + +func TestFloatInt(t *testing.T) { + for _, test := range []struct { + x string + want string + acc Accuracy + }{ + {"0", "0", Exact}, + {"+0", "0", Exact}, + {"-0", "0", Exact}, + {"Inf", "nil", Below}, + {"+Inf", "nil", Below}, + {"-Inf", "nil", Above}, + {"1", "1", Exact}, + {"-1", "-1", Exact}, + {"1.23", "1", Below}, + {"-1.23", "-1", Above}, + {"123e-2", "1", Below}, + {"123e-3", "0", Below}, + {"123e-4", "0", Below}, + {"1e-1000", "0", Below}, + {"-1e-1000", "0", Above}, + {"1e+10", "10000000000", Exact}, + {"1e+100", "10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", Exact}, + } { + x := makeFloat(test.x) + res, acc := x.Int(nil) + got := "nil" + if res != nil { + got = res.String() + } + if got != test.want || acc != test.acc { + t.Errorf("%s: got %s (%s); want %s (%s)", test.x, got, acc, test.want, test.acc) + } + } + + // check that supplied *Int is used + for _, f := range []string{"0", "1", "-1", "1234"} { + x := makeFloat(f) + i := new(Int) + if res, _ := x.Int(i); res != i { + t.Errorf("(%s).Int is not using supplied *Int", f) + } + } +} + +func TestFloatRat(t *testing.T) { + for _, test := range []struct { + x, want string + acc Accuracy + }{ + {"0", "0/1", Exact}, + {"+0", "0/1", Exact}, + {"-0", "0/1", Exact}, + {"Inf", "nil", Below}, + {"+Inf", "nil", Below}, + {"-Inf", "nil", Above}, + {"1", "1/1", Exact}, + {"-1", "-1/1", Exact}, + {"1.25", "5/4", Exact}, + {"-1.25", "-5/4", Exact}, + {"1e10", "10000000000/1", Exact}, + {"1p10", "1024/1", Exact}, + {"-1p-10", "-1/1024", Exact}, + {"3.14159265", "7244019449799623199/2305843009213693952", Exact}, + } { + x := makeFloat(test.x).SetPrec(64) + res, acc := x.Rat(nil) + got := "nil" + if res != nil { + got = res.String() + } + if got != test.want { + t.Errorf("%s: got %s; want %s", test.x, got, test.want) + continue + } + if acc != test.acc { + t.Errorf("%s: got %s; want %s", test.x, acc, test.acc) + continue + } + + // inverse conversion + if res != nil { + got := new(Float).SetPrec(64).SetRat(res) + if got.Cmp(x) != 0 { + t.Errorf("%s: got %s; want %s", test.x, got, x) + } + } + } + + // check that supplied *Rat is used + for _, f := range []string{"0", "1", "-1", "1234"} { + x := makeFloat(f) + r := new(Rat) + if res, _ := x.Rat(r); res != r { + t.Errorf("(%s).Rat is not using supplied *Rat", f) + } + } +} + +func TestFloatAbs(t *testing.T) { + for _, test := range []string{ + "0", + "1", + "1234", + "1.23e-2", + "1e-1000", + "1e1000", + "Inf", + } { + p := makeFloat(test) + a := new(Float).Abs(p) + if !alike(a, p) { + t.Errorf("%s: got %s; want %s", test, a.Text('g', 10), test) + } + + n := makeFloat("-" + test) + a.Abs(n) + if !alike(a, p) { + t.Errorf("-%s: got %s; want %s", test, a.Text('g', 10), test) + } + } +} + +func TestFloatNeg(t *testing.T) { + for _, test := range []string{ + "0", + "1", + "1234", + "1.23e-2", + "1e-1000", + "1e1000", + "Inf", + } { + p1 := makeFloat(test) + n1 := makeFloat("-" + test) + n2 := new(Float).Neg(p1) + p2 := new(Float).Neg(n2) + if !alike(n2, n1) { + t.Errorf("%s: got %s; want %s", test, n2.Text('g', 10), n1.Text('g', 10)) + } + if !alike(p2, p1) { + t.Errorf("%s: got %s; want %s", test, p2.Text('g', 10), p1.Text('g', 10)) + } + } +} + +func TestFloatInc(t *testing.T) { + const n = 10 + for _, prec := range precList { + if 1< y: + want = +1 + } + if got != want { + t.Errorf("(%g).Cmp(%g) = %v; want %v", x, y, got, want) + } + } + } + } +} diff --git a/src/cmd/compile/internal/big/floatconv.go b/src/cmd/compile/internal/big/floatconv.go new file mode 100644 index 0000000000000000000000000000000000000000..4a070ca64d4c835aedad131bb7abb2c6409a6466 --- /dev/null +++ b/src/cmd/compile/internal/big/floatconv.go @@ -0,0 +1,239 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// This file implements string-to-Float conversion functions. + +package big + +import ( + "fmt" + "io" + "strings" +) + +// SetString sets z to the value of s and returns z and a boolean indicating +// success. s must be a floating-point number of the same format as accepted +// by Parse, with base argument 0. +func (z *Float) SetString(s string) (*Float, bool) { + if f, _, err := z.Parse(s, 0); err == nil { + return f, true + } + return nil, false +} + +// scan is like Parse but reads the longest possible prefix representing a valid +// floating point number from an io.ByteScanner rather than a string. It serves +// as the implementation of Parse. It does not recognize ±Inf and does not expect +// EOF at the end. +func (z *Float) scan(r io.ByteScanner, base int) (f *Float, b int, err error) { + prec := z.prec + if prec == 0 { + prec = 64 + } + + // A reasonable value in case of an error. + z.form = zero + + // sign + z.neg, err = scanSign(r) + if err != nil { + return + } + + // mantissa + var fcount int // fractional digit count; valid if <= 0 + z.mant, b, fcount, err = z.mant.scan(r, base, true) + if err != nil { + return + } + + // exponent + var exp int64 + var ebase int + exp, ebase, err = scanExponent(r, true) + if err != nil { + return + } + + // special-case 0 + if len(z.mant) == 0 { + z.prec = prec + z.acc = Exact + z.form = zero + f = z + return + } + // len(z.mant) > 0 + + // The mantissa may have a decimal point (fcount <= 0) and there + // may be a nonzero exponent exp. The decimal point amounts to a + // division by b**(-fcount). An exponent means multiplication by + // ebase**exp. Finally, mantissa normalization (shift left) requires + // a correcting multiplication by 2**(-shiftcount). Multiplications + // are commutative, so we can apply them in any order as long as there + // is no loss of precision. We only have powers of 2 and 10; keep + // track via separate exponents exp2 and exp10. + + // normalize mantissa and get initial binary exponent + var exp2 = int64(len(z.mant))*_W - fnorm(z.mant) + + // determine binary or decimal exponent contribution of decimal point + var exp10 int64 + if fcount < 0 { + // The mantissa has a "decimal" point ddd.dddd; and + // -fcount is the number of digits to the right of '.'. + // Adjust relevant exponent accodingly. + switch b { + case 16: + fcount *= 4 // hexadecimal digits are 4 bits each + fallthrough + case 2: + exp2 += int64(fcount) + default: // b == 10 + exp10 = int64(fcount) + } + // we don't need fcount anymore + } + + // take actual exponent into account + if ebase == 2 { + exp2 += exp + } else { // ebase == 10 + exp10 += exp + } + // we don't need exp anymore + + // apply 2**exp2 + if MinExp <= exp2 && exp2 <= MaxExp { + z.prec = prec + z.form = finite + z.exp = int32(exp2) + f = z + } else { + err = fmt.Errorf("exponent overflow") + return + } + + if exp10 == 0 { + // no decimal exponent to consider + z.round(0) + return + } + // exp10 != 0 + + // apply 10**exp10 + p := new(Float).SetPrec(z.Prec() + 64) // use more bits for p -- TODO(gri) what is the right number? + if exp10 < 0 { + z.uquo(z, p.pow10(-exp10)) + } else { + z.umul(z, p.pow10(exp10)) + } + + return +} + +// These powers of 10 can be represented exactly as a float64. +var pow10tab = [...]float64{ + 1e0, 1e1, 1e2, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9, + 1e10, 1e11, 1e12, 1e13, 1e14, 1e15, 1e16, 1e17, 1e18, 1e19, +} + +// pow10 sets z to 10**n and returns z. +// n must not be negative. +func (z *Float) pow10(n int64) *Float { + if n < 0 { + panic("pow10 called with negative argument") + } + + const m = int64(len(pow10tab) - 1) + if n <= m { + return z.SetFloat64(pow10tab[n]) + } + // n > m + + z.SetFloat64(pow10tab[m]) + n -= m + + // use more bits for f than for z + // TODO(gri) what is the right number? + f := new(Float).SetPrec(z.Prec() + 64).SetInt64(10) + + for n > 0 { + if n&1 != 0 { + z.Mul(z, f) + } + f.Mul(f, f) + n >>= 1 + } + + return z +} + +// Parse parses s which must contain a text representation of a floating- +// point number with a mantissa in the given conversion base (the exponent +// is always a decimal number), or a string representing an infinite value. +// +// It sets z to the (possibly rounded) value of the corresponding floating- +// point value, and returns z, the actual base b, and an error err, if any. +// If z's precision is 0, it is changed to 64 before rounding takes effect. +// The number must be of the form: +// +// number = [ sign ] [ prefix ] mantissa [ exponent ] | infinity . +// sign = "+" | "-" . +// prefix = "0" ( "x" | "X" | "b" | "B" ) . +// mantissa = digits | digits "." [ digits ] | "." digits . +// exponent = ( "E" | "e" | "p" ) [ sign ] digits . +// digits = digit { digit } . +// digit = "0" ... "9" | "a" ... "z" | "A" ... "Z" . +// infinity = [ sign ] ( "inf" | "Inf" ) . +// +// The base argument must be 0, 2, 10, or 16. Providing an invalid base +// argument will lead to a run-time panic. +// +// For base 0, the number prefix determines the actual base: A prefix of +// "0x" or "0X" selects base 16, and a "0b" or "0B" prefix selects +// base 2; otherwise, the actual base is 10 and no prefix is accepted. +// The octal prefix "0" is not supported (a leading "0" is simply +// considered a "0"). +// +// A "p" exponent indicates a binary (rather then decimal) exponent; +// for instance "0x1.fffffffffffffp1023" (using base 0) represents the +// maximum float64 value. For hexadecimal mantissae, the exponent must +// be binary, if present (an "e" or "E" exponent indicator cannot be +// distinguished from a mantissa digit). +// +// The returned *Float f is nil and the value of z is valid but not +// defined if an error is reported. +// +func (z *Float) Parse(s string, base int) (f *Float, b int, err error) { + // scan doesn't handle ±Inf + if len(s) == 3 && (s == "Inf" || s == "inf") { + f = z.SetInf(false) + return + } + if len(s) == 4 && (s[0] == '+' || s[0] == '-') && (s[1:] == "Inf" || s[1:] == "inf") { + f = z.SetInf(s[0] == '-') + return + } + + r := strings.NewReader(s) + if f, b, err = z.scan(r, base); err != nil { + return + } + + // entire string must have been consumed + if ch, err2 := r.ReadByte(); err2 == nil { + err = fmt.Errorf("expected end of string, found %q", ch) + } else if err2 != io.EOF { + err = err2 + } + + return +} + +// ParseFloat is like f.Parse(s, base) with f set to the given precision +// and rounding mode. +func ParseFloat(s string, base int, prec uint, mode RoundingMode) (f *Float, b int, err error) { + return new(Float).SetPrec(prec).SetMode(mode).Parse(s, base) +} diff --git a/src/cmd/compile/internal/big/floatconv_test.go b/src/cmd/compile/internal/big/floatconv_test.go new file mode 100644 index 0000000000000000000000000000000000000000..4f239534a1403b903e56773d19225b5bd14eb02e --- /dev/null +++ b/src/cmd/compile/internal/big/floatconv_test.go @@ -0,0 +1,573 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package big + +import ( + "fmt" + "math" + "strconv" + "testing" +) + +func TestFloatSetFloat64String(t *testing.T) { + inf := math.Inf(0) + nan := math.NaN() + + for _, test := range []struct { + s string + x float64 // NaNs represent invalid inputs + }{ + // basics + {"0", 0}, + {"-0", -0}, + {"+0", 0}, + {"1", 1}, + {"-1", -1}, + {"+1", 1}, + {"1.234", 1.234}, + {"-1.234", -1.234}, + {"+1.234", 1.234}, + {".1", 0.1}, + {"1.", 1}, + {"+1.", 1}, + + // various zeros + {"0e100", 0}, + {"-0e+100", 0}, + {"+0e-100", 0}, + {"0E100", 0}, + {"-0E+100", 0}, + {"+0E-100", 0}, + + // various decimal exponent formats + {"1.e10", 1e10}, + {"1e+10", 1e10}, + {"+1e-10", 1e-10}, + {"1E10", 1e10}, + {"1.E+10", 1e10}, + {"+1E-10", 1e-10}, + + // infinities + {"Inf", inf}, + {"+Inf", inf}, + {"-Inf", -inf}, + {"inf", inf}, + {"+inf", inf}, + {"-inf", -inf}, + + // invalid numbers + {"", nan}, + {"-", nan}, + {"0x", nan}, + {"0e", nan}, + {"1.2ef", nan}, + {"2..3", nan}, + {"123..", nan}, + {"infinity", nan}, + {"foobar", nan}, + + // misc decimal values + {"3.14159265", 3.14159265}, + {"-687436.79457e-245", -687436.79457e-245}, + {"-687436.79457E245", -687436.79457e245}, + {".0000000000000000000000000000000000000001", 1e-40}, + {"+10000000000000000000000000000000000000000e-0", 1e40}, + + // decimal mantissa, binary exponent + {"0p0", 0}, + {"-0p0", -0}, + {"1p10", 1 << 10}, + {"1p+10", 1 << 10}, + {"+1p-10", 1.0 / (1 << 10)}, + {"1024p-12", 0.25}, + {"-1p10", -1024}, + {"1.5p1", 3}, + + // binary mantissa, decimal exponent + {"0b0", 0}, + {"-0b0", -0}, + {"0b0e+10", 0}, + {"-0b0e-10", -0}, + {"0b1010", 10}, + {"0B1010E2", 1000}, + {"0b.1", 0.5}, + {"0b.001", 0.125}, + {"0b.001e3", 125}, + + // binary mantissa, binary exponent + {"0b0p+10", 0}, + {"-0b0p-10", -0}, + {"0b.1010p4", 10}, + {"0b1p-1", 0.5}, + {"0b001p-3", 0.125}, + {"0b.001p3", 1}, + {"0b0.01p2", 1}, + + // hexadecimal mantissa and exponent + {"0x0", 0}, + {"-0x0", -0}, + {"0x0p+10", 0}, + {"-0x0p-10", -0}, + {"0xff", 255}, + {"0X.8p1", 1}, + {"-0X0.00008p16", -0.5}, + {"0x0.0000000000001p-1022", math.SmallestNonzeroFloat64}, + {"0x1.fffffffffffffp1023", math.MaxFloat64}, + } { + var x Float + x.SetPrec(53) + _, ok := x.SetString(test.s) + if math.IsNaN(test.x) { + // test.s is invalid + if ok { + t.Errorf("%s: want parse error", test.s) + } + continue + } + // test.s is valid + if !ok { + t.Errorf("%s: got parse error", test.s) + continue + } + f, _ := x.Float64() + want := new(Float).SetFloat64(test.x) + if x.Cmp(want) != 0 { + t.Errorf("%s: got %s (%v); want %v", test.s, &x, f, test.x) + } + } +} + +const ( + below1e23 = 99999999999999974834176 + above1e23 = 100000000000000008388608 +) + +func TestFloat64Text(t *testing.T) { + for _, test := range []struct { + x float64 + format byte + prec int + want string + }{ + {0, 'f', 0, "0"}, + {math.Copysign(0, -1), 'f', 0, "-0"}, + {1, 'f', 0, "1"}, + {-1, 'f', 0, "-1"}, + + {0.001, 'e', 0, "1e-03"}, + {0.459, 'e', 0, "5e-01"}, + {1.459, 'e', 0, "1e+00"}, + {2.459, 'e', 1, "2.5e+00"}, + {3.459, 'e', 2, "3.46e+00"}, + {4.459, 'e', 3, "4.459e+00"}, + {5.459, 'e', 4, "5.4590e+00"}, + + {0.001, 'f', 0, "0"}, + {0.459, 'f', 0, "0"}, + {1.459, 'f', 0, "1"}, + {2.459, 'f', 1, "2.5"}, + {3.459, 'f', 2, "3.46"}, + {4.459, 'f', 3, "4.459"}, + {5.459, 'f', 4, "5.4590"}, + + {0, 'b', 0, "0"}, + {math.Copysign(0, -1), 'b', 0, "-0"}, + {1.0, 'b', 0, "4503599627370496p-52"}, + {-1.0, 'b', 0, "-4503599627370496p-52"}, + {4503599627370496, 'b', 0, "4503599627370496p+0"}, + + {0, 'p', 0, "0"}, + {math.Copysign(0, -1), 'p', 0, "-0"}, + {1024.0, 'p', 0, "0x.8p+11"}, + {-1024.0, 'p', 0, "-0x.8p+11"}, + + // all test cases below from strconv/ftoa_test.go + {1, 'e', 5, "1.00000e+00"}, + {1, 'f', 5, "1.00000"}, + {1, 'g', 5, "1"}, + // {1, 'g', -1, "1"}, + // {20, 'g', -1, "20"}, + // {1234567.8, 'g', -1, "1.2345678e+06"}, + // {200000, 'g', -1, "200000"}, + // {2000000, 'g', -1, "2e+06"}, + + // g conversion and zero suppression + {400, 'g', 2, "4e+02"}, + {40, 'g', 2, "40"}, + {4, 'g', 2, "4"}, + {.4, 'g', 2, "0.4"}, + {.04, 'g', 2, "0.04"}, + {.004, 'g', 2, "0.004"}, + {.0004, 'g', 2, "0.0004"}, + {.00004, 'g', 2, "4e-05"}, + {.000004, 'g', 2, "4e-06"}, + + {0, 'e', 5, "0.00000e+00"}, + {0, 'f', 5, "0.00000"}, + {0, 'g', 5, "0"}, + // {0, 'g', -1, "0"}, + + {-1, 'e', 5, "-1.00000e+00"}, + {-1, 'f', 5, "-1.00000"}, + {-1, 'g', 5, "-1"}, + // {-1, 'g', -1, "-1"}, + + {12, 'e', 5, "1.20000e+01"}, + {12, 'f', 5, "12.00000"}, + {12, 'g', 5, "12"}, + // {12, 'g', -1, "12"}, + + {123456700, 'e', 5, "1.23457e+08"}, + {123456700, 'f', 5, "123456700.00000"}, + {123456700, 'g', 5, "1.2346e+08"}, + // {123456700, 'g', -1, "1.234567e+08"}, + + {1.2345e6, 'e', 5, "1.23450e+06"}, + {1.2345e6, 'f', 5, "1234500.00000"}, + {1.2345e6, 'g', 5, "1.2345e+06"}, + + {1e23, 'e', 17, "9.99999999999999916e+22"}, + {1e23, 'f', 17, "99999999999999991611392.00000000000000000"}, + {1e23, 'g', 17, "9.9999999999999992e+22"}, + + // {1e23, 'e', -1, "1e+23"}, + // {1e23, 'f', -1, "100000000000000000000000"}, + // {1e23, 'g', -1, "1e+23"}, + + {below1e23, 'e', 17, "9.99999999999999748e+22"}, + {below1e23, 'f', 17, "99999999999999974834176.00000000000000000"}, + {below1e23, 'g', 17, "9.9999999999999975e+22"}, + + // {below1e23, 'e', -1, "9.999999999999997e+22"}, + // {below1e23, 'f', -1, "99999999999999970000000"}, + // {below1e23, 'g', -1, "9.999999999999997e+22"}, + + {above1e23, 'e', 17, "1.00000000000000008e+23"}, + {above1e23, 'f', 17, "100000000000000008388608.00000000000000000"}, + // {above1e23, 'g', 17, "1.0000000000000001e+23"}, + + // {above1e23, 'e', -1, "1.0000000000000001e+23"}, + // {above1e23, 'f', -1, "100000000000000010000000"}, + // {above1e23, 'g', -1, "1.0000000000000001e+23"}, + + // {fdiv(5e-304, 1e20), 'g', -1, "5e-324"}, + // {fdiv(-5e-304, 1e20), 'g', -1, "-5e-324"}, + + // {32, 'g', -1, "32"}, + // {32, 'g', 0, "3e+01"}, + + // {100, 'x', -1, "%x"}, + + // {math.NaN(), 'g', -1, "NaN"}, + // {-math.NaN(), 'g', -1, "NaN"}, + {math.Inf(0), 'g', -1, "+Inf"}, + {math.Inf(-1), 'g', -1, "-Inf"}, + {-math.Inf(0), 'g', -1, "-Inf"}, + + {-1, 'b', -1, "-4503599627370496p-52"}, + + // fixed bugs + {0.9, 'f', 1, "0.9"}, + {0.09, 'f', 1, "0.1"}, + {0.0999, 'f', 1, "0.1"}, + {0.05, 'f', 1, "0.1"}, + {0.05, 'f', 0, "0"}, + {0.5, 'f', 1, "0.5"}, + {0.5, 'f', 0, "0"}, + {1.5, 'f', 0, "2"}, + + // http://www.exploringbinary.com/java-hangs-when-converting-2-2250738585072012e-308/ + // {2.2250738585072012e-308, 'g', -1, "2.2250738585072014e-308"}, + // http://www.exploringbinary.com/php-hangs-on-numeric-value-2-2250738585072011e-308/ + // {2.2250738585072011e-308, 'g', -1, "2.225073858507201e-308"}, + + // Issue 2625. + {383260575764816448, 'f', 0, "383260575764816448"}, + // {383260575764816448, 'g', -1, "3.8326057576481645e+17"}, + } { + f := new(Float).SetFloat64(test.x) + got := f.Text(test.format, test.prec) + if got != test.want { + t.Errorf("%v: got %s; want %s", test, got, test.want) + } + + if test.format == 'b' && test.x == 0 { + continue // 'b' format in strconv.Float requires knowledge of bias for 0.0 + } + if test.format == 'p' { + continue // 'p' format not supported in strconv.Format + } + + // verify that Float format matches strconv format + want := strconv.FormatFloat(test.x, test.format, test.prec, 64) + if got != want { + t.Errorf("%v: got %s; want %s (strconv)", test, got, want) + } + } +} + +func TestFloatText(t *testing.T) { + for _, test := range []struct { + x string + prec uint + format byte + digits int + want string + }{ + {"0", 10, 'f', 0, "0"}, + {"-0", 10, 'f', 0, "-0"}, + {"1", 10, 'f', 0, "1"}, + {"-1", 10, 'f', 0, "-1"}, + + {"1.459", 100, 'e', 0, "1e+00"}, + {"2.459", 100, 'e', 1, "2.5e+00"}, + {"3.459", 100, 'e', 2, "3.46e+00"}, + {"4.459", 100, 'e', 3, "4.459e+00"}, + {"5.459", 100, 'e', 4, "5.4590e+00"}, + + {"1.459", 100, 'E', 0, "1E+00"}, + {"2.459", 100, 'E', 1, "2.5E+00"}, + {"3.459", 100, 'E', 2, "3.46E+00"}, + {"4.459", 100, 'E', 3, "4.459E+00"}, + {"5.459", 100, 'E', 4, "5.4590E+00"}, + + {"1.459", 100, 'f', 0, "1"}, + {"2.459", 100, 'f', 1, "2.5"}, + {"3.459", 100, 'f', 2, "3.46"}, + {"4.459", 100, 'f', 3, "4.459"}, + {"5.459", 100, 'f', 4, "5.4590"}, + + {"1.459", 100, 'g', 0, "1"}, + {"2.459", 100, 'g', 1, "2"}, + {"3.459", 100, 'g', 2, "3.5"}, + {"4.459", 100, 'g', 3, "4.46"}, + {"5.459", 100, 'g', 4, "5.459"}, + + {"1459", 53, 'g', 0, "1e+03"}, + {"2459", 53, 'g', 1, "2e+03"}, + {"3459", 53, 'g', 2, "3.5e+03"}, + {"4459", 53, 'g', 3, "4.46e+03"}, + {"5459", 53, 'g', 4, "5459"}, + + {"1459", 53, 'G', 0, "1E+03"}, + {"2459", 53, 'G', 1, "2E+03"}, + {"3459", 53, 'G', 2, "3.5E+03"}, + {"4459", 53, 'G', 3, "4.46E+03"}, + {"5459", 53, 'G', 4, "5459"}, + + {"3", 10, 'e', 40, "3.0000000000000000000000000000000000000000e+00"}, + {"3", 10, 'f', 40, "3.0000000000000000000000000000000000000000"}, + {"3", 10, 'g', 40, "3"}, + + {"3e40", 100, 'e', 40, "3.0000000000000000000000000000000000000000e+40"}, + {"3e40", 100, 'f', 4, "30000000000000000000000000000000000000000.0000"}, + {"3e40", 100, 'g', 40, "3e+40"}, + + // make sure "stupid" exponents don't stall the machine + {"1e1000000", 64, 'p', 0, "0x.88b3a28a05eade3ap+3321929"}, + {"1e1000000000", 64, 'p', 0, "0x.ecc5f45aa573d3p+1538481529"}, + {"1e-1000000", 64, 'p', 0, "0x.efb4542cc8ca418ap-3321928"}, + {"1e-1000000000", 64, 'p', 0, "0x.8a64dd983a4c7dabp-1538481528"}, + + // TODO(gri) need tests for actual large Floats + + {"0", 53, 'b', 0, "0"}, + {"-0", 53, 'b', 0, "-0"}, + {"1.0", 53, 'b', 0, "4503599627370496p-52"}, + {"-1.0", 53, 'b', 0, "-4503599627370496p-52"}, + {"4503599627370496", 53, 'b', 0, "4503599627370496p+0"}, + + // issue 9939 + {"3", 350, 'b', 0, "1720123961992553633708115671476565205597423741876210842803191629540192157066363606052513914832594264915968p-348"}, + {"03", 350, 'b', 0, "1720123961992553633708115671476565205597423741876210842803191629540192157066363606052513914832594264915968p-348"}, + {"3.", 350, 'b', 0, "1720123961992553633708115671476565205597423741876210842803191629540192157066363606052513914832594264915968p-348"}, + {"3.0", 350, 'b', 0, "1720123961992553633708115671476565205597423741876210842803191629540192157066363606052513914832594264915968p-348"}, + {"3.00", 350, 'b', 0, "1720123961992553633708115671476565205597423741876210842803191629540192157066363606052513914832594264915968p-348"}, + {"3.000", 350, 'b', 0, "1720123961992553633708115671476565205597423741876210842803191629540192157066363606052513914832594264915968p-348"}, + + {"3", 350, 'p', 0, "0x.cp+2"}, + {"03", 350, 'p', 0, "0x.cp+2"}, + {"3.", 350, 'p', 0, "0x.cp+2"}, + {"3.0", 350, 'p', 0, "0x.cp+2"}, + {"3.00", 350, 'p', 0, "0x.cp+2"}, + {"3.000", 350, 'p', 0, "0x.cp+2"}, + + {"0", 64, 'p', 0, "0"}, + {"-0", 64, 'p', 0, "-0"}, + {"1024.0", 64, 'p', 0, "0x.8p+11"}, + {"-1024.0", 64, 'p', 0, "-0x.8p+11"}, + + // unsupported format + {"3.14", 64, 'x', 0, "%x"}, + {"-3.14", 64, 'x', 0, "%x"}, + } { + f, _, err := ParseFloat(test.x, 0, test.prec, ToNearestEven) + if err != nil { + t.Errorf("%v: %s", test, err) + continue + } + + got := f.Text(test.format, test.digits) + if got != test.want { + t.Errorf("%v: got %s; want %s", test, got, test.want) + } + + // compare with strconv.FormatFloat output if possible + // ('p' format is not supported by strconv.FormatFloat, + // and its output for 0.0 prints a biased exponent value + // as in 0p-1074 which makes no sense to emulate here) + if test.prec == 53 && test.format != 'p' && f.Sign() != 0 { + f64, acc := f.Float64() + if acc != Exact { + t.Errorf("%v: expected exact conversion to float64", test) + continue + } + got := strconv.FormatFloat(f64, test.format, test.digits, 64) + if got != test.want { + t.Errorf("%v: got %s; want %s", test, got, test.want) + } + } + } +} + +func TestFloatFormat(t *testing.T) { + for _, test := range []struct { + format string + value interface{} // float32, float64, or string (== 512bit *Float) + want string + }{ + // TODO(gri) uncomment the disabled 'g'/'G' formats + // below once (*Float).Text supports prec < 0 + + // from fmt/fmt_test.go + {"%+.3e", 0.0, "+0.000e+00"}, + {"%+.3e", 1.0, "+1.000e+00"}, + {"%+.3f", -1.0, "-1.000"}, + {"%+.3F", -1.0, "-1.000"}, + {"%+.3F", float32(-1.0), "-1.000"}, + {"%+07.2f", 1.0, "+001.00"}, + {"%+07.2f", -1.0, "-001.00"}, + {"%+10.2f", +1.0, " +1.00"}, + {"%+10.2f", -1.0, " -1.00"}, + {"% .3E", -1.0, "-1.000E+00"}, + {"% .3e", 1.0, " 1.000e+00"}, + {"%+.3g", 0.0, "+0"}, + {"%+.3g", 1.0, "+1"}, + {"%+.3g", -1.0, "-1"}, + {"% .3g", -1.0, "-1"}, + {"% .3g", 1.0, " 1"}, + {"%b", float32(1.0), "8388608p-23"}, + {"%b", 1.0, "4503599627370496p-52"}, + + // from fmt/fmt_test.go: old test/fmt_test.go + {"%e", 1.0, "1.000000e+00"}, + {"%e", 1234.5678e3, "1.234568e+06"}, + {"%e", 1234.5678e-8, "1.234568e-05"}, + {"%e", -7.0, "-7.000000e+00"}, + {"%e", -1e-9, "-1.000000e-09"}, + {"%f", 1234.5678e3, "1234567.800000"}, + {"%f", 1234.5678e-8, "0.000012"}, + {"%f", -7.0, "-7.000000"}, + {"%f", -1e-9, "-0.000000"}, + // {"%g", 1234.5678e3, "1.2345678e+06"}, + // {"%g", float32(1234.5678e3), "1.2345678e+06"}, + // {"%g", 1234.5678e-8, "1.2345678e-05"}, + {"%g", -7.0, "-7"}, + {"%g", -1e-9, "-1e-09"}, + {"%g", float32(-1e-9), "-1e-09"}, + {"%E", 1.0, "1.000000E+00"}, + {"%E", 1234.5678e3, "1.234568E+06"}, + {"%E", 1234.5678e-8, "1.234568E-05"}, + {"%E", -7.0, "-7.000000E+00"}, + {"%E", -1e-9, "-1.000000E-09"}, + // {"%G", 1234.5678e3, "1.2345678E+06"}, + // {"%G", float32(1234.5678e3), "1.2345678E+06"}, + // {"%G", 1234.5678e-8, "1.2345678E-05"}, + {"%G", -7.0, "-7"}, + {"%G", -1e-9, "-1E-09"}, + {"%G", float32(-1e-9), "-1E-09"}, + + {"%20.6e", 1.2345e3, " 1.234500e+03"}, + {"%20.6e", 1.2345e-3, " 1.234500e-03"}, + {"%20e", 1.2345e3, " 1.234500e+03"}, + {"%20e", 1.2345e-3, " 1.234500e-03"}, + {"%20.8e", 1.2345e3, " 1.23450000e+03"}, + {"%20f", 1.23456789e3, " 1234.567890"}, + {"%20f", 1.23456789e-3, " 0.001235"}, + {"%20f", 12345678901.23456789, " 12345678901.234568"}, + {"%-20f", 1.23456789e3, "1234.567890 "}, + {"%20.8f", 1.23456789e3, " 1234.56789000"}, + {"%20.8f", 1.23456789e-3, " 0.00123457"}, + // {"%g", 1.23456789e3, "1234.56789"}, + // {"%g", 1.23456789e-3, "0.00123456789"}, + // {"%g", 1.23456789e20, "1.23456789e+20"}, + {"%20e", math.Inf(1), " +Inf"}, + {"%-20f", math.Inf(-1), "-Inf "}, + + // from fmt/fmt_test.go: comparison of padding rules with C printf + {"%.2f", 1.0, "1.00"}, + {"%.2f", -1.0, "-1.00"}, + {"% .2f", 1.0, " 1.00"}, + {"% .2f", -1.0, "-1.00"}, + {"%+.2f", 1.0, "+1.00"}, + {"%+.2f", -1.0, "-1.00"}, + {"%7.2f", 1.0, " 1.00"}, + {"%7.2f", -1.0, " -1.00"}, + {"% 7.2f", 1.0, " 1.00"}, + {"% 7.2f", -1.0, " -1.00"}, + {"%+7.2f", 1.0, " +1.00"}, + {"%+7.2f", -1.0, " -1.00"}, + {"%07.2f", 1.0, "0001.00"}, + {"%07.2f", -1.0, "-001.00"}, + {"% 07.2f", 1.0, " 001.00"}, + {"% 07.2f", -1.0, "-001.00"}, + {"%+07.2f", 1.0, "+001.00"}, + {"%+07.2f", -1.0, "-001.00"}, + + // from fmt/fmt_test.go: zero padding does not apply to infinities + {"%020f", math.Inf(-1), " -Inf"}, + {"%020f", math.Inf(+1), " +Inf"}, + {"% 020f", math.Inf(-1), " -Inf"}, + {"% 020f", math.Inf(+1), " Inf"}, + {"%+020f", math.Inf(-1), " -Inf"}, + {"%+020f", math.Inf(+1), " +Inf"}, + {"%20f", -1.0, " -1.000000"}, + + // handle %v like %g + {"%v", 0.0, "0"}, + {"%v", -7.0, "-7"}, + {"%v", -1e-9, "-1e-09"}, + {"%v", float32(-1e-9), "-1e-09"}, + {"%010v", 0.0, "0000000000"}, + {"%010v", 0.0, "0000000000"}, + + // *Float cases + {"%.20f", "1e-20", "0.00000000000000000001"}, + {"%.20f", "-1e-20", "-0.00000000000000000001"}, + {"%30.20f", "-1e-20", " -0.00000000000000000001"}, + {"%030.20f", "-1e-20", "-00000000.00000000000000000001"}, + {"%030.20f", "+1e-20", "000000000.00000000000000000001"}, + {"% 030.20f", "+1e-20", " 00000000.00000000000000000001"}, + + // erroneous formats + {"%s", 1.0, "%!s(*big.Float=1)"}, + } { + value := new(Float) + switch v := test.value.(type) { + case float32: + value.SetPrec(24).SetFloat64(float64(v)) + case float64: + value.SetPrec(53).SetFloat64(v) + case string: + value.SetPrec(512).Parse(v, 0) + default: + t.Fatalf("unsupported test value: %v (%T)", v, v) + } + + if got := fmt.Sprintf(test.format, value); got != test.want { + t.Errorf("%v: got %q; want %q", test, got, test.want) + } + } +} diff --git a/src/cmd/compile/internal/big/floatexample_test.go b/src/cmd/compile/internal/big/floatexample_test.go new file mode 100644 index 0000000000000000000000000000000000000000..6fd291c9c220ea9a6152b9ef983258447d3002ca --- /dev/null +++ b/src/cmd/compile/internal/big/floatexample_test.go @@ -0,0 +1,111 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package big_test + +import ( + "cmd/compile/internal/big" + "fmt" + "math" +) + +func ExampleFloat_Add() { + // Operating on numbers of different precision. + var x, y, z big.Float + x.SetInt64(1000) // x is automatically set to 64bit precision + y.SetFloat64(2.718281828) // y is automatically set to 53bit precision + z.SetPrec(32) + z.Add(&x, &y) + fmt.Printf("x = %.10g (%s, prec = %d, acc = %s)\n", &x, x.Text('p', 0), x.Prec(), x.Acc()) + fmt.Printf("y = %.10g (%s, prec = %d, acc = %s)\n", &y, y.Text('p', 0), y.Prec(), y.Acc()) + fmt.Printf("z = %.10g (%s, prec = %d, acc = %s)\n", &z, z.Text('p', 0), z.Prec(), z.Acc()) + // Output: + // x = 1000 (0x.fap+10, prec = 64, acc = Exact) + // y = 2.718281828 (0x.adf85458248cd8p+2, prec = 53, acc = Exact) + // z = 1002.718282 (0x.faadf854p+10, prec = 32, acc = Below) +} + +func Example_Shift() { + // Implementing Float "shift" by modifying the (binary) exponents directly. + for s := -5; s <= 5; s++ { + x := big.NewFloat(0.5) + x.SetMantExp(x, x.MantExp(nil)+s) // shift x by s + fmt.Println(x) + } + // Output: + // 0.015625 + // 0.03125 + // 0.0625 + // 0.125 + // 0.25 + // 0.5 + // 1 + // 2 + // 4 + // 8 + // 16 +} + +func ExampleFloat_Cmp() { + inf := math.Inf(1) + zero := 0.0 + + operands := []float64{-inf, -1.2, -zero, 0, +1.2, +inf} + + fmt.Println(" x y cmp") + fmt.Println("---------------") + for _, x64 := range operands { + x := big.NewFloat(x64) + for _, y64 := range operands { + y := big.NewFloat(y64) + fmt.Printf("%4g %4g %3d\n", x, y, x.Cmp(y)) + } + fmt.Println() + } + + // Output: + // x y cmp + // --------------- + // -Inf -Inf 0 + // -Inf -1.2 -1 + // -Inf -0 -1 + // -Inf 0 -1 + // -Inf 1.2 -1 + // -Inf +Inf -1 + // + // -1.2 -Inf 1 + // -1.2 -1.2 0 + // -1.2 -0 -1 + // -1.2 0 -1 + // -1.2 1.2 -1 + // -1.2 +Inf -1 + // + // -0 -Inf 1 + // -0 -1.2 1 + // -0 -0 0 + // -0 0 0 + // -0 1.2 -1 + // -0 +Inf -1 + // + // 0 -Inf 1 + // 0 -1.2 1 + // 0 -0 0 + // 0 0 0 + // 0 1.2 -1 + // 0 +Inf -1 + // + // 1.2 -Inf 1 + // 1.2 -1.2 1 + // 1.2 -0 1 + // 1.2 0 1 + // 1.2 1.2 0 + // 1.2 +Inf -1 + // + // +Inf -Inf 1 + // +Inf -1.2 1 + // +Inf -0 1 + // +Inf 0 1 + // +Inf 1.2 1 + // +Inf +Inf 0 +} diff --git a/src/cmd/compile/internal/big/ftoa.go b/src/cmd/compile/internal/big/ftoa.go new file mode 100644 index 0000000000000000000000000000000000000000..5c5f2cea460cc87a211e527d24f218f820c12a11 --- /dev/null +++ b/src/cmd/compile/internal/big/ftoa.go @@ -0,0 +1,393 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// This file implements Float-to-string conversion functions. +// It is closely following the corresponding implementation +// in strconv/ftoa.go, but modified and simplified for Float. + +package big + +import ( + "fmt" + "strconv" + "strings" +) + +// Text converts the floating-point number x to a string according +// to the given format and precision prec. The format is one of: +// +// 'e' -d.dddde±dd, decimal exponent, at least two (possibly 0) exponent digits +// 'E' -d.ddddE±dd, decimal exponent, at least two (possibly 0) exponent digits +// 'f' -ddddd.dddd, no exponent +// 'g' like 'e' for large exponents, like 'f' otherwise +// 'G' like 'E' for large exponents, like 'f' otherwise +// 'b' -ddddddp±dd, binary exponent +// 'p' -0x.dddp±dd, binary exponent, hexadecimal mantissa +// +// For the binary exponent formats, the mantissa is printed in normalized form: +// +// 'b' decimal integer mantissa using x.Prec() bits, or -0 +// 'p' hexadecimal fraction with 0.5 <= 0.mantissa < 1.0, or -0 +// +// If format is a different character, Text returns a "%" followed by the +// unrecognized format character. +// +// The precision prec controls the number of digits (excluding the exponent) +// printed by the 'e', 'E', 'f', 'g', and 'G' formats. For 'e', 'E', and 'f' +// it is the number of digits after the decimal point. For 'g' and 'G' it is +// the total number of digits. A negative precision selects the smallest +// number of digits necessary to identify the value x uniquely. +// The prec value is ignored for the 'b' or 'p' format. +// +// BUG(gri) Float.Text does not accept negative precisions (issue #10991). +func (x *Float) Text(format byte, prec int) string { + const extra = 10 // TODO(gri) determine a good/better value here + return string(x.Append(make([]byte, 0, prec+extra), format, prec)) +} + +// String formats x like x.Text('g', 10). +func (x *Float) String() string { + return x.Text('g', 10) +} + +// Append appends to buf the string form of the floating-point number x, +// as generated by x.Text, and returns the extended buffer. +func (x *Float) Append(buf []byte, fmt byte, prec int) []byte { + // sign + if x.neg { + buf = append(buf, '-') + } + + // Inf + if x.form == inf { + if !x.neg { + buf = append(buf, '+') + } + return append(buf, "Inf"...) + } + + // pick off easy formats + switch fmt { + case 'b': + return x.fmtB(buf) + case 'p': + return x.fmtP(buf) + } + + // Algorithm: + // 1) convert Float to multiprecision decimal + // 2) round to desired precision + // 3) read digits out and format + + // 1) convert Float to multiprecision decimal + var d decimal // == 0.0 + if x.form == finite { + d.init(x.mant, int(x.exp)-x.mant.bitLen()) + } + + // 2) round to desired precision + shortest := false + if prec < 0 { + shortest = true + panic("unimplemented") + // TODO(gri) complete this + // roundShortest(&d, f.mant, int(f.exp)) + // Precision for shortest representation mode. + switch fmt { + case 'e', 'E': + prec = len(d.mant) - 1 + case 'f': + prec = max(len(d.mant)-d.exp, 0) + case 'g', 'G': + prec = len(d.mant) + } + } else { + // round appropriately + switch fmt { + case 'e', 'E': + // one digit before and number of digits after decimal point + d.round(1 + prec) + case 'f': + // number of digits before and after decimal point + d.round(d.exp + prec) + case 'g', 'G': + if prec == 0 { + prec = 1 + } + d.round(prec) + } + } + + // 3) read digits out and format + switch fmt { + case 'e', 'E': + return fmtE(buf, fmt, prec, d) + case 'f': + return fmtF(buf, prec, d) + case 'g', 'G': + // trim trailing fractional zeros in %e format + eprec := prec + if eprec > len(d.mant) && len(d.mant) >= d.exp { + eprec = len(d.mant) + } + // %e is used if the exponent from the conversion + // is less than -4 or greater than or equal to the precision. + // If precision was the shortest possible, use eprec = 6 for + // this decision. + if shortest { + eprec = 6 + } + exp := d.exp - 1 + if exp < -4 || exp >= eprec { + if prec > len(d.mant) { + prec = len(d.mant) + } + return fmtE(buf, fmt+'e'-'g', prec-1, d) + } + if prec > d.exp { + prec = len(d.mant) + } + return fmtF(buf, max(prec-d.exp, 0), d) + } + + // unknown format + if x.neg { + buf = buf[:len(buf)-1] // sign was added prematurely - remove it again + } + return append(buf, '%', fmt) +} + +// %e: d.ddddde±dd +func fmtE(buf []byte, fmt byte, prec int, d decimal) []byte { + // first digit + ch := byte('0') + if len(d.mant) > 0 { + ch = d.mant[0] + } + buf = append(buf, ch) + + // .moredigits + if prec > 0 { + buf = append(buf, '.') + i := 1 + m := min(len(d.mant), prec+1) + if i < m { + buf = append(buf, d.mant[i:m]...) + i = m + } + for ; i <= prec; i++ { + buf = append(buf, '0') + } + } + + // e± + buf = append(buf, fmt) + var exp int64 + if len(d.mant) > 0 { + exp = int64(d.exp) - 1 // -1 because first digit was printed before '.' + } + if exp < 0 { + ch = '-' + exp = -exp + } else { + ch = '+' + } + buf = append(buf, ch) + + // dd...d + if exp < 10 { + buf = append(buf, '0') // at least 2 exponent digits + } + return strconv.AppendInt(buf, exp, 10) +} + +// %f: ddddddd.ddddd +func fmtF(buf []byte, prec int, d decimal) []byte { + // integer, padded with zeros as needed + if d.exp > 0 { + m := min(len(d.mant), d.exp) + buf = append(buf, d.mant[:m]...) + for ; m < d.exp; m++ { + buf = append(buf, '0') + } + } else { + buf = append(buf, '0') + } + + // fraction + if prec > 0 { + buf = append(buf, '.') + for i := 0; i < prec; i++ { + ch := byte('0') + if j := d.exp + i; 0 <= j && j < len(d.mant) { + ch = d.mant[j] + } + buf = append(buf, ch) + } + } + + return buf +} + +// fmtB appends the string of x in the format mantissa "p" exponent +// with a decimal mantissa and a binary exponent, or 0" if x is zero, +// and returns the extended buffer. +// The mantissa is normalized such that is uses x.Prec() bits in binary +// representation. +// The sign of x is ignored, and x must not be an Inf. +func (x *Float) fmtB(buf []byte) []byte { + if x.form == zero { + return append(buf, '0') + } + + if debugFloat && x.form != finite { + panic("non-finite float") + } + // x != 0 + + // adjust mantissa to use exactly x.prec bits + m := x.mant + switch w := uint32(len(x.mant)) * _W; { + case w < x.prec: + m = nat(nil).shl(m, uint(x.prec-w)) + case w > x.prec: + m = nat(nil).shr(m, uint(w-x.prec)) + } + + buf = append(buf, m.decimalString()...) + buf = append(buf, 'p') + e := int64(x.exp) - int64(x.prec) + if e >= 0 { + buf = append(buf, '+') + } + return strconv.AppendInt(buf, e, 10) +} + +// fmtP appends the string of x in the format 0x." mantissa "p" exponent +// with a hexadecimal mantissa and a binary exponent, or 0" if x is zero, +// ad returns the extended buffer. +// The mantissa is normalized such that 0.5 <= 0.mantissa < 1.0. +// The sign of x is ignored, and x must not be an Inf. +func (x *Float) fmtP(buf []byte) []byte { + if x.form == zero { + return append(buf, '0') + } + + if debugFloat && x.form != finite { + panic("non-finite float") + } + // x != 0 + + // remove trailing 0 words early + // (no need to convert to hex 0's and trim later) + m := x.mant + i := 0 + for i < len(m) && m[i] == 0 { + i++ + } + m = m[i:] + + buf = append(buf, "0x."...) + buf = append(buf, strings.TrimRight(m.hexString(), "0")...) + buf = append(buf, 'p') + if x.exp >= 0 { + buf = append(buf, '+') + } + return strconv.AppendInt(buf, int64(x.exp), 10) +} + +func min(x, y int) int { + if x < y { + return x + } + return y +} + +// Format implements fmt.Formatter. It accepts all the regular +// formats for floating-point numbers ('e', 'E', 'f', 'F', 'g', +// 'G') as well as 'b', 'p', and 'v'. See (*Float).Text for the +// interpretation of 'b' and 'p'. The 'v' format is handled like +// 'g'. +// Format also supports specification of the minimum precision +// in digits, the output field width, as well as the format verbs +// '+' and ' ' for sign control, '0' for space or zero padding, +// and '-' for left or right justification. See the fmt package +// for details. +// +// BUG(gri) A missing precision for the 'g' format, or a negative +// (via '*') precision is not yet supported. Instead the +// default precision (6) is used in that case (issue #10991). +func (x *Float) Format(s fmt.State, format rune) { + prec, hasPrec := s.Precision() + if !hasPrec { + prec = 6 // default precision for 'e', 'f' + } + + switch format { + case 'e', 'E', 'f', 'b', 'p': + // nothing to do + case 'F': + // (*Float).Text doesn't support 'F'; handle like 'f' + format = 'f' + case 'v': + // handle like 'g' + format = 'g' + fallthrough + case 'g', 'G': + if !hasPrec { + // TODO(gri) uncomment once (*Float).Text handles prec < 0 + // prec = -1 // default precision for 'g', 'G' + } + default: + fmt.Fprintf(s, "%%!%c(*big.Float=%s)", format, x.String()) + return + } + var buf []byte + buf = x.Append(buf, byte(format), prec) + if len(buf) == 0 { + buf = []byte("?") // should never happen, but don't crash + } + // len(buf) > 0 + + var sign string + switch { + case buf[0] == '-': + sign = "-" + buf = buf[1:] + case buf[0] == '+': + // +Inf + sign = "+" + if s.Flag(' ') { + sign = " " + } + buf = buf[1:] + case s.Flag('+'): + sign = "+" + case s.Flag(' '): + sign = " " + } + + var padding int + if width, hasWidth := s.Width(); hasWidth && width > len(sign)+len(buf) { + padding = width - len(sign) - len(buf) + } + + switch { + case s.Flag('0') && !x.IsInf(): + // 0-padding on left + writeMultiple(s, sign, 1) + writeMultiple(s, "0", padding) + s.Write(buf) + case s.Flag('-'): + // padding on right + writeMultiple(s, sign, 1) + s.Write(buf) + writeMultiple(s, " ", padding) + default: + // padding on left + writeMultiple(s, " ", padding) + writeMultiple(s, sign, 1) + s.Write(buf) + } +} diff --git a/src/cmd/compile/internal/big/gcd_test.go b/src/cmd/compile/internal/big/gcd_test.go new file mode 100644 index 0000000000000000000000000000000000000000..c0b9f583000dfb4f06da9940f1572bb5f60fa811 --- /dev/null +++ b/src/cmd/compile/internal/big/gcd_test.go @@ -0,0 +1,47 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// This file implements a GCD benchmark. +// Usage: go test math/big -test.bench GCD + +package big + +import ( + "math/rand" + "testing" +) + +// randInt returns a pseudo-random Int in the range [1<<(size-1), (1< 1<<(size-1) +} + +func runGCD(b *testing.B, aSize, bSize uint) { + b.StopTimer() + var r = rand.New(rand.NewSource(1234)) + aa := randInt(r, aSize) + bb := randInt(r, bSize) + b.StartTimer() + for i := 0; i < b.N; i++ { + new(Int).GCD(nil, nil, aa, bb) + } +} + +func BenchmarkGCD10x10(b *testing.B) { runGCD(b, 10, 10) } +func BenchmarkGCD10x100(b *testing.B) { runGCD(b, 10, 100) } +func BenchmarkGCD10x1000(b *testing.B) { runGCD(b, 10, 1000) } +func BenchmarkGCD10x10000(b *testing.B) { runGCD(b, 10, 10000) } +func BenchmarkGCD10x100000(b *testing.B) { runGCD(b, 10, 100000) } +func BenchmarkGCD100x100(b *testing.B) { runGCD(b, 100, 100) } +func BenchmarkGCD100x1000(b *testing.B) { runGCD(b, 100, 1000) } +func BenchmarkGCD100x10000(b *testing.B) { runGCD(b, 100, 10000) } +func BenchmarkGCD100x100000(b *testing.B) { runGCD(b, 100, 100000) } +func BenchmarkGCD1000x1000(b *testing.B) { runGCD(b, 1000, 1000) } +func BenchmarkGCD1000x10000(b *testing.B) { runGCD(b, 1000, 10000) } +func BenchmarkGCD1000x100000(b *testing.B) { runGCD(b, 1000, 100000) } +func BenchmarkGCD10000x10000(b *testing.B) { runGCD(b, 10000, 10000) } +func BenchmarkGCD10000x100000(b *testing.B) { runGCD(b, 10000, 100000) } +func BenchmarkGCD100000x100000(b *testing.B) { runGCD(b, 100000, 100000) } diff --git a/src/cmd/compile/internal/big/hilbert_test.go b/src/cmd/compile/internal/big/hilbert_test.go new file mode 100644 index 0000000000000000000000000000000000000000..1a84341b3c0b63bfa7040c5631c2af9c8670578a --- /dev/null +++ b/src/cmd/compile/internal/big/hilbert_test.go @@ -0,0 +1,160 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// A little test program and benchmark for rational arithmetics. +// Computes a Hilbert matrix, its inverse, multiplies them +// and verifies that the product is the identity matrix. + +package big + +import ( + "fmt" + "testing" +) + +type matrix struct { + n, m int + a []*Rat +} + +func (a *matrix) at(i, j int) *Rat { + if !(0 <= i && i < a.n && 0 <= j && j < a.m) { + panic("index out of range") + } + return a.a[i*a.m+j] +} + +func (a *matrix) set(i, j int, x *Rat) { + if !(0 <= i && i < a.n && 0 <= j && j < a.m) { + panic("index out of range") + } + a.a[i*a.m+j] = x +} + +func newMatrix(n, m int) *matrix { + if !(0 <= n && 0 <= m) { + panic("illegal matrix") + } + a := new(matrix) + a.n = n + a.m = m + a.a = make([]*Rat, n*m) + return a +} + +func newUnit(n int) *matrix { + a := newMatrix(n, n) + for i := 0; i < n; i++ { + for j := 0; j < n; j++ { + x := NewRat(0, 1) + if i == j { + x.SetInt64(1) + } + a.set(i, j, x) + } + } + return a +} + +func newHilbert(n int) *matrix { + a := newMatrix(n, n) + for i := 0; i < n; i++ { + for j := 0; j < n; j++ { + a.set(i, j, NewRat(1, int64(i+j+1))) + } + } + return a +} + +func newInverseHilbert(n int) *matrix { + a := newMatrix(n, n) + for i := 0; i < n; i++ { + for j := 0; j < n; j++ { + x1 := new(Rat).SetInt64(int64(i + j + 1)) + x2 := new(Rat).SetInt(new(Int).Binomial(int64(n+i), int64(n-j-1))) + x3 := new(Rat).SetInt(new(Int).Binomial(int64(n+j), int64(n-i-1))) + x4 := new(Rat).SetInt(new(Int).Binomial(int64(i+j), int64(i))) + + x1.Mul(x1, x2) + x1.Mul(x1, x3) + x1.Mul(x1, x4) + x1.Mul(x1, x4) + + if (i+j)&1 != 0 { + x1.Neg(x1) + } + + a.set(i, j, x1) + } + } + return a +} + +func (a *matrix) mul(b *matrix) *matrix { + if a.m != b.n { + panic("illegal matrix multiply") + } + c := newMatrix(a.n, b.m) + for i := 0; i < c.n; i++ { + for j := 0; j < c.m; j++ { + x := NewRat(0, 1) + for k := 0; k < a.m; k++ { + x.Add(x, new(Rat).Mul(a.at(i, k), b.at(k, j))) + } + c.set(i, j, x) + } + } + return c +} + +func (a *matrix) eql(b *matrix) bool { + if a.n != b.n || a.m != b.m { + return false + } + for i := 0; i < a.n; i++ { + for j := 0; j < a.m; j++ { + if a.at(i, j).Cmp(b.at(i, j)) != 0 { + return false + } + } + } + return true +} + +func (a *matrix) String() string { + s := "" + for i := 0; i < a.n; i++ { + for j := 0; j < a.m; j++ { + s += fmt.Sprintf("\t%s", a.at(i, j)) + } + s += "\n" + } + return s +} + +func doHilbert(t *testing.T, n int) { + a := newHilbert(n) + b := newInverseHilbert(n) + I := newUnit(n) + ab := a.mul(b) + if !ab.eql(I) { + if t == nil { + panic("Hilbert failed") + } + t.Errorf("a = %s\n", a) + t.Errorf("b = %s\n", b) + t.Errorf("a*b = %s\n", ab) + t.Errorf("I = %s\n", I) + } +} + +func TestHilbert(t *testing.T) { + doHilbert(t, 10) +} + +func BenchmarkHilbert(b *testing.B) { + for i := 0; i < b.N; i++ { + doHilbert(nil, 10) + } +} diff --git a/src/cmd/compile/internal/big/int.go b/src/cmd/compile/internal/big/int.go new file mode 100644 index 0000000000000000000000000000000000000000..5e3125375b72bf19325b26032d3b03f01961e8cd --- /dev/null +++ b/src/cmd/compile/internal/big/int.go @@ -0,0 +1,966 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// This file implements signed multi-precision integers. + +package big + +import ( + "fmt" + "io" + "math/rand" + "strings" +) + +// An Int represents a signed multi-precision integer. +// The zero value for an Int represents the value 0. +type Int struct { + neg bool // sign + abs nat // absolute value of the integer +} + +var intOne = &Int{false, natOne} + +// Sign returns: +// +// -1 if x < 0 +// 0 if x == 0 +// +1 if x > 0 +// +func (x *Int) Sign() int { + if len(x.abs) == 0 { + return 0 + } + if x.neg { + return -1 + } + return 1 +} + +// SetInt64 sets z to x and returns z. +func (z *Int) SetInt64(x int64) *Int { + neg := false + if x < 0 { + neg = true + x = -x + } + z.abs = z.abs.setUint64(uint64(x)) + z.neg = neg + return z +} + +// SetUint64 sets z to x and returns z. +func (z *Int) SetUint64(x uint64) *Int { + z.abs = z.abs.setUint64(x) + z.neg = false + return z +} + +// NewInt allocates and returns a new Int set to x. +func NewInt(x int64) *Int { + return new(Int).SetInt64(x) +} + +// Set sets z to x and returns z. +func (z *Int) Set(x *Int) *Int { + if z != x { + z.abs = z.abs.set(x.abs) + z.neg = x.neg + } + return z +} + +// Bits provides raw (unchecked but fast) access to x by returning its +// absolute value as a little-endian Word slice. The result and x share +// the same underlying array. +// Bits is intended to support implementation of missing low-level Int +// functionality outside this package; it should be avoided otherwise. +func (x *Int) Bits() []Word { + return x.abs +} + +// SetBits provides raw (unchecked but fast) access to z by setting its +// value to abs, interpreted as a little-endian Word slice, and returning +// z. The result and abs share the same underlying array. +// SetBits is intended to support implementation of missing low-level Int +// functionality outside this package; it should be avoided otherwise. +func (z *Int) SetBits(abs []Word) *Int { + z.abs = nat(abs).norm() + z.neg = false + return z +} + +// Abs sets z to |x| (the absolute value of x) and returns z. +func (z *Int) Abs(x *Int) *Int { + z.Set(x) + z.neg = false + return z +} + +// Neg sets z to -x and returns z. +func (z *Int) Neg(x *Int) *Int { + z.Set(x) + z.neg = len(z.abs) > 0 && !z.neg // 0 has no sign + return z +} + +// Add sets z to the sum x+y and returns z. +func (z *Int) Add(x, y *Int) *Int { + neg := x.neg + if x.neg == y.neg { + // x + y == x + y + // (-x) + (-y) == -(x + y) + z.abs = z.abs.add(x.abs, y.abs) + } else { + // x + (-y) == x - y == -(y - x) + // (-x) + y == y - x == -(x - y) + if x.abs.cmp(y.abs) >= 0 { + z.abs = z.abs.sub(x.abs, y.abs) + } else { + neg = !neg + z.abs = z.abs.sub(y.abs, x.abs) + } + } + z.neg = len(z.abs) > 0 && neg // 0 has no sign + return z +} + +// Sub sets z to the difference x-y and returns z. +func (z *Int) Sub(x, y *Int) *Int { + neg := x.neg + if x.neg != y.neg { + // x - (-y) == x + y + // (-x) - y == -(x + y) + z.abs = z.abs.add(x.abs, y.abs) + } else { + // x - y == x - y == -(y - x) + // (-x) - (-y) == y - x == -(x - y) + if x.abs.cmp(y.abs) >= 0 { + z.abs = z.abs.sub(x.abs, y.abs) + } else { + neg = !neg + z.abs = z.abs.sub(y.abs, x.abs) + } + } + z.neg = len(z.abs) > 0 && neg // 0 has no sign + return z +} + +// Mul sets z to the product x*y and returns z. +func (z *Int) Mul(x, y *Int) *Int { + // x * y == x * y + // x * (-y) == -(x * y) + // (-x) * y == -(x * y) + // (-x) * (-y) == x * y + z.abs = z.abs.mul(x.abs, y.abs) + z.neg = len(z.abs) > 0 && x.neg != y.neg // 0 has no sign + return z +} + +// MulRange sets z to the product of all integers +// in the range [a, b] inclusively and returns z. +// If a > b (empty range), the result is 1. +func (z *Int) MulRange(a, b int64) *Int { + switch { + case a > b: + return z.SetInt64(1) // empty range + case a <= 0 && b >= 0: + return z.SetInt64(0) // range includes 0 + } + // a <= b && (b < 0 || a > 0) + + neg := false + if a < 0 { + neg = (b-a)&1 == 0 + a, b = -b, -a + } + + z.abs = z.abs.mulRange(uint64(a), uint64(b)) + z.neg = neg + return z +} + +// Binomial sets z to the binomial coefficient of (n, k) and returns z. +func (z *Int) Binomial(n, k int64) *Int { + // reduce the number of multiplications by reducing k + if n/2 < k && k <= n { + k = n - k // Binomial(n, k) == Binomial(n, n-k) + } + var a, b Int + a.MulRange(n-k+1, n) + b.MulRange(1, k) + return z.Quo(&a, &b) +} + +// Quo sets z to the quotient x/y for y != 0 and returns z. +// If y == 0, a division-by-zero run-time panic occurs. +// Quo implements truncated division (like Go); see QuoRem for more details. +func (z *Int) Quo(x, y *Int) *Int { + z.abs, _ = z.abs.div(nil, x.abs, y.abs) + z.neg = len(z.abs) > 0 && x.neg != y.neg // 0 has no sign + return z +} + +// Rem sets z to the remainder x%y for y != 0 and returns z. +// If y == 0, a division-by-zero run-time panic occurs. +// Rem implements truncated modulus (like Go); see QuoRem for more details. +func (z *Int) Rem(x, y *Int) *Int { + _, z.abs = nat(nil).div(z.abs, x.abs, y.abs) + z.neg = len(z.abs) > 0 && x.neg // 0 has no sign + return z +} + +// QuoRem sets z to the quotient x/y and r to the remainder x%y +// and returns the pair (z, r) for y != 0. +// If y == 0, a division-by-zero run-time panic occurs. +// +// QuoRem implements T-division and modulus (like Go): +// +// q = x/y with the result truncated to zero +// r = x - y*q +// +// (See Daan Leijen, ``Division and Modulus for Computer Scientists''.) +// See DivMod for Euclidean division and modulus (unlike Go). +// +func (z *Int) QuoRem(x, y, r *Int) (*Int, *Int) { + z.abs, r.abs = z.abs.div(r.abs, x.abs, y.abs) + z.neg, r.neg = len(z.abs) > 0 && x.neg != y.neg, len(r.abs) > 0 && x.neg // 0 has no sign + return z, r +} + +// Div sets z to the quotient x/y for y != 0 and returns z. +// If y == 0, a division-by-zero run-time panic occurs. +// Div implements Euclidean division (unlike Go); see DivMod for more details. +func (z *Int) Div(x, y *Int) *Int { + y_neg := y.neg // z may be an alias for y + var r Int + z.QuoRem(x, y, &r) + if r.neg { + if y_neg { + z.Add(z, intOne) + } else { + z.Sub(z, intOne) + } + } + return z +} + +// Mod sets z to the modulus x%y for y != 0 and returns z. +// If y == 0, a division-by-zero run-time panic occurs. +// Mod implements Euclidean modulus (unlike Go); see DivMod for more details. +func (z *Int) Mod(x, y *Int) *Int { + y0 := y // save y + if z == y || alias(z.abs, y.abs) { + y0 = new(Int).Set(y) + } + var q Int + q.QuoRem(x, y, z) + if z.neg { + if y0.neg { + z.Sub(z, y0) + } else { + z.Add(z, y0) + } + } + return z +} + +// DivMod sets z to the quotient x div y and m to the modulus x mod y +// and returns the pair (z, m) for y != 0. +// If y == 0, a division-by-zero run-time panic occurs. +// +// DivMod implements Euclidean division and modulus (unlike Go): +// +// q = x div y such that +// m = x - y*q with 0 <= m < |q| +// +// (See Raymond T. Boute, ``The Euclidean definition of the functions +// div and mod''. ACM Transactions on Programming Languages and +// Systems (TOPLAS), 14(2):127-144, New York, NY, USA, 4/1992. +// ACM press.) +// See QuoRem for T-division and modulus (like Go). +// +func (z *Int) DivMod(x, y, m *Int) (*Int, *Int) { + y0 := y // save y + if z == y || alias(z.abs, y.abs) { + y0 = new(Int).Set(y) + } + z.QuoRem(x, y, m) + if m.neg { + if y0.neg { + z.Add(z, intOne) + m.Sub(m, y0) + } else { + z.Sub(z, intOne) + m.Add(m, y0) + } + } + return z, m +} + +// Cmp compares x and y and returns: +// +// -1 if x < y +// 0 if x == y +// +1 if x > y +// +func (x *Int) Cmp(y *Int) (r int) { + // x cmp y == x cmp y + // x cmp (-y) == x + // (-x) cmp y == y + // (-x) cmp (-y) == -(x cmp y) + switch { + case x.neg == y.neg: + r = x.abs.cmp(y.abs) + if x.neg { + r = -r + } + case x.neg: + r = -1 + default: + r = 1 + } + return +} + +// low32 returns the least significant 32 bits of z. +func low32(z nat) uint32 { + if len(z) == 0 { + return 0 + } + return uint32(z[0]) +} + +// low64 returns the least significant 64 bits of z. +func low64(z nat) uint64 { + if len(z) == 0 { + return 0 + } + v := uint64(z[0]) + if _W == 32 && len(z) > 1 { + v |= uint64(z[1]) << 32 + } + return v +} + +// Int64 returns the int64 representation of x. +// If x cannot be represented in an int64, the result is undefined. +func (x *Int) Int64() int64 { + v := int64(low64(x.abs)) + if x.neg { + v = -v + } + return v +} + +// Uint64 returns the uint64 representation of x. +// If x cannot be represented in a uint64, the result is undefined. +func (x *Int) Uint64() uint64 { + return low64(x.abs) +} + +// SetString sets z to the value of s, interpreted in the given base, +// and returns z and a boolean indicating success. If SetString fails, +// the value of z is undefined but the returned value is nil. +// +// The base argument must be 0 or a value between 2 and MaxBase. If the base +// is 0, the string prefix determines the actual conversion base. A prefix of +// ``0x'' or ``0X'' selects base 16; the ``0'' prefix selects base 8, and a +// ``0b'' or ``0B'' prefix selects base 2. Otherwise the selected base is 10. +// +func (z *Int) SetString(s string, base int) (*Int, bool) { + r := strings.NewReader(s) + _, _, err := z.scan(r, base) + if err != nil { + return nil, false + } + _, err = r.ReadByte() + if err != io.EOF { + return nil, false + } + return z, true // err == io.EOF => scan consumed all of s +} + +// SetBytes interprets buf as the bytes of a big-endian unsigned +// integer, sets z to that value, and returns z. +func (z *Int) SetBytes(buf []byte) *Int { + z.abs = z.abs.setBytes(buf) + z.neg = false + return z +} + +// Bytes returns the absolute value of x as a big-endian byte slice. +func (x *Int) Bytes() []byte { + buf := make([]byte, len(x.abs)*_S) + return buf[x.abs.bytes(buf):] +} + +// BitLen returns the length of the absolute value of x in bits. +// The bit length of 0 is 0. +func (x *Int) BitLen() int { + return x.abs.bitLen() +} + +// Exp sets z = x**y mod |m| (i.e. the sign of m is ignored), and returns z. +// If y <= 0, the result is 1 mod |m|; if m == nil or m == 0, z = x**y. +// See Knuth, volume 2, section 4.6.3. +func (z *Int) Exp(x, y, m *Int) *Int { + var yWords nat + if !y.neg { + yWords = y.abs + } + // y >= 0 + + var mWords nat + if m != nil { + mWords = m.abs // m.abs may be nil for m == 0 + } + + z.abs = z.abs.expNN(x.abs, yWords, mWords) + z.neg = len(z.abs) > 0 && x.neg && len(yWords) > 0 && yWords[0]&1 == 1 // 0 has no sign + if z.neg && len(mWords) > 0 { + // make modulus result positive + z.abs = z.abs.sub(mWords, z.abs) // z == x**y mod |m| && 0 <= z < |m| + z.neg = false + } + + return z +} + +// GCD sets z to the greatest common divisor of a and b, which both must +// be > 0, and returns z. +// If x and y are not nil, GCD sets x and y such that z = a*x + b*y. +// If either a or b is <= 0, GCD sets z = x = y = 0. +func (z *Int) GCD(x, y, a, b *Int) *Int { + if a.Sign() <= 0 || b.Sign() <= 0 { + z.SetInt64(0) + if x != nil { + x.SetInt64(0) + } + if y != nil { + y.SetInt64(0) + } + return z + } + if x == nil && y == nil { + return z.binaryGCD(a, b) + } + + A := new(Int).Set(a) + B := new(Int).Set(b) + + X := new(Int) + Y := new(Int).SetInt64(1) + + lastX := new(Int).SetInt64(1) + lastY := new(Int) + + q := new(Int) + temp := new(Int) + + for len(B.abs) > 0 { + r := new(Int) + q, r = q.QuoRem(A, B, r) + + A, B = B, r + + temp.Set(X) + X.Mul(X, q) + X.neg = !X.neg + X.Add(X, lastX) + lastX.Set(temp) + + temp.Set(Y) + Y.Mul(Y, q) + Y.neg = !Y.neg + Y.Add(Y, lastY) + lastY.Set(temp) + } + + if x != nil { + *x = *lastX + } + + if y != nil { + *y = *lastY + } + + *z = *A + return z +} + +// binaryGCD sets z to the greatest common divisor of a and b, which both must +// be > 0, and returns z. +// See Knuth, The Art of Computer Programming, Vol. 2, Section 4.5.2, Algorithm B. +func (z *Int) binaryGCD(a, b *Int) *Int { + u := z + v := new(Int) + + // use one Euclidean iteration to ensure that u and v are approx. the same size + switch { + case len(a.abs) > len(b.abs): + u.Set(b) + v.Rem(a, b) + case len(a.abs) < len(b.abs): + u.Set(a) + v.Rem(b, a) + default: + u.Set(a) + v.Set(b) + } + + // v might be 0 now + if len(v.abs) == 0 { + return u + } + // u > 0 && v > 0 + + // determine largest k such that u = u' << k, v = v' << k + k := u.abs.trailingZeroBits() + if vk := v.abs.trailingZeroBits(); vk < k { + k = vk + } + u.Rsh(u, k) + v.Rsh(v, k) + + // determine t (we know that u > 0) + t := new(Int) + if u.abs[0]&1 != 0 { + // u is odd + t.Neg(v) + } else { + t.Set(u) + } + + for len(t.abs) > 0 { + // reduce t + t.Rsh(t, t.abs.trailingZeroBits()) + if t.neg { + v, t = t, v + v.neg = len(v.abs) > 0 && !v.neg // 0 has no sign + } else { + u, t = t, u + } + t.Sub(u, v) + } + + return z.Lsh(u, k) +} + +// ProbablyPrime performs n Miller-Rabin tests to check whether x is prime. +// If it returns true, x is prime with probability 1 - 1/4^n. +// If it returns false, x is not prime. n must be > 0. +func (x *Int) ProbablyPrime(n int) bool { + if n <= 0 { + panic("non-positive n for ProbablyPrime") + } + return !x.neg && x.abs.probablyPrime(n) +} + +// Rand sets z to a pseudo-random number in [0, n) and returns z. +func (z *Int) Rand(rnd *rand.Rand, n *Int) *Int { + z.neg = false + if n.neg == true || len(n.abs) == 0 { + z.abs = nil + return z + } + z.abs = z.abs.random(rnd, n.abs, n.abs.bitLen()) + return z +} + +// ModInverse sets z to the multiplicative inverse of g in the ring ℤ/nℤ +// and returns z. If g and n are not relatively prime, the result is undefined. +func (z *Int) ModInverse(g, n *Int) *Int { + var d Int + d.GCD(z, nil, g, n) + // x and y are such that g*x + n*y = d. Since g and n are + // relatively prime, d = 1. Taking that modulo n results in + // g*x = 1, therefore x is the inverse element. + if z.neg { + z.Add(z, n) + } + return z +} + +// Jacobi returns the Jacobi symbol (x/y), either +1, -1, or 0. +// The y argument must be an odd integer. +func Jacobi(x, y *Int) int { + if len(y.abs) == 0 || y.abs[0]&1 == 0 { + panic(fmt.Sprintf("big: invalid 2nd argument to Int.Jacobi: need odd integer but got %s", y)) + } + + // We use the formulation described in chapter 2, section 2.4, + // "The Yacas Book of Algorithms": + // http://yacas.sourceforge.net/Algo.book.pdf + + var a, b, c Int + a.Set(x) + b.Set(y) + j := 1 + + if b.neg { + if a.neg { + j = -1 + } + b.neg = false + } + + for { + if b.Cmp(intOne) == 0 { + return j + } + if len(a.abs) == 0 { + return 0 + } + a.Mod(&a, &b) + if len(a.abs) == 0 { + return 0 + } + // a > 0 + + // handle factors of 2 in 'a' + s := a.abs.trailingZeroBits() + if s&1 != 0 { + bmod8 := b.abs[0] & 7 + if bmod8 == 3 || bmod8 == 5 { + j = -j + } + } + c.Rsh(&a, s) // a = 2^s*c + + // swap numerator and denominator + if b.abs[0]&3 == 3 && c.abs[0]&3 == 3 { + j = -j + } + a.Set(&b) + b.Set(&c) + } +} + +// ModSqrt sets z to a square root of x mod p if such a square root exists, and +// returns z. The modulus p must be an odd prime. If x is not a square mod p, +// ModSqrt leaves z unchanged and returns nil. This function panics if p is +// not an odd integer. +func (z *Int) ModSqrt(x, p *Int) *Int { + switch Jacobi(x, p) { + case -1: + return nil // x is not a square mod p + case 0: + return z.SetInt64(0) // sqrt(0) mod p = 0 + case 1: + break + } + if x.neg || x.Cmp(p) >= 0 { // ensure 0 <= x < p + x = new(Int).Mod(x, p) + } + + // Break p-1 into s*2^e such that s is odd. + var s Int + s.Sub(p, intOne) + e := s.abs.trailingZeroBits() + s.Rsh(&s, e) + + // find some non-square n + var n Int + n.SetInt64(2) + for Jacobi(&n, p) != -1 { + n.Add(&n, intOne) + } + + // Core of the Tonelli-Shanks algorithm. Follows the description in + // section 6 of "Square roots from 1; 24, 51, 10 to Dan Shanks" by Ezra + // Brown: + // https://www.maa.org/sites/default/files/pdf/upload_library/22/Polya/07468342.di020786.02p0470a.pdf + var y, b, g, t Int + y.Add(&s, intOne) + y.Rsh(&y, 1) + y.Exp(x, &y, p) // y = x^((s+1)/2) + b.Exp(x, &s, p) // b = x^s + g.Exp(&n, &s, p) // g = n^s + r := e + for { + // find the least m such that ord_p(b) = 2^m + var m uint + t.Set(&b) + for t.Cmp(intOne) != 0 { + t.Mul(&t, &t).Mod(&t, p) + m++ + } + + if m == 0 { + return z.Set(&y) + } + + t.SetInt64(0).SetBit(&t, int(r-m-1), 1).Exp(&g, &t, p) + // t = g^(2^(r-m-1)) mod p + g.Mul(&t, &t).Mod(&g, p) // g = g^(2^(r-m)) mod p + y.Mul(&y, &t).Mod(&y, p) + b.Mul(&b, &g).Mod(&b, p) + r = m + } +} + +// Lsh sets z = x << n and returns z. +func (z *Int) Lsh(x *Int, n uint) *Int { + z.abs = z.abs.shl(x.abs, n) + z.neg = x.neg + return z +} + +// Rsh sets z = x >> n and returns z. +func (z *Int) Rsh(x *Int, n uint) *Int { + if x.neg { + // (-x) >> s == ^(x-1) >> s == ^((x-1) >> s) == -(((x-1) >> s) + 1) + t := z.abs.sub(x.abs, natOne) // no underflow because |x| > 0 + t = t.shr(t, n) + z.abs = t.add(t, natOne) + z.neg = true // z cannot be zero if x is negative + return z + } + + z.abs = z.abs.shr(x.abs, n) + z.neg = false + return z +} + +// Bit returns the value of the i'th bit of x. That is, it +// returns (x>>i)&1. The bit index i must be >= 0. +func (x *Int) Bit(i int) uint { + if i == 0 { + // optimization for common case: odd/even test of x + if len(x.abs) > 0 { + return uint(x.abs[0] & 1) // bit 0 is same for -x + } + return 0 + } + if i < 0 { + panic("negative bit index") + } + if x.neg { + t := nat(nil).sub(x.abs, natOne) + return t.bit(uint(i)) ^ 1 + } + + return x.abs.bit(uint(i)) +} + +// SetBit sets z to x, with x's i'th bit set to b (0 or 1). +// That is, if b is 1 SetBit sets z = x | (1 << i); +// if b is 0 SetBit sets z = x &^ (1 << i). If b is not 0 or 1, +// SetBit will panic. +func (z *Int) SetBit(x *Int, i int, b uint) *Int { + if i < 0 { + panic("negative bit index") + } + if x.neg { + t := z.abs.sub(x.abs, natOne) + t = t.setBit(t, uint(i), b^1) + z.abs = t.add(t, natOne) + z.neg = len(z.abs) > 0 + return z + } + z.abs = z.abs.setBit(x.abs, uint(i), b) + z.neg = false + return z +} + +// And sets z = x & y and returns z. +func (z *Int) And(x, y *Int) *Int { + if x.neg == y.neg { + if x.neg { + // (-x) & (-y) == ^(x-1) & ^(y-1) == ^((x-1) | (y-1)) == -(((x-1) | (y-1)) + 1) + x1 := nat(nil).sub(x.abs, natOne) + y1 := nat(nil).sub(y.abs, natOne) + z.abs = z.abs.add(z.abs.or(x1, y1), natOne) + z.neg = true // z cannot be zero if x and y are negative + return z + } + + // x & y == x & y + z.abs = z.abs.and(x.abs, y.abs) + z.neg = false + return z + } + + // x.neg != y.neg + if x.neg { + x, y = y, x // & is symmetric + } + + // x & (-y) == x & ^(y-1) == x &^ (y-1) + y1 := nat(nil).sub(y.abs, natOne) + z.abs = z.abs.andNot(x.abs, y1) + z.neg = false + return z +} + +// AndNot sets z = x &^ y and returns z. +func (z *Int) AndNot(x, y *Int) *Int { + if x.neg == y.neg { + if x.neg { + // (-x) &^ (-y) == ^(x-1) &^ ^(y-1) == ^(x-1) & (y-1) == (y-1) &^ (x-1) + x1 := nat(nil).sub(x.abs, natOne) + y1 := nat(nil).sub(y.abs, natOne) + z.abs = z.abs.andNot(y1, x1) + z.neg = false + return z + } + + // x &^ y == x &^ y + z.abs = z.abs.andNot(x.abs, y.abs) + z.neg = false + return z + } + + if x.neg { + // (-x) &^ y == ^(x-1) &^ y == ^(x-1) & ^y == ^((x-1) | y) == -(((x-1) | y) + 1) + x1 := nat(nil).sub(x.abs, natOne) + z.abs = z.abs.add(z.abs.or(x1, y.abs), natOne) + z.neg = true // z cannot be zero if x is negative and y is positive + return z + } + + // x &^ (-y) == x &^ ^(y-1) == x & (y-1) + y1 := nat(nil).sub(y.abs, natOne) + z.abs = z.abs.and(x.abs, y1) + z.neg = false + return z +} + +// Or sets z = x | y and returns z. +func (z *Int) Or(x, y *Int) *Int { + if x.neg == y.neg { + if x.neg { + // (-x) | (-y) == ^(x-1) | ^(y-1) == ^((x-1) & (y-1)) == -(((x-1) & (y-1)) + 1) + x1 := nat(nil).sub(x.abs, natOne) + y1 := nat(nil).sub(y.abs, natOne) + z.abs = z.abs.add(z.abs.and(x1, y1), natOne) + z.neg = true // z cannot be zero if x and y are negative + return z + } + + // x | y == x | y + z.abs = z.abs.or(x.abs, y.abs) + z.neg = false + return z + } + + // x.neg != y.neg + if x.neg { + x, y = y, x // | is symmetric + } + + // x | (-y) == x | ^(y-1) == ^((y-1) &^ x) == -(^((y-1) &^ x) + 1) + y1 := nat(nil).sub(y.abs, natOne) + z.abs = z.abs.add(z.abs.andNot(y1, x.abs), natOne) + z.neg = true // z cannot be zero if one of x or y is negative + return z +} + +// Xor sets z = x ^ y and returns z. +func (z *Int) Xor(x, y *Int) *Int { + if x.neg == y.neg { + if x.neg { + // (-x) ^ (-y) == ^(x-1) ^ ^(y-1) == (x-1) ^ (y-1) + x1 := nat(nil).sub(x.abs, natOne) + y1 := nat(nil).sub(y.abs, natOne) + z.abs = z.abs.xor(x1, y1) + z.neg = false + return z + } + + // x ^ y == x ^ y + z.abs = z.abs.xor(x.abs, y.abs) + z.neg = false + return z + } + + // x.neg != y.neg + if x.neg { + x, y = y, x // ^ is symmetric + } + + // x ^ (-y) == x ^ ^(y-1) == ^(x ^ (y-1)) == -((x ^ (y-1)) + 1) + y1 := nat(nil).sub(y.abs, natOne) + z.abs = z.abs.add(z.abs.xor(x.abs, y1), natOne) + z.neg = true // z cannot be zero if only one of x or y is negative + return z +} + +// Not sets z = ^x and returns z. +func (z *Int) Not(x *Int) *Int { + if x.neg { + // ^(-x) == ^(^(x-1)) == x-1 + z.abs = z.abs.sub(x.abs, natOne) + z.neg = false + return z + } + + // ^x == -x-1 == -(x+1) + z.abs = z.abs.add(x.abs, natOne) + z.neg = true // z cannot be zero if x is positive + return z +} + +// Gob codec version. Permits backward-compatible changes to the encoding. +const intGobVersion byte = 1 + +// GobEncode implements the gob.GobEncoder interface. +func (x *Int) GobEncode() ([]byte, error) { + if x == nil { + return nil, nil + } + buf := make([]byte, 1+len(x.abs)*_S) // extra byte for version and sign bit + i := x.abs.bytes(buf) - 1 // i >= 0 + b := intGobVersion << 1 // make space for sign bit + if x.neg { + b |= 1 + } + buf[i] = b + return buf[i:], nil +} + +// GobDecode implements the gob.GobDecoder interface. +func (z *Int) GobDecode(buf []byte) error { + if len(buf) == 0 { + // Other side sent a nil or default value. + *z = Int{} + return nil + } + b := buf[0] + if b>>1 != intGobVersion { + return fmt.Errorf("Int.GobDecode: encoding version %d not supported", b>>1) + } + z.neg = b&1 != 0 + z.abs = z.abs.setBytes(buf[1:]) + return nil +} + +// MarshalJSON implements the json.Marshaler interface. +func (z *Int) MarshalJSON() ([]byte, error) { + // TODO(gri): get rid of the []byte/string conversions + return []byte(z.String()), nil +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (z *Int) UnmarshalJSON(text []byte) error { + // TODO(gri): get rid of the []byte/string conversions + if _, ok := z.SetString(string(text), 0); !ok { + return fmt.Errorf("math/big: cannot unmarshal %q into a *big.Int", text) + } + return nil +} + +// MarshalText implements the encoding.TextMarshaler interface. +func (z *Int) MarshalText() (text []byte, err error) { + return []byte(z.String()), nil +} + +// UnmarshalText implements the encoding.TextUnmarshaler interface. +func (z *Int) UnmarshalText(text []byte) error { + if _, ok := z.SetString(string(text), 0); !ok { + return fmt.Errorf("math/big: cannot unmarshal %q into a *big.Int", text) + } + return nil +} diff --git a/src/cmd/compile/internal/big/int_test.go b/src/cmd/compile/internal/big/int_test.go new file mode 100644 index 0000000000000000000000000000000000000000..16eed9a770e55a1989de03dc5dcf336cb36e835f --- /dev/null +++ b/src/cmd/compile/internal/big/int_test.go @@ -0,0 +1,1525 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package big + +import ( + "bytes" + "encoding/gob" + "encoding/hex" + "encoding/json" + "encoding/xml" + "fmt" + "math/rand" + "testing" + "testing/quick" +) + +func isNormalized(x *Int) bool { + if len(x.abs) == 0 { + return !x.neg + } + // len(x.abs) > 0 + return x.abs[len(x.abs)-1] != 0 +} + +type funZZ func(z, x, y *Int) *Int +type argZZ struct { + z, x, y *Int +} + +var sumZZ = []argZZ{ + {NewInt(0), NewInt(0), NewInt(0)}, + {NewInt(1), NewInt(1), NewInt(0)}, + {NewInt(1111111110), NewInt(123456789), NewInt(987654321)}, + {NewInt(-1), NewInt(-1), NewInt(0)}, + {NewInt(864197532), NewInt(-123456789), NewInt(987654321)}, + {NewInt(-1111111110), NewInt(-123456789), NewInt(-987654321)}, +} + +var prodZZ = []argZZ{ + {NewInt(0), NewInt(0), NewInt(0)}, + {NewInt(0), NewInt(1), NewInt(0)}, + {NewInt(1), NewInt(1), NewInt(1)}, + {NewInt(-991 * 991), NewInt(991), NewInt(-991)}, + // TODO(gri) add larger products +} + +func TestSignZ(t *testing.T) { + var zero Int + for _, a := range sumZZ { + s := a.z.Sign() + e := a.z.Cmp(&zero) + if s != e { + t.Errorf("got %d; want %d for z = %v", s, e, a.z) + } + } +} + +func TestSetZ(t *testing.T) { + for _, a := range sumZZ { + var z Int + z.Set(a.z) + if !isNormalized(&z) { + t.Errorf("%v is not normalized", z) + } + if (&z).Cmp(a.z) != 0 { + t.Errorf("got z = %v; want %v", z, a.z) + } + } +} + +func TestAbsZ(t *testing.T) { + var zero Int + for _, a := range sumZZ { + var z Int + z.Abs(a.z) + var e Int + e.Set(a.z) + if e.Cmp(&zero) < 0 { + e.Sub(&zero, &e) + } + if z.Cmp(&e) != 0 { + t.Errorf("got z = %v; want %v", z, e) + } + } +} + +func testFunZZ(t *testing.T, msg string, f funZZ, a argZZ) { + var z Int + f(&z, a.x, a.y) + if !isNormalized(&z) { + t.Errorf("%s%v is not normalized", msg, z) + } + if (&z).Cmp(a.z) != 0 { + t.Errorf("%s%+v\n\tgot z = %v; want %v", msg, a, &z, a.z) + } +} + +func TestSumZZ(t *testing.T) { + AddZZ := func(z, x, y *Int) *Int { return z.Add(x, y) } + SubZZ := func(z, x, y *Int) *Int { return z.Sub(x, y) } + for _, a := range sumZZ { + arg := a + testFunZZ(t, "AddZZ", AddZZ, arg) + + arg = argZZ{a.z, a.y, a.x} + testFunZZ(t, "AddZZ symmetric", AddZZ, arg) + + arg = argZZ{a.x, a.z, a.y} + testFunZZ(t, "SubZZ", SubZZ, arg) + + arg = argZZ{a.y, a.z, a.x} + testFunZZ(t, "SubZZ symmetric", SubZZ, arg) + } +} + +func TestProdZZ(t *testing.T) { + MulZZ := func(z, x, y *Int) *Int { return z.Mul(x, y) } + for _, a := range prodZZ { + arg := a + testFunZZ(t, "MulZZ", MulZZ, arg) + + arg = argZZ{a.z, a.y, a.x} + testFunZZ(t, "MulZZ symmetric", MulZZ, arg) + } +} + +// mulBytes returns x*y via grade school multiplication. Both inputs +// and the result are assumed to be in big-endian representation (to +// match the semantics of Int.Bytes and Int.SetBytes). +func mulBytes(x, y []byte) []byte { + z := make([]byte, len(x)+len(y)) + + // multiply + k0 := len(z) - 1 + for j := len(y) - 1; j >= 0; j-- { + d := int(y[j]) + if d != 0 { + k := k0 + carry := 0 + for i := len(x) - 1; i >= 0; i-- { + t := int(z[k]) + int(x[i])*d + carry + z[k], carry = byte(t), t>>8 + k-- + } + z[k] = byte(carry) + } + k0-- + } + + // normalize (remove leading 0's) + i := 0 + for i < len(z) && z[i] == 0 { + i++ + } + + return z[i:] +} + +func checkMul(a, b []byte) bool { + var x, y, z1 Int + x.SetBytes(a) + y.SetBytes(b) + z1.Mul(&x, &y) + + var z2 Int + z2.SetBytes(mulBytes(a, b)) + + return z1.Cmp(&z2) == 0 +} + +func TestMul(t *testing.T) { + if err := quick.Check(checkMul, nil); err != nil { + t.Error(err) + } +} + +var mulRangesZ = []struct { + a, b int64 + prod string +}{ + // entirely positive ranges are covered by mulRangesN + {-1, 1, "0"}, + {-2, -1, "2"}, + {-3, -2, "6"}, + {-3, -1, "-6"}, + {1, 3, "6"}, + {-10, -10, "-10"}, + {0, -1, "1"}, // empty range + {-1, -100, "1"}, // empty range + {-1, 1, "0"}, // range includes 0 + {-1e9, 0, "0"}, // range includes 0 + {-1e9, 1e9, "0"}, // range includes 0 + {-10, -1, "3628800"}, // 10! + {-20, -2, "-2432902008176640000"}, // -20! + {-99, -1, + "-933262154439441526816992388562667004907159682643816214685929" + + "638952175999932299156089414639761565182862536979208272237582" + + "511852109168640000000000000000000000", // -99! + }, +} + +func TestMulRangeZ(t *testing.T) { + var tmp Int + // test entirely positive ranges + for i, r := range mulRangesN { + prod := tmp.MulRange(int64(r.a), int64(r.b)).String() + if prod != r.prod { + t.Errorf("#%da: got %s; want %s", i, prod, r.prod) + } + } + // test other ranges + for i, r := range mulRangesZ { + prod := tmp.MulRange(r.a, r.b).String() + if prod != r.prod { + t.Errorf("#%db: got %s; want %s", i, prod, r.prod) + } + } +} + +func TestBinomial(t *testing.T) { + var z Int + for _, test := range []struct { + n, k int64 + want string + }{ + {0, 0, "1"}, + {0, 1, "0"}, + {1, 0, "1"}, + {1, 1, "1"}, + {1, 10, "0"}, + {4, 0, "1"}, + {4, 1, "4"}, + {4, 2, "6"}, + {4, 3, "4"}, + {4, 4, "1"}, + {10, 1, "10"}, + {10, 9, "10"}, + {10, 5, "252"}, + {11, 5, "462"}, + {11, 6, "462"}, + {100, 10, "17310309456440"}, + {100, 90, "17310309456440"}, + {1000, 10, "263409560461970212832400"}, + {1000, 990, "263409560461970212832400"}, + } { + if got := z.Binomial(test.n, test.k).String(); got != test.want { + t.Errorf("Binomial(%d, %d) = %s; want %s", test.n, test.k, got, test.want) + } + } +} + +func BenchmarkBinomial(b *testing.B) { + var z Int + for i := b.N - 1; i >= 0; i-- { + z.Binomial(1000, 990) + } +} + +// Examples from the Go Language Spec, section "Arithmetic operators" +var divisionSignsTests = []struct { + x, y int64 + q, r int64 // T-division + d, m int64 // Euclidian division +}{ + {5, 3, 1, 2, 1, 2}, + {-5, 3, -1, -2, -2, 1}, + {5, -3, -1, 2, -1, 2}, + {-5, -3, 1, -2, 2, 1}, + {1, 2, 0, 1, 0, 1}, + {8, 4, 2, 0, 2, 0}, +} + +func TestDivisionSigns(t *testing.T) { + for i, test := range divisionSignsTests { + x := NewInt(test.x) + y := NewInt(test.y) + q := NewInt(test.q) + r := NewInt(test.r) + d := NewInt(test.d) + m := NewInt(test.m) + + q1 := new(Int).Quo(x, y) + r1 := new(Int).Rem(x, y) + if !isNormalized(q1) { + t.Errorf("#%d Quo: %v is not normalized", i, *q1) + } + if !isNormalized(r1) { + t.Errorf("#%d Rem: %v is not normalized", i, *r1) + } + if q1.Cmp(q) != 0 || r1.Cmp(r) != 0 { + t.Errorf("#%d QuoRem: got (%s, %s), want (%s, %s)", i, q1, r1, q, r) + } + + q2, r2 := new(Int).QuoRem(x, y, new(Int)) + if !isNormalized(q2) { + t.Errorf("#%d Quo: %v is not normalized", i, *q2) + } + if !isNormalized(r2) { + t.Errorf("#%d Rem: %v is not normalized", i, *r2) + } + if q2.Cmp(q) != 0 || r2.Cmp(r) != 0 { + t.Errorf("#%d QuoRem: got (%s, %s), want (%s, %s)", i, q2, r2, q, r) + } + + d1 := new(Int).Div(x, y) + m1 := new(Int).Mod(x, y) + if !isNormalized(d1) { + t.Errorf("#%d Div: %v is not normalized", i, *d1) + } + if !isNormalized(m1) { + t.Errorf("#%d Mod: %v is not normalized", i, *m1) + } + if d1.Cmp(d) != 0 || m1.Cmp(m) != 0 { + t.Errorf("#%d DivMod: got (%s, %s), want (%s, %s)", i, d1, m1, d, m) + } + + d2, m2 := new(Int).DivMod(x, y, new(Int)) + if !isNormalized(d2) { + t.Errorf("#%d Div: %v is not normalized", i, *d2) + } + if !isNormalized(m2) { + t.Errorf("#%d Mod: %v is not normalized", i, *m2) + } + if d2.Cmp(d) != 0 || m2.Cmp(m) != 0 { + t.Errorf("#%d DivMod: got (%s, %s), want (%s, %s)", i, d2, m2, d, m) + } + } +} + +func norm(x nat) nat { + i := len(x) + for i > 0 && x[i-1] == 0 { + i-- + } + return x[:i] +} + +func TestBits(t *testing.T) { + for _, test := range []nat{ + nil, + {0}, + {1}, + {0, 1, 2, 3, 4}, + {4, 3, 2, 1, 0}, + {4, 3, 2, 1, 0, 0, 0, 0}, + } { + var z Int + z.neg = true + got := z.SetBits(test) + want := norm(test) + if got.abs.cmp(want) != 0 { + t.Errorf("SetBits(%v) = %v; want %v", test, got.abs, want) + } + + if got.neg { + t.Errorf("SetBits(%v): got negative result", test) + } + + bits := nat(z.Bits()) + if bits.cmp(want) != 0 { + t.Errorf("%v.Bits() = %v; want %v", z.abs, bits, want) + } + } +} + +func checkSetBytes(b []byte) bool { + hex1 := hex.EncodeToString(new(Int).SetBytes(b).Bytes()) + hex2 := hex.EncodeToString(b) + + for len(hex1) < len(hex2) { + hex1 = "0" + hex1 + } + + for len(hex1) > len(hex2) { + hex2 = "0" + hex2 + } + + return hex1 == hex2 +} + +func TestSetBytes(t *testing.T) { + if err := quick.Check(checkSetBytes, nil); err != nil { + t.Error(err) + } +} + +func checkBytes(b []byte) bool { + b2 := new(Int).SetBytes(b).Bytes() + return bytes.Equal(b, b2) +} + +func TestBytes(t *testing.T) { + if err := quick.Check(checkBytes, nil); err != nil { + t.Error(err) + } +} + +func checkQuo(x, y []byte) bool { + u := new(Int).SetBytes(x) + v := new(Int).SetBytes(y) + + if len(v.abs) == 0 { + return true + } + + r := new(Int) + q, r := new(Int).QuoRem(u, v, r) + + if r.Cmp(v) >= 0 { + return false + } + + uprime := new(Int).Set(q) + uprime.Mul(uprime, v) + uprime.Add(uprime, r) + + return uprime.Cmp(u) == 0 +} + +var quoTests = []struct { + x, y string + q, r string +}{ + { + "476217953993950760840509444250624797097991362735329973741718102894495832294430498335824897858659711275234906400899559094370964723884706254265559534144986498357", + "9353930466774385905609975137998169297361893554149986716853295022578535724979483772383667534691121982974895531435241089241440253066816724367338287092081996", + "50911", + "1", + }, + { + "11510768301994997771168", + "1328165573307167369775", + "8", + "885443715537658812968", + }, +} + +func TestQuo(t *testing.T) { + if err := quick.Check(checkQuo, nil); err != nil { + t.Error(err) + } + + for i, test := range quoTests { + x, _ := new(Int).SetString(test.x, 10) + y, _ := new(Int).SetString(test.y, 10) + expectedQ, _ := new(Int).SetString(test.q, 10) + expectedR, _ := new(Int).SetString(test.r, 10) + + r := new(Int) + q, r := new(Int).QuoRem(x, y, r) + + if q.Cmp(expectedQ) != 0 || r.Cmp(expectedR) != 0 { + t.Errorf("#%d got (%s, %s) want (%s, %s)", i, q, r, expectedQ, expectedR) + } + } +} + +func TestQuoStepD6(t *testing.T) { + // See Knuth, Volume 2, section 4.3.1, exercise 21. This code exercises + // a code path which only triggers 1 in 10^{-19} cases. + + u := &Int{false, nat{0, 0, 1 + 1<<(_W-1), _M ^ (1 << (_W - 1))}} + v := &Int{false, nat{5, 2 + 1<<(_W-1), 1 << (_W - 1)}} + + r := new(Int) + q, r := new(Int).QuoRem(u, v, r) + const expectedQ64 = "18446744073709551613" + const expectedR64 = "3138550867693340382088035895064302439801311770021610913807" + const expectedQ32 = "4294967293" + const expectedR32 = "39614081266355540837921718287" + if q.String() != expectedQ64 && q.String() != expectedQ32 || + r.String() != expectedR64 && r.String() != expectedR32 { + t.Errorf("got (%s, %s) want (%s, %s) or (%s, %s)", q, r, expectedQ64, expectedR64, expectedQ32, expectedR32) + } +} + +var bitLenTests = []struct { + in string + out int +}{ + {"-1", 1}, + {"0", 0}, + {"1", 1}, + {"2", 2}, + {"4", 3}, + {"0xabc", 12}, + {"0x8000", 16}, + {"0x80000000", 32}, + {"0x800000000000", 48}, + {"0x8000000000000000", 64}, + {"0x80000000000000000000", 80}, + {"-0x4000000000000000000000", 87}, +} + +func TestBitLen(t *testing.T) { + for i, test := range bitLenTests { + x, ok := new(Int).SetString(test.in, 0) + if !ok { + t.Errorf("#%d test input invalid: %s", i, test.in) + continue + } + + if n := x.BitLen(); n != test.out { + t.Errorf("#%d got %d want %d", i, n, test.out) + } + } +} + +var expTests = []struct { + x, y, m string + out string +}{ + // y <= 0 + {"0", "0", "", "1"}, + {"1", "0", "", "1"}, + {"-10", "0", "", "1"}, + {"1234", "-1", "", "1"}, + + // m == 1 + {"0", "0", "1", "0"}, + {"1", "0", "1", "0"}, + {"-10", "0", "1", "0"}, + {"1234", "-1", "1", "0"}, + + // misc + {"5", "1", "3", "2"}, + {"5", "-7", "", "1"}, + {"-5", "-7", "", "1"}, + {"5", "0", "", "1"}, + {"-5", "0", "", "1"}, + {"5", "1", "", "5"}, + {"-5", "1", "", "-5"}, + {"-5", "1", "7", "2"}, + {"-2", "3", "2", "0"}, + {"5", "2", "", "25"}, + {"1", "65537", "2", "1"}, + {"0x8000000000000000", "2", "", "0x40000000000000000000000000000000"}, + {"0x8000000000000000", "2", "6719", "4944"}, + {"0x8000000000000000", "3", "6719", "5447"}, + {"0x8000000000000000", "1000", "6719", "1603"}, + {"0x8000000000000000", "1000000", "6719", "3199"}, + {"0x8000000000000000", "-1000000", "6719", "1"}, + { + "2938462938472983472983659726349017249287491026512746239764525612965293865296239471239874193284792387498274256129746192347", + "298472983472983471903246121093472394872319615612417471234712061", + "29834729834729834729347290846729561262544958723956495615629569234729836259263598127342374289365912465901365498236492183464", + "23537740700184054162508175125554701713153216681790245129157191391322321508055833908509185839069455749219131480588829346291", + }, + // test case for issue 8822 + { + "-0x1BCE04427D8032319A89E5C4136456671AC620883F2C4139E57F91307C485AD2D6204F4F87A58262652DB5DBBAC72B0613E51B835E7153BEC6068F5C8D696B74DBD18FEC316AEF73985CF0475663208EB46B4F17DD9DA55367B03323E5491A70997B90C059FB34809E6EE55BCFBD5F2F52233BFE62E6AA9E4E26A1D4C2439883D14F2633D55D8AA66A1ACD5595E778AC3A280517F1157989E70C1A437B849F1877B779CC3CDDEDE2DAA6594A6C66D181A00A5F777EE60596D8773998F6E988DEAE4CCA60E4DDCF9590543C89F74F603259FCAD71660D30294FBBE6490300F78A9D63FA660DC9417B8B9DDA28BEB3977B621B988E23D4D954F322C3540541BC649ABD504C50FADFD9F0987D58A2BF689313A285E773FF02899A6EF887D1D4A0D2", + "0xB08FFB20760FFED58FADA86DFEF71AD72AA0FA763219618FE022C197E54708BB1191C66470250FCE8879487507CEE41381CA4D932F81C2B3F1AB20B539D50DCD", + "0xAC6BDB41324A9A9BF166DE5E1389582FAF72B6651987EE07FC3192943DB56050A37329CBB4A099ED8193E0757767A13DD52312AB4B03310DCD7F48A9DA04FD50E8083969EDB767B0CF6095179A163AB3661A05FBD5FAAAE82918A9962F0B93B855F97993EC975EEAA80D740ADBF4FF747359D041D5C33EA71D281E446B14773BCA97B43A23FB801676BD207A436C6481F1D2B9078717461A5B9D32E688F87748544523B524B0D57D5EA77A2775D2ECFA032CFBDBF52FB3786160279004E57AE6AF874E7303CE53299CCC041C7BC308D82A5698F3A8D0C38271AE35F8E9DBFBB694B5C803D89F7AE435DE236D525F54759B65E372FCD68EF20FA7111F9E4AFF73", + "21484252197776302499639938883777710321993113097987201050501182909581359357618579566746556372589385361683610524730509041328855066514963385522570894839035884713051640171474186548713546686476761306436434146475140156284389181808675016576845833340494848283681088886584219750554408060556769486628029028720727393293111678826356480455433909233520504112074401376133077150471237549474149190242010469539006449596611576612573955754349042329130631128234637924786466585703488460540228477440853493392086251021228087076124706778899179648655221663765993962724699135217212118535057766739392069738618682722216712319320435674779146070442", + }, +} + +func TestExp(t *testing.T) { + for i, test := range expTests { + x, ok1 := new(Int).SetString(test.x, 0) + y, ok2 := new(Int).SetString(test.y, 0) + out, ok3 := new(Int).SetString(test.out, 0) + + var ok4 bool + var m *Int + + if len(test.m) == 0 { + m, ok4 = nil, true + } else { + m, ok4 = new(Int).SetString(test.m, 0) + } + + if !ok1 || !ok2 || !ok3 || !ok4 { + t.Errorf("#%d: error in input", i) + continue + } + + z1 := new(Int).Exp(x, y, m) + if !isNormalized(z1) { + t.Errorf("#%d: %v is not normalized", i, *z1) + } + if z1.Cmp(out) != 0 { + t.Errorf("#%d: got %s want %s", i, z1, out) + } + + if m == nil { + // The result should be the same as for m == 0; + // specifically, there should be no div-zero panic. + m = &Int{abs: nat{}} // m != nil && len(m.abs) == 0 + z2 := new(Int).Exp(x, y, m) + if z2.Cmp(z1) != 0 { + t.Errorf("#%d: got %s want %s", i, z2, z1) + } + } + } +} + +func checkGcd(aBytes, bBytes []byte) bool { + x := new(Int) + y := new(Int) + a := new(Int).SetBytes(aBytes) + b := new(Int).SetBytes(bBytes) + + d := new(Int).GCD(x, y, a, b) + x.Mul(x, a) + y.Mul(y, b) + x.Add(x, y) + + return x.Cmp(d) == 0 +} + +var gcdTests = []struct { + d, x, y, a, b string +}{ + // a <= 0 || b <= 0 + {"0", "0", "0", "0", "0"}, + {"0", "0", "0", "0", "7"}, + {"0", "0", "0", "11", "0"}, + {"0", "0", "0", "-77", "35"}, + {"0", "0", "0", "64515", "-24310"}, + {"0", "0", "0", "-64515", "-24310"}, + + {"1", "-9", "47", "120", "23"}, + {"7", "1", "-2", "77", "35"}, + {"935", "-3", "8", "64515", "24310"}, + {"935000000000000000", "-3", "8", "64515000000000000000", "24310000000000000000"}, + {"1", "-221", "22059940471369027483332068679400581064239780177629666810348940098015901108344", "98920366548084643601728869055592650835572950932266967461790948584315647051443", "991"}, + + // test early exit (after one Euclidean iteration) in binaryGCD + {"1", "", "", "1", "98920366548084643601728869055592650835572950932266967461790948584315647051443"}, +} + +func testGcd(t *testing.T, d, x, y, a, b *Int) { + var X *Int + if x != nil { + X = new(Int) + } + var Y *Int + if y != nil { + Y = new(Int) + } + + D := new(Int).GCD(X, Y, a, b) + if D.Cmp(d) != 0 { + t.Errorf("GCD(%s, %s): got d = %s, want %s", a, b, D, d) + } + if x != nil && X.Cmp(x) != 0 { + t.Errorf("GCD(%s, %s): got x = %s, want %s", a, b, X, x) + } + if y != nil && Y.Cmp(y) != 0 { + t.Errorf("GCD(%s, %s): got y = %s, want %s", a, b, Y, y) + } + + // binaryGCD requires a > 0 && b > 0 + if a.Sign() <= 0 || b.Sign() <= 0 { + return + } + + D.binaryGCD(a, b) + if D.Cmp(d) != 0 { + t.Errorf("binaryGcd(%s, %s): got d = %s, want %s", a, b, D, d) + } +} + +func TestGcd(t *testing.T) { + for _, test := range gcdTests { + d, _ := new(Int).SetString(test.d, 0) + x, _ := new(Int).SetString(test.x, 0) + y, _ := new(Int).SetString(test.y, 0) + a, _ := new(Int).SetString(test.a, 0) + b, _ := new(Int).SetString(test.b, 0) + + testGcd(t, d, nil, nil, a, b) + testGcd(t, d, x, nil, a, b) + testGcd(t, d, nil, y, a, b) + testGcd(t, d, x, y, a, b) + } + + quick.Check(checkGcd, nil) +} + +var primes = []string{ + "2", + "3", + "5", + "7", + "11", + + "13756265695458089029", + "13496181268022124907", + "10953742525620032441", + "17908251027575790097", + + // https://golang.org/issue/638 + "18699199384836356663", + + "98920366548084643601728869055592650835572950932266967461790948584315647051443", + "94560208308847015747498523884063394671606671904944666360068158221458669711639", + + // http://primes.utm.edu/lists/small/small3.html + "449417999055441493994709297093108513015373787049558499205492347871729927573118262811508386655998299074566974373711472560655026288668094291699357843464363003144674940345912431129144354948751003607115263071543163", + "230975859993204150666423538988557839555560243929065415434980904258310530753006723857139742334640122533598517597674807096648905501653461687601339782814316124971547968912893214002992086353183070342498989426570593", + "5521712099665906221540423207019333379125265462121169655563495403888449493493629943498064604536961775110765377745550377067893607246020694972959780839151452457728855382113555867743022746090187341871655890805971735385789993", + "203956878356401977405765866929034577280193993314348263094772646453283062722701277632936616063144088173312372882677123879538709400158306567338328279154499698366071906766440037074217117805690872792848149112022286332144876183376326512083574821647933992961249917319836219304274280243803104015000563790123", + + // ECC primes: http://tools.ietf.org/html/draft-ladd-safecurves-02 + "3618502788666131106986593281521497120414687020801267626233049500247285301239", // Curve1174: 2^251-9 + "57896044618658097711785492504343953926634992332820282019728792003956564819949", // Curve25519: 2^255-19 + "9850501549098619803069760025035903451269934817616361666987073351061430442874302652853566563721228910201656997576599", // E-382: 2^382-105 + "42307582002575910332922579714097346549017899709713998034217522897561970639123926132812109468141778230245837569601494931472367", // Curve41417: 2^414-17 + "6864797660130609714981900799081393217269435300143305409394463459185543183397656052122559640661454554977296311391480858037121987999716643812574028291115057151", // E-521: 2^521-1 +} + +var composites = []string{ + "0", + "1", + "21284175091214687912771199898307297748211672914763848041968395774954376176754", + "6084766654921918907427900243509372380954290099172559290432744450051395395951", + "84594350493221918389213352992032324280367711247940675652888030554255915464401", + "82793403787388584738507275144194252681", +} + +func TestProbablyPrime(t *testing.T) { + nreps := 20 + if testing.Short() { + nreps = 1 + } + for i, s := range primes { + p, _ := new(Int).SetString(s, 10) + if !p.ProbablyPrime(nreps) { + t.Errorf("#%d prime found to be non-prime (%s)", i, s) + } + } + + for i, s := range composites { + c, _ := new(Int).SetString(s, 10) + if c.ProbablyPrime(nreps) { + t.Errorf("#%d composite found to be prime (%s)", i, s) + } + if testing.Short() { + break + } + } + + // check that ProbablyPrime panics if n <= 0 + c := NewInt(11) // a prime + for _, n := range []int{-1, 0, 1} { + func() { + defer func() { + if n <= 0 && recover() == nil { + t.Fatalf("expected panic from ProbablyPrime(%d)", n) + } + }() + if !c.ProbablyPrime(n) { + t.Fatalf("%v should be a prime", c) + } + }() + } +} + +type intShiftTest struct { + in string + shift uint + out string +} + +var rshTests = []intShiftTest{ + {"0", 0, "0"}, + {"-0", 0, "0"}, + {"0", 1, "0"}, + {"0", 2, "0"}, + {"1", 0, "1"}, + {"1", 1, "0"}, + {"1", 2, "0"}, + {"2", 0, "2"}, + {"2", 1, "1"}, + {"-1", 0, "-1"}, + {"-1", 1, "-1"}, + {"-1", 10, "-1"}, + {"-100", 2, "-25"}, + {"-100", 3, "-13"}, + {"-100", 100, "-1"}, + {"4294967296", 0, "4294967296"}, + {"4294967296", 1, "2147483648"}, + {"4294967296", 2, "1073741824"}, + {"18446744073709551616", 0, "18446744073709551616"}, + {"18446744073709551616", 1, "9223372036854775808"}, + {"18446744073709551616", 2, "4611686018427387904"}, + {"18446744073709551616", 64, "1"}, + {"340282366920938463463374607431768211456", 64, "18446744073709551616"}, + {"340282366920938463463374607431768211456", 128, "1"}, +} + +func TestRsh(t *testing.T) { + for i, test := range rshTests { + in, _ := new(Int).SetString(test.in, 10) + expected, _ := new(Int).SetString(test.out, 10) + out := new(Int).Rsh(in, test.shift) + + if !isNormalized(out) { + t.Errorf("#%d: %v is not normalized", i, *out) + } + if out.Cmp(expected) != 0 { + t.Errorf("#%d: got %s want %s", i, out, expected) + } + } +} + +func TestRshSelf(t *testing.T) { + for i, test := range rshTests { + z, _ := new(Int).SetString(test.in, 10) + expected, _ := new(Int).SetString(test.out, 10) + z.Rsh(z, test.shift) + + if !isNormalized(z) { + t.Errorf("#%d: %v is not normalized", i, *z) + } + if z.Cmp(expected) != 0 { + t.Errorf("#%d: got %s want %s", i, z, expected) + } + } +} + +var lshTests = []intShiftTest{ + {"0", 0, "0"}, + {"0", 1, "0"}, + {"0", 2, "0"}, + {"1", 0, "1"}, + {"1", 1, "2"}, + {"1", 2, "4"}, + {"2", 0, "2"}, + {"2", 1, "4"}, + {"2", 2, "8"}, + {"-87", 1, "-174"}, + {"4294967296", 0, "4294967296"}, + {"4294967296", 1, "8589934592"}, + {"4294967296", 2, "17179869184"}, + {"18446744073709551616", 0, "18446744073709551616"}, + {"9223372036854775808", 1, "18446744073709551616"}, + {"4611686018427387904", 2, "18446744073709551616"}, + {"1", 64, "18446744073709551616"}, + {"18446744073709551616", 64, "340282366920938463463374607431768211456"}, + {"1", 128, "340282366920938463463374607431768211456"}, +} + +func TestLsh(t *testing.T) { + for i, test := range lshTests { + in, _ := new(Int).SetString(test.in, 10) + expected, _ := new(Int).SetString(test.out, 10) + out := new(Int).Lsh(in, test.shift) + + if !isNormalized(out) { + t.Errorf("#%d: %v is not normalized", i, *out) + } + if out.Cmp(expected) != 0 { + t.Errorf("#%d: got %s want %s", i, out, expected) + } + } +} + +func TestLshSelf(t *testing.T) { + for i, test := range lshTests { + z, _ := new(Int).SetString(test.in, 10) + expected, _ := new(Int).SetString(test.out, 10) + z.Lsh(z, test.shift) + + if !isNormalized(z) { + t.Errorf("#%d: %v is not normalized", i, *z) + } + if z.Cmp(expected) != 0 { + t.Errorf("#%d: got %s want %s", i, z, expected) + } + } +} + +func TestLshRsh(t *testing.T) { + for i, test := range rshTests { + in, _ := new(Int).SetString(test.in, 10) + out := new(Int).Lsh(in, test.shift) + out = out.Rsh(out, test.shift) + + if !isNormalized(out) { + t.Errorf("#%d: %v is not normalized", i, *out) + } + if in.Cmp(out) != 0 { + t.Errorf("#%d: got %s want %s", i, out, in) + } + } + for i, test := range lshTests { + in, _ := new(Int).SetString(test.in, 10) + out := new(Int).Lsh(in, test.shift) + out.Rsh(out, test.shift) + + if !isNormalized(out) { + t.Errorf("#%d: %v is not normalized", i, *out) + } + if in.Cmp(out) != 0 { + t.Errorf("#%d: got %s want %s", i, out, in) + } + } +} + +var int64Tests = []int64{ + 0, + 1, + -1, + 4294967295, + -4294967295, + 4294967296, + -4294967296, + 9223372036854775807, + -9223372036854775807, + -9223372036854775808, +} + +func TestInt64(t *testing.T) { + for i, testVal := range int64Tests { + in := NewInt(testVal) + out := in.Int64() + + if out != testVal { + t.Errorf("#%d got %d want %d", i, out, testVal) + } + } +} + +var uint64Tests = []uint64{ + 0, + 1, + 4294967295, + 4294967296, + 8589934591, + 8589934592, + 9223372036854775807, + 9223372036854775808, + 18446744073709551615, // 1<<64 - 1 +} + +func TestUint64(t *testing.T) { + in := new(Int) + for i, testVal := range uint64Tests { + in.SetUint64(testVal) + out := in.Uint64() + + if out != testVal { + t.Errorf("#%d got %d want %d", i, out, testVal) + } + + str := fmt.Sprint(testVal) + strOut := in.String() + if strOut != str { + t.Errorf("#%d.String got %s want %s", i, strOut, str) + } + } +} + +var bitwiseTests = []struct { + x, y string + and, or, xor, andNot string +}{ + {"0x00", "0x00", "0x00", "0x00", "0x00", "0x00"}, + {"0x00", "0x01", "0x00", "0x01", "0x01", "0x00"}, + {"0x01", "0x00", "0x00", "0x01", "0x01", "0x01"}, + {"-0x01", "0x00", "0x00", "-0x01", "-0x01", "-0x01"}, + {"-0xaf", "-0x50", "-0xf0", "-0x0f", "0xe1", "0x41"}, + {"0x00", "-0x01", "0x00", "-0x01", "-0x01", "0x00"}, + {"0x01", "0x01", "0x01", "0x01", "0x00", "0x00"}, + {"-0x01", "-0x01", "-0x01", "-0x01", "0x00", "0x00"}, + {"0x07", "0x08", "0x00", "0x0f", "0x0f", "0x07"}, + {"0x05", "0x0f", "0x05", "0x0f", "0x0a", "0x00"}, + {"0xff", "-0x0a", "0xf6", "-0x01", "-0xf7", "0x09"}, + {"0x013ff6", "0x9a4e", "0x1a46", "0x01bffe", "0x01a5b8", "0x0125b0"}, + {"-0x013ff6", "0x9a4e", "0x800a", "-0x0125b2", "-0x01a5bc", "-0x01c000"}, + {"-0x013ff6", "-0x9a4e", "-0x01bffe", "-0x1a46", "0x01a5b8", "0x8008"}, + { + "0x1000009dc6e3d9822cba04129bcbe3401", + "0xb9bd7d543685789d57cb918e833af352559021483cdb05cc21fd", + "0x1000001186210100001000009048c2001", + "0xb9bd7d543685789d57cb918e8bfeff7fddb2ebe87dfbbdfe35fd", + "0xb9bd7d543685789d57ca918e8ae69d6fcdb2eae87df2b97215fc", + "0x8c40c2d8822caa04120b8321400", + }, + { + "0x1000009dc6e3d9822cba04129bcbe3401", + "-0xb9bd7d543685789d57cb918e833af352559021483cdb05cc21fd", + "0x8c40c2d8822caa04120b8321401", + "-0xb9bd7d543685789d57ca918e82229142459020483cd2014001fd", + "-0xb9bd7d543685789d57ca918e8ae69d6fcdb2eae87df2b97215fe", + "0x1000001186210100001000009048c2000", + }, + { + "-0x1000009dc6e3d9822cba04129bcbe3401", + "-0xb9bd7d543685789d57cb918e833af352559021483cdb05cc21fd", + "-0xb9bd7d543685789d57cb918e8bfeff7fddb2ebe87dfbbdfe35fd", + "-0x1000001186210100001000009048c2001", + "0xb9bd7d543685789d57ca918e8ae69d6fcdb2eae87df2b97215fc", + "0xb9bd7d543685789d57ca918e82229142459020483cd2014001fc", + }, +} + +type bitFun func(z, x, y *Int) *Int + +func testBitFun(t *testing.T, msg string, f bitFun, x, y *Int, exp string) { + expected := new(Int) + expected.SetString(exp, 0) + + out := f(new(Int), x, y) + if out.Cmp(expected) != 0 { + t.Errorf("%s: got %s want %s", msg, out, expected) + } +} + +func testBitFunSelf(t *testing.T, msg string, f bitFun, x, y *Int, exp string) { + self := new(Int) + self.Set(x) + expected := new(Int) + expected.SetString(exp, 0) + + self = f(self, self, y) + if self.Cmp(expected) != 0 { + t.Errorf("%s: got %s want %s", msg, self, expected) + } +} + +func altBit(x *Int, i int) uint { + z := new(Int).Rsh(x, uint(i)) + z = z.And(z, NewInt(1)) + if z.Cmp(new(Int)) != 0 { + return 1 + } + return 0 +} + +func altSetBit(z *Int, x *Int, i int, b uint) *Int { + one := NewInt(1) + m := one.Lsh(one, uint(i)) + switch b { + case 1: + return z.Or(x, m) + case 0: + return z.AndNot(x, m) + } + panic("set bit is not 0 or 1") +} + +func testBitset(t *testing.T, x *Int) { + n := x.BitLen() + z := new(Int).Set(x) + z1 := new(Int).Set(x) + for i := 0; i < n+10; i++ { + old := z.Bit(i) + old1 := altBit(z1, i) + if old != old1 { + t.Errorf("bitset: inconsistent value for Bit(%s, %d), got %v want %v", z1, i, old, old1) + } + z := new(Int).SetBit(z, i, 1) + z1 := altSetBit(new(Int), z1, i, 1) + if z.Bit(i) == 0 { + t.Errorf("bitset: bit %d of %s got 0 want 1", i, x) + } + if z.Cmp(z1) != 0 { + t.Errorf("bitset: inconsistent value after SetBit 1, got %s want %s", z, z1) + } + z.SetBit(z, i, 0) + altSetBit(z1, z1, i, 0) + if z.Bit(i) != 0 { + t.Errorf("bitset: bit %d of %s got 1 want 0", i, x) + } + if z.Cmp(z1) != 0 { + t.Errorf("bitset: inconsistent value after SetBit 0, got %s want %s", z, z1) + } + altSetBit(z1, z1, i, old) + z.SetBit(z, i, old) + if z.Cmp(z1) != 0 { + t.Errorf("bitset: inconsistent value after SetBit old, got %s want %s", z, z1) + } + } + if z.Cmp(x) != 0 { + t.Errorf("bitset: got %s want %s", z, x) + } +} + +var bitsetTests = []struct { + x string + i int + b uint +}{ + {"0", 0, 0}, + {"0", 200, 0}, + {"1", 0, 1}, + {"1", 1, 0}, + {"-1", 0, 1}, + {"-1", 200, 1}, + {"0x2000000000000000000000000000", 108, 0}, + {"0x2000000000000000000000000000", 109, 1}, + {"0x2000000000000000000000000000", 110, 0}, + {"-0x2000000000000000000000000001", 108, 1}, + {"-0x2000000000000000000000000001", 109, 0}, + {"-0x2000000000000000000000000001", 110, 1}, +} + +func TestBitSet(t *testing.T) { + for _, test := range bitwiseTests { + x := new(Int) + x.SetString(test.x, 0) + testBitset(t, x) + x = new(Int) + x.SetString(test.y, 0) + testBitset(t, x) + } + for i, test := range bitsetTests { + x := new(Int) + x.SetString(test.x, 0) + b := x.Bit(test.i) + if b != test.b { + t.Errorf("#%d got %v want %v", i, b, test.b) + } + } + z := NewInt(1) + z.SetBit(NewInt(0), 2, 1) + if z.Cmp(NewInt(4)) != 0 { + t.Errorf("destination leaked into result; got %s want 4", z) + } +} + +func BenchmarkBitset(b *testing.B) { + z := new(Int) + z.SetBit(z, 512, 1) + b.ResetTimer() + b.StartTimer() + for i := b.N - 1; i >= 0; i-- { + z.SetBit(z, i&512, 1) + } +} + +func BenchmarkBitsetNeg(b *testing.B) { + z := NewInt(-1) + z.SetBit(z, 512, 0) + b.ResetTimer() + b.StartTimer() + for i := b.N - 1; i >= 0; i-- { + z.SetBit(z, i&512, 0) + } +} + +func BenchmarkBitsetOrig(b *testing.B) { + z := new(Int) + altSetBit(z, z, 512, 1) + b.ResetTimer() + b.StartTimer() + for i := b.N - 1; i >= 0; i-- { + altSetBit(z, z, i&512, 1) + } +} + +func BenchmarkBitsetNegOrig(b *testing.B) { + z := NewInt(-1) + altSetBit(z, z, 512, 0) + b.ResetTimer() + b.StartTimer() + for i := b.N - 1; i >= 0; i-- { + altSetBit(z, z, i&512, 0) + } +} + +func TestBitwise(t *testing.T) { + x := new(Int) + y := new(Int) + for _, test := range bitwiseTests { + x.SetString(test.x, 0) + y.SetString(test.y, 0) + + testBitFun(t, "and", (*Int).And, x, y, test.and) + testBitFunSelf(t, "and", (*Int).And, x, y, test.and) + testBitFun(t, "andNot", (*Int).AndNot, x, y, test.andNot) + testBitFunSelf(t, "andNot", (*Int).AndNot, x, y, test.andNot) + testBitFun(t, "or", (*Int).Or, x, y, test.or) + testBitFunSelf(t, "or", (*Int).Or, x, y, test.or) + testBitFun(t, "xor", (*Int).Xor, x, y, test.xor) + testBitFunSelf(t, "xor", (*Int).Xor, x, y, test.xor) + } +} + +var notTests = []struct { + in string + out string +}{ + {"0", "-1"}, + {"1", "-2"}, + {"7", "-8"}, + {"0", "-1"}, + {"-81910", "81909"}, + { + "298472983472983471903246121093472394872319615612417471234712061", + "-298472983472983471903246121093472394872319615612417471234712062", + }, +} + +func TestNot(t *testing.T) { + in := new(Int) + out := new(Int) + expected := new(Int) + for i, test := range notTests { + in.SetString(test.in, 10) + expected.SetString(test.out, 10) + out = out.Not(in) + if out.Cmp(expected) != 0 { + t.Errorf("#%d: got %s want %s", i, out, expected) + } + out = out.Not(out) + if out.Cmp(in) != 0 { + t.Errorf("#%d: got %s want %s", i, out, in) + } + } +} + +var modInverseTests = []struct { + element string + modulus string +}{ + {"1234567", "458948883992"}, + {"239487239847", "2410312426921032588552076022197566074856950548502459942654116941958108831682612228890093858261341614673227141477904012196503648957050582631942730706805009223062734745341073406696246014589361659774041027169249453200378729434170325843778659198143763193776859869524088940195577346119843545301547043747207749969763750084308926339295559968882457872412993810129130294592999947926365264059284647209730384947211681434464714438488520940127459844288859336526896320919633919"}, +} + +func TestModInverse(t *testing.T) { + var element, modulus, gcd, inverse Int + one := NewInt(1) + for i, test := range modInverseTests { + (&element).SetString(test.element, 10) + (&modulus).SetString(test.modulus, 10) + (&inverse).ModInverse(&element, &modulus) + (&inverse).Mul(&inverse, &element) + (&inverse).Mod(&inverse, &modulus) + if (&inverse).Cmp(one) != 0 { + t.Errorf("#%d: failed (e·e^(-1)=%s)", i, &inverse) + } + } + // exhaustive test for small values + for n := 2; n < 100; n++ { + (&modulus).SetInt64(int64(n)) + for x := 1; x < n; x++ { + (&element).SetInt64(int64(x)) + (&gcd).GCD(nil, nil, &element, &modulus) + if (&gcd).Cmp(one) != 0 { + continue + } + (&inverse).ModInverse(&element, &modulus) + (&inverse).Mul(&inverse, &element) + (&inverse).Mod(&inverse, &modulus) + if (&inverse).Cmp(one) != 0 { + t.Errorf("ModInverse(%d,%d)*%d%%%d=%d, not 1", &element, &modulus, &element, &modulus, &inverse) + } + } + } +} + +// testModSqrt is a helper for TestModSqrt, +// which checks that ModSqrt can compute a square-root of elt^2. +func testModSqrt(t *testing.T, elt, mod, sq, sqrt *Int) bool { + var sqChk, sqrtChk, sqrtsq Int + sq.Mul(elt, elt) + sq.Mod(sq, mod) + z := sqrt.ModSqrt(sq, mod) + if z != sqrt { + t.Errorf("ModSqrt returned wrong value %s", z) + } + + // test ModSqrt arguments outside the range [0,mod) + sqChk.Add(sq, mod) + z = sqrtChk.ModSqrt(&sqChk, mod) + if z != &sqrtChk || z.Cmp(sqrt) != 0 { + t.Errorf("ModSqrt returned inconsistent value %s", z) + } + sqChk.Sub(sq, mod) + z = sqrtChk.ModSqrt(&sqChk, mod) + if z != &sqrtChk || z.Cmp(sqrt) != 0 { + t.Errorf("ModSqrt returned inconsistent value %s", z) + } + + // make sure we actually got a square root + if sqrt.Cmp(elt) == 0 { + return true // we found the "desired" square root + } + sqrtsq.Mul(sqrt, sqrt) // make sure we found the "other" one + sqrtsq.Mod(&sqrtsq, mod) + return sq.Cmp(&sqrtsq) == 0 +} + +func TestModSqrt(t *testing.T) { + var elt, mod, modx4, sq, sqrt Int + r := rand.New(rand.NewSource(9)) + for i, s := range primes[1:] { // skip 2, use only odd primes + mod.SetString(s, 10) + modx4.Lsh(&mod, 2) + + // test a few random elements per prime + for x := 1; x < 5; x++ { + elt.Rand(r, &modx4) + elt.Sub(&elt, &mod) // test range [-mod, 3*mod) + if !testModSqrt(t, &elt, &mod, &sq, &sqrt) { + t.Errorf("#%d: failed (sqrt(e) = %s)", i, &sqrt) + } + } + } + + // exhaustive test for small values + for n := 3; n < 100; n++ { + mod.SetInt64(int64(n)) + if !mod.ProbablyPrime(10) { + continue + } + isSquare := make([]bool, n) + + // test all the squares + for x := 1; x < n; x++ { + elt.SetInt64(int64(x)) + if !testModSqrt(t, &elt, &mod, &sq, &sqrt) { + t.Errorf("#%d: failed (sqrt(%d,%d) = %s)", x, &elt, &mod, &sqrt) + } + isSquare[sq.Uint64()] = true + } + + // test all non-squares + for x := 1; x < n; x++ { + sq.SetInt64(int64(x)) + z := sqrt.ModSqrt(&sq, &mod) + if !isSquare[x] && z != nil { + t.Errorf("#%d: failed (sqrt(%d,%d) = nil)", x, &sqrt, &mod) + } + } + } +} + +func TestJacobi(t *testing.T) { + testCases := []struct { + x, y int64 + result int + }{ + {0, 1, 1}, + {0, -1, 1}, + {1, 1, 1}, + {1, -1, 1}, + {0, 5, 0}, + {1, 5, 1}, + {2, 5, -1}, + {-2, 5, -1}, + {2, -5, -1}, + {-2, -5, 1}, + {3, 5, -1}, + {5, 5, 0}, + {-5, 5, 0}, + {6, 5, 1}, + {6, -5, 1}, + {-6, 5, 1}, + {-6, -5, -1}, + } + + var x, y Int + + for i, test := range testCases { + x.SetInt64(test.x) + y.SetInt64(test.y) + expected := test.result + actual := Jacobi(&x, &y) + if actual != expected { + t.Errorf("#%d: Jacobi(%d, %d) = %d, but expected %d", i, test.x, test.y, actual, expected) + } + } +} + +func TestJacobiPanic(t *testing.T) { + const failureMsg = "test failure" + defer func() { + msg := recover() + if msg == nil || msg == failureMsg { + panic(msg) + } + t.Log(msg) + }() + x := NewInt(1) + y := NewInt(2) + // Jacobi should panic when the second argument is even. + Jacobi(x, y) + panic(failureMsg) +} + +var encodingTests = []string{ + "-539345864568634858364538753846587364875430589374589", + "-678645873", + "-100", + "-2", + "-1", + "0", + "1", + "2", + "10", + "42", + "1234567890", + "298472983472983471903246121093472394872319615612417471234712061", +} + +func TestIntGobEncoding(t *testing.T) { + var medium bytes.Buffer + enc := gob.NewEncoder(&medium) + dec := gob.NewDecoder(&medium) + for _, test := range encodingTests { + medium.Reset() // empty buffer for each test case (in case of failures) + var tx Int + tx.SetString(test, 10) + if err := enc.Encode(&tx); err != nil { + t.Errorf("encoding of %s failed: %s", &tx, err) + } + var rx Int + if err := dec.Decode(&rx); err != nil { + t.Errorf("decoding of %s failed: %s", &tx, err) + } + if rx.Cmp(&tx) != 0 { + t.Errorf("transmission of %s failed: got %s want %s", &tx, &rx, &tx) + } + } +} + +// Sending a nil Int pointer (inside a slice) on a round trip through gob should yield a zero. +// TODO: top-level nils. +func TestGobEncodingNilIntInSlice(t *testing.T) { + buf := new(bytes.Buffer) + enc := gob.NewEncoder(buf) + dec := gob.NewDecoder(buf) + + var in = make([]*Int, 1) + err := enc.Encode(&in) + if err != nil { + t.Errorf("gob encode failed: %q", err) + } + var out []*Int + err = dec.Decode(&out) + if err != nil { + t.Fatalf("gob decode failed: %q", err) + } + if len(out) != 1 { + t.Fatalf("wrong len; want 1 got %d", len(out)) + } + var zero Int + if out[0].Cmp(&zero) != 0 { + t.Errorf("transmission of (*Int)(nill) failed: got %s want 0", out) + } +} + +func TestIntJSONEncoding(t *testing.T) { + for _, test := range encodingTests { + var tx Int + tx.SetString(test, 10) + b, err := json.Marshal(&tx) + if err != nil { + t.Errorf("marshaling of %s failed: %s", &tx, err) + } + var rx Int + if err := json.Unmarshal(b, &rx); err != nil { + t.Errorf("unmarshaling of %s failed: %s", &tx, err) + } + if rx.Cmp(&tx) != 0 { + t.Errorf("JSON encoding of %s failed: got %s want %s", &tx, &rx, &tx) + } + } +} + +var intVals = []string{ + "-141592653589793238462643383279502884197169399375105820974944592307816406286", + "-1415926535897932384626433832795028841971", + "-141592653589793", + "-1", + "0", + "1", + "141592653589793", + "1415926535897932384626433832795028841971", + "141592653589793238462643383279502884197169399375105820974944592307816406286", +} + +func TestIntJSONEncodingTextMarshaller(t *testing.T) { + for _, num := range intVals { + var tx Int + tx.SetString(num, 0) + b, err := json.Marshal(&tx) + if err != nil { + t.Errorf("marshaling of %s failed: %s", &tx, err) + continue + } + var rx Int + if err := json.Unmarshal(b, &rx); err != nil { + t.Errorf("unmarshaling of %s failed: %s", &tx, err) + continue + } + if rx.Cmp(&tx) != 0 { + t.Errorf("JSON encoding of %s failed: got %s want %s", &tx, &rx, &tx) + } + } +} + +func TestIntXMLEncodingTextMarshaller(t *testing.T) { + for _, num := range intVals { + var tx Int + tx.SetString(num, 0) + b, err := xml.Marshal(&tx) + if err != nil { + t.Errorf("marshaling of %s failed: %s", &tx, err) + continue + } + var rx Int + if err := xml.Unmarshal(b, &rx); err != nil { + t.Errorf("unmarshaling of %s failed: %s", &tx, err) + continue + } + if rx.Cmp(&tx) != 0 { + t.Errorf("XML encoding of %s failed: got %s want %s", &tx, &rx, &tx) + } + } +} + +func TestIssue2607(t *testing.T) { + // This code sequence used to hang. + n := NewInt(10) + n.Rand(rand.New(rand.NewSource(9)), n) +} diff --git a/src/cmd/compile/internal/big/intconv.go b/src/cmd/compile/internal/big/intconv.go new file mode 100644 index 0000000000000000000000000000000000000000..9c68a22bed8055f7a83597507e6eee9e897bbb80 --- /dev/null +++ b/src/cmd/compile/internal/big/intconv.go @@ -0,0 +1,228 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// This file implements int-to-string conversion functions. + +package big + +import ( + "errors" + "fmt" + "io" +) + +func (x *Int) String() string { + switch { + case x == nil: + return "" + case x.neg: + return "-" + x.abs.decimalString() + } + return x.abs.decimalString() +} + +func charset(ch rune) string { + switch ch { + case 'b': + return lowercaseDigits[0:2] + case 'o': + return lowercaseDigits[0:8] + case 'd', 's', 'v': + return lowercaseDigits[0:10] + case 'x': + return lowercaseDigits[0:16] + case 'X': + return uppercaseDigits[0:16] + } + return "" // unknown format +} + +// write count copies of text to s +func writeMultiple(s fmt.State, text string, count int) { + if len(text) > 0 { + b := []byte(text) + for ; count > 0; count-- { + s.Write(b) + } + } +} + +// Format is a support routine for fmt.Formatter. It accepts +// the formats 'b' (binary), 'o' (octal), 'd' (decimal), 'x' +// (lowercase hexadecimal), and 'X' (uppercase hexadecimal). +// Also supported are the full suite of package fmt's format +// verbs for integral types, including '+', '-', and ' ' +// for sign control, '#' for leading zero in octal and for +// hexadecimal, a leading "0x" or "0X" for "%#x" and "%#X" +// respectively, specification of minimum digits precision, +// output field width, space or zero padding, and left or +// right justification. +// +func (x *Int) Format(s fmt.State, ch rune) { + cs := charset(ch) + + // special cases + switch { + case cs == "": + // unknown format + fmt.Fprintf(s, "%%!%c(big.Int=%s)", ch, x.String()) + return + case x == nil: + fmt.Fprint(s, "") + return + } + + // determine sign character + sign := "" + switch { + case x.neg: + sign = "-" + case s.Flag('+'): // supersedes ' ' when both specified + sign = "+" + case s.Flag(' '): + sign = " " + } + + // determine prefix characters for indicating output base + prefix := "" + if s.Flag('#') { + switch ch { + case 'o': // octal + prefix = "0" + case 'x': // hexadecimal + prefix = "0x" + case 'X': + prefix = "0X" + } + } + + // determine digits with base set by len(cs) and digit characters from cs + digits := x.abs.string(cs) + + // number of characters for the three classes of number padding + var left int // space characters to left of digits for right justification ("%8d") + var zeroes int // zero characters (actually cs[0]) as left-most digits ("%.8d") + var right int // space characters to right of digits for left justification ("%-8d") + + // determine number padding from precision: the least number of digits to output + precision, precisionSet := s.Precision() + if precisionSet { + switch { + case len(digits) < precision: + zeroes = precision - len(digits) // count of zero padding + case digits == "0" && precision == 0: + return // print nothing if zero value (x == 0) and zero precision ("." or ".0") + } + } + + // determine field pad from width: the least number of characters to output + length := len(sign) + len(prefix) + zeroes + len(digits) + if width, widthSet := s.Width(); widthSet && length < width { // pad as specified + switch d := width - length; { + case s.Flag('-'): + // pad on the right with spaces; supersedes '0' when both specified + right = d + case s.Flag('0') && !precisionSet: + // pad with zeroes unless precision also specified + zeroes = d + default: + // pad on the left with spaces + left = d + } + } + + // print number as [left pad][sign][prefix][zero pad][digits][right pad] + writeMultiple(s, " ", left) + writeMultiple(s, sign, 1) + writeMultiple(s, prefix, 1) + writeMultiple(s, "0", zeroes) + writeMultiple(s, digits, 1) + writeMultiple(s, " ", right) +} + +// scan sets z to the integer value corresponding to the longest possible prefix +// read from r representing a signed integer number in a given conversion base. +// It returns z, the actual conversion base used, and an error, if any. In the +// error case, the value of z is undefined but the returned value is nil. The +// syntax follows the syntax of integer literals in Go. +// +// The base argument must be 0 or a value from 2 through MaxBase. If the base +// is 0, the string prefix determines the actual conversion base. A prefix of +// ``0x'' or ``0X'' selects base 16; the ``0'' prefix selects base 8, and a +// ``0b'' or ``0B'' prefix selects base 2. Otherwise the selected base is 10. +// +func (z *Int) scan(r io.ByteScanner, base int) (*Int, int, error) { + // determine sign + neg, err := scanSign(r) + if err != nil { + return nil, 0, err + } + + // determine mantissa + z.abs, base, _, err = z.abs.scan(r, base, false) + if err != nil { + return nil, base, err + } + z.neg = len(z.abs) > 0 && neg // 0 has no sign + + return z, base, nil +} + +func scanSign(r io.ByteScanner) (neg bool, err error) { + var ch byte + if ch, err = r.ReadByte(); err != nil { + return false, err + } + switch ch { + case '-': + neg = true + case '+': + // nothing to do + default: + r.UnreadByte() + } + return +} + +// byteReader is a local wrapper around fmt.ScanState; +// it implements the ByteReader interface. +type byteReader struct { + fmt.ScanState +} + +func (r byteReader) ReadByte() (byte, error) { + ch, size, err := r.ReadRune() + if size != 1 && err == nil { + err = fmt.Errorf("invalid rune %#U", ch) + } + return byte(ch), err +} + +func (r byteReader) UnreadByte() error { + return r.UnreadRune() +} + +// Scan is a support routine for fmt.Scanner; it sets z to the value of +// the scanned number. It accepts the formats 'b' (binary), 'o' (octal), +// 'd' (decimal), 'x' (lowercase hexadecimal), and 'X' (uppercase hexadecimal). +func (z *Int) Scan(s fmt.ScanState, ch rune) error { + s.SkipSpace() // skip leading space characters + base := 0 + switch ch { + case 'b': + base = 2 + case 'o': + base = 8 + case 'd': + base = 10 + case 'x', 'X': + base = 16 + case 's', 'v': + // let scan determine the base + default: + return errors.New("Int.Scan: invalid verb") + } + _, _, err := z.scan(byteReader{s}, base) + return err +} diff --git a/src/cmd/compile/internal/big/intconv_test.go b/src/cmd/compile/internal/big/intconv_test.go new file mode 100644 index 0000000000000000000000000000000000000000..2deb84b48f68a4fd667faca454bcbac2dcc95504 --- /dev/null +++ b/src/cmd/compile/internal/big/intconv_test.go @@ -0,0 +1,342 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package big + +import ( + "bytes" + "fmt" + "testing" +) + +var stringTests = []struct { + in string + out string + base int + val int64 + ok bool +}{ + {in: "", ok: false}, + {in: "a", ok: false}, + {in: "z", ok: false}, + {in: "+", ok: false}, + {in: "-", ok: false}, + {in: "0b", ok: false}, + {in: "0x", ok: false}, + {in: "2", base: 2, ok: false}, + {in: "0b2", base: 0, ok: false}, + {in: "08", ok: false}, + {in: "8", base: 8, ok: false}, + {in: "0xg", base: 0, ok: false}, + {in: "g", base: 16, ok: false}, + {"0", "0", 0, 0, true}, + {"0", "0", 10, 0, true}, + {"0", "0", 16, 0, true}, + {"+0", "0", 0, 0, true}, + {"-0", "0", 0, 0, true}, + {"10", "10", 0, 10, true}, + {"10", "10", 10, 10, true}, + {"10", "10", 16, 16, true}, + {"-10", "-10", 16, -16, true}, + {"+10", "10", 16, 16, true}, + {"0x10", "16", 0, 16, true}, + {in: "0x10", base: 16, ok: false}, + {"-0x10", "-16", 0, -16, true}, + {"+0x10", "16", 0, 16, true}, + {"00", "0", 0, 0, true}, + {"0", "0", 8, 0, true}, + {"07", "7", 0, 7, true}, + {"7", "7", 8, 7, true}, + {"023", "19", 0, 19, true}, + {"23", "23", 8, 19, true}, + {"cafebabe", "cafebabe", 16, 0xcafebabe, true}, + {"0b0", "0", 0, 0, true}, + {"-111", "-111", 2, -7, true}, + {"-0b111", "-7", 0, -7, true}, + {"0b1001010111", "599", 0, 0x257, true}, + {"1001010111", "1001010111", 2, 0x257, true}, +} + +func format(base int) string { + switch base { + case 2: + return "%b" + case 8: + return "%o" + case 16: + return "%x" + } + return "%d" +} + +func TestGetString(t *testing.T) { + z := new(Int) + for i, test := range stringTests { + if !test.ok { + continue + } + z.SetInt64(test.val) + + if test.base == 10 { + s := z.String() + if s != test.out { + t.Errorf("#%da got %s; want %s", i, s, test.out) + } + } + + s := fmt.Sprintf(format(test.base), z) + if s != test.out { + t.Errorf("#%db got %s; want %s", i, s, test.out) + } + } +} + +func TestSetString(t *testing.T) { + tmp := new(Int) + for i, test := range stringTests { + // initialize to a non-zero value so that issues with parsing + // 0 are detected + tmp.SetInt64(1234567890) + n1, ok1 := new(Int).SetString(test.in, test.base) + n2, ok2 := tmp.SetString(test.in, test.base) + expected := NewInt(test.val) + if ok1 != test.ok || ok2 != test.ok { + t.Errorf("#%d (input '%s') ok incorrect (should be %t)", i, test.in, test.ok) + continue + } + if !ok1 { + if n1 != nil { + t.Errorf("#%d (input '%s') n1 != nil", i, test.in) + } + continue + } + if !ok2 { + if n2 != nil { + t.Errorf("#%d (input '%s') n2 != nil", i, test.in) + } + continue + } + + if ok1 && !isNormalized(n1) { + t.Errorf("#%d (input '%s'): %v is not normalized", i, test.in, *n1) + } + if ok2 && !isNormalized(n2) { + t.Errorf("#%d (input '%s'): %v is not normalized", i, test.in, *n2) + } + + if n1.Cmp(expected) != 0 { + t.Errorf("#%d (input '%s') got: %s want: %d", i, test.in, n1, test.val) + } + if n2.Cmp(expected) != 0 { + t.Errorf("#%d (input '%s') got: %s want: %d", i, test.in, n2, test.val) + } + } +} + +var formatTests = []struct { + input string + format string + output string +}{ + {"", "%x", ""}, + {"", "%#x", ""}, + {"", "%#y", "%!y(big.Int=)"}, + + {"10", "%b", "1010"}, + {"10", "%o", "12"}, + {"10", "%d", "10"}, + {"10", "%v", "10"}, + {"10", "%x", "a"}, + {"10", "%X", "A"}, + {"-10", "%X", "-A"}, + {"10", "%y", "%!y(big.Int=10)"}, + {"-10", "%y", "%!y(big.Int=-10)"}, + + {"10", "%#b", "1010"}, + {"10", "%#o", "012"}, + {"10", "%#d", "10"}, + {"10", "%#v", "10"}, + {"10", "%#x", "0xa"}, + {"10", "%#X", "0XA"}, + {"-10", "%#X", "-0XA"}, + {"10", "%#y", "%!y(big.Int=10)"}, + {"-10", "%#y", "%!y(big.Int=-10)"}, + + {"1234", "%d", "1234"}, + {"1234", "%3d", "1234"}, + {"1234", "%4d", "1234"}, + {"-1234", "%d", "-1234"}, + {"1234", "% 5d", " 1234"}, + {"1234", "%+5d", "+1234"}, + {"1234", "%-5d", "1234 "}, + {"1234", "%x", "4d2"}, + {"1234", "%X", "4D2"}, + {"-1234", "%3x", "-4d2"}, + {"-1234", "%4x", "-4d2"}, + {"-1234", "%5x", " -4d2"}, + {"-1234", "%-5x", "-4d2 "}, + {"1234", "%03d", "1234"}, + {"1234", "%04d", "1234"}, + {"1234", "%05d", "01234"}, + {"1234", "%06d", "001234"}, + {"-1234", "%06d", "-01234"}, + {"1234", "%+06d", "+01234"}, + {"1234", "% 06d", " 01234"}, + {"1234", "%-6d", "1234 "}, + {"1234", "%-06d", "1234 "}, + {"-1234", "%-06d", "-1234 "}, + + {"1234", "%.3d", "1234"}, + {"1234", "%.4d", "1234"}, + {"1234", "%.5d", "01234"}, + {"1234", "%.6d", "001234"}, + {"-1234", "%.3d", "-1234"}, + {"-1234", "%.4d", "-1234"}, + {"-1234", "%.5d", "-01234"}, + {"-1234", "%.6d", "-001234"}, + + {"1234", "%8.3d", " 1234"}, + {"1234", "%8.4d", " 1234"}, + {"1234", "%8.5d", " 01234"}, + {"1234", "%8.6d", " 001234"}, + {"-1234", "%8.3d", " -1234"}, + {"-1234", "%8.4d", " -1234"}, + {"-1234", "%8.5d", " -01234"}, + {"-1234", "%8.6d", " -001234"}, + + {"1234", "%+8.3d", " +1234"}, + {"1234", "%+8.4d", " +1234"}, + {"1234", "%+8.5d", " +01234"}, + {"1234", "%+8.6d", " +001234"}, + {"-1234", "%+8.3d", " -1234"}, + {"-1234", "%+8.4d", " -1234"}, + {"-1234", "%+8.5d", " -01234"}, + {"-1234", "%+8.6d", " -001234"}, + + {"1234", "% 8.3d", " 1234"}, + {"1234", "% 8.4d", " 1234"}, + {"1234", "% 8.5d", " 01234"}, + {"1234", "% 8.6d", " 001234"}, + {"-1234", "% 8.3d", " -1234"}, + {"-1234", "% 8.4d", " -1234"}, + {"-1234", "% 8.5d", " -01234"}, + {"-1234", "% 8.6d", " -001234"}, + + {"1234", "%.3x", "4d2"}, + {"1234", "%.4x", "04d2"}, + {"1234", "%.5x", "004d2"}, + {"1234", "%.6x", "0004d2"}, + {"-1234", "%.3x", "-4d2"}, + {"-1234", "%.4x", "-04d2"}, + {"-1234", "%.5x", "-004d2"}, + {"-1234", "%.6x", "-0004d2"}, + + {"1234", "%8.3x", " 4d2"}, + {"1234", "%8.4x", " 04d2"}, + {"1234", "%8.5x", " 004d2"}, + {"1234", "%8.6x", " 0004d2"}, + {"-1234", "%8.3x", " -4d2"}, + {"-1234", "%8.4x", " -04d2"}, + {"-1234", "%8.5x", " -004d2"}, + {"-1234", "%8.6x", " -0004d2"}, + + {"1234", "%+8.3x", " +4d2"}, + {"1234", "%+8.4x", " +04d2"}, + {"1234", "%+8.5x", " +004d2"}, + {"1234", "%+8.6x", " +0004d2"}, + {"-1234", "%+8.3x", " -4d2"}, + {"-1234", "%+8.4x", " -04d2"}, + {"-1234", "%+8.5x", " -004d2"}, + {"-1234", "%+8.6x", " -0004d2"}, + + {"1234", "% 8.3x", " 4d2"}, + {"1234", "% 8.4x", " 04d2"}, + {"1234", "% 8.5x", " 004d2"}, + {"1234", "% 8.6x", " 0004d2"}, + {"1234", "% 8.7x", " 00004d2"}, + {"1234", "% 8.8x", " 000004d2"}, + {"-1234", "% 8.3x", " -4d2"}, + {"-1234", "% 8.4x", " -04d2"}, + {"-1234", "% 8.5x", " -004d2"}, + {"-1234", "% 8.6x", " -0004d2"}, + {"-1234", "% 8.7x", "-00004d2"}, + {"-1234", "% 8.8x", "-000004d2"}, + + {"1234", "%-8.3d", "1234 "}, + {"1234", "%-8.4d", "1234 "}, + {"1234", "%-8.5d", "01234 "}, + {"1234", "%-8.6d", "001234 "}, + {"1234", "%-8.7d", "0001234 "}, + {"1234", "%-8.8d", "00001234"}, + {"-1234", "%-8.3d", "-1234 "}, + {"-1234", "%-8.4d", "-1234 "}, + {"-1234", "%-8.5d", "-01234 "}, + {"-1234", "%-8.6d", "-001234 "}, + {"-1234", "%-8.7d", "-0001234"}, + {"-1234", "%-8.8d", "-00001234"}, + + {"16777215", "%b", "111111111111111111111111"}, // 2**24 - 1 + + {"0", "%.d", ""}, + {"0", "%.0d", ""}, + {"0", "%3.d", ""}, +} + +func TestFormat(t *testing.T) { + for i, test := range formatTests { + var x *Int + if test.input != "" { + var ok bool + x, ok = new(Int).SetString(test.input, 0) + if !ok { + t.Errorf("#%d failed reading input %s", i, test.input) + } + } + output := fmt.Sprintf(test.format, x) + if output != test.output { + t.Errorf("#%d got %q; want %q, {%q, %q, %q}", i, output, test.output, test.input, test.format, test.output) + } + } +} + +var scanTests = []struct { + input string + format string + output string + remaining int +}{ + {"1010", "%b", "10", 0}, + {"0b1010", "%v", "10", 0}, + {"12", "%o", "10", 0}, + {"012", "%v", "10", 0}, + {"10", "%d", "10", 0}, + {"10", "%v", "10", 0}, + {"a", "%x", "10", 0}, + {"0xa", "%v", "10", 0}, + {"A", "%X", "10", 0}, + {"-A", "%X", "-10", 0}, + {"+0b1011001", "%v", "89", 0}, + {"0xA", "%v", "10", 0}, + {"0 ", "%v", "0", 1}, + {"2+3", "%v", "2", 2}, + {"0XABC 12", "%v", "2748", 3}, +} + +func TestScan(t *testing.T) { + var buf bytes.Buffer + for i, test := range scanTests { + x := new(Int) + buf.Reset() + buf.WriteString(test.input) + if _, err := fmt.Fscanf(&buf, test.format, x); err != nil { + t.Errorf("#%d error: %s", i, err) + } + if x.String() != test.output { + t.Errorf("#%d got %s; want %s", i, x.String(), test.output) + } + if buf.Len() != test.remaining { + t.Errorf("#%d got %d bytes remaining; want %d", i, buf.Len(), test.remaining) + } + } +} diff --git a/src/cmd/compile/internal/big/nat.go b/src/cmd/compile/internal/big/nat.go new file mode 100644 index 0000000000000000000000000000000000000000..6545bc17ed36734a7d8189739514eacc33cef07a --- /dev/null +++ b/src/cmd/compile/internal/big/nat.go @@ -0,0 +1,1274 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package big implements multi-precision arithmetic (big numbers). +// The following numeric types are supported: +// +// Int signed integers +// Rat rational numbers +// Float floating-point numbers +// +// Methods are typically of the form: +// +// func (z *T) Unary(x *T) *T // z = op x +// func (z *T) Binary(x, y *T) *T // z = x op y +// func (x *T) M() T1 // v = x.M() +// +// with T one of Int, Rat, or Float. For unary and binary operations, the +// result is the receiver (usually named z in that case); if it is one of +// the operands x or y it may be overwritten (and its memory reused). +// To enable chaining of operations, the result is also returned. Methods +// returning a result other than *Int, *Rat, or *Float take an operand as +// the receiver (usually named x in that case). +// +package big + +// This file contains operations on unsigned multi-precision integers. +// These are the building blocks for the operations on signed integers +// and rationals. + +import "math/rand" + +// An unsigned integer x of the form +// +// x = x[n-1]*_B^(n-1) + x[n-2]*_B^(n-2) + ... + x[1]*_B + x[0] +// +// with 0 <= x[i] < _B and 0 <= i < n is stored in a slice of length n, +// with the digits x[i] as the slice elements. +// +// A number is normalized if the slice contains no leading 0 digits. +// During arithmetic operations, denormalized values may occur but are +// always normalized before returning the final result. The normalized +// representation of 0 is the empty or nil slice (length = 0). +// +type nat []Word + +var ( + natOne = nat{1} + natTwo = nat{2} + natTen = nat{10} +) + +func (z nat) clear() { + for i := range z { + z[i] = 0 + } +} + +func (z nat) norm() nat { + i := len(z) + for i > 0 && z[i-1] == 0 { + i-- + } + return z[0:i] +} + +func (z nat) make(n int) nat { + if n <= cap(z) { + return z[:n] // reuse z + } + // Choosing a good value for e has significant performance impact + // because it increases the chance that a value can be reused. + const e = 4 // extra capacity + return make(nat, n, n+e) +} + +func (z nat) setWord(x Word) nat { + if x == 0 { + return z[:0] + } + z = z.make(1) + z[0] = x + return z +} + +func (z nat) setUint64(x uint64) nat { + // single-digit values + if w := Word(x); uint64(w) == x { + return z.setWord(w) + } + + // compute number of words n required to represent x + n := 0 + for t := x; t > 0; t >>= _W { + n++ + } + + // split x into n words + z = z.make(n) + for i := range z { + z[i] = Word(x & _M) + x >>= _W + } + + return z +} + +func (z nat) set(x nat) nat { + z = z.make(len(x)) + copy(z, x) + return z +} + +func (z nat) add(x, y nat) nat { + m := len(x) + n := len(y) + + switch { + case m < n: + return z.add(y, x) + case m == 0: + // n == 0 because m >= n; result is 0 + return z[:0] + case n == 0: + // result is x + return z.set(x) + } + // m > 0 + + z = z.make(m + 1) + c := addVV(z[0:n], x, y) + if m > n { + c = addVW(z[n:m], x[n:], c) + } + z[m] = c + + return z.norm() +} + +func (z nat) sub(x, y nat) nat { + m := len(x) + n := len(y) + + switch { + case m < n: + panic("underflow") + case m == 0: + // n == 0 because m >= n; result is 0 + return z[:0] + case n == 0: + // result is x + return z.set(x) + } + // m > 0 + + z = z.make(m) + c := subVV(z[0:n], x, y) + if m > n { + c = subVW(z[n:], x[n:], c) + } + if c != 0 { + panic("underflow") + } + + return z.norm() +} + +func (x nat) cmp(y nat) (r int) { + m := len(x) + n := len(y) + if m != n || m == 0 { + switch { + case m < n: + r = -1 + case m > n: + r = 1 + } + return + } + + i := m - 1 + for i > 0 && x[i] == y[i] { + i-- + } + + switch { + case x[i] < y[i]: + r = -1 + case x[i] > y[i]: + r = 1 + } + return +} + +func (z nat) mulAddWW(x nat, y, r Word) nat { + m := len(x) + if m == 0 || y == 0 { + return z.setWord(r) // result is r + } + // m > 0 + + z = z.make(m + 1) + z[m] = mulAddVWW(z[0:m], x, y, r) + + return z.norm() +} + +// basicMul multiplies x and y and leaves the result in z. +// The (non-normalized) result is placed in z[0 : len(x) + len(y)]. +func basicMul(z, x, y nat) { + z[0 : len(x)+len(y)].clear() // initialize z + for i, d := range y { + if d != 0 { + z[len(x)+i] = addMulVVW(z[i:i+len(x)], x, d) + } + } +} + +// montgomery computes x*y*2^(-n*_W) mod m, +// assuming k = -1/m mod 2^_W. +// z is used for storing the result which is returned; +// z must not alias x, y or m. +func (z nat) montgomery(x, y, m nat, k Word, n int) nat { + var c1, c2 Word + z = z.make(n) + z.clear() + for i := 0; i < n; i++ { + d := y[i] + c1 += addMulVVW(z, x, d) + t := z[0] * k + c2 = addMulVVW(z, m, t) + + copy(z, z[1:]) + z[n-1] = c1 + c2 + if z[n-1] < c1 { + c1 = 1 + } else { + c1 = 0 + } + } + if c1 != 0 { + subVV(z, z, m) + } + return z +} + +// Fast version of z[0:n+n>>1].add(z[0:n+n>>1], x[0:n]) w/o bounds checks. +// Factored out for readability - do not use outside karatsuba. +func karatsubaAdd(z, x nat, n int) { + if c := addVV(z[0:n], z, x); c != 0 { + addVW(z[n:n+n>>1], z[n:], c) + } +} + +// Like karatsubaAdd, but does subtract. +func karatsubaSub(z, x nat, n int) { + if c := subVV(z[0:n], z, x); c != 0 { + subVW(z[n:n+n>>1], z[n:], c) + } +} + +// Operands that are shorter than karatsubaThreshold are multiplied using +// "grade school" multiplication; for longer operands the Karatsuba algorithm +// is used. +var karatsubaThreshold int = 40 // computed by calibrate.go + +// karatsuba multiplies x and y and leaves the result in z. +// Both x and y must have the same length n and n must be a +// power of 2. The result vector z must have len(z) >= 6*n. +// The (non-normalized) result is placed in z[0 : 2*n]. +func karatsuba(z, x, y nat) { + n := len(y) + + // Switch to basic multiplication if numbers are odd or small. + // (n is always even if karatsubaThreshold is even, but be + // conservative) + if n&1 != 0 || n < karatsubaThreshold || n < 2 { + basicMul(z, x, y) + return + } + // n&1 == 0 && n >= karatsubaThreshold && n >= 2 + + // Karatsuba multiplication is based on the observation that + // for two numbers x and y with: + // + // x = x1*b + x0 + // y = y1*b + y0 + // + // the product x*y can be obtained with 3 products z2, z1, z0 + // instead of 4: + // + // x*y = x1*y1*b*b + (x1*y0 + x0*y1)*b + x0*y0 + // = z2*b*b + z1*b + z0 + // + // with: + // + // xd = x1 - x0 + // yd = y0 - y1 + // + // z1 = xd*yd + z2 + z0 + // = (x1-x0)*(y0 - y1) + z2 + z0 + // = x1*y0 - x1*y1 - x0*y0 + x0*y1 + z2 + z0 + // = x1*y0 - z2 - z0 + x0*y1 + z2 + z0 + // = x1*y0 + x0*y1 + + // split x, y into "digits" + n2 := n >> 1 // n2 >= 1 + x1, x0 := x[n2:], x[0:n2] // x = x1*b + y0 + y1, y0 := y[n2:], y[0:n2] // y = y1*b + y0 + + // z is used for the result and temporary storage: + // + // 6*n 5*n 4*n 3*n 2*n 1*n 0*n + // z = [z2 copy|z0 copy| xd*yd | yd:xd | x1*y1 | x0*y0 ] + // + // For each recursive call of karatsuba, an unused slice of + // z is passed in that has (at least) half the length of the + // caller's z. + + // compute z0 and z2 with the result "in place" in z + karatsuba(z, x0, y0) // z0 = x0*y0 + karatsuba(z[n:], x1, y1) // z2 = x1*y1 + + // compute xd (or the negative value if underflow occurs) + s := 1 // sign of product xd*yd + xd := z[2*n : 2*n+n2] + if subVV(xd, x1, x0) != 0 { // x1-x0 + s = -s + subVV(xd, x0, x1) // x0-x1 + } + + // compute yd (or the negative value if underflow occurs) + yd := z[2*n+n2 : 3*n] + if subVV(yd, y0, y1) != 0 { // y0-y1 + s = -s + subVV(yd, y1, y0) // y1-y0 + } + + // p = (x1-x0)*(y0-y1) == x1*y0 - x1*y1 - x0*y0 + x0*y1 for s > 0 + // p = (x0-x1)*(y0-y1) == x0*y0 - x0*y1 - x1*y0 + x1*y1 for s < 0 + p := z[n*3:] + karatsuba(p, xd, yd) + + // save original z2:z0 + // (ok to use upper half of z since we're done recursing) + r := z[n*4:] + copy(r, z[:n*2]) + + // add up all partial products + // + // 2*n n 0 + // z = [ z2 | z0 ] + // + [ z0 ] + // + [ z2 ] + // + [ p ] + // + karatsubaAdd(z[n2:], r, n) + karatsubaAdd(z[n2:], r[n:], n) + if s > 0 { + karatsubaAdd(z[n2:], p, n) + } else { + karatsubaSub(z[n2:], p, n) + } +} + +// alias reports whether x and y share the same base array. +func alias(x, y nat) bool { + return cap(x) > 0 && cap(y) > 0 && &x[0:cap(x)][cap(x)-1] == &y[0:cap(y)][cap(y)-1] +} + +// addAt implements z += x<<(_W*i); z must be long enough. +// (we don't use nat.add because we need z to stay the same +// slice, and we don't need to normalize z after each addition) +func addAt(z, x nat, i int) { + if n := len(x); n > 0 { + if c := addVV(z[i:i+n], z[i:], x); c != 0 { + j := i + n + if j < len(z) { + addVW(z[j:], z[j:], c) + } + } + } +} + +func max(x, y int) int { + if x > y { + return x + } + return y +} + +// karatsubaLen computes an approximation to the maximum k <= n such that +// k = p<= 0. Thus, the +// result is the largest number that can be divided repeatedly by 2 before +// becoming about the value of karatsubaThreshold. +func karatsubaLen(n int) int { + i := uint(0) + for n > karatsubaThreshold { + n >>= 1 + i++ + } + return n << i +} + +func (z nat) mul(x, y nat) nat { + m := len(x) + n := len(y) + + switch { + case m < n: + return z.mul(y, x) + case m == 0 || n == 0: + return z[:0] + case n == 1: + return z.mulAddWW(x, y[0], 0) + } + // m >= n > 1 + + // determine if z can be reused + if alias(z, x) || alias(z, y) { + z = nil // z is an alias for x or y - cannot reuse + } + + // use basic multiplication if the numbers are small + if n < karatsubaThreshold { + z = z.make(m + n) + basicMul(z, x, y) + return z.norm() + } + // m >= n && n >= karatsubaThreshold && n >= 2 + + // determine Karatsuba length k such that + // + // x = xh*b + x0 (0 <= x0 < b) + // y = yh*b + y0 (0 <= y0 < b) + // b = 1<<(_W*k) ("base" of digits xi, yi) + // + k := karatsubaLen(n) + // k <= n + + // multiply x0 and y0 via Karatsuba + x0 := x[0:k] // x0 is not normalized + y0 := y[0:k] // y0 is not normalized + z = z.make(max(6*k, m+n)) // enough space for karatsuba of x0*y0 and full result of x*y + karatsuba(z, x0, y0) + z = z[0 : m+n] // z has final length but may be incomplete + z[2*k:].clear() // upper portion of z is garbage (and 2*k <= m+n since k <= n <= m) + + // If xh != 0 or yh != 0, add the missing terms to z. For + // + // xh = xi*b^i + ... + x2*b^2 + x1*b (0 <= xi < b) + // yh = y1*b (0 <= y1 < b) + // + // the missing terms are + // + // x0*y1*b and xi*y0*b^i, xi*y1*b^(i+1) for i > 0 + // + // since all the yi for i > 1 are 0 by choice of k: If any of them + // were > 0, then yh >= b^2 and thus y >= b^2. Then k' = k*2 would + // be a larger valid threshold contradicting the assumption about k. + // + if k < n || m != n { + var t nat + + // add x0*y1*b + x0 := x0.norm() + y1 := y[k:] // y1 is normalized because y is + t = t.mul(x0, y1) // update t so we don't lose t's underlying array + addAt(z, t, k) + + // add xi*y0< k { + xi = xi[:k] + } + xi = xi.norm() + t = t.mul(xi, y0) + addAt(z, t, i) + t = t.mul(xi, y1) + addAt(z, t, i+k) + } + } + + return z.norm() +} + +// mulRange computes the product of all the unsigned integers in the +// range [a, b] inclusively. If a > b (empty range), the result is 1. +func (z nat) mulRange(a, b uint64) nat { + switch { + case a == 0: + // cut long ranges short (optimization) + return z.setUint64(0) + case a > b: + return z.setUint64(1) + case a == b: + return z.setUint64(a) + case a+1 == b: + return z.mul(nat(nil).setUint64(a), nat(nil).setUint64(b)) + } + m := (a + b) / 2 + return z.mul(nat(nil).mulRange(a, m), nat(nil).mulRange(m+1, b)) +} + +// q = (x-r)/y, with 0 <= r < y +func (z nat) divW(x nat, y Word) (q nat, r Word) { + m := len(x) + switch { + case y == 0: + panic("division by zero") + case y == 1: + q = z.set(x) // result is x + return + case m == 0: + q = z[:0] // result is 0 + return + } + // m > 0 + z = z.make(m) + r = divWVW(z, 0, x, y) + q = z.norm() + return +} + +func (z nat) div(z2, u, v nat) (q, r nat) { + if len(v) == 0 { + panic("division by zero") + } + + if u.cmp(v) < 0 { + q = z[:0] + r = z2.set(u) + return + } + + if len(v) == 1 { + var r2 Word + q, r2 = z.divW(u, v[0]) + r = z2.setWord(r2) + return + } + + q, r = z.divLarge(z2, u, v) + return +} + +// q = (uIn-r)/v, with 0 <= r < y +// Uses z as storage for q, and u as storage for r if possible. +// See Knuth, Volume 2, section 4.3.1, Algorithm D. +// Preconditions: +// len(v) >= 2 +// len(uIn) >= len(v) +func (z nat) divLarge(u, uIn, v nat) (q, r nat) { + n := len(v) + m := len(uIn) - n + + // determine if z can be reused + // TODO(gri) should find a better solution - this if statement + // is very costly (see e.g. time pidigits -s -n 10000) + if alias(z, uIn) || alias(z, v) { + z = nil // z is an alias for uIn or v - cannot reuse + } + q = z.make(m + 1) + + qhatv := make(nat, n+1) + if alias(u, uIn) || alias(u, v) { + u = nil // u is an alias for uIn or v - cannot reuse + } + u = u.make(len(uIn) + 1) + u.clear() // TODO(gri) no need to clear if we allocated a new u + + // D1. + shift := nlz(v[n-1]) + if shift > 0 { + // do not modify v, it may be used by another goroutine simultaneously + v1 := make(nat, n) + shlVU(v1, v, shift) + v = v1 + } + u[len(uIn)] = shlVU(u[0:len(uIn)], uIn, shift) + + // D2. + for j := m; j >= 0; j-- { + // D3. + qhat := Word(_M) + if u[j+n] != v[n-1] { + var rhat Word + qhat, rhat = divWW(u[j+n], u[j+n-1], v[n-1]) + + // x1 | x2 = q̂v_{n-2} + x1, x2 := mulWW(qhat, v[n-2]) + // test if q̂v_{n-2} > br̂ + u_{j+n-2} + for greaterThan(x1, x2, rhat, u[j+n-2]) { + qhat-- + prevRhat := rhat + rhat += v[n-1] + // v[n-1] >= 0, so this tests for overflow. + if rhat < prevRhat { + break + } + x1, x2 = mulWW(qhat, v[n-2]) + } + } + + // D4. + qhatv[n] = mulAddVWW(qhatv[0:n], v, qhat, 0) + + c := subVV(u[j:j+len(qhatv)], u[j:], qhatv) + if c != 0 { + c := addVV(u[j:j+n], u[j:], v) + u[j+n] += c + qhat-- + } + + q[j] = qhat + } + + q = q.norm() + shrVU(u, u, shift) + r = u.norm() + + return q, r +} + +// Length of x in bits. x must be normalized. +func (x nat) bitLen() int { + if i := len(x) - 1; i >= 0 { + return i*_W + bitLen(x[i]) + } + return 0 +} + +const deBruijn32 = 0x077CB531 + +var deBruijn32Lookup = []byte{ + 0, 1, 28, 2, 29, 14, 24, 3, 30, 22, 20, 15, 25, 17, 4, 8, + 31, 27, 13, 23, 21, 19, 16, 7, 26, 12, 18, 6, 11, 5, 10, 9, +} + +const deBruijn64 = 0x03f79d71b4ca8b09 + +var deBruijn64Lookup = []byte{ + 0, 1, 56, 2, 57, 49, 28, 3, 61, 58, 42, 50, 38, 29, 17, 4, + 62, 47, 59, 36, 45, 43, 51, 22, 53, 39, 33, 30, 24, 18, 12, 5, + 63, 55, 48, 27, 60, 41, 37, 16, 46, 35, 44, 21, 52, 32, 23, 11, + 54, 26, 40, 15, 34, 20, 31, 10, 25, 14, 19, 9, 13, 8, 7, 6, +} + +// trailingZeroBits returns the number of consecutive least significant zero +// bits of x. +func trailingZeroBits(x Word) uint { + // x & -x leaves only the right-most bit set in the word. Let k be the + // index of that bit. Since only a single bit is set, the value is two + // to the power of k. Multiplying by a power of two is equivalent to + // left shifting, in this case by k bits. The de Bruijn constant is + // such that all six bit, consecutive substrings are distinct. + // Therefore, if we have a left shifted version of this constant we can + // find by how many bits it was shifted by looking at which six bit + // substring ended up at the top of the word. + // (Knuth, volume 4, section 7.3.1) + switch _W { + case 32: + return uint(deBruijn32Lookup[((x&-x)*deBruijn32)>>27]) + case 64: + return uint(deBruijn64Lookup[((x&-x)*(deBruijn64&_M))>>58]) + default: + panic("unknown word size") + } +} + +// trailingZeroBits returns the number of consecutive least significant zero +// bits of x. +func (x nat) trailingZeroBits() uint { + if len(x) == 0 { + return 0 + } + var i uint + for x[i] == 0 { + i++ + } + // x[i] != 0 + return i*_W + trailingZeroBits(x[i]) +} + +// z = x << s +func (z nat) shl(x nat, s uint) nat { + m := len(x) + if m == 0 { + return z[:0] + } + // m > 0 + + n := m + int(s/_W) + z = z.make(n + 1) + z[n] = shlVU(z[n-m:n], x, s%_W) + z[0 : n-m].clear() + + return z.norm() +} + +// z = x >> s +func (z nat) shr(x nat, s uint) nat { + m := len(x) + n := m - int(s/_W) + if n <= 0 { + return z[:0] + } + // n > 0 + + z = z.make(n) + shrVU(z, x[m-n:], s%_W) + + return z.norm() +} + +func (z nat) setBit(x nat, i uint, b uint) nat { + j := int(i / _W) + m := Word(1) << (i % _W) + n := len(x) + switch b { + case 0: + z = z.make(n) + copy(z, x) + if j >= n { + // no need to grow + return z + } + z[j] &^= m + return z.norm() + case 1: + if j >= n { + z = z.make(j + 1) + z[n:].clear() + } else { + z = z.make(n) + } + copy(z, x) + z[j] |= m + // no need to normalize + return z + } + panic("set bit is not 0 or 1") +} + +// bit returns the value of the i'th bit, with lsb == bit 0. +func (x nat) bit(i uint) uint { + j := i / _W + if j >= uint(len(x)) { + return 0 + } + // 0 <= j < len(x) + return uint(x[j] >> (i % _W) & 1) +} + +// sticky returns 1 if there's a 1 bit within the +// i least significant bits, otherwise it returns 0. +func (x nat) sticky(i uint) uint { + j := i / _W + if j >= uint(len(x)) { + if len(x) == 0 { + return 0 + } + return 1 + } + // 0 <= j < len(x) + for _, x := range x[:j] { + if x != 0 { + return 1 + } + } + if x[j]<<(_W-i%_W) != 0 { + return 1 + } + return 0 +} + +func (z nat) and(x, y nat) nat { + m := len(x) + n := len(y) + if m > n { + m = n + } + // m <= n + + z = z.make(m) + for i := 0; i < m; i++ { + z[i] = x[i] & y[i] + } + + return z.norm() +} + +func (z nat) andNot(x, y nat) nat { + m := len(x) + n := len(y) + if n > m { + n = m + } + // m >= n + + z = z.make(m) + for i := 0; i < n; i++ { + z[i] = x[i] &^ y[i] + } + copy(z[n:m], x[n:m]) + + return z.norm() +} + +func (z nat) or(x, y nat) nat { + m := len(x) + n := len(y) + s := x + if m < n { + n, m = m, n + s = y + } + // m >= n + + z = z.make(m) + for i := 0; i < n; i++ { + z[i] = x[i] | y[i] + } + copy(z[n:m], s[n:m]) + + return z.norm() +} + +func (z nat) xor(x, y nat) nat { + m := len(x) + n := len(y) + s := x + if m < n { + n, m = m, n + s = y + } + // m >= n + + z = z.make(m) + for i := 0; i < n; i++ { + z[i] = x[i] ^ y[i] + } + copy(z[n:m], s[n:m]) + + return z.norm() +} + +// greaterThan reports whether (x1<<_W + x2) > (y1<<_W + y2) +func greaterThan(x1, x2, y1, y2 Word) bool { + return x1 > y1 || x1 == y1 && x2 > y2 +} + +// modW returns x % d. +func (x nat) modW(d Word) (r Word) { + // TODO(agl): we don't actually need to store the q value. + var q nat + q = q.make(len(x)) + return divWVW(q, 0, x, d) +} + +// random creates a random integer in [0..limit), using the space in z if +// possible. n is the bit length of limit. +func (z nat) random(rand *rand.Rand, limit nat, n int) nat { + if alias(z, limit) { + z = nil // z is an alias for limit - cannot reuse + } + z = z.make(len(limit)) + + bitLengthOfMSW := uint(n % _W) + if bitLengthOfMSW == 0 { + bitLengthOfMSW = _W + } + mask := Word((1 << bitLengthOfMSW) - 1) + + for { + switch _W { + case 32: + for i := range z { + z[i] = Word(rand.Uint32()) + } + case 64: + for i := range z { + z[i] = Word(rand.Uint32()) | Word(rand.Uint32())<<32 + } + default: + panic("unknown word size") + } + z[len(limit)-1] &= mask + if z.cmp(limit) < 0 { + break + } + } + + return z.norm() +} + +// If m != 0 (i.e., len(m) != 0), expNN sets z to x**y mod m; +// otherwise it sets z to x**y. The result is the value of z. +func (z nat) expNN(x, y, m nat) nat { + if alias(z, x) || alias(z, y) { + // We cannot allow in-place modification of x or y. + z = nil + } + + // x**y mod 1 == 0 + if len(m) == 1 && m[0] == 1 { + return z.setWord(0) + } + // m == 0 || m > 1 + + // x**0 == 1 + if len(y) == 0 { + return z.setWord(1) + } + // y > 0 + + // x**1 mod m == x mod m + if len(y) == 1 && y[0] == 1 && len(m) != 0 { + _, z = z.div(z, x, m) + return z + } + // y > 1 + + if len(m) != 0 { + // We likely end up being as long as the modulus. + z = z.make(len(m)) + } + z = z.set(x) + + // If the base is non-trivial and the exponent is large, we use + // 4-bit, windowed exponentiation. This involves precomputing 14 values + // (x^2...x^15) but then reduces the number of multiply-reduces by a + // third. Even for a 32-bit exponent, this reduces the number of + // operations. Uses Montgomery method for odd moduli. + if len(x) > 1 && len(y) > 1 && len(m) > 0 { + if m[0]&1 == 1 { + return z.expNNMontgomery(x, y, m) + } + return z.expNNWindowed(x, y, m) + } + + v := y[len(y)-1] // v > 0 because y is normalized and y > 0 + shift := nlz(v) + 1 + v <<= shift + var q nat + + const mask = 1 << (_W - 1) + + // We walk through the bits of the exponent one by one. Each time we + // see a bit, we square, thus doubling the power. If the bit is a one, + // we also multiply by x, thus adding one to the power. + + w := _W - int(shift) + // zz and r are used to avoid allocating in mul and div as + // otherwise the arguments would alias. + var zz, r nat + for j := 0; j < w; j++ { + zz = zz.mul(z, z) + zz, z = z, zz + + if v&mask != 0 { + zz = zz.mul(z, x) + zz, z = z, zz + } + + if len(m) != 0 { + zz, r = zz.div(r, z, m) + zz, r, q, z = q, z, zz, r + } + + v <<= 1 + } + + for i := len(y) - 2; i >= 0; i-- { + v = y[i] + + for j := 0; j < _W; j++ { + zz = zz.mul(z, z) + zz, z = z, zz + + if v&mask != 0 { + zz = zz.mul(z, x) + zz, z = z, zz + } + + if len(m) != 0 { + zz, r = zz.div(r, z, m) + zz, r, q, z = q, z, zz, r + } + + v <<= 1 + } + } + + return z.norm() +} + +// expNNWindowed calculates x**y mod m using a fixed, 4-bit window. +func (z nat) expNNWindowed(x, y, m nat) nat { + // zz and r are used to avoid allocating in mul and div as otherwise + // the arguments would alias. + var zz, r nat + + const n = 4 + // powers[i] contains x^i. + var powers [1 << n]nat + powers[0] = natOne + powers[1] = x + for i := 2; i < 1<= 0; i-- { + yi := y[i] + for j := 0; j < _W; j += n { + if i != len(y)-1 || j != 0 { + // Unrolled loop for significant performance + // gain. Use go test -bench=".*" in crypto/rsa + // to check performance before making changes. + zz = zz.mul(z, z) + zz, z = z, zz + zz, r = zz.div(r, z, m) + z, r = r, z + + zz = zz.mul(z, z) + zz, z = z, zz + zz, r = zz.div(r, z, m) + z, r = r, z + + zz = zz.mul(z, z) + zz, z = z, zz + zz, r = zz.div(r, z, m) + z, r = r, z + + zz = zz.mul(z, z) + zz, z = z, zz + zz, r = zz.div(r, z, m) + z, r = r, z + } + + zz = zz.mul(z, powers[yi>>(_W-n)]) + zz, z = z, zz + zz, r = zz.div(r, z, m) + z, r = r, z + + yi <<= n + } + } + + return z.norm() +} + +// expNNMontgomery calculates x**y mod m using a fixed, 4-bit window. +// Uses Montgomery representation. +func (z nat) expNNMontgomery(x, y, m nat) nat { + var zz, one, rr, RR nat + + numWords := len(m) + + // We want the lengths of x and m to be equal. + if len(x) > numWords { + _, rr = rr.div(rr, x, m) + } else if len(x) < numWords { + rr = rr.make(numWords) + rr.clear() + for i := range x { + rr[i] = x[i] + } + } else { + rr = x + } + x = rr + + // Ideally the precomputations would be performed outside, and reused + // k0 = -mˆ-1 mod 2ˆ_W. Algorithm from: Dumas, J.G. "On Newton–Raphson + // Iteration for Multiplicative Inverses Modulo Prime Powers". + k0 := 2 - m[0] + t := m[0] - 1 + for i := 1; i < _W; i <<= 1 { + t *= t + k0 *= (t + 1) + } + k0 = -k0 + + // RR = 2ˆ(2*_W*len(m)) mod m + RR = RR.setWord(1) + zz = zz.shl(RR, uint(2*numWords*_W)) + _, RR = RR.div(RR, zz, m) + if len(RR) < numWords { + zz = zz.make(numWords) + copy(zz, RR) + RR = zz + } + // one = 1, with equal length to that of m + one = one.make(numWords) + one.clear() + one[0] = 1 + + const n = 4 + // powers[i] contains x^i + var powers [1 << n]nat + powers[0] = powers[0].montgomery(one, RR, m, k0, numWords) + powers[1] = powers[1].montgomery(x, RR, m, k0, numWords) + for i := 2; i < 1<= 0; i-- { + yi := y[i] + for j := 0; j < _W; j += n { + if i != len(y)-1 || j != 0 { + zz = zz.montgomery(z, z, m, k0, numWords) + z = z.montgomery(zz, zz, m, k0, numWords) + zz = zz.montgomery(z, z, m, k0, numWords) + z = z.montgomery(zz, zz, m, k0, numWords) + } + zz = zz.montgomery(z, powers[yi>>(_W-n)], m, k0, numWords) + z, zz = zz, z + yi <<= n + } + } + // convert to regular number + zz = zz.montgomery(z, one, m, k0, numWords) + return zz.norm() +} + +// probablyPrime performs reps Miller-Rabin tests to check whether n is prime. +// If it returns true, n is prime with probability 1 - 1/4^reps. +// If it returns false, n is not prime. +func (n nat) probablyPrime(reps int) bool { + if len(n) == 0 { + return false + } + + if len(n) == 1 { + if n[0] < 2 { + return false + } + + if n[0]%2 == 0 { + return n[0] == 2 + } + + // We have to exclude these cases because we reject all + // multiples of these numbers below. + switch n[0] { + case 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53: + return true + } + } + + if n[0]&1 == 0 { + return false // n is even + } + + const primesProduct32 = 0xC0CFD797 // Π {p ∈ primes, 2 < p <= 29} + const primesProduct64 = 0xE221F97C30E94E1D // Π {p ∈ primes, 2 < p <= 53} + + var r Word + switch _W { + case 32: + r = n.modW(primesProduct32) + case 64: + r = n.modW(primesProduct64 & _M) + default: + panic("Unknown word size") + } + + if r%3 == 0 || r%5 == 0 || r%7 == 0 || r%11 == 0 || + r%13 == 0 || r%17 == 0 || r%19 == 0 || r%23 == 0 || r%29 == 0 { + return false + } + + if _W == 64 && (r%31 == 0 || r%37 == 0 || r%41 == 0 || + r%43 == 0 || r%47 == 0 || r%53 == 0) { + return false + } + + nm1 := nat(nil).sub(n, natOne) + // determine q, k such that nm1 = q << k + k := nm1.trailingZeroBits() + q := nat(nil).shr(nm1, k) + + nm3 := nat(nil).sub(nm1, natTwo) + rand := rand.New(rand.NewSource(int64(n[0]))) + + var x, y, quotient nat + nm3Len := nm3.bitLen() + +NextRandom: + for i := 0; i < reps; i++ { + x = x.random(rand, nm3, nm3Len) + x = x.add(x, natTwo) + y = y.expNN(x, q, n) + if y.cmp(natOne) == 0 || y.cmp(nm1) == 0 { + continue + } + for j := uint(1); j < k; j++ { + y = y.mul(y, y) + quotient, y = quotient.div(y, y, n) + if y.cmp(nm1) == 0 { + continue NextRandom + } + if y.cmp(natOne) == 0 { + return false + } + } + return false + } + + return true +} + +// bytes writes the value of z into buf using big-endian encoding. +// len(buf) must be >= len(z)*_S. The value of z is encoded in the +// slice buf[i:]. The number i of unused bytes at the beginning of +// buf is returned as result. +func (z nat) bytes(buf []byte) (i int) { + i = len(buf) + for _, d := range z { + for j := 0; j < _S; j++ { + i-- + buf[i] = byte(d) + d >>= 8 + } + } + + for i < len(buf) && buf[i] == 0 { + i++ + } + + return +} + +// setBytes interprets buf as the bytes of a big-endian unsigned +// integer, sets z to that value, and returns z. +func (z nat) setBytes(buf []byte) nat { + z = z.make((len(buf) + _S - 1) / _S) + + k := 0 + s := uint(0) + var d Word + for i := len(buf); i > 0; i-- { + d |= Word(buf[i-1]) << s + if s += 8; s == _S*8 { + z[k] = d + k++ + s = 0 + d = 0 + } + } + if k < len(z) { + z[k] = d + } + + return z.norm() +} diff --git a/src/cmd/compile/internal/big/nat_test.go b/src/cmd/compile/internal/big/nat_test.go new file mode 100644 index 0000000000000000000000000000000000000000..7ac3cb8a8468f9554eec86c4bafeea8f42cdfd1a --- /dev/null +++ b/src/cmd/compile/internal/big/nat_test.go @@ -0,0 +1,579 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package big + +import ( + "runtime" + "strings" + "testing" +) + +var cmpTests = []struct { + x, y nat + r int +}{ + {nil, nil, 0}, + {nil, nat(nil), 0}, + {nat(nil), nil, 0}, + {nat(nil), nat(nil), 0}, + {nat{0}, nat{0}, 0}, + {nat{0}, nat{1}, -1}, + {nat{1}, nat{0}, 1}, + {nat{1}, nat{1}, 0}, + {nat{0, _M}, nat{1}, 1}, + {nat{1}, nat{0, _M}, -1}, + {nat{1, _M}, nat{0, _M}, 1}, + {nat{0, _M}, nat{1, _M}, -1}, + {nat{16, 571956, 8794, 68}, nat{837, 9146, 1, 754489}, -1}, + {nat{34986, 41, 105, 1957}, nat{56, 7458, 104, 1957}, 1}, +} + +func TestCmp(t *testing.T) { + for i, a := range cmpTests { + r := a.x.cmp(a.y) + if r != a.r { + t.Errorf("#%d got r = %v; want %v", i, r, a.r) + } + } +} + +type funNN func(z, x, y nat) nat +type argNN struct { + z, x, y nat +} + +var sumNN = []argNN{ + {}, + {nat{1}, nil, nat{1}}, + {nat{1111111110}, nat{123456789}, nat{987654321}}, + {nat{0, 0, 0, 1}, nil, nat{0, 0, 0, 1}}, + {nat{0, 0, 0, 1111111110}, nat{0, 0, 0, 123456789}, nat{0, 0, 0, 987654321}}, + {nat{0, 0, 0, 1}, nat{0, 0, _M}, nat{0, 0, 1}}, +} + +var prodNN = []argNN{ + {}, + {nil, nil, nil}, + {nil, nat{991}, nil}, + {nat{991}, nat{991}, nat{1}}, + {nat{991 * 991}, nat{991}, nat{991}}, + {nat{0, 0, 991 * 991}, nat{0, 991}, nat{0, 991}}, + {nat{1 * 991, 2 * 991, 3 * 991, 4 * 991}, nat{1, 2, 3, 4}, nat{991}}, + {nat{4, 11, 20, 30, 20, 11, 4}, nat{1, 2, 3, 4}, nat{4, 3, 2, 1}}, + // 3^100 * 3^28 = 3^128 + { + natFromString("11790184577738583171520872861412518665678211592275841109096961"), + natFromString("515377520732011331036461129765621272702107522001"), + natFromString("22876792454961"), + }, + // z = 111....1 (70000 digits) + // x = 10^(99*700) + ... + 10^1400 + 10^700 + 1 + // y = 111....1 (700 digits, larger than Karatsuba threshold on 32-bit and 64-bit) + { + natFromString(strings.Repeat("1", 70000)), + natFromString("1" + strings.Repeat(strings.Repeat("0", 699)+"1", 99)), + natFromString(strings.Repeat("1", 700)), + }, + // z = 111....1 (20000 digits) + // x = 10^10000 + 1 + // y = 111....1 (10000 digits) + { + natFromString(strings.Repeat("1", 20000)), + natFromString("1" + strings.Repeat("0", 9999) + "1"), + natFromString(strings.Repeat("1", 10000)), + }, +} + +func natFromString(s string) nat { + x, _, _, err := nat(nil).scan(strings.NewReader(s), 0, false) + if err != nil { + panic(err) + } + return x +} + +func TestSet(t *testing.T) { + for _, a := range sumNN { + z := nat(nil).set(a.z) + if z.cmp(a.z) != 0 { + t.Errorf("got z = %v; want %v", z, a.z) + } + } +} + +func testFunNN(t *testing.T, msg string, f funNN, a argNN) { + z := f(nil, a.x, a.y) + if z.cmp(a.z) != 0 { + t.Errorf("%s%+v\n\tgot z = %v; want %v", msg, a, z, a.z) + } +} + +func TestFunNN(t *testing.T) { + for _, a := range sumNN { + arg := a + testFunNN(t, "add", nat.add, arg) + + arg = argNN{a.z, a.y, a.x} + testFunNN(t, "add symmetric", nat.add, arg) + + arg = argNN{a.x, a.z, a.y} + testFunNN(t, "sub", nat.sub, arg) + + arg = argNN{a.y, a.z, a.x} + testFunNN(t, "sub symmetric", nat.sub, arg) + } + + for _, a := range prodNN { + arg := a + testFunNN(t, "mul", nat.mul, arg) + + arg = argNN{a.z, a.y, a.x} + testFunNN(t, "mul symmetric", nat.mul, arg) + } +} + +var mulRangesN = []struct { + a, b uint64 + prod string +}{ + {0, 0, "0"}, + {1, 1, "1"}, + {1, 2, "2"}, + {1, 3, "6"}, + {10, 10, "10"}, + {0, 100, "0"}, + {0, 1e9, "0"}, + {1, 0, "1"}, // empty range + {100, 1, "1"}, // empty range + {1, 10, "3628800"}, // 10! + {1, 20, "2432902008176640000"}, // 20! + {1, 100, + "933262154439441526816992388562667004907159682643816214685929" + + "638952175999932299156089414639761565182862536979208272237582" + + "51185210916864000000000000000000000000", // 100! + }, +} + +func TestMulRangeN(t *testing.T) { + for i, r := range mulRangesN { + prod := nat(nil).mulRange(r.a, r.b).decimalString() + if prod != r.prod { + t.Errorf("#%d: got %s; want %s", i, prod, r.prod) + } + } +} + +// allocBytes returns the number of bytes allocated by invoking f. +func allocBytes(f func()) uint64 { + var stats runtime.MemStats + runtime.ReadMemStats(&stats) + t := stats.TotalAlloc + f() + runtime.ReadMemStats(&stats) + return stats.TotalAlloc - t +} + +// TestMulUnbalanced tests that multiplying numbers of different lengths +// does not cause deep recursion and in turn allocate too much memory. +// Test case for issue 3807. +func TestMulUnbalanced(t *testing.T) { + defer runtime.GOMAXPROCS(runtime.GOMAXPROCS(1)) + x := rndNat(50000) + y := rndNat(40) + allocSize := allocBytes(func() { + nat(nil).mul(x, y) + }) + inputSize := uint64(len(x)+len(y)) * _S + if ratio := allocSize / uint64(inputSize); ratio > 10 { + t.Errorf("multiplication uses too much memory (%d > %d times the size of inputs)", allocSize, ratio) + } +} + +func rndNat(n int) nat { + return nat(rndV(n)).norm() +} + +func BenchmarkMul(b *testing.B) { + mulx := rndNat(1e4) + muly := rndNat(1e4) + b.ResetTimer() + for i := 0; i < b.N; i++ { + var z nat + z.mul(mulx, muly) + } +} + +func TestNLZ(t *testing.T) { + var x Word = _B >> 1 + for i := 0; i <= _W; i++ { + if int(nlz(x)) != i { + t.Errorf("failed at %x: got %d want %d", x, nlz(x), i) + } + x >>= 1 + } +} + +type shiftTest struct { + in nat + shift uint + out nat +} + +var leftShiftTests = []shiftTest{ + {nil, 0, nil}, + {nil, 1, nil}, + {natOne, 0, natOne}, + {natOne, 1, natTwo}, + {nat{1 << (_W - 1)}, 1, nat{0}}, + {nat{1 << (_W - 1), 0}, 1, nat{0, 1}}, +} + +func TestShiftLeft(t *testing.T) { + for i, test := range leftShiftTests { + var z nat + z = z.shl(test.in, test.shift) + for j, d := range test.out { + if j >= len(z) || z[j] != d { + t.Errorf("#%d: got: %v want: %v", i, z, test.out) + break + } + } + } +} + +var rightShiftTests = []shiftTest{ + {nil, 0, nil}, + {nil, 1, nil}, + {natOne, 0, natOne}, + {natOne, 1, nil}, + {natTwo, 1, natOne}, + {nat{0, 1}, 1, nat{1 << (_W - 1)}}, + {nat{2, 1, 1}, 1, nat{1<<(_W-1) + 1, 1 << (_W - 1)}}, +} + +func TestShiftRight(t *testing.T) { + for i, test := range rightShiftTests { + var z nat + z = z.shr(test.in, test.shift) + for j, d := range test.out { + if j >= len(z) || z[j] != d { + t.Errorf("#%d: got: %v want: %v", i, z, test.out) + break + } + } + } +} + +type modWTest struct { + in string + dividend string + out string +} + +var modWTests32 = []modWTest{ + {"23492635982634928349238759823742", "252341", "220170"}, +} + +var modWTests64 = []modWTest{ + {"6527895462947293856291561095690465243862946", "524326975699234", "375066989628668"}, +} + +func runModWTests(t *testing.T, tests []modWTest) { + for i, test := range tests { + in, _ := new(Int).SetString(test.in, 10) + d, _ := new(Int).SetString(test.dividend, 10) + out, _ := new(Int).SetString(test.out, 10) + + r := in.abs.modW(d.abs[0]) + if r != out.abs[0] { + t.Errorf("#%d failed: got %d want %s", i, r, out) + } + } +} + +func TestModW(t *testing.T) { + if _W >= 32 { + runModWTests(t, modWTests32) + } + if _W >= 64 { + runModWTests(t, modWTests64) + } +} + +func TestTrailingZeroBits(t *testing.T) { + // test 0 case explicitly + if n := trailingZeroBits(0); n != 0 { + t.Errorf("got trailingZeroBits(0) = %d; want 0", n) + } + + x := Word(1) + for i := uint(0); i < _W; i++ { + n := trailingZeroBits(x) + if n != i { + t.Errorf("got trailingZeroBits(%#x) = %d; want %d", x, n, i%_W) + } + x <<= 1 + } + + // test 0 case explicitly + if n := nat(nil).trailingZeroBits(); n != 0 { + t.Errorf("got nat(nil).trailingZeroBits() = %d; want 0", n) + } + + y := nat(nil).set(natOne) + for i := uint(0); i <= 3*_W; i++ { + n := y.trailingZeroBits() + if n != i { + t.Errorf("got 0x%s.trailingZeroBits() = %d; want %d", y.hexString(), n, i) + } + y = y.shl(y, 1) + } +} + +var montgomeryTests = []struct { + x, y, m string + k0 uint64 + out32, out64 string +}{ + { + "0xffffffffffffffffffffffffffffffffffffffffffffffffe", + "0xffffffffffffffffffffffffffffffffffffffffffffffffe", + "0xfffffffffffffffffffffffffffffffffffffffffffffffff", + 0x0000000000000000, + "0xffffffffffffffffffffffffffffffffffffffffff", + "0xffffffffffffffffffffffffffffffffff", + }, + { + "0x0000000080000000", + "0x00000000ffffffff", + "0x0000000010000001", + 0xff0000000fffffff, + "0x0000000088000000", + "0x0000000007800001", + }, + { + "0xffffffffffffffffffffffffffffffff00000000000022222223333333333444444444", + "0xffffffffffffffffffffffffffffffff999999999999999aaabbbbbbbbcccccccccccc", + "0x33377fffffffffffffffffffffffffffffffffffffffffffff0000000000022222eee1", + 0xdecc8f1249812adf, + "0x22bb05b6d95eaaeca2bb7c05e51f807bce9064b5fbad177161695e4558f9474e91cd79", + "0x14beb58d230f85b6d95eaaeca2bb7c05e51f807bce9064b5fb45669afa695f228e48cd", + }, + { + "0x10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffffffffffff00000000000022222223333333333444444444", + "0x10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffffffffffff999999999999999aaabbbbbbbbcccccccccccc", + "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff33377fffffffffffffffffffffffffffffffffffffffffffff0000000000022222eee1", + 0xdecc8f1249812adf, + "0x5c0d52f451aec609b15da8e5e5626c4eaa88723bdeac9d25ca9b961269400410ca208a16af9c2fb07d7a11c7772cba02c22f9711078d51a3797eb18e691295293284d988e349fa6deba46b25a4ecd9f715", + "0x92fcad4b5c0d52f451aec609b15da8e5e5626c4eaa88723bdeac9d25ca9b961269400410ca208a16af9c2fb07d799c32fe2f3cc5422f9711078d51a3797eb18e691295293284d8f5e69caf6decddfe1df6", + }, +} + +func TestMontgomery(t *testing.T) { + for i, test := range montgomeryTests { + x := natFromString(test.x) + y := natFromString(test.y) + m := natFromString(test.m) + + var out nat + if _W == 32 { + out = natFromString(test.out32) + } else { + out = natFromString(test.out64) + } + + k0 := Word(test.k0 & _M) // mask k0 to ensure that it fits for 32-bit systems. + z := nat(nil).montgomery(x, y, m, k0, len(m)) + z = z.norm() + if z.cmp(out) != 0 { + t.Errorf("#%d got %s want %s", i, z.decimalString(), out.decimalString()) + } + } +} + +var expNNTests = []struct { + x, y, m string + out string +}{ + {"0", "0", "0", "1"}, + {"0", "0", "1", "0"}, + {"1", "1", "1", "0"}, + {"2", "1", "1", "0"}, + {"2", "2", "1", "0"}, + {"10", "100000000000", "1", "0"}, + {"0x8000000000000000", "2", "", "0x40000000000000000000000000000000"}, + {"0x8000000000000000", "2", "6719", "4944"}, + {"0x8000000000000000", "3", "6719", "5447"}, + {"0x8000000000000000", "1000", "6719", "1603"}, + {"0x8000000000000000", "1000000", "6719", "3199"}, + { + "2938462938472983472983659726349017249287491026512746239764525612965293865296239471239874193284792387498274256129746192347", + "298472983472983471903246121093472394872319615612417471234712061", + "29834729834729834729347290846729561262544958723956495615629569234729836259263598127342374289365912465901365498236492183464", + "23537740700184054162508175125554701713153216681790245129157191391322321508055833908509185839069455749219131480588829346291", + }, +} + +func TestExpNN(t *testing.T) { + for i, test := range expNNTests { + x := natFromString(test.x) + y := natFromString(test.y) + out := natFromString(test.out) + + var m nat + if len(test.m) > 0 { + m = natFromString(test.m) + } + + z := nat(nil).expNN(x, y, m) + if z.cmp(out) != 0 { + t.Errorf("#%d got %s want %s", i, z.decimalString(), out.decimalString()) + } + } +} + +func ExpHelper(b *testing.B, x, y Word) { + var z nat + for i := 0; i < b.N; i++ { + z.expWW(x, y) + } +} + +func BenchmarkExp3Power0x10(b *testing.B) { ExpHelper(b, 3, 0x10) } +func BenchmarkExp3Power0x40(b *testing.B) { ExpHelper(b, 3, 0x40) } +func BenchmarkExp3Power0x100(b *testing.B) { ExpHelper(b, 3, 0x100) } +func BenchmarkExp3Power0x400(b *testing.B) { ExpHelper(b, 3, 0x400) } +func BenchmarkExp3Power0x1000(b *testing.B) { ExpHelper(b, 3, 0x1000) } +func BenchmarkExp3Power0x4000(b *testing.B) { ExpHelper(b, 3, 0x4000) } +func BenchmarkExp3Power0x10000(b *testing.B) { ExpHelper(b, 3, 0x10000) } +func BenchmarkExp3Power0x40000(b *testing.B) { ExpHelper(b, 3, 0x40000) } +func BenchmarkExp3Power0x100000(b *testing.B) { ExpHelper(b, 3, 0x100000) } +func BenchmarkExp3Power0x400000(b *testing.B) { ExpHelper(b, 3, 0x400000) } + +func fibo(n int) nat { + switch n { + case 0: + return nil + case 1: + return nat{1} + } + f0 := fibo(0) + f1 := fibo(1) + var f2 nat + for i := 1; i < n; i++ { + f2 = f2.add(f0, f1) + f0, f1, f2 = f1, f2, f0 + } + return f1 +} + +var fiboNums = []string{ + "0", + "55", + "6765", + "832040", + "102334155", + "12586269025", + "1548008755920", + "190392490709135", + "23416728348467685", + "2880067194370816120", + "354224848179261915075", +} + +func TestFibo(t *testing.T) { + for i, want := range fiboNums { + n := i * 10 + got := fibo(n).decimalString() + if got != want { + t.Errorf("fibo(%d) failed: got %s want %s", n, got, want) + } + } +} + +func BenchmarkFibo(b *testing.B) { + for i := 0; i < b.N; i++ { + fibo(1e0) + fibo(1e1) + fibo(1e2) + fibo(1e3) + fibo(1e4) + fibo(1e5) + } +} + +var bitTests = []struct { + x string + i uint + want uint +}{ + {"0", 0, 0}, + {"0", 1, 0}, + {"0", 1000, 0}, + + {"0x1", 0, 1}, + {"0x10", 0, 0}, + {"0x10", 3, 0}, + {"0x10", 4, 1}, + {"0x10", 5, 0}, + + {"0x8000000000000000", 62, 0}, + {"0x8000000000000000", 63, 1}, + {"0x8000000000000000", 64, 0}, + + {"0x3" + strings.Repeat("0", 32), 127, 0}, + {"0x3" + strings.Repeat("0", 32), 128, 1}, + {"0x3" + strings.Repeat("0", 32), 129, 1}, + {"0x3" + strings.Repeat("0", 32), 130, 0}, +} + +func TestBit(t *testing.T) { + for i, test := range bitTests { + x := natFromString(test.x) + if got := x.bit(test.i); got != test.want { + t.Errorf("#%d: %s.bit(%d) = %v; want %v", i, test.x, test.i, got, test.want) + } + } +} + +var stickyTests = []struct { + x string + i uint + want uint +}{ + {"0", 0, 0}, + {"0", 1, 0}, + {"0", 1000, 0}, + + {"0x1", 0, 0}, + {"0x1", 1, 1}, + + {"0x1350", 0, 0}, + {"0x1350", 4, 0}, + {"0x1350", 5, 1}, + + {"0x8000000000000000", 63, 0}, + {"0x8000000000000000", 64, 1}, + + {"0x1" + strings.Repeat("0", 100), 400, 0}, + {"0x1" + strings.Repeat("0", 100), 401, 1}, +} + +func TestSticky(t *testing.T) { + for i, test := range stickyTests { + x := natFromString(test.x) + if got := x.sticky(test.i); got != test.want { + t.Errorf("#%d: %s.sticky(%d) = %v; want %v", i, test.x, test.i, got, test.want) + } + if test.want == 1 { + // all subsequent i's should also return 1 + for d := uint(1); d <= 3; d++ { + if got := x.sticky(test.i + d); got != 1 { + t.Errorf("#%d: %s.sticky(%d) = %v; want %v", i, test.x, test.i+d, got, 1) + } + } + } + } +} diff --git a/src/cmd/compile/internal/big/natconv.go b/src/cmd/compile/internal/big/natconv.go new file mode 100644 index 0000000000000000000000000000000000000000..022dcfe38c8d363326a9acef69ff5c7089664adb --- /dev/null +++ b/src/cmd/compile/internal/big/natconv.go @@ -0,0 +1,495 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// This file implements nat-to-string conversion functions. + +package big + +import ( + "errors" + "fmt" + "io" + "math" + "sync" +) + +// MaxBase is the largest number base accepted for string conversions. +const MaxBase = 'z' - 'a' + 10 + 1 + +// maxPow returns (b**n, n) such that b**n is the largest power b**n <= _M. +// For instance maxPow(10) == (1e19, 19) for 19 decimal digits in a 64bit Word. +// In other words, at most n digits in base b fit into a Word. +// TODO(gri) replace this with a table, generated at build time. +func maxPow(b Word) (p Word, n int) { + p, n = b, 1 // assuming b <= _M + for max := _M / b; p <= max; { + // p == b**n && p <= max + p *= b + n++ + } + // p == b**n && p <= _M + return +} + +// pow returns x**n for n > 0, and 1 otherwise. +func pow(x Word, n int) (p Word) { + // n == sum of bi * 2**i, for 0 <= i < imax, and bi is 0 or 1 + // thus x**n == product of x**(2**i) for all i where bi == 1 + // (Russian Peasant Method for exponentiation) + p = 1 + for n > 0 { + if n&1 != 0 { + p *= x + } + x *= x + n >>= 1 + } + return +} + +// scan scans the number corresponding to the longest possible prefix +// from r representing an unsigned number in a given conversion base. +// It returns the corresponding natural number res, the actual base b, +// a digit count, and a read or syntax error err, if any. +// +// number = [ prefix ] mantissa . +// prefix = "0" [ "x" | "X" | "b" | "B" ] . +// mantissa = digits | digits "." [ digits ] | "." digits . +// digits = digit { digit } . +// digit = "0" ... "9" | "a" ... "z" | "A" ... "Z" . +// +// Unless fracOk is set, the base argument must be 0 or a value between +// 2 and MaxBase. If fracOk is set, the base argument must be one of +// 0, 2, 10, or 16. Providing an invalid base argument leads to a run- +// time panic. +// +// For base 0, the number prefix determines the actual base: A prefix of +// ``0x'' or ``0X'' selects base 16; if fracOk is not set, the ``0'' prefix +// selects base 8, and a ``0b'' or ``0B'' prefix selects base 2. Otherwise +// the selected base is 10 and no prefix is accepted. +// +// If fracOk is set, an octal prefix is ignored (a leading ``0'' simply +// stands for a zero digit), and a period followed by a fractional part +// is permitted. The result value is computed as if there were no period +// present; and the count value is used to determine the fractional part. +// +// A result digit count > 0 corresponds to the number of (non-prefix) digits +// parsed. A digit count <= 0 indicates the presence of a period (if fracOk +// is set, only), and -count is the number of fractional digits found. +// In this case, the actual value of the scanned number is res * b**count. +// +func (z nat) scan(r io.ByteScanner, base int, fracOk bool) (res nat, b, count int, err error) { + // reject illegal bases + baseOk := base == 0 || + !fracOk && 2 <= base && base <= MaxBase || + fracOk && (base == 2 || base == 10 || base == 16) + if !baseOk { + panic(fmt.Sprintf("illegal number base %d", base)) + } + + // one char look-ahead + ch, err := r.ReadByte() + if err != nil { + return + } + + // determine actual base + b = base + if base == 0 { + // actual base is 10 unless there's a base prefix + b = 10 + if ch == '0' { + count = 1 + switch ch, err = r.ReadByte(); err { + case nil: + // possibly one of 0x, 0X, 0b, 0B + if !fracOk { + b = 8 + } + switch ch { + case 'x', 'X': + b = 16 + case 'b', 'B': + b = 2 + } + switch b { + case 16, 2: + count = 0 // prefix is not counted + if ch, err = r.ReadByte(); err != nil { + // io.EOF is also an error in this case + return + } + case 8: + count = 0 // prefix is not counted + } + case io.EOF: + // input is "0" + res = z[:0] + err = nil + return + default: + // read error + return + } + } + } + + // convert string + // Algorithm: Collect digits in groups of at most n digits in di + // and then use mulAddWW for every such group to add them to the + // result. + z = z[:0] + b1 := Word(b) + bn, n := maxPow(b1) // at most n digits in base b1 fit into Word + di := Word(0) // 0 <= di < b1**i < bn + i := 0 // 0 <= i < n + dp := -1 // position of decimal point + for { + if fracOk && ch == '.' { + fracOk = false + dp = count + // advance + if ch, err = r.ReadByte(); err != nil { + if err == io.EOF { + err = nil + break + } + return + } + } + + // convert rune into digit value d1 + var d1 Word + switch { + case '0' <= ch && ch <= '9': + d1 = Word(ch - '0') + case 'a' <= ch && ch <= 'z': + d1 = Word(ch - 'a' + 10) + case 'A' <= ch && ch <= 'Z': + d1 = Word(ch - 'A' + 10) + default: + d1 = MaxBase + 1 + } + if d1 >= b1 { + r.UnreadByte() // ch does not belong to number anymore + break + } + count++ + + // collect d1 in di + di = di*b1 + d1 + i++ + + // if di is "full", add it to the result + if i == n { + z = z.mulAddWW(z, bn, di) + di = 0 + i = 0 + } + + // advance + if ch, err = r.ReadByte(); err != nil { + if err == io.EOF { + err = nil + break + } + return + } + } + + if count == 0 { + // no digits found + switch { + case base == 0 && b == 8: + // there was only the octal prefix 0 (possibly followed by digits > 7); + // count as one digit and return base 10, not 8 + count = 1 + b = 10 + case base != 0 || b != 8: + // there was neither a mantissa digit nor the octal prefix 0 + err = errors.New("syntax error scanning number") + } + return + } + // count > 0 + + // add remaining digits to result + if i > 0 { + z = z.mulAddWW(z, pow(b1, i), di) + } + res = z.norm() + + // adjust for fraction, if any + if dp >= 0 { + // 0 <= dp <= count > 0 + count = dp - count + } + + return +} + +// Character sets for string conversion. +const ( + lowercaseDigits = "0123456789abcdefghijklmnopqrstuvwxyz" + uppercaseDigits = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ" +) + +// decimalString returns a decimal representation of x. +// It calls x.string with the charset "0123456789". +func (x nat) decimalString() string { + return x.string(lowercaseDigits[:10]) +} + +// hexString returns a hexadecimal representation of x. +// It calls x.string with the charset "0123456789abcdef". +func (x nat) hexString() string { + return x.string(lowercaseDigits[:16]) +} + +// string converts x to a string using digits from a charset; a digit with +// value d is represented by charset[d]. The conversion base is determined +// by len(charset), which must be >= 2 and <= 256. +func (x nat) string(charset string) string { + b := Word(len(charset)) + + // special cases + switch { + case b < 2 || b > 256: + panic("invalid character set length") + case len(x) == 0: + return string(charset[0]) + } + + // allocate buffer for conversion + i := int(float64(x.bitLen())/math.Log2(float64(b))) + 1 // off by one at most + s := make([]byte, i) + + // convert power of two and non power of two bases separately + if b == b&-b { + // shift is base-b digit size in bits + shift := trailingZeroBits(b) // shift > 0 because b >= 2 + mask := Word(1)<= shift { + i-- + s[i] = charset[w&mask] + w >>= shift + nbits -= shift + } + + // convert any partial leading digit and advance to next word + if nbits == 0 { + // no partial digit remaining, just advance + w = x[k] + nbits = _W + } else { + // partial digit in current (k-1) and next (k) word + w |= x[k] << nbits + i-- + s[i] = charset[w&mask] + + // advance + w = x[k] >> (shift - nbits) + nbits = _W - (shift - nbits) + } + } + + // convert digits of most-significant word (omit leading zeros) + for nbits >= 0 && w != 0 { + i-- + s[i] = charset[w&mask] + w >>= shift + nbits -= shift + } + + } else { + bb, ndigits := maxPow(Word(b)) + + // construct table of successive squares of bb*leafSize to use in subdivisions + // result (table != nil) <=> (len(x) > leafSize > 0) + table := divisors(len(x), b, ndigits, bb) + + // preserve x, create local copy for use by convertWords + q := nat(nil).set(x) + + // convert q to string s in base b + q.convertWords(s, charset, b, ndigits, bb, table) + + // strip leading zeros + // (x != 0; thus s must contain at least one non-zero digit + // and the loop will terminate) + i = 0 + for zero := charset[0]; s[i] == zero; { + i++ + } + } + + return string(s[i:]) +} + +// Convert words of q to base b digits in s. If q is large, it is recursively "split in half" +// by nat/nat division using tabulated divisors. Otherwise, it is converted iteratively using +// repeated nat/Word division. +// +// The iterative method processes n Words by n divW() calls, each of which visits every Word in the +// incrementally shortened q for a total of n + (n-1) + (n-2) ... + 2 + 1, or n(n+1)/2 divW()'s. +// Recursive conversion divides q by its approximate square root, yielding two parts, each half +// the size of q. Using the iterative method on both halves means 2 * (n/2)(n/2 + 1)/2 divW()'s +// plus the expensive long div(). Asymptotically, the ratio is favorable at 1/2 the divW()'s, and +// is made better by splitting the subblocks recursively. Best is to split blocks until one more +// split would take longer (because of the nat/nat div()) than the twice as many divW()'s of the +// iterative approach. This threshold is represented by leafSize. Benchmarking of leafSize in the +// range 2..64 shows that values of 8 and 16 work well, with a 4x speedup at medium lengths and +// ~30x for 20000 digits. Use nat_test.go's BenchmarkLeafSize tests to optimize leafSize for +// specific hardware. +// +func (q nat) convertWords(s []byte, charset string, b Word, ndigits int, bb Word, table []divisor) { + // split larger blocks recursively + if table != nil { + // len(q) > leafSize > 0 + var r nat + index := len(table) - 1 + for len(q) > leafSize { + // find divisor close to sqrt(q) if possible, but in any case < q + maxLength := q.bitLen() // ~= log2 q, or at of least largest possible q of this bit length + minLength := maxLength >> 1 // ~= log2 sqrt(q) + for index > 0 && table[index-1].nbits > minLength { + index-- // desired + } + if table[index].nbits >= maxLength && table[index].bbb.cmp(q) >= 0 { + index-- + if index < 0 { + panic("internal inconsistency") + } + } + + // split q into the two digit number (q'*bbb + r) to form independent subblocks + q, r = q.div(r, q, table[index].bbb) + + // convert subblocks and collect results in s[:h] and s[h:] + h := len(s) - table[index].ndigits + r.convertWords(s[h:], charset, b, ndigits, bb, table[0:index]) + s = s[:h] // == q.convertWords(s, charset, b, ndigits, bb, table[0:index+1]) + } + } + + // having split any large blocks now process the remaining (small) block iteratively + i := len(s) + var r Word + if b == 10 { + // hard-coding for 10 here speeds this up by 1.25x (allows for / and % by constants) + for len(q) > 0 { + // extract least significant, base bb "digit" + q, r = q.divW(q, bb) + for j := 0; j < ndigits && i > 0; j++ { + i-- + // avoid % computation since r%10 == r - int(r/10)*10; + // this appears to be faster for BenchmarkString10000Base10 + // and smaller strings (but a bit slower for larger ones) + t := r / 10 + s[i] = charset[r-t<<3-t-t] // TODO(gri) replace w/ t*10 once compiler produces better code + r = t + } + } + } else { + for len(q) > 0 { + // extract least significant, base bb "digit" + q, r = q.divW(q, bb) + for j := 0; j < ndigits && i > 0; j++ { + i-- + s[i] = charset[r%b] + r /= b + } + } + } + + // prepend high-order zeroes + zero := charset[0] + for i > 0 { // while need more leading zeroes + i-- + s[i] = zero + } +} + +// Split blocks greater than leafSize Words (or set to 0 to disable recursive conversion) +// Benchmark and configure leafSize using: go test -bench="Leaf" +// 8 and 16 effective on 3.0 GHz Xeon "Clovertown" CPU (128 byte cache lines) +// 8 and 16 effective on 2.66 GHz Core 2 Duo "Penryn" CPU +var leafSize int = 8 // number of Word-size binary values treat as a monolithic block + +type divisor struct { + bbb nat // divisor + nbits int // bit length of divisor (discounting leading zeroes) ~= log2(bbb) + ndigits int // digit length of divisor in terms of output base digits +} + +var cacheBase10 struct { + sync.Mutex + table [64]divisor // cached divisors for base 10 +} + +// expWW computes x**y +func (z nat) expWW(x, y Word) nat { + return z.expNN(nat(nil).setWord(x), nat(nil).setWord(y), nil) +} + +// construct table of powers of bb*leafSize to use in subdivisions +func divisors(m int, b Word, ndigits int, bb Word) []divisor { + // only compute table when recursive conversion is enabled and x is large + if leafSize == 0 || m <= leafSize { + return nil + } + + // determine k where (bb**leafSize)**(2**k) >= sqrt(x) + k := 1 + for words := leafSize; words < m>>1 && k < len(cacheBase10.table); words <<= 1 { + k++ + } + + // reuse and extend existing table of divisors or create new table as appropriate + var table []divisor // for b == 10, table overlaps with cacheBase10.table + if b == 10 { + cacheBase10.Lock() + table = cacheBase10.table[0:k] // reuse old table for this conversion + } else { + table = make([]divisor, k) // create new table for this conversion + } + + // extend table + if table[k-1].ndigits == 0 { + // add new entries as needed + var larger nat + for i := 0; i < k; i++ { + if table[i].ndigits == 0 { + if i == 0 { + table[0].bbb = nat(nil).expWW(bb, Word(leafSize)) + table[0].ndigits = ndigits * leafSize + } else { + table[i].bbb = nat(nil).mul(table[i-1].bbb, table[i-1].bbb) + table[i].ndigits = 2 * table[i-1].ndigits + } + + // optimization: exploit aggregated extra bits in macro blocks + larger = nat(nil).set(table[i].bbb) + for mulAddVWW(larger, larger, b, 0) == 0 { + table[i].bbb = table[i].bbb.set(larger) + table[i].ndigits++ + } + + table[i].nbits = table[i].bbb.bitLen() + } + } + } + + if b == 10 { + cacheBase10.Unlock() + } + + return table +} diff --git a/src/cmd/compile/internal/big/natconv_test.go b/src/cmd/compile/internal/big/natconv_test.go new file mode 100644 index 0000000000000000000000000000000000000000..f321fbc2df0884b18f4b1e767383f7be9d599b2c --- /dev/null +++ b/src/cmd/compile/internal/big/natconv_test.go @@ -0,0 +1,425 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package big + +import ( + "io" + "strings" + "testing" +) + +func toString(x nat, charset string) string { + base := len(charset) + + // special cases + switch { + case base < 2: + panic("illegal base") + case len(x) == 0: + return string(charset[0]) + } + + // allocate buffer for conversion + i := x.bitLen()/log2(Word(base)) + 1 // +1: round up + s := make([]byte, i) + + // don't destroy x + q := nat(nil).set(x) + + // convert + for len(q) > 0 { + i-- + var r Word + q, r = q.divW(q, Word(base)) + s[i] = charset[r] + } + + return string(s[i:]) +} + +var strTests = []struct { + x nat // nat value to be converted + c string // conversion charset + s string // expected result +}{ + {nil, "01", "0"}, + {nat{1}, "01", "1"}, + {nat{0xc5}, "01", "11000101"}, + {nat{03271}, lowercaseDigits[:8], "3271"}, + {nat{10}, lowercaseDigits[:10], "10"}, + {nat{1234567890}, uppercaseDigits[:10], "1234567890"}, + {nat{0xdeadbeef}, lowercaseDigits[:16], "deadbeef"}, + {nat{0xdeadbeef}, uppercaseDigits[:16], "DEADBEEF"}, + {nat{0x229be7}, lowercaseDigits[:17], "1a2b3c"}, + {nat{0x309663e6}, uppercaseDigits[:32], "O9COV6"}, +} + +func TestString(t *testing.T) { + // test invalid character set explicitly + var panicStr string + func() { + defer func() { + panicStr = recover().(string) + }() + natOne.string("0") + }() + if panicStr != "invalid character set length" { + t.Errorf("expected panic for invalid character set") + } + + for _, a := range strTests { + s := a.x.string(a.c) + if s != a.s { + t.Errorf("string%+v\n\tgot s = %s; want %s", a, s, a.s) + } + + x, b, _, err := nat(nil).scan(strings.NewReader(a.s), len(a.c), false) + if x.cmp(a.x) != 0 { + t.Errorf("scan%+v\n\tgot z = %v; want %v", a, x, a.x) + } + if b != len(a.c) { + t.Errorf("scan%+v\n\tgot b = %d; want %d", a, b, len(a.c)) + } + if err != nil { + t.Errorf("scan%+v\n\tgot error = %s", a, err) + } + } +} + +var natScanTests = []struct { + s string // string to be scanned + base int // input base + frac bool // fraction ok + x nat // expected nat + b int // expected base + count int // expected digit count + ok bool // expected success + next rune // next character (or 0, if at EOF) +}{ + // error: no mantissa + {}, + {s: "?"}, + {base: 10}, + {base: 36}, + {s: "?", base: 10}, + {s: "0x"}, + {s: "345", base: 2}, + + // error: incorrect use of decimal point + {s: ".0"}, + {s: ".0", base: 10}, + {s: ".", base: 0}, + {s: "0x.0"}, + + // no errors + {"0", 0, false, nil, 10, 1, true, 0}, + {"0", 10, false, nil, 10, 1, true, 0}, + {"0", 36, false, nil, 36, 1, true, 0}, + {"1", 0, false, nat{1}, 10, 1, true, 0}, + {"1", 10, false, nat{1}, 10, 1, true, 0}, + {"0 ", 0, false, nil, 10, 1, true, ' '}, + {"08", 0, false, nil, 10, 1, true, '8'}, + {"08", 10, false, nat{8}, 10, 2, true, 0}, + {"018", 0, false, nat{1}, 8, 1, true, '8'}, + {"0b1", 0, false, nat{1}, 2, 1, true, 0}, + {"0b11000101", 0, false, nat{0xc5}, 2, 8, true, 0}, + {"03271", 0, false, nat{03271}, 8, 4, true, 0}, + {"10ab", 0, false, nat{10}, 10, 2, true, 'a'}, + {"1234567890", 0, false, nat{1234567890}, 10, 10, true, 0}, + {"xyz", 36, false, nat{(33*36+34)*36 + 35}, 36, 3, true, 0}, + {"xyz?", 36, false, nat{(33*36+34)*36 + 35}, 36, 3, true, '?'}, + {"0x", 16, false, nil, 16, 1, true, 'x'}, + {"0xdeadbeef", 0, false, nat{0xdeadbeef}, 16, 8, true, 0}, + {"0XDEADBEEF", 0, false, nat{0xdeadbeef}, 16, 8, true, 0}, + + // no errors, decimal point + {"0.", 0, false, nil, 10, 1, true, '.'}, + {"0.", 10, true, nil, 10, 0, true, 0}, + {"0.1.2", 10, true, nat{1}, 10, -1, true, '.'}, + {".000", 10, true, nil, 10, -3, true, 0}, + {"12.3", 10, true, nat{123}, 10, -1, true, 0}, + {"012.345", 10, true, nat{12345}, 10, -3, true, 0}, +} + +func TestScanBase(t *testing.T) { + for _, a := range natScanTests { + r := strings.NewReader(a.s) + x, b, count, err := nat(nil).scan(r, a.base, a.frac) + if err == nil && !a.ok { + t.Errorf("scan%+v\n\texpected error", a) + } + if err != nil { + if a.ok { + t.Errorf("scan%+v\n\tgot error = %s", a, err) + } + continue + } + if x.cmp(a.x) != 0 { + t.Errorf("scan%+v\n\tgot z = %v; want %v", a, x, a.x) + } + if b != a.b { + t.Errorf("scan%+v\n\tgot b = %d; want %d", a, b, a.base) + } + if count != a.count { + t.Errorf("scan%+v\n\tgot count = %d; want %d", a, count, a.count) + } + next, _, err := r.ReadRune() + if err == io.EOF { + next = 0 + err = nil + } + if err == nil && next != a.next { + t.Errorf("scan%+v\n\tgot next = %q; want %q", a, next, a.next) + } + } +} + +var pi = "3" + + "14159265358979323846264338327950288419716939937510582097494459230781640628620899862803482534211706798214808651" + + "32823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461" + + "28475648233786783165271201909145648566923460348610454326648213393607260249141273724587006606315588174881520920" + + "96282925409171536436789259036001133053054882046652138414695194151160943305727036575959195309218611738193261179" + + "31051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798" + + "60943702770539217176293176752384674818467669405132000568127145263560827785771342757789609173637178721468440901" + + "22495343014654958537105079227968925892354201995611212902196086403441815981362977477130996051870721134999999837" + + "29780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083" + + "81420617177669147303598253490428755468731159562863882353787593751957781857780532171226806613001927876611195909" + + "21642019893809525720106548586327886593615338182796823030195203530185296899577362259941389124972177528347913151" + + "55748572424541506959508295331168617278558890750983817546374649393192550604009277016711390098488240128583616035" + + "63707660104710181942955596198946767837449448255379774726847104047534646208046684259069491293313677028989152104" + + "75216205696602405803815019351125338243003558764024749647326391419927260426992279678235478163600934172164121992" + + "45863150302861829745557067498385054945885869269956909272107975093029553211653449872027559602364806654991198818" + + "34797753566369807426542527862551818417574672890977772793800081647060016145249192173217214772350141441973568548" + + "16136115735255213347574184946843852332390739414333454776241686251898356948556209921922218427255025425688767179" + + "04946016534668049886272327917860857843838279679766814541009538837863609506800642251252051173929848960841284886" + + "26945604241965285022210661186306744278622039194945047123713786960956364371917287467764657573962413890865832645" + + "99581339047802759009946576407895126946839835259570982582262052248940772671947826848260147699090264013639443745" + + "53050682034962524517493996514314298091906592509372216964615157098583874105978859597729754989301617539284681382" + + "68683868942774155991855925245953959431049972524680845987273644695848653836736222626099124608051243884390451244" + + "13654976278079771569143599770012961608944169486855584840635342207222582848864815845602850601684273945226746767" + + "88952521385225499546667278239864565961163548862305774564980355936345681743241125150760694794510965960940252288" + + "79710893145669136867228748940560101503308617928680920874760917824938589009714909675985261365549781893129784821" + + "68299894872265880485756401427047755513237964145152374623436454285844479526586782105114135473573952311342716610" + + "21359695362314429524849371871101457654035902799344037420073105785390621983874478084784896833214457138687519435" + + "06430218453191048481005370614680674919278191197939952061419663428754440643745123718192179998391015919561814675" + + "14269123974894090718649423196156794520809514655022523160388193014209376213785595663893778708303906979207734672" + + "21825625996615014215030680384477345492026054146659252014974428507325186660021324340881907104863317346496514539" + + "05796268561005508106658796998163574736384052571459102897064140110971206280439039759515677157700420337869936007" + + "23055876317635942187312514712053292819182618612586732157919841484882916447060957527069572209175671167229109816" + + "90915280173506712748583222871835209353965725121083579151369882091444210067510334671103141267111369908658516398" + + "31501970165151168517143765761835155650884909989859982387345528331635507647918535893226185489632132933089857064" + + "20467525907091548141654985946163718027098199430992448895757128289059232332609729971208443357326548938239119325" + + "97463667305836041428138830320382490375898524374417029132765618093773444030707469211201913020330380197621101100" + + "44929321516084244485963766983895228684783123552658213144957685726243344189303968642624341077322697802807318915" + + "44110104468232527162010526522721116603966655730925471105578537634668206531098965269186205647693125705863566201" + + "85581007293606598764861179104533488503461136576867532494416680396265797877185560845529654126654085306143444318" + + "58676975145661406800700237877659134401712749470420562230538994561314071127000407854733269939081454664645880797" + + "27082668306343285878569830523580893306575740679545716377525420211495576158140025012622859413021647155097925923" + + "09907965473761255176567513575178296664547791745011299614890304639947132962107340437518957359614589019389713111" + + "79042978285647503203198691514028708085990480109412147221317947647772622414254854540332157185306142288137585043" + + "06332175182979866223717215916077166925474873898665494945011465406284336639379003976926567214638530673609657120" + + "91807638327166416274888800786925602902284721040317211860820419000422966171196377921337575114959501566049631862" + + "94726547364252308177036751590673502350728354056704038674351362222477158915049530984448933309634087807693259939" + + "78054193414473774418426312986080998886874132604721569516239658645730216315981931951673538129741677294786724229" + + "24654366800980676928238280689964004824354037014163149658979409243237896907069779422362508221688957383798623001" + + "59377647165122893578601588161755782973523344604281512627203734314653197777416031990665541876397929334419521541" + + "34189948544473456738316249934191318148092777710386387734317720754565453220777092120190516609628049092636019759" + + "88281613323166636528619326686336062735676303544776280350450777235547105859548702790814356240145171806246436267" + + "94561275318134078330336254232783944975382437205835311477119926063813346776879695970309833913077109870408591337" + +// Test case for BenchmarkScanPi. +func TestScanPi(t *testing.T) { + var x nat + z, _, _, err := x.scan(strings.NewReader(pi), 10, false) + if err != nil { + t.Errorf("scanning pi: %s", err) + } + if s := z.decimalString(); s != pi { + t.Errorf("scanning pi: got %s", s) + } +} + +func TestScanPiParallel(t *testing.T) { + const n = 2 + c := make(chan int) + for i := 0; i < n; i++ { + go func() { + TestScanPi(t) + c <- 0 + }() + } + for i := 0; i < n; i++ { + <-c + } +} + +func BenchmarkScanPi(b *testing.B) { + for i := 0; i < b.N; i++ { + var x nat + x.scan(strings.NewReader(pi), 10, false) + } +} + +func BenchmarkStringPiParallel(b *testing.B) { + var x nat + x, _, _, _ = x.scan(strings.NewReader(pi), 0, false) + if x.decimalString() != pi { + panic("benchmark incorrect: conversion failed") + } + b.RunParallel(func(pb *testing.PB) { + for pb.Next() { + x.decimalString() + } + }) +} + +func BenchmarkScan10Base2(b *testing.B) { ScanHelper(b, 2, 10, 10) } +func BenchmarkScan100Base2(b *testing.B) { ScanHelper(b, 2, 10, 100) } +func BenchmarkScan1000Base2(b *testing.B) { ScanHelper(b, 2, 10, 1000) } +func BenchmarkScan10000Base2(b *testing.B) { ScanHelper(b, 2, 10, 10000) } +func BenchmarkScan100000Base2(b *testing.B) { ScanHelper(b, 2, 10, 100000) } + +func BenchmarkScan10Base8(b *testing.B) { ScanHelper(b, 8, 10, 10) } +func BenchmarkScan100Base8(b *testing.B) { ScanHelper(b, 8, 10, 100) } +func BenchmarkScan1000Base8(b *testing.B) { ScanHelper(b, 8, 10, 1000) } +func BenchmarkScan10000Base8(b *testing.B) { ScanHelper(b, 8, 10, 10000) } +func BenchmarkScan100000Base8(b *testing.B) { ScanHelper(b, 8, 10, 100000) } + +func BenchmarkScan10Base10(b *testing.B) { ScanHelper(b, 10, 10, 10) } +func BenchmarkScan100Base10(b *testing.B) { ScanHelper(b, 10, 10, 100) } +func BenchmarkScan1000Base10(b *testing.B) { ScanHelper(b, 10, 10, 1000) } +func BenchmarkScan10000Base10(b *testing.B) { ScanHelper(b, 10, 10, 10000) } +func BenchmarkScan100000Base10(b *testing.B) { ScanHelper(b, 10, 10, 100000) } + +func BenchmarkScan10Base16(b *testing.B) { ScanHelper(b, 16, 10, 10) } +func BenchmarkScan100Base16(b *testing.B) { ScanHelper(b, 16, 10, 100) } +func BenchmarkScan1000Base16(b *testing.B) { ScanHelper(b, 16, 10, 1000) } +func BenchmarkScan10000Base16(b *testing.B) { ScanHelper(b, 16, 10, 10000) } +func BenchmarkScan100000Base16(b *testing.B) { ScanHelper(b, 16, 10, 100000) } + +func ScanHelper(b *testing.B, base int, x, y Word) { + b.StopTimer() + var z nat + z = z.expWW(x, y) + + var s string + s = z.string(lowercaseDigits[:base]) + if t := toString(z, lowercaseDigits[:base]); t != s { + b.Fatalf("scanning: got %s; want %s", s, t) + } + b.StartTimer() + + for i := 0; i < b.N; i++ { + z.scan(strings.NewReader(s), base, false) + } +} + +func BenchmarkString10Base2(b *testing.B) { StringHelper(b, 2, 10, 10) } +func BenchmarkString100Base2(b *testing.B) { StringHelper(b, 2, 10, 100) } +func BenchmarkString1000Base2(b *testing.B) { StringHelper(b, 2, 10, 1000) } +func BenchmarkString10000Base2(b *testing.B) { StringHelper(b, 2, 10, 10000) } +func BenchmarkString100000Base2(b *testing.B) { StringHelper(b, 2, 10, 100000) } + +func BenchmarkString10Base8(b *testing.B) { StringHelper(b, 8, 10, 10) } +func BenchmarkString100Base8(b *testing.B) { StringHelper(b, 8, 10, 100) } +func BenchmarkString1000Base8(b *testing.B) { StringHelper(b, 8, 10, 1000) } +func BenchmarkString10000Base8(b *testing.B) { StringHelper(b, 8, 10, 10000) } +func BenchmarkString100000Base8(b *testing.B) { StringHelper(b, 8, 10, 100000) } + +func BenchmarkString10Base10(b *testing.B) { StringHelper(b, 10, 10, 10) } +func BenchmarkString100Base10(b *testing.B) { StringHelper(b, 10, 10, 100) } +func BenchmarkString1000Base10(b *testing.B) { StringHelper(b, 10, 10, 1000) } +func BenchmarkString10000Base10(b *testing.B) { StringHelper(b, 10, 10, 10000) } +func BenchmarkString100000Base10(b *testing.B) { StringHelper(b, 10, 10, 100000) } + +func BenchmarkString10Base16(b *testing.B) { StringHelper(b, 16, 10, 10) } +func BenchmarkString100Base16(b *testing.B) { StringHelper(b, 16, 10, 100) } +func BenchmarkString1000Base16(b *testing.B) { StringHelper(b, 16, 10, 1000) } +func BenchmarkString10000Base16(b *testing.B) { StringHelper(b, 16, 10, 10000) } +func BenchmarkString100000Base16(b *testing.B) { StringHelper(b, 16, 10, 100000) } + +func StringHelper(b *testing.B, base int, x, y Word) { + b.StopTimer() + var z nat + z = z.expWW(x, y) + z.string(lowercaseDigits[:base]) // warm divisor cache + b.StartTimer() + + for i := 0; i < b.N; i++ { + _ = z.string(lowercaseDigits[:base]) + } +} + +func BenchmarkLeafSize0(b *testing.B) { LeafSizeHelper(b, 10, 0) } // test without splitting +func BenchmarkLeafSize1(b *testing.B) { LeafSizeHelper(b, 10, 1) } +func BenchmarkLeafSize2(b *testing.B) { LeafSizeHelper(b, 10, 2) } +func BenchmarkLeafSize3(b *testing.B) { LeafSizeHelper(b, 10, 3) } +func BenchmarkLeafSize4(b *testing.B) { LeafSizeHelper(b, 10, 4) } +func BenchmarkLeafSize5(b *testing.B) { LeafSizeHelper(b, 10, 5) } +func BenchmarkLeafSize6(b *testing.B) { LeafSizeHelper(b, 10, 6) } +func BenchmarkLeafSize7(b *testing.B) { LeafSizeHelper(b, 10, 7) } +func BenchmarkLeafSize8(b *testing.B) { LeafSizeHelper(b, 10, 8) } +func BenchmarkLeafSize9(b *testing.B) { LeafSizeHelper(b, 10, 9) } +func BenchmarkLeafSize10(b *testing.B) { LeafSizeHelper(b, 10, 10) } +func BenchmarkLeafSize11(b *testing.B) { LeafSizeHelper(b, 10, 11) } +func BenchmarkLeafSize12(b *testing.B) { LeafSizeHelper(b, 10, 12) } +func BenchmarkLeafSize13(b *testing.B) { LeafSizeHelper(b, 10, 13) } +func BenchmarkLeafSize14(b *testing.B) { LeafSizeHelper(b, 10, 14) } +func BenchmarkLeafSize15(b *testing.B) { LeafSizeHelper(b, 10, 15) } +func BenchmarkLeafSize16(b *testing.B) { LeafSizeHelper(b, 10, 16) } +func BenchmarkLeafSize32(b *testing.B) { LeafSizeHelper(b, 10, 32) } // try some large lengths +func BenchmarkLeafSize64(b *testing.B) { LeafSizeHelper(b, 10, 64) } + +func LeafSizeHelper(b *testing.B, base Word, size int) { + b.StopTimer() + originalLeafSize := leafSize + resetTable(cacheBase10.table[:]) + leafSize = size + b.StartTimer() + + for d := 1; d <= 10000; d *= 10 { + b.StopTimer() + var z nat + z = z.expWW(base, Word(d)) // build target number + _ = z.string(lowercaseDigits[:base]) // warm divisor cache + b.StartTimer() + + for i := 0; i < b.N; i++ { + _ = z.string(lowercaseDigits[:base]) + } + } + + b.StopTimer() + resetTable(cacheBase10.table[:]) + leafSize = originalLeafSize + b.StartTimer() +} + +func resetTable(table []divisor) { + if table != nil && table[0].bbb != nil { + for i := 0; i < len(table); i++ { + table[i].bbb = nil + table[i].nbits = 0 + table[i].ndigits = 0 + } + } +} + +func TestStringPowers(t *testing.T) { + var b, p Word + for b = 2; b <= 16; b++ { + for p = 0; p <= 512; p++ { + x := nat(nil).expWW(b, p) + xs := x.string(lowercaseDigits[:b]) + xs2 := toString(x, lowercaseDigits[:b]) + if xs != xs2 { + t.Errorf("failed at %d ** %d in base %d: %s != %s", b, p, b, xs, xs2) + } + } + if b >= 3 && testing.Short() { + break + } + } +} diff --git a/src/cmd/compile/internal/big/rat.go b/src/cmd/compile/internal/big/rat.go new file mode 100644 index 0000000000000000000000000000000000000000..fb16f18a964e7121dc3cb635887a6a8d37c3628b --- /dev/null +++ b/src/cmd/compile/internal/big/rat.go @@ -0,0 +1,570 @@ +// Copyright 2010 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// This file implements multi-precision rational numbers. + +package big + +import ( + "encoding/binary" + "errors" + "fmt" + "math" +) + +// A Rat represents a quotient a/b of arbitrary precision. +// The zero value for a Rat represents the value 0. +type Rat struct { + // To make zero values for Rat work w/o initialization, + // a zero value of b (len(b) == 0) acts like b == 1. + // a.neg determines the sign of the Rat, b.neg is ignored. + a, b Int +} + +// NewRat creates a new Rat with numerator a and denominator b. +func NewRat(a, b int64) *Rat { + return new(Rat).SetFrac64(a, b) +} + +// SetFloat64 sets z to exactly f and returns z. +// If f is not finite, SetFloat returns nil. +func (z *Rat) SetFloat64(f float64) *Rat { + const expMask = 1<<11 - 1 + bits := math.Float64bits(f) + mantissa := bits & (1<<52 - 1) + exp := int((bits >> 52) & expMask) + switch exp { + case expMask: // non-finite + return nil + case 0: // denormal + exp -= 1022 + default: // normal + mantissa |= 1 << 52 + exp -= 1023 + } + + shift := 52 - exp + + // Optimization (?): partially pre-normalise. + for mantissa&1 == 0 && shift > 0 { + mantissa >>= 1 + shift-- + } + + z.a.SetUint64(mantissa) + z.a.neg = f < 0 + z.b.Set(intOne) + if shift > 0 { + z.b.Lsh(&z.b, uint(shift)) + } else { + z.a.Lsh(&z.a, uint(-shift)) + } + return z.norm() +} + +// quotToFloat32 returns the non-negative float32 value +// nearest to the quotient a/b, using round-to-even in +// halfway cases. It does not mutate its arguments. +// Preconditions: b is non-zero; a and b have no common factors. +func quotToFloat32(a, b nat) (f float32, exact bool) { + const ( + // float size in bits + Fsize = 32 + + // mantissa + Msize = 23 + Msize1 = Msize + 1 // incl. implicit 1 + Msize2 = Msize1 + 1 + + // exponent + Esize = Fsize - Msize1 + Ebias = 1<<(Esize-1) - 1 + Emin = 1 - Ebias + Emax = Ebias + ) + + // TODO(adonovan): specialize common degenerate cases: 1.0, integers. + alen := a.bitLen() + if alen == 0 { + return 0, true + } + blen := b.bitLen() + if blen == 0 { + panic("division by zero") + } + + // 1. Left-shift A or B such that quotient A/B is in [1<= B). + // This is 2 or 3 more than the float32 mantissa field width of Msize: + // - the optional extra bit is shifted away in step 3 below. + // - the high-order 1 is omitted in "normal" representation; + // - the low-order 1 will be used during rounding then discarded. + exp := alen - blen + var a2, b2 nat + a2 = a2.set(a) + b2 = b2.set(b) + if shift := Msize2 - exp; shift > 0 { + a2 = a2.shl(a2, uint(shift)) + } else if shift < 0 { + b2 = b2.shl(b2, uint(-shift)) + } + + // 2. Compute quotient and remainder (q, r). NB: due to the + // extra shift, the low-order bit of q is logically the + // high-order bit of r. + var q nat + q, r := q.div(a2, a2, b2) // (recycle a2) + mantissa := low32(q) + haveRem := len(r) > 0 // mantissa&1 && !haveRem => remainder is exactly half + + // 3. If quotient didn't fit in Msize2 bits, redo division by b2<<1 + // (in effect---we accomplish this incrementally). + if mantissa>>Msize2 == 1 { + if mantissa&1 == 1 { + haveRem = true + } + mantissa >>= 1 + exp++ + } + if mantissa>>Msize1 != 1 { + panic(fmt.Sprintf("expected exactly %d bits of result", Msize2)) + } + + // 4. Rounding. + if Emin-Msize <= exp && exp <= Emin { + // Denormal case; lose 'shift' bits of precision. + shift := uint(Emin - (exp - 1)) // [1..Esize1) + lostbits := mantissa & (1<>= shift + exp = 2 - Ebias // == exp + shift + } + // Round q using round-half-to-even. + exact = !haveRem + if mantissa&1 != 0 { + exact = false + if haveRem || mantissa&2 != 0 { + if mantissa++; mantissa >= 1< 100...0, so shift is safe + mantissa >>= 1 + exp++ + } + } + } + mantissa >>= 1 // discard rounding bit. Mantissa now scaled by 1<= B). + // This is 2 or 3 more than the float64 mantissa field width of Msize: + // - the optional extra bit is shifted away in step 3 below. + // - the high-order 1 is omitted in "normal" representation; + // - the low-order 1 will be used during rounding then discarded. + exp := alen - blen + var a2, b2 nat + a2 = a2.set(a) + b2 = b2.set(b) + if shift := Msize2 - exp; shift > 0 { + a2 = a2.shl(a2, uint(shift)) + } else if shift < 0 { + b2 = b2.shl(b2, uint(-shift)) + } + + // 2. Compute quotient and remainder (q, r). NB: due to the + // extra shift, the low-order bit of q is logically the + // high-order bit of r. + var q nat + q, r := q.div(a2, a2, b2) // (recycle a2) + mantissa := low64(q) + haveRem := len(r) > 0 // mantissa&1 && !haveRem => remainder is exactly half + + // 3. If quotient didn't fit in Msize2 bits, redo division by b2<<1 + // (in effect---we accomplish this incrementally). + if mantissa>>Msize2 == 1 { + if mantissa&1 == 1 { + haveRem = true + } + mantissa >>= 1 + exp++ + } + if mantissa>>Msize1 != 1 { + panic(fmt.Sprintf("expected exactly %d bits of result", Msize2)) + } + + // 4. Rounding. + if Emin-Msize <= exp && exp <= Emin { + // Denormal case; lose 'shift' bits of precision. + shift := uint(Emin - (exp - 1)) // [1..Esize1) + lostbits := mantissa & (1<>= shift + exp = 2 - Ebias // == exp + shift + } + // Round q using round-half-to-even. + exact = !haveRem + if mantissa&1 != 0 { + exact = false + if haveRem || mantissa&2 != 0 { + if mantissa++; mantissa >= 1< 100...0, so shift is safe + mantissa >>= 1 + exp++ + } + } + } + mantissa >>= 1 // discard rounding bit. Mantissa now scaled by 1< 0 && !z.a.neg // 0 has no sign + return z +} + +// Inv sets z to 1/x and returns z. +func (z *Rat) Inv(x *Rat) *Rat { + if len(x.a.abs) == 0 { + panic("division by zero") + } + z.Set(x) + a := z.b.abs + if len(a) == 0 { + a = a.set(natOne) // materialize numerator + } + b := z.a.abs + if b.cmp(natOne) == 0 { + b = b[:0] // normalize denominator + } + z.a.abs, z.b.abs = a, b // sign doesn't change + return z +} + +// Sign returns: +// +// -1 if x < 0 +// 0 if x == 0 +// +1 if x > 0 +// +func (x *Rat) Sign() int { + return x.a.Sign() +} + +// IsInt reports whether the denominator of x is 1. +func (x *Rat) IsInt() bool { + return len(x.b.abs) == 0 || x.b.abs.cmp(natOne) == 0 +} + +// Num returns the numerator of x; it may be <= 0. +// The result is a reference to x's numerator; it +// may change if a new value is assigned to x, and vice versa. +// The sign of the numerator corresponds to the sign of x. +func (x *Rat) Num() *Int { + return &x.a +} + +// Denom returns the denominator of x; it is always > 0. +// The result is a reference to x's denominator; it +// may change if a new value is assigned to x, and vice versa. +func (x *Rat) Denom() *Int { + x.b.neg = false // the result is always >= 0 + if len(x.b.abs) == 0 { + x.b.abs = x.b.abs.set(natOne) // materialize denominator + } + return &x.b +} + +func (z *Rat) norm() *Rat { + switch { + case len(z.a.abs) == 0: + // z == 0 - normalize sign and denominator + z.a.neg = false + z.b.abs = z.b.abs[:0] + case len(z.b.abs) == 0: + // z is normalized int - nothing to do + case z.b.abs.cmp(natOne) == 0: + // z is int - normalize denominator + z.b.abs = z.b.abs[:0] + default: + neg := z.a.neg + z.a.neg = false + z.b.neg = false + if f := NewInt(0).binaryGCD(&z.a, &z.b); f.Cmp(intOne) != 0 { + z.a.abs, _ = z.a.abs.div(nil, z.a.abs, f.abs) + z.b.abs, _ = z.b.abs.div(nil, z.b.abs, f.abs) + if z.b.abs.cmp(natOne) == 0 { + // z is int - normalize denominator + z.b.abs = z.b.abs[:0] + } + } + z.a.neg = neg + } + return z +} + +// mulDenom sets z to the denominator product x*y (by taking into +// account that 0 values for x or y must be interpreted as 1) and +// returns z. +func mulDenom(z, x, y nat) nat { + switch { + case len(x) == 0: + return z.set(y) + case len(y) == 0: + return z.set(x) + } + return z.mul(x, y) +} + +// scaleDenom computes x*f. +// If f == 0 (zero value of denominator), the result is (a copy of) x. +func scaleDenom(x *Int, f nat) *Int { + var z Int + if len(f) == 0 { + return z.Set(x) + } + z.abs = z.abs.mul(x.abs, f) + z.neg = x.neg + return &z +} + +// Cmp compares x and y and returns: +// +// -1 if x < y +// 0 if x == y +// +1 if x > y +// +func (x *Rat) Cmp(y *Rat) int { + return scaleDenom(&x.a, y.b.abs).Cmp(scaleDenom(&y.a, x.b.abs)) +} + +// Add sets z to the sum x+y and returns z. +func (z *Rat) Add(x, y *Rat) *Rat { + a1 := scaleDenom(&x.a, y.b.abs) + a2 := scaleDenom(&y.a, x.b.abs) + z.a.Add(a1, a2) + z.b.abs = mulDenom(z.b.abs, x.b.abs, y.b.abs) + return z.norm() +} + +// Sub sets z to the difference x-y and returns z. +func (z *Rat) Sub(x, y *Rat) *Rat { + a1 := scaleDenom(&x.a, y.b.abs) + a2 := scaleDenom(&y.a, x.b.abs) + z.a.Sub(a1, a2) + z.b.abs = mulDenom(z.b.abs, x.b.abs, y.b.abs) + return z.norm() +} + +// Mul sets z to the product x*y and returns z. +func (z *Rat) Mul(x, y *Rat) *Rat { + z.a.Mul(&x.a, &y.a) + z.b.abs = mulDenom(z.b.abs, x.b.abs, y.b.abs) + return z.norm() +} + +// Quo sets z to the quotient x/y and returns z. +// If y == 0, a division-by-zero run-time panic occurs. +func (z *Rat) Quo(x, y *Rat) *Rat { + if len(y.a.abs) == 0 { + panic("division by zero") + } + a := scaleDenom(&x.a, y.b.abs) + b := scaleDenom(&y.a, x.b.abs) + z.a.abs = a.abs + z.b.abs = b.abs + z.a.neg = a.neg != b.neg + return z.norm() +} + +// Gob codec version. Permits backward-compatible changes to the encoding. +const ratGobVersion byte = 1 + +// GobEncode implements the gob.GobEncoder interface. +func (x *Rat) GobEncode() ([]byte, error) { + if x == nil { + return nil, nil + } + buf := make([]byte, 1+4+(len(x.a.abs)+len(x.b.abs))*_S) // extra bytes for version and sign bit (1), and numerator length (4) + i := x.b.abs.bytes(buf) + j := x.a.abs.bytes(buf[:i]) + n := i - j + if int(uint32(n)) != n { + // this should never happen + return nil, errors.New("Rat.GobEncode: numerator too large") + } + binary.BigEndian.PutUint32(buf[j-4:j], uint32(n)) + j -= 1 + 4 + b := ratGobVersion << 1 // make space for sign bit + if x.a.neg { + b |= 1 + } + buf[j] = b + return buf[j:], nil +} + +// GobDecode implements the gob.GobDecoder interface. +func (z *Rat) GobDecode(buf []byte) error { + if len(buf) == 0 { + // Other side sent a nil or default value. + *z = Rat{} + return nil + } + b := buf[0] + if b>>1 != ratGobVersion { + return fmt.Errorf("Rat.GobDecode: encoding version %d not supported", b>>1) + } + const j = 1 + 4 + i := j + binary.BigEndian.Uint32(buf[j-4:j]) + z.a.neg = b&1 != 0 + z.a.abs = z.a.abs.setBytes(buf[j:i]) + z.b.abs = z.b.abs.setBytes(buf[i:]) + return nil +} + +// MarshalText implements the encoding.TextMarshaler interface. +func (r *Rat) MarshalText() (text []byte, err error) { + return []byte(r.RatString()), nil +} + +// UnmarshalText implements the encoding.TextUnmarshaler interface. +func (r *Rat) UnmarshalText(text []byte) error { + if _, ok := r.SetString(string(text)); !ok { + return fmt.Errorf("math/big: cannot unmarshal %q into a *big.Rat", text) + } + return nil +} diff --git a/src/cmd/compile/internal/big/rat_test.go b/src/cmd/compile/internal/big/rat_test.go new file mode 100644 index 0000000000000000000000000000000000000000..012d0c47ec4fb857553e9bb6de246f102dfd8348 --- /dev/null +++ b/src/cmd/compile/internal/big/rat_test.go @@ -0,0 +1,736 @@ +// Copyright 2010 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package big + +import ( + "bytes" + "encoding/gob" + "encoding/json" + "encoding/xml" + "math" + "testing" +) + +func TestZeroRat(t *testing.T) { + var x, y, z Rat + y.SetFrac64(0, 42) + + if x.Cmp(&y) != 0 { + t.Errorf("x and y should be both equal and zero") + } + + if s := x.String(); s != "0/1" { + t.Errorf("got x = %s, want 0/1", s) + } + + if s := x.RatString(); s != "0" { + t.Errorf("got x = %s, want 0", s) + } + + z.Add(&x, &y) + if s := z.RatString(); s != "0" { + t.Errorf("got x+y = %s, want 0", s) + } + + z.Sub(&x, &y) + if s := z.RatString(); s != "0" { + t.Errorf("got x-y = %s, want 0", s) + } + + z.Mul(&x, &y) + if s := z.RatString(); s != "0" { + t.Errorf("got x*y = %s, want 0", s) + } + + // check for division by zero + defer func() { + if s := recover(); s == nil || s.(string) != "division by zero" { + panic(s) + } + }() + z.Quo(&x, &y) +} + +func TestRatSign(t *testing.T) { + zero := NewRat(0, 1) + for _, a := range setStringTests { + x, ok := new(Rat).SetString(a.in) + if !ok { + continue + } + s := x.Sign() + e := x.Cmp(zero) + if s != e { + t.Errorf("got %d; want %d for z = %v", s, e, &x) + } + } +} + +var ratCmpTests = []struct { + rat1, rat2 string + out int +}{ + {"0", "0/1", 0}, + {"1/1", "1", 0}, + {"-1", "-2/2", 0}, + {"1", "0", 1}, + {"0/1", "1/1", -1}, + {"-5/1434770811533343057144", "-5/1434770811533343057145", -1}, + {"49832350382626108453/8964749413", "49832350382626108454/8964749413", -1}, + {"-37414950961700930/7204075375675961", "37414950961700930/7204075375675961", -1}, + {"37414950961700930/7204075375675961", "74829901923401860/14408150751351922", 0}, +} + +func TestRatCmp(t *testing.T) { + for i, test := range ratCmpTests { + x, _ := new(Rat).SetString(test.rat1) + y, _ := new(Rat).SetString(test.rat2) + + out := x.Cmp(y) + if out != test.out { + t.Errorf("#%d got out = %v; want %v", i, out, test.out) + } + } +} + +func TestIsInt(t *testing.T) { + one := NewInt(1) + for _, a := range setStringTests { + x, ok := new(Rat).SetString(a.in) + if !ok { + continue + } + i := x.IsInt() + e := x.Denom().Cmp(one) == 0 + if i != e { + t.Errorf("got IsInt(%v) == %v; want %v", x, i, e) + } + } +} + +func TestRatAbs(t *testing.T) { + zero := new(Rat) + for _, a := range setStringTests { + x, ok := new(Rat).SetString(a.in) + if !ok { + continue + } + e := new(Rat).Set(x) + if e.Cmp(zero) < 0 { + e.Sub(zero, e) + } + z := new(Rat).Abs(x) + if z.Cmp(e) != 0 { + t.Errorf("got Abs(%v) = %v; want %v", x, z, e) + } + } +} + +func TestRatNeg(t *testing.T) { + zero := new(Rat) + for _, a := range setStringTests { + x, ok := new(Rat).SetString(a.in) + if !ok { + continue + } + e := new(Rat).Sub(zero, x) + z := new(Rat).Neg(x) + if z.Cmp(e) != 0 { + t.Errorf("got Neg(%v) = %v; want %v", x, z, e) + } + } +} + +func TestRatInv(t *testing.T) { + zero := new(Rat) + for _, a := range setStringTests { + x, ok := new(Rat).SetString(a.in) + if !ok { + continue + } + if x.Cmp(zero) == 0 { + continue // avoid division by zero + } + e := new(Rat).SetFrac(x.Denom(), x.Num()) + z := new(Rat).Inv(x) + if z.Cmp(e) != 0 { + t.Errorf("got Inv(%v) = %v; want %v", x, z, e) + } + } +} + +type ratBinFun func(z, x, y *Rat) *Rat +type ratBinArg struct { + x, y, z string +} + +func testRatBin(t *testing.T, i int, name string, f ratBinFun, a ratBinArg) { + x, _ := new(Rat).SetString(a.x) + y, _ := new(Rat).SetString(a.y) + z, _ := new(Rat).SetString(a.z) + out := f(new(Rat), x, y) + + if out.Cmp(z) != 0 { + t.Errorf("%s #%d got %s want %s", name, i, out, z) + } +} + +var ratBinTests = []struct { + x, y string + sum, prod string +}{ + {"0", "0", "0", "0"}, + {"0", "1", "1", "0"}, + {"-1", "0", "-1", "0"}, + {"-1", "1", "0", "-1"}, + {"1", "1", "2", "1"}, + {"1/2", "1/2", "1", "1/4"}, + {"1/4", "1/3", "7/12", "1/12"}, + {"2/5", "-14/3", "-64/15", "-28/15"}, + {"4707/49292519774798173060", "-3367/70976135186689855734", "84058377121001851123459/1749296273614329067191168098769082663020", "-1760941/388732505247628681598037355282018369560"}, + {"-61204110018146728334/3", "-31052192278051565633/2", "-215564796870448153567/6", "950260896245257153059642991192710872711/3"}, + {"-854857841473707320655/4237645934602118692642972629634714039", "-18/31750379913563777419", "-27/133467566250814981", "15387441146526731771790/134546868362786310073779084329032722548987800600710485341"}, + {"618575745270541348005638912139/19198433543745179392300736", "-19948846211000086/637313996471", "27674141753240653/30123979153216", "-6169936206128396568797607742807090270137721977/6117715203873571641674006593837351328"}, + {"-3/26206484091896184128", "5/2848423294177090248", "15310893822118706237/9330894968229805033368778458685147968", "-5/24882386581946146755650075889827061248"}, + {"26946729/330400702820", "41563965/225583428284", "1238218672302860271/4658307703098666660055", "224002580204097/14906584649915733312176"}, + {"-8259900599013409474/7", "-84829337473700364773/56707961321161574960", "-468402123685491748914621885145127724451/396955729248131024720", "350340947706464153265156004876107029701/198477864624065512360"}, + {"575775209696864/1320203974639986246357", "29/712593081308", "410331716733912717985762465/940768218243776489278275419794956", "808/45524274987585732633"}, + {"1786597389946320496771/2066653520653241", "6269770/1992362624741777", "3559549865190272133656109052308126637/4117523232840525481453983149257", "8967230/3296219033"}, + {"-36459180403360509753/32150500941194292113930", "9381566963714/9633539", "301622077145533298008420642898530153/309723104686531919656937098270", "-3784609207827/3426986245"}, +} + +func TestRatBin(t *testing.T) { + for i, test := range ratBinTests { + arg := ratBinArg{test.x, test.y, test.sum} + testRatBin(t, i, "Add", (*Rat).Add, arg) + + arg = ratBinArg{test.y, test.x, test.sum} + testRatBin(t, i, "Add symmetric", (*Rat).Add, arg) + + arg = ratBinArg{test.sum, test.x, test.y} + testRatBin(t, i, "Sub", (*Rat).Sub, arg) + + arg = ratBinArg{test.sum, test.y, test.x} + testRatBin(t, i, "Sub symmetric", (*Rat).Sub, arg) + + arg = ratBinArg{test.x, test.y, test.prod} + testRatBin(t, i, "Mul", (*Rat).Mul, arg) + + arg = ratBinArg{test.y, test.x, test.prod} + testRatBin(t, i, "Mul symmetric", (*Rat).Mul, arg) + + if test.x != "0" { + arg = ratBinArg{test.prod, test.x, test.y} + testRatBin(t, i, "Quo", (*Rat).Quo, arg) + } + + if test.y != "0" { + arg = ratBinArg{test.prod, test.y, test.x} + testRatBin(t, i, "Quo symmetric", (*Rat).Quo, arg) + } + } +} + +func TestIssue820(t *testing.T) { + x := NewRat(3, 1) + y := NewRat(2, 1) + z := y.Quo(x, y) + q := NewRat(3, 2) + if z.Cmp(q) != 0 { + t.Errorf("got %s want %s", z, q) + } + + y = NewRat(3, 1) + x = NewRat(2, 1) + z = y.Quo(x, y) + q = NewRat(2, 3) + if z.Cmp(q) != 0 { + t.Errorf("got %s want %s", z, q) + } + + x = NewRat(3, 1) + z = x.Quo(x, x) + q = NewRat(3, 3) + if z.Cmp(q) != 0 { + t.Errorf("got %s want %s", z, q) + } +} + +var setFrac64Tests = []struct { + a, b int64 + out string +}{ + {0, 1, "0"}, + {0, -1, "0"}, + {1, 1, "1"}, + {-1, 1, "-1"}, + {1, -1, "-1"}, + {-1, -1, "1"}, + {-9223372036854775808, -9223372036854775808, "1"}, +} + +func TestRatSetFrac64Rat(t *testing.T) { + for i, test := range setFrac64Tests { + x := new(Rat).SetFrac64(test.a, test.b) + if x.RatString() != test.out { + t.Errorf("#%d got %s want %s", i, x.RatString(), test.out) + } + } +} + +func TestRatGobEncoding(t *testing.T) { + var medium bytes.Buffer + enc := gob.NewEncoder(&medium) + dec := gob.NewDecoder(&medium) + for _, test := range encodingTests { + medium.Reset() // empty buffer for each test case (in case of failures) + var tx Rat + tx.SetString(test + ".14159265") + if err := enc.Encode(&tx); err != nil { + t.Errorf("encoding of %s failed: %s", &tx, err) + } + var rx Rat + if err := dec.Decode(&rx); err != nil { + t.Errorf("decoding of %s failed: %s", &tx, err) + } + if rx.Cmp(&tx) != 0 { + t.Errorf("transmission of %s failed: got %s want %s", &tx, &rx, &tx) + } + } +} + +// Sending a nil Rat pointer (inside a slice) on a round trip through gob should yield a zero. +// TODO: top-level nils. +func TestGobEncodingNilRatInSlice(t *testing.T) { + buf := new(bytes.Buffer) + enc := gob.NewEncoder(buf) + dec := gob.NewDecoder(buf) + + var in = make([]*Rat, 1) + err := enc.Encode(&in) + if err != nil { + t.Errorf("gob encode failed: %q", err) + } + var out []*Rat + err = dec.Decode(&out) + if err != nil { + t.Fatalf("gob decode failed: %q", err) + } + if len(out) != 1 { + t.Fatalf("wrong len; want 1 got %d", len(out)) + } + var zero Rat + if out[0].Cmp(&zero) != 0 { + t.Errorf("transmission of (*Int)(nill) failed: got %s want 0", out) + } +} + +var ratNums = []string{ + "-141592653589793238462643383279502884197169399375105820974944592307816406286", + "-1415926535897932384626433832795028841971", + "-141592653589793", + "-1", + "0", + "1", + "141592653589793", + "1415926535897932384626433832795028841971", + "141592653589793238462643383279502884197169399375105820974944592307816406286", +} + +var ratDenoms = []string{ + "1", + "718281828459045", + "7182818284590452353602874713526624977572", + "718281828459045235360287471352662497757247093699959574966967627724076630353", +} + +func TestRatJSONEncoding(t *testing.T) { + for _, num := range ratNums { + for _, denom := range ratDenoms { + var tx Rat + tx.SetString(num + "/" + denom) + b, err := json.Marshal(&tx) + if err != nil { + t.Errorf("marshaling of %s failed: %s", &tx, err) + continue + } + var rx Rat + if err := json.Unmarshal(b, &rx); err != nil { + t.Errorf("unmarshaling of %s failed: %s", &tx, err) + continue + } + if rx.Cmp(&tx) != 0 { + t.Errorf("JSON encoding of %s failed: got %s want %s", &tx, &rx, &tx) + } + } + } +} + +func TestRatXMLEncoding(t *testing.T) { + for _, num := range ratNums { + for _, denom := range ratDenoms { + var tx Rat + tx.SetString(num + "/" + denom) + b, err := xml.Marshal(&tx) + if err != nil { + t.Errorf("marshaling of %s failed: %s", &tx, err) + continue + } + var rx Rat + if err := xml.Unmarshal(b, &rx); err != nil { + t.Errorf("unmarshaling of %s failed: %s", &tx, err) + continue + } + if rx.Cmp(&tx) != 0 { + t.Errorf("XML encoding of %s failed: got %s want %s", &tx, &rx, &tx) + } + } + } +} + +func TestIssue2379(t *testing.T) { + // 1) no aliasing + q := NewRat(3, 2) + x := new(Rat) + x.SetFrac(NewInt(3), NewInt(2)) + if x.Cmp(q) != 0 { + t.Errorf("1) got %s want %s", x, q) + } + + // 2) aliasing of numerator + x = NewRat(2, 3) + x.SetFrac(NewInt(3), x.Num()) + if x.Cmp(q) != 0 { + t.Errorf("2) got %s want %s", x, q) + } + + // 3) aliasing of denominator + x = NewRat(2, 3) + x.SetFrac(x.Denom(), NewInt(2)) + if x.Cmp(q) != 0 { + t.Errorf("3) got %s want %s", x, q) + } + + // 4) aliasing of numerator and denominator + x = NewRat(2, 3) + x.SetFrac(x.Denom(), x.Num()) + if x.Cmp(q) != 0 { + t.Errorf("4) got %s want %s", x, q) + } + + // 5) numerator and denominator are the same + q = NewRat(1, 1) + x = new(Rat) + n := NewInt(7) + x.SetFrac(n, n) + if x.Cmp(q) != 0 { + t.Errorf("5) got %s want %s", x, q) + } +} + +func TestIssue3521(t *testing.T) { + a := new(Int) + b := new(Int) + a.SetString("64375784358435883458348587", 0) + b.SetString("4789759874531", 0) + + // 0) a raw zero value has 1 as denominator + zero := new(Rat) + one := NewInt(1) + if zero.Denom().Cmp(one) != 0 { + t.Errorf("0) got %s want %s", zero.Denom(), one) + } + + // 1a) a zero value remains zero independent of denominator + x := new(Rat) + x.Denom().Set(new(Int).Neg(b)) + if x.Cmp(zero) != 0 { + t.Errorf("1a) got %s want %s", x, zero) + } + + // 1b) a zero value may have a denominator != 0 and != 1 + x.Num().Set(a) + qab := new(Rat).SetFrac(a, b) + if x.Cmp(qab) != 0 { + t.Errorf("1b) got %s want %s", x, qab) + } + + // 2a) an integral value becomes a fraction depending on denominator + x.SetFrac64(10, 2) + x.Denom().SetInt64(3) + q53 := NewRat(5, 3) + if x.Cmp(q53) != 0 { + t.Errorf("2a) got %s want %s", x, q53) + } + + // 2b) an integral value becomes a fraction depending on denominator + x = NewRat(10, 2) + x.Denom().SetInt64(3) + if x.Cmp(q53) != 0 { + t.Errorf("2b) got %s want %s", x, q53) + } + + // 3) changing the numerator/denominator of a Rat changes the Rat + x.SetFrac(a, b) + a = x.Num() + b = x.Denom() + a.SetInt64(5) + b.SetInt64(3) + if x.Cmp(q53) != 0 { + t.Errorf("3) got %s want %s", x, q53) + } +} + +func TestFloat32Distribution(t *testing.T) { + // Generate a distribution of (sign, mantissa, exp) values + // broader than the float32 range, and check Rat.Float32() + // always picks the closest float32 approximation. + var add = []int64{ + 0, + 1, + 3, + 5, + 7, + 9, + 11, + } + var winc, einc = uint64(1), 1 // soak test (~1.5s on x86-64) + if testing.Short() { + winc, einc = 5, 15 // quick test (~60ms on x86-64) + } + + for _, sign := range "+-" { + for _, a := range add { + for wid := uint64(0); wid < 30; wid += winc { + b := 1< 0 { + num.Lsh(num, uint(exp)) + } else { + den.Lsh(den, uint(-exp)) + } + r := new(Rat).SetFrac(num, den) + f, _ := r.Float32() + + if !checkIsBestApprox32(t, f, r) { + // Append context information. + t.Errorf("(input was mantissa %#x, exp %d; f = %g (%b); f ~ %g; r = %v)", + b, exp, f, f, math.Ldexp(float64(b), exp), r) + } + + checkNonLossyRoundtrip32(t, f) + } + } + } + } +} + +func TestFloat64Distribution(t *testing.T) { + // Generate a distribution of (sign, mantissa, exp) values + // broader than the float64 range, and check Rat.Float64() + // always picks the closest float64 approximation. + var add = []int64{ + 0, + 1, + 3, + 5, + 7, + 9, + 11, + } + var winc, einc = uint64(1), 1 // soak test (~75s on x86-64) + if testing.Short() { + winc, einc = 10, 500 // quick test (~12ms on x86-64) + } + + for _, sign := range "+-" { + for _, a := range add { + for wid := uint64(0); wid < 60; wid += winc { + b := 1< 0 { + num.Lsh(num, uint(exp)) + } else { + den.Lsh(den, uint(-exp)) + } + r := new(Rat).SetFrac(num, den) + f, _ := r.Float64() + + if !checkIsBestApprox64(t, f, r) { + // Append context information. + t.Errorf("(input was mantissa %#x, exp %d; f = %g (%b); f ~ %g; r = %v)", + b, exp, f, f, math.Ldexp(float64(b), exp), r) + } + + checkNonLossyRoundtrip64(t, f) + } + } + } + } +} + +// TestSetFloat64NonFinite checks that SetFloat64 of a non-finite value +// returns nil. +func TestSetFloat64NonFinite(t *testing.T) { + for _, f := range []float64{math.NaN(), math.Inf(+1), math.Inf(-1)} { + var r Rat + if r2 := r.SetFloat64(f); r2 != nil { + t.Errorf("SetFloat64(%g) was %v, want nil", f, r2) + } + } +} + +// checkNonLossyRoundtrip32 checks that a float->Rat->float roundtrip is +// non-lossy for finite f. +func checkNonLossyRoundtrip32(t *testing.T, f float32) { + if !isFinite(float64(f)) { + return + } + r := new(Rat).SetFloat64(float64(f)) + if r == nil { + t.Errorf("Rat.SetFloat64(float64(%g) (%b)) == nil", f, f) + return + } + f2, exact := r.Float32() + if f != f2 || !exact { + t.Errorf("Rat.SetFloat64(float64(%g)).Float32() = %g (%b), %v, want %g (%b), %v; delta = %b", + f, f2, f2, exact, f, f, true, f2-f) + } +} + +// checkNonLossyRoundtrip64 checks that a float->Rat->float roundtrip is +// non-lossy for finite f. +func checkNonLossyRoundtrip64(t *testing.T, f float64) { + if !isFinite(f) { + return + } + r := new(Rat).SetFloat64(f) + if r == nil { + t.Errorf("Rat.SetFloat64(%g (%b)) == nil", f, f) + return + } + f2, exact := r.Float64() + if f != f2 || !exact { + t.Errorf("Rat.SetFloat64(%g).Float64() = %g (%b), %v, want %g (%b), %v; delta = %b", + f, f2, f2, exact, f, f, true, f2-f) + } +} + +// delta returns the absolute difference between r and f. +func delta(r *Rat, f float64) *Rat { + d := new(Rat).Sub(r, new(Rat).SetFloat64(f)) + return d.Abs(d) +} + +// checkIsBestApprox32 checks that f is the best possible float32 +// approximation of r. +// Returns true on success. +func checkIsBestApprox32(t *testing.T, f float32, r *Rat) bool { + if math.Abs(float64(f)) >= math.MaxFloat32 { + // Cannot check +Inf, -Inf, nor the float next to them (MaxFloat32). + // But we have tests for these special cases. + return true + } + + // r must be strictly between f0 and f1, the floats bracketing f. + f0 := math.Nextafter32(f, float32(math.Inf(-1))) + f1 := math.Nextafter32(f, float32(math.Inf(+1))) + + // For f to be correct, r must be closer to f than to f0 or f1. + df := delta(r, float64(f)) + df0 := delta(r, float64(f0)) + df1 := delta(r, float64(f1)) + if df.Cmp(df0) > 0 { + t.Errorf("Rat(%v).Float32() = %g (%b), but previous float32 %g (%b) is closer", r, f, f, f0, f0) + return false + } + if df.Cmp(df1) > 0 { + t.Errorf("Rat(%v).Float32() = %g (%b), but next float32 %g (%b) is closer", r, f, f, f1, f1) + return false + } + if df.Cmp(df0) == 0 && !isEven32(f) { + t.Errorf("Rat(%v).Float32() = %g (%b); halfway should have rounded to %g (%b) instead", r, f, f, f0, f0) + return false + } + if df.Cmp(df1) == 0 && !isEven32(f) { + t.Errorf("Rat(%v).Float32() = %g (%b); halfway should have rounded to %g (%b) instead", r, f, f, f1, f1) + return false + } + return true +} + +// checkIsBestApprox64 checks that f is the best possible float64 +// approximation of r. +// Returns true on success. +func checkIsBestApprox64(t *testing.T, f float64, r *Rat) bool { + if math.Abs(f) >= math.MaxFloat64 { + // Cannot check +Inf, -Inf, nor the float next to them (MaxFloat64). + // But we have tests for these special cases. + return true + } + + // r must be strictly between f0 and f1, the floats bracketing f. + f0 := math.Nextafter(f, math.Inf(-1)) + f1 := math.Nextafter(f, math.Inf(+1)) + + // For f to be correct, r must be closer to f than to f0 or f1. + df := delta(r, f) + df0 := delta(r, f0) + df1 := delta(r, f1) + if df.Cmp(df0) > 0 { + t.Errorf("Rat(%v).Float64() = %g (%b), but previous float64 %g (%b) is closer", r, f, f, f0, f0) + return false + } + if df.Cmp(df1) > 0 { + t.Errorf("Rat(%v).Float64() = %g (%b), but next float64 %g (%b) is closer", r, f, f, f1, f1) + return false + } + if df.Cmp(df0) == 0 && !isEven64(f) { + t.Errorf("Rat(%v).Float64() = %g (%b); halfway should have rounded to %g (%b) instead", r, f, f, f0, f0) + return false + } + if df.Cmp(df1) == 0 && !isEven64(f) { + t.Errorf("Rat(%v).Float64() = %g (%b); halfway should have rounded to %g (%b) instead", r, f, f, f1, f1) + return false + } + return true +} + +func isEven32(f float32) bool { return math.Float32bits(f)&1 == 0 } +func isEven64(f float64) bool { return math.Float64bits(f)&1 == 0 } + +func TestIsFinite(t *testing.T) { + finites := []float64{ + 1.0 / 3, + 4891559871276714924261e+222, + math.MaxFloat64, + math.SmallestNonzeroFloat64, + -math.MaxFloat64, + -math.SmallestNonzeroFloat64, + } + for _, f := range finites { + if !isFinite(f) { + t.Errorf("!IsFinite(%g (%b))", f, f) + } + } + nonfinites := []float64{ + math.NaN(), + math.Inf(-1), + math.Inf(+1), + } + for _, f := range nonfinites { + if isFinite(f) { + t.Errorf("IsFinite(%g, (%b))", f, f) + } + } +} diff --git a/src/cmd/compile/internal/big/ratconv.go b/src/cmd/compile/internal/big/ratconv.go new file mode 100644 index 0000000000000000000000000000000000000000..778077b96ecb56a863ff05793991ef80620e8afc --- /dev/null +++ b/src/cmd/compile/internal/big/ratconv.go @@ -0,0 +1,251 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// This file implements rat-to-string conversion functions. + +package big + +import ( + "errors" + "fmt" + "io" + "strconv" + "strings" +) + +func ratTok(ch rune) bool { + return strings.IndexRune("+-/0123456789.eE", ch) >= 0 +} + +// Scan is a support routine for fmt.Scanner. It accepts the formats +// 'e', 'E', 'f', 'F', 'g', 'G', and 'v'. All formats are equivalent. +func (z *Rat) Scan(s fmt.ScanState, ch rune) error { + tok, err := s.Token(true, ratTok) + if err != nil { + return err + } + if strings.IndexRune("efgEFGv", ch) < 0 { + return errors.New("Rat.Scan: invalid verb") + } + if _, ok := z.SetString(string(tok)); !ok { + return errors.New("Rat.Scan: invalid syntax") + } + return nil +} + +// SetString sets z to the value of s and returns z and a boolean indicating +// success. s can be given as a fraction "a/b" or as a floating-point number +// optionally followed by an exponent. If the operation failed, the value of +// z is undefined but the returned value is nil. +func (z *Rat) SetString(s string) (*Rat, bool) { + if len(s) == 0 { + return nil, false + } + // len(s) > 0 + + // parse fraction a/b, if any + if sep := strings.Index(s, "/"); sep >= 0 { + if _, ok := z.a.SetString(s[:sep], 0); !ok { + return nil, false + } + s = s[sep+1:] + var err error + if z.b.abs, _, _, err = z.b.abs.scan(strings.NewReader(s), 0, false); err != nil { + return nil, false + } + if len(z.b.abs) == 0 { + return nil, false + } + return z.norm(), true + } + + // parse floating-point number + r := strings.NewReader(s) + + // sign + neg, err := scanSign(r) + if err != nil { + return nil, false + } + + // mantissa + var ecorr int + z.a.abs, _, ecorr, err = z.a.abs.scan(r, 10, true) + if err != nil { + return nil, false + } + + // exponent + var exp int64 + exp, _, err = scanExponent(r, false) + if err != nil { + return nil, false + } + + // there should be no unread characters left + if _, err = r.ReadByte(); err != io.EOF { + return nil, false + } + + // correct exponent + if ecorr < 0 { + exp += int64(ecorr) + } + + // compute exponent power + expabs := exp + if expabs < 0 { + expabs = -expabs + } + powTen := nat(nil).expNN(natTen, nat(nil).setWord(Word(expabs)), nil) + + // complete fraction + if exp < 0 { + z.b.abs = powTen + z.norm() + } else { + z.a.abs = z.a.abs.mul(z.a.abs, powTen) + z.b.abs = z.b.abs[:0] + } + + z.a.neg = neg && len(z.a.abs) > 0 // 0 has no sign + + return z, true +} + +// scanExponent scans the longest possible prefix of r representing a decimal +// ('e', 'E') or binary ('p') exponent, if any. It returns the exponent, the +// exponent base (10 or 2), or a read or syntax error, if any. +// +// exponent = ( "E" | "e" | "p" ) [ sign ] digits . +// sign = "+" | "-" . +// digits = digit { digit } . +// digit = "0" ... "9" . +// +// A binary exponent is only permitted if binExpOk is set. +func scanExponent(r io.ByteScanner, binExpOk bool) (exp int64, base int, err error) { + base = 10 + + var ch byte + if ch, err = r.ReadByte(); err != nil { + if err == io.EOF { + err = nil // no exponent; same as e0 + } + return + } + + switch ch { + case 'e', 'E': + // ok + case 'p': + if binExpOk { + base = 2 + break // ok + } + fallthrough // binary exponent not permitted + default: + r.UnreadByte() + return // no exponent; same as e0 + } + + var neg bool + if neg, err = scanSign(r); err != nil { + return + } + + var digits []byte + if neg { + digits = append(digits, '-') + } + + // no need to use nat.scan for exponent digits + // since we only care about int64 values - the + // from-scratch scan is easy enough and faster + for i := 0; ; i++ { + if ch, err = r.ReadByte(); err != nil { + if err != io.EOF || i == 0 { + return + } + err = nil + break // i > 0 + } + if ch < '0' || '9' < ch { + if i == 0 { + r.UnreadByte() + err = fmt.Errorf("invalid exponent (missing digits)") + return + } + break // i > 0 + } + digits = append(digits, byte(ch)) + } + // i > 0 => we have at least one digit + + exp, err = strconv.ParseInt(string(digits), 10, 64) + return +} + +// String returns a string representation of x in the form "a/b" (even if b == 1). +func (x *Rat) String() string { + s := "/1" + if len(x.b.abs) != 0 { + s = "/" + x.b.abs.decimalString() + } + return x.a.String() + s +} + +// RatString returns a string representation of x in the form "a/b" if b != 1, +// and in the form "a" if b == 1. +func (x *Rat) RatString() string { + if x.IsInt() { + return x.a.String() + } + return x.String() +} + +// FloatString returns a string representation of x in decimal form with prec +// digits of precision after the decimal point and the last digit rounded. +func (x *Rat) FloatString(prec int) string { + if x.IsInt() { + s := x.a.String() + if prec > 0 { + s += "." + strings.Repeat("0", prec) + } + return s + } + // x.b.abs != 0 + + q, r := nat(nil).div(nat(nil), x.a.abs, x.b.abs) + + p := natOne + if prec > 0 { + p = nat(nil).expNN(natTen, nat(nil).setUint64(uint64(prec)), nil) + } + + r = r.mul(r, p) + r, r2 := r.div(nat(nil), r, x.b.abs) + + // see if we need to round up + r2 = r2.add(r2, r2) + if x.b.abs.cmp(r2) <= 0 { + r = r.add(r, natOne) + if r.cmp(p) >= 0 { + q = nat(nil).add(q, natOne) + r = nat(nil).sub(r, p) + } + } + + s := q.decimalString() + if x.a.neg { + s = "-" + s + } + + if prec > 0 { + rs := r.decimalString() + leadingZeros := prec - len(rs) + s += "." + strings.Repeat("0", leadingZeros) + rs + } + + return s +} diff --git a/src/cmd/compile/internal/big/ratconv_test.go b/src/cmd/compile/internal/big/ratconv_test.go new file mode 100644 index 0000000000000000000000000000000000000000..16b3a1941810e2dcb5dc6d555bb5253e9d51953c --- /dev/null +++ b/src/cmd/compile/internal/big/ratconv_test.go @@ -0,0 +1,451 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package big + +import ( + "bytes" + "fmt" + "math" + "strconv" + "strings" + "testing" +) + +type StringTest struct { + in, out string + ok bool +} + +var setStringTests = []StringTest{ + {"0", "0", true}, + {"-0", "0", true}, + {"1", "1", true}, + {"-1", "-1", true}, + {"1.", "1", true}, + {"1e0", "1", true}, + {"1.e1", "10", true}, + {in: "1e"}, + {in: "1.e"}, + {in: "1e+14e-5"}, + {in: "1e4.5"}, + {in: "r"}, + {in: "a/b"}, + {in: "a.b"}, + {"-0.1", "-1/10", true}, + {"-.1", "-1/10", true}, + {"2/4", "1/2", true}, + {".25", "1/4", true}, + {"-1/5", "-1/5", true}, + {"8129567.7690E14", "812956776900000000000", true}, + {"78189e+4", "781890000", true}, + {"553019.8935e+8", "55301989350000", true}, + {"98765432109876543210987654321e-10", "98765432109876543210987654321/10000000000", true}, + {"9877861857500000E-7", "3951144743/4", true}, + {"2169378.417e-3", "2169378417/1000000", true}, + {"884243222337379604041632732738665534", "884243222337379604041632732738665534", true}, + {"53/70893980658822810696", "53/70893980658822810696", true}, + {"106/141787961317645621392", "53/70893980658822810696", true}, + {"204211327800791583.81095", "4084226556015831676219/20000", true}, + {in: "1/0"}, +} + +// These are not supported by fmt.Fscanf. +var setStringTests2 = []StringTest{ + {"0x10", "16", true}, + {"-010/1", "-8", true}, // TODO(gri) should we even permit octal here? + {"-010.", "-10", true}, + {"0x10/0x20", "1/2", true}, + {"0b1000/3", "8/3", true}, + // TODO(gri) add more tests +} + +func TestRatSetString(t *testing.T) { + var tests []StringTest + tests = append(tests, setStringTests...) + tests = append(tests, setStringTests2...) + + for i, test := range tests { + x, ok := new(Rat).SetString(test.in) + + if ok { + if !test.ok { + t.Errorf("#%d SetString(%q) expected failure", i, test.in) + } else if x.RatString() != test.out { + t.Errorf("#%d SetString(%q) got %s want %s", i, test.in, x.RatString(), test.out) + } + } else if x != nil { + t.Errorf("#%d SetString(%q) got %p want nil", i, test.in, x) + } + } +} + +func TestRatScan(t *testing.T) { + var buf bytes.Buffer + for i, test := range setStringTests { + x := new(Rat) + buf.Reset() + buf.WriteString(test.in) + + _, err := fmt.Fscanf(&buf, "%v", x) + if err == nil != test.ok { + if test.ok { + t.Errorf("#%d (%s) error: %s", i, test.in, err) + } else { + t.Errorf("#%d (%s) expected error", i, test.in) + } + continue + } + if err == nil && x.RatString() != test.out { + t.Errorf("#%d got %s want %s", i, x.RatString(), test.out) + } + } +} + +var floatStringTests = []struct { + in string + prec int + out string +}{ + {"0", 0, "0"}, + {"0", 4, "0.0000"}, + {"1", 0, "1"}, + {"1", 2, "1.00"}, + {"-1", 0, "-1"}, + {".25", 2, "0.25"}, + {".25", 1, "0.3"}, + {".25", 3, "0.250"}, + {"-1/3", 3, "-0.333"}, + {"-2/3", 4, "-0.6667"}, + {"0.96", 1, "1.0"}, + {"0.999", 2, "1.00"}, + {"0.9", 0, "1"}, + {".25", -1, "0"}, + {".55", -1, "1"}, +} + +func TestFloatString(t *testing.T) { + for i, test := range floatStringTests { + x, _ := new(Rat).SetString(test.in) + + if x.FloatString(test.prec) != test.out { + t.Errorf("#%d got %s want %s", i, x.FloatString(test.prec), test.out) + } + } +} + +// Test inputs to Rat.SetString. The prefix "long:" causes the test +// to be skipped in --test.short mode. (The threshold is about 500us.) +var float64inputs = []string{ + // Constants plundered from strconv/testfp.txt. + + // Table 1: Stress Inputs for Conversion to 53-bit Binary, < 1/2 ULP + "5e+125", + "69e+267", + "999e-026", + "7861e-034", + "75569e-254", + "928609e-261", + "9210917e+080", + "84863171e+114", + "653777767e+273", + "5232604057e-298", + "27235667517e-109", + "653532977297e-123", + "3142213164987e-294", + "46202199371337e-072", + "231010996856685e-073", + "9324754620109615e+212", + "78459735791271921e+049", + "272104041512242479e+200", + "6802601037806061975e+198", + "20505426358836677347e-221", + "836168422905420598437e-234", + "4891559871276714924261e+222", + + // Table 2: Stress Inputs for Conversion to 53-bit Binary, > 1/2 ULP + "9e-265", + "85e-037", + "623e+100", + "3571e+263", + "81661e+153", + "920657e-023", + "4603285e-024", + "87575437e-309", + "245540327e+122", + "6138508175e+120", + "83356057653e+193", + "619534293513e+124", + "2335141086879e+218", + "36167929443327e-159", + "609610927149051e-255", + "3743626360493413e-165", + "94080055902682397e-242", + "899810892172646163e+283", + "7120190517612959703e+120", + "25188282901709339043e-252", + "308984926168550152811e-052", + "6372891218502368041059e+064", + + // Table 14: Stress Inputs for Conversion to 24-bit Binary, <1/2 ULP + "5e-20", + "67e+14", + "985e+15", + "7693e-42", + "55895e-16", + "996622e-44", + "7038531e-32", + "60419369e-46", + "702990899e-20", + "6930161142e-48", + "25933168707e+13", + "596428896559e+20", + + // Table 15: Stress Inputs for Conversion to 24-bit Binary, >1/2 ULP + "3e-23", + "57e+18", + "789e-35", + "2539e-18", + "76173e+28", + "887745e-11", + "5382571e-37", + "82381273e-35", + "750486563e-38", + "3752432815e-39", + "75224575729e-45", + "459926601011e+15", + + // Constants plundered from strconv/atof_test.go. + + "0", + "1", + "+1", + "1e23", + "1E23", + "100000000000000000000000", + "1e-100", + "123456700", + "99999999999999974834176", + "100000000000000000000001", + "100000000000000008388608", + "100000000000000016777215", + "100000000000000016777216", + "-1", + "-0.1", + "-0", // NB: exception made for this input + "1e-20", + "625e-3", + + // largest float64 + "1.7976931348623157e308", + "-1.7976931348623157e308", + // next float64 - too large + "1.7976931348623159e308", + "-1.7976931348623159e308", + // the border is ...158079 + // borderline - okay + "1.7976931348623158e308", + "-1.7976931348623158e308", + // borderline - too large + "1.797693134862315808e308", + "-1.797693134862315808e308", + + // a little too large + "1e308", + "2e308", + "1e309", + + // way too large + "1e310", + "-1e310", + "1e400", + "-1e400", + "long:1e400000", + "long:-1e400000", + + // denormalized + "1e-305", + "1e-306", + "1e-307", + "1e-308", + "1e-309", + "1e-310", + "1e-322", + // smallest denormal + "5e-324", + "4e-324", + "3e-324", + // too small + "2e-324", + // way too small + "1e-350", + "long:1e-400000", + // way too small, negative + "-1e-350", + "long:-1e-400000", + + // try to overflow exponent + // [Disabled: too slow and memory-hungry with rationals.] + // "1e-4294967296", + // "1e+4294967296", + // "1e-18446744073709551616", + // "1e+18446744073709551616", + + // http://www.exploringbinary.com/java-hangs-when-converting-2-2250738585072012e-308/ + "2.2250738585072012e-308", + // http://www.exploringbinary.com/php-hangs-on-numeric-value-2-2250738585072011e-308/ + "2.2250738585072011e-308", + + // A very large number (initially wrongly parsed by the fast algorithm). + "4.630813248087435e+307", + + // A different kind of very large number. + "22.222222222222222", + "long:2." + strings.Repeat("2", 4000) + "e+1", + + // Exactly halfway between 1 and math.Nextafter(1, 2). + // Round to even (down). + "1.00000000000000011102230246251565404236316680908203125", + // Slightly lower; still round down. + "1.00000000000000011102230246251565404236316680908203124", + // Slightly higher; round up. + "1.00000000000000011102230246251565404236316680908203126", + // Slightly higher, but you have to read all the way to the end. + "long:1.00000000000000011102230246251565404236316680908203125" + strings.Repeat("0", 10000) + "1", + + // Smallest denormal, 2^(-1022-52) + "4.940656458412465441765687928682213723651e-324", + // Half of smallest denormal, 2^(-1022-53) + "2.470328229206232720882843964341106861825e-324", + // A little more than the exact half of smallest denormal + // 2^-1075 + 2^-1100. (Rounds to 1p-1074.) + "2.470328302827751011111470718709768633275e-324", + // The exact halfway between smallest normal and largest denormal: + // 2^-1022 - 2^-1075. (Rounds to 2^-1022.) + "2.225073858507201136057409796709131975935e-308", + + "1152921504606846975", // 1<<60 - 1 + "-1152921504606846975", // -(1<<60 - 1) + "1152921504606846977", // 1<<60 + 1 + "-1152921504606846977", // -(1<<60 + 1) + + "1/3", +} + +// isFinite reports whether f represents a finite rational value. +// It is equivalent to !math.IsNan(f) && !math.IsInf(f, 0). +func isFinite(f float64) bool { + return math.Abs(f) <= math.MaxFloat64 +} + +func TestFloat32SpecialCases(t *testing.T) { + for _, input := range float64inputs { + if strings.HasPrefix(input, "long:") { + if testing.Short() { + continue + } + input = input[len("long:"):] + } + + r, ok := new(Rat).SetString(input) + if !ok { + t.Errorf("Rat.SetString(%q) failed", input) + continue + } + f, exact := r.Float32() + + // 1. Check string -> Rat -> float32 conversions are + // consistent with strconv.ParseFloat. + // Skip this check if the input uses "a/b" rational syntax. + if !strings.Contains(input, "/") { + e64, _ := strconv.ParseFloat(input, 32) + e := float32(e64) + + // Careful: negative Rats too small for + // float64 become -0, but Rat obviously cannot + // preserve the sign from SetString("-0"). + switch { + case math.Float32bits(e) == math.Float32bits(f): + // Ok: bitwise equal. + case f == 0 && r.Num().BitLen() == 0: + // Ok: Rat(0) is equivalent to both +/- float64(0). + default: + t.Errorf("strconv.ParseFloat(%q) = %g (%b), want %g (%b); delta = %g", input, e, e, f, f, f-e) + } + } + + if !isFinite(float64(f)) { + continue + } + + // 2. Check f is best approximation to r. + if !checkIsBestApprox32(t, f, r) { + // Append context information. + t.Errorf("(input was %q)", input) + } + + // 3. Check f->R->f roundtrip is non-lossy. + checkNonLossyRoundtrip32(t, f) + + // 4. Check exactness using slow algorithm. + if wasExact := new(Rat).SetFloat64(float64(f)).Cmp(r) == 0; wasExact != exact { + t.Errorf("Rat.SetString(%q).Float32().exact = %t, want %t", input, exact, wasExact) + } + } +} + +func TestFloat64SpecialCases(t *testing.T) { + for _, input := range float64inputs { + if strings.HasPrefix(input, "long:") { + if testing.Short() { + continue + } + input = input[len("long:"):] + } + + r, ok := new(Rat).SetString(input) + if !ok { + t.Errorf("Rat.SetString(%q) failed", input) + continue + } + f, exact := r.Float64() + + // 1. Check string -> Rat -> float64 conversions are + // consistent with strconv.ParseFloat. + // Skip this check if the input uses "a/b" rational syntax. + if !strings.Contains(input, "/") { + e, _ := strconv.ParseFloat(input, 64) + + // Careful: negative Rats too small for + // float64 become -0, but Rat obviously cannot + // preserve the sign from SetString("-0"). + switch { + case math.Float64bits(e) == math.Float64bits(f): + // Ok: bitwise equal. + case f == 0 && r.Num().BitLen() == 0: + // Ok: Rat(0) is equivalent to both +/- float64(0). + default: + t.Errorf("strconv.ParseFloat(%q) = %g (%b), want %g (%b); delta = %g", input, e, e, f, f, f-e) + } + } + + if !isFinite(f) { + continue + } + + // 2. Check f is best approximation to r. + if !checkIsBestApprox64(t, f, r) { + // Append context information. + t.Errorf("(input was %q)", input) + } + + // 3. Check f->R->f roundtrip is non-lossy. + checkNonLossyRoundtrip64(t, f) + + // 4. Check exactness using slow algorithm. + if wasExact := new(Rat).SetFloat64(f).Cmp(r) == 0; wasExact != exact { + t.Errorf("Rat.SetString(%q).Float64().exact = %t, want %t", input, exact, wasExact) + } + } +} diff --git a/src/cmd/compile/internal/big/roundingmode_string.go b/src/cmd/compile/internal/big/roundingmode_string.go new file mode 100644 index 0000000000000000000000000000000000000000..05024b806562e503089cde1cc64c5f6438454082 --- /dev/null +++ b/src/cmd/compile/internal/big/roundingmode_string.go @@ -0,0 +1,16 @@ +// generated by stringer -type=RoundingMode; DO NOT EDIT + +package big + +import "fmt" + +const _RoundingMode_name = "ToNearestEvenToNearestAwayToZeroAwayFromZeroToNegativeInfToPositiveInf" + +var _RoundingMode_index = [...]uint8{0, 13, 26, 32, 44, 57, 70} + +func (i RoundingMode) String() string { + if i+1 >= RoundingMode(len(_RoundingMode_index)) { + return fmt.Sprintf("RoundingMode(%d)", i) + } + return _RoundingMode_name[_RoundingMode_index[i]:_RoundingMode_index[i+1]] +} diff --git a/src/cmd/compile/internal/big/vendor.bash b/src/cmd/compile/internal/big/vendor.bash new file mode 100755 index 0000000000000000000000000000000000000000..1b191ccb8fca1e59752584e2284d06127b2fac88 --- /dev/null +++ b/src/cmd/compile/internal/big/vendor.bash @@ -0,0 +1,31 @@ +#!/usr/bin/env bash + +# Copyright 2015 The Go Authors. All rights reserved. +# Use of this source code is governed by a BSD-style +# license that can be found in the LICENSE file. + +# Run this script to obtain an up-to-date vendored version of math/big. + +BIGDIR=../../../../math/big + +# Start from scratch. +rm *.go + +# We don't want any assembly files. +cp $BIGDIR/*.go . + +# Use pure Go arith ops w/o build tag. +sed 's|^// \+build math_big_pure_go$||' arith_decl_pure.go > arith_decl.go +rm arith_decl_pure.go + +# Import vendored math/big in external tests (e.g., floatexample_test.go). +for f in *_test.go; do + sed 's|"math/big"|"cmd/compile/internal/big"|' $f > foo.go + mv foo.go $f +done + +# gofmt to clean up after sed +gofmt -w . + +# Test that it works +go test -short diff --git a/src/cmd/compile/internal/gc/align.go b/src/cmd/compile/internal/gc/align.go new file mode 100644 index 0000000000000000000000000000000000000000..60c59fc32ba11f4fc014d4113c41e0c69dded55a --- /dev/null +++ b/src/cmd/compile/internal/gc/align.go @@ -0,0 +1,713 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package gc + +import "cmd/internal/obj" + +/* + * machine size and rounding + * alignment is dictated around + * the size of a pointer, set in betypeinit + * (see ../6g/galign.c). + */ +var defercalc int + +func Rnd(o int64, r int64) int64 { + if r < 1 || r > 8 || r&(r-1) != 0 { + Fatal("rnd %d", r) + } + return (o + r - 1) &^ (r - 1) +} + +func offmod(t *Type) { + o := int32(0) + for f := t.Type; f != nil; f = f.Down { + if f.Etype != TFIELD { + Fatal("offmod: not TFIELD: %v", Tconv(f, obj.FmtLong)) + } + f.Width = int64(o) + o += int32(Widthptr) + if int64(o) >= Thearch.MAXWIDTH { + Yyerror("interface too large") + o = int32(Widthptr) + } + } +} + +func widstruct(errtype *Type, t *Type, o int64, flag int) int64 { + starto := o + maxalign := int32(flag) + if maxalign < 1 { + maxalign = 1 + } + lastzero := int64(0) + var w int64 + for f := t.Type; f != nil; f = f.Down { + if f.Etype != TFIELD { + Fatal("widstruct: not TFIELD: %v", Tconv(f, obj.FmtLong)) + } + if f.Type == nil { + // broken field, just skip it so that other valid fields + // get a width. + continue + } + + dowidth(f.Type) + if int32(f.Type.Align) > maxalign { + maxalign = int32(f.Type.Align) + } + if f.Type.Width < 0 { + Fatal("invalid width %d", f.Type.Width) + } + w = f.Type.Width + if f.Type.Align > 0 { + o = Rnd(o, int64(f.Type.Align)) + } + f.Width = o // really offset for TFIELD + if f.Nname != nil { + // this same stackparam logic is in addrescapes + // in typecheck.c. usually addrescapes runs after + // widstruct, in which case we could drop this, + // but function closure functions are the exception. + if f.Nname.Name.Param.Stackparam != nil { + f.Nname.Name.Param.Stackparam.Xoffset = o + f.Nname.Xoffset = 0 + } else { + f.Nname.Xoffset = o + } + } + + if w == 0 { + lastzero = o + } + o += w + if o >= Thearch.MAXWIDTH { + Yyerror("type %v too large", Tconv(errtype, obj.FmtLong)) + o = 8 // small but nonzero + } + } + + // For nonzero-sized structs which end in a zero-sized thing, we add + // an extra byte of padding to the type. This padding ensures that + // taking the address of the zero-sized thing can't manufacture a + // pointer to the next object in the heap. See issue 9401. + if flag == 1 && o > starto && o == lastzero { + o++ + } + + // final width is rounded + if flag != 0 { + o = Rnd(o, int64(maxalign)) + } + t.Align = uint8(maxalign) + + // type width only includes back to first field's offset + t.Width = o - starto + + return o +} + +func dowidth(t *Type) { + if Widthptr == 0 { + Fatal("dowidth without betypeinit") + } + + if t == nil { + return + } + + if t.Width > 0 { + if t.Align == 0 { + // See issue 11354 + Fatal("zero alignment with nonzero size %v", t) + } + return + } + + if t.Width == -2 { + lno := int(lineno) + lineno = int32(t.Lineno) + if t.Broke == 0 { + t.Broke = 1 + Yyerror("invalid recursive type %v", t) + } + + t.Width = 0 + lineno = int32(lno) + return + } + + // break infinite recursion if the broken recursive type + // is referenced again + if t.Broke != 0 && t.Width == 0 { + return + } + + // defer checkwidth calls until after we're done + defercalc++ + + lno := int(lineno) + lineno = int32(t.Lineno) + t.Width = -2 + t.Align = 0 + + et := int32(t.Etype) + switch et { + case TFUNC, TCHAN, TMAP, TSTRING: + break + + /* simtype == 0 during bootstrap */ + default: + if Simtype[t.Etype] != 0 { + et = int32(Simtype[t.Etype]) + } + } + + w := int64(0) + switch et { + default: + Fatal("dowidth: unknown type: %v", t) + + /* compiler-specific stuff */ + case TINT8, TUINT8, TBOOL: + // bool is int8 + w = 1 + + case TINT16, TUINT16: + w = 2 + + case TINT32, TUINT32, TFLOAT32: + w = 4 + + case TINT64, TUINT64, TFLOAT64, TCOMPLEX64: + w = 8 + t.Align = uint8(Widthreg) + + case TCOMPLEX128: + w = 16 + t.Align = uint8(Widthreg) + + case TPTR32: + w = 4 + checkwidth(t.Type) + + case TPTR64: + w = 8 + checkwidth(t.Type) + + case TUNSAFEPTR: + w = int64(Widthptr) + + case TINTER: // implemented as 2 pointers + w = 2 * int64(Widthptr) + + t.Align = uint8(Widthptr) + offmod(t) + + case TCHAN: // implemented as pointer + w = int64(Widthptr) + + checkwidth(t.Type) + + // make fake type to check later to + // trigger channel argument check. + t1 := typ(TCHANARGS) + + t1.Type = t + checkwidth(t1) + + case TCHANARGS: + t1 := t.Type + dowidth(t.Type) // just in case + if t1.Type.Width >= 1<<16 { + Yyerror("channel element type too large (>64kB)") + } + t.Width = 1 + + case TMAP: // implemented as pointer + w = int64(Widthptr) + + checkwidth(t.Type) + checkwidth(t.Down) + + case TFORW: // should have been filled in + if t.Broke == 0 { + Yyerror("invalid recursive type %v", t) + } + w = 1 // anything will do + + // dummy type; should be replaced before use. + case TANY: + if Debug['A'] == 0 { + Fatal("dowidth any") + } + w = 1 // anything will do + + case TSTRING: + if sizeof_String == 0 { + Fatal("early dowidth string") + } + w = int64(sizeof_String) + t.Align = uint8(Widthptr) + + case TARRAY: + if t.Type == nil { + break + } + if t.Bound >= 0 { + dowidth(t.Type) + if t.Type.Width != 0 { + cap := (uint64(Thearch.MAXWIDTH) - 1) / uint64(t.Type.Width) + if uint64(t.Bound) > cap { + Yyerror("type %v larger than address space", Tconv(t, obj.FmtLong)) + } + } + + w = t.Bound * t.Type.Width + t.Align = t.Type.Align + } else if t.Bound == -1 { + w = int64(sizeof_Array) + checkwidth(t.Type) + t.Align = uint8(Widthptr) + } else if t.Bound == -100 { + if t.Broke == 0 { + Yyerror("use of [...] array outside of array literal") + t.Broke = 1 + } + } else { + Fatal("dowidth %v", t) // probably [...]T + } + + case TSTRUCT: + if t.Funarg != 0 { + Fatal("dowidth fn struct %v", t) + } + w = widstruct(t, t, 0, 1) + + // make fake type to check later to + // trigger function argument computation. + case TFUNC: + t1 := typ(TFUNCARGS) + + t1.Type = t + checkwidth(t1) + + // width of func type is pointer + w = int64(Widthptr) + + // function is 3 cated structures; + // compute their widths as side-effect. + case TFUNCARGS: + t1 := t.Type + + w = widstruct(t.Type, *getthis(t1), 0, 0) + w = widstruct(t.Type, *getinarg(t1), w, Widthreg) + w = widstruct(t.Type, *Getoutarg(t1), w, Widthreg) + t1.Argwid = w + if w%int64(Widthreg) != 0 { + Warn("bad type %v %d\n", t1, w) + } + t.Align = 1 + } + + if Widthptr == 4 && w != int64(int32(w)) { + Yyerror("type %v too large", t) + } + + t.Width = w + if t.Align == 0 { + if w > 8 || w&(w-1) != 0 { + Fatal("invalid alignment for %v", t) + } + t.Align = uint8(w) + } + + lineno = int32(lno) + + if defercalc == 1 { + resumecheckwidth() + } else { + defercalc-- + } +} + +/* + * when a type's width should be known, we call checkwidth + * to compute it. during a declaration like + * + * type T *struct { next T } + * + * it is necessary to defer the calculation of the struct width + * until after T has been initialized to be a pointer to that struct. + * similarly, during import processing structs may be used + * before their definition. in those situations, calling + * defercheckwidth() stops width calculations until + * resumecheckwidth() is called, at which point all the + * checkwidths that were deferred are executed. + * dowidth should only be called when the type's size + * is needed immediately. checkwidth makes sure the + * size is evaluated eventually. + */ +type TypeList struct { + t *Type + next *TypeList +} + +var tlfree *TypeList + +var tlq *TypeList + +func checkwidth(t *Type) { + if t == nil { + return + } + + // function arg structs should not be checked + // outside of the enclosing function. + if t.Funarg != 0 { + Fatal("checkwidth %v", t) + } + + if defercalc == 0 { + dowidth(t) + return + } + + if t.Deferwidth != 0 { + return + } + t.Deferwidth = 1 + + l := tlfree + if l != nil { + tlfree = l.next + } else { + l = new(TypeList) + } + + l.t = t + l.next = tlq + tlq = l +} + +func defercheckwidth() { + // we get out of sync on syntax errors, so don't be pedantic. + if defercalc != 0 && nerrors == 0 { + Fatal("defercheckwidth") + } + defercalc = 1 +} + +func resumecheckwidth() { + if defercalc == 0 { + Fatal("resumecheckwidth") + } + for l := tlq; l != nil; l = tlq { + l.t.Deferwidth = 0 + tlq = l.next + dowidth(l.t) + l.next = tlfree + tlfree = l + } + + defercalc = 0 +} + +var itable *Type // distinguished *byte + +func typeinit() { + if Widthptr == 0 { + Fatal("typeinit before betypeinit") + } + + for i := 0; i < NTYPE; i++ { + Simtype[i] = uint8(i) + } + + Types[TPTR32] = typ(TPTR32) + dowidth(Types[TPTR32]) + + Types[TPTR64] = typ(TPTR64) + dowidth(Types[TPTR64]) + + t := typ(TUNSAFEPTR) + Types[TUNSAFEPTR] = t + t.Sym = Pkglookup("Pointer", unsafepkg) + t.Sym.Def = typenod(t) + t.Sym.Def.Name = new(Name) + + dowidth(Types[TUNSAFEPTR]) + + Tptr = TPTR32 + if Widthptr == 8 { + Tptr = TPTR64 + } + + for i := TINT8; i <= TUINT64; i++ { + Isint[i] = true + } + Isint[TINT] = true + Isint[TUINT] = true + Isint[TUINTPTR] = true + + Isfloat[TFLOAT32] = true + Isfloat[TFLOAT64] = true + + Iscomplex[TCOMPLEX64] = true + Iscomplex[TCOMPLEX128] = true + + Isptr[TPTR32] = true + Isptr[TPTR64] = true + + isforw[TFORW] = true + + Issigned[TINT] = true + Issigned[TINT8] = true + Issigned[TINT16] = true + Issigned[TINT32] = true + Issigned[TINT64] = true + + /* + * initialize okfor + */ + for i := 0; i < NTYPE; i++ { + if Isint[i] || i == TIDEAL { + okforeq[i] = true + okforcmp[i] = true + okforarith[i] = true + okforadd[i] = true + okforand[i] = true + okforconst[i] = true + issimple[i] = true + Minintval[i] = new(Mpint) + Maxintval[i] = new(Mpint) + } + + if Isfloat[i] { + okforeq[i] = true + okforcmp[i] = true + okforadd[i] = true + okforarith[i] = true + okforconst[i] = true + issimple[i] = true + minfltval[i] = newMpflt() + maxfltval[i] = newMpflt() + } + + if Iscomplex[i] { + okforeq[i] = true + okforadd[i] = true + okforarith[i] = true + okforconst[i] = true + issimple[i] = true + } + } + + issimple[TBOOL] = true + + okforadd[TSTRING] = true + + okforbool[TBOOL] = true + + okforcap[TARRAY] = true + okforcap[TCHAN] = true + + okforconst[TBOOL] = true + okforconst[TSTRING] = true + + okforlen[TARRAY] = true + okforlen[TCHAN] = true + okforlen[TMAP] = true + okforlen[TSTRING] = true + + okforeq[TPTR32] = true + okforeq[TPTR64] = true + okforeq[TUNSAFEPTR] = true + okforeq[TINTER] = true + okforeq[TCHAN] = true + okforeq[TSTRING] = true + okforeq[TBOOL] = true + okforeq[TMAP] = true // nil only; refined in typecheck + okforeq[TFUNC] = true // nil only; refined in typecheck + okforeq[TARRAY] = true // nil slice only; refined in typecheck + okforeq[TSTRUCT] = true // it's complicated; refined in typecheck + + okforcmp[TSTRING] = true + + var i int + for i = 0; i < len(okfor); i++ { + okfor[i] = okfornone[:] + } + + // binary + okfor[OADD] = okforadd[:] + + okfor[OAND] = okforand[:] + okfor[OANDAND] = okforbool[:] + okfor[OANDNOT] = okforand[:] + okfor[ODIV] = okforarith[:] + okfor[OEQ] = okforeq[:] + okfor[OGE] = okforcmp[:] + okfor[OGT] = okforcmp[:] + okfor[OLE] = okforcmp[:] + okfor[OLT] = okforcmp[:] + okfor[OMOD] = okforand[:] + okfor[OHMUL] = okforarith[:] + okfor[OMUL] = okforarith[:] + okfor[ONE] = okforeq[:] + okfor[OOR] = okforand[:] + okfor[OOROR] = okforbool[:] + okfor[OSUB] = okforarith[:] + okfor[OXOR] = okforand[:] + okfor[OLSH] = okforand[:] + okfor[ORSH] = okforand[:] + + // unary + okfor[OCOM] = okforand[:] + + okfor[OMINUS] = okforarith[:] + okfor[ONOT] = okforbool[:] + okfor[OPLUS] = okforarith[:] + + // special + okfor[OCAP] = okforcap[:] + + okfor[OLEN] = okforlen[:] + + // comparison + iscmp[OLT] = true + + iscmp[OGT] = true + iscmp[OGE] = true + iscmp[OLE] = true + iscmp[OEQ] = true + iscmp[ONE] = true + + mpatofix(Maxintval[TINT8], "0x7f") + mpatofix(Minintval[TINT8], "-0x80") + mpatofix(Maxintval[TINT16], "0x7fff") + mpatofix(Minintval[TINT16], "-0x8000") + mpatofix(Maxintval[TINT32], "0x7fffffff") + mpatofix(Minintval[TINT32], "-0x80000000") + mpatofix(Maxintval[TINT64], "0x7fffffffffffffff") + mpatofix(Minintval[TINT64], "-0x8000000000000000") + + mpatofix(Maxintval[TUINT8], "0xff") + mpatofix(Maxintval[TUINT16], "0xffff") + mpatofix(Maxintval[TUINT32], "0xffffffff") + mpatofix(Maxintval[TUINT64], "0xffffffffffffffff") + + /* f is valid float if min < f < max. (min and max are not themselves valid.) */ + mpatoflt(maxfltval[TFLOAT32], "33554431p103") /* 2^24-1 p (127-23) + 1/2 ulp*/ + mpatoflt(minfltval[TFLOAT32], "-33554431p103") + mpatoflt(maxfltval[TFLOAT64], "18014398509481983p970") /* 2^53-1 p (1023-52) + 1/2 ulp */ + mpatoflt(minfltval[TFLOAT64], "-18014398509481983p970") + + maxfltval[TCOMPLEX64] = maxfltval[TFLOAT32] + minfltval[TCOMPLEX64] = minfltval[TFLOAT32] + maxfltval[TCOMPLEX128] = maxfltval[TFLOAT64] + minfltval[TCOMPLEX128] = minfltval[TFLOAT64] + + /* for walk to use in error messages */ + Types[TFUNC] = functype(nil, nil, nil) + + /* types used in front end */ + // types[TNIL] got set early in lexinit + Types[TIDEAL] = typ(TIDEAL) + + Types[TINTER] = typ(TINTER) + + /* simple aliases */ + Simtype[TMAP] = uint8(Tptr) + + Simtype[TCHAN] = uint8(Tptr) + Simtype[TFUNC] = uint8(Tptr) + Simtype[TUNSAFEPTR] = uint8(Tptr) + + /* pick up the backend thearch.typedefs */ + var s1 *Sym + var etype int + var sameas int + var s *Sym + for i = range Thearch.Typedefs { + s = Lookup(Thearch.Typedefs[i].Name) + s1 = Pkglookup(Thearch.Typedefs[i].Name, builtinpkg) + + etype = Thearch.Typedefs[i].Etype + if etype < 0 || etype >= len(Types) { + Fatal("typeinit: %s bad etype", s.Name) + } + sameas = Thearch.Typedefs[i].Sameas + if sameas < 0 || sameas >= len(Types) { + Fatal("typeinit: %s bad sameas", s.Name) + } + Simtype[etype] = uint8(sameas) + minfltval[etype] = minfltval[sameas] + maxfltval[etype] = maxfltval[sameas] + Minintval[etype] = Minintval[sameas] + Maxintval[etype] = Maxintval[sameas] + + t = Types[etype] + if t != nil { + Fatal("typeinit: %s already defined", s.Name) + } + + t = typ(etype) + t.Sym = s1 + + dowidth(t) + Types[etype] = t + s1.Def = typenod(t) + s1.Def.Name = new(Name) + } + + Array_array = int(Rnd(0, int64(Widthptr))) + Array_nel = int(Rnd(int64(Array_array)+int64(Widthptr), int64(Widthint))) + Array_cap = int(Rnd(int64(Array_nel)+int64(Widthint), int64(Widthint))) + sizeof_Array = int(Rnd(int64(Array_cap)+int64(Widthint), int64(Widthptr))) + + // string is same as slice wo the cap + sizeof_String = int(Rnd(int64(Array_nel)+int64(Widthint), int64(Widthptr))) + + dowidth(Types[TSTRING]) + dowidth(idealstring) + + itable = typ(Tptr) + itable.Type = Types[TUINT8] +} + +/* + * compute total size of f's in/out arguments. + */ +func Argsize(t *Type) int { + var save Iter + var x int64 + + w := int64(0) + + fp := Structfirst(&save, Getoutarg(t)) + for fp != nil { + x = fp.Width + fp.Type.Width + if x > w { + w = x + } + fp = structnext(&save) + } + + fp = funcfirst(&save, t) + for fp != nil { + x = fp.Width + fp.Type.Width + if x > w { + w = x + } + fp = funcnext(&save) + } + + w = (w + int64(Widthptr) - 1) &^ (int64(Widthptr) - 1) + if int64(int(w)) != w { + Fatal("argsize too big") + } + return int(w) +} diff --git a/src/cmd/compile/internal/gc/builtin.go b/src/cmd/compile/internal/gc/builtin.go new file mode 100644 index 0000000000000000000000000000000000000000..f09dd5690f9b327f1a7801b5b3f5368560cc7b94 --- /dev/null +++ b/src/cmd/compile/internal/gc/builtin.go @@ -0,0 +1,169 @@ +// AUTO-GENERATED by mkbuiltin.go; DO NOT EDIT + +package gc + +const runtimeimport = "" + + "package runtime\n" + + "import runtime \"runtime\"\n" + + "func @\"\".newobject (@\"\".typ·2 *byte) (? *any)\n" + + "func @\"\".panicindex ()\n" + + "func @\"\".panicslice ()\n" + + "func @\"\".panicdivide ()\n" + + "func @\"\".throwreturn ()\n" + + "func @\"\".throwinit ()\n" + + "func @\"\".panicwrap (? string, ? string, ? string)\n" + + "func @\"\".gopanic (? interface {})\n" + + "func @\"\".gorecover (? *int32) (? interface {})\n" + + "func @\"\".printbool (? bool)\n" + + "func @\"\".printfloat (? float64)\n" + + "func @\"\".printint (? int64)\n" + + "func @\"\".printhex (? uint64)\n" + + "func @\"\".printuint (? uint64)\n" + + "func @\"\".printcomplex (? complex128)\n" + + "func @\"\".printstring (? string)\n" + + "func @\"\".printpointer (? any)\n" + + "func @\"\".printiface (? any)\n" + + "func @\"\".printeface (? any)\n" + + "func @\"\".printslice (? any)\n" + + "func @\"\".printnl ()\n" + + "func @\"\".printsp ()\n" + + "func @\"\".printlock ()\n" + + "func @\"\".printunlock ()\n" + + "func @\"\".concatstring2 (? *[32]byte, ? string, ? string) (? string)\n" + + "func @\"\".concatstring3 (? *[32]byte, ? string, ? string, ? string) (? string)\n" + + "func @\"\".concatstring4 (? *[32]byte, ? string, ? string, ? string, ? string) (? string)\n" + + "func @\"\".concatstring5 (? *[32]byte, ? string, ? string, ? string, ? string, ? string) (? string)\n" + + "func @\"\".concatstrings (? *[32]byte, ? []string) (? string)\n" + + "func @\"\".cmpstring (? string, ? string) (? int)\n" + + "func @\"\".eqstring (? string, ? string) (? bool)\n" + + "func @\"\".intstring (? *[4]byte, ? int64) (? string)\n" + + "func @\"\".slicebytetostring (? *[32]byte, ? []byte) (? string)\n" + + "func @\"\".slicebytetostringtmp (? []byte) (? string)\n" + + "func @\"\".slicerunetostring (? *[32]byte, ? []rune) (? string)\n" + + "func @\"\".stringtoslicebyte (? *[32]byte, ? string) (? []byte)\n" + + "func @\"\".stringtoslicebytetmp (? string) (? []byte)\n" + + "func @\"\".stringtoslicerune (? *[32]rune, ? string) (? []rune)\n" + + "func @\"\".stringiter (? string, ? int) (? int)\n" + + "func @\"\".stringiter2 (? string, ? int) (@\"\".retk·1 int, @\"\".retv·2 rune)\n" + + "func @\"\".slicecopy (@\"\".to·2 any, @\"\".fr·3 any, @\"\".wid·4 uintptr) (? int)\n" + + "func @\"\".slicestringcopy (@\"\".to·2 any, @\"\".fr·3 any) (? int)\n" + + "func @\"\".typ2Itab (@\"\".typ·2 *byte, @\"\".typ2·3 *byte, @\"\".cache·4 **byte) (@\"\".ret·1 *byte)\n" + + "func @\"\".convI2E (@\"\".elem·2 any) (@\"\".ret·1 any)\n" + + "func @\"\".convI2I (@\"\".typ·2 *byte, @\"\".elem·3 any) (@\"\".ret·1 any)\n" + + "func @\"\".convT2E (@\"\".typ·2 *byte, @\"\".elem·3 *any, @\"\".buf·4 *any) (@\"\".ret·1 any)\n" + + "func @\"\".convT2I (@\"\".typ·2 *byte, @\"\".typ2·3 *byte, @\"\".cache·4 **byte, @\"\".elem·5 *any, @\"\".buf·6 *any) (@\"\".ret·1 any)\n" + + "func @\"\".assertE2E (@\"\".typ·1 *byte, @\"\".iface·2 any, @\"\".ret·3 *any)\n" + + "func @\"\".assertE2E2 (@\"\".typ·2 *byte, @\"\".iface·3 any, @\"\".ret·4 *any) (? bool)\n" + + "func @\"\".assertE2I (@\"\".typ·1 *byte, @\"\".iface·2 any, @\"\".ret·3 *any)\n" + + "func @\"\".assertE2I2 (@\"\".typ·2 *byte, @\"\".iface·3 any, @\"\".ret·4 *any) (? bool)\n" + + "func @\"\".assertE2T (@\"\".typ·1 *byte, @\"\".iface·2 any, @\"\".ret·3 *any)\n" + + "func @\"\".assertE2T2 (@\"\".typ·2 *byte, @\"\".iface·3 any, @\"\".ret·4 *any) (? bool)\n" + + "func @\"\".assertI2E (@\"\".typ·1 *byte, @\"\".iface·2 any, @\"\".ret·3 *any)\n" + + "func @\"\".assertI2E2 (@\"\".typ·2 *byte, @\"\".iface·3 any, @\"\".ret·4 *any) (? bool)\n" + + "func @\"\".assertI2I (@\"\".typ·1 *byte, @\"\".iface·2 any, @\"\".ret·3 *any)\n" + + "func @\"\".assertI2I2 (@\"\".typ·2 *byte, @\"\".iface·3 any, @\"\".ret·4 *any) (? bool)\n" + + "func @\"\".assertI2T (@\"\".typ·1 *byte, @\"\".iface·2 any, @\"\".ret·3 *any)\n" + + "func @\"\".assertI2T2 (@\"\".typ·2 *byte, @\"\".iface·3 any, @\"\".ret·4 *any) (? bool)\n" + + "func @\"\".panicdottype (@\"\".have·1 *byte, @\"\".want·2 *byte, @\"\".iface·3 *byte)\n" + + "func @\"\".ifaceeq (@\"\".i1·2 any, @\"\".i2·3 any) (@\"\".ret·1 bool)\n" + + "func @\"\".efaceeq (@\"\".i1·2 any, @\"\".i2·3 any) (@\"\".ret·1 bool)\n" + + "func @\"\".ifacethash (@\"\".i1·2 any) (@\"\".ret·1 uint32)\n" + + "func @\"\".efacethash (@\"\".i1·2 any) (@\"\".ret·1 uint32)\n" + + "func @\"\".makemap (@\"\".mapType·2 *byte, @\"\".hint·3 int64, @\"\".mapbuf·4 *any, @\"\".bucketbuf·5 *any) (@\"\".hmap·1 map[any]any)\n" + + "func @\"\".mapaccess1 (@\"\".mapType·2 *byte, @\"\".hmap·3 map[any]any, @\"\".key·4 *any) (@\"\".val·1 *any)\n" + + "func @\"\".mapaccess1_fast32 (@\"\".mapType·2 *byte, @\"\".hmap·3 map[any]any, @\"\".key·4 any) (@\"\".val·1 *any)\n" + + "func @\"\".mapaccess1_fast64 (@\"\".mapType·2 *byte, @\"\".hmap·3 map[any]any, @\"\".key·4 any) (@\"\".val·1 *any)\n" + + "func @\"\".mapaccess1_faststr (@\"\".mapType·2 *byte, @\"\".hmap·3 map[any]any, @\"\".key·4 any) (@\"\".val·1 *any)\n" + + "func @\"\".mapaccess2 (@\"\".mapType·3 *byte, @\"\".hmap·4 map[any]any, @\"\".key·5 *any) (@\"\".val·1 *any, @\"\".pres·2 bool)\n" + + "func @\"\".mapaccess2_fast32 (@\"\".mapType·3 *byte, @\"\".hmap·4 map[any]any, @\"\".key·5 any) (@\"\".val·1 *any, @\"\".pres·2 bool)\n" + + "func @\"\".mapaccess2_fast64 (@\"\".mapType·3 *byte, @\"\".hmap·4 map[any]any, @\"\".key·5 any) (@\"\".val·1 *any, @\"\".pres·2 bool)\n" + + "func @\"\".mapaccess2_faststr (@\"\".mapType·3 *byte, @\"\".hmap·4 map[any]any, @\"\".key·5 any) (@\"\".val·1 *any, @\"\".pres·2 bool)\n" + + "func @\"\".mapassign1 (@\"\".mapType·1 *byte, @\"\".hmap·2 map[any]any, @\"\".key·3 *any, @\"\".val·4 *any)\n" + + "func @\"\".mapiterinit (@\"\".mapType·1 *byte, @\"\".hmap·2 map[any]any, @\"\".hiter·3 *any)\n" + + "func @\"\".mapdelete (@\"\".mapType·1 *byte, @\"\".hmap·2 map[any]any, @\"\".key·3 *any)\n" + + "func @\"\".mapiternext (@\"\".hiter·1 *any)\n" + + "func @\"\".makechan (@\"\".chanType·2 *byte, @\"\".hint·3 int64) (@\"\".hchan·1 chan any)\n" + + "func @\"\".chanrecv1 (@\"\".chanType·1 *byte, @\"\".hchan·2 <-chan any, @\"\".elem·3 *any)\n" + + "func @\"\".chanrecv2 (@\"\".chanType·2 *byte, @\"\".hchan·3 <-chan any, @\"\".elem·4 *any) (? bool)\n" + + "func @\"\".chansend1 (@\"\".chanType·1 *byte, @\"\".hchan·2 chan<- any, @\"\".elem·3 *any)\n" + + "func @\"\".closechan (@\"\".hchan·1 any)\n" + + "var @\"\".writeBarrierEnabled bool\n" + + "func @\"\".writebarrierptr (@\"\".dst·1 *any, @\"\".src·2 any)\n" + + "func @\"\".writebarrierstring (@\"\".dst·1 *any, @\"\".src·2 any)\n" + + "func @\"\".writebarrierslice (@\"\".dst·1 *any, @\"\".src·2 any)\n" + + "func @\"\".writebarrieriface (@\"\".dst·1 *any, @\"\".src·2 any)\n" + + "func @\"\".writebarrierfat01 (@\"\".dst·1 *any, _ uintptr, @\"\".src·3 any)\n" + + "func @\"\".writebarrierfat10 (@\"\".dst·1 *any, _ uintptr, @\"\".src·3 any)\n" + + "func @\"\".writebarrierfat11 (@\"\".dst·1 *any, _ uintptr, @\"\".src·3 any)\n" + + "func @\"\".writebarrierfat001 (@\"\".dst·1 *any, _ uintptr, @\"\".src·3 any)\n" + + "func @\"\".writebarrierfat010 (@\"\".dst·1 *any, _ uintptr, @\"\".src·3 any)\n" + + "func @\"\".writebarrierfat011 (@\"\".dst·1 *any, _ uintptr, @\"\".src·3 any)\n" + + "func @\"\".writebarrierfat100 (@\"\".dst·1 *any, _ uintptr, @\"\".src·3 any)\n" + + "func @\"\".writebarrierfat101 (@\"\".dst·1 *any, _ uintptr, @\"\".src·3 any)\n" + + "func @\"\".writebarrierfat110 (@\"\".dst·1 *any, _ uintptr, @\"\".src·3 any)\n" + + "func @\"\".writebarrierfat111 (@\"\".dst·1 *any, _ uintptr, @\"\".src·3 any)\n" + + "func @\"\".writebarrierfat0001 (@\"\".dst·1 *any, _ uintptr, @\"\".src·3 any)\n" + + "func @\"\".writebarrierfat0010 (@\"\".dst·1 *any, _ uintptr, @\"\".src·3 any)\n" + + "func @\"\".writebarrierfat0011 (@\"\".dst·1 *any, _ uintptr, @\"\".src·3 any)\n" + + "func @\"\".writebarrierfat0100 (@\"\".dst·1 *any, _ uintptr, @\"\".src·3 any)\n" + + "func @\"\".writebarrierfat0101 (@\"\".dst·1 *any, _ uintptr, @\"\".src·3 any)\n" + + "func @\"\".writebarrierfat0110 (@\"\".dst·1 *any, _ uintptr, @\"\".src·3 any)\n" + + "func @\"\".writebarrierfat0111 (@\"\".dst·1 *any, _ uintptr, @\"\".src·3 any)\n" + + "func @\"\".writebarrierfat1000 (@\"\".dst·1 *any, _ uintptr, @\"\".src·3 any)\n" + + "func @\"\".writebarrierfat1001 (@\"\".dst·1 *any, _ uintptr, @\"\".src·3 any)\n" + + "func @\"\".writebarrierfat1010 (@\"\".dst·1 *any, _ uintptr, @\"\".src·3 any)\n" + + "func @\"\".writebarrierfat1011 (@\"\".dst·1 *any, _ uintptr, @\"\".src·3 any)\n" + + "func @\"\".writebarrierfat1100 (@\"\".dst·1 *any, _ uintptr, @\"\".src·3 any)\n" + + "func @\"\".writebarrierfat1101 (@\"\".dst·1 *any, _ uintptr, @\"\".src·3 any)\n" + + "func @\"\".writebarrierfat1110 (@\"\".dst·1 *any, _ uintptr, @\"\".src·3 any)\n" + + "func @\"\".writebarrierfat1111 (@\"\".dst·1 *any, _ uintptr, @\"\".src·3 any)\n" + + "func @\"\".typedmemmove (@\"\".typ·1 *byte, @\"\".dst·2 *any, @\"\".src·3 *any)\n" + + "func @\"\".typedslicecopy (@\"\".typ·2 *byte, @\"\".dst·3 any, @\"\".src·4 any) (? int)\n" + + "func @\"\".selectnbsend (@\"\".chanType·2 *byte, @\"\".hchan·3 chan<- any, @\"\".elem·4 *any) (? bool)\n" + + "func @\"\".selectnbrecv (@\"\".chanType·2 *byte, @\"\".elem·3 *any, @\"\".hchan·4 <-chan any) (? bool)\n" + + "func @\"\".selectnbrecv2 (@\"\".chanType·2 *byte, @\"\".elem·3 *any, @\"\".received·4 *bool, @\"\".hchan·5 <-chan any) (? bool)\n" + + "func @\"\".newselect (@\"\".sel·1 *byte, @\"\".selsize·2 int64, @\"\".size·3 int32)\n" + + "func @\"\".selectsend (@\"\".sel·2 *byte, @\"\".hchan·3 chan<- any, @\"\".elem·4 *any) (@\"\".selected·1 bool)\n" + + "func @\"\".selectrecv (@\"\".sel·2 *byte, @\"\".hchan·3 <-chan any, @\"\".elem·4 *any) (@\"\".selected·1 bool)\n" + + "func @\"\".selectrecv2 (@\"\".sel·2 *byte, @\"\".hchan·3 <-chan any, @\"\".elem·4 *any, @\"\".received·5 *bool) (@\"\".selected·1 bool)\n" + + "func @\"\".selectdefault (@\"\".sel·2 *byte) (@\"\".selected·1 bool)\n" + + "func @\"\".selectgo (@\"\".sel·1 *byte)\n" + + "func @\"\".block ()\n" + + "func @\"\".makeslice (@\"\".typ·2 *byte, @\"\".nel·3 int64, @\"\".cap·4 int64) (@\"\".ary·1 []any)\n" + + "func @\"\".growslice (@\"\".typ·2 *byte, @\"\".old·3 []any, @\"\".cap·4 int) (@\"\".ary·1 []any)\n" + + "func @\"\".growslice_n (@\"\".typ·2 *byte, @\"\".old·3 []any, @\"\".n·4 int) (@\"\".ary·1 []any)\n" + + "func @\"\".memmove (@\"\".to·1 *any, @\"\".frm·2 *any, @\"\".length·3 uintptr)\n" + + "func @\"\".memclr (@\"\".ptr·1 *byte, @\"\".length·2 uintptr)\n" + + "func @\"\".memequal (@\"\".x·2 *any, @\"\".y·3 *any, @\"\".size·4 uintptr) (? bool)\n" + + "func @\"\".memequal8 (@\"\".x·2 *any, @\"\".y·3 *any) (? bool)\n" + + "func @\"\".memequal16 (@\"\".x·2 *any, @\"\".y·3 *any) (? bool)\n" + + "func @\"\".memequal32 (@\"\".x·2 *any, @\"\".y·3 *any) (? bool)\n" + + "func @\"\".memequal64 (@\"\".x·2 *any, @\"\".y·3 *any) (? bool)\n" + + "func @\"\".memequal128 (@\"\".x·2 *any, @\"\".y·3 *any) (? bool)\n" + + "func @\"\".int64div (? int64, ? int64) (? int64)\n" + + "func @\"\".uint64div (? uint64, ? uint64) (? uint64)\n" + + "func @\"\".int64mod (? int64, ? int64) (? int64)\n" + + "func @\"\".uint64mod (? uint64, ? uint64) (? uint64)\n" + + "func @\"\".float64toint64 (? float64) (? int64)\n" + + "func @\"\".float64touint64 (? float64) (? uint64)\n" + + "func @\"\".int64tofloat64 (? int64) (? float64)\n" + + "func @\"\".uint64tofloat64 (? uint64) (? float64)\n" + + "func @\"\".complex128div (@\"\".num·2 complex128, @\"\".den·3 complex128) (@\"\".quo·1 complex128)\n" + + "func @\"\".racefuncenter (? uintptr)\n" + + "func @\"\".racefuncexit ()\n" + + "func @\"\".raceread (? uintptr)\n" + + "func @\"\".racewrite (? uintptr)\n" + + "func @\"\".racereadrange (@\"\".addr·1 uintptr, @\"\".size·2 uintptr)\n" + + "func @\"\".racewriterange (@\"\".addr·1 uintptr, @\"\".size·2 uintptr)\n" + + "\n" + + "$$\n" + +const unsafeimport = "" + + "package unsafe\n" + + "import runtime \"runtime\"\n" + + "type @\"\".Pointer uintptr\n" + + "func @\"\".Offsetof (? any) (? uintptr)\n" + + "func @\"\".Sizeof (? any) (? uintptr)\n" + + "func @\"\".Alignof (? any) (? uintptr)\n" + + "\n" + + "$$\n" diff --git a/src/cmd/compile/internal/gc/builtin/runtime.go b/src/cmd/compile/internal/gc/builtin/runtime.go new file mode 100644 index 0000000000000000000000000000000000000000..6210f10cdf457e45b34f2bf1a907cd6cb8e96fd5 --- /dev/null +++ b/src/cmd/compile/internal/gc/builtin/runtime.go @@ -0,0 +1,195 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// NOTE: If you change this file you must run "go generate" +// to update builtin.go. This is not done automatically +// to avoid depending on having a working compiler binary. + +// +build ignore + +package PACKAGE + +// emitted by compiler, not referred to by go programs + +func newobject(typ *byte) *any +func panicindex() +func panicslice() +func panicdivide() +func throwreturn() +func throwinit() +func panicwrap(string, string, string) + +func gopanic(interface{}) +func gorecover(*int32) interface{} + +func printbool(bool) +func printfloat(float64) +func printint(int64) +func printhex(uint64) +func printuint(uint64) +func printcomplex(complex128) +func printstring(string) +func printpointer(any) +func printiface(any) +func printeface(any) +func printslice(any) +func printnl() +func printsp() +func printlock() +func printunlock() + +func concatstring2(*[32]byte, string, string) string +func concatstring3(*[32]byte, string, string, string) string +func concatstring4(*[32]byte, string, string, string, string) string +func concatstring5(*[32]byte, string, string, string, string, string) string +func concatstrings(*[32]byte, []string) string + +func cmpstring(string, string) int +func eqstring(string, string) bool +func intstring(*[4]byte, int64) string +func slicebytetostring(*[32]byte, []byte) string +func slicebytetostringtmp([]byte) string +func slicerunetostring(*[32]byte, []rune) string +func stringtoslicebyte(*[32]byte, string) []byte +func stringtoslicebytetmp(string) []byte +func stringtoslicerune(*[32]rune, string) []rune +func stringiter(string, int) int +func stringiter2(string, int) (retk int, retv rune) +func slicecopy(to any, fr any, wid uintptr) int +func slicestringcopy(to any, fr any) int + +// interface conversions +func typ2Itab(typ *byte, typ2 *byte, cache **byte) (ret *byte) +func convI2E(elem any) (ret any) +func convI2I(typ *byte, elem any) (ret any) +func convT2E(typ *byte, elem, buf *any) (ret any) +func convT2I(typ *byte, typ2 *byte, cache **byte, elem, buf *any) (ret any) + +// interface type assertions x.(T) +func assertE2E(typ *byte, iface any, ret *any) +func assertE2E2(typ *byte, iface any, ret *any) bool +func assertE2I(typ *byte, iface any, ret *any) +func assertE2I2(typ *byte, iface any, ret *any) bool +func assertE2T(typ *byte, iface any, ret *any) +func assertE2T2(typ *byte, iface any, ret *any) bool +func assertI2E(typ *byte, iface any, ret *any) +func assertI2E2(typ *byte, iface any, ret *any) bool +func assertI2I(typ *byte, iface any, ret *any) +func assertI2I2(typ *byte, iface any, ret *any) bool +func assertI2T(typ *byte, iface any, ret *any) +func assertI2T2(typ *byte, iface any, ret *any) bool +func panicdottype(have, want, iface *byte) + +func ifaceeq(i1 any, i2 any) (ret bool) +func efaceeq(i1 any, i2 any) (ret bool) +func ifacethash(i1 any) (ret uint32) +func efacethash(i1 any) (ret uint32) + +// *byte is really *runtime.Type +func makemap(mapType *byte, hint int64, mapbuf *any, bucketbuf *any) (hmap map[any]any) +func mapaccess1(mapType *byte, hmap map[any]any, key *any) (val *any) +func mapaccess1_fast32(mapType *byte, hmap map[any]any, key any) (val *any) +func mapaccess1_fast64(mapType *byte, hmap map[any]any, key any) (val *any) +func mapaccess1_faststr(mapType *byte, hmap map[any]any, key any) (val *any) +func mapaccess2(mapType *byte, hmap map[any]any, key *any) (val *any, pres bool) +func mapaccess2_fast32(mapType *byte, hmap map[any]any, key any) (val *any, pres bool) +func mapaccess2_fast64(mapType *byte, hmap map[any]any, key any) (val *any, pres bool) +func mapaccess2_faststr(mapType *byte, hmap map[any]any, key any) (val *any, pres bool) +func mapassign1(mapType *byte, hmap map[any]any, key *any, val *any) +func mapiterinit(mapType *byte, hmap map[any]any, hiter *any) +func mapdelete(mapType *byte, hmap map[any]any, key *any) +func mapiternext(hiter *any) + +// *byte is really *runtime.Type +func makechan(chanType *byte, hint int64) (hchan chan any) +func chanrecv1(chanType *byte, hchan <-chan any, elem *any) +func chanrecv2(chanType *byte, hchan <-chan any, elem *any) bool +func chansend1(chanType *byte, hchan chan<- any, elem *any) +func closechan(hchan any) + +var writeBarrierEnabled bool + +func writebarrierptr(dst *any, src any) +func writebarrierstring(dst *any, src any) +func writebarrierslice(dst *any, src any) +func writebarrieriface(dst *any, src any) + +// The unused *byte argument makes sure that src is 2-pointer-aligned, +// which is the maximum alignment on NaCl amd64p32 +// (and possibly on 32-bit systems if we start 64-bit aligning uint64s). +// The bitmap in the name tells which words being copied are pointers. +func writebarrierfat01(dst *any, _ uintptr, src any) +func writebarrierfat10(dst *any, _ uintptr, src any) +func writebarrierfat11(dst *any, _ uintptr, src any) +func writebarrierfat001(dst *any, _ uintptr, src any) +func writebarrierfat010(dst *any, _ uintptr, src any) +func writebarrierfat011(dst *any, _ uintptr, src any) +func writebarrierfat100(dst *any, _ uintptr, src any) +func writebarrierfat101(dst *any, _ uintptr, src any) +func writebarrierfat110(dst *any, _ uintptr, src any) +func writebarrierfat111(dst *any, _ uintptr, src any) +func writebarrierfat0001(dst *any, _ uintptr, src any) +func writebarrierfat0010(dst *any, _ uintptr, src any) +func writebarrierfat0011(dst *any, _ uintptr, src any) +func writebarrierfat0100(dst *any, _ uintptr, src any) +func writebarrierfat0101(dst *any, _ uintptr, src any) +func writebarrierfat0110(dst *any, _ uintptr, src any) +func writebarrierfat0111(dst *any, _ uintptr, src any) +func writebarrierfat1000(dst *any, _ uintptr, src any) +func writebarrierfat1001(dst *any, _ uintptr, src any) +func writebarrierfat1010(dst *any, _ uintptr, src any) +func writebarrierfat1011(dst *any, _ uintptr, src any) +func writebarrierfat1100(dst *any, _ uintptr, src any) +func writebarrierfat1101(dst *any, _ uintptr, src any) +func writebarrierfat1110(dst *any, _ uintptr, src any) +func writebarrierfat1111(dst *any, _ uintptr, src any) + +// *byte is really *runtime.Type +func typedmemmove(typ *byte, dst *any, src *any) +func typedslicecopy(typ *byte, dst any, src any) int + +func selectnbsend(chanType *byte, hchan chan<- any, elem *any) bool +func selectnbrecv(chanType *byte, elem *any, hchan <-chan any) bool +func selectnbrecv2(chanType *byte, elem *any, received *bool, hchan <-chan any) bool + +func newselect(sel *byte, selsize int64, size int32) +func selectsend(sel *byte, hchan chan<- any, elem *any) (selected bool) +func selectrecv(sel *byte, hchan <-chan any, elem *any) (selected bool) +func selectrecv2(sel *byte, hchan <-chan any, elem *any, received *bool) (selected bool) +func selectdefault(sel *byte) (selected bool) +func selectgo(sel *byte) +func block() + +func makeslice(typ *byte, nel int64, cap int64) (ary []any) +func growslice(typ *byte, old []any, cap int) (ary []any) +func growslice_n(typ *byte, old []any, n int) (ary []any) +func memmove(to *any, frm *any, length uintptr) +func memclr(ptr *byte, length uintptr) + +func memequal(x, y *any, size uintptr) bool +func memequal8(x, y *any) bool +func memequal16(x, y *any) bool +func memequal32(x, y *any) bool +func memequal64(x, y *any) bool +func memequal128(x, y *any) bool + +// only used on 32-bit +func int64div(int64, int64) int64 +func uint64div(uint64, uint64) uint64 +func int64mod(int64, int64) int64 +func uint64mod(uint64, uint64) uint64 +func float64toint64(float64) int64 +func float64touint64(float64) uint64 +func int64tofloat64(int64) float64 +func uint64tofloat64(uint64) float64 + +func complex128div(num complex128, den complex128) (quo complex128) + +// race detection +func racefuncenter(uintptr) +func racefuncexit() +func raceread(uintptr) +func racewrite(uintptr) +func racereadrange(addr, size uintptr) +func racewriterange(addr, size uintptr) diff --git a/src/cmd/compile/internal/gc/builtin/unsafe.go b/src/cmd/compile/internal/gc/builtin/unsafe.go new file mode 100644 index 0000000000000000000000000000000000000000..ce508692eb391795e58ed6560a9469a3c5370a6b --- /dev/null +++ b/src/cmd/compile/internal/gc/builtin/unsafe.go @@ -0,0 +1,18 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// NOTE: If you change this file you must run "go generate" +// to update builtin.go. This is not done automatically +// to avoid depending on having a working compiler binary. + +// +build ignore + +package PACKAGE + +type Pointer uintptr // not really; filled in by compiler + +// return types here are ignored; see unsafe.go +func Offsetof(any) uintptr +func Sizeof(any) uintptr +func Alignof(any) uintptr diff --git a/src/cmd/compile/internal/gc/bv.go b/src/cmd/compile/internal/gc/bv.go new file mode 100644 index 0000000000000000000000000000000000000000..2b988e65472d932f74d55cdadb4d095c2a3e5104 --- /dev/null +++ b/src/cmd/compile/internal/gc/bv.go @@ -0,0 +1,195 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package gc + +import "fmt" + +const ( + WORDSIZE = 4 + WORDBITS = 32 + WORDMASK = WORDBITS - 1 + WORDSHIFT = 5 +) + +// A Bvec is a bit vector. +type Bvec struct { + n int32 // number of bits in vector + b []uint32 // words holding bits +} + +func bvsize(n uint32) uint32 { + return ((n + WORDBITS - 1) / WORDBITS) * WORDSIZE +} + +func bvbits(bv Bvec) int32 { + return bv.n +} + +func bvwords(bv Bvec) int32 { + return (bv.n + WORDBITS - 1) / WORDBITS +} + +func bvalloc(n int32) Bvec { + return Bvec{n, make([]uint32, bvsize(uint32(n))/4)} +} + +type bulkBvec struct { + words []uint32 + nbit int32 + nword int32 +} + +func bvbulkalloc(nbit int32, count int32) bulkBvec { + nword := (nbit + WORDBITS - 1) / WORDBITS + return bulkBvec{ + words: make([]uint32, nword*count), + nbit: nbit, + nword: nword, + } +} + +func (b *bulkBvec) next() Bvec { + out := Bvec{b.nbit, b.words[:b.nword]} + b.words = b.words[b.nword:] + return out +} + +/* difference */ +func bvandnot(dst Bvec, src1 Bvec, src2 Bvec) { + for i, x := range src1.b { + dst.b[i] = x &^ src2.b[i] + } +} + +func bvcmp(bv1 Bvec, bv2 Bvec) int { + if bv1.n != bv2.n { + Fatal("bvequal: lengths %d and %d are not equal", bv1.n, bv2.n) + } + for i, x := range bv1.b { + if x != bv2.b[i] { + return 1 + } + } + return 0 +} + +func bvcopy(dst Bvec, src Bvec) { + for i, x := range src.b { + dst.b[i] = x + } +} + +func bvconcat(src1 Bvec, src2 Bvec) Bvec { + dst := bvalloc(src1.n + src2.n) + for i := int32(0); i < src1.n; i++ { + if bvget(src1, i) != 0 { + bvset(dst, i) + } + } + for i := int32(0); i < src2.n; i++ { + if bvget(src2, i) != 0 { + bvset(dst, i+src1.n) + } + } + return dst +} + +func bvget(bv Bvec, i int32) int { + if i < 0 || i >= bv.n { + Fatal("bvget: index %d is out of bounds with length %d\n", i, bv.n) + } + return int((bv.b[i>>WORDSHIFT] >> uint(i&WORDMASK)) & 1) +} + +// bvnext returns the smallest index >= i for which bvget(bv, i) == 1. +// If there is no such index, bvnext returns -1. +func bvnext(bv Bvec, i int32) int { + if i >= bv.n { + return -1 + } + + // Jump i ahead to next word with bits. + if bv.b[i>>WORDSHIFT]>>uint(i&WORDMASK) == 0 { + i &^= WORDMASK + i += WORDBITS + for i < bv.n && bv.b[i>>WORDSHIFT] == 0 { + i += WORDBITS + } + } + + if i >= bv.n { + return -1 + } + + // Find 1 bit. + w := bv.b[i>>WORDSHIFT] >> uint(i&WORDMASK) + + for w&1 == 0 { + w >>= 1 + i++ + } + + return int(i) +} + +func bvisempty(bv Bvec) bool { + for i := int32(0); i < bv.n; i += WORDBITS { + if bv.b[i>>WORDSHIFT] != 0 { + return false + } + } + return true +} + +func bvnot(bv Bvec) { + i := int32(0) + w := int32(0) + for ; i < bv.n; i, w = i+WORDBITS, w+1 { + bv.b[w] = ^bv.b[w] + } +} + +/* union */ +func bvor(dst Bvec, src1 Bvec, src2 Bvec) { + for i, x := range src1.b { + dst.b[i] = x | src2.b[i] + } +} + +/* intersection */ +func bvand(dst Bvec, src1 Bvec, src2 Bvec) { + for i, x := range src1.b { + dst.b[i] = x & src2.b[i] + } +} + +func bvprint(bv Bvec) { + fmt.Printf("#*") + for i := int32(0); i < bv.n; i++ { + fmt.Printf("%d", bvget(bv, i)) + } +} + +func bvreset(bv Bvec, i int32) { + if i < 0 || i >= bv.n { + Fatal("bvreset: index %d is out of bounds with length %d\n", i, bv.n) + } + mask := uint32(^(1 << uint(i%WORDBITS))) + bv.b[i/WORDBITS] &= mask +} + +func bvresetall(bv Bvec) { + for i := range bv.b { + bv.b[i] = 0 + } +} + +func bvset(bv Bvec, i int32) { + if i < 0 || i >= bv.n { + Fatal("bvset: index %d is out of bounds with length %d\n", i, bv.n) + } + mask := uint32(1 << uint(i%WORDBITS)) + bv.b[i/WORDBITS] |= mask +} diff --git a/src/cmd/compile/internal/gc/cgen.go b/src/cmd/compile/internal/gc/cgen.go new file mode 100644 index 0000000000000000000000000000000000000000..b6a3e5bbebfc6b1ff524d952cb649f8f2fa7014f --- /dev/null +++ b/src/cmd/compile/internal/gc/cgen.go @@ -0,0 +1,3566 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package gc + +import ( + "cmd/internal/obj" + "fmt" +) + +/* + * generate: + * res = n; + * simplifies and calls Thearch.Gmove. + * if wb is true, need to emit write barriers. + */ +func Cgen(n, res *Node) { + cgen_wb(n, res, false) +} + +func cgen_wb(n, res *Node, wb bool) { + if Debug['g'] != 0 { + op := "cgen" + if wb { + op = "cgen_wb" + } + Dump("\n"+op+"-n", n) + Dump(op+"-res", res) + } + + if n == nil || n.Type == nil { + return + } + + if res == nil || res.Type == nil { + Fatal("cgen: res nil") + } + + for n.Op == OCONVNOP { + n = n.Left + } + + switch n.Op { + case OSLICE, OSLICEARR, OSLICESTR, OSLICE3, OSLICE3ARR: + cgen_slice(n, res, wb) + return + + case OEFACE: + if res.Op != ONAME || !res.Addable || wb { + var n1 Node + Tempname(&n1, n.Type) + Cgen_eface(n, &n1) + cgen_wb(&n1, res, wb) + } else { + Cgen_eface(n, res) + } + return + + case ODOTTYPE: + cgen_dottype(n, res, nil, wb) + return + + case OAPPEND: + cgen_append(n, res) + return + } + + if n.Ullman >= UINF { + if n.Op == OINDREG { + Fatal("cgen: this is going to miscompile") + } + if res.Ullman >= UINF { + var n1 Node + Tempname(&n1, n.Type) + Cgen(n, &n1) + cgen_wb(&n1, res, wb) + return + } + } + + if Isfat(n.Type) { + if n.Type.Width < 0 { + Fatal("forgot to compute width for %v", n.Type) + } + sgen_wb(n, res, n.Type.Width, wb) + return + } + + if !res.Addable { + if n.Ullman > res.Ullman { + if Ctxt.Arch.Regsize == 4 && Is64(n.Type) { + var n1 Node + Tempname(&n1, n.Type) + Cgen(n, &n1) + cgen_wb(&n1, res, wb) + return + } + + var n1 Node + Regalloc(&n1, n.Type, res) + Cgen(n, &n1) + if n1.Ullman > res.Ullman { + Dump("n1", &n1) + Dump("res", res) + Fatal("loop in cgen") + } + + cgen_wb(&n1, res, wb) + Regfree(&n1) + return + } + + var f int + if res.Ullman < UINF { + if Complexop(n, res) { + Complexgen(n, res) + return + } + + f = 1 // gen thru register + switch n.Op { + case OLITERAL: + if Smallintconst(n) { + f = 0 + } + + case OREGISTER: + f = 0 + } + + if !Iscomplex[n.Type.Etype] && Ctxt.Arch.Regsize == 8 && !wb { + a := Thearch.Optoas(OAS, res.Type) + var addr obj.Addr + if Thearch.Sudoaddable(a, res, &addr) { + var p1 *obj.Prog + if f != 0 { + var n2 Node + Regalloc(&n2, res.Type, nil) + Cgen(n, &n2) + p1 = Thearch.Gins(a, &n2, nil) + Regfree(&n2) + } else { + p1 = Thearch.Gins(a, n, nil) + } + p1.To = addr + if Debug['g'] != 0 { + fmt.Printf("%v [ignore previous line]\n", p1) + } + Thearch.Sudoclean() + return + } + } + } + + if Ctxt.Arch.Thechar == '8' { + // no registers to speak of + var n1, n2 Node + Tempname(&n1, n.Type) + Cgen(n, &n1) + Igen(res, &n2, nil) + cgen_wb(&n1, &n2, wb) + Regfree(&n2) + return + } + + var n1 Node + Igen(res, &n1, nil) + cgen_wb(n, &n1, wb) + Regfree(&n1) + return + } + + // update addressability for string, slice + // can't do in walk because n->left->addable + // changes if n->left is an escaping local variable. + switch n.Op { + case OSPTR, OLEN: + if Isslice(n.Left.Type) || Istype(n.Left.Type, TSTRING) { + n.Addable = n.Left.Addable + } + + case OCAP: + if Isslice(n.Left.Type) { + n.Addable = n.Left.Addable + } + + case OITAB: + n.Addable = n.Left.Addable + } + + if wb { + if int(Simtype[res.Type.Etype]) != Tptr { + Fatal("cgen_wb of type %v", res.Type) + } + if n.Ullman >= UINF { + var n1 Node + Tempname(&n1, n.Type) + Cgen(n, &n1) + n = &n1 + } + cgen_wbptr(n, res) + return + } + + // Write barrier now handled. Code below this line can ignore wb. + + if Ctxt.Arch.Thechar == '5' { // TODO(rsc): Maybe more often? + // if both are addressable, move + if n.Addable && res.Addable { + if Is64(n.Type) || Is64(res.Type) || n.Op == OREGISTER || res.Op == OREGISTER || Iscomplex[n.Type.Etype] || Iscomplex[res.Type.Etype] { + Thearch.Gmove(n, res) + } else { + var n1 Node + Regalloc(&n1, n.Type, nil) + Thearch.Gmove(n, &n1) + Cgen(&n1, res) + Regfree(&n1) + } + + return + } + + // if both are not addressable, use a temporary. + if !n.Addable && !res.Addable { + // could use regalloc here sometimes, + // but have to check for ullman >= UINF. + var n1 Node + Tempname(&n1, n.Type) + Cgen(n, &n1) + Cgen(&n1, res) + return + } + + // if result is not addressable directly but n is, + // compute its address and then store via the address. + if !res.Addable { + var n1 Node + Igen(res, &n1, nil) + Cgen(n, &n1) + Regfree(&n1) + return + } + } + + if Complexop(n, res) { + Complexgen(n, res) + return + } + + if (Ctxt.Arch.Thechar == '6' || Ctxt.Arch.Thechar == '8') && n.Addable { + Thearch.Gmove(n, res) + return + } + + if Ctxt.Arch.Thechar == '7' || Ctxt.Arch.Thechar == '9' { + // if both are addressable, move + if n.Addable { + if n.Op == OREGISTER || res.Op == OREGISTER { + Thearch.Gmove(n, res) + } else { + var n1 Node + Regalloc(&n1, n.Type, nil) + Thearch.Gmove(n, &n1) + Cgen(&n1, res) + Regfree(&n1) + } + return + } + } + + // if n is sudoaddable generate addr and move + if Ctxt.Arch.Thechar == '5' && !Is64(n.Type) && !Is64(res.Type) && !Iscomplex[n.Type.Etype] && !Iscomplex[res.Type.Etype] { + a := Thearch.Optoas(OAS, n.Type) + var addr obj.Addr + if Thearch.Sudoaddable(a, n, &addr) { + if res.Op != OREGISTER { + var n2 Node + Regalloc(&n2, res.Type, nil) + p1 := Thearch.Gins(a, nil, &n2) + p1.From = addr + if Debug['g'] != 0 { + fmt.Printf("%v [ignore previous line]\n", p1) + } + Thearch.Gmove(&n2, res) + Regfree(&n2) + } else { + p1 := Thearch.Gins(a, nil, res) + p1.From = addr + if Debug['g'] != 0 { + fmt.Printf("%v [ignore previous line]\n", p1) + } + } + Thearch.Sudoclean() + return + } + } + + nl := n.Left + nr := n.Right + + if nl != nil && nl.Ullman >= UINF { + if nr != nil && nr.Ullman >= UINF { + var n1 Node + Tempname(&n1, nl.Type) + Cgen(nl, &n1) + n2 := *n + n2.Left = &n1 + Cgen(&n2, res) + return + } + } + + // 64-bit ops are hard on 32-bit machine. + if Ctxt.Arch.Regsize == 4 && (Is64(n.Type) || Is64(res.Type) || n.Left != nil && Is64(n.Left.Type)) { + switch n.Op { + // math goes to cgen64. + case OMINUS, + OCOM, + OADD, + OSUB, + OMUL, + OLROT, + OLSH, + ORSH, + OAND, + OOR, + OXOR: + Thearch.Cgen64(n, res) + return + } + } + + if Thearch.Cgen_float != nil && nl != nil && Isfloat[n.Type.Etype] && Isfloat[nl.Type.Etype] { + Thearch.Cgen_float(n, res) + return + } + + if !Iscomplex[n.Type.Etype] && Ctxt.Arch.Regsize == 8 { + a := Thearch.Optoas(OAS, n.Type) + var addr obj.Addr + if Thearch.Sudoaddable(a, n, &addr) { + if res.Op == OREGISTER { + p1 := Thearch.Gins(a, nil, res) + p1.From = addr + } else { + var n2 Node + Regalloc(&n2, n.Type, nil) + p1 := Thearch.Gins(a, nil, &n2) + p1.From = addr + Thearch.Gins(a, &n2, res) + Regfree(&n2) + } + + Thearch.Sudoclean() + return + } + } + + var a int + switch n.Op { + default: + Dump("cgen", n) + Dump("cgen-res", res) + Fatal("cgen: unknown op %v", Nconv(n, obj.FmtShort|obj.FmtSign)) + + case OOROR, OANDAND, + OEQ, ONE, + OLT, OLE, + OGE, OGT, + ONOT: + Bvgen(n, res, true) + return + + case OPLUS: + Cgen(nl, res) + return + + // unary + case OCOM: + a := Thearch.Optoas(OXOR, nl.Type) + + var n1 Node + Regalloc(&n1, nl.Type, nil) + Cgen(nl, &n1) + var n2 Node + Nodconst(&n2, nl.Type, -1) + Thearch.Gins(a, &n2, &n1) + cgen_norm(n, &n1, res) + return + + case OMINUS: + if Isfloat[nl.Type.Etype] { + nr = Nodintconst(-1) + Convlit(&nr, n.Type) + a = Thearch.Optoas(OMUL, nl.Type) + goto sbop + } + + a := Thearch.Optoas(int(n.Op), nl.Type) + // unary + var n1 Node + Regalloc(&n1, nl.Type, res) + + Cgen(nl, &n1) + if Ctxt.Arch.Thechar == '5' { + var n2 Node + Nodconst(&n2, nl.Type, 0) + Thearch.Gins(a, &n2, &n1) + } else if Ctxt.Arch.Thechar == '7' { + Thearch.Gins(a, &n1, &n1) + } else { + Thearch.Gins(a, nil, &n1) + } + cgen_norm(n, &n1, res) + return + + case OSQRT: + var n1 Node + Regalloc(&n1, nl.Type, res) + Cgen(n.Left, &n1) + Thearch.Gins(Thearch.Optoas(OSQRT, nl.Type), &n1, &n1) + Thearch.Gmove(&n1, res) + Regfree(&n1) + return + + case OGETG: + Thearch.Getg(res) + return + + // symmetric binary + case OAND, + OOR, + OXOR, + OADD, + OMUL: + if n.Op == OMUL && Thearch.Cgen_bmul != nil && Thearch.Cgen_bmul(int(n.Op), nl, nr, res) { + break + } + a = Thearch.Optoas(int(n.Op), nl.Type) + goto sbop + + // asymmetric binary + case OSUB: + a = Thearch.Optoas(int(n.Op), nl.Type) + goto abop + + case OHMUL: + Thearch.Cgen_hmul(nl, nr, res) + + case OCONV: + if Eqtype(n.Type, nl.Type) || Noconv(n.Type, nl.Type) { + Cgen(nl, res) + return + } + + if Ctxt.Arch.Thechar == '8' { + var n1 Node + var n2 Node + Tempname(&n2, n.Type) + Mgen(nl, &n1, res) + Thearch.Gmove(&n1, &n2) + Thearch.Gmove(&n2, res) + Mfree(&n1) + break + } + + var n1 Node + var n2 Node + if Ctxt.Arch.Thechar == '5' { + if nl.Addable && !Is64(nl.Type) { + Regalloc(&n1, nl.Type, res) + Thearch.Gmove(nl, &n1) + } else { + if n.Type.Width > int64(Widthptr) || Is64(nl.Type) || Isfloat[nl.Type.Etype] { + Tempname(&n1, nl.Type) + } else { + Regalloc(&n1, nl.Type, res) + } + Cgen(nl, &n1) + } + if n.Type.Width > int64(Widthptr) || Is64(n.Type) || Isfloat[n.Type.Etype] { + Tempname(&n2, n.Type) + } else { + Regalloc(&n2, n.Type, nil) + } + } else { + if n.Type.Width > nl.Type.Width { + // If loading from memory, do conversion during load, + // so as to avoid use of 8-bit register in, say, int(*byteptr). + switch nl.Op { + case ODOT, ODOTPTR, OINDEX, OIND, ONAME: + Igen(nl, &n1, res) + Regalloc(&n2, n.Type, res) + Thearch.Gmove(&n1, &n2) + Thearch.Gmove(&n2, res) + Regfree(&n2) + Regfree(&n1) + return + } + } + Regalloc(&n1, nl.Type, res) + Regalloc(&n2, n.Type, &n1) + Cgen(nl, &n1) + } + + // if we do the conversion n1 -> n2 here + // reusing the register, then gmove won't + // have to allocate its own register. + Thearch.Gmove(&n1, &n2) + Thearch.Gmove(&n2, res) + if n2.Op == OREGISTER { + Regfree(&n2) + } + if n1.Op == OREGISTER { + Regfree(&n1) + } + + case ODOT, + ODOTPTR, + OINDEX, + OIND, + ONAME: // PHEAP or PPARAMREF var + var n1 Node + Igen(n, &n1, res) + + Thearch.Gmove(&n1, res) + Regfree(&n1) + + // interface table is first word of interface value + case OITAB: + var n1 Node + Igen(nl, &n1, res) + + n1.Type = n.Type + Thearch.Gmove(&n1, res) + Regfree(&n1) + + case OSPTR: + // pointer is the first word of string or slice. + if Isconst(nl, CTSTR) { + var n1 Node + Regalloc(&n1, Types[Tptr], res) + p1 := Thearch.Gins(Thearch.Optoas(OAS, n1.Type), nil, &n1) + Datastring(nl.Val().U.(string), &p1.From) + p1.From.Type = obj.TYPE_ADDR + Thearch.Gmove(&n1, res) + Regfree(&n1) + break + } + + var n1 Node + Igen(nl, &n1, res) + n1.Type = n.Type + Thearch.Gmove(&n1, res) + Regfree(&n1) + + case OLEN: + if Istype(nl.Type, TMAP) || Istype(nl.Type, TCHAN) { + // map and chan have len in the first int-sized word. + // a zero pointer means zero length + var n1 Node + Regalloc(&n1, Types[Tptr], res) + + Cgen(nl, &n1) + + var n2 Node + Nodconst(&n2, Types[Tptr], 0) + p1 := Thearch.Ginscmp(OEQ, Types[Tptr], &n1, &n2, 0) + + n2 = n1 + n2.Op = OINDREG + n2.Type = Types[Simtype[TINT]] + Thearch.Gmove(&n2, &n1) + + Patch(p1, Pc) + + Thearch.Gmove(&n1, res) + Regfree(&n1) + break + } + + if Istype(nl.Type, TSTRING) || Isslice(nl.Type) { + // both slice and string have len one pointer into the struct. + // a zero pointer means zero length + var n1 Node + Igen(nl, &n1, res) + + n1.Type = Types[Simtype[TUINT]] + n1.Xoffset += int64(Array_nel) + Thearch.Gmove(&n1, res) + Regfree(&n1) + break + } + + Fatal("cgen: OLEN: unknown type %v", Tconv(nl.Type, obj.FmtLong)) + + case OCAP: + if Istype(nl.Type, TCHAN) { + // chan has cap in the second int-sized word. + // a zero pointer means zero length + var n1 Node + Regalloc(&n1, Types[Tptr], res) + + Cgen(nl, &n1) + + var n2 Node + Nodconst(&n2, Types[Tptr], 0) + p1 := Thearch.Ginscmp(OEQ, Types[Tptr], &n1, &n2, 0) + + n2 = n1 + n2.Op = OINDREG + n2.Xoffset = int64(Widthint) + n2.Type = Types[Simtype[TINT]] + Thearch.Gmove(&n2, &n1) + + Patch(p1, Pc) + + Thearch.Gmove(&n1, res) + Regfree(&n1) + break + } + + if Isslice(nl.Type) { + var n1 Node + Igen(nl, &n1, res) + n1.Type = Types[Simtype[TUINT]] + n1.Xoffset += int64(Array_cap) + Thearch.Gmove(&n1, res) + Regfree(&n1) + break + } + + Fatal("cgen: OCAP: unknown type %v", Tconv(nl.Type, obj.FmtLong)) + + case OADDR: + if n.Bounded { // let race detector avoid nil checks + Disable_checknil++ + } + Agen(nl, res) + if n.Bounded { + Disable_checknil-- + } + + case OCALLMETH: + cgen_callmeth(n, 0) + cgen_callret(n, res) + + case OCALLINTER: + cgen_callinter(n, res, 0) + cgen_callret(n, res) + + case OCALLFUNC: + cgen_call(n, 0) + cgen_callret(n, res) + + case OMOD, ODIV: + if Isfloat[n.Type.Etype] || Thearch.Dodiv == nil { + a = Thearch.Optoas(int(n.Op), nl.Type) + goto abop + } + + if nl.Ullman >= nr.Ullman { + var n1 Node + Regalloc(&n1, nl.Type, res) + Cgen(nl, &n1) + cgen_div(int(n.Op), &n1, nr, res) + Regfree(&n1) + } else { + var n2 Node + if !Smallintconst(nr) { + Regalloc(&n2, nr.Type, res) + Cgen(nr, &n2) + } else { + n2 = *nr + } + + cgen_div(int(n.Op), nl, &n2, res) + if n2.Op != OLITERAL { + Regfree(&n2) + } + } + + case OLSH, ORSH, OLROT: + Thearch.Cgen_shift(int(n.Op), n.Bounded, nl, nr, res) + } + + return + + /* + * put simplest on right - we'll generate into left + * and then adjust it using the computation of right. + * constants and variables have the same ullman + * count, so look for constants specially. + * + * an integer constant we can use as an immediate + * is simpler than a variable - we can use the immediate + * in the adjustment instruction directly - so it goes + * on the right. + * + * other constants, like big integers or floating point + * constants, require a mov into a register, so those + * might as well go on the left, so we can reuse that + * register for the computation. + */ +sbop: // symmetric binary + if nl.Ullman < nr.Ullman || (nl.Ullman == nr.Ullman && (Smallintconst(nl) || (nr.Op == OLITERAL && !Smallintconst(nr)))) { + r := nl + nl = nr + nr = r + } + +abop: // asymmetric binary + var n1 Node + var n2 Node + if Ctxt.Arch.Thechar == '8' { + // no registers, sigh + if Smallintconst(nr) { + var n1 Node + Mgen(nl, &n1, res) + var n2 Node + Regalloc(&n2, nl.Type, &n1) + Thearch.Gmove(&n1, &n2) + Thearch.Gins(a, nr, &n2) + Thearch.Gmove(&n2, res) + Regfree(&n2) + Mfree(&n1) + } else if nl.Ullman >= nr.Ullman { + var nt Node + Tempname(&nt, nl.Type) + Cgen(nl, &nt) + var n2 Node + Mgen(nr, &n2, nil) + var n1 Node + Regalloc(&n1, nl.Type, res) + Thearch.Gmove(&nt, &n1) + Thearch.Gins(a, &n2, &n1) + Thearch.Gmove(&n1, res) + Regfree(&n1) + Mfree(&n2) + } else { + var n2 Node + Regalloc(&n2, nr.Type, res) + Cgen(nr, &n2) + var n1 Node + Regalloc(&n1, nl.Type, nil) + Cgen(nl, &n1) + Thearch.Gins(a, &n2, &n1) + Regfree(&n2) + Thearch.Gmove(&n1, res) + Regfree(&n1) + } + return + } + + if nl.Ullman >= nr.Ullman { + Regalloc(&n1, nl.Type, res) + Cgen(nl, &n1) + + if Smallintconst(nr) && Ctxt.Arch.Thechar != '5' && Ctxt.Arch.Thechar != '7' && Ctxt.Arch.Thechar != '9' { // TODO(rsc): Check opcode for arm + n2 = *nr + } else { + Regalloc(&n2, nr.Type, nil) + Cgen(nr, &n2) + } + } else { + if Smallintconst(nr) && Ctxt.Arch.Thechar != '5' && Ctxt.Arch.Thechar != '7' && Ctxt.Arch.Thechar != '9' { // TODO(rsc): Check opcode for arm + n2 = *nr + } else { + Regalloc(&n2, nr.Type, res) + Cgen(nr, &n2) + } + + Regalloc(&n1, nl.Type, nil) + Cgen(nl, &n1) + } + + Thearch.Gins(a, &n2, &n1) + if n2.Op != OLITERAL { + Regfree(&n2) + } + cgen_norm(n, &n1, res) +} + +var sys_wbptr *Node + +func cgen_wbptr(n, res *Node) { + if Curfn != nil && Curfn.Func.Nowritebarrier { + Yyerror("write barrier prohibited") + } + if Debug_wb > 0 { + Warn("write barrier") + } + + var dst, src Node + Igen(res, &dst, nil) + if n.Op == OREGISTER { + src = *n + Regrealloc(&src) + } else { + Cgenr(n, &src, nil) + } + + wbEnabled := syslook("writeBarrierEnabled", 0) + pbr := Thearch.Ginscmp(ONE, Types[TUINT8], wbEnabled, Nodintconst(0), -1) + Thearch.Gins(Thearch.Optoas(OAS, Types[Tptr]), &src, &dst) + pjmp := Gbranch(obj.AJMP, nil, 0) + Patch(pbr, Pc) + var adst Node + Agenr(&dst, &adst, &dst) + p := Thearch.Gins(Thearch.Optoas(OAS, Types[Tptr]), &adst, nil) + a := &p.To + a.Type = obj.TYPE_MEM + a.Reg = int16(Thearch.REGSP) + a.Offset = 0 + if HasLinkRegister() { + a.Offset += int64(Widthptr) + } + p2 := Thearch.Gins(Thearch.Optoas(OAS, Types[Tptr]), &src, nil) + p2.To = p.To + p2.To.Offset += int64(Widthptr) + Regfree(&adst) + if sys_wbptr == nil { + sys_wbptr = writebarrierfn("writebarrierptr", Types[Tptr], Types[Tptr]) + } + Ginscall(sys_wbptr, 0) + Patch(pjmp, Pc) + + Regfree(&dst) + Regfree(&src) +} + +func cgen_wbfat(n, res *Node) { + if Curfn != nil && Curfn.Func.Nowritebarrier { + Yyerror("write barrier prohibited") + } + if Debug_wb > 0 { + Warn("write barrier") + } + needType := true + funcName := "typedmemmove" + var dst, src Node + if n.Ullman >= res.Ullman { + Agenr(n, &src, nil) + Agenr(res, &dst, nil) + } else { + Agenr(res, &dst, nil) + Agenr(n, &src, nil) + } + p := Thearch.Gins(Thearch.Optoas(OAS, Types[Tptr]), &dst, nil) + a := &p.To + a.Type = obj.TYPE_MEM + a.Reg = int16(Thearch.REGSP) + a.Offset = 0 + if HasLinkRegister() { + a.Offset += int64(Widthptr) + } + if needType { + a.Offset += int64(Widthptr) + } + p2 := Thearch.Gins(Thearch.Optoas(OAS, Types[Tptr]), &src, nil) + p2.To = p.To + p2.To.Offset += int64(Widthptr) + Regfree(&dst) + if needType { + src.Type = Types[Tptr] + Thearch.Gins(Thearch.Optoas(OAS, Types[Tptr]), typename(n.Type), &src) + p3 := Thearch.Gins(Thearch.Optoas(OAS, Types[Tptr]), &src, nil) + p3.To = p2.To + p3.To.Offset -= 2 * int64(Widthptr) + } + Regfree(&src) + Ginscall(writebarrierfn(funcName, Types[Tptr], Types[Tptr]), 0) +} + +// cgen_norm moves n1 to res, truncating to expected type if necessary. +// n1 is a register, and cgen_norm frees it. +func cgen_norm(n, n1, res *Node) { + switch Ctxt.Arch.Thechar { + case '6', '8': + // We use sized math, so the result is already truncated. + default: + switch n.Op { + case OADD, OSUB, OMUL, ODIV, OCOM, OMINUS: + // TODO(rsc): What about left shift? + Thearch.Gins(Thearch.Optoas(OAS, n.Type), n1, n1) + } + } + + Thearch.Gmove(n1, res) + Regfree(n1) +} + +func Mgen(n *Node, n1 *Node, rg *Node) { + n1.Op = OEMPTY + + if n.Addable { + *n1 = *n + if n1.Op == OREGISTER || n1.Op == OINDREG { + reg[n.Reg-int16(Thearch.REGMIN)]++ + } + return + } + + Tempname(n1, n.Type) + Cgen(n, n1) + if n.Type.Width <= int64(Widthptr) || Isfloat[n.Type.Etype] { + n2 := *n1 + Regalloc(n1, n.Type, rg) + Thearch.Gmove(&n2, n1) + } +} + +func Mfree(n *Node) { + if n.Op == OREGISTER { + Regfree(n) + } +} + +/* + * allocate a register (reusing res if possible) and generate + * a = n + * The caller must call Regfree(a). + */ +func Cgenr(n *Node, a *Node, res *Node) { + if Debug['g'] != 0 { + Dump("cgenr-n", n) + } + + if Isfat(n.Type) { + Fatal("cgenr on fat node") + } + + if n.Addable { + Regalloc(a, n.Type, res) + Thearch.Gmove(n, a) + return + } + + switch n.Op { + case ONAME, + ODOT, + ODOTPTR, + OINDEX, + OCALLFUNC, + OCALLMETH, + OCALLINTER: + var n1 Node + Igen(n, &n1, res) + Regalloc(a, Types[Tptr], &n1) + Thearch.Gmove(&n1, a) + Regfree(&n1) + + default: + Regalloc(a, n.Type, res) + Cgen(n, a) + } +} + +/* + * allocate a register (reusing res if possible) and generate + * a = &n + * The caller must call Regfree(a). + * The generated code checks that the result is not nil. + */ +func Agenr(n *Node, a *Node, res *Node) { + if Debug['g'] != 0 { + Dump("\nagenr-n", n) + } + + nl := n.Left + nr := n.Right + + switch n.Op { + case ODOT, ODOTPTR, OCALLFUNC, OCALLMETH, OCALLINTER: + var n1 Node + Igen(n, &n1, res) + Regalloc(a, Types[Tptr], &n1) + Agen(&n1, a) + Regfree(&n1) + + case OIND: + Cgenr(n.Left, a, res) + Cgen_checknil(a) + + case OINDEX: + if Ctxt.Arch.Thechar == '5' { + var p2 *obj.Prog // to be patched to panicindex. + w := uint32(n.Type.Width) + bounded := Debug['B'] != 0 || n.Bounded + var n1 Node + var n3 Node + if nr.Addable { + var tmp Node + if !Isconst(nr, CTINT) { + Tempname(&tmp, Types[TINT32]) + } + if !Isconst(nl, CTSTR) { + Agenr(nl, &n3, res) + } + if !Isconst(nr, CTINT) { + p2 = Thearch.Cgenindex(nr, &tmp, bounded) + Regalloc(&n1, tmp.Type, nil) + Thearch.Gmove(&tmp, &n1) + } + } else if nl.Addable { + if !Isconst(nr, CTINT) { + var tmp Node + Tempname(&tmp, Types[TINT32]) + p2 = Thearch.Cgenindex(nr, &tmp, bounded) + Regalloc(&n1, tmp.Type, nil) + Thearch.Gmove(&tmp, &n1) + } + + if !Isconst(nl, CTSTR) { + Agenr(nl, &n3, res) + } + } else { + var tmp Node + Tempname(&tmp, Types[TINT32]) + p2 = Thearch.Cgenindex(nr, &tmp, bounded) + nr = &tmp + if !Isconst(nl, CTSTR) { + Agenr(nl, &n3, res) + } + Regalloc(&n1, tmp.Type, nil) + Thearch.Gins(Thearch.Optoas(OAS, tmp.Type), &tmp, &n1) + } + + // &a is in &n3 (allocated in res) + // i is in &n1 (if not constant) + // w is width + + // constant index + if Isconst(nr, CTINT) { + if Isconst(nl, CTSTR) { + Fatal("constant string constant index") + } + v := uint64(Mpgetfix(nr.Val().U.(*Mpint))) + var n2 Node + if Isslice(nl.Type) || nl.Type.Etype == TSTRING { + if Debug['B'] == 0 && !n.Bounded { + n1 = n3 + n1.Op = OINDREG + n1.Type = Types[Tptr] + n1.Xoffset = int64(Array_nel) + Nodconst(&n2, Types[TUINT32], int64(v)) + p1 := Thearch.Ginscmp(OGT, Types[TUINT32], &n1, &n2, +1) + Ginscall(Panicindex, -1) + Patch(p1, Pc) + } + + n1 = n3 + n1.Op = OINDREG + n1.Type = Types[Tptr] + n1.Xoffset = int64(Array_array) + Thearch.Gmove(&n1, &n3) + } + + Nodconst(&n2, Types[Tptr], int64(v*uint64(w))) + Thearch.Gins(Thearch.Optoas(OADD, Types[Tptr]), &n2, &n3) + *a = n3 + break + } + + var n2 Node + Regalloc(&n2, Types[TINT32], &n1) // i + Thearch.Gmove(&n1, &n2) + Regfree(&n1) + + var n4 Node + if Debug['B'] == 0 && !n.Bounded { + // check bounds + if Isconst(nl, CTSTR) { + Nodconst(&n4, Types[TUINT32], int64(len(nl.Val().U.(string)))) + } else if Isslice(nl.Type) || nl.Type.Etype == TSTRING { + n1 = n3 + n1.Op = OINDREG + n1.Type = Types[Tptr] + n1.Xoffset = int64(Array_nel) + Regalloc(&n4, Types[TUINT32], nil) + Thearch.Gmove(&n1, &n4) + } else { + Nodconst(&n4, Types[TUINT32], nl.Type.Bound) + } + p1 := Thearch.Ginscmp(OLT, Types[TUINT32], &n2, &n4, +1) + if n4.Op == OREGISTER { + Regfree(&n4) + } + if p2 != nil { + Patch(p2, Pc) + } + Ginscall(Panicindex, -1) + Patch(p1, Pc) + } + + if Isconst(nl, CTSTR) { + Regalloc(&n3, Types[Tptr], res) + p1 := Thearch.Gins(Thearch.Optoas(OAS, Types[Tptr]), nil, &n3) + Datastring(nl.Val().U.(string), &p1.From) + p1.From.Type = obj.TYPE_ADDR + } else if Isslice(nl.Type) || nl.Type.Etype == TSTRING { + n1 = n3 + n1.Op = OINDREG + n1.Type = Types[Tptr] + n1.Xoffset = int64(Array_array) + Thearch.Gmove(&n1, &n3) + } + + if w == 0 { + // nothing to do + } else if Thearch.AddIndex != nil && Thearch.AddIndex(&n2, int64(w), &n3) { + // done by back end + } else if w == 1 { + Thearch.Gins(Thearch.Optoas(OADD, Types[Tptr]), &n2, &n3) + } else { + if w&(w-1) == 0 { + // Power of 2. Use shift. + Thearch.Ginscon(Thearch.Optoas(OLSH, Types[TUINT32]), int64(log2(uint64(w))), &n2) + } else { + // Not a power of 2. Use multiply. + Regalloc(&n4, Types[TUINT32], nil) + Nodconst(&n1, Types[TUINT32], int64(w)) + Thearch.Gmove(&n1, &n4) + Thearch.Gins(Thearch.Optoas(OMUL, Types[TUINT32]), &n4, &n2) + Regfree(&n4) + } + Thearch.Gins(Thearch.Optoas(OADD, Types[Tptr]), &n2, &n3) + } + *a = n3 + Regfree(&n2) + break + } + if Ctxt.Arch.Thechar == '8' { + var p2 *obj.Prog // to be patched to panicindex. + w := uint32(n.Type.Width) + bounded := Debug['B'] != 0 || n.Bounded + var n3 Node + var tmp Node + var n1 Node + if nr.Addable { + // Generate &nl first, and move nr into register. + if !Isconst(nl, CTSTR) { + Igen(nl, &n3, res) + } + if !Isconst(nr, CTINT) { + p2 = Thearch.Igenindex(nr, &tmp, bounded) + Regalloc(&n1, tmp.Type, nil) + Thearch.Gmove(&tmp, &n1) + } + } else if nl.Addable { + // Generate nr first, and move &nl into register. + if !Isconst(nr, CTINT) { + p2 = Thearch.Igenindex(nr, &tmp, bounded) + Regalloc(&n1, tmp.Type, nil) + Thearch.Gmove(&tmp, &n1) + } + + if !Isconst(nl, CTSTR) { + Igen(nl, &n3, res) + } + } else { + p2 = Thearch.Igenindex(nr, &tmp, bounded) + nr = &tmp + if !Isconst(nl, CTSTR) { + Igen(nl, &n3, res) + } + Regalloc(&n1, tmp.Type, nil) + Thearch.Gins(Thearch.Optoas(OAS, tmp.Type), &tmp, &n1) + } + + // For fixed array we really want the pointer in n3. + var n2 Node + if Isfixedarray(nl.Type) { + Regalloc(&n2, Types[Tptr], &n3) + Agen(&n3, &n2) + Regfree(&n3) + n3 = n2 + } + + // &a[0] is in n3 (allocated in res) + // i is in n1 (if not constant) + // len(a) is in nlen (if needed) + // w is width + + // constant index + if Isconst(nr, CTINT) { + if Isconst(nl, CTSTR) { + Fatal("constant string constant index") // front end should handle + } + v := uint64(Mpgetfix(nr.Val().U.(*Mpint))) + if Isslice(nl.Type) || nl.Type.Etype == TSTRING { + if Debug['B'] == 0 && !n.Bounded { + nlen := n3 + nlen.Type = Types[TUINT32] + nlen.Xoffset += int64(Array_nel) + Nodconst(&n2, Types[TUINT32], int64(v)) + p1 := Thearch.Ginscmp(OGT, Types[TUINT32], &nlen, &n2, +1) + Ginscall(Panicindex, -1) + Patch(p1, Pc) + } + } + + // Load base pointer in n2 = n3. + Regalloc(&n2, Types[Tptr], &n3) + + n3.Type = Types[Tptr] + n3.Xoffset += int64(Array_array) + Thearch.Gmove(&n3, &n2) + Regfree(&n3) + if v*uint64(w) != 0 { + Nodconst(&n1, Types[Tptr], int64(v*uint64(w))) + Thearch.Gins(Thearch.Optoas(OADD, Types[Tptr]), &n1, &n2) + } + *a = n2 + break + } + + // i is in register n1, extend to 32 bits. + t := Types[TUINT32] + + if Issigned[n1.Type.Etype] { + t = Types[TINT32] + } + + Regalloc(&n2, t, &n1) // i + Thearch.Gmove(&n1, &n2) + Regfree(&n1) + + if Debug['B'] == 0 && !n.Bounded { + // check bounds + t := Types[TUINT32] + + var nlen Node + if Isconst(nl, CTSTR) { + Nodconst(&nlen, t, int64(len(nl.Val().U.(string)))) + } else if Isslice(nl.Type) || nl.Type.Etype == TSTRING { + nlen = n3 + nlen.Type = t + nlen.Xoffset += int64(Array_nel) + } else { + Nodconst(&nlen, t, nl.Type.Bound) + } + + p1 := Thearch.Ginscmp(OLT, t, &n2, &nlen, +1) + if p2 != nil { + Patch(p2, Pc) + } + Ginscall(Panicindex, -1) + Patch(p1, Pc) + } + + if Isconst(nl, CTSTR) { + Regalloc(&n3, Types[Tptr], res) + p1 := Thearch.Gins(Thearch.Optoas(OAS, Types[Tptr]), nil, &n3) + Datastring(nl.Val().U.(string), &p1.From) + p1.From.Type = obj.TYPE_ADDR + Thearch.Gins(Thearch.Optoas(OADD, n3.Type), &n2, &n3) + goto indexdone1 + } + + // Load base pointer in n3. + Regalloc(&tmp, Types[Tptr], &n3) + + if Isslice(nl.Type) || nl.Type.Etype == TSTRING { + n3.Type = Types[Tptr] + n3.Xoffset += int64(Array_array) + Thearch.Gmove(&n3, &tmp) + } + + Regfree(&n3) + n3 = tmp + + if w == 0 { + // nothing to do + } else if Thearch.AddIndex != nil && Thearch.AddIndex(&n2, int64(w), &n3) { + // done by back end + } else if w == 1 { + Thearch.Gins(Thearch.Optoas(OADD, Types[Tptr]), &n2, &n3) + } else { + if w&(w-1) == 0 { + // Power of 2. Use shift. + Thearch.Ginscon(Thearch.Optoas(OLSH, Types[TUINT32]), int64(log2(uint64(w))), &n2) + } else { + // Not a power of 2. Use multiply. + Thearch.Ginscon(Thearch.Optoas(OMUL, Types[TUINT32]), int64(w), &n2) + } + Thearch.Gins(Thearch.Optoas(OADD, Types[Tptr]), &n2, &n3) + } + + indexdone1: + *a = n3 + Regfree(&n2) + break + } + + freelen := 0 + w := uint64(n.Type.Width) + + // Generate the non-addressable child first. + var n3 Node + var nlen Node + var tmp Node + var n1 Node + if nr.Addable { + goto irad + } + if nl.Addable { + Cgenr(nr, &n1, nil) + if !Isconst(nl, CTSTR) { + if Isfixedarray(nl.Type) { + Agenr(nl, &n3, res) + } else { + Igen(nl, &nlen, res) + freelen = 1 + nlen.Type = Types[Tptr] + nlen.Xoffset += int64(Array_array) + Regalloc(&n3, Types[Tptr], res) + Thearch.Gmove(&nlen, &n3) + nlen.Type = Types[Simtype[TUINT]] + nlen.Xoffset += int64(Array_nel) - int64(Array_array) + } + } + + goto index + } + + Tempname(&tmp, nr.Type) + Cgen(nr, &tmp) + nr = &tmp + + irad: + if !Isconst(nl, CTSTR) { + if Isfixedarray(nl.Type) { + Agenr(nl, &n3, res) + } else { + if !nl.Addable { + if res != nil && res.Op == OREGISTER { // give up res, which we don't need yet. + Regfree(res) + } + + // igen will need an addressable node. + var tmp2 Node + Tempname(&tmp2, nl.Type) + Cgen(nl, &tmp2) + nl = &tmp2 + + if res != nil && res.Op == OREGISTER { // reacquire res + Regrealloc(res) + } + } + + Igen(nl, &nlen, res) + freelen = 1 + nlen.Type = Types[Tptr] + nlen.Xoffset += int64(Array_array) + Regalloc(&n3, Types[Tptr], res) + Thearch.Gmove(&nlen, &n3) + nlen.Type = Types[Simtype[TUINT]] + nlen.Xoffset += int64(Array_nel) - int64(Array_array) + } + } + + if !Isconst(nr, CTINT) { + Cgenr(nr, &n1, nil) + } + + goto index + + // &a is in &n3 (allocated in res) + // i is in &n1 (if not constant) + // len(a) is in nlen (if needed) + // w is width + + // constant index + index: + if Isconst(nr, CTINT) { + if Isconst(nl, CTSTR) { + Fatal("constant string constant index") // front end should handle + } + v := uint64(Mpgetfix(nr.Val().U.(*Mpint))) + if Isslice(nl.Type) || nl.Type.Etype == TSTRING { + if Debug['B'] == 0 && !n.Bounded { + p1 := Thearch.Ginscmp(OGT, Types[Simtype[TUINT]], &nlen, Nodintconst(int64(v)), +1) + Ginscall(Panicindex, -1) + Patch(p1, Pc) + } + + Regfree(&nlen) + } + + if v*w != 0 { + Thearch.Ginscon(Thearch.Optoas(OADD, Types[Tptr]), int64(v*w), &n3) + } + *a = n3 + break + } + + // type of the index + t := Types[TUINT64] + + if Issigned[n1.Type.Etype] { + t = Types[TINT64] + } + + var n2 Node + Regalloc(&n2, t, &n1) // i + Thearch.Gmove(&n1, &n2) + Regfree(&n1) + + if Debug['B'] == 0 && !n.Bounded { + // check bounds + t = Types[Simtype[TUINT]] + + if Is64(nr.Type) { + t = Types[TUINT64] + } + if Isconst(nl, CTSTR) { + Nodconst(&nlen, t, int64(len(nl.Val().U.(string)))) + } else if Isslice(nl.Type) || nl.Type.Etype == TSTRING { + // nlen already initialized + } else { + Nodconst(&nlen, t, nl.Type.Bound) + } + + p1 := Thearch.Ginscmp(OLT, t, &n2, &nlen, +1) + Ginscall(Panicindex, -1) + Patch(p1, Pc) + } + + if Isconst(nl, CTSTR) { + Regalloc(&n3, Types[Tptr], res) + p1 := Thearch.Gins(Thearch.Optoas(OAS, n3.Type), nil, &n3) // XXX was LEAQ! + Datastring(nl.Val().U.(string), &p1.From) + p1.From.Type = obj.TYPE_ADDR + Thearch.Gins(Thearch.Optoas(OADD, n3.Type), &n2, &n3) + goto indexdone + } + + if w == 0 { + // nothing to do + } else if Thearch.AddIndex != nil && Thearch.AddIndex(&n2, int64(w), &n3) { + // done by back end + } else if w == 1 { + Thearch.Gins(Thearch.Optoas(OADD, Types[Tptr]), &n2, &n3) + } else { + if w&(w-1) == 0 { + // Power of 2. Use shift. + Thearch.Ginscon(Thearch.Optoas(OLSH, t), int64(log2(w)), &n2) + } else { + // Not a power of 2. Use multiply. + Thearch.Ginscon(Thearch.Optoas(OMUL, t), int64(w), &n2) + } + Thearch.Gins(Thearch.Optoas(OADD, Types[Tptr]), &n2, &n3) + } + + indexdone: + *a = n3 + Regfree(&n2) + if freelen != 0 { + Regfree(&nlen) + } + + default: + Regalloc(a, Types[Tptr], res) + Agen(n, a) + } +} + +// log2 returns the logarithm base 2 of n. n must be a power of 2. +func log2(n uint64) int { + x := 0 + for n>>uint(x) != 1 { + x++ + } + return x +} + +/* + * generate: + * res = &n; + * The generated code checks that the result is not nil. + */ +func Agen(n *Node, res *Node) { + if Debug['g'] != 0 { + Dump("\nagen-res", res) + Dump("agen-r", n) + } + + if n == nil || n.Type == nil { + return + } + + for n.Op == OCONVNOP { + n = n.Left + } + + if Isconst(n, CTNIL) && n.Type.Width > int64(Widthptr) { + // Use of a nil interface or nil slice. + // Create a temporary we can take the address of and read. + // The generated code is just going to panic, so it need not + // be terribly efficient. See issue 3670. + var n1 Node + Tempname(&n1, n.Type) + + Gvardef(&n1) + Thearch.Clearfat(&n1) + var n2 Node + Regalloc(&n2, Types[Tptr], res) + var n3 Node + n3.Op = OADDR + n3.Left = &n1 + Thearch.Gins(Thearch.Optoas(OAS, Types[Tptr]), &n3, &n2) + Thearch.Gmove(&n2, res) + Regfree(&n2) + return + } + + if n.Op == OINDREG && n.Xoffset == 0 { + // Generate MOVW R0, R1 instead of MOVW $0(R0), R1. + // This allows better move propagation in the back ends + // (and maybe it helps the processor). + n1 := *n + n1.Op = OREGISTER + n1.Type = res.Type + Thearch.Gmove(&n1, res) + return + } + + if n.Addable { + if n.Op == OREGISTER { + Fatal("agen OREGISTER") + } + var n1 Node + n1.Op = OADDR + n1.Left = n + var n2 Node + Regalloc(&n2, Types[Tptr], res) + Thearch.Gins(Thearch.Optoas(OAS, Types[Tptr]), &n1, &n2) + Thearch.Gmove(&n2, res) + Regfree(&n2) + return + } + + nl := n.Left + + switch n.Op { + default: + Fatal("agen: unknown op %v", Nconv(n, obj.FmtShort|obj.FmtSign)) + + case OCALLMETH: + cgen_callmeth(n, 0) + cgen_aret(n, res) + + case OCALLINTER: + cgen_callinter(n, res, 0) + cgen_aret(n, res) + + case OCALLFUNC: + cgen_call(n, 0) + cgen_aret(n, res) + + case OEFACE, ODOTTYPE, OSLICE, OSLICEARR, OSLICESTR, OSLICE3, OSLICE3ARR: + var n1 Node + Tempname(&n1, n.Type) + Cgen(n, &n1) + Agen(&n1, res) + + case OINDEX: + var n1 Node + Agenr(n, &n1, res) + Thearch.Gmove(&n1, res) + Regfree(&n1) + + case ONAME: + // should only get here with names in this func. + if n.Name.Funcdepth > 0 && n.Name.Funcdepth != Funcdepth { + Dump("bad agen", n) + Fatal("agen: bad ONAME funcdepth %d != %d", n.Name.Funcdepth, Funcdepth) + } + + // should only get here for heap vars or paramref + if n.Class&PHEAP == 0 && n.Class != PPARAMREF { + Dump("bad agen", n) + Fatal("agen: bad ONAME class %#x", n.Class) + } + + Cgen(n.Name.Heapaddr, res) + if n.Xoffset != 0 { + addOffset(res, n.Xoffset) + } + + case OIND: + Cgen(nl, res) + Cgen_checknil(res) + + case ODOT: + Agen(nl, res) + if n.Xoffset != 0 { + addOffset(res, n.Xoffset) + } + + case ODOTPTR: + Cgen(nl, res) + Cgen_checknil(res) + if n.Xoffset != 0 { + addOffset(res, n.Xoffset) + } + } +} + +func addOffset(res *Node, offset int64) { + if Ctxt.Arch.Thechar == '6' || Ctxt.Arch.Thechar == '8' { + Thearch.Gins(Thearch.Optoas(OADD, Types[Tptr]), Nodintconst(offset), res) + return + } + + var n1, n2 Node + Regalloc(&n1, Types[Tptr], nil) + Thearch.Gmove(res, &n1) + Regalloc(&n2, Types[Tptr], nil) + Thearch.Gins(Thearch.Optoas(OAS, Types[Tptr]), Nodintconst(offset), &n2) + Thearch.Gins(Thearch.Optoas(OADD, Types[Tptr]), &n2, &n1) + Thearch.Gmove(&n1, res) + Regfree(&n1) + Regfree(&n2) +} + +// Igen computes the address &n, stores it in a register r, +// and rewrites a to refer to *r. The chosen r may be the +// stack pointer, it may be borrowed from res, or it may +// be a newly allocated register. The caller must call Regfree(a) +// to free r when the address is no longer needed. +// The generated code ensures that &n is not nil. +func Igen(n *Node, a *Node, res *Node) { + if Debug['g'] != 0 { + Dump("\nigen-n", n) + } + + switch n.Op { + case ONAME: + if (n.Class&PHEAP != 0) || n.Class == PPARAMREF { + break + } + *a = *n + return + + case OINDREG: + // Increase the refcount of the register so that igen's caller + // has to call Regfree. + if n.Reg != int16(Thearch.REGSP) { + reg[n.Reg-int16(Thearch.REGMIN)]++ + } + *a = *n + return + + case ODOT: + Igen(n.Left, a, res) + a.Xoffset += n.Xoffset + a.Type = n.Type + Fixlargeoffset(a) + return + + case ODOTPTR: + Cgenr(n.Left, a, res) + Cgen_checknil(a) + a.Op = OINDREG + a.Xoffset += n.Xoffset + a.Type = n.Type + Fixlargeoffset(a) + return + + case OCALLFUNC, OCALLMETH, OCALLINTER: + switch n.Op { + case OCALLFUNC: + cgen_call(n, 0) + + case OCALLMETH: + cgen_callmeth(n, 0) + + case OCALLINTER: + cgen_callinter(n, nil, 0) + } + + var flist Iter + fp := Structfirst(&flist, Getoutarg(n.Left.Type)) + *a = Node{} + a.Op = OINDREG + a.Reg = int16(Thearch.REGSP) + a.Addable = true + a.Xoffset = fp.Width + if HasLinkRegister() { + a.Xoffset += int64(Ctxt.Arch.Ptrsize) + } + a.Type = n.Type + return + + // Index of fixed-size array by constant can + // put the offset in the addressing. + // Could do the same for slice except that we need + // to use the real index for the bounds checking. + case OINDEX: + if Isfixedarray(n.Left.Type) || (Isptr[n.Left.Type.Etype] && Isfixedarray(n.Left.Left.Type)) { + if Isconst(n.Right, CTINT) { + // Compute &a. + if !Isptr[n.Left.Type.Etype] { + Igen(n.Left, a, res) + } else { + var n1 Node + Igen(n.Left, &n1, res) + Cgen_checknil(&n1) + Regalloc(a, Types[Tptr], res) + Thearch.Gmove(&n1, a) + Regfree(&n1) + a.Op = OINDREG + } + + // Compute &a[i] as &a + i*width. + a.Type = n.Type + + a.Xoffset += Mpgetfix(n.Right.Val().U.(*Mpint)) * n.Type.Width + Fixlargeoffset(a) + return + } + } + } + + Agenr(n, a, res) + a.Op = OINDREG + a.Type = n.Type +} + +// Bgen generates code for branches: +// +// if n == wantTrue { +// goto to +// } +func Bgen(n *Node, wantTrue bool, likely int, to *obj.Prog) { + bgenx(n, nil, wantTrue, likely, to) +} + +// Bvgen generates code for calculating boolean values: +// res = n == wantTrue +func Bvgen(n, res *Node, wantTrue bool) { + if Thearch.Ginsboolval == nil { + // Direct value generation not implemented for this architecture. + // Implement using jumps. + bvgenjump(n, res, wantTrue, true) + return + } + bgenx(n, res, wantTrue, 0, nil) +} + +// bvgenjump implements boolean value generation using jumps: +// if n == wantTrue { +// res = 1 +// } else { +// res = 0 +// } +// geninit controls whether n's Ninit is generated. +func bvgenjump(n, res *Node, wantTrue, geninit bool) { + init := n.Ninit + if !geninit { + n.Ninit = nil + } + p1 := Gbranch(obj.AJMP, nil, 0) + p2 := Pc + Thearch.Gmove(Nodbool(true), res) + p3 := Gbranch(obj.AJMP, nil, 0) + Patch(p1, Pc) + Bgen(n, wantTrue, 0, p2) + Thearch.Gmove(Nodbool(false), res) + Patch(p3, Pc) + n.Ninit = init +} + +// bgenx is the backend for Bgen and Bvgen. +// If res is nil, it generates a branch. +// Otherwise, it generates a boolean value. +func bgenx(n, res *Node, wantTrue bool, likely int, to *obj.Prog) { + if Debug['g'] != 0 { + fmt.Printf("\nbgenx wantTrue=%t likely=%d to=%v\n", wantTrue, likely, to) + Dump("n", n) + Dump("res", res) + } + + genval := res != nil + + if n == nil { + n = Nodbool(true) + } + + Genlist(n.Ninit) + + if n.Type == nil { + Convlit(&n, Types[TBOOL]) + if n.Type == nil { + return + } + } + + if n.Type.Etype != TBOOL { + Fatal("bgen: bad type %v for %v", n.Type, Oconv(int(n.Op), 0)) + } + + for n.Op == OCONVNOP { + n = n.Left + Genlist(n.Ninit) + } + + if Thearch.Bgen_float != nil && n.Left != nil && Isfloat[n.Left.Type.Etype] { + if genval { + bvgenjump(n, res, wantTrue, false) + return + } + Thearch.Bgen_float(n, wantTrue, likely, to) + return + } + + switch n.Op { + default: + if genval { + Cgen(n, res) + if !wantTrue { + Thearch.Gins(Thearch.Optoas(OXOR, Types[TUINT8]), Nodintconst(1), res) + } + return + } + + var tmp Node + Regalloc(&tmp, n.Type, nil) + Cgen(n, &tmp) + bgenNonZero(&tmp, nil, wantTrue, likely, to) + Regfree(&tmp) + return + + case ONAME: + if genval { + // 5g, 7g, and 9g might need a temporary or other help here, + // but they don't support direct generation of a bool value yet. + // We can fix that as we go. + switch Ctxt.Arch.Thechar { + case '5', '7', '9': + Fatal("genval 5g, 7g, 9g ONAMES not fully implemented") + } + Cgen(n, res) + if !wantTrue { + Thearch.Gins(Thearch.Optoas(OXOR, Types[TUINT8]), Nodintconst(1), res) + } + return + } + + if n.Addable && Ctxt.Arch.Thechar != '5' && Ctxt.Arch.Thechar != '7' && Ctxt.Arch.Thechar != '9' { + // no need for a temporary + bgenNonZero(n, nil, wantTrue, likely, to) + return + } + var tmp Node + Regalloc(&tmp, n.Type, nil) + Cgen(n, &tmp) + bgenNonZero(&tmp, nil, wantTrue, likely, to) + Regfree(&tmp) + return + + case OLITERAL: + // n is a constant. + if !Isconst(n, CTBOOL) { + Fatal("bgen: non-bool const %v\n", Nconv(n, obj.FmtLong)) + } + if genval { + Cgen(Nodbool(wantTrue == n.Val().U.(bool)), res) + return + } + // If n == wantTrue, jump; otherwise do nothing. + if wantTrue == n.Val().U.(bool) { + Patch(Gbranch(obj.AJMP, nil, likely), to) + } + return + + case OANDAND, OOROR: + and := (n.Op == OANDAND) == wantTrue + if genval { + p1 := Gbranch(obj.AJMP, nil, 0) + p2 := Gbranch(obj.AJMP, nil, 0) + Patch(p2, Pc) + Cgen(Nodbool(!and), res) + p3 := Gbranch(obj.AJMP, nil, 0) + Patch(p1, Pc) + Bgen(n.Left, wantTrue != and, 0, p2) + Bvgen(n.Right, res, wantTrue) + Patch(p3, Pc) + return + } + + if and { + p1 := Gbranch(obj.AJMP, nil, 0) + p2 := Gbranch(obj.AJMP, nil, 0) + Patch(p1, Pc) + Bgen(n.Left, !wantTrue, -likely, p2) + Bgen(n.Right, !wantTrue, -likely, p2) + p1 = Gbranch(obj.AJMP, nil, 0) + Patch(p1, to) + Patch(p2, Pc) + } else { + Bgen(n.Left, wantTrue, likely, to) + Bgen(n.Right, wantTrue, likely, to) + } + return + + case ONOT: // unary + if n.Left == nil || n.Left.Type == nil { + return + } + bgenx(n.Left, res, !wantTrue, likely, to) + return + + case OEQ, ONE, OLT, OGT, OLE, OGE: + if n.Left == nil || n.Left.Type == nil || n.Right == nil || n.Right.Type == nil { + return + } + } + + // n.Op is one of OEQ, ONE, OLT, OGT, OLE, OGE + nl := n.Left + nr := n.Right + a := int(n.Op) + + if !wantTrue { + if Isfloat[nr.Type.Etype] { + // Brcom is not valid on floats when NaN is involved. + ll := n.Ninit // avoid re-genning Ninit + n.Ninit = nil + if genval { + bgenx(n, res, true, likely, to) + Thearch.Gins(Thearch.Optoas(OXOR, Types[TUINT8]), Nodintconst(1), res) // res = !res + n.Ninit = ll + return + } + p1 := Gbranch(obj.AJMP, nil, 0) + p2 := Gbranch(obj.AJMP, nil, 0) + Patch(p1, Pc) + bgenx(n, res, true, -likely, p2) + Patch(Gbranch(obj.AJMP, nil, 0), to) + Patch(p2, Pc) + n.Ninit = ll + return + } + + a = Brcom(a) + } + wantTrue = true + + // make simplest on right + if nl.Op == OLITERAL || (nl.Ullman < nr.Ullman && nl.Ullman < UINF) { + a = Brrev(a) + nl, nr = nr, nl + } + + if Isslice(nl.Type) || Isinter(nl.Type) { + // front end should only leave cmp to literal nil + if (a != OEQ && a != ONE) || nr.Op != OLITERAL { + if Isslice(nl.Type) { + Yyerror("illegal slice comparison") + } else { + Yyerror("illegal interface comparison") + } + return + } + + var ptr Node + Igen(nl, &ptr, nil) + if Isslice(nl.Type) { + ptr.Xoffset += int64(Array_array) + } + ptr.Type = Types[Tptr] + var tmp Node + Regalloc(&tmp, ptr.Type, &ptr) + Cgen(&ptr, &tmp) + Regfree(&ptr) + bgenNonZero(&tmp, res, a == OEQ != wantTrue, likely, to) + Regfree(&tmp) + return + } + + if Iscomplex[nl.Type.Etype] { + complexbool(a, nl, nr, res, wantTrue, likely, to) + return + } + + if Ctxt.Arch.Regsize == 4 && Is64(nr.Type) { + if genval { + // TODO: Teach Cmp64 to generate boolean values and remove this. + bvgenjump(n, res, wantTrue, false) + return + } + if !nl.Addable || Isconst(nl, CTINT) { + nl = CgenTemp(nl) + } + if !nr.Addable { + nr = CgenTemp(nr) + } + Thearch.Cmp64(nl, nr, a, likely, to) + return + } + + if nr.Ullman >= UINF { + var n1 Node + Regalloc(&n1, nl.Type, nil) + Cgen(nl, &n1) + nl = &n1 + + var tmp Node + Tempname(&tmp, nl.Type) + Thearch.Gmove(&n1, &tmp) + Regfree(&n1) + + var n2 Node + Regalloc(&n2, nr.Type, nil) + Cgen(nr, &n2) + nr = &n2 + + Regalloc(&n1, nl.Type, nil) + Cgen(&tmp, &n1) + Regfree(&n1) + Regfree(&n2) + } else { + var n1 Node + if !nl.Addable && Ctxt.Arch.Thechar == '8' { + Tempname(&n1, nl.Type) + } else { + Regalloc(&n1, nl.Type, nil) + defer Regfree(&n1) + } + Cgen(nl, &n1) + nl = &n1 + + if Smallintconst(nr) && Ctxt.Arch.Thechar != '9' { + Thearch.Gins(Thearch.Optoas(OCMP, nr.Type), nl, nr) + bins(nr.Type, res, a, likely, to) + return + } + + if !nr.Addable && Ctxt.Arch.Thechar == '8' { + nr = CgenTemp(nr) + } + + var n2 Node + Regalloc(&n2, nr.Type, nil) + Cgen(nr, &n2) + nr = &n2 + Regfree(&n2) + } + + l, r := nl, nr + + // On x86, only < and <= work right with NaN; reverse if needed + if Ctxt.Arch.Thechar == '6' && Isfloat[nl.Type.Etype] && (a == OGT || a == OGE) { + l, r = r, l + a = Brrev(a) + } + + // Do the comparison. + Thearch.Gins(Thearch.Optoas(OCMP, nr.Type), l, r) + + // Handle floating point special cases. + // Note that 8g has Bgen_float and is handled above. + if Isfloat[nl.Type.Etype] { + switch Ctxt.Arch.Thechar { + case '5': + if genval { + Fatal("genval 5g Isfloat special cases not implemented") + } + switch n.Op { + case ONE: + Patch(Gbranch(Thearch.Optoas(OPS, nr.Type), nr.Type, likely), to) + Patch(Gbranch(Thearch.Optoas(a, nr.Type), nr.Type, likely), to) + default: + p := Gbranch(Thearch.Optoas(OPS, nr.Type), nr.Type, -likely) + Patch(Gbranch(Thearch.Optoas(a, nr.Type), nr.Type, likely), to) + Patch(p, Pc) + } + return + case '6': + switch n.Op { + case OEQ: + // neither NE nor P + if genval { + var reg Node + Regalloc(®, Types[TBOOL], nil) + Thearch.Ginsboolval(Thearch.Optoas(OEQ, nr.Type), ®) + Thearch.Ginsboolval(Thearch.Optoas(OPC, nr.Type), res) + Thearch.Gins(Thearch.Optoas(OAND, Types[TBOOL]), ®, res) + Regfree(®) + } else { + p1 := Gbranch(Thearch.Optoas(ONE, nr.Type), nil, -likely) + p2 := Gbranch(Thearch.Optoas(OPS, nr.Type), nil, -likely) + Patch(Gbranch(obj.AJMP, nil, 0), to) + Patch(p1, Pc) + Patch(p2, Pc) + } + return + case ONE: + // either NE or P + if genval { + var reg Node + Regalloc(®, Types[TBOOL], nil) + Thearch.Ginsboolval(Thearch.Optoas(ONE, nr.Type), ®) + Thearch.Ginsboolval(Thearch.Optoas(OPS, nr.Type), res) + Thearch.Gins(Thearch.Optoas(OOR, Types[TBOOL]), ®, res) + Regfree(®) + } else { + Patch(Gbranch(Thearch.Optoas(ONE, nr.Type), nil, likely), to) + Patch(Gbranch(Thearch.Optoas(OPS, nr.Type), nil, likely), to) + } + return + } + case '7', '9': + if genval { + Fatal("genval 7g, 9g Isfloat special cases not implemented") + } + switch n.Op { + // On arm64 and ppc64, <= and >= mishandle NaN. Must decompose into < or > and =. + // TODO(josh): Convert a <= b to b > a instead? + case OLE, OGE: + if a == OLE { + a = OLT + } else { + a = OGT + } + Patch(Gbranch(Thearch.Optoas(a, nr.Type), nr.Type, likely), to) + Patch(Gbranch(Thearch.Optoas(OEQ, nr.Type), nr.Type, likely), to) + return + } + } + } + + // Not a special case. Insert the conditional jump or value gen. + bins(nr.Type, res, a, likely, to) +} + +func bgenNonZero(n, res *Node, wantTrue bool, likely int, to *obj.Prog) { + // TODO: Optimize on systems that can compare to zero easily. + a := ONE + if !wantTrue { + a = OEQ + } + var zero Node + Nodconst(&zero, n.Type, 0) + Thearch.Gins(Thearch.Optoas(OCMP, n.Type), n, &zero) + bins(n.Type, res, a, likely, to) +} + +// bins inserts an instruction to handle the result of a compare. +// If res is non-nil, it inserts appropriate value generation instructions. +// If res is nil, it inserts a branch to to. +func bins(typ *Type, res *Node, a, likely int, to *obj.Prog) { + a = Thearch.Optoas(a, typ) + if res != nil { + // value gen + Thearch.Ginsboolval(a, res) + } else { + // jump + Patch(Gbranch(a, typ, likely), to) + } +} + +// stkof returns n's offset from SP if n is on the stack +// (either a local variable or the return value from a function call +// or the arguments to a function call). +// If n is not on the stack, stkof returns -1000. +// If n is on the stack but in an unknown location +// (due to array index arithmetic), stkof returns +1000. +// +// NOTE(rsc): It is possible that the ODOT and OINDEX cases +// are not relevant here, since it shouldn't be possible for them +// to be involved in an overlapping copy. Only function results +// from one call and the arguments to the next can overlap in +// any non-trivial way. If they can be dropped, then this function +// becomes much simpler and also more trustworthy. +// The fact that it works at all today is probably due to the fact +// that ODOT and OINDEX are irrelevant. +func stkof(n *Node) int64 { + switch n.Op { + case OINDREG: + if n.Reg != int16(Thearch.REGSP) { + return -1000 // not on stack + } + return n.Xoffset + + case ODOT: + t := n.Left.Type + if Isptr[t.Etype] { + break + } + off := stkof(n.Left) + if off == -1000 || off == +1000 { + return off + } + return off + n.Xoffset + + case OINDEX: + t := n.Left.Type + if !Isfixedarray(t) { + break + } + off := stkof(n.Left) + if off == -1000 || off == +1000 { + return off + } + if Isconst(n.Right, CTINT) { + return off + t.Type.Width*Mpgetfix(n.Right.Val().U.(*Mpint)) + } + return +1000 // on stack but not sure exactly where + + case OCALLMETH, OCALLINTER, OCALLFUNC: + t := n.Left.Type + if Isptr[t.Etype] { + t = t.Type + } + + var flist Iter + t = Structfirst(&flist, Getoutarg(t)) + if t != nil { + w := t.Width + if HasLinkRegister() { + w += int64(Ctxt.Arch.Ptrsize) + } + return w + } + } + + // botch - probably failing to recognize address + // arithmetic on the above. eg INDEX and DOT + return -1000 // not on stack +} + +/* + * block copy: + * memmove(&ns, &n, w); + * if wb is true, needs write barrier. + */ +func sgen_wb(n *Node, ns *Node, w int64, wb bool) { + if Debug['g'] != 0 { + op := "sgen" + if wb { + op = "sgen-wb" + } + fmt.Printf("\n%s w=%d\n", op, w) + Dump("r", n) + Dump("res", ns) + } + + if n.Ullman >= UINF && ns.Ullman >= UINF { + Fatal("sgen UINF") + } + + if w < 0 { + Fatal("sgen copy %d", w) + } + + // If copying .args, that's all the results, so record definition sites + // for them for the liveness analysis. + if ns.Op == ONAME && ns.Sym.Name == ".args" { + for l := Curfn.Func.Dcl; l != nil; l = l.Next { + if l.N.Class == PPARAMOUT { + Gvardef(l.N) + } + } + } + + // Avoid taking the address for simple enough types. + if componentgen_wb(n, ns, wb) { + return + } + + if w == 0 { + // evaluate side effects only + var nodr Node + Regalloc(&nodr, Types[Tptr], nil) + Agen(ns, &nodr) + Agen(n, &nodr) + Regfree(&nodr) + return + } + + // offset on the stack + osrc := stkof(n) + odst := stkof(ns) + + if odst != -1000 { + // on stack, write barrier not needed after all + wb = false + } + + if osrc != -1000 && odst != -1000 && (osrc == 1000 || odst == 1000) || wb && osrc != -1000 { + // osrc and odst both on stack, and at least one is in + // an unknown position. Could generate code to test + // for forward/backward copy, but instead just copy + // to a temporary location first. + // + // OR: write barrier needed and source is on stack. + // Invoking the write barrier will use the stack to prepare its call. + // Copy to temporary. + var tmp Node + Tempname(&tmp, n.Type) + sgen_wb(n, &tmp, w, false) + sgen_wb(&tmp, ns, w, wb) + return + } + + if wb { + cgen_wbfat(n, ns) + return + } + + Thearch.Blockcopy(n, ns, osrc, odst, w) +} + +/* + * generate: + * call f + * proc=-1 normal call but no return + * proc=0 normal call + * proc=1 goroutine run in new proc + * proc=2 defer call save away stack + * proc=3 normal call to C pointer (not Go func value) +*/ +func Ginscall(f *Node, proc int) { + if f.Type != nil { + extra := int32(0) + if proc == 1 || proc == 2 { + extra = 2 * int32(Widthptr) + } + Setmaxarg(f.Type, extra) + } + + switch proc { + default: + Fatal("Ginscall: bad proc %d", proc) + + case 0, // normal call + -1: // normal call but no return + if f.Op == ONAME && f.Class == PFUNC { + if f == Deferreturn { + // Deferred calls will appear to be returning to + // the CALL deferreturn(SB) that we are about to emit. + // However, the stack trace code will show the line + // of the instruction byte before the return PC. + // To avoid that being an unrelated instruction, + // insert an actual hardware NOP that will have the right line number. + // This is different from obj.ANOP, which is a virtual no-op + // that doesn't make it into the instruction stream. + Thearch.Ginsnop() + } + + p := Thearch.Gins(obj.ACALL, nil, f) + Afunclit(&p.To, f) + if proc == -1 || Noreturn(p) { + Thearch.Gins(obj.AUNDEF, nil, nil) + } + break + } + + var reg Node + Nodreg(®, Types[Tptr], Thearch.REGCTXT) + var r1 Node + Nodreg(&r1, Types[Tptr], Thearch.REGCALLX) + Thearch.Gmove(f, ®) + reg.Op = OINDREG + Thearch.Gmove(®, &r1) + reg.Op = OREGISTER + Thearch.Gins(obj.ACALL, ®, &r1) + + case 3: // normal call of c function pointer + Thearch.Gins(obj.ACALL, nil, f) + + case 1, // call in new proc (go) + 2: // deferred call (defer) + var stk Node + + // size of arguments at 0(SP) + stk.Op = OINDREG + stk.Reg = int16(Thearch.REGSP) + stk.Xoffset = 0 + if HasLinkRegister() { + stk.Xoffset += int64(Ctxt.Arch.Ptrsize) + } + Thearch.Ginscon(Thearch.Optoas(OAS, Types[TINT32]), int64(Argsize(f.Type)), &stk) + + // FuncVal* at 8(SP) + stk.Xoffset = int64(Widthptr) + if HasLinkRegister() { + stk.Xoffset += int64(Ctxt.Arch.Ptrsize) + } + + var reg Node + Nodreg(®, Types[Tptr], Thearch.REGCALLX2) + Thearch.Gmove(f, ®) + Thearch.Gins(Thearch.Optoas(OAS, Types[Tptr]), ®, &stk) + + if proc == 1 { + Ginscall(Newproc, 0) + } else { + if Hasdefer == 0 { + Fatal("hasdefer=0 but has defer") + } + Ginscall(Deferproc, 0) + } + + if proc == 2 { + Nodreg(®, Types[TINT32], Thearch.REGRETURN) + p := Thearch.Ginscmp(OEQ, Types[TINT32], ®, Nodintconst(0), +1) + cgen_ret(nil) + Patch(p, Pc) + } + } +} + +/* + * n is call to interface method. + * generate res = n. + */ +func cgen_callinter(n *Node, res *Node, proc int) { + i := n.Left + if i.Op != ODOTINTER { + Fatal("cgen_callinter: not ODOTINTER %v", Oconv(int(i.Op), 0)) + } + + f := i.Right // field + if f.Op != ONAME { + Fatal("cgen_callinter: not ONAME %v", Oconv(int(f.Op), 0)) + } + + i = i.Left // interface + + if !i.Addable { + var tmpi Node + Tempname(&tmpi, i.Type) + Cgen(i, &tmpi) + i = &tmpi + } + + Genlist(n.List) // assign the args + + // i is now addable, prepare an indirected + // register to hold its address. + var nodi Node + Igen(i, &nodi, res) // REG = &inter + + var nodsp Node + Nodindreg(&nodsp, Types[Tptr], Thearch.REGSP) + nodsp.Xoffset = 0 + if HasLinkRegister() { + nodsp.Xoffset += int64(Ctxt.Arch.Ptrsize) + } + if proc != 0 { + nodsp.Xoffset += 2 * int64(Widthptr) // leave room for size & fn + } + nodi.Type = Types[Tptr] + nodi.Xoffset += int64(Widthptr) + Cgen(&nodi, &nodsp) // {0, 8(nacl), or 16}(SP) = 8(REG) -- i.data + + var nodo Node + Regalloc(&nodo, Types[Tptr], res) + + nodi.Type = Types[Tptr] + nodi.Xoffset -= int64(Widthptr) + Cgen(&nodi, &nodo) // REG = 0(REG) -- i.tab + Regfree(&nodi) + + var nodr Node + Regalloc(&nodr, Types[Tptr], &nodo) + if n.Left.Xoffset == BADWIDTH { + Fatal("cgen_callinter: badwidth") + } + Cgen_checknil(&nodo) // in case offset is huge + nodo.Op = OINDREG + nodo.Xoffset = n.Left.Xoffset + 3*int64(Widthptr) + 8 + if proc == 0 { + // plain call: use direct c function pointer - more efficient + Cgen(&nodo, &nodr) // REG = 32+offset(REG) -- i.tab->fun[f] + proc = 3 + } else { + // go/defer. generate go func value. + Agen(&nodo, &nodr) // REG = &(32+offset(REG)) -- i.tab->fun[f] + } + + nodr.Type = n.Left.Type + Ginscall(&nodr, proc) + + Regfree(&nodr) + Regfree(&nodo) +} + +/* + * generate function call; + * proc=0 normal call + * proc=1 goroutine run in new proc + * proc=2 defer call save away stack + */ +func cgen_call(n *Node, proc int) { + if n == nil { + return + } + + var afun Node + if n.Left.Ullman >= UINF { + // if name involves a fn call + // precompute the address of the fn + Tempname(&afun, Types[Tptr]) + + Cgen(n.Left, &afun) + } + + Genlist(n.List) // assign the args + t := n.Left.Type + + // call tempname pointer + if n.Left.Ullman >= UINF { + var nod Node + Regalloc(&nod, Types[Tptr], nil) + Cgen_as(&nod, &afun) + nod.Type = t + Ginscall(&nod, proc) + Regfree(&nod) + return + } + + // call pointer + if n.Left.Op != ONAME || n.Left.Class != PFUNC { + var nod Node + Regalloc(&nod, Types[Tptr], nil) + Cgen_as(&nod, n.Left) + nod.Type = t + Ginscall(&nod, proc) + Regfree(&nod) + return + } + + // call direct + n.Left.Name.Method = true + + Ginscall(n.Left, proc) +} + +func HasLinkRegister() bool { + c := Ctxt.Arch.Thechar + return c != '6' && c != '8' +} + +/* + * call to n has already been generated. + * generate: + * res = return value from call. + */ +func cgen_callret(n *Node, res *Node) { + t := n.Left.Type + if t.Etype == TPTR32 || t.Etype == TPTR64 { + t = t.Type + } + + var flist Iter + fp := Structfirst(&flist, Getoutarg(t)) + if fp == nil { + Fatal("cgen_callret: nil") + } + + var nod Node + nod.Op = OINDREG + nod.Reg = int16(Thearch.REGSP) + nod.Addable = true + + nod.Xoffset = fp.Width + if HasLinkRegister() { + nod.Xoffset += int64(Ctxt.Arch.Ptrsize) + } + nod.Type = fp.Type + Cgen_as(res, &nod) +} + +/* + * call to n has already been generated. + * generate: + * res = &return value from call. + */ +func cgen_aret(n *Node, res *Node) { + t := n.Left.Type + if Isptr[t.Etype] { + t = t.Type + } + + var flist Iter + fp := Structfirst(&flist, Getoutarg(t)) + if fp == nil { + Fatal("cgen_aret: nil") + } + + var nod1 Node + nod1.Op = OINDREG + nod1.Reg = int16(Thearch.REGSP) + nod1.Addable = true + nod1.Xoffset = fp.Width + if HasLinkRegister() { + nod1.Xoffset += int64(Ctxt.Arch.Ptrsize) + } + nod1.Type = fp.Type + + if res.Op != OREGISTER { + var nod2 Node + Regalloc(&nod2, Types[Tptr], res) + Agen(&nod1, &nod2) + Thearch.Gins(Thearch.Optoas(OAS, Types[Tptr]), &nod2, res) + Regfree(&nod2) + } else { + Agen(&nod1, res) + } +} + +/* + * generate return. + * n->left is assignments to return values. + */ +func cgen_ret(n *Node) { + if n != nil { + Genlist(n.List) // copy out args + } + if Hasdefer != 0 { + Ginscall(Deferreturn, 0) + } + Genlist(Curfn.Func.Exit) + p := Thearch.Gins(obj.ARET, nil, nil) + if n != nil && n.Op == ORETJMP { + p.To.Type = obj.TYPE_MEM + p.To.Name = obj.NAME_EXTERN + p.To.Sym = Linksym(n.Left.Sym) + } +} + +/* + * generate division according to op, one of: + * res = nl / nr + * res = nl % nr + */ +func cgen_div(op int, nl *Node, nr *Node, res *Node) { + var w int + + // TODO(rsc): arm64 needs to support the relevant instructions + // in peep and optoas in order to enable this. + // TODO(rsc): ppc64 needs to support the relevant instructions + // in peep and optoas in order to enable this. + if nr.Op != OLITERAL || Ctxt.Arch.Thechar == '7' || Ctxt.Arch.Thechar == '9' { + goto longdiv + } + w = int(nl.Type.Width * 8) + + // Front end handled 32-bit division. We only need to handle 64-bit. + // try to do division by multiply by (2^w)/d + // see hacker's delight chapter 10 + switch Simtype[nl.Type.Etype] { + default: + goto longdiv + + case TUINT64: + var m Magic + m.W = w + m.Ud = uint64(Mpgetfix(nr.Val().U.(*Mpint))) + Umagic(&m) + if m.Bad != 0 { + break + } + if op == OMOD { + goto longmod + } + + var n1 Node + Cgenr(nl, &n1, nil) + var n2 Node + Nodconst(&n2, nl.Type, int64(m.Um)) + var n3 Node + Regalloc(&n3, nl.Type, res) + Thearch.Cgen_hmul(&n1, &n2, &n3) + + if m.Ua != 0 { + // need to add numerator accounting for overflow + Thearch.Gins(Thearch.Optoas(OADD, nl.Type), &n1, &n3) + + Nodconst(&n2, nl.Type, 1) + Thearch.Gins(Thearch.Optoas(ORROTC, nl.Type), &n2, &n3) + Nodconst(&n2, nl.Type, int64(m.S)-1) + Thearch.Gins(Thearch.Optoas(ORSH, nl.Type), &n2, &n3) + } else { + Nodconst(&n2, nl.Type, int64(m.S)) + Thearch.Gins(Thearch.Optoas(ORSH, nl.Type), &n2, &n3) // shift dx + } + + Thearch.Gmove(&n3, res) + Regfree(&n1) + Regfree(&n3) + return + + case TINT64: + var m Magic + m.W = w + m.Sd = Mpgetfix(nr.Val().U.(*Mpint)) + Smagic(&m) + if m.Bad != 0 { + break + } + if op == OMOD { + goto longmod + } + + var n1 Node + Cgenr(nl, &n1, res) + var n2 Node + Nodconst(&n2, nl.Type, m.Sm) + var n3 Node + Regalloc(&n3, nl.Type, nil) + Thearch.Cgen_hmul(&n1, &n2, &n3) + + if m.Sm < 0 { + // need to add numerator + Thearch.Gins(Thearch.Optoas(OADD, nl.Type), &n1, &n3) + } + + Nodconst(&n2, nl.Type, int64(m.S)) + Thearch.Gins(Thearch.Optoas(ORSH, nl.Type), &n2, &n3) // shift n3 + + Nodconst(&n2, nl.Type, int64(w)-1) + + Thearch.Gins(Thearch.Optoas(ORSH, nl.Type), &n2, &n1) // -1 iff num is neg + Thearch.Gins(Thearch.Optoas(OSUB, nl.Type), &n1, &n3) // added + + if m.Sd < 0 { + // this could probably be removed + // by factoring it into the multiplier + Thearch.Gins(Thearch.Optoas(OMINUS, nl.Type), nil, &n3) + } + + Thearch.Gmove(&n3, res) + Regfree(&n1) + Regfree(&n3) + return + } + + goto longdiv + + // division and mod using (slow) hardware instruction +longdiv: + Thearch.Dodiv(op, nl, nr, res) + + return + + // mod using formula A%B = A-(A/B*B) but + // we know that there is a fast algorithm for A/B +longmod: + var n1 Node + Regalloc(&n1, nl.Type, res) + + Cgen(nl, &n1) + var n2 Node + Regalloc(&n2, nl.Type, nil) + cgen_div(ODIV, &n1, nr, &n2) + a := Thearch.Optoas(OMUL, nl.Type) + if w == 8 { + // use 2-operand 16-bit multiply + // because there is no 2-operand 8-bit multiply + a = Thearch.Optoas(OMUL, Types[TINT16]) // XXX was IMULW + } + + if !Smallintconst(nr) { + var n3 Node + Regalloc(&n3, nl.Type, nil) + Cgen(nr, &n3) + Thearch.Gins(a, &n3, &n2) + Regfree(&n3) + } else { + Thearch.Gins(a, nr, &n2) + } + Thearch.Gins(Thearch.Optoas(OSUB, nl.Type), &n2, &n1) + Thearch.Gmove(&n1, res) + Regfree(&n1) + Regfree(&n2) +} + +func Fixlargeoffset(n *Node) { + if n == nil { + return + } + if n.Op != OINDREG { + return + } + if n.Reg == int16(Thearch.REGSP) { // stack offset cannot be large + return + } + if n.Xoffset != int64(int32(n.Xoffset)) { + // offset too large, add to register instead. + a := *n + + a.Op = OREGISTER + a.Type = Types[Tptr] + a.Xoffset = 0 + Cgen_checknil(&a) + Thearch.Ginscon(Thearch.Optoas(OADD, Types[Tptr]), n.Xoffset, &a) + n.Xoffset = 0 + } +} + +func cgen_append(n, res *Node) { + if Debug['g'] != 0 { + Dump("cgen_append-n", n) + Dump("cgen_append-res", res) + } + if res.Op != ONAME && !samesafeexpr(res, n.List.N) { + Dump("cgen_append-n", n) + Dump("cgen_append-res", res) + Fatal("append not lowered") + } + for l := n.List; l != nil; l = l.Next { + if l.N.Ullman >= UINF { + Fatal("append with function call arguments") + } + } + + // res = append(src, x, y, z) + // + // If res and src are the same, we can avoid writing to base and cap + // unless we grow the underlying array. + needFullUpdate := !samesafeexpr(res, n.List.N) + + // Copy src triple into base, len, cap. + base := temp(Types[Tptr]) + len := temp(Types[TUINT]) + cap := temp(Types[TUINT]) + + var src Node + Igen(n.List.N, &src, nil) + src.Type = Types[Tptr] + Thearch.Gmove(&src, base) + src.Type = Types[TUINT] + src.Xoffset += int64(Widthptr) + Thearch.Gmove(&src, len) + src.Xoffset += int64(Widthptr) + Thearch.Gmove(&src, cap) + + // if len+argc <= cap goto L1 + var rlen Node + Regalloc(&rlen, Types[TUINT], nil) + Thearch.Gmove(len, &rlen) + Thearch.Ginscon(Thearch.Optoas(OADD, Types[TUINT]), int64(count(n.List)-1), &rlen) + p := Thearch.Ginscmp(OLE, Types[TUINT], &rlen, cap, +1) + // Note: rlen and src are Regrealloc'ed below at the target of the + // branch we just emitted; do not reuse these Go variables for + // other purposes. They need to still describe the same things + // below that they describe right here. + Regfree(&src) + + // base, len, cap = growslice(type, base, len, cap, newlen) + var arg Node + arg.Op = OINDREG + arg.Reg = int16(Thearch.REGSP) + arg.Addable = true + arg.Xoffset = 0 + if HasLinkRegister() { + arg.Xoffset = int64(Ctxt.Arch.Ptrsize) + } + arg.Type = Ptrto(Types[TUINT8]) + Cgen(typename(res.Type), &arg) + arg.Xoffset += int64(Widthptr) + + arg.Type = Types[Tptr] + Cgen(base, &arg) + arg.Xoffset += int64(Widthptr) + + arg.Type = Types[TUINT] + Cgen(len, &arg) + arg.Xoffset += int64(Widthptr) + + arg.Type = Types[TUINT] + Cgen(cap, &arg) + arg.Xoffset += int64(Widthptr) + + arg.Type = Types[TUINT] + Cgen(&rlen, &arg) + arg.Xoffset += int64(Widthptr) + Regfree(&rlen) + + fn := syslook("growslice", 1) + substArgTypes(fn, res.Type.Type, res.Type.Type) + Ginscall(fn, 0) + + if Widthptr == 4 && Widthreg == 8 { + arg.Xoffset += 4 + } + + arg.Type = Types[Tptr] + Cgen(&arg, base) + arg.Xoffset += int64(Widthptr) + + arg.Type = Types[TUINT] + Cgen(&arg, len) + arg.Xoffset += int64(Widthptr) + + arg.Type = Types[TUINT] + Cgen(&arg, cap) + + // Update res with base, len+argc, cap. + if needFullUpdate { + if Debug_append > 0 { + Warn("append: full update") + } + Patch(p, Pc) + } + if res.Op == ONAME { + Gvardef(res) + } + var dst, r1 Node + Igen(res, &dst, nil) + dst.Type = Types[TUINT] + dst.Xoffset += int64(Widthptr) + Regalloc(&r1, Types[TUINT], nil) + Thearch.Gmove(len, &r1) + Thearch.Ginscon(Thearch.Optoas(OADD, Types[TUINT]), int64(count(n.List)-1), &r1) + Thearch.Gmove(&r1, &dst) + Regfree(&r1) + dst.Xoffset += int64(Widthptr) + Thearch.Gmove(cap, &dst) + dst.Type = Types[Tptr] + dst.Xoffset -= 2 * int64(Widthptr) + cgen_wb(base, &dst, needwritebarrier(&dst, base)) + Regfree(&dst) + + if !needFullUpdate { + if Debug_append > 0 { + Warn("append: len-only update") + } + // goto L2; + // L1: + // update len only + // L2: + q := Gbranch(obj.AJMP, nil, 0) + Patch(p, Pc) + // At the goto above, src refers to cap and rlen holds the new len + if src.Op == OREGISTER || src.Op == OINDREG { + Regrealloc(&src) + } + Regrealloc(&rlen) + src.Xoffset -= int64(Widthptr) + Thearch.Gmove(&rlen, &src) + Regfree(&src) + Regfree(&rlen) + Patch(q, Pc) + } + + // Copy data into place. + // Could do write barrier check around entire copy instead of each element. + // Could avoid reloading registers on each iteration if we know the cgen_wb + // is not going to use a write barrier. + i := 0 + var r2 Node + for l := n.List.Next; l != nil; l = l.Next { + Regalloc(&r1, Types[Tptr], nil) + Thearch.Gmove(base, &r1) + Regalloc(&r2, Types[TUINT], nil) + Thearch.Gmove(len, &r2) + if i > 0 { + Thearch.Gins(Thearch.Optoas(OADD, Types[TUINT]), Nodintconst(int64(i)), &r2) + } + w := res.Type.Type.Width + if Thearch.AddIndex != nil && Thearch.AddIndex(&r2, w, &r1) { + // r1 updated by back end + } else if w == 1 { + Thearch.Gins(Thearch.Optoas(OADD, Types[Tptr]), &r2, &r1) + } else { + Thearch.Ginscon(Thearch.Optoas(OMUL, Types[TUINT]), int64(w), &r2) + Thearch.Gins(Thearch.Optoas(OADD, Types[Tptr]), &r2, &r1) + } + Regfree(&r2) + + r1.Op = OINDREG + r1.Type = res.Type.Type + cgen_wb(l.N, &r1, needwritebarrier(&r1, l.N)) + Regfree(&r1) + i++ + } +} + +// Generate res = n, where n is x[i:j] or x[i:j:k]. +// If wb is true, need write barrier updating res's base pointer. +// On systems with 32-bit ints, i, j, k are guaranteed to be 32-bit values. +func cgen_slice(n, res *Node, wb bool) { + if Debug['g'] != 0 { + Dump("cgen_slice-n", n) + Dump("cgen_slice-res", res) + } + + needFullUpdate := !samesafeexpr(n.Left, res) + + // orderexpr has made sure that x is safe (but possibly expensive) + // and i, j, k are cheap. On a system with registers (anything but 386) + // we can evaluate x first and then know we have enough registers + // for i, j, k as well. + var x, xbase, xlen, xcap, i, j, k Node + if n.Op != OSLICEARR && n.Op != OSLICE3ARR { + Igen(n.Left, &x, nil) + } + + indexRegType := Types[TUINT] + if Widthreg > Widthptr { // amd64p32 + indexRegType = Types[TUINT64] + } + + // On most systems, we use registers. + // The 386 has basically no registers, so substitute functions + // that can work with temporaries instead. + regalloc := Regalloc + ginscon := Thearch.Ginscon + gins := Thearch.Gins + if Thearch.Thechar == '8' { + regalloc = func(n *Node, t *Type, reuse *Node) { + Tempname(n, t) + } + ginscon = func(as int, c int64, n *Node) { + var n1 Node + Regalloc(&n1, n.Type, n) + Thearch.Gmove(n, &n1) + Thearch.Ginscon(as, c, &n1) + Thearch.Gmove(&n1, n) + Regfree(&n1) + } + gins = func(as int, f, t *Node) *obj.Prog { + var n1 Node + Regalloc(&n1, t.Type, t) + Thearch.Gmove(t, &n1) + Thearch.Gins(as, f, &n1) + Thearch.Gmove(&n1, t) + Regfree(&n1) + return nil + } + } + + panics := make([]*obj.Prog, 0, 6) // 3 loads + 3 checks + + loadlen := func() { + if xlen.Op != 0 { + return + } + if n.Op == OSLICEARR || n.Op == OSLICE3ARR { + Nodconst(&xlen, indexRegType, n.Left.Type.Type.Bound) + return + } + if n.Op == OSLICESTR && Isconst(n.Left, CTSTR) { + Nodconst(&xlen, indexRegType, int64(len(n.Left.Val().U.(string)))) + return + } + regalloc(&xlen, indexRegType, nil) + x.Xoffset += int64(Widthptr) + x.Type = Types[TUINT] + Thearch.Gmove(&x, &xlen) + x.Xoffset -= int64(Widthptr) + } + + loadcap := func() { + if xcap.Op != 0 { + return + } + if n.Op == OSLICEARR || n.Op == OSLICE3ARR || n.Op == OSLICESTR { + loadlen() + xcap = xlen + if xcap.Op == OREGISTER { + Regrealloc(&xcap) + } + return + } + regalloc(&xcap, indexRegType, nil) + x.Xoffset += 2 * int64(Widthptr) + x.Type = Types[TUINT] + Thearch.Gmove(&x, &xcap) + x.Xoffset -= 2 * int64(Widthptr) + } + + var x1, x2, x3 *Node // unevaluated index arguments + x1 = n.Right.Left + switch n.Op { + default: + x2 = n.Right.Right + case OSLICE3, OSLICE3ARR: + x2 = n.Right.Right.Left + x3 = n.Right.Right.Right + } + + // load computes src into targ, but if src refers to the len or cap of n.Left, + // load copies those from xlen, xcap, loading xlen if needed. + // If targ.Op == OREGISTER on return, it must be Regfreed, + // but it should not be modified without first checking whether it is + // xlen or xcap's register. + load := func(src, targ *Node) { + if src == nil { + return + } + switch src.Op { + case OLITERAL: + *targ = *src + return + case OLEN: + // NOTE(rsc): This doesn't actually trigger, because order.go + // has pulled all the len and cap calls into separate assignments + // to temporaries. There are tests in test/sliceopt.go that could + // be enabled if this is fixed. + if samesafeexpr(n.Left, src.Left) { + if Debug_slice > 0 { + Warn("slice: reuse len") + } + loadlen() + *targ = xlen + if targ.Op == OREGISTER { + Regrealloc(targ) + } + return + } + case OCAP: + // NOTE(rsc): This doesn't actually trigger; see note in case OLEN above. + if samesafeexpr(n.Left, src.Left) { + if Debug_slice > 0 { + Warn("slice: reuse cap") + } + loadcap() + *targ = xcap + if targ.Op == OREGISTER { + Regrealloc(targ) + } + return + } + } + if i.Op != 0 && samesafeexpr(x1, src) { + if Debug_slice > 0 { + Warn("slice: reuse 1st index") + } + *targ = i + if targ.Op == OREGISTER { + Regrealloc(targ) + } + return + } + if j.Op != 0 && samesafeexpr(x2, src) { + if Debug_slice > 0 { + Warn("slice: reuse 2nd index") + } + *targ = j + if targ.Op == OREGISTER { + Regrealloc(targ) + } + return + } + if Thearch.Cgenindex != nil { + regalloc(targ, indexRegType, nil) + p := Thearch.Cgenindex(src, targ, false) + if p != nil { + panics = append(panics, p) + } + } else if Thearch.Igenindex != nil { + p := Thearch.Igenindex(src, targ, false) + if p != nil { + panics = append(panics, p) + } + } else { + regalloc(targ, indexRegType, nil) + var tmp Node + Cgenr(src, &tmp, targ) + Thearch.Gmove(&tmp, targ) + Regfree(&tmp) + } + } + + load(x1, &i) + load(x2, &j) + load(x3, &k) + + // i defaults to 0. + if i.Op == 0 { + Nodconst(&i, indexRegType, 0) + } + + // j defaults to len(x) + if j.Op == 0 { + loadlen() + j = xlen + if j.Op == OREGISTER { + Regrealloc(&j) + } + } + + // k defaults to cap(x) + // Only need to load it if we're recalculating cap or doing a full update. + if k.Op == 0 && n.Op != OSLICESTR && (!iszero(&i) || needFullUpdate) { + loadcap() + k = xcap + if k.Op == OREGISTER { + Regrealloc(&k) + } + } + + // Check constant indexes for negative values, and against constant length if known. + // The func obvious below checks for out-of-order constant indexes. + var bound int64 = -1 + if n.Op == OSLICEARR || n.Op == OSLICE3ARR { + bound = n.Left.Type.Type.Bound + } else if n.Op == OSLICESTR && Isconst(n.Left, CTSTR) { + bound = int64(len(n.Left.Val().U.(string))) + } + if Isconst(&i, CTINT) { + if mpcmpfixc(i.Val().U.(*Mpint), 0) < 0 || bound >= 0 && mpcmpfixc(i.Val().U.(*Mpint), bound) > 0 { + Yyerror("slice index out of bounds") + } + } + if Isconst(&j, CTINT) { + if mpcmpfixc(j.Val().U.(*Mpint), 0) < 0 || bound >= 0 && mpcmpfixc(j.Val().U.(*Mpint), bound) > 0 { + Yyerror("slice index out of bounds") + } + } + if Isconst(&k, CTINT) { + if mpcmpfixc(k.Val().U.(*Mpint), 0) < 0 || bound >= 0 && mpcmpfixc(k.Val().U.(*Mpint), bound) > 0 { + Yyerror("slice index out of bounds") + } + } + + // same reports whether n1 and n2 are the same register or constant. + same := func(n1, n2 *Node) bool { + return n1.Op == OREGISTER && n2.Op == OREGISTER && n1.Reg == n2.Reg || + n1.Op == ONAME && n2.Op == ONAME && n1.Orig == n2.Orig && n1.Type == n2.Type && n1.Xoffset == n2.Xoffset || + n1.Op == OLITERAL && n2.Op == OLITERAL && Mpcmpfixfix(n1.Val().U.(*Mpint), n2.Val().U.(*Mpint)) == 0 + } + + // obvious reports whether n1 <= n2 is obviously true, + // and it calls Yyerror if n1 <= n2 is obviously false. + obvious := func(n1, n2 *Node) bool { + if Debug['B'] != 0 { // -B disables bounds checks + return true + } + if same(n1, n2) { + return true // n1 == n2 + } + if iszero(n1) { + return true // using unsigned compare, so 0 <= n2 always true + } + if xlen.Op != 0 && same(n1, &xlen) && xcap.Op != 0 && same(n2, &xcap) { + return true // len(x) <= cap(x) always true + } + if Isconst(n1, CTINT) && Isconst(n2, CTINT) { + if Mpcmpfixfix(n1.Val().U.(*Mpint), n2.Val().U.(*Mpint)) <= 0 { + return true // n1, n2 constants such that n1 <= n2 + } + Yyerror("slice index out of bounds") + return true + } + return false + } + + compare := func(n1, n2 *Node) { + // n1 might be a 64-bit constant, even on 32-bit architectures, + // but it will be represented in 32 bits. + if Ctxt.Arch.Regsize == 4 && Is64(n1.Type) { + if mpcmpfixc(n1.Val().U.(*Mpint), 1<<31) >= 0 { + Fatal("missed slice out of bounds check") + } + var tmp Node + Nodconst(&tmp, indexRegType, Mpgetfix(n1.Val().U.(*Mpint))) + n1 = &tmp + } + p := Thearch.Ginscmp(OGT, indexRegType, n1, n2, -1) + panics = append(panics, p) + } + + loadcap() + max := &xcap + if k.Op != 0 && (n.Op == OSLICE3 || n.Op == OSLICE3ARR) { + if obvious(&k, max) { + if Debug_slice > 0 { + Warn("slice: omit check for 3rd index") + } + } else { + compare(&k, max) + } + max = &k + } + if j.Op != 0 { + if obvious(&j, max) { + if Debug_slice > 0 { + Warn("slice: omit check for 2nd index") + } + } else { + compare(&j, max) + } + max = &j + } + if i.Op != 0 { + if obvious(&i, max) { + if Debug_slice > 0 { + Warn("slice: omit check for 1st index") + } + } else { + compare(&i, max) + } + max = &i + } + if k.Op != 0 && i.Op != 0 { + obvious(&i, &k) // emit compile-time error for x[3:n:2] + } + + if len(panics) > 0 { + p := Gbranch(obj.AJMP, nil, 0) + for _, q := range panics { + Patch(q, Pc) + } + Ginscall(panicslice, -1) + Patch(p, Pc) + } + + // Checks are done. + // Compute new len as j-i, cap as k-i. + // If i and j are same register, len is constant 0. + // If i and k are same register, cap is constant 0. + // If j and k are same register, len and cap are same. + + // Done with xlen and xcap. + // Now safe to modify j and k even if they alias xlen, xcap. + if xlen.Op == OREGISTER { + Regfree(&xlen) + } + if xcap.Op == OREGISTER { + Regfree(&xcap) + } + + // are j and k the same value? + sameJK := same(&j, &k) + + if i.Op != 0 { + // j -= i + if same(&i, &j) { + if Debug_slice > 0 { + Warn("slice: result len == 0") + } + if j.Op == OREGISTER { + Regfree(&j) + } + Nodconst(&j, indexRegType, 0) + } else { + switch j.Op { + case OLITERAL: + if Isconst(&i, CTINT) { + Nodconst(&j, indexRegType, Mpgetfix(j.Val().U.(*Mpint))-Mpgetfix(i.Val().U.(*Mpint))) + if Debug_slice > 0 { + Warn("slice: result len == %d", Mpgetfix(j.Val().U.(*Mpint))) + } + break + } + fallthrough + case ONAME: + if !istemp(&j) { + var r Node + regalloc(&r, indexRegType, nil) + Thearch.Gmove(&j, &r) + j = r + } + fallthrough + case OREGISTER: + if i.Op == OLITERAL { + v := Mpgetfix(i.Val().U.(*Mpint)) + if v != 0 { + ginscon(Thearch.Optoas(OSUB, indexRegType), v, &j) + } + } else { + gins(Thearch.Optoas(OSUB, indexRegType), &i, &j) + } + } + } + + // k -= i if k different from j and cap is needed.j + // (The modifications to j above cannot affect i: if j and i were aliased, + // we replace j with a constant 0 instead of doing a subtraction, + // leaving i unmodified.) + if k.Op == 0 { + if Debug_slice > 0 && n.Op != OSLICESTR { + Warn("slice: result cap not computed") + } + // no need + } else if same(&i, &k) { + if k.Op == OREGISTER { + Regfree(&k) + } + Nodconst(&k, indexRegType, 0) + if Debug_slice > 0 { + Warn("slice: result cap == 0") + } + } else if sameJK { + if Debug_slice > 0 { + Warn("slice: result cap == result len") + } + // k and j were the same value; make k-i the same as j-i. + if k.Op == OREGISTER { + Regfree(&k) + } + k = j + if k.Op == OREGISTER { + Regrealloc(&k) + } + } else { + switch k.Op { + case OLITERAL: + if Isconst(&i, CTINT) { + Nodconst(&k, indexRegType, Mpgetfix(k.Val().U.(*Mpint))-Mpgetfix(i.Val().U.(*Mpint))) + if Debug_slice > 0 { + Warn("slice: result cap == %d", Mpgetfix(k.Val().U.(*Mpint))) + } + break + } + fallthrough + case ONAME: + if !istemp(&k) { + var r Node + regalloc(&r, indexRegType, nil) + Thearch.Gmove(&k, &r) + k = r + } + fallthrough + case OREGISTER: + if same(&i, &k) { + Regfree(&k) + Nodconst(&k, indexRegType, 0) + if Debug_slice > 0 { + Warn("slice: result cap == 0") + } + } else if i.Op == OLITERAL { + v := Mpgetfix(i.Val().U.(*Mpint)) + if v != 0 { + ginscon(Thearch.Optoas(OSUB, indexRegType), v, &k) + } + } else { + gins(Thearch.Optoas(OSUB, indexRegType), &i, &k) + } + } + } + } + + adjustBase := true + if i.Op == 0 || iszero(&i) { + if Debug_slice > 0 { + Warn("slice: skip base adjustment for 1st index 0") + } + adjustBase = false + } else if k.Op != 0 && iszero(&k) || k.Op == 0 && iszero(&j) { + if Debug_slice > 0 { + if n.Op == OSLICESTR { + Warn("slice: skip base adjustment for string len == 0") + } else { + Warn("slice: skip base adjustment for cap == 0") + } + } + adjustBase = false + } + + if !adjustBase && !needFullUpdate { + if Debug_slice > 0 { + if k.Op != 0 { + Warn("slice: len/cap-only update") + } else { + Warn("slice: len-only update") + } + } + if i.Op == OREGISTER { + Regfree(&i) + } + // Write len (and cap if needed) back to x. + x.Xoffset += int64(Widthptr) + x.Type = Types[TUINT] + Thearch.Gmove(&j, &x) + x.Xoffset -= int64(Widthptr) + if k.Op != 0 { + x.Xoffset += 2 * int64(Widthptr) + x.Type = Types[TUINT] + Thearch.Gmove(&k, &x) + x.Xoffset -= 2 * int64(Widthptr) + } + Regfree(&x) + } else { + // Compute new base. May smash i. + if n.Op == OSLICEARR || n.Op == OSLICE3ARR { + Cgenr(n.Left, &xbase, nil) + Cgen_checknil(&xbase) + } else { + regalloc(&xbase, Ptrto(res.Type.Type), nil) + x.Type = xbase.Type + Thearch.Gmove(&x, &xbase) + Regfree(&x) + } + if i.Op != 0 && adjustBase { + // Branch around the base adjustment if the resulting cap will be 0. + var p *obj.Prog + size := &k + if k.Op == 0 { + size = &j + } + if Isconst(size, CTINT) { + // zero was checked above, must be non-zero. + } else { + var tmp Node + Nodconst(&tmp, indexRegType, 0) + p = Thearch.Ginscmp(OEQ, indexRegType, size, &tmp, -1) + } + var w int64 + if n.Op == OSLICESTR { + w = 1 // res is string, elem size is 1 (byte) + } else { + w = res.Type.Type.Width // res is []T, elem size is T.width + } + if Isconst(&i, CTINT) { + ginscon(Thearch.Optoas(OADD, xbase.Type), Mpgetfix(i.Val().U.(*Mpint))*w, &xbase) + } else if Thearch.AddIndex != nil && Thearch.AddIndex(&i, w, &xbase) { + // done by back end + } else if w == 1 { + gins(Thearch.Optoas(OADD, xbase.Type), &i, &xbase) + } else { + if i.Op == ONAME && !istemp(&i) { + var tmp Node + Tempname(&tmp, i.Type) + Thearch.Gmove(&i, &tmp) + i = tmp + } + ginscon(Thearch.Optoas(OMUL, i.Type), w, &i) + gins(Thearch.Optoas(OADD, xbase.Type), &i, &xbase) + } + if p != nil { + Patch(p, Pc) + } + } + if i.Op == OREGISTER { + Regfree(&i) + } + + // Write len, cap, base to result. + if res.Op == ONAME { + Gvardef(res) + } + Igen(res, &x, nil) + x.Xoffset += int64(Widthptr) + x.Type = Types[TUINT] + Thearch.Gmove(&j, &x) + x.Xoffset -= int64(Widthptr) + if k.Op != 0 { + x.Xoffset += 2 * int64(Widthptr) + Thearch.Gmove(&k, &x) + x.Xoffset -= 2 * int64(Widthptr) + } + x.Type = xbase.Type + cgen_wb(&xbase, &x, wb) + Regfree(&xbase) + Regfree(&x) + } + + if j.Op == OREGISTER { + Regfree(&j) + } + if k.Op == OREGISTER { + Regfree(&k) + } +} diff --git a/src/cmd/compile/internal/gc/closure.go b/src/cmd/compile/internal/gc/closure.go new file mode 100644 index 0000000000000000000000000000000000000000..a0dfa0bb0f446d3a7efc661acac672b41f38501b --- /dev/null +++ b/src/cmd/compile/internal/gc/closure.go @@ -0,0 +1,690 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package gc + +import ( + "cmd/internal/obj" + "fmt" +) + +/* + * function literals aka closures + */ +func closurehdr(ntype *Node) { + var name *Node + var a *Node + + n := Nod(OCLOSURE, nil, nil) + n.Func.Ntype = ntype + n.Func.Depth = Funcdepth + n.Func.Outerfunc = Curfn + + funchdr(n) + + // steal ntype's argument names and + // leave a fresh copy in their place. + // references to these variables need to + // refer to the variables in the external + // function declared below; see walkclosure. + n.List = ntype.List + + n.Rlist = ntype.Rlist + ntype.List = nil + ntype.Rlist = nil + for l := n.List; l != nil; l = l.Next { + name = l.N.Left + if name != nil { + name = newname(name.Sym) + } + a = Nod(ODCLFIELD, name, l.N.Right) + a.Isddd = l.N.Isddd + if name != nil { + name.Isddd = a.Isddd + } + ntype.List = list(ntype.List, a) + } + + for l := n.Rlist; l != nil; l = l.Next { + name = l.N.Left + if name != nil { + name = newname(name.Sym) + } + ntype.Rlist = list(ntype.Rlist, Nod(ODCLFIELD, name, l.N.Right)) + } +} + +func closurebody(body *NodeList) *Node { + if body == nil { + body = list1(Nod(OEMPTY, nil, nil)) + } + + func_ := Curfn + func_.Nbody = body + func_.Func.Endlineno = lineno + funcbody(func_) + + // closure-specific variables are hanging off the + // ordinary ones in the symbol table; see oldname. + // unhook them. + // make the list of pointers for the closure call. + var v *Node + for l := func_.Func.Cvars; l != nil; l = l.Next { + v = l.N + v.Name.Param.Closure.Name.Param.Closure = v.Name.Param.Outer + v.Name.Param.Outerexpr = oldname(v.Sym) + } + + return func_ +} + +func typecheckclosure(func_ *Node, top int) { + var n *Node + + for l := func_.Func.Cvars; l != nil; l = l.Next { + n = l.N.Name.Param.Closure + if !n.Name.Captured { + n.Name.Captured = true + if n.Name.Decldepth == 0 { + Fatal("typecheckclosure: var %v does not have decldepth assigned", Nconv(n, obj.FmtShort)) + } + + // Ignore assignments to the variable in straightline code + // preceding the first capturing by a closure. + if n.Name.Decldepth == decldepth { + n.Assigned = false + } + } + } + + for l := func_.Func.Dcl; l != nil; l = l.Next { + if l.N.Op == ONAME && (l.N.Class == PPARAM || l.N.Class == PPARAMOUT) { + l.N.Name.Decldepth = 1 + } + } + + oldfn := Curfn + typecheck(&func_.Func.Ntype, Etype) + func_.Type = func_.Func.Ntype.Type + func_.Func.Top = top + + // Type check the body now, but only if we're inside a function. + // At top level (in a variable initialization: curfn==nil) we're not + // ready to type check code yet; we'll check it later, because the + // underlying closure function we create is added to xtop. + if Curfn != nil && func_.Type != nil { + Curfn = func_ + olddd := decldepth + decldepth = 1 + typechecklist(func_.Nbody, Etop) + decldepth = olddd + Curfn = oldfn + } + + // Create top-level function + xtop = list(xtop, makeclosure(func_)) +} + +// closurename returns name for OCLOSURE n. +// It is not as simple as it ought to be, because we typecheck nested closures +// starting from the innermost one. So when we check the inner closure, +// we don't yet have name for the outer closure. This function uses recursion +// to generate names all the way up if necessary. + +var closurename_closgen int + +func closurename(n *Node) *Sym { + if n.Sym != nil { + return n.Sym + } + gen := 0 + outer := "" + prefix := "" + if n.Func.Outerfunc == nil { + // Global closure. + outer = "glob" + + prefix = "func" + closurename_closgen++ + gen = closurename_closgen + } else if n.Func.Outerfunc.Op == ODCLFUNC { + // The outermost closure inside of a named function. + outer = n.Func.Outerfunc.Func.Nname.Sym.Name + + prefix = "func" + + // Yes, functions can be named _. + // Can't use function closgen in such case, + // because it would lead to name clashes. + if !isblank(n.Func.Outerfunc.Func.Nname) { + n.Func.Outerfunc.Func.Closgen++ + gen = n.Func.Outerfunc.Func.Closgen + } else { + closurename_closgen++ + gen = closurename_closgen + } + } else if n.Func.Outerfunc.Op == OCLOSURE { + // Nested closure, recurse. + outer = closurename(n.Func.Outerfunc).Name + + prefix = "" + n.Func.Outerfunc.Func.Closgen++ + gen = n.Func.Outerfunc.Func.Closgen + } else { + Fatal("closurename called for %v", Nconv(n, obj.FmtShort)) + } + n.Sym = Lookupf("%s.%s%d", outer, prefix, gen) + return n.Sym +} + +func makeclosure(func_ *Node) *Node { + /* + * wrap body in external function + * that begins by reading closure parameters. + */ + xtype := Nod(OTFUNC, nil, nil) + + xtype.List = func_.List + xtype.Rlist = func_.Rlist + + // create the function + xfunc := Nod(ODCLFUNC, nil, nil) + + xfunc.Func.Nname = newfuncname(closurename(func_)) + xfunc.Func.Nname.Sym.Flags |= SymExported // disable export + xfunc.Func.Nname.Name.Param.Ntype = xtype + xfunc.Func.Nname.Name.Defn = xfunc + declare(xfunc.Func.Nname, PFUNC) + xfunc.Func.Nname.Name.Funcdepth = func_.Func.Depth + xfunc.Func.Depth = func_.Func.Depth + xfunc.Func.Endlineno = func_.Func.Endlineno + makefuncsym(xfunc.Func.Nname.Sym) + + xfunc.Nbody = func_.Nbody + xfunc.Func.Dcl = concat(func_.Func.Dcl, xfunc.Func.Dcl) + if xfunc.Nbody == nil { + Fatal("empty body - won't generate any code") + } + typecheck(&xfunc, Etop) + + xfunc.Func.Closure = func_ + func_.Func.Closure = xfunc + + func_.Nbody = nil + func_.List = nil + func_.Rlist = nil + + return xfunc +} + +// capturevars is called in a separate phase after all typechecking is done. +// It decides whether each variable captured by a closure should be captured +// by value or by reference. +// We use value capturing for values <= 128 bytes that are never reassigned +// after capturing (effectively constant). +func capturevars(xfunc *Node) { + var v *Node + var outer *Node + + lno := int(lineno) + lineno = xfunc.Lineno + + func_ := xfunc.Func.Closure + func_.Func.Enter = nil + for l := func_.Func.Cvars; l != nil; l = l.Next { + v = l.N + if v.Type == nil { + // if v->type is nil, it means v looked like it was + // going to be used in the closure but wasn't. + // this happens because when parsing a, b, c := f() + // the a, b, c gets parsed as references to older + // a, b, c before the parser figures out this is a + // declaration. + v.Op = OXXX + + continue + } + + // type check the & of closed variables outside the closure, + // so that the outer frame also grabs them and knows they escape. + dowidth(v.Type) + + outer = v.Name.Param.Outerexpr + v.Name.Param.Outerexpr = nil + + // out parameters will be assigned to implicitly upon return. + if outer.Class != PPARAMOUT && !v.Name.Param.Closure.Addrtaken && !v.Name.Param.Closure.Assigned && v.Type.Width <= 128 { + v.Name.Byval = true + } else { + v.Name.Param.Closure.Addrtaken = true + outer = Nod(OADDR, outer, nil) + } + + if Debug['m'] > 1 { + var name *Sym + if v.Name.Curfn != nil && v.Name.Curfn.Func.Nname != nil { + name = v.Name.Curfn.Func.Nname.Sym + } + how := "ref" + if v.Name.Byval { + how = "value" + } + Warnl(int(v.Lineno), "%v capturing by %s: %v (addr=%v assign=%v width=%d)", name, how, v.Sym, v.Name.Param.Closure.Addrtaken, v.Name.Param.Closure.Assigned, int32(v.Type.Width)) + } + + typecheck(&outer, Erv) + func_.Func.Enter = list(func_.Func.Enter, outer) + } + + lineno = int32(lno) +} + +// transformclosure is called in a separate phase after escape analysis. +// It transform closure bodies to properly reference captured variables. +func transformclosure(xfunc *Node) { + lno := int(lineno) + lineno = xfunc.Lineno + func_ := xfunc.Func.Closure + + if func_.Func.Top&Ecall != 0 { + // If the closure is directly called, we transform it to a plain function call + // with variables passed as args. This avoids allocation of a closure object. + // Here we do only a part of the transformation. Walk of OCALLFUNC(OCLOSURE) + // will complete the transformation later. + // For illustration, the following closure: + // func(a int) { + // println(byval) + // byref++ + // }(42) + // becomes: + // func(a int, byval int, &byref *int) { + // println(byval) + // (*&byref)++ + // }(byval, &byref, 42) + + // f is ONAME of the actual function. + f := xfunc.Func.Nname + + // Get pointer to input arguments. + // We are going to insert captured variables before input args. + param := &getinargx(f.Type).Type + original_args := *param // old input args + original_dcl := xfunc.Func.Dcl + xfunc.Func.Dcl = nil + + var v *Node + var addr *Node + var fld *Type + for l := func_.Func.Cvars; l != nil; l = l.Next { + v = l.N + if v.Op == OXXX { + continue + } + fld = typ(TFIELD) + fld.Funarg = 1 + if v.Name.Byval { + // If v is captured by value, we merely downgrade it to PPARAM. + v.Class = PPARAM + + v.Ullman = 1 + fld.Nname = v + } else { + // If v of type T is captured by reference, + // we introduce function param &v *T + // and v remains PPARAMREF with &v heapaddr + // (accesses will implicitly deref &v). + addr = newname(Lookupf("&%s", v.Sym.Name)) + addr.Type = Ptrto(v.Type) + addr.Class = PPARAM + v.Name.Heapaddr = addr + fld.Nname = addr + } + + fld.Type = fld.Nname.Type + fld.Sym = fld.Nname.Sym + + // Declare the new param and add it the first part of the input arguments. + xfunc.Func.Dcl = list(xfunc.Func.Dcl, fld.Nname) + + *param = fld + param = &fld.Down + } + *param = original_args + xfunc.Func.Dcl = concat(xfunc.Func.Dcl, original_dcl) + + // Recalculate param offsets. + if f.Type.Width > 0 { + Fatal("transformclosure: width is already calculated") + } + dowidth(f.Type) + xfunc.Type = f.Type // update type of ODCLFUNC + } else { + // The closure is not called, so it is going to stay as closure. + nvar := 0 + + var body *NodeList + offset := int64(Widthptr) + var addr *Node + var v *Node + var cv *Node + for l := func_.Func.Cvars; l != nil; l = l.Next { + v = l.N + if v.Op == OXXX { + continue + } + nvar++ + + // cv refers to the field inside of closure OSTRUCTLIT. + cv = Nod(OCLOSUREVAR, nil, nil) + + cv.Type = v.Type + if !v.Name.Byval { + cv.Type = Ptrto(v.Type) + } + offset = Rnd(offset, int64(cv.Type.Align)) + cv.Xoffset = offset + offset += cv.Type.Width + + if v.Name.Byval && v.Type.Width <= int64(2*Widthptr) { + // If it is a small variable captured by value, downgrade it to PAUTO. + v.Class = PAUTO + v.Ullman = 1 + xfunc.Func.Dcl = list(xfunc.Func.Dcl, v) + body = list(body, Nod(OAS, v, cv)) + } else { + // Declare variable holding addresses taken from closure + // and initialize in entry prologue. + addr = newname(Lookupf("&%s", v.Sym.Name)) + addr.Name.Param.Ntype = Nod(OIND, typenod(v.Type), nil) + addr.Class = PAUTO + addr.Used = true + addr.Name.Curfn = xfunc + xfunc.Func.Dcl = list(xfunc.Func.Dcl, addr) + v.Name.Heapaddr = addr + if v.Name.Byval { + cv = Nod(OADDR, cv, nil) + } + body = list(body, Nod(OAS, addr, cv)) + } + } + + typechecklist(body, Etop) + walkstmtlist(body) + xfunc.Func.Enter = body + xfunc.Func.Needctxt = nvar > 0 + } + + lineno = int32(lno) +} + +func walkclosure(func_ *Node, init **NodeList) *Node { + // If no closure vars, don't bother wrapping. + if func_.Func.Cvars == nil { + return func_.Func.Closure.Func.Nname + } + + // Create closure in the form of a composite literal. + // supposing the closure captures an int i and a string s + // and has one float64 argument and no results, + // the generated code looks like: + // + // clos = &struct{.F uintptr; i *int; s *string}{func.1, &i, &s} + // + // The use of the struct provides type information to the garbage + // collector so that it can walk the closure. We could use (in this case) + // [3]unsafe.Pointer instead, but that would leave the gc in the dark. + // The information appears in the binary in the form of type descriptors; + // the struct is unnamed so that closures in multiple packages with the + // same struct type can share the descriptor. + + typ := Nod(OTSTRUCT, nil, nil) + + typ.List = list1(Nod(ODCLFIELD, newname(Lookup(".F")), typenod(Types[TUINTPTR]))) + var typ1 *Node + var v *Node + for l := func_.Func.Cvars; l != nil; l = l.Next { + v = l.N + if v.Op == OXXX { + continue + } + typ1 = typenod(v.Type) + if !v.Name.Byval { + typ1 = Nod(OIND, typ1, nil) + } + typ.List = list(typ.List, Nod(ODCLFIELD, newname(v.Sym), typ1)) + } + + clos := Nod(OCOMPLIT, nil, Nod(OIND, typ, nil)) + clos.Esc = func_.Esc + clos.Right.Implicit = true + clos.List = concat(list1(Nod(OCFUNC, func_.Func.Closure.Func.Nname, nil)), func_.Func.Enter) + + // Force type conversion from *struct to the func type. + clos = Nod(OCONVNOP, clos, nil) + + clos.Type = func_.Type + + typecheck(&clos, Erv) + + // typecheck will insert a PTRLIT node under CONVNOP, + // tag it with escape analysis result. + clos.Left.Esc = func_.Esc + + // non-escaping temp to use, if any. + // orderexpr did not compute the type; fill it in now. + if x := prealloc[func_]; x != nil { + x.Type = clos.Left.Left.Type + x.Orig.Type = x.Type + clos.Left.Right = x + delete(prealloc, func_) + } + + walkexpr(&clos, init) + + return clos +} + +func typecheckpartialcall(fn *Node, sym *Node) { + switch fn.Op { + case ODOTINTER, ODOTMETH: + break + + default: + Fatal("invalid typecheckpartialcall") + } + + // Create top-level function. + xfunc := makepartialcall(fn, fn.Type, sym) + fn.Func = xfunc.Func + fn.Right = sym + fn.Op = OCALLPART + fn.Type = xfunc.Type +} + +var makepartialcall_gopkg *Pkg + +func makepartialcall(fn *Node, t0 *Type, meth *Node) *Node { + var p string + + rcvrtype := fn.Left.Type + if exportname(meth.Sym.Name) { + p = fmt.Sprintf("(%v).%s-fm", Tconv(rcvrtype, obj.FmtLeft|obj.FmtShort), meth.Sym.Name) + } else { + p = fmt.Sprintf("(%v).(%v)-fm", Tconv(rcvrtype, obj.FmtLeft|obj.FmtShort), Sconv(meth.Sym, obj.FmtLeft)) + } + basetype := rcvrtype + if Isptr[rcvrtype.Etype] { + basetype = basetype.Type + } + if basetype.Etype != TINTER && basetype.Sym == nil { + Fatal("missing base type for %v", rcvrtype) + } + + var spkg *Pkg + if basetype.Sym != nil { + spkg = basetype.Sym.Pkg + } + if spkg == nil { + if makepartialcall_gopkg == nil { + makepartialcall_gopkg = mkpkg("go") + } + spkg = makepartialcall_gopkg + } + + sym := Pkglookup(p, spkg) + + if sym.Flags&SymUniq != 0 { + return sym.Def + } + sym.Flags |= SymUniq + + savecurfn := Curfn + Curfn = nil + + xtype := Nod(OTFUNC, nil, nil) + i := 0 + var l *NodeList + var callargs *NodeList + ddd := false + xfunc := Nod(ODCLFUNC, nil, nil) + Curfn = xfunc + var fld *Node + var n *Node + for t := getinargx(t0).Type; t != nil; t = t.Down { + n = newname(Lookupf("a%d", i)) + i++ + n.Class = PPARAM + xfunc.Func.Dcl = list(xfunc.Func.Dcl, n) + callargs = list(callargs, n) + fld = Nod(ODCLFIELD, n, typenod(t.Type)) + if t.Isddd { + fld.Isddd = true + ddd = true + } + + l = list(l, fld) + } + + xtype.List = l + i = 0 + l = nil + var retargs *NodeList + for t := getoutargx(t0).Type; t != nil; t = t.Down { + n = newname(Lookupf("r%d", i)) + i++ + n.Class = PPARAMOUT + xfunc.Func.Dcl = list(xfunc.Func.Dcl, n) + retargs = list(retargs, n) + l = list(l, Nod(ODCLFIELD, n, typenod(t.Type))) + } + + xtype.Rlist = l + + xfunc.Func.Dupok = true + xfunc.Func.Nname = newfuncname(sym) + xfunc.Func.Nname.Sym.Flags |= SymExported // disable export + xfunc.Func.Nname.Name.Param.Ntype = xtype + xfunc.Func.Nname.Name.Defn = xfunc + declare(xfunc.Func.Nname, PFUNC) + + // Declare and initialize variable holding receiver. + + xfunc.Func.Needctxt = true + cv := Nod(OCLOSUREVAR, nil, nil) + cv.Xoffset = int64(Widthptr) + cv.Type = rcvrtype + if int(cv.Type.Align) > Widthptr { + cv.Xoffset = int64(cv.Type.Align) + } + ptr := Nod(ONAME, nil, nil) + ptr.Sym = Lookup("rcvr") + ptr.Class = PAUTO + ptr.Addable = true + ptr.Ullman = 1 + ptr.Used = true + ptr.Name.Curfn = xfunc + xfunc.Func.Dcl = list(xfunc.Func.Dcl, ptr) + var body *NodeList + if Isptr[rcvrtype.Etype] || Isinter(rcvrtype) { + ptr.Name.Param.Ntype = typenod(rcvrtype) + body = list(body, Nod(OAS, ptr, cv)) + } else { + ptr.Name.Param.Ntype = typenod(Ptrto(rcvrtype)) + body = list(body, Nod(OAS, ptr, Nod(OADDR, cv, nil))) + } + + call := Nod(OCALL, Nod(OXDOT, ptr, meth), nil) + call.List = callargs + call.Isddd = ddd + if t0.Outtuple == 0 { + body = list(body, call) + } else { + n := Nod(OAS2, nil, nil) + n.List = retargs + n.Rlist = list1(call) + body = list(body, n) + n = Nod(ORETURN, nil, nil) + body = list(body, n) + } + + xfunc.Nbody = body + + typecheck(&xfunc, Etop) + sym.Def = xfunc + xtop = list(xtop, xfunc) + Curfn = savecurfn + + return xfunc +} + +func walkpartialcall(n *Node, init **NodeList) *Node { + // Create closure in the form of a composite literal. + // For x.M with receiver (x) type T, the generated code looks like: + // + // clos = &struct{F uintptr; R T}{M.T·f, x} + // + // Like walkclosure above. + + if Isinter(n.Left.Type) { + // Trigger panic for method on nil interface now. + // Otherwise it happens in the wrapper and is confusing. + n.Left = cheapexpr(n.Left, init) + + checknil(n.Left, init) + } + + typ := Nod(OTSTRUCT, nil, nil) + typ.List = list1(Nod(ODCLFIELD, newname(Lookup("F")), typenod(Types[TUINTPTR]))) + typ.List = list(typ.List, Nod(ODCLFIELD, newname(Lookup("R")), typenod(n.Left.Type))) + + clos := Nod(OCOMPLIT, nil, Nod(OIND, typ, nil)) + clos.Esc = n.Esc + clos.Right.Implicit = true + clos.List = list1(Nod(OCFUNC, n.Func.Nname, nil)) + clos.List = list(clos.List, n.Left) + + // Force type conversion from *struct to the func type. + clos = Nod(OCONVNOP, clos, nil) + + clos.Type = n.Type + + typecheck(&clos, Erv) + + // typecheck will insert a PTRLIT node under CONVNOP, + // tag it with escape analysis result. + clos.Left.Esc = n.Esc + + // non-escaping temp to use, if any. + // orderexpr did not compute the type; fill it in now. + if x := prealloc[n]; x != nil { + x.Type = clos.Left.Left.Type + x.Orig.Type = x.Type + clos.Left.Right = x + delete(prealloc, n) + } + + walkexpr(&clos, init) + + return clos +} diff --git a/src/cmd/compile/internal/gc/const.go b/src/cmd/compile/internal/gc/const.go new file mode 100644 index 0000000000000000000000000000000000000000..9eb49836062094c06dcbaee51e207b1396d5662a --- /dev/null +++ b/src/cmd/compile/internal/gc/const.go @@ -0,0 +1,1715 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package gc + +import ( + "cmd/compile/internal/big" + "cmd/internal/obj" + "strings" +) + +// Int returns n as an int. +// n must be an integer constant. +func (n *Node) Int() int64 { + if !Isconst(n, CTINT) { + Fatal("Int(%v)", n) + } + return Mpgetfix(n.Val().U.(*Mpint)) +} + +// SetInt sets n's value to i. +// n must be an integer constant. +func (n *Node) SetInt(i int64) { + if !Isconst(n, CTINT) { + Fatal("SetInt(%v)", n) + } + Mpmovecfix(n.Val().U.(*Mpint), i) +} + +// SetBigInt sets n's value to x. +// n must be an integer constant. +func (n *Node) SetBigInt(x *big.Int) { + if !Isconst(n, CTINT) { + Fatal("SetBigInt(%v)", n) + } + n.Val().U.(*Mpint).Val.Set(x) +} + +// Bool returns n as an bool. +// n must be an boolean constant. +func (n *Node) Bool() bool { + if !Isconst(n, CTBOOL) { + Fatal("Int(%v)", n) + } + return n.Val().U.(bool) +} + +/* + * truncate float literal fv to 32-bit or 64-bit precision + * according to type; return truncated value. + */ +func truncfltlit(oldv *Mpflt, t *Type) *Mpflt { + if t == nil { + return oldv + } + + var v Val + v.U = oldv + overflow(v, t) + + fv := newMpflt() + mpmovefltflt(fv, oldv) + + // convert large precision literal floating + // into limited precision (float64 or float32) + switch t.Etype { + case TFLOAT64: + d := mpgetflt(fv) + Mpmovecflt(fv, d) + + case TFLOAT32: + d := mpgetflt32(fv) + Mpmovecflt(fv, d) + } + + return fv +} + +/* + * convert n, if literal, to type t. + * implicit conversion. + */ +func Convlit(np **Node, t *Type) { + convlit1(np, t, false) +} + +/* + * convert n, if literal, to type t. + * return a new node if necessary + * (if n is a named constant, can't edit n->type directly). + */ +func convlit1(np **Node, t *Type, explicit bool) { + n := *np + if n == nil || t == nil || n.Type == nil || isideal(t) || n.Type == t { + return + } + if !explicit && !isideal(n.Type) { + return + } + + if n.Op == OLITERAL { + nn := Nod(OXXX, nil, nil) + *nn = *n + n = nn + *np = n + } + + switch n.Op { + default: + if n.Type == idealbool { + if t.Etype == TBOOL { + n.Type = t + } else { + n.Type = Types[TBOOL] + } + } + + if n.Type.Etype == TIDEAL { + Convlit(&n.Left, t) + Convlit(&n.Right, t) + n.Type = t + } + + return + + // target is invalid type for a constant? leave alone. + case OLITERAL: + if !okforconst[t.Etype] && n.Type.Etype != TNIL { + defaultlit(&n, nil) + *np = n + return + } + + case OLSH, ORSH: + convlit1(&n.Left, t, explicit && isideal(n.Left.Type)) + t = n.Left.Type + if t != nil && t.Etype == TIDEAL && n.Val().Ctype() != CTINT { + n.SetVal(toint(n.Val())) + } + if t != nil && !Isint[t.Etype] { + Yyerror("invalid operation: %v (shift of type %v)", n, t) + t = nil + } + + n.Type = t + return + + case OCOMPLEX: + if n.Type.Etype == TIDEAL { + switch t.Etype { + // If trying to convert to non-complex type, + // leave as complex128 and let typechecker complain. + default: + t = Types[TCOMPLEX128] + fallthrough + + //fallthrough + case TCOMPLEX128: + n.Type = t + + Convlit(&n.Left, Types[TFLOAT64]) + Convlit(&n.Right, Types[TFLOAT64]) + + case TCOMPLEX64: + n.Type = t + Convlit(&n.Left, Types[TFLOAT32]) + Convlit(&n.Right, Types[TFLOAT32]) + } + } + + return + } + + // avoided repeated calculations, errors + if Eqtype(n.Type, t) { + return + } + + ct := consttype(n) + var et int + if ct < 0 { + goto bad + } + + et = int(t.Etype) + if et == TINTER { + if ct == CTNIL && n.Type == Types[TNIL] { + n.Type = t + return + } + + defaultlit(np, nil) + return + } + + switch ct { + default: + goto bad + + case CTNIL: + switch et { + default: + n.Type = nil + goto bad + + // let normal conversion code handle it + case TSTRING: + return + + case TARRAY: + if !Isslice(t) { + goto bad + } + + case TPTR32, + TPTR64, + TINTER, + TMAP, + TCHAN, + TFUNC, + TUNSAFEPTR: + break + + // A nil literal may be converted to uintptr + // if it is an unsafe.Pointer + case TUINTPTR: + if n.Type.Etype == TUNSAFEPTR { + n.SetVal(Val{new(Mpint)}) + Mpmovecfix(n.Val().U.(*Mpint), 0) + } else { + goto bad + } + } + + case CTSTR, CTBOOL: + if et != int(n.Type.Etype) { + goto bad + } + + case CTINT, CTRUNE, CTFLT, CTCPLX: + if n.Type.Etype == TUNSAFEPTR && t.Etype != TUINTPTR { + goto bad + } + ct := int(n.Val().Ctype()) + if Isint[et] { + switch ct { + default: + goto bad + + case CTCPLX, CTFLT, CTRUNE: + n.SetVal(toint(n.Val())) + fallthrough + + // flowthrough + case CTINT: + overflow(n.Val(), t) + } + } else if Isfloat[et] { + switch ct { + default: + goto bad + + case CTCPLX, CTINT, CTRUNE: + n.SetVal(toflt(n.Val())) + fallthrough + + // flowthrough + case CTFLT: + n.SetVal(Val{truncfltlit(n.Val().U.(*Mpflt), t)}) + } + } else if Iscomplex[et] { + switch ct { + default: + goto bad + + case CTFLT, CTINT, CTRUNE: + n.SetVal(tocplx(n.Val())) + + case CTCPLX: + overflow(n.Val(), t) + } + } else if et == TSTRING && (ct == CTINT || ct == CTRUNE) && explicit { + n.SetVal(tostr(n.Val())) + } else { + goto bad + } + } + + n.Type = t + return + +bad: + if n.Diag == 0 { + if t.Broke == 0 { + Yyerror("cannot convert %v to type %v", n, t) + } + n.Diag = 1 + } + + if isideal(n.Type) { + defaultlit(&n, nil) + *np = n + } +} + +func copyval(v Val) Val { + switch v.Ctype() { + case CTINT, CTRUNE: + i := new(Mpint) + mpmovefixfix(i, v.U.(*Mpint)) + i.Rune = v.U.(*Mpint).Rune + v.U = i + + case CTFLT: + f := newMpflt() + mpmovefltflt(f, v.U.(*Mpflt)) + v.U = f + + case CTCPLX: + c := new(Mpcplx) + mpmovefltflt(&c.Real, &v.U.(*Mpcplx).Real) + mpmovefltflt(&c.Imag, &v.U.(*Mpcplx).Imag) + v.U = c + } + + return v +} + +func tocplx(v Val) Val { + switch v.Ctype() { + case CTINT, CTRUNE: + c := new(Mpcplx) + Mpmovefixflt(&c.Real, v.U.(*Mpint)) + Mpmovecflt(&c.Imag, 0.0) + v.U = c + + case CTFLT: + c := new(Mpcplx) + mpmovefltflt(&c.Real, v.U.(*Mpflt)) + Mpmovecflt(&c.Imag, 0.0) + v.U = c + } + + return v +} + +func toflt(v Val) Val { + switch v.Ctype() { + case CTINT, CTRUNE: + f := newMpflt() + Mpmovefixflt(f, v.U.(*Mpint)) + v.U = f + + case CTCPLX: + f := newMpflt() + mpmovefltflt(f, &v.U.(*Mpcplx).Real) + if mpcmpfltc(&v.U.(*Mpcplx).Imag, 0) != 0 { + Yyerror("constant %v%vi truncated to real", Fconv(&v.U.(*Mpcplx).Real, obj.FmtSharp), Fconv(&v.U.(*Mpcplx).Imag, obj.FmtSharp|obj.FmtSign)) + } + v.U = f + } + + return v +} + +func toint(v Val) Val { + switch v.Ctype() { + case CTRUNE: + i := new(Mpint) + mpmovefixfix(i, v.U.(*Mpint)) + v.U = i + + case CTFLT: + i := new(Mpint) + if mpmovefltfix(i, v.U.(*Mpflt)) < 0 { + Yyerror("constant %v truncated to integer", Fconv(v.U.(*Mpflt), obj.FmtSharp)) + } + v.U = i + + case CTCPLX: + i := new(Mpint) + if mpmovefltfix(i, &v.U.(*Mpcplx).Real) < 0 { + Yyerror("constant %v%vi truncated to integer", Fconv(&v.U.(*Mpcplx).Real, obj.FmtSharp), Fconv(&v.U.(*Mpcplx).Imag, obj.FmtSharp|obj.FmtSign)) + } + if mpcmpfltc(&v.U.(*Mpcplx).Imag, 0) != 0 { + Yyerror("constant %v%vi truncated to real", Fconv(&v.U.(*Mpcplx).Real, obj.FmtSharp), Fconv(&v.U.(*Mpcplx).Imag, obj.FmtSharp|obj.FmtSign)) + } + v.U = i + } + + return v +} + +func doesoverflow(v Val, t *Type) bool { + switch v.Ctype() { + case CTINT, CTRUNE: + if !Isint[t.Etype] { + Fatal("overflow: %v integer constant", t) + } + if Mpcmpfixfix(v.U.(*Mpint), Minintval[t.Etype]) < 0 || Mpcmpfixfix(v.U.(*Mpint), Maxintval[t.Etype]) > 0 { + return true + } + + case CTFLT: + if !Isfloat[t.Etype] { + Fatal("overflow: %v floating-point constant", t) + } + if mpcmpfltflt(v.U.(*Mpflt), minfltval[t.Etype]) <= 0 || mpcmpfltflt(v.U.(*Mpflt), maxfltval[t.Etype]) >= 0 { + return true + } + + case CTCPLX: + if !Iscomplex[t.Etype] { + Fatal("overflow: %v complex constant", t) + } + if mpcmpfltflt(&v.U.(*Mpcplx).Real, minfltval[t.Etype]) <= 0 || mpcmpfltflt(&v.U.(*Mpcplx).Real, maxfltval[t.Etype]) >= 0 || mpcmpfltflt(&v.U.(*Mpcplx).Imag, minfltval[t.Etype]) <= 0 || mpcmpfltflt(&v.U.(*Mpcplx).Imag, maxfltval[t.Etype]) >= 0 { + return true + } + } + + return false +} + +func overflow(v Val, t *Type) { + // v has already been converted + // to appropriate form for t. + if t == nil || t.Etype == TIDEAL { + return + } + + // Only uintptrs may be converted to unsafe.Pointer, which cannot overflow. + if t.Etype == TUNSAFEPTR { + return + } + + if !doesoverflow(v, t) { + return + } + + switch v.Ctype() { + case CTINT, CTRUNE: + Yyerror("constant %v overflows %v", v.U.(*Mpint), t) + + case CTFLT: + Yyerror("constant %v overflows %v", Fconv(v.U.(*Mpflt), obj.FmtSharp), t) + + case CTCPLX: + Yyerror("constant %v overflows %v", Fconv(v.U.(*Mpflt), obj.FmtSharp), t) + } +} + +func tostr(v Val) Val { + switch v.Ctype() { + case CTINT, CTRUNE: + if Mpcmpfixfix(v.U.(*Mpint), Minintval[TINT]) < 0 || Mpcmpfixfix(v.U.(*Mpint), Maxintval[TINT]) > 0 { + Yyerror("overflow in int -> string") + } + r := uint(Mpgetfix(v.U.(*Mpint))) + v = Val{} + v.U = string(r) + + case CTFLT: + Yyerror("no float -> string") + fallthrough + + case CTNIL: + v = Val{} + v.U = "" + } + + return v +} + +func consttype(n *Node) int { + if n == nil || n.Op != OLITERAL { + return -1 + } + return int(n.Val().Ctype()) +} + +func Isconst(n *Node, ct int) bool { + t := consttype(n) + + // If the caller is asking for CTINT, allow CTRUNE too. + // Makes life easier for back ends. + return t == ct || (ct == CTINT && t == CTRUNE) +} + +func saveorig(n *Node) *Node { + if n == n.Orig { + // duplicate node for n->orig. + n1 := Nod(OLITERAL, nil, nil) + + n.Orig = n1 + *n1 = *n + } + + return n.Orig +} + +/* + * if n is constant, rewrite as OLITERAL node. + */ +func evconst(n *Node) { + // pick off just the opcodes that can be + // constant evaluated. + switch n.Op { + default: + return + + case OADD, + OAND, + OANDAND, + OANDNOT, + OARRAYBYTESTR, + OCOM, + ODIV, + OEQ, + OGE, + OGT, + OLE, + OLSH, + OLT, + OMINUS, + OMOD, + OMUL, + ONE, + ONOT, + OOR, + OOROR, + OPLUS, + ORSH, + OSUB, + OXOR: + break + + case OCONV: + if n.Type == nil { + return + } + if !okforconst[n.Type.Etype] && n.Type.Etype != TNIL { + return + } + + // merge adjacent constants in the argument list. + case OADDSTR: + var nr *Node + var nl *Node + var l2 *NodeList + for l1 := n.List; l1 != nil; l1 = l1.Next { + if Isconst(l1.N, CTSTR) && l1.Next != nil && Isconst(l1.Next.N, CTSTR) { + // merge from l1 up to but not including l2 + var strs []string + l2 = l1 + for l2 != nil && Isconst(l2.N, CTSTR) { + nr = l2.N + strs = append(strs, nr.Val().U.(string)) + l2 = l2.Next + } + + nl = Nod(OXXX, nil, nil) + *nl = *l1.N + nl.Orig = nl + nl.SetVal(Val{strings.Join(strs, "")}) + l1.N = nl + l1.Next = l2 + } + } + + // fix list end pointer. + for l2 := n.List; l2 != nil; l2 = l2.Next { + n.List.End = l2 + } + + // collapse single-constant list to single constant. + if count(n.List) == 1 && Isconst(n.List.N, CTSTR) { + n.Op = OLITERAL + n.SetVal(n.List.N.Val()) + } + + return + } + + nl := n.Left + if nl == nil || nl.Type == nil { + return + } + if consttype(nl) < 0 { + return + } + wl := int(nl.Type.Etype) + if Isint[wl] || Isfloat[wl] || Iscomplex[wl] { + wl = TIDEAL + } + + nr := n.Right + var rv Val + var lno int + var wr int + var v Val + var norig *Node + if nr == nil { + // copy numeric value to avoid modifying + // nl, in case someone still refers to it (e.g. iota). + v = nl.Val() + + if wl == TIDEAL { + v = copyval(v) + } + + switch uint32(n.Op)<<16 | uint32(v.Ctype()) { + default: + if n.Diag == 0 { + Yyerror("illegal constant expression %v %v", Oconv(int(n.Op), 0), nl.Type) + n.Diag = 1 + } + + return + + case OCONV<<16 | CTNIL, + OARRAYBYTESTR<<16 | CTNIL: + if n.Type.Etype == TSTRING { + v = tostr(v) + nl.Type = n.Type + break + } + fallthrough + + // fall through + case OCONV<<16 | CTINT, + OCONV<<16 | CTRUNE, + OCONV<<16 | CTFLT, + OCONV<<16 | CTSTR: + convlit1(&nl, n.Type, true) + + v = nl.Val() + + case OPLUS<<16 | CTINT, + OPLUS<<16 | CTRUNE: + break + + case OMINUS<<16 | CTINT, + OMINUS<<16 | CTRUNE: + mpnegfix(v.U.(*Mpint)) + + case OCOM<<16 | CTINT, + OCOM<<16 | CTRUNE: + et := Txxx + if nl.Type != nil { + et = int(nl.Type.Etype) + } + + // calculate the mask in b + // result will be (a ^ mask) + var b Mpint + switch et { + // signed guys change sign + default: + Mpmovecfix(&b, -1) + + // unsigned guys invert their bits + case TUINT8, + TUINT16, + TUINT32, + TUINT64, + TUINT, + TUINTPTR: + mpmovefixfix(&b, Maxintval[et]) + } + + mpxorfixfix(v.U.(*Mpint), &b) + + case OPLUS<<16 | CTFLT: + break + + case OMINUS<<16 | CTFLT: + mpnegflt(v.U.(*Mpflt)) + + case OPLUS<<16 | CTCPLX: + break + + case OMINUS<<16 | CTCPLX: + mpnegflt(&v.U.(*Mpcplx).Real) + mpnegflt(&v.U.(*Mpcplx).Imag) + + case ONOT<<16 | CTBOOL: + if !v.U.(bool) { + goto settrue + } + goto setfalse + } + goto ret + } + if nr.Type == nil { + return + } + if consttype(nr) < 0 { + return + } + wr = int(nr.Type.Etype) + if Isint[wr] || Isfloat[wr] || Iscomplex[wr] { + wr = TIDEAL + } + + // check for compatible general types (numeric, string, etc) + if wl != wr { + goto illegal + } + + // check for compatible types. + switch n.Op { + // ideal const mixes with anything but otherwise must match. + default: + if nl.Type.Etype != TIDEAL { + defaultlit(&nr, nl.Type) + n.Right = nr + } + + if nr.Type.Etype != TIDEAL { + defaultlit(&nl, nr.Type) + n.Left = nl + } + + if nl.Type.Etype != nr.Type.Etype { + goto illegal + } + + // right must be unsigned. + // left can be ideal. + case OLSH, ORSH: + defaultlit(&nr, Types[TUINT]) + + n.Right = nr + if nr.Type != nil && (Issigned[nr.Type.Etype] || !Isint[nr.Type.Etype]) { + goto illegal + } + if nl.Val().Ctype() != CTRUNE { + nl.SetVal(toint(nl.Val())) + } + nr.SetVal(toint(nr.Val())) + } + + // copy numeric value to avoid modifying + // n->left, in case someone still refers to it (e.g. iota). + v = nl.Val() + + if wl == TIDEAL { + v = copyval(v) + } + + rv = nr.Val() + + // convert to common ideal + if v.Ctype() == CTCPLX || rv.Ctype() == CTCPLX { + v = tocplx(v) + rv = tocplx(rv) + } + + if v.Ctype() == CTFLT || rv.Ctype() == CTFLT { + v = toflt(v) + rv = toflt(rv) + } + + // Rune and int turns into rune. + if v.Ctype() == CTRUNE && rv.Ctype() == CTINT { + i := new(Mpint) + mpmovefixfix(i, rv.U.(*Mpint)) + i.Rune = true + rv.U = i + } + if v.Ctype() == CTINT && rv.Ctype() == CTRUNE { + if n.Op == OLSH || n.Op == ORSH { + i := new(Mpint) + mpmovefixfix(i, rv.U.(*Mpint)) + rv.U = i + } else { + i := new(Mpint) + mpmovefixfix(i, v.U.(*Mpint)) + i.Rune = true + v.U = i + } + } + + if v.Ctype() != rv.Ctype() { + // Use of undefined name as constant? + if (v.Ctype() == 0 || rv.Ctype() == 0) && nerrors > 0 { + return + } + Fatal("constant type mismatch %v(%d) %v(%d)", nl.Type, v.Ctype(), nr.Type, rv.Ctype()) + } + + // run op + switch uint32(n.Op)<<16 | uint32(v.Ctype()) { + default: + goto illegal + + case OADD<<16 | CTINT, + OADD<<16 | CTRUNE: + mpaddfixfix(v.U.(*Mpint), rv.U.(*Mpint), 0) + + case OSUB<<16 | CTINT, + OSUB<<16 | CTRUNE: + mpsubfixfix(v.U.(*Mpint), rv.U.(*Mpint)) + + case OMUL<<16 | CTINT, + OMUL<<16 | CTRUNE: + mpmulfixfix(v.U.(*Mpint), rv.U.(*Mpint)) + + case ODIV<<16 | CTINT, + ODIV<<16 | CTRUNE: + if mpcmpfixc(rv.U.(*Mpint), 0) == 0 { + Yyerror("division by zero") + mpsetovf(v.U.(*Mpint)) + break + } + + mpdivfixfix(v.U.(*Mpint), rv.U.(*Mpint)) + + case OMOD<<16 | CTINT, + OMOD<<16 | CTRUNE: + if mpcmpfixc(rv.U.(*Mpint), 0) == 0 { + Yyerror("division by zero") + mpsetovf(v.U.(*Mpint)) + break + } + + mpmodfixfix(v.U.(*Mpint), rv.U.(*Mpint)) + + case OLSH<<16 | CTINT, + OLSH<<16 | CTRUNE: + mplshfixfix(v.U.(*Mpint), rv.U.(*Mpint)) + + case ORSH<<16 | CTINT, + ORSH<<16 | CTRUNE: + mprshfixfix(v.U.(*Mpint), rv.U.(*Mpint)) + + case OOR<<16 | CTINT, + OOR<<16 | CTRUNE: + mporfixfix(v.U.(*Mpint), rv.U.(*Mpint)) + + case OAND<<16 | CTINT, + OAND<<16 | CTRUNE: + mpandfixfix(v.U.(*Mpint), rv.U.(*Mpint)) + + case OANDNOT<<16 | CTINT, + OANDNOT<<16 | CTRUNE: + mpandnotfixfix(v.U.(*Mpint), rv.U.(*Mpint)) + + case OXOR<<16 | CTINT, + OXOR<<16 | CTRUNE: + mpxorfixfix(v.U.(*Mpint), rv.U.(*Mpint)) + + case OADD<<16 | CTFLT: + mpaddfltflt(v.U.(*Mpflt), rv.U.(*Mpflt)) + + case OSUB<<16 | CTFLT: + mpsubfltflt(v.U.(*Mpflt), rv.U.(*Mpflt)) + + case OMUL<<16 | CTFLT: + mpmulfltflt(v.U.(*Mpflt), rv.U.(*Mpflt)) + + case ODIV<<16 | CTFLT: + if mpcmpfltc(rv.U.(*Mpflt), 0) == 0 { + Yyerror("division by zero") + Mpmovecflt(v.U.(*Mpflt), 1.0) + break + } + + mpdivfltflt(v.U.(*Mpflt), rv.U.(*Mpflt)) + + // The default case above would print 'ideal % ideal', + // which is not quite an ideal error. + case OMOD<<16 | CTFLT: + if n.Diag == 0 { + Yyerror("illegal constant expression: floating-point %% operation") + n.Diag = 1 + } + + return + + case OADD<<16 | CTCPLX: + mpaddfltflt(&v.U.(*Mpcplx).Real, &rv.U.(*Mpcplx).Real) + mpaddfltflt(&v.U.(*Mpcplx).Imag, &rv.U.(*Mpcplx).Imag) + + case OSUB<<16 | CTCPLX: + mpsubfltflt(&v.U.(*Mpcplx).Real, &rv.U.(*Mpcplx).Real) + mpsubfltflt(&v.U.(*Mpcplx).Imag, &rv.U.(*Mpcplx).Imag) + + case OMUL<<16 | CTCPLX: + cmplxmpy(v.U.(*Mpcplx), rv.U.(*Mpcplx)) + + case ODIV<<16 | CTCPLX: + if mpcmpfltc(&rv.U.(*Mpcplx).Real, 0) == 0 && mpcmpfltc(&rv.U.(*Mpcplx).Imag, 0) == 0 { + Yyerror("complex division by zero") + Mpmovecflt(&rv.U.(*Mpcplx).Real, 1.0) + Mpmovecflt(&rv.U.(*Mpcplx).Imag, 0.0) + break + } + + cmplxdiv(v.U.(*Mpcplx), rv.U.(*Mpcplx)) + + case OEQ<<16 | CTNIL: + goto settrue + + case ONE<<16 | CTNIL: + goto setfalse + + case OEQ<<16 | CTINT, + OEQ<<16 | CTRUNE: + if Mpcmpfixfix(v.U.(*Mpint), rv.U.(*Mpint)) == 0 { + goto settrue + } + goto setfalse + + case ONE<<16 | CTINT, + ONE<<16 | CTRUNE: + if Mpcmpfixfix(v.U.(*Mpint), rv.U.(*Mpint)) != 0 { + goto settrue + } + goto setfalse + + case OLT<<16 | CTINT, + OLT<<16 | CTRUNE: + if Mpcmpfixfix(v.U.(*Mpint), rv.U.(*Mpint)) < 0 { + goto settrue + } + goto setfalse + + case OLE<<16 | CTINT, + OLE<<16 | CTRUNE: + if Mpcmpfixfix(v.U.(*Mpint), rv.U.(*Mpint)) <= 0 { + goto settrue + } + goto setfalse + + case OGE<<16 | CTINT, + OGE<<16 | CTRUNE: + if Mpcmpfixfix(v.U.(*Mpint), rv.U.(*Mpint)) >= 0 { + goto settrue + } + goto setfalse + + case OGT<<16 | CTINT, + OGT<<16 | CTRUNE: + if Mpcmpfixfix(v.U.(*Mpint), rv.U.(*Mpint)) > 0 { + goto settrue + } + goto setfalse + + case OEQ<<16 | CTFLT: + if mpcmpfltflt(v.U.(*Mpflt), rv.U.(*Mpflt)) == 0 { + goto settrue + } + goto setfalse + + case ONE<<16 | CTFLT: + if mpcmpfltflt(v.U.(*Mpflt), rv.U.(*Mpflt)) != 0 { + goto settrue + } + goto setfalse + + case OLT<<16 | CTFLT: + if mpcmpfltflt(v.U.(*Mpflt), rv.U.(*Mpflt)) < 0 { + goto settrue + } + goto setfalse + + case OLE<<16 | CTFLT: + if mpcmpfltflt(v.U.(*Mpflt), rv.U.(*Mpflt)) <= 0 { + goto settrue + } + goto setfalse + + case OGE<<16 | CTFLT: + if mpcmpfltflt(v.U.(*Mpflt), rv.U.(*Mpflt)) >= 0 { + goto settrue + } + goto setfalse + + case OGT<<16 | CTFLT: + if mpcmpfltflt(v.U.(*Mpflt), rv.U.(*Mpflt)) > 0 { + goto settrue + } + goto setfalse + + case OEQ<<16 | CTCPLX: + if mpcmpfltflt(&v.U.(*Mpcplx).Real, &rv.U.(*Mpcplx).Real) == 0 && mpcmpfltflt(&v.U.(*Mpcplx).Imag, &rv.U.(*Mpcplx).Imag) == 0 { + goto settrue + } + goto setfalse + + case ONE<<16 | CTCPLX: + if mpcmpfltflt(&v.U.(*Mpcplx).Real, &rv.U.(*Mpcplx).Real) != 0 || mpcmpfltflt(&v.U.(*Mpcplx).Imag, &rv.U.(*Mpcplx).Imag) != 0 { + goto settrue + } + goto setfalse + + case OEQ<<16 | CTSTR: + if cmpslit(nl, nr) == 0 { + goto settrue + } + goto setfalse + + case ONE<<16 | CTSTR: + if cmpslit(nl, nr) != 0 { + goto settrue + } + goto setfalse + + case OLT<<16 | CTSTR: + if cmpslit(nl, nr) < 0 { + goto settrue + } + goto setfalse + + case OLE<<16 | CTSTR: + if cmpslit(nl, nr) <= 0 { + goto settrue + } + goto setfalse + + case OGE<<16 | CTSTR: + if cmpslit(nl, nr) >= 0 { + goto settrue + } + goto setfalse + + case OGT<<16 | CTSTR: + if cmpslit(nl, nr) > 0 { + goto settrue + } + goto setfalse + + case OOROR<<16 | CTBOOL: + if v.U.(bool) || rv.U.(bool) { + goto settrue + } + goto setfalse + + case OANDAND<<16 | CTBOOL: + if v.U.(bool) && rv.U.(bool) { + goto settrue + } + goto setfalse + + case OEQ<<16 | CTBOOL: + if v.U.(bool) == rv.U.(bool) { + goto settrue + } + goto setfalse + + case ONE<<16 | CTBOOL: + if v.U.(bool) != rv.U.(bool) { + goto settrue + } + goto setfalse + } + + goto ret + +ret: + norig = saveorig(n) + *n = *nl + + // restore value of n->orig. + n.Orig = norig + + n.SetVal(v) + + // check range. + lno = int(setlineno(n)) + + overflow(v, n.Type) + lineno = int32(lno) + + // truncate precision for non-ideal float. + if v.Ctype() == CTFLT && n.Type.Etype != TIDEAL { + n.SetVal(Val{truncfltlit(v.U.(*Mpflt), n.Type)}) + } + return + +settrue: + norig = saveorig(n) + *n = *Nodbool(true) + n.Orig = norig + return + +setfalse: + norig = saveorig(n) + *n = *Nodbool(false) + n.Orig = norig + return + +illegal: + if n.Diag == 0 { + Yyerror("illegal constant expression: %v %v %v", nl.Type, Oconv(int(n.Op), 0), nr.Type) + n.Diag = 1 + } + + return +} + +func nodlit(v Val) *Node { + n := Nod(OLITERAL, nil, nil) + n.SetVal(v) + switch v.Ctype() { + default: + Fatal("nodlit ctype %d", v.Ctype()) + + case CTSTR: + n.Type = idealstring + + case CTBOOL: + n.Type = idealbool + + case CTINT, CTRUNE, CTFLT, CTCPLX: + n.Type = Types[TIDEAL] + + case CTNIL: + n.Type = Types[TNIL] + } + + return n +} + +func nodcplxlit(r Val, i Val) *Node { + r = toflt(r) + i = toflt(i) + + c := new(Mpcplx) + n := Nod(OLITERAL, nil, nil) + n.Type = Types[TIDEAL] + n.SetVal(Val{c}) + + if r.Ctype() != CTFLT || i.Ctype() != CTFLT { + Fatal("nodcplxlit ctype %d/%d", r.Ctype(), i.Ctype()) + } + + mpmovefltflt(&c.Real, r.U.(*Mpflt)) + mpmovefltflt(&c.Imag, i.U.(*Mpflt)) + return n +} + +// idealkind returns a constant kind like consttype +// but for an arbitrary "ideal" (untyped constant) expression. +func idealkind(n *Node) int { + if n == nil || !isideal(n.Type) { + return CTxxx + } + + switch n.Op { + default: + return CTxxx + + case OLITERAL: + return int(n.Val().Ctype()) + + // numeric kinds. + case OADD, + OAND, + OANDNOT, + OCOM, + ODIV, + OMINUS, + OMOD, + OMUL, + OSUB, + OXOR, + OOR, + OPLUS: + k1 := idealkind(n.Left) + + k2 := idealkind(n.Right) + if k1 > k2 { + return k1 + } else { + return k2 + } + + case OREAL, OIMAG: + return CTFLT + + case OCOMPLEX: + return CTCPLX + + case OADDSTR: + return CTSTR + + case OANDAND, + OEQ, + OGE, + OGT, + OLE, + OLT, + ONE, + ONOT, + OOROR, + OCMPSTR, + OCMPIFACE: + return CTBOOL + + // shifts (beware!). + case OLSH, ORSH: + return idealkind(n.Left) + } +} + +func defaultlit(np **Node, t *Type) { + n := *np + if n == nil || !isideal(n.Type) { + return + } + + if n.Op == OLITERAL { + nn := Nod(OXXX, nil, nil) + *nn = *n + n = nn + *np = n + } + + lno := int(setlineno(n)) + ctype := idealkind(n) + var t1 *Type + switch ctype { + default: + if t != nil { + Convlit(np, t) + return + } + + if n.Val().Ctype() == CTNIL { + lineno = int32(lno) + if n.Diag == 0 { + Yyerror("use of untyped nil") + n.Diag = 1 + } + + n.Type = nil + break + } + + if n.Val().Ctype() == CTSTR { + t1 := Types[TSTRING] + Convlit(np, t1) + break + } + + Yyerror("defaultlit: unknown literal: %v", n) + + case CTxxx: + Fatal("defaultlit: idealkind is CTxxx: %v", Nconv(n, obj.FmtSign)) + + case CTBOOL: + t1 := Types[TBOOL] + if t != nil && t.Etype == TBOOL { + t1 = t + } + Convlit(np, t1) + + case CTINT: + t1 = Types[TINT] + goto num + + case CTRUNE: + t1 = runetype + goto num + + case CTFLT: + t1 = Types[TFLOAT64] + goto num + + case CTCPLX: + t1 = Types[TCOMPLEX128] + goto num + } + + lineno = int32(lno) + return + +num: + if t != nil { + if Isint[t.Etype] { + t1 = t + n.SetVal(toint(n.Val())) + } else if Isfloat[t.Etype] { + t1 = t + n.SetVal(toflt(n.Val())) + } else if Iscomplex[t.Etype] { + t1 = t + n.SetVal(tocplx(n.Val())) + } + } + + overflow(n.Val(), t1) + Convlit(np, t1) + lineno = int32(lno) + return +} + +/* + * defaultlit on both nodes simultaneously; + * if they're both ideal going in they better + * get the same type going out. + * force means must assign concrete (non-ideal) type. + */ +func defaultlit2(lp **Node, rp **Node, force int) { + l := *lp + r := *rp + if l.Type == nil || r.Type == nil { + return + } + if !isideal(l.Type) { + Convlit(rp, l.Type) + return + } + + if !isideal(r.Type) { + Convlit(lp, r.Type) + return + } + + if force == 0 { + return + } + if l.Type.Etype == TBOOL { + Convlit(lp, Types[TBOOL]) + Convlit(rp, Types[TBOOL]) + } + + lkind := idealkind(l) + rkind := idealkind(r) + if lkind == CTCPLX || rkind == CTCPLX { + Convlit(lp, Types[TCOMPLEX128]) + Convlit(rp, Types[TCOMPLEX128]) + return + } + + if lkind == CTFLT || rkind == CTFLT { + Convlit(lp, Types[TFLOAT64]) + Convlit(rp, Types[TFLOAT64]) + return + } + + if lkind == CTRUNE || rkind == CTRUNE { + Convlit(lp, runetype) + Convlit(rp, runetype) + return + } + + Convlit(lp, Types[TINT]) + Convlit(rp, Types[TINT]) +} + +func cmpslit(l, r *Node) int { + return stringsCompare(l.Val().U.(string), r.Val().U.(string)) +} + +func Smallintconst(n *Node) bool { + if n.Op == OLITERAL && Isconst(n, CTINT) && n.Type != nil { + switch Simtype[n.Type.Etype] { + case TINT8, + TUINT8, + TINT16, + TUINT16, + TINT32, + TUINT32, + TBOOL, + TPTR32: + return true + + case TIDEAL, TINT64, TUINT64, TPTR64: + if Mpcmpfixfix(n.Val().U.(*Mpint), Minintval[TINT32]) < 0 || Mpcmpfixfix(n.Val().U.(*Mpint), Maxintval[TINT32]) > 0 { + break + } + return true + } + } + + return false +} + +func nonnegconst(n *Node) int { + if n.Op == OLITERAL && n.Type != nil { + switch Simtype[n.Type.Etype] { + // check negative and 2^31 + case TINT8, + TUINT8, + TINT16, + TUINT16, + TINT32, + TUINT32, + TINT64, + TUINT64, + TIDEAL: + if Mpcmpfixfix(n.Val().U.(*Mpint), Minintval[TUINT32]) < 0 || Mpcmpfixfix(n.Val().U.(*Mpint), Maxintval[TINT32]) > 0 { + break + } + return int(Mpgetfix(n.Val().U.(*Mpint))) + } + } + + return -1 +} + +/* + * convert x to type et and back to int64 + * for sign extension and truncation. + */ +func iconv(x int64, et int) int64 { + switch et { + case TINT8: + x = int64(int8(x)) + + case TUINT8: + x = int64(uint8(x)) + + case TINT16: + x = int64(int16(x)) + + case TUINT16: + x = int64(uint64(x)) + + case TINT32: + x = int64(int32(x)) + + case TUINT32: + x = int64(uint32(x)) + + case TINT64, TUINT64: + break + } + + return x +} + +// Convconst converts constant node n to type t and +// places the result in con. +func (n *Node) Convconst(con *Node, t *Type) { + tt := Simsimtype(t) + + // copy the constant for conversion + Nodconst(con, Types[TINT8], 0) + + con.Type = t + con.SetVal(n.Val()) + + if Isint[tt] { + con.SetVal(Val{new(Mpint)}) + var i int64 + switch n.Val().Ctype() { + default: + Fatal("convconst ctype=%d %v", n.Val().Ctype(), Tconv(t, obj.FmtLong)) + + case CTINT, CTRUNE: + i = Mpgetfix(n.Val().U.(*Mpint)) + + case CTBOOL: + i = int64(obj.Bool2int(n.Val().U.(bool))) + + case CTNIL: + i = 0 + } + + i = iconv(i, tt) + Mpmovecfix(con.Val().U.(*Mpint), i) + return + } + + if Isfloat[tt] { + con.SetVal(toflt(con.Val())) + if con.Val().Ctype() != CTFLT { + Fatal("convconst ctype=%d %v", con.Val().Ctype(), t) + } + if tt == TFLOAT32 { + con.SetVal(Val{truncfltlit(con.Val().U.(*Mpflt), t)}) + } + return + } + + if Iscomplex[tt] { + con.SetVal(tocplx(con.Val())) + if tt == TCOMPLEX64 { + con.Val().U.(*Mpcplx).Real = *truncfltlit(&con.Val().U.(*Mpcplx).Real, Types[TFLOAT32]) + con.Val().U.(*Mpcplx).Imag = *truncfltlit(&con.Val().U.(*Mpcplx).Imag, Types[TFLOAT32]) + } + return + } + + Fatal("convconst %v constant", Tconv(t, obj.FmtLong)) +} + +// complex multiply v *= rv +// (a, b) * (c, d) = (a*c - b*d, b*c + a*d) +func cmplxmpy(v *Mpcplx, rv *Mpcplx) { + var ac Mpflt + var bd Mpflt + var bc Mpflt + var ad Mpflt + + mpmovefltflt(&ac, &v.Real) + mpmulfltflt(&ac, &rv.Real) // ac + + mpmovefltflt(&bd, &v.Imag) + + mpmulfltflt(&bd, &rv.Imag) // bd + + mpmovefltflt(&bc, &v.Imag) + + mpmulfltflt(&bc, &rv.Real) // bc + + mpmovefltflt(&ad, &v.Real) + + mpmulfltflt(&ad, &rv.Imag) // ad + + mpmovefltflt(&v.Real, &ac) + + mpsubfltflt(&v.Real, &bd) // ac-bd + + mpmovefltflt(&v.Imag, &bc) + + mpaddfltflt(&v.Imag, &ad) // bc+ad +} + +// complex divide v /= rv +// (a, b) / (c, d) = ((a*c + b*d), (b*c - a*d))/(c*c + d*d) +func cmplxdiv(v *Mpcplx, rv *Mpcplx) { + var ac Mpflt + var bd Mpflt + var bc Mpflt + var ad Mpflt + var cc_plus_dd Mpflt + + mpmovefltflt(&cc_plus_dd, &rv.Real) + mpmulfltflt(&cc_plus_dd, &rv.Real) // cc + + mpmovefltflt(&ac, &rv.Imag) + + mpmulfltflt(&ac, &rv.Imag) // dd + + mpaddfltflt(&cc_plus_dd, &ac) // cc+dd + + mpmovefltflt(&ac, &v.Real) + + mpmulfltflt(&ac, &rv.Real) // ac + + mpmovefltflt(&bd, &v.Imag) + + mpmulfltflt(&bd, &rv.Imag) // bd + + mpmovefltflt(&bc, &v.Imag) + + mpmulfltflt(&bc, &rv.Real) // bc + + mpmovefltflt(&ad, &v.Real) + + mpmulfltflt(&ad, &rv.Imag) // ad + + mpmovefltflt(&v.Real, &ac) + + mpaddfltflt(&v.Real, &bd) // ac+bd + mpdivfltflt(&v.Real, &cc_plus_dd) // (ac+bd)/(cc+dd) + + mpmovefltflt(&v.Imag, &bc) + + mpsubfltflt(&v.Imag, &ad) // bc-ad + mpdivfltflt(&v.Imag, &cc_plus_dd) // (bc+ad)/(cc+dd) +} + +// Is n a Go language constant (as opposed to a compile-time constant)? +// Expressions derived from nil, like string([]byte(nil)), while they +// may be known at compile time, are not Go language constants. +// Only called for expressions known to evaluated to compile-time +// constants. +func isgoconst(n *Node) bool { + if n.Orig != nil { + n = n.Orig + } + + switch n.Op { + case OADD, + OADDSTR, + OAND, + OANDAND, + OANDNOT, + OCOM, + ODIV, + OEQ, + OGE, + OGT, + OLE, + OLSH, + OLT, + OMINUS, + OMOD, + OMUL, + ONE, + ONOT, + OOR, + OOROR, + OPLUS, + ORSH, + OSUB, + OXOR, + OIOTA, + OCOMPLEX, + OREAL, + OIMAG: + if isgoconst(n.Left) && (n.Right == nil || isgoconst(n.Right)) { + return true + } + + case OCONV: + if okforconst[n.Type.Etype] && isgoconst(n.Left) { + return true + } + + case OLEN, OCAP: + l := n.Left + if isgoconst(l) { + return true + } + + // Special case: len/cap is constant when applied to array or + // pointer to array when the expression does not contain + // function calls or channel receive operations. + t := l.Type + + if t != nil && Isptr[t.Etype] { + t = t.Type + } + if Isfixedarray(t) && !hascallchan(l) { + return true + } + + case OLITERAL: + if n.Val().Ctype() != CTNIL { + return true + } + + case ONAME: + l := n.Sym.Def + if l != nil && l.Op == OLITERAL && n.Val().Ctype() != CTNIL { + return true + } + + case ONONAME: + if n.Sym.Def != nil && n.Sym.Def.Op == OIOTA { + return true + } + + // Only constant calls are unsafe.Alignof, Offsetof, and Sizeof. + case OCALL: + l := n.Left + + for l.Op == OPAREN { + l = l.Left + } + if l.Op != ONAME || l.Sym.Pkg != unsafepkg { + break + } + if l.Sym.Name == "Alignof" || l.Sym.Name == "Offsetof" || l.Sym.Name == "Sizeof" { + return true + } + } + + //dump("nonconst", n); + return false +} + +func hascallchan(n *Node) bool { + if n == nil { + return false + } + switch n.Op { + case OAPPEND, + OCALL, + OCALLFUNC, + OCALLINTER, + OCALLMETH, + OCAP, + OCLOSE, + OCOMPLEX, + OCOPY, + ODELETE, + OIMAG, + OLEN, + OMAKE, + ONEW, + OPANIC, + OPRINT, + OPRINTN, + OREAL, + ORECOVER, + ORECV: + return true + } + + if hascallchan(n.Left) || hascallchan(n.Right) { + return true + } + + for l := n.List; l != nil; l = l.Next { + if hascallchan(l.N) { + return true + } + } + for l := n.Rlist; l != nil; l = l.Next { + if hascallchan(l.N) { + return true + } + } + + return false +} diff --git a/src/cmd/compile/internal/gc/cplx.go b/src/cmd/compile/internal/gc/cplx.go new file mode 100644 index 0000000000000000000000000000000000000000..1643f262b5499d582d8081de5932733d57c77924 --- /dev/null +++ b/src/cmd/compile/internal/gc/cplx.go @@ -0,0 +1,479 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package gc + +import "cmd/internal/obj" + +func overlap_cplx(f *Node, t *Node) bool { + // check whether f and t could be overlapping stack references. + // not exact, because it's hard to check for the stack register + // in portable code. close enough: worst case we will allocate + // an extra temporary and the registerizer will clean it up. + return f.Op == OINDREG && t.Op == OINDREG && f.Xoffset+f.Type.Width >= t.Xoffset && t.Xoffset+t.Type.Width >= f.Xoffset +} + +func complexbool(op int, nl, nr, res *Node, wantTrue bool, likely int, to *obj.Prog) { + // make both sides addable in ullman order + if nr != nil { + if nl.Ullman > nr.Ullman && !nl.Addable { + nl = CgenTemp(nl) + } + + if !nr.Addable { + nr = CgenTemp(nr) + } + } + if !nl.Addable { + nl = CgenTemp(nl) + } + + // Break nl and nr into real and imaginary components. + var lreal, limag, rreal, rimag Node + subnode(&lreal, &limag, nl) + subnode(&rreal, &rimag, nr) + + // build tree + // if branching: + // real(l) == real(r) && imag(l) == imag(r) + // if generating a value, use a branch-free version: + // real(l) == real(r) & imag(l) == imag(r) + realeq := Node{ + Op: OEQ, + Left: &lreal, + Right: &rreal, + Type: Types[TBOOL], + } + imageq := Node{ + Op: OEQ, + Left: &limag, + Right: &rimag, + Type: Types[TBOOL], + } + and := Node{ + Op: OANDAND, + Left: &realeq, + Right: &imageq, + Type: Types[TBOOL], + } + + if res != nil { + // generating a value + and.Op = OAND + if op == ONE { + and.Op = OOR + realeq.Op = ONE + imageq.Op = ONE + } + Bvgen(&and, res, true) + return + } + + // generating a branch + if op == ONE { + wantTrue = !wantTrue + } + + Bgen(&and, wantTrue, likely, to) +} + +// break addable nc-complex into nr-real and ni-imaginary +func subnode(nr *Node, ni *Node, nc *Node) { + if !nc.Addable { + Fatal("subnode not addable") + } + + tc := Simsimtype(nc.Type) + tc = cplxsubtype(tc) + t := Types[tc] + + if nc.Op == OLITERAL { + nodfconst(nr, t, &nc.Val().U.(*Mpcplx).Real) + nodfconst(ni, t, &nc.Val().U.(*Mpcplx).Imag) + return + } + + *nr = *nc + nr.Type = t + + *ni = *nc + ni.Type = t + ni.Xoffset += t.Width +} + +// generate code res = -nl +func minus(nl *Node, res *Node) { + var ra Node + ra.Op = OMINUS + ra.Left = nl + ra.Type = nl.Type + Cgen(&ra, res) +} + +// build and execute tree +// real(res) = -real(nl) +// imag(res) = -imag(nl) +func complexminus(nl *Node, res *Node) { + var n1 Node + var n2 Node + var n5 Node + var n6 Node + + subnode(&n1, &n2, nl) + subnode(&n5, &n6, res) + + minus(&n1, &n5) + minus(&n2, &n6) +} + +// build and execute tree +// real(res) = real(nl) op real(nr) +// imag(res) = imag(nl) op imag(nr) +func complexadd(op int, nl *Node, nr *Node, res *Node) { + var n1 Node + var n2 Node + var n3 Node + var n4 Node + var n5 Node + var n6 Node + + subnode(&n1, &n2, nl) + subnode(&n3, &n4, nr) + subnode(&n5, &n6, res) + + var ra Node + ra.Op = uint8(op) + ra.Left = &n1 + ra.Right = &n3 + ra.Type = n1.Type + Cgen(&ra, &n5) + + ra = Node{} + ra.Op = uint8(op) + ra.Left = &n2 + ra.Right = &n4 + ra.Type = n2.Type + Cgen(&ra, &n6) +} + +// build and execute tree +// tmp = real(nl)*real(nr) - imag(nl)*imag(nr) +// imag(res) = real(nl)*imag(nr) + imag(nl)*real(nr) +// real(res) = tmp +func complexmul(nl *Node, nr *Node, res *Node) { + var n1 Node + var n2 Node + var n3 Node + var n4 Node + var n5 Node + var n6 Node + var tmp Node + + subnode(&n1, &n2, nl) + subnode(&n3, &n4, nr) + subnode(&n5, &n6, res) + Tempname(&tmp, n5.Type) + + // real part -> tmp + var rm1 Node + + rm1.Op = OMUL + rm1.Left = &n1 + rm1.Right = &n3 + rm1.Type = n1.Type + + var rm2 Node + rm2.Op = OMUL + rm2.Left = &n2 + rm2.Right = &n4 + rm2.Type = n2.Type + + var ra Node + ra.Op = OSUB + ra.Left = &rm1 + ra.Right = &rm2 + ra.Type = rm1.Type + Cgen(&ra, &tmp) + + // imag part + rm1 = Node{} + + rm1.Op = OMUL + rm1.Left = &n1 + rm1.Right = &n4 + rm1.Type = n1.Type + + rm2 = Node{} + rm2.Op = OMUL + rm2.Left = &n2 + rm2.Right = &n3 + rm2.Type = n2.Type + + ra = Node{} + ra.Op = OADD + ra.Left = &rm1 + ra.Right = &rm2 + ra.Type = rm1.Type + Cgen(&ra, &n6) + + // tmp ->real part + Cgen(&tmp, &n5) +} + +func nodfconst(n *Node, t *Type, fval *Mpflt) { + *n = Node{} + n.Op = OLITERAL + n.Addable = true + ullmancalc(n) + n.SetVal(Val{fval}) + n.Type = t + + if !Isfloat[t.Etype] { + Fatal("nodfconst: bad type %v", t) + } +} + +func Complexop(n *Node, res *Node) bool { + if n != nil && n.Type != nil { + if Iscomplex[n.Type.Etype] { + goto maybe + } + } + + if res != nil && res.Type != nil { + if Iscomplex[res.Type.Etype] { + goto maybe + } + } + + if n.Op == OREAL || n.Op == OIMAG { + //dump("\ncomplex-yes", n); + return true + } + + //dump("\ncomplex-no", n); + return false + +maybe: + switch n.Op { + case OCONV, // implemented ops + OADD, + OSUB, + OMUL, + OMINUS, + OCOMPLEX, + OREAL, + OIMAG: + //dump("\ncomplex-yes", n); + return true + + case ODOT, + ODOTPTR, + OINDEX, + OIND, + ONAME: + //dump("\ncomplex-yes", n); + return true + } + + //dump("\ncomplex-no", n); + return false +} + +func Complexmove(f *Node, t *Node) { + if Debug['g'] != 0 { + Dump("\ncomplexmove-f", f) + Dump("complexmove-t", t) + } + + if !t.Addable { + Fatal("complexmove: to not addable") + } + + ft := Simsimtype(f.Type) + tt := Simsimtype(t.Type) + switch uint32(ft)<<16 | uint32(tt) { + default: + Fatal("complexmove: unknown conversion: %v -> %v\n", f.Type, t.Type) + + // complex to complex move/convert. + // make f addable. + // also use temporary if possible stack overlap. + case TCOMPLEX64<<16 | TCOMPLEX64, + TCOMPLEX64<<16 | TCOMPLEX128, + TCOMPLEX128<<16 | TCOMPLEX64, + TCOMPLEX128<<16 | TCOMPLEX128: + if !f.Addable || overlap_cplx(f, t) { + var tmp Node + Tempname(&tmp, f.Type) + Complexmove(f, &tmp) + f = &tmp + } + + var n1 Node + var n2 Node + subnode(&n1, &n2, f) + var n4 Node + var n3 Node + subnode(&n3, &n4, t) + + Cgen(&n1, &n3) + Cgen(&n2, &n4) + } +} + +func Complexgen(n *Node, res *Node) { + if Debug['g'] != 0 { + Dump("\ncomplexgen-n", n) + Dump("complexgen-res", res) + } + + for n.Op == OCONVNOP { + n = n.Left + } + + // pick off float/complex opcodes + switch n.Op { + case OCOMPLEX: + if res.Addable { + var n1 Node + var n2 Node + subnode(&n1, &n2, res) + var tmp Node + Tempname(&tmp, n1.Type) + Cgen(n.Left, &tmp) + Cgen(n.Right, &n2) + Cgen(&tmp, &n1) + return + } + + case OREAL, OIMAG: + nl := n.Left + if !nl.Addable { + var tmp Node + Tempname(&tmp, nl.Type) + Complexgen(nl, &tmp) + nl = &tmp + } + + var n1 Node + var n2 Node + subnode(&n1, &n2, nl) + if n.Op == OREAL { + Cgen(&n1, res) + return + } + + Cgen(&n2, res) + return + } + + // perform conversion from n to res + tl := Simsimtype(res.Type) + + tl = cplxsubtype(tl) + tr := Simsimtype(n.Type) + tr = cplxsubtype(tr) + if tl != tr { + if !n.Addable { + var n1 Node + Tempname(&n1, n.Type) + Complexmove(n, &n1) + n = &n1 + } + + Complexmove(n, res) + return + } + + if !res.Addable { + var n1 Node + Igen(res, &n1, nil) + Cgen(n, &n1) + Regfree(&n1) + return + } + + if n.Addable { + Complexmove(n, res) + return + } + + switch n.Op { + default: + Dump("complexgen: unknown op", n) + Fatal("complexgen: unknown op %v", Oconv(int(n.Op), 0)) + + case ODOT, + ODOTPTR, + OINDEX, + OIND, + ONAME, // PHEAP or PPARAMREF var + OCALLFUNC, + OCALLMETH, + OCALLINTER: + var n1 Node + Igen(n, &n1, res) + + Complexmove(&n1, res) + Regfree(&n1) + return + + case OCONV, + OADD, + OSUB, + OMUL, + OMINUS, + OCOMPLEX, + OREAL, + OIMAG: + break + } + + nl := n.Left + if nl == nil { + return + } + nr := n.Right + + // make both sides addable in ullman order + var tnl Node + if nr != nil { + if nl.Ullman > nr.Ullman && !nl.Addable { + Tempname(&tnl, nl.Type) + Cgen(nl, &tnl) + nl = &tnl + } + + if !nr.Addable { + var tnr Node + Tempname(&tnr, nr.Type) + Cgen(nr, &tnr) + nr = &tnr + } + } + + if !nl.Addable { + Tempname(&tnl, nl.Type) + Cgen(nl, &tnl) + nl = &tnl + } + + switch n.Op { + default: + Fatal("complexgen: unknown op %v", Oconv(int(n.Op), 0)) + + case OCONV: + Complexmove(nl, res) + + case OMINUS: + complexminus(nl, res) + + case OADD, OSUB: + complexadd(int(n.Op), nl, nr, res) + + case OMUL: + complexmul(nl, nr, res) + } +} diff --git a/src/cmd/compile/internal/gc/dcl.go b/src/cmd/compile/internal/gc/dcl.go new file mode 100644 index 0000000000000000000000000000000000000000..c8864f305e21b0f68045af6a2bea9cc2f37c226b --- /dev/null +++ b/src/cmd/compile/internal/gc/dcl.go @@ -0,0 +1,1513 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package gc + +import ( + "cmd/internal/obj" + "fmt" + "strings" +) + +func dflag() bool { + if Debug['d'] == 0 { + return false + } + if Debug['y'] != 0 { + return true + } + if incannedimport != 0 { + return false + } + return true +} + +/* + * declaration stack & operations + */ +func dcopy(a *Sym, b *Sym) { + a.Pkg = b.Pkg + a.Name = b.Name + a.Def = b.Def + a.Block = b.Block + a.Lastlineno = b.Lastlineno +} + +func push() *Sym { + d := new(Sym) + d.Lastlineno = lineno + d.Link = dclstack + dclstack = d + return d +} + +func pushdcl(s *Sym) *Sym { + d := push() + dcopy(d, s) + if dflag() { + fmt.Printf("\t%v push %v %p\n", Ctxt.Line(int(lineno)), s, s.Def) + } + return d +} + +func popdcl() { + var d *Sym + var s *Sym + var lno int + + // if(dflag()) + // print("revert\n"); + + for d = dclstack; d != nil; d = d.Link { + if d.Name == "" { + break + } + s = Pkglookup(d.Name, d.Pkg) + lno = int(s.Lastlineno) + dcopy(s, d) + d.Lastlineno = int32(lno) + if dflag() { + fmt.Printf("\t%v pop %v %p\n", Ctxt.Line(int(lineno)), s, s.Def) + } + } + + if d == nil { + Fatal("popdcl: no mark") + } + dclstack = d.Link + block = d.Block +} + +func poptodcl() { + // pop the old marker and push a new one + // (cannot reuse the existing one) + // because we use the markers to identify blocks + // for the goto restriction checks. + popdcl() + + markdcl() +} + +func markdcl() { + d := push() + d.Name = "" // used as a mark in fifo + d.Block = block + + blockgen++ + block = blockgen +} + +// if(dflag()) +// print("markdcl\n"); +func dumpdcl(st string) { + var s *Sym + + i := 0 + for d := dclstack; d != nil; d = d.Link { + i++ + fmt.Printf(" %.2d %p", i, d) + if d.Name == "" { + fmt.Printf("\n") + continue + } + + fmt.Printf(" '%s'", d.Name) + s = Pkglookup(d.Name, d.Pkg) + fmt.Printf(" %v\n", s) + } +} + +func testdclstack() { + for d := dclstack; d != nil; d = d.Link { + if d.Name == "" { + if nerrors != 0 { + errorexit() + } + Yyerror("mark left on the stack") + continue + } + } +} + +func redeclare(s *Sym, where string) { + if s.Lastlineno == 0 { + var tmp string + if s.Origpkg != nil { + tmp = s.Origpkg.Path + } else { + tmp = s.Pkg.Path + } + pkgstr := tmp + Yyerror("%v redeclared %s\n"+"\tprevious declaration during import %q", s, where, pkgstr) + } else { + line1 := parserline() + line2 := int(s.Lastlineno) + + // When an import and a declaration collide in separate files, + // present the import as the "redeclared", because the declaration + // is visible where the import is, but not vice versa. + // See issue 4510. + if s.Def == nil { + line2 = line1 + line1 = int(s.Lastlineno) + } + + yyerrorl(int(line1), "%v redeclared %s\n"+"\tprevious declaration at %v", s, where, Ctxt.Line(line2)) + } +} + +var vargen int + +/* + * declare individual names - var, typ, const + */ + +var declare_typegen int + +func declare(n *Node, ctxt uint8) { + if ctxt == PDISCARD { + return + } + + if isblank(n) { + return + } + + if n.Name == nil { + // named OLITERAL needs Name; most OLITERALs don't. + n.Name = new(Name) + } + n.Lineno = int32(parserline()) + s := n.Sym + + // kludgy: typecheckok means we're past parsing. Eg genwrapper may declare out of package names later. + if importpkg == nil && typecheckok == 0 && s.Pkg != localpkg { + Yyerror("cannot declare name %v", s) + } + + if ctxt == PEXTERN && s.Name == "init" { + Yyerror("cannot declare init - must be func") + } + + gen := 0 + if ctxt == PEXTERN { + externdcl = list(externdcl, n) + if dflag() { + fmt.Printf("\t%v global decl %v %p\n", Ctxt.Line(int(lineno)), s, n) + } + } else { + if Curfn == nil && ctxt == PAUTO { + Fatal("automatic outside function") + } + if Curfn != nil { + Curfn.Func.Dcl = list(Curfn.Func.Dcl, n) + } + if n.Op == OTYPE { + declare_typegen++ + gen = declare_typegen + } else if n.Op == ONAME && ctxt == PAUTO && !strings.Contains(s.Name, "·") { + vargen++ + gen = vargen + } + pushdcl(s) + n.Name.Curfn = Curfn + } + + if ctxt == PAUTO { + n.Xoffset = 0 + } + + if s.Block == block { + // functype will print errors about duplicate function arguments. + // Don't repeat the error here. + if ctxt != PPARAM && ctxt != PPARAMOUT { + redeclare(s, "in this block") + } + } + + s.Block = block + s.Lastlineno = int32(parserline()) + s.Def = n + n.Name.Vargen = int32(gen) + n.Name.Funcdepth = Funcdepth + n.Class = uint8(ctxt) + + autoexport(n, ctxt) +} + +func addvar(n *Node, t *Type, ctxt uint8) { + if n == nil || n.Sym == nil || (n.Op != ONAME && n.Op != ONONAME) || t == nil { + Fatal("addvar: n=%v t=%v nil", n, t) + } + + n.Op = ONAME + declare(n, ctxt) + n.Type = t +} + +/* + * declare variables from grammar + * new_name_list (type | [type] = expr_list) + */ +func variter(vl *NodeList, t *Node, el *NodeList) *NodeList { + var init *NodeList + doexpr := el != nil + + if count(el) == 1 && count(vl) > 1 { + e := el.N + as2 := Nod(OAS2, nil, nil) + as2.List = vl + as2.Rlist = list1(e) + var v *Node + for ; vl != nil; vl = vl.Next { + v = vl.N + v.Op = ONAME + declare(v, dclcontext) + v.Name.Param.Ntype = t + v.Name.Defn = as2 + if Funcdepth > 0 { + init = list(init, Nod(ODCL, v, nil)) + } + } + + return list(init, as2) + } + + var v *Node + var e *Node + for ; vl != nil; vl = vl.Next { + if doexpr { + if el == nil { + Yyerror("missing expression in var declaration") + break + } + + e = el.N + el = el.Next + } else { + e = nil + } + + v = vl.N + v.Op = ONAME + declare(v, dclcontext) + v.Name.Param.Ntype = t + + if e != nil || Funcdepth > 0 || isblank(v) { + if Funcdepth > 0 { + init = list(init, Nod(ODCL, v, nil)) + } + e = Nod(OAS, v, e) + init = list(init, e) + if e.Right != nil { + v.Name.Defn = e + } + } + } + + if el != nil { + Yyerror("extra expression in var declaration") + } + return init +} + +/* + * declare constants from grammar + * new_name_list [[type] = expr_list] + */ +func constiter(vl *NodeList, t *Node, cl *NodeList) *NodeList { + lno := int32(0) // default is to leave line number alone in listtreecopy + if cl == nil { + if t != nil { + Yyerror("const declaration cannot have type without expression") + } + cl = lastconst + t = lasttype + lno = vl.N.Lineno + } else { + lastconst = cl + lasttype = t + } + cl = listtreecopy(cl, lno) + + var v *Node + var c *Node + var vv *NodeList + for ; vl != nil; vl = vl.Next { + if cl == nil { + Yyerror("missing value in const declaration") + break + } + + c = cl.N + cl = cl.Next + + v = vl.N + v.Op = OLITERAL + declare(v, dclcontext) + + v.Name.Param.Ntype = t + v.Name.Defn = c + + vv = list(vv, Nod(ODCLCONST, v, nil)) + } + + if cl != nil { + Yyerror("extra expression in const declaration") + } + iota_ += 1 + return vv +} + +/* + * this generates a new name node, + * typically for labels or other one-off names. + */ +func newname(s *Sym) *Node { + if s == nil { + Fatal("newname nil") + } + + n := Nod(ONAME, nil, nil) + n.Sym = s + n.Type = nil + n.Addable = true + n.Ullman = 1 + n.Xoffset = 0 + return n +} + +// newfuncname generates a new name node for a function or method. +// TODO(rsc): Use an ODCLFUNC node instead. See comment in CL 7360. +func newfuncname(s *Sym) *Node { + n := newname(s) + n.Func = new(Func) + n.Func.FCurfn = Curfn + return n +} + +/* + * this generates a new name node for a name + * being declared. + */ +func dclname(s *Sym) *Node { + n := newname(s) + n.Op = ONONAME // caller will correct it + return n +} + +func typenod(t *Type) *Node { + // if we copied another type with *t = *u + // then t->nod might be out of date, so + // check t->nod->type too + if t.Nod == nil || t.Nod.Type != t { + t.Nod = Nod(OTYPE, nil, nil) + t.Nod.Type = t + t.Nod.Sym = t.Sym + } + + return t.Nod +} + +/* + * this will return an old name + * that has already been pushed on the + * declaration list. a diagnostic is + * generated if no name has been defined. + */ +func oldname(s *Sym) *Node { + n := s.Def + if n == nil { + // maybe a top-level name will come along + // to give this a definition later. + // walkdef will check s->def again once + // all the input source has been processed. + n = newname(s) + n.Op = ONONAME + n.Name.Iota = iota_ // save current iota value in const declarations + } + + if Curfn != nil && n.Op == ONAME && n.Name.Funcdepth > 0 && n.Name.Funcdepth != Funcdepth { + // inner func is referring to var in outer func. + // + // TODO(rsc): If there is an outer variable x and we + // are parsing x := 5 inside the closure, until we get to + // the := it looks like a reference to the outer x so we'll + // make x a closure variable unnecessarily. + if n.Name.Param.Closure == nil || n.Name.Param.Closure.Name.Funcdepth != Funcdepth { + // create new closure var. + c := Nod(ONAME, nil, nil) + + c.Sym = s + c.Class = PPARAMREF + c.Isddd = n.Isddd + c.Name.Defn = n + c.Addable = false + c.Ullman = 2 + c.Name.Funcdepth = Funcdepth + c.Name.Param.Outer = n.Name.Param.Closure + n.Name.Param.Closure = c + c.Name.Param.Closure = n + c.Xoffset = 0 + Curfn.Func.Cvars = list(Curfn.Func.Cvars, c) + } + + // return ref to closure var, not original + return n.Name.Param.Closure + } + + return n +} + +/* + * := declarations + */ +func colasname(n *Node) bool { + switch n.Op { + case ONAME, + ONONAME, + OPACK, + OTYPE, + OLITERAL: + return n.Sym != nil + } + + return false +} + +func colasdefn(left *NodeList, defn *Node) { + for l := left; l != nil; l = l.Next { + if l.N.Sym != nil { + l.N.Sym.Flags |= SymUniq + } + } + + nnew := 0 + nerr := 0 + var n *Node + for l := left; l != nil; l = l.Next { + n = l.N + if isblank(n) { + continue + } + if !colasname(n) { + yyerrorl(int(defn.Lineno), "non-name %v on left side of :=", n) + nerr++ + continue + } + + if n.Sym.Flags&SymUniq == 0 { + yyerrorl(int(defn.Lineno), "%v repeated on left side of :=", n.Sym) + n.Diag++ + nerr++ + continue + } + + n.Sym.Flags &^= SymUniq + if n.Sym.Block == block { + continue + } + + nnew++ + n = newname(n.Sym) + declare(n, dclcontext) + n.Name.Defn = defn + defn.Ninit = list(defn.Ninit, Nod(ODCL, n, nil)) + l.N = n + } + + if nnew == 0 && nerr == 0 { + yyerrorl(int(defn.Lineno), "no new variables on left side of :=") + } +} + +func colas(left *NodeList, right *NodeList, lno int32) *Node { + as := Nod(OAS2, nil, nil) + as.List = left + as.Rlist = right + as.Colas = true + as.Lineno = lno + colasdefn(left, as) + + // make the tree prettier; not necessary + if count(left) == 1 && count(right) == 1 { + as.Left = as.List.N + as.Right = as.Rlist.N + as.List = nil + as.Rlist = nil + as.Op = OAS + } + + return as +} + +/* + * declare the arguments in an + * interface field declaration. + */ +func ifacedcl(n *Node) { + if n.Op != ODCLFIELD || n.Right == nil { + Fatal("ifacedcl") + } + + if isblank(n.Left) { + Yyerror("methods must have a unique non-blank name") + } + + n.Func = new(Func) + n.Func.FCurfn = Curfn + dclcontext = PPARAM + markdcl() + Funcdepth++ + n.Func.Outer = Curfn + Curfn = n + funcargs(n.Right) + + // funcbody is normally called after the parser has + // seen the body of a function but since an interface + // field declaration does not have a body, we must + // call it now to pop the current declaration context. + dclcontext = PAUTO + + funcbody(n) +} + +/* + * declare the function proper + * and declare the arguments. + * called in extern-declaration context + * returns in auto-declaration context. + */ +func funchdr(n *Node) { + // change the declaration context from extern to auto + if Funcdepth == 0 && dclcontext != PEXTERN { + Fatal("funchdr: dclcontext") + } + + if importpkg == nil && n.Func.Nname != nil { + makefuncsym(n.Func.Nname.Sym) + } + + dclcontext = PAUTO + markdcl() + Funcdepth++ + + n.Func.Outer = Curfn + Curfn = n + + if n.Func.Nname != nil { + funcargs(n.Func.Nname.Name.Param.Ntype) + } else if n.Func.Ntype != nil { + funcargs(n.Func.Ntype) + } else { + funcargs2(n.Type) + } +} + +func funcargs(nt *Node) { + if nt.Op != OTFUNC { + Fatal("funcargs %v", Oconv(int(nt.Op), 0)) + } + + // re-start the variable generation number + // we want to use small numbers for the return variables, + // so let them have the chunk starting at 1. + vargen = count(nt.Rlist) + + // declare the receiver and in arguments. + // no n->defn because type checking of func header + // will not fill in the types until later + if nt.Left != nil { + n := nt.Left + if n.Op != ODCLFIELD { + Fatal("funcargs receiver %v", Oconv(int(n.Op), 0)) + } + if n.Left != nil { + n.Left.Op = ONAME + n.Left.Name.Param.Ntype = n.Right + declare(n.Left, PPARAM) + if dclcontext == PAUTO { + vargen++ + n.Left.Name.Vargen = int32(vargen) + } + } + } + + var n *Node + for l := nt.List; l != nil; l = l.Next { + n = l.N + if n.Op != ODCLFIELD { + Fatal("funcargs in %v", Oconv(int(n.Op), 0)) + } + if n.Left != nil { + n.Left.Op = ONAME + n.Left.Name.Param.Ntype = n.Right + declare(n.Left, PPARAM) + if dclcontext == PAUTO { + vargen++ + n.Left.Name.Vargen = int32(vargen) + } + } + } + + // declare the out arguments. + gen := count(nt.List) + var i int = 0 + var nn *Node + for l := nt.Rlist; l != nil; l = l.Next { + n = l.N + + if n.Op != ODCLFIELD { + Fatal("funcargs out %v", Oconv(int(n.Op), 0)) + } + + if n.Left == nil { + // Name so that escape analysis can track it. ~r stands for 'result'. + n.Left = newname(Lookupf("~r%d", gen)) + gen++ + } + + // TODO: n->left->missing = 1; + n.Left.Op = ONAME + + if isblank(n.Left) { + // Give it a name so we can assign to it during return. ~b stands for 'blank'. + // The name must be different from ~r above because if you have + // func f() (_ int) + // func g() int + // f is allowed to use a plain 'return' with no arguments, while g is not. + // So the two cases must be distinguished. + // We do not record a pointer to the original node (n->orig). + // Having multiple names causes too much confusion in later passes. + nn = Nod(OXXX, nil, nil) + + *nn = *n.Left + nn.Orig = nn + nn.Sym = Lookupf("~b%d", gen) + gen++ + n.Left = nn + } + + n.Left.Name.Param.Ntype = n.Right + declare(n.Left, PPARAMOUT) + if dclcontext == PAUTO { + i++ + n.Left.Name.Vargen = int32(i) + } + } +} + +/* + * Same as funcargs, except run over an already constructed TFUNC. + * This happens during import, where the hidden_fndcl rule has + * used functype directly to parse the function's type. + */ +func funcargs2(t *Type) { + if t.Etype != TFUNC { + Fatal("funcargs2 %v", t) + } + + if t.Thistuple != 0 { + var n *Node + for ft := getthisx(t).Type; ft != nil; ft = ft.Down { + if ft.Nname == nil || ft.Nname.Sym == nil { + continue + } + n = ft.Nname // no need for newname(ft->nname->sym) + n.Type = ft.Type + declare(n, PPARAM) + } + } + + if t.Intuple != 0 { + var n *Node + for ft := getinargx(t).Type; ft != nil; ft = ft.Down { + if ft.Nname == nil || ft.Nname.Sym == nil { + continue + } + n = ft.Nname + n.Type = ft.Type + declare(n, PPARAM) + } + } + + if t.Outtuple != 0 { + var n *Node + for ft := getoutargx(t).Type; ft != nil; ft = ft.Down { + if ft.Nname == nil || ft.Nname.Sym == nil { + continue + } + n = ft.Nname + n.Type = ft.Type + declare(n, PPARAMOUT) + } + } +} + +/* + * finish the body. + * called in auto-declaration context. + * returns in extern-declaration context. + */ +func funcbody(n *Node) { + // change the declaration context from auto to extern + if dclcontext != PAUTO { + Fatal("funcbody: dclcontext") + } + popdcl() + Funcdepth-- + Curfn = n.Func.Outer + n.Func.Outer = nil + if Funcdepth == 0 { + dclcontext = PEXTERN + } +} + +/* + * new type being defined with name s. + */ +func typedcl0(s *Sym) *Node { + n := newname(s) + n.Op = OTYPE + declare(n, dclcontext) + return n +} + +/* + * node n, which was returned by typedcl0 + * is being declared to have uncompiled type t. + * return the ODCLTYPE node to use. + */ +func typedcl1(n *Node, t *Node, local bool) *Node { + n.Name.Param.Ntype = t + n.Local = local + return Nod(ODCLTYPE, n, nil) +} + +/* + * structs, functions, and methods. + * they don't belong here, but where do they belong? + */ +func checkembeddedtype(t *Type) { + if t == nil { + return + } + + if t.Sym == nil && Isptr[t.Etype] { + t = t.Type + if t.Etype == TINTER { + Yyerror("embedded type cannot be a pointer to interface") + } + } + + if Isptr[t.Etype] { + Yyerror("embedded type cannot be a pointer") + } else if t.Etype == TFORW && t.Embedlineno == 0 { + t.Embedlineno = lineno + } +} + +func structfield(n *Node) *Type { + lno := int(lineno) + lineno = n.Lineno + + if n.Op != ODCLFIELD { + Fatal("structfield: oops %v\n", n) + } + + f := typ(TFIELD) + f.Isddd = n.Isddd + + if n.Right != nil { + typecheck(&n.Right, Etype) + n.Type = n.Right.Type + if n.Left != nil { + n.Left.Type = n.Type + } + if n.Embedded != 0 { + checkembeddedtype(n.Type) + } + } + + n.Right = nil + + f.Type = n.Type + if f.Type == nil { + f.Broke = 1 + } + + switch n.Val().Ctype() { + case CTSTR: + f.Note = new(string) + *f.Note = n.Val().U.(string) + + default: + Yyerror("field annotation must be string") + fallthrough + + case CTxxx: + f.Note = nil + } + + if n.Left != nil && n.Left.Op == ONAME { + f.Nname = n.Left + f.Embedded = n.Embedded + f.Sym = f.Nname.Sym + } + + lineno = int32(lno) + return f +} + +var uniqgen uint32 + +func checkdupfields(t *Type, what string) { + lno := int(lineno) + + for ; t != nil; t = t.Down { + if t.Sym != nil && t.Nname != nil && !isblank(t.Nname) { + if t.Sym.Uniqgen == uniqgen { + lineno = t.Nname.Lineno + Yyerror("duplicate %s %s", what, t.Sym.Name) + } else { + t.Sym.Uniqgen = uniqgen + } + } + } + + lineno = int32(lno) +} + +/* + * convert a parsed id/type list into + * a type for struct/interface/arglist + */ +func tostruct(l *NodeList) *Type { + var f *Type + t := typ(TSTRUCT) + + for tp := &t.Type; l != nil; l = l.Next { + f = structfield(l.N) + + *tp = f + tp = &f.Down + } + + for f := t.Type; f != nil && t.Broke == 0; f = f.Down { + if f.Broke != 0 { + t.Broke = 1 + } + } + + uniqgen++ + checkdupfields(t.Type, "field") + + if t.Broke == 0 { + checkwidth(t) + } + + return t +} + +func tofunargs(l *NodeList) *Type { + var f *Type + + t := typ(TSTRUCT) + t.Funarg = 1 + + for tp := &t.Type; l != nil; l = l.Next { + f = structfield(l.N) + f.Funarg = 1 + + // esc.c needs to find f given a PPARAM to add the tag. + if l.N.Left != nil && l.N.Left.Class == PPARAM { + l.N.Left.Name.Param.Field = f + } + + *tp = f + tp = &f.Down + } + + for f := t.Type; f != nil && t.Broke == 0; f = f.Down { + if f.Broke != 0 { + t.Broke = 1 + } + } + + return t +} + +func interfacefield(n *Node) *Type { + lno := int(lineno) + lineno = n.Lineno + + if n.Op != ODCLFIELD { + Fatal("interfacefield: oops %v\n", n) + } + + if n.Val().Ctype() != CTxxx { + Yyerror("interface method cannot have annotation") + } + + f := typ(TFIELD) + f.Isddd = n.Isddd + + if n.Right != nil { + if n.Left != nil { + // queue resolution of method type for later. + // right now all we need is the name list. + // avoids cycles for recursive interface types. + n.Type = typ(TINTERMETH) + + n.Type.Nname = n.Right + n.Left.Type = n.Type + queuemethod(n) + + if n.Left.Op == ONAME { + f.Nname = n.Left + f.Embedded = n.Embedded + f.Sym = f.Nname.Sym + } + } else { + typecheck(&n.Right, Etype) + n.Type = n.Right.Type + + if n.Embedded != 0 { + checkembeddedtype(n.Type) + } + + if n.Type != nil { + switch n.Type.Etype { + case TINTER: + break + + case TFORW: + Yyerror("interface type loop involving %v", n.Type) + f.Broke = 1 + + default: + Yyerror("interface contains embedded non-interface %v", n.Type) + f.Broke = 1 + } + } + } + } + + n.Right = nil + + f.Type = n.Type + if f.Type == nil { + f.Broke = 1 + } + + lineno = int32(lno) + return f +} + +func tointerface(l *NodeList) *Type { + var f *Type + var t1 *Type + + t := typ(TINTER) + + tp := &t.Type + for ; l != nil; l = l.Next { + f = interfacefield(l.N) + + if l.N.Left == nil && f.Type.Etype == TINTER { + // embedded interface, inline methods + for t1 = f.Type.Type; t1 != nil; t1 = t1.Down { + f = typ(TFIELD) + f.Type = t1.Type + f.Broke = t1.Broke + f.Sym = t1.Sym + if f.Sym != nil { + f.Nname = newname(f.Sym) + } + *tp = f + tp = &f.Down + } + } else { + *tp = f + tp = &f.Down + } + } + + for f := t.Type; f != nil && t.Broke == 0; f = f.Down { + if f.Broke != 0 { + t.Broke = 1 + } + } + + uniqgen++ + checkdupfields(t.Type, "method") + t = sortinter(t) + checkwidth(t) + + return t +} + +func embedded(s *Sym, pkg *Pkg) *Node { + const ( + CenterDot = 0xB7 + ) + // Names sometimes have disambiguation junk + // appended after a center dot. Discard it when + // making the name for the embedded struct field. + name := s.Name + + if i := strings.Index(s.Name, string(CenterDot)); i >= 0 { + name = s.Name[:i] + } + + var n *Node + if exportname(name) { + n = newname(Lookup(name)) + } else if s.Pkg == builtinpkg { + // The name of embedded builtins belongs to pkg. + n = newname(Pkglookup(name, pkg)) + } else { + n = newname(Pkglookup(name, s.Pkg)) + } + n = Nod(ODCLFIELD, n, oldname(s)) + n.Embedded = 1 + return n +} + +/* + * check that the list of declarations is either all anonymous or all named + */ +func findtype(l *NodeList) *Node { + for ; l != nil; l = l.Next { + if l.N.Op == OKEY { + return l.N.Right + } + } + return nil +} + +func checkarglist(all *NodeList, input int) *NodeList { + named := 0 + for l := all; l != nil; l = l.Next { + if l.N.Op == OKEY { + named = 1 + break + } + } + + if named != 0 { + var n *Node + var l *NodeList + for l = all; l != nil; l = l.Next { + n = l.N + if n.Op != OKEY && n.Sym == nil { + Yyerror("mixed named and unnamed function parameters") + break + } + } + + if l == nil && n != nil && n.Op != OKEY { + Yyerror("final function parameter must have type") + } + } + + var nextt *Node + var t *Node + var n *Node + for l := all; l != nil; l = l.Next { + // can cache result from findtype to avoid + // quadratic behavior here, but unlikely to matter. + n = l.N + + if named != 0 { + if n.Op == OKEY { + t = n.Right + n = n.Left + nextt = nil + } else { + if nextt == nil { + nextt = findtype(l) + } + t = nextt + } + } else { + t = n + n = nil + } + + // during import l->n->op is OKEY, but l->n->left->sym == S + // means it was a '?', not that it was + // a lone type This doesn't matter for the exported + // declarations, which are parsed by rules that don't + // use checkargs, but can happen for func literals in + // the inline bodies. + // TODO(rsc) this can go when typefmt case TFIELD in exportmode fmt.c prints _ instead of ? + if importpkg != nil && n.Sym == nil { + n = nil + } + + if n != nil && n.Sym == nil { + t = n + n = nil + } + + if n != nil { + n = newname(n.Sym) + } + n = Nod(ODCLFIELD, n, t) + if n.Right != nil && n.Right.Op == ODDD { + if input == 0 { + Yyerror("cannot use ... in output argument list") + } else if l.Next != nil { + Yyerror("can only use ... as final argument in list") + } + n.Right.Op = OTARRAY + n.Right.Right = n.Right.Left + n.Right.Left = nil + n.Isddd = true + if n.Left != nil { + n.Left.Isddd = true + } + } + + l.N = n + } + + return all +} + +func fakethis() *Node { + n := Nod(ODCLFIELD, nil, typenod(Ptrto(typ(TSTRUCT)))) + return n +} + +/* + * Is this field a method on an interface? + * Those methods have an anonymous + * *struct{} as the receiver. + * (See fakethis above.) + */ +func isifacemethod(f *Type) bool { + rcvr := getthisx(f).Type + if rcvr.Sym != nil { + return false + } + t := rcvr.Type + if !Isptr[t.Etype] { + return false + } + t = t.Type + if t.Sym != nil || t.Etype != TSTRUCT || t.Type != nil { + return false + } + return true +} + +/* + * turn a parsed function declaration + * into a type + */ +func functype(this *Node, in *NodeList, out *NodeList) *Type { + t := typ(TFUNC) + + var rcvr *NodeList + if this != nil { + rcvr = list1(this) + } + t.Type = tofunargs(rcvr) + t.Type.Down = tofunargs(out) + t.Type.Down.Down = tofunargs(in) + + uniqgen++ + checkdupfields(t.Type.Type, "argument") + checkdupfields(t.Type.Down.Type, "argument") + checkdupfields(t.Type.Down.Down.Type, "argument") + + if t.Type.Broke != 0 || t.Type.Down.Broke != 0 || t.Type.Down.Down.Broke != 0 { + t.Broke = 1 + } + + if this != nil { + t.Thistuple = 1 + } + t.Outtuple = count(out) + t.Intuple = count(in) + t.Outnamed = 0 + if t.Outtuple > 0 && out.N.Left != nil && out.N.Left.Orig != nil { + s := out.N.Left.Orig.Sym + if s != nil && (s.Name[0] != '~' || s.Name[1] != 'r') { // ~r%d is the name invented for an unnamed result + t.Outnamed = 1 + } + } + + return t +} + +var methodsym_toppkg *Pkg + +func methodsym(nsym *Sym, t0 *Type, iface int) *Sym { + var s *Sym + var p string + var suffix string + var spkg *Pkg + + t := t0 + if t == nil { + goto bad + } + s = t.Sym + if s == nil && Isptr[t.Etype] { + t = t.Type + if t == nil { + goto bad + } + s = t.Sym + } + + spkg = nil + if s != nil { + spkg = s.Pkg + } + + // if t0 == *t and t0 has a sym, + // we want to see *t, not t0, in the method name. + if t != t0 && t0.Sym != nil { + t0 = Ptrto(t) + } + + suffix = "" + if iface != 0 { + dowidth(t0) + if t0.Width < Types[Tptr].Width { + suffix = "·i" + } + } + + if (spkg == nil || nsym.Pkg != spkg) && !exportname(nsym.Name) { + if t0.Sym == nil && Isptr[t0.Etype] { + p = fmt.Sprintf("(%v).%s.%s%s", Tconv(t0, obj.FmtLeft|obj.FmtShort), nsym.Pkg.Prefix, nsym.Name, suffix) + } else { + p = fmt.Sprintf("%v.%s.%s%s", Tconv(t0, obj.FmtLeft|obj.FmtShort), nsym.Pkg.Prefix, nsym.Name, suffix) + } + } else { + if t0.Sym == nil && Isptr[t0.Etype] { + p = fmt.Sprintf("(%v).%s%s", Tconv(t0, obj.FmtLeft|obj.FmtShort), nsym.Name, suffix) + } else { + p = fmt.Sprintf("%v.%s%s", Tconv(t0, obj.FmtLeft|obj.FmtShort), nsym.Name, suffix) + } + } + + if spkg == nil { + if methodsym_toppkg == nil { + methodsym_toppkg = mkpkg("go") + } + spkg = methodsym_toppkg + } + + s = Pkglookup(p, spkg) + + return s + +bad: + Yyerror("illegal receiver type: %v", t0) + return nil +} + +func methodname(n *Node, t *Type) *Node { + s := methodsym(n.Sym, t, 0) + if s == nil { + return n + } + return newname(s) +} + +func methodname1(n *Node, t *Node) *Node { + star := "" + if t.Op == OIND { + star = "*" + t = t.Left + } + + if t.Sym == nil || isblank(n) { + return newfuncname(n.Sym) + } + + var p string + if star != "" { + p = fmt.Sprintf("(%s%v).%v", star, t.Sym, n.Sym) + } else { + p = fmt.Sprintf("%v.%v", t.Sym, n.Sym) + } + + if exportname(t.Sym.Name) { + n = newfuncname(Lookup(p)) + } else { + n = newfuncname(Pkglookup(p, t.Sym.Pkg)) + } + + return n +} + +/* + * add a method, declared as a function, + * n is fieldname, pa is base type, t is function type + */ +func addmethod(sf *Sym, t *Type, local bool, nointerface bool) { + // get field sym + if sf == nil { + Fatal("no method symbol") + } + + // get parent type sym + pa := getthisx(t).Type // ptr to this structure + if pa == nil { + Yyerror("missing receiver") + return + } + + pa = pa.Type + f := methtype(pa, 1) + if f == nil { + t = pa + if t == nil { // rely on typecheck having complained before + return + } + if t != nil { + if Isptr[t.Etype] { + if t.Sym != nil { + Yyerror("invalid receiver type %v (%v is a pointer type)", pa, t) + return + } + + t = t.Type + } + + if t.Broke != 0 { // rely on typecheck having complained before + return + } + if t.Sym == nil { + Yyerror("invalid receiver type %v (%v is an unnamed type)", pa, t) + return + } + + if Isptr[t.Etype] { + Yyerror("invalid receiver type %v (%v is a pointer type)", pa, t) + return + } + + if t.Etype == TINTER { + Yyerror("invalid receiver type %v (%v is an interface type)", pa, t) + return + } + } + + // Should have picked off all the reasons above, + // but just in case, fall back to generic error. + Yyerror("invalid receiver type %v (%v / %v)", pa, Tconv(pa, obj.FmtLong), Tconv(t, obj.FmtLong)) + + return + } + + pa = f + if pa.Etype == TSTRUCT { + for f := pa.Type; f != nil; f = f.Down { + if f.Sym == sf { + Yyerror("type %v has both field and method named %v", pa, sf) + return + } + } + } + + if local && !pa.Local { + // defining method on non-local type. + Yyerror("cannot define new methods on non-local type %v", pa) + + return + } + + n := Nod(ODCLFIELD, newname(sf), nil) + n.Type = t + + var d *Type // last found + for f := pa.Method; f != nil; f = f.Down { + d = f + if f.Etype != TFIELD { + Fatal("addmethod: not TFIELD: %v", Tconv(f, obj.FmtLong)) + } + if sf.Name != f.Sym.Name { + continue + } + if !Eqtype(t, f.Type) { + Yyerror("method redeclared: %v.%v\n\t%v\n\t%v", pa, sf, f.Type, t) + } + return + } + + f = structfield(n) + f.Nointerface = nointerface + + // during import unexported method names should be in the type's package + if importpkg != nil && f.Sym != nil && !exportname(f.Sym.Name) && f.Sym.Pkg != structpkg { + Fatal("imported method name %v in wrong package %s\n", Sconv(f.Sym, obj.FmtSign), structpkg.Name) + } + + if d == nil { + pa.Method = f + } else { + d.Down = f + } + return +} + +func funccompile(n *Node) { + Stksize = BADWIDTH + Maxarg = 0 + + if n.Type == nil { + if nerrors == 0 { + Fatal("funccompile missing type") + } + return + } + + // assign parameter offsets + checkwidth(n.Type) + + if Curfn != nil { + Fatal("funccompile %v inside %v", n.Func.Nname.Sym, Curfn.Func.Nname.Sym) + } + + Stksize = 0 + dclcontext = PAUTO + Funcdepth = n.Func.Depth + 1 + compile(n) + Curfn = nil + Funcdepth = 0 + dclcontext = PEXTERN +} + +func funcsym(s *Sym) *Sym { + if s.Fsym != nil { + return s.Fsym + } + + s1 := Pkglookup(s.Name+"·f", s.Pkg) + s.Fsym = s1 + return s1 +} + +func makefuncsym(s *Sym) { + if isblanksym(s) { + return + } + if compiling_runtime != 0 && s.Name == "getg" { + // runtime.getg() is not a real function and so does + // not get a funcsym. + return + } + s1 := funcsym(s) + s1.Def = newfuncname(s1) + s1.Def.Func.Shortname = newname(s) + funcsyms = list(funcsyms, s1.Def) +} diff --git a/src/cmd/compile/internal/gc/esc.go b/src/cmd/compile/internal/gc/esc.go new file mode 100644 index 0000000000000000000000000000000000000000..4c4455fba7add78e88663c55a894703b14dc9cb3 --- /dev/null +++ b/src/cmd/compile/internal/gc/esc.go @@ -0,0 +1,1821 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package gc + +import ( + "cmd/internal/obj" + "fmt" + "strings" +) + +// Run analysis on minimal sets of mutually recursive functions +// or single non-recursive functions, bottom up. +// +// Finding these sets is finding strongly connected components +// in the static call graph. The algorithm for doing that is taken +// from Sedgewick, Algorithms, Second Edition, p. 482, with two +// adaptations. +// +// First, a hidden closure function (n->curfn != N) cannot be the +// root of a connected component. Refusing to use it as a root +// forces it into the component of the function in which it appears. +// This is more convenient for escape analysis. +// +// Second, each function becomes two virtual nodes in the graph, +// with numbers n and n+1. We record the function's node number as n +// but search from node n+1. If the search tells us that the component +// number (min) is n+1, we know that this is a trivial component: one function +// plus its closures. If the search tells us that the component number is +// n, then there was a path from node n+1 back to node n, meaning that +// the function set is mutually recursive. The escape analysis can be +// more precise when analyzing a single non-recursive function than +// when analyzing a set of mutually recursive functions. + +type bottomUpVisitor struct { + analyze func(*NodeList, bool) + visitgen uint32 + nodeID map[*Node]uint32 + stack *NodeList +} + +// visitBottomUp invokes analyze on the ODCLFUNC nodes listed in list. +// It calls analyze with successive groups of functions, working from +// the bottom of the call graph upward. Each time analyze is called with +// a list of functions, every function on that list only calls other functions +// on the list or functions that have been passed in previous invocations of +// analyze. Closures appear in the same list as their outer functions. +// The lists are as short as possible while preserving those requirements. +// (In a typical program, many invocations of analyze will be passed just +// a single function.) The boolean argument 'recursive' passed to analyze +// specifies whether the functions on the list are mutually recursive. +// If recursive is false, the list consists of only a single function and its closures. +// If recursive is true, the list may still contain only a single function, +// if that function is itself recursive. +func visitBottomUp(list *NodeList, analyze func(list *NodeList, recursive bool)) { + var v bottomUpVisitor + v.analyze = analyze + v.nodeID = make(map[*Node]uint32) + for l := list; l != nil; l = l.Next { + if l.N.Op == ODCLFUNC && l.N.Func.FCurfn == nil { + v.visit(l.N) + } + } +} + +func (v *bottomUpVisitor) visit(n *Node) uint32 { + if id := v.nodeID[n]; id > 0 { + // already visited + return id + } + + v.visitgen++ + id := v.visitgen + v.nodeID[n] = id + v.visitgen++ + min := v.visitgen + + l := new(NodeList) + l.Next = v.stack + l.N = n + v.stack = l + min = v.visitcodelist(n.Nbody, min) + if (min == id || min == id+1) && n.Func.FCurfn == nil { + // This node is the root of a strongly connected component. + + // The original min passed to visitcodelist was n->walkgen+1. + // If visitcodelist found its way back to n->walkgen, then this + // block is a set of mutually recursive functions. + // Otherwise it's just a lone function that does not recurse. + recursive := min == id + + // Remove connected component from stack. + // Mark walkgen so that future visits return a large number + // so as not to affect the caller's min. + block := v.stack + + var l *NodeList + for l = v.stack; l.N != n; l = l.Next { + v.nodeID[l.N] = ^uint32(0) + } + v.nodeID[n] = ^uint32(0) + v.stack = l.Next + l.Next = nil + + // Run escape analysis on this set of functions. + v.analyze(block, recursive) + } + + return min +} + +func (v *bottomUpVisitor) visitcodelist(l *NodeList, min uint32) uint32 { + for ; l != nil; l = l.Next { + min = v.visitcode(l.N, min) + } + return min +} + +func (v *bottomUpVisitor) visitcode(n *Node, min uint32) uint32 { + if n == nil { + return min + } + + min = v.visitcodelist(n.Ninit, min) + min = v.visitcode(n.Left, min) + min = v.visitcode(n.Right, min) + min = v.visitcodelist(n.List, min) + min = v.visitcodelist(n.Nbody, min) + min = v.visitcodelist(n.Rlist, min) + + if n.Op == OCALLFUNC || n.Op == OCALLMETH { + fn := n.Left + if n.Op == OCALLMETH { + fn = n.Left.Right.Sym.Def + } + if fn != nil && fn.Op == ONAME && fn.Class == PFUNC && fn.Name.Defn != nil { + m := v.visit(fn.Name.Defn) + if m < min { + min = m + } + } + } + + if n.Op == OCLOSURE { + m := v.visit(n.Func.Closure) + if m < min { + min = m + } + } + + return min +} + +// Escape analysis. + +// An escape analysis pass for a set of functions. +// The analysis assumes that closures and the functions in which they +// appear are analyzed together, so that the aliasing between their +// variables can be modeled more precisely. +// +// First escfunc, esc and escassign recurse over the ast of each +// function to dig out flow(dst,src) edges between any +// pointer-containing nodes and store them in dst->escflowsrc. For +// variables assigned to a variable in an outer scope or used as a +// return value, they store a flow(theSink, src) edge to a fake node +// 'the Sink'. For variables referenced in closures, an edge +// flow(closure, &var) is recorded and the flow of a closure itself to +// an outer scope is tracked the same way as other variables. +// +// Then escflood walks the graph starting at theSink and tags all +// variables of it can reach an & node as escaping and all function +// parameters it can reach as leaking. +// +// If a value's address is taken but the address does not escape, +// then the value can stay on the stack. If the value new(T) does +// not escape, then new(T) can be rewritten into a stack allocation. +// The same is true of slice literals. +// +// If optimizations are disabled (-N), this code is not used. +// Instead, the compiler assumes that any value whose address +// is taken without being immediately dereferenced +// needs to be moved to the heap, and new(T) and slice +// literals are always real allocations. + +func escapes(all *NodeList) { + visitBottomUp(all, escAnalyze) +} + +const ( + EscFuncUnknown = 0 + iota + EscFuncPlanned + EscFuncStarted + EscFuncTagged +) + +// There appear to be some loops in the escape graph, causing +// arbitrary recursion into deeper and deeper levels. +// Cut this off safely by making minLevel sticky: once you +// get that deep, you cannot go down any further but you also +// cannot go up any further. This is a conservative fix. +// Making minLevel smaller (more negative) would handle more +// complex chains of indirections followed by address-of operations, +// at the cost of repeating the traversal once for each additional +// allowed level when a loop is encountered. Using -2 suffices to +// pass all the tests we have written so far, which we assume matches +// the level of complexity we want the escape analysis code to handle. +const ( + MinLevel = -2 +) + +// A Level encodes the reference state and context applied to +// (stack, heap) allocated memory. +// +// value is the overall sum of *(1) and &(-1) operations encountered +// along a path from a destination (sink, return value) to a source +// (allocation, parameter). +// +// suffixValue is the maximum-copy-started-suffix-level applied to a sink. +// For example: +// sink = x.left.left --> level=2, x is dereferenced twice and does not escape to sink. +// sink = &Node{x} --> level=-1, x is accessible from sink via one "address of" +// sink = &Node{&Node{x}} --> level=-2, x is accessible from sink via two "address of" +// sink = &Node{&Node{x.left}} --> level=-1, but x is NOT accessible from sink because it was indirected and then copied. +// (The copy operations are sometimes implicit in the source code; in this case, +// value of x.left was copied into a field of a newly allocated Node) +// +// There's one of these for each Node, and the integer values +// rarely exceed even what can be stored in 4 bits, never mind 8. +type Level struct { + value, suffixValue int8 +} + +func (l Level) int() int { + return int(l.value) +} + +func levelFrom(i int) Level { + if i <= MinLevel { + return Level{value: MinLevel} + } + return Level{value: int8(i)} +} + +func satInc8(x int8) int8 { + if x == 127 { + return 127 + } + return x + 1 +} + +func satAdd8(x, y int8) int8 { + z := x + y + if x^y < 0 || x^z >= 0 { + return z + } + if x < 0 { + return -128 + } + return 127 +} + +func min8(a, b int8) int8 { + if a < b { + return a + } + return b +} + +func max8(a, b int8) int8 { + if a > b { + return a + } + return b +} + +// inc returns the level l + 1, representing the effect of an indirect (*) operation. +func (l Level) inc() Level { + if l.value <= MinLevel { + return Level{value: MinLevel} + } + return Level{value: satInc8(l.value), suffixValue: satInc8(l.suffixValue)} +} + +// dec returns the level l - 1, representing the effect of an address-of (&) operation. +func (l Level) dec() Level { + if l.value <= MinLevel { + return Level{value: MinLevel} + } + return Level{value: l.value - 1, suffixValue: l.suffixValue - 1} +} + +// copy returns the level for a copy of a value with level l. +func (l Level) copy() Level { + return Level{value: l.value, suffixValue: max8(l.suffixValue, 0)} +} + +func (l1 Level) min(l2 Level) Level { + return Level{ + value: min8(l1.value, l2.value), + suffixValue: min8(l1.suffixValue, l2.suffixValue)} +} + +// guaranteedDereference returns the number of dereferences +// applied to a pointer before addresses are taken/generated. +// This is the maximum level computed from path suffixes starting +// with copies where paths flow from destination to source. +func (l Level) guaranteedDereference() int { + return int(l.suffixValue) +} + +type NodeEscState struct { + Curfn *Node + Escflowsrc *NodeList // flow(this, src) + Escretval *NodeList // on OCALLxxx, list of dummy return values + Escloopdepth int32 // -1: global, 0: return variables, 1:function top level, increased inside function for every loop or label to mark scopes + Esclevel Level + Walkgen uint32 +} + +func (e *EscState) nodeEscState(n *Node) *NodeEscState { + if nE, ok := n.Opt().(*NodeEscState); ok { + return nE + } + if n.Opt() != nil { + Fatal("nodeEscState: opt in use (%T)", n.Opt()) + } + nE := new(NodeEscState) + nE.Curfn = Curfn + n.SetOpt(nE) + e.opts = append(e.opts, n) + return nE +} + +func (e *EscState) track(n *Node) { + if Curfn == nil { + Fatal("EscState.track: Curfn nil") + } + n.Esc = EscNone // until proven otherwise + nE := e.nodeEscState(n) + nE.Escloopdepth = e.loopdepth + e.noesc = list(e.noesc, n) +} + +// Escape constants are numbered in order of increasing "escapiness" +// to help make inferences be monotonic. With the exception of +// EscNever which is sticky, eX < eY means that eY is more exposed +// than eX, and hence replaces it in a conservative analysis. +const ( + EscUnknown = iota + EscNone // Does not escape to heap, result, or parameters. + EscReturn // Is returned or reachable from returned. + EscScope // Allocated in an inner loop scope, assigned to an outer loop scope, + // which allows the construction of non-escaping but arbitrarily large linked + // data structures (i.e., not eligible for allocation in a fixed-size stack frame). + EscHeap // Reachable from the heap + EscNever // By construction will not escape. + EscBits = 3 + EscMask = (1 << EscBits) - 1 + EscContentEscapes = 1 << EscBits // value obtained by indirect of parameter escapes to heap + EscReturnBits = EscBits + 1 + // Node.esc encoding = | escapeReturnEncoding:(width-4) | contentEscapes:1 | escEnum:3 +) + +// escMax returns the maximum of an existing escape value +// (and its additional parameter flow flags) and a new escape type. +func escMax(e, etype uint16) uint16 { + if e&EscMask >= EscScope { + // normalize + if e&^EscMask != 0 { + Fatal("Escape information had unexpected return encoding bits (w/ EscScope, EscHeap, EscNever), e&EscMask=%v", e&EscMask) + } + } + if e&EscMask > etype { + return e + } + if etype == EscNone || etype == EscReturn { + return (e &^ EscMask) | etype + } + return etype +} + +// For each input parameter to a function, the escapeReturnEncoding describes +// how the parameter may leak to the function's outputs. This is currently the +// "level" of the leak where level is 0 or larger (negative level means stored into +// something whose address is returned -- but that implies stored into the heap, +// hence EscHeap, which means that the details are not currently relevant. ) +const ( + bitsPerOutputInTag = 3 // For each output, the number of bits for a tag + bitsMaskForTag = uint16(1<dsts, %d edges\n", e->dstcount, e->edgecount); + + // visit the upstream of each dst, mark address nodes with + // addrescapes, mark parameters unsafe + for l := e.dsts; l != nil; l = l.Next { + escflood(e, l.N) + } + + // for all top level functions, tag the typenodes corresponding to the param nodes + for l := all; l != nil; l = l.Next { + if l.N.Op == ODCLFUNC { + esctag(e, l.N) + } + } + + if Debug['m'] != 0 { + for l := e.noesc; l != nil; l = l.Next { + if l.N.Esc == EscNone { + Warnl(int(l.N.Lineno), "%v %v does not escape", e.curfnSym(l.N), Nconv(l.N, obj.FmtShort)) + } + } + } + for _, x := range e.opts { + x.SetOpt(nil) + } +} + +func escfunc(e *EscState, func_ *Node) { + // print("escfunc %N %s\n", func->nname, e->recursive?"(recursive)":""); + if func_.Esc != 1 { + Fatal("repeat escfunc %v", func_.Func.Nname) + } + func_.Esc = EscFuncStarted + + saveld := e.loopdepth + e.loopdepth = 1 + savefn := Curfn + Curfn = func_ + + for ll := Curfn.Func.Dcl; ll != nil; ll = ll.Next { + if ll.N.Op != ONAME { + continue + } + llNE := e.nodeEscState(ll.N) + switch ll.N.Class { + // out params are in a loopdepth between the sink and all local variables + case PPARAMOUT: + llNE.Escloopdepth = 0 + + case PPARAM: + llNE.Escloopdepth = 1 + if ll.N.Type != nil && !haspointers(ll.N.Type) { + break + } + if Curfn.Nbody == nil && !Curfn.Noescape { + ll.N.Esc = EscHeap + } else { + ll.N.Esc = EscNone // prime for escflood later + } + e.noesc = list(e.noesc, ll.N) + } + } + + // in a mutually recursive group we lose track of the return values + if e.recursive { + for ll := Curfn.Func.Dcl; ll != nil; ll = ll.Next { + if ll.N.Op == ONAME && ll.N.Class == PPARAMOUT { + escflows(e, &e.theSink, ll.N) + } + } + } + + escloopdepthlist(e, Curfn.Nbody) + esclist(e, Curfn.Nbody, Curfn) + Curfn = savefn + e.loopdepth = saveld +} + +// Mark labels that have no backjumps to them as not increasing e->loopdepth. +// Walk hasn't generated (goto|label)->left->sym->label yet, so we'll cheat +// and set it to one of the following two. Then in esc we'll clear it again. +var looping Label + +var nonlooping Label + +func escloopdepthlist(e *EscState, l *NodeList) { + for ; l != nil; l = l.Next { + escloopdepth(e, l.N) + } +} + +func escloopdepth(e *EscState, n *Node) { + if n == nil { + return + } + + escloopdepthlist(e, n.Ninit) + + switch n.Op { + case OLABEL: + if n.Left == nil || n.Left.Sym == nil { + Fatal("esc:label without label: %v", Nconv(n, obj.FmtSign)) + } + + // Walk will complain about this label being already defined, but that's not until + // after escape analysis. in the future, maybe pull label & goto analysis out of walk and put before esc + // if(n->left->sym->label != nil) + // fatal("escape analysis messed up analyzing label: %+N", n); + n.Left.Sym.Label = &nonlooping + + case OGOTO: + if n.Left == nil || n.Left.Sym == nil { + Fatal("esc:goto without label: %v", Nconv(n, obj.FmtSign)) + } + + // If we come past one that's uninitialized, this must be a (harmless) forward jump + // but if it's set to nonlooping the label must have preceded this goto. + if n.Left.Sym.Label == &nonlooping { + n.Left.Sym.Label = &looping + } + } + + escloopdepth(e, n.Left) + escloopdepth(e, n.Right) + escloopdepthlist(e, n.List) + escloopdepthlist(e, n.Nbody) + escloopdepthlist(e, n.Rlist) +} + +func esclist(e *EscState, l *NodeList, up *Node) { + for ; l != nil; l = l.Next { + esc(e, l.N, up) + } +} + +func esc(e *EscState, n *Node, up *Node) { + if n == nil { + return + } + + lno := int(setlineno(n)) + + // ninit logically runs at a different loopdepth than the rest of the for loop. + esclist(e, n.Ninit, n) + + if n.Op == OFOR || n.Op == ORANGE { + e.loopdepth++ + } + + // type switch variables have no ODCL. + // process type switch as declaration. + // must happen before processing of switch body, + // so before recursion. + if n.Op == OSWITCH && n.Left != nil && n.Left.Op == OTYPESW { + for ll := n.List; ll != nil; ll = ll.Next { // cases + + // ll.N.Rlist is the variable per case + if ll.N.Rlist != nil { + e.nodeEscState(ll.N.Rlist.N).Escloopdepth = e.loopdepth + } + } + } + + // Big stuff escapes unconditionally + // "Big" conditions that were scattered around in walk have been gathered here + if n.Esc != EscHeap && n.Type != nil && (n.Type.Width > MaxStackVarSize || + n.Op == ONEW && n.Type.Type.Width >= 1<<16 || + n.Op == OMAKESLICE && !isSmallMakeSlice(n)) { + if Debug['m'] > 1 { + Warnl(int(n.Lineno), "%v is too large for stack", n) + } + n.Esc = EscHeap + addrescapes(n) + escassign(e, &e.theSink, n) + } + + esc(e, n.Left, n) + esc(e, n.Right, n) + esclist(e, n.Nbody, n) + esclist(e, n.List, n) + esclist(e, n.Rlist, n) + + if n.Op == OFOR || n.Op == ORANGE { + e.loopdepth-- + } + + if Debug['m'] > 1 { + fmt.Printf("%v:[%d] %v esc: %v\n", Ctxt.Line(int(lineno)), e.loopdepth, funcSym(Curfn), n) + } + + switch n.Op { + // Record loop depth at declaration. + case ODCL: + if n.Left != nil { + e.nodeEscState(n.Left).Escloopdepth = e.loopdepth + } + + case OLABEL: + if n.Left.Sym.Label == &nonlooping { + if Debug['m'] > 1 { + fmt.Printf("%v:%v non-looping label\n", Ctxt.Line(int(lineno)), n) + } + } else if n.Left.Sym.Label == &looping { + if Debug['m'] > 1 { + fmt.Printf("%v: %v looping label\n", Ctxt.Line(int(lineno)), n) + } + e.loopdepth++ + } + + // See case OLABEL in escloopdepth above + // else if(n->left->sym->label == nil) + // fatal("escape analysis missed or messed up a label: %+N", n); + + n.Left.Sym.Label = nil + + // Everything but fixed array is a dereference. + case ORANGE: + if n.List != nil && n.List.Next != nil { + if Isfixedarray(n.Type) { + escassign(e, n.List.Next.N, n.Right) + } else { + escassignDereference(e, n.List.Next.N, n.Right) + } + } + + case OSWITCH: + if n.Left != nil && n.Left.Op == OTYPESW { + for ll := n.List; ll != nil; ll = ll.Next { + // cases + // n.Left.Right is the argument of the .(type), + // ll.N.Rlist is the variable per case + if ll.N.Rlist != nil { + escassign(e, ll.N.Rlist.N, n.Left.Right) + } + } + } + + // Filter out the following special case. + // + // func (b *Buffer) Foo() { + // n, m := ... + // b.buf = b.buf[n:m] + // } + // + // This assignment is a no-op for escape analysis, + // it does not store any new pointers into b that were not already there. + // However, without this special case b will escape, because we assign to OIND/ODOTPTR. + case OAS, OASOP, OASWB: + if (n.Left.Op == OIND || n.Left.Op == ODOTPTR) && n.Left.Left.Op == ONAME && // dst is ONAME dereference + (n.Right.Op == OSLICE || n.Right.Op == OSLICE3 || n.Right.Op == OSLICESTR) && // src is slice operation + (n.Right.Left.Op == OIND || n.Right.Left.Op == ODOTPTR) && n.Right.Left.Left.Op == ONAME && // slice is applied to ONAME dereference + n.Left.Left == n.Right.Left.Left { // dst and src reference the same base ONAME + + // Here we also assume that the statement will not contain calls, + // that is, that order will move any calls to init. + // Otherwise base ONAME value could change between the moments + // when we evaluate it for dst and for src. + // + // Note, this optimization does not apply to OSLICEARR, + // because it does introduce a new pointer into b that was not already there + // (pointer to b itself). After such assignment, if b contents escape, + // b escapes as well. If we ignore such OSLICEARR, we will conclude + // that b does not escape when b contents do. + if Debug['m'] != 0 { + Warnl(int(n.Lineno), "%v ignoring self-assignment to %v", e.curfnSym(n), Nconv(n.Left, obj.FmtShort)) + } + + break + } + + escassign(e, n.Left, n.Right) + + case OAS2: // x,y = a,b + if count(n.List) == count(n.Rlist) { + ll := n.List + lr := n.Rlist + for ; ll != nil; ll, lr = ll.Next, lr.Next { + escassign(e, ll.N, lr.N) + } + } + + case OAS2RECV, // v, ok = <-ch + OAS2MAPR, // v, ok = m[k] + OAS2DOTTYPE: // v, ok = x.(type) + escassign(e, n.List.N, n.Rlist.N) + + case OSEND: // ch <- x + escassign(e, &e.theSink, n.Right) + + case ODEFER: + if e.loopdepth == 1 { // top level + break + } + // arguments leak out of scope + // TODO: leak to a dummy node instead + fallthrough + + case OPROC: + // go f(x) - f and x escape + escassign(e, &e.theSink, n.Left.Left) + + escassign(e, &e.theSink, n.Left.Right) // ODDDARG for call + for ll := n.Left.List; ll != nil; ll = ll.Next { + escassign(e, &e.theSink, ll.N) + } + + case OCALLMETH, OCALLFUNC, OCALLINTER: + esccall(e, n, up) + + // esccall already done on n->rlist->n. tie it's escretval to n->list + case OAS2FUNC: // x,y = f() + lr := e.nodeEscState(n.Rlist.N).Escretval + + var ll *NodeList + for ll = n.List; lr != nil && ll != nil; lr, ll = lr.Next, ll.Next { + escassign(e, ll.N, lr.N) + } + if lr != nil || ll != nil { + Fatal("esc oas2func") + } + + case ORETURN: + ll := n.List + if count(n.List) == 1 && Curfn.Type.Outtuple > 1 { + // OAS2FUNC in disguise + // esccall already done on n->list->n + // tie n->list->n->escretval to curfn->dcl PPARAMOUT's + ll = e.nodeEscState(n.List.N).Escretval + } + + for lr := Curfn.Func.Dcl; lr != nil && ll != nil; lr = lr.Next { + if lr.N.Op != ONAME || lr.N.Class != PPARAMOUT { + continue + } + escassign(e, lr.N, ll.N) + ll = ll.Next + } + + if ll != nil { + Fatal("esc return list") + } + + // Argument could leak through recover. + case OPANIC: + escassign(e, &e.theSink, n.Left) + + case OAPPEND: + if !n.Isddd { + for ll := n.List.Next; ll != nil; ll = ll.Next { + escassign(e, &e.theSink, ll.N) // lose track of assign to dereference + } + } else { + // append(slice1, slice2...) -- slice2 itself does not escape, but contents do. + slice2 := n.List.Next.N + escassignDereference(e, &e.theSink, slice2) // lose track of assign of dereference + if Debug['m'] > 2 { + Warnl(int(n.Lineno), "%v special treatment of append(slice1, slice2...) %v", e.curfnSym(n), Nconv(n, obj.FmtShort)) + } + } + escassignDereference(e, &e.theSink, n.List.N) // The original elements are now leaked, too + + case OCOPY: + escassignDereference(e, &e.theSink, n.Right) // lose track of assign of dereference + + case OCONV, OCONVNOP: + escassign(e, n, n.Left) + + case OCONVIFACE: + e.track(n) + escassign(e, n, n.Left) + + case OARRAYLIT: + if Isslice(n.Type) { + // Slice itself is not leaked until proven otherwise + e.track(n) + } + + // Link values to array/slice + for ll := n.List; ll != nil; ll = ll.Next { + escassign(e, n, ll.N.Right) + } + + // Link values to struct. + case OSTRUCTLIT: + for ll := n.List; ll != nil; ll = ll.Next { + escassign(e, n, ll.N.Right) + } + + case OPTRLIT: + e.track(n) + + // Link OSTRUCTLIT to OPTRLIT; if OPTRLIT escapes, OSTRUCTLIT elements do too. + escassign(e, n, n.Left) + + case OCALLPART: + e.track(n) + + // Contents make it to memory, lose track. + escassign(e, &e.theSink, n.Left) + + case OMAPLIT: + e.track(n) + + // Keys and values make it to memory, lose track. + for ll := n.List; ll != nil; ll = ll.Next { + escassign(e, &e.theSink, ll.N.Left) + escassign(e, &e.theSink, ll.N.Right) + } + + // Link addresses of captured variables to closure. + case OCLOSURE: + var a *Node + var v *Node + for ll := n.Func.Cvars; ll != nil; ll = ll.Next { + v = ll.N + if v.Op == OXXX { // unnamed out argument; see dcl.c:/^funcargs + continue + } + a = v.Name.Param.Closure + if !v.Name.Byval { + a = Nod(OADDR, a, nil) + a.Lineno = v.Lineno + e.nodeEscState(a).Escloopdepth = e.loopdepth + typecheck(&a, Erv) + } + + escassign(e, n, a) + } + fallthrough + + case OMAKECHAN, + OMAKEMAP, + OMAKESLICE, + ONEW, + OARRAYRUNESTR, + OARRAYBYTESTR, + OSTRARRAYRUNE, + OSTRARRAYBYTE, + ORUNESTR: + e.track(n) + + case OADDSTR: + e.track(n) + // Arguments of OADDSTR do not escape. + + case OADDR: + // current loop depth is an upper bound on actual loop depth + // of addressed value. + e.track(n) + + // for &x, use loop depth of x if known. + // it should always be known, but if not, be conservative + // and keep the current loop depth. + if n.Left.Op == ONAME { + switch n.Left.Class { + case PAUTO: + nE := e.nodeEscState(n) + leftE := e.nodeEscState(n.Left) + if leftE.Escloopdepth != 0 { + nE.Escloopdepth = leftE.Escloopdepth + } + + // PPARAM is loop depth 1 always. + // PPARAMOUT is loop depth 0 for writes + // but considered loop depth 1 for address-of, + // so that writing the address of one result + // to another (or the same) result makes the + // first result move to the heap. + case PPARAM, PPARAMOUT: + nE := e.nodeEscState(n) + nE.Escloopdepth = 1 + } + } + } + + lineno = int32(lno) +} + +// Assert that expr somehow gets assigned to dst, if non nil. for +// dst==nil, any name node expr still must be marked as being +// evaluated in curfn. For expr==nil, dst must still be examined for +// evaluations inside it (e.g *f(x) = y) +func escassign(e *EscState, dst *Node, src *Node) { + if isblank(dst) || dst == nil || src == nil || src.Op == ONONAME || src.Op == OXXX { + return + } + + if Debug['m'] > 1 { + fmt.Printf("%v:[%d] %v escassign: %v(%v)[%v] = %v(%v)[%v]\n", + Ctxt.Line(int(lineno)), e.loopdepth, funcSym(Curfn), + Nconv(dst, obj.FmtShort), Jconv(dst, obj.FmtShort), Oconv(int(dst.Op), 0), + Nconv(src, obj.FmtShort), Jconv(src, obj.FmtShort), Oconv(int(src.Op), 0)) + } + + setlineno(dst) + + // Analyze lhs of assignment. + // Replace dst with e->theSink if we can't track it. + switch dst.Op { + default: + Dump("dst", dst) + Fatal("escassign: unexpected dst") + + case OARRAYLIT, + OCLOSURE, + OCONV, + OCONVIFACE, + OCONVNOP, + OMAPLIT, + OSTRUCTLIT, + OPTRLIT, + OCALLPART: + break + + case ONAME: + if dst.Class == PEXTERN { + dst = &e.theSink + } + + case ODOT: // treat "dst.x = src" as "dst = src" + escassign(e, dst.Left, src) + + return + + case OINDEX: + if Isfixedarray(dst.Left.Type) { + escassign(e, dst.Left, src) + return + } + + dst = &e.theSink // lose track of dereference + + case OIND, ODOTPTR: + dst = &e.theSink // lose track of dereference + + // lose track of key and value + case OINDEXMAP: + escassign(e, &e.theSink, dst.Right) + + dst = &e.theSink + } + + lno := int(setlineno(src)) + e.pdepth++ + + switch src.Op { + case OADDR, // dst = &x + OIND, // dst = *x + ODOTPTR, // dst = (*x).f + ONAME, + OPARAM, + ODDDARG, + OPTRLIT, + OARRAYLIT, + OMAPLIT, + OSTRUCTLIT, + OMAKECHAN, + OMAKEMAP, + OMAKESLICE, + OARRAYRUNESTR, + OARRAYBYTESTR, + OSTRARRAYRUNE, + OSTRARRAYBYTE, + OADDSTR, + ONEW, + OCALLPART, + ORUNESTR, + OCONVIFACE: + escflows(e, dst, src) + + case OCLOSURE: + // OCLOSURE is lowered to OPTRLIT, + // insert OADDR to account for the additional indirection. + a := Nod(OADDR, src, nil) + a.Lineno = src.Lineno + e.nodeEscState(a).Escloopdepth = e.nodeEscState(src).Escloopdepth + a.Type = Ptrto(src.Type) + escflows(e, dst, a) + + // Flowing multiple returns to a single dst happens when + // analyzing "go f(g())": here g() flows to sink (issue 4529). + case OCALLMETH, OCALLFUNC, OCALLINTER: + for ll := e.nodeEscState(src).Escretval; ll != nil; ll = ll.Next { + escflows(e, dst, ll.N) + } + + // A non-pointer escaping from a struct does not concern us. + case ODOT: + if src.Type != nil && !haspointers(src.Type) { + break + } + fallthrough + + // Conversions, field access, slice all preserve the input value. + case OCONV, + OCONVNOP, + ODOTMETH, + // treat recv.meth as a value with recv in it, only happens in ODEFER and OPROC + // iface.method already leaks iface in esccall, no need to put in extra ODOTINTER edge here + ODOTTYPE, + ODOTTYPE2, + OSLICE, + OSLICE3, + OSLICEARR, + OSLICE3ARR, + OSLICESTR: + // Conversions, field access, slice all preserve the input value. + escassign(e, dst, src.Left) + + case OAPPEND: + // Append returns first argument. + // Subsequent arguments are already leaked because they are operands to append. + escassign(e, dst, src.List.N) + + case OINDEX: + // Index of array preserves input value. + if Isfixedarray(src.Left.Type) { + escassign(e, dst, src.Left) + } else { + escflows(e, dst, src) + } + + // Might be pointer arithmetic, in which case + // the operands flow into the result. + // TODO(rsc): Decide what the story is here. This is unsettling. + case OADD, + OSUB, + OOR, + OXOR, + OMUL, + ODIV, + OMOD, + OLSH, + ORSH, + OAND, + OANDNOT, + OPLUS, + OMINUS, + OCOM: + escassign(e, dst, src.Left) + + escassign(e, dst, src.Right) + } + + e.pdepth-- + lineno = int32(lno) +} + +// Common case for escapes is 16 bits 000000000xxxEEEE +// where commonest cases for xxx encoding in-to-out pointer +// flow are 000, 001, 010, 011 and EEEE is computed Esc bits. +// Note width of xxx depends on value of constant +// bitsPerOutputInTag -- expect 2 or 3, so in practice the +// tag cache array is 64 or 128 long. Some entries will +// never be populated. +var tags [1 << (bitsPerOutputInTag + EscReturnBits)]string + +// mktag returns the string representation for an escape analysis tag. +func mktag(mask int) *string { + switch mask & EscMask { + case EscNone, EscReturn: + break + + default: + Fatal("escape mktag") + } + + if mask < len(tags) && tags[mask] != "" { + return &tags[mask] + } + + s := fmt.Sprintf("esc:0x%x", mask) + if mask < len(tags) { + tags[mask] = s + } + return &s +} + +// parsetag decodes an escape analysis tag and returns the esc value. +func parsetag(note *string) uint16 { + if note == nil || !strings.HasPrefix(*note, "esc:") { + return EscUnknown + } + em := uint16(atoi((*note)[4:])) + if em == 0 { + return EscNone + } + return em +} + +// describeEscape returns a string describing the escape tag. +// The result is either one of {EscUnknown, EscNone, EscHeap} which all have no further annotation +// or a description of parameter flow, which takes the form of an optional "contentToHeap" +// indicating that the content of this parameter is leaked to the heap, followed by a sequence +// of level encodings separated by spaces, one for each parameter, where _ means no flow, +// = means direct flow, and N asterisks (*) encodes content (obtained by indirection) flow. +// e.g., "contentToHeap _ =" means that a parameter's content (one or more dereferences) +// escapes to the heap, the parameter does not leak to the first output, but does leak directly +// to the second output (and if there are more than two outputs, there is no flow to those.) +func describeEscape(em uint16) string { + var s string + if em&EscMask == EscUnknown { + s = "EscUnknown" + } + if em&EscMask == EscNone { + s = "EscNone" + } + if em&EscMask == EscHeap { + s = "EscHeap" + } + if em&EscMask == EscReturn { + s = "EscReturn" + } + if em&EscMask == EscScope { + s = "EscScope" + } + if em&EscContentEscapes != 0 { + if s != "" { + s += " " + } + s += "contentToHeap" + } + for em >>= EscReturnBits; em != 0; em = em >> bitsPerOutputInTag { + // See encoding description above + if s != "" { + s += " " + } + switch embits := em & bitsMaskForTag; embits { + case 0: + s += "_" + case 1: + s += "=" + default: + for i := uint16(0); i < embits-1; i++ { + s += "*" + } + } + + } + return s +} + +// escassignfromtag models the input-to-output assignment flow of one of a function +// calls arguments, where the flow is encoded in "note". +func escassignfromtag(e *EscState, note *string, dsts *NodeList, src *Node) uint16 { + em := parsetag(note) + if src.Op == OLITERAL { + return em + } + + if Debug['m'] > 2 { + fmt.Printf("%v::assignfromtag:: src=%v, em=%s\n", + Ctxt.Line(int(lineno)), Nconv(src, obj.FmtShort), describeEscape(em)) + } + + if em == EscUnknown { + escassign(e, &e.theSink, src) + return em + } + + if em == EscNone { + return em + } + + // If content inside parameter (reached via indirection) + // escapes to heap, mark as such. + if em&EscContentEscapes != 0 { + escassign(e, &e.theSink, e.addDereference(src)) + } + + em0 := em + for em >>= EscReturnBits; em != 0 && dsts != nil; em, dsts = em>>bitsPerOutputInTag, dsts.Next { + // Prefer the lowest-level path to the reference (for escape purposes). + // Two-bit encoding (for example. 1, 3, and 4 bits are other options) + // 01 = 0-level + // 10 = 1-level, (content escapes), + // 11 = 2-level, (content of content escapes), + embits := em & bitsMaskForTag + if embits > 0 { + n := src + for i := uint16(0); i < embits-1; i++ { + n = e.addDereference(n) // encode level>0 as indirections + } + escassign(e, dsts.N, n) + } + } + // If there are too many outputs to fit in the tag, + // that is handled at the encoding end as EscHeap, + // so there is no need to check here. + + if em != 0 && dsts == nil { + Fatal("corrupt esc tag %q or messed up escretval list\n", note) + } + return em0 +} + +func escassignDereference(e *EscState, dst *Node, src *Node) { + if src.Op == OLITERAL { + return + } + escassign(e, dst, e.addDereference(src)) +} + +// addDereference constructs a suitable OIND note applied to src. +// Because this is for purposes of escape accounting, not execution, +// some semantically dubious node combinations are (currently) possible. +func (e *EscState) addDereference(n *Node) *Node { + ind := Nod(OIND, n, nil) + e.nodeEscState(ind).Escloopdepth = e.nodeEscState(n).Escloopdepth + ind.Lineno = n.Lineno + t := n.Type + if Istype(t, Tptr) { + // This should model our own sloppy use of OIND to encode + // decreasing levels of indirection; i.e., "indirecting" an array + // might yield the type of an element. To be enhanced... + t = t.Type + } + ind.Type = t + return ind +} + +// escNoteOutputParamFlow encodes maxEncodedLevel/.../1/0-level flow to the vargen'th parameter. +// Levels greater than maxEncodedLevel are replaced with maxEncodedLevel. +// If the encoding cannot describe the modified input level and output number, then EscHeap is returned. +func escNoteOutputParamFlow(e uint16, vargen int32, level Level) uint16 { + // Flow+level is encoded in two bits. + // 00 = not flow, xx = level+1 for 0 <= level <= maxEncodedLevel + // 16 bits for Esc allows 6x2bits or 4x3bits or 3x4bits if additional information would be useful. + if level.int() <= 0 && level.guaranteedDereference() > 0 { + return escMax(e|EscContentEscapes, EscNone) // At least one deref, thus only content. + } + if level.int() < 0 { + return EscHeap + } + if level.int() > maxEncodedLevel { + // Cannot encode larger values than maxEncodedLevel. + level = levelFrom(maxEncodedLevel) + } + encoded := uint16(level.int() + 1) + + shift := uint(bitsPerOutputInTag*(vargen-1) + EscReturnBits) + old := (e >> shift) & bitsMaskForTag + if old == 0 || encoded != 0 && encoded < old { + old = encoded + } + + encodedFlow := old << shift + if (encodedFlow>>shift)&bitsMaskForTag != old { + // Encoding failure defaults to heap. + return EscHeap + } + + return (e &^ (bitsMaskForTag << shift)) | encodedFlow +} + +func initEscretval(e *EscState, n *Node, fntype *Type) { + i := 0 + nE := e.nodeEscState(n) + nE.Escretval = nil // Suspect this is not nil for indirect calls. + for t := getoutargx(fntype).Type; t != nil; t = t.Down { + src := Nod(ONAME, nil, nil) + buf := fmt.Sprintf(".out%d", i) + i++ + src.Sym = Lookup(buf) + src.Type = t.Type + src.Class = PAUTO + src.Name.Curfn = Curfn + e.nodeEscState(src).Escloopdepth = e.loopdepth + src.Used = true + src.Lineno = n.Lineno + nE.Escretval = list(nE.Escretval, src) + } +} + +// This is a bit messier than fortunate, pulled out of esc's big +// switch for clarity. We either have the paramnodes, which may be +// connected to other things through flows or we have the parameter type +// nodes, which may be marked "noescape". Navigating the ast is slightly +// different for methods vs plain functions and for imported vs +// this-package +func esccall(e *EscState, n *Node, up *Node) { + var fntype *Type + var indirect bool + var fn *Node + switch n.Op { + default: + Fatal("esccall") + + case OCALLFUNC: + fn = n.Left + fntype = fn.Type + indirect = fn.Op != ONAME || fn.Class != PFUNC + + case OCALLMETH: + fn = n.Left.Right.Sym.Def + if fn != nil { + fntype = fn.Type + } else { + fntype = n.Left.Type + } + + case OCALLINTER: + fntype = n.Left.Type + indirect = true + } + + ll := n.List + if n.List != nil && n.List.Next == nil { + a := n.List.N + if a.Type.Etype == TSTRUCT && a.Type.Funarg != 0 { // f(g()). + ll = e.nodeEscState(a).Escretval + } + } + + if indirect { + // We know nothing! + // Leak all the parameters + for ; ll != nil; ll = ll.Next { + escassign(e, &e.theSink, ll.N) + if Debug['m'] > 2 { + fmt.Printf("%v::esccall:: indirect call <- %v, untracked\n", Ctxt.Line(int(lineno)), Nconv(ll.N, obj.FmtShort)) + } + } + // Set up bogus outputs + initEscretval(e, n, fntype) + // If there is a receiver, it also leaks to heap. + if n.Op != OCALLFUNC { + t := getthisx(fntype).Type + src := n.Left.Left + if haspointers(t.Type) { + escassign(e, &e.theSink, src) + } + } + return + } + + nE := e.nodeEscState(n) + if fn != nil && fn.Op == ONAME && fn.Class == PFUNC && + fn.Name.Defn != nil && fn.Name.Defn.Nbody != nil && fn.Name.Param.Ntype != nil && fn.Name.Defn.Esc < EscFuncTagged { + if Debug['m'] > 2 { + fmt.Printf("%v::esccall:: %v in recursive group\n", Ctxt.Line(int(lineno)), Nconv(n, obj.FmtShort)) + } + + // function in same mutually recursive group. Incorporate into flow graph. + // print("esc local fn: %N\n", fn->ntype); + if fn.Name.Defn.Esc == EscFuncUnknown || nE.Escretval != nil { + Fatal("graph inconsistency") + } + + // set up out list on this call node + for lr := fn.Name.Param.Ntype.Rlist; lr != nil; lr = lr.Next { + nE.Escretval = list(nE.Escretval, lr.N.Left) // type.rlist -> dclfield -> ONAME (PPARAMOUT) + } + + // Receiver. + if n.Op != OCALLFUNC { + escassign(e, fn.Name.Param.Ntype.Left.Left, n.Left.Left) + } + + var src *Node + for lr := fn.Name.Param.Ntype.List; ll != nil && lr != nil; ll, lr = ll.Next, lr.Next { + src = ll.N + if lr.N.Isddd && !n.Isddd { + // Introduce ODDDARG node to represent ... allocation. + src = Nod(ODDDARG, nil, nil) + src.Type = typ(TARRAY) + src.Type.Type = lr.N.Type.Type + src.Type.Bound = int64(count(ll)) + src.Type = Ptrto(src.Type) // make pointer so it will be tracked + src.Lineno = n.Lineno + e.track(src) + n.Right = src + } + + if lr.N.Left != nil { + escassign(e, lr.N.Left, src) + } + if src != ll.N { + break + } + } + + // "..." arguments are untracked + for ; ll != nil; ll = ll.Next { + if Debug['m'] > 2 { + fmt.Printf("%v::esccall:: ... <- %v, untracked\n", Ctxt.Line(int(lineno)), Nconv(ll.N, obj.FmtShort)) + } + escassign(e, &e.theSink, ll.N) + } + + return + } + + // Imported or completely analyzed function. Use the escape tags. + if nE.Escretval != nil { + Fatal("esc already decorated call %v\n", Nconv(n, obj.FmtSign)) + } + + if Debug['m'] > 2 { + fmt.Printf("%v::esccall:: %v not recursive\n", Ctxt.Line(int(lineno)), Nconv(n, obj.FmtShort)) + } + + // set up out list on this call node with dummy auto ONAMES in the current (calling) function. + initEscretval(e, n, fntype) + + // print("esc analyzed fn: %#N (%+T) returning (%+H)\n", fn, fntype, n->escretval); + + // Receiver. + if n.Op != OCALLFUNC { + t := getthisx(fntype).Type + src := n.Left.Left + if haspointers(t.Type) { + escassignfromtag(e, t.Note, nE.Escretval, src) + } + } + + for t := getinargx(fntype).Type; ll != nil; ll = ll.Next { + src := ll.N + if t.Isddd && !n.Isddd { + // Introduce ODDDARG node to represent ... allocation. + src = Nod(ODDDARG, nil, nil) + src.Lineno = n.Lineno + src.Type = typ(TARRAY) + src.Type.Type = t.Type.Type + src.Type.Bound = int64(count(ll)) + src.Type = Ptrto(src.Type) // make pointer so it will be tracked + e.track(src) + n.Right = src + } + + if haspointers(t.Type) { + if escassignfromtag(e, t.Note, nE.Escretval, src) == EscNone && up.Op != ODEFER && up.Op != OPROC { + a := src + for a.Op == OCONVNOP { + a = a.Left + } + switch a.Op { + // The callee has already been analyzed, so its arguments have esc tags. + // The argument is marked as not escaping at all. + // Record that fact so that any temporary used for + // synthesizing this expression can be reclaimed when + // the function returns. + // This 'noescape' is even stronger than the usual esc == EscNone. + // src->esc == EscNone means that src does not escape the current function. + // src->noescape = 1 here means that src does not escape this statement + // in the current function. + case OCALLPART, + OCLOSURE, + ODDDARG, + OARRAYLIT, + OPTRLIT, + OSTRUCTLIT: + a.Noescape = true + } + } + } + + if src != ll.N { + break + } + t = t.Down + } + + // "..." arguments are untracked + for ; ll != nil; ll = ll.Next { + escassign(e, &e.theSink, ll.N) + if Debug['m'] > 2 { + fmt.Printf("%v::esccall:: ... <- %v, untracked\n", Ctxt.Line(int(lineno)), Nconv(ll.N, obj.FmtShort)) + } + } +} + +// escflows records the link src->dst in dst, throwing out some quick wins, +// and also ensuring that dst is noted as a flow destination. +func escflows(e *EscState, dst *Node, src *Node) { + if dst == nil || src == nil || dst == src { + return + } + + // Don't bother building a graph for scalars. + if src.Type != nil && !haspointers(src.Type) { + return + } + + if Debug['m'] > 2 { + fmt.Printf("%v::flows:: %v <- %v\n", Ctxt.Line(int(lineno)), Nconv(dst, obj.FmtShort), Nconv(src, obj.FmtShort)) + } + + dstE := e.nodeEscState(dst) + if dstE.Escflowsrc == nil { + e.dsts = list(e.dsts, dst) + e.dstcount++ + } + + e.edgecount++ + + dstE.Escflowsrc = list(dstE.Escflowsrc, src) +} + +// Whenever we hit a reference node, the level goes up by one, and whenever +// we hit an OADDR, the level goes down by one. as long as we're on a level > 0 +// finding an OADDR just means we're following the upstream of a dereference, +// so this address doesn't leak (yet). +// If level == 0, it means the /value/ of this node can reach the root of this flood. +// so if this node is an OADDR, it's argument should be marked as escaping iff +// it's currfn/e->loopdepth are different from the flood's root. +// Once an object has been moved to the heap, all of it's upstream should be considered +// escaping to the global scope. +func escflood(e *EscState, dst *Node) { + switch dst.Op { + case ONAME, OCLOSURE: + break + + default: + return + } + + dstE := e.nodeEscState(dst) + if Debug['m'] > 1 { + fmt.Printf("\nescflood:%d: dst %v scope:%v[%d]\n", e.walkgen, Nconv(dst, obj.FmtShort), e.curfnSym(dst), dstE.Escloopdepth) + } + + for l := dstE.Escflowsrc; l != nil; l = l.Next { + e.walkgen++ + escwalk(e, levelFrom(0), dst, l.N) + } +} + +// funcOutputAndInput reports whether dst and src correspond to output and input parameters of the same function. +func funcOutputAndInput(dst, src *Node) bool { + // Note if dst is marked as escaping, then "returned" is too weak. + return dst.Op == ONAME && dst.Class == PPARAMOUT && + src.Op == ONAME && src.Class == PPARAM && src.Name.Curfn == dst.Name.Curfn +} + +func escwalk(e *EscState, level Level, dst *Node, src *Node) { + if src.Op == OLITERAL { + return + } + srcE := e.nodeEscState(src) + if srcE.Walkgen == e.walkgen { + // Esclevels are vectors, do not compare as integers, + // and must use "min" of old and new to guarantee + // convergence. + level = level.min(srcE.Esclevel) + if level == srcE.Esclevel { + return + } + } + + srcE.Walkgen = e.walkgen + srcE.Esclevel = level + + if Debug['m'] > 1 { + fmt.Printf("escwalk: level:%d depth:%d %.*s op=%v %v(%v) scope:%v[%d]\n", + level, e.pdepth, e.pdepth, "\t\t\t\t\t\t\t\t\t\t", Oconv(int(src.Op), 0), Nconv(src, obj.FmtShort), Jconv(src, obj.FmtShort), e.curfnSym(src), srcE.Escloopdepth) + } + + e.pdepth++ + + // Input parameter flowing to output parameter? + var leaks bool + dstE := e.nodeEscState(dst) + if funcOutputAndInput(dst, src) && src.Esc&EscMask < EscScope && dst.Esc != EscHeap { + // This case handles: + // 1. return in + // 2. return &in + // 3. tmp := in; return &tmp + // 4. return *in + if Debug['m'] != 0 { + if Debug['m'] == 1 { + Warnl(int(src.Lineno), "leaking param: %v to result %v level=%v", Nconv(src, obj.FmtShort), dst.Sym, level.int()) + } else { + Warnl(int(src.Lineno), "leaking param: %v to result %v level=%v", Nconv(src, obj.FmtShort), dst.Sym, level) + } + } + if src.Esc&EscMask != EscReturn { + src.Esc = EscReturn | src.Esc&EscContentEscapes + } + src.Esc = escNoteOutputParamFlow(src.Esc, dst.Name.Vargen, level) + goto recurse + } + + // If parameter content escapes to heap, set EscContentEscapes + // Note minor confusion around escape from pointer-to-struct vs escape from struct + if dst.Esc == EscHeap && + src.Op == ONAME && src.Class == PPARAM && src.Esc&EscMask < EscScope && + level.int() > 0 { + src.Esc = escMax(EscContentEscapes|src.Esc, EscNone) + if Debug['m'] != 0 { + Warnl(int(src.Lineno), "mark escaped content: %v", Nconv(src, obj.FmtShort)) + } + } + + leaks = level.int() <= 0 && level.guaranteedDereference() <= 0 && dstE.Escloopdepth < srcE.Escloopdepth + + switch src.Op { + case ONAME: + if src.Class == PPARAM && (leaks || dstE.Escloopdepth < 0) && src.Esc&EscMask < EscScope { + if level.guaranteedDereference() > 0 { + src.Esc = escMax(EscContentEscapes|src.Esc, EscNone) + if Debug['m'] != 0 { + if Debug['m'] == 1 { + Warnl(int(src.Lineno), "leaking param content: %v", Nconv(src, obj.FmtShort)) + } else { + Warnl(int(src.Lineno), "leaking param content: %v level=%v dst.eld=%v src.eld=%v dst=%v", + Nconv(src, obj.FmtShort), level, dstE.Escloopdepth, srcE.Escloopdepth, Nconv(dst, obj.FmtShort)) + } + } + } else { + src.Esc = EscScope + if Debug['m'] != 0 { + if Debug['m'] == 1 { + Warnl(int(src.Lineno), "leaking param: %v", Nconv(src, obj.FmtShort)) + } else { + Warnl(int(src.Lineno), "leaking param: %v level=%v dst.eld=%v src.eld=%v dst=%v", + Nconv(src, obj.FmtShort), level, dstE.Escloopdepth, srcE.Escloopdepth, Nconv(dst, obj.FmtShort)) + } + } + } + } + + // Treat a PPARAMREF closure variable as equivalent to the + // original variable. + if src.Class == PPARAMREF { + if leaks && Debug['m'] != 0 { + Warnl(int(src.Lineno), "leaking closure reference %v", Nconv(src, obj.FmtShort)) + } + escwalk(e, level, dst, src.Name.Param.Closure) + } + + case OPTRLIT, OADDR: + if leaks { + src.Esc = EscHeap + addrescapes(src.Left) + if Debug['m'] != 0 { + p := src + if p.Left.Op == OCLOSURE { + p = p.Left // merely to satisfy error messages in tests + } + if Debug['m'] > 1 { + Warnl(int(src.Lineno), "%v escapes to heap, level=%v, dst.eld=%v, src.eld=%v", + Nconv(p, obj.FmtShort), level, dstE.Escloopdepth, srcE.Escloopdepth) + } else { + Warnl(int(src.Lineno), "%v escapes to heap", Nconv(p, obj.FmtShort)) + } + } + } + + escwalk(e, level.dec(), dst, src.Left) + + case OAPPEND: + escwalk(e, level, dst, src.List.N) + + case OARRAYLIT: + if Isfixedarray(src.Type) { + break + } + for ll := src.List; ll != nil; ll = ll.Next { + escwalk(e, level.dec(), dst, ll.N.Right) + } + + fallthrough + + case ODDDARG, + OMAKECHAN, + OMAKEMAP, + OMAKESLICE, + OARRAYRUNESTR, + OARRAYBYTESTR, + OSTRARRAYRUNE, + OSTRARRAYBYTE, + OADDSTR, + OMAPLIT, + ONEW, + OCLOSURE, + OCALLPART, + ORUNESTR, + OCONVIFACE: + if leaks { + src.Esc = EscHeap + if Debug['m'] != 0 { + Warnl(int(src.Lineno), "%v escapes to heap", Nconv(src, obj.FmtShort)) + } + } + + case ODOT, + ODOTTYPE, + OSLICE, + OSLICEARR, + OSLICE3, + OSLICE3ARR, + OSLICESTR: + escwalk(e, level, dst, src.Left) + + case OINDEX: + if Isfixedarray(src.Left.Type) { + escwalk(e, level, dst, src.Left) + break + } + fallthrough + + case ODOTPTR, OINDEXMAP, OIND: + escwalk(e, level.inc(), dst, src.Left) + + // In this case a link went directly to a call, but should really go + // to the dummy .outN outputs that were created for the call that + // themselves link to the inputs with levels adjusted. + // See e.g. #10466 + // This can only happen with functions returning a single result. + case OCALLMETH, OCALLFUNC, OCALLINTER: + if srcE.Escretval != nil { + if Debug['m'] > 1 { + fmt.Printf("%v:[%d] dst %v escwalk replace src: %v with %v\n", + Ctxt.Line(int(lineno)), e.loopdepth, + Nconv(dst, obj.FmtShort), Nconv(src, obj.FmtShort), Nconv(srcE.Escretval.N, obj.FmtShort)) + } + src = srcE.Escretval.N + srcE = e.nodeEscState(src) + } + } + +recurse: + level = level.copy() + for ll := srcE.Escflowsrc; ll != nil; ll = ll.Next { + escwalk(e, level, dst, ll.N) + } + + e.pdepth-- +} + +func esctag(e *EscState, func_ *Node) { + func_.Esc = EscFuncTagged + + // External functions are assumed unsafe, + // unless //go:noescape is given before the declaration. + if func_.Nbody == nil { + if func_.Noescape { + for t := getinargx(func_.Type).Type; t != nil; t = t.Down { + if haspointers(t.Type) { + t.Note = mktag(EscNone) + } + } + } + + return + } + + savefn := Curfn + Curfn = func_ + + for ll := Curfn.Func.Dcl; ll != nil; ll = ll.Next { + if ll.N.Op != ONAME { + continue + } + + switch ll.N.Esc & EscMask { + case EscNone, // not touched by escflood + EscReturn: + if haspointers(ll.N.Type) { // don't bother tagging for scalars + ll.N.Name.Param.Field.Note = mktag(int(ll.N.Esc)) + } + + case EscHeap, // touched by escflood, moved to heap + EscScope: // touched by escflood, value leaves scope + break + } + } + + Curfn = savefn +} diff --git a/src/cmd/compile/internal/gc/export.go b/src/cmd/compile/internal/gc/export.go new file mode 100644 index 0000000000000000000000000000000000000000..66ae8816c344245064121cc680b9dd435f39605b --- /dev/null +++ b/src/cmd/compile/internal/gc/export.go @@ -0,0 +1,561 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package gc + +import ( + "cmd/internal/obj" + "fmt" + "sort" + "unicode" + "unicode/utf8" +) + +var asmlist *NodeList + +// Mark n's symbol as exported +func exportsym(n *Node) { + if n == nil || n.Sym == nil { + return + } + if n.Sym.Flags&(SymExport|SymPackage) != 0 { + if n.Sym.Flags&SymPackage != 0 { + Yyerror("export/package mismatch: %v", n.Sym) + } + return + } + + n.Sym.Flags |= SymExport + + if Debug['E'] != 0 { + fmt.Printf("export symbol %v\n", n.Sym) + } + exportlist = list(exportlist, n) +} + +func exportname(s string) bool { + if s[0] < utf8.RuneSelf { + return 'A' <= s[0] && s[0] <= 'Z' + } + r, _ := utf8.DecodeRuneInString(s) + return unicode.IsUpper(r) +} + +func initname(s string) bool { + return s == "init" +} + +// exportedsym reports whether a symbol will be visible +// to files that import our package. +func exportedsym(sym *Sym) bool { + // Builtins are visible everywhere. + if sym.Pkg == builtinpkg || sym.Origpkg == builtinpkg { + return true + } + + return sym.Pkg == localpkg && exportname(sym.Name) +} + +func autoexport(n *Node, ctxt uint8) { + if n == nil || n.Sym == nil { + return + } + if (ctxt != PEXTERN && ctxt != PFUNC) || dclcontext != PEXTERN { + return + } + if n.Name.Param != nil && n.Name.Param.Ntype != nil && n.Name.Param.Ntype.Op == OTFUNC && n.Name.Param.Ntype.Left != nil { // method + return + } + + // -A is for cmd/gc/mkbuiltin script, so export everything + if Debug['A'] != 0 || exportname(n.Sym.Name) || initname(n.Sym.Name) { + exportsym(n) + } + if asmhdr != "" && n.Sym.Pkg == localpkg && n.Sym.Flags&SymAsm == 0 { + n.Sym.Flags |= SymAsm + asmlist = list(asmlist, n) + } +} + +func dumppkg(p *Pkg) { + if p == nil || p == localpkg || p.Exported != 0 || p == builtinpkg { + return + } + p.Exported = 1 + suffix := "" + if p.Direct == 0 { + suffix = " // indirect" + } + fmt.Fprintf(bout, "\timport %s %q%s\n", p.Name, p.Path, suffix) +} + +// Look for anything we need for the inline body +func reexportdeplist(ll *NodeList) { + for ; ll != nil; ll = ll.Next { + reexportdep(ll.N) + } +} + +func reexportdep(n *Node) { + if n == nil { + return + } + + //print("reexportdep %+hN\n", n); + switch n.Op { + case ONAME: + switch n.Class &^ PHEAP { + // methods will be printed along with their type + // nodes for T.Method expressions + case PFUNC: + if n.Left != nil && n.Left.Op == OTYPE { + break + } + + // nodes for method calls. + if n.Type == nil || n.Type.Thistuple > 0 { + break + } + fallthrough + + case PEXTERN: + if n.Sym != nil && !exportedsym(n.Sym) { + if Debug['E'] != 0 { + fmt.Printf("reexport name %v\n", n.Sym) + } + exportlist = list(exportlist, n) + } + } + + // Local variables in the bodies need their type. + case ODCL: + t := n.Left.Type + + if t != Types[t.Etype] && t != idealbool && t != idealstring { + if Isptr[t.Etype] { + t = t.Type + } + if t != nil && t.Sym != nil && t.Sym.Def != nil && !exportedsym(t.Sym) { + if Debug['E'] != 0 { + fmt.Printf("reexport type %v from declaration\n", t.Sym) + } + exportlist = list(exportlist, t.Sym.Def) + } + } + + case OLITERAL: + t := n.Type + if t != Types[n.Type.Etype] && t != idealbool && t != idealstring { + if Isptr[t.Etype] { + t = t.Type + } + if t != nil && t.Sym != nil && t.Sym.Def != nil && !exportedsym(t.Sym) { + if Debug['E'] != 0 { + fmt.Printf("reexport literal type %v\n", t.Sym) + } + exportlist = list(exportlist, t.Sym.Def) + } + } + fallthrough + + case OTYPE: + if n.Sym != nil && !exportedsym(n.Sym) { + if Debug['E'] != 0 { + fmt.Printf("reexport literal/type %v\n", n.Sym) + } + exportlist = list(exportlist, n) + } + + // for operations that need a type when rendered, put the type on the export list. + case OCONV, + OCONVIFACE, + OCONVNOP, + ORUNESTR, + OARRAYBYTESTR, + OARRAYRUNESTR, + OSTRARRAYBYTE, + OSTRARRAYRUNE, + ODOTTYPE, + ODOTTYPE2, + OSTRUCTLIT, + OARRAYLIT, + OPTRLIT, + OMAKEMAP, + OMAKESLICE, + OMAKECHAN: + t := n.Type + + if t.Sym == nil && t.Type != nil { + t = t.Type + } + if t != nil && t.Sym != nil && t.Sym.Def != nil && !exportedsym(t.Sym) { + if Debug['E'] != 0 { + fmt.Printf("reexport type for expression %v\n", t.Sym) + } + exportlist = list(exportlist, t.Sym.Def) + } + } + + reexportdep(n.Left) + reexportdep(n.Right) + reexportdeplist(n.List) + reexportdeplist(n.Rlist) + reexportdeplist(n.Ninit) + reexportdeplist(n.Nbody) +} + +func dumpexportconst(s *Sym) { + n := s.Def + typecheck(&n, Erv) + if n == nil || n.Op != OLITERAL { + Fatal("dumpexportconst: oconst nil: %v", s) + } + + t := n.Type // may or may not be specified + dumpexporttype(t) + + if t != nil && !isideal(t) { + fmt.Fprintf(bout, "\tconst %v %v = %v\n", Sconv(s, obj.FmtSharp), Tconv(t, obj.FmtSharp), Vconv(n.Val(), obj.FmtSharp)) + } else { + fmt.Fprintf(bout, "\tconst %v = %v\n", Sconv(s, obj.FmtSharp), Vconv(n.Val(), obj.FmtSharp)) + } +} + +func dumpexportvar(s *Sym) { + n := s.Def + typecheck(&n, Erv|Ecall) + if n == nil || n.Type == nil { + Yyerror("variable exported but not defined: %v", s) + return + } + + t := n.Type + dumpexporttype(t) + + if t.Etype == TFUNC && n.Class == PFUNC { + if n.Func != nil && n.Func.Inl != nil { + // when lazily typechecking inlined bodies, some re-exported ones may not have been typechecked yet. + // currently that can leave unresolved ONONAMEs in import-dot-ed packages in the wrong package + if Debug['l'] < 2 { + typecheckinl(n) + } + + // NOTE: The space after %#S here is necessary for ld's export data parser. + fmt.Fprintf(bout, "\tfunc %v %v { %v }\n", Sconv(s, obj.FmtSharp), Tconv(t, obj.FmtShort|obj.FmtSharp), Hconv(n.Func.Inl, obj.FmtSharp)) + + reexportdeplist(n.Func.Inl) + } else { + fmt.Fprintf(bout, "\tfunc %v %v\n", Sconv(s, obj.FmtSharp), Tconv(t, obj.FmtShort|obj.FmtSharp)) + } + } else { + fmt.Fprintf(bout, "\tvar %v %v\n", Sconv(s, obj.FmtSharp), Tconv(t, obj.FmtSharp)) + } +} + +type methodbyname []*Type + +func (x methodbyname) Len() int { + return len(x) +} + +func (x methodbyname) Swap(i, j int) { + x[i], x[j] = x[j], x[i] +} + +func (x methodbyname) Less(i, j int) bool { + a := x[i] + b := x[j] + return stringsCompare(a.Sym.Name, b.Sym.Name) < 0 +} + +func dumpexporttype(t *Type) { + if t == nil { + return + } + if t.Printed != 0 || t == Types[t.Etype] || t == bytetype || t == runetype || t == errortype { + return + } + t.Printed = 1 + + if t.Sym != nil && t.Etype != TFIELD { + dumppkg(t.Sym.Pkg) + } + + dumpexporttype(t.Type) + dumpexporttype(t.Down) + + if t.Sym == nil || t.Etype == TFIELD { + return + } + + n := 0 + for f := t.Method; f != nil; f = f.Down { + dumpexporttype(f) + n++ + } + + m := make([]*Type, n) + i := 0 + for f := t.Method; f != nil; f = f.Down { + m[i] = f + i++ + } + sort.Sort(methodbyname(m[:n])) + + fmt.Fprintf(bout, "\ttype %v %v\n", Sconv(t.Sym, obj.FmtSharp), Tconv(t, obj.FmtSharp|obj.FmtLong)) + var f *Type + for i := 0; i < n; i++ { + f = m[i] + if f.Nointerface { + fmt.Fprintf(bout, "\t//go:nointerface\n") + } + if f.Type.Nname != nil && f.Type.Nname.Func.Inl != nil { // nname was set by caninl + + // when lazily typechecking inlined bodies, some re-exported ones may not have been typechecked yet. + // currently that can leave unresolved ONONAMEs in import-dot-ed packages in the wrong package + if Debug['l'] < 2 { + typecheckinl(f.Type.Nname) + } + fmt.Fprintf(bout, "\tfunc (%v) %v %v { %v }\n", Tconv(getthisx(f.Type).Type, obj.FmtSharp), Sconv(f.Sym, obj.FmtShort|obj.FmtByte|obj.FmtSharp), Tconv(f.Type, obj.FmtShort|obj.FmtSharp), Hconv(f.Type.Nname.Func.Inl, obj.FmtSharp)) + reexportdeplist(f.Type.Nname.Func.Inl) + } else { + fmt.Fprintf(bout, "\tfunc (%v) %v %v\n", Tconv(getthisx(f.Type).Type, obj.FmtSharp), Sconv(f.Sym, obj.FmtShort|obj.FmtByte|obj.FmtSharp), Tconv(f.Type, obj.FmtShort|obj.FmtSharp)) + } + } +} + +func dumpsym(s *Sym) { + if s.Flags&SymExported != 0 { + return + } + s.Flags |= SymExported + + if s.Def == nil { + Yyerror("unknown export symbol: %v", s) + return + } + + // print("dumpsym %O %+S\n", s->def->op, s); + dumppkg(s.Pkg) + + switch s.Def.Op { + default: + Yyerror("unexpected export symbol: %v %v", Oconv(int(s.Def.Op), 0), s) + + case OLITERAL: + dumpexportconst(s) + + case OTYPE: + if s.Def.Type.Etype == TFORW { + Yyerror("export of incomplete type %v", s) + } else { + dumpexporttype(s.Def.Type) + } + + case ONAME: + dumpexportvar(s) + } +} + +func dumpexport() { + lno := lineno + + if buildid != "" { + fmt.Fprintf(bout, "build id %q\n", buildid) + } + fmt.Fprintf(bout, "\n$$\npackage %s", localpkg.Name) + if safemode != 0 { + fmt.Fprintf(bout, " safe") + } + fmt.Fprintf(bout, "\n") + + for _, p := range pkgs { + if p.Direct != 0 { + dumppkg(p) + } + } + + for l := exportlist; l != nil; l = l.Next { + lineno = l.N.Lineno + dumpsym(l.N.Sym) + } + + fmt.Fprintf(bout, "\n$$\n") + lineno = lno +} + +/* + * import + */ + +/* + * return the sym for ss, which should match lexical + */ +func importsym(s *Sym, op int) *Sym { + if s.Def != nil && int(s.Def.Op) != op { + pkgstr := fmt.Sprintf("during import %q", importpkg.Path) + redeclare(s, pkgstr) + } + + // mark the symbol so it is not reexported + if s.Def == nil { + if exportname(s.Name) || initname(s.Name) { + s.Flags |= SymExport + } else { + s.Flags |= SymPackage // package scope + } + } + + return s +} + +/* + * return the type pkg.name, forward declaring if needed + */ +func pkgtype(s *Sym) *Type { + importsym(s, OTYPE) + if s.Def == nil || s.Def.Op != OTYPE { + t := typ(TFORW) + t.Sym = s + s.Def = typenod(t) + s.Def.Name = new(Name) + } + + if s.Def.Type == nil { + Yyerror("pkgtype %v", s) + } + return s.Def.Type +} + +var numImport = make(map[string]int) + +func importimport(s *Sym, path string) { + // Informational: record package name + // associated with import path, for use in + // human-readable messages. + + if isbadimport(path) { + errorexit() + } + p := mkpkg(path) + if p.Name == "" { + p.Name = s.Name + numImport[s.Name]++ + } else if p.Name != s.Name { + Yyerror("conflicting names %s and %s for package %q", p.Name, s.Name, p.Path) + } + + if incannedimport == 0 && myimportpath != "" && path == myimportpath { + Yyerror("import %q: package depends on %q (import cycle)", importpkg.Path, path) + errorexit() + } +} + +func importconst(s *Sym, t *Type, n *Node) { + importsym(s, OLITERAL) + Convlit(&n, t) + + if s.Def != nil { // TODO: check if already the same. + return + } + + if n.Op != OLITERAL { + Yyerror("expression must be a constant") + return + } + + if n.Sym != nil { + n1 := Nod(OXXX, nil, nil) + *n1 = *n + n = n1 + } + + n.Orig = newname(s) + n.Sym = s + declare(n, PEXTERN) + + if Debug['E'] != 0 { + fmt.Printf("import const %v\n", s) + } +} + +func importvar(s *Sym, t *Type) { + importsym(s, ONAME) + if s.Def != nil && s.Def.Op == ONAME { + if Eqtype(t, s.Def.Type) { + return + } + Yyerror("inconsistent definition for var %v during import\n\t%v (in %q)\n\t%v (in %q)", s, s.Def.Type, s.Importdef.Path, t, importpkg.Path) + } + + n := newname(s) + s.Importdef = importpkg + n.Type = t + declare(n, PEXTERN) + + if Debug['E'] != 0 { + fmt.Printf("import var %v %v\n", s, Tconv(t, obj.FmtLong)) + } +} + +func importtype(pt *Type, t *Type) { + // override declaration in unsafe.go for Pointer. + // there is no way in Go code to define unsafe.Pointer + // so we have to supply it. + if incannedimport != 0 && importpkg.Name == "unsafe" && pt.Nod.Sym.Name == "Pointer" { + t = Types[TUNSAFEPTR] + } + + if pt.Etype == TFORW { + n := pt.Nod + copytype(pt.Nod, t) + pt.Nod = n // unzero nod + pt.Sym.Importdef = importpkg + pt.Sym.Lastlineno = int32(parserline()) + declare(n, PEXTERN) + checkwidth(pt) + } else if !Eqtype(pt.Orig, t) { + Yyerror("inconsistent definition for type %v during import\n\t%v (in %q)\n\t%v (in %q)", pt.Sym, Tconv(pt, obj.FmtLong), pt.Sym.Importdef.Path, Tconv(t, obj.FmtLong), importpkg.Path) + } + + if Debug['E'] != 0 { + fmt.Printf("import type %v %v\n", pt, Tconv(t, obj.FmtLong)) + } +} + +func dumpasmhdr() { + var b *obj.Biobuf + + b, err := obj.Bopenw(asmhdr) + if err != nil { + Fatal("%v", err) + } + fmt.Fprintf(b, "// generated by %cg -asmhdr from package %s\n\n", Thearch.Thechar, localpkg.Name) + var n *Node + var t *Type + for l := asmlist; l != nil; l = l.Next { + n = l.N + if isblanksym(n.Sym) { + continue + } + switch n.Op { + case OLITERAL: + fmt.Fprintf(b, "#define const_%s %v\n", n.Sym.Name, Vconv(n.Val(), obj.FmtSharp)) + + case OTYPE: + t = n.Type + if t.Etype != TSTRUCT || t.Map != nil || t.Funarg != 0 { + break + } + fmt.Fprintf(b, "#define %s__size %d\n", t.Sym.Name, int(t.Width)) + for t = t.Type; t != nil; t = t.Down { + if !isblanksym(t.Sym) { + fmt.Fprintf(b, "#define %s_%s %d\n", n.Sym.Name, t.Sym.Name, int(t.Width)) + } + } + } + } + + obj.Bterm(b) +} diff --git a/src/cmd/compile/internal/gc/fmt.go b/src/cmd/compile/internal/gc/fmt.go new file mode 100644 index 0000000000000000000000000000000000000000..b40014be80dec993cce8e4dae9198d8ba91c20b6 --- /dev/null +++ b/src/cmd/compile/internal/gc/fmt.go @@ -0,0 +1,1724 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package gc + +import ( + "bytes" + "cmd/internal/obj" + "fmt" + "strconv" + "strings" + "unicode/utf8" +) + +// +// Format conversions +// %L int Line numbers +// +// %E int etype values (aka 'Kind') +// +// %O int Node Opcodes +// Flags: "%#O": print go syntax. (automatic unless fmtmode == FDbg) +// +// %J Node* Node details +// Flags: "%hJ" suppresses things not relevant until walk. +// +// %V Val* Constant values +// +// %S Sym* Symbols +// Flags: +,- #: mode (see below) +// "%hS" unqualified identifier in any mode +// "%hhS" in export mode: unqualified identifier if exported, qualified if not +// +// %T Type* Types +// Flags: +,- #: mode (see below) +// 'l' definition instead of name. +// 'h' omit "func" and receiver in function types +// 'u' (only in -/Sym mode) print type identifiers wit package name instead of prefix. +// +// %N Node* Nodes +// Flags: +,- #: mode (see below) +// 'h' (only in +/debug mode) suppress recursion +// 'l' (only in Error mode) print "foo (type Bar)" +// +// %H NodeList* NodeLists +// Flags: those of %N +// ',' separate items with ',' instead of ';' +// +// In mparith1.c: +// %B Mpint* Big integers +// %F Mpflt* Big floats +// +// %S, %T and %N obey use the following flags to set the format mode: +const ( + FErr = iota + FDbg + FExp + FTypeId +) + +var fmtmode int = FErr + +var fmtpkgpfx int // %uT stickyness + +// +// E.g. for %S: %+S %#S %-S print an identifier properly qualified for debug/export/internal mode. +// +// The mode flags +, - and # are sticky, meaning they persist through +// recursions of %N, %T and %S, but not the h and l flags. The u flag is +// sticky only on %T recursions and only used in %-/Sym mode. + +// +// Useful format combinations: +// +// %+N %+H multiline recursive debug dump of node/nodelist +// %+hN %+hH non recursive debug dump +// +// %#N %#T export format +// %#lT type definition instead of name +// %#hT omit"func" and receiver in function signature +// +// %lN "foo (type Bar)" for error messages +// +// %-T type identifiers +// %-hT type identifiers without "func" and arg names in type signatures (methodsym) +// %-uT type identifiers with package name instead of prefix (typesym, dcommontype, typehash) +// + +func setfmode(flags *int) int { + fm := fmtmode + if *flags&obj.FmtSign != 0 { + fmtmode = FDbg + } else if *flags&obj.FmtSharp != 0 { + fmtmode = FExp + } else if *flags&obj.FmtLeft != 0 { + fmtmode = FTypeId + } + + *flags &^= (obj.FmtSharp | obj.FmtLeft | obj.FmtSign) + return fm +} + +// Fmt "%L": Linenumbers + +var goopnames = []string{ + OADDR: "&", + OADD: "+", + OADDSTR: "+", + OANDAND: "&&", + OANDNOT: "&^", + OAND: "&", + OAPPEND: "append", + OAS: "=", + OAS2: "=", + OBREAK: "break", + OCALL: "function call", // not actual syntax + OCAP: "cap", + OCASE: "case", + OCLOSE: "close", + OCOMPLEX: "complex", + OCOM: "^", + OCONTINUE: "continue", + OCOPY: "copy", + ODEC: "--", + ODELETE: "delete", + ODEFER: "defer", + ODIV: "/", + OEQ: "==", + OFALL: "fallthrough", + OFOR: "for", + OGE: ">=", + OGOTO: "goto", + OGT: ">", + OIF: "if", + OIMAG: "imag", + OINC: "++", + OIND: "*", + OLEN: "len", + OLE: "<=", + OLSH: "<<", + OLT: "<", + OMAKE: "make", + OMINUS: "-", + OMOD: "%", + OMUL: "*", + ONEW: "new", + ONE: "!=", + ONOT: "!", + OOROR: "||", + OOR: "|", + OPANIC: "panic", + OPLUS: "+", + OPRINTN: "println", + OPRINT: "print", + ORANGE: "range", + OREAL: "real", + ORECV: "<-", + ORECOVER: "recover", + ORETURN: "return", + ORSH: ">>", + OSELECT: "select", + OSEND: "<-", + OSUB: "-", + OSWITCH: "switch", + OXOR: "^", +} + +// Fmt "%O": Node opcodes +func Oconv(o int, flag int) string { + if (flag&obj.FmtSharp != 0) || fmtmode != FDbg { + if o >= 0 && o < len(goopnames) && goopnames[o] != "" { + return goopnames[o] + } + } + + if o >= 0 && o < len(opnames) && opnames[o] != "" { + return opnames[o] + } + + return fmt.Sprintf("O-%d", o) +} + +var classnames = []string{ + "Pxxx", + "PEXTERN", + "PAUTO", + "PPARAM", + "PPARAMOUT", + "PPARAMREF", + "PFUNC", +} + +// Fmt "%J": Node details. +func Jconv(n *Node, flag int) string { + var buf bytes.Buffer + + c := flag & obj.FmtShort + + if c == 0 && n.Ullman != 0 { + fmt.Fprintf(&buf, " u(%d)", n.Ullman) + } + + if c == 0 && n.Addable { + fmt.Fprintf(&buf, " a(%v)", n.Addable) + } + + if c == 0 && n.Name != nil && n.Name.Vargen != 0 { + fmt.Fprintf(&buf, " g(%d)", n.Name.Vargen) + } + + if n.Lineno != 0 { + fmt.Fprintf(&buf, " l(%d)", n.Lineno) + } + + if c == 0 && n.Xoffset != BADWIDTH { + fmt.Fprintf(&buf, " x(%d%+d)", n.Xoffset, stkdelta[n]) + } + + if n.Class != 0 { + s := "" + if n.Class&PHEAP != 0 { + s = ",heap" + } + if int(n.Class&^PHEAP) < len(classnames) { + fmt.Fprintf(&buf, " class(%s%s)", classnames[n.Class&^PHEAP], s) + } else { + fmt.Fprintf(&buf, " class(%d?%s)", n.Class&^PHEAP, s) + } + } + + if n.Colas { + fmt.Fprintf(&buf, " colas(%v)", n.Colas) + } + + if n.Name != nil && n.Name.Funcdepth != 0 { + fmt.Fprintf(&buf, " f(%d)", n.Name.Funcdepth) + } + if n.Func != nil && n.Func.Depth != 0 { + fmt.Fprintf(&buf, " ff(%d)", n.Func.Depth) + } + + switch n.Esc { + case EscUnknown: + break + + case EscHeap: + buf.WriteString(" esc(h)") + + case EscScope: + buf.WriteString(" esc(s)") + + case EscNone: + buf.WriteString(" esc(no)") + + case EscNever: + if c == 0 { + buf.WriteString(" esc(N)") + } + + default: + fmt.Fprintf(&buf, " esc(%d)", n.Esc) + } + + if e, ok := n.Opt().(*NodeEscState); ok && e.Escloopdepth != 0 { + fmt.Fprintf(&buf, " ld(%d)", e.Escloopdepth) + } + + if c == 0 && n.Typecheck != 0 { + fmt.Fprintf(&buf, " tc(%d)", n.Typecheck) + } + + if c == 0 && n.Dodata != 0 { + fmt.Fprintf(&buf, " dd(%d)", n.Dodata) + } + + if n.Isddd { + fmt.Fprintf(&buf, " isddd(%v)", n.Isddd) + } + + if n.Implicit { + fmt.Fprintf(&buf, " implicit(%v)", n.Implicit) + } + + if n.Embedded != 0 { + fmt.Fprintf(&buf, " embedded(%d)", n.Embedded) + } + + if n.Addrtaken { + buf.WriteString(" addrtaken") + } + + if n.Assigned { + buf.WriteString(" assigned") + } + + if c == 0 && n.Used { + fmt.Fprintf(&buf, " used(%v)", n.Used) + } + return buf.String() +} + +// Fmt "%V": Values +func Vconv(v Val, flag int) string { + switch v.Ctype() { + case CTINT: + if (flag&obj.FmtSharp != 0) || fmtmode == FExp { + return Bconv(v.U.(*Mpint), obj.FmtSharp) + } + return Bconv(v.U.(*Mpint), 0) + + case CTRUNE: + x := Mpgetfix(v.U.(*Mpint)) + if ' ' <= x && x < 0x80 && x != '\\' && x != '\'' { + return fmt.Sprintf("'%c'", int(x)) + } + if 0 <= x && x < 1<<16 { + return fmt.Sprintf("'\\u%04x'", uint(int(x))) + } + if 0 <= x && x <= utf8.MaxRune { + return fmt.Sprintf("'\\U%08x'", uint64(x)) + } + return fmt.Sprintf("('\\x00' + %v)", v.U.(*Mpint)) + + case CTFLT: + if (flag&obj.FmtSharp != 0) || fmtmode == FExp { + return Fconv(v.U.(*Mpflt), 0) + } + return Fconv(v.U.(*Mpflt), obj.FmtSharp) + + case CTCPLX: + if (flag&obj.FmtSharp != 0) || fmtmode == FExp { + return fmt.Sprintf("(%v+%vi)", &v.U.(*Mpcplx).Real, &v.U.(*Mpcplx).Imag) + } + if mpcmpfltc(&v.U.(*Mpcplx).Real, 0) == 0 { + return fmt.Sprintf("%vi", Fconv(&v.U.(*Mpcplx).Imag, obj.FmtSharp)) + } + if mpcmpfltc(&v.U.(*Mpcplx).Imag, 0) == 0 { + return Fconv(&v.U.(*Mpcplx).Real, obj.FmtSharp) + } + if mpcmpfltc(&v.U.(*Mpcplx).Imag, 0) < 0 { + return fmt.Sprintf("(%v%vi)", Fconv(&v.U.(*Mpcplx).Real, obj.FmtSharp), Fconv(&v.U.(*Mpcplx).Imag, obj.FmtSharp)) + } + return fmt.Sprintf("(%v+%vi)", Fconv(&v.U.(*Mpcplx).Real, obj.FmtSharp), Fconv(&v.U.(*Mpcplx).Imag, obj.FmtSharp)) + + case CTSTR: + return strconv.Quote(v.U.(string)) + + case CTBOOL: + if v.U.(bool) { + return "true" + } + return "false" + + case CTNIL: + return "nil" + } + + return fmt.Sprintf("", v.Ctype) +} + +/* +s%,%,\n%g +s%\n+%\n%g +s%^[ ]*T%%g +s%,.*%%g +s%.+% [T&] = "&",%g +s%^ ........*\]%&~%g +s%~ %%g +*/ +var etnames = []string{ + TINT: "INT", + TUINT: "UINT", + TINT8: "INT8", + TUINT8: "UINT8", + TINT16: "INT16", + TUINT16: "UINT16", + TINT32: "INT32", + TUINT32: "UINT32", + TINT64: "INT64", + TUINT64: "UINT64", + TUINTPTR: "UINTPTR", + TFLOAT32: "FLOAT32", + TFLOAT64: "FLOAT64", + TCOMPLEX64: "COMPLEX64", + TCOMPLEX128: "COMPLEX128", + TBOOL: "BOOL", + TPTR32: "PTR32", + TPTR64: "PTR64", + TFUNC: "FUNC", + TARRAY: "ARRAY", + TSTRUCT: "STRUCT", + TCHAN: "CHAN", + TMAP: "MAP", + TINTER: "INTER", + TFORW: "FORW", + TFIELD: "FIELD", + TSTRING: "STRING", + TANY: "ANY", +} + +// Fmt "%E": etype +func Econv(et int, flag int) string { + if et >= 0 && et < len(etnames) && etnames[et] != "" { + return etnames[et] + } + return fmt.Sprintf("E-%d", et) +} + +// Fmt "%S": syms +func symfmt(s *Sym, flag int) string { + if s.Pkg != nil && flag&obj.FmtShort == 0 { + switch fmtmode { + case FErr: // This is for the user + if s.Pkg == localpkg { + return s.Name + } + + // If the name was used by multiple packages, display the full path, + if s.Pkg.Name != "" && numImport[s.Pkg.Name] > 1 { + return fmt.Sprintf("%q.%s", s.Pkg.Path, s.Name) + } + return fmt.Sprintf("%s.%s", s.Pkg.Name, s.Name) + + case FDbg: + return fmt.Sprintf("%s.%s", s.Pkg.Name, s.Name) + + case FTypeId: + if flag&obj.FmtUnsigned != 0 { + return fmt.Sprintf("%s.%s", s.Pkg.Name, s.Name) // dcommontype, typehash + } + return fmt.Sprintf("%s.%s", s.Pkg.Prefix, s.Name) // (methodsym), typesym, weaksym + + case FExp: + if s.Name != "" && s.Name[0] == '.' { + Fatal("exporting synthetic symbol %s", s.Name) + } + if s.Pkg != builtinpkg { + return fmt.Sprintf("@%q.%s", s.Pkg.Path, s.Name) + } + } + } + + if flag&obj.FmtByte != 0 { + // FmtByte (hh) implies FmtShort (h) + // skip leading "type." in method name + p := s.Name + if i := strings.LastIndex(s.Name, "."); i >= 0 { + p = s.Name[i+1:] + } + + // exportname needs to see the name without the prefix too. + if (fmtmode == FExp && !exportname(p)) || fmtmode == FDbg { + return fmt.Sprintf("@%q.%s", s.Pkg.Path, p) + } + + return p + } + + return s.Name +} + +var basicnames = []string{ + TINT: "int", + TUINT: "uint", + TINT8: "int8", + TUINT8: "uint8", + TINT16: "int16", + TUINT16: "uint16", + TINT32: "int32", + TUINT32: "uint32", + TINT64: "int64", + TUINT64: "uint64", + TUINTPTR: "uintptr", + TFLOAT32: "float32", + TFLOAT64: "float64", + TCOMPLEX64: "complex64", + TCOMPLEX128: "complex128", + TBOOL: "bool", + TANY: "any", + TSTRING: "string", + TNIL: "nil", + TIDEAL: "untyped number", + TBLANK: "blank", +} + +func typefmt(t *Type, flag int) string { + if t == nil { + return "" + } + + if t == bytetype || t == runetype { + // in %-T mode collapse rune and byte with their originals. + if fmtmode != FTypeId { + return Sconv(t.Sym, obj.FmtShort) + } + t = Types[t.Etype] + } + + if t == errortype { + return "error" + } + + // Unless the 'l' flag was specified, if the type has a name, just print that name. + if flag&obj.FmtLong == 0 && t.Sym != nil && t.Etype != TFIELD && t != Types[t.Etype] { + switch fmtmode { + case FTypeId: + if flag&obj.FmtShort != 0 { + if t.Vargen != 0 { + return fmt.Sprintf("%v·%d", Sconv(t.Sym, obj.FmtShort), t.Vargen) + } + return Sconv(t.Sym, obj.FmtShort) + } + + if flag&obj.FmtUnsigned != 0 { + return Sconv(t.Sym, obj.FmtUnsigned) + } + fallthrough + + case FExp: + if t.Sym.Pkg == localpkg && t.Vargen != 0 { + return fmt.Sprintf("%v·%d", t.Sym, t.Vargen) + } + } + + return Sconv(t.Sym, 0) + } + + if int(t.Etype) < len(basicnames) && basicnames[t.Etype] != "" { + prefix := "" + if fmtmode == FErr && (t == idealbool || t == idealstring) { + prefix = "untyped " + } + return prefix + basicnames[t.Etype] + } + + if fmtmode == FDbg { + fmtmode = 0 + str := Econv(int(t.Etype), 0) + "-" + typefmt(t, flag) + fmtmode = FDbg + return str + } + + switch t.Etype { + case TPTR32, TPTR64: + if fmtmode == FTypeId && (flag&obj.FmtShort != 0) { + return fmt.Sprintf("*%v", Tconv(t.Type, obj.FmtShort)) + } + return fmt.Sprintf("*%v", t.Type) + + case TARRAY: + if t.Bound >= 0 { + return fmt.Sprintf("[%d]%v", t.Bound, t.Type) + } + if t.Bound == -100 { + return fmt.Sprintf("[...]%v", t.Type) + } + return fmt.Sprintf("[]%v", t.Type) + + case TCHAN: + switch t.Chan { + case Crecv: + return fmt.Sprintf("<-chan %v", t.Type) + + case Csend: + return fmt.Sprintf("chan<- %v", t.Type) + } + + if t.Type != nil && t.Type.Etype == TCHAN && t.Type.Sym == nil && t.Type.Chan == Crecv { + return fmt.Sprintf("chan (%v)", t.Type) + } + return fmt.Sprintf("chan %v", t.Type) + + case TMAP: + return fmt.Sprintf("map[%v]%v", t.Down, t.Type) + + case TINTER: + var buf bytes.Buffer + buf.WriteString("interface {") + for t1 := t.Type; t1 != nil; t1 = t1.Down { + buf.WriteString(" ") + if exportname(t1.Sym.Name) { + buf.WriteString(Sconv(t1.Sym, obj.FmtShort)) + } else { + buf.WriteString(Sconv(t1.Sym, obj.FmtUnsigned)) + } + buf.WriteString(Tconv(t1.Type, obj.FmtShort)) + if t1.Down != nil { + buf.WriteString(";") + } + } + if t.Type != nil { + buf.WriteString(" ") + } + buf.WriteString("}") + return buf.String() + + case TFUNC: + var buf bytes.Buffer + if flag&obj.FmtShort != 0 { + // no leading func + } else { + if t.Thistuple != 0 { + buf.WriteString("method") + buf.WriteString(Tconv(getthisx(t), 0)) + buf.WriteString(" ") + } + buf.WriteString("func") + } + buf.WriteString(Tconv(getinargx(t), 0)) + + switch t.Outtuple { + case 0: + break + + case 1: + if fmtmode != FExp { + buf.WriteString(" ") + buf.WriteString(Tconv(getoutargx(t).Type.Type, 0)) // struct->field->field's type + break + } + fallthrough + + default: + buf.WriteString(" ") + buf.WriteString(Tconv(getoutargx(t), 0)) + } + return buf.String() + + case TSTRUCT: + if t.Map != nil { + // Format the bucket struct for map[x]y as map.bucket[x]y. + // This avoids a recursive print that generates very long names. + if t.Map.Bucket == t { + return fmt.Sprintf("map.bucket[%v]%v", t.Map.Down, t.Map.Type) + } + + if t.Map.Hmap == t { + return fmt.Sprintf("map.hdr[%v]%v", t.Map.Down, t.Map.Type) + } + + if t.Map.Hiter == t { + return fmt.Sprintf("map.iter[%v]%v", t.Map.Down, t.Map.Type) + } + + Yyerror("unknown internal map type") + } + + var buf bytes.Buffer + if t.Funarg != 0 { + buf.WriteString("(") + if fmtmode == FTypeId || fmtmode == FErr { // no argument names on function signature, and no "noescape"/"nosplit" tags + for t1 := t.Type; t1 != nil; t1 = t1.Down { + buf.WriteString(Tconv(t1, obj.FmtShort)) + if t1.Down != nil { + buf.WriteString(", ") + } + } + } else { + for t1 := t.Type; t1 != nil; t1 = t1.Down { + buf.WriteString(Tconv(t1, 0)) + if t1.Down != nil { + buf.WriteString(", ") + } + } + } + buf.WriteString(")") + } else { + buf.WriteString("struct {") + for t1 := t.Type; t1 != nil; t1 = t1.Down { + buf.WriteString(" ") + buf.WriteString(Tconv(t1, obj.FmtLong)) + if t1.Down != nil { + buf.WriteString(";") + } + } + if t.Type != nil { + buf.WriteString(" ") + } + buf.WriteString("}") + } + return buf.String() + + case TFIELD: + var name string + if flag&obj.FmtShort == 0 { + s := t.Sym + + // Take the name from the original, lest we substituted it with ~r%d or ~b%d. + // ~r%d is a (formerly) unnamed result. + if (fmtmode == FErr || fmtmode == FExp) && t.Nname != nil { + if t.Nname.Orig != nil { + s = t.Nname.Orig.Sym + if s != nil && s.Name[0] == '~' { + if s.Name[1] == 'r' { // originally an unnamed result + s = nil + } else if s.Name[1] == 'b' { // originally the blank identifier _ + s = Lookup("_") + } + } + } else { + s = nil + } + } + + if s != nil && t.Embedded == 0 { + if t.Funarg != 0 { + name = Nconv(t.Nname, 0) + } else if flag&obj.FmtLong != 0 { + name = Sconv(s, obj.FmtShort|obj.FmtByte) // qualify non-exported names (used on structs, not on funarg) + } else { + name = Sconv(s, 0) + } + } else if fmtmode == FExp { + // TODO(rsc) this breaks on the eliding of unused arguments in the backend + // when this is fixed, the special case in dcl.c checkarglist can go. + //if(t->funarg) + // fmtstrcpy(fp, "_ "); + //else + if t.Embedded != 0 && s.Pkg != nil && len(s.Pkg.Path) > 0 { + name = fmt.Sprintf("@%q.?", s.Pkg.Path) + } else { + name = "?" + } + } + } + + var typ string + if t.Isddd { + typ = "..." + Tconv(t.Type.Type, 0) + } else { + typ = Tconv(t.Type, 0) + } + + str := typ + if name != "" { + str = name + " " + typ + } + if flag&obj.FmtShort == 0 && t.Note != nil { + str += " " + strconv.Quote(*t.Note) + } + return str + + case TFORW: + if t.Sym != nil { + return fmt.Sprintf("undefined %v", t.Sym) + } + return "undefined" + + case TUNSAFEPTR: + if fmtmode == FExp { + return "@\"unsafe\".Pointer" + } + return "unsafe.Pointer" + } + + if fmtmode == FExp { + Fatal("missing %v case during export", Econv(int(t.Etype), 0)) + } + + // Don't know how to handle - fall back to detailed prints. + return fmt.Sprintf("%v <%v> %v", Econv(int(t.Etype), 0), t.Sym, t.Type) +} + +// Statements which may be rendered with a simplestmt as init. +func stmtwithinit(op int) bool { + switch op { + case OIF, OFOR, OSWITCH: + return true + } + + return false +} + +func stmtfmt(n *Node) string { + var f string + + // some statements allow for an init, but at most one, + // but we may have an arbitrary number added, eg by typecheck + // and inlining. If it doesn't fit the syntax, emit an enclosing + // block starting with the init statements. + + // if we can just say "for" n->ninit; ... then do so + simpleinit := n.Ninit != nil && n.Ninit.Next == nil && n.Ninit.N.Ninit == nil && stmtwithinit(int(n.Op)) + + // otherwise, print the inits as separate statements + complexinit := n.Ninit != nil && !simpleinit && (fmtmode != FErr) + + // but if it was for if/for/switch, put in an extra surrounding block to limit the scope + extrablock := complexinit && stmtwithinit(int(n.Op)) + + if extrablock { + f += "{" + } + + if complexinit { + f += fmt.Sprintf(" %v; ", n.Ninit) + } + + switch n.Op { + case ODCL: + if fmtmode == FExp { + switch n.Left.Class &^ PHEAP { + case PPARAM, PPARAMOUT, PAUTO: + f += fmt.Sprintf("var %v %v", n.Left, n.Left.Type) + goto ret + } + } + + f += fmt.Sprintf("var %v %v", n.Left.Sym, n.Left.Type) + + case ODCLFIELD: + if n.Left != nil { + f += fmt.Sprintf("%v %v", n.Left, n.Right) + } else { + f += Nconv(n.Right, 0) + } + + // Don't export "v = " initializing statements, hope they're always + // preceded by the DCL which will be re-parsed and typecheck to reproduce + // the "v = " again. + case OAS, OASWB: + if fmtmode == FExp && n.Right == nil { + break + } + + if n.Colas && !complexinit { + f += fmt.Sprintf("%v := %v", n.Left, n.Right) + } else { + f += fmt.Sprintf("%v = %v", n.Left, n.Right) + } + + case OASOP: + if n.Implicit { + if n.Etype == OADD { + f += fmt.Sprintf("%v++", n.Left) + } else { + f += fmt.Sprintf("%v--", n.Left) + } + break + } + + f += fmt.Sprintf("%v %v= %v", n.Left, Oconv(int(n.Etype), obj.FmtSharp), n.Right) + + case OAS2: + if n.Colas && !complexinit { + f += fmt.Sprintf("%v := %v", Hconv(n.List, obj.FmtComma), Hconv(n.Rlist, obj.FmtComma)) + break + } + fallthrough + + case OAS2DOTTYPE, OAS2FUNC, OAS2MAPR, OAS2RECV: + f += fmt.Sprintf("%v = %v", Hconv(n.List, obj.FmtComma), Hconv(n.Rlist, obj.FmtComma)) + + case ORETURN: + f += fmt.Sprintf("return %v", Hconv(n.List, obj.FmtComma)) + + case ORETJMP: + f += fmt.Sprintf("retjmp %v", n.Sym) + + case OPROC: + f += fmt.Sprintf("go %v", n.Left) + + case ODEFER: + f += fmt.Sprintf("defer %v", n.Left) + + case OIF: + if simpleinit { + f += fmt.Sprintf("if %v; %v { %v }", n.Ninit.N, n.Left, n.Nbody) + } else { + f += fmt.Sprintf("if %v { %v }", n.Left, n.Nbody) + } + if n.Rlist != nil { + f += fmt.Sprintf(" else { %v }", n.Rlist) + } + + case OFOR: + if fmtmode == FErr { // TODO maybe only if FmtShort, same below + f += "for loop" + break + } + + f += "for" + if simpleinit { + f += fmt.Sprintf(" %v;", n.Ninit.N) + } else if n.Right != nil { + f += " ;" + } + + if n.Left != nil { + f += fmt.Sprintf(" %v", n.Left) + } + + if n.Right != nil { + f += fmt.Sprintf("; %v", n.Right) + } else if simpleinit { + f += ";" + } + + f += fmt.Sprintf(" { %v }", n.Nbody) + + case ORANGE: + if fmtmode == FErr { + f += "for loop" + break + } + + if n.List == nil { + f += fmt.Sprintf("for range %v { %v }", n.Right, n.Nbody) + break + } + + f += fmt.Sprintf("for %v = range %v { %v }", Hconv(n.List, obj.FmtComma), n.Right, n.Nbody) + + case OSELECT, OSWITCH: + if fmtmode == FErr { + f += fmt.Sprintf("%v statement", Oconv(int(n.Op), 0)) + break + } + + f += Oconv(int(n.Op), obj.FmtSharp) + if simpleinit { + f += fmt.Sprintf(" %v;", n.Ninit.N) + } + if n.Left != nil { + f += Nconv(n.Left, 0) + } + + f += fmt.Sprintf(" { %v }", n.List) + + case OCASE, OXCASE: + if n.List != nil { + f += fmt.Sprintf("case %v: %v", Hconv(n.List, obj.FmtComma), n.Nbody) + } else { + f += fmt.Sprintf("default: %v", n.Nbody) + } + + case OBREAK, + OCONTINUE, + OGOTO, + OFALL, + OXFALL: + if n.Left != nil { + f += fmt.Sprintf("%v %v", Oconv(int(n.Op), obj.FmtSharp), n.Left) + } else { + f += Oconv(int(n.Op), obj.FmtSharp) + } + + case OEMPTY: + break + + case OLABEL: + f += fmt.Sprintf("%v: ", n.Left) + } + +ret: + if extrablock { + f += "}" + } + + return f +} + +var opprec = []int{ + OAPPEND: 8, + OARRAYBYTESTR: 8, + OARRAYLIT: 8, + OARRAYRUNESTR: 8, + OCALLFUNC: 8, + OCALLINTER: 8, + OCALLMETH: 8, + OCALL: 8, + OCAP: 8, + OCLOSE: 8, + OCONVIFACE: 8, + OCONVNOP: 8, + OCONV: 8, + OCOPY: 8, + ODELETE: 8, + OGETG: 8, + OLEN: 8, + OLITERAL: 8, + OMAKESLICE: 8, + OMAKE: 8, + OMAPLIT: 8, + ONAME: 8, + ONEW: 8, + ONONAME: 8, + OPACK: 8, + OPANIC: 8, + OPAREN: 8, + OPRINTN: 8, + OPRINT: 8, + ORUNESTR: 8, + OSTRARRAYBYTE: 8, + OSTRARRAYRUNE: 8, + OSTRUCTLIT: 8, + OTARRAY: 8, + OTCHAN: 8, + OTFUNC: 8, + OTINTER: 8, + OTMAP: 8, + OTSTRUCT: 8, + OINDEXMAP: 8, + OINDEX: 8, + OSLICE: 8, + OSLICESTR: 8, + OSLICEARR: 8, + OSLICE3: 8, + OSLICE3ARR: 8, + ODOTINTER: 8, + ODOTMETH: 8, + ODOTPTR: 8, + ODOTTYPE2: 8, + ODOTTYPE: 8, + ODOT: 8, + OXDOT: 8, + OCALLPART: 8, + OPLUS: 7, + ONOT: 7, + OCOM: 7, + OMINUS: 7, + OADDR: 7, + OIND: 7, + ORECV: 7, + OMUL: 6, + ODIV: 6, + OMOD: 6, + OLSH: 6, + ORSH: 6, + OAND: 6, + OANDNOT: 6, + OADD: 5, + OSUB: 5, + OOR: 5, + OXOR: 5, + OEQ: 4, + OLT: 4, + OLE: 4, + OGE: 4, + OGT: 4, + ONE: 4, + OCMPSTR: 4, + OCMPIFACE: 4, + OSEND: 3, + OANDAND: 2, + OOROR: 1, + // Statements handled by stmtfmt + OAS: -1, + OAS2: -1, + OAS2DOTTYPE: -1, + OAS2FUNC: -1, + OAS2MAPR: -1, + OAS2RECV: -1, + OASOP: -1, + OBREAK: -1, + OCASE: -1, + OCONTINUE: -1, + ODCL: -1, + ODCLFIELD: -1, + ODEFER: -1, + OEMPTY: -1, + OFALL: -1, + OFOR: -1, + OGOTO: -1, + OIF: -1, + OLABEL: -1, + OPROC: -1, + ORANGE: -1, + ORETURN: -1, + OSELECT: -1, + OSWITCH: -1, + OXCASE: -1, + OXFALL: -1, + OEND: 0, +} + +func exprfmt(n *Node, prec int) string { + for n != nil && n.Implicit && (n.Op == OIND || n.Op == OADDR) { + n = n.Left + } + + if n == nil { + return "" + } + + nprec := opprec[n.Op] + if n.Op == OTYPE && n.Sym != nil { + nprec = 8 + } + + if prec > nprec { + return fmt.Sprintf("(%v)", n) + } + + switch n.Op { + case OPAREN: + return fmt.Sprintf("(%v)", n.Left) + + case ODDDARG: + return "... argument" + + case OREGISTER: + return obj.Rconv(int(n.Reg)) + + case OLITERAL: // this is a bit of a mess + if fmtmode == FErr { + if n.Orig != nil && n.Orig != n { + return exprfmt(n.Orig, prec) + } + if n.Sym != nil { + return Sconv(n.Sym, 0) + } + } + if n.Val().Ctype() == CTNIL && n.Orig != nil && n.Orig != n { + return exprfmt(n.Orig, prec) + } + if n.Type != nil && n.Type != Types[n.Type.Etype] && n.Type != idealbool && n.Type != idealstring { + // Need parens when type begins with what might + // be misinterpreted as a unary operator: * or <-. + if Isptr[n.Type.Etype] || (n.Type.Etype == TCHAN && n.Type.Chan == Crecv) { + return fmt.Sprintf("(%v)(%v)", n.Type, Vconv(n.Val(), 0)) + } else { + return fmt.Sprintf("%v(%v)", n.Type, Vconv(n.Val(), 0)) + } + } + + return Vconv(n.Val(), 0) + + // Special case: name used as local variable in export. + // _ becomes ~b%d internally; print as _ for export + case ONAME: + if (fmtmode == FExp || fmtmode == FErr) && n.Sym != nil && n.Sym.Name[0] == '~' && n.Sym.Name[1] == 'b' { + return "_" + } + if fmtmode == FExp && n.Sym != nil && !isblank(n) && n.Name.Vargen > 0 { + return fmt.Sprintf("%v·%d", n.Sym, n.Name.Vargen) + } + + // Special case: explicit name of func (*T) method(...) is turned into pkg.(*T).method, + // but for export, this should be rendered as (*pkg.T).meth. + // These nodes have the special property that they are names with a left OTYPE and a right ONAME. + if fmtmode == FExp && n.Left != nil && n.Left.Op == OTYPE && n.Right != nil && n.Right.Op == ONAME { + if Isptr[n.Left.Type.Etype] { + return fmt.Sprintf("(%v).%v", n.Left.Type, Sconv(n.Right.Sym, obj.FmtShort|obj.FmtByte)) + } else { + return fmt.Sprintf("%v.%v", n.Left.Type, Sconv(n.Right.Sym, obj.FmtShort|obj.FmtByte)) + } + } + fallthrough + + //fallthrough + case OPACK, ONONAME: + return Sconv(n.Sym, 0) + + case OTYPE: + if n.Type == nil && n.Sym != nil { + return Sconv(n.Sym, 0) + } + return Tconv(n.Type, 0) + + case OTARRAY: + if n.Left != nil { + return fmt.Sprintf("[]%v", n.Left) + } + var f string + f += fmt.Sprintf("[]%v", n.Right) + return f // happens before typecheck + + case OTMAP: + return fmt.Sprintf("map[%v]%v", n.Left, n.Right) + + case OTCHAN: + switch n.Etype { + case Crecv: + return fmt.Sprintf("<-chan %v", n.Left) + + case Csend: + return fmt.Sprintf("chan<- %v", n.Left) + + default: + if n.Left != nil && n.Left.Op == OTCHAN && n.Left.Sym == nil && n.Left.Etype == Crecv { + return fmt.Sprintf("chan (%v)", n.Left) + } else { + return fmt.Sprintf("chan %v", n.Left) + } + } + + case OTSTRUCT: + return "" + + case OTINTER: + return "" + + case OTFUNC: + return "" + + case OCLOSURE: + if fmtmode == FErr { + return "func literal" + } + if n.Nbody != nil { + return fmt.Sprintf("%v { %v }", n.Type, n.Nbody) + } + return fmt.Sprintf("%v { %v }", n.Type, n.Name.Param.Closure.Nbody) + + case OCOMPLIT: + ptrlit := n.Right != nil && n.Right.Implicit && n.Right.Type != nil && Isptr[n.Right.Type.Etype] + if fmtmode == FErr { + if n.Right != nil && n.Right.Type != nil && !n.Implicit { + if ptrlit { + return fmt.Sprintf("&%v literal", n.Right.Type.Type) + } else { + return fmt.Sprintf("%v literal", n.Right.Type) + } + } + + return "composite literal" + } + + if fmtmode == FExp && ptrlit { + // typecheck has overwritten OIND by OTYPE with pointer type. + return fmt.Sprintf("(&%v{ %v })", n.Right.Type.Type, Hconv(n.List, obj.FmtComma)) + } + + return fmt.Sprintf("(%v{ %v })", n.Right, Hconv(n.List, obj.FmtComma)) + + case OPTRLIT: + if fmtmode == FExp && n.Left.Implicit { + return Nconv(n.Left, 0) + } + return fmt.Sprintf("&%v", n.Left) + + case OSTRUCTLIT: + if fmtmode == FExp { // requires special handling of field names + var f string + if n.Implicit { + f += "{" + } else { + f += fmt.Sprintf("(%v{", n.Type) + } + for l := n.List; l != nil; l = l.Next { + f += fmt.Sprintf(" %v:%v", Sconv(l.N.Left.Sym, obj.FmtShort|obj.FmtByte), l.N.Right) + + if l.Next != nil { + f += "," + } else { + f += " " + } + } + + if !n.Implicit { + f += "})" + return f + } + f += "}" + return f + } + fallthrough + + case OARRAYLIT, OMAPLIT: + if fmtmode == FErr { + return fmt.Sprintf("%v literal", n.Type) + } + if fmtmode == FExp && n.Implicit { + return fmt.Sprintf("{ %v }", Hconv(n.List, obj.FmtComma)) + } + return fmt.Sprintf("(%v{ %v })", n.Type, Hconv(n.List, obj.FmtComma)) + + case OKEY: + if n.Left != nil && n.Right != nil { + if fmtmode == FExp && n.Left.Type != nil && n.Left.Type.Etype == TFIELD { + // requires special handling of field names + return fmt.Sprintf("%v:%v", Sconv(n.Left.Sym, obj.FmtShort|obj.FmtByte), n.Right) + } else { + return fmt.Sprintf("%v:%v", n.Left, n.Right) + } + } + + if n.Left == nil && n.Right != nil { + return fmt.Sprintf(":%v", n.Right) + } + if n.Left != nil && n.Right == nil { + return fmt.Sprintf("%v:", n.Left) + } + return ":" + + case OXDOT, + ODOT, + ODOTPTR, + ODOTINTER, + ODOTMETH, + OCALLPART: + var f string + f += exprfmt(n.Left, nprec) + if n.Right == nil || n.Right.Sym == nil { + f += "." + return f + } + f += fmt.Sprintf(".%v", Sconv(n.Right.Sym, obj.FmtShort|obj.FmtByte)) + return f + + case ODOTTYPE, ODOTTYPE2: + var f string + f += exprfmt(n.Left, nprec) + if n.Right != nil { + f += fmt.Sprintf(".(%v)", n.Right) + return f + } + f += fmt.Sprintf(".(%v)", n.Type) + return f + + case OINDEX, + OINDEXMAP, + OSLICE, + OSLICESTR, + OSLICEARR, + OSLICE3, + OSLICE3ARR: + var f string + f += exprfmt(n.Left, nprec) + f += fmt.Sprintf("[%v]", n.Right) + return f + + case OCOPY, OCOMPLEX: + return fmt.Sprintf("%v(%v, %v)", Oconv(int(n.Op), obj.FmtSharp), n.Left, n.Right) + + case OCONV, + OCONVIFACE, + OCONVNOP, + OARRAYBYTESTR, + OARRAYRUNESTR, + OSTRARRAYBYTE, + OSTRARRAYRUNE, + ORUNESTR: + if n.Type == nil || n.Type.Sym == nil { + return fmt.Sprintf("(%v)(%v)", n.Type, n.Left) + } + if n.Left != nil { + return fmt.Sprintf("%v(%v)", n.Type, n.Left) + } + return fmt.Sprintf("%v(%v)", n.Type, Hconv(n.List, obj.FmtComma)) + + case OREAL, + OIMAG, + OAPPEND, + OCAP, + OCLOSE, + ODELETE, + OLEN, + OMAKE, + ONEW, + OPANIC, + ORECOVER, + OPRINT, + OPRINTN: + if n.Left != nil { + return fmt.Sprintf("%v(%v)", Oconv(int(n.Op), obj.FmtSharp), n.Left) + } + if n.Isddd { + return fmt.Sprintf("%v(%v...)", Oconv(int(n.Op), obj.FmtSharp), Hconv(n.List, obj.FmtComma)) + } + return fmt.Sprintf("%v(%v)", Oconv(int(n.Op), obj.FmtSharp), Hconv(n.List, obj.FmtComma)) + + case OCALL, OCALLFUNC, OCALLINTER, OCALLMETH, OGETG: + var f string + f += exprfmt(n.Left, nprec) + if n.Isddd { + f += fmt.Sprintf("(%v...)", Hconv(n.List, obj.FmtComma)) + return f + } + f += fmt.Sprintf("(%v)", Hconv(n.List, obj.FmtComma)) + return f + + case OMAKEMAP, OMAKECHAN, OMAKESLICE: + if n.List != nil { // pre-typecheck + return fmt.Sprintf("make(%v, %v)", n.Type, Hconv(n.List, obj.FmtComma)) + } + if n.Right != nil { + return fmt.Sprintf("make(%v, %v, %v)", n.Type, n.Left, n.Right) + } + if n.Left != nil && (n.Op == OMAKESLICE || !isideal(n.Left.Type)) { + return fmt.Sprintf("make(%v, %v)", n.Type, n.Left) + } + return fmt.Sprintf("make(%v)", n.Type) + + // Unary + case OPLUS, + OMINUS, + OADDR, + OCOM, + OIND, + ONOT, + ORECV: + var f string + if n.Left.Op == n.Op { + f += fmt.Sprintf("%v ", Oconv(int(n.Op), obj.FmtSharp)) + } else { + f += Oconv(int(n.Op), obj.FmtSharp) + } + f += exprfmt(n.Left, nprec+1) + return f + + // Binary + case OADD, + OAND, + OANDAND, + OANDNOT, + ODIV, + OEQ, + OGE, + OGT, + OLE, + OLT, + OLSH, + OMOD, + OMUL, + ONE, + OOR, + OOROR, + ORSH, + OSEND, + OSUB, + OXOR: + var f string + f += exprfmt(n.Left, nprec) + + f += fmt.Sprintf(" %v ", Oconv(int(n.Op), obj.FmtSharp)) + f += exprfmt(n.Right, nprec+1) + return f + + case OADDSTR: + var f string + for l := n.List; l != nil; l = l.Next { + if l != n.List { + f += " + " + } + f += exprfmt(l.N, nprec) + } + + return f + + case OCMPSTR, OCMPIFACE: + var f string + f += exprfmt(n.Left, nprec) + f += fmt.Sprintf(" %v ", Oconv(int(n.Etype), obj.FmtSharp)) + f += exprfmt(n.Right, nprec+1) + return f + } + + return fmt.Sprintf("", Oconv(int(n.Op), 0)) +} + +func nodefmt(n *Node, flag int) string { + t := n.Type + + // we almost always want the original, except in export mode for literals + // this saves the importer some work, and avoids us having to redo some + // special casing for package unsafe + if (fmtmode != FExp || n.Op != OLITERAL) && n.Orig != nil { + n = n.Orig + } + + if flag&obj.FmtLong != 0 && t != nil { + if t.Etype == TNIL { + return "nil" + } else { + return fmt.Sprintf("%v (type %v)", n, t) + } + } + + // TODO inlining produces expressions with ninits. we can't print these yet. + + if opprec[n.Op] < 0 { + return stmtfmt(n) + } + + return exprfmt(n, 0) +} + +var dumpdepth int + +func indent(buf *bytes.Buffer) { + buf.WriteString("\n") + for i := 0; i < dumpdepth; i++ { + buf.WriteString(". ") + } +} + +func nodedump(n *Node, flag int) string { + if n == nil { + return "" + } + + recur := flag&obj.FmtShort == 0 + + var buf bytes.Buffer + if recur { + indent(&buf) + if dumpdepth > 10 { + buf.WriteString("...") + return buf.String() + } + + if n.Ninit != nil { + fmt.Fprintf(&buf, "%v-init%v", Oconv(int(n.Op), 0), n.Ninit) + indent(&buf) + } + } + + switch n.Op { + default: + fmt.Fprintf(&buf, "%v%v", Oconv(int(n.Op), 0), Jconv(n, 0)) + + case OREGISTER, OINDREG: + fmt.Fprintf(&buf, "%v-%v%v", Oconv(int(n.Op), 0), obj.Rconv(int(n.Reg)), Jconv(n, 0)) + + case OLITERAL: + fmt.Fprintf(&buf, "%v-%v%v", Oconv(int(n.Op), 0), Vconv(n.Val(), 0), Jconv(n, 0)) + + case ONAME, ONONAME: + if n.Sym != nil { + fmt.Fprintf(&buf, "%v-%v%v", Oconv(int(n.Op), 0), n.Sym, Jconv(n, 0)) + } else { + fmt.Fprintf(&buf, "%v%v", Oconv(int(n.Op), 0), Jconv(n, 0)) + } + if recur && n.Type == nil && n.Name.Param.Ntype != nil { + indent(&buf) + fmt.Fprintf(&buf, "%v-ntype%v", Oconv(int(n.Op), 0), n.Name.Param.Ntype) + } + + case OASOP: + fmt.Fprintf(&buf, "%v-%v%v", Oconv(int(n.Op), 0), Oconv(int(n.Etype), 0), Jconv(n, 0)) + + case OTYPE: + fmt.Fprintf(&buf, "%v %v%v type=%v", Oconv(int(n.Op), 0), n.Sym, Jconv(n, 0), n.Type) + if recur && n.Type == nil && n.Name.Param.Ntype != nil { + indent(&buf) + fmt.Fprintf(&buf, "%v-ntype%v", Oconv(int(n.Op), 0), n.Name.Param.Ntype) + } + } + + if n.Sym != nil && n.Op != ONAME { + fmt.Fprintf(&buf, " %v", n.Sym) + } + + if n.Type != nil { + fmt.Fprintf(&buf, " %v", n.Type) + } + + if recur { + if n.Left != nil { + buf.WriteString(Nconv(n.Left, 0)) + } + if n.Right != nil { + buf.WriteString(Nconv(n.Right, 0)) + } + if n.List != nil { + indent(&buf) + fmt.Fprintf(&buf, "%v-list%v", Oconv(int(n.Op), 0), n.List) + } + + if n.Rlist != nil { + indent(&buf) + fmt.Fprintf(&buf, "%v-rlist%v", Oconv(int(n.Op), 0), n.Rlist) + } + + if n.Nbody != nil { + indent(&buf) + fmt.Fprintf(&buf, "%v-body%v", Oconv(int(n.Op), 0), n.Nbody) + } + } + + return buf.String() +} + +func (s *Sym) String() string { + return Sconv(s, 0) +} + +// Fmt "%S": syms +// Flags: "%hS" suppresses qualifying with package +func Sconv(s *Sym, flag int) string { + if flag&obj.FmtLong != 0 { + panic("linksymfmt") + } + + if s == nil { + return "" + } + + if s.Name == "_" { + return "_" + } + + sf := flag + sm := setfmode(&flag) + var r int + _ = r + str := symfmt(s, flag) + flag = sf + fmtmode = sm + return str +} + +func (t *Type) String() string { + return Tconv(t, 0) +} + +// Fmt "%T": types. +// Flags: 'l' print definition, not name +// 'h' omit 'func' and receiver from function types, short type names +// 'u' package name, not prefix (FTypeId mode, sticky) +func Tconv(t *Type, flag int) string { + if t == nil { + return "" + } + + if t.Trecur > 4 { + return "<...>" + } + + t.Trecur++ + sf := flag + sm := setfmode(&flag) + + if fmtmode == FTypeId && (sf&obj.FmtUnsigned != 0) { + fmtpkgpfx++ + } + if fmtpkgpfx != 0 { + flag |= obj.FmtUnsigned + } + + var r int + _ = r + str := typefmt(t, flag) + + if fmtmode == FTypeId && (sf&obj.FmtUnsigned != 0) { + fmtpkgpfx-- + } + + flag = sf + fmtmode = sm + t.Trecur-- + return str +} + +func (n *Node) String() string { + return Nconv(n, 0) +} + +// Fmt '%N': Nodes. +// Flags: 'l' suffix with "(type %T)" where possible +// '+h' in debug mode, don't recurse, no multiline output +func Nconv(n *Node, flag int) string { + if n == nil { + return "" + } + sf := flag + sm := setfmode(&flag) + + var r int + _ = r + var str string + switch fmtmode { + case FErr, FExp: + str = nodefmt(n, flag) + + case FDbg: + dumpdepth++ + str = nodedump(n, flag) + dumpdepth-- + + default: + Fatal("unhandled %%N mode") + } + + flag = sf + fmtmode = sm + return str +} + +func (l *NodeList) String() string { + return Hconv(l, 0) +} + +// Fmt '%H': NodeList. +// Flags: all those of %N plus ',': separate with comma's instead of semicolons. +func Hconv(l *NodeList, flag int) string { + if l == nil && fmtmode == FDbg { + return "" + } + + sf := flag + sm := setfmode(&flag) + var r int + _ = r + sep := "; " + if fmtmode == FDbg { + sep = "\n" + } else if flag&obj.FmtComma != 0 { + sep = ", " + } + + var buf bytes.Buffer + for ; l != nil; l = l.Next { + buf.WriteString(Nconv(l.N, 0)) + if l.Next != nil { + buf.WriteString(sep) + } + } + + flag = sf + fmtmode = sm + return buf.String() +} + +func dumplist(s string, l *NodeList) { + fmt.Printf("%s%v\n", s, Hconv(l, obj.FmtSign)) +} + +func Dump(s string, n *Node) { + fmt.Printf("%s [%p]%v\n", s, n, Nconv(n, obj.FmtSign)) +} diff --git a/src/cmd/compile/internal/gc/gen.go b/src/cmd/compile/internal/gc/gen.go new file mode 100644 index 0000000000000000000000000000000000000000..764895f15db5f12acc5e5b9c351ff24685f02378 --- /dev/null +++ b/src/cmd/compile/internal/gc/gen.go @@ -0,0 +1,1276 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package gc + +import ( + "cmd/internal/obj" + "fmt" +) + +/* + * portable half of code generator. + * mainly statements and control flow. + */ +var labellist *Label + +var lastlabel *Label + +func Sysfunc(name string) *Node { + n := newname(Pkglookup(name, Runtimepkg)) + n.Class = PFUNC + return n +} + +// addrescapes tags node n as having had its address taken +// by "increasing" the "value" of n.Esc to EscHeap. +// Storage is allocated as necessary to allow the address +// to be taken. +func addrescapes(n *Node) { + switch n.Op { + // probably a type error already. + // dump("addrescapes", n); + default: + break + + case ONAME: + if n == nodfp { + break + } + + // if this is a tmpname (PAUTO), it was tagged by tmpname as not escaping. + // on PPARAM it means something different. + if n.Class == PAUTO && n.Esc == EscNever { + break + } + + switch n.Class { + case PPARAMREF: + addrescapes(n.Name.Defn) + + // if func param, need separate temporary + // to hold heap pointer. + // the function type has already been checked + // (we're in the function body) + // so the param already has a valid xoffset. + + // expression to refer to stack copy + case PPARAM, PPARAMOUT: + n.Name.Param.Stackparam = Nod(OPARAM, n, nil) + + n.Name.Param.Stackparam.Type = n.Type + n.Name.Param.Stackparam.Addable = true + if n.Xoffset == BADWIDTH { + Fatal("addrescapes before param assignment") + } + n.Name.Param.Stackparam.Xoffset = n.Xoffset + fallthrough + + case PAUTO: + n.Class |= PHEAP + + n.Addable = false + n.Ullman = 2 + n.Xoffset = 0 + + // create stack variable to hold pointer to heap + oldfn := Curfn + + Curfn = n.Name.Curfn + n.Name.Heapaddr = temp(Ptrto(n.Type)) + buf := fmt.Sprintf("&%v", n.Sym) + n.Name.Heapaddr.Sym = Lookup(buf) + n.Name.Heapaddr.Orig.Sym = n.Name.Heapaddr.Sym + n.Esc = EscHeap + if Debug['m'] != 0 { + fmt.Printf("%v: moved to heap: %v\n", n.Line(), n) + } + Curfn = oldfn + } + + case OIND, ODOTPTR: + break + + // ODOTPTR has already been introduced, + // so these are the non-pointer ODOT and OINDEX. + // In &x[0], if x is a slice, then x does not + // escape--the pointer inside x does, but that + // is always a heap pointer anyway. + case ODOT, OINDEX, OPAREN, OCONVNOP: + if !Isslice(n.Left.Type) { + addrescapes(n.Left) + } + } +} + +func clearlabels() { + for l := labellist; l != nil; l = l.Link { + l.Sym.Label = nil + } + + labellist = nil + lastlabel = nil +} + +func newlab(n *Node) *Label { + s := n.Left.Sym + lab := s.Label + if lab == nil { + lab = new(Label) + if lastlabel == nil { + labellist = lab + } else { + lastlabel.Link = lab + } + lastlabel = lab + lab.Sym = s + s.Label = lab + } + + if n.Op == OLABEL { + if lab.Def != nil { + Yyerror("label %v already defined at %v", s, lab.Def.Line()) + } else { + lab.Def = n + } + } else { + lab.Use = list(lab.Use, n) + } + + return lab +} + +func checkgoto(from *Node, to *Node) { + if from.Sym == to.Sym { + return + } + + nf := 0 + for fs := from.Sym; fs != nil; fs = fs.Link { + nf++ + } + nt := 0 + for fs := to.Sym; fs != nil; fs = fs.Link { + nt++ + } + fs := from.Sym + for ; nf > nt; nf-- { + fs = fs.Link + } + if fs != to.Sym { + lno := int(lineno) + setlineno(from) + + // decide what to complain about. + // prefer to complain about 'into block' over declarations, + // so scan backward to find most recent block or else dcl. + var block *Sym + + var dcl *Sym + ts := to.Sym + for ; nt > nf; nt-- { + if ts.Pkg == nil { + block = ts + } else { + dcl = ts + } + ts = ts.Link + } + + for ts != fs { + if ts.Pkg == nil { + block = ts + } else { + dcl = ts + } + ts = ts.Link + fs = fs.Link + } + + if block != nil { + Yyerror("goto %v jumps into block starting at %v", from.Left.Sym, Ctxt.Line(int(block.Lastlineno))) + } else { + Yyerror("goto %v jumps over declaration of %v at %v", from.Left.Sym, dcl, Ctxt.Line(int(dcl.Lastlineno))) + } + lineno = int32(lno) + } +} + +func stmtlabel(n *Node) *Label { + if n.Sym != nil { + lab := n.Sym.Label + if lab != nil { + if lab.Def != nil { + if lab.Def.Name.Defn == n { + return lab + } + } + } + } + return nil +} + +/* + * compile statements + */ +func Genlist(l *NodeList) { + for ; l != nil; l = l.Next { + gen(l.N) + } +} + +/* + * generate code to start new proc running call n. + */ +func cgen_proc(n *Node, proc int) { + switch n.Left.Op { + default: + Fatal("cgen_proc: unknown call %v", Oconv(int(n.Left.Op), 0)) + + case OCALLMETH: + cgen_callmeth(n.Left, proc) + + case OCALLINTER: + cgen_callinter(n.Left, nil, proc) + + case OCALLFUNC: + cgen_call(n.Left, proc) + } +} + +/* + * generate declaration. + * have to allocate heap copy + * for escaped variables. + */ +func cgen_dcl(n *Node) { + if Debug['g'] != 0 { + Dump("\ncgen-dcl", n) + } + if n.Op != ONAME { + Dump("cgen_dcl", n) + Fatal("cgen_dcl") + } + + if n.Class&PHEAP == 0 { + return + } + if compiling_runtime != 0 { + Yyerror("%v escapes to heap, not allowed in runtime.", n) + } + if prealloc[n] == nil { + prealloc[n] = callnew(n.Type) + } + Cgen_as(n.Name.Heapaddr, prealloc[n]) +} + +/* + * generate discard of value + */ +func cgen_discard(nr *Node) { + if nr == nil { + return + } + + switch nr.Op { + case ONAME: + if nr.Class&PHEAP == 0 && nr.Class != PEXTERN && nr.Class != PFUNC && nr.Class != PPARAMREF { + gused(nr) + } + + // unary + case OADD, + OAND, + ODIV, + OEQ, + OGE, + OGT, + OLE, + OLSH, + OLT, + OMOD, + OMUL, + ONE, + OOR, + ORSH, + OSUB, + OXOR: + cgen_discard(nr.Left) + + cgen_discard(nr.Right) + + // binary + case OCAP, + OCOM, + OLEN, + OMINUS, + ONOT, + OPLUS: + cgen_discard(nr.Left) + + case OIND: + Cgen_checknil(nr.Left) + + // special enough to just evaluate + default: + var tmp Node + Tempname(&tmp, nr.Type) + + Cgen_as(&tmp, nr) + gused(&tmp) + } +} + +/* + * clearslim generates code to zero a slim node. + */ +func Clearslim(n *Node) { + var z Node + z.Op = OLITERAL + z.Type = n.Type + z.Addable = true + + switch Simtype[n.Type.Etype] { + case TCOMPLEX64, TCOMPLEX128: + z.SetVal(Val{new(Mpcplx)}) + Mpmovecflt(&z.Val().U.(*Mpcplx).Real, 0.0) + Mpmovecflt(&z.Val().U.(*Mpcplx).Imag, 0.0) + + case TFLOAT32, TFLOAT64: + var zero Mpflt + Mpmovecflt(&zero, 0.0) + z.SetVal(Val{&zero}) + + case TPTR32, TPTR64, TCHAN, TMAP: + z.SetVal(Val{new(NilVal)}) + + case TBOOL: + z.SetVal(Val{false}) + + case TINT8, + TINT16, + TINT32, + TINT64, + TUINT8, + TUINT16, + TUINT32, + TUINT64: + z.SetVal(Val{new(Mpint)}) + Mpmovecfix(z.Val().U.(*Mpint), 0) + + default: + Fatal("clearslim called on type %v", n.Type) + } + + ullmancalc(&z) + Cgen(&z, n) +} + +/* + * generate: + * res = iface{typ, data} + * n->left is typ + * n->right is data + */ +func Cgen_eface(n *Node, res *Node) { + /* + * the right node of an eface may contain function calls that uses res as an argument, + * so it's important that it is done first + */ + + tmp := temp(Types[Tptr]) + Cgen(n.Right, tmp) + + Gvardef(res) + + dst := *res + dst.Type = Types[Tptr] + dst.Xoffset += int64(Widthptr) + Cgen(tmp, &dst) + + dst.Xoffset -= int64(Widthptr) + Cgen(n.Left, &dst) +} + +/* + * generate one of: + * res, resok = x.(T) + * res = x.(T) (when resok == nil) + * n.Left is x + * n.Type is T + */ +func cgen_dottype(n *Node, res, resok *Node, wb bool) { + if Debug_typeassert > 0 { + Warn("type assertion inlined") + } + // iface := n.Left + // r1 := iword(iface) + // if n.Left is non-empty interface { + // r1 = *r1 + // } + // if r1 == T { + // res = idata(iface) + // resok = true + // } else { + // assert[EI]2T(x, T, nil) // (when resok == nil; does not return) + // resok = false // (when resok != nil) + // } + // + var iface Node + Igen(n.Left, &iface, res) + var r1, r2 Node + byteptr := Ptrto(Types[TUINT8]) // type used in runtime prototypes for runtime type (*byte) + Regalloc(&r1, byteptr, nil) + iface.Type = byteptr + Cgen(&iface, &r1) + if !isnilinter(n.Left.Type) { + // Holding itab, want concrete type in second word. + p := Thearch.Ginscmp(OEQ, byteptr, &r1, Nodintconst(0), -1) + r2 = r1 + r2.Op = OINDREG + r2.Xoffset = int64(Widthptr) + Cgen(&r2, &r1) + Patch(p, Pc) + } + Regalloc(&r2, byteptr, nil) + Cgen(typename(n.Type), &r2) + p := Thearch.Ginscmp(ONE, byteptr, &r1, &r2, -1) + Regfree(&r2) // not needed for success path; reclaimed on one failure path + iface.Xoffset += int64(Widthptr) + Cgen(&iface, &r1) + Regfree(&iface) + + if resok == nil { + r1.Type = res.Type + cgen_wb(&r1, res, wb) + q := Gbranch(obj.AJMP, nil, 0) + Patch(p, Pc) + Regrealloc(&r2) // reclaim from above, for this failure path + fn := syslook("panicdottype", 0) + dowidth(fn.Type) + call := Nod(OCALLFUNC, fn, nil) + r1.Type = byteptr + r2.Type = byteptr + call.List = list(list(list1(&r1), &r2), typename(n.Left.Type)) + call.List = ascompatte(OCALLFUNC, call, false, getinarg(fn.Type), call.List, 0, nil) + gen(call) + Regfree(&r1) + Regfree(&r2) + Thearch.Gins(obj.AUNDEF, nil, nil) + Patch(q, Pc) + } else { + // This half is handling the res, resok = x.(T) case, + // which is called from gen, not cgen, and is consequently fussier + // about blank assignments. We have to avoid calling cgen for those. + r1.Type = res.Type + if !isblank(res) { + cgen_wb(&r1, res, wb) + } + Regfree(&r1) + if !isblank(resok) { + Cgen(Nodbool(true), resok) + } + q := Gbranch(obj.AJMP, nil, 0) + Patch(p, Pc) + if !isblank(res) { + n := nodnil() + n.Type = res.Type + Cgen(n, res) + } + if !isblank(resok) { + Cgen(Nodbool(false), resok) + } + Patch(q, Pc) + } +} + +/* + * generate: + * res, resok = x.(T) + * n.Left is x + * n.Type is T + */ +func Cgen_As2dottype(n, res, resok *Node) { + if Debug_typeassert > 0 { + Warn("type assertion inlined") + } + // iface := n.Left + // r1 := iword(iface) + // if n.Left is non-empty interface { + // r1 = *r1 + // } + // if r1 == T { + // res = idata(iface) + // resok = true + // } else { + // res = nil + // resok = false + // } + // + var iface Node + Igen(n.Left, &iface, nil) + var r1, r2 Node + byteptr := Ptrto(Types[TUINT8]) // type used in runtime prototypes for runtime type (*byte) + Regalloc(&r1, byteptr, res) + iface.Type = byteptr + Cgen(&iface, &r1) + if !isnilinter(n.Left.Type) { + // Holding itab, want concrete type in second word. + p := Thearch.Ginscmp(OEQ, byteptr, &r1, Nodintconst(0), -1) + r2 = r1 + r2.Op = OINDREG + r2.Xoffset = int64(Widthptr) + Cgen(&r2, &r1) + Patch(p, Pc) + } + Regalloc(&r2, byteptr, nil) + Cgen(typename(n.Type), &r2) + p := Thearch.Ginscmp(ONE, byteptr, &r1, &r2, -1) + iface.Type = n.Type + iface.Xoffset += int64(Widthptr) + Cgen(&iface, &r1) + if iface.Op != 0 { + Regfree(&iface) + } + Cgen(&r1, res) + q := Gbranch(obj.AJMP, nil, 0) + Patch(p, Pc) + + fn := syslook("panicdottype", 0) + dowidth(fn.Type) + call := Nod(OCALLFUNC, fn, nil) + call.List = list(list(list1(&r1), &r2), typename(n.Left.Type)) + call.List = ascompatte(OCALLFUNC, call, false, getinarg(fn.Type), call.List, 0, nil) + gen(call) + Regfree(&r1) + Regfree(&r2) + Thearch.Gins(obj.AUNDEF, nil, nil) + Patch(q, Pc) +} + +/* + * gather series of offsets + * >=0 is direct addressed field + * <0 is pointer to next field (+1) + */ +func Dotoffset(n *Node, oary []int64, nn **Node) int { + var i int + + switch n.Op { + case ODOT: + if n.Xoffset == BADWIDTH { + Dump("bad width in dotoffset", n) + Fatal("bad width in dotoffset") + } + + i = Dotoffset(n.Left, oary, nn) + if i > 0 { + if oary[i-1] >= 0 { + oary[i-1] += n.Xoffset + } else { + oary[i-1] -= n.Xoffset + } + break + } + + if i < 10 { + oary[i] = n.Xoffset + i++ + } + + case ODOTPTR: + if n.Xoffset == BADWIDTH { + Dump("bad width in dotoffset", n) + Fatal("bad width in dotoffset") + } + + i = Dotoffset(n.Left, oary, nn) + if i < 10 { + oary[i] = -(n.Xoffset + 1) + i++ + } + + default: + *nn = n + return 0 + } + + if i >= 10 { + *nn = nil + } + return i +} + +/* + * make a new off the books + */ +func Tempname(nn *Node, t *Type) { + if Curfn == nil { + Fatal("no curfn for tempname") + } + + if t == nil { + Yyerror("tempname called with nil type") + t = Types[TINT32] + } + + // give each tmp a different name so that there + // a chance to registerizer them + s := Lookupf("autotmp_%.4d", statuniqgen) + statuniqgen++ + n := Nod(ONAME, nil, nil) + n.Sym = s + s.Def = n + n.Type = t + n.Class = PAUTO + n.Addable = true + n.Ullman = 1 + n.Esc = EscNever + n.Name.Curfn = Curfn + Curfn.Func.Dcl = list(Curfn.Func.Dcl, n) + + dowidth(t) + n.Xoffset = 0 + *nn = *n +} + +func temp(t *Type) *Node { + n := Nod(OXXX, nil, nil) + Tempname(n, t) + n.Sym.Def.Used = true + return n.Orig +} + +func gen(n *Node) { + //dump("gen", n); + + lno := setlineno(n) + + wasregalloc := Anyregalloc() + + if n == nil { + goto ret + } + + if n.Ninit != nil { + Genlist(n.Ninit) + } + + setlineno(n) + + switch n.Op { + default: + Fatal("gen: unknown op %v", Nconv(n, obj.FmtShort|obj.FmtSign)) + + case OCASE, + OFALL, + OXCASE, + OXFALL, + ODCLCONST, + ODCLFUNC, + ODCLTYPE: + break + + case OEMPTY: + break + + case OBLOCK: + Genlist(n.List) + + case OLABEL: + if isblanksym(n.Left.Sym) { + break + } + + lab := newlab(n) + + // if there are pending gotos, resolve them all to the current pc. + var p2 *obj.Prog + for p1 := lab.Gotopc; p1 != nil; p1 = p2 { + p2 = unpatch(p1) + Patch(p1, Pc) + } + + lab.Gotopc = nil + if lab.Labelpc == nil { + lab.Labelpc = Pc + } + + if n.Name.Defn != nil { + switch n.Name.Defn.Op { + // so stmtlabel can find the label + case OFOR, OSWITCH, OSELECT: + n.Name.Defn.Sym = lab.Sym + } + } + + // if label is defined, emit jump to it. + // otherwise save list of pending gotos in lab->gotopc. + // the list is linked through the normal jump target field + // to avoid a second list. (the jumps are actually still + // valid code, since they're just going to another goto + // to the same label. we'll unwind it when we learn the pc + // of the label in the OLABEL case above.) + case OGOTO: + lab := newlab(n) + + if lab.Labelpc != nil { + gjmp(lab.Labelpc) + } else { + lab.Gotopc = gjmp(lab.Gotopc) + } + + case OBREAK: + if n.Left != nil { + lab := n.Left.Sym.Label + if lab == nil { + Yyerror("break label not defined: %v", n.Left.Sym) + break + } + + lab.Used = 1 + if lab.Breakpc == nil { + Yyerror("invalid break label %v", n.Left.Sym) + break + } + + gjmp(lab.Breakpc) + break + } + + if breakpc == nil { + Yyerror("break is not in a loop") + break + } + + gjmp(breakpc) + + case OCONTINUE: + if n.Left != nil { + lab := n.Left.Sym.Label + if lab == nil { + Yyerror("continue label not defined: %v", n.Left.Sym) + break + } + + lab.Used = 1 + if lab.Continpc == nil { + Yyerror("invalid continue label %v", n.Left.Sym) + break + } + + gjmp(lab.Continpc) + break + } + + if continpc == nil { + Yyerror("continue is not in a loop") + break + } + + gjmp(continpc) + + case OFOR: + sbreak := breakpc + p1 := gjmp(nil) // goto test + breakpc = gjmp(nil) // break: goto done + scontin := continpc + continpc = Pc + + // define break and continue labels + lab := stmtlabel(n) + if lab != nil { + lab.Breakpc = breakpc + lab.Continpc = continpc + } + + gen(n.Right) // contin: incr + Patch(p1, Pc) // test: + Bgen(n.Left, false, -1, breakpc) // if(!test) goto break + Genlist(n.Nbody) // body + gjmp(continpc) + Patch(breakpc, Pc) // done: + continpc = scontin + breakpc = sbreak + if lab != nil { + lab.Breakpc = nil + lab.Continpc = nil + } + + case OIF: + p1 := gjmp(nil) // goto test + p2 := gjmp(nil) // p2: goto else + Patch(p1, Pc) // test: + Bgen(n.Left, false, int(-n.Likely), p2) // if(!test) goto p2 + Genlist(n.Nbody) // then + p3 := gjmp(nil) // goto done + Patch(p2, Pc) // else: + Genlist(n.Rlist) // else + Patch(p3, Pc) // done: + + case OSWITCH: + sbreak := breakpc + p1 := gjmp(nil) // goto test + breakpc = gjmp(nil) // break: goto done + + // define break label + lab := stmtlabel(n) + if lab != nil { + lab.Breakpc = breakpc + } + + Patch(p1, Pc) // test: + Genlist(n.Nbody) // switch(test) body + Patch(breakpc, Pc) // done: + breakpc = sbreak + if lab != nil { + lab.Breakpc = nil + } + + case OSELECT: + sbreak := breakpc + p1 := gjmp(nil) // goto test + breakpc = gjmp(nil) // break: goto done + + // define break label + lab := stmtlabel(n) + if lab != nil { + lab.Breakpc = breakpc + } + + Patch(p1, Pc) // test: + Genlist(n.Nbody) // select() body + Patch(breakpc, Pc) // done: + breakpc = sbreak + if lab != nil { + lab.Breakpc = nil + } + + case ODCL: + cgen_dcl(n.Left) + + case OAS: + if gen_as_init(n) { + break + } + Cgen_as(n.Left, n.Right) + + case OASWB: + Cgen_as_wb(n.Left, n.Right, true) + + case OAS2DOTTYPE: + cgen_dottype(n.Rlist.N, n.List.N, n.List.Next.N, false) + + case OCALLMETH: + cgen_callmeth(n, 0) + + case OCALLINTER: + cgen_callinter(n, nil, 0) + + case OCALLFUNC: + cgen_call(n, 0) + + case OPROC: + cgen_proc(n, 1) + + case ODEFER: + cgen_proc(n, 2) + + case ORETURN, ORETJMP: + cgen_ret(n) + + // Function calls turned into compiler intrinsics. + // At top level, can just ignore the call and make sure to preserve side effects in the argument, if any. + case OGETG: + // nothing + case OSQRT: + cgen_discard(n.Left) + + case OCHECKNIL: + Cgen_checknil(n.Left) + + case OVARKILL: + gvarkill(n.Left) + } + +ret: + if Anyregalloc() != wasregalloc { + Dump("node", n) + Fatal("registers left allocated") + } + + lineno = lno +} + +func Cgen_as(nl, nr *Node) { + Cgen_as_wb(nl, nr, false) +} + +func Cgen_as_wb(nl, nr *Node, wb bool) { + if Debug['g'] != 0 { + op := "cgen_as" + if wb { + op = "cgen_as_wb" + } + Dump(op, nl) + Dump(op+" = ", nr) + } + + for nr != nil && nr.Op == OCONVNOP { + nr = nr.Left + } + + if nl == nil || isblank(nl) { + cgen_discard(nr) + return + } + + if nr == nil || iszero(nr) { + // heaps should already be clear + if nr == nil && (nl.Class&PHEAP != 0) { + return + } + + tl := nl.Type + if tl == nil { + return + } + if Isfat(tl) { + if nl.Op == ONAME { + Gvardef(nl) + } + Thearch.Clearfat(nl) + return + } + + Clearslim(nl) + return + } + + tl := nl.Type + if tl == nil { + return + } + + cgen_wb(nr, nl, wb) +} + +func cgen_callmeth(n *Node, proc int) { + // generate a rewrite in n2 for the method call + // (p.f)(...) goes to (f)(p,...) + + l := n.Left + + if l.Op != ODOTMETH { + Fatal("cgen_callmeth: not dotmethod: %v", l) + } + + n2 := *n + n2.Op = OCALLFUNC + n2.Left = l.Right + n2.Left.Type = l.Type + + if n2.Left.Op == ONAME { + n2.Left.Class = PFUNC + } + cgen_call(&n2, proc) +} + +// CgenTemp creates a temporary node, assigns n to it, and returns it. +func CgenTemp(n *Node) *Node { + var tmp Node + Tempname(&tmp, n.Type) + Cgen(n, &tmp) + return &tmp +} + +func checklabels() { + var l *NodeList + + for lab := labellist; lab != nil; lab = lab.Link { + if lab.Def == nil { + for l = lab.Use; l != nil; l = l.Next { + yyerrorl(int(l.N.Lineno), "label %v not defined", lab.Sym) + } + continue + } + + if lab.Use == nil && lab.Used == 0 { + yyerrorl(int(lab.Def.Lineno), "label %v defined and not used", lab.Sym) + continue + } + + if lab.Gotopc != nil { + Fatal("label %v never resolved", lab.Sym) + } + for l = lab.Use; l != nil; l = l.Next { + checkgoto(l.N, lab.Def) + } + } +} + +// Componentgen copies a composite value by moving its individual components. +// Slices, strings and interfaces are supported. Small structs or arrays with +// elements of basic type are also supported. +// nr is nil when assigning a zero value. +func Componentgen(nr, nl *Node) bool { + return componentgen_wb(nr, nl, false) +} + +// componentgen_wb is like componentgen but if wb==true emits write barriers for pointer updates. +func componentgen_wb(nr, nl *Node, wb bool) bool { + // Don't generate any code for complete copy of a variable into itself. + // It's useless, and the VARDEF will incorrectly mark the old value as dead. + // (This check assumes that the arguments passed to componentgen did not + // themselves come from Igen, or else we could have Op==ONAME but + // with a Type and Xoffset describing an individual field, not the entire + // variable.) + if nl.Op == ONAME && nl == nr { + return true + } + + // Count number of moves required to move components. + // If using write barrier, can only emit one pointer. + // TODO(rsc): Allow more pointers, for reflect.Value. + const maxMoves = 8 + n := 0 + numPtr := 0 + visitComponents(nl.Type, 0, func(t *Type, offset int64) bool { + n++ + if int(Simtype[t.Etype]) == Tptr && t != itable { + numPtr++ + } + return n <= maxMoves && (!wb || numPtr <= 1) + }) + if n > maxMoves || wb && numPtr > 1 { + return false + } + + // Must call emitVardef after evaluating rhs but before writing to lhs. + emitVardef := func() { + // Emit vardef if needed. + if nl.Op == ONAME { + switch nl.Type.Etype { + case TARRAY, TSTRING, TINTER, TSTRUCT: + Gvardef(nl) + } + } + } + + isConstString := Isconst(nr, CTSTR) + + if !cadable(nl) && nr != nil && !cadable(nr) && !isConstString { + return false + } + + var nodl Node + if cadable(nl) { + nodl = *nl + } else { + if nr != nil && !cadable(nr) && !isConstString { + return false + } + if nr == nil || isConstString || nl.Ullman >= nr.Ullman { + Igen(nl, &nodl, nil) + defer Regfree(&nodl) + } + } + lbase := nodl.Xoffset + + // Special case: zeroing. + var nodr Node + if nr == nil { + // When zeroing, prepare a register containing zero. + // TODO(rsc): Check that this is actually generating the best code. + if Thearch.REGZERO != 0 { + // cpu has a dedicated zero register + Nodreg(&nodr, Types[TUINT], Thearch.REGZERO) + } else { + // no dedicated zero register + var zero Node + Nodconst(&zero, nl.Type, 0) + Regalloc(&nodr, Types[TUINT], nil) + Thearch.Gmove(&zero, &nodr) + defer Regfree(&nodr) + } + + emitVardef() + visitComponents(nl.Type, 0, func(t *Type, offset int64) bool { + nodl.Type = t + nodl.Xoffset = lbase + offset + nodr.Type = t + if Isfloat[t.Etype] { + // TODO(rsc): Cache zero register like we do for integers? + Clearslim(&nodl) + } else { + Thearch.Gmove(&nodr, &nodl) + } + return true + }) + return true + } + + // Special case: assignment of string constant. + if isConstString { + emitVardef() + + // base + nodl.Type = Ptrto(Types[TUINT8]) + Regalloc(&nodr, Types[Tptr], nil) + p := Thearch.Gins(Thearch.Optoas(OAS, Types[Tptr]), nil, &nodr) + Datastring(nr.Val().U.(string), &p.From) + p.From.Type = obj.TYPE_ADDR + Thearch.Gmove(&nodr, &nodl) + Regfree(&nodr) + + // length + nodl.Type = Types[Simtype[TUINT]] + nodl.Xoffset += int64(Array_nel) - int64(Array_array) + Nodconst(&nodr, nodl.Type, int64(len(nr.Val().U.(string)))) + Thearch.Gmove(&nodr, &nodl) + return true + } + + // General case: copy nl = nr. + nodr = *nr + if !cadable(nr) { + if nr.Ullman >= UINF && nodl.Op == OINDREG { + Fatal("miscompile") + } + Igen(nr, &nodr, nil) + defer Regfree(&nodr) + } + rbase := nodr.Xoffset + + if nodl.Op == 0 { + Igen(nl, &nodl, nil) + defer Regfree(&nodl) + lbase = nodl.Xoffset + } + + emitVardef() + var ( + ptrType *Type + ptrOffset int64 + ) + visitComponents(nl.Type, 0, func(t *Type, offset int64) bool { + if wb && int(Simtype[t.Etype]) == Tptr && t != itable { + if ptrType != nil { + Fatal("componentgen_wb %v", Tconv(nl.Type, 0)) + } + ptrType = t + ptrOffset = offset + return true + } + nodl.Type = t + nodl.Xoffset = lbase + offset + nodr.Type = t + nodr.Xoffset = rbase + offset + Thearch.Gmove(&nodr, &nodl) + return true + }) + if ptrType != nil { + nodl.Type = ptrType + nodl.Xoffset = lbase + ptrOffset + nodr.Type = ptrType + nodr.Xoffset = rbase + ptrOffset + cgen_wbptr(&nodr, &nodl) + } + return true +} + +// visitComponents walks the individual components of the type t, +// walking into array elements, struct fields, the real and imaginary +// parts of complex numbers, and on 32-bit systems the high and +// low halves of 64-bit integers. +// It calls f for each such component, passing the component (aka element) +// type and memory offset, assuming t starts at startOffset. +// If f ever returns false, visitComponents returns false without any more +// calls to f. Otherwise visitComponents returns true. +func visitComponents(t *Type, startOffset int64, f func(elem *Type, elemOffset int64) bool) bool { + switch t.Etype { + case TINT64: + if Widthreg == 8 { + break + } + // NOTE: Assuming little endian (signed top half at offset 4). + // We don't have any 32-bit big-endian systems. + if Thearch.Thechar != '5' && Thearch.Thechar != '8' { + Fatal("unknown 32-bit architecture") + } + return f(Types[TUINT32], startOffset) && + f(Types[TINT32], startOffset+4) + + case TUINT64: + if Widthreg == 8 { + break + } + return f(Types[TUINT32], startOffset) && + f(Types[TUINT32], startOffset+4) + + case TCOMPLEX64: + return f(Types[TFLOAT32], startOffset) && + f(Types[TFLOAT32], startOffset+4) + + case TCOMPLEX128: + return f(Types[TFLOAT64], startOffset) && + f(Types[TFLOAT64], startOffset+8) + + case TINTER: + return f(itable, startOffset) && + f(Ptrto(Types[TUINT8]), startOffset+int64(Widthptr)) + return true + + case TSTRING: + return f(Ptrto(Types[TUINT8]), startOffset) && + f(Types[Simtype[TUINT]], startOffset+int64(Widthptr)) + + case TARRAY: + if Isslice(t) { + return f(Ptrto(t.Type), startOffset+int64(Array_array)) && + f(Types[Simtype[TUINT]], startOffset+int64(Array_nel)) && + f(Types[Simtype[TUINT]], startOffset+int64(Array_cap)) + } + + // Short-circuit [1e6]struct{}. + if t.Type.Width == 0 { + return true + } + + for i := int64(0); i < t.Bound; i++ { + if !visitComponents(t.Type, startOffset+i*t.Type.Width, f) { + return false + } + } + return true + + case TSTRUCT: + if t.Type != nil && t.Type.Width != 0 { + // NOTE(rsc): If this happens, the right thing to do is to say + // startOffset -= t.Type.Width + // but I want to see if it does. + // The old version of componentgen handled this, + // in code introduced in CL 6932045 to fix issue #4518. + // But the test case in issue 4518 does not trigger this anymore, + // so maybe this complication is no longer needed. + Fatal("struct not at offset 0") + } + + for field := t.Type; field != nil; field = field.Down { + if field.Etype != TFIELD { + Fatal("bad struct") + } + if !visitComponents(field.Type, startOffset+field.Width, f) { + return false + } + } + return true + } + return f(t, startOffset) +} + +func cadable(n *Node) bool { + // Note: Not sure why you can have n.Op == ONAME without n.Addable, but you can. + return n.Addable && n.Op == ONAME +} diff --git a/src/cmd/compile/internal/gc/go.go b/src/cmd/compile/internal/gc/go.go new file mode 100644 index 0000000000000000000000000000000000000000..67d27bbc02082f15a4e668af889e4c80942e8e87 --- /dev/null +++ b/src/cmd/compile/internal/gc/go.go @@ -0,0 +1,870 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package gc + +import ( + "bytes" + "cmd/compile/internal/big" + "cmd/internal/obj" +) + +// avoid + +// The parser's maximum stack size. +// We have to use a #define macro here since yacc +// or bison will check for its definition and use +// a potentially smaller value if it is undefined. +const ( + NHUNK = 50000 + BUFSIZ = 8192 + NSYMB = 500 + NHASH = 1024 + MAXALIGN = 7 + UINF = 100 + PRIME1 = 3 + BADWIDTH = -1000000000 + MaxStackVarSize = 10 * 1024 * 1024 +) + +const ( + // These values are known by runtime. + // The MEMx and NOEQx values must run in parallel. See algtype. + AMEM = iota + AMEM0 + AMEM8 + AMEM16 + AMEM32 + AMEM64 + AMEM128 + ANOEQ + ANOEQ0 + ANOEQ8 + ANOEQ16 + ANOEQ32 + ANOEQ64 + ANOEQ128 + ASTRING + AINTER + ANILINTER + ASLICE + AFLOAT32 + AFLOAT64 + ACPLX64 + ACPLX128 + AUNK = 100 +) + +const ( + // Maximum size in bits for Mpints before signalling + // overflow and also mantissa precision for Mpflts. + Mpprec = 512 + // Turn on for constant arithmetic debugging output. + Mpdebug = false +) + +// Mpint represents an integer constant. +type Mpint struct { + Val big.Int + Ovf bool // set if Val overflowed compiler limit (sticky) + Rune bool // set if syntax indicates default type rune +} + +// Mpflt represents a floating-point constant. +type Mpflt struct { + Val big.Float +} + +// Mpcplx represents a complex constant. +type Mpcplx struct { + Real Mpflt + Imag Mpflt +} + +type Val struct { + // U contains one of: + // bool bool when n.ValCtype() == CTBOOL + // *Mpint int when n.ValCtype() == CTINT, rune when n.ValCtype() == CTRUNE + // *Mpflt float when n.ValCtype() == CTFLT + // *Mpcplx pair of floats when n.ValCtype() == CTCPLX + // string string when n.ValCtype() == CTSTR + // *Nilval when n.ValCtype() == CTNIL + U interface{} +} + +type NilVal struct{} + +func (v Val) Ctype() int { + switch x := v.U.(type) { + default: + Fatal("unexpected Ctype for %T", v.U) + panic("not reached") + case nil: + return 0 + case *NilVal: + return CTNIL + case bool: + return CTBOOL + case *Mpint: + if x.Rune { + return CTRUNE + } + return CTINT + case *Mpflt: + return CTFLT + case *Mpcplx: + return CTCPLX + case string: + return CTSTR + } +} + +type Pkg struct { + Name string // package name + Path string // string literal used in import statement + Pathsym *Sym + Prefix string // escaped path for use in symbol table + Imported uint8 // export data of this package was parsed + Exported int8 // import line written in export data + Direct int8 // imported directly + Safe bool // whether the package is marked as safe + Syms map[string]*Sym +} + +type Sym struct { + Lexical uint16 + Flags uint8 + Link *Sym + Uniqgen uint32 + Importdef *Pkg // where imported definition was found + Linkname string // link name + + // saved and restored by dcopy + Pkg *Pkg + Name string // variable name + Def *Node // definition: ONAME OTYPE OPACK or OLITERAL + Label *Label // corresponding label (ephemeral) + Block int32 // blocknumber to catch redeclaration + Lastlineno int32 // last declaration for diagnostic + Origpkg *Pkg // original package for . import + Lsym *obj.LSym + Fsym *Sym // funcsym +} + +type Type struct { + Etype uint8 + Nointerface bool + Noalg uint8 + Chan uint8 + Trecur uint8 // to detect loops + Printed uint8 + Embedded uint8 // TFIELD embedded type + Siggen uint8 + Funarg uint8 // on TSTRUCT and TFIELD + Copyany uint8 + Local bool // created in this file + Deferwidth uint8 + Broke uint8 // broken type definition. + Isddd bool // TFIELD is ... argument + Align uint8 + Haspointers uint8 // 0 unknown, 1 no, 2 yes + + Nod *Node // canonical OTYPE node + Orig *Type // original type (type literal or predefined type) + Lineno int + + // TFUNC + Thistuple int + Outtuple int + Intuple int + Outnamed uint8 + + Method *Type + Xmethod *Type + + Sym *Sym + Vargen int32 // unique name for OTYPE/ONAME + + Nname *Node + Argwid int64 + + // most nodes + Type *Type // actual type for TFIELD, element type for TARRAY, TCHAN, TMAP, TPTRxx + Width int64 // offset in TFIELD, width in all others + + // TFIELD + Down *Type // next struct field, also key type in TMAP + Outer *Type // outer struct + Note *string // literal string annotation + + // TARRAY + Bound int64 // negative is dynamic array + + // TMAP + Bucket *Type // internal type representing a hash bucket + Hmap *Type // internal type representing a Hmap (map header object) + Hiter *Type // internal type representing hash iterator state + Map *Type // link from the above 3 internal types back to the map type. + + Maplineno int32 // first use of TFORW as map key + Embedlineno int32 // first use of TFORW as embedded type + + // for TFORW, where to copy the eventual value to + Copyto *NodeList + + Lastfn *Node // for usefield +} + +type Label struct { + Used uint8 + Sym *Sym + Def *Node + Use *NodeList + Link *Label + + // for use during gen + Gotopc *obj.Prog // pointer to unresolved gotos + Labelpc *obj.Prog // pointer to code + Breakpc *obj.Prog // pointer to code + Continpc *obj.Prog // pointer to code +} + +type InitEntry struct { + Xoffset int64 // struct, array only + Expr *Node // bytes of run-time computed expressions +} + +type InitPlan struct { + Lit int64 + Zero int64 + Expr int64 + E []InitEntry +} + +const ( + SymExport = 1 << 0 // to be exported + SymPackage = 1 << 1 + SymExported = 1 << 2 // already written out by export + SymUniq = 1 << 3 + SymSiggen = 1 << 4 + SymAsm = 1 << 5 + SymAlgGen = 1 << 6 +) + +var dclstack *Sym + +type Iter struct { + Done int + Tfunc *Type + T *Type +} + +const ( + Txxx = iota + + TINT8 + TUINT8 + TINT16 + TUINT16 + TINT32 + TUINT32 + TINT64 + TUINT64 + TINT + TUINT + TUINTPTR + + TCOMPLEX64 + TCOMPLEX128 + + TFLOAT32 + TFLOAT64 + + TBOOL + + TPTR32 + TPTR64 + + TFUNC + TARRAY + T_old_DARRAY + TSTRUCT + TCHAN + TMAP + TINTER + TFORW + TFIELD + TANY + TSTRING + TUNSAFEPTR + + // pseudo-types for literals + TIDEAL + TNIL + TBLANK + + // pseudo-type for frame layout + TFUNCARGS + TCHANARGS + TINTERMETH + + NTYPE +) + +const ( + CTxxx = iota + + CTINT + CTRUNE + CTFLT + CTCPLX + CTSTR + CTBOOL + CTNIL +) + +const ( + /* types of channel */ + /* must match ../../pkg/nreflect/type.go:/Chandir */ + Cxxx = 0 + Crecv = 1 << 0 + Csend = 1 << 1 + Cboth = Crecv | Csend +) + +// declaration context +const ( + Pxxx = uint8(iota) + PEXTERN // global variable + PAUTO // local variables + PPARAM // input arguments + PPARAMOUT // output results + PPARAMREF // closure variable reference + PFUNC // global function + + PDISCARD // discard during parse of duplicate import + + PHEAP = uint8(1 << 7) // an extra bit to identify an escaped variable +) + +const ( + Etop = 1 << 1 // evaluated at statement level + Erv = 1 << 2 // evaluated in value context + Etype = 1 << 3 + Ecall = 1 << 4 // call-only expressions are ok + Efnstruct = 1 << 5 // multivalue function returns are ok + Eiota = 1 << 6 // iota is ok + Easgn = 1 << 7 // assigning to expression + Eindir = 1 << 8 // indirecting through expression + Eaddr = 1 << 9 // taking address of expression + Eproc = 1 << 10 // inside a go statement + Ecomplit = 1 << 11 // type in composite literal +) + +type Typedef struct { + Name string + Etype int + Sameas int +} + +type Sig struct { + name string + pkg *Pkg + isym *Sym + tsym *Sym + type_ *Type + mtype *Type + offset int32 + link *Sig +} + +type Io struct { + infile string + bin *obj.Biobuf + nlsemi int + eofnl int + last int + peekc int + peekc1 int // second peekc for ... + cp string // used for content when bin==nil + importsafe bool +} + +type Dlist struct { + field *Type +} + +type Idir struct { + link *Idir + dir string +} + +/* + * argument passing to/from + * smagic and umagic + */ +type Magic struct { + W int // input for both - width + S int // output for both - shift + Bad int // output for both - unexpected failure + + // magic multiplier for signed literal divisors + Sd int64 // input - literal divisor + Sm int64 // output - multiplier + + // magic multiplier for unsigned literal divisors + Ud uint64 // input - literal divisor + Um uint64 // output - multiplier + Ua int // output - adder +} + +/* + * note this is the runtime representation + * of the compilers arrays. + * + * typedef struct + * { // must not move anything + * uchar array[8]; // pointer to data + * uchar nel[4]; // number of elements + * uchar cap[4]; // allocated number of elements + * } Array; + */ +var Array_array int // runtime offsetof(Array,array) - same for String + +var Array_nel int // runtime offsetof(Array,nel) - same for String + +var Array_cap int // runtime offsetof(Array,cap) + +var sizeof_Array int // runtime sizeof(Array) + +/* + * note this is the runtime representation + * of the compilers strings. + * + * typedef struct + * { // must not move anything + * uchar array[8]; // pointer to data + * uchar nel[4]; // number of elements + * } String; + */ +var sizeof_String int // runtime sizeof(String) + +var dotlist [10]Dlist // size is max depth of embeddeds + +var curio Io + +var pushedio Io + +var lexlineno int32 + +var lineno int32 + +var prevlineno int32 + +var pragcgobuf string + +var infile string + +var outfile string + +var bout *obj.Biobuf + +var nerrors int + +var nsavederrors int + +var nsyntaxerrors int + +var decldepth int32 + +var safemode int + +var nolocalimports int + +var lexbuf bytes.Buffer +var strbuf bytes.Buffer + +var litbuf string + +var Debug [256]int + +var debugstr string + +var Debug_checknil int +var Debug_typeassert int + +var importmyname *Sym // my name for package + +var localpkg *Pkg // package being compiled + +var importpkg *Pkg // package being imported + +var structpkg *Pkg // package that declared struct, during import + +var builtinpkg *Pkg // fake package for builtins + +var gostringpkg *Pkg // fake pkg for Go strings + +var itabpkg *Pkg // fake pkg for itab cache + +var Runtimepkg *Pkg // package runtime + +var racepkg *Pkg // package runtime/race + +var typepkg *Pkg // fake package for runtime type info (headers) + +var typelinkpkg *Pkg // fake package for runtime type info (data) + +var weaktypepkg *Pkg // weak references to runtime type info + +var unsafepkg *Pkg // package unsafe + +var trackpkg *Pkg // fake package for field tracking + +var Tptr int // either TPTR32 or TPTR64 + +var myimportpath string + +var idirs *Idir + +var localimport string + +var asmhdr string + +var Types [NTYPE]*Type + +var idealstring *Type + +var idealbool *Type + +var bytetype *Type + +var runetype *Type + +var errortype *Type + +var Simtype [NTYPE]uint8 + +var ( + Isptr [NTYPE]bool + isforw [NTYPE]bool + Isint [NTYPE]bool + Isfloat [NTYPE]bool + Iscomplex [NTYPE]bool + Issigned [NTYPE]bool + issimple [NTYPE]bool +) + +var ( + okforeq [NTYPE]bool + okforadd [NTYPE]bool + okforand [NTYPE]bool + okfornone [NTYPE]bool + okforcmp [NTYPE]bool + okforbool [NTYPE]bool + okforcap [NTYPE]bool + okforlen [NTYPE]bool + okforarith [NTYPE]bool + okforconst [NTYPE]bool +) + +var ( + okfor [OEND][]bool + iscmp [OEND]bool +) + +var Minintval [NTYPE]*Mpint + +var Maxintval [NTYPE]*Mpint + +var minfltval [NTYPE]*Mpflt + +var maxfltval [NTYPE]*Mpflt + +var xtop *NodeList + +var externdcl *NodeList + +var exportlist *NodeList + +var importlist *NodeList // imported functions and methods with inlinable bodies + +var funcsyms *NodeList + +var dclcontext uint8 // PEXTERN/PAUTO + +var incannedimport int + +var statuniqgen int // name generator for static temps + +var loophack int + +var iota_ int32 + +var lastconst *NodeList + +var lasttype *Node + +var Maxarg int64 + +var Stksize int64 // stack size for current frame + +var stkptrsize int64 // prefix of stack containing pointers + +var blockgen int32 // max block number + +var block int32 // current block number + +var Hasdefer int // flag that curfn has defer statetment + +var Curfn *Node + +var Widthptr int + +var Widthint int + +var Widthreg int + +var typesw *Node + +var nblank *Node + +var hunk string + +var nhunk int32 + +var thunk int32 + +var Funcdepth int32 + +var typecheckok int + +var compiling_runtime int + +var compiling_wrappers int + +var use_writebarrier int + +var pure_go int + +var flag_installsuffix string + +var flag_race int + +var flag_largemodel int + +// Pending annotations for next func declaration. +var ( + noescape bool + nosplit bool + nowritebarrier bool + systemstack bool + norace bool +) + +var debuglive int + +var Ctxt *obj.Link + +var nointerface bool + +var writearchive int + +var bstdout obj.Biobuf + +var Nacl bool + +var continpc *obj.Prog + +var breakpc *obj.Prog + +var Pc *obj.Prog + +var nodfp *Node + +var Disable_checknil int + +var zerosize int64 + +type Flow struct { + Prog *obj.Prog // actual instruction + P1 *Flow // predecessors of this instruction: p1, + P2 *Flow // and then p2 linked though p2link. + P2link *Flow + S1 *Flow // successors of this instruction (at most two: s1 and s2). + S2 *Flow + Link *Flow // next instruction in function code + + Active int32 // usable by client + + Id int32 // sequence number in flow graph + Rpo int32 // reverse post ordering + Loop uint16 // x5 for every loop + Refset uint8 // diagnostic generated + + Data interface{} // for use by client +} + +type Graph struct { + Start *Flow + Num int + + // After calling flowrpo, rpo lists the flow nodes in reverse postorder, + // and each non-dead Flow node f has g->rpo[f->rpo] == f. + Rpo []*Flow +} + +/* + * interface to back end + */ + +const ( + // Pseudo-op, like TEXT, GLOBL, TYPE, PCDATA, FUNCDATA. + Pseudo = 1 << 1 + + // There's nothing to say about the instruction, + // but it's still okay to see. + OK = 1 << 2 + + // Size of right-side write, or right-side read if no write. + SizeB = 1 << 3 + SizeW = 1 << 4 + SizeL = 1 << 5 + SizeQ = 1 << 6 + SizeF = 1 << 7 + SizeD = 1 << 8 + + // Left side (Prog.from): address taken, read, write. + LeftAddr = 1 << 9 + LeftRead = 1 << 10 + LeftWrite = 1 << 11 + + // Register in middle (Prog.reg); only ever read. (arm, ppc64) + RegRead = 1 << 12 + CanRegRead = 1 << 13 + + // Right side (Prog.to): address taken, read, write. + RightAddr = 1 << 14 + RightRead = 1 << 15 + RightWrite = 1 << 16 + + // Instruction kinds + Move = 1 << 17 // straight move + Conv = 1 << 18 // size conversion + Cjmp = 1 << 19 // conditional jump + Break = 1 << 20 // breaks control flow (no fallthrough) + Call = 1 << 21 // function call + Jump = 1 << 22 // jump + Skip = 1 << 23 // data instruction + + // Set, use, or kill of carry bit. + // Kill means we never look at the carry bit after this kind of instruction. + SetCarry = 1 << 24 + UseCarry = 1 << 25 + KillCarry = 1 << 26 + + // Special cases for register use. (amd64, 386) + ShiftCX = 1 << 27 // possible shift by CX + ImulAXDX = 1 << 28 // possible multiply into DX:AX + + // Instruction updates whichever of from/to is type D_OREG. (ppc64) + PostInc = 1 << 29 +) + +type Arch struct { + Thechar int + Thestring string + Thelinkarch *obj.LinkArch + Typedefs []Typedef + REGSP int + REGCTXT int + REGCALLX int // BX + REGCALLX2 int // AX + REGRETURN int // AX + REGMIN int + REGMAX int + REGZERO int // architectural zero register, if available + FREGMIN int + FREGMAX int + MAXWIDTH int64 + ReservedRegs []int + + AddIndex func(*Node, int64, *Node) bool // optional + Betypeinit func() + Bgen_float func(*Node, bool, int, *obj.Prog) // optional + Cgen64 func(*Node, *Node) // only on 32-bit systems + Cgenindex func(*Node, *Node, bool) *obj.Prog + Cgen_bmul func(int, *Node, *Node, *Node) bool + Cgen_float func(*Node, *Node) // optional + Cgen_hmul func(*Node, *Node, *Node) + Cgen_shift func(int, bool, *Node, *Node, *Node) + Clearfat func(*Node) + Cmp64 func(*Node, *Node, int, int, *obj.Prog) // only on 32-bit systems + Defframe func(*obj.Prog) + Dodiv func(int, *Node, *Node, *Node) + Excise func(*Flow) + Expandchecks func(*obj.Prog) + Getg func(*Node) + Gins func(int, *Node, *Node) *obj.Prog + + // Ginscmp generates code comparing n1 to n2 and jumping away if op is satisfied. + // The returned prog should be Patch'ed with the jump target. + // If op is not satisfied, code falls through to the next emitted instruction. + // Likely is the branch prediction hint: +1 for likely, -1 for unlikely, 0 for no opinion. + // + // Ginscmp must be able to handle all kinds of arguments for n1 and n2, + // not just simple registers, although it can assume that there are no + // function calls needed during the evaluation, and on 32-bit systems + // the values are guaranteed not to be 64-bit values, so no in-memory + // temporaries are necessary. + Ginscmp func(op int, t *Type, n1, n2 *Node, likely int) *obj.Prog + + // Ginsboolval inserts instructions to convert the result + // of a just-completed comparison to a boolean value. + // The first argument is the conditional jump instruction + // corresponding to the desired value. + // The second argument is the destination. + // If not present, Ginsboolval will be emulated with jumps. + Ginsboolval func(int, *Node) + + Ginscon func(int, int64, *Node) + Ginsnop func() + Gmove func(*Node, *Node) + Igenindex func(*Node, *Node, bool) *obj.Prog + Linkarchinit func() + Peep func(*obj.Prog) + Proginfo func(*obj.Prog) // fills in Prog.Info + Regtyp func(*obj.Addr) bool + Sameaddr func(*obj.Addr, *obj.Addr) bool + Smallindir func(*obj.Addr, *obj.Addr) bool + Stackaddr func(*obj.Addr) bool + Blockcopy func(*Node, *Node, int64, int64, int64) + Sudoaddable func(int, *Node, *obj.Addr) bool + Sudoclean func() + Excludedregs func() uint64 + RtoB func(int) uint64 + FtoB func(int) uint64 + BtoR func(uint64) int + BtoF func(uint64) int + Optoas func(int, *Type) int + Doregbits func(int) uint64 + Regnames func(*int) []string + Use387 bool // should 8g use 387 FP instructions instead of sse2. +} + +var pcloc int32 + +var Thearch Arch + +var Newproc *Node + +var Deferproc *Node + +var Deferreturn *Node + +var Panicindex *Node + +var panicslice *Node + +var throwreturn *Node diff --git a/src/cmd/compile/internal/gc/go.y b/src/cmd/compile/internal/gc/go.y new file mode 100644 index 0000000000000000000000000000000000000000..c6d1607e6b2f82f43c98d58ff77d3d9df79dedf0 --- /dev/null +++ b/src/cmd/compile/internal/gc/go.y @@ -0,0 +1,2316 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +/* + * Go language grammar. + * + * The Go semicolon rules are: + * + * 1. all statements and declarations are terminated by semicolons. + * 2. semicolons can be omitted before a closing ) or }. + * 3. semicolons are inserted by the lexer before a newline + * following a specific list of tokens. + * + * Rules #1 and #2 are accomplished by writing the lists as + * semicolon-separated lists with an optional trailing semicolon. + * Rule #3 is implemented in yylex. + */ + +%{ +package gc + +import ( + "fmt" + "strings" +) +%} +%union { + node *Node + list *NodeList + typ *Type + sym *Sym + val Val + i int +} + +// |sed 's/.* //' |9 fmt -l1 |sort |9 fmt -l50 | sed 's/^/%xxx /' + +%token LLITERAL +%token LASOP LCOLAS +%token LBREAK LCASE LCHAN LCONST LCONTINUE LDDD +%token LDEFAULT LDEFER LELSE LFALL LFOR LFUNC LGO LGOTO +%token LIF LIMPORT LINTERFACE LMAP LNAME +%token LPACKAGE LRANGE LRETURN LSELECT LSTRUCT LSWITCH +%token LTYPE LVAR + +%token LANDAND LANDNOT LBODY LCOMM LDEC LEQ LGE LGT +%token LIGNORE LINC LLE LLSH LLT LNE LOROR LRSH + +%type lbrace import_here +%type sym packname +%type oliteral + +%type stmt ntype +%type arg_type +%type case caseblock +%type compound_stmt dotname embed expr complitexpr bare_complitexpr +%type expr_or_type +%type fndcl hidden_fndcl fnliteral +%type for_body for_header for_stmt if_header if_stmt non_dcl_stmt +%type interfacedcl keyval labelname name +%type name_or_type non_expr_type +%type new_name dcl_name oexpr typedclname +%type onew_name +%type osimple_stmt pexpr pexpr_no_paren +%type pseudocall range_stmt select_stmt +%type simple_stmt +%type switch_stmt uexpr +%type xfndcl typedcl start_complit + +%type xdcl fnbody fnres loop_body dcl_name_list +%type new_name_list expr_list keyval_list braced_keyval_list expr_or_type_list xdcl_list +%type oexpr_list caseblock_list elseif elseif_list else stmt_list oarg_type_list_ocomma arg_type_list +%type interfacedcl_list vardcl vardcl_list structdcl structdcl_list +%type common_dcl constdcl constdcl1 constdcl_list typedcl_list + +%type convtype comptype dotdotdot +%type indcl interfacetype structtype ptrtype +%type recvchantype non_recvchantype othertype fnret_type fntype + +%type hidden_importsym hidden_pkg_importsym + +%type hidden_constant hidden_literal hidden_funarg +%type hidden_interfacedcl hidden_structdcl + +%type hidden_funres +%type ohidden_funres +%type hidden_funarg_list ohidden_funarg_list +%type hidden_interfacedcl_list ohidden_interfacedcl_list +%type hidden_structdcl_list ohidden_structdcl_list + +%type hidden_type hidden_type_misc hidden_pkgtype +%type hidden_type_func +%type hidden_type_recv_chan hidden_type_non_recv_chan + +%left LCOMM /* outside the usual hierarchy; here for good error messages */ + +%left LOROR +%left LANDAND +%left LEQ LNE LLE LGE LLT LGT +%left '+' '-' '|' '^' +%left '*' '/' '%' '&' LLSH LRSH LANDNOT + +/* + * manual override of shift/reduce conflicts. + * the general form is that we assign a precedence + * to the token being shifted and then introduce + * NotToken with lower precedence or PreferToToken with higher + * and annotate the reducing rule accordingly. + */ +%left NotPackage +%left LPACKAGE + +%left NotParen +%left '(' + +%left ')' +%left PreferToRightParen + +%error loadsys package LIMPORT '(' LLITERAL import_package import_there ',': + "unexpected comma during import block" + +%error loadsys package LIMPORT LNAME ';': + "missing import path; require quoted string" + +%error loadsys package imports LFUNC LNAME '(' ')' '{' LIF if_header ';': + "missing { after if clause" + +%error loadsys package imports LFUNC LNAME '(' ')' '{' LSWITCH if_header ';': + "missing { after switch clause" + +%error loadsys package imports LFUNC LNAME '(' ')' '{' LFOR for_header ';': + "missing { after for clause" + +%error loadsys package imports LFUNC LNAME '(' ')' '{' LFOR ';' LBODY: + "missing { after for clause" + +%error loadsys package imports LFUNC LNAME '(' ')' ';' '{': + "unexpected semicolon or newline before {" + +%error loadsys package imports LTYPE LNAME ';': + "unexpected semicolon or newline in type declaration" + +%error loadsys package imports LCHAN '}': + "unexpected } in channel type" + +%error loadsys package imports LCHAN ')': + "unexpected ) in channel type" + +%error loadsys package imports LCHAN ',': + "unexpected comma in channel type" + +%error loadsys package imports LFUNC LNAME '(' ')' '{' if_stmt ';' LELSE: + "unexpected semicolon or newline before else" + +%error loadsys package imports LTYPE LNAME LINTERFACE '{' LNAME ',' LNAME: + "name list not allowed in interface type" + +%error loadsys package imports LFUNC LNAME '(' ')' '{' LFOR LVAR LNAME '=' LNAME: + "var declaration not allowed in for initializer" + +%error loadsys package imports LVAR LNAME '[' ']' LNAME '{': + "unexpected { at end of statement" + +%error loadsys package imports LFUNC LNAME '(' ')' '{' LVAR LNAME '[' ']' LNAME '{': + "unexpected { at end of statement" + +%error loadsys package imports LFUNC LNAME '(' ')' '{' LDEFER LNAME ';': + "argument to go/defer must be function call" + +%error loadsys package imports LVAR LNAME '=' LNAME '{' LNAME ';': + "need trailing comma before newline in composite literal" + +%error loadsys package imports LVAR LNAME '=' comptype '{' LNAME ';': + "need trailing comma before newline in composite literal" + +%error loadsys package imports LFUNC LNAME '(' ')' '{' LFUNC LNAME: + "nested func not allowed" + +%error loadsys package imports LFUNC LNAME '(' ')' '{' LIF if_header loop_body LELSE ';': + "else must be followed by if or statement block" + +%% +file: + loadsys + package + imports + xdcl_list + { + xtop = concat(xtop, $4); + } + +package: + %prec NotPackage + { + prevlineno = lineno; + Yyerror("package statement must be first"); + errorexit(); + } +| LPACKAGE sym ';' + { + mkpackage($2.Name); + } + +/* + * this loads the definitions for the low-level runtime functions, + * so that the compiler can generate calls to them, + * but does not make the name "runtime" visible as a package. + */ +loadsys: + { + importpkg = Runtimepkg; + + if Debug['A'] != 0 { + cannedimports("runtime.Builtin", "package runtime\n\n$$\n\n"); + } else { + cannedimports("runtime.Builtin", runtimeimport); + } + curio.importsafe = true + } + import_package + import_there + { + importpkg = nil; + } + +imports: +| imports import ';' + +import: + LIMPORT import_stmt +| LIMPORT '(' import_stmt_list osemi ')' +| LIMPORT '(' ')' + +import_stmt: + import_here import_package import_there + { + ipkg := importpkg; + my := importmyname; + importpkg = nil; + importmyname = nil; + + if my == nil { + my = Lookup(ipkg.Name); + } + + pack := Nod(OPACK, nil, nil); + pack.Sym = my; + pack.Name.Pkg = ipkg; + pack.Lineno = int32($1); + + if strings.HasPrefix(my.Name, ".") { + importdot(ipkg, pack); + break; + } + if my.Name == "init" { + Yyerror("cannot import package as init - init must be a func"); + break; + } + if my.Name == "_" { + break; + } + if my.Def != nil { + lineno = int32($1); + redeclare(my, "as imported package name"); + } + my.Def = pack; + my.Lastlineno = int32($1); + my.Block = 1; // at top level + } +| import_here import_there + { + // When an invalid import path is passed to importfile, + // it calls Yyerror and then sets up a fake import with + // no package statement. This allows us to test more + // than one invalid import statement in a single file. + if nerrors == 0 { + Fatal("phase error in import"); + } + } + +import_stmt_list: + import_stmt +| import_stmt_list ';' import_stmt + +import_here: + LLITERAL + { + // import with original name + $$ = parserline(); + importmyname = nil; + importfile(&$1, $$); + } +| sym LLITERAL + { + // import with given name + $$ = parserline(); + importmyname = $1; + importfile(&$2, $$); + } +| '.' LLITERAL + { + // import into my name space + $$ = parserline(); + importmyname = Lookup("."); + importfile(&$2, $$); + } + +import_package: + LPACKAGE LNAME import_safety ';' + { + if importpkg.Name == "" { + importpkg.Name = $2.Name; + numImport[$2.Name]++ + } else if importpkg.Name != $2.Name { + Yyerror("conflicting names %s and %s for package %q", importpkg.Name, $2.Name, importpkg.Path); + } + importpkg.Direct = 1; + importpkg.Safe = curio.importsafe + + if safemode != 0 && !curio.importsafe { + Yyerror("cannot import unsafe package %q", importpkg.Path); + } + } + +import_safety: +| LNAME + { + if $1.Name == "safe" { + curio.importsafe = true + } + } + +import_there: + { + defercheckwidth(); + } + hidden_import_list '$' '$' + { + resumecheckwidth(); + unimportfile(); + } + +/* + * declarations + */ +xdcl: + { + Yyerror("empty top-level declaration"); + $$ = nil; + } +| common_dcl +| xfndcl + { + $$ = list1($1); + } +| non_dcl_stmt + { + Yyerror("non-declaration statement outside function body"); + $$ = nil; + } +| error + { + $$ = nil; + } + +common_dcl: + LVAR vardcl + { + $$ = $2; + } +| LVAR '(' vardcl_list osemi ')' + { + $$ = $3; + } +| LVAR '(' ')' + { + $$ = nil; + } +| lconst constdcl + { + $$ = $2; + iota_ = -100000; + lastconst = nil; + } +| lconst '(' constdcl osemi ')' + { + $$ = $3; + iota_ = -100000; + lastconst = nil; + } +| lconst '(' constdcl ';' constdcl_list osemi ')' + { + $$ = concat($3, $5); + iota_ = -100000; + lastconst = nil; + } +| lconst '(' ')' + { + $$ = nil; + iota_ = -100000; + } +| LTYPE typedcl + { + $$ = list1($2); + } +| LTYPE '(' typedcl_list osemi ')' + { + $$ = $3; + } +| LTYPE '(' ')' + { + $$ = nil; + } + +lconst: + LCONST + { + iota_ = 0; + } + +vardcl: + dcl_name_list ntype + { + $$ = variter($1, $2, nil); + } +| dcl_name_list ntype '=' expr_list + { + $$ = variter($1, $2, $4); + } +| dcl_name_list '=' expr_list + { + $$ = variter($1, nil, $3); + } + +constdcl: + dcl_name_list ntype '=' expr_list + { + $$ = constiter($1, $2, $4); + } +| dcl_name_list '=' expr_list + { + $$ = constiter($1, nil, $3); + } + +constdcl1: + constdcl +| dcl_name_list ntype + { + $$ = constiter($1, $2, nil); + } +| dcl_name_list + { + $$ = constiter($1, nil, nil); + } + +typedclname: + sym + { + // different from dclname because the name + // becomes visible right here, not at the end + // of the declaration. + $$ = typedcl0($1); + } + +typedcl: + typedclname ntype + { + $$ = typedcl1($1, $2, true); + } + +simple_stmt: + expr + { + $$ = $1; + + // These nodes do not carry line numbers. + // Since a bare name used as an expression is an error, + // introduce a wrapper node to give the correct line. + switch($$.Op) { + case ONAME, ONONAME, OTYPE, OPACK, OLITERAL: + $$ = Nod(OPAREN, $$, nil); + $$.Implicit = true; + break; + } + } +| expr LASOP expr + { + $$ = Nod(OASOP, $1, $3); + $$.Etype = uint8($2); // rathole to pass opcode + } +| expr_list '=' expr_list + { + if $1.Next == nil && $3.Next == nil { + // simple + $$ = Nod(OAS, $1.N, $3.N); + break; + } + // multiple + $$ = Nod(OAS2, nil, nil); + $$.List = $1; + $$.Rlist = $3; + } +| expr_list LCOLAS expr_list + { + if $3.N.Op == OTYPESW { + $$ = Nod(OTYPESW, nil, $3.N.Right); + if $3.Next != nil { + Yyerror("expr.(type) must be alone in list"); + } + if $1.Next != nil { + Yyerror("argument count mismatch: %d = %d", count($1), 1); + } else if ($1.N.Op != ONAME && $1.N.Op != OTYPE && $1.N.Op != ONONAME) || isblank($1.N) { + Yyerror("invalid variable name %s in type switch", $1.N); + } else { + $$.Left = dclname($1.N.Sym); + } // it's a colas, so must not re-use an oldname. + break; + } + $$ = colas($1, $3, int32($2)); + } +| expr LINC + { + $$ = Nod(OASOP, $1, Nodintconst(1)); + $$.Implicit = true; + $$.Etype = OADD; + } +| expr LDEC + { + $$ = Nod(OASOP, $1, Nodintconst(1)); + $$.Implicit = true; + $$.Etype = OSUB; + } + +case: + LCASE expr_or_type_list ':' + { + var n, nn *Node + + // will be converted to OCASE + // right will point to next case + // done in casebody() + markdcl(); + $$ = Nod(OXCASE, nil, nil); + $$.List = $2; + if typesw != nil && typesw.Right != nil { + n = typesw.Right.Left + if n != nil { + // type switch - declare variable + nn = newname(n.Sym); + declare(nn, dclcontext); + $$.Rlist = list1(nn); + + // keep track of the instances for reporting unused + nn.Name.Defn = typesw.Right; + } + } + } +| LCASE expr_or_type_list '=' expr ':' + { + var n *Node + + // will be converted to OCASE + // right will point to next case + // done in casebody() + markdcl(); + $$ = Nod(OXCASE, nil, nil); + if $2.Next == nil { + n = Nod(OAS, $2.N, $4); + } else { + n = Nod(OAS2, nil, nil); + n.List = $2; + n.Rlist = list1($4); + } + $$.List = list1(n); + } +| LCASE expr_or_type_list LCOLAS expr ':' + { + // will be converted to OCASE + // right will point to next case + // done in casebody() + markdcl(); + $$ = Nod(OXCASE, nil, nil); + $$.List = list1(colas($2, list1($4), int32($3))); + } +| LDEFAULT ':' + { + var n, nn *Node + + markdcl(); + $$ = Nod(OXCASE, nil, nil); + if typesw != nil && typesw.Right != nil { + n = typesw.Right.Left + if n != nil { + // type switch - declare variable + nn = newname(n.Sym); + declare(nn, dclcontext); + $$.Rlist = list1(nn); + + // keep track of the instances for reporting unused + nn.Name.Defn = typesw.Right; + } + } + } + +compound_stmt: + '{' + { + markdcl(); + } + stmt_list '}' + { + if $3 == nil { + $$ = Nod(OEMPTY, nil, nil); + } else { + $$ = liststmt($3); + } + popdcl(); + } + +caseblock: + case + { + // If the last token read by the lexer was consumed + // as part of the case, clear it (parser has cleared yychar). + // If the last token read by the lexer was the lookahead + // leave it alone (parser has it cached in yychar). + // This is so that the stmt_list action doesn't look at + // the case tokens if the stmt_list is empty. + yylast = yychar; + $1.Xoffset = int64(block); + } + stmt_list + { + // This is the only place in the language where a statement + // list is not allowed to drop the final semicolon, because + // it's the only place where a statement list is not followed + // by a closing brace. Handle the error for pedantry. + + // Find the final token of the statement list. + // yylast is lookahead; yyprev is last of stmt_list + last := yyprev; + + if last > 0 && last != ';' && yychar != '}' { + Yyerror("missing statement after label"); + } + $$ = $1; + $$.Nbody = $3; + popdcl(); + } + +caseblock_list: + { + $$ = nil; + } +| caseblock_list caseblock + { + $$ = list($1, $2); + } + +loop_body: + LBODY + { + markdcl(); + } + stmt_list '}' + { + $$ = $3; + popdcl(); + } + +range_stmt: + expr_list '=' LRANGE expr + { + $$ = Nod(ORANGE, nil, $4); + $$.List = $1; + $$.Etype = 0; // := flag + } +| expr_list LCOLAS LRANGE expr + { + $$ = Nod(ORANGE, nil, $4); + $$.List = $1; + $$.Colas = true; + colasdefn($1, $$); + } +| LRANGE expr + { + $$ = Nod(ORANGE, nil, $2); + $$.Etype = 0; // := flag + } + +for_header: + osimple_stmt ';' osimple_stmt ';' osimple_stmt + { + // init ; test ; incr + if $5 != nil && $5.Colas { + Yyerror("cannot declare in the for-increment"); + } + $$ = Nod(OFOR, nil, nil); + if $1 != nil { + $$.Ninit = list1($1); + } + $$.Left = $3; + $$.Right = $5; + } +| osimple_stmt + { + // normal test + $$ = Nod(OFOR, nil, nil); + $$.Left = $1; + } +| range_stmt + +for_body: + for_header loop_body + { + $$ = $1; + $$.Nbody = concat($$.Nbody, $2); + } + +for_stmt: + LFOR + { + markdcl(); + } + for_body + { + $$ = $3; + popdcl(); + } + +if_header: + osimple_stmt + { + // test + $$ = Nod(OIF, nil, nil); + $$.Left = $1; + } +| osimple_stmt ';' osimple_stmt + { + // init ; test + $$ = Nod(OIF, nil, nil); + if $1 != nil { + $$.Ninit = list1($1); + } + $$.Left = $3; + } + +/* IF cond body (ELSE IF cond body)* (ELSE block)? */ +if_stmt: + LIF + { + markdcl(); + } + if_header + { + if $3.Left == nil { + Yyerror("missing condition in if statement"); + } + } + loop_body + { + $3.Nbody = $5; + } + elseif_list else + { + var n *Node + var nn *NodeList + + $$ = $3; + n = $3; + popdcl(); + for nn = concat($7, $8); nn != nil; nn = nn.Next { + if nn.N.Op == OIF { + popdcl(); + } + n.Rlist = list1(nn.N); + n = nn.N; + } + } + +elseif: + LELSE LIF + { + markdcl(); + } + if_header loop_body + { + if $4.Left == nil { + Yyerror("missing condition in if statement"); + } + $4.Nbody = $5; + $$ = list1($4); + } + +elseif_list: + { + $$ = nil; + } +| elseif_list elseif + { + $$ = concat($1, $2); + } + +else: + { + $$ = nil; + } +| LELSE compound_stmt + { + l := &NodeList{N: $2} + l.End = l + $$ = l; + } + +switch_stmt: + LSWITCH + { + markdcl(); + } + if_header + { + var n *Node + n = $3.Left; + if n != nil && n.Op != OTYPESW { + n = nil; + } + typesw = Nod(OXXX, typesw, n); + } + LBODY caseblock_list '}' + { + $$ = $3; + $$.Op = OSWITCH; + $$.List = $6; + typesw = typesw.Left; + popdcl(); + } + +select_stmt: + LSELECT + { + typesw = Nod(OXXX, typesw, nil); + } + LBODY caseblock_list '}' + { + $$ = Nod(OSELECT, nil, nil); + $$.Lineno = typesw.Lineno; + $$.List = $4; + typesw = typesw.Left; + } + +/* + * expressions + */ +expr: + uexpr +| expr LOROR expr + { + $$ = Nod(OOROR, $1, $3); + } +| expr LANDAND expr + { + $$ = Nod(OANDAND, $1, $3); + } +| expr LEQ expr + { + $$ = Nod(OEQ, $1, $3); + } +| expr LNE expr + { + $$ = Nod(ONE, $1, $3); + } +| expr LLT expr + { + $$ = Nod(OLT, $1, $3); + } +| expr LLE expr + { + $$ = Nod(OLE, $1, $3); + } +| expr LGE expr + { + $$ = Nod(OGE, $1, $3); + } +| expr LGT expr + { + $$ = Nod(OGT, $1, $3); + } +| expr '+' expr + { + $$ = Nod(OADD, $1, $3); + } +| expr '-' expr + { + $$ = Nod(OSUB, $1, $3); + } +| expr '|' expr + { + $$ = Nod(OOR, $1, $3); + } +| expr '^' expr + { + $$ = Nod(OXOR, $1, $3); + } +| expr '*' expr + { + $$ = Nod(OMUL, $1, $3); + } +| expr '/' expr + { + $$ = Nod(ODIV, $1, $3); + } +| expr '%' expr + { + $$ = Nod(OMOD, $1, $3); + } +| expr '&' expr + { + $$ = Nod(OAND, $1, $3); + } +| expr LANDNOT expr + { + $$ = Nod(OANDNOT, $1, $3); + } +| expr LLSH expr + { + $$ = Nod(OLSH, $1, $3); + } +| expr LRSH expr + { + $$ = Nod(ORSH, $1, $3); + } + /* not an expression anymore, but left in so we can give a good error */ +| expr LCOMM expr + { + $$ = Nod(OSEND, $1, $3); + } + +uexpr: + pexpr +| '*' uexpr + { + $$ = Nod(OIND, $2, nil); + } +| '&' uexpr + { + if $2.Op == OCOMPLIT { + // Special case for &T{...}: turn into (*T){...}. + $$ = $2; + $$.Right = Nod(OIND, $$.Right, nil); + $$.Right.Implicit = true; + } else { + $$ = Nod(OADDR, $2, nil); + } + } +| '+' uexpr + { + $$ = Nod(OPLUS, $2, nil); + } +| '-' uexpr + { + $$ = Nod(OMINUS, $2, nil); + } +| '!' uexpr + { + $$ = Nod(ONOT, $2, nil); + } +| '~' uexpr + { + Yyerror("the bitwise complement operator is ^"); + $$ = Nod(OCOM, $2, nil); + } +| '^' uexpr + { + $$ = Nod(OCOM, $2, nil); + } +| LCOMM uexpr + { + $$ = Nod(ORECV, $2, nil); + } + +/* + * call-like statements that + * can be preceded by 'defer' and 'go' + */ +pseudocall: + pexpr '(' ')' + { + $$ = Nod(OCALL, $1, nil); + } +| pexpr '(' expr_or_type_list ocomma ')' + { + $$ = Nod(OCALL, $1, nil); + $$.List = $3; + } +| pexpr '(' expr_or_type_list LDDD ocomma ')' + { + $$ = Nod(OCALL, $1, nil); + $$.List = $3; + $$.Isddd = true; + } + +pexpr_no_paren: + LLITERAL + { + $$ = nodlit($1); + } +| name +| pexpr '.' sym + { + if $1.Op == OPACK { + var s *Sym + s = restrictlookup($3.Name, $1.Name.Pkg); + $1.Used = true; + $$ = oldname(s); + break; + } + $$ = Nod(OXDOT, $1, newname($3)); + } +| pexpr '.' '(' expr_or_type ')' + { + $$ = Nod(ODOTTYPE, $1, $4); + } +| pexpr '.' '(' LTYPE ')' + { + $$ = Nod(OTYPESW, nil, $1); + } +| pexpr '[' expr ']' + { + $$ = Nod(OINDEX, $1, $3); + } +| pexpr '[' oexpr ':' oexpr ']' + { + $$ = Nod(OSLICE, $1, Nod(OKEY, $3, $5)); + } +| pexpr '[' oexpr ':' oexpr ':' oexpr ']' + { + if $5 == nil { + Yyerror("middle index required in 3-index slice"); + } + if $7 == nil { + Yyerror("final index required in 3-index slice"); + } + $$ = Nod(OSLICE3, $1, Nod(OKEY, $3, Nod(OKEY, $5, $7))); + } +| pseudocall +| convtype '(' expr ocomma ')' + { + // conversion + $$ = Nod(OCALL, $1, nil); + $$.List = list1($3); + } +| comptype lbrace start_complit braced_keyval_list '}' + { + $$ = $3; + $$.Right = $1; + $$.List = $4; + fixlbrace($2); + } +| pexpr_no_paren '{' start_complit braced_keyval_list '}' + { + $$ = $3; + $$.Right = $1; + $$.List = $4; + } +| '(' expr_or_type ')' '{' start_complit braced_keyval_list '}' + { + Yyerror("cannot parenthesize type in composite literal"); + $$ = $5; + $$.Right = $2; + $$.List = $6; + } +| fnliteral + +start_complit: + { + // composite expression. + // make node early so we get the right line number. + $$ = Nod(OCOMPLIT, nil, nil); + } + +keyval: + complitexpr ':' complitexpr + { + $$ = Nod(OKEY, $1, $3); + } + +bare_complitexpr: + expr + { + // These nodes do not carry line numbers. + // Since a composite literal commonly spans several lines, + // the line number on errors may be misleading. + // Introduce a wrapper node to give the correct line. + $$ = $1; + switch($$.Op) { + case ONAME, ONONAME, OTYPE, OPACK, OLITERAL: + $$ = Nod(OPAREN, $$, nil); + $$.Implicit = true; + } + } +| '{' start_complit braced_keyval_list '}' + { + $$ = $2; + $$.List = $3; + } + +complitexpr: + expr +| '{' start_complit braced_keyval_list '}' + { + $$ = $2; + $$.List = $3; + } + +pexpr: + pexpr_no_paren +| '(' expr_or_type ')' + { + $$ = $2; + + // Need to know on lhs of := whether there are ( ). + // Don't bother with the OPAREN in other cases: + // it's just a waste of memory and time. + switch($$.Op) { + case ONAME, ONONAME, OPACK, OTYPE, OLITERAL, OTYPESW: + $$ = Nod(OPAREN, $$, nil); + } + } + +expr_or_type: + expr +| non_expr_type %prec PreferToRightParen + +name_or_type: + ntype + +lbrace: + LBODY + { + $$ = LBODY; + } +| '{' + { + $$ = '{'; + } + +/* + * names and types + * newname is used before declared + * oldname is used after declared + */ +new_name: + sym + { + if $1 == nil { + $$ = nil; + } else { + $$ = newname($1); + } + } + +dcl_name: + sym + { + $$ = dclname($1); + } + +onew_name: + { + $$ = nil; + } +| new_name + +sym: + LNAME + { + $$ = $1; + // during imports, unqualified non-exported identifiers are from builtinpkg + if importpkg != nil && !exportname($1.Name) { + $$ = Pkglookup($1.Name, builtinpkg); + } + } +| hidden_importsym +| '?' + { + $$ = nil; + } + +hidden_importsym: + '@' LLITERAL '.' LNAME + { + var p *Pkg + + if $2.U.(string) == "" { + p = importpkg; + } else { + if isbadimport($2.U.(string)) { + errorexit(); + } + p = mkpkg($2.U.(string)); + } + $$ = Pkglookup($4.Name, p); + } +| '@' LLITERAL '.' '?' + { + var p *Pkg + + if $2.U.(string) == "" { + p = importpkg; + } else { + if isbadimport($2.U.(string)) { + errorexit(); + } + p = mkpkg($2.U.(string)); + } + $$ = Pkglookup("?", p); + } + +name: + sym %prec NotParen + { + $$ = oldname($1); + if $$.Name != nil && $$.Name.Pack != nil { + $$.Name.Pack.Used = true; + } + } + +labelname: + new_name + +/* + * to avoid parsing conflicts, type is split into + * channel types + * function types + * parenthesized types + * any other type + * the type system makes additional restrictions, + * but those are not implemented in the grammar. + */ +dotdotdot: + LDDD + { + Yyerror("final argument in variadic function missing type"); + $$ = Nod(ODDD, typenod(typ(TINTER)), nil); + } +| LDDD ntype + { + $$ = Nod(ODDD, $2, nil); + } + +ntype: + recvchantype +| fntype +| othertype +| ptrtype +| dotname +| '(' ntype ')' + { + $$ = $2; + } + +non_expr_type: + recvchantype +| fntype +| othertype +| '*' non_expr_type + { + $$ = Nod(OIND, $2, nil); + } + +non_recvchantype: + fntype +| othertype +| ptrtype +| dotname +| '(' ntype ')' + { + $$ = $2; + } + +convtype: + fntype +| othertype + +comptype: + othertype + +fnret_type: + recvchantype +| fntype +| othertype +| ptrtype +| dotname + +dotname: + name +| name '.' sym + { + if $1.Op == OPACK { + var s *Sym + s = restrictlookup($3.Name, $1.Name.Pkg); + $1.Used = true; + $$ = oldname(s); + break; + } + $$ = Nod(OXDOT, $1, newname($3)); + } + +othertype: + '[' oexpr ']' ntype + { + $$ = Nod(OTARRAY, $2, $4); + } +| '[' LDDD ']' ntype + { + // array literal of nelem + $$ = Nod(OTARRAY, Nod(ODDD, nil, nil), $4); + } +| LCHAN non_recvchantype + { + $$ = Nod(OTCHAN, $2, nil); + $$.Etype = Cboth; + } +| LCHAN LCOMM ntype + { + $$ = Nod(OTCHAN, $3, nil); + $$.Etype = Csend; + } +| LMAP '[' ntype ']' ntype + { + $$ = Nod(OTMAP, $3, $5); + } +| structtype +| interfacetype + +ptrtype: + '*' ntype + { + $$ = Nod(OIND, $2, nil); + } + +recvchantype: + LCOMM LCHAN ntype + { + $$ = Nod(OTCHAN, $3, nil); + $$.Etype = Crecv; + } + +structtype: + LSTRUCT lbrace structdcl_list osemi '}' + { + $$ = Nod(OTSTRUCT, nil, nil); + $$.List = $3; + fixlbrace($2); + } +| LSTRUCT lbrace '}' + { + $$ = Nod(OTSTRUCT, nil, nil); + fixlbrace($2); + } + +interfacetype: + LINTERFACE lbrace interfacedcl_list osemi '}' + { + $$ = Nod(OTINTER, nil, nil); + $$.List = $3; + fixlbrace($2); + } +| LINTERFACE lbrace '}' + { + $$ = Nod(OTINTER, nil, nil); + fixlbrace($2); + } + +/* + * function stuff + * all in one place to show how crappy it all is + */ +xfndcl: + LFUNC fndcl fnbody + { + $$ = $2; + if $$ == nil { + break; + } + if noescape && $3 != nil { + Yyerror("can only use //go:noescape with external func implementations"); + } + $$.Nbody = $3; + $$.Func.Endlineno = lineno; + $$.Noescape = noescape; + $$.Func.Norace = norace; + $$.Func.Nosplit = nosplit; + $$.Func.Nowritebarrier = nowritebarrier; + $$.Func.Systemstack = systemstack; + funcbody($$); + } + +fndcl: + sym '(' oarg_type_list_ocomma ')' fnres + { + var t *Node + + $$ = nil; + $3 = checkarglist($3, 1); + + if $1.Name == "init" { + $1 = renameinit(); + if $3 != nil || $5 != nil { + Yyerror("func init must have no arguments and no return values"); + } + } + if localpkg.Name == "main" && $1.Name == "main" { + if $3 != nil || $5 != nil { + Yyerror("func main must have no arguments and no return values"); + } + } + + t = Nod(OTFUNC, nil, nil); + t.List = $3; + t.Rlist = $5; + + $$ = Nod(ODCLFUNC, nil, nil); + $$.Func.Nname = newfuncname($1); + $$.Func.Nname.Name.Defn = $$; + $$.Func.Nname.Name.Param.Ntype = t; // TODO: check if nname already has an ntype + declare($$.Func.Nname, PFUNC); + + funchdr($$); + } +| '(' oarg_type_list_ocomma ')' sym '(' oarg_type_list_ocomma ')' fnres + { + var rcvr, t *Node + + $$ = nil; + $2 = checkarglist($2, 0); + $6 = checkarglist($6, 1); + + if $2 == nil { + Yyerror("method has no receiver"); + break; + } + if $2.Next != nil { + Yyerror("method has multiple receivers"); + break; + } + rcvr = $2.N; + if rcvr.Op != ODCLFIELD { + Yyerror("bad receiver in method"); + break; + } + + t = Nod(OTFUNC, rcvr, nil); + t.List = $6; + t.Rlist = $8; + + $$ = Nod(ODCLFUNC, nil, nil); + $$.Func.Shortname = newfuncname($4); + $$.Func.Nname = methodname1($$.Func.Shortname, rcvr.Right); + $$.Func.Nname.Name.Defn = $$; + $$.Func.Nname.Name.Param.Ntype = t; + $$.Func.Nname.Nointerface = nointerface; + declare($$.Func.Nname, PFUNC); + + funchdr($$); + } + +hidden_fndcl: + hidden_pkg_importsym '(' ohidden_funarg_list ')' ohidden_funres + { + var s *Sym + var t *Type + + $$ = nil; + + s = $1; + t = functype(nil, $3, $5); + + importsym(s, ONAME); + if s.Def != nil && s.Def.Op == ONAME { + if Eqtype(t, s.Def.Type) { + dclcontext = PDISCARD; // since we skip funchdr below + break; + } + Yyerror("inconsistent definition for func %v during import\n\t%v\n\t%v", s, s.Def.Type, t); + } + + $$ = newfuncname(s); + $$.Type = t; + declare($$, PFUNC); + + funchdr($$); + } +| '(' hidden_funarg_list ')' sym '(' ohidden_funarg_list ')' ohidden_funres + { + $$ = methodname1(newname($4), $2.N.Right); + $$.Type = functype($2.N, $6, $8); + + checkwidth($$.Type); + addmethod($4, $$.Type, false, nointerface); + nointerface = false + funchdr($$); + + // inl.C's inlnode in on a dotmeth node expects to find the inlineable body as + // (dotmeth's type).Nname.Inl, and dotmeth's type has been pulled + // out by typecheck's lookdot as this $$.ttype. So by providing + // this back link here we avoid special casing there. + $$.Type.Nname = $$; + } + +fntype: + LFUNC '(' oarg_type_list_ocomma ')' fnres + { + $3 = checkarglist($3, 1); + $$ = Nod(OTFUNC, nil, nil); + $$.List = $3; + $$.Rlist = $5; + } + +fnbody: + { + $$ = nil; + } +| '{' stmt_list '}' + { + $$ = $2; + if $$ == nil { + $$ = list1(Nod(OEMPTY, nil, nil)); + } + } + +fnres: + %prec NotParen + { + $$ = nil; + } +| fnret_type + { + $$ = list1(Nod(ODCLFIELD, nil, $1)); + } +| '(' oarg_type_list_ocomma ')' + { + $2 = checkarglist($2, 0); + $$ = $2; + } + +fnlitdcl: + fntype + { + closurehdr($1); + } + +fnliteral: + fnlitdcl lbrace stmt_list '}' + { + $$ = closurebody($3); + fixlbrace($2); + } +| fnlitdcl error + { + $$ = closurebody(nil); + } + +/* + * lists of things + * note that they are left recursive + * to conserve yacc stack. they need to + * be reversed to interpret correctly + */ +xdcl_list: + { + $$ = nil; + } +| xdcl_list xdcl ';' + { + $$ = concat($1, $2); + if nsyntaxerrors == 0 { + testdclstack(); + } + nointerface = false + noescape = false + norace = false + nosplit = false + nowritebarrier = false + systemstack = false + } + +vardcl_list: + vardcl +| vardcl_list ';' vardcl + { + $$ = concat($1, $3); + } + +constdcl_list: + constdcl1 +| constdcl_list ';' constdcl1 + { + $$ = concat($1, $3); + } + +typedcl_list: + typedcl + { + $$ = list1($1); + } +| typedcl_list ';' typedcl + { + $$ = list($1, $3); + } + +structdcl_list: + structdcl +| structdcl_list ';' structdcl + { + $$ = concat($1, $3); + } + +interfacedcl_list: + interfacedcl + { + $$ = list1($1); + } +| interfacedcl_list ';' interfacedcl + { + $$ = list($1, $3); + } + +structdcl: + new_name_list ntype oliteral + { + var l *NodeList + + var n *Node + l = $1; + if l == nil || l.N.Sym.Name == "?" { + // ? symbol, during import (list1(nil) == nil) + n = $2; + if n.Op == OIND { + n = n.Left; + } + n = embedded(n.Sym, importpkg); + n.Right = $2; + n.SetVal($3) + $$ = list1(n); + break; + } + + for l=$1; l != nil; l=l.Next { + l.N = Nod(ODCLFIELD, l.N, $2); + l.N.SetVal($3) + } + } +| embed oliteral + { + $1.SetVal($2) + $$ = list1($1); + } +| '(' embed ')' oliteral + { + $2.SetVal($4) + $$ = list1($2); + Yyerror("cannot parenthesize embedded type"); + } +| '*' embed oliteral + { + $2.Right = Nod(OIND, $2.Right, nil); + $2.SetVal($3) + $$ = list1($2); + } +| '(' '*' embed ')' oliteral + { + $3.Right = Nod(OIND, $3.Right, nil); + $3.SetVal($5) + $$ = list1($3); + Yyerror("cannot parenthesize embedded type"); + } +| '*' '(' embed ')' oliteral + { + $3.Right = Nod(OIND, $3.Right, nil); + $3.SetVal($5) + $$ = list1($3); + Yyerror("cannot parenthesize embedded type"); + } + +packname: + LNAME + { + var n *Node + + $$ = $1; + n = oldname($1); + if n.Name != nil && n.Name.Pack != nil { + n.Name.Pack.Used = true; + } + } +| LNAME '.' sym + { + var pkg *Pkg + + if $1.Def == nil || $1.Def.Op != OPACK { + Yyerror("%v is not a package", $1); + pkg = localpkg; + } else { + $1.Def.Used = true; + pkg = $1.Def.Name.Pkg; + } + $$ = restrictlookup($3.Name, pkg); + } + +embed: + packname + { + $$ = embedded($1, localpkg); + } + +interfacedcl: + new_name indcl + { + $$ = Nod(ODCLFIELD, $1, $2); + ifacedcl($$); + } +| packname + { + $$ = Nod(ODCLFIELD, nil, oldname($1)); + } +| '(' packname ')' + { + $$ = Nod(ODCLFIELD, nil, oldname($2)); + Yyerror("cannot parenthesize embedded type"); + } + +indcl: + '(' oarg_type_list_ocomma ')' fnres + { + // without func keyword + $2 = checkarglist($2, 1); + $$ = Nod(OTFUNC, fakethis(), nil); + $$.List = $2; + $$.Rlist = $4; + } + +/* + * function arguments. + */ +arg_type: + name_or_type +| sym name_or_type + { + $$ = Nod(ONONAME, nil, nil); + $$.Sym = $1; + $$ = Nod(OKEY, $$, $2); + } +| sym dotdotdot + { + $$ = Nod(ONONAME, nil, nil); + $$.Sym = $1; + $$ = Nod(OKEY, $$, $2); + } +| dotdotdot + +arg_type_list: + arg_type + { + $$ = list1($1); + } +| arg_type_list ',' arg_type + { + $$ = list($1, $3); + } + +oarg_type_list_ocomma: + { + $$ = nil; + } +| arg_type_list ocomma + { + $$ = $1; + } + +/* + * statement + */ +stmt: + { + $$ = nil; + } +| compound_stmt +| common_dcl + { + $$ = liststmt($1); + } +| non_dcl_stmt +| error + { + $$ = nil; + } + +non_dcl_stmt: + simple_stmt +| for_stmt +| switch_stmt +| select_stmt +| if_stmt +| labelname ':' + { + $1 = Nod(OLABEL, $1, nil); + $1.Sym = dclstack; // context, for goto restrictions + } + stmt + { + var l *NodeList + + $1.Name.Defn = $4; + l = list1($1); + if $4 != nil { + l = list(l, $4); + } + $$ = liststmt(l); + } +| LFALL + { + // will be converted to OFALL + $$ = Nod(OXFALL, nil, nil); + $$.Xoffset = int64(block); + } +| LBREAK onew_name + { + $$ = Nod(OBREAK, $2, nil); + } +| LCONTINUE onew_name + { + $$ = Nod(OCONTINUE, $2, nil); + } +| LGO pseudocall + { + $$ = Nod(OPROC, $2, nil); + } +| LDEFER pseudocall + { + $$ = Nod(ODEFER, $2, nil); + } +| LGOTO new_name + { + $$ = Nod(OGOTO, $2, nil); + $$.Sym = dclstack; // context, for goto restrictions + } +| LRETURN oexpr_list + { + $$ = Nod(ORETURN, nil, nil); + $$.List = $2; + if $$.List == nil && Curfn != nil { + var l *NodeList + + for l=Curfn.Func.Dcl; l != nil; l=l.Next { + if l.N.Class == PPARAM { + continue; + } + if l.N.Class != PPARAMOUT { + break; + } + if l.N.Sym.Def != l.N { + Yyerror("%s is shadowed during return", l.N.Sym.Name); + } + } + } + } + +stmt_list: + stmt + { + $$ = nil; + if $1 != nil { + $$ = list1($1); + } + } +| stmt_list ';' stmt + { + $$ = $1; + if $3 != nil { + $$ = list($$, $3); + } + } + +new_name_list: + new_name + { + $$ = list1($1); + } +| new_name_list ',' new_name + { + $$ = list($1, $3); + } + +dcl_name_list: + dcl_name + { + $$ = list1($1); + } +| dcl_name_list ',' dcl_name + { + $$ = list($1, $3); + } + +expr_list: + expr + { + $$ = list1($1); + } +| expr_list ',' expr + { + $$ = list($1, $3); + } + +expr_or_type_list: + expr_or_type + { + $$ = list1($1); + } +| expr_or_type_list ',' expr_or_type + { + $$ = list($1, $3); + } + +/* + * list of combo of keyval and val + */ +keyval_list: + keyval + { + $$ = list1($1); + } +| bare_complitexpr + { + $$ = list1($1); + } +| keyval_list ',' keyval + { + $$ = list($1, $3); + } +| keyval_list ',' bare_complitexpr + { + $$ = list($1, $3); + } + +braced_keyval_list: + { + $$ = nil; + } +| keyval_list ocomma + { + $$ = $1; + } + +/* + * optional things + */ +osemi: +| ';' + +ocomma: +| ',' + +oexpr: + { + $$ = nil; + } +| expr + +oexpr_list: + { + $$ = nil; + } +| expr_list + +osimple_stmt: + { + $$ = nil; + } +| simple_stmt + +ohidden_funarg_list: + { + $$ = nil; + } +| hidden_funarg_list + +ohidden_structdcl_list: + { + $$ = nil; + } +| hidden_structdcl_list + +ohidden_interfacedcl_list: + { + $$ = nil; + } +| hidden_interfacedcl_list + +oliteral: + { + $$.U = nil + } +| LLITERAL + +/* + * import syntax from package header + */ +hidden_import: + LIMPORT LNAME LLITERAL ';' + { + importimport($2, $3.U.(string)); + } +| LVAR hidden_pkg_importsym hidden_type ';' + { + importvar($2, $3); + } +| LCONST hidden_pkg_importsym '=' hidden_constant ';' + { + importconst($2, Types[TIDEAL], $4); + } +| LCONST hidden_pkg_importsym hidden_type '=' hidden_constant ';' + { + importconst($2, $3, $5); + } +| LTYPE hidden_pkgtype hidden_type ';' + { + importtype($2, $3); + } +| LFUNC hidden_fndcl fnbody ';' + { + if $2 == nil { + dclcontext = PEXTERN; // since we skip the funcbody below + break; + } + + $2.Func.Inl = $3; + + funcbody($2); + importlist = list(importlist, $2); + + if Debug['E'] > 0 { + fmt.Printf("import [%q] func %v \n", importpkg.Path, $2) + if Debug['m'] > 2 && $2.Func.Inl != nil { + fmt.Printf("inl body:%v\n", $2.Func.Inl) + } + } + } + +hidden_pkg_importsym: + hidden_importsym + { + $$ = $1; + structpkg = $$.Pkg; + } + +hidden_pkgtype: + hidden_pkg_importsym + { + $$ = pkgtype($1); + importsym($1, OTYPE); + } + +/* + * importing types + */ + +hidden_type: + hidden_type_misc +| hidden_type_recv_chan +| hidden_type_func + +hidden_type_non_recv_chan: + hidden_type_misc +| hidden_type_func + +hidden_type_misc: + hidden_importsym + { + $$ = pkgtype($1); + } +| LNAME + { + // predefined name like uint8 + $1 = Pkglookup($1.Name, builtinpkg); + if $1.Def == nil || $1.Def.Op != OTYPE { + Yyerror("%s is not a type", $1.Name); + $$ = nil; + } else { + $$ = $1.Def.Type; + } + } +| '[' ']' hidden_type + { + $$ = aindex(nil, $3); + } +| '[' LLITERAL ']' hidden_type + { + $$ = aindex(nodlit($2), $4); + } +| LMAP '[' hidden_type ']' hidden_type + { + $$ = maptype($3, $5); + } +| LSTRUCT '{' ohidden_structdcl_list '}' + { + $$ = tostruct($3); + } +| LINTERFACE '{' ohidden_interfacedcl_list '}' + { + $$ = tointerface($3); + } +| '*' hidden_type + { + $$ = Ptrto($2); + } +| LCHAN hidden_type_non_recv_chan + { + $$ = typ(TCHAN); + $$.Type = $2; + $$.Chan = Cboth; + } +| LCHAN '(' hidden_type_recv_chan ')' + { + $$ = typ(TCHAN); + $$.Type = $3; + $$.Chan = Cboth; + } +| LCHAN LCOMM hidden_type + { + $$ = typ(TCHAN); + $$.Type = $3; + $$.Chan = Csend; + } + +hidden_type_recv_chan: + LCOMM LCHAN hidden_type + { + $$ = typ(TCHAN); + $$.Type = $3; + $$.Chan = Crecv; + } + +hidden_type_func: + LFUNC '(' ohidden_funarg_list ')' ohidden_funres + { + $$ = functype(nil, $3, $5); + } + +hidden_funarg: + sym hidden_type oliteral + { + $$ = Nod(ODCLFIELD, nil, typenod($2)); + if $1 != nil { + $$.Left = newname($1); + } + $$.SetVal($3) + } +| sym LDDD hidden_type oliteral + { + var t *Type + + t = typ(TARRAY); + t.Bound = -1; + t.Type = $3; + + $$ = Nod(ODCLFIELD, nil, typenod(t)); + if $1 != nil { + $$.Left = newname($1); + } + $$.Isddd = true; + $$.SetVal($4) + } + +hidden_structdcl: + sym hidden_type oliteral + { + var s *Sym + var p *Pkg + + if $1 != nil && $1.Name != "?" { + $$ = Nod(ODCLFIELD, newname($1), typenod($2)); + $$.SetVal($3) + } else { + s = $2.Sym; + if s == nil && Isptr[$2.Etype] { + s = $2.Type.Sym; + } + p = importpkg; + if $1 != nil { + p = $1.Pkg; + } + $$ = embedded(s, p); + $$.Right = typenod($2); + $$.SetVal($3) + } + } + +hidden_interfacedcl: + sym '(' ohidden_funarg_list ')' ohidden_funres + { + $$ = Nod(ODCLFIELD, newname($1), typenod(functype(fakethis(), $3, $5))); + } +| hidden_type + { + $$ = Nod(ODCLFIELD, nil, typenod($1)); + } + +ohidden_funres: + { + $$ = nil; + } +| hidden_funres + +hidden_funres: + '(' ohidden_funarg_list ')' + { + $$ = $2; + } +| hidden_type + { + $$ = list1(Nod(ODCLFIELD, nil, typenod($1))); + } + +/* + * importing constants + */ + +hidden_literal: + LLITERAL + { + $$ = nodlit($1); + } +| '-' LLITERAL + { + $$ = nodlit($2); + switch($$.Val().Ctype()){ + case CTINT, CTRUNE: + mpnegfix($$.Val().U.(*Mpint)); + break; + case CTFLT: + mpnegflt($$.Val().U.(*Mpflt)); + break; + case CTCPLX: + mpnegflt(&$$.Val().U.(*Mpcplx).Real); + mpnegflt(&$$.Val().U.(*Mpcplx).Imag); + break; + default: + Yyerror("bad negated constant"); + } + } +| sym + { + $$ = oldname(Pkglookup($1.Name, builtinpkg)); + if $$.Op != OLITERAL { + Yyerror("bad constant %v", $$.Sym); + } + } + +hidden_constant: + hidden_literal +| '(' hidden_literal '+' hidden_literal ')' + { + if $2.Val().Ctype() == CTRUNE && $4.Val().Ctype() == CTINT { + $$ = $2; + mpaddfixfix($2.Val().U.(*Mpint), $4.Val().U.(*Mpint), 0); + break; + } + $4.Val().U.(*Mpcplx).Real = $4.Val().U.(*Mpcplx).Imag; + Mpmovecflt(&$4.Val().U.(*Mpcplx).Imag, 0.0); + $$ = nodcplxlit($2.Val(), $4.Val()); + } + +hidden_import_list: +| hidden_import_list hidden_import + +hidden_funarg_list: + hidden_funarg + { + $$ = list1($1); + } +| hidden_funarg_list ',' hidden_funarg + { + $$ = list($1, $3); + } + +hidden_structdcl_list: + hidden_structdcl + { + $$ = list1($1); + } +| hidden_structdcl_list ';' hidden_structdcl + { + $$ = list($1, $3); + } + +hidden_interfacedcl_list: + hidden_interfacedcl + { + $$ = list1($1); + } +| hidden_interfacedcl_list ';' hidden_interfacedcl + { + $$ = list($1, $3); + } + +%% +func fixlbrace(lbr int) { + // If the opening brace was an LBODY, + // set up for another one now that we're done. + // See comment in lex.C about loophack. + if lbr == LBODY { + loophack = 1 + } +} diff --git a/src/cmd/compile/internal/gc/gsubr.go b/src/cmd/compile/internal/gc/gsubr.go new file mode 100644 index 0000000000000000000000000000000000000000..2c575f3d789a21b47379d15fb5fededde903f5fe --- /dev/null +++ b/src/cmd/compile/internal/gc/gsubr.go @@ -0,0 +1,836 @@ +// Derived from Inferno utils/6c/txt.c +// http://code.google.com/p/inferno-os/source/browse/utils/6c/txt.c +// +// Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved. +// Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net) +// Portions Copyright © 1997-1999 Vita Nuova Limited +// Portions Copyright © 2000-2007 Vita Nuova Holdings Limited (www.vitanuova.com) +// Portions Copyright © 2004,2006 Bruce Ellis +// Portions Copyright © 2005-2007 C H Forsyth (forsyth@terzarima.net) +// Revisions Copyright © 2000-2007 Lucent Technologies Inc. and others +// Portions Copyright © 2009 The Go Authors. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +package gc + +import ( + "cmd/internal/obj" + "fmt" + "runtime" + "strings" +) + +var ddumped int + +var dfirst *obj.Prog + +var dpc *obj.Prog + +/* + * Is this node a memory operand? + */ +func Ismem(n *Node) bool { + switch n.Op { + case OITAB, + OSPTR, + OLEN, + OCAP, + OINDREG, + ONAME, + OPARAM, + OCLOSUREVAR: + return true + + case OADDR: + return Thearch.Thechar == '6' || Thearch.Thechar == '9' // because 6g uses PC-relative addressing; TODO(rsc): not sure why 9g too + } + + return false +} + +func Samereg(a *Node, b *Node) bool { + if a == nil || b == nil { + return false + } + if a.Op != OREGISTER { + return false + } + if b.Op != OREGISTER { + return false + } + if a.Reg != b.Reg { + return false + } + return true +} + +func Gbranch(as int, t *Type, likely int) *obj.Prog { + p := Prog(as) + p.To.Type = obj.TYPE_BRANCH + p.To.Val = nil + if as != obj.AJMP && likely != 0 && Thearch.Thechar != '9' && Thearch.Thechar != '7' { + p.From.Type = obj.TYPE_CONST + p.From.Offset = int64(obj.Bool2int(likely > 0)) + } + + if Debug['g'] != 0 { + fmt.Printf("%v\n", p) + } + + return p +} + +func Prog(as int) *obj.Prog { + var p *obj.Prog + + if as == obj.ADATA || as == obj.AGLOBL { + if ddumped != 0 { + Fatal("already dumped data") + } + if dpc == nil { + dpc = Ctxt.NewProg() + dfirst = dpc + } + + p = dpc + dpc = Ctxt.NewProg() + p.Link = dpc + } else { + p = Pc + Pc = Ctxt.NewProg() + Clearp(Pc) + p.Link = Pc + } + + if lineno == 0 { + if Debug['K'] != 0 { + Warn("prog: line 0") + } + } + + p.As = int16(as) + p.Lineno = lineno + return p +} + +func Nodreg(n *Node, t *Type, r int) { + if t == nil { + Fatal("nodreg: t nil") + } + + *n = Node{} + n.Op = OREGISTER + n.Addable = true + ullmancalc(n) + n.Reg = int16(r) + n.Type = t +} + +func Nodindreg(n *Node, t *Type, r int) { + Nodreg(n, t, r) + n.Op = OINDREG +} + +func Afunclit(a *obj.Addr, n *Node) { + if a.Type == obj.TYPE_ADDR && a.Name == obj.NAME_EXTERN { + a.Type = obj.TYPE_MEM + a.Sym = Linksym(n.Sym) + } +} + +func Clearp(p *obj.Prog) { + obj.Nopout(p) + p.As = obj.AEND + p.Pc = int64(pcloc) + pcloc++ +} + +func dumpdata() { + ddumped = 1 + if dfirst == nil { + return + } + newplist() + *Pc = *dfirst + Pc = dpc + Clearp(Pc) +} + +// Fixup instructions after allocauto (formerly compactframe) has moved all autos around. +func fixautoused(p *obj.Prog) { + for lp := &p; ; { + p = *lp + if p == nil { + break + } + if p.As == obj.ATYPE && p.From.Node != nil && p.From.Name == obj.NAME_AUTO && !((p.From.Node).(*Node)).Used { + *lp = p.Link + continue + } + + if (p.As == obj.AVARDEF || p.As == obj.AVARKILL) && p.To.Node != nil && !((p.To.Node).(*Node)).Used { + // Cannot remove VARDEF instruction, because - unlike TYPE handled above - + // VARDEFs are interspersed with other code, and a jump might be using the + // VARDEF as a target. Replace with a no-op instead. A later pass will remove + // the no-ops. + obj.Nopout(p) + + continue + } + + if p.From.Name == obj.NAME_AUTO && p.From.Node != nil { + p.From.Offset += stkdelta[p.From.Node.(*Node)] + } + + if p.To.Name == obj.NAME_AUTO && p.To.Node != nil { + p.To.Offset += stkdelta[p.To.Node.(*Node)] + } + + lp = &p.Link + } +} + +func ggloblnod(nam *Node) { + p := Thearch.Gins(obj.AGLOBL, nam, nil) + p.Lineno = nam.Lineno + p.From.Sym.Gotype = Linksym(ngotype(nam)) + p.To.Sym = nil + p.To.Type = obj.TYPE_CONST + p.To.Offset = nam.Type.Width + p.From3 = new(obj.Addr) + if nam.Name.Readonly { + p.From3.Offset = obj.RODATA + } + if nam.Type != nil && !haspointers(nam.Type) { + p.From3.Offset |= obj.NOPTR + } +} + +func ggloblsym(s *Sym, width int32, flags int16) { + p := Thearch.Gins(obj.AGLOBL, nil, nil) + p.From.Type = obj.TYPE_MEM + p.From.Name = obj.NAME_EXTERN + p.From.Sym = Linksym(s) + if flags&obj.LOCAL != 0 { + p.From.Sym.Local = true + flags &= ^obj.LOCAL + } + p.To.Type = obj.TYPE_CONST + p.To.Offset = int64(width) + p.From3 = new(obj.Addr) + p.From3.Offset = int64(flags) +} + +func gjmp(to *obj.Prog) *obj.Prog { + p := Gbranch(obj.AJMP, nil, 0) + if to != nil { + Patch(p, to) + } + return p +} + +func gtrack(s *Sym) { + p := Thearch.Gins(obj.AUSEFIELD, nil, nil) + p.From.Type = obj.TYPE_MEM + p.From.Name = obj.NAME_EXTERN + p.From.Sym = Linksym(s) +} + +func gused(n *Node) { + Thearch.Gins(obj.ANOP, n, nil) // used +} + +func Isfat(t *Type) bool { + if t != nil { + switch t.Etype { + case TSTRUCT, TARRAY, TSTRING, + TINTER: // maybe remove later + return true + } + } + + return false +} + +// Sweep the prog list to mark any used nodes. +func markautoused(p *obj.Prog) { + for ; p != nil; p = p.Link { + if p.As == obj.ATYPE || p.As == obj.AVARDEF || p.As == obj.AVARKILL { + continue + } + + if p.From.Node != nil { + ((p.From.Node).(*Node)).Used = true + } + + if p.To.Node != nil { + ((p.To.Node).(*Node)).Used = true + } + } +} + +// Naddr rewrites a to refer to n. +// It assumes that a is zeroed on entry. +func Naddr(a *obj.Addr, n *Node) { + if n == nil { + return + } + + if n.Type != nil && n.Type.Etype != TIDEAL { + // TODO(rsc): This is undone by the selective clearing of width below, + // to match architectures that were not as aggressive in setting width + // during naddr. Those widths must be cleared to avoid triggering + // failures in gins when it detects real but heretofore latent (and one + // hopes innocuous) type mismatches. + // The type mismatches should be fixed and the clearing below removed. + dowidth(n.Type) + + a.Width = n.Type.Width + } + + switch n.Op { + default: + a := a // copy to let escape into Ctxt.Dconv + Debug['h'] = 1 + Dump("naddr", n) + Fatal("naddr: bad %v %v", Oconv(int(n.Op), 0), Ctxt.Dconv(a)) + + case OREGISTER: + a.Type = obj.TYPE_REG + a.Reg = n.Reg + a.Sym = nil + if Thearch.Thechar == '8' { // TODO(rsc): Never clear a->width. + a.Width = 0 + } + + case OINDREG: + a.Type = obj.TYPE_MEM + a.Reg = n.Reg + a.Sym = Linksym(n.Sym) + a.Offset = n.Xoffset + if a.Offset != int64(int32(a.Offset)) { + Yyerror("offset %d too large for OINDREG", a.Offset) + } + if Thearch.Thechar == '8' { // TODO(rsc): Never clear a->width. + a.Width = 0 + } + + // n->left is PHEAP ONAME for stack parameter. + // compute address of actual parameter on stack. + case OPARAM: + a.Etype = Simtype[n.Left.Type.Etype] + + a.Width = n.Left.Type.Width + a.Offset = n.Xoffset + a.Sym = Linksym(n.Left.Sym) + a.Type = obj.TYPE_MEM + a.Name = obj.NAME_PARAM + a.Node = n.Left.Orig + + case OCLOSUREVAR: + if !Curfn.Func.Needctxt { + Fatal("closurevar without needctxt") + } + a.Type = obj.TYPE_MEM + a.Reg = int16(Thearch.REGCTXT) + a.Sym = nil + a.Offset = n.Xoffset + + case OCFUNC: + Naddr(a, n.Left) + a.Sym = Linksym(n.Left.Sym) + + case ONAME: + a.Etype = 0 + if n.Type != nil { + a.Etype = Simtype[n.Type.Etype] + } + a.Offset = n.Xoffset + s := n.Sym + a.Node = n.Orig + + //if(a->node >= (Node*)&n) + // fatal("stack node"); + if s == nil { + s = Lookup(".noname") + } + if n.Name.Method { + if n.Type != nil { + if n.Type.Sym != nil { + if n.Type.Sym.Pkg != nil { + s = Pkglookup(s.Name, n.Type.Sym.Pkg) + } + } + } + } + + a.Type = obj.TYPE_MEM + switch n.Class { + default: + Fatal("naddr: ONAME class %v %d\n", n.Sym, n.Class) + + case PEXTERN: + a.Name = obj.NAME_EXTERN + + case PAUTO: + a.Name = obj.NAME_AUTO + + case PPARAM, PPARAMOUT: + a.Name = obj.NAME_PARAM + + case PFUNC: + a.Name = obj.NAME_EXTERN + a.Type = obj.TYPE_ADDR + a.Width = int64(Widthptr) + s = funcsym(s) + } + + a.Sym = Linksym(s) + + case OLITERAL: + if Thearch.Thechar == '8' { + a.Width = 0 + } + switch n.Val().Ctype() { + default: + Fatal("naddr: const %v", Tconv(n.Type, obj.FmtLong)) + + case CTFLT: + a.Type = obj.TYPE_FCONST + a.Val = mpgetflt(n.Val().U.(*Mpflt)) + + case CTINT, CTRUNE: + a.Sym = nil + a.Type = obj.TYPE_CONST + a.Offset = Mpgetfix(n.Val().U.(*Mpint)) + + case CTSTR: + datagostring(n.Val().U.(string), a) + + case CTBOOL: + a.Sym = nil + a.Type = obj.TYPE_CONST + a.Offset = int64(obj.Bool2int(n.Val().U.(bool))) + + case CTNIL: + a.Sym = nil + a.Type = obj.TYPE_CONST + a.Offset = 0 + } + + case OADDR: + Naddr(a, n.Left) + a.Etype = uint8(Tptr) + if Thearch.Thechar != '5' && Thearch.Thechar != '7' && Thearch.Thechar != '9' { // TODO(rsc): Do this even for arm, ppc64. + a.Width = int64(Widthptr) + } + if a.Type != obj.TYPE_MEM { + a := a // copy to let escape into Ctxt.Dconv + Fatal("naddr: OADDR %v (from %v)", Ctxt.Dconv(a), Oconv(int(n.Left.Op), 0)) + } + a.Type = obj.TYPE_ADDR + + // itable of interface value + case OITAB: + Naddr(a, n.Left) + + if a.Type == obj.TYPE_CONST && a.Offset == 0 { + break // itab(nil) + } + a.Etype = uint8(Tptr) + a.Width = int64(Widthptr) + + // pointer in a string or slice + case OSPTR: + Naddr(a, n.Left) + + if a.Type == obj.TYPE_CONST && a.Offset == 0 { + break // ptr(nil) + } + a.Etype = Simtype[Tptr] + a.Offset += int64(Array_array) + a.Width = int64(Widthptr) + + // len of string or slice + case OLEN: + Naddr(a, n.Left) + + if a.Type == obj.TYPE_CONST && a.Offset == 0 { + break // len(nil) + } + a.Etype = Simtype[TUINT] + a.Offset += int64(Array_nel) + if Thearch.Thechar != '5' { // TODO(rsc): Do this even on arm. + a.Width = int64(Widthint) + } + + // cap of string or slice + case OCAP: + Naddr(a, n.Left) + + if a.Type == obj.TYPE_CONST && a.Offset == 0 { + break // cap(nil) + } + a.Etype = Simtype[TUINT] + a.Offset += int64(Array_cap) + if Thearch.Thechar != '5' { // TODO(rsc): Do this even on arm. + a.Width = int64(Widthint) + } + } + return +} + +func newplist() *obj.Plist { + pl := obj.Linknewplist(Ctxt) + + Pc = Ctxt.NewProg() + Clearp(Pc) + pl.Firstpc = Pc + + return pl +} + +func nodarg(t *Type, fp int) *Node { + var n *Node + + // entire argument struct, not just one arg + if t.Etype == TSTRUCT && t.Funarg != 0 { + n = Nod(ONAME, nil, nil) + n.Sym = Lookup(".args") + n.Type = t + var savet Iter + first := Structfirst(&savet, &t) + if first == nil { + Fatal("nodarg: bad struct") + } + if first.Width == BADWIDTH { + Fatal("nodarg: offset not computed for %v", t) + } + n.Xoffset = first.Width + n.Addable = true + goto fp + } + + if t.Etype != TFIELD { + Fatal("nodarg: not field %v", t) + } + + if fp == 1 { + var n *Node + for l := Curfn.Func.Dcl; l != nil; l = l.Next { + n = l.N + if (n.Class == PPARAM || n.Class == PPARAMOUT) && !isblanksym(t.Sym) && n.Sym == t.Sym { + return n + } + } + } + + n = Nod(ONAME, nil, nil) + n.Type = t.Type + n.Sym = t.Sym + + if t.Width == BADWIDTH { + Fatal("nodarg: offset not computed for %v", t) + } + n.Xoffset = t.Width + n.Addable = true + n.Orig = t.Nname + + // Rewrite argument named _ to __, + // or else the assignment to _ will be + // discarded during code generation. +fp: + if isblank(n) { + n.Sym = Lookup("__") + } + + switch fp { + case 0: // output arg + n.Op = OINDREG + + n.Reg = int16(Thearch.REGSP) + if HasLinkRegister() { + n.Xoffset += int64(Ctxt.Arch.Ptrsize) + } + + case 1: // input arg + n.Class = PPARAM + + case 2: // offset output arg + Fatal("shouldn't be used") + } + + n.Typecheck = 1 + return n +} + +func Patch(p *obj.Prog, to *obj.Prog) { + if p.To.Type != obj.TYPE_BRANCH { + Fatal("patch: not a branch") + } + p.To.Val = to + p.To.Offset = to.Pc +} + +func unpatch(p *obj.Prog) *obj.Prog { + if p.To.Type != obj.TYPE_BRANCH { + Fatal("unpatch: not a branch") + } + q, _ := p.To.Val.(*obj.Prog) + p.To.Val = nil + p.To.Offset = 0 + return q +} + +var reg [100]int // count of references to reg +var regstk [100][]byte // allocation sites, when -v is given + +func GetReg(r int) int { + return reg[r-Thearch.REGMIN] +} +func SetReg(r, v int) { + reg[r-Thearch.REGMIN] = v +} + +func ginit() { + for r := range reg { + reg[r] = 1 + } + + for r := Thearch.REGMIN; r <= Thearch.REGMAX; r++ { + reg[r-Thearch.REGMIN] = 0 + } + for r := Thearch.FREGMIN; r <= Thearch.FREGMAX; r++ { + reg[r-Thearch.REGMIN] = 0 + } + + for _, r := range Thearch.ReservedRegs { + reg[r-Thearch.REGMIN] = 1 + } +} + +func gclean() { + for _, r := range Thearch.ReservedRegs { + reg[r-Thearch.REGMIN]-- + } + + for r := Thearch.REGMIN; r <= Thearch.REGMAX; r++ { + n := reg[r-Thearch.REGMIN] + if n != 0 { + if Debug['v'] != 0 { + Regdump() + } + Yyerror("reg %v left allocated", obj.Rconv(r)) + } + } + + for r := Thearch.FREGMIN; r <= Thearch.FREGMAX; r++ { + n := reg[r-Thearch.REGMIN] + if n != 0 { + if Debug['v'] != 0 { + Regdump() + } + Yyerror("reg %v left allocated", obj.Rconv(r)) + } + } +} + +func Anyregalloc() bool { + n := 0 + for r := Thearch.REGMIN; r <= Thearch.REGMAX; r++ { + if reg[r-Thearch.REGMIN] == 0 { + n++ + } + } + return n > len(Thearch.ReservedRegs) +} + +/* + * allocate register of type t, leave in n. + * if o != N, o may be reusable register. + * caller must Regfree(n). + */ +func Regalloc(n *Node, t *Type, o *Node) { + if t == nil { + Fatal("regalloc: t nil") + } + et := int(Simtype[t.Etype]) + if Ctxt.Arch.Regsize == 4 && (et == TINT64 || et == TUINT64) { + Fatal("regalloc 64bit") + } + + var i int +Switch: + switch et { + default: + Fatal("regalloc: unknown type %v", t) + + case TINT8, TUINT8, TINT16, TUINT16, TINT32, TUINT32, TINT64, TUINT64, TPTR32, TPTR64, TBOOL: + if o != nil && o.Op == OREGISTER { + i = int(o.Reg) + if Thearch.REGMIN <= i && i <= Thearch.REGMAX { + break Switch + } + } + for i = Thearch.REGMIN; i <= Thearch.REGMAX; i++ { + if reg[i-Thearch.REGMIN] == 0 { + break Switch + } + } + Flusherrors() + Regdump() + Fatal("out of fixed registers") + + case TFLOAT32, TFLOAT64: + if Thearch.Use387 { + i = Thearch.FREGMIN // x86.REG_F0 + break Switch + } + if o != nil && o.Op == OREGISTER { + i = int(o.Reg) + if Thearch.FREGMIN <= i && i <= Thearch.FREGMAX { + break Switch + } + } + for i = Thearch.FREGMIN; i <= Thearch.FREGMAX; i++ { + if reg[i-Thearch.REGMIN] == 0 { // note: REGMIN, not FREGMIN + break Switch + } + } + Flusherrors() + Regdump() + Fatal("out of floating registers") + + case TCOMPLEX64, TCOMPLEX128: + Tempname(n, t) + return + } + + ix := i - Thearch.REGMIN + if reg[ix] == 0 && Debug['v'] > 0 { + if regstk[ix] == nil { + regstk[ix] = make([]byte, 4096) + } + stk := regstk[ix] + n := runtime.Stack(stk[:cap(stk)], false) + regstk[ix] = stk[:n] + } + reg[ix]++ + Nodreg(n, t, i) +} + +func Regfree(n *Node) { + if n.Op == ONAME { + return + } + if n.Op != OREGISTER && n.Op != OINDREG { + Fatal("regfree: not a register") + } + i := int(n.Reg) + if i == Thearch.REGSP { + return + } + switch { + case Thearch.REGMIN <= i && i <= Thearch.REGMAX, + Thearch.FREGMIN <= i && i <= Thearch.FREGMAX: + // ok + default: + Fatal("regfree: reg out of range") + } + + i -= Thearch.REGMIN + if reg[i] <= 0 { + Fatal("regfree: reg not allocated") + } + reg[i]-- + if reg[i] == 0 { + regstk[i] = regstk[i][:0] + } +} + +// Reginuse reports whether r is in use. +func Reginuse(r int) bool { + switch { + case Thearch.REGMIN <= r && r <= Thearch.REGMAX, + Thearch.FREGMIN <= r && r <= Thearch.FREGMAX: + // ok + default: + Fatal("reginuse: reg out of range") + } + + return reg[r-Thearch.REGMIN] > 0 +} + +// Regrealloc(n) undoes the effect of Regfree(n), +// so that a register can be given up but then reclaimed. +func Regrealloc(n *Node) { + if n.Op != OREGISTER && n.Op != OINDREG { + Fatal("regrealloc: not a register") + } + i := int(n.Reg) + if i == Thearch.REGSP { + return + } + switch { + case Thearch.REGMIN <= i && i <= Thearch.REGMAX, + Thearch.FREGMIN <= i && i <= Thearch.FREGMAX: + // ok + default: + Fatal("regrealloc: reg out of range") + } + + i -= Thearch.REGMIN + if reg[i] == 0 && Debug['v'] > 0 { + if regstk[i] == nil { + regstk[i] = make([]byte, 4096) + } + stk := regstk[i] + n := runtime.Stack(stk[:cap(stk)], false) + regstk[i] = stk[:n] + } + reg[i]++ +} + +func Regdump() { + if Debug['v'] == 0 { + fmt.Printf("run compiler with -v for register allocation sites\n") + return + } + + dump := func(r int) { + stk := regstk[r-Thearch.REGMIN] + if len(stk) == 0 { + return + } + fmt.Printf("reg %v allocated at:\n", obj.Rconv(r)) + fmt.Printf("\t%s\n", strings.Replace(strings.TrimSpace(string(stk)), "\n", "\n\t", -1)) + } + + for r := Thearch.REGMIN; r <= Thearch.REGMAX; r++ { + if reg[r-Thearch.REGMIN] != 0 { + dump(r) + } + } + for r := Thearch.FREGMIN; r <= Thearch.FREGMAX; r++ { + if reg[r-Thearch.REGMIN] == 0 { + dump(r) + } + } +} diff --git a/src/cmd/compile/internal/gc/init.go b/src/cmd/compile/internal/gc/init.go new file mode 100644 index 0000000000000000000000000000000000000000..5fbc82dd38305d39252151ca2c1493cf3c0f1625 --- /dev/null +++ b/src/cmd/compile/internal/gc/init.go @@ -0,0 +1,189 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package gc + +// case OADD: +// if(n->right->op == OLITERAL) { +// v = n->right->vconst; +// naddr(n->left, a, canemitcode); +// } else +// if(n->left->op == OLITERAL) { +// v = n->left->vconst; +// naddr(n->right, a, canemitcode); +// } else +// goto bad; +// a->offset += v; +// break; + +/* + * a function named init is a special case. + * it is called by the initialization before + * main is run. to make it unique within a + * package and also uncallable, the name, + * normally "pkg.init", is altered to "pkg.init.1". + */ + +var renameinit_initgen int + +func renameinit() *Sym { + renameinit_initgen++ + return Lookupf("init.%d", renameinit_initgen) +} + +/* + * hand-craft the following initialization code + * var initdone· uint8 (1) + * func init() (2) + * if initdone· != 0 { (3) + * if initdone· == 2 (4) + * return + * throw(); (5) + * } + * initdone· = 1; (6) + * // over all matching imported symbols + * .init() (7) + * { } (8) + * init.() // if any (9) + * initdone· = 2; (10) + * return (11) + * } + */ +func anyinit(n *NodeList) bool { + // are there any interesting init statements + for l := n; l != nil; l = l.Next { + switch l.N.Op { + case ODCLFUNC, ODCLCONST, ODCLTYPE, OEMPTY: + break + + case OAS, OASWB: + if isblank(l.N.Left) && candiscard(l.N.Right) { + break + } + fallthrough + + // fall through + default: + return true + } + } + + // is this main + if localpkg.Name == "main" { + return true + } + + // is there an explicit init function + s := Lookup("init.1") + + if s.Def != nil { + return true + } + + // are there any imported init functions + for _, s := range initSyms { + if s.Def != nil { + return true + } + } + + // then none + return false +} + +func fninit(n *NodeList) { + if Debug['A'] != 0 { + // sys.go or unsafe.go during compiler build + return + } + + n = initfix(n) + if !anyinit(n) { + return + } + + var r *NodeList + + // (1) + gatevar := newname(Lookup("initdone·")) + addvar(gatevar, Types[TUINT8], PEXTERN) + + // (2) + Maxarg = 0 + + fn := Nod(ODCLFUNC, nil, nil) + initsym := Lookup("init") + fn.Func.Nname = newname(initsym) + fn.Func.Nname.Name.Defn = fn + fn.Func.Nname.Name.Param.Ntype = Nod(OTFUNC, nil, nil) + declare(fn.Func.Nname, PFUNC) + funchdr(fn) + + // (3) + a := Nod(OIF, nil, nil) + + a.Left = Nod(ONE, gatevar, Nodintconst(0)) + r = list(r, a) + + // (4) + b := Nod(OIF, nil, nil) + + b.Left = Nod(OEQ, gatevar, Nodintconst(2)) + b.Nbody = list1(Nod(ORETURN, nil, nil)) + a.Nbody = list1(b) + + // (5) + b = syslook("throwinit", 0) + + b = Nod(OCALL, b, nil) + a.Nbody = list(a.Nbody, b) + + // (6) + a = Nod(OAS, gatevar, Nodintconst(1)) + + r = list(r, a) + + // (7) + for _, s := range initSyms { + if s.Def != nil && s != initsym { + // could check that it is fn of no args/returns + a = Nod(OCALL, s.Def, nil) + r = list(r, a) + } + } + + // (8) + r = concat(r, n) + + // (9) + // could check that it is fn of no args/returns + for i := 1; ; i++ { + s := Lookupf("init.%d", i) + if s.Def == nil { + break + } + a = Nod(OCALL, s.Def, nil) + r = list(r, a) + } + + // (10) + a = Nod(OAS, gatevar, Nodintconst(2)) + + r = list(r, a) + + // (11) + a = Nod(ORETURN, nil, nil) + + r = list(r, a) + exportsym(fn.Func.Nname) + + fn.Nbody = r + funcbody(fn) + + Curfn = fn + typecheck(&fn, Etop) + typechecklist(r, Etop) + Curfn = nil + funccompile(fn) +} diff --git a/src/cmd/compile/internal/gc/inl.go b/src/cmd/compile/internal/gc/inl.go new file mode 100644 index 0000000000000000000000000000000000000000..b2eeeed315ef114c89d7a7ab8ba71cc650f21a6e --- /dev/null +++ b/src/cmd/compile/internal/gc/inl.go @@ -0,0 +1,995 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. +// +// The inlining facility makes 2 passes: first caninl determines which +// functions are suitable for inlining, and for those that are it +// saves a copy of the body. Then inlcalls walks each function body to +// expand calls to inlinable functions. +// +// The debug['l'] flag controls the agressiveness. Note that main() swaps level 0 and 1, +// making 1 the default and -l disable. -ll and more is useful to flush out bugs. +// These additional levels (beyond -l) may be buggy and are not supported. +// 0: disabled +// 1: 40-nodes leaf functions, oneliners, lazy typechecking (default) +// 2: early typechecking of all imported bodies +// 3: allow variadic functions +// 4: allow non-leaf functions , (breaks runtime.Caller) +// +// At some point this may get another default and become switch-offable with -N. +// +// The debug['m'] flag enables diagnostic output. a single -m is useful for verifying +// which calls get inlined or not, more is for debugging, and may go away at any point. +// +// TODO: +// - inline functions with ... args +// - handle T.meth(f()) with func f() (t T, arg, arg, ) + +package gc + +import ( + "cmd/internal/obj" + "fmt" +) + +// Used by caninl. + +// Used by inlcalls + +// Used during inlsubst[list] +var inlfn *Node // function currently being inlined + +var inlretlabel *Node // target of the goto substituted in place of a return + +var inlretvars *NodeList // temp out variables + +// Get the function's package. For ordinary functions it's on the ->sym, but for imported methods +// the ->sym can be re-used in the local package, so peel it off the receiver's type. +func fnpkg(fn *Node) *Pkg { + if fn.Type.Thistuple != 0 { + // method + rcvr := getthisx(fn.Type).Type.Type + + if Isptr[rcvr.Etype] { + rcvr = rcvr.Type + } + if rcvr.Sym == nil { + Fatal("receiver with no sym: [%v] %v (%v)", fn.Sym, Nconv(fn, obj.FmtLong), rcvr) + } + return rcvr.Sym.Pkg + } + + // non-method + return fn.Sym.Pkg +} + +// Lazy typechecking of imported bodies. For local functions, caninl will set ->typecheck +// because they're a copy of an already checked body. +func typecheckinl(fn *Node) { + lno := int(setlineno(fn)) + + // typecheckinl is only for imported functions; + // their bodies may refer to unsafe as long as the package + // was marked safe during import (which was checked then). + // the ->inl of a local function has been typechecked before caninl copied it. + pkg := fnpkg(fn) + + if pkg == localpkg || pkg == nil { + return // typecheckinl on local function + } + + if Debug['m'] > 2 { + fmt.Printf("typecheck import [%v] %v { %v }\n", fn.Sym, Nconv(fn, obj.FmtLong), Hconv(fn.Func.Inl, obj.FmtSharp)) + } + + save_safemode := safemode + safemode = 0 + + savefn := Curfn + Curfn = fn + typechecklist(fn.Func.Inl, Etop) + Curfn = savefn + + safemode = save_safemode + + lineno = int32(lno) +} + +// Caninl determines whether fn is inlineable. +// If so, caninl saves fn->nbody in fn->inl and substitutes it with a copy. +// fn and ->nbody will already have been typechecked. +func caninl(fn *Node) { + if fn.Op != ODCLFUNC { + Fatal("caninl %v", fn) + } + if fn.Func.Nname == nil { + Fatal("caninl no nname %v", Nconv(fn, obj.FmtSign)) + } + + // If fn has no body (is defined outside of Go), cannot inline it. + if fn.Nbody == nil { + return + } + + if fn.Typecheck == 0 { + Fatal("caninl on non-typechecked function %v", fn) + } + + // can't handle ... args yet + if Debug['l'] < 3 { + for t := fn.Type.Type.Down.Down.Type; t != nil; t = t.Down { + if t.Isddd { + return + } + } + } + + // Runtime package must not be race instrumented. + // Racewalk skips runtime package. However, some runtime code can be + // inlined into other packages and instrumented there. To avoid this, + // we disable inlining of runtime functions in race mode. + // The example that we observed is inlining of LockOSThread, + // which lead to false race reports on m contents. + if flag_race != 0 && myimportpath == "runtime" { + return + } + + const maxBudget = 80 + budget := maxBudget // allowed hairyness + if ishairylist(fn.Nbody, &budget) || budget < 0 { + return + } + + savefn := Curfn + Curfn = fn + + fn.Func.Nname.Func.Inl = fn.Nbody + fn.Nbody = inlcopylist(fn.Func.Nname.Func.Inl) + fn.Func.Nname.Func.Inldcl = inlcopylist(fn.Func.Nname.Name.Defn.Func.Dcl) + fn.Func.Nname.Func.InlCost = int32(maxBudget - budget) + + // hack, TODO, check for better way to link method nodes back to the thing with the ->inl + // this is so export can find the body of a method + fn.Type.Nname = fn.Func.Nname + + if Debug['m'] > 1 { + fmt.Printf("%v: can inline %v as: %v { %v }\n", fn.Line(), Nconv(fn.Func.Nname, obj.FmtSharp), Tconv(fn.Type, obj.FmtSharp), Hconv(fn.Func.Nname.Func.Inl, obj.FmtSharp)) + } else if Debug['m'] != 0 { + fmt.Printf("%v: can inline %v\n", fn.Line(), fn.Func.Nname) + } + + Curfn = savefn +} + +// Look for anything we want to punt on. +func ishairylist(ll *NodeList, budget *int) bool { + for ; ll != nil; ll = ll.Next { + if ishairy(ll.N, budget) { + return true + } + } + return false +} + +func ishairy(n *Node, budget *int) bool { + if n == nil { + return false + } + + switch n.Op { + // Call is okay if inlinable and we have the budget for the body. + case OCALLFUNC: + if n.Left.Func != nil && n.Left.Func.Inl != nil { + *budget -= int(n.Left.Func.InlCost) + break + } + if n.Left.Op == ONAME && n.Left.Left != nil && n.Left.Left.Op == OTYPE && n.Left.Right != nil && n.Left.Right.Op == ONAME { // methods called as functions + if n.Left.Sym.Def != nil && n.Left.Sym.Def.Func.Inl != nil { + *budget -= int(n.Left.Sym.Def.Func.InlCost) + break + } + } + if Debug['l'] < 4 { + return true + } + + // Call is okay if inlinable and we have the budget for the body. + case OCALLMETH: + if n.Left.Type == nil { + Fatal("no function type for [%p] %v\n", n.Left, Nconv(n.Left, obj.FmtSign)) + } + if n.Left.Type.Nname == nil { + Fatal("no function definition for [%p] %v\n", n.Left.Type, Tconv(n.Left.Type, obj.FmtSign)) + } + if n.Left.Type.Nname.Func.Inl != nil { + *budget -= int(n.Left.Type.Nname.Func.InlCost) + break + } + if Debug['l'] < 4 { + return true + } + + // Things that are too hairy, irrespective of the budget + case OCALL, OCALLINTER, OPANIC, ORECOVER: + if Debug['l'] < 4 { + return true + } + + case OCLOSURE, + OCALLPART, + ORANGE, + OFOR, + OSELECT, + OSWITCH, + OPROC, + ODEFER, + ODCLTYPE, // can't print yet + ODCLCONST, // can't print yet + ORETJMP: + return true + } + + (*budget)-- + + return *budget < 0 || ishairy(n.Left, budget) || ishairy(n.Right, budget) || ishairylist(n.List, budget) || ishairylist(n.Rlist, budget) || ishairylist(n.Ninit, budget) || ishairylist(n.Nbody, budget) +} + +// Inlcopy and inlcopylist recursively copy the body of a function. +// Any name-like node of non-local class is marked for re-export by adding it to +// the exportlist. +func inlcopylist(ll *NodeList) *NodeList { + var l *NodeList + for ; ll != nil; ll = ll.Next { + l = list(l, inlcopy(ll.N)) + } + return l +} + +func inlcopy(n *Node) *Node { + if n == nil { + return nil + } + + switch n.Op { + case ONAME, OTYPE, OLITERAL: + return n + } + + m := Nod(OXXX, nil, nil) + *m = *n + if m.Func != nil { + m.Func.Inl = nil + } + m.Left = inlcopy(n.Left) + m.Right = inlcopy(n.Right) + m.List = inlcopylist(n.List) + m.Rlist = inlcopylist(n.Rlist) + m.Ninit = inlcopylist(n.Ninit) + m.Nbody = inlcopylist(n.Nbody) + + return m +} + +// Inlcalls/nodelist/node walks fn's statements and expressions and substitutes any +// calls made to inlineable functions. This is the external entry point. +func inlcalls(fn *Node) { + savefn := Curfn + Curfn = fn + inlnode(&fn) + if fn != Curfn { + Fatal("inlnode replaced curfn") + } + Curfn = savefn +} + +// Turn an OINLCALL into a statement. +func inlconv2stmt(n *Node) { + n.Op = OBLOCK + + // n->ninit stays + n.List = n.Nbody + + n.Nbody = nil + n.Rlist = nil +} + +// Turn an OINLCALL into a single valued expression. +func inlconv2expr(np **Node) { + n := *np + r := n.Rlist.N + addinit(&r, concat(n.Ninit, n.Nbody)) + *np = r +} + +// Turn the rlist (with the return values) of the OINLCALL in +// n into an expression list lumping the ninit and body +// containing the inlined statements on the first list element so +// order will be preserved Used in return, oas2func and call +// statements. +func inlconv2list(n *Node) *NodeList { + if n.Op != OINLCALL || n.Rlist == nil { + Fatal("inlconv2list %v\n", Nconv(n, obj.FmtSign)) + } + + l := n.Rlist + addinit(&l.N, concat(n.Ninit, n.Nbody)) + return l +} + +func inlnodelist(l *NodeList) { + for ; l != nil; l = l.Next { + inlnode(&l.N) + } +} + +// inlnode recurses over the tree to find inlineable calls, which will +// be turned into OINLCALLs by mkinlcall. When the recursion comes +// back up will examine left, right, list, rlist, ninit, ntest, nincr, +// nbody and nelse and use one of the 4 inlconv/glue functions above +// to turn the OINLCALL into an expression, a statement, or patch it +// in to this nodes list or rlist as appropriate. +// NOTE it makes no sense to pass the glue functions down the +// recursion to the level where the OINLCALL gets created because they +// have to edit /this/ n, so you'd have to push that one down as well, +// but then you may as well do it here. so this is cleaner and +// shorter and less complicated. +func inlnode(np **Node) { + if *np == nil { + return + } + + n := *np + + switch n.Op { + // inhibit inlining of their argument + case ODEFER, OPROC: + switch n.Left.Op { + case OCALLFUNC, OCALLMETH: + n.Left.Etype = n.Op + } + fallthrough + + // TODO do them here (or earlier), + // so escape analysis can avoid more heapmoves. + case OCLOSURE: + return + } + + lno := int(setlineno(n)) + + inlnodelist(n.Ninit) + for l := n.Ninit; l != nil; l = l.Next { + if l.N.Op == OINLCALL { + inlconv2stmt(l.N) + } + } + + inlnode(&n.Left) + if n.Left != nil && n.Left.Op == OINLCALL { + inlconv2expr(&n.Left) + } + + inlnode(&n.Right) + if n.Right != nil && n.Right.Op == OINLCALL { + if n.Op == OFOR { + inlconv2stmt(n.Right) + } else { + inlconv2expr(&n.Right) + } + } + + inlnodelist(n.List) + switch n.Op { + case OBLOCK: + for l := n.List; l != nil; l = l.Next { + if l.N.Op == OINLCALL { + inlconv2stmt(l.N) + } + } + + // if we just replaced arg in f(arg()) or return arg with an inlined call + // and arg returns multiple values, glue as list + case ORETURN, + OCALLFUNC, + OCALLMETH, + OCALLINTER, + OAPPEND, + OCOMPLEX: + if count(n.List) == 1 && n.List.N.Op == OINLCALL && count(n.List.N.Rlist) > 1 { + n.List = inlconv2list(n.List.N) + break + } + fallthrough + + default: + for l := n.List; l != nil; l = l.Next { + if l.N.Op == OINLCALL { + inlconv2expr(&l.N) + } + } + } + + inlnodelist(n.Rlist) + switch n.Op { + case OAS2FUNC: + if n.Rlist.N.Op == OINLCALL { + n.Rlist = inlconv2list(n.Rlist.N) + n.Op = OAS2 + n.Typecheck = 0 + typecheck(np, Etop) + break + } + fallthrough + + default: + for l := n.Rlist; l != nil; l = l.Next { + if l.N.Op == OINLCALL { + if n.Op == OIF { + inlconv2stmt(l.N) + } else { + inlconv2expr(&l.N) + } + } + } + } + + inlnodelist(n.Nbody) + for l := n.Nbody; l != nil; l = l.Next { + if l.N.Op == OINLCALL { + inlconv2stmt(l.N) + } + } + + // with all the branches out of the way, it is now time to + // transmogrify this node itself unless inhibited by the + // switch at the top of this function. + switch n.Op { + case OCALLFUNC, OCALLMETH: + if n.Etype == OPROC || n.Etype == ODEFER { + return + } + } + + switch n.Op { + case OCALLFUNC: + if Debug['m'] > 3 { + fmt.Printf("%v:call to func %v\n", n.Line(), Nconv(n.Left, obj.FmtSign)) + } + if n.Left.Func != nil && n.Left.Func.Inl != nil { // normal case + mkinlcall(np, n.Left, n.Isddd) + } else if n.Left.Op == ONAME && n.Left.Left != nil && n.Left.Left.Op == OTYPE && n.Left.Right != nil && n.Left.Right.Op == ONAME { // methods called as functions + if n.Left.Sym.Def != nil { + mkinlcall(np, n.Left.Sym.Def, n.Isddd) + } + } + + case OCALLMETH: + if Debug['m'] > 3 { + fmt.Printf("%v:call to meth %v\n", n.Line(), Nconv(n.Left.Right, obj.FmtLong)) + } + + // typecheck should have resolved ODOTMETH->type, whose nname points to the actual function. + if n.Left.Type == nil { + Fatal("no function type for [%p] %v\n", n.Left, Nconv(n.Left, obj.FmtSign)) + } + + if n.Left.Type.Nname == nil { + Fatal("no function definition for [%p] %v\n", n.Left.Type, Tconv(n.Left.Type, obj.FmtSign)) + } + + mkinlcall(np, n.Left.Type.Nname, n.Isddd) + } + + lineno = int32(lno) +} + +func mkinlcall(np **Node, fn *Node, isddd bool) { + save_safemode := safemode + + // imported functions may refer to unsafe as long as the + // package was marked safe during import (already checked). + pkg := fnpkg(fn) + + if pkg != localpkg && pkg != nil { + safemode = 0 + } + mkinlcall1(np, fn, isddd) + safemode = save_safemode +} + +func tinlvar(t *Type) *Node { + if t.Nname != nil && !isblank(t.Nname) { + if t.Nname.Name.Inlvar == nil { + Fatal("missing inlvar for %v\n", t.Nname) + } + return t.Nname.Name.Inlvar + } + + typecheck(&nblank, Erv|Easgn) + return nblank +} + +var inlgen int + +// if *np is a call, and fn is a function with an inlinable body, substitute *np with an OINLCALL. +// On return ninit has the parameter assignments, the nbody is the +// inlined function body and list, rlist contain the input, output +// parameters. +func mkinlcall1(np **Node, fn *Node, isddd bool) { + // For variadic fn. + if fn.Func.Inl == nil { + return + } + + if fn == Curfn || fn.Name.Defn == Curfn { + return + } + + if Debug['l'] < 2 { + typecheckinl(fn) + } + + n := *np + + // Bingo, we have a function node, and it has an inlineable body + if Debug['m'] > 1 { + fmt.Printf("%v: inlining call to %v %v { %v }\n", n.Line(), fn.Sym, Tconv(fn.Type, obj.FmtSharp), Hconv(fn.Func.Inl, obj.FmtSharp)) + } else if Debug['m'] != 0 { + fmt.Printf("%v: inlining call to %v\n", n.Line(), fn) + } + + if Debug['m'] > 2 { + fmt.Printf("%v: Before inlining: %v\n", n.Line(), Nconv(n, obj.FmtSign)) + } + + saveinlfn := inlfn + inlfn = fn + + ninit := n.Ninit + + //dumplist("ninit pre", ninit); + + var dcl *NodeList + if fn.Name.Defn != nil { // local function + dcl = fn.Func.Inldcl // imported function + } else { + dcl = fn.Func.Dcl + } + + inlretvars = nil + i := 0 + + // Make temp names to use instead of the originals + for ll := dcl; ll != nil; ll = ll.Next { + if ll.N.Class == PPARAMOUT { // return values handled below. + continue + } + if ll.N.Op == ONAME { + ll.N.Name.Inlvar = inlvar(ll.N) + + // Typecheck because inlvar is not necessarily a function parameter. + typecheck(&ll.N.Name.Inlvar, Erv) + + if ll.N.Class&^PHEAP != PAUTO { + ninit = list(ninit, Nod(ODCL, ll.N.Name.Inlvar, nil)) // otherwise gen won't emit the allocations for heapallocs + } + } + } + + // temporaries for return values. + var m *Node + for t := getoutargx(fn.Type).Type; t != nil; t = t.Down { + if t != nil && t.Nname != nil && !isblank(t.Nname) { + m = inlvar(t.Nname) + typecheck(&m, Erv) + t.Nname.Name.Inlvar = m + } else { + // anonymous return values, synthesize names for use in assignment that replaces return + m = retvar(t, i) + i++ + } + + ninit = list(ninit, Nod(ODCL, m, nil)) + inlretvars = list(inlretvars, m) + } + + // assign receiver. + var as *Node + if fn.Type.Thistuple != 0 && n.Left.Op == ODOTMETH { + // method call with a receiver. + t := getthisx(fn.Type).Type + + if t != nil && t.Nname != nil && !isblank(t.Nname) && t.Nname.Name.Inlvar == nil { + Fatal("missing inlvar for %v\n", t.Nname) + } + if n.Left.Left == nil { + Fatal("method call without receiver: %v", Nconv(n, obj.FmtSign)) + } + if t == nil { + Fatal("method call unknown receiver type: %v", Nconv(n, obj.FmtSign)) + } + as = Nod(OAS, tinlvar(t), n.Left.Left) + if as != nil { + typecheck(&as, Etop) + ninit = list(ninit, as) + } + } + + // check if inlined function is variadic. + variadic := false + + var varargtype *Type + varargcount := 0 + for t := fn.Type.Type.Down.Down.Type; t != nil; t = t.Down { + if t.Isddd { + variadic = true + varargtype = t.Type + } + } + + // but if argument is dotted too forget about variadicity. + if variadic && isddd { + variadic = false + } + + // check if argument is actually a returned tuple from call. + multiret := 0 + + if n.List != nil && n.List.Next == nil { + switch n.List.N.Op { + case OCALL, OCALLFUNC, OCALLINTER, OCALLMETH: + if n.List.N.Left.Type.Outtuple > 1 { + multiret = n.List.N.Left.Type.Outtuple - 1 + } + } + } + + if variadic { + varargcount = count(n.List) + multiret + if n.Left.Op != ODOTMETH { + varargcount -= fn.Type.Thistuple + } + varargcount -= fn.Type.Intuple - 1 + } + + // assign arguments to the parameters' temp names + as = Nod(OAS2, nil, nil) + + as.Rlist = n.List + ll := n.List + + // TODO: if len(nlist) == 1 but multiple args, check that n->list->n is a call? + if fn.Type.Thistuple != 0 && n.Left.Op != ODOTMETH { + // non-method call to method + if n.List == nil { + Fatal("non-method call to method without first arg: %v", Nconv(n, obj.FmtSign)) + } + + // append receiver inlvar to LHS. + t := getthisx(fn.Type).Type + + if t != nil && t.Nname != nil && !isblank(t.Nname) && t.Nname.Name.Inlvar == nil { + Fatal("missing inlvar for %v\n", t.Nname) + } + if t == nil { + Fatal("method call unknown receiver type: %v", Nconv(n, obj.FmtSign)) + } + as.List = list(as.List, tinlvar(t)) + ll = ll.Next // track argument count. + } + + // append ordinary arguments to LHS. + chkargcount := n.List != nil && n.List.Next != nil + + var vararg *Node // the slice argument to a variadic call + var varargs *NodeList // the list of LHS names to put in vararg. + if !chkargcount { + // 0 or 1 expression on RHS. + var i int + for t := getinargx(fn.Type).Type; t != nil; t = t.Down { + if variadic && t.Isddd { + vararg = tinlvar(t) + for i = 0; i < varargcount && ll != nil; i++ { + m = argvar(varargtype, i) + varargs = list(varargs, m) + as.List = list(as.List, m) + } + + break + } + + as.List = list(as.List, tinlvar(t)) + } + } else { + // match arguments except final variadic (unless the call is dotted itself) + var t *Type + for t = getinargx(fn.Type).Type; t != nil; { + if ll == nil { + break + } + if variadic && t.Isddd { + break + } + as.List = list(as.List, tinlvar(t)) + t = t.Down + ll = ll.Next + } + + // match varargcount arguments with variadic parameters. + if variadic && t != nil && t.Isddd { + vararg = tinlvar(t) + var i int + for i = 0; i < varargcount && ll != nil; i++ { + m = argvar(varargtype, i) + varargs = list(varargs, m) + as.List = list(as.List, m) + ll = ll.Next + } + + if i == varargcount { + t = t.Down + } + } + + if ll != nil || t != nil { + Fatal("arg count mismatch: %v vs %v\n", Tconv(getinargx(fn.Type), obj.FmtSharp), Hconv(n.List, obj.FmtComma)) + } + } + + if as.Rlist != nil { + typecheck(&as, Etop) + ninit = list(ninit, as) + } + + // turn the variadic args into a slice. + if variadic { + as = Nod(OAS, vararg, nil) + if varargcount == 0 { + as.Right = nodnil() + as.Right.Type = varargtype + } else { + vararrtype := typ(TARRAY) + vararrtype.Type = varargtype.Type + vararrtype.Bound = int64(varargcount) + + as.Right = Nod(OCOMPLIT, nil, typenod(varargtype)) + as.Right.List = varargs + as.Right = Nod(OSLICE, as.Right, Nod(OKEY, nil, nil)) + } + + typecheck(&as, Etop) + ninit = list(ninit, as) + } + + // zero the outparams + for ll := inlretvars; ll != nil; ll = ll.Next { + as = Nod(OAS, ll.N, nil) + typecheck(&as, Etop) + ninit = list(ninit, as) + } + + inlretlabel = newlabel_inl() + inlgen++ + body := inlsubstlist(fn.Func.Inl) + + body = list(body, Nod(OGOTO, inlretlabel, nil)) // avoid 'not used' when function doesn't have return + body = list(body, Nod(OLABEL, inlretlabel, nil)) + + typechecklist(body, Etop) + + //dumplist("ninit post", ninit); + + call := Nod(OINLCALL, nil, nil) + + call.Ninit = ninit + call.Nbody = body + call.Rlist = inlretvars + call.Type = n.Type + call.Typecheck = 1 + + // Hide the args from setlno -- the parameters to the inlined + // call already have good line numbers that should be preserved. + args := as.Rlist + as.Rlist = nil + + setlno(call, int(n.Lineno)) + + as.Rlist = args + + //dumplist("call body", body); + + *np = call + + inlfn = saveinlfn + + // transitive inlining + // might be nice to do this before exporting the body, + // but can't emit the body with inlining expanded. + // instead we emit the things that the body needs + // and each use must redo the inlining. + // luckily these are small. + body = fn.Func.Inl + fn.Func.Inl = nil // prevent infinite recursion (shouldn't happen anyway) + inlnodelist(call.Nbody) + for ll := call.Nbody; ll != nil; ll = ll.Next { + if ll.N.Op == OINLCALL { + inlconv2stmt(ll.N) + } + } + fn.Func.Inl = body + + if Debug['m'] > 2 { + fmt.Printf("%v: After inlining %v\n\n", n.Line(), Nconv(*np, obj.FmtSign)) + } +} + +// Every time we expand a function we generate a new set of tmpnames, +// PAUTO's in the calling functions, and link them off of the +// PPARAM's, PAUTOS and PPARAMOUTs of the called function. +func inlvar(var_ *Node) *Node { + if Debug['m'] > 3 { + fmt.Printf("inlvar %v\n", Nconv(var_, obj.FmtSign)) + } + + n := newname(var_.Sym) + n.Type = var_.Type + n.Class = PAUTO + n.Used = true + n.Name.Curfn = Curfn // the calling function, not the called one + n.Addrtaken = var_.Addrtaken + + // This may no longer be necessary now that we run escape analysis + // after wrapper generation, but for 1.5 this is conservatively left + // unchanged. See bugs 11053 and 9537. + if var_.Esc == EscHeap { + addrescapes(n) + } + + Curfn.Func.Dcl = list(Curfn.Func.Dcl, n) + return n +} + +// Synthesize a variable to store the inlined function's results in. +func retvar(t *Type, i int) *Node { + n := newname(Lookupf("~r%d", i)) + n.Type = t.Type + n.Class = PAUTO + n.Used = true + n.Name.Curfn = Curfn // the calling function, not the called one + Curfn.Func.Dcl = list(Curfn.Func.Dcl, n) + return n +} + +// Synthesize a variable to store the inlined function's arguments +// when they come from a multiple return call. +func argvar(t *Type, i int) *Node { + n := newname(Lookupf("~arg%d", i)) + n.Type = t.Type + n.Class = PAUTO + n.Used = true + n.Name.Curfn = Curfn // the calling function, not the called one + Curfn.Func.Dcl = list(Curfn.Func.Dcl, n) + return n +} + +var newlabel_inl_label int + +func newlabel_inl() *Node { + newlabel_inl_label++ + n := newname(Lookupf(".inlret%.6d", newlabel_inl_label)) + n.Etype = 1 // flag 'safe' for escape analysis (no backjumps) + return n +} + +// inlsubst and inlsubstlist recursively copy the body of the saved +// pristine ->inl body of the function while substituting references +// to input/output parameters with ones to the tmpnames, and +// substituting returns with assignments to the output. +func inlsubstlist(ll *NodeList) *NodeList { + var l *NodeList + for ; ll != nil; ll = ll.Next { + l = list(l, inlsubst(ll.N)) + } + return l +} + +func inlsubst(n *Node) *Node { + if n == nil { + return nil + } + + switch n.Op { + case ONAME: + if n.Name.Inlvar != nil { // These will be set during inlnode + if Debug['m'] > 2 { + fmt.Printf("substituting name %v -> %v\n", Nconv(n, obj.FmtSign), Nconv(n.Name.Inlvar, obj.FmtSign)) + } + return n.Name.Inlvar + } + + if Debug['m'] > 2 { + fmt.Printf("not substituting name %v\n", Nconv(n, obj.FmtSign)) + } + return n + + case OLITERAL, OTYPE: + return n + + // Since we don't handle bodies with closures, this return is guaranteed to belong to the current inlined function. + + // dump("Return before substitution", n); + case ORETURN: + m := Nod(OGOTO, inlretlabel, nil) + + m.Ninit = inlsubstlist(n.Ninit) + + if inlretvars != nil && n.List != nil { + as := Nod(OAS2, nil, nil) + + // shallow copy or OINLCALL->rlist will be the same list, and later walk and typecheck may clobber that. + for ll := inlretvars; ll != nil; ll = ll.Next { + as.List = list(as.List, ll.N) + } + as.Rlist = inlsubstlist(n.List) + typecheck(&as, Etop) + m.Ninit = list(m.Ninit, as) + } + + typechecklist(m.Ninit, Etop) + typecheck(&m, Etop) + + // dump("Return after substitution", m); + return m + + case OGOTO, OLABEL: + m := Nod(OXXX, nil, nil) + *m = *n + m.Ninit = nil + p := fmt.Sprintf("%s·%d", n.Left.Sym.Name, inlgen) + m.Left = newname(Lookup(p)) + + return m + } + + m := Nod(OXXX, nil, nil) + *m = *n + m.Ninit = nil + + if n.Op == OCLOSURE { + Fatal("cannot inline function containing closure: %v", Nconv(n, obj.FmtSign)) + } + + m.Left = inlsubst(n.Left) + m.Right = inlsubst(n.Right) + m.List = inlsubstlist(n.List) + m.Rlist = inlsubstlist(n.Rlist) + m.Ninit = concat(m.Ninit, inlsubstlist(n.Ninit)) + m.Nbody = inlsubstlist(n.Nbody) + + return m +} + +// Plaster over linenumbers +func setlnolist(ll *NodeList, lno int) { + for ; ll != nil; ll = ll.Next { + setlno(ll.N, lno) + } +} + +func setlno(n *Node, lno int) { + if n == nil { + return + } + + // don't clobber names, unless they're freshly synthesized + if n.Op != ONAME || n.Lineno == 0 { + n.Lineno = int32(lno) + } + + setlno(n.Left, lno) + setlno(n.Right, lno) + setlnolist(n.List, lno) + setlnolist(n.Rlist, lno) + setlnolist(n.Ninit, lno) + setlnolist(n.Nbody, lno) +} diff --git a/src/cmd/compile/internal/gc/lex.go b/src/cmd/compile/internal/gc/lex.go new file mode 100644 index 0000000000000000000000000000000000000000..606298b6e6b8d71aea936eb0a3f967c7c7b61c26 --- /dev/null +++ b/src/cmd/compile/internal/gc/lex.go @@ -0,0 +1,2653 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:generate go tool yacc go.y +//go:generate go run mkbuiltin.go runtime unsafe + +package gc + +import ( + "bytes" + "cmd/internal/obj" + "flag" + "fmt" + "io" + "log" + "os" + "path" + "strconv" + "strings" + "unicode" + "unicode/utf8" +) + +var yyprev int + +var yylast int + +var imported_unsafe int + +var ( + goos string + goarch string + goroot string + buildid string +) + +var ( + Debug_append int + Debug_panic int + Debug_slice int + Debug_wb int +) + +// Debug arguments. +// These can be specified with the -d flag, as in "-d nil" +// to set the debug_checknil variable. In general the list passed +// to -d can be comma-separated. +var debugtab = []struct { + name string + val *int +}{ + {"append", &Debug_append}, // print information about append compilation + {"disablenil", &Disable_checknil}, // disable nil checks + {"gcprog", &Debug_gcprog}, // print dump of GC programs + {"nil", &Debug_checknil}, // print information about nil checks + {"panic", &Debug_panic}, // do not hide any compiler panic + {"slice", &Debug_slice}, // print information about slice compilation + {"typeassert", &Debug_typeassert}, // print information about type assertion inlining + {"wb", &Debug_wb}, // print information about write barriers +} + +// Our own isdigit, isspace, isalpha, isalnum that take care +// of EOF and other out of range arguments. +func yy_isdigit(c int) bool { + return c >= 0 && c <= 0xFF && isdigit(c) +} + +func yy_isspace(c int) bool { + return c == ' ' || c == '\t' || c == '\n' || c == '\r' +} + +func yy_isalpha(c int) bool { + return 'a' <= c && c <= 'z' || 'A' <= c && c <= 'Z' +} + +func yy_isalnum(c int) bool { + return c >= 0 && c <= 0xFF && isalnum(c) +} + +// Disallow use of isdigit etc. + +const ( + EOF = -1 +) + +func usage() { + fmt.Printf("usage: %cg [options] file.go...\n", Thearch.Thechar) + obj.Flagprint(1) + Exit(2) +} + +func hidePanic() { + if Debug_panic == 0 && nsavederrors+nerrors > 0 { + // If we've already complained about things + // in the program, don't bother complaining + // about a panic too; let the user clean up + // the code and try again. + if err := recover(); err != nil { + errorexit() + } + } +} + +func doversion() { + p := obj.Expstring() + if p == "X:none" { + p = "" + } + sep := "" + if p != "" { + sep = " " + } + fmt.Printf("%cg version %s%s%s\n", Thearch.Thechar, obj.Getgoversion(), sep, p) + os.Exit(0) +} + +func Main() { + defer hidePanic() + + // Allow GOARCH=thearch.thestring or GOARCH=thearch.thestringsuffix, + // but not other values. + p := obj.Getgoarch() + + if !strings.HasPrefix(p, Thearch.Thestring) { + log.Fatalf("cannot use %cg with GOARCH=%s", Thearch.Thechar, p) + } + goarch = p + + Thearch.Linkarchinit() + Ctxt = obj.Linknew(Thearch.Thelinkarch) + Ctxt.Diag = Yyerror + Ctxt.Bso = &bstdout + bstdout = *obj.Binitw(os.Stdout) + + localpkg = mkpkg("") + localpkg.Prefix = "\"\"" + + // pseudo-package, for scoping + builtinpkg = mkpkg("go.builtin") + + builtinpkg.Prefix = "go.builtin" // not go%2ebuiltin + + // pseudo-package, accessed by import "unsafe" + unsafepkg = mkpkg("unsafe") + + unsafepkg.Name = "unsafe" + + // real package, referred to by generated runtime calls + Runtimepkg = mkpkg("runtime") + + Runtimepkg.Name = "runtime" + + // pseudo-packages used in symbol tables + gostringpkg = mkpkg("go.string") + + gostringpkg.Name = "go.string" + gostringpkg.Prefix = "go.string" // not go%2estring + + itabpkg = mkpkg("go.itab") + + itabpkg.Name = "go.itab" + itabpkg.Prefix = "go.itab" // not go%2eitab + + weaktypepkg = mkpkg("go.weak.type") + + weaktypepkg.Name = "go.weak.type" + weaktypepkg.Prefix = "go.weak.type" // not go%2eweak%2etype + + typelinkpkg = mkpkg("go.typelink") + typelinkpkg.Name = "go.typelink" + typelinkpkg.Prefix = "go.typelink" // not go%2etypelink + + trackpkg = mkpkg("go.track") + + trackpkg.Name = "go.track" + trackpkg.Prefix = "go.track" // not go%2etrack + + typepkg = mkpkg("type") + + typepkg.Name = "type" + + goroot = obj.Getgoroot() + goos = obj.Getgoos() + + Nacl = goos == "nacl" + if Nacl { + flag_largemodel = 1 + } + + outfile = "" + obj.Flagcount("+", "compiling runtime", &compiling_runtime) + obj.Flagcount("%", "debug non-static initializers", &Debug['%']) + obj.Flagcount("A", "for bootstrapping, allow 'any' type", &Debug['A']) + obj.Flagcount("B", "disable bounds checking", &Debug['B']) + obj.Flagstr("D", "set relative `path` for local imports", &localimport) + obj.Flagcount("E", "debug symbol export", &Debug['E']) + obj.Flagfn1("I", "add `directory` to import search path", addidir) + obj.Flagcount("K", "debug missing line numbers", &Debug['K']) + obj.Flagcount("L", "use full (long) path in error messages", &Debug['L']) + obj.Flagcount("M", "debug move generation", &Debug['M']) + obj.Flagcount("N", "disable optimizations", &Debug['N']) + obj.Flagcount("P", "debug peephole optimizer", &Debug['P']) + obj.Flagcount("R", "debug register optimizer", &Debug['R']) + obj.Flagcount("S", "print assembly listing", &Debug['S']) + obj.Flagfn0("V", "print compiler version", doversion) + obj.Flagcount("W", "debug parse tree after type checking", &Debug['W']) + obj.Flagstr("asmhdr", "write assembly header to `file`", &asmhdr) + obj.Flagstr("buildid", "record `id` as the build id in the export metadata", &buildid) + obj.Flagcount("complete", "compiling complete package (no C or assembly)", &pure_go) + obj.Flagstr("d", "print debug information about items in `list`", &debugstr) + obj.Flagcount("e", "no limit on number of errors reported", &Debug['e']) + obj.Flagcount("f", "debug stack frames", &Debug['f']) + obj.Flagcount("g", "debug code generation", &Debug['g']) + obj.Flagcount("h", "halt on error", &Debug['h']) + obj.Flagcount("i", "debug line number stack", &Debug['i']) + obj.Flagfn1("importmap", "add `definition` of the form source=actual to import map", addImportMap) + obj.Flagstr("installsuffix", "set pkg directory `suffix`", &flag_installsuffix) + obj.Flagcount("j", "debug runtime-initialized variables", &Debug['j']) + obj.Flagcount("l", "disable inlining", &Debug['l']) + obj.Flagcount("live", "debug liveness analysis", &debuglive) + obj.Flagcount("m", "print optimization decisions", &Debug['m']) + obj.Flagcount("nolocalimports", "reject local (relative) imports", &nolocalimports) + obj.Flagstr("o", "write output to `file`", &outfile) + obj.Flagstr("p", "set expected package import `path`", &myimportpath) + obj.Flagcount("pack", "write package file instead of object file", &writearchive) + obj.Flagcount("r", "debug generated wrappers", &Debug['r']) + obj.Flagcount("race", "enable race detector", &flag_race) + obj.Flagcount("s", "warn about composite literals that can be simplified", &Debug['s']) + obj.Flagstr("trimpath", "remove `prefix` from recorded source file paths", &Ctxt.LineHist.TrimPathPrefix) + obj.Flagcount("u", "reject unsafe code", &safemode) + obj.Flagcount("v", "increase debug verbosity", &Debug['v']) + obj.Flagcount("w", "debug type checking", &Debug['w']) + use_writebarrier = 1 + obj.Flagcount("wb", "enable write barrier", &use_writebarrier) + obj.Flagcount("x", "debug lexer", &Debug['x']) + obj.Flagcount("y", "debug declarations in canned imports (with -d)", &Debug['y']) + var flag_shared int + var flag_dynlink bool + if Thearch.Thechar == '6' { + obj.Flagcount("largemodel", "generate code that assumes a large memory model", &flag_largemodel) + obj.Flagcount("shared", "generate code that can be linked into a shared library", &flag_shared) + flag.BoolVar(&flag_dynlink, "dynlink", false, "support references to Go symbols defined in other shared libraries") + } + obj.Flagstr("cpuprofile", "write cpu profile to `file`", &cpuprofile) + obj.Flagstr("memprofile", "write memory profile to `file`", &memprofile) + obj.Flagint64("memprofilerate", "set runtime.MemProfileRate to `rate`", &memprofilerate) + obj.Flagparse(usage) + + if flag_dynlink { + flag_shared = 1 + } + Ctxt.Flag_shared = int32(flag_shared) + Ctxt.Flag_dynlink = flag_dynlink + + Ctxt.Debugasm = int32(Debug['S']) + Ctxt.Debugvlog = int32(Debug['v']) + + if flag.NArg() < 1 { + usage() + } + + startProfile() + + if flag_race != 0 { + racepkg = mkpkg("runtime/race") + racepkg.Name = "race" + } + + // parse -d argument + if debugstr != "" { + Split: + for _, name := range strings.Split(debugstr, ",") { + if name == "" { + continue + } + val := 1 + if i := strings.Index(name, "="); i >= 0 { + var err error + val, err = strconv.Atoi(name[i+1:]) + if err != nil { + log.Fatalf("invalid debug value %v", name) + } + name = name[:i] + } + for _, t := range debugtab { + if t.name == name { + if t.val != nil { + *t.val = val + continue Split + } + } + } + log.Fatalf("unknown debug key -d %s\n", name) + } + } + + // enable inlining. for now: + // default: inlining on. (debug['l'] == 1) + // -l: inlining off (debug['l'] == 0) + // -ll, -lll: inlining on again, with extra debugging (debug['l'] > 1) + if Debug['l'] <= 1 { + Debug['l'] = 1 - Debug['l'] + } + + Thearch.Betypeinit() + if Widthptr == 0 { + Fatal("betypeinit failed") + } + + lexinit() + typeinit() + lexinit1() + // TODO(rsc): Restore yytinit? + + blockgen = 1 + dclcontext = PEXTERN + nerrors = 0 + lexlineno = 1 + + for _, infile = range flag.Args() { + linehistpush(infile) + + curio.infile = infile + var err error + curio.bin, err = obj.Bopenr(infile) + if err != nil { + fmt.Printf("open %s: %v\n", infile, err) + errorexit() + } + + curio.peekc = 0 + curio.peekc1 = 0 + curio.nlsemi = 0 + curio.eofnl = 0 + curio.last = 0 + + // Skip initial BOM if present. + if obj.Bgetrune(curio.bin) != obj.BOM { + obj.Bungetrune(curio.bin) + } + + block = 1 + iota_ = -1000000 + + imported_unsafe = 0 + + yyparse() + if nsyntaxerrors != 0 { + errorexit() + } + + linehistpop() + if curio.bin != nil { + obj.Bterm(curio.bin) + } + } + + testdclstack() + mkpackage(localpkg.Name) // final import not used checks + lexfini() + + typecheckok = 1 + if Debug['f'] != 0 { + frame(1) + } + + // Process top-level declarations in phases. + + // Phase 1: const, type, and names and types of funcs. + // This will gather all the information about types + // and methods but doesn't depend on any of it. + defercheckwidth() + + for l := xtop; l != nil; l = l.Next { + if l.N.Op != ODCL && l.N.Op != OAS && l.N.Op != OAS2 { + typecheck(&l.N, Etop) + } + } + + // Phase 2: Variable assignments. + // To check interface assignments, depends on phase 1. + for l := xtop; l != nil; l = l.Next { + if l.N.Op == ODCL || l.N.Op == OAS || l.N.Op == OAS2 { + typecheck(&l.N, Etop) + } + } + resumecheckwidth() + + // Phase 3: Type check function bodies. + for l := xtop; l != nil; l = l.Next { + if l.N.Op == ODCLFUNC || l.N.Op == OCLOSURE { + Curfn = l.N + decldepth = 1 + saveerrors() + typechecklist(l.N.Nbody, Etop) + checkreturn(l.N) + if nerrors != 0 { + l.N.Nbody = nil // type errors; do not compile + } + } + } + + // Phase 4: Decide how to capture closed variables. + // This needs to run before escape analysis, + // because variables captured by value do not escape. + for l := xtop; l != nil; l = l.Next { + if l.N.Op == ODCLFUNC && l.N.Func.Closure != nil { + Curfn = l.N + capturevars(l.N) + } + } + + Curfn = nil + + if nsavederrors+nerrors != 0 { + errorexit() + } + + // Phase 5: Inlining + if Debug['l'] > 1 { + // Typecheck imported function bodies if debug['l'] > 1, + // otherwise lazily when used or re-exported. + for l := importlist; l != nil; l = l.Next { + if l.N.Func.Inl != nil { + saveerrors() + typecheckinl(l.N) + } + } + + if nsavederrors+nerrors != 0 { + errorexit() + } + } + + if Debug['l'] != 0 { + // Find functions that can be inlined and clone them before walk expands them. + visitBottomUp(xtop, func(list *NodeList, recursive bool) { + for l := list; l != nil; l = l.Next { + if l.N.Op == ODCLFUNC { + caninl(l.N) + inlcalls(l.N) + } + } + }) + } + + // Phase 6: Escape analysis. + // Required for moving heap allocations onto stack, + // which in turn is required by the closure implementation, + // which stores the addresses of stack variables into the closure. + // If the closure does not escape, it needs to be on the stack + // or else the stack copier will not update it. + // Large values are also moved off stack in escape analysis; + // because large values may contain pointers, it must happen early. + escapes(xtop) + + // Phase 7: Transform closure bodies to properly reference captured variables. + // This needs to happen before walk, because closures must be transformed + // before walk reaches a call of a closure. + for l := xtop; l != nil; l = l.Next { + if l.N.Op == ODCLFUNC && l.N.Func.Closure != nil { + Curfn = l.N + transformclosure(l.N) + } + } + + Curfn = nil + + // Phase 8: Compile top level functions. + for l := xtop; l != nil; l = l.Next { + if l.N.Op == ODCLFUNC { + funccompile(l.N) + } + } + + if nsavederrors+nerrors == 0 { + fninit(xtop) + } + + // Phase 9: Check external declarations. + for l := externdcl; l != nil; l = l.Next { + if l.N.Op == ONAME { + typecheck(&l.N, Erv) + } + } + + if nerrors+nsavederrors != 0 { + errorexit() + } + + dumpobj() + + if asmhdr != "" { + dumpasmhdr() + } + + if nerrors+nsavederrors != 0 { + errorexit() + } + + Flusherrors() +} + +var importMap = map[string]string{} + +func addImportMap(s string) { + if strings.Count(s, "=") != 1 { + log.Fatal("-importmap argument must be of the form source=actual") + } + i := strings.Index(s, "=") + source, actual := s[:i], s[i+1:] + if source == "" || actual == "" { + log.Fatal("-importmap argument must be of the form source=actual; source and actual must be non-empty") + } + importMap[source] = actual +} + +func saveerrors() { + nsavederrors += nerrors + nerrors = 0 +} + +func arsize(b *obj.Biobuf, name string) int { + var buf [ArhdrSize]byte + if _, err := io.ReadFull(b, buf[:]); err != nil { + return -1 + } + aname := strings.Trim(string(buf[0:16]), " ") + if !strings.HasPrefix(aname, name) { + return -1 + } + asize := strings.Trim(string(buf[48:58]), " ") + i, _ := strconv.Atoi(asize) + return i +} + +func skiptopkgdef(b *obj.Biobuf) bool { + /* archive header */ + p := obj.Brdline(b, '\n') + if p == "" { + return false + } + if obj.Blinelen(b) != 8 { + return false + } + if p != "!\n" { + return false + } + + /* symbol table may be first; skip it */ + sz := arsize(b, "__.GOSYMDEF") + + if sz >= 0 { + obj.Bseek(b, int64(sz), 1) + } else { + obj.Bseek(b, 8, 0) + } + + /* package export block is next */ + sz = arsize(b, "__.PKGDEF") + + if sz <= 0 { + return false + } + return true +} + +func addidir(dir string) { + if dir == "" { + return + } + + var pp **Idir + for pp = &idirs; *pp != nil; pp = &(*pp).link { + } + *pp = new(Idir) + (*pp).link = nil + (*pp).dir = dir +} + +// is this path a local name? begins with ./ or ../ or / +func islocalname(name string) bool { + return strings.HasPrefix(name, "/") || + Ctxt.Windows != 0 && len(name) >= 3 && yy_isalpha(int(name[0])) && name[1] == ':' && name[2] == '/' || + strings.HasPrefix(name, "./") || name == "." || + strings.HasPrefix(name, "../") || name == ".." +} + +func findpkg(name string) (file string, ok bool) { + if islocalname(name) { + if safemode != 0 || nolocalimports != 0 { + return "", false + } + + // try .a before .6. important for building libraries: + // if there is an array.6 in the array.a library, + // want to find all of array.a, not just array.6. + file = fmt.Sprintf("%s.a", name) + if obj.Access(file, 0) >= 0 { + return file, true + } + file = fmt.Sprintf("%s.o", name) + if obj.Access(file, 0) >= 0 { + return file, true + } + return "", false + } + + // local imports should be canonicalized already. + // don't want to see "encoding/../encoding/base64" + // as different from "encoding/base64". + var q string + _ = q + if path.Clean(name) != name { + Yyerror("non-canonical import path %q (should be %q)", name, q) + return "", false + } + + for p := idirs; p != nil; p = p.link { + file = fmt.Sprintf("%s/%s.a", p.dir, name) + if obj.Access(file, 0) >= 0 { + return file, true + } + file = fmt.Sprintf("%s/%s.o", p.dir, name) + if obj.Access(file, 0) >= 0 { + return file, true + } + } + + if goroot != "" { + suffix := "" + suffixsep := "" + if flag_installsuffix != "" { + suffixsep = "_" + suffix = flag_installsuffix + } else if flag_race != 0 { + suffixsep = "_" + suffix = "race" + } + + file = fmt.Sprintf("%s/pkg/%s_%s%s%s/%s.a", goroot, goos, goarch, suffixsep, suffix, name) + if obj.Access(file, 0) >= 0 { + return file, true + } + file = fmt.Sprintf("%s/pkg/%s_%s%s%s/%s.o", goroot, goos, goarch, suffixsep, suffix, name) + if obj.Access(file, 0) >= 0 { + return file, true + } + } + + return "", false +} + +func fakeimport() { + importpkg = mkpkg("fake") + cannedimports("fake.o", "$$\n") +} + +func importfile(f *Val, line int) { + if _, ok := f.U.(string); !ok { + Yyerror("import statement not a string") + fakeimport() + return + } + + if len(f.U.(string)) == 0 { + Yyerror("import path is empty") + fakeimport() + return + } + + if isbadimport(f.U.(string)) { + fakeimport() + return + } + + // The package name main is no longer reserved, + // but we reserve the import path "main" to identify + // the main package, just as we reserve the import + // path "math" to identify the standard math package. + if f.U.(string) == "main" { + Yyerror("cannot import \"main\"") + errorexit() + } + + if myimportpath != "" && f.U.(string) == myimportpath { + Yyerror("import %q while compiling that package (import cycle)", f.U.(string)) + errorexit() + } + + if f.U.(string) == "unsafe" { + if safemode != 0 { + Yyerror("cannot import package unsafe") + errorexit() + } + + importpkg = mkpkg(f.U.(string)) + cannedimports("unsafe.o", unsafeimport) + imported_unsafe = 1 + return + } + + path_ := f.U.(string) + + if mapped, ok := importMap[path_]; ok { + path_ = mapped + } + + if islocalname(path_) { + if path_[0] == '/' { + Yyerror("import path cannot be absolute path") + fakeimport() + return + } + + prefix := Ctxt.Pathname + if localimport != "" { + prefix = localimport + } + cleanbuf := prefix + cleanbuf += "/" + cleanbuf += path_ + cleanbuf = path.Clean(cleanbuf) + path_ = cleanbuf + + if isbadimport(path_) { + fakeimport() + return + } + } + + file, found := findpkg(path_) + if !found { + Yyerror("can't find import: %q", f.U.(string)) + errorexit() + } + + importpkg = mkpkg(path_) + + // If we already saw that package, feed a dummy statement + // to the lexer to avoid parsing export data twice. + if importpkg.Imported != 0 { + tag := "" + if importpkg.Safe { + tag = "safe" + } + + p := fmt.Sprintf("package %s %s\n$$\n", importpkg.Name, tag) + cannedimports(file, p) + return + } + + importpkg.Imported = 1 + + var err error + var imp *obj.Biobuf + imp, err = obj.Bopenr(file) + if err != nil { + Yyerror("can't open import: %q: %v", f.U.(string), err) + errorexit() + } + + if strings.HasSuffix(file, ".a") { + if !skiptopkgdef(imp) { + Yyerror("import %s: not a package file", file) + errorexit() + } + } + + // check object header + p := obj.Brdstr(imp, '\n', 1) + + if p != "empty archive" { + if !strings.HasPrefix(p, "go object ") { + Yyerror("import %s: not a go object file", file) + errorexit() + } + + q := fmt.Sprintf("%s %s %s %s", obj.Getgoos(), obj.Getgoarch(), obj.Getgoversion(), obj.Expstring()) + if p[10:] != q { + Yyerror("import %s: object is [%s] expected [%s]", file, p[10:], q) + errorexit() + } + } + + // assume files move (get installed) + // so don't record the full path. + linehistpragma(file[len(file)-len(path_)-2:]) // acts as #pragma lib + + /* + * position the input right + * after $$ and return + */ + pushedio = curio + + curio.bin = imp + curio.peekc = 0 + curio.peekc1 = 0 + curio.infile = file + curio.nlsemi = 0 + typecheckok = 1 + + var c int32 + for { + c = int32(getc()) + if c == EOF { + break + } + if c != '$' { + continue + } + c = int32(getc()) + if c == EOF { + break + } + if c != '$' { + continue + } + return + } + + Yyerror("no import in %q", f.U.(string)) + unimportfile() +} + +func unimportfile() { + if curio.bin != nil { + obj.Bterm(curio.bin) + curio.bin = nil + } else { + lexlineno-- // re correct sys.6 line number + } + + curio = pushedio + + pushedio.bin = nil + incannedimport = 0 + typecheckok = 0 +} + +func cannedimports(file string, cp string) { + lexlineno++ // if sys.6 is included on line 1, + + pushedio = curio + + curio.bin = nil + curio.peekc = 0 + curio.peekc1 = 0 + curio.infile = file + curio.cp = cp + curio.nlsemi = 0 + curio.importsafe = false + + typecheckok = 1 + incannedimport = 1 +} + +func isfrog(c int) bool { + // complain about possibly invisible control characters + if c < ' ' { + return !yy_isspace(c) // exclude good white space + } + + if 0x7f <= c && c <= 0xa0 { // DEL, unicode block including unbreakable space. + return true + } + return false +} + +type Loophack struct { + v int + next *Loophack +} + +var _yylex_lstk *Loophack + +func _yylex(yylval *yySymType) int32 { + var c1 int + var escflag int + var v int64 + var cp *bytes.Buffer + var rune_ uint + var s *Sym + var h *Loophack + var str string + + prevlineno = lineno + +l0: + c := getc() + if yy_isspace(c) { + if c == '\n' && curio.nlsemi != 0 { + ungetc(c) + if Debug['x'] != 0 { + fmt.Printf("lex: implicit semi\n") + } + return ';' + } + + goto l0 + } + + lineno = lexlineno /* start of token */ + + if c >= utf8.RuneSelf { + /* all multibyte runes are alpha */ + cp = &lexbuf + cp.Reset() + + goto talph + } + + if yy_isalpha(c) { + cp = &lexbuf + cp.Reset() + goto talph + } + + if yy_isdigit(c) { + cp = &lexbuf + cp.Reset() + if c != '0' { + for { + cp.WriteByte(byte(c)) + c = getc() + if yy_isdigit(c) { + continue + } + if c == '.' { + goto casedot + } + if c == 'e' || c == 'E' || c == 'p' || c == 'P' { + goto caseep + } + if c == 'i' { + goto casei + } + goto ncu + } + } + + cp.WriteByte(byte(c)) + c = getc() + if c == 'x' || c == 'X' { + for { + cp.WriteByte(byte(c)) + c = getc() + if yy_isdigit(c) { + continue + } + if c >= 'a' && c <= 'f' { + continue + } + if c >= 'A' && c <= 'F' { + continue + } + if lexbuf.Len() == 2 { + Yyerror("malformed hex constant") + } + if c == 'p' { + goto caseep + } + goto ncu + } + } + + if c == 'p' { // 0p begins floating point zero + goto caseep + } + + c1 = 0 + for { + if !yy_isdigit(c) { + break + } + if c < '0' || c > '7' { + c1 = 1 // not octal + } + cp.WriteByte(byte(c)) + c = getc() + } + + if c == '.' { + goto casedot + } + if c == 'e' || c == 'E' { + goto caseep + } + if c == 'i' { + goto casei + } + if c1 != 0 { + Yyerror("malformed octal constant") + } + goto ncu + } + + switch c { + case EOF: + lineno = prevlineno + ungetc(EOF) + return -1 + + case '_': + cp = &lexbuf + cp.Reset() + goto talph + + case '.': + c1 = getc() + if yy_isdigit(c1) { + cp = &lexbuf + cp.Reset() + cp.WriteByte(byte(c)) + c = c1 + goto casedot + } + + if c1 == '.' { + c1 = getc() + if c1 == '.' { + c = LDDD + goto lx + } + + ungetc(c1) + c1 = '.' + } + + /* "..." */ + case '"': + lexbuf.Reset() + lexbuf.WriteString(`""`) + + cp = &strbuf + cp.Reset() + + for { + if escchar('"', &escflag, &v) { + break + } + if v < utf8.RuneSelf || escflag != 0 { + cp.WriteByte(byte(v)) + } else { + rune_ = uint(v) + cp.WriteRune(rune(rune_)) + } + } + + goto strlit + + /* `...` */ + case '`': + lexbuf.Reset() + lexbuf.WriteString("``") + + cp = &strbuf + cp.Reset() + + for { + c = int(getr()) + if c == '\r' { + continue + } + if c == EOF { + Yyerror("eof in string") + break + } + + if c == '`' { + break + } + cp.WriteRune(rune(c)) + } + + goto strlit + + /* '.' */ + case '\'': + if escchar('\'', &escflag, &v) { + Yyerror("empty character literal or unescaped ' in character literal") + v = '\'' + } + + if !escchar('\'', &escflag, &v) { + Yyerror("missing '") + ungetc(int(v)) + } + + x := new(Mpint) + yylval.val.U = x + Mpmovecfix(x, v) + x.Rune = true + if Debug['x'] != 0 { + fmt.Printf("lex: codepoint literal\n") + } + litbuf = "string literal" + return LLITERAL + + case '/': + c1 = getc() + if c1 == '*' { + nl := 0 + for { + c = int(getr()) + if c == '\n' { + nl = 1 + } + for c == '*' { + c = int(getr()) + if c == '/' { + if nl != 0 { + ungetc('\n') + } + goto l0 + } + + if c == '\n' { + nl = 1 + } + } + + if c == EOF { + Yyerror("eof in comment") + errorexit() + } + } + } + + if c1 == '/' { + c = getlinepragma() + for { + if c == '\n' || c == EOF { + ungetc(c) + goto l0 + } + + c = int(getr()) + } + } + + if c1 == '=' { + c = ODIV + goto asop + } + + case ':': + c1 = getc() + if c1 == '=' { + c = LCOLAS + yylval.i = int(lexlineno) + goto lx + } + + case '*': + c1 = getc() + if c1 == '=' { + c = OMUL + goto asop + } + + case '%': + c1 = getc() + if c1 == '=' { + c = OMOD + goto asop + } + + case '+': + c1 = getc() + if c1 == '+' { + c = LINC + goto lx + } + + if c1 == '=' { + c = OADD + goto asop + } + + case '-': + c1 = getc() + if c1 == '-' { + c = LDEC + goto lx + } + + if c1 == '=' { + c = OSUB + goto asop + } + + case '>': + c1 = getc() + if c1 == '>' { + c = LRSH + c1 = getc() + if c1 == '=' { + c = ORSH + goto asop + } + + break + } + + if c1 == '=' { + c = LGE + goto lx + } + + c = LGT + + case '<': + c1 = getc() + if c1 == '<' { + c = LLSH + c1 = getc() + if c1 == '=' { + c = OLSH + goto asop + } + + break + } + + if c1 == '=' { + c = LLE + goto lx + } + + if c1 == '-' { + c = LCOMM + goto lx + } + + c = LLT + + case '=': + c1 = getc() + if c1 == '=' { + c = LEQ + goto lx + } + + case '!': + c1 = getc() + if c1 == '=' { + c = LNE + goto lx + } + + case '&': + c1 = getc() + if c1 == '&' { + c = LANDAND + goto lx + } + + if c1 == '^' { + c = LANDNOT + c1 = getc() + if c1 == '=' { + c = OANDNOT + goto asop + } + + break + } + + if c1 == '=' { + c = OAND + goto asop + } + + case '|': + c1 = getc() + if c1 == '|' { + c = LOROR + goto lx + } + + if c1 == '=' { + c = OOR + goto asop + } + + case '^': + c1 = getc() + if c1 == '=' { + c = OXOR + goto asop + } + + /* + * clumsy dance: + * to implement rule that disallows + * if T{1}[0] { ... } + * but allows + * if (T{1}[0]) { ... } + * the block bodies for if/for/switch/select + * begin with an LBODY token, not '{'. + * + * when we see the keyword, the next + * non-parenthesized '{' becomes an LBODY. + * loophack is normally 0. + * a keyword makes it go up to 1. + * parens push loophack onto a stack and go back to 0. + * a '{' with loophack == 1 becomes LBODY and disables loophack. + * + * i said it was clumsy. + */ + case '(', '[': + if loophack != 0 || _yylex_lstk != nil { + h = new(Loophack) + if h == nil { + Flusherrors() + Yyerror("out of memory") + errorexit() + } + + h.v = loophack + h.next = _yylex_lstk + _yylex_lstk = h + loophack = 0 + } + + goto lx + + case ')', ']': + if _yylex_lstk != nil { + h = _yylex_lstk + loophack = h.v + _yylex_lstk = h.next + } + + goto lx + + case '{': + if loophack == 1 { + if Debug['x'] != 0 { + fmt.Printf("%v lex: LBODY\n", Ctxt.Line(int(lexlineno))) + } + loophack = 0 + return LBODY + } + + goto lx + + default: + goto lx + } + + ungetc(c1) + +lx: + if c > 0xff { + if Debug['x'] != 0 { + fmt.Printf("%v lex: TOKEN %s\n", Ctxt.Line(int(lexlineno)), lexname(c)) + } + } else { + if Debug['x'] != 0 { + fmt.Printf("%v lex: TOKEN '%c'\n", Ctxt.Line(int(lexlineno)), c) + } + } + if isfrog(c) { + Yyerror("illegal character 0x%x", uint(c)) + goto l0 + } + + if importpkg == nil && (c == '#' || c == '$' || c == '?' || c == '@' || c == '\\') { + Yyerror("%s: unexpected %c", "syntax error", c) + goto l0 + } + + return int32(c) + +asop: + yylval.i = c // rathole to hold which asop + if Debug['x'] != 0 { + fmt.Printf("lex: TOKEN ASOP %c\n", c) + } + return LASOP + + /* + * cp is set to lexbuf and some + * prefix has been stored + */ +talph: + for { + if c >= utf8.RuneSelf { + ungetc(c) + rune_ = uint(getr()) + + // 0xb7 · is used for internal names + if !unicode.IsLetter(rune(rune_)) && !unicode.IsDigit(rune(rune_)) && (importpkg == nil || rune_ != 0xb7) { + Yyerror("invalid identifier character U+%04x", rune_) + } + cp.WriteRune(rune(rune_)) + } else if !yy_isalnum(c) && c != '_' { + break + } else { + cp.WriteByte(byte(c)) + } + c = getc() + } + + cp = nil + ungetc(c) + + s = LookupBytes(lexbuf.Bytes()) + switch s.Lexical { + case LIGNORE: + goto l0 + + case LFOR, LIF, LSWITCH, LSELECT: + loophack = 1 // see comment about loophack above + } + + if Debug['x'] != 0 { + fmt.Printf("lex: %s %s\n", s, lexname(int(s.Lexical))) + } + yylval.sym = s + return int32(s.Lexical) + +ncu: + cp = nil + ungetc(c) + + str = lexbuf.String() + yylval.val.U = new(Mpint) + mpatofix(yylval.val.U.(*Mpint), str) + if yylval.val.U.(*Mpint).Ovf { + Yyerror("overflow in constant") + Mpmovecfix(yylval.val.U.(*Mpint), 0) + } + + if Debug['x'] != 0 { + fmt.Printf("lex: integer literal\n") + } + litbuf = "literal " + str + return LLITERAL + +casedot: + for { + cp.WriteByte(byte(c)) + c = getc() + if !yy_isdigit(c) { + break + } + } + + if c == 'i' { + goto casei + } + if c != 'e' && c != 'E' { + goto caseout + } + +caseep: + if importpkg == nil && (c == 'p' || c == 'P') { + // p is allowed in .a/.o imports, + // but not in .go sources. See #9036. + Yyerror("malformed floating point constant") + } + cp.WriteByte(byte(c)) + c = getc() + if c == '+' || c == '-' { + cp.WriteByte(byte(c)) + c = getc() + } + + if !yy_isdigit(c) { + Yyerror("malformed floating point constant exponent") + } + for yy_isdigit(c) { + cp.WriteByte(byte(c)) + c = getc() + } + + if c == 'i' { + goto casei + } + goto caseout + + // imaginary constant +casei: + cp = nil + + str = lexbuf.String() + yylval.val.U = new(Mpcplx) + Mpmovecflt(&yylval.val.U.(*Mpcplx).Real, 0.0) + mpatoflt(&yylval.val.U.(*Mpcplx).Imag, str) + if yylval.val.U.(*Mpcplx).Imag.Val.IsInf() { + Yyerror("overflow in imaginary constant") + Mpmovecflt(&yylval.val.U.(*Mpcplx).Real, 0.0) + } + + if Debug['x'] != 0 { + fmt.Printf("lex: imaginary literal\n") + } + litbuf = "literal " + str + return LLITERAL + +caseout: + cp = nil + ungetc(c) + + str = lexbuf.String() + yylval.val.U = newMpflt() + mpatoflt(yylval.val.U.(*Mpflt), str) + if yylval.val.U.(*Mpflt).Val.IsInf() { + Yyerror("overflow in float constant") + Mpmovecflt(yylval.val.U.(*Mpflt), 0.0) + } + + if Debug['x'] != 0 { + fmt.Printf("lex: floating literal\n") + } + litbuf = "literal " + str + return LLITERAL + +strlit: + yylval.val.U = internString(cp.Bytes()) + if Debug['x'] != 0 { + fmt.Printf("lex: string literal\n") + } + litbuf = "string literal" + return LLITERAL +} + +var internedStrings = map[string]string{} + +func internString(b []byte) string { + s, ok := internedStrings[string(b)] // string(b) here doesn't allocate + if ok { + return s + } + s = string(b) + internedStrings[s] = s + return s +} + +func more(pp *string) bool { + p := *pp + for p != "" && yy_isspace(int(p[0])) { + p = p[1:] + } + *pp = p + return p != "" +} + +/* + * read and interpret syntax that looks like + * //line parse.y:15 + * as a discontinuity in sequential line numbers. + * the next line of input comes from parse.y:15 + */ +func getlinepragma() int { + var cmd, verb, name string + + c := int(getr()) + if c == 'g' { + cp := &lexbuf + cp.Reset() + cp.WriteByte('g') // already read + for { + c = int(getr()) + if c == EOF || c >= utf8.RuneSelf { + return c + } + if c == '\n' { + break + } + cp.WriteByte(byte(c)) + } + cp = nil + + text := strings.TrimSuffix(lexbuf.String(), "\r") + + if strings.HasPrefix(text, "go:cgo_") { + pragcgo(text) + } + + cmd = text + verb = cmd + if i := strings.Index(verb, " "); i >= 0 { + verb = verb[:i] + } + + if verb == "go:linkname" { + if imported_unsafe == 0 { + Yyerror("//go:linkname only allowed in Go files that import \"unsafe\"") + } + f := strings.Fields(cmd) + if len(f) != 3 { + Yyerror("usage: //go:linkname localname linkname") + return c + } + + Lookup(f[1]).Linkname = f[2] + return c + } + + if verb == "go:nointerface" && obj.Fieldtrack_enabled != 0 { + nointerface = true + return c + } + + if verb == "go:noescape" { + noescape = true + return c + } + + if verb == "go:norace" { + norace = true + return c + } + + if verb == "go:nosplit" { + nosplit = true + return c + } + + if verb == "go:systemstack" { + systemstack = true + return c + } + + if verb == "go:nowritebarrier" { + if compiling_runtime == 0 { + Yyerror("//go:nowritebarrier only allowed in runtime") + } + nowritebarrier = true + return c + } + return c + } + if c != 'l' { + return c + } + for i := 1; i < 5; i++ { + c = int(getr()) + if c != int("line "[i]) { + return c + } + } + + cp := &lexbuf + cp.Reset() + linep := 0 + for { + c = int(getr()) + if c == EOF { + return c + } + if c == '\n' { + break + } + if c == ' ' { + continue + } + if c == ':' { + linep = cp.Len() + 1 + } + cp.WriteByte(byte(c)) + } + + cp = nil + + if linep == 0 { + return c + } + text := strings.TrimSuffix(lexbuf.String(), "\r") + n := 0 + for _, c := range text[linep:] { + if c < '0' || c > '9' { + goto out + } + n = n*10 + int(c) - '0' + if n > 1e8 { + Yyerror("line number out of range") + errorexit() + } + } + + if n <= 0 { + return c + } + + name = text[:linep-1] + linehistupdate(name, n) + return c + +out: + return c +} + +func getimpsym(pp *string) string { + more(pp) // skip spaces + p := *pp + if p == "" || p[0] == '"' { + return "" + } + i := 0 + for i < len(p) && !yy_isspace(int(p[i])) && p[i] != '"' { + i++ + } + sym := p[:i] + *pp = p[i:] + return sym +} + +func getquoted(pp *string) (string, bool) { + more(pp) // skip spaces + p := *pp + if p == "" || p[0] != '"' { + return "", false + } + p = p[1:] + i := strings.Index(p, `"`) + if i < 0 { + return "", false + } + *pp = p[i+1:] + return p[:i], true +} + +// Copied nearly verbatim from the C compiler's #pragma parser. +// TODO: Rewrite more cleanly once the compiler is written in Go. +func pragcgo(text string) { + var q string + + if i := strings.Index(text, " "); i >= 0 { + text, q = text[:i], text[i:] + } + + verb := text[3:] // skip "go:" + + if verb == "cgo_dynamic_linker" || verb == "dynlinker" { + var ok bool + var p string + p, ok = getquoted(&q) + if !ok { + Yyerror("usage: //go:cgo_dynamic_linker \"path\"") + return + } + pragcgobuf += fmt.Sprintf("cgo_dynamic_linker %v\n", plan9quote(p)) + return + + } + + if verb == "dynexport" { + verb = "cgo_export_dynamic" + } + if verb == "cgo_export_static" || verb == "cgo_export_dynamic" { + local := getimpsym(&q) + var remote string + if local == "" { + goto err2 + } + if !more(&q) { + pragcgobuf += fmt.Sprintf("%s %v\n", verb, plan9quote(local)) + return + } + + remote = getimpsym(&q) + if remote == "" { + goto err2 + } + pragcgobuf += fmt.Sprintf("%s %v %v\n", verb, plan9quote(local), plan9quote(remote)) + return + + err2: + Yyerror("usage: //go:%s local [remote]", verb) + return + } + + if verb == "cgo_import_dynamic" || verb == "dynimport" { + var ok bool + local := getimpsym(&q) + var p string + var remote string + if local == "" { + goto err3 + } + if !more(&q) { + pragcgobuf += fmt.Sprintf("cgo_import_dynamic %v\n", plan9quote(local)) + return + } + + remote = getimpsym(&q) + if remote == "" { + goto err3 + } + if !more(&q) { + pragcgobuf += fmt.Sprintf("cgo_import_dynamic %v %v\n", plan9quote(local), plan9quote(remote)) + return + } + + p, ok = getquoted(&q) + if !ok { + goto err3 + } + pragcgobuf += fmt.Sprintf("cgo_import_dynamic %v %v %v\n", plan9quote(local), plan9quote(remote), plan9quote(p)) + return + + err3: + Yyerror("usage: //go:cgo_import_dynamic local [remote [\"library\"]]") + return + } + + if verb == "cgo_import_static" { + local := getimpsym(&q) + if local == "" || more(&q) { + Yyerror("usage: //go:cgo_import_static local") + return + } + pragcgobuf += fmt.Sprintf("cgo_import_static %v\n", plan9quote(local)) + return + + } + + if verb == "cgo_ldflag" { + var ok bool + var p string + p, ok = getquoted(&q) + if !ok { + Yyerror("usage: //go:cgo_ldflag \"arg\"") + return + } + pragcgobuf += fmt.Sprintf("cgo_ldflag %v\n", plan9quote(p)) + return + + } +} + +type yy struct{} + +func (yy) Lex(v *yySymType) int { + return int(yylex(v)) +} + +func (yy) Error(msg string) { + Yyerror("%s", msg) +} + +var theparser yyParser +var parsing bool + +func yyparse() { + theparser = yyNewParser() + parsing = true + theparser.Parse(yy{}) + parsing = false +} + +func yylex(yylval *yySymType) int32 { + lx := int(_yylex(yylval)) + + if curio.nlsemi != 0 && lx == EOF { + // Treat EOF as "end of line" for the purposes + // of inserting a semicolon. + lx = ';' + } + + switch lx { + case LNAME, + LLITERAL, + LBREAK, + LCONTINUE, + LFALL, + LRETURN, + LINC, + LDEC, + ')', + '}', + ']': + curio.nlsemi = 1 + + default: + curio.nlsemi = 0 + } + + // Track last two tokens returned by yylex. + yyprev = yylast + + yylast = lx + return int32(lx) +} + +func getc() int { + c := curio.peekc + if c != 0 { + curio.peekc = curio.peekc1 + curio.peekc1 = 0 + goto check + } + + if curio.bin == nil { + if len(curio.cp) == 0 { + c = 0 + } else { + c = int(curio.cp[0]) + curio.cp = curio.cp[1:] + } + } else { + loop: + c = obj.Bgetc(curio.bin) + if c == 0xef { + buf, err := curio.bin.Peek(2) + if err != nil { + log.Fatalf("getc: peeking: %v", err) + } + if buf[0] == 0xbb && buf[1] == 0xbf { + yyerrorl(int(lexlineno), "Unicode (UTF-8) BOM in middle of file") + + // consume BOM bytes + obj.Bgetc(curio.bin) + obj.Bgetc(curio.bin) + goto loop + } + } + } + +check: + switch c { + case 0: + if curio.bin != nil { + Yyerror("illegal NUL byte") + break + } + fallthrough + + // insert \n at EOF + case EOF: + if curio.eofnl != 0 || curio.last == '\n' { + return EOF + } + curio.eofnl = 1 + c = '\n' + fallthrough + + case '\n': + if pushedio.bin == nil { + lexlineno++ + } + } + + curio.last = c + return c +} + +func ungetc(c int) { + curio.peekc1 = curio.peekc + curio.peekc = c + if c == '\n' && pushedio.bin == nil { + lexlineno-- + } +} + +func getr() int32 { + var buf [utf8.UTFMax]byte + + for i := 0; ; i++ { + c := getc() + if i == 0 && c < utf8.RuneSelf { + return int32(c) + } + buf[i] = byte(c) + if i+1 == len(buf) || utf8.FullRune(buf[:i+1]) { + r, w := utf8.DecodeRune(buf[:i+1]) + if r == utf8.RuneError && w == 1 { + lineno = lexlineno + // The string conversion here makes a copy for passing + // to fmt.Printf, so that buf itself does not escape and can + // be allocated on the stack. + Yyerror("illegal UTF-8 sequence % x", string(buf[:i+1])) + } + return int32(r) + } + } +} + +func escchar(e int, escflg *int, val *int64) bool { + *escflg = 0 + + c := int(getr()) + switch c { + case EOF: + Yyerror("eof in string") + return true + + case '\n': + Yyerror("newline in string") + return true + + case '\\': + break + + default: + if c == e { + return true + } + *val = int64(c) + return false + } + + u := 0 + c = int(getr()) + var i int + switch c { + case 'x': + *escflg = 1 // it's a byte + i = 2 + goto hex + + case 'u': + i = 4 + u = 1 + goto hex + + case 'U': + i = 8 + u = 1 + goto hex + + case '0', + '1', + '2', + '3', + '4', + '5', + '6', + '7': + *escflg = 1 // it's a byte + l := int64(c) - '0' + for i := 2; i > 0; i-- { + c = getc() + if c >= '0' && c <= '7' { + l = l*8 + int64(c) - '0' + continue + } + + Yyerror("non-octal character in escape sequence: %c", c) + ungetc(c) + } + + if l > 255 { + Yyerror("octal escape value > 255: %d", l) + } + + *val = l + return false + + case 'a': + c = '\a' + case 'b': + c = '\b' + case 'f': + c = '\f' + case 'n': + c = '\n' + case 'r': + c = '\r' + case 't': + c = '\t' + case 'v': + c = '\v' + case '\\': + c = '\\' + + default: + if c != e { + Yyerror("unknown escape sequence: %c", c) + } + } + + *val = int64(c) + return false + +hex: + l := int64(0) + for ; i > 0; i-- { + c = getc() + if c >= '0' && c <= '9' { + l = l*16 + int64(c) - '0' + continue + } + + if c >= 'a' && c <= 'f' { + l = l*16 + int64(c) - 'a' + 10 + continue + } + + if c >= 'A' && c <= 'F' { + l = l*16 + int64(c) - 'A' + 10 + continue + } + + Yyerror("non-hex character in escape sequence: %c", c) + ungetc(c) + break + } + + if u != 0 && (l > utf8.MaxRune || (0xd800 <= l && l < 0xe000)) { + Yyerror("invalid Unicode code point in escape sequence: %#x", l) + l = utf8.RuneError + } + + *val = l + return false +} + +var syms = []struct { + name string + lexical int + etype int + op int +}{ + /* basic types */ + {"int8", LNAME, TINT8, OXXX}, + {"int16", LNAME, TINT16, OXXX}, + {"int32", LNAME, TINT32, OXXX}, + {"int64", LNAME, TINT64, OXXX}, + {"uint8", LNAME, TUINT8, OXXX}, + {"uint16", LNAME, TUINT16, OXXX}, + {"uint32", LNAME, TUINT32, OXXX}, + {"uint64", LNAME, TUINT64, OXXX}, + {"float32", LNAME, TFLOAT32, OXXX}, + {"float64", LNAME, TFLOAT64, OXXX}, + {"complex64", LNAME, TCOMPLEX64, OXXX}, + {"complex128", LNAME, TCOMPLEX128, OXXX}, + {"bool", LNAME, TBOOL, OXXX}, + {"string", LNAME, TSTRING, OXXX}, + {"any", LNAME, TANY, OXXX}, + {"break", LBREAK, Txxx, OXXX}, + {"case", LCASE, Txxx, OXXX}, + {"chan", LCHAN, Txxx, OXXX}, + {"const", LCONST, Txxx, OXXX}, + {"continue", LCONTINUE, Txxx, OXXX}, + {"default", LDEFAULT, Txxx, OXXX}, + {"else", LELSE, Txxx, OXXX}, + {"defer", LDEFER, Txxx, OXXX}, + {"fallthrough", LFALL, Txxx, OXXX}, + {"for", LFOR, Txxx, OXXX}, + {"func", LFUNC, Txxx, OXXX}, + {"go", LGO, Txxx, OXXX}, + {"goto", LGOTO, Txxx, OXXX}, + {"if", LIF, Txxx, OXXX}, + {"import", LIMPORT, Txxx, OXXX}, + {"interface", LINTERFACE, Txxx, OXXX}, + {"map", LMAP, Txxx, OXXX}, + {"package", LPACKAGE, Txxx, OXXX}, + {"range", LRANGE, Txxx, OXXX}, + {"return", LRETURN, Txxx, OXXX}, + {"select", LSELECT, Txxx, OXXX}, + {"struct", LSTRUCT, Txxx, OXXX}, + {"switch", LSWITCH, Txxx, OXXX}, + {"type", LTYPE, Txxx, OXXX}, + {"var", LVAR, Txxx, OXXX}, + {"append", LNAME, Txxx, OAPPEND}, + {"cap", LNAME, Txxx, OCAP}, + {"close", LNAME, Txxx, OCLOSE}, + {"complex", LNAME, Txxx, OCOMPLEX}, + {"copy", LNAME, Txxx, OCOPY}, + {"delete", LNAME, Txxx, ODELETE}, + {"imag", LNAME, Txxx, OIMAG}, + {"len", LNAME, Txxx, OLEN}, + {"make", LNAME, Txxx, OMAKE}, + {"new", LNAME, Txxx, ONEW}, + {"panic", LNAME, Txxx, OPANIC}, + {"print", LNAME, Txxx, OPRINT}, + {"println", LNAME, Txxx, OPRINTN}, + {"real", LNAME, Txxx, OREAL}, + {"recover", LNAME, Txxx, ORECOVER}, + {"notwithstanding", LIGNORE, Txxx, OXXX}, + {"thetruthofthematter", LIGNORE, Txxx, OXXX}, + {"despiteallobjections", LIGNORE, Txxx, OXXX}, + {"whereas", LIGNORE, Txxx, OXXX}, + {"insofaras", LIGNORE, Txxx, OXXX}, +} + +func lexinit() { + var lex int + var s *Sym + var s1 *Sym + var t *Type + var etype int + + /* + * initialize basic types array + * initialize known symbols + */ + for i := 0; i < len(syms); i++ { + lex = syms[i].lexical + s = Lookup(syms[i].name) + s.Lexical = uint16(lex) + + etype = syms[i].etype + if etype != Txxx { + if etype < 0 || etype >= len(Types) { + Fatal("lexinit: %s bad etype", s.Name) + } + s1 = Pkglookup(syms[i].name, builtinpkg) + t = Types[etype] + if t == nil { + t = typ(etype) + t.Sym = s1 + + if etype != TANY && etype != TSTRING { + dowidth(t) + } + Types[etype] = t + } + + s1.Lexical = LNAME + s1.Def = typenod(t) + s1.Def.Name = new(Name) + continue + } + + etype = syms[i].op + if etype != OXXX { + s1 = Pkglookup(syms[i].name, builtinpkg) + s1.Lexical = LNAME + s1.Def = Nod(ONAME, nil, nil) + s1.Def.Sym = s1 + s1.Def.Etype = uint8(etype) + } + } + + // logically, the type of a string literal. + // types[TSTRING] is the named type string + // (the type of x in var x string or var x = "hello"). + // this is the ideal form + // (the type of x in const x = "hello"). + idealstring = typ(TSTRING) + + idealbool = typ(TBOOL) + + s = Pkglookup("true", builtinpkg) + s.Def = Nodbool(true) + s.Def.Sym = Lookup("true") + s.Def.Name = new(Name) + s.Def.Type = idealbool + + s = Pkglookup("false", builtinpkg) + s.Def = Nodbool(false) + s.Def.Sym = Lookup("false") + s.Def.Name = new(Name) + s.Def.Type = idealbool + + s = Lookup("_") + s.Block = -100 + s.Def = Nod(ONAME, nil, nil) + s.Def.Sym = s + Types[TBLANK] = typ(TBLANK) + s.Def.Type = Types[TBLANK] + nblank = s.Def + + s = Pkglookup("_", builtinpkg) + s.Block = -100 + s.Def = Nod(ONAME, nil, nil) + s.Def.Sym = s + Types[TBLANK] = typ(TBLANK) + s.Def.Type = Types[TBLANK] + + Types[TNIL] = typ(TNIL) + s = Pkglookup("nil", builtinpkg) + var v Val + v.U = new(NilVal) + s.Def = nodlit(v) + s.Def.Sym = s + s.Def.Name = new(Name) +} + +func lexinit1() { + // t = interface { Error() string } + rcvr := typ(TSTRUCT) + + rcvr.Type = typ(TFIELD) + rcvr.Type.Type = Ptrto(typ(TSTRUCT)) + rcvr.Funarg = 1 + in := typ(TSTRUCT) + in.Funarg = 1 + out := typ(TSTRUCT) + out.Type = typ(TFIELD) + out.Type.Type = Types[TSTRING] + out.Funarg = 1 + f := typ(TFUNC) + *getthis(f) = rcvr + *Getoutarg(f) = out + *getinarg(f) = in + f.Thistuple = 1 + f.Intuple = 0 + f.Outnamed = 0 + f.Outtuple = 1 + t := typ(TINTER) + t.Type = typ(TFIELD) + t.Type.Sym = Lookup("Error") + t.Type.Type = f + + // error type + s := Lookup("error") + + s.Lexical = LNAME + s1 := Pkglookup("error", builtinpkg) + errortype = t + errortype.Sym = s1 + s1.Lexical = LNAME + s1.Def = typenod(errortype) + + // byte alias + s = Lookup("byte") + + s.Lexical = LNAME + s1 = Pkglookup("byte", builtinpkg) + bytetype = typ(TUINT8) + bytetype.Sym = s1 + s1.Lexical = LNAME + s1.Def = typenod(bytetype) + s1.Def.Name = new(Name) + + // rune alias + s = Lookup("rune") + + s.Lexical = LNAME + s1 = Pkglookup("rune", builtinpkg) + runetype = typ(TINT32) + runetype.Sym = s1 + s1.Lexical = LNAME + s1.Def = typenod(runetype) + s1.Def.Name = new(Name) +} + +func lexfini() { + var s *Sym + var lex int + var etype int + var i int + + for i = 0; i < len(syms); i++ { + lex = syms[i].lexical + if lex != LNAME { + continue + } + s = Lookup(syms[i].name) + s.Lexical = uint16(lex) + + etype = syms[i].etype + if etype != Txxx && (etype != TANY || Debug['A'] != 0) && s.Def == nil { + s.Def = typenod(Types[etype]) + s.Def.Name = new(Name) + s.Origpkg = builtinpkg + } + + etype = syms[i].op + if etype != OXXX && s.Def == nil { + s.Def = Nod(ONAME, nil, nil) + s.Def.Sym = s + s.Def.Etype = uint8(etype) + s.Origpkg = builtinpkg + } + } + + // backend-specific builtin types (e.g. int). + for i = range Thearch.Typedefs { + s = Lookup(Thearch.Typedefs[i].Name) + if s.Def == nil { + s.Def = typenod(Types[Thearch.Typedefs[i].Etype]) + s.Def.Name = new(Name) + s.Origpkg = builtinpkg + } + } + + // there's only so much table-driven we can handle. + // these are special cases. + s = Lookup("byte") + + if s.Def == nil { + s.Def = typenod(bytetype) + s.Def.Name = new(Name) + s.Origpkg = builtinpkg + } + + s = Lookup("error") + if s.Def == nil { + s.Def = typenod(errortype) + s.Def.Name = new(Name) + s.Origpkg = builtinpkg + } + + s = Lookup("rune") + if s.Def == nil { + s.Def = typenod(runetype) + s.Def.Name = new(Name) + s.Origpkg = builtinpkg + } + + s = Lookup("nil") + if s.Def == nil { + var v Val + v.U = new(NilVal) + s.Def = nodlit(v) + s.Def.Sym = s + s.Def.Name = new(Name) + s.Origpkg = builtinpkg + } + + s = Lookup("iota") + if s.Def == nil { + s.Def = Nod(OIOTA, nil, nil) + s.Def.Sym = s + s.Origpkg = builtinpkg + } + + s = Lookup("true") + if s.Def == nil { + s.Def = Nodbool(true) + s.Def.Sym = s + s.Def.Name = new(Name) + s.Origpkg = builtinpkg + } + + s = Lookup("false") + if s.Def == nil { + s.Def = Nodbool(false) + s.Def.Sym = s + s.Def.Name = new(Name) + s.Origpkg = builtinpkg + } + + nodfp = Nod(ONAME, nil, nil) + nodfp.Type = Types[TINT32] + nodfp.Xoffset = 0 + nodfp.Class = PPARAM + nodfp.Sym = Lookup(".fp") +} + +var lexn = []struct { + lex int + name string +}{ + {LANDAND, "ANDAND"}, + {LANDNOT, "ANDNOT"}, + {LASOP, "ASOP"}, + {LBREAK, "BREAK"}, + {LCASE, "CASE"}, + {LCHAN, "CHAN"}, + {LCOLAS, "COLAS"}, + {LCOMM, "<-"}, + {LCONST, "CONST"}, + {LCONTINUE, "CONTINUE"}, + {LDDD, "..."}, + {LDEC, "DEC"}, + {LDEFAULT, "DEFAULT"}, + {LDEFER, "DEFER"}, + {LELSE, "ELSE"}, + {LEQ, "EQ"}, + {LFALL, "FALL"}, + {LFOR, "FOR"}, + {LFUNC, "FUNC"}, + {LGE, "GE"}, + {LGO, "GO"}, + {LGOTO, "GOTO"}, + {LGT, "GT"}, + {LIF, "IF"}, + {LIMPORT, "IMPORT"}, + {LINC, "INC"}, + {LINTERFACE, "INTERFACE"}, + {LLE, "LE"}, + {LLITERAL, "LITERAL"}, + {LLSH, "LSH"}, + {LLT, "LT"}, + {LMAP, "MAP"}, + {LNAME, "NAME"}, + {LNE, "NE"}, + {LOROR, "OROR"}, + {LPACKAGE, "PACKAGE"}, + {LRANGE, "RANGE"}, + {LRETURN, "RETURN"}, + {LRSH, "RSH"}, + {LSELECT, "SELECT"}, + {LSTRUCT, "STRUCT"}, + {LSWITCH, "SWITCH"}, + {LTYPE, "TYPE"}, + {LVAR, "VAR"}, +} + +func lexname(lex int) string { + for i := 0; i < len(lexn); i++ { + if lexn[i].lex == lex { + return lexn[i].name + } + } + return fmt.Sprintf("LEX-%d", lex) +} + +var yytfix = []struct { + have string + want string +}{ + {"$end", "EOF"}, + {"LASOP", "op="}, + {"LBREAK", "break"}, + {"LCASE", "case"}, + {"LCHAN", "chan"}, + {"LCOLAS", ":="}, + {"LCONST", "const"}, + {"LCONTINUE", "continue"}, + {"LDDD", "..."}, + {"LDEFAULT", "default"}, + {"LDEFER", "defer"}, + {"LELSE", "else"}, + {"LFALL", "fallthrough"}, + {"LFOR", "for"}, + {"LFUNC", "func"}, + {"LGO", "go"}, + {"LGOTO", "goto"}, + {"LIF", "if"}, + {"LIMPORT", "import"}, + {"LINTERFACE", "interface"}, + {"LMAP", "map"}, + {"LNAME", "name"}, + {"LPACKAGE", "package"}, + {"LRANGE", "range"}, + {"LRETURN", "return"}, + {"LSELECT", "select"}, + {"LSTRUCT", "struct"}, + {"LSWITCH", "switch"}, + {"LTYPE", "type"}, + {"LVAR", "var"}, + {"LANDAND", "&&"}, + {"LANDNOT", "&^"}, + {"LBODY", "{"}, + {"LCOMM", "<-"}, + {"LDEC", "--"}, + {"LINC", "++"}, + {"LEQ", "=="}, + {"LGE", ">="}, + {"LGT", ">"}, + {"LLE", "<="}, + {"LLT", "<"}, + {"LLSH", "<<"}, + {"LRSH", ">>"}, + {"LOROR", "||"}, + {"LNE", "!="}, + // spell out to avoid confusion with punctuation in error messages + {"';'", "semicolon or newline"}, + {"','", "comma"}, +} + +func init() { + yyErrorVerbose = true + +Outer: + for i, s := range yyToknames { + // Apply yytfix if possible. + for _, fix := range yytfix { + if s == fix.have { + yyToknames[i] = fix.want + continue Outer + } + } + + // Turn 'x' into x. + if len(s) == 3 && s[0] == '\'' && s[2] == '\'' { + yyToknames[i] = s[1:2] + continue + } + } +} + +func pkgnotused(lineno int, path string, name string) { + // If the package was imported with a name other than the final + // import path element, show it explicitly in the error message. + // Note that this handles both renamed imports and imports of + // packages containing unconventional package declarations. + // Note that this uses / always, even on Windows, because Go import + // paths always use forward slashes. + elem := path + if i := strings.LastIndex(elem, "/"); i >= 0 { + elem = elem[i+1:] + } + if name == "" || elem == name { + yyerrorl(int(lineno), "imported and not used: %q", path) + } else { + yyerrorl(int(lineno), "imported and not used: %q as %s", path, name) + } +} + +func mkpackage(pkgname string) { + if localpkg.Name == "" { + if pkgname == "_" { + Yyerror("invalid package name _") + } + localpkg.Name = pkgname + } else { + if pkgname != localpkg.Name { + Yyerror("package %s; expected %s", pkgname, localpkg.Name) + } + for _, s := range localpkg.Syms { + if s.Def == nil { + continue + } + if s.Def.Op == OPACK { + // throw away top-level package name leftover + // from previous file. + // leave s->block set to cause redeclaration + // errors if a conflicting top-level name is + // introduced by a different file. + if !s.Def.Used && nsyntaxerrors == 0 { + pkgnotused(int(s.Def.Lineno), s.Def.Name.Pkg.Path, s.Name) + } + s.Def = nil + continue + } + + if s.Def.Sym != s { + // throw away top-level name left over + // from previous import . "x" + if s.Def.Name != nil && s.Def.Name.Pack != nil && !s.Def.Name.Pack.Used && nsyntaxerrors == 0 { + pkgnotused(int(s.Def.Name.Pack.Lineno), s.Def.Name.Pack.Name.Pkg.Path, "") + s.Def.Name.Pack.Used = true + } + + s.Def = nil + continue + } + } + } + + if outfile == "" { + p := infile + if i := strings.LastIndex(p, "/"); i >= 0 { + p = p[i+1:] + } + if Ctxt.Windows != 0 { + if i := strings.LastIndex(p, `\`); i >= 0 { + p = p[i+1:] + } + } + if i := strings.LastIndex(p, "."); i >= 0 { + p = p[:i] + } + suffix := ".o" + if writearchive > 0 { + suffix = ".a" + } + outfile = p + suffix + } +} diff --git a/src/cmd/compile/internal/gc/mkbuiltin.go b/src/cmd/compile/internal/gc/mkbuiltin.go new file mode 100644 index 0000000000000000000000000000000000000000..ea3877f280eaac676f8e8a12897b872c65893f6a --- /dev/null +++ b/src/cmd/compile/internal/gc/mkbuiltin.go @@ -0,0 +1,97 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build ignore + +// Generate builtin.go from $* (runtime.go and unsafe.go). +// Run this after changing runtime.go and unsafe.go +// or after changing the export metadata format in the compiler. +// Either way, you need to have a working compiler binary first. +package main + +import ( + "bufio" + "fmt" + "io" + "log" + "os" + "os/exec" + "strings" +) + +func main() { + f, err := os.Create("builtin.go") + if err != nil { + log.Fatal(err) + } + defer f.Close() + w := bufio.NewWriter(f) + + fmt.Fprintln(w, "// AUTO-GENERATED by mkbuiltin.go; DO NOT EDIT") + fmt.Fprintln(w, "") + fmt.Fprintln(w, "package gc") + + for _, name := range os.Args[1:] { + mkbuiltin(w, name) + } + + if err := w.Flush(); err != nil { + log.Fatal(err) + } +} + +// Compile .go file, import data from .6 file, and write Go string version. +func mkbuiltin(w io.Writer, name string) { + if err := exec.Command("go", "tool", "compile", "-A", "builtin/"+name+".go").Run(); err != nil { + log.Fatal(err) + } + obj := name + ".o" + defer os.Remove(obj) + + r, err := os.Open(obj) + if err != nil { + log.Fatal(err) + } + defer r.Close() + scanner := bufio.NewScanner(r) + + // Look for $$ that introduces imports. + for scanner.Scan() { + if strings.Contains(scanner.Text(), "$$") { + goto Begin + } + } + log.Fatal("did not find beginning of imports") + +Begin: + initfunc := fmt.Sprintf("init_%s_function", name) + + fmt.Fprintf(w, "\nconst %simport = \"\" +\n", name) + + // sys.go claims to be in package PACKAGE to avoid + // conflicts during "go tool compile sys.go". Rename PACKAGE to $2. + replacer := strings.NewReplacer("PACKAGE", name) + + // Process imports, stopping at $$ that closes them. + for scanner.Scan() { + p := scanner.Text() + if strings.Contains(p, "$$") { + goto End + } + + // Chop leading white space. + p = strings.TrimLeft(p, " \t") + + // Cut out decl of init_$1_function - it doesn't exist. + if strings.Contains(p, initfunc) { + continue + } + + fmt.Fprintf(w, "\t%q +\n", replacer.Replace(p)+"\n") + } + log.Fatal("did not find end of imports") + +End: + fmt.Fprintf(w, "\t\"$$\\n\"\n") +} diff --git a/src/cmd/compile/internal/gc/mparith2.go b/src/cmd/compile/internal/gc/mparith2.go new file mode 100644 index 0000000000000000000000000000000000000000..2c7e5176acb3a9a77930e86e521592b5b6f6c007 --- /dev/null +++ b/src/cmd/compile/internal/gc/mparith2.go @@ -0,0 +1,300 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package gc + +import ( + "cmd/compile/internal/big" + "cmd/internal/obj" + "fmt" +) + +/// implements fix arithmetic + +func mpsetovf(a *Mpint) { + a.Val.SetUint64(1) // avoid spurious div-zero errors + a.Ovf = true +} + +func mptestovf(a *Mpint, extra int) bool { + // We don't need to be precise here, any reasonable upper limit would do. + // For now, use existing limit so we pass all the tests unchanged. + if a.Val.BitLen()+extra > Mpprec { + mpsetovf(a) + } + return a.Ovf +} + +func mpmovefixfix(a, b *Mpint) { + a.Val.Set(&b.Val) +} + +func mpmovefltfix(a *Mpint, b *Mpflt) int { + if _, acc := b.Val.Int(&a.Val); acc == big.Exact { + return 0 + } + + const delta = 16 // a reasonably small number of bits > 0 + var t big.Float + t.SetPrec(Mpprec - delta) + + // try rounding down a little + t.SetMode(big.ToZero) + t.Set(&b.Val) + if _, acc := t.Int(&a.Val); acc == big.Exact { + return 0 + } + + // try rounding up a little + t.SetMode(big.AwayFromZero) + t.Set(&b.Val) + if _, acc := t.Int(&a.Val); acc == big.Exact { + return 0 + } + + return -1 +} + +func mpaddfixfix(a, b *Mpint, quiet int) { + if a.Ovf || b.Ovf { + if nsavederrors+nerrors == 0 { + Yyerror("ovf in mpaddfixfix") + } + mpsetovf(a) + return + } + + a.Val.Add(&a.Val, &b.Val) + + if mptestovf(a, 0) && quiet == 0 { + Yyerror("constant addition overflow") + } +} + +func mpsubfixfix(a, b *Mpint) { + if a.Ovf || b.Ovf { + if nsavederrors+nerrors == 0 { + Yyerror("ovf in mpsubfixfix") + } + mpsetovf(a) + return + } + + a.Val.Sub(&a.Val, &b.Val) + + if mptestovf(a, 0) { + Yyerror("constant subtraction overflow") + } +} + +func mpmulfixfix(a, b *Mpint) { + if a.Ovf || b.Ovf { + if nsavederrors+nerrors == 0 { + Yyerror("ovf in mpmulfixfix") + } + mpsetovf(a) + return + } + + a.Val.Mul(&a.Val, &b.Val) + + if mptestovf(a, 0) { + Yyerror("constant multiplication overflow") + } +} + +func mpdivfixfix(a, b *Mpint) { + if a.Ovf || b.Ovf { + if nsavederrors+nerrors == 0 { + Yyerror("ovf in mpdivfixfix") + } + mpsetovf(a) + return + } + + a.Val.Quo(&a.Val, &b.Val) + + if mptestovf(a, 0) { + // can only happen for div-0 which should be checked elsewhere + Yyerror("constant division overflow") + } +} + +func mpmodfixfix(a, b *Mpint) { + if a.Ovf || b.Ovf { + if nsavederrors+nerrors == 0 { + Yyerror("ovf in mpmodfixfix") + } + mpsetovf(a) + return + } + + a.Val.Rem(&a.Val, &b.Val) + + if mptestovf(a, 0) { + // should never happen + Yyerror("constant modulo overflow") + } +} + +func mporfixfix(a, b *Mpint) { + if a.Ovf || b.Ovf { + if nsavederrors+nerrors == 0 { + Yyerror("ovf in mporfixfix") + } + mpsetovf(a) + return + } + + a.Val.Or(&a.Val, &b.Val) +} + +func mpandfixfix(a, b *Mpint) { + if a.Ovf || b.Ovf { + if nsavederrors+nerrors == 0 { + Yyerror("ovf in mpandfixfix") + } + mpsetovf(a) + return + } + + a.Val.And(&a.Val, &b.Val) +} + +func mpandnotfixfix(a, b *Mpint) { + if a.Ovf || b.Ovf { + if nsavederrors+nerrors == 0 { + Yyerror("ovf in mpandnotfixfix") + } + mpsetovf(a) + return + } + + a.Val.AndNot(&a.Val, &b.Val) +} + +func mpxorfixfix(a, b *Mpint) { + if a.Ovf || b.Ovf { + if nsavederrors+nerrors == 0 { + Yyerror("ovf in mpxorfixfix") + } + mpsetovf(a) + return + } + + a.Val.Xor(&a.Val, &b.Val) +} + +// shift left by s (or right by -s) +func Mpshiftfix(a *Mpint, s int) { + switch { + case s > 0: + if mptestovf(a, s) { + Yyerror("constant shift overflow") + return + } + a.Val.Lsh(&a.Val, uint(s)) + case s < 0: + a.Val.Rsh(&a.Val, uint(-s)) + } +} + +func mplshfixfix(a, b *Mpint) { + if a.Ovf || b.Ovf { + if nsavederrors+nerrors == 0 { + Yyerror("ovf in mplshfixfix") + } + mpsetovf(a) + return + } + + s := Mpgetfix(b) + if s < 0 || s >= Mpprec { + Yyerror("stupid shift: %d", s) + Mpmovecfix(a, 0) + return + } + + Mpshiftfix(a, int(s)) +} + +func mprshfixfix(a, b *Mpint) { + if a.Ovf || b.Ovf { + if nsavederrors+nerrors == 0 { + Yyerror("ovf in mprshfixfix") + } + mpsetovf(a) + return + } + + s := Mpgetfix(b) + if s < 0 || s >= Mpprec { + Yyerror("stupid shift: %d", s) + if a.Val.Sign() < 0 { + Mpmovecfix(a, -1) + } else { + Mpmovecfix(a, 0) + } + return + } + + Mpshiftfix(a, int(-s)) +} + +func Mpcmpfixfix(a, b *Mpint) int { + return a.Val.Cmp(&b.Val) +} + +func mpcmpfixc(b *Mpint, c int64) int { + return b.Val.Cmp(big.NewInt(c)) +} + +func mpnegfix(a *Mpint) { + a.Val.Neg(&a.Val) +} + +func Mpgetfix(a *Mpint) int64 { + if a.Ovf { + if nsavederrors+nerrors == 0 { + Yyerror("constant overflow") + } + return 0 + } + + return a.Val.Int64() +} + +func Mpmovecfix(a *Mpint, c int64) { + a.Val.SetInt64(c) +} + +func mpatofix(a *Mpint, as string) { + _, ok := a.Val.SetString(as, 0) + if !ok { + // required syntax is [+-][0[x]]d* + // At the moment we lose precise error cause; + // the old code distinguished between: + // - malformed hex constant + // - malformed octal constant + // - malformed decimal constant + // TODO(gri) use different conversion function + Yyerror("malformed integer constant: %s", as) + a.Val.SetUint64(0) + return + } + if mptestovf(a, 0) { + Yyerror("constant too large: %s", as) + } +} + +func (x *Mpint) String() string { + return Bconv(x, 0) +} + +func Bconv(xval *Mpint, flag int) string { + if flag&obj.FmtSharp != 0 { + return fmt.Sprintf("%#x", &xval.Val) + } + return xval.Val.String() +} diff --git a/src/cmd/compile/internal/gc/mparith3.go b/src/cmd/compile/internal/gc/mparith3.go new file mode 100644 index 0000000000000000000000000000000000000000..bf37f2d60786c4affce2dbb22975f09f3d648a89 --- /dev/null +++ b/src/cmd/compile/internal/gc/mparith3.go @@ -0,0 +1,250 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package gc + +import ( + "cmd/compile/internal/big" + "cmd/internal/obj" + "fmt" + "math" + "strings" +) + +/// implements float arihmetic + +func newMpflt() *Mpflt { + var a Mpflt + a.Val.SetPrec(Mpprec) + return &a +} + +func Mpmovefixflt(a *Mpflt, b *Mpint) { + if b.Ovf { + // sign doesn't really matter but copy anyway + a.Val.SetInf(b.Val.Sign() < 0) + return + } + a.Val.SetInt(&b.Val) +} + +func mpmovefltflt(a *Mpflt, b *Mpflt) { + a.Val.Set(&b.Val) +} + +func mpaddfltflt(a *Mpflt, b *Mpflt) { + if Mpdebug { + fmt.Printf("\n%v + %v", a, b) + } + + a.Val.Add(&a.Val, &b.Val) + + if Mpdebug { + fmt.Printf(" = %v\n\n", a) + } +} + +func mpaddcflt(a *Mpflt, c float64) { + var b Mpflt + + Mpmovecflt(&b, c) + mpaddfltflt(a, &b) +} + +func mpsubfltflt(a *Mpflt, b *Mpflt) { + if Mpdebug { + fmt.Printf("\n%v - %v", a, b) + } + + a.Val.Sub(&a.Val, &b.Val) + + if Mpdebug { + fmt.Printf(" = %v\n\n", a) + } +} + +func mpmulfltflt(a *Mpflt, b *Mpflt) { + if Mpdebug { + fmt.Printf("%v\n * %v\n", a, b) + } + + a.Val.Mul(&a.Val, &b.Val) + + if Mpdebug { + fmt.Printf(" = %v\n\n", a) + } +} + +func mpmulcflt(a *Mpflt, c float64) { + var b Mpflt + + Mpmovecflt(&b, c) + mpmulfltflt(a, &b) +} + +func mpdivfltflt(a *Mpflt, b *Mpflt) { + if Mpdebug { + fmt.Printf("%v\n / %v\n", a, b) + } + + a.Val.Quo(&a.Val, &b.Val) + + if Mpdebug { + fmt.Printf(" = %v\n\n", a) + } +} + +func mpcmpfltflt(a *Mpflt, b *Mpflt) int { + return a.Val.Cmp(&b.Val) +} + +func mpcmpfltc(b *Mpflt, c float64) int { + var a Mpflt + + Mpmovecflt(&a, c) + return mpcmpfltflt(b, &a) +} + +func mpgetflt(a *Mpflt) float64 { + x, _ := a.Val.Float64() + + // check for overflow + if math.IsInf(x, 0) && nsavederrors+nerrors == 0 { + Yyerror("mpgetflt ovf") + } + + return x +} + +func mpgetflt32(a *Mpflt) float64 { + x32, _ := a.Val.Float32() + x := float64(x32) + + // check for overflow + if math.IsInf(x, 0) && nsavederrors+nerrors == 0 { + Yyerror("mpgetflt32 ovf") + } + + return x +} + +func Mpmovecflt(a *Mpflt, c float64) { + if Mpdebug { + fmt.Printf("\nconst %g", c) + } + + a.Val.SetFloat64(c) + + if Mpdebug { + fmt.Printf(" = %v\n", a) + } +} + +func mpnegflt(a *Mpflt) { + a.Val.Neg(&a.Val) +} + +// +// floating point input +// required syntax is [+-]d*[.]d*[e[+-]d*] or [+-]0xH*[e[+-]d*] +// +func mpatoflt(a *Mpflt, as string) { + for len(as) > 0 && (as[0] == ' ' || as[0] == '\t') { + as = as[1:] + } + + // The spec requires accepting exponents that fit in int32. + // Don't accept much more than that. + // Count digits in exponent and stop early if there are too many. + if i := strings.Index(as, "e"); i >= 0 { + i++ + if i < len(as) && (as[i] == '-' || as[i] == '+') { + i++ + } + for i < len(as) && as[i] == '0' { + i++ + } + // TODO(rsc): This should be > 10, because we're supposed + // to accept any signed 32-bit int as an exponent. + // But that's not working terribly well, so we deviate from the + // spec in order to make sure that what we accept works. + // We can remove this restriction once those larger exponents work. + // See golang.org/issue/11326 and test/fixedbugs/issue11326*.go. + if len(as)-i > 8 { + Yyerror("malformed constant: %s (exponent too large)", as) + a.Val.SetUint64(0) + return + } + } + + f, ok := a.Val.SetString(as) + if !ok { + // At the moment we lose precise error cause; + // the old code additionally distinguished between: + // - malformed hex constant + // - decimal point in hex constant + // - constant exponent out of range + // - decimal point and binary point in constant + // TODO(gri) use different conversion function or check separately + Yyerror("malformed constant: %s", as) + a.Val.SetUint64(0) + return + } + + if f.IsInf() { + Yyerror("constant too large: %s", as) + a.Val.SetUint64(0) + return + } +} + +func (f *Mpflt) String() string { + return Fconv(f, 0) +} + +func Fconv(fvp *Mpflt, flag int) string { + if flag&obj.FmtSharp == 0 { + return fvp.Val.Text('b', 0) + } + + // use decimal format for error messages + + // determine sign + f := &fvp.Val + var sign string + if fvp.Val.Signbit() { + sign = "-" + f = new(big.Float).Abs(f) + } else if flag&obj.FmtSign != 0 { + sign = "+" + } + + // Use fmt formatting if in float64 range (common case). + if x, _ := f.Float64(); !math.IsInf(x, 0) { + return fmt.Sprintf("%s%.6g", sign, x) + } + + // Out of float64 range. Do approximate manual to decimal + // conversion to avoid precise but possibly slow Float + // formatting. The exponent is > 0 since a negative out- + // of-range exponent would have underflowed and led to 0. + // f = mant * 2**exp + var mant big.Float + exp := float64(f.MantExp(&mant)) // 0.5 <= mant < 1.0, exp > 0 + + // approximate float64 mantissa m and decimal exponent d + // f ~ m * 10**d + m, _ := mant.Float64() // 0.5 <= m < 1.0 + d := exp * (math.Ln2 / math.Ln10) // log_10(2) + + // adjust m for truncated (integer) decimal exponent e + e := int64(d) + m *= math.Pow(10, d-float64(e)) + for m >= 10 { + m /= 10 + e++ + } + + return fmt.Sprintf("%s%.5fe+%d", sign, m, e) +} diff --git a/src/cmd/compile/internal/gc/obj.go b/src/cmd/compile/internal/gc/obj.go new file mode 100644 index 0000000000000000000000000000000000000000..d2ac813a88b65916d9748ea8d94c3d05bab6fd06 --- /dev/null +++ b/src/cmd/compile/internal/gc/obj.go @@ -0,0 +1,450 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package gc + +import ( + "cmd/internal/obj" + "fmt" + "strconv" +) + +/* + * architecture-independent object file output + */ +const ( + ArhdrSize = 60 +) + +func formathdr(arhdr []byte, name string, size int64) { + copy(arhdr[:], fmt.Sprintf("%-16s%-12d%-6d%-6d%-8o%-10d`\n", name, 0, 0, 0, 0644, size)) +} + +func dumpobj() { + var err error + bout, err = obj.Bopenw(outfile) + if err != nil { + Flusherrors() + fmt.Printf("can't create %s: %v\n", outfile, err) + errorexit() + } + + startobj := int64(0) + var arhdr [ArhdrSize]byte + if writearchive != 0 { + obj.Bwritestring(bout, "!\n") + arhdr = [ArhdrSize]byte{} + bout.Write(arhdr[:]) + startobj = obj.Boffset(bout) + } + + fmt.Fprintf(bout, "go object %s %s %s %s\n", obj.Getgoos(), obj.Getgoarch(), obj.Getgoversion(), obj.Expstring()) + dumpexport() + + if writearchive != 0 { + bout.Flush() + size := obj.Boffset(bout) - startobj + if size&1 != 0 { + obj.Bputc(bout, 0) + } + obj.Bseek(bout, startobj-ArhdrSize, 0) + formathdr(arhdr[:], "__.PKGDEF", size) + bout.Write(arhdr[:]) + bout.Flush() + + obj.Bseek(bout, startobj+size+(size&1), 0) + arhdr = [ArhdrSize]byte{} + bout.Write(arhdr[:]) + startobj = obj.Boffset(bout) + fmt.Fprintf(bout, "go object %s %s %s %s\n", obj.Getgoos(), obj.Getgoarch(), obj.Getgoversion(), obj.Expstring()) + } + + if pragcgobuf != "" { + if writearchive != 0 { + // write empty export section; must be before cgo section + fmt.Fprintf(bout, "\n$$\n\n$$\n\n") + } + + fmt.Fprintf(bout, "\n$$ // cgo\n") + fmt.Fprintf(bout, "%s\n$$\n\n", pragcgobuf) + } + + fmt.Fprintf(bout, "\n!\n") + + var externs *NodeList + if externdcl != nil { + externs = externdcl.End + } + + dumpglobls() + dumptypestructs() + + // Dump extra globals. + tmp := externdcl + + if externs != nil { + externdcl = externs.Next + } + dumpglobls() + externdcl = tmp + + zero := Pkglookup("zerovalue", Runtimepkg) + ggloblsym(zero, int32(zerosize), obj.DUPOK|obj.RODATA) + + dumpdata() + obj.Writeobjdirect(Ctxt, bout) + + if writearchive != 0 { + bout.Flush() + size := obj.Boffset(bout) - startobj + if size&1 != 0 { + obj.Bputc(bout, 0) + } + obj.Bseek(bout, startobj-ArhdrSize, 0) + formathdr(arhdr[:], "_go_.o", size) + bout.Write(arhdr[:]) + } + + obj.Bterm(bout) +} + +func dumpglobls() { + var n *Node + + // add globals + for l := externdcl; l != nil; l = l.Next { + n = l.N + if n.Op != ONAME { + continue + } + + if n.Type == nil { + Fatal("external %v nil type\n", n) + } + if n.Class == PFUNC { + continue + } + if n.Sym.Pkg != localpkg { + continue + } + dowidth(n.Type) + + ggloblnod(n) + } + + for l := funcsyms; l != nil; l = l.Next { + n = l.N + dsymptr(n.Sym, 0, n.Sym.Def.Func.Shortname.Sym, 0) + ggloblsym(n.Sym, int32(Widthptr), obj.DUPOK|obj.RODATA) + } + + // Do not reprocess funcsyms on next dumpglobls call. + funcsyms = nil +} + +func Bputname(b *obj.Biobuf, s *obj.LSym) { + obj.Bwritestring(b, s.Name) + obj.Bputc(b, 0) +} + +func Linksym(s *Sym) *obj.LSym { + if s == nil { + return nil + } + if s.Lsym != nil { + return s.Lsym + } + var name string + if isblanksym(s) { + name = "_" + } else if s.Linkname != "" { + name = s.Linkname + } else { + name = s.Pkg.Prefix + "." + s.Name + } + + ls := obj.Linklookup(Ctxt, name, 0) + s.Lsym = ls + return ls +} + +func duintxx(s *Sym, off int, v uint64, wid int) int { + // Update symbol data directly instead of generating a + // DATA instruction that liblink will have to interpret later. + // This reduces compilation time and memory usage. + off = int(Rnd(int64(off), int64(wid))) + + return int(obj.Setuintxx(Ctxt, Linksym(s), int64(off), v, int64(wid))) +} + +func duint8(s *Sym, off int, v uint8) int { + return duintxx(s, off, uint64(v), 1) +} + +func duint16(s *Sym, off int, v uint16) int { + return duintxx(s, off, uint64(v), 2) +} + +func duint32(s *Sym, off int, v uint32) int { + return duintxx(s, off, uint64(v), 4) +} + +func duint64(s *Sym, off int, v uint64) int { + return duintxx(s, off, v, 8) +} + +func duintptr(s *Sym, off int, v uint64) int { + return duintxx(s, off, v, Widthptr) +} + +var stringsym_gen int + +func stringsym(s string) (hdr, data *Sym) { + var symname string + var pkg *Pkg + if len(s) > 100 { + // huge strings are made static to avoid long names + stringsym_gen++ + symname = fmt.Sprintf(".gostring.%d", stringsym_gen) + + pkg = localpkg + } else { + // small strings get named by their contents, + // so that multiple modules using the same string + // can share it. + symname = strconv.Quote(s) + pkg = gostringpkg + } + + symhdr := Pkglookup("hdr."+symname, pkg) + symdata := Pkglookup(symname, pkg) + + // SymUniq flag indicates that data is generated already + if symhdr.Flags&SymUniq != 0 { + return symhdr, symdata + } + symhdr.Flags |= SymUniq + symhdr.Def = newname(symhdr) + + // string header + off := 0 + off = dsymptr(symhdr, off, symdata, 0) + off = duintxx(symhdr, off, uint64(len(s)), Widthint) + ggloblsym(symhdr, int32(off), obj.DUPOK|obj.RODATA|obj.LOCAL) + + // string data + if symdata.Flags&SymUniq != 0 { + return symhdr, symdata + } + symdata.Flags |= SymUniq + symdata.Def = newname(symdata) + + off = 0 + var m int + for n := 0; n < len(s); n += m { + m = 8 + if m > len(s)-n { + m = len(s) - n + } + off = dsname(symdata, off, s[n:n+m]) + } + + off = duint8(symdata, off, 0) // terminating NUL for runtime + off = (off + Widthptr - 1) &^ (Widthptr - 1) // round to pointer alignment + ggloblsym(symdata, int32(off), obj.DUPOK|obj.RODATA|obj.LOCAL) + + return symhdr, symdata +} + +var slicebytes_gen int + +func slicebytes(nam *Node, s string, len int) { + var m int + + slicebytes_gen++ + symname := fmt.Sprintf(".gobytes.%d", slicebytes_gen) + sym := Pkglookup(symname, localpkg) + sym.Def = newname(sym) + + off := 0 + for n := 0; n < len; n += m { + m = 8 + if m > len-n { + m = len - n + } + off = dsname(sym, off, s[n:n+m]) + } + + ggloblsym(sym, int32(off), obj.NOPTR|obj.LOCAL) + + if nam.Op != ONAME { + Fatal("slicebytes %v", nam) + } + off = int(nam.Xoffset) + off = dsymptr(nam.Sym, off, sym, 0) + off = duintxx(nam.Sym, off, uint64(len), Widthint) + duintxx(nam.Sym, off, uint64(len), Widthint) +} + +func dstringptr(s *Sym, off int, str string) int { + off = int(Rnd(int64(off), int64(Widthptr))) + p := Thearch.Gins(obj.ADATA, nil, nil) + p.From.Type = obj.TYPE_MEM + p.From.Name = obj.NAME_EXTERN + p.From.Sym = Linksym(s) + p.From.Offset = int64(off) + p.From3 = new(obj.Addr) + p.From3.Type = obj.TYPE_CONST + p.From3.Offset = int64(Widthptr) + + Datastring(str+"\x00", &p.To) // TODO(rsc): Remove NUL + p.To.Type = obj.TYPE_ADDR + p.To.Etype = Simtype[TINT] + off += Widthptr + + return off +} + +func Datastring(s string, a *obj.Addr) { + _, symdata := stringsym(s) + a.Type = obj.TYPE_MEM + a.Name = obj.NAME_EXTERN + a.Sym = Linksym(symdata) + a.Node = symdata.Def + a.Offset = 0 + a.Etype = Simtype[TINT] +} + +func datagostring(sval string, a *obj.Addr) { + symhdr, _ := stringsym(sval) + a.Type = obj.TYPE_MEM + a.Name = obj.NAME_EXTERN + a.Sym = Linksym(symhdr) + a.Node = symhdr.Def + a.Offset = 0 + a.Etype = TSTRING +} + +func dgostringptr(s *Sym, off int, str string) int { + if str == "" { + return duintptr(s, off, 0) + } + return dgostrlitptr(s, off, &str) +} + +func dgostrlitptr(s *Sym, off int, lit *string) int { + if lit == nil { + return duintptr(s, off, 0) + } + off = int(Rnd(int64(off), int64(Widthptr))) + p := Thearch.Gins(obj.ADATA, nil, nil) + p.From.Type = obj.TYPE_MEM + p.From.Name = obj.NAME_EXTERN + p.From.Sym = Linksym(s) + p.From.Offset = int64(off) + p.From3 = new(obj.Addr) + p.From3.Type = obj.TYPE_CONST + p.From3.Offset = int64(Widthptr) + datagostring(*lit, &p.To) + p.To.Type = obj.TYPE_ADDR + p.To.Etype = Simtype[TINT] + off += Widthptr + + return off +} + +func dsname(s *Sym, off int, t string) int { + p := Thearch.Gins(obj.ADATA, nil, nil) + p.From.Type = obj.TYPE_MEM + p.From.Name = obj.NAME_EXTERN + p.From.Offset = int64(off) + p.From.Sym = Linksym(s) + p.From3 = new(obj.Addr) + p.From3.Type = obj.TYPE_CONST + p.From3.Offset = int64(len(t)) + + p.To.Type = obj.TYPE_SCONST + p.To.Val = t + return off + len(t) +} + +func dsymptr(s *Sym, off int, x *Sym, xoff int) int { + off = int(Rnd(int64(off), int64(Widthptr))) + + p := Thearch.Gins(obj.ADATA, nil, nil) + p.From.Type = obj.TYPE_MEM + p.From.Name = obj.NAME_EXTERN + p.From.Sym = Linksym(s) + p.From.Offset = int64(off) + p.From3 = new(obj.Addr) + p.From3.Type = obj.TYPE_CONST + p.From3.Offset = int64(Widthptr) + p.To.Type = obj.TYPE_ADDR + p.To.Name = obj.NAME_EXTERN + p.To.Sym = Linksym(x) + p.To.Offset = int64(xoff) + off += Widthptr + + return off +} + +func gdata(nam *Node, nr *Node, wid int) { + if nr.Op == OLITERAL { + switch nr.Val().Ctype() { + case CTCPLX: + gdatacomplex(nam, nr.Val().U.(*Mpcplx)) + return + + case CTSTR: + gdatastring(nam, nr.Val().U.(string)) + return + } + } + + p := Thearch.Gins(obj.ADATA, nam, nr) + p.From3 = new(obj.Addr) + p.From3.Type = obj.TYPE_CONST + p.From3.Offset = int64(wid) +} + +func gdatacomplex(nam *Node, cval *Mpcplx) { + w := cplxsubtype(int(nam.Type.Etype)) + w = int(Types[w].Width) + + p := Thearch.Gins(obj.ADATA, nam, nil) + p.From3 = new(obj.Addr) + p.From3.Type = obj.TYPE_CONST + p.From3.Offset = int64(w) + p.To.Type = obj.TYPE_FCONST + p.To.Val = mpgetflt(&cval.Real) + + p = Thearch.Gins(obj.ADATA, nam, nil) + p.From3 = new(obj.Addr) + p.From3.Type = obj.TYPE_CONST + p.From3.Offset = int64(w) + p.From.Offset += int64(w) + p.To.Type = obj.TYPE_FCONST + p.To.Val = mpgetflt(&cval.Imag) +} + +func gdatastring(nam *Node, sval string) { + var nod1 Node + + p := Thearch.Gins(obj.ADATA, nam, nil) + Datastring(sval, &p.To) + p.From3 = new(obj.Addr) + p.From3.Type = obj.TYPE_CONST + p.From3.Offset = Types[Tptr].Width + p.To.Type = obj.TYPE_ADDR + + //print("%v\n", p); + + Nodconst(&nod1, Types[TINT], int64(len(sval))) + + p = Thearch.Gins(obj.ADATA, nam, &nod1) + p.From3 = new(obj.Addr) + p.From3.Type = obj.TYPE_CONST + p.From3.Offset = int64(Widthint) + p.From.Offset += int64(Widthptr) +} diff --git a/src/cmd/compile/internal/gc/opnames.go b/src/cmd/compile/internal/gc/opnames.go new file mode 100644 index 0000000000000000000000000000000000000000..9134bd43329327d816de3021e901677621600e8f --- /dev/null +++ b/src/cmd/compile/internal/gc/opnames.go @@ -0,0 +1,163 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package gc + +// auto generated by go tool dist +var opnames = []string{ + OXXX: "XXX", + ONAME: "NAME", + ONONAME: "NONAME", + OTYPE: "TYPE", + OPACK: "PACK", + OLITERAL: "LITERAL", + OADD: "ADD", + OSUB: "SUB", + OOR: "OR", + OXOR: "XOR", + OADDSTR: "ADDSTR", + OADDR: "ADDR", + OANDAND: "ANDAND", + OAPPEND: "APPEND", + OARRAYBYTESTR: "ARRAYBYTESTR", + OARRAYBYTESTRTMP: "ARRAYBYTESTRTMP", + OARRAYRUNESTR: "ARRAYRUNESTR", + OSTRARRAYBYTE: "STRARRAYBYTE", + OSTRARRAYBYTETMP: "STRARRAYBYTETMP", + OSTRARRAYRUNE: "STRARRAYRUNE", + OAS: "AS", + OAS2: "AS2", + OAS2FUNC: "AS2FUNC", + OAS2RECV: "AS2RECV", + OAS2MAPR: "AS2MAPR", + OAS2DOTTYPE: "AS2DOTTYPE", + OASOP: "ASOP", + OASWB: "ASWB", + OCALL: "CALL", + OCALLFUNC: "CALLFUNC", + OCALLMETH: "CALLMETH", + OCALLINTER: "CALLINTER", + OCALLPART: "CALLPART", + OCAP: "CAP", + OCLOSE: "CLOSE", + OCLOSURE: "CLOSURE", + OCMPIFACE: "CMPIFACE", + OCMPSTR: "CMPSTR", + OCOMPLIT: "COMPLIT", + OMAPLIT: "MAPLIT", + OSTRUCTLIT: "STRUCTLIT", + OARRAYLIT: "ARRAYLIT", + OPTRLIT: "PTRLIT", + OCONV: "CONV", + OCONVIFACE: "CONVIFACE", + OCONVNOP: "CONVNOP", + OCOPY: "COPY", + ODCL: "DCL", + ODCLFUNC: "DCLFUNC", + ODCLFIELD: "DCLFIELD", + ODCLCONST: "DCLCONST", + ODCLTYPE: "DCLTYPE", + ODELETE: "DELETE", + ODOT: "DOT", + ODOTPTR: "DOTPTR", + ODOTMETH: "DOTMETH", + ODOTINTER: "DOTINTER", + OXDOT: "XDOT", + ODOTTYPE: "DOTTYPE", + ODOTTYPE2: "DOTTYPE2", + OEQ: "EQ", + ONE: "NE", + OLT: "LT", + OLE: "LE", + OGE: "GE", + OGT: "GT", + OIND: "IND", + OINDEX: "INDEX", + OINDEXMAP: "INDEXMAP", + OKEY: "KEY", + OPARAM: "PARAM", + OLEN: "LEN", + OMAKE: "MAKE", + OMAKECHAN: "MAKECHAN", + OMAKEMAP: "MAKEMAP", + OMAKESLICE: "MAKESLICE", + OMUL: "MUL", + ODIV: "DIV", + OMOD: "MOD", + OLSH: "LSH", + ORSH: "RSH", + OAND: "AND", + OANDNOT: "ANDNOT", + ONEW: "NEW", + ONOT: "NOT", + OCOM: "COM", + OPLUS: "PLUS", + OMINUS: "MINUS", + OOROR: "OROR", + OPANIC: "PANIC", + OPRINT: "PRINT", + OPRINTN: "PRINTN", + OPAREN: "PAREN", + OSEND: "SEND", + OSLICE: "SLICE", + OSLICEARR: "SLICEARR", + OSLICESTR: "SLICESTR", + OSLICE3: "SLICE3", + OSLICE3ARR: "SLICE3ARR", + ORECOVER: "RECOVER", + ORECV: "RECV", + ORUNESTR: "RUNESTR", + OSELRECV: "SELRECV", + OSELRECV2: "SELRECV2", + OIOTA: "IOTA", + OREAL: "REAL", + OIMAG: "IMAG", + OCOMPLEX: "COMPLEX", + OBLOCK: "BLOCK", + OBREAK: "BREAK", + OCASE: "CASE", + OXCASE: "XCASE", + OCONTINUE: "CONTINUE", + ODEFER: "DEFER", + OEMPTY: "EMPTY", + OFALL: "FALL", + OXFALL: "XFALL", + OFOR: "FOR", + OGOTO: "GOTO", + OIF: "IF", + OLABEL: "LABEL", + OPROC: "PROC", + ORANGE: "RANGE", + ORETURN: "RETURN", + OSELECT: "SELECT", + OSWITCH: "SWITCH", + OTYPESW: "TYPESW", + OTCHAN: "TCHAN", + OTMAP: "TMAP", + OTSTRUCT: "TSTRUCT", + OTINTER: "TINTER", + OTFUNC: "TFUNC", + OTARRAY: "TARRAY", + ODDD: "DDD", + ODDDARG: "DDDARG", + OINLCALL: "INLCALL", + OEFACE: "EFACE", + OITAB: "ITAB", + OSPTR: "SPTR", + OCLOSUREVAR: "CLOSUREVAR", + OCFUNC: "CFUNC", + OCHECKNIL: "CHECKNIL", + OVARKILL: "VARKILL", + OREGISTER: "REGISTER", + OINDREG: "INDREG", + OCMP: "CMP", + ODEC: "DEC", + OINC: "INC", + OEXTEND: "EXTEND", + OHMUL: "HMUL", + OLROT: "LROT", + ORROTC: "RROTC", + ORETJMP: "RETJMP", + OEND: "END", +} diff --git a/src/cmd/compile/internal/gc/order.go b/src/cmd/compile/internal/gc/order.go new file mode 100644 index 0000000000000000000000000000000000000000..799a17e18426f890ba2b8df6b0e2da925d2cda73 --- /dev/null +++ b/src/cmd/compile/internal/gc/order.go @@ -0,0 +1,1179 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package gc + +import ( + "fmt" + "strings" +) + +// Rewrite tree to use separate statements to enforce +// order of evaluation. Makes walk easier, because it +// can (after this runs) reorder at will within an expression. +// +// Rewrite x op= y into x = x op y. +// +// Introduce temporaries as needed by runtime routines. +// For example, the map runtime routines take the map key +// by reference, so make sure all map keys are addressable +// by copying them to temporaries as needed. +// The same is true for channel operations. +// +// Arrange that map index expressions only appear in direct +// assignments x = m[k] or m[k] = x, never in larger expressions. +// +// Arrange that receive expressions only appear in direct assignments +// x = <-c or as standalone statements <-c, never in larger expressions. + +// TODO(rsc): The temporary introduction during multiple assignments +// should be moved into this file, so that the temporaries can be cleaned +// and so that conversions implicit in the OAS2FUNC and OAS2RECV +// nodes can be made explicit and then have their temporaries cleaned. + +// TODO(rsc): Goto and multilevel break/continue can jump over +// inserted VARKILL annotations. Work out a way to handle these. +// The current implementation is safe, in that it will execute correctly. +// But it won't reuse temporaries as aggressively as it might, and +// it can result in unnecessary zeroing of those variables in the function +// prologue. + +// Order holds state during the ordering process. +type Order struct { + out *NodeList // list of generated statements + temp *NodeList // head of stack of temporary variables + free *NodeList // free list of NodeList* structs (for use in temp) +} + +// Order rewrites fn->nbody to apply the ordering constraints +// described in the comment at the top of the file. +func order(fn *Node) { + if Debug['W'] > 1 { + s := fmt.Sprintf("\nbefore order %v", fn.Func.Nname.Sym) + dumplist(s, fn.Nbody) + } + + orderblock(&fn.Nbody) +} + +// Ordertemp allocates a new temporary with the given type, +// pushes it onto the temp stack, and returns it. +// If clear is true, ordertemp emits code to zero the temporary. +func ordertemp(t *Type, order *Order, clear bool) *Node { + var_ := temp(t) + if clear { + a := Nod(OAS, var_, nil) + typecheck(&a, Etop) + order.out = list(order.out, a) + } + + l := order.free + if l == nil { + l = new(NodeList) + } + order.free = l.Next + l.Next = order.temp + l.N = var_ + order.temp = l + return var_ +} + +// Ordercopyexpr behaves like ordertemp but also emits +// code to initialize the temporary to the value n. +// +// The clear argument is provided for use when the evaluation +// of tmp = n turns into a function call that is passed a pointer +// to the temporary as the output space. If the call blocks before +// tmp has been written, the garbage collector will still treat the +// temporary as live, so we must zero it before entering that call. +// Today, this only happens for channel receive operations. +// (The other candidate would be map access, but map access +// returns a pointer to the result data instead of taking a pointer +// to be filled in.) +func ordercopyexpr(n *Node, t *Type, order *Order, clear int) *Node { + var_ := ordertemp(t, order, clear != 0) + a := Nod(OAS, var_, n) + typecheck(&a, Etop) + order.out = list(order.out, a) + return var_ +} + +// Ordercheapexpr returns a cheap version of n. +// The definition of cheap is that n is a variable or constant. +// If not, ordercheapexpr allocates a new tmp, emits tmp = n, +// and then returns tmp. +func ordercheapexpr(n *Node, order *Order) *Node { + if n == nil { + return nil + } + switch n.Op { + case ONAME, OLITERAL: + return n + case OLEN, OCAP: + l := ordercheapexpr(n.Left, order) + if l == n.Left { + return n + } + a := Nod(OXXX, nil, nil) + *a = *n + a.Orig = a + a.Left = l + typecheck(&a, Erv) + return a + } + + return ordercopyexpr(n, n.Type, order, 0) +} + +// Ordersafeexpr returns a safe version of n. +// The definition of safe is that n can appear multiple times +// without violating the semantics of the original program, +// and that assigning to the safe version has the same effect +// as assigning to the original n. +// +// The intended use is to apply to x when rewriting x += y into x = x + y. +func ordersafeexpr(n *Node, order *Order) *Node { + switch n.Op { + case ONAME, OLITERAL: + return n + + case ODOT, OLEN, OCAP: + l := ordersafeexpr(n.Left, order) + if l == n.Left { + return n + } + a := Nod(OXXX, nil, nil) + *a = *n + a.Orig = a + a.Left = l + typecheck(&a, Erv) + return a + + case ODOTPTR, OIND: + l := ordercheapexpr(n.Left, order) + if l == n.Left { + return n + } + a := Nod(OXXX, nil, nil) + *a = *n + a.Orig = a + a.Left = l + typecheck(&a, Erv) + return a + + case OINDEX, OINDEXMAP: + var l *Node + if Isfixedarray(n.Left.Type) { + l = ordersafeexpr(n.Left, order) + } else { + l = ordercheapexpr(n.Left, order) + } + r := ordercheapexpr(n.Right, order) + if l == n.Left && r == n.Right { + return n + } + a := Nod(OXXX, nil, nil) + *a = *n + a.Orig = a + a.Left = l + a.Right = r + typecheck(&a, Erv) + return a + } + + Fatal("ordersafeexpr %v", Oconv(int(n.Op), 0)) + return nil // not reached +} + +// Istemp reports whether n is a temporary variable. +func istemp(n *Node) bool { + if n.Op != ONAME { + return false + } + return strings.HasPrefix(n.Sym.Name, "autotmp_") +} + +// Isaddrokay reports whether it is okay to pass n's address to runtime routines. +// Taking the address of a variable makes the liveness and optimization analyses +// lose track of where the variable's lifetime ends. To avoid hurting the analyses +// of ordinary stack variables, those are not 'isaddrokay'. Temporaries are okay, +// because we emit explicit VARKILL instructions marking the end of those +// temporaries' lifetimes. +func isaddrokay(n *Node) bool { + return islvalue(n) && (n.Op != ONAME || n.Class == PEXTERN || istemp(n)) +} + +// Orderaddrtemp ensures that *np is okay to pass by address to runtime routines. +// If the original argument *np is not okay, orderaddrtemp creates a tmp, emits +// tmp = *np, and then sets *np to the tmp variable. +func orderaddrtemp(np **Node, order *Order) { + n := *np + if isaddrokay(n) { + return + } + *np = ordercopyexpr(n, n.Type, order, 0) +} + +// Marktemp returns the top of the temporary variable stack. +func marktemp(order *Order) *NodeList { + return order.temp +} + +// Poptemp pops temporaries off the stack until reaching the mark, +// which must have been returned by marktemp. +func poptemp(mark *NodeList, order *Order) { + var l *NodeList + + for { + l = order.temp + if l == mark { + break + } + order.temp = l.Next + l.Next = order.free + order.free = l + } +} + +// Cleantempnopop emits to *out VARKILL instructions for each temporary +// above the mark on the temporary stack, but it does not pop them +// from the stack. +func cleantempnopop(mark *NodeList, order *Order, out **NodeList) { + var kill *Node + + for l := order.temp; l != mark; l = l.Next { + kill = Nod(OVARKILL, l.N, nil) + typecheck(&kill, Etop) + *out = list(*out, kill) + } +} + +// Cleantemp emits VARKILL instructions for each temporary above the +// mark on the temporary stack and removes them from the stack. +func cleantemp(top *NodeList, order *Order) { + cleantempnopop(top, order, &order.out) + poptemp(top, order) +} + +// Orderstmtlist orders each of the statements in the list. +func orderstmtlist(l *NodeList, order *Order) { + for ; l != nil; l = l.Next { + orderstmt(l.N, order) + } +} + +// Orderblock orders the block of statements *l onto a new list, +// and then replaces *l with that list. +func orderblock(l **NodeList) { + var order Order + mark := marktemp(&order) + orderstmtlist(*l, &order) + cleantemp(mark, &order) + *l = order.out +} + +// Orderexprinplace orders the side effects in *np and +// leaves them as the init list of the final *np. +func orderexprinplace(np **Node, outer *Order) { + n := *np + var order Order + orderexpr(&n, &order, nil) + addinit(&n, order.out) + + // insert new temporaries from order + // at head of outer list. + lp := &order.temp + + for *lp != nil { + lp = &(*lp).Next + } + *lp = outer.temp + outer.temp = order.temp + + *np = n +} + +// Orderstmtinplace orders the side effects of the single statement *np +// and replaces it with the resulting statement list. +func orderstmtinplace(np **Node) { + n := *np + var order Order + mark := marktemp(&order) + orderstmt(n, &order) + cleantemp(mark, &order) + *np = liststmt(order.out) +} + +// Orderinit moves n's init list to order->out. +func orderinit(n *Node, order *Order) { + orderstmtlist(n.Ninit, order) + n.Ninit = nil +} + +// Ismulticall reports whether the list l is f() for a multi-value function. +// Such an f() could appear as the lone argument to a multi-arg function. +func ismulticall(l *NodeList) bool { + // one arg only + if l == nil || l.Next != nil { + return false + } + n := l.N + + // must be call + switch n.Op { + default: + return false + + case OCALLFUNC, OCALLMETH, OCALLINTER: + break + } + + // call must return multiple values + return n.Left.Type.Outtuple > 1 +} + +// Copyret emits t1, t2, ... = n, where n is a function call, +// and then returns the list t1, t2, .... +func copyret(n *Node, order *Order) *NodeList { + if n.Type.Etype != TSTRUCT || n.Type.Funarg == 0 { + Fatal("copyret %v %d", n.Type, n.Left.Type.Outtuple) + } + + var l1 *NodeList + var l2 *NodeList + var tl Iter + var tmp *Node + for t := Structfirst(&tl, &n.Type); t != nil; t = structnext(&tl) { + tmp = temp(t.Type) + l1 = list(l1, tmp) + l2 = list(l2, tmp) + } + + as := Nod(OAS2, nil, nil) + as.List = l1 + as.Rlist = list1(n) + typecheck(&as, Etop) + orderstmt(as, order) + + return l2 +} + +// Ordercallargs orders the list of call arguments *l. +func ordercallargs(l **NodeList, order *Order) { + if ismulticall(*l) { + // return f() where f() is multiple values. + *l = copyret((*l).N, order) + } else { + orderexprlist(*l, order) + } +} + +// Ordercall orders the call expression n. +// n->op is OCALLMETH/OCALLFUNC/OCALLINTER or a builtin like OCOPY. +func ordercall(n *Node, order *Order) { + orderexpr(&n.Left, order, nil) + orderexpr(&n.Right, order, nil) // ODDDARG temp + ordercallargs(&n.List, order) +} + +// Ordermapassign appends n to order->out, introducing temporaries +// to make sure that all map assignments have the form m[k] = x, +// where x is adressable. +// (Orderexpr has already been called on n, so we know k is addressable.) +// +// If n is m[k] = x where x is not addressable, the rewrite is: +// tmp = x +// m[k] = tmp +// +// If n is the multiple assignment form ..., m[k], ... = ..., the rewrite is +// t1 = m +// t2 = k +// ...., t3, ... = x +// t1[t2] = t3 +// +// The temporaries t1, t2 are needed in case the ... being assigned +// contain m or k. They are usually unnecessary, but in the unnecessary +// cases they are also typically registerizable, so not much harm done. +// And this only applies to the multiple-assignment form. +// We could do a more precise analysis if needed, like in walk.c. +// +// Ordermapassign also inserts these temporaries if needed for +// calling writebarrierfat with a pointer to n->right. +func ordermapassign(n *Node, order *Order) { + switch n.Op { + default: + Fatal("ordermapassign %v", Oconv(int(n.Op), 0)) + + case OAS: + order.out = list(order.out, n) + + // We call writebarrierfat only for values > 4 pointers long. See walk.c. + if (n.Left.Op == OINDEXMAP || (needwritebarrier(n.Left, n.Right) && n.Left.Type.Width > int64(4*Widthptr))) && !isaddrokay(n.Right) { + m := n.Left + n.Left = ordertemp(m.Type, order, false) + a := Nod(OAS, m, n.Left) + typecheck(&a, Etop) + order.out = list(order.out, a) + } + + case OAS2, OAS2DOTTYPE, OAS2MAPR, OAS2FUNC: + var post *NodeList + var m *Node + var a *Node + for l := n.List; l != nil; l = l.Next { + if l.N.Op == OINDEXMAP { + m = l.N + if !istemp(m.Left) { + m.Left = ordercopyexpr(m.Left, m.Left.Type, order, 0) + } + if !istemp(m.Right) { + m.Right = ordercopyexpr(m.Right, m.Right.Type, order, 0) + } + l.N = ordertemp(m.Type, order, false) + a = Nod(OAS, m, l.N) + typecheck(&a, Etop) + post = list(post, a) + } else if flag_race != 0 && n.Op == OAS2FUNC && !isblank(l.N) { + m = l.N + l.N = ordertemp(m.Type, order, false) + a = Nod(OAS, m, l.N) + typecheck(&a, Etop) + post = list(post, a) + } + } + + order.out = list(order.out, n) + order.out = concat(order.out, post) + } +} + +// Orderstmt orders the statement n, appending to order->out. +// Temporaries created during the statement are cleaned +// up using VARKILL instructions as possible. +func orderstmt(n *Node, order *Order) { + if n == nil { + return + } + + lno := int(setlineno(n)) + + orderinit(n, order) + + switch n.Op { + default: + Fatal("orderstmt %v", Oconv(int(n.Op), 0)) + + case OVARKILL: + order.out = list(order.out, n) + + case OAS: + t := marktemp(order) + orderexpr(&n.Left, order, nil) + orderexpr(&n.Right, order, n.Left) + ordermapassign(n, order) + cleantemp(t, order) + + case OAS2, + OCLOSE, + OCOPY, + OPRINT, + OPRINTN, + ORECOVER, + ORECV: + t := marktemp(order) + orderexpr(&n.Left, order, nil) + orderexpr(&n.Right, order, nil) + orderexprlist(n.List, order) + orderexprlist(n.Rlist, order) + switch n.Op { + case OAS2, OAS2DOTTYPE: + ordermapassign(n, order) + default: + order.out = list(order.out, n) + } + cleantemp(t, order) + + case OASOP: + // Special: rewrite l op= r into l = l op r. + // This simplifies quite a few operations; + // most important is that it lets us separate + // out map read from map write when l is + // a map index expression. + t := marktemp(order) + + orderexpr(&n.Left, order, nil) + n.Left = ordersafeexpr(n.Left, order) + tmp1 := treecopy(n.Left, 0) + if tmp1.Op == OINDEXMAP { + tmp1.Etype = 0 // now an rvalue not an lvalue + } + tmp1 = ordercopyexpr(tmp1, n.Left.Type, order, 0) + n.Right = Nod(int(n.Etype), tmp1, n.Right) + typecheck(&n.Right, Erv) + orderexpr(&n.Right, order, nil) + n.Etype = 0 + n.Op = OAS + ordermapassign(n, order) + cleantemp(t, order) + + // Special: make sure key is addressable, + // and make sure OINDEXMAP is not copied out. + case OAS2MAPR: + t := marktemp(order) + + orderexprlist(n.List, order) + r := n.Rlist.N + orderexpr(&r.Left, order, nil) + orderexpr(&r.Right, order, nil) + + // See case OINDEXMAP below. + if r.Right.Op == OARRAYBYTESTR { + r.Right.Op = OARRAYBYTESTRTMP + } + orderaddrtemp(&r.Right, order) + ordermapassign(n, order) + cleantemp(t, order) + + // Special: avoid copy of func call n->rlist->n. + case OAS2FUNC: + t := marktemp(order) + + orderexprlist(n.List, order) + ordercall(n.Rlist.N, order) + ordermapassign(n, order) + cleantemp(t, order) + + // Special: use temporary variables to hold result, + // so that assertI2Tetc can take address of temporary. + // No temporary for blank assignment. + case OAS2DOTTYPE: + t := marktemp(order) + + orderexprlist(n.List, order) + orderexpr(&n.Rlist.N.Left, order, nil) // i in i.(T) + if isblank(n.List.N) { + order.out = list(order.out, n) + } else { + typ := n.Rlist.N.Type + tmp1 := ordertemp(typ, order, haspointers(typ)) + order.out = list(order.out, n) + r := Nod(OAS, n.List.N, tmp1) + typecheck(&r, Etop) + ordermapassign(r, order) + n.List = list(list1(tmp1), n.List.Next.N) + } + + cleantemp(t, order) + + // Special: use temporary variables to hold result, + // so that chanrecv can take address of temporary. + case OAS2RECV: + t := marktemp(order) + + orderexprlist(n.List, order) + orderexpr(&n.Rlist.N.Left, order, nil) // arg to recv + ch := n.Rlist.N.Left.Type + tmp1 := ordertemp(ch.Type, order, haspointers(ch.Type)) + var tmp2 *Node + if !isblank(n.List.Next.N) { + tmp2 = ordertemp(n.List.Next.N.Type, order, false) + } else { + tmp2 = ordertemp(Types[TBOOL], order, false) + } + order.out = list(order.out, n) + r := Nod(OAS, n.List.N, tmp1) + typecheck(&r, Etop) + ordermapassign(r, order) + r = Nod(OAS, n.List.Next.N, tmp2) + typecheck(&r, Etop) + ordermapassign(r, order) + n.List = list(list1(tmp1), tmp2) + cleantemp(t, order) + + // Special: does not save n onto out. + case OBLOCK, OEMPTY: + orderstmtlist(n.List, order) + + // Special: n->left is not an expression; save as is. + case OBREAK, + OCONTINUE, + ODCL, + ODCLCONST, + ODCLTYPE, + OFALL, + OXFALL, + OGOTO, + OLABEL, + ORETJMP: + order.out = list(order.out, n) + + // Special: handle call arguments. + case OCALLFUNC, OCALLINTER, OCALLMETH: + t := marktemp(order) + + ordercall(n, order) + order.out = list(order.out, n) + cleantemp(t, order) + + // Special: order arguments to inner call but not call itself. + case ODEFER, OPROC: + t := marktemp(order) + + switch n.Left.Op { + // Delete will take the address of the key. + // Copy key into new temp and do not clean it + // (it persists beyond the statement). + case ODELETE: + orderexprlist(n.Left.List, order) + + t1 := marktemp(order) + np := &n.Left.List.Next.N // map key + *np = ordercopyexpr(*np, (*np).Type, order, 0) + poptemp(t1, order) + + default: + ordercall(n.Left, order) + } + + order.out = list(order.out, n) + cleantemp(t, order) + + case ODELETE: + t := marktemp(order) + orderexpr(&n.List.N, order, nil) + orderexpr(&n.List.Next.N, order, nil) + orderaddrtemp(&n.List.Next.N, order) // map key + order.out = list(order.out, n) + cleantemp(t, order) + + // Clean temporaries from condition evaluation at + // beginning of loop body and after for statement. + case OFOR: + t := marktemp(order) + + orderexprinplace(&n.Left, order) + var l *NodeList + cleantempnopop(t, order, &l) + n.Nbody = concat(l, n.Nbody) + orderblock(&n.Nbody) + orderstmtinplace(&n.Right) + order.out = list(order.out, n) + cleantemp(t, order) + + // Clean temporaries from condition at + // beginning of both branches. + case OIF: + t := marktemp(order) + + orderexprinplace(&n.Left, order) + var l *NodeList + cleantempnopop(t, order, &l) + n.Nbody = concat(l, n.Nbody) + l = nil + cleantempnopop(t, order, &l) + n.Rlist = concat(l, n.Rlist) + poptemp(t, order) + orderblock(&n.Nbody) + orderblock(&n.Rlist) + order.out = list(order.out, n) + + // Special: argument will be converted to interface using convT2E + // so make sure it is an addressable temporary. + case OPANIC: + t := marktemp(order) + + orderexpr(&n.Left, order, nil) + if !Isinter(n.Left.Type) { + orderaddrtemp(&n.Left, order) + } + order.out = list(order.out, n) + cleantemp(t, order) + + // n->right is the expression being ranged over. + // order it, and then make a copy if we need one. + // We almost always do, to ensure that we don't + // see any value changes made during the loop. + // Usually the copy is cheap (e.g., array pointer, chan, slice, string are all tiny). + // The exception is ranging over an array value (not a slice, not a pointer to array), + // which must make a copy to avoid seeing updates made during + // the range body. Ranging over an array value is uncommon though. + case ORANGE: + t := marktemp(order) + + orderexpr(&n.Right, order, nil) + switch n.Type.Etype { + default: + Fatal("orderstmt range %v", n.Type) + + // Mark []byte(str) range expression to reuse string backing storage. + // It is safe because the storage cannot be mutated. + case TARRAY: + if n.Right.Op == OSTRARRAYBYTE { + n.Right.Op = OSTRARRAYBYTETMP + } + if count(n.List) < 2 || isblank(n.List.Next.N) { + // for i := range x will only use x once, to compute len(x). + // No need to copy it. + break + } + fallthrough + + // chan, string, slice, array ranges use value multiple times. + // make copy. + // fall through + case TCHAN, TSTRING: + r := n.Right + + if r.Type.Etype == TSTRING && r.Type != Types[TSTRING] { + r = Nod(OCONV, r, nil) + r.Type = Types[TSTRING] + typecheck(&r, Erv) + } + + n.Right = ordercopyexpr(r, r.Type, order, 0) + + // copy the map value in case it is a map literal. + // TODO(rsc): Make tmp = literal expressions reuse tmp. + // For maps tmp is just one word so it hardly matters. + case TMAP: + r := n.Right + + n.Right = ordercopyexpr(r, r.Type, order, 0) + + // n->alloc is the temp for the iterator. + prealloc[n] = ordertemp(Types[TUINT8], order, true) + } + + for l := n.List; l != nil; l = l.Next { + orderexprinplace(&l.N, order) + } + orderblock(&n.Nbody) + order.out = list(order.out, n) + cleantemp(t, order) + + case ORETURN: + ordercallargs(&n.List, order) + order.out = list(order.out, n) + + // Special: clean case temporaries in each block entry. + // Select must enter one of its blocks, so there is no + // need for a cleaning at the end. + // Doubly special: evaluation order for select is stricter + // than ordinary expressions. Even something like p.c + // has to be hoisted into a temporary, so that it cannot be + // reordered after the channel evaluation for a different + // case (if p were nil, then the timing of the fault would + // give this away). + case OSELECT: + t := marktemp(order) + + var tmp1 *Node + var tmp2 *Node + var r *Node + for l := n.List; l != nil; l = l.Next { + if l.N.Op != OXCASE { + Fatal("order select case %v", Oconv(int(l.N.Op), 0)) + } + r = l.N.Left + setlineno(l.N) + + // Append any new body prologue to ninit. + // The next loop will insert ninit into nbody. + if l.N.Ninit != nil { + Fatal("order select ninit") + } + if r != nil { + switch r.Op { + default: + Yyerror("unknown op in select %v", Oconv(int(r.Op), 0)) + Dump("select case", r) + + // If this is case x := <-ch or case x, y := <-ch, the case has + // the ODCL nodes to declare x and y. We want to delay that + // declaration (and possible allocation) until inside the case body. + // Delete the ODCL nodes here and recreate them inside the body below. + case OSELRECV, OSELRECV2: + if r.Colas { + t = r.Ninit + if t != nil && t.N.Op == ODCL && t.N.Left == r.Left { + t = t.Next + } + if t != nil && t.N.Op == ODCL && r.List != nil && t.N.Left == r.List.N { + t = t.Next + } + if t == nil { + r.Ninit = nil + } + } + + if r.Ninit != nil { + Yyerror("ninit on select recv") + dumplist("ninit", r.Ninit) + } + + // case x = <-c + // case x, ok = <-c + // r->left is x, r->ntest is ok, r->right is ORECV, r->right->left is c. + // r->left == N means 'case <-c'. + // c is always evaluated; x and ok are only evaluated when assigned. + orderexpr(&r.Right.Left, order, nil) + + if r.Right.Left.Op != ONAME { + r.Right.Left = ordercopyexpr(r.Right.Left, r.Right.Left.Type, order, 0) + } + + // Introduce temporary for receive and move actual copy into case body. + // avoids problems with target being addressed, as usual. + // NOTE: If we wanted to be clever, we could arrange for just one + // temporary per distinct type, sharing the temp among all receives + // with that temp. Similarly one ok bool could be shared among all + // the x,ok receives. Not worth doing until there's a clear need. + if r.Left != nil && isblank(r.Left) { + r.Left = nil + } + if r.Left != nil { + // use channel element type for temporary to avoid conversions, + // such as in case interfacevalue = <-intchan. + // the conversion happens in the OAS instead. + tmp1 = r.Left + + if r.Colas { + tmp2 = Nod(ODCL, tmp1, nil) + typecheck(&tmp2, Etop) + l.N.Ninit = list(l.N.Ninit, tmp2) + } + + r.Left = ordertemp(r.Right.Left.Type.Type, order, haspointers(r.Right.Left.Type.Type)) + tmp2 = Nod(OAS, tmp1, r.Left) + typecheck(&tmp2, Etop) + l.N.Ninit = list(l.N.Ninit, tmp2) + } + + if r.List != nil && isblank(r.List.N) { + r.List = nil + } + if r.List != nil { + tmp1 = r.List.N + if r.Colas { + tmp2 = Nod(ODCL, tmp1, nil) + typecheck(&tmp2, Etop) + l.N.Ninit = list(l.N.Ninit, tmp2) + } + + r.List = list1(ordertemp(tmp1.Type, order, false)) + tmp2 = Nod(OAS, tmp1, r.List.N) + typecheck(&tmp2, Etop) + l.N.Ninit = list(l.N.Ninit, tmp2) + } + + orderblock(&l.N.Ninit) + + case OSEND: + if r.Ninit != nil { + Yyerror("ninit on select send") + dumplist("ninit", r.Ninit) + } + + // case c <- x + // r->left is c, r->right is x, both are always evaluated. + orderexpr(&r.Left, order, nil) + + if !istemp(r.Left) { + r.Left = ordercopyexpr(r.Left, r.Left.Type, order, 0) + } + orderexpr(&r.Right, order, nil) + if !istemp(r.Right) { + r.Right = ordercopyexpr(r.Right, r.Right.Type, order, 0) + } + } + } + + orderblock(&l.N.Nbody) + } + + // Now that we have accumulated all the temporaries, clean them. + // Also insert any ninit queued during the previous loop. + // (The temporary cleaning must follow that ninit work.) + for l := n.List; l != nil; l = l.Next { + cleantempnopop(t, order, &l.N.Ninit) + l.N.Nbody = concat(l.N.Ninit, l.N.Nbody) + l.N.Ninit = nil + } + + order.out = list(order.out, n) + poptemp(t, order) + + // Special: value being sent is passed as a pointer; make it addressable. + case OSEND: + t := marktemp(order) + + orderexpr(&n.Left, order, nil) + orderexpr(&n.Right, order, nil) + orderaddrtemp(&n.Right, order) + order.out = list(order.out, n) + cleantemp(t, order) + + // TODO(rsc): Clean temporaries more aggressively. + // Note that because walkswitch will rewrite some of the + // switch into a binary search, this is not as easy as it looks. + // (If we ran that code here we could invoke orderstmt on + // the if-else chain instead.) + // For now just clean all the temporaries at the end. + // In practice that's fine. + case OSWITCH: + t := marktemp(order) + + orderexpr(&n.Left, order, nil) + for l := n.List; l != nil; l = l.Next { + if l.N.Op != OXCASE { + Fatal("order switch case %v", Oconv(int(l.N.Op), 0)) + } + orderexprlistinplace(l.N.List, order) + orderblock(&l.N.Nbody) + } + + order.out = list(order.out, n) + cleantemp(t, order) + } + + lineno = int32(lno) +} + +// Orderexprlist orders the expression list l into order. +func orderexprlist(l *NodeList, order *Order) { + for ; l != nil; l = l.Next { + orderexpr(&l.N, order, nil) + } +} + +// Orderexprlist orders the expression list l but saves +// the side effects on the individual expression ninit lists. +func orderexprlistinplace(l *NodeList, order *Order) { + for ; l != nil; l = l.Next { + orderexprinplace(&l.N, order) + } +} + +// prealloc[x] records the allocation to use for x. +var prealloc = map[*Node]*Node{} + +// Orderexpr orders a single expression, appending side +// effects to order->out as needed. +// If this is part of an assignment lhs = *np, lhs is given. +// Otherwise lhs == nil. (When lhs != nil it may be possible +// to avoid copying the result of the expression to a temporary.) +func orderexpr(np **Node, order *Order, lhs *Node) { + n := *np + if n == nil { + return + } + + lno := int(setlineno(n)) + orderinit(n, order) + + switch n.Op { + default: + orderexpr(&n.Left, order, nil) + orderexpr(&n.Right, order, nil) + orderexprlist(n.List, order) + orderexprlist(n.Rlist, order) + + // Addition of strings turns into a function call. + // Allocate a temporary to hold the strings. + // Fewer than 5 strings use direct runtime helpers. + case OADDSTR: + orderexprlist(n.List, order) + + if count(n.List) > 5 { + t := typ(TARRAY) + t.Bound = int64(count(n.List)) + t.Type = Types[TSTRING] + prealloc[n] = ordertemp(t, order, false) + } + + // Mark string(byteSlice) arguments to reuse byteSlice backing + // buffer during conversion. String concatenation does not + // memorize the strings for later use, so it is safe. + // However, we can do it only if there is at least one non-empty string literal. + // Otherwise if all other arguments are empty strings, + // concatstrings will return the reference to the temp string + // to the caller. + hasbyte := false + + haslit := false + for l := n.List; l != nil; l = l.Next { + hasbyte = hasbyte || l.N.Op == OARRAYBYTESTR + haslit = haslit || l.N.Op == OLITERAL && len(l.N.Val().U.(string)) != 0 + } + + if haslit && hasbyte { + for l := n.List; l != nil; l = l.Next { + if l.N.Op == OARRAYBYTESTR { + l.N.Op = OARRAYBYTESTRTMP + } + } + } + + case OCMPSTR: + orderexpr(&n.Left, order, nil) + orderexpr(&n.Right, order, nil) + + // Mark string(byteSlice) arguments to reuse byteSlice backing + // buffer during conversion. String comparison does not + // memorize the strings for later use, so it is safe. + if n.Left.Op == OARRAYBYTESTR { + n.Left.Op = OARRAYBYTESTRTMP + } + if n.Right.Op == OARRAYBYTESTR { + n.Right.Op = OARRAYBYTESTRTMP + } + + // key must be addressable + case OINDEXMAP: + orderexpr(&n.Left, order, nil) + + orderexpr(&n.Right, order, nil) + + // For x = m[string(k)] where k is []byte, the allocation of + // backing bytes for the string can be avoided by reusing + // the []byte backing array. This is a special case that it + // would be nice to handle more generally, but because + // there are no []byte-keyed maps, this specific case comes + // up in important cases in practice. See issue 3512. + // Nothing can change the []byte we are not copying before + // the map index, because the map access is going to + // be forced to happen immediately following this + // conversion (by the ordercopyexpr a few lines below). + if n.Etype == 0 && n.Right.Op == OARRAYBYTESTR { + n.Right.Op = OARRAYBYTESTRTMP + } + + orderaddrtemp(&n.Right, order) + if n.Etype == 0 { + // use of value (not being assigned); + // make copy in temporary. + n = ordercopyexpr(n, n.Type, order, 0) + } + + // concrete type (not interface) argument must be addressable + // temporary to pass to runtime. + case OCONVIFACE: + orderexpr(&n.Left, order, nil) + + if !Isinter(n.Left.Type) { + orderaddrtemp(&n.Left, order) + } + + case OANDAND, OOROR: + mark := marktemp(order) + orderexpr(&n.Left, order, nil) + + // Clean temporaries from first branch at beginning of second. + // Leave them on the stack so that they can be killed in the outer + // context in case the short circuit is taken. + var l *NodeList + + cleantempnopop(mark, order, &l) + n.Right.Ninit = concat(l, n.Right.Ninit) + orderexprinplace(&n.Right, order) + + case OCALLFUNC, + OCALLINTER, + OCALLMETH, + OCAP, + OCOMPLEX, + OCOPY, + OIMAG, + OLEN, + OMAKECHAN, + OMAKEMAP, + OMAKESLICE, + ONEW, + OREAL, + ORECOVER: + ordercall(n, order) + if lhs == nil || lhs.Op != ONAME || flag_race != 0 { + n = ordercopyexpr(n, n.Type, order, 0) + } + + case OAPPEND: + ordercallargs(&n.List, order) + if lhs == nil || lhs.Op != ONAME && !samesafeexpr(lhs, n.List.N) { + n = ordercopyexpr(n, n.Type, order, 0) + } + + case OSLICE, OSLICEARR, OSLICESTR: + orderexpr(&n.Left, order, nil) + orderexpr(&n.Right.Left, order, nil) + n.Right.Left = ordercheapexpr(n.Right.Left, order) + orderexpr(&n.Right.Right, order, nil) + n.Right.Right = ordercheapexpr(n.Right.Right, order) + if lhs == nil || lhs.Op != ONAME && !samesafeexpr(lhs, n.Left) { + n = ordercopyexpr(n, n.Type, order, 0) + } + + case OSLICE3, OSLICE3ARR: + orderexpr(&n.Left, order, nil) + orderexpr(&n.Right.Left, order, nil) + n.Right.Left = ordercheapexpr(n.Right.Left, order) + orderexpr(&n.Right.Right.Left, order, nil) + n.Right.Right.Left = ordercheapexpr(n.Right.Right.Left, order) + orderexpr(&n.Right.Right.Right, order, nil) + n.Right.Right.Right = ordercheapexpr(n.Right.Right.Right, order) + if lhs == nil || lhs.Op != ONAME && !samesafeexpr(lhs, n.Left) { + n = ordercopyexpr(n, n.Type, order, 0) + } + + case OCLOSURE: + if n.Noescape && n.Func.Cvars != nil { + prealloc[n] = ordertemp(Types[TUINT8], order, false) // walk will fill in correct type + } + + case OARRAYLIT, OCALLPART: + orderexpr(&n.Left, order, nil) + orderexpr(&n.Right, order, nil) + orderexprlist(n.List, order) + orderexprlist(n.Rlist, order) + if n.Noescape { + prealloc[n] = ordertemp(Types[TUINT8], order, false) // walk will fill in correct type + } + + case ODDDARG: + if n.Noescape { + // The ddd argument does not live beyond the call it is created for. + // Allocate a temporary that will be cleaned up when this statement + // completes. We could be more aggressive and try to arrange for it + // to be cleaned up when the call completes. + prealloc[n] = ordertemp(n.Type.Type, order, false) + } + + case ODOTTYPE, ODOTTYPE2: + orderexpr(&n.Left, order, nil) + // TODO(rsc): The Isfat is for consistency with componentgen and walkexpr. + // It needs to be removed in all three places. + // That would allow inlining x.(struct{*int}) the same as x.(*int). + if !isdirectiface(n.Type) || Isfat(n.Type) || flag_race != 0 { + n = ordercopyexpr(n, n.Type, order, 1) + } + + case ORECV: + orderexpr(&n.Left, order, nil) + n = ordercopyexpr(n, n.Type, order, 1) + + case OEQ, ONE: + orderexpr(&n.Left, order, nil) + orderexpr(&n.Right, order, nil) + t := n.Left.Type + if t.Etype == TSTRUCT || Isfixedarray(t) { + // for complex comparisons, we need both args to be + // addressable so we can pass them to the runtime. + orderaddrtemp(&n.Left, order) + orderaddrtemp(&n.Right, order) + } + } + + lineno = int32(lno) + + *np = n +} diff --git a/src/cmd/compile/internal/gc/pgen.go b/src/cmd/compile/internal/gc/pgen.go new file mode 100644 index 0000000000000000000000000000000000000000..47cb8b12012af8ee74c9572b02118c8d694094d0 --- /dev/null +++ b/src/cmd/compile/internal/gc/pgen.go @@ -0,0 +1,544 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package gc + +import ( + "cmd/internal/obj" + "crypto/md5" + "fmt" + "strings" +) + +// "Portable" code generation. + +var makefuncdatasym_nsym int32 + +func makefuncdatasym(namefmt string, funcdatakind int64) *Sym { + var nod Node + + sym := Lookupf(namefmt, makefuncdatasym_nsym) + makefuncdatasym_nsym++ + pnod := newname(sym) + pnod.Class = PEXTERN + Nodconst(&nod, Types[TINT32], funcdatakind) + Thearch.Gins(obj.AFUNCDATA, &nod, pnod) + return sym +} + +// gvardef inserts a VARDEF for n into the instruction stream. +// VARDEF is an annotation for the liveness analysis, marking a place +// where a complete initialization (definition) of a variable begins. +// Since the liveness analysis can see initialization of single-word +// variables quite easy, gvardef is usually only called for multi-word +// or 'fat' variables, those satisfying isfat(n->type). +// However, gvardef is also called when a non-fat variable is initialized +// via a block move; the only time this happens is when you have +// return f() +// for a function with multiple return values exactly matching the return +// types of the current function. +// +// A 'VARDEF x' annotation in the instruction stream tells the liveness +// analysis to behave as though the variable x is being initialized at that +// point in the instruction stream. The VARDEF must appear before the +// actual (multi-instruction) initialization, and it must also appear after +// any uses of the previous value, if any. For example, if compiling: +// +// x = x[1:] +// +// it is important to generate code like: +// +// base, len, cap = pieces of x[1:] +// VARDEF x +// x = {base, len, cap} +// +// If instead the generated code looked like: +// +// VARDEF x +// base, len, cap = pieces of x[1:] +// x = {base, len, cap} +// +// then the liveness analysis would decide the previous value of x was +// unnecessary even though it is about to be used by the x[1:] computation. +// Similarly, if the generated code looked like: +// +// base, len, cap = pieces of x[1:] +// x = {base, len, cap} +// VARDEF x +// +// then the liveness analysis will not preserve the new value of x, because +// the VARDEF appears to have "overwritten" it. +// +// VARDEF is a bit of a kludge to work around the fact that the instruction +// stream is working on single-word values but the liveness analysis +// wants to work on individual variables, which might be multi-word +// aggregates. It might make sense at some point to look into letting +// the liveness analysis work on single-word values as well, although +// there are complications around interface values, slices, and strings, +// all of which cannot be treated as individual words. +// +// VARKILL is the opposite of VARDEF: it marks a value as no longer needed, +// even if its address has been taken. That is, a VARKILL annotation asserts +// that its argument is certainly dead, for use when the liveness analysis +// would not otherwise be able to deduce that fact. + +func gvardefx(n *Node, as int) { + if n == nil { + Fatal("gvardef nil") + } + if n.Op != ONAME { + Yyerror("gvardef %v; %v", Oconv(int(n.Op), obj.FmtSharp), n) + return + } + + switch n.Class { + case PAUTO, PPARAM, PPARAMOUT: + Thearch.Gins(as, nil, n) + } +} + +func Gvardef(n *Node) { + gvardefx(n, obj.AVARDEF) +} + +func gvarkill(n *Node) { + gvardefx(n, obj.AVARKILL) +} + +func removevardef(firstp *obj.Prog) { + for p := firstp; p != nil; p = p.Link { + for p.Link != nil && (p.Link.As == obj.AVARDEF || p.Link.As == obj.AVARKILL) { + p.Link = p.Link.Link + } + if p.To.Type == obj.TYPE_BRANCH { + for p.To.Val.(*obj.Prog) != nil && (p.To.Val.(*obj.Prog).As == obj.AVARDEF || p.To.Val.(*obj.Prog).As == obj.AVARKILL) { + p.To.Val = p.To.Val.(*obj.Prog).Link + } + } + } +} + +func gcsymdup(s *Sym) { + ls := Linksym(s) + if len(ls.R) > 0 { + Fatal("cannot rosymdup %s with relocations", ls.Name) + } + ls.Name = fmt.Sprintf("gclocals·%x", md5.Sum(ls.P)) + ls.Dupok = 1 +} + +func emitptrargsmap() { + sym := Lookup(fmt.Sprintf("%s.args_stackmap", Curfn.Func.Nname.Sym.Name)) + + nptr := int(Curfn.Type.Argwid / int64(Widthptr)) + bv := bvalloc(int32(nptr) * 2) + nbitmap := 1 + if Curfn.Type.Outtuple > 0 { + nbitmap = 2 + } + off := duint32(sym, 0, uint32(nbitmap)) + off = duint32(sym, off, uint32(bv.n)) + var xoffset int64 + if Curfn.Type.Thistuple > 0 { + xoffset = 0 + onebitwalktype1(getthisx(Curfn.Type), &xoffset, bv) + } + + if Curfn.Type.Intuple > 0 { + xoffset = 0 + onebitwalktype1(getinargx(Curfn.Type), &xoffset, bv) + } + + for j := 0; int32(j) < bv.n; j += 32 { + off = duint32(sym, off, bv.b[j/32]) + } + if Curfn.Type.Outtuple > 0 { + xoffset = 0 + onebitwalktype1(getoutargx(Curfn.Type), &xoffset, bv) + for j := 0; int32(j) < bv.n; j += 32 { + off = duint32(sym, off, bv.b[j/32]) + } + } + + ggloblsym(sym, int32(off), obj.RODATA|obj.LOCAL) +} + +// Sort the list of stack variables. Autos after anything else, +// within autos, unused after used, within used, things with +// pointers first, zeroed things first, and then decreasing size. +// Because autos are laid out in decreasing addresses +// on the stack, pointers first, zeroed things first and decreasing size +// really means, in memory, things with pointers needing zeroing at +// the top of the stack and increasing in size. +// Non-autos sort on offset. +func cmpstackvar(a *Node, b *Node) int { + if a.Class != b.Class { + if a.Class == PAUTO { + return +1 + } + return -1 + } + + if a.Class != PAUTO { + if a.Xoffset < b.Xoffset { + return -1 + } + if a.Xoffset > b.Xoffset { + return +1 + } + return 0 + } + + if a.Used != b.Used { + return obj.Bool2int(b.Used) - obj.Bool2int(a.Used) + } + + ap := obj.Bool2int(haspointers(a.Type)) + bp := obj.Bool2int(haspointers(b.Type)) + if ap != bp { + return bp - ap + } + + ap = obj.Bool2int(a.Name.Needzero) + bp = obj.Bool2int(b.Name.Needzero) + if ap != bp { + return bp - ap + } + + if a.Type.Width < b.Type.Width { + return +1 + } + if a.Type.Width > b.Type.Width { + return -1 + } + + return stringsCompare(a.Sym.Name, b.Sym.Name) +} + +// stkdelta records the stack offset delta for a node +// during the compaction of the stack frame to remove +// unused stack slots. +var stkdelta = map[*Node]int64{} + +// TODO(lvd) find out where the PAUTO/OLITERAL nodes come from. +func allocauto(ptxt *obj.Prog) { + Stksize = 0 + stkptrsize = 0 + + if Curfn.Func.Dcl == nil { + return + } + + // Mark the PAUTO's unused. + for ll := Curfn.Func.Dcl; ll != nil; ll = ll.Next { + if ll.N.Class == PAUTO { + ll.N.Used = false + } + } + + markautoused(ptxt) + + listsort(&Curfn.Func.Dcl, cmpstackvar) + + // Unused autos are at the end, chop 'em off. + ll := Curfn.Func.Dcl + + n := ll.N + if n.Class == PAUTO && n.Op == ONAME && !n.Used { + // No locals used at all + Curfn.Func.Dcl = nil + + fixautoused(ptxt) + return + } + + for ll := Curfn.Func.Dcl; ll.Next != nil; ll = ll.Next { + n = ll.Next.N + if n.Class == PAUTO && n.Op == ONAME && !n.Used { + ll.Next = nil + Curfn.Func.Dcl.End = ll + break + } + } + + // Reassign stack offsets of the locals that are still there. + var w int64 + for ll := Curfn.Func.Dcl; ll != nil; ll = ll.Next { + n = ll.N + if n.Class != PAUTO || n.Op != ONAME { + continue + } + + dowidth(n.Type) + w = n.Type.Width + if w >= Thearch.MAXWIDTH || w < 0 { + Fatal("bad width") + } + Stksize += w + Stksize = Rnd(Stksize, int64(n.Type.Align)) + if haspointers(n.Type) { + stkptrsize = Stksize + } + if Thearch.Thechar == '5' || Thearch.Thechar == '7' || Thearch.Thechar == '9' { + Stksize = Rnd(Stksize, int64(Widthptr)) + } + if Stksize >= 1<<31 { + setlineno(Curfn) + Yyerror("stack frame too large (>2GB)") + } + + stkdelta[n] = -Stksize - n.Xoffset + } + + Stksize = Rnd(Stksize, int64(Widthreg)) + stkptrsize = Rnd(stkptrsize, int64(Widthreg)) + + fixautoused(ptxt) + + // The debug information needs accurate offsets on the symbols. + for ll := Curfn.Func.Dcl; ll != nil; ll = ll.Next { + if ll.N.Class != PAUTO || ll.N.Op != ONAME { + continue + } + ll.N.Xoffset += stkdelta[ll.N] + delete(stkdelta, ll.N) + } +} + +func Cgen_checknil(n *Node) { + if Disable_checknil != 0 { + return + } + + // Ideally we wouldn't see any integer types here, but we do. + if n.Type == nil || (!Isptr[n.Type.Etype] && !Isint[n.Type.Etype] && n.Type.Etype != TUNSAFEPTR) { + Dump("checknil", n) + Fatal("bad checknil") + } + + if ((Thearch.Thechar == '5' || Thearch.Thechar == '7' || Thearch.Thechar == '9') && n.Op != OREGISTER) || !n.Addable || n.Op == OLITERAL { + var reg Node + Regalloc(®, Types[Tptr], n) + Cgen(n, ®) + Thearch.Gins(obj.ACHECKNIL, ®, nil) + Regfree(®) + return + } + + Thearch.Gins(obj.ACHECKNIL, n, nil) +} + +func compile(fn *Node) { + if Newproc == nil { + Newproc = Sysfunc("newproc") + Deferproc = Sysfunc("deferproc") + Deferreturn = Sysfunc("deferreturn") + Panicindex = Sysfunc("panicindex") + panicslice = Sysfunc("panicslice") + throwreturn = Sysfunc("throwreturn") + } + + lno := setlineno(fn) + + Curfn = fn + dowidth(Curfn.Type) + + var oldstksize int64 + var nod1 Node + var ptxt *obj.Prog + var pl *obj.Plist + var p *obj.Prog + var n *Node + var nam *Node + var gcargs *Sym + var gclocals *Sym + if fn.Nbody == nil { + if pure_go != 0 || strings.HasPrefix(fn.Func.Nname.Sym.Name, "init.") { + Yyerror("missing function body for %q", fn.Func.Nname.Sym.Name) + goto ret + } + + if Debug['A'] != 0 { + goto ret + } + emitptrargsmap() + goto ret + } + + saveerrors() + + // set up domain for labels + clearlabels() + + if Curfn.Type.Outnamed != 0 { + // add clearing of the output parameters + var save Iter + t := Structfirst(&save, Getoutarg(Curfn.Type)) + + for t != nil { + if t.Nname != nil { + n = Nod(OAS, t.Nname, nil) + typecheck(&n, Etop) + Curfn.Nbody = concat(list1(n), Curfn.Nbody) + } + + t = structnext(&save) + } + } + + order(Curfn) + if nerrors != 0 { + goto ret + } + + Hasdefer = 0 + walk(Curfn) + if nerrors != 0 { + goto ret + } + if flag_race != 0 { + racewalk(Curfn) + } + if nerrors != 0 { + goto ret + } + + continpc = nil + breakpc = nil + + pl = newplist() + pl.Name = Linksym(Curfn.Func.Nname.Sym) + + setlineno(Curfn) + + Nodconst(&nod1, Types[TINT32], 0) + nam = Curfn.Func.Nname + if isblank(nam) { + nam = nil + } + ptxt = Thearch.Gins(obj.ATEXT, nam, &nod1) + Afunclit(&ptxt.From, Curfn.Func.Nname) + ptxt.From3 = new(obj.Addr) + if fn.Func.Dupok { + ptxt.From3.Offset |= obj.DUPOK + } + if fn.Func.Wrapper { + ptxt.From3.Offset |= obj.WRAPPER + } + if fn.Func.Needctxt { + ptxt.From3.Offset |= obj.NEEDCTXT + } + if fn.Func.Nosplit { + ptxt.From3.Offset |= obj.NOSPLIT + } + if fn.Func.Systemstack { + ptxt.From.Sym.Cfunc = 1 + } + + // Clumsy but important. + // See test/recover.go for test cases and src/reflect/value.go + // for the actual functions being considered. + if myimportpath != "" && myimportpath == "reflect" { + if Curfn.Func.Nname.Sym.Name == "callReflect" || Curfn.Func.Nname.Sym.Name == "callMethod" { + ptxt.From3.Offset |= obj.WRAPPER + } + } + + ginit() + + gcargs = makefuncdatasym("gcargs·%d", obj.FUNCDATA_ArgsPointerMaps) + gclocals = makefuncdatasym("gclocals·%d", obj.FUNCDATA_LocalsPointerMaps) + + for _, t := range Curfn.Func.Fieldtrack { + gtrack(tracksym(t)) + } + + for l := fn.Func.Dcl; l != nil; l = l.Next { + n = l.N + if n.Op != ONAME { // might be OTYPE or OLITERAL + continue + } + switch n.Class { + case PAUTO, PPARAM, PPARAMOUT: + Nodconst(&nod1, Types[TUINTPTR], l.N.Type.Width) + p = Thearch.Gins(obj.ATYPE, l.N, &nod1) + p.From.Gotype = Linksym(ngotype(l.N)) + } + } + + Genlist(Curfn.Func.Enter) + Genlist(Curfn.Nbody) + gclean() + checklabels() + if nerrors != 0 { + goto ret + } + if Curfn.Func.Endlineno != 0 { + lineno = Curfn.Func.Endlineno + } + + if Curfn.Type.Outtuple != 0 { + Ginscall(throwreturn, 0) + } + + ginit() + + // TODO: Determine when the final cgen_ret can be omitted. Perhaps always? + cgen_ret(nil) + + if Hasdefer != 0 { + // deferreturn pretends to have one uintptr argument. + // Reserve space for it so stack scanner is happy. + if Maxarg < int64(Widthptr) { + Maxarg = int64(Widthptr) + } + } + + gclean() + if nerrors != 0 { + goto ret + } + + Pc.As = obj.ARET // overwrite AEND + Pc.Lineno = lineno + + fixjmp(ptxt) + if Debug['N'] == 0 || Debug['R'] != 0 || Debug['P'] != 0 { + regopt(ptxt) + nilopt(ptxt) + } + + Thearch.Expandchecks(ptxt) + + oldstksize = Stksize + allocauto(ptxt) + + if false { + fmt.Printf("allocauto: %d to %d\n", oldstksize, int64(Stksize)) + } + + setlineno(Curfn) + if int64(Stksize)+Maxarg > 1<<31 { + Yyerror("stack frame too large (>2GB)") + goto ret + } + + // Emit garbage collection symbols. + liveness(Curfn, ptxt, gcargs, gclocals) + + gcsymdup(gcargs) + gcsymdup(gclocals) + + Thearch.Defframe(ptxt) + + if Debug['f'] != 0 { + frame(0) + } + + // Remove leftover instrumentation from the instruction stream. + removevardef(ptxt) + +ret: + lineno = lno +} diff --git a/src/cmd/compile/internal/gc/plive.go b/src/cmd/compile/internal/gc/plive.go new file mode 100644 index 0000000000000000000000000000000000000000..efaf69f550169e2c19a161f9e54689ef451eb1f4 --- /dev/null +++ b/src/cmd/compile/internal/gc/plive.go @@ -0,0 +1,1830 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Garbage collector liveness bitmap generation. + +// The command line flag -live causes this code to print debug information. +// The levels are: +// +// -live (aka -live=1): print liveness lists as code warnings at safe points +// -live=2: print an assembly listing with liveness annotations +// -live=3: print information during each computation phase (much chattier) +// +// Each level includes the earlier output as well. + +package gc + +import ( + "cmd/internal/obj" + "fmt" + "sort" +) + +const ( + UNVISITED = 0 + VISITED = 1 +) + +// An ordinary basic block. +// +// Instructions are threaded together in a doubly-linked list. To iterate in +// program order follow the link pointer from the first node and stop after the +// last node has been visited +// +// for(p = bb->first;; p = p->link) { +// ... +// if(p == bb->last) +// break; +// } +// +// To iterate in reverse program order by following the opt pointer from the +// last node +// +// for(p = bb->last; p != nil; p = p->opt) { +// ... +// } +type BasicBlock struct { + pred []*BasicBlock // predecessors; if none, probably start of CFG + succ []*BasicBlock // successors; if none, probably ends in return statement + first *obj.Prog // first instruction in block + last *obj.Prog // last instruction in block + rpo int // reverse post-order number (also index in cfg) + mark int // mark bit for traversals + lastbitmapindex int // for livenessepilogue + + // Summary sets of block effects. + + // Computed during livenessprologue using only the content of + // individual blocks: + // + // uevar: upward exposed variables (used before set in block) + // varkill: killed variables (set in block) + // avarinit: addrtaken variables set or used (proof of initialization) + uevar Bvec + varkill Bvec + avarinit Bvec + + // Computed during livenesssolve using control flow information: + // + // livein: variables live at block entry + // liveout: variables live at block exit + // avarinitany: addrtaken variables possibly initialized at block exit + // (initialized in block or at exit from any predecessor block) + // avarinitall: addrtaken variables certainly initialized at block exit + // (initialized in block or at exit from all predecessor blocks) + livein Bvec + liveout Bvec + avarinitany Bvec + avarinitall Bvec +} + +// A collection of global state used by liveness analysis. +type Liveness struct { + fn *Node + ptxt *obj.Prog + vars []*Node + cfg []*BasicBlock + + // An array with a bit vector for each safe point tracking live pointers + // in the arguments and locals area, indexed by bb.rpo. + argslivepointers []Bvec + livepointers []Bvec +} + +func xmalloc(size uint32) interface{} { + result := (interface{})(make([]byte, size)) + if result == nil { + Fatal("malloc failed") + } + return result +} + +// Constructs a new basic block containing a single instruction. +func newblock(prog *obj.Prog) *BasicBlock { + if prog == nil { + Fatal("newblock: prog cannot be nil") + } + result := new(BasicBlock) + result.rpo = -1 + result.mark = UNVISITED + result.first = prog + result.last = prog + result.pred = make([]*BasicBlock, 0, 2) + result.succ = make([]*BasicBlock, 0, 2) + return result +} + +// Frees a basic block and all of its leaf data structures. +func freeblock(bb *BasicBlock) { + if bb == nil { + Fatal("freeblock: cannot free nil") + } +} + +// Adds an edge between two basic blocks by making from a predecessor of to and +// to a successor of from. +func addedge(from *BasicBlock, to *BasicBlock) { + if from == nil { + Fatal("addedge: from is nil") + } + if to == nil { + Fatal("addedge: to is nil") + } + from.succ = append(from.succ, to) + to.pred = append(to.pred, from) +} + +// Inserts prev before curr in the instruction +// stream. Any control flow, such as branches or fall throughs, that target the +// existing instruction are adjusted to target the new instruction. +func splicebefore(lv *Liveness, bb *BasicBlock, prev *obj.Prog, curr *obj.Prog) { + // There may be other instructions pointing at curr, + // and we want them to now point at prev. Instead of + // trying to find all such instructions, swap the contents + // so that the problem becomes inserting next after curr. + // The "opt" field is the backward link in the linked list. + + // Overwrite curr's data with prev, but keep the list links. + tmp := *curr + + *curr = *prev + curr.Opt = tmp.Opt + curr.Link = tmp.Link + + // Overwrite prev (now next) with curr's old data. + next := prev + + *next = tmp + next.Opt = nil + next.Link = nil + + // Now insert next after curr. + next.Link = curr.Link + + next.Opt = curr + curr.Link = next + if next.Link != nil && next.Link.Opt == curr { + next.Link.Opt = next + } + + if bb.last == curr { + bb.last = next + } +} + +// A pretty printer for basic blocks. +func printblock(bb *BasicBlock) { + fmt.Printf("basic block %d\n", bb.rpo) + fmt.Printf("\tpred:") + for _, pred := range bb.pred { + fmt.Printf(" %d", pred.rpo) + } + fmt.Printf("\n") + fmt.Printf("\tsucc:") + for _, succ := range bb.succ { + fmt.Printf(" %d", succ.rpo) + } + fmt.Printf("\n") + fmt.Printf("\tprog:\n") + for prog := bb.first; ; prog = prog.Link { + fmt.Printf("\t\t%v\n", prog) + if prog == bb.last { + break + } + } +} + +// Iterates over a basic block applying a callback to each instruction. There +// are two criteria for termination. If the end of basic block is reached a +// value of zero is returned. If the callback returns a non-zero value, the +// iteration is stopped and the value of the callback is returned. +func blockany(bb *BasicBlock, f func(*obj.Prog) bool) bool { + for p := bb.last; p != nil; p = p.Opt.(*obj.Prog) { + if f(p) { + return true + } + } + return false +} + +// Collects and returns and array of Node*s for functions arguments and local +// variables. +func getvariables(fn *Node) []*Node { + result := make([]*Node, 0, 0) + for ll := fn.Func.Dcl; ll != nil; ll = ll.Next { + if ll.N.Op == ONAME { + // In order for GODEBUG=gcdead=1 to work, each bitmap needs + // to contain information about all variables covered by the bitmap. + // For local variables, the bitmap only covers the stkptrsize + // bytes in the frame where variables containing pointers live. + // For arguments and results, the bitmap covers all variables, + // so we must include all the variables, even the ones without + // pointers. + // + // The Node.opt field is available for use by optimization passes. + // We use it to hold the index of the node in the variables array, plus 1 + // (so that 0 means the Node is not in the variables array). + // Each pass should clear opt when done, but you never know, + // so clear them all ourselves too. + // The Node.curfn field is supposed to be set to the current function + // already, but for some compiler-introduced names it seems not to be, + // so fix that here. + // Later, when we want to find the index of a node in the variables list, + // we will check that n->curfn == curfn and n->opt > 0. Then n->opt - 1 + // is the index in the variables list. + ll.N.SetOpt(nil) + + // The compiler doesn't emit initializations for zero-width parameters or results. + if ll.N.Type.Width == 0 { + continue + } + + ll.N.Name.Curfn = Curfn + switch ll.N.Class { + case PAUTO: + if haspointers(ll.N.Type) { + ll.N.SetOpt(int32(len(result))) + result = append(result, ll.N) + } + + case PPARAM, PPARAMOUT: + ll.N.SetOpt(int32(len(result))) + result = append(result, ll.N) + } + } + } + + return result +} + +// A pretty printer for control flow graphs. Takes an array of BasicBlock*s. +func printcfg(cfg []*BasicBlock) { + for _, bb := range cfg { + printblock(bb) + } +} + +// Assigns a reverse post order number to each connected basic block using the +// standard algorithm. Unconnected blocks will not be affected. +func reversepostorder(root *BasicBlock, rpo *int32) { + root.mark = VISITED + for _, bb := range root.succ { + if bb.mark == UNVISITED { + reversepostorder(bb, rpo) + } + } + *rpo -= 1 + root.rpo = int(*rpo) +} + +// Comparison predicate used for sorting basic blocks by their rpo in ascending +// order. +type blockrpocmp []*BasicBlock + +func (x blockrpocmp) Len() int { return len(x) } +func (x blockrpocmp) Swap(i, j int) { x[i], x[j] = x[j], x[i] } +func (x blockrpocmp) Less(i, j int) bool { return x[i].rpo < x[j].rpo } + +// A pattern matcher for call instructions. Returns true when the instruction +// is a call to a specific package qualified function name. +func iscall(prog *obj.Prog, name *obj.LSym) bool { + if prog == nil { + Fatal("iscall: prog is nil") + } + if name == nil { + Fatal("iscall: function name is nil") + } + if prog.As != obj.ACALL { + return false + } + return name == prog.To.Sym +} + +// Returns true for instructions that call a runtime function implementing a +// select communication clause. + +var selectNames [4]*obj.LSym + +func isselectcommcasecall(prog *obj.Prog) bool { + if selectNames[0] == nil { + selectNames[0] = Linksym(Pkglookup("selectsend", Runtimepkg)) + selectNames[1] = Linksym(Pkglookup("selectrecv", Runtimepkg)) + selectNames[2] = Linksym(Pkglookup("selectrecv2", Runtimepkg)) + selectNames[3] = Linksym(Pkglookup("selectdefault", Runtimepkg)) + } + + for _, name := range selectNames { + if iscall(prog, name) { + return true + } + } + return false +} + +// Returns true for call instructions that target runtime·newselect. + +var isnewselect_sym *obj.LSym + +func isnewselect(prog *obj.Prog) bool { + if isnewselect_sym == nil { + isnewselect_sym = Linksym(Pkglookup("newselect", Runtimepkg)) + } + return iscall(prog, isnewselect_sym) +} + +// Returns true for call instructions that target runtime·selectgo. + +var isselectgocall_sym *obj.LSym + +func isselectgocall(prog *obj.Prog) bool { + if isselectgocall_sym == nil { + isselectgocall_sym = Linksym(Pkglookup("selectgo", Runtimepkg)) + } + return iscall(prog, isselectgocall_sym) +} + +var isdeferreturn_sym *obj.LSym + +func isdeferreturn(prog *obj.Prog) bool { + if isdeferreturn_sym == nil { + isdeferreturn_sym = Linksym(Pkglookup("deferreturn", Runtimepkg)) + } + return iscall(prog, isdeferreturn_sym) +} + +// Walk backwards from a runtime·selectgo call up to its immediately dominating +// runtime·newselect call. Any successor nodes of communication clause nodes +// are implicit successors of the runtime·selectgo call node. The goal of this +// analysis is to add these missing edges to complete the control flow graph. +func addselectgosucc(selectgo *BasicBlock) { + var succ *BasicBlock + + pred := selectgo + for { + if len(pred.pred) == 0 { + Fatal("selectgo does not have a newselect") + } + pred = pred.pred[0] + if blockany(pred, isselectcommcasecall) { + // A select comm case block should have exactly one + // successor. + if len(pred.succ) != 1 { + Fatal("select comm case has too many successors") + } + succ = pred.succ[0] + + // Its successor should have exactly two successors. + // The drop through should flow to the selectgo block + // and the branch should lead to the select case + // statements block. + if len(succ.succ) != 2 { + Fatal("select comm case successor has too many successors") + } + + // Add the block as a successor of the selectgo block. + addedge(selectgo, succ) + } + + if blockany(pred, isnewselect) { + // Reached the matching newselect. + break + } + } +} + +// The entry point for the missing selectgo control flow algorithm. Takes an +// array of BasicBlock*s containing selectgo calls. +func fixselectgo(selectgo []*BasicBlock) { + for _, bb := range selectgo { + addselectgosucc(bb) + } +} + +// Constructs a control flow graph from a sequence of instructions. This +// procedure is complicated by various sources of implicit control flow that are +// not accounted for using the standard cfg construction algorithm. Returns an +// array of BasicBlock*s in control flow graph form (basic blocks ordered by +// their RPO number). +func newcfg(firstp *obj.Prog) []*BasicBlock { + // Reset the opt field of each prog to nil. In the first and second + // passes, instructions that are labels temporarily use the opt field to + // point to their basic block. In the third pass, the opt field reset + // to point to the predecessor of an instruction in its basic block. + for p := firstp; p != nil; p = p.Link { + p.Opt = nil + } + + // Allocate an array to remember where we have seen selectgo calls. + // These blocks will be revisited to add successor control flow edges. + selectgo := make([]*BasicBlock, 0, 0) + + // Loop through all instructions identifying branch targets + // and fall-throughs and allocate basic blocks. + cfg := make([]*BasicBlock, 0, 0) + + bb := newblock(firstp) + cfg = append(cfg, bb) + for p := firstp; p != nil; p = p.Link { + Thearch.Proginfo(p) + if p.To.Type == obj.TYPE_BRANCH { + if p.To.Val == nil { + Fatal("prog branch to nil") + } + if p.To.Val.(*obj.Prog).Opt == nil { + p.To.Val.(*obj.Prog).Opt = newblock(p.To.Val.(*obj.Prog)) + cfg = append(cfg, p.To.Val.(*obj.Prog).Opt.(*BasicBlock)) + } + + if p.As != obj.AJMP && p.Link != nil && p.Link.Opt == nil { + p.Link.Opt = newblock(p.Link) + cfg = append(cfg, p.Link.Opt.(*BasicBlock)) + } + } else if isselectcommcasecall(p) || isselectgocall(p) { + // Accommodate implicit selectgo control flow. + if p.Link.Opt == nil { + p.Link.Opt = newblock(p.Link) + cfg = append(cfg, p.Link.Opt.(*BasicBlock)) + } + } + } + + // Loop through all basic blocks maximally growing the list of + // contained instructions until a label is reached. Add edges + // for branches and fall-through instructions. + for _, bb := range cfg { + for p := bb.last; p != nil; p = p.Link { + if p.Opt != nil && p != bb.last { + break + } + bb.last = p + + // Stop before an unreachable RET, to avoid creating + // unreachable control flow nodes. + if p.Link != nil && p.Link.As == obj.ARET && p.Link.Mode == 1 { + break + } + + // Collect basic blocks with selectgo calls. + if isselectgocall(p) { + selectgo = append(selectgo, bb) + } + } + + if bb.last.To.Type == obj.TYPE_BRANCH { + addedge(bb, bb.last.To.Val.(*obj.Prog).Opt.(*BasicBlock)) + } + if bb.last.Link != nil { + // Add a fall-through when the instruction is + // not an unconditional control transfer. + if bb.last.As != obj.AJMP && bb.last.As != obj.ARET && bb.last.As != obj.AUNDEF { + addedge(bb, bb.last.Link.Opt.(*BasicBlock)) + } + } + } + + // Add back links so the instructions in a basic block can be traversed + // backward. This is the final state of the instruction opt field. + for _, bb := range cfg { + p := bb.first + var prev *obj.Prog + for { + p.Opt = prev + if p == bb.last { + break + } + prev = p + p = p.Link + } + } + + // Add missing successor edges to the selectgo blocks. + if len(selectgo) != 0 { + fixselectgo([]*BasicBlock(selectgo)) + } + + // Find a depth-first order and assign a depth-first number to + // all basic blocks. + for _, bb := range cfg { + bb.mark = UNVISITED + } + bb = cfg[0] + rpo := int32(len(cfg)) + reversepostorder(bb, &rpo) + + // Sort the basic blocks by their depth first number. The + // array is now a depth-first spanning tree with the first + // node being the root. + sort.Sort(blockrpocmp(cfg)) + + // Unreachable control flow nodes are indicated by a -1 in the rpo + // field. If we see these nodes something must have gone wrong in an + // upstream compilation phase. + bb = cfg[0] + if bb.rpo == -1 { + fmt.Printf("newcfg: unreachable basic block for %v\n", bb.last) + printcfg(cfg) + Fatal("newcfg: invalid control flow graph") + } + + return cfg +} + +// Frees a control flow graph (an array of BasicBlock*s) and all of its leaf +// data structures. +func freecfg(cfg []*BasicBlock) { + if len(cfg) > 0 { + bb0 := cfg[0] + for p := bb0.first; p != nil; p = p.Link { + p.Opt = nil + } + } +} + +// Returns true if the node names a variable that is otherwise uninteresting to +// the liveness computation. +func isfunny(n *Node) bool { + return n.Sym != nil && (n.Sym.Name == ".fp" || n.Sym.Name == ".args") +} + +// Computes the effects of an instruction on a set of +// variables. The vars argument is an array of Node*s. +// +// The output vectors give bits for variables: +// uevar - used by this instruction +// varkill - killed by this instruction +// for variables without address taken, means variable was set +// for variables with address taken, means variable was marked dead +// avarinit - initialized or referred to by this instruction, +// only for variables with address taken but not escaping to heap +// +// The avarinit output serves as a signal that the data has been +// initialized, because any use of a variable must come after its +// initialization. +func progeffects(prog *obj.Prog, vars []*Node, uevar Bvec, varkill Bvec, avarinit Bvec) { + bvresetall(uevar) + bvresetall(varkill) + bvresetall(avarinit) + + if prog.As == obj.ARET { + // Return instructions implicitly read all the arguments. For + // the sake of correctness, out arguments must be read. For the + // sake of backtrace quality, we read in arguments as well. + // + // A return instruction with a p->to is a tail return, which brings + // the stack pointer back up (if it ever went down) and then jumps + // to a new function entirely. That form of instruction must read + // all the parameters for correctness, and similarly it must not + // read the out arguments - they won't be set until the new + // function runs. + for i, node := range vars { + switch node.Class &^ PHEAP { + case PPARAM: + bvset(uevar, int32(i)) + + // If the result had its address taken, it is being tracked + // by the avarinit code, which does not use uevar. + // If we added it to uevar too, we'd not see any kill + // and decide that the variable was live entry, which it is not. + // So only use uevar in the non-addrtaken case. + // The p->to.type == thearch.D_NONE limits the bvset to + // non-tail-call return instructions; see note above + // the for loop for details. + case PPARAMOUT: + if !node.Addrtaken && prog.To.Type == obj.TYPE_NONE { + bvset(uevar, int32(i)) + } + } + } + + return + } + + if prog.As == obj.ATEXT { + // A text instruction marks the entry point to a function and + // the definition point of all in arguments. + for i, node := range vars { + switch node.Class &^ PHEAP { + case PPARAM: + if node.Addrtaken { + bvset(avarinit, int32(i)) + } + bvset(varkill, int32(i)) + } + } + + return + } + + if prog.Info.Flags&(LeftRead|LeftWrite|LeftAddr) != 0 { + from := &prog.From + if from.Node != nil && from.Sym != nil && ((from.Node).(*Node)).Name.Curfn == Curfn { + switch ((from.Node).(*Node)).Class &^ PHEAP { + case PAUTO, PPARAM, PPARAMOUT: + pos, ok := from.Node.(*Node).Opt().(int32) // index in vars + if !ok { + goto Next + } + if pos >= int32(len(vars)) || vars[pos] != from.Node { + Fatal("bad bookkeeping in liveness %v %d", Nconv(from.Node.(*Node), 0), pos) + } + if ((from.Node).(*Node)).Addrtaken { + bvset(avarinit, pos) + } else { + if prog.Info.Flags&(LeftRead|LeftAddr) != 0 { + bvset(uevar, pos) + } + if prog.Info.Flags&LeftWrite != 0 { + if from.Node != nil && !Isfat(((from.Node).(*Node)).Type) { + bvset(varkill, pos) + } + } + } + } + } + } + +Next: + if prog.Info.Flags&(RightRead|RightWrite|RightAddr) != 0 { + to := &prog.To + if to.Node != nil && to.Sym != nil && ((to.Node).(*Node)).Name.Curfn == Curfn { + switch ((to.Node).(*Node)).Class &^ PHEAP { + case PAUTO, PPARAM, PPARAMOUT: + pos, ok := to.Node.(*Node).Opt().(int32) // index in vars + if !ok { + return + } + if pos >= int32(len(vars)) || vars[pos] != to.Node { + Fatal("bad bookkeeping in liveness %v %d", Nconv(to.Node.(*Node), 0), pos) + } + if ((to.Node).(*Node)).Addrtaken { + if prog.As != obj.AVARKILL { + bvset(avarinit, pos) + } + if prog.As == obj.AVARDEF || prog.As == obj.AVARKILL { + bvset(varkill, pos) + } + } else { + // RightRead is a read, obviously. + // RightAddr by itself is also implicitly a read. + // + // RightAddr|RightWrite means that the address is being taken + // but only so that the instruction can write to the value. + // It is not a read. It is equivalent to RightWrite except that + // having the RightAddr bit set keeps the registerizer from + // trying to substitute a register for the memory location. + if (prog.Info.Flags&RightRead != 0) || prog.Info.Flags&(RightAddr|RightWrite) == RightAddr { + bvset(uevar, pos) + } + if prog.Info.Flags&RightWrite != 0 { + if to.Node != nil && (!Isfat(((to.Node).(*Node)).Type) || prog.As == obj.AVARDEF) { + bvset(varkill, pos) + } + } + } + } + } + } +} + +// Constructs a new liveness structure used to hold the global state of the +// liveness computation. The cfg argument is an array of BasicBlock*s and the +// vars argument is an array of Node*s. +func newliveness(fn *Node, ptxt *obj.Prog, cfg []*BasicBlock, vars []*Node) *Liveness { + result := new(Liveness) + result.fn = fn + result.ptxt = ptxt + result.cfg = cfg + result.vars = vars + + nblocks := int32(len(cfg)) + nvars := int32(len(vars)) + bulk := bvbulkalloc(nvars, nblocks*7) + for _, bb := range cfg { + bb.uevar = bulk.next() + bb.varkill = bulk.next() + bb.livein = bulk.next() + bb.liveout = bulk.next() + bb.avarinit = bulk.next() + bb.avarinitany = bulk.next() + bb.avarinitall = bulk.next() + } + + result.livepointers = make([]Bvec, 0, 0) + result.argslivepointers = make([]Bvec, 0, 0) + return result +} + +// Frees the liveness structure and all of its leaf data structures. +func freeliveness(lv *Liveness) { + if lv == nil { + Fatal("freeliveness: cannot free nil") + } +} + +func printeffects(p *obj.Prog, uevar Bvec, varkill Bvec, avarinit Bvec) { + fmt.Printf("effects of %v", p) + fmt.Printf("\nuevar: ") + bvprint(uevar) + fmt.Printf("\nvarkill: ") + bvprint(varkill) + fmt.Printf("\navarinit: ") + bvprint(avarinit) + fmt.Printf("\n") +} + +// Pretty print a variable node. Uses Pascal like conventions for pointers and +// addresses to avoid confusing the C like conventions used in the node variable +// names. +func printnode(node *Node) { + p := "" + if haspointers(node.Type) { + p = "^" + } + a := "" + if node.Addrtaken { + a = "@" + } + fmt.Printf(" %v%s%s", node, p, a) +} + +// Pretty print a list of variables. The vars argument is an array of Node*s. +func printvars(name string, bv Bvec, vars []*Node) { + fmt.Printf("%s:", name) + for i, node := range vars { + if bvget(bv, int32(i)) != 0 { + printnode(node) + } + } + fmt.Printf("\n") +} + +// Prints a basic block annotated with the information computed by liveness +// analysis. +func livenessprintblock(lv *Liveness, bb *BasicBlock) { + fmt.Printf("basic block %d\n", bb.rpo) + + fmt.Printf("\tpred:") + for _, pred := range bb.pred { + fmt.Printf(" %d", pred.rpo) + } + fmt.Printf("\n") + + fmt.Printf("\tsucc:") + for _, succ := range bb.succ { + fmt.Printf(" %d", succ.rpo) + } + fmt.Printf("\n") + + printvars("\tuevar", bb.uevar, []*Node(lv.vars)) + printvars("\tvarkill", bb.varkill, []*Node(lv.vars)) + printvars("\tlivein", bb.livein, []*Node(lv.vars)) + printvars("\tliveout", bb.liveout, []*Node(lv.vars)) + printvars("\tavarinit", bb.avarinit, []*Node(lv.vars)) + printvars("\tavarinitany", bb.avarinitany, []*Node(lv.vars)) + printvars("\tavarinitall", bb.avarinitall, []*Node(lv.vars)) + + fmt.Printf("\tprog:\n") + for prog := bb.first; ; prog = prog.Link { + fmt.Printf("\t\t%v", prog) + if prog.As == obj.APCDATA && prog.From.Offset == obj.PCDATA_StackMapIndex { + pos := int32(prog.To.Offset) + live := lv.livepointers[pos] + fmt.Printf(" ") + bvprint(live) + } + + fmt.Printf("\n") + if prog == bb.last { + break + } + } +} + +// Prints a control flow graph annotated with any information computed by +// liveness analysis. +func livenessprintcfg(lv *Liveness) { + for _, bb := range lv.cfg { + livenessprintblock(lv, bb) + } +} + +func checkauto(fn *Node, p *obj.Prog, n *Node) { + for l := fn.Func.Dcl; l != nil; l = l.Next { + if l.N.Op == ONAME && l.N.Class == PAUTO && l.N == n { + return + } + } + + if n == nil { + fmt.Printf("%v: checkauto %v: nil node in %v\n", p.Line(), Curfn, p) + return + } + + fmt.Printf("checkauto %v: %v (%p; class=%d) not found in %v\n", Curfn, n, n, n.Class, p) + for l := fn.Func.Dcl; l != nil; l = l.Next { + fmt.Printf("\t%v (%p; class=%d)\n", l.N, l.N, l.N.Class) + } + Yyerror("checkauto: invariant lost") +} + +func checkparam(fn *Node, p *obj.Prog, n *Node) { + if isfunny(n) { + return + } + var a *Node + var class uint8 + for l := fn.Func.Dcl; l != nil; l = l.Next { + a = l.N + class = a.Class &^ PHEAP + if a.Op == ONAME && (class == PPARAM || class == PPARAMOUT) && a == n { + return + } + } + + fmt.Printf("checkparam %v: %v (%p; class=%d) not found in %v\n", Curfn, n, n, n.Class, p) + for l := fn.Func.Dcl; l != nil; l = l.Next { + fmt.Printf("\t%v (%p; class=%d)\n", l.N, l.N, l.N.Class) + } + Yyerror("checkparam: invariant lost") +} + +func checkprog(fn *Node, p *obj.Prog) { + if p.From.Name == obj.NAME_AUTO { + checkauto(fn, p, p.From.Node.(*Node)) + } + if p.From.Name == obj.NAME_PARAM { + checkparam(fn, p, p.From.Node.(*Node)) + } + if p.To.Name == obj.NAME_AUTO { + checkauto(fn, p, p.To.Node.(*Node)) + } + if p.To.Name == obj.NAME_PARAM { + checkparam(fn, p, p.To.Node.(*Node)) + } +} + +// Check instruction invariants. We assume that the nodes corresponding to the +// sources and destinations of memory operations will be declared in the +// function. This is not strictly true, as is the case for the so-called funny +// nodes and there are special cases to skip over that stuff. The analysis will +// fail if this invariant blindly changes. +func checkptxt(fn *Node, firstp *obj.Prog) { + if debuglive == 0 { + return + } + + for p := firstp; p != nil; p = p.Link { + if false { + fmt.Printf("analyzing '%v'\n", p) + } + if p.As != obj.ADATA && p.As != obj.AGLOBL && p.As != obj.ATYPE { + checkprog(fn, p) + } + } +} + +// NOTE: The bitmap for a specific type t should be cached in t after the first run +// and then simply copied into bv at the correct offset on future calls with +// the same type t. On https://rsc.googlecode.com/hg/testdata/slow.go, onebitwalktype1 +// accounts for 40% of the 6g execution time. +func onebitwalktype1(t *Type, xoffset *int64, bv Bvec) { + if t.Align > 0 && *xoffset&int64(t.Align-1) != 0 { + Fatal("onebitwalktype1: invalid initial alignment, %v", t) + } + + switch t.Etype { + case TINT8, + TUINT8, + TINT16, + TUINT16, + TINT32, + TUINT32, + TINT64, + TUINT64, + TINT, + TUINT, + TUINTPTR, + TBOOL, + TFLOAT32, + TFLOAT64, + TCOMPLEX64, + TCOMPLEX128: + *xoffset += t.Width + + case TPTR32, + TPTR64, + TUNSAFEPTR, + TFUNC, + TCHAN, + TMAP: + if *xoffset&int64(Widthptr-1) != 0 { + Fatal("onebitwalktype1: invalid alignment, %v", t) + } + bvset(bv, int32(*xoffset/int64(Widthptr))) // pointer + *xoffset += t.Width + + case TSTRING: + // struct { byte *str; intgo len; } + if *xoffset&int64(Widthptr-1) != 0 { + Fatal("onebitwalktype1: invalid alignment, %v", t) + } + bvset(bv, int32(*xoffset/int64(Widthptr))) //pointer in first slot + *xoffset += t.Width + + case TINTER: + // struct { Itab *tab; void *data; } + // or, when isnilinter(t)==true: + // struct { Type *type; void *data; } + if *xoffset&int64(Widthptr-1) != 0 { + Fatal("onebitwalktype1: invalid alignment, %v", t) + } + bvset(bv, int32(*xoffset/int64(Widthptr))) // pointer in first slot + bvset(bv, int32(*xoffset/int64(Widthptr)+1)) // pointer in second slot + *xoffset += t.Width + + case TARRAY: + // The value of t->bound is -1 for slices types and >=0 for + // for fixed array types. All other values are invalid. + if t.Bound < -1 { + Fatal("onebitwalktype1: invalid bound, %v", t) + } + if Isslice(t) { + // struct { byte *array; uintgo len; uintgo cap; } + if *xoffset&int64(Widthptr-1) != 0 { + Fatal("onebitwalktype1: invalid TARRAY alignment, %v", t) + } + bvset(bv, int32(*xoffset/int64(Widthptr))) // pointer in first slot (BitsPointer) + *xoffset += t.Width + } else { + for i := int64(0); i < t.Bound; i++ { + onebitwalktype1(t.Type, xoffset, bv) + } + } + + case TSTRUCT: + o := int64(0) + var fieldoffset int64 + for t1 := t.Type; t1 != nil; t1 = t1.Down { + fieldoffset = t1.Width + *xoffset += fieldoffset - o + onebitwalktype1(t1.Type, xoffset, bv) + o = fieldoffset + t1.Type.Width + } + + *xoffset += t.Width - o + + default: + Fatal("onebitwalktype1: unexpected type, %v", t) + } +} + +// Returns the number of words of local variables. +func localswords() int32 { + return int32(stkptrsize / int64(Widthptr)) +} + +// Returns the number of words of in and out arguments. +func argswords() int32 { + return int32(Curfn.Type.Argwid / int64(Widthptr)) +} + +// Generates live pointer value maps for arguments and local variables. The +// this argument and the in arguments are always assumed live. The vars +// argument is an array of Node*s. +func onebitlivepointermap(lv *Liveness, liveout Bvec, vars []*Node, args Bvec, locals Bvec) { + var node *Node + var xoffset int64 + + for i := int32(0); ; i++ { + i = int32(bvnext(liveout, i)) + if i < 0 { + break + } + node = vars[i] + switch node.Class { + case PAUTO: + xoffset = node.Xoffset + stkptrsize + onebitwalktype1(node.Type, &xoffset, locals) + + case PPARAM, PPARAMOUT: + xoffset = node.Xoffset + onebitwalktype1(node.Type, &xoffset, args) + } + } + + // The node list only contains declared names. + // If the receiver or arguments are unnamed, they will be omitted + // from the list above. Preserve those values - even though they are unused - + // in order to keep their addresses live for use in stack traces. + thisargtype := getthisx(lv.fn.Type) + + if thisargtype != nil { + xoffset = 0 + onebitwalktype1(thisargtype, &xoffset, args) + } + + inargtype := getinargx(lv.fn.Type) + if inargtype != nil { + xoffset = 0 + onebitwalktype1(inargtype, &xoffset, args) + } +} + +// Construct a disembodied instruction. +func unlinkedprog(as int) *obj.Prog { + p := Ctxt.NewProg() + Clearp(p) + p.As = int16(as) + return p +} + +// Construct a new PCDATA instruction associated with and for the purposes of +// covering an existing instruction. +func newpcdataprog(prog *obj.Prog, index int32) *obj.Prog { + var from Node + var to Node + + Nodconst(&from, Types[TINT32], obj.PCDATA_StackMapIndex) + Nodconst(&to, Types[TINT32], int64(index)) + pcdata := unlinkedprog(obj.APCDATA) + pcdata.Lineno = prog.Lineno + Naddr(&pcdata.From, &from) + Naddr(&pcdata.To, &to) + return pcdata +} + +// Returns true for instructions that are safe points that must be annotated +// with liveness information. +func issafepoint(prog *obj.Prog) bool { + return prog.As == obj.ATEXT || prog.As == obj.ACALL +} + +// Initializes the sets for solving the live variables. Visits all the +// instructions in each basic block to summarizes the information at each basic +// block +func livenessprologue(lv *Liveness) { + nvars := int32(len(lv.vars)) + uevar := bvalloc(nvars) + varkill := bvalloc(nvars) + avarinit := bvalloc(nvars) + for _, bb := range lv.cfg { + // Walk the block instructions backward and update the block + // effects with the each prog effects. + for p := bb.last; p != nil; p = p.Opt.(*obj.Prog) { + progeffects(p, []*Node(lv.vars), uevar, varkill, avarinit) + if debuglive >= 3 { + printeffects(p, uevar, varkill, avarinit) + } + bvor(bb.varkill, bb.varkill, varkill) + bvandnot(bb.uevar, bb.uevar, varkill) + bvor(bb.uevar, bb.uevar, uevar) + } + + // Walk the block instructions forward to update avarinit bits. + // avarinit describes the effect at the end of the block, not the beginning. + bvresetall(varkill) + + for p := bb.first; ; p = p.Link { + progeffects(p, []*Node(lv.vars), uevar, varkill, avarinit) + if debuglive >= 3 { + printeffects(p, uevar, varkill, avarinit) + } + bvandnot(bb.avarinit, bb.avarinit, varkill) + bvor(bb.avarinit, bb.avarinit, avarinit) + if p == bb.last { + break + } + } + } +} + +// Solve the liveness dataflow equations. +func livenesssolve(lv *Liveness) { + // These temporary bitvectors exist to avoid successive allocations and + // frees within the loop. + newlivein := bvalloc(int32(len(lv.vars))) + + newliveout := bvalloc(int32(len(lv.vars))) + any := bvalloc(int32(len(lv.vars))) + all := bvalloc(int32(len(lv.vars))) + + // Push avarinitall, avarinitany forward. + // avarinitall says the addressed var is initialized along all paths reaching the block exit. + // avarinitany says the addressed var is initialized along some path reaching the block exit. + for i, bb := range lv.cfg { + if i == 0 { + bvcopy(bb.avarinitall, bb.avarinit) + } else { + bvresetall(bb.avarinitall) + bvnot(bb.avarinitall) + } + bvcopy(bb.avarinitany, bb.avarinit) + } + + change := int32(1) + for change != 0 { + change = 0 + for _, bb := range lv.cfg { + bvresetall(any) + bvresetall(all) + for j, pred := range bb.pred { + if j == 0 { + bvcopy(any, pred.avarinitany) + bvcopy(all, pred.avarinitall) + } else { + bvor(any, any, pred.avarinitany) + bvand(all, all, pred.avarinitall) + } + } + + bvandnot(any, any, bb.varkill) + bvandnot(all, all, bb.varkill) + bvor(any, any, bb.avarinit) + bvor(all, all, bb.avarinit) + if bvcmp(any, bb.avarinitany) != 0 { + change = 1 + bvcopy(bb.avarinitany, any) + } + + if bvcmp(all, bb.avarinitall) != 0 { + change = 1 + bvcopy(bb.avarinitall, all) + } + } + } + + // Iterate through the blocks in reverse round-robin fashion. A work + // queue might be slightly faster. As is, the number of iterations is + // so low that it hardly seems to be worth the complexity. + change = 1 + + for change != 0 { + change = 0 + + // Walk blocks in the general direction of propagation. This + // improves convergence. + for i := len(lv.cfg) - 1; i >= 0; i-- { + bb := lv.cfg[i] + + // A variable is live on output from this block + // if it is live on input to some successor. + // + // out[b] = \bigcup_{s \in succ[b]} in[s] + bvresetall(newliveout) + for _, succ := range bb.succ { + bvor(newliveout, newliveout, succ.livein) + } + + if bvcmp(bb.liveout, newliveout) != 0 { + change = 1 + bvcopy(bb.liveout, newliveout) + } + + // A variable is live on input to this block + // if it is live on output from this block and + // not set by the code in this block. + // + // in[b] = uevar[b] \cup (out[b] \setminus varkill[b]) + bvandnot(newlivein, bb.liveout, bb.varkill) + + bvor(bb.livein, newlivein, bb.uevar) + } + } +} + +// This function is slow but it is only used for generating debug prints. +// Check whether n is marked live in args/locals. +func islive(n *Node, args Bvec, locals Bvec) bool { + switch n.Class { + case PPARAM, PPARAMOUT: + for i := 0; int64(i) < n.Type.Width/int64(Widthptr); i++ { + if bvget(args, int32(n.Xoffset/int64(Widthptr)+int64(i))) != 0 { + return true + } + } + + case PAUTO: + for i := 0; int64(i) < n.Type.Width/int64(Widthptr); i++ { + if bvget(locals, int32((n.Xoffset+stkptrsize)/int64(Widthptr)+int64(i))) != 0 { + return true + } + } + } + + return false +} + +// Visits all instructions in a basic block and computes a bit vector of live +// variables at each safe point locations. +func livenessepilogue(lv *Liveness) { + var pred *BasicBlock + var args Bvec + var locals Bvec + var n *Node + var p *obj.Prog + var j int32 + var pos int32 + var xoffset int64 + + nvars := int32(len(lv.vars)) + livein := bvalloc(nvars) + liveout := bvalloc(nvars) + uevar := bvalloc(nvars) + varkill := bvalloc(nvars) + avarinit := bvalloc(nvars) + any := bvalloc(nvars) + all := bvalloc(nvars) + ambig := bvalloc(localswords()) + nmsg := int32(0) + startmsg := int32(0) + + for _, bb := range lv.cfg { + // Compute avarinitany and avarinitall for entry to block. + // This duplicates information known during livenesssolve + // but avoids storing two more vectors for each block. + bvresetall(any) + + bvresetall(all) + for j = 0; j < int32(len(bb.pred)); j++ { + pred = bb.pred[j] + if j == 0 { + bvcopy(any, pred.avarinitany) + bvcopy(all, pred.avarinitall) + } else { + bvor(any, any, pred.avarinitany) + bvand(all, all, pred.avarinitall) + } + } + + // Walk forward through the basic block instructions and + // allocate liveness maps for those instructions that need them. + // Seed the maps with information about the addrtaken variables. + for p = bb.first; ; p = p.Link { + progeffects(p, []*Node(lv.vars), uevar, varkill, avarinit) + bvandnot(any, any, varkill) + bvandnot(all, all, varkill) + bvor(any, any, avarinit) + bvor(all, all, avarinit) + + if issafepoint(p) { + // Annotate ambiguously live variables so that they can + // be zeroed at function entry. + // livein and liveout are dead here and used as temporaries. + bvresetall(livein) + + bvandnot(liveout, any, all) + if !bvisempty(liveout) { + for pos = 0; pos < liveout.n; pos++ { + if bvget(liveout, pos) == 0 { + continue + } + bvset(all, pos) // silence future warnings in this block + n = lv.vars[pos] + if !n.Name.Needzero { + n.Name.Needzero = true + if debuglive >= 1 { + Warnl(int(p.Lineno), "%v: %v is ambiguously live", Curfn.Func.Nname, Nconv(n, obj.FmtLong)) + } + + // Record in 'ambiguous' bitmap. + xoffset = n.Xoffset + stkptrsize + + onebitwalktype1(n.Type, &xoffset, ambig) + } + } + } + + // Allocate a bit vector for each class and facet of + // value we are tracking. + + // Live stuff first. + args = bvalloc(argswords()) + + lv.argslivepointers = append(lv.argslivepointers, args) + locals = bvalloc(localswords()) + lv.livepointers = append(lv.livepointers, locals) + + if debuglive >= 3 { + fmt.Printf("%v\n", p) + printvars("avarinitany", any, lv.vars) + } + + // Record any values with an "address taken" reaching + // this code position as live. Must do now instead of below + // because the any/all calculation requires walking forward + // over the block (as this loop does), while the liveout + // requires walking backward (as the next loop does). + onebitlivepointermap(lv, any, lv.vars, args, locals) + } + + if p == bb.last { + break + } + } + + bb.lastbitmapindex = len(lv.livepointers) - 1 + } + + var fmt_ string + var next *obj.Prog + var numlive int32 + var msg []string + for _, bb := range lv.cfg { + if debuglive >= 1 && Curfn.Func.Nname.Sym.Name != "init" && Curfn.Func.Nname.Sym.Name[0] != '.' { + nmsg = int32(len(lv.livepointers)) + startmsg = nmsg + msg = make([]string, nmsg) + for j = 0; j < nmsg; j++ { + msg[j] = "" + } + } + + // walk backward, emit pcdata and populate the maps + pos = int32(bb.lastbitmapindex) + + if pos < 0 { + // the first block we encounter should have the ATEXT so + // at no point should pos ever be less than zero. + Fatal("livenessepilogue") + } + + bvcopy(livein, bb.liveout) + for p = bb.last; p != nil; p = next { + next = p.Opt.(*obj.Prog) // splicebefore modifies p->opt + + // Propagate liveness information + progeffects(p, lv.vars, uevar, varkill, avarinit) + + bvcopy(liveout, livein) + bvandnot(livein, liveout, varkill) + bvor(livein, livein, uevar) + if debuglive >= 3 && issafepoint(p) { + fmt.Printf("%v\n", p) + printvars("uevar", uevar, lv.vars) + printvars("varkill", varkill, lv.vars) + printvars("livein", livein, lv.vars) + printvars("liveout", liveout, lv.vars) + } + + if issafepoint(p) { + // Found an interesting instruction, record the + // corresponding liveness information. + + // Useful sanity check: on entry to the function, + // the only things that can possibly be live are the + // input parameters. + if p.As == obj.ATEXT { + for j = 0; j < liveout.n; j++ { + if bvget(liveout, j) == 0 { + continue + } + n = lv.vars[j] + if n.Class != PPARAM { + yyerrorl(int(p.Lineno), "internal error: %v %v recorded as live on entry", Curfn.Func.Nname, Nconv(n, obj.FmtLong)) + } + } + } + + // Record live pointers. + args = lv.argslivepointers[pos] + + locals = lv.livepointers[pos] + onebitlivepointermap(lv, liveout, lv.vars, args, locals) + + // Ambiguously live variables are zeroed immediately after + // function entry. Mark them live for all the non-entry bitmaps + // so that GODEBUG=gcdead=1 mode does not poison them. + if p.As == obj.ACALL { + bvor(locals, locals, ambig) + } + + // Show live pointer bitmaps. + // We're interpreting the args and locals bitmap instead of liveout so that we + // include the bits added by the avarinit logic in the + // previous loop. + if msg != nil { + fmt_ = "" + fmt_ += fmt.Sprintf("%v: live at ", p.Line()) + if p.As == obj.ACALL && p.To.Node != nil { + fmt_ += fmt.Sprintf("call to %s:", ((p.To.Node).(*Node)).Sym.Name) + } else if p.As == obj.ACALL { + fmt_ += "indirect call:" + } else { + fmt_ += fmt.Sprintf("entry to %s:", ((p.From.Node).(*Node)).Sym.Name) + } + numlive = 0 + for j = 0; j < int32(len(lv.vars)); j++ { + n = lv.vars[j] + if islive(n, args, locals) { + fmt_ += fmt.Sprintf(" %v", n) + numlive++ + } + } + + fmt_ += "\n" + if numlive == 0 { // squelch message + + } else { + startmsg-- + msg[startmsg] = fmt_ + } + } + + // Only CALL instructions need a PCDATA annotation. + // The TEXT instruction annotation is implicit. + if p.As == obj.ACALL { + if isdeferreturn(p) { + // runtime.deferreturn modifies its return address to return + // back to the CALL, not to the subsequent instruction. + // Because the return comes back one instruction early, + // the PCDATA must begin one instruction early too. + // The instruction before a call to deferreturn is always a + // no-op, to keep PC-specific data unambiguous. + splicebefore(lv, bb, newpcdataprog(p.Opt.(*obj.Prog), pos), p.Opt.(*obj.Prog)) + } else { + splicebefore(lv, bb, newpcdataprog(p, pos), p) + } + } + + pos-- + } + } + + if msg != nil { + for j = startmsg; j < nmsg; j++ { + if msg[j] != "" { + fmt.Printf("%s", msg[j]) + } + } + + msg = nil + nmsg = 0 + startmsg = 0 + } + } + + Flusherrors() +} + +// FNV-1 hash function constants. +const ( + H0 = 2166136261 + Hp = 16777619 +) + +func hashbitmap(h uint32, bv Bvec) uint32 { + var w uint32 + + n := int((bv.n + 31) / 32) + for i := 0; i < n; i++ { + w = bv.b[i] + h = (h * Hp) ^ (w & 0xff) + h = (h * Hp) ^ ((w >> 8) & 0xff) + h = (h * Hp) ^ ((w >> 16) & 0xff) + h = (h * Hp) ^ ((w >> 24) & 0xff) + } + + return h +} + +// Compact liveness information by coalescing identical per-call-site bitmaps. +// The merging only happens for a single function, not across the entire binary. +// +// There are actually two lists of bitmaps, one list for the local variables and one +// list for the function arguments. Both lists are indexed by the same PCDATA +// index, so the corresponding pairs must be considered together when +// merging duplicates. The argument bitmaps change much less often during +// function execution than the local variable bitmaps, so it is possible that +// we could introduce a separate PCDATA index for arguments vs locals and +// then compact the set of argument bitmaps separately from the set of +// local variable bitmaps. As of 2014-04-02, doing this to the godoc binary +// is actually a net loss: we save about 50k of argument bitmaps but the new +// PCDATA tables cost about 100k. So for now we keep using a single index for +// both bitmap lists. +func livenesscompact(lv *Liveness) { + // Linear probing hash table of bitmaps seen so far. + // The hash table has 4n entries to keep the linear + // scan short. An entry of -1 indicates an empty slot. + n := len(lv.livepointers) + + tablesize := 4 * n + table := make([]int, tablesize) + for i := range table { + table[i] = -1 + } + + // remap[i] = the new index of the old bit vector #i. + remap := make([]int, n) + + for i := range remap { + remap[i] = -1 + } + uniq := 0 // unique tables found so far + + // Consider bit vectors in turn. + // If new, assign next number using uniq, + // record in remap, record in lv->livepointers and lv->argslivepointers + // under the new index, and add entry to hash table. + // If already seen, record earlier index in remap and free bitmaps. + var jarg Bvec + var j int + var h uint32 + var arg Bvec + var jlocal Bvec + var local Bvec + for i := 0; i < n; i++ { + local = lv.livepointers[i] + arg = lv.argslivepointers[i] + h = hashbitmap(hashbitmap(H0, local), arg) % uint32(tablesize) + + for { + j = table[h] + if j < 0 { + break + } + jlocal = lv.livepointers[j] + jarg = lv.argslivepointers[j] + if bvcmp(local, jlocal) == 0 && bvcmp(arg, jarg) == 0 { + remap[i] = j + goto Next + } + + h++ + if h == uint32(tablesize) { + h = 0 + } + } + + table[h] = uniq + remap[i] = uniq + lv.livepointers[uniq] = local + lv.argslivepointers[uniq] = arg + uniq++ + Next: + } + + // We've already reordered lv->livepointers[0:uniq] + // and lv->argslivepointers[0:uniq] and freed the bitmaps + // we don't need anymore. Clear the pointers later in the + // array so that we can tell where the coalesced bitmaps stop + // and so that we don't double-free when cleaning up. + for j := uniq; j < n; j++ { + lv.livepointers[j] = Bvec{} + lv.argslivepointers[j] = Bvec{} + } + + // Rewrite PCDATA instructions to use new numbering. + var i int + for p := lv.ptxt; p != nil; p = p.Link { + if p.As == obj.APCDATA && p.From.Offset == obj.PCDATA_StackMapIndex { + i = int(p.To.Offset) + if i >= 0 { + p.To.Offset = int64(remap[i]) + } + } + } +} + +func printbitset(printed int, name string, vars []*Node, bits Bvec) int { + started := 0 + for i, n := range vars { + if bvget(bits, int32(i)) == 0 { + continue + } + if started == 0 { + if printed == 0 { + fmt.Printf("\t") + } else { + fmt.Printf(" ") + } + started = 1 + printed = 1 + fmt.Printf("%s=", name) + } else { + fmt.Printf(",") + } + + fmt.Printf("%s", n.Sym.Name) + } + + return printed +} + +// Prints the computed liveness information and inputs, for debugging. +// This format synthesizes the information used during the multiple passes +// into a single presentation. +func livenessprintdebug(lv *Liveness) { + var j int + var printed int + var p *obj.Prog + var args Bvec + var locals Bvec + var n *Node + + fmt.Printf("liveness: %s\n", Curfn.Func.Nname.Sym.Name) + + uevar := bvalloc(int32(len(lv.vars))) + varkill := bvalloc(int32(len(lv.vars))) + avarinit := bvalloc(int32(len(lv.vars))) + + pcdata := 0 + for i, bb := range lv.cfg { + if i > 0 { + fmt.Printf("\n") + } + + // bb#0 pred=1,2 succ=3,4 + fmt.Printf("bb#%d pred=", i) + + for j = 0; j < len(bb.pred); j++ { + if j > 0 { + fmt.Printf(",") + } + fmt.Printf("%d", (bb.pred[j]).rpo) + } + + fmt.Printf(" succ=") + for j = 0; j < len(bb.succ); j++ { + if j > 0 { + fmt.Printf(",") + } + fmt.Printf("%d", (bb.succ[j]).rpo) + } + + fmt.Printf("\n") + + // initial settings + printed = 0 + + printed = printbitset(printed, "uevar", lv.vars, bb.uevar) + printed = printbitset(printed, "livein", lv.vars, bb.livein) + if printed != 0 { + fmt.Printf("\n") + } + + // program listing, with individual effects listed + for p = bb.first; ; p = p.Link { + fmt.Printf("%v\n", p) + if p.As == obj.APCDATA && p.From.Offset == obj.PCDATA_StackMapIndex { + pcdata = int(p.To.Offset) + } + progeffects(p, lv.vars, uevar, varkill, avarinit) + printed = 0 + printed = printbitset(printed, "uevar", lv.vars, uevar) + printed = printbitset(printed, "varkill", lv.vars, varkill) + printed = printbitset(printed, "avarinit", lv.vars, avarinit) + if printed != 0 { + fmt.Printf("\n") + } + if issafepoint(p) { + args = lv.argslivepointers[pcdata] + locals = lv.livepointers[pcdata] + fmt.Printf("\tlive=") + printed = 0 + for j = 0; j < len(lv.vars); j++ { + n = lv.vars[j] + if islive(n, args, locals) { + tmp9 := printed + printed++ + if tmp9 != 0 { + fmt.Printf(",") + } + fmt.Printf("%v", n) + } + } + + fmt.Printf("\n") + } + + if p == bb.last { + break + } + } + + // bb bitsets + fmt.Printf("end\n") + + printed = printbitset(printed, "varkill", lv.vars, bb.varkill) + printed = printbitset(printed, "liveout", lv.vars, bb.liveout) + printed = printbitset(printed, "avarinit", lv.vars, bb.avarinit) + printed = printbitset(printed, "avarinitany", lv.vars, bb.avarinitany) + printed = printbitset(printed, "avarinitall", lv.vars, bb.avarinitall) + if printed != 0 { + fmt.Printf("\n") + } + } + + fmt.Printf("\n") +} + +// Dumps an array of bitmaps to a symbol as a sequence of uint32 values. The +// first word dumped is the total number of bitmaps. The second word is the +// length of the bitmaps. All bitmaps are assumed to be of equal length. The +// words that are followed are the raw bitmap words. The arr argument is an +// array of Node*s. +func onebitwritesymbol(arr []Bvec, sym *Sym) { + var i int + var j int + var word uint32 + + n := len(arr) + off := 0 + off += 4 // number of bitmaps, to fill in later + bv := arr[0] + off = duint32(sym, off, uint32(bv.n)) // number of bits in each bitmap + for i = 0; i < n; i++ { + // bitmap words + bv = arr[i] + + if bv.b == nil { + break + } + for j = 0; int32(j) < bv.n; j += 32 { + word = bv.b[j/32] + + // Runtime reads the bitmaps as byte arrays. Oblige. + off = duint8(sym, off, uint8(word)) + + off = duint8(sym, off, uint8(word>>8)) + off = duint8(sym, off, uint8(word>>16)) + off = duint8(sym, off, uint8(word>>24)) + } + } + + duint32(sym, 0, uint32(i)) // number of bitmaps + ggloblsym(sym, int32(off), obj.RODATA) +} + +func printprog(p *obj.Prog) { + for p != nil { + fmt.Printf("%v\n", p) + p = p.Link + } +} + +// Entry pointer for liveness analysis. Constructs a complete CFG, solves for +// the liveness of pointer variables in the function, and emits a runtime data +// structure read by the garbage collector. +func liveness(fn *Node, firstp *obj.Prog, argssym *Sym, livesym *Sym) { + // Change name to dump debugging information only for a specific function. + debugdelta := 0 + + if Curfn.Func.Nname.Sym.Name == "!" { + debugdelta = 2 + } + + debuglive += debugdelta + if debuglive >= 3 { + fmt.Printf("liveness: %s\n", Curfn.Func.Nname.Sym.Name) + printprog(firstp) + } + + checkptxt(fn, firstp) + + // Construct the global liveness state. + cfg := newcfg(firstp) + + if debuglive >= 3 { + printcfg([]*BasicBlock(cfg)) + } + vars := getvariables(fn) + lv := newliveness(fn, firstp, cfg, vars) + + // Run the dataflow framework. + livenessprologue(lv) + + if debuglive >= 3 { + livenessprintcfg(lv) + } + livenesssolve(lv) + if debuglive >= 3 { + livenessprintcfg(lv) + } + livenessepilogue(lv) + if debuglive >= 3 { + livenessprintcfg(lv) + } + livenesscompact(lv) + + if debuglive >= 2 { + livenessprintdebug(lv) + } + + // Emit the live pointer map data structures + onebitwritesymbol(lv.livepointers, livesym) + + onebitwritesymbol(lv.argslivepointers, argssym) + + // Free everything. + for l := fn.Func.Dcl; l != nil; l = l.Next { + if l.N != nil { + l.N.SetOpt(nil) + } + } + freeliveness(lv) + + freecfg([]*BasicBlock(cfg)) + + debuglive -= debugdelta +} diff --git a/src/cmd/compile/internal/gc/popt.go b/src/cmd/compile/internal/gc/popt.go new file mode 100644 index 0000000000000000000000000000000000000000..4fc562c1f52fa54051244a94399c50cc3e321660 --- /dev/null +++ b/src/cmd/compile/internal/gc/popt.go @@ -0,0 +1,1086 @@ +// Derived from Inferno utils/6c/gc.h +// http://code.google.com/p/inferno-os/source/browse/utils/6c/gc.h +// +// Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved. +// Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net) +// Portions Copyright © 1997-1999 Vita Nuova Limited +// Portions Copyright © 2000-2007 Vita Nuova Holdings Limited (www.vitanuova.com) +// Portions Copyright © 2004,2006 Bruce Ellis +// Portions Copyright © 2005-2007 C H Forsyth (forsyth@terzarima.net) +// Revisions Copyright © 2000-2007 Lucent Technologies Inc. and others +// Portions Copyright © 2009 The Go Authors. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +// "Portable" optimizations. + +package gc + +import ( + "cmd/internal/obj" + "fmt" + "sort" + "strings" +) + +type OptStats struct { + Ncvtreg int32 + Nspill int32 + Nreload int32 + Ndelmov int32 + Nvar int32 + Naddr int32 +} + +var Ostats OptStats + +var noreturn_symlist [10]*Sym + +// p is a call instruction. Does the call fail to return? +func Noreturn(p *obj.Prog) bool { + if noreturn_symlist[0] == nil { + noreturn_symlist[0] = Pkglookup("panicindex", Runtimepkg) + noreturn_symlist[1] = Pkglookup("panicslice", Runtimepkg) + noreturn_symlist[2] = Pkglookup("throwinit", Runtimepkg) + noreturn_symlist[3] = Pkglookup("gopanic", Runtimepkg) + noreturn_symlist[4] = Pkglookup("panicwrap", Runtimepkg) + noreturn_symlist[5] = Pkglookup("throwreturn", Runtimepkg) + noreturn_symlist[6] = Pkglookup("selectgo", Runtimepkg) + noreturn_symlist[7] = Pkglookup("block", Runtimepkg) + } + + if p.To.Node == nil { + return false + } + s := ((p.To.Node).(*Node)).Sym + if s == nil { + return false + } + for i := 0; noreturn_symlist[i] != nil; i++ { + if s == noreturn_symlist[i] { + return true + } + } + return false +} + +// JMP chasing and removal. +// +// The code generator depends on being able to write out jump +// instructions that it can jump to now but fill in later. +// the linker will resolve them nicely, but they make the code +// longer and more difficult to follow during debugging. +// Remove them. + +/* what instruction does a JMP to p eventually land on? */ +func chasejmp(p *obj.Prog, jmploop *int) *obj.Prog { + n := 0 + for p != nil && p.As == obj.AJMP && p.To.Type == obj.TYPE_BRANCH { + n++ + if n > 10 { + *jmploop = 1 + break + } + + p = p.To.Val.(*obj.Prog) + } + + return p +} + +/* + * reuse reg pointer for mark/sweep state. + * leave reg==nil at end because alive==nil. + */ +var alive interface{} = nil +var dead interface{} = 1 + +/* mark all code reachable from firstp as alive */ +func mark(firstp *obj.Prog) { + for p := firstp; p != nil; p = p.Link { + if p.Opt != dead { + break + } + p.Opt = alive + if p.As != obj.ACALL && p.To.Type == obj.TYPE_BRANCH && p.To.Val.(*obj.Prog) != nil { + mark(p.To.Val.(*obj.Prog)) + } + if p.As == obj.AJMP || p.As == obj.ARET || p.As == obj.AUNDEF { + break + } + } +} + +func fixjmp(firstp *obj.Prog) { + if Debug['R'] != 0 && Debug['v'] != 0 { + fmt.Printf("\nfixjmp\n") + } + + // pass 1: resolve jump to jump, mark all code as dead. + jmploop := 0 + + for p := firstp; p != nil; p = p.Link { + if Debug['R'] != 0 && Debug['v'] != 0 { + fmt.Printf("%v\n", p) + } + if p.As != obj.ACALL && p.To.Type == obj.TYPE_BRANCH && p.To.Val.(*obj.Prog) != nil && p.To.Val.(*obj.Prog).As == obj.AJMP { + p.To.Val = chasejmp(p.To.Val.(*obj.Prog), &jmploop) + if Debug['R'] != 0 && Debug['v'] != 0 { + fmt.Printf("->%v\n", p) + } + } + + p.Opt = dead + } + + if Debug['R'] != 0 && Debug['v'] != 0 { + fmt.Printf("\n") + } + + // pass 2: mark all reachable code alive + mark(firstp) + + // pass 3: delete dead code (mostly JMPs). + var last *obj.Prog + + for p := firstp; p != nil; p = p.Link { + if p.Opt == dead { + if p.Link == nil && p.As == obj.ARET && last != nil && last.As != obj.ARET { + // This is the final ARET, and the code so far doesn't have one. + // Let it stay. The register allocator assumes that all live code in + // the function can be traversed by starting at all the RET instructions + // and following predecessor links. If we remove the final RET, + // this assumption will not hold in the case of an infinite loop + // at the end of a function. + // Keep the RET but mark it dead for the liveness analysis. + p.Mode = 1 + } else { + if Debug['R'] != 0 && Debug['v'] != 0 { + fmt.Printf("del %v\n", p) + } + continue + } + } + + if last != nil { + last.Link = p + } + last = p + } + + last.Link = nil + + // pass 4: elide JMP to next instruction. + // only safe if there are no jumps to JMPs anymore. + if jmploop == 0 { + var last *obj.Prog + for p := firstp; p != nil; p = p.Link { + if p.As == obj.AJMP && p.To.Type == obj.TYPE_BRANCH && p.To.Val == p.Link { + if Debug['R'] != 0 && Debug['v'] != 0 { + fmt.Printf("del %v\n", p) + } + continue + } + + if last != nil { + last.Link = p + } + last = p + } + + last.Link = nil + } + + if Debug['R'] != 0 && Debug['v'] != 0 { + fmt.Printf("\n") + for p := firstp; p != nil; p = p.Link { + fmt.Printf("%v\n", p) + } + fmt.Printf("\n") + } +} + +// Control flow analysis. The Flow structures hold predecessor and successor +// information as well as basic loop analysis. +// +// graph = flowstart(firstp, 0); +// ... use flow graph ... +// flowend(graph); // free graph +// +// Typical uses of the flow graph are to iterate over all the flow-relevant instructions: +// +// for(f = graph->start; f != nil; f = f->link) +// +// or, given an instruction f, to iterate over all the predecessors, which is +// f->p1 and this list: +// +// for(f2 = f->p2; f2 != nil; f2 = f2->p2link) +// +// The size argument to flowstart specifies an amount of zeroed memory +// to allocate in every f->data field, for use by the client. +// If size == 0, f->data will be nil. + +var flowmark int + +// MaxFlowProg is the maximum size program (counted in instructions) +// for which the flow code will build a graph. Functions larger than this limit +// will not have flow graphs and consequently will not be optimized. +const MaxFlowProg = 50000 + +func Flowstart(firstp *obj.Prog, newData func() interface{}) *Graph { + // Count and mark instructions to annotate. + nf := 0 + + for p := firstp; p != nil; p = p.Link { + p.Opt = nil // should be already, but just in case + Thearch.Proginfo(p) + if p.Info.Flags&Skip != 0 { + continue + } + p.Opt = &flowmark + nf++ + } + + if nf == 0 { + return nil + } + + if nf >= MaxFlowProg { + if Debug['v'] != 0 { + Warn("%v is too big (%d instructions)", Curfn.Func.Nname.Sym, nf) + } + return nil + } + + // Allocate annotations and assign to instructions. + graph := new(Graph) + ff := make([]Flow, nf) + start := &ff[0] + id := 0 + var last *Flow + for p := firstp; p != nil; p = p.Link { + if p.Opt == nil { + continue + } + f := &ff[0] + ff = ff[1:] + p.Opt = f + f.Prog = p + if last != nil { + last.Link = f + } + last = f + if newData != nil { + f.Data = newData() + } + f.Id = int32(id) + id++ + } + + // Fill in pred/succ information. + var f1 *Flow + var p *obj.Prog + for f := start; f != nil; f = f.Link { + p = f.Prog + if p.Info.Flags&Break == 0 { + f1 = f.Link + f.S1 = f1 + f1.P1 = f + } + + if p.To.Type == obj.TYPE_BRANCH { + if p.To.Val == nil { + Fatal("pnil %v", p) + } + f1 = p.To.Val.(*obj.Prog).Opt.(*Flow) + if f1 == nil { + Fatal("fnil %v / %v", p, p.To.Val.(*obj.Prog)) + } + if f1 == f { + //fatal("self loop %v", p); + continue + } + + f.S2 = f1 + f.P2link = f1.P2 + f1.P2 = f + } + } + + graph.Start = start + graph.Num = nf + return graph +} + +func Flowend(graph *Graph) { + for f := graph.Start; f != nil; f = f.Link { + f.Prog.Info.Flags = 0 // drop cached proginfo + f.Prog.Opt = nil + } +} + +/* + * find looping structure + * + * 1) find reverse postordering + * 2) find approximate dominators, + * the actual dominators if the flow graph is reducible + * otherwise, dominators plus some other non-dominators. + * See Matthew S. Hecht and Jeffrey D. Ullman, + * "Analysis of a Simple Algorithm for Global Data Flow Problems", + * Conf. Record of ACM Symp. on Principles of Prog. Langs, Boston, Massachusetts, + * Oct. 1-3, 1973, pp. 207-217. + * 3) find all nodes with a predecessor dominated by the current node. + * such a node is a loop head. + * recursively, all preds with a greater rpo number are in the loop + */ +func postorder(r *Flow, rpo2r []*Flow, n int32) int32 { + r.Rpo = 1 + r1 := r.S1 + if r1 != nil && r1.Rpo == 0 { + n = postorder(r1, rpo2r, n) + } + r1 = r.S2 + if r1 != nil && r1.Rpo == 0 { + n = postorder(r1, rpo2r, n) + } + rpo2r[n] = r + n++ + return n +} + +func rpolca(idom []int32, rpo1 int32, rpo2 int32) int32 { + if rpo1 == -1 { + return rpo2 + } + var t int32 + for rpo1 != rpo2 { + if rpo1 > rpo2 { + t = rpo2 + rpo2 = rpo1 + rpo1 = t + } + + for rpo1 < rpo2 { + t = idom[rpo2] + if t >= rpo2 { + Fatal("bad idom") + } + rpo2 = t + } + } + + return rpo1 +} + +func doms(idom []int32, r int32, s int32) bool { + for s > r { + s = idom[s] + } + return s == r +} + +func loophead(idom []int32, r *Flow) bool { + src := r.Rpo + if r.P1 != nil && doms(idom, src, r.P1.Rpo) { + return true + } + for r = r.P2; r != nil; r = r.P2link { + if doms(idom, src, r.Rpo) { + return true + } + } + return false +} + +func loopmark(rpo2r **Flow, head int32, r *Flow) { + if r.Rpo < head || r.Active == head { + return + } + r.Active = head + r.Loop += LOOP + if r.P1 != nil { + loopmark(rpo2r, head, r.P1) + } + for r = r.P2; r != nil; r = r.P2link { + loopmark(rpo2r, head, r) + } +} + +func flowrpo(g *Graph) { + g.Rpo = make([]*Flow, g.Num) + idom := make([]int32, g.Num) + + for r1 := g.Start; r1 != nil; r1 = r1.Link { + r1.Active = 0 + } + + rpo2r := g.Rpo + d := postorder(g.Start, rpo2r, 0) + nr := int32(g.Num) + if d > nr { + Fatal("too many reg nodes %d %d", d, nr) + } + nr = d + var r1 *Flow + for i := int32(0); i < nr/2; i++ { + r1 = rpo2r[i] + rpo2r[i] = rpo2r[nr-1-i] + rpo2r[nr-1-i] = r1 + } + + for i := int32(0); i < nr; i++ { + rpo2r[i].Rpo = i + } + + idom[0] = 0 + var me int32 + for i := int32(0); i < nr; i++ { + r1 = rpo2r[i] + me = r1.Rpo + d = -1 + + // rpo2r[r->rpo] == r protects against considering dead code, + // which has r->rpo == 0. + if r1.P1 != nil && rpo2r[r1.P1.Rpo] == r1.P1 && r1.P1.Rpo < me { + d = r1.P1.Rpo + } + for r1 = r1.P2; r1 != nil; r1 = r1.P2link { + if rpo2r[r1.Rpo] == r1 && r1.Rpo < me { + d = rpolca(idom, d, r1.Rpo) + } + } + idom[i] = d + } + + for i := int32(0); i < nr; i++ { + r1 = rpo2r[i] + r1.Loop++ + if r1.P2 != nil && loophead(idom, r1) { + loopmark(&rpo2r[0], i, r1) + } + } + + for r1 := g.Start; r1 != nil; r1 = r1.Link { + r1.Active = 0 + } +} + +func Uniqp(r *Flow) *Flow { + r1 := r.P1 + if r1 == nil { + r1 = r.P2 + if r1 == nil || r1.P2link != nil { + return nil + } + } else if r.P2 != nil { + return nil + } + return r1 +} + +func Uniqs(r *Flow) *Flow { + r1 := r.S1 + if r1 == nil { + r1 = r.S2 + if r1 == nil { + return nil + } + } else if r.S2 != nil { + return nil + } + return r1 +} + +// The compilers assume they can generate temporary variables +// as needed to preserve the right semantics or simplify code +// generation and the back end will still generate good code. +// This results in a large number of ephemeral temporary variables. +// Merge temps with non-overlapping lifetimes and equal types using the +// greedy algorithm in Poletto and Sarkar, "Linear Scan Register Allocation", +// ACM TOPLAS 1999. + +type TempVar struct { + node *Node + def *Flow // definition of temp var + use *Flow // use list, chained through Flow.data + merge *TempVar // merge var with this one + start int64 // smallest Prog.pc in live range + end int64 // largest Prog.pc in live range + addr uint8 // address taken - no accurate end + removed uint8 // removed from program +} + +type startcmp []*TempVar + +func (x startcmp) Len() int { + return len(x) +} + +func (x startcmp) Swap(i, j int) { + x[i], x[j] = x[j], x[i] +} + +func (x startcmp) Less(i, j int) bool { + a := x[i] + b := x[j] + + if a.start < b.start { + return true + } + if a.start > b.start { + return false + } + + // Order what's left by id or symbol name, + // just so that sort is forced into a specific ordering, + // so that the result of the sort does not depend on + // the sort implementation. + if a.def != b.def { + return int(a.def.Id-b.def.Id) < 0 + } + if a.node != b.node { + return stringsCompare(a.node.Sym.Name, b.node.Sym.Name) < 0 + } + return false +} + +// Is n available for merging? +func canmerge(n *Node) bool { + return n.Class == PAUTO && strings.HasPrefix(n.Sym.Name, "autotmp") +} + +func mergetemp(firstp *obj.Prog) { + const ( + debugmerge = 0 + ) + + g := Flowstart(firstp, nil) + if g == nil { + return + } + + // Build list of all mergeable variables. + nvar := 0 + for l := Curfn.Func.Dcl; l != nil; l = l.Next { + if canmerge(l.N) { + nvar++ + } + } + + var_ := make([]TempVar, nvar) + nvar = 0 + var n *Node + var v *TempVar + for l := Curfn.Func.Dcl; l != nil; l = l.Next { + n = l.N + if canmerge(n) { + v = &var_[nvar] + nvar++ + n.SetOpt(v) + v.node = n + } + } + + // Build list of uses. + // We assume that the earliest reference to a temporary is its definition. + // This is not true of variables in general but our temporaries are all + // single-use (that's why we have so many!). + for f := g.Start; f != nil; f = f.Link { + p := f.Prog + if p.From.Node != nil && ((p.From.Node).(*Node)).Opt() != nil && p.To.Node != nil && ((p.To.Node).(*Node)).Opt() != nil { + Fatal("double node %v", p) + } + v = nil + n, _ = p.From.Node.(*Node) + if n != nil { + v, _ = n.Opt().(*TempVar) + } + if v == nil { + n, _ = p.To.Node.(*Node) + if n != nil { + v, _ = n.Opt().(*TempVar) + } + } + if v != nil { + if v.def == nil { + v.def = f + } + f.Data = v.use + v.use = f + if n == p.From.Node && (p.Info.Flags&LeftAddr != 0) { + v.addr = 1 + } + } + } + + if debugmerge > 1 && Debug['v'] != 0 { + Dumpit("before", g.Start, 0) + } + + nkill := 0 + + // Special case. + for i := 0; i < len(var_); i++ { + v = &var_[i] + if v.addr != 0 { + continue + } + + // Used in only one instruction, which had better be a write. + f := v.use + if f != nil && f.Data.(*Flow) == nil { + p := f.Prog + if p.To.Node == v.node && (p.Info.Flags&RightWrite != 0) && p.Info.Flags&RightRead == 0 { + p.As = obj.ANOP + p.To = obj.Addr{} + v.removed = 1 + if debugmerge > 0 && Debug['v'] != 0 { + fmt.Printf("drop write-only %v\n", v.node.Sym) + } + } else { + Fatal("temp used and not set: %v", p) + } + nkill++ + continue + } + + // Written in one instruction, read in the next, otherwise unused, + // no jumps to the next instruction. Happens mainly in 386 compiler. + f = v.use + if f != nil && f.Link == f.Data.(*Flow) && (f.Data.(*Flow)).Data.(*Flow) == nil && Uniqp(f.Link) == f { + p := f.Prog + p1 := f.Link.Prog + const ( + SizeAny = SizeB | SizeW | SizeL | SizeQ | SizeF | SizeD + ) + if p.From.Node == v.node && p1.To.Node == v.node && (p.Info.Flags&Move != 0) && (p.Info.Flags|p1.Info.Flags)&(LeftAddr|RightAddr) == 0 && p.Info.Flags&SizeAny == p1.Info.Flags&SizeAny { + p1.From = p.From + Thearch.Excise(f) + v.removed = 1 + if debugmerge > 0 && Debug['v'] != 0 { + fmt.Printf("drop immediate-use %v\n", v.node.Sym) + } + } + + nkill++ + continue + } + } + + // Traverse live range of each variable to set start, end. + // Each flood uses a new value of gen so that we don't have + // to clear all the r->active words after each variable. + gen := int32(0) + + for i := 0; i < len(var_); i++ { + v = &var_[i] + gen++ + for f := v.use; f != nil; f = f.Data.(*Flow) { + mergewalk(v, f, uint32(gen)) + } + if v.addr != 0 { + gen++ + for f := v.use; f != nil; f = f.Data.(*Flow) { + varkillwalk(v, f, uint32(gen)) + } + } + } + + // Sort variables by start. + bystart := make([]*TempVar, len(var_)) + + for i := 0; i < len(var_); i++ { + bystart[i] = &var_[i] + } + sort.Sort(startcmp(bystart[:len(var_)])) + + // List of in-use variables, sorted by end, so that the ones that + // will last the longest are the earliest ones in the array. + // The tail inuse[nfree:] holds no-longer-used variables. + // In theory we should use a sorted tree so that insertions are + // guaranteed O(log n) and then the loop is guaranteed O(n log n). + // In practice, it doesn't really matter. + inuse := make([]*TempVar, len(var_)) + + ninuse := 0 + nfree := len(var_) + var t *Type + var v1 *TempVar + var j int + for i := 0; i < len(var_); i++ { + v = bystart[i] + if debugmerge > 0 && Debug['v'] != 0 { + fmt.Printf("consider %v: removed=%d\n", Nconv(v.node, obj.FmtSharp), v.removed) + } + + if v.removed != 0 { + continue + } + + // Expire no longer in use. + for ninuse > 0 && inuse[ninuse-1].end < v.start { + ninuse-- + v1 = inuse[ninuse] + nfree-- + inuse[nfree] = v1 + } + + if debugmerge > 0 && Debug['v'] != 0 { + fmt.Printf("consider %v: removed=%d nfree=%d nvar=%d\n", Nconv(v.node, obj.FmtSharp), v.removed, nfree, len(var_)) + } + + // Find old temp to reuse if possible. + t = v.node.Type + + for j = nfree; j < len(var_); j++ { + v1 = inuse[j] + if debugmerge > 0 && Debug['v'] != 0 { + fmt.Printf("consider %v: maybe %v: type=%v,%v addrtaken=%v,%v\n", Nconv(v.node, obj.FmtSharp), Nconv(v1.node, obj.FmtSharp), t, v1.node.Type, v.node.Addrtaken, v1.node.Addrtaken) + } + + // Require the types to match but also require the addrtaken bits to match. + // If a variable's address is taken, that disables registerization for the individual + // words of the variable (for example, the base,len,cap of a slice). + // We don't want to merge a non-addressed var with an addressed one and + // inhibit registerization of the former. + if Eqtype(t, v1.node.Type) && v.node.Addrtaken == v1.node.Addrtaken { + inuse[j] = inuse[nfree] + nfree++ + if v1.merge != nil { + v.merge = v1.merge + } else { + v.merge = v1 + } + nkill++ + break + } + } + + // Sort v into inuse. + j = ninuse + ninuse++ + + for j > 0 && inuse[j-1].end < v.end { + inuse[j] = inuse[j-1] + j-- + } + + inuse[j] = v + } + + if debugmerge > 0 && Debug['v'] != 0 { + fmt.Printf("%v [%d - %d]\n", Curfn.Func.Nname.Sym, len(var_), nkill) + var v *TempVar + for i := 0; i < len(var_); i++ { + v = &var_[i] + fmt.Printf("var %v %v %d-%d", Nconv(v.node, obj.FmtSharp), v.node.Type, v.start, v.end) + if v.addr != 0 { + fmt.Printf(" addr=1") + } + if v.removed != 0 { + fmt.Printf(" dead=1") + } + if v.merge != nil { + fmt.Printf(" merge %v", Nconv(v.merge.node, obj.FmtSharp)) + } + if v.start == v.end && v.def != nil { + fmt.Printf(" %v", v.def.Prog) + } + fmt.Printf("\n") + } + + if debugmerge > 1 && Debug['v'] != 0 { + Dumpit("after", g.Start, 0) + } + } + + // Update node references to use merged temporaries. + for f := g.Start; f != nil; f = f.Link { + p := f.Prog + n, _ = p.From.Node.(*Node) + if n != nil { + v, _ = n.Opt().(*TempVar) + if v != nil && v.merge != nil { + p.From.Node = v.merge.node + } + } + n, _ = p.To.Node.(*Node) + if n != nil { + v, _ = n.Opt().(*TempVar) + if v != nil && v.merge != nil { + p.To.Node = v.merge.node + } + } + } + + // Delete merged nodes from declaration list. + var l *NodeList + for lp := &Curfn.Func.Dcl; ; { + l = *lp + if l == nil { + break + } + + Curfn.Func.Dcl.End = l + n = l.N + v, _ = n.Opt().(*TempVar) + if v != nil && (v.merge != nil || v.removed != 0) { + *lp = l.Next + continue + } + + lp = &l.Next + } + + // Clear aux structures. + for i := 0; i < len(var_); i++ { + var_[i].node.SetOpt(nil) + } + + Flowend(g) +} + +func mergewalk(v *TempVar, f0 *Flow, gen uint32) { + var p *obj.Prog + var f1 *Flow + + for f1 = f0; f1 != nil; f1 = f1.P1 { + if uint32(f1.Active) == gen { + break + } + f1.Active = int32(gen) + p = f1.Prog + if v.end < p.Pc { + v.end = p.Pc + } + if f1 == v.def { + v.start = p.Pc + break + } + } + + var f2 *Flow + for f := f0; f != f1; f = f.P1 { + for f2 = f.P2; f2 != nil; f2 = f2.P2link { + mergewalk(v, f2, gen) + } + } +} + +func varkillwalk(v *TempVar, f0 *Flow, gen uint32) { + var p *obj.Prog + var f1 *Flow + + for f1 = f0; f1 != nil; f1 = f1.S1 { + if uint32(f1.Active) == gen { + break + } + f1.Active = int32(gen) + p = f1.Prog + if v.end < p.Pc { + v.end = p.Pc + } + if v.start > p.Pc { + v.start = p.Pc + } + if p.As == obj.ARET || (p.As == obj.AVARKILL && p.To.Node == v.node) { + break + } + } + + for f := f0; f != f1; f = f.S1 { + varkillwalk(v, f.S2, gen) + } +} + +// Eliminate redundant nil pointer checks. +// +// The code generation pass emits a CHECKNIL for every possibly nil pointer. +// This pass removes a CHECKNIL if every predecessor path has already +// checked this value for nil. +// +// Simple backwards flood from check to definition. +// Run prog loop backward from end of program to beginning to avoid quadratic +// behavior removing a run of checks. +// +// Assume that stack variables with address not taken can be loaded multiple times +// from memory without being rechecked. Other variables need to be checked on +// each load. + +var killed int // f->data is either nil or &killed + +func nilopt(firstp *obj.Prog) { + g := Flowstart(firstp, nil) + if g == nil { + return + } + + if Debug_checknil > 1 { /* || strcmp(curfn->nname->sym->name, "f1") == 0 */ + Dumpit("nilopt", g.Start, 0) + } + + ncheck := 0 + nkill := 0 + var p *obj.Prog + for f := g.Start; f != nil; f = f.Link { + p = f.Prog + if p.As != obj.ACHECKNIL || !Thearch.Regtyp(&p.From) { + continue + } + ncheck++ + if Thearch.Stackaddr(&p.From) { + if Debug_checknil != 0 && p.Lineno > 1 { + Warnl(int(p.Lineno), "removed nil check of SP address") + } + f.Data = &killed + continue + } + + nilwalkfwd(f) + if f.Data != nil { + if Debug_checknil != 0 && p.Lineno > 1 { + Warnl(int(p.Lineno), "removed nil check before indirect") + } + continue + } + + nilwalkback(f) + if f.Data != nil { + if Debug_checknil != 0 && p.Lineno > 1 { + Warnl(int(p.Lineno), "removed repeated nil check") + } + continue + } + } + + for f := g.Start; f != nil; f = f.Link { + if f.Data != nil { + nkill++ + Thearch.Excise(f) + } + } + + Flowend(g) + + if Debug_checknil > 1 { + fmt.Printf("%v: removed %d of %d nil checks\n", Curfn.Func.Nname.Sym, nkill, ncheck) + } +} + +func nilwalkback(fcheck *Flow) { + for f := fcheck; f != nil; f = Uniqp(f) { + p := f.Prog + if (p.Info.Flags&RightWrite != 0) && Thearch.Sameaddr(&p.To, &fcheck.Prog.From) { + // Found initialization of value we're checking for nil. + // without first finding the check, so this one is unchecked. + return + } + + if f != fcheck && p.As == obj.ACHECKNIL && Thearch.Sameaddr(&p.From, &fcheck.Prog.From) { + fcheck.Data = &killed + return + } + } +} + +// Here is a more complex version that scans backward across branches. +// It assumes fcheck->kill = 1 has been set on entry, and its job is to find a reason +// to keep the check (setting fcheck->kill = 0). +// It doesn't handle copying of aggregates as well as I would like, +// nor variables with their address taken, +// and it's too subtle to turn on this late in Go 1.2. Perhaps for Go 1.3. +/* +for(f1 = f0; f1 != nil; f1 = f1->p1) { + if(f1->active == gen) + break; + f1->active = gen; + p = f1->prog; + + // If same check, stop this loop but still check + // alternate predecessors up to this point. + if(f1 != fcheck && p->as == ACHECKNIL && thearch.sameaddr(&p->from, &fcheck->prog->from)) + break; + + if((p.Info.flags & RightWrite) && thearch.sameaddr(&p->to, &fcheck->prog->from)) { + // Found initialization of value we're checking for nil. + // without first finding the check, so this one is unchecked. + fcheck->kill = 0; + return; + } + + if(f1->p1 == nil && f1->p2 == nil) { + print("lost pred for %v\n", fcheck->prog); + for(f1=f0; f1!=nil; f1=f1->p1) { + thearch.proginfo(&info, f1->prog); + print("\t%v %d %d %D %D\n", r1->prog, info.flags&RightWrite, thearch.sameaddr(&f1->prog->to, &fcheck->prog->from), &f1->prog->to, &fcheck->prog->from); + } + fatal("lost pred trail"); + } +} + +for(f = f0; f != f1; f = f->p1) + for(f2 = f->p2; f2 != nil; f2 = f2->p2link) + nilwalkback(fcheck, f2, gen); +*/ + +func nilwalkfwd(fcheck *Flow) { + // If the path down from rcheck dereferences the address + // (possibly with a small offset) before writing to memory + // and before any subsequent checks, it's okay to wait for + // that implicit check. Only consider this basic block to + // avoid problems like: + // _ = *x // should panic + // for {} // no writes but infinite loop may be considered visible + + var last *Flow + for f := Uniqs(fcheck); f != nil; f = Uniqs(f) { + p := f.Prog + if (p.Info.Flags&LeftRead != 0) && Thearch.Smallindir(&p.From, &fcheck.Prog.From) { + fcheck.Data = &killed + return + } + + if (p.Info.Flags&(RightRead|RightWrite) != 0) && Thearch.Smallindir(&p.To, &fcheck.Prog.From) { + fcheck.Data = &killed + return + } + + // Stop if another nil check happens. + if p.As == obj.ACHECKNIL { + return + } + + // Stop if value is lost. + if (p.Info.Flags&RightWrite != 0) && Thearch.Sameaddr(&p.To, &fcheck.Prog.From) { + return + } + + // Stop if memory write. + if (p.Info.Flags&RightWrite != 0) && !Thearch.Regtyp(&p.To) { + return + } + + // Stop if we jump backward. + if last != nil && f.Id <= last.Id { + return + } + last = f + } +} diff --git a/src/cmd/compile/internal/gc/racewalk.go b/src/cmd/compile/internal/gc/racewalk.go new file mode 100644 index 0000000000000000000000000000000000000000..f53e8ec9a57ec4395e09533d8b337e1f4e0b943e --- /dev/null +++ b/src/cmd/compile/internal/gc/racewalk.go @@ -0,0 +1,622 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package gc + +import ( + "fmt" + "strings" +) + +// The racewalk pass modifies the code tree for the function as follows: +// +// 1. It inserts a call to racefuncenter at the beginning of each function. +// 2. It inserts a call to racefuncexit at the end of each function. +// 3. It inserts a call to raceread before each memory read. +// 4. It inserts a call to racewrite before each memory write. +// +// The rewriting is not yet complete. Certain nodes are not rewritten +// but should be. + +// TODO(dvyukov): do not instrument initialization as writes: +// a := make([]int, 10) + +// Do not instrument the following packages at all, +// at best instrumentation would cause infinite recursion. +var omit_pkgs = []string{"runtime", "runtime/race"} + +// Only insert racefuncenter/racefuncexit into the following packages. +// Memory accesses in the packages are either uninteresting or will cause false positives. +var noinst_pkgs = []string{"sync", "sync/atomic"} + +func ispkgin(pkgs []string) bool { + if myimportpath != "" { + for i := 0; i < len(pkgs); i++ { + if myimportpath == pkgs[i] { + return true + } + } + } + + return false +} + +// TODO(rsc): Remove. Put //go:norace on forkAndExecInChild instead. +func isforkfunc(fn *Node) bool { + // Special case for syscall.forkAndExecInChild. + // In the child, this function must not acquire any locks, because + // they might have been locked at the time of the fork. This means + // no rescheduling, no malloc calls, and no new stack segments. + // Race instrumentation does all of the above. + return myimportpath != "" && myimportpath == "syscall" && fn.Func.Nname.Sym.Name == "forkAndExecInChild" +} + +func racewalk(fn *Node) { + if ispkgin(omit_pkgs) || isforkfunc(fn) || fn.Func.Norace { + return + } + + if !ispkgin(noinst_pkgs) { + racewalklist(fn.Nbody, nil) + + // nothing interesting for race detector in fn->enter + racewalklist(fn.Func.Exit, nil) + } + + // nodpc is the PC of the caller as extracted by + // getcallerpc. We use -widthptr(FP) for x86. + // BUG: this will not work on arm. + nodpc := Nod(OXXX, nil, nil) + + *nodpc = *nodfp + nodpc.Type = Types[TUINTPTR] + nodpc.Xoffset = int64(-Widthptr) + nd := mkcall("racefuncenter", nil, nil, nodpc) + fn.Func.Enter = concat(list1(nd), fn.Func.Enter) + nd = mkcall("racefuncexit", nil, nil) + fn.Func.Exit = list(fn.Func.Exit, nd) + + if Debug['W'] != 0 { + s := fmt.Sprintf("after racewalk %v", fn.Func.Nname.Sym) + dumplist(s, fn.Nbody) + s = fmt.Sprintf("enter %v", fn.Func.Nname.Sym) + dumplist(s, fn.Func.Enter) + s = fmt.Sprintf("exit %v", fn.Func.Nname.Sym) + dumplist(s, fn.Func.Exit) + } +} + +func racewalklist(l *NodeList, init **NodeList) { + var instr *NodeList + + for ; l != nil; l = l.Next { + instr = nil + racewalknode(&l.N, &instr, 0, 0) + if init == nil { + l.N.Ninit = concat(l.N.Ninit, instr) + } else { + *init = concat(*init, instr) + } + } +} + +// walkexpr and walkstmt combined +// walks the tree and adds calls to the +// instrumentation code to top-level (statement) nodes' init +func racewalknode(np **Node, init **NodeList, wr int, skip int) { + n := *np + + if n == nil { + return + } + + if Debug['w'] > 1 { + Dump("racewalk-before", n) + } + setlineno(n) + if init == nil { + Fatal("racewalk: bad init list") + } + if init == &n.Ninit { + // If init == &n->ninit and n->ninit is non-nil, + // racewalknode might append it to itself. + // nil it out and handle it separately before putting it back. + l := n.Ninit + + n.Ninit = nil + racewalklist(l, nil) + racewalknode(&n, &l, wr, skip) // recurse with nil n->ninit + appendinit(&n, l) + *np = n + return + } + + racewalklist(n.Ninit, nil) + + switch n.Op { + default: + Fatal("racewalk: unknown node type %v", Oconv(int(n.Op), 0)) + + case OAS, OASWB, OAS2FUNC: + racewalknode(&n.Left, init, 1, 0) + racewalknode(&n.Right, init, 0, 0) + goto ret + + // can't matter + case OCFUNC, OVARKILL: + goto ret + + case OBLOCK: + var out *NodeList + for l := n.List; l != nil; l = l.Next { + switch l.N.Op { + case OCALLFUNC, OCALLMETH, OCALLINTER: + racewalknode(&l.N, &out, 0, 0) + out = list(out, l.N) + // Scan past OAS nodes copying results off stack. + // Those must not be instrumented, because the + // instrumentation calls will smash the results. + // The assignments are to temporaries, so they cannot + // be involved in races and need not be instrumented. + for l.Next != nil && l.Next.N.Op == OAS && iscallret(l.Next.N.Right) { + l = l.Next + out = list(out, l.N) + } + default: + racewalknode(&l.N, &out, 0, 0) + out = list(out, l.N) + } + } + n.List = out + goto ret + + case ODEFER: + racewalknode(&n.Left, init, 0, 0) + goto ret + + case OPROC: + racewalknode(&n.Left, init, 0, 0) + goto ret + + case OCALLINTER: + racewalknode(&n.Left, init, 0, 0) + goto ret + + // Instrument dst argument of runtime.writebarrier* calls + // as we do not instrument runtime code. + // typedslicecopy is instrumented in runtime. + case OCALLFUNC: + racewalknode(&n.Left, init, 0, 0) + goto ret + + case ONOT, + OMINUS, + OPLUS, + OREAL, + OIMAG, + OCOM, + OSQRT: + racewalknode(&n.Left, init, wr, 0) + goto ret + + case ODOTINTER: + racewalknode(&n.Left, init, 0, 0) + goto ret + + case ODOT: + racewalknode(&n.Left, init, 0, 1) + callinstr(&n, init, wr, skip) + goto ret + + case ODOTPTR: // dst = (*x).f with implicit *; otherwise it's ODOT+OIND + racewalknode(&n.Left, init, 0, 0) + + callinstr(&n, init, wr, skip) + goto ret + + case OIND: // *p + racewalknode(&n.Left, init, 0, 0) + + callinstr(&n, init, wr, skip) + goto ret + + case OSPTR, OLEN, OCAP: + racewalknode(&n.Left, init, 0, 0) + if Istype(n.Left.Type, TMAP) { + n1 := Nod(OCONVNOP, n.Left, nil) + n1.Type = Ptrto(Types[TUINT8]) + n1 = Nod(OIND, n1, nil) + typecheck(&n1, Erv) + callinstr(&n1, init, 0, skip) + } + + goto ret + + case OLSH, + ORSH, + OLROT, + OAND, + OANDNOT, + OOR, + OXOR, + OSUB, + OMUL, + OHMUL, + OEQ, + ONE, + OLT, + OLE, + OGE, + OGT, + OADD, + OCOMPLEX: + racewalknode(&n.Left, init, wr, 0) + racewalknode(&n.Right, init, wr, 0) + goto ret + + case OANDAND, OOROR: + racewalknode(&n.Left, init, wr, 0) + + // walk has ensured the node has moved to a location where + // side effects are safe. + // n->right may not be executed, + // so instrumentation goes to n->right->ninit, not init. + racewalknode(&n.Right, &n.Right.Ninit, wr, 0) + + goto ret + + case ONAME: + callinstr(&n, init, wr, skip) + goto ret + + case OCONV: + racewalknode(&n.Left, init, wr, 0) + goto ret + + case OCONVNOP: + racewalknode(&n.Left, init, wr, 0) + goto ret + + case ODIV, OMOD: + racewalknode(&n.Left, init, wr, 0) + racewalknode(&n.Right, init, wr, 0) + goto ret + + case OINDEX: + if !Isfixedarray(n.Left.Type) { + racewalknode(&n.Left, init, 0, 0) + } else if !islvalue(n.Left) { + // index of unaddressable array, like Map[k][i]. + racewalknode(&n.Left, init, wr, 0) + + racewalknode(&n.Right, init, 0, 0) + goto ret + } + + racewalknode(&n.Right, init, 0, 0) + if n.Left.Type.Etype != TSTRING { + callinstr(&n, init, wr, skip) + } + goto ret + + case OSLICE, OSLICEARR, OSLICE3, OSLICE3ARR, OSLICESTR: + racewalknode(&n.Left, init, 0, 0) + racewalknode(&n.Right, init, 0, 0) + goto ret + + case OKEY: + racewalknode(&n.Left, init, 0, 0) + racewalknode(&n.Right, init, 0, 0) + goto ret + + case OADDR: + racewalknode(&n.Left, init, 0, 1) + goto ret + + // n->left is Type* which is not interesting. + case OEFACE: + racewalknode(&n.Right, init, 0, 0) + + goto ret + + case OITAB: + racewalknode(&n.Left, init, 0, 0) + goto ret + + // should not appear in AST by now + case OSEND, + ORECV, + OCLOSE, + ONEW, + OXCASE, + OXFALL, + OCASE, + OPANIC, + ORECOVER, + OCONVIFACE, + OCMPIFACE, + OMAKECHAN, + OMAKEMAP, + OMAKESLICE, + OCALL, + OCOPY, + OAPPEND, + ORUNESTR, + OARRAYBYTESTR, + OARRAYRUNESTR, + OSTRARRAYBYTE, + OSTRARRAYRUNE, + OINDEXMAP, + // lowered to call + OCMPSTR, + OADDSTR, + ODOTTYPE, + ODOTTYPE2, + OAS2DOTTYPE, + OCALLPART, + // lowered to PTRLIT + OCLOSURE, // lowered to PTRLIT + ORANGE, // lowered to ordinary for loop + OARRAYLIT, // lowered to assignments + OMAPLIT, + OSTRUCTLIT, + OAS2, + OAS2RECV, + OAS2MAPR, + OASOP: + Yyerror("racewalk: %v must be lowered by now", Oconv(int(n.Op), 0)) + + goto ret + + // impossible nodes: only appear in backend. + case ORROTC, OEXTEND: + Yyerror("racewalk: %v cannot exist now", Oconv(int(n.Op), 0)) + goto ret + + case OGETG: + Yyerror("racewalk: OGETG can happen only in runtime which we don't instrument") + goto ret + + case OFOR: + if n.Left != nil { + racewalknode(&n.Left, &n.Left.Ninit, 0, 0) + } + if n.Right != nil { + racewalknode(&n.Right, &n.Right.Ninit, 0, 0) + } + goto ret + + case OIF, OSWITCH: + if n.Left != nil { + racewalknode(&n.Left, &n.Left.Ninit, 0, 0) + } + goto ret + + // just do generic traversal + case OCALLMETH, + ORETURN, + ORETJMP, + OSELECT, + OEMPTY, + OBREAK, + OCONTINUE, + OFALL, + OGOTO, + OLABEL: + goto ret + + // does not require instrumentation + case OPRINT, // don't bother instrumenting it + OPRINTN, // don't bother instrumenting it + OCHECKNIL, // always followed by a read. + OPARAM, // it appears only in fn->exit to copy heap params back + OCLOSUREVAR, // immutable pointer to captured variable + ODOTMETH, // either part of CALLMETH or CALLPART (lowered to PTRLIT) + OINDREG, // at this stage, only n(SP) nodes from nodarg + ODCL, // declarations (without value) cannot be races + ODCLCONST, + ODCLTYPE, + OTYPE, + ONONAME, + OLITERAL, + OTYPESW: // ignored by code generation, do not instrument. + goto ret + } + +ret: + if n.Op != OBLOCK { // OBLOCK is handled above in a special way. + racewalklist(n.List, init) + } + racewalklist(n.Nbody, nil) + racewalklist(n.Rlist, nil) + *np = n +} + +func isartificial(n *Node) bool { + // compiler-emitted artificial things that we do not want to instrument, + // cant' possibly participate in a data race. + if n.Op == ONAME && n.Sym != nil && n.Sym.Name != "" { + if n.Sym.Name == "_" { + return true + } + + // autotmp's are always local + if strings.HasPrefix(n.Sym.Name, "autotmp_") { + return true + } + + // statictmp's are read-only + if strings.HasPrefix(n.Sym.Name, "statictmp_") { + return true + } + + // go.itab is accessed only by the compiler and runtime (assume safe) + if n.Sym.Pkg != nil && n.Sym.Pkg.Name != "" && n.Sym.Pkg.Name == "go.itab" { + return true + } + } + + return false +} + +func callinstr(np **Node, init **NodeList, wr int, skip int) bool { + n := *np + + //print("callinstr for %+N [ %O ] etype=%E class=%d\n", + // n, n->op, n->type ? n->type->etype : -1, n->class); + + if skip != 0 || n.Type == nil || n.Type.Etype >= TIDEAL { + return false + } + t := n.Type + if isartificial(n) { + return false + } + + b := outervalue(n) + + // it skips e.g. stores to ... parameter array + if isartificial(b) { + return false + } + class := b.Class + + // BUG: we _may_ want to instrument PAUTO sometimes + // e.g. if we've got a local variable/method receiver + // that has got a pointer inside. Whether it points to + // the heap or not is impossible to know at compile time + if (class&PHEAP != 0) || class == PPARAMREF || class == PEXTERN || b.Op == OINDEX || b.Op == ODOTPTR || b.Op == OIND { + hascalls := 0 + foreach(n, hascallspred, &hascalls) + if hascalls != 0 { + n = detachexpr(n, init) + *np = n + } + + n = treecopy(n, 0) + makeaddable(n) + var f *Node + if t.Etype == TSTRUCT || Isfixedarray(t) { + name := "racereadrange" + if wr != 0 { + name = "racewriterange" + } + f = mkcall(name, nil, init, uintptraddr(n), Nodintconst(t.Width)) + } else { + name := "raceread" + if wr != 0 { + name = "racewrite" + } + f = mkcall(name, nil, init, uintptraddr(n)) + } + + *init = list(*init, f) + return true + } + + return false +} + +// makeaddable returns a node whose memory location is the +// same as n, but which is addressable in the Go language +// sense. +// This is different from functions like cheapexpr that may make +// a copy of their argument. +func makeaddable(n *Node) { + // The arguments to uintptraddr technically have an address but + // may not be addressable in the Go sense: for example, in the case + // of T(v).Field where T is a struct type and v is + // an addressable value. + switch n.Op { + case OINDEX: + if Isfixedarray(n.Left.Type) { + makeaddable(n.Left) + } + + // Turn T(v).Field into v.Field + case ODOT, OXDOT: + if n.Left.Op == OCONVNOP { + n.Left = n.Left.Left + } + makeaddable(n.Left) + + // nothing to do + case ODOTPTR: + fallthrough + default: + break + } +} + +func uintptraddr(n *Node) *Node { + r := Nod(OADDR, n, nil) + r.Bounded = true + r = conv(r, Types[TUNSAFEPTR]) + r = conv(r, Types[TUINTPTR]) + return r +} + +func detachexpr(n *Node, init **NodeList) *Node { + addr := Nod(OADDR, n, nil) + l := temp(Ptrto(n.Type)) + as := Nod(OAS, l, addr) + typecheck(&as, Etop) + walkexpr(&as, init) + *init = list(*init, as) + ind := Nod(OIND, l, nil) + typecheck(&ind, Erv) + walkexpr(&ind, init) + return ind +} + +func foreachnode(n *Node, f func(*Node, interface{}), c interface{}) { + if n != nil { + f(n, c) + } +} + +func foreachlist(l *NodeList, f func(*Node, interface{}), c interface{}) { + for ; l != nil; l = l.Next { + foreachnode(l.N, f, c) + } +} + +func foreach(n *Node, f func(*Node, interface{}), c interface{}) { + foreachlist(n.Ninit, f, c) + foreachnode(n.Left, f, c) + foreachnode(n.Right, f, c) + foreachlist(n.List, f, c) + foreachlist(n.Nbody, f, c) + foreachlist(n.Rlist, f, c) +} + +func hascallspred(n *Node, c interface{}) { + switch n.Op { + case OCALL, OCALLFUNC, OCALLMETH, OCALLINTER: + (*c.(*int))++ + } +} + +// appendinit is like addinit in subr.go +// but appends rather than prepends. +func appendinit(np **Node, init *NodeList) { + if init == nil { + return + } + + n := *np + switch n.Op { + // There may be multiple refs to this node; + // introduce OCONVNOP to hold init list. + case ONAME, OLITERAL: + n = Nod(OCONVNOP, n, nil) + + n.Type = n.Left.Type + n.Typecheck = 1 + *np = n + } + + n.Ninit = concat(n.Ninit, init) + n.Ullman = UINF +} diff --git a/src/cmd/compile/internal/gc/range.go b/src/cmd/compile/internal/gc/range.go new file mode 100644 index 0000000000000000000000000000000000000000..26f05d9d70b89bf5c30f57d63a4a62f7785d9120 --- /dev/null +++ b/src/cmd/compile/internal/gc/range.go @@ -0,0 +1,406 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package gc + +import "cmd/internal/obj" + +/* + * range + */ +func typecheckrange(n *Node) { + var toomany int + var why string + var t1 *Type + var t2 *Type + var v1 *Node + var v2 *Node + + // Typechecking order is important here: + // 0. first typecheck range expression (slice/map/chan), + // it is evaluated only once and so logically it is not part of the loop. + // 1. typcheck produced values, + // this part can declare new vars and so it must be typechecked before body, + // because body can contain a closure that captures the vars. + // 2. decldepth++ to denote loop body. + // 3. typecheck body. + // 4. decldepth--. + + typecheck(&n.Right, Erv) + + t := n.Right.Type + if t == nil { + goto out + } + + // delicate little dance. see typecheckas2 + for ll := n.List; ll != nil; ll = ll.Next { + if ll.N.Name == nil || ll.N.Name.Defn != n { + typecheck(&ll.N, Erv|Easgn) + } + } + + if Isptr[t.Etype] && Isfixedarray(t.Type) { + t = t.Type + } + n.Type = t + + toomany = 0 + switch t.Etype { + default: + Yyerror("cannot range over %v", Nconv(n.Right, obj.FmtLong)) + goto out + + case TARRAY: + t1 = Types[TINT] + t2 = t.Type + + case TMAP: + t1 = t.Down + t2 = t.Type + + case TCHAN: + if t.Chan&Crecv == 0 { + Yyerror("invalid operation: range %v (receive from send-only type %v)", n.Right, n.Right.Type) + goto out + } + + t1 = t.Type + t2 = nil + if count(n.List) == 2 { + toomany = 1 + } + + case TSTRING: + t1 = Types[TINT] + t2 = runetype + } + + if count(n.List) > 2 || toomany != 0 { + Yyerror("too many variables in range") + } + + v1 = nil + if n.List != nil { + v1 = n.List.N + } + v2 = nil + if n.List != nil && n.List.Next != nil { + v2 = n.List.Next.N + } + + // this is not only a optimization but also a requirement in the spec. + // "if the second iteration variable is the blank identifier, the range + // clause is equivalent to the same clause with only the first variable + // present." + if isblank(v2) { + if v1 != nil { + n.List = list1(v1) + } + v2 = nil + } + + if v1 != nil { + if v1.Name != nil && v1.Name.Defn == n { + v1.Type = t1 + } else if v1.Type != nil && assignop(t1, v1.Type, &why) == 0 { + Yyerror("cannot assign type %v to %v in range%s", t1, Nconv(v1, obj.FmtLong), why) + } + checkassign(n, v1) + } + + if v2 != nil { + if v2.Name != nil && v2.Name.Defn == n { + v2.Type = t2 + } else if v2.Type != nil && assignop(t2, v2.Type, &why) == 0 { + Yyerror("cannot assign type %v to %v in range%s", t2, Nconv(v2, obj.FmtLong), why) + } + checkassign(n, v2) + } + + // second half of dance +out: + n.Typecheck = 1 + + for ll := n.List; ll != nil; ll = ll.Next { + if ll.N.Typecheck == 0 { + typecheck(&ll.N, Erv|Easgn) + } + } + + decldepth++ + typechecklist(n.Nbody, Etop) + decldepth-- +} + +func walkrange(n *Node) { + // variable name conventions: + // ohv1, hv1, hv2: hidden (old) val 1, 2 + // ha, hit: hidden aggregate, iterator + // hn, hp: hidden len, pointer + // hb: hidden bool + // a, v1, v2: not hidden aggregate, val 1, 2 + + t := n.Type + + a := n.Right + lno := int(setlineno(a)) + n.Right = nil + + var v1 *Node + if n.List != nil { + v1 = n.List.N + } + var v2 *Node + if n.List != nil && n.List.Next != nil && !isblank(n.List.Next.N) { + v2 = n.List.Next.N + } + + // n->list has no meaning anymore, clear it + // to avoid erroneous processing by racewalk. + n.List = nil + + var body *NodeList + var init *NodeList + switch t.Etype { + default: + Fatal("walkrange") + + // Lower n into runtime·memclr if possible, for + // fast zeroing of slices and arrays (issue 5373). + // Look for instances of + // + // for i := range a { + // a[i] = zero + // } + // + // in which the evaluation of a is side-effect-free. + case TARRAY: + if Debug['N'] == 0 { + if flag_race == 0 { + if v1 != nil { + if v2 == nil { + if n.Nbody != nil { + if n.Nbody.N != nil { // at least one statement in body + if n.Nbody.Next == nil { // at most one statement in body + tmp := n.Nbody.N // first statement of body + if tmp.Op == OAS { + if tmp.Left.Op == OINDEX { + if samesafeexpr(tmp.Left.Left, a) { + if samesafeexpr(tmp.Left.Right, v1) { + if t.Type.Width > 0 { + if iszero(tmp.Right) { + // Convert to + // if len(a) != 0 { + // hp = &a[0] + // hn = len(a)*sizeof(elem(a)) + // memclr(hp, hn) + // i = len(a) - 1 + // } + n.Op = OIF + + n.Nbody = nil + n.Left = Nod(ONE, Nod(OLEN, a, nil), Nodintconst(0)) + + // hp = &a[0] + hp := temp(Ptrto(Types[TUINT8])) + + tmp := Nod(OINDEX, a, Nodintconst(0)) + tmp.Bounded = true + tmp = Nod(OADDR, tmp, nil) + tmp = Nod(OCONVNOP, tmp, nil) + tmp.Type = Ptrto(Types[TUINT8]) + n.Nbody = list(n.Nbody, Nod(OAS, hp, tmp)) + + // hn = len(a) * sizeof(elem(a)) + hn := temp(Types[TUINTPTR]) + + tmp = Nod(OLEN, a, nil) + tmp = Nod(OMUL, tmp, Nodintconst(t.Type.Width)) + tmp = conv(tmp, Types[TUINTPTR]) + n.Nbody = list(n.Nbody, Nod(OAS, hn, tmp)) + + // memclr(hp, hn) + fn := mkcall("memclr", nil, nil, hp, hn) + + n.Nbody = list(n.Nbody, fn) + + // i = len(a) - 1 + v1 = Nod(OAS, v1, Nod(OSUB, Nod(OLEN, a, nil), Nodintconst(1))) + + n.Nbody = list(n.Nbody, v1) + + typecheck(&n.Left, Erv) + typechecklist(n.Nbody, Etop) + walkstmt(&n) + lineno = int32(lno) + return + } + } + } + } + } + } + } + } + } + } + } + } + } + + // orderstmt arranged for a copy of the array/slice variable if needed. + ha := a + + hv1 := temp(Types[TINT]) + hn := temp(Types[TINT]) + var hp *Node + + init = list(init, Nod(OAS, hv1, nil)) + init = list(init, Nod(OAS, hn, Nod(OLEN, ha, nil))) + if v2 != nil { + hp = temp(Ptrto(n.Type.Type)) + tmp := Nod(OINDEX, ha, Nodintconst(0)) + tmp.Bounded = true + init = list(init, Nod(OAS, hp, Nod(OADDR, tmp, nil))) + } + + n.Left = Nod(OLT, hv1, hn) + n.Right = Nod(OAS, hv1, Nod(OADD, hv1, Nodintconst(1))) + if v1 == nil { + body = nil + } else if v2 == nil { + body = list1(Nod(OAS, v1, hv1)) + } else { + a := Nod(OAS2, nil, nil) + a.List = list(list1(v1), v2) + a.Rlist = list(list1(hv1), Nod(OIND, hp, nil)) + body = list1(a) + + // Advance pointer as part of increment. + // We used to advance the pointer before executing the loop body, + // but doing so would make the pointer point past the end of the + // array during the final iteration, possibly causing another unrelated + // piece of memory not to be garbage collected until the loop finished. + // Advancing during the increment ensures that the pointer p only points + // pass the end of the array during the final "p++; i++; if(i >= len(x)) break;", + // after which p is dead, so it cannot confuse the collector. + tmp := Nod(OADD, hp, Nodintconst(t.Type.Width)) + + tmp.Type = hp.Type + tmp.Typecheck = 1 + tmp.Right.Type = Types[Tptr] + tmp.Right.Typecheck = 1 + a = Nod(OAS, hp, tmp) + typecheck(&a, Etop) + n.Right.Ninit = list1(a) + } + + // orderstmt allocated the iterator for us. + // we only use a once, so no copy needed. + case TMAP: + ha := a + + th := hiter(t) + hit := prealloc[n] + hit.Type = th + n.Left = nil + keyname := newname(th.Type.Sym) // depends on layout of iterator struct. See reflect.go:hiter + valname := newname(th.Type.Down.Sym) // ditto + + fn := syslook("mapiterinit", 1) + + substArgTypes(fn, t.Down, t.Type, th) + init = list(init, mkcall1(fn, nil, nil, typename(t), ha, Nod(OADDR, hit, nil))) + n.Left = Nod(ONE, Nod(ODOT, hit, keyname), nodnil()) + + fn = syslook("mapiternext", 1) + substArgTypes(fn, th) + n.Right = mkcall1(fn, nil, nil, Nod(OADDR, hit, nil)) + + key := Nod(ODOT, hit, keyname) + key = Nod(OIND, key, nil) + if v1 == nil { + body = nil + } else if v2 == nil { + body = list1(Nod(OAS, v1, key)) + } else { + val := Nod(ODOT, hit, valname) + val = Nod(OIND, val, nil) + a := Nod(OAS2, nil, nil) + a.List = list(list1(v1), v2) + a.Rlist = list(list1(key), val) + body = list1(a) + } + + // orderstmt arranged for a copy of the channel variable. + case TCHAN: + ha := a + + n.Left = nil + + hv1 := temp(t.Type) + hv1.Typecheck = 1 + if haspointers(t.Type) { + init = list(init, Nod(OAS, hv1, nil)) + } + hb := temp(Types[TBOOL]) + + n.Left = Nod(ONE, hb, Nodbool(false)) + a := Nod(OAS2RECV, nil, nil) + a.Typecheck = 1 + a.List = list(list1(hv1), hb) + a.Rlist = list1(Nod(ORECV, ha, nil)) + n.Left.Ninit = list1(a) + if v1 == nil { + body = nil + } else { + body = list1(Nod(OAS, v1, hv1)) + } + + // orderstmt arranged for a copy of the string variable. + case TSTRING: + ha := a + + ohv1 := temp(Types[TINT]) + + hv1 := temp(Types[TINT]) + init = list(init, Nod(OAS, hv1, nil)) + + var a *Node + var hv2 *Node + if v2 == nil { + a = Nod(OAS, hv1, mkcall("stringiter", Types[TINT], nil, ha, hv1)) + } else { + hv2 = temp(runetype) + a = Nod(OAS2, nil, nil) + a.List = list(list1(hv1), hv2) + fn := syslook("stringiter2", 0) + a.Rlist = list1(mkcall1(fn, getoutargx(fn.Type), nil, ha, hv1)) + } + + n.Left = Nod(ONE, hv1, Nodintconst(0)) + n.Left.Ninit = list(list1(Nod(OAS, ohv1, hv1)), a) + + body = nil + if v1 != nil { + body = list1(Nod(OAS, v1, ohv1)) + } + if v2 != nil { + body = list(body, Nod(OAS, v2, hv2)) + } + } + + n.Op = OFOR + typechecklist(init, Etop) + n.Ninit = concat(n.Ninit, init) + typechecklist(n.Left.Ninit, Etop) + typecheck(&n.Left, Erv) + typecheck(&n.Right, Etop) + typechecklist(body, Etop) + n.Nbody = concat(body, n.Nbody) + walkstmt(&n) + + lineno = int32(lno) +} diff --git a/src/cmd/compile/internal/gc/reflect.go b/src/cmd/compile/internal/gc/reflect.go new file mode 100644 index 0000000000000000000000000000000000000000..1ac4a03d32f1e2da02e8679f2d2c439c154152c4 --- /dev/null +++ b/src/cmd/compile/internal/gc/reflect.go @@ -0,0 +1,1607 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package gc + +import ( + "cmd/internal/gcprog" + "cmd/internal/obj" + "fmt" + "os" +) + +/* + * runtime interface and reflection data structures + */ +var signatlist *NodeList + +func sigcmp(a *Sig, b *Sig) int { + i := stringsCompare(a.name, b.name) + if i != 0 { + return i + } + if a.pkg == b.pkg { + return 0 + } + if a.pkg == nil { + return -1 + } + if b.pkg == nil { + return +1 + } + return stringsCompare(a.pkg.Path, b.pkg.Path) +} + +func lsort(l *Sig, f func(*Sig, *Sig) int) *Sig { + if l == nil || l.link == nil { + return l + } + + l1 := l + l2 := l + for { + l2 = l2.link + if l2 == nil { + break + } + l2 = l2.link + if l2 == nil { + break + } + l1 = l1.link + } + + l2 = l1.link + l1.link = nil + l1 = lsort(l, f) + l2 = lsort(l2, f) + + /* set up lead element */ + if f(l1, l2) < 0 { + l = l1 + l1 = l1.link + } else { + l = l2 + l2 = l2.link + } + + le := l + + for { + if l1 == nil { + for l2 != nil { + le.link = l2 + le = l2 + l2 = l2.link + } + + le.link = nil + break + } + + if l2 == nil { + for l1 != nil { + le.link = l1 + le = l1 + l1 = l1.link + } + + break + } + + if f(l1, l2) < 0 { + le.link = l1 + le = l1 + l1 = l1.link + } else { + le.link = l2 + le = l2 + l2 = l2.link + } + } + + le.link = nil + return l +} + +// Builds a type representing a Bucket structure for +// the given map type. This type is not visible to users - +// we include only enough information to generate a correct GC +// program for it. +// Make sure this stays in sync with ../../runtime/hashmap.go! +const ( + BUCKETSIZE = 8 + MAXKEYSIZE = 128 + MAXVALSIZE = 128 +) + +func makefield(name string, t *Type) *Type { + f := typ(TFIELD) + f.Type = t + f.Sym = new(Sym) + f.Sym.Name = name + return f +} + +func mapbucket(t *Type) *Type { + if t.Bucket != nil { + return t.Bucket + } + + bucket := typ(TSTRUCT) + keytype := t.Down + valtype := t.Type + dowidth(keytype) + dowidth(valtype) + if keytype.Width > MAXKEYSIZE { + keytype = Ptrto(keytype) + } + if valtype.Width > MAXVALSIZE { + valtype = Ptrto(valtype) + } + + // The first field is: uint8 topbits[BUCKETSIZE]. + arr := typ(TARRAY) + + arr.Type = Types[TUINT8] + arr.Bound = BUCKETSIZE + field := make([]*Type, 0, 5) + field = append(field, makefield("topbits", arr)) + arr = typ(TARRAY) + arr.Type = keytype + arr.Bound = BUCKETSIZE + field = append(field, makefield("keys", arr)) + arr = typ(TARRAY) + arr.Type = valtype + arr.Bound = BUCKETSIZE + field = append(field, makefield("values", arr)) + + // Make sure the overflow pointer is the last memory in the struct, + // because the runtime assumes it can use size-ptrSize as the + // offset of the overflow pointer. We double-check that property + // below once the offsets and size are computed. + // + // BUCKETSIZE is 8, so the struct is aligned to 64 bits to this point. + // On 32-bit systems, the max alignment is 32-bit, and the + // overflow pointer will add another 32-bit field, and the struct + // will end with no padding. + // On 64-bit systems, the max alignment is 64-bit, and the + // overflow pointer will add another 64-bit field, and the struct + // will end with no padding. + // On nacl/amd64p32, however, the max alignment is 64-bit, + // but the overflow pointer will add only a 32-bit field, + // so if the struct needs 64-bit padding (because a key or value does) + // then it would end with an extra 32-bit padding field. + // Preempt that by emitting the padding here. + if int(t.Type.Align) > Widthptr || int(t.Down.Align) > Widthptr { + field = append(field, makefield("pad", Types[TUINTPTR])) + } + + // If keys and values have no pointers, the map implementation + // can keep a list of overflow pointers on the side so that + // buckets can be marked as having no pointers. + // Arrange for the bucket to have no pointers by changing + // the type of the overflow field to uintptr in this case. + // See comment on hmap.overflow in ../../../../runtime/hashmap.go. + otyp := Ptrto(bucket) + if !haspointers(t.Type) && !haspointers(t.Down) && t.Type.Width <= MAXKEYSIZE && t.Down.Width <= MAXVALSIZE { + otyp = Types[TUINTPTR] + } + ovf := makefield("overflow", otyp) + field = append(field, ovf) + + // link up fields + bucket.Noalg = 1 + bucket.Local = t.Local + bucket.Type = field[0] + for n := int32(0); n < int32(len(field)-1); n++ { + field[n].Down = field[n+1] + } + field[len(field)-1].Down = nil + dowidth(bucket) + + // Double-check that overflow field is final memory in struct, + // with no padding at end. See comment above. + if ovf.Width != bucket.Width-int64(Widthptr) { + Yyerror("bad math in mapbucket for %v", t) + } + + t.Bucket = bucket + + bucket.Map = t + return bucket +} + +// Builds a type representing a Hmap structure for the given map type. +// Make sure this stays in sync with ../../runtime/hashmap.go! +func hmap(t *Type) *Type { + if t.Hmap != nil { + return t.Hmap + } + + bucket := mapbucket(t) + var field [8]*Type + field[0] = makefield("count", Types[TINT]) + field[1] = makefield("flags", Types[TUINT8]) + field[2] = makefield("B", Types[TUINT8]) + field[3] = makefield("hash0", Types[TUINT32]) + field[4] = makefield("buckets", Ptrto(bucket)) + field[5] = makefield("oldbuckets", Ptrto(bucket)) + field[6] = makefield("nevacuate", Types[TUINTPTR]) + field[7] = makefield("overflow", Types[TUNSAFEPTR]) + + h := typ(TSTRUCT) + h.Noalg = 1 + h.Local = t.Local + h.Type = field[0] + for n := int32(0); n < int32(len(field)-1); n++ { + field[n].Down = field[n+1] + } + field[len(field)-1].Down = nil + dowidth(h) + t.Hmap = h + h.Map = t + return h +} + +func hiter(t *Type) *Type { + if t.Hiter != nil { + return t.Hiter + } + + // build a struct: + // hash_iter { + // key *Key + // val *Value + // t *MapType + // h *Hmap + // buckets *Bucket + // bptr *Bucket + // overflow0 unsafe.Pointer + // overflow1 unsafe.Pointer + // startBucket uintptr + // stuff uintptr + // bucket uintptr + // checkBucket uintptr + // } + // must match ../../runtime/hashmap.go:hash_iter. + var field [12]*Type + field[0] = makefield("key", Ptrto(t.Down)) + + field[1] = makefield("val", Ptrto(t.Type)) + field[2] = makefield("t", Ptrto(Types[TUINT8])) + field[3] = makefield("h", Ptrto(hmap(t))) + field[4] = makefield("buckets", Ptrto(mapbucket(t))) + field[5] = makefield("bptr", Ptrto(mapbucket(t))) + field[6] = makefield("overflow0", Types[TUNSAFEPTR]) + field[7] = makefield("overflow1", Types[TUNSAFEPTR]) + field[8] = makefield("startBucket", Types[TUINTPTR]) + field[9] = makefield("stuff", Types[TUINTPTR]) // offset+wrapped+B+I + field[10] = makefield("bucket", Types[TUINTPTR]) + field[11] = makefield("checkBucket", Types[TUINTPTR]) + + // build iterator struct holding the above fields + i := typ(TSTRUCT) + + i.Noalg = 1 + i.Type = field[0] + for n := int32(0); n < int32(len(field)-1); n++ { + field[n].Down = field[n+1] + } + field[len(field)-1].Down = nil + dowidth(i) + if i.Width != int64(12*Widthptr) { + Yyerror("hash_iter size not correct %d %d", i.Width, 12*Widthptr) + } + t.Hiter = i + i.Map = t + return i +} + +/* + * f is method type, with receiver. + * return function type, receiver as first argument (or not). + */ +func methodfunc(f *Type, receiver *Type) *Type { + var in *NodeList + if receiver != nil { + d := Nod(ODCLFIELD, nil, nil) + d.Type = receiver + in = list(in, d) + } + + var d *Node + for t := getinargx(f).Type; t != nil; t = t.Down { + d = Nod(ODCLFIELD, nil, nil) + d.Type = t.Type + d.Isddd = t.Isddd + in = list(in, d) + } + + var out *NodeList + for t := getoutargx(f).Type; t != nil; t = t.Down { + d = Nod(ODCLFIELD, nil, nil) + d.Type = t.Type + out = list(out, d) + } + + t := functype(nil, in, out) + if f.Nname != nil { + // Link to name of original method function. + t.Nname = f.Nname + } + + return t +} + +/* + * return methods of non-interface type t, sorted by name. + * generates stub functions as needed. + */ +func methods(t *Type) *Sig { + // method type + mt := methtype(t, 0) + + if mt == nil { + return nil + } + expandmeth(mt) + + // type stored in interface word + it := t + + if !isdirectiface(it) { + it = Ptrto(t) + } + + // make list of methods for t, + // generating code if necessary. + var a *Sig + + var this *Type + var b *Sig + var method *Sym + for f := mt.Xmethod; f != nil; f = f.Down { + if f.Etype != TFIELD { + Fatal("methods: not field %v", f) + } + if f.Type.Etype != TFUNC || f.Type.Thistuple == 0 { + Fatal("non-method on %v method %v %v\n", mt, f.Sym, f) + } + if getthisx(f.Type).Type == nil { + Fatal("receiver with no type on %v method %v %v\n", mt, f.Sym, f) + } + if f.Nointerface { + continue + } + + method = f.Sym + if method == nil { + continue + } + + // get receiver type for this particular method. + // if pointer receiver but non-pointer t and + // this is not an embedded pointer inside a struct, + // method does not apply. + this = getthisx(f.Type).Type.Type + + if Isptr[this.Etype] && this.Type == t { + continue + } + if Isptr[this.Etype] && !Isptr[t.Etype] && f.Embedded != 2 && !isifacemethod(f.Type) { + continue + } + + b = new(Sig) + b.link = a + a = b + + a.name = method.Name + if !exportname(method.Name) { + if method.Pkg == nil { + Fatal("methods: missing package") + } + a.pkg = method.Pkg + } + + a.isym = methodsym(method, it, 1) + a.tsym = methodsym(method, t, 0) + a.type_ = methodfunc(f.Type, t) + a.mtype = methodfunc(f.Type, nil) + + if a.isym.Flags&SymSiggen == 0 { + a.isym.Flags |= SymSiggen + if !Eqtype(this, it) || this.Width < Types[Tptr].Width { + compiling_wrappers = 1 + genwrapper(it, f, a.isym, 1) + compiling_wrappers = 0 + } + } + + if a.tsym.Flags&SymSiggen == 0 { + a.tsym.Flags |= SymSiggen + if !Eqtype(this, t) { + compiling_wrappers = 1 + genwrapper(t, f, a.tsym, 0) + compiling_wrappers = 0 + } + } + } + + return lsort(a, sigcmp) +} + +/* + * return methods of interface type t, sorted by name. + */ +func imethods(t *Type) *Sig { + var a *Sig + var method *Sym + var isym *Sym + + var all *Sig + var last *Sig + for f := t.Type; f != nil; f = f.Down { + if f.Etype != TFIELD { + Fatal("imethods: not field") + } + if f.Type.Etype != TFUNC || f.Sym == nil { + continue + } + method = f.Sym + a = new(Sig) + a.name = method.Name + if !exportname(method.Name) { + if method.Pkg == nil { + Fatal("imethods: missing package") + } + a.pkg = method.Pkg + } + + a.mtype = f.Type + a.offset = 0 + a.type_ = methodfunc(f.Type, nil) + + if last != nil && sigcmp(last, a) >= 0 { + Fatal("sigcmp vs sortinter %s %s", last.name, a.name) + } + if last == nil { + all = a + } else { + last.link = a + } + last = a + + // Compiler can only refer to wrappers for non-blank methods. + if isblanksym(method) { + continue + } + + // NOTE(rsc): Perhaps an oversight that + // IfaceType.Method is not in the reflect data. + // Generate the method body, so that compiled + // code can refer to it. + isym = methodsym(method, t, 0) + + if isym.Flags&SymSiggen == 0 { + isym.Flags |= SymSiggen + genwrapper(t, f, isym, 0) + } + } + + return all +} + +var dimportpath_gopkg *Pkg + +func dimportpath(p *Pkg) { + if p.Pathsym != nil { + return + } + + // If we are compiling the runtime package, there are two runtime packages around + // -- localpkg and Runtimepkg. We don't want to produce import path symbols for + // both of them, so just produce one for localpkg. + if myimportpath == "runtime" && p == Runtimepkg { + return + } + + if dimportpath_gopkg == nil { + dimportpath_gopkg = mkpkg("go") + dimportpath_gopkg.Name = "go" + } + + nam := "importpath." + p.Prefix + "." + + n := Nod(ONAME, nil, nil) + n.Sym = Pkglookup(nam, dimportpath_gopkg) + + n.Class = PEXTERN + n.Xoffset = 0 + p.Pathsym = n.Sym + + if p == localpkg { + // Note: myimportpath != "", or else dgopkgpath won't call dimportpath. + gdatastring(n, myimportpath) + } else { + gdatastring(n, p.Path) + } + ggloblsym(n.Sym, int32(Types[TSTRING].Width), obj.DUPOK|obj.RODATA) +} + +func dgopkgpath(s *Sym, ot int, pkg *Pkg) int { + if pkg == nil { + return dgostringptr(s, ot, "") + } + + if pkg == localpkg && myimportpath == "" { + // If we don't know the full path of the package being compiled (i.e. -p + // was not passed on the compiler command line), emit reference to + // go.importpath.""., which 6l will rewrite using the correct import path. + // Every package that imports this one directly defines the symbol. + var ns *Sym + + if ns == nil { + ns = Pkglookup("importpath.\"\".", mkpkg("go")) + } + return dsymptr(s, ot, ns, 0) + } + + dimportpath(pkg) + return dsymptr(s, ot, pkg.Pathsym, 0) +} + +/* + * uncommonType + * ../../runtime/type.go:/uncommonType + */ +func dextratype(sym *Sym, off int, t *Type, ptroff int) int { + m := methods(t) + if t.Sym == nil && m == nil { + return off + } + + // fill in *extraType pointer in header + off = int(Rnd(int64(off), int64(Widthptr))) + + dsymptr(sym, ptroff, sym, off) + + n := 0 + for a := m; a != nil; a = a.link { + dtypesym(a.type_) + n++ + } + + ot := off + s := sym + if t.Sym != nil { + ot = dgostringptr(s, ot, t.Sym.Name) + if t != Types[t.Etype] && t != errortype { + ot = dgopkgpath(s, ot, t.Sym.Pkg) + } else { + ot = dgostringptr(s, ot, "") + } + } else { + ot = dgostringptr(s, ot, "") + ot = dgostringptr(s, ot, "") + } + + // slice header + ot = dsymptr(s, ot, s, ot+Widthptr+2*Widthint) + + ot = duintxx(s, ot, uint64(n), Widthint) + ot = duintxx(s, ot, uint64(n), Widthint) + + // methods + for a := m; a != nil; a = a.link { + // method + // ../../runtime/type.go:/method + ot = dgostringptr(s, ot, a.name) + + ot = dgopkgpath(s, ot, a.pkg) + ot = dsymptr(s, ot, dtypesym(a.mtype), 0) + ot = dsymptr(s, ot, dtypesym(a.type_), 0) + if a.isym != nil { + ot = dsymptr(s, ot, a.isym, 0) + } else { + ot = duintptr(s, ot, 0) + } + if a.tsym != nil { + ot = dsymptr(s, ot, a.tsym, 0) + } else { + ot = duintptr(s, ot, 0) + } + } + + return ot +} + +var kinds = []int{ + TINT: obj.KindInt, + TUINT: obj.KindUint, + TINT8: obj.KindInt8, + TUINT8: obj.KindUint8, + TINT16: obj.KindInt16, + TUINT16: obj.KindUint16, + TINT32: obj.KindInt32, + TUINT32: obj.KindUint32, + TINT64: obj.KindInt64, + TUINT64: obj.KindUint64, + TUINTPTR: obj.KindUintptr, + TFLOAT32: obj.KindFloat32, + TFLOAT64: obj.KindFloat64, + TBOOL: obj.KindBool, + TSTRING: obj.KindString, + TPTR32: obj.KindPtr, + TPTR64: obj.KindPtr, + TSTRUCT: obj.KindStruct, + TINTER: obj.KindInterface, + TCHAN: obj.KindChan, + TMAP: obj.KindMap, + TARRAY: obj.KindArray, + TFUNC: obj.KindFunc, + TCOMPLEX64: obj.KindComplex64, + TCOMPLEX128: obj.KindComplex128, + TUNSAFEPTR: obj.KindUnsafePointer, +} + +func haspointers(t *Type) bool { + if t.Haspointers != 0 { + return t.Haspointers-1 != 0 + } + + var ret bool + switch t.Etype { + case TINT, + TUINT, + TINT8, + TUINT8, + TINT16, + TUINT16, + TINT32, + TUINT32, + TINT64, + TUINT64, + TUINTPTR, + TFLOAT32, + TFLOAT64, + TCOMPLEX64, + TCOMPLEX128, + TBOOL: + ret = false + + case TARRAY: + if t.Bound < 0 { // slice + ret = true + break + } + + if t.Bound == 0 { // empty array + ret = false + break + } + + ret = haspointers(t.Type) + + case TSTRUCT: + ret = false + for t1 := t.Type; t1 != nil; t1 = t1.Down { + if haspointers(t1.Type) { + ret = true + break + } + } + + case TSTRING, + TPTR32, + TPTR64, + TUNSAFEPTR, + TINTER, + TCHAN, + TMAP, + TFUNC: + fallthrough + default: + ret = true + + case TFIELD: + Fatal("haspointers: unexpected type, %v", t) + } + + t.Haspointers = 1 + uint8(obj.Bool2int(ret)) + return ret +} + +// typeptrdata returns the length in bytes of the prefix of t +// containing pointer data. Anything after this offset is scalar data. +func typeptrdata(t *Type) int64 { + if !haspointers(t) { + return 0 + } + + switch t.Etype { + case TPTR32, + TPTR64, + TUNSAFEPTR, + TFUNC, + TCHAN, + TMAP: + return int64(Widthptr) + + case TSTRING: + // struct { byte *str; intgo len; } + return int64(Widthptr) + + case TINTER: + // struct { Itab *tab; void *data; } or + // struct { Type *type; void *data; } + return 2 * int64(Widthptr) + + case TARRAY: + if Isslice(t) { + // struct { byte *array; uintgo len; uintgo cap; } + return int64(Widthptr) + } + // haspointers already eliminated t.Bound == 0. + return (t.Bound-1)*t.Type.Width + typeptrdata(t.Type) + + case TSTRUCT: + // Find the last field that has pointers. + var lastPtrField *Type + for t1 := t.Type; t1 != nil; t1 = t1.Down { + if haspointers(t1.Type) { + lastPtrField = t1 + } + } + return lastPtrField.Width + typeptrdata(lastPtrField.Type) + + default: + Fatal("typeptrdata: unexpected type, %v", t) + return 0 + } +} + +/* + * commonType + * ../../runtime/type.go:/commonType + */ + +var dcommontype_algarray *Sym + +func dcommontype(s *Sym, ot int, t *Type) int { + if ot != 0 { + Fatal("dcommontype %d", ot) + } + + sizeofAlg := 2 * Widthptr + if dcommontype_algarray == nil { + dcommontype_algarray = Pkglookup("algarray", Runtimepkg) + } + dowidth(t) + alg := algtype(t) + var algsym *Sym + if alg < 0 || alg == AMEM { + algsym = dalgsym(t) + } + + var sptr *Sym + tptr := Ptrto(t) + if !Isptr[t.Etype] && (t.Sym != nil || methods(tptr) != nil) { + sptr = dtypesym(tptr) + } else { + sptr = weaktypesym(tptr) + } + + // All (non-reflect-allocated) Types share the same zero object. + // Each place in the compiler where a pointer to the zero object + // might be returned by a runtime call (map access return value, + // 2-arg type cast) declares the size of the zerovalue it needs. + // The linker magically takes the max of all the sizes. + zero := Pkglookup("zerovalue", Runtimepkg) + + gcsym, useGCProg, ptrdata := dgcsym(t) + + // We use size 0 here so we get the pointer to the zero value, + // but don't allocate space for the zero value unless we need it. + // TODO: how do we get this symbol into bss? We really want + // a read-only bss, but I don't think such a thing exists. + + // ../../pkg/reflect/type.go:/^type.commonType + // actual type structure + // type commonType struct { + // size uintptr + // ptrsize uintptr + // hash uint32 + // _ uint8 + // align uint8 + // fieldAlign uint8 + // kind uint8 + // alg unsafe.Pointer + // gcdata unsafe.Pointer + // string *string + // *extraType + // ptrToThis *Type + // zero unsafe.Pointer + // } + ot = duintptr(s, ot, uint64(t.Width)) + ot = duintptr(s, ot, uint64(ptrdata)) + + ot = duint32(s, ot, typehash(t)) + ot = duint8(s, ot, 0) // unused + + // runtime (and common sense) expects alignment to be a power of two. + i := int(t.Align) + + if i == 0 { + i = 1 + } + if i&(i-1) != 0 { + Fatal("invalid alignment %d for %v", t.Align, t) + } + ot = duint8(s, ot, t.Align) // align + ot = duint8(s, ot, t.Align) // fieldAlign + + i = kinds[t.Etype] + if t.Etype == TARRAY && t.Bound < 0 { + i = obj.KindSlice + } + if !haspointers(t) { + i |= obj.KindNoPointers + } + if isdirectiface(t) { + i |= obj.KindDirectIface + } + if useGCProg { + i |= obj.KindGCProg + } + ot = duint8(s, ot, uint8(i)) // kind + if algsym == nil { + ot = dsymptr(s, ot, dcommontype_algarray, alg*sizeofAlg) + } else { + ot = dsymptr(s, ot, algsym, 0) + } + ot = dsymptr(s, ot, gcsym, 0) + + p := Tconv(t, obj.FmtLeft|obj.FmtUnsigned) + + //print("dcommontype: %s\n", p); + ot = dgostringptr(s, ot, p) // string + + // skip pointer to extraType, + // which follows the rest of this type structure. + // caller will fill in if needed. + // otherwise linker will assume 0. + ot += Widthptr + + ot = dsymptr(s, ot, sptr, 0) // ptrto type + ot = dsymptr(s, ot, zero, 0) // ptr to zero value + return ot +} + +func typesym(t *Type) *Sym { + return Pkglookup(Tconv(t, obj.FmtLeft), typepkg) +} + +func tracksym(t *Type) *Sym { + return Pkglookup(Tconv(t.Outer, obj.FmtLeft)+"."+t.Sym.Name, trackpkg) +} + +func typelinksym(t *Type) *Sym { + // %-uT is what the generated Type's string field says. + // It uses (ambiguous) package names instead of import paths. + // %-T is the complete, unambiguous type name. + // We want the types to end up sorted by string field, + // so use that first in the name, and then add :%-T to + // disambiguate. We use a tab character as the separator to + // ensure the types appear sorted by their string field. The + // names are a little long but they are discarded by the linker + // and do not end up in the symbol table of the final binary. + p := Tconv(t, obj.FmtLeft|obj.FmtUnsigned) + "\t" + Tconv(t, obj.FmtLeft) + + s := Pkglookup(p, typelinkpkg) + + //print("typelinksym: %s -> %+S\n", p, s); + + return s +} + +func typesymprefix(prefix string, t *Type) *Sym { + p := prefix + "." + Tconv(t, obj.FmtLeft) + s := Pkglookup(p, typepkg) + + //print("algsym: %s -> %+S\n", p, s); + + return s +} + +func typenamesym(t *Type) *Sym { + if t == nil || (Isptr[t.Etype] && t.Type == nil) || isideal(t) { + Fatal("typename %v", t) + } + s := typesym(t) + if s.Def == nil { + n := Nod(ONAME, nil, nil) + n.Sym = s + n.Type = Types[TUINT8] + n.Addable = true + n.Ullman = 1 + n.Class = PEXTERN + n.Xoffset = 0 + n.Typecheck = 1 + s.Def = n + + signatlist = list(signatlist, typenod(t)) + } + + return s.Def.Sym +} + +func typename(t *Type) *Node { + s := typenamesym(t) + n := Nod(OADDR, s.Def, nil) + n.Type = Ptrto(s.Def.Type) + n.Addable = true + n.Ullman = 2 + n.Typecheck = 1 + return n +} + +func weaktypesym(t *Type) *Sym { + p := Tconv(t, obj.FmtLeft) + s := Pkglookup(p, weaktypepkg) + + //print("weaktypesym: %s -> %+S\n", p, s); + + return s +} + +/* + * Returns 1 if t has a reflexive equality operator. + * That is, if x==x for all x of type t. + */ +func isreflexive(t *Type) bool { + switch t.Etype { + case TBOOL, + TINT, + TUINT, + TINT8, + TUINT8, + TINT16, + TUINT16, + TINT32, + TUINT32, + TINT64, + TUINT64, + TUINTPTR, + TPTR32, + TPTR64, + TUNSAFEPTR, + TSTRING, + TCHAN: + return true + + case TFLOAT32, + TFLOAT64, + TCOMPLEX64, + TCOMPLEX128, + TINTER: + return false + + case TARRAY: + if Isslice(t) { + Fatal("slice can't be a map key: %v", t) + } + return isreflexive(t.Type) + + case TSTRUCT: + for t1 := t.Type; t1 != nil; t1 = t1.Down { + if !isreflexive(t1.Type) { + return false + } + } + + return true + + default: + Fatal("bad type for map key: %v", t) + return false + } +} + +func dtypesym(t *Type) *Sym { + // Replace byte, rune aliases with real type. + // They've been separate internally to make error messages + // better, but we have to merge them in the reflect tables. + if t == bytetype || t == runetype { + t = Types[t.Etype] + } + + if isideal(t) { + Fatal("dtypesym %v", t) + } + + s := typesym(t) + if s.Flags&SymSiggen != 0 { + return s + } + s.Flags |= SymSiggen + + // special case (look for runtime below): + // when compiling package runtime, + // emit the type structures for int, float, etc. + tbase := t + + if Isptr[t.Etype] && t.Sym == nil && t.Type.Sym != nil { + tbase = t.Type + } + dupok := 0 + if tbase.Sym == nil { + dupok = obj.DUPOK + } + + if compiling_runtime != 0 && (tbase == Types[tbase.Etype] || tbase == bytetype || tbase == runetype || tbase == errortype) { // int, float, etc + goto ok + } + + // named types from other files are defined only by those files + if tbase.Sym != nil && !tbase.Local { + return s + } + if isforw[tbase.Etype] { + return s + } + +ok: + ot := 0 + xt := 0 + switch t.Etype { + default: + ot = dcommontype(s, ot, t) + xt = ot - 3*Widthptr + + case TARRAY: + if t.Bound >= 0 { + // ../../runtime/type.go:/ArrayType + s1 := dtypesym(t.Type) + + t2 := typ(TARRAY) + t2.Type = t.Type + t2.Bound = -1 // slice + s2 := dtypesym(t2) + ot = dcommontype(s, ot, t) + xt = ot - 3*Widthptr + ot = dsymptr(s, ot, s1, 0) + ot = dsymptr(s, ot, s2, 0) + ot = duintptr(s, ot, uint64(t.Bound)) + } else { + // ../../runtime/type.go:/SliceType + s1 := dtypesym(t.Type) + + ot = dcommontype(s, ot, t) + xt = ot - 3*Widthptr + ot = dsymptr(s, ot, s1, 0) + } + + // ../../runtime/type.go:/ChanType + case TCHAN: + s1 := dtypesym(t.Type) + + ot = dcommontype(s, ot, t) + xt = ot - 3*Widthptr + ot = dsymptr(s, ot, s1, 0) + ot = duintptr(s, ot, uint64(t.Chan)) + + case TFUNC: + for t1 := getthisx(t).Type; t1 != nil; t1 = t1.Down { + dtypesym(t1.Type) + } + isddd := false + for t1 := getinargx(t).Type; t1 != nil; t1 = t1.Down { + isddd = t1.Isddd + dtypesym(t1.Type) + } + + for t1 := getoutargx(t).Type; t1 != nil; t1 = t1.Down { + dtypesym(t1.Type) + } + + ot = dcommontype(s, ot, t) + xt = ot - 3*Widthptr + ot = duint8(s, ot, uint8(obj.Bool2int(isddd))) + + // two slice headers: in and out. + ot = int(Rnd(int64(ot), int64(Widthptr))) + + ot = dsymptr(s, ot, s, ot+2*(Widthptr+2*Widthint)) + n := t.Thistuple + t.Intuple + ot = duintxx(s, ot, uint64(n), Widthint) + ot = duintxx(s, ot, uint64(n), Widthint) + ot = dsymptr(s, ot, s, ot+1*(Widthptr+2*Widthint)+n*Widthptr) + ot = duintxx(s, ot, uint64(t.Outtuple), Widthint) + ot = duintxx(s, ot, uint64(t.Outtuple), Widthint) + + // slice data + for t1 := getthisx(t).Type; t1 != nil; t1 = t1.Down { + ot = dsymptr(s, ot, dtypesym(t1.Type), 0) + n++ + } + for t1 := getinargx(t).Type; t1 != nil; t1 = t1.Down { + ot = dsymptr(s, ot, dtypesym(t1.Type), 0) + n++ + } + for t1 := getoutargx(t).Type; t1 != nil; t1 = t1.Down { + ot = dsymptr(s, ot, dtypesym(t1.Type), 0) + n++ + } + + case TINTER: + m := imethods(t) + n := 0 + for a := m; a != nil; a = a.link { + dtypesym(a.type_) + n++ + } + + // ../../runtime/type.go:/InterfaceType + ot = dcommontype(s, ot, t) + + xt = ot - 3*Widthptr + ot = dsymptr(s, ot, s, ot+Widthptr+2*Widthint) + ot = duintxx(s, ot, uint64(n), Widthint) + ot = duintxx(s, ot, uint64(n), Widthint) + for a := m; a != nil; a = a.link { + // ../../runtime/type.go:/imethod + ot = dgostringptr(s, ot, a.name) + + ot = dgopkgpath(s, ot, a.pkg) + ot = dsymptr(s, ot, dtypesym(a.type_), 0) + } + + // ../../runtime/type.go:/MapType + case TMAP: + s1 := dtypesym(t.Down) + + s2 := dtypesym(t.Type) + s3 := dtypesym(mapbucket(t)) + s4 := dtypesym(hmap(t)) + ot = dcommontype(s, ot, t) + xt = ot - 3*Widthptr + ot = dsymptr(s, ot, s1, 0) + ot = dsymptr(s, ot, s2, 0) + ot = dsymptr(s, ot, s3, 0) + ot = dsymptr(s, ot, s4, 0) + if t.Down.Width > MAXKEYSIZE { + ot = duint8(s, ot, uint8(Widthptr)) + ot = duint8(s, ot, 1) // indirect + } else { + ot = duint8(s, ot, uint8(t.Down.Width)) + ot = duint8(s, ot, 0) // not indirect + } + + if t.Type.Width > MAXVALSIZE { + ot = duint8(s, ot, uint8(Widthptr)) + ot = duint8(s, ot, 1) // indirect + } else { + ot = duint8(s, ot, uint8(t.Type.Width)) + ot = duint8(s, ot, 0) // not indirect + } + + ot = duint16(s, ot, uint16(mapbucket(t).Width)) + ot = duint8(s, ot, uint8(obj.Bool2int(isreflexive(t.Down)))) + + case TPTR32, TPTR64: + if t.Type.Etype == TANY { + // ../../runtime/type.go:/UnsafePointerType + ot = dcommontype(s, ot, t) + + break + } + + // ../../runtime/type.go:/PtrType + s1 := dtypesym(t.Type) + + ot = dcommontype(s, ot, t) + xt = ot - 3*Widthptr + ot = dsymptr(s, ot, s1, 0) + + // ../../runtime/type.go:/StructType + // for security, only the exported fields. + case TSTRUCT: + n := 0 + + for t1 := t.Type; t1 != nil; t1 = t1.Down { + dtypesym(t1.Type) + n++ + } + + ot = dcommontype(s, ot, t) + xt = ot - 3*Widthptr + ot = dsymptr(s, ot, s, ot+Widthptr+2*Widthint) + ot = duintxx(s, ot, uint64(n), Widthint) + ot = duintxx(s, ot, uint64(n), Widthint) + for t1 := t.Type; t1 != nil; t1 = t1.Down { + // ../../runtime/type.go:/structField + if t1.Sym != nil && t1.Embedded == 0 { + ot = dgostringptr(s, ot, t1.Sym.Name) + if exportname(t1.Sym.Name) { + ot = dgostringptr(s, ot, "") + } else { + ot = dgopkgpath(s, ot, t1.Sym.Pkg) + } + } else { + ot = dgostringptr(s, ot, "") + if t1.Type.Sym != nil && t1.Type.Sym.Pkg == builtinpkg { + ot = dgopkgpath(s, ot, localpkg) + } else { + ot = dgostringptr(s, ot, "") + } + } + + ot = dsymptr(s, ot, dtypesym(t1.Type), 0) + ot = dgostrlitptr(s, ot, t1.Note) + ot = duintptr(s, ot, uint64(t1.Width)) // field offset + } + } + + ot = dextratype(s, ot, t, xt) + ggloblsym(s, int32(ot), int16(dupok|obj.RODATA)) + + // generate typelink.foo pointing at s = type.foo. + // The linker will leave a table of all the typelinks for + // types in the binary, so reflect can find them. + // We only need the link for unnamed composites that + // we want be able to find. + if t.Sym == nil { + switch t.Etype { + case TPTR32, TPTR64: + // The ptrto field of the type data cannot be relied on when + // dynamic linking: a type T may be defined in a module that makes + // no use of pointers to that type, but another module can contain + // a package that imports the first one and does use *T pointers. + // The second module will end up defining type data for *T and a + // type.*T symbol pointing at it. It's important that calling + // .PtrTo() on the reflect.Type for T returns this type data and + // not some synthesized object, so we need reflect to be able to + // find it! + if !Ctxt.Flag_dynlink { + break + } + fallthrough + case TARRAY, TCHAN, TFUNC, TMAP: + slink := typelinksym(t) + dsymptr(slink, 0, s, 0) + ggloblsym(slink, int32(Widthptr), int16(dupok|obj.RODATA)) + } + } + + return s +} + +func dumptypestructs() { + var n *Node + + // copy types from externdcl list to signatlist + for l := externdcl; l != nil; l = l.Next { + n = l.N + if n.Op != OTYPE { + continue + } + signatlist = list(signatlist, n) + } + + // process signatlist + var t *Type + for l := signatlist; l != nil; l = l.Next { + n = l.N + if n.Op != OTYPE { + continue + } + t = n.Type + dtypesym(t) + if t.Sym != nil { + dtypesym(Ptrto(t)) + } + } + + // generate import strings for imported packages + for _, p := range pkgs { + if p.Direct != 0 { + dimportpath(p) + } + } + + // do basic types if compiling package runtime. + // they have to be in at least one package, + // and runtime is always loaded implicitly, + // so this is as good as any. + // another possible choice would be package main, + // but using runtime means fewer copies in .6 files. + if compiling_runtime != 0 { + for i := 1; i <= TBOOL; i++ { + dtypesym(Ptrto(Types[i])) + } + dtypesym(Ptrto(Types[TSTRING])) + dtypesym(Ptrto(Types[TUNSAFEPTR])) + + // emit type structs for error and func(error) string. + // The latter is the type of an auto-generated wrapper. + dtypesym(Ptrto(errortype)) + + dtypesym(functype(nil, list1(Nod(ODCLFIELD, nil, typenod(errortype))), list1(Nod(ODCLFIELD, nil, typenod(Types[TSTRING]))))) + + // add paths for runtime and main, which 6l imports implicitly. + dimportpath(Runtimepkg) + + if flag_race != 0 { + dimportpath(racepkg) + } + dimportpath(mkpkg("main")) + } +} + +func dalgsym(t *Type) *Sym { + var s *Sym + var hashfunc *Sym + var eqfunc *Sym + + // dalgsym is only called for a type that needs an algorithm table, + // which implies that the type is comparable (or else it would use ANOEQ). + + if algtype(t) == AMEM { + // we use one algorithm table for all AMEM types of a given size + p := fmt.Sprintf(".alg%d", t.Width) + + s = Pkglookup(p, typepkg) + + if s.Flags&SymAlgGen != 0 { + return s + } + s.Flags |= SymAlgGen + + // make hash closure + p = fmt.Sprintf(".hashfunc%d", t.Width) + + hashfunc = Pkglookup(p, typepkg) + + ot := 0 + ot = dsymptr(hashfunc, ot, Pkglookup("memhash_varlen", Runtimepkg), 0) + ot = duintxx(hashfunc, ot, uint64(t.Width), Widthptr) // size encoded in closure + ggloblsym(hashfunc, int32(ot), obj.DUPOK|obj.RODATA) + + // make equality closure + p = fmt.Sprintf(".eqfunc%d", t.Width) + + eqfunc = Pkglookup(p, typepkg) + + ot = 0 + ot = dsymptr(eqfunc, ot, Pkglookup("memequal_varlen", Runtimepkg), 0) + ot = duintxx(eqfunc, ot, uint64(t.Width), Widthptr) + ggloblsym(eqfunc, int32(ot), obj.DUPOK|obj.RODATA) + } else { + // generate an alg table specific to this type + s = typesymprefix(".alg", t) + + hash := typesymprefix(".hash", t) + eq := typesymprefix(".eq", t) + hashfunc = typesymprefix(".hashfunc", t) + eqfunc = typesymprefix(".eqfunc", t) + + genhash(hash, t) + geneq(eq, t) + + // make Go funcs (closures) for calling hash and equal from Go + dsymptr(hashfunc, 0, hash, 0) + + ggloblsym(hashfunc, int32(Widthptr), obj.DUPOK|obj.RODATA) + dsymptr(eqfunc, 0, eq, 0) + ggloblsym(eqfunc, int32(Widthptr), obj.DUPOK|obj.RODATA) + } + + // ../../runtime/alg.go:/typeAlg + ot := 0 + + ot = dsymptr(s, ot, hashfunc, 0) + ot = dsymptr(s, ot, eqfunc, 0) + ggloblsym(s, int32(ot), obj.DUPOK|obj.RODATA) + return s +} + +// maxPtrmaskBytes is the maximum length of a GC ptrmask bitmap, +// which holds 1-bit entries describing where pointers are in a given type. +// 16 bytes is enough to describe 128 pointer-sized words, 512 or 1024 bytes +// depending on the system. Above this length, the GC information is +// recorded as a GC program, which can express repetition compactly. +// In either form, the information is used by the runtime to initialize the +// heap bitmap, and for large types (like 128 or more words), they are +// roughly the same speed. GC programs are never much larger and often +// more compact. (If large arrays are involved, they can be arbitrarily more +// compact.) +// +// The cutoff must be large enough that any allocation large enough to +// use a GC program is large enough that it does not share heap bitmap +// bytes with any other objects, allowing the GC program execution to +// assume an aligned start and not use atomic operations. In the current +// runtime, this means all malloc size classes larger than the cutoff must +// be multiples of four words. On 32-bit systems that's 16 bytes, and +// all size classes >= 16 bytes are 16-byte aligned, so no real constraint. +// On 64-bit systems, that's 32 bytes, and 32-byte alignment is guaranteed +// for size classes >= 256 bytes. On a 64-bit sytem, 256 bytes allocated +// is 32 pointers, the bits for which fit in 4 bytes. So maxPtrmaskBytes +// must be >= 4. +// +// We used to use 16 because the GC programs do have some constant overhead +// to get started, and processing 128 pointers seems to be enough to +// amortize that overhead well. +// +// To make sure that the runtime's chansend can call typeBitsBulkBarrier, +// we raised the limit to 2048, so that even 32-bit systems are guaranteed to +// use bitmaps for objects up to 64 kB in size. +// +// Also known to reflect/type.go. +// +const maxPtrmaskBytes = 2048 + +// dgcsym emits and returns a data symbol containing GC information for type t, +// along with a boolean reporting whether the UseGCProg bit should be set in +// the type kind, and the ptrdata field to record in the reflect type information. +func dgcsym(t *Type) (sym *Sym, useGCProg bool, ptrdata int64) { + ptrdata = typeptrdata(t) + if ptrdata/int64(Widthptr) <= maxPtrmaskBytes*8 { + sym = dgcptrmask(t) + return + } + + useGCProg = true + sym, ptrdata = dgcprog(t) + return +} + +// dgcptrmask emits and returns the symbol containing a pointer mask for type t. +func dgcptrmask(t *Type) *Sym { + ptrmask := make([]byte, (typeptrdata(t)/int64(Widthptr)+7)/8) + fillptrmask(t, ptrmask) + p := fmt.Sprintf("gcbits.%x", ptrmask) + + sym := Pkglookup(p, Runtimepkg) + if sym.Flags&SymUniq == 0 { + sym.Flags |= SymUniq + for i, x := range ptrmask { + duint8(sym, i, x) + } + ggloblsym(sym, int32(len(ptrmask)), obj.DUPOK|obj.RODATA|obj.LOCAL) + } + return sym +} + +// fillptrmask fills in ptrmask with 1s corresponding to the +// word offsets in t that hold pointers. +// ptrmask is assumed to fit at least typeptrdata(t)/Widthptr bits. +func fillptrmask(t *Type, ptrmask []byte) { + for i := range ptrmask { + ptrmask[i] = 0 + } + if !haspointers(t) { + return + } + + vec := bvalloc(8 * int32(len(ptrmask))) + xoffset := int64(0) + onebitwalktype1(t, &xoffset, vec) + + nptr := typeptrdata(t) / int64(Widthptr) + for i := int64(0); i < nptr; i++ { + if bvget(vec, int32(i)) == 1 { + ptrmask[i/8] |= 1 << (uint(i) % 8) + } + } +} + +// dgcprog emits and returns the symbol containing a GC program for type t +// along with the size of the data described by the program (in the range [typeptrdata(t), t.Width]). +// In practice, the size is typeptrdata(t) except for non-trivial arrays. +// For non-trivial arrays, the program describes the full t.Width size. +func dgcprog(t *Type) (*Sym, int64) { + dowidth(t) + if t.Width == BADWIDTH { + Fatal("dgcprog: %v badwidth", t) + } + sym := typesymprefix(".gcprog", t) + var p GCProg + p.init(sym) + p.emit(t, 0) + offset := p.w.BitIndex() * int64(Widthptr) + p.end() + if ptrdata := typeptrdata(t); offset < ptrdata || offset > t.Width { + Fatal("dgcprog: %v: offset=%d but ptrdata=%d size=%d", t, offset, ptrdata, t.Width) + } + return sym, offset +} + +type GCProg struct { + sym *Sym + symoff int + w gcprog.Writer +} + +var Debug_gcprog int // set by -d gcprog + +func (p *GCProg) init(sym *Sym) { + p.sym = sym + p.symoff = 4 // first 4 bytes hold program length + p.w.Init(p.writeByte) + if Debug_gcprog > 0 { + fmt.Fprintf(os.Stderr, "compile: start GCProg for %v\n", sym) + p.w.Debug(os.Stderr) + } +} + +func (p *GCProg) writeByte(x byte) { + p.symoff = duint8(p.sym, p.symoff, x) +} + +func (p *GCProg) end() { + p.w.End() + duint32(p.sym, 0, uint32(p.symoff-4)) + ggloblsym(p.sym, int32(p.symoff), obj.DUPOK|obj.RODATA|obj.LOCAL) + if Debug_gcprog > 0 { + fmt.Fprintf(os.Stderr, "compile: end GCProg for %v\n", p.sym) + } +} + +func (p *GCProg) emit(t *Type, offset int64) { + dowidth(t) + if !haspointers(t) { + return + } + if t.Width == int64(Widthptr) { + p.w.Ptr(offset / int64(Widthptr)) + return + } + switch t.Etype { + default: + Fatal("GCProg.emit: unexpected type %v", t) + + case TSTRING: + p.w.Ptr(offset / int64(Widthptr)) + + case TINTER: + p.w.Ptr(offset / int64(Widthptr)) + p.w.Ptr(offset/int64(Widthptr) + 1) + + case TARRAY: + if Isslice(t) { + p.w.Ptr(offset / int64(Widthptr)) + return + } + if t.Bound == 0 { + // should have been handled by haspointers check above + Fatal("GCProg.emit: empty array") + } + + // Flatten array-of-array-of-array to just a big array by multiplying counts. + count := t.Bound + elem := t.Type + for Isfixedarray(elem) { + count *= elem.Bound + elem = elem.Type + } + + if !p.w.ShouldRepeat(elem.Width/int64(Widthptr), count) { + // Cheaper to just emit the bits. + for i := int64(0); i < count; i++ { + p.emit(elem, offset+i*elem.Width) + } + return + } + p.emit(elem, offset) + p.w.ZeroUntil((offset + elem.Width) / int64(Widthptr)) + p.w.Repeat(elem.Width/int64(Widthptr), count-1) + + case TSTRUCT: + for t1 := t.Type; t1 != nil; t1 = t1.Down { + p.emit(t1.Type, offset+t1.Width) + } + } +} diff --git a/src/cmd/compile/internal/gc/reg.go b/src/cmd/compile/internal/gc/reg.go new file mode 100644 index 0000000000000000000000000000000000000000..0fa0535424afbb4320e9d03971e90e314079808c --- /dev/null +++ b/src/cmd/compile/internal/gc/reg.go @@ -0,0 +1,1559 @@ +// Derived from Inferno utils/6c/reg.c +// http://code.google.com/p/inferno-os/source/browse/utils/6c/reg.c +// +// Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved. +// Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net) +// Portions Copyright © 1997-1999 Vita Nuova Limited +// Portions Copyright © 2000-2007 Vita Nuova Holdings Limited (www.vitanuova.com) +// Portions Copyright © 2004,2006 Bruce Ellis +// Portions Copyright © 2005-2007 C H Forsyth (forsyth@terzarima.net) +// Revisions Copyright © 2000-2007 Lucent Technologies Inc. and others +// Portions Copyright © 2009 The Go Authors. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +package gc + +import ( + "bytes" + "cmd/internal/obj" + "fmt" + "sort" + "strings" +) + +// A Var represents a single variable that may be stored in a register. +// That variable may itself correspond to a hardware register, +// to represent the use of registers in the unoptimized instruction stream. +type Var struct { + offset int64 + node *Node + nextinnode *Var + width int + id int // index in vars + name int8 + etype int8 + addr int8 +} + +// Bits represents a set of Vars, stored as a bit set of var numbers +// (the index in vars, or equivalently v.id). +type Bits struct { + b [BITS]uint64 +} + +const ( + BITS = 3 + NVAR = BITS * 64 +) + +var ( + vars [NVAR]Var // variables under consideration + nvar int // number of vars + + regbits uint64 // bits for hardware registers + + zbits Bits // zero + externs Bits // global variables + params Bits // function parameters and results + ivar Bits // function parameters (inputs) + ovar Bits // function results (outputs) + consts Bits // constant values + addrs Bits // variables with address taken +) + +// A Reg is a wrapper around a single Prog (one instruction) that holds +// register optimization information while the optimizer runs. +// r->prog is the instruction. +type Reg struct { + set Bits // regopt variables written by this instruction. + use1 Bits // regopt variables read by prog->from. + use2 Bits // regopt variables read by prog->to. + + // refahead/refbehind are the regopt variables whose current + // value may be used in the following/preceding instructions + // up to a CALL (or the value is clobbered). + refbehind Bits + refahead Bits + + // calahead/calbehind are similar, but for variables in + // instructions that are reachable after hitting at least one + // CALL. + calbehind Bits + calahead Bits + + regdiff Bits + act Bits + regu uint64 // register used bitmap +} + +// A Rgn represents a single regopt variable over a region of code +// where a register could potentially be dedicated to that variable. +// The code encompassed by a Rgn is defined by the flow graph, +// starting at enter, flood-filling forward while varno is refahead +// and backward while varno is refbehind, and following branches. +// A single variable may be represented by multiple disjoint Rgns and +// each Rgn may choose a different register for that variable. +// Registers are allocated to regions greedily in order of descending +// cost. +type Rgn struct { + enter *Flow + cost int16 + varno int16 + regno int16 +} + +// The Plan 9 C compilers used a limit of 600 regions, +// but the yacc-generated parser in y.go has 3100 regions. +// We set MaxRgn large enough to handle that. +// There's not a huge cost to having too many regions: +// the main processing traces the live area for each variable, +// which is limited by the number of variables times the area, +// not the raw region count. If there are many regions, they +// are almost certainly small and easy to trace. +// The only operation that scales with region count is the +// sorting by cost, which uses sort.Sort and is therefore +// guaranteed n log n. +const MaxRgn = 6000 + +var ( + region []Rgn + nregion int +) + +type rcmp []Rgn + +func (x rcmp) Len() int { + return len(x) +} + +func (x rcmp) Swap(i, j int) { + x[i], x[j] = x[j], x[i] +} + +func (x rcmp) Less(i, j int) bool { + p1 := &x[i] + p2 := &x[j] + if p1.cost != p2.cost { + return int(p2.cost)-int(p1.cost) < 0 + } + if p1.varno != p2.varno { + return int(p2.varno)-int(p1.varno) < 0 + } + if p1.enter != p2.enter { + return int(p2.enter.Id-p1.enter.Id) < 0 + } + return false +} + +func setaddrs(bit Bits) { + var i int + var n int + var v *Var + var node *Node + + for bany(&bit) { + // convert each bit to a variable + i = bnum(bit) + + node = vars[i].node + n = int(vars[i].name) + biclr(&bit, uint(i)) + + // disable all pieces of that variable + for i = 0; i < nvar; i++ { + v = &vars[i] + if v.node == node && int(v.name) == n { + v.addr = 2 + } + } + } +} + +var regnodes [64]*Node + +func walkvardef(n *Node, f *Flow, active int) { + var f1 *Flow + var bn int + var v *Var + + for f1 = f; f1 != nil; f1 = f1.S1 { + if f1.Active == int32(active) { + break + } + f1.Active = int32(active) + if f1.Prog.As == obj.AVARKILL && f1.Prog.To.Node == n { + break + } + for v, _ = n.Opt().(*Var); v != nil; v = v.nextinnode { + bn = v.id + biset(&(f1.Data.(*Reg)).act, uint(bn)) + } + + if f1.Prog.As == obj.ACALL { + break + } + } + + for f2 := f; f2 != f1; f2 = f2.S1 { + if f2.S2 != nil { + walkvardef(n, f2.S2, active) + } + } +} + +/* + * add mov b,rn + * just after r + */ +func addmove(r *Flow, bn int, rn int, f int) { + p1 := Ctxt.NewProg() + Clearp(p1) + p1.Pc = 9999 + + p := r.Prog + p1.Link = p.Link + p.Link = p1 + p1.Lineno = p.Lineno + + v := &vars[bn] + + a := &p1.To + a.Offset = v.offset + a.Etype = uint8(v.etype) + a.Type = obj.TYPE_MEM + a.Name = v.name + a.Node = v.node + a.Sym = Linksym(v.node.Sym) + + /* NOTE(rsc): 9g did + if(a->etype == TARRAY) + a->type = TYPE_ADDR; + else if(a->sym == nil) + a->type = TYPE_CONST; + */ + p1.As = int16(Thearch.Optoas(OAS, Types[uint8(v.etype)])) + + // TODO(rsc): Remove special case here. + if (Thearch.Thechar == '5' || Thearch.Thechar == '7' || Thearch.Thechar == '9') && v.etype == TBOOL { + p1.As = int16(Thearch.Optoas(OAS, Types[TUINT8])) + } + p1.From.Type = obj.TYPE_REG + p1.From.Reg = int16(rn) + p1.From.Name = obj.NAME_NONE + if f == 0 { + p1.From = *a + *a = obj.Addr{} + a.Type = obj.TYPE_REG + a.Reg = int16(rn) + } + + if Debug['R'] != 0 && Debug['v'] != 0 { + fmt.Printf("%v ===add=== %v\n", p, p1) + } + Ostats.Nspill++ +} + +func overlap_reg(o1 int64, w1 int, o2 int64, w2 int) bool { + t1 := o1 + int64(w1) + t2 := o2 + int64(w2) + + if t1 <= o2 || t2 <= o1 { + return false + } + + return true +} + +func mkvar(f *Flow, a *obj.Addr) Bits { + /* + * mark registers used + */ + if a.Type == obj.TYPE_NONE { + return zbits + } + + r := f.Data.(*Reg) + r.use1.b[0] |= Thearch.Doregbits(int(a.Index)) // TODO: Use RtoB + + var n int + switch a.Type { + default: + regu := Thearch.Doregbits(int(a.Reg)) | Thearch.RtoB(int(a.Reg)) // TODO: Use RtoB + if regu == 0 { + return zbits + } + bit := zbits + bit.b[0] = regu + return bit + + // TODO(rsc): Remove special case here. + case obj.TYPE_ADDR: + var bit Bits + if Thearch.Thechar == '5' || Thearch.Thechar == '7' || Thearch.Thechar == '9' { + goto memcase + } + a.Type = obj.TYPE_MEM + bit = mkvar(f, a) + setaddrs(bit) + a.Type = obj.TYPE_ADDR + Ostats.Naddr++ + return zbits + + memcase: + fallthrough + + case obj.TYPE_MEM: + if r != nil { + r.use1.b[0] |= Thearch.RtoB(int(a.Reg)) + } + + /* NOTE: 5g did + if(r->f.prog->scond & (C_PBIT|C_WBIT)) + r->set.b[0] |= RtoB(a->reg); + */ + switch a.Name { + default: + // Note: This case handles NAME_EXTERN and NAME_STATIC. + // We treat these as requiring eager writes to memory, due to + // the possibility of a fault handler looking at them, so there is + // not much point in registerizing the loads. + // If we later choose the set of candidate variables from a + // larger list, these cases could be deprioritized instead of + // removed entirely. + return zbits + + case obj.NAME_PARAM, + obj.NAME_AUTO: + n = int(a.Name) + } + } + + node, _ := a.Node.(*Node) + if node == nil || node.Op != ONAME || node.Orig == nil { + return zbits + } + node = node.Orig + if node.Orig != node { + Fatal("%v: bad node", Ctxt.Dconv(a)) + } + if node.Sym == nil || node.Sym.Name[0] == '.' { + return zbits + } + et := int(a.Etype) + o := a.Offset + w := a.Width + if w < 0 { + Fatal("bad width %d for %v", w, Ctxt.Dconv(a)) + } + + flag := 0 + var v *Var + for i := 0; i < nvar; i++ { + v = &vars[i] + if v.node == node && int(v.name) == n { + if v.offset == o { + if int(v.etype) == et { + if int64(v.width) == w { + // TODO(rsc): Remove special case for arm here. + if flag == 0 || Thearch.Thechar != '5' { + return blsh(uint(i)) + } + } + } + } + + // if they overlap, disable both + if overlap_reg(v.offset, v.width, o, int(w)) { + // print("disable overlap %s %d %d %d %d, %E != %E\n", s->name, v->offset, v->width, o, w, v->etype, et); + v.addr = 1 + + flag = 1 + } + } + } + + switch et { + case 0, TFUNC: + return zbits + } + + if nvar >= NVAR { + if Debug['w'] > 1 && node != nil { + Fatal("variable not optimized: %v", Nconv(node, obj.FmtSharp)) + } + if Debug['v'] > 0 { + Warn("variable not optimized: %v", Nconv(node, obj.FmtSharp)) + } + + // If we're not tracking a word in a variable, mark the rest as + // having its address taken, so that we keep the whole thing + // live at all calls. otherwise we might optimize away part of + // a variable but not all of it. + var v *Var + for i := 0; i < nvar; i++ { + v = &vars[i] + if v.node == node { + v.addr = 1 + } + } + + return zbits + } + + i := nvar + nvar++ + v = &vars[i] + v.id = i + v.offset = o + v.name = int8(n) + v.etype = int8(et) + v.width = int(w) + v.addr = int8(flag) // funny punning + v.node = node + + // node->opt is the head of a linked list + // of Vars within the given Node, so that + // we can start at a Var and find all the other + // Vars in the same Go variable. + v.nextinnode, _ = node.Opt().(*Var) + + node.SetOpt(v) + + bit := blsh(uint(i)) + if n == obj.NAME_EXTERN || n == obj.NAME_STATIC { + for z := 0; z < BITS; z++ { + externs.b[z] |= bit.b[z] + } + } + if n == obj.NAME_PARAM { + for z := 0; z < BITS; z++ { + params.b[z] |= bit.b[z] + } + } + + if node.Class == PPARAM { + for z := 0; z < BITS; z++ { + ivar.b[z] |= bit.b[z] + } + } + if node.Class == PPARAMOUT { + for z := 0; z < BITS; z++ { + ovar.b[z] |= bit.b[z] + } + } + + // Treat values with their address taken as live at calls, + // because the garbage collector's liveness analysis in ../gc/plive.c does. + // These must be consistent or else we will elide stores and the garbage + // collector will see uninitialized data. + // The typical case where our own analysis is out of sync is when the + // node appears to have its address taken but that code doesn't actually + // get generated and therefore doesn't show up as an address being + // taken when we analyze the instruction stream. + // One instance of this case is when a closure uses the same name as + // an outer variable for one of its own variables declared with :=. + // The parser flags the outer variable as possibly shared, and therefore + // sets addrtaken, even though it ends up not being actually shared. + // If we were better about _ elision, _ = &x would suffice too. + // The broader := in a closure problem is mentioned in a comment in + // closure.c:/^typecheckclosure and dcl.c:/^oldname. + if node.Addrtaken { + v.addr = 1 + } + + // Disable registerization for globals, because: + // (1) we might panic at any time and we want the recovery code + // to see the latest values (issue 1304). + // (2) we don't know what pointers might point at them and we want + // loads via those pointers to see updated values and vice versa (issue 7995). + // + // Disable registerization for results if using defer, because the deferred func + // might recover and return, causing the current values to be used. + if node.Class == PEXTERN || (Hasdefer != 0 && node.Class == PPARAMOUT) { + v.addr = 1 + } + + if Debug['R'] != 0 { + fmt.Printf("bit=%2d et=%v w=%d+%d %v %v flag=%d\n", i, Econv(int(et), 0), o, w, Nconv(node, obj.FmtSharp), Ctxt.Dconv(a), v.addr) + } + Ostats.Nvar++ + + return bit +} + +var change int + +func prop(f *Flow, ref Bits, cal Bits) { + var f1 *Flow + var r1 *Reg + var z int + var i int + var v *Var + var v1 *Var + + for f1 = f; f1 != nil; f1 = f1.P1 { + r1 = f1.Data.(*Reg) + for z = 0; z < BITS; z++ { + ref.b[z] |= r1.refahead.b[z] + if ref.b[z] != r1.refahead.b[z] { + r1.refahead.b[z] = ref.b[z] + change = 1 + } + + cal.b[z] |= r1.calahead.b[z] + if cal.b[z] != r1.calahead.b[z] { + r1.calahead.b[z] = cal.b[z] + change = 1 + } + } + + switch f1.Prog.As { + case obj.ACALL: + if Noreturn(f1.Prog) { + break + } + + // Mark all input variables (ivar) as used, because that's what the + // liveness bitmaps say. The liveness bitmaps say that so that a + // panic will not show stale values in the parameter dump. + // Mark variables with a recent VARDEF (r1->act) as used, + // so that the optimizer flushes initializations to memory, + // so that if a garbage collection happens during this CALL, + // the collector will see initialized memory. Again this is to + // match what the liveness bitmaps say. + for z = 0; z < BITS; z++ { + cal.b[z] |= ref.b[z] | externs.b[z] | ivar.b[z] | r1.act.b[z] + ref.b[z] = 0 + } + + // cal.b is the current approximation of what's live across the call. + // Every bit in cal.b is a single stack word. For each such word, + // find all the other tracked stack words in the same Go variable + // (struct/slice/string/interface) and mark them live too. + // This is necessary because the liveness analysis for the garbage + // collector works at variable granularity, not at word granularity. + // It is fundamental for slice/string/interface: the garbage collector + // needs the whole value, not just some of the words, in order to + // interpret the other bits correctly. Specifically, slice needs a consistent + // ptr and cap, string needs a consistent ptr and len, and interface + // needs a consistent type word and data word. + for z = 0; z < BITS; z++ { + if cal.b[z] == 0 { + continue + } + for i = 0; i < 64; i++ { + if z*64+i >= nvar || (cal.b[z]>>uint(i))&1 == 0 { + continue + } + v = &vars[z*64+i] + if v.node.Opt() == nil { // v represents fixed register, not Go variable + continue + } + + // v->node->opt is the head of a linked list of Vars + // corresponding to tracked words from the Go variable v->node. + // Walk the list and set all the bits. + // For a large struct this could end up being quadratic: + // after the first setting, the outer loop (for z, i) would see a 1 bit + // for all of the remaining words in the struct, and for each such + // word would go through and turn on all the bits again. + // To avoid the quadratic behavior, we only turn on the bits if + // v is the head of the list or if the head's bit is not yet turned on. + // This will set the bits at most twice, keeping the overall loop linear. + v1, _ = v.node.Opt().(*Var) + + if v == v1 || !btest(&cal, uint(v1.id)) { + for ; v1 != nil; v1 = v1.nextinnode { + biset(&cal, uint(v1.id)) + } + } + } + } + + case obj.ATEXT: + for z = 0; z < BITS; z++ { + cal.b[z] = 0 + ref.b[z] = 0 + } + + case obj.ARET: + for z = 0; z < BITS; z++ { + cal.b[z] = externs.b[z] | ovar.b[z] + ref.b[z] = 0 + } + } + + for z = 0; z < BITS; z++ { + ref.b[z] = ref.b[z]&^r1.set.b[z] | r1.use1.b[z] | r1.use2.b[z] + cal.b[z] &^= (r1.set.b[z] | r1.use1.b[z] | r1.use2.b[z]) + r1.refbehind.b[z] = ref.b[z] + r1.calbehind.b[z] = cal.b[z] + } + + if f1.Active != 0 { + break + } + f1.Active = 1 + } + + var r *Reg + var f2 *Flow + for ; f != f1; f = f.P1 { + r = f.Data.(*Reg) + for f2 = f.P2; f2 != nil; f2 = f2.P2link { + prop(f2, r.refbehind, r.calbehind) + } + } +} + +func synch(f *Flow, dif Bits) { + var r1 *Reg + var z int + + for f1 := f; f1 != nil; f1 = f1.S1 { + r1 = f1.Data.(*Reg) + for z = 0; z < BITS; z++ { + dif.b[z] = dif.b[z]&^(^r1.refbehind.b[z]&r1.refahead.b[z]) | r1.set.b[z] | r1.regdiff.b[z] + if dif.b[z] != r1.regdiff.b[z] { + r1.regdiff.b[z] = dif.b[z] + change = 1 + } + } + + if f1.Active != 0 { + break + } + f1.Active = 1 + for z = 0; z < BITS; z++ { + dif.b[z] &^= (^r1.calbehind.b[z] & r1.calahead.b[z]) + } + if f1.S2 != nil { + synch(f1.S2, dif) + } + } +} + +func allreg(b uint64, r *Rgn) uint64 { + v := &vars[r.varno] + r.regno = 0 + switch v.etype { + default: + Fatal("unknown etype %d/%v", Bitno(b), Econv(int(v.etype), 0)) + + case TINT8, + TUINT8, + TINT16, + TUINT16, + TINT32, + TUINT32, + TINT64, + TUINT64, + TINT, + TUINT, + TUINTPTR, + TBOOL, + TPTR32, + TPTR64: + i := Thearch.BtoR(^b) + if i != 0 && r.cost > 0 { + r.regno = int16(i) + return Thearch.RtoB(i) + } + + case TFLOAT32, TFLOAT64: + i := Thearch.BtoF(^b) + if i != 0 && r.cost > 0 { + r.regno = int16(i) + return Thearch.FtoB(i) + } + } + + return 0 +} + +func LOAD(r *Reg, z int) uint64 { + return ^r.refbehind.b[z] & r.refahead.b[z] +} + +func STORE(r *Reg, z int) uint64 { + return ^r.calbehind.b[z] & r.calahead.b[z] +} + +// Cost parameters +const ( + CLOAD = 5 // cost of load + CREF = 5 // cost of reference if not registerized + LOOP = 3 // loop execution count (applied in popt.go) +) + +func paint1(f *Flow, bn int) { + z := bn / 64 + bb := uint64(1 << uint(bn%64)) + r := f.Data.(*Reg) + if r.act.b[z]&bb != 0 { + return + } + var f1 *Flow + var r1 *Reg + for { + if r.refbehind.b[z]&bb == 0 { + break + } + f1 = f.P1 + if f1 == nil { + break + } + r1 = f1.Data.(*Reg) + if r1.refahead.b[z]&bb == 0 { + break + } + if r1.act.b[z]&bb != 0 { + break + } + f = f1 + r = r1 + } + + if LOAD(r, z)&^(r.set.b[z]&^(r.use1.b[z]|r.use2.b[z]))&bb != 0 { + change -= CLOAD * int(f.Loop) + } + + for { + r.act.b[z] |= bb + + if f.Prog.As != obj.ANOP { // don't give credit for NOPs + if r.use1.b[z]&bb != 0 { + change += CREF * int(f.Loop) + } + if (r.use2.b[z]|r.set.b[z])&bb != 0 { + change += CREF * int(f.Loop) + } + } + + if STORE(r, z)&r.regdiff.b[z]&bb != 0 { + change -= CLOAD * int(f.Loop) + } + + if r.refbehind.b[z]&bb != 0 { + for f1 = f.P2; f1 != nil; f1 = f1.P2link { + if (f1.Data.(*Reg)).refahead.b[z]&bb != 0 { + paint1(f1, bn) + } + } + } + + if r.refahead.b[z]&bb == 0 { + break + } + f1 = f.S2 + if f1 != nil { + if (f1.Data.(*Reg)).refbehind.b[z]&bb != 0 { + paint1(f1, bn) + } + } + f = f.S1 + if f == nil { + break + } + r = f.Data.(*Reg) + if r.act.b[z]&bb != 0 { + break + } + if r.refbehind.b[z]&bb == 0 { + break + } + } +} + +func paint2(f *Flow, bn int, depth int) uint64 { + z := bn / 64 + bb := uint64(1 << uint(bn%64)) + vreg := regbits + r := f.Data.(*Reg) + if r.act.b[z]&bb == 0 { + return vreg + } + var r1 *Reg + var f1 *Flow + for { + if r.refbehind.b[z]&bb == 0 { + break + } + f1 = f.P1 + if f1 == nil { + break + } + r1 = f1.Data.(*Reg) + if r1.refahead.b[z]&bb == 0 { + break + } + if r1.act.b[z]&bb == 0 { + break + } + f = f1 + r = r1 + } + + for { + if Debug['R'] != 0 && Debug['v'] != 0 { + fmt.Printf(" paint2 %d %v\n", depth, f.Prog) + } + + r.act.b[z] &^= bb + + vreg |= r.regu + + if r.refbehind.b[z]&bb != 0 { + for f1 = f.P2; f1 != nil; f1 = f1.P2link { + if (f1.Data.(*Reg)).refahead.b[z]&bb != 0 { + vreg |= paint2(f1, bn, depth+1) + } + } + } + + if r.refahead.b[z]&bb == 0 { + break + } + f1 = f.S2 + if f1 != nil { + if (f1.Data.(*Reg)).refbehind.b[z]&bb != 0 { + vreg |= paint2(f1, bn, depth+1) + } + } + f = f.S1 + if f == nil { + break + } + r = f.Data.(*Reg) + if r.act.b[z]&bb == 0 { + break + } + if r.refbehind.b[z]&bb == 0 { + break + } + } + + return vreg +} + +func paint3(f *Flow, bn int, rb uint64, rn int) { + z := bn / 64 + bb := uint64(1 << uint(bn%64)) + r := f.Data.(*Reg) + if r.act.b[z]&bb != 0 { + return + } + var r1 *Reg + var f1 *Flow + for { + if r.refbehind.b[z]&bb == 0 { + break + } + f1 = f.P1 + if f1 == nil { + break + } + r1 = f1.Data.(*Reg) + if r1.refahead.b[z]&bb == 0 { + break + } + if r1.act.b[z]&bb != 0 { + break + } + f = f1 + r = r1 + } + + if LOAD(r, z)&^(r.set.b[z]&^(r.use1.b[z]|r.use2.b[z]))&bb != 0 { + addmove(f, bn, rn, 0) + } + var p *obj.Prog + for { + r.act.b[z] |= bb + p = f.Prog + + if r.use1.b[z]&bb != 0 { + if Debug['R'] != 0 && Debug['v'] != 0 { + fmt.Printf("%v", p) + } + addreg(&p.From, rn) + if Debug['R'] != 0 && Debug['v'] != 0 { + fmt.Printf(" ===change== %v\n", p) + } + } + + if (r.use2.b[z]|r.set.b[z])&bb != 0 { + if Debug['R'] != 0 && Debug['v'] != 0 { + fmt.Printf("%v", p) + } + addreg(&p.To, rn) + if Debug['R'] != 0 && Debug['v'] != 0 { + fmt.Printf(" ===change== %v\n", p) + } + } + + if STORE(r, z)&r.regdiff.b[z]&bb != 0 { + addmove(f, bn, rn, 1) + } + r.regu |= rb + + if r.refbehind.b[z]&bb != 0 { + for f1 = f.P2; f1 != nil; f1 = f1.P2link { + if (f1.Data.(*Reg)).refahead.b[z]&bb != 0 { + paint3(f1, bn, rb, rn) + } + } + } + + if r.refahead.b[z]&bb == 0 { + break + } + f1 = f.S2 + if f1 != nil { + if (f1.Data.(*Reg)).refbehind.b[z]&bb != 0 { + paint3(f1, bn, rb, rn) + } + } + f = f.S1 + if f == nil { + break + } + r = f.Data.(*Reg) + if r.act.b[z]&bb != 0 { + break + } + if r.refbehind.b[z]&bb == 0 { + break + } + } +} + +func addreg(a *obj.Addr, rn int) { + a.Sym = nil + a.Node = nil + a.Offset = 0 + a.Type = obj.TYPE_REG + a.Reg = int16(rn) + a.Name = 0 + + Ostats.Ncvtreg++ +} + +func dumpone(f *Flow, isreg int) { + fmt.Printf("%d:%v", f.Loop, f.Prog) + if isreg != 0 { + r := f.Data.(*Reg) + var bit Bits + for z := 0; z < BITS; z++ { + bit.b[z] = r.set.b[z] | r.use1.b[z] | r.use2.b[z] | r.refbehind.b[z] | r.refahead.b[z] | r.calbehind.b[z] | r.calahead.b[z] | r.regdiff.b[z] | r.act.b[z] | 0 + } + if bany(&bit) { + fmt.Printf("\t") + if bany(&r.set) { + fmt.Printf(" s:%v", &r.set) + } + if bany(&r.use1) { + fmt.Printf(" u1:%v", &r.use1) + } + if bany(&r.use2) { + fmt.Printf(" u2:%v", &r.use2) + } + if bany(&r.refbehind) { + fmt.Printf(" rb:%v ", &r.refbehind) + } + if bany(&r.refahead) { + fmt.Printf(" ra:%v ", &r.refahead) + } + if bany(&r.calbehind) { + fmt.Printf(" cb:%v ", &r.calbehind) + } + if bany(&r.calahead) { + fmt.Printf(" ca:%v ", &r.calahead) + } + if bany(&r.regdiff) { + fmt.Printf(" d:%v ", &r.regdiff) + } + if bany(&r.act) { + fmt.Printf(" a:%v ", &r.act) + } + } + } + + fmt.Printf("\n") +} + +func Dumpit(str string, r0 *Flow, isreg int) { + var r1 *Flow + + fmt.Printf("\n%s\n", str) + for r := r0; r != nil; r = r.Link { + dumpone(r, isreg) + r1 = r.P2 + if r1 != nil { + fmt.Printf("\tpred:") + for ; r1 != nil; r1 = r1.P2link { + fmt.Printf(" %.4d", uint(int(r1.Prog.Pc))) + } + if r.P1 != nil { + fmt.Printf(" (and %.4d)", uint(int(r.P1.Prog.Pc))) + } else { + fmt.Printf(" (only)") + } + fmt.Printf("\n") + } + + // Print successors if it's not just the next one + if r.S1 != r.Link || r.S2 != nil { + fmt.Printf("\tsucc:") + if r.S1 != nil { + fmt.Printf(" %.4d", uint(int(r.S1.Prog.Pc))) + } + if r.S2 != nil { + fmt.Printf(" %.4d", uint(int(r.S2.Prog.Pc))) + } + fmt.Printf("\n") + } + } +} + +func regopt(firstp *obj.Prog) { + mergetemp(firstp) + + /* + * control flow is more complicated in generated go code + * than in generated c code. define pseudo-variables for + * registers, so we have complete register usage information. + */ + var nreg int + regnames := Thearch.Regnames(&nreg) + + nvar = nreg + for i := 0; i < nreg; i++ { + vars[i] = Var{} + } + for i := 0; i < nreg; i++ { + if regnodes[i] == nil { + regnodes[i] = newname(Lookup(regnames[i])) + } + vars[i].node = regnodes[i] + } + + regbits = Thearch.Excludedregs() + externs = zbits + params = zbits + consts = zbits + addrs = zbits + ivar = zbits + ovar = zbits + + /* + * pass 1 + * build aux data structure + * allocate pcs + * find use and set of variables + */ + g := Flowstart(firstp, func() interface{} { return new(Reg) }) + if g == nil { + for i := 0; i < nvar; i++ { + vars[i].node.SetOpt(nil) + } + return + } + + firstf := g.Start + + for f := firstf; f != nil; f = f.Link { + p := f.Prog + if p.As == obj.AVARDEF || p.As == obj.AVARKILL { + continue + } + + // Avoid making variables for direct-called functions. + if p.As == obj.ACALL && p.To.Type == obj.TYPE_MEM && p.To.Name == obj.NAME_EXTERN { + continue + } + + // from vs to doesn't matter for registers. + r := f.Data.(*Reg) + r.use1.b[0] |= p.Info.Reguse | p.Info.Regindex + r.set.b[0] |= p.Info.Regset + + bit := mkvar(f, &p.From) + if bany(&bit) { + if p.Info.Flags&LeftAddr != 0 { + setaddrs(bit) + } + if p.Info.Flags&LeftRead != 0 { + for z := 0; z < BITS; z++ { + r.use1.b[z] |= bit.b[z] + } + } + if p.Info.Flags&LeftWrite != 0 { + for z := 0; z < BITS; z++ { + r.set.b[z] |= bit.b[z] + } + } + } + + // Compute used register for reg + if p.Info.Flags&RegRead != 0 { + r.use1.b[0] |= Thearch.RtoB(int(p.Reg)) + } + + // Currently we never generate three register forms. + // If we do, this will need to change. + if p.From3Type() != obj.TYPE_NONE { + Fatal("regopt not implemented for from3") + } + + bit = mkvar(f, &p.To) + if bany(&bit) { + if p.Info.Flags&RightAddr != 0 { + setaddrs(bit) + } + if p.Info.Flags&RightRead != 0 { + for z := 0; z < BITS; z++ { + r.use2.b[z] |= bit.b[z] + } + } + if p.Info.Flags&RightWrite != 0 { + for z := 0; z < BITS; z++ { + r.set.b[z] |= bit.b[z] + } + } + } + } + + for i := 0; i < nvar; i++ { + v := &vars[i] + if v.addr != 0 { + bit := blsh(uint(i)) + for z := 0; z < BITS; z++ { + addrs.b[z] |= bit.b[z] + } + } + + if Debug['R'] != 0 && Debug['v'] != 0 { + fmt.Printf("bit=%2d addr=%d et=%v w=%-2d s=%v + %d\n", i, v.addr, Econv(int(v.etype), 0), v.width, v.node, v.offset) + } + } + + if Debug['R'] != 0 && Debug['v'] != 0 { + Dumpit("pass1", firstf, 1) + } + + /* + * pass 2 + * find looping structure + */ + flowrpo(g) + + if Debug['R'] != 0 && Debug['v'] != 0 { + Dumpit("pass2", firstf, 1) + } + + /* + * pass 2.5 + * iterate propagating fat vardef covering forward + * r->act records vars with a VARDEF since the last CALL. + * (r->act will be reused in pass 5 for something else, + * but we'll be done with it by then.) + */ + active := 0 + + for f := firstf; f != nil; f = f.Link { + f.Active = 0 + r := f.Data.(*Reg) + r.act = zbits + } + + for f := firstf; f != nil; f = f.Link { + p := f.Prog + if p.As == obj.AVARDEF && Isfat(((p.To.Node).(*Node)).Type) && ((p.To.Node).(*Node)).Opt() != nil { + active++ + walkvardef(p.To.Node.(*Node), f, active) + } + } + + /* + * pass 3 + * iterate propagating usage + * back until flow graph is complete + */ + var f1 *Flow + var i int + var f *Flow +loop1: + change = 0 + + for f = firstf; f != nil; f = f.Link { + f.Active = 0 + } + for f = firstf; f != nil; f = f.Link { + if f.Prog.As == obj.ARET { + prop(f, zbits, zbits) + } + } + + /* pick up unreachable code */ +loop11: + i = 0 + + for f = firstf; f != nil; f = f1 { + f1 = f.Link + if f1 != nil && f1.Active != 0 && f.Active == 0 { + prop(f, zbits, zbits) + i = 1 + } + } + + if i != 0 { + goto loop11 + } + if change != 0 { + goto loop1 + } + + if Debug['R'] != 0 && Debug['v'] != 0 { + Dumpit("pass3", firstf, 1) + } + + /* + * pass 4 + * iterate propagating register/variable synchrony + * forward until graph is complete + */ +loop2: + change = 0 + + for f = firstf; f != nil; f = f.Link { + f.Active = 0 + } + synch(firstf, zbits) + if change != 0 { + goto loop2 + } + + if Debug['R'] != 0 && Debug['v'] != 0 { + Dumpit("pass4", firstf, 1) + } + + /* + * pass 4.5 + * move register pseudo-variables into regu. + */ + mask := uint64((1 << uint(nreg)) - 1) + for f := firstf; f != nil; f = f.Link { + r := f.Data.(*Reg) + r.regu = (r.refbehind.b[0] | r.set.b[0]) & mask + r.set.b[0] &^= mask + r.use1.b[0] &^= mask + r.use2.b[0] &^= mask + r.refbehind.b[0] &^= mask + r.refahead.b[0] &^= mask + r.calbehind.b[0] &^= mask + r.calahead.b[0] &^= mask + r.regdiff.b[0] &^= mask + r.act.b[0] &^= mask + } + + if Debug['R'] != 0 && Debug['v'] != 0 { + Dumpit("pass4.5", firstf, 1) + } + + /* + * pass 5 + * isolate regions + * calculate costs (paint1) + */ + var bit Bits + if f := firstf; f != nil { + r := f.Data.(*Reg) + for z := 0; z < BITS; z++ { + bit.b[z] = (r.refahead.b[z] | r.calahead.b[z]) &^ (externs.b[z] | params.b[z] | addrs.b[z] | consts.b[z]) + } + if bany(&bit) && f.Refset == 0 { + // should never happen - all variables are preset + if Debug['w'] != 0 { + fmt.Printf("%v: used and not set: %v\n", f.Prog.Line(), &bit) + } + f.Refset = 1 + } + } + + for f := firstf; f != nil; f = f.Link { + (f.Data.(*Reg)).act = zbits + } + nregion = 0 + region = region[:0] + var rgp *Rgn + for f := firstf; f != nil; f = f.Link { + r := f.Data.(*Reg) + for z := 0; z < BITS; z++ { + bit.b[z] = r.set.b[z] &^ (r.refahead.b[z] | r.calahead.b[z] | addrs.b[z]) + } + if bany(&bit) && f.Refset == 0 { + if Debug['w'] != 0 { + fmt.Printf("%v: set and not used: %v\n", f.Prog.Line(), &bit) + } + f.Refset = 1 + Thearch.Excise(f) + } + + for z := 0; z < BITS; z++ { + bit.b[z] = LOAD(r, z) &^ (r.act.b[z] | addrs.b[z]) + } + for bany(&bit) { + i = bnum(bit) + change = 0 + paint1(f, i) + biclr(&bit, uint(i)) + if change <= 0 { + continue + } + if nregion >= MaxRgn { + nregion++ + continue + } + + region = append(region, Rgn{ + enter: f, + cost: int16(change), + varno: int16(i), + }) + nregion++ + } + } + + if false && Debug['v'] != 0 && strings.Contains(Curfn.Func.Nname.Sym.Name, "Parse") { + Warn("regions: %d\n", nregion) + } + if nregion >= MaxRgn { + if Debug['v'] != 0 { + Warn("too many regions: %d\n", nregion) + } + nregion = MaxRgn + } + + sort.Sort(rcmp(region[:nregion])) + + if Debug['R'] != 0 && Debug['v'] != 0 { + Dumpit("pass5", firstf, 1) + } + + /* + * pass 6 + * determine used registers (paint2) + * replace code (paint3) + */ + if Debug['R'] != 0 && Debug['v'] != 0 { + fmt.Printf("\nregisterizing\n") + } + var usedreg uint64 + var vreg uint64 + for i := 0; i < nregion; i++ { + rgp = ®ion[i] + if Debug['R'] != 0 && Debug['v'] != 0 { + fmt.Printf("region %d: cost %d varno %d enter %d\n", i, rgp.cost, rgp.varno, rgp.enter.Prog.Pc) + } + bit = blsh(uint(rgp.varno)) + usedreg = paint2(rgp.enter, int(rgp.varno), 0) + vreg = allreg(usedreg, rgp) + if rgp.regno != 0 { + if Debug['R'] != 0 && Debug['v'] != 0 { + v := &vars[rgp.varno] + fmt.Printf("registerize %v+%d (bit=%2d et=%v) in %v usedreg=%#x vreg=%#x\n", v.node, v.offset, rgp.varno, Econv(int(v.etype), 0), obj.Rconv(int(rgp.regno)), usedreg, vreg) + } + + paint3(rgp.enter, int(rgp.varno), vreg, int(rgp.regno)) + } + } + + /* + * free aux structures. peep allocates new ones. + */ + for i := 0; i < nvar; i++ { + vars[i].node.SetOpt(nil) + } + Flowend(g) + firstf = nil + + if Debug['R'] != 0 && Debug['v'] != 0 { + // Rebuild flow graph, since we inserted instructions + g := Flowstart(firstp, nil) + firstf = g.Start + Dumpit("pass6", firstf, 0) + Flowend(g) + firstf = nil + } + + /* + * pass 7 + * peep-hole on basic block + */ + if Debug['R'] == 0 || Debug['P'] != 0 { + Thearch.Peep(firstp) + } + + /* + * eliminate nops + */ + for p := firstp; p != nil; p = p.Link { + for p.Link != nil && p.Link.As == obj.ANOP { + p.Link = p.Link.Link + } + if p.To.Type == obj.TYPE_BRANCH { + for p.To.Val.(*obj.Prog) != nil && p.To.Val.(*obj.Prog).As == obj.ANOP { + p.To.Val = p.To.Val.(*obj.Prog).Link + } + } + } + + if Debug['R'] != 0 { + if Ostats.Ncvtreg != 0 || Ostats.Nspill != 0 || Ostats.Nreload != 0 || Ostats.Ndelmov != 0 || Ostats.Nvar != 0 || Ostats.Naddr != 0 || false { + fmt.Printf("\nstats\n") + } + + if Ostats.Ncvtreg != 0 { + fmt.Printf("\t%4d cvtreg\n", Ostats.Ncvtreg) + } + if Ostats.Nspill != 0 { + fmt.Printf("\t%4d spill\n", Ostats.Nspill) + } + if Ostats.Nreload != 0 { + fmt.Printf("\t%4d reload\n", Ostats.Nreload) + } + if Ostats.Ndelmov != 0 { + fmt.Printf("\t%4d delmov\n", Ostats.Ndelmov) + } + if Ostats.Nvar != 0 { + fmt.Printf("\t%4d var\n", Ostats.Nvar) + } + if Ostats.Naddr != 0 { + fmt.Printf("\t%4d addr\n", Ostats.Naddr) + } + + Ostats = OptStats{} + } +} + +// bany reports whether any bits in a are set. +func bany(a *Bits) bool { + for _, x := range &a.b { // & to avoid making a copy of a.b + if x != 0 { + return true + } + } + return false +} + +// bnum reports the lowest index of a 1 bit in a. +func bnum(a Bits) int { + for i, x := range &a.b { // & to avoid making a copy of a.b + if x != 0 { + return 64*i + Bitno(x) + } + } + + Fatal("bad in bnum") + return 0 +} + +// blsh returns a Bits with 1 at index n, 0 elsewhere (1<>= 32 + } + if b&(1<<16-1) == 0 { + n += 16 + b >>= 16 + } + if b&(1<<8-1) == 0 { + n += 8 + b >>= 8 + } + if b&(1<<4-1) == 0 { + n += 4 + b >>= 4 + } + if b&(1<<2-1) == 0 { + n += 2 + b >>= 2 + } + if b&1 == 0 { + n++ + } + return n +} + +// String returns a space-separated list of the variables represented by bits. +func (bits Bits) String() string { + // Note: This method takes a value receiver, both for convenience + // and to make it safe to modify the bits as we process them. + // Even so, most prints above use &bits, because then the value + // being stored in the interface{} is a pointer and does not require + // an allocation and copy to create the interface{}. + var buf bytes.Buffer + sep := "" + for bany(&bits) { + i := bnum(bits) + buf.WriteString(sep) + sep = " " + v := &vars[i] + if v.node == nil || v.node.Sym == nil { + fmt.Fprintf(&buf, "$%d", i) + } else { + fmt.Fprintf(&buf, "%s(%d)", v.node.Sym.Name, i) + if v.offset != 0 { + fmt.Fprintf(&buf, "%+d", int64(v.offset)) + } + } + biclr(&bits, uint(i)) + } + return buf.String() +} diff --git a/src/cmd/compile/internal/gc/select.go b/src/cmd/compile/internal/gc/select.go new file mode 100644 index 0000000000000000000000000000000000000000..db2077883751cbd309f8af4237d6968f5adbe4d0 --- /dev/null +++ b/src/cmd/compile/internal/gc/select.go @@ -0,0 +1,369 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package gc + +/* + * select + */ +func typecheckselect(sel *Node) { + var ncase *Node + var n *Node + + var def *Node + lno := int(setlineno(sel)) + count := 0 + typechecklist(sel.Ninit, Etop) + for l := sel.List; l != nil; l = l.Next { + count++ + ncase = l.N + setlineno(ncase) + if ncase.Op != OXCASE { + Fatal("typecheckselect %v", Oconv(int(ncase.Op), 0)) + } + + if ncase.List == nil { + // default + if def != nil { + Yyerror("multiple defaults in select (first at %v)", def.Line()) + } else { + def = ncase + } + } else if ncase.List.Next != nil { + Yyerror("select cases cannot be lists") + } else { + n = typecheck(&ncase.List.N, Etop) + ncase.Left = n + ncase.List = nil + setlineno(n) + switch n.Op { + default: + Yyerror("select case must be receive, send or assign recv") + + // convert x = <-c into OSELRECV(x, <-c). + // remove implicit conversions; the eventual assignment + // will reintroduce them. + case OAS: + if (n.Right.Op == OCONVNOP || n.Right.Op == OCONVIFACE) && n.Right.Implicit { + n.Right = n.Right.Left + } + + if n.Right.Op != ORECV { + Yyerror("select assignment must have receive on right hand side") + break + } + + n.Op = OSELRECV + + // convert x, ok = <-c into OSELRECV2(x, <-c) with ntest=ok + case OAS2RECV: + if n.Rlist.N.Op != ORECV { + Yyerror("select assignment must have receive on right hand side") + break + } + + n.Op = OSELRECV2 + n.Left = n.List.N + n.List = list1(n.List.Next.N) + n.Right = n.Rlist.N + n.Rlist = nil + + // convert <-c into OSELRECV(N, <-c) + case ORECV: + n = Nod(OSELRECV, nil, n) + + n.Typecheck = 1 + ncase.Left = n + + case OSEND: + break + } + } + + typechecklist(ncase.Nbody, Etop) + } + + sel.Xoffset = int64(count) + lineno = int32(lno) +} + +func walkselect(sel *Node) { + if sel.List == nil && sel.Xoffset != 0 { + Fatal("double walkselect") // already rewrote + } + + lno := int(setlineno(sel)) + i := count(sel.List) + + // optimization: zero-case select + var init *NodeList + var r *Node + var n *Node + var var_ *Node + var selv *Node + var cas *Node + if i == 0 { + sel.Nbody = list1(mkcall("block", nil, nil)) + goto out + } + + // optimization: one-case select: single op. + // TODO(rsc): Reenable optimization once order.c can handle it. + // golang.org/issue/7672. + if i == 1 { + cas := sel.List.N + setlineno(cas) + l := cas.Ninit + if cas.Left != nil { // not default: + n := cas.Left + l = concat(l, n.Ninit) + n.Ninit = nil + var ch *Node + switch n.Op { + default: + Fatal("select %v", Oconv(int(n.Op), 0)) + + // ok already + case OSEND: + ch = n.Left + + case OSELRECV, OSELRECV2: + ch = n.Right.Left + if n.Op == OSELRECV || n.List == nil { + if n.Left == nil { + n = n.Right + } else { + n.Op = OAS + } + break + } + + if n.Left == nil { + typecheck(&nblank, Erv|Easgn) + n.Left = nblank + } + + n.Op = OAS2 + n.List = concat(list1(n.Left), n.List) + n.Rlist = list1(n.Right) + n.Right = nil + n.Left = nil + n.Typecheck = 0 + typecheck(&n, Etop) + } + + // if ch == nil { block() }; n; + a := Nod(OIF, nil, nil) + + a.Left = Nod(OEQ, ch, nodnil()) + a.Nbody = list1(mkcall("block", nil, &l)) + typecheck(&a, Etop) + l = list(l, a) + l = list(l, n) + } + + l = concat(l, cas.Nbody) + sel.Nbody = l + goto out + } + + // convert case value arguments to addresses. + // this rewrite is used by both the general code and the next optimization. + for l := sel.List; l != nil; l = l.Next { + cas = l.N + setlineno(cas) + n = cas.Left + if n == nil { + continue + } + switch n.Op { + case OSEND: + n.Right = Nod(OADDR, n.Right, nil) + typecheck(&n.Right, Erv) + + case OSELRECV, OSELRECV2: + if n.Op == OSELRECV2 && n.List == nil { + n.Op = OSELRECV + } + if n.Op == OSELRECV2 { + n.List.N = Nod(OADDR, n.List.N, nil) + typecheck(&n.List.N, Erv) + } + + if n.Left == nil { + n.Left = nodnil() + } else { + n.Left = Nod(OADDR, n.Left, nil) + typecheck(&n.Left, Erv) + } + } + } + + // optimization: two-case select but one is default: single non-blocking op. + if i == 2 && (sel.List.N.Left == nil || sel.List.Next.N.Left == nil) { + var cas *Node + var dflt *Node + if sel.List.N.Left == nil { + cas = sel.List.Next.N + dflt = sel.List.N + } else { + dflt = sel.List.Next.N + cas = sel.List.N + } + + n := cas.Left + setlineno(n) + r := Nod(OIF, nil, nil) + r.Ninit = cas.Ninit + switch n.Op { + default: + Fatal("select %v", Oconv(int(n.Op), 0)) + + // if selectnbsend(c, v) { body } else { default body } + case OSEND: + ch := n.Left + + r.Left = mkcall1(chanfn("selectnbsend", 2, ch.Type), Types[TBOOL], &r.Ninit, typename(ch.Type), ch, n.Right) + + // if c != nil && selectnbrecv(&v, c) { body } else { default body } + case OSELRECV: + r = Nod(OIF, nil, nil) + + r.Ninit = cas.Ninit + ch := n.Right.Left + r.Left = mkcall1(chanfn("selectnbrecv", 2, ch.Type), Types[TBOOL], &r.Ninit, typename(ch.Type), n.Left, ch) + + // if c != nil && selectnbrecv2(&v, c) { body } else { default body } + case OSELRECV2: + r = Nod(OIF, nil, nil) + + r.Ninit = cas.Ninit + ch := n.Right.Left + r.Left = mkcall1(chanfn("selectnbrecv2", 2, ch.Type), Types[TBOOL], &r.Ninit, typename(ch.Type), n.Left, n.List.N, ch) + } + + typecheck(&r.Left, Erv) + r.Nbody = cas.Nbody + r.Rlist = concat(dflt.Ninit, dflt.Nbody) + sel.Nbody = list1(r) + goto out + } + + init = sel.Ninit + sel.Ninit = nil + + // generate sel-struct + setlineno(sel) + + selv = temp(selecttype(int32(sel.Xoffset))) + r = Nod(OAS, selv, nil) + typecheck(&r, Etop) + init = list(init, r) + var_ = conv(conv(Nod(OADDR, selv, nil), Types[TUNSAFEPTR]), Ptrto(Types[TUINT8])) + r = mkcall("newselect", nil, nil, var_, Nodintconst(selv.Type.Width), Nodintconst(sel.Xoffset)) + typecheck(&r, Etop) + init = list(init, r) + + // register cases + for l := sel.List; l != nil; l = l.Next { + cas = l.N + setlineno(cas) + n = cas.Left + r = Nod(OIF, nil, nil) + r.Ninit = cas.Ninit + cas.Ninit = nil + if n != nil { + r.Ninit = concat(r.Ninit, n.Ninit) + n.Ninit = nil + } + + if n == nil { + // selectdefault(sel *byte); + r.Left = mkcall("selectdefault", Types[TBOOL], &r.Ninit, var_) + } else { + switch n.Op { + default: + Fatal("select %v", Oconv(int(n.Op), 0)) + + // selectsend(sel *byte, hchan *chan any, elem *any) (selected bool); + case OSEND: + r.Left = mkcall1(chanfn("selectsend", 2, n.Left.Type), Types[TBOOL], &r.Ninit, var_, n.Left, n.Right) + + // selectrecv(sel *byte, hchan *chan any, elem *any) (selected bool); + case OSELRECV: + r.Left = mkcall1(chanfn("selectrecv", 2, n.Right.Left.Type), Types[TBOOL], &r.Ninit, var_, n.Right.Left, n.Left) + + // selectrecv2(sel *byte, hchan *chan any, elem *any, received *bool) (selected bool); + case OSELRECV2: + r.Left = mkcall1(chanfn("selectrecv2", 2, n.Right.Left.Type), Types[TBOOL], &r.Ninit, var_, n.Right.Left, n.Left, n.List.N) + } + } + + // selv is no longer alive after use. + r.Nbody = list(r.Nbody, Nod(OVARKILL, selv, nil)) + + r.Nbody = concat(r.Nbody, cas.Nbody) + r.Nbody = list(r.Nbody, Nod(OBREAK, nil, nil)) + init = list(init, r) + } + + // run the select + setlineno(sel) + + init = list(init, mkcall("selectgo", nil, nil, var_)) + sel.Nbody = init + +out: + sel.List = nil + walkstmtlist(sel.Nbody) + lineno = int32(lno) +} + +// Keep in sync with src/runtime/runtime2.go and src/runtime/select.go. +func selecttype(size int32) *Type { + // TODO(dvyukov): it's possible to generate SudoG and Scase only once + // and then cache; and also cache Select per size. + sudog := Nod(OTSTRUCT, nil, nil) + + sudog.List = list(sudog.List, Nod(ODCLFIELD, newname(Lookup("g")), typenod(Ptrto(Types[TUINT8])))) + sudog.List = list(sudog.List, Nod(ODCLFIELD, newname(Lookup("selectdone")), typenod(Ptrto(Types[TUINT8])))) + sudog.List = list(sudog.List, Nod(ODCLFIELD, newname(Lookup("next")), typenod(Ptrto(Types[TUINT8])))) + sudog.List = list(sudog.List, Nod(ODCLFIELD, newname(Lookup("prev")), typenod(Ptrto(Types[TUINT8])))) + sudog.List = list(sudog.List, Nod(ODCLFIELD, newname(Lookup("elem")), typenod(Ptrto(Types[TUINT8])))) + sudog.List = list(sudog.List, Nod(ODCLFIELD, newname(Lookup("releasetime")), typenod(Types[TUINT64]))) + sudog.List = list(sudog.List, Nod(ODCLFIELD, newname(Lookup("nrelease")), typenod(Types[TINT32]))) + sudog.List = list(sudog.List, Nod(ODCLFIELD, newname(Lookup("waitlink")), typenod(Ptrto(Types[TUINT8])))) + typecheck(&sudog, Etype) + sudog.Type.Noalg = 1 + sudog.Type.Local = true + + scase := Nod(OTSTRUCT, nil, nil) + scase.List = list(scase.List, Nod(ODCLFIELD, newname(Lookup("elem")), typenod(Ptrto(Types[TUINT8])))) + scase.List = list(scase.List, Nod(ODCLFIELD, newname(Lookup("chan")), typenod(Ptrto(Types[TUINT8])))) + scase.List = list(scase.List, Nod(ODCLFIELD, newname(Lookup("pc")), typenod(Types[TUINTPTR]))) + scase.List = list(scase.List, Nod(ODCLFIELD, newname(Lookup("kind")), typenod(Types[TUINT16]))) + scase.List = list(scase.List, Nod(ODCLFIELD, newname(Lookup("so")), typenod(Types[TUINT16]))) + scase.List = list(scase.List, Nod(ODCLFIELD, newname(Lookup("receivedp")), typenod(Ptrto(Types[TUINT8])))) + scase.List = list(scase.List, Nod(ODCLFIELD, newname(Lookup("releasetime")), typenod(Types[TUINT64]))) + typecheck(&scase, Etype) + scase.Type.Noalg = 1 + scase.Type.Local = true + + sel := Nod(OTSTRUCT, nil, nil) + sel.List = list(sel.List, Nod(ODCLFIELD, newname(Lookup("tcase")), typenod(Types[TUINT16]))) + sel.List = list(sel.List, Nod(ODCLFIELD, newname(Lookup("ncase")), typenod(Types[TUINT16]))) + sel.List = list(sel.List, Nod(ODCLFIELD, newname(Lookup("pollorder")), typenod(Ptrto(Types[TUINT8])))) + sel.List = list(sel.List, Nod(ODCLFIELD, newname(Lookup("lockorder")), typenod(Ptrto(Types[TUINT8])))) + arr := Nod(OTARRAY, Nodintconst(int64(size)), scase) + sel.List = list(sel.List, Nod(ODCLFIELD, newname(Lookup("scase")), arr)) + arr = Nod(OTARRAY, Nodintconst(int64(size)), typenod(Ptrto(Types[TUINT8]))) + sel.List = list(sel.List, Nod(ODCLFIELD, newname(Lookup("lockorderarr")), arr)) + arr = Nod(OTARRAY, Nodintconst(int64(size)), typenod(Types[TUINT16])) + sel.List = list(sel.List, Nod(ODCLFIELD, newname(Lookup("pollorderarr")), arr)) + typecheck(&sel, Etype) + sel.Type.Noalg = 1 + sel.Type.Local = true + + return sel.Type +} diff --git a/src/cmd/compile/internal/gc/sinit.go b/src/cmd/compile/internal/gc/sinit.go new file mode 100644 index 0000000000000000000000000000000000000000..0ced4ef3b0928bf3cd97fe98db2f5f4a24e2e5b6 --- /dev/null +++ b/src/cmd/compile/internal/gc/sinit.go @@ -0,0 +1,1551 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package gc + +import ( + "cmd/internal/obj" + "fmt" +) + +/* + * static initialization + */ +const ( + InitNotStarted = 0 + InitDone = 1 + InitPending = 2 +) + +var ( + initlist *NodeList + initplans map[*Node]*InitPlan + inittemps = make(map[*Node]*Node) +) + +// init1 walks the AST starting at n, and accumulates in out +// the list of definitions needing init code in dependency order. +func init1(n *Node, out **NodeList) { + if n == nil { + return + } + init1(n.Left, out) + init1(n.Right, out) + for l := n.List; l != nil; l = l.Next { + init1(l.N, out) + } + + if n.Left != nil && n.Type != nil && n.Left.Op == OTYPE && n.Class == PFUNC { + // Methods called as Type.Method(receiver, ...). + // Definitions for method expressions are stored in type->nname. + init1(n.Type.Nname, out) + } + + if n.Op != ONAME { + return + } + switch n.Class { + case PEXTERN, PFUNC: + break + + default: + if isblank(n) && n.Name.Curfn == nil && n.Name.Defn != nil && n.Name.Defn.Initorder == InitNotStarted { + // blank names initialization is part of init() but not + // when they are inside a function. + break + } + + return + } + + if n.Initorder == InitDone { + return + } + if n.Initorder == InitPending { + // Since mutually recursive sets of functions are allowed, + // we don't necessarily raise an error if n depends on a node + // which is already waiting for its dependencies to be visited. + // + // initlist contains a cycle of identifiers referring to each other. + // If this cycle contains a variable, then this variable refers to itself. + // Conversely, if there exists an initialization cycle involving + // a variable in the program, the tree walk will reach a cycle + // involving that variable. + var nv *Node + if n.Class != PFUNC { + nv = n + goto foundinitloop + } + + for l := initlist; l.N != n; l = l.Next { + if l.N.Class != PFUNC { + nv = l.N + goto foundinitloop + } + } + + // The loop involves only functions, ok. + return + + // if there have already been errors printed, + // those errors probably confused us and + // there might not be a loop. let the user + // fix those first. + foundinitloop: + Flusherrors() + + if nerrors > 0 { + errorexit() + } + + // There is a loop involving nv. We know about + // n and initlist = n1 <- ... <- nv <- ... <- n <- ... + fmt.Printf("%v: initialization loop:\n", nv.Line()) + + // Build back pointers in initlist. + for l := initlist; l != nil; l = l.Next { + if l.Next != nil { + l.Next.End = l + } + } + + // Print nv -> ... -> n1 -> n. + var l *NodeList + for l = initlist; l.N != nv; l = l.Next { + } + for ; l != nil; l = l.End { + fmt.Printf("\t%v %v refers to\n", l.N.Line(), l.N.Sym) + } + + // Print n -> ... -> nv. + for l = initlist; l.N != n; l = l.Next { + } + for ; l.N != nv; l = l.End { + fmt.Printf("\t%v %v refers to\n", l.N.Line(), l.N.Sym) + } + fmt.Printf("\t%v %v\n", nv.Line(), nv.Sym) + errorexit() + } + + // reached a new unvisited node. + n.Initorder = InitPending + + l := new(NodeList) + if l == nil { + Flusherrors() + Yyerror("out of memory") + errorexit() + } + + l.Next = initlist + l.N = n + l.End = nil + initlist = l + + // make sure that everything n depends on is initialized. + // n->defn is an assignment to n + if defn := n.Name.Defn; defn != nil { + switch defn.Op { + default: + goto bad + + case ODCLFUNC: + init2list(defn.Nbody, out) + + case OAS: + if defn.Left != n { + goto bad + } + if isblank(defn.Left) && candiscard(defn.Right) { + defn.Op = OEMPTY + defn.Left = nil + defn.Right = nil + break + } + + init2(defn.Right, out) + if Debug['j'] != 0 { + fmt.Printf("%v\n", n.Sym) + } + if isblank(n) || !staticinit(n, out) { + if Debug['%'] != 0 { + Dump("nonstatic", defn) + } + *out = list(*out, defn) + } + + case OAS2FUNC, OAS2MAPR, OAS2DOTTYPE, OAS2RECV: + if defn.Initorder != InitNotStarted { + break + } + defn.Initorder = InitDone + for l := defn.Rlist; l != nil; l = l.Next { + init1(l.N, out) + } + if Debug['%'] != 0 { + Dump("nonstatic", defn) + } + *out = list(*out, defn) + } + } + + l = initlist + initlist = l.Next + if l.N != n { + Fatal("bad initlist") + } + + n.Initorder = InitDone + return + +bad: + Dump("defn", n.Name.Defn) + Fatal("init1: bad defn") +} + +// recurse over n, doing init1 everywhere. +func init2(n *Node, out **NodeList) { + if n == nil || n.Initorder == InitDone { + return + } + + if n.Op == ONAME && n.Ninit != nil { + Fatal("name %v with ninit: %v\n", n.Sym, Nconv(n, obj.FmtSign)) + } + + init1(n, out) + init2(n.Left, out) + init2(n.Right, out) + init2list(n.Ninit, out) + init2list(n.List, out) + init2list(n.Rlist, out) + init2list(n.Nbody, out) + + if n.Op == OCLOSURE { + init2list(n.Func.Closure.Nbody, out) + } + if n.Op == ODOTMETH || n.Op == OCALLPART { + init2(n.Type.Nname, out) + } +} + +func init2list(l *NodeList, out **NodeList) { + for ; l != nil; l = l.Next { + init2(l.N, out) + } +} + +func initreorder(l *NodeList, out **NodeList) { + var n *Node + + for ; l != nil; l = l.Next { + n = l.N + switch n.Op { + case ODCLFUNC, ODCLCONST, ODCLTYPE: + continue + } + + initreorder(n.Ninit, out) + n.Ninit = nil + init1(n, out) + } +} + +// initfix computes initialization order for a list l of top-level +// declarations and outputs the corresponding list of statements +// to include in the init() function body. +func initfix(l *NodeList) *NodeList { + var lout *NodeList + initplans = make(map[*Node]*InitPlan) + lno := int(lineno) + initreorder(l, &lout) + lineno = int32(lno) + initplans = nil + return lout +} + +/* + * compilation of top-level (static) assignments + * into DATA statements if at all possible. + */ +func staticinit(n *Node, out **NodeList) bool { + if n.Op != ONAME || n.Class != PEXTERN || n.Name.Defn == nil || n.Name.Defn.Op != OAS { + Fatal("staticinit") + } + + lineno = n.Lineno + l := n.Name.Defn.Left + r := n.Name.Defn.Right + return staticassign(l, r, out) +} + +// like staticassign but we are copying an already +// initialized value r. +func staticcopy(l *Node, r *Node, out **NodeList) bool { + if r.Op != ONAME { + return false + } + if r.Class == PFUNC { + gdata(l, r, Widthptr) + return true + } + if r.Class != PEXTERN || r.Sym.Pkg != localpkg { + return false + } + if r.Name.Defn == nil { // probably zeroed but perhaps supplied externally and of unknown value + return false + } + if r.Name.Defn.Op != OAS { + return false + } + orig := r + r = r.Name.Defn.Right + + for r.Op == OCONVNOP { + r = r.Left + } + + switch r.Op { + case ONAME: + if staticcopy(l, r, out) { + return true + } + *out = list(*out, Nod(OAS, l, r)) + return true + + case OLITERAL: + if iszero(r) { + return true + } + gdata(l, r, int(l.Type.Width)) + return true + + case OADDR: + switch r.Left.Op { + case ONAME: + gdata(l, r, int(l.Type.Width)) + return true + } + + case OPTRLIT: + switch r.Left.Op { + //dump("not static addr", r); + default: + break + + // copy pointer + case OARRAYLIT, OSTRUCTLIT, OMAPLIT: + gdata(l, Nod(OADDR, inittemps[r], nil), int(l.Type.Width)) + + return true + } + + case OARRAYLIT: + if Isslice(r.Type) { + // copy slice + a := inittemps[r] + + n1 := *l + n1.Xoffset = l.Xoffset + int64(Array_array) + gdata(&n1, Nod(OADDR, a, nil), Widthptr) + n1.Xoffset = l.Xoffset + int64(Array_nel) + gdata(&n1, r.Right, Widthint) + n1.Xoffset = l.Xoffset + int64(Array_cap) + gdata(&n1, r.Right, Widthint) + return true + } + fallthrough + + // fall through + case OSTRUCTLIT: + p := initplans[r] + + n1 := *l + var e *InitEntry + var ll *Node + var rr *Node + for i := 0; i < len(p.E); i++ { + e = &p.E[i] + n1.Xoffset = l.Xoffset + e.Xoffset + n1.Type = e.Expr.Type + if e.Expr.Op == OLITERAL { + gdata(&n1, e.Expr, int(n1.Type.Width)) + } else { + ll = Nod(OXXX, nil, nil) + *ll = n1 + ll.Orig = ll // completely separate copy + if !staticassign(ll, e.Expr, out) { + // Requires computation, but we're + // copying someone else's computation. + rr = Nod(OXXX, nil, nil) + + *rr = *orig + rr.Orig = rr // completely separate copy + rr.Type = ll.Type + rr.Xoffset += e.Xoffset + setlineno(rr) + *out = list(*out, Nod(OAS, ll, rr)) + } + } + } + + return true + } + + return false +} + +func staticassign(l *Node, r *Node, out **NodeList) bool { + var n1 Node + + for r.Op == OCONVNOP { + r = r.Left + } + + switch r.Op { + //dump("not static", r); + default: + break + + case ONAME: + return staticcopy(l, r, out) + + case OLITERAL: + if iszero(r) { + return true + } + gdata(l, r, int(l.Type.Width)) + return true + + case OADDR: + var nam Node + if stataddr(&nam, r.Left) { + n1 := *r + n1.Left = &nam + gdata(l, &n1, int(l.Type.Width)) + return true + } + fallthrough + + case OPTRLIT: + switch r.Left.Op { + //dump("not static ptrlit", r); + default: + break + + // Init pointer. + case OARRAYLIT, OMAPLIT, OSTRUCTLIT: + a := staticname(r.Left.Type, 1) + + inittemps[r] = a + gdata(l, Nod(OADDR, a, nil), int(l.Type.Width)) + + // Init underlying literal. + if !staticassign(a, r.Left, out) { + *out = list(*out, Nod(OAS, a, r.Left)) + } + return true + } + + case OSTRARRAYBYTE: + if l.Class == PEXTERN && r.Left.Op == OLITERAL { + sval := r.Left.Val().U.(string) + slicebytes(l, sval, len(sval)) + return true + } + + case OARRAYLIT: + initplan(r) + if Isslice(r.Type) { + // Init slice. + ta := typ(TARRAY) + + ta.Type = r.Type.Type + ta.Bound = Mpgetfix(r.Right.Val().U.(*Mpint)) + a := staticname(ta, 1) + inittemps[r] = a + n1 = *l + n1.Xoffset = l.Xoffset + int64(Array_array) + gdata(&n1, Nod(OADDR, a, nil), Widthptr) + n1.Xoffset = l.Xoffset + int64(Array_nel) + gdata(&n1, r.Right, Widthint) + n1.Xoffset = l.Xoffset + int64(Array_cap) + gdata(&n1, r.Right, Widthint) + + // Fall through to init underlying array. + l = a + } + fallthrough + + // fall through + case OSTRUCTLIT: + initplan(r) + + p := initplans[r] + n1 = *l + var e *InitEntry + var a *Node + for i := 0; i < len(p.E); i++ { + e = &p.E[i] + n1.Xoffset = l.Xoffset + e.Xoffset + n1.Type = e.Expr.Type + if e.Expr.Op == OLITERAL { + gdata(&n1, e.Expr, int(n1.Type.Width)) + } else { + setlineno(e.Expr) + a = Nod(OXXX, nil, nil) + *a = n1 + a.Orig = a // completely separate copy + if !staticassign(a, e.Expr, out) { + *out = list(*out, Nod(OAS, a, e.Expr)) + } + } + } + + return true + + // TODO: Table-driven map insert. + case OMAPLIT: + break + } + + return false +} + +/* + * from here down is the walk analysis + * of composite literals. + * most of the work is to generate + * data statements for the constant + * part of the composite literal. + */ +func staticname(t *Type, ctxt int) *Node { + n := newname(Lookupf("statictmp_%.4d", statuniqgen)) + statuniqgen++ + if ctxt == 0 { + n.Name.Readonly = true + } + addvar(n, t, PEXTERN) + return n +} + +func isliteral(n *Node) bool { + if n.Op == OLITERAL { + if n.Val().Ctype() != CTNIL { + return true + } + } + return false +} + +func simplename(n *Node) bool { + if n.Op != ONAME { + return false + } + if !n.Addable { + return false + } + if n.Class&PHEAP != 0 { + return false + } + if n.Class == PPARAMREF { + return false + } + return true +} + +func litas(l *Node, r *Node, init **NodeList) { + a := Nod(OAS, l, r) + typecheck(&a, Etop) + walkexpr(&a, init) + *init = list(*init, a) +} + +const ( + MODEDYNAM = 1 + MODECONST = 2 +) + +func getdyn(n *Node, top int) int { + mode := 0 + switch n.Op { + default: + if isliteral(n) { + return MODECONST + } + return MODEDYNAM + + case OARRAYLIT: + if top == 0 && n.Type.Bound < 0 { + return MODEDYNAM + } + fallthrough + + case OSTRUCTLIT: + break + } + + var value *Node + for nl := n.List; nl != nil; nl = nl.Next { + value = nl.N.Right + mode |= getdyn(value, 0) + if mode == MODEDYNAM|MODECONST { + break + } + } + + return mode +} + +func structlit(ctxt int, pass int, n *Node, var_ *Node, init **NodeList) { + var r *Node + var a *Node + var index *Node + var value *Node + + for nl := n.List; nl != nil; nl = nl.Next { + r = nl.N + if r.Op != OKEY { + Fatal("structlit: rhs not OKEY: %v", r) + } + index = r.Left + value = r.Right + + switch value.Op { + case OARRAYLIT: + if value.Type.Bound < 0 { + if pass == 1 && ctxt != 0 { + a = Nod(ODOT, var_, newname(index.Sym)) + slicelit(ctxt, value, a, init) + } else if pass == 2 && ctxt == 0 { + a = Nod(ODOT, var_, newname(index.Sym)) + slicelit(ctxt, value, a, init) + } else if pass == 3 { + break + } + continue + } + + a = Nod(ODOT, var_, newname(index.Sym)) + arraylit(ctxt, pass, value, a, init) + continue + + case OSTRUCTLIT: + a = Nod(ODOT, var_, newname(index.Sym)) + structlit(ctxt, pass, value, a, init) + continue + } + + if isliteral(value) { + if pass == 2 { + continue + } + } else if pass == 1 { + continue + } + + // build list of var.field = expr + setlineno(value) + a = Nod(ODOT, var_, newname(index.Sym)) + + a = Nod(OAS, a, value) + typecheck(&a, Etop) + if pass == 1 { + walkexpr(&a, init) // add any assignments in r to top + if a.Op != OAS { + Fatal("structlit: not as") + } + a.Dodata = 2 + } else { + orderstmtinplace(&a) + walkstmt(&a) + } + + *init = list(*init, a) + } +} + +func arraylit(ctxt int, pass int, n *Node, var_ *Node, init **NodeList) { + var r *Node + var a *Node + var index *Node + var value *Node + + for l := n.List; l != nil; l = l.Next { + r = l.N + if r.Op != OKEY { + Fatal("arraylit: rhs not OKEY: %v", r) + } + index = r.Left + value = r.Right + + switch value.Op { + case OARRAYLIT: + if value.Type.Bound < 0 { + if pass == 1 && ctxt != 0 { + a = Nod(OINDEX, var_, index) + slicelit(ctxt, value, a, init) + } else if pass == 2 && ctxt == 0 { + a = Nod(OINDEX, var_, index) + slicelit(ctxt, value, a, init) + } else if pass == 3 { + break + } + continue + } + + a = Nod(OINDEX, var_, index) + arraylit(ctxt, pass, value, a, init) + continue + + case OSTRUCTLIT: + a = Nod(OINDEX, var_, index) + structlit(ctxt, pass, value, a, init) + continue + } + + if isliteral(index) && isliteral(value) { + if pass == 2 { + continue + } + } else if pass == 1 { + continue + } + + // build list of var[index] = value + setlineno(value) + a = Nod(OINDEX, var_, index) + + a = Nod(OAS, a, value) + typecheck(&a, Etop) + if pass == 1 { + walkexpr(&a, init) + if a.Op != OAS { + Fatal("arraylit: not as") + } + a.Dodata = 2 + } else { + orderstmtinplace(&a) + walkstmt(&a) + } + + *init = list(*init, a) + } +} + +func slicelit(ctxt int, n *Node, var_ *Node, init **NodeList) { + // make an array type + t := shallow(n.Type) + + t.Bound = Mpgetfix(n.Right.Val().U.(*Mpint)) + t.Width = 0 + t.Sym = nil + t.Haspointers = 0 + dowidth(t) + + if ctxt != 0 { + // put everything into static array + vstat := staticname(t, ctxt) + + arraylit(ctxt, 1, n, vstat, init) + arraylit(ctxt, 2, n, vstat, init) + + // copy static to slice + a := Nod(OSLICE, vstat, Nod(OKEY, nil, nil)) + + a = Nod(OAS, var_, a) + typecheck(&a, Etop) + a.Dodata = 2 + *init = list(*init, a) + return + } + + // recipe for var = []t{...} + // 1. make a static array + // var vstat [...]t + // 2. assign (data statements) the constant part + // vstat = constpart{} + // 3. make an auto pointer to array and allocate heap to it + // var vauto *[...]t = new([...]t) + // 4. copy the static array to the auto array + // *vauto = vstat + // 5. assign slice of allocated heap to var + // var = [0:]*auto + // 6. for each dynamic part assign to the slice + // var[i] = dynamic part + // + // an optimization is done if there is no constant part + // 3. var vauto *[...]t = new([...]t) + // 5. var = [0:]*auto + // 6. var[i] = dynamic part + + // if the literal contains constants, + // make static initialized array (1),(2) + var vstat *Node + + mode := getdyn(n, 1) + if mode&MODECONST != 0 { + vstat = staticname(t, ctxt) + arraylit(ctxt, 1, n, vstat, init) + } + + // make new auto *array (3 declare) + vauto := temp(Ptrto(t)) + + // set auto to point at new temp or heap (3 assign) + var a *Node + if x := prealloc[n]; x != nil { + // temp allocated during order.c for dddarg + x.Type = t + + if vstat == nil { + a = Nod(OAS, x, nil) + typecheck(&a, Etop) + *init = list(*init, a) // zero new temp + } + + a = Nod(OADDR, x, nil) + } else if n.Esc == EscNone { + a = temp(t) + if vstat == nil { + a = Nod(OAS, temp(t), nil) + typecheck(&a, Etop) + *init = list(*init, a) // zero new temp + a = a.Left + } + + a = Nod(OADDR, a, nil) + } else { + a = Nod(ONEW, nil, nil) + a.List = list1(typenod(t)) + } + + a = Nod(OAS, vauto, a) + typecheck(&a, Etop) + walkexpr(&a, init) + *init = list(*init, a) + + if vstat != nil { + // copy static to heap (4) + a = Nod(OIND, vauto, nil) + + a = Nod(OAS, a, vstat) + typecheck(&a, Etop) + walkexpr(&a, init) + *init = list(*init, a) + } + + // make slice out of heap (5) + a = Nod(OAS, var_, Nod(OSLICE, vauto, Nod(OKEY, nil, nil))) + + typecheck(&a, Etop) + orderstmtinplace(&a) + walkstmt(&a) + *init = list(*init, a) + + // put dynamics into slice (6) + var value *Node + var r *Node + var index *Node + for l := n.List; l != nil; l = l.Next { + r = l.N + if r.Op != OKEY { + Fatal("slicelit: rhs not OKEY: %v", r) + } + index = r.Left + value = r.Right + a = Nod(OINDEX, var_, index) + a.Bounded = true + + // TODO need to check bounds? + + switch value.Op { + case OARRAYLIT: + if value.Type.Bound < 0 { + break + } + arraylit(ctxt, 2, value, a, init) + continue + + case OSTRUCTLIT: + structlit(ctxt, 2, value, a, init) + continue + } + + if isliteral(index) && isliteral(value) { + continue + } + + // build list of var[c] = expr + setlineno(value) + a = Nod(OAS, a, value) + + typecheck(&a, Etop) + orderstmtinplace(&a) + walkstmt(&a) + *init = list(*init, a) + } +} + +func maplit(ctxt int, n *Node, var_ *Node, init **NodeList) { + var r *Node + var index *Node + var value *Node + + ctxt = 0 + + // make the map var + nerr := nerrors + + a := Nod(OMAKE, nil, nil) + a.List = list1(typenod(n.Type)) + litas(var_, a, init) + + // count the initializers + b := int64(0) + + for l := n.List; l != nil; l = l.Next { + r = l.N + + if r.Op != OKEY { + Fatal("maplit: rhs not OKEY: %v", r) + } + index = r.Left + value = r.Right + + if isliteral(index) && isliteral(value) { + b++ + } + } + + if b != 0 { + // build type [count]struct { a Tindex, b Tvalue } + t := n.Type + + tk := t.Down + tv := t.Type + + symb := Lookup("b") + t = typ(TFIELD) + t.Type = tv + t.Sym = symb + + syma := Lookup("a") + t1 := t + t = typ(TFIELD) + t.Type = tk + t.Sym = syma + t.Down = t1 + + t1 = t + t = typ(TSTRUCT) + t.Type = t1 + + t1 = t + t = typ(TARRAY) + t.Bound = b + t.Type = t1 + + dowidth(t) + + // make and initialize static array + vstat := staticname(t, ctxt) + + b := int64(0) + var index *Node + var r *Node + var value *Node + for l := n.List; l != nil; l = l.Next { + r = l.N + + if r.Op != OKEY { + Fatal("maplit: rhs not OKEY: %v", r) + } + index = r.Left + value = r.Right + + if isliteral(index) && isliteral(value) { + // build vstat[b].a = key; + setlineno(index) + a = Nodintconst(b) + + a = Nod(OINDEX, vstat, a) + a = Nod(ODOT, a, newname(syma)) + a = Nod(OAS, a, index) + typecheck(&a, Etop) + walkexpr(&a, init) + a.Dodata = 2 + *init = list(*init, a) + + // build vstat[b].b = value; + setlineno(value) + a = Nodintconst(b) + + a = Nod(OINDEX, vstat, a) + a = Nod(ODOT, a, newname(symb)) + a = Nod(OAS, a, value) + typecheck(&a, Etop) + walkexpr(&a, init) + a.Dodata = 2 + *init = list(*init, a) + + b++ + } + } + + // loop adding structure elements to map + // for i = 0; i < len(vstat); i++ { + // map[vstat[i].a] = vstat[i].b + // } + index = temp(Types[TINT]) + + a = Nod(OINDEX, vstat, index) + a.Bounded = true + a = Nod(ODOT, a, newname(symb)) + + r = Nod(OINDEX, vstat, index) + r.Bounded = true + r = Nod(ODOT, r, newname(syma)) + r = Nod(OINDEX, var_, r) + + r = Nod(OAS, r, a) + + a = Nod(OFOR, nil, nil) + a.Nbody = list1(r) + + a.Ninit = list1(Nod(OAS, index, Nodintconst(0))) + a.Left = Nod(OLT, index, Nodintconst(t.Bound)) + a.Right = Nod(OAS, index, Nod(OADD, index, Nodintconst(1))) + + typecheck(&a, Etop) + walkstmt(&a) + *init = list(*init, a) + } + + // put in dynamic entries one-at-a-time + var key *Node + + var val *Node + for l := n.List; l != nil; l = l.Next { + r = l.N + + if r.Op != OKEY { + Fatal("maplit: rhs not OKEY: %v", r) + } + index = r.Left + value = r.Right + + if isliteral(index) && isliteral(value) { + continue + } + + // build list of var[c] = expr. + // use temporary so that mapassign1 can have addressable key, val. + if key == nil { + key = temp(var_.Type.Down) + val = temp(var_.Type.Type) + } + + setlineno(r.Left) + a = Nod(OAS, key, r.Left) + typecheck(&a, Etop) + walkstmt(&a) + *init = list(*init, a) + setlineno(r.Right) + a = Nod(OAS, val, r.Right) + typecheck(&a, Etop) + walkstmt(&a) + *init = list(*init, a) + + setlineno(val) + a = Nod(OAS, Nod(OINDEX, var_, key), val) + typecheck(&a, Etop) + walkstmt(&a) + *init = list(*init, a) + + if nerr != nerrors { + break + } + } + + if key != nil { + a = Nod(OVARKILL, key, nil) + typecheck(&a, Etop) + *init = list(*init, a) + a = Nod(OVARKILL, val, nil) + typecheck(&a, Etop) + *init = list(*init, a) + } +} + +func anylit(ctxt int, n *Node, var_ *Node, init **NodeList) { + t := n.Type + switch n.Op { + default: + Fatal("anylit: not lit") + + case OPTRLIT: + if !Isptr[t.Etype] { + Fatal("anylit: not ptr") + } + + var r *Node + if n.Right != nil { + r = Nod(OADDR, n.Right, nil) + typecheck(&r, Erv) + } else { + r = Nod(ONEW, nil, nil) + r.Typecheck = 1 + r.Type = t + r.Esc = n.Esc + } + + walkexpr(&r, init) + a := Nod(OAS, var_, r) + + typecheck(&a, Etop) + *init = list(*init, a) + + var_ = Nod(OIND, var_, nil) + typecheck(&var_, Erv|Easgn) + anylit(ctxt, n.Left, var_, init) + + case OSTRUCTLIT: + if t.Etype != TSTRUCT { + Fatal("anylit: not struct") + } + + if simplename(var_) && count(n.List) > 4 { + if ctxt == 0 { + // lay out static data + vstat := staticname(t, ctxt) + + structlit(ctxt, 1, n, vstat, init) + + // copy static to var + a := Nod(OAS, var_, vstat) + + typecheck(&a, Etop) + walkexpr(&a, init) + *init = list(*init, a) + + // add expressions to automatic + structlit(ctxt, 2, n, var_, init) + + break + } + + structlit(ctxt, 1, n, var_, init) + structlit(ctxt, 2, n, var_, init) + break + } + + // initialize of not completely specified + if simplename(var_) || count(n.List) < structcount(t) { + a := Nod(OAS, var_, nil) + typecheck(&a, Etop) + walkexpr(&a, init) + *init = list(*init, a) + } + + structlit(ctxt, 3, n, var_, init) + + case OARRAYLIT: + if t.Etype != TARRAY { + Fatal("anylit: not array") + } + if t.Bound < 0 { + slicelit(ctxt, n, var_, init) + break + } + + if simplename(var_) && count(n.List) > 4 { + if ctxt == 0 { + // lay out static data + vstat := staticname(t, ctxt) + + arraylit(1, 1, n, vstat, init) + + // copy static to automatic + a := Nod(OAS, var_, vstat) + + typecheck(&a, Etop) + walkexpr(&a, init) + *init = list(*init, a) + + // add expressions to automatic + arraylit(ctxt, 2, n, var_, init) + + break + } + + arraylit(ctxt, 1, n, var_, init) + arraylit(ctxt, 2, n, var_, init) + break + } + + // initialize of not completely specified + if simplename(var_) || int64(count(n.List)) < t.Bound { + a := Nod(OAS, var_, nil) + typecheck(&a, Etop) + walkexpr(&a, init) + *init = list(*init, a) + } + + arraylit(ctxt, 3, n, var_, init) + + case OMAPLIT: + if t.Etype != TMAP { + Fatal("anylit: not map") + } + maplit(ctxt, n, var_, init) + } +} + +func oaslit(n *Node, init **NodeList) bool { + if n.Left == nil || n.Right == nil { + // not a special composit literal assignment + return false + } + if n.Left.Type == nil || n.Right.Type == nil { + // not a special composit literal assignment + return false + } + if !simplename(n.Left) { + // not a special composit literal assignment + return false + } + if !Eqtype(n.Left.Type, n.Right.Type) { + // not a special composit literal assignment + return false + } + + // context is init() function. + // implies generated data executed + // exactly once and not subject to races. + ctxt := 0 + + // if(n->dodata == 1) + // ctxt = 1; + + switch n.Right.Op { + default: + // not a special composit literal assignment + return false + + case OSTRUCTLIT, OARRAYLIT, OMAPLIT: + if vmatch1(n.Left, n.Right) { + // not a special composit literal assignment + return false + } + anylit(ctxt, n.Right, n.Left, init) + } + + n.Op = OEMPTY + n.Right = nil + return true +} + +func getlit(lit *Node) int { + if Smallintconst(lit) { + return int(Mpgetfix(lit.Val().U.(*Mpint))) + } + return -1 +} + +func stataddr(nam *Node, n *Node) bool { + if n == nil { + return false + } + + switch n.Op { + case ONAME: + *nam = *n + return n.Addable + + case ODOT: + if !stataddr(nam, n.Left) { + break + } + nam.Xoffset += n.Xoffset + nam.Type = n.Type + return true + + case OINDEX: + if n.Left.Type.Bound < 0 { + break + } + if !stataddr(nam, n.Left) { + break + } + l := getlit(n.Right) + if l < 0 { + break + } + + // Check for overflow. + if n.Type.Width != 0 && Thearch.MAXWIDTH/n.Type.Width <= int64(l) { + break + } + nam.Xoffset += int64(l) * n.Type.Width + nam.Type = n.Type + return true + } + + return false +} + +func initplan(n *Node) { + if initplans[n] != nil { + return + } + p := new(InitPlan) + initplans[n] = p + switch n.Op { + default: + Fatal("initplan") + + case OARRAYLIT: + var a *Node + for l := n.List; l != nil; l = l.Next { + a = l.N + if a.Op != OKEY || !Smallintconst(a.Left) { + Fatal("initplan arraylit") + } + addvalue(p, n.Type.Type.Width*Mpgetfix(a.Left.Val().U.(*Mpint)), nil, a.Right) + } + + case OSTRUCTLIT: + var a *Node + for l := n.List; l != nil; l = l.Next { + a = l.N + if a.Op != OKEY || a.Left.Type == nil { + Fatal("initplan structlit") + } + addvalue(p, a.Left.Type.Width, nil, a.Right) + } + + case OMAPLIT: + var a *Node + for l := n.List; l != nil; l = l.Next { + a = l.N + if a.Op != OKEY { + Fatal("initplan maplit") + } + addvalue(p, -1, a.Left, a.Right) + } + } +} + +func addvalue(p *InitPlan, xoffset int64, key *Node, n *Node) { + // special case: zero can be dropped entirely + if iszero(n) { + p.Zero += n.Type.Width + return + } + + // special case: inline struct and array (not slice) literals + if isvaluelit(n) { + initplan(n) + q := initplans[n] + var e *InitEntry + for i := 0; i < len(q.E); i++ { + e = entry(p) + *e = q.E[i] + e.Xoffset += xoffset + } + + return + } + + // add to plan + if n.Op == OLITERAL { + p.Lit += n.Type.Width + } else { + p.Expr += n.Type.Width + } + + e := entry(p) + e.Xoffset = xoffset + e.Expr = n +} + +func iszero(n *Node) bool { + switch n.Op { + case OLITERAL: + switch n.Val().Ctype() { + default: + Dump("unexpected literal", n) + Fatal("iszero") + + case CTNIL: + return true + + case CTSTR: + return n.Val().U.(string) == "" + + case CTBOOL: + return !n.Val().U.(bool) + + case CTINT, CTRUNE: + return mpcmpfixc(n.Val().U.(*Mpint), 0) == 0 + + case CTFLT: + return mpcmpfltc(n.Val().U.(*Mpflt), 0) == 0 + + case CTCPLX: + return mpcmpfltc(&n.Val().U.(*Mpcplx).Real, 0) == 0 && mpcmpfltc(&n.Val().U.(*Mpcplx).Imag, 0) == 0 + } + + case OARRAYLIT: + if Isslice(n.Type) { + break + } + fallthrough + + // fall through + case OSTRUCTLIT: + for l := n.List; l != nil; l = l.Next { + if !iszero(l.N.Right) { + return false + } + } + return true + } + + return false +} + +func isvaluelit(n *Node) bool { + return (n.Op == OARRAYLIT && Isfixedarray(n.Type)) || n.Op == OSTRUCTLIT +} + +func entry(p *InitPlan) *InitEntry { + p.E = append(p.E, InitEntry{}) + return &p.E[len(p.E)-1] +} + +func gen_as_init(n *Node) bool { + var nr *Node + var nl *Node + var nam Node + + if n.Dodata == 0 { + goto no + } + + nr = n.Right + nl = n.Left + if nr == nil { + var nam Node + if !stataddr(&nam, nl) { + goto no + } + if nam.Class != PEXTERN { + goto no + } + return true + } + + if nr.Type == nil || !Eqtype(nl.Type, nr.Type) { + goto no + } + + if !stataddr(&nam, nl) { + goto no + } + + if nam.Class != PEXTERN { + goto no + } + + switch nr.Op { + default: + goto no + + case OCONVNOP: + nr = nr.Left + if nr == nil || nr.Op != OSLICEARR { + goto no + } + fallthrough + + // fall through + case OSLICEARR: + if nr.Right.Op == OKEY && nr.Right.Left == nil && nr.Right.Right == nil { + nr = nr.Left + gused(nil) // in case the data is the dest of a goto + nl := nr + if nr == nil || nr.Op != OADDR { + goto no + } + nr = nr.Left + if nr == nil || nr.Op != ONAME { + goto no + } + + // nr is the array being converted to a slice + if nr.Type == nil || nr.Type.Etype != TARRAY || nr.Type.Bound < 0 { + goto no + } + + nam.Xoffset += int64(Array_array) + gdata(&nam, nl, int(Types[Tptr].Width)) + + nam.Xoffset += int64(Array_nel) - int64(Array_array) + var nod1 Node + Nodconst(&nod1, Types[TINT], nr.Type.Bound) + gdata(&nam, &nod1, Widthint) + + nam.Xoffset += int64(Array_cap) - int64(Array_nel) + gdata(&nam, &nod1, Widthint) + + return true + } + + goto no + + case OLITERAL: + break + } + + switch nr.Type.Etype { + default: + goto no + + case TBOOL, + TINT8, + TUINT8, + TINT16, + TUINT16, + TINT32, + TUINT32, + TINT64, + TUINT64, + TINT, + TUINT, + TUINTPTR, + TPTR32, + TPTR64, + TFLOAT32, + TFLOAT64: + gdata(&nam, nr, int(nr.Type.Width)) + + case TCOMPLEX64, TCOMPLEX128: + gdatacomplex(&nam, nr.Val().U.(*Mpcplx)) + + case TSTRING: + gdatastring(&nam, nr.Val().U.(string)) + } + + return true + +no: + if n.Dodata == 2 { + Dump("\ngen_as_init", n) + Fatal("gen_as_init couldnt make data statement") + } + + return false +} diff --git a/src/cmd/compile/internal/gc/subr.go b/src/cmd/compile/internal/gc/subr.go new file mode 100644 index 0000000000000000000000000000000000000000..866d8e1bdee88e5cbd03bdb6840f8e64bd33439c --- /dev/null +++ b/src/cmd/compile/internal/gc/subr.go @@ -0,0 +1,3589 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package gc + +import ( + "bytes" + "cmd/internal/obj" + "crypto/md5" + "encoding/binary" + "fmt" + "os" + "sort" + "strings" + "unicode" + "unicode/utf8" +) + +type Error struct { + lineno int + seq int + msg string +} + +var errors []Error + +func errorexit() { + Flusherrors() + if outfile != "" { + os.Remove(outfile) + } + os.Exit(2) +} + +func parserline() int { + if parsing && theparser.Lookahead() > 0 { + // parser has one symbol lookahead + return int(prevlineno) + } + return int(lineno) +} + +func adderrorname(n *Node) { + if n.Op != ODOT { + return + } + old := fmt.Sprintf("%v: undefined: %v\n", n.Line(), n.Left) + if len(errors) > 0 && int32(errors[len(errors)-1].lineno) == n.Lineno && errors[len(errors)-1].msg == old { + errors[len(errors)-1].msg = fmt.Sprintf("%v: undefined: %v in %v\n", n.Line(), n.Left, n) + } +} + +func adderr(line int, format string, args ...interface{}) { + errors = append(errors, Error{ + seq: len(errors), + lineno: line, + msg: fmt.Sprintf("%v: %s\n", Ctxt.Line(line), fmt.Sprintf(format, args...)), + }) +} + +type errcmp []Error + +func (x errcmp) Len() int { + return len(x) +} + +func (x errcmp) Swap(i, j int) { + x[i], x[j] = x[j], x[i] +} + +func (x errcmp) Less(i, j int) bool { + a := &x[i] + b := &x[j] + if a.lineno != b.lineno { + return a.lineno-b.lineno < 0 + } + if a.seq != b.seq { + return a.seq-b.seq < 0 + } + return stringsCompare(a.msg, b.msg) < 0 +} + +func Flusherrors() { + bstdout.Flush() + if len(errors) == 0 { + return + } + sort.Sort(errcmp(errors[:len(errors)])) + for i := 0; i < len(errors); i++ { + if i == 0 || errors[i].msg != errors[i-1].msg { + fmt.Printf("%s", errors[i].msg) + } + } + errors = errors[:0] +} + +func hcrash() { + if Debug['h'] != 0 { + Flusherrors() + if outfile != "" { + os.Remove(outfile) + } + var x *int + *x = 0 + } +} + +func yyerrorl(line int, format string, args ...interface{}) { + adderr(line, format, args...) + + hcrash() + nerrors++ + if nsavederrors+nerrors >= 10 && Debug['e'] == 0 { + Flusherrors() + fmt.Printf("%v: too many errors\n", Ctxt.Line(line)) + errorexit() + } +} + +var yyerror_lastsyntax int + +func Yyerror(format string, args ...interface{}) { + msg := fmt.Sprintf(format, args...) + if strings.HasPrefix(msg, "syntax error") { + nsyntaxerrors++ + + // An unexpected EOF caused a syntax error. Use the previous + // line number since getc generated a fake newline character. + if curio.eofnl != 0 { + lexlineno = prevlineno + } + + // only one syntax error per line + if int32(yyerror_lastsyntax) == lexlineno { + return + } + yyerror_lastsyntax = int(lexlineno) + + // plain "syntax error" gets "near foo" added + if msg == "syntax error" { + yyerrorl(int(lexlineno), "syntax error near %s", lexbuf.String()) + return + } + + // The grammar has { and LBRACE but both show up as {. + // Rewrite syntax error referring to "{ or {" to say just "{". + // The grammar has ? and @ but only for reading imports. + // Silence them in ordinary errors. + msg = strings.Replace(msg, "{ or {", "{", -1) + msg = strings.Replace(msg, " or ?", "", -1) + msg = strings.Replace(msg, " or @", "", -1) + + msg = strings.Replace(msg, "LLITERAL", litbuf, -1) + + yyerrorl(int(lexlineno), "%s", msg) + return + } + + adderr(parserline(), "%s", msg) + + hcrash() + nerrors++ + if nsavederrors+nerrors >= 10 && Debug['e'] == 0 { + Flusherrors() + fmt.Printf("%v: too many errors\n", Ctxt.Line(parserline())) + errorexit() + } +} + +func Warn(fmt_ string, args ...interface{}) { + adderr(parserline(), fmt_, args...) + + hcrash() +} + +func Warnl(line int, fmt_ string, args ...interface{}) { + adderr(line, fmt_, args...) + if Debug['m'] != 0 { + Flusherrors() + } +} + +func Fatal(fmt_ string, args ...interface{}) { + Flusherrors() + + fmt.Printf("%v: internal compiler error: ", Ctxt.Line(int(lineno))) + fmt.Printf(fmt_, args...) + fmt.Printf("\n") + + // If this is a released compiler version, ask for a bug report. + if strings.HasPrefix(obj.Getgoversion(), "release") { + fmt.Printf("\n") + fmt.Printf("Please file a bug report including a short program that triggers the error.\n") + fmt.Printf("https://golang.org/issue/new\n") + } + + hcrash() + errorexit() +} + +func linehistpragma(file string) { + if Debug['i'] != 0 { + fmt.Printf("pragma %s at line %v\n", file, Ctxt.Line(int(lexlineno))) + } + Ctxt.AddImport(file) +} + +func linehistpush(file string) { + if Debug['i'] != 0 { + fmt.Printf("import %s at line %v\n", file, Ctxt.Line(int(lexlineno))) + } + Ctxt.LineHist.Push(int(lexlineno), file) +} + +func linehistpop() { + if Debug['i'] != 0 { + fmt.Printf("end of import at line %v\n", Ctxt.Line(int(lexlineno))) + } + Ctxt.LineHist.Pop(int(lexlineno)) +} + +func linehistupdate(file string, off int) { + if Debug['i'] != 0 { + fmt.Printf("line %s at line %v\n", file, Ctxt.Line(int(lexlineno))) + } + Ctxt.LineHist.Update(int(lexlineno), file, off) +} + +func setlineno(n *Node) int32 { + lno := lineno + if n != nil { + switch n.Op { + case ONAME, OTYPE, OPACK: + break + + case OLITERAL: + if n.Sym != nil { + break + } + fallthrough + + default: + lineno = n.Lineno + if lineno == 0 { + if Debug['K'] != 0 { + Warn("setlineno: line 0") + } + lineno = lno + } + } + } + + return lno +} + +func Lookup(name string) *Sym { + return localpkg.Lookup(name) +} + +func Lookupf(format string, a ...interface{}) *Sym { + return Lookup(fmt.Sprintf(format, a...)) +} + +func LookupBytes(name []byte) *Sym { + return localpkg.LookupBytes(name) +} + +var initSyms []*Sym + +var nopkg = &Pkg{ + Syms: make(map[string]*Sym), +} + +func (pkg *Pkg) Lookup(name string) *Sym { + if pkg == nil { + pkg = nopkg + } + if s := pkg.Syms[name]; s != nil { + return s + } + + s := &Sym{ + Name: name, + Pkg: pkg, + Lexical: LNAME, + } + if name == "init" { + initSyms = append(initSyms, s) + } + pkg.Syms[name] = s + return s +} + +func (pkg *Pkg) LookupBytes(name []byte) *Sym { + if pkg == nil { + pkg = nopkg + } + if s := pkg.Syms[string(name)]; s != nil { + return s + } + str := internString(name) + return pkg.Lookup(str) +} + +func Pkglookup(name string, pkg *Pkg) *Sym { + return pkg.Lookup(name) +} + +func restrictlookup(name string, pkg *Pkg) *Sym { + if !exportname(name) && pkg != localpkg { + Yyerror("cannot refer to unexported name %s.%s", pkg.Name, name) + } + return Pkglookup(name, pkg) +} + +// find all the exported symbols in package opkg +// and make them available in the current package +func importdot(opkg *Pkg, pack *Node) { + var s1 *Sym + var pkgerror string + + n := 0 + for _, s := range opkg.Syms { + if s.Def == nil { + continue + } + if !exportname(s.Name) || strings.ContainsRune(s.Name, 0xb7) { // 0xb7 = center dot + continue + } + s1 = Lookup(s.Name) + if s1.Def != nil { + pkgerror = fmt.Sprintf("during import %q", opkg.Path) + redeclare(s1, pkgerror) + continue + } + + s1.Def = s.Def + s1.Block = s.Block + if s1.Def.Name == nil { + Dump("s1def", s1.Def) + Fatal("missing Name") + } + s1.Def.Name.Pack = pack + s1.Origpkg = opkg + n++ + } + + if n == 0 { + // can't possibly be used - there were no symbols + yyerrorl(int(pack.Lineno), "imported and not used: %q", opkg.Path) + } +} + +func gethunk() { + nh := int32(NHUNK) + if thunk >= 10*NHUNK { + nh = 10 * NHUNK + } + h := string(make([]byte, nh)) + if h == "" { + Flusherrors() + Yyerror("out of memory") + errorexit() + } + + hunk = h + nhunk = nh + thunk += nh +} + +func Nod(op int, nleft *Node, nright *Node) *Node { + n := new(Node) + n.Op = uint8(op) + n.Left = nleft + n.Right = nright + n.Lineno = int32(parserline()) + n.Xoffset = BADWIDTH + n.Orig = n + switch op { + case OCLOSURE, ODCLFUNC: + n.Func = new(Func) + n.Func.FCurfn = Curfn + case ONAME: + n.Name = new(Name) + n.Name.Param = new(Param) + case OLABEL, OPACK: + n.Name = new(Name) + case ODCLFIELD: + if nleft != nil { + n.Name = nleft.Name + } else { + n.Name = new(Name) + n.Name.Param = new(Param) + } + } + if n.Name != nil { + n.Name.Curfn = Curfn + } + return n +} + +func saveorignode(n *Node) { + if n.Orig != nil { + return + } + norig := Nod(int(n.Op), nil, nil) + *norig = *n + n.Orig = norig +} + +// ispaddedfield reports whether the given field +// is followed by padding. For the case where t is +// the last field, total gives the size of the enclosing struct. +func ispaddedfield(t *Type, total int64) bool { + if t.Etype != TFIELD { + Fatal("ispaddedfield called non-field %v", t) + } + if t.Down == nil { + return t.Width+t.Type.Width != total + } + return t.Width+t.Type.Width != t.Down.Width +} + +func algtype1(t *Type, bad **Type) int { + if bad != nil { + *bad = nil + } + if t.Broke != 0 { + return AMEM + } + if t.Noalg != 0 { + return ANOEQ + } + + switch t.Etype { + // will be defined later. + case TANY, TFORW: + *bad = t + + return -1 + + case TINT8, + TUINT8, + TINT16, + TUINT16, + TINT32, + TUINT32, + TINT64, + TUINT64, + TINT, + TUINT, + TUINTPTR, + TBOOL, + TPTR32, + TPTR64, + TCHAN, + TUNSAFEPTR: + return AMEM + + case TFUNC, TMAP: + if bad != nil { + *bad = t + } + return ANOEQ + + case TFLOAT32: + return AFLOAT32 + + case TFLOAT64: + return AFLOAT64 + + case TCOMPLEX64: + return ACPLX64 + + case TCOMPLEX128: + return ACPLX128 + + case TSTRING: + return ASTRING + + case TINTER: + if isnilinter(t) { + return ANILINTER + } + return AINTER + + case TARRAY: + if Isslice(t) { + if bad != nil { + *bad = t + } + return ANOEQ + } + + a := algtype1(t.Type, bad) + if a == ANOEQ || a == AMEM { + if a == ANOEQ && bad != nil { + *bad = t + } + return a + } + + return -1 // needs special compare + + case TSTRUCT: + if t.Type != nil && t.Type.Down == nil && !isblanksym(t.Type.Sym) { + // One-field struct is same as that one field alone. + return algtype1(t.Type.Type, bad) + } + + ret := AMEM + var a int + for t1 := t.Type; t1 != nil; t1 = t1.Down { + // All fields must be comparable. + a = algtype1(t1.Type, bad) + + if a == ANOEQ { + return ANOEQ + } + + // Blank fields, padded fields, fields with non-memory + // equality need special compare. + if a != AMEM || isblanksym(t1.Sym) || ispaddedfield(t1, t.Width) { + ret = -1 + continue + } + } + + return ret + } + + Fatal("algtype1: unexpected type %v", t) + return 0 +} + +func algtype(t *Type) int { + a := algtype1(t, nil) + if a == AMEM || a == ANOEQ { + if Isslice(t) { + return ASLICE + } + switch t.Width { + case 0: + return a + AMEM0 - AMEM + + case 1: + return a + AMEM8 - AMEM + + case 2: + return a + AMEM16 - AMEM + + case 4: + return a + AMEM32 - AMEM + + case 8: + return a + AMEM64 - AMEM + + case 16: + return a + AMEM128 - AMEM + } + } + + return a +} + +func maptype(key *Type, val *Type) *Type { + if key != nil { + var bad *Type + atype := algtype1(key, &bad) + var mtype int + if bad == nil { + mtype = int(key.Etype) + } else { + mtype = int(bad.Etype) + } + switch mtype { + default: + if atype == ANOEQ { + Yyerror("invalid map key type %v", key) + } + + // will be resolved later. + case TANY: + break + + // map[key] used during definition of key. + // postpone check until key is fully defined. + // if there are multiple uses of map[key] + // before key is fully defined, the error + // will only be printed for the first one. + // good enough. + case TFORW: + if key.Maplineno == 0 { + key.Maplineno = lineno + } + } + } + + t := typ(TMAP) + t.Down = key + t.Type = val + return t +} + +func typ(et int) *Type { + t := new(Type) + t.Etype = uint8(et) + t.Width = BADWIDTH + t.Lineno = int(lineno) + t.Orig = t + return t +} + +type methcmp []*Type + +func (x methcmp) Len() int { + return len(x) +} + +func (x methcmp) Swap(i, j int) { + x[i], x[j] = x[j], x[i] +} + +func (x methcmp) Less(i, j int) bool { + a := x[i] + b := x[j] + if a.Sym == nil && b.Sym == nil { + return false + } + if a.Sym == nil { + return true + } + if b.Sym == nil { + return 1 < 0 + } + k := stringsCompare(a.Sym.Name, b.Sym.Name) + if k != 0 { + return k < 0 + } + if !exportname(a.Sym.Name) { + k := stringsCompare(a.Sym.Pkg.Path, b.Sym.Pkg.Path) + if k != 0 { + return k < 0 + } + } + + return false +} + +func sortinter(t *Type) *Type { + if t.Type == nil || t.Type.Down == nil { + return t + } + + i := 0 + for f := t.Type; f != nil; f = f.Down { + i++ + } + a := make([]*Type, i) + i = 0 + var f *Type + for f = t.Type; f != nil; f = f.Down { + a[i] = f + i++ + } + sort.Sort(methcmp(a[:i])) + for { + tmp11 := i + i-- + if tmp11 <= 0 { + break + } + a[i].Down = f + f = a[i] + } + + t.Type = f + return t +} + +func Nodintconst(v int64) *Node { + c := Nod(OLITERAL, nil, nil) + c.Addable = true + c.SetVal(Val{new(Mpint)}) + Mpmovecfix(c.Val().U.(*Mpint), v) + c.Type = Types[TIDEAL] + ullmancalc(c) + return c +} + +func nodfltconst(v *Mpflt) *Node { + c := Nod(OLITERAL, nil, nil) + c.Addable = true + c.SetVal(Val{newMpflt()}) + mpmovefltflt(c.Val().U.(*Mpflt), v) + c.Type = Types[TIDEAL] + ullmancalc(c) + return c +} + +func Nodconst(n *Node, t *Type, v int64) { + *n = Node{} + n.Op = OLITERAL + n.Addable = true + ullmancalc(n) + n.SetVal(Val{new(Mpint)}) + Mpmovecfix(n.Val().U.(*Mpint), v) + n.Type = t + + if Isfloat[t.Etype] { + Fatal("nodconst: bad type %v", t) + } +} + +func nodnil() *Node { + c := Nodintconst(0) + c.SetVal(Val{new(NilVal)}) + c.Type = Types[TNIL] + return c +} + +func Nodbool(b bool) *Node { + c := Nodintconst(0) + c.SetVal(Val{b}) + c.Type = idealbool + return c +} + +func aindex(b *Node, t *Type) *Type { + bound := int64(-1) // open bound + typecheck(&b, Erv) + if b != nil { + switch consttype(b) { + default: + Yyerror("array bound must be an integer expression") + + case CTINT, CTRUNE: + bound = Mpgetfix(b.Val().U.(*Mpint)) + if bound < 0 { + Yyerror("array bound must be non negative") + } + } + } + + // fixed array + r := typ(TARRAY) + + r.Type = t + r.Bound = bound + return r +} + +// treecopy recursively copies n, with the exception of +// ONAME, OLITERAL, OTYPE, and non-iota ONONAME leaves. +// Copies of iota ONONAME nodes are assigned the current +// value of iota_. If lineno != 0, it sets the line number +// of newly allocated nodes to lineno. +func treecopy(n *Node, lineno int32) *Node { + if n == nil { + return nil + } + + var m *Node + switch n.Op { + default: + m = Nod(OXXX, nil, nil) + *m = *n + m.Orig = m + m.Left = treecopy(n.Left, lineno) + m.Right = treecopy(n.Right, lineno) + m.List = listtreecopy(n.List, lineno) + if lineno != 0 { + m.Lineno = lineno + } + if m.Name != nil && n.Op != ODCLFIELD { + Dump("treecopy", n) + Fatal("treecopy Name") + } + + case ONONAME: + if n.Sym == Lookup("iota") { + // Not sure yet whether this is the real iota, + // but make a copy of the Node* just in case, + // so that all the copies of this const definition + // don't have the same iota value. + m = Nod(OXXX, nil, nil) + *m = *n + if lineno != 0 { + m.Lineno = lineno + } + m.Name = new(Name) + *m.Name = *n.Name + m.Name.Iota = iota_ + break + } + fallthrough + + case ONAME, OLITERAL, OTYPE: + m = n + } + + return m +} + +func isnil(n *Node) bool { + if n == nil { + return false + } + if n.Op != OLITERAL { + return false + } + if n.Val().Ctype() != CTNIL { + return false + } + return true +} + +func isptrto(t *Type, et int) bool { + if t == nil { + return false + } + if !Isptr[t.Etype] { + return false + } + t = t.Type + if t == nil { + return false + } + if int(t.Etype) != et { + return false + } + return true +} + +func Istype(t *Type, et int) bool { + return t != nil && int(t.Etype) == et +} + +func Isfixedarray(t *Type) bool { + return t != nil && t.Etype == TARRAY && t.Bound >= 0 +} + +func Isslice(t *Type) bool { + return t != nil && t.Etype == TARRAY && t.Bound < 0 +} + +func isblank(n *Node) bool { + if n == nil { + return false + } + return isblanksym(n.Sym) +} + +func isblanksym(s *Sym) bool { + return s != nil && s.Name == "_" +} + +func Isinter(t *Type) bool { + return t != nil && t.Etype == TINTER +} + +func isnilinter(t *Type) bool { + if !Isinter(t) { + return false + } + if t.Type != nil { + return false + } + return true +} + +func isideal(t *Type) bool { + if t == nil { + return false + } + if t == idealstring || t == idealbool { + return true + } + switch t.Etype { + case TNIL, TIDEAL: + return true + } + + return false +} + +/* + * given receiver of type t (t == r or t == *r) + * return type to hang methods off (r). + */ +func methtype(t *Type, mustname int) *Type { + if t == nil { + return nil + } + + // strip away pointer if it's there + if Isptr[t.Etype] { + if t.Sym != nil { + return nil + } + t = t.Type + if t == nil { + return nil + } + } + + // need a type name + if t.Sym == nil && (mustname != 0 || t.Etype != TSTRUCT) { + return nil + } + + // check types + if !issimple[t.Etype] { + switch t.Etype { + default: + return nil + + case TSTRUCT, + TARRAY, + TMAP, + TCHAN, + TSTRING, + TFUNC: + break + } + } + + return t +} + +func cplxsubtype(et int) int { + switch et { + case TCOMPLEX64: + return TFLOAT32 + + case TCOMPLEX128: + return TFLOAT64 + } + + Fatal("cplxsubtype: %v\n", Econv(int(et), 0)) + return 0 +} + +func eqnote(a, b *string) bool { + return a == b || a != nil && b != nil && *a == *b +} + +type TypePairList struct { + t1 *Type + t2 *Type + next *TypePairList +} + +func onlist(l *TypePairList, t1 *Type, t2 *Type) bool { + for ; l != nil; l = l.next { + if (l.t1 == t1 && l.t2 == t2) || (l.t1 == t2 && l.t2 == t1) { + return true + } + } + return false +} + +// Return 1 if t1 and t2 are identical, following the spec rules. +// +// Any cyclic type must go through a named type, and if one is +// named, it is only identical to the other if they are the same +// pointer (t1 == t2), so there's no chance of chasing cycles +// ad infinitum, so no need for a depth counter. +func Eqtype(t1 *Type, t2 *Type) bool { + return eqtype1(t1, t2, nil) +} + +func eqtype1(t1 *Type, t2 *Type, assumed_equal *TypePairList) bool { + if t1 == t2 { + return true + } + if t1 == nil || t2 == nil || t1.Etype != t2.Etype { + return false + } + if t1.Sym != nil || t2.Sym != nil { + // Special case: we keep byte and uint8 separate + // for error messages. Treat them as equal. + switch t1.Etype { + case TUINT8: + if (t1 == Types[TUINT8] || t1 == bytetype) && (t2 == Types[TUINT8] || t2 == bytetype) { + return true + } + + case TINT, TINT32: + if (t1 == Types[runetype.Etype] || t1 == runetype) && (t2 == Types[runetype.Etype] || t2 == runetype) { + return true + } + } + + return false + } + + if onlist(assumed_equal, t1, t2) { + return true + } + var l TypePairList + l.next = assumed_equal + l.t1 = t1 + l.t2 = t2 + + switch t1.Etype { + case TINTER, TSTRUCT: + t1 = t1.Type + t2 = t2.Type + for ; t1 != nil && t2 != nil; t1, t2 = t1.Down, t2.Down { + if t1.Etype != TFIELD || t2.Etype != TFIELD { + Fatal("struct/interface missing field: %v %v", t1, t2) + } + if t1.Sym != t2.Sym || t1.Embedded != t2.Embedded || !eqtype1(t1.Type, t2.Type, &l) || !eqnote(t1.Note, t2.Note) { + return false + } + } + + if t1 == nil && t2 == nil { + return true + } + return false + + // Loop over structs: receiver, in, out. + case TFUNC: + t1 = t1.Type + t2 = t2.Type + for ; t1 != nil && t2 != nil; t1, t2 = t1.Down, t2.Down { + if t1.Etype != TSTRUCT || t2.Etype != TSTRUCT { + Fatal("func missing struct: %v %v", t1, t2) + } + + // Loop over fields in structs, ignoring argument names. + ta := t1.Type + tb := t2.Type + for ; ta != nil && tb != nil; ta, tb = ta.Down, tb.Down { + if ta.Etype != TFIELD || tb.Etype != TFIELD { + Fatal("func struct missing field: %v %v", ta, tb) + } + if ta.Isddd != tb.Isddd || !eqtype1(ta.Type, tb.Type, &l) { + return false + } + } + + if ta != nil || tb != nil { + return false + } + } + + if t1 == nil && t2 == nil { + return true + } + return false + + case TARRAY: + if t1.Bound != t2.Bound { + return false + } + + case TCHAN: + if t1.Chan != t2.Chan { + return false + } + } + + if eqtype1(t1.Down, t2.Down, &l) && eqtype1(t1.Type, t2.Type, &l) { + return true + } + return false +} + +// Are t1 and t2 equal struct types when field names are ignored? +// For deciding whether the result struct from g can be copied +// directly when compiling f(g()). +func eqtypenoname(t1 *Type, t2 *Type) bool { + if t1 == nil || t2 == nil || t1.Etype != TSTRUCT || t2.Etype != TSTRUCT { + return false + } + + t1 = t1.Type + t2 = t2.Type + for { + if !Eqtype(t1, t2) { + return false + } + if t1 == nil { + return true + } + t1 = t1.Down + t2 = t2.Down + } +} + +// Is type src assignment compatible to type dst? +// If so, return op code to use in conversion. +// If not, return 0. +func assignop(src *Type, dst *Type, why *string) int { + if why != nil { + *why = "" + } + + // TODO(rsc,lvd): This behaves poorly in the presence of inlining. + // https://golang.org/issue/2795 + if safemode != 0 && importpkg == nil && src != nil && src.Etype == TUNSAFEPTR { + Yyerror("cannot use unsafe.Pointer") + errorexit() + } + + if src == dst { + return OCONVNOP + } + if src == nil || dst == nil || src.Etype == TFORW || dst.Etype == TFORW || src.Orig == nil || dst.Orig == nil { + return 0 + } + + // 1. src type is identical to dst. + if Eqtype(src, dst) { + return OCONVNOP + } + + // 2. src and dst have identical underlying types + // and either src or dst is not a named type or + // both are empty interface types. + // For assignable but different non-empty interface types, + // we want to recompute the itab. + if Eqtype(src.Orig, dst.Orig) && (src.Sym == nil || dst.Sym == nil || isnilinter(src)) { + return OCONVNOP + } + + // 3. dst is an interface type and src implements dst. + if dst.Etype == TINTER && src.Etype != TNIL { + var missing *Type + var ptr int + var have *Type + if implements(src, dst, &missing, &have, &ptr) { + return OCONVIFACE + } + + // we'll have complained about this method anyway, suppress spurious messages. + if have != nil && have.Sym == missing.Sym && (have.Type.Broke != 0 || missing.Type.Broke != 0) { + return OCONVIFACE + } + + if why != nil { + if isptrto(src, TINTER) { + *why = fmt.Sprintf(":\n\t%v is pointer to interface, not interface", src) + } else if have != nil && have.Sym == missing.Sym && have.Nointerface { + *why = fmt.Sprintf(":\n\t%v does not implement %v (%v method is marked 'nointerface')", src, dst, missing.Sym) + } else if have != nil && have.Sym == missing.Sym { + *why = fmt.Sprintf(":\n\t%v does not implement %v (wrong type for %v method)\n"+"\t\thave %v%v\n\t\twant %v%v", src, dst, missing.Sym, have.Sym, Tconv(have.Type, obj.FmtShort|obj.FmtByte), missing.Sym, Tconv(missing.Type, obj.FmtShort|obj.FmtByte)) + } else if ptr != 0 { + *why = fmt.Sprintf(":\n\t%v does not implement %v (%v method has pointer receiver)", src, dst, missing.Sym) + } else if have != nil { + *why = fmt.Sprintf(":\n\t%v does not implement %v (missing %v method)\n"+"\t\thave %v%v\n\t\twant %v%v", src, dst, missing.Sym, have.Sym, Tconv(have.Type, obj.FmtShort|obj.FmtByte), missing.Sym, Tconv(missing.Type, obj.FmtShort|obj.FmtByte)) + } else { + *why = fmt.Sprintf(":\n\t%v does not implement %v (missing %v method)", src, dst, missing.Sym) + } + } + + return 0 + } + + if isptrto(dst, TINTER) { + if why != nil { + *why = fmt.Sprintf(":\n\t%v is pointer to interface, not interface", dst) + } + return 0 + } + + if src.Etype == TINTER && dst.Etype != TBLANK { + var have *Type + var ptr int + var missing *Type + if why != nil && implements(dst, src, &missing, &have, &ptr) { + *why = ": need type assertion" + } + return 0 + } + + // 4. src is a bidirectional channel value, dst is a channel type, + // src and dst have identical element types, and + // either src or dst is not a named type. + if src.Etype == TCHAN && src.Chan == Cboth && dst.Etype == TCHAN { + if Eqtype(src.Type, dst.Type) && (src.Sym == nil || dst.Sym == nil) { + return OCONVNOP + } + } + + // 5. src is the predeclared identifier nil and dst is a nillable type. + if src.Etype == TNIL { + switch dst.Etype { + case TARRAY: + if dst.Bound != -100 { // not slice + break + } + fallthrough + + case TPTR32, + TPTR64, + TFUNC, + TMAP, + TCHAN, + TINTER: + return OCONVNOP + } + } + + // 6. rule about untyped constants - already converted by defaultlit. + + // 7. Any typed value can be assigned to the blank identifier. + if dst.Etype == TBLANK { + return OCONVNOP + } + + return 0 +} + +// Can we convert a value of type src to a value of type dst? +// If so, return op code to use in conversion (maybe OCONVNOP). +// If not, return 0. +func convertop(src *Type, dst *Type, why *string) int { + if why != nil { + *why = "" + } + + if src == dst { + return OCONVNOP + } + if src == nil || dst == nil { + return 0 + } + + // 1. src can be assigned to dst. + op := assignop(src, dst, why) + if op != 0 { + return op + } + + // The rules for interfaces are no different in conversions + // than assignments. If interfaces are involved, stop now + // with the good message from assignop. + // Otherwise clear the error. + if src.Etype == TINTER || dst.Etype == TINTER { + return 0 + } + if why != nil { + *why = "" + } + + // 2. src and dst have identical underlying types. + if Eqtype(src.Orig, dst.Orig) { + return OCONVNOP + } + + // 3. src and dst are unnamed pointer types + // and their base types have identical underlying types. + if Isptr[src.Etype] && Isptr[dst.Etype] && src.Sym == nil && dst.Sym == nil { + if Eqtype(src.Type.Orig, dst.Type.Orig) { + return OCONVNOP + } + } + + // 4. src and dst are both integer or floating point types. + if (Isint[src.Etype] || Isfloat[src.Etype]) && (Isint[dst.Etype] || Isfloat[dst.Etype]) { + if Simtype[src.Etype] == Simtype[dst.Etype] { + return OCONVNOP + } + return OCONV + } + + // 5. src and dst are both complex types. + if Iscomplex[src.Etype] && Iscomplex[dst.Etype] { + if Simtype[src.Etype] == Simtype[dst.Etype] { + return OCONVNOP + } + return OCONV + } + + // 6. src is an integer or has type []byte or []rune + // and dst is a string type. + if Isint[src.Etype] && dst.Etype == TSTRING { + return ORUNESTR + } + + if Isslice(src) && dst.Etype == TSTRING { + if src.Type.Etype == bytetype.Etype { + return OARRAYBYTESTR + } + if src.Type.Etype == runetype.Etype { + return OARRAYRUNESTR + } + } + + // 7. src is a string and dst is []byte or []rune. + // String to slice. + if src.Etype == TSTRING && Isslice(dst) { + if dst.Type.Etype == bytetype.Etype { + return OSTRARRAYBYTE + } + if dst.Type.Etype == runetype.Etype { + return OSTRARRAYRUNE + } + } + + // 8. src is a pointer or uintptr and dst is unsafe.Pointer. + if (Isptr[src.Etype] || src.Etype == TUINTPTR) && dst.Etype == TUNSAFEPTR { + return OCONVNOP + } + + // 9. src is unsafe.Pointer and dst is a pointer or uintptr. + if src.Etype == TUNSAFEPTR && (Isptr[dst.Etype] || dst.Etype == TUINTPTR) { + return OCONVNOP + } + + return 0 +} + +func assignconv(n *Node, t *Type, context string) *Node { + return assignconvfn(n, t, func() string { return context }) +} + +// Convert node n for assignment to type t. +func assignconvfn(n *Node, t *Type, context func() string) *Node { + if n == nil || n.Type == nil || n.Type.Broke != 0 { + return n + } + + if t.Etype == TBLANK && n.Type.Etype == TNIL { + Yyerror("use of untyped nil") + } + + old := n + old.Diag++ // silence errors about n; we'll issue one below + defaultlit(&n, t) + old.Diag-- + if t.Etype == TBLANK { + return n + } + + // Convert ideal bool from comparison to plain bool + // if the next step is non-bool (like interface{}). + if n.Type == idealbool && t.Etype != TBOOL { + if n.Op == ONAME || n.Op == OLITERAL { + r := Nod(OCONVNOP, n, nil) + r.Type = Types[TBOOL] + r.Typecheck = 1 + r.Implicit = true + n = r + } + } + + if Eqtype(n.Type, t) { + return n + } + + var why string + op := assignop(n.Type, t, &why) + if op == 0 { + Yyerror("cannot use %v as type %v in %s%s", Nconv(n, obj.FmtLong), t, context(), why) + op = OCONV + } + + r := Nod(op, n, nil) + r.Type = t + r.Typecheck = 1 + r.Implicit = true + r.Orig = n.Orig + return r +} + +// substArgTypes substitutes the given list of types for +// successive occurrences of the "any" placeholder in the +// type syntax expression n.Type. +func substArgTypes(n *Node, types ...*Type) { + for _, t := range types { + dowidth(t) + } + substAny(&n.Type, &types) + if len(types) > 0 { + Fatal("substArgTypes: too many argument types") + } +} + +// substAny walks *tp, replacing instances of "any" with successive +// elements removed from types. +func substAny(tp **Type, types *[]*Type) { + for { + t := *tp + if t == nil { + return + } + if t.Etype == TANY && t.Copyany != 0 { + if len(*types) == 0 { + Fatal("substArgTypes: not enough argument types") + } + *tp = (*types)[0] + *types = (*types)[1:] + } + + switch t.Etype { + case TPTR32, TPTR64, TCHAN, TARRAY: + tp = &t.Type + continue + + case TMAP: + substAny(&t.Down, types) + tp = &t.Type + continue + + case TFUNC: + substAny(&t.Type, types) + substAny(&t.Type.Down.Down, types) + substAny(&t.Type.Down, types) + + case TSTRUCT: + for t = t.Type; t != nil; t = t.Down { + substAny(&t.Type, types) + } + } + return + } +} + +/* + * Is this a 64-bit type? + */ +func Is64(t *Type) bool { + if t == nil { + return false + } + switch Simtype[t.Etype] { + case TINT64, TUINT64, TPTR64: + return true + } + + return false +} + +/* + * Is a conversion between t1 and t2 a no-op? + */ +func Noconv(t1 *Type, t2 *Type) bool { + e1 := int(Simtype[t1.Etype]) + e2 := int(Simtype[t2.Etype]) + + switch e1 { + case TINT8, TUINT8: + return e2 == TINT8 || e2 == TUINT8 + + case TINT16, TUINT16: + return e2 == TINT16 || e2 == TUINT16 + + case TINT32, TUINT32, TPTR32: + return e2 == TINT32 || e2 == TUINT32 || e2 == TPTR32 + + case TINT64, TUINT64, TPTR64: + return e2 == TINT64 || e2 == TUINT64 || e2 == TPTR64 + + case TFLOAT32: + return e2 == TFLOAT32 + + case TFLOAT64: + return e2 == TFLOAT64 + } + + return false +} + +func shallow(t *Type) *Type { + if t == nil { + return nil + } + nt := typ(0) + *nt = *t + if t.Orig == t { + nt.Orig = nt + } + return nt +} + +func deep(t *Type) *Type { + if t == nil { + return nil + } + + var nt *Type + switch t.Etype { + default: + nt = t // share from here down + + case TANY: + nt = shallow(t) + nt.Copyany = 1 + + case TPTR32, TPTR64, TCHAN, TARRAY: + nt = shallow(t) + nt.Type = deep(t.Type) + + case TMAP: + nt = shallow(t) + nt.Down = deep(t.Down) + nt.Type = deep(t.Type) + + case TFUNC: + nt = shallow(t) + nt.Type = deep(t.Type) + nt.Type.Down = deep(t.Type.Down) + nt.Type.Down.Down = deep(t.Type.Down.Down) + + case TSTRUCT: + nt = shallow(t) + nt.Type = shallow(t.Type) + xt := nt.Type + + for t = t.Type; t != nil; t = t.Down { + xt.Type = deep(t.Type) + xt.Down = shallow(t.Down) + xt = xt.Down + } + } + + return nt +} + +func syslook(name string, copy int) *Node { + s := Pkglookup(name, Runtimepkg) + if s == nil || s.Def == nil { + Fatal("syslook: can't find runtime.%s", name) + } + + if copy == 0 { + return s.Def + } + + n := Nod(0, nil, nil) + *n = *s.Def + n.Type = deep(s.Def.Type) + + return n +} + +/* + * compute a hash value for type t. + * if t is a method type, ignore the receiver + * so that the hash can be used in interface checks. + * %T already contains + * all the necessary logic to generate a representation + * of the type that completely describes it. + * using smprint here avoids duplicating that code. + * using md5 here is overkill, but i got tired of + * accidental collisions making the runtime think + * two types are equal when they really aren't. + */ +func typehash(t *Type) uint32 { + var p string + + if t.Thistuple != 0 { + // hide method receiver from Tpretty + t.Thistuple = 0 + + p = Tconv(t, obj.FmtLeft|obj.FmtUnsigned) + t.Thistuple = 1 + } else { + p = Tconv(t, obj.FmtLeft|obj.FmtUnsigned) + } + + //print("typehash: %s\n", p); + h := md5.Sum([]byte(p)) + return binary.LittleEndian.Uint32(h[:4]) +} + +var initPtrtoDone bool + +var ( + ptrToUint8 *Type + ptrToAny *Type + ptrToString *Type + ptrToBool *Type + ptrToInt32 *Type +) + +func initPtrto() { + ptrToUint8 = ptrto1(Types[TUINT8]) + ptrToAny = ptrto1(Types[TANY]) + ptrToString = ptrto1(Types[TSTRING]) + ptrToBool = ptrto1(Types[TBOOL]) + ptrToInt32 = ptrto1(Types[TINT32]) +} + +func ptrto1(t *Type) *Type { + t1 := typ(Tptr) + t1.Type = t + t1.Width = int64(Widthptr) + t1.Align = uint8(Widthptr) + return t1 +} + +// Ptrto returns the Type *t. +// The returned struct must not be modified. +func Ptrto(t *Type) *Type { + if Tptr == 0 { + Fatal("ptrto: no tptr") + } + // Reduce allocations by pre-creating common cases. + if !initPtrtoDone { + initPtrto() + initPtrtoDone = true + } + switch t { + case Types[TUINT8]: + return ptrToUint8 + case Types[TINT32]: + return ptrToInt32 + case Types[TANY]: + return ptrToAny + case Types[TSTRING]: + return ptrToString + case Types[TBOOL]: + return ptrToBool + } + return ptrto1(t) +} + +func frame(context int) { + var l *NodeList + + if context != 0 { + fmt.Printf("--- external frame ---\n") + l = externdcl + } else if Curfn != nil { + fmt.Printf("--- %v frame ---\n", Curfn.Func.Nname.Sym) + l = Curfn.Func.Dcl + } else { + return + } + + var n *Node + var w int64 + for ; l != nil; l = l.Next { + n = l.N + w = -1 + if n.Type != nil { + w = n.Type.Width + } + switch n.Op { + case ONAME: + fmt.Printf("%v %v G%d %v width=%d\n", Oconv(int(n.Op), 0), n.Sym, n.Name.Vargen, n.Type, w) + + case OTYPE: + fmt.Printf("%v %v width=%d\n", Oconv(int(n.Op), 0), n.Type, w) + } + } +} + +/* + * calculate sethi/ullman number + * roughly how many registers needed to + * compile a node. used to compile the + * hardest side first to minimize registers. + */ +func ullmancalc(n *Node) { + if n == nil { + return + } + + var ul int + var ur int + if n.Ninit != nil { + ul = UINF + goto out + } + + switch n.Op { + case OREGISTER, OLITERAL, ONAME: + ul = 1 + if n.Class == PPARAMREF || (n.Class&PHEAP != 0) { + ul++ + } + goto out + + case OCALL, OCALLFUNC, OCALLMETH, OCALLINTER, OASWB: + ul = UINF + goto out + + // hard with race detector + case OANDAND, OOROR: + if flag_race != 0 { + ul = UINF + goto out + } + } + + ul = 1 + if n.Left != nil { + ul = int(n.Left.Ullman) + } + ur = 1 + if n.Right != nil { + ur = int(n.Right.Ullman) + } + if ul == ur { + ul += 1 + } + if ur > ul { + ul = ur + } + +out: + if ul > 200 { + ul = 200 // clamp to uchar with room to grow + } + n.Ullman = uint8(ul) +} + +func badtype(o int, tl *Type, tr *Type) { + fmt_ := "" + if tl != nil { + fmt_ += fmt.Sprintf("\n\t%v", tl) + } + if tr != nil { + fmt_ += fmt.Sprintf("\n\t%v", tr) + } + + // common mistake: *struct and *interface. + if tl != nil && tr != nil && Isptr[tl.Etype] && Isptr[tr.Etype] { + if tl.Type.Etype == TSTRUCT && tr.Type.Etype == TINTER { + fmt_ += "\n\t(*struct vs *interface)" + } else if tl.Type.Etype == TINTER && tr.Type.Etype == TSTRUCT { + fmt_ += "\n\t(*interface vs *struct)" + } + } + + s := fmt_ + Yyerror("illegal types for operand: %v%s", Oconv(int(o), 0), s) +} + +/* + * iterator to walk a structure declaration + */ +func Structfirst(s *Iter, nn **Type) *Type { + var t *Type + + n := *nn + if n == nil { + goto bad + } + + switch n.Etype { + default: + goto bad + + case TSTRUCT, TINTER, TFUNC: + break + } + + t = n.Type + if t == nil { + return nil + } + + if t.Etype != TFIELD { + Fatal("structfirst: not field %v", t) + } + + s.T = t + return t + +bad: + Fatal("structfirst: not struct %v", n) + + return nil +} + +func structnext(s *Iter) *Type { + n := s.T + t := n.Down + if t == nil { + return nil + } + + if t.Etype != TFIELD { + Fatal("structnext: not struct %v", n) + + return nil + } + + s.T = t + return t +} + +/* + * iterator to this and inargs in a function + */ +func funcfirst(s *Iter, t *Type) *Type { + var fp *Type + + if t == nil { + goto bad + } + + if t.Etype != TFUNC { + goto bad + } + + s.Tfunc = t + s.Done = 0 + fp = Structfirst(s, getthis(t)) + if fp == nil { + s.Done = 1 + fp = Structfirst(s, getinarg(t)) + } + + return fp + +bad: + Fatal("funcfirst: not func %v", t) + return nil +} + +func funcnext(s *Iter) *Type { + fp := structnext(s) + if fp == nil && s.Done == 0 { + s.Done = 1 + fp = Structfirst(s, getinarg(s.Tfunc)) + } + + return fp +} + +func getthis(t *Type) **Type { + if t.Etype != TFUNC { + Fatal("getthis: not a func %v", t) + } + return &t.Type +} + +func Getoutarg(t *Type) **Type { + if t.Etype != TFUNC { + Fatal("getoutarg: not a func %v", t) + } + return &t.Type.Down +} + +func getinarg(t *Type) **Type { + if t.Etype != TFUNC { + Fatal("getinarg: not a func %v", t) + } + return &t.Type.Down.Down +} + +func getthisx(t *Type) *Type { + return *getthis(t) +} + +func getoutargx(t *Type) *Type { + return *Getoutarg(t) +} + +func getinargx(t *Type) *Type { + return *getinarg(t) +} + +// Brcom returns !(op). +// For example, Brcom(==) is !=. +func Brcom(a int) int { + switch a { + case OEQ: + return ONE + case ONE: + return OEQ + case OLT: + return OGE + case OGT: + return OLE + case OLE: + return OGT + case OGE: + return OLT + } + Fatal("brcom: no com for %v\n", Oconv(a, 0)) + return a +} + +// Brrev returns reverse(op). +// For example, Brrev(<) is >. +func Brrev(a int) int { + switch a { + case OEQ: + return OEQ + case ONE: + return ONE + case OLT: + return OGT + case OGT: + return OLT + case OLE: + return OGE + case OGE: + return OLE + } + Fatal("brrev: no rev for %v\n", Oconv(a, 0)) + return a +} + +/* + * return side effect-free n, appending side effects to init. + * result is assignable if n is. + */ +func safeexpr(n *Node, init **NodeList) *Node { + if n == nil { + return nil + } + + if n.Ninit != nil { + walkstmtlist(n.Ninit) + *init = concat(*init, n.Ninit) + n.Ninit = nil + } + + switch n.Op { + case ONAME, OLITERAL: + return n + + case ODOT, OLEN, OCAP: + l := safeexpr(n.Left, init) + if l == n.Left { + return n + } + r := Nod(OXXX, nil, nil) + *r = *n + r.Left = l + typecheck(&r, Erv) + walkexpr(&r, init) + return r + + case ODOTPTR, OIND: + l := safeexpr(n.Left, init) + if l == n.Left { + return n + } + a := Nod(OXXX, nil, nil) + *a = *n + a.Left = l + walkexpr(&a, init) + return a + + case OINDEX, OINDEXMAP: + l := safeexpr(n.Left, init) + r := safeexpr(n.Right, init) + if l == n.Left && r == n.Right { + return n + } + a := Nod(OXXX, nil, nil) + *a = *n + a.Left = l + a.Right = r + walkexpr(&a, init) + return a + } + + // make a copy; must not be used as an lvalue + if islvalue(n) { + Fatal("missing lvalue case in safeexpr: %v", n) + } + return cheapexpr(n, init) +} + +func copyexpr(n *Node, t *Type, init **NodeList) *Node { + l := temp(t) + a := Nod(OAS, l, n) + typecheck(&a, Etop) + walkexpr(&a, init) + *init = list(*init, a) + return l +} + +/* + * return side-effect free and cheap n, appending side effects to init. + * result may not be assignable. + */ +func cheapexpr(n *Node, init **NodeList) *Node { + switch n.Op { + case ONAME, OLITERAL: + return n + } + + return copyexpr(n, n.Type, init) +} + +/* + * return n in a local variable of type t if it is not already. + * the value is guaranteed not to change except by direct + * assignment to it. + */ +func localexpr(n *Node, t *Type, init **NodeList) *Node { + if n.Op == ONAME && (!n.Addrtaken || strings.HasPrefix(n.Sym.Name, "autotmp_")) && (n.Class == PAUTO || n.Class == PPARAM || n.Class == PPARAMOUT) && convertop(n.Type, t, nil) == OCONVNOP { + return n + } + + return copyexpr(n, t, init) +} + +func Setmaxarg(t *Type, extra int32) { + dowidth(t) + w := t.Argwid + if w >= Thearch.MAXWIDTH { + Fatal("bad argwid %v", t) + } + w += int64(extra) + if w >= Thearch.MAXWIDTH { + Fatal("bad argwid %d + %v", extra, t) + } + if w > Maxarg { + Maxarg = w + } +} + +/* + * unicode-aware case-insensitive strcmp + */ + +/* + * code to resolve elided DOTs + * in embedded types + */ + +// search depth 0 -- +// return count of fields+methods +// found with a given name +func lookdot0(s *Sym, t *Type, save **Type, ignorecase int) int { + u := t + if Isptr[u.Etype] { + u = u.Type + } + + c := 0 + if u.Etype == TSTRUCT || u.Etype == TINTER { + for f := u.Type; f != nil; f = f.Down { + if f.Sym == s || (ignorecase != 0 && f.Type.Etype == TFUNC && f.Type.Thistuple > 0 && strings.EqualFold(f.Sym.Name, s.Name)) { + if save != nil { + *save = f + } + c++ + } + } + } + + u = methtype(t, 0) + if u != nil { + for f := u.Method; f != nil; f = f.Down { + if f.Embedded == 0 && (f.Sym == s || (ignorecase != 0 && strings.EqualFold(f.Sym.Name, s.Name))) { + if save != nil { + *save = f + } + c++ + } + } + } + + return c +} + +// search depth d for field/method s -- +// return count of fields+methods +// found at search depth. +// answer is in dotlist array and +// count of number of ways is returned. +func adddot1(s *Sym, t *Type, d int, save **Type, ignorecase int) int { + if t.Trecur != 0 { + return 0 + } + t.Trecur = 1 + + var c int + var u *Type + var a int + if d == 0 { + c = lookdot0(s, t, save, ignorecase) + goto out + } + + c = 0 + u = t + if Isptr[u.Etype] { + u = u.Type + } + if u.Etype != TSTRUCT && u.Etype != TINTER { + goto out + } + + d-- + for f := u.Type; f != nil; f = f.Down { + if f.Embedded == 0 { + continue + } + if f.Sym == nil { + continue + } + a = adddot1(s, f.Type, d, save, ignorecase) + if a != 0 && c == 0 { + dotlist[d].field = f + } + c += a + } + +out: + t.Trecur = 0 + return c +} + +// in T.field +// find missing fields that +// will give shortest unique addressing. +// modify the tree with missing type names. +func adddot(n *Node) *Node { + typecheck(&n.Left, Etype|Erv) + n.Diag |= n.Left.Diag + t := n.Left.Type + if t == nil { + return n + } + + if n.Left.Op == OTYPE { + return n + } + + if n.Right.Op != ONAME { + return n + } + s := n.Right.Sym + if s == nil { + return n + } + + var c int + for d := 0; d < len(dotlist); d++ { + c = adddot1(s, t, d, nil, 0) + if c > 0 { + if c > 1 { + Yyerror("ambiguous selector %v", n) + n.Left = nil + return n + } + + // rebuild elided dots + for c := d - 1; c >= 0; c-- { + n.Left = Nod(ODOT, n.Left, newname(dotlist[c].field.Sym)) + n.Left.Implicit = true + } + + return n + } + } + + return n +} + +/* + * code to help generate trampoline + * functions for methods on embedded + * subtypes. + * these are approx the same as + * the corresponding adddot routines + * except that they expect to be called + * with unique tasks and they return + * the actual methods. + */ +type Symlink struct { + field *Type + good uint8 + followptr uint8 + link *Symlink +} + +var slist *Symlink + +func expand0(t *Type, followptr int) { + u := t + if Isptr[u.Etype] { + followptr = 1 + u = u.Type + } + + if u.Etype == TINTER { + var sl *Symlink + for f := u.Type; f != nil; f = f.Down { + if f.Sym.Flags&SymUniq != 0 { + continue + } + f.Sym.Flags |= SymUniq + sl = new(Symlink) + sl.field = f + sl.link = slist + sl.followptr = uint8(followptr) + slist = sl + } + + return + } + + u = methtype(t, 0) + if u != nil { + var sl *Symlink + for f := u.Method; f != nil; f = f.Down { + if f.Sym.Flags&SymUniq != 0 { + continue + } + f.Sym.Flags |= SymUniq + sl = new(Symlink) + sl.field = f + sl.link = slist + sl.followptr = uint8(followptr) + slist = sl + } + } +} + +func expand1(t *Type, d int, followptr int) { + if t.Trecur != 0 { + return + } + if d == 0 { + return + } + t.Trecur = 1 + + if d != len(dotlist)-1 { + expand0(t, followptr) + } + + u := t + if Isptr[u.Etype] { + followptr = 1 + u = u.Type + } + + if u.Etype != TSTRUCT && u.Etype != TINTER { + goto out + } + + for f := u.Type; f != nil; f = f.Down { + if f.Embedded == 0 { + continue + } + if f.Sym == nil { + continue + } + expand1(f.Type, d-1, followptr) + } + +out: + t.Trecur = 0 +} + +func expandmeth(t *Type) { + if t == nil || t.Xmethod != nil { + return + } + + // mark top-level method symbols + // so that expand1 doesn't consider them. + var f *Type + for f = t.Method; f != nil; f = f.Down { + f.Sym.Flags |= SymUniq + } + + // generate all reachable methods + slist = nil + + expand1(t, len(dotlist)-1, 0) + + // check each method to be uniquely reachable + var c int + var d int + for sl := slist; sl != nil; sl = sl.link { + sl.field.Sym.Flags &^= SymUniq + for d = 0; d < len(dotlist); d++ { + c = adddot1(sl.field.Sym, t, d, &f, 0) + if c == 0 { + continue + } + if c == 1 { + // addot1 may have dug out arbitrary fields, we only want methods. + if f.Type.Etype == TFUNC && f.Type.Thistuple > 0 { + sl.good = 1 + sl.field = f + } + } + + break + } + } + + for f = t.Method; f != nil; f = f.Down { + f.Sym.Flags &^= SymUniq + } + + t.Xmethod = t.Method + for sl := slist; sl != nil; sl = sl.link { + if sl.good != 0 { + // add it to the base type method list + f = typ(TFIELD) + + *f = *sl.field + f.Embedded = 1 // needs a trampoline + if sl.followptr != 0 { + f.Embedded = 2 + } + f.Down = t.Xmethod + t.Xmethod = f + } + } +} + +/* + * Given funarg struct list, return list of ODCLFIELD Node fn args. + */ +func structargs(tl **Type, mustname int) *NodeList { + var savet Iter + var a *Node + var n *Node + var buf string + + var args *NodeList + gen := 0 + for t := Structfirst(&savet, tl); t != nil; t = structnext(&savet) { + n = nil + if mustname != 0 && (t.Sym == nil || t.Sym.Name == "_") { + // invent a name so that we can refer to it in the trampoline + buf = fmt.Sprintf(".anon%d", gen) + gen++ + + n = newname(Lookup(buf)) + } else if t.Sym != nil { + n = newname(t.Sym) + } + a = Nod(ODCLFIELD, n, typenod(t.Type)) + a.Isddd = t.Isddd + if n != nil { + n.Isddd = t.Isddd + } + args = list(args, a) + } + + return args +} + +/* + * Generate a wrapper function to convert from + * a receiver of type T to a receiver of type U. + * That is, + * + * func (t T) M() { + * ... + * } + * + * already exists; this function generates + * + * func (u U) M() { + * u.M() + * } + * + * where the types T and U are such that u.M() is valid + * and calls the T.M method. + * The resulting function is for use in method tables. + * + * rcvr - U + * method - M func (t T)(), a TFIELD type struct + * newnam - the eventual mangled name of this function + */ + +var genwrapper_linehistdone int = 0 + +func genwrapper(rcvr *Type, method *Type, newnam *Sym, iface int) { + if false && Debug['r'] != 0 { + fmt.Printf("genwrapper rcvrtype=%v method=%v newnam=%v\n", rcvr, method, newnam) + } + + lexlineno++ + lineno = lexlineno + if genwrapper_linehistdone == 0 { + // All the wrappers can share the same linehist entry. + linehistpush("") + + genwrapper_linehistdone = 1 + } + + dclcontext = PEXTERN + markdcl() + + this := Nod(ODCLFIELD, newname(Lookup(".this")), typenod(rcvr)) + this.Left.Name.Param.Ntype = this.Right + in := structargs(getinarg(method.Type), 1) + out := structargs(Getoutarg(method.Type), 0) + + t := Nod(OTFUNC, nil, nil) + l := list1(this) + if iface != 0 && rcvr.Width < Types[Tptr].Width { + // Building method for interface table and receiver + // is smaller than the single pointer-sized word + // that the interface call will pass in. + // Add a dummy padding argument after the + // receiver to make up the difference. + tpad := typ(TARRAY) + + tpad.Type = Types[TUINT8] + tpad.Bound = Types[Tptr].Width - rcvr.Width + pad := Nod(ODCLFIELD, newname(Lookup(".pad")), typenod(tpad)) + l = list(l, pad) + } + + t.List = concat(l, in) + t.Rlist = out + + fn := Nod(ODCLFUNC, nil, nil) + fn.Func.Nname = newname(newnam) + fn.Func.Nname.Name.Defn = fn + fn.Func.Nname.Name.Param.Ntype = t + declare(fn.Func.Nname, PFUNC) + funchdr(fn) + + // arg list + var args *NodeList + + isddd := false + for l := in; l != nil; l = l.Next { + args = list(args, l.N.Left) + isddd = l.N.Left.Isddd + } + + methodrcvr := getthisx(method.Type).Type.Type + + // generate nil pointer check for better error + if Isptr[rcvr.Etype] && rcvr.Type == methodrcvr { + // generating wrapper from *T to T. + n := Nod(OIF, nil, nil) + + n.Left = Nod(OEQ, this.Left, nodnil()) + + // these strings are already in the reflect tables, + // so no space cost to use them here. + var l *NodeList + + var v Val + v.U = rcvr.Type.Sym.Pkg.Name // package name + l = list(l, nodlit(v)) + v.U = rcvr.Type.Sym.Name // type name + l = list(l, nodlit(v)) + v.U = method.Sym.Name + l = list(l, nodlit(v)) // method name + call := Nod(OCALL, syslook("panicwrap", 0), nil) + call.List = l + n.Nbody = list1(call) + fn.Nbody = list(fn.Nbody, n) + } + + dot := adddot(Nod(OXDOT, this.Left, newname(method.Sym))) + + // generate call + if flag_race == 0 && Isptr[rcvr.Etype] && Isptr[methodrcvr.Etype] && method.Embedded != 0 && !isifacemethod(method.Type) { + // generate tail call: adjust pointer receiver and jump to embedded method. + dot = dot.Left // skip final .M + if !Isptr[dotlist[0].field.Type.Etype] { + dot = Nod(OADDR, dot, nil) + } + as := Nod(OAS, this.Left, Nod(OCONVNOP, dot, nil)) + as.Right.Type = rcvr + fn.Nbody = list(fn.Nbody, as) + n := Nod(ORETJMP, nil, nil) + n.Left = newname(methodsym(method.Sym, methodrcvr, 0)) + fn.Nbody = list(fn.Nbody, n) + } else { + fn.Func.Wrapper = true // ignore frame for panic+recover matching + call := Nod(OCALL, dot, nil) + call.List = args + call.Isddd = isddd + if method.Type.Outtuple > 0 { + n := Nod(ORETURN, nil, nil) + n.List = list1(call) + call = n + } + + fn.Nbody = list(fn.Nbody, call) + } + + if false && Debug['r'] != 0 { + dumplist("genwrapper body", fn.Nbody) + } + + funcbody(fn) + Curfn = fn + + // wrappers where T is anonymous (struct or interface) can be duplicated. + if rcvr.Etype == TSTRUCT || rcvr.Etype == TINTER || Isptr[rcvr.Etype] && rcvr.Type.Etype == TSTRUCT { + fn.Func.Dupok = true + } + typecheck(&fn, Etop) + typechecklist(fn.Nbody, Etop) + + inlcalls(fn) + escAnalyze(list1(fn), false) + + Curfn = nil + funccompile(fn) +} + +func hashmem(t *Type) *Node { + sym := Pkglookup("memhash", Runtimepkg) + + n := newname(sym) + n.Class = PFUNC + tfn := Nod(OTFUNC, nil, nil) + tfn.List = list(tfn.List, Nod(ODCLFIELD, nil, typenod(Ptrto(t)))) + tfn.List = list(tfn.List, Nod(ODCLFIELD, nil, typenod(Types[TUINTPTR]))) + tfn.List = list(tfn.List, Nod(ODCLFIELD, nil, typenod(Types[TUINTPTR]))) + tfn.Rlist = list(tfn.Rlist, Nod(ODCLFIELD, nil, typenod(Types[TUINTPTR]))) + typecheck(&tfn, Etype) + n.Type = tfn.Type + return n +} + +func hashfor(t *Type) *Node { + var sym *Sym + + a := algtype1(t, nil) + switch a { + case AMEM: + Fatal("hashfor with AMEM type") + + case AINTER: + sym = Pkglookup("interhash", Runtimepkg) + + case ANILINTER: + sym = Pkglookup("nilinterhash", Runtimepkg) + + case ASTRING: + sym = Pkglookup("strhash", Runtimepkg) + + case AFLOAT32: + sym = Pkglookup("f32hash", Runtimepkg) + + case AFLOAT64: + sym = Pkglookup("f64hash", Runtimepkg) + + case ACPLX64: + sym = Pkglookup("c64hash", Runtimepkg) + + case ACPLX128: + sym = Pkglookup("c128hash", Runtimepkg) + + default: + sym = typesymprefix(".hash", t) + } + + n := newname(sym) + n.Class = PFUNC + tfn := Nod(OTFUNC, nil, nil) + tfn.List = list(tfn.List, Nod(ODCLFIELD, nil, typenod(Ptrto(t)))) + tfn.List = list(tfn.List, Nod(ODCLFIELD, nil, typenod(Types[TUINTPTR]))) + tfn.Rlist = list(tfn.Rlist, Nod(ODCLFIELD, nil, typenod(Types[TUINTPTR]))) + typecheck(&tfn, Etype) + n.Type = tfn.Type + return n +} + +/* + * Generate a helper function to compute the hash of a value of type t. + */ +func genhash(sym *Sym, t *Type) { + if Debug['r'] != 0 { + fmt.Printf("genhash %v %v\n", sym, t) + } + + lineno = 1 // less confusing than end of input + dclcontext = PEXTERN + markdcl() + + // func sym(p *T, h uintptr) uintptr + fn := Nod(ODCLFUNC, nil, nil) + + fn.Func.Nname = newname(sym) + fn.Func.Nname.Class = PFUNC + tfn := Nod(OTFUNC, nil, nil) + fn.Func.Nname.Name.Param.Ntype = tfn + + n := Nod(ODCLFIELD, newname(Lookup("p")), typenod(Ptrto(t))) + tfn.List = list(tfn.List, n) + np := n.Left + n = Nod(ODCLFIELD, newname(Lookup("h")), typenod(Types[TUINTPTR])) + tfn.List = list(tfn.List, n) + nh := n.Left + n = Nod(ODCLFIELD, nil, typenod(Types[TUINTPTR])) // return value + tfn.Rlist = list(tfn.Rlist, n) + + funchdr(fn) + typecheck(&fn.Func.Nname.Name.Param.Ntype, Etype) + + // genhash is only called for types that have equality but + // cannot be handled by the standard algorithms, + // so t must be either an array or a struct. + switch t.Etype { + default: + Fatal("genhash %v", t) + + case TARRAY: + if Isslice(t) { + Fatal("genhash %v", t) + } + + // An array of pure memory would be handled by the + // standard algorithm, so the element type must not be + // pure memory. + hashel := hashfor(t.Type) + + n := Nod(ORANGE, nil, Nod(OIND, np, nil)) + ni := newname(Lookup("i")) + ni.Type = Types[TINT] + n.List = list1(ni) + n.Colas = true + colasdefn(n.List, n) + ni = n.List.N + + // TODO: with aeshash we don't need these shift/mul parts + + // h = h<<3 | h>>61 + n.Nbody = list(n.Nbody, Nod(OAS, nh, Nod(OOR, Nod(OLSH, nh, Nodintconst(3)), Nod(ORSH, nh, Nodintconst(int64(Widthptr)*8-3))))) + + // h *= mul + // Same multipliers as in runtime.memhash. + var mul int64 + if Widthptr == 4 { + mul = 3267000013 + } else { + mul = 23344194077549503 + } + n.Nbody = list(n.Nbody, Nod(OAS, nh, Nod(OMUL, nh, Nodintconst(mul)))) + + // h = hashel(&p[i], h) + call := Nod(OCALL, hashel, nil) + + nx := Nod(OINDEX, np, ni) + nx.Bounded = true + na := Nod(OADDR, nx, nil) + na.Etype = 1 // no escape to heap + call.List = list(call.List, na) + call.List = list(call.List, nh) + n.Nbody = list(n.Nbody, Nod(OAS, nh, call)) + + fn.Nbody = list(fn.Nbody, n) + + // Walk the struct using memhash for runs of AMEM + // and calling specific hash functions for the others. + case TSTRUCT: + var first *Type + + offend := int64(0) + var size int64 + var call *Node + var nx *Node + var na *Node + var hashel *Node + for t1 := t.Type; ; t1 = t1.Down { + if t1 != nil && algtype1(t1.Type, nil) == AMEM && !isblanksym(t1.Sym) { + offend = t1.Width + t1.Type.Width + if first == nil { + first = t1 + } + + // If it's a memory field but it's padded, stop here. + if ispaddedfield(t1, t.Width) { + t1 = t1.Down + } else { + continue + } + } + + // Run memhash for fields up to this one. + if first != nil { + size = offend - first.Width // first->width is offset + hashel = hashmem(first.Type) + + // h = hashel(&p.first, size, h) + call = Nod(OCALL, hashel, nil) + + nx = Nod(OXDOT, np, newname(first.Sym)) // TODO: fields from other packages? + na = Nod(OADDR, nx, nil) + na.Etype = 1 // no escape to heap + call.List = list(call.List, na) + call.List = list(call.List, nh) + call.List = list(call.List, Nodintconst(size)) + fn.Nbody = list(fn.Nbody, Nod(OAS, nh, call)) + + first = nil + } + + if t1 == nil { + break + } + if isblanksym(t1.Sym) { + continue + } + + // Run hash for this field. + if algtype1(t1.Type, nil) == AMEM { + hashel = hashmem(t1.Type) + + // h = memhash(&p.t1, h, size) + call = Nod(OCALL, hashel, nil) + + nx = Nod(OXDOT, np, newname(t1.Sym)) // TODO: fields from other packages? + na = Nod(OADDR, nx, nil) + na.Etype = 1 // no escape to heap + call.List = list(call.List, na) + call.List = list(call.List, nh) + call.List = list(call.List, Nodintconst(t1.Type.Width)) + fn.Nbody = list(fn.Nbody, Nod(OAS, nh, call)) + } else { + hashel = hashfor(t1.Type) + + // h = hashel(&p.t1, h) + call = Nod(OCALL, hashel, nil) + + nx = Nod(OXDOT, np, newname(t1.Sym)) // TODO: fields from other packages? + na = Nod(OADDR, nx, nil) + na.Etype = 1 // no escape to heap + call.List = list(call.List, na) + call.List = list(call.List, nh) + fn.Nbody = list(fn.Nbody, Nod(OAS, nh, call)) + } + } + } + + r := Nod(ORETURN, nil, nil) + r.List = list(r.List, nh) + fn.Nbody = list(fn.Nbody, r) + + if Debug['r'] != 0 { + dumplist("genhash body", fn.Nbody) + } + + funcbody(fn) + Curfn = fn + fn.Func.Dupok = true + typecheck(&fn, Etop) + typechecklist(fn.Nbody, Etop) + Curfn = nil + + // Disable safemode while compiling this code: the code we + // generate internally can refer to unsafe.Pointer. + // In this case it can happen if we need to generate an == + // for a struct containing a reflect.Value, which itself has + // an unexported field of type unsafe.Pointer. + old_safemode := safemode + + safemode = 0 + funccompile(fn) + safemode = old_safemode +} + +// Return node for +// if p.field != q.field { return false } +func eqfield(p *Node, q *Node, field *Node) *Node { + nx := Nod(OXDOT, p, field) + ny := Nod(OXDOT, q, field) + nif := Nod(OIF, nil, nil) + nif.Left = Nod(ONE, nx, ny) + r := Nod(ORETURN, nil, nil) + r.List = list(r.List, Nodbool(false)) + nif.Nbody = list(nif.Nbody, r) + return nif +} + +func eqmemfunc(size int64, type_ *Type, needsize *int) *Node { + var fn *Node + + switch size { + default: + fn = syslook("memequal", 1) + *needsize = 1 + + case 1, 2, 4, 8, 16: + buf := fmt.Sprintf("memequal%d", int(size)*8) + fn = syslook(buf, 1) + *needsize = 0 + } + + substArgTypes(fn, type_, type_) + return fn +} + +// Return node for +// if !memequal(&p.field, &q.field [, size]) { return false } +func eqmem(p *Node, q *Node, field *Node, size int64) *Node { + var needsize int + + nx := Nod(OADDR, Nod(OXDOT, p, field), nil) + nx.Etype = 1 // does not escape + ny := Nod(OADDR, Nod(OXDOT, q, field), nil) + ny.Etype = 1 // does not escape + typecheck(&nx, Erv) + typecheck(&ny, Erv) + + call := Nod(OCALL, eqmemfunc(size, nx.Type.Type, &needsize), nil) + call.List = list(call.List, nx) + call.List = list(call.List, ny) + if needsize != 0 { + call.List = list(call.List, Nodintconst(size)) + } + + nif := Nod(OIF, nil, nil) + nif.Left = Nod(ONOT, call, nil) + r := Nod(ORETURN, nil, nil) + r.List = list(r.List, Nodbool(false)) + nif.Nbody = list(nif.Nbody, r) + return nif +} + +/* + * Generate a helper function to check equality of two values of type t. + */ +func geneq(sym *Sym, t *Type) { + if Debug['r'] != 0 { + fmt.Printf("geneq %v %v\n", sym, t) + } + + lineno = 1 // less confusing than end of input + dclcontext = PEXTERN + markdcl() + + // func sym(p, q *T) bool + fn := Nod(ODCLFUNC, nil, nil) + + fn.Func.Nname = newname(sym) + fn.Func.Nname.Class = PFUNC + tfn := Nod(OTFUNC, nil, nil) + fn.Func.Nname.Name.Param.Ntype = tfn + + n := Nod(ODCLFIELD, newname(Lookup("p")), typenod(Ptrto(t))) + tfn.List = list(tfn.List, n) + np := n.Left + n = Nod(ODCLFIELD, newname(Lookup("q")), typenod(Ptrto(t))) + tfn.List = list(tfn.List, n) + nq := n.Left + n = Nod(ODCLFIELD, nil, typenod(Types[TBOOL])) + tfn.Rlist = list(tfn.Rlist, n) + + funchdr(fn) + + // geneq is only called for types that have equality but + // cannot be handled by the standard algorithms, + // so t must be either an array or a struct. + switch t.Etype { + default: + Fatal("geneq %v", t) + + case TARRAY: + if Isslice(t) { + Fatal("geneq %v", t) + } + + // An array of pure memory would be handled by the + // standard memequal, so the element type must not be + // pure memory. Even if we unrolled the range loop, + // each iteration would be a function call, so don't bother + // unrolling. + nrange := Nod(ORANGE, nil, Nod(OIND, np, nil)) + + ni := newname(Lookup("i")) + ni.Type = Types[TINT] + nrange.List = list1(ni) + nrange.Colas = true + colasdefn(nrange.List, nrange) + ni = nrange.List.N + + // if p[i] != q[i] { return false } + nx := Nod(OINDEX, np, ni) + + nx.Bounded = true + ny := Nod(OINDEX, nq, ni) + ny.Bounded = true + + nif := Nod(OIF, nil, nil) + nif.Left = Nod(ONE, nx, ny) + r := Nod(ORETURN, nil, nil) + r.List = list(r.List, Nodbool(false)) + nif.Nbody = list(nif.Nbody, r) + nrange.Nbody = list(nrange.Nbody, nif) + fn.Nbody = list(fn.Nbody, nrange) + + // Walk the struct using memequal for runs of AMEM + // and calling specific equality tests for the others. + // Skip blank-named fields. + case TSTRUCT: + var first *Type + + offend := int64(0) + var size int64 + for t1 := t.Type; ; t1 = t1.Down { + if t1 != nil && algtype1(t1.Type, nil) == AMEM && !isblanksym(t1.Sym) { + offend = t1.Width + t1.Type.Width + if first == nil { + first = t1 + } + + // If it's a memory field but it's padded, stop here. + if ispaddedfield(t1, t.Width) { + t1 = t1.Down + } else { + continue + } + } + + // Run memequal for fields up to this one. + // TODO(rsc): All the calls to newname are wrong for + // cross-package unexported fields. + if first != nil { + if first.Down == t1 { + fn.Nbody = list(fn.Nbody, eqfield(np, nq, newname(first.Sym))) + } else if first.Down.Down == t1 { + fn.Nbody = list(fn.Nbody, eqfield(np, nq, newname(first.Sym))) + first = first.Down + if !isblanksym(first.Sym) { + fn.Nbody = list(fn.Nbody, eqfield(np, nq, newname(first.Sym))) + } + } else { + // More than two fields: use memequal. + size = offend - first.Width // first->width is offset + fn.Nbody = list(fn.Nbody, eqmem(np, nq, newname(first.Sym), size)) + } + + first = nil + } + + if t1 == nil { + break + } + if isblanksym(t1.Sym) { + continue + } + + // Check this field, which is not just memory. + fn.Nbody = list(fn.Nbody, eqfield(np, nq, newname(t1.Sym))) + } + } + + // return true + r := Nod(ORETURN, nil, nil) + + r.List = list(r.List, Nodbool(true)) + fn.Nbody = list(fn.Nbody, r) + + if Debug['r'] != 0 { + dumplist("geneq body", fn.Nbody) + } + + funcbody(fn) + Curfn = fn + fn.Func.Dupok = true + typecheck(&fn, Etop) + typechecklist(fn.Nbody, Etop) + Curfn = nil + + // Disable safemode while compiling this code: the code we + // generate internally can refer to unsafe.Pointer. + // In this case it can happen if we need to generate an == + // for a struct containing a reflect.Value, which itself has + // an unexported field of type unsafe.Pointer. + old_safemode := safemode + + safemode = 0 + funccompile(fn) + safemode = old_safemode +} + +func ifacelookdot(s *Sym, t *Type, followptr *int, ignorecase int) *Type { + *followptr = 0 + + if t == nil { + return nil + } + + var m *Type + var i int + var c int + for d := 0; d < len(dotlist); d++ { + c = adddot1(s, t, d, &m, ignorecase) + if c > 1 { + Yyerror("%v.%v is ambiguous", t, s) + return nil + } + + if c == 1 { + for i = 0; i < d; i++ { + if Isptr[dotlist[i].field.Type.Etype] { + *followptr = 1 + break + } + } + + if m.Type.Etype != TFUNC || m.Type.Thistuple == 0 { + Yyerror("%v.%v is a field, not a method", t, s) + return nil + } + + return m + } + } + + return nil +} + +func implements(t *Type, iface *Type, m **Type, samename **Type, ptr *int) bool { + t0 := t + if t == nil { + return false + } + + // if this is too slow, + // could sort these first + // and then do one loop. + + if t.Etype == TINTER { + var tm *Type + for im := iface.Type; im != nil; im = im.Down { + for tm = t.Type; tm != nil; tm = tm.Down { + if tm.Sym == im.Sym { + if Eqtype(tm.Type, im.Type) { + goto found + } + *m = im + *samename = tm + *ptr = 0 + return false + } + } + + *m = im + *samename = nil + *ptr = 0 + return false + found: + } + + return true + } + + t = methtype(t, 0) + if t != nil { + expandmeth(t) + } + var tm *Type + var imtype *Type + var followptr int + var rcvr *Type + for im := iface.Type; im != nil; im = im.Down { + imtype = methodfunc(im.Type, nil) + tm = ifacelookdot(im.Sym, t, &followptr, 0) + if tm == nil || tm.Nointerface || !Eqtype(methodfunc(tm.Type, nil), imtype) { + if tm == nil { + tm = ifacelookdot(im.Sym, t, &followptr, 1) + } + *m = im + *samename = tm + *ptr = 0 + return false + } + + // if pointer receiver in method, + // the method does not exist for value types. + rcvr = getthisx(tm.Type).Type.Type + + if Isptr[rcvr.Etype] && !Isptr[t0.Etype] && followptr == 0 && !isifacemethod(tm.Type) { + if false && Debug['r'] != 0 { + Yyerror("interface pointer mismatch") + } + + *m = im + *samename = nil + *ptr = 1 + return false + } + } + + return true +} + +/* + * even simpler simtype; get rid of ptr, bool. + * assuming that the front end has rejected + * all the invalid conversions (like ptr -> bool) + */ +func Simsimtype(t *Type) int { + if t == nil { + return 0 + } + + et := int(Simtype[t.Etype]) + switch et { + case TPTR32: + et = TUINT32 + + case TPTR64: + et = TUINT64 + + case TBOOL: + et = TUINT8 + } + + return et +} + +func listtreecopy(l *NodeList, lineno int32) *NodeList { + var out *NodeList + for ; l != nil; l = l.Next { + out = list(out, treecopy(l.N, lineno)) + } + return out +} + +func liststmt(l *NodeList) *Node { + n := Nod(OBLOCK, nil, nil) + n.List = l + if l != nil { + n.Lineno = l.N.Lineno + } + return n +} + +/* + * return nelem of list + */ +func structcount(t *Type) int { + var s Iter + + v := 0 + for t = Structfirst(&s, &t); t != nil; t = structnext(&s) { + v++ + } + return v +} + +/* + * return power of 2 of the constant + * operand. -1 if it is not a power of 2. + * 1000+ if it is a -(power of 2) + */ +func powtwo(n *Node) int { + if n == nil || n.Op != OLITERAL || n.Type == nil { + return -1 + } + if !Isint[n.Type.Etype] { + return -1 + } + + v := uint64(Mpgetfix(n.Val().U.(*Mpint))) + b := uint64(1) + for i := 0; i < 64; i++ { + if b == v { + return i + } + b = b << 1 + } + + if !Issigned[n.Type.Etype] { + return -1 + } + + v = -v + b = 1 + for i := 0; i < 64; i++ { + if b == v { + return i + 1000 + } + b = b << 1 + } + + return -1 +} + +/* + * return the unsigned type for + * a signed integer type. + * returns T if input is not a + * signed integer type. + */ +func tounsigned(t *Type) *Type { + // this is types[et+1], but not sure + // that this relation is immutable + switch t.Etype { + default: + fmt.Printf("tounsigned: unknown type %v\n", t) + t = nil + + case TINT: + t = Types[TUINT] + + case TINT8: + t = Types[TUINT8] + + case TINT16: + t = Types[TUINT16] + + case TINT32: + t = Types[TUINT32] + + case TINT64: + t = Types[TUINT64] + } + + return t +} + +/* + * magic number for signed division + * see hacker's delight chapter 10 + */ +func Smagic(m *Magic) { + var mask uint64 + + m.Bad = 0 + switch m.W { + default: + m.Bad = 1 + return + + case 8: + mask = 0xff + + case 16: + mask = 0xffff + + case 32: + mask = 0xffffffff + + case 64: + mask = 0xffffffffffffffff + } + + two31 := mask ^ (mask >> 1) + + p := m.W - 1 + ad := uint64(m.Sd) + if m.Sd < 0 { + ad = -uint64(m.Sd) + } + + // bad denominators + if ad == 0 || ad == 1 || ad == two31 { + m.Bad = 1 + return + } + + t := two31 + ad &= mask + + anc := t - 1 - t%ad + anc &= mask + + q1 := two31 / anc + r1 := two31 - q1*anc + q1 &= mask + r1 &= mask + + q2 := two31 / ad + r2 := two31 - q2*ad + q2 &= mask + r2 &= mask + + var delta uint64 + for { + p++ + q1 <<= 1 + r1 <<= 1 + q1 &= mask + r1 &= mask + if r1 >= anc { + q1++ + r1 -= anc + q1 &= mask + r1 &= mask + } + + q2 <<= 1 + r2 <<= 1 + q2 &= mask + r2 &= mask + if r2 >= ad { + q2++ + r2 -= ad + q2 &= mask + r2 &= mask + } + + delta = ad - r2 + delta &= mask + if q1 < delta || (q1 == delta && r1 == 0) { + continue + } + + break + } + + m.Sm = int64(q2 + 1) + if uint64(m.Sm)&two31 != 0 { + m.Sm |= ^int64(mask) + } + m.S = p - m.W +} + +/* + * magic number for unsigned division + * see hacker's delight chapter 10 + */ +func Umagic(m *Magic) { + var mask uint64 + + m.Bad = 0 + m.Ua = 0 + + switch m.W { + default: + m.Bad = 1 + return + + case 8: + mask = 0xff + + case 16: + mask = 0xffff + + case 32: + mask = 0xffffffff + + case 64: + mask = 0xffffffffffffffff + } + + two31 := mask ^ (mask >> 1) + + m.Ud &= mask + if m.Ud == 0 || m.Ud == two31 { + m.Bad = 1 + return + } + + nc := mask - (-m.Ud&mask)%m.Ud + p := m.W - 1 + + q1 := two31 / nc + r1 := two31 - q1*nc + q1 &= mask + r1 &= mask + + q2 := (two31 - 1) / m.Ud + r2 := (two31 - 1) - q2*m.Ud + q2 &= mask + r2 &= mask + + var delta uint64 + for { + p++ + if r1 >= nc-r1 { + q1 <<= 1 + q1++ + r1 <<= 1 + r1 -= nc + } else { + q1 <<= 1 + r1 <<= 1 + } + + q1 &= mask + r1 &= mask + if r2+1 >= m.Ud-r2 { + if q2 >= two31-1 { + m.Ua = 1 + } + + q2 <<= 1 + q2++ + r2 <<= 1 + r2++ + r2 -= m.Ud + } else { + if q2 >= two31 { + m.Ua = 1 + } + + q2 <<= 1 + r2 <<= 1 + r2++ + } + + q2 &= mask + r2 &= mask + + delta = m.Ud - 1 - r2 + delta &= mask + + if p < m.W+m.W { + if q1 < delta || (q1 == delta && r1 == 0) { + continue + } + } + + break + } + + m.Um = q2 + 1 + m.S = p - m.W +} + +func ngotype(n *Node) *Sym { + if n.Type != nil { + return typenamesym(n.Type) + } + return nil +} + +/* + * Convert raw string to the prefix that will be used in the symbol + * table. All control characters, space, '%' and '"', as well as + * non-7-bit clean bytes turn into %xx. The period needs escaping + * only in the last segment of the path, and it makes for happier + * users if we escape that as little as possible. + * + * If you edit this, edit ../ld/lib.c:/^pathtoprefix too. + * If you edit this, edit ../../debug/goobj/read.go:/importPathToPrefix too. + */ +func pathtoprefix(s string) string { + slash := strings.LastIndex(s, "/") + for i := 0; i < len(s); i++ { + c := s[i] + if c <= ' ' || i >= slash && c == '.' || c == '%' || c == '"' || c >= 0x7F { + var buf bytes.Buffer + for i := 0; i < len(s); i++ { + c := s[i] + if c <= ' ' || i >= slash && c == '.' || c == '%' || c == '"' || c >= 0x7F { + fmt.Fprintf(&buf, "%%%02x", c) + continue + } + buf.WriteByte(c) + } + return buf.String() + } + } + return s +} + +var pkgMap = make(map[string]*Pkg) +var pkgs []*Pkg + +func mkpkg(path string) *Pkg { + if p := pkgMap[path]; p != nil { + return p + } + + p := new(Pkg) + p.Path = path + p.Prefix = pathtoprefix(path) + p.Syms = make(map[string]*Sym) + pkgMap[path] = p + pkgs = append(pkgs, p) + return p +} + +func addinit(np **Node, init *NodeList) { + if init == nil { + return + } + + n := *np + switch n.Op { + // There may be multiple refs to this node; + // introduce OCONVNOP to hold init list. + case ONAME, OLITERAL: + n = Nod(OCONVNOP, n, nil) + + n.Type = n.Left.Type + n.Typecheck = 1 + *np = n + } + + n.Ninit = concat(init, n.Ninit) + n.Ullman = UINF +} + +var reservedimports = []string{ + "go", + "type", +} + +func isbadimport(path string) bool { + if strings.Contains(path, "\x00") { + Yyerror("import path contains NUL") + return true + } + + for i := 0; i < len(reservedimports); i++ { + if path == reservedimports[i] { + Yyerror("import path %q is reserved and cannot be used", path) + return true + } + } + + var s string + _ = s + var r uint + _ = r + for _, r := range path { + if r == utf8.RuneError { + Yyerror("import path contains invalid UTF-8 sequence: %q", path) + return true + } + + if r < 0x20 || r == 0x7f { + Yyerror("import path contains control character: %q", path) + return true + } + + if r == '\\' { + Yyerror("import path contains backslash; use slash: %q", path) + return true + } + + if unicode.IsSpace(rune(r)) { + Yyerror("import path contains space character: %q", path) + return true + } + + if strings.ContainsRune("!\"#$%&'()*,:;<=>?[]^`{|}", r) { + Yyerror("import path contains invalid character '%c': %q", r, path) + return true + } + } + + return false +} + +func checknil(x *Node, init **NodeList) { + if Isinter(x.Type) { + x = Nod(OITAB, x, nil) + typecheck(&x, Erv) + } + + n := Nod(OCHECKNIL, x, nil) + n.Typecheck = 1 + *init = list(*init, n) +} + +/* + * Can this type be stored directly in an interface word? + * Yes, if the representation is a single pointer. + */ +func isdirectiface(t *Type) bool { + switch t.Etype { + case TPTR32, + TPTR64, + TCHAN, + TMAP, + TFUNC, + TUNSAFEPTR: + return true + + // Array of 1 direct iface type can be direct. + case TARRAY: + return t.Bound == 1 && isdirectiface(t.Type) + + // Struct with 1 field of direct iface type can be direct. + case TSTRUCT: + return t.Type != nil && t.Type.Down == nil && isdirectiface(t.Type.Type) + } + + return false +} + +// type2IET returns "T" if t is a concrete type, +// "I" if t is an interface type, and "E" if t is an empty interface type. +// It is used to build calls to the conv* and assert* runtime routines. +func type2IET(t *Type) string { + if isnilinter(t) { + return "E" + } + if Isinter(t) { + return "I" + } + return "T" +} diff --git a/src/cmd/compile/internal/gc/swt.go b/src/cmd/compile/internal/gc/swt.go new file mode 100644 index 0000000000000000000000000000000000000000..f34b1c614c8ed8df5d67aa47f5319a331121c8fb --- /dev/null +++ b/src/cmd/compile/internal/gc/swt.go @@ -0,0 +1,848 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package gc + +import ( + "cmd/internal/obj" + "fmt" + "sort" + "strconv" +) + +const ( + // expression switch + switchKindExpr = iota // switch a {...} or switch 5 {...} + switchKindTrue // switch true {...} or switch {...} + switchKindFalse // switch false {...} + + // type switch + switchKindType // switch a.(type) {...} +) + +const ( + caseKindDefault = iota // default: + + // expression switch + caseKindExprConst // case 5: + caseKindExprVar // case x: + + // type switch + caseKindTypeNil // case nil: + caseKindTypeConst // case time.Time: (concrete type, has type hash) + caseKindTypeVar // case io.Reader: (interface type) +) + +const binarySearchMin = 4 // minimum number of cases for binary search + +// An exprSwitch walks an expression switch. +type exprSwitch struct { + exprname *Node // node for the expression being switched on + kind int // kind of switch statement (switchKind*) +} + +// A typeSwitch walks a type switch. +type typeSwitch struct { + hashname *Node // node for the hash of the type of the variable being switched on + facename *Node // node for the concrete type of the variable being switched on + okname *Node // boolean node used for comma-ok type assertions +} + +// A caseClause is a single case clause in a switch statement. +type caseClause struct { + node *Node // points at case statement + ordinal int // position in switch + hash uint32 // hash of a type switch + typ uint8 // type of case +} + +// typecheckswitch typechecks a switch statement. +func typecheckswitch(n *Node) { + lno := int(lineno) + typechecklist(n.Ninit, Etop) + + var nilonly string + var top int + var t *Type + + if n.Left != nil && n.Left.Op == OTYPESW { + // type switch + top = Etype + typecheck(&n.Left.Right, Erv) + t = n.Left.Right.Type + if t != nil && t.Etype != TINTER { + Yyerror("cannot type switch on non-interface value %v", Nconv(n.Left.Right, obj.FmtLong)) + } + } else { + // expression switch + top = Erv + if n.Left != nil { + typecheck(&n.Left, Erv) + defaultlit(&n.Left, nil) + t = n.Left.Type + } else { + t = Types[TBOOL] + } + if t != nil { + var badtype *Type + switch { + case !okforeq[t.Etype]: + Yyerror("cannot switch on %v", Nconv(n.Left, obj.FmtLong)) + case t.Etype == TARRAY && !Isfixedarray(t): + nilonly = "slice" + case t.Etype == TARRAY && Isfixedarray(t) && algtype1(t, nil) == ANOEQ: + Yyerror("cannot switch on %v", Nconv(n.Left, obj.FmtLong)) + case t.Etype == TSTRUCT && algtype1(t, &badtype) == ANOEQ: + Yyerror("cannot switch on %v (struct containing %v cannot be compared)", Nconv(n.Left, obj.FmtLong), badtype) + case t.Etype == TFUNC: + nilonly = "func" + case t.Etype == TMAP: + nilonly = "map" + } + } + } + + n.Type = t + + var def *Node + var ll *NodeList + for l := n.List; l != nil; l = l.Next { + ncase := l.N + setlineno(n) + if ncase.List == nil { + // default + if def != nil { + Yyerror("multiple defaults in switch (first at %v)", def.Line()) + } else { + def = ncase + } + } else { + for ll = ncase.List; ll != nil; ll = ll.Next { + setlineno(ll.N) + typecheck(&ll.N, Erv|Etype) + if ll.N.Type == nil || t == nil { + continue + } + setlineno(ncase) + switch top { + // expression switch + case Erv: + defaultlit(&ll.N, t) + switch { + case ll.N.Op == OTYPE: + Yyerror("type %v is not an expression", ll.N.Type) + case ll.N.Type != nil && assignop(ll.N.Type, t, nil) == 0 && assignop(t, ll.N.Type, nil) == 0: + if n.Left != nil { + Yyerror("invalid case %v in switch on %v (mismatched types %v and %v)", ll.N, n.Left, ll.N.Type, t) + } else { + Yyerror("invalid case %v in switch (mismatched types %v and bool)", ll.N, ll.N.Type) + } + case nilonly != "" && !Isconst(ll.N, CTNIL): + Yyerror("invalid case %v in switch (can only compare %s %v to nil)", ll.N, nilonly, n.Left) + } + + // type switch + case Etype: + var missing, have *Type + var ptr int + switch { + case ll.N.Op == OLITERAL && Istype(ll.N.Type, TNIL): + case ll.N.Op != OTYPE && ll.N.Type != nil: // should this be ||? + Yyerror("%v is not a type", Nconv(ll.N, obj.FmtLong)) + // reset to original type + ll.N = n.Left.Right + case ll.N.Type.Etype != TINTER && t.Etype == TINTER && !implements(ll.N.Type, t, &missing, &have, &ptr): + if have != nil && missing.Broke == 0 && have.Broke == 0 { + Yyerror("impossible type switch case: %v cannot have dynamic type %v"+" (wrong type for %v method)\n\thave %v%v\n\twant %v%v", Nconv(n.Left.Right, obj.FmtLong), ll.N.Type, missing.Sym, have.Sym, Tconv(have.Type, obj.FmtShort), missing.Sym, Tconv(missing.Type, obj.FmtShort)) + } else if missing.Broke == 0 { + Yyerror("impossible type switch case: %v cannot have dynamic type %v"+" (missing %v method)", Nconv(n.Left.Right, obj.FmtLong), ll.N.Type, missing.Sym) + } + } + } + } + } + + if top == Etype && n.Type != nil { + ll = ncase.List + if ncase.Rlist != nil { + nvar := ncase.Rlist.N + if ll != nil && ll.Next == nil && ll.N.Type != nil && !Istype(ll.N.Type, TNIL) { + // single entry type switch + nvar.Name.Param.Ntype = typenod(ll.N.Type) + } else { + // multiple entry type switch or default + nvar.Name.Param.Ntype = typenod(n.Type) + } + + typecheck(&nvar, Erv|Easgn) + ncase.Rlist.N = nvar + } + } + + typechecklist(ncase.Nbody, Etop) + } + + lineno = int32(lno) +} + +// walkswitch walks a switch statement. +func walkswitch(sw *Node) { + // convert switch {...} to switch true {...} + if sw.Left == nil { + sw.Left = Nodbool(true) + typecheck(&sw.Left, Erv) + } + + if sw.Left.Op == OTYPESW { + var s typeSwitch + s.walk(sw) + } else { + var s exprSwitch + s.walk(sw) + } +} + +// walk generates an AST implementing sw. +// sw is an expression switch. +// The AST is generally of the form of a linear +// search using if..goto, although binary search +// is used with long runs of constants. +func (s *exprSwitch) walk(sw *Node) { + casebody(sw, nil) + + cond := sw.Left + sw.Left = nil + + s.kind = switchKindExpr + if Isconst(cond, CTBOOL) { + s.kind = switchKindTrue + if !cond.Val().U.(bool) { + s.kind = switchKindFalse + } + } + + walkexpr(&cond, &sw.Ninit) + t := sw.Type + if t == nil { + return + } + + // convert the switch into OIF statements + var cas *NodeList + if s.kind == switchKindTrue || s.kind == switchKindFalse { + s.exprname = Nodbool(s.kind == switchKindTrue) + } else if consttype(cond) >= 0 { + // leave constants to enable dead code elimination (issue 9608) + s.exprname = cond + } else { + s.exprname = temp(cond.Type) + cas = list1(Nod(OAS, s.exprname, cond)) + typechecklist(cas, Etop) + } + + // enumerate the cases, and lop off the default case + cc := caseClauses(sw, s.kind) + sw.List = nil + var def *Node + if len(cc) > 0 && cc[0].typ == caseKindDefault { + def = cc[0].node.Right + cc = cc[1:] + } else { + def = Nod(OBREAK, nil, nil) + } + + // handle the cases in order + for len(cc) > 0 { + // deal with expressions one at a time + if !okforcmp[t.Etype] || cc[0].typ != caseKindExprConst { + a := s.walkCases(cc[:1]) + cas = list(cas, a) + cc = cc[1:] + continue + } + + // do binary search on runs of constants + var run int + for run = 1; run < len(cc) && cc[run].typ == caseKindExprConst; run++ { + } + + // sort and compile constants + sort.Sort(caseClauseByExpr(cc[:run])) + a := s.walkCases(cc[:run]) + cas = list(cas, a) + cc = cc[run:] + } + + // handle default case + if nerrors == 0 { + cas = list(cas, def) + sw.Nbody = concat(cas, sw.Nbody) + walkstmtlist(sw.Nbody) + } +} + +// walkCases generates an AST implementing the cases in cc. +func (s *exprSwitch) walkCases(cc []*caseClause) *Node { + if len(cc) < binarySearchMin { + // linear search + var cas *NodeList + for _, c := range cc { + n := c.node + lno := int(setlineno(n)) + + a := Nod(OIF, nil, nil) + if (s.kind != switchKindTrue && s.kind != switchKindFalse) || assignop(n.Left.Type, s.exprname.Type, nil) == OCONVIFACE || assignop(s.exprname.Type, n.Left.Type, nil) == OCONVIFACE { + a.Left = Nod(OEQ, s.exprname, n.Left) // if name == val + typecheck(&a.Left, Erv) + } else if s.kind == switchKindTrue { + a.Left = n.Left // if val + } else { + // s.kind == switchKindFalse + a.Left = Nod(ONOT, n.Left, nil) // if !val + typecheck(&a.Left, Erv) + } + a.Nbody = list1(n.Right) // goto l + + cas = list(cas, a) + lineno = int32(lno) + } + return liststmt(cas) + } + + // find the middle and recur + half := len(cc) / 2 + a := Nod(OIF, nil, nil) + mid := cc[half-1].node.Left + le := Nod(OLE, s.exprname, mid) + if Isconst(mid, CTSTR) { + // Search by length and then by value; see exprcmp. + lenlt := Nod(OLT, Nod(OLEN, s.exprname, nil), Nod(OLEN, mid, nil)) + leneq := Nod(OEQ, Nod(OLEN, s.exprname, nil), Nod(OLEN, mid, nil)) + a.Left = Nod(OOROR, lenlt, Nod(OANDAND, leneq, le)) + } else { + a.Left = le + } + typecheck(&a.Left, Erv) + a.Nbody = list1(s.walkCases(cc[:half])) + a.Rlist = list1(s.walkCases(cc[half:])) + return a +} + +// casebody builds separate lists of statements and cases. +// It makes labels between cases and statements +// and deals with fallthrough, break, and unreachable statements. +func casebody(sw *Node, typeswvar *Node) { + if sw.List == nil { + return + } + + lno := setlineno(sw) + + var cas *NodeList // cases + var stat *NodeList // statements + var def *Node // defaults + br := Nod(OBREAK, nil, nil) + + for l := sw.List; l != nil; l = l.Next { + n := l.N + setlineno(n) + if n.Op != OXCASE { + Fatal("casebody %v", Oconv(int(n.Op), 0)) + } + n.Op = OCASE + needvar := count(n.List) != 1 || n.List.N.Op == OLITERAL + + jmp := Nod(OGOTO, newCaseLabel(), nil) + if n.List == nil { + if def != nil { + Yyerror("more than one default case") + } + // reuse original default case + n.Right = jmp + def = n + } + + if n.List != nil && n.List.Next == nil { + // one case -- reuse OCASE node + n.Left = n.List.N + n.Right = jmp + n.List = nil + cas = list(cas, n) + } else { + // expand multi-valued cases + for lc := n.List; lc != nil; lc = lc.Next { + cas = list(cas, Nod(OCASE, lc.N, jmp)) + } + } + + stat = list(stat, Nod(OLABEL, jmp.Left, nil)) + if typeswvar != nil && needvar && n.Rlist != nil { + l := list1(Nod(ODCL, n.Rlist.N, nil)) + l = list(l, Nod(OAS, n.Rlist.N, typeswvar)) + typechecklist(l, Etop) + stat = concat(stat, l) + } + stat = concat(stat, n.Nbody) + + // botch - shouldn't fall thru declaration + last := stat.End.N + if last.Xoffset == n.Xoffset && last.Op == OXFALL { + if typeswvar != nil { + setlineno(last) + Yyerror("cannot fallthrough in type switch") + } + + if l.Next == nil { + setlineno(last) + Yyerror("cannot fallthrough final case in switch") + } + + last.Op = OFALL + } else { + stat = list(stat, br) + } + } + + stat = list(stat, br) + if def != nil { + cas = list(cas, def) + } + + sw.List = cas + sw.Nbody = stat + lineno = lno +} + +// nSwitchLabel is the number of switch labels generated. +// This should be per-function, but it is a global counter for now. +var nSwitchLabel int + +func newCaseLabel() *Node { + label := strconv.Itoa(nSwitchLabel) + nSwitchLabel++ + return newname(Lookup(label)) +} + +// caseClauses generates a slice of caseClauses +// corresponding to the clauses in the switch statement sw. +// Kind is the kind of switch statement. +func caseClauses(sw *Node, kind int) []*caseClause { + var cc []*caseClause + for l := sw.List; l != nil; l = l.Next { + n := l.N + c := new(caseClause) + cc = append(cc, c) + c.ordinal = len(cc) + c.node = n + + if n.Left == nil { + c.typ = caseKindDefault + continue + } + + if kind == switchKindType { + // type switch + switch { + case n.Left.Op == OLITERAL: + c.typ = caseKindTypeNil + case Istype(n.Left.Type, TINTER): + c.typ = caseKindTypeVar + default: + c.typ = caseKindTypeConst + c.hash = typehash(n.Left.Type) + } + } else { + // expression switch + switch consttype(n.Left) { + case CTFLT, CTINT, CTRUNE, CTSTR: + c.typ = caseKindExprConst + default: + c.typ = caseKindExprVar + } + } + } + + if cc == nil { + return nil + } + + // sort by value and diagnose duplicate cases + if kind == switchKindType { + // type switch + sort.Sort(caseClauseByType(cc)) + for i, c1 := range cc { + if c1.typ == caseKindTypeNil || c1.typ == caseKindDefault { + break + } + for _, c2 := range cc[i+1:] { + if c2.typ == caseKindTypeNil || c2.typ == caseKindDefault || c1.hash != c2.hash { + break + } + if Eqtype(c1.node.Left.Type, c2.node.Left.Type) { + yyerrorl(int(c2.node.Lineno), "duplicate case %v in type switch\n\tprevious case at %v", c2.node.Left.Type, c1.node.Line()) + } + } + } + } else { + // expression switch + sort.Sort(caseClauseByExpr(cc)) + for i, c1 := range cc { + if i+1 == len(cc) { + break + } + c2 := cc[i+1] + if exprcmp(c1, c2) != 0 { + continue + } + setlineno(c2.node) + Yyerror("duplicate case %v in switch\n\tprevious case at %v", c1.node.Left, c1.node.Line()) + } + } + + // put list back in processing order + sort.Sort(caseClauseByOrd(cc)) + return cc +} + +// walk generates an AST that implements sw, +// where sw is a type switch. +// The AST is generally of the form of a linear +// search using if..goto, although binary search +// is used with long runs of concrete types. +func (s *typeSwitch) walk(sw *Node) { + cond := sw.Left + sw.Left = nil + + if cond == nil { + sw.List = nil + return + } + if cond.Right == nil { + setlineno(sw) + Yyerror("type switch must have an assignment") + return + } + + walkexpr(&cond.Right, &sw.Ninit) + if !Istype(cond.Right.Type, TINTER) { + Yyerror("type switch must be on an interface") + return + } + + var cas *NodeList + + // predeclare temporary variables and the boolean var + s.facename = temp(cond.Right.Type) + + a := Nod(OAS, s.facename, cond.Right) + typecheck(&a, Etop) + cas = list(cas, a) + + s.okname = temp(Types[TBOOL]) + typecheck(&s.okname, Erv) + + s.hashname = temp(Types[TUINT32]) + typecheck(&s.hashname, Erv) + + // set up labels and jumps + casebody(sw, s.facename) + + // calculate type hash + t := cond.Right.Type + if isnilinter(t) { + a = syslook("efacethash", 1) + } else { + a = syslook("ifacethash", 1) + } + substArgTypes(a, t) + a = Nod(OCALL, a, nil) + a.List = list1(s.facename) + a = Nod(OAS, s.hashname, a) + typecheck(&a, Etop) + cas = list(cas, a) + + cc := caseClauses(sw, switchKindType) + sw.List = nil + var def *Node + if len(cc) > 0 && cc[0].typ == caseKindDefault { + def = cc[0].node.Right + cc = cc[1:] + } else { + def = Nod(OBREAK, nil, nil) + } + + // insert type equality check into each case block + for _, c := range cc { + n := c.node + switch c.typ { + case caseKindTypeNil: + var v Val + v.U = new(NilVal) + a = Nod(OIF, nil, nil) + a.Left = Nod(OEQ, s.facename, nodlit(v)) + typecheck(&a.Left, Erv) + a.Nbody = list1(n.Right) // if i==nil { goto l } + n.Right = a + + case caseKindTypeVar, caseKindTypeConst: + n.Right = s.typeone(n) + } + } + + // generate list of if statements, binary search for constant sequences + for len(cc) > 0 { + if cc[0].typ != caseKindTypeConst { + n := cc[0].node + cas = list(cas, n.Right) + cc = cc[1:] + continue + } + + // identify run of constants + var run int + for run = 1; run < len(cc) && cc[run].typ == caseKindTypeConst; run++ { + } + + // sort by hash + sort.Sort(caseClauseByType(cc[:run])) + + // for debugging: linear search + if false { + for i := 0; i < run; i++ { + n := cc[i].node + cas = list(cas, n.Right) + } + continue + } + + // combine adjacent cases with the same hash + ncase := 0 + for i := 0; i < run; i++ { + ncase++ + hash := list1(cc[i].node.Right) + for j := i + 1; j < run && cc[i].hash == cc[j].hash; j++ { + hash = list(hash, cc[j].node.Right) + } + cc[i].node.Right = liststmt(hash) + } + + // binary search among cases to narrow by hash + cas = list(cas, s.walkCases(cc[:ncase])) + cc = cc[ncase:] + } + + // handle default case + if nerrors == 0 { + cas = list(cas, def) + sw.Nbody = concat(cas, sw.Nbody) + sw.List = nil + walkstmtlist(sw.Nbody) + } +} + +// typeone generates an AST that jumps to the +// case body if the variable is of type t. +func (s *typeSwitch) typeone(t *Node) *Node { + var name *Node + var init *NodeList + if t.Rlist == nil { + name = nblank + typecheck(&nblank, Erv|Easgn) + } else { + name = t.Rlist.N + init = list1(Nod(ODCL, name, nil)) + a := Nod(OAS, name, nil) + typecheck(&a, Etop) + init = list(init, a) + } + + a := Nod(OAS2, nil, nil) + a.List = list(list1(name), s.okname) // name, ok = + b := Nod(ODOTTYPE, s.facename, nil) + b.Type = t.Left.Type // interface.(type) + a.Rlist = list1(b) + typecheck(&a, Etop) + init = list(init, a) + + c := Nod(OIF, nil, nil) + c.Left = s.okname + c.Nbody = list1(t.Right) // if ok { goto l } + + return liststmt(list(init, c)) +} + +// walkCases generates an AST implementing the cases in cc. +func (s *typeSwitch) walkCases(cc []*caseClause) *Node { + if len(cc) < binarySearchMin { + var cas *NodeList + for _, c := range cc { + n := c.node + if c.typ != caseKindTypeConst { + Fatal("typeSwitch walkCases") + } + a := Nod(OIF, nil, nil) + a.Left = Nod(OEQ, s.hashname, Nodintconst(int64(c.hash))) + typecheck(&a.Left, Erv) + a.Nbody = list1(n.Right) + cas = list(cas, a) + } + return liststmt(cas) + } + + // find the middle and recur + half := len(cc) / 2 + a := Nod(OIF, nil, nil) + a.Left = Nod(OLE, s.hashname, Nodintconst(int64(cc[half-1].hash))) + typecheck(&a.Left, Erv) + a.Nbody = list1(s.walkCases(cc[:half])) + a.Rlist = list1(s.walkCases(cc[half:])) + return a +} + +type caseClauseByOrd []*caseClause + +func (x caseClauseByOrd) Len() int { return len(x) } +func (x caseClauseByOrd) Swap(i, j int) { x[i], x[j] = x[j], x[i] } +func (x caseClauseByOrd) Less(i, j int) bool { + c1, c2 := x[i], x[j] + switch { + // sort default first + case c1.typ == caseKindDefault: + return true + case c2.typ == caseKindDefault: + return false + + // sort nil second + case c1.typ == caseKindTypeNil: + return true + case c2.typ == caseKindTypeNil: + return false + } + + // sort by ordinal + return c1.ordinal < c2.ordinal +} + +type caseClauseByExpr []*caseClause + +func (x caseClauseByExpr) Len() int { return len(x) } +func (x caseClauseByExpr) Swap(i, j int) { x[i], x[j] = x[j], x[i] } +func (x caseClauseByExpr) Less(i, j int) bool { + return exprcmp(x[i], x[j]) < 0 +} + +func exprcmp(c1, c2 *caseClause) int { + // sort non-constants last + if c1.typ != caseKindExprConst { + return +1 + } + if c2.typ != caseKindExprConst { + return -1 + } + + n1 := c1.node.Left + n2 := c2.node.Left + + // sort by type (for switches on interface) + ct := int(n1.Val().Ctype()) + if ct > int(n2.Val().Ctype()) { + return +1 + } + if ct < int(n2.Val().Ctype()) { + return -1 + } + if !Eqtype(n1.Type, n2.Type) { + if n1.Type.Vargen > n2.Type.Vargen { + return +1 + } else { + return -1 + } + } + + // sort by constant value to enable binary search + switch ct { + case CTFLT: + return mpcmpfltflt(n1.Val().U.(*Mpflt), n2.Val().U.(*Mpflt)) + case CTINT, CTRUNE: + return Mpcmpfixfix(n1.Val().U.(*Mpint), n2.Val().U.(*Mpint)) + case CTSTR: + // Sort strings by length and then by value. + // It is much cheaper to compare lengths than values, + // and all we need here is consistency. + // We respect this sorting in exprSwitch.walkCases. + a := n1.Val().U.(string) + b := n2.Val().U.(string) + if len(a) < len(b) { + return -1 + } + if len(a) > len(b) { + return +1 + } + return stringsCompare(a, b) + } + + return 0 +} + +type caseClauseByType []*caseClause + +func (x caseClauseByType) Len() int { return len(x) } +func (x caseClauseByType) Swap(i, j int) { x[i], x[j] = x[j], x[i] } +func (x caseClauseByType) Less(i, j int) bool { + c1, c2 := x[i], x[j] + switch { + // sort non-constants last + case c1.typ != caseKindTypeConst: + return false + case c2.typ != caseKindTypeConst: + return true + + // sort by hash code + case c1.hash != c2.hash: + return c1.hash < c2.hash + } + + // sort by ordinal + return c1.ordinal < c2.ordinal +} + +func dumpcase(cc []*caseClause) { + for _, c := range cc { + switch c.typ { + case caseKindDefault: + fmt.Printf("case-default\n") + fmt.Printf("\tord=%d\n", c.ordinal) + + case caseKindExprConst: + fmt.Printf("case-exprconst\n") + fmt.Printf("\tord=%d\n", c.ordinal) + + case caseKindExprVar: + fmt.Printf("case-exprvar\n") + fmt.Printf("\tord=%d\n", c.ordinal) + fmt.Printf("\top=%v\n", Oconv(int(c.node.Left.Op), 0)) + + case caseKindTypeNil: + fmt.Printf("case-typenil\n") + fmt.Printf("\tord=%d\n", c.ordinal) + + case caseKindTypeConst: + fmt.Printf("case-typeconst\n") + fmt.Printf("\tord=%d\n", c.ordinal) + fmt.Printf("\thash=%x\n", c.hash) + + case caseKindTypeVar: + fmt.Printf("case-typevar\n") + fmt.Printf("\tord=%d\n", c.ordinal) + + default: + fmt.Printf("case-???\n") + fmt.Printf("\tord=%d\n", c.ordinal) + fmt.Printf("\top=%v\n", Oconv(int(c.node.Left.Op), 0)) + fmt.Printf("\thash=%x\n", c.hash) + } + } + + fmt.Printf("\n") +} diff --git a/src/cmd/compile/internal/gc/syntax.go b/src/cmd/compile/internal/gc/syntax.go new file mode 100644 index 0000000000000000000000000000000000000000..7f03a4e87ac6fc70723b1d1051cfc5887f5de2eb --- /dev/null +++ b/src/cmd/compile/internal/gc/syntax.go @@ -0,0 +1,484 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// “Abstract” syntax representation. + +package gc + +// A Node is a single node in the syntax tree. +// Actually the syntax tree is a syntax DAG, because there is only one +// node with Op=ONAME for a given instance of a variable x. +// The same is true for Op=OTYPE and Op=OLITERAL. +type Node struct { + // Tree structure. + // Generic recursive walks should follow these fields. + Left *Node + Right *Node + Ninit *NodeList + Nbody *NodeList + List *NodeList + Rlist *NodeList + + // most nodes + Type *Type + Orig *Node // original form, for printing, and tracking copies of ONAMEs + + // func + Func *Func + + // ONAME + Name *Name + + Sym *Sym // various + E interface{} // Opt or Val, see methods below + + Xoffset int64 + + Lineno int32 + + // OREGISTER, OINDREG + Reg int16 + + Esc uint16 // EscXXX + + Op uint8 + Nointerface bool + Ullman uint8 // sethi/ullman number + Addable bool // addressable + Etype uint8 // op for OASOP, etype for OTYPE, exclam for export, 6g saved reg + Bounded bool // bounds check unnecessary + Class uint8 // PPARAM, PAUTO, PEXTERN, etc + Embedded uint8 // ODCLFIELD embedded type + Colas bool // OAS resulting from := + Diag uint8 // already printed error about this + Noescape bool // func arguments do not escape; TODO(rsc): move Noescape to Func struct (see CL 7360) + Walkdef uint8 + Typecheck uint8 + Local bool + Dodata uint8 + Initorder uint8 + Used bool + Isddd bool // is the argument variadic + Implicit bool + Addrtaken bool // address taken, even if not moved to heap + Assigned bool // is the variable ever assigned to + Likely int8 // likeliness of if statement + Hasbreak bool // has break statement + hasVal int8 // +1 for Val, -1 for Opt, 0 for not yet set +} + +// Val returns the Val for the node. +func (n *Node) Val() Val { + if n.hasVal != +1 { + return Val{} + } + return Val{n.E} +} + +// SetVal sets the Val for the node, which must not have been used with SetOpt. +func (n *Node) SetVal(v Val) { + if n.hasVal == -1 { + Debug['h'] = 1 + Dump("have Opt", n) + Fatal("have Opt") + } + n.hasVal = +1 + n.E = v.U +} + +// Opt returns the optimizer data for the node. +func (n *Node) Opt() interface{} { + if n.hasVal != -1 { + return nil + } + return n.E +} + +// SetOpt sets the optimizer data for the node, which must not have been used with SetVal. +// SetOpt(nil) is ignored for Vals to simplify call sites that are clearing Opts. +func (n *Node) SetOpt(x interface{}) { + if x == nil && n.hasVal >= 0 { + return + } + if n.hasVal == +1 { + Debug['h'] = 1 + Dump("have Val", n) + Fatal("have Val") + } + n.hasVal = -1 + n.E = x +} + +// Name holds Node fields used only by named nodes (ONAME, OPACK, some OLITERAL). +type Name struct { + Pack *Node // real package for import . names + Pkg *Pkg // pkg for OPACK nodes + Heapaddr *Node // temp holding heap address of param + Inlvar *Node // ONAME substitute while inlining + Defn *Node // initializing assignment + Curfn *Node // function for local variables + Param *Param + Decldepth int32 // declaration loop depth, increased for every loop or label + Vargen int32 // unique name for ONAME within a function. Function outputs are numbered starting at one. + Iota int32 // value if this name is iota + Funcdepth int32 + Method bool // OCALLMETH name + Readonly bool + Captured bool // is the variable captured by a closure + Byval bool // is the variable captured by value or by reference + Needzero bool // if it contains pointers, needs to be zeroed on function entry +} + +type Param struct { + Ntype *Node + + // ONAME func param with PHEAP + Outerexpr *Node // expression copied into closure for variable + Stackparam *Node // OPARAM node referring to stack copy of param + + // ONAME PPARAM + Field *Type // TFIELD in arg struct + + // ONAME closure param with PPARAMREF + Outer *Node // outer PPARAMREF in nested closure + Closure *Node // ONAME/PHEAP <-> ONAME/PPARAMREF +} + +// Func holds Node fields used only with function-like nodes. +type Func struct { + Shortname *Node + Enter *NodeList + Exit *NodeList + Cvars *NodeList // closure params + Dcl *NodeList // autodcl for this func/closure + Inldcl *NodeList // copy of dcl for use in inlining + Closgen int + Outerfunc *Node + Fieldtrack []*Type + Outer *Node // outer func for closure + Ntype *Node // signature + Top int // top context (Ecall, Eproc, etc) + Closure *Node // OCLOSURE <-> ODCLFUNC + FCurfn *Node + Nname *Node + + Inl *NodeList // copy of the body for use in inlining + InlCost int32 + Depth int32 + + Endlineno int32 + + Norace bool // func must not have race detector annotations + Nosplit bool // func should not execute on separate stack + Nowritebarrier bool // emit compiler error instead of write barrier + Dupok bool // duplicate definitions ok + Wrapper bool // is method wrapper + Needctxt bool // function uses context register (has closure variables) + Systemstack bool // must run on system stack +} + +// Node ops. +const ( + OXXX = iota + + // names + ONAME // var, const or func name + ONONAME // unnamed arg or return value: f(int, string) (int, error) { etc } + OTYPE // type name + OPACK // import + OLITERAL // literal + + // expressions + OADD // Left + Right + OSUB // Left - Right + OOR // Left | Right + OXOR // Left ^ Right + OADDSTR // Left + Right (string addition) + OADDR // &Left + OANDAND // Left && Right + OAPPEND // append(List) + OARRAYBYTESTR // Type(Left) (Type is string, Left is a []byte) + OARRAYBYTESTRTMP // Type(Left) (Type is string, Left is a []byte, ephemeral) + OARRAYRUNESTR // Type(Left) (Type is string, Left is a []rune) + OSTRARRAYBYTE // Type(Left) (Type is []byte, Left is a string) + OSTRARRAYBYTETMP // Type(Left) (Type is []byte, Left is a string, ephemeral) + OSTRARRAYRUNE // Type(Left) (Type is []rune, Left is a string) + OAS // Left = Right or (if Colas=true) Left := Right + OAS2 // List = Rlist (x, y, z = a, b, c) + OAS2FUNC // List = Rlist (x, y = f()) + OAS2RECV // List = Rlist (x, ok = <-c) + OAS2MAPR // List = Rlist (x, ok = m["foo"]) + OAS2DOTTYPE // List = Rlist (x, ok = I.(int)) + OASOP // Left Etype= Right (x += y) + OASWB // Left = Right (with write barrier) + OCALL // Left(List) (function call, method call or type conversion) + OCALLFUNC // Left(List) (function call f(args)) + OCALLMETH // Left(List) (direct method call x.Method(args)) + OCALLINTER // Left(List) (interface method call x.Method(args)) + OCALLPART // Left.Right (method expression x.Method, not called) + OCAP // cap(Left) + OCLOSE // close(Left) + OCLOSURE // func Type { Body } (func literal) + OCMPIFACE // Left Etype Right (interface comparison, x == y or x != y) + OCMPSTR // Left Etype Right (string comparison, x == y, x < y, etc) + OCOMPLIT // Right{List} (composite literal, not yet lowered to specific form) + OMAPLIT // Type{List} (composite literal, Type is map) + OSTRUCTLIT // Type{List} (composite literal, Type is struct) + OARRAYLIT // Type{List} (composite literal, Type is array or slice) + OPTRLIT // &Left (left is composite literal) + OCONV // Type(Left) (type conversion) + OCONVIFACE // Type(Left) (type conversion, to interface) + OCONVNOP // Type(Left) (type conversion, no effect) + OCOPY // copy(Left, Right) + ODCL // var Left (declares Left of type Left.Type) + + // Used during parsing but don't last. + ODCLFUNC // func f() or func (r) f() + ODCLFIELD // struct field, interface field, or func/method argument/return value. + ODCLCONST // const pi = 3.14 + ODCLTYPE // type Int int + + ODELETE // delete(Left, Right) + ODOT // Left.Right (Left is of struct type) + ODOTPTR // Left.Right (Left is of pointer to struct type) + ODOTMETH // Left.Right (Left is non-interface, Right is method name) + ODOTINTER // Left.Right (Left is interface, Right is method name) + OXDOT // Left.Right (before rewrite to one of the preceding) + ODOTTYPE // Left.Right or Left.Type (.Right during parsing, .Type once resolved) + ODOTTYPE2 // Left.Right or Left.Type (.Right during parsing, .Type once resolved; on rhs of OAS2DOTTYPE) + OEQ // Left == Right + ONE // Left != Right + OLT // Left < Right + OLE // Left <= Right + OGE // Left >= Right + OGT // Left > Right + OIND // *Left + OINDEX // Left[Right] (index of array or slice) + OINDEXMAP // Left[Right] (index of map) + OKEY // Left:Right (key:value in struct/array/map literal, or slice index pair) + OPARAM // variant of ONAME for on-stack copy of a parameter or return value that escapes. + OLEN // len(Left) + OMAKE // make(List) (before type checking converts to one of the following) + OMAKECHAN // make(Type, Left) (type is chan) + OMAKEMAP // make(Type, Left) (type is map) + OMAKESLICE // make(Type, Left, Right) (type is slice) + OMUL // Left * Right + ODIV // Left / Right + OMOD // Left % Right + OLSH // Left << Right + ORSH // Left >> Right + OAND // Left & Right + OANDNOT // Left &^ Right + ONEW // new(Left) + ONOT // !Left + OCOM // ^Left + OPLUS // +Left + OMINUS // -Left + OOROR // Left || Right + OPANIC // panic(Left) + OPRINT // print(List) + OPRINTN // println(List) + OPAREN // (Left) + OSEND // Left <- Right + OSLICE // Left[Right.Left : Right.Right] (Left is untypechecked or slice; Right.Op==OKEY) + OSLICEARR // Left[Right.Left : Right.Right] (Left is array) + OSLICESTR // Left[Right.Left : Right.Right] (Left is string) + OSLICE3 // Left[R.Left : R.R.Left : R.R.R] (R=Right; Left is untypedchecked or slice; R.Op and R.R.Op==OKEY) + OSLICE3ARR // Left[R.Left : R.R.Left : R.R.R] (R=Right; Left is array; R.Op and R.R.Op==OKEY) + ORECOVER // recover() + ORECV // <-Left + ORUNESTR // Type(Left) (Type is string, Left is rune) + OSELRECV // Left = <-Right.Left: (appears as .Left of OCASE; Right.Op == ORECV) + OSELRECV2 // List = <-Right.Left: (apperas as .Left of OCASE; count(List) == 2, Right.Op == ORECV) + OIOTA // iota + OREAL // real(Left) + OIMAG // imag(Left) + OCOMPLEX // complex(Left, Right) + + // statements + OBLOCK // { List } (block of code) + OBREAK // break + OCASE // case List: Nbody (select case after processing; List==nil means default) + OXCASE // case List: Nbody (select case before processing; List==nil means default) + OCONTINUE // continue + ODEFER // defer Left (Left must be call) + OEMPTY // no-op (empty statement) + OFALL // fallthrough (after processing) + OXFALL // fallthrough (before processing) + OFOR // for Ninit; Left; Right { Nbody } + OGOTO // goto Left + OIF // if Ninit; Left { Nbody } else { Rlist } + OLABEL // Left: + OPROC // go Left (Left must be call) + ORANGE // for List = range Right { Nbody } + ORETURN // return List + OSELECT // select { List } (List is list of OXCASE or OCASE) + OSWITCH // switch Ninit; Left { List } (List is a list of OXCASE or OCASE) + OTYPESW // List = Left.(type) (appears as .Left of OSWITCH) + + // types + OTCHAN // chan int + OTMAP // map[string]int + OTSTRUCT // struct{} + OTINTER // interface{} + OTFUNC // func() + OTARRAY // []int, [8]int, [N]int or [...]int + + // misc + ODDD // func f(args ...int) or f(l...) or var a = [...]int{0, 1, 2}. + ODDDARG // func f(args ...int), introduced by escape analysis. + OINLCALL // intermediary representation of an inlined call. + OEFACE // itable and data words of an empty-interface value. + OITAB // itable word of an interface value. + OSPTR // base pointer of a slice or string. + OCLOSUREVAR // variable reference at beginning of closure function + OCFUNC // reference to c function pointer (not go func value) + OCHECKNIL // emit code to ensure pointer/interface not nil + OVARKILL // variable is dead + + // thearch-specific registers + OREGISTER // a register, such as AX. + OINDREG // offset plus indirect of a register, such as 8(SP). + + // arch-specific opcodes + OCMP // compare: ACMP. + ODEC // decrement: ADEC. + OINC // increment: AINC. + OEXTEND // extend: ACWD/ACDQ/ACQO. + OHMUL // high mul: AMUL/AIMUL for unsigned/signed (OMUL uses AIMUL for both). + OLROT // left rotate: AROL. + ORROTC // right rotate-carry: ARCR. + ORETJMP // return to other function + OPS // compare parity set (for x86 NaN check) + OPC // compare parity clear (for x86 NaN check) + OSQRT // sqrt(float64), on systems that have hw support + OGETG // runtime.getg() (read g pointer) + + OEND +) + +// A NodeList is a linked list of nodes. +// TODO(rsc): Some uses of NodeList should be made into slices. +// The remaining ones probably just need a simple linked list, +// not one with concatenation support. +type NodeList struct { + N *Node + Next *NodeList + End *NodeList +} + +// concat returns the concatenation of the lists a and b. +// The storage taken by both is reused for the result. +func concat(a *NodeList, b *NodeList) *NodeList { + if a == nil { + return b + } + if b == nil { + return a + } + + a.End.Next = b + a.End = b.End + b.End = nil + return a +} + +// list1 returns a one-element list containing n. +func list1(n *Node) *NodeList { + if n == nil { + return nil + } + if n.Op == OBLOCK && n.Ninit == nil { + // Flatten list and steal storage. + // Poison pointer to catch errant uses. + l := n.List + + n.List = nil + return l + } + + l := new(NodeList) + l.N = n + l.End = l + return l +} + +// list returns the result of appending n to l. +func list(l *NodeList, n *Node) *NodeList { + return concat(l, list1(n)) +} + +// listsort sorts *l in place according to the 3-way comparison function f. +// The algorithm is mergesort, so it is guaranteed to be O(n log n). +func listsort(l **NodeList, f func(*Node, *Node) int) { + if *l == nil || (*l).Next == nil { + return + } + + l1 := *l + l2 := *l + for { + l2 = l2.Next + if l2 == nil { + break + } + l2 = l2.Next + if l2 == nil { + break + } + l1 = l1.Next + } + + l2 = l1.Next + l1.Next = nil + l2.End = (*l).End + (*l).End = l1 + + l1 = *l + listsort(&l1, f) + listsort(&l2, f) + + if f(l1.N, l2.N) < 0 { + *l = l1 + } else { + *l = l2 + l2 = l1 + l1 = *l + } + + // now l1 == *l; and l1 < l2 + + var le *NodeList + for (l1 != nil) && (l2 != nil) { + for (l1.Next != nil) && f(l1.Next.N, l2.N) < 0 { + l1 = l1.Next + } + + // l1 is last one from l1 that is < l2 + le = l1.Next // le is the rest of l1, first one that is >= l2 + if le != nil { + le.End = (*l).End + } + + (*l).End = l1 // cut *l at l1 + *l = concat(*l, l2) // glue l2 to *l's tail + + l1 = l2 // l1 is the first element of *l that is < the new l2 + l2 = le // ... because l2 now is the old tail of l1 + } + + *l = concat(*l, l2) // any remainder +} + +// count returns the length of the list l. +func count(l *NodeList) int { + n := int64(0) + for ; l != nil; l = l.Next { + n++ + } + if int64(int(n)) != n { // Overflow. + Yyerror("too many elements in list") + } + return int(n) +} diff --git a/src/cmd/compile/internal/gc/typecheck.go b/src/cmd/compile/internal/gc/typecheck.go new file mode 100644 index 0000000000000000000000000000000000000000..befe3b26523251d0498bc4af4ef38710cc68d566 --- /dev/null +++ b/src/cmd/compile/internal/gc/typecheck.go @@ -0,0 +1,4035 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package gc + +import ( + "cmd/internal/obj" + "fmt" + "math" + "strings" +) + +/* + * type check the whole tree of an expression. + * calculates expression types. + * evaluates compile time constants. + * marks variables that escape the local frame. + * rewrites n->op to be more specific in some cases. + */ +var typecheckdefstack *NodeList + +/* + * resolve ONONAME to definition, if any. + */ +func resolve(n *Node) *Node { + if n != nil && n.Op == ONONAME && n.Sym != nil { + r := n.Sym.Def + if r != nil { + if r.Op != OIOTA { + n = r + } else if n.Name.Iota >= 0 { + n = Nodintconst(int64(n.Name.Iota)) + } + } + } + + return n +} + +func typechecklist(l *NodeList, top int) { + for ; l != nil; l = l.Next { + typecheck(&l.N, top) + } +} + +var _typekind = []string{ + TINT: "int", + TUINT: "uint", + TINT8: "int8", + TUINT8: "uint8", + TINT16: "int16", + TUINT16: "uint16", + TINT32: "int32", + TUINT32: "uint32", + TINT64: "int64", + TUINT64: "uint64", + TUINTPTR: "uintptr", + TCOMPLEX64: "complex64", + TCOMPLEX128: "complex128", + TFLOAT32: "float32", + TFLOAT64: "float64", + TBOOL: "bool", + TSTRING: "string", + TPTR32: "pointer", + TPTR64: "pointer", + TUNSAFEPTR: "unsafe.Pointer", + TSTRUCT: "struct", + TINTER: "interface", + TCHAN: "chan", + TMAP: "map", + TARRAY: "array", + TFUNC: "func", + TNIL: "nil", + TIDEAL: "untyped number", +} + +func typekind(t *Type) string { + if Isslice(t) { + return "slice" + } + et := int(t.Etype) + if 0 <= et && et < len(_typekind) { + s := _typekind[et] + if s != "" { + return s + } + } + return fmt.Sprintf("etype=%d", et) +} + +/* + * sprint_depchain prints a dependency chain + * of nodes into fmt. + * It is used by typecheck in the case of OLITERAL nodes + * to print constant definition loops. + */ +func sprint_depchain(fmt_ *string, stack *NodeList, cur *Node, first *Node) { + for l := stack; l != nil; l = l.Next { + if l.N.Op == cur.Op { + if l.N != first { + sprint_depchain(fmt_, l.Next, l.N, first) + } + *fmt_ += fmt.Sprintf("\n\t%v: %v uses %v", l.N.Line(), l.N, cur) + return + } + } +} + +/* + * type check node *np. + * replaces *np with a new pointer in some cases. + * returns the final value of *np as a convenience. + */ + +var typecheck_tcstack *NodeList +var typecheck_tcfree *NodeList + +func typecheck(np **Node, top int) *Node { + // cannot type check until all the source has been parsed + if typecheckok == 0 { + Fatal("early typecheck") + } + + n := *np + if n == nil { + return nil + } + + lno := int(setlineno(n)) + + // Skip over parens. + for n.Op == OPAREN { + n = n.Left + } + + // Resolve definition of name and value of iota lazily. + n = resolve(n) + + *np = n + + // Skip typecheck if already done. + // But re-typecheck ONAME/OTYPE/OLITERAL/OPACK node in case context has changed. + if n.Typecheck == 1 { + switch n.Op { + case ONAME, OTYPE, OLITERAL, OPACK: + break + + default: + lineno = int32(lno) + return n + } + } + + if n.Typecheck == 2 { + // Typechecking loop. Trying printing a meaningful message, + // otherwise a stack trace of typechecking. + var fmt_ string + switch n.Op { + // We can already diagnose variables used as types. + case ONAME: + if top&(Erv|Etype) == Etype { + Yyerror("%v is not a type", n) + } + + case OLITERAL: + if top&(Erv|Etype) == Etype { + Yyerror("%v is not a type", n) + break + } + + fmt_ = "" + sprint_depchain(&fmt_, typecheck_tcstack, n, n) + yyerrorl(int(n.Lineno), "constant definition loop%s", fmt_) + } + + if nsavederrors+nerrors == 0 { + fmt_ = "" + for l := typecheck_tcstack; l != nil; l = l.Next { + fmt_ += fmt.Sprintf("\n\t%v %v", l.N.Line(), l.N) + } + Yyerror("typechecking loop involving %v%s", n, fmt_) + } + + lineno = int32(lno) + return n + } + + n.Typecheck = 2 + + var l *NodeList + if typecheck_tcfree != nil { + l = typecheck_tcfree + typecheck_tcfree = l.Next + } else { + l = new(NodeList) + } + l.Next = typecheck_tcstack + l.N = n + typecheck_tcstack = l + + typecheck1(&n, top) + *np = n + n.Typecheck = 1 + + if typecheck_tcstack != l { + Fatal("typecheck stack out of sync") + } + typecheck_tcstack = l.Next + l.Next = typecheck_tcfree + typecheck_tcfree = l + + lineno = int32(lno) + return n +} + +/* + * does n contain a call or receive operation? + */ +func callrecv(n *Node) bool { + if n == nil { + return false + } + + switch n.Op { + case OCALL, + OCALLMETH, + OCALLINTER, + OCALLFUNC, + ORECV, + OCAP, + OLEN, + OCOPY, + ONEW, + OAPPEND, + ODELETE: + return true + } + + return callrecv(n.Left) || callrecv(n.Right) || callrecvlist(n.Ninit) || callrecvlist(n.Nbody) || callrecvlist(n.List) || callrecvlist(n.Rlist) +} + +func callrecvlist(l *NodeList) bool { + for ; l != nil; l = l.Next { + if callrecv(l.N) { + return true + } + } + return false +} + +// indexlit implements typechecking of untyped values as +// array/slice indexes. It is equivalent to defaultlit +// except for constants of numerical kind, which are acceptable +// whenever they can be represented by a value of type int. +func indexlit(np **Node) { + n := *np + if n == nil || !isideal(n.Type) { + return + } + switch consttype(n) { + case CTINT, CTRUNE, CTFLT, CTCPLX: + defaultlit(np, Types[TINT]) + } + + defaultlit(np, nil) +} + +func typecheck1(np **Node, top int) { + n := *np + defer func() { + *np = n + }() + + if n.Sym != nil { + if n.Op == ONAME && n.Etype != 0 && top&Ecall == 0 { + Yyerror("use of builtin %v not in function call", n.Sym) + n.Type = nil + return + } + + typecheckdef(n) + if n.Op == ONONAME { + n.Type = nil + return + } + } + + ok := 0 +OpSwitch: + switch n.Op { + // until typecheck is complete, do nothing. + default: + Dump("typecheck", n) + + Fatal("typecheck %v", Oconv(int(n.Op), 0)) + + /* + * names + */ + case OLITERAL: + ok |= Erv + + if n.Type == nil && n.Val().Ctype() == CTSTR { + n.Type = idealstring + } + break OpSwitch + + case ONONAME: + ok |= Erv + break OpSwitch + + case ONAME: + if n.Name.Decldepth == 0 { + n.Name.Decldepth = decldepth + } + if n.Etype != 0 { + ok |= Ecall + break OpSwitch + } + + if top&Easgn == 0 { + // not a write to the variable + if isblank(n) { + Yyerror("cannot use _ as value") + n.Type = nil + return + } + + n.Used = true + } + + if top&Ecall == 0 && isunsafebuiltin(n) { + Yyerror("%v is not an expression, must be called", n) + n.Type = nil + return + } + + ok |= Erv + break OpSwitch + + case OPACK: + Yyerror("use of package %v without selector", n.Sym) + n.Type = nil + return + + case ODDD: + break + + /* + * types (OIND is with exprs) + */ + case OTYPE: + ok |= Etype + + if n.Type == nil { + n.Type = nil + return + } + + case OTARRAY: + ok |= Etype + t := typ(TARRAY) + l := n.Left + r := n.Right + if l == nil { + t.Bound = -1 // slice + } else if l.Op == ODDD { + t.Bound = -100 // to be filled in + if top&Ecomplit == 0 && n.Diag == 0 { + t.Broke = 1 + n.Diag = 1 + Yyerror("use of [...] array outside of array literal") + } + } else { + l := typecheck(&n.Left, Erv) + var v Val + switch consttype(l) { + case CTINT, CTRUNE: + v = l.Val() + + case CTFLT: + v = toint(l.Val()) + + default: + if l.Type != nil && Isint[l.Type.Etype] && l.Op != OLITERAL { + Yyerror("non-constant array bound %v", l) + } else { + Yyerror("invalid array bound %v", l) + } + n.Type = nil + return + } + + t.Bound = Mpgetfix(v.U.(*Mpint)) + if doesoverflow(v, Types[TINT]) { + Yyerror("array bound is too large") + n.Type = nil + return + } else if t.Bound < 0 { + Yyerror("array bound must be non-negative") + n.Type = nil + return + } + } + + typecheck(&r, Etype) + if r.Type == nil { + n.Type = nil + return + } + t.Type = r.Type + n.Op = OTYPE + n.Type = t + n.Left = nil + n.Right = nil + if t.Bound != -100 { + checkwidth(t) + } + + case OTMAP: + ok |= Etype + l := typecheck(&n.Left, Etype) + r := typecheck(&n.Right, Etype) + if l.Type == nil || r.Type == nil { + n.Type = nil + return + } + n.Op = OTYPE + n.Type = maptype(l.Type, r.Type) + n.Left = nil + n.Right = nil + + case OTCHAN: + ok |= Etype + l := typecheck(&n.Left, Etype) + if l.Type == nil { + n.Type = nil + return + } + t := typ(TCHAN) + t.Type = l.Type + t.Chan = n.Etype + n.Op = OTYPE + n.Type = t + n.Left = nil + n.Etype = 0 + + case OTSTRUCT: + ok |= Etype + n.Op = OTYPE + n.Type = tostruct(n.List) + if n.Type == nil || n.Type.Broke != 0 { + n.Type = nil + return + } + n.List = nil + + case OTINTER: + ok |= Etype + n.Op = OTYPE + n.Type = tointerface(n.List) + if n.Type == nil { + n.Type = nil + return + } + + case OTFUNC: + ok |= Etype + n.Op = OTYPE + n.Type = functype(n.Left, n.List, n.Rlist) + if n.Type == nil { + n.Type = nil + return + } + + /* + * type or expr + */ + case OIND: + ntop := Erv | Etype + + if top&Eaddr == 0 { // The *x in &*x is not an indirect. + ntop |= Eindir + } + ntop |= top & Ecomplit + l := typecheck(&n.Left, ntop) + t := l.Type + if t == nil { + n.Type = nil + return + } + if l.Op == OTYPE { + ok |= Etype + n.Op = OTYPE + n.Type = Ptrto(l.Type) + n.Left = nil + break OpSwitch + } + + if !Isptr[t.Etype] { + if top&(Erv|Etop) != 0 { + Yyerror("invalid indirect of %v", Nconv(n.Left, obj.FmtLong)) + n.Type = nil + return + } + + break OpSwitch + } + + ok |= Erv + n.Type = t.Type + break OpSwitch + + /* + * arithmetic exprs + */ + case OASOP, + OADD, + OAND, + OANDAND, + OANDNOT, + ODIV, + OEQ, + OGE, + OGT, + OHMUL, + OLE, + OLT, + OLSH, + ORSH, + OMOD, + OMUL, + ONE, + OOR, + OOROR, + OSUB, + OXOR: + var l *Node + var op int + var r *Node + if n.Op == OASOP { + ok |= Etop + l = typecheck(&n.Left, Erv) + r = typecheck(&n.Right, Erv) + checkassign(n, n.Left) + if l.Type == nil || r.Type == nil { + n.Type = nil + return + } + op = int(n.Etype) + } else { + ok |= Erv + l = typecheck(&n.Left, Erv|top&Eiota) + r = typecheck(&n.Right, Erv|top&Eiota) + if l.Type == nil || r.Type == nil { + n.Type = nil + return + } + op = int(n.Op) + } + if op == OLSH || op == ORSH { + defaultlit(&r, Types[TUINT]) + n.Right = r + t := r.Type + if !Isint[t.Etype] || Issigned[t.Etype] { + Yyerror("invalid operation: %v (shift count type %v, must be unsigned integer)", n, r.Type) + n.Type = nil + return + } + + t = l.Type + if t != nil && t.Etype != TIDEAL && !Isint[t.Etype] { + Yyerror("invalid operation: %v (shift of type %v)", n, t) + n.Type = nil + return + } + + // no defaultlit for left + // the outer context gives the type + n.Type = l.Type + + break OpSwitch + } + + // ideal mixed with non-ideal + defaultlit2(&l, &r, 0) + + n.Left = l + n.Right = r + if l.Type == nil || r.Type == nil { + n.Type = nil + return + } + t := l.Type + if t.Etype == TIDEAL { + t = r.Type + } + et := int(t.Etype) + if et == TIDEAL { + et = TINT + } + aop := 0 + if iscmp[n.Op] && t.Etype != TIDEAL && !Eqtype(l.Type, r.Type) { + // comparison is okay as long as one side is + // assignable to the other. convert so they have + // the same type. + // + // the only conversion that isn't a no-op is concrete == interface. + // in that case, check comparability of the concrete type. + // The conversion allocates, so only do it if the concrete type is huge. + if r.Type.Etype != TBLANK { + aop = assignop(l.Type, r.Type, nil) + if aop != 0 { + if Isinter(r.Type) && !Isinter(l.Type) && algtype1(l.Type, nil) == ANOEQ { + Yyerror("invalid operation: %v (operator %v not defined on %s)", n, Oconv(int(op), 0), typekind(l.Type)) + n.Type = nil + return + } + + dowidth(l.Type) + if Isinter(r.Type) == Isinter(l.Type) || l.Type.Width >= 1<<16 { + l = Nod(aop, l, nil) + l.Type = r.Type + l.Typecheck = 1 + n.Left = l + } + + t = r.Type + goto converted + } + } + + if l.Type.Etype != TBLANK { + aop = assignop(r.Type, l.Type, nil) + if aop != 0 { + if Isinter(l.Type) && !Isinter(r.Type) && algtype1(r.Type, nil) == ANOEQ { + Yyerror("invalid operation: %v (operator %v not defined on %s)", n, Oconv(int(op), 0), typekind(r.Type)) + n.Type = nil + return + } + + dowidth(r.Type) + if Isinter(r.Type) == Isinter(l.Type) || r.Type.Width >= 1<<16 { + r = Nod(aop, r, nil) + r.Type = l.Type + r.Typecheck = 1 + n.Right = r + } + + t = l.Type + } + } + + converted: + et = int(t.Etype) + } + + if t.Etype != TIDEAL && !Eqtype(l.Type, r.Type) { + defaultlit2(&l, &r, 1) + if n.Op == OASOP && n.Implicit { + Yyerror("invalid operation: %v (non-numeric type %v)", n, l.Type) + n.Type = nil + return + } + + if Isinter(r.Type) == Isinter(l.Type) || aop == 0 { + Yyerror("invalid operation: %v (mismatched types %v and %v)", n, l.Type, r.Type) + n.Type = nil + return + } + } + + if !okfor[op][et] { + Yyerror("invalid operation: %v (operator %v not defined on %s)", n, Oconv(int(op), 0), typekind(t)) + n.Type = nil + return + } + + // okfor allows any array == array, map == map, func == func. + // restrict to slice/map/func == nil and nil == slice/map/func. + if Isfixedarray(l.Type) && algtype1(l.Type, nil) == ANOEQ { + Yyerror("invalid operation: %v (%v cannot be compared)", n, l.Type) + n.Type = nil + return + } + + if Isslice(l.Type) && !isnil(l) && !isnil(r) { + Yyerror("invalid operation: %v (slice can only be compared to nil)", n) + n.Type = nil + return + } + + if l.Type.Etype == TMAP && !isnil(l) && !isnil(r) { + Yyerror("invalid operation: %v (map can only be compared to nil)", n) + n.Type = nil + return + } + + if l.Type.Etype == TFUNC && !isnil(l) && !isnil(r) { + Yyerror("invalid operation: %v (func can only be compared to nil)", n) + n.Type = nil + return + } + + var badtype *Type + if l.Type.Etype == TSTRUCT && algtype1(l.Type, &badtype) == ANOEQ { + Yyerror("invalid operation: %v (struct containing %v cannot be compared)", n, badtype) + n.Type = nil + return + } + + t = l.Type + if iscmp[n.Op] { + evconst(n) + t = idealbool + if n.Op != OLITERAL { + defaultlit2(&l, &r, 1) + n.Left = l + n.Right = r + } + } else if n.Op == OANDAND || n.Op == OOROR { + if l.Type == r.Type { + t = l.Type + } else if l.Type == idealbool { + t = r.Type + } else if r.Type == idealbool { + t = l.Type + } + } else + // non-comparison operators on ideal bools should make them lose their ideal-ness + if t == idealbool { + t = Types[TBOOL] + } + + if et == TSTRING { + if iscmp[n.Op] { + n.Etype = n.Op + n.Op = OCMPSTR + } else if n.Op == OADD { + // create OADDSTR node with list of strings in x + y + z + (w + v) + ... + n.Op = OADDSTR + + if l.Op == OADDSTR { + n.List = l.List + } else { + n.List = list1(l) + } + if r.Op == OADDSTR { + n.List = concat(n.List, r.List) + } else { + n.List = list(n.List, r) + } + n.Left = nil + n.Right = nil + } + } + + if et == TINTER { + if l.Op == OLITERAL && l.Val().Ctype() == CTNIL { + // swap for back end + n.Left = r + + n.Right = l + } else if r.Op == OLITERAL && r.Val().Ctype() == CTNIL { + } else // leave alone for back end + if Isinter(r.Type) == Isinter(l.Type) { + n.Etype = n.Op + n.Op = OCMPIFACE + } + } + + if (op == ODIV || op == OMOD) && Isconst(r, CTINT) { + if mpcmpfixc(r.Val().U.(*Mpint), 0) == 0 { + Yyerror("division by zero") + n.Type = nil + return + } + } + + n.Type = t + break OpSwitch + + case OCOM, OMINUS, ONOT, OPLUS: + ok |= Erv + l := typecheck(&n.Left, Erv|top&Eiota) + t := l.Type + if t == nil { + n.Type = nil + return + } + if !okfor[n.Op][t.Etype] { + Yyerror("invalid operation: %v %v", Oconv(int(n.Op), 0), t) + n.Type = nil + return + } + + n.Type = t + break OpSwitch + + /* + * exprs + */ + case OADDR: + ok |= Erv + + typecheck(&n.Left, Erv|Eaddr) + if n.Left.Type == nil { + n.Type = nil + return + } + checklvalue(n.Left, "take the address of") + r := outervalue(n.Left) + var l *Node + for l = n.Left; l != r; l = l.Left { + l.Addrtaken = true + if l.Name != nil && l.Name.Param != nil && l.Name.Param.Closure != nil { + l.Name.Param.Closure.Addrtaken = true + } + } + + if l.Orig != l && l.Op == ONAME { + Fatal("found non-orig name node %v", l) + } + l.Addrtaken = true + if l.Name != nil && l.Name.Param != nil && l.Name.Param.Closure != nil { + l.Name.Param.Closure.Addrtaken = true + } + defaultlit(&n.Left, nil) + l = n.Left + t := l.Type + if t == nil { + n.Type = nil + return + } + n.Type = Ptrto(t) + break OpSwitch + + case OCOMPLIT: + ok |= Erv + typecheckcomplit(&n) + if n.Type == nil { + n.Type = nil + return + } + break OpSwitch + + case OXDOT, ODOT: + if n.Op == OXDOT { + n = adddot(n) + n.Op = ODOT + if n.Left == nil { + n.Type = nil + return + } + } + + typecheck(&n.Left, Erv|Etype) + + defaultlit(&n.Left, nil) + if n.Right.Op != ONAME { + Yyerror("rhs of . must be a name") // impossible + n.Type = nil + return + } + + t := n.Left.Type + if t == nil { + adderrorname(n) + n.Type = nil + return + } + + r := n.Right + + if n.Left.Op == OTYPE { + if !looktypedot(n, t, 0) { + if looktypedot(n, t, 1) { + Yyerror("%v undefined (cannot refer to unexported method %v)", n, n.Right.Sym) + } else { + Yyerror("%v undefined (type %v has no method %v)", n, t, n.Right.Sym) + } + n.Type = nil + return + } + + if n.Type.Etype != TFUNC || n.Type.Thistuple != 1 { + Yyerror("type %v has no method %v", n.Left.Type, Sconv(n.Right.Sym, obj.FmtShort)) + n.Type = nil + n.Type = nil + return + } + + n.Op = ONAME + if n.Name == nil { + n.Name = new(Name) + } + n.Sym = n.Right.Sym + n.Type = methodfunc(n.Type, n.Left.Type) + n.Xoffset = 0 + n.Class = PFUNC + ok = Erv + break OpSwitch + } + + if Isptr[t.Etype] && t.Type.Etype != TINTER { + t = t.Type + if t == nil { + n.Type = nil + return + } + n.Op = ODOTPTR + checkwidth(t) + } + + if isblank(n.Right) { + Yyerror("cannot refer to blank field or method") + n.Type = nil + return + } + + if lookdot(n, t, 0) == nil { + // Legitimate field or method lookup failed, try to explain the error + switch { + case isnilinter(t): + Yyerror("%v undefined (type %v is interface with no methods)", n, n.Left.Type) + + case Isptr[t.Etype] && Isinter(t.Type): + // Pointer to interface is almost always a mistake. + Yyerror("%v undefined (type %v is pointer to interface, not interface)", n, n.Left.Type) + + case lookdot(n, t, 1) != nil: + // Field or method matches by name, but it is not exported. + Yyerror("%v undefined (cannot refer to unexported field or method %v)", n, n.Right.Sym) + + default: + if mt := lookdot(n, t, 2); mt != nil { // Case-insensitive lookup. + Yyerror("%v undefined (type %v has no field or method %v, but does have %v)", n, n.Left.Type, n.Right.Sym, mt.Sym) + } else { + Yyerror("%v undefined (type %v has no field or method %v)", n, n.Left.Type, n.Right.Sym) + } + } + n.Type = nil + return + } + + switch n.Op { + case ODOTINTER, ODOTMETH: + if top&Ecall != 0 { + ok |= Ecall + } else { + typecheckpartialcall(n, r) + ok |= Erv + } + + default: + ok |= Erv + } + + break OpSwitch + + case ODOTTYPE: + ok |= Erv + typecheck(&n.Left, Erv) + defaultlit(&n.Left, nil) + l := n.Left + t := l.Type + if t == nil { + n.Type = nil + return + } + if !Isinter(t) { + Yyerror("invalid type assertion: %v (non-interface type %v on left)", n, t) + n.Type = nil + return + } + + if n.Right != nil { + typecheck(&n.Right, Etype) + n.Type = n.Right.Type + n.Right = nil + if n.Type == nil { + n.Type = nil + return + } + } + + if n.Type != nil && n.Type.Etype != TINTER { + var have *Type + var missing *Type + var ptr int + if !implements(n.Type, t, &missing, &have, &ptr) { + if have != nil && have.Sym == missing.Sym { + Yyerror("impossible type assertion:\n\t%v does not implement %v (wrong type for %v method)\n"+"\t\thave %v%v\n\t\twant %v%v", n.Type, t, missing.Sym, have.Sym, Tconv(have.Type, obj.FmtShort|obj.FmtByte), missing.Sym, Tconv(missing.Type, obj.FmtShort|obj.FmtByte)) + } else if ptr != 0 { + Yyerror("impossible type assertion:\n\t%v does not implement %v (%v method has pointer receiver)", n.Type, t, missing.Sym) + } else if have != nil { + Yyerror("impossible type assertion:\n\t%v does not implement %v (missing %v method)\n"+"\t\thave %v%v\n\t\twant %v%v", n.Type, t, missing.Sym, have.Sym, Tconv(have.Type, obj.FmtShort|obj.FmtByte), missing.Sym, Tconv(missing.Type, obj.FmtShort|obj.FmtByte)) + } else { + Yyerror("impossible type assertion:\n\t%v does not implement %v (missing %v method)", n.Type, t, missing.Sym) + } + n.Type = nil + return + } + } + + break OpSwitch + + case OINDEX: + ok |= Erv + typecheck(&n.Left, Erv) + defaultlit(&n.Left, nil) + implicitstar(&n.Left) + l := n.Left + typecheck(&n.Right, Erv) + r := n.Right + t := l.Type + if t == nil || r.Type == nil { + n.Type = nil + return + } + switch t.Etype { + default: + Yyerror("invalid operation: %v (type %v does not support indexing)", n, t) + n.Type = nil + return + + case TSTRING, TARRAY: + indexlit(&n.Right) + if t.Etype == TSTRING { + n.Type = bytetype + } else { + n.Type = t.Type + } + why := "string" + if t.Etype == TARRAY { + if Isfixedarray(t) { + why = "array" + } else { + why = "slice" + } + } + + if n.Right.Type != nil && !Isint[n.Right.Type.Etype] { + Yyerror("non-integer %s index %v", why, n.Right) + break + } + + if Isconst(n.Right, CTINT) { + x := Mpgetfix(n.Right.Val().U.(*Mpint)) + if x < 0 { + Yyerror("invalid %s index %v (index must be non-negative)", why, n.Right) + } else if Isfixedarray(t) && t.Bound > 0 && x >= t.Bound { + Yyerror("invalid array index %v (out of bounds for %d-element array)", n.Right, t.Bound) + } else if Isconst(n.Left, CTSTR) && x >= int64(len(n.Left.Val().U.(string))) { + Yyerror("invalid string index %v (out of bounds for %d-byte string)", n.Right, len(n.Left.Val().U.(string))) + } else if Mpcmpfixfix(n.Right.Val().U.(*Mpint), Maxintval[TINT]) > 0 { + Yyerror("invalid %s index %v (index too large)", why, n.Right) + } + } + + case TMAP: + n.Etype = 0 + defaultlit(&n.Right, t.Down) + if n.Right.Type != nil { + n.Right = assignconv(n.Right, t.Down, "map index") + } + n.Type = t.Type + n.Op = OINDEXMAP + } + + break OpSwitch + + case ORECV: + ok |= Etop | Erv + typecheck(&n.Left, Erv) + defaultlit(&n.Left, nil) + l := n.Left + t := l.Type + if t == nil { + n.Type = nil + return + } + if t.Etype != TCHAN { + Yyerror("invalid operation: %v (receive from non-chan type %v)", n, t) + n.Type = nil + return + } + + if t.Chan&Crecv == 0 { + Yyerror("invalid operation: %v (receive from send-only type %v)", n, t) + n.Type = nil + return + } + + n.Type = t.Type + break OpSwitch + + case OSEND: + ok |= Etop + l := typecheck(&n.Left, Erv) + typecheck(&n.Right, Erv) + defaultlit(&n.Left, nil) + l = n.Left + t := l.Type + if t == nil { + n.Type = nil + return + } + if t.Etype != TCHAN { + Yyerror("invalid operation: %v (send to non-chan type %v)", n, t) + n.Type = nil + return + } + + if t.Chan&Csend == 0 { + Yyerror("invalid operation: %v (send to receive-only type %v)", n, t) + n.Type = nil + return + } + + defaultlit(&n.Right, t.Type) + r := n.Right + if r.Type == nil { + n.Type = nil + return + } + n.Right = assignconv(r, l.Type.Type, "send") + + // TODO: more aggressive + n.Etype = 0 + + n.Type = nil + break OpSwitch + + case OSLICE: + ok |= Erv + typecheck(&n.Left, top) + typecheck(&n.Right.Left, Erv) + typecheck(&n.Right.Right, Erv) + defaultlit(&n.Left, nil) + indexlit(&n.Right.Left) + indexlit(&n.Right.Right) + l := n.Left + if Isfixedarray(l.Type) { + if !islvalue(n.Left) { + Yyerror("invalid operation %v (slice of unaddressable value)", n) + n.Type = nil + return + } + + n.Left = Nod(OADDR, n.Left, nil) + n.Left.Implicit = true + typecheck(&n.Left, Erv) + l = n.Left + } + + t := l.Type + if t == nil { + n.Type = nil + return + } + var tp *Type + if Istype(t, TSTRING) { + n.Type = t + n.Op = OSLICESTR + } else if Isptr[t.Etype] && Isfixedarray(t.Type) { + tp = t.Type + n.Type = typ(TARRAY) + n.Type.Type = tp.Type + n.Type.Bound = -1 + dowidth(n.Type) + n.Op = OSLICEARR + } else if Isslice(t) { + n.Type = t + } else { + Yyerror("cannot slice %v (type %v)", l, t) + n.Type = nil + return + } + + lo := n.Right.Left + if lo != nil && checksliceindex(l, lo, tp) < 0 { + n.Type = nil + return + } + hi := n.Right.Right + if hi != nil && checksliceindex(l, hi, tp) < 0 { + n.Type = nil + return + } + if checksliceconst(lo, hi) < 0 { + n.Type = nil + return + } + break OpSwitch + + case OSLICE3: + ok |= Erv + typecheck(&n.Left, top) + typecheck(&n.Right.Left, Erv) + typecheck(&n.Right.Right.Left, Erv) + typecheck(&n.Right.Right.Right, Erv) + defaultlit(&n.Left, nil) + indexlit(&n.Right.Left) + indexlit(&n.Right.Right.Left) + indexlit(&n.Right.Right.Right) + l := n.Left + if Isfixedarray(l.Type) { + if !islvalue(n.Left) { + Yyerror("invalid operation %v (slice of unaddressable value)", n) + n.Type = nil + return + } + + n.Left = Nod(OADDR, n.Left, nil) + n.Left.Implicit = true + typecheck(&n.Left, Erv) + l = n.Left + } + + t := l.Type + if t == nil { + n.Type = nil + return + } + if Istype(t, TSTRING) { + Yyerror("invalid operation %v (3-index slice of string)", n) + n.Type = nil + return + } + + var tp *Type + if Isptr[t.Etype] && Isfixedarray(t.Type) { + tp = t.Type + n.Type = typ(TARRAY) + n.Type.Type = tp.Type + n.Type.Bound = -1 + dowidth(n.Type) + n.Op = OSLICE3ARR + } else if Isslice(t) { + n.Type = t + } else { + Yyerror("cannot slice %v (type %v)", l, t) + n.Type = nil + return + } + + lo := n.Right.Left + if lo != nil && checksliceindex(l, lo, tp) < 0 { + n.Type = nil + return + } + mid := n.Right.Right.Left + if mid != nil && checksliceindex(l, mid, tp) < 0 { + n.Type = nil + return + } + hi := n.Right.Right.Right + if hi != nil && checksliceindex(l, hi, tp) < 0 { + n.Type = nil + return + } + if checksliceconst(lo, hi) < 0 || checksliceconst(lo, mid) < 0 || checksliceconst(mid, hi) < 0 { + n.Type = nil + return + } + break OpSwitch + + /* + * call and call like + */ + case OCALL: + l := n.Left + + if l.Op == ONAME { + r := unsafenmagic(n) + if r != nil { + if n.Isddd { + Yyerror("invalid use of ... with builtin %v", l) + } + n = r + typecheck1(&n, top) + return + } + } + + typecheck(&n.Left, Erv|Etype|Ecall|top&Eproc) + n.Diag |= n.Left.Diag + l = n.Left + if l.Op == ONAME && l.Etype != 0 { + if n.Isddd && l.Etype != OAPPEND { + Yyerror("invalid use of ... with builtin %v", l) + } + + // builtin: OLEN, OCAP, etc. + n.Op = l.Etype + + n.Left = n.Right + n.Right = nil + typecheck1(&n, top) + return + } + + defaultlit(&n.Left, nil) + l = n.Left + if l.Op == OTYPE { + if n.Isddd || l.Type.Bound == -100 { + if l.Type.Broke == 0 { + Yyerror("invalid use of ... in type conversion to %v", l.Type) + } + n.Diag = 1 + } + + // pick off before type-checking arguments + ok |= Erv + + // turn CALL(type, arg) into CONV(arg) w/ type + n.Left = nil + + n.Op = OCONV + n.Type = l.Type + if onearg(n, "conversion to %v", l.Type) < 0 { + n.Type = nil + return + } + typecheck1(&n, top) + return + } + + if count(n.List) == 1 && !n.Isddd { + typecheck(&n.List.N, Erv|Efnstruct) + } else { + typechecklist(n.List, Erv) + } + t := l.Type + if t == nil { + n.Type = nil + return + } + checkwidth(t) + + switch l.Op { + case ODOTINTER: + n.Op = OCALLINTER + + case ODOTMETH: + n.Op = OCALLMETH + + // typecheckaste was used here but there wasn't enough + // information further down the call chain to know if we + // were testing a method receiver for unexported fields. + // It isn't necessary, so just do a sanity check. + tp := getthisx(t).Type.Type + + if l.Left == nil || !Eqtype(l.Left.Type, tp) { + Fatal("method receiver") + } + + default: + n.Op = OCALLFUNC + if t.Etype != TFUNC { + Yyerror("cannot call non-function %v (type %v)", l, t) + n.Type = nil + return + } + } + + typecheckaste(OCALL, n.Left, n.Isddd, getinargx(t), n.List, func() string { return fmt.Sprintf("argument to %v", n.Left) }) + ok |= Etop + if t.Outtuple == 0 { + break OpSwitch + } + ok |= Erv + if t.Outtuple == 1 { + t := getoutargx(l.Type).Type + if t == nil { + n.Type = nil + return + } + if t.Etype == TFIELD { + t = t.Type + } + n.Type = t + + if n.Op == OCALLFUNC && n.Left.Op == ONAME && (compiling_runtime != 0 || n.Left.Sym.Pkg == Runtimepkg) && n.Left.Sym.Name == "getg" { + // Emit code for runtime.getg() directly instead of calling function. + // Most such rewrites (for example the similar one for math.Sqrt) should be done in walk, + // so that the ordering pass can make sure to preserve the semantics of the original code + // (in particular, the exact time of the function call) by introducing temporaries. + // In this case, we know getg() always returns the same result within a given function + // and we want to avoid the temporaries, so we do the rewrite earlier than is typical. + n.Op = OGETG + } + + break OpSwitch + } + + // multiple return + if top&(Efnstruct|Etop) == 0 { + Yyerror("multiple-value %v() in single-value context", l) + break OpSwitch + } + + n.Type = getoutargx(l.Type) + + break OpSwitch + + case OCAP, OLEN, OREAL, OIMAG: + ok |= Erv + if onearg(n, "%v", Oconv(int(n.Op), 0)) < 0 { + n.Type = nil + return + } + typecheck(&n.Left, Erv) + defaultlit(&n.Left, nil) + implicitstar(&n.Left) + l := n.Left + t := l.Type + if t == nil { + n.Type = nil + return + } + switch n.Op { + case OCAP: + if !okforcap[t.Etype] { + goto badcall1 + } + + case OLEN: + if !okforlen[t.Etype] { + goto badcall1 + } + + case OREAL, OIMAG: + if !Iscomplex[t.Etype] { + goto badcall1 + } + if Isconst(l, CTCPLX) { + r := n + if n.Op == OREAL { + n = nodfltconst(&l.Val().U.(*Mpcplx).Real) + } else { + n = nodfltconst(&l.Val().U.(*Mpcplx).Imag) + } + n.Orig = r + } + + n.Type = Types[cplxsubtype(int(t.Etype))] + break OpSwitch + } + + // might be constant + switch t.Etype { + case TSTRING: + if Isconst(l, CTSTR) { + r := Nod(OXXX, nil, nil) + Nodconst(r, Types[TINT], int64(len(l.Val().U.(string)))) + r.Orig = n + n = r + } + + case TARRAY: + if t.Bound < 0 { // slice + break + } + if callrecv(l) { // has call or receive + break + } + r := Nod(OXXX, nil, nil) + Nodconst(r, Types[TINT], t.Bound) + r.Orig = n + n = r + } + + n.Type = Types[TINT] + break OpSwitch + + badcall1: + Yyerror("invalid argument %v for %v", Nconv(n.Left, obj.FmtLong), Oconv(int(n.Op), 0)) + n.Type = nil + return + + case OCOMPLEX: + ok |= Erv + var r *Node + var l *Node + if count(n.List) == 1 { + typechecklist(n.List, Efnstruct) + if n.List.N.Op != OCALLFUNC && n.List.N.Op != OCALLMETH { + Yyerror("invalid operation: complex expects two arguments") + n.Type = nil + return + } + + t := n.List.N.Left.Type + if t.Outtuple != 2 { + Yyerror("invalid operation: complex expects two arguments, %v returns %d results", n.List.N, t.Outtuple) + n.Type = nil + return + } + + t = n.List.N.Type.Type + l = t.Nname + r = t.Down.Nname + } else { + if twoarg(n) < 0 { + n.Type = nil + return + } + l = typecheck(&n.Left, Erv|top&Eiota) + r = typecheck(&n.Right, Erv|top&Eiota) + if l.Type == nil || r.Type == nil { + n.Type = nil + return + } + defaultlit2(&l, &r, 0) + if l.Type == nil || r.Type == nil { + n.Type = nil + return + } + n.Left = l + n.Right = r + } + + if !Eqtype(l.Type, r.Type) { + Yyerror("invalid operation: %v (mismatched types %v and %v)", n, l.Type, r.Type) + n.Type = nil + return + } + + var t *Type + switch l.Type.Etype { + default: + Yyerror("invalid operation: %v (arguments have type %v, expected floating-point)", n, l.Type) + n.Type = nil + return + + case TIDEAL: + t = Types[TIDEAL] + + case TFLOAT32: + t = Types[TCOMPLEX64] + + case TFLOAT64: + t = Types[TCOMPLEX128] + } + + if l.Op == OLITERAL && r.Op == OLITERAL { + // make it a complex literal + r = nodcplxlit(l.Val(), r.Val()) + + r.Orig = n + n = r + } + + n.Type = t + break OpSwitch + + case OCLOSE: + if onearg(n, "%v", Oconv(int(n.Op), 0)) < 0 { + n.Type = nil + return + } + typecheck(&n.Left, Erv) + defaultlit(&n.Left, nil) + l := n.Left + t := l.Type + if t == nil { + n.Type = nil + return + } + if t.Etype != TCHAN { + Yyerror("invalid operation: %v (non-chan type %v)", n, t) + n.Type = nil + return + } + + if t.Chan&Csend == 0 { + Yyerror("invalid operation: %v (cannot close receive-only channel)", n) + n.Type = nil + return + } + + ok |= Etop + break OpSwitch + + case ODELETE: + args := n.List + if args == nil { + Yyerror("missing arguments to delete") + n.Type = nil + return + } + + if args.Next == nil { + Yyerror("missing second (key) argument to delete") + n.Type = nil + return + } + + if args.Next.Next != nil { + Yyerror("too many arguments to delete") + n.Type = nil + return + } + + ok |= Etop + typechecklist(args, Erv) + l := args.N + r := args.Next.N + if l.Type != nil && l.Type.Etype != TMAP { + Yyerror("first argument to delete must be map; have %v", Tconv(l.Type, obj.FmtLong)) + n.Type = nil + return + } + + args.Next.N = assignconv(r, l.Type.Down, "delete") + break OpSwitch + + case OAPPEND: + ok |= Erv + args := n.List + if args == nil { + Yyerror("missing arguments to append") + n.Type = nil + return + } + + if count(args) == 1 && !n.Isddd { + typecheck(&args.N, Erv|Efnstruct) + } else { + typechecklist(args, Erv) + } + + t := args.N.Type + if t == nil { + n.Type = nil + return + } + + // Unpack multiple-return result before type-checking. + var funarg *Type + if Istype(t, TSTRUCT) && t.Funarg != 0 { + funarg = t + t = t.Type.Type + } + + n.Type = t + if !Isslice(t) { + if Isconst(args.N, CTNIL) { + Yyerror("first argument to append must be typed slice; have untyped nil") + n.Type = nil + return + } + + Yyerror("first argument to append must be slice; have %v", Tconv(t, obj.FmtLong)) + n.Type = nil + return + } + + if n.Isddd { + if args.Next == nil { + Yyerror("cannot use ... on first argument to append") + n.Type = nil + return + } + + if args.Next.Next != nil { + Yyerror("too many arguments to append") + n.Type = nil + return + } + + if Istype(t.Type, TUINT8) && Istype(args.Next.N.Type, TSTRING) { + defaultlit(&args.Next.N, Types[TSTRING]) + break OpSwitch + } + + args.Next.N = assignconv(args.Next.N, t.Orig, "append") + break OpSwitch + } + + if funarg != nil { + for t := funarg.Type.Down; t != nil; t = t.Down { + if assignop(t.Type, n.Type.Type, nil) == 0 { + Yyerror("cannot append %v value to []%v", t.Type, n.Type.Type) + } + } + } else { + for args = args.Next; args != nil; args = args.Next { + if args.N.Type == nil { + continue + } + args.N = assignconv(args.N, t.Type, "append") + } + } + + break OpSwitch + + case OCOPY: + ok |= Etop | Erv + args := n.List + if args == nil || args.Next == nil { + Yyerror("missing arguments to copy") + n.Type = nil + return + } + + if args.Next.Next != nil { + Yyerror("too many arguments to copy") + n.Type = nil + return + } + + n.Left = args.N + n.Right = args.Next.N + n.List = nil + n.Type = Types[TINT] + typecheck(&n.Left, Erv) + typecheck(&n.Right, Erv) + if n.Left.Type == nil || n.Right.Type == nil { + n.Type = nil + return + } + defaultlit(&n.Left, nil) + defaultlit(&n.Right, nil) + if n.Left.Type == nil || n.Right.Type == nil { + n.Type = nil + return + } + + // copy([]byte, string) + if Isslice(n.Left.Type) && n.Right.Type.Etype == TSTRING { + if Eqtype(n.Left.Type.Type, bytetype) { + break OpSwitch + } + Yyerror("arguments to copy have different element types: %v and string", Tconv(n.Left.Type, obj.FmtLong)) + n.Type = nil + return + } + + if !Isslice(n.Left.Type) || !Isslice(n.Right.Type) { + if !Isslice(n.Left.Type) && !Isslice(n.Right.Type) { + Yyerror("arguments to copy must be slices; have %v, %v", Tconv(n.Left.Type, obj.FmtLong), Tconv(n.Right.Type, obj.FmtLong)) + } else if !Isslice(n.Left.Type) { + Yyerror("first argument to copy should be slice; have %v", Tconv(n.Left.Type, obj.FmtLong)) + } else { + Yyerror("second argument to copy should be slice or string; have %v", Tconv(n.Right.Type, obj.FmtLong)) + } + n.Type = nil + return + } + + if !Eqtype(n.Left.Type.Type, n.Right.Type.Type) { + Yyerror("arguments to copy have different element types: %v and %v", Tconv(n.Left.Type, obj.FmtLong), Tconv(n.Right.Type, obj.FmtLong)) + n.Type = nil + return + } + + break OpSwitch + + case OCONV: + ok |= Erv + saveorignode(n) + typecheck(&n.Left, Erv|top&(Eindir|Eiota)) + convlit1(&n.Left, n.Type, true) + t := n.Left.Type + if t == nil || n.Type == nil { + n.Type = nil + return + } + var why string + n.Op = uint8(convertop(t, n.Type, &why)) + if (n.Op) == 0 { + if n.Diag == 0 && n.Type.Broke == 0 { + Yyerror("cannot convert %v to type %v%s", Nconv(n.Left, obj.FmtLong), n.Type, why) + n.Diag = 1 + } + + n.Op = OCONV + } + + switch n.Op { + case OCONVNOP: + if n.Left.Op == OLITERAL && n.Type != Types[TBOOL] { + r := Nod(OXXX, nil, nil) + n.Op = OCONV + n.Orig = r + *r = *n + n.Op = OLITERAL + n.SetVal(n.Left.Val()) + } + + // do not use stringtoarraylit. + // generated code and compiler memory footprint is better without it. + case OSTRARRAYBYTE: + break + + case OSTRARRAYRUNE: + if n.Left.Op == OLITERAL { + stringtoarraylit(&n) + } + } + + break OpSwitch + + case OMAKE: + ok |= Erv + args := n.List + if args == nil { + Yyerror("missing argument to make") + n.Type = nil + return + } + + n.List = nil + l := args.N + args = args.Next + typecheck(&l, Etype) + t := l.Type + if t == nil { + n.Type = nil + return + } + + switch t.Etype { + default: + Yyerror("cannot make type %v", t) + n.Type = nil + return + + case TARRAY: + if !Isslice(t) { + Yyerror("cannot make type %v", t) + n.Type = nil + return + } + + if args == nil { + Yyerror("missing len argument to make(%v)", t) + n.Type = nil + return + } + + l = args.N + args = args.Next + typecheck(&l, Erv) + var r *Node + if args != nil { + r = args.N + args = args.Next + typecheck(&r, Erv) + } + + if l.Type == nil || (r != nil && r.Type == nil) { + n.Type = nil + return + } + et := obj.Bool2int(checkmake(t, "len", l) < 0) + et |= obj.Bool2int(r != nil && checkmake(t, "cap", r) < 0) + if et != 0 { + n.Type = nil + return + } + if Isconst(l, CTINT) && r != nil && Isconst(r, CTINT) && Mpcmpfixfix(l.Val().U.(*Mpint), r.Val().U.(*Mpint)) > 0 { + Yyerror("len larger than cap in make(%v)", t) + n.Type = nil + return + } + + n.Left = l + n.Right = r + n.Op = OMAKESLICE + + case TMAP: + if args != nil { + l = args.N + args = args.Next + typecheck(&l, Erv) + defaultlit(&l, Types[TINT]) + if l.Type == nil { + n.Type = nil + return + } + if checkmake(t, "size", l) < 0 { + n.Type = nil + return + } + n.Left = l + } else { + n.Left = Nodintconst(0) + } + n.Op = OMAKEMAP + + case TCHAN: + l = nil + if args != nil { + l = args.N + args = args.Next + typecheck(&l, Erv) + defaultlit(&l, Types[TINT]) + if l.Type == nil { + n.Type = nil + return + } + if checkmake(t, "buffer", l) < 0 { + n.Type = nil + return + } + n.Left = l + } else { + n.Left = Nodintconst(0) + } + n.Op = OMAKECHAN + } + + if args != nil { + Yyerror("too many arguments to make(%v)", t) + n.Op = OMAKE + n.Type = nil + return + } + + n.Type = t + break OpSwitch + + case ONEW: + ok |= Erv + args := n.List + if args == nil { + Yyerror("missing argument to new") + n.Type = nil + return + } + + l := args.N + typecheck(&l, Etype) + t := l.Type + if t == nil { + n.Type = nil + return + } + if args.Next != nil { + Yyerror("too many arguments to new(%v)", t) + n.Type = nil + return + } + + n.Left = l + n.Type = Ptrto(t) + break OpSwitch + + case OPRINT, OPRINTN: + ok |= Etop + typechecklist(n.List, Erv|Eindir) // Eindir: address does not escape + for args := n.List; args != nil; args = args.Next { + // Special case for print: int constant is int64, not int. + if Isconst(args.N, CTINT) { + defaultlit(&args.N, Types[TINT64]) + } else { + defaultlit(&args.N, nil) + } + } + + break OpSwitch + + case OPANIC: + ok |= Etop + if onearg(n, "panic") < 0 { + n.Type = nil + return + } + typecheck(&n.Left, Erv) + defaultlit(&n.Left, Types[TINTER]) + if n.Left.Type == nil { + n.Type = nil + return + } + break OpSwitch + + case ORECOVER: + ok |= Erv | Etop + if n.List != nil { + Yyerror("too many arguments to recover") + n.Type = nil + return + } + + n.Type = Types[TINTER] + break OpSwitch + + case OCLOSURE: + ok |= Erv + typecheckclosure(n, top) + if n.Type == nil { + n.Type = nil + return + } + break OpSwitch + + case OITAB: + ok |= Erv + typecheck(&n.Left, Erv) + t := n.Left.Type + if t == nil { + n.Type = nil + return + } + if t.Etype != TINTER { + Fatal("OITAB of %v", t) + } + n.Type = Ptrto(Types[TUINTPTR]) + break OpSwitch + + case OSPTR: + ok |= Erv + typecheck(&n.Left, Erv) + t := n.Left.Type + if t == nil { + n.Type = nil + return + } + if !Isslice(t) && t.Etype != TSTRING { + Fatal("OSPTR of %v", t) + } + if t.Etype == TSTRING { + n.Type = Ptrto(Types[TUINT8]) + } else { + n.Type = Ptrto(t.Type) + } + break OpSwitch + + case OCLOSUREVAR: + ok |= Erv + break OpSwitch + + case OCFUNC: + ok |= Erv + typecheck(&n.Left, Erv) + n.Type = Types[TUINTPTR] + break OpSwitch + + case OCONVNOP: + ok |= Erv + typecheck(&n.Left, Erv) + break OpSwitch + + /* + * statements + */ + case OAS: + ok |= Etop + + typecheckas(n) + + // Code that creates temps does not bother to set defn, so do it here. + if n.Left.Op == ONAME && strings.HasPrefix(n.Left.Sym.Name, "autotmp_") { + n.Left.Name.Defn = n + } + break OpSwitch + + case OAS2: + ok |= Etop + typecheckas2(n) + break OpSwitch + + case OBREAK, + OCONTINUE, + ODCL, + OEMPTY, + OGOTO, + OXFALL, + OVARKILL: + ok |= Etop + break OpSwitch + + case OLABEL: + ok |= Etop + decldepth++ + break OpSwitch + + case ODEFER: + ok |= Etop + typecheck(&n.Left, Etop|Erv) + if n.Left.Diag == 0 { + checkdefergo(n) + } + break OpSwitch + + case OPROC: + ok |= Etop + typecheck(&n.Left, Etop|Eproc|Erv) + checkdefergo(n) + break OpSwitch + + case OFOR: + ok |= Etop + typechecklist(n.Ninit, Etop) + decldepth++ + typecheck(&n.Left, Erv) + if n.Left != nil { + t := n.Left.Type + if t != nil && t.Etype != TBOOL { + Yyerror("non-bool %v used as for condition", Nconv(n.Left, obj.FmtLong)) + } + } + typecheck(&n.Right, Etop) + typechecklist(n.Nbody, Etop) + decldepth-- + break OpSwitch + + case OIF: + ok |= Etop + typechecklist(n.Ninit, Etop) + typecheck(&n.Left, Erv) + if n.Left != nil { + t := n.Left.Type + if t != nil && t.Etype != TBOOL { + Yyerror("non-bool %v used as if condition", Nconv(n.Left, obj.FmtLong)) + } + } + typechecklist(n.Nbody, Etop) + typechecklist(n.Rlist, Etop) + break OpSwitch + + case ORETURN: + ok |= Etop + if count(n.List) == 1 { + typechecklist(n.List, Erv|Efnstruct) + } else { + typechecklist(n.List, Erv) + } + if Curfn == nil { + Yyerror("return outside function") + n.Type = nil + return + } + + if Curfn.Type.Outnamed != 0 && n.List == nil { + break OpSwitch + } + typecheckaste(ORETURN, nil, false, getoutargx(Curfn.Type), n.List, func() string { return "return argument" }) + break OpSwitch + + case ORETJMP: + ok |= Etop + break OpSwitch + + case OSELECT: + ok |= Etop + typecheckselect(n) + break OpSwitch + + case OSWITCH: + ok |= Etop + typecheckswitch(n) + break OpSwitch + + case ORANGE: + ok |= Etop + typecheckrange(n) + break OpSwitch + + case OTYPESW: + Yyerror("use of .(type) outside type switch") + n.Type = nil + return + + case OXCASE: + ok |= Etop + typechecklist(n.List, Erv) + typechecklist(n.Nbody, Etop) + break OpSwitch + + case ODCLFUNC: + ok |= Etop + typecheckfunc(n) + break OpSwitch + + case ODCLCONST: + ok |= Etop + typecheck(&n.Left, Erv) + break OpSwitch + + case ODCLTYPE: + ok |= Etop + typecheck(&n.Left, Etype) + if incannedimport == 0 { + checkwidth(n.Left.Type) + } + break OpSwitch + } + + t := n.Type + if t != nil && t.Funarg == 0 && n.Op != OTYPE { + switch t.Etype { + case TFUNC, // might have TANY; wait until its called + TANY, + TFORW, + TIDEAL, + TNIL, + TBLANK: + break + + default: + checkwidth(t) + } + } + + if safemode != 0 && incannedimport == 0 && importpkg == nil && compiling_wrappers == 0 && t != nil && t.Etype == TUNSAFEPTR { + Yyerror("cannot use unsafe.Pointer") + } + + evconst(n) + if n.Op == OTYPE && top&Etype == 0 { + Yyerror("type %v is not an expression", n.Type) + n.Type = nil + return + } + + if top&(Erv|Etype) == Etype && n.Op != OTYPE { + Yyerror("%v is not a type", n) + n.Type = nil + return + } + + // TODO(rsc): simplify + if (top&(Ecall|Erv|Etype) != 0) && top&Etop == 0 && ok&(Erv|Etype|Ecall) == 0 { + Yyerror("%v used as value", n) + n.Type = nil + return + } + + if (top&Etop != 0) && top&(Ecall|Erv|Etype) == 0 && ok&Etop == 0 { + if n.Diag == 0 { + Yyerror("%v evaluated but not used", n) + n.Diag = 1 + } + + n.Type = nil + return + } + + /* TODO + if(n->type == T) + fatal("typecheck nil type"); + */ +} + +func checksliceindex(l *Node, r *Node, tp *Type) int { + t := r.Type + if t == nil { + return -1 + } + if !Isint[t.Etype] { + Yyerror("invalid slice index %v (type %v)", r, t) + return -1 + } + + if r.Op == OLITERAL { + if Mpgetfix(r.Val().U.(*Mpint)) < 0 { + Yyerror("invalid slice index %v (index must be non-negative)", r) + return -1 + } else if tp != nil && tp.Bound > 0 && Mpgetfix(r.Val().U.(*Mpint)) > tp.Bound { + Yyerror("invalid slice index %v (out of bounds for %d-element array)", r, tp.Bound) + return -1 + } else if Isconst(l, CTSTR) && Mpgetfix(r.Val().U.(*Mpint)) > int64(len(l.Val().U.(string))) { + Yyerror("invalid slice index %v (out of bounds for %d-byte string)", r, len(l.Val().U.(string))) + return -1 + } else if Mpcmpfixfix(r.Val().U.(*Mpint), Maxintval[TINT]) > 0 { + Yyerror("invalid slice index %v (index too large)", r) + return -1 + } + } + + return 0 +} + +func checksliceconst(lo *Node, hi *Node) int { + if lo != nil && hi != nil && lo.Op == OLITERAL && hi.Op == OLITERAL && Mpcmpfixfix(lo.Val().U.(*Mpint), hi.Val().U.(*Mpint)) > 0 { + Yyerror("invalid slice index: %v > %v", lo, hi) + return -1 + } + + return 0 +} + +func checkdefergo(n *Node) { + what := "defer" + if n.Op == OPROC { + what = "go" + } + + switch n.Left.Op { + // ok + case OCALLINTER, + OCALLMETH, + OCALLFUNC, + OCLOSE, + OCOPY, + ODELETE, + OPANIC, + OPRINT, + OPRINTN, + ORECOVER: + return + + case OAPPEND, + OCAP, + OCOMPLEX, + OIMAG, + OLEN, + OMAKE, + OMAKESLICE, + OMAKECHAN, + OMAKEMAP, + ONEW, + OREAL, + OLITERAL: // conversion or unsafe.Alignof, Offsetof, Sizeof + if n.Left.Orig != nil && n.Left.Orig.Op == OCONV { + break + } + Yyerror("%s discards result of %v", what, n.Left) + return + } + + // type is broken or missing, most likely a method call on a broken type + // we will warn about the broken type elsewhere. no need to emit a potentially confusing error + if n.Left.Type == nil || n.Left.Type.Broke != 0 { + return + } + + if n.Diag == 0 { + // The syntax made sure it was a call, so this must be + // a conversion. + n.Diag = 1 + + Yyerror("%s requires function call, not conversion", what) + } +} + +func implicitstar(nn **Node) { + // insert implicit * if needed for fixed array + n := *nn + + t := n.Type + if t == nil || !Isptr[t.Etype] { + return + } + t = t.Type + if t == nil { + return + } + if !Isfixedarray(t) { + return + } + n = Nod(OIND, n, nil) + n.Implicit = true + typecheck(&n, Erv) + *nn = n +} + +func onearg(n *Node, f string, args ...interface{}) int { + if n.Left != nil { + return 0 + } + if n.List == nil { + p := fmt.Sprintf(f, args...) + Yyerror("missing argument to %s: %v", p, n) + return -1 + } + + if n.List.Next != nil { + p := fmt.Sprintf(f, args...) + Yyerror("too many arguments to %s: %v", p, n) + n.Left = n.List.N + n.List = nil + return -1 + } + + n.Left = n.List.N + n.List = nil + return 0 +} + +func twoarg(n *Node) int { + if n.Left != nil { + return 0 + } + if n.List == nil { + Yyerror("missing argument to %v - %v", Oconv(int(n.Op), 0), n) + return -1 + } + + n.Left = n.List.N + if n.List.Next == nil { + Yyerror("missing argument to %v - %v", Oconv(int(n.Op), 0), n) + n.List = nil + return -1 + } + + if n.List.Next.Next != nil { + Yyerror("too many arguments to %v - %v", Oconv(int(n.Op), 0), n) + n.List = nil + return -1 + } + + n.Right = n.List.Next.N + n.List = nil + return 0 +} + +func lookdot1(errnode *Node, s *Sym, t *Type, f *Type, dostrcmp int) *Type { + var r *Type + for ; f != nil; f = f.Down { + if dostrcmp != 0 && f.Sym.Name == s.Name { + return f + } + if dostrcmp == 2 && strings.EqualFold(f.Sym.Name, s.Name) { + return f + } + if f.Sym != s { + continue + } + if r != nil { + if errnode != nil { + Yyerror("ambiguous selector %v", errnode) + } else if Isptr[t.Etype] { + Yyerror("ambiguous selector (%v).%v", t, s) + } else { + Yyerror("ambiguous selector %v.%v", t, s) + } + break + } + + r = f + } + + return r +} + +func looktypedot(n *Node, t *Type, dostrcmp int) bool { + s := n.Right.Sym + + if t.Etype == TINTER { + f1 := lookdot1(n, s, t, t.Type, dostrcmp) + if f1 == nil { + return false + } + + n.Right = methodname(n.Right, t) + n.Xoffset = f1.Width + n.Type = f1.Type + n.Op = ODOTINTER + return true + } + + // Find the base type: methtype will fail if t + // is not of the form T or *T. + f2 := methtype(t, 0) + + if f2 == nil { + return false + } + + expandmeth(f2) + f2 = lookdot1(n, s, f2, f2.Xmethod, dostrcmp) + if f2 == nil { + return false + } + + // disallow T.m if m requires *T receiver + if Isptr[getthisx(f2.Type).Type.Type.Etype] && !Isptr[t.Etype] && f2.Embedded != 2 && !isifacemethod(f2.Type) { + Yyerror("invalid method expression %v (needs pointer receiver: (*%v).%v)", n, t, Sconv(f2.Sym, obj.FmtShort)) + return false + } + + n.Right = methodname(n.Right, t) + n.Xoffset = f2.Width + n.Type = f2.Type + n.Op = ODOTMETH + return true +} + +func derefall(t *Type) *Type { + for t != nil && int(t.Etype) == Tptr { + t = t.Type + } + return t +} + +type typeSym struct { + t *Type + s *Sym +} + +// dotField maps (*Type, *Sym) pairs to the corresponding struct field (*Type with Etype==TFIELD). +// It is a cache for use during usefield in walk.go, only enabled when field tracking. +var dotField = map[typeSym]*Type{} + +func lookdot(n *Node, t *Type, dostrcmp int) *Type { + s := n.Right.Sym + + dowidth(t) + var f1 *Type + if t.Etype == TSTRUCT || t.Etype == TINTER { + f1 = lookdot1(n, s, t, t.Type, dostrcmp) + } + + var f2 *Type + if n.Left.Type == t || n.Left.Type.Sym == nil { + f2 = methtype(t, 0) + if f2 != nil { + // Use f2->method, not f2->xmethod: adddot has + // already inserted all the necessary embedded dots. + f2 = lookdot1(n, s, f2, f2.Method, dostrcmp) + } + } + + if f1 != nil { + if dostrcmp > 1 { + // Already in the process of diagnosing an error. + return f1 + } + if f2 != nil { + Yyerror("%v is both field and method", n.Right.Sym) + } + if f1.Width == BADWIDTH { + Fatal("lookdot badwidth %v %p", f1, f1) + } + n.Xoffset = f1.Width + n.Type = f1.Type + if obj.Fieldtrack_enabled > 0 { + dotField[typeSym{t.Orig, s}] = f1 + } + if t.Etype == TINTER { + if Isptr[n.Left.Type.Etype] { + n.Left = Nod(OIND, n.Left, nil) // implicitstar + n.Left.Implicit = true + typecheck(&n.Left, Erv) + } + + n.Op = ODOTINTER + } + + return f1 + } + + if f2 != nil { + if dostrcmp > 1 { + // Already in the process of diagnosing an error. + return f2 + } + tt := n.Left.Type + dowidth(tt) + rcvr := getthisx(f2.Type).Type.Type + if !Eqtype(rcvr, tt) { + if int(rcvr.Etype) == Tptr && Eqtype(rcvr.Type, tt) { + checklvalue(n.Left, "call pointer method on") + n.Left = Nod(OADDR, n.Left, nil) + n.Left.Implicit = true + typecheck(&n.Left, Etype|Erv) + } else if int(tt.Etype) == Tptr && int(rcvr.Etype) != Tptr && Eqtype(tt.Type, rcvr) { + n.Left = Nod(OIND, n.Left, nil) + n.Left.Implicit = true + typecheck(&n.Left, Etype|Erv) + } else if int(tt.Etype) == Tptr && int(tt.Type.Etype) == Tptr && Eqtype(derefall(tt), derefall(rcvr)) { + Yyerror("calling method %v with receiver %v requires explicit dereference", n.Right, Nconv(n.Left, obj.FmtLong)) + for int(tt.Etype) == Tptr { + // Stop one level early for method with pointer receiver. + if int(rcvr.Etype) == Tptr && int(tt.Type.Etype) != Tptr { + break + } + n.Left = Nod(OIND, n.Left, nil) + n.Left.Implicit = true + typecheck(&n.Left, Etype|Erv) + tt = tt.Type + } + } else { + Fatal("method mismatch: %v for %v", rcvr, tt) + } + } + + pll := n + ll := n.Left + for ll.Left != nil && (ll.Op == ODOT || ll.Op == ODOTPTR || ll.Op == OIND) { + pll = ll + ll = ll.Left + } + if pll.Implicit && Isptr[ll.Type.Etype] && ll.Type.Sym != nil && ll.Type.Sym.Def != nil && ll.Type.Sym.Def.Op == OTYPE { + // It is invalid to automatically dereference a named pointer type when selecting a method. + // Make n->left == ll to clarify error message. + n.Left = ll + return nil + } + + n.Right = methodname(n.Right, n.Left.Type) + n.Xoffset = f2.Width + n.Type = f2.Type + + // print("lookdot found [%p] %T\n", f2->type, f2->type); + n.Op = ODOTMETH + + return f2 + } + + return nil +} + +func nokeys(l *NodeList) bool { + for ; l != nil; l = l.Next { + if l.N.Op == OKEY { + return false + } + } + return true +} + +func hasddd(t *Type) bool { + for tl := t.Type; tl != nil; tl = tl.Down { + if tl.Isddd { + return true + } + } + + return false +} + +func downcount(t *Type) int { + n := 0 + for tl := t.Type; tl != nil; tl = tl.Down { + n++ + } + + return n +} + +/* + * typecheck assignment: type list = expression list + */ +func typecheckaste(op int, call *Node, isddd bool, tstruct *Type, nl *NodeList, desc func() string) { + var t *Type + var n *Node + var n1 int + var n2 int + + lno := int(lineno) + + if tstruct.Broke != 0 { + goto out + } + + n = nil + if nl != nil && nl.Next == nil { + n = nl.N + if n.Type != nil { + if n.Type.Etype == TSTRUCT && n.Type.Funarg != 0 { + if !hasddd(tstruct) { + n1 := downcount(tstruct) + n2 := downcount(n.Type) + if n2 > n1 { + goto toomany + } + if n2 < n1 { + goto notenough + } + } + + tn := n.Type.Type + var why string + for tl := tstruct.Type; tl != nil; tl = tl.Down { + if tl.Isddd { + for ; tn != nil; tn = tn.Down { + if assignop(tn.Type, tl.Type.Type, &why) == 0 { + if call != nil { + Yyerror("cannot use %v as type %v in argument to %v%s", tn.Type, tl.Type.Type, call, why) + } else { + Yyerror("cannot use %v as type %v in %s%s", tn.Type, tl.Type.Type, desc(), why) + } + } + } + + goto out + } + + if tn == nil { + goto notenough + } + if assignop(tn.Type, tl.Type, &why) == 0 { + if call != nil { + Yyerror("cannot use %v as type %v in argument to %v%s", tn.Type, tl.Type, call, why) + } else { + Yyerror("cannot use %v as type %v in %s%s", tn.Type, tl.Type, desc(), why) + } + } + + tn = tn.Down + } + + if tn != nil { + goto toomany + } + goto out + } + } + } + + n1 = downcount(tstruct) + n2 = count(nl) + if !hasddd(tstruct) { + if n2 > n1 { + goto toomany + } + if n2 < n1 { + goto notenough + } + } else { + if !isddd { + if n2 < n1-1 { + goto notenough + } + } else { + if n2 > n1 { + goto toomany + } + if n2 < n1 { + goto notenough + } + } + } + + for tl := tstruct.Type; tl != nil; tl = tl.Down { + t = tl.Type + if tl.Isddd { + if isddd { + if nl == nil { + goto notenough + } + if nl.Next != nil { + goto toomany + } + n = nl.N + setlineno(n) + if n.Type != nil { + nl.N = assignconvfn(n, t, desc) + } + goto out + } + + for ; nl != nil; nl = nl.Next { + n = nl.N + setlineno(nl.N) + if n.Type != nil { + nl.N = assignconvfn(n, t.Type, desc) + } + } + + goto out + } + + if nl == nil { + goto notenough + } + n = nl.N + setlineno(n) + if n.Type != nil { + nl.N = assignconvfn(n, t, desc) + } + nl = nl.Next + } + + if nl != nil { + goto toomany + } + if isddd { + if call != nil { + Yyerror("invalid use of ... in call to %v", call) + } else { + Yyerror("invalid use of ... in %v", Oconv(int(op), 0)) + } + } + +out: + lineno = int32(lno) + return + +notenough: + if n == nil || n.Diag == 0 { + if call != nil { + // call is the expression being called, not the overall call. + // Method expressions have the form T.M, and the compiler has + // rewritten those to ONAME nodes but left T in Left. + if call.Op == ONAME && call.Left != nil && call.Left.Op == OTYPE { + Yyerror("not enough arguments in call to method expression %v", call) + } else { + Yyerror("not enough arguments in call to %v", call) + } + } else { + Yyerror("not enough arguments to %v", Oconv(int(op), 0)) + } + if n != nil { + n.Diag = 1 + } + } + + goto out + +toomany: + if call != nil { + Yyerror("too many arguments in call to %v", call) + } else { + Yyerror("too many arguments to %v", Oconv(int(op), 0)) + } + goto out +} + +/* + * type check composite + */ +func fielddup(n *Node, hash map[string]bool) { + if n.Op != ONAME { + Fatal("fielddup: not ONAME") + } + name := n.Sym.Name + if hash[name] { + Yyerror("duplicate field name in struct literal: %s", name) + return + } + hash[name] = true +} + +func keydup(n *Node, hash map[uint32][]*Node) { + orign := n + if n.Op == OCONVIFACE { + n = n.Left + } + evconst(n) + if n.Op != OLITERAL { + return // we don't check variables + } + + var h uint32 + switch n.Val().Ctype() { + default: // unknown, bool, nil + h = 23 + + case CTINT, CTRUNE: + h = uint32(Mpgetfix(n.Val().U.(*Mpint))) + + case CTFLT: + d := mpgetflt(n.Val().U.(*Mpflt)) + x := math.Float64bits(d) + for i := 0; i < 8; i++ { + h = h*PRIME1 + uint32(x&0xFF) + x >>= 8 + } + + case CTSTR: + h = 0 + s := n.Val().U.(string) + for i := len(n.Val().U.(string)); i > 0; i-- { + h = h*PRIME1 + uint32(s[0]) + s = s[1:] + } + } + + var cmp Node + for _, a := range hash[h] { + cmp.Op = OEQ + cmp.Left = n + b := uint32(0) + if a.Op == OCONVIFACE && orign.Op == OCONVIFACE { + if Eqtype(a.Left.Type, n.Type) { + cmp.Right = a.Left + evconst(&cmp) + b = uint32(obj.Bool2int(cmp.Val().U.(bool))) + } + } else if Eqtype(a.Type, n.Type) { + cmp.Right = a + evconst(&cmp) + b = uint32(obj.Bool2int(cmp.Val().U.(bool))) + } + + if b != 0 { + Yyerror("duplicate key %v in map literal", n) + return + } + } + + hash[h] = append(hash[h], orign) +} + +func indexdup(n *Node, hash map[int64]*Node) { + if n.Op != OLITERAL { + Fatal("indexdup: not OLITERAL") + } + + v := Mpgetfix(n.Val().U.(*Mpint)) + if hash[v] != nil { + Yyerror("duplicate index in array literal: %d", v) + return + } + hash[v] = n +} + +func iscomptype(t *Type) bool { + switch t.Etype { + case TARRAY, TSTRUCT, TMAP: + return true + + case TPTR32, TPTR64: + switch t.Type.Etype { + case TARRAY, TSTRUCT, TMAP: + return true + } + } + + return false +} + +func pushtype(n *Node, t *Type) { + if n == nil || n.Op != OCOMPLIT || !iscomptype(t) { + return + } + + if n.Right == nil { + n.Right = typenod(t) + n.Implicit = true // don't print + n.Right.Implicit = true // * is okay + } else if Debug['s'] != 0 { + typecheck(&n.Right, Etype) + if n.Right.Type != nil && Eqtype(n.Right.Type, t) { + fmt.Printf("%v: redundant type: %v\n", n.Line(), t) + } + } +} + +func typecheckcomplit(np **Node) { + n := *np + lno := lineno + defer func() { + lineno = lno + *np = n + }() + + if n.Right == nil { + if n.List != nil { + setlineno(n.List.N) + } + Yyerror("missing type in composite literal") + n.Type = nil + return + } + + // Save original node (including n->right) + norig := Nod(int(n.Op), nil, nil) + + *norig = *n + + setlineno(n.Right) + l := typecheck(&n.Right, Etype|Ecomplit) /* sic */ + t := l.Type + if t == nil { + n.Type = nil + return + } + nerr := nerrors + n.Type = t + + if Isptr[t.Etype] { + // For better or worse, we don't allow pointers as the composite literal type, + // except when using the &T syntax, which sets implicit on the OIND. + if !n.Right.Implicit { + Yyerror("invalid pointer type %v for composite literal (use &%v instead)", t, t.Type) + n.Type = nil + return + } + + // Also, the underlying type must be a struct, map, slice, or array. + if !iscomptype(t) { + Yyerror("invalid pointer type %v for composite literal", t) + n.Type = nil + return + } + + t = t.Type + } + + var r *Node + switch t.Etype { + default: + Yyerror("invalid type for composite literal: %v", t) + n.Type = nil + + case TARRAY: + // Only allocate hash if there are some key/value pairs. + var hash map[int64]*Node + for ll := n.List; ll != nil; ll = ll.Next { + if ll.N.Op == OKEY { + hash = make(map[int64]*Node) + break + } + } + length := int64(0) + i := 0 + var l *Node + for ll := n.List; ll != nil; ll = ll.Next { + l = ll.N + setlineno(l) + if l.Op != OKEY { + l = Nod(OKEY, Nodintconst(int64(i)), l) + l.Left.Type = Types[TINT] + l.Left.Typecheck = 1 + ll.N = l + } + + typecheck(&l.Left, Erv) + evconst(l.Left) + i = nonnegconst(l.Left) + if i < 0 && l.Left.Diag == 0 { + Yyerror("array index must be non-negative integer constant") + l.Left.Diag = 1 + i = -(1 << 30) // stay negative for a while + } + + if i >= 0 && hash != nil { + indexdup(l.Left, hash) + } + i++ + if int64(i) > length { + length = int64(i) + if t.Bound >= 0 && length > t.Bound { + setlineno(l) + Yyerror("array index %d out of bounds [0:%d]", length-1, t.Bound) + t.Bound = -1 // no more errors + } + } + + r = l.Right + pushtype(r, t.Type) + typecheck(&r, Erv) + defaultlit(&r, t.Type) + l.Right = assignconv(r, t.Type, "array element") + } + + if t.Bound == -100 { + t.Bound = length + } + if t.Bound < 0 { + n.Right = Nodintconst(length) + } + n.Op = OARRAYLIT + + case TMAP: + hash := make(map[uint32][]*Node) + var l *Node + for ll := n.List; ll != nil; ll = ll.Next { + l = ll.N + setlineno(l) + if l.Op != OKEY { + typecheck(&ll.N, Erv) + Yyerror("missing key in map literal") + continue + } + + r = l.Left + pushtype(r, t.Down) + typecheck(&r, Erv) + defaultlit(&r, t.Down) + l.Left = assignconv(r, t.Down, "map key") + if l.Left.Op != OCONV { + keydup(l.Left, hash) + } + + r = l.Right + pushtype(r, t.Type) + typecheck(&r, Erv) + defaultlit(&r, t.Type) + l.Right = assignconv(r, t.Type, "map value") + } + + n.Op = OMAPLIT + + case TSTRUCT: + bad := 0 + if n.List != nil && nokeys(n.List) { + // simple list of variables + f := t.Type + + var s *Sym + for ll := n.List; ll != nil; ll = ll.Next { + setlineno(ll.N) + typecheck(&ll.N, Erv) + if f == nil { + tmp12 := bad + bad++ + if tmp12 == 0 { + Yyerror("too many values in struct initializer") + } + continue + } + + s = f.Sym + if s != nil && !exportname(s.Name) && s.Pkg != localpkg { + Yyerror("implicit assignment of unexported field '%s' in %v literal", s.Name, t) + } + + // No pushtype allowed here. Must name fields for that. + ll.N = assignconv(ll.N, f.Type, "field value") + + ll.N = Nod(OKEY, newname(f.Sym), ll.N) + ll.N.Left.Type = f + ll.N.Left.Typecheck = 1 + f = f.Down + } + + if f != nil { + Yyerror("too few values in struct initializer") + } + } else { + hash := make(map[string]bool) + + // keyed list + var s *Sym + var f *Type + var l *Node + var s1 *Sym + for ll := n.List; ll != nil; ll = ll.Next { + l = ll.N + setlineno(l) + if l.Op != OKEY { + tmp13 := bad + bad++ + if tmp13 == 0 { + Yyerror("mixture of field:value and value initializers") + } + typecheck(&ll.N, Erv) + continue + } + + s = l.Left.Sym + if s == nil { + Yyerror("invalid field name %v in struct initializer", l.Left) + typecheck(&l.Right, Erv) + continue + } + + // Sym might have resolved to name in other top-level + // package, because of import dot. Redirect to correct sym + // before we do the lookup. + if s.Pkg != localpkg && exportname(s.Name) { + s1 = Lookup(s.Name) + if s1.Origpkg == s.Pkg { + s = s1 + } + } + + f = lookdot1(nil, s, t, t.Type, 0) + if f == nil { + Yyerror("unknown %v field '%v' in struct literal", t, s) + continue + } + + l.Left = newname(s) + l.Left.Typecheck = 1 + l.Left.Type = f + s = f.Sym + fielddup(newname(s), hash) + r = l.Right + + // No pushtype allowed here. Tried and rejected. + typecheck(&r, Erv) + + l.Right = assignconv(r, f.Type, "field value") + } + } + + n.Op = OSTRUCTLIT + } + + if nerr != nerrors { + n.Type = nil + return + } + + n.Orig = norig + if Isptr[n.Type.Etype] { + n = Nod(OPTRLIT, n, nil) + n.Typecheck = 1 + n.Type = n.Left.Type + n.Left.Type = t + n.Left.Typecheck = 1 + } + + n.Orig = norig + return +} + +/* + * lvalue etc + */ +func islvalue(n *Node) bool { + switch n.Op { + case OINDEX: + if Isfixedarray(n.Left.Type) { + return islvalue(n.Left) + } + if n.Left.Type != nil && n.Left.Type.Etype == TSTRING { + return false + } + fallthrough + + // fall through + case OIND, ODOTPTR, OCLOSUREVAR, OPARAM: + return true + + case ODOT: + return islvalue(n.Left) + + case ONAME: + if n.Class == PFUNC { + return false + } + return true + } + + return false +} + +func checklvalue(n *Node, verb string) { + if !islvalue(n) { + Yyerror("cannot %s %v", verb, n) + } +} + +func checkassign(stmt *Node, n *Node) { + // Variables declared in ORANGE are assigned on every iteration. + if n.Name == nil || n.Name.Defn != stmt || stmt.Op == ORANGE { + r := outervalue(n) + var l *Node + for l = n; l != r; l = l.Left { + l.Assigned = true + if l.Name != nil && l.Name.Param != nil && l.Name.Param.Closure != nil { + l.Name.Param.Closure.Assigned = true + } + } + + l.Assigned = true + if l.Name != nil && l.Name.Param != nil && l.Name.Param.Closure != nil { + l.Name.Param.Closure.Assigned = true + } + } + + if islvalue(n) { + return + } + if n.Op == OINDEXMAP { + n.Etype = 1 + return + } + + // have already complained about n being undefined + if n.Op == ONONAME { + return + } + + Yyerror("cannot assign to %v", n) +} + +func checkassignlist(stmt *Node, l *NodeList) { + for ; l != nil; l = l.Next { + checkassign(stmt, l.N) + } +} + +// Check whether l and r are the same side effect-free expression, +// so that it is safe to reuse one instead of computing both. +func samesafeexpr(l *Node, r *Node) bool { + if l.Op != r.Op || !Eqtype(l.Type, r.Type) { + return false + } + + switch l.Op { + case ONAME, OCLOSUREVAR: + return l == r + + case ODOT, ODOTPTR: + return l.Right != nil && r.Right != nil && l.Right.Sym == r.Right.Sym && samesafeexpr(l.Left, r.Left) + + case OIND: + return samesafeexpr(l.Left, r.Left) + + case OINDEX: + return samesafeexpr(l.Left, r.Left) && samesafeexpr(l.Right, r.Right) + } + + return false +} + +/* + * type check assignment. + * if this assignment is the definition of a var on the left side, + * fill in the var's type. + */ +func typecheckas(n *Node) { + // delicate little dance. + // the definition of n may refer to this assignment + // as its definition, in which case it will call typecheckas. + // in that case, do not call typecheck back, or it will cycle. + // if the variable has a type (ntype) then typechecking + // will not look at defn, so it is okay (and desirable, + // so that the conversion below happens). + n.Left = resolve(n.Left) + + if n.Left.Name == nil || n.Left.Name.Defn != n || n.Left.Name.Param.Ntype != nil { + typecheck(&n.Left, Erv|Easgn) + } + + typecheck(&n.Right, Erv) + checkassign(n, n.Left) + if n.Right != nil && n.Right.Type != nil { + if n.Left.Type != nil { + n.Right = assignconv(n.Right, n.Left.Type, "assignment") + } + } + + if n.Left.Name != nil && n.Left.Name.Defn == n && n.Left.Name.Param.Ntype == nil { + defaultlit(&n.Right, nil) + n.Left.Type = n.Right.Type + } + + // second half of dance. + // now that right is done, typecheck the left + // just to get it over with. see dance above. + n.Typecheck = 1 + + if n.Left.Typecheck == 0 { + typecheck(&n.Left, Erv|Easgn) + } +} + +func checkassignto(src *Type, dst *Node) { + var why string + + if assignop(src, dst.Type, &why) == 0 { + Yyerror("cannot assign %v to %v in multiple assignment%s", src, Nconv(dst, obj.FmtLong), why) + return + } +} + +func typecheckas2(n *Node) { + for ll := n.List; ll != nil; ll = ll.Next { + // delicate little dance. + ll.N = resolve(ll.N) + + if ll.N.Name == nil || ll.N.Name.Defn != n || ll.N.Name.Param.Ntype != nil { + typecheck(&ll.N, Erv|Easgn) + } + } + + cl := count(n.List) + cr := count(n.Rlist) + if cl > 1 && cr == 1 { + typecheck(&n.Rlist.N, Erv|Efnstruct) + } else { + typechecklist(n.Rlist, Erv) + } + checkassignlist(n, n.List) + + var l *Node + var r *Node + if cl == cr { + // easy + ll := n.List + lr := n.Rlist + for ; ll != nil; ll, lr = ll.Next, lr.Next { + if ll.N.Type != nil && lr.N.Type != nil { + lr.N = assignconv(lr.N, ll.N.Type, "assignment") + } + if ll.N.Name != nil && ll.N.Name.Defn == n && ll.N.Name.Param.Ntype == nil { + defaultlit(&lr.N, nil) + ll.N.Type = lr.N.Type + } + } + + goto out + } + + l = n.List.N + r = n.Rlist.N + + // x,y,z = f() + if cr == 1 { + if r.Type == nil { + goto out + } + switch r.Op { + case OCALLMETH, OCALLINTER, OCALLFUNC: + if r.Type.Etype != TSTRUCT || r.Type.Funarg == 0 { + break + } + cr = structcount(r.Type) + if cr != cl { + goto mismatch + } + n.Op = OAS2FUNC + var s Iter + t := Structfirst(&s, &r.Type) + for ll := n.List; ll != nil; ll = ll.Next { + if t.Type != nil && ll.N.Type != nil { + checkassignto(t.Type, ll.N) + } + if ll.N.Name != nil && ll.N.Name.Defn == n && ll.N.Name.Param.Ntype == nil { + ll.N.Type = t.Type + } + t = structnext(&s) + } + + goto out + } + } + + // x, ok = y + if cl == 2 && cr == 1 { + if r.Type == nil { + goto out + } + switch r.Op { + case OINDEXMAP, ORECV, ODOTTYPE: + switch r.Op { + case OINDEXMAP: + n.Op = OAS2MAPR + + case ORECV: + n.Op = OAS2RECV + + case ODOTTYPE: + n.Op = OAS2DOTTYPE + r.Op = ODOTTYPE2 + } + + if l.Type != nil { + checkassignto(r.Type, l) + } + if l.Name != nil && l.Name.Defn == n { + l.Type = r.Type + } + l := n.List.Next.N + if l.Type != nil && l.Type.Etype != TBOOL { + checkassignto(Types[TBOOL], l) + } + if l.Name != nil && l.Name.Defn == n && l.Name.Param.Ntype == nil { + l.Type = Types[TBOOL] + } + goto out + } + } + +mismatch: + Yyerror("assignment count mismatch: %d = %d", cl, cr) + + // second half of dance +out: + n.Typecheck = 1 + + for ll := n.List; ll != nil; ll = ll.Next { + if ll.N.Typecheck == 0 { + typecheck(&ll.N, Erv|Easgn) + } + } +} + +/* + * type check function definition + */ +func typecheckfunc(n *Node) { + typecheck(&n.Func.Nname, Erv|Easgn) + t := n.Func.Nname.Type + if t == nil { + return + } + n.Type = t + t.Nname = n.Func.Nname + rcvr := getthisx(t).Type + if rcvr != nil && n.Func.Shortname != nil && !isblank(n.Func.Shortname) { + addmethod(n.Func.Shortname.Sym, t, true, n.Func.Nname.Nointerface) + } + + for l := n.Func.Dcl; l != nil; l = l.Next { + if l.N.Op == ONAME && (l.N.Class == PPARAM || l.N.Class == PPARAMOUT) { + l.N.Name.Decldepth = 1 + } + } +} + +func stringtoarraylit(np **Node) { + n := *np + if n.Left.Op != OLITERAL || n.Left.Val().Ctype() != CTSTR { + Fatal("stringtoarraylit %v", n) + } + + s := n.Left.Val().U.(string) + var l *NodeList + if n.Type.Type.Etype == TUINT8 { + // []byte + for i := 0; i < len(s); i++ { + l = list(l, Nod(OKEY, Nodintconst(int64(i)), Nodintconst(int64(s[0])))) + } + } else { + // []rune + i := 0 + for _, r := range s { + l = list(l, Nod(OKEY, Nodintconst(int64(i)), Nodintconst(int64(r)))) + i++ + } + } + + nn := Nod(OCOMPLIT, nil, typenod(n.Type)) + nn.List = l + typecheck(&nn, Erv) + *np = nn +} + +var ntypecheckdeftype int + +var methodqueue *NodeList + +func domethod(n *Node) { + nt := n.Type.Nname + typecheck(&nt, Etype) + if nt.Type == nil { + // type check failed; leave empty func + n.Type.Etype = TFUNC + + n.Type.Nod = nil + return + } + + // If we have + // type I interface { + // M(_ int) + // } + // then even though I.M looks like it doesn't care about the + // value of its argument, a specific implementation of I may + // care. The _ would suppress the assignment to that argument + // while generating a call, so remove it. + for t := getinargx(nt.Type).Type; t != nil; t = t.Down { + if t.Sym != nil && t.Sym.Name == "_" { + t.Sym = nil + } + } + + *n.Type = *nt.Type + n.Type.Nod = nil + checkwidth(n.Type) +} + +var mapqueue *NodeList + +func copytype(n *Node, t *Type) { + if t.Etype == TFORW { + // This type isn't computed yet; when it is, update n. + t.Copyto = list(t.Copyto, n) + + return + } + + maplineno := int(n.Type.Maplineno) + embedlineno := int(n.Type.Embedlineno) + + l := n.Type.Copyto + *n.Type = *t + + t = n.Type + t.Sym = n.Sym + t.Local = n.Local + if n.Name != nil { + t.Vargen = n.Name.Vargen + } + t.Siggen = 0 + t.Method = nil + t.Xmethod = nil + t.Nod = nil + t.Printed = 0 + t.Deferwidth = 0 + t.Copyto = nil + + // Update nodes waiting on this type. + for ; l != nil; l = l.Next { + copytype(l.N, t) + } + + // Double-check use of type as embedded type. + lno := int(lineno) + + if embedlineno != 0 { + lineno = int32(embedlineno) + if Isptr[t.Etype] { + Yyerror("embedded type cannot be a pointer") + } + } + + lineno = int32(lno) + + // Queue check for map until all the types are done settling. + if maplineno != 0 { + t.Maplineno = int32(maplineno) + mapqueue = list(mapqueue, n) + } +} + +func typecheckdeftype(n *Node) { + ntypecheckdeftype++ + lno := int(lineno) + setlineno(n) + n.Type.Sym = n.Sym + n.Typecheck = 1 + typecheck(&n.Name.Param.Ntype, Etype) + t := n.Name.Param.Ntype.Type + if t == nil { + n.Diag = 1 + n.Type = nil + goto ret + } + + if n.Type == nil { + n.Diag = 1 + goto ret + } + + // copy new type and clear fields + // that don't come along. + // anything zeroed here must be zeroed in + // typedcl2 too. + copytype(n, t) + +ret: + lineno = int32(lno) + + // if there are no type definitions going on, it's safe to + // try to resolve the method types for the interfaces + // we just read. + if ntypecheckdeftype == 1 { + var l *NodeList + for { + l = methodqueue + if l == nil { + break + } + methodqueue = nil + for ; l != nil; l = l.Next { + domethod(l.N) + } + } + + for l := mapqueue; l != nil; l = l.Next { + lineno = l.N.Type.Maplineno + maptype(l.N.Type, Types[TBOOL]) + } + + lineno = int32(lno) + } + + ntypecheckdeftype-- +} + +func queuemethod(n *Node) { + if ntypecheckdeftype == 0 { + domethod(n) + return + } + + methodqueue = list(methodqueue, n) +} + +func typecheckdef(n *Node) *Node { + lno := int(lineno) + setlineno(n) + + if n.Op == ONONAME { + if n.Diag == 0 { + n.Diag = 1 + if n.Lineno != 0 { + lineno = n.Lineno + } + + // Note: adderrorname looks for this string and + // adds context about the outer expression + Yyerror("undefined: %v", n.Sym) + } + + return n + } + + if n.Walkdef == 1 { + return n + } + + l := new(NodeList) + l.N = n + l.Next = typecheckdefstack + typecheckdefstack = l + + if n.Walkdef == 2 { + Flusherrors() + fmt.Printf("typecheckdef loop:") + for l := typecheckdefstack; l != nil; l = l.Next { + fmt.Printf(" %v", l.N.Sym) + } + fmt.Printf("\n") + Fatal("typecheckdef loop") + } + + n.Walkdef = 2 + + if n.Type != nil || n.Sym == nil { // builtin or no name + goto ret + } + + switch n.Op { + default: + Fatal("typecheckdef %v", Oconv(int(n.Op), 0)) + + // not really syms + case OGOTO, OLABEL: + break + + case OLITERAL: + if n.Name.Param.Ntype != nil { + typecheck(&n.Name.Param.Ntype, Etype) + n.Type = n.Name.Param.Ntype.Type + n.Name.Param.Ntype = nil + if n.Type == nil { + n.Diag = 1 + goto ret + } + } + + e := n.Name.Defn + n.Name.Defn = nil + if e == nil { + lineno = n.Lineno + Dump("typecheckdef nil defn", n) + Yyerror("xxx") + } + + typecheck(&e, Erv|Eiota) + if Isconst(e, CTNIL) { + Yyerror("const initializer cannot be nil") + goto ret + } + + if e.Type != nil && e.Op != OLITERAL || !isgoconst(e) { + if e.Diag == 0 { + Yyerror("const initializer %v is not a constant", e) + e.Diag = 1 + } + + goto ret + } + + t := n.Type + if t != nil { + if !okforconst[t.Etype] { + Yyerror("invalid constant type %v", t) + goto ret + } + + if !isideal(e.Type) && !Eqtype(t, e.Type) { + Yyerror("cannot use %v as type %v in const initializer", Nconv(e, obj.FmtLong), t) + goto ret + } + + Convlit(&e, t) + } + + n.SetVal(e.Val()) + n.Type = e.Type + + case ONAME: + if n.Name.Param.Ntype != nil { + typecheck(&n.Name.Param.Ntype, Etype) + n.Type = n.Name.Param.Ntype.Type + if n.Type == nil { + n.Diag = 1 + goto ret + } + } + + if n.Type != nil { + break + } + if n.Name.Defn == nil { + if n.Etype != 0 { // like OPRINTN + break + } + if nsavederrors+nerrors > 0 { + // Can have undefined variables in x := foo + // that make x have an n->ndefn == nil. + // If there are other errors anyway, don't + // bother adding to the noise. + break + } + + Fatal("var without type, init: %v", n.Sym) + } + + if n.Name.Defn.Op == ONAME { + typecheck(&n.Name.Defn, Erv) + n.Type = n.Name.Defn.Type + break + } + + typecheck(&n.Name.Defn, Etop) // fills in n->type + + case OTYPE: + if Curfn != nil { + defercheckwidth() + } + n.Walkdef = 1 + n.Type = typ(TFORW) + n.Type.Sym = n.Sym + nerrors0 := nerrors + typecheckdeftype(n) + if n.Type.Etype == TFORW && nerrors > nerrors0 { + // Something went wrong during type-checking, + // but it was reported. Silence future errors. + n.Type.Broke = 1 + } + + if Curfn != nil { + resumecheckwidth() + } + + // nothing to see here + case OPACK: + break + } + +ret: + if n.Op != OLITERAL && n.Type != nil && isideal(n.Type) { + Fatal("got %v for %v", n.Type, n) + } + if typecheckdefstack.N != n { + Fatal("typecheckdefstack mismatch") + } + l = typecheckdefstack + typecheckdefstack = l.Next + + lineno = int32(lno) + n.Walkdef = 1 + return n +} + +func checkmake(t *Type, arg string, n *Node) int { + if n.Op == OLITERAL { + switch n.Val().Ctype() { + case CTINT, CTRUNE, CTFLT, CTCPLX: + n.SetVal(toint(n.Val())) + if mpcmpfixc(n.Val().U.(*Mpint), 0) < 0 { + Yyerror("negative %s argument in make(%v)", arg, t) + return -1 + } + + if Mpcmpfixfix(n.Val().U.(*Mpint), Maxintval[TINT]) > 0 { + Yyerror("%s argument too large in make(%v)", arg, t) + return -1 + } + + // Delay defaultlit until after we've checked range, to avoid + // a redundant "constant NNN overflows int" error. + defaultlit(&n, Types[TINT]) + + return 0 + + default: + break + } + } + + if !Isint[n.Type.Etype] && n.Type.Etype != TIDEAL { + Yyerror("non-integer %s argument in make(%v) - %v", arg, t, n.Type) + return -1 + } + + // Defaultlit still necessary for non-constant: n might be 1<left may be mutated by typechecking, check it explicitly + // first to track it correctly. + typecheck(&r.Left, Erv) + + base := r.Left + typecheck(&r, Erv) + switch r.Op { + case ODOT, ODOTPTR: + break + + case OCALLPART: + Yyerror("invalid expression %v: argument is a method value", nn) + v = 0 + goto ret + + default: + goto bad + } + + v = 0 + + // add offsets for inserted dots. + var r1 *Node + for r1 = r; r1.Left != base; r1 = r1.Left { + switch r1.Op { + case ODOT: + v += r1.Xoffset + + case ODOTPTR: + Yyerror("invalid expression %v: selector implies indirection of embedded %v", nn, r1.Left) + goto ret + + default: + Dump("unsafenmagic", r) + Fatal("impossible %v node after dot insertion", Oconv(int(r1.Op), obj.FmtSharp)) + goto bad + } + } + + v += r1.Xoffset + goto yes + } + + if s.Name == "Alignof" { + typecheck(&r, Erv) + defaultlit(&r, nil) + tr := r.Type + if tr == nil { + goto bad + } + + // make struct { byte; T; } + t := typ(TSTRUCT) + + t.Type = typ(TFIELD) + t.Type.Type = Types[TUINT8] + t.Type.Down = typ(TFIELD) + t.Type.Down.Type = tr + + // compute struct widths + dowidth(t) + + // the offset of T is its required alignment + v = t.Type.Down.Width + + goto yes + } + + return nil + +bad: + Yyerror("invalid expression %v", nn) + v = 0 + goto ret + +yes: + if args.Next != nil { + Yyerror("extra arguments for %v", s) + } + + // any side effects disappear; ignore init +ret: + var val Val + val.U = new(Mpint) + Mpmovecfix(val.U.(*Mpint), v) + n := Nod(OLITERAL, nil, nil) + n.Orig = nn + n.SetVal(val) + n.Type = Types[TUINTPTR] + nn.Type = Types[TUINTPTR] + return n +} + +func isunsafebuiltin(n *Node) bool { + if n == nil || n.Op != ONAME || n.Sym == nil || n.Sym.Pkg != unsafepkg { + return false + } + if n.Sym.Name == "Sizeof" { + return true + } + if n.Sym.Name == "Offsetof" { + return true + } + if n.Sym.Name == "Alignof" { + return true + } + return false +} diff --git a/src/cmd/compile/internal/gc/util.go b/src/cmd/compile/internal/gc/util.go new file mode 100644 index 0000000000000000000000000000000000000000..c59af0665b7d61bdf79d59388bd924b4c79d4733 --- /dev/null +++ b/src/cmd/compile/internal/gc/util.go @@ -0,0 +1,103 @@ +package gc + +import ( + "os" + "runtime" + "runtime/pprof" + "strconv" + "strings" +) + +func (n *Node) Line() string { + return Ctxt.LineHist.LineString(int(n.Lineno)) +} + +func atoi(s string) int { + // NOTE: Not strconv.Atoi, accepts hex and octal prefixes. + n, _ := strconv.ParseInt(s, 0, 0) + return int(n) +} + +func isalnum(c int) bool { + return isalpha(c) || isdigit(c) +} + +func isalpha(c int) bool { + return 'A' <= c && c <= 'Z' || 'a' <= c && c <= 'z' +} + +func isdigit(c int) bool { + return '0' <= c && c <= '9' +} + +func plan9quote(s string) string { + if s == "" { + return "'" + strings.Replace(s, "'", "''", -1) + "'" + } + for i := 0; i < len(s); i++ { + if s[i] <= ' ' || s[i] == '\'' { + return "'" + strings.Replace(s, "'", "''", -1) + "'" + } + } + return s +} + +// strings.Compare, introduced in Go 1.5. +func stringsCompare(a, b string) int { + if a == b { + return 0 + } + if a < b { + return -1 + } + return +1 +} + +var atExitFuncs []func() + +func AtExit(f func()) { + atExitFuncs = append(atExitFuncs, f) +} + +func Exit(code int) { + for i := len(atExitFuncs) - 1; i >= 0; i-- { + f := atExitFuncs[i] + atExitFuncs = atExitFuncs[:i] + f() + } + os.Exit(code) +} + +var ( + cpuprofile string + memprofile string + memprofilerate int64 +) + +func startProfile() { + if cpuprofile != "" { + f, err := os.Create(cpuprofile) + if err != nil { + Fatal("%v", err) + } + if err := pprof.StartCPUProfile(f); err != nil { + Fatal("%v", err) + } + AtExit(pprof.StopCPUProfile) + } + if memprofile != "" { + if memprofilerate != 0 { + runtime.MemProfileRate = int(memprofilerate) + } + f, err := os.Create(memprofile) + if err != nil { + Fatal("%v", err) + } + AtExit(func() { + runtime.GC() // profile all outstanding allocations + if err := pprof.WriteHeapProfile(f); err != nil { + Fatal("%v", err) + } + }) + } +} diff --git a/src/cmd/compile/internal/gc/walk.go b/src/cmd/compile/internal/gc/walk.go new file mode 100644 index 0000000000000000000000000000000000000000..af3e1ccbe4e5424191aec5e6fe888bb9bb2e5384 --- /dev/null +++ b/src/cmd/compile/internal/gc/walk.go @@ -0,0 +1,4074 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package gc + +import ( + "cmd/internal/obj" + "fmt" + "strings" +) + +var mpzero Mpint + +// The constant is known to runtime. +const ( + tmpstringbufsize = 32 +) + +func walk(fn *Node) { + Curfn = fn + + if Debug['W'] != 0 { + s := fmt.Sprintf("\nbefore %v", Curfn.Func.Nname.Sym) + dumplist(s, Curfn.Nbody) + } + + lno := int(lineno) + + // Final typecheck for any unused variables. + // It's hard to be on the heap when not-used, but best to be consistent about &~PHEAP here and below. + for l := fn.Func.Dcl; l != nil; l = l.Next { + if l.N.Op == ONAME && l.N.Class&^PHEAP == PAUTO { + typecheck(&l.N, Erv|Easgn) + } + } + + // Propagate the used flag for typeswitch variables up to the NONAME in it's definition. + for l := fn.Func.Dcl; l != nil; l = l.Next { + if l.N.Op == ONAME && l.N.Class&^PHEAP == PAUTO && l.N.Name.Defn != nil && l.N.Name.Defn.Op == OTYPESW && l.N.Used { + l.N.Name.Defn.Left.Used = true + } + } + + for l := fn.Func.Dcl; l != nil; l = l.Next { + if l.N.Op != ONAME || l.N.Class&^PHEAP != PAUTO || l.N.Sym.Name[0] == '&' || l.N.Used { + continue + } + if defn := l.N.Name.Defn; defn != nil && defn.Op == OTYPESW { + if defn.Left.Used { + continue + } + lineno = defn.Left.Lineno + Yyerror("%v declared and not used", l.N.Sym) + defn.Left.Used = true // suppress repeats + } else { + lineno = l.N.Lineno + Yyerror("%v declared and not used", l.N.Sym) + } + } + + lineno = int32(lno) + if nerrors != 0 { + return + } + walkstmtlist(Curfn.Nbody) + if Debug['W'] != 0 { + s := fmt.Sprintf("after walk %v", Curfn.Func.Nname.Sym) + dumplist(s, Curfn.Nbody) + } + + heapmoves() + if Debug['W'] != 0 && Curfn.Func.Enter != nil { + s := fmt.Sprintf("enter %v", Curfn.Func.Nname.Sym) + dumplist(s, Curfn.Func.Enter) + } +} + +func walkstmtlist(l *NodeList) { + for ; l != nil; l = l.Next { + walkstmt(&l.N) + } +} + +func samelist(a *NodeList, b *NodeList) bool { + for ; a != nil && b != nil; a, b = a.Next, b.Next { + if a.N != b.N { + return false + } + } + return a == b +} + +func paramoutheap(fn *Node) bool { + for l := fn.Func.Dcl; l != nil; l = l.Next { + switch l.N.Class { + case PPARAMOUT, + PPARAMOUT | PHEAP: + return l.N.Addrtaken + + // stop early - parameters are over + case PAUTO, + PAUTO | PHEAP: + return false + } + } + + return false +} + +// adds "adjust" to all the argument locations for the call n. +// n must be a defer or go node that has already been walked. +func adjustargs(n *Node, adjust int) { + var arg *Node + var lhs *Node + + callfunc := n.Left + for args := callfunc.List; args != nil; args = args.Next { + arg = args.N + if arg.Op != OAS { + Yyerror("call arg not assignment") + } + lhs = arg.Left + if lhs.Op == ONAME { + // This is a temporary introduced by reorder1. + // The real store to the stack appears later in the arg list. + continue + } + + if lhs.Op != OINDREG { + Yyerror("call argument store does not use OINDREG") + } + + // can't really check this in machine-indep code. + //if(lhs->val.u.reg != D_SP) + // yyerror("call arg assign not indreg(SP)"); + lhs.Xoffset += int64(adjust) + } +} + +func walkstmt(np **Node) { + n := *np + if n == nil { + return + } + if n.Dodata == 2 { // don't walk, generated by anylit. + return + } + + setlineno(n) + + walkstmtlist(n.Ninit) + + switch n.Op { + default: + if n.Op == ONAME { + Yyerror("%v is not a top level statement", n.Sym) + } else { + Yyerror("%v is not a top level statement", Oconv(int(n.Op), 0)) + } + Dump("nottop", n) + + case OAS, + OASOP, + OAS2, + OAS2DOTTYPE, + OAS2RECV, + OAS2FUNC, + OAS2MAPR, + OCLOSE, + OCOPY, + OCALLMETH, + OCALLINTER, + OCALL, + OCALLFUNC, + ODELETE, + OSEND, + OPRINT, + OPRINTN, + OPANIC, + OEMPTY, + ORECOVER, + OGETG: + if n.Typecheck == 0 { + Fatal("missing typecheck: %v", Nconv(n, obj.FmtSign)) + } + init := n.Ninit + n.Ninit = nil + walkexpr(&n, &init) + addinit(&n, init) + if (*np).Op == OCOPY && n.Op == OCONVNOP { + n.Op = OEMPTY // don't leave plain values as statements. + } + + // special case for a receive where we throw away + // the value received. + case ORECV: + if n.Typecheck == 0 { + Fatal("missing typecheck: %v", Nconv(n, obj.FmtSign)) + } + init := n.Ninit + n.Ninit = nil + + walkexpr(&n.Left, &init) + n = mkcall1(chanfn("chanrecv1", 2, n.Left.Type), nil, &init, typename(n.Left.Type), n.Left, nodnil()) + walkexpr(&n, &init) + + addinit(&n, init) + + case OBREAK, + ODCL, + OCONTINUE, + OFALL, + OGOTO, + OLABEL, + ODCLCONST, + ODCLTYPE, + OCHECKNIL, + OVARKILL: + break + + case OBLOCK: + walkstmtlist(n.List) + + case OXCASE: + Yyerror("case statement out of place") + n.Op = OCASE + fallthrough + + case OCASE: + walkstmt(&n.Right) + + case ODEFER: + Hasdefer = 1 + switch n.Left.Op { + case OPRINT, OPRINTN: + walkprintfunc(&n.Left, &n.Ninit) + + case OCOPY: + n.Left = copyany(n.Left, &n.Ninit, 1) + + default: + walkexpr(&n.Left, &n.Ninit) + } + + // make room for size & fn arguments. + adjustargs(n, 2*Widthptr) + + case OFOR: + if n.Left != nil { + walkstmtlist(n.Left.Ninit) + init := n.Left.Ninit + n.Left.Ninit = nil + walkexpr(&n.Left, &init) + addinit(&n.Left, init) + } + + walkstmt(&n.Right) + walkstmtlist(n.Nbody) + + case OIF: + walkexpr(&n.Left, &n.Ninit) + walkstmtlist(n.Nbody) + walkstmtlist(n.Rlist) + + case OPROC: + switch n.Left.Op { + case OPRINT, OPRINTN: + walkprintfunc(&n.Left, &n.Ninit) + + case OCOPY: + n.Left = copyany(n.Left, &n.Ninit, 1) + + default: + walkexpr(&n.Left, &n.Ninit) + } + + // make room for size & fn arguments. + adjustargs(n, 2*Widthptr) + + case ORETURN: + walkexprlist(n.List, &n.Ninit) + if n.List == nil { + break + } + if (Curfn.Type.Outnamed != 0 && count(n.List) > 1) || paramoutheap(Curfn) { + // assign to the function out parameters, + // so that reorder3 can fix up conflicts + var rl *NodeList + + var cl uint8 + for ll := Curfn.Func.Dcl; ll != nil; ll = ll.Next { + cl = ll.N.Class &^ PHEAP + if cl == PAUTO { + break + } + if cl == PPARAMOUT { + rl = list(rl, ll.N) + } + } + + if samelist(rl, n.List) { + // special return in disguise + n.List = nil + + break + } + + if count(n.List) == 1 && count(rl) > 1 { + // OAS2FUNC in disguise + f := n.List.N + + if f.Op != OCALLFUNC && f.Op != OCALLMETH && f.Op != OCALLINTER { + Fatal("expected return of call, have %v", f) + } + n.List = concat(list1(f), ascompatet(int(n.Op), rl, &f.Type, 0, &n.Ninit)) + break + } + + // move function calls out, to make reorder3's job easier. + walkexprlistsafe(n.List, &n.Ninit) + + ll := ascompatee(int(n.Op), rl, n.List, &n.Ninit) + n.List = reorder3(ll) + break + } + + ll := ascompatte(int(n.Op), nil, false, Getoutarg(Curfn.Type), n.List, 1, &n.Ninit) + n.List = ll + + case ORETJMP: + break + + case OSELECT: + walkselect(n) + + case OSWITCH: + walkswitch(n) + + case ORANGE: + walkrange(n) + + case OXFALL: + Yyerror("fallthrough statement out of place") + n.Op = OFALL + } + + if n.Op == ONAME { + Fatal("walkstmt ended up with name: %v", Nconv(n, obj.FmtSign)) + } + + *np = n +} + +func isSmallMakeSlice(n *Node) bool { + if n.Op != OMAKESLICE { + return false + } + l := n.Left + r := n.Right + if r == nil { + r = l + } + t := n.Type + + return Smallintconst(l) && Smallintconst(r) && (t.Type.Width == 0 || Mpgetfix(r.Val().U.(*Mpint)) < (1<<16)/t.Type.Width) +} + +/* + * walk the whole tree of the body of an + * expression or simple statement. + * the types expressions are calculated. + * compile-time constants are evaluated. + * complex side effects like statements are appended to init + */ +func walkexprlist(l *NodeList, init **NodeList) { + for ; l != nil; l = l.Next { + walkexpr(&l.N, init) + } +} + +func walkexprlistsafe(l *NodeList, init **NodeList) { + for ; l != nil; l = l.Next { + l.N = safeexpr(l.N, init) + walkexpr(&l.N, init) + } +} + +func walkexprlistcheap(l *NodeList, init **NodeList) { + for ; l != nil; l = l.Next { + l.N = cheapexpr(l.N, init) + walkexpr(&l.N, init) + } +} + +func walkexpr(np **Node, init **NodeList) { + n := *np + + if n == nil { + return + } + + if init == &n.Ninit { + // not okay to use n->ninit when walking n, + // because we might replace n with some other node + // and would lose the init list. + Fatal("walkexpr init == &n->ninit") + } + + if n.Ninit != nil { + walkstmtlist(n.Ninit) + *init = concat(*init, n.Ninit) + n.Ninit = nil + } + + // annoying case - not typechecked + if n.Op == OKEY { + walkexpr(&n.Left, init) + walkexpr(&n.Right, init) + return + } + + lno := setlineno(n) + + if Debug['w'] > 1 { + Dump("walk-before", n) + } + + if n.Typecheck != 1 { + Fatal("missed typecheck: %v\n", Nconv(n, obj.FmtSign)) + } + + switch n.Op { + default: + Dump("walk", n) + Fatal("walkexpr: switch 1 unknown op %v", Nconv(n, obj.FmtShort|obj.FmtSign)) + + case OTYPE, + ONONAME, + OINDREG, + OEMPTY, + OPARAM, + OGETG: + goto ret + + case ONOT, + OMINUS, + OPLUS, + OCOM, + OREAL, + OIMAG, + ODOTMETH, + ODOTINTER: + walkexpr(&n.Left, init) + goto ret + + case OIND: + walkexpr(&n.Left, init) + goto ret + + case ODOT: + usefield(n) + walkexpr(&n.Left, init) + goto ret + + case ODOTPTR: + usefield(n) + if n.Op == ODOTPTR && n.Left.Type.Type.Width == 0 { + // No actual copy will be generated, so emit an explicit nil check. + n.Left = cheapexpr(n.Left, init) + + checknil(n.Left, init) + } + + walkexpr(&n.Left, init) + goto ret + + case OEFACE: + walkexpr(&n.Left, init) + walkexpr(&n.Right, init) + goto ret + + case OSPTR, OITAB: + walkexpr(&n.Left, init) + goto ret + + case OLEN, OCAP: + walkexpr(&n.Left, init) + + // replace len(*[10]int) with 10. + // delayed until now to preserve side effects. + t := n.Left.Type + + if Isptr[t.Etype] { + t = t.Type + } + if Isfixedarray(t) { + safeexpr(n.Left, init) + Nodconst(n, n.Type, t.Bound) + n.Typecheck = 1 + } + + goto ret + + case OLSH, ORSH: + walkexpr(&n.Left, init) + walkexpr(&n.Right, init) + t := n.Left.Type + n.Bounded = bounded(n.Right, 8*t.Width) + if Debug['m'] != 0 && n.Etype != 0 && !Isconst(n.Right, CTINT) { + Warn("shift bounds check elided") + } + goto ret + + // Use results from call expression as arguments for complex. + case OAND, + OSUB, + OHMUL, + OLT, + OLE, + OGE, + OGT, + OADD, + OCOMPLEX, + OLROT: + if n.Op == OCOMPLEX && n.Left == nil && n.Right == nil { + n.Left = n.List.N + n.Right = n.List.Next.N + } + + walkexpr(&n.Left, init) + walkexpr(&n.Right, init) + goto ret + + case OOR, OXOR: + walkexpr(&n.Left, init) + walkexpr(&n.Right, init) + walkrotate(&n) + goto ret + + case OEQ, ONE: + walkexpr(&n.Left, init) + walkexpr(&n.Right, init) + + // Disable safemode while compiling this code: the code we + // generate internally can refer to unsafe.Pointer. + // In this case it can happen if we need to generate an == + // for a struct containing a reflect.Value, which itself has + // an unexported field of type unsafe.Pointer. + old_safemode := safemode + + safemode = 0 + walkcompare(&n, init) + safemode = old_safemode + goto ret + + case OANDAND, OOROR: + walkexpr(&n.Left, init) + + // cannot put side effects from n.Right on init, + // because they cannot run before n.Left is checked. + // save elsewhere and store on the eventual n.Right. + var ll *NodeList + + walkexpr(&n.Right, &ll) + addinit(&n.Right, ll) + goto ret + + case OPRINT, OPRINTN: + walkexprlist(n.List, init) + n = walkprint(n, init) + goto ret + + case OPANIC: + n = mkcall("gopanic", nil, init, n.Left) + goto ret + + case ORECOVER: + n = mkcall("gorecover", n.Type, init, Nod(OADDR, nodfp, nil)) + goto ret + + case OLITERAL: + n.Addable = true + goto ret + + case OCLOSUREVAR, OCFUNC: + n.Addable = true + goto ret + + case ONAME: + if n.Class&PHEAP == 0 && n.Class != PPARAMREF { + n.Addable = true + } + goto ret + + case OCALLINTER: + t := n.Left.Type + if n.List != nil && n.List.N.Op == OAS { + goto ret + } + walkexpr(&n.Left, init) + walkexprlist(n.List, init) + ll := ascompatte(int(n.Op), n, n.Isddd, getinarg(t), n.List, 0, init) + n.List = reorder1(ll) + goto ret + + case OCALLFUNC: + if n.Left.Op == OCLOSURE { + // Transform direct call of a closure to call of a normal function. + // transformclosure already did all preparation work. + + // Prepend captured variables to argument list. + n.List = concat(n.Left.Func.Enter, n.List) + + n.Left.Func.Enter = nil + + // Replace OCLOSURE with ONAME/PFUNC. + n.Left = n.Left.Func.Closure.Func.Nname + + // Update type of OCALLFUNC node. + // Output arguments had not changed, but their offsets could. + if n.Left.Type.Outtuple == 1 { + t := getoutargx(n.Left.Type).Type + if t.Etype == TFIELD { + t = t.Type + } + n.Type = t + } else { + n.Type = getoutargx(n.Left.Type) + } + } + + t := n.Left.Type + if n.List != nil && n.List.N.Op == OAS { + goto ret + } + + walkexpr(&n.Left, init) + walkexprlist(n.List, init) + + if n.Left.Op == ONAME && n.Left.Sym.Name == "Sqrt" && n.Left.Sym.Pkg.Path == "math" { + switch Thearch.Thechar { + case '5', '6', '7': + n.Op = OSQRT + n.Left = n.List.N + n.List = nil + goto ret + } + } + + ll := ascompatte(int(n.Op), n, n.Isddd, getinarg(t), n.List, 0, init) + n.List = reorder1(ll) + goto ret + + case OCALLMETH: + t := n.Left.Type + if n.List != nil && n.List.N.Op == OAS { + goto ret + } + walkexpr(&n.Left, init) + walkexprlist(n.List, init) + ll := ascompatte(int(n.Op), n, false, getthis(t), list1(n.Left.Left), 0, init) + lr := ascompatte(int(n.Op), n, n.Isddd, getinarg(t), n.List, 0, init) + ll = concat(ll, lr) + n.Left.Left = nil + ullmancalc(n.Left) + n.List = reorder1(ll) + goto ret + + case OAS: + *init = concat(*init, n.Ninit) + n.Ninit = nil + + walkexpr(&n.Left, init) + n.Left = safeexpr(n.Left, init) + + if oaslit(n, init) { + goto ret + } + + if n.Right == nil || iszero(n.Right) && flag_race == 0 { + goto ret + } + + switch n.Right.Op { + default: + walkexpr(&n.Right, init) + + case ODOTTYPE: + // TODO(rsc): The Isfat is for consistency with componentgen and orderexpr. + // It needs to be removed in all three places. + // That would allow inlining x.(struct{*int}) the same as x.(*int). + if isdirectiface(n.Right.Type) && !Isfat(n.Right.Type) && flag_race == 0 { + // handled directly during cgen + walkexpr(&n.Right, init) + break + } + + // x = i.(T); n.Left is x, n.Right.Left is i. + // orderstmt made sure x is addressable. + walkexpr(&n.Right.Left, init) + + n1 := Nod(OADDR, n.Left, nil) + r := n.Right // i.(T) + + if Debug_typeassert > 0 { + Warn("type assertion not inlined") + } + + buf := "assert" + type2IET(r.Left.Type) + "2" + type2IET(r.Type) + fn := syslook(buf, 1) + substArgTypes(fn, r.Left.Type, r.Type) + + n = mkcall1(fn, nil, init, typename(r.Type), r.Left, n1) + walkexpr(&n, init) + goto ret + + case ORECV: + // x = <-c; n.Left is x, n.Right.Left is c. + // orderstmt made sure x is addressable. + walkexpr(&n.Right.Left, init) + + n1 := Nod(OADDR, n.Left, nil) + r := n.Right.Left // the channel + n = mkcall1(chanfn("chanrecv1", 2, r.Type), nil, init, typename(r.Type), r, n1) + walkexpr(&n, init) + goto ret + + case OAPPEND: + // x = append(...) + r := n.Right + if r.Isddd { + r = appendslice(r, init) // also works for append(slice, string). + } else { + r = walkappend(r, init, n) + } + n.Right = r + if r.Op == OAPPEND { + // Left in place for back end. + // Do not add a new write barrier. + goto ret + } + // Otherwise, lowered for race detector. + // Treat as ordinary assignment. + } + + if n.Left != nil && n.Right != nil { + r := convas(Nod(OAS, n.Left, n.Right), init) + r.Dodata = n.Dodata + n = r + n = applywritebarrier(n, init) + } + + goto ret + + case OAS2: + *init = concat(*init, n.Ninit) + n.Ninit = nil + walkexprlistsafe(n.List, init) + walkexprlistsafe(n.Rlist, init) + ll := ascompatee(OAS, n.List, n.Rlist, init) + ll = reorder3(ll) + for lr := ll; lr != nil; lr = lr.Next { + lr.N = applywritebarrier(lr.N, init) + } + n = liststmt(ll) + goto ret + + // a,b,... = fn() + case OAS2FUNC: + *init = concat(*init, n.Ninit) + + n.Ninit = nil + r := n.Rlist.N + walkexprlistsafe(n.List, init) + walkexpr(&r, init) + + ll := ascompatet(int(n.Op), n.List, &r.Type, 0, init) + for lr := ll; lr != nil; lr = lr.Next { + lr.N = applywritebarrier(lr.N, init) + } + n = liststmt(concat(list1(r), ll)) + goto ret + + // x, y = <-c + // orderstmt made sure x is addressable. + case OAS2RECV: + *init = concat(*init, n.Ninit) + + n.Ninit = nil + r := n.Rlist.N + walkexprlistsafe(n.List, init) + walkexpr(&r.Left, init) + var n1 *Node + if isblank(n.List.N) { + n1 = nodnil() + } else { + n1 = Nod(OADDR, n.List.N, nil) + } + n1.Etype = 1 // addr does not escape + fn := chanfn("chanrecv2", 2, r.Left.Type) + r = mkcall1(fn, n.List.Next.N.Type, init, typename(r.Left.Type), r.Left, n1) + n = Nod(OAS, n.List.Next.N, r) + typecheck(&n, Etop) + goto ret + + // a,b = m[i]; + case OAS2MAPR: + *init = concat(*init, n.Ninit) + + n.Ninit = nil + r := n.Rlist.N + walkexprlistsafe(n.List, init) + walkexpr(&r.Left, init) + walkexpr(&r.Right, init) + t := r.Left.Type + p := "" + if t.Type.Width <= 128 { // Check ../../runtime/hashmap.go:maxValueSize before changing. + switch Simsimtype(t.Down) { + case TINT32, TUINT32: + p = "mapaccess2_fast32" + + case TINT64, TUINT64: + p = "mapaccess2_fast64" + + case TSTRING: + p = "mapaccess2_faststr" + } + } + + var key *Node + if p != "" { + // fast versions take key by value + key = r.Right + } else { + // standard version takes key by reference + // orderexpr made sure key is addressable. + key = Nod(OADDR, r.Right, nil) + + p = "mapaccess2" + } + + // from: + // a,b = m[i] + // to: + // var,b = mapaccess2*(t, m, i) + // a = *var + a := n.List.N + + fn := mapfn(p, t) + r = mkcall1(fn, getoutargx(fn.Type), init, typename(t), r.Left, key) + + // mapaccess2* returns a typed bool, but due to spec changes, + // the boolean result of i.(T) is now untyped so we make it the + // same type as the variable on the lhs. + if !isblank(n.List.Next.N) { + r.Type.Type.Down.Type = n.List.Next.N.Type + } + n.Rlist = list1(r) + n.Op = OAS2FUNC + + // don't generate a = *var if a is _ + if !isblank(a) { + var_ := temp(Ptrto(t.Type)) + var_.Typecheck = 1 + n.List.N = var_ + walkexpr(&n, init) + *init = list(*init, n) + n = Nod(OAS, a, Nod(OIND, var_, nil)) + } + + typecheck(&n, Etop) + walkexpr(&n, init) + + // mapaccess needs a zero value to be at least this big. + if zerosize < t.Type.Width { + zerosize = t.Type.Width + } + + // TODO: ptr is always non-nil, so disable nil check for this OIND op. + goto ret + + case ODELETE: + *init = concat(*init, n.Ninit) + n.Ninit = nil + map_ := n.List.N + key := n.List.Next.N + walkexpr(&map_, init) + walkexpr(&key, init) + + // orderstmt made sure key is addressable. + key = Nod(OADDR, key, nil) + + t := map_.Type + n = mkcall1(mapfndel("mapdelete", t), nil, init, typename(t), map_, key) + goto ret + + case OAS2DOTTYPE: + e := n.Rlist.N // i.(T) + // TODO(rsc): The Isfat is for consistency with componentgen and orderexpr. + // It needs to be removed in all three places. + // That would allow inlining x.(struct{*int}) the same as x.(*int). + if isdirectiface(e.Type) && !Isfat(e.Type) && flag_race == 0 { + // handled directly during gen. + walkexprlistsafe(n.List, init) + walkexpr(&e.Left, init) + goto ret + } + + // res, ok = i.(T) + // orderstmt made sure a is addressable. + *init = concat(*init, n.Ninit) + n.Ninit = nil + + walkexprlistsafe(n.List, init) + walkexpr(&e.Left, init) + t := e.Type // T + from := e.Left // i + + oktype := Types[TBOOL] + ok := n.List.Next.N + if !isblank(ok) { + oktype = ok.Type + } + + fromKind := type2IET(from.Type) + toKind := type2IET(t) + + // Avoid runtime calls in a few cases of the form _, ok := i.(T). + // This is faster and shorter and allows the corresponding assertX2X2 + // routines to skip nil checks on their last argument. + if isblank(n.List.N) { + var fast *Node + switch { + case fromKind == "E" && toKind == "T": + tab := Nod(OITAB, from, nil) // type:eface::tab:iface + typ := Nod(OCONVNOP, typename(t), nil) + typ.Type = Ptrto(Types[TUINTPTR]) + fast = Nod(OEQ, tab, typ) + case fromKind == "I" && toKind == "E", + fromKind == "E" && toKind == "E": + tab := Nod(OITAB, from, nil) + fast = Nod(ONE, nodnil(), tab) + } + if fast != nil { + if Debug_typeassert > 0 { + Warn("type assertion (ok only) inlined") + } + n = Nod(OAS, ok, fast) + typecheck(&n, Etop) + goto ret + } + } + + var resptr *Node // &res + if isblank(n.List.N) { + resptr = nodnil() + } else { + resptr = Nod(OADDR, n.List.N, nil) + } + resptr.Etype = 1 // addr does not escape + + if Debug_typeassert > 0 { + Warn("type assertion not inlined") + } + buf := "assert" + fromKind + "2" + toKind + "2" + fn := syslook(buf, 1) + substArgTypes(fn, from.Type, t) + call := mkcall1(fn, oktype, init, typename(t), from, resptr) + n = Nod(OAS, ok, call) + typecheck(&n, Etop) + goto ret + + case ODOTTYPE, ODOTTYPE2: + if !isdirectiface(n.Type) || Isfat(n.Type) { + Fatal("walkexpr ODOTTYPE") // should see inside OAS only + } + walkexpr(&n.Left, init) + goto ret + + case OCONVIFACE: + walkexpr(&n.Left, init) + + // Optimize convT2E as a two-word copy when T is pointer-shaped. + if isnilinter(n.Type) && isdirectiface(n.Left.Type) { + l := Nod(OEFACE, typename(n.Left.Type), n.Left) + l.Type = n.Type + l.Typecheck = n.Typecheck + n = l + goto ret + } + + // Build name of function: convI2E etc. + // Not all names are possible + // (e.g., we'll never generate convE2E or convE2I). + buf := "conv" + type2IET(n.Left.Type) + "2" + type2IET(n.Type) + fn := syslook(buf, 1) + var ll *NodeList + if !Isinter(n.Left.Type) { + ll = list(ll, typename(n.Left.Type)) + } + if !isnilinter(n.Type) { + ll = list(ll, typename(n.Type)) + } + if !Isinter(n.Left.Type) && !isnilinter(n.Type) { + sym := Pkglookup(Tconv(n.Left.Type, obj.FmtLeft)+"."+Tconv(n.Type, obj.FmtLeft), itabpkg) + if sym.Def == nil { + l := Nod(ONAME, nil, nil) + l.Sym = sym + l.Type = Ptrto(Types[TUINT8]) + l.Addable = true + l.Class = PEXTERN + l.Xoffset = 0 + sym.Def = l + ggloblsym(sym, int32(Widthptr), obj.DUPOK|obj.NOPTR) + } + + l := Nod(OADDR, sym.Def, nil) + l.Addable = true + ll = list(ll, l) + + if isdirectiface(n.Left.Type) { + /* For pointer types, we can make a special form of optimization + * + * These statements are put onto the expression init list: + * Itab *tab = atomicloadtype(&cache); + * if(tab == nil) + * tab = typ2Itab(type, itype, &cache); + * + * The CONVIFACE expression is replaced with this: + * OEFACE{tab, ptr}; + */ + l := temp(Ptrto(Types[TUINT8])) + + n1 := Nod(OAS, l, sym.Def) + typecheck(&n1, Etop) + *init = list(*init, n1) + + fn := syslook("typ2Itab", 1) + n1 = Nod(OCALL, fn, nil) + n1.List = ll + typecheck(&n1, Erv) + walkexpr(&n1, init) + + n2 := Nod(OIF, nil, nil) + n2.Left = Nod(OEQ, l, nodnil()) + n2.Nbody = list1(Nod(OAS, l, n1)) + n2.Likely = -1 + typecheck(&n2, Etop) + *init = list(*init, n2) + + l = Nod(OEFACE, l, n.Left) + l.Typecheck = n.Typecheck + l.Type = n.Type + n = l + goto ret + } + } + + if Isinter(n.Left.Type) { + ll = list(ll, n.Left) + } else { + // regular types are passed by reference to avoid C vararg calls + // orderexpr arranged for n.Left to be a temporary for all + // the conversions it could see. comparison of an interface + // with a non-interface, especially in a switch on interface value + // with non-interface cases, is not visible to orderstmt, so we + // have to fall back on allocating a temp here. + if islvalue(n.Left) { + ll = list(ll, Nod(OADDR, n.Left, nil)) + } else { + ll = list(ll, Nod(OADDR, copyexpr(n.Left, n.Left.Type, init), nil)) + } + dowidth(n.Left.Type) + r := nodnil() + if n.Esc == EscNone && n.Left.Type.Width <= 1024 { + // Allocate stack buffer for value stored in interface. + r = temp(n.Left.Type) + r = Nod(OAS, r, nil) // zero temp + typecheck(&r, Etop) + *init = list(*init, r) + r = Nod(OADDR, r.Left, nil) + typecheck(&r, Erv) + } + ll = list(ll, r) + } + + if !Isinter(n.Left.Type) { + substArgTypes(fn, n.Left.Type, n.Left.Type, n.Type) + } else { + substArgTypes(fn, n.Left.Type, n.Type) + } + dowidth(fn.Type) + n = Nod(OCALL, fn, nil) + n.List = ll + typecheck(&n, Erv) + walkexpr(&n, init) + goto ret + + case OCONV, OCONVNOP: + if Thearch.Thechar == '5' { + if Isfloat[n.Left.Type.Etype] { + if n.Type.Etype == TINT64 { + n = mkcall("float64toint64", n.Type, init, conv(n.Left, Types[TFLOAT64])) + goto ret + } + + if n.Type.Etype == TUINT64 { + n = mkcall("float64touint64", n.Type, init, conv(n.Left, Types[TFLOAT64])) + goto ret + } + } + + if Isfloat[n.Type.Etype] { + if n.Left.Type.Etype == TINT64 { + n = mkcall("int64tofloat64", n.Type, init, conv(n.Left, Types[TINT64])) + goto ret + } + + if n.Left.Type.Etype == TUINT64 { + n = mkcall("uint64tofloat64", n.Type, init, conv(n.Left, Types[TUINT64])) + goto ret + } + } + } + + walkexpr(&n.Left, init) + goto ret + + case OANDNOT: + walkexpr(&n.Left, init) + n.Op = OAND + n.Right = Nod(OCOM, n.Right, nil) + typecheck(&n.Right, Erv) + walkexpr(&n.Right, init) + goto ret + + case OMUL: + walkexpr(&n.Left, init) + walkexpr(&n.Right, init) + walkmul(&n, init) + goto ret + + case ODIV, OMOD: + walkexpr(&n.Left, init) + walkexpr(&n.Right, init) + + /* + * rewrite complex div into function call. + */ + et := int(n.Left.Type.Etype) + + if Iscomplex[et] && n.Op == ODIV { + t := n.Type + n = mkcall("complex128div", Types[TCOMPLEX128], init, conv(n.Left, Types[TCOMPLEX128]), conv(n.Right, Types[TCOMPLEX128])) + n = conv(n, t) + goto ret + } + + // Nothing to do for float divisions. + if Isfloat[et] { + goto ret + } + + // Try rewriting as shifts or magic multiplies. + walkdiv(&n, init) + + /* + * rewrite 64-bit div and mod into function calls + * on 32-bit architectures. + */ + switch n.Op { + case OMOD, ODIV: + if Widthreg >= 8 || (et != TUINT64 && et != TINT64) { + goto ret + } + var fn string + if et == TINT64 { + fn = "int64" + } else { + fn = "uint64" + } + if n.Op == ODIV { + fn += "div" + } else { + fn += "mod" + } + n = mkcall(fn, n.Type, init, conv(n.Left, Types[et]), conv(n.Right, Types[et])) + + default: + break + } + + goto ret + + case OINDEX: + walkexpr(&n.Left, init) + + // save the original node for bounds checking elision. + // If it was a ODIV/OMOD walk might rewrite it. + r := n.Right + + walkexpr(&n.Right, init) + + // if range of type cannot exceed static array bound, + // disable bounds check. + if n.Bounded { + goto ret + } + t := n.Left.Type + if t != nil && Isptr[t.Etype] { + t = t.Type + } + if Isfixedarray(t) { + n.Bounded = bounded(r, t.Bound) + if Debug['m'] != 0 && n.Bounded && !Isconst(n.Right, CTINT) { + Warn("index bounds check elided") + } + if Smallintconst(n.Right) && !n.Bounded { + Yyerror("index out of bounds") + } + } else if Isconst(n.Left, CTSTR) { + n.Bounded = bounded(r, int64(len(n.Left.Val().U.(string)))) + if Debug['m'] != 0 && n.Bounded && !Isconst(n.Right, CTINT) { + Warn("index bounds check elided") + } + if Smallintconst(n.Right) { + if !n.Bounded { + Yyerror("index out of bounds") + } else { + // replace "abc"[1] with 'b'. + // delayed until now because "abc"[1] is not + // an ideal constant. + v := Mpgetfix(n.Right.Val().U.(*Mpint)) + + Nodconst(n, n.Type, int64(n.Left.Val().U.(string)[v])) + n.Typecheck = 1 + } + } + } + + if Isconst(n.Right, CTINT) { + if Mpcmpfixfix(n.Right.Val().U.(*Mpint), &mpzero) < 0 || Mpcmpfixfix(n.Right.Val().U.(*Mpint), Maxintval[TINT]) > 0 { + Yyerror("index out of bounds") + } + } + goto ret + + case OINDEXMAP: + if n.Etype == 1 { + goto ret + } + walkexpr(&n.Left, init) + walkexpr(&n.Right, init) + + t := n.Left.Type + p := "" + if t.Type.Width <= 128 { // Check ../../runtime/hashmap.go:maxValueSize before changing. + switch Simsimtype(t.Down) { + case TINT32, TUINT32: + p = "mapaccess1_fast32" + + case TINT64, TUINT64: + p = "mapaccess1_fast64" + + case TSTRING: + p = "mapaccess1_faststr" + } + } + + var key *Node + if p != "" { + // fast versions take key by value + key = n.Right + } else { + // standard version takes key by reference. + // orderexpr made sure key is addressable. + key = Nod(OADDR, n.Right, nil) + + p = "mapaccess1" + } + + n = mkcall1(mapfn(p, t), Ptrto(t.Type), init, typename(t), n.Left, key) + n = Nod(OIND, n, nil) + n.Type = t.Type + n.Typecheck = 1 + + // mapaccess needs a zero value to be at least this big. + if zerosize < t.Type.Width { + zerosize = t.Type.Width + } + goto ret + + case ORECV: + Fatal("walkexpr ORECV") // should see inside OAS only + + case OSLICE, OSLICEARR, OSLICESTR: + walkexpr(&n.Left, init) + walkexpr(&n.Right.Left, init) + if n.Right.Left != nil && iszero(n.Right.Left) { + // Reduce x[0:j] to x[:j]. + n.Right.Left = nil + } + walkexpr(&n.Right.Right, init) + n = reduceSlice(n) + goto ret + + case OSLICE3, OSLICE3ARR: + walkexpr(&n.Left, init) + walkexpr(&n.Right.Left, init) + if n.Right.Left != nil && iszero(n.Right.Left) { + // Reduce x[0:j:k] to x[:j:k]. + n.Right.Left = nil + } + walkexpr(&n.Right.Right.Left, init) + walkexpr(&n.Right.Right.Right, init) + + r := n.Right.Right.Right + if r != nil && r.Op == OCAP && samesafeexpr(n.Left, r.Left) { + // Reduce x[i:j:cap(x)] to x[i:j]. + n.Right.Right = n.Right.Right.Left + if n.Op == OSLICE3 { + n.Op = OSLICE + } else { + n.Op = OSLICEARR + } + n = reduceSlice(n) + goto ret + } + goto ret + + case OADDR: + walkexpr(&n.Left, init) + goto ret + + case ONEW: + if n.Esc == EscNone { + if n.Type.Type.Width >= 1<<16 { + Fatal("large ONEW with EscNone: %v", n) + } + r := temp(n.Type.Type) + r = Nod(OAS, r, nil) // zero temp + typecheck(&r, Etop) + *init = list(*init, r) + r = Nod(OADDR, r.Left, nil) + typecheck(&r, Erv) + n = r + } else { + n = callnew(n.Type.Type) + } + + goto ret + + // If one argument to the comparison is an empty string, + // comparing the lengths instead will yield the same result + // without the function call. + case OCMPSTR: + if (Isconst(n.Left, CTSTR) && len(n.Left.Val().U.(string)) == 0) || (Isconst(n.Right, CTSTR) && len(n.Right.Val().U.(string)) == 0) { + r := Nod(int(n.Etype), Nod(OLEN, n.Left, nil), Nod(OLEN, n.Right, nil)) + typecheck(&r, Erv) + walkexpr(&r, init) + r.Type = n.Type + n = r + goto ret + } + + // s + "badgerbadgerbadger" == "badgerbadgerbadger" + if (n.Etype == OEQ || n.Etype == ONE) && Isconst(n.Right, CTSTR) && n.Left.Op == OADDSTR && count(n.Left.List) == 2 && Isconst(n.Left.List.Next.N, CTSTR) && cmpslit(n.Right, n.Left.List.Next.N) == 0 { + r := Nod(int(n.Etype), Nod(OLEN, n.Left.List.N, nil), Nodintconst(0)) + typecheck(&r, Erv) + walkexpr(&r, init) + r.Type = n.Type + n = r + goto ret + } + + var r *Node + if n.Etype == OEQ || n.Etype == ONE { + // prepare for rewrite below + n.Left = cheapexpr(n.Left, init) + + n.Right = cheapexpr(n.Right, init) + + r = mkcall("eqstring", Types[TBOOL], init, conv(n.Left, Types[TSTRING]), conv(n.Right, Types[TSTRING])) + + // quick check of len before full compare for == or != + // eqstring assumes that the lengths are equal + if n.Etype == OEQ { + // len(left) == len(right) && eqstring(left, right) + r = Nod(OANDAND, Nod(OEQ, Nod(OLEN, n.Left, nil), Nod(OLEN, n.Right, nil)), r) + } else { + // len(left) != len(right) || !eqstring(left, right) + r = Nod(ONOT, r, nil) + + r = Nod(OOROR, Nod(ONE, Nod(OLEN, n.Left, nil), Nod(OLEN, n.Right, nil)), r) + } + + typecheck(&r, Erv) + walkexpr(&r, nil) + } else { + // sys_cmpstring(s1, s2) :: 0 + r = mkcall("cmpstring", Types[TINT], init, conv(n.Left, Types[TSTRING]), conv(n.Right, Types[TSTRING])) + + r = Nod(int(n.Etype), r, Nodintconst(0)) + } + + typecheck(&r, Erv) + if n.Type.Etype != TBOOL { + Fatal("cmp %v", n.Type) + } + r.Type = n.Type + n = r + goto ret + + case OADDSTR: + n = addstr(n, init) + goto ret + + case OAPPEND: + // order should make sure we only see OAS(node, OAPPEND), which we handle above. + Fatal("append outside assignment") + + case OCOPY: + n = copyany(n, init, flag_race) + goto ret + + // cannot use chanfn - closechan takes any, not chan any + case OCLOSE: + fn := syslook("closechan", 1) + + substArgTypes(fn, n.Left.Type) + n = mkcall1(fn, nil, init, n.Left) + goto ret + + case OMAKECHAN: + n = mkcall1(chanfn("makechan", 1, n.Type), n.Type, init, typename(n.Type), conv(n.Left, Types[TINT64])) + goto ret + + case OMAKEMAP: + t := n.Type + + fn := syslook("makemap", 1) + + a := nodnil() // hmap buffer + r := nodnil() // bucket buffer + if n.Esc == EscNone { + // Allocate hmap buffer on stack. + var_ := temp(hmap(t)) + + a = Nod(OAS, var_, nil) // zero temp + typecheck(&a, Etop) + *init = list(*init, a) + a = Nod(OADDR, var_, nil) + + // Allocate one bucket on stack. + // Maximum key/value size is 128 bytes, larger objects + // are stored with an indirection. So max bucket size is 2048+eps. + var_ = temp(mapbucket(t)) + + r = Nod(OAS, var_, nil) // zero temp + typecheck(&r, Etop) + *init = list(*init, r) + r = Nod(OADDR, var_, nil) + } + + substArgTypes(fn, hmap(t), mapbucket(t), t.Down, t.Type) + n = mkcall1(fn, n.Type, init, typename(n.Type), conv(n.Left, Types[TINT64]), a, r) + goto ret + + case OMAKESLICE: + l := n.Left + r := n.Right + if r == nil { + r = safeexpr(l, init) + l = r + } + t := n.Type + if n.Esc == EscNone { + if !isSmallMakeSlice(n) { + Fatal("non-small OMAKESLICE with EscNone: %v", n) + } + // var arr [r]T + // n = arr[:l] + t = aindex(r, t.Type) // [r]T + var_ := temp(t) + a := Nod(OAS, var_, nil) // zero temp + typecheck(&a, Etop) + *init = list(*init, a) + r := Nod(OSLICE, var_, Nod(OKEY, nil, l)) // arr[:l] + r = conv(r, n.Type) // in case n.Type is named. + typecheck(&r, Erv) + walkexpr(&r, init) + n = r + } else { + // makeslice(t *Type, nel int64, max int64) (ary []any) + fn := syslook("makeslice", 1) + + substArgTypes(fn, t.Type) // any-1 + n = mkcall1(fn, n.Type, init, typename(n.Type), conv(l, Types[TINT64]), conv(r, Types[TINT64])) + } + + goto ret + + case ORUNESTR: + a := nodnil() + if n.Esc == EscNone { + t := aindex(Nodintconst(4), Types[TUINT8]) + var_ := temp(t) + a = Nod(OADDR, var_, nil) + } + + // intstring(*[4]byte, rune) + n = mkcall("intstring", n.Type, init, a, conv(n.Left, Types[TINT64])) + + goto ret + + case OARRAYBYTESTR: + a := nodnil() + if n.Esc == EscNone { + // Create temporary buffer for string on stack. + t := aindex(Nodintconst(tmpstringbufsize), Types[TUINT8]) + + a = Nod(OADDR, temp(t), nil) + } + + // slicebytetostring(*[32]byte, []byte) string; + n = mkcall("slicebytetostring", n.Type, init, a, n.Left) + + goto ret + + // slicebytetostringtmp([]byte) string; + case OARRAYBYTESTRTMP: + n = mkcall("slicebytetostringtmp", n.Type, init, n.Left) + + goto ret + + // slicerunetostring(*[32]byte, []rune) string; + case OARRAYRUNESTR: + a := nodnil() + + if n.Esc == EscNone { + // Create temporary buffer for string on stack. + t := aindex(Nodintconst(tmpstringbufsize), Types[TUINT8]) + + a = Nod(OADDR, temp(t), nil) + } + + n = mkcall("slicerunetostring", n.Type, init, a, n.Left) + goto ret + + // stringtoslicebyte(*32[byte], string) []byte; + case OSTRARRAYBYTE: + a := nodnil() + + if n.Esc == EscNone { + // Create temporary buffer for slice on stack. + t := aindex(Nodintconst(tmpstringbufsize), Types[TUINT8]) + + a = Nod(OADDR, temp(t), nil) + } + + n = mkcall("stringtoslicebyte", n.Type, init, a, conv(n.Left, Types[TSTRING])) + goto ret + + // stringtoslicebytetmp(string) []byte; + case OSTRARRAYBYTETMP: + n = mkcall("stringtoslicebytetmp", n.Type, init, conv(n.Left, Types[TSTRING])) + + goto ret + + // stringtoslicerune(*[32]rune, string) []rune + case OSTRARRAYRUNE: + a := nodnil() + + if n.Esc == EscNone { + // Create temporary buffer for slice on stack. + t := aindex(Nodintconst(tmpstringbufsize), Types[TINT32]) + + a = Nod(OADDR, temp(t), nil) + } + + n = mkcall("stringtoslicerune", n.Type, init, a, n.Left) + goto ret + + // ifaceeq(i1 any-1, i2 any-2) (ret bool); + case OCMPIFACE: + if !Eqtype(n.Left.Type, n.Right.Type) { + Fatal("ifaceeq %v %v %v", Oconv(int(n.Op), 0), n.Left.Type, n.Right.Type) + } + var fn *Node + if isnilinter(n.Left.Type) { + fn = syslook("efaceeq", 1) + } else { + fn = syslook("ifaceeq", 1) + } + + n.Right = cheapexpr(n.Right, init) + n.Left = cheapexpr(n.Left, init) + substArgTypes(fn, n.Right.Type, n.Left.Type) + r := mkcall1(fn, n.Type, init, n.Left, n.Right) + if n.Etype == ONE { + r = Nod(ONOT, r, nil) + } + + // check itable/type before full compare. + if n.Etype == OEQ { + r = Nod(OANDAND, Nod(OEQ, Nod(OITAB, n.Left, nil), Nod(OITAB, n.Right, nil)), r) + } else { + r = Nod(OOROR, Nod(ONE, Nod(OITAB, n.Left, nil), Nod(OITAB, n.Right, nil)), r) + } + typecheck(&r, Erv) + walkexpr(&r, init) + r.Type = n.Type + n = r + goto ret + + case OARRAYLIT, OMAPLIT, OSTRUCTLIT, OPTRLIT: + var_ := temp(n.Type) + anylit(0, n, var_, init) + n = var_ + goto ret + + case OSEND: + n1 := n.Right + n1 = assignconv(n1, n.Left.Type.Type, "chan send") + walkexpr(&n1, init) + n1 = Nod(OADDR, n1, nil) + n = mkcall1(chanfn("chansend1", 2, n.Left.Type), nil, init, typename(n.Left.Type), n.Left, n1) + goto ret + + case OCLOSURE: + n = walkclosure(n, init) + goto ret + + case OCALLPART: + n = walkpartialcall(n, init) + goto ret + } + + Fatal("missing switch %v", Oconv(int(n.Op), 0)) + + // Expressions that are constant at run time but not + // considered const by the language spec are not turned into + // constants until walk. For example, if n is y%1 == 0, the + // walk of y%1 may have replaced it by 0. + // Check whether n with its updated args is itself now a constant. +ret: + t := n.Type + + evconst(n) + n.Type = t + if n.Op == OLITERAL { + typecheck(&n, Erv) + } + + ullmancalc(n) + + if Debug['w'] != 0 && n != nil { + Dump("walk", n) + } + + lineno = lno + *np = n +} + +func reduceSlice(n *Node) *Node { + r := n.Right.Right + if r != nil && r.Op == OLEN && samesafeexpr(n.Left, r.Left) { + // Reduce x[i:len(x)] to x[i:]. + n.Right.Right = nil + } + if (n.Op == OSLICE || n.Op == OSLICESTR) && n.Right.Left == nil && n.Right.Right == nil { + // Reduce x[:] to x. + if Debug_slice > 0 { + Warn("slice: omit slice operation") + } + return n.Left + } + return n +} + +func ascompatee1(op int, l *Node, r *Node, init **NodeList) *Node { + // convas will turn map assigns into function calls, + // making it impossible for reorder3 to work. + n := Nod(OAS, l, r) + + if l.Op == OINDEXMAP { + return n + } + + return convas(n, init) +} + +func ascompatee(op int, nl *NodeList, nr *NodeList, init **NodeList) *NodeList { + /* + * check assign expression list to + * a expression list. called in + * expr-list = expr-list + */ + + // ensure order of evaluation for function calls + for ll := nl; ll != nil; ll = ll.Next { + ll.N = safeexpr(ll.N, init) + } + for lr := nr; lr != nil; lr = lr.Next { + lr.N = safeexpr(lr.N, init) + } + + var nn *NodeList + ll := nl + lr := nr + for ; ll != nil && lr != nil; ll, lr = ll.Next, lr.Next { + // Do not generate 'x = x' during return. See issue 4014. + if op == ORETURN && ll.N == lr.N { + continue + } + nn = list(nn, ascompatee1(op, ll.N, lr.N, init)) + } + + // cannot happen: caller checked that lists had same length + if ll != nil || lr != nil { + Yyerror("error in shape across %v %v %v / %d %d [%s]", Hconv(nl, obj.FmtSign), Oconv(int(op), 0), Hconv(nr, obj.FmtSign), count(nl), count(nr), Curfn.Func.Nname.Sym.Name) + } + return nn +} + +/* + * l is an lv and rt is the type of an rv + * return 1 if this implies a function call + * evaluating the lv or a function call + * in the conversion of the types + */ +func fncall(l *Node, rt *Type) bool { + if l.Ullman >= UINF || l.Op == OINDEXMAP { + return true + } + var r Node + if needwritebarrier(l, &r) { + return true + } + if Eqtype(l.Type, rt) { + return false + } + return true +} + +func ascompatet(op int, nl *NodeList, nr **Type, fp int, init **NodeList) *NodeList { + var l *Node + var tmp *Node + var a *Node + var ll *NodeList + var saver Iter + + /* + * check assign type list to + * a expression list. called in + * expr-list = func() + */ + r := Structfirst(&saver, nr) + + var nn *NodeList + var mm *NodeList + ucount := 0 + for ll = nl; ll != nil; ll = ll.Next { + if r == nil { + break + } + l = ll.N + if isblank(l) { + r = structnext(&saver) + continue + } + + // any lv that causes a fn call must be + // deferred until all the return arguments + // have been pulled from the output arguments + if fncall(l, r.Type) { + tmp = temp(r.Type) + typecheck(&tmp, Erv) + a = Nod(OAS, l, tmp) + a = convas(a, init) + mm = list(mm, a) + l = tmp + } + + a = Nod(OAS, l, nodarg(r, fp)) + a = convas(a, init) + ullmancalc(a) + if a.Ullman >= UINF { + Dump("ascompatet ucount", a) + ucount++ + } + + nn = list(nn, a) + r = structnext(&saver) + } + + if ll != nil || r != nil { + Yyerror("ascompatet: assignment count mismatch: %d = %d", count(nl), structcount(*nr)) + } + + if ucount != 0 { + Fatal("ascompatet: too many function calls evaluating parameters") + } + return concat(nn, mm) +} + +/* +* package all the arguments that match a ... T parameter into a []T. + */ +func mkdotargslice(lr0 *NodeList, nn *NodeList, l *Type, fp int, init **NodeList, ddd *Node) *NodeList { + esc := uint16(EscUnknown) + if ddd != nil { + esc = ddd.Esc + } + + tslice := typ(TARRAY) + tslice.Type = l.Type.Type + tslice.Bound = -1 + + var n *Node + if count(lr0) == 0 { + n = nodnil() + n.Type = tslice + } else { + n = Nod(OCOMPLIT, nil, typenod(tslice)) + if ddd != nil && prealloc[ddd] != nil { + prealloc[n] = prealloc[ddd] // temporary to use + } + n.List = lr0 + n.Esc = esc + typecheck(&n, Erv) + if n.Type == nil { + Fatal("mkdotargslice: typecheck failed") + } + walkexpr(&n, init) + } + + a := Nod(OAS, nodarg(l, fp), n) + nn = list(nn, convas(a, init)) + return nn +} + +/* + * helpers for shape errors + */ +func dumptypes(nl **Type, what string) string { + var savel Iter + + fmt_ := "" + fmt_ += "\t" + first := 1 + for l := Structfirst(&savel, nl); l != nil; l = structnext(&savel) { + if first != 0 { + first = 0 + } else { + fmt_ += ", " + } + fmt_ += Tconv(l, 0) + } + + if first != 0 { + fmt_ += fmt.Sprintf("[no arguments %s]", what) + } + return fmt_ +} + +func dumpnodetypes(l *NodeList, what string) string { + var r *Node + + fmt_ := "" + fmt_ += "\t" + first := 1 + for ; l != nil; l = l.Next { + r = l.N + if first != 0 { + first = 0 + } else { + fmt_ += ", " + } + fmt_ += Tconv(r.Type, 0) + } + + if first != 0 { + fmt_ += fmt.Sprintf("[no arguments %s]", what) + } + return fmt_ +} + +/* + * check assign expression list to + * a type list. called in + * return expr-list + * func(expr-list) + */ +func ascompatte(op int, call *Node, isddd bool, nl **Type, lr *NodeList, fp int, init **NodeList) *NodeList { + var savel Iter + + lr0 := lr + l := Structfirst(&savel, nl) + var r *Node + if lr != nil { + r = lr.N + } + var nn *NodeList + + // f(g()) where g has multiple return values + var a *Node + var l2 string + var ll *Type + var l1 string + if r != nil && lr.Next == nil && r.Type.Etype == TSTRUCT && r.Type.Funarg != 0 { + // optimization - can do block copy + if eqtypenoname(r.Type, *nl) { + a := nodarg(*nl, fp) + r = Nod(OCONVNOP, r, nil) + r.Type = a.Type + nn = list1(convas(Nod(OAS, a, r), init)) + goto ret + } + + // conversions involved. + // copy into temporaries. + var alist *NodeList + + for l := Structfirst(&savel, &r.Type); l != nil; l = structnext(&savel) { + a = temp(l.Type) + alist = list(alist, a) + } + + a = Nod(OAS2, nil, nil) + a.List = alist + a.Rlist = lr + typecheck(&a, Etop) + walkstmt(&a) + *init = list(*init, a) + lr = alist + r = lr.N + l = Structfirst(&savel, nl) + } + +loop: + if l != nil && l.Isddd { + // the ddd parameter must be last + ll = structnext(&savel) + + if ll != nil { + Yyerror("... must be last argument") + } + + // special case -- + // only if we are assigning a single ddd + // argument to a ddd parameter then it is + // passed thru unencapsulated + if r != nil && lr.Next == nil && isddd && Eqtype(l.Type, r.Type) { + a = Nod(OAS, nodarg(l, fp), r) + a = convas(a, init) + nn = list(nn, a) + goto ret + } + + // normal case -- make a slice of all + // remaining arguments and pass it to + // the ddd parameter. + nn = mkdotargslice(lr, nn, l, fp, init, call.Right) + + goto ret + } + + if l == nil || r == nil { + if l != nil || r != nil { + l1 = dumptypes(nl, "expected") + l2 = dumpnodetypes(lr0, "given") + if l != nil { + Yyerror("not enough arguments to %v\n%s\n%s", Oconv(int(op), 0), l1, l2) + } else { + Yyerror("too many arguments to %v\n%s\n%s", Oconv(int(op), 0), l1, l2) + } + } + + goto ret + } + + a = Nod(OAS, nodarg(l, fp), r) + a = convas(a, init) + nn = list(nn, a) + + l = structnext(&savel) + r = nil + lr = lr.Next + if lr != nil { + r = lr.N + } + goto loop + +ret: + for lr = nn; lr != nil; lr = lr.Next { + lr.N.Typecheck = 1 + } + return nn +} + +// generate code for print +func walkprint(nn *Node, init **NodeList) *Node { + var r *Node + var n *Node + var on *Node + var t *Type + var et int + + op := int(nn.Op) + all := nn.List + var calls *NodeList + notfirst := false + + // Hoist all the argument evaluation up before the lock. + walkexprlistcheap(all, init) + + calls = list(calls, mkcall("printlock", nil, init)) + + for l := all; l != nil; l = l.Next { + if notfirst { + calls = list(calls, mkcall("printsp", nil, init)) + } + + notfirst = op == OPRINTN + + n = l.N + if n.Op == OLITERAL { + switch n.Val().Ctype() { + case CTRUNE: + defaultlit(&n, runetype) + + case CTINT: + defaultlit(&n, Types[TINT64]) + + case CTFLT: + defaultlit(&n, Types[TFLOAT64]) + } + } + + if n.Op != OLITERAL && n.Type != nil && n.Type.Etype == TIDEAL { + defaultlit(&n, Types[TINT64]) + } + defaultlit(&n, nil) + l.N = n + if n.Type == nil || n.Type.Etype == TFORW { + continue + } + + t = n.Type + et = int(n.Type.Etype) + if Isinter(n.Type) { + if isnilinter(n.Type) { + on = syslook("printeface", 1) + } else { + on = syslook("printiface", 1) + } + substArgTypes(on, n.Type) // any-1 + } else if Isptr[et] || et == TCHAN || et == TMAP || et == TFUNC || et == TUNSAFEPTR { + on = syslook("printpointer", 1) + substArgTypes(on, n.Type) // any-1 + } else if Isslice(n.Type) { + on = syslook("printslice", 1) + substArgTypes(on, n.Type) // any-1 + } else if Isint[et] { + if et == TUINT64 { + if (t.Sym.Pkg == Runtimepkg || compiling_runtime != 0) && t.Sym.Name == "hex" { + on = syslook("printhex", 0) + } else { + on = syslook("printuint", 0) + } + } else { + on = syslook("printint", 0) + } + } else if Isfloat[et] { + on = syslook("printfloat", 0) + } else if Iscomplex[et] { + on = syslook("printcomplex", 0) + } else if et == TBOOL { + on = syslook("printbool", 0) + } else if et == TSTRING { + on = syslook("printstring", 0) + } else { + badtype(OPRINT, n.Type, nil) + continue + } + + t = *getinarg(on.Type) + if t != nil { + t = t.Type + } + if t != nil { + t = t.Type + } + + if !Eqtype(t, n.Type) { + n = Nod(OCONV, n, nil) + n.Type = t + } + + r = Nod(OCALL, on, nil) + r.List = list1(n) + calls = list(calls, r) + } + + if op == OPRINTN { + calls = list(calls, mkcall("printnl", nil, nil)) + } + + calls = list(calls, mkcall("printunlock", nil, init)) + + typechecklist(calls, Etop) + walkexprlist(calls, init) + + r = Nod(OEMPTY, nil, nil) + typecheck(&r, Etop) + walkexpr(&r, init) + r.Ninit = calls + return r +} + +func callnew(t *Type) *Node { + dowidth(t) + fn := syslook("newobject", 1) + substArgTypes(fn, t) + return mkcall1(fn, Ptrto(t), nil, typename(t)) +} + +func iscallret(n *Node) bool { + n = outervalue(n) + return n.Op == OINDREG && n.Reg == int16(Thearch.REGSP) +} + +func isstack(n *Node) bool { + n = outervalue(n) + + // If n is *autotmp and autotmp = &foo, replace n with foo. + // We introduce such temps when initializing struct literals. + if n.Op == OIND && n.Left.Op == ONAME && strings.HasPrefix(n.Left.Sym.Name, "autotmp_") { + defn := n.Left.Name.Defn + if defn != nil && defn.Op == OAS && defn.Right.Op == OADDR { + n = defn.Right.Left + } + } + + switch n.Op { + case OINDREG: + return n.Reg == int16(Thearch.REGSP) + + case ONAME: + switch n.Class { + case PAUTO, PPARAM, PPARAMOUT: + return true + } + } + + return false +} + +func isglobal(n *Node) bool { + n = outervalue(n) + + switch n.Op { + case ONAME: + switch n.Class { + case PEXTERN: + return true + } + } + + return false +} + +// Do we need a write barrier for the assignment l = r? +func needwritebarrier(l *Node, r *Node) bool { + if use_writebarrier == 0 { + return false + } + + if l == nil || isblank(l) { + return false + } + + // No write barrier for write of non-pointers. + dowidth(l.Type) + + if !haspointers(l.Type) { + return false + } + + // No write barrier for write to stack. + if isstack(l) { + return false + } + + // No write barrier for implicit zeroing. + if r == nil { + return false + } + + // Ignore no-op conversions when making decision. + // Ensures that xp = unsafe.Pointer(&x) is treated + // the same as xp = &x. + for r.Op == OCONVNOP { + r = r.Left + } + + // No write barrier for zeroing or initialization to constant. + if iszero(r) || r.Op == OLITERAL { + return false + } + + // No write barrier for storing static (read-only) data. + if r.Op == ONAME && strings.HasPrefix(r.Sym.Name, "statictmp_") { + return false + } + + // No write barrier for storing address of stack values, + // which are guaranteed only to be written to the stack. + if r.Op == OADDR && isstack(r.Left) { + return false + } + + // No write barrier for storing address of global, which + // is live no matter what. + if r.Op == OADDR && isglobal(r.Left) { + return false + } + + // Otherwise, be conservative and use write barrier. + return true +} + +// TODO(rsc): Perhaps componentgen should run before this. + +var applywritebarrier_bv Bvec + +func applywritebarrier(n *Node, init **NodeList) *Node { + if n.Left != nil && n.Right != nil && needwritebarrier(n.Left, n.Right) { + if Debug_wb > 1 { + Warnl(int(n.Lineno), "marking %v for barrier", Nconv(n.Left, 0)) + } + n.Op = OASWB + return n + } + return n +} + +func convas(n *Node, init **NodeList) *Node { + if n.Op != OAS { + Fatal("convas: not OAS %v", Oconv(int(n.Op), 0)) + } + + n.Typecheck = 1 + + var lt *Type + var rt *Type + if n.Left == nil || n.Right == nil { + goto out + } + + lt = n.Left.Type + rt = n.Right.Type + if lt == nil || rt == nil { + goto out + } + + if isblank(n.Left) { + defaultlit(&n.Right, nil) + goto out + } + + if n.Left.Op == OINDEXMAP { + map_ := n.Left.Left + key := n.Left.Right + val := n.Right + walkexpr(&map_, init) + walkexpr(&key, init) + walkexpr(&val, init) + + // orderexpr made sure key and val are addressable. + key = Nod(OADDR, key, nil) + + val = Nod(OADDR, val, nil) + n = mkcall1(mapfn("mapassign1", map_.Type), nil, init, typename(map_.Type), map_, key, val) + goto out + } + + if !Eqtype(lt, rt) { + n.Right = assignconv(n.Right, lt, "assignment") + walkexpr(&n.Right, init) + } + +out: + ullmancalc(n) + return n +} + +/* + * from ascompat[te] + * evaluating actual function arguments. + * f(a,b) + * if there is exactly one function expr, + * then it is done first. otherwise must + * make temp variables + */ +func reorder1(all *NodeList) *NodeList { + var n *Node + + c := 0 // function calls + t := 0 // total parameters + + for l := all; l != nil; l = l.Next { + n = l.N + t++ + ullmancalc(n) + if n.Ullman >= UINF { + c++ + } + } + + if c == 0 || t == 1 { + return all + } + + var g *NodeList // fncalls assigned to tempnames + var f *Node // last fncall assigned to stack + var r *NodeList // non fncalls and tempnames assigned to stack + d := 0 + var a *Node + for l := all; l != nil; l = l.Next { + n = l.N + if n.Ullman < UINF { + r = list(r, n) + continue + } + + d++ + if d == c { + f = n + continue + } + + // make assignment of fncall to tempname + a = temp(n.Right.Type) + + a = Nod(OAS, a, n.Right) + g = list(g, a) + + // put normal arg assignment on list + // with fncall replaced by tempname + n.Right = a.Left + + r = list(r, n) + } + + if f != nil { + g = list(g, f) + } + return concat(g, r) +} + +/* + * from ascompat[ee] + * a,b = c,d + * simultaneous assignment. there cannot + * be later use of an earlier lvalue. + * + * function calls have been removed. + */ +func reorder3(all *NodeList) *NodeList { + var l *Node + + // If a needed expression may be affected by an + // earlier assignment, make an early copy of that + // expression and use the copy instead. + var early *NodeList + + var mapinit *NodeList + for list := all; list != nil; list = list.Next { + l = list.N.Left + + // Save subexpressions needed on left side. + // Drill through non-dereferences. + for { + if l.Op == ODOT || l.Op == OPAREN { + l = l.Left + continue + } + + if l.Op == OINDEX && Isfixedarray(l.Left.Type) { + reorder3save(&l.Right, all, list, &early) + l = l.Left + continue + } + + break + } + + switch l.Op { + default: + Fatal("reorder3 unexpected lvalue %v", Oconv(int(l.Op), obj.FmtSharp)) + + case ONAME: + break + + case OINDEX, OINDEXMAP: + reorder3save(&l.Left, all, list, &early) + reorder3save(&l.Right, all, list, &early) + if l.Op == OINDEXMAP { + list.N = convas(list.N, &mapinit) + } + + case OIND, ODOTPTR: + reorder3save(&l.Left, all, list, &early) + } + + // Save expression on right side. + reorder3save(&list.N.Right, all, list, &early) + } + + early = concat(mapinit, early) + return concat(early, all) +} + +/* + * if the evaluation of *np would be affected by the + * assignments in all up to but not including stop, + * copy into a temporary during *early and + * replace *np with that temp. + */ +func reorder3save(np **Node, all *NodeList, stop *NodeList, early **NodeList) { + n := *np + if !aliased(n, all, stop) { + return + } + + q := temp(n.Type) + q = Nod(OAS, q, n) + typecheck(&q, Etop) + *early = list(*early, q) + *np = q.Left +} + +/* + * what's the outer value that a write to n affects? + * outer value means containing struct or array. + */ +func outervalue(n *Node) *Node { + for { + if n.Op == OXDOT { + Fatal("OXDOT in walk") + } + if n.Op == ODOT || n.Op == OPAREN || n.Op == OCONVNOP { + n = n.Left + continue + } + + if n.Op == OINDEX && Isfixedarray(n.Left.Type) { + n = n.Left + continue + } + + break + } + + return n +} + +/* + * Is it possible that the computation of n might be + * affected by writes in as up to but not including stop? + */ +func aliased(n *Node, all *NodeList, stop *NodeList) bool { + if n == nil { + return false + } + + // Look for obvious aliasing: a variable being assigned + // during the all list and appearing in n. + // Also record whether there are any writes to main memory. + // Also record whether there are any writes to variables + // whose addresses have been taken. + memwrite := 0 + + varwrite := 0 + var a *Node + for l := all; l != stop; l = l.Next { + a = outervalue(l.N.Left) + if a.Op != ONAME { + memwrite = 1 + continue + } + + switch n.Class { + default: + varwrite = 1 + continue + + case PAUTO, PPARAM, PPARAMOUT: + if n.Addrtaken { + varwrite = 1 + continue + } + + if vmatch2(a, n) { + // Direct hit. + return true + } + } + } + + // The variables being written do not appear in n. + // However, n might refer to computed addresses + // that are being written. + + // If no computed addresses are affected by the writes, no aliasing. + if memwrite == 0 && varwrite == 0 { + return false + } + + // If n does not refer to computed addresses + // (that is, if n only refers to variables whose addresses + // have not been taken), no aliasing. + if varexpr(n) { + return false + } + + // Otherwise, both the writes and n refer to computed memory addresses. + // Assume that they might conflict. + return true +} + +/* + * does the evaluation of n only refer to variables + * whose addresses have not been taken? + * (and no other memory) + */ +func varexpr(n *Node) bool { + if n == nil { + return true + } + + switch n.Op { + case OLITERAL: + return true + + case ONAME: + switch n.Class { + case PAUTO, PPARAM, PPARAMOUT: + if !n.Addrtaken { + return true + } + } + + return false + + case OADD, + OSUB, + OOR, + OXOR, + OMUL, + ODIV, + OMOD, + OLSH, + ORSH, + OAND, + OANDNOT, + OPLUS, + OMINUS, + OCOM, + OPAREN, + OANDAND, + OOROR, + ODOT, // but not ODOTPTR + OCONV, + OCONVNOP, + OCONVIFACE, + ODOTTYPE: + return varexpr(n.Left) && varexpr(n.Right) + } + + // Be conservative. + return false +} + +/* + * is the name l mentioned in r? + */ +func vmatch2(l *Node, r *Node) bool { + if r == nil { + return false + } + switch r.Op { + // match each right given left + case ONAME: + return l == r + + case OLITERAL: + return false + } + + if vmatch2(l, r.Left) { + return true + } + if vmatch2(l, r.Right) { + return true + } + for ll := r.List; ll != nil; ll = ll.Next { + if vmatch2(l, ll.N) { + return true + } + } + return false +} + +/* + * is any name mentioned in l also mentioned in r? + * called by sinit.go + */ +func vmatch1(l *Node, r *Node) bool { + /* + * isolate all left sides + */ + if l == nil || r == nil { + return false + } + switch l.Op { + case ONAME: + switch l.Class { + case PPARAM, PPARAMREF, PAUTO: + break + + // assignment to non-stack variable + // must be delayed if right has function calls. + default: + if r.Ullman >= UINF { + return true + } + } + + return vmatch2(l, r) + + case OLITERAL: + return false + } + + if vmatch1(l.Left, r) { + return true + } + if vmatch1(l.Right, r) { + return true + } + for ll := l.List; ll != nil; ll = ll.Next { + if vmatch1(ll.N, r) { + return true + } + } + return false +} + +/* + * walk through argin parameters. + * generate and return code to allocate + * copies of escaped parameters to the heap. + */ +func paramstoheap(argin **Type, out int) *NodeList { + var savet Iter + var v *Node + var as *Node + + var nn *NodeList + for t := Structfirst(&savet, argin); t != nil; t = structnext(&savet) { + v = t.Nname + if v != nil && v.Sym != nil && v.Sym.Name[0] == '~' && v.Sym.Name[1] == 'r' { // unnamed result + v = nil + } + + // For precise stacks, the garbage collector assumes results + // are always live, so zero them always. + if out != 0 { + // Defer might stop a panic and show the + // return values as they exist at the time of panic. + // Make sure to zero them on entry to the function. + nn = list(nn, Nod(OAS, nodarg(t, 1), nil)) + } + + if v == nil || v.Class&PHEAP == 0 { + continue + } + + // generate allocation & copying code + if compiling_runtime != 0 { + Yyerror("%v escapes to heap, not allowed in runtime.", v) + } + if prealloc[v] == nil { + prealloc[v] = callnew(v.Type) + } + nn = list(nn, Nod(OAS, v.Name.Heapaddr, prealloc[v])) + if v.Class&^PHEAP != PPARAMOUT { + as = Nod(OAS, v, v.Name.Param.Stackparam) + v.Name.Param.Stackparam.Typecheck = 1 + typecheck(&as, Etop) + as = applywritebarrier(as, &nn) + nn = list(nn, as) + } + } + + return nn +} + +/* + * walk through argout parameters copying back to stack + */ +func returnsfromheap(argin **Type) *NodeList { + var savet Iter + var v *Node + + var nn *NodeList + for t := Structfirst(&savet, argin); t != nil; t = structnext(&savet) { + v = t.Nname + if v == nil || v.Class != PHEAP|PPARAMOUT { + continue + } + nn = list(nn, Nod(OAS, v.Name.Param.Stackparam, v)) + } + + return nn +} + +/* + * take care of migrating any function in/out args + * between the stack and the heap. adds code to + * curfn's before and after lists. + */ +func heapmoves() { + lno := lineno + lineno = Curfn.Lineno + nn := paramstoheap(getthis(Curfn.Type), 0) + nn = concat(nn, paramstoheap(getinarg(Curfn.Type), 0)) + nn = concat(nn, paramstoheap(Getoutarg(Curfn.Type), 1)) + Curfn.Func.Enter = concat(Curfn.Func.Enter, nn) + lineno = Curfn.Func.Endlineno + Curfn.Func.Exit = returnsfromheap(Getoutarg(Curfn.Type)) + lineno = lno +} + +func vmkcall(fn *Node, t *Type, init **NodeList, va []*Node) *Node { + if fn.Type == nil || fn.Type.Etype != TFUNC { + Fatal("mkcall %v %v", fn, fn.Type) + } + + var args *NodeList + n := fn.Type.Intuple + for i := 0; i < n; i++ { + args = list(args, va[i]) + } + + r := Nod(OCALL, fn, nil) + r.List = args + if fn.Type.Outtuple > 0 { + typecheck(&r, Erv|Efnstruct) + } else { + typecheck(&r, Etop) + } + walkexpr(&r, init) + r.Type = t + return r +} + +func mkcall(name string, t *Type, init **NodeList, args ...*Node) *Node { + return vmkcall(syslook(name, 0), t, init, args) +} + +func mkcall1(fn *Node, t *Type, init **NodeList, args ...*Node) *Node { + return vmkcall(fn, t, init, args) +} + +func conv(n *Node, t *Type) *Node { + if Eqtype(n.Type, t) { + return n + } + n = Nod(OCONV, n, nil) + n.Type = t + typecheck(&n, Erv) + return n +} + +func chanfn(name string, n int, t *Type) *Node { + if t.Etype != TCHAN { + Fatal("chanfn %v", t) + } + fn := syslook(name, 1) + switch n { + default: + Fatal("chanfn %d", n) + case 1: + substArgTypes(fn, t.Type) + case 2: + substArgTypes(fn, t.Type, t.Type) + } + return fn +} + +func mapfn(name string, t *Type) *Node { + if t.Etype != TMAP { + Fatal("mapfn %v", t) + } + fn := syslook(name, 1) + substArgTypes(fn, t.Down, t.Type, t.Down, t.Type) + return fn +} + +func mapfndel(name string, t *Type) *Node { + if t.Etype != TMAP { + Fatal("mapfn %v", t) + } + fn := syslook(name, 1) + substArgTypes(fn, t.Down, t.Type, t.Down) + return fn +} + +func writebarrierfn(name string, l *Type, r *Type) *Node { + fn := syslook(name, 1) + substArgTypes(fn, l, r) + return fn +} + +func addstr(n *Node, init **NodeList) *Node { + // orderexpr rewrote OADDSTR to have a list of strings. + c := count(n.List) + + if c < 2 { + Yyerror("addstr count %d too small", c) + } + + buf := nodnil() + if n.Esc == EscNone { + sz := int64(0) + for l := n.List; l != nil; l = l.Next { + if n.Op == OLITERAL { + sz += int64(len(n.Val().U.(string))) + } + } + + // Don't allocate the buffer if the result won't fit. + if sz < tmpstringbufsize { + // Create temporary buffer for result string on stack. + t := aindex(Nodintconst(tmpstringbufsize), Types[TUINT8]) + + buf = Nod(OADDR, temp(t), nil) + } + } + + // build list of string arguments + args := list1(buf) + + for l := n.List; l != nil; l = l.Next { + args = list(args, conv(l.N, Types[TSTRING])) + } + + var fn string + if c <= 5 { + // small numbers of strings use direct runtime helpers. + // note: orderexpr knows this cutoff too. + fn = fmt.Sprintf("concatstring%d", c) + } else { + // large numbers of strings are passed to the runtime as a slice. + fn = "concatstrings" + + t := typ(TARRAY) + t.Type = Types[TSTRING] + t.Bound = -1 + slice := Nod(OCOMPLIT, nil, typenod(t)) + if prealloc[n] != nil { + prealloc[slice] = prealloc[n] + } + slice.List = args.Next // skip buf arg + args = list1(buf) + args = list(args, slice) + slice.Esc = EscNone + } + + cat := syslook(fn, 1) + r := Nod(OCALL, cat, nil) + r.List = args + typecheck(&r, Erv) + walkexpr(&r, init) + r.Type = n.Type + + return r +} + +// expand append(l1, l2...) to +// init { +// s := l1 +// if n := len(l1) + len(l2) - cap(s); n > 0 { +// s = growslice_n(s, n) +// } +// s = s[:len(l1)+len(l2)] +// memmove(&s[len(l1)], &l2[0], len(l2)*sizeof(T)) +// } +// s +// +// l2 is allowed to be a string. +func appendslice(n *Node, init **NodeList) *Node { + walkexprlistsafe(n.List, init) + + // walkexprlistsafe will leave OINDEX (s[n]) alone if both s + // and n are name or literal, but those may index the slice we're + // modifying here. Fix explicitly. + for l := n.List; l != nil; l = l.Next { + l.N = cheapexpr(l.N, init) + } + + l1 := n.List.N + l2 := n.List.Next.N + + s := temp(l1.Type) // var s []T + var l *NodeList + l = list(l, Nod(OAS, s, l1)) // s = l1 + + nt := temp(Types[TINT]) + + nif := Nod(OIF, nil, nil) + + // n := len(s) + len(l2) - cap(s) + nif.Ninit = list1(Nod(OAS, nt, Nod(OSUB, Nod(OADD, Nod(OLEN, s, nil), Nod(OLEN, l2, nil)), Nod(OCAP, s, nil)))) + + nif.Left = Nod(OGT, nt, Nodintconst(0)) + + // instantiate growslice_n(Type*, []any, int) []any + fn := syslook("growslice_n", 1) // growslice_n(, old []T, n int64) (ret []T) + substArgTypes(fn, s.Type.Type, s.Type.Type) + + // s = growslice_n(T, s, n) + nif.Nbody = list1(Nod(OAS, s, mkcall1(fn, s.Type, &nif.Ninit, typename(s.Type), s, nt))) + + l = list(l, nif) + + if haspointers(l1.Type.Type) { + // copy(s[len(l1):len(l1)+len(l2)], l2) + nptr1 := Nod(OSLICE, s, Nod(OKEY, Nod(OLEN, l1, nil), Nod(OADD, Nod(OLEN, l1, nil), Nod(OLEN, l2, nil)))) + + nptr1.Etype = 1 + nptr2 := l2 + fn := syslook("typedslicecopy", 1) + substArgTypes(fn, l1.Type, l2.Type) + nt := mkcall1(fn, Types[TINT], &l, typename(l1.Type.Type), nptr1, nptr2) + l = list(l, nt) + } else if flag_race != 0 { + // rely on runtime to instrument copy. + // copy(s[len(l1):len(l1)+len(l2)], l2) + nptr1 := Nod(OSLICE, s, Nod(OKEY, Nod(OLEN, l1, nil), Nod(OADD, Nod(OLEN, l1, nil), Nod(OLEN, l2, nil)))) + + nptr1.Etype = 1 + nptr2 := l2 + var fn *Node + if l2.Type.Etype == TSTRING { + fn = syslook("slicestringcopy", 1) + } else { + fn = syslook("slicecopy", 1) + } + substArgTypes(fn, l1.Type, l2.Type) + nt := mkcall1(fn, Types[TINT], &l, nptr1, nptr2, Nodintconst(s.Type.Type.Width)) + l = list(l, nt) + } else { + // memmove(&s[len(l1)], &l2[0], len(l2)*sizeof(T)) + nptr1 := Nod(OINDEX, s, Nod(OLEN, l1, nil)) + + nptr1.Bounded = true + nptr1 = Nod(OADDR, nptr1, nil) + + nptr2 := Nod(OSPTR, l2, nil) + + fn := syslook("memmove", 1) + substArgTypes(fn, s.Type.Type, s.Type.Type) + + nwid := cheapexpr(conv(Nod(OLEN, l2, nil), Types[TUINTPTR]), &l) + + nwid = Nod(OMUL, nwid, Nodintconst(s.Type.Type.Width)) + nt := mkcall1(fn, nil, &l, nptr1, nptr2, nwid) + l = list(l, nt) + } + + // s = s[:len(l1)+len(l2)] + nt = Nod(OADD, Nod(OLEN, l1, nil), Nod(OLEN, l2, nil)) + + nt = Nod(OSLICE, s, Nod(OKEY, nil, nt)) + nt.Etype = 1 + l = list(l, Nod(OAS, s, nt)) + + typechecklist(l, Etop) + walkstmtlist(l) + *init = concat(*init, l) + return s +} + +// Rewrite append(src, x, y, z) so that any side effects in +// x, y, z (including runtime panics) are evaluated in +// initialization statements before the append. +// For normal code generation, stop there and leave the +// rest to cgen_append. +// +// For race detector, expand append(src, a [, b]* ) to +// +// init { +// s := src +// const argc = len(args) - 1 +// if cap(s) - len(s) < argc { +// s = growslice(s, len(s)+argc) +// } +// n := len(s) +// s = s[:n+argc] +// s[n] = a +// s[n+1] = b +// ... +// } +// s +func walkappend(n *Node, init **NodeList, dst *Node) *Node { + if !samesafeexpr(dst, n.List.N) { + l := n.List + l.N = safeexpr(l.N, init) + walkexpr(&l.N, init) + } + walkexprlistsafe(n.List.Next, init) + + // walkexprlistsafe will leave OINDEX (s[n]) alone if both s + // and n are name or literal, but those may index the slice we're + // modifying here. Fix explicitly. + // Using cheapexpr also makes sure that the evaluation + // of all arguments (and especially any panics) happen + // before we begin to modify the slice in a visible way. + for l := n.List.Next; l != nil; l = l.Next { + l.N = cheapexpr(l.N, init) + } + + nsrc := n.List.N + + // Resolve slice type of multi-valued return. + if Istype(nsrc.Type, TSTRUCT) { + nsrc.Type = nsrc.Type.Type.Type + } + argc := count(n.List) - 1 + if argc < 1 { + return nsrc + } + + // General case, with no function calls left as arguments. + // Leave for gen, except that race detector requires old form + if flag_race == 0 { + return n + } + + var l *NodeList + + ns := temp(nsrc.Type) + l = list(l, Nod(OAS, ns, nsrc)) // s = src + + na := Nodintconst(int64(argc)) // const argc + nx := Nod(OIF, nil, nil) // if cap(s) - len(s) < argc + nx.Left = Nod(OLT, Nod(OSUB, Nod(OCAP, ns, nil), Nod(OLEN, ns, nil)), na) + + fn := syslook("growslice", 1) // growslice(, old []T, mincap int) (ret []T) + substArgTypes(fn, ns.Type.Type, ns.Type.Type) + + nx.Nbody = list1(Nod(OAS, ns, mkcall1(fn, ns.Type, &nx.Ninit, typename(ns.Type), ns, Nod(OADD, Nod(OLEN, ns, nil), na)))) + + l = list(l, nx) + + nn := temp(Types[TINT]) + l = list(l, Nod(OAS, nn, Nod(OLEN, ns, nil))) // n = len(s) + + nx = Nod(OSLICE, ns, Nod(OKEY, nil, Nod(OADD, nn, na))) // ...s[:n+argc] + nx.Etype = 1 + l = list(l, Nod(OAS, ns, nx)) // s = s[:n+argc] + + for a := n.List.Next; a != nil; a = a.Next { + nx = Nod(OINDEX, ns, nn) // s[n] ... + nx.Bounded = true + l = list(l, Nod(OAS, nx, a.N)) // s[n] = arg + if a.Next != nil { + l = list(l, Nod(OAS, nn, Nod(OADD, nn, Nodintconst(1)))) // n = n + 1 + } + } + + typechecklist(l, Etop) + walkstmtlist(l) + *init = concat(*init, l) + return ns +} + +// Lower copy(a, b) to a memmove call or a runtime call. +// +// init { +// n := len(a) +// if n > len(b) { n = len(b) } +// memmove(a.ptr, b.ptr, n*sizeof(elem(a))) +// } +// n; +// +// Also works if b is a string. +// +func copyany(n *Node, init **NodeList, runtimecall int) *Node { + if haspointers(n.Left.Type.Type) { + fn := writebarrierfn("typedslicecopy", n.Left.Type, n.Right.Type) + return mkcall1(fn, n.Type, init, typename(n.Left.Type.Type), n.Left, n.Right) + } + + if runtimecall != 0 { + var fn *Node + if n.Right.Type.Etype == TSTRING { + fn = syslook("slicestringcopy", 1) + } else { + fn = syslook("slicecopy", 1) + } + substArgTypes(fn, n.Left.Type, n.Right.Type) + return mkcall1(fn, n.Type, init, n.Left, n.Right, Nodintconst(n.Left.Type.Type.Width)) + } + + walkexpr(&n.Left, init) + walkexpr(&n.Right, init) + nl := temp(n.Left.Type) + nr := temp(n.Right.Type) + var l *NodeList + l = list(l, Nod(OAS, nl, n.Left)) + l = list(l, Nod(OAS, nr, n.Right)) + + nfrm := Nod(OSPTR, nr, nil) + nto := Nod(OSPTR, nl, nil) + + nlen := temp(Types[TINT]) + + // n = len(to) + l = list(l, Nod(OAS, nlen, Nod(OLEN, nl, nil))) + + // if n > len(frm) { n = len(frm) } + nif := Nod(OIF, nil, nil) + + nif.Left = Nod(OGT, nlen, Nod(OLEN, nr, nil)) + nif.Nbody = list(nif.Nbody, Nod(OAS, nlen, Nod(OLEN, nr, nil))) + l = list(l, nif) + + // Call memmove. + fn := syslook("memmove", 1) + + substArgTypes(fn, nl.Type.Type, nl.Type.Type) + nwid := temp(Types[TUINTPTR]) + l = list(l, Nod(OAS, nwid, conv(nlen, Types[TUINTPTR]))) + nwid = Nod(OMUL, nwid, Nodintconst(nl.Type.Type.Width)) + l = list(l, mkcall1(fn, nil, init, nto, nfrm, nwid)) + + typechecklist(l, Etop) + walkstmtlist(l) + *init = concat(*init, l) + return nlen +} + +func eqfor(t *Type, needsize *int) *Node { + // Should only arrive here with large memory or + // a struct/array containing a non-memory field/element. + // Small memory is handled inline, and single non-memory + // is handled during type check (OCMPSTR etc). + a := algtype1(t, nil) + + if a != AMEM && a != -1 { + Fatal("eqfor %v", t) + } + + if a == AMEM { + n := syslook("memequal", 1) + substArgTypes(n, t, t) + *needsize = 1 + return n + } + + sym := typesymprefix(".eq", t) + n := newname(sym) + n.Class = PFUNC + ntype := Nod(OTFUNC, nil, nil) + ntype.List = list(ntype.List, Nod(ODCLFIELD, nil, typenod(Ptrto(t)))) + ntype.List = list(ntype.List, Nod(ODCLFIELD, nil, typenod(Ptrto(t)))) + ntype.Rlist = list(ntype.Rlist, Nod(ODCLFIELD, nil, typenod(Types[TBOOL]))) + typecheck(&ntype, Etype) + n.Type = ntype.Type + *needsize = 0 + return n +} + +func countfield(t *Type) int { + n := 0 + for t1 := t.Type; t1 != nil; t1 = t1.Down { + n++ + } + return n +} + +func walkcompare(np **Node, init **NodeList) { + n := *np + + // Given interface value l and concrete value r, rewrite + // l == r + // to + // x, ok := l.(type(r)); ok && x == r + // Handle != similarly. + // This avoids the allocation that would be required + // to convert r to l for comparison. + var l *Node + + var r *Node + if Isinter(n.Left.Type) && !Isinter(n.Right.Type) { + l = n.Left + r = n.Right + } else if !Isinter(n.Left.Type) && Isinter(n.Right.Type) { + l = n.Right + r = n.Left + } + + if l != nil { + x := temp(r.Type) + if haspointers(r.Type) { + a := Nod(OAS, x, nil) + typecheck(&a, Etop) + *init = list(*init, a) + } + ok := temp(Types[TBOOL]) + + // l.(type(r)) + a := Nod(ODOTTYPE, l, nil) + + a.Type = r.Type + + // x, ok := l.(type(r)) + expr := Nod(OAS2, nil, nil) + + expr.List = list1(x) + expr.List = list(expr.List, ok) + expr.Rlist = list1(a) + typecheck(&expr, Etop) + walkexpr(&expr, init) + + if n.Op == OEQ { + r = Nod(OANDAND, ok, Nod(OEQ, x, r)) + } else { + r = Nod(OOROR, Nod(ONOT, ok, nil), Nod(ONE, x, r)) + } + *init = list(*init, expr) + finishcompare(np, n, r, init) + return + } + + // Must be comparison of array or struct. + // Otherwise back end handles it. + t := n.Left.Type + + switch t.Etype { + default: + return + + case TARRAY: + if Isslice(t) { + return + } + + case TSTRUCT: + break + } + + cmpl := n.Left + for cmpl != nil && cmpl.Op == OCONVNOP { + cmpl = cmpl.Left + } + cmpr := n.Right + for cmpr != nil && cmpr.Op == OCONVNOP { + cmpr = cmpr.Left + } + + if !islvalue(cmpl) || !islvalue(cmpr) { + Fatal("arguments of comparison must be lvalues - %v %v", cmpl, cmpr) + } + + l = temp(Ptrto(t)) + a := Nod(OAS, l, Nod(OADDR, cmpl, nil)) + a.Right.Etype = 1 // addr does not escape + typecheck(&a, Etop) + *init = list(*init, a) + + r = temp(Ptrto(t)) + a = Nod(OAS, r, Nod(OADDR, cmpr, nil)) + a.Right.Etype = 1 // addr does not escape + typecheck(&a, Etop) + *init = list(*init, a) + + andor := OANDAND + if n.Op == ONE { + andor = OOROR + } + + var expr *Node + if t.Etype == TARRAY && t.Bound <= 4 && issimple[t.Type.Etype] { + // Four or fewer elements of a basic type. + // Unroll comparisons. + var li *Node + var ri *Node + for i := 0; int64(i) < t.Bound; i++ { + li = Nod(OINDEX, l, Nodintconst(int64(i))) + ri = Nod(OINDEX, r, Nodintconst(int64(i))) + a = Nod(int(n.Op), li, ri) + if expr == nil { + expr = a + } else { + expr = Nod(andor, expr, a) + } + } + + if expr == nil { + expr = Nodbool(n.Op == OEQ) + } + finishcompare(np, n, expr, init) + return + } + + if t.Etype == TSTRUCT && countfield(t) <= 4 { + // Struct of four or fewer fields. + // Inline comparisons. + var li *Node + var ri *Node + for t1 := t.Type; t1 != nil; t1 = t1.Down { + if isblanksym(t1.Sym) { + continue + } + li = Nod(OXDOT, l, newname(t1.Sym)) + ri = Nod(OXDOT, r, newname(t1.Sym)) + a = Nod(int(n.Op), li, ri) + if expr == nil { + expr = a + } else { + expr = Nod(andor, expr, a) + } + } + + if expr == nil { + expr = Nodbool(n.Op == OEQ) + } + finishcompare(np, n, expr, init) + return + } + + // Chose not to inline. Call equality function directly. + var needsize int + call := Nod(OCALL, eqfor(t, &needsize), nil) + + call.List = list(call.List, l) + call.List = list(call.List, r) + if needsize != 0 { + call.List = list(call.List, Nodintconst(t.Width)) + } + r = call + if n.Op != OEQ { + r = Nod(ONOT, r, nil) + } + + finishcompare(np, n, r, init) + return +} + +func finishcompare(np **Node, n, r *Node, init **NodeList) { + // Using np here to avoid passing &r to typecheck. + *np = r + typecheck(np, Erv) + walkexpr(np, init) + r = *np + if r.Type != n.Type { + r = Nod(OCONVNOP, r, nil) + r.Type = n.Type + r.Typecheck = 1 + *np = r + } +} + +func samecheap(a *Node, b *Node) bool { + var ar *Node + var br *Node + for a != nil && b != nil && a.Op == b.Op { + switch a.Op { + default: + return false + + case ONAME: + return a == b + + case ODOT, ODOTPTR: + ar = a.Right + br = b.Right + if ar.Op != ONAME || br.Op != ONAME || ar.Sym != br.Sym { + return false + } + + case OINDEX: + ar = a.Right + br = b.Right + if !Isconst(ar, CTINT) || !Isconst(br, CTINT) || Mpcmpfixfix(ar.Val().U.(*Mpint), br.Val().U.(*Mpint)) != 0 { + return false + } + } + + a = a.Left + b = b.Left + } + + return false +} + +func walkrotate(np **Node) { + if Thearch.Thechar == '7' || Thearch.Thechar == '9' { + return + } + + n := *np + + // Want << | >> or >> | << or << ^ >> or >> ^ << on unsigned value. + l := n.Left + + r := n.Right + if (n.Op != OOR && n.Op != OXOR) || (l.Op != OLSH && l.Op != ORSH) || (r.Op != OLSH && r.Op != ORSH) || n.Type == nil || Issigned[n.Type.Etype] || l.Op == r.Op { + return + } + + // Want same, side effect-free expression on lhs of both shifts. + if !samecheap(l.Left, r.Left) { + return + } + + // Constants adding to width? + w := int(l.Type.Width * 8) + + if Smallintconst(l.Right) && Smallintconst(r.Right) { + sl := int(Mpgetfix(l.Right.Val().U.(*Mpint))) + if sl >= 0 { + sr := int(Mpgetfix(r.Right.Val().U.(*Mpint))) + if sr >= 0 && sl+sr == w { + // Rewrite left shift half to left rotate. + if l.Op == OLSH { + n = l + } else { + n = r + } + n.Op = OLROT + + // Remove rotate 0 and rotate w. + s := int(Mpgetfix(n.Right.Val().U.(*Mpint))) + + if s == 0 || s == w { + n = n.Left + } + + *np = n + return + } + } + return + } + + // TODO: Could allow s and 32-s if s is bounded (maybe s&31 and 32-s&31). + return +} + +/* + * walkmul rewrites integer multiplication by powers of two as shifts. + */ +func walkmul(np **Node, init **NodeList) { + n := *np + if !Isint[n.Type.Etype] { + return + } + + var nr *Node + var nl *Node + if n.Right.Op == OLITERAL { + nl = n.Left + nr = n.Right + } else if n.Left.Op == OLITERAL { + nl = n.Right + nr = n.Left + } else { + return + } + + neg := 0 + + // x*0 is 0 (and side effects of x). + var pow int + var w int + if Mpgetfix(nr.Val().U.(*Mpint)) == 0 { + cheapexpr(nl, init) + Nodconst(n, n.Type, 0) + goto ret + } + + // nr is a constant. + pow = powtwo(nr) + + if pow < 0 { + return + } + if pow >= 1000 { + // negative power of 2, like -16 + neg = 1 + + pow -= 1000 + } + + w = int(nl.Type.Width * 8) + if pow+1 >= w { // too big, shouldn't happen + return + } + + nl = cheapexpr(nl, init) + + if pow == 0 { + // x*1 is x + n = nl + + goto ret + } + + n = Nod(OLSH, nl, Nodintconst(int64(pow))) + +ret: + if neg != 0 { + n = Nod(OMINUS, n, nil) + } + + typecheck(&n, Erv) + walkexpr(&n, init) + *np = n +} + +/* + * walkdiv rewrites division by a constant as less expensive + * operations. + */ +func walkdiv(np **Node, init **NodeList) { + // if >= 0, nr is 1<= 0, nr is 1<= 1000 { + // negative power of 2 + s = 1 + + pow -= 1000 + } + + if pow+1 >= w { + // divisor too large. + return + } + + if pow < 0 { + // try to do division by multiply by (2^w)/d + // see hacker's delight chapter 10 + // TODO: support 64-bit magic multiply here. + var m Magic + m.W = w + + if Issigned[nl.Type.Etype] { + m.Sd = Mpgetfix(nr.Val().U.(*Mpint)) + Smagic(&m) + } else { + m.Ud = uint64(Mpgetfix(nr.Val().U.(*Mpint))) + Umagic(&m) + } + + if m.Bad != 0 { + return + } + + // We have a quick division method so use it + // for modulo too. + if n.Op == OMOD { + // rewrite as A%B = A - (A/B*B). + n1 := Nod(ODIV, nl, nr) + + n2 := Nod(OMUL, n1, nr) + n = Nod(OSUB, nl, n2) + goto ret + } + + switch Simtype[nl.Type.Etype] { + default: + return + + // n1 = nl * magic >> w (HMUL) + case TUINT8, TUINT16, TUINT32: + nc := Nod(OXXX, nil, nil) + + Nodconst(nc, nl.Type, int64(m.Um)) + n1 := Nod(OHMUL, nl, nc) + typecheck(&n1, Erv) + if m.Ua != 0 { + // Select a Go type with (at least) twice the width. + var twide *Type + switch Simtype[nl.Type.Etype] { + default: + return + + case TUINT8, TUINT16: + twide = Types[TUINT32] + + case TUINT32: + twide = Types[TUINT64] + + case TINT8, TINT16: + twide = Types[TINT32] + + case TINT32: + twide = Types[TINT64] + } + + // add numerator (might overflow). + // n2 = (n1 + nl) + n2 := Nod(OADD, conv(n1, twide), conv(nl, twide)) + + // shift by m.s + nc := Nod(OXXX, nil, nil) + + Nodconst(nc, Types[TUINT], int64(m.S)) + n = conv(Nod(ORSH, n2, nc), nl.Type) + } else { + // n = n1 >> m.s + nc := Nod(OXXX, nil, nil) + + Nodconst(nc, Types[TUINT], int64(m.S)) + n = Nod(ORSH, n1, nc) + } + + // n1 = nl * magic >> w + case TINT8, TINT16, TINT32: + nc := Nod(OXXX, nil, nil) + + Nodconst(nc, nl.Type, m.Sm) + n1 := Nod(OHMUL, nl, nc) + typecheck(&n1, Erv) + if m.Sm < 0 { + // add the numerator. + n1 = Nod(OADD, n1, nl) + } + + // shift by m.s + nc = Nod(OXXX, nil, nil) + + Nodconst(nc, Types[TUINT], int64(m.S)) + n2 := conv(Nod(ORSH, n1, nc), nl.Type) + + // add 1 iff n1 is negative. + nc = Nod(OXXX, nil, nil) + + Nodconst(nc, Types[TUINT], int64(w)-1) + n3 := Nod(ORSH, nl, nc) // n4 = -1 iff n1 is negative. + n = Nod(OSUB, n2, n3) + + // apply sign. + if m.Sd < 0 { + n = Nod(OMINUS, n, nil) + } + } + + goto ret + } + + switch pow { + case 0: + if n.Op == OMOD { + // nl % 1 is zero. + Nodconst(n, n.Type, 0) + } else if s != 0 { + // divide by -1 + n.Op = OMINUS + + n.Right = nil + } else { + // divide by 1 + n = nl + } + + default: + if Issigned[n.Type.Etype] { + if n.Op == OMOD { + // signed modulo 2^pow is like ANDing + // with the last pow bits, but if nl < 0, + // nl & (2^pow-1) is (nl+1)%2^pow - 1. + nc := Nod(OXXX, nil, nil) + + Nodconst(nc, Types[Simtype[TUINT]], int64(w)-1) + n1 := Nod(ORSH, nl, nc) // n1 = -1 iff nl < 0. + if pow == 1 { + typecheck(&n1, Erv) + n1 = cheapexpr(n1, init) + + // n = (nl+ε)&1 -ε where ε=1 iff nl<0. + n2 := Nod(OSUB, nl, n1) + + nc := Nod(OXXX, nil, nil) + Nodconst(nc, nl.Type, 1) + n3 := Nod(OAND, n2, nc) + n = Nod(OADD, n3, n1) + } else { + // n = (nl+ε)&(nr-1) - ε where ε=2^pow-1 iff nl<0. + nc := Nod(OXXX, nil, nil) + + Nodconst(nc, nl.Type, (1<= 0, nl >> n == nl / nr + // if nl < 0, we want to add 2^n-1 first. + nc := Nod(OXXX, nil, nil) + + Nodconst(nc, Types[Simtype[TUINT]], int64(w)-1) + n1 := Nod(ORSH, nl, nc) // n1 = -1 iff nl < 0. + if pow == 1 { + // nl+1 is nl-(-1) + n.Left = Nod(OSUB, nl, n1) + } else { + // Do a logical right right on -1 to keep pow bits. + nc := Nod(OXXX, nil, nil) + + Nodconst(nc, Types[Simtype[TUINT]], int64(w)-int64(pow)) + n2 := Nod(ORSH, conv(n1, tounsigned(nl.Type)), nc) + n.Left = Nod(OADD, nl, conv(n2, nl.Type)) + } + + // n = (nl + 2^pow-1) >> pow + n.Op = ORSH + + nc = Nod(OXXX, nil, nil) + Nodconst(nc, Types[Simtype[TUINT]], int64(pow)) + n.Right = nc + n.Typecheck = 0 + } + + if s != 0 { + n = Nod(OMINUS, n, nil) + } + break + } + + nc := Nod(OXXX, nil, nil) + if n.Op == OMOD { + // n = nl & (nr-1) + n.Op = OAND + + Nodconst(nc, nl.Type, Mpgetfix(nr.Val().U.(*Mpint))-1) + } else { + // n = nl >> pow + n.Op = ORSH + + Nodconst(nc, Types[Simtype[TUINT]], int64(pow)) + } + + n.Typecheck = 0 + n.Right = nc + } + + goto ret + +ret: + typecheck(&n, Erv) + walkexpr(&n, init) + *np = n +} + +// return 1 if integer n must be in range [0, max), 0 otherwise +func bounded(n *Node, max int64) bool { + if n.Type == nil || !Isint[n.Type.Etype] { + return false + } + + sign := Issigned[n.Type.Etype] + bits := int32(8 * n.Type.Width) + + if Smallintconst(n) { + v := Mpgetfix(n.Val().U.(*Mpint)) + return 0 <= v && v < max + } + + switch n.Op { + case OAND: + v := int64(-1) + if Smallintconst(n.Left) { + v = Mpgetfix(n.Left.Val().U.(*Mpint)) + } else if Smallintconst(n.Right) { + v = Mpgetfix(n.Right.Val().U.(*Mpint)) + } + + if 0 <= v && v < max { + return true + } + + case OMOD: + if !sign && Smallintconst(n.Right) { + v := Mpgetfix(n.Right.Val().U.(*Mpint)) + if 0 <= v && v <= max { + return true + } + } + + case ODIV: + if !sign && Smallintconst(n.Right) { + v := Mpgetfix(n.Right.Val().U.(*Mpint)) + for bits > 0 && v >= 2 { + bits-- + v >>= 1 + } + } + + case ORSH: + if !sign && Smallintconst(n.Right) { + v := Mpgetfix(n.Right.Val().U.(*Mpint)) + if v > int64(bits) { + return true + } + bits -= int32(v) + } + } + + if !sign && bits <= 62 && 1<= 1 && c-1 < len(yyToknames) { + if yyToknames[c-1] != "" { + return yyToknames[c-1] + } + } + return __yyfmt__.Sprintf("tok-%v", c) +} + +func yyStatname(s int) string { + if s >= 0 && s < len(yyStatenames) { + if yyStatenames[s] != "" { + return yyStatenames[s] + } + } + return __yyfmt__.Sprintf("state-%v", s) +} + +func yyErrorMessage(state, lookAhead int) string { + const TOKSTART = 4 + + if !yyErrorVerbose { + return "syntax error" + } + + for _, e := range yyErrorMessages { + if e.state == state && e.token == lookAhead { + return "syntax error: " + e.msg + } + } + + res := "syntax error: unexpected " + yyTokname(lookAhead) + + // To match Bison, suggest at most four expected tokens. + expected := make([]int, 0, 4) + + // Look for shiftable tokens. + base := yyPact[state] + for tok := TOKSTART; tok-1 < len(yyToknames); tok++ { + if n := base + tok; n >= 0 && n < yyLast && yyChk[yyAct[n]] == tok { + if len(expected) == cap(expected) { + return res + } + expected = append(expected, tok) + } + } + + if yyDef[state] == -2 { + i := 0 + for yyExca[i] != -1 || yyExca[i+1] != state { + i += 2 + } + + // Look for tokens that we accept or reduce. + for i += 2; yyExca[i] >= 0; i += 2 { + tok := yyExca[i] + if tok < TOKSTART || yyExca[i+1] == 0 { + continue + } + if len(expected) == cap(expected) { + return res + } + expected = append(expected, tok) + } + + // If the default action is to accept or reduce, give up. + if yyExca[i+1] != 0 { + return res + } + } + + for i, tok := range expected { + if i == 0 { + res += ", expecting " + } else { + res += " or " + } + res += yyTokname(tok) + } + return res +} + +func yylex1(lex yyLexer, lval *yySymType) (char, token int) { + token = 0 + char = lex.Lex(lval) + if char <= 0 { + token = yyTok1[0] + goto out + } + if char < len(yyTok1) { + token = yyTok1[char] + goto out + } + if char >= yyPrivate { + if char < yyPrivate+len(yyTok2) { + token = yyTok2[char-yyPrivate] + goto out + } + } + for i := 0; i < len(yyTok3); i += 2 { + token = yyTok3[i+0] + if token == char { + token = yyTok3[i+1] + goto out + } + } + +out: + if token == 0 { + token = yyTok2[1] /* unknown char */ + } + if yyDebug >= 3 { + __yyfmt__.Printf("lex %s(%d)\n", yyTokname(token), uint(char)) + } + return char, token +} + +func yyParse(yylex yyLexer) int { + return yyNewParser().Parse(yylex) +} + +func (yyrcvr *yyParserImpl) Parse(yylex yyLexer) int { + var yyn int + var yylval yySymType + var yyVAL yySymType + var yyDollar []yySymType + yyS := make([]yySymType, yyMaxDepth) + + Nerrs := 0 /* number of errors */ + Errflag := 0 /* error recovery flag */ + yystate := 0 + yychar := -1 + yytoken := -1 // yychar translated into internal numbering + yyrcvr.lookahead = func() int { return yychar } + defer func() { + // Make sure we report no lookahead when not parsing. + yystate = -1 + yychar = -1 + yytoken = -1 + }() + yyp := -1 + goto yystack + +ret0: + return 0 + +ret1: + return 1 + +yystack: + /* put a state and value onto the stack */ + if yyDebug >= 4 { + __yyfmt__.Printf("char %v in %v\n", yyTokname(yytoken), yyStatname(yystate)) + } + + yyp++ + if yyp >= len(yyS) { + nyys := make([]yySymType, len(yyS)*2) + copy(nyys, yyS) + yyS = nyys + } + yyS[yyp] = yyVAL + yyS[yyp].yys = yystate + +yynewstate: + yyn = yyPact[yystate] + if yyn <= yyFlag { + goto yydefault /* simple state */ + } + if yychar < 0 { + yychar, yytoken = yylex1(yylex, &yylval) + } + yyn += yytoken + if yyn < 0 || yyn >= yyLast { + goto yydefault + } + yyn = yyAct[yyn] + if yyChk[yyn] == yytoken { /* valid shift */ + yychar = -1 + yytoken = -1 + yyVAL = yylval + yystate = yyn + if Errflag > 0 { + Errflag-- + } + goto yystack + } + +yydefault: + /* default state action */ + yyn = yyDef[yystate] + if yyn == -2 { + if yychar < 0 { + yychar, yytoken = yylex1(yylex, &yylval) + } + + /* look through exception table */ + xi := 0 + for { + if yyExca[xi+0] == -1 && yyExca[xi+1] == yystate { + break + } + xi += 2 + } + for xi += 2; ; xi += 2 { + yyn = yyExca[xi+0] + if yyn < 0 || yyn == yytoken { + break + } + } + yyn = yyExca[xi+1] + if yyn < 0 { + goto ret0 + } + } + if yyn == 0 { + /* error ... attempt to resume parsing */ + switch Errflag { + case 0: /* brand new error */ + yylex.Error(yyErrorMessage(yystate, yytoken)) + Nerrs++ + if yyDebug >= 1 { + __yyfmt__.Printf("%s", yyStatname(yystate)) + __yyfmt__.Printf(" saw %s\n", yyTokname(yytoken)) + } + fallthrough + + case 1, 2: /* incompletely recovered error ... try again */ + Errflag = 3 + + /* find a state where "error" is a legal shift action */ + for yyp >= 0 { + yyn = yyPact[yyS[yyp].yys] + yyErrCode + if yyn >= 0 && yyn < yyLast { + yystate = yyAct[yyn] /* simulate a shift of "error" */ + if yyChk[yystate] == yyErrCode { + goto yystack + } + } + + /* the current p has no shift on "error", pop stack */ + if yyDebug >= 2 { + __yyfmt__.Printf("error recovery pops state %d\n", yyS[yyp].yys) + } + yyp-- + } + /* there is no state on the stack with an error shift ... abort */ + goto ret1 + + case 3: /* no shift yet; clobber input char */ + if yyDebug >= 2 { + __yyfmt__.Printf("error recovery discards %s\n", yyTokname(yytoken)) + } + if yytoken == yyEofCode { + goto ret1 + } + yychar = -1 + yytoken = -1 + goto yynewstate /* try again in the same state */ + } + } + + /* reduction by production yyn */ + if yyDebug >= 2 { + __yyfmt__.Printf("reduce %v in:\n\t%v\n", yyn, yyStatname(yystate)) + } + + yynt := yyn + yypt := yyp + _ = yypt // guard against "declared and not used" + + yyp -= yyR2[yyn] + // yyp is now the index of $0. Perform the default action. Iff the + // reduced production is ε, $1 is possibly out of range. + if yyp+1 >= len(yyS) { + nyys := make([]yySymType, len(yyS)*2) + copy(nyys, yyS) + yyS = nyys + } + yyVAL = yyS[yyp+1] + + /* consult goto table to find next state */ + yyn = yyR1[yyn] + yyg := yyPgo[yyn] + yyj := yyg + yyS[yyp].yys + 1 + + if yyj >= yyLast { + yystate = yyAct[yyg] + } else { + yystate = yyAct[yyj] + if yyChk[yystate] != -yyn { + yystate = yyAct[yyg] + } + } + // dummy call; replaced with literal code + switch yynt { + + case 1: + yyDollar = yyS[yypt-4 : yypt+1] + //line go.y:189 + { + xtop = concat(xtop, yyDollar[4].list) + } + case 2: + yyDollar = yyS[yypt-0 : yypt+1] + //line go.y:195 + { + prevlineno = lineno + Yyerror("package statement must be first") + errorexit() + } + case 3: + yyDollar = yyS[yypt-3 : yypt+1] + //line go.y:201 + { + mkpackage(yyDollar[2].sym.Name) + } + case 4: + yyDollar = yyS[yypt-0 : yypt+1] + //line go.y:211 + { + importpkg = Runtimepkg + + if Debug['A'] != 0 { + cannedimports("runtime.Builtin", "package runtime\n\n$$\n\n") + } else { + cannedimports("runtime.Builtin", runtimeimport) + } + curio.importsafe = true + } + case 5: + yyDollar = yyS[yypt-3 : yypt+1] + //line go.y:223 + { + importpkg = nil + } + case 11: + yyDollar = yyS[yypt-3 : yypt+1] + //line go.y:237 + { + ipkg := importpkg + my := importmyname + importpkg = nil + importmyname = nil + + if my == nil { + my = Lookup(ipkg.Name) + } + + pack := Nod(OPACK, nil, nil) + pack.Sym = my + pack.Name.Pkg = ipkg + pack.Lineno = int32(yyDollar[1].i) + + if strings.HasPrefix(my.Name, ".") { + importdot(ipkg, pack) + break + } + if my.Name == "init" { + Yyerror("cannot import package as init - init must be a func") + break + } + if my.Name == "_" { + break + } + if my.Def != nil { + lineno = int32(yyDollar[1].i) + redeclare(my, "as imported package name") + } + my.Def = pack + my.Lastlineno = int32(yyDollar[1].i) + my.Block = 1 // at top level + } + case 12: + yyDollar = yyS[yypt-2 : yypt+1] + //line go.y:272 + { + // When an invalid import path is passed to importfile, + // it calls Yyerror and then sets up a fake import with + // no package statement. This allows us to test more + // than one invalid import statement in a single file. + if nerrors == 0 { + Fatal("phase error in import") + } + } + case 15: + yyDollar = yyS[yypt-1 : yypt+1] + //line go.y:288 + { + // import with original name + yyVAL.i = parserline() + importmyname = nil + importfile(&yyDollar[1].val, yyVAL.i) + } + case 16: + yyDollar = yyS[yypt-2 : yypt+1] + //line go.y:295 + { + // import with given name + yyVAL.i = parserline() + importmyname = yyDollar[1].sym + importfile(&yyDollar[2].val, yyVAL.i) + } + case 17: + yyDollar = yyS[yypt-2 : yypt+1] + //line go.y:302 + { + // import into my name space + yyVAL.i = parserline() + importmyname = Lookup(".") + importfile(&yyDollar[2].val, yyVAL.i) + } + case 18: + yyDollar = yyS[yypt-4 : yypt+1] + //line go.y:311 + { + if importpkg.Name == "" { + importpkg.Name = yyDollar[2].sym.Name + numImport[yyDollar[2].sym.Name]++ + } else if importpkg.Name != yyDollar[2].sym.Name { + Yyerror("conflicting names %s and %s for package %q", importpkg.Name, yyDollar[2].sym.Name, importpkg.Path) + } + importpkg.Direct = 1 + importpkg.Safe = curio.importsafe + + if safemode != 0 && !curio.importsafe { + Yyerror("cannot import unsafe package %q", importpkg.Path) + } + } + case 20: + yyDollar = yyS[yypt-1 : yypt+1] + //line go.y:328 + { + if yyDollar[1].sym.Name == "safe" { + curio.importsafe = true + } + } + case 21: + yyDollar = yyS[yypt-0 : yypt+1] + //line go.y:335 + { + defercheckwidth() + } + case 22: + yyDollar = yyS[yypt-4 : yypt+1] + //line go.y:339 + { + resumecheckwidth() + unimportfile() + } + case 23: + yyDollar = yyS[yypt-0 : yypt+1] + //line go.y:348 + { + Yyerror("empty top-level declaration") + yyVAL.list = nil + } + case 25: + yyDollar = yyS[yypt-1 : yypt+1] + //line go.y:354 + { + yyVAL.list = list1(yyDollar[1].node) + } + case 26: + yyDollar = yyS[yypt-1 : yypt+1] + //line go.y:358 + { + Yyerror("non-declaration statement outside function body") + yyVAL.list = nil + } + case 27: + yyDollar = yyS[yypt-1 : yypt+1] + //line go.y:363 + { + yyVAL.list = nil + } + case 28: + yyDollar = yyS[yypt-2 : yypt+1] + //line go.y:369 + { + yyVAL.list = yyDollar[2].list + } + case 29: + yyDollar = yyS[yypt-5 : yypt+1] + //line go.y:373 + { + yyVAL.list = yyDollar[3].list + } + case 30: + yyDollar = yyS[yypt-3 : yypt+1] + //line go.y:377 + { + yyVAL.list = nil + } + case 31: + yyDollar = yyS[yypt-2 : yypt+1] + //line go.y:381 + { + yyVAL.list = yyDollar[2].list + iota_ = -100000 + lastconst = nil + } + case 32: + yyDollar = yyS[yypt-5 : yypt+1] + //line go.y:387 + { + yyVAL.list = yyDollar[3].list + iota_ = -100000 + lastconst = nil + } + case 33: + yyDollar = yyS[yypt-7 : yypt+1] + //line go.y:393 + { + yyVAL.list = concat(yyDollar[3].list, yyDollar[5].list) + iota_ = -100000 + lastconst = nil + } + case 34: + yyDollar = yyS[yypt-3 : yypt+1] + //line go.y:399 + { + yyVAL.list = nil + iota_ = -100000 + } + case 35: + yyDollar = yyS[yypt-2 : yypt+1] + //line go.y:404 + { + yyVAL.list = list1(yyDollar[2].node) + } + case 36: + yyDollar = yyS[yypt-5 : yypt+1] + //line go.y:408 + { + yyVAL.list = yyDollar[3].list + } + case 37: + yyDollar = yyS[yypt-3 : yypt+1] + //line go.y:412 + { + yyVAL.list = nil + } + case 38: + yyDollar = yyS[yypt-1 : yypt+1] + //line go.y:418 + { + iota_ = 0 + } + case 39: + yyDollar = yyS[yypt-2 : yypt+1] + //line go.y:424 + { + yyVAL.list = variter(yyDollar[1].list, yyDollar[2].node, nil) + } + case 40: + yyDollar = yyS[yypt-4 : yypt+1] + //line go.y:428 + { + yyVAL.list = variter(yyDollar[1].list, yyDollar[2].node, yyDollar[4].list) + } + case 41: + yyDollar = yyS[yypt-3 : yypt+1] + //line go.y:432 + { + yyVAL.list = variter(yyDollar[1].list, nil, yyDollar[3].list) + } + case 42: + yyDollar = yyS[yypt-4 : yypt+1] + //line go.y:438 + { + yyVAL.list = constiter(yyDollar[1].list, yyDollar[2].node, yyDollar[4].list) + } + case 43: + yyDollar = yyS[yypt-3 : yypt+1] + //line go.y:442 + { + yyVAL.list = constiter(yyDollar[1].list, nil, yyDollar[3].list) + } + case 45: + yyDollar = yyS[yypt-2 : yypt+1] + //line go.y:449 + { + yyVAL.list = constiter(yyDollar[1].list, yyDollar[2].node, nil) + } + case 46: + yyDollar = yyS[yypt-1 : yypt+1] + //line go.y:453 + { + yyVAL.list = constiter(yyDollar[1].list, nil, nil) + } + case 47: + yyDollar = yyS[yypt-1 : yypt+1] + //line go.y:459 + { + // different from dclname because the name + // becomes visible right here, not at the end + // of the declaration. + yyVAL.node = typedcl0(yyDollar[1].sym) + } + case 48: + yyDollar = yyS[yypt-2 : yypt+1] + //line go.y:468 + { + yyVAL.node = typedcl1(yyDollar[1].node, yyDollar[2].node, true) + } + case 49: + yyDollar = yyS[yypt-1 : yypt+1] + //line go.y:474 + { + yyVAL.node = yyDollar[1].node + + // These nodes do not carry line numbers. + // Since a bare name used as an expression is an error, + // introduce a wrapper node to give the correct line. + switch yyVAL.node.Op { + case ONAME, ONONAME, OTYPE, OPACK, OLITERAL: + yyVAL.node = Nod(OPAREN, yyVAL.node, nil) + yyVAL.node.Implicit = true + break + } + } + case 50: + yyDollar = yyS[yypt-3 : yypt+1] + //line go.y:488 + { + yyVAL.node = Nod(OASOP, yyDollar[1].node, yyDollar[3].node) + yyVAL.node.Etype = uint8(yyDollar[2].i) // rathole to pass opcode + } + case 51: + yyDollar = yyS[yypt-3 : yypt+1] + //line go.y:493 + { + if yyDollar[1].list.Next == nil && yyDollar[3].list.Next == nil { + // simple + yyVAL.node = Nod(OAS, yyDollar[1].list.N, yyDollar[3].list.N) + break + } + // multiple + yyVAL.node = Nod(OAS2, nil, nil) + yyVAL.node.List = yyDollar[1].list + yyVAL.node.Rlist = yyDollar[3].list + } + case 52: + yyDollar = yyS[yypt-3 : yypt+1] + //line go.y:505 + { + if yyDollar[3].list.N.Op == OTYPESW { + yyVAL.node = Nod(OTYPESW, nil, yyDollar[3].list.N.Right) + if yyDollar[3].list.Next != nil { + Yyerror("expr.(type) must be alone in list") + } + if yyDollar[1].list.Next != nil { + Yyerror("argument count mismatch: %d = %d", count(yyDollar[1].list), 1) + } else if (yyDollar[1].list.N.Op != ONAME && yyDollar[1].list.N.Op != OTYPE && yyDollar[1].list.N.Op != ONONAME) || isblank(yyDollar[1].list.N) { + Yyerror("invalid variable name %s in type switch", yyDollar[1].list.N) + } else { + yyVAL.node.Left = dclname(yyDollar[1].list.N.Sym) + } // it's a colas, so must not re-use an oldname. + break + } + yyVAL.node = colas(yyDollar[1].list, yyDollar[3].list, int32(yyDollar[2].i)) + } + case 53: + yyDollar = yyS[yypt-2 : yypt+1] + //line go.y:523 + { + yyVAL.node = Nod(OASOP, yyDollar[1].node, Nodintconst(1)) + yyVAL.node.Implicit = true + yyVAL.node.Etype = OADD + } + case 54: + yyDollar = yyS[yypt-2 : yypt+1] + //line go.y:529 + { + yyVAL.node = Nod(OASOP, yyDollar[1].node, Nodintconst(1)) + yyVAL.node.Implicit = true + yyVAL.node.Etype = OSUB + } + case 55: + yyDollar = yyS[yypt-3 : yypt+1] + //line go.y:537 + { + var n, nn *Node + + // will be converted to OCASE + // right will point to next case + // done in casebody() + markdcl() + yyVAL.node = Nod(OXCASE, nil, nil) + yyVAL.node.List = yyDollar[2].list + if typesw != nil && typesw.Right != nil { + n = typesw.Right.Left + if n != nil { + // type switch - declare variable + nn = newname(n.Sym) + declare(nn, dclcontext) + yyVAL.node.Rlist = list1(nn) + + // keep track of the instances for reporting unused + nn.Name.Defn = typesw.Right + } + } + } + case 56: + yyDollar = yyS[yypt-5 : yypt+1] + //line go.y:560 + { + var n *Node + + // will be converted to OCASE + // right will point to next case + // done in casebody() + markdcl() + yyVAL.node = Nod(OXCASE, nil, nil) + if yyDollar[2].list.Next == nil { + n = Nod(OAS, yyDollar[2].list.N, yyDollar[4].node) + } else { + n = Nod(OAS2, nil, nil) + n.List = yyDollar[2].list + n.Rlist = list1(yyDollar[4].node) + } + yyVAL.node.List = list1(n) + } + case 57: + yyDollar = yyS[yypt-5 : yypt+1] + //line go.y:578 + { + // will be converted to OCASE + // right will point to next case + // done in casebody() + markdcl() + yyVAL.node = Nod(OXCASE, nil, nil) + yyVAL.node.List = list1(colas(yyDollar[2].list, list1(yyDollar[4].node), int32(yyDollar[3].i))) + } + case 58: + yyDollar = yyS[yypt-2 : yypt+1] + //line go.y:587 + { + var n, nn *Node + + markdcl() + yyVAL.node = Nod(OXCASE, nil, nil) + if typesw != nil && typesw.Right != nil { + n = typesw.Right.Left + if n != nil { + // type switch - declare variable + nn = newname(n.Sym) + declare(nn, dclcontext) + yyVAL.node.Rlist = list1(nn) + + // keep track of the instances for reporting unused + nn.Name.Defn = typesw.Right + } + } + } + case 59: + yyDollar = yyS[yypt-1 : yypt+1] + //line go.y:608 + { + markdcl() + } + case 60: + yyDollar = yyS[yypt-4 : yypt+1] + //line go.y:612 + { + if yyDollar[3].list == nil { + yyVAL.node = Nod(OEMPTY, nil, nil) + } else { + yyVAL.node = liststmt(yyDollar[3].list) + } + popdcl() + } + case 61: + yyDollar = yyS[yypt-1 : yypt+1] + //line go.y:623 + { + // If the last token read by the lexer was consumed + // as part of the case, clear it (parser has cleared yychar). + // If the last token read by the lexer was the lookahead + // leave it alone (parser has it cached in yychar). + // This is so that the stmt_list action doesn't look at + // the case tokens if the stmt_list is empty. + yylast = yychar + yyDollar[1].node.Xoffset = int64(block) + } + case 62: + yyDollar = yyS[yypt-3 : yypt+1] + //line go.y:634 + { + // This is the only place in the language where a statement + // list is not allowed to drop the final semicolon, because + // it's the only place where a statement list is not followed + // by a closing brace. Handle the error for pedantry. + + // Find the final token of the statement list. + // yylast is lookahead; yyprev is last of stmt_list + last := yyprev + + if last > 0 && last != ';' && yychar != '}' { + Yyerror("missing statement after label") + } + yyVAL.node = yyDollar[1].node + yyVAL.node.Nbody = yyDollar[3].list + popdcl() + } + case 63: + yyDollar = yyS[yypt-0 : yypt+1] + //line go.y:653 + { + yyVAL.list = nil + } + case 64: + yyDollar = yyS[yypt-2 : yypt+1] + //line go.y:657 + { + yyVAL.list = list(yyDollar[1].list, yyDollar[2].node) + } + case 65: + yyDollar = yyS[yypt-1 : yypt+1] + //line go.y:663 + { + markdcl() + } + case 66: + yyDollar = yyS[yypt-4 : yypt+1] + //line go.y:667 + { + yyVAL.list = yyDollar[3].list + popdcl() + } + case 67: + yyDollar = yyS[yypt-4 : yypt+1] + //line go.y:674 + { + yyVAL.node = Nod(ORANGE, nil, yyDollar[4].node) + yyVAL.node.List = yyDollar[1].list + yyVAL.node.Etype = 0 // := flag + } + case 68: + yyDollar = yyS[yypt-4 : yypt+1] + //line go.y:680 + { + yyVAL.node = Nod(ORANGE, nil, yyDollar[4].node) + yyVAL.node.List = yyDollar[1].list + yyVAL.node.Colas = true + colasdefn(yyDollar[1].list, yyVAL.node) + } + case 69: + yyDollar = yyS[yypt-2 : yypt+1] + //line go.y:687 + { + yyVAL.node = Nod(ORANGE, nil, yyDollar[2].node) + yyVAL.node.Etype = 0 // := flag + } + case 70: + yyDollar = yyS[yypt-5 : yypt+1] + //line go.y:694 + { + // init ; test ; incr + if yyDollar[5].node != nil && yyDollar[5].node.Colas { + Yyerror("cannot declare in the for-increment") + } + yyVAL.node = Nod(OFOR, nil, nil) + if yyDollar[1].node != nil { + yyVAL.node.Ninit = list1(yyDollar[1].node) + } + yyVAL.node.Left = yyDollar[3].node + yyVAL.node.Right = yyDollar[5].node + } + case 71: + yyDollar = yyS[yypt-1 : yypt+1] + //line go.y:707 + { + // normal test + yyVAL.node = Nod(OFOR, nil, nil) + yyVAL.node.Left = yyDollar[1].node + } + case 73: + yyDollar = yyS[yypt-2 : yypt+1] + //line go.y:716 + { + yyVAL.node = yyDollar[1].node + yyVAL.node.Nbody = concat(yyVAL.node.Nbody, yyDollar[2].list) + } + case 74: + yyDollar = yyS[yypt-1 : yypt+1] + //line go.y:723 + { + markdcl() + } + case 75: + yyDollar = yyS[yypt-3 : yypt+1] + //line go.y:727 + { + yyVAL.node = yyDollar[3].node + popdcl() + } + case 76: + yyDollar = yyS[yypt-1 : yypt+1] + //line go.y:734 + { + // test + yyVAL.node = Nod(OIF, nil, nil) + yyVAL.node.Left = yyDollar[1].node + } + case 77: + yyDollar = yyS[yypt-3 : yypt+1] + //line go.y:740 + { + // init ; test + yyVAL.node = Nod(OIF, nil, nil) + if yyDollar[1].node != nil { + yyVAL.node.Ninit = list1(yyDollar[1].node) + } + yyVAL.node.Left = yyDollar[3].node + } + case 78: + yyDollar = yyS[yypt-1 : yypt+1] + //line go.y:752 + { + markdcl() + } + case 79: + yyDollar = yyS[yypt-3 : yypt+1] + //line go.y:756 + { + if yyDollar[3].node.Left == nil { + Yyerror("missing condition in if statement") + } + } + case 80: + yyDollar = yyS[yypt-5 : yypt+1] + //line go.y:762 + { + yyDollar[3].node.Nbody = yyDollar[5].list + } + case 81: + yyDollar = yyS[yypt-8 : yypt+1] + //line go.y:766 + { + var n *Node + var nn *NodeList + + yyVAL.node = yyDollar[3].node + n = yyDollar[3].node + popdcl() + for nn = concat(yyDollar[7].list, yyDollar[8].list); nn != nil; nn = nn.Next { + if nn.N.Op == OIF { + popdcl() + } + n.Rlist = list1(nn.N) + n = nn.N + } + } + case 82: + yyDollar = yyS[yypt-2 : yypt+1] + //line go.y:784 + { + markdcl() + } + case 83: + yyDollar = yyS[yypt-5 : yypt+1] + //line go.y:788 + { + if yyDollar[4].node.Left == nil { + Yyerror("missing condition in if statement") + } + yyDollar[4].node.Nbody = yyDollar[5].list + yyVAL.list = list1(yyDollar[4].node) + } + case 84: + yyDollar = yyS[yypt-0 : yypt+1] + //line go.y:797 + { + yyVAL.list = nil + } + case 85: + yyDollar = yyS[yypt-2 : yypt+1] + //line go.y:801 + { + yyVAL.list = concat(yyDollar[1].list, yyDollar[2].list) + } + case 86: + yyDollar = yyS[yypt-0 : yypt+1] + //line go.y:806 + { + yyVAL.list = nil + } + case 87: + yyDollar = yyS[yypt-2 : yypt+1] + //line go.y:810 + { + l := &NodeList{N: yyDollar[2].node} + l.End = l + yyVAL.list = l + } + case 88: + yyDollar = yyS[yypt-1 : yypt+1] + //line go.y:818 + { + markdcl() + } + case 89: + yyDollar = yyS[yypt-3 : yypt+1] + //line go.y:822 + { + var n *Node + n = yyDollar[3].node.Left + if n != nil && n.Op != OTYPESW { + n = nil + } + typesw = Nod(OXXX, typesw, n) + } + case 90: + yyDollar = yyS[yypt-7 : yypt+1] + //line go.y:831 + { + yyVAL.node = yyDollar[3].node + yyVAL.node.Op = OSWITCH + yyVAL.node.List = yyDollar[6].list + typesw = typesw.Left + popdcl() + } + case 91: + yyDollar = yyS[yypt-1 : yypt+1] + //line go.y:841 + { + typesw = Nod(OXXX, typesw, nil) + } + case 92: + yyDollar = yyS[yypt-5 : yypt+1] + //line go.y:845 + { + yyVAL.node = Nod(OSELECT, nil, nil) + yyVAL.node.Lineno = typesw.Lineno + yyVAL.node.List = yyDollar[4].list + typesw = typesw.Left + } + case 94: + yyDollar = yyS[yypt-3 : yypt+1] + //line go.y:858 + { + yyVAL.node = Nod(OOROR, yyDollar[1].node, yyDollar[3].node) + } + case 95: + yyDollar = yyS[yypt-3 : yypt+1] + //line go.y:862 + { + yyVAL.node = Nod(OANDAND, yyDollar[1].node, yyDollar[3].node) + } + case 96: + yyDollar = yyS[yypt-3 : yypt+1] + //line go.y:866 + { + yyVAL.node = Nod(OEQ, yyDollar[1].node, yyDollar[3].node) + } + case 97: + yyDollar = yyS[yypt-3 : yypt+1] + //line go.y:870 + { + yyVAL.node = Nod(ONE, yyDollar[1].node, yyDollar[3].node) + } + case 98: + yyDollar = yyS[yypt-3 : yypt+1] + //line go.y:874 + { + yyVAL.node = Nod(OLT, yyDollar[1].node, yyDollar[3].node) + } + case 99: + yyDollar = yyS[yypt-3 : yypt+1] + //line go.y:878 + { + yyVAL.node = Nod(OLE, yyDollar[1].node, yyDollar[3].node) + } + case 100: + yyDollar = yyS[yypt-3 : yypt+1] + //line go.y:882 + { + yyVAL.node = Nod(OGE, yyDollar[1].node, yyDollar[3].node) + } + case 101: + yyDollar = yyS[yypt-3 : yypt+1] + //line go.y:886 + { + yyVAL.node = Nod(OGT, yyDollar[1].node, yyDollar[3].node) + } + case 102: + yyDollar = yyS[yypt-3 : yypt+1] + //line go.y:890 + { + yyVAL.node = Nod(OADD, yyDollar[1].node, yyDollar[3].node) + } + case 103: + yyDollar = yyS[yypt-3 : yypt+1] + //line go.y:894 + { + yyVAL.node = Nod(OSUB, yyDollar[1].node, yyDollar[3].node) + } + case 104: + yyDollar = yyS[yypt-3 : yypt+1] + //line go.y:898 + { + yyVAL.node = Nod(OOR, yyDollar[1].node, yyDollar[3].node) + } + case 105: + yyDollar = yyS[yypt-3 : yypt+1] + //line go.y:902 + { + yyVAL.node = Nod(OXOR, yyDollar[1].node, yyDollar[3].node) + } + case 106: + yyDollar = yyS[yypt-3 : yypt+1] + //line go.y:906 + { + yyVAL.node = Nod(OMUL, yyDollar[1].node, yyDollar[3].node) + } + case 107: + yyDollar = yyS[yypt-3 : yypt+1] + //line go.y:910 + { + yyVAL.node = Nod(ODIV, yyDollar[1].node, yyDollar[3].node) + } + case 108: + yyDollar = yyS[yypt-3 : yypt+1] + //line go.y:914 + { + yyVAL.node = Nod(OMOD, yyDollar[1].node, yyDollar[3].node) + } + case 109: + yyDollar = yyS[yypt-3 : yypt+1] + //line go.y:918 + { + yyVAL.node = Nod(OAND, yyDollar[1].node, yyDollar[3].node) + } + case 110: + yyDollar = yyS[yypt-3 : yypt+1] + //line go.y:922 + { + yyVAL.node = Nod(OANDNOT, yyDollar[1].node, yyDollar[3].node) + } + case 111: + yyDollar = yyS[yypt-3 : yypt+1] + //line go.y:926 + { + yyVAL.node = Nod(OLSH, yyDollar[1].node, yyDollar[3].node) + } + case 112: + yyDollar = yyS[yypt-3 : yypt+1] + //line go.y:930 + { + yyVAL.node = Nod(ORSH, yyDollar[1].node, yyDollar[3].node) + } + case 113: + yyDollar = yyS[yypt-3 : yypt+1] + //line go.y:935 + { + yyVAL.node = Nod(OSEND, yyDollar[1].node, yyDollar[3].node) + } + case 115: + yyDollar = yyS[yypt-2 : yypt+1] + //line go.y:942 + { + yyVAL.node = Nod(OIND, yyDollar[2].node, nil) + } + case 116: + yyDollar = yyS[yypt-2 : yypt+1] + //line go.y:946 + { + if yyDollar[2].node.Op == OCOMPLIT { + // Special case for &T{...}: turn into (*T){...}. + yyVAL.node = yyDollar[2].node + yyVAL.node.Right = Nod(OIND, yyVAL.node.Right, nil) + yyVAL.node.Right.Implicit = true + } else { + yyVAL.node = Nod(OADDR, yyDollar[2].node, nil) + } + } + case 117: + yyDollar = yyS[yypt-2 : yypt+1] + //line go.y:957 + { + yyVAL.node = Nod(OPLUS, yyDollar[2].node, nil) + } + case 118: + yyDollar = yyS[yypt-2 : yypt+1] + //line go.y:961 + { + yyVAL.node = Nod(OMINUS, yyDollar[2].node, nil) + } + case 119: + yyDollar = yyS[yypt-2 : yypt+1] + //line go.y:965 + { + yyVAL.node = Nod(ONOT, yyDollar[2].node, nil) + } + case 120: + yyDollar = yyS[yypt-2 : yypt+1] + //line go.y:969 + { + Yyerror("the bitwise complement operator is ^") + yyVAL.node = Nod(OCOM, yyDollar[2].node, nil) + } + case 121: + yyDollar = yyS[yypt-2 : yypt+1] + //line go.y:974 + { + yyVAL.node = Nod(OCOM, yyDollar[2].node, nil) + } + case 122: + yyDollar = yyS[yypt-2 : yypt+1] + //line go.y:978 + { + yyVAL.node = Nod(ORECV, yyDollar[2].node, nil) + } + case 123: + yyDollar = yyS[yypt-3 : yypt+1] + //line go.y:988 + { + yyVAL.node = Nod(OCALL, yyDollar[1].node, nil) + } + case 124: + yyDollar = yyS[yypt-5 : yypt+1] + //line go.y:992 + { + yyVAL.node = Nod(OCALL, yyDollar[1].node, nil) + yyVAL.node.List = yyDollar[3].list + } + case 125: + yyDollar = yyS[yypt-6 : yypt+1] + //line go.y:997 + { + yyVAL.node = Nod(OCALL, yyDollar[1].node, nil) + yyVAL.node.List = yyDollar[3].list + yyVAL.node.Isddd = true + } + case 126: + yyDollar = yyS[yypt-1 : yypt+1] + //line go.y:1005 + { + yyVAL.node = nodlit(yyDollar[1].val) + } + case 128: + yyDollar = yyS[yypt-3 : yypt+1] + //line go.y:1010 + { + if yyDollar[1].node.Op == OPACK { + var s *Sym + s = restrictlookup(yyDollar[3].sym.Name, yyDollar[1].node.Name.Pkg) + yyDollar[1].node.Used = true + yyVAL.node = oldname(s) + break + } + yyVAL.node = Nod(OXDOT, yyDollar[1].node, newname(yyDollar[3].sym)) + } + case 129: + yyDollar = yyS[yypt-5 : yypt+1] + //line go.y:1021 + { + yyVAL.node = Nod(ODOTTYPE, yyDollar[1].node, yyDollar[4].node) + } + case 130: + yyDollar = yyS[yypt-5 : yypt+1] + //line go.y:1025 + { + yyVAL.node = Nod(OTYPESW, nil, yyDollar[1].node) + } + case 131: + yyDollar = yyS[yypt-4 : yypt+1] + //line go.y:1029 + { + yyVAL.node = Nod(OINDEX, yyDollar[1].node, yyDollar[3].node) + } + case 132: + yyDollar = yyS[yypt-6 : yypt+1] + //line go.y:1033 + { + yyVAL.node = Nod(OSLICE, yyDollar[1].node, Nod(OKEY, yyDollar[3].node, yyDollar[5].node)) + } + case 133: + yyDollar = yyS[yypt-8 : yypt+1] + //line go.y:1037 + { + if yyDollar[5].node == nil { + Yyerror("middle index required in 3-index slice") + } + if yyDollar[7].node == nil { + Yyerror("final index required in 3-index slice") + } + yyVAL.node = Nod(OSLICE3, yyDollar[1].node, Nod(OKEY, yyDollar[3].node, Nod(OKEY, yyDollar[5].node, yyDollar[7].node))) + } + case 135: + yyDollar = yyS[yypt-5 : yypt+1] + //line go.y:1048 + { + // conversion + yyVAL.node = Nod(OCALL, yyDollar[1].node, nil) + yyVAL.node.List = list1(yyDollar[3].node) + } + case 136: + yyDollar = yyS[yypt-5 : yypt+1] + //line go.y:1054 + { + yyVAL.node = yyDollar[3].node + yyVAL.node.Right = yyDollar[1].node + yyVAL.node.List = yyDollar[4].list + fixlbrace(yyDollar[2].i) + } + case 137: + yyDollar = yyS[yypt-5 : yypt+1] + //line go.y:1061 + { + yyVAL.node = yyDollar[3].node + yyVAL.node.Right = yyDollar[1].node + yyVAL.node.List = yyDollar[4].list + } + case 138: + yyDollar = yyS[yypt-7 : yypt+1] + //line go.y:1067 + { + Yyerror("cannot parenthesize type in composite literal") + yyVAL.node = yyDollar[5].node + yyVAL.node.Right = yyDollar[2].node + yyVAL.node.List = yyDollar[6].list + } + case 140: + yyDollar = yyS[yypt-0 : yypt+1] + //line go.y:1076 + { + // composite expression. + // make node early so we get the right line number. + yyVAL.node = Nod(OCOMPLIT, nil, nil) + } + case 141: + yyDollar = yyS[yypt-3 : yypt+1] + //line go.y:1084 + { + yyVAL.node = Nod(OKEY, yyDollar[1].node, yyDollar[3].node) + } + case 142: + yyDollar = yyS[yypt-1 : yypt+1] + //line go.y:1090 + { + // These nodes do not carry line numbers. + // Since a composite literal commonly spans several lines, + // the line number on errors may be misleading. + // Introduce a wrapper node to give the correct line. + yyVAL.node = yyDollar[1].node + switch yyVAL.node.Op { + case ONAME, ONONAME, OTYPE, OPACK, OLITERAL: + yyVAL.node = Nod(OPAREN, yyVAL.node, nil) + yyVAL.node.Implicit = true + } + } + case 143: + yyDollar = yyS[yypt-4 : yypt+1] + //line go.y:1103 + { + yyVAL.node = yyDollar[2].node + yyVAL.node.List = yyDollar[3].list + } + case 145: + yyDollar = yyS[yypt-4 : yypt+1] + //line go.y:1111 + { + yyVAL.node = yyDollar[2].node + yyVAL.node.List = yyDollar[3].list + } + case 147: + yyDollar = yyS[yypt-3 : yypt+1] + //line go.y:1119 + { + yyVAL.node = yyDollar[2].node + + // Need to know on lhs of := whether there are ( ). + // Don't bother with the OPAREN in other cases: + // it's just a waste of memory and time. + switch yyVAL.node.Op { + case ONAME, ONONAME, OPACK, OTYPE, OLITERAL, OTYPESW: + yyVAL.node = Nod(OPAREN, yyVAL.node, nil) + } + } + case 151: + yyDollar = yyS[yypt-1 : yypt+1] + //line go.y:1140 + { + yyVAL.i = LBODY + } + case 152: + yyDollar = yyS[yypt-1 : yypt+1] + //line go.y:1144 + { + yyVAL.i = '{' + } + case 153: + yyDollar = yyS[yypt-1 : yypt+1] + //line go.y:1155 + { + if yyDollar[1].sym == nil { + yyVAL.node = nil + } else { + yyVAL.node = newname(yyDollar[1].sym) + } + } + case 154: + yyDollar = yyS[yypt-1 : yypt+1] + //line go.y:1165 + { + yyVAL.node = dclname(yyDollar[1].sym) + } + case 155: + yyDollar = yyS[yypt-0 : yypt+1] + //line go.y:1170 + { + yyVAL.node = nil + } + case 157: + yyDollar = yyS[yypt-1 : yypt+1] + //line go.y:1177 + { + yyVAL.sym = yyDollar[1].sym + // during imports, unqualified non-exported identifiers are from builtinpkg + if importpkg != nil && !exportname(yyDollar[1].sym.Name) { + yyVAL.sym = Pkglookup(yyDollar[1].sym.Name, builtinpkg) + } + } + case 159: + yyDollar = yyS[yypt-1 : yypt+1] + //line go.y:1186 + { + yyVAL.sym = nil + } + case 160: + yyDollar = yyS[yypt-4 : yypt+1] + //line go.y:1192 + { + var p *Pkg + + if yyDollar[2].val.U.(string) == "" { + p = importpkg + } else { + if isbadimport(yyDollar[2].val.U.(string)) { + errorexit() + } + p = mkpkg(yyDollar[2].val.U.(string)) + } + yyVAL.sym = Pkglookup(yyDollar[4].sym.Name, p) + } + case 161: + yyDollar = yyS[yypt-4 : yypt+1] + //line go.y:1206 + { + var p *Pkg + + if yyDollar[2].val.U.(string) == "" { + p = importpkg + } else { + if isbadimport(yyDollar[2].val.U.(string)) { + errorexit() + } + p = mkpkg(yyDollar[2].val.U.(string)) + } + yyVAL.sym = Pkglookup("?", p) + } + case 162: + yyDollar = yyS[yypt-1 : yypt+1] + //line go.y:1222 + { + yyVAL.node = oldname(yyDollar[1].sym) + if yyVAL.node.Name != nil && yyVAL.node.Name.Pack != nil { + yyVAL.node.Name.Pack.Used = true + } + } + case 164: + yyDollar = yyS[yypt-1 : yypt+1] + //line go.y:1243 + { + Yyerror("final argument in variadic function missing type") + yyVAL.node = Nod(ODDD, typenod(typ(TINTER)), nil) + } + case 165: + yyDollar = yyS[yypt-2 : yypt+1] + //line go.y:1248 + { + yyVAL.node = Nod(ODDD, yyDollar[2].node, nil) + } + case 171: + yyDollar = yyS[yypt-3 : yypt+1] + //line go.y:1259 + { + yyVAL.node = yyDollar[2].node + } + case 175: + yyDollar = yyS[yypt-2 : yypt+1] + //line go.y:1268 + { + yyVAL.node = Nod(OIND, yyDollar[2].node, nil) + } + case 180: + yyDollar = yyS[yypt-3 : yypt+1] + //line go.y:1278 + { + yyVAL.node = yyDollar[2].node + } + case 190: + yyDollar = yyS[yypt-3 : yypt+1] + //line go.y:1299 + { + if yyDollar[1].node.Op == OPACK { + var s *Sym + s = restrictlookup(yyDollar[3].sym.Name, yyDollar[1].node.Name.Pkg) + yyDollar[1].node.Used = true + yyVAL.node = oldname(s) + break + } + yyVAL.node = Nod(OXDOT, yyDollar[1].node, newname(yyDollar[3].sym)) + } + case 191: + yyDollar = yyS[yypt-4 : yypt+1] + //line go.y:1312 + { + yyVAL.node = Nod(OTARRAY, yyDollar[2].node, yyDollar[4].node) + } + case 192: + yyDollar = yyS[yypt-4 : yypt+1] + //line go.y:1316 + { + // array literal of nelem + yyVAL.node = Nod(OTARRAY, Nod(ODDD, nil, nil), yyDollar[4].node) + } + case 193: + yyDollar = yyS[yypt-2 : yypt+1] + //line go.y:1321 + { + yyVAL.node = Nod(OTCHAN, yyDollar[2].node, nil) + yyVAL.node.Etype = Cboth + } + case 194: + yyDollar = yyS[yypt-3 : yypt+1] + //line go.y:1326 + { + yyVAL.node = Nod(OTCHAN, yyDollar[3].node, nil) + yyVAL.node.Etype = Csend + } + case 195: + yyDollar = yyS[yypt-5 : yypt+1] + //line go.y:1331 + { + yyVAL.node = Nod(OTMAP, yyDollar[3].node, yyDollar[5].node) + } + case 198: + yyDollar = yyS[yypt-2 : yypt+1] + //line go.y:1339 + { + yyVAL.node = Nod(OIND, yyDollar[2].node, nil) + } + case 199: + yyDollar = yyS[yypt-3 : yypt+1] + //line go.y:1345 + { + yyVAL.node = Nod(OTCHAN, yyDollar[3].node, nil) + yyVAL.node.Etype = Crecv + } + case 200: + yyDollar = yyS[yypt-5 : yypt+1] + //line go.y:1352 + { + yyVAL.node = Nod(OTSTRUCT, nil, nil) + yyVAL.node.List = yyDollar[3].list + fixlbrace(yyDollar[2].i) + } + case 201: + yyDollar = yyS[yypt-3 : yypt+1] + //line go.y:1358 + { + yyVAL.node = Nod(OTSTRUCT, nil, nil) + fixlbrace(yyDollar[2].i) + } + case 202: + yyDollar = yyS[yypt-5 : yypt+1] + //line go.y:1365 + { + yyVAL.node = Nod(OTINTER, nil, nil) + yyVAL.node.List = yyDollar[3].list + fixlbrace(yyDollar[2].i) + } + case 203: + yyDollar = yyS[yypt-3 : yypt+1] + //line go.y:1371 + { + yyVAL.node = Nod(OTINTER, nil, nil) + fixlbrace(yyDollar[2].i) + } + case 204: + yyDollar = yyS[yypt-3 : yypt+1] + //line go.y:1382 + { + yyVAL.node = yyDollar[2].node + if yyVAL.node == nil { + break + } + if noescape && yyDollar[3].list != nil { + Yyerror("can only use //go:noescape with external func implementations") + } + yyVAL.node.Nbody = yyDollar[3].list + yyVAL.node.Func.Endlineno = lineno + yyVAL.node.Noescape = noescape + yyVAL.node.Func.Norace = norace + yyVAL.node.Func.Nosplit = nosplit + yyVAL.node.Func.Nowritebarrier = nowritebarrier + yyVAL.node.Func.Systemstack = systemstack + funcbody(yyVAL.node) + } + case 205: + yyDollar = yyS[yypt-5 : yypt+1] + //line go.y:1402 + { + var t *Node + + yyVAL.node = nil + yyDollar[3].list = checkarglist(yyDollar[3].list, 1) + + if yyDollar[1].sym.Name == "init" { + yyDollar[1].sym = renameinit() + if yyDollar[3].list != nil || yyDollar[5].list != nil { + Yyerror("func init must have no arguments and no return values") + } + } + if localpkg.Name == "main" && yyDollar[1].sym.Name == "main" { + if yyDollar[3].list != nil || yyDollar[5].list != nil { + Yyerror("func main must have no arguments and no return values") + } + } + + t = Nod(OTFUNC, nil, nil) + t.List = yyDollar[3].list + t.Rlist = yyDollar[5].list + + yyVAL.node = Nod(ODCLFUNC, nil, nil) + yyVAL.node.Func.Nname = newfuncname(yyDollar[1].sym) + yyVAL.node.Func.Nname.Name.Defn = yyVAL.node + yyVAL.node.Func.Nname.Name.Param.Ntype = t // TODO: check if nname already has an ntype + declare(yyVAL.node.Func.Nname, PFUNC) + + funchdr(yyVAL.node) + } + case 206: + yyDollar = yyS[yypt-8 : yypt+1] + //line go.y:1433 + { + var rcvr, t *Node + + yyVAL.node = nil + yyDollar[2].list = checkarglist(yyDollar[2].list, 0) + yyDollar[6].list = checkarglist(yyDollar[6].list, 1) + + if yyDollar[2].list == nil { + Yyerror("method has no receiver") + break + } + if yyDollar[2].list.Next != nil { + Yyerror("method has multiple receivers") + break + } + rcvr = yyDollar[2].list.N + if rcvr.Op != ODCLFIELD { + Yyerror("bad receiver in method") + break + } + + t = Nod(OTFUNC, rcvr, nil) + t.List = yyDollar[6].list + t.Rlist = yyDollar[8].list + + yyVAL.node = Nod(ODCLFUNC, nil, nil) + yyVAL.node.Func.Shortname = newfuncname(yyDollar[4].sym) + yyVAL.node.Func.Nname = methodname1(yyVAL.node.Func.Shortname, rcvr.Right) + yyVAL.node.Func.Nname.Name.Defn = yyVAL.node + yyVAL.node.Func.Nname.Name.Param.Ntype = t + yyVAL.node.Func.Nname.Nointerface = nointerface + declare(yyVAL.node.Func.Nname, PFUNC) + + funchdr(yyVAL.node) + } + case 207: + yyDollar = yyS[yypt-5 : yypt+1] + //line go.y:1471 + { + var s *Sym + var t *Type + + yyVAL.node = nil + + s = yyDollar[1].sym + t = functype(nil, yyDollar[3].list, yyDollar[5].list) + + importsym(s, ONAME) + if s.Def != nil && s.Def.Op == ONAME { + if Eqtype(t, s.Def.Type) { + dclcontext = PDISCARD // since we skip funchdr below + break + } + Yyerror("inconsistent definition for func %v during import\n\t%v\n\t%v", s, s.Def.Type, t) + } + + yyVAL.node = newfuncname(s) + yyVAL.node.Type = t + declare(yyVAL.node, PFUNC) + + funchdr(yyVAL.node) + } + case 208: + yyDollar = yyS[yypt-8 : yypt+1] + //line go.y:1496 + { + yyVAL.node = methodname1(newname(yyDollar[4].sym), yyDollar[2].list.N.Right) + yyVAL.node.Type = functype(yyDollar[2].list.N, yyDollar[6].list, yyDollar[8].list) + + checkwidth(yyVAL.node.Type) + addmethod(yyDollar[4].sym, yyVAL.node.Type, false, nointerface) + nointerface = false + funchdr(yyVAL.node) + + // inl.C's inlnode in on a dotmeth node expects to find the inlineable body as + // (dotmeth's type).Nname.Inl, and dotmeth's type has been pulled + // out by typecheck's lookdot as this $$.ttype. So by providing + // this back link here we avoid special casing there. + yyVAL.node.Type.Nname = yyVAL.node + } + case 209: + yyDollar = yyS[yypt-5 : yypt+1] + //line go.y:1514 + { + yyDollar[3].list = checkarglist(yyDollar[3].list, 1) + yyVAL.node = Nod(OTFUNC, nil, nil) + yyVAL.node.List = yyDollar[3].list + yyVAL.node.Rlist = yyDollar[5].list + } + case 210: + yyDollar = yyS[yypt-0 : yypt+1] + //line go.y:1522 + { + yyVAL.list = nil + } + case 211: + yyDollar = yyS[yypt-3 : yypt+1] + //line go.y:1526 + { + yyVAL.list = yyDollar[2].list + if yyVAL.list == nil { + yyVAL.list = list1(Nod(OEMPTY, nil, nil)) + } + } + case 212: + yyDollar = yyS[yypt-0 : yypt+1] + //line go.y:1535 + { + yyVAL.list = nil + } + case 213: + yyDollar = yyS[yypt-1 : yypt+1] + //line go.y:1539 + { + yyVAL.list = list1(Nod(ODCLFIELD, nil, yyDollar[1].node)) + } + case 214: + yyDollar = yyS[yypt-3 : yypt+1] + //line go.y:1543 + { + yyDollar[2].list = checkarglist(yyDollar[2].list, 0) + yyVAL.list = yyDollar[2].list + } + case 215: + yyDollar = yyS[yypt-1 : yypt+1] + //line go.y:1550 + { + closurehdr(yyDollar[1].node) + } + case 216: + yyDollar = yyS[yypt-4 : yypt+1] + //line go.y:1556 + { + yyVAL.node = closurebody(yyDollar[3].list) + fixlbrace(yyDollar[2].i) + } + case 217: + yyDollar = yyS[yypt-2 : yypt+1] + //line go.y:1561 + { + yyVAL.node = closurebody(nil) + } + case 218: + yyDollar = yyS[yypt-0 : yypt+1] + //line go.y:1572 + { + yyVAL.list = nil + } + case 219: + yyDollar = yyS[yypt-3 : yypt+1] + //line go.y:1576 + { + yyVAL.list = concat(yyDollar[1].list, yyDollar[2].list) + if nsyntaxerrors == 0 { + testdclstack() + } + nointerface = false + noescape = false + norace = false + nosplit = false + nowritebarrier = false + systemstack = false + } + case 221: + yyDollar = yyS[yypt-3 : yypt+1] + //line go.y:1592 + { + yyVAL.list = concat(yyDollar[1].list, yyDollar[3].list) + } + case 223: + yyDollar = yyS[yypt-3 : yypt+1] + //line go.y:1599 + { + yyVAL.list = concat(yyDollar[1].list, yyDollar[3].list) + } + case 224: + yyDollar = yyS[yypt-1 : yypt+1] + //line go.y:1605 + { + yyVAL.list = list1(yyDollar[1].node) + } + case 225: + yyDollar = yyS[yypt-3 : yypt+1] + //line go.y:1609 + { + yyVAL.list = list(yyDollar[1].list, yyDollar[3].node) + } + case 227: + yyDollar = yyS[yypt-3 : yypt+1] + //line go.y:1616 + { + yyVAL.list = concat(yyDollar[1].list, yyDollar[3].list) + } + case 228: + yyDollar = yyS[yypt-1 : yypt+1] + //line go.y:1622 + { + yyVAL.list = list1(yyDollar[1].node) + } + case 229: + yyDollar = yyS[yypt-3 : yypt+1] + //line go.y:1626 + { + yyVAL.list = list(yyDollar[1].list, yyDollar[3].node) + } + case 230: + yyDollar = yyS[yypt-3 : yypt+1] + //line go.y:1632 + { + var l *NodeList + + var n *Node + l = yyDollar[1].list + if l == nil || l.N.Sym.Name == "?" { + // ? symbol, during import (list1(nil) == nil) + n = yyDollar[2].node + if n.Op == OIND { + n = n.Left + } + n = embedded(n.Sym, importpkg) + n.Right = yyDollar[2].node + n.SetVal(yyDollar[3].val) + yyVAL.list = list1(n) + break + } + + for l = yyDollar[1].list; l != nil; l = l.Next { + l.N = Nod(ODCLFIELD, l.N, yyDollar[2].node) + l.N.SetVal(yyDollar[3].val) + } + } + case 231: + yyDollar = yyS[yypt-2 : yypt+1] + //line go.y:1656 + { + yyDollar[1].node.SetVal(yyDollar[2].val) + yyVAL.list = list1(yyDollar[1].node) + } + case 232: + yyDollar = yyS[yypt-4 : yypt+1] + //line go.y:1661 + { + yyDollar[2].node.SetVal(yyDollar[4].val) + yyVAL.list = list1(yyDollar[2].node) + Yyerror("cannot parenthesize embedded type") + } + case 233: + yyDollar = yyS[yypt-3 : yypt+1] + //line go.y:1667 + { + yyDollar[2].node.Right = Nod(OIND, yyDollar[2].node.Right, nil) + yyDollar[2].node.SetVal(yyDollar[3].val) + yyVAL.list = list1(yyDollar[2].node) + } + case 234: + yyDollar = yyS[yypt-5 : yypt+1] + //line go.y:1673 + { + yyDollar[3].node.Right = Nod(OIND, yyDollar[3].node.Right, nil) + yyDollar[3].node.SetVal(yyDollar[5].val) + yyVAL.list = list1(yyDollar[3].node) + Yyerror("cannot parenthesize embedded type") + } + case 235: + yyDollar = yyS[yypt-5 : yypt+1] + //line go.y:1680 + { + yyDollar[3].node.Right = Nod(OIND, yyDollar[3].node.Right, nil) + yyDollar[3].node.SetVal(yyDollar[5].val) + yyVAL.list = list1(yyDollar[3].node) + Yyerror("cannot parenthesize embedded type") + } + case 236: + yyDollar = yyS[yypt-1 : yypt+1] + //line go.y:1689 + { + var n *Node + + yyVAL.sym = yyDollar[1].sym + n = oldname(yyDollar[1].sym) + if n.Name != nil && n.Name.Pack != nil { + n.Name.Pack.Used = true + } + } + case 237: + yyDollar = yyS[yypt-3 : yypt+1] + //line go.y:1699 + { + var pkg *Pkg + + if yyDollar[1].sym.Def == nil || yyDollar[1].sym.Def.Op != OPACK { + Yyerror("%v is not a package", yyDollar[1].sym) + pkg = localpkg + } else { + yyDollar[1].sym.Def.Used = true + pkg = yyDollar[1].sym.Def.Name.Pkg + } + yyVAL.sym = restrictlookup(yyDollar[3].sym.Name, pkg) + } + case 238: + yyDollar = yyS[yypt-1 : yypt+1] + //line go.y:1714 + { + yyVAL.node = embedded(yyDollar[1].sym, localpkg) + } + case 239: + yyDollar = yyS[yypt-2 : yypt+1] + //line go.y:1720 + { + yyVAL.node = Nod(ODCLFIELD, yyDollar[1].node, yyDollar[2].node) + ifacedcl(yyVAL.node) + } + case 240: + yyDollar = yyS[yypt-1 : yypt+1] + //line go.y:1725 + { + yyVAL.node = Nod(ODCLFIELD, nil, oldname(yyDollar[1].sym)) + } + case 241: + yyDollar = yyS[yypt-3 : yypt+1] + //line go.y:1729 + { + yyVAL.node = Nod(ODCLFIELD, nil, oldname(yyDollar[2].sym)) + Yyerror("cannot parenthesize embedded type") + } + case 242: + yyDollar = yyS[yypt-4 : yypt+1] + //line go.y:1736 + { + // without func keyword + yyDollar[2].list = checkarglist(yyDollar[2].list, 1) + yyVAL.node = Nod(OTFUNC, fakethis(), nil) + yyVAL.node.List = yyDollar[2].list + yyVAL.node.Rlist = yyDollar[4].list + } + case 244: + yyDollar = yyS[yypt-2 : yypt+1] + //line go.y:1750 + { + yyVAL.node = Nod(ONONAME, nil, nil) + yyVAL.node.Sym = yyDollar[1].sym + yyVAL.node = Nod(OKEY, yyVAL.node, yyDollar[2].node) + } + case 245: + yyDollar = yyS[yypt-2 : yypt+1] + //line go.y:1756 + { + yyVAL.node = Nod(ONONAME, nil, nil) + yyVAL.node.Sym = yyDollar[1].sym + yyVAL.node = Nod(OKEY, yyVAL.node, yyDollar[2].node) + } + case 247: + yyDollar = yyS[yypt-1 : yypt+1] + //line go.y:1765 + { + yyVAL.list = list1(yyDollar[1].node) + } + case 248: + yyDollar = yyS[yypt-3 : yypt+1] + //line go.y:1769 + { + yyVAL.list = list(yyDollar[1].list, yyDollar[3].node) + } + case 249: + yyDollar = yyS[yypt-0 : yypt+1] + //line go.y:1774 + { + yyVAL.list = nil + } + case 250: + yyDollar = yyS[yypt-2 : yypt+1] + //line go.y:1778 + { + yyVAL.list = yyDollar[1].list + } + case 251: + yyDollar = yyS[yypt-0 : yypt+1] + //line go.y:1786 + { + yyVAL.node = nil + } + case 253: + yyDollar = yyS[yypt-1 : yypt+1] + //line go.y:1791 + { + yyVAL.node = liststmt(yyDollar[1].list) + } + case 255: + yyDollar = yyS[yypt-1 : yypt+1] + //line go.y:1796 + { + yyVAL.node = nil + } + case 261: + yyDollar = yyS[yypt-2 : yypt+1] + //line go.y:1807 + { + yyDollar[1].node = Nod(OLABEL, yyDollar[1].node, nil) + yyDollar[1].node.Sym = dclstack // context, for goto restrictions + } + case 262: + yyDollar = yyS[yypt-4 : yypt+1] + //line go.y:1812 + { + var l *NodeList + + yyDollar[1].node.Name.Defn = yyDollar[4].node + l = list1(yyDollar[1].node) + if yyDollar[4].node != nil { + l = list(l, yyDollar[4].node) + } + yyVAL.node = liststmt(l) + } + case 263: + yyDollar = yyS[yypt-1 : yypt+1] + //line go.y:1823 + { + // will be converted to OFALL + yyVAL.node = Nod(OXFALL, nil, nil) + yyVAL.node.Xoffset = int64(block) + } + case 264: + yyDollar = yyS[yypt-2 : yypt+1] + //line go.y:1829 + { + yyVAL.node = Nod(OBREAK, yyDollar[2].node, nil) + } + case 265: + yyDollar = yyS[yypt-2 : yypt+1] + //line go.y:1833 + { + yyVAL.node = Nod(OCONTINUE, yyDollar[2].node, nil) + } + case 266: + yyDollar = yyS[yypt-2 : yypt+1] + //line go.y:1837 + { + yyVAL.node = Nod(OPROC, yyDollar[2].node, nil) + } + case 267: + yyDollar = yyS[yypt-2 : yypt+1] + //line go.y:1841 + { + yyVAL.node = Nod(ODEFER, yyDollar[2].node, nil) + } + case 268: + yyDollar = yyS[yypt-2 : yypt+1] + //line go.y:1845 + { + yyVAL.node = Nod(OGOTO, yyDollar[2].node, nil) + yyVAL.node.Sym = dclstack // context, for goto restrictions + } + case 269: + yyDollar = yyS[yypt-2 : yypt+1] + //line go.y:1850 + { + yyVAL.node = Nod(ORETURN, nil, nil) + yyVAL.node.List = yyDollar[2].list + if yyVAL.node.List == nil && Curfn != nil { + var l *NodeList + + for l = Curfn.Func.Dcl; l != nil; l = l.Next { + if l.N.Class == PPARAM { + continue + } + if l.N.Class != PPARAMOUT { + break + } + if l.N.Sym.Def != l.N { + Yyerror("%s is shadowed during return", l.N.Sym.Name) + } + } + } + } + case 270: + yyDollar = yyS[yypt-1 : yypt+1] + //line go.y:1872 + { + yyVAL.list = nil + if yyDollar[1].node != nil { + yyVAL.list = list1(yyDollar[1].node) + } + } + case 271: + yyDollar = yyS[yypt-3 : yypt+1] + //line go.y:1879 + { + yyVAL.list = yyDollar[1].list + if yyDollar[3].node != nil { + yyVAL.list = list(yyVAL.list, yyDollar[3].node) + } + } + case 272: + yyDollar = yyS[yypt-1 : yypt+1] + //line go.y:1888 + { + yyVAL.list = list1(yyDollar[1].node) + } + case 273: + yyDollar = yyS[yypt-3 : yypt+1] + //line go.y:1892 + { + yyVAL.list = list(yyDollar[1].list, yyDollar[3].node) + } + case 274: + yyDollar = yyS[yypt-1 : yypt+1] + //line go.y:1898 + { + yyVAL.list = list1(yyDollar[1].node) + } + case 275: + yyDollar = yyS[yypt-3 : yypt+1] + //line go.y:1902 + { + yyVAL.list = list(yyDollar[1].list, yyDollar[3].node) + } + case 276: + yyDollar = yyS[yypt-1 : yypt+1] + //line go.y:1908 + { + yyVAL.list = list1(yyDollar[1].node) + } + case 277: + yyDollar = yyS[yypt-3 : yypt+1] + //line go.y:1912 + { + yyVAL.list = list(yyDollar[1].list, yyDollar[3].node) + } + case 278: + yyDollar = yyS[yypt-1 : yypt+1] + //line go.y:1918 + { + yyVAL.list = list1(yyDollar[1].node) + } + case 279: + yyDollar = yyS[yypt-3 : yypt+1] + //line go.y:1922 + { + yyVAL.list = list(yyDollar[1].list, yyDollar[3].node) + } + case 280: + yyDollar = yyS[yypt-1 : yypt+1] + //line go.y:1931 + { + yyVAL.list = list1(yyDollar[1].node) + } + case 281: + yyDollar = yyS[yypt-1 : yypt+1] + //line go.y:1935 + { + yyVAL.list = list1(yyDollar[1].node) + } + case 282: + yyDollar = yyS[yypt-3 : yypt+1] + //line go.y:1939 + { + yyVAL.list = list(yyDollar[1].list, yyDollar[3].node) + } + case 283: + yyDollar = yyS[yypt-3 : yypt+1] + //line go.y:1943 + { + yyVAL.list = list(yyDollar[1].list, yyDollar[3].node) + } + case 284: + yyDollar = yyS[yypt-0 : yypt+1] + //line go.y:1948 + { + yyVAL.list = nil + } + case 285: + yyDollar = yyS[yypt-2 : yypt+1] + //line go.y:1952 + { + yyVAL.list = yyDollar[1].list + } + case 290: + yyDollar = yyS[yypt-0 : yypt+1] + //line go.y:1966 + { + yyVAL.node = nil + } + case 292: + yyDollar = yyS[yypt-0 : yypt+1] + //line go.y:1972 + { + yyVAL.list = nil + } + case 294: + yyDollar = yyS[yypt-0 : yypt+1] + //line go.y:1978 + { + yyVAL.node = nil + } + case 296: + yyDollar = yyS[yypt-0 : yypt+1] + //line go.y:1984 + { + yyVAL.list = nil + } + case 298: + yyDollar = yyS[yypt-0 : yypt+1] + //line go.y:1990 + { + yyVAL.list = nil + } + case 300: + yyDollar = yyS[yypt-0 : yypt+1] + //line go.y:1996 + { + yyVAL.list = nil + } + case 302: + yyDollar = yyS[yypt-0 : yypt+1] + //line go.y:2002 + { + yyVAL.val.U = nil + } + case 304: + yyDollar = yyS[yypt-4 : yypt+1] + //line go.y:2012 + { + importimport(yyDollar[2].sym, yyDollar[3].val.U.(string)) + } + case 305: + yyDollar = yyS[yypt-4 : yypt+1] + //line go.y:2016 + { + importvar(yyDollar[2].sym, yyDollar[3].typ) + } + case 306: + yyDollar = yyS[yypt-5 : yypt+1] + //line go.y:2020 + { + importconst(yyDollar[2].sym, Types[TIDEAL], yyDollar[4].node) + } + case 307: + yyDollar = yyS[yypt-6 : yypt+1] + //line go.y:2024 + { + importconst(yyDollar[2].sym, yyDollar[3].typ, yyDollar[5].node) + } + case 308: + yyDollar = yyS[yypt-4 : yypt+1] + //line go.y:2028 + { + importtype(yyDollar[2].typ, yyDollar[3].typ) + } + case 309: + yyDollar = yyS[yypt-4 : yypt+1] + //line go.y:2032 + { + if yyDollar[2].node == nil { + dclcontext = PEXTERN // since we skip the funcbody below + break + } + + yyDollar[2].node.Func.Inl = yyDollar[3].list + + funcbody(yyDollar[2].node) + importlist = list(importlist, yyDollar[2].node) + + if Debug['E'] > 0 { + fmt.Printf("import [%q] func %v \n", importpkg.Path, yyDollar[2].node) + if Debug['m'] > 2 && yyDollar[2].node.Func.Inl != nil { + fmt.Printf("inl body:%v\n", yyDollar[2].node.Func.Inl) + } + } + } + case 310: + yyDollar = yyS[yypt-1 : yypt+1] + //line go.y:2053 + { + yyVAL.sym = yyDollar[1].sym + structpkg = yyVAL.sym.Pkg + } + case 311: + yyDollar = yyS[yypt-1 : yypt+1] + //line go.y:2060 + { + yyVAL.typ = pkgtype(yyDollar[1].sym) + importsym(yyDollar[1].sym, OTYPE) + } + case 317: + yyDollar = yyS[yypt-1 : yypt+1] + //line go.y:2080 + { + yyVAL.typ = pkgtype(yyDollar[1].sym) + } + case 318: + yyDollar = yyS[yypt-1 : yypt+1] + //line go.y:2084 + { + // predefined name like uint8 + yyDollar[1].sym = Pkglookup(yyDollar[1].sym.Name, builtinpkg) + if yyDollar[1].sym.Def == nil || yyDollar[1].sym.Def.Op != OTYPE { + Yyerror("%s is not a type", yyDollar[1].sym.Name) + yyVAL.typ = nil + } else { + yyVAL.typ = yyDollar[1].sym.Def.Type + } + } + case 319: + yyDollar = yyS[yypt-3 : yypt+1] + //line go.y:2095 + { + yyVAL.typ = aindex(nil, yyDollar[3].typ) + } + case 320: + yyDollar = yyS[yypt-4 : yypt+1] + //line go.y:2099 + { + yyVAL.typ = aindex(nodlit(yyDollar[2].val), yyDollar[4].typ) + } + case 321: + yyDollar = yyS[yypt-5 : yypt+1] + //line go.y:2103 + { + yyVAL.typ = maptype(yyDollar[3].typ, yyDollar[5].typ) + } + case 322: + yyDollar = yyS[yypt-4 : yypt+1] + //line go.y:2107 + { + yyVAL.typ = tostruct(yyDollar[3].list) + } + case 323: + yyDollar = yyS[yypt-4 : yypt+1] + //line go.y:2111 + { + yyVAL.typ = tointerface(yyDollar[3].list) + } + case 324: + yyDollar = yyS[yypt-2 : yypt+1] + //line go.y:2115 + { + yyVAL.typ = Ptrto(yyDollar[2].typ) + } + case 325: + yyDollar = yyS[yypt-2 : yypt+1] + //line go.y:2119 + { + yyVAL.typ = typ(TCHAN) + yyVAL.typ.Type = yyDollar[2].typ + yyVAL.typ.Chan = Cboth + } + case 326: + yyDollar = yyS[yypt-4 : yypt+1] + //line go.y:2125 + { + yyVAL.typ = typ(TCHAN) + yyVAL.typ.Type = yyDollar[3].typ + yyVAL.typ.Chan = Cboth + } + case 327: + yyDollar = yyS[yypt-3 : yypt+1] + //line go.y:2131 + { + yyVAL.typ = typ(TCHAN) + yyVAL.typ.Type = yyDollar[3].typ + yyVAL.typ.Chan = Csend + } + case 328: + yyDollar = yyS[yypt-3 : yypt+1] + //line go.y:2139 + { + yyVAL.typ = typ(TCHAN) + yyVAL.typ.Type = yyDollar[3].typ + yyVAL.typ.Chan = Crecv + } + case 329: + yyDollar = yyS[yypt-5 : yypt+1] + //line go.y:2147 + { + yyVAL.typ = functype(nil, yyDollar[3].list, yyDollar[5].list) + } + case 330: + yyDollar = yyS[yypt-3 : yypt+1] + //line go.y:2153 + { + yyVAL.node = Nod(ODCLFIELD, nil, typenod(yyDollar[2].typ)) + if yyDollar[1].sym != nil { + yyVAL.node.Left = newname(yyDollar[1].sym) + } + yyVAL.node.SetVal(yyDollar[3].val) + } + case 331: + yyDollar = yyS[yypt-4 : yypt+1] + //line go.y:2161 + { + var t *Type + + t = typ(TARRAY) + t.Bound = -1 + t.Type = yyDollar[3].typ + + yyVAL.node = Nod(ODCLFIELD, nil, typenod(t)) + if yyDollar[1].sym != nil { + yyVAL.node.Left = newname(yyDollar[1].sym) + } + yyVAL.node.Isddd = true + yyVAL.node.SetVal(yyDollar[4].val) + } + case 332: + yyDollar = yyS[yypt-3 : yypt+1] + //line go.y:2178 + { + var s *Sym + var p *Pkg + + if yyDollar[1].sym != nil && yyDollar[1].sym.Name != "?" { + yyVAL.node = Nod(ODCLFIELD, newname(yyDollar[1].sym), typenod(yyDollar[2].typ)) + yyVAL.node.SetVal(yyDollar[3].val) + } else { + s = yyDollar[2].typ.Sym + if s == nil && Isptr[yyDollar[2].typ.Etype] { + s = yyDollar[2].typ.Type.Sym + } + p = importpkg + if yyDollar[1].sym != nil { + p = yyDollar[1].sym.Pkg + } + yyVAL.node = embedded(s, p) + yyVAL.node.Right = typenod(yyDollar[2].typ) + yyVAL.node.SetVal(yyDollar[3].val) + } + } + case 333: + yyDollar = yyS[yypt-5 : yypt+1] + //line go.y:2202 + { + yyVAL.node = Nod(ODCLFIELD, newname(yyDollar[1].sym), typenod(functype(fakethis(), yyDollar[3].list, yyDollar[5].list))) + } + case 334: + yyDollar = yyS[yypt-1 : yypt+1] + //line go.y:2206 + { + yyVAL.node = Nod(ODCLFIELD, nil, typenod(yyDollar[1].typ)) + } + case 335: + yyDollar = yyS[yypt-0 : yypt+1] + //line go.y:2211 + { + yyVAL.list = nil + } + case 337: + yyDollar = yyS[yypt-3 : yypt+1] + //line go.y:2218 + { + yyVAL.list = yyDollar[2].list + } + case 338: + yyDollar = yyS[yypt-1 : yypt+1] + //line go.y:2222 + { + yyVAL.list = list1(Nod(ODCLFIELD, nil, typenod(yyDollar[1].typ))) + } + case 339: + yyDollar = yyS[yypt-1 : yypt+1] + //line go.y:2232 + { + yyVAL.node = nodlit(yyDollar[1].val) + } + case 340: + yyDollar = yyS[yypt-2 : yypt+1] + //line go.y:2236 + { + yyVAL.node = nodlit(yyDollar[2].val) + switch yyVAL.node.Val().Ctype() { + case CTINT, CTRUNE: + mpnegfix(yyVAL.node.Val().U.(*Mpint)) + break + case CTFLT: + mpnegflt(yyVAL.node.Val().U.(*Mpflt)) + break + case CTCPLX: + mpnegflt(&yyVAL.node.Val().U.(*Mpcplx).Real) + mpnegflt(&yyVAL.node.Val().U.(*Mpcplx).Imag) + break + default: + Yyerror("bad negated constant") + } + } + case 341: + yyDollar = yyS[yypt-1 : yypt+1] + //line go.y:2254 + { + yyVAL.node = oldname(Pkglookup(yyDollar[1].sym.Name, builtinpkg)) + if yyVAL.node.Op != OLITERAL { + Yyerror("bad constant %v", yyVAL.node.Sym) + } + } + case 343: + yyDollar = yyS[yypt-5 : yypt+1] + //line go.y:2264 + { + if yyDollar[2].node.Val().Ctype() == CTRUNE && yyDollar[4].node.Val().Ctype() == CTINT { + yyVAL.node = yyDollar[2].node + mpaddfixfix(yyDollar[2].node.Val().U.(*Mpint), yyDollar[4].node.Val().U.(*Mpint), 0) + break + } + yyDollar[4].node.Val().U.(*Mpcplx).Real = yyDollar[4].node.Val().U.(*Mpcplx).Imag + Mpmovecflt(&yyDollar[4].node.Val().U.(*Mpcplx).Imag, 0.0) + yyVAL.node = nodcplxlit(yyDollar[2].node.Val(), yyDollar[4].node.Val()) + } + case 346: + yyDollar = yyS[yypt-1 : yypt+1] + //line go.y:2280 + { + yyVAL.list = list1(yyDollar[1].node) + } + case 347: + yyDollar = yyS[yypt-3 : yypt+1] + //line go.y:2284 + { + yyVAL.list = list(yyDollar[1].list, yyDollar[3].node) + } + case 348: + yyDollar = yyS[yypt-1 : yypt+1] + //line go.y:2290 + { + yyVAL.list = list1(yyDollar[1].node) + } + case 349: + yyDollar = yyS[yypt-3 : yypt+1] + //line go.y:2294 + { + yyVAL.list = list(yyDollar[1].list, yyDollar[3].node) + } + case 350: + yyDollar = yyS[yypt-1 : yypt+1] + //line go.y:2300 + { + yyVAL.list = list1(yyDollar[1].node) + } + case 351: + yyDollar = yyS[yypt-3 : yypt+1] + //line go.y:2304 + { + yyVAL.list = list(yyDollar[1].list, yyDollar[3].node) + } + } + goto yystack /* stack new state and value */ +} diff --git a/src/cmd/compile/internal/ppc64/cgen.go b/src/cmd/compile/internal/ppc64/cgen.go new file mode 100644 index 0000000000000000000000000000000000000000..37dd6cefb27c8fc65c48825bf7eba7dd8dd292db --- /dev/null +++ b/src/cmd/compile/internal/ppc64/cgen.go @@ -0,0 +1,149 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package ppc64 + +import ( + "cmd/compile/internal/gc" + "cmd/internal/obj" + "cmd/internal/obj/ppc64" +) + +func blockcopy(n, res *gc.Node, osrc, odst, w int64) { + // determine alignment. + // want to avoid unaligned access, so have to use + // smaller operations for less aligned types. + // for example moving [4]byte must use 4 MOVB not 1 MOVW. + align := int(n.Type.Align) + + var op int + switch align { + default: + gc.Fatal("sgen: invalid alignment %d for %v", align, n.Type) + + case 1: + op = ppc64.AMOVBU + + case 2: + op = ppc64.AMOVHU + + case 4: + op = ppc64.AMOVWZU // there is no lwau, only lwaux + + case 8: + op = ppc64.AMOVDU + } + + if w%int64(align) != 0 { + gc.Fatal("sgen: unaligned size %d (align=%d) for %v", w, align, n.Type) + } + c := int32(w / int64(align)) + + // if we are copying forward on the stack and + // the src and dst overlap, then reverse direction + dir := align + + if osrc < odst && int64(odst) < int64(osrc)+w { + dir = -dir + } + + var dst gc.Node + var src gc.Node + if n.Ullman >= res.Ullman { + gc.Agenr(n, &dst, res) // temporarily use dst + gc.Regalloc(&src, gc.Types[gc.Tptr], nil) + gins(ppc64.AMOVD, &dst, &src) + if res.Op == gc.ONAME { + gc.Gvardef(res) + } + gc.Agen(res, &dst) + } else { + if res.Op == gc.ONAME { + gc.Gvardef(res) + } + gc.Agenr(res, &dst, res) + gc.Agenr(n, &src, nil) + } + + var tmp gc.Node + gc.Regalloc(&tmp, gc.Types[gc.Tptr], nil) + + // set up end marker + var nend gc.Node + + // move src and dest to the end of block if necessary + if dir < 0 { + if c >= 4 { + gc.Regalloc(&nend, gc.Types[gc.Tptr], nil) + gins(ppc64.AMOVD, &src, &nend) + } + + p := gins(ppc64.AADD, nil, &src) + p.From.Type = obj.TYPE_CONST + p.From.Offset = w + + p = gins(ppc64.AADD, nil, &dst) + p.From.Type = obj.TYPE_CONST + p.From.Offset = w + } else { + p := gins(ppc64.AADD, nil, &src) + p.From.Type = obj.TYPE_CONST + p.From.Offset = int64(-dir) + + p = gins(ppc64.AADD, nil, &dst) + p.From.Type = obj.TYPE_CONST + p.From.Offset = int64(-dir) + + if c >= 4 { + gc.Regalloc(&nend, gc.Types[gc.Tptr], nil) + p := gins(ppc64.AMOVD, &src, &nend) + p.From.Type = obj.TYPE_ADDR + p.From.Offset = w + } + } + + // move + // TODO: enable duffcopy for larger copies. + if c >= 4 { + p := gins(op, &src, &tmp) + p.From.Type = obj.TYPE_MEM + p.From.Offset = int64(dir) + ploop := p + + p = gins(op, &tmp, &dst) + p.To.Type = obj.TYPE_MEM + p.To.Offset = int64(dir) + + p = gins(ppc64.ACMP, &src, &nend) + + gc.Patch(gc.Gbranch(ppc64.ABNE, nil, 0), ploop) + gc.Regfree(&nend) + } else { + // TODO(austin): Instead of generating ADD $-8,R8; ADD + // $-8,R7; n*(MOVDU 8(R8),R9; MOVDU R9,8(R7);) just + // generate the offsets directly and eliminate the + // ADDs. That will produce shorter, more + // pipeline-able code. + var p *obj.Prog + for { + tmp14 := c + c-- + if tmp14 <= 0 { + break + } + + p = gins(op, &src, &tmp) + p.From.Type = obj.TYPE_MEM + p.From.Offset = int64(dir) + + p = gins(op, &tmp, &dst) + p.To.Type = obj.TYPE_MEM + p.To.Offset = int64(dir) + } + } + + gc.Regfree(&dst) + gc.Regfree(&src) + gc.Regfree(&tmp) +} diff --git a/src/cmd/compile/internal/ppc64/galign.go b/src/cmd/compile/internal/ppc64/galign.go new file mode 100644 index 0000000000000000000000000000000000000000..73aef6fde9423564ea6690703fa4daee540b16ad --- /dev/null +++ b/src/cmd/compile/internal/ppc64/galign.go @@ -0,0 +1,100 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package ppc64 + +import ( + "cmd/compile/internal/gc" + "cmd/internal/obj" + "cmd/internal/obj/ppc64" +) + +var thechar int = '9' + +var thestring string = "ppc64" + +var thelinkarch *obj.LinkArch + +func linkarchinit() { + thestring = obj.Getgoarch() + gc.Thearch.Thestring = thestring + if thestring == "ppc64le" { + thelinkarch = &ppc64.Linkppc64le + } else { + thelinkarch = &ppc64.Linkppc64 + } + gc.Thearch.Thelinkarch = thelinkarch +} + +var MAXWIDTH int64 = 1 << 50 + +/* + * go declares several platform-specific type aliases: + * int, uint, and uintptr + */ +var typedefs = []gc.Typedef{ + gc.Typedef{"int", gc.TINT, gc.TINT64}, + gc.Typedef{"uint", gc.TUINT, gc.TUINT64}, + gc.Typedef{"uintptr", gc.TUINTPTR, gc.TUINT64}, +} + +func betypeinit() { + gc.Widthptr = 8 + gc.Widthint = 8 + gc.Widthreg = 8 +} + +func Main() { + gc.Thearch.Thechar = thechar + gc.Thearch.Thestring = thestring + gc.Thearch.Thelinkarch = thelinkarch + gc.Thearch.Typedefs = typedefs + gc.Thearch.REGSP = ppc64.REGSP + gc.Thearch.REGCTXT = ppc64.REGCTXT + gc.Thearch.REGCALLX = ppc64.REG_R3 + gc.Thearch.REGCALLX2 = ppc64.REG_R4 + gc.Thearch.REGRETURN = ppc64.REG_R3 + gc.Thearch.REGMIN = ppc64.REG_R0 + gc.Thearch.REGMAX = ppc64.REG_R31 + gc.Thearch.FREGMIN = ppc64.REG_F0 + gc.Thearch.FREGMAX = ppc64.REG_F31 + gc.Thearch.MAXWIDTH = MAXWIDTH + gc.Thearch.ReservedRegs = resvd + + gc.Thearch.Betypeinit = betypeinit + gc.Thearch.Cgen_hmul = cgen_hmul + gc.Thearch.Cgen_shift = cgen_shift + gc.Thearch.Clearfat = clearfat + gc.Thearch.Defframe = defframe + gc.Thearch.Dodiv = dodiv + gc.Thearch.Excise = excise + gc.Thearch.Expandchecks = expandchecks + gc.Thearch.Getg = getg + gc.Thearch.Gins = gins + gc.Thearch.Ginscmp = ginscmp + gc.Thearch.Ginscon = ginscon + gc.Thearch.Ginsnop = ginsnop + gc.Thearch.Gmove = gmove + gc.Thearch.Linkarchinit = linkarchinit + gc.Thearch.Peep = peep + gc.Thearch.Proginfo = proginfo + gc.Thearch.Regtyp = regtyp + gc.Thearch.Sameaddr = sameaddr + gc.Thearch.Smallindir = smallindir + gc.Thearch.Stackaddr = stackaddr + gc.Thearch.Blockcopy = blockcopy + gc.Thearch.Sudoaddable = sudoaddable + gc.Thearch.Sudoclean = sudoclean + gc.Thearch.Excludedregs = excludedregs + gc.Thearch.RtoB = RtoB + gc.Thearch.FtoB = RtoB + gc.Thearch.BtoR = BtoR + gc.Thearch.BtoF = BtoF + gc.Thearch.Optoas = optoas + gc.Thearch.Doregbits = doregbits + gc.Thearch.Regnames = regnames + + gc.Main() + gc.Exit(0) +} diff --git a/src/cmd/compile/internal/ppc64/ggen.go b/src/cmd/compile/internal/ppc64/ggen.go new file mode 100644 index 0000000000000000000000000000000000000000..5b282eb2f250423f14a84dda7e3801968ad533db --- /dev/null +++ b/src/cmd/compile/internal/ppc64/ggen.go @@ -0,0 +1,564 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package ppc64 + +import ( + "cmd/compile/internal/gc" + "cmd/internal/obj" + "cmd/internal/obj/ppc64" + "fmt" +) + +func defframe(ptxt *obj.Prog) { + var n *gc.Node + + // fill in argument size, stack size + ptxt.To.Type = obj.TYPE_TEXTSIZE + + ptxt.To.Val = int32(gc.Rnd(gc.Curfn.Type.Argwid, int64(gc.Widthptr))) + frame := uint32(gc.Rnd(gc.Stksize+gc.Maxarg, int64(gc.Widthreg))) + ptxt.To.Offset = int64(frame) + + // insert code to zero ambiguously live variables + // so that the garbage collector only sees initialized values + // when it looks for pointers. + p := ptxt + + hi := int64(0) + lo := hi + + // iterate through declarations - they are sorted in decreasing xoffset order. + for l := gc.Curfn.Func.Dcl; l != nil; l = l.Next { + n = l.N + if !n.Name.Needzero { + continue + } + if n.Class != gc.PAUTO { + gc.Fatal("needzero class %d", n.Class) + } + if n.Type.Width%int64(gc.Widthptr) != 0 || n.Xoffset%int64(gc.Widthptr) != 0 || n.Type.Width == 0 { + gc.Fatal("var %v has size %d offset %d", gc.Nconv(n, obj.FmtLong), int(n.Type.Width), int(n.Xoffset)) + } + + if lo != hi && n.Xoffset+n.Type.Width >= lo-int64(2*gc.Widthreg) { + // merge with range we already have + lo = n.Xoffset + + continue + } + + // zero old range + p = zerorange(p, int64(frame), lo, hi) + + // set new range + hi = n.Xoffset + n.Type.Width + + lo = n.Xoffset + } + + // zero final range + zerorange(p, int64(frame), lo, hi) +} + +func zerorange(p *obj.Prog, frame int64, lo int64, hi int64) *obj.Prog { + cnt := hi - lo + if cnt == 0 { + return p + } + if cnt < int64(4*gc.Widthptr) { + for i := int64(0); i < cnt; i += int64(gc.Widthptr) { + p = appendpp(p, ppc64.AMOVD, obj.TYPE_REG, ppc64.REGZERO, 0, obj.TYPE_MEM, ppc64.REGSP, 8+frame+lo+i) + } + // TODO(dfc): https://golang.org/issue/12108 + // If DUFFZERO is used inside a tail call (see genwrapper) it will + // overwrite the link register. + } else if false && cnt <= int64(128*gc.Widthptr) { + p = appendpp(p, ppc64.AADD, obj.TYPE_CONST, 0, 8+frame+lo-8, obj.TYPE_REG, ppc64.REGRT1, 0) + p.Reg = ppc64.REGSP + p = appendpp(p, obj.ADUFFZERO, obj.TYPE_NONE, 0, 0, obj.TYPE_MEM, 0, 0) + f := gc.Sysfunc("duffzero") + gc.Naddr(&p.To, f) + gc.Afunclit(&p.To, f) + p.To.Offset = 4 * (128 - cnt/int64(gc.Widthptr)) + } else { + p = appendpp(p, ppc64.AMOVD, obj.TYPE_CONST, 0, 8+frame+lo-8, obj.TYPE_REG, ppc64.REGTMP, 0) + p = appendpp(p, ppc64.AADD, obj.TYPE_REG, ppc64.REGTMP, 0, obj.TYPE_REG, ppc64.REGRT1, 0) + p.Reg = ppc64.REGSP + p = appendpp(p, ppc64.AMOVD, obj.TYPE_CONST, 0, cnt, obj.TYPE_REG, ppc64.REGTMP, 0) + p = appendpp(p, ppc64.AADD, obj.TYPE_REG, ppc64.REGTMP, 0, obj.TYPE_REG, ppc64.REGRT2, 0) + p.Reg = ppc64.REGRT1 + p = appendpp(p, ppc64.AMOVDU, obj.TYPE_REG, ppc64.REGZERO, 0, obj.TYPE_MEM, ppc64.REGRT1, int64(gc.Widthptr)) + p1 := p + p = appendpp(p, ppc64.ACMP, obj.TYPE_REG, ppc64.REGRT1, 0, obj.TYPE_REG, ppc64.REGRT2, 0) + p = appendpp(p, ppc64.ABNE, obj.TYPE_NONE, 0, 0, obj.TYPE_BRANCH, 0, 0) + gc.Patch(p, p1) + } + + return p +} + +func appendpp(p *obj.Prog, as int, ftype int, freg int, foffset int64, ttype int, treg int, toffset int64) *obj.Prog { + q := gc.Ctxt.NewProg() + gc.Clearp(q) + q.As = int16(as) + q.Lineno = p.Lineno + q.From.Type = int16(ftype) + q.From.Reg = int16(freg) + q.From.Offset = foffset + q.To.Type = int16(ttype) + q.To.Reg = int16(treg) + q.To.Offset = toffset + q.Link = p.Link + p.Link = q + return q +} + +func ginsnop() { + var reg gc.Node + gc.Nodreg(®, gc.Types[gc.TINT], ppc64.REG_R0) + gins(ppc64.AOR, ®, ®) +} + +var panicdiv *gc.Node + +/* + * generate division. + * generates one of: + * res = nl / nr + * res = nl % nr + * according to op. + */ +func dodiv(op int, nl *gc.Node, nr *gc.Node, res *gc.Node) { + // Have to be careful about handling + // most negative int divided by -1 correctly. + // The hardware will generate undefined result. + // Also need to explicitly trap on division on zero, + // the hardware will silently generate undefined result. + // DIVW will leave unpredicable result in higher 32-bit, + // so always use DIVD/DIVDU. + t := nl.Type + + t0 := t + check := 0 + if gc.Issigned[t.Etype] { + check = 1 + if gc.Isconst(nl, gc.CTINT) && nl.Int() != -(1<= nr.Ullman { + gc.Cgen(nl, &tl) + gc.Cgen(nr, &tr) + } else { + gc.Cgen(nr, &tr) + gc.Cgen(nl, &tl) + } + + if t != t0 { + // Convert + tl2 := tl + + tr2 := tr + tl.Type = t + tr.Type = t + gmove(&tl2, &tl) + gmove(&tr2, &tr) + } + + // Handle divide-by-zero panic. + p1 := gins(optoas(gc.OCMP, t), &tr, nil) + + p1.To.Type = obj.TYPE_REG + p1.To.Reg = ppc64.REGZERO + p1 = gc.Gbranch(optoas(gc.ONE, t), nil, +1) + if panicdiv == nil { + panicdiv = gc.Sysfunc("panicdivide") + } + gc.Ginscall(panicdiv, -1) + gc.Patch(p1, gc.Pc) + + var p2 *obj.Prog + if check != 0 { + var nm1 gc.Node + gc.Nodconst(&nm1, t, -1) + gins(optoas(gc.OCMP, t), &tr, &nm1) + p1 := gc.Gbranch(optoas(gc.ONE, t), nil, +1) + if op == gc.ODIV { + // a / (-1) is -a. + gins(optoas(gc.OMINUS, t), nil, &tl) + + gmove(&tl, res) + } else { + // a % (-1) is 0. + var nz gc.Node + gc.Nodconst(&nz, t, 0) + + gmove(&nz, res) + } + + p2 = gc.Gbranch(obj.AJMP, nil, 0) + gc.Patch(p1, gc.Pc) + } + + p1 = gins(a, &tr, &tl) + if op == gc.ODIV { + gc.Regfree(&tr) + gmove(&tl, res) + } else { + // A%B = A-(A/B*B) + var tm gc.Node + gc.Regalloc(&tm, t, nil) + + // patch div to use the 3 register form + // TODO(minux): add gins3? + p1.Reg = p1.To.Reg + + p1.To.Reg = tm.Reg + gins(optoas(gc.OMUL, t), &tr, &tm) + gc.Regfree(&tr) + gins(optoas(gc.OSUB, t), &tm, &tl) + gc.Regfree(&tm) + gmove(&tl, res) + } + + gc.Regfree(&tl) + if check != 0 { + gc.Patch(p2, gc.Pc) + } +} + +/* + * generate high multiply: + * res = (nl*nr) >> width + */ +func cgen_hmul(nl *gc.Node, nr *gc.Node, res *gc.Node) { + // largest ullman on left. + if nl.Ullman < nr.Ullman { + tmp := (*gc.Node)(nl) + nl = nr + nr = tmp + } + + t := (*gc.Type)(nl.Type) + w := int(int(t.Width * 8)) + var n1 gc.Node + gc.Cgenr(nl, &n1, res) + var n2 gc.Node + gc.Cgenr(nr, &n2, nil) + switch gc.Simtype[t.Etype] { + case gc.TINT8, + gc.TINT16, + gc.TINT32: + gins(optoas(gc.OMUL, t), &n2, &n1) + p := (*obj.Prog)(gins(ppc64.ASRAD, nil, &n1)) + p.From.Type = obj.TYPE_CONST + p.From.Offset = int64(w) + + case gc.TUINT8, + gc.TUINT16, + gc.TUINT32: + gins(optoas(gc.OMUL, t), &n2, &n1) + p := (*obj.Prog)(gins(ppc64.ASRD, nil, &n1)) + p.From.Type = obj.TYPE_CONST + p.From.Offset = int64(w) + + case gc.TINT64, + gc.TUINT64: + if gc.Issigned[t.Etype] { + gins(ppc64.AMULHD, &n2, &n1) + } else { + gins(ppc64.AMULHDU, &n2, &n1) + } + + default: + gc.Fatal("cgen_hmul %v", t) + } + + gc.Cgen(&n1, res) + gc.Regfree(&n1) + gc.Regfree(&n2) +} + +/* + * generate shift according to op, one of: + * res = nl << nr + * res = nl >> nr + */ +func cgen_shift(op int, bounded bool, nl *gc.Node, nr *gc.Node, res *gc.Node) { + a := int(optoas(op, nl.Type)) + + if nr.Op == gc.OLITERAL { + var n1 gc.Node + gc.Regalloc(&n1, nl.Type, res) + gc.Cgen(nl, &n1) + sc := uint64(nr.Int()) + if sc >= uint64(nl.Type.Width*8) { + // large shift gets 2 shifts by width-1 + var n3 gc.Node + gc.Nodconst(&n3, gc.Types[gc.TUINT32], nl.Type.Width*8-1) + + gins(a, &n3, &n1) + gins(a, &n3, &n1) + } else { + gins(a, nr, &n1) + } + gmove(&n1, res) + gc.Regfree(&n1) + return + } + + if nl.Ullman >= gc.UINF { + var n4 gc.Node + gc.Tempname(&n4, nl.Type) + gc.Cgen(nl, &n4) + nl = &n4 + } + + if nr.Ullman >= gc.UINF { + var n5 gc.Node + gc.Tempname(&n5, nr.Type) + gc.Cgen(nr, &n5) + nr = &n5 + } + + // Allow either uint32 or uint64 as shift type, + // to avoid unnecessary conversion from uint32 to uint64 + // just to do the comparison. + tcount := gc.Types[gc.Simtype[nr.Type.Etype]] + + if tcount.Etype < gc.TUINT32 { + tcount = gc.Types[gc.TUINT32] + } + + var n1 gc.Node + gc.Regalloc(&n1, nr.Type, nil) // to hold the shift type in CX + var n3 gc.Node + gc.Regalloc(&n3, tcount, &n1) // to clear high bits of CX + + var n2 gc.Node + gc.Regalloc(&n2, nl.Type, res) + + if nl.Ullman >= nr.Ullman { + gc.Cgen(nl, &n2) + gc.Cgen(nr, &n1) + gmove(&n1, &n3) + } else { + gc.Cgen(nr, &n1) + gmove(&n1, &n3) + gc.Cgen(nl, &n2) + } + + gc.Regfree(&n3) + + // test and fix up large shifts + if !bounded { + gc.Nodconst(&n3, tcount, nl.Type.Width*8) + gins(optoas(gc.OCMP, tcount), &n1, &n3) + p1 := (*obj.Prog)(gc.Gbranch(optoas(gc.OLT, tcount), nil, +1)) + if op == gc.ORSH && gc.Issigned[nl.Type.Etype] { + gc.Nodconst(&n3, gc.Types[gc.TUINT32], nl.Type.Width*8-1) + gins(a, &n3, &n2) + } else { + gc.Nodconst(&n3, nl.Type, 0) + gmove(&n3, &n2) + } + + gc.Patch(p1, gc.Pc) + } + + gins(a, &n1, &n2) + + gmove(&n2, res) + + gc.Regfree(&n1) + gc.Regfree(&n2) +} + +func clearfat(nl *gc.Node) { + /* clear a fat object */ + if gc.Debug['g'] != 0 { + fmt.Printf("clearfat %v (%v, size: %d)\n", nl, nl.Type, nl.Type.Width) + } + + w := uint64(uint64(nl.Type.Width)) + + // Avoid taking the address for simple enough types. + if gc.Componentgen(nil, nl) { + return + } + + c := uint64(w % 8) // bytes + q := uint64(w / 8) // dwords + + if gc.Reginuse(ppc64.REGRT1) { + gc.Fatal("%v in use during clearfat", obj.Rconv(ppc64.REGRT1)) + } + + var r0 gc.Node + gc.Nodreg(&r0, gc.Types[gc.TUINT64], ppc64.REGZERO) + var dst gc.Node + gc.Nodreg(&dst, gc.Types[gc.Tptr], ppc64.REGRT1) + gc.Regrealloc(&dst) + gc.Agen(nl, &dst) + + var boff uint64 + if q > 128 { + p := gins(ppc64.ASUB, nil, &dst) + p.From.Type = obj.TYPE_CONST + p.From.Offset = 8 + + var end gc.Node + gc.Regalloc(&end, gc.Types[gc.Tptr], nil) + p = gins(ppc64.AMOVD, &dst, &end) + p.From.Type = obj.TYPE_ADDR + p.From.Offset = int64(q * 8) + + p = gins(ppc64.AMOVDU, &r0, &dst) + p.To.Type = obj.TYPE_MEM + p.To.Offset = 8 + pl := (*obj.Prog)(p) + + p = gins(ppc64.ACMP, &dst, &end) + gc.Patch(gc.Gbranch(ppc64.ABNE, nil, 0), pl) + + gc.Regfree(&end) + + // The loop leaves R3 on the last zeroed dword + boff = 8 + // TODO(dfc): https://golang.org/issue/12108 + // If DUFFZERO is used inside a tail call (see genwrapper) it will + // overwrite the link register. + } else if false && q >= 4 { + p := gins(ppc64.ASUB, nil, &dst) + p.From.Type = obj.TYPE_CONST + p.From.Offset = 8 + f := (*gc.Node)(gc.Sysfunc("duffzero")) + p = gins(obj.ADUFFZERO, nil, f) + gc.Afunclit(&p.To, f) + + // 4 and 128 = magic constants: see ../../runtime/asm_ppc64x.s + p.To.Offset = int64(4 * (128 - q)) + + // duffzero leaves R3 on the last zeroed dword + boff = 8 + } else { + var p *obj.Prog + for t := uint64(0); t < q; t++ { + p = gins(ppc64.AMOVD, &r0, &dst) + p.To.Type = obj.TYPE_MEM + p.To.Offset = int64(8 * t) + } + + boff = 8 * q + } + + var p *obj.Prog + for t := uint64(0); t < c; t++ { + p = gins(ppc64.AMOVB, &r0, &dst) + p.To.Type = obj.TYPE_MEM + p.To.Offset = int64(t + boff) + } + + gc.Regfree(&dst) +} + +// Called after regopt and peep have run. +// Expand CHECKNIL pseudo-op into actual nil pointer check. +func expandchecks(firstp *obj.Prog) { + var p1 *obj.Prog + var p2 *obj.Prog + + for p := (*obj.Prog)(firstp); p != nil; p = p.Link { + if gc.Debug_checknil != 0 && gc.Ctxt.Debugvlog != 0 { + fmt.Printf("expandchecks: %v\n", p) + } + if p.As != obj.ACHECKNIL { + continue + } + if gc.Debug_checknil != 0 && p.Lineno > 1 { // p->lineno==1 in generated wrappers + gc.Warnl(int(p.Lineno), "generated nil check") + } + if p.From.Type != obj.TYPE_REG { + gc.Fatal("invalid nil check %v\n", p) + } + + /* + // check is + // TD $4, R0, arg (R0 is always zero) + // eqv. to: + // tdeq r0, arg + // NOTE: this needs special runtime support to make SIGTRAP recoverable. + reg = p->from.reg; + p->as = ATD; + p->from = p->to = p->from3 = zprog.from; + p->from.type = TYPE_CONST; + p->from.offset = 4; + p->from.reg = 0; + p->reg = REGZERO; + p->to.type = TYPE_REG; + p->to.reg = reg; + */ + // check is + // CMP arg, R0 + // BNE 2(PC) [likely] + // MOVD R0, 0(R0) + p1 = gc.Ctxt.NewProg() + + p2 = gc.Ctxt.NewProg() + gc.Clearp(p1) + gc.Clearp(p2) + p1.Link = p2 + p2.Link = p.Link + p.Link = p1 + p1.Lineno = p.Lineno + p2.Lineno = p.Lineno + p1.Pc = 9999 + p2.Pc = 9999 + p.As = ppc64.ACMP + p.To.Type = obj.TYPE_REG + p.To.Reg = ppc64.REGZERO + p1.As = ppc64.ABNE + + //p1->from.type = TYPE_CONST; + //p1->from.offset = 1; // likely + p1.To.Type = obj.TYPE_BRANCH + + p1.To.Val = p2.Link + + // crash by write to memory address 0. + p2.As = ppc64.AMOVD + + p2.From.Type = obj.TYPE_REG + p2.From.Reg = ppc64.REGZERO + p2.To.Type = obj.TYPE_MEM + p2.To.Reg = ppc64.REGZERO + p2.To.Offset = 0 + } +} + +// res = runtime.getg() +func getg(res *gc.Node) { + var n1 gc.Node + gc.Nodreg(&n1, res.Type, ppc64.REGG) + gmove(&n1, res) +} diff --git a/src/cmd/compile/internal/ppc64/gsubr.go b/src/cmd/compile/internal/ppc64/gsubr.go new file mode 100644 index 0000000000000000000000000000000000000000..2501972846ff968d37322525d6dc8b461e24c5a3 --- /dev/null +++ b/src/cmd/compile/internal/ppc64/gsubr.go @@ -0,0 +1,1031 @@ +// Derived from Inferno utils/6c/txt.c +// http://code.google.com/p/inferno-os/source/browse/utils/6c/txt.c +// +// Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved. +// Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net) +// Portions Copyright © 1997-1999 Vita Nuova Limited +// Portions Copyright © 2000-2007 Vita Nuova Holdings Limited (www.vitanuova.com) +// Portions Copyright © 2004,2006 Bruce Ellis +// Portions Copyright © 2005-2007 C H Forsyth (forsyth@terzarima.net) +// Revisions Copyright © 2000-2007 Lucent Technologies Inc. and others +// Portions Copyright © 2009 The Go Authors. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +package ppc64 + +import ( + "cmd/compile/internal/big" + "cmd/compile/internal/gc" + "cmd/internal/obj" + "cmd/internal/obj/ppc64" + "fmt" +) + +var resvd = []int{ + ppc64.REGZERO, + ppc64.REGSP, // reserved for SP + // We need to preserve the C ABI TLS pointer because sigtramp + // may happen during C code and needs to access the g. C + // clobbers REGG, so if Go were to clobber REGTLS, sigtramp + // won't know which convention to use. By preserving REGTLS, + // we can just retrieve g from TLS when we aren't sure. + ppc64.REGTLS, + + // TODO(austin): Consolidate REGTLS and REGG? + ppc64.REGG, + ppc64.REGTMP, // REGTMP + ppc64.FREGCVI, + ppc64.FREGZERO, + ppc64.FREGHALF, + ppc64.FREGONE, + ppc64.FREGTWO, +} + +/* + * generate + * as $c, n + */ +func ginscon(as int, c int64, n2 *gc.Node) { + var n1 gc.Node + + gc.Nodconst(&n1, gc.Types[gc.TINT64], c) + + if as != ppc64.AMOVD && (c < -ppc64.BIG || c > ppc64.BIG) || n2.Op != gc.OREGISTER || as == ppc64.AMULLD { + // cannot have more than 16-bit of immediate in ADD, etc. + // instead, MOV into register first. + var ntmp gc.Node + gc.Regalloc(&ntmp, gc.Types[gc.TINT64], nil) + + rawgins(ppc64.AMOVD, &n1, &ntmp) + rawgins(as, &ntmp, n2) + gc.Regfree(&ntmp) + return + } + + rawgins(as, &n1, n2) +} + +/* + * generate + * as n, $c (CMP/CMPU) + */ +func ginscon2(as int, n2 *gc.Node, c int64) { + var n1 gc.Node + + gc.Nodconst(&n1, gc.Types[gc.TINT64], c) + + switch as { + default: + gc.Fatal("ginscon2") + + case ppc64.ACMP: + if -ppc64.BIG <= c && c <= ppc64.BIG { + rawgins(as, n2, &n1) + return + } + + case ppc64.ACMPU: + if 0 <= c && c <= 2*ppc64.BIG { + rawgins(as, n2, &n1) + return + } + } + + // MOV n1 into register first + var ntmp gc.Node + gc.Regalloc(&ntmp, gc.Types[gc.TINT64], nil) + + rawgins(ppc64.AMOVD, &n1, &ntmp) + rawgins(as, n2, &ntmp) + gc.Regfree(&ntmp) +} + +func ginscmp(op int, t *gc.Type, n1, n2 *gc.Node, likely int) *obj.Prog { + if gc.Isint[t.Etype] && n1.Op == gc.OLITERAL && n2.Op != gc.OLITERAL { + // Reverse comparison to place constant last. + op = gc.Brrev(op) + n1, n2 = n2, n1 + } + + var r1, r2, g1, g2 gc.Node + gc.Regalloc(&r1, t, n1) + gc.Regalloc(&g1, n1.Type, &r1) + gc.Cgen(n1, &g1) + gmove(&g1, &r1) + if gc.Isint[t.Etype] && gc.Isconst(n2, gc.CTINT) { + ginscon2(optoas(gc.OCMP, t), &r1, n2.Int()) + } else { + gc.Regalloc(&r2, t, n2) + gc.Regalloc(&g2, n1.Type, &r2) + gc.Cgen(n2, &g2) + gmove(&g2, &r2) + rawgins(optoas(gc.OCMP, t), &r1, &r2) + gc.Regfree(&g2) + gc.Regfree(&r2) + } + gc.Regfree(&g1) + gc.Regfree(&r1) + return gc.Gbranch(optoas(op, t), nil, likely) +} + +// set up nodes representing 2^63 +var ( + bigi gc.Node + bigf gc.Node + bignodes_did bool +) + +func bignodes() { + if bignodes_did { + return + } + bignodes_did = true + + var i big.Int + i.SetInt64(1) + i.Lsh(&i, 63) + + gc.Nodconst(&bigi, gc.Types[gc.TUINT64], 0) + bigi.SetBigInt(&i) + + bigi.Convconst(&bigf, gc.Types[gc.TFLOAT64]) +} + +/* + * generate move: + * t = f + * hard part is conversions. + */ +func gmove(f *gc.Node, t *gc.Node) { + if gc.Debug['M'] != 0 { + fmt.Printf("gmove %v -> %v\n", gc.Nconv(f, obj.FmtLong), gc.Nconv(t, obj.FmtLong)) + } + + ft := int(gc.Simsimtype(f.Type)) + tt := int(gc.Simsimtype(t.Type)) + cvt := (*gc.Type)(t.Type) + + if gc.Iscomplex[ft] || gc.Iscomplex[tt] { + gc.Complexmove(f, t) + return + } + + // cannot have two memory operands + var r2 gc.Node + var r1 gc.Node + var a int + if gc.Ismem(f) && gc.Ismem(t) { + goto hard + } + + // convert constant to desired type + if f.Op == gc.OLITERAL { + var con gc.Node + switch tt { + default: + f.Convconst(&con, t.Type) + + case gc.TINT32, + gc.TINT16, + gc.TINT8: + var con gc.Node + f.Convconst(&con, gc.Types[gc.TINT64]) + var r1 gc.Node + gc.Regalloc(&r1, con.Type, t) + gins(ppc64.AMOVD, &con, &r1) + gmove(&r1, t) + gc.Regfree(&r1) + return + + case gc.TUINT32, + gc.TUINT16, + gc.TUINT8: + var con gc.Node + f.Convconst(&con, gc.Types[gc.TUINT64]) + var r1 gc.Node + gc.Regalloc(&r1, con.Type, t) + gins(ppc64.AMOVD, &con, &r1) + gmove(&r1, t) + gc.Regfree(&r1) + return + } + + f = &con + ft = tt // so big switch will choose a simple mov + + // constants can't move directly to memory. + if gc.Ismem(t) { + goto hard + } + } + + // float constants come from memory. + //if(isfloat[tt]) + // goto hard; + + // 64-bit immediates are also from memory. + //if(isint[tt]) + // goto hard; + //// 64-bit immediates are really 32-bit sign-extended + //// unless moving into a register. + //if(isint[tt]) { + // if(mpcmpfixfix(con.val.u.xval, minintval[TINT32]) < 0) + // goto hard; + // if(mpcmpfixfix(con.val.u.xval, maxintval[TINT32]) > 0) + // goto hard; + //} + + // value -> value copy, only one memory operand. + // figure out the instruction to use. + // break out of switch for one-instruction gins. + // goto rdst for "destination must be register". + // goto hard for "convert to cvt type first". + // otherwise handle and return. + + switch uint32(ft)<<16 | uint32(tt) { + default: + gc.Fatal("gmove %v -> %v", gc.Tconv(f.Type, obj.FmtLong), gc.Tconv(t.Type, obj.FmtLong)) + + /* + * integer copy and truncate + */ + case gc.TINT8<<16 | gc.TINT8, // same size + gc.TUINT8<<16 | gc.TINT8, + gc.TINT16<<16 | gc.TINT8, + // truncate + gc.TUINT16<<16 | gc.TINT8, + gc.TINT32<<16 | gc.TINT8, + gc.TUINT32<<16 | gc.TINT8, + gc.TINT64<<16 | gc.TINT8, + gc.TUINT64<<16 | gc.TINT8: + a = ppc64.AMOVB + + case gc.TINT8<<16 | gc.TUINT8, // same size + gc.TUINT8<<16 | gc.TUINT8, + gc.TINT16<<16 | gc.TUINT8, + // truncate + gc.TUINT16<<16 | gc.TUINT8, + gc.TINT32<<16 | gc.TUINT8, + gc.TUINT32<<16 | gc.TUINT8, + gc.TINT64<<16 | gc.TUINT8, + gc.TUINT64<<16 | gc.TUINT8: + a = ppc64.AMOVBZ + + case gc.TINT16<<16 | gc.TINT16, // same size + gc.TUINT16<<16 | gc.TINT16, + gc.TINT32<<16 | gc.TINT16, + // truncate + gc.TUINT32<<16 | gc.TINT16, + gc.TINT64<<16 | gc.TINT16, + gc.TUINT64<<16 | gc.TINT16: + a = ppc64.AMOVH + + case gc.TINT16<<16 | gc.TUINT16, // same size + gc.TUINT16<<16 | gc.TUINT16, + gc.TINT32<<16 | gc.TUINT16, + // truncate + gc.TUINT32<<16 | gc.TUINT16, + gc.TINT64<<16 | gc.TUINT16, + gc.TUINT64<<16 | gc.TUINT16: + a = ppc64.AMOVHZ + + case gc.TINT32<<16 | gc.TINT32, // same size + gc.TUINT32<<16 | gc.TINT32, + gc.TINT64<<16 | gc.TINT32, + // truncate + gc.TUINT64<<16 | gc.TINT32: + a = ppc64.AMOVW + + case gc.TINT32<<16 | gc.TUINT32, // same size + gc.TUINT32<<16 | gc.TUINT32, + gc.TINT64<<16 | gc.TUINT32, + gc.TUINT64<<16 | gc.TUINT32: + a = ppc64.AMOVWZ + + case gc.TINT64<<16 | gc.TINT64, // same size + gc.TINT64<<16 | gc.TUINT64, + gc.TUINT64<<16 | gc.TINT64, + gc.TUINT64<<16 | gc.TUINT64: + a = ppc64.AMOVD + + /* + * integer up-conversions + */ + case gc.TINT8<<16 | gc.TINT16, // sign extend int8 + gc.TINT8<<16 | gc.TUINT16, + gc.TINT8<<16 | gc.TINT32, + gc.TINT8<<16 | gc.TUINT32, + gc.TINT8<<16 | gc.TINT64, + gc.TINT8<<16 | gc.TUINT64: + a = ppc64.AMOVB + + goto rdst + + case gc.TUINT8<<16 | gc.TINT16, // zero extend uint8 + gc.TUINT8<<16 | gc.TUINT16, + gc.TUINT8<<16 | gc.TINT32, + gc.TUINT8<<16 | gc.TUINT32, + gc.TUINT8<<16 | gc.TINT64, + gc.TUINT8<<16 | gc.TUINT64: + a = ppc64.AMOVBZ + + goto rdst + + case gc.TINT16<<16 | gc.TINT32, // sign extend int16 + gc.TINT16<<16 | gc.TUINT32, + gc.TINT16<<16 | gc.TINT64, + gc.TINT16<<16 | gc.TUINT64: + a = ppc64.AMOVH + + goto rdst + + case gc.TUINT16<<16 | gc.TINT32, // zero extend uint16 + gc.TUINT16<<16 | gc.TUINT32, + gc.TUINT16<<16 | gc.TINT64, + gc.TUINT16<<16 | gc.TUINT64: + a = ppc64.AMOVHZ + + goto rdst + + case gc.TINT32<<16 | gc.TINT64, // sign extend int32 + gc.TINT32<<16 | gc.TUINT64: + a = ppc64.AMOVW + + goto rdst + + case gc.TUINT32<<16 | gc.TINT64, // zero extend uint32 + gc.TUINT32<<16 | gc.TUINT64: + a = ppc64.AMOVWZ + + goto rdst + + //warn("gmove: convert float to int not implemented: %N -> %N\n", f, t); + //return; + // algorithm is: + // if small enough, use native float64 -> int64 conversion. + // otherwise, subtract 2^63, convert, and add it back. + /* + * float to integer + */ + case gc.TFLOAT32<<16 | gc.TINT32, + gc.TFLOAT64<<16 | gc.TINT32, + gc.TFLOAT32<<16 | gc.TINT64, + gc.TFLOAT64<<16 | gc.TINT64, + gc.TFLOAT32<<16 | gc.TINT16, + gc.TFLOAT32<<16 | gc.TINT8, + gc.TFLOAT32<<16 | gc.TUINT16, + gc.TFLOAT32<<16 | gc.TUINT8, + gc.TFLOAT64<<16 | gc.TINT16, + gc.TFLOAT64<<16 | gc.TINT8, + gc.TFLOAT64<<16 | gc.TUINT16, + gc.TFLOAT64<<16 | gc.TUINT8, + gc.TFLOAT32<<16 | gc.TUINT32, + gc.TFLOAT64<<16 | gc.TUINT32, + gc.TFLOAT32<<16 | gc.TUINT64, + gc.TFLOAT64<<16 | gc.TUINT64: + bignodes() + + var r1 gc.Node + gc.Regalloc(&r1, gc.Types[ft], f) + gmove(f, &r1) + if tt == gc.TUINT64 { + gc.Regalloc(&r2, gc.Types[gc.TFLOAT64], nil) + gmove(&bigf, &r2) + gins(ppc64.AFCMPU, &r1, &r2) + p1 := (*obj.Prog)(gc.Gbranch(optoas(gc.OLT, gc.Types[gc.TFLOAT64]), nil, +1)) + gins(ppc64.AFSUB, &r2, &r1) + gc.Patch(p1, gc.Pc) + gc.Regfree(&r2) + } + + gc.Regalloc(&r2, gc.Types[gc.TFLOAT64], nil) + var r3 gc.Node + gc.Regalloc(&r3, gc.Types[gc.TINT64], t) + gins(ppc64.AFCTIDZ, &r1, &r2) + p1 := (*obj.Prog)(gins(ppc64.AFMOVD, &r2, nil)) + p1.To.Type = obj.TYPE_MEM + p1.To.Reg = ppc64.REGSP + p1.To.Offset = -8 + p1 = gins(ppc64.AMOVD, nil, &r3) + p1.From.Type = obj.TYPE_MEM + p1.From.Reg = ppc64.REGSP + p1.From.Offset = -8 + gc.Regfree(&r2) + gc.Regfree(&r1) + if tt == gc.TUINT64 { + p1 := (*obj.Prog)(gc.Gbranch(optoas(gc.OLT, gc.Types[gc.TFLOAT64]), nil, +1)) // use CR0 here again + gc.Nodreg(&r1, gc.Types[gc.TINT64], ppc64.REGTMP) + gins(ppc64.AMOVD, &bigi, &r1) + gins(ppc64.AADD, &r1, &r3) + gc.Patch(p1, gc.Pc) + } + + gmove(&r3, t) + gc.Regfree(&r3) + return + + //warn("gmove: convert int to float not implemented: %N -> %N\n", f, t); + //return; + // algorithm is: + // if small enough, use native int64 -> uint64 conversion. + // otherwise, halve (rounding to odd?), convert, and double. + /* + * integer to float + */ + case gc.TINT32<<16 | gc.TFLOAT32, + gc.TINT32<<16 | gc.TFLOAT64, + gc.TINT64<<16 | gc.TFLOAT32, + gc.TINT64<<16 | gc.TFLOAT64, + gc.TINT16<<16 | gc.TFLOAT32, + gc.TINT16<<16 | gc.TFLOAT64, + gc.TINT8<<16 | gc.TFLOAT32, + gc.TINT8<<16 | gc.TFLOAT64, + gc.TUINT16<<16 | gc.TFLOAT32, + gc.TUINT16<<16 | gc.TFLOAT64, + gc.TUINT8<<16 | gc.TFLOAT32, + gc.TUINT8<<16 | gc.TFLOAT64, + gc.TUINT32<<16 | gc.TFLOAT32, + gc.TUINT32<<16 | gc.TFLOAT64, + gc.TUINT64<<16 | gc.TFLOAT32, + gc.TUINT64<<16 | gc.TFLOAT64: + bignodes() + + var r1 gc.Node + gc.Regalloc(&r1, gc.Types[gc.TINT64], nil) + gmove(f, &r1) + if ft == gc.TUINT64 { + gc.Nodreg(&r2, gc.Types[gc.TUINT64], ppc64.REGTMP) + gmove(&bigi, &r2) + gins(ppc64.ACMPU, &r1, &r2) + p1 := (*obj.Prog)(gc.Gbranch(optoas(gc.OLT, gc.Types[gc.TUINT64]), nil, +1)) + p2 := (*obj.Prog)(gins(ppc64.ASRD, nil, &r1)) + p2.From.Type = obj.TYPE_CONST + p2.From.Offset = 1 + gc.Patch(p1, gc.Pc) + } + + gc.Regalloc(&r2, gc.Types[gc.TFLOAT64], t) + p1 := (*obj.Prog)(gins(ppc64.AMOVD, &r1, nil)) + p1.To.Type = obj.TYPE_MEM + p1.To.Reg = ppc64.REGSP + p1.To.Offset = -8 + p1 = gins(ppc64.AFMOVD, nil, &r2) + p1.From.Type = obj.TYPE_MEM + p1.From.Reg = ppc64.REGSP + p1.From.Offset = -8 + gins(ppc64.AFCFID, &r2, &r2) + gc.Regfree(&r1) + if ft == gc.TUINT64 { + p1 := (*obj.Prog)(gc.Gbranch(optoas(gc.OLT, gc.Types[gc.TUINT64]), nil, +1)) // use CR0 here again + gc.Nodreg(&r1, gc.Types[gc.TFLOAT64], ppc64.FREGTWO) + gins(ppc64.AFMUL, &r1, &r2) + gc.Patch(p1, gc.Pc) + } + + gmove(&r2, t) + gc.Regfree(&r2) + return + + /* + * float to float + */ + case gc.TFLOAT32<<16 | gc.TFLOAT32: + a = ppc64.AFMOVS + + case gc.TFLOAT64<<16 | gc.TFLOAT64: + a = ppc64.AFMOVD + + case gc.TFLOAT32<<16 | gc.TFLOAT64: + a = ppc64.AFMOVS + goto rdst + + case gc.TFLOAT64<<16 | gc.TFLOAT32: + a = ppc64.AFRSP + goto rdst + } + + gins(a, f, t) + return + + // requires register destination +rdst: + { + gc.Regalloc(&r1, t.Type, t) + + gins(a, f, &r1) + gmove(&r1, t) + gc.Regfree(&r1) + return + } + + // requires register intermediate +hard: + gc.Regalloc(&r1, cvt, t) + + gmove(f, &r1) + gmove(&r1, t) + gc.Regfree(&r1) + return +} + +func intLiteral(n *gc.Node) (x int64, ok bool) { + switch { + case n == nil: + return + case gc.Isconst(n, gc.CTINT): + return n.Int(), true + case gc.Isconst(n, gc.CTBOOL): + return int64(obj.Bool2int(n.Bool())), true + } + return +} + +// gins is called by the front end. +// It synthesizes some multiple-instruction sequences +// so the front end can stay simpler. +func gins(as int, f, t *gc.Node) *obj.Prog { + if as >= obj.A_ARCHSPECIFIC { + if x, ok := intLiteral(f); ok { + ginscon(as, x, t) + return nil // caller must not use + } + } + if as == ppc64.ACMP || as == ppc64.ACMPU { + if x, ok := intLiteral(t); ok { + ginscon2(as, f, x) + return nil // caller must not use + } + } + return rawgins(as, f, t) +} + +/* + * generate one instruction: + * as f, t + */ +func rawgins(as int, f *gc.Node, t *gc.Node) *obj.Prog { + // TODO(austin): Add self-move test like in 6g (but be careful + // of truncation moves) + + p := gc.Prog(as) + gc.Naddr(&p.From, f) + gc.Naddr(&p.To, t) + + switch as { + case obj.ACALL: + if p.To.Type == obj.TYPE_REG && p.To.Reg != ppc64.REG_CTR { + // Allow front end to emit CALL REG, and rewrite into MOV REG, CTR; CALL CTR. + pp := gc.Prog(as) + pp.From = p.From + pp.To.Type = obj.TYPE_REG + pp.To.Reg = ppc64.REG_CTR + + p.As = ppc64.AMOVD + p.From = p.To + p.To.Type = obj.TYPE_REG + p.To.Reg = ppc64.REG_CTR + + if gc.Debug['g'] != 0 { + fmt.Printf("%v\n", p) + fmt.Printf("%v\n", pp) + } + + return pp + } + + // Bad things the front end has done to us. Crash to find call stack. + case ppc64.AAND, ppc64.AMULLD: + if p.From.Type == obj.TYPE_CONST { + gc.Debug['h'] = 1 + gc.Fatal("bad inst: %v", p) + } + case ppc64.ACMP, ppc64.ACMPU: + if p.From.Type == obj.TYPE_MEM || p.To.Type == obj.TYPE_MEM { + gc.Debug['h'] = 1 + gc.Fatal("bad inst: %v", p) + } + } + + if gc.Debug['g'] != 0 { + fmt.Printf("%v\n", p) + } + + w := int32(0) + switch as { + case ppc64.AMOVB, + ppc64.AMOVBU, + ppc64.AMOVBZ, + ppc64.AMOVBZU: + w = 1 + + case ppc64.AMOVH, + ppc64.AMOVHU, + ppc64.AMOVHZ, + ppc64.AMOVHZU: + w = 2 + + case ppc64.AMOVW, + ppc64.AMOVWU, + ppc64.AMOVWZ, + ppc64.AMOVWZU: + w = 4 + + case ppc64.AMOVD, + ppc64.AMOVDU: + if p.From.Type == obj.TYPE_CONST || p.From.Type == obj.TYPE_ADDR { + break + } + w = 8 + } + + if w != 0 && ((f != nil && p.From.Width < int64(w)) || (t != nil && p.To.Type != obj.TYPE_REG && p.To.Width > int64(w))) { + gc.Dump("f", f) + gc.Dump("t", t) + gc.Fatal("bad width: %v (%d, %d)\n", p, p.From.Width, p.To.Width) + } + + return p +} + +/* + * return Axxx for Oxxx on type t. + */ +func optoas(op int, t *gc.Type) int { + if t == nil { + gc.Fatal("optoas: t is nil") + } + + a := int(obj.AXXX) + switch uint32(op)<<16 | uint32(gc.Simtype[t.Etype]) { + default: + gc.Fatal("optoas: no entry for op=%v type=%v", gc.Oconv(int(op), 0), t) + + case gc.OEQ<<16 | gc.TBOOL, + gc.OEQ<<16 | gc.TINT8, + gc.OEQ<<16 | gc.TUINT8, + gc.OEQ<<16 | gc.TINT16, + gc.OEQ<<16 | gc.TUINT16, + gc.OEQ<<16 | gc.TINT32, + gc.OEQ<<16 | gc.TUINT32, + gc.OEQ<<16 | gc.TINT64, + gc.OEQ<<16 | gc.TUINT64, + gc.OEQ<<16 | gc.TPTR32, + gc.OEQ<<16 | gc.TPTR64, + gc.OEQ<<16 | gc.TFLOAT32, + gc.OEQ<<16 | gc.TFLOAT64: + a = ppc64.ABEQ + + case gc.ONE<<16 | gc.TBOOL, + gc.ONE<<16 | gc.TINT8, + gc.ONE<<16 | gc.TUINT8, + gc.ONE<<16 | gc.TINT16, + gc.ONE<<16 | gc.TUINT16, + gc.ONE<<16 | gc.TINT32, + gc.ONE<<16 | gc.TUINT32, + gc.ONE<<16 | gc.TINT64, + gc.ONE<<16 | gc.TUINT64, + gc.ONE<<16 | gc.TPTR32, + gc.ONE<<16 | gc.TPTR64, + gc.ONE<<16 | gc.TFLOAT32, + gc.ONE<<16 | gc.TFLOAT64: + a = ppc64.ABNE + + case gc.OLT<<16 | gc.TINT8, // ACMP + gc.OLT<<16 | gc.TINT16, + gc.OLT<<16 | gc.TINT32, + gc.OLT<<16 | gc.TINT64, + gc.OLT<<16 | gc.TUINT8, + // ACMPU + gc.OLT<<16 | gc.TUINT16, + gc.OLT<<16 | gc.TUINT32, + gc.OLT<<16 | gc.TUINT64, + gc.OLT<<16 | gc.TFLOAT32, + // AFCMPU + gc.OLT<<16 | gc.TFLOAT64: + a = ppc64.ABLT + + case gc.OLE<<16 | gc.TINT8, // ACMP + gc.OLE<<16 | gc.TINT16, + gc.OLE<<16 | gc.TINT32, + gc.OLE<<16 | gc.TINT64, + gc.OLE<<16 | gc.TUINT8, + // ACMPU + gc.OLE<<16 | gc.TUINT16, + gc.OLE<<16 | gc.TUINT32, + gc.OLE<<16 | gc.TUINT64: + // No OLE for floats, because it mishandles NaN. + // Front end must reverse comparison or use OLT and OEQ together. + a = ppc64.ABLE + + case gc.OGT<<16 | gc.TINT8, + gc.OGT<<16 | gc.TINT16, + gc.OGT<<16 | gc.TINT32, + gc.OGT<<16 | gc.TINT64, + gc.OGT<<16 | gc.TUINT8, + gc.OGT<<16 | gc.TUINT16, + gc.OGT<<16 | gc.TUINT32, + gc.OGT<<16 | gc.TUINT64, + gc.OGT<<16 | gc.TFLOAT32, + gc.OGT<<16 | gc.TFLOAT64: + a = ppc64.ABGT + + case gc.OGE<<16 | gc.TINT8, + gc.OGE<<16 | gc.TINT16, + gc.OGE<<16 | gc.TINT32, + gc.OGE<<16 | gc.TINT64, + gc.OGE<<16 | gc.TUINT8, + gc.OGE<<16 | gc.TUINT16, + gc.OGE<<16 | gc.TUINT32, + gc.OGE<<16 | gc.TUINT64: + // No OGE for floats, because it mishandles NaN. + // Front end must reverse comparison or use OLT and OEQ together. + a = ppc64.ABGE + + case gc.OCMP<<16 | gc.TBOOL, + gc.OCMP<<16 | gc.TINT8, + gc.OCMP<<16 | gc.TINT16, + gc.OCMP<<16 | gc.TINT32, + gc.OCMP<<16 | gc.TPTR32, + gc.OCMP<<16 | gc.TINT64: + a = ppc64.ACMP + + case gc.OCMP<<16 | gc.TUINT8, + gc.OCMP<<16 | gc.TUINT16, + gc.OCMP<<16 | gc.TUINT32, + gc.OCMP<<16 | gc.TUINT64, + gc.OCMP<<16 | gc.TPTR64: + a = ppc64.ACMPU + + case gc.OCMP<<16 | gc.TFLOAT32, + gc.OCMP<<16 | gc.TFLOAT64: + a = ppc64.AFCMPU + + case gc.OAS<<16 | gc.TBOOL, + gc.OAS<<16 | gc.TINT8: + a = ppc64.AMOVB + + case gc.OAS<<16 | gc.TUINT8: + a = ppc64.AMOVBZ + + case gc.OAS<<16 | gc.TINT16: + a = ppc64.AMOVH + + case gc.OAS<<16 | gc.TUINT16: + a = ppc64.AMOVHZ + + case gc.OAS<<16 | gc.TINT32: + a = ppc64.AMOVW + + case gc.OAS<<16 | gc.TUINT32, + gc.OAS<<16 | gc.TPTR32: + a = ppc64.AMOVWZ + + case gc.OAS<<16 | gc.TINT64, + gc.OAS<<16 | gc.TUINT64, + gc.OAS<<16 | gc.TPTR64: + a = ppc64.AMOVD + + case gc.OAS<<16 | gc.TFLOAT32: + a = ppc64.AFMOVS + + case gc.OAS<<16 | gc.TFLOAT64: + a = ppc64.AFMOVD + + case gc.OADD<<16 | gc.TINT8, + gc.OADD<<16 | gc.TUINT8, + gc.OADD<<16 | gc.TINT16, + gc.OADD<<16 | gc.TUINT16, + gc.OADD<<16 | gc.TINT32, + gc.OADD<<16 | gc.TUINT32, + gc.OADD<<16 | gc.TPTR32, + gc.OADD<<16 | gc.TINT64, + gc.OADD<<16 | gc.TUINT64, + gc.OADD<<16 | gc.TPTR64: + a = ppc64.AADD + + case gc.OADD<<16 | gc.TFLOAT32: + a = ppc64.AFADDS + + case gc.OADD<<16 | gc.TFLOAT64: + a = ppc64.AFADD + + case gc.OSUB<<16 | gc.TINT8, + gc.OSUB<<16 | gc.TUINT8, + gc.OSUB<<16 | gc.TINT16, + gc.OSUB<<16 | gc.TUINT16, + gc.OSUB<<16 | gc.TINT32, + gc.OSUB<<16 | gc.TUINT32, + gc.OSUB<<16 | gc.TPTR32, + gc.OSUB<<16 | gc.TINT64, + gc.OSUB<<16 | gc.TUINT64, + gc.OSUB<<16 | gc.TPTR64: + a = ppc64.ASUB + + case gc.OSUB<<16 | gc.TFLOAT32: + a = ppc64.AFSUBS + + case gc.OSUB<<16 | gc.TFLOAT64: + a = ppc64.AFSUB + + case gc.OMINUS<<16 | gc.TINT8, + gc.OMINUS<<16 | gc.TUINT8, + gc.OMINUS<<16 | gc.TINT16, + gc.OMINUS<<16 | gc.TUINT16, + gc.OMINUS<<16 | gc.TINT32, + gc.OMINUS<<16 | gc.TUINT32, + gc.OMINUS<<16 | gc.TPTR32, + gc.OMINUS<<16 | gc.TINT64, + gc.OMINUS<<16 | gc.TUINT64, + gc.OMINUS<<16 | gc.TPTR64: + a = ppc64.ANEG + + case gc.OAND<<16 | gc.TINT8, + gc.OAND<<16 | gc.TUINT8, + gc.OAND<<16 | gc.TINT16, + gc.OAND<<16 | gc.TUINT16, + gc.OAND<<16 | gc.TINT32, + gc.OAND<<16 | gc.TUINT32, + gc.OAND<<16 | gc.TPTR32, + gc.OAND<<16 | gc.TINT64, + gc.OAND<<16 | gc.TUINT64, + gc.OAND<<16 | gc.TPTR64: + a = ppc64.AAND + + case gc.OOR<<16 | gc.TINT8, + gc.OOR<<16 | gc.TUINT8, + gc.OOR<<16 | gc.TINT16, + gc.OOR<<16 | gc.TUINT16, + gc.OOR<<16 | gc.TINT32, + gc.OOR<<16 | gc.TUINT32, + gc.OOR<<16 | gc.TPTR32, + gc.OOR<<16 | gc.TINT64, + gc.OOR<<16 | gc.TUINT64, + gc.OOR<<16 | gc.TPTR64: + a = ppc64.AOR + + case gc.OXOR<<16 | gc.TINT8, + gc.OXOR<<16 | gc.TUINT8, + gc.OXOR<<16 | gc.TINT16, + gc.OXOR<<16 | gc.TUINT16, + gc.OXOR<<16 | gc.TINT32, + gc.OXOR<<16 | gc.TUINT32, + gc.OXOR<<16 | gc.TPTR32, + gc.OXOR<<16 | gc.TINT64, + gc.OXOR<<16 | gc.TUINT64, + gc.OXOR<<16 | gc.TPTR64: + a = ppc64.AXOR + + // TODO(minux): handle rotates + //case CASE(OLROT, TINT8): + //case CASE(OLROT, TUINT8): + //case CASE(OLROT, TINT16): + //case CASE(OLROT, TUINT16): + //case CASE(OLROT, TINT32): + //case CASE(OLROT, TUINT32): + //case CASE(OLROT, TPTR32): + //case CASE(OLROT, TINT64): + //case CASE(OLROT, TUINT64): + //case CASE(OLROT, TPTR64): + // a = 0//???; RLDC? + // break; + + case gc.OLSH<<16 | gc.TINT8, + gc.OLSH<<16 | gc.TUINT8, + gc.OLSH<<16 | gc.TINT16, + gc.OLSH<<16 | gc.TUINT16, + gc.OLSH<<16 | gc.TINT32, + gc.OLSH<<16 | gc.TUINT32, + gc.OLSH<<16 | gc.TPTR32, + gc.OLSH<<16 | gc.TINT64, + gc.OLSH<<16 | gc.TUINT64, + gc.OLSH<<16 | gc.TPTR64: + a = ppc64.ASLD + + case gc.ORSH<<16 | gc.TUINT8, + gc.ORSH<<16 | gc.TUINT16, + gc.ORSH<<16 | gc.TUINT32, + gc.ORSH<<16 | gc.TPTR32, + gc.ORSH<<16 | gc.TUINT64, + gc.ORSH<<16 | gc.TPTR64: + a = ppc64.ASRD + + case gc.ORSH<<16 | gc.TINT8, + gc.ORSH<<16 | gc.TINT16, + gc.ORSH<<16 | gc.TINT32, + gc.ORSH<<16 | gc.TINT64: + a = ppc64.ASRAD + + // TODO(minux): handle rotates + //case CASE(ORROTC, TINT8): + //case CASE(ORROTC, TUINT8): + //case CASE(ORROTC, TINT16): + //case CASE(ORROTC, TUINT16): + //case CASE(ORROTC, TINT32): + //case CASE(ORROTC, TUINT32): + //case CASE(ORROTC, TINT64): + //case CASE(ORROTC, TUINT64): + // a = 0//??? RLDC?? + // break; + + case gc.OHMUL<<16 | gc.TINT64: + a = ppc64.AMULHD + + case gc.OHMUL<<16 | gc.TUINT64, + gc.OHMUL<<16 | gc.TPTR64: + a = ppc64.AMULHDU + + case gc.OMUL<<16 | gc.TINT8, + gc.OMUL<<16 | gc.TINT16, + gc.OMUL<<16 | gc.TINT32, + gc.OMUL<<16 | gc.TINT64: + a = ppc64.AMULLD + + case gc.OMUL<<16 | gc.TUINT8, + gc.OMUL<<16 | gc.TUINT16, + gc.OMUL<<16 | gc.TUINT32, + gc.OMUL<<16 | gc.TPTR32, + // don't use word multiply, the high 32-bit are undefined. + gc.OMUL<<16 | gc.TUINT64, + gc.OMUL<<16 | gc.TPTR64: + // for 64-bit multiplies, signedness doesn't matter. + a = ppc64.AMULLD + + case gc.OMUL<<16 | gc.TFLOAT32: + a = ppc64.AFMULS + + case gc.OMUL<<16 | gc.TFLOAT64: + a = ppc64.AFMUL + + case gc.ODIV<<16 | gc.TINT8, + gc.ODIV<<16 | gc.TINT16, + gc.ODIV<<16 | gc.TINT32, + gc.ODIV<<16 | gc.TINT64: + a = ppc64.ADIVD + + case gc.ODIV<<16 | gc.TUINT8, + gc.ODIV<<16 | gc.TUINT16, + gc.ODIV<<16 | gc.TUINT32, + gc.ODIV<<16 | gc.TPTR32, + gc.ODIV<<16 | gc.TUINT64, + gc.ODIV<<16 | gc.TPTR64: + a = ppc64.ADIVDU + + case gc.ODIV<<16 | gc.TFLOAT32: + a = ppc64.AFDIVS + + case gc.ODIV<<16 | gc.TFLOAT64: + a = ppc64.AFDIV + } + + return a +} + +const ( + ODynam = 1 << 0 + OAddable = 1 << 1 +) + +func xgen(n *gc.Node, a *gc.Node, o int) bool { + // TODO(minux) + + return -1 != 0 /*TypeKind(100016)*/ +} + +func sudoclean() { + return +} + +/* + * generate code to compute address of n, + * a reference to a (perhaps nested) field inside + * an array or struct. + * return 0 on failure, 1 on success. + * on success, leaves usable address in a. + * + * caller is responsible for calling sudoclean + * after successful sudoaddable, + * to release the register used for a. + */ +func sudoaddable(as int, n *gc.Node, a *obj.Addr) bool { + // TODO(minux) + + *a = obj.Addr{} + return false +} diff --git a/src/cmd/compile/internal/ppc64/opt.go b/src/cmd/compile/internal/ppc64/opt.go new file mode 100644 index 0000000000000000000000000000000000000000..1704f63c4825f13719c2618e619e18ca6d14dc4f --- /dev/null +++ b/src/cmd/compile/internal/ppc64/opt.go @@ -0,0 +1,12 @@ +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package ppc64 + +// Many Power ISA arithmetic and logical instructions come in four +// standard variants. These bits let us map between variants. +const ( + V_CC = 1 << 0 // xCC (affect CR field 0 flags) + V_V = 1 << 1 // xV (affect SO and OV flags) +) diff --git a/src/cmd/compile/internal/ppc64/peep.go b/src/cmd/compile/internal/ppc64/peep.go new file mode 100644 index 0000000000000000000000000000000000000000..9c3f1edb307f28ffc868b7f93098f812303f8587 --- /dev/null +++ b/src/cmd/compile/internal/ppc64/peep.go @@ -0,0 +1,1051 @@ +// Derived from Inferno utils/6c/peep.c +// http://code.google.com/p/inferno-os/source/browse/utils/6c/peep.c +// +// Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved. +// Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net) +// Portions Copyright © 1997-1999 Vita Nuova Limited +// Portions Copyright © 2000-2007 Vita Nuova Holdings Limited (www.vitanuova.com) +// Portions Copyright © 2004,2006 Bruce Ellis +// Portions Copyright © 2005-2007 C H Forsyth (forsyth@terzarima.net) +// Revisions Copyright © 2000-2007 Lucent Technologies Inc. and others +// Portions Copyright © 2009 The Go Authors. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +package ppc64 + +import ( + "cmd/compile/internal/gc" + "cmd/internal/obj" + "cmd/internal/obj/ppc64" + "fmt" +) + +var gactive uint32 + +func peep(firstp *obj.Prog) { + g := (*gc.Graph)(gc.Flowstart(firstp, nil)) + if g == nil { + return + } + gactive = 0 + + var p *obj.Prog + var r *gc.Flow + var t int +loop1: + if gc.Debug['P'] != 0 && gc.Debug['v'] != 0 { + gc.Dumpit("loop1", g.Start, 0) + } + + t = 0 + for r = g.Start; r != nil; r = r.Link { + p = r.Prog + + // TODO(austin) Handle smaller moves. arm and amd64 + // distinguish between moves that moves that *must* + // sign/zero extend and moves that don't care so they + // can eliminate moves that don't care without + // breaking moves that do care. This might let us + // simplify or remove the next peep loop, too. + if p.As == ppc64.AMOVD || p.As == ppc64.AFMOVD { + if regtyp(&p.To) { + // Try to eliminate reg->reg moves + if regtyp(&p.From) { + if p.From.Type == p.To.Type { + if copyprop(r) { + excise(r) + t++ + } else if subprop(r) && copyprop(r) { + excise(r) + t++ + } + } + } + + // Convert uses to $0 to uses of R0 and + // propagate R0 + if regzer(&p.From) != 0 { + if p.To.Type == obj.TYPE_REG { + p.From.Type = obj.TYPE_REG + p.From.Reg = ppc64.REGZERO + if copyprop(r) { + excise(r) + t++ + } else if subprop(r) && copyprop(r) { + excise(r) + t++ + } + } + } + } + } + } + + if t != 0 { + goto loop1 + } + + /* + * look for MOVB x,R; MOVB R,R (for small MOVs not handled above) + */ + var p1 *obj.Prog + var r1 *gc.Flow + for r := (*gc.Flow)(g.Start); r != nil; r = r.Link { + p = r.Prog + switch p.As { + default: + continue + + case ppc64.AMOVH, + ppc64.AMOVHZ, + ppc64.AMOVB, + ppc64.AMOVBZ, + ppc64.AMOVW, + ppc64.AMOVWZ: + if p.To.Type != obj.TYPE_REG { + continue + } + } + + r1 = r.Link + if r1 == nil { + continue + } + p1 = r1.Prog + if p1.As != p.As { + continue + } + if p1.From.Type != obj.TYPE_REG || p1.From.Reg != p.To.Reg { + continue + } + if p1.To.Type != obj.TYPE_REG || p1.To.Reg != p.To.Reg { + continue + } + excise(r1) + } + + if gc.Debug['D'] > 1 { + goto ret /* allow following code improvement to be suppressed */ + } + + /* + * look for OP x,y,R; CMP R, $0 -> OPCC x,y,R + * when OP can set condition codes correctly + */ + for r := (*gc.Flow)(g.Start); r != nil; r = r.Link { + p = r.Prog + switch p.As { + case ppc64.ACMP, + ppc64.ACMPW: /* always safe? */ + if regzer(&p.To) == 0 { + continue + } + r1 = r.S1 + if r1 == nil { + continue + } + switch r1.Prog.As { + default: + continue + + /* the conditions can be complex and these are currently little used */ + case ppc64.ABCL, + ppc64.ABC: + continue + + case ppc64.ABEQ, + ppc64.ABGE, + ppc64.ABGT, + ppc64.ABLE, + ppc64.ABLT, + ppc64.ABNE, + ppc64.ABVC, + ppc64.ABVS: + break + } + + r1 = r + for { + r1 = gc.Uniqp(r1) + if r1 == nil || r1.Prog.As != obj.ANOP { + break + } + } + + if r1 == nil { + continue + } + p1 = r1.Prog + if p1.To.Type != obj.TYPE_REG || p1.To.Reg != p.From.Reg { + continue + } + switch p1.As { + /* irregular instructions */ + case ppc64.ASUB, + ppc64.AADD, + ppc64.AXOR, + ppc64.AOR: + if p1.From.Type == obj.TYPE_CONST || p1.From.Type == obj.TYPE_ADDR { + continue + } + } + + switch p1.As { + default: + continue + + case ppc64.AMOVW, + ppc64.AMOVD: + if p1.From.Type != obj.TYPE_REG { + continue + } + continue + + case ppc64.AANDCC, + ppc64.AANDNCC, + ppc64.AORCC, + ppc64.AORNCC, + ppc64.AXORCC, + ppc64.ASUBCC, + ppc64.ASUBECC, + ppc64.ASUBMECC, + ppc64.ASUBZECC, + ppc64.AADDCC, + ppc64.AADDCCC, + ppc64.AADDECC, + ppc64.AADDMECC, + ppc64.AADDZECC, + ppc64.ARLWMICC, + ppc64.ARLWNMCC, + /* don't deal with floating point instructions for now */ + /* + case AFABS: + case AFADD: + case AFADDS: + case AFCTIW: + case AFCTIWZ: + case AFDIV: + case AFDIVS: + case AFMADD: + case AFMADDS: + case AFMOVD: + case AFMSUB: + case AFMSUBS: + case AFMUL: + case AFMULS: + case AFNABS: + case AFNEG: + case AFNMADD: + case AFNMADDS: + case AFNMSUB: + case AFNMSUBS: + case AFRSP: + case AFSUB: + case AFSUBS: + case ACNTLZW: + case AMTFSB0: + case AMTFSB1: + */ + ppc64.AADD, + ppc64.AADDV, + ppc64.AADDC, + ppc64.AADDCV, + ppc64.AADDME, + ppc64.AADDMEV, + ppc64.AADDE, + ppc64.AADDEV, + ppc64.AADDZE, + ppc64.AADDZEV, + ppc64.AAND, + ppc64.AANDN, + ppc64.ADIVW, + ppc64.ADIVWV, + ppc64.ADIVWU, + ppc64.ADIVWUV, + ppc64.ADIVD, + ppc64.ADIVDV, + ppc64.ADIVDU, + ppc64.ADIVDUV, + ppc64.AEQV, + ppc64.AEXTSB, + ppc64.AEXTSH, + ppc64.AEXTSW, + ppc64.AMULHW, + ppc64.AMULHWU, + ppc64.AMULLW, + ppc64.AMULLWV, + ppc64.AMULHD, + ppc64.AMULHDU, + ppc64.AMULLD, + ppc64.AMULLDV, + ppc64.ANAND, + ppc64.ANEG, + ppc64.ANEGV, + ppc64.ANOR, + ppc64.AOR, + ppc64.AORN, + ppc64.AREM, + ppc64.AREMV, + ppc64.AREMU, + ppc64.AREMUV, + ppc64.AREMD, + ppc64.AREMDV, + ppc64.AREMDU, + ppc64.AREMDUV, + ppc64.ARLWMI, + ppc64.ARLWNM, + ppc64.ASLW, + ppc64.ASRAW, + ppc64.ASRW, + ppc64.ASLD, + ppc64.ASRAD, + ppc64.ASRD, + ppc64.ASUB, + ppc64.ASUBV, + ppc64.ASUBC, + ppc64.ASUBCV, + ppc64.ASUBME, + ppc64.ASUBMEV, + ppc64.ASUBE, + ppc64.ASUBEV, + ppc64.ASUBZE, + ppc64.ASUBZEV, + ppc64.AXOR: + t = variant2as(int(p1.As), as2variant(int(p1.As))|V_CC) + } + + if gc.Debug['D'] != 0 { + fmt.Printf("cmp %v; %v -> ", p1, p) + } + p1.As = int16(t) + if gc.Debug['D'] != 0 { + fmt.Printf("%v\n", p1) + } + excise(r) + continue + } + } + +ret: + gc.Flowend(g) +} + +func excise(r *gc.Flow) { + p := (*obj.Prog)(r.Prog) + if gc.Debug['P'] != 0 && gc.Debug['v'] != 0 { + fmt.Printf("%v ===delete===\n", p) + } + obj.Nopout(p) + gc.Ostats.Ndelmov++ +} + +/* + * regzer returns 1 if a's value is 0 (a is R0 or $0) + */ +func regzer(a *obj.Addr) int { + if a.Type == obj.TYPE_CONST || a.Type == obj.TYPE_ADDR { + if a.Sym == nil && a.Reg == 0 { + if a.Offset == 0 { + return 1 + } + } + } + if a.Type == obj.TYPE_REG { + if a.Reg == ppc64.REGZERO { + return 1 + } + } + return 0 +} + +func regtyp(a *obj.Addr) bool { + // TODO(rsc): Floating point register exclusions? + return a.Type == obj.TYPE_REG && ppc64.REG_R0 <= a.Reg && a.Reg <= ppc64.REG_F31 && a.Reg != ppc64.REGZERO +} + +/* + * the idea is to substitute + * one register for another + * from one MOV to another + * MOV a, R1 + * ADD b, R1 / no use of R2 + * MOV R1, R2 + * would be converted to + * MOV a, R2 + * ADD b, R2 + * MOV R2, R1 + * hopefully, then the former or latter MOV + * will be eliminated by copy propagation. + * + * r0 (the argument, not the register) is the MOV at the end of the + * above sequences. This returns 1 if it modified any instructions. + */ +func subprop(r0 *gc.Flow) bool { + p := (*obj.Prog)(r0.Prog) + v1 := (*obj.Addr)(&p.From) + if !regtyp(v1) { + return false + } + v2 := (*obj.Addr)(&p.To) + if !regtyp(v2) { + return false + } + for r := gc.Uniqp(r0); r != nil; r = gc.Uniqp(r) { + if gc.Uniqs(r) == nil { + break + } + p = r.Prog + if p.As == obj.AVARDEF || p.As == obj.AVARKILL { + continue + } + if p.Info.Flags&gc.Call != 0 { + return false + } + + if p.Info.Flags&(gc.RightRead|gc.RightWrite) == gc.RightWrite { + if p.To.Type == v1.Type { + if p.To.Reg == v1.Reg { + copysub(&p.To, v1, v2, 1) + if gc.Debug['P'] != 0 { + fmt.Printf("gotit: %v->%v\n%v", gc.Ctxt.Dconv(v1), gc.Ctxt.Dconv(v2), r.Prog) + if p.From.Type == v2.Type { + fmt.Printf(" excise") + } + fmt.Printf("\n") + } + + for r = gc.Uniqs(r); r != r0; r = gc.Uniqs(r) { + p = r.Prog + copysub(&p.From, v1, v2, 1) + copysub1(p, v1, v2, 1) + copysub(&p.To, v1, v2, 1) + if gc.Debug['P'] != 0 { + fmt.Printf("%v\n", r.Prog) + } + } + + t := int(int(v1.Reg)) + v1.Reg = v2.Reg + v2.Reg = int16(t) + if gc.Debug['P'] != 0 { + fmt.Printf("%v last\n", r.Prog) + } + return true + } + } + } + + if copyau(&p.From, v2) || copyau1(p, v2) || copyau(&p.To, v2) { + break + } + if copysub(&p.From, v1, v2, 0) != 0 || copysub1(p, v1, v2, 0) != 0 || copysub(&p.To, v1, v2, 0) != 0 { + break + } + } + + return false +} + +/* + * The idea is to remove redundant copies. + * v1->v2 F=0 + * (use v2 s/v2/v1/)* + * set v1 F=1 + * use v2 return fail (v1->v2 move must remain) + * ----------------- + * v1->v2 F=0 + * (use v2 s/v2/v1/)* + * set v1 F=1 + * set v2 return success (caller can remove v1->v2 move) + */ +func copyprop(r0 *gc.Flow) bool { + p := (*obj.Prog)(r0.Prog) + v1 := (*obj.Addr)(&p.From) + v2 := (*obj.Addr)(&p.To) + if copyas(v1, v2) { + if gc.Debug['P'] != 0 { + fmt.Printf("eliminating self-move: %v\n", r0.Prog) + } + return true + } + + gactive++ + if gc.Debug['P'] != 0 { + fmt.Printf("trying to eliminate %v->%v move from:\n%v\n", gc.Ctxt.Dconv(v1), gc.Ctxt.Dconv(v2), r0.Prog) + } + return copy1(v1, v2, r0.S1, 0) +} + +// copy1 replaces uses of v2 with v1 starting at r and returns 1 if +// all uses were rewritten. +func copy1(v1 *obj.Addr, v2 *obj.Addr, r *gc.Flow, f int) bool { + if uint32(r.Active) == gactive { + if gc.Debug['P'] != 0 { + fmt.Printf("act set; return 1\n") + } + return true + } + + r.Active = int32(gactive) + if gc.Debug['P'] != 0 { + fmt.Printf("copy1 replace %v with %v f=%d\n", gc.Ctxt.Dconv(v2), gc.Ctxt.Dconv(v1), f) + } + var t int + var p *obj.Prog + for ; r != nil; r = r.S1 { + p = r.Prog + if gc.Debug['P'] != 0 { + fmt.Printf("%v", p) + } + if f == 0 && gc.Uniqp(r) == nil { + // Multiple predecessors; conservatively + // assume v1 was set on other path + f = 1 + + if gc.Debug['P'] != 0 { + fmt.Printf("; merge; f=%d", f) + } + } + + t = copyu(p, v2, nil) + switch t { + case 2: /* rar, can't split */ + if gc.Debug['P'] != 0 { + fmt.Printf("; %v rar; return 0\n", gc.Ctxt.Dconv(v2)) + } + return false + + case 3: /* set */ + if gc.Debug['P'] != 0 { + fmt.Printf("; %v set; return 1\n", gc.Ctxt.Dconv(v2)) + } + return true + + case 1, /* used, substitute */ + 4: /* use and set */ + if f != 0 { + if gc.Debug['P'] == 0 { + return false + } + if t == 4 { + fmt.Printf("; %v used+set and f=%d; return 0\n", gc.Ctxt.Dconv(v2), f) + } else { + fmt.Printf("; %v used and f=%d; return 0\n", gc.Ctxt.Dconv(v2), f) + } + return false + } + + if copyu(p, v2, v1) != 0 { + if gc.Debug['P'] != 0 { + fmt.Printf("; sub fail; return 0\n") + } + return false + } + + if gc.Debug['P'] != 0 { + fmt.Printf("; sub %v->%v\n => %v", gc.Ctxt.Dconv(v2), gc.Ctxt.Dconv(v1), p) + } + if t == 4 { + if gc.Debug['P'] != 0 { + fmt.Printf("; %v used+set; return 1\n", gc.Ctxt.Dconv(v2)) + } + return true + } + } + + if f == 0 { + t = copyu(p, v1, nil) + if f == 0 && (t == 2 || t == 3 || t == 4) { + f = 1 + if gc.Debug['P'] != 0 { + fmt.Printf("; %v set and !f; f=%d", gc.Ctxt.Dconv(v1), f) + } + } + } + + if gc.Debug['P'] != 0 { + fmt.Printf("\n") + } + if r.S2 != nil { + if !copy1(v1, v2, r.S2, f) { + return false + } + } + } + + return true +} + +// If s==nil, copyu returns the set/use of v in p; otherwise, it +// modifies p to replace reads of v with reads of s and returns 0 for +// success or non-zero for failure. +// +// If s==nil, copy returns one of the following values: +// 1 if v only used +// 2 if v is set and used in one address (read-alter-rewrite; +// can't substitute) +// 3 if v is only set +// 4 if v is set in one address and used in another (so addresses +// can be rewritten independently) +// 0 otherwise (not touched) +func copyu(p *obj.Prog, v *obj.Addr, s *obj.Addr) int { + if p.From3Type() != obj.TYPE_NONE { + // 9g never generates a from3 + fmt.Printf("copyu: from3 (%v) not implemented\n", gc.Ctxt.Dconv(p.From3)) + } + + switch p.As { + default: + fmt.Printf("copyu: can't find %v\n", obj.Aconv(int(p.As))) + return 2 + + case obj.ANOP, /* read p->from, write p->to */ + ppc64.AMOVH, + ppc64.AMOVHZ, + ppc64.AMOVB, + ppc64.AMOVBZ, + ppc64.AMOVW, + ppc64.AMOVWZ, + ppc64.AMOVD, + ppc64.ANEG, + ppc64.ANEGCC, + ppc64.AADDME, + ppc64.AADDMECC, + ppc64.AADDZE, + ppc64.AADDZECC, + ppc64.ASUBME, + ppc64.ASUBMECC, + ppc64.ASUBZE, + ppc64.ASUBZECC, + ppc64.AFCTIW, + ppc64.AFCTIWZ, + ppc64.AFCTID, + ppc64.AFCTIDZ, + ppc64.AFCFID, + ppc64.AFCFIDCC, + ppc64.AFMOVS, + ppc64.AFMOVD, + ppc64.AFRSP, + ppc64.AFNEG, + ppc64.AFNEGCC: + if s != nil { + if copysub(&p.From, v, s, 1) != 0 { + return 1 + } + + // Update only indirect uses of v in p->to + if !copyas(&p.To, v) { + if copysub(&p.To, v, s, 1) != 0 { + return 1 + } + } + return 0 + } + + if copyas(&p.To, v) { + // Fix up implicit from + if p.From.Type == obj.TYPE_NONE { + p.From = p.To + } + if copyau(&p.From, v) { + return 4 + } + return 3 + } + + if copyau(&p.From, v) { + return 1 + } + if copyau(&p.To, v) { + // p->to only indirectly uses v + return 1 + } + + return 0 + + case ppc64.AMOVBU, /* rar p->from, write p->to or read p->from, rar p->to */ + ppc64.AMOVBZU, + ppc64.AMOVHU, + ppc64.AMOVHZU, + ppc64.AMOVWZU, + ppc64.AMOVDU: + if p.From.Type == obj.TYPE_MEM { + if copyas(&p.From, v) { + // No s!=nil check; need to fail + // anyway in that case + return 2 + } + + if s != nil { + if copysub(&p.To, v, s, 1) != 0 { + return 1 + } + return 0 + } + + if copyas(&p.To, v) { + return 3 + } + } else if p.To.Type == obj.TYPE_MEM { + if copyas(&p.To, v) { + return 2 + } + if s != nil { + if copysub(&p.From, v, s, 1) != 0 { + return 1 + } + return 0 + } + + if copyau(&p.From, v) { + return 1 + } + } else { + fmt.Printf("copyu: bad %v\n", p) + } + + return 0 + + case ppc64.ARLWMI, /* read p->from, read p->reg, rar p->to */ + ppc64.ARLWMICC: + if copyas(&p.To, v) { + return 2 + } + fallthrough + + /* fall through */ + case ppc64.AADD, + /* read p->from, read p->reg, write p->to */ + ppc64.AADDC, + ppc64.AADDE, + ppc64.ASUB, + ppc64.ASLW, + ppc64.ASRW, + ppc64.ASRAW, + ppc64.ASLD, + ppc64.ASRD, + ppc64.ASRAD, + ppc64.AOR, + ppc64.AORCC, + ppc64.AORN, + ppc64.AORNCC, + ppc64.AAND, + ppc64.AANDCC, + ppc64.AANDN, + ppc64.AANDNCC, + ppc64.ANAND, + ppc64.ANANDCC, + ppc64.ANOR, + ppc64.ANORCC, + ppc64.AXOR, + ppc64.AMULHW, + ppc64.AMULHWU, + ppc64.AMULLW, + ppc64.AMULLD, + ppc64.ADIVW, + ppc64.ADIVD, + ppc64.ADIVWU, + ppc64.ADIVDU, + ppc64.AREM, + ppc64.AREMU, + ppc64.AREMD, + ppc64.AREMDU, + ppc64.ARLWNM, + ppc64.ARLWNMCC, + ppc64.AFADDS, + ppc64.AFADD, + ppc64.AFSUBS, + ppc64.AFSUB, + ppc64.AFMULS, + ppc64.AFMUL, + ppc64.AFDIVS, + ppc64.AFDIV: + if s != nil { + if copysub(&p.From, v, s, 1) != 0 { + return 1 + } + if copysub1(p, v, s, 1) != 0 { + return 1 + } + + // Update only indirect uses of v in p->to + if !copyas(&p.To, v) { + if copysub(&p.To, v, s, 1) != 0 { + return 1 + } + } + return 0 + } + + if copyas(&p.To, v) { + if p.Reg == 0 { + // Fix up implicit reg (e.g., ADD + // R3,R4 -> ADD R3,R4,R4) so we can + // update reg and to separately. + p.Reg = p.To.Reg + } + + if copyau(&p.From, v) { + return 4 + } + if copyau1(p, v) { + return 4 + } + return 3 + } + + if copyau(&p.From, v) { + return 1 + } + if copyau1(p, v) { + return 1 + } + if copyau(&p.To, v) { + return 1 + } + return 0 + + case ppc64.ABEQ, + ppc64.ABGT, + ppc64.ABGE, + ppc64.ABLT, + ppc64.ABLE, + ppc64.ABNE, + ppc64.ABVC, + ppc64.ABVS: + return 0 + + case obj.ACHECKNIL, /* read p->from */ + ppc64.ACMP, /* read p->from, read p->to */ + ppc64.ACMPU, + ppc64.ACMPW, + ppc64.ACMPWU, + ppc64.AFCMPO, + ppc64.AFCMPU: + if s != nil { + if copysub(&p.From, v, s, 1) != 0 { + return 1 + } + return copysub(&p.To, v, s, 1) + } + + if copyau(&p.From, v) { + return 1 + } + if copyau(&p.To, v) { + return 1 + } + return 0 + + // 9g never generates a branch to a GPR (this isn't + // even a normal instruction; liblink turns it in to a + // mov and a branch). + case ppc64.ABR: /* read p->to */ + if s != nil { + if copysub(&p.To, v, s, 1) != 0 { + return 1 + } + return 0 + } + + if copyau(&p.To, v) { + return 1 + } + return 0 + + case obj.ARET: /* funny */ + if s != nil { + return 0 + } + + // All registers die at this point, so claim + // everything is set (and not used). + return 3 + + case ppc64.ABL: /* funny */ + if v.Type == obj.TYPE_REG { + // TODO(rsc): REG_R0 and REG_F0 used to be + // (when register numbers started at 0) exregoffset and exfregoffset, + // which are unset entirely. + // It's strange that this handles R0 and F0 differently from the other + // registers. Possible failure to optimize? + if ppc64.REG_R0 < v.Reg && v.Reg <= ppc64.REGEXT { + return 2 + } + if v.Reg == ppc64.REGARG { + return 2 + } + if ppc64.REG_F0 < v.Reg && v.Reg <= ppc64.FREGEXT { + return 2 + } + } + + if p.From.Type == obj.TYPE_REG && v.Type == obj.TYPE_REG && p.From.Reg == v.Reg { + return 2 + } + + if s != nil { + if copysub(&p.To, v, s, 1) != 0 { + return 1 + } + return 0 + } + + if copyau(&p.To, v) { + return 4 + } + return 3 + + // R0 is zero, used by DUFFZERO, cannot be substituted. + // R3 is ptr to memory, used and set, cannot be substituted. + case obj.ADUFFZERO: + if v.Type == obj.TYPE_REG { + if v.Reg == 0 { + return 1 + } + if v.Reg == 3 { + return 2 + } + } + + return 0 + + // R3, R4 are ptr to src, dst, used and set, cannot be substituted. + // R5 is scratch, set by DUFFCOPY, cannot be substituted. + case obj.ADUFFCOPY: + if v.Type == obj.TYPE_REG { + if v.Reg == 3 || v.Reg == 4 { + return 2 + } + if v.Reg == 5 { + return 3 + } + } + + return 0 + + case obj.ATEXT: /* funny */ + if v.Type == obj.TYPE_REG { + if v.Reg == ppc64.REGARG { + return 3 + } + } + return 0 + + case obj.APCDATA, + obj.AFUNCDATA, + obj.AVARDEF, + obj.AVARKILL: + return 0 + } +} + +// copyas returns 1 if a and v address the same register. +// +// If a is the from operand, this means this operation reads the +// register in v. If a is the to operand, this means this operation +// writes the register in v. +func copyas(a *obj.Addr, v *obj.Addr) bool { + if regtyp(v) { + if a.Type == v.Type { + if a.Reg == v.Reg { + return true + } + } + } + return false +} + +// copyau returns 1 if a either directly or indirectly addresses the +// same register as v. +// +// If a is the from operand, this means this operation reads the +// register in v. If a is the to operand, this means the operation +// either reads or writes the register in v (if !copyas(a, v), then +// the operation reads the register in v). +func copyau(a *obj.Addr, v *obj.Addr) bool { + if copyas(a, v) { + return true + } + if v.Type == obj.TYPE_REG { + if a.Type == obj.TYPE_MEM || (a.Type == obj.TYPE_ADDR && a.Reg != 0) { + if v.Reg == a.Reg { + return true + } + } + } + return false +} + +// copyau1 returns 1 if p->reg references the same register as v and v +// is a direct reference. +func copyau1(p *obj.Prog, v *obj.Addr) bool { + if regtyp(v) && v.Reg != 0 { + if p.Reg == v.Reg { + return true + } + } + return false +} + +// copysub replaces v with s in a if f!=0 or indicates it if could if f==0. +// Returns 1 on failure to substitute (it always succeeds on ppc64). +func copysub(a *obj.Addr, v *obj.Addr, s *obj.Addr, f int) int { + if f != 0 { + if copyau(a, v) { + a.Reg = s.Reg + } + } + return 0 +} + +// copysub1 replaces v with s in p1->reg if f!=0 or indicates if it could if f==0. +// Returns 1 on failure to substitute (it always succeeds on ppc64). +func copysub1(p1 *obj.Prog, v *obj.Addr, s *obj.Addr, f int) int { + if f != 0 { + if copyau1(p1, v) { + p1.Reg = s.Reg + } + } + return 0 +} + +func sameaddr(a *obj.Addr, v *obj.Addr) bool { + if a.Type != v.Type { + return false + } + if regtyp(v) && a.Reg == v.Reg { + return true + } + if v.Type == obj.NAME_AUTO || v.Type == obj.NAME_PARAM { + if v.Offset == a.Offset { + return true + } + } + return false +} + +func smallindir(a *obj.Addr, reg *obj.Addr) bool { + return reg.Type == obj.TYPE_REG && a.Type == obj.TYPE_MEM && a.Reg == reg.Reg && 0 <= a.Offset && a.Offset < 4096 +} + +func stackaddr(a *obj.Addr) bool { + return a.Type == obj.TYPE_REG && a.Reg == ppc64.REGSP +} diff --git a/src/cmd/compile/internal/ppc64/prog.go b/src/cmd/compile/internal/ppc64/prog.go new file mode 100644 index 0000000000000000000000000000000000000000..328b2ce0cf3cc685f52c989667ce1334285ae062 --- /dev/null +++ b/src/cmd/compile/internal/ppc64/prog.go @@ -0,0 +1,314 @@ +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package ppc64 + +import ( + "cmd/compile/internal/gc" + "cmd/internal/obj" + "cmd/internal/obj/ppc64" +) + +const ( + LeftRdwr uint32 = gc.LeftRead | gc.LeftWrite + RightRdwr uint32 = gc.RightRead | gc.RightWrite +) + +// This table gives the basic information about instruction +// generated by the compiler and processed in the optimizer. +// See opt.h for bit definitions. +// +// Instructions not generated need not be listed. +// As an exception to that rule, we typically write down all the +// size variants of an operation even if we just use a subset. +// +// The table is formatted for 8-space tabs. +var progtable = [ppc64.ALAST]obj.ProgInfo{ + obj.ATYPE: {gc.Pseudo | gc.Skip, 0, 0, 0}, + obj.ATEXT: {gc.Pseudo, 0, 0, 0}, + obj.AFUNCDATA: {gc.Pseudo, 0, 0, 0}, + obj.APCDATA: {gc.Pseudo, 0, 0, 0}, + obj.AUNDEF: {gc.Break, 0, 0, 0}, + obj.AUSEFIELD: {gc.OK, 0, 0, 0}, + obj.ACHECKNIL: {gc.LeftRead, 0, 0, 0}, + obj.AVARDEF: {gc.Pseudo | gc.RightWrite, 0, 0, 0}, + obj.AVARKILL: {gc.Pseudo | gc.RightWrite, 0, 0, 0}, + + // NOP is an internal no-op that also stands + // for USED and SET annotations, not the Power opcode. + obj.ANOP: {gc.LeftRead | gc.RightWrite, 0, 0, 0}, + + // Integer + ppc64.AADD: {gc.SizeQ | gc.LeftRead | gc.RegRead | gc.RightWrite, 0, 0, 0}, + ppc64.ASUB: {gc.SizeQ | gc.LeftRead | gc.RegRead | gc.RightWrite, 0, 0, 0}, + ppc64.ANEG: {gc.SizeQ | gc.LeftRead | gc.RegRead | gc.RightWrite, 0, 0, 0}, + ppc64.AAND: {gc.SizeQ | gc.LeftRead | gc.RegRead | gc.RightWrite, 0, 0, 0}, + ppc64.AOR: {gc.SizeQ | gc.LeftRead | gc.RegRead | gc.RightWrite, 0, 0, 0}, + ppc64.AXOR: {gc.SizeQ | gc.LeftRead | gc.RegRead | gc.RightWrite, 0, 0, 0}, + ppc64.AMULLD: {gc.SizeQ | gc.LeftRead | gc.RegRead | gc.RightWrite, 0, 0, 0}, + ppc64.AMULLW: {gc.SizeL | gc.LeftRead | gc.RegRead | gc.RightWrite, 0, 0, 0}, + ppc64.AMULHD: {gc.SizeL | gc.LeftRead | gc.RegRead | gc.RightWrite, 0, 0, 0}, + ppc64.AMULHDU: {gc.SizeL | gc.LeftRead | gc.RegRead | gc.RightWrite, 0, 0, 0}, + ppc64.ADIVD: {gc.SizeQ | gc.LeftRead | gc.RegRead | gc.RightWrite, 0, 0, 0}, + ppc64.ADIVDU: {gc.SizeQ | gc.LeftRead | gc.RegRead | gc.RightWrite, 0, 0, 0}, + ppc64.ASLD: {gc.SizeQ | gc.LeftRead | gc.RegRead | gc.RightWrite, 0, 0, 0}, + ppc64.ASRD: {gc.SizeQ | gc.LeftRead | gc.RegRead | gc.RightWrite, 0, 0, 0}, + ppc64.ASRAD: {gc.SizeQ | gc.LeftRead | gc.RegRead | gc.RightWrite, 0, 0, 0}, + ppc64.ACMP: {gc.SizeQ | gc.LeftRead | gc.RightRead, 0, 0, 0}, + ppc64.ACMPU: {gc.SizeQ | gc.LeftRead | gc.RightRead, 0, 0, 0}, + ppc64.ATD: {gc.SizeQ | gc.RightRead, 0, 0, 0}, + + // Floating point. + ppc64.AFADD: {gc.SizeD | gc.LeftRead | gc.RegRead | gc.RightWrite, 0, 0, 0}, + ppc64.AFADDS: {gc.SizeF | gc.LeftRead | gc.RegRead | gc.RightWrite, 0, 0, 0}, + ppc64.AFSUB: {gc.SizeD | gc.LeftRead | gc.RegRead | gc.RightWrite, 0, 0, 0}, + ppc64.AFSUBS: {gc.SizeF | gc.LeftRead | gc.RegRead | gc.RightWrite, 0, 0, 0}, + ppc64.AFMUL: {gc.SizeD | gc.LeftRead | gc.RegRead | gc.RightWrite, 0, 0, 0}, + ppc64.AFMULS: {gc.SizeF | gc.LeftRead | gc.RegRead | gc.RightWrite, 0, 0, 0}, + ppc64.AFDIV: {gc.SizeD | gc.LeftRead | gc.RegRead | gc.RightWrite, 0, 0, 0}, + ppc64.AFDIVS: {gc.SizeF | gc.LeftRead | gc.RegRead | gc.RightWrite, 0, 0, 0}, + ppc64.AFCTIDZ: {gc.SizeF | gc.LeftRead | gc.RegRead | gc.RightWrite, 0, 0, 0}, + ppc64.AFCFID: {gc.SizeF | gc.LeftRead | gc.RegRead | gc.RightWrite, 0, 0, 0}, + ppc64.AFCMPU: {gc.SizeD | gc.LeftRead | gc.RightRead, 0, 0, 0}, + ppc64.AFRSP: {gc.SizeD | gc.LeftRead | gc.RightWrite | gc.Conv, 0, 0, 0}, + + // Moves + ppc64.AMOVB: {gc.SizeB | gc.LeftRead | gc.RightWrite | gc.Move | gc.Conv, 0, 0, 0}, + ppc64.AMOVBU: {gc.SizeB | gc.LeftRead | gc.RightWrite | gc.Move | gc.Conv | gc.PostInc, 0, 0, 0}, + ppc64.AMOVBZ: {gc.SizeB | gc.LeftRead | gc.RightWrite | gc.Move | gc.Conv, 0, 0, 0}, + ppc64.AMOVH: {gc.SizeW | gc.LeftRead | gc.RightWrite | gc.Move | gc.Conv, 0, 0, 0}, + ppc64.AMOVHU: {gc.SizeW | gc.LeftRead | gc.RightWrite | gc.Move | gc.Conv | gc.PostInc, 0, 0, 0}, + ppc64.AMOVHZ: {gc.SizeW | gc.LeftRead | gc.RightWrite | gc.Move | gc.Conv, 0, 0, 0}, + ppc64.AMOVW: {gc.SizeL | gc.LeftRead | gc.RightWrite | gc.Move | gc.Conv, 0, 0, 0}, + + // there is no AMOVWU. + ppc64.AMOVWZU: {gc.SizeL | gc.LeftRead | gc.RightWrite | gc.Move | gc.Conv | gc.PostInc, 0, 0, 0}, + ppc64.AMOVWZ: {gc.SizeL | gc.LeftRead | gc.RightWrite | gc.Move | gc.Conv, 0, 0, 0}, + ppc64.AMOVD: {gc.SizeQ | gc.LeftRead | gc.RightWrite | gc.Move, 0, 0, 0}, + ppc64.AMOVDU: {gc.SizeQ | gc.LeftRead | gc.RightWrite | gc.Move | gc.PostInc, 0, 0, 0}, + ppc64.AFMOVS: {gc.SizeF | gc.LeftRead | gc.RightWrite | gc.Move | gc.Conv, 0, 0, 0}, + ppc64.AFMOVD: {gc.SizeD | gc.LeftRead | gc.RightWrite | gc.Move, 0, 0, 0}, + + // Jumps + ppc64.ABR: {gc.Jump | gc.Break, 0, 0, 0}, + ppc64.ABL: {gc.Call, 0, 0, 0}, + ppc64.ABEQ: {gc.Cjmp, 0, 0, 0}, + ppc64.ABNE: {gc.Cjmp, 0, 0, 0}, + ppc64.ABGE: {gc.Cjmp, 0, 0, 0}, + ppc64.ABLT: {gc.Cjmp, 0, 0, 0}, + ppc64.ABGT: {gc.Cjmp, 0, 0, 0}, + ppc64.ABLE: {gc.Cjmp, 0, 0, 0}, + obj.ARET: {gc.Break, 0, 0, 0}, + obj.ADUFFZERO: {gc.Call, 0, 0, 0}, + obj.ADUFFCOPY: {gc.Call, 0, 0, 0}, +} + +var initproginfo_initialized int + +func initproginfo() { + var addvariant = []int{V_CC, V_V, V_CC | V_V} + + if initproginfo_initialized != 0 { + return + } + initproginfo_initialized = 1 + + // Perform one-time expansion of instructions in progtable to + // their CC, V, and VCC variants + var as2 int + var i int + var variant int + for as := int(0); as < len(progtable); as++ { + if progtable[as].Flags == 0 { + continue + } + variant = as2variant(as) + for i = 0; i < len(addvariant); i++ { + as2 = variant2as(as, variant|addvariant[i]) + if as2 != 0 && progtable[as2].Flags == 0 { + progtable[as2] = progtable[as] + } + } + } +} + +func proginfo(p *obj.Prog) { + initproginfo() + + info := &p.Info + *info = progtable[p.As] + if info.Flags == 0 { + gc.Fatal("proginfo: unknown instruction %v", p) + } + + if (info.Flags&gc.RegRead != 0) && p.Reg == 0 { + info.Flags &^= gc.RegRead + info.Flags |= gc.RightRead /*CanRegRead |*/ + } + + if (p.From.Type == obj.TYPE_MEM || p.From.Type == obj.TYPE_ADDR) && p.From.Reg != 0 { + info.Regindex |= RtoB(int(p.From.Reg)) + if info.Flags&gc.PostInc != 0 { + info.Regset |= RtoB(int(p.From.Reg)) + } + } + + if (p.To.Type == obj.TYPE_MEM || p.To.Type == obj.TYPE_ADDR) && p.To.Reg != 0 { + info.Regindex |= RtoB(int(p.To.Reg)) + if info.Flags&gc.PostInc != 0 { + info.Regset |= RtoB(int(p.To.Reg)) + } + } + + if p.From.Type == obj.TYPE_ADDR && p.From.Sym != nil && (info.Flags&gc.LeftRead != 0) { + info.Flags &^= gc.LeftRead + info.Flags |= gc.LeftAddr + } + + if p.As == obj.ADUFFZERO { + info.Reguse |= 1<<0 | RtoB(ppc64.REG_R3) + info.Regset |= RtoB(ppc64.REG_R3) + } + + if p.As == obj.ADUFFCOPY { + // TODO(austin) Revisit when duffcopy is implemented + info.Reguse |= RtoB(ppc64.REG_R3) | RtoB(ppc64.REG_R4) | RtoB(ppc64.REG_R5) + + info.Regset |= RtoB(ppc64.REG_R3) | RtoB(ppc64.REG_R4) + } +} + +// Instruction variants table. Initially this contains entries only +// for the "base" form of each instruction. On the first call to +// as2variant or variant2as, we'll add the variants to the table. +var varianttable = [ppc64.ALAST][4]int{ + ppc64.AADD: [4]int{ppc64.AADD, ppc64.AADDCC, ppc64.AADDV, ppc64.AADDVCC}, + ppc64.AADDC: [4]int{ppc64.AADDC, ppc64.AADDCCC, ppc64.AADDCV, ppc64.AADDCVCC}, + ppc64.AADDE: [4]int{ppc64.AADDE, ppc64.AADDECC, ppc64.AADDEV, ppc64.AADDEVCC}, + ppc64.AADDME: [4]int{ppc64.AADDME, ppc64.AADDMECC, ppc64.AADDMEV, ppc64.AADDMEVCC}, + ppc64.AADDZE: [4]int{ppc64.AADDZE, ppc64.AADDZECC, ppc64.AADDZEV, ppc64.AADDZEVCC}, + ppc64.AAND: [4]int{ppc64.AAND, ppc64.AANDCC, 0, 0}, + ppc64.AANDN: [4]int{ppc64.AANDN, ppc64.AANDNCC, 0, 0}, + ppc64.ACNTLZD: [4]int{ppc64.ACNTLZD, ppc64.ACNTLZDCC, 0, 0}, + ppc64.ACNTLZW: [4]int{ppc64.ACNTLZW, ppc64.ACNTLZWCC, 0, 0}, + ppc64.ADIVD: [4]int{ppc64.ADIVD, ppc64.ADIVDCC, ppc64.ADIVDV, ppc64.ADIVDVCC}, + ppc64.ADIVDU: [4]int{ppc64.ADIVDU, ppc64.ADIVDUCC, ppc64.ADIVDUV, ppc64.ADIVDUVCC}, + ppc64.ADIVW: [4]int{ppc64.ADIVW, ppc64.ADIVWCC, ppc64.ADIVWV, ppc64.ADIVWVCC}, + ppc64.ADIVWU: [4]int{ppc64.ADIVWU, ppc64.ADIVWUCC, ppc64.ADIVWUV, ppc64.ADIVWUVCC}, + ppc64.AEQV: [4]int{ppc64.AEQV, ppc64.AEQVCC, 0, 0}, + ppc64.AEXTSB: [4]int{ppc64.AEXTSB, ppc64.AEXTSBCC, 0, 0}, + ppc64.AEXTSH: [4]int{ppc64.AEXTSH, ppc64.AEXTSHCC, 0, 0}, + ppc64.AEXTSW: [4]int{ppc64.AEXTSW, ppc64.AEXTSWCC, 0, 0}, + ppc64.AFABS: [4]int{ppc64.AFABS, ppc64.AFABSCC, 0, 0}, + ppc64.AFADD: [4]int{ppc64.AFADD, ppc64.AFADDCC, 0, 0}, + ppc64.AFADDS: [4]int{ppc64.AFADDS, ppc64.AFADDSCC, 0, 0}, + ppc64.AFCFID: [4]int{ppc64.AFCFID, ppc64.AFCFIDCC, 0, 0}, + ppc64.AFCTID: [4]int{ppc64.AFCTID, ppc64.AFCTIDCC, 0, 0}, + ppc64.AFCTIDZ: [4]int{ppc64.AFCTIDZ, ppc64.AFCTIDZCC, 0, 0}, + ppc64.AFCTIW: [4]int{ppc64.AFCTIW, ppc64.AFCTIWCC, 0, 0}, + ppc64.AFCTIWZ: [4]int{ppc64.AFCTIWZ, ppc64.AFCTIWZCC, 0, 0}, + ppc64.AFDIV: [4]int{ppc64.AFDIV, ppc64.AFDIVCC, 0, 0}, + ppc64.AFDIVS: [4]int{ppc64.AFDIVS, ppc64.AFDIVSCC, 0, 0}, + ppc64.AFMADD: [4]int{ppc64.AFMADD, ppc64.AFMADDCC, 0, 0}, + ppc64.AFMADDS: [4]int{ppc64.AFMADDS, ppc64.AFMADDSCC, 0, 0}, + ppc64.AFMOVD: [4]int{ppc64.AFMOVD, ppc64.AFMOVDCC, 0, 0}, + ppc64.AFMSUB: [4]int{ppc64.AFMSUB, ppc64.AFMSUBCC, 0, 0}, + ppc64.AFMSUBS: [4]int{ppc64.AFMSUBS, ppc64.AFMSUBSCC, 0, 0}, + ppc64.AFMUL: [4]int{ppc64.AFMUL, ppc64.AFMULCC, 0, 0}, + ppc64.AFMULS: [4]int{ppc64.AFMULS, ppc64.AFMULSCC, 0, 0}, + ppc64.AFNABS: [4]int{ppc64.AFNABS, ppc64.AFNABSCC, 0, 0}, + ppc64.AFNEG: [4]int{ppc64.AFNEG, ppc64.AFNEGCC, 0, 0}, + ppc64.AFNMADD: [4]int{ppc64.AFNMADD, ppc64.AFNMADDCC, 0, 0}, + ppc64.AFNMADDS: [4]int{ppc64.AFNMADDS, ppc64.AFNMADDSCC, 0, 0}, + ppc64.AFNMSUB: [4]int{ppc64.AFNMSUB, ppc64.AFNMSUBCC, 0, 0}, + ppc64.AFNMSUBS: [4]int{ppc64.AFNMSUBS, ppc64.AFNMSUBSCC, 0, 0}, + ppc64.AFRES: [4]int{ppc64.AFRES, ppc64.AFRESCC, 0, 0}, + ppc64.AFRSP: [4]int{ppc64.AFRSP, ppc64.AFRSPCC, 0, 0}, + ppc64.AFRSQRTE: [4]int{ppc64.AFRSQRTE, ppc64.AFRSQRTECC, 0, 0}, + ppc64.AFSEL: [4]int{ppc64.AFSEL, ppc64.AFSELCC, 0, 0}, + ppc64.AFSQRT: [4]int{ppc64.AFSQRT, ppc64.AFSQRTCC, 0, 0}, + ppc64.AFSQRTS: [4]int{ppc64.AFSQRTS, ppc64.AFSQRTSCC, 0, 0}, + ppc64.AFSUB: [4]int{ppc64.AFSUB, ppc64.AFSUBCC, 0, 0}, + ppc64.AFSUBS: [4]int{ppc64.AFSUBS, ppc64.AFSUBSCC, 0, 0}, + ppc64.AMTFSB0: [4]int{ppc64.AMTFSB0, ppc64.AMTFSB0CC, 0, 0}, + ppc64.AMTFSB1: [4]int{ppc64.AMTFSB1, ppc64.AMTFSB1CC, 0, 0}, + ppc64.AMULHD: [4]int{ppc64.AMULHD, ppc64.AMULHDCC, 0, 0}, + ppc64.AMULHDU: [4]int{ppc64.AMULHDU, ppc64.AMULHDUCC, 0, 0}, + ppc64.AMULHW: [4]int{ppc64.AMULHW, ppc64.AMULHWCC, 0, 0}, + ppc64.AMULHWU: [4]int{ppc64.AMULHWU, ppc64.AMULHWUCC, 0, 0}, + ppc64.AMULLD: [4]int{ppc64.AMULLD, ppc64.AMULLDCC, ppc64.AMULLDV, ppc64.AMULLDVCC}, + ppc64.AMULLW: [4]int{ppc64.AMULLW, ppc64.AMULLWCC, ppc64.AMULLWV, ppc64.AMULLWVCC}, + ppc64.ANAND: [4]int{ppc64.ANAND, ppc64.ANANDCC, 0, 0}, + ppc64.ANEG: [4]int{ppc64.ANEG, ppc64.ANEGCC, ppc64.ANEGV, ppc64.ANEGVCC}, + ppc64.ANOR: [4]int{ppc64.ANOR, ppc64.ANORCC, 0, 0}, + ppc64.AOR: [4]int{ppc64.AOR, ppc64.AORCC, 0, 0}, + ppc64.AORN: [4]int{ppc64.AORN, ppc64.AORNCC, 0, 0}, + ppc64.AREM: [4]int{ppc64.AREM, ppc64.AREMCC, ppc64.AREMV, ppc64.AREMVCC}, + ppc64.AREMD: [4]int{ppc64.AREMD, ppc64.AREMDCC, ppc64.AREMDV, ppc64.AREMDVCC}, + ppc64.AREMDU: [4]int{ppc64.AREMDU, ppc64.AREMDUCC, ppc64.AREMDUV, ppc64.AREMDUVCC}, + ppc64.AREMU: [4]int{ppc64.AREMU, ppc64.AREMUCC, ppc64.AREMUV, ppc64.AREMUVCC}, + ppc64.ARLDC: [4]int{ppc64.ARLDC, ppc64.ARLDCCC, 0, 0}, + ppc64.ARLDCL: [4]int{ppc64.ARLDCL, ppc64.ARLDCLCC, 0, 0}, + ppc64.ARLDCR: [4]int{ppc64.ARLDCR, ppc64.ARLDCRCC, 0, 0}, + ppc64.ARLDMI: [4]int{ppc64.ARLDMI, ppc64.ARLDMICC, 0, 0}, + ppc64.ARLWMI: [4]int{ppc64.ARLWMI, ppc64.ARLWMICC, 0, 0}, + ppc64.ARLWNM: [4]int{ppc64.ARLWNM, ppc64.ARLWNMCC, 0, 0}, + ppc64.ASLD: [4]int{ppc64.ASLD, ppc64.ASLDCC, 0, 0}, + ppc64.ASLW: [4]int{ppc64.ASLW, ppc64.ASLWCC, 0, 0}, + ppc64.ASRAD: [4]int{ppc64.ASRAD, ppc64.ASRADCC, 0, 0}, + ppc64.ASRAW: [4]int{ppc64.ASRAW, ppc64.ASRAWCC, 0, 0}, + ppc64.ASRD: [4]int{ppc64.ASRD, ppc64.ASRDCC, 0, 0}, + ppc64.ASRW: [4]int{ppc64.ASRW, ppc64.ASRWCC, 0, 0}, + ppc64.ASUB: [4]int{ppc64.ASUB, ppc64.ASUBCC, ppc64.ASUBV, ppc64.ASUBVCC}, + ppc64.ASUBC: [4]int{ppc64.ASUBC, ppc64.ASUBCCC, ppc64.ASUBCV, ppc64.ASUBCVCC}, + ppc64.ASUBE: [4]int{ppc64.ASUBE, ppc64.ASUBECC, ppc64.ASUBEV, ppc64.ASUBEVCC}, + ppc64.ASUBME: [4]int{ppc64.ASUBME, ppc64.ASUBMECC, ppc64.ASUBMEV, ppc64.ASUBMEVCC}, + ppc64.ASUBZE: [4]int{ppc64.ASUBZE, ppc64.ASUBZECC, ppc64.ASUBZEV, ppc64.ASUBZEVCC}, + ppc64.AXOR: [4]int{ppc64.AXOR, ppc64.AXORCC, 0, 0}, +} + +var initvariants_initialized int + +func initvariants() { + if initvariants_initialized != 0 { + return + } + initvariants_initialized = 1 + + var j int + for i := int(0); i < len(varianttable); i++ { + if varianttable[i][0] == 0 { + // Instruction has no variants + varianttable[i][0] = i + + continue + } + + // Copy base form to other variants + if varianttable[i][0] == i { + for j = 0; j < len(varianttable[i]); j++ { + varianttable[varianttable[i][j]] = varianttable[i] + } + } + } +} + +// as2variant returns the variant (V_*) flags of instruction as. +func as2variant(as int) int { + initvariants() + for i := int(0); i < len(varianttable[as]); i++ { + if varianttable[as][i] == as { + return i + } + } + gc.Fatal("as2variant: instruction %v is not a variant of itself", obj.Aconv(as)) + return 0 +} + +// variant2as returns the instruction as with the given variant (V_*) flags. +// If no such variant exists, this returns 0. +func variant2as(as int, flags int) int { + initvariants() + return varianttable[as][flags] +} diff --git a/src/cmd/compile/internal/ppc64/reg.go b/src/cmd/compile/internal/ppc64/reg.go new file mode 100644 index 0000000000000000000000000000000000000000..fa1cb71975e511316b44887eb471989503690f6c --- /dev/null +++ b/src/cmd/compile/internal/ppc64/reg.go @@ -0,0 +1,162 @@ +// Derived from Inferno utils/6c/reg.c +// http://code.google.com/p/inferno-os/source/browse/utils/6c/reg.c +// +// Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved. +// Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net) +// Portions Copyright © 1997-1999 Vita Nuova Limited +// Portions Copyright © 2000-2007 Vita Nuova Holdings Limited (www.vitanuova.com) +// Portions Copyright © 2004,2006 Bruce Ellis +// Portions Copyright © 2005-2007 C H Forsyth (forsyth@terzarima.net) +// Revisions Copyright © 2000-2007 Lucent Technologies Inc. and others +// Portions Copyright © 2009 The Go Authors. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +package ppc64 + +import "cmd/internal/obj/ppc64" +import "cmd/compile/internal/gc" + +const ( + NREGVAR = 64 /* 32 general + 32 floating */ +) + +var regname = []string{ + ".R0", + ".R1", + ".R2", + ".R3", + ".R4", + ".R5", + ".R6", + ".R7", + ".R8", + ".R9", + ".R10", + ".R11", + ".R12", + ".R13", + ".R14", + ".R15", + ".R16", + ".R17", + ".R18", + ".R19", + ".R20", + ".R21", + ".R22", + ".R23", + ".R24", + ".R25", + ".R26", + ".R27", + ".R28", + ".R29", + ".R30", + ".R31", + ".F0", + ".F1", + ".F2", + ".F3", + ".F4", + ".F5", + ".F6", + ".F7", + ".F8", + ".F9", + ".F10", + ".F11", + ".F12", + ".F13", + ".F14", + ".F15", + ".F16", + ".F17", + ".F18", + ".F19", + ".F20", + ".F21", + ".F22", + ".F23", + ".F24", + ".F25", + ".F26", + ".F27", + ".F28", + ".F29", + ".F30", + ".F31", +} + +func regnames(n *int) []string { + *n = NREGVAR + return regname +} + +func excludedregs() uint64 { + // Exclude registers with fixed functions + regbits := uint64(1<<0 | RtoB(ppc64.REGSP) | RtoB(ppc64.REGG) | RtoB(ppc64.REGTLS)) + + // Also exclude floating point registers with fixed constants + regbits |= RtoB(ppc64.REG_F27) | RtoB(ppc64.REG_F28) | RtoB(ppc64.REG_F29) | RtoB(ppc64.REG_F30) | RtoB(ppc64.REG_F31) + + return regbits +} + +func doregbits(r int) uint64 { + return 0 +} + +/* + * track register variables including external registers: + * bit reg + * 0 R0 + * 1 R1 + * ... ... + * 31 R31 + * 32+0 F0 + * 32+1 F1 + * ... ... + * 32+31 F31 + */ +func RtoB(r int) uint64 { + if r > ppc64.REG_R0 && r <= ppc64.REG_R31 { + return 1 << uint(r-ppc64.REG_R0) + } + if r >= ppc64.REG_F0 && r <= ppc64.REG_F31 { + return 1 << uint(32+r-ppc64.REG_F0) + } + return 0 +} + +func BtoR(b uint64) int { + b &= 0xffffffff + if b == 0 { + return 0 + } + return gc.Bitno(b) + ppc64.REG_R0 +} + +func BtoF(b uint64) int { + b >>= 32 + if b == 0 { + return 0 + } + return gc.Bitno(b) + ppc64.REG_F0 +} diff --git a/src/cmd/compile/internal/x86/cgen.go b/src/cmd/compile/internal/x86/cgen.go new file mode 100644 index 0000000000000000000000000000000000000000..1768674e4296442acccb369f8f5f7c8fab6dab22 --- /dev/null +++ b/src/cmd/compile/internal/x86/cgen.go @@ -0,0 +1,159 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package x86 + +import ( + "cmd/compile/internal/gc" + "cmd/internal/obj" + "cmd/internal/obj/x86" +) + +/* + * generate an addressable node in res, containing the value of n. + * n is an array index, and might be any size; res width is <= 32-bit. + * returns Prog* to patch to panic call. + */ +func igenindex(n *gc.Node, res *gc.Node, bounded bool) *obj.Prog { + if !gc.Is64(n.Type) { + if n.Addable && (gc.Simtype[n.Etype] == gc.TUINT32 || gc.Simtype[n.Etype] == gc.TINT32) { + // nothing to do. + *res = *n + } else { + gc.Tempname(res, gc.Types[gc.TUINT32]) + gc.Cgen(n, res) + } + + return nil + } + + var tmp gc.Node + gc.Tempname(&tmp, gc.Types[gc.TINT64]) + gc.Cgen(n, &tmp) + var lo gc.Node + var hi gc.Node + split64(&tmp, &lo, &hi) + gc.Tempname(res, gc.Types[gc.TUINT32]) + gmove(&lo, res) + if bounded { + splitclean() + return nil + } + + var zero gc.Node + gc.Nodconst(&zero, gc.Types[gc.TINT32], 0) + gins(x86.ACMPL, &hi, &zero) + splitclean() + return gc.Gbranch(x86.AJNE, nil, +1) +} + +func blockcopy(n, res *gc.Node, osrc, odst, w int64) { + var dst gc.Node + gc.Nodreg(&dst, gc.Types[gc.Tptr], x86.REG_DI) + var src gc.Node + gc.Nodreg(&src, gc.Types[gc.Tptr], x86.REG_SI) + + var tsrc gc.Node + gc.Tempname(&tsrc, gc.Types[gc.Tptr]) + var tdst gc.Node + gc.Tempname(&tdst, gc.Types[gc.Tptr]) + if !n.Addable { + gc.Agen(n, &tsrc) + } + if !res.Addable { + gc.Agen(res, &tdst) + } + if n.Addable { + gc.Agen(n, &src) + } else { + gmove(&tsrc, &src) + } + + if res.Op == gc.ONAME { + gc.Gvardef(res) + } + + if res.Addable { + gc.Agen(res, &dst) + } else { + gmove(&tdst, &dst) + } + + c := int32(w % 4) // bytes + q := int32(w / 4) // doublewords + + // if we are copying forward on the stack and + // the src and dst overlap, then reverse direction + if osrc < odst && int64(odst) < int64(osrc)+w { + // reverse direction + gins(x86.ASTD, nil, nil) // set direction flag + if c > 0 { + gconreg(x86.AADDL, w-1, x86.REG_SI) + gconreg(x86.AADDL, w-1, x86.REG_DI) + + gconreg(x86.AMOVL, int64(c), x86.REG_CX) + gins(x86.AREP, nil, nil) // repeat + gins(x86.AMOVSB, nil, nil) // MOVB *(SI)-,*(DI)- + } + + if q > 0 { + if c > 0 { + gconreg(x86.AADDL, -3, x86.REG_SI) + gconreg(x86.AADDL, -3, x86.REG_DI) + } else { + gconreg(x86.AADDL, w-4, x86.REG_SI) + gconreg(x86.AADDL, w-4, x86.REG_DI) + } + + gconreg(x86.AMOVL, int64(q), x86.REG_CX) + gins(x86.AREP, nil, nil) // repeat + gins(x86.AMOVSL, nil, nil) // MOVL *(SI)-,*(DI)- + } + + // we leave with the flag clear + gins(x86.ACLD, nil, nil) + } else { + gins(x86.ACLD, nil, nil) // paranoia. TODO(rsc): remove? + + // normal direction + if q > 128 || (q >= 4 && gc.Nacl) { + gconreg(x86.AMOVL, int64(q), x86.REG_CX) + gins(x86.AREP, nil, nil) // repeat + gins(x86.AMOVSL, nil, nil) // MOVL *(SI)+,*(DI)+ + } else if q >= 4 { + p := gins(obj.ADUFFCOPY, nil, nil) + p.To.Type = obj.TYPE_ADDR + p.To.Sym = gc.Linksym(gc.Pkglookup("duffcopy", gc.Runtimepkg)) + + // 10 and 128 = magic constants: see ../../runtime/asm_386.s + p.To.Offset = 10 * (128 - int64(q)) + } else if !gc.Nacl && c == 0 { + var cx gc.Node + gc.Nodreg(&cx, gc.Types[gc.TINT32], x86.REG_CX) + + // We don't need the MOVSL side-effect of updating SI and DI, + // and issuing a sequence of MOVLs directly is faster. + src.Op = gc.OINDREG + + dst.Op = gc.OINDREG + for q > 0 { + gmove(&src, &cx) // MOVL x+(SI),CX + gmove(&cx, &dst) // MOVL CX,x+(DI) + src.Xoffset += 4 + dst.Xoffset += 4 + q-- + } + } else { + for q > 0 { + gins(x86.AMOVSL, nil, nil) // MOVL *(SI)+,*(DI)+ + q-- + } + } + + for c > 0 { + gins(x86.AMOVSB, nil, nil) // MOVB *(SI)+,*(DI)+ + c-- + } + } +} diff --git a/src/cmd/compile/internal/x86/cgen64.go b/src/cmd/compile/internal/x86/cgen64.go new file mode 100644 index 0000000000000000000000000000000000000000..0b061ffb60d212e203e3cdd3fadc5f8d4bf480a1 --- /dev/null +++ b/src/cmd/compile/internal/x86/cgen64.go @@ -0,0 +1,598 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package x86 + +import ( + "cmd/compile/internal/gc" + "cmd/internal/obj" + "cmd/internal/obj/x86" +) + +/* + * attempt to generate 64-bit + * res = n + * return 1 on success, 0 if op not handled. + */ +func cgen64(n *gc.Node, res *gc.Node) { + if res.Op != gc.OINDREG && res.Op != gc.ONAME { + gc.Dump("n", n) + gc.Dump("res", res) + gc.Fatal("cgen64 %v of %v", gc.Oconv(int(n.Op), 0), gc.Oconv(int(res.Op), 0)) + } + + switch n.Op { + default: + gc.Fatal("cgen64 %v", gc.Oconv(int(n.Op), 0)) + + case gc.OMINUS: + gc.Cgen(n.Left, res) + var hi1 gc.Node + var lo1 gc.Node + split64(res, &lo1, &hi1) + gins(x86.ANEGL, nil, &lo1) + gins(x86.AADCL, ncon(0), &hi1) + gins(x86.ANEGL, nil, &hi1) + splitclean() + return + + case gc.OCOM: + gc.Cgen(n.Left, res) + var lo1 gc.Node + var hi1 gc.Node + split64(res, &lo1, &hi1) + gins(x86.ANOTL, nil, &lo1) + gins(x86.ANOTL, nil, &hi1) + splitclean() + return + + // binary operators. + // common setup below. + case gc.OADD, + gc.OSUB, + gc.OMUL, + gc.OLROT, + gc.OLSH, + gc.ORSH, + gc.OAND, + gc.OOR, + gc.OXOR: + break + } + + l := n.Left + r := n.Right + if !l.Addable { + var t1 gc.Node + gc.Tempname(&t1, l.Type) + gc.Cgen(l, &t1) + l = &t1 + } + + if r != nil && !r.Addable { + var t2 gc.Node + gc.Tempname(&t2, r.Type) + gc.Cgen(r, &t2) + r = &t2 + } + + var ax gc.Node + gc.Nodreg(&ax, gc.Types[gc.TINT32], x86.REG_AX) + var cx gc.Node + gc.Nodreg(&cx, gc.Types[gc.TINT32], x86.REG_CX) + var dx gc.Node + gc.Nodreg(&dx, gc.Types[gc.TINT32], x86.REG_DX) + + // Setup for binary operation. + var hi1 gc.Node + var lo1 gc.Node + split64(l, &lo1, &hi1) + + var lo2 gc.Node + var hi2 gc.Node + if gc.Is64(r.Type) { + split64(r, &lo2, &hi2) + } + + // Do op. Leave result in DX:AX. + switch n.Op { + // TODO: Constants + case gc.OADD: + gins(x86.AMOVL, &lo1, &ax) + + gins(x86.AMOVL, &hi1, &dx) + gins(x86.AADDL, &lo2, &ax) + gins(x86.AADCL, &hi2, &dx) + + // TODO: Constants. + case gc.OSUB: + gins(x86.AMOVL, &lo1, &ax) + + gins(x86.AMOVL, &hi1, &dx) + gins(x86.ASUBL, &lo2, &ax) + gins(x86.ASBBL, &hi2, &dx) + + // let's call the next two EX and FX. + case gc.OMUL: + var ex gc.Node + gc.Regalloc(&ex, gc.Types[gc.TPTR32], nil) + + var fx gc.Node + gc.Regalloc(&fx, gc.Types[gc.TPTR32], nil) + + // load args into DX:AX and EX:CX. + gins(x86.AMOVL, &lo1, &ax) + + gins(x86.AMOVL, &hi1, &dx) + gins(x86.AMOVL, &lo2, &cx) + gins(x86.AMOVL, &hi2, &ex) + + // if DX and EX are zero, use 32 x 32 -> 64 unsigned multiply. + gins(x86.AMOVL, &dx, &fx) + + gins(x86.AORL, &ex, &fx) + p1 := gc.Gbranch(x86.AJNE, nil, 0) + gins(x86.AMULL, &cx, nil) // implicit &ax + p2 := gc.Gbranch(obj.AJMP, nil, 0) + gc.Patch(p1, gc.Pc) + + // full 64x64 -> 64, from 32x32 -> 64. + gins(x86.AIMULL, &cx, &dx) + + gins(x86.AMOVL, &ax, &fx) + gins(x86.AIMULL, &ex, &fx) + gins(x86.AADDL, &dx, &fx) + gins(x86.AMOVL, &cx, &dx) + gins(x86.AMULL, &dx, nil) // implicit &ax + gins(x86.AADDL, &fx, &dx) + gc.Patch(p2, gc.Pc) + + gc.Regfree(&ex) + gc.Regfree(&fx) + + // We only rotate by a constant c in [0,64). + // if c >= 32: + // lo, hi = hi, lo + // c -= 32 + // if c == 0: + // no-op + // else: + // t = hi + // shld hi:lo, c + // shld lo:t, c + case gc.OLROT: + v := uint64(r.Int()) + + if v >= 32 { + // reverse during load to do the first 32 bits of rotate + v -= 32 + + gins(x86.AMOVL, &lo1, &dx) + gins(x86.AMOVL, &hi1, &ax) + } else { + gins(x86.AMOVL, &lo1, &ax) + gins(x86.AMOVL, &hi1, &dx) + } + + if v == 0 { + } else // done + { + gins(x86.AMOVL, &dx, &cx) + p1 := gins(x86.ASHLL, ncon(uint32(v)), &dx) + p1.From.Index = x86.REG_AX // double-width shift + p1.From.Scale = 0 + p1 = gins(x86.ASHLL, ncon(uint32(v)), &ax) + p1.From.Index = x86.REG_CX // double-width shift + p1.From.Scale = 0 + } + + case gc.OLSH: + if r.Op == gc.OLITERAL { + v := uint64(r.Int()) + if v >= 64 { + if gc.Is64(r.Type) { + splitclean() + } + splitclean() + split64(res, &lo2, &hi2) + gins(x86.AMOVL, ncon(0), &lo2) + gins(x86.AMOVL, ncon(0), &hi2) + splitclean() + return + } + + if v >= 32 { + if gc.Is64(r.Type) { + splitclean() + } + split64(res, &lo2, &hi2) + gmove(&lo1, &hi2) + if v > 32 { + gins(x86.ASHLL, ncon(uint32(v-32)), &hi2) + } + + gins(x86.AMOVL, ncon(0), &lo2) + splitclean() + splitclean() + return + } + + // general shift + gins(x86.AMOVL, &lo1, &ax) + + gins(x86.AMOVL, &hi1, &dx) + p1 := gins(x86.ASHLL, ncon(uint32(v)), &dx) + p1.From.Index = x86.REG_AX // double-width shift + p1.From.Scale = 0 + gins(x86.ASHLL, ncon(uint32(v)), &ax) + break + } + + // load value into DX:AX. + gins(x86.AMOVL, &lo1, &ax) + + gins(x86.AMOVL, &hi1, &dx) + + // load shift value into register. + // if high bits are set, zero value. + var p1 *obj.Prog + + if gc.Is64(r.Type) { + gins(x86.ACMPL, &hi2, ncon(0)) + p1 = gc.Gbranch(x86.AJNE, nil, +1) + gins(x86.AMOVL, &lo2, &cx) + } else { + cx.Type = gc.Types[gc.TUINT32] + gmove(r, &cx) + } + + // if shift count is >=64, zero value + gins(x86.ACMPL, &cx, ncon(64)) + + p2 := gc.Gbranch(optoas(gc.OLT, gc.Types[gc.TUINT32]), nil, +1) + if p1 != nil { + gc.Patch(p1, gc.Pc) + } + gins(x86.AXORL, &dx, &dx) + gins(x86.AXORL, &ax, &ax) + gc.Patch(p2, gc.Pc) + + // if shift count is >= 32, zero low. + gins(x86.ACMPL, &cx, ncon(32)) + + p1 = gc.Gbranch(optoas(gc.OLT, gc.Types[gc.TUINT32]), nil, +1) + gins(x86.AMOVL, &ax, &dx) + gins(x86.ASHLL, &cx, &dx) // SHLL only uses bottom 5 bits of count + gins(x86.AXORL, &ax, &ax) + p2 = gc.Gbranch(obj.AJMP, nil, 0) + gc.Patch(p1, gc.Pc) + + // general shift + p1 = gins(x86.ASHLL, &cx, &dx) + + p1.From.Index = x86.REG_AX // double-width shift + p1.From.Scale = 0 + gins(x86.ASHLL, &cx, &ax) + gc.Patch(p2, gc.Pc) + + case gc.ORSH: + if r.Op == gc.OLITERAL { + v := uint64(r.Int()) + if v >= 64 { + if gc.Is64(r.Type) { + splitclean() + } + splitclean() + split64(res, &lo2, &hi2) + if hi1.Type.Etype == gc.TINT32 { + gmove(&hi1, &lo2) + gins(x86.ASARL, ncon(31), &lo2) + gmove(&hi1, &hi2) + gins(x86.ASARL, ncon(31), &hi2) + } else { + gins(x86.AMOVL, ncon(0), &lo2) + gins(x86.AMOVL, ncon(0), &hi2) + } + + splitclean() + return + } + + if v >= 32 { + if gc.Is64(r.Type) { + splitclean() + } + split64(res, &lo2, &hi2) + gmove(&hi1, &lo2) + if v > 32 { + gins(optoas(gc.ORSH, hi1.Type), ncon(uint32(v-32)), &lo2) + } + if hi1.Type.Etype == gc.TINT32 { + gmove(&hi1, &hi2) + gins(x86.ASARL, ncon(31), &hi2) + } else { + gins(x86.AMOVL, ncon(0), &hi2) + } + splitclean() + splitclean() + return + } + + // general shift + gins(x86.AMOVL, &lo1, &ax) + + gins(x86.AMOVL, &hi1, &dx) + p1 := gins(x86.ASHRL, ncon(uint32(v)), &ax) + p1.From.Index = x86.REG_DX // double-width shift + p1.From.Scale = 0 + gins(optoas(gc.ORSH, hi1.Type), ncon(uint32(v)), &dx) + break + } + + // load value into DX:AX. + gins(x86.AMOVL, &lo1, &ax) + + gins(x86.AMOVL, &hi1, &dx) + + // load shift value into register. + // if high bits are set, zero value. + var p1 *obj.Prog + + if gc.Is64(r.Type) { + gins(x86.ACMPL, &hi2, ncon(0)) + p1 = gc.Gbranch(x86.AJNE, nil, +1) + gins(x86.AMOVL, &lo2, &cx) + } else { + cx.Type = gc.Types[gc.TUINT32] + gmove(r, &cx) + } + + // if shift count is >=64, zero or sign-extend value + gins(x86.ACMPL, &cx, ncon(64)) + + p2 := gc.Gbranch(optoas(gc.OLT, gc.Types[gc.TUINT32]), nil, +1) + if p1 != nil { + gc.Patch(p1, gc.Pc) + } + if hi1.Type.Etype == gc.TINT32 { + gins(x86.ASARL, ncon(31), &dx) + gins(x86.AMOVL, &dx, &ax) + } else { + gins(x86.AXORL, &dx, &dx) + gins(x86.AXORL, &ax, &ax) + } + + gc.Patch(p2, gc.Pc) + + // if shift count is >= 32, sign-extend hi. + gins(x86.ACMPL, &cx, ncon(32)) + + p1 = gc.Gbranch(optoas(gc.OLT, gc.Types[gc.TUINT32]), nil, +1) + gins(x86.AMOVL, &dx, &ax) + if hi1.Type.Etype == gc.TINT32 { + gins(x86.ASARL, &cx, &ax) // SARL only uses bottom 5 bits of count + gins(x86.ASARL, ncon(31), &dx) + } else { + gins(x86.ASHRL, &cx, &ax) + gins(x86.AXORL, &dx, &dx) + } + + p2 = gc.Gbranch(obj.AJMP, nil, 0) + gc.Patch(p1, gc.Pc) + + // general shift + p1 = gins(x86.ASHRL, &cx, &ax) + + p1.From.Index = x86.REG_DX // double-width shift + p1.From.Scale = 0 + gins(optoas(gc.ORSH, hi1.Type), &cx, &dx) + gc.Patch(p2, gc.Pc) + + // make constant the right side (it usually is anyway). + case gc.OXOR, + gc.OAND, + gc.OOR: + if lo1.Op == gc.OLITERAL { + nswap(&lo1, &lo2) + nswap(&hi1, &hi2) + } + + if lo2.Op == gc.OLITERAL { + // special cases for constants. + lv := uint32(lo2.Int()) + hv := uint32(hi2.Int()) + splitclean() // right side + split64(res, &lo2, &hi2) + switch n.Op { + case gc.OXOR: + gmove(&lo1, &lo2) + gmove(&hi1, &hi2) + switch lv { + case 0: + break + + case 0xffffffff: + gins(x86.ANOTL, nil, &lo2) + + default: + gins(x86.AXORL, ncon(lv), &lo2) + } + + switch hv { + case 0: + break + + case 0xffffffff: + gins(x86.ANOTL, nil, &hi2) + + default: + gins(x86.AXORL, ncon(hv), &hi2) + } + + case gc.OAND: + switch lv { + case 0: + gins(x86.AMOVL, ncon(0), &lo2) + + default: + gmove(&lo1, &lo2) + if lv != 0xffffffff { + gins(x86.AANDL, ncon(lv), &lo2) + } + } + + switch hv { + case 0: + gins(x86.AMOVL, ncon(0), &hi2) + + default: + gmove(&hi1, &hi2) + if hv != 0xffffffff { + gins(x86.AANDL, ncon(hv), &hi2) + } + } + + case gc.OOR: + switch lv { + case 0: + gmove(&lo1, &lo2) + + case 0xffffffff: + gins(x86.AMOVL, ncon(0xffffffff), &lo2) + + default: + gmove(&lo1, &lo2) + gins(x86.AORL, ncon(lv), &lo2) + } + + switch hv { + case 0: + gmove(&hi1, &hi2) + + case 0xffffffff: + gins(x86.AMOVL, ncon(0xffffffff), &hi2) + + default: + gmove(&hi1, &hi2) + gins(x86.AORL, ncon(hv), &hi2) + } + } + + splitclean() + splitclean() + return + } + + gins(x86.AMOVL, &lo1, &ax) + gins(x86.AMOVL, &hi1, &dx) + gins(optoas(int(n.Op), lo1.Type), &lo2, &ax) + gins(optoas(int(n.Op), lo1.Type), &hi2, &dx) + } + + if gc.Is64(r.Type) { + splitclean() + } + splitclean() + + split64(res, &lo1, &hi1) + gins(x86.AMOVL, &ax, &lo1) + gins(x86.AMOVL, &dx, &hi1) + splitclean() +} + +/* + * generate comparison of nl, nr, both 64-bit. + * nl is memory; nr is constant or memory. + */ +func cmp64(nl *gc.Node, nr *gc.Node, op int, likely int, to *obj.Prog) { + var lo1 gc.Node + var hi1 gc.Node + var lo2 gc.Node + var hi2 gc.Node + var rr gc.Node + + split64(nl, &lo1, &hi1) + split64(nr, &lo2, &hi2) + + // compare most significant word; + // if they differ, we're done. + t := hi1.Type + + if nl.Op == gc.OLITERAL || nr.Op == gc.OLITERAL { + gins(x86.ACMPL, &hi1, &hi2) + } else { + gc.Regalloc(&rr, gc.Types[gc.TINT32], nil) + gins(x86.AMOVL, &hi1, &rr) + gins(x86.ACMPL, &rr, &hi2) + gc.Regfree(&rr) + } + + var br *obj.Prog + switch op { + default: + gc.Fatal("cmp64 %v %v", gc.Oconv(int(op), 0), t) + + // cmp hi + // jne L + // cmp lo + // jeq to + // L: + case gc.OEQ: + br = gc.Gbranch(x86.AJNE, nil, -likely) + + // cmp hi + // jne to + // cmp lo + // jne to + case gc.ONE: + gc.Patch(gc.Gbranch(x86.AJNE, nil, likely), to) + + // cmp hi + // jgt to + // jlt L + // cmp lo + // jge to (or jgt to) + // L: + case gc.OGE, + gc.OGT: + gc.Patch(gc.Gbranch(optoas(gc.OGT, t), nil, likely), to) + + br = gc.Gbranch(optoas(gc.OLT, t), nil, -likely) + + // cmp hi + // jlt to + // jgt L + // cmp lo + // jle to (or jlt to) + // L: + case gc.OLE, + gc.OLT: + gc.Patch(gc.Gbranch(optoas(gc.OLT, t), nil, likely), to) + + br = gc.Gbranch(optoas(gc.OGT, t), nil, -likely) + } + + // compare least significant word + t = lo1.Type + + if nl.Op == gc.OLITERAL || nr.Op == gc.OLITERAL { + gins(x86.ACMPL, &lo1, &lo2) + } else { + gc.Regalloc(&rr, gc.Types[gc.TINT32], nil) + gins(x86.AMOVL, &lo1, &rr) + gins(x86.ACMPL, &rr, &lo2) + gc.Regfree(&rr) + } + + // jump again + gc.Patch(gc.Gbranch(optoas(op, t), nil, likely), to) + + // point first branch down here if appropriate + if br != nil { + gc.Patch(br, gc.Pc) + } + + splitclean() + splitclean() +} diff --git a/src/cmd/compile/internal/x86/galign.go b/src/cmd/compile/internal/x86/galign.go new file mode 100644 index 0000000000000000000000000000000000000000..2b602e1bb3387811c501fd911ecdec9101d2863d --- /dev/null +++ b/src/cmd/compile/internal/x86/galign.go @@ -0,0 +1,110 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package x86 + +import ( + "cmd/compile/internal/gc" + "cmd/internal/obj" + "cmd/internal/obj/x86" + "fmt" + "os" +) + +var thechar int = '8' + +var thestring string = "386" + +var thelinkarch *obj.LinkArch = &x86.Link386 + +func linkarchinit() { +} + +var MAXWIDTH int64 = (1 << 32) - 1 + +/* + * go declares several platform-specific type aliases: + * int, uint, and uintptr + */ +var typedefs = []gc.Typedef{ + gc.Typedef{"int", gc.TINT, gc.TINT32}, + gc.Typedef{"uint", gc.TUINT, gc.TUINT32}, + gc.Typedef{"uintptr", gc.TUINTPTR, gc.TUINT32}, +} + +func betypeinit() { + gc.Widthptr = 4 + gc.Widthint = 4 + gc.Widthreg = 4 +} + +func Main() { + gc.Thearch.Thechar = thechar + gc.Thearch.Thestring = thestring + gc.Thearch.Thelinkarch = thelinkarch + gc.Thearch.Typedefs = typedefs + gc.Thearch.REGSP = x86.REGSP + gc.Thearch.REGCTXT = x86.REGCTXT + gc.Thearch.REGCALLX = x86.REG_BX + gc.Thearch.REGCALLX2 = x86.REG_AX + gc.Thearch.REGRETURN = x86.REG_AX + gc.Thearch.REGMIN = x86.REG_AX + gc.Thearch.REGMAX = x86.REG_DI + switch v := obj.Getgo386(); v { + case "387": + gc.Thearch.FREGMIN = x86.REG_F0 + gc.Thearch.FREGMAX = x86.REG_F7 + gc.Thearch.Use387 = true + case "sse2": + gc.Thearch.FREGMIN = x86.REG_X0 + gc.Thearch.FREGMAX = x86.REG_X7 + default: + fmt.Fprintf(os.Stderr, "unsupported setting GO386=%s\n", v) + gc.Exit(1) + } + gc.Thearch.MAXWIDTH = MAXWIDTH + gc.Thearch.ReservedRegs = resvd + + gc.Thearch.Betypeinit = betypeinit + gc.Thearch.Bgen_float = bgen_float + gc.Thearch.Cgen64 = cgen64 + gc.Thearch.Cgen_bmul = cgen_bmul + gc.Thearch.Cgen_float = cgen_float + gc.Thearch.Cgen_hmul = cgen_hmul + gc.Thearch.Cgen_shift = cgen_shift + gc.Thearch.Clearfat = clearfat + gc.Thearch.Cmp64 = cmp64 + gc.Thearch.Defframe = defframe + gc.Thearch.Dodiv = cgen_div + gc.Thearch.Excise = excise + gc.Thearch.Expandchecks = expandchecks + gc.Thearch.Getg = getg + gc.Thearch.Gins = gins + gc.Thearch.Ginscmp = ginscmp + gc.Thearch.Ginscon = ginscon + gc.Thearch.Ginsnop = ginsnop + gc.Thearch.Gmove = gmove + gc.Thearch.Igenindex = igenindex + gc.Thearch.Linkarchinit = linkarchinit + gc.Thearch.Peep = peep + gc.Thearch.Proginfo = proginfo + gc.Thearch.Regtyp = regtyp + gc.Thearch.Sameaddr = sameaddr + gc.Thearch.Smallindir = smallindir + gc.Thearch.Stackaddr = stackaddr + gc.Thearch.Blockcopy = blockcopy + gc.Thearch.Sudoaddable = sudoaddable + gc.Thearch.Sudoclean = sudoclean + gc.Thearch.Excludedregs = excludedregs + gc.Thearch.RtoB = RtoB + gc.Thearch.FtoB = FtoB + gc.Thearch.BtoR = BtoR + gc.Thearch.BtoF = BtoF + gc.Thearch.Optoas = optoas + gc.Thearch.Doregbits = doregbits + gc.Thearch.Regnames = regnames + + gc.Main() + gc.Exit(0) +} diff --git a/src/cmd/compile/internal/x86/ggen.go b/src/cmd/compile/internal/x86/ggen.go new file mode 100644 index 0000000000000000000000000000000000000000..ae9881d2739f7d476f9e1ba3b47921ad398a48ae --- /dev/null +++ b/src/cmd/compile/internal/x86/ggen.go @@ -0,0 +1,940 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package x86 + +import ( + "cmd/compile/internal/gc" + "cmd/internal/obj" + "cmd/internal/obj/x86" +) + +func defframe(ptxt *obj.Prog) { + var n *gc.Node + + // fill in argument size, stack size + ptxt.To.Type = obj.TYPE_TEXTSIZE + + ptxt.To.Val = int32(gc.Rnd(gc.Curfn.Type.Argwid, int64(gc.Widthptr))) + frame := uint32(gc.Rnd(gc.Stksize+gc.Maxarg, int64(gc.Widthreg))) + ptxt.To.Offset = int64(frame) + + // insert code to zero ambiguously live variables + // so that the garbage collector only sees initialized values + // when it looks for pointers. + p := ptxt + + hi := int64(0) + lo := hi + ax := uint32(0) + for l := gc.Curfn.Func.Dcl; l != nil; l = l.Next { + n = l.N + if !n.Name.Needzero { + continue + } + if n.Class != gc.PAUTO { + gc.Fatal("needzero class %d", n.Class) + } + if n.Type.Width%int64(gc.Widthptr) != 0 || n.Xoffset%int64(gc.Widthptr) != 0 || n.Type.Width == 0 { + gc.Fatal("var %v has size %d offset %d", gc.Nconv(n, obj.FmtLong), int(n.Type.Width), int(n.Xoffset)) + } + if lo != hi && n.Xoffset+n.Type.Width == lo-int64(2*gc.Widthptr) { + // merge with range we already have + lo = n.Xoffset + + continue + } + + // zero old range + p = zerorange(p, int64(frame), lo, hi, &ax) + + // set new range + hi = n.Xoffset + n.Type.Width + + lo = n.Xoffset + } + + // zero final range + zerorange(p, int64(frame), lo, hi, &ax) +} + +func zerorange(p *obj.Prog, frame int64, lo int64, hi int64, ax *uint32) *obj.Prog { + cnt := hi - lo + if cnt == 0 { + return p + } + if *ax == 0 { + p = appendpp(p, x86.AMOVL, obj.TYPE_CONST, 0, 0, obj.TYPE_REG, x86.REG_AX, 0) + *ax = 1 + } + + if cnt <= int64(4*gc.Widthreg) { + for i := int64(0); i < cnt; i += int64(gc.Widthreg) { + p = appendpp(p, x86.AMOVL, obj.TYPE_REG, x86.REG_AX, 0, obj.TYPE_MEM, x86.REG_SP, frame+lo+i) + } + } else if !gc.Nacl && cnt <= int64(128*gc.Widthreg) { + p = appendpp(p, x86.ALEAL, obj.TYPE_MEM, x86.REG_SP, frame+lo, obj.TYPE_REG, x86.REG_DI, 0) + p = appendpp(p, obj.ADUFFZERO, obj.TYPE_NONE, 0, 0, obj.TYPE_ADDR, 0, 1*(128-cnt/int64(gc.Widthreg))) + p.To.Sym = gc.Linksym(gc.Pkglookup("duffzero", gc.Runtimepkg)) + } else { + p = appendpp(p, x86.AMOVL, obj.TYPE_CONST, 0, cnt/int64(gc.Widthreg), obj.TYPE_REG, x86.REG_CX, 0) + p = appendpp(p, x86.ALEAL, obj.TYPE_MEM, x86.REG_SP, frame+lo, obj.TYPE_REG, x86.REG_DI, 0) + p = appendpp(p, x86.AREP, obj.TYPE_NONE, 0, 0, obj.TYPE_NONE, 0, 0) + p = appendpp(p, x86.ASTOSL, obj.TYPE_NONE, 0, 0, obj.TYPE_NONE, 0, 0) + } + + return p +} + +func appendpp(p *obj.Prog, as int, ftype int, freg int, foffset int64, ttype int, treg int, toffset int64) *obj.Prog { + q := gc.Ctxt.NewProg() + gc.Clearp(q) + q.As = int16(as) + q.Lineno = p.Lineno + q.From.Type = int16(ftype) + q.From.Reg = int16(freg) + q.From.Offset = foffset + q.To.Type = int16(ttype) + q.To.Reg = int16(treg) + q.To.Offset = toffset + q.Link = p.Link + p.Link = q + return q +} + +func clearfat(nl *gc.Node) { + /* clear a fat object */ + if gc.Debug['g'] != 0 { + gc.Dump("\nclearfat", nl) + } + + w := uint32(nl.Type.Width) + + // Avoid taking the address for simple enough types. + if gc.Componentgen(nil, nl) { + return + } + + c := w % 4 // bytes + q := w / 4 // quads + + if q < 4 { + // Write sequence of MOV 0, off(base) instead of using STOSL. + // The hope is that although the code will be slightly longer, + // the MOVs will have no dependencies and pipeline better + // than the unrolled STOSL loop. + // NOTE: Must use agen, not igen, so that optimizer sees address + // being taken. We are not writing on field boundaries. + var n1 gc.Node + gc.Regalloc(&n1, gc.Types[gc.Tptr], nil) + + gc.Agen(nl, &n1) + n1.Op = gc.OINDREG + var z gc.Node + gc.Nodconst(&z, gc.Types[gc.TUINT64], 0) + for { + tmp14 := q + q-- + if tmp14 <= 0 { + break + } + n1.Type = z.Type + gins(x86.AMOVL, &z, &n1) + n1.Xoffset += 4 + } + + gc.Nodconst(&z, gc.Types[gc.TUINT8], 0) + for { + tmp15 := c + c-- + if tmp15 <= 0 { + break + } + n1.Type = z.Type + gins(x86.AMOVB, &z, &n1) + n1.Xoffset++ + } + + gc.Regfree(&n1) + return + } + + var n1 gc.Node + gc.Nodreg(&n1, gc.Types[gc.Tptr], x86.REG_DI) + gc.Agen(nl, &n1) + gconreg(x86.AMOVL, 0, x86.REG_AX) + + if q > 128 || (q >= 4 && gc.Nacl) { + gconreg(x86.AMOVL, int64(q), x86.REG_CX) + gins(x86.AREP, nil, nil) // repeat + gins(x86.ASTOSL, nil, nil) // STOL AL,*(DI)+ + } else if q >= 4 { + p := gins(obj.ADUFFZERO, nil, nil) + p.To.Type = obj.TYPE_ADDR + p.To.Sym = gc.Linksym(gc.Pkglookup("duffzero", gc.Runtimepkg)) + + // 1 and 128 = magic constants: see ../../runtime/asm_386.s + p.To.Offset = 1 * (128 - int64(q)) + } else { + for q > 0 { + gins(x86.ASTOSL, nil, nil) // STOL AL,*(DI)+ + q-- + } + } + + for c > 0 { + gins(x86.ASTOSB, nil, nil) // STOB AL,*(DI)+ + c-- + } +} + +var panicdiv *gc.Node + +/* + * generate division. + * caller must set: + * ax = allocated AX register + * dx = allocated DX register + * generates one of: + * res = nl / nr + * res = nl % nr + * according to op. + */ +func dodiv(op int, nl *gc.Node, nr *gc.Node, res *gc.Node, ax *gc.Node, dx *gc.Node) { + // Have to be careful about handling + // most negative int divided by -1 correctly. + // The hardware will trap. + // Also the byte divide instruction needs AH, + // which we otherwise don't have to deal with. + // Easiest way to avoid for int8, int16: use int32. + // For int32 and int64, use explicit test. + // Could use int64 hw for int32. + t := nl.Type + + t0 := t + check := 0 + if gc.Issigned[t.Etype] { + check = 1 + if gc.Isconst(nl, gc.CTINT) && nl.Int() != -1< 0 && !gc.Samereg(x, res) { + gc.Tempname(oldx, gc.Types[gc.TINT32]) + gmove(x, oldx) + } + + gc.Regalloc(x, t, x) +} + +func restx(x *gc.Node, oldx *gc.Node) { + gc.Regfree(x) + + if oldx.Op != 0 { + x.Type = gc.Types[gc.TINT32] + gmove(oldx, x) + } +} + +/* + * generate division according to op, one of: + * res = nl / nr + * res = nl % nr + */ +func cgen_div(op int, nl *gc.Node, nr *gc.Node, res *gc.Node) { + if gc.Is64(nl.Type) { + gc.Fatal("cgen_div %v", nl.Type) + } + + var t *gc.Type + if gc.Issigned[nl.Type.Etype] { + t = gc.Types[gc.TINT32] + } else { + t = gc.Types[gc.TUINT32] + } + var ax gc.Node + var oldax gc.Node + savex(x86.REG_AX, &ax, &oldax, res, t) + var olddx gc.Node + var dx gc.Node + savex(x86.REG_DX, &dx, &olddx, res, t) + dodiv(op, nl, nr, res, &ax, &dx) + restx(&dx, &olddx) + restx(&ax, &oldax) +} + +/* + * generate shift according to op, one of: + * res = nl << nr + * res = nl >> nr + */ +func cgen_shift(op int, bounded bool, nl *gc.Node, nr *gc.Node, res *gc.Node) { + if nl.Type.Width > 4 { + gc.Fatal("cgen_shift %v", nl.Type) + } + + w := int(nl.Type.Width * 8) + + a := optoas(op, nl.Type) + + if nr.Op == gc.OLITERAL { + var n2 gc.Node + gc.Tempname(&n2, nl.Type) + gc.Cgen(nl, &n2) + var n1 gc.Node + gc.Regalloc(&n1, nl.Type, res) + gmove(&n2, &n1) + sc := uint64(nr.Int()) + if sc >= uint64(nl.Type.Width*8) { + // large shift gets 2 shifts by width-1 + gins(a, ncon(uint32(w)-1), &n1) + + gins(a, ncon(uint32(w)-1), &n1) + } else { + gins(a, nr, &n1) + } + gmove(&n1, res) + gc.Regfree(&n1) + return + } + + var oldcx gc.Node + var cx gc.Node + gc.Nodreg(&cx, gc.Types[gc.TUINT32], x86.REG_CX) + if gc.GetReg(x86.REG_CX) > 1 && !gc.Samereg(&cx, res) { + gc.Tempname(&oldcx, gc.Types[gc.TUINT32]) + gmove(&cx, &oldcx) + } + + var n1 gc.Node + var nt gc.Node + if nr.Type.Width > 4 { + gc.Tempname(&nt, nr.Type) + n1 = nt + } else { + gc.Nodreg(&n1, gc.Types[gc.TUINT32], x86.REG_CX) + gc.Regalloc(&n1, nr.Type, &n1) // to hold the shift type in CX + } + + var n2 gc.Node + if gc.Samereg(&cx, res) { + gc.Regalloc(&n2, nl.Type, nil) + } else { + gc.Regalloc(&n2, nl.Type, res) + } + if nl.Ullman >= nr.Ullman { + gc.Cgen(nl, &n2) + gc.Cgen(nr, &n1) + } else { + gc.Cgen(nr, &n1) + gc.Cgen(nl, &n2) + } + + // test and fix up large shifts + if bounded { + if nr.Type.Width > 4 { + // delayed reg alloc + gc.Nodreg(&n1, gc.Types[gc.TUINT32], x86.REG_CX) + + gc.Regalloc(&n1, gc.Types[gc.TUINT32], &n1) // to hold the shift type in CX + var lo gc.Node + var hi gc.Node + split64(&nt, &lo, &hi) + gmove(&lo, &n1) + splitclean() + } + } else { + var p1 *obj.Prog + if nr.Type.Width > 4 { + // delayed reg alloc + gc.Nodreg(&n1, gc.Types[gc.TUINT32], x86.REG_CX) + + gc.Regalloc(&n1, gc.Types[gc.TUINT32], &n1) // to hold the shift type in CX + var lo gc.Node + var hi gc.Node + split64(&nt, &lo, &hi) + gmove(&lo, &n1) + gins(optoas(gc.OCMP, gc.Types[gc.TUINT32]), &hi, ncon(0)) + p2 := gc.Gbranch(optoas(gc.ONE, gc.Types[gc.TUINT32]), nil, +1) + gins(optoas(gc.OCMP, gc.Types[gc.TUINT32]), &n1, ncon(uint32(w))) + p1 = gc.Gbranch(optoas(gc.OLT, gc.Types[gc.TUINT32]), nil, +1) + splitclean() + gc.Patch(p2, gc.Pc) + } else { + gins(optoas(gc.OCMP, nr.Type), &n1, ncon(uint32(w))) + p1 = gc.Gbranch(optoas(gc.OLT, gc.Types[gc.TUINT32]), nil, +1) + } + + if op == gc.ORSH && gc.Issigned[nl.Type.Etype] { + gins(a, ncon(uint32(w)-1), &n2) + } else { + gmove(ncon(0), &n2) + } + + gc.Patch(p1, gc.Pc) + } + + gins(a, &n1, &n2) + + if oldcx.Op != 0 { + gmove(&oldcx, &cx) + } + + gmove(&n2, res) + + gc.Regfree(&n1) + gc.Regfree(&n2) +} + +/* + * generate byte multiply: + * res = nl * nr + * there is no 2-operand byte multiply instruction so + * we do a full-width multiplication and truncate afterwards. + */ +func cgen_bmul(op int, nl *gc.Node, nr *gc.Node, res *gc.Node) bool { + if optoas(op, nl.Type) != x86.AIMULB { + return false + } + + // copy from byte to full registers + t := gc.Types[gc.TUINT32] + + if gc.Issigned[nl.Type.Etype] { + t = gc.Types[gc.TINT32] + } + + // largest ullman on left. + if nl.Ullman < nr.Ullman { + tmp := nl + nl = nr + nr = tmp + } + + var nt gc.Node + gc.Tempname(&nt, nl.Type) + gc.Cgen(nl, &nt) + var n1 gc.Node + gc.Regalloc(&n1, t, res) + gc.Cgen(nr, &n1) + var n2 gc.Node + gc.Regalloc(&n2, t, nil) + gmove(&nt, &n2) + a := optoas(op, t) + gins(a, &n2, &n1) + gc.Regfree(&n2) + gmove(&n1, res) + gc.Regfree(&n1) + + return true +} + +/* + * generate high multiply: + * res = (nl*nr) >> width + */ +func cgen_hmul(nl *gc.Node, nr *gc.Node, res *gc.Node) { + var n1 gc.Node + var n2 gc.Node + var ax gc.Node + var dx gc.Node + + t := nl.Type + a := optoas(gc.OHMUL, t) + + // gen nl in n1. + gc.Tempname(&n1, t) + + gc.Cgen(nl, &n1) + + // gen nr in n2. + gc.Regalloc(&n2, t, res) + + gc.Cgen(nr, &n2) + + // multiply. + gc.Nodreg(&ax, t, x86.REG_AX) + + gmove(&n2, &ax) + gins(a, &n1, nil) + gc.Regfree(&n2) + + if t.Width == 1 { + // byte multiply behaves differently. + gc.Nodreg(&ax, t, x86.REG_AH) + + gc.Nodreg(&dx, t, x86.REG_DX) + gmove(&ax, &dx) + } + + gc.Nodreg(&dx, t, x86.REG_DX) + gmove(&dx, res) +} + +/* + * generate floating-point operation. + */ +func cgen_float(n *gc.Node, res *gc.Node) { + nl := n.Left + switch n.Op { + case gc.OEQ, + gc.ONE, + gc.OLT, + gc.OLE, + gc.OGE: + p1 := gc.Gbranch(obj.AJMP, nil, 0) + p2 := gc.Pc + gmove(gc.Nodbool(true), res) + p3 := gc.Gbranch(obj.AJMP, nil, 0) + gc.Patch(p1, gc.Pc) + gc.Bgen(n, true, 0, p2) + gmove(gc.Nodbool(false), res) + gc.Patch(p3, gc.Pc) + return + + case gc.OPLUS: + gc.Cgen(nl, res) + return + + case gc.OCONV: + if gc.Eqtype(n.Type, nl.Type) || gc.Noconv(n.Type, nl.Type) { + gc.Cgen(nl, res) + return + } + + var n2 gc.Node + gc.Tempname(&n2, n.Type) + var n1 gc.Node + gc.Mgen(nl, &n1, res) + gmove(&n1, &n2) + gmove(&n2, res) + gc.Mfree(&n1) + return + } + + if gc.Thearch.Use387 { + cgen_float387(n, res) + } else { + cgen_floatsse(n, res) + } +} + +// floating-point. 387 (not SSE2) +func cgen_float387(n *gc.Node, res *gc.Node) { + var f0 gc.Node + var f1 gc.Node + + nl := n.Left + nr := n.Right + gc.Nodreg(&f0, nl.Type, x86.REG_F0) + gc.Nodreg(&f1, n.Type, x86.REG_F0+1) + if nr != nil { + // binary + if nl.Ullman >= nr.Ullman { + gc.Cgen(nl, &f0) + if nr.Addable { + gins(foptoas(int(n.Op), n.Type, 0), nr, &f0) + } else { + gc.Cgen(nr, &f0) + gins(foptoas(int(n.Op), n.Type, Fpop), &f0, &f1) + } + } else { + gc.Cgen(nr, &f0) + if nl.Addable { + gins(foptoas(int(n.Op), n.Type, Frev), nl, &f0) + } else { + gc.Cgen(nl, &f0) + gins(foptoas(int(n.Op), n.Type, Frev|Fpop), &f0, &f1) + } + } + + gmove(&f0, res) + return + } + + // unary + gc.Cgen(nl, &f0) + + if n.Op != gc.OCONV && n.Op != gc.OPLUS { + gins(foptoas(int(n.Op), n.Type, 0), nil, nil) + } + gmove(&f0, res) + return +} + +func cgen_floatsse(n *gc.Node, res *gc.Node) { + var a int + + nl := n.Left + nr := n.Right + switch n.Op { + default: + gc.Dump("cgen_floatsse", n) + gc.Fatal("cgen_floatsse %v", gc.Oconv(int(n.Op), 0)) + return + + case gc.OMINUS, + gc.OCOM: + nr = gc.Nodintconst(-1) + gc.Convlit(&nr, n.Type) + a = foptoas(gc.OMUL, nl.Type, 0) + goto sbop + + // symmetric binary + case gc.OADD, + gc.OMUL: + a = foptoas(int(n.Op), nl.Type, 0) + + goto sbop + + // asymmetric binary + case gc.OSUB, + gc.OMOD, + gc.ODIV: + a = foptoas(int(n.Op), nl.Type, 0) + + goto abop + } + +sbop: // symmetric binary + if nl.Ullman < nr.Ullman || nl.Op == gc.OLITERAL { + r := nl + nl = nr + nr = r + } + +abop: // asymmetric binary + if nl.Ullman >= nr.Ullman { + var nt gc.Node + gc.Tempname(&nt, nl.Type) + gc.Cgen(nl, &nt) + var n2 gc.Node + gc.Mgen(nr, &n2, nil) + var n1 gc.Node + gc.Regalloc(&n1, nl.Type, res) + gmove(&nt, &n1) + gins(a, &n2, &n1) + gmove(&n1, res) + gc.Regfree(&n1) + gc.Mfree(&n2) + } else { + var n2 gc.Node + gc.Regalloc(&n2, nr.Type, res) + gc.Cgen(nr, &n2) + var n1 gc.Node + gc.Regalloc(&n1, nl.Type, nil) + gc.Cgen(nl, &n1) + gins(a, &n2, &n1) + gc.Regfree(&n2) + gmove(&n1, res) + gc.Regfree(&n1) + } + + return +} + +func bgen_float(n *gc.Node, wantTrue bool, likely int, to *obj.Prog) { + nl := n.Left + nr := n.Right + a := int(n.Op) + if !wantTrue { + // brcom is not valid on floats when NaN is involved. + p1 := gc.Gbranch(obj.AJMP, nil, 0) + p2 := gc.Gbranch(obj.AJMP, nil, 0) + gc.Patch(p1, gc.Pc) + + // No need to avoid re-genning ninit. + bgen_float(n, true, -likely, p2) + + gc.Patch(gc.Gbranch(obj.AJMP, nil, 0), to) + gc.Patch(p2, gc.Pc) + return + } + + if gc.Thearch.Use387 { + a = gc.Brrev(a) // because the args are stacked + if a == gc.OGE || a == gc.OGT { + // only < and <= work right with NaN; reverse if needed + nl, nr = nr, nl + a = gc.Brrev(a) + } + + var ax, n2, tmp gc.Node + gc.Nodreg(&tmp, nr.Type, x86.REG_F0) + gc.Nodreg(&n2, nr.Type, x86.REG_F0+1) + gc.Nodreg(&ax, gc.Types[gc.TUINT16], x86.REG_AX) + if gc.Simsimtype(nr.Type) == gc.TFLOAT64 { + if nl.Ullman > nr.Ullman { + gc.Cgen(nl, &tmp) + gc.Cgen(nr, &tmp) + gins(x86.AFXCHD, &tmp, &n2) + } else { + gc.Cgen(nr, &tmp) + gc.Cgen(nl, &tmp) + } + + gins(x86.AFUCOMIP, &tmp, &n2) + gins(x86.AFMOVDP, &tmp, &tmp) // annoying pop but still better than STSW+SAHF + } else { + // TODO(rsc): The moves back and forth to memory + // here are for truncating the value to 32 bits. + // This handles 32-bit comparison but presumably + // all the other ops have the same problem. + // We need to figure out what the right general + // solution is, besides telling people to use float64. + var t1 gc.Node + gc.Tempname(&t1, gc.Types[gc.TFLOAT32]) + + var t2 gc.Node + gc.Tempname(&t2, gc.Types[gc.TFLOAT32]) + gc.Cgen(nr, &t1) + gc.Cgen(nl, &t2) + gmove(&t2, &tmp) + gins(x86.AFCOMFP, &t1, &tmp) + gins(x86.AFSTSW, nil, &ax) + gins(x86.ASAHF, nil, nil) + } + } else { + // Not 387 + if !nl.Addable { + nl = gc.CgenTemp(nl) + } + if !nr.Addable { + nr = gc.CgenTemp(nr) + } + + var n2 gc.Node + gc.Regalloc(&n2, nr.Type, nil) + gmove(nr, &n2) + nr = &n2 + + if nl.Op != gc.OREGISTER { + var n3 gc.Node + gc.Regalloc(&n3, nl.Type, nil) + gmove(nl, &n3) + nl = &n3 + } + + if a == gc.OGE || a == gc.OGT { + // only < and <= work right with NaN; reverse if needed + nl, nr = nr, nl + a = gc.Brrev(a) + } + + gins(foptoas(gc.OCMP, nr.Type, 0), nl, nr) + if nl.Op == gc.OREGISTER { + gc.Regfree(nl) + } + gc.Regfree(nr) + } + + switch a { + case gc.OEQ: + // neither NE nor P + p1 := gc.Gbranch(x86.AJNE, nil, -likely) + p2 := gc.Gbranch(x86.AJPS, nil, -likely) + gc.Patch(gc.Gbranch(obj.AJMP, nil, 0), to) + gc.Patch(p1, gc.Pc) + gc.Patch(p2, gc.Pc) + case gc.ONE: + // either NE or P + gc.Patch(gc.Gbranch(x86.AJNE, nil, likely), to) + gc.Patch(gc.Gbranch(x86.AJPS, nil, likely), to) + default: + gc.Patch(gc.Gbranch(optoas(a, nr.Type), nil, likely), to) + } +} + +// Called after regopt and peep have run. +// Expand CHECKNIL pseudo-op into actual nil pointer check. +func expandchecks(firstp *obj.Prog) { + var p1 *obj.Prog + var p2 *obj.Prog + + for p := firstp; p != nil; p = p.Link { + if p.As != obj.ACHECKNIL { + continue + } + if gc.Debug_checknil != 0 && p.Lineno > 1 { // p->lineno==1 in generated wrappers + gc.Warnl(int(p.Lineno), "generated nil check") + } + + // check is + // CMP arg, $0 + // JNE 2(PC) (likely) + // MOV AX, 0 + p1 = gc.Ctxt.NewProg() + + p2 = gc.Ctxt.NewProg() + gc.Clearp(p1) + gc.Clearp(p2) + p1.Link = p2 + p2.Link = p.Link + p.Link = p1 + p1.Lineno = p.Lineno + p2.Lineno = p.Lineno + p1.Pc = 9999 + p2.Pc = 9999 + p.As = x86.ACMPL + p.To.Type = obj.TYPE_CONST + p.To.Offset = 0 + p1.As = x86.AJNE + p1.From.Type = obj.TYPE_CONST + p1.From.Offset = 1 // likely + p1.To.Type = obj.TYPE_BRANCH + p1.To.Val = p2.Link + + // crash by write to memory address 0. + // if possible, since we know arg is 0, use 0(arg), + // which will be shorter to encode than plain 0. + p2.As = x86.AMOVL + + p2.From.Type = obj.TYPE_REG + p2.From.Reg = x86.REG_AX + if regtyp(&p.From) { + p2.To.Type = obj.TYPE_MEM + p2.To.Reg = p.From.Reg + } else { + p2.To.Type = obj.TYPE_MEM + } + p2.To.Offset = 0 + } +} + +// addr += index*width if possible. +func addindex(index *gc.Node, width int64, addr *gc.Node) bool { + switch width { + case 1, 2, 4, 8: + p1 := gins(x86.ALEAL, index, addr) + p1.From.Type = obj.TYPE_MEM + p1.From.Scale = int16(width) + p1.From.Index = p1.From.Reg + p1.From.Reg = p1.To.Reg + return true + } + return false +} + +// res = runtime.getg() +func getg(res *gc.Node) { + var n1 gc.Node + gc.Regalloc(&n1, res.Type, res) + mov := optoas(gc.OAS, gc.Types[gc.Tptr]) + p := gins(mov, nil, &n1) + p.From.Type = obj.TYPE_REG + p.From.Reg = x86.REG_TLS + p = gins(mov, nil, &n1) + p.From = p.To + p.From.Type = obj.TYPE_MEM + p.From.Index = x86.REG_TLS + p.From.Scale = 1 + gmove(&n1, res) + gc.Regfree(&n1) +} diff --git a/src/cmd/compile/internal/x86/gsubr.go b/src/cmd/compile/internal/x86/gsubr.go new file mode 100644 index 0000000000000000000000000000000000000000..7593d043bbe8e79a4742fbe5f7d763c4d5d44081 --- /dev/null +++ b/src/cmd/compile/internal/x86/gsubr.go @@ -0,0 +1,1801 @@ +// Derived from Inferno utils/8c/txt.c +// http://code.google.com/p/inferno-os/source/browse/utils/8c/txt.c +// +// Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved. +// Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net) +// Portions Copyright © 1997-1999 Vita Nuova Limited +// Portions Copyright © 2000-2007 Vita Nuova Holdings Limited (www.vitanuova.com) +// Portions Copyright © 2004,2006 Bruce Ellis +// Portions Copyright © 2005-2007 C H Forsyth (forsyth@terzarima.net) +// Revisions Copyright © 2000-2007 Lucent Technologies Inc. and others +// Portions Copyright © 2009 The Go Authors. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +package x86 + +import ( + "cmd/compile/internal/big" + "cmd/compile/internal/gc" + "cmd/internal/obj" + "cmd/internal/obj/x86" + "fmt" +) + +// TODO(rsc): Can make this bigger if we move +// the text segment up higher in 8l for all GOOS. +// At the same time, can raise StackBig in ../../runtime/stack.h. +var unmappedzero uint32 = 4096 + +// foptoas flags +const ( + Frev = 1 << 0 + Fpop = 1 << 1 + Fpop2 = 1 << 2 +) + +/* + * return Axxx for Oxxx on type t. + */ +func optoas(op int, t *gc.Type) int { + if t == nil { + gc.Fatal("optoas: t is nil") + } + + a := obj.AXXX + switch uint32(op)<<16 | uint32(gc.Simtype[t.Etype]) { + default: + gc.Fatal("optoas: no entry %v-%v", gc.Oconv(int(op), 0), t) + + case gc.OADDR<<16 | gc.TPTR32: + a = x86.ALEAL + + case gc.OEQ<<16 | gc.TBOOL, + gc.OEQ<<16 | gc.TINT8, + gc.OEQ<<16 | gc.TUINT8, + gc.OEQ<<16 | gc.TINT16, + gc.OEQ<<16 | gc.TUINT16, + gc.OEQ<<16 | gc.TINT32, + gc.OEQ<<16 | gc.TUINT32, + gc.OEQ<<16 | gc.TINT64, + gc.OEQ<<16 | gc.TUINT64, + gc.OEQ<<16 | gc.TPTR32, + gc.OEQ<<16 | gc.TPTR64, + gc.OEQ<<16 | gc.TFLOAT32, + gc.OEQ<<16 | gc.TFLOAT64: + a = x86.AJEQ + + case gc.ONE<<16 | gc.TBOOL, + gc.ONE<<16 | gc.TINT8, + gc.ONE<<16 | gc.TUINT8, + gc.ONE<<16 | gc.TINT16, + gc.ONE<<16 | gc.TUINT16, + gc.ONE<<16 | gc.TINT32, + gc.ONE<<16 | gc.TUINT32, + gc.ONE<<16 | gc.TINT64, + gc.ONE<<16 | gc.TUINT64, + gc.ONE<<16 | gc.TPTR32, + gc.ONE<<16 | gc.TPTR64, + gc.ONE<<16 | gc.TFLOAT32, + gc.ONE<<16 | gc.TFLOAT64: + a = x86.AJNE + + case gc.OLT<<16 | gc.TINT8, + gc.OLT<<16 | gc.TINT16, + gc.OLT<<16 | gc.TINT32, + gc.OLT<<16 | gc.TINT64: + a = x86.AJLT + + case gc.OLT<<16 | gc.TUINT8, + gc.OLT<<16 | gc.TUINT16, + gc.OLT<<16 | gc.TUINT32, + gc.OLT<<16 | gc.TUINT64: + a = x86.AJCS + + case gc.OLE<<16 | gc.TINT8, + gc.OLE<<16 | gc.TINT16, + gc.OLE<<16 | gc.TINT32, + gc.OLE<<16 | gc.TINT64: + a = x86.AJLE + + case gc.OLE<<16 | gc.TUINT8, + gc.OLE<<16 | gc.TUINT16, + gc.OLE<<16 | gc.TUINT32, + gc.OLE<<16 | gc.TUINT64: + a = x86.AJLS + + case gc.OGT<<16 | gc.TINT8, + gc.OGT<<16 | gc.TINT16, + gc.OGT<<16 | gc.TINT32, + gc.OGT<<16 | gc.TINT64: + a = x86.AJGT + + case gc.OGT<<16 | gc.TUINT8, + gc.OGT<<16 | gc.TUINT16, + gc.OGT<<16 | gc.TUINT32, + gc.OGT<<16 | gc.TUINT64, + gc.OLT<<16 | gc.TFLOAT32, + gc.OLT<<16 | gc.TFLOAT64: + a = x86.AJHI + + case gc.OGE<<16 | gc.TINT8, + gc.OGE<<16 | gc.TINT16, + gc.OGE<<16 | gc.TINT32, + gc.OGE<<16 | gc.TINT64: + a = x86.AJGE + + case gc.OGE<<16 | gc.TUINT8, + gc.OGE<<16 | gc.TUINT16, + gc.OGE<<16 | gc.TUINT32, + gc.OGE<<16 | gc.TUINT64, + gc.OLE<<16 | gc.TFLOAT32, + gc.OLE<<16 | gc.TFLOAT64: + a = x86.AJCC + + case gc.OCMP<<16 | gc.TBOOL, + gc.OCMP<<16 | gc.TINT8, + gc.OCMP<<16 | gc.TUINT8: + a = x86.ACMPB + + case gc.OCMP<<16 | gc.TINT16, + gc.OCMP<<16 | gc.TUINT16: + a = x86.ACMPW + + case gc.OCMP<<16 | gc.TINT32, + gc.OCMP<<16 | gc.TUINT32, + gc.OCMP<<16 | gc.TPTR32: + a = x86.ACMPL + + case gc.OAS<<16 | gc.TBOOL, + gc.OAS<<16 | gc.TINT8, + gc.OAS<<16 | gc.TUINT8: + a = x86.AMOVB + + case gc.OAS<<16 | gc.TINT16, + gc.OAS<<16 | gc.TUINT16: + a = x86.AMOVW + + case gc.OAS<<16 | gc.TINT32, + gc.OAS<<16 | gc.TUINT32, + gc.OAS<<16 | gc.TPTR32: + a = x86.AMOVL + + case gc.OAS<<16 | gc.TFLOAT32: + a = x86.AMOVSS + + case gc.OAS<<16 | gc.TFLOAT64: + a = x86.AMOVSD + + case gc.OADD<<16 | gc.TINT8, + gc.OADD<<16 | gc.TUINT8: + a = x86.AADDB + + case gc.OADD<<16 | gc.TINT16, + gc.OADD<<16 | gc.TUINT16: + a = x86.AADDW + + case gc.OADD<<16 | gc.TINT32, + gc.OADD<<16 | gc.TUINT32, + gc.OADD<<16 | gc.TPTR32: + a = x86.AADDL + + case gc.OSUB<<16 | gc.TINT8, + gc.OSUB<<16 | gc.TUINT8: + a = x86.ASUBB + + case gc.OSUB<<16 | gc.TINT16, + gc.OSUB<<16 | gc.TUINT16: + a = x86.ASUBW + + case gc.OSUB<<16 | gc.TINT32, + gc.OSUB<<16 | gc.TUINT32, + gc.OSUB<<16 | gc.TPTR32: + a = x86.ASUBL + + case gc.OINC<<16 | gc.TINT8, + gc.OINC<<16 | gc.TUINT8: + a = x86.AINCB + + case gc.OINC<<16 | gc.TINT16, + gc.OINC<<16 | gc.TUINT16: + a = x86.AINCW + + case gc.OINC<<16 | gc.TINT32, + gc.OINC<<16 | gc.TUINT32, + gc.OINC<<16 | gc.TPTR32: + a = x86.AINCL + + case gc.ODEC<<16 | gc.TINT8, + gc.ODEC<<16 | gc.TUINT8: + a = x86.ADECB + + case gc.ODEC<<16 | gc.TINT16, + gc.ODEC<<16 | gc.TUINT16: + a = x86.ADECW + + case gc.ODEC<<16 | gc.TINT32, + gc.ODEC<<16 | gc.TUINT32, + gc.ODEC<<16 | gc.TPTR32: + a = x86.ADECL + + case gc.OCOM<<16 | gc.TINT8, + gc.OCOM<<16 | gc.TUINT8: + a = x86.ANOTB + + case gc.OCOM<<16 | gc.TINT16, + gc.OCOM<<16 | gc.TUINT16: + a = x86.ANOTW + + case gc.OCOM<<16 | gc.TINT32, + gc.OCOM<<16 | gc.TUINT32, + gc.OCOM<<16 | gc.TPTR32: + a = x86.ANOTL + + case gc.OMINUS<<16 | gc.TINT8, + gc.OMINUS<<16 | gc.TUINT8: + a = x86.ANEGB + + case gc.OMINUS<<16 | gc.TINT16, + gc.OMINUS<<16 | gc.TUINT16: + a = x86.ANEGW + + case gc.OMINUS<<16 | gc.TINT32, + gc.OMINUS<<16 | gc.TUINT32, + gc.OMINUS<<16 | gc.TPTR32: + a = x86.ANEGL + + case gc.OAND<<16 | gc.TINT8, + gc.OAND<<16 | gc.TUINT8: + a = x86.AANDB + + case gc.OAND<<16 | gc.TINT16, + gc.OAND<<16 | gc.TUINT16: + a = x86.AANDW + + case gc.OAND<<16 | gc.TINT32, + gc.OAND<<16 | gc.TUINT32, + gc.OAND<<16 | gc.TPTR32: + a = x86.AANDL + + case gc.OOR<<16 | gc.TINT8, + gc.OOR<<16 | gc.TUINT8: + a = x86.AORB + + case gc.OOR<<16 | gc.TINT16, + gc.OOR<<16 | gc.TUINT16: + a = x86.AORW + + case gc.OOR<<16 | gc.TINT32, + gc.OOR<<16 | gc.TUINT32, + gc.OOR<<16 | gc.TPTR32: + a = x86.AORL + + case gc.OXOR<<16 | gc.TINT8, + gc.OXOR<<16 | gc.TUINT8: + a = x86.AXORB + + case gc.OXOR<<16 | gc.TINT16, + gc.OXOR<<16 | gc.TUINT16: + a = x86.AXORW + + case gc.OXOR<<16 | gc.TINT32, + gc.OXOR<<16 | gc.TUINT32, + gc.OXOR<<16 | gc.TPTR32: + a = x86.AXORL + + case gc.OLROT<<16 | gc.TINT8, + gc.OLROT<<16 | gc.TUINT8: + a = x86.AROLB + + case gc.OLROT<<16 | gc.TINT16, + gc.OLROT<<16 | gc.TUINT16: + a = x86.AROLW + + case gc.OLROT<<16 | gc.TINT32, + gc.OLROT<<16 | gc.TUINT32, + gc.OLROT<<16 | gc.TPTR32: + a = x86.AROLL + + case gc.OLSH<<16 | gc.TINT8, + gc.OLSH<<16 | gc.TUINT8: + a = x86.ASHLB + + case gc.OLSH<<16 | gc.TINT16, + gc.OLSH<<16 | gc.TUINT16: + a = x86.ASHLW + + case gc.OLSH<<16 | gc.TINT32, + gc.OLSH<<16 | gc.TUINT32, + gc.OLSH<<16 | gc.TPTR32: + a = x86.ASHLL + + case gc.ORSH<<16 | gc.TUINT8: + a = x86.ASHRB + + case gc.ORSH<<16 | gc.TUINT16: + a = x86.ASHRW + + case gc.ORSH<<16 | gc.TUINT32, + gc.ORSH<<16 | gc.TPTR32: + a = x86.ASHRL + + case gc.ORSH<<16 | gc.TINT8: + a = x86.ASARB + + case gc.ORSH<<16 | gc.TINT16: + a = x86.ASARW + + case gc.ORSH<<16 | gc.TINT32: + a = x86.ASARL + + case gc.OHMUL<<16 | gc.TINT8, + gc.OMUL<<16 | gc.TINT8, + gc.OMUL<<16 | gc.TUINT8: + a = x86.AIMULB + + case gc.OHMUL<<16 | gc.TINT16, + gc.OMUL<<16 | gc.TINT16, + gc.OMUL<<16 | gc.TUINT16: + a = x86.AIMULW + + case gc.OHMUL<<16 | gc.TINT32, + gc.OMUL<<16 | gc.TINT32, + gc.OMUL<<16 | gc.TUINT32, + gc.OMUL<<16 | gc.TPTR32: + a = x86.AIMULL + + case gc.OHMUL<<16 | gc.TUINT8: + a = x86.AMULB + + case gc.OHMUL<<16 | gc.TUINT16: + a = x86.AMULW + + case gc.OHMUL<<16 | gc.TUINT32, + gc.OHMUL<<16 | gc.TPTR32: + a = x86.AMULL + + case gc.ODIV<<16 | gc.TINT8, + gc.OMOD<<16 | gc.TINT8: + a = x86.AIDIVB + + case gc.ODIV<<16 | gc.TUINT8, + gc.OMOD<<16 | gc.TUINT8: + a = x86.ADIVB + + case gc.ODIV<<16 | gc.TINT16, + gc.OMOD<<16 | gc.TINT16: + a = x86.AIDIVW + + case gc.ODIV<<16 | gc.TUINT16, + gc.OMOD<<16 | gc.TUINT16: + a = x86.ADIVW + + case gc.ODIV<<16 | gc.TINT32, + gc.OMOD<<16 | gc.TINT32: + a = x86.AIDIVL + + case gc.ODIV<<16 | gc.TUINT32, + gc.ODIV<<16 | gc.TPTR32, + gc.OMOD<<16 | gc.TUINT32, + gc.OMOD<<16 | gc.TPTR32: + a = x86.ADIVL + + case gc.OEXTEND<<16 | gc.TINT16: + a = x86.ACWD + + case gc.OEXTEND<<16 | gc.TINT32: + a = x86.ACDQ + } + + return a +} + +func foptoas(op int, t *gc.Type, flg int) int { + a := obj.AXXX + et := int(gc.Simtype[t.Etype]) + + if !gc.Thearch.Use387 { + switch uint32(op)<<16 | uint32(et) { + default: + gc.Fatal("foptoas-sse: no entry %v-%v", gc.Oconv(int(op), 0), t) + + case gc.OCMP<<16 | gc.TFLOAT32: + a = x86.AUCOMISS + + case gc.OCMP<<16 | gc.TFLOAT64: + a = x86.AUCOMISD + + case gc.OAS<<16 | gc.TFLOAT32: + a = x86.AMOVSS + + case gc.OAS<<16 | gc.TFLOAT64: + a = x86.AMOVSD + + case gc.OADD<<16 | gc.TFLOAT32: + a = x86.AADDSS + + case gc.OADD<<16 | gc.TFLOAT64: + a = x86.AADDSD + + case gc.OSUB<<16 | gc.TFLOAT32: + a = x86.ASUBSS + + case gc.OSUB<<16 | gc.TFLOAT64: + a = x86.ASUBSD + + case gc.OMUL<<16 | gc.TFLOAT32: + a = x86.AMULSS + + case gc.OMUL<<16 | gc.TFLOAT64: + a = x86.AMULSD + + case gc.ODIV<<16 | gc.TFLOAT32: + a = x86.ADIVSS + + case gc.ODIV<<16 | gc.TFLOAT64: + a = x86.ADIVSD + } + + return a + } + + // If we need Fpop, it means we're working on + // two different floating-point registers, not memory. + // There the instruction only has a float64 form. + if flg&Fpop != 0 { + et = gc.TFLOAT64 + } + + // clear Frev if unneeded + switch op { + case gc.OADD, + gc.OMUL: + flg &^= Frev + } + + switch uint32(op)<<16 | (uint32(et)<<8 | uint32(flg)) { + case gc.OADD<<16 | (gc.TFLOAT32<<8 | 0): + return x86.AFADDF + + case gc.OADD<<16 | (gc.TFLOAT64<<8 | 0): + return x86.AFADDD + + case gc.OADD<<16 | (gc.TFLOAT64<<8 | Fpop): + return x86.AFADDDP + + case gc.OSUB<<16 | (gc.TFLOAT32<<8 | 0): + return x86.AFSUBF + + case gc.OSUB<<16 | (gc.TFLOAT32<<8 | Frev): + return x86.AFSUBRF + + case gc.OSUB<<16 | (gc.TFLOAT64<<8 | 0): + return x86.AFSUBD + + case gc.OSUB<<16 | (gc.TFLOAT64<<8 | Frev): + return x86.AFSUBRD + + case gc.OSUB<<16 | (gc.TFLOAT64<<8 | Fpop): + return x86.AFSUBDP + + case gc.OSUB<<16 | (gc.TFLOAT64<<8 | (Fpop | Frev)): + return x86.AFSUBRDP + + case gc.OMUL<<16 | (gc.TFLOAT32<<8 | 0): + return x86.AFMULF + + case gc.OMUL<<16 | (gc.TFLOAT64<<8 | 0): + return x86.AFMULD + + case gc.OMUL<<16 | (gc.TFLOAT64<<8 | Fpop): + return x86.AFMULDP + + case gc.ODIV<<16 | (gc.TFLOAT32<<8 | 0): + return x86.AFDIVF + + case gc.ODIV<<16 | (gc.TFLOAT32<<8 | Frev): + return x86.AFDIVRF + + case gc.ODIV<<16 | (gc.TFLOAT64<<8 | 0): + return x86.AFDIVD + + case gc.ODIV<<16 | (gc.TFLOAT64<<8 | Frev): + return x86.AFDIVRD + + case gc.ODIV<<16 | (gc.TFLOAT64<<8 | Fpop): + return x86.AFDIVDP + + case gc.ODIV<<16 | (gc.TFLOAT64<<8 | (Fpop | Frev)): + return x86.AFDIVRDP + + case gc.OCMP<<16 | (gc.TFLOAT32<<8 | 0): + return x86.AFCOMF + + case gc.OCMP<<16 | (gc.TFLOAT32<<8 | Fpop): + return x86.AFCOMFP + + case gc.OCMP<<16 | (gc.TFLOAT64<<8 | 0): + return x86.AFCOMD + + case gc.OCMP<<16 | (gc.TFLOAT64<<8 | Fpop): + return x86.AFCOMDP + + case gc.OCMP<<16 | (gc.TFLOAT64<<8 | Fpop2): + return x86.AFCOMDPP + + case gc.OMINUS<<16 | (gc.TFLOAT32<<8 | 0): + return x86.AFCHS + + case gc.OMINUS<<16 | (gc.TFLOAT64<<8 | 0): + return x86.AFCHS + } + + gc.Fatal("foptoas %v %v %#x", gc.Oconv(int(op), 0), t, flg) + return 0 +} + +var resvd = []int{ + // REG_DI, // for movstring + // REG_SI, // for movstring + + x86.REG_AX, // for divide + x86.REG_CX, // for shift + x86.REG_DX, // for divide, context + x86.REG_SP, // for stack +} + +/* + * generate + * as $c, reg + */ +func gconreg(as int, c int64, reg int) { + var n1 gc.Node + var n2 gc.Node + + gc.Nodconst(&n1, gc.Types[gc.TINT64], c) + gc.Nodreg(&n2, gc.Types[gc.TINT64], reg) + gins(as, &n1, &n2) +} + +/* + * generate + * as $c, n + */ +func ginscon(as int, c int64, n2 *gc.Node) { + var n1 gc.Node + gc.Nodconst(&n1, gc.Types[gc.TINT32], c) + gins(as, &n1, n2) +} + +func ginscmp(op int, t *gc.Type, n1, n2 *gc.Node, likely int) *obj.Prog { + if gc.Isint[t.Etype] || int(t.Etype) == gc.Tptr { + if (n1.Op == gc.OLITERAL || n1.Op == gc.OADDR && n1.Left.Op == gc.ONAME) && n2.Op != gc.OLITERAL { + // Reverse comparison to place constant (including address constant) last. + op = gc.Brrev(op) + n1, n2 = n2, n1 + } + } + + // General case. + var r1, r2, g1, g2 gc.Node + if n1.Op == gc.ONAME && n1.Class&gc.PHEAP == 0 || n1.Op == gc.OINDREG { + r1 = *n1 + } else { + gc.Regalloc(&r1, t, n1) + gc.Regalloc(&g1, n1.Type, &r1) + gc.Cgen(n1, &g1) + gmove(&g1, &r1) + } + if n2.Op == gc.OLITERAL && gc.Isint[t.Etype] || n2.Op == gc.OADDR && n2.Left.Op == gc.ONAME && n2.Left.Class == gc.PEXTERN { + r2 = *n2 + } else { + gc.Regalloc(&r2, t, n2) + gc.Regalloc(&g2, n1.Type, &r2) + gc.Cgen(n2, &g2) + gmove(&g2, &r2) + } + gins(optoas(gc.OCMP, t), &r1, &r2) + if r1.Op == gc.OREGISTER { + gc.Regfree(&g1) + gc.Regfree(&r1) + } + if r2.Op == gc.OREGISTER { + gc.Regfree(&g2) + gc.Regfree(&r2) + } + return gc.Gbranch(optoas(op, t), nil, likely) +} + +/* + * swap node contents + */ +func nswap(a *gc.Node, b *gc.Node) { + t := *a + *a = *b + *b = t +} + +/* + * return constant i node. + * overwritten by next call, but useful in calls to gins. + */ + +var ncon_n gc.Node + +func ncon(i uint32) *gc.Node { + if ncon_n.Type == nil { + gc.Nodconst(&ncon_n, gc.Types[gc.TUINT32], 0) + } + ncon_n.SetInt(int64(i)) + return &ncon_n +} + +var sclean [10]gc.Node + +var nsclean int + +/* + * n is a 64-bit value. fill in lo and hi to refer to its 32-bit halves. + */ +func split64(n *gc.Node, lo *gc.Node, hi *gc.Node) { + if !gc.Is64(n.Type) { + gc.Fatal("split64 %v", n.Type) + } + + if nsclean >= len(sclean) { + gc.Fatal("split64 clean") + } + sclean[nsclean].Op = gc.OEMPTY + nsclean++ + switch n.Op { + default: + switch n.Op { + default: + var n1 gc.Node + if !dotaddable(n, &n1) { + gc.Igen(n, &n1, nil) + sclean[nsclean-1] = n1 + } + + n = &n1 + + case gc.ONAME: + if n.Class == gc.PPARAMREF { + var n1 gc.Node + gc.Cgen(n.Name.Heapaddr, &n1) + sclean[nsclean-1] = n1 + n = &n1 + } + + // nothing + case gc.OINDREG: + break + } + + *lo = *n + *hi = *n + lo.Type = gc.Types[gc.TUINT32] + if n.Type.Etype == gc.TINT64 { + hi.Type = gc.Types[gc.TINT32] + } else { + hi.Type = gc.Types[gc.TUINT32] + } + hi.Xoffset += 4 + + case gc.OLITERAL: + var n1 gc.Node + n.Convconst(&n1, n.Type) + i := n1.Int() + gc.Nodconst(lo, gc.Types[gc.TUINT32], int64(uint32(i))) + i >>= 32 + if n.Type.Etype == gc.TINT64 { + gc.Nodconst(hi, gc.Types[gc.TINT32], int64(int32(i))) + } else { + gc.Nodconst(hi, gc.Types[gc.TUINT32], int64(uint32(i))) + } + } +} + +func splitclean() { + if nsclean <= 0 { + gc.Fatal("splitclean") + } + nsclean-- + if sclean[nsclean].Op != gc.OEMPTY { + gc.Regfree(&sclean[nsclean]) + } +} + +// set up nodes representing fp constants +var ( + zerof gc.Node + two63f gc.Node + two64f gc.Node + bignodes_did bool +) + +func bignodes() { + if bignodes_did { + return + } + bignodes_did = true + + gc.Nodconst(&zerof, gc.Types[gc.TINT64], 0) + zerof.Convconst(&zerof, gc.Types[gc.TFLOAT64]) + + var i big.Int + i.SetInt64(1) + i.Lsh(&i, 63) + var bigi gc.Node + + gc.Nodconst(&bigi, gc.Types[gc.TUINT64], 0) + bigi.SetBigInt(&i) + bigi.Convconst(&two63f, gc.Types[gc.TFLOAT64]) + + gc.Nodconst(&bigi, gc.Types[gc.TUINT64], 0) + i.Lsh(&i, 1) + bigi.SetBigInt(&i) + bigi.Convconst(&two64f, gc.Types[gc.TFLOAT64]) +} + +func memname(n *gc.Node, t *gc.Type) { + gc.Tempname(n, t) + n.Sym = gc.Lookup("." + n.Sym.Name[1:]) // keep optimizer from registerizing + n.Orig.Sym = n.Sym +} + +func gmove(f *gc.Node, t *gc.Node) { + if gc.Debug['M'] != 0 { + fmt.Printf("gmove %v -> %v\n", f, t) + } + + ft := gc.Simsimtype(f.Type) + tt := gc.Simsimtype(t.Type) + cvt := t.Type + + if gc.Iscomplex[ft] || gc.Iscomplex[tt] { + gc.Complexmove(f, t) + return + } + + if gc.Isfloat[ft] || gc.Isfloat[tt] { + floatmove(f, t) + return + } + + // cannot have two integer memory operands; + // except 64-bit, which always copies via registers anyway. + var r1 gc.Node + var a int + if gc.Isint[ft] && gc.Isint[tt] && !gc.Is64(f.Type) && !gc.Is64(t.Type) && gc.Ismem(f) && gc.Ismem(t) { + goto hard + } + + // convert constant to desired type + if f.Op == gc.OLITERAL { + var con gc.Node + f.Convconst(&con, t.Type) + f = &con + ft = gc.Simsimtype(con.Type) + } + + // value -> value copy, only one memory operand. + // figure out the instruction to use. + // break out of switch for one-instruction gins. + // goto rdst for "destination must be register". + // goto hard for "convert to cvt type first". + // otherwise handle and return. + + switch uint32(ft)<<16 | uint32(tt) { + default: + // should not happen + gc.Fatal("gmove %v -> %v", f, t) + return + + /* + * integer copy and truncate + */ + case gc.TINT8<<16 | gc.TINT8, // same size + gc.TINT8<<16 | gc.TUINT8, + gc.TUINT8<<16 | gc.TINT8, + gc.TUINT8<<16 | gc.TUINT8: + a = x86.AMOVB + + case gc.TINT16<<16 | gc.TINT8, // truncate + gc.TUINT16<<16 | gc.TINT8, + gc.TINT32<<16 | gc.TINT8, + gc.TUINT32<<16 | gc.TINT8, + gc.TINT16<<16 | gc.TUINT8, + gc.TUINT16<<16 | gc.TUINT8, + gc.TINT32<<16 | gc.TUINT8, + gc.TUINT32<<16 | gc.TUINT8: + a = x86.AMOVB + + goto rsrc + + case gc.TINT64<<16 | gc.TINT8, // truncate low word + gc.TUINT64<<16 | gc.TINT8, + gc.TINT64<<16 | gc.TUINT8, + gc.TUINT64<<16 | gc.TUINT8: + var flo gc.Node + var fhi gc.Node + split64(f, &flo, &fhi) + + var r1 gc.Node + gc.Nodreg(&r1, t.Type, x86.REG_AX) + gmove(&flo, &r1) + gins(x86.AMOVB, &r1, t) + splitclean() + return + + case gc.TINT16<<16 | gc.TINT16, // same size + gc.TINT16<<16 | gc.TUINT16, + gc.TUINT16<<16 | gc.TINT16, + gc.TUINT16<<16 | gc.TUINT16: + a = x86.AMOVW + + case gc.TINT32<<16 | gc.TINT16, // truncate + gc.TUINT32<<16 | gc.TINT16, + gc.TINT32<<16 | gc.TUINT16, + gc.TUINT32<<16 | gc.TUINT16: + a = x86.AMOVW + + goto rsrc + + case gc.TINT64<<16 | gc.TINT16, // truncate low word + gc.TUINT64<<16 | gc.TINT16, + gc.TINT64<<16 | gc.TUINT16, + gc.TUINT64<<16 | gc.TUINT16: + var flo gc.Node + var fhi gc.Node + split64(f, &flo, &fhi) + + var r1 gc.Node + gc.Nodreg(&r1, t.Type, x86.REG_AX) + gmove(&flo, &r1) + gins(x86.AMOVW, &r1, t) + splitclean() + return + + case gc.TINT32<<16 | gc.TINT32, // same size + gc.TINT32<<16 | gc.TUINT32, + gc.TUINT32<<16 | gc.TINT32, + gc.TUINT32<<16 | gc.TUINT32: + a = x86.AMOVL + + case gc.TINT64<<16 | gc.TINT32, // truncate + gc.TUINT64<<16 | gc.TINT32, + gc.TINT64<<16 | gc.TUINT32, + gc.TUINT64<<16 | gc.TUINT32: + var fhi gc.Node + var flo gc.Node + split64(f, &flo, &fhi) + + var r1 gc.Node + gc.Nodreg(&r1, t.Type, x86.REG_AX) + gmove(&flo, &r1) + gins(x86.AMOVL, &r1, t) + splitclean() + return + + case gc.TINT64<<16 | gc.TINT64, // same size + gc.TINT64<<16 | gc.TUINT64, + gc.TUINT64<<16 | gc.TINT64, + gc.TUINT64<<16 | gc.TUINT64: + var fhi gc.Node + var flo gc.Node + split64(f, &flo, &fhi) + + var tlo gc.Node + var thi gc.Node + split64(t, &tlo, &thi) + if f.Op == gc.OLITERAL { + gins(x86.AMOVL, &flo, &tlo) + gins(x86.AMOVL, &fhi, &thi) + } else { + // Implementation of conversion-free x = y for int64 or uint64 x. + // This is generated by the code that copies small values out of closures, + // and that code has DX live, so avoid DX and use CX instead. + var r1 gc.Node + gc.Nodreg(&r1, gc.Types[gc.TUINT32], x86.REG_AX) + var r2 gc.Node + gc.Nodreg(&r2, gc.Types[gc.TUINT32], x86.REG_CX) + gins(x86.AMOVL, &flo, &r1) + gins(x86.AMOVL, &fhi, &r2) + gins(x86.AMOVL, &r1, &tlo) + gins(x86.AMOVL, &r2, &thi) + } + + splitclean() + splitclean() + return + + /* + * integer up-conversions + */ + case gc.TINT8<<16 | gc.TINT16, // sign extend int8 + gc.TINT8<<16 | gc.TUINT16: + a = x86.AMOVBWSX + + goto rdst + + case gc.TINT8<<16 | gc.TINT32, + gc.TINT8<<16 | gc.TUINT32: + a = x86.AMOVBLSX + goto rdst + + case gc.TINT8<<16 | gc.TINT64, // convert via int32 + gc.TINT8<<16 | gc.TUINT64: + cvt = gc.Types[gc.TINT32] + + goto hard + + case gc.TUINT8<<16 | gc.TINT16, // zero extend uint8 + gc.TUINT8<<16 | gc.TUINT16: + a = x86.AMOVBWZX + + goto rdst + + case gc.TUINT8<<16 | gc.TINT32, + gc.TUINT8<<16 | gc.TUINT32: + a = x86.AMOVBLZX + goto rdst + + case gc.TUINT8<<16 | gc.TINT64, // convert via uint32 + gc.TUINT8<<16 | gc.TUINT64: + cvt = gc.Types[gc.TUINT32] + + goto hard + + case gc.TINT16<<16 | gc.TINT32, // sign extend int16 + gc.TINT16<<16 | gc.TUINT32: + a = x86.AMOVWLSX + + goto rdst + + case gc.TINT16<<16 | gc.TINT64, // convert via int32 + gc.TINT16<<16 | gc.TUINT64: + cvt = gc.Types[gc.TINT32] + + goto hard + + case gc.TUINT16<<16 | gc.TINT32, // zero extend uint16 + gc.TUINT16<<16 | gc.TUINT32: + a = x86.AMOVWLZX + + goto rdst + + case gc.TUINT16<<16 | gc.TINT64, // convert via uint32 + gc.TUINT16<<16 | gc.TUINT64: + cvt = gc.Types[gc.TUINT32] + + goto hard + + case gc.TINT32<<16 | gc.TINT64, // sign extend int32 + gc.TINT32<<16 | gc.TUINT64: + var thi gc.Node + var tlo gc.Node + split64(t, &tlo, &thi) + + var flo gc.Node + gc.Nodreg(&flo, tlo.Type, x86.REG_AX) + var fhi gc.Node + gc.Nodreg(&fhi, thi.Type, x86.REG_DX) + gmove(f, &flo) + gins(x86.ACDQ, nil, nil) + gins(x86.AMOVL, &flo, &tlo) + gins(x86.AMOVL, &fhi, &thi) + splitclean() + return + + case gc.TUINT32<<16 | gc.TINT64, // zero extend uint32 + gc.TUINT32<<16 | gc.TUINT64: + var tlo gc.Node + var thi gc.Node + split64(t, &tlo, &thi) + + gmove(f, &tlo) + gins(x86.AMOVL, ncon(0), &thi) + splitclean() + return + } + + gins(a, f, t) + return + + // requires register source +rsrc: + gc.Regalloc(&r1, f.Type, t) + + gmove(f, &r1) + gins(a, &r1, t) + gc.Regfree(&r1) + return + + // requires register destination +rdst: + { + gc.Regalloc(&r1, t.Type, t) + + gins(a, f, &r1) + gmove(&r1, t) + gc.Regfree(&r1) + return + } + + // requires register intermediate +hard: + gc.Regalloc(&r1, cvt, t) + + gmove(f, &r1) + gmove(&r1, t) + gc.Regfree(&r1) + return +} + +func floatmove(f *gc.Node, t *gc.Node) { + var r1 gc.Node + + ft := gc.Simsimtype(f.Type) + tt := gc.Simsimtype(t.Type) + cvt := t.Type + + // cannot have two floating point memory operands. + if gc.Isfloat[ft] && gc.Isfloat[tt] && gc.Ismem(f) && gc.Ismem(t) { + goto hard + } + + // convert constant to desired type + if f.Op == gc.OLITERAL { + var con gc.Node + f.Convconst(&con, t.Type) + f = &con + ft = gc.Simsimtype(con.Type) + + // some constants can't move directly to memory. + if gc.Ismem(t) { + // float constants come from memory. + if gc.Isfloat[tt] { + goto hard + } + } + } + + // value -> value copy, only one memory operand. + // figure out the instruction to use. + // break out of switch for one-instruction gins. + // goto rdst for "destination must be register". + // goto hard for "convert to cvt type first". + // otherwise handle and return. + + switch uint32(ft)<<16 | uint32(tt) { + default: + if gc.Thearch.Use387 { + floatmove_387(f, t) + } else { + floatmove_sse(f, t) + } + return + + // float to very long integer. + case gc.TFLOAT32<<16 | gc.TINT64, + gc.TFLOAT64<<16 | gc.TINT64: + if f.Op == gc.OREGISTER { + cvt = f.Type + goto hardmem + } + + var r1 gc.Node + gc.Nodreg(&r1, gc.Types[ft], x86.REG_F0) + if ft == gc.TFLOAT32 { + gins(x86.AFMOVF, f, &r1) + } else { + gins(x86.AFMOVD, f, &r1) + } + + // set round to zero mode during conversion + var t1 gc.Node + memname(&t1, gc.Types[gc.TUINT16]) + + var t2 gc.Node + memname(&t2, gc.Types[gc.TUINT16]) + gins(x86.AFSTCW, nil, &t1) + gins(x86.AMOVW, ncon(0xf7f), &t2) + gins(x86.AFLDCW, &t2, nil) + if tt == gc.TINT16 { + gins(x86.AFMOVWP, &r1, t) + } else if tt == gc.TINT32 { + gins(x86.AFMOVLP, &r1, t) + } else { + gins(x86.AFMOVVP, &r1, t) + } + gins(x86.AFLDCW, &t1, nil) + return + + case gc.TFLOAT32<<16 | gc.TUINT64, + gc.TFLOAT64<<16 | gc.TUINT64: + if !gc.Ismem(f) { + cvt = f.Type + goto hardmem + } + + bignodes() + var f0 gc.Node + gc.Nodreg(&f0, gc.Types[ft], x86.REG_F0) + var f1 gc.Node + gc.Nodreg(&f1, gc.Types[ft], x86.REG_F0+1) + var ax gc.Node + gc.Nodreg(&ax, gc.Types[gc.TUINT16], x86.REG_AX) + + if ft == gc.TFLOAT32 { + gins(x86.AFMOVF, f, &f0) + } else { + gins(x86.AFMOVD, f, &f0) + } + + // if 0 > v { answer = 0 } + gins(x86.AFMOVD, &zerof, &f0) + + gins(x86.AFUCOMIP, &f0, &f1) + p1 := gc.Gbranch(optoas(gc.OGT, gc.Types[tt]), nil, 0) + + // if 1<<64 <= v { answer = 0 too } + gins(x86.AFMOVD, &two64f, &f0) + + gins(x86.AFUCOMIP, &f0, &f1) + p2 := gc.Gbranch(optoas(gc.OGT, gc.Types[tt]), nil, 0) + gc.Patch(p1, gc.Pc) + gins(x86.AFMOVVP, &f0, t) // don't care about t, but will pop the stack + var thi gc.Node + var tlo gc.Node + split64(t, &tlo, &thi) + gins(x86.AMOVL, ncon(0), &tlo) + gins(x86.AMOVL, ncon(0), &thi) + splitclean() + p1 = gc.Gbranch(obj.AJMP, nil, 0) + gc.Patch(p2, gc.Pc) + + // in range; algorithm is: + // if small enough, use native float64 -> int64 conversion. + // otherwise, subtract 2^63, convert, and add it back. + + // set round to zero mode during conversion + var t1 gc.Node + memname(&t1, gc.Types[gc.TUINT16]) + + var t2 gc.Node + memname(&t2, gc.Types[gc.TUINT16]) + gins(x86.AFSTCW, nil, &t1) + gins(x86.AMOVW, ncon(0xf7f), &t2) + gins(x86.AFLDCW, &t2, nil) + + // actual work + gins(x86.AFMOVD, &two63f, &f0) + + gins(x86.AFUCOMIP, &f0, &f1) + p2 = gc.Gbranch(optoas(gc.OLE, gc.Types[tt]), nil, 0) + gins(x86.AFMOVVP, &f0, t) + p3 := gc.Gbranch(obj.AJMP, nil, 0) + gc.Patch(p2, gc.Pc) + gins(x86.AFMOVD, &two63f, &f0) + gins(x86.AFSUBDP, &f0, &f1) + gins(x86.AFMOVVP, &f0, t) + split64(t, &tlo, &thi) + gins(x86.AXORL, ncon(0x80000000), &thi) // + 2^63 + gc.Patch(p3, gc.Pc) + splitclean() + + // restore rounding mode + gins(x86.AFLDCW, &t1, nil) + + gc.Patch(p1, gc.Pc) + return + + /* + * integer to float + */ + case gc.TINT64<<16 | gc.TFLOAT32, + gc.TINT64<<16 | gc.TFLOAT64: + if t.Op == gc.OREGISTER { + goto hardmem + } + var f0 gc.Node + gc.Nodreg(&f0, t.Type, x86.REG_F0) + gins(x86.AFMOVV, f, &f0) + if tt == gc.TFLOAT32 { + gins(x86.AFMOVFP, &f0, t) + } else { + gins(x86.AFMOVDP, &f0, t) + } + return + + // algorithm is: + // if small enough, use native int64 -> float64 conversion. + // otherwise, halve (rounding to odd?), convert, and double. + case gc.TUINT64<<16 | gc.TFLOAT32, + gc.TUINT64<<16 | gc.TFLOAT64: + var ax gc.Node + gc.Nodreg(&ax, gc.Types[gc.TUINT32], x86.REG_AX) + + var dx gc.Node + gc.Nodreg(&dx, gc.Types[gc.TUINT32], x86.REG_DX) + var cx gc.Node + gc.Nodreg(&cx, gc.Types[gc.TUINT32], x86.REG_CX) + var t1 gc.Node + gc.Tempname(&t1, f.Type) + var tlo gc.Node + var thi gc.Node + split64(&t1, &tlo, &thi) + gmove(f, &t1) + gins(x86.ACMPL, &thi, ncon(0)) + p1 := gc.Gbranch(x86.AJLT, nil, 0) + + // native + var r1 gc.Node + gc.Nodreg(&r1, gc.Types[tt], x86.REG_F0) + + gins(x86.AFMOVV, &t1, &r1) + if tt == gc.TFLOAT32 { + gins(x86.AFMOVFP, &r1, t) + } else { + gins(x86.AFMOVDP, &r1, t) + } + p2 := gc.Gbranch(obj.AJMP, nil, 0) + + // simulated + gc.Patch(p1, gc.Pc) + + gmove(&tlo, &ax) + gmove(&thi, &dx) + p1 = gins(x86.ASHRL, ncon(1), &ax) + p1.From.Index = x86.REG_DX // double-width shift DX -> AX + p1.From.Scale = 0 + gins(x86.AMOVL, ncon(0), &cx) + gins(x86.ASETCC, nil, &cx) + gins(x86.AORL, &cx, &ax) + gins(x86.ASHRL, ncon(1), &dx) + gmove(&dx, &thi) + gmove(&ax, &tlo) + gc.Nodreg(&r1, gc.Types[tt], x86.REG_F0) + var r2 gc.Node + gc.Nodreg(&r2, gc.Types[tt], x86.REG_F0+1) + gins(x86.AFMOVV, &t1, &r1) + gins(x86.AFMOVD, &r1, &r1) + gins(x86.AFADDDP, &r1, &r2) + if tt == gc.TFLOAT32 { + gins(x86.AFMOVFP, &r1, t) + } else { + gins(x86.AFMOVDP, &r1, t) + } + gc.Patch(p2, gc.Pc) + splitclean() + return + } + + // requires register intermediate +hard: + gc.Regalloc(&r1, cvt, t) + + gmove(f, &r1) + gmove(&r1, t) + gc.Regfree(&r1) + return + + // requires memory intermediate +hardmem: + gc.Tempname(&r1, cvt) + + gmove(f, &r1) + gmove(&r1, t) + return +} + +func floatmove_387(f *gc.Node, t *gc.Node) { + var r1 gc.Node + var a int + + ft := gc.Simsimtype(f.Type) + tt := gc.Simsimtype(t.Type) + cvt := t.Type + + switch uint32(ft)<<16 | uint32(tt) { + default: + goto fatal + + /* + * float to integer + */ + case gc.TFLOAT32<<16 | gc.TINT16, + gc.TFLOAT32<<16 | gc.TINT32, + gc.TFLOAT32<<16 | gc.TINT64, + gc.TFLOAT64<<16 | gc.TINT16, + gc.TFLOAT64<<16 | gc.TINT32, + gc.TFLOAT64<<16 | gc.TINT64: + if t.Op == gc.OREGISTER { + goto hardmem + } + var r1 gc.Node + gc.Nodreg(&r1, gc.Types[ft], x86.REG_F0) + if f.Op != gc.OREGISTER { + if ft == gc.TFLOAT32 { + gins(x86.AFMOVF, f, &r1) + } else { + gins(x86.AFMOVD, f, &r1) + } + } + + // set round to zero mode during conversion + var t1 gc.Node + memname(&t1, gc.Types[gc.TUINT16]) + + var t2 gc.Node + memname(&t2, gc.Types[gc.TUINT16]) + gins(x86.AFSTCW, nil, &t1) + gins(x86.AMOVW, ncon(0xf7f), &t2) + gins(x86.AFLDCW, &t2, nil) + if tt == gc.TINT16 { + gins(x86.AFMOVWP, &r1, t) + } else if tt == gc.TINT32 { + gins(x86.AFMOVLP, &r1, t) + } else { + gins(x86.AFMOVVP, &r1, t) + } + gins(x86.AFLDCW, &t1, nil) + return + + // convert via int32. + case gc.TFLOAT32<<16 | gc.TINT8, + gc.TFLOAT32<<16 | gc.TUINT16, + gc.TFLOAT32<<16 | gc.TUINT8, + gc.TFLOAT64<<16 | gc.TINT8, + gc.TFLOAT64<<16 | gc.TUINT16, + gc.TFLOAT64<<16 | gc.TUINT8: + var t1 gc.Node + gc.Tempname(&t1, gc.Types[gc.TINT32]) + + gmove(f, &t1) + switch tt { + default: + gc.Fatal("gmove %v", t) + + case gc.TINT8: + gins(x86.ACMPL, &t1, ncon(-0x80&(1<<32-1))) + p1 := gc.Gbranch(optoas(gc.OLT, gc.Types[gc.TINT32]), nil, -1) + gins(x86.ACMPL, &t1, ncon(0x7f)) + p2 := gc.Gbranch(optoas(gc.OGT, gc.Types[gc.TINT32]), nil, -1) + p3 := gc.Gbranch(obj.AJMP, nil, 0) + gc.Patch(p1, gc.Pc) + gc.Patch(p2, gc.Pc) + gmove(ncon(-0x80&(1<<32-1)), &t1) + gc.Patch(p3, gc.Pc) + gmove(&t1, t) + + case gc.TUINT8: + gins(x86.ATESTL, ncon(0xffffff00), &t1) + p1 := gc.Gbranch(x86.AJEQ, nil, +1) + gins(x86.AMOVL, ncon(0), &t1) + gc.Patch(p1, gc.Pc) + gmove(&t1, t) + + case gc.TUINT16: + gins(x86.ATESTL, ncon(0xffff0000), &t1) + p1 := gc.Gbranch(x86.AJEQ, nil, +1) + gins(x86.AMOVL, ncon(0), &t1) + gc.Patch(p1, gc.Pc) + gmove(&t1, t) + } + + return + + // convert via int64. + case gc.TFLOAT32<<16 | gc.TUINT32, + gc.TFLOAT64<<16 | gc.TUINT32: + cvt = gc.Types[gc.TINT64] + + goto hardmem + + /* + * integer to float + */ + case gc.TINT16<<16 | gc.TFLOAT32, + gc.TINT16<<16 | gc.TFLOAT64, + gc.TINT32<<16 | gc.TFLOAT32, + gc.TINT32<<16 | gc.TFLOAT64, + gc.TINT64<<16 | gc.TFLOAT32, + gc.TINT64<<16 | gc.TFLOAT64: + if t.Op != gc.OREGISTER { + goto hard + } + if f.Op == gc.OREGISTER { + cvt = f.Type + goto hardmem + } + + switch ft { + case gc.TINT16: + a = x86.AFMOVW + + case gc.TINT32: + a = x86.AFMOVL + + default: + a = x86.AFMOVV + } + + // convert via int32 memory + case gc.TINT8<<16 | gc.TFLOAT32, + gc.TINT8<<16 | gc.TFLOAT64, + gc.TUINT16<<16 | gc.TFLOAT32, + gc.TUINT16<<16 | gc.TFLOAT64, + gc.TUINT8<<16 | gc.TFLOAT32, + gc.TUINT8<<16 | gc.TFLOAT64: + cvt = gc.Types[gc.TINT32] + + goto hardmem + + // convert via int64 memory + case gc.TUINT32<<16 | gc.TFLOAT32, + gc.TUINT32<<16 | gc.TFLOAT64: + cvt = gc.Types[gc.TINT64] + + goto hardmem + + // The way the code generator uses floating-point + // registers, a move from F0 to F0 is intended as a no-op. + // On the x86, it's not: it pushes a second copy of F0 + // on the floating point stack. So toss it away here. + // Also, F0 is the *only* register we ever evaluate + // into, so we should only see register/register as F0/F0. + /* + * float to float + */ + case gc.TFLOAT32<<16 | gc.TFLOAT32, + gc.TFLOAT64<<16 | gc.TFLOAT64: + if gc.Ismem(f) && gc.Ismem(t) { + goto hard + } + if f.Op == gc.OREGISTER && t.Op == gc.OREGISTER { + if f.Reg != x86.REG_F0 || t.Reg != x86.REG_F0 { + goto fatal + } + return + } + + a = x86.AFMOVF + if ft == gc.TFLOAT64 { + a = x86.AFMOVD + } + if gc.Ismem(t) { + if f.Op != gc.OREGISTER || f.Reg != x86.REG_F0 { + gc.Fatal("gmove %v", f) + } + a = x86.AFMOVFP + if ft == gc.TFLOAT64 { + a = x86.AFMOVDP + } + } + + case gc.TFLOAT32<<16 | gc.TFLOAT64: + if gc.Ismem(f) && gc.Ismem(t) { + goto hard + } + if f.Op == gc.OREGISTER && t.Op == gc.OREGISTER { + if f.Reg != x86.REG_F0 || t.Reg != x86.REG_F0 { + goto fatal + } + return + } + + if f.Op == gc.OREGISTER { + gins(x86.AFMOVDP, f, t) + } else { + gins(x86.AFMOVF, f, t) + } + return + + case gc.TFLOAT64<<16 | gc.TFLOAT32: + if gc.Ismem(f) && gc.Ismem(t) { + goto hard + } + if f.Op == gc.OREGISTER && t.Op == gc.OREGISTER { + var r1 gc.Node + gc.Tempname(&r1, gc.Types[gc.TFLOAT32]) + gins(x86.AFMOVFP, f, &r1) + gins(x86.AFMOVF, &r1, t) + return + } + + if f.Op == gc.OREGISTER { + gins(x86.AFMOVFP, f, t) + } else { + gins(x86.AFMOVD, f, t) + } + return + } + + gins(a, f, t) + return + + // requires register intermediate +hard: + gc.Regalloc(&r1, cvt, t) + + gmove(f, &r1) + gmove(&r1, t) + gc.Regfree(&r1) + return + + // requires memory intermediate +hardmem: + gc.Tempname(&r1, cvt) + + gmove(f, &r1) + gmove(&r1, t) + return + + // should not happen +fatal: + gc.Fatal("gmove %v -> %v", gc.Nconv(f, obj.FmtLong), gc.Nconv(t, obj.FmtLong)) + + return +} + +func floatmove_sse(f *gc.Node, t *gc.Node) { + var r1 gc.Node + var cvt *gc.Type + var a int + + ft := gc.Simsimtype(f.Type) + tt := gc.Simsimtype(t.Type) + + switch uint32(ft)<<16 | uint32(tt) { + // should not happen + default: + gc.Fatal("gmove %v -> %v", f, t) + + return + + // convert via int32. + /* + * float to integer + */ + case gc.TFLOAT32<<16 | gc.TINT16, + gc.TFLOAT32<<16 | gc.TINT8, + gc.TFLOAT32<<16 | gc.TUINT16, + gc.TFLOAT32<<16 | gc.TUINT8, + gc.TFLOAT64<<16 | gc.TINT16, + gc.TFLOAT64<<16 | gc.TINT8, + gc.TFLOAT64<<16 | gc.TUINT16, + gc.TFLOAT64<<16 | gc.TUINT8: + cvt = gc.Types[gc.TINT32] + + goto hard + + // convert via int64. + case gc.TFLOAT32<<16 | gc.TUINT32, + gc.TFLOAT64<<16 | gc.TUINT32: + cvt = gc.Types[gc.TINT64] + + goto hardmem + + case gc.TFLOAT32<<16 | gc.TINT32: + a = x86.ACVTTSS2SL + goto rdst + + case gc.TFLOAT64<<16 | gc.TINT32: + a = x86.ACVTTSD2SL + goto rdst + + // convert via int32 memory + /* + * integer to float + */ + case gc.TINT8<<16 | gc.TFLOAT32, + gc.TINT8<<16 | gc.TFLOAT64, + gc.TINT16<<16 | gc.TFLOAT32, + gc.TINT16<<16 | gc.TFLOAT64, + gc.TUINT16<<16 | gc.TFLOAT32, + gc.TUINT16<<16 | gc.TFLOAT64, + gc.TUINT8<<16 | gc.TFLOAT32, + gc.TUINT8<<16 | gc.TFLOAT64: + cvt = gc.Types[gc.TINT32] + + goto hard + + // convert via int64 memory + case gc.TUINT32<<16 | gc.TFLOAT32, + gc.TUINT32<<16 | gc.TFLOAT64: + cvt = gc.Types[gc.TINT64] + + goto hardmem + + case gc.TINT32<<16 | gc.TFLOAT32: + a = x86.ACVTSL2SS + goto rdst + + case gc.TINT32<<16 | gc.TFLOAT64: + a = x86.ACVTSL2SD + goto rdst + + /* + * float to float + */ + case gc.TFLOAT32<<16 | gc.TFLOAT32: + a = x86.AMOVSS + + case gc.TFLOAT64<<16 | gc.TFLOAT64: + a = x86.AMOVSD + + case gc.TFLOAT32<<16 | gc.TFLOAT64: + a = x86.ACVTSS2SD + goto rdst + + case gc.TFLOAT64<<16 | gc.TFLOAT32: + a = x86.ACVTSD2SS + goto rdst + } + + gins(a, f, t) + return + + // requires register intermediate +hard: + gc.Regalloc(&r1, cvt, t) + + gmove(f, &r1) + gmove(&r1, t) + gc.Regfree(&r1) + return + + // requires memory intermediate +hardmem: + gc.Tempname(&r1, cvt) + + gmove(f, &r1) + gmove(&r1, t) + return + + // requires register destination +rdst: + gc.Regalloc(&r1, t.Type, t) + + gins(a, f, &r1) + gmove(&r1, t) + gc.Regfree(&r1) + return +} + +func samaddr(f *gc.Node, t *gc.Node) bool { + if f.Op != t.Op { + return false + } + + switch f.Op { + case gc.OREGISTER: + if f.Reg != t.Reg { + break + } + return true + } + + return false +} + +/* + * generate one instruction: + * as f, t + */ +func gins(as int, f *gc.Node, t *gc.Node) *obj.Prog { + if as == x86.AFMOVF && f != nil && f.Op == gc.OREGISTER && t != nil && t.Op == gc.OREGISTER { + gc.Fatal("gins MOVF reg, reg") + } + if as == x86.ACVTSD2SS && f != nil && f.Op == gc.OLITERAL { + gc.Fatal("gins CVTSD2SS const") + } + if as == x86.AMOVSD && t != nil && t.Op == gc.OREGISTER && t.Reg == x86.REG_F0 { + gc.Fatal("gins MOVSD into F0") + } + + if as == x86.AMOVL && f != nil && f.Op == gc.OADDR && f.Left.Op == gc.ONAME && f.Left.Class != gc.PEXTERN && f.Left.Class != gc.PFUNC { + // Turn MOVL $xxx(FP/SP) into LEAL xxx. + // These should be equivalent but most of the backend + // only expects to see LEAL, because that's what we had + // historically generated. Various hidden assumptions are baked in by now. + as = x86.ALEAL + f = f.Left + } + + switch as { + case x86.AMOVB, + x86.AMOVW, + x86.AMOVL: + if f != nil && t != nil && samaddr(f, t) { + return nil + } + + case x86.ALEAL: + if f != nil && gc.Isconst(f, gc.CTNIL) { + gc.Fatal("gins LEAL nil %v", f.Type) + } + } + + p := gc.Prog(as) + gc.Naddr(&p.From, f) + gc.Naddr(&p.To, t) + + if gc.Debug['g'] != 0 { + fmt.Printf("%v\n", p) + } + + w := 0 + switch as { + case x86.AMOVB: + w = 1 + + case x86.AMOVW: + w = 2 + + case x86.AMOVL: + w = 4 + } + + if true && w != 0 && f != nil && (p.From.Width > int64(w) || p.To.Width > int64(w)) { + gc.Dump("bad width from:", f) + gc.Dump("bad width to:", t) + gc.Fatal("bad width: %v (%d, %d)\n", p, p.From.Width, p.To.Width) + } + + if p.To.Type == obj.TYPE_ADDR && w > 0 { + gc.Fatal("bad use of addr: %v", p) + } + + return p +} + +func ginsnop() { + var reg gc.Node + gc.Nodreg(®, gc.Types[gc.TINT], x86.REG_AX) + gins(x86.AXCHGL, ®, ®) +} + +func dotaddable(n *gc.Node, n1 *gc.Node) bool { + if n.Op != gc.ODOT { + return false + } + + var oary [10]int64 + var nn *gc.Node + o := gc.Dotoffset(n, oary[:], &nn) + if nn != nil && nn.Addable && o == 1 && oary[0] >= 0 { + *n1 = *nn + n1.Type = n.Type + n1.Xoffset += oary[0] + return true + } + + return false +} + +func sudoclean() { +} + +func sudoaddable(as int, n *gc.Node, a *obj.Addr) bool { + *a = obj.Addr{} + return false +} diff --git a/src/cmd/compile/internal/x86/peep.go b/src/cmd/compile/internal/x86/peep.go new file mode 100644 index 0000000000000000000000000000000000000000..8b50eab077ad1f08ec79517c19b2f4031f2ce710 --- /dev/null +++ b/src/cmd/compile/internal/x86/peep.go @@ -0,0 +1,814 @@ +// Derived from Inferno utils/6c/peep.c +// http://code.google.com/p/inferno-os/source/browse/utils/6c/peep.c +// +// Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved. +// Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net) +// Portions Copyright © 1997-1999 Vita Nuova Limited +// Portions Copyright © 2000-2007 Vita Nuova Holdings Limited (www.vitanuova.com) +// Portions Copyright © 2004,2006 Bruce Ellis +// Portions Copyright © 2005-2007 C H Forsyth (forsyth@terzarima.net) +// Revisions Copyright © 2000-2007 Lucent Technologies Inc. and others +// Portions Copyright © 2009 The Go Authors. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +package x86 + +import ( + "cmd/compile/internal/gc" + "cmd/internal/obj" + "cmd/internal/obj/x86" + "fmt" +) + +const ( + REGEXT = 0 + exregoffset = x86.REG_DI +) + +var gactive uint32 + +// do we need the carry bit +func needc(p *obj.Prog) bool { + for p != nil { + if p.Info.Flags&gc.UseCarry != 0 { + return true + } + if p.Info.Flags&(gc.SetCarry|gc.KillCarry) != 0 { + return false + } + p = p.Link + } + + return false +} + +func rnops(r *gc.Flow) *gc.Flow { + if r != nil { + var p *obj.Prog + var r1 *gc.Flow + for { + p = r.Prog + if p.As != obj.ANOP || p.From.Type != obj.TYPE_NONE || p.To.Type != obj.TYPE_NONE { + break + } + r1 = gc.Uniqs(r) + if r1 == nil { + break + } + r = r1 + } + } + + return r +} + +func peep(firstp *obj.Prog) { + g := gc.Flowstart(firstp, nil) + if g == nil { + return + } + gactive = 0 + + // byte, word arithmetic elimination. + elimshortmov(g) + + // constant propagation + // find MOV $con,R followed by + // another MOV $con,R without + // setting R in the interim + var p *obj.Prog + for r := g.Start; r != nil; r = r.Link { + p = r.Prog + switch p.As { + case x86.ALEAL: + if regtyp(&p.To) { + if p.From.Sym != nil { + if p.From.Index == x86.REG_NONE { + conprop(r) + } + } + } + + case x86.AMOVB, + x86.AMOVW, + x86.AMOVL, + x86.AMOVSS, + x86.AMOVSD: + if regtyp(&p.To) { + if p.From.Type == obj.TYPE_CONST || p.From.Type == obj.TYPE_FCONST { + conprop(r) + } + } + } + } + + var r1 *gc.Flow + var p1 *obj.Prog + var r *gc.Flow + var t int +loop1: + if gc.Debug['P'] != 0 && gc.Debug['v'] != 0 { + gc.Dumpit("loop1", g.Start, 0) + } + + t = 0 + for r = g.Start; r != nil; r = r.Link { + p = r.Prog + switch p.As { + case x86.AMOVL, + x86.AMOVSS, + x86.AMOVSD: + if regtyp(&p.To) { + if regtyp(&p.From) { + if copyprop(g, r) { + excise(r) + t++ + } else if subprop(r) && copyprop(g, r) { + excise(r) + t++ + } + } + } + + case x86.AMOVBLZX, + x86.AMOVWLZX, + x86.AMOVBLSX, + x86.AMOVWLSX: + if regtyp(&p.To) { + r1 = rnops(gc.Uniqs(r)) + if r1 != nil { + p1 = r1.Prog + if p.As == p1.As && p.To.Type == p1.From.Type && p.To.Reg == p1.From.Reg { + p1.As = x86.AMOVL + t++ + } + } + } + + case x86.AADDL, + x86.AADDW: + if p.From.Type != obj.TYPE_CONST || needc(p.Link) { + break + } + if p.From.Offset == -1 { + if p.As == x86.AADDL { + p.As = x86.ADECL + } else { + p.As = x86.ADECW + } + p.From = obj.Addr{} + break + } + + if p.From.Offset == 1 { + if p.As == x86.AADDL { + p.As = x86.AINCL + } else { + p.As = x86.AINCW + } + p.From = obj.Addr{} + break + } + + case x86.ASUBL, + x86.ASUBW: + if p.From.Type != obj.TYPE_CONST || needc(p.Link) { + break + } + if p.From.Offset == -1 { + if p.As == x86.ASUBL { + p.As = x86.AINCL + } else { + p.As = x86.AINCW + } + p.From = obj.Addr{} + break + } + + if p.From.Offset == 1 { + if p.As == x86.ASUBL { + p.As = x86.ADECL + } else { + p.As = x86.ADECW + } + p.From = obj.Addr{} + break + } + } + } + + if t != 0 { + goto loop1 + } + + // MOVSD removal. + // We never use packed registers, so a MOVSD between registers + // can be replaced by MOVAPD, which moves the pair of float64s + // instead of just the lower one. We only use the lower one, but + // the processor can do better if we do moves using both. + for r := g.Start; r != nil; r = r.Link { + p = r.Prog + if p.As == x86.AMOVSD { + if regtyp(&p.From) { + if regtyp(&p.To) { + p.As = x86.AMOVAPD + } + } + } + } + + gc.Flowend(g) +} + +func excise(r *gc.Flow) { + p := r.Prog + if gc.Debug['P'] != 0 && gc.Debug['v'] != 0 { + fmt.Printf("%v ===delete===\n", p) + } + + obj.Nopout(p) + + gc.Ostats.Ndelmov++ +} + +func regtyp(a *obj.Addr) bool { + return a.Type == obj.TYPE_REG && (x86.REG_AX <= a.Reg && a.Reg <= x86.REG_DI || x86.REG_X0 <= a.Reg && a.Reg <= x86.REG_X7) +} + +// movb elimination. +// movb is simulated by the linker +// when a register other than ax, bx, cx, dx +// is used, so rewrite to other instructions +// when possible. a movb into a register +// can smash the entire 64-bit register without +// causing any trouble. +func elimshortmov(g *gc.Graph) { + var p *obj.Prog + + for r := g.Start; r != nil; r = r.Link { + p = r.Prog + if regtyp(&p.To) { + switch p.As { + case x86.AINCB, + x86.AINCW: + p.As = x86.AINCL + + case x86.ADECB, + x86.ADECW: + p.As = x86.ADECL + + case x86.ANEGB, + x86.ANEGW: + p.As = x86.ANEGL + + case x86.ANOTB, + x86.ANOTW: + p.As = x86.ANOTL + } + + if regtyp(&p.From) || p.From.Type == obj.TYPE_CONST { + // move or artihmetic into partial register. + // from another register or constant can be movl. + // we don't switch to 32-bit arithmetic if it can + // change how the carry bit is set (and the carry bit is needed). + switch p.As { + case x86.AMOVB, + x86.AMOVW: + p.As = x86.AMOVL + + case x86.AADDB, + x86.AADDW: + if !needc(p.Link) { + p.As = x86.AADDL + } + + case x86.ASUBB, + x86.ASUBW: + if !needc(p.Link) { + p.As = x86.ASUBL + } + + case x86.AMULB, + x86.AMULW: + p.As = x86.AMULL + + case x86.AIMULB, + x86.AIMULW: + p.As = x86.AIMULL + + case x86.AANDB, + x86.AANDW: + p.As = x86.AANDL + + case x86.AORB, + x86.AORW: + p.As = x86.AORL + + case x86.AXORB, + x86.AXORW: + p.As = x86.AXORL + + case x86.ASHLB, + x86.ASHLW: + p.As = x86.ASHLL + } + } else { + // explicit zero extension + switch p.As { + case x86.AMOVB: + p.As = x86.AMOVBLZX + + case x86.AMOVW: + p.As = x86.AMOVWLZX + } + } + } + } +} + +/* + * the idea is to substitute + * one register for another + * from one MOV to another + * MOV a, R0 + * ADD b, R0 / no use of R1 + * MOV R0, R1 + * would be converted to + * MOV a, R1 + * ADD b, R1 + * MOV R1, R0 + * hopefully, then the former or latter MOV + * will be eliminated by copy propagation. + */ +func subprop(r0 *gc.Flow) bool { + p := r0.Prog + v1 := &p.From + if !regtyp(v1) { + return false + } + v2 := &p.To + if !regtyp(v2) { + return false + } + for r := gc.Uniqp(r0); r != nil; r = gc.Uniqp(r) { + if gc.Debug['P'] != 0 && gc.Debug['v'] != 0 { + fmt.Printf("\t? %v\n", r.Prog) + } + if gc.Uniqs(r) == nil { + break + } + p = r.Prog + if p.As == obj.AVARDEF || p.As == obj.AVARKILL { + continue + } + if p.Info.Flags&gc.Call != 0 { + return false + } + + if p.Info.Reguse|p.Info.Regset != 0 { + return false + } + + if (p.Info.Flags&gc.Move != 0) && (p.Info.Flags&(gc.SizeL|gc.SizeQ|gc.SizeF|gc.SizeD) != 0) && p.To.Type == v1.Type && p.To.Reg == v1.Reg { + copysub(&p.To, v1, v2, 1) + if gc.Debug['P'] != 0 { + fmt.Printf("gotit: %v->%v\n%v", gc.Ctxt.Dconv(v1), gc.Ctxt.Dconv(v2), r.Prog) + if p.From.Type == v2.Type && p.From.Reg == v2.Reg { + fmt.Printf(" excise") + } + fmt.Printf("\n") + } + + for r = gc.Uniqs(r); r != r0; r = gc.Uniqs(r) { + p = r.Prog + copysub(&p.From, v1, v2, 1) + copysub(&p.To, v1, v2, 1) + if gc.Debug['P'] != 0 { + fmt.Printf("%v\n", r.Prog) + } + } + + t := int(v1.Reg) + v1.Reg = v2.Reg + v2.Reg = int16(t) + if gc.Debug['P'] != 0 { + fmt.Printf("%v last\n", r.Prog) + } + return true + } + + if copyau(&p.From, v2) || copyau(&p.To, v2) { + break + } + if copysub(&p.From, v1, v2, 0) != 0 || copysub(&p.To, v1, v2, 0) != 0 { + break + } + } + + return false +} + +/* + * The idea is to remove redundant copies. + * v1->v2 F=0 + * (use v2 s/v2/v1/)* + * set v1 F=1 + * use v2 return fail + * ----------------- + * v1->v2 F=0 + * (use v2 s/v2/v1/)* + * set v1 F=1 + * set v2 return success + */ +func copyprop(g *gc.Graph, r0 *gc.Flow) bool { + p := r0.Prog + v1 := &p.From + v2 := &p.To + if copyas(v1, v2) { + return true + } + gactive++ + return copy1(v1, v2, r0.S1, 0) +} + +func copy1(v1 *obj.Addr, v2 *obj.Addr, r *gc.Flow, f int) bool { + if uint32(r.Active) == gactive { + if gc.Debug['P'] != 0 { + fmt.Printf("act set; return 1\n") + } + return true + } + + r.Active = int32(gactive) + if gc.Debug['P'] != 0 { + fmt.Printf("copy %v->%v f=%d\n", gc.Ctxt.Dconv(v1), gc.Ctxt.Dconv(v2), f) + } + var t int + var p *obj.Prog + for ; r != nil; r = r.S1 { + p = r.Prog + if gc.Debug['P'] != 0 { + fmt.Printf("%v", p) + } + if f == 0 && gc.Uniqp(r) == nil { + f = 1 + if gc.Debug['P'] != 0 { + fmt.Printf("; merge; f=%d", f) + } + } + + t = copyu(p, v2, nil) + switch t { + case 2: /* rar, can't split */ + if gc.Debug['P'] != 0 { + fmt.Printf("; %v rar; return 0\n", gc.Ctxt.Dconv(v2)) + } + return false + + case 3: /* set */ + if gc.Debug['P'] != 0 { + fmt.Printf("; %v set; return 1\n", gc.Ctxt.Dconv(v2)) + } + return true + + case 1, /* used, substitute */ + 4: /* use and set */ + if f != 0 { + if gc.Debug['P'] == 0 { + return false + } + if t == 4 { + fmt.Printf("; %v used+set and f=%d; return 0\n", gc.Ctxt.Dconv(v2), f) + } else { + fmt.Printf("; %v used and f=%d; return 0\n", gc.Ctxt.Dconv(v2), f) + } + return false + } + + if copyu(p, v2, v1) != 0 { + if gc.Debug['P'] != 0 { + fmt.Printf("; sub fail; return 0\n") + } + return false + } + + if gc.Debug['P'] != 0 { + fmt.Printf("; sub %v/%v", gc.Ctxt.Dconv(v2), gc.Ctxt.Dconv(v1)) + } + if t == 4 { + if gc.Debug['P'] != 0 { + fmt.Printf("; %v used+set; return 1\n", gc.Ctxt.Dconv(v2)) + } + return true + } + } + + if f == 0 { + t = copyu(p, v1, nil) + if f == 0 && (t == 2 || t == 3 || t == 4) { + f = 1 + if gc.Debug['P'] != 0 { + fmt.Printf("; %v set and !f; f=%d", gc.Ctxt.Dconv(v1), f) + } + } + } + + if gc.Debug['P'] != 0 { + fmt.Printf("\n") + } + if r.S2 != nil { + if !copy1(v1, v2, r.S2, f) { + return false + } + } + } + + return true +} + +/* + * return + * 1 if v only used (and substitute), + * 2 if read-alter-rewrite + * 3 if set + * 4 if set and used + * 0 otherwise (not touched) + */ +func copyu(p *obj.Prog, v *obj.Addr, s *obj.Addr) int { + switch p.As { + case obj.AJMP: + if s != nil { + if copysub(&p.To, v, s, 1) != 0 { + return 1 + } + return 0 + } + + if copyau(&p.To, v) { + return 1 + } + return 0 + + case obj.ARET: + if s != nil { + return 1 + } + return 3 + + case obj.ACALL: + if REGEXT != 0 /*TypeKind(100016)*/ && v.Type == obj.TYPE_REG && v.Reg <= REGEXT && v.Reg > exregoffset { + return 2 + } + if x86.REGARG >= 0 && v.Type == obj.TYPE_REG && v.Reg == x86.REGARG { + return 2 + } + if v.Type == p.From.Type && v.Reg == p.From.Reg { + return 2 + } + + if s != nil { + if copysub(&p.To, v, s, 1) != 0 { + return 1 + } + return 0 + } + + if copyau(&p.To, v) { + return 4 + } + return 3 + + case obj.ATEXT: + if x86.REGARG >= 0 && v.Type == obj.TYPE_REG && v.Reg == x86.REGARG { + return 3 + } + return 0 + } + + if p.As == obj.AVARDEF || p.As == obj.AVARKILL { + return 0 + } + + if (p.Info.Reguse|p.Info.Regset)&RtoB(int(v.Reg)) != 0 { + return 2 + } + + if p.Info.Flags&gc.LeftAddr != 0 { + if copyas(&p.From, v) { + return 2 + } + } + + if p.Info.Flags&(gc.RightRead|gc.RightWrite) == gc.RightRead|gc.RightWrite { + if copyas(&p.To, v) { + return 2 + } + } + + if p.Info.Flags&gc.RightWrite != 0 { + if copyas(&p.To, v) { + if s != nil { + return copysub(&p.From, v, s, 1) + } + if copyau(&p.From, v) { + return 4 + } + return 3 + } + } + + if p.Info.Flags&(gc.LeftAddr|gc.LeftRead|gc.LeftWrite|gc.RightAddr|gc.RightRead|gc.RightWrite) != 0 { + if s != nil { + if copysub(&p.From, v, s, 1) != 0 { + return 1 + } + return copysub(&p.To, v, s, 1) + } + + if copyau(&p.From, v) { + return 1 + } + if copyau(&p.To, v) { + return 1 + } + } + + return 0 +} + +/* + * direct reference, + * could be set/use depending on + * semantics + */ +func copyas(a *obj.Addr, v *obj.Addr) bool { + if x86.REG_AL <= a.Reg && a.Reg <= x86.REG_BL { + gc.Fatal("use of byte register") + } + if x86.REG_AL <= v.Reg && v.Reg <= x86.REG_BL { + gc.Fatal("use of byte register") + } + + if a.Type != v.Type || a.Name != v.Name || a.Reg != v.Reg { + return false + } + if regtyp(v) { + return true + } + if (v.Type == obj.TYPE_MEM || v.Type == obj.TYPE_ADDR) && (v.Name == obj.NAME_AUTO || v.Name == obj.NAME_PARAM) { + if v.Offset == a.Offset { + return true + } + } + return false +} + +func sameaddr(a *obj.Addr, v *obj.Addr) bool { + if a.Type != v.Type || a.Name != v.Name || a.Reg != v.Reg { + return false + } + if regtyp(v) { + return true + } + if (v.Type == obj.TYPE_MEM || v.Type == obj.TYPE_ADDR) && (v.Name == obj.NAME_AUTO || v.Name == obj.NAME_PARAM) { + if v.Offset == a.Offset { + return true + } + } + return false +} + +/* + * either direct or indirect + */ +func copyau(a *obj.Addr, v *obj.Addr) bool { + if copyas(a, v) { + return true + } + if regtyp(v) { + if (a.Type == obj.TYPE_MEM || a.Type == obj.TYPE_ADDR) && a.Reg == v.Reg { + return true + } + if a.Index == v.Reg { + return true + } + } + + return false +} + +/* + * substitute s for v in a + * return failure to substitute + */ +func copysub(a *obj.Addr, v *obj.Addr, s *obj.Addr, f int) int { + if copyas(a, v) { + reg := int(s.Reg) + if reg >= x86.REG_AX && reg <= x86.REG_DI || reg >= x86.REG_X0 && reg <= x86.REG_X7 { + if f != 0 { + a.Reg = int16(reg) + } + } + + return 0 + } + + if regtyp(v) { + reg := int(v.Reg) + if (a.Type == obj.TYPE_MEM || a.Type == obj.TYPE_ADDR) && int(a.Reg) == reg { + if (s.Reg == x86.REG_BP) && a.Index != obj.TYPE_NONE { + return 1 /* can't use BP-base with index */ + } + if f != 0 { + a.Reg = s.Reg + } + } + + // return 0; + if int(a.Index) == reg { + if f != 0 { + a.Index = s.Reg + } + return 0 + } + + return 0 + } + + return 0 +} + +func conprop(r0 *gc.Flow) { + var p *obj.Prog + var t int + + p0 := r0.Prog + v0 := &p0.To + r := r0 + +loop: + r = gc.Uniqs(r) + if r == nil || r == r0 { + return + } + if gc.Uniqp(r) == nil { + return + } + + p = r.Prog + t = copyu(p, v0, nil) + switch t { + case 0, // miss + 1: // use + goto loop + + case 2, // rar + 4: // use and set + break + + case 3: // set + if p.As == p0.As { + if p.From.Type == p0.From.Type { + if p.From.Reg == p0.From.Reg { + if p.From.Node == p0.From.Node { + if p.From.Offset == p0.From.Offset { + if p.From.Scale == p0.From.Scale { + if p.From.Type == obj.TYPE_FCONST && p.From.Val.(float64) == p0.From.Val.(float64) { + if p.From.Index == p0.From.Index { + excise(r) + goto loop + } + } + } + } + } + } + } + } + } +} + +func smallindir(a *obj.Addr, reg *obj.Addr) bool { + return regtyp(reg) && a.Type == obj.TYPE_MEM && a.Reg == reg.Reg && a.Index == x86.REG_NONE && 0 <= a.Offset && a.Offset < 4096 +} + +func stackaddr(a *obj.Addr) bool { + return a.Type == obj.TYPE_REG && a.Reg == x86.REG_SP +} diff --git a/src/cmd/compile/internal/x86/prog.go b/src/cmd/compile/internal/x86/prog.go new file mode 100644 index 0000000000000000000000000000000000000000..f96a1aa9453bbc6c9ae91d6f8376fdacf0d4ca72 --- /dev/null +++ b/src/cmd/compile/internal/x86/prog.go @@ -0,0 +1,292 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package x86 + +import ( + "cmd/compile/internal/gc" + "cmd/internal/obj" + "cmd/internal/obj/x86" +) + +var ( + AX = RtoB(x86.REG_AX) + BX = RtoB(x86.REG_BX) + CX = RtoB(x86.REG_CX) + DX = RtoB(x86.REG_DX) + DI = RtoB(x86.REG_DI) + SI = RtoB(x86.REG_SI) + LeftRdwr uint32 = gc.LeftRead | gc.LeftWrite + RightRdwr uint32 = gc.RightRead | gc.RightWrite +) + +// This table gives the basic information about instruction +// generated by the compiler and processed in the optimizer. +// See opt.h for bit definitions. +// +// Instructions not generated need not be listed. +// As an exception to that rule, we typically write down all the +// size variants of an operation even if we just use a subset. +// +// The table is formatted for 8-space tabs. +var progtable = [x86.ALAST]obj.ProgInfo{ + obj.ATYPE: {gc.Pseudo | gc.Skip, 0, 0, 0}, + obj.ATEXT: {gc.Pseudo, 0, 0, 0}, + obj.AFUNCDATA: {gc.Pseudo, 0, 0, 0}, + obj.APCDATA: {gc.Pseudo, 0, 0, 0}, + obj.AUNDEF: {gc.Break, 0, 0, 0}, + obj.AUSEFIELD: {gc.OK, 0, 0, 0}, + obj.ACHECKNIL: {gc.LeftRead, 0, 0, 0}, + obj.AVARDEF: {gc.Pseudo | gc.RightWrite, 0, 0, 0}, + obj.AVARKILL: {gc.Pseudo | gc.RightWrite, 0, 0, 0}, + + // NOP is an internal no-op that also stands + // for USED and SET annotations, not the Intel opcode. + obj.ANOP: {gc.LeftRead | gc.RightWrite, 0, 0, 0}, + x86.AADCL: {gc.SizeL | gc.LeftRead | RightRdwr | gc.SetCarry | gc.UseCarry, 0, 0, 0}, + x86.AADCW: {gc.SizeW | gc.LeftRead | RightRdwr | gc.SetCarry | gc.UseCarry, 0, 0, 0}, + x86.AADDB: {gc.SizeB | gc.LeftRead | RightRdwr | gc.SetCarry, 0, 0, 0}, + x86.AADDL: {gc.SizeL | gc.LeftRead | RightRdwr | gc.SetCarry, 0, 0, 0}, + x86.AADDW: {gc.SizeW | gc.LeftRead | RightRdwr | gc.SetCarry, 0, 0, 0}, + x86.AADDSD: {gc.SizeD | gc.LeftRead | RightRdwr, 0, 0, 0}, + x86.AADDSS: {gc.SizeF | gc.LeftRead | RightRdwr, 0, 0, 0}, + x86.AANDB: {gc.SizeB | gc.LeftRead | RightRdwr | gc.SetCarry, 0, 0, 0}, + x86.AANDL: {gc.SizeL | gc.LeftRead | RightRdwr | gc.SetCarry, 0, 0, 0}, + x86.AANDW: {gc.SizeW | gc.LeftRead | RightRdwr | gc.SetCarry, 0, 0, 0}, + obj.ACALL: {gc.RightAddr | gc.Call | gc.KillCarry, 0, 0, 0}, + x86.ACDQ: {gc.OK, AX, AX | DX, 0}, + x86.ACWD: {gc.OK, AX, AX | DX, 0}, + x86.ACLD: {gc.OK, 0, 0, 0}, + x86.ASTD: {gc.OK, 0, 0, 0}, + x86.ACMPB: {gc.SizeB | gc.LeftRead | gc.RightRead | gc.SetCarry, 0, 0, 0}, + x86.ACMPL: {gc.SizeL | gc.LeftRead | gc.RightRead | gc.SetCarry, 0, 0, 0}, + x86.ACMPW: {gc.SizeW | gc.LeftRead | gc.RightRead | gc.SetCarry, 0, 0, 0}, + x86.ACOMISD: {gc.SizeD | gc.LeftRead | gc.RightRead | gc.SetCarry, 0, 0, 0}, + x86.ACOMISS: {gc.SizeF | gc.LeftRead | gc.RightRead | gc.SetCarry, 0, 0, 0}, + x86.ACVTSD2SL: {gc.SizeL | gc.LeftRead | gc.RightWrite | gc.Conv, 0, 0, 0}, + x86.ACVTSD2SS: {gc.SizeF | gc.LeftRead | gc.RightWrite | gc.Conv, 0, 0, 0}, + x86.ACVTSL2SD: {gc.SizeD | gc.LeftRead | gc.RightWrite | gc.Conv, 0, 0, 0}, + x86.ACVTSL2SS: {gc.SizeF | gc.LeftRead | gc.RightWrite | gc.Conv, 0, 0, 0}, + x86.ACVTSS2SD: {gc.SizeD | gc.LeftRead | gc.RightWrite | gc.Conv, 0, 0, 0}, + x86.ACVTSS2SL: {gc.SizeL | gc.LeftRead | gc.RightWrite | gc.Conv, 0, 0, 0}, + x86.ACVTTSD2SL: {gc.SizeL | gc.LeftRead | gc.RightWrite | gc.Conv, 0, 0, 0}, + x86.ACVTTSS2SL: {gc.SizeL | gc.LeftRead | gc.RightWrite | gc.Conv, 0, 0, 0}, + x86.ADECB: {gc.SizeB | RightRdwr, 0, 0, 0}, + x86.ADECL: {gc.SizeL | RightRdwr, 0, 0, 0}, + x86.ADECW: {gc.SizeW | RightRdwr, 0, 0, 0}, + x86.ADIVB: {gc.SizeB | gc.LeftRead | gc.SetCarry, AX, AX, 0}, + x86.ADIVL: {gc.SizeL | gc.LeftRead | gc.SetCarry, AX | DX, AX | DX, 0}, + x86.ADIVW: {gc.SizeW | gc.LeftRead | gc.SetCarry, AX | DX, AX | DX, 0}, + x86.ADIVSD: {gc.SizeD | gc.LeftRead | RightRdwr, 0, 0, 0}, + x86.ADIVSS: {gc.SizeF | gc.LeftRead | RightRdwr, 0, 0, 0}, + x86.AFLDCW: {gc.SizeW | gc.LeftAddr, 0, 0, 0}, + x86.AFSTCW: {gc.SizeW | gc.RightAddr, 0, 0, 0}, + x86.AFSTSW: {gc.SizeW | gc.RightAddr | gc.RightWrite, 0, 0, 0}, + x86.AFADDD: {gc.SizeD | gc.LeftAddr | RightRdwr, 0, 0, 0}, + x86.AFADDDP: {gc.SizeD | gc.LeftAddr | RightRdwr, 0, 0, 0}, + x86.AFADDF: {gc.SizeF | gc.LeftAddr | RightRdwr, 0, 0, 0}, + x86.AFCOMD: {gc.SizeD | gc.LeftAddr | gc.RightRead, 0, 0, 0}, + x86.AFCOMDP: {gc.SizeD | gc.LeftAddr | gc.RightRead, 0, 0, 0}, + x86.AFCOMDPP: {gc.SizeD | gc.LeftAddr | gc.RightRead, 0, 0, 0}, + x86.AFCOMF: {gc.SizeF | gc.LeftAddr | gc.RightRead, 0, 0, 0}, + x86.AFCOMFP: {gc.SizeF | gc.LeftAddr | gc.RightRead, 0, 0, 0}, + x86.AFUCOMIP: {gc.SizeF | gc.LeftAddr | gc.RightRead, 0, 0, 0}, + x86.AFCHS: {gc.SizeD | RightRdwr, 0, 0, 0}, // also SizeF + + x86.AFDIVDP: {gc.SizeD | gc.LeftAddr | RightRdwr, 0, 0, 0}, + x86.AFDIVF: {gc.SizeF | gc.LeftAddr | RightRdwr, 0, 0, 0}, + x86.AFDIVD: {gc.SizeD | gc.LeftAddr | RightRdwr, 0, 0, 0}, + x86.AFDIVRDP: {gc.SizeD | gc.LeftAddr | RightRdwr, 0, 0, 0}, + x86.AFDIVRF: {gc.SizeF | gc.LeftAddr | RightRdwr, 0, 0, 0}, + x86.AFDIVRD: {gc.SizeD | gc.LeftAddr | RightRdwr, 0, 0, 0}, + x86.AFXCHD: {gc.SizeD | LeftRdwr | RightRdwr, 0, 0, 0}, + x86.AFSUBD: {gc.SizeD | gc.LeftAddr | RightRdwr, 0, 0, 0}, + x86.AFSUBDP: {gc.SizeD | gc.LeftAddr | RightRdwr, 0, 0, 0}, + x86.AFSUBF: {gc.SizeF | gc.LeftAddr | RightRdwr, 0, 0, 0}, + x86.AFSUBRD: {gc.SizeD | gc.LeftAddr | RightRdwr, 0, 0, 0}, + x86.AFSUBRDP: {gc.SizeD | gc.LeftAddr | RightRdwr, 0, 0, 0}, + x86.AFSUBRF: {gc.SizeF | gc.LeftAddr | RightRdwr, 0, 0, 0}, + x86.AFMOVD: {gc.SizeD | gc.LeftAddr | gc.RightWrite, 0, 0, 0}, + x86.AFMOVF: {gc.SizeF | gc.LeftAddr | gc.RightWrite, 0, 0, 0}, + x86.AFMOVL: {gc.SizeL | gc.LeftAddr | gc.RightWrite, 0, 0, 0}, + x86.AFMOVW: {gc.SizeW | gc.LeftAddr | gc.RightWrite, 0, 0, 0}, + x86.AFMOVV: {gc.SizeQ | gc.LeftAddr | gc.RightWrite, 0, 0, 0}, + + // These instructions are marked as RightAddr + // so that the register optimizer does not try to replace the + // memory references with integer register references. + // But they do not use the previous value at the address, so + // we also mark them RightWrite. + x86.AFMOVDP: {gc.SizeD | gc.LeftRead | gc.RightWrite | gc.RightAddr, 0, 0, 0}, + x86.AFMOVFP: {gc.SizeF | gc.LeftRead | gc.RightWrite | gc.RightAddr, 0, 0, 0}, + x86.AFMOVLP: {gc.SizeL | gc.LeftRead | gc.RightWrite | gc.RightAddr, 0, 0, 0}, + x86.AFMOVWP: {gc.SizeW | gc.LeftRead | gc.RightWrite | gc.RightAddr, 0, 0, 0}, + x86.AFMOVVP: {gc.SizeQ | gc.LeftRead | gc.RightWrite | gc.RightAddr, 0, 0, 0}, + x86.AFMULD: {gc.SizeD | gc.LeftAddr | RightRdwr, 0, 0, 0}, + x86.AFMULDP: {gc.SizeD | gc.LeftAddr | RightRdwr, 0, 0, 0}, + x86.AFMULF: {gc.SizeF | gc.LeftAddr | RightRdwr, 0, 0, 0}, + x86.AIDIVB: {gc.SizeB | gc.LeftRead | gc.SetCarry, AX, AX, 0}, + x86.AIDIVL: {gc.SizeL | gc.LeftRead | gc.SetCarry, AX | DX, AX | DX, 0}, + x86.AIDIVW: {gc.SizeW | gc.LeftRead | gc.SetCarry, AX | DX, AX | DX, 0}, + x86.AIMULB: {gc.SizeB | gc.LeftRead | gc.SetCarry, AX, AX, 0}, + x86.AIMULL: {gc.SizeL | gc.LeftRead | gc.ImulAXDX | gc.SetCarry, 0, 0, 0}, + x86.AIMULW: {gc.SizeW | gc.LeftRead | gc.ImulAXDX | gc.SetCarry, 0, 0, 0}, + x86.AINCB: {gc.SizeB | RightRdwr, 0, 0, 0}, + x86.AINCL: {gc.SizeL | RightRdwr, 0, 0, 0}, + x86.AINCW: {gc.SizeW | RightRdwr, 0, 0, 0}, + x86.AJCC: {gc.Cjmp | gc.UseCarry, 0, 0, 0}, + x86.AJCS: {gc.Cjmp | gc.UseCarry, 0, 0, 0}, + x86.AJEQ: {gc.Cjmp | gc.UseCarry, 0, 0, 0}, + x86.AJGE: {gc.Cjmp | gc.UseCarry, 0, 0, 0}, + x86.AJGT: {gc.Cjmp | gc.UseCarry, 0, 0, 0}, + x86.AJHI: {gc.Cjmp | gc.UseCarry, 0, 0, 0}, + x86.AJLE: {gc.Cjmp | gc.UseCarry, 0, 0, 0}, + x86.AJLS: {gc.Cjmp | gc.UseCarry, 0, 0, 0}, + x86.AJLT: {gc.Cjmp | gc.UseCarry, 0, 0, 0}, + x86.AJMI: {gc.Cjmp | gc.UseCarry, 0, 0, 0}, + x86.AJNE: {gc.Cjmp | gc.UseCarry, 0, 0, 0}, + x86.AJOC: {gc.Cjmp | gc.UseCarry, 0, 0, 0}, + x86.AJOS: {gc.Cjmp | gc.UseCarry, 0, 0, 0}, + x86.AJPC: {gc.Cjmp | gc.UseCarry, 0, 0, 0}, + x86.AJPL: {gc.Cjmp | gc.UseCarry, 0, 0, 0}, + x86.AJPS: {gc.Cjmp | gc.UseCarry, 0, 0, 0}, + obj.AJMP: {gc.Jump | gc.Break | gc.KillCarry, 0, 0, 0}, + x86.ALEAL: {gc.LeftAddr | gc.RightWrite, 0, 0, 0}, + x86.AMOVBLSX: {gc.SizeL | gc.LeftRead | gc.RightWrite | gc.Conv, 0, 0, 0}, + x86.AMOVBLZX: {gc.SizeL | gc.LeftRead | gc.RightWrite | gc.Conv, 0, 0, 0}, + x86.AMOVBWSX: {gc.SizeW | gc.LeftRead | gc.RightWrite | gc.Conv, 0, 0, 0}, + x86.AMOVBWZX: {gc.SizeW | gc.LeftRead | gc.RightWrite | gc.Conv, 0, 0, 0}, + x86.AMOVWLSX: {gc.SizeL | gc.LeftRead | gc.RightWrite | gc.Conv, 0, 0, 0}, + x86.AMOVWLZX: {gc.SizeL | gc.LeftRead | gc.RightWrite | gc.Conv, 0, 0, 0}, + x86.AMOVB: {gc.SizeB | gc.LeftRead | gc.RightWrite | gc.Move, 0, 0, 0}, + x86.AMOVL: {gc.SizeL | gc.LeftRead | gc.RightWrite | gc.Move, 0, 0, 0}, + x86.AMOVW: {gc.SizeW | gc.LeftRead | gc.RightWrite | gc.Move, 0, 0, 0}, + x86.AMOVSB: {gc.OK, DI | SI, DI | SI, 0}, + x86.AMOVSL: {gc.OK, DI | SI, DI | SI, 0}, + x86.AMOVSW: {gc.OK, DI | SI, DI | SI, 0}, + obj.ADUFFCOPY: {gc.OK, DI | SI, DI | SI | CX, 0}, + x86.AMOVSD: {gc.SizeD | gc.LeftRead | gc.RightWrite | gc.Move, 0, 0, 0}, + x86.AMOVSS: {gc.SizeF | gc.LeftRead | gc.RightWrite | gc.Move, 0, 0, 0}, + + // We use MOVAPD as a faster synonym for MOVSD. + x86.AMOVAPD: {gc.SizeD | gc.LeftRead | gc.RightWrite | gc.Move, 0, 0, 0}, + x86.AMULB: {gc.SizeB | gc.LeftRead | gc.SetCarry, AX, AX, 0}, + x86.AMULL: {gc.SizeL | gc.LeftRead | gc.SetCarry, AX, AX | DX, 0}, + x86.AMULW: {gc.SizeW | gc.LeftRead | gc.SetCarry, AX, AX | DX, 0}, + x86.AMULSD: {gc.SizeD | gc.LeftRead | RightRdwr, 0, 0, 0}, + x86.AMULSS: {gc.SizeF | gc.LeftRead | RightRdwr, 0, 0, 0}, + x86.ANEGB: {gc.SizeB | RightRdwr | gc.SetCarry, 0, 0, 0}, + x86.ANEGL: {gc.SizeL | RightRdwr | gc.SetCarry, 0, 0, 0}, + x86.ANEGW: {gc.SizeW | RightRdwr | gc.SetCarry, 0, 0, 0}, + x86.ANOTB: {gc.SizeB | RightRdwr, 0, 0, 0}, + x86.ANOTL: {gc.SizeL | RightRdwr, 0, 0, 0}, + x86.ANOTW: {gc.SizeW | RightRdwr, 0, 0, 0}, + x86.AORB: {gc.SizeB | gc.LeftRead | RightRdwr | gc.SetCarry, 0, 0, 0}, + x86.AORL: {gc.SizeL | gc.LeftRead | RightRdwr | gc.SetCarry, 0, 0, 0}, + x86.AORW: {gc.SizeW | gc.LeftRead | RightRdwr | gc.SetCarry, 0, 0, 0}, + x86.APOPL: {gc.SizeL | gc.RightWrite, 0, 0, 0}, + x86.APUSHL: {gc.SizeL | gc.LeftRead, 0, 0, 0}, + x86.ARCLB: {gc.SizeB | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry | gc.UseCarry, 0, 0, 0}, + x86.ARCLL: {gc.SizeL | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry | gc.UseCarry, 0, 0, 0}, + x86.ARCLW: {gc.SizeW | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry | gc.UseCarry, 0, 0, 0}, + x86.ARCRB: {gc.SizeB | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry | gc.UseCarry, 0, 0, 0}, + x86.ARCRL: {gc.SizeL | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry | gc.UseCarry, 0, 0, 0}, + x86.ARCRW: {gc.SizeW | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry | gc.UseCarry, 0, 0, 0}, + x86.AREP: {gc.OK, CX, CX, 0}, + x86.AREPN: {gc.OK, CX, CX, 0}, + obj.ARET: {gc.Break | gc.KillCarry, 0, 0, 0}, + x86.AROLB: {gc.SizeB | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry, 0, 0, 0}, + x86.AROLL: {gc.SizeL | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry, 0, 0, 0}, + x86.AROLW: {gc.SizeW | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry, 0, 0, 0}, + x86.ARORB: {gc.SizeB | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry, 0, 0, 0}, + x86.ARORL: {gc.SizeL | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry, 0, 0, 0}, + x86.ARORW: {gc.SizeW | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry, 0, 0, 0}, + x86.ASAHF: {gc.OK, AX, AX, 0}, + x86.ASALB: {gc.SizeB | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry, 0, 0, 0}, + x86.ASALL: {gc.SizeL | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry, 0, 0, 0}, + x86.ASALW: {gc.SizeW | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry, 0, 0, 0}, + x86.ASARB: {gc.SizeB | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry, 0, 0, 0}, + x86.ASARL: {gc.SizeL | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry, 0, 0, 0}, + x86.ASARW: {gc.SizeW | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry, 0, 0, 0}, + x86.ASBBB: {gc.SizeB | gc.LeftRead | RightRdwr | gc.SetCarry | gc.UseCarry, 0, 0, 0}, + x86.ASBBL: {gc.SizeL | gc.LeftRead | RightRdwr | gc.SetCarry | gc.UseCarry, 0, 0, 0}, + x86.ASBBW: {gc.SizeW | gc.LeftRead | RightRdwr | gc.SetCarry | gc.UseCarry, 0, 0, 0}, + x86.ASETCC: {gc.SizeB | RightRdwr | gc.UseCarry, 0, 0, 0}, + x86.ASETCS: {gc.SizeB | RightRdwr | gc.UseCarry, 0, 0, 0}, + x86.ASETEQ: {gc.SizeB | RightRdwr | gc.UseCarry, 0, 0, 0}, + x86.ASETGE: {gc.SizeB | RightRdwr | gc.UseCarry, 0, 0, 0}, + x86.ASETGT: {gc.SizeB | RightRdwr | gc.UseCarry, 0, 0, 0}, + x86.ASETHI: {gc.SizeB | RightRdwr | gc.UseCarry, 0, 0, 0}, + x86.ASETLE: {gc.SizeB | RightRdwr | gc.UseCarry, 0, 0, 0}, + x86.ASETLS: {gc.SizeB | RightRdwr | gc.UseCarry, 0, 0, 0}, + x86.ASETLT: {gc.SizeB | RightRdwr | gc.UseCarry, 0, 0, 0}, + x86.ASETMI: {gc.SizeB | RightRdwr | gc.UseCarry, 0, 0, 0}, + x86.ASETNE: {gc.SizeB | RightRdwr | gc.UseCarry, 0, 0, 0}, + x86.ASETOC: {gc.SizeB | RightRdwr | gc.UseCarry, 0, 0, 0}, + x86.ASETOS: {gc.SizeB | RightRdwr | gc.UseCarry, 0, 0, 0}, + x86.ASETPC: {gc.SizeB | RightRdwr | gc.UseCarry, 0, 0, 0}, + x86.ASETPL: {gc.SizeB | RightRdwr | gc.UseCarry, 0, 0, 0}, + x86.ASETPS: {gc.SizeB | RightRdwr | gc.UseCarry, 0, 0, 0}, + x86.ASHLB: {gc.SizeB | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry, 0, 0, 0}, + x86.ASHLL: {gc.SizeL | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry, 0, 0, 0}, + x86.ASHLW: {gc.SizeW | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry, 0, 0, 0}, + x86.ASHRB: {gc.SizeB | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry, 0, 0, 0}, + x86.ASHRL: {gc.SizeL | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry, 0, 0, 0}, + x86.ASHRW: {gc.SizeW | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry, 0, 0, 0}, + x86.ASTOSB: {gc.OK, AX | DI, DI, 0}, + x86.ASTOSL: {gc.OK, AX | DI, DI, 0}, + x86.ASTOSW: {gc.OK, AX | DI, DI, 0}, + obj.ADUFFZERO: {gc.OK, AX | DI, DI, 0}, + x86.ASUBB: {gc.SizeB | gc.LeftRead | RightRdwr | gc.SetCarry, 0, 0, 0}, + x86.ASUBL: {gc.SizeL | gc.LeftRead | RightRdwr | gc.SetCarry, 0, 0, 0}, + x86.ASUBW: {gc.SizeW | gc.LeftRead | RightRdwr | gc.SetCarry, 0, 0, 0}, + x86.ASUBSD: {gc.SizeD | gc.LeftRead | RightRdwr, 0, 0, 0}, + x86.ASUBSS: {gc.SizeF | gc.LeftRead | RightRdwr, 0, 0, 0}, + x86.ATESTB: {gc.SizeB | gc.LeftRead | gc.RightRead | gc.SetCarry, 0, 0, 0}, + x86.ATESTL: {gc.SizeL | gc.LeftRead | gc.RightRead | gc.SetCarry, 0, 0, 0}, + x86.ATESTW: {gc.SizeW | gc.LeftRead | gc.RightRead | gc.SetCarry, 0, 0, 0}, + x86.AUCOMISD: {gc.SizeD | gc.LeftRead | gc.RightRead, 0, 0, 0}, + x86.AUCOMISS: {gc.SizeF | gc.LeftRead | gc.RightRead, 0, 0, 0}, + x86.AXCHGB: {gc.SizeB | LeftRdwr | RightRdwr, 0, 0, 0}, + x86.AXCHGL: {gc.SizeL | LeftRdwr | RightRdwr, 0, 0, 0}, + x86.AXCHGW: {gc.SizeW | LeftRdwr | RightRdwr, 0, 0, 0}, + x86.AXORB: {gc.SizeB | gc.LeftRead | RightRdwr | gc.SetCarry, 0, 0, 0}, + x86.AXORL: {gc.SizeL | gc.LeftRead | RightRdwr | gc.SetCarry, 0, 0, 0}, + x86.AXORW: {gc.SizeW | gc.LeftRead | RightRdwr | gc.SetCarry, 0, 0, 0}, +} + +func proginfo(p *obj.Prog) { + info := &p.Info + *info = progtable[p.As] + if info.Flags == 0 { + gc.Fatal("unknown instruction %v", p) + } + + if (info.Flags&gc.ShiftCX != 0) && p.From.Type != obj.TYPE_CONST { + info.Reguse |= CX + } + + if info.Flags&gc.ImulAXDX != 0 { + if p.To.Type == obj.TYPE_NONE { + info.Reguse |= AX + info.Regset |= AX | DX + } else { + info.Flags |= RightRdwr + } + } + + // Addressing makes some registers used. + if p.From.Type == obj.TYPE_MEM && p.From.Name == obj.NAME_NONE { + info.Regindex |= RtoB(int(p.From.Reg)) + } + if p.From.Index != x86.REG_NONE { + info.Regindex |= RtoB(int(p.From.Index)) + } + if p.To.Type == obj.TYPE_MEM && p.To.Name == obj.NAME_NONE { + info.Regindex |= RtoB(int(p.To.Reg)) + } + if p.To.Index != x86.REG_NONE { + info.Regindex |= RtoB(int(p.To.Index)) + } +} diff --git a/src/cmd/compile/internal/x86/reg.go b/src/cmd/compile/internal/x86/reg.go new file mode 100644 index 0000000000000000000000000000000000000000..b3a5fdf4e054385ba21412b74efdd7265ae42d93 --- /dev/null +++ b/src/cmd/compile/internal/x86/reg.go @@ -0,0 +1,110 @@ +// Derived from Inferno utils/6c/reg.c +// http://code.google.com/p/inferno-os/source/browse/utils/6c/reg.c +// +// Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved. +// Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net) +// Portions Copyright © 1997-1999 Vita Nuova Limited +// Portions Copyright © 2000-2007 Vita Nuova Holdings Limited (www.vitanuova.com) +// Portions Copyright © 2004,2006 Bruce Ellis +// Portions Copyright © 2005-2007 C H Forsyth (forsyth@terzarima.net) +// Revisions Copyright © 2000-2007 Lucent Technologies Inc. and others +// Portions Copyright © 2009 The Go Authors. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +package x86 + +import "cmd/internal/obj/x86" +import "cmd/compile/internal/gc" + +const ( + NREGVAR = 16 /* 8 integer + 8 floating */ +) + +var regname = []string{ + ".ax", + ".cx", + ".dx", + ".bx", + ".sp", + ".bp", + ".si", + ".di", + ".x0", + ".x1", + ".x2", + ".x3", + ".x4", + ".x5", + ".x6", + ".x7", +} + +func regnames(n *int) []string { + *n = NREGVAR + return regname +} + +func excludedregs() uint64 { + return RtoB(x86.REG_SP) +} + +func doregbits(r int) uint64 { + b := uint64(0) + if r >= x86.REG_AX && r <= x86.REG_DI { + b |= RtoB(r) + } else if r >= x86.REG_AL && r <= x86.REG_BL { + b |= RtoB(r - x86.REG_AL + x86.REG_AX) + } else if r >= x86.REG_AH && r <= x86.REG_BH { + b |= RtoB(r - x86.REG_AH + x86.REG_AX) + } else if r >= x86.REG_X0 && r <= x86.REG_X0+7 { + b |= FtoB(r) + } + return b +} + +func RtoB(r int) uint64 { + if r < x86.REG_AX || r > x86.REG_DI { + return 0 + } + return 1 << uint(r-x86.REG_AX) +} + +func BtoR(b uint64) int { + b &= 0xff + if b == 0 { + return 0 + } + return gc.Bitno(b) + x86.REG_AX +} + +func FtoB(f int) uint64 { + if f < x86.REG_X0 || f > x86.REG_X7 { + return 0 + } + return 1 << uint(f-x86.REG_X0+8) +} + +func BtoF(b uint64) int { + b &= 0xFF00 + if b == 0 { + return 0 + } + return gc.Bitno(b) - 8 + x86.REG_X0 +} diff --git a/src/cmd/compile/main.go b/src/cmd/compile/main.go new file mode 100644 index 0000000000000000000000000000000000000000..7b69c344240e0b1161f291f56ef5f42bb3ecfbca --- /dev/null +++ b/src/cmd/compile/main.go @@ -0,0 +1,34 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +import ( + "cmd/compile/internal/amd64" + "cmd/compile/internal/arm" + "cmd/compile/internal/arm64" + "cmd/compile/internal/ppc64" + "cmd/compile/internal/x86" + "cmd/internal/obj" + "fmt" + "os" +) + +func main() { + switch obj.Getgoarch() { + default: + fmt.Fprintf(os.Stderr, "compile: unknown architecture %q\n", obj.Getgoarch()) + os.Exit(2) + case "386": + x86.Main() + case "amd64", "amd64p32": + amd64.Main() + case "arm": + arm.Main() + case "arm64": + arm64.Main() + case "ppc64", "ppc64le": + ppc64.Main() + } +} diff --git a/src/cmd/cover/cover.go b/src/cmd/cover/cover.go new file mode 100644 index 0000000000000000000000000000000000000000..31ec43454695b1f0fa9f088b012bdd8d14307cb5 --- /dev/null +++ b/src/cmd/cover/cover.go @@ -0,0 +1,722 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +import ( + "bytes" + "flag" + "fmt" + "go/ast" + "go/parser" + "go/printer" + "go/token" + "io" + "io/ioutil" + "log" + "os" + "path/filepath" + "sort" + "strconv" + "strings" +) + +const usageMessage = "" + + `Usage of 'go tool cover': +Given a coverage profile produced by 'go test': + go test -coverprofile=c.out + +Open a web browser displaying annotated source code: + go tool cover -html=c.out + +Write out an HTML file instead of launching a web browser: + go tool cover -html=c.out -o coverage.html + +Display coverage percentages to stdout for each function: + go tool cover -func=c.out + +Finally, to generate modified source code with coverage annotations +(what go test -cover does): + go tool cover -mode=set -var=CoverageVariableName program.go +` + +func usage() { + fmt.Fprintln(os.Stderr, usageMessage) + fmt.Fprintln(os.Stderr, "Flags:") + flag.PrintDefaults() + fmt.Fprintln(os.Stderr, "\n Only one of -html, -func, or -mode may be set.") + os.Exit(2) +} + +var ( + mode = flag.String("mode", "", "coverage mode: set, count, atomic") + varVar = flag.String("var", "GoCover", "name of coverage variable to generate") + output = flag.String("o", "", "file for output; default: stdout") + htmlOut = flag.String("html", "", "generate HTML representation of coverage profile") + funcOut = flag.String("func", "", "output coverage profile information for each function") +) + +var profile string // The profile to read; the value of -html or -func + +var counterStmt func(*File, ast.Expr) ast.Stmt + +const ( + atomicPackagePath = "sync/atomic" + atomicPackageName = "_cover_atomic_" +) + +func main() { + flag.Usage = usage + flag.Parse() + + // Usage information when no arguments. + if flag.NFlag() == 0 && flag.NArg() == 0 { + flag.Usage() + } + + err := parseFlags() + if err != nil { + fmt.Fprintln(os.Stderr, err) + fmt.Fprintln(os.Stderr, `For usage information, run "go tool cover -help"`) + os.Exit(2) + } + + // Generate coverage-annotated source. + if *mode != "" { + annotate(flag.Arg(0)) + return + } + + // Output HTML or function coverage information. + if *htmlOut != "" { + err = htmlOutput(profile, *output) + } else { + err = funcOutput(profile, *output) + } + + if err != nil { + fmt.Fprintf(os.Stderr, "cover: %v\n", err) + os.Exit(2) + } +} + +// parseFlags sets the profile and counterStmt globals and performs validations. +func parseFlags() error { + profile = *htmlOut + if *funcOut != "" { + if profile != "" { + return fmt.Errorf("too many options") + } + profile = *funcOut + } + + // Must either display a profile or rewrite Go source. + if (profile == "") == (*mode == "") { + return fmt.Errorf("too many options") + } + + if *mode != "" { + switch *mode { + case "set": + counterStmt = setCounterStmt + case "count": + counterStmt = incCounterStmt + case "atomic": + counterStmt = atomicCounterStmt + default: + return fmt.Errorf("unknown -mode %v", *mode) + } + + if flag.NArg() == 0 { + return fmt.Errorf("missing source file") + } else if flag.NArg() == 1 { + return nil + } + } else if flag.NArg() == 0 { + return nil + } + return fmt.Errorf("too many arguments") +} + +// Block represents the information about a basic block to be recorded in the analysis. +// Note: Our definition of basic block is based on control structures; we don't break +// apart && and ||. We could but it doesn't seem important enough to bother. +type Block struct { + startByte token.Pos + endByte token.Pos + numStmt int +} + +// File is a wrapper for the state of a file used in the parser. +// The basic parse tree walker is a method of this type. +type File struct { + fset *token.FileSet + name string // Name of file. + astFile *ast.File + blocks []Block + atomicPkg string // Package name for "sync/atomic" in this file. +} + +// Visit implements the ast.Visitor interface. +func (f *File) Visit(node ast.Node) ast.Visitor { + switch n := node.(type) { + case *ast.BlockStmt: + // If it's a switch or select, the body is a list of case clauses; don't tag the block itself. + if len(n.List) > 0 { + switch n.List[0].(type) { + case *ast.CaseClause: // switch + for _, n := range n.List { + clause := n.(*ast.CaseClause) + clause.Body = f.addCounters(clause.Pos(), clause.End(), clause.Body, false) + } + return f + case *ast.CommClause: // select + for _, n := range n.List { + clause := n.(*ast.CommClause) + clause.Body = f.addCounters(clause.Pos(), clause.End(), clause.Body, false) + } + return f + } + } + n.List = f.addCounters(n.Lbrace, n.Rbrace+1, n.List, true) // +1 to step past closing brace. + case *ast.IfStmt: + ast.Walk(f, n.Body) + if n.Else == nil { + return nil + } + // The elses are special, because if we have + // if x { + // } else if y { + // } + // we want to cover the "if y". To do this, we need a place to drop the counter, + // so we add a hidden block: + // if x { + // } else { + // if y { + // } + // } + switch stmt := n.Else.(type) { + case *ast.IfStmt: + block := &ast.BlockStmt{ + Lbrace: n.Body.End(), // Start at end of the "if" block so the covered part looks like it starts at the "else". + List: []ast.Stmt{stmt}, + Rbrace: stmt.End(), + } + n.Else = block + case *ast.BlockStmt: + stmt.Lbrace = n.Body.End() // Start at end of the "if" block so the covered part looks like it starts at the "else". + default: + panic("unexpected node type in if") + } + ast.Walk(f, n.Else) + return nil + case *ast.SelectStmt: + // Don't annotate an empty select - creates a syntax error. + if n.Body == nil || len(n.Body.List) == 0 { + return nil + } + case *ast.SwitchStmt: + // Don't annotate an empty switch - creates a syntax error. + if n.Body == nil || len(n.Body.List) == 0 { + return nil + } + case *ast.TypeSwitchStmt: + // Don't annotate an empty type switch - creates a syntax error. + if n.Body == nil || len(n.Body.List) == 0 { + return nil + } + } + return f +} + +// unquote returns the unquoted string. +func unquote(s string) string { + t, err := strconv.Unquote(s) + if err != nil { + log.Fatalf("cover: improperly quoted string %q\n", s) + } + return t +} + +// addImport adds an import for the specified path, if one does not already exist, and returns +// the local package name. +func (f *File) addImport(path string) string { + // Does the package already import it? + for _, s := range f.astFile.Imports { + if unquote(s.Path.Value) == path { + if s.Name != nil { + return s.Name.Name + } + return filepath.Base(path) + } + } + newImport := &ast.ImportSpec{ + Name: ast.NewIdent(atomicPackageName), + Path: &ast.BasicLit{ + Kind: token.STRING, + Value: fmt.Sprintf("%q", path), + }, + } + impDecl := &ast.GenDecl{ + Tok: token.IMPORT, + Specs: []ast.Spec{ + newImport, + }, + } + // Make the new import the first Decl in the file. + astFile := f.astFile + astFile.Decls = append(astFile.Decls, nil) + copy(astFile.Decls[1:], astFile.Decls[0:]) + astFile.Decls[0] = impDecl + astFile.Imports = append(astFile.Imports, newImport) + + // Now refer to the package, just in case it ends up unused. + // That is, append to the end of the file the declaration + // var _ = _cover_atomic_.AddUint32 + reference := &ast.GenDecl{ + Tok: token.VAR, + Specs: []ast.Spec{ + &ast.ValueSpec{ + Names: []*ast.Ident{ + ast.NewIdent("_"), + }, + Values: []ast.Expr{ + &ast.SelectorExpr{ + X: ast.NewIdent(atomicPackageName), + Sel: ast.NewIdent("AddUint32"), + }, + }, + }, + }, + } + astFile.Decls = append(astFile.Decls, reference) + return atomicPackageName +} + +var slashslash = []byte("//") + +// initialComments returns the prefix of content containing only +// whitespace and line comments. Any +build directives must appear +// within this region. This approach is more reliable than using +// go/printer to print a modified AST containing comments. +// +func initialComments(content []byte) []byte { + // Derived from go/build.Context.shouldBuild. + end := 0 + p := content + for len(p) > 0 { + line := p + if i := bytes.IndexByte(line, '\n'); i >= 0 { + line, p = line[:i], p[i+1:] + } else { + p = p[len(p):] + } + line = bytes.TrimSpace(line) + if len(line) == 0 { // Blank line. + end = len(content) - len(p) + continue + } + if !bytes.HasPrefix(line, slashslash) { // Not comment line. + break + } + } + return content[:end] +} + +func annotate(name string) { + fset := token.NewFileSet() + content, err := ioutil.ReadFile(name) + if err != nil { + log.Fatalf("cover: %s: %s", name, err) + } + parsedFile, err := parser.ParseFile(fset, name, content, parser.ParseComments) + if err != nil { + log.Fatalf("cover: %s: %s", name, err) + } + parsedFile.Comments = trimComments(parsedFile, fset) + + file := &File{ + fset: fset, + name: name, + astFile: parsedFile, + } + if *mode == "atomic" { + file.atomicPkg = file.addImport(atomicPackagePath) + } + ast.Walk(file, file.astFile) + fd := os.Stdout + if *output != "" { + var err error + fd, err = os.Create(*output) + if err != nil { + log.Fatalf("cover: %s", err) + } + } + fd.Write(initialComments(content)) // Retain '// +build' directives. + file.print(fd) + // After printing the source tree, add some declarations for the counters etc. + // We could do this by adding to the tree, but it's easier just to print the text. + file.addVariables(fd) +} + +// trimComments drops all but the //go: comments, some of which are semantically important. +// We drop all others because they can appear in places that cause our counters +// to appear in syntactically incorrect places. //go: appears at the beginning of +// the line and is syntactically safe. +func trimComments(file *ast.File, fset *token.FileSet) []*ast.CommentGroup { + var comments []*ast.CommentGroup + for _, group := range file.Comments { + var list []*ast.Comment + for _, comment := range group.List { + if strings.HasPrefix(comment.Text, "//go:") && fset.Position(comment.Slash).Column == 1 { + list = append(list, comment) + } + } + if list != nil { + comments = append(comments, &ast.CommentGroup{list}) + } + } + return comments +} + +func (f *File) print(w io.Writer) { + printer.Fprint(w, f.fset, f.astFile) +} + +// intLiteral returns an ast.BasicLit representing the integer value. +func (f *File) intLiteral(i int) *ast.BasicLit { + node := &ast.BasicLit{ + Kind: token.INT, + Value: fmt.Sprint(i), + } + return node +} + +// index returns an ast.BasicLit representing the number of counters present. +func (f *File) index() *ast.BasicLit { + return f.intLiteral(len(f.blocks)) +} + +// setCounterStmt returns the expression: __count[23] = 1. +func setCounterStmt(f *File, counter ast.Expr) ast.Stmt { + return &ast.AssignStmt{ + Lhs: []ast.Expr{counter}, + Tok: token.ASSIGN, + Rhs: []ast.Expr{f.intLiteral(1)}, + } +} + +// incCounterStmt returns the expression: __count[23]++. +func incCounterStmt(f *File, counter ast.Expr) ast.Stmt { + return &ast.IncDecStmt{ + X: counter, + Tok: token.INC, + } +} + +// atomicCounterStmt returns the expression: atomic.AddUint32(&__count[23], 1) +func atomicCounterStmt(f *File, counter ast.Expr) ast.Stmt { + return &ast.ExprStmt{ + X: &ast.CallExpr{ + Fun: &ast.SelectorExpr{ + X: ast.NewIdent(f.atomicPkg), + Sel: ast.NewIdent("AddUint32"), + }, + Args: []ast.Expr{&ast.UnaryExpr{ + Op: token.AND, + X: counter, + }, + f.intLiteral(1), + }, + }, + } +} + +// newCounter creates a new counter expression of the appropriate form. +func (f *File) newCounter(start, end token.Pos, numStmt int) ast.Stmt { + counter := &ast.IndexExpr{ + X: &ast.SelectorExpr{ + X: ast.NewIdent(*varVar), + Sel: ast.NewIdent("Count"), + }, + Index: f.index(), + } + stmt := counterStmt(f, counter) + f.blocks = append(f.blocks, Block{start, end, numStmt}) + return stmt +} + +// addCounters takes a list of statements and adds counters to the beginning of +// each basic block at the top level of that list. For instance, given +// +// S1 +// if cond { +// S2 +// } +// S3 +// +// counters will be added before S1 and before S3. The block containing S2 +// will be visited in a separate call. +// TODO: Nested simple blocks get unnecessary (but correct) counters +func (f *File) addCounters(pos, blockEnd token.Pos, list []ast.Stmt, extendToClosingBrace bool) []ast.Stmt { + // Special case: make sure we add a counter to an empty block. Can't do this below + // or we will add a counter to an empty statement list after, say, a return statement. + if len(list) == 0 { + return []ast.Stmt{f.newCounter(pos, blockEnd, 0)} + } + // We have a block (statement list), but it may have several basic blocks due to the + // appearance of statements that affect the flow of control. + var newList []ast.Stmt + for { + // Find first statement that affects flow of control (break, continue, if, etc.). + // It will be the last statement of this basic block. + var last int + end := blockEnd + for last = 0; last < len(list); last++ { + end = f.statementBoundary(list[last]) + if f.endsBasicSourceBlock(list[last]) { + extendToClosingBrace = false // Block is broken up now. + last++ + break + } + } + if extendToClosingBrace { + end = blockEnd + } + if pos != end { // Can have no source to cover if e.g. blocks abut. + newList = append(newList, f.newCounter(pos, end, last)) + } + newList = append(newList, list[0:last]...) + list = list[last:] + if len(list) == 0 { + break + } + pos = list[0].Pos() + } + return newList +} + +// hasFuncLiteral reports the existence and position of the first func literal +// in the node, if any. If a func literal appears, it usually marks the termination +// of a basic block because the function body is itself a block. +// Therefore we draw a line at the start of the body of the first function literal we find. +// TODO: what if there's more than one? Probably doesn't matter much. +func hasFuncLiteral(n ast.Node) (bool, token.Pos) { + if n == nil { + return false, 0 + } + var literal funcLitFinder + ast.Walk(&literal, n) + return literal.found(), token.Pos(literal) +} + +// statementBoundary finds the location in s that terminates the current basic +// block in the source. +func (f *File) statementBoundary(s ast.Stmt) token.Pos { + // Control flow statements are easy. + switch s := s.(type) { + case *ast.BlockStmt: + // Treat blocks like basic blocks to avoid overlapping counters. + return s.Lbrace + case *ast.IfStmt: + found, pos := hasFuncLiteral(s.Init) + if found { + return pos + } + found, pos = hasFuncLiteral(s.Cond) + if found { + return pos + } + return s.Body.Lbrace + case *ast.ForStmt: + found, pos := hasFuncLiteral(s.Init) + if found { + return pos + } + found, pos = hasFuncLiteral(s.Cond) + if found { + return pos + } + found, pos = hasFuncLiteral(s.Post) + if found { + return pos + } + return s.Body.Lbrace + case *ast.LabeledStmt: + return f.statementBoundary(s.Stmt) + case *ast.RangeStmt: + found, pos := hasFuncLiteral(s.X) + if found { + return pos + } + return s.Body.Lbrace + case *ast.SwitchStmt: + found, pos := hasFuncLiteral(s.Init) + if found { + return pos + } + found, pos = hasFuncLiteral(s.Tag) + if found { + return pos + } + return s.Body.Lbrace + case *ast.SelectStmt: + return s.Body.Lbrace + case *ast.TypeSwitchStmt: + found, pos := hasFuncLiteral(s.Init) + if found { + return pos + } + return s.Body.Lbrace + } + // If not a control flow statement, it is a declaration, expression, call, etc. and it may have a function literal. + // If it does, that's tricky because we want to exclude the body of the function from this block. + // Draw a line at the start of the body of the first function literal we find. + // TODO: what if there's more than one? Probably doesn't matter much. + found, pos := hasFuncLiteral(s) + if found { + return pos + } + return s.End() +} + +// endsBasicSourceBlock reports whether s changes the flow of control: break, if, etc., +// or if it's just problematic, for instance contains a function literal, which will complicate +// accounting due to the block-within-an expression. +func (f *File) endsBasicSourceBlock(s ast.Stmt) bool { + switch s := s.(type) { + case *ast.BlockStmt: + // Treat blocks like basic blocks to avoid overlapping counters. + return true + case *ast.BranchStmt: + return true + case *ast.ForStmt: + return true + case *ast.IfStmt: + return true + case *ast.LabeledStmt: + return f.endsBasicSourceBlock(s.Stmt) + case *ast.RangeStmt: + return true + case *ast.SwitchStmt: + return true + case *ast.SelectStmt: + return true + case *ast.TypeSwitchStmt: + return true + case *ast.ExprStmt: + // Calls to panic change the flow. + // We really should verify that "panic" is the predefined function, + // but without type checking we can't and the likelihood of it being + // an actual problem is vanishingly small. + if call, ok := s.X.(*ast.CallExpr); ok { + if ident, ok := call.Fun.(*ast.Ident); ok && ident.Name == "panic" && len(call.Args) == 1 { + return true + } + } + } + found, _ := hasFuncLiteral(s) + return found +} + +// funcLitFinder implements the ast.Visitor pattern to find the location of any +// function literal in a subtree. +type funcLitFinder token.Pos + +func (f *funcLitFinder) Visit(node ast.Node) (w ast.Visitor) { + if f.found() { + return nil // Prune search. + } + switch n := node.(type) { + case *ast.FuncLit: + *f = funcLitFinder(n.Body.Lbrace) + return nil // Prune search. + } + return f +} + +func (f *funcLitFinder) found() bool { + return token.Pos(*f) != token.NoPos +} + +// Sort interface for []block1; used for self-check in addVariables. + +type block1 struct { + Block + index int +} + +type blockSlice []block1 + +func (b blockSlice) Len() int { return len(b) } +func (b blockSlice) Less(i, j int) bool { return b[i].startByte < b[j].startByte } +func (b blockSlice) Swap(i, j int) { b[i], b[j] = b[j], b[i] } + +// offset translates a token position into a 0-indexed byte offset. +func (f *File) offset(pos token.Pos) int { + return f.fset.Position(pos).Offset +} + +// addVariables adds to the end of the file the declarations to set up the counter and position variables. +func (f *File) addVariables(w io.Writer) { + // Self-check: Verify that the instrumented basic blocks are disjoint. + t := make([]block1, len(f.blocks)) + for i := range f.blocks { + t[i].Block = f.blocks[i] + t[i].index = i + } + sort.Sort(blockSlice(t)) + for i := 1; i < len(t); i++ { + if t[i-1].endByte > t[i].startByte { + fmt.Fprintf(os.Stderr, "cover: internal error: block %d overlaps block %d\n", t[i-1].index, t[i].index) + // Note: error message is in byte positions, not token positions. + fmt.Fprintf(os.Stderr, "\t%s:#%d,#%d %s:#%d,#%d\n", + f.name, f.offset(t[i-1].startByte), f.offset(t[i-1].endByte), + f.name, f.offset(t[i].startByte), f.offset(t[i].endByte)) + } + } + + // Declare the coverage struct as a package-level variable. + fmt.Fprintf(w, "\nvar %s = struct {\n", *varVar) + fmt.Fprintf(w, "\tCount [%d]uint32\n", len(f.blocks)) + fmt.Fprintf(w, "\tPos [3 * %d]uint32\n", len(f.blocks)) + fmt.Fprintf(w, "\tNumStmt [%d]uint16\n", len(f.blocks)) + fmt.Fprintf(w, "} {\n") + + // Initialize the position array field. + fmt.Fprintf(w, "\tPos: [3 * %d]uint32{\n", len(f.blocks)) + + // A nice long list of positions. Each position is encoded as follows to reduce size: + // - 32-bit starting line number + // - 32-bit ending line number + // - (16 bit ending column number << 16) | (16-bit starting column number). + for i, block := range f.blocks { + start := f.fset.Position(block.startByte) + end := f.fset.Position(block.endByte) + fmt.Fprintf(w, "\t\t%d, %d, %#x, // [%d]\n", start.Line, end.Line, (end.Column&0xFFFF)<<16|(start.Column&0xFFFF), i) + } + + // Close the position array. + fmt.Fprintf(w, "\t},\n") + + // Initialize the position array field. + fmt.Fprintf(w, "\tNumStmt: [%d]uint16{\n", len(f.blocks)) + + // A nice long list of statements-per-block, so we can give a conventional + // valuation of "percent covered". To save space, it's a 16-bit number, so we + // clamp it if it overflows - won't matter in practice. + for i, block := range f.blocks { + n := block.numStmt + if n > 1<<16-1 { + n = 1<<16 - 1 + } + fmt.Fprintf(w, "\t\t%d, // %d\n", n, i) + } + + // Close the statements-per-block array. + fmt.Fprintf(w, "\t},\n") + + // Close the struct initialization. + fmt.Fprintf(w, "}\n") +} diff --git a/src/cmd/cover/cover_test.go b/src/cmd/cover/cover_test.go new file mode 100644 index 0000000000000000000000000000000000000000..f01f138cd0232c0636df8f7c61710561ed8cc908 --- /dev/null +++ b/src/cmd/cover/cover_test.go @@ -0,0 +1,92 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main_test + +import ( + "bytes" + "fmt" + "internal/testenv" + "io/ioutil" + "os" + "os/exec" + "path/filepath" + "testing" +) + +const ( + // Data directory, also the package directory for the test. + testdata = "testdata" + + // Binaries we compile. + testcover = "./testcover.exe" +) + +var ( + // Files we use. + testMain = filepath.Join(testdata, "main.go") + testTest = filepath.Join(testdata, "test.go") + coverInput = filepath.Join(testdata, "test_line.go") + coverOutput = filepath.Join(testdata, "test_cover.go") +) + +var debug = false // Keeps the rewritten files around if set. + +// Run this shell script, but do it in Go so it can be run by "go test". +// +// replace the word LINE with the line number < testdata/test.go > testdata/test_line.go +// go build -o ./testcover +// ./testcover -mode=count -var=CoverTest -o ./testdata/test_cover.go testdata/test_line.go +// go run ./testdata/main.go ./testdata/test.go +// +func TestCover(t *testing.T) { + testenv.MustHaveGoBuild(t) + + // Read in the test file (testTest) and write it, with LINEs specified, to coverInput. + file, err := ioutil.ReadFile(testTest) + if err != nil { + t.Fatal(err) + } + lines := bytes.Split(file, []byte("\n")) + for i, line := range lines { + lines[i] = bytes.Replace(line, []byte("LINE"), []byte(fmt.Sprint(i+1)), -1) + } + if err := ioutil.WriteFile(coverInput, bytes.Join(lines, []byte("\n")), 0666); err != nil { + t.Fatal(err) + } + + // defer removal of test_line.go + if !debug { + defer os.Remove(coverInput) + } + + // go build -o testcover + cmd := exec.Command("go", "build", "-o", testcover) + run(cmd, t) + + // defer removal of testcover + defer os.Remove(testcover) + + // ./testcover -mode=count -var=coverTest -o ./testdata/test_cover.go testdata/test_line.go + cmd = exec.Command(testcover, "-mode=count", "-var=coverTest", "-o", coverOutput, coverInput) + run(cmd, t) + + // defer removal of ./testdata/test_cover.go + if !debug { + defer os.Remove(coverOutput) + } + + // go run ./testdata/main.go ./testdata/test.go + cmd = exec.Command("go", "run", testMain, coverOutput) + run(cmd, t) +} + +func run(c *exec.Cmd, t *testing.T) { + c.Stdout = os.Stdout + c.Stderr = os.Stderr + err := c.Run() + if err != nil { + t.Fatal(err) + } +} diff --git a/src/cmd/cover/doc.go b/src/cmd/cover/doc.go new file mode 100644 index 0000000000000000000000000000000000000000..636d7e08d9ac9026a0163f6dd17130db10802193 --- /dev/null +++ b/src/cmd/cover/doc.go @@ -0,0 +1,21 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +/* +Cover is a program for analyzing the coverage profiles generated by +'go test -coverprofile=cover.out'. + +Cover is also used by 'go test -cover' to rewrite the source code with +annotations to track which parts of each function are executed. +It operates on one Go source file at a time, computing approximate +basic block information by studying the source. It is thus more portable +than binary-rewriting coverage tools, but also a little less capable. +For instance, it does not probe inside && and || expressions, and can +be mildly confused by single statements with multiple function literals. + +For usage information, please see: + go help testflag + go tool cover -help +*/ +package main diff --git a/src/cmd/cover/func.go b/src/cmd/cover/func.go new file mode 100644 index 0000000000000000000000000000000000000000..66ec242a402a9505822c143213bbd45b4b26bbb7 --- /dev/null +++ b/src/cmd/cover/func.go @@ -0,0 +1,164 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// This file implements the visitor that computes the (line, column)-(line-column) range for each function. + +package main + +import ( + "bufio" + "fmt" + "go/ast" + "go/build" + "go/parser" + "go/token" + "os" + "path/filepath" + "text/tabwriter" +) + +// funcOutput takes two file names as arguments, a coverage profile to read as input and an output +// file to write ("" means to write to standard output). The function reads the profile and produces +// as output the coverage data broken down by function, like this: +// +// fmt/format.go:30: init 100.0% +// fmt/format.go:57: clearflags 100.0% +// ... +// fmt/scan.go:1046: doScan 100.0% +// fmt/scan.go:1075: advance 96.2% +// fmt/scan.go:1119: doScanf 96.8% +// total: (statements) 91.9% + +func funcOutput(profile, outputFile string) error { + profiles, err := ParseProfiles(profile) + if err != nil { + return err + } + + var out *bufio.Writer + if outputFile == "" { + out = bufio.NewWriter(os.Stdout) + } else { + fd, err := os.Create(outputFile) + if err != nil { + return err + } + defer fd.Close() + out = bufio.NewWriter(fd) + } + defer out.Flush() + + tabber := tabwriter.NewWriter(out, 1, 8, 1, '\t', 0) + defer tabber.Flush() + + var total, covered int64 + for _, profile := range profiles { + fn := profile.FileName + file, err := findFile(fn) + if err != nil { + return err + } + funcs, err := findFuncs(file) + if err != nil { + return err + } + // Now match up functions and profile blocks. + for _, f := range funcs { + c, t := f.coverage(profile) + fmt.Fprintf(tabber, "%s:%d:\t%s\t%.1f%%\n", fn, f.startLine, f.name, 100.0*float64(c)/float64(t)) + total += t + covered += c + } + } + fmt.Fprintf(tabber, "total:\t(statements)\t%.1f%%\n", 100.0*float64(covered)/float64(total)) + + return nil +} + +// findFuncs parses the file and returns a slice of FuncExtent descriptors. +func findFuncs(name string) ([]*FuncExtent, error) { + fset := token.NewFileSet() + parsedFile, err := parser.ParseFile(fset, name, nil, 0) + if err != nil { + return nil, err + } + visitor := &FuncVisitor{ + fset: fset, + name: name, + astFile: parsedFile, + } + ast.Walk(visitor, visitor.astFile) + return visitor.funcs, nil +} + +// FuncExtent describes a function's extent in the source by file and position. +type FuncExtent struct { + name string + startLine int + startCol int + endLine int + endCol int +} + +// FuncVisitor implements the visitor that builds the function position list for a file. +type FuncVisitor struct { + fset *token.FileSet + name string // Name of file. + astFile *ast.File + funcs []*FuncExtent +} + +// Visit implements the ast.Visitor interface. +func (v *FuncVisitor) Visit(node ast.Node) ast.Visitor { + switch n := node.(type) { + case *ast.FuncDecl: + start := v.fset.Position(n.Pos()) + end := v.fset.Position(n.End()) + fe := &FuncExtent{ + name: n.Name.Name, + startLine: start.Line, + startCol: start.Column, + endLine: end.Line, + endCol: end.Column, + } + v.funcs = append(v.funcs, fe) + } + return v +} + +// coverage returns the fraction of the statements in the function that were covered, as a numerator and denominator. +func (f *FuncExtent) coverage(profile *Profile) (num, den int64) { + // We could avoid making this n^2 overall by doing a single scan and annotating the functions, + // but the sizes of the data structures is never very large and the scan is almost instantaneous. + var covered, total int64 + // The blocks are sorted, so we can stop counting as soon as we reach the end of the relevant block. + for _, b := range profile.Blocks { + if b.StartLine > f.endLine || (b.StartLine == f.endLine && b.StartCol >= f.endCol) { + // Past the end of the function. + break + } + if b.EndLine < f.startLine || (b.EndLine == f.startLine && b.EndCol <= f.startCol) { + // Before the beginning of the function + continue + } + total += int64(b.NumStmt) + if b.Count > 0 { + covered += int64(b.NumStmt) + } + } + if total == 0 { + total = 1 // Avoid zero denominator. + } + return covered, total +} + +// findFile finds the location of the named file in GOROOT, GOPATH etc. +func findFile(file string) (string, error) { + dir, file := filepath.Split(file) + pkg, err := build.Import(dir, ".", build.FindOnly) + if err != nil { + return "", fmt.Errorf("can't find %q: %v", file, err) + } + return filepath.Join(pkg.Dir, file), nil +} diff --git a/src/cmd/cover/html.go b/src/cmd/cover/html.go new file mode 100644 index 0000000000000000000000000000000000000000..bb0a495ae7214acc3f8734f6b2d3a9df1f5bf3fa --- /dev/null +++ b/src/cmd/cover/html.go @@ -0,0 +1,279 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +import ( + "bufio" + "bytes" + "fmt" + "html/template" + "io" + "io/ioutil" + "math" + "os" + "os/exec" + "path/filepath" + "runtime" +) + +// htmlOutput reads the profile data from profile and generates an HTML +// coverage report, writing it to outfile. If outfile is empty, +// it writes the report to a temporary file and opens it in a web browser. +func htmlOutput(profile, outfile string) error { + profiles, err := ParseProfiles(profile) + if err != nil { + return err + } + + var d templateData + + for _, profile := range profiles { + fn := profile.FileName + if profile.Mode == "set" { + d.Set = true + } + file, err := findFile(fn) + if err != nil { + return err + } + src, err := ioutil.ReadFile(file) + if err != nil { + return fmt.Errorf("can't read %q: %v", fn, err) + } + var buf bytes.Buffer + err = htmlGen(&buf, src, profile.Boundaries(src)) + if err != nil { + return err + } + d.Files = append(d.Files, &templateFile{ + Name: fn, + Body: template.HTML(buf.String()), + Coverage: percentCovered(profile), + }) + } + + var out *os.File + if outfile == "" { + var dir string + dir, err = ioutil.TempDir("", "cover") + if err != nil { + return err + } + out, err = os.Create(filepath.Join(dir, "coverage.html")) + } else { + out, err = os.Create(outfile) + } + err = htmlTemplate.Execute(out, d) + if err == nil { + err = out.Close() + } + if err != nil { + return err + } + + if outfile == "" { + if !startBrowser("file://" + out.Name()) { + fmt.Fprintf(os.Stderr, "HTML output written to %s\n", out.Name()) + } + } + + return nil +} + +// percentCovered returns, as a percentage, the fraction of the statements in +// the profile covered by the test run. +// In effect, it reports the coverage of a given source file. +func percentCovered(p *Profile) float64 { + var total, covered int64 + for _, b := range p.Blocks { + total += int64(b.NumStmt) + if b.Count > 0 { + covered += int64(b.NumStmt) + } + } + if total == 0 { + return 0 + } + return float64(covered) / float64(total) * 100 +} + +// htmlGen generates an HTML coverage report with the provided filename, +// source code, and tokens, and writes it to the given Writer. +func htmlGen(w io.Writer, src []byte, boundaries []Boundary) error { + dst := bufio.NewWriter(w) + for i := range src { + for len(boundaries) > 0 && boundaries[0].Offset == i { + b := boundaries[0] + if b.Start { + n := 0 + if b.Count > 0 { + n = int(math.Floor(b.Norm*9)) + 1 + } + fmt.Fprintf(dst, ``, n, b.Count) + } else { + dst.WriteString("") + } + boundaries = boundaries[1:] + } + switch b := src[i]; b { + case '>': + dst.WriteString(">") + case '<': + dst.WriteString("<") + case '&': + dst.WriteString("&") + case '\t': + dst.WriteString(" ") + default: + dst.WriteByte(b) + } + } + return dst.Flush() +} + +// startBrowser tries to open the URL in a browser +// and reports whether it succeeds. +func startBrowser(url string) bool { + // try to start the browser + var args []string + switch runtime.GOOS { + case "darwin": + args = []string{"open"} + case "windows": + args = []string{"cmd", "/c", "start"} + default: + args = []string{"xdg-open"} + } + cmd := exec.Command(args[0], append(args[1:], url)...) + return cmd.Start() == nil +} + +// rgb returns an rgb value for the specified coverage value +// between 0 (no coverage) and 10 (max coverage). +func rgb(n int) string { + if n == 0 { + return "rgb(192, 0, 0)" // Red + } + // Gradient from gray to green. + r := 128 - 12*(n-1) + g := 128 + 12*(n-1) + b := 128 + 3*(n-1) + return fmt.Sprintf("rgb(%v, %v, %v)", r, g, b) +} + +// colors generates the CSS rules for coverage colors. +func colors() template.CSS { + var buf bytes.Buffer + for i := 0; i < 11; i++ { + fmt.Fprintf(&buf, ".cov%v { color: %v }\n", i, rgb(i)) + } + return template.CSS(buf.String()) +} + +var htmlTemplate = template.Must(template.New("html").Funcs(template.FuncMap{ + "colors": colors, +}).Parse(tmplHTML)) + +type templateData struct { + Files []*templateFile + Set bool +} + +type templateFile struct { + Name string + Body template.HTML + Coverage float64 +} + +const tmplHTML = ` + + + + + + + +
+ +
+ not tracked + {{if .Set}} + not covered + covered + {{else}} + no coverage + low coverage + * + * + * + * + * + * + * + * + high coverage + {{end}} +
+
+
+ {{range $i, $f := .Files}} +
{{$f.Body}}
+ {{end}} +
+ + + +` diff --git a/src/cmd/cover/profile.go b/src/cmd/cover/profile.go new file mode 100644 index 0000000000000000000000000000000000000000..a03b5d532a4d7633e88965a22fe54826a16e44eb --- /dev/null +++ b/src/cmd/cover/profile.go @@ -0,0 +1,192 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// This file provides support for parsing coverage profiles +// generated by "go test -coverprofile=cover.out". +// It is a copy of golang.org/x/tools/cover/profile.go. + +package main + +import ( + "bufio" + "fmt" + "math" + "os" + "regexp" + "sort" + "strconv" + "strings" +) + +// Profile represents the profiling data for a specific file. +type Profile struct { + FileName string + Mode string + Blocks []ProfileBlock +} + +// ProfileBlock represents a single block of profiling data. +type ProfileBlock struct { + StartLine, StartCol int + EndLine, EndCol int + NumStmt, Count int +} + +type byFileName []*Profile + +func (p byFileName) Len() int { return len(p) } +func (p byFileName) Less(i, j int) bool { return p[i].FileName < p[j].FileName } +func (p byFileName) Swap(i, j int) { p[i], p[j] = p[j], p[i] } + +// ParseProfiles parses profile data in the specified file and returns a +// Profile for each source file described therein. +func ParseProfiles(fileName string) ([]*Profile, error) { + pf, err := os.Open(fileName) + if err != nil { + return nil, err + } + defer pf.Close() + + files := make(map[string]*Profile) + buf := bufio.NewReader(pf) + // First line is "mode: foo", where foo is "set", "count", or "atomic". + // Rest of file is in the format + // encoding/base64/base64.go:34.44,37.40 3 1 + // where the fields are: name.go:line.column,line.column numberOfStatements count + s := bufio.NewScanner(buf) + mode := "" + for s.Scan() { + line := s.Text() + if mode == "" { + const p = "mode: " + if !strings.HasPrefix(line, p) || line == p { + return nil, fmt.Errorf("bad mode line: %v", line) + } + mode = line[len(p):] + continue + } + m := lineRe.FindStringSubmatch(line) + if m == nil { + return nil, fmt.Errorf("line %q doesn't match expected format: %v", m, lineRe) + } + fn := m[1] + p := files[fn] + if p == nil { + p = &Profile{ + FileName: fn, + Mode: mode, + } + files[fn] = p + } + p.Blocks = append(p.Blocks, ProfileBlock{ + StartLine: toInt(m[2]), + StartCol: toInt(m[3]), + EndLine: toInt(m[4]), + EndCol: toInt(m[5]), + NumStmt: toInt(m[6]), + Count: toInt(m[7]), + }) + } + if err := s.Err(); err != nil { + return nil, err + } + for _, p := range files { + sort.Sort(blocksByStart(p.Blocks)) + } + // Generate a sorted slice. + profiles := make([]*Profile, 0, len(files)) + for _, profile := range files { + profiles = append(profiles, profile) + } + sort.Sort(byFileName(profiles)) + return profiles, nil +} + +type blocksByStart []ProfileBlock + +func (b blocksByStart) Len() int { return len(b) } +func (b blocksByStart) Swap(i, j int) { b[i], b[j] = b[j], b[i] } +func (b blocksByStart) Less(i, j int) bool { + bi, bj := b[i], b[j] + return bi.StartLine < bj.StartLine || bi.StartLine == bj.StartLine && bi.StartCol < bj.StartCol +} + +var lineRe = regexp.MustCompile(`^(.+):([0-9]+).([0-9]+),([0-9]+).([0-9]+) ([0-9]+) ([0-9]+)$`) + +func toInt(s string) int { + i, err := strconv.Atoi(s) + if err != nil { + panic(err) + } + return i +} + +// Boundary represents the position in a source file of the beginning or end of a +// block as reported by the coverage profile. In HTML mode, it will correspond to +// the opening or closing of a tag and will be used to colorize the source +type Boundary struct { + Offset int // Location as a byte offset in the source file. + Start bool // Is this the start of a block? + Count int // Event count from the cover profile. + Norm float64 // Count normalized to [0..1]. +} + +// Boundaries returns a Profile as a set of Boundary objects within the provided src. +func (p *Profile) Boundaries(src []byte) (boundaries []Boundary) { + // Find maximum count. + max := 0 + for _, b := range p.Blocks { + if b.Count > max { + max = b.Count + } + } + // Divisor for normalization. + divisor := math.Log(float64(max)) + + // boundary returns a Boundary, populating the Norm field with a normalized Count. + boundary := func(offset int, start bool, count int) Boundary { + b := Boundary{Offset: offset, Start: start, Count: count} + if !start || count == 0 { + return b + } + if max <= 1 { + b.Norm = 0.8 // Profile is in"set" mode; we want a heat map. Use cov8 in the CSS. + } else if count > 0 { + b.Norm = math.Log(float64(count)) / divisor + } + return b + } + + line, col := 1, 2 // TODO: Why is this 2? + for si, bi := 0, 0; si < len(src) && bi < len(p.Blocks); { + b := p.Blocks[bi] + if b.StartLine == line && b.StartCol == col { + boundaries = append(boundaries, boundary(si, true, b.Count)) + } + if b.EndLine == line && b.EndCol == col || line > b.EndLine { + boundaries = append(boundaries, boundary(si, false, 0)) + bi++ + continue // Don't advance through src; maybe the next block starts here. + } + if src[si] == '\n' { + line++ + col = 0 + } + col++ + si++ + } + sort.Sort(boundariesByPos(boundaries)) + return +} + +type boundariesByPos []Boundary + +func (b boundariesByPos) Len() int { return len(b) } +func (b boundariesByPos) Swap(i, j int) { b[i], b[j] = b[j], b[i] } +func (b boundariesByPos) Less(i, j int) bool { + if b[i].Offset == b[j].Offset { + return !b[i].Start && b[j].Start + } + return b[i].Offset < b[j].Offset +} diff --git a/src/cmd/cover/testdata/main.go b/src/cmd/cover/testdata/main.go new file mode 100644 index 0000000000000000000000000000000000000000..6ed39c4f23079a565f3b17fc2419122e2ae877a6 --- /dev/null +++ b/src/cmd/cover/testdata/main.go @@ -0,0 +1,112 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Test runner for coverage test. This file is not coverage-annotated; test.go is. +// It knows the coverage counter is called "coverTest". + +package main + +import ( + "fmt" + "os" +) + +func main() { + testAll() + verify() +} + +type block struct { + count uint32 + line uint32 +} + +var counters = make(map[block]bool) + +// check records the location and expected value for a counter. +func check(line, count uint32) { + b := block{ + count, + line, + } + counters[b] = true +} + +// checkVal is a version of check that returns its extra argument, +// so it can be used in conditionals. +func checkVal(line, count uint32, val int) int { + b := block{ + count, + line, + } + counters[b] = true + return val +} + +var PASS = true + +// verify checks the expected counts against the actual. It runs after the test has completed. +func verify() { + for b := range counters { + got, index := count(b.line) + if b.count == anything && got != 0 { + got = anything + } + if got != b.count { + fmt.Fprintf(os.Stderr, "test_go:%d expected count %d got %d [counter %d]\n", b.line, b.count, got, index) + PASS = false + } + } + verifyPanic() + if !PASS { + fmt.Fprintf(os.Stderr, "FAIL\n") + os.Exit(2) + } +} + +// verifyPanic is a special check for the known counter that should be +// after the panic call in testPanic. +func verifyPanic() { + if coverTest.Count[panicIndex-1] != 1 { + // Sanity check for test before panic. + fmt.Fprintf(os.Stderr, "bad before panic") + PASS = false + } + if coverTest.Count[panicIndex] != 0 { + fmt.Fprintf(os.Stderr, "bad at panic: %d should be 0\n", coverTest.Count[panicIndex]) + PASS = false + } + if coverTest.Count[panicIndex+1] != 1 { + fmt.Fprintf(os.Stderr, "bad after panic") + PASS = false + } +} + +// count returns the count and index for the counter at the specified line. +func count(line uint32) (uint32, int) { + // Linear search is fine. Choose perfect fit over approximate. + // We can have a closing brace for a range on the same line as a condition for an "else if" + // and we don't want that brace to steal the count for the condition on the "if". + // Therefore we test for a perfect (lo==line && hi==line) match, but if we can't + // find that we take the first imperfect match. + index := -1 + indexLo := uint32(1e9) + for i := range coverTest.Count { + lo, hi := coverTest.Pos[3*i], coverTest.Pos[3*i+1] + if lo == line && line == hi { + return coverTest.Count[i], i + } + // Choose the earliest match (the counters are in unpredictable order). + if lo <= line && line <= hi && indexLo > lo { + index = i + indexLo = lo + } + } + if index == -1 { + fmt.Fprintln(os.Stderr, "cover_test: no counter for line", line) + PASS = false + return 0, 0 + } + return coverTest.Count[index], index +} diff --git a/src/cmd/cover/testdata/test.go b/src/cmd/cover/testdata/test.go new file mode 100644 index 0000000000000000000000000000000000000000..9013950a2b3cbbda408462fdeac143dcea1394eb --- /dev/null +++ b/src/cmd/cover/testdata/test.go @@ -0,0 +1,218 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// This program is processed by the cover command, and then testAll is called. +// The test driver in main.go can then compare the coverage statistics with expectation. + +// The word LINE is replaced by the line number in this file. When the file is executed, +// the coverage processing has changed the line numbers, so we can't use runtime.Caller. + +package main + +const anything = 1e9 // Just some unlikely value that means "we got here, don't care how often" + +func testAll() { + testSimple() + testBlockRun() + testIf() + testFor() + testRange() + testSwitch() + testTypeSwitch() + testSelect1() + testSelect2() + testPanic() + testEmptySwitches() +} + +// The indexes of the counters in testPanic are known to main.go +const panicIndex = 3 + +// This test appears first because the index of its counters is known to main.go +func testPanic() { + defer func() { + recover() + }() + check(LINE, 1) + panic("should not get next line") + check(LINE, 0) // this is GoCover.Count[panicIndex] + // The next counter is in testSimple and it will be non-zero. + // If the panic above does not trigger a counter, the test will fail + // because GoCover.Count[panicIndex] will be the one in testSimple. +} + +func testSimple() { + check(LINE, 1) +} + +func testIf() { + if true { + check(LINE, 1) + } else { + check(LINE, 0) + } + if false { + check(LINE, 0) + } else { + check(LINE, 1) + } + for i := 0; i < 3; i++ { + if checkVal(LINE, 3, i) <= 2 { + check(LINE, 3) + } + if checkVal(LINE, 3, i) <= 1 { + check(LINE, 2) + } + if checkVal(LINE, 3, i) <= 0 { + check(LINE, 1) + } + } + for i := 0; i < 3; i++ { + if checkVal(LINE, 3, i) <= 1 { + check(LINE, 2) + } else { + check(LINE, 1) + } + } + for i := 0; i < 3; i++ { + if checkVal(LINE, 3, i) <= 0 { + check(LINE, 1) + } else if checkVal(LINE, 2, i) <= 1 { + check(LINE, 1) + } else if checkVal(LINE, 1, i) <= 2 { + check(LINE, 1) + } else if checkVal(LINE, 0, i) <= 3 { + check(LINE, 0) + } + } + if func(a, b int) bool { return a < b }(3, 4) { + check(LINE, 1) + } +} + +func testFor() { + for i := 0; i < 10; func() { i++; check(LINE, 10) }() { + check(LINE, 10) + } +} + +func testRange() { + for _, f := range []func(){ + func() { check(LINE, 1) }, + } { + f() + check(LINE, 1) + } +} + +func testBlockRun() { + check(LINE, 1) + { + check(LINE, 1) + } + { + check(LINE, 1) + } + check(LINE, 1) + { + check(LINE, 1) + } + { + check(LINE, 1) + } + check(LINE, 1) +} + +func testSwitch() { + for i := 0; i < 5; func() { i++; check(LINE, 5) }() { + switch i { + case 0: + check(LINE, 1) + case 1: + check(LINE, 1) + case 2: + check(LINE, 1) + default: + check(LINE, 2) + } + } +} + +func testTypeSwitch() { + var x = []interface{}{1, 2.0, "hi"} + for _, v := range x { + switch func() { check(LINE, 3) }(); v.(type) { + case int: + check(LINE, 1) + case float64: + check(LINE, 1) + case string: + check(LINE, 1) + case complex128: + check(LINE, 0) + default: + check(LINE, 0) + } + } +} + +func testSelect1() { + c := make(chan int) + go func() { + for i := 0; i < 1000; i++ { + c <- i + } + }() + for { + select { + case <-c: + check(LINE, anything) + case <-c: + check(LINE, anything) + default: + check(LINE, 1) + return + } + } +} + +func testSelect2() { + c1 := make(chan int, 1000) + c2 := make(chan int, 1000) + for i := 0; i < 1000; i++ { + c1 <- i + c2 <- i + } + for { + select { + case <-c1: + check(LINE, 1000) + case <-c2: + check(LINE, 1000) + default: + check(LINE, 1) + return + } + } +} + +// Empty control statements created syntax errors. This function +// is here just to be sure that those are handled correctly now. +func testEmptySwitches() { + check(LINE, 1) + switch 3 { + } + check(LINE, 1) + switch i := (interface{})(3).(int); i { + } + check(LINE, 1) + c := make(chan int) + go func() { + check(LINE, 1) + c <- 1 + select {} + }() + <-c + check(LINE, 1) +} diff --git a/src/cmd/dist/README b/src/cmd/dist/README new file mode 100644 index 0000000000000000000000000000000000000000..0649e887f45a4e162bef8e8279cc4b1ffaba5b5e --- /dev/null +++ b/src/cmd/dist/README @@ -0,0 +1,27 @@ +This program, dist, is the bootstrapping tool for the Go distribution. + +As of Go 1.5, dist and other parts of the compiler toolchain are written +in Go, making bootstrapping a little more involved than in the past. +The approach is to build the current release of Go with an earlier one. + +The process to install Go 1.x, for x ≥ 5, is: + +1. Build cmd/dist with Go 1.4. +2. Using dist, build Go 1.x compiler toolchain with Go 1.4. +3. Using dist, rebuild Go 1.x compiler toolchain with itself. +4. Using dist, build Go 1.x cmd/go (as go_bootstrap) with Go 1.x compiler toolchain. +5. Using go_bootstrap, build the remaining Go 1.x standard library and commands. + +NOTE: During the transition from the old C-based toolchain to the Go-based one, +step 2 also builds the parts of the toolchain written in C, and step 3 does not +recompile those. + +Because of backward compatibility, although the steps above say Go 1.4, +in practice any release ≥ Go 1.4 but < Go 1.x will work as the bootstrap base. + +See golang.org/s/go15bootstrap for more details. + +Compared to Go 1.4 and earlier, dist will also take over much of what used to +be done by make.bash/make.bat/make.rc and all of what used to be done by +run.bash/run.bat/run.rc, because it is nicer to implement that logic in Go +than in three different scripting languages simultaneously. diff --git a/src/cmd/dist/build.go b/src/cmd/dist/build.go new file mode 100644 index 0000000000000000000000000000000000000000..184f9738b44daeef1e9395143a84ddf565e2e38e --- /dev/null +++ b/src/cmd/dist/build.go @@ -0,0 +1,1202 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +import ( + "bytes" + "flag" + "fmt" + "os" + "os/exec" + "path/filepath" + "strings" +) + +// Initialization for any invocation. + +// The usual variables. +var ( + goarch string + gobin string + gohostarch string + gohostos string + goos string + goarm string + go386 string + goroot string + goroot_final string + goextlinkenabled string + workdir string + tooldir string + oldgoos string + oldgoarch string + slash string + exe string + defaultcc string + defaultcflags string + defaultldflags string + defaultcxxtarget string + defaultcctarget string + rebuildall bool + defaultclang bool + + sflag bool // build static binaries + vflag int // verbosity +) + +// The known architectures. +var okgoarch = []string{ + "386", + "amd64", + "amd64p32", + "arm", + "arm64", + "ppc64", + "ppc64le", +} + +// The known operating systems. +var okgoos = []string{ + "darwin", + "dragonfly", + "linux", + "android", + "solaris", + "freebsd", + "nacl", + "netbsd", + "openbsd", + "plan9", + "windows", +} + +// find reports the first index of p in l[0:n], or else -1. +func find(p string, l []string) int { + for i, s := range l { + if p == s { + return i + } + } + return -1 +} + +// xinit handles initialization of the various global state, like goroot and goarch. +func xinit() { + goroot = os.Getenv("GOROOT") + if slash == "/" && len(goroot) > 1 || slash == `\` && len(goroot) > 3 { + // if not "/" or "c:\", then strip trailing path separator + goroot = strings.TrimSuffix(goroot, slash) + } + if goroot == "" { + fatal("$GOROOT must be set") + } + + goroot_final = os.Getenv("GOROOT_FINAL") + if goroot_final == "" { + goroot_final = goroot + } + + b := os.Getenv("GOBIN") + if b == "" { + b = goroot + slash + "bin" + } + gobin = b + + b = os.Getenv("GOOS") + if b == "" { + b = gohostos + } + goos = b + if find(goos, okgoos) < 0 { + fatal("unknown $GOOS %s", goos) + } + + b = os.Getenv("GOARM") + if b == "" { + b = xgetgoarm() + } + goarm = b + + b = os.Getenv("GO386") + if b == "" { + if cansse2() { + b = "sse2" + } else { + b = "387" + } + } + go386 = b + + p := pathf("%s/src/all.bash", goroot) + if !isfile(p) { + fatal("$GOROOT is not set correctly or not exported\n"+ + "\tGOROOT=%s\n"+ + "\t%s does not exist", goroot, p) + } + + b = os.Getenv("GOHOSTARCH") + if b != "" { + gohostarch = b + } + + if find(gohostarch, okgoarch) < 0 { + fatal("unknown $GOHOSTARCH %s", gohostarch) + } + + b = os.Getenv("GOARCH") + if b == "" { + b = gohostarch + } + goarch = b + if find(goarch, okgoarch) < 0 { + fatal("unknown $GOARCH %s", goarch) + } + + b = os.Getenv("GO_EXTLINK_ENABLED") + if b != "" { + if b != "0" && b != "1" { + fatal("unknown $GO_EXTLINK_ENABLED %s", b) + } + goextlinkenabled = b + } + + b = os.Getenv("CC") + if b == "" { + // Use clang on OS X, because gcc is deprecated there. + // Xcode for OS X 10.9 Mavericks will ship a fake "gcc" binary that + // actually runs clang. We prepare different command + // lines for the two binaries, so it matters what we call it. + // See golang.org/issue/5822. + if defaultclang { + b = "clang" + } else { + b = "gcc" + } + } + defaultcc = b + + defaultcflags = os.Getenv("CFLAGS") + + defaultldflags = os.Getenv("LDFLAGS") + + b = os.Getenv("CC_FOR_TARGET") + if b == "" { + b = defaultcc + } + defaultcctarget = b + + b = os.Getenv("CXX_FOR_TARGET") + if b == "" { + b = os.Getenv("CXX") + if b == "" { + if defaultclang { + b = "clang++" + } else { + b = "g++" + } + } + } + defaultcxxtarget = b + + // For tools being invoked but also for os.ExpandEnv. + os.Setenv("GO386", go386) + os.Setenv("GOARCH", goarch) + os.Setenv("GOARM", goarm) + os.Setenv("GOHOSTARCH", gohostarch) + os.Setenv("GOHOSTOS", gohostos) + os.Setenv("GOOS", goos) + os.Setenv("GOROOT", goroot) + os.Setenv("GOROOT_FINAL", goroot_final) + + // Make the environment more predictable. + os.Setenv("LANG", "C") + os.Setenv("LANGUAGE", "en_US.UTF8") + + workdir = xworkdir() + xatexit(rmworkdir) + + tooldir = pathf("%s/pkg/tool/%s_%s", goroot, gohostos, gohostarch) +} + +// rmworkdir deletes the work directory. +func rmworkdir() { + if vflag > 1 { + errprintf("rm -rf %s\n", workdir) + } + xremoveall(workdir) +} + +// Remove trailing spaces. +func chomp(s string) string { + return strings.TrimRight(s, " \t\r\n") +} + +func branchtag(branch string) (tag string, precise bool) { + b := run(goroot, CheckExit, "git", "log", "--decorate=full", "--format=format:%d", "master.."+branch) + tag = branch + for _, line := range splitlines(b) { + // Each line is either blank, or looks like + // (tag: refs/tags/go1.4rc2, refs/remotes/origin/release-branch.go1.4, refs/heads/release-branch.go1.4) + // We need to find an element starting with refs/tags/. + i := strings.Index(line, " refs/tags/") + if i < 0 { + continue + } + i += len(" refs/tags/") + // The tag name ends at a comma or paren (prefer the first). + j := strings.Index(line[i:], ",") + if j < 0 { + j = strings.Index(line[i:], ")") + } + if j < 0 { + continue // malformed line; ignore it + } + tag = line[i : i+j] + if i == 0 { + precise = true // tag denotes HEAD + } + break + } + return +} + +// findgoversion determines the Go version to use in the version string. +func findgoversion() string { + // The $GOROOT/VERSION file takes priority, for distributions + // without the source repo. + path := pathf("%s/VERSION", goroot) + if isfile(path) { + b := chomp(readfile(path)) + // Commands such as "dist version > VERSION" will cause + // the shell to create an empty VERSION file and set dist's + // stdout to its fd. dist in turn looks at VERSION and uses + // its content if available, which is empty at this point. + // Only use the VERSION file if it is non-empty. + if b != "" { + return b + } + } + + // The $GOROOT/VERSION.cache file is a cache to avoid invoking + // git every time we run this command. Unlike VERSION, it gets + // deleted by the clean command. + path = pathf("%s/VERSION.cache", goroot) + if isfile(path) { + return chomp(readfile(path)) + } + + // Show a nicer error message if this isn't a Git repo. + if !isGitRepo() { + fatal("FAILED: not a Git repo; must put a VERSION file in $GOROOT") + } + + // Otherwise, use Git. + // What is the current branch? + branch := chomp(run(goroot, CheckExit, "git", "rev-parse", "--abbrev-ref", "HEAD")) + + // What are the tags along the current branch? + tag := "devel" + precise := false + + // If we're on a release branch, use the closest matching tag + // that is on the release branch (and not on the master branch). + if strings.HasPrefix(branch, "release-branch.") { + tag, precise = branchtag(branch) + } + + if !precise { + // Tag does not point at HEAD; add hash and date to version. + tag += chomp(run(goroot, CheckExit, "git", "log", "-n", "1", "--format=format: +%h %cd", "HEAD")) + } + + // Cache version. + writefile(tag, path, 0) + + return tag +} + +// isGitRepo reports whether the working directory is inside a Git repository. +func isGitRepo() bool { + p := ".git" + for { + fi, err := os.Stat(p) + if os.IsNotExist(err) { + p = filepath.Join("..", p) + continue + } + if err != nil || !fi.IsDir() { + return false + } + return true + } +} + +/* + * Initial tree setup. + */ + +// The old tools that no longer live in $GOBIN or $GOROOT/bin. +var oldtool = []string{ + "5a", "5c", "5g", "5l", + "6a", "6c", "6g", "6l", + "8a", "8c", "8g", "8l", + "9a", "9c", "9g", "9l", + "6cov", + "6nm", + "6prof", + "cgo", + "ebnflint", + "goapi", + "gofix", + "goinstall", + "gomake", + "gopack", + "gopprof", + "gotest", + "gotype", + "govet", + "goyacc", + "quietgcc", +} + +// Unreleased directories (relative to $GOROOT) that should +// not be in release branches. +var unreleased = []string{ + "src/cmd/newlink", + "src/cmd/objwriter", + "src/debug/goobj", + "src/old", +} + +// setup sets up the tree for the initial build. +func setup() { + // Create bin directory. + if p := pathf("%s/bin", goroot); !isdir(p) { + xmkdir(p) + } + + // Create package directory. + if p := pathf("%s/pkg", goroot); !isdir(p) { + xmkdir(p) + } + + p := pathf("%s/pkg/%s_%s", goroot, gohostos, gohostarch) + if rebuildall { + xremoveall(p) + } + xmkdirall(p) + + if goos != gohostos || goarch != gohostarch { + p := pathf("%s/pkg/%s_%s", goroot, goos, goarch) + if rebuildall { + xremoveall(p) + } + xmkdirall(p) + } + + // Create object directory. + // We keep it in pkg/ so that all the generated binaries + // are in one tree. If pkg/obj/libgc.a exists, it is a dreg from + // before we used subdirectories of obj. Delete all of obj + // to clean up. + if p := pathf("%s/pkg/obj/libgc.a", goroot); isfile(p) { + xremoveall(pathf("%s/pkg/obj", goroot)) + } + p = pathf("%s/pkg/obj/%s_%s", goroot, gohostos, gohostarch) + if rebuildall { + xremoveall(p) + } + xmkdirall(p) + + // Create tool directory. + // We keep it in pkg/, just like the object directory above. + if rebuildall { + xremoveall(tooldir) + } + xmkdirall(tooldir) + + // Remove tool binaries from before the tool/gohostos_gohostarch + xremoveall(pathf("%s/bin/tool", goroot)) + + // Remove old pre-tool binaries. + for _, old := range oldtool { + xremove(pathf("%s/bin/%s", goroot, old)) + } + + // If $GOBIN is set and has a Go compiler, it must be cleaned. + for _, char := range "56789" { + if isfile(pathf("%s%s%c%s", gobin, slash, char, "g")) { + for _, old := range oldtool { + xremove(pathf("%s/%s", gobin, old)) + } + break + } + } + + // For release, make sure excluded things are excluded. + goversion := findgoversion() + if strings.HasPrefix(goversion, "release.") || (strings.HasPrefix(goversion, "go") && !strings.Contains(goversion, "beta")) { + for _, dir := range unreleased { + if p := pathf("%s/%s", goroot, dir); isdir(p) { + fatal("%s should not exist in release build", p) + } + } + } +} + +/* + * Tool building + */ + +// deptab lists changes to the default dependencies for a given prefix. +// deps ending in /* read the whole directory; deps beginning with - +// exclude files with that prefix. +var deptab = []struct { + prefix string // prefix of target + dep []string // dependency tweaks for targets with that prefix +}{ + {"cmd/go", []string{ + "zdefaultcc.go", + }}, + {"runtime", []string{ + "zversion.go", + }}, +} + +// depsuffix records the allowed suffixes for source files. +var depsuffix = []string{ + ".s", + ".go", +} + +// gentab records how to generate some trivial files. +var gentab = []struct { + nameprefix string + gen func(string, string) +}{ + {"zdefaultcc.go", mkzdefaultcc}, + {"zversion.go", mkzversion}, + + // not generated anymore, but delete the file if we see it + {"enam.c", nil}, + {"anames5.c", nil}, + {"anames6.c", nil}, + {"anames8.c", nil}, + {"anames9.c", nil}, +} + +// install installs the library, package, or binary associated with dir, +// which is relative to $GOROOT/src. +func install(dir string) { + if vflag > 0 { + if goos != gohostos || goarch != gohostarch { + errprintf("%s (%s/%s)\n", dir, goos, goarch) + } else { + errprintf("%s\n", dir) + } + } + + var clean []string + defer func() { + for _, name := range clean { + xremove(name) + } + }() + + // path = full path to dir. + path := pathf("%s/src/%s", goroot, dir) + name := filepath.Base(dir) + + ispkg := !strings.HasPrefix(dir, "cmd/") || strings.HasPrefix(dir, "cmd/internal/") || strings.HasPrefix(dir, "cmd/asm/internal/") + + // Start final link command line. + // Note: code below knows that link.p[targ] is the target. + var ( + link []string + targ int + ispackcmd bool + ) + if ispkg { + // Go library (package). + ispackcmd = true + link = []string{"pack", pathf("%s/pkg/%s_%s/%s.a", goroot, goos, goarch, dir)} + targ = len(link) - 1 + xmkdirall(filepath.Dir(link[targ])) + } else { + // Go command. + elem := name + if elem == "go" { + elem = "go_bootstrap" + } + link = []string{pathf("%s/link", tooldir), "-o", pathf("%s/%s%s", tooldir, elem, exe)} + targ = len(link) - 1 + } + ttarg := mtime(link[targ]) + + // Gather files that are sources for this target. + // Everything in that directory, and any target-specific + // additions. + files := xreaddir(path) + + // Remove files beginning with . or _, + // which are likely to be editor temporary files. + // This is the same heuristic build.ScanDir uses. + // There do exist real C files beginning with _, + // so limit that check to just Go files. + files = filter(files, func(p string) bool { + return !strings.HasPrefix(p, ".") && (!strings.HasPrefix(p, "_") || !strings.HasSuffix(p, ".go")) + }) + + for _, dt := range deptab { + if dir == dt.prefix || strings.HasSuffix(dt.prefix, "/") && strings.HasPrefix(dir, dt.prefix) { + for _, p := range dt.dep { + p = os.ExpandEnv(p) + files = append(files, p) + } + } + } + files = uniq(files) + + // Convert to absolute paths. + for i, p := range files { + if !isabs(p) { + files[i] = pathf("%s/%s", path, p) + } + } + + // Is the target up-to-date? + var gofiles, missing []string + stale := rebuildall + files = filter(files, func(p string) bool { + for _, suf := range depsuffix { + if strings.HasSuffix(p, suf) { + goto ok + } + } + return false + ok: + t := mtime(p) + if !t.IsZero() && !strings.HasSuffix(p, ".a") && !shouldbuild(p, dir) { + return false + } + if strings.HasSuffix(p, ".go") { + gofiles = append(gofiles, p) + } + if t.After(ttarg) { + stale = true + } + if t.IsZero() { + missing = append(missing, p) + } + return true + }) + + // If there are no files to compile, we're done. + if len(files) == 0 { + return + } + + if !stale { + return + } + + // For package runtime, copy some files into the work space. + if dir == "runtime" { + xmkdirall(pathf("%s/pkg/include", goroot)) + // For use by assembly and C files. + copyfile(pathf("%s/pkg/include/textflag.h", goroot), + pathf("%s/src/runtime/textflag.h", goroot), 0) + copyfile(pathf("%s/pkg/include/funcdata.h", goroot), + pathf("%s/src/runtime/funcdata.h", goroot), 0) + } + + // Generate any missing files; regenerate existing ones. + for _, p := range files { + elem := filepath.Base(p) + for _, gt := range gentab { + if gt.gen == nil { + continue + } + if strings.HasPrefix(elem, gt.nameprefix) { + if vflag > 1 { + errprintf("generate %s\n", p) + } + gt.gen(path, p) + // Do not add generated file to clean list. + // In runtime, we want to be able to + // build the package with the go tool, + // and it assumes these generated files already + // exist (it does not know how to build them). + // The 'clean' command can remove + // the generated files. + goto built + } + } + // Did not rebuild p. + if find(p, missing) >= 0 { + fatal("missing file %s", p) + } + built: + } + + if goos != gohostos || goarch != gohostarch { + // We've generated the right files; the go command can do the build. + if vflag > 1 { + errprintf("skip build for cross-compile %s\n", dir) + } + return + } + + var archive string + // The next loop will compile individual non-Go files. + // Hand the Go files to the compiler en masse. + // For package runtime, this writes go_asm.h, which + // the assembly files will need. + pkg := dir + if strings.HasPrefix(dir, "cmd/") { + pkg = "main" + } + b := pathf("%s/_go_.a", workdir) + clean = append(clean, b) + if !ispackcmd { + link = append(link, b) + } else { + archive = b + } + compile := []string{pathf("%s/compile", tooldir), "-pack", "-o", b, "-p", pkg} + if dir == "runtime" { + compile = append(compile, "-+", "-asmhdr", pathf("%s/go_asm.h", workdir)) + } + compile = append(compile, gofiles...) + run(path, CheckExit|ShowOutput, compile...) + + // Compile the files. + for _, p := range files { + if !strings.HasSuffix(p, ".s") { + continue + } + + var compile []string + // Assembly file for a Go package. + compile = []string{ + pathf("%s/asm", tooldir), + "-I", workdir, + "-I", pathf("%s/pkg/include", goroot), + "-D", "GOOS_" + goos, + "-D", "GOARCH_" + goarch, + "-D", "GOOS_GOARCH_" + goos + "_" + goarch, + } + + doclean := true + b := pathf("%s/%s", workdir, filepath.Base(p)) + + // Change the last character of the output file (which was c or s). + b = b[:len(b)-1] + "o" + compile = append(compile, "-o", b, p) + bgrun(path, compile...) + + link = append(link, b) + if doclean { + clean = append(clean, b) + } + } + bgwait() + + if ispackcmd { + xremove(link[targ]) + dopack(link[targ], archive, link[targ+1:]) + return + } + + // Remove target before writing it. + xremove(link[targ]) + run("", CheckExit|ShowOutput, link...) +} + +// matchfield reports whether the field (x,y,z) matches this build. +// all the elements in the field must be satisfied. +func matchfield(f string) bool { + for _, tag := range strings.Split(f, ",") { + if !matchtag(tag) { + return false + } + } + return true +} + +// matchtag reports whether the tag (x or !x) matches this build. +func matchtag(tag string) bool { + if tag == "" { + return false + } + if tag[0] == '!' { + if len(tag) == 1 || tag[1] == '!' { + return false + } + return !matchtag(tag[1:]) + } + return tag == goos || tag == goarch || tag == "cmd_go_bootstrap" || tag == "go1.1" || (goos == "android" && tag == "linux") +} + +// shouldbuild reports whether we should build this file. +// It applies the same rules that are used with context tags +// in package go/build, except that the GOOS and GOARCH +// can appear anywhere in the file name, not just after _. +// In particular, they can be the entire file name (like windows.c). +// We also allow the special tag cmd_go_bootstrap. +// See ../go/bootstrap.go and package go/build. +func shouldbuild(file, dir string) bool { + // Check file name for GOOS or GOARCH. + name := filepath.Base(file) + excluded := func(list []string, ok string) bool { + for _, x := range list { + if x == ok { + continue + } + i := strings.Index(name, x) + if i < 0 { + continue + } + i += len(x) + if i == len(name) || name[i] == '.' || name[i] == '_' { + return true + } + } + return false + } + if excluded(okgoos, goos) || excluded(okgoarch, goarch) { + return false + } + + // Omit test files. + if strings.Contains(name, "_test") { + return false + } + + // Check file contents for // +build lines. + for _, p := range splitlines(readfile(file)) { + p = strings.TrimSpace(p) + if p == "" { + continue + } + if strings.Contains(p, "package documentation") { + return false + } + if strings.Contains(p, "package main") && dir != "cmd/go" && dir != "cmd/cgo" { + return false + } + if !strings.HasPrefix(p, "//") { + break + } + if !strings.Contains(p, "+build") { + continue + } + fields := splitfields(p) + if len(fields) < 2 || fields[1] != "+build" { + continue + } + for _, p := range fields[2:] { + if matchfield(p) { + goto fieldmatch + } + } + return false + fieldmatch: + } + + return true +} + +// copy copies the file src to dst, via memory (so only good for small files). +func copyfile(dst, src string, flag int) { + if vflag > 1 { + errprintf("cp %s %s\n", src, dst) + } + writefile(readfile(src), dst, flag) +} + +// dopack copies the package src to dst, +// appending the files listed in extra. +// The archive format is the traditional Unix ar format. +func dopack(dst, src string, extra []string) { + bdst := bytes.NewBufferString(readfile(src)) + for _, file := range extra { + b := readfile(file) + // find last path element for archive member name + i := strings.LastIndex(file, "/") + 1 + j := strings.LastIndex(file, `\`) + 1 + if i < j { + i = j + } + fmt.Fprintf(bdst, "%-16.16s%-12d%-6d%-6d%-8o%-10d`\n", file[i:], 0, 0, 0, 0644, len(b)) + bdst.WriteString(b) + if len(b)&1 != 0 { + bdst.WriteByte(0) + } + } + writefile(bdst.String(), dst, 0) +} + +// buildorder records the order of builds for the 'go bootstrap' command. +// The Go packages and commands must be in dependency order, +// maintained by hand, but the order doesn't change often. +var buildorder = []string{ + // Go libraries and programs for bootstrap. + "runtime", + "errors", + "sync/atomic", + "sync", + "internal/singleflight", + "io", + "unicode", + "unicode/utf8", + "unicode/utf16", + "bytes", + "math", + "strings", + "strconv", + "bufio", + "sort", + "container/heap", + "encoding/base64", + "syscall", + "internal/syscall/windows/registry", + "time", + "internal/syscall/windows", + "os", + "reflect", + "fmt", + "encoding", + "encoding/binary", + "encoding/json", + "flag", + "path/filepath", + "path", + "io/ioutil", + "log", + "regexp/syntax", + "regexp", + "go/token", + "go/scanner", + "go/ast", + "go/parser", + "os/exec", + "os/signal", + "net/url", + "text/template/parse", + "text/template", + "go/doc", + "go/build", + "hash", + "crypto", + "crypto/sha1", + "debug/dwarf", + "debug/elf", + "cmd/go", +} + +var runtimegen = []string{ + "zaexperiment.h", + "zversion.go", +} + +func clean() { + for _, name := range buildorder { + path := pathf("%s/src/%s", goroot, name) + // Remove generated files. + for _, elem := range xreaddir(path) { + for _, gt := range gentab { + if strings.HasPrefix(elem, gt.nameprefix) { + xremove(pathf("%s/%s", path, elem)) + } + } + } + // Remove generated binary named for directory. + if strings.HasPrefix(name, "cmd/") { + xremove(pathf("%s/%s", path, name[4:])) + } + } + + // remove runtimegen files. + path := pathf("%s/src/runtime", goroot) + for _, elem := range runtimegen { + xremove(pathf("%s/%s", path, elem)) + } + + if rebuildall { + // Remove object tree. + xremoveall(pathf("%s/pkg/obj/%s_%s", goroot, gohostos, gohostarch)) + + // Remove installed packages and tools. + xremoveall(pathf("%s/pkg/%s_%s", goroot, gohostos, gohostarch)) + xremoveall(pathf("%s/pkg/%s_%s", goroot, goos, goarch)) + xremoveall(tooldir) + + // Remove cached version info. + xremove(pathf("%s/VERSION.cache", goroot)) + } +} + +/* + * command implementations + */ + +func usage() { + xprintf("usage: go tool dist [command]\n" + + "Commands are:\n" + + "\n" + + "banner print installation banner\n" + + "bootstrap rebuild everything\n" + + "clean deletes all built files\n" + + "env [-p] print environment (-p: include $PATH)\n" + + "install [dir] install individual directory\n" + + "test [-h] run Go test(s)\n" + + "version print Go version\n" + + "\n" + + "All commands take -v flags to emit extra information.\n", + ) + xexit(2) +} + +// The env command prints the default environment. +func cmdenv() { + path := flag.Bool("p", false, "emit updated PATH") + plan9 := flag.Bool("9", false, "emit plan 9 syntax") + windows := flag.Bool("w", false, "emit windows syntax") + xflagparse(0) + + format := "%s=\"%s\"\n" + switch { + case *plan9: + format = "%s='%s'\n" + case *windows: + format = "set %s=%s\r\n" + } + + xprintf(format, "CC", defaultcc) + xprintf(format, "CC_FOR_TARGET", defaultcctarget) + xprintf(format, "GOROOT", goroot) + xprintf(format, "GOBIN", gobin) + xprintf(format, "GOARCH", goarch) + xprintf(format, "GOOS", goos) + xprintf(format, "GOHOSTARCH", gohostarch) + xprintf(format, "GOHOSTOS", gohostos) + xprintf(format, "GOTOOLDIR", tooldir) + if goarch == "arm" { + xprintf(format, "GOARM", goarm) + } + if goarch == "386" { + xprintf(format, "GO386", go386) + } + + if *path { + sep := ":" + if gohostos == "windows" { + sep = ";" + } + xprintf(format, "PATH", fmt.Sprintf("%s%s%s", gobin, sep, os.Getenv("PATH"))) + } +} + +// The bootstrap command runs a build from scratch, +// stopping at having installed the go_bootstrap command. +func cmdbootstrap() { + flag.BoolVar(&rebuildall, "a", rebuildall, "rebuild all") + flag.BoolVar(&sflag, "s", sflag, "build static binaries") + xflagparse(0) + + if isdir(pathf("%s/src/pkg", goroot)) { + fatal("\n\n"+ + "The Go package sources have moved to $GOROOT/src.\n"+ + "*** %s still exists. ***\n"+ + "It probably contains stale files that may confuse the build.\n"+ + "Please (check what's there and) remove it and try again.\n"+ + "See https://golang.org/s/go14nopkg\n", + pathf("%s/src/pkg", goroot)) + } + + if rebuildall { + clean() + } + + setup() + + checkCC() + bootstrapBuildTools() + + // For the main bootstrap, building for host os/arch. + oldgoos = goos + oldgoarch = goarch + goos = gohostos + goarch = gohostarch + os.Setenv("GOHOSTARCH", gohostarch) + os.Setenv("GOHOSTOS", gohostos) + os.Setenv("GOARCH", goarch) + os.Setenv("GOOS", goos) + + // TODO(rsc): Enable when appropriate. + // This step is only needed if we believe that the Go compiler built from Go 1.4 + // will produce different object files than the Go compiler built from itself. + // In the absence of bugs, that should not happen. + // And if there are bugs, they're more likely in the current development tree + // than in a standard release like Go 1.4, so don't do this rebuild by default. + if false { + xprintf("##### Building Go toolchain using itself.\n") + for _, dir := range buildorder { + if dir == "cmd/go" { + break + } + install(dir) + } + xprintf("\n") + } + + xprintf("##### Building go_bootstrap for host, %s/%s.\n", gohostos, gohostarch) + for _, dir := range buildorder { + install(dir) + } + + goos = oldgoos + goarch = oldgoarch + os.Setenv("GOARCH", goarch) + os.Setenv("GOOS", goos) + + // Build runtime for actual goos/goarch too. + if goos != gohostos || goarch != gohostarch { + install("runtime") + } +} + +// Copied from go/build/build.go. +// Cannot use go/build directly because cmd/dist for a new release +// builds against an old release's go/build, which may be out of sync. +var cgoEnabled = map[string]bool{ + "darwin/386": true, + "darwin/amd64": true, + "darwin/arm": true, + "darwin/arm64": true, + "dragonfly/amd64": true, + "freebsd/386": true, + "freebsd/amd64": true, + "linux/386": true, + "linux/amd64": true, + "linux/arm": true, + "linux/arm64": true, + "linux/ppc64le": true, + "android/386": true, + "android/amd64": true, + "android/arm": true, + "netbsd/386": true, + "netbsd/amd64": true, + "netbsd/arm": true, + "openbsd/386": true, + "openbsd/amd64": true, + "solaris/amd64": true, + "windows/386": true, + "windows/amd64": true, +} + +func needCC() bool { + switch os.Getenv("CGO_ENABLED") { + case "1": + return true + case "0": + return false + } + return cgoEnabled[gohostos+"/"+gohostarch] +} + +func checkCC() { + if !needCC() { + return + } + if _, err := exec.Command(defaultcc, "--help").Output(); err != nil { + fatal("cannot invoke C compiler %q: %v\n\n"+ + "Go needs a system C compiler for use with cgo.\n"+ + "To set a C compiler, export CC=the-compiler.\n"+ + "To disable cgo, export CGO_ENABLED=0.\n", defaultcc, err) + } +} + +func defaulttarg() string { + // xgetwd might return a path with symlinks fully resolved, and if + // there happens to be symlinks in goroot, then the hasprefix test + // will never succeed. Instead, we use xrealwd to get a canonical + // goroot/src before the comparison to avoid this problem. + pwd := xgetwd() + src := pathf("%s/src/", goroot) + real_src := xrealwd(src) + if !strings.HasPrefix(pwd, real_src) { + fatal("current directory %s is not under %s", pwd, real_src) + } + pwd = pwd[len(real_src):] + // guard againt xrealwd return the directory without the trailing / + pwd = strings.TrimPrefix(pwd, "/") + + return pwd +} + +// Install installs the list of packages named on the command line. +func cmdinstall() { + flag.BoolVar(&sflag, "s", sflag, "build static binaries") + xflagparse(-1) + + if flag.NArg() == 0 { + install(defaulttarg()) + } + + for _, arg := range flag.Args() { + install(arg) + } +} + +// Clean deletes temporary objects. +func cmdclean() { + xflagparse(0) + clean() +} + +// Banner prints the 'now you've installed Go' banner. +func cmdbanner() { + xflagparse(0) + + xprintf("\n") + xprintf("---\n") + xprintf("Installed Go for %s/%s in %s\n", goos, goarch, goroot) + xprintf("Installed commands in %s\n", gobin) + + if !xsamefile(goroot_final, goroot) { + // If the files are to be moved, don't check that gobin + // is on PATH; assume they know what they are doing. + } else if gohostos == "plan9" { + // Check that gobin is bound before /bin. + pid := strings.Replace(readfile("#c/pid"), " ", "", -1) + ns := fmt.Sprintf("/proc/%s/ns", pid) + if !strings.Contains(readfile(ns), fmt.Sprintf("bind -b %s /bin", gobin)) { + xprintf("*** You need to bind %s before /bin.\n", gobin) + } + } else { + // Check that gobin appears in $PATH. + pathsep := ":" + if gohostos == "windows" { + pathsep = ";" + } + if !strings.Contains(pathsep+os.Getenv("PATH")+pathsep, pathsep+gobin+pathsep) { + xprintf("*** You need to add %s to your PATH.\n", gobin) + } + } + + if !xsamefile(goroot_final, goroot) { + xprintf("\n"+ + "The binaries expect %s to be copied or moved to %s\n", + goroot, goroot_final) + } +} + +// Version prints the Go version. +func cmdversion() { + xflagparse(0) + xprintf("%s\n", findgoversion()) +} diff --git a/src/cmd/dist/buildgo.go b/src/cmd/dist/buildgo.go new file mode 100644 index 0000000000000000000000000000000000000000..437e9dd9a0f7b24ef5508adfe08854862a100cc4 --- /dev/null +++ b/src/cmd/dist/buildgo.go @@ -0,0 +1,39 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +import "fmt" + +/* + * Helpers for building cmd/go and cmd/cgo. + */ + +// mkzdefaultcc writes zdefaultcc.go: +// +// package main +// const defaultCC = +// const defaultCXX = +// +// It is invoked to write cmd/go/zdefaultcc.go +// but we also write cmd/cgo/zdefaultcc.go +func mkzdefaultcc(dir, file string) { + var out string + + out = fmt.Sprintf( + "// auto generated by go tool dist\n"+ + "\n"+ + "package main\n"+ + "\n"+ + "const defaultCC = `%s`\n"+ + "const defaultCXX = `%s`\n", + defaultcctarget, defaultcxxtarget) + + writefile(out, file, writeSkipSame) + + // Convert file name to replace: turn go into cgo. + i := len(file) - len("go/zdefaultcc.go") + file = file[:i] + "c" + file[i:] + writefile(out, file, writeSkipSame) +} diff --git a/src/cmd/dist/buildruntime.go b/src/cmd/dist/buildruntime.go new file mode 100644 index 0000000000000000000000000000000000000000..4e9bede6e2d4edf302ee53ad596f914a1fae1153 --- /dev/null +++ b/src/cmd/dist/buildruntime.go @@ -0,0 +1,96 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +import ( + "fmt" + "os" + "strings" +) + +/* + * Helpers for building runtime. + */ + +// mkzversion writes zversion.go: +// +// package runtime +// const defaultGoroot = +// const theVersion = +// const goexperiment = +// const stackGuardMultiplier = +// const buildVersion = +// +func mkzversion(dir, file string) { + out := fmt.Sprintf( + "// auto generated by go tool dist\n"+ + "\n"+ + "package runtime\n"+ + "\n"+ + "const defaultGoroot = `%s`\n"+ + "const theVersion = `%s`\n"+ + "const goexperiment = `%s`\n"+ + "const stackGuardMultiplier = %d\n"+ + "var buildVersion = theVersion\n", goroot_final, findgoversion(), os.Getenv("GOEXPERIMENT"), stackGuardMultiplier()) + + writefile(out, file, writeSkipSame) +} + +// mkzbootstrap writes cmd/internal/obj/zbootstrap.go: +// +// package obj +// +// const defaultGOROOT = +// const defaultGO386 = +// const defaultGOARM = +// const defaultGOOS = runtime.GOOS +// const defaultGOARCH = runtime.GOARCH +// const defaultGO_EXTLINK_ENABLED = +// const version = +// const stackGuardMultiplier = +// const goexperiment = +// +// The use of runtime.GOOS and runtime.GOARCH makes sure that +// a cross-compiled compiler expects to compile for its own target +// system. That is, if on a Mac you do: +// +// GOOS=linux GOARCH=ppc64 go build cmd/compile +// +// the resulting compiler will default to generating linux/ppc64 object files. +// This is more useful than having it default to generating objects for the +// original target (in this example, a Mac). +func mkzbootstrap(file string) { + out := fmt.Sprintf( + "// auto generated by go tool dist\n"+ + "\n"+ + "package obj\n"+ + "\n"+ + "import \"runtime\"\n"+ + "\n"+ + "const defaultGOROOT = `%s`\n"+ + "const defaultGO386 = `%s`\n"+ + "const defaultGOARM = `%s`\n"+ + "const defaultGOOS = runtime.GOOS\n"+ + "const defaultGOARCH = runtime.GOARCH\n"+ + "const defaultGO_EXTLINK_ENABLED = `%s`\n"+ + "const version = `%s`\n"+ + "const stackGuardMultiplier = %d\n"+ + "const goexperiment = `%s`\n", + goroot_final, go386, goarm, goextlinkenabled, findgoversion(), stackGuardMultiplier(), os.Getenv("GOEXPERIMENT")) + + writefile(out, file, writeSkipSame) +} + +// stackGuardMultiplier returns a multiplier to apply to the default +// stack guard size. Larger multipliers are used for non-optimized +// builds that have larger stack frames. +func stackGuardMultiplier() int { + for _, s := range strings.Split(os.Getenv("GO_GCFLAGS"), " ") { + if s == "-N" { + return 2 + } + } + return 1 +} diff --git a/src/cmd/dist/buildtool.go b/src/cmd/dist/buildtool.go new file mode 100644 index 0000000000000000000000000000000000000000..8a55b5da7011368853999fd4232d9fa5e74c3755 --- /dev/null +++ b/src/cmd/dist/buildtool.go @@ -0,0 +1,144 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Build toolchain using Go 1.4. +// +// The general strategy is to copy the source files we need into +// a new GOPATH workspace, adjust import paths appropriately, +// invoke the Go 1.4 go command to build those sources, +// and then copy the binaries back. + +package main + +import ( + "os" + "strings" +) + +// bootstrapDirs is a list of directories holding code that must be +// compiled with a Go 1.4 toolchain to produce the bootstrapTargets. +// All directories in this list are relative to and must be below $GOROOT/src/cmd. +// The list is assumed to have two kinds of entries: names without slashes, +// which are commands, and entries beginning with internal/, which are +// packages supporting the commands. +var bootstrapDirs = []string{ + "asm", + "asm/internal/arch", + "asm/internal/asm", + "asm/internal/flags", + "asm/internal/lex", + "compile", + "compile/internal/amd64", + "compile/internal/arm", + "compile/internal/arm64", + "compile/internal/big", + "compile/internal/gc", + "compile/internal/ppc64", + "compile/internal/x86", + "internal/gcprog", + "internal/obj", + "internal/obj/arm", + "internal/obj/arm64", + "internal/obj/ppc64", + "internal/obj/x86", + "link", + "link/internal/amd64", + "link/internal/arm", + "link/internal/arm64", + "link/internal/ld", + "link/internal/ppc64", + "link/internal/x86", +} + +func bootstrapBuildTools() { + goroot_bootstrap := os.Getenv("GOROOT_BOOTSTRAP") + if goroot_bootstrap == "" { + goroot_bootstrap = pathf("%s/go1.4", os.Getenv("HOME")) + } + xprintf("##### Building Go toolchain using %s.\n", goroot_bootstrap) + + mkzbootstrap(pathf("%s/src/cmd/internal/obj/zbootstrap.go", goroot)) + + // Use $GOROOT/pkg/bootstrap as the bootstrap workspace root. + // We use a subdirectory of $GOROOT/pkg because that's the + // space within $GOROOT where we store all generated objects. + // We could use a temporary directory outside $GOROOT instead, + // but it is easier to debug on failure if the files are in a known location. + workspace := pathf("%s/pkg/bootstrap", goroot) + xremoveall(workspace) + base := pathf("%s/src/bootstrap", workspace) + xmkdirall(base) + + // Copy source code into $GOROOT/pkg/bootstrap and rewrite import paths. + for _, dir := range bootstrapDirs { + src := pathf("%s/src/cmd/%s", goroot, dir) + dst := pathf("%s/%s", base, dir) + xmkdirall(dst) + for _, name := range xreaddirfiles(src) { + srcFile := pathf("%s/%s", src, name) + text := readfile(srcFile) + text = bootstrapFixImports(text, srcFile) + writefile(text, pathf("%s/%s", dst, name), 0) + } + } + + // Set up environment for invoking Go 1.4 go command. + // GOROOT points at Go 1.4 GOROOT, + // GOPATH points at our bootstrap workspace, + // GOBIN is empty, so that binaries are installed to GOPATH/bin, + // and GOOS, GOHOSTOS, GOARCH, and GOHOSTOS are empty, + // so that Go 1.4 builds whatever kind of binary it knows how to build. + // Restore GOROOT, GOPATH, and GOBIN when done. + // Don't bother with GOOS, GOHOSTOS, GOARCH, and GOHOSTARCH, + // because setup will take care of those when bootstrapBuildTools returns. + + defer os.Setenv("GOROOT", os.Getenv("GOROOT")) + os.Setenv("GOROOT", goroot_bootstrap) + + defer os.Setenv("GOPATH", os.Getenv("GOPATH")) + os.Setenv("GOPATH", workspace) + + defer os.Setenv("GOBIN", os.Getenv("GOBIN")) + os.Setenv("GOBIN", "") + + os.Setenv("GOOS", "") + os.Setenv("GOHOSTOS", "") + os.Setenv("GOARCH", "") + os.Setenv("GOHOSTARCH", "") + + // Run Go 1.4 to build binaries. + run(workspace, ShowOutput|CheckExit, pathf("%s/bin/go", goroot_bootstrap), "install", "-v", "bootstrap/...") + + // Copy binaries into tool binary directory. + for _, name := range bootstrapDirs { + if !strings.Contains(name, "/") { + copyfile(pathf("%s/%s%s", tooldir, name, exe), pathf("%s/bin/%s%s", workspace, name, exe), writeExec) + } + } + + xprintf("\n") +} + +func bootstrapFixImports(text, srcFile string) string { + lines := strings.SplitAfter(text, "\n") + inBlock := false + for i, line := range lines { + if strings.HasPrefix(line, "import (") { + inBlock = true + continue + } + if inBlock && strings.HasPrefix(line, ")") { + inBlock = false + continue + } + if strings.HasPrefix(line, `import "`) || strings.HasPrefix(line, `import . "`) || + inBlock && (strings.HasPrefix(line, "\t\"") || strings.HasPrefix(line, "\t. \"")) { + lines[i] = strings.Replace(line, `"cmd/`, `"bootstrap/`, -1) + } + } + + lines[0] = "// Do not edit. Bootstrap copy of " + srcFile + "\n\n//line " + srcFile + ":1\n" + lines[0] + + return strings.Join(lines, "") +} diff --git a/src/cmd/dist/cpuid_386.s b/src/cmd/dist/cpuid_386.s new file mode 100644 index 0000000000000000000000000000000000000000..ed4fb523d75f25bc0507ec2f330705f9dad4ae98 --- /dev/null +++ b/src/cmd/dist/cpuid_386.s @@ -0,0 +1,16 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build !gccgo + +TEXT ·cpuid(SB),$0-8 + MOVL ax+4(FP), AX + CPUID + MOVL info+0(FP), DI + MOVL AX, 0(DI) + MOVL BX, 4(DI) + MOVL CX, 8(DI) + MOVL DX, 12(DI) + RET + diff --git a/src/cmd/dist/cpuid_amd64.s b/src/cmd/dist/cpuid_amd64.s new file mode 100644 index 0000000000000000000000000000000000000000..b6cdfed65f599141b039f195e2bc93589682b97e --- /dev/null +++ b/src/cmd/dist/cpuid_amd64.s @@ -0,0 +1,16 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build !gccgo + +TEXT ·cpuid(SB),$0-12 + MOVL ax+8(FP), AX + CPUID + MOVQ info+0(FP), DI + MOVL AX, 0(DI) + MOVL BX, 4(DI) + MOVL CX, 8(DI) + MOVL DX, 12(DI) + RET + diff --git a/src/cmd/dist/cpuid_default.s b/src/cmd/dist/cpuid_default.s new file mode 100644 index 0000000000000000000000000000000000000000..165b4a98b031cef5270424e50fb2938f193924ac --- /dev/null +++ b/src/cmd/dist/cpuid_default.s @@ -0,0 +1,10 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build !386,!amd64,!gccgo + +#include "textflag.h" + +TEXT ·cpuid(SB),NOSPLIT,$0-0 + RET diff --git a/src/cmd/dist/main.go b/src/cmd/dist/main.go new file mode 100644 index 0000000000000000000000000000000000000000..1f19a7ca1836f786de0796e86308fd05f3120187 --- /dev/null +++ b/src/cmd/dist/main.go @@ -0,0 +1,86 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +import ( + "flag" + "fmt" + "os" + "strconv" +) + +// cmdtab records the available commands. +var cmdtab = []struct { + name string + f func() +}{ + {"banner", cmdbanner}, + {"bootstrap", cmdbootstrap}, + {"clean", cmdclean}, + {"env", cmdenv}, + {"install", cmdinstall}, + {"test", cmdtest}, + {"version", cmdversion}, +} + +// The OS-specific main calls into the portable code here. +func xmain() { + if len(os.Args) < 2 { + usage() + } + cmd := os.Args[1] + os.Args = os.Args[1:] // for flag parsing during cmd + for _, ct := range cmdtab { + if ct.name == cmd { + flag.Usage = func() { + fmt.Fprintf(os.Stderr, "usage: go tool dist %s [options]\n", cmd) + flag.PrintDefaults() + os.Exit(2) + } + ct.f() + return + } + } + + xprintf("unknown command %s\n", cmd) + usage() +} + +func xflagparse(maxargs int) { + flag.Var((*count)(&vflag), "v", "verbosity") + flag.Parse() + if maxargs >= 0 && flag.NArg() > maxargs { + flag.Usage() + } +} + +// count is a flag.Value that is like a flag.Bool and a flag.Int. +// If used as -name, it increments the count, but -name=x sets the count. +// Used for verbose flag -v. +type count int + +func (c *count) String() string { + return fmt.Sprint(int(*c)) +} + +func (c *count) Set(s string) error { + switch s { + case "true": + *c++ + case "false": + *c = 0 + default: + n, err := strconv.Atoi(s) + if err != nil { + return fmt.Errorf("invalid count %q", s) + } + *c = count(n) + } + return nil +} + +func (c *count) IsBoolFlag() bool { + return true +} diff --git a/src/cmd/dist/sys_default.go b/src/cmd/dist/sys_default.go new file mode 100644 index 0000000000000000000000000000000000000000..d7bc464f2a6b83d30cab8936b63e4dcacf8966ab --- /dev/null +++ b/src/cmd/dist/sys_default.go @@ -0,0 +1,10 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build !windows + +package main + +func sysinit() { +} diff --git a/src/cmd/dist/sys_windows.go b/src/cmd/dist/sys_windows.go new file mode 100644 index 0000000000000000000000000000000000000000..e9bfe9e3d9625b91e6cf746ec4c5d899bf55ac38 --- /dev/null +++ b/src/cmd/dist/sys_windows.go @@ -0,0 +1,49 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +import ( + "syscall" + "unsafe" +) + +var ( + modkernel32 = syscall.NewLazyDLL("kernel32.dll") + procGetSystemInfo = modkernel32.NewProc("GetSystemInfo") +) + +// see http://msdn.microsoft.com/en-us/library/windows/desktop/ms724958(v=vs.85).aspx +type systeminfo struct { + wProcessorArchitecture uint16 + wReserved uint16 + dwPageSize uint32 + lpMinimumApplicationAddress uintptr + lpMaximumApplicationAddress uintptr + dwActiveProcessorMask uintptr + dwNumberOfProcessors uint32 + dwProcessorType uint32 + dwAllocationGranularity uint32 + wProcessorLevel uint16 + wProcessorRevision uint16 +} + +const ( + PROCESSOR_ARCHITECTURE_AMD64 = 9 + PROCESSOR_ARCHITECTURE_INTEL = 0 +) + +var sysinfo systeminfo + +func sysinit() { + syscall.Syscall(procGetSystemInfo.Addr(), 1, uintptr(unsafe.Pointer(&sysinfo)), 0, 0) + switch sysinfo.wProcessorArchitecture { + case PROCESSOR_ARCHITECTURE_AMD64: + gohostarch = "amd64" + case PROCESSOR_ARCHITECTURE_INTEL: + gohostarch = "386" + default: + fatal("unknown processor architecture") + } +} diff --git a/src/cmd/dist/test.go b/src/cmd/dist/test.go new file mode 100755 index 0000000000000000000000000000000000000000..d0e634640c067d1abb8264fab318f548f8635b1c --- /dev/null +++ b/src/cmd/dist/test.go @@ -0,0 +1,866 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +import ( + "bytes" + "errors" + "flag" + "fmt" + "log" + "os" + "os/exec" + "path/filepath" + "regexp" + "strconv" + "strings" + "time" +) + +func cmdtest() { + var t tester + flag.BoolVar(&t.listMode, "list", false, "list available tests") + flag.BoolVar(&t.noRebuild, "no-rebuild", false, "don't rebuild std and cmd packages") + flag.BoolVar(&t.keepGoing, "k", false, "keep going even when error occurred") + flag.BoolVar(&t.race, "race", false, "run in race builder mode (different set of tests)") + flag.StringVar(&t.banner, "banner", "##### ", "banner prefix; blank means no section banners") + flag.StringVar(&t.runRxStr, "run", os.Getenv("GOTESTONLY"), + "run only those tests matching the regular expression; empty means to run all. "+ + "Special exception: if the string begins with '!', the match is inverted.") + xflagparse(-1) // any number of args + t.run() +} + +// tester executes cmdtest. +type tester struct { + race bool + listMode bool + noRebuild bool + keepGoing bool + runRxStr string + runRx *regexp.Regexp + runRxWant bool // want runRx to match (true) or not match (false) + runNames []string // tests to run, exclusive with runRx; empty means all + banner string // prefix, or "" for none + + goroot string + goarch string + gohostarch string + goos string + gohostos string + cgoEnabled bool + partial bool + haveTime bool // the 'time' binary is available + + tests []distTest + timeoutScale int +} + +// A distTest is a test run by dist test. +// Each test has a unique name and belongs to a group (heading) +type distTest struct { + name string // unique test name; may be filtered with -run flag + heading string // group section; this header is printed before the test is run. + fn func() error +} + +func mustEnv(k string) string { + v := os.Getenv(k) + if v == "" { + log.Fatalf("Unset environment variable %v", k) + } + return v +} + +func (t *tester) run() { + t.goroot = mustEnv("GOROOT") + t.goos = mustEnv("GOOS") + t.gohostos = mustEnv("GOHOSTOS") + t.goarch = mustEnv("GOARCH") + t.gohostarch = mustEnv("GOHOSTARCH") + slurp, err := exec.Command("go", "env", "CGO_ENABLED").Output() + if err != nil { + log.Fatalf("Error running go env CGO_ENABLED: %v", err) + } + t.cgoEnabled, _ = strconv.ParseBool(strings.TrimSpace(string(slurp))) + if flag.NArg() > 0 && t.runRxStr != "" { + log.Fatalf("the -run regular expression flag is mutually exclusive with test name arguments") + } + t.runNames = flag.Args() + + if t.hasBash() { + if _, err := exec.LookPath("time"); err == nil { + t.haveTime = true + } + } + + if !t.noRebuild { + t.out("Building packages and commands.") + cmd := exec.Command("go", "install", "-a", "-v", "std", "cmd") + cmd.Stdout = os.Stdout + cmd.Stderr = os.Stderr + if err := cmd.Run(); err != nil { + log.Fatalf("building packages and commands: %v", err) + } + } + + if t.iOS() { + // Install the Mach exception handler used to intercept + // EXC_BAD_ACCESS and convert it into a Go panic. This is + // necessary for a Go program running under lldb (the way + // we run tests). It is disabled by default because iOS + // apps are not allowed to access the exc_server symbol. + cmd := exec.Command("go", "install", "-a", "-tags", "lldb", "runtime/cgo") + cmd.Stdout = os.Stdout + cmd.Stderr = os.Stderr + if err := cmd.Run(); err != nil { + log.Fatalf("building mach exception handler: %v", err) + } + + defer func() { + cmd := exec.Command("go", "install", "-a", "runtime/cgo") + cmd.Stdout = os.Stdout + cmd.Stderr = os.Stderr + if err := cmd.Run(); err != nil { + log.Fatalf("reverting mach exception handler: %v", err) + } + }() + } + + t.timeoutScale = 1 + if t.goarch == "arm" || t.goos == "windows" { + t.timeoutScale = 2 + } + if s := os.Getenv("GO_TEST_TIMEOUT_SCALE"); s != "" { + t.timeoutScale, err = strconv.Atoi(s) + if err != nil { + log.Fatalf("failed to parse $GO_TEST_TIMEOUT_SCALE = %q as integer: %v", s, err) + } + } + + if t.runRxStr != "" { + if t.runRxStr[0] == '!' { + t.runRxWant = false + t.runRxStr = t.runRxStr[1:] + } else { + t.runRxWant = true + } + t.runRx = regexp.MustCompile(t.runRxStr) + } + + t.registerTests() + if t.listMode { + for _, tt := range t.tests { + fmt.Println(tt.name) + } + return + } + + // we must unset GOROOT_FINAL before tests, because runtime/debug requires + // correct access to source code, so if we have GOROOT_FINAL in effect, + // at least runtime/debug test will fail. + os.Unsetenv("GOROOT_FINAL") + + for _, name := range t.runNames { + if !t.isRegisteredTestName(name) { + log.Fatalf("unknown test %q", name) + } + } + + var lastHeading string + ok := true + for _, dt := range t.tests { + if !t.shouldRunTest(dt.name) { + t.partial = true + continue + } + if dt.heading != "" && lastHeading != dt.heading { + lastHeading = dt.heading + t.out(dt.heading) + } + if vflag > 0 { + fmt.Printf("# go tool dist test -run=^%s$\n", dt.name) + } + if err := dt.fn(); err != nil { + ok = false + if t.keepGoing { + log.Printf("Failed: %v", err) + } else { + log.Fatalf("Failed: %v", err) + } + } + } + if !ok { + fmt.Println("\nFAILED") + os.Exit(1) + } else if t.partial { + fmt.Println("\nALL TESTS PASSED (some were excluded)") + } else { + fmt.Println("\nALL TESTS PASSED") + } +} + +func (t *tester) shouldRunTest(name string) bool { + if t.runRx != nil { + return t.runRx.MatchString(name) == t.runRxWant + } + if len(t.runNames) == 0 { + return true + } + for _, runName := range t.runNames { + if runName == name { + return true + } + } + return false +} + +func (t *tester) tags() string { + if t.iOS() { + return "-tags=lldb" + } + return "-tags=" +} + +func (t *tester) timeout(sec int) string { + return "-timeout=" + fmt.Sprint(time.Duration(sec)*time.Second*time.Duration(t.timeoutScale)) +} + +// ranGoTest and stdMatches are state closed over by the stdlib +// testing func in registerStdTest below. The tests are run +// sequentially, so there's no need for locks. +// +// ranGoBench and benchMatches are the same, but are only used +// in -race mode. +var ( + ranGoTest bool + stdMatches []string + + ranGoBench bool + benchMatches []string +) + +func (t *tester) registerStdTest(pkg string) { + testName := "go_test:" + pkg + if t.runRx == nil || t.runRx.MatchString(testName) { + stdMatches = append(stdMatches, pkg) + } + t.tests = append(t.tests, distTest{ + name: testName, + heading: "Testing packages.", + fn: func() error { + if ranGoTest { + return nil + } + ranGoTest = true + args := []string{ + "test", + "-short", + t.tags(), + t.timeout(180), + "-gcflags=" + os.Getenv("GO_GCFLAGS"), + } + if t.race { + args = append(args, "-race") + } + args = append(args, stdMatches...) + cmd := exec.Command("go", args...) + cmd.Stdout = os.Stdout + cmd.Stderr = os.Stderr + return cmd.Run() + }, + }) +} + +func (t *tester) registerRaceBenchTest(pkg string) { + testName := "go_test_bench:" + pkg + if t.runRx == nil || t.runRx.MatchString(testName) { + benchMatches = append(benchMatches, pkg) + } + t.tests = append(t.tests, distTest{ + name: testName, + heading: "Running benchmarks briefly.", + fn: func() error { + if ranGoBench { + return nil + } + ranGoBench = true + args := []string{ + "test", + "-short", + "-race", + "-run=^$", // nothing. only benchmarks. + "-bench=.*", + "-benchtime=.1s", + "-cpu=4", + } + args = append(args, benchMatches...) + cmd := exec.Command("go", args...) + cmd.Stdout = os.Stdout + cmd.Stderr = os.Stderr + return cmd.Run() + }, + }) +} + +func (t *tester) registerTests() { + // Fast path to avoid the ~1 second of `go list std cmd` when + // the caller lists specific tests to run. (as the continuous + // build coordinator does). + if len(t.runNames) > 0 { + for _, name := range t.runNames { + if strings.HasPrefix(name, "go_test:") { + t.registerStdTest(strings.TrimPrefix(name, "go_test:")) + } + if strings.HasPrefix(name, "go_test_bench:") { + t.registerRaceBenchTest(strings.TrimPrefix(name, "go_test_bench:")) + } + } + } else { + // Use a format string to only list packages and commands that have tests. + const format = "{{if (or .TestGoFiles .XTestGoFiles)}}{{.ImportPath}}{{end}}" + cmd := exec.Command("go", "list", "-f", format, "std") + if !t.race { + cmd.Args = append(cmd.Args, "cmd") + } + all, err := cmd.CombinedOutput() + if err != nil { + log.Fatalf("Error running go list std cmd: %v, %s", err, all) + } + pkgs := strings.Fields(string(all)) + for _, pkg := range pkgs { + t.registerStdTest(pkg) + } + if t.race { + for _, pkg := range pkgs { + t.registerRaceBenchTest(pkg) + } + } + } + + if t.race { + return + } + + // Runtime CPU tests. + testName := "runtime:cpu124" + t.tests = append(t.tests, distTest{ + name: testName, + heading: "GOMAXPROCS=2 runtime -cpu=1,2,4", + fn: func() error { + cmd := t.dirCmd("src", "go", "test", "-short", t.timeout(300), t.tags(), "runtime", "-cpu=1,2,4") + // We set GOMAXPROCS=2 in addition to -cpu=1,2,4 in order to test runtime bootstrap code, + // creation of first goroutines and first garbage collections in the parallel setting. + cmd.Env = mergeEnvLists([]string{"GOMAXPROCS=2"}, os.Environ()) + return cmd.Run() + }, + }) + + // sync tests + t.tests = append(t.tests, distTest{ + name: "sync_cpu", + heading: "sync -cpu=10", + fn: func() error { + return t.dirCmd("src", "go", "test", "sync", "-short", t.timeout(120), t.tags(), "-cpu=10").Run() + }, + }) + + if t.cgoEnabled && t.goos != "android" && !t.iOS() { + // Disabled on android and iOS. golang.org/issue/8345 + t.tests = append(t.tests, distTest{ + name: "cgo_stdio", + heading: "../misc/cgo/stdio", + fn: func() error { + return t.dirCmd("misc/cgo/stdio", + "go", "run", filepath.Join(os.Getenv("GOROOT"), "test/run.go"), "-", ".").Run() + }, + }) + t.tests = append(t.tests, distTest{ + name: "cgo_life", + heading: "../misc/cgo/life", + fn: func() error { + return t.dirCmd("misc/cgo/life", + "go", "run", filepath.Join(os.Getenv("GOROOT"), "test/run.go"), "-", ".").Run() + }, + }) + } + if t.cgoEnabled && t.goos != "android" && !t.iOS() { + // TODO(crawshaw): reenable on android and iOS + // golang.org/issue/8345 + // + // These tests are not designed to run off the host. + t.tests = append(t.tests, distTest{ + name: "cgo_test", + heading: "../misc/cgo/test", + fn: t.cgoTest, + }) + } + + if t.raceDetectorSupported() { + t.tests = append(t.tests, distTest{ + name: "race", + heading: "Testing race detector", + fn: t.raceTest, + }) + } + + if t.hasBash() && t.cgoEnabled && t.goos != "android" && t.goos != "darwin" { + t.registerTest("testgodefs", "../misc/cgo/testgodefs", "./test.bash") + } + if t.cgoEnabled { + if t.cgoTestSOSupported() { + t.tests = append(t.tests, distTest{ + name: "testso", + heading: "../misc/cgo/testso", + fn: func() error { + return t.cgoTestSO("misc/cgo/testso") + }, + }) + t.tests = append(t.tests, distTest{ + name: "testsovar", + heading: "../misc/cgo/testsovar", + fn: func() error { + return t.cgoTestSO("misc/cgo/testsovar") + }, + }) + } + if t.supportedBuildmode("c-archive") { + t.registerTest("testcarchive", "../misc/cgo/testcarchive", "./test.bash") + } + if t.supportedBuildmode("c-shared") { + t.registerTest("testcshared", "../misc/cgo/testcshared", "./test.bash") + } + if t.supportedBuildmode("shared") { + t.registerTest("testshared", "../misc/cgo/testshared", "go", "test") + } + if t.gohostos == "linux" && t.goarch == "amd64" { + t.registerTest("testasan", "../misc/cgo/testasan", "go", "run", "main.go") + } + if t.hasBash() && t.goos != "android" && !t.iOS() && t.gohostos != "windows" { + t.registerTest("cgo_errors", "../misc/cgo/errors", "./test.bash") + } + if t.gohostos == "linux" && t.extLink() { + t.registerTest("testsigfwd", "../misc/cgo/testsigfwd", "go", "run", "main.go") + } + } + if t.hasBash() && t.goos != "nacl" && t.goos != "android" && !t.iOS() { + t.registerTest("doc_progs", "../doc/progs", "time", "go", "run", "run.go") + t.registerTest("wiki", "../doc/articles/wiki", "./test.bash") + t.registerTest("codewalk", "../doc/codewalk", "time", "./run") + t.registerTest("shootout", "../test/bench/shootout", "time", "./timing.sh", "-test") + } + if t.goos != "android" && !t.iOS() { + t.registerTest("bench_go1", "../test/bench/go1", "go", "test") + } + if t.goos != "android" && !t.iOS() { + const nShards = 5 + for shard := 0; shard < nShards; shard++ { + shard := shard + t.tests = append(t.tests, distTest{ + name: fmt.Sprintf("test:%d_%d", shard, nShards), + heading: "../test", + fn: func() error { return t.testDirTest(shard, nShards) }, + }) + } + } + if t.goos != "nacl" && t.goos != "android" && !t.iOS() { + t.tests = append(t.tests, distTest{ + name: "api", + heading: "API check", + fn: func() error { + return t.dirCmd("src", "go", "run", filepath.Join(t.goroot, "src/cmd/api/run.go")).Run() + }, + }) + } +} + +// isRegisteredTestName reports whether a test named testName has already +// been registered. +func (t *tester) isRegisteredTestName(testName string) bool { + for _, tt := range t.tests { + if tt.name == testName { + return true + } + } + return false +} + +func (t *tester) registerTest(name, dirBanner, bin string, args ...string) { + if bin == "time" && !t.haveTime { + bin, args = args[0], args[1:] + } + if t.isRegisteredTestName(name) { + panic("duplicate registered test name " + name) + } + t.tests = append(t.tests, distTest{ + name: name, + heading: dirBanner, + fn: func() error { + return t.dirCmd(filepath.Join(t.goroot, "src", dirBanner), bin, args...).Run() + }, + }) +} + +func (t *tester) dirCmd(dir string, bin string, args ...string) *exec.Cmd { + cmd := exec.Command(bin, args...) + if filepath.IsAbs(dir) { + cmd.Dir = dir + } else { + cmd.Dir = filepath.Join(t.goroot, dir) + } + cmd.Stdout = os.Stdout + cmd.Stderr = os.Stderr + if vflag > 1 { + errprintf("%s\n", strings.Join(cmd.Args, " ")) + } + return cmd +} + +func (t *tester) iOS() bool { + return t.goos == "darwin" && (t.goarch == "arm" || t.goarch == "arm64") +} + +func (t *tester) out(v string) { + if t.banner == "" { + return + } + fmt.Println("\n" + t.banner + v) +} + +func (t *tester) extLink() bool { + pair := t.gohostos + "-" + t.goarch + switch pair { + case "android-arm", + "darwin-arm", "darwin-arm64", + "dragonfly-386", "dragonfly-amd64", + "freebsd-386", "freebsd-amd64", "freebsd-arm", + "linux-386", "linux-amd64", "linux-arm", "linux-arm64", + "netbsd-386", "netbsd-amd64", + "openbsd-386", "openbsd-amd64", + "windows-386", "windows-amd64": + return true + case "darwin-386", "darwin-amd64": + // linkmode=external fails on OS X 10.6 and earlier == Darwin + // 10.8 and earlier. + unameR, err := exec.Command("uname", "-r").Output() + if err != nil { + log.Fatalf("uname -r: %v", err) + } + major, _ := strconv.Atoi(string(unameR[:bytes.IndexByte(unameR, '.')])) + return major > 10 + } + return false +} + +func (t *tester) supportedBuildmode(mode string) bool { + pair := t.goos + "-" + t.goarch + switch mode { + case "c-archive": + if !t.extLink() { + return false + } + switch pair { + case "darwin-amd64", "darwin-arm", "darwin-arm64", + "linux-amd64", "linux-386": + return true + } + return false + case "c-shared": + // TODO(hyangah): add linux-386. + switch pair { + case "linux-amd64", "darwin-amd64", "android-arm": + return true + } + return false + case "shared": + switch pair { + case "linux-amd64": + return true + } + return false + default: + log.Fatal("internal error: unknown buildmode %s", mode) + return false + } +} + +func (t *tester) cgoTest() error { + env := mergeEnvLists([]string{"GOTRACEBACK=2"}, os.Environ()) + + if t.goos == "android" || t.iOS() { + cmd := t.dirCmd("misc/cgo/test", "go", "test", t.tags()) + cmd.Env = env + return cmd.Run() + } + + cmd := t.dirCmd("misc/cgo/test", "go", "test", t.tags(), "-ldflags", "-linkmode=auto") + cmd.Env = env + if err := cmd.Run(); err != nil { + return err + } + + if t.gohostos != "dragonfly" { + // linkmode=internal fails on dragonfly since errno is a TLS relocation. + cmd := t.dirCmd("misc/cgo/test", "go", "test", "-ldflags", "-linkmode=internal") + cmd.Env = env + if err := cmd.Run(); err != nil { + return err + } + } + + pair := t.gohostos + "-" + t.goarch + switch pair { + case "darwin-386", "darwin-amd64", + "openbsd-386", "openbsd-amd64", + "windows-386", "windows-amd64": + // test linkmode=external, but __thread not supported, so skip testtls. + if !t.extLink() { + break + } + cmd := t.dirCmd("misc/cgo/test", "go", "test", "-ldflags", "-linkmode=external") + cmd.Env = env + if err := cmd.Run(); err != nil { + return err + } + cmd = t.dirCmd("misc/cgo/test", "go", "test", "-ldflags", "-linkmode=external -s") + cmd.Env = env + if err := cmd.Run(); err != nil { + return err + } + case "android-arm", + "dragonfly-386", "dragonfly-amd64", + "freebsd-386", "freebsd-amd64", "freebsd-arm", + "linux-386", "linux-amd64", "linux-arm", + "netbsd-386", "netbsd-amd64": + + cmd := t.dirCmd("misc/cgo/test", "go", "test", "-ldflags", "-linkmode=external") + cmd.Env = env + if err := cmd.Run(); err != nil { + return err + } + cmd = t.dirCmd("misc/cgo/testtls", "go", "test", "-ldflags", "-linkmode=auto") + cmd.Env = env + if err := cmd.Run(); err != nil { + return err + } + cmd = t.dirCmd("misc/cgo/testtls", "go", "test", "-ldflags", "-linkmode=external") + cmd.Env = env + if err := cmd.Run(); err != nil { + return err + } + + switch pair { + case "netbsd-386", "netbsd-amd64": + // no static linking + case "freebsd-arm": + // -fPIC compiled tls code will use __tls_get_addr instead + // of __aeabi_read_tp, however, on FreeBSD/ARM, __tls_get_addr + // is implemented in rtld-elf, so -fPIC isn't compatible with + // static linking on FreeBSD/ARM with clang. (cgo depends on + // -fPIC fundamentally.) + default: + cc := mustEnv("CC") + cmd := t.dirCmd("misc/cgo/test", + cc, "-xc", "-o", "/dev/null", "-static", "-") + cmd.Env = env + cmd.Stdin = strings.NewReader("int main() {}") + if err := cmd.Run(); err != nil { + fmt.Println("No support for static linking found (lacks libc.a?), skip cgo static linking test.") + } else { + cmd = t.dirCmd("misc/cgo/testtls", "go", "test", "-ldflags", `-linkmode=external -extldflags "-static -pthread"`) + cmd.Env = env + if err := cmd.Run(); err != nil { + return err + } + + cmd = t.dirCmd("misc/cgo/nocgo", "go", "test") + cmd.Env = env + if err := cmd.Run(); err != nil { + return err + } + + cmd = t.dirCmd("misc/cgo/nocgo", "go", "test", "-ldflags", `-linkmode=external`) + cmd.Env = env + if err := cmd.Run(); err != nil { + return err + } + + cmd = t.dirCmd("misc/cgo/nocgo", "go", "test", "-ldflags", `-linkmode=external -extldflags "-static -pthread"`) + cmd.Env = env + if err := cmd.Run(); err != nil { + return err + } + } + + if pair != "freebsd-amd64" { // clang -pie fails to link misc/cgo/test + cmd := t.dirCmd("misc/cgo/test", + cc, "-xc", "-o", "/dev/null", "-pie", "-") + cmd.Env = env + cmd.Stdin = strings.NewReader("int main() {}") + if err := cmd.Run(); err != nil { + fmt.Println("No support for -pie found, skip cgo PIE test.") + } else { + cmd = t.dirCmd("misc/cgo/test", "go", "test", "-ldflags", `-linkmode=external -extldflags "-pie"`) + cmd.Env = env + if err := cmd.Run(); err != nil { + return fmt.Errorf("pie cgo/test: %v", err) + } + cmd = t.dirCmd("misc/cgo/testtls", "go", "test", "-ldflags", `-linkmode=external -extldflags "-pie"`) + cmd.Env = env + if err := cmd.Run(); err != nil { + return fmt.Errorf("pie cgo/testtls: %v", err) + } + cmd = t.dirCmd("misc/cgo/nocgo", "go", "test", "-ldflags", `-linkmode=external -extldflags "-pie"`) + cmd.Env = env + if err := cmd.Run(); err != nil { + return fmt.Errorf("pie cgo/nocgo: %v", err) + } + } + } + } + } + + return nil +} + +func (t *tester) cgoTestSOSupported() bool { + if t.goos == "android" || t.iOS() { + // No exec facility on Android or iOS. + return false + } + if t.goarch == "ppc64le" || t.goarch == "ppc64" { + // External linking not implemented on ppc64 (issue #8912). + return false + } + return true +} + +func (t *tester) cgoTestSO(testpath string) error { + dir := filepath.Join(t.goroot, testpath) + + // build shared object + output, err := exec.Command("go", "env", "CC").Output() + if err != nil { + return fmt.Errorf("Error running go env CC: %v", err) + } + cc := strings.TrimSuffix(string(output), "\n") + if cc == "" { + return errors.New("CC environment variable (go env CC) cannot be empty") + } + output, err = exec.Command("go", "env", "GOGCCFLAGS").Output() + if err != nil { + return fmt.Errorf("Error running go env GOGCCFLAGS: %v", err) + } + gogccflags := strings.Split(strings.TrimSuffix(string(output), "\n"), " ") + + ext := "so" + args := append(gogccflags, "-shared") + switch t.goos { + case "darwin": + ext = "dylib" + args = append(args, "-undefined", "suppress", "-flat_namespace") + case "windows": + ext = "dll" + args = append(args, "-DEXPORT_DLL") + } + sofname := "libcgosotest." + ext + args = append(args, "-o", sofname, "cgoso_c.c") + + if err := t.dirCmd(dir, cc, args...).Run(); err != nil { + return err + } + defer os.Remove(filepath.Join(dir, sofname)) + + if err := t.dirCmd(dir, "go", "build", "-o", "main.exe", "main.go").Run(); err != nil { + return err + } + defer os.Remove(filepath.Join(dir, "main.exe")) + + cmd := t.dirCmd(dir, "./main.exe") + if t.goos != "windows" { + s := "LD_LIBRARY_PATH" + if t.goos == "darwin" { + s = "DYLD_LIBRARY_PATH" + } + cmd.Env = mergeEnvLists([]string{s + "=."}, os.Environ()) + } + return cmd.Run() +} + +func (t *tester) hasBash() bool { + switch t.gohostos { + case "windows", "plan9": + return false + } + return true +} + +func (t *tester) raceDetectorSupported() bool { + switch t.gohostos { + case "linux", "darwin", "freebsd", "windows": + return t.cgoEnabled && t.goarch == "amd64" && t.gohostos == t.goos + } + return false +} + +func (t *tester) raceTest() error { + if err := t.dirCmd("src", "go", "test", "-race", "-i", "runtime/race", "flag", "os/exec").Run(); err != nil { + return err + } + if err := t.dirCmd("src", "go", "test", "-race", "-run=Output", "runtime/race").Run(); err != nil { + return err + } + if err := t.dirCmd("src", "go", "test", "-race", "-short", "flag", "os/exec").Run(); err != nil { + return err + } + if t.cgoEnabled { + env := mergeEnvLists([]string{"GOTRACEBACK=2"}, os.Environ()) + cmd := t.dirCmd("misc/cgo/test", "go", "test", "-race", "-short") + cmd.Env = env + if err := cmd.Run(); err != nil { + return err + } + } + if t.extLink() { + // Test with external linking; see issue 9133. + if err := t.dirCmd("src", "go", "test", "-race", "-short", "-ldflags=-linkmode=external", "flag", "os/exec").Run(); err != nil { + return err + } + } + return nil +} + +func (t *tester) testDirTest(shard, shards int) error { + const runExe = "runtest.exe" // named exe for Windows, but harmless elsewhere + cmd := t.dirCmd("test", "go", "build", "-o", runExe, "run.go") + cmd.Env = mergeEnvLists([]string{"GOOS=" + t.gohostos, "GOARCH=" + t.gohostarch, "GOMAXPROCS="}, os.Environ()) + if err := cmd.Run(); err != nil { + return err + } + absExe := filepath.Join(cmd.Dir, runExe) + defer os.Remove(absExe) + return t.dirCmd("test", absExe, + fmt.Sprintf("--shard=%d", shard), + fmt.Sprintf("--shards=%d", shards), + ).Run() +} + +// mergeEnvLists merges the two environment lists such that +// variables with the same name in "in" replace those in "out". +// out may be mutated. +func mergeEnvLists(in, out []string) []string { +NextVar: + for _, inkv := range in { + k := strings.SplitAfterN(inkv, "=", 2)[0] + for i, outkv := range out { + if strings.HasPrefix(outkv, k) { + out[i] = inkv + continue NextVar + } + } + out = append(out, inkv) + } + return out +} diff --git a/src/cmd/dist/util.go b/src/cmd/dist/util.go new file mode 100644 index 0000000000000000000000000000000000000000..f13210f4dea731b93a10ae8ea0cbda08aee1f9d8 --- /dev/null +++ b/src/cmd/dist/util.go @@ -0,0 +1,559 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +import ( + "bytes" + "fmt" + "io/ioutil" + "os" + "os/exec" + "path/filepath" + "runtime" + "sort" + "strconv" + "strings" + "sync" + "sync/atomic" + "time" +) + +// pathf is fmt.Sprintf for generating paths +// (on windows it turns / into \ after the printf). +func pathf(format string, args ...interface{}) string { + return filepath.Clean(fmt.Sprintf(format, args...)) +} + +// filter returns a slice containing the elements x from list for which f(x) == true. +func filter(list []string, f func(string) bool) []string { + var out []string + for _, x := range list { + if f(x) { + out = append(out, x) + } + } + return out +} + +// uniq returns a sorted slice containing the unique elements of list. +func uniq(list []string) []string { + out := make([]string, len(list)) + copy(out, list) + sort.Strings(out) + keep := out[:0] + for _, x := range out { + if len(keep) == 0 || keep[len(keep)-1] != x { + keep = append(keep, x) + } + } + return keep +} + +// splitlines returns a slice with the result of splitting +// the input p after each \n. +func splitlines(p string) []string { + return strings.SplitAfter(p, "\n") +} + +// splitfields replaces the vector v with the result of splitting +// the input p into non-empty fields containing no spaces. +func splitfields(p string) []string { + return strings.Fields(p) +} + +const ( + CheckExit = 1 << iota + ShowOutput + Background +) + +var outputLock sync.Mutex + +// run runs the command line cmd in dir. +// If mode has ShowOutput set, run collects cmd's output and returns it as a string; +// otherwise, run prints cmd's output to standard output after the command finishes. +// If mode has CheckExit set and the command fails, run calls fatal. +// If mode has Background set, this command is being run as a +// Background job. Only bgrun should use the Background mode, +// not other callers. +func run(dir string, mode int, cmd ...string) string { + if vflag > 1 { + errprintf("run: %s\n", strings.Join(cmd, " ")) + } + + xcmd := exec.Command(cmd[0], cmd[1:]...) + xcmd.Dir = dir + var data []byte + var err error + + // If we want to show command output and this is not + // a background command, assume it's the only thing + // running, so we can just let it write directly stdout/stderr + // as it runs without fear of mixing the output with some + // other command's output. Not buffering lets the output + // appear as it is printed instead of once the command exits. + // This is most important for the invocation of 'go1.4 build -v bootstrap/...'. + if mode&(Background|ShowOutput) == ShowOutput { + xcmd.Stdout = os.Stdout + xcmd.Stderr = os.Stderr + err = xcmd.Run() + } else { + data, err = xcmd.CombinedOutput() + } + if err != nil && mode&CheckExit != 0 { + outputLock.Lock() + if len(data) > 0 { + xprintf("%s\n", data) + } + outputLock.Unlock() + if mode&Background != 0 { + bgdied.Done() + } + fatal("FAILED: %v: %v", strings.Join(cmd, " "), err) + } + if mode&ShowOutput != 0 { + outputLock.Lock() + os.Stdout.Write(data) + outputLock.Unlock() + } + if vflag > 2 { + errprintf("run: %s DONE\n", strings.Join(cmd, " ")) + } + return string(data) +} + +var maxbg = 4 /* maximum number of jobs to run at once */ + +var ( + bgwork = make(chan func(), 1e5) + bgdone = make(chan struct{}, 1e5) + + bgdied sync.WaitGroup + nwork int32 + ndone int32 + + dying = make(chan bool) + nfatal int32 +) + +func bginit() { + bgdied.Add(maxbg) + for i := 0; i < maxbg; i++ { + go bghelper() + } +} + +func bghelper() { + for { + w := <-bgwork + w() + + // Stop if we're dying. + if atomic.LoadInt32(&nfatal) > 0 { + bgdied.Done() + return + } + } +} + +// bgrun is like run but runs the command in the background. +// CheckExit|ShowOutput mode is implied (since output cannot be returned). +func bgrun(dir string, cmd ...string) { + bgwork <- func() { + run(dir, CheckExit|ShowOutput|Background, cmd...) + } +} + +// bgwait waits for pending bgruns to finish. +// bgwait must be called from only a single goroutine at a time. +func bgwait() { + var wg sync.WaitGroup + wg.Add(maxbg) + done := make(chan bool) + for i := 0; i < maxbg; i++ { + bgwork <- func() { + wg.Done() + + // Hold up bg goroutine until either the wait finishes + // or the program starts dying due to a call to fatal. + select { + case <-dying: + case <-done: + } + } + } + wg.Wait() + close(done) +} + +// xgetwd returns the current directory. +func xgetwd() string { + wd, err := os.Getwd() + if err != nil { + fatal("%s", err) + } + return wd +} + +// xrealwd returns the 'real' name for the given path. +// real is defined as what xgetwd returns in that directory. +func xrealwd(path string) string { + old := xgetwd() + if err := os.Chdir(path); err != nil { + fatal("chdir %s: %v", path, err) + } + real := xgetwd() + if err := os.Chdir(old); err != nil { + fatal("chdir %s: %v", old, err) + } + return real +} + +// isdir reports whether p names an existing directory. +func isdir(p string) bool { + fi, err := os.Stat(p) + return err == nil && fi.IsDir() +} + +// isfile reports whether p names an existing file. +func isfile(p string) bool { + fi, err := os.Stat(p) + return err == nil && fi.Mode().IsRegular() +} + +// mtime returns the modification time of the file p. +func mtime(p string) time.Time { + fi, err := os.Stat(p) + if err != nil { + return time.Time{} + } + return fi.ModTime() +} + +// isabs reports whether p is an absolute path. +func isabs(p string) bool { + return filepath.IsAbs(p) +} + +// readfile returns the content of the named file. +func readfile(file string) string { + data, err := ioutil.ReadFile(file) + if err != nil { + fatal("%v", err) + } + return string(data) +} + +const ( + writeExec = 1 << iota + writeSkipSame +) + +// writefile writes b to the named file, creating it if needed. +// if exec is non-zero, marks the file as executable. +// If the file already exists and has the expected content, +// it is not rewritten, to avoid changing the time stamp. +func writefile(b, file string, flag int) { + new := []byte(b) + if flag&writeSkipSame != 0 { + old, err := ioutil.ReadFile(file) + if err == nil && bytes.Equal(old, new) { + return + } + } + mode := os.FileMode(0666) + if flag&writeExec != 0 { + mode = 0777 + } + err := ioutil.WriteFile(file, new, mode) + if err != nil { + fatal("%v", err) + } +} + +// xmkdir creates the directory p. +func xmkdir(p string) { + err := os.Mkdir(p, 0777) + if err != nil { + fatal("%v", err) + } +} + +// xmkdirall creates the directory p and its parents, as needed. +func xmkdirall(p string) { + err := os.MkdirAll(p, 0777) + if err != nil { + fatal("%v", err) + } +} + +// xremove removes the file p. +func xremove(p string) { + if vflag > 2 { + errprintf("rm %s\n", p) + } + os.Remove(p) +} + +// xremoveall removes the file or directory tree rooted at p. +func xremoveall(p string) { + if vflag > 2 { + errprintf("rm -r %s\n", p) + } + os.RemoveAll(p) +} + +// xreaddir replaces dst with a list of the names of the files and subdirectories in dir. +// The names are relative to dir; they are not full paths. +func xreaddir(dir string) []string { + f, err := os.Open(dir) + if err != nil { + fatal("%v", err) + } + defer f.Close() + names, err := f.Readdirnames(-1) + if err != nil { + fatal("reading %s: %v", dir, err) + } + return names +} + +// xreaddir replaces dst with a list of the names of the files in dir. +// The names are relative to dir; they are not full paths. +func xreaddirfiles(dir string) []string { + f, err := os.Open(dir) + if err != nil { + fatal("%v", err) + } + defer f.Close() + infos, err := f.Readdir(-1) + if err != nil { + fatal("reading %s: %v", dir, err) + } + var names []string + for _, fi := range infos { + if !fi.IsDir() { + names = append(names, fi.Name()) + } + } + return names +} + +// xworkdir creates a new temporary directory to hold object files +// and returns the name of that directory. +func xworkdir() string { + name, err := ioutil.TempDir("", "go-tool-dist-") + if err != nil { + fatal("%v", err) + } + return name +} + +// fatal prints an error message to standard error and exits. +func fatal(format string, args ...interface{}) { + fmt.Fprintf(os.Stderr, "go tool dist: %s\n", fmt.Sprintf(format, args...)) + + // Wait for background goroutines to finish, + // so that exit handler that removes the work directory + // is not fighting with active writes or open files. + if atomic.AddInt32(&nfatal, 1) == 1 { + close(dying) + } + for i := 0; i < maxbg; i++ { + bgwork <- func() {} // wake up workers so they notice nfatal > 0 + } + bgdied.Wait() + + xexit(2) +} + +var atexits []func() + +// xexit exits the process with return code n. +func xexit(n int) { + for i := len(atexits) - 1; i >= 0; i-- { + atexits[i]() + } + os.Exit(n) +} + +// xatexit schedules the exit-handler f to be run when the program exits. +func xatexit(f func()) { + atexits = append(atexits, f) +} + +// xprintf prints a message to standard output. +func xprintf(format string, args ...interface{}) { + fmt.Printf(format, args...) +} + +// errprintf prints a message to standard output. +func errprintf(format string, args ...interface{}) { + fmt.Fprintf(os.Stderr, format, args...) +} + +// main takes care of OS-specific startup and dispatches to xmain. +func main() { + os.Setenv("TERM", "dumb") // disable escape codes in clang errors + + slash = string(filepath.Separator) + + gohostos = runtime.GOOS + switch gohostos { + case "darwin": + // Even on 64-bit platform, darwin uname -m prints i386. + if strings.Contains(run("", CheckExit, "sysctl", "machdep.cpu.extfeatures"), "EM64T") { + gohostarch = "amd64" + } + case "solaris": + // Even on 64-bit platform, solaris uname -m prints i86pc. + out := run("", CheckExit, "isainfo", "-n") + if strings.Contains(out, "amd64") { + gohostarch = "amd64" + } + if strings.Contains(out, "i386") { + gohostarch = "386" + } + case "plan9": + gohostarch = os.Getenv("objtype") + if gohostarch == "" { + fatal("$objtype is unset") + } + case "windows": + exe = ".exe" + } + + sysinit() + + if gohostarch == "" { + // Default Unix system. + out := run("", CheckExit, "uname", "-m") + switch { + case strings.Contains(out, "x86_64"), strings.Contains(out, "amd64"): + gohostarch = "amd64" + case strings.Contains(out, "86"): + gohostarch = "386" + case strings.Contains(out, "arm"): + gohostarch = "arm" + case strings.Contains(out, "aarch64"): + gohostarch = "arm64" + case strings.Contains(out, "ppc64le"): + gohostarch = "ppc64le" + case strings.Contains(out, "ppc64"): + gohostarch = "ppc64" + case gohostos == "darwin": + if strings.Contains(run("", CheckExit, "uname", "-v"), "RELEASE_ARM_") { + gohostarch = "arm" + } + default: + fatal("unknown architecture: %s", out) + } + } + + if gohostarch == "arm" { + maxbg = min(maxbg, runtime.NumCPU()) + } + bginit() + + // The OS X 10.6 linker does not support external linking mode. + // See golang.org/issue/5130. + // + // OS X 10.6 does not work with clang either, but OS X 10.9 requires it. + // It seems to work with OS X 10.8, so we default to clang for 10.8 and later. + // See golang.org/issue/5822. + // + // Roughly, OS X 10.N shows up as uname release (N+4), + // so OS X 10.6 is uname version 10 and OS X 10.8 is uname version 12. + if gohostos == "darwin" { + rel := run("", CheckExit, "uname", "-r") + if i := strings.Index(rel, "."); i >= 0 { + rel = rel[:i] + } + osx, _ := strconv.Atoi(rel) + if osx <= 6+4 { + goextlinkenabled = "0" + } + if osx >= 8+4 { + defaultclang = true + } + } + + xinit() + xmain() + xexit(0) +} + +// xsamefile reports whether f1 and f2 are the same file (or dir) +func xsamefile(f1, f2 string) bool { + fi1, err1 := os.Stat(f1) + fi2, err2 := os.Stat(f2) + if err1 != nil || err2 != nil { + return f1 == f2 + } + return os.SameFile(fi1, fi2) +} + +func xgetgoarm() string { + if goos == "nacl" { + // NaCl guarantees VFPv3 and is always cross-compiled. + return "7" + } + if goos == "darwin" { + // Assume all darwin/arm devices are have VFPv3. This + // port is also mostly cross-compiled, so it makes little + // sense to auto-detect the setting. + return "7" + } + if gohostarch != "arm" || goos != gohostos { + // Conservative default for cross-compilation. + return "5" + } + if goos == "freebsd" || goos == "openbsd" { + // FreeBSD has broken VFP support. + // OpenBSD currently only supports softfloat. + return "5" + } + if goos != "linux" { + // All other arm platforms that we support + // require ARMv7. + return "7" + } + cpuinfo := readfile("/proc/cpuinfo") + goarm := "5" + for _, line := range splitlines(cpuinfo) { + line := strings.SplitN(line, ":", 2) + if len(line) < 2 { + continue + } + if strings.TrimSpace(line[0]) != "Features" { + continue + } + features := splitfields(line[1]) + sort.Strings(features) // so vfpv3 sorts after vfp + + // Infer GOARM value from the vfp features available + // on this host. Values of GOARM detected are: + // 5: no vfp support was found + // 6: vfp (v1) support was detected, but no higher + // 7: vfpv3 support was detected. + // This matches the assertions in runtime.checkarm. + for _, f := range features { + switch f { + case "vfp": + goarm = "6" + case "vfpv3": + goarm = "7" + } + } + } + return goarm +} + +func min(a, b int) int { + if a < b { + return a + } + return b +} diff --git a/src/cmd/dist/util_gc.go b/src/cmd/dist/util_gc.go new file mode 100644 index 0000000000000000000000000000000000000000..9f6cfd01b79c20518e327653c04d881c09979a6c --- /dev/null +++ b/src/cmd/dist/util_gc.go @@ -0,0 +1,19 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build !gccgo + +package main + +func cpuid(info *[4]uint32, ax uint32) + +func cansse2() bool { + if gohostarch != "386" && gohostarch != "amd64" { + return false + } + + var info [4]uint32 + cpuid(&info, 1) + return info[3]&(1<<26) != 0 // SSE2 +} diff --git a/src/cmd/dist/util_gccgo.go b/src/cmd/dist/util_gccgo.go new file mode 100644 index 0000000000000000000000000000000000000000..14ac70bca5d8eee4e474a54048d40279f2f48cdd --- /dev/null +++ b/src/cmd/dist/util_gccgo.go @@ -0,0 +1,20 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build gccgo + +package main + +/* +int supports_sse2() { +#if defined(__i386__) || defined(__x86_64__) + return __builtin_cpu_supports("sse2"); +#else + return 0; +#endif +} +*/ +import "C" + +func cansse2() bool { return C.supports_sse2() != 0 } diff --git a/src/cmd/doc/doc_test.go b/src/cmd/doc/doc_test.go new file mode 100644 index 0000000000000000000000000000000000000000..b97cc7688db7b081792063de2d5d40819320a2b4 --- /dev/null +++ b/src/cmd/doc/doc_test.go @@ -0,0 +1,348 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +import ( + "bytes" + "flag" + "os" + "os/exec" + "regexp" + "runtime" + "testing" +) + +const ( + dataDir = "testdata" + binary = "testdoc" +) + +type test struct { + name string + args []string // Arguments to "[go] doc". + yes []string // Regular expressions that should match. + no []string // Regular expressions that should not match. +} + +const p = "cmd/doc/testdata" + +var tests = []test{ + // Sanity check. + { + "sanity check", + []string{p}, + []string{`type ExportedType struct`}, + nil, + }, + + // Package dump includes import, package statement. + { + "package clause", + []string{p}, + []string{`package pkg.*cmd/doc/testdata`}, + nil, + }, + + // Constants. + // Package dump + { + "full package", + []string{p}, + []string{ + `Package comment`, + `const ExportedConstant = 1`, // Simple constant. + `const ConstOne = 1`, // First entry in constant block. + `var ExportedVariable = 1`, // Simple variable. + `var VarOne = 1`, // First entry in variable block. + `func ExportedFunc\(a int\) bool`, // Function. + `type ExportedType struct { ... }`, // Exported type. + `const ExportedTypedConstant ExportedType = iota`, // Typed constant. + `const ExportedTypedConstant_unexported unexportedType`, // Typed constant, exported for unexported type. + }, + []string{ + `const internalConstant = 2`, // No internal constants. + `var internalVariable = 2`, // No internal variables. + `func internalFunc(a int) bool`, // No internal functions. + `Comment about exported constant`, // No comment for single constant. + `Comment about exported variable`, // No comment for single variable. + `Comment about block of constants.`, // No comment for constant block. + `Comment about block of variables.`, // No comment for variable block. + `Comment before ConstOne`, // No comment for first entry in constant block. + `Comment before VarOne`, // No comment for first entry in variable block. + `ConstTwo = 2`, // No second entry in constant block. + `VarTwo = 2`, // No second entry in variable block. + `type unexportedType`, // No unexported type. + `unexportedTypedConstant`, // No unexported typed constant. + `Field`, // No fields. + `Method`, // No methods. + }, + }, + // Package dump -u + { + "full package with u", + []string{`-u`, p}, + []string{ + `const ExportedConstant = 1`, // Simple constant. + `const internalConstant = 2`, // Internal constants. + `func internalFunc\(a int\) bool`, // Internal functions. + }, + []string{ + `Comment about exported constant`, // No comment for simple constant. + `Comment about block of constants`, // No comment for constant block. + `Comment about internal function`, // No comment for internal function. + }, + }, + + // Single constant. + { + "single constant", + []string{p, `ExportedConstant`}, + []string{ + `Comment about exported constant`, // Include comment. + `const ExportedConstant = 1`, + }, + nil, + }, + // Single constant -u. + { + "single constant with -u", + []string{`-u`, p, `internalConstant`}, + []string{ + `Comment about internal constant`, // Include comment. + `const internalConstant = 2`, + }, + nil, + }, + // Block of constants. + { + "block of constants", + []string{p, `ConstTwo`}, + []string{ + `Comment before ConstOne.\n.*ConstOne = 1`, // First... + `ConstTwo = 2.*Comment on line with ConstTwo`, // And second show up. + `Comment about block of constants`, // Comment does too. + }, + []string{ + `constThree`, // No unexported constant. + }, + }, + // Block of constants -u. + { + "block of constants with -u", + []string{"-u", p, `constThree`}, + []string{ + `constThree = 3.*Comment on line with constThree`, + }, + nil, + }, + + // Single variable. + { + "single variable", + []string{p, `ExportedVariable`}, + []string{ + `ExportedVariable`, // Include comment. + `var ExportedVariable = 1`, + }, + nil, + }, + // Single variable -u. + { + "single variable with -u", + []string{`-u`, p, `internalVariable`}, + []string{ + `Comment about internal variable`, // Include comment. + `var internalVariable = 2`, + }, + nil, + }, + // Block of variables. + { + "block of variables", + []string{p, `VarTwo`}, + []string{ + `Comment before VarOne.\n.*VarOne = 1`, // First... + `VarTwo = 2.*Comment on line with VarTwo`, // And second show up. + `Comment about block of variables`, // Comment does too. + }, + []string{ + `varThree= 3`, // No unexported variable. + }, + }, + // Block of variables -u. + { + "block of variables with -u", + []string{"-u", p, `varThree`}, + []string{ + `varThree = 3.*Comment on line with varThree`, + }, + nil, + }, + + // Function. + { + "function", + []string{p, `ExportedFunc`}, + []string{ + `Comment about exported function`, // Include comment. + `func ExportedFunc\(a int\) bool`, + }, + nil, + }, + // Function -u. + { + "function with -u", + []string{"-u", p, `internalFunc`}, + []string{ + `Comment about internal function`, // Include comment. + `func internalFunc\(a int\) bool`, + }, + nil, + }, + + // Type. + { + "type", + []string{p, `ExportedType`}, + []string{ + `Comment about exported type`, // Include comment. + `type ExportedType struct`, // Type definition. + `Comment before exported field.*\n.*ExportedField +int`, + `Has unexported fields`, + `func \(ExportedType\) ExportedMethod\(a int\) bool`, + `const ExportedTypedConstant ExportedType = iota`, // Must include associated constant. + `func ExportedTypeConstructor\(\) \*ExportedType`, // Must include constructor. + }, + []string{ + `unexportedField`, // No unexported field. + `Comment about exported method.`, // No comment about exported method. + `unexportedMethod`, // No unexported method. + `unexportedTypedConstant`, // No unexported constant. + }, + }, + // Type -u with unexported fields. + { + "type with unexported fields and -u", + []string{"-u", p, `ExportedType`}, + []string{ + `Comment about exported type`, // Include comment. + `type ExportedType struct`, // Type definition. + `Comment before exported field.*\n.*ExportedField +int`, + `unexportedField int.*Comment on line with unexported field.`, + `func \(ExportedType\) unexportedMethod\(a int\) bool`, + `unexportedTypedConstant`, + }, + []string{ + `Has unexported fields`, + }, + }, + // Unexported type with -u. + { + "unexported type with -u", + []string{"-u", p, `unexportedType`}, + []string{ + `Comment about unexported type`, // Include comment. + `type unexportedType int`, // Type definition. + `func \(unexportedType\) ExportedMethod\(\) bool`, + `func \(unexportedType\) unexportedMethod\(\) bool`, + `ExportedTypedConstant_unexported unexportedType = iota`, + `const unexportedTypedConstant unexportedType = 1`, + }, + nil, + }, + + // Method. + { + "method", + []string{p, `ExportedType.ExportedMethod`}, + []string{ + `func \(ExportedType\) ExportedMethod\(a int\) bool`, + `Comment about exported method.`, + }, + nil, + }, + // Method with -u. + { + "method with -u", + []string{"-u", p, `ExportedType.unexportedMethod`}, + []string{ + `func \(ExportedType\) unexportedMethod\(a int\) bool`, + `Comment about unexported method.`, + }, + nil, + }, + + // Case matching off. + { + "case matching off", + []string{p, `casematch`}, + []string{ + `CaseMatch`, + `Casematch`, + }, + nil, + }, + + // Case matching on. + { + "case matching on", + []string{"-c", p, `Casematch`}, + []string{ + `Casematch`, + }, + []string{ + `CaseMatch`, + }, + }, +} + +func TestDoc(t *testing.T) { + if runtime.GOOS == "darwin" && (runtime.GOARCH == "arm" || runtime.GOARCH == "arm64") { + t.Skip("TODO: on darwin/arm, test fails: no such package cmd/doc/testdata") + } + for _, test := range tests { + var b bytes.Buffer + var flagSet flag.FlagSet + err := do(&b, &flagSet, test.args) + if err != nil { + t.Fatalf("%s: %s\n", test.name, err) + } + output := b.Bytes() + failed := false + for j, yes := range test.yes { + re, err := regexp.Compile(yes) + if err != nil { + t.Fatalf("%s.%d: compiling %#q: %s", test.name, j, yes, err) + } + if !re.Match(output) { + t.Errorf("%s.%d: no match for %s %#q", test.name, j, test.args, yes) + failed = true + } + } + for j, no := range test.no { + re, err := regexp.Compile(no) + if err != nil { + t.Fatalf("%s.%d: compiling %#q: %s", test.name, j, no, err) + } + if re.Match(output) { + t.Errorf("%s.%d: incorrect match for %s %#q", test.name, j, test.args, no) + failed = true + } + } + if failed { + t.Logf("\n%s", output) + } + } +} + +// run runs the command, but calls t.Fatal if there is an error. +func run(c *exec.Cmd, t *testing.T) []byte { + output, err := c.CombinedOutput() + if err != nil { + os.Stdout.Write(output) + t.Fatal(err) + } + return output +} diff --git a/src/cmd/doc/main.go b/src/cmd/doc/main.go new file mode 100644 index 0000000000000000000000000000000000000000..dda6aec22cdba68a88b95f8dc1c541875295232c --- /dev/null +++ b/src/cmd/doc/main.go @@ -0,0 +1,354 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Doc (usually run as go doc) accepts zero, one or two arguments. +// +// Zero arguments: +// go doc +// Show the documentation for the package in the current directory. +// +// One argument: +// go doc +// go doc [.] +// go doc [].[.] +// The first item in this list that succeeds is the one whose documentation +// is printed. If there is a symbol but no package, the package in the current +// directory is chosen. +// +// Two arguments: +// go doc [.] +// +// Show the documentation for the package, symbol, and method. The +// first argument must be a full package path. This is similar to the +// command-line usage for the godoc command. +// +// For commands, unless the -cmd flag is present "go doc command" +// shows only the package-level docs for the package. +// +// For complete documentation, run "go help doc". +package main + +import ( + "flag" + "fmt" + "go/build" + "io" + "log" + "os" + "path" + "path/filepath" + "strings" + "unicode" + "unicode/utf8" +) + +var ( + unexported bool // -u flag + matchCase bool // -c flag + showCmd bool // -cmd flag +) + +// usage is a replacement usage function for the flags package. +func usage() { + fmt.Fprintf(os.Stderr, "Usage of [go] doc:\n") + fmt.Fprintf(os.Stderr, "\tgo doc\n") + fmt.Fprintf(os.Stderr, "\tgo doc \n") + fmt.Fprintf(os.Stderr, "\tgo doc [.]\n") + fmt.Fprintf(os.Stderr, "\tgo doc [].[.]\n") + fmt.Fprintf(os.Stderr, "\tgo doc [.]\n") + fmt.Fprintf(os.Stderr, "For more information run\n") + fmt.Fprintf(os.Stderr, "\tgo help doc\n\n") + fmt.Fprintf(os.Stderr, "Flags:\n") + flag.PrintDefaults() + os.Exit(2) +} + +func main() { + log.SetFlags(0) + log.SetPrefix("doc: ") + err := do(os.Stdout, flag.CommandLine, os.Args[1:]) + if err != nil { + log.Fatal(err) + } +} + +// do is the workhorse, broken out of main to make testing easier. +func do(writer io.Writer, flagSet *flag.FlagSet, args []string) (err error) { + flagSet.Usage = usage + unexported = false + matchCase = false + flagSet.BoolVar(&unexported, "u", false, "show unexported symbols as well as exported") + flagSet.BoolVar(&matchCase, "c", false, "symbol matching honors case (paths not affected)") + flagSet.BoolVar(&showCmd, "cmd", false, "show symbols with package docs even if package is a command") + flagSet.Parse(args) + buildPackage, userPath, symbol := parseArgs(flagSet.Args()) + symbol, method := parseSymbol(symbol) + pkg := parsePackage(writer, buildPackage, userPath) + defer func() { + pkg.flush() + e := recover() + if e == nil { + return + } + pkgError, ok := e.(PackageError) + if ok { + err = pkgError + return + } + panic(e) + }() + switch { + case symbol == "": + pkg.packageDoc() + return + case method == "": + pkg.symbolDoc(symbol) + default: + pkg.methodDoc(symbol, method) + } + return nil +} + +// parseArgs analyzes the arguments (if any) and returns the package +// it represents, the part of the argument the user used to identify +// the path (or "" if it's the current package) and the symbol +// (possibly with a .method) within that package. +// parseSymbol is used to analyze the symbol itself. +func parseArgs(args []string) (*build.Package, string, string) { + switch len(args) { + default: + usage() + case 0: + // Easy: current directory. + return importDir(pwd()), "", "" + case 1: + // Done below. + case 2: + // Package must be importable. + pkg, err := build.Import(args[0], "", build.ImportComment) + if err != nil { + log.Fatalf("%s", err) + } + return pkg, args[0], args[1] + } + // Usual case: one argument. + arg := args[0] + // If it contains slashes, it begins with a package path. + // First, is it a complete package path as it is? If so, we are done. + // This avoids confusion over package paths that have other + // package paths as their prefix. + pkg, err := build.Import(arg, "", build.ImportComment) + if err == nil { + return pkg, arg, "" + } + // Another disambiguator: If the symbol starts with an upper + // case letter, it can only be a symbol in the current directory. + // Kills the problem caused by case-insensitive file systems + // matching an upper case name as a package name. + if isUpper(arg) { + pkg, err := build.ImportDir(".", build.ImportComment) + if err == nil { + return pkg, "", arg + } + } + // If it has a slash, it must be a package path but there is a symbol. + // It's the last package path we care about. + slash := strings.LastIndex(arg, "/") + // There may be periods in the package path before or after the slash + // and between a symbol and method. + // Split the string at various periods to see what we find. + // In general there may be ambiguities but this should almost always + // work. + var period int + // slash+1: if there's no slash, the value is -1 and start is 0; otherwise + // start is the byte after the slash. + for start := slash + 1; start < len(arg); start = period + 1 { + period = strings.Index(arg[start:], ".") + symbol := "" + if period < 0 { + period = len(arg) + } else { + period += start + symbol = arg[period+1:] + } + // Have we identified a package already? + pkg, err := build.Import(arg[0:period], "", build.ImportComment) + if err == nil { + return pkg, arg[0:period], symbol + } + // See if we have the basename or tail of a package, as in json for encoding/json + // or ivy/value for robpike.io/ivy/value. + path := findPackage(arg[0:period]) + if path != "" { + return importDir(path), arg[0:period], symbol + } + } + // If it has a slash, we've failed. + if slash >= 0 { + log.Fatalf("no such package %s", arg[0:period]) + } + // Guess it's a symbol in the current directory. + return importDir(pwd()), "", arg +} + +// importDir is just an error-catching wrapper for build.ImportDir. +func importDir(dir string) *build.Package { + pkg, err := build.ImportDir(dir, build.ImportComment) + if err != nil { + log.Fatal(err) + } + return pkg +} + +// parseSymbol breaks str apart into a symbol and method. +// Both may be missing or the method may be missing. +// If present, each must be a valid Go identifier. +func parseSymbol(str string) (symbol, method string) { + if str == "" { + return + } + elem := strings.Split(str, ".") + switch len(elem) { + case 1: + case 2: + method = elem[1] + isIdentifier(method) + default: + log.Printf("too many periods in symbol specification") + usage() + } + symbol = elem[0] + isIdentifier(symbol) + return +} + +// isIdentifier checks that the name is valid Go identifier, and +// logs and exits if it is not. +func isIdentifier(name string) { + if len(name) == 0 { + log.Fatal("empty symbol") + } + for i, ch := range name { + if unicode.IsLetter(ch) || ch == '_' || i > 0 && unicode.IsDigit(ch) { + continue + } + log.Fatalf("invalid identifier %q", name) + } +} + +// isExported reports whether the name is an exported identifier. +// If the unexported flag (-u) is true, isExported returns true because +// it means that we treat the name as if it is exported. +func isExported(name string) bool { + return unexported || isUpper(name) +} + +// isUpper reports whether the name starts with an upper case letter. +func isUpper(name string) bool { + ch, _ := utf8.DecodeRuneInString(name) + return unicode.IsUpper(ch) +} + +// findPackage returns the full file name path specified by the +// (perhaps partial) package path pkg. +func findPackage(pkg string) string { + if pkg == "" { + return "" + } + if isUpper(pkg) { + return "" // Upper case symbol cannot be a package name. + } + path := pathFor(build.Default.GOROOT, pkg) + if path != "" { + return path + } + for _, root := range splitGopath() { + path = pathFor(root, pkg) + if path != "" { + return path + } + } + return "" +} + +// splitGopath splits $GOPATH into a list of roots. +func splitGopath() []string { + return filepath.SplitList(build.Default.GOPATH) +} + +// pathsFor recursively walks the tree at root looking for possible directories for the package: +// those whose package path is pkg or which have a proper suffix pkg. +func pathFor(root, pkg string) (result string) { + root = path.Join(root, "src") + slashDot := string(filepath.Separator) + "." + // We put a slash on the pkg so can use simple string comparison below + // yet avoid inadvertent matches, like /foobar matching bar. + pkgString := filepath.Clean(string(filepath.Separator) + pkg) + + // We use panic/defer to short-circuit processing at the first match. + // A nil panic reports that the path has been found. + defer func() { + err := recover() + if err != nil { + panic(err) + } + }() + + visit := func(pathName string, f os.FileInfo, err error) error { + if err != nil { + return nil + } + // One package per directory. Ignore the files themselves. + if !f.IsDir() { + return nil + } + // No .git or other dot nonsense please. + if strings.Contains(pathName, slashDot) { + return filepath.SkipDir + } + // Is the tail of the path correct? + if strings.HasSuffix(pathName, pkgString) && hasGoFiles(pathName) { + result = pathName + panic(nil) + } + return nil + } + + filepath.Walk(root, visit) + return "" // Call to panic above sets the real value. +} + +// hasGoFiles tests whether the directory contains at least one file with ".go" +// extension +func hasGoFiles(path string) bool { + dir, err := os.Open(path) + if err != nil { + // ignore unreadable directories + return false + } + defer dir.Close() + + names, err := dir.Readdirnames(0) + if err != nil { + // ignore unreadable directories + return false + } + + for _, name := range names { + if strings.HasSuffix(name, ".go") { + return true + } + } + + return false +} + +// pwd returns the current directory. +func pwd() string { + wd, err := os.Getwd() + if err != nil { + log.Fatal(err) + } + return wd +} diff --git a/src/cmd/doc/pkg.go b/src/cmd/doc/pkg.go new file mode 100644 index 0000000000000000000000000000000000000000..569c7a30624903653373d9789d26be8e5d393ccc --- /dev/null +++ b/src/cmd/doc/pkg.go @@ -0,0 +1,552 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +import ( + "bytes" + "fmt" + "go/ast" + "go/build" + "go/doc" + "go/format" + "go/parser" + "go/token" + "io" + "log" + "os" + "unicode" + "unicode/utf8" +) + +const ( + punchedCardWidth = 80 // These things just won't leave us alone. + indentedWidth = punchedCardWidth - len(indent) + indent = " " +) + +type Package struct { + writer io.Writer // Destination for output. + name string // Package name, json for encoding/json. + userPath string // String the user used to find this package. + unexported bool + matchCase bool + pkg *ast.Package // Parsed package. + file *ast.File // Merged from all files in the package + doc *doc.Package + build *build.Package + fs *token.FileSet // Needed for printing. + buf bytes.Buffer +} + +type PackageError string // type returned by pkg.Fatalf. + +func (p PackageError) Error() string { + return string(p) +} + +// pkg.Fatalf is like log.Fatalf, but panics so it can be recovered in the +// main do function, so it doesn't cause an exit. Allows testing to work +// without running a subprocess. The log prefix will be added when +// logged in main; it is not added here. +func (pkg *Package) Fatalf(format string, args ...interface{}) { + panic(PackageError(fmt.Sprintf(format, args...))) +} + +// parsePackage turns the build package we found into a parsed package +// we can then use to generate documentation. +func parsePackage(writer io.Writer, pkg *build.Package, userPath string) *Package { + fs := token.NewFileSet() + // include tells parser.ParseDir which files to include. + // That means the file must be in the build package's GoFiles or CgoFiles + // list only (no tag-ignored files, tests, swig or other non-Go files). + include := func(info os.FileInfo) bool { + for _, name := range pkg.GoFiles { + if name == info.Name() { + return true + } + } + for _, name := range pkg.CgoFiles { + if name == info.Name() { + return true + } + } + return false + } + pkgs, err := parser.ParseDir(fs, pkg.Dir, include, parser.ParseComments) + if err != nil { + log.Fatal(err) + } + // Make sure they are all in one package. + if len(pkgs) != 1 { + log.Fatalf("multiple packages in directory %s", pkg.Dir) + } + astPkg := pkgs[pkg.Name] + + // TODO: go/doc does not include typed constants in the constants + // list, which is what we want. For instance, time.Sunday is of type + // time.Weekday, so it is defined in the type but not in the + // Consts list for the package. This prevents + // go doc time.Sunday + // from finding the symbol. Work around this for now, but we + // should fix it in go/doc. + // A similar story applies to factory functions. + docPkg := doc.New(astPkg, pkg.ImportPath, doc.AllDecls) + for _, typ := range docPkg.Types { + docPkg.Consts = append(docPkg.Consts, typ.Consts...) + docPkg.Vars = append(docPkg.Vars, typ.Vars...) + docPkg.Funcs = append(docPkg.Funcs, typ.Funcs...) + } + + return &Package{ + writer: writer, + name: pkg.Name, + userPath: userPath, + pkg: astPkg, + file: ast.MergePackageFiles(astPkg, 0), + doc: docPkg, + build: pkg, + fs: fs, + } +} + +func (pkg *Package) Printf(format string, args ...interface{}) { + fmt.Fprintf(&pkg.buf, format, args...) +} + +func (pkg *Package) flush() { + _, err := pkg.writer.Write(pkg.buf.Bytes()) + if err != nil { + log.Fatal(err) + } + pkg.buf.Reset() // Not needed, but it's a flush. +} + +var newlineBytes = []byte("\n\n") // We never ask for more than 2. + +// newlines guarantees there are n newlines at the end of the buffer. +func (pkg *Package) newlines(n int) { + for !bytes.HasSuffix(pkg.buf.Bytes(), newlineBytes[:n]) { + pkg.buf.WriteRune('\n') + } +} + +// emit prints the node. +func (pkg *Package) emit(comment string, node ast.Node) { + if node != nil { + err := format.Node(&pkg.buf, pkg.fs, node) + if err != nil { + log.Fatal(err) + } + if comment != "" { + pkg.newlines(2) // Guarantee blank line before comment. + doc.ToText(&pkg.buf, comment, " ", indent, indentedWidth) + } + pkg.newlines(1) + } +} + +var formatBuf bytes.Buffer // Reusable to avoid allocation. + +// formatNode is a helper function for printing. +func (pkg *Package) formatNode(node ast.Node) []byte { + formatBuf.Reset() + format.Node(&formatBuf, pkg.fs, node) + return formatBuf.Bytes() +} + +// oneLineFunc prints a function declaration as a single line. +func (pkg *Package) oneLineFunc(decl *ast.FuncDecl) { + decl.Doc = nil + decl.Body = nil + pkg.emit("", decl) +} + +// oneLineValueGenDecl prints a var or const declaration as a single line. +func (pkg *Package) oneLineValueGenDecl(decl *ast.GenDecl) { + decl.Doc = nil + dotDotDot := "" + if len(decl.Specs) > 1 { + dotDotDot = " ..." + } + // Find the first relevant spec. + for i, spec := range decl.Specs { + valueSpec := spec.(*ast.ValueSpec) // Must succeed; we can't mix types in one genDecl. + if !isExported(valueSpec.Names[0].Name) { + continue + } + typ := "" + if valueSpec.Type != nil { + typ = fmt.Sprintf(" %s", pkg.formatNode(valueSpec.Type)) + } + val := "" + if i < len(valueSpec.Values) && valueSpec.Values[i] != nil { + val = fmt.Sprintf(" = %s", pkg.formatNode(valueSpec.Values[i])) + } + pkg.Printf("%s %s%s%s%s\n", decl.Tok, valueSpec.Names[0], typ, val, dotDotDot) + break + } +} + +// oneLineTypeDecl prints a type declaration as a single line. +func (pkg *Package) oneLineTypeDecl(spec *ast.TypeSpec) { + spec.Doc = nil + spec.Comment = nil + switch spec.Type.(type) { + case *ast.InterfaceType: + pkg.Printf("type %s interface { ... }\n", spec.Name) + case *ast.StructType: + pkg.Printf("type %s struct { ... }\n", spec.Name) + default: + pkg.Printf("type %s %s\n", spec.Name, pkg.formatNode(spec.Type)) + } +} + +// packageDoc prints the docs for the package (package doc plus one-liners of the rest). +func (pkg *Package) packageDoc() { + defer pkg.flush() + if pkg.showInternals() { + pkg.packageClause(false) + } + + doc.ToText(&pkg.buf, pkg.doc.Doc, "", indent, indentedWidth) + pkg.newlines(1) + + if !pkg.showInternals() { + // Show only package docs for commands. + return + } + + pkg.newlines(1) + pkg.valueSummary(pkg.doc.Consts) + pkg.valueSummary(pkg.doc.Vars) + pkg.funcSummary(pkg.doc.Funcs) + pkg.typeSummary() + pkg.bugs() +} + +// showInternals reports whether we should show the internals +// of a package as opposed to just the package docs. +// Used to decide whether to suppress internals for commands. +// Called only by Package.packageDoc. +func (pkg *Package) showInternals() bool { + return pkg.pkg.Name != "main" || showCmd +} + +// packageClause prints the package clause. +// The argument boolean, if true, suppresses the output if the +// user's argument is identical to the actual package path or +// is empty, meaning it's the current directory. +func (pkg *Package) packageClause(checkUserPath bool) { + if checkUserPath { + if pkg.userPath == "" || pkg.userPath == pkg.build.ImportPath { + return + } + } + importPath := pkg.build.ImportComment + if importPath == "" { + importPath = pkg.build.ImportPath + } + pkg.Printf("package %s // import %q\n\n", pkg.name, importPath) + if importPath != pkg.build.ImportPath { + pkg.Printf("WARNING: package source is installed in %q\n", pkg.build.ImportPath) + } +} + +// valueSummary prints a one-line summary for each set of values and constants. +func (pkg *Package) valueSummary(values []*doc.Value) { + for _, value := range values { + // Only print first item in spec, show ... to stand for the rest. + spec := value.Decl.Specs[0].(*ast.ValueSpec) // Must succeed. + exported := true + for _, name := range spec.Names { + if !isExported(name.Name) { + exported = false + break + } + } + if exported { + pkg.oneLineValueGenDecl(value.Decl) + } + } +} + +// funcSummary prints a one-line summary for each function. +func (pkg *Package) funcSummary(funcs []*doc.Func) { + for _, fun := range funcs { + decl := fun.Decl + // Exported functions only. The go/doc package does not include methods here. + if isExported(fun.Name) { + pkg.oneLineFunc(decl) + } + } +} + +// typeSummary prints a one-line summary for each type. +func (pkg *Package) typeSummary() { + for _, typ := range pkg.doc.Types { + for _, spec := range typ.Decl.Specs { + typeSpec := spec.(*ast.TypeSpec) // Must succeed. + if isExported(typeSpec.Name.Name) { + pkg.oneLineTypeDecl(typeSpec) + } + } + } +} + +// bugs prints the BUGS information for the package. +// TODO: Provide access to TODOs and NOTEs as well (very noisy so off by default)? +func (pkg *Package) bugs() { + if pkg.doc.Notes["BUG"] == nil { + return + } + pkg.Printf("\n") + for _, note := range pkg.doc.Notes["BUG"] { + pkg.Printf("%s: %v\n", "BUG", note.Body) + } +} + +// findValues finds the doc.Values that describe the symbol. +func (pkg *Package) findValues(symbol string, docValues []*doc.Value) (values []*doc.Value) { + for _, value := range docValues { + for _, name := range value.Names { + if match(symbol, name) { + values = append(values, value) + } + } + } + return +} + +// findFuncs finds the doc.Funcs that describes the symbol. +func (pkg *Package) findFuncs(symbol string) (funcs []*doc.Func) { + for _, fun := range pkg.doc.Funcs { + if match(symbol, fun.Name) { + funcs = append(funcs, fun) + } + } + return +} + +// findTypes finds the doc.Types that describes the symbol. +// If symbol is empty, it finds all exported types. +func (pkg *Package) findTypes(symbol string) (types []*doc.Type) { + for _, typ := range pkg.doc.Types { + if symbol == "" && isExported(typ.Name) || match(symbol, typ.Name) { + types = append(types, typ) + } + } + return +} + +// findTypeSpec returns the ast.TypeSpec within the declaration that defines the symbol. +// The name must match exactly. +func (pkg *Package) findTypeSpec(decl *ast.GenDecl, symbol string) *ast.TypeSpec { + for _, spec := range decl.Specs { + typeSpec := spec.(*ast.TypeSpec) // Must succeed. + if symbol == typeSpec.Name.Name { + return typeSpec + } + } + return nil +} + +// symbolDoc prints the docs for symbol. There may be multiple matches. +// If symbol matches a type, output includes its methods factories and associated constants. +// If there is no top-level symbol, symbolDoc looks for methods that match. +func (pkg *Package) symbolDoc(symbol string) { + defer pkg.flush() + found := false + // Functions. + for _, fun := range pkg.findFuncs(symbol) { + if !found { + pkg.packageClause(true) + } + // Symbol is a function. + decl := fun.Decl + decl.Body = nil + pkg.emit(fun.Doc, decl) + found = true + } + // Constants and variables behave the same. + values := pkg.findValues(symbol, pkg.doc.Consts) + values = append(values, pkg.findValues(symbol, pkg.doc.Vars)...) + for _, value := range values { + // Print each spec only if there is at least one exported symbol in it. + // (See issue 11008.) + // TODO: Should we elide unexported symbols from a single spec? + // It's an unlikely scenario, probably not worth the trouble. + // TODO: Would be nice if go/doc did this for us. + specs := make([]ast.Spec, 0, len(value.Decl.Specs)) + for _, spec := range value.Decl.Specs { + vspec := spec.(*ast.ValueSpec) + for _, ident := range vspec.Names { + if isExported(ident.Name) { + specs = append(specs, vspec) + break + } + } + } + if len(specs) == 0 { + continue + } + value.Decl.Specs = specs + if !found { + pkg.packageClause(true) + } + pkg.emit(value.Doc, value.Decl) + found = true + } + // Types. + for _, typ := range pkg.findTypes(symbol) { + if !found { + pkg.packageClause(true) + } + decl := typ.Decl + spec := pkg.findTypeSpec(decl, typ.Name) + trimUnexportedElems(spec) + // If there are multiple types defined, reduce to just this one. + if len(decl.Specs) > 1 { + decl.Specs = []ast.Spec{spec} + } + pkg.emit(typ.Doc, decl) + // Show associated methods, constants, etc. + if len(typ.Consts) > 0 || len(typ.Vars) > 0 || len(typ.Funcs) > 0 || len(typ.Methods) > 0 { + pkg.Printf("\n") + } + pkg.valueSummary(typ.Consts) + pkg.valueSummary(typ.Vars) + pkg.funcSummary(typ.Funcs) + pkg.funcSummary(typ.Methods) + found = true + } + if !found { + // See if there are methods. + if !pkg.printMethodDoc("", symbol) { + log.Printf("symbol %s not present in package %s installed in %q", symbol, pkg.name, pkg.build.ImportPath) + } + } +} + +// trimUnexportedElems modifies spec in place to elide unexported fields from +// structs and methods from interfaces (unless the unexported flag is set). +func trimUnexportedElems(spec *ast.TypeSpec) { + if unexported { + return + } + switch typ := spec.Type.(type) { + case *ast.StructType: + typ.Fields = trimUnexportedFields(typ.Fields, "fields") + case *ast.InterfaceType: + typ.Methods = trimUnexportedFields(typ.Methods, "methods") + } +} + +// trimUnexportedFields returns the field list trimmed of unexported fields. +func trimUnexportedFields(fields *ast.FieldList, what string) *ast.FieldList { + trimmed := false + list := make([]*ast.Field, 0, len(fields.List)) + for _, field := range fields.List { + // Trims if any is unexported. Good enough in practice. + ok := true + for _, name := range field.Names { + if !isExported(name.Name) { + trimmed = true + ok = false + break + } + } + if ok { + list = append(list, field) + } + } + if !trimmed { + return fields + } + unexportedField := &ast.Field{ + Type: ast.NewIdent(""), // Hack: printer will treat this as a field with a named type. + Comment: &ast.CommentGroup{ + List: []*ast.Comment{ + &ast.Comment{ + Text: fmt.Sprintf("// Has unexported %s.\n", what), + }, + }, + }, + } + return &ast.FieldList{ + Opening: fields.Opening, + List: append(list, unexportedField), + Closing: fields.Closing, + } +} + +// printMethodDoc prints the docs for matches of symbol.method. +// If symbol is empty, it prints all methods that match the name. +// It reports whether it found any methods. +func (pkg *Package) printMethodDoc(symbol, method string) bool { + defer pkg.flush() + types := pkg.findTypes(symbol) + if types == nil { + if symbol == "" { + return false + } + pkg.Fatalf("symbol %s is not a type in package %s installed in %q", symbol, pkg.name, pkg.build.ImportPath) + } + found := false + for _, typ := range types { + for _, meth := range typ.Methods { + if match(method, meth.Name) { + decl := meth.Decl + decl.Body = nil + pkg.emit(meth.Doc, decl) + found = true + } + } + } + return found +} + +// methodDoc prints the docs for matches of symbol.method. +func (pkg *Package) methodDoc(symbol, method string) { + defer pkg.flush() + if !pkg.printMethodDoc(symbol, method) { + pkg.Fatalf("no method %s.%s in package %s installed in %q", symbol, method, pkg.name, pkg.build.ImportPath) + } +} + +// match reports whether the user's symbol matches the program's. +// A lower-case character in the user's string matches either case in the program's. +// The program string must be exported. +func match(user, program string) bool { + if !isExported(program) { + return false + } + if matchCase { + return user == program + } + for _, u := range user { + p, w := utf8.DecodeRuneInString(program) + program = program[w:] + if u == p { + continue + } + if unicode.IsLower(u) && simpleFold(u) == simpleFold(p) { + continue + } + return false + } + return program == "" +} + +// simpleFold returns the minimum rune equivalent to r +// under Unicode-defined simple case folding. +func simpleFold(r rune) rune { + for { + r1 := unicode.SimpleFold(r) + if r1 <= r { + return r1 // wrapped around, found min + } + r = r1 + } +} diff --git a/src/cmd/doc/testdata/pkg.go b/src/cmd/doc/testdata/pkg.go new file mode 100644 index 0000000000000000000000000000000000000000..ebefb50b2a100a7f9da470e864e0ddba4a7129ab --- /dev/null +++ b/src/cmd/doc/testdata/pkg.go @@ -0,0 +1,96 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package comment. +package pkg + +// Constants + +// Comment about exported constant. +const ExportedConstant = 1 + +// Comment about internal constant. +const internalConstant = 2 + +// Comment about block of constants. +const ( + // Comment before ConstOne. + ConstOne = 1 + ConstTwo = 2 // Comment on line with ConstTwo. + constThree = 3 // Comment on line with constThree. +) + +// Variables + +// Comment about exported variable. +var ExportedVariable = 1 + +// Comment about internal variable. +var internalVariable = 2 + +// Comment about block of variables. +var ( + // Comment before VarOne. + VarOne = 1 + VarTwo = 2 // Comment on line with VarTwo. + varThree = 3 // Comment on line with varThree. +) + +// Comment about exported function. +func ExportedFunc(a int) bool + +// Comment about internal function. +func internalFunc(a int) bool + +// Comment about exported type. +type ExportedType struct { + // Comment before exported field. + ExportedField int + unexportedField int // Comment on line with unexported field. +} + +// Comment about exported method. +func (ExportedType) ExportedMethod(a int) bool { + return true +} + +// Comment about unexported method. +func (ExportedType) unexportedMethod(a int) bool { + return true +} + +// Constants tied to ExportedType. (The type is a struct so this isn't valid Go, +// but it parses and that's all we need.) +const ( + ExportedTypedConstant ExportedType = iota +) + +// Comment about constructor for exported type. +func ExportedTypeConstructor() *ExportedType { + return nil +} + +const unexportedTypedConstant ExportedType = 1 // In a separate section to test -u. + +// Comment about unexported type. +type unexportedType int + +func (unexportedType) ExportedMethod() bool { + return true +} + +func (unexportedType) unexportedMethod() bool { + return true +} + +// Constants tied to unexportedType. +const ( + ExportedTypedConstant_unexported unexportedType = iota +) + +const unexportedTypedConstant unexportedType = 1 // In a separate section to test -u. + +// For case matching. +const CaseMatch = 1 +const Casematch = 2 diff --git a/src/cmd/fix/doc.go b/src/cmd/fix/doc.go new file mode 100644 index 0000000000000000000000000000000000000000..0570169576b62355f8cfb01cf0765abdcf4feebb --- /dev/null +++ b/src/cmd/fix/doc.go @@ -0,0 +1,36 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +/* +Fix finds Go programs that use old APIs and rewrites them to use +newer ones. After you update to a new Go release, fix helps make +the necessary changes to your programs. + +Usage: + go tool fix [-r name,...] [path ...] + +Without an explicit path, fix reads standard input and writes the +result to standard output. + +If the named path is a file, fix rewrites the named files in place. +If the named path is a directory, fix rewrites all .go files in that +directory tree. When fix rewrites a file, it prints a line to standard +error giving the name of the file and the rewrite applied. + +If the -diff flag is set, no files are rewritten. Instead fix prints +the differences a rewrite would introduce. + +The -r flag restricts the set of rewrites considered to those in the +named list. By default fix considers all known rewrites. Fix's +rewrites are idempotent, so that it is safe to apply fix to updated +or partially updated code even without using the -r flag. + +Fix prints the full list of fixes it can apply in its help output; +to see them, run go tool fix -help. + +Fix does not make backup copies of the files that it edits. +Instead, use a version control system's ``diff'' functionality to inspect +the changes that fix makes before committing them. +*/ +package main diff --git a/src/cmd/fix/fix.go b/src/cmd/fix/fix.go new file mode 100644 index 0000000000000000000000000000000000000000..160336cdbd004ff83c52e8cf552e7cd56aef3300 --- /dev/null +++ b/src/cmd/fix/fix.go @@ -0,0 +1,848 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +import ( + "fmt" + "go/ast" + "go/parser" + "go/token" + "os" + "path" + "reflect" + "strconv" + "strings" +) + +type fix struct { + name string + date string // date that fix was introduced, in YYYY-MM-DD format + f func(*ast.File) bool + desc string +} + +// main runs sort.Sort(byName(fixes)) before printing list of fixes. +type byName []fix + +func (f byName) Len() int { return len(f) } +func (f byName) Swap(i, j int) { f[i], f[j] = f[j], f[i] } +func (f byName) Less(i, j int) bool { return f[i].name < f[j].name } + +// main runs sort.Sort(byDate(fixes)) before applying fixes. +type byDate []fix + +func (f byDate) Len() int { return len(f) } +func (f byDate) Swap(i, j int) { f[i], f[j] = f[j], f[i] } +func (f byDate) Less(i, j int) bool { return f[i].date < f[j].date } + +var fixes []fix + +func register(f fix) { + fixes = append(fixes, f) +} + +// walk traverses the AST x, calling visit(y) for each node y in the tree but +// also with a pointer to each ast.Expr, ast.Stmt, and *ast.BlockStmt, +// in a bottom-up traversal. +func walk(x interface{}, visit func(interface{})) { + walkBeforeAfter(x, nop, visit) +} + +func nop(interface{}) {} + +// walkBeforeAfter is like walk but calls before(x) before traversing +// x's children and after(x) afterward. +func walkBeforeAfter(x interface{}, before, after func(interface{})) { + before(x) + + switch n := x.(type) { + default: + panic(fmt.Errorf("unexpected type %T in walkBeforeAfter", x)) + + case nil: + + // pointers to interfaces + case *ast.Decl: + walkBeforeAfter(*n, before, after) + case *ast.Expr: + walkBeforeAfter(*n, before, after) + case *ast.Spec: + walkBeforeAfter(*n, before, after) + case *ast.Stmt: + walkBeforeAfter(*n, before, after) + + // pointers to struct pointers + case **ast.BlockStmt: + walkBeforeAfter(*n, before, after) + case **ast.CallExpr: + walkBeforeAfter(*n, before, after) + case **ast.FieldList: + walkBeforeAfter(*n, before, after) + case **ast.FuncType: + walkBeforeAfter(*n, before, after) + case **ast.Ident: + walkBeforeAfter(*n, before, after) + case **ast.BasicLit: + walkBeforeAfter(*n, before, after) + + // pointers to slices + case *[]ast.Decl: + walkBeforeAfter(*n, before, after) + case *[]ast.Expr: + walkBeforeAfter(*n, before, after) + case *[]*ast.File: + walkBeforeAfter(*n, before, after) + case *[]*ast.Ident: + walkBeforeAfter(*n, before, after) + case *[]ast.Spec: + walkBeforeAfter(*n, before, after) + case *[]ast.Stmt: + walkBeforeAfter(*n, before, after) + + // These are ordered and grouped to match ../../go/ast/ast.go + case *ast.Field: + walkBeforeAfter(&n.Names, before, after) + walkBeforeAfter(&n.Type, before, after) + walkBeforeAfter(&n.Tag, before, after) + case *ast.FieldList: + for _, field := range n.List { + walkBeforeAfter(field, before, after) + } + case *ast.BadExpr: + case *ast.Ident: + case *ast.Ellipsis: + walkBeforeAfter(&n.Elt, before, after) + case *ast.BasicLit: + case *ast.FuncLit: + walkBeforeAfter(&n.Type, before, after) + walkBeforeAfter(&n.Body, before, after) + case *ast.CompositeLit: + walkBeforeAfter(&n.Type, before, after) + walkBeforeAfter(&n.Elts, before, after) + case *ast.ParenExpr: + walkBeforeAfter(&n.X, before, after) + case *ast.SelectorExpr: + walkBeforeAfter(&n.X, before, after) + case *ast.IndexExpr: + walkBeforeAfter(&n.X, before, after) + walkBeforeAfter(&n.Index, before, after) + case *ast.SliceExpr: + walkBeforeAfter(&n.X, before, after) + if n.Low != nil { + walkBeforeAfter(&n.Low, before, after) + } + if n.High != nil { + walkBeforeAfter(&n.High, before, after) + } + case *ast.TypeAssertExpr: + walkBeforeAfter(&n.X, before, after) + walkBeforeAfter(&n.Type, before, after) + case *ast.CallExpr: + walkBeforeAfter(&n.Fun, before, after) + walkBeforeAfter(&n.Args, before, after) + case *ast.StarExpr: + walkBeforeAfter(&n.X, before, after) + case *ast.UnaryExpr: + walkBeforeAfter(&n.X, before, after) + case *ast.BinaryExpr: + walkBeforeAfter(&n.X, before, after) + walkBeforeAfter(&n.Y, before, after) + case *ast.KeyValueExpr: + walkBeforeAfter(&n.Key, before, after) + walkBeforeAfter(&n.Value, before, after) + + case *ast.ArrayType: + walkBeforeAfter(&n.Len, before, after) + walkBeforeAfter(&n.Elt, before, after) + case *ast.StructType: + walkBeforeAfter(&n.Fields, before, after) + case *ast.FuncType: + walkBeforeAfter(&n.Params, before, after) + if n.Results != nil { + walkBeforeAfter(&n.Results, before, after) + } + case *ast.InterfaceType: + walkBeforeAfter(&n.Methods, before, after) + case *ast.MapType: + walkBeforeAfter(&n.Key, before, after) + walkBeforeAfter(&n.Value, before, after) + case *ast.ChanType: + walkBeforeAfter(&n.Value, before, after) + + case *ast.BadStmt: + case *ast.DeclStmt: + walkBeforeAfter(&n.Decl, before, after) + case *ast.EmptyStmt: + case *ast.LabeledStmt: + walkBeforeAfter(&n.Stmt, before, after) + case *ast.ExprStmt: + walkBeforeAfter(&n.X, before, after) + case *ast.SendStmt: + walkBeforeAfter(&n.Chan, before, after) + walkBeforeAfter(&n.Value, before, after) + case *ast.IncDecStmt: + walkBeforeAfter(&n.X, before, after) + case *ast.AssignStmt: + walkBeforeAfter(&n.Lhs, before, after) + walkBeforeAfter(&n.Rhs, before, after) + case *ast.GoStmt: + walkBeforeAfter(&n.Call, before, after) + case *ast.DeferStmt: + walkBeforeAfter(&n.Call, before, after) + case *ast.ReturnStmt: + walkBeforeAfter(&n.Results, before, after) + case *ast.BranchStmt: + case *ast.BlockStmt: + walkBeforeAfter(&n.List, before, after) + case *ast.IfStmt: + walkBeforeAfter(&n.Init, before, after) + walkBeforeAfter(&n.Cond, before, after) + walkBeforeAfter(&n.Body, before, after) + walkBeforeAfter(&n.Else, before, after) + case *ast.CaseClause: + walkBeforeAfter(&n.List, before, after) + walkBeforeAfter(&n.Body, before, after) + case *ast.SwitchStmt: + walkBeforeAfter(&n.Init, before, after) + walkBeforeAfter(&n.Tag, before, after) + walkBeforeAfter(&n.Body, before, after) + case *ast.TypeSwitchStmt: + walkBeforeAfter(&n.Init, before, after) + walkBeforeAfter(&n.Assign, before, after) + walkBeforeAfter(&n.Body, before, after) + case *ast.CommClause: + walkBeforeAfter(&n.Comm, before, after) + walkBeforeAfter(&n.Body, before, after) + case *ast.SelectStmt: + walkBeforeAfter(&n.Body, before, after) + case *ast.ForStmt: + walkBeforeAfter(&n.Init, before, after) + walkBeforeAfter(&n.Cond, before, after) + walkBeforeAfter(&n.Post, before, after) + walkBeforeAfter(&n.Body, before, after) + case *ast.RangeStmt: + walkBeforeAfter(&n.Key, before, after) + walkBeforeAfter(&n.Value, before, after) + walkBeforeAfter(&n.X, before, after) + walkBeforeAfter(&n.Body, before, after) + + case *ast.ImportSpec: + case *ast.ValueSpec: + walkBeforeAfter(&n.Type, before, after) + walkBeforeAfter(&n.Values, before, after) + walkBeforeAfter(&n.Names, before, after) + case *ast.TypeSpec: + walkBeforeAfter(&n.Type, before, after) + + case *ast.BadDecl: + case *ast.GenDecl: + walkBeforeAfter(&n.Specs, before, after) + case *ast.FuncDecl: + if n.Recv != nil { + walkBeforeAfter(&n.Recv, before, after) + } + walkBeforeAfter(&n.Type, before, after) + if n.Body != nil { + walkBeforeAfter(&n.Body, before, after) + } + + case *ast.File: + walkBeforeAfter(&n.Decls, before, after) + + case *ast.Package: + walkBeforeAfter(&n.Files, before, after) + + case []*ast.File: + for i := range n { + walkBeforeAfter(&n[i], before, after) + } + case []ast.Decl: + for i := range n { + walkBeforeAfter(&n[i], before, after) + } + case []ast.Expr: + for i := range n { + walkBeforeAfter(&n[i], before, after) + } + case []*ast.Ident: + for i := range n { + walkBeforeAfter(&n[i], before, after) + } + case []ast.Stmt: + for i := range n { + walkBeforeAfter(&n[i], before, after) + } + case []ast.Spec: + for i := range n { + walkBeforeAfter(&n[i], before, after) + } + } + after(x) +} + +// imports reports whether f imports path. +func imports(f *ast.File, path string) bool { + return importSpec(f, path) != nil +} + +// importSpec returns the import spec if f imports path, +// or nil otherwise. +func importSpec(f *ast.File, path string) *ast.ImportSpec { + for _, s := range f.Imports { + if importPath(s) == path { + return s + } + } + return nil +} + +// importPath returns the unquoted import path of s, +// or "" if the path is not properly quoted. +func importPath(s *ast.ImportSpec) string { + t, err := strconv.Unquote(s.Path.Value) + if err == nil { + return t + } + return "" +} + +// declImports reports whether gen contains an import of path. +func declImports(gen *ast.GenDecl, path string) bool { + if gen.Tok != token.IMPORT { + return false + } + for _, spec := range gen.Specs { + impspec := spec.(*ast.ImportSpec) + if importPath(impspec) == path { + return true + } + } + return false +} + +// isPkgDot reports whether t is the expression "pkg.name" +// where pkg is an imported identifier. +func isPkgDot(t ast.Expr, pkg, name string) bool { + sel, ok := t.(*ast.SelectorExpr) + return ok && isTopName(sel.X, pkg) && sel.Sel.String() == name +} + +// isPtrPkgDot reports whether f is the expression "*pkg.name" +// where pkg is an imported identifier. +func isPtrPkgDot(t ast.Expr, pkg, name string) bool { + ptr, ok := t.(*ast.StarExpr) + return ok && isPkgDot(ptr.X, pkg, name) +} + +// isTopName reports whether n is a top-level unresolved identifier with the given name. +func isTopName(n ast.Expr, name string) bool { + id, ok := n.(*ast.Ident) + return ok && id.Name == name && id.Obj == nil +} + +// isName reports whether n is an identifier with the given name. +func isName(n ast.Expr, name string) bool { + id, ok := n.(*ast.Ident) + return ok && id.String() == name +} + +// isCall reports whether t is a call to pkg.name. +func isCall(t ast.Expr, pkg, name string) bool { + call, ok := t.(*ast.CallExpr) + return ok && isPkgDot(call.Fun, pkg, name) +} + +// If n is an *ast.Ident, isIdent returns it; otherwise isIdent returns nil. +func isIdent(n interface{}) *ast.Ident { + id, _ := n.(*ast.Ident) + return id +} + +// refersTo reports whether n is a reference to the same object as x. +func refersTo(n ast.Node, x *ast.Ident) bool { + id, ok := n.(*ast.Ident) + // The test of id.Name == x.Name handles top-level unresolved + // identifiers, which all have Obj == nil. + return ok && id.Obj == x.Obj && id.Name == x.Name +} + +// isBlank reports whether n is the blank identifier. +func isBlank(n ast.Expr) bool { + return isName(n, "_") +} + +// isEmptyString reports whether n is an empty string literal. +func isEmptyString(n ast.Expr) bool { + lit, ok := n.(*ast.BasicLit) + return ok && lit.Kind == token.STRING && len(lit.Value) == 2 +} + +func warn(pos token.Pos, msg string, args ...interface{}) { + if pos.IsValid() { + msg = "%s: " + msg + arg1 := []interface{}{fset.Position(pos).String()} + args = append(arg1, args...) + } + fmt.Fprintf(os.Stderr, msg+"\n", args...) +} + +// countUses returns the number of uses of the identifier x in scope. +func countUses(x *ast.Ident, scope []ast.Stmt) int { + count := 0 + ff := func(n interface{}) { + if n, ok := n.(ast.Node); ok && refersTo(n, x) { + count++ + } + } + for _, n := range scope { + walk(n, ff) + } + return count +} + +// rewriteUses replaces all uses of the identifier x and !x in scope +// with f(x.Pos()) and fnot(x.Pos()). +func rewriteUses(x *ast.Ident, f, fnot func(token.Pos) ast.Expr, scope []ast.Stmt) { + var lastF ast.Expr + ff := func(n interface{}) { + ptr, ok := n.(*ast.Expr) + if !ok { + return + } + nn := *ptr + + // The child node was just walked and possibly replaced. + // If it was replaced and this is a negation, replace with fnot(p). + not, ok := nn.(*ast.UnaryExpr) + if ok && not.Op == token.NOT && not.X == lastF { + *ptr = fnot(nn.Pos()) + return + } + if refersTo(nn, x) { + lastF = f(nn.Pos()) + *ptr = lastF + } + } + for _, n := range scope { + walk(n, ff) + } +} + +// assignsTo reports whether any of the code in scope assigns to or takes the address of x. +func assignsTo(x *ast.Ident, scope []ast.Stmt) bool { + assigned := false + ff := func(n interface{}) { + if assigned { + return + } + switch n := n.(type) { + case *ast.UnaryExpr: + // use of &x + if n.Op == token.AND && refersTo(n.X, x) { + assigned = true + return + } + case *ast.AssignStmt: + for _, l := range n.Lhs { + if refersTo(l, x) { + assigned = true + return + } + } + } + } + for _, n := range scope { + if assigned { + break + } + walk(n, ff) + } + return assigned +} + +// newPkgDot returns an ast.Expr referring to "pkg.name" at position pos. +func newPkgDot(pos token.Pos, pkg, name string) ast.Expr { + return &ast.SelectorExpr{ + X: &ast.Ident{ + NamePos: pos, + Name: pkg, + }, + Sel: &ast.Ident{ + NamePos: pos, + Name: name, + }, + } +} + +// renameTop renames all references to the top-level name old. +// It returns true if it makes any changes. +func renameTop(f *ast.File, old, new string) bool { + var fixed bool + + // Rename any conflicting imports + // (assuming package name is last element of path). + for _, s := range f.Imports { + if s.Name != nil { + if s.Name.Name == old { + s.Name.Name = new + fixed = true + } + } else { + _, thisName := path.Split(importPath(s)) + if thisName == old { + s.Name = ast.NewIdent(new) + fixed = true + } + } + } + + // Rename any top-level declarations. + for _, d := range f.Decls { + switch d := d.(type) { + case *ast.FuncDecl: + if d.Recv == nil && d.Name.Name == old { + d.Name.Name = new + d.Name.Obj.Name = new + fixed = true + } + case *ast.GenDecl: + for _, s := range d.Specs { + switch s := s.(type) { + case *ast.TypeSpec: + if s.Name.Name == old { + s.Name.Name = new + s.Name.Obj.Name = new + fixed = true + } + case *ast.ValueSpec: + for _, n := range s.Names { + if n.Name == old { + n.Name = new + n.Obj.Name = new + fixed = true + } + } + } + } + } + } + + // Rename top-level old to new, both unresolved names + // (probably defined in another file) and names that resolve + // to a declaration we renamed. + walk(f, func(n interface{}) { + id, ok := n.(*ast.Ident) + if ok && isTopName(id, old) { + id.Name = new + fixed = true + } + if ok && id.Obj != nil && id.Name == old && id.Obj.Name == new { + id.Name = id.Obj.Name + fixed = true + } + }) + + return fixed +} + +// matchLen returns the length of the longest prefix shared by x and y. +func matchLen(x, y string) int { + i := 0 + for i < len(x) && i < len(y) && x[i] == y[i] { + i++ + } + return i +} + +// addImport adds the import path to the file f, if absent. +func addImport(f *ast.File, ipath string) (added bool) { + if imports(f, ipath) { + return false + } + + // Determine name of import. + // Assume added imports follow convention of using last element. + _, name := path.Split(ipath) + + // Rename any conflicting top-level references from name to name_. + renameTop(f, name, name+"_") + + newImport := &ast.ImportSpec{ + Path: &ast.BasicLit{ + Kind: token.STRING, + Value: strconv.Quote(ipath), + }, + } + + // Find an import decl to add to. + var ( + bestMatch = -1 + lastImport = -1 + impDecl *ast.GenDecl + impIndex = -1 + ) + for i, decl := range f.Decls { + gen, ok := decl.(*ast.GenDecl) + if ok && gen.Tok == token.IMPORT { + lastImport = i + // Do not add to import "C", to avoid disrupting the + // association with its doc comment, breaking cgo. + if declImports(gen, "C") { + continue + } + + // Compute longest shared prefix with imports in this block. + for j, spec := range gen.Specs { + impspec := spec.(*ast.ImportSpec) + n := matchLen(importPath(impspec), ipath) + if n > bestMatch { + bestMatch = n + impDecl = gen + impIndex = j + } + } + } + } + + // If no import decl found, add one after the last import. + if impDecl == nil { + impDecl = &ast.GenDecl{ + Tok: token.IMPORT, + } + f.Decls = append(f.Decls, nil) + copy(f.Decls[lastImport+2:], f.Decls[lastImport+1:]) + f.Decls[lastImport+1] = impDecl + } + + // Ensure the import decl has parentheses, if needed. + if len(impDecl.Specs) > 0 && !impDecl.Lparen.IsValid() { + impDecl.Lparen = impDecl.Pos() + } + + insertAt := impIndex + 1 + if insertAt == 0 { + insertAt = len(impDecl.Specs) + } + impDecl.Specs = append(impDecl.Specs, nil) + copy(impDecl.Specs[insertAt+1:], impDecl.Specs[insertAt:]) + impDecl.Specs[insertAt] = newImport + if insertAt > 0 { + // Assign same position as the previous import, + // so that the sorter sees it as being in the same block. + prev := impDecl.Specs[insertAt-1] + newImport.Path.ValuePos = prev.Pos() + newImport.EndPos = prev.Pos() + } + + f.Imports = append(f.Imports, newImport) + return true +} + +// deleteImport deletes the import path from the file f, if present. +func deleteImport(f *ast.File, path string) (deleted bool) { + oldImport := importSpec(f, path) + + // Find the import node that imports path, if any. + for i, decl := range f.Decls { + gen, ok := decl.(*ast.GenDecl) + if !ok || gen.Tok != token.IMPORT { + continue + } + for j, spec := range gen.Specs { + impspec := spec.(*ast.ImportSpec) + if oldImport != impspec { + continue + } + + // We found an import spec that imports path. + // Delete it. + deleted = true + copy(gen.Specs[j:], gen.Specs[j+1:]) + gen.Specs = gen.Specs[:len(gen.Specs)-1] + + // If this was the last import spec in this decl, + // delete the decl, too. + if len(gen.Specs) == 0 { + copy(f.Decls[i:], f.Decls[i+1:]) + f.Decls = f.Decls[:len(f.Decls)-1] + } else if len(gen.Specs) == 1 { + gen.Lparen = token.NoPos // drop parens + } + if j > 0 { + // We deleted an entry but now there will be + // a blank line-sized hole where the import was. + // Close the hole by making the previous + // import appear to "end" where this one did. + gen.Specs[j-1].(*ast.ImportSpec).EndPos = impspec.End() + } + break + } + } + + // Delete it from f.Imports. + for i, imp := range f.Imports { + if imp == oldImport { + copy(f.Imports[i:], f.Imports[i+1:]) + f.Imports = f.Imports[:len(f.Imports)-1] + break + } + } + + return +} + +// rewriteImport rewrites any import of path oldPath to path newPath. +func rewriteImport(f *ast.File, oldPath, newPath string) (rewrote bool) { + for _, imp := range f.Imports { + if importPath(imp) == oldPath { + rewrote = true + // record old End, because the default is to compute + // it using the length of imp.Path.Value. + imp.EndPos = imp.End() + imp.Path.Value = strconv.Quote(newPath) + } + } + return +} + +func usesImport(f *ast.File, path string) (used bool) { + spec := importSpec(f, path) + if spec == nil { + return + } + + name := spec.Name.String() + switch name { + case "": + // If the package name is not explicitly specified, + // make an educated guess. This is not guaranteed to be correct. + lastSlash := strings.LastIndex(path, "/") + if lastSlash == -1 { + name = path + } else { + name = path[lastSlash+1:] + } + case "_", ".": + // Not sure if this import is used - err on the side of caution. + return true + } + + walk(f, func(n interface{}) { + sel, ok := n.(*ast.SelectorExpr) + if ok && isTopName(sel.X, name) { + used = true + } + }) + + return +} + +func expr(s string) ast.Expr { + x, err := parser.ParseExpr(s) + if err != nil { + panic("parsing " + s + ": " + err.Error()) + } + // Remove position information to avoid spurious newlines. + killPos(reflect.ValueOf(x)) + return x +} + +var posType = reflect.TypeOf(token.Pos(0)) + +func killPos(v reflect.Value) { + switch v.Kind() { + case reflect.Ptr, reflect.Interface: + if !v.IsNil() { + killPos(v.Elem()) + } + case reflect.Slice: + n := v.Len() + for i := 0; i < n; i++ { + killPos(v.Index(i)) + } + case reflect.Struct: + n := v.NumField() + for i := 0; i < n; i++ { + f := v.Field(i) + if f.Type() == posType { + f.SetInt(0) + continue + } + killPos(f) + } + } +} + +// A Rename describes a single renaming. +type rename struct { + OldImport string // only apply rename if this import is present + NewImport string // add this import during rewrite + Old string // old name: p.T or *p.T + New string // new name: p.T or *p.T +} + +func renameFix(tab []rename) func(*ast.File) bool { + return func(f *ast.File) bool { + return renameFixTab(f, tab) + } +} + +func parseName(s string) (ptr bool, pkg, nam string) { + i := strings.Index(s, ".") + if i < 0 { + panic("parseName: invalid name " + s) + } + if strings.HasPrefix(s, "*") { + ptr = true + s = s[1:] + i-- + } + pkg = s[:i] + nam = s[i+1:] + return +} + +func renameFixTab(f *ast.File, tab []rename) bool { + fixed := false + added := map[string]bool{} + check := map[string]bool{} + for _, t := range tab { + if !imports(f, t.OldImport) { + continue + } + optr, opkg, onam := parseName(t.Old) + walk(f, func(n interface{}) { + np, ok := n.(*ast.Expr) + if !ok { + return + } + x := *np + if optr { + p, ok := x.(*ast.StarExpr) + if !ok { + return + } + x = p.X + } + if !isPkgDot(x, opkg, onam) { + return + } + if t.NewImport != "" && !added[t.NewImport] { + addImport(f, t.NewImport) + added[t.NewImport] = true + } + *np = expr(t.New) + check[t.OldImport] = true + fixed = true + }) + } + + for ipath := range check { + if !usesImport(f, ipath) { + deleteImport(f, ipath) + } + } + return fixed +} diff --git a/src/cmd/fix/gotypes.go b/src/cmd/fix/gotypes.go new file mode 100644 index 0000000000000000000000000000000000000000..8c7b46674a00bbad4713ecff71f5576ea34e145a --- /dev/null +++ b/src/cmd/fix/gotypes.go @@ -0,0 +1,75 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +import ( + "go/ast" + "strconv" +) + +func init() { + register(gotypesFix) +} + +var gotypesFix = fix{ + "gotypes", + "2015-07-16", + gotypes, + `Change imports of golang.org/x/tools/go/{exact,types} to go/{constant,types}`, +} + +func gotypes(f *ast.File) bool { + truth := fixGoTypes(f) + if fixGoExact(f) { + truth = true + } + return truth +} + +func fixGoTypes(f *ast.File) bool { + return rewriteImport(f, "golang.org/x/tools/go/types", "go/types") +} + +func fixGoExact(f *ast.File) bool { + // This one is harder because the import name changes. + // First find the import spec. + var importSpec *ast.ImportSpec + walk(f, func(n interface{}) { + if importSpec != nil { + return + } + spec, ok := n.(*ast.ImportSpec) + if !ok { + return + } + path, err := strconv.Unquote(spec.Path.Value) + if err != nil { + return + } + if path == "golang.org/x/tools/go/exact" { + importSpec = spec + } + + }) + if importSpec == nil { + return false + } + + // We are about to rename exact.* to constant.*, but constant is a common + // name. See if it will conflict. This is a hack but it is effective. + exists := renameTop(f, "constant", "constant") + suffix := "" + if exists { + suffix = "_" + } + // Now we need to rename all the uses of the import. RewriteImport + // affects renameTop, but not vice versa, so do them in this order. + renameTop(f, "exact", "constant"+suffix) + rewriteImport(f, "golang.org/x/tools/go/exact", "go/constant") + // renameTop will also rewrite the imported package name. Fix that; + // we know it should be missing. + importSpec.Name = nil + return true +} diff --git a/src/cmd/fix/gotypes_test.go b/src/cmd/fix/gotypes_test.go new file mode 100644 index 0000000000000000000000000000000000000000..1ecb7a22223b7a3f79d8f9f7a7e6f34db9bc841c --- /dev/null +++ b/src/cmd/fix/gotypes_test.go @@ -0,0 +1,89 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +func init() { + addTestCases(gotypesTests, gotypes) +} + +var gotypesTests = []testCase{ + { + Name: "gotypes.0", + In: `package main + +import "golang.org/x/tools/go/types" +import "golang.org/x/tools/go/exact" + +var _ = exact.Kind + +func f() { + _ = exact.MakeBool(true) +} +`, + Out: `package main + +import "go/types" +import "go/constant" + +var _ = constant.Kind + +func f() { + _ = constant.MakeBool(true) +} +`, + }, + { + Name: "gotypes.1", + In: `package main + +import "golang.org/x/tools/go/types" +import foo "golang.org/x/tools/go/exact" + +var _ = foo.Kind + +func f() { + _ = foo.MakeBool(true) +} +`, + Out: `package main + +import "go/types" +import "go/constant" + +var _ = foo.Kind + +func f() { + _ = foo.MakeBool(true) +} +`, + }, + { + Name: "gotypes.0", + In: `package main + +import "golang.org/x/tools/go/types" +import "golang.org/x/tools/go/exact" + +var _ = exact.Kind +var constant = 23 // Use of new package name. + +func f() { + _ = exact.MakeBool(true) +} +`, + Out: `package main + +import "go/types" +import "go/constant" + +var _ = constant_.Kind +var constant = 23 // Use of new package name. + +func f() { + _ = constant_.MakeBool(true) +} +`, + }, +} diff --git a/src/cmd/fix/import_test.go b/src/cmd/fix/import_test.go new file mode 100644 index 0000000000000000000000000000000000000000..73011920588687513a72dbb2092456f7b3c24eae --- /dev/null +++ b/src/cmd/fix/import_test.go @@ -0,0 +1,458 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +import "go/ast" + +func init() { + addTestCases(importTests, nil) +} + +var importTests = []testCase{ + { + Name: "import.0", + Fn: addImportFn("os"), + In: `package main + +import ( + "os" +) +`, + Out: `package main + +import ( + "os" +) +`, + }, + { + Name: "import.1", + Fn: addImportFn("os"), + In: `package main +`, + Out: `package main + +import "os" +`, + }, + { + Name: "import.2", + Fn: addImportFn("os"), + In: `package main + +// Comment +import "C" +`, + Out: `package main + +// Comment +import "C" +import "os" +`, + }, + { + Name: "import.3", + Fn: addImportFn("os"), + In: `package main + +// Comment +import "C" + +import ( + "io" + "utf8" +) +`, + Out: `package main + +// Comment +import "C" + +import ( + "io" + "os" + "utf8" +) +`, + }, + { + Name: "import.4", + Fn: deleteImportFn("os"), + In: `package main + +import ( + "os" +) +`, + Out: `package main +`, + }, + { + Name: "import.5", + Fn: deleteImportFn("os"), + In: `package main + +// Comment +import "C" +import "os" +`, + Out: `package main + +// Comment +import "C" +`, + }, + { + Name: "import.6", + Fn: deleteImportFn("os"), + In: `package main + +// Comment +import "C" + +import ( + "io" + "os" + "utf8" +) +`, + Out: `package main + +// Comment +import "C" + +import ( + "io" + "utf8" +) +`, + }, + { + Name: "import.7", + Fn: deleteImportFn("io"), + In: `package main + +import ( + "io" // a + "os" // b + "utf8" // c +) +`, + Out: `package main + +import ( + // a + "os" // b + "utf8" // c +) +`, + }, + { + Name: "import.8", + Fn: deleteImportFn("os"), + In: `package main + +import ( + "io" // a + "os" // b + "utf8" // c +) +`, + Out: `package main + +import ( + "io" // a + // b + "utf8" // c +) +`, + }, + { + Name: "import.9", + Fn: deleteImportFn("utf8"), + In: `package main + +import ( + "io" // a + "os" // b + "utf8" // c +) +`, + Out: `package main + +import ( + "io" // a + "os" // b + // c +) +`, + }, + { + Name: "import.10", + Fn: deleteImportFn("io"), + In: `package main + +import ( + "io" + "os" + "utf8" +) +`, + Out: `package main + +import ( + "os" + "utf8" +) +`, + }, + { + Name: "import.11", + Fn: deleteImportFn("os"), + In: `package main + +import ( + "io" + "os" + "utf8" +) +`, + Out: `package main + +import ( + "io" + "utf8" +) +`, + }, + { + Name: "import.12", + Fn: deleteImportFn("utf8"), + In: `package main + +import ( + "io" + "os" + "utf8" +) +`, + Out: `package main + +import ( + "io" + "os" +) +`, + }, + { + Name: "import.13", + Fn: rewriteImportFn("utf8", "encoding/utf8"), + In: `package main + +import ( + "io" + "os" + "utf8" // thanks ken +) +`, + Out: `package main + +import ( + "encoding/utf8" // thanks ken + "io" + "os" +) +`, + }, + { + Name: "import.14", + Fn: rewriteImportFn("asn1", "encoding/asn1"), + In: `package main + +import ( + "asn1" + "crypto" + "crypto/rsa" + _ "crypto/sha1" + "crypto/x509" + "crypto/x509/pkix" + "time" +) + +var x = 1 +`, + Out: `package main + +import ( + "crypto" + "crypto/rsa" + _ "crypto/sha1" + "crypto/x509" + "crypto/x509/pkix" + "encoding/asn1" + "time" +) + +var x = 1 +`, + }, + { + Name: "import.15", + Fn: rewriteImportFn("url", "net/url"), + In: `package main + +import ( + "bufio" + "net" + "path" + "url" +) + +var x = 1 // comment on x, not on url +`, + Out: `package main + +import ( + "bufio" + "net" + "net/url" + "path" +) + +var x = 1 // comment on x, not on url +`, + }, + { + Name: "import.16", + Fn: rewriteImportFn("http", "net/http", "template", "text/template"), + In: `package main + +import ( + "flag" + "http" + "log" + "template" +) + +var addr = flag.String("addr", ":1718", "http service address") // Q=17, R=18 +`, + Out: `package main + +import ( + "flag" + "log" + "net/http" + "text/template" +) + +var addr = flag.String("addr", ":1718", "http service address") // Q=17, R=18 +`, + }, + { + Name: "import.17", + Fn: addImportFn("x/y/z", "x/a/c"), + In: `package main + +// Comment +import "C" + +import ( + "a" + "b" + + "x/w" + + "d/f" +) +`, + Out: `package main + +// Comment +import "C" + +import ( + "a" + "b" + + "x/a/c" + "x/w" + "x/y/z" + + "d/f" +) +`, + }, + { + Name: "import.18", + Fn: addDelImportFn("e", "o"), + In: `package main + +import ( + "f" + "o" + "z" +) +`, + Out: `package main + +import ( + "e" + "f" + "z" +) +`, + }, +} + +func addImportFn(path ...string) func(*ast.File) bool { + return func(f *ast.File) bool { + fixed := false + for _, p := range path { + if !imports(f, p) { + addImport(f, p) + fixed = true + } + } + return fixed + } +} + +func deleteImportFn(path string) func(*ast.File) bool { + return func(f *ast.File) bool { + if imports(f, path) { + deleteImport(f, path) + return true + } + return false + } +} + +func addDelImportFn(p1 string, p2 string) func(*ast.File) bool { + return func(f *ast.File) bool { + fixed := false + if !imports(f, p1) { + addImport(f, p1) + fixed = true + } + if imports(f, p2) { + deleteImport(f, p2) + fixed = true + } + return fixed + } +} + +func rewriteImportFn(oldnew ...string) func(*ast.File) bool { + return func(f *ast.File) bool { + fixed := false + for i := 0; i < len(oldnew); i += 2 { + if imports(f, oldnew[i]) { + rewriteImport(f, oldnew[i], oldnew[i+1]) + fixed = true + } + } + return fixed + } +} diff --git a/src/cmd/fix/main.go b/src/cmd/fix/main.go new file mode 100644 index 0000000000000000000000000000000000000000..dc10d6beb526d892d3dec26c20063b3732208462 --- /dev/null +++ b/src/cmd/fix/main.go @@ -0,0 +1,258 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +import ( + "bytes" + "flag" + "fmt" + "go/ast" + "go/format" + "go/parser" + "go/scanner" + "go/token" + "io/ioutil" + "os" + "os/exec" + "path/filepath" + "sort" + "strings" +) + +var ( + fset = token.NewFileSet() + exitCode = 0 +) + +var allowedRewrites = flag.String("r", "", + "restrict the rewrites to this comma-separated list") + +var forceRewrites = flag.String("force", "", + "force these fixes to run even if the code looks updated") + +var allowed, force map[string]bool + +var doDiff = flag.Bool("diff", false, "display diffs instead of rewriting files") + +// enable for debugging fix failures +const debug = false // display incorrectly reformatted source and exit + +func usage() { + fmt.Fprintf(os.Stderr, "usage: go tool fix [-diff] [-r fixname,...] [-force fixname,...] [path ...]\n") + flag.PrintDefaults() + fmt.Fprintf(os.Stderr, "\nAvailable rewrites are:\n") + sort.Sort(byName(fixes)) + for _, f := range fixes { + fmt.Fprintf(os.Stderr, "\n%s\n", f.name) + desc := strings.TrimSpace(f.desc) + desc = strings.Replace(desc, "\n", "\n\t", -1) + fmt.Fprintf(os.Stderr, "\t%s\n", desc) + } + os.Exit(2) +} + +func main() { + flag.Usage = usage + flag.Parse() + + sort.Sort(byDate(fixes)) + + if *allowedRewrites != "" { + allowed = make(map[string]bool) + for _, f := range strings.Split(*allowedRewrites, ",") { + allowed[f] = true + } + } + + if *forceRewrites != "" { + force = make(map[string]bool) + for _, f := range strings.Split(*forceRewrites, ",") { + force[f] = true + } + } + + if flag.NArg() == 0 { + if err := processFile("standard input", true); err != nil { + report(err) + } + os.Exit(exitCode) + } + + for i := 0; i < flag.NArg(); i++ { + path := flag.Arg(i) + switch dir, err := os.Stat(path); { + case err != nil: + report(err) + case dir.IsDir(): + walkDir(path) + default: + if err := processFile(path, false); err != nil { + report(err) + } + } + } + + os.Exit(exitCode) +} + +const parserMode = parser.ParseComments + +func gofmtFile(f *ast.File) ([]byte, error) { + var buf bytes.Buffer + if err := format.Node(&buf, fset, f); err != nil { + return nil, err + } + return buf.Bytes(), nil +} + +func processFile(filename string, useStdin bool) error { + var f *os.File + var err error + var fixlog bytes.Buffer + + if useStdin { + f = os.Stdin + } else { + f, err = os.Open(filename) + if err != nil { + return err + } + defer f.Close() + } + + src, err := ioutil.ReadAll(f) + if err != nil { + return err + } + + file, err := parser.ParseFile(fset, filename, src, parserMode) + if err != nil { + return err + } + + // Apply all fixes to file. + newFile := file + fixed := false + for _, fix := range fixes { + if allowed != nil && !allowed[fix.name] { + continue + } + if fix.f(newFile) { + fixed = true + fmt.Fprintf(&fixlog, " %s", fix.name) + + // AST changed. + // Print and parse, to update any missing scoping + // or position information for subsequent fixers. + newSrc, err := gofmtFile(newFile) + if err != nil { + return err + } + newFile, err = parser.ParseFile(fset, filename, newSrc, parserMode) + if err != nil { + if debug { + fmt.Printf("%s", newSrc) + report(err) + os.Exit(exitCode) + } + return err + } + } + } + if !fixed { + return nil + } + fmt.Fprintf(os.Stderr, "%s: fixed %s\n", filename, fixlog.String()[1:]) + + // Print AST. We did that after each fix, so this appears + // redundant, but it is necessary to generate gofmt-compatible + // source code in a few cases. The official gofmt style is the + // output of the printer run on a standard AST generated by the parser, + // but the source we generated inside the loop above is the + // output of the printer run on a mangled AST generated by a fixer. + newSrc, err := gofmtFile(newFile) + if err != nil { + return err + } + + if *doDiff { + data, err := diff(src, newSrc) + if err != nil { + return fmt.Errorf("computing diff: %s", err) + } + fmt.Printf("diff %s fixed/%s\n", filename, filename) + os.Stdout.Write(data) + return nil + } + + if useStdin { + os.Stdout.Write(newSrc) + return nil + } + + return ioutil.WriteFile(f.Name(), newSrc, 0) +} + +var gofmtBuf bytes.Buffer + +func gofmt(n interface{}) string { + gofmtBuf.Reset() + if err := format.Node(&gofmtBuf, fset, n); err != nil { + return "<" + err.Error() + ">" + } + return gofmtBuf.String() +} + +func report(err error) { + scanner.PrintError(os.Stderr, err) + exitCode = 2 +} + +func walkDir(path string) { + filepath.Walk(path, visitFile) +} + +func visitFile(path string, f os.FileInfo, err error) error { + if err == nil && isGoFile(f) { + err = processFile(path, false) + } + if err != nil { + report(err) + } + return nil +} + +func isGoFile(f os.FileInfo) bool { + // ignore non-Go files + name := f.Name() + return !f.IsDir() && !strings.HasPrefix(name, ".") && strings.HasSuffix(name, ".go") +} + +func diff(b1, b2 []byte) (data []byte, err error) { + f1, err := ioutil.TempFile("", "go-fix") + if err != nil { + return nil, err + } + defer os.Remove(f1.Name()) + defer f1.Close() + + f2, err := ioutil.TempFile("", "go-fix") + if err != nil { + return nil, err + } + defer os.Remove(f2.Name()) + defer f2.Close() + + f1.Write(b1) + f2.Write(b2) + + data, err = exec.Command("diff", "-u", f1.Name(), f2.Name()).CombinedOutput() + if len(data) > 0 { + // diff exits with a non-zero status when the files don't match. + // Ignore that failure as long as we get output. + err = nil + } + return +} diff --git a/src/cmd/fix/main_test.go b/src/cmd/fix/main_test.go new file mode 100644 index 0000000000000000000000000000000000000000..2151bf29e125068681c7f427a3413dd0d92329a4 --- /dev/null +++ b/src/cmd/fix/main_test.go @@ -0,0 +1,129 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +import ( + "go/ast" + "go/parser" + "strings" + "testing" +) + +type testCase struct { + Name string + Fn func(*ast.File) bool + In string + Out string +} + +var testCases []testCase + +func addTestCases(t []testCase, fn func(*ast.File) bool) { + // Fill in fn to avoid repetition in definitions. + if fn != nil { + for i := range t { + if t[i].Fn == nil { + t[i].Fn = fn + } + } + } + testCases = append(testCases, t...) +} + +func fnop(*ast.File) bool { return false } + +func parseFixPrint(t *testing.T, fn func(*ast.File) bool, desc, in string, mustBeGofmt bool) (out string, fixed, ok bool) { + file, err := parser.ParseFile(fset, desc, in, parserMode) + if err != nil { + t.Errorf("%s: parsing: %v", desc, err) + return + } + + outb, err := gofmtFile(file) + if err != nil { + t.Errorf("%s: printing: %v", desc, err) + return + } + if s := string(outb); in != s && mustBeGofmt { + t.Errorf("%s: not gofmt-formatted.\n--- %s\n%s\n--- %s | gofmt\n%s", + desc, desc, in, desc, s) + tdiff(t, in, s) + return + } + + if fn == nil { + for _, fix := range fixes { + if fix.f(file) { + fixed = true + } + } + } else { + fixed = fn(file) + } + + outb, err = gofmtFile(file) + if err != nil { + t.Errorf("%s: printing: %v", desc, err) + return + } + + return string(outb), fixed, true +} + +func TestRewrite(t *testing.T) { + for _, tt := range testCases { + // Apply fix: should get tt.Out. + out, fixed, ok := parseFixPrint(t, tt.Fn, tt.Name, tt.In, true) + if !ok { + continue + } + + // reformat to get printing right + out, _, ok = parseFixPrint(t, fnop, tt.Name, out, false) + if !ok { + continue + } + + if out != tt.Out { + t.Errorf("%s: incorrect output.\n", tt.Name) + if !strings.HasPrefix(tt.Name, "testdata/") { + t.Errorf("--- have\n%s\n--- want\n%s", out, tt.Out) + } + tdiff(t, out, tt.Out) + continue + } + + if changed := out != tt.In; changed != fixed { + t.Errorf("%s: changed=%v != fixed=%v", tt.Name, changed, fixed) + continue + } + + // Should not change if run again. + out2, fixed2, ok := parseFixPrint(t, tt.Fn, tt.Name+" output", out, true) + if !ok { + continue + } + + if fixed2 { + t.Errorf("%s: applied fixes during second round", tt.Name) + continue + } + + if out2 != out { + t.Errorf("%s: changed output after second round of fixes.\n--- output after first round\n%s\n--- output after second round\n%s", + tt.Name, out, out2) + tdiff(t, out, out2) + } + } +} + +func tdiff(t *testing.T, a, b string) { + data, err := diff([]byte(a), []byte(b)) + if err != nil { + t.Error(err) + return + } + t.Error(string(data)) +} diff --git a/src/cmd/fix/netipv6zone.go b/src/cmd/fix/netipv6zone.go new file mode 100644 index 0000000000000000000000000000000000000000..195c218074ecf983b4252f6769a102044018995e --- /dev/null +++ b/src/cmd/fix/netipv6zone.go @@ -0,0 +1,68 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +import "go/ast" + +func init() { + register(netipv6zoneFix) +} + +var netipv6zoneFix = fix{ + "netipv6zone", + "2012-11-26", + netipv6zone, + `Adapt element key to IPAddr, UDPAddr or TCPAddr composite literals. + +https://codereview.appspot.com/6849045/ +`, +} + +func netipv6zone(f *ast.File) bool { + if !imports(f, "net") { + return false + } + + fixed := false + walk(f, func(n interface{}) { + cl, ok := n.(*ast.CompositeLit) + if !ok { + return + } + se, ok := cl.Type.(*ast.SelectorExpr) + if !ok { + return + } + if !isTopName(se.X, "net") || se.Sel == nil { + return + } + switch ss := se.Sel.String(); ss { + case "IPAddr", "UDPAddr", "TCPAddr": + for i, e := range cl.Elts { + if _, ok := e.(*ast.KeyValueExpr); ok { + break + } + switch i { + case 0: + cl.Elts[i] = &ast.KeyValueExpr{ + Key: ast.NewIdent("IP"), + Value: e, + } + case 1: + if elit, ok := e.(*ast.BasicLit); ok && elit.Value == "0" { + cl.Elts = append(cl.Elts[:i], cl.Elts[i+1:]...) + } else { + cl.Elts[i] = &ast.KeyValueExpr{ + Key: ast.NewIdent("Port"), + Value: e, + } + } + } + fixed = true + } + } + }) + return fixed +} diff --git a/src/cmd/fix/netipv6zone_test.go b/src/cmd/fix/netipv6zone_test.go new file mode 100644 index 0000000000000000000000000000000000000000..142880a12a7242f8a584f29d33c16104bb4aed07 --- /dev/null +++ b/src/cmd/fix/netipv6zone_test.go @@ -0,0 +1,43 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +func init() { + addTestCases(netipv6zoneTests, netipv6zone) +} + +var netipv6zoneTests = []testCase{ + { + Name: "netipv6zone.0", + In: `package main + +import "net" + +func f() net.Addr { + a := &net.IPAddr{ip1} + sub(&net.UDPAddr{ip2, 12345}) + c := &net.TCPAddr{IP: ip3, Port: 54321} + d := &net.TCPAddr{ip4, 0} + p := 1234 + e := &net.TCPAddr{ip4, p} + return &net.TCPAddr{ip5}, nil +} +`, + Out: `package main + +import "net" + +func f() net.Addr { + a := &net.IPAddr{IP: ip1} + sub(&net.UDPAddr{IP: ip2, Port: 12345}) + c := &net.TCPAddr{IP: ip3, Port: 54321} + d := &net.TCPAddr{IP: ip4} + p := 1234 + e := &net.TCPAddr{IP: ip4, Port: p} + return &net.TCPAddr{IP: ip5}, nil +} +`, + }, +} diff --git a/src/cmd/fix/printerconfig.go b/src/cmd/fix/printerconfig.go new file mode 100644 index 0000000000000000000000000000000000000000..432e18bb263bcfd51575ee2fc56937c05c879a3f --- /dev/null +++ b/src/cmd/fix/printerconfig.go @@ -0,0 +1,61 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +import "go/ast" + +func init() { + register(printerconfigFix) +} + +var printerconfigFix = fix{ + "printerconfig", + "2012-12-11", + printerconfig, + `Add element keys to Config composite literals.`, +} + +func printerconfig(f *ast.File) bool { + if !imports(f, "go/printer") { + return false + } + + fixed := false + walk(f, func(n interface{}) { + cl, ok := n.(*ast.CompositeLit) + if !ok { + return + } + se, ok := cl.Type.(*ast.SelectorExpr) + if !ok { + return + } + if !isTopName(se.X, "printer") || se.Sel == nil { + return + } + + if ss := se.Sel.String(); ss == "Config" { + for i, e := range cl.Elts { + if _, ok := e.(*ast.KeyValueExpr); ok { + break + } + switch i { + case 0: + cl.Elts[i] = &ast.KeyValueExpr{ + Key: ast.NewIdent("Mode"), + Value: e, + } + case 1: + cl.Elts[i] = &ast.KeyValueExpr{ + Key: ast.NewIdent("Tabwidth"), + Value: e, + } + } + fixed = true + } + } + }) + return fixed +} diff --git a/src/cmd/fix/printerconfig_test.go b/src/cmd/fix/printerconfig_test.go new file mode 100644 index 0000000000000000000000000000000000000000..72e2bdcacb6ea2b84ac35f7ffa678908cb50e530 --- /dev/null +++ b/src/cmd/fix/printerconfig_test.go @@ -0,0 +1,37 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +func init() { + addTestCases(printerconfigTests, printerconfig) +} + +var printerconfigTests = []testCase{ + { + Name: "printerconfig.0", + In: `package main + +import "go/printer" + +func f() printer.Config { + b := printer.Config{0, 8} + c := &printer.Config{0} + d := &printer.Config{Tabwidth: 8, Mode: 0} + return printer.Config{0, 8} +} +`, + Out: `package main + +import "go/printer" + +func f() printer.Config { + b := printer.Config{Mode: 0, Tabwidth: 8} + c := &printer.Config{Mode: 0} + d := &printer.Config{Tabwidth: 8, Mode: 0} + return printer.Config{Mode: 0, Tabwidth: 8} +} +`, + }, +} diff --git a/src/cmd/fix/typecheck.go b/src/cmd/fix/typecheck.go new file mode 100644 index 0000000000000000000000000000000000000000..d33b69fddc95b4a001c1676908265d2856064cd7 --- /dev/null +++ b/src/cmd/fix/typecheck.go @@ -0,0 +1,671 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +import ( + "fmt" + "go/ast" + "go/token" + "os" + "reflect" + "strings" +) + +// Partial type checker. +// +// The fact that it is partial is very important: the input is +// an AST and a description of some type information to +// assume about one or more packages, but not all the +// packages that the program imports. The checker is +// expected to do as much as it can with what it has been +// given. There is not enough information supplied to do +// a full type check, but the type checker is expected to +// apply information that can be derived from variable +// declarations, function and method returns, and type switches +// as far as it can, so that the caller can still tell the types +// of expression relevant to a particular fix. +// +// TODO(rsc,gri): Replace with go/typechecker. +// Doing that could be an interesting test case for go/typechecker: +// the constraints about working with partial information will +// likely exercise it in interesting ways. The ideal interface would +// be to pass typecheck a map from importpath to package API text +// (Go source code), but for now we use data structures (TypeConfig, Type). +// +// The strings mostly use gofmt form. +// +// A Field or FieldList has as its type a comma-separated list +// of the types of the fields. For example, the field list +// x, y, z int +// has type "int, int, int". + +// The prefix "type " is the type of a type. +// For example, given +// var x int +// type T int +// x's type is "int" but T's type is "type int". +// mkType inserts the "type " prefix. +// getType removes it. +// isType tests for it. + +func mkType(t string) string { + return "type " + t +} + +func getType(t string) string { + if !isType(t) { + return "" + } + return t[len("type "):] +} + +func isType(t string) bool { + return strings.HasPrefix(t, "type ") +} + +// TypeConfig describes the universe of relevant types. +// For ease of creation, the types are all referred to by string +// name (e.g., "reflect.Value"). TypeByName is the only place +// where the strings are resolved. + +type TypeConfig struct { + Type map[string]*Type + Var map[string]string + Func map[string]string +} + +// typeof returns the type of the given name, which may be of +// the form "x" or "p.X". +func (cfg *TypeConfig) typeof(name string) string { + if cfg.Var != nil { + if t := cfg.Var[name]; t != "" { + return t + } + } + if cfg.Func != nil { + if t := cfg.Func[name]; t != "" { + return "func()" + t + } + } + return "" +} + +// Type describes the Fields and Methods of a type. +// If the field or method cannot be found there, it is next +// looked for in the Embed list. +type Type struct { + Field map[string]string // map field name to type + Method map[string]string // map method name to comma-separated return types (should start with "func ") + Embed []string // list of types this type embeds (for extra methods) + Def string // definition of named type +} + +// dot returns the type of "typ.name", making its decision +// using the type information in cfg. +func (typ *Type) dot(cfg *TypeConfig, name string) string { + if typ.Field != nil { + if t := typ.Field[name]; t != "" { + return t + } + } + if typ.Method != nil { + if t := typ.Method[name]; t != "" { + return t + } + } + + for _, e := range typ.Embed { + etyp := cfg.Type[e] + if etyp != nil { + if t := etyp.dot(cfg, name); t != "" { + return t + } + } + } + + return "" +} + +// typecheck type checks the AST f assuming the information in cfg. +// It returns two maps with type information: +// typeof maps AST nodes to type information in gofmt string form. +// assign maps type strings to lists of expressions that were assigned +// to values of another type that were assigned to that type. +func typecheck(cfg *TypeConfig, f *ast.File) (typeof map[interface{}]string, assign map[string][]interface{}) { + typeof = make(map[interface{}]string) + assign = make(map[string][]interface{}) + cfg1 := &TypeConfig{} + *cfg1 = *cfg // make copy so we can add locally + copied := false + + // gather function declarations + for _, decl := range f.Decls { + fn, ok := decl.(*ast.FuncDecl) + if !ok { + continue + } + typecheck1(cfg, fn.Type, typeof, assign) + t := typeof[fn.Type] + if fn.Recv != nil { + // The receiver must be a type. + rcvr := typeof[fn.Recv] + if !isType(rcvr) { + if len(fn.Recv.List) != 1 { + continue + } + rcvr = mkType(gofmt(fn.Recv.List[0].Type)) + typeof[fn.Recv.List[0].Type] = rcvr + } + rcvr = getType(rcvr) + if rcvr != "" && rcvr[0] == '*' { + rcvr = rcvr[1:] + } + typeof[rcvr+"."+fn.Name.Name] = t + } else { + if isType(t) { + t = getType(t) + } else { + t = gofmt(fn.Type) + } + typeof[fn.Name] = t + + // Record typeof[fn.Name.Obj] for future references to fn.Name. + typeof[fn.Name.Obj] = t + } + } + + // gather struct declarations + for _, decl := range f.Decls { + d, ok := decl.(*ast.GenDecl) + if ok { + for _, s := range d.Specs { + switch s := s.(type) { + case *ast.TypeSpec: + if cfg1.Type[s.Name.Name] != nil { + break + } + if !copied { + copied = true + // Copy map lazily: it's time. + cfg1.Type = make(map[string]*Type) + for k, v := range cfg.Type { + cfg1.Type[k] = v + } + } + t := &Type{Field: map[string]string{}} + cfg1.Type[s.Name.Name] = t + switch st := s.Type.(type) { + case *ast.StructType: + for _, f := range st.Fields.List { + for _, n := range f.Names { + t.Field[n.Name] = gofmt(f.Type) + } + } + case *ast.ArrayType, *ast.StarExpr, *ast.MapType: + t.Def = gofmt(st) + } + } + } + } + } + + typecheck1(cfg1, f, typeof, assign) + return typeof, assign +} + +func makeExprList(a []*ast.Ident) []ast.Expr { + var b []ast.Expr + for _, x := range a { + b = append(b, x) + } + return b +} + +// Typecheck1 is the recursive form of typecheck. +// It is like typecheck but adds to the information in typeof +// instead of allocating a new map. +func typecheck1(cfg *TypeConfig, f interface{}, typeof map[interface{}]string, assign map[string][]interface{}) { + // set sets the type of n to typ. + // If isDecl is true, n is being declared. + set := func(n ast.Expr, typ string, isDecl bool) { + if typeof[n] != "" || typ == "" { + if typeof[n] != typ { + assign[typ] = append(assign[typ], n) + } + return + } + typeof[n] = typ + + // If we obtained typ from the declaration of x + // propagate the type to all the uses. + // The !isDecl case is a cheat here, but it makes + // up in some cases for not paying attention to + // struct fields. The real type checker will be + // more accurate so we won't need the cheat. + if id, ok := n.(*ast.Ident); ok && id.Obj != nil && (isDecl || typeof[id.Obj] == "") { + typeof[id.Obj] = typ + } + } + + // Type-check an assignment lhs = rhs. + // If isDecl is true, this is := so we can update + // the types of the objects that lhs refers to. + typecheckAssign := func(lhs, rhs []ast.Expr, isDecl bool) { + if len(lhs) > 1 && len(rhs) == 1 { + if _, ok := rhs[0].(*ast.CallExpr); ok { + t := split(typeof[rhs[0]]) + // Lists should have same length but may not; pair what can be paired. + for i := 0; i < len(lhs) && i < len(t); i++ { + set(lhs[i], t[i], isDecl) + } + return + } + } + if len(lhs) == 1 && len(rhs) == 2 { + // x = y, ok + rhs = rhs[:1] + } else if len(lhs) == 2 && len(rhs) == 1 { + // x, ok = y + lhs = lhs[:1] + } + + // Match as much as we can. + for i := 0; i < len(lhs) && i < len(rhs); i++ { + x, y := lhs[i], rhs[i] + if typeof[y] != "" { + set(x, typeof[y], isDecl) + } else { + set(y, typeof[x], false) + } + } + } + + expand := func(s string) string { + typ := cfg.Type[s] + if typ != nil && typ.Def != "" { + return typ.Def + } + return s + } + + // The main type check is a recursive algorithm implemented + // by walkBeforeAfter(n, before, after). + // Most of it is bottom-up, but in a few places we need + // to know the type of the function we are checking. + // The before function records that information on + // the curfn stack. + var curfn []*ast.FuncType + + before := func(n interface{}) { + // push function type on stack + switch n := n.(type) { + case *ast.FuncDecl: + curfn = append(curfn, n.Type) + case *ast.FuncLit: + curfn = append(curfn, n.Type) + } + } + + // After is the real type checker. + after := func(n interface{}) { + if n == nil { + return + } + if false && reflect.TypeOf(n).Kind() == reflect.Ptr { // debugging trace + defer func() { + if t := typeof[n]; t != "" { + pos := fset.Position(n.(ast.Node).Pos()) + fmt.Fprintf(os.Stderr, "%s: typeof[%s] = %s\n", pos, gofmt(n), t) + } + }() + } + + switch n := n.(type) { + case *ast.FuncDecl, *ast.FuncLit: + // pop function type off stack + curfn = curfn[:len(curfn)-1] + + case *ast.FuncType: + typeof[n] = mkType(joinFunc(split(typeof[n.Params]), split(typeof[n.Results]))) + + case *ast.FieldList: + // Field list is concatenation of sub-lists. + t := "" + for _, field := range n.List { + if t != "" { + t += ", " + } + t += typeof[field] + } + typeof[n] = t + + case *ast.Field: + // Field is one instance of the type per name. + all := "" + t := typeof[n.Type] + if !isType(t) { + // Create a type, because it is typically *T or *p.T + // and we might care about that type. + t = mkType(gofmt(n.Type)) + typeof[n.Type] = t + } + t = getType(t) + if len(n.Names) == 0 { + all = t + } else { + for _, id := range n.Names { + if all != "" { + all += ", " + } + all += t + typeof[id.Obj] = t + typeof[id] = t + } + } + typeof[n] = all + + case *ast.ValueSpec: + // var declaration. Use type if present. + if n.Type != nil { + t := typeof[n.Type] + if !isType(t) { + t = mkType(gofmt(n.Type)) + typeof[n.Type] = t + } + t = getType(t) + for _, id := range n.Names { + set(id, t, true) + } + } + // Now treat same as assignment. + typecheckAssign(makeExprList(n.Names), n.Values, true) + + case *ast.AssignStmt: + typecheckAssign(n.Lhs, n.Rhs, n.Tok == token.DEFINE) + + case *ast.Ident: + // Identifier can take its type from underlying object. + if t := typeof[n.Obj]; t != "" { + typeof[n] = t + } + + case *ast.SelectorExpr: + // Field or method. + name := n.Sel.Name + if t := typeof[n.X]; t != "" { + t = strings.TrimPrefix(t, "*") // implicit * + if typ := cfg.Type[t]; typ != nil { + if t := typ.dot(cfg, name); t != "" { + typeof[n] = t + return + } + } + tt := typeof[t+"."+name] + if isType(tt) { + typeof[n] = getType(tt) + return + } + } + // Package selector. + if x, ok := n.X.(*ast.Ident); ok && x.Obj == nil { + str := x.Name + "." + name + if cfg.Type[str] != nil { + typeof[n] = mkType(str) + return + } + if t := cfg.typeof(x.Name + "." + name); t != "" { + typeof[n] = t + return + } + } + + case *ast.CallExpr: + // make(T) has type T. + if isTopName(n.Fun, "make") && len(n.Args) >= 1 { + typeof[n] = gofmt(n.Args[0]) + return + } + // new(T) has type *T + if isTopName(n.Fun, "new") && len(n.Args) == 1 { + typeof[n] = "*" + gofmt(n.Args[0]) + return + } + // Otherwise, use type of function to determine arguments. + t := typeof[n.Fun] + in, out := splitFunc(t) + if in == nil && out == nil { + return + } + typeof[n] = join(out) + for i, arg := range n.Args { + if i >= len(in) { + break + } + if typeof[arg] == "" { + typeof[arg] = in[i] + } + } + + case *ast.TypeAssertExpr: + // x.(type) has type of x. + if n.Type == nil { + typeof[n] = typeof[n.X] + return + } + // x.(T) has type T. + if t := typeof[n.Type]; isType(t) { + typeof[n] = getType(t) + } else { + typeof[n] = gofmt(n.Type) + } + + case *ast.SliceExpr: + // x[i:j] has type of x. + typeof[n] = typeof[n.X] + + case *ast.IndexExpr: + // x[i] has key type of x's type. + t := expand(typeof[n.X]) + if strings.HasPrefix(t, "[") || strings.HasPrefix(t, "map[") { + // Lazy: assume there are no nested [] in the array + // length or map key type. + if i := strings.Index(t, "]"); i >= 0 { + typeof[n] = t[i+1:] + } + } + + case *ast.StarExpr: + // *x for x of type *T has type T when x is an expr. + // We don't use the result when *x is a type, but + // compute it anyway. + t := expand(typeof[n.X]) + if isType(t) { + typeof[n] = "type *" + getType(t) + } else if strings.HasPrefix(t, "*") { + typeof[n] = t[len("*"):] + } + + case *ast.UnaryExpr: + // &x for x of type T has type *T. + t := typeof[n.X] + if t != "" && n.Op == token.AND { + typeof[n] = "*" + t + } + + case *ast.CompositeLit: + // T{...} has type T. + typeof[n] = gofmt(n.Type) + + case *ast.ParenExpr: + // (x) has type of x. + typeof[n] = typeof[n.X] + + case *ast.RangeStmt: + t := expand(typeof[n.X]) + if t == "" { + return + } + var key, value string + if t == "string" { + key, value = "int", "rune" + } else if strings.HasPrefix(t, "[") { + key = "int" + if i := strings.Index(t, "]"); i >= 0 { + value = t[i+1:] + } + } else if strings.HasPrefix(t, "map[") { + if i := strings.Index(t, "]"); i >= 0 { + key, value = t[4:i], t[i+1:] + } + } + changed := false + if n.Key != nil && key != "" { + changed = true + set(n.Key, key, n.Tok == token.DEFINE) + } + if n.Value != nil && value != "" { + changed = true + set(n.Value, value, n.Tok == token.DEFINE) + } + // Ugly failure of vision: already type-checked body. + // Do it again now that we have that type info. + if changed { + typecheck1(cfg, n.Body, typeof, assign) + } + + case *ast.TypeSwitchStmt: + // Type of variable changes for each case in type switch, + // but go/parser generates just one variable. + // Repeat type check for each case with more precise + // type information. + as, ok := n.Assign.(*ast.AssignStmt) + if !ok { + return + } + varx, ok := as.Lhs[0].(*ast.Ident) + if !ok { + return + } + t := typeof[varx] + for _, cas := range n.Body.List { + cas := cas.(*ast.CaseClause) + if len(cas.List) == 1 { + // Variable has specific type only when there is + // exactly one type in the case list. + if tt := typeof[cas.List[0]]; isType(tt) { + tt = getType(tt) + typeof[varx] = tt + typeof[varx.Obj] = tt + typecheck1(cfg, cas.Body, typeof, assign) + } + } + } + // Restore t. + typeof[varx] = t + typeof[varx.Obj] = t + + case *ast.ReturnStmt: + if len(curfn) == 0 { + // Probably can't happen. + return + } + f := curfn[len(curfn)-1] + res := n.Results + if f.Results != nil { + t := split(typeof[f.Results]) + for i := 0; i < len(res) && i < len(t); i++ { + set(res[i], t[i], false) + } + } + } + } + walkBeforeAfter(f, before, after) +} + +// Convert between function type strings and lists of types. +// Using strings makes this a little harder, but it makes +// a lot of the rest of the code easier. This will all go away +// when we can use go/typechecker directly. + +// splitFunc splits "func(x,y,z) (a,b,c)" into ["x", "y", "z"] and ["a", "b", "c"]. +func splitFunc(s string) (in, out []string) { + if !strings.HasPrefix(s, "func(") { + return nil, nil + } + + i := len("func(") // index of beginning of 'in' arguments + nparen := 0 + for j := i; j < len(s); j++ { + switch s[j] { + case '(': + nparen++ + case ')': + nparen-- + if nparen < 0 { + // found end of parameter list + out := strings.TrimSpace(s[j+1:]) + if len(out) >= 2 && out[0] == '(' && out[len(out)-1] == ')' { + out = out[1 : len(out)-1] + } + return split(s[i:j]), split(out) + } + } + } + return nil, nil +} + +// joinFunc is the inverse of splitFunc. +func joinFunc(in, out []string) string { + outs := "" + if len(out) == 1 { + outs = " " + out[0] + } else if len(out) > 1 { + outs = " (" + join(out) + ")" + } + return "func(" + join(in) + ")" + outs +} + +// split splits "int, float" into ["int", "float"] and splits "" into []. +func split(s string) []string { + out := []string{} + i := 0 // current type being scanned is s[i:j]. + nparen := 0 + for j := 0; j < len(s); j++ { + switch s[j] { + case ' ': + if i == j { + i++ + } + case '(': + nparen++ + case ')': + nparen-- + if nparen < 0 { + // probably can't happen + return nil + } + case ',': + if nparen == 0 { + if i < j { + out = append(out, s[i:j]) + } + i = j + 1 + } + } + } + if nparen != 0 { + // probably can't happen + return nil + } + if i < len(s) { + out = append(out, s[i:]) + } + return out +} + +// join is the inverse of split. +func join(x []string) string { + return strings.Join(x, ", ") +} diff --git a/src/cmd/go/alldocs.go b/src/cmd/go/alldocs.go new file mode 100644 index 0000000000000000000000000000000000000000..1134997eaaa277f0b0f6592a23c615438b97b327 --- /dev/null +++ b/src/cmd/go/alldocs.go @@ -0,0 +1,1481 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// DO NOT EDIT THIS FILE. GENERATED BY mkalldocs.sh. +// Edit the documentation in other files and rerun mkalldocs.sh to generate this one. + +/* +Go is a tool for managing Go source code. + +Usage: + + go command [arguments] + +The commands are: + + build compile packages and dependencies + clean remove object files + doc show documentation for package or symbol + env print Go environment information + fix run go tool fix on packages + fmt run gofmt on package sources + generate generate Go files by processing source + get download and install packages and dependencies + install compile and install packages and dependencies + list list packages + run compile and run Go program + test test packages + tool run specified go tool + version print Go version + vet run go tool vet on packages + +Use "go help [command]" for more information about a command. + +Additional help topics: + + c calling between Go and C + buildmode description of build modes + filetype file types + gopath GOPATH environment variable + environment environment variables + importpath import path syntax + packages description of package lists + testflag description of testing flags + testfunc description of testing functions + +Use "go help [topic]" for more information about that topic. + + +Compile packages and dependencies + +Usage: + + go build [-o output] [-i] [build flags] [packages] + +Build compiles the packages named by the import paths, +along with their dependencies, but it does not install the results. + +If the arguments to build are a list of .go files, build treats +them as a list of source files specifying a single package. + +When compiling a single main package, build writes +the resulting executable to an output file named after +the first source file ('go build ed.go rx.go' writes 'ed' or 'ed.exe') +or the source code directory ('go build unix/sam' writes 'sam' or 'sam.exe'). +The '.exe' suffix is added when writing a Windows executable. + +When compiling multiple packages or a single non-main package, +build compiles the packages but discards the resulting object, +serving only as a check that the packages can be built. + +The -o flag, only allowed when compiling a single package, +forces build to write the resulting executable or object +to the named output file, instead of the default behavior described +in the last two paragraphs. + +The -i flag installs the packages that are dependencies of the target. + +The build flags are shared by the build, clean, get, install, list, run, +and test commands: + + -a + force rebuilding of packages that are already up-to-date. + -n + print the commands but do not run them. + -p n + the number of builds that can be run in parallel. + The default is the number of CPUs available, except + on darwin/arm which defaults to 1. + -race + enable data race detection. + Supported only on linux/amd64, freebsd/amd64, darwin/amd64 and windows/amd64. + -v + print the names of packages as they are compiled. + -work + print the name of the temporary work directory and + do not delete it when exiting. + -x + print the commands. + + -asmflags 'flag list' + arguments to pass on each go tool asm invocation. + -buildmode mode + build mode to use. See 'go help buildmode' for more. + -compiler name + name of compiler to use, as in runtime.Compiler (gccgo or gc). + -gccgoflags 'arg list' + arguments to pass on each gccgo compiler/linker invocation. + -gcflags 'arg list' + arguments to pass on each go tool compile invocation. + -installsuffix suffix + a suffix to use in the name of the package installation directory, + in order to keep output separate from default builds. + If using the -race flag, the install suffix is automatically set to race + or, if set explicitly, has _race appended to it. Using a -buildmode + option that requires non-default compile flags has a similar effect. + -ldflags 'flag list' + arguments to pass on each go tool link invocation. + -linkshared + link against shared libraries previously created with + -buildmode=shared + -pkgdir dir + install and load all packages from dir instead of the usual locations. + For example, when building with a non-standard configuration, + use -pkgdir to keep generated packages in a separate location. + -tags 'tag list' + a list of build tags to consider satisfied during the build. + For more information about build tags, see the description of + build constraints in the documentation for the go/build package. + -toolexec 'cmd args' + a program to use to invoke toolchain programs like vet and asm. + For example, instead of running asm, the go command will run + 'cmd args /path/to/asm '. + +The list flags accept a space-separated list of strings. To embed spaces +in an element in the list, surround it with either single or double quotes. + +For more about specifying packages, see 'go help packages'. +For more about where packages and binaries are installed, +run 'go help gopath'. +For more about calling between Go and C/C++, run 'go help c'. + +Note: Build adheres to certain conventions such as those described +by 'go help gopath'. Not all projects can follow these conventions, +however. Installations that have their own conventions or that use +a separate software build system may choose to use lower-level +invocations such as 'go tool compile' and 'go tool link' to avoid +some of the overheads and design decisions of the build tool. + +See also: go install, go get, go clean. + + +Remove object files + +Usage: + + go clean [-i] [-r] [-n] [-x] [build flags] [packages] + +Clean removes object files from package source directories. +The go command builds most objects in a temporary directory, +so go clean is mainly concerned with object files left by other +tools or by manual invocations of go build. + +Specifically, clean removes the following files from each of the +source directories corresponding to the import paths: + + _obj/ old object directory, left from Makefiles + _test/ old test directory, left from Makefiles + _testmain.go old gotest file, left from Makefiles + test.out old test log, left from Makefiles + build.out old test log, left from Makefiles + *.[568ao] object files, left from Makefiles + + DIR(.exe) from go build + DIR.test(.exe) from go test -c + MAINFILE(.exe) from go build MAINFILE.go + *.so from SWIG + +In the list, DIR represents the final path element of the +directory, and MAINFILE is the base name of any Go source +file in the directory that is not included when building +the package. + +The -i flag causes clean to remove the corresponding installed +archive or binary (what 'go install' would create). + +The -n flag causes clean to print the remove commands it would execute, +but not run them. + +The -r flag causes clean to be applied recursively to all the +dependencies of the packages named by the import paths. + +The -x flag causes clean to print remove commands as it executes them. + +For more about build flags, see 'go help build'. + +For more about specifying packages, see 'go help packages'. + + +Show documentation for package or symbol + +Usage: + + go doc [-u] [-c] [package|[package.]symbol[.method]] + +Doc prints the documentation comments associated with the item identified by its +arguments (a package, const, func, type, var, or method) followed by a one-line +summary of each of the first-level items "under" that item (package-level +declarations for a package, methods for a type, etc.). + +Doc accepts zero, one, or two arguments. + +Given no arguments, that is, when run as + + go doc + +it prints the package documentation for the package in the current directory. +If the package is a command (package main), the exported symbols of the package +are elided from the presentation unless the -cmd flag is provided. + +When run with one argument, the argument is treated as a Go-syntax-like +representation of the item to be documented. What the argument selects depends +on what is installed in GOROOT and GOPATH, as well as the form of the argument, +which is schematically one of these: + + go doc + go doc [.] + go doc [].[.] + +The first item in this list matched by the argument is the one whose +documentation is printed. (See the examples below.) For packages, the order of +scanning is determined lexically, but the GOROOT tree is always scanned before +GOPATH. + +If there is no package specified or matched, the package in the current +directory is selected, so "go doc Foo" shows the documentation for symbol Foo in +the current package. + +The package path must be either a qualified path or a proper suffix of a +path. The go tool's usual package mechanism does not apply: package path +elements like . and ... are not implemented by go doc. + +When run with two arguments, the first must be a full package path (not just a +suffix), and the second is a symbol or symbol and method; this is similar to the +syntax accepted by godoc: + + go doc [.] + +In all forms, when matching symbols, lower-case letters in the argument match +either case but upper-case letters match exactly. This means that there may be +multiple matches of a lower-case argument in a package if different symbols have +different cases. If this occurs, documentation for all matches is printed. + +Examples: + go doc + Show documentation for current package. + go doc Foo + Show documentation for Foo in the current package. + (Foo starts with a capital letter so it cannot match + a package path.) + go doc encoding/json + Show documentation for the encoding/json package. + go doc json + Shorthand for encoding/json. + go doc json.Number (or go doc json.number) + Show documentation and method summary for json.Number. + go doc json.Number.Int64 (or go doc json.number.int64) + Show documentation for json.Number's Int64 method. + go doc cmd/doc + Show package docs for the doc command. + go doc -cmd cmd/doc + Show package docs and exported symbols within the doc command. + go doc template.new + Show documentation for html/template's New function. + (html/template is lexically before text/template) + go doc text/template.new # One argument + Show documentation for text/template's New function. + go doc text/template new # Two arguments + Show documentation for text/template's New function. + +Flags: + -c + Respect case when matching symbols. + -cmd + Treat a command (package main) like a regular package. + Otherwise package main's exported symbols are hidden + when showing the package's top-level documentation. + -u + Show documentation for unexported as well as exported + symbols and methods. + + +Print Go environment information + +Usage: + + go env [var ...] + +Env prints Go environment information. + +By default env prints information as a shell script +(on Windows, a batch file). If one or more variable +names is given as arguments, env prints the value of +each named variable on its own line. + + +Run go tool fix on packages + +Usage: + + go fix [packages] + +Fix runs the Go fix command on the packages named by the import paths. + +For more about fix, see 'go doc cmd/fix'. +For more about specifying packages, see 'go help packages'. + +To run fix with specific options, run 'go tool fix'. + +See also: go fmt, go vet. + + +Run gofmt on package sources + +Usage: + + go fmt [-n] [-x] [packages] + +Fmt runs the command 'gofmt -l -w' on the packages named +by the import paths. It prints the names of the files that are modified. + +For more about gofmt, see 'go doc cmd/gofmt'. +For more about specifying packages, see 'go help packages'. + +The -n flag prints commands that would be executed. +The -x flag prints commands as they are executed. + +To run gofmt with specific options, run gofmt itself. + +See also: go fix, go vet. + + +Generate Go files by processing source + +Usage: + + go generate [-run regexp] [file.go... | packages] + +Generate runs commands described by directives within existing +files. Those commands can run any process but the intent is to +create or update Go source files, for instance by running yacc. + +Go generate is never run automatically by go build, go get, go test, +and so on. It must be run explicitly. + +Go generate scans the file for directives, which are lines of +the form, + + //go:generate command argument... + +(note: no leading spaces and no space in "//go") where command +is the generator to be run, corresponding to an executable file +that can be run locally. It must either be in the shell path +(gofmt), a fully qualified path (/usr/you/bin/mytool), or a +command alias, described below. + +Note that go generate does not parse the file, so lines that look +like directives in comments or multiline strings will be treated +as directives. + +The arguments to the directive are space-separated tokens or +double-quoted strings passed to the generator as individual +arguments when it is run. + +Quoted strings use Go syntax and are evaluated before execution; a +quoted string appears as a single argument to the generator. + +Go generate sets several variables when it runs the generator: + + $GOARCH + The execution architecture (arm, amd64, etc.) + $GOOS + The execution operating system (linux, windows, etc.) + $GOFILE + The base name of the file. + $GOLINE + The line number of the directive in the source file. + $GOPACKAGE + The name of the package of the file containing the directive. + $DOLLAR + A dollar sign. + +Other than variable substitution and quoted-string evaluation, no +special processing such as "globbing" is performed on the command +line. + +As a last step before running the command, any invocations of any +environment variables with alphanumeric names, such as $GOFILE or +$HOME, are expanded throughout the command line. The syntax for +variable expansion is $NAME on all operating systems. Due to the +order of evaluation, variables are expanded even inside quoted +strings. If the variable NAME is not set, $NAME expands to the +empty string. + +A directive of the form, + + //go:generate -command xxx args... + +specifies, for the remainder of this source file only, that the +string xxx represents the command identified by the arguments. This +can be used to create aliases or to handle multiword generators. +For example, + + //go:generate -command yacc go tool yacc + +specifies that the command "yacc" represents the generator +"go tool yacc". + +Generate processes packages in the order given on the command line, +one at a time. If the command line lists .go files, they are treated +as a single package. Within a package, generate processes the +source files in a package in file name order, one at a time. Within +a source file, generate runs generators in the order they appear +in the file, one at a time. + +If any generator returns an error exit status, "go generate" skips +all further processing for that package. + +The generator is run in the package's source directory. + +Go generate accepts one specific flag: + + -run="" + if non-empty, specifies a regular expression to select + directives whose full original source text (excluding + any trailing spaces and final newline) matches the + expression. + +It also accepts the standard build flags -v, -n, and -x. +The -v flag prints the names of packages and files as they are +processed. +The -n flag prints commands that would be executed. +The -x flag prints commands as they are executed. + +For more about specifying packages, see 'go help packages'. + + +Download and install packages and dependencies + +Usage: + + go get [-d] [-f] [-fix] [-insecure] [-t] [-u] [build flags] [packages] + +Get downloads and installs the packages named by the import paths, +along with their dependencies. + +The -d flag instructs get to stop after downloading the packages; that is, +it instructs get not to install the packages. + +The -f flag, valid only when -u is set, forces get -u not to verify that +each package has been checked out from the source control repository +implied by its import path. This can be useful if the source is a local fork +of the original. + +The -fix flag instructs get to run the fix tool on the downloaded packages +before resolving dependencies or building the code. + +The -insecure flag permits fetching from repositories and resolving +custom domains using insecure schemes such as HTTP. Use with caution. + +The -t flag instructs get to also download the packages required to build +the tests for the specified packages. + +The -u flag instructs get to use the network to update the named packages +and their dependencies. By default, get uses the network to check out +missing packages but does not use it to look for updates to existing packages. + +Get also accepts build flags to control the installation. See 'go help build'. + +When checking out or updating a package, get looks for a branch or tag +that matches the locally installed version of Go. The most important +rule is that if the local installation is running version "go1", get +searches for a branch or tag named "go1". If no such version exists it +retrieves the most recent version of the package. + +If the vendoring experiment is enabled (see 'go help gopath'), +then when go get checks out or updates a Git repository, +it also updates any git submodules referenced by the repository. + +For more about specifying packages, see 'go help packages'. + +For more about how 'go get' finds source code to +download, see 'go help importpath'. + +See also: go build, go install, go clean. + + +Compile and install packages and dependencies + +Usage: + + go install [build flags] [packages] + +Install compiles and installs the packages named by the import paths, +along with their dependencies. + +For more about the build flags, see 'go help build'. +For more about specifying packages, see 'go help packages'. + +See also: go build, go get, go clean. + + +List packages + +Usage: + + go list [-e] [-f format] [-json] [build flags] [packages] + +List lists the packages named by the import paths, one per line. + +The default output shows the package import path: + + bytes + encoding/json + github.com/gorilla/mux + golang.org/x/net/html + +The -f flag specifies an alternate format for the list, using the +syntax of package template. The default output is equivalent to -f +'{{.ImportPath}}'. The struct being passed to the template is: + + type Package struct { + Dir string // directory containing package sources + ImportPath string // import path of package in dir + ImportComment string // path in import comment on package statement + Name string // package name + Doc string // package documentation string + Target string // install path + Shlib string // the shared library that contains this package (only set when -linkshared) + Goroot bool // is this package in the Go root? + Standard bool // is this package part of the standard Go library? + Stale bool // would 'go install' do anything for this package? + Root string // Go root or Go path dir containing this package + + // Source files + GoFiles []string // .go source files (excluding CgoFiles, TestGoFiles, XTestGoFiles) + CgoFiles []string // .go sources files that import "C" + IgnoredGoFiles []string // .go sources ignored due to build constraints + CFiles []string // .c source files + CXXFiles []string // .cc, .cxx and .cpp source files + MFiles []string // .m source files + HFiles []string // .h, .hh, .hpp and .hxx source files + SFiles []string // .s source files + SwigFiles []string // .swig files + SwigCXXFiles []string // .swigcxx files + SysoFiles []string // .syso object files to add to archive + + // Cgo directives + CgoCFLAGS []string // cgo: flags for C compiler + CgoCPPFLAGS []string // cgo: flags for C preprocessor + CgoCXXFLAGS []string // cgo: flags for C++ compiler + CgoLDFLAGS []string // cgo: flags for linker + CgoPkgConfig []string // cgo: pkg-config names + + // Dependency information + Imports []string // import paths used by this package + Deps []string // all (recursively) imported dependencies + + // Error information + Incomplete bool // this package or a dependency has an error + Error *PackageError // error loading package + DepsErrors []*PackageError // errors loading dependencies + + TestGoFiles []string // _test.go files in package + TestImports []string // imports from TestGoFiles + XTestGoFiles []string // _test.go files outside package + XTestImports []string // imports from XTestGoFiles + } + +The template function "join" calls strings.Join. + +The template function "context" returns the build context, defined as: + + type Context struct { + GOARCH string // target architecture + GOOS string // target operating system + GOROOT string // Go root + GOPATH string // Go path + CgoEnabled bool // whether cgo can be used + UseAllFiles bool // use files regardless of +build lines, file names + Compiler string // compiler to assume when computing target paths + BuildTags []string // build constraints to match in +build lines + ReleaseTags []string // releases the current release is compatible with + InstallSuffix string // suffix to use in the name of the install dir + } + +For more information about the meaning of these fields see the documentation +for the go/build package's Context type. + +The -json flag causes the package data to be printed in JSON format +instead of using the template format. + +The -e flag changes the handling of erroneous packages, those that +cannot be found or are malformed. By default, the list command +prints an error to standard error for each erroneous package and +omits the packages from consideration during the usual printing. +With the -e flag, the list command never prints errors to standard +error and instead processes the erroneous packages with the usual +printing. Erroneous packages will have a non-empty ImportPath and +a non-nil Error field; other information may or may not be missing +(zeroed). + +For more about build flags, see 'go help build'. + +For more about specifying packages, see 'go help packages'. + + +Compile and run Go program + +Usage: + + go run [build flags] [-exec xprog] gofiles... [arguments...] + +Run compiles and runs the main package comprising the named Go source files. +A Go source file is defined to be a file ending in a literal ".go" suffix. + +By default, 'go run' runs the compiled binary directly: 'a.out arguments...'. +If the -exec flag is given, 'go run' invokes the binary using xprog: + 'xprog a.out arguments...'. +If the -exec flag is not given, GOOS or GOARCH is different from the system +default, and a program named go_$GOOS_$GOARCH_exec can be found +on the current search path, 'go run' invokes the binary using that program, +for example 'go_nacl_386_exec a.out arguments...'. This allows execution of +cross-compiled programs when a simulator or other execution method is +available. + +For more about build flags, see 'go help build'. + +See also: go build. + + +Test packages + +Usage: + + go test [-c] [-i] [build and test flags] [packages] [flags for test binary] + +'Go test' automates testing the packages named by the import paths. +It prints a summary of the test results in the format: + + ok archive/tar 0.011s + FAIL archive/zip 0.022s + ok compress/gzip 0.033s + ... + +followed by detailed output for each failed package. + +'Go test' recompiles each package along with any files with names matching +the file pattern "*_test.go". +Files whose names begin with "_" (including "_test.go") or "." are ignored. +These additional files can contain test functions, benchmark functions, and +example functions. See 'go help testfunc' for more. +Each listed package causes the execution of a separate test binary. + +Test files that declare a package with the suffix "_test" will be compiled as a +separate package, and then linked and run with the main test binary. + +By default, go test needs no arguments. It compiles and tests the package +with source in the current directory, including tests, and runs the tests. + +The package is built in a temporary directory so it does not interfere with the +non-test installation. + +In addition to the build flags, the flags handled by 'go test' itself are: + + -c + Compile the test binary to pkg.test but do not run it + (where pkg is the last element of the package's import path). + The file name can be changed with the -o flag. + + -exec xprog + Run the test binary using xprog. The behavior is the same as + in 'go run'. See 'go help run' for details. + + -i + Install packages that are dependencies of the test. + Do not run the test. + + -o file + Compile the test binary to the named file. + The test still runs (unless -c or -i is specified). + +The test binary also accepts flags that control execution of the test; these +flags are also accessible by 'go test'. See 'go help testflag' for details. + +If the test binary needs any other flags, they should be presented after the +package names. The go tool treats as a flag the first argument that begins with +a minus sign that it does not recognize itself; that argument and all subsequent +arguments are passed as arguments to the test binary. + +For more about build flags, see 'go help build'. +For more about specifying packages, see 'go help packages'. + +See also: go build, go vet. + + +Run specified go tool + +Usage: + + go tool [-n] command [args...] + +Tool runs the go tool command identified by the arguments. +With no arguments it prints the list of known tools. + +The -n flag causes tool to print the command that would be +executed but not execute it. + +For more about each tool command, see 'go tool command -h'. + + +Print Go version + +Usage: + + go version + +Version prints the Go version, as reported by runtime.Version. + + +Run go tool vet on packages + +Usage: + + go vet [-n] [-x] [build flags] [packages] + +Vet runs the Go vet command on the packages named by the import paths. + +For more about vet, see 'go doc cmd/vet'. +For more about specifying packages, see 'go help packages'. + +To run the vet tool with specific options, run 'go tool vet'. + +The -n flag prints commands that would be executed. +The -x flag prints commands as they are executed. + +For more about build flags, see 'go help build'. + +See also: go fmt, go fix. + + +Calling between Go and C + +There are two different ways to call between Go and C/C++ code. + +The first is the cgo tool, which is part of the Go distribution. For +information on how to use it see the cgo documentation (go doc cmd/cgo). + +The second is the SWIG program, which is a general tool for +interfacing between languages. For information on SWIG see +http://swig.org/. When running go build, any file with a .swig +extension will be passed to SWIG. Any file with a .swigcxx extension +will be passed to SWIG with the -c++ option. + +When either cgo or SWIG is used, go build will pass any .c, .m, .s, +or .S files to the C compiler, and any .cc, .cpp, .cxx files to the C++ +compiler. The CC or CXX environment variables may be set to determine +the C or C++ compiler, respectively, to use. + + +Description of build modes + +The 'go build' and 'go install' commands take a -buildmode argument which +indicates which kind of object file is to be built. Currently supported values +are: + + -buildmode=archive + Build the listed non-main packages into .a files. Packages named + main are ignored. + + -buildmode=c-archive + Build the listed main package, plus all packages it imports, + into a C archive file. The only callable symbols will be those + functions exported using a cgo //export comment. Requires + exactly one main package to be listed. + + -buildmode=c-shared + Build the listed main packages, plus all packages that they + import, into C shared libraries. The only callable symbols will + be those functions exported using a cgo //export comment. + Non-main packages are ignored. + + -buildmode=default + Listed main packages are built into executables and listed + non-main packages are built into .a files (the default + behavior). + + -buildmode=shared + Combine all the listed non-main packages into a single shared + library that will be used when building with the -linkshared + option. Packages named main are ignored. + + -buildmode=exe + Build the listed main packages and everything they import into + executables. Packages not named main are ignored. + + +File types + +The go command examines the contents of a restricted set of files +in each directory. It identifies which files to examine based on +the extension of the file name. These extensions are: + + .go + Go source files. + .c, .h + C source files. + If the package uses cgo or SWIG, these will be compiled with the + OS-native compiler (typically gcc); otherwise they will + trigger an error. + .cc, .cpp, .cxx, .hh, .hpp, .hxx + C++ source files. Only useful with cgo or SWIG, and always + compiled with the OS-native compiler. + .m + Objective-C source files. Only useful with cgo, and always + compiled with the OS-native compiler. + .s, .S + Assembler source files. + If the package uses cgo or SWIG, these will be assembled with the + OS-native assembler (typically gcc (sic)); otherwise they + will be assembled with the Go assembler. + .swig, .swigcxx + SWIG definition files. + .syso + System object files. + +Files of each of these types except .syso may contain build +constraints, but the go command stops scanning for build constraints +at the first item in the file that is not a blank line or //-style +line comment. + + +GOPATH environment variable + +The Go path is used to resolve import statements. +It is implemented by and documented in the go/build package. + +The GOPATH environment variable lists places to look for Go code. +On Unix, the value is a colon-separated string. +On Windows, the value is a semicolon-separated string. +On Plan 9, the value is a list. + +GOPATH must be set to get, build and install packages outside the +standard Go tree. + +Each directory listed in GOPATH must have a prescribed structure: + +The src directory holds source code. The path below src +determines the import path or executable name. + +The pkg directory holds installed package objects. +As in the Go tree, each target operating system and +architecture pair has its own subdirectory of pkg +(pkg/GOOS_GOARCH). + +If DIR is a directory listed in the GOPATH, a package with +source in DIR/src/foo/bar can be imported as "foo/bar" and +has its compiled form installed to "DIR/pkg/GOOS_GOARCH/foo/bar.a". + +The bin directory holds compiled commands. +Each command is named for its source directory, but only +the final element, not the entire path. That is, the +command with source in DIR/src/foo/quux is installed into +DIR/bin/quux, not DIR/bin/foo/quux. The "foo/" prefix is stripped +so that you can add DIR/bin to your PATH to get at the +installed commands. If the GOBIN environment variable is +set, commands are installed to the directory it names instead +of DIR/bin. + +Here's an example directory layout: + + GOPATH=/home/user/gocode + + /home/user/gocode/ + src/ + foo/ + bar/ (go code in package bar) + x.go + quux/ (go code in package main) + y.go + bin/ + quux (installed command) + pkg/ + linux_amd64/ + foo/ + bar.a (installed package object) + +Go searches each directory listed in GOPATH to find source code, +but new packages are always downloaded into the first directory +in the list. + +See https://golang.org/doc/code.html for an example. + +Internal Directories + +Code in or below a directory named "internal" is importable only +by code in the directory tree rooted at the parent of "internal". +Here's an extended version of the directory layout above: + + /home/user/gocode/ + src/ + crash/ + bang/ (go code in package bang) + b.go + foo/ (go code in package foo) + f.go + bar/ (go code in package bar) + x.go + internal/ + baz/ (go code in package baz) + z.go + quux/ (go code in package main) + y.go + + +The code in z.go is imported as "foo/internal/baz", but that +import statement can only appear in source files in the subtree +rooted at foo. The source files foo/f.go, foo/bar/x.go, and +foo/quux/y.go can all import "foo/internal/baz", but the source file +crash/bang/b.go cannot. + +See https://golang.org/s/go14internal for details. + +Vendor Directories + +Go 1.5 includes experimental support for using local copies +of external dependencies to satisfy imports of those dependencies, +often referred to as vendoring. Setting the environment variable +GO15VENDOREXPERIMENT=1 enables that experimental support. + +When the vendor experiment is enabled, +code below a directory named "vendor" is importable only +by code in the directory tree rooted at the parent of "vendor", +and only using an import path that omits the prefix up to and +including the vendor element. + +Here's the example from the previous section, +but with the "internal" directory renamed to "vendor" +and a new foo/vendor/crash/bang directory added: + + /home/user/gocode/ + src/ + crash/ + bang/ (go code in package bang) + b.go + foo/ (go code in package foo) + f.go + bar/ (go code in package bar) + x.go + vendor/ + crash/ + bang/ (go code in package bang) + b.go + baz/ (go code in package baz) + z.go + quux/ (go code in package main) + y.go + +The same visibility rules apply as for internal, but the code +in z.go is imported as "baz", not as "foo/vendor/baz". + +Code in vendor directories deeper in the source tree shadows +code in higher directories. Within the subtree rooted at foo, an import +of "crash/bang" resolves to "foo/vendor/crash/bang", not the +top-level "crash/bang". + +Code in vendor directories is not subject to import path +checking (see 'go help importpath'). + +When the vendor experiment is enabled, 'go get' checks out +submodules when checking out or updating a git repository +(see 'go help get'). + +The vendoring semantics are an experiment, and they may change +in future releases. Once settled, they will be on by default. + +See https://golang.org/s/go15vendor for details. + + +Environment variables + +The go command, and the tools it invokes, examine a few different +environment variables. For many of these, you can see the default +value of on your system by running 'go env NAME', where NAME is the +name of the variable. + +General-purpose environment variables: + + GCCGO + The gccgo command to run for 'go build -compiler=gccgo'. + GOARCH + The architecture, or processor, for which to compile code. + Examples are amd64, 386, arm, ppc64. + GOBIN + The directory where 'go install' will install a command. + GOOS + The operating system for which to compile code. + Examples are linux, darwin, windows, netbsd. + GOPATH + See 'go help gopath'. + GORACE + Options for the race detector. + See https://golang.org/doc/articles/race_detector.html. + GOROOT + The root of the go tree. + +Environment variables for use with cgo: + + CC + The command to use to compile C code. + CGO_ENABLED + Whether the cgo command is supported. Either 0 or 1. + CGO_CFLAGS + Flags that cgo will pass to the compiler when compiling + C code. + CGO_CPPFLAGS + Flags that cgo will pass to the compiler when compiling + C or C++ code. + CGO_CXXFLAGS + Flags that cgo will pass to the compiler when compiling + C++ code. + CGO_LDFLAGS + Flags that cgo will pass to the compiler when linking. + CXX + The command to use to compile C++ code. + +Architecture-specific environment variables: + + GOARM + For GOARCH=arm, the ARM architecture for which to compile. + Valid values are 5, 6, 7. + GO386 + For GOARCH=386, the floating point instruction set. + Valid values are 387, sse2. + +Special-purpose environment variables: + + GOROOT_FINAL + The root of the installed Go tree, when it is + installed in a location other than where it is built. + File names in stack traces are rewritten from GOROOT to + GOROOT_FINAL. + GO15VENDOREXPERIMENT + Set to 1 to enable the Go 1.5 vendoring experiment. + GO_EXTLINK_ENABLED + Whether the linker should use external linking mode + when using -linkmode=auto with code that uses cgo. + Set to 0 to disable external linking mode, 1 to enable it. + + +Import path syntax + +An import path (see 'go help packages') denotes a package +stored in the local file system. In general, an import path denotes +either a standard package (such as "unicode/utf8") or a package +found in one of the work spaces (see 'go help gopath'). + +Relative import paths + +An import path beginning with ./ or ../ is called a relative path. +The toolchain supports relative import paths as a shortcut in two ways. + +First, a relative path can be used as a shorthand on the command line. +If you are working in the directory containing the code imported as +"unicode" and want to run the tests for "unicode/utf8", you can type +"go test ./utf8" instead of needing to specify the full path. +Similarly, in the reverse situation, "go test .." will test "unicode" from +the "unicode/utf8" directory. Relative patterns are also allowed, like +"go test ./..." to test all subdirectories. See 'go help packages' for details +on the pattern syntax. + +Second, if you are compiling a Go program not in a work space, +you can use a relative path in an import statement in that program +to refer to nearby code also not in a work space. +This makes it easy to experiment with small multipackage programs +outside of the usual work spaces, but such programs cannot be +installed with "go install" (there is no work space in which to install them), +so they are rebuilt from scratch each time they are built. +To avoid ambiguity, Go programs cannot use relative import paths +within a work space. + +Remote import paths + +Certain import paths also +describe how to obtain the source code for the package using +a revision control system. + +A few common code hosting sites have special syntax: + + Bitbucket (Git, Mercurial) + + import "bitbucket.org/user/project" + import "bitbucket.org/user/project/sub/directory" + + GitHub (Git) + + import "github.com/user/project" + import "github.com/user/project/sub/directory" + + Google Code Project Hosting (Git, Mercurial, Subversion) + + import "code.google.com/p/project" + import "code.google.com/p/project/sub/directory" + + import "code.google.com/p/project.subrepository" + import "code.google.com/p/project.subrepository/sub/directory" + + Launchpad (Bazaar) + + import "launchpad.net/project" + import "launchpad.net/project/series" + import "launchpad.net/project/series/sub/directory" + + import "launchpad.net/~user/project/branch" + import "launchpad.net/~user/project/branch/sub/directory" + + IBM DevOps Services (Git) + + import "hub.jazz.net/git/user/project" + import "hub.jazz.net/git/user/project/sub/directory" + +For code hosted on other servers, import paths may either be qualified +with the version control type, or the go tool can dynamically fetch +the import path over https/http and discover where the code resides +from a tag in the HTML. + +To declare the code location, an import path of the form + + repository.vcs/path + +specifies the given repository, with or without the .vcs suffix, +using the named version control system, and then the path inside +that repository. The supported version control systems are: + + Bazaar .bzr + Git .git + Mercurial .hg + Subversion .svn + +For example, + + import "example.org/user/foo.hg" + +denotes the root directory of the Mercurial repository at +example.org/user/foo or foo.hg, and + + import "example.org/repo.git/foo/bar" + +denotes the foo/bar directory of the Git repository at +example.org/repo or repo.git. + +When a version control system supports multiple protocols, +each is tried in turn when downloading. For example, a Git +download tries https://, then git+ssh://. + +If the import path is not a known code hosting site and also lacks a +version control qualifier, the go tool attempts to fetch the import +over https/http and looks for a tag in the document's HTML +. + +The meta tag has the form: + + + +The import-prefix is the import path corresponding to the repository +root. It must be a prefix or an exact match of the package being +fetched with "go get". If it's not an exact match, another http +request is made at the prefix to verify the tags match. + +The meta tag should appear as early in the file as possible. +In particular, it should appear before any raw JavaScript or CSS, +to avoid confusing the go command's restricted parser. + +The vcs is one of "git", "hg", "svn", etc, + +The repo-root is the root of the version control system +containing a scheme and not containing a .vcs qualifier. + +For example, + + import "example.org/pkg/foo" + +will result in the following requests: + + https://example.org/pkg/foo?go-get=1 (preferred) + http://example.org/pkg/foo?go-get=1 (fallback, only with -insecure) + +If that page contains the meta tag + + + +the go tool will verify that https://example.org/?go-get=1 contains the +same meta tag and then git clone https://code.org/r/p/exproj into +GOPATH/src/example.org. + +New downloaded packages are written to the first directory +listed in the GOPATH environment variable (see 'go help gopath'). + +The go command attempts to download the version of the +package appropriate for the Go release being used. +Run 'go help get' for more. + +Import path checking + +When the custom import path feature described above redirects to a +known code hosting site, each of the resulting packages has two possible +import paths, using the custom domain or the known hosting site. + +A package statement is said to have an "import comment" if it is immediately +followed (before the next newline) by a comment of one of these two forms: + + package math // import "path" + package math /* import "path" * / + +The go command will refuse to install a package with an import comment +unless it is being referred to by that import path. In this way, import comments +let package authors make sure the custom import path is used and not a +direct path to the underlying code hosting site. + +If the vendoring experiment is enabled (see 'go help gopath'), +then import path checking is disabled for code found within vendor trees. +This makes it possible to copy code into alternate locations in vendor trees +without needing to update import comments. + +See https://golang.org/s/go14customimport for details. + + +Description of package lists + +Many commands apply to a set of packages: + + go action [packages] + +Usually, [packages] is a list of import paths. + +An import path that is a rooted path or that begins with +a . or .. element is interpreted as a file system path and +denotes the package in that directory. + +Otherwise, the import path P denotes the package found in +the directory DIR/src/P for some DIR listed in the GOPATH +environment variable (see 'go help gopath'). + +If no import paths are given, the action applies to the +package in the current directory. + +There are four reserved names for paths that should not be used +for packages to be built with the go tool: + +- "main" denotes the top-level package in a stand-alone executable. + +- "all" expands to all package directories found in all the GOPATH +trees. For example, 'go list all' lists all the packages on the local +system. + +- "std" is like all but expands to just the packages in the standard +Go library. + +- "cmd" expands to the Go repository's commands and their +internal libraries. + +An import path is a pattern if it includes one or more "..." wildcards, +each of which can match any string, including the empty string and +strings containing slashes. Such a pattern expands to all package +directories found in the GOPATH trees with names matching the +patterns. As a special case, x/... matches x as well as x's subdirectories. +For example, net/... expands to net and packages in its subdirectories. + +An import path can also name a package to be downloaded from +a remote repository. Run 'go help importpath' for details. + +Every package in a program must have a unique import path. +By convention, this is arranged by starting each path with a +unique prefix that belongs to you. For example, paths used +internally at Google all begin with 'google', and paths +denoting remote repositories begin with the path to the code, +such as 'github.com/user/repo'. + +As a special case, if the package list is a list of .go files from a +single directory, the command is applied to a single synthesized +package made up of exactly those files, ignoring any build constraints +in those files and ignoring any other files in the directory. + +Directory and file names that begin with "." or "_" are ignored +by the go tool, as are directories named "testdata". + + +Description of testing flags + +The 'go test' command takes both flags that apply to 'go test' itself +and flags that apply to the resulting test binary. + +Several of the flags control profiling and write an execution profile +suitable for "go tool pprof"; run "go tool pprof -h" for more +information. The --alloc_space, --alloc_objects, and --show_bytes +options of pprof control how the information is presented. + +The following flags are recognized by the 'go test' command and +control the execution of any test: + + -bench regexp + Run benchmarks matching the regular expression. + By default, no benchmarks run. To run all benchmarks, + use '-bench .' or '-bench=.'. + + -benchmem + Print memory allocation statistics for benchmarks. + + -benchtime t + Run enough iterations of each benchmark to take t, specified + as a time.Duration (for example, -benchtime 1h30s). + The default is 1 second (1s). + + -blockprofile block.out + Write a goroutine blocking profile to the specified file + when all tests are complete. + Writes test binary as -c would. + + -blockprofilerate n + Control the detail provided in goroutine blocking profiles by + calling runtime.SetBlockProfileRate with n. + See 'go doc runtime.SetBlockProfileRate'. + The profiler aims to sample, on average, one blocking event every + n nanoseconds the program spends blocked. By default, + if -test.blockprofile is set without this flag, all blocking events + are recorded, equivalent to -test.blockprofilerate=1. + + -count n + Run each test and benchmark n times (default 1). + If -cpu is set, run n times for each GOMAXPROCS value. + Examples are always run once. + + -cover + Enable coverage analysis. + + -covermode set,count,atomic + Set the mode for coverage analysis for the package[s] + being tested. The default is "set" unless -race is enabled, + in which case it is "atomic". + The values: + set: bool: does this statement run? + count: int: how many times does this statement run? + atomic: int: count, but correct in multithreaded tests; + significantly more expensive. + Sets -cover. + + -coverpkg pkg1,pkg2,pkg3 + Apply coverage analysis in each test to the given list of packages. + The default is for each test to analyze only the package being tested. + Packages are specified as import paths. + Sets -cover. + + -coverprofile cover.out + Write a coverage profile to the file after all tests have passed. + Sets -cover. + + -cpu 1,2,4 + Specify a list of GOMAXPROCS values for which the tests or + benchmarks should be executed. The default is the current value + of GOMAXPROCS. + + -cpuprofile cpu.out + Write a CPU profile to the specified file before exiting. + Writes test binary as -c would. + + -memprofile mem.out + Write a memory profile to the file after all tests have passed. + Writes test binary as -c would. + + -memprofilerate n + Enable more precise (and expensive) memory profiles by setting + runtime.MemProfileRate. See 'go doc runtime.MemProfileRate'. + To profile all memory allocations, use -test.memprofilerate=1 + and pass --alloc_space flag to the pprof tool. + + -outputdir directory + Place output files from profiling in the specified directory, + by default the directory in which "go test" is running. + + -parallel n + Allow parallel execution of test functions that call t.Parallel. + The value of this flag is the maximum number of tests to run + simultaneously; by default, it is set to the value of GOMAXPROCS. + + -run regexp + Run only those tests and examples matching the regular + expression. + + -short + Tell long-running tests to shorten their run time. + It is off by default but set during all.bash so that installing + the Go tree can run a sanity check but not spend time running + exhaustive tests. + + -timeout t + If a test runs longer than t, panic. + The default is 10 minutes (10m). + + -trace trace.out + Write an execution trace to the specified file before exiting. + Writes test binary as -c would. + + -v + Verbose output: log all tests as they are run. Also print all + text from Log and Logf calls even if the test succeeds. + +The test binary, called pkg.test where pkg is the name of the +directory containing the package sources, can be invoked directly +after building it with 'go test -c'. When invoking the test binary +directly, each of the standard flag names must be prefixed with 'test.', +as in -test.run=TestMyFunc or -test.v. + +When running 'go test', flags not listed above are passed through +unaltered. For instance, the command + + go test -x -v -cpuprofile=prof.out -dir=testdata -update + +will compile the test binary and then run it as + + pkg.test -test.v -test.cpuprofile=prof.out -dir=testdata -update + +The test flags that generate profiles (other than for coverage) also +leave the test binary in pkg.test for use when analyzing the profiles. + +Flags not recognized by 'go test' must be placed after any specified packages. + + +Description of testing functions + +The 'go test' command expects to find test, benchmark, and example functions +in the "*_test.go" files corresponding to the package under test. + +A test function is one named TestXXX (where XXX is any alphanumeric string +not starting with a lower case letter) and should have the signature, + + func TestXXX(t *testing.T) { ... } + +A benchmark function is one named BenchmarkXXX and should have the signature, + + func BenchmarkXXX(b *testing.B) { ... } + +An example function is similar to a test function but, instead of using +*testing.T to report success or failure, prints output to os.Stdout. +That output is compared against the function's "Output:" comment, which +must be the last comment in the function body (see example below). An +example with no such comment, or with no text after "Output:" is compiled +but not executed. + +Godoc displays the body of ExampleXXX to demonstrate the use +of the function, constant, or variable XXX. An example of a method M with +receiver type T or *T is named ExampleT_M. There may be multiple examples +for a given function, constant, or variable, distinguished by a trailing _xxx, +where xxx is a suffix not beginning with an upper case letter. + +Here is an example of an example: + + func ExamplePrintln() { + Println("The output of\nthis example.") + // Output: The output of + // this example. + } + +The entire test file is presented as the example when it contains a single +example function, at least one other function, type, variable, or constant +declaration, and no test or benchmark functions. + +See the documentation of the testing package for more information. + + +*/ +package main diff --git a/src/cmd/go/bootstrap.go b/src/cmd/go/bootstrap.go new file mode 100644 index 0000000000000000000000000000000000000000..1686df77afd863914fcfc04d8ceab716db357276 --- /dev/null +++ b/src/cmd/go/bootstrap.go @@ -0,0 +1,38 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build cmd_go_bootstrap + +// This code is compiled only into the bootstrap 'go' binary. +// These stubs avoid importing packages with large dependency +// trees, like the use of "net/http" in vcs.go. + +package main + +import ( + "errors" + "io" +) + +var errHTTP = errors.New("no http in bootstrap go command") + +type httpError struct { + statusCode int +} + +func (e *httpError) Error() string { + panic("unreachable") +} + +func httpGET(url string) ([]byte, error) { + return nil, errHTTP +} + +func httpsOrHTTP(importPath string, security securityMode) (string, io.ReadCloser, error) { + return "", nil, errHTTP +} + +func parseMetaGoImports(r io.Reader) ([]metaImport, error) { + panic("unreachable") +} diff --git a/src/cmd/go/build.go b/src/cmd/go/build.go new file mode 100644 index 0000000000000000000000000000000000000000..0b147252ec1a4c04ad210f51d8d8ffa510adf483 --- /dev/null +++ b/src/cmd/go/build.go @@ -0,0 +1,3362 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +import ( + "bufio" + "bytes" + "container/heap" + "debug/elf" + "errors" + "flag" + "fmt" + "go/build" + "io" + "io/ioutil" + "log" + "os" + "os/exec" + "path" + "path/filepath" + "regexp" + "runtime" + "strconv" + "strings" + "sync" + "time" +) + +var cmdBuild = &Command{ + UsageLine: "build [-o output] [-i] [build flags] [packages]", + Short: "compile packages and dependencies", + Long: ` +Build compiles the packages named by the import paths, +along with their dependencies, but it does not install the results. + +If the arguments to build are a list of .go files, build treats +them as a list of source files specifying a single package. + +When compiling a single main package, build writes +the resulting executable to an output file named after +the first source file ('go build ed.go rx.go' writes 'ed' or 'ed.exe') +or the source code directory ('go build unix/sam' writes 'sam' or 'sam.exe'). +The '.exe' suffix is added when writing a Windows executable. + +When compiling multiple packages or a single non-main package, +build compiles the packages but discards the resulting object, +serving only as a check that the packages can be built. + +The -o flag, only allowed when compiling a single package, +forces build to write the resulting executable or object +to the named output file, instead of the default behavior described +in the last two paragraphs. + +The -i flag installs the packages that are dependencies of the target. + +The build flags are shared by the build, clean, get, install, list, run, +and test commands: + + -a + force rebuilding of packages that are already up-to-date. + -n + print the commands but do not run them. + -p n + the number of builds that can be run in parallel. + The default is the number of CPUs available, except + on darwin/arm which defaults to 1. + -race + enable data race detection. + Supported only on linux/amd64, freebsd/amd64, darwin/amd64 and windows/amd64. + -v + print the names of packages as they are compiled. + -work + print the name of the temporary work directory and + do not delete it when exiting. + -x + print the commands. + + -asmflags 'flag list' + arguments to pass on each go tool asm invocation. + -buildmode mode + build mode to use. See 'go help buildmode' for more. + -compiler name + name of compiler to use, as in runtime.Compiler (gccgo or gc). + -gccgoflags 'arg list' + arguments to pass on each gccgo compiler/linker invocation. + -gcflags 'arg list' + arguments to pass on each go tool compile invocation. + -installsuffix suffix + a suffix to use in the name of the package installation directory, + in order to keep output separate from default builds. + If using the -race flag, the install suffix is automatically set to race + or, if set explicitly, has _race appended to it. Using a -buildmode + option that requires non-default compile flags has a similar effect. + -ldflags 'flag list' + arguments to pass on each go tool link invocation. + -linkshared + link against shared libraries previously created with + -buildmode=shared + -pkgdir dir + install and load all packages from dir instead of the usual locations. + For example, when building with a non-standard configuration, + use -pkgdir to keep generated packages in a separate location. + -tags 'tag list' + a list of build tags to consider satisfied during the build. + For more information about build tags, see the description of + build constraints in the documentation for the go/build package. + -toolexec 'cmd args' + a program to use to invoke toolchain programs like vet and asm. + For example, instead of running asm, the go command will run + 'cmd args /path/to/asm '. + +The list flags accept a space-separated list of strings. To embed spaces +in an element in the list, surround it with either single or double quotes. + +For more about specifying packages, see 'go help packages'. +For more about where packages and binaries are installed, +run 'go help gopath'. +For more about calling between Go and C/C++, run 'go help c'. + +Note: Build adheres to certain conventions such as those described +by 'go help gopath'. Not all projects can follow these conventions, +however. Installations that have their own conventions or that use +a separate software build system may choose to use lower-level +invocations such as 'go tool compile' and 'go tool link' to avoid +some of the overheads and design decisions of the build tool. + +See also: go install, go get, go clean. + `, +} + +func init() { + // break init cycle + cmdBuild.Run = runBuild + cmdInstall.Run = runInstall + + cmdBuild.Flag.BoolVar(&buildI, "i", false, "") + + addBuildFlags(cmdBuild) + addBuildFlags(cmdInstall) + + if buildContext.GOOS == "darwin" { + switch buildContext.GOARCH { + case "arm", "arm64": + // darwin/arm cannot run multiple tests simultaneously. + // Parallelism is limited in go_darwin_arm_exec, but + // also needs to be limited here so go test std does not + // timeout tests that waiting to run. + buildP = 1 + } + } +} + +// Flags set by multiple commands. +var buildA bool // -a flag +var buildN bool // -n flag +var buildP = runtime.NumCPU() // -p flag +var buildV bool // -v flag +var buildX bool // -x flag +var buildI bool // -i flag +var buildO = cmdBuild.Flag.String("o", "", "output file") +var buildWork bool // -work flag +var buildAsmflags []string // -asmflags flag +var buildGcflags []string // -gcflags flag +var buildLdflags []string // -ldflags flag +var buildGccgoflags []string // -gccgoflags flag +var buildRace bool // -race flag +var buildToolExec []string // -toolexec flag +var buildBuildmode string // -buildmode flag +var buildLinkshared bool // -linkshared flag +var buildPkgdir string // -pkgdir flag + +var buildContext = build.Default +var buildToolchain toolchain = noToolchain{} +var ldBuildmode string + +// buildCompiler implements flag.Var. +// It implements Set by updating both +// buildToolchain and buildContext.Compiler. +type buildCompiler struct{} + +func (c buildCompiler) Set(value string) error { + switch value { + case "gc": + buildToolchain = gcToolchain{} + case "gccgo": + buildToolchain = gccgoToolchain{} + default: + return fmt.Errorf("unknown compiler %q", value) + } + buildContext.Compiler = value + return nil +} + +func (c buildCompiler) String() string { + return buildContext.Compiler +} + +func init() { + switch build.Default.Compiler { + case "gc": + buildToolchain = gcToolchain{} + case "gccgo": + buildToolchain = gccgoToolchain{} + } +} + +// addBuildFlags adds the flags common to the build, clean, get, +// install, list, run, and test commands. +func addBuildFlags(cmd *Command) { + cmd.Flag.BoolVar(&buildA, "a", false, "") + cmd.Flag.BoolVar(&buildN, "n", false, "") + cmd.Flag.IntVar(&buildP, "p", buildP, "") + cmd.Flag.BoolVar(&buildV, "v", false, "") + cmd.Flag.BoolVar(&buildX, "x", false, "") + + cmd.Flag.Var((*stringsFlag)(&buildAsmflags), "asmflags", "") + cmd.Flag.Var(buildCompiler{}, "compiler", "") + cmd.Flag.StringVar(&buildBuildmode, "buildmode", "default", "") + cmd.Flag.Var((*stringsFlag)(&buildGcflags), "gcflags", "") + cmd.Flag.Var((*stringsFlag)(&buildGccgoflags), "gccgoflags", "") + cmd.Flag.StringVar(&buildContext.InstallSuffix, "installsuffix", "", "") + cmd.Flag.Var((*stringsFlag)(&buildLdflags), "ldflags", "") + cmd.Flag.BoolVar(&buildLinkshared, "linkshared", false, "") + cmd.Flag.StringVar(&buildPkgdir, "pkgdir", "", "") + cmd.Flag.BoolVar(&buildRace, "race", false, "") + cmd.Flag.Var((*stringsFlag)(&buildContext.BuildTags), "tags", "") + cmd.Flag.Var((*stringsFlag)(&buildToolExec), "toolexec", "") + cmd.Flag.BoolVar(&buildWork, "work", false, "") +} + +func addBuildFlagsNX(cmd *Command) { + cmd.Flag.BoolVar(&buildN, "n", false, "") + cmd.Flag.BoolVar(&buildX, "x", false, "") +} + +func isSpaceByte(c byte) bool { + return c == ' ' || c == '\t' || c == '\n' || c == '\r' +} + +// fileExtSplit expects a filename and returns the name +// and ext (without the dot). If the file has no +// extension, ext will be empty. +func fileExtSplit(file string) (name, ext string) { + dotExt := filepath.Ext(file) + name = file[:len(file)-len(dotExt)] + if dotExt != "" { + ext = dotExt[1:] + } + return +} + +type stringsFlag []string + +func (v *stringsFlag) Set(s string) error { + var err error + *v, err = splitQuotedFields(s) + if *v == nil { + *v = []string{} + } + return err +} + +func splitQuotedFields(s string) ([]string, error) { + // Split fields allowing '' or "" around elements. + // Quotes further inside the string do not count. + var f []string + for len(s) > 0 { + for len(s) > 0 && isSpaceByte(s[0]) { + s = s[1:] + } + if len(s) == 0 { + break + } + // Accepted quoted string. No unescaping inside. + if s[0] == '"' || s[0] == '\'' { + quote := s[0] + s = s[1:] + i := 0 + for i < len(s) && s[i] != quote { + i++ + } + if i >= len(s) { + return nil, fmt.Errorf("unterminated %c string", quote) + } + f = append(f, s[:i]) + s = s[i+1:] + continue + } + i := 0 + for i < len(s) && !isSpaceByte(s[i]) { + i++ + } + f = append(f, s[:i]) + s = s[i:] + } + return f, nil +} + +func (v *stringsFlag) String() string { + return "" +} + +func pkgsMain(pkgs []*Package) (res []*Package) { + for _, p := range pkgs { + if p.Name == "main" { + res = append(res, p) + } + } + return res +} + +func pkgsNotMain(pkgs []*Package) (res []*Package) { + for _, p := range pkgs { + if p.Name != "main" { + res = append(res, p) + } + } + return res +} + +var pkgsFilter = func(pkgs []*Package) []*Package { return pkgs } + +func buildModeInit() { + _, gccgo := buildToolchain.(gccgoToolchain) + var codegenArg string + platform := goos + "/" + goarch + switch buildBuildmode { + case "archive": + pkgsFilter = pkgsNotMain + case "c-archive": + pkgsFilter = func(p []*Package) []*Package { + if len(p) != 1 || p[0].Name != "main" { + fatalf("-buildmode=c-archive requires exactly one main package") + } + return p + } + exeSuffix = ".a" + ldBuildmode = "c-archive" + case "c-shared": + pkgsFilter = pkgsMain + if gccgo { + codegenArg = "-fPIC" + } else { + switch platform { + case "linux/amd64": + codegenArg = "-shared" + case "linux/arm": + buildAsmflags = append(buildAsmflags, "-shared") + case "darwin/amd64": + case "android/arm": + default: + fatalf("-buildmode=c-shared not supported on %s\n", platform) + } + } + ldBuildmode = "c-shared" + case "default": + ldBuildmode = "exe" + case "exe": + pkgsFilter = pkgsMain + ldBuildmode = "exe" + case "shared": + pkgsFilter = pkgsNotMain + if gccgo { + codegenArg = "-fPIC" + } else { + switch platform { + case "linux/amd64": + default: + fatalf("-buildmode=shared not supported on %s\n", platform) + } + codegenArg = "-dynlink" + } + if *buildO != "" { + fatalf("-buildmode=shared and -o not supported together") + } + ldBuildmode = "shared" + default: + fatalf("buildmode=%s not supported", buildBuildmode) + } + if buildLinkshared { + if gccgo { + codegenArg = "-fPIC" + } else { + if platform != "linux/amd64" { + fmt.Fprintf(os.Stderr, "go %s: -linkshared is only supported on linux/amd64\n", flag.Args()[0]) + os.Exit(2) + } + codegenArg = "-dynlink" + // TODO(mwhudson): remove -w when that gets fixed in linker. + buildLdflags = append(buildLdflags, "-linkshared", "-w") + } + } + if codegenArg != "" { + if gccgo { + buildGccgoflags = append(buildGccgoflags, codegenArg) + } else { + buildAsmflags = append(buildAsmflags, codegenArg) + buildGcflags = append(buildGcflags, codegenArg) + } + if buildContext.InstallSuffix != "" { + buildContext.InstallSuffix += "_" + } + buildContext.InstallSuffix += codegenArg[1:] + } +} + +func runBuild(cmd *Command, args []string) { + raceInit() + buildModeInit() + var b builder + b.init() + + pkgs := packagesForBuild(args) + + if len(pkgs) == 1 && pkgs[0].Name == "main" && *buildO == "" { + _, *buildO = path.Split(pkgs[0].ImportPath) + *buildO += exeSuffix + } + + // sanity check some often mis-used options + switch buildContext.Compiler { + case "gccgo": + if len(buildGcflags) != 0 { + fmt.Println("go build: when using gccgo toolchain, please pass compiler flags using -gccgoflags, not -gcflags") + } + if len(buildLdflags) != 0 { + fmt.Println("go build: when using gccgo toolchain, please pass linker flags using -gccgoflags, not -ldflags") + } + case "gc": + if len(buildGccgoflags) != 0 { + fmt.Println("go build: when using gc toolchain, please pass compile flags using -gcflags, and linker flags using -ldflags") + } + } + + depMode := modeBuild + if buildI { + depMode = modeInstall + } + + if *buildO != "" { + if len(pkgs) > 1 { + fatalf("go build: cannot use -o with multiple packages") + } else if len(pkgs) == 0 { + fatalf("no packages to build") + } + p := pkgs[0] + p.target = *buildO + p.Stale = true // must build - not up to date + a := b.action(modeInstall, depMode, p) + b.do(a) + return + } + + var a *action + if buildBuildmode == "shared" { + a = b.libaction(libname(args), pkgsFilter(packages(args)), modeBuild, depMode) + } else { + a = &action{} + for _, p := range pkgsFilter(packages(args)) { + a.deps = append(a.deps, b.action(modeBuild, depMode, p)) + } + } + b.do(a) +} + +var cmdInstall = &Command{ + UsageLine: "install [build flags] [packages]", + Short: "compile and install packages and dependencies", + Long: ` +Install compiles and installs the packages named by the import paths, +along with their dependencies. + +For more about the build flags, see 'go help build'. +For more about specifying packages, see 'go help packages'. + +See also: go build, go get, go clean. + `, +} + +// libname returns the filename to use for the shared library when using +// -buildmode=shared. The rules we use are: +// 1) Drop any trailing "/..."s if present +// 2) Change / to - +// 3) Join arguments with , +// So std -> libstd.so +// a b/... -> liba,b.so +// gopkg.in/tomb.v2 -> libgopkg.in-tomb.v2.so +func libname(args []string) string { + var libname string + for _, arg := range args { + arg = strings.TrimSuffix(arg, "/...") + arg = strings.Replace(arg, "/", "-", -1) + if libname == "" { + libname = arg + } else { + libname += "," + arg + } + } + // TODO(mwhudson): Needs to change for platforms that use different naming + // conventions... + return "lib" + libname + ".so" +} + +func runInstall(cmd *Command, args []string) { + raceInit() + buildModeInit() + pkgs := pkgsFilter(packagesForBuild(args)) + + for _, p := range pkgs { + if p.Target == "" && (!p.Standard || p.ImportPath != "unsafe") { + switch { + case p.gobinSubdir: + errorf("go install: cannot install cross-compiled binaries when GOBIN is set") + case p.cmdline: + errorf("go install: no install location for .go files listed on command line (GOBIN not set)") + case p.ConflictDir != "": + errorf("go install: no install location for %s: hidden by %s", p.Dir, p.ConflictDir) + default: + errorf("go install: no install location for directory %s outside GOPATH\n"+ + "\tFor more details see: go help gopath", p.Dir) + } + } + } + exitIfErrors() + + var b builder + b.init() + var a *action + if buildBuildmode == "shared" { + a = b.libaction(libname(args), pkgs, modeInstall, modeInstall) + } else { + a = &action{} + var tools []*action + for _, p := range pkgs { + // If p is a tool, delay the installation until the end of the build. + // This avoids installing assemblers/compilers that are being executed + // by other steps in the build. + // cmd/cgo is handled specially in b.action, so that we can + // both build and use it in the same 'go install'. + action := b.action(modeInstall, modeInstall, p) + if goTools[p.ImportPath] == toTool && p.ImportPath != "cmd/cgo" { + a.deps = append(a.deps, action.deps...) + action.deps = append(action.deps, a) + tools = append(tools, action) + continue + } + a.deps = append(a.deps, action) + } + if len(tools) > 0 { + a = &action{ + deps: tools, + } + } + } + b.do(a) + exitIfErrors() + + // Success. If this command is 'go install' with no arguments + // and the current directory (the implicit argument) is a command, + // remove any leftover command binary from a previous 'go build'. + // The binary is installed; it's not needed here anymore. + // And worse it might be a stale copy, which you don't want to find + // instead of the installed one if $PATH contains dot. + // One way to view this behavior is that it is as if 'go install' first + // runs 'go build' and the moves the generated file to the install dir. + // See issue 9645. + if len(args) == 0 && len(pkgs) == 1 && pkgs[0].Name == "main" { + // Compute file 'go build' would have created. + // If it exists and is an executable file, remove it. + _, targ := filepath.Split(pkgs[0].ImportPath) + targ += exeSuffix + if filepath.Join(pkgs[0].Dir, targ) != pkgs[0].Target { // maybe $GOBIN is the current directory + fi, err := os.Stat(targ) + if err == nil { + m := fi.Mode() + if m.IsRegular() { + if m&0111 != 0 || goos == "windows" { // windows never sets executable bit + os.Remove(targ) + } + } + } + } + } +} + +// Global build parameters (used during package load) +var ( + goarch string + goos string + exeSuffix string +) + +func init() { + goarch = buildContext.GOARCH + goos = buildContext.GOOS + if goos == "windows" { + exeSuffix = ".exe" + } +} + +// A builder holds global state about a build. +// It does not hold per-package state, because we +// build packages in parallel, and the builder is shared. +type builder struct { + work string // the temporary work directory (ends in filepath.Separator) + actionCache map[cacheKey]*action // a cache of already-constructed actions + mkdirCache map[string]bool // a cache of created directories + print func(args ...interface{}) (int, error) + + output sync.Mutex + scriptDir string // current directory in printed script + + exec sync.Mutex + readySema chan bool + ready actionQueue +} + +// An action represents a single action in the action graph. +type action struct { + p *Package // the package this action works on + deps []*action // actions that must happen before this one + triggers []*action // inverse of deps + cgo *action // action for cgo binary if needed + args []string // additional args for runProgram + testOutput *bytes.Buffer // test output buffer + + f func(*builder, *action) error // the action itself (nil = no-op) + ignoreFail bool // whether to run f even if dependencies fail + + // Generated files, directories. + link bool // target is executable, not just package + pkgdir string // the -I or -L argument to use when importing this package + objdir string // directory for intermediate objects + objpkg string // the intermediate package .a file created during the action + target string // goal of the action: the created package or executable + + // Execution state. + pending int // number of deps yet to complete + priority int // relative execution priority + failed bool // whether the action failed +} + +// cacheKey is the key for the action cache. +type cacheKey struct { + mode buildMode + p *Package + shlib string +} + +// buildMode specifies the build mode: +// are we just building things or also installing the results? +type buildMode int + +const ( + modeBuild buildMode = iota + modeInstall +) + +var ( + goroot = filepath.Clean(runtime.GOROOT()) + gobin = os.Getenv("GOBIN") + gorootBin = filepath.Join(goroot, "bin") + gorootPkg = filepath.Join(goroot, "pkg") + gorootSrc = filepath.Join(goroot, "src") +) + +func (b *builder) init() { + var err error + b.print = func(a ...interface{}) (int, error) { + return fmt.Fprint(os.Stderr, a...) + } + b.actionCache = make(map[cacheKey]*action) + b.mkdirCache = make(map[string]bool) + + if buildN { + b.work = "$WORK" + } else { + b.work, err = ioutil.TempDir("", "go-build") + if err != nil { + fatalf("%s", err) + } + if buildX || buildWork { + fmt.Fprintf(os.Stderr, "WORK=%s\n", b.work) + } + if !buildWork { + workdir := b.work + atexit(func() { os.RemoveAll(workdir) }) + } + } +} + +// goFilesPackage creates a package for building a collection of Go files +// (typically named on the command line). The target is named p.a for +// package p or named after the first Go file for package main. +func goFilesPackage(gofiles []string) *Package { + // TODO: Remove this restriction. + for _, f := range gofiles { + if !strings.HasSuffix(f, ".go") { + fatalf("named files must be .go files") + } + } + + var stk importStack + ctxt := buildContext + ctxt.UseAllFiles = true + + // Synthesize fake "directory" that only shows the named files, + // to make it look like this is a standard package or + // command directory. So that local imports resolve + // consistently, the files must all be in the same directory. + var dirent []os.FileInfo + var dir string + for _, file := range gofiles { + fi, err := os.Stat(file) + if err != nil { + fatalf("%s", err) + } + if fi.IsDir() { + fatalf("%s is a directory, should be a Go file", file) + } + dir1, _ := filepath.Split(file) + if dir1 == "" { + dir1 = "./" + } + if dir == "" { + dir = dir1 + } else if dir != dir1 { + fatalf("named files must all be in one directory; have %s and %s", dir, dir1) + } + dirent = append(dirent, fi) + } + ctxt.ReadDir = func(string) ([]os.FileInfo, error) { return dirent, nil } + + var err error + if dir == "" { + dir = cwd + } + dir, err = filepath.Abs(dir) + if err != nil { + fatalf("%s", err) + } + + bp, err := ctxt.ImportDir(dir, 0) + pkg := new(Package) + pkg.local = true + pkg.cmdline = true + pkg.load(&stk, bp, err) + pkg.localPrefix = dirToImportPath(dir) + pkg.ImportPath = "command-line-arguments" + pkg.target = "" + + if pkg.Name == "main" { + _, elem := filepath.Split(gofiles[0]) + exe := elem[:len(elem)-len(".go")] + exeSuffix + if *buildO == "" { + *buildO = exe + } + if gobin != "" { + pkg.target = filepath.Join(gobin, exe) + } + } + + pkg.Target = pkg.target + pkg.Stale = true + + computeStale(pkg) + return pkg +} + +// readpkglist returns the list of packages that were built into the shared library +// at shlibpath. For the native toolchain this list is stored, newline separated, in +// an ELF note with name "Go\x00\x00" and type 1. For GCCGO it is extracted from the +// .go_export section. +func readpkglist(shlibpath string) (pkgs []*Package) { + var stk importStack + if _, gccgo := buildToolchain.(gccgoToolchain); gccgo { + f, _ := elf.Open(shlibpath) + sect := f.Section(".go_export") + data, _ := sect.Data() + scanner := bufio.NewScanner(bytes.NewBuffer(data)) + for scanner.Scan() { + t := scanner.Text() + if strings.HasPrefix(t, "pkgpath ") { + t = strings.TrimPrefix(t, "pkgpath ") + t = strings.TrimSuffix(t, ";") + pkgs = append(pkgs, loadPackage(t, &stk)) + } + } + } else { + pkglistbytes, err := readELFNote(shlibpath, "Go\x00\x00", 1) + if err != nil { + fatalf("readELFNote failed: %v", err) + } + scanner := bufio.NewScanner(bytes.NewBuffer(pkglistbytes)) + for scanner.Scan() { + t := scanner.Text() + pkgs = append(pkgs, loadPackage(t, &stk)) + } + } + return +} + +// action returns the action for applying the given operation (mode) to the package. +// depMode is the action to use when building dependencies. +// action never looks for p in a shared library. +func (b *builder) action(mode buildMode, depMode buildMode, p *Package) *action { + return b.action1(mode, depMode, p, false) +} + +// action1 returns the action for applying the given operation (mode) to the package. +// depMode is the action to use when building dependencies. +// action1 will look for p in a shared library if lookshared is true. +func (b *builder) action1(mode buildMode, depMode buildMode, p *Package, lookshared bool) *action { + shlib := "" + if lookshared { + shlib = p.Shlib + } + key := cacheKey{mode, p, shlib} + + a := b.actionCache[key] + if a != nil { + return a + } + if shlib != "" { + key2 := cacheKey{modeInstall, nil, shlib} + a = b.actionCache[key2] + if a != nil { + b.actionCache[key] = a + return a + } + pkgs := readpkglist(shlib) + a = b.libaction(filepath.Base(shlib), pkgs, modeInstall, depMode) + b.actionCache[key2] = a + b.actionCache[key] = a + return a + } + + a = &action{p: p, pkgdir: p.build.PkgRoot} + if p.pkgdir != "" { // overrides p.t + a.pkgdir = p.pkgdir + } + b.actionCache[key] = a + + for _, p1 := range p.imports { + ls := buildLinkshared + // If p1 is part of the same shared library as p, we need the action + // that builds p here, not the shared libary or we get action loops. + if p1.Shlib == p.Shlib { + ls = false + } + a.deps = append(a.deps, b.action1(depMode, depMode, p1, ls)) + } + + // If we are not doing a cross-build, then record the binary we'll + // generate for cgo as a dependency of the build of any package + // using cgo, to make sure we do not overwrite the binary while + // a package is using it. If this is a cross-build, then the cgo we + // are writing is not the cgo we need to use. + if goos == runtime.GOOS && goarch == runtime.GOARCH && !buildRace { + if (len(p.CgoFiles) > 0 || p.Standard && p.ImportPath == "runtime/cgo") && !buildLinkshared && buildBuildmode != "shared" { + var stk importStack + p1 := loadPackage("cmd/cgo", &stk) + if p1.Error != nil { + fatalf("load cmd/cgo: %v", p1.Error) + } + a.cgo = b.action(depMode, depMode, p1) + a.deps = append(a.deps, a.cgo) + } + } + + if p.Standard { + switch p.ImportPath { + case "builtin", "unsafe": + // Fake packages - nothing to build. + return a + } + // gccgo standard library is "fake" too. + if _, ok := buildToolchain.(gccgoToolchain); ok { + // the target name is needed for cgo. + a.target = p.target + return a + } + } + + if !p.Stale && p.target != "" { + // p.Stale==false implies that p.target is up-to-date. + // Record target name for use by actions depending on this one. + a.target = p.target + return a + } + + if p.local && p.target == "" { + // Imported via local path. No permanent target. + mode = modeBuild + } + work := p.pkgdir + if work == "" { + work = b.work + } + a.objdir = filepath.Join(work, a.p.ImportPath, "_obj") + string(filepath.Separator) + a.objpkg = buildToolchain.pkgpath(work, a.p) + a.link = p.Name == "main" + + switch mode { + case modeInstall: + a.f = (*builder).install + a.deps = []*action{b.action1(modeBuild, depMode, p, lookshared)} + a.target = a.p.target + + // Install header for cgo in c-archive and c-shared modes. + if p.usesCgo() && (buildBuildmode == "c-archive" || buildBuildmode == "c-shared") { + ah := &action{ + p: a.p, + deps: []*action{a.deps[0]}, + f: (*builder).installHeader, + pkgdir: a.pkgdir, + objdir: a.objdir, + target: a.target[:len(a.target)-len(filepath.Ext(a.target))] + ".h", + } + a.deps = append(a.deps, ah) + } + + case modeBuild: + a.f = (*builder).build + a.target = a.objpkg + if a.link { + // An executable file. (This is the name of a temporary file.) + // Because we run the temporary file in 'go run' and 'go test', + // the name will show up in ps listings. If the caller has specified + // a name, use that instead of a.out. The binary is generated + // in an otherwise empty subdirectory named exe to avoid + // naming conflicts. The only possible conflict is if we were + // to create a top-level package named exe. + name := "a.out" + if p.exeName != "" { + name = p.exeName + } else if goos == "darwin" && buildBuildmode == "c-shared" && p.target != "" { + // On OS X, the linker output name gets recorded in the + // shared library's LC_ID_DYLIB load command. + // The code invoking the linker knows to pass only the final + // path element. Arrange that the path element matches what + // we'll install it as; otherwise the library is only loadable as "a.out". + _, name = filepath.Split(p.target) + } + a.target = a.objdir + filepath.Join("exe", name) + exeSuffix + } + } + + return a +} + +func (b *builder) libaction(libname string, pkgs []*Package, mode, depMode buildMode) *action { + a := &action{} + if mode == modeBuild { + a.f = (*builder).linkShared + a.target = filepath.Join(b.work, libname) + for _, p := range pkgs { + if p.target == "" { + continue + } + a.deps = append(a.deps, b.action(depMode, depMode, p)) + } + } else if mode == modeInstall { + // Currently build mode shared forces external linking mode, and + // external linking mode forces an import of runtime/cgo. So if it + // was not passed on the command line and it is not present in + // another shared library, add it here. + seencgo := false + _, gccgo := buildToolchain.(gccgoToolchain) + if !gccgo { + for _, p := range pkgs { + seencgo = seencgo || (p.Standard && p.ImportPath == "runtime/cgo") + } + if !seencgo { + var stk importStack + p := loadPackage("runtime/cgo", &stk) + if p.Error != nil { + fatalf("load runtime/cgo: %v", p.Error) + } + computeStale(p) + // If runtime/cgo is in another shared library, then that's + // also the shared library that contains runtime, so + // something will depend on it and so runtime/cgo's staleness + // will be checked when processing that library. + if p.Shlib == "" || p.Shlib == libname { + pkgs = append([]*Package{}, pkgs...) + pkgs = append(pkgs, p) + } + } + } + + // Figure out where the library will go. + var libdir string + for _, p := range pkgs { + plibdir := p.build.PkgTargetRoot + if gccgo { + plibdir = filepath.Join(plibdir, "shlibs") + } + if libdir == "" { + libdir = plibdir + } else if libdir != plibdir { + fatalf("multiple roots %s & %s", libdir, plibdir) + } + } + a.target = filepath.Join(libdir, libname) + + // Now we can check whether we need to rebuild it. + stale := false + var built time.Time + if fi, err := os.Stat(a.target); err == nil { + built = fi.ModTime() + } + for _, p := range pkgs { + if p.target == "" { + continue + } + stale = stale || p.Stale + lstat, err := os.Stat(p.target) + if err != nil || lstat.ModTime().After(built) { + stale = true + } + a.deps = append(a.deps, b.action(depMode, depMode, p)) + } + + if stale { + a.f = (*builder).install + buildAction := b.libaction(libname, pkgs, modeBuild, depMode) + a.deps = []*action{buildAction} + for _, p := range pkgs { + if p.target == "" { + continue + } + shlibnameaction := &action{} + shlibnameaction.f = (*builder).installShlibname + shlibnameaction.target = p.target[:len(p.target)-2] + ".shlibname" + a.deps = append(a.deps, shlibnameaction) + shlibnameaction.deps = append(shlibnameaction.deps, buildAction) + } + } + } else { + fatalf("unregonized mode %v", mode) + } + return a +} + +// actionList returns the list of actions in the dag rooted at root +// as visited in a depth-first post-order traversal. +func actionList(root *action) []*action { + seen := map[*action]bool{} + all := []*action{} + var walk func(*action) + walk = func(a *action) { + if seen[a] { + return + } + seen[a] = true + for _, a1 := range a.deps { + walk(a1) + } + all = append(all, a) + } + walk(root) + return all +} + +// allArchiveActions returns a list of the archive dependencies of root. +// This is needed because if package p depends on package q that is in libr.so, the +// action graph looks like p->libr.so->q and so just scanning through p's +// dependencies does not find the import dir for q. +func allArchiveActions(root *action) []*action { + seen := map[*action]bool{} + r := []*action{} + var walk func(*action) + walk = func(a *action) { + if seen[a] { + return + } + seen[a] = true + if strings.HasSuffix(a.target, ".so") || a == root { + for _, a1 := range a.deps { + walk(a1) + } + } else if strings.HasSuffix(a.target, ".a") { + r = append(r, a) + } + } + walk(root) + return r +} + +// do runs the action graph rooted at root. +func (b *builder) do(root *action) { + // Build list of all actions, assigning depth-first post-order priority. + // The original implementation here was a true queue + // (using a channel) but it had the effect of getting + // distracted by low-level leaf actions to the detriment + // of completing higher-level actions. The order of + // work does not matter much to overall execution time, + // but when running "go test std" it is nice to see each test + // results as soon as possible. The priorities assigned + // ensure that, all else being equal, the execution prefers + // to do what it would have done first in a simple depth-first + // dependency order traversal. + all := actionList(root) + for i, a := range all { + a.priority = i + } + + b.readySema = make(chan bool, len(all)) + + // Initialize per-action execution state. + for _, a := range all { + for _, a1 := range a.deps { + a1.triggers = append(a1.triggers, a) + } + a.pending = len(a.deps) + if a.pending == 0 { + b.ready.push(a) + b.readySema <- true + } + } + + // Handle runs a single action and takes care of triggering + // any actions that are runnable as a result. + handle := func(a *action) { + var err error + if a.f != nil && (!a.failed || a.ignoreFail) { + err = a.f(b, a) + } + + // The actions run in parallel but all the updates to the + // shared work state are serialized through b.exec. + b.exec.Lock() + defer b.exec.Unlock() + + if err != nil { + if err == errPrintedOutput { + setExitStatus(2) + } else { + errorf("%s", err) + } + a.failed = true + } + + for _, a0 := range a.triggers { + if a.failed { + a0.failed = true + } + if a0.pending--; a0.pending == 0 { + b.ready.push(a0) + b.readySema <- true + } + } + + if a == root { + close(b.readySema) + } + } + + var wg sync.WaitGroup + + // Kick off goroutines according to parallelism. + // If we are using the -n flag (just printing commands) + // drop the parallelism to 1, both to make the output + // deterministic and because there is no real work anyway. + par := buildP + if buildN { + par = 1 + } + for i := 0; i < par; i++ { + wg.Add(1) + go func() { + defer wg.Done() + for { + select { + case _, ok := <-b.readySema: + if !ok { + return + } + // Receiving a value from b.readySema entitles + // us to take from the ready queue. + b.exec.Lock() + a := b.ready.pop() + b.exec.Unlock() + handle(a) + case <-interrupted: + setExitStatus(1) + return + } + } + }() + } + + wg.Wait() +} + +// hasString reports whether s appears in the list of strings. +func hasString(strings []string, s string) bool { + for _, t := range strings { + if s == t { + return true + } + } + return false +} + +// build is the action for building a single package or command. +func (b *builder) build(a *action) (err error) { + // Return an error if the package has CXX files but it's not using + // cgo nor SWIG, since the CXX files can only be processed by cgo + // and SWIG. + if len(a.p.CXXFiles) > 0 && !a.p.usesCgo() && !a.p.usesSwig() { + return fmt.Errorf("can't build package %s because it contains C++ files (%s) but it's not using cgo nor SWIG", + a.p.ImportPath, strings.Join(a.p.CXXFiles, ",")) + } + // Same as above for Objective-C files + if len(a.p.MFiles) > 0 && !a.p.usesCgo() && !a.p.usesSwig() { + return fmt.Errorf("can't build package %s because it contains Objective-C files (%s) but it's not using cgo nor SWIG", + a.p.ImportPath, strings.Join(a.p.MFiles, ",")) + } + defer func() { + if err != nil && err != errPrintedOutput { + err = fmt.Errorf("go build %s: %v", a.p.ImportPath, err) + } + }() + if buildN { + // In -n mode, print a banner between packages. + // The banner is five lines so that when changes to + // different sections of the bootstrap script have to + // be merged, the banners give patch something + // to use to find its context. + fmt.Printf("\n#\n# %s\n#\n\n", a.p.ImportPath) + } + + if buildV { + fmt.Fprintf(os.Stderr, "%s\n", a.p.ImportPath) + } + + if a.p.Standard && a.p.ImportPath == "runtime" && buildContext.Compiler == "gc" && + (!hasString(a.p.GoFiles, "zgoos_"+buildContext.GOOS+".go") || + !hasString(a.p.GoFiles, "zgoarch_"+buildContext.GOARCH+".go")) { + return fmt.Errorf("%s/%s must be bootstrapped using make%v", buildContext.GOOS, buildContext.GOARCH, defaultSuffix()) + } + + // Make build directory. + obj := a.objdir + if err := b.mkdir(obj); err != nil { + return err + } + + // make target directory + dir, _ := filepath.Split(a.target) + if dir != "" { + if err := b.mkdir(dir); err != nil { + return err + } + } + + var gofiles, cgofiles, cfiles, sfiles, cxxfiles, objects, cgoObjects, pcCFLAGS, pcLDFLAGS []string + + gofiles = append(gofiles, a.p.GoFiles...) + cgofiles = append(cgofiles, a.p.CgoFiles...) + cfiles = append(cfiles, a.p.CFiles...) + sfiles = append(sfiles, a.p.SFiles...) + cxxfiles = append(cxxfiles, a.p.CXXFiles...) + + if a.p.usesCgo() || a.p.usesSwig() { + if pcCFLAGS, pcLDFLAGS, err = b.getPkgConfigFlags(a.p); err != nil { + return + } + } + + // Run SWIG on each .swig and .swigcxx file. + // Each run will generate two files, a .go file and a .c or .cxx file. + // The .go file will use import "C" and is to be processed by cgo. + if a.p.usesSwig() { + outGo, outC, outCXX, err := b.swig(a.p, obj, pcCFLAGS) + if err != nil { + return err + } + cgofiles = append(cgofiles, outGo...) + cfiles = append(cfiles, outC...) + cxxfiles = append(cxxfiles, outCXX...) + } + + // Run cgo. + if a.p.usesCgo() || a.p.usesSwig() { + // In a package using cgo, cgo compiles the C, C++ and assembly files with gcc. + // There is one exception: runtime/cgo's job is to bridge the + // cgo and non-cgo worlds, so it necessarily has files in both. + // In that case gcc only gets the gcc_* files. + var gccfiles []string + if a.p.Standard && a.p.ImportPath == "runtime/cgo" { + filter := func(files, nongcc, gcc []string) ([]string, []string) { + for _, f := range files { + if strings.HasPrefix(f, "gcc_") { + gcc = append(gcc, f) + } else { + nongcc = append(nongcc, f) + } + } + return nongcc, gcc + } + cfiles, gccfiles = filter(cfiles, cfiles[:0], gccfiles) + sfiles, gccfiles = filter(sfiles, sfiles[:0], gccfiles) + } else { + gccfiles = append(cfiles, sfiles...) + cfiles = nil + sfiles = nil + } + + cgoExe := tool("cgo") + if a.cgo != nil && a.cgo.target != "" { + cgoExe = a.cgo.target + } + outGo, outObj, err := b.cgo(a.p, cgoExe, obj, pcCFLAGS, pcLDFLAGS, cgofiles, gccfiles, cxxfiles, a.p.MFiles) + if err != nil { + return err + } + cgoObjects = append(cgoObjects, outObj...) + gofiles = append(gofiles, outGo...) + } + + if len(gofiles) == 0 { + return &build.NoGoError{Dir: a.p.Dir} + } + + // If we're doing coverage, preprocess the .go files and put them in the work directory + if a.p.coverMode != "" { + for i, file := range gofiles { + var sourceFile string + var coverFile string + var key string + if strings.HasSuffix(file, ".cgo1.go") { + // cgo files have absolute paths + base := filepath.Base(file) + sourceFile = file + coverFile = filepath.Join(obj, base) + key = strings.TrimSuffix(base, ".cgo1.go") + ".go" + } else { + sourceFile = filepath.Join(a.p.Dir, file) + coverFile = filepath.Join(obj, file) + key = file + } + cover := a.p.coverVars[key] + if cover == nil || isTestFile(file) { + // Not covering this file. + continue + } + if err := b.cover(a, coverFile, sourceFile, 0666, cover.Var); err != nil { + return err + } + gofiles[i] = coverFile + } + } + + // Prepare Go import path list. + inc := b.includeArgs("-I", allArchiveActions(a)) + + // Compile Go. + ofile, out, err := buildToolchain.gc(b, a.p, a.objpkg, obj, len(sfiles) > 0, inc, gofiles) + if len(out) > 0 { + b.showOutput(a.p.Dir, a.p.ImportPath, b.processOutput(out)) + if err != nil { + return errPrintedOutput + } + } + if err != nil { + return err + } + if ofile != a.objpkg { + objects = append(objects, ofile) + } + + // Copy .h files named for goos or goarch or goos_goarch + // to names using GOOS and GOARCH. + // For example, defs_linux_amd64.h becomes defs_GOOS_GOARCH.h. + _goos_goarch := "_" + goos + "_" + goarch + _goos := "_" + goos + _goarch := "_" + goarch + for _, file := range a.p.HFiles { + name, ext := fileExtSplit(file) + switch { + case strings.HasSuffix(name, _goos_goarch): + targ := file[:len(name)-len(_goos_goarch)] + "_GOOS_GOARCH." + ext + if err := b.copyFile(a, obj+targ, filepath.Join(a.p.Dir, file), 0644, true); err != nil { + return err + } + case strings.HasSuffix(name, _goarch): + targ := file[:len(name)-len(_goarch)] + "_GOARCH." + ext + if err := b.copyFile(a, obj+targ, filepath.Join(a.p.Dir, file), 0644, true); err != nil { + return err + } + case strings.HasSuffix(name, _goos): + targ := file[:len(name)-len(_goos)] + "_GOOS." + ext + if err := b.copyFile(a, obj+targ, filepath.Join(a.p.Dir, file), 0644, true); err != nil { + return err + } + } + } + + for _, file := range cfiles { + out := file[:len(file)-len(".c")] + ".o" + if err := buildToolchain.cc(b, a.p, obj, obj+out, file); err != nil { + return err + } + objects = append(objects, out) + } + + // Assemble .s files. + for _, file := range sfiles { + out := file[:len(file)-len(".s")] + ".o" + if err := buildToolchain.asm(b, a.p, obj, obj+out, file); err != nil { + return err + } + objects = append(objects, out) + } + + // NOTE(rsc): On Windows, it is critically important that the + // gcc-compiled objects (cgoObjects) be listed after the ordinary + // objects in the archive. I do not know why this is. + // https://golang.org/issue/2601 + objects = append(objects, cgoObjects...) + + // Add system object files. + for _, syso := range a.p.SysoFiles { + objects = append(objects, filepath.Join(a.p.Dir, syso)) + } + + // Pack into archive in obj directory. + // If the Go compiler wrote an archive, we only need to add the + // object files for non-Go sources to the archive. + // If the Go compiler wrote an archive and the package is entirely + // Go sources, there is no pack to execute at all. + if len(objects) > 0 { + if err := buildToolchain.pack(b, a.p, obj, a.objpkg, objects); err != nil { + return err + } + } + + // Link if needed. + if a.link { + // The compiler only cares about direct imports, but the + // linker needs the whole dependency tree. + all := actionList(a) + all = all[:len(all)-1] // drop a + if err := buildToolchain.ld(b, a, a.target, all, a.objpkg, objects); err != nil { + return err + } + } + + return nil +} + +// Calls pkg-config if needed and returns the cflags/ldflags needed to build the package. +func (b *builder) getPkgConfigFlags(p *Package) (cflags, ldflags []string, err error) { + if pkgs := p.CgoPkgConfig; len(pkgs) > 0 { + var out []byte + out, err = b.runOut(p.Dir, p.ImportPath, nil, "pkg-config", "--cflags", pkgs) + if err != nil { + b.showOutput(p.Dir, "pkg-config --cflags "+strings.Join(pkgs, " "), string(out)) + b.print(err.Error() + "\n") + err = errPrintedOutput + return + } + if len(out) > 0 { + cflags = strings.Fields(string(out)) + } + out, err = b.runOut(p.Dir, p.ImportPath, nil, "pkg-config", "--libs", pkgs) + if err != nil { + b.showOutput(p.Dir, "pkg-config --libs "+strings.Join(pkgs, " "), string(out)) + b.print(err.Error() + "\n") + err = errPrintedOutput + return + } + if len(out) > 0 { + ldflags = strings.Fields(string(out)) + } + } + return +} + +func (b *builder) installShlibname(a *action) error { + a1 := a.deps[0] + err := ioutil.WriteFile(a.target, []byte(filepath.Base(a1.target)+"\n"), 0644) + if err != nil { + return err + } + if buildX { + b.showcmd("", "echo '%s' > %s # internal", filepath.Base(a1.target), a.target) + } + return nil +} + +func (b *builder) linkShared(a *action) (err error) { + allactions := actionList(a) + allactions = allactions[:len(allactions)-1] + return buildToolchain.ldShared(b, a.deps, a.target, allactions) +} + +// install is the action for installing a single package or executable. +func (b *builder) install(a *action) (err error) { + defer func() { + if err != nil && err != errPrintedOutput { + err = fmt.Errorf("go install %s: %v", a.p.ImportPath, err) + } + }() + a1 := a.deps[0] + perm := os.FileMode(0644) + if a1.link { + switch buildBuildmode { + case "c-archive", "c-shared": + default: + perm = 0755 + } + } + + // make target directory + dir, _ := filepath.Split(a.target) + if dir != "" { + if err := b.mkdir(dir); err != nil { + return err + } + } + + // remove object dir to keep the amount of + // garbage down in a large build. On an operating system + // with aggressive buffering, cleaning incrementally like + // this keeps the intermediate objects from hitting the disk. + if !buildWork { + defer os.RemoveAll(a1.objdir) + defer os.Remove(a1.target) + } + + return b.moveOrCopyFile(a, a.target, a1.target, perm, false) +} + +// includeArgs returns the -I or -L directory list for access +// to the results of the list of actions. +func (b *builder) includeArgs(flag string, all []*action) []string { + inc := []string{} + incMap := map[string]bool{ + b.work: true, // handled later + gorootPkg: true, + "": true, // ignore empty strings + } + + // Look in the temporary space for results of test-specific actions. + // This is the $WORK/my/package/_test directory for the + // package being built, so there are few of these. + for _, a1 := range all { + if a1.p == nil { + continue + } + if dir := a1.pkgdir; dir != a1.p.build.PkgRoot && !incMap[dir] { + incMap[dir] = true + inc = append(inc, flag, dir) + } + } + + // Also look in $WORK for any non-test packages that have + // been built but not installed. + inc = append(inc, flag, b.work) + + // Finally, look in the installed package directories for each action. + for _, a1 := range all { + if a1.p == nil { + continue + } + if dir := a1.pkgdir; dir == a1.p.build.PkgRoot && !incMap[dir] { + incMap[dir] = true + inc = append(inc, flag, a1.p.build.PkgTargetRoot) + } + } + + return inc +} + +// moveOrCopyFile is like 'mv src dst' or 'cp src dst'. +func (b *builder) moveOrCopyFile(a *action, dst, src string, perm os.FileMode, force bool) error { + if buildN { + b.showcmd("", "mv %s %s", src, dst) + return nil + } + + // If we can update the mode and rename to the dst, do it. + // Otherwise fall back to standard copy. + if err := os.Chmod(src, perm); err == nil { + if err := os.Rename(src, dst); err == nil { + if buildX { + b.showcmd("", "mv %s %s", src, dst) + } + return nil + } + } + + return b.copyFile(a, dst, src, perm, force) +} + +// copyFile is like 'cp src dst'. +func (b *builder) copyFile(a *action, dst, src string, perm os.FileMode, force bool) error { + if buildN || buildX { + b.showcmd("", "cp %s %s", src, dst) + if buildN { + return nil + } + } + + sf, err := os.Open(src) + if err != nil { + return err + } + defer sf.Close() + + // Be careful about removing/overwriting dst. + // Do not remove/overwrite if dst exists and is a directory + // or a non-object file. + if fi, err := os.Stat(dst); err == nil { + if fi.IsDir() { + return fmt.Errorf("build output %q already exists and is a directory", dst) + } + if !force && !isObject(dst) { + return fmt.Errorf("build output %q already exists and is not an object file", dst) + } + } + + // On Windows, remove lingering ~ file from last attempt. + if toolIsWindows { + if _, err := os.Stat(dst + "~"); err == nil { + os.Remove(dst + "~") + } + } + + os.Remove(dst) + df, err := os.OpenFile(dst, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, perm) + if err != nil && toolIsWindows { + // Windows does not allow deletion of a binary file + // while it is executing. Try to move it out of the way. + // If the move fails, which is likely, we'll try again the + // next time we do an install of this binary. + if err := os.Rename(dst, dst+"~"); err == nil { + os.Remove(dst + "~") + } + df, err = os.OpenFile(dst, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, perm) + } + if err != nil { + return err + } + + _, err = io.Copy(df, sf) + df.Close() + if err != nil { + os.Remove(dst) + return fmt.Errorf("copying %s to %s: %v", src, dst, err) + } + return nil +} + +// Install the cgo export header file, if there is one. +func (b *builder) installHeader(a *action) error { + src := a.objdir + "_cgo_install.h" + if _, err := os.Stat(src); os.IsNotExist(err) { + // If the file does not exist, there are no exported + // functions, and we do not install anything. + return nil + } + + dir, _ := filepath.Split(a.target) + if dir != "" { + if err := b.mkdir(dir); err != nil { + return err + } + } + + return b.moveOrCopyFile(a, a.target, src, 0644, true) +} + +// cover runs, in effect, +// go tool cover -mode=b.coverMode -var="varName" -o dst.go src.go +func (b *builder) cover(a *action, dst, src string, perm os.FileMode, varName string) error { + return b.run(a.objdir, "cover "+a.p.ImportPath, nil, + buildToolExec, + tool("cover"), + "-mode", a.p.coverMode, + "-var", varName, + "-o", dst, + src) +} + +var objectMagic = [][]byte{ + {'!', '<', 'a', 'r', 'c', 'h', '>', '\n'}, // Package archive + {'\x7F', 'E', 'L', 'F'}, // ELF + {0xFE, 0xED, 0xFA, 0xCE}, // Mach-O big-endian 32-bit + {0xFE, 0xED, 0xFA, 0xCF}, // Mach-O big-endian 64-bit + {0xCE, 0xFA, 0xED, 0xFE}, // Mach-O little-endian 32-bit + {0xCF, 0xFA, 0xED, 0xFE}, // Mach-O little-endian 64-bit + {0x4d, 0x5a, 0x90, 0x00, 0x03, 0x00}, // PE (Windows) as generated by 6l/8l and gcc + {0x00, 0x00, 0x01, 0xEB}, // Plan 9 i386 + {0x00, 0x00, 0x8a, 0x97}, // Plan 9 amd64 +} + +func isObject(s string) bool { + f, err := os.Open(s) + if err != nil { + return false + } + defer f.Close() + buf := make([]byte, 64) + io.ReadFull(f, buf) + for _, magic := range objectMagic { + if bytes.HasPrefix(buf, magic) { + return true + } + } + return false +} + +// fmtcmd formats a command in the manner of fmt.Sprintf but also: +// +// If dir is non-empty and the script is not in dir right now, +// fmtcmd inserts "cd dir\n" before the command. +// +// fmtcmd replaces the value of b.work with $WORK. +// fmtcmd replaces the value of goroot with $GOROOT. +// fmtcmd replaces the value of b.gobin with $GOBIN. +// +// fmtcmd replaces the name of the current directory with dot (.) +// but only when it is at the beginning of a space-separated token. +// +func (b *builder) fmtcmd(dir string, format string, args ...interface{}) string { + cmd := fmt.Sprintf(format, args...) + if dir != "" && dir != "/" { + cmd = strings.Replace(" "+cmd, " "+dir, " .", -1)[1:] + if b.scriptDir != dir { + b.scriptDir = dir + cmd = "cd " + dir + "\n" + cmd + } + } + if b.work != "" { + cmd = strings.Replace(cmd, b.work, "$WORK", -1) + } + return cmd +} + +// showcmd prints the given command to standard output +// for the implementation of -n or -x. +func (b *builder) showcmd(dir string, format string, args ...interface{}) { + b.output.Lock() + defer b.output.Unlock() + b.print(b.fmtcmd(dir, format, args...) + "\n") +} + +// showOutput prints "# desc" followed by the given output. +// The output is expected to contain references to 'dir', usually +// the source directory for the package that has failed to build. +// showOutput rewrites mentions of dir with a relative path to dir +// when the relative path is shorter. This is usually more pleasant. +// For example, if fmt doesn't compile and we are in src/html, +// the output is +// +// $ go build +// # fmt +// ../fmt/print.go:1090: undefined: asdf +// $ +// +// instead of +// +// $ go build +// # fmt +// /usr/gopher/go/src/fmt/print.go:1090: undefined: asdf +// $ +// +// showOutput also replaces references to the work directory with $WORK. +// +func (b *builder) showOutput(dir, desc, out string) { + prefix := "# " + desc + suffix := "\n" + out + if reldir := shortPath(dir); reldir != dir { + suffix = strings.Replace(suffix, " "+dir, " "+reldir, -1) + suffix = strings.Replace(suffix, "\n"+dir, "\n"+reldir, -1) + } + suffix = strings.Replace(suffix, " "+b.work, " $WORK", -1) + + b.output.Lock() + defer b.output.Unlock() + b.print(prefix, suffix) +} + +// shortPath returns an absolute or relative name for path, whatever is shorter. +func shortPath(path string) string { + if rel, err := filepath.Rel(cwd, path); err == nil && len(rel) < len(path) { + return rel + } + return path +} + +// relPaths returns a copy of paths with absolute paths +// made relative to the current directory if they would be shorter. +func relPaths(paths []string) []string { + var out []string + pwd, _ := os.Getwd() + for _, p := range paths { + rel, err := filepath.Rel(pwd, p) + if err == nil && len(rel) < len(p) { + p = rel + } + out = append(out, p) + } + return out +} + +// errPrintedOutput is a special error indicating that a command failed +// but that it generated output as well, and that output has already +// been printed, so there's no point showing 'exit status 1' or whatever +// the wait status was. The main executor, builder.do, knows not to +// print this error. +var errPrintedOutput = errors.New("already printed output - no need to show error") + +var cgoLine = regexp.MustCompile(`\[[^\[\]]+\.cgo1\.go:[0-9]+\]`) +var cgoTypeSigRe = regexp.MustCompile(`\b_Ctype_\B`) + +// run runs the command given by cmdline in the directory dir. +// If the command fails, run prints information about the failure +// and returns a non-nil error. +func (b *builder) run(dir string, desc string, env []string, cmdargs ...interface{}) error { + out, err := b.runOut(dir, desc, env, cmdargs...) + if len(out) > 0 { + if desc == "" { + desc = b.fmtcmd(dir, "%s", strings.Join(stringList(cmdargs...), " ")) + } + b.showOutput(dir, desc, b.processOutput(out)) + if err != nil { + err = errPrintedOutput + } + } + return err +} + +// processOutput prepares the output of runOut to be output to the console. +func (b *builder) processOutput(out []byte) string { + if out[len(out)-1] != '\n' { + out = append(out, '\n') + } + messages := string(out) + // Fix up output referring to cgo-generated code to be more readable. + // Replace x.go:19[/tmp/.../x.cgo1.go:18] with x.go:19. + // Replace *[100]_Ctype_foo with *[100]C.foo. + // If we're using -x, assume we're debugging and want the full dump, so disable the rewrite. + if !buildX && cgoLine.MatchString(messages) { + messages = cgoLine.ReplaceAllString(messages, "") + messages = cgoTypeSigRe.ReplaceAllString(messages, "C.") + } + return messages +} + +// runOut runs the command given by cmdline in the directory dir. +// It returns the command output and any errors that occurred. +func (b *builder) runOut(dir string, desc string, env []string, cmdargs ...interface{}) ([]byte, error) { + cmdline := stringList(cmdargs...) + if buildN || buildX { + var envcmdline string + for i := range env { + envcmdline += env[i] + envcmdline += " " + } + envcmdline += joinUnambiguously(cmdline) + b.showcmd(dir, "%s", envcmdline) + if buildN { + return nil, nil + } + } + + nbusy := 0 + for { + var buf bytes.Buffer + cmd := exec.Command(cmdline[0], cmdline[1:]...) + cmd.Stdout = &buf + cmd.Stderr = &buf + cmd.Dir = dir + cmd.Env = mergeEnvLists(env, envForDir(cmd.Dir, os.Environ())) + err := cmd.Run() + + // cmd.Run will fail on Unix if some other process has the binary + // we want to run open for writing. This can happen here because + // we build and install the cgo command and then run it. + // If another command was kicked off while we were writing the + // cgo binary, the child process for that command may be holding + // a reference to the fd, keeping us from running exec. + // + // But, you might reasonably wonder, how can this happen? + // The cgo fd, like all our fds, is close-on-exec, so that we need + // not worry about other processes inheriting the fd accidentally. + // The answer is that running a command is fork and exec. + // A child forked while the cgo fd is open inherits that fd. + // Until the child has called exec, it holds the fd open and the + // kernel will not let us run cgo. Even if the child were to close + // the fd explicitly, it would still be open from the time of the fork + // until the time of the explicit close, and the race would remain. + // + // On Unix systems, this results in ETXTBSY, which formats + // as "text file busy". Rather than hard-code specific error cases, + // we just look for that string. If this happens, sleep a little + // and try again. We let this happen three times, with increasing + // sleep lengths: 100+200+400 ms = 0.7 seconds. + // + // An alternate solution might be to split the cmd.Run into + // separate cmd.Start and cmd.Wait, and then use an RWLock + // to make sure that copyFile only executes when no cmd.Start + // call is in progress. However, cmd.Start (really syscall.forkExec) + // only guarantees that when it returns, the exec is committed to + // happen and succeed. It uses a close-on-exec file descriptor + // itself to determine this, so we know that when cmd.Start returns, + // at least one close-on-exec file descriptor has been closed. + // However, we cannot be sure that all of them have been closed, + // so the program might still encounter ETXTBSY even with such + // an RWLock. The race window would be smaller, perhaps, but not + // guaranteed to be gone. + // + // Sleeping when we observe the race seems to be the most reliable + // option we have. + // + // https://golang.org/issue/3001 + // + if err != nil && nbusy < 3 && strings.Contains(err.Error(), "text file busy") { + time.Sleep(100 * time.Millisecond << uint(nbusy)) + nbusy++ + continue + } + + // err can be something like 'exit status 1'. + // Add information about what program was running. + // Note that if buf.Bytes() is non-empty, the caller usually + // shows buf.Bytes() and does not print err at all, so the + // prefix here does not make most output any more verbose. + if err != nil { + err = errors.New(cmdline[0] + ": " + err.Error()) + } + return buf.Bytes(), err + } +} + +// joinUnambiguously prints the slice, quoting where necessary to make the +// output unambiguous. +// TODO: See issue 5279. The printing of commands needs a complete redo. +func joinUnambiguously(a []string) string { + var buf bytes.Buffer + for i, s := range a { + if i > 0 { + buf.WriteByte(' ') + } + q := strconv.Quote(s) + if s == "" || strings.Contains(s, " ") || len(q) > len(s)+2 { + buf.WriteString(q) + } else { + buf.WriteString(s) + } + } + return buf.String() +} + +// mkdir makes the named directory. +func (b *builder) mkdir(dir string) error { + b.exec.Lock() + defer b.exec.Unlock() + // We can be a little aggressive about being + // sure directories exist. Skip repeated calls. + if b.mkdirCache[dir] { + return nil + } + b.mkdirCache[dir] = true + + if buildN || buildX { + b.showcmd("", "mkdir -p %s", dir) + if buildN { + return nil + } + } + + if err := os.MkdirAll(dir, 0777); err != nil { + return err + } + return nil +} + +// mkAbs returns an absolute path corresponding to +// evaluating f in the directory dir. +// We always pass absolute paths of source files so that +// the error messages will include the full path to a file +// in need of attention. +func mkAbs(dir, f string) string { + // Leave absolute paths alone. + // Also, during -n mode we use the pseudo-directory $WORK + // instead of creating an actual work directory that won't be used. + // Leave paths beginning with $WORK alone too. + if filepath.IsAbs(f) || strings.HasPrefix(f, "$WORK") { + return f + } + return filepath.Join(dir, f) +} + +type toolchain interface { + // gc runs the compiler in a specific directory on a set of files + // and returns the name of the generated output file. + // The compiler runs in the directory dir. + gc(b *builder, p *Package, archive, obj string, asmhdr bool, importArgs []string, gofiles []string) (ofile string, out []byte, err error) + // cc runs the toolchain's C compiler in a directory on a C file + // to produce an output file. + cc(b *builder, p *Package, objdir, ofile, cfile string) error + // asm runs the assembler in a specific directory on a specific file + // to generate the named output file. + asm(b *builder, p *Package, obj, ofile, sfile string) error + // pkgpath builds an appropriate path for a temporary package file. + pkgpath(basedir string, p *Package) string + // pack runs the archive packer in a specific directory to create + // an archive from a set of object files. + // typically it is run in the object directory. + pack(b *builder, p *Package, objDir, afile string, ofiles []string) error + // ld runs the linker to create an executable starting at mainpkg. + ld(b *builder, root *action, out string, allactions []*action, mainpkg string, ofiles []string) error + // ldShared runs the linker to create a shared library containing the pkgs built by toplevelactions + ldShared(b *builder, toplevelactions []*action, out string, allactions []*action) error + + compiler() string + linker() string +} + +type noToolchain struct{} + +func noCompiler() error { + log.Fatalf("unknown compiler %q", buildContext.Compiler) + return nil +} + +func (noToolchain) compiler() string { + noCompiler() + return "" +} + +func (noToolchain) linker() string { + noCompiler() + return "" +} + +func (noToolchain) gc(b *builder, p *Package, archive, obj string, asmhdr bool, importArgs []string, gofiles []string) (ofile string, out []byte, err error) { + return "", nil, noCompiler() +} + +func (noToolchain) asm(b *builder, p *Package, obj, ofile, sfile string) error { + return noCompiler() +} + +func (noToolchain) pkgpath(basedir string, p *Package) string { + noCompiler() + return "" +} + +func (noToolchain) pack(b *builder, p *Package, objDir, afile string, ofiles []string) error { + return noCompiler() +} + +func (noToolchain) ld(b *builder, root *action, out string, allactions []*action, mainpkg string, ofiles []string) error { + return noCompiler() +} + +func (noToolchain) ldShared(b *builder, toplevelactions []*action, out string, allactions []*action) error { + return noCompiler() +} + +func (noToolchain) cc(b *builder, p *Package, objdir, ofile, cfile string) error { + return noCompiler() +} + +// The Go toolchain. +type gcToolchain struct{} + +func (gcToolchain) compiler() string { + return tool("compile") +} + +func (gcToolchain) linker() string { + return tool("link") +} + +func (gcToolchain) gc(b *builder, p *Package, archive, obj string, asmhdr bool, importArgs []string, gofiles []string) (ofile string, output []byte, err error) { + if archive != "" { + ofile = archive + } else { + out := "_go_.o" + ofile = obj + out + } + + gcargs := []string{"-p", p.ImportPath} + if p.Name == "main" { + gcargs[1] = "main" + } + if p.Standard && p.ImportPath == "runtime" { + // runtime compiles with a special gc flag to emit + // additional reflect type data. + gcargs = append(gcargs, "-+") + } + + // If we're giving the compiler the entire package (no C etc files), tell it that, + // so that it can give good error messages about forward declarations. + // Exceptions: a few standard packages have forward declarations for + // pieces supplied behind-the-scenes by package runtime. + extFiles := len(p.CgoFiles) + len(p.CFiles) + len(p.CXXFiles) + len(p.MFiles) + len(p.SFiles) + len(p.SysoFiles) + len(p.SwigFiles) + len(p.SwigCXXFiles) + if p.Standard { + switch p.ImportPath { + case "bytes", "net", "os", "runtime/pprof", "sync", "time": + extFiles++ + } + } + if extFiles == 0 { + gcargs = append(gcargs, "-complete") + } + if buildContext.InstallSuffix != "" { + gcargs = append(gcargs, "-installsuffix", buildContext.InstallSuffix) + } + if p.buildID != "" { + gcargs = append(gcargs, "-buildid", p.buildID) + } + + for _, path := range p.Imports { + if i := strings.LastIndex(path, "/vendor/"); i >= 0 { + gcargs = append(gcargs, "-importmap", path[i+len("/vendor/"):]+"="+path) + } else if strings.HasPrefix(path, "vendor/") { + gcargs = append(gcargs, "-importmap", path[len("vendor/"):]+"="+path) + } + } + + args := []interface{}{buildToolExec, tool("compile"), "-o", ofile, "-trimpath", b.work, buildGcflags, gcargs, "-D", p.localPrefix, importArgs} + if ofile == archive { + args = append(args, "-pack") + } + if asmhdr { + args = append(args, "-asmhdr", obj+"go_asm.h") + } + for _, f := range gofiles { + args = append(args, mkAbs(p.Dir, f)) + } + + output, err = b.runOut(p.Dir, p.ImportPath, nil, args...) + return ofile, output, err +} + +func (gcToolchain) asm(b *builder, p *Package, obj, ofile, sfile string) error { + // Add -I pkg/GOOS_GOARCH so #include "textflag.h" works in .s files. + inc := filepath.Join(goroot, "pkg", "include") + sfile = mkAbs(p.Dir, sfile) + args := []interface{}{buildToolExec, tool("asm"), "-o", ofile, "-trimpath", b.work, "-I", obj, "-I", inc, "-D", "GOOS_" + goos, "-D", "GOARCH_" + goarch, buildAsmflags, sfile} + if err := b.run(p.Dir, p.ImportPath, nil, args...); err != nil { + return err + } + return nil +} + +// toolVerify checks that the command line args writes the same output file +// if run using newTool instead. +// Unused now but kept around for future use. +func toolVerify(b *builder, p *Package, newTool string, ofile string, args []interface{}) error { + newArgs := make([]interface{}, len(args)) + copy(newArgs, args) + newArgs[1] = tool(newTool) + newArgs[3] = ofile + ".new" // x.6 becomes x.6.new + if err := b.run(p.Dir, p.ImportPath, nil, newArgs...); err != nil { + return err + } + data1, err := ioutil.ReadFile(ofile) + if err != nil { + return err + } + data2, err := ioutil.ReadFile(ofile + ".new") + if err != nil { + return err + } + if !bytes.Equal(data1, data2) { + return fmt.Errorf("%s and %s produced different output files:\n%s\n%s", filepath.Base(args[1].(string)), newTool, strings.Join(stringList(args...), " "), strings.Join(stringList(newArgs...), " ")) + } + os.Remove(ofile + ".new") + return nil +} + +func (gcToolchain) pkgpath(basedir string, p *Package) string { + end := filepath.FromSlash(p.ImportPath + ".a") + return filepath.Join(basedir, end) +} + +func (gcToolchain) pack(b *builder, p *Package, objDir, afile string, ofiles []string) error { + var absOfiles []string + for _, f := range ofiles { + absOfiles = append(absOfiles, mkAbs(objDir, f)) + } + cmd := "c" + absAfile := mkAbs(objDir, afile) + appending := false + if _, err := os.Stat(absAfile); err == nil { + appending = true + cmd = "r" + } + + cmdline := stringList("pack", cmd, absAfile, absOfiles) + + if appending { + if buildN || buildX { + b.showcmd(p.Dir, "%s # internal", joinUnambiguously(cmdline)) + } + if buildN { + return nil + } + if err := packInternal(b, absAfile, absOfiles); err != nil { + b.showOutput(p.Dir, p.ImportPath, err.Error()+"\n") + return errPrintedOutput + } + return nil + } + + // Need actual pack. + cmdline[0] = tool("pack") + return b.run(p.Dir, p.ImportPath, nil, buildToolExec, cmdline) +} + +func packInternal(b *builder, afile string, ofiles []string) error { + dst, err := os.OpenFile(afile, os.O_WRONLY|os.O_APPEND, 0) + if err != nil { + return err + } + defer dst.Close() // only for error returns or panics + w := bufio.NewWriter(dst) + + for _, ofile := range ofiles { + src, err := os.Open(ofile) + if err != nil { + return err + } + fi, err := src.Stat() + if err != nil { + src.Close() + return err + } + // Note: Not using %-16.16s format because we care + // about bytes, not runes. + name := fi.Name() + if len(name) > 16 { + name = name[:16] + } else { + name += strings.Repeat(" ", 16-len(name)) + } + size := fi.Size() + fmt.Fprintf(w, "%s%-12d%-6d%-6d%-8o%-10d`\n", + name, 0, 0, 0, 0644, size) + n, err := io.Copy(w, src) + src.Close() + if err == nil && n < size { + err = io.ErrUnexpectedEOF + } else if err == nil && n > size { + err = fmt.Errorf("file larger than size reported by stat") + } + if err != nil { + return fmt.Errorf("copying %s to %s: %v", ofile, afile, err) + } + if size&1 != 0 { + w.WriteByte(0) + } + } + + if err := w.Flush(); err != nil { + return err + } + return dst.Close() +} + +// setextld sets the appropriate linker flags for the specified compiler. +func setextld(ldflags []string, compiler []string) []string { + for _, f := range ldflags { + if f == "-extld" || strings.HasPrefix(f, "-extld=") { + // don't override -extld if supplied + return ldflags + } + } + ldflags = append(ldflags, "-extld="+compiler[0]) + if len(compiler) > 1 { + extldflags := false + add := strings.Join(compiler[1:], " ") + for i, f := range ldflags { + if f == "-extldflags" && i+1 < len(ldflags) { + ldflags[i+1] = add + " " + ldflags[i+1] + extldflags = true + break + } else if strings.HasPrefix(f, "-extldflags=") { + ldflags[i] = "-extldflags=" + add + " " + ldflags[i][len("-extldflags="):] + extldflags = true + break + } + } + if !extldflags { + ldflags = append(ldflags, "-extldflags="+add) + } + } + return ldflags +} + +func (gcToolchain) ld(b *builder, root *action, out string, allactions []*action, mainpkg string, ofiles []string) error { + importArgs := b.includeArgs("-L", allactions) + cxx := len(root.p.CXXFiles) > 0 || len(root.p.SwigCXXFiles) > 0 + for _, a := range allactions { + if a.p != nil && (len(a.p.CXXFiles) > 0 || len(a.p.SwigCXXFiles) > 0) { + cxx = true + } + } + var ldflags []string + if buildContext.InstallSuffix != "" { + ldflags = append(ldflags, "-installsuffix", buildContext.InstallSuffix) + } + if root.p.omitDWARF { + ldflags = append(ldflags, "-w") + } + + // If the user has not specified the -extld option, then specify the + // appropriate linker. In case of C++ code, use the compiler named + // by the CXX environment variable or defaultCXX if CXX is not set. + // Else, use the CC environment variable and defaultCC as fallback. + var compiler []string + if cxx { + compiler = envList("CXX", defaultCXX) + } else { + compiler = envList("CC", defaultCC) + } + ldflags = setextld(ldflags, compiler) + ldflags = append(ldflags, "-buildmode="+ldBuildmode) + if root.p.buildID != "" { + ldflags = append(ldflags, "-buildid="+root.p.buildID) + } + ldflags = append(ldflags, buildLdflags...) + + // On OS X when using external linking to build a shared library, + // the argument passed here to -o ends up recorded in the final + // shared library in the LC_ID_DYLIB load command. + // To avoid putting the temporary output directory name there + // (and making the resulting shared library useless), + // run the link in the output directory so that -o can name + // just the final path element. + dir := "." + if goos == "darwin" && buildBuildmode == "c-shared" { + dir, out = filepath.Split(out) + } + + return b.run(dir, root.p.ImportPath, nil, buildToolExec, tool("link"), "-o", out, importArgs, ldflags, mainpkg) +} + +func (gcToolchain) ldShared(b *builder, toplevelactions []*action, out string, allactions []*action) error { + importArgs := b.includeArgs("-L", allactions) + ldflags := []string{"-installsuffix", buildContext.InstallSuffix} + ldflags = append(ldflags, "-buildmode=shared") + ldflags = append(ldflags, buildLdflags...) + cxx := false + for _, a := range allactions { + if a.p != nil && (len(a.p.CXXFiles) > 0 || len(a.p.SwigCXXFiles) > 0) { + cxx = true + } + } + // If the user has not specified the -extld option, then specify the + // appropriate linker. In case of C++ code, use the compiler named + // by the CXX environment variable or defaultCXX if CXX is not set. + // Else, use the CC environment variable and defaultCC as fallback. + var compiler []string + if cxx { + compiler = envList("CXX", defaultCXX) + } else { + compiler = envList("CC", defaultCC) + } + ldflags = setextld(ldflags, compiler) + for _, d := range toplevelactions { + if !strings.HasSuffix(d.target, ".a") { // omit unsafe etc and actions for other shared libraries + continue + } + ldflags = append(ldflags, d.p.ImportPath+"="+d.target) + } + return b.run(".", out, nil, buildToolExec, tool("link"), "-o", out, importArgs, ldflags) +} + +func (gcToolchain) cc(b *builder, p *Package, objdir, ofile, cfile string) error { + return fmt.Errorf("%s: C source files not supported without cgo", mkAbs(p.Dir, cfile)) +} + +// The Gccgo toolchain. +type gccgoToolchain struct{} + +var gccgoName, gccgoBin string + +func init() { + gccgoName = os.Getenv("GCCGO") + if gccgoName == "" { + gccgoName = "gccgo" + } + gccgoBin, _ = exec.LookPath(gccgoName) +} + +func (gccgoToolchain) compiler() string { + return gccgoBin +} + +func (gccgoToolchain) linker() string { + return gccgoBin +} + +func (tools gccgoToolchain) gc(b *builder, p *Package, archive, obj string, asmhdr bool, importArgs []string, gofiles []string) (ofile string, output []byte, err error) { + out := "_go_.o" + ofile = obj + out + gcargs := []string{"-g"} + gcargs = append(gcargs, b.gccArchArgs()...) + if pkgpath := gccgoPkgpath(p); pkgpath != "" { + gcargs = append(gcargs, "-fgo-pkgpath="+pkgpath) + } + if p.localPrefix != "" { + gcargs = append(gcargs, "-fgo-relative-import-path="+p.localPrefix) + } + args := stringList(tools.compiler(), importArgs, "-c", gcargs, "-o", ofile, buildGccgoflags) + for _, f := range gofiles { + args = append(args, mkAbs(p.Dir, f)) + } + + output, err = b.runOut(p.Dir, p.ImportPath, nil, args) + return ofile, output, err +} + +func (tools gccgoToolchain) asm(b *builder, p *Package, obj, ofile, sfile string) error { + sfile = mkAbs(p.Dir, sfile) + defs := []string{"-D", "GOOS_" + goos, "-D", "GOARCH_" + goarch} + if pkgpath := gccgoCleanPkgpath(p); pkgpath != "" { + defs = append(defs, `-D`, `GOPKGPATH="`+pkgpath+`"`) + } + defs = tools.maybePIC(defs) + defs = append(defs, b.gccArchArgs()...) + return b.run(p.Dir, p.ImportPath, nil, tools.compiler(), "-I", obj, "-o", ofile, defs, sfile) +} + +func (gccgoToolchain) pkgpath(basedir string, p *Package) string { + end := filepath.FromSlash(p.ImportPath + ".a") + afile := filepath.Join(basedir, end) + // add "lib" to the final element + return filepath.Join(filepath.Dir(afile), "lib"+filepath.Base(afile)) +} + +func (gccgoToolchain) pack(b *builder, p *Package, objDir, afile string, ofiles []string) error { + var absOfiles []string + for _, f := range ofiles { + absOfiles = append(absOfiles, mkAbs(objDir, f)) + } + return b.run(p.Dir, p.ImportPath, nil, "ar", "cru", mkAbs(objDir, afile), absOfiles) +} + +func (tools gccgoToolchain) ld(b *builder, root *action, out string, allactions []*action, mainpkg string, ofiles []string) error { + // gccgo needs explicit linking with all package dependencies, + // and all LDFLAGS from cgo dependencies. + apackagesSeen := make(map[*Package]bool) + afiles := []string{} + shlibs := []string{} + xfiles := []string{} + ldflags := b.gccArchArgs() + cgoldflags := []string{} + usesCgo := false + cxx := len(root.p.CXXFiles) > 0 || len(root.p.SwigCXXFiles) > 0 + objc := len(root.p.MFiles) > 0 + + actionsSeen := make(map[*action]bool) + // Make a pre-order depth-first traversal of the action graph, taking note of + // whether a shared library action has been seen on the way to an action (the + // construction of the graph means that if any path to a node passes through + // a shared library action, they all do). + var walk func(a *action, seenShlib bool) + walk = func(a *action, seenShlib bool) { + if actionsSeen[a] { + return + } + actionsSeen[a] = true + if a.p != nil && !seenShlib { + if a.p.Standard { + return + } + // We record the target of the first time we see a .a file + // for a package to make sure that we prefer the 'install' + // rather than the 'build' location (which may not exist any + // more). We still need to traverse the dependencies of the + // build action though so saying + // if apackagesSeen[a.p] { return } + // doesn't work. + if !apackagesSeen[a.p] { + apackagesSeen[a.p] = true + if a.p.fake && a.p.external { + // external _tests, if present must come before + // internal _tests. Store these on a separate list + // and place them at the head after this loop. + xfiles = append(xfiles, a.target) + } else if a.p.fake { + // move _test files to the top of the link order + afiles = append([]string{a.target}, afiles...) + } else { + afiles = append(afiles, a.target) + } + } + } + if strings.HasSuffix(a.target, ".so") { + shlibs = append(shlibs, a.target) + seenShlib = true + } + for _, a1 := range a.deps { + walk(a1, seenShlib) + } + } + for _, a1 := range root.deps { + walk(a1, false) + } + afiles = append(xfiles, afiles...) + + for _, a := range allactions { + // Gather CgoLDFLAGS, but not from standard packages. + // The go tool can dig up runtime/cgo from GOROOT and + // think that it should use its CgoLDFLAGS, but gccgo + // doesn't use runtime/cgo. + if a.p == nil { + continue + } + if !a.p.Standard { + cgoldflags = append(cgoldflags, a.p.CgoLDFLAGS...) + } + if len(a.p.CgoFiles) > 0 { + usesCgo = true + } + if a.p.usesSwig() { + usesCgo = true + } + if len(a.p.CXXFiles) > 0 || len(a.p.SwigCXXFiles) > 0 { + cxx = true + } + if len(a.p.MFiles) > 0 { + objc = true + } + } + + switch ldBuildmode { + case "c-archive", "c-shared": + ldflags = append(ldflags, "-Wl,--whole-archive") + } + + ldflags = append(ldflags, afiles...) + + switch ldBuildmode { + case "c-archive", "c-shared": + ldflags = append(ldflags, "-Wl,--no-whole-archive") + } + + ldflags = append(ldflags, cgoldflags...) + ldflags = append(ldflags, envList("CGO_LDFLAGS", "")...) + ldflags = append(ldflags, root.p.CgoLDFLAGS...) + + ldflags = stringList("-Wl,-(", ldflags, "-Wl,-)") + + for _, shlib := range shlibs { + ldflags = append( + ldflags, + "-L"+filepath.Dir(shlib), + "-Wl,-rpath="+filepath.Dir(shlib), + "-l"+strings.TrimSuffix( + strings.TrimPrefix(filepath.Base(shlib), "lib"), + ".so")) + } + + var realOut string + switch ldBuildmode { + case "exe": + if usesCgo && goos == "linux" { + ldflags = append(ldflags, "-Wl,-E") + } + + case "c-archive": + // Link the Go files into a single .o, and also link + // in -lgolibbegin. + // + // We need to use --whole-archive with -lgolibbegin + // because it doesn't define any symbols that will + // cause the contents to be pulled in; it's just + // initialization code. + // + // The user remains responsible for linking against + // -lgo -lpthread -lm in the final link. We can't use + // -r to pick them up because we can't combine + // split-stack and non-split-stack code in a single -r + // link, and libgo picks up non-split-stack code from + // libffi. + ldflags = append(ldflags, "-Wl,-r", "-nostdlib", "-Wl,--whole-archive", "-lgolibbegin", "-Wl,--no-whole-archive") + + // We are creating an object file, so we don't want a build ID. + ldflags = b.disableBuildID(ldflags) + + realOut = out + out = out + ".o" + + case "c-shared": + ldflags = append(ldflags, "-shared", "-nostdlib", "-Wl,--whole-archive", "-lgolibbegin", "-Wl,--no-whole-archive", "-lgo", "-lgcc_s", "-lgcc") + + default: + fatalf("-buildmode=%s not supported for gccgo", ldBuildmode) + } + + switch ldBuildmode { + case "exe", "c-shared": + if cxx { + ldflags = append(ldflags, "-lstdc++") + } + if objc { + ldflags = append(ldflags, "-lobjc") + } + } + + if err := b.run(".", root.p.ImportPath, nil, tools.linker(), "-o", out, ofiles, ldflags, buildGccgoflags); err != nil { + return err + } + + switch ldBuildmode { + case "c-archive": + if err := b.run(".", root.p.ImportPath, nil, "ar", "rc", realOut, out); err != nil { + return err + } + } + return nil +} + +func (tools gccgoToolchain) ldShared(b *builder, toplevelactions []*action, out string, allactions []*action) error { + args := []string{"-o", out, "-shared", "-nostdlib", "-zdefs", "-Wl,--whole-archive"} + for _, a := range toplevelactions { + args = append(args, a.target) + } + args = append(args, "-Wl,--no-whole-archive", "-shared", "-nostdlib", "-lgo", "-lgcc_s", "-lgcc", "-lc") + shlibs := []string{} + for _, a := range allactions { + if strings.HasSuffix(a.target, ".so") { + shlibs = append(shlibs, a.target) + } + } + for _, shlib := range shlibs { + args = append( + args, + "-L"+filepath.Dir(shlib), + "-Wl,-rpath="+filepath.Dir(shlib), + "-l"+strings.TrimSuffix( + strings.TrimPrefix(filepath.Base(shlib), "lib"), + ".so")) + } + return b.run(".", out, nil, tools.linker(), args, buildGccgoflags) +} + +func (tools gccgoToolchain) cc(b *builder, p *Package, objdir, ofile, cfile string) error { + inc := filepath.Join(goroot, "pkg", "include") + cfile = mkAbs(p.Dir, cfile) + defs := []string{"-D", "GOOS_" + goos, "-D", "GOARCH_" + goarch} + defs = append(defs, b.gccArchArgs()...) + if pkgpath := gccgoCleanPkgpath(p); pkgpath != "" { + defs = append(defs, `-D`, `GOPKGPATH="`+pkgpath+`"`) + } + switch goarch { + case "386", "amd64": + defs = append(defs, "-fsplit-stack") + } + defs = tools.maybePIC(defs) + return b.run(p.Dir, p.ImportPath, nil, envList("CC", defaultCC), "-Wall", "-g", + "-I", objdir, "-I", inc, "-o", ofile, defs, "-c", cfile) +} + +// maybePIC adds -fPIC to the list of arguments if needed. +func (tools gccgoToolchain) maybePIC(args []string) []string { + switch buildBuildmode { + case "c-shared", "shared": + args = append(args, "-fPIC") + } + return args +} + +func gccgoPkgpath(p *Package) string { + if p.build.IsCommand() && !p.forceLibrary { + return "" + } + return p.ImportPath +} + +func gccgoCleanPkgpath(p *Package) string { + clean := func(r rune) rune { + switch { + case 'A' <= r && r <= 'Z', 'a' <= r && r <= 'z', + '0' <= r && r <= '9': + return r + } + return '_' + } + return strings.Map(clean, gccgoPkgpath(p)) +} + +// libgcc returns the filename for libgcc, as determined by invoking gcc with +// the -print-libgcc-file-name option. +func (b *builder) libgcc(p *Package) (string, error) { + var buf bytes.Buffer + + gccCmd := b.gccCmd(p.Dir) + + prev := b.print + if buildN { + // In -n mode we temporarily swap out the builder's + // print function to capture the command-line. This + // let's us assign it to $LIBGCC and produce a valid + // buildscript for cgo packages. + b.print = func(a ...interface{}) (int, error) { + return fmt.Fprint(&buf, a...) + } + } + f, err := b.runOut(p.Dir, p.ImportPath, nil, gccCmd, "-print-libgcc-file-name") + if err != nil { + return "", fmt.Errorf("gcc -print-libgcc-file-name: %v (%s)", err, f) + } + if buildN { + s := fmt.Sprintf("LIBGCC=$(%s)\n", buf.Next(buf.Len()-1)) + b.print = prev + b.print(s) + return "$LIBGCC", nil + } + + // The compiler might not be able to find libgcc, and in that case, + // it will simply return "libgcc.a", which is of no use to us. + if !filepath.IsAbs(string(f)) { + return "", nil + } + + return strings.Trim(string(f), "\r\n"), nil +} + +// gcc runs the gcc C compiler to create an object from a single C file. +func (b *builder) gcc(p *Package, out string, flags []string, cfile string) error { + return b.ccompile(p, out, flags, cfile, b.gccCmd(p.Dir)) +} + +// gxx runs the g++ C++ compiler to create an object from a single C++ file. +func (b *builder) gxx(p *Package, out string, flags []string, cxxfile string) error { + return b.ccompile(p, out, flags, cxxfile, b.gxxCmd(p.Dir)) +} + +// ccompile runs the given C or C++ compiler and creates an object from a single source file. +func (b *builder) ccompile(p *Package, out string, flags []string, file string, compiler []string) error { + file = mkAbs(p.Dir, file) + return b.run(p.Dir, p.ImportPath, nil, compiler, flags, "-o", out, "-c", file) +} + +// gccld runs the gcc linker to create an executable from a set of object files. +func (b *builder) gccld(p *Package, out string, flags []string, obj []string) error { + var cmd []string + if len(p.CXXFiles) > 0 || len(p.SwigCXXFiles) > 0 { + cmd = b.gxxCmd(p.Dir) + } else { + cmd = b.gccCmd(p.Dir) + } + return b.run(p.Dir, p.ImportPath, nil, cmd, "-o", out, obj, flags) +} + +// gccCmd returns a gcc command line prefix +// defaultCC is defined in zdefaultcc.go, written by cmd/dist. +func (b *builder) gccCmd(objdir string) []string { + return b.ccompilerCmd("CC", defaultCC, objdir) +} + +// gxxCmd returns a g++ command line prefix +// defaultCXX is defined in zdefaultcc.go, written by cmd/dist. +func (b *builder) gxxCmd(objdir string) []string { + return b.ccompilerCmd("CXX", defaultCXX, objdir) +} + +// ccompilerCmd returns a command line prefix for the given environment +// variable and using the default command when the variable is empty. +func (b *builder) ccompilerCmd(envvar, defcmd, objdir string) []string { + // NOTE: env.go's mkEnv knows that the first three + // strings returned are "gcc", "-I", objdir (and cuts them off). + + compiler := envList(envvar, defcmd) + a := []string{compiler[0], "-I", objdir} + a = append(a, compiler[1:]...) + + // Definitely want -fPIC but on Windows gcc complains + // "-fPIC ignored for target (all code is position independent)" + if goos != "windows" { + a = append(a, "-fPIC") + } + a = append(a, b.gccArchArgs()...) + // gcc-4.5 and beyond require explicit "-pthread" flag + // for multithreading with pthread library. + if buildContext.CgoEnabled { + switch goos { + case "windows": + a = append(a, "-mthreads") + default: + a = append(a, "-pthread") + } + } + + if strings.Contains(a[0], "clang") { + // disable ASCII art in clang errors, if possible + a = append(a, "-fno-caret-diagnostics") + // clang is too smart about command-line arguments + a = append(a, "-Qunused-arguments") + } + + // disable word wrapping in error messages + a = append(a, "-fmessage-length=0") + + // On OS X, some of the compilers behave as if -fno-common + // is always set, and the Mach-O linker in 6l/8l assumes this. + // See https://golang.org/issue/3253. + if goos == "darwin" { + a = append(a, "-fno-common") + } + + return a +} + +// gccArchArgs returns arguments to pass to gcc based on the architecture. +func (b *builder) gccArchArgs() []string { + switch goarch { + case "386": + return []string{"-m32"} + case "amd64", "amd64p32": + return []string{"-m64"} + case "arm": + return []string{"-marm"} // not thumb + } + return nil +} + +// envList returns the value of the given environment variable broken +// into fields, using the default value when the variable is empty. +func envList(key, def string) []string { + v := os.Getenv(key) + if v == "" { + v = def + } + return strings.Fields(v) +} + +// Return the flags to use when invoking the C or C++ compilers, or cgo. +func (b *builder) cflags(p *Package, def bool) (cppflags, cflags, cxxflags, ldflags []string) { + var defaults string + if def { + defaults = "-g -O2" + } + + cppflags = stringList(envList("CGO_CPPFLAGS", ""), p.CgoCPPFLAGS) + cflags = stringList(envList("CGO_CFLAGS", defaults), p.CgoCFLAGS) + cxxflags = stringList(envList("CGO_CXXFLAGS", defaults), p.CgoCXXFLAGS) + ldflags = stringList(envList("CGO_LDFLAGS", defaults), p.CgoLDFLAGS) + return +} + +var cgoRe = regexp.MustCompile(`[/\\:]`) + +var ( + cgoLibGccFile string + cgoLibGccErr error + cgoLibGccFileOnce sync.Once +) + +func (b *builder) cgo(p *Package, cgoExe, obj string, pcCFLAGS, pcLDFLAGS, cgofiles, gccfiles, gxxfiles, mfiles []string) (outGo, outObj []string, err error) { + cgoCPPFLAGS, cgoCFLAGS, cgoCXXFLAGS, cgoLDFLAGS := b.cflags(p, true) + _, cgoexeCFLAGS, _, _ := b.cflags(p, false) + cgoCPPFLAGS = append(cgoCPPFLAGS, pcCFLAGS...) + cgoLDFLAGS = append(cgoLDFLAGS, pcLDFLAGS...) + // If we are compiling Objective-C code, then we need to link against libobjc + if len(mfiles) > 0 { + cgoLDFLAGS = append(cgoLDFLAGS, "-lobjc") + } + + // Allows including _cgo_export.h from .[ch] files in the package. + cgoCPPFLAGS = append(cgoCPPFLAGS, "-I", obj) + + // cgo + // TODO: CGOPKGPATH, CGO_FLAGS? + gofiles := []string{obj + "_cgo_gotypes.go"} + cfiles := []string{"_cgo_main.c", "_cgo_export.c"} + for _, fn := range cgofiles { + f := cgoRe.ReplaceAllString(fn[:len(fn)-2], "_") + gofiles = append(gofiles, obj+f+"cgo1.go") + cfiles = append(cfiles, f+"cgo2.c") + } + defunC := obj + "_cgo_defun.c" + + cgoflags := []string{} + // TODO: make cgo not depend on $GOARCH? + + if p.Standard && p.ImportPath == "runtime/cgo" { + cgoflags = append(cgoflags, "-import_runtime_cgo=false") + } + if p.Standard && (p.ImportPath == "runtime/race" || p.ImportPath == "runtime/cgo") { + cgoflags = append(cgoflags, "-import_syscall=false") + } + + // Update $CGO_LDFLAGS with p.CgoLDFLAGS. + var cgoenv []string + if len(cgoLDFLAGS) > 0 { + flags := make([]string, len(cgoLDFLAGS)) + for i, f := range cgoLDFLAGS { + flags[i] = strconv.Quote(f) + } + cgoenv = []string{"CGO_LDFLAGS=" + strings.Join(flags, " ")} + } + + if _, ok := buildToolchain.(gccgoToolchain); ok { + switch goarch { + case "386", "amd64": + cgoCFLAGS = append(cgoCFLAGS, "-fsplit-stack") + } + cgoflags = append(cgoflags, "-gccgo") + if pkgpath := gccgoPkgpath(p); pkgpath != "" { + cgoflags = append(cgoflags, "-gccgopkgpath="+pkgpath) + } + } + + switch buildBuildmode { + case "c-archive", "c-shared": + // Tell cgo that if there are any exported functions + // it should generate a header file that C code can + // #include. + cgoflags = append(cgoflags, "-exportheader="+obj+"_cgo_install.h") + } + + if err := b.run(p.Dir, p.ImportPath, cgoenv, buildToolExec, cgoExe, "-objdir", obj, "-importpath", p.ImportPath, cgoflags, "--", cgoCPPFLAGS, cgoexeCFLAGS, cgofiles); err != nil { + return nil, nil, err + } + outGo = append(outGo, gofiles...) + + // cc _cgo_defun.c + _, gccgo := buildToolchain.(gccgoToolchain) + if gccgo { + defunObj := obj + "_cgo_defun.o" + if err := buildToolchain.cc(b, p, obj, defunObj, defunC); err != nil { + return nil, nil, err + } + outObj = append(outObj, defunObj) + } + + // gcc + var linkobj []string + + var bareLDFLAGS []string + // filter out -lsomelib, -l somelib, *.{so,dll,dylib}, and (on Darwin) -framework X + for i := 0; i < len(cgoLDFLAGS); i++ { + f := cgoLDFLAGS[i] + switch { + // skip "-lc" or "-l somelib" + case strings.HasPrefix(f, "-l"): + if f == "-l" { + i++ + } + // skip "-framework X" on Darwin + case goos == "darwin" && f == "-framework": + i++ + // skip "*.{dylib,so,dll}" + case strings.HasSuffix(f, ".dylib"), + strings.HasSuffix(f, ".so"), + strings.HasSuffix(f, ".dll"): + continue + // Remove any -fsanitize=foo flags. + // Otherwise the compiler driver thinks that we are doing final link + // and links sanitizer runtime into the object file. But we are not doing + // the final link, we will link the resulting object file again. And + // so the program ends up with two copies of sanitizer runtime. + // See issue 8788 for details. + case strings.HasPrefix(f, "-fsanitize="): + continue + default: + bareLDFLAGS = append(bareLDFLAGS, f) + } + } + + cgoLibGccFileOnce.Do(func() { + cgoLibGccFile, cgoLibGccErr = b.libgcc(p) + }) + if cgoLibGccFile == "" && cgoLibGccErr != nil { + return nil, nil, err + } + + var staticLibs []string + if goos == "windows" { + // libmingw32 and libmingwex might also use libgcc, so libgcc must come last, + // and they also have some inter-dependencies, so must use linker groups. + staticLibs = []string{"-Wl,--start-group", "-lmingwex", "-lmingw32", "-Wl,--end-group"} + } + if cgoLibGccFile != "" { + staticLibs = append(staticLibs, cgoLibGccFile) + } + + cflags := stringList(cgoCPPFLAGS, cgoCFLAGS) + for _, cfile := range cfiles { + ofile := obj + cfile[:len(cfile)-1] + "o" + if err := b.gcc(p, ofile, cflags, obj+cfile); err != nil { + return nil, nil, err + } + linkobj = append(linkobj, ofile) + if !strings.HasSuffix(ofile, "_cgo_main.o") { + outObj = append(outObj, ofile) + } + } + + for _, file := range gccfiles { + ofile := obj + cgoRe.ReplaceAllString(file[:len(file)-1], "_") + "o" + if err := b.gcc(p, ofile, cflags, file); err != nil { + return nil, nil, err + } + linkobj = append(linkobj, ofile) + outObj = append(outObj, ofile) + } + + cxxflags := stringList(cgoCPPFLAGS, cgoCXXFLAGS) + for _, file := range gxxfiles { + // Append .o to the file, just in case the pkg has file.c and file.cpp + ofile := obj + cgoRe.ReplaceAllString(file, "_") + ".o" + if err := b.gxx(p, ofile, cxxflags, file); err != nil { + return nil, nil, err + } + linkobj = append(linkobj, ofile) + outObj = append(outObj, ofile) + } + + for _, file := range mfiles { + // Append .o to the file, just in case the pkg has file.c and file.m + ofile := obj + cgoRe.ReplaceAllString(file, "_") + ".o" + if err := b.gcc(p, ofile, cflags, file); err != nil { + return nil, nil, err + } + linkobj = append(linkobj, ofile) + outObj = append(outObj, ofile) + } + + linkobj = append(linkobj, p.SysoFiles...) + dynobj := obj + "_cgo_.o" + pie := goarch == "arm" && (goos == "linux" || goos == "android") + if pie { // we need to use -pie for Linux/ARM to get accurate imported sym + cgoLDFLAGS = append(cgoLDFLAGS, "-pie") + } + if err := b.gccld(p, dynobj, cgoLDFLAGS, linkobj); err != nil { + return nil, nil, err + } + if pie { // but we don't need -pie for normal cgo programs + cgoLDFLAGS = cgoLDFLAGS[0 : len(cgoLDFLAGS)-1] + } + + if _, ok := buildToolchain.(gccgoToolchain); ok { + // we don't use dynimport when using gccgo. + return outGo, outObj, nil + } + + // cgo -dynimport + importGo := obj + "_cgo_import.go" + cgoflags = []string{} + if p.Standard && p.ImportPath == "runtime/cgo" { + cgoflags = append(cgoflags, "-dynlinker") // record path to dynamic linker + } + if err := b.run(p.Dir, p.ImportPath, nil, buildToolExec, cgoExe, "-objdir", obj, "-dynpackage", p.Name, "-dynimport", dynobj, "-dynout", importGo, cgoflags); err != nil { + return nil, nil, err + } + outGo = append(outGo, importGo) + + ofile := obj + "_all.o" + var gccObjs, nonGccObjs []string + for _, f := range outObj { + if strings.HasSuffix(f, ".o") { + gccObjs = append(gccObjs, f) + } else { + nonGccObjs = append(nonGccObjs, f) + } + } + ldflags := stringList(bareLDFLAGS, "-Wl,-r", "-nostdlib", staticLibs) + + // We are creating an object file, so we don't want a build ID. + ldflags = b.disableBuildID(ldflags) + + if err := b.gccld(p, ofile, ldflags, gccObjs); err != nil { + return nil, nil, err + } + + // NOTE(rsc): The importObj is a 5c/6c/8c object and on Windows + // must be processed before the gcc-generated objects. + // Put it first. https://golang.org/issue/2601 + outObj = stringList(nonGccObjs, ofile) + + return outGo, outObj, nil +} + +// Run SWIG on all SWIG input files. +// TODO: Don't build a shared library, once SWIG emits the necessary +// pragmas for external linking. +func (b *builder) swig(p *Package, obj string, pcCFLAGS []string) (outGo, outC, outCXX []string, err error) { + if err := b.swigVersionCheck(); err != nil { + return nil, nil, nil, err + } + + intgosize, err := b.swigIntSize(obj) + if err != nil { + return nil, nil, nil, err + } + + for _, f := range p.SwigFiles { + goFile, cFile, err := b.swigOne(p, f, obj, pcCFLAGS, false, intgosize) + if err != nil { + return nil, nil, nil, err + } + if goFile != "" { + outGo = append(outGo, goFile) + } + if cFile != "" { + outC = append(outC, cFile) + } + } + for _, f := range p.SwigCXXFiles { + goFile, cxxFile, err := b.swigOne(p, f, obj, pcCFLAGS, true, intgosize) + if err != nil { + return nil, nil, nil, err + } + if goFile != "" { + outGo = append(outGo, goFile) + } + if cxxFile != "" { + outCXX = append(outCXX, cxxFile) + } + } + return outGo, outC, outCXX, nil +} + +// Make sure SWIG is new enough. +var ( + swigCheckOnce sync.Once + swigCheck error +) + +func (b *builder) swigDoVersionCheck() error { + out, err := b.runOut("", "", nil, "swig", "-version") + if err != nil { + return err + } + re := regexp.MustCompile(`[vV]ersion +([\d]+)([.][\d]+)?([.][\d]+)?`) + matches := re.FindSubmatch(out) + if matches == nil { + // Can't find version number; hope for the best. + return nil + } + + major, err := strconv.Atoi(string(matches[1])) + if err != nil { + // Can't find version number; hope for the best. + return nil + } + const errmsg = "must have SWIG version >= 3.0.6" + if major < 3 { + return errors.New(errmsg) + } + if major > 3 { + // 4.0 or later + return nil + } + + // We have SWIG version 3.x. + if len(matches[2]) > 0 { + minor, err := strconv.Atoi(string(matches[2][1:])) + if err != nil { + return nil + } + if minor > 0 { + // 3.1 or later + return nil + } + } + + // We have SWIG version 3.0.x. + if len(matches[3]) > 0 { + patch, err := strconv.Atoi(string(matches[3][1:])) + if err != nil { + return nil + } + if patch < 6 { + // Before 3.0.6. + return errors.New(errmsg) + } + } + + return nil +} + +func (b *builder) swigVersionCheck() error { + swigCheckOnce.Do(func() { + swigCheck = b.swigDoVersionCheck() + }) + return swigCheck +} + +// This code fails to build if sizeof(int) <= 32 +const swigIntSizeCode = ` +package main +const i int = 1 << 32 +` + +// Determine the size of int on the target system for the -intgosize option +// of swig >= 2.0.9 +func (b *builder) swigIntSize(obj string) (intsize string, err error) { + if buildN { + return "$INTBITS", nil + } + src := filepath.Join(b.work, "swig_intsize.go") + if err = ioutil.WriteFile(src, []byte(swigIntSizeCode), 0644); err != nil { + return + } + srcs := []string{src} + + p := goFilesPackage(srcs) + + if _, _, e := buildToolchain.gc(b, p, "", obj, false, nil, srcs); e != nil { + return "32", nil + } + return "64", nil +} + +// Run SWIG on one SWIG input file. +func (b *builder) swigOne(p *Package, file, obj string, pcCFLAGS []string, cxx bool, intgosize string) (outGo, outC string, err error) { + cgoCPPFLAGS, cgoCFLAGS, cgoCXXFLAGS, _ := b.cflags(p, true) + var cflags []string + if cxx { + cflags = stringList(cgoCPPFLAGS, pcCFLAGS, cgoCXXFLAGS) + } else { + cflags = stringList(cgoCPPFLAGS, pcCFLAGS, cgoCFLAGS) + } + + n := 5 // length of ".swig" + if cxx { + n = 8 // length of ".swigcxx" + } + base := file[:len(file)-n] + goFile := base + ".go" + gccBase := base + "_wrap." + gccExt := "c" + if cxx { + gccExt = "cxx" + } + + _, gccgo := buildToolchain.(gccgoToolchain) + + // swig + args := []string{ + "-go", + "-cgo", + "-intgosize", intgosize, + "-module", base, + "-o", obj + gccBase + gccExt, + "-outdir", obj, + } + + for _, f := range cflags { + if len(f) > 3 && f[:2] == "-I" { + args = append(args, f) + } + } + + if gccgo { + args = append(args, "-gccgo") + if pkgpath := gccgoPkgpath(p); pkgpath != "" { + args = append(args, "-go-pkgpath", pkgpath) + } + } + if cxx { + args = append(args, "-c++") + } + + out, err := b.runOut(p.Dir, p.ImportPath, nil, "swig", args, file) + if err != nil { + if len(out) > 0 { + if bytes.Contains(out, []byte("-intgosize")) || bytes.Contains(out, []byte("-cgo")) { + return "", "", errors.New("must have SWIG version >= 3.0.6") + } + b.showOutput(p.Dir, p.ImportPath, b.processOutput(out)) // swig error + return "", "", errPrintedOutput + } + return "", "", err + } + if len(out) > 0 { + b.showOutput(p.Dir, p.ImportPath, b.processOutput(out)) // swig warning + } + + return obj + goFile, obj + gccBase + gccExt, nil +} + +// disableBuildID adjusts a linker command line to avoid creating a +// build ID when creating an object file rather than an executable or +// shared library. Some systems, such as Ubuntu, always add +// --build-id to every link, but we don't want a build ID when we are +// producing an object file. On some of those system a plain -r (not +// -Wl,-r) will turn off --build-id, but clang 3.0 doesn't support a +// plain -r. I don't know how to turn off --build-id when using clang +// other than passing a trailing --build-id=none. So that is what we +// do, but only on systems likely to support it, which is to say, +// systems that normally use gold or the GNU linker. +func (b *builder) disableBuildID(ldflags []string) []string { + switch goos { + case "android", "dragonfly", "linux", "netbsd": + ldflags = append(ldflags, "-Wl,--build-id=none") + } + return ldflags +} + +// An actionQueue is a priority queue of actions. +type actionQueue []*action + +// Implement heap.Interface +func (q *actionQueue) Len() int { return len(*q) } +func (q *actionQueue) Swap(i, j int) { (*q)[i], (*q)[j] = (*q)[j], (*q)[i] } +func (q *actionQueue) Less(i, j int) bool { return (*q)[i].priority < (*q)[j].priority } +func (q *actionQueue) Push(x interface{}) { *q = append(*q, x.(*action)) } +func (q *actionQueue) Pop() interface{} { + n := len(*q) - 1 + x := (*q)[n] + *q = (*q)[:n] + return x +} + +func (q *actionQueue) push(a *action) { + heap.Push(q, a) +} + +func (q *actionQueue) pop() *action { + return heap.Pop(q).(*action) +} + +func raceInit() { + if !buildRace { + return + } + if goarch != "amd64" || goos != "linux" && goos != "freebsd" && goos != "darwin" && goos != "windows" { + fmt.Fprintf(os.Stderr, "go %s: -race is only supported on linux/amd64, freebsd/amd64, darwin/amd64 and windows/amd64\n", flag.Args()[0]) + os.Exit(2) + } + buildGcflags = append(buildGcflags, "-race") + buildLdflags = append(buildLdflags, "-race") + if buildContext.InstallSuffix != "" { + buildContext.InstallSuffix += "_" + } + buildContext.InstallSuffix += "race" + buildContext.BuildTags = append(buildContext.BuildTags, "race") +} + +// defaultSuffix returns file extension used for command files in +// current os environment. +func defaultSuffix() string { + switch runtime.GOOS { + case "windows": + return ".bat" + case "plan9": + return ".rc" + default: + return ".bash" + } +} diff --git a/src/cmd/go/clean.go b/src/cmd/go/clean.go new file mode 100644 index 0000000000000000000000000000000000000000..16054a5b5bc33869a78ac1eaac2fe4a19c6a8587 --- /dev/null +++ b/src/cmd/go/clean.go @@ -0,0 +1,248 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +import ( + "fmt" + "io/ioutil" + "os" + "path/filepath" + "strings" +) + +var cmdClean = &Command{ + UsageLine: "clean [-i] [-r] [-n] [-x] [build flags] [packages]", + Short: "remove object files", + Long: ` +Clean removes object files from package source directories. +The go command builds most objects in a temporary directory, +so go clean is mainly concerned with object files left by other +tools or by manual invocations of go build. + +Specifically, clean removes the following files from each of the +source directories corresponding to the import paths: + + _obj/ old object directory, left from Makefiles + _test/ old test directory, left from Makefiles + _testmain.go old gotest file, left from Makefiles + test.out old test log, left from Makefiles + build.out old test log, left from Makefiles + *.[568ao] object files, left from Makefiles + + DIR(.exe) from go build + DIR.test(.exe) from go test -c + MAINFILE(.exe) from go build MAINFILE.go + *.so from SWIG + +In the list, DIR represents the final path element of the +directory, and MAINFILE is the base name of any Go source +file in the directory that is not included when building +the package. + +The -i flag causes clean to remove the corresponding installed +archive or binary (what 'go install' would create). + +The -n flag causes clean to print the remove commands it would execute, +but not run them. + +The -r flag causes clean to be applied recursively to all the +dependencies of the packages named by the import paths. + +The -x flag causes clean to print remove commands as it executes them. + +For more about build flags, see 'go help build'. + +For more about specifying packages, see 'go help packages'. + `, +} + +var cleanI bool // clean -i flag +var cleanR bool // clean -r flag + +func init() { + // break init cycle + cmdClean.Run = runClean + + cmdClean.Flag.BoolVar(&cleanI, "i", false, "") + cmdClean.Flag.BoolVar(&cleanR, "r", false, "") + // -n and -x are important enough to be + // mentioned explicitly in the docs but they + // are part of the build flags. + + addBuildFlags(cmdClean) +} + +func runClean(cmd *Command, args []string) { + for _, pkg := range packagesAndErrors(args) { + clean(pkg) + } +} + +var cleaned = map[*Package]bool{} + +// TODO: These are dregs left by Makefile-based builds. +// Eventually, can stop deleting these. +var cleanDir = map[string]bool{ + "_test": true, + "_obj": true, +} + +var cleanFile = map[string]bool{ + "_testmain.go": true, + "test.out": true, + "build.out": true, + "a.out": true, +} + +var cleanExt = map[string]bool{ + ".5": true, + ".6": true, + ".8": true, + ".a": true, + ".o": true, + ".so": true, +} + +func clean(p *Package) { + if cleaned[p] { + return + } + cleaned[p] = true + + if p.Dir == "" { + errorf("can't load package: %v", p.Error) + return + } + dirs, err := ioutil.ReadDir(p.Dir) + if err != nil { + errorf("go clean %s: %v", p.Dir, err) + return + } + + var b builder + b.print = fmt.Print + + packageFile := map[string]bool{} + if p.Name != "main" { + // Record which files are not in package main. + // The others are. + keep := func(list []string) { + for _, f := range list { + packageFile[f] = true + } + } + keep(p.GoFiles) + keep(p.CgoFiles) + keep(p.TestGoFiles) + keep(p.XTestGoFiles) + } + + _, elem := filepath.Split(p.Dir) + var allRemove []string + + // Remove dir-named executable only if this is package main. + if p.Name == "main" { + allRemove = append(allRemove, + elem, + elem+".exe", + ) + } + + // Remove package test executables. + allRemove = append(allRemove, + elem+".test", + elem+".test.exe", + ) + + // Remove a potential executable for each .go file in the directory that + // is not part of the directory's package. + for _, dir := range dirs { + name := dir.Name() + if packageFile[name] { + continue + } + if !dir.IsDir() && strings.HasSuffix(name, ".go") { + // TODO(adg,rsc): check that this .go file is actually + // in "package main", and therefore capable of building + // to an executable file. + base := name[:len(name)-len(".go")] + allRemove = append(allRemove, base, base+".exe") + } + } + + if buildN || buildX { + b.showcmd(p.Dir, "rm -f %s", strings.Join(allRemove, " ")) + } + + toRemove := map[string]bool{} + for _, name := range allRemove { + toRemove[name] = true + } + for _, dir := range dirs { + name := dir.Name() + if dir.IsDir() { + // TODO: Remove once Makefiles are forgotten. + if cleanDir[name] { + if buildN || buildX { + b.showcmd(p.Dir, "rm -r %s", name) + if buildN { + continue + } + } + if err := os.RemoveAll(filepath.Join(p.Dir, name)); err != nil { + errorf("go clean: %v", err) + } + } + continue + } + + if buildN { + continue + } + + if cleanFile[name] || cleanExt[filepath.Ext(name)] || toRemove[name] { + removeFile(filepath.Join(p.Dir, name)) + } + } + + if cleanI && p.target != "" { + if buildN || buildX { + b.showcmd("", "rm -f %s", p.target) + } + if !buildN { + removeFile(p.target) + } + } + + if cleanR { + for _, p1 := range p.imports { + clean(p1) + } + } +} + +// removeFile tries to remove file f, if error other than file doesn't exist +// occurs, it will report the error. +func removeFile(f string) { + err := os.Remove(f) + if err == nil || os.IsNotExist(err) { + return + } + // Windows does not allow deletion of a binary file while it is executing. + if toolIsWindows { + // Remove lingering ~ file from last attempt. + if _, err2 := os.Stat(f + "~"); err2 == nil { + os.Remove(f + "~") + } + // Try to move it out of the way. If the move fails, + // which is likely, we'll try again the + // next time we do an install of this binary. + if err2 := os.Rename(f, f+"~"); err2 == nil { + os.Remove(f + "~") + return + } + } + errorf("go clean: %v", err) +} diff --git a/src/cmd/go/context.go b/src/cmd/go/context.go new file mode 100644 index 0000000000000000000000000000000000000000..68e518259f45b3798db7e738808ca0aafc038b37 --- /dev/null +++ b/src/cmd/go/context.go @@ -0,0 +1,36 @@ +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +import ( + "go/build" +) + +type Context struct { + GOARCH string `json:",omitempty"` // target architecture + GOOS string `json:",omitempty"` // target operating system + GOROOT string `json:",omitempty"` // Go root + GOPATH string `json:",omitempty"` // Go path + CgoEnabled bool `json:",omitempty"` // whether cgo can be used + UseAllFiles bool `json:",omitempty"` // use files regardless of +build lines, file names + Compiler string `json:",omitempty"` // compiler to assume when computing target paths + BuildTags []string `json:",omitempty"` // build constraints to match in +build lines + ReleaseTags []string `json:",omitempty"` // releases the current release is compatible with + InstallSuffix string `json:",omitempty"` // suffix to use in the name of the install dir +} + +func newContext(c *build.Context) *Context { + return &Context{ + GOARCH: c.GOARCH, + GOOS: c.GOOS, + GOROOT: c.GOROOT, + CgoEnabled: c.CgoEnabled, + UseAllFiles: c.UseAllFiles, + Compiler: c.Compiler, + BuildTags: c.BuildTags, + ReleaseTags: c.ReleaseTags, + InstallSuffix: c.InstallSuffix, + } +} diff --git a/src/cmd/go/discovery.go b/src/cmd/go/discovery.go new file mode 100644 index 0000000000000000000000000000000000000000..b9f42799546e306f8f3762d00d2c6d273d3e50a2 --- /dev/null +++ b/src/cmd/go/discovery.go @@ -0,0 +1,83 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build !cmd_go_bootstrap + +// This code is compiled into the real 'go' binary, but it is not +// compiled into the binary that is built during all.bash, so as +// to avoid needing to build net (and thus use cgo) during the +// bootstrap process. + +package main + +import ( + "encoding/xml" + "fmt" + "io" + "strings" +) + +// charsetReader returns a reader for the given charset. Currently +// it only supports UTF-8 and ASCII. Otherwise, it returns a meaningful +// error which is printed by go get, so the user can find why the package +// wasn't downloaded if the encoding is not supported. Note that, in +// order to reduce potential errors, ASCII is treated as UTF-8 (i.e. characters +// greater than 0x7f are not rejected). +func charsetReader(charset string, input io.Reader) (io.Reader, error) { + switch strings.ToLower(charset) { + case "ascii": + return input, nil + default: + return nil, fmt.Errorf("can't decode XML document using charset %q", charset) + } +} + +// parseMetaGoImports returns meta imports from the HTML in r. +// Parsing ends at the end of the section or the beginning of the . +func parseMetaGoImports(r io.Reader) (imports []metaImport, err error) { + d := xml.NewDecoder(r) + d.CharsetReader = charsetReader + d.Strict = false + var t xml.Token + for { + t, err = d.Token() + if err != nil { + if err == io.EOF { + err = nil + } + return + } + if e, ok := t.(xml.StartElement); ok && strings.EqualFold(e.Name.Local, "body") { + return + } + if e, ok := t.(xml.EndElement); ok && strings.EqualFold(e.Name.Local, "head") { + return + } + e, ok := t.(xml.StartElement) + if !ok || !strings.EqualFold(e.Name.Local, "meta") { + continue + } + if attrValue(e.Attr, "name") != "go-import" { + continue + } + if f := strings.Fields(attrValue(e.Attr, "content")); len(f) == 3 { + imports = append(imports, metaImport{ + Prefix: f[0], + VCS: f[1], + RepoRoot: f[2], + }) + } + } +} + +// attrValue returns the attribute value for the case-insensitive key +// `name', or the empty string if nothing is found. +func attrValue(attrs []xml.Attr, name string) string { + for _, a := range attrs { + if strings.EqualFold(a.Name.Local, name) { + return a.Value + } + } + return "" +} diff --git a/src/cmd/go/doc.go b/src/cmd/go/doc.go new file mode 100644 index 0000000000000000000000000000000000000000..4a07dfe11f4e76a76a3aa6feceaa55c964ccf367 --- /dev/null +++ b/src/cmd/go/doc.go @@ -0,0 +1,103 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +var cmdDoc = &Command{ + Run: runDoc, + UsageLine: "doc [-u] [-c] [package|[package.]symbol[.method]]", + CustomFlags: true, + Short: "show documentation for package or symbol", + Long: ` +Doc prints the documentation comments associated with the item identified by its +arguments (a package, const, func, type, var, or method) followed by a one-line +summary of each of the first-level items "under" that item (package-level +declarations for a package, methods for a type, etc.). + +Doc accepts zero, one, or two arguments. + +Given no arguments, that is, when run as + + go doc + +it prints the package documentation for the package in the current directory. +If the package is a command (package main), the exported symbols of the package +are elided from the presentation unless the -cmd flag is provided. + +When run with one argument, the argument is treated as a Go-syntax-like +representation of the item to be documented. What the argument selects depends +on what is installed in GOROOT and GOPATH, as well as the form of the argument, +which is schematically one of these: + + go doc + go doc [.] + go doc [].[.] + +The first item in this list matched by the argument is the one whose +documentation is printed. (See the examples below.) For packages, the order of +scanning is determined lexically, but the GOROOT tree is always scanned before +GOPATH. + +If there is no package specified or matched, the package in the current +directory is selected, so "go doc Foo" shows the documentation for symbol Foo in +the current package. + +The package path must be either a qualified path or a proper suffix of a +path. The go tool's usual package mechanism does not apply: package path +elements like . and ... are not implemented by go doc. + +When run with two arguments, the first must be a full package path (not just a +suffix), and the second is a symbol or symbol and method; this is similar to the +syntax accepted by godoc: + + go doc [.] + +In all forms, when matching symbols, lower-case letters in the argument match +either case but upper-case letters match exactly. This means that there may be +multiple matches of a lower-case argument in a package if different symbols have +different cases. If this occurs, documentation for all matches is printed. + +Examples: + go doc + Show documentation for current package. + go doc Foo + Show documentation for Foo in the current package. + (Foo starts with a capital letter so it cannot match + a package path.) + go doc encoding/json + Show documentation for the encoding/json package. + go doc json + Shorthand for encoding/json. + go doc json.Number (or go doc json.number) + Show documentation and method summary for json.Number. + go doc json.Number.Int64 (or go doc json.number.int64) + Show documentation for json.Number's Int64 method. + go doc cmd/doc + Show package docs for the doc command. + go doc -cmd cmd/doc + Show package docs and exported symbols within the doc command. + go doc template.new + Show documentation for html/template's New function. + (html/template is lexically before text/template) + go doc text/template.new # One argument + Show documentation for text/template's New function. + go doc text/template new # Two arguments + Show documentation for text/template's New function. + +Flags: + -c + Respect case when matching symbols. + -cmd + Treat a command (package main) like a regular package. + Otherwise package main's exported symbols are hidden + when showing the package's top-level documentation. + -u + Show documentation for unexported as well as exported + symbols and methods. +`, +} + +func runDoc(cmd *Command, args []string) { + run(buildToolExec, tool("doc"), args) +} diff --git a/src/cmd/go/env.go b/src/cmd/go/env.go new file mode 100644 index 0000000000000000000000000000000000000000..600accac03f2767bf086d45b8a94ec5313d8d123 --- /dev/null +++ b/src/cmd/go/env.go @@ -0,0 +1,112 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +import ( + "fmt" + "os" + "runtime" + "strings" +) + +var cmdEnv = &Command{ + Run: runEnv, + UsageLine: "env [var ...]", + Short: "print Go environment information", + Long: ` +Env prints Go environment information. + +By default env prints information as a shell script +(on Windows, a batch file). If one or more variable +names is given as arguments, env prints the value of +each named variable on its own line. + `, +} + +type envVar struct { + name, value string +} + +func mkEnv() []envVar { + var b builder + b.init() + + env := []envVar{ + {"GOARCH", goarch}, + {"GOBIN", gobin}, + {"GOEXE", exeSuffix}, + {"GOHOSTARCH", runtime.GOARCH}, + {"GOHOSTOS", runtime.GOOS}, + {"GOOS", goos}, + {"GOPATH", os.Getenv("GOPATH")}, + {"GORACE", os.Getenv("GORACE")}, + {"GOROOT", goroot}, + {"GOTOOLDIR", toolDir}, + {"GO15VENDOREXPERIMENT", os.Getenv("GO15VENDOREXPERIMENT")}, + + // disable escape codes in clang errors + {"TERM", "dumb"}, + } + + if goos != "plan9" { + cmd := b.gccCmd(".") + env = append(env, envVar{"CC", cmd[0]}) + env = append(env, envVar{"GOGCCFLAGS", strings.Join(cmd[3:], " ")}) + cmd = b.gxxCmd(".") + env = append(env, envVar{"CXX", cmd[0]}) + } + + if buildContext.CgoEnabled { + env = append(env, envVar{"CGO_ENABLED", "1"}) + } else { + env = append(env, envVar{"CGO_ENABLED", "0"}) + } + + return env +} + +func findEnv(env []envVar, name string) string { + for _, e := range env { + if e.name == name { + return e.value + } + } + return "" +} + +func runEnv(cmd *Command, args []string) { + env := mkEnv() + if len(args) > 0 { + for _, name := range args { + fmt.Printf("%s\n", findEnv(env, name)) + } + return + } + + for _, e := range env { + if e.name != "TERM" { + switch runtime.GOOS { + default: + fmt.Printf("%s=\"%s\"\n", e.name, e.value) + case "plan9": + if strings.IndexByte(e.value, '\x00') < 0 { + fmt.Printf("%s='%s'\n", e.name, strings.Replace(e.value, "'", "''", -1)) + } else { + v := strings.Split(e.value, "\x00") + fmt.Printf("%s=(", e.name) + for x, s := range v { + if x > 0 { + fmt.Printf(" ") + } + fmt.Printf("%s", s) + } + fmt.Printf(")\n") + } + case "windows": + fmt.Printf("set %s=%s\n", e.name, e.value) + } + } + } +} diff --git a/src/cmd/go/fix.go b/src/cmd/go/fix.go new file mode 100644 index 0000000000000000000000000000000000000000..94fd22e3c2150ec64d4840d15a262e025968a463 --- /dev/null +++ b/src/cmd/go/fix.go @@ -0,0 +1,30 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +var cmdFix = &Command{ + Run: runFix, + UsageLine: "fix [packages]", + Short: "run go tool fix on packages", + Long: ` +Fix runs the Go fix command on the packages named by the import paths. + +For more about fix, see 'go doc cmd/fix'. +For more about specifying packages, see 'go help packages'. + +To run fix with specific options, run 'go tool fix'. + +See also: go fmt, go vet. + `, +} + +func runFix(cmd *Command, args []string) { + for _, pkg := range packages(args) { + // Use pkg.gofiles instead of pkg.Dir so that + // the command only applies to this package, + // not to packages in subdirectories. + run(stringList(buildToolExec, tool("fix"), relPaths(pkg.allgofiles))) + } +} diff --git a/src/cmd/go/fmt.go b/src/cmd/go/fmt.go new file mode 100644 index 0000000000000000000000000000000000000000..57c02ad26477f483c4fe3422809076a7a32070d4 --- /dev/null +++ b/src/cmd/go/fmt.go @@ -0,0 +1,64 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +import ( + "os" + "path/filepath" +) + +func init() { + addBuildFlagsNX(cmdFmt) +} + +var cmdFmt = &Command{ + Run: runFmt, + UsageLine: "fmt [-n] [-x] [packages]", + Short: "run gofmt on package sources", + Long: ` +Fmt runs the command 'gofmt -l -w' on the packages named +by the import paths. It prints the names of the files that are modified. + +For more about gofmt, see 'go doc cmd/gofmt'. +For more about specifying packages, see 'go help packages'. + +The -n flag prints commands that would be executed. +The -x flag prints commands as they are executed. + +To run gofmt with specific options, run gofmt itself. + +See also: go fix, go vet. + `, +} + +func runFmt(cmd *Command, args []string) { + gofmt := gofmtPath() + for _, pkg := range packages(args) { + // Use pkg.gofiles instead of pkg.Dir so that + // the command only applies to this package, + // not to packages in subdirectories. + run(stringList(gofmt, "-l", "-w", relPaths(pkg.allgofiles))) + } +} + +func gofmtPath() string { + gofmt := "gofmt" + if toolIsWindows { + gofmt += toolWindowsExtension + } + + gofmtPath := filepath.Join(gobin, gofmt) + if _, err := os.Stat(gofmtPath); err == nil { + return gofmtPath + } + + gofmtPath = filepath.Join(goroot, "bin", gofmt) + if _, err := os.Stat(gofmtPath); err == nil { + return gofmtPath + } + + // fallback to looking for gofmt in $PATH + return "gofmt" +} diff --git a/src/cmd/go/generate.go b/src/cmd/go/generate.go new file mode 100644 index 0000000000000000000000000000000000000000..efdc229b2281a2e0463e12d4308c85299ed56c74 --- /dev/null +++ b/src/cmd/go/generate.go @@ -0,0 +1,410 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +import ( + "bufio" + "bytes" + "fmt" + "io" + "log" + "os" + "os/exec" + "path/filepath" + "regexp" + "runtime" + "strconv" + "strings" + "unicode" +) + +var cmdGenerate = &Command{ + Run: runGenerate, + UsageLine: "generate [-run regexp] [file.go... | packages]", + Short: "generate Go files by processing source", + Long: ` +Generate runs commands described by directives within existing +files. Those commands can run any process but the intent is to +create or update Go source files, for instance by running yacc. + +Go generate is never run automatically by go build, go get, go test, +and so on. It must be run explicitly. + +Go generate scans the file for directives, which are lines of +the form, + + //go:generate command argument... + +(note: no leading spaces and no space in "//go") where command +is the generator to be run, corresponding to an executable file +that can be run locally. It must either be in the shell path +(gofmt), a fully qualified path (/usr/you/bin/mytool), or a +command alias, described below. + +Note that go generate does not parse the file, so lines that look +like directives in comments or multiline strings will be treated +as directives. + +The arguments to the directive are space-separated tokens or +double-quoted strings passed to the generator as individual +arguments when it is run. + +Quoted strings use Go syntax and are evaluated before execution; a +quoted string appears as a single argument to the generator. + +Go generate sets several variables when it runs the generator: + + $GOARCH + The execution architecture (arm, amd64, etc.) + $GOOS + The execution operating system (linux, windows, etc.) + $GOFILE + The base name of the file. + $GOLINE + The line number of the directive in the source file. + $GOPACKAGE + The name of the package of the file containing the directive. + $DOLLAR + A dollar sign. + +Other than variable substitution and quoted-string evaluation, no +special processing such as "globbing" is performed on the command +line. + +As a last step before running the command, any invocations of any +environment variables with alphanumeric names, such as $GOFILE or +$HOME, are expanded throughout the command line. The syntax for +variable expansion is $NAME on all operating systems. Due to the +order of evaluation, variables are expanded even inside quoted +strings. If the variable NAME is not set, $NAME expands to the +empty string. + +A directive of the form, + + //go:generate -command xxx args... + +specifies, for the remainder of this source file only, that the +string xxx represents the command identified by the arguments. This +can be used to create aliases or to handle multiword generators. +For example, + + //go:generate -command yacc go tool yacc + +specifies that the command "yacc" represents the generator +"go tool yacc". + +Generate processes packages in the order given on the command line, +one at a time. If the command line lists .go files, they are treated +as a single package. Within a package, generate processes the +source files in a package in file name order, one at a time. Within +a source file, generate runs generators in the order they appear +in the file, one at a time. + +If any generator returns an error exit status, "go generate" skips +all further processing for that package. + +The generator is run in the package's source directory. + +Go generate accepts one specific flag: + + -run="" + if non-empty, specifies a regular expression to select + directives whose full original source text (excluding + any trailing spaces and final newline) matches the + expression. + +It also accepts the standard build flags -v, -n, and -x. +The -v flag prints the names of packages and files as they are +processed. +The -n flag prints commands that would be executed. +The -x flag prints commands as they are executed. + +For more about specifying packages, see 'go help packages'. + `, +} + +var ( + generateRunFlag string // generate -run flag + generateRunRE *regexp.Regexp // compiled expression for -run +) + +func init() { + addBuildFlags(cmdGenerate) + cmdGenerate.Flag.StringVar(&generateRunFlag, "run", "", "") +} + +func runGenerate(cmd *Command, args []string) { + if generateRunFlag != "" { + var err error + generateRunRE, err = regexp.Compile(generateRunFlag) + if err != nil { + log.Fatalf("generate: %s", err) + } + } + // Even if the arguments are .go files, this loop suffices. + for _, pkg := range packages(args) { + for _, file := range pkg.gofiles { + if !generate(pkg.Name, file) { + break + } + } + } +} + +// generate runs the generation directives for a single file. +func generate(pkg, absFile string) bool { + fd, err := os.Open(absFile) + if err != nil { + log.Fatalf("generate: %s", err) + } + defer fd.Close() + g := &Generator{ + r: fd, + path: absFile, + pkg: pkg, + commands: make(map[string][]string), + } + return g.run() +} + +// A Generator represents the state of a single Go source file +// being scanned for generator commands. +type Generator struct { + r io.Reader + path string // full rooted path name. + dir string // full rooted directory of file. + file string // base name of file. + pkg string + commands map[string][]string + lineNum int // current line number. +} + +// run runs the generators in the current file. +func (g *Generator) run() (ok bool) { + // Processing below here calls g.errorf on failure, which does panic(stop). + // If we encounter an error, we abort the package. + defer func() { + e := recover() + if e != nil { + ok = false + if e != stop { + panic(e) + } + setExitStatus(1) + } + }() + g.dir, g.file = filepath.Split(g.path) + g.dir = filepath.Clean(g.dir) // No final separator please. + if buildV { + fmt.Fprintf(os.Stderr, "%s\n", shortPath(g.path)) + } + + // Scan for lines that start "//go:generate". + // Can't use bufio.Scanner because it can't handle long lines, + // which are likely to appear when using generate. + input := bufio.NewReader(g.r) + var err error + // One line per loop. + for { + g.lineNum++ // 1-indexed. + var buf []byte + buf, err = input.ReadSlice('\n') + if err == bufio.ErrBufferFull { + // Line too long - consume and ignore. + if isGoGenerate(buf) { + g.errorf("directive too long") + } + for err == bufio.ErrBufferFull { + _, err = input.ReadSlice('\n') + } + if err != nil { + break + } + continue + } + + if err != nil { + // Check for marker at EOF without final \n. + if err == io.EOF && isGoGenerate(buf) { + err = io.ErrUnexpectedEOF + } + break + } + + if !isGoGenerate(buf) { + continue + } + if generateRunFlag != "" { + if !generateRunRE.Match(bytes.TrimSpace(buf)) { + continue + } + } + + words := g.split(string(buf)) + if len(words) == 0 { + g.errorf("no arguments to directive") + } + if words[0] == "-command" { + g.setShorthand(words) + continue + } + // Run the command line. + if buildN || buildX { + fmt.Fprintf(os.Stderr, "%s\n", strings.Join(words, " ")) + } + if buildN { + continue + } + g.exec(words) + } + if err != nil && err != io.EOF { + g.errorf("error reading %s: %s", shortPath(g.path), err) + } + return true +} + +func isGoGenerate(buf []byte) bool { + return bytes.HasPrefix(buf, []byte("//go:generate ")) || bytes.HasPrefix(buf, []byte("//go:generate\t")) +} + +// split breaks the line into words, evaluating quoted +// strings and evaluating environment variables. +// The initial //go:generate element is present in line. +func (g *Generator) split(line string) []string { + // Parse line, obeying quoted strings. + var words []string + line = line[len("//go:generate ") : len(line)-1] // Drop preamble and final newline. + // There may still be a carriage return. + if len(line) > 0 && line[len(line)-1] == '\r' { + line = line[:len(line)-1] + } + // One (possibly quoted) word per iteration. +Words: + for { + line = strings.TrimLeft(line, " \t") + if len(line) == 0 { + break + } + if line[0] == '"' { + for i := 1; i < len(line); i++ { + c := line[i] // Only looking for ASCII so this is OK. + switch c { + case '\\': + if i+1 == len(line) { + g.errorf("bad backslash") + } + i++ // Absorb next byte (If it's a multibyte we'll get an error in Unquote). + case '"': + word, err := strconv.Unquote(line[0 : i+1]) + if err != nil { + g.errorf("bad quoted string") + } + words = append(words, word) + line = line[i+1:] + // Check the next character is space or end of line. + if len(line) > 0 && line[0] != ' ' && line[0] != '\t' { + g.errorf("expect space after quoted argument") + } + continue Words + } + } + g.errorf("mismatched quoted string") + } + i := strings.IndexAny(line, " \t") + if i < 0 { + i = len(line) + } + words = append(words, line[0:i]) + line = line[i:] + } + // Substitute command if required. + if len(words) > 0 && g.commands[words[0]] != nil { + // Replace 0th word by command substitution. + words = append(g.commands[words[0]], words[1:]...) + } + // Substitute environment variables. + for i, word := range words { + words[i] = os.Expand(word, g.expandVar) + } + return words +} + +var stop = fmt.Errorf("error in generation") + +// errorf logs an error message prefixed with the file and line number. +// It then exits the program (with exit status 1) because generation stops +// at the first error. +func (g *Generator) errorf(format string, args ...interface{}) { + fmt.Fprintf(os.Stderr, "%s:%d: %s\n", shortPath(g.path), g.lineNum, + fmt.Sprintf(format, args...)) + panic(stop) +} + +// expandVar expands the $XXX invocation in word. It is called +// by os.Expand. +func (g *Generator) expandVar(word string) string { + switch word { + case "GOARCH": + return buildContext.GOARCH + case "GOOS": + return buildContext.GOOS + case "GOFILE": + return g.file + case "GOLINE": + return fmt.Sprint(g.lineNum) + case "GOPACKAGE": + return g.pkg + case "DOLLAR": + return "$" + default: + return os.Getenv(word) + } +} + +// identLength returns the length of the identifier beginning the string. +func (g *Generator) identLength(word string) int { + for i, r := range word { + if r == '_' || unicode.IsLetter(r) || unicode.IsDigit(r) { + continue + } + return i + } + return len(word) +} + +// setShorthand installs a new shorthand as defined by a -command directive. +func (g *Generator) setShorthand(words []string) { + // Create command shorthand. + if len(words) == 1 { + g.errorf("no command specified for -command") + } + command := words[1] + if g.commands[command] != nil { + g.errorf("command %q defined multiply defined", command) + } + g.commands[command] = words[2:len(words):len(words)] // force later append to make copy +} + +// exec runs the command specified by the argument. The first word is +// the command name itself. +func (g *Generator) exec(words []string) { + cmd := exec.Command(words[0], words[1:]...) + // Standard in and out of generator should be the usual. + cmd.Stdout = os.Stdout + cmd.Stderr = os.Stderr + // Run the command in the package directory. + cmd.Dir = g.dir + env := []string{ + "GOARCH=" + runtime.GOARCH, + "GOOS=" + runtime.GOOS, + "GOFILE=" + g.file, + "GOPACKAGE=" + g.pkg, + } + cmd.Env = mergeEnvLists(env, origEnv) + err := cmd.Run() + if err != nil { + g.errorf("running %q: %s", words[0], err) + } +} diff --git a/src/cmd/go/generate_test.go b/src/cmd/go/generate_test.go new file mode 100644 index 0000000000000000000000000000000000000000..169d71ca812b7515e12a3c5909f21dce38b9cf02 --- /dev/null +++ b/src/cmd/go/generate_test.go @@ -0,0 +1,55 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +import ( + "reflect" + "runtime" + "testing" +) + +type splitTest struct { + in string + out []string +} + +var splitTests = []splitTest{ + {"", nil}, + {"x", []string{"x"}}, + {" a b\tc ", []string{"a", "b", "c"}}, + {` " a " `, []string{" a "}}, + {"$GOARCH", []string{runtime.GOARCH}}, + {"$GOOS", []string{runtime.GOOS}}, + {"$GOFILE", []string{"proc.go"}}, + {"$GOPACKAGE", []string{"sys"}}, + {"a $XXNOTDEFINEDXX b", []string{"a", "", "b"}}, + {"/$XXNOTDEFINED/", []string{"//"}}, + {"/$DOLLAR/", []string{"/$/"}}, + {"yacc -o $GOARCH/yacc_$GOFILE", []string{"go", "tool", "yacc", "-o", runtime.GOARCH + "/yacc_proc.go"}}, +} + +func TestGenerateCommandParse(t *testing.T) { + g := &Generator{ + r: nil, // Unused here. + path: "/usr/ken/sys/proc.go", + dir: "/usr/ken/sys", + file: "proc.go", + pkg: "sys", + commands: make(map[string][]string), + } + g.setShorthand([]string{"-command", "yacc", "go", "tool", "yacc"}) + for _, test := range splitTests { + // First with newlines. + got := g.split("//go:generate " + test.in + "\n") + if !reflect.DeepEqual(got, test.out) { + t.Errorf("split(%q): got %q expected %q", test.in, got, test.out) + } + // Then with CRLFs, thank you Windows. + got = g.split("//go:generate " + test.in + "\r\n") + if !reflect.DeepEqual(got, test.out) { + t.Errorf("split(%q): got %q expected %q", test.in, got, test.out) + } + } +} diff --git a/src/cmd/go/get.go b/src/cmd/go/get.go new file mode 100644 index 0000000000000000000000000000000000000000..e95201a69307b040de55a24082c37701c20b6a40 --- /dev/null +++ b/src/cmd/go/get.go @@ -0,0 +1,535 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +import ( + "fmt" + "go/build" + "os" + "path/filepath" + "regexp" + "runtime" + "strconv" + "strings" +) + +var cmdGet = &Command{ + UsageLine: "get [-d] [-f] [-fix] [-insecure] [-t] [-u] [build flags] [packages]", + Short: "download and install packages and dependencies", + Long: ` +Get downloads and installs the packages named by the import paths, +along with their dependencies. + +The -d flag instructs get to stop after downloading the packages; that is, +it instructs get not to install the packages. + +The -f flag, valid only when -u is set, forces get -u not to verify that +each package has been checked out from the source control repository +implied by its import path. This can be useful if the source is a local fork +of the original. + +The -fix flag instructs get to run the fix tool on the downloaded packages +before resolving dependencies or building the code. + +The -insecure flag permits fetching from repositories and resolving +custom domains using insecure schemes such as HTTP. Use with caution. + +The -t flag instructs get to also download the packages required to build +the tests for the specified packages. + +The -u flag instructs get to use the network to update the named packages +and their dependencies. By default, get uses the network to check out +missing packages but does not use it to look for updates to existing packages. + +Get also accepts build flags to control the installation. See 'go help build'. + +When checking out or updating a package, get looks for a branch or tag +that matches the locally installed version of Go. The most important +rule is that if the local installation is running version "go1", get +searches for a branch or tag named "go1". If no such version exists it +retrieves the most recent version of the package. + +If the vendoring experiment is enabled (see 'go help gopath'), +then when go get checks out or updates a Git repository, +it also updates any git submodules referenced by the repository. + +For more about specifying packages, see 'go help packages'. + +For more about how 'go get' finds source code to +download, see 'go help importpath'. + +See also: go build, go install, go clean. + `, +} + +var getD = cmdGet.Flag.Bool("d", false, "") +var getF = cmdGet.Flag.Bool("f", false, "") +var getT = cmdGet.Flag.Bool("t", false, "") +var getU = cmdGet.Flag.Bool("u", false, "") +var getFix = cmdGet.Flag.Bool("fix", false, "") +var getInsecure = cmdGet.Flag.Bool("insecure", false, "") + +func init() { + addBuildFlags(cmdGet) + cmdGet.Run = runGet // break init loop +} + +func runGet(cmd *Command, args []string) { + if *getF && !*getU { + fatalf("go get: cannot use -f flag without -u") + } + + // Disable any prompting for passwords by Git. + // Only has an effect for 2.3.0 or later, but avoiding + // the prompt in earlier versions is just too hard. + // See golang.org/issue/9341. + os.Setenv("GIT_TERMINAL_PROMPT", "0") + + // Phase 1. Download/update. + var stk importStack + mode := 0 + if *getT { + mode |= getTestDeps + } + for _, arg := range downloadPaths(args) { + download(arg, nil, &stk, mode) + } + exitIfErrors() + + // Phase 2. Rescan packages and re-evaluate args list. + + // Code we downloaded and all code that depends on it + // needs to be evicted from the package cache so that + // the information will be recomputed. Instead of keeping + // track of the reverse dependency information, evict + // everything. + for name := range packageCache { + delete(packageCache, name) + } + + args = importPaths(args) + packagesForBuild(args) + + // Phase 3. Install. + if *getD { + // Download only. + // Check delayed until now so that importPaths + // and packagesForBuild have a chance to print errors. + return + } + + runInstall(cmd, args) +} + +// downloadPaths prepares the list of paths to pass to download. +// It expands ... patterns that can be expanded. If there is no match +// for a particular pattern, downloadPaths leaves it in the result list, +// in the hope that we can figure out the repository from the +// initial ...-free prefix. +func downloadPaths(args []string) []string { + args = importPathsNoDotExpansion(args) + var out []string + for _, a := range args { + if strings.Contains(a, "...") { + var expand []string + // Use matchPackagesInFS to avoid printing + // warnings. They will be printed by the + // eventual call to importPaths instead. + if build.IsLocalImport(a) { + expand = matchPackagesInFS(a) + } else { + expand = matchPackages(a) + } + if len(expand) > 0 { + out = append(out, expand...) + continue + } + } + out = append(out, a) + } + return out +} + +// downloadCache records the import paths we have already +// considered during the download, to avoid duplicate work when +// there is more than one dependency sequence leading to +// a particular package. +var downloadCache = map[string]bool{} + +// downloadRootCache records the version control repository +// root directories we have already considered during the download. +// For example, all the packages in the code.google.com/p/codesearch repo +// share the same root (the directory for that path), and we only need +// to run the hg commands to consider each repository once. +var downloadRootCache = map[string]bool{} + +// download runs the download half of the get command +// for the package named by the argument. +func download(arg string, parent *Package, stk *importStack, mode int) { + load := func(path string, mode int) *Package { + if parent == nil { + return loadPackage(path, stk) + } + return loadImport(path, parent.Dir, parent, stk, nil, mode) + } + + p := load(arg, mode) + if p.Error != nil && p.Error.hard { + errorf("%s", p.Error) + return + } + + // loadPackage inferred the canonical ImportPath from arg. + // Use that in the following to prevent hysteresis effects + // in e.g. downloadCache and packageCache. + // This allows invocations such as: + // mkdir -p $GOPATH/src/github.com/user + // cd $GOPATH/src/github.com/user + // go get ./foo + // see: golang.org/issue/9767 + arg = p.ImportPath + + // There's nothing to do if this is a package in the standard library. + if p.Standard { + return + } + + // Only process each package once. + // (Unless we're fetching test dependencies for this package, + // in which case we want to process it again.) + if downloadCache[arg] && mode&getTestDeps == 0 { + return + } + downloadCache[arg] = true + + pkgs := []*Package{p} + wildcardOkay := len(*stk) == 0 + isWildcard := false + + // Download if the package is missing, or update if we're using -u. + if p.Dir == "" || *getU { + // The actual download. + stk.push(arg) + err := downloadPackage(p) + if err != nil { + errorf("%s", &PackageError{ImportStack: stk.copy(), Err: err.Error()}) + stk.pop() + return + } + + // Warn that code.google.com is shutting down. We + // issue the warning here because this is where we + // have the import stack. + if strings.HasPrefix(p.ImportPath, "code.google.com") { + fmt.Fprintf(os.Stderr, "warning: code.google.com is shutting down; import path %v will stop working\n", p.ImportPath) + if len(*stk) > 1 { + fmt.Fprintf(os.Stderr, "warning: package %v\n", strings.Join(*stk, "\n\timports ")) + } + } + stk.pop() + + args := []string{arg} + // If the argument has a wildcard in it, re-evaluate the wildcard. + // We delay this until after reloadPackage so that the old entry + // for p has been replaced in the package cache. + if wildcardOkay && strings.Contains(arg, "...") { + if build.IsLocalImport(arg) { + args = matchPackagesInFS(arg) + } else { + args = matchPackages(arg) + } + isWildcard = true + } + + // Clear all relevant package cache entries before + // doing any new loads. + for _, arg := range args { + p := packageCache[arg] + if p != nil { + delete(packageCache, p.Dir) + delete(packageCache, p.ImportPath) + } + } + + pkgs = pkgs[:0] + for _, arg := range args { + // Note: load calls loadPackage or loadImport, + // which push arg onto stk already. + // Do not push here too, or else stk will say arg imports arg. + p := load(arg, mode) + if p.Error != nil { + errorf("%s", p.Error) + continue + } + pkgs = append(pkgs, p) + } + } + + // Process package, which might now be multiple packages + // due to wildcard expansion. + for _, p := range pkgs { + if *getFix { + run(buildToolExec, stringList(tool("fix"), relPaths(p.allgofiles))) + + // The imports might have changed, so reload again. + p = reloadPackage(arg, stk) + if p.Error != nil { + errorf("%s", p.Error) + return + } + } + + if isWildcard { + // Report both the real package and the + // wildcard in any error message. + stk.push(p.ImportPath) + } + + // Process dependencies, now that we know what they are. + for _, path := range p.Imports { + if path == "C" { + continue + } + // Don't get test dependencies recursively. + // Imports is already vendor-expanded. + download(path, p, stk, 0) + } + if mode&getTestDeps != 0 { + // Process test dependencies when -t is specified. + // (Don't get test dependencies for test dependencies.) + // We pass useVendor here because p.load does not + // vendor-expand TestImports and XTestImports. + // The call to loadImport inside download needs to do that. + for _, path := range p.TestImports { + if path == "C" { + continue + } + download(path, p, stk, useVendor) + } + for _, path := range p.XTestImports { + if path == "C" { + continue + } + download(path, p, stk, useVendor) + } + } + + if isWildcard { + stk.pop() + } + } +} + +// downloadPackage runs the create or download command +// to make the first copy of or update a copy of the given package. +func downloadPackage(p *Package) error { + var ( + vcs *vcsCmd + repo, rootPath string + err error + ) + + security := secure + if *getInsecure { + security = insecure + } + + if p.build.SrcRoot != "" { + // Directory exists. Look for checkout along path to src. + vcs, rootPath, err = vcsForDir(p) + if err != nil { + return err + } + repo = "" // should be unused; make distinctive + + // Double-check where it came from. + if *getU && vcs.remoteRepo != nil { + dir := filepath.Join(p.build.SrcRoot, rootPath) + remote, err := vcs.remoteRepo(vcs, dir) + if err != nil { + return err + } + repo = remote + if !*getF { + if rr, err := repoRootForImportPath(p.ImportPath, security); err == nil { + repo := rr.repo + if rr.vcs.resolveRepo != nil { + resolved, err := rr.vcs.resolveRepo(rr.vcs, dir, repo) + if err == nil { + repo = resolved + } + } + if remote != repo && p.ImportComment != "" { + return fmt.Errorf("%s is a custom import path for %s, but %s is checked out from %s", rr.root, repo, dir, remote) + } + } + } + } + } else { + // Analyze the import path to determine the version control system, + // repository, and the import path for the root of the repository. + rr, err := repoRootForImportPath(p.ImportPath, security) + if err != nil { + return err + } + vcs, repo, rootPath = rr.vcs, rr.repo, rr.root + } + if !vcs.isSecure(repo) && !*getInsecure { + return fmt.Errorf("cannot download, %v uses insecure protocol", repo) + } + + if p.build.SrcRoot == "" { + // Package not found. Put in first directory of $GOPATH. + list := filepath.SplitList(buildContext.GOPATH) + if len(list) == 0 { + return fmt.Errorf("cannot download, $GOPATH not set. For more details see: go help gopath") + } + // Guard against people setting GOPATH=$GOROOT. + if list[0] == goroot { + return fmt.Errorf("cannot download, $GOPATH must not be set to $GOROOT. For more details see: go help gopath") + } + p.build.SrcRoot = filepath.Join(list[0], "src") + p.build.PkgRoot = filepath.Join(list[0], "pkg") + } + root := filepath.Join(p.build.SrcRoot, rootPath) + // If we've considered this repository already, don't do it again. + if downloadRootCache[root] { + return nil + } + downloadRootCache[root] = true + + if buildV { + fmt.Fprintf(os.Stderr, "%s (download)\n", rootPath) + } + + // Check that this is an appropriate place for the repo to be checked out. + // The target directory must either not exist or have a repo checked out already. + meta := filepath.Join(root, "."+vcs.cmd) + st, err := os.Stat(meta) + if err == nil && !st.IsDir() { + return fmt.Errorf("%s exists but is not a directory", meta) + } + if err != nil { + // Metadata directory does not exist. Prepare to checkout new copy. + // Some version control tools require the target directory not to exist. + // We require that too, just to avoid stepping on existing work. + if _, err := os.Stat(root); err == nil { + return fmt.Errorf("%s exists but %s does not - stale checkout?", root, meta) + } + // Some version control tools require the parent of the target to exist. + parent, _ := filepath.Split(root) + if err = os.MkdirAll(parent, 0777); err != nil { + return err + } + if err = vcs.create(root, repo); err != nil { + return err + } + } else { + // Metadata directory does exist; download incremental updates. + if err = vcs.download(root); err != nil { + return err + } + } + + if buildN { + // Do not show tag sync in -n; it's noise more than anything, + // and since we're not running commands, no tag will be found. + // But avoid printing nothing. + fmt.Fprintf(os.Stderr, "# cd %s; %s sync/update\n", root, vcs.cmd) + return nil + } + + // Select and sync to appropriate version of the repository. + tags, err := vcs.tags(root) + if err != nil { + return err + } + vers := runtime.Version() + if i := strings.Index(vers, " "); i >= 0 { + vers = vers[:i] + } + if err := vcs.tagSync(root, selectTag(vers, tags)); err != nil { + return err + } + + return nil +} + +// goTag matches go release tags such as go1 and go1.2.3. +// The numbers involved must be small (at most 4 digits), +// have no unnecessary leading zeros, and the version cannot +// end in .0 - it is go1, not go1.0 or go1.0.0. +var goTag = regexp.MustCompile( + `^go((0|[1-9][0-9]{0,3})\.)*([1-9][0-9]{0,3})$`, +) + +// selectTag returns the closest matching tag for a given version. +// Closest means the latest one that is not after the current release. +// Version "goX" (or "goX.Y" or "goX.Y.Z") matches tags of the same form. +// Version "release.rN" matches tags of the form "go.rN" (N being a floating-point number). +// Version "weekly.YYYY-MM-DD" matches tags like "go.weekly.YYYY-MM-DD". +// +// NOTE(rsc): Eventually we will need to decide on some logic here. +// For now, there is only "go1". This matches the docs in go help get. +func selectTag(goVersion string, tags []string) (match string) { + for _, t := range tags { + if t == "go1" { + return "go1" + } + } + return "" + + /* + if goTag.MatchString(goVersion) { + v := goVersion + for _, t := range tags { + if !goTag.MatchString(t) { + continue + } + if cmpGoVersion(match, t) < 0 && cmpGoVersion(t, v) <= 0 { + match = t + } + } + } + + return match + */ +} + +// cmpGoVersion returns -1, 0, +1 reporting whether +// x < y, x == y, or x > y. +func cmpGoVersion(x, y string) int { + // Malformed strings compare less than well-formed strings. + if !goTag.MatchString(x) { + return -1 + } + if !goTag.MatchString(y) { + return +1 + } + + // Compare numbers in sequence. + xx := strings.Split(x[len("go"):], ".") + yy := strings.Split(y[len("go"):], ".") + + for i := 0; i < len(xx) && i < len(yy); i++ { + // The Atoi are guaranteed to succeed + // because the versions match goTag. + xi, _ := strconv.Atoi(xx[i]) + yi, _ := strconv.Atoi(yy[i]) + if xi < yi { + return -1 + } else if xi > yi { + return +1 + } + } + + if len(xx) < len(yy) { + return -1 + } + if len(xx) > len(yy) { + return +1 + } + return 0 +} diff --git a/src/cmd/go/go11.go b/src/cmd/go/go11.go new file mode 100644 index 0000000000000000000000000000000000000000..8a434dfed1ca7f6c3601e9056c8b82b67e8d86b4 --- /dev/null +++ b/src/cmd/go/go11.go @@ -0,0 +1,10 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build go1.1 + +package main + +// Test that go1.1 tag above is included in builds. main.go refers to this definition. +const go11tag = true diff --git a/src/cmd/go/go_test.go b/src/cmd/go/go_test.go new file mode 100644 index 0000000000000000000000000000000000000000..77b2628982bb81675d07d2705017aa1dd7c1efe4 --- /dev/null +++ b/src/cmd/go/go_test.go @@ -0,0 +1,2389 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main_test + +import ( + "bytes" + "flag" + "fmt" + "go/build" + "go/format" + "internal/testenv" + "io" + "io/ioutil" + "os" + "os/exec" + "path/filepath" + "regexp" + "runtime" + "strconv" + "strings" + "testing" + "time" +) + +var ( + canRun = true // whether we can run go or ./testgo + canRace = false // whether we can run the race detector + canCgo = false // whether we can use cgo + + exeSuffix string // ".exe" on Windows + + builder = testenv.Builder() + skipExternalBuilder = false // skip external tests on this builder +) + +func init() { + switch runtime.GOOS { + case "android", "nacl": + canRun = false + case "darwin": + switch runtime.GOARCH { + case "arm", "arm64": + canRun = false + } + } + + if strings.HasPrefix(builder+"-", "freebsd-arm-") { + skipExternalBuilder = true + canRun = false + } + + switch runtime.GOOS { + case "windows": + exeSuffix = ".exe" + } +} + +// The TestMain function creates a go command for testing purposes and +// deletes it after the tests have been run. +func TestMain(m *testing.M) { + flag.Parse() + + if canRun { + out, err := exec.Command("go", "build", "-tags", "testgo", "-o", "testgo"+exeSuffix).CombinedOutput() + if err != nil { + fmt.Fprintf(os.Stderr, "building testgo failed: %v\n%s", err, out) + os.Exit(2) + } + + if out, err := exec.Command("./testgo"+exeSuffix, "env", "CGO_ENABLED").Output(); err != nil { + fmt.Fprintf(os.Stderr, "running testgo failed: %v\n", err) + canRun = false + } else { + canCgo, err = strconv.ParseBool(strings.TrimSpace(string(out))) + if err != nil { + fmt.Fprintf(os.Stderr, "can't parse go env CGO_ENABLED output: %v\n", strings.TrimSpace(string(out))) + } + } + + switch runtime.GOOS { + case "linux", "darwin", "freebsd", "windows": + canRace = canCgo && runtime.GOARCH == "amd64" + } + + measureTick("./testgo" + exeSuffix) + } + + // Don't let these environment variables confuse the test. + os.Unsetenv("GOBIN") + os.Unsetenv("GOPATH") + + r := m.Run() + + if canRun { + os.Remove("testgo" + exeSuffix) + } + + os.Exit(r) +} + +// The length of an mtime tick on this system. This is an estimate of +// how long we need to sleep to ensure that the mtime of two files is +// different. +var mtimeTick time.Duration + +// measureTick sets mtimeTick by looking at the rounding of the mtime +// of a file. +func measureTick(path string) { + st, err := os.Stat(path) + if err != nil { + // Default to one second, the most conservative value. + mtimeTick = time.Second + return + } + mtime := st.ModTime() + t := time.Microsecond + for mtime.Round(t).Equal(mtime) && t < time.Second { + t *= 10 + } + mtimeTick = t +} + +// Manage a single run of the testgo binary. +type testgoData struct { + t *testing.T + temps []string + wd string + env []string + tempdir string + ran bool + inParallel bool + stdout, stderr bytes.Buffer +} + +// testgo sets up for a test that runs testgo. +func testgo(t *testing.T) *testgoData { + testenv.MustHaveGoBuild(t) + + if skipExternalBuilder { + t.Skip("skipping external tests on %s builder", builder) + } + + return &testgoData{t: t} +} + +// must gives a fatal error if err is not nil. +func (tg *testgoData) must(err error) { + if err != nil { + tg.t.Fatal(err) + } +} + +// check gives a test non-fatal error if err is not nil. +func (tg *testgoData) check(err error) { + if err != nil { + tg.t.Error(err) + } +} + +// parallel runs the test in parallel by calling t.Parallel. +func (tg *testgoData) parallel() { + if tg.ran { + tg.t.Fatal("internal testsuite error: call to parallel after run") + } + if tg.wd != "" { + tg.t.Fatal("internal testsuite error: call to parallel after cd") + } + for _, e := range tg.env { + if strings.HasPrefix(e, "GOROOT=") || strings.HasPrefix(e, "GOPATH=") || strings.HasPrefix(e, "GOBIN=") { + val := e[strings.Index(e, "=")+1:] + if strings.HasPrefix(val, "testdata") || strings.HasPrefix(val, "./testdata") { + tg.t.Fatalf("internal testsuite error: call to parallel with testdata in environment (%s)", e) + } + } + } + tg.inParallel = true + tg.t.Parallel() +} + +// pwd returns the current directory. +func (tg *testgoData) pwd() string { + wd, err := os.Getwd() + if err != nil { + tg.t.Fatalf("could not get working directory: %v", err) + } + return wd +} + +// cd changes the current directory to the named directory. Note that +// using this means that the test must not be run in parallel with any +// other tests. +func (tg *testgoData) cd(dir string) { + if tg.inParallel { + tg.t.Fatal("internal testsuite error: changing directory when running in parallel") + } + if tg.wd == "" { + tg.wd = tg.pwd() + } + abs, err := filepath.Abs(dir) + tg.must(os.Chdir(dir)) + if err == nil { + tg.setenv("PWD", abs) + } +} + +// sleep sleeps for one tick, where a tick is a conservative estimate +// of how long it takes for a file modification to get a different +// mtime. +func (tg *testgoData) sleep() { + time.Sleep(mtimeTick) +} + +// setenv sets an environment variable to use when running the test go +// command. +func (tg *testgoData) setenv(name, val string) { + if tg.inParallel && (name == "GOROOT" || name == "GOPATH" || name == "GOBIN") && (strings.HasPrefix(val, "testdata") || strings.HasPrefix(val, "./testdata")) { + tg.t.Fatalf("internal testsuite error: call to setenv with testdata (%s=%s) after parallel", name, val) + } + tg.unsetenv(name) + tg.env = append(tg.env, name+"="+val) +} + +// unsetenv removes an environment variable. +func (tg *testgoData) unsetenv(name string) { + if tg.env == nil { + tg.env = append([]string(nil), os.Environ()...) + } + for i, v := range tg.env { + if strings.HasPrefix(v, name+"=") { + tg.env = append(tg.env[:i], tg.env[i+1:]...) + break + } + } +} + +// doRun runs the test go command, recording stdout and stderr and +// returning exit status. +func (tg *testgoData) doRun(args []string) error { + if !canRun { + panic("testgoData.doRun called but canRun false") + } + if tg.inParallel { + for _, arg := range args { + if strings.HasPrefix(arg, "testdata") || strings.HasPrefix(arg, "./testdata") { + tg.t.Fatal("internal testsuite error: parallel run using testdata") + } + } + } + tg.t.Logf("running testgo %v", args) + var prog string + if tg.wd == "" { + prog = "./testgo" + exeSuffix + } else { + prog = filepath.Join(tg.wd, "testgo"+exeSuffix) + } + cmd := exec.Command(prog, args...) + tg.stdout.Reset() + tg.stderr.Reset() + cmd.Stdout = &tg.stdout + cmd.Stderr = &tg.stderr + cmd.Env = tg.env + status := cmd.Run() + if tg.stdout.Len() > 0 { + tg.t.Log("standard output:") + tg.t.Log(tg.stdout.String()) + } + if tg.stderr.Len() > 0 { + tg.t.Log("standard error:") + tg.t.Log(tg.stderr.String()) + } + tg.ran = true + return status +} + +// run runs the test go command, and expects it to succeed. +func (tg *testgoData) run(args ...string) { + if status := tg.doRun(args); status != nil { + tg.t.Logf("go %v failed unexpectedly: %v", args, status) + tg.t.FailNow() + } +} + +// runFail runs the test go command, and expects it to fail. +func (tg *testgoData) runFail(args ...string) { + if status := tg.doRun(args); status == nil { + tg.t.Fatal("testgo succeeded unexpectedly") + } else { + tg.t.Log("testgo failed as expected:", status) + } +} + +// runGit runs a git command, and expects it to succeed. +func (tg *testgoData) runGit(dir string, args ...string) { + cmd := exec.Command("git", args...) + tg.stdout.Reset() + tg.stderr.Reset() + cmd.Stdout = &tg.stdout + cmd.Stderr = &tg.stderr + cmd.Dir = dir + cmd.Env = tg.env + status := cmd.Run() + if tg.stdout.Len() > 0 { + tg.t.Log("git standard output:") + tg.t.Log(tg.stdout.String()) + } + if tg.stderr.Len() > 0 { + tg.t.Log("git standard error:") + tg.t.Log(tg.stderr.String()) + } + if status != nil { + tg.t.Logf("git %v failed unexpectedly: %v", args, status) + tg.t.FailNow() + } +} + +// getStdout returns standard output of the testgo run as a string. +func (tg *testgoData) getStdout() string { + if !tg.ran { + tg.t.Fatal("internal testsuite error: stdout called before run") + } + return tg.stdout.String() +} + +// getStderr returns standard error of the testgo run as a string. +func (tg *testgoData) getStderr() string { + if !tg.ran { + tg.t.Fatal("internal testsuite error: stdout called before run") + } + return tg.stderr.String() +} + +// doGrepMatch looks for a regular expression in a buffer, and returns +// whether it is found. The regular expression is matched against +// each line separately, as with the grep command. +func (tg *testgoData) doGrepMatch(match string, b *bytes.Buffer) bool { + if !tg.ran { + tg.t.Fatal("internal testsuite error: grep called before run") + } + re := regexp.MustCompile(match) + for _, ln := range bytes.Split(b.Bytes(), []byte{'\n'}) { + if re.Match(ln) { + return true + } + } + return false +} + +// doGrep looks for a regular expression in a buffer and fails if it +// is not found. The name argument is the name of the output we are +// searching, "output" or "error". The msg argument is logged on +// failure. +func (tg *testgoData) doGrep(match string, b *bytes.Buffer, name, msg string) { + if !tg.doGrepMatch(match, b) { + tg.t.Log(msg) + tg.t.Logf("pattern %v not found in standard %s", match, name) + tg.t.FailNow() + } +} + +// grepStdout looks for a regular expression in the test run's +// standard output and fails, logging msg, if it is not found. +func (tg *testgoData) grepStdout(match, msg string) { + tg.doGrep(match, &tg.stdout, "output", msg) +} + +// grepStderr looks for a regular expression in the test run's +// standard error and fails, logging msg, if it is not found. +func (tg *testgoData) grepStderr(match, msg string) { + tg.doGrep(match, &tg.stderr, "error", msg) +} + +// grepBoth looks for a regular expression in the test run's standard +// output or stand error and fails, logging msg, if it is not found. +func (tg *testgoData) grepBoth(match, msg string) { + if !tg.doGrepMatch(match, &tg.stdout) && !tg.doGrepMatch(match, &tg.stderr) { + tg.t.Log(msg) + tg.t.Logf("pattern %v not found in standard output or standard error", match) + tg.t.FailNow() + } +} + +// doGrepNot looks for a regular expression in a buffer and fails if +// it is found. The name and msg arguments are as for doGrep. +func (tg *testgoData) doGrepNot(match string, b *bytes.Buffer, name, msg string) { + if tg.doGrepMatch(match, b) { + tg.t.Log(msg) + tg.t.Logf("pattern %v found unexpectedly in standard %s", match, name) + tg.t.FailNow() + } +} + +// grepStdoutNot looks for a regular expression in the test run's +// standard output and fails, logging msg, if it is found. +func (tg *testgoData) grepStdoutNot(match, msg string) { + tg.doGrepNot(match, &tg.stdout, "output", msg) +} + +// grepStderrNot looks for a regular expression in the test run's +// standard error and fails, logging msg, if it is found. +func (tg *testgoData) grepStderrNot(match, msg string) { + tg.doGrepNot(match, &tg.stderr, "error", msg) +} + +// grepBothNot looks for a regular expression in the test run's +// standard output or stand error and fails, logging msg, if it is +// found. +func (tg *testgoData) grepBothNot(match, msg string) { + if tg.doGrepMatch(match, &tg.stdout) || tg.doGrepMatch(match, &tg.stderr) { + tg.t.Log(msg) + tg.t.Fatalf("pattern %v found unexpectedly in standard output or standard error", match) + } +} + +// doGrepCount counts the number of times a regexp is seen in a buffer. +func (tg *testgoData) doGrepCount(match string, b *bytes.Buffer) int { + if !tg.ran { + tg.t.Fatal("internal testsuite error: doGrepCount called before run") + } + re := regexp.MustCompile(match) + c := 0 + for _, ln := range bytes.Split(b.Bytes(), []byte{'\n'}) { + if re.Match(ln) { + c++ + } + } + return c +} + +// grepCountStdout returns the number of times a regexp is seen in +// standard output. +func (tg *testgoData) grepCountStdout(match string) int { + return tg.doGrepCount(match, &tg.stdout) +} + +// grepCountStderr returns the number of times a regexp is seen in +// standard error. +func (tg *testgoData) grepCountStderr(match string) int { + return tg.doGrepCount(match, &tg.stderr) +} + +// grepCountBoth returns the number of times a regexp is seen in both +// standard output and standard error. +func (tg *testgoData) grepCountBoth(match string) int { + return tg.doGrepCount(match, &tg.stdout) + tg.doGrepCount(match, &tg.stderr) +} + +// creatingTemp records that the test plans to create a temporary file +// or directory. If the file or directory exists already, it will be +// removed. When the test completes, the file or directory will be +// removed if it exists. +func (tg *testgoData) creatingTemp(path string) { + if filepath.IsAbs(path) && !strings.HasPrefix(path, tg.tempdir) { + tg.t.Fatal("internal testsuite error: creatingTemp(%q) with absolute path not in temporary directory", path) + } + // If we have changed the working directory, make sure we have + // an absolute path, because we are going to change directory + // back before we remove the temporary. + if tg.wd != "" && !filepath.IsAbs(path) { + path = filepath.Join(tg.pwd(), path) + } + tg.must(os.RemoveAll(path)) + tg.temps = append(tg.temps, path) +} + +// makeTempdir makes a temporary directory for a run of testgo. If +// the temporary directory was already created, this does nothing. +func (tg *testgoData) makeTempdir() { + if tg.tempdir == "" { + var err error + tg.tempdir, err = ioutil.TempDir("", "gotest") + tg.must(err) + } +} + +// tempFile adds a temporary file for a run of testgo. +func (tg *testgoData) tempFile(path, contents string) { + tg.makeTempdir() + tg.must(os.MkdirAll(filepath.Join(tg.tempdir, filepath.Dir(path)), 0755)) + bytes := []byte(contents) + if strings.HasSuffix(path, ".go") { + formatted, err := format.Source(bytes) + if err == nil { + bytes = formatted + } + } + tg.must(ioutil.WriteFile(filepath.Join(tg.tempdir, path), bytes, 0644)) +} + +// tempDir adds a temporary directory for a run of testgo. +func (tg *testgoData) tempDir(path string) { + tg.makeTempdir() + if err := os.MkdirAll(filepath.Join(tg.tempdir, path), 0755); err != nil && !os.IsExist(err) { + tg.t.Fatal(err) + } +} + +// path returns the absolute pathname to file with the temporary +// directory. +func (tg *testgoData) path(name string) string { + if tg.tempdir == "" { + tg.t.Fatalf("internal testsuite error: path(%q) with no tempdir", name) + } + if name == "." { + return tg.tempdir + } + return filepath.Join(tg.tempdir, name) +} + +// mustNotExist fails if path exists. +func (tg *testgoData) mustNotExist(path string) { + if _, err := os.Stat(path); err == nil || !os.IsNotExist(err) { + tg.t.Fatalf("%s exists but should not (%v)", path, err) + } +} + +// wantExecutable fails with msg if path is not executable. +func (tg *testgoData) wantExecutable(path, msg string) { + if st, err := os.Stat(path); err != nil { + if !os.IsNotExist(err) { + tg.t.Log(err) + } + tg.t.Fatal(msg) + } else { + if runtime.GOOS != "windows" && st.Mode()&0111 == 0 { + tg.t.Fatalf("binary %s exists but is not executable", path) + } + } +} + +// wantArchive fails if path is not an archive. +func (tg *testgoData) wantArchive(path string) { + f, err := os.Open(path) + if err != nil { + tg.t.Fatal(err) + } + buf := make([]byte, 100) + io.ReadFull(f, buf) + f.Close() + if !bytes.HasPrefix(buf, []byte("!\n")) { + tg.t.Fatalf("file %s exists but is not an archive", path) + } +} + +// isStale returns whether pkg is stale. +func (tg *testgoData) isStale(pkg string) bool { + tg.run("list", "-f", "{{.Stale}}", pkg) + switch v := strings.TrimSpace(tg.getStdout()); v { + case "true": + return true + case "false": + return false + default: + tg.t.Fatalf("unexpected output checking staleness of package %v: %v", pkg, v) + panic("unreachable") + } +} + +// wantStale fails with msg if pkg is not stale. +func (tg *testgoData) wantStale(pkg, msg string) { + if !tg.isStale(pkg) { + tg.t.Fatal(msg) + } +} + +// wantNotStale fails with msg if pkg is stale. +func (tg *testgoData) wantNotStale(pkg, msg string) { + if tg.isStale(pkg) { + tg.t.Fatal(msg) + } +} + +// cleanup cleans up a test that runs testgo. +func (tg *testgoData) cleanup() { + if tg.wd != "" { + if err := os.Chdir(tg.wd); err != nil { + // We are unlikely to be able to continue. + fmt.Fprintln(os.Stderr, "could not restore working directory, crashing:", err) + os.Exit(2) + } + } + for _, path := range tg.temps { + tg.check(os.RemoveAll(path)) + } + if tg.tempdir != "" { + tg.check(os.RemoveAll(tg.tempdir)) + } +} + +// resetReadOnlyFlagAll resets windows read-only flag +// set on path and any children it contains. +// The flag is set by git and has to be removed. +// os.Remove refuses to remove files with read-only flag set. +func (tg *testgoData) resetReadOnlyFlagAll(path string) { + fi, err := os.Stat(path) + if err != nil { + tg.t.Fatalf("resetReadOnlyFlagAll(%q) failed: %v", path, err) + } + if !fi.IsDir() { + err := os.Chmod(path, 0666) + if err != nil { + tg.t.Fatalf("resetReadOnlyFlagAll(%q) failed: %v", path, err) + } + } + fd, err := os.Open(path) + if err != nil { + tg.t.Fatalf("resetReadOnlyFlagAll(%q) failed: %v", path, err) + } + defer fd.Close() + names, _ := fd.Readdirnames(-1) + for _, name := range names { + tg.resetReadOnlyFlagAll(path + string(filepath.Separator) + name) + } +} + +// failSSH puts an ssh executable in the PATH that always fails. +// This is to stub out uses of ssh by go get. +func (tg *testgoData) failSSH() { + wd, err := os.Getwd() + if err != nil { + tg.t.Fatal(err) + } + fail := filepath.Join(wd, "testdata/failssh") + tg.setenv("PATH", fmt.Sprintf("%v%c%v", fail, filepath.ListSeparator, os.Getenv("PATH"))) +} + +func TestFileLineInErrorMessages(t *testing.T) { + tg := testgo(t) + defer tg.cleanup() + tg.parallel() + tg.tempFile("err.go", `package main; import "bar"`) + path := tg.path("err.go") + tg.runFail("run", path) + shortPath := path + if rel, err := filepath.Rel(tg.pwd(), path); err == nil && len(rel) < len(path) { + shortPath = rel + } + tg.grepStderr("^"+regexp.QuoteMeta(shortPath)+":", "missing file:line in error message") +} + +func TestProgramNameInCrashMessages(t *testing.T) { + tg := testgo(t) + defer tg.cleanup() + tg.parallel() + tg.tempFile("triv.go", `package main; func main() {}`) + tg.runFail("build", "-ldflags", "-crash_for_testing", tg.path("triv.go")) + tg.grepStderr(`[/\\]tool[/\\].*[/\\]link`, "missing linker name in error message") +} + +func TestBrokenTestsWithoutTestFunctionsAllFail(t *testing.T) { + tg := testgo(t) + defer tg.cleanup() + tg.runFail("test", "./testdata/src/badtest/...") + tg.grepBothNot("^ok", "test passed unexpectedly") + tg.grepBoth("FAIL.*badtest/badexec", "test did not run everything") + tg.grepBoth("FAIL.*badtest/badsyntax", "test did not run everything") + tg.grepBoth("FAIL.*badtest/badvar", "test did not run everything") +} + +func TestGoBuildDashAInDevBranch(t *testing.T) { + if testing.Short() { + t.Skip("don't rebuild the standard library in short mode") + } + + tg := testgo(t) + defer tg.cleanup() + tg.run("install", "math") // should be up to date already but just in case + tg.setenv("TESTGO_IS_GO_RELEASE", "0") + tg.run("build", "-v", "-a", "math") + tg.grepStderr("runtime", "testgo build -a math in dev branch DID NOT build runtime, but should have") +} + +func TestGoBuilDashAInReleaseBranch(t *testing.T) { + if testing.Short() { + t.Skip("don't rebuild the standard library in short mode") + } + + tg := testgo(t) + defer tg.cleanup() + tg.run("install", "math") // should be up to date already but just in case + tg.setenv("TESTGO_IS_GO_RELEASE", "1") + tg.run("build", "-v", "-a", "math") + tg.grepStderr("runtime", "testgo build -a math in dev branch did not build runtime, but should have") +} + +func TestGoInstallCleansUpAfterGoBuild(t *testing.T) { + tg := testgo(t) + defer tg.cleanup() + tg.tempFile("src/mycmd/main.go", `package main; func main(){}`) + tg.setenv("GOPATH", tg.path(".")) + tg.cd(tg.path("src/mycmd")) + + doesNotExist := func(file, msg string) { + if _, err := os.Stat(file); err == nil { + t.Fatal(msg) + } else if !os.IsNotExist(err) { + t.Fatal(msg, "error:", err) + } + } + + tg.run("build") + tg.wantExecutable("mycmd"+exeSuffix, "testgo build did not write command binary") + tg.run("install") + doesNotExist("mycmd"+exeSuffix, "testgo install did not remove command binary") + tg.run("build") + tg.wantExecutable("mycmd"+exeSuffix, "testgo build did not write command binary (second time)") + // Running install with arguments does not remove the target, + // even in the same directory. + tg.run("install", "mycmd") + tg.wantExecutable("mycmd"+exeSuffix, "testgo install mycmd removed command binary when run in mycmd") + tg.run("build") + tg.wantExecutable("mycmd"+exeSuffix, "testgo build did not write command binary (third time)") + // And especially not outside the directory. + tg.cd(tg.path(".")) + if data, err := ioutil.ReadFile("src/mycmd/mycmd" + exeSuffix); err != nil { + t.Fatal("could not read file:", err) + } else { + if err := ioutil.WriteFile("mycmd"+exeSuffix, data, 0555); err != nil { + t.Fatal("could not write file:", err) + } + } + tg.run("install", "mycmd") + tg.wantExecutable("src/mycmd/mycmd"+exeSuffix, "testgo install mycmd removed command binary from its source dir when run outside mycmd") + tg.wantExecutable("mycmd"+exeSuffix, "testgo install mycmd removed command binary from current dir when run outside mycmd") +} + +func TestGoInstallRebuildsStalePackagesInOtherGOPATH(t *testing.T) { + tg := testgo(t) + defer tg.cleanup() + tg.parallel() + tg.tempFile("d1/src/p1/p1.go", `package p1 + import "p2" + func F() { p2.F() }`) + tg.tempFile("d2/src/p2/p2.go", `package p2 + func F() {}`) + sep := string(filepath.ListSeparator) + tg.setenv("GOPATH", tg.path("d1")+sep+tg.path("d2")) + tg.run("install", "p1") + tg.wantNotStale("p1", "./testgo list mypkg claims p1 is stale, incorrectly") + tg.wantNotStale("p2", "./testgo list mypkg claims p2 is stale, incorrectly") + tg.sleep() + if f, err := os.OpenFile(tg.path("d2/src/p2/p2.go"), os.O_WRONLY|os.O_APPEND, 0); err != nil { + t.Fatal(err) + } else if _, err = f.WriteString(`func G() {}`); err != nil { + t.Fatal(err) + } else { + tg.must(f.Close()) + } + tg.wantStale("p2", "./testgo list mypkg claims p2 is NOT stale, incorrectly") + tg.wantStale("p1", "./testgo list mypkg claims p1 is NOT stale, incorrectly") + + tg.run("install", "p1") + tg.wantNotStale("p2", "./testgo list mypkg claims p2 is stale after reinstall, incorrectly") + tg.wantNotStale("p1", "./testgo list mypkg claims p1 is stale after reinstall, incorrectly") +} + +func TestGoInstallDetectsRemovedFiles(t *testing.T) { + tg := testgo(t) + defer tg.cleanup() + tg.parallel() + tg.tempFile("src/mypkg/x.go", `package mypkg`) + tg.tempFile("src/mypkg/y.go", `package mypkg`) + tg.tempFile("src/mypkg/z.go", `// +build missingtag + + package mypkg`) + tg.setenv("GOPATH", tg.path(".")) + tg.run("install", "mypkg") + tg.wantNotStale("mypkg", "./testgo list mypkg claims mypkg is stale, incorrectly") + // z.go was not part of the build; removing it is okay. + tg.must(os.Remove(tg.path("src/mypkg/z.go"))) + tg.wantNotStale("mypkg", "./testgo list mypkg claims mypkg is stale after removing z.go; should not be stale") + // y.go was part of the package; removing it should be detected. + tg.must(os.Remove(tg.path("src/mypkg/y.go"))) + tg.wantStale("mypkg", "./testgo list mypkg claims mypkg is NOT stale after removing y.go; should be stale") +} + +func TestGoInstallErrorOnCrossCompileToBin(t *testing.T) { + if testing.Short() { + t.Skip("don't install into GOROOT in short mode") + } + + tg := testgo(t) + defer tg.cleanup() + tg.tempFile("src/mycmd/x.go", `package main + func main() {}`) + tg.setenv("GOPATH", tg.path(".")) + tg.cd(tg.path("src/mycmd")) + + tg.run("build", "mycmd") + + goarch := "386" + if runtime.GOARCH == "386" { + goarch = "amd64" + } + tg.setenv("GOOS", "linux") + tg.setenv("GOARCH", goarch) + tg.run("install", "mycmd") + tg.setenv("GOBIN", tg.path(".")) + tg.runFail("install", "mycmd") + tg.run("install", "cmd/pack") +} + +func TestGoInstallDetectsRemovedFilesInPackageMain(t *testing.T) { + tg := testgo(t) + defer tg.cleanup() + tg.parallel() + tg.tempFile("src/mycmd/x.go", `package main + func main() {}`) + tg.tempFile("src/mycmd/y.go", `package main`) + tg.tempFile("src/mycmd/z.go", `// +build missingtag + + package main`) + tg.setenv("GOPATH", tg.path(".")) + tg.run("install", "mycmd") + tg.wantNotStale("mycmd", "./testgo list mypkg claims mycmd is stale, incorrectly") + // z.go was not part of the build; removing it is okay. + tg.must(os.Remove(tg.path("src/mycmd/z.go"))) + tg.wantNotStale("mycmd", "./testgo list mycmd claims mycmd is stale after removing z.go; should not be stale") + // y.go was part of the package; removing it should be detected. + tg.must(os.Remove(tg.path("src/mycmd/y.go"))) + tg.wantStale("mycmd", "./testgo list mycmd claims mycmd is NOT stale after removing y.go; should be stale") +} + +func testLocalRun(tg *testgoData, exepath, local, match string) { + out, err := exec.Command(exepath).Output() + if err != nil { + tg.t.Fatalf("error running %v: %v", exepath, err) + } + if !regexp.MustCompile(match).Match(out) { + tg.t.Log(string(out)) + tg.t.Errorf("testdata/%s/easy.go did not generate expected output", local) + } +} + +func testLocalEasy(tg *testgoData, local string) { + exepath := "./easy" + exeSuffix + tg.creatingTemp(exepath) + tg.run("build", "-o", exepath, filepath.Join("testdata", local, "easy.go")) + testLocalRun(tg, exepath, local, `(?m)^easysub\.Hello`) +} + +func testLocalEasySub(tg *testgoData, local string) { + exepath := "./easysub" + exeSuffix + tg.creatingTemp(exepath) + tg.run("build", "-o", exepath, filepath.Join("testdata", local, "easysub", "main.go")) + testLocalRun(tg, exepath, local, `(?m)^easysub\.Hello`) +} + +func testLocalHard(tg *testgoData, local string) { + exepath := "./hard" + exeSuffix + tg.creatingTemp(exepath) + tg.run("build", "-o", exepath, filepath.Join("testdata", local, "hard.go")) + testLocalRun(tg, exepath, local, `(?m)^sub\.Hello`) +} + +func testLocalInstall(tg *testgoData, local string) { + tg.runFail("install", filepath.Join("testdata", local, "easy.go")) +} + +func TestLocalImportsEasy(t *testing.T) { + tg := testgo(t) + defer tg.cleanup() + testLocalEasy(tg, "local") +} + +func TestLocalImportsEasySub(t *testing.T) { + tg := testgo(t) + defer tg.cleanup() + testLocalEasySub(tg, "local") +} + +func TestLocalImportsHard(t *testing.T) { + tg := testgo(t) + defer tg.cleanup() + testLocalHard(tg, "local") +} + +func TestLocalImportsGoInstallShouldFail(t *testing.T) { + tg := testgo(t) + defer tg.cleanup() + testLocalInstall(tg, "local") +} + +const badDirName = `#$%:, &()*;<=>?\^{}` + +func copyBad(tg *testgoData) { + if runtime.GOOS == "windows" { + tg.t.Skipf("skipping test because %q is an invalid directory name", badDirName) + } + + tg.must(filepath.Walk("testdata/local", + func(path string, info os.FileInfo, err error) error { + if err != nil { + return err + } + if info.IsDir() { + return nil + } + var data []byte + data, err = ioutil.ReadFile(path) + if err != nil { + return err + } + newpath := strings.Replace(path, "local", badDirName, 1) + tg.tempFile(newpath, string(data)) + return nil + })) + tg.cd(tg.path(".")) +} + +func TestBadImportsEasy(t *testing.T) { + tg := testgo(t) + defer tg.cleanup() + copyBad(tg) + testLocalEasy(tg, badDirName) +} + +func TestBadImportsEasySub(t *testing.T) { + tg := testgo(t) + defer tg.cleanup() + copyBad(tg) + testLocalEasySub(tg, badDirName) +} + +func TestBadImportsHard(t *testing.T) { + tg := testgo(t) + defer tg.cleanup() + copyBad(tg) + testLocalHard(tg, badDirName) +} + +func TestBadImportsGoInstallShouldFail(t *testing.T) { + tg := testgo(t) + defer tg.cleanup() + copyBad(tg) + testLocalInstall(tg, badDirName) +} + +func TestInternalPackagesInGOROOTAreRespected(t *testing.T) { + tg := testgo(t) + defer tg.cleanup() + tg.runFail("build", "-v", "./testdata/testinternal") + tg.grepBoth("use of internal package not allowed", "wrong error message for testdata/testinternal") +} + +func TestInternalPackagesOutsideGOROOTAreRespected(t *testing.T) { + tg := testgo(t) + defer tg.cleanup() + tg.runFail("build", "-v", "./testdata/testinternal2") + tg.grepBoth("use of internal package not allowed", "wrote error message for testdata/testinternal2") +} + +func testMove(t *testing.T, vcs, url, base, config string) { + testenv.MustHaveExternalNetwork(t) + + tg := testgo(t) + defer tg.cleanup() + tg.parallel() + tg.tempDir("src") + tg.setenv("GOPATH", tg.path(".")) + tg.run("get", "-d", url) + tg.run("get", "-d", "-u", url) + switch vcs { + case "svn": + // SVN doesn't believe in text files so we can't just edit the config. + // Check out a different repo into the wrong place. + tg.must(os.RemoveAll(tg.path("src/code.google.com/p/rsc-svn"))) + tg.run("get", "-d", "-u", "code.google.com/p/rsc-svn2/trunk") + tg.must(os.Rename(tg.path("src/code.google.com/p/rsc-svn2"), tg.path("src/code.google.com/p/rsc-svn"))) + default: + path := tg.path(filepath.Join("src", config)) + data, err := ioutil.ReadFile(path) + tg.must(err) + data = bytes.Replace(data, []byte(base), []byte(base+"XXX"), -1) + tg.must(ioutil.WriteFile(path, data, 0644)) + } + if vcs == "git" { + // git will ask for a username and password when we + // run go get -d -f -u. An empty username and + // password will work. Prevent asking by setting + // GIT_ASKPASS. + tg.creatingTemp("sink" + exeSuffix) + tg.tempFile("src/sink/sink.go", `package main; func main() {}`) + tg.run("build", "-o", "sink"+exeSuffix, "sink") + tg.setenv("GIT_ASKPASS", filepath.Join(tg.pwd(), "sink"+exeSuffix)) + } + tg.runFail("get", "-d", "-u", url) + tg.grepStderr("is a custom import path for", "go get -d -u "+url+" failed for wrong reason") + tg.runFail("get", "-d", "-f", "-u", url) + tg.grepStderr("validating server certificate|not found", "go get -d -f -u "+url+" failed for wrong reason") +} + +func TestInternalPackageErrorsAreHandled(t *testing.T) { + tg := testgo(t) + defer tg.cleanup() + tg.run("list", "./testdata/testinternal3") +} + +func TestInternalCache(t *testing.T) { + tg := testgo(t) + defer tg.cleanup() + tg.setenv("GOPATH", filepath.Join(tg.pwd(), "testdata/testinternal4")) + tg.runFail("build", "p") + tg.grepStderr("internal", "did not fail to build p") +} + +func TestMoveGit(t *testing.T) { + testMove(t, "git", "rsc.io/pdf", "pdf", "rsc.io/pdf/.git/config") +} + +// TODO(rsc): Set up a test case on bitbucket for hg. +// func TestMoveHG(t *testing.T) { +// testMove(t, "hg", "rsc.io/x86/x86asm", "x86", "rsc.io/x86/.hg/hgrc") +// } + +// TODO(rsc): Set up a test case on SourceForge (?) for svn. +// func testMoveSVN(t *testing.T) { +// testMove(t, "svn", "code.google.com/p/rsc-svn/trunk", "-", "-") +// } + +func TestImportCommandMatch(t *testing.T) { + tg := testgo(t) + defer tg.cleanup() + tg.setenv("GOPATH", filepath.Join(tg.pwd(), "testdata/importcom")) + tg.run("build", "./testdata/importcom/works.go") +} + +func TestImportCommentMismatch(t *testing.T) { + tg := testgo(t) + defer tg.cleanup() + tg.setenv("GOPATH", filepath.Join(tg.pwd(), "testdata/importcom")) + tg.runFail("build", "./testdata/importcom/wrongplace.go") + tg.grepStderr(`wrongplace expects import "my/x"`, "go build did not mention incorrect import") +} + +func TestImportCommentSyntaxError(t *testing.T) { + tg := testgo(t) + defer tg.cleanup() + tg.setenv("GOPATH", filepath.Join(tg.pwd(), "testdata/importcom")) + tg.runFail("build", "./testdata/importcom/bad.go") + tg.grepStderr("cannot parse import comment", "go build did not mention syntax error") +} + +func TestImportCommentConflict(t *testing.T) { + tg := testgo(t) + defer tg.cleanup() + tg.setenv("GOPATH", filepath.Join(tg.pwd(), "testdata/importcom")) + tg.runFail("build", "./testdata/importcom/conflict.go") + tg.grepStderr("found import comments", "go build did not mention comment conflict") +} + +// cmd/go: custom import path checking should not apply to github.com/xxx/yyy. +func TestIssue10952(t *testing.T) { + testenv.MustHaveExternalNetwork(t) + + if _, err := exec.LookPath("git"); err != nil { + t.Skip("skipping because git binary not found") + } + + tg := testgo(t) + defer tg.cleanup() + tg.parallel() + tg.tempDir("src") + tg.setenv("GOPATH", tg.path(".")) + const importPath = "github.com/zombiezen/go-get-issue-10952" + tg.run("get", "-d", "-u", importPath) + repoDir := tg.path("src/" + importPath) + defer tg.resetReadOnlyFlagAll(repoDir) + tg.runGit(repoDir, "remote", "set-url", "origin", "https://"+importPath+".git") + tg.run("get", "-d", "-u", importPath) +} + +func TestDisallowedCSourceFiles(t *testing.T) { + tg := testgo(t) + defer tg.cleanup() + tg.setenv("GOPATH", filepath.Join(tg.pwd(), "testdata")) + tg.runFail("build", "badc") + tg.grepStderr("C source files not allowed", "go test did not say C source files not allowed") +} + +func TestErrorMessageForSyntaxErrorInTestGoFileSaysFAIL(t *testing.T) { + tg := testgo(t) + defer tg.cleanup() + tg.setenv("GOPATH", filepath.Join(tg.pwd(), "testdata")) + tg.runFail("test", "syntaxerror") + tg.grepStderr("FAIL", "go test did not say FAIL") +} + +func TestWildcardsDoNotLookInUselessDirectories(t *testing.T) { + tg := testgo(t) + defer tg.cleanup() + tg.setenv("GOPATH", filepath.Join(tg.pwd(), "testdata")) + tg.runFail("list", "...") + tg.grepBoth("badpkg", "go list ... failure does not mention badpkg") + tg.run("list", "m...") +} + +func TestRelativeImportsGoTest(t *testing.T) { + tg := testgo(t) + defer tg.cleanup() + tg.run("test", "./testdata/testimport") +} + +func TestRelativeImportsGoTestDashI(t *testing.T) { + tg := testgo(t) + defer tg.cleanup() + tg.run("test", "-i", "./testdata/testimport") +} + +func TestRelativeImportsInCommandLinePackage(t *testing.T) { + tg := testgo(t) + defer tg.cleanup() + files, err := filepath.Glob("./testdata/testimport/*.go") + tg.must(err) + tg.run(append([]string{"test"}, files...)...) +} + +func TestVersionControlErrorMessageIncludesCorrectDirectory(t *testing.T) { + tg := testgo(t) + defer tg.cleanup() + tg.setenv("GOPATH", filepath.Join(tg.pwd(), "testdata/shadow/root1")) + tg.runFail("get", "-u", "foo") + + // TODO(iant): We should not have to use strconv.Quote here. + // The code in vcs.go should be changed so that it is not required. + quoted := strconv.Quote(filepath.Join("testdata", "shadow", "root1", "src", "foo")) + quoted = quoted[1 : len(quoted)-1] + + tg.grepStderr(regexp.QuoteMeta(quoted), "go get -u error does not mention shadow/root1/src/foo") +} + +func TestInstallFailsWithNoBuildableFiles(t *testing.T) { + tg := testgo(t) + defer tg.cleanup() + tg.setenv("GOPATH", filepath.Join(tg.pwd(), "testdata")) + tg.setenv("CGO_ENABLED", "0") + tg.runFail("install", "cgotest") + tg.grepStderr("no buildable Go source files", "go install cgotest did not report 'no buildable Go Source files'") +} + +// Test that without $GOBIN set, binaries get installed +// into the GOPATH bin directory. +func TestInstallIntoGOPATH(t *testing.T) { + tg := testgo(t) + defer tg.cleanup() + tg.creatingTemp("testdata/bin/go-cmd-test" + exeSuffix) + tg.setenv("GOPATH", filepath.Join(tg.pwd(), "testdata")) + tg.run("install", "go-cmd-test") + tg.wantExecutable("testdata/bin/go-cmd-test"+exeSuffix, "go install go-cmd-test did not write to testdata/bin/go-cmd-test") +} + +func TestPackageMainTestImportsArchiveNotBinary(t *testing.T) { + tg := testgo(t) + defer tg.cleanup() + gobin := filepath.Join(tg.pwd(), "testdata", "bin") + tg.creatingTemp(gobin) + tg.setenv("GOBIN", gobin) + tg.setenv("GOPATH", filepath.Join(tg.pwd(), "testdata")) + tg.must(os.Chtimes("./testdata/src/main_test/m.go", time.Now(), time.Now())) + tg.sleep() + tg.run("test", "main_test") + tg.run("install", "main_test") + tg.wantNotStale("main_test", "after go install, main listed as stale") + tg.run("test", "main_test") +} + +// With $GOBIN set, binaries get installed to $GOBIN. +func TestInstallIntoGOBIN(t *testing.T) { + tg := testgo(t) + defer tg.cleanup() + gobin := filepath.Join(tg.pwd(), "testdata", "bin1") + tg.creatingTemp(gobin) + tg.setenv("GOBIN", gobin) + tg.setenv("GOPATH", filepath.Join(tg.pwd(), "testdata")) + tg.run("install", "go-cmd-test") + tg.wantExecutable("testdata/bin1/go-cmd-test"+exeSuffix, "go install go-cmd-test did not write to testdata/bin1/go-cmd-test") +} + +// Issue 11065 +func TestInstallToCurrentDirectoryCreatesExecutable(t *testing.T) { + tg := testgo(t) + defer tg.cleanup() + pkg := filepath.Join(tg.pwd(), "testdata", "src", "go-cmd-test") + tg.creatingTemp(filepath.Join(pkg, "go-cmd-test"+exeSuffix)) + tg.setenv("GOBIN", pkg) + tg.setenv("GOPATH", filepath.Join(tg.pwd(), "testdata")) + tg.cd(pkg) + tg.run("install") + tg.wantExecutable("go-cmd-test"+exeSuffix, "go install did not write to current directory") +} + +// Without $GOBIN set, installing a program outside $GOPATH should fail +// (there is nowhere to install it). +func TestInstallWithoutDestinationFails(t *testing.T) { + tg := testgo(t) + defer tg.cleanup() + tg.runFail("install", "testdata/src/go-cmd-test/helloworld.go") + tg.grepStderr("no install location for .go files listed on command line", "wrong error") +} + +// With $GOBIN set, should install there. +func TestInstallToGOBINCommandLinePackage(t *testing.T) { + tg := testgo(t) + defer tg.cleanup() + gobin := filepath.Join(tg.pwd(), "testdata", "bin1") + tg.creatingTemp(gobin) + tg.setenv("GOBIN", gobin) + tg.run("install", "testdata/src/go-cmd-test/helloworld.go") + tg.wantExecutable("testdata/bin1/helloworld"+exeSuffix, "go install testdata/src/go-cmd-test/helloworld.go did not write testdata/bin1/helloworld") +} + +func TestGodocInstalls(t *testing.T) { + testenv.MustHaveExternalNetwork(t) + + // godoc installs into GOBIN + tg := testgo(t) + defer tg.cleanup() + tg.parallel() + tg.tempDir("gobin") + tg.setenv("GOPATH", tg.path(".")) + tg.setenv("GOBIN", tg.path("gobin")) + tg.run("get", "golang.org/x/tools/cmd/godoc") + tg.wantExecutable(tg.path("gobin/godoc"), "did not install godoc to $GOBIN") + tg.unsetenv("GOBIN") + + // godoc installs into GOROOT + goroot := runtime.GOROOT() + tg.setenv("GOROOT", goroot) + tg.check(os.RemoveAll(filepath.Join(goroot, "bin", "godoc"))) + tg.run("install", "golang.org/x/tools/cmd/godoc") + tg.wantExecutable(filepath.Join(goroot, "bin", "godoc"), "did not install godoc to $GOROOT/bin") +} + +func TestGoGetNonPkg(t *testing.T) { + testenv.MustHaveExternalNetwork(t) + + tg := testgo(t) + defer tg.cleanup() + tg.tempDir("gobin") + tg.setenv("GOPATH", tg.path(".")) + tg.setenv("GOBIN", tg.path("gobin")) + tg.runFail("get", "-d", "golang.org/x/tools") + tg.grepStderr("golang.org/x/tools: no buildable Go source files", "missing error") + tg.runFail("get", "-d", "-u", "golang.org/x/tools") + tg.grepStderr("golang.org/x/tools: no buildable Go source files", "missing error") + tg.runFail("get", "-d", "golang.org/x/tools") + tg.grepStderr("golang.org/x/tools: no buildable Go source files", "missing error") +} + +func TestInstalls(t *testing.T) { + if testing.Short() { + t.Skip("don't install into GOROOT in short mode") + } + + tg := testgo(t) + defer tg.cleanup() + tg.parallel() + tg.tempDir("gobin") + tg.setenv("GOPATH", tg.path(".")) + goroot := runtime.GOROOT() + tg.setenv("GOROOT", goroot) + + // cmd/fix installs into tool + tg.run("env", "GOOS") + goos := strings.TrimSpace(tg.getStdout()) + tg.setenv("GOOS", goos) + tg.run("env", "GOARCH") + goarch := strings.TrimSpace(tg.getStdout()) + tg.setenv("GOARCH", goarch) + fixbin := filepath.Join(goroot, "pkg", "tool", goos+"_"+goarch, "fix") + exeSuffix + tg.must(os.RemoveAll(fixbin)) + tg.run("install", "cmd/fix") + tg.wantExecutable(fixbin, "did not install cmd/fix to $GOROOT/pkg/tool") + tg.must(os.Remove(fixbin)) + tg.setenv("GOBIN", tg.path("gobin")) + tg.run("install", "cmd/fix") + tg.wantExecutable(fixbin, "did not install cmd/fix to $GOROOT/pkg/tool with $GOBIN set") + tg.unsetenv("GOBIN") + + // gopath program installs into GOBIN + tg.tempFile("src/progname/p.go", `package main; func main() {}`) + tg.setenv("GOBIN", tg.path("gobin")) + tg.run("install", "progname") + tg.unsetenv("GOBIN") + tg.wantExecutable(tg.path("gobin/progname")+exeSuffix, "did not install progname to $GOBIN/progname") + + // gopath program installs into GOPATH/bin + tg.run("install", "progname") + tg.wantExecutable(tg.path("bin/progname")+exeSuffix, "did not install progname to $GOPATH/bin/progname") +} + +func TestRejectRelativeDotPathInGOPATHCommandLinePackage(t *testing.T) { + tg := testgo(t) + defer tg.cleanup() + tg.setenv("GOPATH", ".") + tg.runFail("build", "testdata/src/go-cmd-test/helloworld.go") + tg.grepStderr("GOPATH entry is relative", "expected an error message rejecting relative GOPATH entries") +} + +func TestRejectRelativePathsInGOPATH(t *testing.T) { + tg := testgo(t) + defer tg.cleanup() + sep := string(filepath.ListSeparator) + tg.setenv("GOPATH", sep+filepath.Join(tg.pwd(), "testdata")+sep+".") + tg.runFail("build", "go-cmd-test") + tg.grepStderr("GOPATH entry is relative", "expected an error message rejecting relative GOPATH entries") +} + +func TestRejectRelativePathsInGOPATHCommandLinePackage(t *testing.T) { + tg := testgo(t) + defer tg.cleanup() + tg.setenv("GOPATH", "testdata") + tg.runFail("build", "testdata/src/go-cmd-test/helloworld.go") + tg.grepStderr("GOPATH entry is relative", "expected an error message rejecting relative GOPATH entries") +} + +// Issue 4104. +func TestGoTestWithPackageListedMultipleTimes(t *testing.T) { + tg := testgo(t) + defer tg.cleanup() + tg.parallel() + tg.run("test", "errors", "errors", "errors", "errors", "errors") + if strings.Index(strings.TrimSpace(tg.getStdout()), "\n") != -1 { + t.Error("go test errors errors errors errors errors tested the same package multiple times") + } +} + +func TestGoListHasAConsistentOrder(t *testing.T) { + tg := testgo(t) + defer tg.cleanup() + tg.run("list", "std") + first := tg.getStdout() + tg.run("list", "std") + if first != tg.getStdout() { + t.Error("go list std ordering is inconsistent") + } +} + +func TestGoListStdDoesNotIncludeCommands(t *testing.T) { + tg := testgo(t) + defer tg.cleanup() + tg.run("list", "std") + tg.grepStdoutNot("cmd/", "go list std shows commands") +} + +func TestGoListCmdOnlyShowsCommands(t *testing.T) { + tg := testgo(t) + defer tg.cleanup() + tg.run("list", "cmd") + out := strings.TrimSpace(tg.getStdout()) + for _, line := range strings.Split(out, "\n") { + if strings.Index(line, "cmd/") == -1 { + t.Error("go list cmd shows non-commands") + break + } + } +} + +// Issue 4096. Validate the output of unsuccessful go install foo/quxx. +func TestUnsuccessfulGoInstallShouldMentionMissingPackage(t *testing.T) { + tg := testgo(t) + defer tg.cleanup() + tg.runFail("install", "foo/quxx") + if tg.grepCountBoth(`cannot find package "foo/quxx" in any of`) != 1 { + t.Error(`go install foo/quxx expected error: .*cannot find package "foo/quxx" in any of`) + } +} + +func TestGOROOTSearchFailureReporting(t *testing.T) { + tg := testgo(t) + defer tg.cleanup() + tg.runFail("install", "foo/quxx") + if tg.grepCountBoth(regexp.QuoteMeta(filepath.Join("foo", "quxx"))+` \(from \$GOROOT\)$`) != 1 { + t.Error(`go install foo/quxx expected error: .*foo/quxx (from $GOROOT)`) + } +} + +func TestMultipleGOPATHEntriesReportedSeparately(t *testing.T) { + tg := testgo(t) + defer tg.cleanup() + sep := string(filepath.ListSeparator) + tg.setenv("GOPATH", filepath.Join(tg.pwd(), "testdata", "a")+sep+filepath.Join(tg.pwd(), "testdata", "b")) + tg.runFail("install", "foo/quxx") + if tg.grepCountBoth(`testdata[/\\].[/\\]src[/\\]foo[/\\]quxx`) != 2 { + t.Error(`go install foo/quxx expected error: .*testdata/a/src/foo/quxx (from $GOPATH)\n.*testdata/b/src/foo/quxx`) + } +} + +// Test (from $GOPATH) annotation is reported for the first GOPATH entry, +func TestMentionGOPATHInFirstGOPATHEntry(t *testing.T) { + tg := testgo(t) + defer tg.cleanup() + sep := string(filepath.ListSeparator) + tg.setenv("GOPATH", filepath.Join(tg.pwd(), "testdata", "a")+sep+filepath.Join(tg.pwd(), "testdata", "b")) + tg.runFail("install", "foo/quxx") + if tg.grepCountBoth(regexp.QuoteMeta(filepath.Join("testdata", "a", "src", "foo", "quxx"))+` \(from \$GOPATH\)$`) != 1 { + t.Error(`go install foo/quxx expected error: .*testdata/a/src/foo/quxx (from $GOPATH)`) + } +} + +// but not on the second. +func TestMentionGOPATHNotOnSecondEntry(t *testing.T) { + tg := testgo(t) + defer tg.cleanup() + sep := string(filepath.ListSeparator) + tg.setenv("GOPATH", filepath.Join(tg.pwd(), "testdata", "a")+sep+filepath.Join(tg.pwd(), "testdata", "b")) + tg.runFail("install", "foo/quxx") + if tg.grepCountBoth(regexp.QuoteMeta(filepath.Join("testdata", "b", "src", "foo", "quxx"))+`$`) != 1 { + t.Error(`go install foo/quxx expected error: .*testdata/b/src/foo/quxx`) + } +} + +// Test missing GOPATH is reported. +func TestMissingGOPATHIsReported(t *testing.T) { + tg := testgo(t) + defer tg.cleanup() + tg.setenv("GOPATH", "") + tg.runFail("install", "foo/quxx") + if tg.grepCountBoth(`\(\$GOPATH not set\)$`) != 1 { + t.Error(`go install foo/quxx expected error: ($GOPATH not set)`) + } +} + +// Issue 4186. go get cannot be used to download packages to $GOROOT. +// Test that without GOPATH set, go get should fail. +func TestWithoutGOPATHGoGetFails(t *testing.T) { + testenv.MustHaveExternalNetwork(t) + + tg := testgo(t) + defer tg.cleanup() + tg.parallel() + tg.tempDir("src") + tg.setenv("GOPATH", "") + tg.setenv("GOROOT", tg.path(".")) + tg.runFail("get", "-d", "golang.org/x/codereview/cmd/hgpatch") +} + +// Test that with GOPATH=$GOROOT, go get should fail. +func TestWithGOPATHEqualsGOROOTGoGetFails(t *testing.T) { + testenv.MustHaveExternalNetwork(t) + + tg := testgo(t) + defer tg.cleanup() + tg.parallel() + tg.tempDir("src") + tg.setenv("GOPATH", tg.path(".")) + tg.setenv("GOROOT", tg.path(".")) + tg.runFail("get", "-d", "golang.org/x/codereview/cmd/hgpatch") +} + +func TestLdflagsArgumentsWithSpacesIssue3941(t *testing.T) { + tg := testgo(t) + defer tg.cleanup() + tg.parallel() + tg.tempFile("main.go", `package main + var extern string + func main() { + println(extern) + }`) + tg.run("run", "-ldflags", `-X main.extern "hello world"`, tg.path("main.go")) + tg.grepStderr("^hello world", `ldflags -X main.extern 'hello world' failed`) +} + +func TestGoTestCpuprofileLeavesBinaryBehind(t *testing.T) { + tg := testgo(t) + defer tg.cleanup() + tg.makeTempdir() + tg.cd(tg.path(".")) + tg.run("test", "-cpuprofile", "errors.prof", "errors") + tg.wantExecutable("errors.test"+exeSuffix, "go test -cpuprofile did not create errors.test") +} + +func TestGoTestCpuprofileDashOControlsBinaryLocation(t *testing.T) { + tg := testgo(t) + defer tg.cleanup() + tg.makeTempdir() + tg.cd(tg.path(".")) + tg.run("test", "-cpuprofile", "errors.prof", "-o", "myerrors.test"+exeSuffix, "errors") + tg.wantExecutable("myerrors.test"+exeSuffix, "go test -cpuprofile -o myerrors.test did not create myerrors.test") +} + +func TestGoTestDashCDashOControlsBinaryLocation(t *testing.T) { + tg := testgo(t) + defer tg.cleanup() + tg.parallel() + tg.makeTempdir() + tg.run("test", "-c", "-o", tg.path("myerrors.test"+exeSuffix), "errors") + tg.wantExecutable(tg.path("myerrors.test"+exeSuffix), "go test -c -o myerrors.test did not create myerrors.test") +} + +func TestGoTestDashOWritesBinary(t *testing.T) { + tg := testgo(t) + defer tg.cleanup() + tg.parallel() + tg.makeTempdir() + tg.run("test", "-o", tg.path("myerrors.test"+exeSuffix), "errors") + tg.wantExecutable(tg.path("myerrors.test"+exeSuffix), "go test -o myerrors.test did not create myerrors.test") +} + +// Issue 4568. +func TestSymlinksDoNotConfuseGoList(t *testing.T) { + switch runtime.GOOS { + case "plan9", "windows": + t.Skipf("skipping symlink test on %s", runtime.GOOS) + } + + tg := testgo(t) + defer tg.cleanup() + tg.tempDir("src") + tg.must(os.Symlink(tg.path("."), tg.path("src/dir1"))) + tg.tempFile("src/dir1/p.go", "package p") + tg.setenv("GOPATH", tg.path(".")) + tg.cd(tg.path("src")) + tg.run("list", "-f", "{{.Root}}", "dir1") + if strings.TrimSpace(tg.getStdout()) != tg.path(".") { + t.Error("confused by symlinks") + } +} + +// Issue 4515. +func TestInstallWithTags(t *testing.T) { + tg := testgo(t) + defer tg.cleanup() + tg.parallel() + tg.tempDir("bin") + tg.tempFile("src/example/a/main.go", `package main + func main() {}`) + tg.tempFile("src/example/b/main.go", `// +build mytag + + package main + func main() {}`) + tg.setenv("GOPATH", tg.path(".")) + tg.run("install", "-tags", "mytag", "example/a", "example/b") + tg.wantExecutable(tg.path("bin/a"+exeSuffix), "go install example/a example/b did not install binaries") + tg.wantExecutable(tg.path("bin/b"+exeSuffix), "go install example/a example/b did not install binaries") + tg.must(os.Remove(tg.path("bin/a" + exeSuffix))) + tg.must(os.Remove(tg.path("bin/b" + exeSuffix))) + tg.run("install", "-tags", "mytag", "example/...") + tg.wantExecutable(tg.path("bin/a"+exeSuffix), "go install example/... did not install binaries") + tg.wantExecutable(tg.path("bin/b"+exeSuffix), "go install example/... did not install binaries") + tg.run("list", "-tags", "mytag", "example/b...") + if strings.TrimSpace(tg.getStdout()) != "example/b" { + t.Error("go list example/b did not find example/b") + } +} + +// Issue 4773 +func TestCaseCollisions(t *testing.T) { + tg := testgo(t) + defer tg.cleanup() + tg.parallel() + tg.tempDir("src/example/a/pkg") + tg.tempDir("src/example/a/Pkg") + tg.tempDir("src/example/b") + tg.setenv("GOPATH", tg.path(".")) + tg.tempFile("src/example/a/a.go", `package p + import ( + _ "example/a/pkg" + _ "example/a/Pkg" + )`) + tg.tempFile("src/example/a/pkg/pkg.go", `package pkg`) + tg.tempFile("src/example/a/Pkg/pkg.go", `package pkg`) + tg.runFail("list", "example/a") + tg.grepStderr("case-insensitive import collision", "go list example/a did not report import collision") + tg.tempFile("src/example/b/file.go", `package b`) + tg.tempFile("src/example/b/FILE.go", `package b`) + f, err := os.Open(tg.path("src/example/b")) + tg.must(err) + names, err := f.Readdirnames(0) + tg.must(err) + tg.check(f.Close()) + args := []string{"list"} + if len(names) == 2 { + // case-sensitive file system, let directory read find both files + args = append(args, "example/b") + } else { + // case-insensitive file system, list files explicitly on command line + args = append(args, tg.path("src/example/b/file.go"), tg.path("src/example/b/FILE.go")) + } + tg.runFail(args...) + tg.grepStderr("case-insensitive file name collision", "go list example/b did not report file name collision") +} + +// Issue 8181. +func TestGoGetDashTIssue8181(t *testing.T) { + if testing.Short() { + t.Skip("skipping test that uses network in short mode") + } + + tg := testgo(t) + defer tg.cleanup() + tg.parallel() + tg.makeTempdir() + tg.setenv("GOPATH", tg.path(".")) + tg.run("get", "-v", "-t", "github.com/rsc/go-get-issue-8181/a", "github.com/rsc/go-get-issue-8181/b") + tg.run("list", "...") + tg.grepStdout("x/build/cmd/cl", "missing expected x/build/cmd/cl") +} + +func TestIssue11307(t *testing.T) { + // go get -u was not working except in checkout directory + if testing.Short() { + t.Skip("skipping test that uses network in short mode") + } + + tg := testgo(t) + defer tg.cleanup() + tg.parallel() + tg.makeTempdir() + tg.setenv("GOPATH", tg.path(".")) + tg.run("get", "github.com/rsc/go-get-issue-11307") + tg.run("get", "-u", "github.com/rsc/go-get-issue-11307") // was failing +} + +func TestShadowingLogic(t *testing.T) { + tg := testgo(t) + defer tg.cleanup() + pwd := tg.pwd() + sep := string(filepath.ListSeparator) + tg.setenv("GOPATH", filepath.Join(pwd, "testdata", "shadow", "root1")+sep+filepath.Join(pwd, "testdata", "shadow", "root2")) + + // The math in root1 is not "math" because the standard math is. + tg.run("list", "-f", "({{.ImportPath}}) ({{.ConflictDir}})", "./testdata/shadow/root1/src/math") + pwdForwardSlash := strings.Replace(pwd, string(os.PathSeparator), "/", -1) + if !strings.HasPrefix(pwdForwardSlash, "/") { + pwdForwardSlash = "/" + pwdForwardSlash + } + // The output will have makeImportValid applies, but we only + // bother to deal with characters we might reasonably see. + pwdForwardSlash = strings.Replace(pwdForwardSlash, ":", "_", -1) + want := "(_" + pwdForwardSlash + "/testdata/shadow/root1/src/math) (" + filepath.Join(runtime.GOROOT(), "src", "math") + ")" + if strings.TrimSpace(tg.getStdout()) != want { + t.Error("shadowed math is not shadowed; looking for", want) + } + + // The foo in root1 is "foo". + tg.run("list", "-f", "({{.ImportPath}}) ({{.ConflictDir}})", "./testdata/shadow/root1/src/foo") + if strings.TrimSpace(tg.getStdout()) != "(foo) ()" { + t.Error("unshadowed foo is shadowed") + } + + // The foo in root2 is not "foo" because the foo in root1 got there first. + tg.run("list", "-f", "({{.ImportPath}}) ({{.ConflictDir}})", "./testdata/shadow/root2/src/foo") + want = "(_" + pwdForwardSlash + "/testdata/shadow/root2/src/foo) (" + filepath.Join(pwd, "testdata", "shadow", "root1", "src", "foo") + ")" + if strings.TrimSpace(tg.getStdout()) != want { + t.Error("shadowed foo is not shadowed; looking for", want) + } + + // The error for go install should mention the conflicting directory. + tg.runFail("install", "./testdata/shadow/root2/src/foo") + want = "go install: no install location for " + filepath.Join(pwd, "testdata", "shadow", "root2", "src", "foo") + ": hidden by " + filepath.Join(pwd, "testdata", "shadow", "root1", "src", "foo") + if strings.TrimSpace(tg.getStderr()) != want { + t.Error("wrong shadowed install error; looking for", want) + } +} + +// Only succeeds if source order is preserved. +func TestSourceFileNameOrderPreserved(t *testing.T) { + tg := testgo(t) + defer tg.cleanup() + tg.run("test", "testdata/example1_test.go", "testdata/example2_test.go") +} + +// Check that coverage analysis works at all. +// Don't worry about the exact numbers but require not 0.0%. +func checkCoverage(tg *testgoData, data string) { + if regexp.MustCompile(`[^0-9]0\.0%`).MatchString(data) { + tg.t.Error("some coverage results are 0.0%") + } + tg.t.Log(data) +} + +func TestCoverageRuns(t *testing.T) { + if testing.Short() { + t.Skip("don't build libraries for coverage in short mode") + } + tg := testgo(t) + defer tg.cleanup() + tg.run("test", "-short", "-coverpkg=strings", "strings", "regexp") + data := tg.getStdout() + tg.getStderr() + tg.run("test", "-short", "-cover", "strings", "math", "regexp") + data += tg.getStdout() + tg.getStderr() + checkCoverage(tg, data) +} + +// Check that coverage analysis uses set mode. +func TestCoverageUsesSetMode(t *testing.T) { + if testing.Short() { + t.Skip("don't build libraries for coverage in short mode") + } + tg := testgo(t) + defer tg.cleanup() + tg.creatingTemp("testdata/cover.out") + tg.run("test", "-short", "-cover", "encoding/binary", "-coverprofile=testdata/cover.out") + data := tg.getStdout() + tg.getStderr() + if out, err := ioutil.ReadFile("testdata/cover.out"); err != nil { + t.Error(err) + } else { + if !bytes.Contains(out, []byte("mode: set")) { + t.Error("missing mode: set") + } + } + checkCoverage(tg, data) +} + +func TestCoverageUsesAtomicModeForRace(t *testing.T) { + if testing.Short() { + t.Skip("don't build libraries for coverage in short mode") + } + if !canRace { + t.Skip("skipping because race detector not supported") + } + + tg := testgo(t) + defer tg.cleanup() + tg.creatingTemp("testdata/cover.out") + tg.run("test", "-short", "-race", "-cover", "encoding/binary", "-coverprofile=testdata/cover.out") + data := tg.getStdout() + tg.getStderr() + if out, err := ioutil.ReadFile("testdata/cover.out"); err != nil { + t.Error(err) + } else { + if !bytes.Contains(out, []byte("mode: atomic")) { + t.Error("missing mode: atomic") + } + } + checkCoverage(tg, data) +} + +func TestCoverageUsesActualSettingToOverrideEvenForRace(t *testing.T) { + if testing.Short() { + t.Skip("don't build libraries for coverage in short mode") + } + if !canRace { + t.Skip("skipping because race detector not supported") + } + + tg := testgo(t) + defer tg.cleanup() + tg.creatingTemp("testdata/cover.out") + tg.run("test", "-short", "-race", "-cover", "encoding/binary", "-covermode=count", "-coverprofile=testdata/cover.out") + data := tg.getStdout() + tg.getStderr() + if out, err := ioutil.ReadFile("testdata/cover.out"); err != nil { + t.Error(err) + } else { + if !bytes.Contains(out, []byte("mode: count")) { + t.Error("missing mode: count") + } + } + checkCoverage(tg, data) +} + +func TestCoverageWithCgo(t *testing.T) { + if !canCgo { + t.Skip("skipping because cgo not enabled") + } + + tg := testgo(t) + defer tg.cleanup() + tg.run("test", "-short", "-cover", "./testdata/cgocover") + data := tg.getStdout() + tg.getStderr() + checkCoverage(tg, data) +} + +func TestCgoDependsOnSyscall(t *testing.T) { + if testing.Short() { + t.Skip("skipping test that removes $GOROOT/pkg/*_race in short mode") + } + if !canCgo { + t.Skip("skipping because cgo not enabled") + } + if !canRace { + t.Skip("skipping because race detector not supported") + } + + tg := testgo(t) + defer tg.cleanup() + files, err := filepath.Glob(filepath.Join(runtime.GOROOT(), "pkg", "*_race")) + tg.must(err) + for _, file := range files { + tg.check(os.RemoveAll(file)) + } + tg.tempFile("src/foo/foo.go", ` + package foo + //#include + import "C"`) + tg.setenv("GOPATH", tg.path(".")) + tg.run("build", "-race", "foo") +} + +func TestCgoShowsFullPathNames(t *testing.T) { + if !canCgo { + t.Skip("skipping because cgo not enabled") + } + + tg := testgo(t) + defer tg.cleanup() + tg.parallel() + tg.tempFile("src/x/y/dirname/foo.go", ` + package foo + import "C" + func f() {`) + tg.setenv("GOPATH", tg.path(".")) + tg.runFail("build", "x/y/dirname") + tg.grepBoth("x/y/dirname", "error did not use full path") +} + +func TestCgoHandlesWlORIGIN(t *testing.T) { + if !canCgo { + t.Skip("skipping because cgo not enabled") + } + + tg := testgo(t) + defer tg.cleanup() + tg.parallel() + tg.tempFile("src/origin/origin.go", `package origin + // #cgo !darwin LDFLAGS: -Wl,-rpath -Wl,$ORIGIN + // void f(void) {} + import "C" + func f() { C.f() }`) + tg.setenv("GOPATH", tg.path(".")) + tg.run("build", "origin") +} + +// "go test -c -test.bench=XXX errors" should not hang +func TestIssue6480(t *testing.T) { + tg := testgo(t) + defer tg.cleanup() + tg.makeTempdir() + tg.cd(tg.path(".")) + tg.run("test", "-c", "-test.bench=XXX", "errors") +} + +// cmd/cgo: undefined reference when linking a C-library using gccgo +func TestIssue7573(t *testing.T) { + if _, err := exec.LookPath("gccgo"); err != nil { + t.Skip("skipping because no gccgo compiler found") + } + + tg := testgo(t) + defer tg.cleanup() + tg.parallel() + tg.tempFile("src/cgoref/cgoref.go", ` +package main +// #cgo LDFLAGS: -L alibpath -lalib +// void f(void) {} +import "C" + +func main() { C.f() }`) + tg.setenv("GOPATH", tg.path(".")) + tg.run("build", "-n", "-compiler", "gccgo", "cgoref") + tg.grepStderr(`gccgo.*\-L alibpath \-lalib`, `no Go-inline "#cgo LDFLAGS:" ("-L alibpath -lalib") passed to gccgo linking stage`) +} + +func TestListTemplateCanUseContextFunction(t *testing.T) { + tg := testgo(t) + defer tg.cleanup() + tg.run("list", "-f", "GOARCH: {{context.GOARCH}}") +} + +// cmd/go: "go test" should fail if package does not build +func TestIssue7108(t *testing.T) { + tg := testgo(t) + defer tg.cleanup() + tg.setenv("GOPATH", filepath.Join(tg.pwd(), "testdata")) + tg.runFail("test", "notest") +} + +// cmd/go: go test -a foo does not rebuild regexp. +func TestIssue6844(t *testing.T) { + if testing.Short() { + t.Skip("don't rebuild the standard libary in short mode") + } + + tg := testgo(t) + defer tg.cleanup() + tg.creatingTemp("deps.test" + exeSuffix) + tg.run("test", "-x", "-a", "-c", "testdata/dep_test.go") + tg.grepStderr("regexp", "go test -x -a -c testdata/dep-test.go did not rebuild regexp") +} + +func TestBuildDashIInstallsDependencies(t *testing.T) { + tg := testgo(t) + defer tg.cleanup() + tg.parallel() + tg.tempFile("src/x/y/foo/foo.go", `package foo + func F() {}`) + tg.tempFile("src/x/y/bar/bar.go", `package bar + import "x/y/foo" + func F() { foo.F() }`) + tg.setenv("GOPATH", tg.path(".")) + + checkbar := func(desc string) { + tg.sleep() + tg.must(os.Chtimes(tg.path("src/x/y/foo/foo.go"), time.Now(), time.Now())) + tg.sleep() + tg.run("build", "-v", "-i", "x/y/bar") + tg.grepBoth("x/y/foo", "first build -i "+desc+" did not build x/y/foo") + tg.run("build", "-v", "-i", "x/y/bar") + tg.grepBothNot("x/y/foo", "second build -i "+desc+" built x/y/foo") + } + checkbar("pkg") + tg.creatingTemp("bar" + exeSuffix) + tg.tempFile("src/x/y/bar/bar.go", `package main + import "x/y/foo" + func main() { foo.F() }`) + checkbar("cmd") +} + +func TestGoBuildInTestOnlyDirectoryFailsWithAGoodError(t *testing.T) { + tg := testgo(t) + defer tg.cleanup() + tg.runFail("build", "./testdata/testonly") + tg.grepStderr("no buildable Go", "go build ./testdata/testonly produced unexpected error") +} + +func TestGoTestDetectsTestOnlyImportCycles(t *testing.T) { + tg := testgo(t) + defer tg.cleanup() + tg.setenv("GOPATH", filepath.Join(tg.pwd(), "testdata")) + tg.runFail("test", "-c", "testcycle/p3") + tg.grepStderr("import cycle not allowed in test", "go test testcycle/p3 produced unexpected error") + + tg.runFail("test", "-c", "testcycle/q1") + tg.grepStderr("import cycle not allowed in test", "go test testcycle/q1 produced unexpected error") +} + +func TestGoTestFooTestWorks(t *testing.T) { + tg := testgo(t) + defer tg.cleanup() + tg.run("test", "testdata/standalone_test.go") +} + +func TestGoTestXtestonlyWorks(t *testing.T) { + tg := testgo(t) + defer tg.cleanup() + tg.setenv("GOPATH", filepath.Join(tg.pwd(), "testdata")) + tg.run("clean", "-i", "xtestonly") + tg.run("test", "xtestonly") +} + +func TestGoTestBuildsAnXtestContainingOnlyNonRunnableExamples(t *testing.T) { + tg := testgo(t) + defer tg.cleanup() + tg.run("test", "-v", "./testdata/norunexample") + tg.grepStdout("File with non-runnable example was built.", "file with non-runnable example was not built") +} + +func TestGoGenerateHandlesSimpleCommand(t *testing.T) { + if runtime.GOOS == "windows" { + t.Skip("skipping because windows has no echo command") + } + + tg := testgo(t) + defer tg.cleanup() + tg.run("generate", "./testdata/generate/test1.go") + tg.grepStdout("Success", "go generate ./testdata/generate/test1.go generated wrong output") +} + +func TestGoGenerateHandlesCommandAlias(t *testing.T) { + if runtime.GOOS == "windows" { + t.Skip("skipping because windows has no echo command") + } + + tg := testgo(t) + defer tg.cleanup() + tg.run("generate", "./testdata/generate/test2.go") + tg.grepStdout("Now is the time for all good men", "go generate ./testdata/generate/test2.go generated wrong output") +} + +func TestGoGenerateVariableSubstitution(t *testing.T) { + if runtime.GOOS == "windows" { + t.Skip("skipping because windows has no echo command") + } + + tg := testgo(t) + defer tg.cleanup() + tg.run("generate", "./testdata/generate/test3.go") + tg.grepStdout(runtime.GOARCH+" test3.go:7 pabc xyzp/test3.go/123", "go generate ./testdata/generate/test3.go generated wrong output") +} + +func TestGoGenerateRunFlag(t *testing.T) { + if runtime.GOOS == "windows" { + t.Skip("skipping because windows has no echo command") + } + + tg := testgo(t) + defer tg.cleanup() + tg.run("generate", "-run", "y.s", "./testdata/generate/test4.go") + tg.grepStdout("yes", "go generate -run yes ./testdata/generate/test4.go did not select yes") + tg.grepStdoutNot("no", "go generate -run yes ./testdata/generate/test4.go selected no") +} + +func TestGoGetCustomDomainWildcard(t *testing.T) { + testenv.MustHaveExternalNetwork(t) + + tg := testgo(t) + defer tg.cleanup() + tg.makeTempdir() + tg.setenv("GOPATH", tg.path(".")) + tg.run("get", "-u", "rsc.io/pdf/...") + tg.wantExecutable(tg.path("bin/pdfpasswd"+exeSuffix), "did not build rsc/io/pdf/pdfpasswd") +} + +func TestGoGetInternalWildcard(t *testing.T) { + testenv.MustHaveExternalNetwork(t) + + tg := testgo(t) + defer tg.cleanup() + tg.makeTempdir() + tg.setenv("GOPATH", tg.path(".")) + // used to fail with errors about internal packages + tg.run("get", "github.com/rsc/go-get-issue-11960/...") +} + +func TestGoVetWithExternalTests(t *testing.T) { + testenv.MustHaveExternalNetwork(t) + + tg := testgo(t) + defer tg.cleanup() + tg.makeTempdir() + tg.setenv("GOPATH", tg.path(".")) + tg.run("get", "golang.org/x/tools/cmd/vet") + tg.setenv("GOPATH", filepath.Join(tg.pwd(), "testdata")) + tg.runFail("vet", "vetpkg") + tg.grepBoth("missing argument for Printf", "go vet vetpkg did not find missing argument for Printf") +} + +func TestGoVetWithTags(t *testing.T) { + testenv.MustHaveExternalNetwork(t) + + tg := testgo(t) + defer tg.cleanup() + tg.makeTempdir() + tg.setenv("GOPATH", tg.path(".")) + tg.run("get", "golang.org/x/tools/cmd/vet") + tg.setenv("GOPATH", filepath.Join(tg.pwd(), "testdata")) + tg.runFail("vet", "-tags", "tagtest", "vetpkg") + tg.grepBoth(`c\.go.*wrong number of args for format`, "go get vetpkg did not run scan tagged file") +} + +// Issue 9767. +func TestGoGetRscIoToolstash(t *testing.T) { + testenv.MustHaveExternalNetwork(t) + + tg := testgo(t) + defer tg.cleanup() + tg.tempDir("src/rsc.io") + tg.setenv("GOPATH", tg.path(".")) + tg.cd(tg.path("src/rsc.io")) + tg.run("get", "./toolstash") +} + +// Test that you can not import a main package. +func TestIssue4210(t *testing.T) { + tg := testgo(t) + defer tg.cleanup() + tg.tempFile("src/x/main.go", `package main + var X int + func main() {}`) + tg.tempFile("src/y/main.go", `package main + import "fmt" + import xmain "x" + func main() { + fmt.Println(xmain.X) + }`) + tg.setenv("GOPATH", tg.path(".")) + tg.runFail("build", "y") + tg.grepBoth("is a program", `did not find expected error message ("is a program")`) +} + +func TestGoGetInsecure(t *testing.T) { + testenv.MustHaveExternalNetwork(t) + + tg := testgo(t) + defer tg.cleanup() + tg.makeTempdir() + tg.setenv("GOPATH", tg.path(".")) + tg.failSSH() + + const repo = "wh3rd.net/git.git" + + // Try go get -d of HTTP-only repo (should fail). + tg.runFail("get", "-d", repo) + + // Try again with -insecure (should succeed). + tg.run("get", "-d", "-insecure", repo) + + // Try updating without -insecure (should fail). + tg.runFail("get", "-d", "-u", "-f", repo) +} + +func TestGoGetUpdateInsecure(t *testing.T) { + testenv.MustHaveExternalNetwork(t) + + tg := testgo(t) + defer tg.cleanup() + tg.makeTempdir() + tg.setenv("GOPATH", tg.path(".")) + + const repo = "github.com/golang/example" + + // Clone the repo via HTTP manually. + cmd := exec.Command("git", "clone", "-q", "http://"+repo, tg.path("src/"+repo)) + if out, err := cmd.CombinedOutput(); err != nil { + t.Fatalf("cloning %v repo: %v\n%s", repo, err, out) + } + + // Update without -insecure should fail. + // Update with -insecure should succeed. + // We need -f to ignore import comments. + const pkg = repo + "/hello" + tg.runFail("get", "-d", "-u", "-f", pkg) + tg.run("get", "-d", "-u", "-f", "-insecure", pkg) +} + +func TestGoGetInsecureCustomDomain(t *testing.T) { + testenv.MustHaveExternalNetwork(t) + + tg := testgo(t) + defer tg.cleanup() + tg.makeTempdir() + tg.setenv("GOPATH", tg.path(".")) + + const repo = "wh3rd.net/repo" + tg.runFail("get", "-d", repo) + tg.run("get", "-d", "-insecure", repo) +} + +func TestIssue10193(t *testing.T) { + testenv.MustHaveExternalNetwork(t) + + tg := testgo(t) + defer tg.cleanup() + tg.parallel() + tg.tempDir("src") + tg.setenv("GOPATH", tg.path(".")) + tg.runFail("get", "code.google.com/p/rsc/pdf") + tg.grepStderr("is shutting down", "missed warning about code.google.com") +} + +func TestGoRunDirs(t *testing.T) { + tg := testgo(t) + defer tg.cleanup() + tg.cd("testdata/rundir") + tg.runFail("run", "x.go", "sub/sub.go") + tg.grepStderr("named files must all be in one directory; have ./ and sub/", "wrong output") + tg.runFail("run", "sub/sub.go", "x.go") + tg.grepStderr("named files must all be in one directory; have sub/ and ./", "wrong output") +} + +func TestGoInstallPkgdir(t *testing.T) { + tg := testgo(t) + defer tg.cleanup() + tg.makeTempdir() + pkg := tg.path(".") + tg.run("install", "-pkgdir", pkg, "errors") + _, err := os.Stat(filepath.Join(pkg, "errors.a")) + tg.must(err) + _, err = os.Stat(filepath.Join(pkg, "runtime.a")) + tg.must(err) +} + +func TestGoTestRaceInstallCgo(t *testing.T) { + switch sys := runtime.GOOS + "/" + runtime.GOARCH; sys { + case "darwin/amd64", "freebsd/amd64", "linux/amd64", "windows/amd64": + // ok + default: + t.Skip("no race detector on %s", sys) + } + + if !build.Default.CgoEnabled { + t.Skip("no race detector without cgo") + } + + // golang.org/issue/10500. + // This used to install a race-enabled cgo. + tg := testgo(t) + defer tg.cleanup() + tg.run("tool", "-n", "cgo") + cgo := strings.TrimSpace(tg.stdout.String()) + old, err := os.Stat(cgo) + tg.must(err) + tg.run("test", "-race", "-i", "runtime/race") + new, err := os.Stat(cgo) + tg.must(err) + if new.ModTime() != old.ModTime() { + t.Fatalf("go test -i runtime/race reinstalled cmd/cgo") + } +} + +func TestGoTestImportErrorStack(t *testing.T) { + const out = `package testdep/p1 (test) + imports testdep/p2 + imports testdep/p3: no buildable Go source files` + + tg := testgo(t) + defer tg.cleanup() + tg.setenv("GOPATH", filepath.Join(tg.pwd(), "testdata")) + tg.runFail("test", "testdep/p1") + if !strings.Contains(tg.stderr.String(), out) { + t.Fatal("did not give full import stack:\n\n%s", tg.stderr.String()) + } +} + +func TestGoGetUpdate(t *testing.T) { + // golang.org/issue/9224. + // The recursive updating was trying to walk to + // former dependencies, not current ones. + + testenv.MustHaveExternalNetwork(t) + + tg := testgo(t) + defer tg.cleanup() + tg.makeTempdir() + tg.setenv("GOPATH", tg.path(".")) + + rewind := func() { + tg.run("get", "github.com/rsc/go-get-issue-9224-cmd") + cmd := exec.Command("git", "reset", "--hard", "HEAD~") + cmd.Dir = tg.path("src/github.com/rsc/go-get-issue-9224-lib") + out, err := cmd.CombinedOutput() + if err != nil { + t.Fatalf("git: %v\n%s", err, out) + } + } + + rewind() + tg.run("get", "-u", "github.com/rsc/go-get-issue-9224-cmd") + + // Again with -d -u. + rewind() + tg.run("get", "-d", "-u", "github.com/rsc/go-get-issue-9224-cmd") +} + +func TestGoGetDomainRoot(t *testing.T) { + // golang.org/issue/9357. + // go get foo.io (not foo.io/subdir) was not working consistently. + + testenv.MustHaveExternalNetwork(t) + + tg := testgo(t) + defer tg.cleanup() + tg.makeTempdir() + tg.setenv("GOPATH", tg.path(".")) + + // go-get-issue-9357.appspot.com is running + // the code at github.com/rsc/go-get-issue-9357, + // a trivial Go on App Engine app that serves a + // tag for the domain root. + tg.run("get", "-d", "go-get-issue-9357.appspot.com") + tg.run("get", "go-get-issue-9357.appspot.com") + tg.run("get", "-u", "go-get-issue-9357.appspot.com") + + tg.must(os.RemoveAll(tg.path("src/go-get-issue-9357.appspot.com"))) + tg.run("get", "go-get-issue-9357.appspot.com") + + tg.must(os.RemoveAll(tg.path("src/go-get-issue-9357.appspot.com"))) + tg.run("get", "-u", "go-get-issue-9357.appspot.com") +} + +func TestGoInstallShadowedGOPATH(t *testing.T) { + // golang.org/issue/3652. + // go get foo.io (not foo.io/subdir) was not working consistently. + + testenv.MustHaveExternalNetwork(t) + + tg := testgo(t) + defer tg.cleanup() + tg.makeTempdir() + tg.setenv("GOPATH", tg.path("gopath1")+string(filepath.ListSeparator)+tg.path("gopath2")) + + tg.tempDir("gopath1/src/test") + tg.tempDir("gopath2/src/test") + tg.tempFile("gopath2/src/test/main.go", "package main\nfunc main(){}\n") + + tg.cd(tg.path("gopath2/src/test")) + tg.runFail("install") + tg.grepStderr("no install location for.*gopath2.src.test: hidden by .*gopath1.src.test", "missing error") +} + +func TestIssue11709(t *testing.T) { + tg := testgo(t) + defer tg.cleanup() + tg.tempFile("run.go", ` + package main + import "os" + func main() { + if os.Getenv("TERM") != "" { + os.Exit(1) + } + }`) + tg.unsetenv("TERM") + tg.run("run", tg.path("run.go")) +} + +func TestIssue12096(t *testing.T) { + tg := testgo(t) + defer tg.cleanup() + tg.tempFile("test_test.go", ` + package main + import ("os"; "testing") + func TestEnv(t *testing.T) { + if os.Getenv("TERM") != "" { + t.Fatal("TERM is set") + } + }`) + tg.unsetenv("TERM") + tg.run("test", tg.path("test_test.go")) +} + +func TestGoBuildOutput(t *testing.T) { + tg := testgo(t) + defer tg.cleanup() + + tg.makeTempdir() + tg.cd(tg.path(".")) + + nonExeSuffix := ".exe" + if exeSuffix == ".exe" { + nonExeSuffix = "" + } + + tg.tempFile("x.go", "package main\nfunc main(){}\n") + tg.run("build", "x.go") + tg.wantExecutable("x"+exeSuffix, "go build x.go did not write x"+exeSuffix) + tg.must(os.Remove(tg.path("x" + exeSuffix))) + tg.mustNotExist("x" + nonExeSuffix) + + tg.run("build", "-o", "myprog", "x.go") + tg.mustNotExist("x") + tg.mustNotExist("x.exe") + tg.wantExecutable("myprog", "go build -o myprog x.go did not write myprog") + tg.mustNotExist("myprog.exe") + + tg.tempFile("p.go", "package p\n") + tg.run("build", "p.go") + tg.mustNotExist("p") + tg.mustNotExist("p.a") + tg.mustNotExist("p.o") + tg.mustNotExist("p.exe") + + tg.run("build", "-o", "p.a", "p.go") + tg.wantArchive("p.a") + + tg.run("build", "cmd/gofmt") + tg.wantExecutable("gofmt"+exeSuffix, "go build cmd/gofmt did not write gofmt"+exeSuffix) + tg.must(os.Remove(tg.path("gofmt" + exeSuffix))) + tg.mustNotExist("gofmt" + nonExeSuffix) + + tg.run("build", "-o", "mygofmt", "cmd/gofmt") + tg.wantExecutable("mygofmt", "go build -o mygofmt cmd/gofmt did not write mygofmt") + tg.mustNotExist("mygofmt.exe") + tg.mustNotExist("gofmt") + tg.mustNotExist("gofmt.exe") + + tg.run("build", "sync/atomic") + tg.mustNotExist("atomic") + tg.mustNotExist("atomic.exe") + + tg.run("build", "-o", "myatomic.a", "sync/atomic") + tg.wantArchive("myatomic.a") + tg.mustNotExist("atomic") + tg.mustNotExist("atomic.a") + tg.mustNotExist("atomic.exe") + + tg.runFail("build", "-o", "whatever", "cmd/gofmt", "sync/atomic") + tg.grepStderr("multiple packages", "did not reject -o with multiple packages") +} + +func TestGoBuildARM(t *testing.T) { + if testing.Short() { + t.Skip("skipping cross-compile in short mode") + } + + tg := testgo(t) + defer tg.cleanup() + + tg.makeTempdir() + tg.cd(tg.path(".")) + + tg.setenv("GOARCH", "arm") + tg.setenv("GOOS", "linux") + tg.setenv("GOARM", "5") + tg.tempFile("hello.go", `package main + func main() {}`) + tg.run("build", "hello.go") + tg.grepStderrNot("unable to find math.a", "did not build math.a correctly") +} diff --git a/src/cmd/go/go_windows_test.go b/src/cmd/go/go_windows_test.go new file mode 100644 index 0000000000000000000000000000000000000000..53d695cccc8a72c6285ce5b7bcfa87bccef22e26 --- /dev/null +++ b/src/cmd/go/go_windows_test.go @@ -0,0 +1,55 @@ +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +import ( + "io/ioutil" + "os" + "os/exec" + "path/filepath" + "strings" + "testing" +) + +func TestAbsolutePath(t *testing.T) { + tmp, err := ioutil.TempDir("", "TestAbsolutePath") + if err != nil { + t.Fatal(err) + } + defer os.RemoveAll(tmp) + + file := filepath.Join(tmp, "a.go") + err = ioutil.WriteFile(file, []byte{}, 0644) + if err != nil { + t.Fatal(err) + } + dir := filepath.Join(tmp, "dir") + err = os.Mkdir(dir, 0777) + if err != nil { + t.Fatal(err) + } + + wd, err := os.Getwd() + if err != nil { + t.Fatal(err) + } + defer os.Chdir(wd) + + // Chdir so current directory and a.go reside on the same drive. + err = os.Chdir(dir) + if err != nil { + t.Fatal(err) + } + + noVolume := file[len(filepath.VolumeName(file)):] + wrongPath := filepath.Join(dir, noVolume) + output, err := exec.Command("go", "build", noVolume).CombinedOutput() + if err == nil { + t.Fatal("build should fail") + } + if strings.Contains(string(output), wrongPath) { + t.Fatalf("wrong output found: %v %v", err, string(output)) + } +} diff --git a/src/cmd/go/help.go b/src/cmd/go/help.go new file mode 100644 index 0000000000000000000000000000000000000000..5dff2670f1b990471dee5a4338fee5e3ee9ab6a8 --- /dev/null +++ b/src/cmd/go/help.go @@ -0,0 +1,574 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +var helpC = &Command{ + UsageLine: "c", + Short: "calling between Go and C", + Long: ` +There are two different ways to call between Go and C/C++ code. + +The first is the cgo tool, which is part of the Go distribution. For +information on how to use it see the cgo documentation (go doc cmd/cgo). + +The second is the SWIG program, which is a general tool for +interfacing between languages. For information on SWIG see +http://swig.org/. When running go build, any file with a .swig +extension will be passed to SWIG. Any file with a .swigcxx extension +will be passed to SWIG with the -c++ option. + +When either cgo or SWIG is used, go build will pass any .c, .m, .s, +or .S files to the C compiler, and any .cc, .cpp, .cxx files to the C++ +compiler. The CC or CXX environment variables may be set to determine +the C or C++ compiler, respectively, to use. + `, +} + +var helpPackages = &Command{ + UsageLine: "packages", + Short: "description of package lists", + Long: ` +Many commands apply to a set of packages: + + go action [packages] + +Usually, [packages] is a list of import paths. + +An import path that is a rooted path or that begins with +a . or .. element is interpreted as a file system path and +denotes the package in that directory. + +Otherwise, the import path P denotes the package found in +the directory DIR/src/P for some DIR listed in the GOPATH +environment variable (see 'go help gopath'). + +If no import paths are given, the action applies to the +package in the current directory. + +There are four reserved names for paths that should not be used +for packages to be built with the go tool: + +- "main" denotes the top-level package in a stand-alone executable. + +- "all" expands to all package directories found in all the GOPATH +trees. For example, 'go list all' lists all the packages on the local +system. + +- "std" is like all but expands to just the packages in the standard +Go library. + +- "cmd" expands to the Go repository's commands and their +internal libraries. + +An import path is a pattern if it includes one or more "..." wildcards, +each of which can match any string, including the empty string and +strings containing slashes. Such a pattern expands to all package +directories found in the GOPATH trees with names matching the +patterns. As a special case, x/... matches x as well as x's subdirectories. +For example, net/... expands to net and packages in its subdirectories. + +An import path can also name a package to be downloaded from +a remote repository. Run 'go help importpath' for details. + +Every package in a program must have a unique import path. +By convention, this is arranged by starting each path with a +unique prefix that belongs to you. For example, paths used +internally at Google all begin with 'google', and paths +denoting remote repositories begin with the path to the code, +such as 'github.com/user/repo'. + +As a special case, if the package list is a list of .go files from a +single directory, the command is applied to a single synthesized +package made up of exactly those files, ignoring any build constraints +in those files and ignoring any other files in the directory. + +Directory and file names that begin with "." or "_" are ignored +by the go tool, as are directories named "testdata". + `, +} + +var helpImportPath = &Command{ + UsageLine: "importpath", + Short: "import path syntax", + Long: ` + +An import path (see 'go help packages') denotes a package +stored in the local file system. In general, an import path denotes +either a standard package (such as "unicode/utf8") or a package +found in one of the work spaces (see 'go help gopath'). + +Relative import paths + +An import path beginning with ./ or ../ is called a relative path. +The toolchain supports relative import paths as a shortcut in two ways. + +First, a relative path can be used as a shorthand on the command line. +If you are working in the directory containing the code imported as +"unicode" and want to run the tests for "unicode/utf8", you can type +"go test ./utf8" instead of needing to specify the full path. +Similarly, in the reverse situation, "go test .." will test "unicode" from +the "unicode/utf8" directory. Relative patterns are also allowed, like +"go test ./..." to test all subdirectories. See 'go help packages' for details +on the pattern syntax. + +Second, if you are compiling a Go program not in a work space, +you can use a relative path in an import statement in that program +to refer to nearby code also not in a work space. +This makes it easy to experiment with small multipackage programs +outside of the usual work spaces, but such programs cannot be +installed with "go install" (there is no work space in which to install them), +so they are rebuilt from scratch each time they are built. +To avoid ambiguity, Go programs cannot use relative import paths +within a work space. + +Remote import paths + +Certain import paths also +describe how to obtain the source code for the package using +a revision control system. + +A few common code hosting sites have special syntax: + + Bitbucket (Git, Mercurial) + + import "bitbucket.org/user/project" + import "bitbucket.org/user/project/sub/directory" + + GitHub (Git) + + import "github.com/user/project" + import "github.com/user/project/sub/directory" + + Google Code Project Hosting (Git, Mercurial, Subversion) + + import "code.google.com/p/project" + import "code.google.com/p/project/sub/directory" + + import "code.google.com/p/project.subrepository" + import "code.google.com/p/project.subrepository/sub/directory" + + Launchpad (Bazaar) + + import "launchpad.net/project" + import "launchpad.net/project/series" + import "launchpad.net/project/series/sub/directory" + + import "launchpad.net/~user/project/branch" + import "launchpad.net/~user/project/branch/sub/directory" + + IBM DevOps Services (Git) + + import "hub.jazz.net/git/user/project" + import "hub.jazz.net/git/user/project/sub/directory" + +For code hosted on other servers, import paths may either be qualified +with the version control type, or the go tool can dynamically fetch +the import path over https/http and discover where the code resides +from a tag in the HTML. + +To declare the code location, an import path of the form + + repository.vcs/path + +specifies the given repository, with or without the .vcs suffix, +using the named version control system, and then the path inside +that repository. The supported version control systems are: + + Bazaar .bzr + Git .git + Mercurial .hg + Subversion .svn + +For example, + + import "example.org/user/foo.hg" + +denotes the root directory of the Mercurial repository at +example.org/user/foo or foo.hg, and + + import "example.org/repo.git/foo/bar" + +denotes the foo/bar directory of the Git repository at +example.org/repo or repo.git. + +When a version control system supports multiple protocols, +each is tried in turn when downloading. For example, a Git +download tries https://, then git+ssh://. + +If the import path is not a known code hosting site and also lacks a +version control qualifier, the go tool attempts to fetch the import +over https/http and looks for a tag in the document's HTML +. + +The meta tag has the form: + + + +The import-prefix is the import path corresponding to the repository +root. It must be a prefix or an exact match of the package being +fetched with "go get". If it's not an exact match, another http +request is made at the prefix to verify the tags match. + +The meta tag should appear as early in the file as possible. +In particular, it should appear before any raw JavaScript or CSS, +to avoid confusing the go command's restricted parser. + +The vcs is one of "git", "hg", "svn", etc, + +The repo-root is the root of the version control system +containing a scheme and not containing a .vcs qualifier. + +For example, + + import "example.org/pkg/foo" + +will result in the following requests: + + https://example.org/pkg/foo?go-get=1 (preferred) + http://example.org/pkg/foo?go-get=1 (fallback, only with -insecure) + +If that page contains the meta tag + + + +the go tool will verify that https://example.org/?go-get=1 contains the +same meta tag and then git clone https://code.org/r/p/exproj into +GOPATH/src/example.org. + +New downloaded packages are written to the first directory +listed in the GOPATH environment variable (see 'go help gopath'). + +The go command attempts to download the version of the +package appropriate for the Go release being used. +Run 'go help get' for more. + +Import path checking + +When the custom import path feature described above redirects to a +known code hosting site, each of the resulting packages has two possible +import paths, using the custom domain or the known hosting site. + +A package statement is said to have an "import comment" if it is immediately +followed (before the next newline) by a comment of one of these two forms: + + package math // import "path" + package math /* import "path" */ + +The go command will refuse to install a package with an import comment +unless it is being referred to by that import path. In this way, import comments +let package authors make sure the custom import path is used and not a +direct path to the underlying code hosting site. + +If the vendoring experiment is enabled (see 'go help gopath'), +then import path checking is disabled for code found within vendor trees. +This makes it possible to copy code into alternate locations in vendor trees +without needing to update import comments. + +See https://golang.org/s/go14customimport for details. + `, +} + +var helpGopath = &Command{ + UsageLine: "gopath", + Short: "GOPATH environment variable", + Long: ` +The Go path is used to resolve import statements. +It is implemented by and documented in the go/build package. + +The GOPATH environment variable lists places to look for Go code. +On Unix, the value is a colon-separated string. +On Windows, the value is a semicolon-separated string. +On Plan 9, the value is a list. + +GOPATH must be set to get, build and install packages outside the +standard Go tree. + +Each directory listed in GOPATH must have a prescribed structure: + +The src directory holds source code. The path below src +determines the import path or executable name. + +The pkg directory holds installed package objects. +As in the Go tree, each target operating system and +architecture pair has its own subdirectory of pkg +(pkg/GOOS_GOARCH). + +If DIR is a directory listed in the GOPATH, a package with +source in DIR/src/foo/bar can be imported as "foo/bar" and +has its compiled form installed to "DIR/pkg/GOOS_GOARCH/foo/bar.a". + +The bin directory holds compiled commands. +Each command is named for its source directory, but only +the final element, not the entire path. That is, the +command with source in DIR/src/foo/quux is installed into +DIR/bin/quux, not DIR/bin/foo/quux. The "foo/" prefix is stripped +so that you can add DIR/bin to your PATH to get at the +installed commands. If the GOBIN environment variable is +set, commands are installed to the directory it names instead +of DIR/bin. + +Here's an example directory layout: + + GOPATH=/home/user/gocode + + /home/user/gocode/ + src/ + foo/ + bar/ (go code in package bar) + x.go + quux/ (go code in package main) + y.go + bin/ + quux (installed command) + pkg/ + linux_amd64/ + foo/ + bar.a (installed package object) + +Go searches each directory listed in GOPATH to find source code, +but new packages are always downloaded into the first directory +in the list. + +See https://golang.org/doc/code.html for an example. + +Internal Directories + +Code in or below a directory named "internal" is importable only +by code in the directory tree rooted at the parent of "internal". +Here's an extended version of the directory layout above: + + /home/user/gocode/ + src/ + crash/ + bang/ (go code in package bang) + b.go + foo/ (go code in package foo) + f.go + bar/ (go code in package bar) + x.go + internal/ + baz/ (go code in package baz) + z.go + quux/ (go code in package main) + y.go + + +The code in z.go is imported as "foo/internal/baz", but that +import statement can only appear in source files in the subtree +rooted at foo. The source files foo/f.go, foo/bar/x.go, and +foo/quux/y.go can all import "foo/internal/baz", but the source file +crash/bang/b.go cannot. + +See https://golang.org/s/go14internal for details. + +Vendor Directories + +Go 1.5 includes experimental support for using local copies +of external dependencies to satisfy imports of those dependencies, +often referred to as vendoring. Setting the environment variable +GO15VENDOREXPERIMENT=1 enables that experimental support. + +When the vendor experiment is enabled, +code below a directory named "vendor" is importable only +by code in the directory tree rooted at the parent of "vendor", +and only using an import path that omits the prefix up to and +including the vendor element. + +Here's the example from the previous section, +but with the "internal" directory renamed to "vendor" +and a new foo/vendor/crash/bang directory added: + + /home/user/gocode/ + src/ + crash/ + bang/ (go code in package bang) + b.go + foo/ (go code in package foo) + f.go + bar/ (go code in package bar) + x.go + vendor/ + crash/ + bang/ (go code in package bang) + b.go + baz/ (go code in package baz) + z.go + quux/ (go code in package main) + y.go + +The same visibility rules apply as for internal, but the code +in z.go is imported as "baz", not as "foo/vendor/baz". + +Code in vendor directories deeper in the source tree shadows +code in higher directories. Within the subtree rooted at foo, an import +of "crash/bang" resolves to "foo/vendor/crash/bang", not the +top-level "crash/bang". + +Code in vendor directories is not subject to import path +checking (see 'go help importpath'). + +When the vendor experiment is enabled, 'go get' checks out +submodules when checking out or updating a git repository +(see 'go help get'). + +The vendoring semantics are an experiment, and they may change +in future releases. Once settled, they will be on by default. + +See https://golang.org/s/go15vendor for details. + `, +} + +var helpEnvironment = &Command{ + UsageLine: "environment", + Short: "environment variables", + Long: ` + +The go command, and the tools it invokes, examine a few different +environment variables. For many of these, you can see the default +value of on your system by running 'go env NAME', where NAME is the +name of the variable. + +General-purpose environment variables: + + GCCGO + The gccgo command to run for 'go build -compiler=gccgo'. + GOARCH + The architecture, or processor, for which to compile code. + Examples are amd64, 386, arm, ppc64. + GOBIN + The directory where 'go install' will install a command. + GOOS + The operating system for which to compile code. + Examples are linux, darwin, windows, netbsd. + GOPATH + See 'go help gopath'. + GORACE + Options for the race detector. + See https://golang.org/doc/articles/race_detector.html. + GOROOT + The root of the go tree. + +Environment variables for use with cgo: + + CC + The command to use to compile C code. + CGO_ENABLED + Whether the cgo command is supported. Either 0 or 1. + CGO_CFLAGS + Flags that cgo will pass to the compiler when compiling + C code. + CGO_CPPFLAGS + Flags that cgo will pass to the compiler when compiling + C or C++ code. + CGO_CXXFLAGS + Flags that cgo will pass to the compiler when compiling + C++ code. + CGO_LDFLAGS + Flags that cgo will pass to the compiler when linking. + CXX + The command to use to compile C++ code. + +Architecture-specific environment variables: + + GOARM + For GOARCH=arm, the ARM architecture for which to compile. + Valid values are 5, 6, 7. + GO386 + For GOARCH=386, the floating point instruction set. + Valid values are 387, sse2. + +Special-purpose environment variables: + + GOROOT_FINAL + The root of the installed Go tree, when it is + installed in a location other than where it is built. + File names in stack traces are rewritten from GOROOT to + GOROOT_FINAL. + GO15VENDOREXPERIMENT + Set to 1 to enable the Go 1.5 vendoring experiment. + GO_EXTLINK_ENABLED + Whether the linker should use external linking mode + when using -linkmode=auto with code that uses cgo. + Set to 0 to disable external linking mode, 1 to enable it. + `, +} + +var helpFileType = &Command{ + UsageLine: "filetype", + Short: "file types", + Long: ` +The go command examines the contents of a restricted set of files +in each directory. It identifies which files to examine based on +the extension of the file name. These extensions are: + + .go + Go source files. + .c, .h + C source files. + If the package uses cgo or SWIG, these will be compiled with the + OS-native compiler (typically gcc); otherwise they will + trigger an error. + .cc, .cpp, .cxx, .hh, .hpp, .hxx + C++ source files. Only useful with cgo or SWIG, and always + compiled with the OS-native compiler. + .m + Objective-C source files. Only useful with cgo, and always + compiled with the OS-native compiler. + .s, .S + Assembler source files. + If the package uses cgo or SWIG, these will be assembled with the + OS-native assembler (typically gcc (sic)); otherwise they + will be assembled with the Go assembler. + .swig, .swigcxx + SWIG definition files. + .syso + System object files. + +Files of each of these types except .syso may contain build +constraints, but the go command stops scanning for build constraints +at the first item in the file that is not a blank line or //-style +line comment. + `, +} + +var helpBuildmode = &Command{ + UsageLine: "buildmode", + Short: "description of build modes", + Long: ` +The 'go build' and 'go install' commands take a -buildmode argument which +indicates which kind of object file is to be built. Currently supported values +are: + + -buildmode=archive + Build the listed non-main packages into .a files. Packages named + main are ignored. + + -buildmode=c-archive + Build the listed main package, plus all packages it imports, + into a C archive file. The only callable symbols will be those + functions exported using a cgo //export comment. Requires + exactly one main package to be listed. + + -buildmode=c-shared + Build the listed main packages, plus all packages that they + import, into C shared libraries. The only callable symbols will + be those functions exported using a cgo //export comment. + Non-main packages are ignored. + + -buildmode=default + Listed main packages are built into executables and listed + non-main packages are built into .a files (the default + behavior). + + -buildmode=shared + Combine all the listed non-main packages into a single shared + library that will be used when building with the -linkshared + option. Packages named main are ignored. + + -buildmode=exe + Build the listed main packages and everything they import into + executables. Packages not named main are ignored. +`, +} diff --git a/src/cmd/go/http.go b/src/cmd/go/http.go new file mode 100644 index 0000000000000000000000000000000000000000..7979c41b11bae8a59a68eb23d1f184009fd0aa4f --- /dev/null +++ b/src/cmd/go/http.go @@ -0,0 +1,109 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build !cmd_go_bootstrap + +// This code is compiled into the real 'go' binary, but it is not +// compiled into the binary that is built during all.bash, so as +// to avoid needing to build net (and thus use cgo) during the +// bootstrap process. + +package main + +import ( + "fmt" + "io" + "io/ioutil" + "log" + "net/http" + "net/url" + "time" +) + +// httpClient is the default HTTP client, but a variable so it can be +// changed by tests, without modifying http.DefaultClient. +var httpClient = http.DefaultClient +var impatientHTTPClient = &http.Client{ + Timeout: time.Duration(5 * time.Second), +} + +type httpError struct { + status string + statusCode int + url string +} + +func (e *httpError) Error() string { + return fmt.Sprintf("%s: %s", e.url, e.status) +} + +// httpGET returns the data from an HTTP GET request for the given URL. +func httpGET(url string) ([]byte, error) { + resp, err := httpClient.Get(url) + if err != nil { + return nil, err + } + defer resp.Body.Close() + if resp.StatusCode != 200 { + err := &httpError{status: resp.Status, statusCode: resp.StatusCode, url: url} + + return nil, err + } + b, err := ioutil.ReadAll(resp.Body) + if err != nil { + return nil, fmt.Errorf("%s: %v", url, err) + } + return b, nil +} + +// httpsOrHTTP returns the body of either the importPath's +// https resource or, if unavailable, the http resource. +func httpsOrHTTP(importPath string, security securityMode) (urlStr string, body io.ReadCloser, err error) { + fetch := func(scheme string) (urlStr string, res *http.Response, err error) { + u, err := url.Parse(scheme + "://" + importPath) + if err != nil { + return "", nil, err + } + u.RawQuery = "go-get=1" + urlStr = u.String() + if buildV { + log.Printf("Fetching %s", urlStr) + } + if security == insecure && scheme == "https" { // fail earlier + res, err = impatientHTTPClient.Get(urlStr) + } else { + res, err = httpClient.Get(urlStr) + } + return + } + closeBody := func(res *http.Response) { + if res != nil { + res.Body.Close() + } + } + urlStr, res, err := fetch("https") + if err != nil || res.StatusCode != 200 { + if buildV { + if err != nil { + log.Printf("https fetch failed.") + } else { + log.Printf("ignoring https fetch with status code %d", res.StatusCode) + } + } + closeBody(res) + if security == insecure { + urlStr, res, err = fetch("http") + } + } + if err != nil { + closeBody(res) + return "", nil, err + } + // Note: accepting a non-200 OK here, so people can serve a + // meta import in their http 404 page. + if buildV { + log.Printf("Parsing meta tags from %s (status code %d)", urlStr, res.StatusCode) + } + return urlStr, res.Body, nil +} diff --git a/src/cmd/go/list.go b/src/cmd/go/list.go new file mode 100644 index 0000000000000000000000000000000000000000..35c7cc4f2a73a8168570695625c88f6a2b56700e --- /dev/null +++ b/src/cmd/go/list.go @@ -0,0 +1,216 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +import ( + "bufio" + "encoding/json" + "io" + "os" + "strings" + "text/template" +) + +var cmdList = &Command{ + UsageLine: "list [-e] [-f format] [-json] [build flags] [packages]", + Short: "list packages", + Long: ` +List lists the packages named by the import paths, one per line. + +The default output shows the package import path: + + bytes + encoding/json + github.com/gorilla/mux + golang.org/x/net/html + +The -f flag specifies an alternate format for the list, using the +syntax of package template. The default output is equivalent to -f +'{{.ImportPath}}'. The struct being passed to the template is: + + type Package struct { + Dir string // directory containing package sources + ImportPath string // import path of package in dir + ImportComment string // path in import comment on package statement + Name string // package name + Doc string // package documentation string + Target string // install path + Shlib string // the shared library that contains this package (only set when -linkshared) + Goroot bool // is this package in the Go root? + Standard bool // is this package part of the standard Go library? + Stale bool // would 'go install' do anything for this package? + Root string // Go root or Go path dir containing this package + + // Source files + GoFiles []string // .go source files (excluding CgoFiles, TestGoFiles, XTestGoFiles) + CgoFiles []string // .go sources files that import "C" + IgnoredGoFiles []string // .go sources ignored due to build constraints + CFiles []string // .c source files + CXXFiles []string // .cc, .cxx and .cpp source files + MFiles []string // .m source files + HFiles []string // .h, .hh, .hpp and .hxx source files + SFiles []string // .s source files + SwigFiles []string // .swig files + SwigCXXFiles []string // .swigcxx files + SysoFiles []string // .syso object files to add to archive + + // Cgo directives + CgoCFLAGS []string // cgo: flags for C compiler + CgoCPPFLAGS []string // cgo: flags for C preprocessor + CgoCXXFLAGS []string // cgo: flags for C++ compiler + CgoLDFLAGS []string // cgo: flags for linker + CgoPkgConfig []string // cgo: pkg-config names + + // Dependency information + Imports []string // import paths used by this package + Deps []string // all (recursively) imported dependencies + + // Error information + Incomplete bool // this package or a dependency has an error + Error *PackageError // error loading package + DepsErrors []*PackageError // errors loading dependencies + + TestGoFiles []string // _test.go files in package + TestImports []string // imports from TestGoFiles + XTestGoFiles []string // _test.go files outside package + XTestImports []string // imports from XTestGoFiles + } + +The template function "join" calls strings.Join. + +The template function "context" returns the build context, defined as: + + type Context struct { + GOARCH string // target architecture + GOOS string // target operating system + GOROOT string // Go root + GOPATH string // Go path + CgoEnabled bool // whether cgo can be used + UseAllFiles bool // use files regardless of +build lines, file names + Compiler string // compiler to assume when computing target paths + BuildTags []string // build constraints to match in +build lines + ReleaseTags []string // releases the current release is compatible with + InstallSuffix string // suffix to use in the name of the install dir + } + +For more information about the meaning of these fields see the documentation +for the go/build package's Context type. + +The -json flag causes the package data to be printed in JSON format +instead of using the template format. + +The -e flag changes the handling of erroneous packages, those that +cannot be found or are malformed. By default, the list command +prints an error to standard error for each erroneous package and +omits the packages from consideration during the usual printing. +With the -e flag, the list command never prints errors to standard +error and instead processes the erroneous packages with the usual +printing. Erroneous packages will have a non-empty ImportPath and +a non-nil Error field; other information may or may not be missing +(zeroed). + +For more about build flags, see 'go help build'. + +For more about specifying packages, see 'go help packages'. + `, +} + +func init() { + cmdList.Run = runList // break init cycle + addBuildFlags(cmdList) +} + +var listE = cmdList.Flag.Bool("e", false, "") +var listFmt = cmdList.Flag.String("f", "{{.ImportPath}}", "") +var listJson = cmdList.Flag.Bool("json", false, "") +var nl = []byte{'\n'} + +func runList(cmd *Command, args []string) { + buildModeInit() + out := newTrackingWriter(os.Stdout) + defer out.w.Flush() + + var do func(*Package) + if *listJson { + do = func(p *Package) { + b, err := json.MarshalIndent(p, "", "\t") + if err != nil { + out.Flush() + fatalf("%s", err) + } + out.Write(b) + out.Write(nl) + } + } else { + var cachedCtxt *Context + context := func() *Context { + if cachedCtxt == nil { + cachedCtxt = newContext(&buildContext) + } + return cachedCtxt + } + fm := template.FuncMap{ + "join": strings.Join, + "context": context, + } + tmpl, err := template.New("main").Funcs(fm).Parse(*listFmt) + if err != nil { + fatalf("%s", err) + } + do = func(p *Package) { + if err := tmpl.Execute(out, p); err != nil { + out.Flush() + fatalf("%s", err) + } + if out.NeedNL() { + out.Write(nl) + } + } + } + + load := packages + if *listE { + load = packagesAndErrors + } + + for _, pkg := range load(args) { + // Show vendor-expanded paths in listing + pkg.TestImports = pkg.vendored(pkg.TestImports) + pkg.XTestImports = pkg.vendored(pkg.XTestImports) + + do(pkg) + } +} + +// TrackingWriter tracks the last byte written on every write so +// we can avoid printing a newline if one was already written or +// if there is no output at all. +type TrackingWriter struct { + w *bufio.Writer + last byte +} + +func newTrackingWriter(w io.Writer) *TrackingWriter { + return &TrackingWriter{ + w: bufio.NewWriter(w), + last: '\n', + } +} + +func (t *TrackingWriter) Write(p []byte) (n int, err error) { + n, err = t.w.Write(p) + if n > 0 { + t.last = p[n-1] + } + return +} + +func (t *TrackingWriter) Flush() { + t.w.Flush() +} + +func (t *TrackingWriter) NeedNL() bool { + return t.last != '\n' +} diff --git a/src/cmd/go/main.go b/src/cmd/go/main.go new file mode 100644 index 0000000000000000000000000000000000000000..8ebde8925990dc5a4ad1f19a7da298d20302fd8b --- /dev/null +++ b/src/cmd/go/main.go @@ -0,0 +1,761 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +import ( + "bufio" + "bytes" + "flag" + "fmt" + "go/build" + "io" + "log" + "os" + "os/exec" + "path" + "path/filepath" + "regexp" + "runtime" + "strings" + "sync" + "text/template" + "unicode" + "unicode/utf8" +) + +// A Command is an implementation of a go command +// like go build or go fix. +type Command struct { + // Run runs the command. + // The args are the arguments after the command name. + Run func(cmd *Command, args []string) + + // UsageLine is the one-line usage message. + // The first word in the line is taken to be the command name. + UsageLine string + + // Short is the short description shown in the 'go help' output. + Short string + + // Long is the long message shown in the 'go help ' output. + Long string + + // Flag is a set of flags specific to this command. + Flag flag.FlagSet + + // CustomFlags indicates that the command will do its own + // flag parsing. + CustomFlags bool +} + +// Name returns the command's name: the first word in the usage line. +func (c *Command) Name() string { + name := c.UsageLine + i := strings.Index(name, " ") + if i >= 0 { + name = name[:i] + } + return name +} + +func (c *Command) Usage() { + fmt.Fprintf(os.Stderr, "usage: %s\n\n", c.UsageLine) + fmt.Fprintf(os.Stderr, "%s\n", strings.TrimSpace(c.Long)) + os.Exit(2) +} + +// Runnable reports whether the command can be run; otherwise +// it is a documentation pseudo-command such as importpath. +func (c *Command) Runnable() bool { + return c.Run != nil +} + +// Commands lists the available commands and help topics. +// The order here is the order in which they are printed by 'go help'. +var commands = []*Command{ + cmdBuild, + cmdClean, + cmdDoc, + cmdEnv, + cmdFix, + cmdFmt, + cmdGenerate, + cmdGet, + cmdInstall, + cmdList, + cmdRun, + cmdTest, + cmdTool, + cmdVersion, + cmdVet, + + helpC, + helpBuildmode, + helpFileType, + helpGopath, + helpEnvironment, + helpImportPath, + helpPackages, + helpTestflag, + helpTestfunc, +} + +var exitStatus = 0 +var exitMu sync.Mutex + +func setExitStatus(n int) { + exitMu.Lock() + if exitStatus < n { + exitStatus = n + } + exitMu.Unlock() +} + +var origEnv []string + +func main() { + _ = go11tag + flag.Usage = usage + flag.Parse() + log.SetFlags(0) + + args := flag.Args() + if len(args) < 1 { + usage() + } + + if args[0] == "help" { + help(args[1:]) + return + } + + // Diagnose common mistake: GOPATH==GOROOT. + // This setting is equivalent to not setting GOPATH at all, + // which is not what most people want when they do it. + if gopath := os.Getenv("GOPATH"); gopath == runtime.GOROOT() { + fmt.Fprintf(os.Stderr, "warning: GOPATH set to GOROOT (%s) has no effect\n", gopath) + } else { + for _, p := range filepath.SplitList(gopath) { + // Note: using HasPrefix instead of Contains because a ~ can appear + // in the middle of directory elements, such as /tmp/git-1.8.2~rc3 + // or C:\PROGRA~1. Only ~ as a path prefix has meaning to the shell. + if strings.HasPrefix(p, "~") { + fmt.Fprintf(os.Stderr, "go: GOPATH entry cannot start with shell metacharacter '~': %q\n", p) + os.Exit(2) + } + if !filepath.IsAbs(p) { + fmt.Fprintf(os.Stderr, "go: GOPATH entry is relative; must be absolute path: %q.\nRun 'go help gopath' for usage.\n", p) + os.Exit(2) + } + } + } + + if fi, err := os.Stat(goroot); err != nil || !fi.IsDir() { + fmt.Fprintf(os.Stderr, "go: cannot find GOROOT directory: %v\n", goroot) + os.Exit(2) + } + + // Set environment (GOOS, GOARCH, etc) explicitly. + // In theory all the commands we invoke should have + // the same default computation of these as we do, + // but in practice there might be skew + // This makes sure we all agree. + origEnv = os.Environ() + for _, env := range mkEnv() { + if os.Getenv(env.name) != env.value { + os.Setenv(env.name, env.value) + } + } + + for _, cmd := range commands { + if cmd.Name() == args[0] && cmd.Runnable() { + cmd.Flag.Usage = func() { cmd.Usage() } + if cmd.CustomFlags { + args = args[1:] + } else { + cmd.Flag.Parse(args[1:]) + args = cmd.Flag.Args() + } + cmd.Run(cmd, args) + exit() + return + } + } + + fmt.Fprintf(os.Stderr, "go: unknown subcommand %q\nRun 'go help' for usage.\n", args[0]) + setExitStatus(2) + exit() +} + +var usageTemplate = `Go is a tool for managing Go source code. + +Usage: + + go command [arguments] + +The commands are: +{{range .}}{{if .Runnable}} + {{.Name | printf "%-11s"}} {{.Short}}{{end}}{{end}} + +Use "go help [command]" for more information about a command. + +Additional help topics: +{{range .}}{{if not .Runnable}} + {{.Name | printf "%-11s"}} {{.Short}}{{end}}{{end}} + +Use "go help [topic]" for more information about that topic. + +` + +var helpTemplate = `{{if .Runnable}}usage: go {{.UsageLine}} + +{{end}}{{.Long | trim}} +` + +var documentationTemplate = `// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// DO NOT EDIT THIS FILE. GENERATED BY mkalldocs.sh. +// Edit the documentation in other files and rerun mkalldocs.sh to generate this one. + +/* +{{range .}}{{if .Short}}{{.Short | capitalize}} + +{{end}}{{if .Runnable}}Usage: + + go {{.UsageLine}} + +{{end}}{{.Long | trim}} + + +{{end}}*/ +package main +` + +// An errWriter wraps a writer, recording whether a write error occurred. +type errWriter struct { + w io.Writer + err error +} + +func (w *errWriter) Write(b []byte) (int, error) { + n, err := w.w.Write(b) + if err != nil { + w.err = err + } + return n, err +} + +// tmpl executes the given template text on data, writing the result to w. +func tmpl(w io.Writer, text string, data interface{}) { + t := template.New("top") + t.Funcs(template.FuncMap{"trim": strings.TrimSpace, "capitalize": capitalize}) + template.Must(t.Parse(text)) + ew := &errWriter{w: w} + err := t.Execute(ew, data) + if ew.err != nil { + // I/O error writing. Ignore write on closed pipe. + if strings.Contains(ew.err.Error(), "pipe") { + os.Exit(1) + } + fatalf("writing output: %v", ew.err) + } + if err != nil { + panic(err) + } +} + +func capitalize(s string) string { + if s == "" { + return s + } + r, n := utf8.DecodeRuneInString(s) + return string(unicode.ToTitle(r)) + s[n:] +} + +func printUsage(w io.Writer) { + bw := bufio.NewWriter(w) + tmpl(bw, usageTemplate, commands) + bw.Flush() +} + +func usage() { + // special case "go test -h" + if len(os.Args) > 1 && os.Args[1] == "test" { + os.Stdout.WriteString(testUsage + "\n\n" + + strings.TrimSpace(testFlag1) + "\n\n" + + strings.TrimSpace(testFlag2) + "\n") + os.Exit(2) + } + printUsage(os.Stderr) + os.Exit(2) +} + +// help implements the 'help' command. +func help(args []string) { + if len(args) == 0 { + printUsage(os.Stdout) + // not exit 2: succeeded at 'go help'. + return + } + if len(args) != 1 { + fmt.Fprintf(os.Stderr, "usage: go help command\n\nToo many arguments given.\n") + os.Exit(2) // failed at 'go help' + } + + arg := args[0] + + // 'go help documentation' generates doc.go. + if arg == "documentation" { + buf := new(bytes.Buffer) + printUsage(buf) + usage := &Command{Long: buf.String()} + tmpl(os.Stdout, documentationTemplate, append([]*Command{usage}, commands...)) + return + } + + for _, cmd := range commands { + if cmd.Name() == arg { + tmpl(os.Stdout, helpTemplate, cmd) + // not exit 2: succeeded at 'go help cmd'. + return + } + } + + fmt.Fprintf(os.Stderr, "Unknown help topic %#q. Run 'go help'.\n", arg) + os.Exit(2) // failed at 'go help cmd' +} + +// importPathsNoDotExpansion returns the import paths to use for the given +// command line, but it does no ... expansion. +func importPathsNoDotExpansion(args []string) []string { + if len(args) == 0 { + return []string{"."} + } + var out []string + for _, a := range args { + // Arguments are supposed to be import paths, but + // as a courtesy to Windows developers, rewrite \ to / + // in command-line arguments. Handles .\... and so on. + if filepath.Separator == '\\' { + a = strings.Replace(a, `\`, `/`, -1) + } + + // Put argument in canonical form, but preserve leading ./. + if strings.HasPrefix(a, "./") { + a = "./" + path.Clean(a) + if a == "./." { + a = "." + } + } else { + a = path.Clean(a) + } + if a == "all" || a == "std" || a == "cmd" { + out = append(out, allPackages(a)...) + continue + } + out = append(out, a) + } + return out +} + +// importPaths returns the import paths to use for the given command line. +func importPaths(args []string) []string { + args = importPathsNoDotExpansion(args) + var out []string + for _, a := range args { + if strings.Contains(a, "...") { + if build.IsLocalImport(a) { + out = append(out, allPackagesInFS(a)...) + } else { + out = append(out, allPackages(a)...) + } + continue + } + out = append(out, a) + } + return out +} + +var atexitFuncs []func() + +func atexit(f func()) { + atexitFuncs = append(atexitFuncs, f) +} + +func exit() { + for _, f := range atexitFuncs { + f() + } + os.Exit(exitStatus) +} + +func fatalf(format string, args ...interface{}) { + errorf(format, args...) + exit() +} + +func errorf(format string, args ...interface{}) { + log.Printf(format, args...) + setExitStatus(1) +} + +var logf = log.Printf + +func exitIfErrors() { + if exitStatus != 0 { + exit() + } +} + +func run(cmdargs ...interface{}) { + cmdline := stringList(cmdargs...) + if buildN || buildX { + fmt.Printf("%s\n", strings.Join(cmdline, " ")) + if buildN { + return + } + } + + cmd := exec.Command(cmdline[0], cmdline[1:]...) + cmd.Stdout = os.Stdout + cmd.Stderr = os.Stderr + if err := cmd.Run(); err != nil { + errorf("%v", err) + } +} + +func runOut(dir string, cmdargs ...interface{}) []byte { + cmdline := stringList(cmdargs...) + cmd := exec.Command(cmdline[0], cmdline[1:]...) + cmd.Dir = dir + out, err := cmd.CombinedOutput() + if err != nil { + os.Stderr.Write(out) + errorf("%v", err) + out = nil + } + return out +} + +// envForDir returns a copy of the environment +// suitable for running in the given directory. +// The environment is the current process's environment +// but with an updated $PWD, so that an os.Getwd in the +// child will be faster. +func envForDir(dir string, base []string) []string { + // Internally we only use rooted paths, so dir is rooted. + // Even if dir is not rooted, no harm done. + return mergeEnvLists([]string{"PWD=" + dir}, base) +} + +// mergeEnvLists merges the two environment lists such that +// variables with the same name in "in" replace those in "out". +func mergeEnvLists(in, out []string) []string { +NextVar: + for _, inkv := range in { + k := strings.SplitAfterN(inkv, "=", 2)[0] + for i, outkv := range out { + if strings.HasPrefix(outkv, k) { + out[i] = inkv + continue NextVar + } + } + out = append(out, inkv) + } + return out +} + +// matchPattern(pattern)(name) reports whether +// name matches pattern. Pattern is a limited glob +// pattern in which '...' means 'any string' and there +// is no other special syntax. +func matchPattern(pattern string) func(name string) bool { + re := regexp.QuoteMeta(pattern) + re = strings.Replace(re, `\.\.\.`, `.*`, -1) + // Special case: foo/... matches foo too. + if strings.HasSuffix(re, `/.*`) { + re = re[:len(re)-len(`/.*`)] + `(/.*)?` + } + reg := regexp.MustCompile(`^` + re + `$`) + return func(name string) bool { + return reg.MatchString(name) + } +} + +// hasPathPrefix reports whether the path s begins with the +// elements in prefix. +func hasPathPrefix(s, prefix string) bool { + switch { + default: + return false + case len(s) == len(prefix): + return s == prefix + case len(s) > len(prefix): + if prefix != "" && prefix[len(prefix)-1] == '/' { + return strings.HasPrefix(s, prefix) + } + return s[len(prefix)] == '/' && s[:len(prefix)] == prefix + } +} + +// hasFilePathPrefix reports whether the filesystem path s begins with the +// elements in prefix. +func hasFilePathPrefix(s, prefix string) bool { + sv := strings.ToUpper(filepath.VolumeName(s)) + pv := strings.ToUpper(filepath.VolumeName(prefix)) + s = s[len(sv):] + prefix = prefix[len(pv):] + switch { + default: + return false + case sv != pv: + return false + case len(s) == len(prefix): + return s == prefix + case len(s) > len(prefix): + if prefix != "" && prefix[len(prefix)-1] == filepath.Separator { + return strings.HasPrefix(s, prefix) + } + return s[len(prefix)] == filepath.Separator && s[:len(prefix)] == prefix + } +} + +// treeCanMatchPattern(pattern)(name) reports whether +// name or children of name can possibly match pattern. +// Pattern is the same limited glob accepted by matchPattern. +func treeCanMatchPattern(pattern string) func(name string) bool { + wildCard := false + if i := strings.Index(pattern, "..."); i >= 0 { + wildCard = true + pattern = pattern[:i] + } + return func(name string) bool { + return len(name) <= len(pattern) && hasPathPrefix(pattern, name) || + wildCard && strings.HasPrefix(name, pattern) + } +} + +// allPackages returns all the packages that can be found +// under the $GOPATH directories and $GOROOT matching pattern. +// The pattern is either "all" (all packages), "std" (standard packages), +// "cmd" (standard commands), or a path including "...". +func allPackages(pattern string) []string { + pkgs := matchPackages(pattern) + if len(pkgs) == 0 { + fmt.Fprintf(os.Stderr, "warning: %q matched no packages\n", pattern) + } + return pkgs +} + +func matchPackages(pattern string) []string { + match := func(string) bool { return true } + treeCanMatch := func(string) bool { return true } + if pattern != "all" && pattern != "std" && pattern != "cmd" { + match = matchPattern(pattern) + treeCanMatch = treeCanMatchPattern(pattern) + } + + have := map[string]bool{ + "builtin": true, // ignore pseudo-package that exists only for documentation + } + if !buildContext.CgoEnabled { + have["runtime/cgo"] = true // ignore during walk + } + var pkgs []string + + for _, src := range buildContext.SrcDirs() { + if (pattern == "std" || pattern == "cmd") && src != gorootSrc { + continue + } + src = filepath.Clean(src) + string(filepath.Separator) + root := src + if pattern == "cmd" { + root += "cmd" + string(filepath.Separator) + } + filepath.Walk(root, func(path string, fi os.FileInfo, err error) error { + if err != nil || !fi.IsDir() || path == src { + return nil + } + + // Avoid .foo, _foo, and testdata directory trees. + _, elem := filepath.Split(path) + if strings.HasPrefix(elem, ".") || strings.HasPrefix(elem, "_") || elem == "testdata" { + return filepath.SkipDir + } + + name := filepath.ToSlash(path[len(src):]) + if pattern == "std" && (strings.Contains(name, ".") || name == "cmd") { + // The name "std" is only the standard library. + // If the name has a dot, assume it's a domain name for go get, + // and if the name is cmd, it's the root of the command tree. + return filepath.SkipDir + } + if !treeCanMatch(name) { + return filepath.SkipDir + } + if have[name] { + return nil + } + have[name] = true + if !match(name) { + return nil + } + _, err = buildContext.ImportDir(path, 0) + if err != nil { + if _, noGo := err.(*build.NoGoError); noGo { + return nil + } + } + pkgs = append(pkgs, name) + return nil + }) + } + return pkgs +} + +// allPackagesInFS is like allPackages but is passed a pattern +// beginning ./ or ../, meaning it should scan the tree rooted +// at the given directory. There are ... in the pattern too. +func allPackagesInFS(pattern string) []string { + pkgs := matchPackagesInFS(pattern) + if len(pkgs) == 0 { + fmt.Fprintf(os.Stderr, "warning: %q matched no packages\n", pattern) + } + return pkgs +} + +func matchPackagesInFS(pattern string) []string { + // Find directory to begin the scan. + // Could be smarter but this one optimization + // is enough for now, since ... is usually at the + // end of a path. + i := strings.Index(pattern, "...") + dir, _ := path.Split(pattern[:i]) + + // pattern begins with ./ or ../. + // path.Clean will discard the ./ but not the ../. + // We need to preserve the ./ for pattern matching + // and in the returned import paths. + prefix := "" + if strings.HasPrefix(pattern, "./") { + prefix = "./" + } + match := matchPattern(pattern) + + var pkgs []string + filepath.Walk(dir, func(path string, fi os.FileInfo, err error) error { + if err != nil || !fi.IsDir() { + return nil + } + if path == dir { + // filepath.Walk starts at dir and recurses. For the recursive case, + // the path is the result of filepath.Join, which calls filepath.Clean. + // The initial case is not Cleaned, though, so we do this explicitly. + // + // This converts a path like "./io/" to "io". Without this step, running + // "cd $GOROOT/src; go list ./io/..." would incorrectly skip the io + // package, because prepending the prefix "./" to the unclean path would + // result in "././io", and match("././io") returns false. + path = filepath.Clean(path) + } + + // Avoid .foo, _foo, and testdata directory trees, but do not avoid "." or "..". + _, elem := filepath.Split(path) + dot := strings.HasPrefix(elem, ".") && elem != "." && elem != ".." + if dot || strings.HasPrefix(elem, "_") || elem == "testdata" { + return filepath.SkipDir + } + + name := prefix + filepath.ToSlash(path) + if !match(name) { + return nil + } + if _, err = build.ImportDir(path, 0); err != nil { + if _, noGo := err.(*build.NoGoError); !noGo { + log.Print(err) + } + return nil + } + pkgs = append(pkgs, name) + return nil + }) + return pkgs +} + +// stringList's arguments should be a sequence of string or []string values. +// stringList flattens them into a single []string. +func stringList(args ...interface{}) []string { + var x []string + for _, arg := range args { + switch arg := arg.(type) { + case []string: + x = append(x, arg...) + case string: + x = append(x, arg) + default: + panic("stringList: invalid argument of type " + fmt.Sprintf("%T", arg)) + } + } + return x +} + +// toFold returns a string with the property that +// strings.EqualFold(s, t) iff toFold(s) == toFold(t) +// This lets us test a large set of strings for fold-equivalent +// duplicates without making a quadratic number of calls +// to EqualFold. Note that strings.ToUpper and strings.ToLower +// have the desired property in some corner cases. +func toFold(s string) string { + // Fast path: all ASCII, no upper case. + // Most paths look like this already. + for i := 0; i < len(s); i++ { + c := s[i] + if c >= utf8.RuneSelf || 'A' <= c && c <= 'Z' { + goto Slow + } + } + return s + +Slow: + var buf bytes.Buffer + for _, r := range s { + // SimpleFold(x) cycles to the next equivalent rune > x + // or wraps around to smaller values. Iterate until it wraps, + // and we've found the minimum value. + for { + r0 := r + r = unicode.SimpleFold(r0) + if r <= r0 { + break + } + } + // Exception to allow fast path above: A-Z => a-z + if 'A' <= r && r <= 'Z' { + r += 'a' - 'A' + } + buf.WriteRune(r) + } + return buf.String() +} + +// foldDup reports a pair of strings from the list that are +// equal according to strings.EqualFold. +// It returns "", "" if there are no such strings. +func foldDup(list []string) (string, string) { + clash := map[string]string{} + for _, s := range list { + fold := toFold(s) + if t := clash[fold]; t != "" { + if s > t { + s, t = t, s + } + return s, t + } + clash[fold] = s + } + return "", "" +} diff --git a/src/cmd/go/match_test.go b/src/cmd/go/match_test.go new file mode 100644 index 0000000000000000000000000000000000000000..38b9b115e7c0be2f093595f4e977067f6ef8f826 --- /dev/null +++ b/src/cmd/go/match_test.go @@ -0,0 +1,88 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +import "testing" + +var matchPatternTests = []stringPairTest{ + {"...", "foo", true}, + {"net", "net", true}, + {"net", "net/http", false}, + {"net/http", "net", false}, + {"net/http", "net/http", true}, + {"net...", "netchan", true}, + {"net...", "net", true}, + {"net...", "net/http", true}, + {"net...", "not/http", false}, + {"net/...", "netchan", false}, + {"net/...", "net", true}, + {"net/...", "net/http", true}, + {"net/...", "not/http", false}, +} + +func TestMatchPattern(t *testing.T) { + testStringPairs(t, "matchPattern", matchPatternTests, func(pattern, name string) bool { + return matchPattern(pattern)(name) + }) +} + +var treeCanMatchPatternTests = []stringPairTest{ + {"...", "foo", true}, + {"net", "net", true}, + {"net", "net/http", false}, + {"net/http", "net", true}, + {"net/http", "net/http", true}, + {"net...", "netchan", true}, + {"net...", "net", true}, + {"net...", "net/http", true}, + {"net...", "not/http", false}, + {"net/...", "netchan", false}, + {"net/...", "net", true}, + {"net/...", "net/http", true}, + {"net/...", "not/http", false}, + {"abc.../def", "abcxyz", true}, + {"abc.../def", "xyxabc", false}, + {"x/y/z/...", "x", true}, + {"x/y/z/...", "x/y", true}, + {"x/y/z/...", "x/y/z", true}, + {"x/y/z/...", "x/y/z/w", true}, + {"x/y/z", "x", true}, + {"x/y/z", "x/y", true}, + {"x/y/z", "x/y/z", true}, + {"x/y/z", "x/y/z/w", false}, + {"x/.../y/z", "x/a/b/c", true}, + {"x/.../y/z", "y/x/a/b/c", false}, +} + +func TestChildrenCanMatchPattern(t *testing.T) { + testStringPairs(t, "treeCanMatchPattern", treeCanMatchPatternTests, func(pattern, name string) bool { + return treeCanMatchPattern(pattern)(name) + }) +} + +var hasPathPrefixTests = []stringPairTest{ + {"abc", "a", false}, + {"a/bc", "a", true}, + {"a", "a", true}, + {"a/bc", "a/", true}, +} + +func TestHasPathPrefix(t *testing.T) { + testStringPairs(t, "hasPathPrefix", hasPathPrefixTests, hasPathPrefix) +} + +type stringPairTest struct { + in1 string + in2 string + out bool +} + +func testStringPairs(t *testing.T, name string, tests []stringPairTest, f func(string, string) bool) { + for _, tt := range tests { + if out := f(tt.in1, tt.in2); out != tt.out { + t.Errorf("%s(%q, %q) = %v, want %v", name, tt.in1, tt.in2, out, tt.out) + } + } +} diff --git a/src/cmd/go/mkalldocs.sh b/src/cmd/go/mkalldocs.sh new file mode 100755 index 0000000000000000000000000000000000000000..74e3125e657540986d099e6086125571076d6a52 --- /dev/null +++ b/src/cmd/go/mkalldocs.sh @@ -0,0 +1,12 @@ +#!/bin/bash +# Copyright 2012 The Go Authors. All rights reserved. +# Use of this source code is governed by a BSD-style +# license that can be found in the LICENSE file. + +set -e + +go build -o go.latest +./go.latest help documentation | sed 's; \*/; * /;' >alldocs.go +gofmt -w alldocs.go +rm go.latest + diff --git a/src/cmd/go/note.go b/src/cmd/go/note.go new file mode 100644 index 0000000000000000000000000000000000000000..97e18651e4acca486f3ab3383ab07b1ad872c433 --- /dev/null +++ b/src/cmd/go/note.go @@ -0,0 +1,116 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +import ( + "bytes" + "debug/elf" + "encoding/binary" + "fmt" + "io" + "os" +) + +func readAligned4(r io.Reader, sz int32) ([]byte, error) { + full := (sz + 3) &^ 3 + data := make([]byte, full) + _, err := io.ReadFull(r, data) + if err != nil { + return nil, err + } + data = data[:sz] + return data, nil +} + +func readELFNote(filename, name string, typ int32) ([]byte, error) { + f, err := elf.Open(filename) + if err != nil { + return nil, err + } + for _, sect := range f.Sections { + if sect.Type != elf.SHT_NOTE { + continue + } + r := sect.Open() + for { + var namesize, descsize, noteType int32 + err = binary.Read(r, f.ByteOrder, &namesize) + if err != nil { + if err == io.EOF { + break + } + return nil, fmt.Errorf("read namesize failed: %v", err) + } + err = binary.Read(r, f.ByteOrder, &descsize) + if err != nil { + return nil, fmt.Errorf("read descsize failed: %v", err) + } + err = binary.Read(r, f.ByteOrder, ¬eType) + if err != nil { + return nil, fmt.Errorf("read type failed: %v", err) + } + noteName, err := readAligned4(r, namesize) + if err != nil { + return nil, fmt.Errorf("read name failed: %v", err) + } + desc, err := readAligned4(r, descsize) + if err != nil { + return nil, fmt.Errorf("read desc failed: %v", err) + } + if name == string(noteName) && typ == noteType { + return desc, nil + } + } + } + return nil, nil +} + +var elfGoNote = []byte("Go\x00\x00") + +// readELFGoBuildID the Go build ID string from an ELF binary. +// The Go build ID is stored in a note described by an ELF PT_NOTE prog header. +// The caller has already opened filename, to get f, and read the first 4 kB out, in data. +func readELFGoBuildID(filename string, f *os.File, data []byte) (buildid string, err error) { + // Assume the note content is in the first 4 kB, already read. + // Rewrite the ELF header to set shnum to 0, so that we can pass + // the data to elf.NewFile and it will decode the Prog list but not + // try to read the section headers and the string table from disk. + // That's a waste of I/O when all we care about is the Prog list + // and the one ELF note. + switch elf.Class(data[elf.EI_CLASS]) { + case elf.ELFCLASS32: + data[48] = 0 + data[49] = 0 + case elf.ELFCLASS64: + data[60] = 0 + data[61] = 0 + } + + const elfGoBuildIDTag = 4 + + ef, err := elf.NewFile(bytes.NewReader(data)) + if err != nil { + return "", &os.PathError{Path: filename, Op: "parse", Err: err} + } + for _, p := range ef.Progs { + if p.Type != elf.PT_NOTE || p.Off >= uint64(len(data)) || p.Off+p.Filesz >= uint64(len(data)) || p.Filesz < 16 { + continue + } + + note := data[p.Off : p.Off+p.Filesz] + nameSize := ef.ByteOrder.Uint32(note) + valSize := ef.ByteOrder.Uint32(note[4:]) + tag := ef.ByteOrder.Uint32(note[8:]) + name := note[12:16] + if nameSize != 4 || 16+valSize > uint32(len(note)) || tag != elfGoBuildIDTag || !bytes.Equal(name, elfGoNote) { + continue + } + + return string(note[16 : 16+valSize]), nil + } + + // No note. Treat as successful but build ID empty. + return "", nil +} diff --git a/src/cmd/go/note_test.go b/src/cmd/go/note_test.go new file mode 100644 index 0000000000000000000000000000000000000000..3d644518c6897de348b57f8928f1b2e06b139769 --- /dev/null +++ b/src/cmd/go/note_test.go @@ -0,0 +1,49 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main_test + +import ( + main "cmd/go" + "runtime" + "testing" +) + +func TestNoteReading(t *testing.T) { + tg := testgo(t) + defer tg.cleanup() + tg.tempFile("hello.go", `package main; func main() { print("hello, world\n") }`) + const buildID = "TestNoteReading-Build-ID" + tg.run("build", "-ldflags", "-buildid="+buildID, "-o", tg.path("hello.exe"), tg.path("hello.go")) + id, err := main.ReadBuildIDFromBinary(tg.path("hello.exe")) + if err != nil { + t.Fatalf("reading build ID from hello binary: %v", err) + } + if id != buildID { + t.Fatalf("buildID in hello binary = %q, want %q", id, buildID) + } + + if runtime.GOOS == "linux" && runtime.GOARCH == "ppc64le" { + t.Skipf("skipping - golang.org/issue/11184") + } + + switch runtime.GOOS { + case "plan9": + // no external linking + t.Logf("no external linking - skipping linkmode=external test") + + case "solaris": + t.Logf("skipping - golang.org/issue/12178") + + default: + tg.run("build", "-ldflags", "-buildid="+buildID+" -linkmode=external", "-o", tg.path("hello.exe"), tg.path("hello.go")) + id, err := main.ReadBuildIDFromBinary(tg.path("hello.exe")) + if err != nil { + t.Fatalf("reading build ID from hello binary (linkmode=external): %v", err) + } + if id != buildID { + t.Fatalf("buildID in hello binary = %q, want %q (linkmode=external)", id, buildID) + } + } +} diff --git a/src/cmd/go/pkg.go b/src/cmd/go/pkg.go new file mode 100644 index 0000000000000000000000000000000000000000..c4817947a17fef1cae1f3a2db25143394e7b83a1 --- /dev/null +++ b/src/cmd/go/pkg.go @@ -0,0 +1,1850 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +import ( + "bytes" + "crypto/sha1" + "errors" + "fmt" + "go/build" + "go/scanner" + "go/token" + "io" + "io/ioutil" + "os" + pathpkg "path" + "path/filepath" + "runtime" + "sort" + "strconv" + "strings" + "unicode" +) + +// A Package describes a single package found in a directory. +type Package struct { + // Note: These fields are part of the go command's public API. + // See list.go. It is okay to add fields, but not to change or + // remove existing ones. Keep in sync with list.go + Dir string `json:",omitempty"` // directory containing package sources + ImportPath string `json:",omitempty"` // import path of package in dir + ImportComment string `json:",omitempty"` // path in import comment on package statement + Name string `json:",omitempty"` // package name + Doc string `json:",omitempty"` // package documentation string + Target string `json:",omitempty"` // install path + Shlib string `json:",omitempty"` // the shared library that contains this package (only set when -linkshared) + Goroot bool `json:",omitempty"` // is this package found in the Go root? + Standard bool `json:",omitempty"` // is this package part of the standard Go library? + Stale bool `json:",omitempty"` // would 'go install' do anything for this package? + Root string `json:",omitempty"` // Go root or Go path dir containing this package + ConflictDir string `json:",omitempty"` // Dir is hidden by this other directory + + // Source files + GoFiles []string `json:",omitempty"` // .go source files (excluding CgoFiles, TestGoFiles, XTestGoFiles) + CgoFiles []string `json:",omitempty"` // .go sources files that import "C" + IgnoredGoFiles []string `json:",omitempty"` // .go sources ignored due to build constraints + CFiles []string `json:",omitempty"` // .c source files + CXXFiles []string `json:",omitempty"` // .cc, .cpp and .cxx source files + MFiles []string `json:",omitempty"` // .m source files + HFiles []string `json:",omitempty"` // .h, .hh, .hpp and .hxx source files + SFiles []string `json:",omitempty"` // .s source files + SwigFiles []string `json:",omitempty"` // .swig files + SwigCXXFiles []string `json:",omitempty"` // .swigcxx files + SysoFiles []string `json:",omitempty"` // .syso system object files added to package + + // Cgo directives + CgoCFLAGS []string `json:",omitempty"` // cgo: flags for C compiler + CgoCPPFLAGS []string `json:",omitempty"` // cgo: flags for C preprocessor + CgoCXXFLAGS []string `json:",omitempty"` // cgo: flags for C++ compiler + CgoLDFLAGS []string `json:",omitempty"` // cgo: flags for linker + CgoPkgConfig []string `json:",omitempty"` // cgo: pkg-config names + + // Dependency information + Imports []string `json:",omitempty"` // import paths used by this package + Deps []string `json:",omitempty"` // all (recursively) imported dependencies + + // Error information + Incomplete bool `json:",omitempty"` // was there an error loading this package or dependencies? + Error *PackageError `json:",omitempty"` // error loading this package (not dependencies) + DepsErrors []*PackageError `json:",omitempty"` // errors loading dependencies + + // Test information + TestGoFiles []string `json:",omitempty"` // _test.go files in package + TestImports []string `json:",omitempty"` // imports from TestGoFiles + XTestGoFiles []string `json:",omitempty"` // _test.go files outside package + XTestImports []string `json:",omitempty"` // imports from XTestGoFiles + + // Unexported fields are not part of the public API. + build *build.Package + pkgdir string // overrides build.PkgDir + imports []*Package + deps []*Package + gofiles []string // GoFiles+CgoFiles+TestGoFiles+XTestGoFiles files, absolute paths + sfiles []string + allgofiles []string // gofiles + IgnoredGoFiles, absolute paths + target string // installed file for this package (may be executable) + fake bool // synthesized package + external bool // synthesized external test package + forceBuild bool // this package must be rebuilt + forceLibrary bool // this package is a library (even if named "main") + cmdline bool // defined by files listed on command line + local bool // imported via local path (./ or ../) + localPrefix string // interpret ./ and ../ imports relative to this prefix + exeName string // desired name for temporary executable + coverMode string // preprocess Go source files with the coverage tool in this mode + coverVars map[string]*CoverVar // variables created by coverage analysis + omitDWARF bool // tell linker not to write DWARF information + buildID string // expected build ID for generated package + gobinSubdir bool // install target would be subdir of GOBIN +} + +// vendored returns the vendor-resolved version of imports, +// which should be p.TestImports or p.XTestImports, NOT p.Imports. +// The imports in p.TestImports and p.XTestImports are not recursively +// loaded during the initial load of p, so they list the imports found in +// the source file, but most processing should be over the vendor-resolved +// import paths. We do this resolution lazily both to avoid file system work +// and because the eventual real load of the test imports (during 'go test') +// can produce better error messages if it starts with the original paths. +// The initial load of p loads all the non-test imports and rewrites +// the vendored paths, so nothing should ever call p.vendored(p.Imports). +func (p *Package) vendored(imports []string) []string { + if len(imports) > 0 && len(p.Imports) > 0 && &imports[0] == &p.Imports[0] { + panic("internal error: p.vendored(p.Imports) called") + } + seen := make(map[string]bool) + var all []string + for _, path := range imports { + path, _ = vendoredImportPath(p, path) + if !seen[path] { + seen[path] = true + all = append(all, path) + } + } + sort.Strings(all) + return all +} + +// CoverVar holds the name of the generated coverage variables targeting the named file. +type CoverVar struct { + File string // local file name + Var string // name of count struct +} + +func (p *Package) copyBuild(pp *build.Package) { + p.build = pp + + if pp.PkgTargetRoot != "" && buildPkgdir != "" { + old := pp.PkgTargetRoot + pp.PkgRoot = buildPkgdir + pp.PkgTargetRoot = buildPkgdir + pp.PkgObj = filepath.Join(buildPkgdir, strings.TrimPrefix(pp.PkgObj, old)) + } + + p.Dir = pp.Dir + p.ImportPath = pp.ImportPath + p.ImportComment = pp.ImportComment + p.Name = pp.Name + p.Doc = pp.Doc + p.Root = pp.Root + p.ConflictDir = pp.ConflictDir + // TODO? Target + p.Goroot = pp.Goroot + p.Standard = p.Goroot && p.ImportPath != "" && !strings.Contains(p.ImportPath, ".") + p.GoFiles = pp.GoFiles + p.CgoFiles = pp.CgoFiles + p.IgnoredGoFiles = pp.IgnoredGoFiles + p.CFiles = pp.CFiles + p.CXXFiles = pp.CXXFiles + p.MFiles = pp.MFiles + p.HFiles = pp.HFiles + p.SFiles = pp.SFiles + p.SwigFiles = pp.SwigFiles + p.SwigCXXFiles = pp.SwigCXXFiles + p.SysoFiles = pp.SysoFiles + p.CgoCFLAGS = pp.CgoCFLAGS + p.CgoCPPFLAGS = pp.CgoCPPFLAGS + p.CgoCXXFLAGS = pp.CgoCXXFLAGS + p.CgoLDFLAGS = pp.CgoLDFLAGS + p.CgoPkgConfig = pp.CgoPkgConfig + p.Imports = pp.Imports + p.TestGoFiles = pp.TestGoFiles + p.TestImports = pp.TestImports + p.XTestGoFiles = pp.XTestGoFiles + p.XTestImports = pp.XTestImports +} + +// A PackageError describes an error loading information about a package. +type PackageError struct { + ImportStack []string // shortest path from package named on command line to this one + Pos string // position of error + Err string // the error itself + isImportCycle bool // the error is an import cycle + hard bool // whether the error is soft or hard; soft errors are ignored in some places +} + +func (p *PackageError) Error() string { + // Import cycles deserve special treatment. + if p.isImportCycle { + return fmt.Sprintf("%s\npackage %s\n", p.Err, strings.Join(p.ImportStack, "\n\timports ")) + } + if p.Pos != "" { + // Omit import stack. The full path to the file where the error + // is the most important thing. + return p.Pos + ": " + p.Err + } + if len(p.ImportStack) == 0 { + return p.Err + } + return "package " + strings.Join(p.ImportStack, "\n\timports ") + ": " + p.Err +} + +// An importStack is a stack of import paths. +type importStack []string + +func (s *importStack) push(p string) { + *s = append(*s, p) +} + +func (s *importStack) pop() { + *s = (*s)[0 : len(*s)-1] +} + +func (s *importStack) copy() []string { + return append([]string{}, *s...) +} + +// shorterThan reports whether sp is shorter than t. +// We use this to record the shortest import sequence +// that leads to a particular package. +func (sp *importStack) shorterThan(t []string) bool { + s := *sp + if len(s) != len(t) { + return len(s) < len(t) + } + // If they are the same length, settle ties using string ordering. + for i := range s { + if s[i] != t[i] { + return s[i] < t[i] + } + } + return false // they are equal +} + +// packageCache is a lookup cache for loadPackage, +// so that if we look up a package multiple times +// we return the same pointer each time. +var packageCache = map[string]*Package{} + +// reloadPackage is like loadPackage but makes sure +// not to use the package cache. +func reloadPackage(arg string, stk *importStack) *Package { + p := packageCache[arg] + if p != nil { + delete(packageCache, p.Dir) + delete(packageCache, p.ImportPath) + } + return loadPackage(arg, stk) +} + +// The Go 1.5 vendoring experiment is enabled by setting GO15VENDOREXPERIMENT=1. +// The variable is obnoxiously long so that years from now when people find it in +// their profiles and wonder what it does, there is some chance that a web search +// might answer the question. +var go15VendorExperiment = os.Getenv("GO15VENDOREXPERIMENT") == "1" + +// dirToImportPath returns the pseudo-import path we use for a package +// outside the Go path. It begins with _/ and then contains the full path +// to the directory. If the package lives in c:\home\gopher\my\pkg then +// the pseudo-import path is _/c_/home/gopher/my/pkg. +// Using a pseudo-import path like this makes the ./ imports no longer +// a special case, so that all the code to deal with ordinary imports works +// automatically. +func dirToImportPath(dir string) string { + return pathpkg.Join("_", strings.Map(makeImportValid, filepath.ToSlash(dir))) +} + +func makeImportValid(r rune) rune { + // Should match Go spec, compilers, and ../../go/parser/parser.go:/isValidImport. + const illegalChars = `!"#$%&'()*,:;<=>?[\]^{|}` + "`\uFFFD" + if !unicode.IsGraphic(r) || unicode.IsSpace(r) || strings.ContainsRune(illegalChars, r) { + return '_' + } + return r +} + +// Mode flags for loadImport and download (in get.go). +const ( + // useVendor means that loadImport should do vendor expansion + // (provided the vendoring experiment is enabled). + // That is, useVendor means that the import path came from + // a source file and has not been vendor-expanded yet. + // Every import path should be loaded initially with useVendor, + // and then the expanded version (with the /vendor/ in it) gets + // recorded as the canonical import path. At that point, future loads + // of that package must not pass useVendor, because + // disallowVendor will reject direct use of paths containing /vendor/. + useVendor = 1 << iota + + // getTestDeps is for download (part of "go get") and indicates + // that test dependencies should be fetched too. + getTestDeps +) + +// loadImport scans the directory named by path, which must be an import path, +// but possibly a local import path (an absolute file system path or one beginning +// with ./ or ../). A local relative path is interpreted relative to srcDir. +// It returns a *Package describing the package found in that directory. +func loadImport(path, srcDir string, parent *Package, stk *importStack, importPos []token.Position, mode int) *Package { + stk.push(path) + defer stk.pop() + + // Determine canonical identifier for this package. + // For a local import the identifier is the pseudo-import path + // we create from the full directory to the package. + // Otherwise it is the usual import path. + // For vendored imports, it is the expanded form. + importPath := path + origPath := path + isLocal := build.IsLocalImport(path) + var vendorSearch []string + if isLocal { + importPath = dirToImportPath(filepath.Join(srcDir, path)) + } else if mode&useVendor != 0 { + path, vendorSearch = vendoredImportPath(parent, path) + importPath = path + } + + if p := packageCache[importPath]; p != nil { + if perr := disallowInternal(srcDir, p, stk); perr != p { + return perr + } + if mode&useVendor != 0 { + if perr := disallowVendor(srcDir, origPath, p, stk); perr != p { + return perr + } + } + return reusePackage(p, stk) + } + + p := new(Package) + p.local = isLocal + p.ImportPath = importPath + packageCache[importPath] = p + + // Load package. + // Import always returns bp != nil, even if an error occurs, + // in order to return partial information. + // + // TODO: After Go 1, decide when to pass build.AllowBinary here. + // See issue 3268 for mistakes to avoid. + bp, err := buildContext.Import(path, srcDir, build.ImportComment) + + // If we got an error from go/build about package not found, + // it contains the directories from $GOROOT and $GOPATH that + // were searched. Add to that message the vendor directories + // that were searched. + if err != nil && len(vendorSearch) > 0 { + // NOTE(rsc): The direct text manipulation here is fairly awful, + // but it avoids defining new go/build API (an exported error type) + // late in the Go 1.5 release cycle. If this turns out to be a more general + // problem we could define a real error type when the decision can be + // considered more carefully. + text := err.Error() + if strings.Contains(text, "cannot find package \"") && strings.Contains(text, "\" in any of:\n\t") { + old := strings.SplitAfter(text, "\n") + lines := []string{old[0]} + for _, dir := range vendorSearch { + lines = append(lines, "\t"+dir+" (vendor tree)\n") + } + lines = append(lines, old[1:]...) + err = errors.New(strings.Join(lines, "")) + } + } + bp.ImportPath = importPath + if gobin != "" { + bp.BinDir = gobin + } + if err == nil && !isLocal && bp.ImportComment != "" && bp.ImportComment != path && + (!go15VendorExperiment || (!strings.Contains(path, "/vendor/") && !strings.HasPrefix(path, "vendor/"))) { + err = fmt.Errorf("code in directory %s expects import %q", bp.Dir, bp.ImportComment) + } + p.load(stk, bp, err) + if p.Error != nil && len(importPos) > 0 { + pos := importPos[0] + pos.Filename = shortPath(pos.Filename) + p.Error.Pos = pos.String() + } + + if perr := disallowInternal(srcDir, p, stk); perr != p { + return perr + } + if mode&useVendor != 0 { + if perr := disallowVendor(srcDir, origPath, p, stk); perr != p { + return perr + } + } + + return p +} + +var isDirCache = map[string]bool{} + +func isDir(path string) bool { + result, ok := isDirCache[path] + if ok { + return result + } + + fi, err := os.Stat(path) + result = err == nil && fi.IsDir() + isDirCache[path] = result + return result +} + +// vendoredImportPath returns the expansion of path when it appears in parent. +// If parent is x/y/z, then path might expand to x/y/z/vendor/path, x/y/vendor/path, +// x/vendor/path, vendor/path, or else stay x/y/z if none of those exist. +// vendoredImportPath returns the expanded path or, if no expansion is found, the original. +// If no expansion is found, vendoredImportPath also returns a list of vendor directories +// it searched along the way, to help prepare a useful error message should path turn +// out not to exist. +func vendoredImportPath(parent *Package, path string) (found string, searched []string) { + if parent == nil || parent.Root == "" || !go15VendorExperiment { + return path, nil + } + dir := filepath.Clean(parent.Dir) + root := filepath.Join(parent.Root, "src") + if !hasFilePathPrefix(dir, root) || len(dir) <= len(root) || dir[len(root)] != filepath.Separator { + fatalf("invalid vendoredImportPath: dir=%q root=%q separator=%q", dir, root, string(filepath.Separator)) + } + vpath := "vendor/" + path + for i := len(dir); i >= len(root); i-- { + if i < len(dir) && dir[i] != filepath.Separator { + continue + } + // Note: checking for the vendor directory before checking + // for the vendor/path directory helps us hit the + // isDir cache more often. It also helps us prepare a more useful + // list of places we looked, to report when an import is not found. + if !isDir(filepath.Join(dir[:i], "vendor")) { + continue + } + targ := filepath.Join(dir[:i], vpath) + if isDir(targ) { + // We started with parent's dir c:\gopath\src\foo\bar\baz\quux\xyzzy. + // We know the import path for parent's dir. + // We chopped off some number of path elements and + // added vendor\path to produce c:\gopath\src\foo\bar\baz\vendor\path. + // Now we want to know the import path for that directory. + // Construct it by chopping the same number of path elements + // (actually the same number of bytes) from parent's import path + // and then append /vendor/path. + chopped := len(dir) - i + if chopped == len(parent.ImportPath)+1 { + // We walked up from c:\gopath\src\foo\bar + // and found c:\gopath\src\vendor\path. + // We chopped \foo\bar (length 8) but the import path is "foo/bar" (length 7). + // Use "vendor/path" without any prefix. + return vpath, nil + } + return parent.ImportPath[:len(parent.ImportPath)-chopped] + "/" + vpath, nil + } + // Note the existence of a vendor directory in case path is not found anywhere. + searched = append(searched, targ) + } + return path, searched +} + +// reusePackage reuses package p to satisfy the import at the top +// of the import stack stk. If this use causes an import loop, +// reusePackage updates p's error information to record the loop. +func reusePackage(p *Package, stk *importStack) *Package { + // We use p.imports==nil to detect a package that + // is in the midst of its own loadPackage call + // (all the recursion below happens before p.imports gets set). + if p.imports == nil { + if p.Error == nil { + p.Error = &PackageError{ + ImportStack: stk.copy(), + Err: "import cycle not allowed", + isImportCycle: true, + } + } + p.Incomplete = true + } + // Don't rewrite the import stack in the error if we have an import cycle. + // If we do, we'll lose the path that describes the cycle. + if p.Error != nil && !p.Error.isImportCycle && stk.shorterThan(p.Error.ImportStack) { + p.Error.ImportStack = stk.copy() + } + return p +} + +// disallowInternal checks that srcDir is allowed to import p. +// If the import is allowed, disallowInternal returns the original package p. +// If not, it returns a new package containing just an appropriate error. +func disallowInternal(srcDir string, p *Package, stk *importStack) *Package { + // golang.org/s/go14internal: + // An import of a path containing the element “internal” + // is disallowed if the importing code is outside the tree + // rooted at the parent of the “internal” directory. + + // There was an error loading the package; stop here. + if p.Error != nil { + return p + } + + // The stack includes p.ImportPath. + // If that's the only thing on the stack, we started + // with a name given on the command line, not an + // import. Anything listed on the command line is fine. + if len(*stk) == 1 { + return p + } + + // Check for "internal" element: four cases depending on begin of string and/or end of string. + i, ok := findInternal(p.ImportPath) + if !ok { + return p + } + + // Internal is present. + // Map import path back to directory corresponding to parent of internal. + if i > 0 { + i-- // rewind over slash in ".../internal" + } + parent := p.Dir[:i+len(p.Dir)-len(p.ImportPath)] + if hasPathPrefix(filepath.ToSlash(srcDir), filepath.ToSlash(parent)) { + return p + } + + // Internal is present, and srcDir is outside parent's tree. Not allowed. + perr := *p + perr.Error = &PackageError{ + ImportStack: stk.copy(), + Err: "use of internal package not allowed", + } + perr.Incomplete = true + return &perr +} + +// findInternal looks for the final "internal" path element in the given import path. +// If there isn't one, findInternal returns ok=false. +// Otherwise, findInternal returns ok=true and the index of the "internal". +func findInternal(path string) (index int, ok bool) { + // Four cases, depending on internal at start/end of string or not. + // The order matters: we must return the index of the final element, + // because the final one produces the most restrictive requirement + // on the importer. + switch { + case strings.HasSuffix(path, "/internal"): + return len(path) - len("internal"), true + case strings.Contains(path, "/internal/"): + return strings.LastIndex(path, "/internal/") + 1, true + case path == "internal", strings.HasPrefix(path, "internal/"): + return 0, true + } + return 0, false +} + +// disallowVendor checks that srcDir is allowed to import p as path. +// If the import is allowed, disallowVendor returns the original package p. +// If not, it returns a new package containing just an appropriate error. +func disallowVendor(srcDir, path string, p *Package, stk *importStack) *Package { + if !go15VendorExperiment { + return p + } + + // The stack includes p.ImportPath. + // If that's the only thing on the stack, we started + // with a name given on the command line, not an + // import. Anything listed on the command line is fine. + if len(*stk) == 1 { + return p + } + + if perr := disallowVendorVisibility(srcDir, p, stk); perr != p { + return perr + } + + // Paths like x/vendor/y must be imported as y, never as x/vendor/y. + if i, ok := findVendor(path); ok { + perr := *p + perr.Error = &PackageError{ + ImportStack: stk.copy(), + Err: "must be imported as " + path[i+len("vendor/"):], + } + perr.Incomplete = true + return &perr + } + + return p +} + +// disallowVendorVisibility checks that srcDir is allowed to import p. +// The rules are the same as for /internal/ except that a path ending in /vendor +// is not subject to the rules, only subdirectories of vendor. +// This allows people to have packages and commands named vendor, +// for maximal compatibility with existing source trees. +func disallowVendorVisibility(srcDir string, p *Package, stk *importStack) *Package { + // The stack includes p.ImportPath. + // If that's the only thing on the stack, we started + // with a name given on the command line, not an + // import. Anything listed on the command line is fine. + if len(*stk) == 1 { + return p + } + + // Check for "vendor" element. + i, ok := findVendor(p.ImportPath) + if !ok { + return p + } + + // Vendor is present. + // Map import path back to directory corresponding to parent of vendor. + if i > 0 { + i-- // rewind over slash in ".../vendor" + } + truncateTo := i + len(p.Dir) - len(p.ImportPath) + if truncateTo < 0 || len(p.Dir) < truncateTo { + return p + } + parent := p.Dir[:truncateTo] + if hasPathPrefix(filepath.ToSlash(srcDir), filepath.ToSlash(parent)) { + return p + } + + // Vendor is present, and srcDir is outside parent's tree. Not allowed. + perr := *p + perr.Error = &PackageError{ + ImportStack: stk.copy(), + Err: "use of vendored package not allowed", + } + perr.Incomplete = true + return &perr +} + +// findVendor looks for the last non-terminating "vendor" path element in the given import path. +// If there isn't one, findVendor returns ok=false. +// Otherwise, findInternal returns ok=true and the index of the "vendor". +// +// Note that terminating "vendor" elements don't count: "x/vendor" is its own package, +// not the vendored copy of an import "" (the empty import path). +// This will allow people to have packages or commands named vendor. +// This may help reduce breakage, or it may just be confusing. We'll see. +func findVendor(path string) (index int, ok bool) { + // Two cases, depending on internal at start of string or not. + // The order matters: we must return the index of the final element, + // because the final one is where the effective import path starts. + switch { + case strings.Contains(path, "/vendor/"): + return strings.LastIndex(path, "/vendor/") + 1, true + case strings.HasPrefix(path, "vendor/"): + return 0, true + } + return 0, false +} + +type targetDir int + +const ( + toRoot targetDir = iota // to bin dir inside package root (default) + toTool // GOROOT/pkg/tool + toBin // GOROOT/bin + stalePath // the old import path; fail to build +) + +// goTools is a map of Go program import path to install target directory. +var goTools = map[string]targetDir{ + "cmd/addr2line": toTool, + "cmd/api": toTool, + "cmd/asm": toTool, + "cmd/compile": toTool, + "cmd/cgo": toTool, + "cmd/cover": toTool, + "cmd/dist": toTool, + "cmd/doc": toTool, + "cmd/fix": toTool, + "cmd/link": toTool, + "cmd/newlink": toTool, + "cmd/nm": toTool, + "cmd/objdump": toTool, + "cmd/pack": toTool, + "cmd/pprof": toTool, + "cmd/trace": toTool, + "cmd/vet": toTool, + "cmd/yacc": toTool, + "golang.org/x/tools/cmd/godoc": toBin, + "code.google.com/p/go.tools/cmd/cover": stalePath, + "code.google.com/p/go.tools/cmd/godoc": stalePath, + "code.google.com/p/go.tools/cmd/vet": stalePath, +} + +// expandScanner expands a scanner.List error into all the errors in the list. +// The default Error method only shows the first error. +func expandScanner(err error) error { + // Look for parser errors. + if err, ok := err.(scanner.ErrorList); ok { + // Prepare error with \n before each message. + // When printed in something like context: %v + // this will put the leading file positions each on + // its own line. It will also show all the errors + // instead of just the first, as err.Error does. + var buf bytes.Buffer + for _, e := range err { + e.Pos.Filename = shortPath(e.Pos.Filename) + buf.WriteString("\n") + buf.WriteString(e.Error()) + } + return errors.New(buf.String()) + } + return err +} + +var raceExclude = map[string]bool{ + "runtime/race": true, + "runtime/cgo": true, + "cmd/cgo": true, + "syscall": true, + "errors": true, +} + +var cgoExclude = map[string]bool{ + "runtime/cgo": true, +} + +var cgoSyscallExclude = map[string]bool{ + "runtime/cgo": true, + "runtime/race": true, +} + +// load populates p using information from bp, err, which should +// be the result of calling build.Context.Import. +func (p *Package) load(stk *importStack, bp *build.Package, err error) *Package { + p.copyBuild(bp) + + // The localPrefix is the path we interpret ./ imports relative to. + // Synthesized main packages sometimes override this. + p.localPrefix = dirToImportPath(p.Dir) + + if err != nil { + p.Incomplete = true + err = expandScanner(err) + p.Error = &PackageError{ + ImportStack: stk.copy(), + Err: err.Error(), + } + return p + } + + useBindir := p.Name == "main" + if !p.Standard { + switch buildBuildmode { + case "c-archive", "c-shared": + useBindir = false + } + } + + if useBindir { + // Report an error when the old code.google.com/p/go.tools paths are used. + if goTools[p.ImportPath] == stalePath { + newPath := strings.Replace(p.ImportPath, "code.google.com/p/go.", "golang.org/x/", 1) + e := fmt.Sprintf("the %v command has moved; use %v instead.", p.ImportPath, newPath) + p.Error = &PackageError{Err: e} + return p + } + _, elem := filepath.Split(p.Dir) + full := buildContext.GOOS + "_" + buildContext.GOARCH + "/" + elem + if buildContext.GOOS != toolGOOS || buildContext.GOARCH != toolGOARCH { + // Install cross-compiled binaries to subdirectories of bin. + elem = full + } + if p.build.BinDir != gobin && goTools[p.ImportPath] == toBin { + // Override BinDir. + // This is from a subrepo but installs to $GOROOT/bin + // by default anyway (like godoc). + p.target = filepath.Join(gorootBin, elem) + } else if p.build.BinDir != "" { + // Install to GOBIN or bin of GOPATH entry. + p.target = filepath.Join(p.build.BinDir, elem) + if !p.Goroot && strings.Contains(elem, "/") && gobin != "" { + // Do not create $GOBIN/goos_goarch/elem. + p.target = "" + p.gobinSubdir = true + } + } + if goTools[p.ImportPath] == toTool { + // This is for 'go tool'. + // Override all the usual logic and force it into the tool directory. + p.target = filepath.Join(gorootPkg, "tool", full) + } + if p.target != "" && buildContext.GOOS == "windows" { + p.target += ".exe" + } + } else if p.local { + // Local import turned into absolute path. + // No permanent install target. + p.target = "" + } else { + p.target = p.build.PkgObj + if buildLinkshared { + shlibnamefile := p.target[:len(p.target)-2] + ".shlibname" + shlib, err := ioutil.ReadFile(shlibnamefile) + if err == nil { + libname := strings.TrimSpace(string(shlib)) + if buildContext.Compiler == "gccgo" { + p.Shlib = filepath.Join(p.build.PkgTargetRoot, "shlibs", libname) + } else { + p.Shlib = filepath.Join(p.build.PkgTargetRoot, libname) + + } + } else if !os.IsNotExist(err) { + fatalf("unexpected error reading %s: %v", shlibnamefile, err) + } + } + } + + importPaths := p.Imports + // Packages that use cgo import runtime/cgo implicitly. + // Packages that use cgo also import syscall implicitly, + // to wrap errno. + // Exclude certain packages to avoid circular dependencies. + if len(p.CgoFiles) > 0 && (!p.Standard || !cgoExclude[p.ImportPath]) { + importPaths = append(importPaths, "runtime/cgo") + } + if len(p.CgoFiles) > 0 && (!p.Standard || !cgoSyscallExclude[p.ImportPath]) { + importPaths = append(importPaths, "syscall") + } + + // Currently build mode c-shared, or -linkshared, forces + // external linking mode, and external linking mode forces an + // import of runtime/cgo. + if p.Name == "main" && !p.Goroot && (buildBuildmode == "c-shared" || buildLinkshared) { + importPaths = append(importPaths, "runtime/cgo") + } + + // Everything depends on runtime, except runtime and unsafe. + if !p.Standard || (p.ImportPath != "runtime" && p.ImportPath != "unsafe") { + importPaths = append(importPaths, "runtime") + // When race detection enabled everything depends on runtime/race. + // Exclude certain packages to avoid circular dependencies. + if buildRace && (!p.Standard || !raceExclude[p.ImportPath]) { + importPaths = append(importPaths, "runtime/race") + } + // On ARM with GOARM=5, everything depends on math for the link. + if p.Name == "main" && goarch == "arm" { + importPaths = append(importPaths, "math") + } + } + + // Build list of full paths to all Go files in the package, + // for use by commands like go fmt. + p.gofiles = stringList(p.GoFiles, p.CgoFiles, p.TestGoFiles, p.XTestGoFiles) + for i := range p.gofiles { + p.gofiles[i] = filepath.Join(p.Dir, p.gofiles[i]) + } + sort.Strings(p.gofiles) + + p.sfiles = stringList(p.SFiles) + for i := range p.sfiles { + p.sfiles[i] = filepath.Join(p.Dir, p.sfiles[i]) + } + sort.Strings(p.sfiles) + + p.allgofiles = stringList(p.IgnoredGoFiles) + for i := range p.allgofiles { + p.allgofiles[i] = filepath.Join(p.Dir, p.allgofiles[i]) + } + p.allgofiles = append(p.allgofiles, p.gofiles...) + sort.Strings(p.allgofiles) + + // Check for case-insensitive collision of input files. + // To avoid problems on case-insensitive files, we reject any package + // where two different input files have equal names under a case-insensitive + // comparison. + f1, f2 := foldDup(stringList( + p.GoFiles, + p.CgoFiles, + p.IgnoredGoFiles, + p.CFiles, + p.CXXFiles, + p.MFiles, + p.HFiles, + p.SFiles, + p.SysoFiles, + p.SwigFiles, + p.SwigCXXFiles, + p.TestGoFiles, + p.XTestGoFiles, + )) + if f1 != "" { + p.Error = &PackageError{ + ImportStack: stk.copy(), + Err: fmt.Sprintf("case-insensitive file name collision: %q and %q", f1, f2), + } + return p + } + + // Build list of imported packages and full dependency list. + imports := make([]*Package, 0, len(p.Imports)) + deps := make(map[string]*Package) + for i, path := range importPaths { + if path == "C" { + continue + } + p1 := loadImport(path, p.Dir, p, stk, p.build.ImportPos[path], useVendor) + if p1.Name == "main" { + p.Error = &PackageError{ + ImportStack: stk.copy(), + Err: fmt.Sprintf("import %q is a program, not an importable package", path), + } + pos := p.build.ImportPos[path] + if len(pos) > 0 { + p.Error.Pos = pos[0].String() + } + } + if p1.local { + if !p.local && p.Error == nil { + p.Error = &PackageError{ + ImportStack: stk.copy(), + Err: fmt.Sprintf("local import %q in non-local package", path), + } + pos := p.build.ImportPos[path] + if len(pos) > 0 { + p.Error.Pos = pos[0].String() + } + } + } + path = p1.ImportPath + importPaths[i] = path + if i < len(p.Imports) { + p.Imports[i] = path + } + deps[path] = p1 + imports = append(imports, p1) + for _, dep := range p1.deps { + // The same import path could produce an error or not, + // depending on what tries to import it. + // Prefer to record entries with errors, so we can report them. + if deps[dep.ImportPath] == nil || dep.Error != nil { + deps[dep.ImportPath] = dep + } + } + if p1.Incomplete { + p.Incomplete = true + } + } + p.imports = imports + + p.Deps = make([]string, 0, len(deps)) + for dep := range deps { + p.Deps = append(p.Deps, dep) + } + sort.Strings(p.Deps) + for _, dep := range p.Deps { + p1 := deps[dep] + if p1 == nil { + panic("impossible: missing entry in package cache for " + dep + " imported by " + p.ImportPath) + } + p.deps = append(p.deps, p1) + if p1.Error != nil { + p.DepsErrors = append(p.DepsErrors, p1.Error) + } + } + + // unsafe is a fake package. + if p.Standard && (p.ImportPath == "unsafe" || buildContext.Compiler == "gccgo") { + p.target = "" + } + p.Target = p.target + + // The gc toolchain only permits C source files with cgo. + if len(p.CFiles) > 0 && !p.usesCgo() && !p.usesSwig() && buildContext.Compiler == "gc" { + p.Error = &PackageError{ + ImportStack: stk.copy(), + Err: fmt.Sprintf("C source files not allowed when not using cgo or SWIG: %s", strings.Join(p.CFiles, " ")), + } + return p + } + + // In the absence of errors lower in the dependency tree, + // check for case-insensitive collisions of import paths. + if len(p.DepsErrors) == 0 { + dep1, dep2 := foldDup(p.Deps) + if dep1 != "" { + p.Error = &PackageError{ + ImportStack: stk.copy(), + Err: fmt.Sprintf("case-insensitive import collision: %q and %q", dep1, dep2), + } + return p + } + } + + computeBuildID(p) + return p +} + +// usesSwig reports whether the package needs to run SWIG. +func (p *Package) usesSwig() bool { + return len(p.SwigFiles) > 0 || len(p.SwigCXXFiles) > 0 +} + +// usesCgo reports whether the package needs to run cgo +func (p *Package) usesCgo() bool { + return len(p.CgoFiles) > 0 +} + +// packageList returns the list of packages in the dag rooted at roots +// as visited in a depth-first post-order traversal. +func packageList(roots []*Package) []*Package { + seen := map[*Package]bool{} + all := []*Package{} + var walk func(*Package) + walk = func(p *Package) { + if seen[p] { + return + } + seen[p] = true + for _, p1 := range p.imports { + walk(p1) + } + all = append(all, p) + } + for _, root := range roots { + walk(root) + } + return all +} + +// computeStale computes the Stale flag in the package dag that starts +// at the named pkgs (command-line arguments). +func computeStale(pkgs ...*Package) { + for _, p := range packageList(pkgs) { + p.Stale = isStale(p) + } +} + +// The runtime version string takes one of two forms: +// "go1.X[.Y]" for Go releases, and "devel +hash" at tip. +// Determine whether we are in a released copy by +// inspecting the version. +var isGoRelease = strings.HasPrefix(runtime.Version(), "go1") + +// isStale and computeBuildID +// +// Theory of Operation +// +// There is an installed copy of the package (or binary). +// Can we reuse the installed copy, or do we need to build a new one? +// +// We can use the installed copy if it matches what we'd get +// by building a new one. The hard part is predicting that without +// actually running a build. +// +// To start, we must know the set of inputs to the build process that can +// affect the generated output. At a minimum, that includes the source +// files for the package and also any compiled packages imported by those +// source files. The *Package has these, and we use them. One might also +// argue for including in the input set: the build tags, whether the race +// detector is in use, the target operating system and architecture, the +// compiler and linker binaries being used, the additional flags being +// passed to those, the cgo binary being used, the additional flags cgo +// passes to the host C compiler, the host C compiler being used, the set +// of host C include files and installed C libraries, and so on. +// We include some but not all of this information. +// +// Once we have decided on a set of inputs, we must next decide how to +// tell whether the content of that set has changed since the last build +// of p. If there have been no changes, then we assume a new build would +// produce the same result and reuse the installed package or binary. +// But if there have been changes, then we assume a new build might not +// produce the same result, so we rebuild. +// +// There are two common ways to decide whether the content of the set has +// changed: modification times and content hashes. We use a mixture of both. +// +// The use of modification times (mtimes) was pioneered by make: +// assuming that a file's mtime is an accurate record of when that file was last written, +// and assuming that the modification time of an installed package or +// binary is the time that it was built, if the mtimes of the inputs +// predate the mtime of the installed object, then the build of that +// object saw those versions of the files, and therefore a rebuild using +// those same versions would produce the same object. In contrast, if any +// mtime of an input is newer than the mtime of the installed object, a +// change has occurred since the build, and the build should be redone. +// +// Modification times are attractive because the logic is easy to +// understand and the file system maintains the mtimes automatically +// (less work for us). Unfortunately, there are a variety of ways in +// which the mtime approach fails to detect a change and reuses a stale +// object file incorrectly. (Making the opposite mistake, rebuilding +// unnecessarily, is only a performance problem and not a correctness +// problem, so we ignore that one.) +// +// As a warmup, one problem is that to be perfectly precise, we need to +// compare the input mtimes against the time at the beginning of the +// build, but the object file time is the time at the end of the build. +// If an input file changes after being read but before the object is +// written, the next build will see an object newer than the input and +// will incorrectly decide that the object is up to date. We make no +// attempt to detect or solve this problem. +// +// Another problem is that due to file system imprecision, an input and +// output that are actually ordered in time have the same mtime. +// This typically happens on file systems with 1-second (or, worse, +// 2-second) mtime granularity and with automated scripts that write an +// input and then immediately run a build, or vice versa. If an input and +// an output have the same mtime, the conservative behavior is to treat +// the output as out-of-date and rebuild. This can cause one or more +// spurious rebuilds, but only for 1 second, until the object finally has +// an mtime later than the input. +// +// Another problem is that binary distributions often set the mtime on +// all files to the same time. If the distribution includes both inputs +// and cached build outputs, the conservative solution to the previous +// problem will cause unnecessary rebuilds. Worse, in such a binary +// distribution, those rebuilds might not even have permission to update +// the cached build output. To avoid these write errors, if an input and +// output have the same mtime, we assume the output is up-to-date. +// This is the opposite of what the previous problem would have us do, +// but binary distributions are more common than instances of the +// previous problem. +// +// A variant of the last problem is that some binary distributions do not +// set the mtime on all files to the same time. Instead they let the file +// system record mtimes as the distribution is unpacked. If the outputs +// are unpacked before the inputs, they'll be older and a build will try +// to rebuild them. That rebuild might hit the same write errors as in +// the last scenario. We don't make any attempt to solve this, and we +// haven't had many reports of it. Perhaps the only time this happens is +// when people manually unpack the distribution, and most of the time +// that's done as the same user who will be using it, so an initial +// rebuild on first use succeeds quietly. +// +// More generally, people and programs change mtimes on files. The last +// few problems were specific examples of this, but it's a general problem. +// For example, instead of a binary distribution, copying a home +// directory from one directory or machine to another might copy files +// but not preserve mtimes. If the inputs are new than the outputs on the +// first machine but copied first, they end up older than the outputs on +// the second machine. +// +// Because many other build systems have the same sensitivity to mtimes, +// most programs manipulating source code take pains not to break the +// mtime assumptions. For example, Git does not set the mtime of files +// during a checkout operation, even when checking out an old version of +// the code. This decision was made specifically to work well with +// mtime-based build systems. +// +// The killer problem, though, for mtime-based build systems is that the +// build only has access to the mtimes of the inputs that still exist. +// If it is possible to remove an input without changing any other inputs, +// a later build will think the object is up-to-date when it is not. +// This happens for Go because a package is made up of all source +// files in a directory. If a source file is removed, there is no newer +// mtime available recording that fact. The mtime on the directory could +// be used, but it also changes when unrelated files are added to or +// removed from the directory, so including the directory mtime would +// cause unnecessary rebuilds, possibly many. It would also exacerbate +// the problems mentioned earlier, since even programs that are careful +// to maintain mtimes on files rarely maintain mtimes on directories. +// +// A variant of the last problem is when the inputs change for other +// reasons. For example, Go 1.4 and Go 1.5 both install $GOPATH/src/mypkg +// into the same target, $GOPATH/pkg/$GOOS_$GOARCH/mypkg.a. +// If Go 1.4 has built mypkg into mypkg.a, a build using Go 1.5 must +// rebuild mypkg.a, but from mtimes alone mypkg.a looks up-to-date. +// If Go 1.5 has just been installed, perhaps the compiler will have a +// newer mtime; since the compiler is considered an input, that would +// trigger a rebuild. But only once, and only the last Go 1.4 build of +// mypkg.a happened before Go 1.5 was installed. If a user has the two +// versions installed in different locations and flips back and forth, +// mtimes alone cannot tell what to do. Changing the toolchain is +// changing the set of inputs, without affecting any mtimes. +// +// To detect the set of inputs changing, we turn away from mtimes and to +// an explicit data comparison. Specifically, we build a list of the +// inputs to the build, compute its SHA1 hash, and record that as the +// ``build ID'' in the generated object. At the next build, we can +// recompute the buid ID and compare it to the one in the generated +// object. If they differ, the list of inputs has changed, so the object +// is out of date and must be rebuilt. +// +// Because this build ID is computed before the build begins, the +// comparison does not have the race that mtime comparison does. +// +// Making the build sensitive to changes in other state is +// straightforward: include the state in the build ID hash, and if it +// changes, so does the build ID, triggering a rebuild. +// +// To detect changes in toolchain, we include the toolchain version in +// the build ID hash for package runtime, and then we include the build +// IDs of all imported packages in the build ID for p. +// +// It is natural to think about including build tags in the build ID, but +// the naive approach of just dumping the tags into the hash would cause +// spurious rebuilds. For example, 'go install' and 'go install -tags neverusedtag' +// produce the same binaries (assuming neverusedtag is never used). +// A more precise approach would be to include only tags that have an +// effect on the build. But the effect of a tag on the build is to +// include or exclude a file from the compilation, and that file list is +// already in the build ID hash. So the build ID is already tag-sensitive +// in a perfectly precise way. So we do NOT explicitly add build tags to +// the build ID hash. +// +// We do not include as part of the build ID the operating system, +// architecture, or whether the race detector is enabled, even though all +// three have an effect on the output, because that information is used +// to decide the install location. Binaries for linux and binaries for +// darwin are written to different directory trees; including that +// information in the build ID is unnecessary (although it would be +// harmless). +// +// TODO(rsc): Investigate the cost of putting source file content into +// the build ID hash as a replacement for the use of mtimes. Using the +// file content would avoid all the mtime problems, but it does require +// reading all the source files, something we avoid today (we read the +// beginning to find the build tags and the imports, but we stop as soon +// as we see the import block is over). If the package is stale, the compiler +// is going to read the files anyway. But if the package is up-to-date, the +// read is overhead. +// +// TODO(rsc): Investigate the complexity of making the build more +// precise about when individual results are needed. To be fully precise, +// there are two results of a compilation: the entire .a file used by the link +// and the subpiece used by later compilations (__.PKGDEF only). +// If a rebuild is needed but produces the previous __.PKGDEF, then +// no more recompilation due to the rebuilt package is needed, only +// relinking. To date, there is nothing in the Go command to express this. +// +// Special Cases +// +// When the go command makes the wrong build decision and does not +// rebuild something it should, users fall back to adding the -a flag. +// Any common use of the -a flag should be considered prima facie evidence +// that isStale is returning an incorrect false result in some important case. +// Bugs reported in the behavior of -a itself should prompt the question +// ``Why is -a being used at all? What bug does that indicate?'' +// +// There is a long history of changes to isStale to try to make -a into a +// suitable workaround for bugs in the mtime-based decisions. +// It is worth recording that history to inform (and, as much as possible, deter) future changes. +// +// (1) Before the build IDs were introduced, building with alternate tags +// would happily reuse installed objects built without those tags. +// For example, "go build -tags netgo myprog.go" would use the installed +// copy of package net, even if that copy had been built without netgo. +// (The netgo tag controls whether package net uses cgo or pure Go for +// functionality such as name resolution.) +// Using the installed non-netgo package defeats the purpose. +// +// Users worked around this with "go build -tags netgo -a myprog.go". +// +// Build IDs have made that workaround unnecessary: +// "go build -tags netgo myprog.go" +// cannot use a non-netgo copy of package net. +// +// (2) Before the build IDs were introduced, building with different toolchains, +// especially changing between toolchains, tried to reuse objects stored in +// $GOPATH/pkg, resulting in link-time errors about object file mismatches. +// +// Users worked around this with "go install -a ./...". +// +// Build IDs have made that workaround unnecessary: +// "go install ./..." will rebuild any objects it finds that were built against +// a different toolchain. +// +// (3) The common use of "go install -a ./..." led to reports of problems +// when the -a forced the rebuild of the standard library, which for some +// users was not writable. Because we didn't understand that the real +// problem was the bug -a was working around, we changed -a not to +// apply to the standard library. +// +// (4) The common use of "go build -tags netgo -a myprog.go" broke +// when we changed -a not to apply to the standard library, because +// if go build doesn't rebuild package net, it uses the non-netgo version. +// +// Users worked around this with "go build -tags netgo -installsuffix barf myprog.go". +// The -installsuffix here is making the go command look for packages +// in pkg/$GOOS_$GOARCH_barf instead of pkg/$GOOS_$GOARCH. +// Since the former presumably doesn't exist, go build decides to rebuild +// everything, including the standard library. Since go build doesn't +// install anything it builds, nothing is ever written to pkg/$GOOS_$GOARCH_barf, +// so repeated invocations continue to work. +// +// If the use of -a wasn't a red flag, the use of -installsuffix to point to +// a non-existent directory in a command that installs nothing should +// have been. +// +// (5) Now that (1) and (2) no longer need -a, we have removed the kludge +// introduced in (3): once again, -a means ``rebuild everything,'' not +// ``rebuild everything except the standard library.'' Only Go 1.4 had +// the restricted meaning. +// +// In addition to these cases trying to trigger rebuilds, there are +// special cases trying NOT to trigger rebuilds. The main one is that for +// a variety of reasons (see above), the install process for a Go release +// cannot be relied upon to set the mtimes such that the go command will +// think the standard library is up to date. So the mtime evidence is +// ignored for the standard library if we find ourselves in a release +// version of Go. Build ID-based staleness checks still apply to the +// standard library, even in release versions. This makes +// 'go build -tags netgo' work, among other things. + +// isStale reports whether package p needs to be rebuilt. +func isStale(p *Package) bool { + if p.Standard && (p.ImportPath == "unsafe" || buildContext.Compiler == "gccgo") { + // fake, builtin package + return false + } + if p.Error != nil { + return true + } + + // A package without Go sources means we only found + // the installed .a file. Since we don't know how to rebuild + // it, it can't be stale, even if -a is set. This enables binary-only + // distributions of Go packages, although such binaries are + // only useful with the specific version of the toolchain that + // created them. + if len(p.gofiles) == 0 && !p.usesSwig() { + return false + } + + // If the -a flag is given, rebuild everything. + if buildA { + return true + } + + // If there's no install target or it's already marked stale, we have to rebuild. + if p.target == "" || p.Stale { + return true + } + + // Package is stale if completely unbuilt. + fi, err := os.Stat(p.target) + if err != nil { + return true + } + + // Package is stale if the expected build ID differs from the + // recorded build ID. This catches changes like a source file + // being removed from a package directory. See issue 3895. + // It also catches changes in build tags that affect the set of + // files being compiled. See issue 9369. + // It also catches changes in toolchain, like when flipping between + // two versions of Go compiling a single GOPATH. + // See issue 8290 and issue 10702. + targetBuildID, err := readBuildID(p) + if err == nil && targetBuildID != p.buildID { + return true + } + + // Package is stale if a dependency is. + for _, p1 := range p.deps { + if p1.Stale { + return true + } + } + + // The checks above are content-based staleness. + // We assume they are always accurate. + // + // The checks below are mtime-based staleness. + // We hope they are accurate, but we know that they fail in the case of + // prebuilt Go installations that don't preserve the build mtimes + // (for example, if the pkg/ mtimes are before the src/ mtimes). + // See the large comment above isStale for details. + + // If we are running a release copy of Go and didn't find a content-based + // reason to rebuild the standard packages, do not rebuild them. + // They may not be writable anyway, but they are certainly not changing. + // This makes 'go build' skip the standard packages when + // using an official release, even when the mtimes have been changed. + // See issue 3036, issue 3149, issue 4106, issue 8290. + // (If a change to a release tree must be made by hand, the way to force the + // install is to run make.bash, which will remove the old package archives + // before rebuilding.) + if p.Standard && isGoRelease { + return false + } + + // Time-based staleness. + + built := fi.ModTime() + + olderThan := func(file string) bool { + fi, err := os.Stat(file) + return err != nil || fi.ModTime().After(built) + } + + // Package is stale if a dependency is, or if a dependency is newer. + for _, p1 := range p.deps { + if p1.target != "" && olderThan(p1.target) { + return true + } + } + + // As a courtesy to developers installing new versions of the compiler + // frequently, define that packages are stale if they are + // older than the compiler, and commands if they are older than + // the linker. This heuristic will not work if the binaries are + // back-dated, as some binary distributions may do, but it does handle + // a very common case. + // See issue 3036. + // Exclude $GOROOT, under the assumption that people working on + // the compiler may want to control when everything gets rebuilt, + // and people updating the Go repository will run make.bash or all.bash + // and get a full rebuild anyway. + // Excluding $GOROOT used to also fix issue 4106, but that's now + // taken care of above (at least when the installed Go is a released version). + if p.Root != goroot { + if olderThan(buildToolchain.compiler()) { + return true + } + if p.build.IsCommand() && olderThan(buildToolchain.linker()) { + return true + } + } + + // Note: Until Go 1.5, we had an additional shortcut here. + // We built a list of the workspace roots ($GOROOT, each $GOPATH) + // containing targets directly named on the command line, + // and if p were not in any of those, it would be treated as up-to-date + // as long as it is built. The goal was to avoid rebuilding a system-installed + // $GOROOT, unless something from $GOROOT were explicitly named + // on the command line (like go install math). + // That's now handled by the isGoRelease clause above. + // The other effect of the shortcut was to isolate different entries in + // $GOPATH from each other. This had the unfortunate effect that + // if you had (say), GOPATH listing two entries, one for commands + // and one for libraries, and you did a 'git pull' in the library one + // and then tried 'go install commands/...', it would build the new libraries + // during the first build (because they wouldn't have been installed at all) + // but then subsequent builds would not rebuild the libraries, even if the + // mtimes indicate they are stale, because the different GOPATH entries + // were treated differently. This behavior was confusing when using + // non-trivial GOPATHs, which were particularly common with some + // code management conventions, like the original godep. + // Since the $GOROOT case (the original motivation) is handled separately, + // we no longer put a barrier between the different $GOPATH entries. + // + // One implication of this is that if there is a system directory for + // non-standard Go packages that is included in $GOPATH, the mtimes + // on those compiled packages must be no earlier than the mtimes + // on the source files. Since most distributions use the same mtime + // for all files in a tree, they will be unaffected. People using plain + // tar x to extract system-installed packages will need to adjust mtimes, + // but it's better to force them to get the mtimes right than to ignore + // the mtimes and thereby do the wrong thing in common use cases. + // + // So there is no GOPATH vs GOPATH shortcut here anymore. + // + // If something needs to come back here, we could try writing a dummy + // file with a random name to the $GOPATH/pkg directory (and removing it) + // to test for write access, and then skip GOPATH roots we don't have write + // access to. But hopefully we can just use the mtimes always. + + srcs := stringList(p.GoFiles, p.CFiles, p.CXXFiles, p.MFiles, p.HFiles, p.SFiles, p.CgoFiles, p.SysoFiles, p.SwigFiles, p.SwigCXXFiles) + for _, src := range srcs { + if olderThan(filepath.Join(p.Dir, src)) { + return true + } + } + + return false +} + +// computeBuildID computes the build ID for p, leaving it in p.buildID. +// Build ID is a hash of the information we want to detect changes in. +// See the long comment in isStale for details. +func computeBuildID(p *Package) { + h := sha1.New() + + // Include the list of files compiled as part of the package. + // This lets us detect removed files. See issue 3895. + inputFiles := stringList( + p.GoFiles, + p.CgoFiles, + p.CFiles, + p.CXXFiles, + p.MFiles, + p.HFiles, + p.SFiles, + p.SysoFiles, + p.SwigFiles, + p.SwigCXXFiles, + ) + for _, file := range inputFiles { + fmt.Fprintf(h, "file %s\n", file) + } + + // Include the content of runtime/zversion.go in the hash + // for package runtime. This will give package runtime a + // different build ID in each Go release. + if p.Standard && p.ImportPath == "runtime" { + data, _ := ioutil.ReadFile(filepath.Join(p.Dir, "zversion.go")) + fmt.Fprintf(h, "zversion %q\n", string(data)) + } + + // Include the build IDs of any dependencies in the hash. + // This, combined with the runtime/zversion content, + // will cause packages to have different build IDs when + // compiled with different Go releases. + // This helps the go command know to recompile when + // people use the same GOPATH but switch between + // different Go releases. See issue 10702. + // This is also a better fix for issue 8290. + for _, p1 := range p.deps { + fmt.Fprintf(h, "dep %s %s\n", p1.ImportPath, p1.buildID) + } + + p.buildID = fmt.Sprintf("%x", h.Sum(nil)) +} + +var cwd, _ = os.Getwd() + +var cmdCache = map[string]*Package{} + +// loadPackage is like loadImport but is used for command-line arguments, +// not for paths found in import statements. In addition to ordinary import paths, +// loadPackage accepts pseudo-paths beginning with cmd/ to denote commands +// in the Go command directory, as well as paths to those directories. +func loadPackage(arg string, stk *importStack) *Package { + if build.IsLocalImport(arg) { + dir := arg + if !filepath.IsAbs(dir) { + if abs, err := filepath.Abs(dir); err == nil { + // interpret relative to current directory + dir = abs + } + } + if sub, ok := hasSubdir(gorootSrc, dir); ok && strings.HasPrefix(sub, "cmd/") && !strings.Contains(sub[4:], "/") { + arg = sub + } + } + if strings.HasPrefix(arg, "cmd/") && !strings.Contains(arg[4:], "/") { + if p := cmdCache[arg]; p != nil { + return p + } + stk.push(arg) + defer stk.pop() + + bp, err := buildContext.ImportDir(filepath.Join(gorootSrc, arg), 0) + bp.ImportPath = arg + bp.Goroot = true + bp.BinDir = gorootBin + if gobin != "" { + bp.BinDir = gobin + } + bp.Root = goroot + bp.SrcRoot = gorootSrc + p := new(Package) + cmdCache[arg] = p + p.load(stk, bp, err) + if p.Error == nil && p.Name != "main" { + p.Error = &PackageError{ + ImportStack: stk.copy(), + Err: fmt.Sprintf("expected package main but found package %s in %s", p.Name, p.Dir), + } + } + return p + } + + // Wasn't a command; must be a package. + // If it is a local import path but names a standard package, + // we treat it as if the user specified the standard package. + // This lets you run go test ./ioutil in package io and be + // referring to io/ioutil rather than a hypothetical import of + // "./ioutil". + if build.IsLocalImport(arg) { + bp, _ := buildContext.ImportDir(filepath.Join(cwd, arg), build.FindOnly) + if bp.ImportPath != "" && bp.ImportPath != "." { + arg = bp.ImportPath + } + } + + return loadImport(arg, cwd, nil, stk, nil, 0) +} + +// packages returns the packages named by the +// command line arguments 'args'. If a named package +// cannot be loaded at all (for example, if the directory does not exist), +// then packages prints an error and does not include that +// package in the results. However, if errors occur trying +// to load dependencies of a named package, the named +// package is still returned, with p.Incomplete = true +// and details in p.DepsErrors. +func packages(args []string) []*Package { + var pkgs []*Package + for _, pkg := range packagesAndErrors(args) { + if pkg.Error != nil { + errorf("can't load package: %s", pkg.Error) + continue + } + pkgs = append(pkgs, pkg) + } + return pkgs +} + +// packagesAndErrors is like 'packages' but returns a +// *Package for every argument, even the ones that +// cannot be loaded at all. +// The packages that fail to load will have p.Error != nil. +func packagesAndErrors(args []string) []*Package { + if len(args) > 0 && strings.HasSuffix(args[0], ".go") { + return []*Package{goFilesPackage(args)} + } + + args = importPaths(args) + var pkgs []*Package + var stk importStack + var set = make(map[string]bool) + + for _, arg := range args { + if !set[arg] { + pkgs = append(pkgs, loadPackage(arg, &stk)) + set[arg] = true + } + } + computeStale(pkgs...) + + return pkgs +} + +// packagesForBuild is like 'packages' but fails if any of +// the packages or their dependencies have errors +// (cannot be built). +func packagesForBuild(args []string) []*Package { + pkgs := packagesAndErrors(args) + printed := map[*PackageError]bool{} + for _, pkg := range pkgs { + if pkg.Error != nil { + errorf("can't load package: %s", pkg.Error) + } + for _, err := range pkg.DepsErrors { + // Since these are errors in dependencies, + // the same error might show up multiple times, + // once in each package that depends on it. + // Only print each once. + if !printed[err] { + printed[err] = true + errorf("%s", err) + } + } + } + exitIfErrors() + + // Check for duplicate loads of the same package. + // That should be impossible, but if it does happen then + // we end up trying to build the same package twice, + // usually in parallel overwriting the same files, + // which doesn't work very well. + seen := map[string]bool{} + reported := map[string]bool{} + for _, pkg := range packageList(pkgs) { + if seen[pkg.ImportPath] && !reported[pkg.ImportPath] { + reported[pkg.ImportPath] = true + errorf("internal error: duplicate loads of %s", pkg.ImportPath) + } + seen[pkg.ImportPath] = true + } + exitIfErrors() + + return pkgs +} + +// hasSubdir reports whether dir is a subdirectory of +// (possibly multiple levels below) root. +// If so, it sets rel to the path fragment that must be +// appended to root to reach dir. +func hasSubdir(root, dir string) (rel string, ok bool) { + if p, err := filepath.EvalSymlinks(root); err == nil { + root = p + } + if p, err := filepath.EvalSymlinks(dir); err == nil { + dir = p + } + const sep = string(filepath.Separator) + root = filepath.Clean(root) + if !strings.HasSuffix(root, sep) { + root += sep + } + dir = filepath.Clean(dir) + if !strings.HasPrefix(dir, root) { + return "", false + } + return filepath.ToSlash(dir[len(root):]), true +} + +var ( + errBuildIDToolchain = fmt.Errorf("build ID only supported in gc toolchain") + errBuildIDMalformed = fmt.Errorf("malformed object file") + errBuildIDUnknown = fmt.Errorf("lost build ID") +) + +var ( + bangArch = []byte("!") + pkgdef = []byte("__.PKGDEF") + goobject = []byte("go object ") + buildid = []byte("build id ") +) + +// readBuildID reads the build ID from an archive or binary. +// It only supports the gc toolchain. +// Other toolchain maintainers should adjust this function. +func readBuildID(p *Package) (id string, err error) { + if buildToolchain != (gcToolchain{}) { + return "", errBuildIDToolchain + } + + // For commands, read build ID directly from binary. + if p.Name == "main" { + return ReadBuildIDFromBinary(p.Target) + } + + // Otherwise, we expect to have an archive (.a) file, + // and we can read the build ID from the Go export data. + if !strings.HasSuffix(p.Target, ".a") { + return "", &os.PathError{Op: "parse", Path: p.Target, Err: errBuildIDUnknown} + } + + // Read just enough of the target to fetch the build ID. + // The archive is expected to look like: + // + // ! + // __.PKGDEF 0 0 0 644 7955 ` + // go object darwin amd64 devel X:none + // build id "b41e5c45250e25c9fd5e9f9a1de7857ea0d41224" + // + // The variable-sized strings are GOOS, GOARCH, and the experiment list (X:none). + // Reading the first 1024 bytes should be plenty. + f, err := os.Open(p.Target) + if err != nil { + return "", err + } + data := make([]byte, 1024) + n, err := io.ReadFull(f, data) + f.Close() + + if err != nil && n == 0 { + return "", err + } + + bad := func() (string, error) { + return "", &os.PathError{Op: "parse", Path: p.Target, Err: errBuildIDMalformed} + } + + // Archive header. + for i := 0; ; i++ { // returns during i==3 + j := bytes.IndexByte(data, '\n') + if j < 0 { + return bad() + } + line := data[:j] + data = data[j+1:] + switch i { + case 0: + if !bytes.Equal(line, bangArch) { + return bad() + } + case 1: + if !bytes.HasPrefix(line, pkgdef) { + return bad() + } + case 2: + if !bytes.HasPrefix(line, goobject) { + return bad() + } + case 3: + if !bytes.HasPrefix(line, buildid) { + // Found the object header, just doesn't have a build id line. + // Treat as successful, with empty build id. + return "", nil + } + id, err := strconv.Unquote(string(line[len(buildid):])) + if err != nil { + return bad() + } + return id, nil + } + } +} + +var ( + goBuildPrefix = []byte("\xff Go build ID: \"") + goBuildEnd = []byte("\"\n \xff") + + elfPrefix = []byte("\x7fELF") +) + +// ReadBuildIDFromBinary reads the build ID from a binary. +// +// ELF binaries store the build ID in a proper PT_NOTE section. +// +// Other binary formats are not so flexible. For those, the linker +// stores the build ID as non-instruction bytes at the very beginning +// of the text segment, which should appear near the beginning +// of the file. This is clumsy but fairly portable. Custom locations +// can be added for other binary types as needed, like we did for ELF. +func ReadBuildIDFromBinary(filename string) (id string, err error) { + if filename == "" { + return "", &os.PathError{Op: "parse", Path: filename, Err: errBuildIDUnknown} + } + + // Read the first 16 kB of the binary file. + // That should be enough to find the build ID. + // In ELF files, the build ID is in the leading headers, + // which are typically less than 4 kB, not to mention 16 kB. + // On other systems, we're trying to read enough that + // we get the beginning of the text segment in the read. + // The offset where the text segment begins in a hello + // world compiled for each different object format today: + // + // Plan 9: 0x20 + // Windows: 0x600 + // Mach-O: 0x2000 + // + f, err := os.Open(filename) + if err != nil { + return "", err + } + defer f.Close() + + data := make([]byte, 16*1024) + _, err = io.ReadFull(f, data) + if err == io.ErrUnexpectedEOF { + err = nil + } + if err != nil { + return "", err + } + + if bytes.HasPrefix(data, elfPrefix) { + return readELFGoBuildID(filename, f, data) + } + + i := bytes.Index(data, goBuildPrefix) + if i < 0 { + // Missing. Treat as successful but build ID empty. + return "", nil + } + + j := bytes.Index(data[i+len(goBuildPrefix):], goBuildEnd) + if j < 0 { + return "", &os.PathError{Op: "parse", Path: filename, Err: errBuildIDMalformed} + } + + quoted := data[i+len(goBuildPrefix)-1 : i+len(goBuildPrefix)+j+1] + id, err = strconv.Unquote(string(quoted)) + if err != nil { + return "", &os.PathError{Op: "parse", Path: filename, Err: errBuildIDMalformed} + } + + return id, nil +} diff --git a/src/cmd/go/pkg_test.go b/src/cmd/go/pkg_test.go new file mode 100644 index 0000000000000000000000000000000000000000..06b9f0ac6ebcb0fe1802756c8355edc86d07b72d --- /dev/null +++ b/src/cmd/go/pkg_test.go @@ -0,0 +1,73 @@ +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +import ( + "reflect" + "strings" + "testing" +) + +var foldDupTests = []struct { + list []string + f1, f2 string +}{ + {stringList("math/rand", "math/big"), "", ""}, + {stringList("math", "strings"), "", ""}, + {stringList("strings"), "", ""}, + {stringList("strings", "strings"), "strings", "strings"}, + {stringList("Rand", "rand", "math", "math/rand", "math/Rand"), "Rand", "rand"}, +} + +func TestFoldDup(t *testing.T) { + for _, tt := range foldDupTests { + f1, f2 := foldDup(tt.list) + if f1 != tt.f1 || f2 != tt.f2 { + t.Errorf("foldDup(%q) = %q, %q, want %q, %q", tt.list, f1, f2, tt.f1, tt.f2) + } + } +} + +var parseMetaGoImportsTests = []struct { + in string + out []metaImport +}{ + { + ``, + []metaImport{{"foo/bar", "git", "https://github.com/rsc/foo/bar"}}, + }, + { + ` + `, + []metaImport{ + {"foo/bar", "git", "https://github.com/rsc/foo/bar"}, + {"baz/quux", "git", "http://github.com/rsc/baz/quux"}, + }, + }, + { + ` + + `, + []metaImport{{"foo/bar", "git", "https://github.com/rsc/foo/bar"}}, + }, + { + ` + `, + []metaImport{{"foo/bar", "git", "https://github.com/rsc/foo/bar"}}, + }, +} + +func TestParseMetaGoImports(t *testing.T) { + for i, tt := range parseMetaGoImportsTests { + out, err := parseMetaGoImports(strings.NewReader(tt.in)) + if err != nil { + t.Errorf("test#%d: %v", i, err) + continue + } + if !reflect.DeepEqual(out, tt.out) { + t.Errorf("test#%d:\n\thave %q\n\twant %q", i, out, tt.out) + } + } +} diff --git a/src/cmd/go/run.go b/src/cmd/go/run.go new file mode 100644 index 0000000000000000000000000000000000000000..f6da373e2522d4b491a58af224859e8d862f39d9 --- /dev/null +++ b/src/cmd/go/run.go @@ -0,0 +1,146 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +import ( + "fmt" + "os" + "os/exec" + "runtime" + "strings" +) + +var execCmd []string // -exec flag, for run and test + +func findExecCmd() []string { + if execCmd != nil { + return execCmd + } + execCmd = []string{} // avoid work the second time + if goos == runtime.GOOS && goarch == runtime.GOARCH { + return execCmd + } + path, err := exec.LookPath(fmt.Sprintf("go_%s_%s_exec", goos, goarch)) + if err == nil { + execCmd = []string{path} + } + return execCmd +} + +var cmdRun = &Command{ + UsageLine: "run [build flags] [-exec xprog] gofiles... [arguments...]", + Short: "compile and run Go program", + Long: ` +Run compiles and runs the main package comprising the named Go source files. +A Go source file is defined to be a file ending in a literal ".go" suffix. + +By default, 'go run' runs the compiled binary directly: 'a.out arguments...'. +If the -exec flag is given, 'go run' invokes the binary using xprog: + 'xprog a.out arguments...'. +If the -exec flag is not given, GOOS or GOARCH is different from the system +default, and a program named go_$GOOS_$GOARCH_exec can be found +on the current search path, 'go run' invokes the binary using that program, +for example 'go_nacl_386_exec a.out arguments...'. This allows execution of +cross-compiled programs when a simulator or other execution method is +available. + +For more about build flags, see 'go help build'. + +See also: go build. + `, +} + +func init() { + cmdRun.Run = runRun // break init loop + + addBuildFlags(cmdRun) + cmdRun.Flag.Var((*stringsFlag)(&execCmd), "exec", "") +} + +func printStderr(args ...interface{}) (int, error) { + return fmt.Fprint(os.Stderr, args...) +} + +func runRun(cmd *Command, args []string) { + raceInit() + buildModeInit() + var b builder + b.init() + b.print = printStderr + i := 0 + for i < len(args) && strings.HasSuffix(args[i], ".go") { + i++ + } + files, cmdArgs := args[:i], args[i:] + if len(files) == 0 { + fatalf("go run: no go files listed") + } + for _, file := range files { + if strings.HasSuffix(file, "_test.go") { + // goFilesPackage is going to assign this to TestGoFiles. + // Reject since it won't be part of the build. + fatalf("go run: cannot run *_test.go files (%s)", file) + } + } + p := goFilesPackage(files) + if p.Error != nil { + fatalf("%s", p.Error) + } + p.omitDWARF = true + for _, err := range p.DepsErrors { + errorf("%s", err) + } + exitIfErrors() + if p.Name != "main" { + fatalf("go run: cannot run non-main package") + } + p.target = "" // must build - not up to date + var src string + if len(p.GoFiles) > 0 { + src = p.GoFiles[0] + } else if len(p.CgoFiles) > 0 { + src = p.CgoFiles[0] + } else { + // this case could only happen if the provided source uses cgo + // while cgo is disabled. + hint := "" + if !buildContext.CgoEnabled { + hint = " (cgo is disabled)" + } + fatalf("go run: no suitable source files%s", hint) + } + p.exeName = src[:len(src)-len(".go")] // name temporary executable for first go file + a1 := b.action(modeBuild, modeBuild, p) + a := &action{f: (*builder).runProgram, args: cmdArgs, deps: []*action{a1}} + b.do(a) +} + +// runProgram is the action for running a binary that has already +// been compiled. We ignore exit status. +func (b *builder) runProgram(a *action) error { + cmdline := stringList(findExecCmd(), a.deps[0].target, a.args) + if buildN || buildX { + b.showcmd("", "%s", strings.Join(cmdline, " ")) + if buildN { + return nil + } + } + + runStdin(cmdline) + return nil +} + +// runStdin is like run, but connects Stdin. +func runStdin(cmdline []string) { + cmd := exec.Command(cmdline[0], cmdline[1:]...) + cmd.Stdin = os.Stdin + cmd.Stdout = os.Stdout + cmd.Stderr = os.Stderr + cmd.Env = origEnv + startSigHandlers() + if err := cmd.Run(); err != nil { + errorf("%v", err) + } +} diff --git a/src/cmd/go/signal.go b/src/cmd/go/signal.go new file mode 100644 index 0000000000000000000000000000000000000000..e8ba0d36556ad4efd9f2a83e8c8b37cf0e95c24e --- /dev/null +++ b/src/cmd/go/signal.go @@ -0,0 +1,31 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +import ( + "os" + "os/signal" + "sync" +) + +// interrupted is closed, if go process is interrupted. +var interrupted = make(chan struct{}) + +// processSignals setups signal handler. +func processSignals() { + sig := make(chan os.Signal) + signal.Notify(sig, signalsToIgnore...) + go func() { + <-sig + close(interrupted) + }() +} + +var onceProcessSignals sync.Once + +// startSigHandlers start signal handlers. +func startSigHandlers() { + onceProcessSignals.Do(processSignals) +} diff --git a/src/cmd/go/signal_notunix.go b/src/cmd/go/signal_notunix.go new file mode 100644 index 0000000000000000000000000000000000000000..29aa9d8c209ada3ee07d17dbb1e623b98bc6e379 --- /dev/null +++ b/src/cmd/go/signal_notunix.go @@ -0,0 +1,17 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build plan9 windows + +package main + +import ( + "os" +) + +var signalsToIgnore = []os.Signal{os.Interrupt} + +// signalTrace is the signal to send to make a Go program +// crash with a stack trace. +var signalTrace os.Signal = nil diff --git a/src/cmd/go/signal_unix.go b/src/cmd/go/signal_unix.go new file mode 100644 index 0000000000000000000000000000000000000000..e86cd4652311ccdb851d7cfa72c596a6dbb2fdf9 --- /dev/null +++ b/src/cmd/go/signal_unix.go @@ -0,0 +1,18 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build darwin dragonfly freebsd linux nacl netbsd openbsd solaris + +package main + +import ( + "os" + "syscall" +) + +var signalsToIgnore = []os.Signal{os.Interrupt, syscall.SIGQUIT} + +// signalTrace is the signal to send to make a Go program +// crash with a stack trace. +var signalTrace os.Signal = syscall.SIGQUIT diff --git a/src/cmd/go/tag_test.go b/src/cmd/go/tag_test.go new file mode 100644 index 0000000000000000000000000000000000000000..ffe218c7b6d5d77154e2428c12837f08b8871dc2 --- /dev/null +++ b/src/cmd/go/tag_test.go @@ -0,0 +1,100 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +import "testing" + +var selectTagTestTags = []string{ + "go.r58", + "go.r58.1", + "go.r59", + "go.r59.1", + "go.r61", + "go.r61.1", + "go.weekly.2010-01-02", + "go.weekly.2011-10-12", + "go.weekly.2011-10-12.1", + "go.weekly.2011-10-14", + "go.weekly.2011-11-01", + "go1", + "go1.0.1", + "go1.999", + "go1.9.2", + "go5", + + // these should be ignored: + "release.r59", + "release.r59.1", + "release", + "weekly.2011-10-12", + "weekly.2011-10-12.1", + "weekly", + "foo", + "bar", + "go.f00", + "go!r60", + "go.1999-01-01", + "go.2x", + "go.20000000000000", + "go.2.", + "go.2.0", + "go2x", + "go20000000000000", + "go2.", + "go2.0", +} + +var selectTagTests = []struct { + version string + selected string +}{ + /* + {"release.r57", ""}, + {"release.r58.2", "go.r58.1"}, + {"release.r59", "go.r59"}, + {"release.r59.1", "go.r59.1"}, + {"release.r60", "go.r59.1"}, + {"release.r60.1", "go.r59.1"}, + {"release.r61", "go.r61"}, + {"release.r66", "go.r61.1"}, + {"weekly.2010-01-01", ""}, + {"weekly.2010-01-02", "go.weekly.2010-01-02"}, + {"weekly.2010-01-02.1", "go.weekly.2010-01-02"}, + {"weekly.2010-01-03", "go.weekly.2010-01-02"}, + {"weekly.2011-10-12", "go.weekly.2011-10-12"}, + {"weekly.2011-10-12.1", "go.weekly.2011-10-12.1"}, + {"weekly.2011-10-13", "go.weekly.2011-10-12.1"}, + {"weekly.2011-10-14", "go.weekly.2011-10-14"}, + {"weekly.2011-10-14.1", "go.weekly.2011-10-14"}, + {"weekly.2011-11-01", "go.weekly.2011-11-01"}, + {"weekly.2014-01-01", "go.weekly.2011-11-01"}, + {"weekly.3000-01-01", "go.weekly.2011-11-01"}, + {"go1", "go1"}, + {"go1.1", "go1.0.1"}, + {"go1.998", "go1.9.2"}, + {"go1.1000", "go1.999"}, + {"go6", "go5"}, + + // faulty versions: + {"release.f00", ""}, + {"weekly.1999-01-01", ""}, + {"junk", ""}, + {"", ""}, + {"go2x", ""}, + {"go200000000000", ""}, + {"go2.", ""}, + {"go2.0", ""}, + */ + {"anything", "go1"}, +} + +func TestSelectTag(t *testing.T) { + for _, c := range selectTagTests { + selected := selectTag(c.version, selectTagTestTags) + if selected != c.selected { + t.Errorf("selectTag(%q) = %q, want %q", c.version, selected, c.selected) + } + } +} diff --git a/src/cmd/go/test.go b/src/cmd/go/test.go new file mode 100644 index 0000000000000000000000000000000000000000..ba1ab82680d9c06112d18c7b79f1d9ea9200298e --- /dev/null +++ b/src/cmd/go/test.go @@ -0,0 +1,1447 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +import ( + "bytes" + "errors" + "fmt" + "go/ast" + "go/build" + "go/doc" + "go/parser" + "go/token" + "log" + "os" + "os/exec" + "path" + "path/filepath" + "regexp" + "runtime" + "sort" + "strings" + "text/template" + "time" + "unicode" + "unicode/utf8" +) + +// Break init loop. +func init() { + cmdTest.Run = runTest +} + +const testUsage = "test [-c] [-i] [build and test flags] [packages] [flags for test binary]" + +var cmdTest = &Command{ + CustomFlags: true, + UsageLine: testUsage, + Short: "test packages", + Long: ` +'Go test' automates testing the packages named by the import paths. +It prints a summary of the test results in the format: + + ok archive/tar 0.011s + FAIL archive/zip 0.022s + ok compress/gzip 0.033s + ... + +followed by detailed output for each failed package. + +'Go test' recompiles each package along with any files with names matching +the file pattern "*_test.go". +Files whose names begin with "_" (including "_test.go") or "." are ignored. +These additional files can contain test functions, benchmark functions, and +example functions. See 'go help testfunc' for more. +Each listed package causes the execution of a separate test binary. + +Test files that declare a package with the suffix "_test" will be compiled as a +separate package, and then linked and run with the main test binary. + +By default, go test needs no arguments. It compiles and tests the package +with source in the current directory, including tests, and runs the tests. + +The package is built in a temporary directory so it does not interfere with the +non-test installation. + +` + strings.TrimSpace(testFlag1) + ` See 'go help testflag' for details. + +If the test binary needs any other flags, they should be presented after the +package names. The go tool treats as a flag the first argument that begins with +a minus sign that it does not recognize itself; that argument and all subsequent +arguments are passed as arguments to the test binary. + +For more about build flags, see 'go help build'. +For more about specifying packages, see 'go help packages'. + +See also: go build, go vet. +`, +} + +const testFlag1 = ` +In addition to the build flags, the flags handled by 'go test' itself are: + + -c + Compile the test binary to pkg.test but do not run it + (where pkg is the last element of the package's import path). + The file name can be changed with the -o flag. + + -exec xprog + Run the test binary using xprog. The behavior is the same as + in 'go run'. See 'go help run' for details. + + -i + Install packages that are dependencies of the test. + Do not run the test. + + -o file + Compile the test binary to the named file. + The test still runs (unless -c or -i is specified). + +The test binary also accepts flags that control execution of the test; these +flags are also accessible by 'go test'. +` + +var helpTestflag = &Command{ + UsageLine: "testflag", + Short: "description of testing flags", + Long: ` +The 'go test' command takes both flags that apply to 'go test' itself +and flags that apply to the resulting test binary. + +Several of the flags control profiling and write an execution profile +suitable for "go tool pprof"; run "go tool pprof -h" for more +information. The --alloc_space, --alloc_objects, and --show_bytes +options of pprof control how the information is presented. + +The following flags are recognized by the 'go test' command and +control the execution of any test: + + ` + strings.TrimSpace(testFlag2) + ` +`, +} + +const testFlag2 = ` + -bench regexp + Run benchmarks matching the regular expression. + By default, no benchmarks run. To run all benchmarks, + use '-bench .' or '-bench=.'. + + -benchmem + Print memory allocation statistics for benchmarks. + + -benchtime t + Run enough iterations of each benchmark to take t, specified + as a time.Duration (for example, -benchtime 1h30s). + The default is 1 second (1s). + + -blockprofile block.out + Write a goroutine blocking profile to the specified file + when all tests are complete. + Writes test binary as -c would. + + -blockprofilerate n + Control the detail provided in goroutine blocking profiles by + calling runtime.SetBlockProfileRate with n. + See 'go doc runtime.SetBlockProfileRate'. + The profiler aims to sample, on average, one blocking event every + n nanoseconds the program spends blocked. By default, + if -test.blockprofile is set without this flag, all blocking events + are recorded, equivalent to -test.blockprofilerate=1. + + -count n + Run each test and benchmark n times (default 1). + If -cpu is set, run n times for each GOMAXPROCS value. + Examples are always run once. + + -cover + Enable coverage analysis. + + -covermode set,count,atomic + Set the mode for coverage analysis for the package[s] + being tested. The default is "set" unless -race is enabled, + in which case it is "atomic". + The values: + set: bool: does this statement run? + count: int: how many times does this statement run? + atomic: int: count, but correct in multithreaded tests; + significantly more expensive. + Sets -cover. + + -coverpkg pkg1,pkg2,pkg3 + Apply coverage analysis in each test to the given list of packages. + The default is for each test to analyze only the package being tested. + Packages are specified as import paths. + Sets -cover. + + -coverprofile cover.out + Write a coverage profile to the file after all tests have passed. + Sets -cover. + + -cpu 1,2,4 + Specify a list of GOMAXPROCS values for which the tests or + benchmarks should be executed. The default is the current value + of GOMAXPROCS. + + -cpuprofile cpu.out + Write a CPU profile to the specified file before exiting. + Writes test binary as -c would. + + -memprofile mem.out + Write a memory profile to the file after all tests have passed. + Writes test binary as -c would. + + -memprofilerate n + Enable more precise (and expensive) memory profiles by setting + runtime.MemProfileRate. See 'go doc runtime.MemProfileRate'. + To profile all memory allocations, use -test.memprofilerate=1 + and pass --alloc_space flag to the pprof tool. + + -outputdir directory + Place output files from profiling in the specified directory, + by default the directory in which "go test" is running. + + -parallel n + Allow parallel execution of test functions that call t.Parallel. + The value of this flag is the maximum number of tests to run + simultaneously; by default, it is set to the value of GOMAXPROCS. + + -run regexp + Run only those tests and examples matching the regular + expression. + + -short + Tell long-running tests to shorten their run time. + It is off by default but set during all.bash so that installing + the Go tree can run a sanity check but not spend time running + exhaustive tests. + + -timeout t + If a test runs longer than t, panic. + The default is 10 minutes (10m). + + -trace trace.out + Write an execution trace to the specified file before exiting. + Writes test binary as -c would. + + -v + Verbose output: log all tests as they are run. Also print all + text from Log and Logf calls even if the test succeeds. + +The test binary, called pkg.test where pkg is the name of the +directory containing the package sources, can be invoked directly +after building it with 'go test -c'. When invoking the test binary +directly, each of the standard flag names must be prefixed with 'test.', +as in -test.run=TestMyFunc or -test.v. + +When running 'go test', flags not listed above are passed through +unaltered. For instance, the command + + go test -x -v -cpuprofile=prof.out -dir=testdata -update + +will compile the test binary and then run it as + + pkg.test -test.v -test.cpuprofile=prof.out -dir=testdata -update + +The test flags that generate profiles (other than for coverage) also +leave the test binary in pkg.test for use when analyzing the profiles. + +Flags not recognized by 'go test' must be placed after any specified packages. +` + +var helpTestfunc = &Command{ + UsageLine: "testfunc", + Short: "description of testing functions", + Long: ` +The 'go test' command expects to find test, benchmark, and example functions +in the "*_test.go" files corresponding to the package under test. + +A test function is one named TestXXX (where XXX is any alphanumeric string +not starting with a lower case letter) and should have the signature, + + func TestXXX(t *testing.T) { ... } + +A benchmark function is one named BenchmarkXXX and should have the signature, + + func BenchmarkXXX(b *testing.B) { ... } + +An example function is similar to a test function but, instead of using +*testing.T to report success or failure, prints output to os.Stdout. +That output is compared against the function's "Output:" comment, which +must be the last comment in the function body (see example below). An +example with no such comment, or with no text after "Output:" is compiled +but not executed. + +Godoc displays the body of ExampleXXX to demonstrate the use +of the function, constant, or variable XXX. An example of a method M with +receiver type T or *T is named ExampleT_M. There may be multiple examples +for a given function, constant, or variable, distinguished by a trailing _xxx, +where xxx is a suffix not beginning with an upper case letter. + +Here is an example of an example: + + func ExamplePrintln() { + Println("The output of\nthis example.") + // Output: The output of + // this example. + } + +The entire test file is presented as the example when it contains a single +example function, at least one other function, type, variable, or constant +declaration, and no test or benchmark functions. + +See the documentation of the testing package for more information. +`, +} + +var ( + testC bool // -c flag + testCover bool // -cover flag + testCoverMode string // -covermode flag + testCoverPaths []string // -coverpkg flag + testCoverPkgs []*Package // -coverpkg flag + testO string // -o flag + testProfile bool // some profiling flag + testNeedBinary bool // profile needs to keep binary around + testV bool // -v flag + testTimeout string // -timeout flag + testArgs []string + testBench bool + testStreamOutput bool // show output as it is generated + testShowPass bool // show passing output + + testKillTimeout = 10 * time.Minute +) + +var testMainDeps = map[string]bool{ + // Dependencies for testmain. + "testing": true, + "regexp": true, + "os": true, +} + +func runTest(cmd *Command, args []string) { + var pkgArgs []string + pkgArgs, testArgs = testFlags(args) + + findExecCmd() // initialize cached result + + raceInit() + buildModeInit() + pkgs := packagesForBuild(pkgArgs) + if len(pkgs) == 0 { + fatalf("no packages to test") + } + + if testC && len(pkgs) != 1 { + fatalf("cannot use -c flag with multiple packages") + } + if testO != "" && len(pkgs) != 1 { + fatalf("cannot use -o flag with multiple packages") + } + if testProfile && len(pkgs) != 1 { + fatalf("cannot use test profile flag with multiple packages") + } + + // If a test timeout was given and is parseable, set our kill timeout + // to that timeout plus one minute. This is a backup alarm in case + // the test wedges with a goroutine spinning and its background + // timer does not get a chance to fire. + if dt, err := time.ParseDuration(testTimeout); err == nil && dt > 0 { + testKillTimeout = dt + 1*time.Minute + } + + // show passing test output (after buffering) with -v flag. + // must buffer because tests are running in parallel, and + // otherwise the output will get mixed. + testShowPass = testV + + // stream test output (no buffering) when no package has + // been given on the command line (implicit current directory) + // or when benchmarking. + // Also stream if we're showing output anyway with a + // single package under test or if parallelism is set to 1. + // In these cases, streaming the output produces the same result + // as not streaming, just more immediately. + testStreamOutput = len(pkgArgs) == 0 || testBench || + (testShowPass && (len(pkgs) == 1 || buildP == 1)) + + var b builder + b.init() + + if buildI { + buildV = testV + + deps := make(map[string]bool) + for dep := range testMainDeps { + deps[dep] = true + } + + for _, p := range pkgs { + // Dependencies for each test. + for _, path := range p.Imports { + deps[path] = true + } + for _, path := range p.vendored(p.TestImports) { + deps[path] = true + } + for _, path := range p.vendored(p.XTestImports) { + deps[path] = true + } + } + + // translate C to runtime/cgo + if deps["C"] { + delete(deps, "C") + deps["runtime/cgo"] = true + if goos == runtime.GOOS && goarch == runtime.GOARCH && !buildRace { + deps["cmd/cgo"] = true + } + } + // Ignore pseudo-packages. + delete(deps, "unsafe") + + all := []string{} + for path := range deps { + if !build.IsLocalImport(path) { + all = append(all, path) + } + } + sort.Strings(all) + + a := &action{} + for _, p := range packagesForBuild(all) { + a.deps = append(a.deps, b.action(modeInstall, modeInstall, p)) + } + b.do(a) + if !testC || a.failed { + return + } + b.init() + } + + var builds, runs, prints []*action + + if testCoverPaths != nil { + // Load packages that were asked about for coverage. + // packagesForBuild exits if the packages cannot be loaded. + testCoverPkgs = packagesForBuild(testCoverPaths) + + // Warn about -coverpkg arguments that are not actually used. + used := make(map[string]bool) + for _, p := range pkgs { + used[p.ImportPath] = true + for _, dep := range p.Deps { + used[dep] = true + } + } + for _, p := range testCoverPkgs { + if !used[p.ImportPath] { + log.Printf("warning: no packages being tested depend on %s", p.ImportPath) + } + } + + // Mark all the coverage packages for rebuilding with coverage. + for _, p := range testCoverPkgs { + // There is nothing to cover in package unsafe; it comes from the compiler. + if p.ImportPath == "unsafe" { + continue + } + p.Stale = true // rebuild + p.fake = true // do not warn about rebuild + p.coverMode = testCoverMode + var coverFiles []string + coverFiles = append(coverFiles, p.GoFiles...) + coverFiles = append(coverFiles, p.CgoFiles...) + coverFiles = append(coverFiles, p.TestGoFiles...) + p.coverVars = declareCoverVars(p.ImportPath, coverFiles...) + } + } + + // Prepare build + run + print actions for all packages being tested. + for _, p := range pkgs { + buildTest, runTest, printTest, err := b.test(p) + if err != nil { + str := err.Error() + if strings.HasPrefix(str, "\n") { + str = str[1:] + } + failed := fmt.Sprintf("FAIL\t%s [setup failed]\n", p.ImportPath) + + if p.ImportPath != "" { + errorf("# %s\n%s\n%s", p.ImportPath, str, failed) + } else { + errorf("%s\n%s", str, failed) + } + continue + } + builds = append(builds, buildTest) + runs = append(runs, runTest) + prints = append(prints, printTest) + } + + // Ultimately the goal is to print the output. + root := &action{deps: prints} + + // Force the printing of results to happen in order, + // one at a time. + for i, a := range prints { + if i > 0 { + a.deps = append(a.deps, prints[i-1]) + } + } + + // Force benchmarks to run in serial. + if !testC && testBench { + // The first run must wait for all builds. + // Later runs must wait for the previous run's print. + for i, run := range runs { + if i == 0 { + run.deps = append(run.deps, builds...) + } else { + run.deps = append(run.deps, prints[i-1]) + } + } + } + + // If we are building any out-of-date packages other + // than those under test, warn. + okBuild := map[*Package]bool{} + for _, p := range pkgs { + okBuild[p] = true + } + warned := false + for _, a := range actionList(root) { + if a.p == nil || okBuild[a.p] { + continue + } + okBuild[a.p] = true // warn at most once + + // Don't warn about packages being rebuilt because of + // things like coverage analysis. + for _, p1 := range a.p.imports { + if p1.fake { + a.p.fake = true + } + } + + if a.f != nil && !okBuild[a.p] && !a.p.fake && !a.p.local { + if !warned { + fmt.Fprintf(os.Stderr, "warning: building out-of-date packages:\n") + warned = true + } + fmt.Fprintf(os.Stderr, "\t%s\n", a.p.ImportPath) + } + } + if warned { + args := strings.Join(pkgArgs, " ") + if args != "" { + args = " " + args + } + extraOpts := "" + if buildRace { + extraOpts = "-race " + } + fmt.Fprintf(os.Stderr, "installing these packages with 'go test %s-i%s' will speed future tests.\n\n", extraOpts, args) + } + + b.do(root) +} + +func contains(x []string, s string) bool { + for _, t := range x { + if t == s { + return true + } + } + return false +} + +var windowsBadWords = []string{ + "install", + "patch", + "setup", + "update", +} + +func (b *builder) test(p *Package) (buildAction, runAction, printAction *action, err error) { + if len(p.TestGoFiles)+len(p.XTestGoFiles) == 0 { + build := b.action(modeBuild, modeBuild, p) + run := &action{p: p, deps: []*action{build}} + print := &action{f: (*builder).notest, p: p, deps: []*action{run}} + return build, run, print, nil + } + + // Build Package structs describing: + // ptest - package + test files + // pxtest - package of external test files + // pmain - pkg.test binary + var ptest, pxtest, pmain *Package + + var imports, ximports []*Package + var stk importStack + stk.push(p.ImportPath + " (test)") + for i, path := range p.TestImports { + p1 := loadImport(path, p.Dir, p, &stk, p.build.TestImportPos[path], useVendor) + if p1.Error != nil { + return nil, nil, nil, p1.Error + } + if len(p1.DepsErrors) > 0 { + err := p1.DepsErrors[0] + err.Pos = "" // show full import stack + return nil, nil, nil, err + } + if contains(p1.Deps, p.ImportPath) || p1.ImportPath == p.ImportPath { + // Same error that loadPackage returns (via reusePackage) in pkg.go. + // Can't change that code, because that code is only for loading the + // non-test copy of a package. + err := &PackageError{ + ImportStack: testImportStack(stk[0], p1, p.ImportPath), + Err: "import cycle not allowed in test", + isImportCycle: true, + } + return nil, nil, nil, err + } + p.TestImports[i] = p1.ImportPath + imports = append(imports, p1) + } + stk.pop() + stk.push(p.ImportPath + "_test") + pxtestNeedsPtest := false + for i, path := range p.XTestImports { + p1 := loadImport(path, p.Dir, p, &stk, p.build.XTestImportPos[path], useVendor) + if p1.Error != nil { + return nil, nil, nil, p1.Error + } + if len(p1.DepsErrors) > 0 { + err := p1.DepsErrors[0] + err.Pos = "" // show full import stack + return nil, nil, nil, err + } + if p1.ImportPath == p.ImportPath { + pxtestNeedsPtest = true + } else { + ximports = append(ximports, p1) + } + p.XTestImports[i] = p1.ImportPath + } + stk.pop() + + // Use last element of import path, not package name. + // They differ when package name is "main". + // But if the import path is "command-line-arguments", + // like it is during 'go run', use the package name. + var elem string + if p.ImportPath == "command-line-arguments" { + elem = p.Name + } else { + _, elem = path.Split(p.ImportPath) + } + testBinary := elem + ".test" + + // The ptest package needs to be importable under the + // same import path that p has, but we cannot put it in + // the usual place in the temporary tree, because then + // other tests will see it as the real package. + // Instead we make a _test directory under the import path + // and then repeat the import path there. We tell the + // compiler and linker to look in that _test directory first. + // + // That is, if the package under test is unicode/utf8, + // then the normal place to write the package archive is + // $WORK/unicode/utf8.a, but we write the test package archive to + // $WORK/unicode/utf8/_test/unicode/utf8.a. + // We write the external test package archive to + // $WORK/unicode/utf8/_test/unicode/utf8_test.a. + testDir := filepath.Join(b.work, filepath.FromSlash(p.ImportPath+"/_test")) + ptestObj := buildToolchain.pkgpath(testDir, p) + + // Create the directory for the .a files. + ptestDir, _ := filepath.Split(ptestObj) + if err := b.mkdir(ptestDir); err != nil { + return nil, nil, nil, err + } + + // Should we apply coverage analysis locally, + // only for this package and only for this test? + // Yes, if -cover is on but -coverpkg has not specified + // a list of packages for global coverage. + localCover := testCover && testCoverPaths == nil + + // Test package. + if len(p.TestGoFiles) > 0 || localCover || p.Name == "main" { + ptest = new(Package) + *ptest = *p + ptest.GoFiles = nil + ptest.GoFiles = append(ptest.GoFiles, p.GoFiles...) + ptest.GoFiles = append(ptest.GoFiles, p.TestGoFiles...) + ptest.target = "" + ptest.Imports = stringList(p.Imports, p.TestImports) + ptest.imports = append(append([]*Package{}, p.imports...), imports...) + ptest.pkgdir = testDir + ptest.fake = true + ptest.forceLibrary = true + ptest.Stale = true + ptest.build = new(build.Package) + *ptest.build = *p.build + m := map[string][]token.Position{} + for k, v := range p.build.ImportPos { + m[k] = append(m[k], v...) + } + for k, v := range p.build.TestImportPos { + m[k] = append(m[k], v...) + } + ptest.build.ImportPos = m + + if localCover { + ptest.coverMode = testCoverMode + var coverFiles []string + coverFiles = append(coverFiles, ptest.GoFiles...) + coverFiles = append(coverFiles, ptest.CgoFiles...) + ptest.coverVars = declareCoverVars(ptest.ImportPath, coverFiles...) + } + } else { + ptest = p + } + + // External test package. + if len(p.XTestGoFiles) > 0 { + pxtest = &Package{ + Name: p.Name + "_test", + ImportPath: p.ImportPath + "_test", + localPrefix: p.localPrefix, + Root: p.Root, + Dir: p.Dir, + GoFiles: p.XTestGoFiles, + Imports: p.XTestImports, + build: &build.Package{ + ImportPos: p.build.XTestImportPos, + }, + imports: ximports, + pkgdir: testDir, + fake: true, + external: true, + Stale: true, + } + if pxtestNeedsPtest { + pxtest.imports = append(pxtest.imports, ptest) + } + } + + // Action for building pkg.test. + pmain = &Package{ + Name: "main", + Dir: testDir, + GoFiles: []string{"_testmain.go"}, + ImportPath: "testmain", + Root: p.Root, + build: &build.Package{Name: "main"}, + pkgdir: testDir, + fake: true, + Stale: true, + omitDWARF: !testC && !testNeedBinary, + } + + // The generated main also imports testing, regexp, and os. + stk.push("testmain") + for dep := range testMainDeps { + if dep == ptest.ImportPath { + pmain.imports = append(pmain.imports, ptest) + } else { + p1 := loadImport(dep, "", nil, &stk, nil, 0) + if p1.Error != nil { + return nil, nil, nil, p1.Error + } + pmain.imports = append(pmain.imports, p1) + } + } + + if testCoverPkgs != nil { + // Add imports, but avoid duplicates. + seen := map[*Package]bool{p: true, ptest: true} + for _, p1 := range pmain.imports { + seen[p1] = true + } + for _, p1 := range testCoverPkgs { + if !seen[p1] { + seen[p1] = true + pmain.imports = append(pmain.imports, p1) + } + } + } + + // Do initial scan for metadata needed for writing _testmain.go + // Use that metadata to update the list of imports for package main. + // The list of imports is used by recompileForTest and by the loop + // afterward that gathers t.Cover information. + t, err := loadTestFuncs(ptest) + if err != nil { + return nil, nil, nil, err + } + if len(ptest.GoFiles) > 0 { + pmain.imports = append(pmain.imports, ptest) + t.ImportTest = true + } + if pxtest != nil { + pmain.imports = append(pmain.imports, pxtest) + t.ImportXtest = true + } + + if ptest != p && localCover { + // We have made modifications to the package p being tested + // and are rebuilding p (as ptest), writing it to the testDir tree. + // Arrange to rebuild, writing to that same tree, all packages q + // such that the test depends on q, and q depends on p. + // This makes sure that q sees the modifications to p. + // Strictly speaking, the rebuild is only necessary if the + // modifications to p change its export metadata, but + // determining that is a bit tricky, so we rebuild always. + // + // This will cause extra compilation, so for now we only do it + // when testCover is set. The conditions are more general, though, + // and we may find that we need to do it always in the future. + recompileForTest(pmain, p, ptest, testDir) + } + + if buildContext.GOOS == "darwin" { + if buildContext.GOARCH == "arm" || buildContext.GOARCH == "arm64" { + t.NeedCgo = true + } + } + + for _, cp := range pmain.imports { + if len(cp.coverVars) > 0 { + t.Cover = append(t.Cover, coverInfo{cp, cp.coverVars}) + } + } + + // writeTestmain writes _testmain.go. This must happen after recompileForTest, + // because recompileForTest modifies XXX. + if err := writeTestmain(filepath.Join(testDir, "_testmain.go"), t); err != nil { + return nil, nil, nil, err + } + + computeStale(pmain) + + if ptest != p { + a := b.action(modeBuild, modeBuild, ptest) + a.objdir = testDir + string(filepath.Separator) + "_obj_test" + string(filepath.Separator) + a.objpkg = ptestObj + a.target = ptestObj + a.link = false + } + + if pxtest != nil { + a := b.action(modeBuild, modeBuild, pxtest) + a.objdir = testDir + string(filepath.Separator) + "_obj_xtest" + string(filepath.Separator) + a.objpkg = buildToolchain.pkgpath(testDir, pxtest) + a.target = a.objpkg + } + + a := b.action(modeBuild, modeBuild, pmain) + a.objdir = testDir + string(filepath.Separator) + a.objpkg = filepath.Join(testDir, "main.a") + a.target = filepath.Join(testDir, testBinary) + exeSuffix + if goos == "windows" { + // There are many reserved words on Windows that, + // if used in the name of an executable, cause Windows + // to try to ask for extra permissions. + // The word list includes setup, install, update, and patch, + // but it does not appear to be defined anywhere. + // We have run into this trying to run the + // go.codereview/patch tests. + // For package names containing those words, use test.test.exe + // instead of pkgname.test.exe. + // Note that this file name is only used in the Go command's + // temporary directory. If the -c or other flags are + // given, the code below will still use pkgname.test.exe. + // There are two user-visible effects of this change. + // First, you can actually run 'go test' in directories that + // have names that Windows thinks are installer-like, + // without getting a dialog box asking for more permissions. + // Second, in the Windows process listing during go test, + // the test shows up as test.test.exe, not pkgname.test.exe. + // That second one is a drawback, but it seems a small + // price to pay for the test running at all. + // If maintaining the list of bad words is too onerous, + // we could just do this always on Windows. + for _, bad := range windowsBadWords { + if strings.Contains(testBinary, bad) { + a.target = filepath.Join(testDir, "test.test") + exeSuffix + break + } + } + } + buildAction = a + + if testC || testNeedBinary { + // -c or profiling flag: create action to copy binary to ./test.out. + target := filepath.Join(cwd, testBinary+exeSuffix) + if testO != "" { + target = testO + if !filepath.IsAbs(target) { + target = filepath.Join(cwd, target) + } + } + buildAction = &action{ + f: (*builder).install, + deps: []*action{buildAction}, + p: pmain, + target: target, + } + runAction = buildAction // make sure runAction != nil even if not running test + } + if testC { + printAction = &action{p: p, deps: []*action{runAction}} // nop + } else { + // run test + runAction = &action{ + f: (*builder).runTest, + deps: []*action{buildAction}, + p: p, + ignoreFail: true, + } + cleanAction := &action{ + f: (*builder).cleanTest, + deps: []*action{runAction}, + p: p, + } + printAction = &action{ + f: (*builder).printTest, + deps: []*action{cleanAction}, + p: p, + } + } + + return buildAction, runAction, printAction, nil +} + +func testImportStack(top string, p *Package, target string) []string { + stk := []string{top, p.ImportPath} +Search: + for p.ImportPath != target { + for _, p1 := range p.imports { + if p1.ImportPath == target || contains(p1.Deps, target) { + stk = append(stk, p1.ImportPath) + p = p1 + continue Search + } + } + // Can't happen, but in case it does... + stk = append(stk, "") + break + } + return stk +} + +func recompileForTest(pmain, preal, ptest *Package, testDir string) { + // The "test copy" of preal is ptest. + // For each package that depends on preal, make a "test copy" + // that depends on ptest. And so on, up the dependency tree. + testCopy := map[*Package]*Package{preal: ptest} + for _, p := range packageList([]*Package{pmain}) { + // Copy on write. + didSplit := false + split := func() { + if didSplit { + return + } + didSplit = true + if p.pkgdir != testDir { + p1 := new(Package) + testCopy[p] = p1 + *p1 = *p + p1.imports = make([]*Package, len(p.imports)) + copy(p1.imports, p.imports) + p = p1 + p.pkgdir = testDir + p.target = "" + p.fake = true + p.Stale = true + } + } + + // Update p.deps and p.imports to use at test copies. + for i, dep := range p.deps { + if p1 := testCopy[dep]; p1 != nil && p1 != dep { + split() + p.deps[i] = p1 + } + } + for i, imp := range p.imports { + if p1 := testCopy[imp]; p1 != nil && p1 != imp { + split() + p.imports[i] = p1 + } + } + } +} + +var coverIndex = 0 + +// isTestFile reports whether the source file is a set of tests and should therefore +// be excluded from coverage analysis. +func isTestFile(file string) bool { + // We don't cover tests, only the code they test. + return strings.HasSuffix(file, "_test.go") +} + +// declareCoverVars attaches the required cover variables names +// to the files, to be used when annotating the files. +func declareCoverVars(importPath string, files ...string) map[string]*CoverVar { + coverVars := make(map[string]*CoverVar) + for _, file := range files { + if isTestFile(file) { + continue + } + coverVars[file] = &CoverVar{ + File: filepath.Join(importPath, file), + Var: fmt.Sprintf("GoCover_%d", coverIndex), + } + coverIndex++ + } + return coverVars +} + +// runTest is the action for running a test binary. +func (b *builder) runTest(a *action) error { + args := stringList(findExecCmd(), a.deps[0].target, testArgs) + a.testOutput = new(bytes.Buffer) + + if buildN || buildX { + b.showcmd("", "%s", strings.Join(args, " ")) + if buildN { + return nil + } + } + + if a.failed { + // We were unable to build the binary. + a.failed = false + fmt.Fprintf(a.testOutput, "FAIL\t%s [build failed]\n", a.p.ImportPath) + setExitStatus(1) + return nil + } + + cmd := exec.Command(args[0], args[1:]...) + cmd.Dir = a.p.Dir + cmd.Env = envForDir(cmd.Dir, origEnv) + var buf bytes.Buffer + if testStreamOutput { + cmd.Stdout = os.Stdout + cmd.Stderr = os.Stderr + } else { + cmd.Stdout = &buf + cmd.Stderr = &buf + } + + // If there are any local SWIG dependencies, we want to load + // the shared library from the build directory. + if a.p.usesSwig() { + env := cmd.Env + found := false + prefix := "LD_LIBRARY_PATH=" + for i, v := range env { + if strings.HasPrefix(v, prefix) { + env[i] = v + ":." + found = true + break + } + } + if !found { + env = append(env, "LD_LIBRARY_PATH=.") + } + cmd.Env = env + } + + t0 := time.Now() + err := cmd.Start() + + // This is a last-ditch deadline to detect and + // stop wedged test binaries, to keep the builders + // running. + if err == nil { + tick := time.NewTimer(testKillTimeout) + startSigHandlers() + done := make(chan error) + go func() { + done <- cmd.Wait() + }() + Outer: + select { + case err = <-done: + // ok + case <-tick.C: + if signalTrace != nil { + // Send a quit signal in the hope that the program will print + // a stack trace and exit. Give it five seconds before resorting + // to Kill. + cmd.Process.Signal(signalTrace) + select { + case err = <-done: + fmt.Fprintf(&buf, "*** Test killed with %v: ran too long (%v).\n", signalTrace, testKillTimeout) + break Outer + case <-time.After(5 * time.Second): + } + } + cmd.Process.Kill() + err = <-done + fmt.Fprintf(&buf, "*** Test killed: ran too long (%v).\n", testKillTimeout) + } + tick.Stop() + } + out := buf.Bytes() + t := fmt.Sprintf("%.3fs", time.Since(t0).Seconds()) + if err == nil { + if testShowPass { + a.testOutput.Write(out) + } + fmt.Fprintf(a.testOutput, "ok \t%s\t%s%s\n", a.p.ImportPath, t, coveragePercentage(out)) + return nil + } + + setExitStatus(1) + if len(out) > 0 { + a.testOutput.Write(out) + // assume printing the test binary's exit status is superfluous + } else { + fmt.Fprintf(a.testOutput, "%s\n", err) + } + fmt.Fprintf(a.testOutput, "FAIL\t%s\t%s\n", a.p.ImportPath, t) + + return nil +} + +// coveragePercentage returns the coverage results (if enabled) for the +// test. It uncovers the data by scanning the output from the test run. +func coveragePercentage(out []byte) string { + if !testCover { + return "" + } + // The string looks like + // test coverage for encoding/binary: 79.9% of statements + // Extract the piece from the percentage to the end of the line. + re := regexp.MustCompile(`coverage: (.*)\n`) + matches := re.FindSubmatch(out) + if matches == nil { + // Probably running "go test -cover" not "go test -cover fmt". + // The coverage output will appear in the output directly. + return "" + } + return fmt.Sprintf("\tcoverage: %s", matches[1]) +} + +// cleanTest is the action for cleaning up after a test. +func (b *builder) cleanTest(a *action) error { + if buildWork { + return nil + } + run := a.deps[0] + testDir := filepath.Join(b.work, filepath.FromSlash(run.p.ImportPath+"/_test")) + os.RemoveAll(testDir) + return nil +} + +// printTest is the action for printing a test result. +func (b *builder) printTest(a *action) error { + clean := a.deps[0] + run := clean.deps[0] + os.Stdout.Write(run.testOutput.Bytes()) + run.testOutput = nil + return nil +} + +// notest is the action for testing a package with no test files. +func (b *builder) notest(a *action) error { + fmt.Printf("? \t%s\t[no test files]\n", a.p.ImportPath) + return nil +} + +// isTestMain tells whether fn is a TestMain(m *testing.M) function. +func isTestMain(fn *ast.FuncDecl) bool { + if fn.Name.String() != "TestMain" || + fn.Type.Results != nil && len(fn.Type.Results.List) > 0 || + fn.Type.Params == nil || + len(fn.Type.Params.List) != 1 || + len(fn.Type.Params.List[0].Names) > 1 { + return false + } + ptr, ok := fn.Type.Params.List[0].Type.(*ast.StarExpr) + if !ok { + return false + } + // We can't easily check that the type is *testing.M + // because we don't know how testing has been imported, + // but at least check that it's *M or *something.M. + if name, ok := ptr.X.(*ast.Ident); ok && name.Name == "M" { + return true + } + if sel, ok := ptr.X.(*ast.SelectorExpr); ok && sel.Sel.Name == "M" { + return true + } + return false +} + +// isTest tells whether name looks like a test (or benchmark, according to prefix). +// It is a Test (say) if there is a character after Test that is not a lower-case letter. +// We don't want TesticularCancer. +func isTest(name, prefix string) bool { + if !strings.HasPrefix(name, prefix) { + return false + } + if len(name) == len(prefix) { // "Test" is ok + return true + } + rune, _ := utf8.DecodeRuneInString(name[len(prefix):]) + return !unicode.IsLower(rune) +} + +type coverInfo struct { + Package *Package + Vars map[string]*CoverVar +} + +// loadTestFuncs returns the testFuncs describing the tests that will be run. +func loadTestFuncs(ptest *Package) (*testFuncs, error) { + t := &testFuncs{ + Package: ptest, + } + for _, file := range ptest.TestGoFiles { + if err := t.load(filepath.Join(ptest.Dir, file), "_test", &t.ImportTest, &t.NeedTest); err != nil { + return nil, err + } + } + for _, file := range ptest.XTestGoFiles { + if err := t.load(filepath.Join(ptest.Dir, file), "_xtest", &t.ImportXtest, &t.NeedXtest); err != nil { + return nil, err + } + } + return t, nil +} + +// writeTestmain writes the _testmain.go file for t to the file named out. +func writeTestmain(out string, t *testFuncs) error { + f, err := os.Create(out) + if err != nil { + return err + } + defer f.Close() + + if err := testmainTmpl.Execute(f, t); err != nil { + return err + } + + return nil +} + +type testFuncs struct { + Tests []testFunc + Benchmarks []testFunc + Examples []testFunc + TestMain *testFunc + Package *Package + ImportTest bool + NeedTest bool + ImportXtest bool + NeedXtest bool + NeedCgo bool + Cover []coverInfo +} + +func (t *testFuncs) CoverMode() string { + return testCoverMode +} + +func (t *testFuncs) CoverEnabled() bool { + return testCover +} + +// Covered returns a string describing which packages are being tested for coverage. +// If the covered package is the same as the tested package, it returns the empty string. +// Otherwise it is a comma-separated human-readable list of packages beginning with +// " in", ready for use in the coverage message. +func (t *testFuncs) Covered() string { + if testCoverPaths == nil { + return "" + } + return " in " + strings.Join(testCoverPaths, ", ") +} + +// Tested returns the name of the package being tested. +func (t *testFuncs) Tested() string { + return t.Package.Name +} + +type testFunc struct { + Package string // imported package name (_test or _xtest) + Name string // function name + Output string // output, for examples +} + +var testFileSet = token.NewFileSet() + +func (t *testFuncs) load(filename, pkg string, doImport, seen *bool) error { + f, err := parser.ParseFile(testFileSet, filename, nil, parser.ParseComments) + if err != nil { + return expandScanner(err) + } + for _, d := range f.Decls { + n, ok := d.(*ast.FuncDecl) + if !ok { + continue + } + if n.Recv != nil { + continue + } + name := n.Name.String() + switch { + case isTestMain(n): + if t.TestMain != nil { + return errors.New("multiple definitions of TestMain") + } + t.TestMain = &testFunc{pkg, name, ""} + *doImport, *seen = true, true + case isTest(name, "Test"): + t.Tests = append(t.Tests, testFunc{pkg, name, ""}) + *doImport, *seen = true, true + case isTest(name, "Benchmark"): + t.Benchmarks = append(t.Benchmarks, testFunc{pkg, name, ""}) + *doImport, *seen = true, true + } + } + ex := doc.Examples(f) + sort.Sort(byOrder(ex)) + for _, e := range ex { + *doImport = true // import test file whether executed or not + if e.Output == "" && !e.EmptyOutput { + // Don't run examples with no output. + continue + } + t.Examples = append(t.Examples, testFunc{pkg, "Example" + e.Name, e.Output}) + *seen = true + } + return nil +} + +type byOrder []*doc.Example + +func (x byOrder) Len() int { return len(x) } +func (x byOrder) Swap(i, j int) { x[i], x[j] = x[j], x[i] } +func (x byOrder) Less(i, j int) bool { return x[i].Order < x[j].Order } + +var testmainTmpl = template.Must(template.New("main").Parse(` +package main + +import ( +{{if not .TestMain}} + "os" +{{end}} + "regexp" + "testing" + +{{if .ImportTest}} + {{if .NeedTest}}_test{{else}}_{{end}} {{.Package.ImportPath | printf "%q"}} +{{end}} +{{if .ImportXtest}} + {{if .NeedXtest}}_xtest{{else}}_{{end}} {{.Package.ImportPath | printf "%s_test" | printf "%q"}} +{{end}} +{{range $i, $p := .Cover}} + _cover{{$i}} {{$p.Package.ImportPath | printf "%q"}} +{{end}} + +{{if .NeedCgo}} + _ "runtime/cgo" +{{end}} +) + +var tests = []testing.InternalTest{ +{{range .Tests}} + {"{{.Name}}", {{.Package}}.{{.Name}}}, +{{end}} +} + +var benchmarks = []testing.InternalBenchmark{ +{{range .Benchmarks}} + {"{{.Name}}", {{.Package}}.{{.Name}}}, +{{end}} +} + +var examples = []testing.InternalExample{ +{{range .Examples}} + {"{{.Name}}", {{.Package}}.{{.Name}}, {{.Output | printf "%q"}}}, +{{end}} +} + +var matchPat string +var matchRe *regexp.Regexp + +func matchString(pat, str string) (result bool, err error) { + if matchRe == nil || matchPat != pat { + matchPat = pat + matchRe, err = regexp.Compile(matchPat) + if err != nil { + return + } + } + return matchRe.MatchString(str), nil +} + +{{if .CoverEnabled}} + +// Only updated by init functions, so no need for atomicity. +var ( + coverCounters = make(map[string][]uint32) + coverBlocks = make(map[string][]testing.CoverBlock) +) + +func init() { + {{range $i, $p := .Cover}} + {{range $file, $cover := $p.Vars}} + coverRegisterFile({{printf "%q" $cover.File}}, _cover{{$i}}.{{$cover.Var}}.Count[:], _cover{{$i}}.{{$cover.Var}}.Pos[:], _cover{{$i}}.{{$cover.Var}}.NumStmt[:]) + {{end}} + {{end}} +} + +func coverRegisterFile(fileName string, counter []uint32, pos []uint32, numStmts []uint16) { + if 3*len(counter) != len(pos) || len(counter) != len(numStmts) { + panic("coverage: mismatched sizes") + } + if coverCounters[fileName] != nil { + // Already registered. + return + } + coverCounters[fileName] = counter + block := make([]testing.CoverBlock, len(counter)) + for i := range counter { + block[i] = testing.CoverBlock{ + Line0: pos[3*i+0], + Col0: uint16(pos[3*i+2]), + Line1: pos[3*i+1], + Col1: uint16(pos[3*i+2]>>16), + Stmts: numStmts[i], + } + } + coverBlocks[fileName] = block +} +{{end}} + +func main() { +{{if .CoverEnabled}} + testing.RegisterCover(testing.Cover{ + Mode: {{printf "%q" .CoverMode}}, + Counters: coverCounters, + Blocks: coverBlocks, + CoveredPackages: {{printf "%q" .Covered}}, + }) +{{end}} + m := testing.MainStart(matchString, tests, benchmarks, examples) +{{with .TestMain}} + {{.Package}}.{{.Name}}(m) +{{else}} + os.Exit(m.Run()) +{{end}} +} + +`)) diff --git a/src/cmd/go/testdata/cgocover/p.go b/src/cmd/go/testdata/cgocover/p.go new file mode 100644 index 0000000000000000000000000000000000000000..a6a3891cd4e029d5e82f43ed0a3bedd0b158e30b --- /dev/null +++ b/src/cmd/go/testdata/cgocover/p.go @@ -0,0 +1,19 @@ +package p + +/* +void +f(void) +{ +} +*/ +import "C" + +var b bool + +func F() { + if b { + for { + } + } + C.f() +} diff --git a/src/cmd/go/testdata/cgocover/p_test.go b/src/cmd/go/testdata/cgocover/p_test.go new file mode 100644 index 0000000000000000000000000000000000000000..a8f057e358767230643d2cb226c69cfb75303b52 --- /dev/null +++ b/src/cmd/go/testdata/cgocover/p_test.go @@ -0,0 +1,7 @@ +package p + +import "testing" + +func TestF(t *testing.T) { + F() +} diff --git a/src/cmd/go/testdata/dep_test.go b/src/cmd/go/testdata/dep_test.go new file mode 100644 index 0000000000000000000000000000000000000000..0c53ac4f963517191f614aa17044b1df0d63f0c8 --- /dev/null +++ b/src/cmd/go/testdata/dep_test.go @@ -0,0 +1,7 @@ +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package deps + +import _ "testing" diff --git a/src/cmd/go/testdata/example1_test.go b/src/cmd/go/testdata/example1_test.go new file mode 100644 index 0000000000000000000000000000000000000000..ec7092e972b712211df90d7c7fc45966625310b0 --- /dev/null +++ b/src/cmd/go/testdata/example1_test.go @@ -0,0 +1,23 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Make sure that go test runs Example_Z before Example_A, preserving source order. + +package p + +import "fmt" + +var n int + +func Example_Z() { + n++ + fmt.Println(n) + // Output: 1 +} + +func Example_A() { + n++ + fmt.Println(n) + // Output: 2 +} diff --git a/src/cmd/go/testdata/example2_test.go b/src/cmd/go/testdata/example2_test.go new file mode 100644 index 0000000000000000000000000000000000000000..1e0e80b80f03e1157654014df0b21b7d379150f0 --- /dev/null +++ b/src/cmd/go/testdata/example2_test.go @@ -0,0 +1,21 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Make sure that go test runs Example_Y before Example_B, preserving source order. + +package p + +import "fmt" + +func Example_Y() { + n++ + fmt.Println(n) + // Output: 3 +} + +func Example_B() { + n++ + fmt.Println(n) + // Output: 4 +} diff --git a/src/cmd/go/testdata/failssh/ssh b/src/cmd/go/testdata/failssh/ssh new file mode 100755 index 0000000000000000000000000000000000000000..ecdbef95dde03cb2ec8e068bc3e1304a28cb9275 --- /dev/null +++ b/src/cmd/go/testdata/failssh/ssh @@ -0,0 +1,2 @@ +#!/bin/sh +exit 1 diff --git a/src/cmd/go/testdata/generate/test1.go b/src/cmd/go/testdata/generate/test1.go new file mode 100644 index 0000000000000000000000000000000000000000..1f05734f04f5bcbcf573e9a43168150ff265c1ab --- /dev/null +++ b/src/cmd/go/testdata/generate/test1.go @@ -0,0 +1,13 @@ +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Simple test for go generate. + +// We include a build tag that go generate should ignore. + +// +build ignore + +//go:generate echo Success + +package p diff --git a/src/cmd/go/testdata/generate/test2.go b/src/cmd/go/testdata/generate/test2.go new file mode 100644 index 0000000000000000000000000000000000000000..ef1a3d9515903d7481b60bf1631e3560b3195cda --- /dev/null +++ b/src/cmd/go/testdata/generate/test2.go @@ -0,0 +1,10 @@ +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Test that go generate handles command aliases. + +//go:generate -command run echo Now is the time +//go:generate run for all good men + +package p diff --git a/src/cmd/go/testdata/generate/test3.go b/src/cmd/go/testdata/generate/test3.go new file mode 100644 index 0000000000000000000000000000000000000000..3d6a8a5c7420fe33031ced2907aa1f89eed3a15c --- /dev/null +++ b/src/cmd/go/testdata/generate/test3.go @@ -0,0 +1,9 @@ +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Test go generate variable substitution. + +//go:generate echo $GOARCH $GOFILE:$GOLINE ${GOPACKAGE}abc xyz$GOPACKAGE/$GOFILE/123 + +package p diff --git a/src/cmd/go/testdata/generate/test4.go b/src/cmd/go/testdata/generate/test4.go new file mode 100644 index 0000000000000000000000000000000000000000..a7631c4a45652c6dbdb050911a3bccdd463d7314 --- /dev/null +++ b/src/cmd/go/testdata/generate/test4.go @@ -0,0 +1,10 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Test -run flag + +//go:generate echo oh yes my man +//go:generate echo no, no, a thousand times no + +package p diff --git a/src/cmd/go/testdata/importcom/bad.go b/src/cmd/go/testdata/importcom/bad.go new file mode 100644 index 0000000000000000000000000000000000000000..e104c2e992b35026a3cece0a4e41ca42b6a26abd --- /dev/null +++ b/src/cmd/go/testdata/importcom/bad.go @@ -0,0 +1,3 @@ +package p + +import "bad" diff --git a/src/cmd/go/testdata/importcom/conflict.go b/src/cmd/go/testdata/importcom/conflict.go new file mode 100644 index 0000000000000000000000000000000000000000..995556c51148eec79bf7d4332159fe5cab15238d --- /dev/null +++ b/src/cmd/go/testdata/importcom/conflict.go @@ -0,0 +1,3 @@ +package p + +import "conflict" diff --git a/src/cmd/go/testdata/importcom/src/bad/bad.go b/src/cmd/go/testdata/importcom/src/bad/bad.go new file mode 100644 index 0000000000000000000000000000000000000000..bc51fd3fdeeb120877a927a0548dcd0f94e3aadb --- /dev/null +++ b/src/cmd/go/testdata/importcom/src/bad/bad.go @@ -0,0 +1 @@ +package bad // import diff --git a/src/cmd/go/testdata/importcom/src/conflict/a.go b/src/cmd/go/testdata/importcom/src/conflict/a.go new file mode 100644 index 0000000000000000000000000000000000000000..2d677035119bab23b86a306ef0d0f9a0a0e8d25c --- /dev/null +++ b/src/cmd/go/testdata/importcom/src/conflict/a.go @@ -0,0 +1 @@ +package conflict // import "a" diff --git a/src/cmd/go/testdata/importcom/src/conflict/b.go b/src/cmd/go/testdata/importcom/src/conflict/b.go new file mode 100644 index 0000000000000000000000000000000000000000..8fcfb3c8bd3c7f39844814b434a3aa92b34d62a2 --- /dev/null +++ b/src/cmd/go/testdata/importcom/src/conflict/b.go @@ -0,0 +1 @@ +package conflict /* import "b" */ diff --git a/src/cmd/go/testdata/importcom/src/works/x/x.go b/src/cmd/go/testdata/importcom/src/works/x/x.go new file mode 100644 index 0000000000000000000000000000000000000000..044c6eca803b62bca73e737d2c06fb037400014f --- /dev/null +++ b/src/cmd/go/testdata/importcom/src/works/x/x.go @@ -0,0 +1 @@ +package x // import "works/x" diff --git a/src/cmd/go/testdata/importcom/src/works/x/x1.go b/src/cmd/go/testdata/importcom/src/works/x/x1.go new file mode 100644 index 0000000000000000000000000000000000000000..2449b29df51ef066e551ef72d9f7d17ce68a571f --- /dev/null +++ b/src/cmd/go/testdata/importcom/src/works/x/x1.go @@ -0,0 +1 @@ +package x // important! not an import comment diff --git a/src/cmd/go/testdata/importcom/src/wrongplace/x.go b/src/cmd/go/testdata/importcom/src/wrongplace/x.go new file mode 100644 index 0000000000000000000000000000000000000000..b89849da78598b01ec6bfdca94fc4355f5174c8d --- /dev/null +++ b/src/cmd/go/testdata/importcom/src/wrongplace/x.go @@ -0,0 +1 @@ +package x // import "my/x" diff --git a/src/cmd/go/testdata/importcom/works.go b/src/cmd/go/testdata/importcom/works.go new file mode 100644 index 0000000000000000000000000000000000000000..31b55d08a37f08e425e06c082bc2dd476b7d2c26 --- /dev/null +++ b/src/cmd/go/testdata/importcom/works.go @@ -0,0 +1,3 @@ +package p + +import _ "works/x" diff --git a/src/cmd/go/testdata/importcom/wrongplace.go b/src/cmd/go/testdata/importcom/wrongplace.go new file mode 100644 index 0000000000000000000000000000000000000000..e2535e01ae0efbb973995828a5a5cbd2b107d8bd --- /dev/null +++ b/src/cmd/go/testdata/importcom/wrongplace.go @@ -0,0 +1,3 @@ +package p + +import "wrongplace" diff --git a/src/cmd/go/testdata/local/easy.go b/src/cmd/go/testdata/local/easy.go new file mode 100644 index 0000000000000000000000000000000000000000..4eeb517da15acf0bf8bc9f46a344fb85dfb46cda --- /dev/null +++ b/src/cmd/go/testdata/local/easy.go @@ -0,0 +1,7 @@ +package main + +import "./easysub" + +func main() { + easysub.Hello() +} diff --git a/src/cmd/go/testdata/local/easysub/easysub.go b/src/cmd/go/testdata/local/easysub/easysub.go new file mode 100644 index 0000000000000000000000000000000000000000..07040daee57991188df9d044c1e4502542555bda --- /dev/null +++ b/src/cmd/go/testdata/local/easysub/easysub.go @@ -0,0 +1,7 @@ +package easysub + +import "fmt" + +func Hello() { + fmt.Println("easysub.Hello") +} diff --git a/src/cmd/go/testdata/local/easysub/main.go b/src/cmd/go/testdata/local/easysub/main.go new file mode 100644 index 0000000000000000000000000000000000000000..6c30b52362e45ed4d01d567a7452f4c729766165 --- /dev/null +++ b/src/cmd/go/testdata/local/easysub/main.go @@ -0,0 +1,9 @@ +// +build ignore + +package main + +import "." + +func main() { + easysub.Hello() +} diff --git a/src/cmd/go/testdata/local/hard.go b/src/cmd/go/testdata/local/hard.go new file mode 100644 index 0000000000000000000000000000000000000000..2ffac3fd73bc65874b0e8edc8141049685622edf --- /dev/null +++ b/src/cmd/go/testdata/local/hard.go @@ -0,0 +1,7 @@ +package main + +import "./sub" + +func main() { + sub.Hello() +} diff --git a/src/cmd/go/testdata/local/sub/sub.go b/src/cmd/go/testdata/local/sub/sub.go new file mode 100644 index 0000000000000000000000000000000000000000..d5dbf6d5fa5bbe0a79e1e3c1163cb7d5d5f25376 --- /dev/null +++ b/src/cmd/go/testdata/local/sub/sub.go @@ -0,0 +1,12 @@ +package sub + +import ( + "fmt" + + subsub "./sub" +) + +func Hello() { + fmt.Println("sub.Hello") + subsub.Hello() +} diff --git a/src/cmd/go/testdata/local/sub/sub/subsub.go b/src/cmd/go/testdata/local/sub/sub/subsub.go new file mode 100644 index 0000000000000000000000000000000000000000..4cc72233e13ee42317ed013074331f1ccdadc10b --- /dev/null +++ b/src/cmd/go/testdata/local/sub/sub/subsub.go @@ -0,0 +1,7 @@ +package subsub + +import "fmt" + +func Hello() { + fmt.Println("subsub.Hello") +} diff --git a/src/cmd/go/testdata/norunexample/example_test.go b/src/cmd/go/testdata/norunexample/example_test.go new file mode 100644 index 0000000000000000000000000000000000000000..e158305a6c8cd93adf036b2f6234d3b88f98021d --- /dev/null +++ b/src/cmd/go/testdata/norunexample/example_test.go @@ -0,0 +1,11 @@ +package pkg_test + +import "os" + +func init() { + os.Stdout.Write([]byte("File with non-runnable example was built.\n")) +} + +func Example_test() { + // This test will not be run, it has no "Output:" comment. +} diff --git a/src/cmd/go/testdata/norunexample/test_test.go b/src/cmd/go/testdata/norunexample/test_test.go new file mode 100644 index 0000000000000000000000000000000000000000..d2e919838fb571404999ae2c71ddeb5e6766bd6a --- /dev/null +++ b/src/cmd/go/testdata/norunexample/test_test.go @@ -0,0 +1,10 @@ +package pkg + +import ( + "os" + "testing" +) + +func TestBuilt(t *testing.T) { + os.Stdout.Write([]byte("A normal test was executed.\n")) +} diff --git a/src/cmd/go/testdata/rundir/sub/sub.go b/src/cmd/go/testdata/rundir/sub/sub.go new file mode 100644 index 0000000000000000000000000000000000000000..06ab7d0f9a35a7d1070711496d6ca1cb892a258f --- /dev/null +++ b/src/cmd/go/testdata/rundir/sub/sub.go @@ -0,0 +1 @@ +package main diff --git a/src/cmd/go/testdata/rundir/x.go b/src/cmd/go/testdata/rundir/x.go new file mode 100644 index 0000000000000000000000000000000000000000..06ab7d0f9a35a7d1070711496d6ca1cb892a258f --- /dev/null +++ b/src/cmd/go/testdata/rundir/x.go @@ -0,0 +1 @@ +package main diff --git a/src/cmd/go/testdata/shadow/root1/src/foo/foo.go b/src/cmd/go/testdata/shadow/root1/src/foo/foo.go new file mode 100644 index 0000000000000000000000000000000000000000..f52652b1ba78cfe439c9719d0d3dfb51ed9d44d8 --- /dev/null +++ b/src/cmd/go/testdata/shadow/root1/src/foo/foo.go @@ -0,0 +1 @@ +package foo diff --git a/src/cmd/go/testdata/shadow/root1/src/math/math.go b/src/cmd/go/testdata/shadow/root1/src/math/math.go new file mode 100644 index 0000000000000000000000000000000000000000..c91c24e967cccde6aa7be55a6e77ed22991bf9e9 --- /dev/null +++ b/src/cmd/go/testdata/shadow/root1/src/math/math.go @@ -0,0 +1 @@ +package math diff --git a/src/cmd/go/testdata/shadow/root2/src/foo/foo.go b/src/cmd/go/testdata/shadow/root2/src/foo/foo.go new file mode 100644 index 0000000000000000000000000000000000000000..f52652b1ba78cfe439c9719d0d3dfb51ed9d44d8 --- /dev/null +++ b/src/cmd/go/testdata/shadow/root2/src/foo/foo.go @@ -0,0 +1 @@ +package foo diff --git a/src/cmd/go/testdata/src/badc/x.c b/src/cmd/go/testdata/src/badc/x.c new file mode 100644 index 0000000000000000000000000000000000000000..f6cbf6924db1414a3001acd3c6005eff2bb99b8b --- /dev/null +++ b/src/cmd/go/testdata/src/badc/x.c @@ -0,0 +1 @@ +// C code! diff --git a/src/cmd/go/testdata/src/badc/x.go b/src/cmd/go/testdata/src/badc/x.go new file mode 100644 index 0000000000000000000000000000000000000000..bfa1de28bde5178ac93b88b3153efaa6cc56b9cc --- /dev/null +++ b/src/cmd/go/testdata/src/badc/x.go @@ -0,0 +1 @@ +package badc diff --git a/src/cmd/go/testdata/src/badpkg/x.go b/src/cmd/go/testdata/src/badpkg/x.go new file mode 100644 index 0000000000000000000000000000000000000000..dda35e8ed3db96f40fe93a0f5a6ba71cb13180d1 --- /dev/null +++ b/src/cmd/go/testdata/src/badpkg/x.go @@ -0,0 +1 @@ +pkg badpkg diff --git a/src/cmd/go/testdata/src/badtest/badexec/x_test.go b/src/cmd/go/testdata/src/badtest/badexec/x_test.go new file mode 100644 index 0000000000000000000000000000000000000000..12f50517125a3d91b4977bab24f4d67834bb9a7c --- /dev/null +++ b/src/cmd/go/testdata/src/badtest/badexec/x_test.go @@ -0,0 +1,5 @@ +package badexec + +func init() { + panic("badexec") +} diff --git a/src/cmd/go/testdata/src/badtest/badsyntax/x.go b/src/cmd/go/testdata/src/badtest/badsyntax/x.go new file mode 100644 index 0000000000000000000000000000000000000000..c8a5407a5ace027072b0678d611f63e5b3449b85 --- /dev/null +++ b/src/cmd/go/testdata/src/badtest/badsyntax/x.go @@ -0,0 +1 @@ +package badsyntax diff --git a/src/cmd/go/testdata/src/badtest/badsyntax/x_test.go b/src/cmd/go/testdata/src/badtest/badsyntax/x_test.go new file mode 100644 index 0000000000000000000000000000000000000000..5be10745d9b874c15f72e86e7b90eca66c9738e4 --- /dev/null +++ b/src/cmd/go/testdata/src/badtest/badsyntax/x_test.go @@ -0,0 +1,3 @@ +package badsyntax + +func func func func func! diff --git a/src/cmd/go/testdata/src/badtest/badvar/x.go b/src/cmd/go/testdata/src/badtest/badvar/x.go new file mode 100644 index 0000000000000000000000000000000000000000..fdd46c4c721cb6e4356f4dea562a851b718a9d50 --- /dev/null +++ b/src/cmd/go/testdata/src/badtest/badvar/x.go @@ -0,0 +1 @@ +package badvar diff --git a/src/cmd/go/testdata/src/badtest/badvar/x_test.go b/src/cmd/go/testdata/src/badtest/badvar/x_test.go new file mode 100644 index 0000000000000000000000000000000000000000..c67df01c5cac251e47f7a2ac957ca129cd9b67aa --- /dev/null +++ b/src/cmd/go/testdata/src/badtest/badvar/x_test.go @@ -0,0 +1,5 @@ +package badvar_test + +func f() { + _ = notdefined +} diff --git a/src/cmd/go/testdata/src/cgotest/m.go b/src/cmd/go/testdata/src/cgotest/m.go new file mode 100644 index 0000000000000000000000000000000000000000..4d68307cf0dbaee3064123c54e068da54146fa62 --- /dev/null +++ b/src/cmd/go/testdata/src/cgotest/m.go @@ -0,0 +1,5 @@ +package cgotest + +import "C" + +var _ C.int diff --git a/src/cmd/go/testdata/src/go-cmd-test/helloworld.go b/src/cmd/go/testdata/src/go-cmd-test/helloworld.go new file mode 100644 index 0000000000000000000000000000000000000000..002a5c740c7d288d40d490a43aae9297488a2433 --- /dev/null +++ b/src/cmd/go/testdata/src/go-cmd-test/helloworld.go @@ -0,0 +1,5 @@ +package main + +func main() { + println("hello world") +} diff --git a/src/cmd/go/testdata/src/main_test/m.go b/src/cmd/go/testdata/src/main_test/m.go new file mode 100644 index 0000000000000000000000000000000000000000..c682f030b4eb33e1dfe819ec320806076ff7131a --- /dev/null +++ b/src/cmd/go/testdata/src/main_test/m.go @@ -0,0 +1,4 @@ +package main + +func F() {} +func main() {} diff --git a/src/cmd/go/testdata/src/main_test/m_test.go b/src/cmd/go/testdata/src/main_test/m_test.go new file mode 100644 index 0000000000000000000000000000000000000000..f865b7734f0e5d56fe6e62dd0f540efc00eb783a --- /dev/null +++ b/src/cmd/go/testdata/src/main_test/m_test.go @@ -0,0 +1,10 @@ +package main_test + +import ( + . "main_test" + "testing" +) + +func Test1(t *testing.T) { + F() +} diff --git a/src/cmd/go/testdata/src/notest/hello.go b/src/cmd/go/testdata/src/notest/hello.go new file mode 100644 index 0000000000000000000000000000000000000000..7c42c32fb0abcae9ad478b2e9b324b4de4814526 --- /dev/null +++ b/src/cmd/go/testdata/src/notest/hello.go @@ -0,0 +1,6 @@ +package notest + +func hello() { + println("hello world") +} +Hello world diff --git a/src/cmd/go/testdata/src/syntaxerror/x.go b/src/cmd/go/testdata/src/syntaxerror/x.go new file mode 100644 index 0000000000000000000000000000000000000000..c89cd18d0fe7d777c6008d0d9133c5bb808be6fc --- /dev/null +++ b/src/cmd/go/testdata/src/syntaxerror/x.go @@ -0,0 +1 @@ +package p diff --git a/src/cmd/go/testdata/src/syntaxerror/x_test.go b/src/cmd/go/testdata/src/syntaxerror/x_test.go new file mode 100644 index 0000000000000000000000000000000000000000..2460743e50186d66712857889ed1506286f2b53f --- /dev/null +++ b/src/cmd/go/testdata/src/syntaxerror/x_test.go @@ -0,0 +1,4 @@ +package p + +func f() (x.y, z int) { +} diff --git a/src/cmd/go/testdata/src/testcycle/p1/p1.go b/src/cmd/go/testdata/src/testcycle/p1/p1.go new file mode 100644 index 0000000000000000000000000000000000000000..65ab76d4e1e8bafc5e3a1e10dd5be1200625228f --- /dev/null +++ b/src/cmd/go/testdata/src/testcycle/p1/p1.go @@ -0,0 +1,7 @@ +package p1 + +import _ "testcycle/p2" + +func init() { + println("p1 init") +} diff --git a/src/cmd/go/testdata/src/testcycle/p1/p1_test.go b/src/cmd/go/testdata/src/testcycle/p1/p1_test.go new file mode 100644 index 0000000000000000000000000000000000000000..75abb13e6d0349938d6d1e1136e225e230ab19f4 --- /dev/null +++ b/src/cmd/go/testdata/src/testcycle/p1/p1_test.go @@ -0,0 +1,6 @@ +package p1 + +import "testing" + +func Test(t *testing.T) { +} diff --git a/src/cmd/go/testdata/src/testcycle/p2/p2.go b/src/cmd/go/testdata/src/testcycle/p2/p2.go new file mode 100644 index 0000000000000000000000000000000000000000..7e26cdf19c913f3c4638944540967e93a507caa5 --- /dev/null +++ b/src/cmd/go/testdata/src/testcycle/p2/p2.go @@ -0,0 +1,7 @@ +package p2 + +import _ "testcycle/p3" + +func init() { + println("p2 init") +} diff --git a/src/cmd/go/testdata/src/testcycle/p3/p3.go b/src/cmd/go/testdata/src/testcycle/p3/p3.go new file mode 100644 index 0000000000000000000000000000000000000000..bb0a2f4f6569229b75b37b6636c5dede5d35fc62 --- /dev/null +++ b/src/cmd/go/testdata/src/testcycle/p3/p3.go @@ -0,0 +1,5 @@ +package p3 + +func init() { + println("p3 init") +} diff --git a/src/cmd/go/testdata/src/testcycle/p3/p3_test.go b/src/cmd/go/testdata/src/testcycle/p3/p3_test.go new file mode 100644 index 0000000000000000000000000000000000000000..9b4b0757f82acca7121fbceb6223c0700e322bb1 --- /dev/null +++ b/src/cmd/go/testdata/src/testcycle/p3/p3_test.go @@ -0,0 +1,10 @@ +package p3 + +import ( + "testing" + + _ "testcycle/p1" +) + +func Test(t *testing.T) { +} diff --git a/src/cmd/go/testdata/src/testcycle/q1/q1.go b/src/cmd/go/testdata/src/testcycle/q1/q1.go new file mode 100644 index 0000000000000000000000000000000000000000..7a471f0cc05a38b6c173ada43a7a68e82968456d --- /dev/null +++ b/src/cmd/go/testdata/src/testcycle/q1/q1.go @@ -0,0 +1 @@ +package q1 diff --git a/src/cmd/go/testdata/src/testcycle/q1/q1_test.go b/src/cmd/go/testdata/src/testcycle/q1/q1_test.go new file mode 100644 index 0000000000000000000000000000000000000000..ca81bd2bf80b18f01b6a8248a7999fe3d7d20b00 --- /dev/null +++ b/src/cmd/go/testdata/src/testcycle/q1/q1_test.go @@ -0,0 +1,6 @@ +package q1 + +import "testing" +import _ "testcycle/q1" + +func Test(t *testing.T) {} diff --git a/src/cmd/go/testdata/src/testdep/p1/p1.go b/src/cmd/go/testdata/src/testdep/p1/p1.go new file mode 100644 index 0000000000000000000000000000000000000000..a457035a4300f39249b3b263624b537909bd2951 --- /dev/null +++ b/src/cmd/go/testdata/src/testdep/p1/p1.go @@ -0,0 +1 @@ +package p1 diff --git a/src/cmd/go/testdata/src/testdep/p1/p1_test.go b/src/cmd/go/testdata/src/testdep/p1/p1_test.go new file mode 100644 index 0000000000000000000000000000000000000000..8be75334425d606a4070f7e7be41ee83f8d760cb --- /dev/null +++ b/src/cmd/go/testdata/src/testdep/p1/p1_test.go @@ -0,0 +1,3 @@ +package p1 + +import _ "testdep/p2" diff --git a/src/cmd/go/testdata/src/testdep/p2/p2.go b/src/cmd/go/testdata/src/testdep/p2/p2.go new file mode 100644 index 0000000000000000000000000000000000000000..15ba2eacea5c6e4a26884238c7f98f0149132f71 --- /dev/null +++ b/src/cmd/go/testdata/src/testdep/p2/p2.go @@ -0,0 +1,3 @@ +package p2 + +import _ "testdep/p3" diff --git a/src/cmd/go/testdata/src/testdep/p3/p3.go b/src/cmd/go/testdata/src/testdep/p3/p3.go new file mode 100644 index 0000000000000000000000000000000000000000..0219e7fae507e173b49c71e668b8fd2811715178 --- /dev/null +++ b/src/cmd/go/testdata/src/testdep/p3/p3.go @@ -0,0 +1,3 @@ +// +build ignore + +package ignored diff --git a/src/cmd/go/testdata/src/vend/bad.go b/src/cmd/go/testdata/src/vend/bad.go new file mode 100644 index 0000000000000000000000000000000000000000..57cc595220c50d5941a245734f0a2ed8a6592192 --- /dev/null +++ b/src/cmd/go/testdata/src/vend/bad.go @@ -0,0 +1,3 @@ +package vend + +import _ "r" diff --git a/src/cmd/go/testdata/src/vend/good.go b/src/cmd/go/testdata/src/vend/good.go new file mode 100644 index 0000000000000000000000000000000000000000..952ada3108d34828f0ae101e11e93ef69260d587 --- /dev/null +++ b/src/cmd/go/testdata/src/vend/good.go @@ -0,0 +1,3 @@ +package vend + +import _ "p" diff --git a/src/cmd/go/testdata/src/vend/hello/hello.go b/src/cmd/go/testdata/src/vend/hello/hello.go new file mode 100644 index 0000000000000000000000000000000000000000..41dc03e0ce497d99597d06ddd15ff6f55635b874 --- /dev/null +++ b/src/cmd/go/testdata/src/vend/hello/hello.go @@ -0,0 +1,10 @@ +package main + +import ( + "fmt" + "strings" // really ../vendor/strings +) + +func main() { + fmt.Printf("%s\n", strings.Msg) +} diff --git a/src/cmd/go/testdata/src/vend/hello/hello_test.go b/src/cmd/go/testdata/src/vend/hello/hello_test.go new file mode 100644 index 0000000000000000000000000000000000000000..5e72ada9387a7a79d903d8557b214c0899c432d5 --- /dev/null +++ b/src/cmd/go/testdata/src/vend/hello/hello_test.go @@ -0,0 +1,12 @@ +package main + +import ( + "strings" // really ../vendor/strings + "testing" +) + +func TestMsgInternal(t *testing.T) { + if strings.Msg != "hello, world" { + t.Fatal("unexpected msg: %v", strings.Msg) + } +} diff --git a/src/cmd/go/testdata/src/vend/hello/hellox_test.go b/src/cmd/go/testdata/src/vend/hello/hellox_test.go new file mode 100644 index 0000000000000000000000000000000000000000..96e6049dad0ae1642f9fbdcb3a91917675ecd52d --- /dev/null +++ b/src/cmd/go/testdata/src/vend/hello/hellox_test.go @@ -0,0 +1,12 @@ +package main_test + +import ( + "strings" // really ../vendor/strings + "testing" +) + +func TestMsgExternal(t *testing.T) { + if strings.Msg != "hello, world" { + t.Fatal("unexpected msg: %v", strings.Msg) + } +} diff --git a/src/cmd/go/testdata/src/vend/subdir/bad.go b/src/cmd/go/testdata/src/vend/subdir/bad.go new file mode 100644 index 0000000000000000000000000000000000000000..d0ddaacfea5df6464c0f185d477c9ded6ee09150 --- /dev/null +++ b/src/cmd/go/testdata/src/vend/subdir/bad.go @@ -0,0 +1,3 @@ +package subdir + +import _ "r" diff --git a/src/cmd/go/testdata/src/vend/subdir/good.go b/src/cmd/go/testdata/src/vend/subdir/good.go new file mode 100644 index 0000000000000000000000000000000000000000..edd04543a2bad09f53b1f4fd50a2502f80d16e3b --- /dev/null +++ b/src/cmd/go/testdata/src/vend/subdir/good.go @@ -0,0 +1,3 @@ +package subdir + +import _ "p" diff --git a/src/cmd/go/testdata/src/vend/vendor/p/p.go b/src/cmd/go/testdata/src/vend/vendor/p/p.go new file mode 100644 index 0000000000000000000000000000000000000000..c89cd18d0fe7d777c6008d0d9133c5bb808be6fc --- /dev/null +++ b/src/cmd/go/testdata/src/vend/vendor/p/p.go @@ -0,0 +1 @@ +package p diff --git a/src/cmd/go/testdata/src/vend/vendor/q/q.go b/src/cmd/go/testdata/src/vend/vendor/q/q.go new file mode 100644 index 0000000000000000000000000000000000000000..946e6d99109580d53b402a34fd8b55226b9e564d --- /dev/null +++ b/src/cmd/go/testdata/src/vend/vendor/q/q.go @@ -0,0 +1 @@ +package q diff --git a/src/cmd/go/testdata/src/vend/vendor/strings/msg.go b/src/cmd/go/testdata/src/vend/vendor/strings/msg.go new file mode 100644 index 0000000000000000000000000000000000000000..438126ba2be59819a8e2710480eccd897f9cdf9b --- /dev/null +++ b/src/cmd/go/testdata/src/vend/vendor/strings/msg.go @@ -0,0 +1,3 @@ +package strings + +var Msg = "hello, world" diff --git a/src/cmd/go/testdata/src/vend/x/invalid/invalid.go b/src/cmd/go/testdata/src/vend/x/invalid/invalid.go new file mode 100644 index 0000000000000000000000000000000000000000..e250d5bb31b563a4fdbb958fb034d7fa388fe38a --- /dev/null +++ b/src/cmd/go/testdata/src/vend/x/invalid/invalid.go @@ -0,0 +1,3 @@ +package invalid + +import "vend/x/invalid/vendor/foo" diff --git a/src/cmd/go/testdata/src/vend/x/vendor/p/p.go b/src/cmd/go/testdata/src/vend/x/vendor/p/p.go new file mode 100644 index 0000000000000000000000000000000000000000..c89cd18d0fe7d777c6008d0d9133c5bb808be6fc --- /dev/null +++ b/src/cmd/go/testdata/src/vend/x/vendor/p/p.go @@ -0,0 +1 @@ +package p diff --git a/src/cmd/go/testdata/src/vend/x/vendor/p/p/p.go b/src/cmd/go/testdata/src/vend/x/vendor/p/p/p.go new file mode 100644 index 0000000000000000000000000000000000000000..e12e12c2f4c9c738561a10ce54e8afcaa17fb9ef --- /dev/null +++ b/src/cmd/go/testdata/src/vend/x/vendor/p/p/p.go @@ -0,0 +1,3 @@ +package p + +import _ "notfound" diff --git a/src/cmd/go/testdata/src/vend/x/vendor/r/r.go b/src/cmd/go/testdata/src/vend/x/vendor/r/r.go new file mode 100644 index 0000000000000000000000000000000000000000..838c177a570f958653822675e6dc4079e5c472af --- /dev/null +++ b/src/cmd/go/testdata/src/vend/x/vendor/r/r.go @@ -0,0 +1 @@ +package r diff --git a/src/cmd/go/testdata/src/vend/x/x.go b/src/cmd/go/testdata/src/vend/x/x.go new file mode 100644 index 0000000000000000000000000000000000000000..ae526ebdda252e8fb618fb5b6f90e5ab6902a432 --- /dev/null +++ b/src/cmd/go/testdata/src/vend/x/x.go @@ -0,0 +1,5 @@ +package x + +import _ "p" +import _ "q" +import _ "r" diff --git a/src/cmd/go/testdata/src/vetpkg/a_test.go b/src/cmd/go/testdata/src/vetpkg/a_test.go new file mode 100644 index 0000000000000000000000000000000000000000..9b64e8e1a26912848f4e8069783f060c94be47c6 --- /dev/null +++ b/src/cmd/go/testdata/src/vetpkg/a_test.go @@ -0,0 +1 @@ +package p_test diff --git a/src/cmd/go/testdata/src/vetpkg/b.go b/src/cmd/go/testdata/src/vetpkg/b.go new file mode 100644 index 0000000000000000000000000000000000000000..99e18f63dc65aaf4bad40464f0c89cc3f8dc75bb --- /dev/null +++ b/src/cmd/go/testdata/src/vetpkg/b.go @@ -0,0 +1,7 @@ +package p + +import "fmt" + +func f() { + fmt.Printf("%d") +} diff --git a/src/cmd/go/testdata/src/vetpkg/c.go b/src/cmd/go/testdata/src/vetpkg/c.go new file mode 100644 index 0000000000000000000000000000000000000000..ef5648f0590c42e9b6d7a3ee4049fca0feb3ae00 --- /dev/null +++ b/src/cmd/go/testdata/src/vetpkg/c.go @@ -0,0 +1,9 @@ +// +build tagtest + +package p + +import "fmt" + +func g() { + fmt.Printf("%d", 3, 4) +} diff --git a/src/cmd/go/testdata/src/xtestonly/f.go b/src/cmd/go/testdata/src/xtestonly/f.go new file mode 100644 index 0000000000000000000000000000000000000000..dac039e1ad0ed1c0b00c4338abe5f5e46fc39a66 --- /dev/null +++ b/src/cmd/go/testdata/src/xtestonly/f.go @@ -0,0 +1,3 @@ +package xtestonly + +func F() int { return 42 } diff --git a/src/cmd/go/testdata/src/xtestonly/f_test.go b/src/cmd/go/testdata/src/xtestonly/f_test.go new file mode 100644 index 0000000000000000000000000000000000000000..01f6e83730c3911929f1d218739bb7c94810850f --- /dev/null +++ b/src/cmd/go/testdata/src/xtestonly/f_test.go @@ -0,0 +1,12 @@ +package xtestonly_test + +import ( + "testing" + "xtestonly" +) + +func TestF(t *testing.T) { + if x := xtestonly.F(); x != 42 { + t.Errorf("f.F() = %d, want 42", x) + } +} diff --git a/src/cmd/go/testdata/standalone_test.go b/src/cmd/go/testdata/standalone_test.go new file mode 100644 index 0000000000000000000000000000000000000000..59cf918b9bc8dcb0a8a9cc8dca67ab3e520ad961 --- /dev/null +++ b/src/cmd/go/testdata/standalone_test.go @@ -0,0 +1,6 @@ +package standalone_test + +import "testing" + +func Test(t *testing.T) { +} diff --git a/src/cmd/go/testdata/testimport/p.go b/src/cmd/go/testdata/testimport/p.go new file mode 100644 index 0000000000000000000000000000000000000000..f94d2cd0e66c2b19547f2a04039695a555140f1d --- /dev/null +++ b/src/cmd/go/testdata/testimport/p.go @@ -0,0 +1,3 @@ +package p + +func F() int { return 1 } diff --git a/src/cmd/go/testdata/testimport/p1/p1.go b/src/cmd/go/testdata/testimport/p1/p1.go new file mode 100644 index 0000000000000000000000000000000000000000..fd315272ea21d544f0db689c99bce227ca20617c --- /dev/null +++ b/src/cmd/go/testdata/testimport/p1/p1.go @@ -0,0 +1,3 @@ +package p1 + +func F() int { return 1 } diff --git a/src/cmd/go/testdata/testimport/p2/p2.go b/src/cmd/go/testdata/testimport/p2/p2.go new file mode 100644 index 0000000000000000000000000000000000000000..d4888865ddb7a88b8abd553b67ce7bc78eedcbbc --- /dev/null +++ b/src/cmd/go/testdata/testimport/p2/p2.go @@ -0,0 +1,3 @@ +package p2 + +func F() int { return 1 } diff --git a/src/cmd/go/testdata/testimport/p_test.go b/src/cmd/go/testdata/testimport/p_test.go new file mode 100644 index 0000000000000000000000000000000000000000..a3fb4a9e2780b84bec390a6c8d800bcd8e86f66c --- /dev/null +++ b/src/cmd/go/testdata/testimport/p_test.go @@ -0,0 +1,13 @@ +package p + +import ( + "./p1" + + "testing" +) + +func TestF(t *testing.T) { + if F() != p1.F() { + t.Fatal(F()) + } +} diff --git a/src/cmd/go/testdata/testimport/x_test.go b/src/cmd/go/testdata/testimport/x_test.go new file mode 100644 index 0000000000000000000000000000000000000000..b253e3fd2dd9453d8c812acff968c21953bf98ad --- /dev/null +++ b/src/cmd/go/testdata/testimport/x_test.go @@ -0,0 +1,15 @@ +package p_test + +import ( + . "../testimport" + + "./p2" + + "testing" +) + +func TestF1(t *testing.T) { + if F() != p2.F() { + t.Fatal(F()) + } +} diff --git a/src/cmd/go/testdata/testinternal/p.go b/src/cmd/go/testdata/testinternal/p.go new file mode 100644 index 0000000000000000000000000000000000000000..e3558a53b244276b9ba1bf0867a04e5ad2057743 --- /dev/null +++ b/src/cmd/go/testdata/testinternal/p.go @@ -0,0 +1,3 @@ +package p + +import _ "net/http/internal" diff --git a/src/cmd/go/testdata/testinternal2/p.go b/src/cmd/go/testdata/testinternal2/p.go new file mode 100644 index 0000000000000000000000000000000000000000..c594f5c5e9effc9e9ea56692b4c71c84d76f2c1b --- /dev/null +++ b/src/cmd/go/testdata/testinternal2/p.go @@ -0,0 +1,3 @@ +package p + +import _ "./x/y/z/internal/w" diff --git a/src/cmd/go/testdata/testinternal2/x/y/z/internal/w/w.go b/src/cmd/go/testdata/testinternal2/x/y/z/internal/w/w.go new file mode 100644 index 0000000000000000000000000000000000000000..a796c0b5f4b14f82d3cc4417a0d14c9a96fa1019 --- /dev/null +++ b/src/cmd/go/testdata/testinternal2/x/y/z/internal/w/w.go @@ -0,0 +1 @@ +package w diff --git a/src/cmd/go/testdata/testinternal3/t.go b/src/cmd/go/testdata/testinternal3/t.go new file mode 100644 index 0000000000000000000000000000000000000000..8576a4b4d76d6220a56482e722a58712fb50ae14 --- /dev/null +++ b/src/cmd/go/testdata/testinternal3/t.go @@ -0,0 +1,3 @@ +package t + +import _ "internal/does-not-exist" diff --git a/src/cmd/go/testdata/testinternal4/src/p/p.go b/src/cmd/go/testdata/testinternal4/src/p/p.go new file mode 100644 index 0000000000000000000000000000000000000000..6bdee27be2f9577b633f5c889bd0ed60050aa366 --- /dev/null +++ b/src/cmd/go/testdata/testinternal4/src/p/p.go @@ -0,0 +1,6 @@ +package p + +import ( + _ "q/internal/x" + _ "q/j" +) diff --git a/src/cmd/go/testdata/testinternal4/src/q/internal/x/x.go b/src/cmd/go/testdata/testinternal4/src/q/internal/x/x.go new file mode 100644 index 0000000000000000000000000000000000000000..823aafd0712b6c533df84b17d9b7ac6ae43e66fa --- /dev/null +++ b/src/cmd/go/testdata/testinternal4/src/q/internal/x/x.go @@ -0,0 +1 @@ +package x diff --git a/src/cmd/go/testdata/testinternal4/src/q/j/j.go b/src/cmd/go/testdata/testinternal4/src/q/j/j.go new file mode 100644 index 0000000000000000000000000000000000000000..9f07543894098fa018424fb6fc0eff05b4682466 --- /dev/null +++ b/src/cmd/go/testdata/testinternal4/src/q/j/j.go @@ -0,0 +1,3 @@ +package j + +import _ "q/internal/x" diff --git a/src/cmd/go/testdata/testonly/p_test.go b/src/cmd/go/testdata/testonly/p_test.go new file mode 100644 index 0000000000000000000000000000000000000000..c89cd18d0fe7d777c6008d0d9133c5bb808be6fc --- /dev/null +++ b/src/cmd/go/testdata/testonly/p_test.go @@ -0,0 +1 @@ +package p diff --git a/src/cmd/go/testdata/testvendor/src/p/p.go b/src/cmd/go/testdata/testvendor/src/p/p.go new file mode 100644 index 0000000000000000000000000000000000000000..e740715186ebf6695594700c00042ee8fc8fb468 --- /dev/null +++ b/src/cmd/go/testdata/testvendor/src/p/p.go @@ -0,0 +1,6 @@ +package p + +import ( + _ "q/y" + _ "q/z" +) diff --git a/src/cmd/go/testdata/testvendor/src/q/vendor/x/x.go b/src/cmd/go/testdata/testvendor/src/q/vendor/x/x.go new file mode 100644 index 0000000000000000000000000000000000000000..823aafd0712b6c533df84b17d9b7ac6ae43e66fa --- /dev/null +++ b/src/cmd/go/testdata/testvendor/src/q/vendor/x/x.go @@ -0,0 +1 @@ +package x diff --git a/src/cmd/go/testdata/testvendor/src/q/y/y.go b/src/cmd/go/testdata/testvendor/src/q/y/y.go new file mode 100644 index 0000000000000000000000000000000000000000..4f842237675a424ea2e20029ec4fd4c5cbfd0d1e --- /dev/null +++ b/src/cmd/go/testdata/testvendor/src/q/y/y.go @@ -0,0 +1,3 @@ +package y + +import _ "x" diff --git a/src/cmd/go/testdata/testvendor/src/q/z/z.go b/src/cmd/go/testdata/testvendor/src/q/z/z.go new file mode 100644 index 0000000000000000000000000000000000000000..a8d4924936a7a5d7e4bc88b8ab9e5a9d20c26627 --- /dev/null +++ b/src/cmd/go/testdata/testvendor/src/q/z/z.go @@ -0,0 +1,3 @@ +package z + +import _ "q/vendor/x" diff --git a/src/cmd/go/testdata/testvendor2/src/p/p.go b/src/cmd/go/testdata/testvendor2/src/p/p.go new file mode 100644 index 0000000000000000000000000000000000000000..220b2b2a0712eabd10461cb354842501785282d6 --- /dev/null +++ b/src/cmd/go/testdata/testvendor2/src/p/p.go @@ -0,0 +1,3 @@ +package p + +import "x" diff --git a/src/cmd/go/testdata/testvendor2/vendor/x/x.go b/src/cmd/go/testdata/testvendor2/vendor/x/x.go new file mode 100644 index 0000000000000000000000000000000000000000..823aafd0712b6c533df84b17d9b7ac6ae43e66fa --- /dev/null +++ b/src/cmd/go/testdata/testvendor2/vendor/x/x.go @@ -0,0 +1 @@ +package x diff --git a/src/cmd/go/testflag.go b/src/cmd/go/testflag.go new file mode 100644 index 0000000000000000000000000000000000000000..1f3e3d316af5a8794e8746e6617d9a943a5fc3a3 --- /dev/null +++ b/src/cmd/go/testflag.go @@ -0,0 +1,281 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +import ( + "flag" + "fmt" + "os" + "strconv" + "strings" +) + +// The flag handling part of go test is large and distracting. +// We can't use the flag package because some of the flags from +// our command line are for us, and some are for 6.out, and +// some are for both. + +// testFlagSpec defines a flag we know about. +type testFlagSpec struct { + name string + boolVar *bool + flagValue flag.Value + passToTest bool // pass to Test + multiOK bool // OK to have multiple instances + present bool // flag has been seen +} + +// testFlagDefn is the set of flags we process. +var testFlagDefn = []*testFlagSpec{ + // local. + {name: "c", boolVar: &testC}, + {name: "i", boolVar: &buildI}, + {name: "o"}, + {name: "cover", boolVar: &testCover}, + {name: "covermode"}, + {name: "coverpkg"}, + {name: "exec"}, + + // passed to 6.out, adding a "test." prefix to the name if necessary: -v becomes -test.v. + {name: "bench", passToTest: true}, + {name: "benchmem", boolVar: new(bool), passToTest: true}, + {name: "benchtime", passToTest: true}, + {name: "count", passToTest: true}, + {name: "coverprofile", passToTest: true}, + {name: "cpu", passToTest: true}, + {name: "cpuprofile", passToTest: true}, + {name: "memprofile", passToTest: true}, + {name: "memprofilerate", passToTest: true}, + {name: "blockprofile", passToTest: true}, + {name: "blockprofilerate", passToTest: true}, + {name: "outputdir", passToTest: true}, + {name: "parallel", passToTest: true}, + {name: "run", passToTest: true}, + {name: "short", boolVar: new(bool), passToTest: true}, + {name: "timeout", passToTest: true}, + {name: "trace", passToTest: true}, + {name: "v", boolVar: &testV, passToTest: true}, +} + +// add build flags to testFlagDefn +func init() { + var cmd Command + addBuildFlags(&cmd) + cmd.Flag.VisitAll(func(f *flag.Flag) { + if f.Name == "v" { + // test overrides the build -v flag + return + } + testFlagDefn = append(testFlagDefn, &testFlagSpec{ + name: f.Name, + flagValue: f.Value, + }) + }) +} + +// testFlags processes the command line, grabbing -x and -c, rewriting known flags +// to have "test" before them, and reading the command line for the 6.out. +// Unfortunately for us, we need to do our own flag processing because go test +// grabs some flags but otherwise its command line is just a holding place for +// pkg.test's arguments. +// We allow known flags both before and after the package name list, +// to allow both +// go test fmt -custom-flag-for-fmt-test +// go test -x math +func testFlags(args []string) (packageNames, passToTest []string) { + inPkg := false + outputDir := "" + for i := 0; i < len(args); i++ { + if !strings.HasPrefix(args[i], "-") { + if !inPkg && packageNames == nil { + // First package name we've seen. + inPkg = true + } + if inPkg { + packageNames = append(packageNames, args[i]) + continue + } + } + + if inPkg { + // Found an argument beginning with "-"; end of package list. + inPkg = false + } + + f, value, extraWord := testFlag(args, i) + if f == nil { + // This is a flag we do not know; we must assume + // that any args we see after this might be flag + // arguments, not package names. + inPkg = false + if packageNames == nil { + // make non-nil: we have seen the empty package list + packageNames = []string{} + } + passToTest = append(passToTest, args[i]) + continue + } + if f.flagValue != nil { + if err := f.flagValue.Set(value); err != nil { + fatalf("invalid flag argument for -%s: %v", f.name, err) + } + } else { + // Test-only flags. + // Arguably should be handled by f.flagValue, but aren't. + var err error + switch f.name { + // bool flags. + case "c", "i", "v", "cover": + setBoolFlag(f.boolVar, value) + case "o": + testO = value + testNeedBinary = true + case "exec": + execCmd, err = splitQuotedFields(value) + if err != nil { + fatalf("invalid flag argument for -%s: %v", f.name, err) + } + case "bench": + // record that we saw the flag; don't care about the value + testBench = true + case "timeout": + testTimeout = value + case "blockprofile", "cpuprofile", "memprofile", "trace": + testProfile = true + testNeedBinary = true + case "coverpkg": + testCover = true + if value == "" { + testCoverPaths = nil + } else { + testCoverPaths = strings.Split(value, ",") + } + case "coverprofile": + testCover = true + testProfile = true + case "covermode": + switch value { + case "set", "count", "atomic": + testCoverMode = value + default: + fatalf("invalid flag argument for -covermode: %q", value) + } + testCover = true + case "outputdir": + outputDir = value + } + } + if extraWord { + i++ + } + if f.passToTest { + passToTest = append(passToTest, "-test."+f.name+"="+value) + } + } + + if testCoverMode == "" { + testCoverMode = "set" + if buildRace { + // Default coverage mode is atomic when -race is set. + testCoverMode = "atomic" + } + } + + // Tell the test what directory we're running in, so it can write the profiles there. + if testProfile && outputDir == "" { + dir, err := os.Getwd() + if err != nil { + fatalf("error from os.Getwd: %s", err) + } + passToTest = append(passToTest, "-test.outputdir", dir) + } + return +} + +// testFlag sees if argument i is a known flag and returns its definition, value, and whether it consumed an extra word. +func testFlag(args []string, i int) (f *testFlagSpec, value string, extra bool) { + arg := args[i] + if strings.HasPrefix(arg, "--") { // reduce two minuses to one + arg = arg[1:] + } + switch arg { + case "-?", "-h", "-help": + usage() + } + if arg == "" || arg[0] != '-' { + return + } + name := arg[1:] + // If there's already "test.", drop it for now. + name = strings.TrimPrefix(name, "test.") + equals := strings.Index(name, "=") + if equals >= 0 { + value = name[equals+1:] + name = name[:equals] + } + for _, f = range testFlagDefn { + if name == f.name { + // Booleans are special because they have modes -x, -x=true, -x=false. + if f.boolVar != nil || isBoolFlag(f.flagValue) { + if equals < 0 { // otherwise, it's been set and will be verified in setBoolFlag + value = "true" + } else { + // verify it parses + setBoolFlag(new(bool), value) + } + } else { // Non-booleans must have a value. + extra = equals < 0 + if extra { + if i+1 >= len(args) { + testSyntaxError("missing argument for flag " + f.name) + } + value = args[i+1] + } + } + if f.present && !f.multiOK { + testSyntaxError(f.name + " flag may be set only once") + } + f.present = true + return + } + } + f = nil + return +} + +// isBoolFlag reports whether v is a bool flag. +func isBoolFlag(v flag.Value) bool { + vv, ok := v.(interface { + IsBoolFlag() bool + }) + if ok { + return vv.IsBoolFlag() + } + return false +} + +// setBoolFlag sets the addressed boolean to the value. +func setBoolFlag(flag *bool, value string) { + x, err := strconv.ParseBool(value) + if err != nil { + testSyntaxError("illegal bool flag value " + value) + } + *flag = x +} + +// setIntFlag sets the addressed integer to the value. +func setIntFlag(flag *int, value string) { + x, err := strconv.Atoi(value) + if err != nil { + testSyntaxError("illegal int flag value " + value) + } + *flag = x +} + +func testSyntaxError(msg string) { + fmt.Fprintf(os.Stderr, "go test: %s\n", msg) + fmt.Fprintf(os.Stderr, `run "go help test" or "go help testflag" for more information`+"\n") + os.Exit(2) +} diff --git a/src/cmd/go/testgo.go b/src/cmd/go/testgo.go new file mode 100644 index 0000000000000000000000000000000000000000..01923f74bdff7653e4de02d9b8f3ffad0b588695 --- /dev/null +++ b/src/cmd/go/testgo.go @@ -0,0 +1,21 @@ +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// This file contains extra hooks for testing the go command. +// It is compiled into the Go binary only when building the +// test copy; it does not get compiled into the standard go +// command, so these testing hooks are not present in the +// go command that everyone uses. + +// +build testgo + +package main + +import "os" + +func init() { + if v := os.Getenv("TESTGO_IS_GO_RELEASE"); v != "" { + isGoRelease = v == "1" + } +} diff --git a/src/cmd/go/tool.go b/src/cmd/go/tool.go new file mode 100644 index 0000000000000000000000000000000000000000..937ca1f306cf025eb5124c6cfc86950d8c132e83 --- /dev/null +++ b/src/cmd/go/tool.go @@ -0,0 +1,151 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +import ( + "fmt" + "go/build" + "os" + "os/exec" + "path/filepath" + "runtime" + "sort" + "strings" +) + +var cmdTool = &Command{ + Run: runTool, + UsageLine: "tool [-n] command [args...]", + Short: "run specified go tool", + Long: ` +Tool runs the go tool command identified by the arguments. +With no arguments it prints the list of known tools. + +The -n flag causes tool to print the command that would be +executed but not execute it. + +For more about each tool command, see 'go tool command -h'. +`, +} + +var ( + toolGOOS = runtime.GOOS + toolGOARCH = runtime.GOARCH + toolIsWindows = toolGOOS == "windows" + toolDir = build.ToolDir + + toolN bool +) + +func init() { + cmdTool.Flag.BoolVar(&toolN, "n", false, "") +} + +const toolWindowsExtension = ".exe" + +func tool(toolName string) string { + toolPath := filepath.Join(toolDir, toolName) + if toolIsWindows { + toolPath += toolWindowsExtension + } + if len(buildToolExec) > 0 { + return toolPath + } + // Give a nice message if there is no tool with that name. + if _, err := os.Stat(toolPath); err != nil { + if isInGoToolsRepo(toolName) { + fmt.Fprintf(os.Stderr, "go tool: no such tool %q; to install:\n\tgo get golang.org/x/tools/cmd/%s\n", toolName, toolName) + } else { + fmt.Fprintf(os.Stderr, "go tool: no such tool %q\n", toolName) + } + setExitStatus(3) + exit() + } + return toolPath +} + +func isInGoToolsRepo(toolName string) bool { + return false +} + +func runTool(cmd *Command, args []string) { + if len(args) == 0 { + listTools() + return + } + toolName := args[0] + // The tool name must be lower-case letters, numbers or underscores. + for _, c := range toolName { + switch { + case 'a' <= c && c <= 'z', '0' <= c && c <= '9', c == '_': + default: + fmt.Fprintf(os.Stderr, "go tool: bad tool name %q\n", toolName) + setExitStatus(2) + return + } + } + toolPath := tool(toolName) + if toolPath == "" { + return + } + if toolN { + cmd := toolPath + if len(args) > 1 { + cmd += " " + strings.Join(args[1:], " ") + } + fmt.Printf("%s\n", cmd) + return + } + toolCmd := &exec.Cmd{ + Path: toolPath, + Args: args, + Stdin: os.Stdin, + Stdout: os.Stdout, + Stderr: os.Stderr, + // Set $GOROOT, mainly for go tool dist. + Env: mergeEnvLists([]string{"GOROOT=" + goroot}, os.Environ()), + } + err := toolCmd.Run() + if err != nil { + // Only print about the exit status if the command + // didn't even run (not an ExitError) or it didn't exit cleanly + // or we're printing command lines too (-x mode). + // Assume if command exited cleanly (even with non-zero status) + // it printed any messages it wanted to print. + if e, ok := err.(*exec.ExitError); !ok || !e.Exited() || buildX { + fmt.Fprintf(os.Stderr, "go tool %s: %s\n", toolName, err) + } + setExitStatus(1) + return + } +} + +// listTools prints a list of the available tools in the tools directory. +func listTools() { + f, err := os.Open(toolDir) + if err != nil { + fmt.Fprintf(os.Stderr, "go tool: no tool directory: %s\n", err) + setExitStatus(2) + return + } + defer f.Close() + names, err := f.Readdirnames(-1) + if err != nil { + fmt.Fprintf(os.Stderr, "go tool: can't read directory: %s\n", err) + setExitStatus(2) + return + } + + sort.Strings(names) + for _, name := range names { + // Unify presentation by going to lower case. + name = strings.ToLower(name) + // If it's windows, don't show the .exe suffix. + if toolIsWindows && strings.HasSuffix(name, toolWindowsExtension) { + name = name[:len(name)-len(toolWindowsExtension)] + } + fmt.Println(name) + } +} diff --git a/src/cmd/go/vcs.go b/src/cmd/go/vcs.go new file mode 100644 index 0000000000000000000000000000000000000000..28a7540dfe43c0b14f929e94051a74eb6b1ae399 --- /dev/null +++ b/src/cmd/go/vcs.go @@ -0,0 +1,1037 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "internal/singleflight" + "log" + "net/url" + "os" + "os/exec" + "path/filepath" + "regexp" + "strings" + "sync" +) + +// A vcsCmd describes how to use a version control system +// like Mercurial, Git, or Subversion. +type vcsCmd struct { + name string + cmd string // name of binary to invoke command + + createCmd []string // commands to download a fresh copy of a repository + downloadCmd []string // commands to download updates into an existing repository + + tagCmd []tagCmd // commands to list tags + tagLookupCmd []tagCmd // commands to lookup tags before running tagSyncCmd + tagSyncCmd []string // commands to sync to specific tag + tagSyncDefault []string // commands to sync to default tag + + scheme []string + pingCmd string + + remoteRepo func(v *vcsCmd, rootDir string) (remoteRepo string, err error) + resolveRepo func(v *vcsCmd, rootDir, remoteRepo string) (realRepo string, err error) +} + +var isSecureScheme = map[string]bool{ + "https": true, + "git+ssh": true, + "bzr+ssh": true, + "svn+ssh": true, + "ssh": true, +} + +func (v *vcsCmd) isSecure(repo string) bool { + u, err := url.Parse(repo) + if err != nil { + // If repo is not a URL, it's not secure. + return false + } + return isSecureScheme[u.Scheme] +} + +// A tagCmd describes a command to list available tags +// that can be passed to tagSyncCmd. +type tagCmd struct { + cmd string // command to list tags + pattern string // regexp to extract tags from list +} + +// vcsList lists the known version control systems +var vcsList = []*vcsCmd{ + vcsHg, + vcsGit, + vcsSvn, + vcsBzr, +} + +// vcsByCmd returns the version control system for the given +// command name (hg, git, svn, bzr). +func vcsByCmd(cmd string) *vcsCmd { + for _, vcs := range vcsList { + if vcs.cmd == cmd { + return vcs + } + } + return nil +} + +// vcsHg describes how to use Mercurial. +var vcsHg = &vcsCmd{ + name: "Mercurial", + cmd: "hg", + + createCmd: []string{"clone -U {repo} {dir}"}, + downloadCmd: []string{"pull"}, + + // We allow both tag and branch names as 'tags' + // for selecting a version. This lets people have + // a go.release.r60 branch and a go1 branch + // and make changes in both, without constantly + // editing .hgtags. + tagCmd: []tagCmd{ + {"tags", `^(\S+)`}, + {"branches", `^(\S+)`}, + }, + tagSyncCmd: []string{"update -r {tag}"}, + tagSyncDefault: []string{"update default"}, + + scheme: []string{"https", "http", "ssh"}, + pingCmd: "identify {scheme}://{repo}", + remoteRepo: hgRemoteRepo, +} + +func hgRemoteRepo(vcsHg *vcsCmd, rootDir string) (remoteRepo string, err error) { + out, err := vcsHg.runOutput(rootDir, "paths default") + if err != nil { + return "", err + } + return strings.TrimSpace(string(out)), nil +} + +// vcsGit describes how to use Git. +var vcsGit = &vcsCmd{ + name: "Git", + cmd: "git", + + createCmd: []string{"clone {repo} {dir}", "--git-dir={dir}/.git submodule update --init --recursive"}, + downloadCmd: []string{"pull --ff-only", "submodule update --init --recursive"}, + + tagCmd: []tagCmd{ + // tags/xxx matches a git tag named xxx + // origin/xxx matches a git branch named xxx on the default remote repository + {"show-ref", `(?:tags|origin)/(\S+)$`}, + }, + tagLookupCmd: []tagCmd{ + {"show-ref tags/{tag} origin/{tag}", `((?:tags|origin)/\S+)$`}, + }, + tagSyncCmd: []string{"checkout {tag}", "submodule update --init --recursive"}, + // both createCmd and downloadCmd update the working dir. + // No need to do more here. We used to 'checkout master' + // but that doesn't work if the default branch is not named master. + // See golang.org/issue/9032. + tagSyncDefault: []string{"checkout master", "submodule update --init --recursive"}, + + scheme: []string{"git", "https", "http", "git+ssh", "ssh"}, + pingCmd: "ls-remote {scheme}://{repo}", + remoteRepo: gitRemoteRepo, +} + +// scpSyntaxRe matches the SCP-like addresses used by Git to access +// repositories by SSH. +var scpSyntaxRe = regexp.MustCompile(`^([a-zA-Z0-9_]+)@([a-zA-Z0-9._-]+):(.*)$`) + +func gitRemoteRepo(vcsGit *vcsCmd, rootDir string) (remoteRepo string, err error) { + cmd := "config remote.origin.url" + errParse := errors.New("unable to parse output of git " + cmd) + errRemoteOriginNotFound := errors.New("remote origin not found") + outb, err := vcsGit.run1(rootDir, cmd, nil, false) + if err != nil { + // if it doesn't output any message, it means the config argument is correct, + // but the config value itself doesn't exist + if outb != nil && len(outb) == 0 { + return "", errRemoteOriginNotFound + } + return "", err + } + out := strings.TrimSpace(string(outb)) + + var repoURL *url.URL + if m := scpSyntaxRe.FindStringSubmatch(out); m != nil { + // Match SCP-like syntax and convert it to a URL. + // Eg, "git@github.com:user/repo" becomes + // "ssh://git@github.com/user/repo". + repoURL = &url.URL{ + Scheme: "ssh", + User: url.User(m[1]), + Host: m[2], + RawPath: m[3], + } + } else { + repoURL, err = url.Parse(out) + if err != nil { + return "", err + } + } + + // Iterate over insecure schemes too, because this function simply + // reports the state of the repo. If we can't see insecure schemes then + // we can't report the actual repo URL. + for _, s := range vcsGit.scheme { + if repoURL.Scheme == s { + return repoURL.String(), nil + } + } + return "", errParse +} + +// vcsBzr describes how to use Bazaar. +var vcsBzr = &vcsCmd{ + name: "Bazaar", + cmd: "bzr", + + createCmd: []string{"branch {repo} {dir}"}, + + // Without --overwrite bzr will not pull tags that changed. + // Replace by --overwrite-tags after http://pad.lv/681792 goes in. + downloadCmd: []string{"pull --overwrite"}, + + tagCmd: []tagCmd{{"tags", `^(\S+)`}}, + tagSyncCmd: []string{"update -r {tag}"}, + tagSyncDefault: []string{"update -r revno:-1"}, + + scheme: []string{"https", "http", "bzr", "bzr+ssh"}, + pingCmd: "info {scheme}://{repo}", + remoteRepo: bzrRemoteRepo, + resolveRepo: bzrResolveRepo, +} + +func bzrRemoteRepo(vcsBzr *vcsCmd, rootDir string) (remoteRepo string, err error) { + outb, err := vcsBzr.runOutput(rootDir, "config parent_location") + if err != nil { + return "", err + } + return strings.TrimSpace(string(outb)), nil +} + +func bzrResolveRepo(vcsBzr *vcsCmd, rootDir, remoteRepo string) (realRepo string, err error) { + outb, err := vcsBzr.runOutput(rootDir, "info "+remoteRepo) + if err != nil { + return "", err + } + out := string(outb) + + // Expect: + // ... + // (branch root|repository branch): + // ... + + found := false + for _, prefix := range []string{"\n branch root: ", "\n repository branch: "} { + i := strings.Index(out, prefix) + if i >= 0 { + out = out[i+len(prefix):] + found = true + break + } + } + if !found { + return "", fmt.Errorf("unable to parse output of bzr info") + } + + i := strings.Index(out, "\n") + if i < 0 { + return "", fmt.Errorf("unable to parse output of bzr info") + } + out = out[:i] + return strings.TrimSpace(string(out)), nil +} + +// vcsSvn describes how to use Subversion. +var vcsSvn = &vcsCmd{ + name: "Subversion", + cmd: "svn", + + createCmd: []string{"checkout {repo} {dir}"}, + downloadCmd: []string{"update"}, + + // There is no tag command in subversion. + // The branch information is all in the path names. + + scheme: []string{"https", "http", "svn", "svn+ssh"}, + pingCmd: "info {scheme}://{repo}", + remoteRepo: svnRemoteRepo, +} + +func svnRemoteRepo(vcsSvn *vcsCmd, rootDir string) (remoteRepo string, err error) { + outb, err := vcsSvn.runOutput(rootDir, "info") + if err != nil { + return "", err + } + out := string(outb) + + // Expect: + // ... + // Repository Root: + // ... + + i := strings.Index(out, "\nRepository Root: ") + if i < 0 { + return "", fmt.Errorf("unable to parse output of svn info") + } + out = out[i+len("\nRepository Root: "):] + i = strings.Index(out, "\n") + if i < 0 { + return "", fmt.Errorf("unable to parse output of svn info") + } + out = out[:i] + return strings.TrimSpace(string(out)), nil +} + +func (v *vcsCmd) String() string { + return v.name +} + +// run runs the command line cmd in the given directory. +// keyval is a list of key, value pairs. run expands +// instances of {key} in cmd into value, but only after +// splitting cmd into individual arguments. +// If an error occurs, run prints the command line and the +// command's combined stdout+stderr to standard error. +// Otherwise run discards the command's output. +func (v *vcsCmd) run(dir string, cmd string, keyval ...string) error { + _, err := v.run1(dir, cmd, keyval, true) + return err +} + +// runVerboseOnly is like run but only generates error output to standard error in verbose mode. +func (v *vcsCmd) runVerboseOnly(dir string, cmd string, keyval ...string) error { + _, err := v.run1(dir, cmd, keyval, false) + return err +} + +// runOutput is like run but returns the output of the command. +func (v *vcsCmd) runOutput(dir string, cmd string, keyval ...string) ([]byte, error) { + return v.run1(dir, cmd, keyval, true) +} + +// run1 is the generalized implementation of run and runOutput. +func (v *vcsCmd) run1(dir string, cmdline string, keyval []string, verbose bool) ([]byte, error) { + m := make(map[string]string) + for i := 0; i < len(keyval); i += 2 { + m[keyval[i]] = keyval[i+1] + } + args := strings.Fields(cmdline) + for i, arg := range args { + args[i] = expand(m, arg) + } + + _, err := exec.LookPath(v.cmd) + if err != nil { + fmt.Fprintf(os.Stderr, + "go: missing %s command. See https://golang.org/s/gogetcmd\n", + v.name) + return nil, err + } + + cmd := exec.Command(v.cmd, args...) + cmd.Dir = dir + cmd.Env = envForDir(cmd.Dir, os.Environ()) + if buildX { + fmt.Printf("cd %s\n", dir) + fmt.Printf("%s %s\n", v.cmd, strings.Join(args, " ")) + } + var buf bytes.Buffer + cmd.Stdout = &buf + cmd.Stderr = &buf + err = cmd.Run() + out := buf.Bytes() + if err != nil { + if verbose || buildV { + fmt.Fprintf(os.Stderr, "# cd %s; %s %s\n", dir, v.cmd, strings.Join(args, " ")) + os.Stderr.Write(out) + } + return out, err + } + return out, nil +} + +// ping pings to determine scheme to use. +func (v *vcsCmd) ping(scheme, repo string) error { + return v.runVerboseOnly(".", v.pingCmd, "scheme", scheme, "repo", repo) +} + +// create creates a new copy of repo in dir. +// The parent of dir must exist; dir must not. +func (v *vcsCmd) create(dir, repo string) error { + for _, cmd := range v.createCmd { + if !go15VendorExperiment && strings.Contains(cmd, "submodule") { + continue + } + if err := v.run(".", cmd, "dir", dir, "repo", repo); err != nil { + return err + } + } + return nil +} + +// download downloads any new changes for the repo in dir. +func (v *vcsCmd) download(dir string) error { + if err := v.fixDetachedHead(dir); err != nil { + return err + } + for _, cmd := range v.downloadCmd { + if !go15VendorExperiment && strings.Contains(cmd, "submodule") { + continue + } + if err := v.run(dir, cmd); err != nil { + return err + } + } + return nil +} + +// fixDetachedHead switches a Git repository in dir from a detached head to the master branch. +// Go versions before 1.2 downloaded Git repositories in an unfortunate way +// that resulted in the working tree state being on a detached head. +// That meant the repository was not usable for normal Git operations. +// Go 1.2 fixed that, but we can't pull into a detached head, so if this is +// a Git repository we check for being on a detached head and switch to the +// real branch, almost always called "master". +// TODO(dsymonds): Consider removing this for Go 1.3. +func (v *vcsCmd) fixDetachedHead(dir string) error { + if v != vcsGit { + return nil + } + + // "git symbolic-ref HEAD" succeeds iff we are not on a detached head. + if err := v.runVerboseOnly(dir, "symbolic-ref HEAD"); err == nil { + // not on a detached head + return nil + } + if buildV { + log.Printf("%s on detached head; repairing", dir) + } + return v.run(dir, "checkout master") +} + +// tags returns the list of available tags for the repo in dir. +func (v *vcsCmd) tags(dir string) ([]string, error) { + var tags []string + for _, tc := range v.tagCmd { + out, err := v.runOutput(dir, tc.cmd) + if err != nil { + return nil, err + } + re := regexp.MustCompile(`(?m-s)` + tc.pattern) + for _, m := range re.FindAllStringSubmatch(string(out), -1) { + tags = append(tags, m[1]) + } + } + return tags, nil +} + +// tagSync syncs the repo in dir to the named tag, +// which either is a tag returned by tags or is v.tagDefault. +func (v *vcsCmd) tagSync(dir, tag string) error { + if v.tagSyncCmd == nil { + return nil + } + if tag != "" { + for _, tc := range v.tagLookupCmd { + out, err := v.runOutput(dir, tc.cmd, "tag", tag) + if err != nil { + return err + } + re := regexp.MustCompile(`(?m-s)` + tc.pattern) + m := re.FindStringSubmatch(string(out)) + if len(m) > 1 { + tag = m[1] + break + } + } + } + + if tag == "" && v.tagSyncDefault != nil { + for _, cmd := range v.tagSyncDefault { + if !go15VendorExperiment && strings.Contains(cmd, "submodule") { + continue + } + if err := v.run(dir, cmd); err != nil { + return err + } + } + return nil + } + + for _, cmd := range v.tagSyncCmd { + if !go15VendorExperiment && strings.Contains(cmd, "submodule") { + continue + } + if err := v.run(dir, cmd, "tag", tag); err != nil { + return err + } + } + return nil +} + +// A vcsPath describes how to convert an import path into a +// version control system and repository name. +type vcsPath struct { + prefix string // prefix this description applies to + re string // pattern for import path + repo string // repository to use (expand with match of re) + vcs string // version control system to use (expand with match of re) + check func(match map[string]string) error // additional checks + ping bool // ping for scheme to use to download repo + + regexp *regexp.Regexp // cached compiled form of re +} + +// vcsForDir inspects dir and its parents to determine the +// version control system and code repository to use. +// On return, root is the import path +// corresponding to the root of the repository +// (thus root is a prefix of importPath). +func vcsForDir(p *Package) (vcs *vcsCmd, root string, err error) { + // Clean and double-check that dir is in (a subdirectory of) srcRoot. + dir := filepath.Clean(p.Dir) + srcRoot := filepath.Clean(p.build.SrcRoot) + if len(dir) <= len(srcRoot) || dir[len(srcRoot)] != filepath.Separator { + return nil, "", fmt.Errorf("directory %q is outside source root %q", dir, srcRoot) + } + + origDir := dir + for len(dir) > len(srcRoot) { + for _, vcs := range vcsList { + if fi, err := os.Stat(filepath.Join(dir, "."+vcs.cmd)); err == nil && fi.IsDir() { + return vcs, dir[len(srcRoot)+1:], nil + } + } + + // Move to parent. + ndir := filepath.Dir(dir) + if len(ndir) >= len(dir) { + // Shouldn't happen, but just in case, stop. + break + } + dir = ndir + } + + return nil, "", fmt.Errorf("directory %q is not using a known version control system", origDir) +} + +// repoRoot represents a version control system, a repo, and a root of +// where to put it on disk. +type repoRoot struct { + vcs *vcsCmd + + // repo is the repository URL, including scheme + repo string + + // root is the import path corresponding to the root of the + // repository + root string +} + +var httpPrefixRE = regexp.MustCompile(`^https?:`) + +// securityMode specifies whether a function should make network +// calls using insecure transports (eg, plain text HTTP). +// The zero value is "secure". +type securityMode int + +const ( + secure securityMode = iota + insecure +) + +// repoRootForImportPath analyzes importPath to determine the +// version control system, and code repository to use. +func repoRootForImportPath(importPath string, security securityMode) (*repoRoot, error) { + rr, err := repoRootFromVCSPaths(importPath, "", security, vcsPaths) + if err == errUnknownSite { + // If there are wildcards, look up the thing before the wildcard, + // hoping it applies to the wildcarded parts too. + // This makes 'go get rsc.io/pdf/...' work in a fresh GOPATH. + lookup := strings.TrimSuffix(importPath, "/...") + if i := strings.Index(lookup, "/.../"); i >= 0 { + lookup = lookup[:i] + } + rr, err = repoRootForImportDynamic(lookup, security) + + // repoRootForImportDynamic returns error detail + // that is irrelevant if the user didn't intend to use a + // dynamic import in the first place. + // Squelch it. + if err != nil { + if buildV { + log.Printf("import %q: %v", importPath, err) + } + err = fmt.Errorf("unrecognized import path %q", importPath) + } + } + if err != nil { + rr1, err1 := repoRootFromVCSPaths(importPath, "", security, vcsPathsAfterDynamic) + if err1 == nil { + rr = rr1 + err = nil + } + } + + if err == nil && strings.Contains(importPath, "...") && strings.Contains(rr.root, "...") { + // Do not allow wildcards in the repo root. + rr = nil + err = fmt.Errorf("cannot expand ... in %q", importPath) + } + return rr, err +} + +var errUnknownSite = errors.New("dynamic lookup required to find mapping") + +// repoRootFromVCSPaths attempts to map importPath to a repoRoot +// using the mappings defined in vcsPaths. +// If scheme is non-empty, that scheme is forced. +func repoRootFromVCSPaths(importPath, scheme string, security securityMode, vcsPaths []*vcsPath) (*repoRoot, error) { + // A common error is to use https://packagepath because that's what + // hg and git require. Diagnose this helpfully. + if loc := httpPrefixRE.FindStringIndex(importPath); loc != nil { + // The importPath has been cleaned, so has only one slash. The pattern + // ignores the slashes; the error message puts them back on the RHS at least. + return nil, fmt.Errorf("%q not allowed in import path", importPath[loc[0]:loc[1]]+"//") + } + for _, srv := range vcsPaths { + if !strings.HasPrefix(importPath, srv.prefix) { + continue + } + m := srv.regexp.FindStringSubmatch(importPath) + if m == nil { + if srv.prefix != "" { + return nil, fmt.Errorf("invalid %s import path %q", srv.prefix, importPath) + } + continue + } + + // Build map of named subexpression matches for expand. + match := map[string]string{ + "prefix": srv.prefix, + "import": importPath, + } + for i, name := range srv.regexp.SubexpNames() { + if name != "" && match[name] == "" { + match[name] = m[i] + } + } + if srv.vcs != "" { + match["vcs"] = expand(match, srv.vcs) + } + if srv.repo != "" { + match["repo"] = expand(match, srv.repo) + } + if srv.check != nil { + if err := srv.check(match); err != nil { + return nil, err + } + } + vcs := vcsByCmd(match["vcs"]) + if vcs == nil { + return nil, fmt.Errorf("unknown version control system %q", match["vcs"]) + } + if srv.ping { + if scheme != "" { + match["repo"] = scheme + "://" + match["repo"] + } else { + for _, scheme := range vcs.scheme { + if security == secure && !isSecureScheme[scheme] { + continue + } + if vcs.ping(scheme, match["repo"]) == nil { + match["repo"] = scheme + "://" + match["repo"] + break + } + } + } + } + rr := &repoRoot{ + vcs: vcs, + repo: match["repo"], + root: match["root"], + } + return rr, nil + } + return nil, errUnknownSite +} + +// repoRootForImportDynamic finds a *repoRoot for a custom domain that's not +// statically known by repoRootForImportPathStatic. +// +// This handles custom import paths like "name.tld/pkg/foo" or just "name.tld". +func repoRootForImportDynamic(importPath string, security securityMode) (*repoRoot, error) { + slash := strings.Index(importPath, "/") + if slash < 0 { + slash = len(importPath) + } + host := importPath[:slash] + if !strings.Contains(host, ".") { + return nil, errors.New("import path does not begin with hostname") + } + urlStr, body, err := httpsOrHTTP(importPath, security) + if err != nil { + msg := "https fetch: %v" + if security == insecure { + msg = "http/" + msg + } + return nil, fmt.Errorf(msg, err) + } + defer body.Close() + imports, err := parseMetaGoImports(body) + if err != nil { + return nil, fmt.Errorf("parsing %s: %v", importPath, err) + } + // Find the matched meta import. + mmi, err := matchGoImport(imports, importPath) + if err != nil { + if err != errNoMatch { + return nil, fmt.Errorf("parse %s: %v", urlStr, err) + } + return nil, fmt.Errorf("parse %s: no go-import meta tags", urlStr) + } + if buildV { + log.Printf("get %q: found meta tag %#v at %s", importPath, mmi, urlStr) + } + // If the import was "uni.edu/bob/project", which said the + // prefix was "uni.edu" and the RepoRoot was "evilroot.com", + // make sure we don't trust Bob and check out evilroot.com to + // "uni.edu" yet (possibly overwriting/preempting another + // non-evil student). Instead, first verify the root and see + // if it matches Bob's claim. + if mmi.Prefix != importPath { + if buildV { + log.Printf("get %q: verifying non-authoritative meta tag", importPath) + } + urlStr0 := urlStr + var imports []metaImport + urlStr, imports, err = metaImportsForPrefix(mmi.Prefix, security) + if err != nil { + return nil, err + } + metaImport2, err := matchGoImport(imports, importPath) + if err != nil || mmi != metaImport2 { + return nil, fmt.Errorf("%s and %s disagree about go-import for %s", urlStr0, urlStr, mmi.Prefix) + } + } + + if !strings.Contains(mmi.RepoRoot, "://") { + return nil, fmt.Errorf("%s: invalid repo root %q; no scheme", urlStr, mmi.RepoRoot) + } + rr := &repoRoot{ + vcs: vcsByCmd(mmi.VCS), + repo: mmi.RepoRoot, + root: mmi.Prefix, + } + if rr.vcs == nil { + return nil, fmt.Errorf("%s: unknown vcs %q", urlStr, mmi.VCS) + } + return rr, nil +} + +var fetchGroup singleflight.Group +var ( + fetchCacheMu sync.Mutex + fetchCache = map[string]fetchResult{} // key is metaImportsForPrefix's importPrefix +) + +// metaImportsForPrefix takes a package's root import path as declared in a tag +// and returns its HTML discovery URL and the parsed metaImport lines +// found on the page. +// +// The importPath is of the form "golang.org/x/tools". +// It is an error if no imports are found. +// urlStr will still be valid if err != nil. +// The returned urlStr will be of the form "https://golang.org/x/tools?go-get=1" +func metaImportsForPrefix(importPrefix string, security securityMode) (urlStr string, imports []metaImport, err error) { + setCache := func(res fetchResult) (fetchResult, error) { + fetchCacheMu.Lock() + defer fetchCacheMu.Unlock() + fetchCache[importPrefix] = res + return res, nil + } + + resi, _, _ := fetchGroup.Do(importPrefix, func() (resi interface{}, err error) { + fetchCacheMu.Lock() + if res, ok := fetchCache[importPrefix]; ok { + fetchCacheMu.Unlock() + return res, nil + } + fetchCacheMu.Unlock() + + urlStr, body, err := httpsOrHTTP(importPrefix, security) + if err != nil { + return setCache(fetchResult{urlStr: urlStr, err: fmt.Errorf("fetch %s: %v", urlStr, err)}) + } + imports, err := parseMetaGoImports(body) + if err != nil { + return setCache(fetchResult{urlStr: urlStr, err: fmt.Errorf("parsing %s: %v", urlStr, err)}) + } + if len(imports) == 0 { + err = fmt.Errorf("fetch %s: no go-import meta tag", urlStr) + } + return setCache(fetchResult{urlStr: urlStr, imports: imports, err: err}) + }) + res := resi.(fetchResult) + return res.urlStr, res.imports, res.err +} + +type fetchResult struct { + urlStr string // e.g. "https://foo.com/x/bar?go-get=1" + imports []metaImport + err error +} + +// metaImport represents the parsed tags from HTML files. +type metaImport struct { + Prefix, VCS, RepoRoot string +} + +// errNoMatch is returned from matchGoImport when there's no applicable match. +var errNoMatch = errors.New("no import match") + +// matchGoImport returns the metaImport from imports matching importPath. +// An error is returned if there are multiple matches. +// errNoMatch is returned if none match. +func matchGoImport(imports []metaImport, importPath string) (_ metaImport, err error) { + match := -1 + for i, im := range imports { + if !strings.HasPrefix(importPath, im.Prefix) { + continue + } + if match != -1 { + err = fmt.Errorf("multiple meta tags match import path %q", importPath) + return + } + match = i + } + if match == -1 { + err = errNoMatch + return + } + return imports[match], nil +} + +// expand rewrites s to replace {k} with match[k] for each key k in match. +func expand(match map[string]string, s string) string { + for k, v := range match { + s = strings.Replace(s, "{"+k+"}", v, -1) + } + return s +} + +// vcsPaths defines the meaning of import paths referring to +// commonly-used VCS hosting sites (github.com/user/dir) +// and import paths referring to a fully-qualified importPath +// containing a VCS type (foo.com/repo.git/dir) +var vcsPaths = []*vcsPath{ + // Google Code - new syntax + { + prefix: "code.google.com/", + re: `^(?Pcode\.google\.com/p/(?P[a-z0-9\-]+)(\.(?P[a-z0-9\-]+))?)(/[A-Za-z0-9_.\-]+)*$`, + repo: "https://{root}", + check: googleCodeVCS, + }, + + // Google Code - old syntax + { + re: `^(?P[a-z0-9_\-.]+)\.googlecode\.com/(git|hg|svn)(?P/.*)?$`, + check: oldGoogleCode, + }, + + // Github + { + prefix: "github.com/", + re: `^(?Pgithub\.com/[A-Za-z0-9_.\-]+/[A-Za-z0-9_.\-]+)(/[A-Za-z0-9_.\-]+)*$`, + vcs: "git", + repo: "https://{root}", + check: noVCSSuffix, + }, + + // Bitbucket + { + prefix: "bitbucket.org/", + re: `^(?Pbitbucket\.org/(?P[A-Za-z0-9_.\-]+/[A-Za-z0-9_.\-]+))(/[A-Za-z0-9_.\-]+)*$`, + repo: "https://{root}", + check: bitbucketVCS, + }, + + // IBM DevOps Services (JazzHub) + { + prefix: "hub.jazz.net/git", + re: `^(?Phub.jazz.net/git/[a-z0-9]+/[A-Za-z0-9_.\-]+)(/[A-Za-z0-9_.\-]+)*$`, + vcs: "git", + repo: "https://{root}", + check: noVCSSuffix, + }, + + // Git at Apache + { + prefix: "git.apache.org", + re: `^(?Pgit.apache.org/[a-z0-9_.\-]+\.git)(/[A-Za-z0-9_.\-]+)*$`, + vcs: "git", + repo: "https://{root}", + }, + + // General syntax for any server. + // Must be last. + { + re: `^(?P(?P([a-z0-9.\-]+\.)+[a-z0-9.\-]+(:[0-9]+)?/[A-Za-z0-9_.\-/]*?)\.(?Pbzr|git|hg|svn))(/[A-Za-z0-9_.\-]+)*$`, + ping: true, + }, +} + +// vcsPathsAfterDynamic gives additional vcsPaths entries +// to try after the dynamic HTML check. +// This gives those sites a chance to introduce tags +// as part of a graceful transition away from the hard-coded logic. +var vcsPathsAfterDynamic = []*vcsPath{ + // Launchpad. See golang.org/issue/11436. + { + prefix: "launchpad.net/", + re: `^(?Plaunchpad\.net/((?P[A-Za-z0-9_.\-]+)(?P/[A-Za-z0-9_.\-]+)?|~[A-Za-z0-9_.\-]+/(\+junk|[A-Za-z0-9_.\-]+)/[A-Za-z0-9_.\-]+))(/[A-Za-z0-9_.\-]+)*$`, + vcs: "bzr", + repo: "https://{root}", + check: launchpadVCS, + }, +} + +func init() { + // fill in cached regexps. + // Doing this eagerly discovers invalid regexp syntax + // without having to run a command that needs that regexp. + for _, srv := range vcsPaths { + srv.regexp = regexp.MustCompile(srv.re) + } + for _, srv := range vcsPathsAfterDynamic { + srv.regexp = regexp.MustCompile(srv.re) + } +} + +// noVCSSuffix checks that the repository name does not +// end in .foo for any version control system foo. +// The usual culprit is ".git". +func noVCSSuffix(match map[string]string) error { + repo := match["repo"] + for _, vcs := range vcsList { + if strings.HasSuffix(repo, "."+vcs.cmd) { + return fmt.Errorf("invalid version control suffix in %s path", match["prefix"]) + } + } + return nil +} + +var googleCheckout = regexp.MustCompile(`id="checkoutcmd">(hg|git|svn)`) + +// googleCodeVCS determines the version control system for +// a code.google.com repository, by scraping the project's +// /source/checkout page. +func googleCodeVCS(match map[string]string) error { + if err := noVCSSuffix(match); err != nil { + return err + } + data, err := httpGET(expand(match, "https://code.google.com/p/{project}/source/checkout?repo={subrepo}")) + if err != nil { + return err + } + + if m := googleCheckout.FindSubmatch(data); m != nil { + if vcs := vcsByCmd(string(m[1])); vcs != nil { + // Subversion requires the old URLs. + // TODO: Test. + if vcs == vcsSvn { + if match["subrepo"] != "" { + return fmt.Errorf("sub-repositories not supported in Google Code Subversion projects") + } + match["repo"] = expand(match, "https://{project}.googlecode.com/svn") + } + match["vcs"] = vcs.cmd + return nil + } + } + + return fmt.Errorf("unable to detect version control system for code.google.com/ path") +} + +// oldGoogleCode is invoked for old-style foo.googlecode.com paths. +// It prints an error giving the equivalent new path. +func oldGoogleCode(match map[string]string) error { + return fmt.Errorf("invalid Google Code import path: use %s instead", + expand(match, "code.google.com/p/{project}{path}")) +} + +// bitbucketVCS determines the version control system for a +// Bitbucket repository, by using the Bitbucket API. +func bitbucketVCS(match map[string]string) error { + if err := noVCSSuffix(match); err != nil { + return err + } + + var resp struct { + SCM string `json:"scm"` + } + url := expand(match, "https://api.bitbucket.org/1.0/repositories/{bitname}") + data, err := httpGET(url) + if err != nil { + if httpErr, ok := err.(*httpError); ok && httpErr.statusCode == 403 { + // this may be a private repository. If so, attempt to determine which + // VCS it uses. See issue 5375. + root := match["root"] + for _, vcs := range []string{"git", "hg"} { + if vcsByCmd(vcs).ping("https", root) == nil { + resp.SCM = vcs + break + } + } + } + + if resp.SCM == "" { + return err + } + } else { + if err := json.Unmarshal(data, &resp); err != nil { + return fmt.Errorf("decoding %s: %v", url, err) + } + } + + if vcsByCmd(resp.SCM) != nil { + match["vcs"] = resp.SCM + if resp.SCM == "git" { + match["repo"] += ".git" + } + return nil + } + + return fmt.Errorf("unable to detect version control system for bitbucket.org/ path") +} + +// launchpadVCS solves the ambiguity for "lp.net/project/foo". In this case, +// "foo" could be a series name registered in Launchpad with its own branch, +// and it could also be the name of a directory within the main project +// branch one level up. +func launchpadVCS(match map[string]string) error { + if match["project"] == "" || match["series"] == "" { + return nil + } + _, err := httpGET(expand(match, "https://code.launchpad.net/{project}{series}/.bzr/branch-format")) + if err != nil { + match["root"] = expand(match, "launchpad.net/{project}") + match["repo"] = expand(match, "https://{root}") + } + return nil +} diff --git a/src/cmd/go/vcs_test.go b/src/cmd/go/vcs_test.go new file mode 100644 index 0000000000000000000000000000000000000000..f5d5e4f4f0b521a5ccbe99b5039a0ee95965fd7b --- /dev/null +++ b/src/cmd/go/vcs_test.go @@ -0,0 +1,175 @@ +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +import ( + "internal/testenv" + "testing" +) + +// Test that RepoRootForImportPath creates the correct RepoRoot for a given importPath. +// TODO(cmang): Add tests for SVN and BZR. +func TestRepoRootForImportPath(t *testing.T) { + testenv.MustHaveExternalNetwork(t) + + tests := []struct { + path string + want *repoRoot + }{ + { + "code.google.com/p/go", + &repoRoot{ + vcs: vcsHg, + repo: "https://code.google.com/p/go", + }, + }, + /*{ + "code.google.com/r/go", + &repoRoot{ + vcs: vcsHg, + repo: "https://code.google.com/r/go", + }, + },*/ + { + "github.com/golang/groupcache", + &repoRoot{ + vcs: vcsGit, + repo: "https://github.com/golang/groupcache", + }, + }, + // IBM DevOps Services tests + { + "hub.jazz.net/git/user1/pkgname", + &repoRoot{ + vcs: vcsGit, + repo: "https://hub.jazz.net/git/user1/pkgname", + }, + }, + { + "hub.jazz.net/git/user1/pkgname/submodule/submodule/submodule", + &repoRoot{ + vcs: vcsGit, + repo: "https://hub.jazz.net/git/user1/pkgname", + }, + }, + { + "hub.jazz.net", + nil, + }, + { + "hub2.jazz.net", + nil, + }, + { + "hub.jazz.net/someotherprefix", + nil, + }, + { + "hub.jazz.net/someotherprefix/user1/pkgname", + nil, + }, + // Spaces are not valid in user names or package names + { + "hub.jazz.net/git/User 1/pkgname", + nil, + }, + { + "hub.jazz.net/git/user1/pkg name", + nil, + }, + // Dots are not valid in user names + { + "hub.jazz.net/git/user.1/pkgname", + nil, + }, + { + "hub.jazz.net/git/user/pkg.name", + &repoRoot{ + vcs: vcsGit, + repo: "https://hub.jazz.net/git/user/pkg.name", + }, + }, + // User names cannot have uppercase letters + { + "hub.jazz.net/git/USER/pkgname", + nil, + }, + // Spaces are not valid in package name + { + "git.apache.org/package name/path/to/lib", + nil, + }, + // Should have ".git" suffix + { + "git.apache.org/package-name/path/to/lib", + nil, + }, + { + "git.apache.org/package-name.git", + &repoRoot{ + vcs: vcsGit, + repo: "https://git.apache.org/package-name.git", + }, + }, + { + "git.apache.org/package-name_2.x.git/path/to/lib", + &repoRoot{ + vcs: vcsGit, + repo: "https://git.apache.org/package-name_2.x.git", + }, + }, + } + + for _, test := range tests { + got, err := repoRootForImportPath(test.path, secure) + want := test.want + + if want == nil { + if err == nil { + t.Errorf("RepoRootForImport(%q): Error expected but not received", test.path) + } + continue + } + if err != nil { + t.Errorf("RepoRootForImport(%q): %v", test.path, err) + continue + } + if got.vcs.name != want.vcs.name || got.repo != want.repo { + t.Errorf("RepoRootForImport(%q) = VCS(%s) Repo(%s), want VCS(%s) Repo(%s)", test.path, got.vcs, got.repo, want.vcs, want.repo) + } + } +} + +func TestIsSecure(t *testing.T) { + tests := []struct { + vcs *vcsCmd + url string + secure bool + }{ + {vcsGit, "http://example.com/foo.git", false}, + {vcsGit, "https://example.com/foo.git", true}, + {vcsBzr, "http://example.com/foo.bzr", false}, + {vcsBzr, "https://example.com/foo.bzr", true}, + {vcsSvn, "http://example.com/svn", false}, + {vcsSvn, "https://example.com/svn", true}, + {vcsHg, "http://example.com/foo.hg", false}, + {vcsHg, "https://example.com/foo.hg", true}, + {vcsGit, "ssh://user@example.com/foo.git", true}, + {vcsGit, "user@server:path/to/repo.git", false}, + {vcsGit, "user@server:", false}, + {vcsGit, "server:repo.git", false}, + {vcsGit, "server:path/to/repo.git", false}, + {vcsGit, "example.com:path/to/repo.git", false}, + {vcsGit, "path/that/contains/a:colon/repo.git", false}, + {vcsHg, "ssh://user@example.com/path/to/repo.hg", true}, + } + + for _, test := range tests { + secure := test.vcs.isSecure(test.url) + if secure != test.secure { + t.Errorf("%s isSecure(%q) = %t; want %t", test.vcs, test.url, secure, test.secure) + } + } +} diff --git a/src/cmd/go/vendor_test.go b/src/cmd/go/vendor_test.go new file mode 100644 index 0000000000000000000000000000000000000000..1e8cf9c8d26d7531fbc5520f5819362c5b21e2a3 --- /dev/null +++ b/src/cmd/go/vendor_test.go @@ -0,0 +1,258 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Tests for vendoring semantics. + +package main_test + +import ( + "bytes" + "fmt" + "internal/testenv" + "path/filepath" + "regexp" + "strings" + "testing" +) + +func TestVendorImports(t *testing.T) { + tg := testgo(t) + defer tg.cleanup() + tg.setenv("GOPATH", filepath.Join(tg.pwd(), "testdata")) + tg.setenv("GO15VENDOREXPERIMENT", "1") + tg.run("list", "-f", "{{.ImportPath}} {{.Imports}}", "vend/...") + want := ` + vend [vend/vendor/p r] + vend/hello [fmt vend/vendor/strings] + vend/subdir [vend/vendor/p r] + vend/vendor/p [] + vend/vendor/q [] + vend/vendor/strings [] + vend/x [vend/x/vendor/p vend/vendor/q vend/x/vendor/r] + vend/x/invalid [vend/x/invalid/vendor/foo] + vend/x/vendor/p [] + vend/x/vendor/p/p [notfound] + vend/x/vendor/r [] + ` + want = strings.Replace(want+"\t", "\n\t\t", "\n", -1) + want = strings.TrimPrefix(want, "\n") + + have := tg.stdout.String() + + if have != want { + t.Errorf("incorrect go list output:\n%s", diffSortedOutputs(have, want)) + } +} + +func TestVendorRun(t *testing.T) { + tg := testgo(t) + defer tg.cleanup() + tg.setenv("GOPATH", filepath.Join(tg.pwd(), "testdata")) + tg.setenv("GO15VENDOREXPERIMENT", "1") + tg.cd(filepath.Join(tg.pwd(), "testdata/src/vend/hello")) + tg.run("run", "hello.go") + tg.grepStdout("hello, world", "missing hello world output") +} + +func TestVendorGOPATH(t *testing.T) { + tg := testgo(t) + defer tg.cleanup() + changeVolume := func(s string, f func(s string) string) string { + vol := filepath.VolumeName(s) + return f(vol) + s[len(vol):] + } + gopath := changeVolume(filepath.Join(tg.pwd(), "testdata"), strings.ToLower) + tg.setenv("GOPATH", gopath) + tg.setenv("GO15VENDOREXPERIMENT", "1") + cd := changeVolume(filepath.Join(tg.pwd(), "testdata/src/vend/hello"), strings.ToUpper) + tg.cd(cd) + tg.run("run", "hello.go") + tg.grepStdout("hello, world", "missing hello world output") +} + +func TestVendorTest(t *testing.T) { + tg := testgo(t) + defer tg.cleanup() + tg.setenv("GOPATH", filepath.Join(tg.pwd(), "testdata")) + tg.setenv("GO15VENDOREXPERIMENT", "1") + tg.cd(filepath.Join(tg.pwd(), "testdata/src/vend/hello")) + tg.run("test", "-v") + tg.grepStdout("TestMsgInternal", "missing use in internal test") + tg.grepStdout("TestMsgExternal", "missing use in external test") +} + +func TestVendorInvalid(t *testing.T) { + tg := testgo(t) + defer tg.cleanup() + tg.setenv("GOPATH", filepath.Join(tg.pwd(), "testdata")) + tg.setenv("GO15VENDOREXPERIMENT", "1") + + tg.runFail("build", "vend/x/invalid") + tg.grepStderr("must be imported as foo", "missing vendor import error") +} + +func TestVendorImportError(t *testing.T) { + tg := testgo(t) + defer tg.cleanup() + tg.setenv("GOPATH", filepath.Join(tg.pwd(), "testdata")) + tg.setenv("GO15VENDOREXPERIMENT", "1") + + tg.runFail("build", "vend/x/vendor/p/p") + + re := regexp.MustCompile(`cannot find package "notfound" in any of: + .*[\\/]testdata[\\/]src[\\/]vend[\\/]x[\\/]vendor[\\/]notfound \(vendor tree\) + .*[\\/]testdata[\\/]src[\\/]vend[\\/]vendor[\\/]notfound \(vendor tree\) + .*[\\/]src[\\/]notfound \(from \$GOROOT\) + .*[\\/]testdata[\\/]src[\\/]notfound \(from \$GOPATH\)`) + + if !re.MatchString(tg.stderr.String()) { + t.Errorf("did not find expected search list in error text") + } +} + +// diffSortedOutput prepares a diff of the already sorted outputs haveText and wantText. +// The diff shows common lines prefixed by a tab, lines present only in haveText +// prefixed by "unexpected: ", and lines present only in wantText prefixed by "missing: ". +func diffSortedOutputs(haveText, wantText string) string { + var diff bytes.Buffer + have := splitLines(haveText) + want := splitLines(wantText) + for len(have) > 0 || len(want) > 0 { + if len(want) == 0 || len(have) > 0 && have[0] < want[0] { + fmt.Fprintf(&diff, "unexpected: %s\n", have[0]) + have = have[1:] + continue + } + if len(have) == 0 || len(want) > 0 && want[0] < have[0] { + fmt.Fprintf(&diff, "missing: %s\n", want[0]) + want = want[1:] + continue + } + fmt.Fprintf(&diff, "\t%s\n", want[0]) + want = want[1:] + have = have[1:] + } + return diff.String() +} + +func splitLines(s string) []string { + x := strings.Split(s, "\n") + if x[len(x)-1] == "" { + x = x[:len(x)-1] + } + return x +} + +func TestVendorGet(t *testing.T) { + tg := testgo(t) + defer tg.cleanup() + tg.tempFile("src/v/m.go", ` + package main + import ("fmt"; "vendor.org/p") + func main() { + fmt.Println(p.C) + }`) + tg.tempFile("src/v/m_test.go", ` + package main + import ("fmt"; "testing"; "vendor.org/p") + func TestNothing(t *testing.T) { + fmt.Println(p.C) + }`) + tg.tempFile("src/v/vendor/vendor.org/p/p.go", ` + package p + const C = 1`) + tg.setenv("GOPATH", tg.path(".")) + tg.setenv("GO15VENDOREXPERIMENT", "1") + tg.cd(tg.path("src/v")) + tg.run("run", "m.go") + tg.run("test") + tg.run("list", "-f", "{{.Imports}}") + tg.grepStdout("v/vendor/vendor.org/p", "import not in vendor directory") + tg.run("list", "-f", "{{.TestImports}}") + tg.grepStdout("v/vendor/vendor.org/p", "test import not in vendor directory") + tg.run("get") + tg.run("get", "-t") +} + +func TestVendorGetUpdate(t *testing.T) { + testenv.MustHaveExternalNetwork(t) + + tg := testgo(t) + defer tg.cleanup() + tg.makeTempdir() + tg.setenv("GOPATH", tg.path(".")) + tg.setenv("GO15VENDOREXPERIMENT", "1") + tg.run("get", "github.com/rsc/go-get-issue-11864") + tg.run("get", "-u", "github.com/rsc/go-get-issue-11864") +} + +func TestVendorCache(t *testing.T) { + tg := testgo(t) + defer tg.cleanup() + tg.setenv("GOPATH", filepath.Join(tg.pwd(), "testdata/testvendor")) + tg.setenv("GO15VENDOREXPERIMENT", "1") + tg.runFail("build", "p") + tg.grepStderr("must be imported as x", "did not fail to build p") +} + +func TestVendorTest2(t *testing.T) { + testenv.MustHaveExternalNetwork(t) + + tg := testgo(t) + defer tg.cleanup() + tg.makeTempdir() + tg.setenv("GOPATH", tg.path(".")) + tg.setenv("GO15VENDOREXPERIMENT", "1") + tg.run("get", "github.com/rsc/go-get-issue-11864") + + // build -i should work + tg.run("build", "-i", "github.com/rsc/go-get-issue-11864") + tg.run("build", "-i", "github.com/rsc/go-get-issue-11864/t") + + // test -i should work like build -i (golang.org/issue/11988) + tg.run("test", "-i", "github.com/rsc/go-get-issue-11864") + tg.run("test", "-i", "github.com/rsc/go-get-issue-11864/t") + + // test should work too + tg.run("test", "github.com/rsc/go-get-issue-11864") + tg.run("test", "github.com/rsc/go-get-issue-11864/t") + + // external tests should observe internal test exports (golang.org/issue/11977) + tg.run("test", "github.com/rsc/go-get-issue-11864/vendor/vendor.org/tx2") +} + +func TestVendorList(t *testing.T) { + testenv.MustHaveExternalNetwork(t) + + tg := testgo(t) + defer tg.cleanup() + tg.makeTempdir() + tg.setenv("GOPATH", tg.path(".")) + tg.setenv("GO15VENDOREXPERIMENT", "1") + tg.run("get", "github.com/rsc/go-get-issue-11864") + + tg.run("list", "-f", `{{join .TestImports "\n"}}`, "github.com/rsc/go-get-issue-11864/t") + tg.grepStdout("go-get-issue-11864/vendor/vendor.org/p", "did not find vendor-expanded p") + + tg.run("list", "-f", `{{join .XTestImports "\n"}}`, "github.com/rsc/go-get-issue-11864/tx") + tg.grepStdout("go-get-issue-11864/vendor/vendor.org/p", "did not find vendor-expanded p") + + tg.run("list", "-f", `{{join .XTestImports "\n"}}`, "github.com/rsc/go-get-issue-11864/vendor/vendor.org/tx2") + tg.grepStdout("go-get-issue-11864/vendor/vendor.org/tx2", "did not find vendor-expanded tx2") + + tg.run("list", "-f", `{{join .XTestImports "\n"}}`, "github.com/rsc/go-get-issue-11864/vendor/vendor.org/tx3") + tg.grepStdout("go-get-issue-11864/vendor/vendor.org/tx3", "did not find vendor-expanded tx3") +} + +func TestVendor12156(t *testing.T) { + // Former index out of range panic. + tg := testgo(t) + defer tg.cleanup() + tg.setenv("GOPATH", filepath.Join(tg.pwd(), "testdata/testvendor2")) + tg.setenv("GO15VENDOREXPERIMENT", "1") + tg.cd(filepath.Join(tg.pwd(), "testdata/testvendor2/src/p")) + tg.runFail("build", "p.go") + tg.grepStderrNot("panic", "panicked") + tg.grepStderr(`cannot find package "x"`, "wrong error") +} diff --git a/src/cmd/go/version.go b/src/cmd/go/version.go new file mode 100644 index 0000000000000000000000000000000000000000..a41f4a7361546d1067cf076697f82a68178b30e2 --- /dev/null +++ b/src/cmd/go/version.go @@ -0,0 +1,25 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +import ( + "fmt" + "runtime" +) + +var cmdVersion = &Command{ + Run: runVersion, + UsageLine: "version", + Short: "print Go version", + Long: `Version prints the Go version, as reported by runtime.Version.`, +} + +func runVersion(cmd *Command, args []string) { + if len(args) != 0 { + cmd.Usage() + } + + fmt.Printf("go version %s %s/%s\n", runtime.Version(), runtime.GOOS, runtime.GOARCH) +} diff --git a/src/cmd/go/vet.go b/src/cmd/go/vet.go new file mode 100644 index 0000000000000000000000000000000000000000..81b978e8dab2b5213cbe64d79c89bd9f0cccea69 --- /dev/null +++ b/src/cmd/go/vet.go @@ -0,0 +1,52 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +import "path/filepath" + +func init() { + addBuildFlags(cmdVet) +} + +var cmdVet = &Command{ + Run: runVet, + UsageLine: "vet [-n] [-x] [build flags] [packages]", + Short: "run go tool vet on packages", + Long: ` +Vet runs the Go vet command on the packages named by the import paths. + +For more about vet, see 'go doc cmd/vet'. +For more about specifying packages, see 'go help packages'. + +To run the vet tool with specific options, run 'go tool vet'. + +The -n flag prints commands that would be executed. +The -x flag prints commands as they are executed. + +For more about build flags, see 'go help build'. + +See also: go fmt, go fix. + `, +} + +func runVet(cmd *Command, args []string) { + for _, p := range packages(args) { + // Vet expects to be given a set of files all from the same package. + // Run once for package p and once for package p_test. + if len(p.GoFiles)+len(p.CgoFiles)+len(p.TestGoFiles) > 0 { + runVetFiles(p, stringList(p.GoFiles, p.CgoFiles, p.TestGoFiles, p.SFiles)) + } + if len(p.XTestGoFiles) > 0 { + runVetFiles(p, stringList(p.XTestGoFiles)) + } + } +} + +func runVetFiles(p *Package, files []string) { + for i := range files { + files[i] = filepath.Join(p.Dir, files[i]) + } + run(buildToolExec, tool("vet"), relPaths(files)) +} diff --git a/src/cmd/gofmt/doc.go b/src/cmd/gofmt/doc.go new file mode 100644 index 0000000000000000000000000000000000000000..9d0cd328623cb406c470f10fdea230d5a6fa08f2 --- /dev/null +++ b/src/cmd/gofmt/doc.go @@ -0,0 +1,100 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +/* +Gofmt formats Go programs. +It uses tabs (width = 8) for indentation and blanks for alignment. + +Without an explicit path, it processes the standard input. Given a file, +it operates on that file; given a directory, it operates on all .go files in +that directory, recursively. (Files starting with a period are ignored.) +By default, gofmt prints the reformatted sources to standard output. + +Usage: + gofmt [flags] [path ...] + +The flags are: + -d + Do not print reformatted sources to standard output. + If a file's formatting is different than gofmt's, print diffs + to standard output. + -e + Print all (including spurious) errors. + -l + Do not print reformatted sources to standard output. + If a file's formatting is different from gofmt's, print its name + to standard output. + -r rule + Apply the rewrite rule to the source before reformatting. + -s + Try to simplify code (after applying the rewrite rule, if any). + -w + Do not print reformatted sources to standard output. + If a file's formatting is different from gofmt's, overwrite it + with gofmt's version. + +Debugging support: + -cpuprofile filename + Write cpu profile to the specified file. + + +The rewrite rule specified with the -r flag must be a string of the form: + + pattern -> replacement + +Both pattern and replacement must be valid Go expressions. +In the pattern, single-character lowercase identifiers serve as +wildcards matching arbitrary sub-expressions; those expressions +will be substituted for the same identifiers in the replacement. + +When gofmt reads from standard input, it accepts either a full Go program +or a program fragment. A program fragment must be a syntactically +valid declaration list, statement list, or expression. When formatting +such a fragment, gofmt preserves leading indentation as well as leading +and trailing spaces, so that individual sections of a Go program can be +formatted by piping them through gofmt. + +Examples + +To check files for unnecessary parentheses: + + gofmt -r '(a) -> a' -l *.go + +To remove the parentheses: + + gofmt -r '(a) -> a' -w *.go + +To convert the package tree from explicit slice upper bounds to implicit ones: + + gofmt -r 'α[β:len(α)] -> α[β:]' -w $GOROOT/src + +The simplify command + +When invoked with -s gofmt will make the following source transformations where possible. + + An array, slice, or map composite literal of the form: + []T{T{}, T{}} + will be simplified to: + []T{{}, {}} + + A slice expression of the form: + s[a:len(s)] + will be simplified to: + s[a:] + + A range of the form: + for x, _ = range v {...} + will be simplified to: + for x = range v {...} + + A range of the form: + for _ = range v {...} + will be simplified to: + for range v {...} + +This may result in changes that are incompatible with earlier versions of Go. +*/ +package main + +// BUG(rsc): The implementation of -r is a bit slow. diff --git a/src/cmd/gofmt/gofmt.go b/src/cmd/gofmt/gofmt.go new file mode 100644 index 0000000000000000000000000000000000000000..b2805ac05fbcc936c92ccd74d4c79781090bb2b5 --- /dev/null +++ b/src/cmd/gofmt/gofmt.go @@ -0,0 +1,237 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +import ( + "bytes" + "flag" + "fmt" + "go/ast" + "go/parser" + "go/printer" + "go/scanner" + "go/token" + "internal/format" + "io" + "io/ioutil" + "os" + "os/exec" + "path/filepath" + "runtime/pprof" + "strings" +) + +var ( + // main operation modes + list = flag.Bool("l", false, "list files whose formatting differs from gofmt's") + write = flag.Bool("w", false, "write result to (source) file instead of stdout") + rewriteRule = flag.String("r", "", "rewrite rule (e.g., 'a[b:len(a)] -> a[b:]')") + simplifyAST = flag.Bool("s", false, "simplify code") + doDiff = flag.Bool("d", false, "display diffs instead of rewriting files") + allErrors = flag.Bool("e", false, "report all errors (not just the first 10 on different lines)") + + // debugging + cpuprofile = flag.String("cpuprofile", "", "write cpu profile to this file") +) + +const ( + tabWidth = 8 + printerMode = printer.UseSpaces | printer.TabIndent +) + +var ( + fileSet = token.NewFileSet() // per process FileSet + exitCode = 0 + rewrite func(*ast.File) *ast.File + parserMode parser.Mode +) + +func report(err error) { + scanner.PrintError(os.Stderr, err) + exitCode = 2 +} + +func usage() { + fmt.Fprintf(os.Stderr, "usage: gofmt [flags] [path ...]\n") + flag.PrintDefaults() + os.Exit(2) +} + +func initParserMode() { + parserMode = parser.ParseComments + if *allErrors { + parserMode |= parser.AllErrors + } +} + +func isGoFile(f os.FileInfo) bool { + // ignore non-Go files + name := f.Name() + return !f.IsDir() && !strings.HasPrefix(name, ".") && strings.HasSuffix(name, ".go") +} + +// If in == nil, the source is the contents of the file with the given filename. +func processFile(filename string, in io.Reader, out io.Writer, stdin bool) error { + if in == nil { + f, err := os.Open(filename) + if err != nil { + return err + } + defer f.Close() + in = f + } + + src, err := ioutil.ReadAll(in) + if err != nil { + return err + } + + file, sourceAdj, indentAdj, err := format.Parse(fileSet, filename, src, stdin) + if err != nil { + return err + } + + if rewrite != nil { + if sourceAdj == nil { + file = rewrite(file) + } else { + fmt.Fprintf(os.Stderr, "warning: rewrite ignored for incomplete programs\n") + } + } + + ast.SortImports(fileSet, file) + + if *simplifyAST { + simplify(file) + } + + res, err := format.Format(fileSet, file, sourceAdj, indentAdj, src, printer.Config{Mode: printerMode, Tabwidth: tabWidth}) + if err != nil { + return err + } + + if !bytes.Equal(src, res) { + // formatting has changed + if *list { + fmt.Fprintln(out, filename) + } + if *write { + err = ioutil.WriteFile(filename, res, 0644) + if err != nil { + return err + } + } + if *doDiff { + data, err := diff(src, res) + if err != nil { + return fmt.Errorf("computing diff: %s", err) + } + fmt.Printf("diff %s gofmt/%s\n", filename, filename) + out.Write(data) + } + } + + if !*list && !*write && !*doDiff { + _, err = out.Write(res) + } + + return err +} + +func visitFile(path string, f os.FileInfo, err error) error { + if err == nil && isGoFile(f) { + err = processFile(path, nil, os.Stdout, false) + } + if err != nil { + report(err) + } + return nil +} + +func walkDir(path string) { + filepath.Walk(path, visitFile) +} + +func main() { + // call gofmtMain in a separate function + // so that it can use defer and have them + // run before the exit. + gofmtMain() + os.Exit(exitCode) +} + +func gofmtMain() { + flag.Usage = usage + flag.Parse() + + if *cpuprofile != "" { + f, err := os.Create(*cpuprofile) + if err != nil { + fmt.Fprintf(os.Stderr, "creating cpu profile: %s\n", err) + exitCode = 2 + return + } + defer f.Close() + pprof.StartCPUProfile(f) + defer pprof.StopCPUProfile() + } + + initParserMode() + initRewrite() + + if flag.NArg() == 0 { + if *write { + fmt.Fprintln(os.Stderr, "error: cannot use -w with standard input") + exitCode = 2 + return + } + if err := processFile("", os.Stdin, os.Stdout, true); err != nil { + report(err) + } + return + } + + for i := 0; i < flag.NArg(); i++ { + path := flag.Arg(i) + switch dir, err := os.Stat(path); { + case err != nil: + report(err) + case dir.IsDir(): + walkDir(path) + default: + if err := processFile(path, nil, os.Stdout, false); err != nil { + report(err) + } + } + } +} + +func diff(b1, b2 []byte) (data []byte, err error) { + f1, err := ioutil.TempFile("", "gofmt") + if err != nil { + return + } + defer os.Remove(f1.Name()) + defer f1.Close() + + f2, err := ioutil.TempFile("", "gofmt") + if err != nil { + return + } + defer os.Remove(f2.Name()) + defer f2.Close() + + f1.Write(b1) + f2.Write(b2) + + data, err = exec.Command("diff", "-u", f1.Name(), f2.Name()).CombinedOutput() + if len(data) > 0 { + // diff exits with a non-zero status when the files don't match. + // Ignore that failure as long as we get output. + err = nil + } + return + +} diff --git a/src/cmd/gofmt/gofmt_test.go b/src/cmd/gofmt/gofmt_test.go new file mode 100644 index 0000000000000000000000000000000000000000..d1edb7bcc16c25fba5cdaa68b287838bd451cfac --- /dev/null +++ b/src/cmd/gofmt/gofmt_test.go @@ -0,0 +1,173 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +import ( + "bytes" + "flag" + "io/ioutil" + "os" + "path/filepath" + "strings" + "testing" + "text/scanner" +) + +var update = flag.Bool("update", false, "update .golden files") + +// gofmtFlags looks for a comment of the form +// +// //gofmt flags +// +// within the first maxLines lines of the given file, +// and returns the flags string, if any. Otherwise it +// returns the empty string. +func gofmtFlags(filename string, maxLines int) string { + f, err := os.Open(filename) + if err != nil { + return "" // ignore errors - they will be found later + } + defer f.Close() + + // initialize scanner + var s scanner.Scanner + s.Init(f) + s.Error = func(*scanner.Scanner, string) {} // ignore errors + s.Mode = scanner.GoTokens &^ scanner.SkipComments // want comments + + // look for //gofmt comment + for s.Line <= maxLines { + switch s.Scan() { + case scanner.Comment: + const prefix = "//gofmt " + if t := s.TokenText(); strings.HasPrefix(t, prefix) { + return strings.TrimSpace(t[len(prefix):]) + } + case scanner.EOF: + return "" + } + + } + + return "" +} + +func runTest(t *testing.T, in, out string) { + // process flags + *simplifyAST = false + *rewriteRule = "" + stdin := false + for _, flag := range strings.Split(gofmtFlags(in, 20), " ") { + elts := strings.SplitN(flag, "=", 2) + name := elts[0] + value := "" + if len(elts) == 2 { + value = elts[1] + } + switch name { + case "": + // no flags + case "-r": + *rewriteRule = value + case "-s": + *simplifyAST = true + case "-stdin": + // fake flag - pretend input is from stdin + stdin = true + default: + t.Errorf("unrecognized flag name: %s", name) + } + } + + initParserMode() + initRewrite() + + var buf bytes.Buffer + err := processFile(in, nil, &buf, stdin) + if err != nil { + t.Error(err) + return + } + + expected, err := ioutil.ReadFile(out) + if err != nil { + t.Error(err) + return + } + + if got := buf.Bytes(); !bytes.Equal(got, expected) { + if *update { + if in != out { + if err := ioutil.WriteFile(out, got, 0666); err != nil { + t.Error(err) + } + return + } + // in == out: don't accidentally destroy input + t.Errorf("WARNING: -update did not rewrite input file %s", in) + } + + t.Errorf("(gofmt %s) != %s (see %s.gofmt)", in, out, in) + d, err := diff(expected, got) + if err == nil { + t.Errorf("%s", d) + } + if err := ioutil.WriteFile(in+".gofmt", got, 0666); err != nil { + t.Error(err) + } + } +} + +// TestRewrite processes testdata/*.input files and compares them to the +// corresponding testdata/*.golden files. The gofmt flags used to process +// a file must be provided via a comment of the form +// +// //gofmt flags +// +// in the processed file within the first 20 lines, if any. +func TestRewrite(t *testing.T) { + // determine input files + match, err := filepath.Glob("testdata/*.input") + if err != nil { + t.Fatal(err) + } + + // add larger examples + match = append(match, "gofmt.go", "gofmt_test.go") + + for _, in := range match { + out := in // for files where input and output are identical + if strings.HasSuffix(in, ".input") { + out = in[:len(in)-len(".input")] + ".golden" + } + runTest(t, in, out) + if in != out { + // Check idempotence. + runTest(t, out, out) + } + } +} + +// Test case for issue 3961. +func TestCRLF(t *testing.T) { + const input = "testdata/crlf.input" // must contain CR/LF's + const golden = "testdata/crlf.golden" // must not contain any CR's + + data, err := ioutil.ReadFile(input) + if err != nil { + t.Error(err) + } + if bytes.Index(data, []byte("\r\n")) < 0 { + t.Errorf("%s contains no CR/LF's", input) + } + + data, err = ioutil.ReadFile(golden) + if err != nil { + t.Error(err) + } + if bytes.Index(data, []byte("\r")) >= 0 { + t.Errorf("%s contains CR's", golden) + } +} diff --git a/src/cmd/gofmt/long_test.go b/src/cmd/gofmt/long_test.go new file mode 100644 index 0000000000000000000000000000000000000000..df9a878df44db12eb844b82451f3afc5dbcd9174 --- /dev/null +++ b/src/cmd/gofmt/long_test.go @@ -0,0 +1,160 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// This test applies gofmt to all Go files under -root. +// To test specific files provide a list of comma-separated +// filenames via the -files flag: go test -files=gofmt.go . + +package main + +import ( + "bytes" + "flag" + "fmt" + "go/ast" + "go/printer" + "go/token" + "internal/format" + "io" + "os" + "path/filepath" + "runtime" + "strings" + "testing" +) + +var ( + root = flag.String("root", runtime.GOROOT(), "test root directory") + files = flag.String("files", "", "comma-separated list of files to test") + ngo = flag.Int("n", runtime.NumCPU(), "number of goroutines used") + verbose = flag.Bool("verbose", false, "verbose mode") + nfiles int // number of files processed +) + +func gofmt(fset *token.FileSet, filename string, src *bytes.Buffer) error { + f, _, _, err := format.Parse(fset, filename, src.Bytes(), false) + if err != nil { + return err + } + ast.SortImports(fset, f) + src.Reset() + return (&printer.Config{Mode: printerMode, Tabwidth: tabWidth}).Fprint(src, fset, f) +} + +func testFile(t *testing.T, b1, b2 *bytes.Buffer, filename string) { + // open file + f, err := os.Open(filename) + if err != nil { + t.Error(err) + return + } + + // read file + b1.Reset() + _, err = io.Copy(b1, f) + f.Close() + if err != nil { + t.Error(err) + return + } + + // exclude files w/ syntax errors (typically test cases) + fset := token.NewFileSet() + if _, _, _, err = format.Parse(fset, filename, b1.Bytes(), false); err != nil { + if *verbose { + fmt.Fprintf(os.Stderr, "ignoring %s\n", err) + } + return + } + + // gofmt file + if err = gofmt(fset, filename, b1); err != nil { + t.Errorf("1st gofmt failed: %v", err) + return + } + + // make a copy of the result + b2.Reset() + b2.Write(b1.Bytes()) + + // gofmt result again + if err = gofmt(fset, filename, b2); err != nil { + t.Errorf("2nd gofmt failed: %v", err) + return + } + + // the first and 2nd result should be identical + if !bytes.Equal(b1.Bytes(), b2.Bytes()) { + t.Errorf("gofmt %s not idempotent", filename) + } +} + +func testFiles(t *testing.T, filenames <-chan string, done chan<- int) { + b1 := new(bytes.Buffer) + b2 := new(bytes.Buffer) + for filename := range filenames { + testFile(t, b1, b2, filename) + } + done <- 0 +} + +func genFilenames(t *testing.T, filenames chan<- string) { + defer close(filenames) + + handleFile := func(filename string, fi os.FileInfo, err error) error { + if err != nil { + t.Error(err) + return nil + } + if isGoFile(fi) { + filenames <- filename + nfiles++ + } + return nil + } + + // test Go files provided via -files, if any + if *files != "" { + for _, filename := range strings.Split(*files, ",") { + fi, err := os.Stat(filename) + handleFile(filename, fi, err) + } + return // ignore files under -root + } + + // otherwise, test all Go files under *root + filepath.Walk(*root, handleFile) +} + +func TestAll(t *testing.T) { + if testing.Short() { + return + } + + if *ngo < 1 { + *ngo = 1 // make sure test is run + } + if *verbose { + fmt.Printf("running test using %d goroutines\n", *ngo) + } + + // generate filenames + filenames := make(chan string, 32) + go genFilenames(t, filenames) + + // launch test goroutines + done := make(chan int) + for i := 0; i < *ngo; i++ { + go testFiles(t, filenames, done) + } + + // wait for all test goroutines to complete + for i := 0; i < *ngo; i++ { + <-done + } + + if *verbose { + fmt.Printf("processed %d files\n", nfiles) + } +} diff --git a/src/cmd/gofmt/rewrite.go b/src/cmd/gofmt/rewrite.go new file mode 100644 index 0000000000000000000000000000000000000000..069f96622caf712a58f9dd7f08d1b3c6e4c0e281 --- /dev/null +++ b/src/cmd/gofmt/rewrite.go @@ -0,0 +1,303 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +import ( + "fmt" + "go/ast" + "go/parser" + "go/token" + "os" + "reflect" + "strings" + "unicode" + "unicode/utf8" +) + +func initRewrite() { + if *rewriteRule == "" { + rewrite = nil // disable any previous rewrite + return + } + f := strings.Split(*rewriteRule, "->") + if len(f) != 2 { + fmt.Fprintf(os.Stderr, "rewrite rule must be of the form 'pattern -> replacement'\n") + os.Exit(2) + } + pattern := parseExpr(f[0], "pattern") + replace := parseExpr(f[1], "replacement") + rewrite = func(p *ast.File) *ast.File { return rewriteFile(pattern, replace, p) } +} + +// parseExpr parses s as an expression. +// It might make sense to expand this to allow statement patterns, +// but there are problems with preserving formatting and also +// with what a wildcard for a statement looks like. +func parseExpr(s, what string) ast.Expr { + x, err := parser.ParseExpr(s) + if err != nil { + fmt.Fprintf(os.Stderr, "parsing %s %s at %s\n", what, s, err) + os.Exit(2) + } + return x +} + +// Keep this function for debugging. +/* +func dump(msg string, val reflect.Value) { + fmt.Printf("%s:\n", msg) + ast.Print(fileSet, val.Interface()) + fmt.Println() +} +*/ + +// rewriteFile applies the rewrite rule 'pattern -> replace' to an entire file. +func rewriteFile(pattern, replace ast.Expr, p *ast.File) *ast.File { + cmap := ast.NewCommentMap(fileSet, p, p.Comments) + m := make(map[string]reflect.Value) + pat := reflect.ValueOf(pattern) + repl := reflect.ValueOf(replace) + + var rewriteVal func(val reflect.Value) reflect.Value + rewriteVal = func(val reflect.Value) reflect.Value { + // don't bother if val is invalid to start with + if !val.IsValid() { + return reflect.Value{} + } + for k := range m { + delete(m, k) + } + val = apply(rewriteVal, val) + if match(m, pat, val) { + val = subst(m, repl, reflect.ValueOf(val.Interface().(ast.Node).Pos())) + } + return val + } + + r := apply(rewriteVal, reflect.ValueOf(p)).Interface().(*ast.File) + r.Comments = cmap.Filter(r).Comments() // recreate comments list + return r +} + +// set is a wrapper for x.Set(y); it protects the caller from panics if x cannot be changed to y. +func set(x, y reflect.Value) { + // don't bother if x cannot be set or y is invalid + if !x.CanSet() || !y.IsValid() { + return + } + defer func() { + if x := recover(); x != nil { + if s, ok := x.(string); ok && + (strings.Contains(s, "type mismatch") || strings.Contains(s, "not assignable")) { + // x cannot be set to y - ignore this rewrite + return + } + panic(x) + } + }() + x.Set(y) +} + +// Values/types for special cases. +var ( + objectPtrNil = reflect.ValueOf((*ast.Object)(nil)) + scopePtrNil = reflect.ValueOf((*ast.Scope)(nil)) + + identType = reflect.TypeOf((*ast.Ident)(nil)) + objectPtrType = reflect.TypeOf((*ast.Object)(nil)) + positionType = reflect.TypeOf(token.NoPos) + callExprType = reflect.TypeOf((*ast.CallExpr)(nil)) + scopePtrType = reflect.TypeOf((*ast.Scope)(nil)) +) + +// apply replaces each AST field x in val with f(x), returning val. +// To avoid extra conversions, f operates on the reflect.Value form. +func apply(f func(reflect.Value) reflect.Value, val reflect.Value) reflect.Value { + if !val.IsValid() { + return reflect.Value{} + } + + // *ast.Objects introduce cycles and are likely incorrect after + // rewrite; don't follow them but replace with nil instead + if val.Type() == objectPtrType { + return objectPtrNil + } + + // similarly for scopes: they are likely incorrect after a rewrite; + // replace them with nil + if val.Type() == scopePtrType { + return scopePtrNil + } + + switch v := reflect.Indirect(val); v.Kind() { + case reflect.Slice: + for i := 0; i < v.Len(); i++ { + e := v.Index(i) + set(e, f(e)) + } + case reflect.Struct: + for i := 0; i < v.NumField(); i++ { + e := v.Field(i) + set(e, f(e)) + } + case reflect.Interface: + e := v.Elem() + set(v, f(e)) + } + return val +} + +func isWildcard(s string) bool { + rune, size := utf8.DecodeRuneInString(s) + return size == len(s) && unicode.IsLower(rune) +} + +// match reports whether pattern matches val, +// recording wildcard submatches in m. +// If m == nil, match checks whether pattern == val. +func match(m map[string]reflect.Value, pattern, val reflect.Value) bool { + // Wildcard matches any expression. If it appears multiple + // times in the pattern, it must match the same expression + // each time. + if m != nil && pattern.IsValid() && pattern.Type() == identType { + name := pattern.Interface().(*ast.Ident).Name + if isWildcard(name) && val.IsValid() { + // wildcards only match valid (non-nil) expressions. + if _, ok := val.Interface().(ast.Expr); ok && !val.IsNil() { + if old, ok := m[name]; ok { + return match(nil, old, val) + } + m[name] = val + return true + } + } + } + + // Otherwise, pattern and val must match recursively. + if !pattern.IsValid() || !val.IsValid() { + return !pattern.IsValid() && !val.IsValid() + } + if pattern.Type() != val.Type() { + return false + } + + // Special cases. + switch pattern.Type() { + case identType: + // For identifiers, only the names need to match + // (and none of the other *ast.Object information). + // This is a common case, handle it all here instead + // of recursing down any further via reflection. + p := pattern.Interface().(*ast.Ident) + v := val.Interface().(*ast.Ident) + return p == nil && v == nil || p != nil && v != nil && p.Name == v.Name + case objectPtrType, positionType: + // object pointers and token positions always match + return true + case callExprType: + // For calls, the Ellipsis fields (token.Position) must + // match since that is how f(x) and f(x...) are different. + // Check them here but fall through for the remaining fields. + p := pattern.Interface().(*ast.CallExpr) + v := val.Interface().(*ast.CallExpr) + if p.Ellipsis.IsValid() != v.Ellipsis.IsValid() { + return false + } + } + + p := reflect.Indirect(pattern) + v := reflect.Indirect(val) + if !p.IsValid() || !v.IsValid() { + return !p.IsValid() && !v.IsValid() + } + + switch p.Kind() { + case reflect.Slice: + if p.Len() != v.Len() { + return false + } + for i := 0; i < p.Len(); i++ { + if !match(m, p.Index(i), v.Index(i)) { + return false + } + } + return true + + case reflect.Struct: + for i := 0; i < p.NumField(); i++ { + if !match(m, p.Field(i), v.Field(i)) { + return false + } + } + return true + + case reflect.Interface: + return match(m, p.Elem(), v.Elem()) + } + + // Handle token integers, etc. + return p.Interface() == v.Interface() +} + +// subst returns a copy of pattern with values from m substituted in place +// of wildcards and pos used as the position of tokens from the pattern. +// if m == nil, subst returns a copy of pattern and doesn't change the line +// number information. +func subst(m map[string]reflect.Value, pattern reflect.Value, pos reflect.Value) reflect.Value { + if !pattern.IsValid() { + return reflect.Value{} + } + + // Wildcard gets replaced with map value. + if m != nil && pattern.Type() == identType { + name := pattern.Interface().(*ast.Ident).Name + if isWildcard(name) { + if old, ok := m[name]; ok { + return subst(nil, old, reflect.Value{}) + } + } + } + + if pos.IsValid() && pattern.Type() == positionType { + // use new position only if old position was valid in the first place + if old := pattern.Interface().(token.Pos); !old.IsValid() { + return pattern + } + return pos + } + + // Otherwise copy. + switch p := pattern; p.Kind() { + case reflect.Slice: + v := reflect.MakeSlice(p.Type(), p.Len(), p.Len()) + for i := 0; i < p.Len(); i++ { + v.Index(i).Set(subst(m, p.Index(i), pos)) + } + return v + + case reflect.Struct: + v := reflect.New(p.Type()).Elem() + for i := 0; i < p.NumField(); i++ { + v.Field(i).Set(subst(m, p.Field(i), pos)) + } + return v + + case reflect.Ptr: + v := reflect.New(p.Type()).Elem() + if elem := p.Elem(); elem.IsValid() { + v.Set(subst(m, elem, pos).Addr()) + } + return v + + case reflect.Interface: + v := reflect.New(p.Type()).Elem() + if elem := p.Elem(); elem.IsValid() { + v.Set(subst(m, elem, pos)) + } + return v + } + + return pattern +} diff --git a/src/cmd/gofmt/simplify.go b/src/cmd/gofmt/simplify.go new file mode 100644 index 0000000000000000000000000000000000000000..69f7bf23c0b2de7b3e7f909ea65fd0fc9bd39b36 --- /dev/null +++ b/src/cmd/gofmt/simplify.go @@ -0,0 +1,161 @@ +// Copyright 2010 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +import ( + "go/ast" + "go/token" + "reflect" +) + +type simplifier struct { + hasDotImport bool // package file contains: import . "some/import/path" +} + +func (s *simplifier) Visit(node ast.Node) ast.Visitor { + switch n := node.(type) { + case *ast.CompositeLit: + // array, slice, and map composite literals may be simplified + outer := n + var eltType ast.Expr + switch typ := outer.Type.(type) { + case *ast.ArrayType: + eltType = typ.Elt + case *ast.MapType: + eltType = typ.Value + } + + if eltType != nil { + typ := reflect.ValueOf(eltType) + for i, x := range outer.Elts { + px := &outer.Elts[i] + // look at value of indexed/named elements + if t, ok := x.(*ast.KeyValueExpr); ok { + x = t.Value + px = &t.Value + } + ast.Walk(s, x) // simplify x + // if the element is a composite literal and its literal type + // matches the outer literal's element type exactly, the inner + // literal type may be omitted + if inner, ok := x.(*ast.CompositeLit); ok { + if match(nil, typ, reflect.ValueOf(inner.Type)) { + inner.Type = nil + } + } + // if the outer literal's element type is a pointer type *T + // and the element is & of a composite literal of type T, + // the inner &T may be omitted. + if ptr, ok := eltType.(*ast.StarExpr); ok { + if addr, ok := x.(*ast.UnaryExpr); ok && addr.Op == token.AND { + if inner, ok := addr.X.(*ast.CompositeLit); ok { + if match(nil, reflect.ValueOf(ptr.X), reflect.ValueOf(inner.Type)) { + inner.Type = nil // drop T + *px = inner // drop & + } + } + } + } + } + + // node was simplified - stop walk (there are no subnodes to simplify) + return nil + } + + case *ast.SliceExpr: + // a slice expression of the form: s[a:len(s)] + // can be simplified to: s[a:] + // if s is "simple enough" (for now we only accept identifiers) + if n.Max != nil || s.hasDotImport { + // - 3-index slices always require the 2nd and 3rd index + // - if dot imports are present, we cannot be certain that an + // unresolved "len" identifier refers to the predefined len() + break + } + if s, _ := n.X.(*ast.Ident); s != nil && s.Obj != nil { + // the array/slice object is a single, resolved identifier + if call, _ := n.High.(*ast.CallExpr); call != nil && len(call.Args) == 1 && !call.Ellipsis.IsValid() { + // the high expression is a function call with a single argument + if fun, _ := call.Fun.(*ast.Ident); fun != nil && fun.Name == "len" && fun.Obj == nil { + // the function called is "len" and it is not locally defined; and + // because we don't have dot imports, it must be the predefined len() + if arg, _ := call.Args[0].(*ast.Ident); arg != nil && arg.Obj == s.Obj { + // the len argument is the array/slice object + n.High = nil + } + } + } + } + // Note: We could also simplify slice expressions of the form s[0:b] to s[:b] + // but we leave them as is since sometimes we want to be very explicit + // about the lower bound. + // An example where the 0 helps: + // x, y, z := b[0:2], b[2:4], b[4:6] + // An example where it does not: + // x, y := b[:n], b[n:] + + case *ast.RangeStmt: + // - a range of the form: for x, _ = range v {...} + // can be simplified to: for x = range v {...} + // - a range of the form: for _ = range v {...} + // can be simplified to: for range v {...} + if isBlank(n.Value) { + n.Value = nil + } + if isBlank(n.Key) && n.Value == nil { + n.Key = nil + } + } + + return s +} + +func isBlank(x ast.Expr) bool { + ident, ok := x.(*ast.Ident) + return ok && ident.Name == "_" +} + +func simplify(f *ast.File) { + var s simplifier + + // determine if f contains dot imports + for _, imp := range f.Imports { + if imp.Name != nil && imp.Name.Name == "." { + s.hasDotImport = true + break + } + } + + // remove empty declarations such as "const ()", etc + removeEmptyDeclGroups(f) + + ast.Walk(&s, f) +} + +func removeEmptyDeclGroups(f *ast.File) { + i := 0 + for _, d := range f.Decls { + if g, ok := d.(*ast.GenDecl); !ok || !isEmpty(f, g) { + f.Decls[i] = d + i++ + } + } + f.Decls = f.Decls[:i] +} + +func isEmpty(f *ast.File, g *ast.GenDecl) bool { + if g.Doc != nil || g.Specs != nil { + return false + } + + for _, c := range f.Comments { + // if there is a comment in the declaration, it is not considered empty + if g.Pos() <= c.Pos() && c.End() <= g.End() { + return false + } + } + + return true +} diff --git a/src/cmd/gofmt/testdata/comments.golden b/src/cmd/gofmt/testdata/comments.golden new file mode 100644 index 0000000000000000000000000000000000000000..ad6bcafafa2382a02bd9c83fbc8c7ed61773f318 --- /dev/null +++ b/src/cmd/gofmt/testdata/comments.golden @@ -0,0 +1,9 @@ +package main + +func main() {} + +// comment here + +func f() {} + +//line foo.go:1 diff --git a/src/cmd/gofmt/testdata/comments.input b/src/cmd/gofmt/testdata/comments.input new file mode 100644 index 0000000000000000000000000000000000000000..ad6bcafafa2382a02bd9c83fbc8c7ed61773f318 --- /dev/null +++ b/src/cmd/gofmt/testdata/comments.input @@ -0,0 +1,9 @@ +package main + +func main() {} + +// comment here + +func f() {} + +//line foo.go:1 diff --git a/src/cmd/gofmt/testdata/composites.golden b/src/cmd/gofmt/testdata/composites.golden new file mode 100644 index 0000000000000000000000000000000000000000..fc9c98e625b4b869250a464fc5fd6b08fc42b613 --- /dev/null +++ b/src/cmd/gofmt/testdata/composites.golden @@ -0,0 +1,204 @@ +//gofmt -s + +package P + +type T struct { + x, y int +} + +var _ = [42]T{ + {}, + {1, 2}, + {3, 4}, +} + +var _ = [...]T{ + {}, + {1, 2}, + {3, 4}, +} + +var _ = []T{ + {}, + {1, 2}, + {3, 4}, +} + +var _ = []T{ + {}, + 10: {1, 2}, + 20: {3, 4}, +} + +var _ = []struct { + x, y int +}{ + {}, + 10: {1, 2}, + 20: {3, 4}, +} + +var _ = []interface{}{ + T{}, + 10: T{1, 2}, + 20: T{3, 4}, +} + +var _ = [][]int{ + {}, + {1, 2}, + {3, 4}, +} + +var _ = [][]int{ + ([]int{}), + ([]int{1, 2}), + {3, 4}, +} + +var _ = [][][]int{ + {}, + { + {}, + {0, 1, 2, 3}, + {4, 5}, + }, +} + +var _ = map[string]T{ + "foo": {}, + "bar": {1, 2}, + "bal": {3, 4}, +} + +var _ = map[string]struct { + x, y int +}{ + "foo": {}, + "bar": {1, 2}, + "bal": {3, 4}, +} + +var _ = map[string]interface{}{ + "foo": T{}, + "bar": T{1, 2}, + "bal": T{3, 4}, +} + +var _ = map[string][]int{ + "foo": {}, + "bar": {1, 2}, + "bal": {3, 4}, +} + +var _ = map[string][]int{ + "foo": ([]int{}), + "bar": ([]int{1, 2}), + "bal": {3, 4}, +} + +// from exp/4s/data.go +var pieces4 = []Piece{ + {0, 0, Point{4, 1}, []Point{{0, 0}, {1, 0}, {1, 0}, {1, 0}}, nil, nil}, + {1, 0, Point{1, 4}, []Point{{0, 0}, {0, 1}, {0, 1}, {0, 1}}, nil, nil}, + {2, 0, Point{4, 1}, []Point{{0, 0}, {1, 0}, {1, 0}, {1, 0}}, nil, nil}, + {3, 0, Point{1, 4}, []Point{{0, 0}, {0, 1}, {0, 1}, {0, 1}}, nil, nil}, +} + +var _ = [42]*T{ + {}, + {1, 2}, + {3, 4}, +} + +var _ = [...]*T{ + {}, + {1, 2}, + {3, 4}, +} + +var _ = []*T{ + {}, + {1, 2}, + {3, 4}, +} + +var _ = []*T{ + {}, + 10: {1, 2}, + 20: {3, 4}, +} + +var _ = []*struct { + x, y int +}{ + {}, + 10: {1, 2}, + 20: {3, 4}, +} + +var _ = []interface{}{ + &T{}, + 10: &T{1, 2}, + 20: &T{3, 4}, +} + +var _ = []*[]int{ + {}, + {1, 2}, + {3, 4}, +} + +var _ = []*[]int{ + (&[]int{}), + (&[]int{1, 2}), + {3, 4}, +} + +var _ = []*[]*[]int{ + {}, + { + {}, + {0, 1, 2, 3}, + {4, 5}, + }, +} + +var _ = map[string]*T{ + "foo": {}, + "bar": {1, 2}, + "bal": {3, 4}, +} + +var _ = map[string]*struct { + x, y int +}{ + "foo": {}, + "bar": {1, 2}, + "bal": {3, 4}, +} + +var _ = map[string]interface{}{ + "foo": &T{}, + "bar": &T{1, 2}, + "bal": &T{3, 4}, +} + +var _ = map[string]*[]int{ + "foo": {}, + "bar": {1, 2}, + "bal": {3, 4}, +} + +var _ = map[string]*[]int{ + "foo": (&[]int{}), + "bar": (&[]int{1, 2}), + "bal": {3, 4}, +} + +var pieces4 = []*Piece{ + {0, 0, Point{4, 1}, []Point{{0, 0}, {1, 0}, {1, 0}, {1, 0}}, nil, nil}, + {1, 0, Point{1, 4}, []Point{{0, 0}, {0, 1}, {0, 1}, {0, 1}}, nil, nil}, + {2, 0, Point{4, 1}, []Point{{0, 0}, {1, 0}, {1, 0}, {1, 0}}, nil, nil}, + {3, 0, Point{1, 4}, []Point{{0, 0}, {0, 1}, {0, 1}, {0, 1}}, nil, nil}, +} diff --git a/src/cmd/gofmt/testdata/composites.input b/src/cmd/gofmt/testdata/composites.input new file mode 100644 index 0000000000000000000000000000000000000000..fc7598af99edf1fc729f0e51f459ceda11ca73c0 --- /dev/null +++ b/src/cmd/gofmt/testdata/composites.input @@ -0,0 +1,204 @@ +//gofmt -s + +package P + +type T struct { + x, y int +} + +var _ = [42]T{ + T{}, + T{1, 2}, + T{3, 4}, +} + +var _ = [...]T{ + T{}, + T{1, 2}, + T{3, 4}, +} + +var _ = []T{ + T{}, + T{1, 2}, + T{3, 4}, +} + +var _ = []T{ + T{}, + 10: T{1, 2}, + 20: T{3, 4}, +} + +var _ = []struct { + x, y int +}{ + struct{ x, y int }{}, + 10: struct{ x, y int }{1, 2}, + 20: struct{ x, y int }{3, 4}, +} + +var _ = []interface{}{ + T{}, + 10: T{1, 2}, + 20: T{3, 4}, +} + +var _ = [][]int{ + []int{}, + []int{1, 2}, + []int{3, 4}, +} + +var _ = [][]int{ + ([]int{}), + ([]int{1, 2}), + []int{3, 4}, +} + +var _ = [][][]int{ + [][]int{}, + [][]int{ + []int{}, + []int{0, 1, 2, 3}, + []int{4, 5}, + }, +} + +var _ = map[string]T{ + "foo": T{}, + "bar": T{1, 2}, + "bal": T{3, 4}, +} + +var _ = map[string]struct { + x, y int +}{ + "foo": struct{ x, y int }{}, + "bar": struct{ x, y int }{1, 2}, + "bal": struct{ x, y int }{3, 4}, +} + +var _ = map[string]interface{}{ + "foo": T{}, + "bar": T{1, 2}, + "bal": T{3, 4}, +} + +var _ = map[string][]int{ + "foo": []int{}, + "bar": []int{1, 2}, + "bal": []int{3, 4}, +} + +var _ = map[string][]int{ + "foo": ([]int{}), + "bar": ([]int{1, 2}), + "bal": []int{3, 4}, +} + +// from exp/4s/data.go +var pieces4 = []Piece{ + Piece{0, 0, Point{4, 1}, []Point{Point{0, 0}, Point{1, 0}, Point{1, 0}, Point{1, 0}}, nil, nil}, + Piece{1, 0, Point{1, 4}, []Point{Point{0, 0}, Point{0, 1}, Point{0, 1}, Point{0, 1}}, nil, nil}, + Piece{2, 0, Point{4, 1}, []Point{Point{0, 0}, Point{1, 0}, Point{1, 0}, Point{1, 0}}, nil, nil}, + Piece{3, 0, Point{1, 4}, []Point{Point{0, 0}, Point{0, 1}, Point{0, 1}, Point{0, 1}}, nil, nil}, +} + +var _ = [42]*T{ + &T{}, + &T{1, 2}, + &T{3, 4}, +} + +var _ = [...]*T{ + &T{}, + &T{1, 2}, + &T{3, 4}, +} + +var _ = []*T{ + &T{}, + &T{1, 2}, + &T{3, 4}, +} + +var _ = []*T{ + &T{}, + 10: &T{1, 2}, + 20: &T{3, 4}, +} + +var _ = []*struct { + x, y int +}{ + &struct{ x, y int }{}, + 10: &struct{ x, y int }{1, 2}, + 20: &struct{ x, y int }{3, 4}, +} + +var _ = []interface{}{ + &T{}, + 10: &T{1, 2}, + 20: &T{3, 4}, +} + +var _ = []*[]int{ + &[]int{}, + &[]int{1, 2}, + &[]int{3, 4}, +} + +var _ = []*[]int{ + (&[]int{}), + (&[]int{1, 2}), + &[]int{3, 4}, +} + +var _ = []*[]*[]int{ + &[]*[]int{}, + &[]*[]int{ + &[]int{}, + &[]int{0, 1, 2, 3}, + &[]int{4, 5}, + }, +} + +var _ = map[string]*T{ + "foo": &T{}, + "bar": &T{1, 2}, + "bal": &T{3, 4}, +} + +var _ = map[string]*struct { + x, y int +}{ + "foo": &struct{ x, y int }{}, + "bar": &struct{ x, y int }{1, 2}, + "bal": &struct{ x, y int }{3, 4}, +} + +var _ = map[string]interface{}{ + "foo": &T{}, + "bar": &T{1, 2}, + "bal": &T{3, 4}, +} + +var _ = map[string]*[]int{ + "foo": &[]int{}, + "bar": &[]int{1, 2}, + "bal": &[]int{3, 4}, +} + +var _ = map[string]*[]int{ + "foo": (&[]int{}), + "bar": (&[]int{1, 2}), + "bal": &[]int{3, 4}, +} + +var pieces4 = []*Piece{ + &Piece{0, 0, Point{4, 1}, []Point{Point{0, 0}, Point{1, 0}, Point{1, 0}, Point{1, 0}}, nil, nil}, + &Piece{1, 0, Point{1, 4}, []Point{Point{0, 0}, Point{0, 1}, Point{0, 1}, Point{0, 1}}, nil, nil}, + &Piece{2, 0, Point{4, 1}, []Point{Point{0, 0}, Point{1, 0}, Point{1, 0}, Point{1, 0}}, nil, nil}, + &Piece{3, 0, Point{1, 4}, []Point{Point{0, 0}, Point{0, 1}, Point{0, 1}, Point{0, 1}}, nil, nil}, +} diff --git a/src/cmd/gofmt/testdata/crlf.golden b/src/cmd/gofmt/testdata/crlf.golden new file mode 100644 index 0000000000000000000000000000000000000000..193dbacc727dd786f3ac6604c8d1f0f55ab26376 --- /dev/null +++ b/src/cmd/gofmt/testdata/crlf.golden @@ -0,0 +1,13 @@ +/* + Source containing CR/LF line endings. + The gofmt'ed output must only have LF + line endings. + Test case for issue 3961. +*/ +package main + +func main() { + // line comment + println("hello, world!") // another line comment + println() +} diff --git a/src/cmd/gofmt/testdata/crlf.input b/src/cmd/gofmt/testdata/crlf.input new file mode 100644 index 0000000000000000000000000000000000000000..ae7e14dbf1386c7133cc0863acf425ad85f51f63 --- /dev/null +++ b/src/cmd/gofmt/testdata/crlf.input @@ -0,0 +1,13 @@ +/* + Source containing CR/LF line endings. + The gofmt'ed output must only have LF + line endings. + Test case for issue 3961. +*/ +package main + +func main() { + // line comment + println("hello, world!") // another line comment + println() +} diff --git a/src/cmd/gofmt/testdata/emptydecl.golden b/src/cmd/gofmt/testdata/emptydecl.golden new file mode 100644 index 0000000000000000000000000000000000000000..33d6435e0a99dc63d16abb9cf6edaf9799b2de23 --- /dev/null +++ b/src/cmd/gofmt/testdata/emptydecl.golden @@ -0,0 +1,14 @@ +//gofmt -s + +// Test case for issue 7631. + +package main + +// Keep this declaration +var () + +const ( +// Keep this declaration +) + +func main() {} diff --git a/src/cmd/gofmt/testdata/emptydecl.input b/src/cmd/gofmt/testdata/emptydecl.input new file mode 100644 index 0000000000000000000000000000000000000000..4948a61f0de2285960ebb54ed0392c474f69d503 --- /dev/null +++ b/src/cmd/gofmt/testdata/emptydecl.input @@ -0,0 +1,16 @@ +//gofmt -s + +// Test case for issue 7631. + +package main + +// Keep this declaration +var () + +const ( +// Keep this declaration +) + +type () + +func main() {} \ No newline at end of file diff --git a/src/cmd/gofmt/testdata/import.golden b/src/cmd/gofmt/testdata/import.golden new file mode 100644 index 0000000000000000000000000000000000000000..51d7be79dfab7aea7bec5c32fd02b6fdefebafec --- /dev/null +++ b/src/cmd/gofmt/testdata/import.golden @@ -0,0 +1,126 @@ +package main + +import ( + "errors" + "fmt" + "io" + "log" + "math" +) + +import ( + "fmt" + + "math" + + "log" + + "errors" + + "io" +) + +import ( + "errors" + "fmt" + "io" + "log" + "math" + + "fmt" + + "math" + + "log" + + "errors" + + "io" +) + +import ( + // a block with comments + "errors" + "fmt" // for Printf + "io" // for Reader + "log" // for Fatal + "math" +) + +import ( + "fmt" // for Printf + + "math" + + "log" // for Fatal + + "errors" + + "io" // for Reader +) + +import ( + // for Printf + "fmt" + + "math" + + // for Fatal + "log" + + "errors" + + // for Reader + "io" +) + +import ( + "errors" + "fmt" // for Printf + "io" // for Reader + "log" // for Fatal + "math" + + "fmt" // for Printf + + "math" + + "log" // for Fatal + + "errors" + + "io" // for Reader +) + +import ( + "fmt" // for Printf + + "errors" + "io" // for Reader + "log" // for Fatal + "math" + + "errors" + "fmt" // for Printf + "io" // for Reader + "log" // for Fatal + "math" +) + +// Test deduping and extended sorting +import ( + a "A" // aA + b "A" // bA1 + b "A" // bA2 + "B" // B + . "B" // .B + _ "B" // _b + "C" + a "D" // aD +) + +import ( + "dedup_by_group" + + "dedup_by_group" +) diff --git a/src/cmd/gofmt/testdata/import.input b/src/cmd/gofmt/testdata/import.input new file mode 100644 index 0000000000000000000000000000000000000000..9a4b09dbf9108ca8cd642e122a340887dee79b46 --- /dev/null +++ b/src/cmd/gofmt/testdata/import.input @@ -0,0 +1,131 @@ +package main + +import ( + "fmt" + "math" + "log" + "errors" + "io" +) + +import ( + "fmt" + + "math" + + "log" + + "errors" + + "io" +) + +import ( + "fmt" + "math" + "log" + "errors" + "io" + + "fmt" + + "math" + + "log" + + "errors" + + "io" +) + +import ( + // a block with comments + "fmt" // for Printf + "math" + "log" // for Fatal + "errors" + "io" // for Reader +) + +import ( + "fmt" // for Printf + + "math" + + "log" // for Fatal + + "errors" + + "io" // for Reader +) + +import ( + // for Printf + "fmt" + + "math" + + // for Fatal + "log" + + "errors" + + // for Reader + "io" +) + +import ( + "fmt" // for Printf + "math" + "log" // for Fatal + "errors" + "io" // for Reader + + "fmt" // for Printf + + "math" + + "log" // for Fatal + + "errors" + + "io" // for Reader +) + +import ( + "fmt" // for Printf + + "math" + "log" // for Fatal + "errors" + "io" // for Reader + + "fmt" // for Printf + "math" + "log" // for Fatal + "errors" + "io" // for Reader +) + +// Test deduping and extended sorting +import ( + "B" // B + a "A" // aA + b "A" // bA2 + b "A" // bA1 + . "B" // .B + . "B" + "C" + "C" + "C" + a "D" // aD + "B" + _ "B" // _b +) + +import ( + "dedup_by_group" + "dedup_by_group" + + "dedup_by_group" +) diff --git a/src/cmd/gofmt/testdata/old.golden b/src/cmd/gofmt/testdata/old.golden new file mode 100644 index 0000000000000000000000000000000000000000..95a0b72a0e09926bf1d29adef13eed603c3fca66 --- /dev/null +++ b/src/cmd/gofmt/testdata/old.golden @@ -0,0 +1,9 @@ +package P + +func f() { + if x { + y + } else { + z + } +} diff --git a/src/cmd/gofmt/testdata/old.input b/src/cmd/gofmt/testdata/old.input new file mode 100644 index 0000000000000000000000000000000000000000..e24eed215d3b868fc8b7bdbb71c543ad69589fed --- /dev/null +++ b/src/cmd/gofmt/testdata/old.input @@ -0,0 +1,8 @@ +package P + +func f() { + if x { + y + } else + z +} diff --git a/src/cmd/gofmt/testdata/ranges.golden b/src/cmd/gofmt/testdata/ranges.golden new file mode 100644 index 0000000000000000000000000000000000000000..506b3a035a3684b783b29d5113087f42fbfaf87e --- /dev/null +++ b/src/cmd/gofmt/testdata/ranges.golden @@ -0,0 +1,30 @@ +//gofmt -s + +// Test cases for range simplification. +package p + +func _() { + for a, b = range x { + } + for a = range x { + } + for _, b = range x { + } + for range x { + } + + for a = range x { + } + for range x { + } + + for a, b := range x { + } + for a := range x { + } + for _, b := range x { + } + + for a := range x { + } +} diff --git a/src/cmd/gofmt/testdata/ranges.input b/src/cmd/gofmt/testdata/ranges.input new file mode 100644 index 0000000000000000000000000000000000000000..df5f8333c21c91af3de98d58fe2aa52582491ce4 --- /dev/null +++ b/src/cmd/gofmt/testdata/ranges.input @@ -0,0 +1,20 @@ +//gofmt -s + +// Test cases for range simplification. +package p + +func _() { + for a, b = range x {} + for a, _ = range x {} + for _, b = range x {} + for _, _ = range x {} + + for a = range x {} + for _ = range x {} + + for a, b := range x {} + for a, _ := range x {} + for _, b := range x {} + + for a := range x {} +} diff --git a/src/cmd/gofmt/testdata/rewrite1.golden b/src/cmd/gofmt/testdata/rewrite1.golden new file mode 100644 index 0000000000000000000000000000000000000000..3ee5373a79094a6b05328b2114d75946cb4c4575 --- /dev/null +++ b/src/cmd/gofmt/testdata/rewrite1.golden @@ -0,0 +1,14 @@ +//gofmt -r=Foo->Bar + +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +type Bar int + +func main() { + var a Bar + println(a) +} diff --git a/src/cmd/gofmt/testdata/rewrite1.input b/src/cmd/gofmt/testdata/rewrite1.input new file mode 100644 index 0000000000000000000000000000000000000000..a84c8f781659ba5ebd9ae62ac351d680167551cd --- /dev/null +++ b/src/cmd/gofmt/testdata/rewrite1.input @@ -0,0 +1,14 @@ +//gofmt -r=Foo->Bar + +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +type Foo int + +func main() { + var a Foo + println(a) +} diff --git a/src/cmd/gofmt/testdata/rewrite2.golden b/src/cmd/gofmt/testdata/rewrite2.golden new file mode 100644 index 0000000000000000000000000000000000000000..f980e035309e1a6958b6bb02458ee055dac98431 --- /dev/null +++ b/src/cmd/gofmt/testdata/rewrite2.golden @@ -0,0 +1,12 @@ +//gofmt -r=int->bool + +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package p + +// Slices have nil Len values in the corresponding ast.ArrayType +// node and reflect.NewValue(slice.Len) is an invalid reflect.Value. +// The rewriter must not crash in that case. Was issue 1696. +func f() []bool {} diff --git a/src/cmd/gofmt/testdata/rewrite2.input b/src/cmd/gofmt/testdata/rewrite2.input new file mode 100644 index 0000000000000000000000000000000000000000..489be4e07dc80facb5a7ee72a6b8f5c7ba2cf18e --- /dev/null +++ b/src/cmd/gofmt/testdata/rewrite2.input @@ -0,0 +1,12 @@ +//gofmt -r=int->bool + +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package p + +// Slices have nil Len values in the corresponding ast.ArrayType +// node and reflect.NewValue(slice.Len) is an invalid reflect.Value. +// The rewriter must not crash in that case. Was issue 1696. +func f() []int {} diff --git a/src/cmd/gofmt/testdata/rewrite3.golden b/src/cmd/gofmt/testdata/rewrite3.golden new file mode 100644 index 0000000000000000000000000000000000000000..261a220c65d7f1988a2ae55fa31af59b32bb6dec --- /dev/null +++ b/src/cmd/gofmt/testdata/rewrite3.golden @@ -0,0 +1,14 @@ +//gofmt -r=x->x + +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +// Field tags are *ast.BasicLit nodes that are nil when the tag is +// absent. These nil nodes must not be mistaken for expressions, +// the rewriter should not try to dereference them. Was issue 2410. +type Foo struct { + Field int +} diff --git a/src/cmd/gofmt/testdata/rewrite3.input b/src/cmd/gofmt/testdata/rewrite3.input new file mode 100644 index 0000000000000000000000000000000000000000..261a220c65d7f1988a2ae55fa31af59b32bb6dec --- /dev/null +++ b/src/cmd/gofmt/testdata/rewrite3.input @@ -0,0 +1,14 @@ +//gofmt -r=x->x + +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +// Field tags are *ast.BasicLit nodes that are nil when the tag is +// absent. These nil nodes must not be mistaken for expressions, +// the rewriter should not try to dereference them. Was issue 2410. +type Foo struct { + Field int +} diff --git a/src/cmd/gofmt/testdata/rewrite4.golden b/src/cmd/gofmt/testdata/rewrite4.golden new file mode 100644 index 0000000000000000000000000000000000000000..b05547b4bf08216357c7f7bfc2622916aa976165 --- /dev/null +++ b/src/cmd/gofmt/testdata/rewrite4.golden @@ -0,0 +1,76 @@ +//gofmt -r=(x)->x + +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Rewriting of parenthesized expressions (x) -> x +// must not drop parentheses if that would lead to +// wrong association of the operands. +// Was issue 1847. + +package main + +// From example 1 of issue 1847. +func _() { + var t = (&T{1000}).Id() +} + +// From example 2 of issue 1847. +func _() { + fmt.Println((*xpp).a) +} + +// Some more test cases. +func _() { + _ = (-x).f + _ = (*x).f + _ = (&x).f + _ = (!x).f + _ = -x.f + _ = *x.f + _ = &x.f + _ = !x.f + (-x).f() + (*x).f() + (&x).f() + (!x).f() + _ = -x.f() + _ = *x.f() + _ = &x.f() + _ = !x.f() + + _ = (-x).f + _ = (*x).f + _ = (&x).f + _ = (!x).f + _ = -x.f + _ = *x.f + _ = &x.f + _ = !x.f + (-x).f() + (*x).f() + (&x).f() + (!x).f() + _ = -x.f() + _ = *x.f() + _ = &x.f() + _ = !x.f() + + _ = -x.f + _ = *x.f + _ = &x.f + _ = !x.f + _ = -x.f + _ = *x.f + _ = &x.f + _ = !x.f + _ = -x.f() + _ = *x.f() + _ = &x.f() + _ = !x.f() + _ = -x.f() + _ = *x.f() + _ = &x.f() + _ = !x.f() +} diff --git a/src/cmd/gofmt/testdata/rewrite4.input b/src/cmd/gofmt/testdata/rewrite4.input new file mode 100644 index 0000000000000000000000000000000000000000..0817099209c0e87ce5c422bd7750c0d01a38b839 --- /dev/null +++ b/src/cmd/gofmt/testdata/rewrite4.input @@ -0,0 +1,76 @@ +//gofmt -r=(x)->x + +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Rewriting of parenthesized expressions (x) -> x +// must not drop parentheses if that would lead to +// wrong association of the operands. +// Was issue 1847. + +package main + +// From example 1 of issue 1847. +func _() { + var t = (&T{1000}).Id() +} + +// From example 2 of issue 1847. +func _() { + fmt.Println((*xpp).a) +} + +// Some more test cases. +func _() { + _ = (-x).f + _ = (*x).f + _ = (&x).f + _ = (!x).f + _ = (-x.f) + _ = (*x.f) + _ = (&x.f) + _ = (!x.f) + (-x).f() + (*x).f() + (&x).f() + (!x).f() + _ = (-x.f()) + _ = (*x.f()) + _ = (&x.f()) + _ = (!x.f()) + + _ = ((-x)).f + _ = ((*x)).f + _ = ((&x)).f + _ = ((!x)).f + _ = ((-x.f)) + _ = ((*x.f)) + _ = ((&x.f)) + _ = ((!x.f)) + ((-x)).f() + ((*x)).f() + ((&x)).f() + ((!x)).f() + _ = ((-x.f())) + _ = ((*x.f())) + _ = ((&x.f())) + _ = ((!x.f())) + + _ = -(x).f + _ = *(x).f + _ = &(x).f + _ = !(x).f + _ = -x.f + _ = *x.f + _ = &x.f + _ = !x.f + _ = -(x).f() + _ = *(x).f() + _ = &(x).f() + _ = !(x).f() + _ = -x.f() + _ = *x.f() + _ = &x.f() + _ = !x.f() +} diff --git a/src/cmd/gofmt/testdata/rewrite5.golden b/src/cmd/gofmt/testdata/rewrite5.golden new file mode 100644 index 0000000000000000000000000000000000000000..9beb34aee76d13da7fafce9f32006f4c16b9092a --- /dev/null +++ b/src/cmd/gofmt/testdata/rewrite5.golden @@ -0,0 +1,17 @@ +//gofmt -r=x+x->2*x + +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Rewriting of expressions containing nodes with associated comments to +// expressions without those nodes must also eliminate the associated +// comments. + +package p + +func f(x int) int { + _ = 2 * x // this comment remains in the rewrite + _ = 2 * x + return 2 * x +} diff --git a/src/cmd/gofmt/testdata/rewrite5.input b/src/cmd/gofmt/testdata/rewrite5.input new file mode 100644 index 0000000000000000000000000000000000000000..d7a6122d07a7a99c20e3ce7e0f57d27b054d2bcc --- /dev/null +++ b/src/cmd/gofmt/testdata/rewrite5.input @@ -0,0 +1,17 @@ +//gofmt -r=x+x->2*x + +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Rewriting of expressions containing nodes with associated comments to +// expressions without those nodes must also eliminate the associated +// comments. + +package p + +func f(x int) int { + _ = x + x // this comment remains in the rewrite + _ = x /* this comment must not be in the rewrite */ + x + return x /* this comment must not be in the rewrite */ + x +} diff --git a/src/cmd/gofmt/testdata/rewrite6.golden b/src/cmd/gofmt/testdata/rewrite6.golden new file mode 100644 index 0000000000000000000000000000000000000000..48ec9aa0df7780e1dea1567071240fee46d1b2f9 --- /dev/null +++ b/src/cmd/gofmt/testdata/rewrite6.golden @@ -0,0 +1,17 @@ +//gofmt -r=fun(x)->Fun(x) + +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Rewriting of calls must take the ... (ellipsis) +// attribute for the last argument into account. + +package p + +func fun(x []int) {} + +func g(x []int) { + Fun(x) // -r='fun(x)->Fun(x)' should rewrite this to Fun(x) + fun(x...) // -r='fun(x)->Fun(x)' should not rewrite this +} diff --git a/src/cmd/gofmt/testdata/rewrite6.input b/src/cmd/gofmt/testdata/rewrite6.input new file mode 100644 index 0000000000000000000000000000000000000000..b085a84fef4a878b41bdd90716dce23acb90ecb9 --- /dev/null +++ b/src/cmd/gofmt/testdata/rewrite6.input @@ -0,0 +1,17 @@ +//gofmt -r=fun(x)->Fun(x) + +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Rewriting of calls must take the ... (ellipsis) +// attribute for the last argument into account. + +package p + +func fun(x []int) {} + +func g(x []int) { + fun(x) // -r='fun(x)->Fun(x)' should rewrite this to Fun(x) + fun(x...) // -r='fun(x)->Fun(x)' should not rewrite this +} diff --git a/src/cmd/gofmt/testdata/rewrite7.golden b/src/cmd/gofmt/testdata/rewrite7.golden new file mode 100644 index 0000000000000000000000000000000000000000..8386a0b2a3eb791bd1bb5a68d4277ea75b660441 --- /dev/null +++ b/src/cmd/gofmt/testdata/rewrite7.golden @@ -0,0 +1,17 @@ +//gofmt -r=fun(x...)->Fun(x) + +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Rewriting of calls must take the ... (ellipsis) +// attribute for the last argument into account. + +package p + +func fun(x []int) {} + +func g(x []int) { + fun(x) // -r='fun(x...)->Fun(x)' should not rewrite this + Fun(x) // -r='fun(x...)->Fun(x)' should rewrite this to Fun(x) +} diff --git a/src/cmd/gofmt/testdata/rewrite7.input b/src/cmd/gofmt/testdata/rewrite7.input new file mode 100644 index 0000000000000000000000000000000000000000..c1984708e71b34b96a1e78292ba8cca8ce1280f5 --- /dev/null +++ b/src/cmd/gofmt/testdata/rewrite7.input @@ -0,0 +1,17 @@ +//gofmt -r=fun(x...)->Fun(x) + +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Rewriting of calls must take the ... (ellipsis) +// attribute for the last argument into account. + +package p + +func fun(x []int) {} + +func g(x []int) { + fun(x) // -r='fun(x...)->Fun(x)' should not rewrite this + fun(x...) // -r='fun(x...)->Fun(x)' should rewrite this to Fun(x) +} diff --git a/src/cmd/gofmt/testdata/rewrite8.golden b/src/cmd/gofmt/testdata/rewrite8.golden new file mode 100644 index 0000000000000000000000000000000000000000..62f0419dfb460297d64aef8850d228c507f411f9 --- /dev/null +++ b/src/cmd/gofmt/testdata/rewrite8.golden @@ -0,0 +1,12 @@ +//gofmt -r=interface{}->int + +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Check that literal type expression rewrites are accepted. +// Was issue 4406. + +package p + +type T int diff --git a/src/cmd/gofmt/testdata/rewrite8.input b/src/cmd/gofmt/testdata/rewrite8.input new file mode 100644 index 0000000000000000000000000000000000000000..7964c5c75c78fb0551487b8ae637353081990851 --- /dev/null +++ b/src/cmd/gofmt/testdata/rewrite8.input @@ -0,0 +1,12 @@ +//gofmt -r=interface{}->int + +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Check that literal type expression rewrites are accepted. +// Was issue 4406. + +package p + +type T interface{} diff --git a/src/cmd/gofmt/testdata/slices1.golden b/src/cmd/gofmt/testdata/slices1.golden new file mode 100644 index 0000000000000000000000000000000000000000..04bc16f2160b62e330346aa424afc395b4be200a --- /dev/null +++ b/src/cmd/gofmt/testdata/slices1.golden @@ -0,0 +1,66 @@ +//gofmt -s + +// Test cases for slice expression simplification. +package p + +var ( + a [10]byte + b [20]float32 + s []int + t struct { + s []byte + } + + _ = a[0:] + _ = a[1:10] + _ = a[2:] + _ = a[3:(len(a))] + _ = a[len(a) : len(a)-1] + _ = a[0:len(b)] + _ = a[2:len(a):len(a)] + + _ = a[:] + _ = a[:10] + _ = a[:] + _ = a[:(len(a))] + _ = a[:len(a)-1] + _ = a[:len(b)] + _ = a[:len(a):len(a)] + + _ = s[0:] + _ = s[1:10] + _ = s[2:] + _ = s[3:(len(s))] + _ = s[len(a) : len(s)-1] + _ = s[0:len(b)] + _ = s[2:len(s):len(s)] + + _ = s[:] + _ = s[:10] + _ = s[:] + _ = s[:(len(s))] + _ = s[:len(s)-1] + _ = s[:len(b)] + _ = s[:len(s):len(s)] + + _ = t.s[0:] + _ = t.s[1:10] + _ = t.s[2:len(t.s)] + _ = t.s[3:(len(t.s))] + _ = t.s[len(a) : len(t.s)-1] + _ = t.s[0:len(b)] + _ = t.s[2:len(t.s):len(t.s)] + + _ = t.s[:] + _ = t.s[:10] + _ = t.s[:len(t.s)] + _ = t.s[:(len(t.s))] + _ = t.s[:len(t.s)-1] + _ = t.s[:len(b)] + _ = t.s[:len(t.s):len(t.s)] +) + +func _() { + s := s[0:] + _ = s +} diff --git a/src/cmd/gofmt/testdata/slices1.input b/src/cmd/gofmt/testdata/slices1.input new file mode 100644 index 0000000000000000000000000000000000000000..1f25c43ccbc825ba1a89cee7e0362c43c4eba257 --- /dev/null +++ b/src/cmd/gofmt/testdata/slices1.input @@ -0,0 +1,66 @@ +//gofmt -s + +// Test cases for slice expression simplification. +package p + +var ( + a [10]byte + b [20]float32 + s []int + t struct { + s []byte + } + + _ = a[0:] + _ = a[1:10] + _ = a[2:len(a)] + _ = a[3:(len(a))] + _ = a[len(a) : len(a)-1] + _ = a[0:len(b)] + _ = a[2:len(a):len(a)] + + _ = a[:] + _ = a[:10] + _ = a[:len(a)] + _ = a[:(len(a))] + _ = a[:len(a)-1] + _ = a[:len(b)] + _ = a[:len(a):len(a)] + + _ = s[0:] + _ = s[1:10] + _ = s[2:len(s)] + _ = s[3:(len(s))] + _ = s[len(a) : len(s)-1] + _ = s[0:len(b)] + _ = s[2:len(s):len(s)] + + _ = s[:] + _ = s[:10] + _ = s[:len(s)] + _ = s[:(len(s))] + _ = s[:len(s)-1] + _ = s[:len(b)] + _ = s[:len(s):len(s)] + + _ = t.s[0:] + _ = t.s[1:10] + _ = t.s[2:len(t.s)] + _ = t.s[3:(len(t.s))] + _ = t.s[len(a) : len(t.s)-1] + _ = t.s[0:len(b)] + _ = t.s[2:len(t.s):len(t.s)] + + _ = t.s[:] + _ = t.s[:10] + _ = t.s[:len(t.s)] + _ = t.s[:(len(t.s))] + _ = t.s[:len(t.s)-1] + _ = t.s[:len(b)] + _ = t.s[:len(t.s):len(t.s)] +) + +func _() { + s := s[0:len(s)] + _ = s +} diff --git a/src/cmd/gofmt/testdata/slices2.golden b/src/cmd/gofmt/testdata/slices2.golden new file mode 100644 index 0000000000000000000000000000000000000000..ab657004e64accaae1c2b1258e3b795fef78bcf0 --- /dev/null +++ b/src/cmd/gofmt/testdata/slices2.golden @@ -0,0 +1,63 @@ +//gofmt -s + +// Test cases for slice expression simplification. +// Because of a dot import, these slices must remain untouched. +package p + +import . "math" + +var ( + a [10]byte + b [20]float32 + s []int + t struct { + s []byte + } + + _ = a[0:] + _ = a[1:10] + _ = a[2:len(a)] + _ = a[3:(len(a))] + _ = a[len(a) : len(a)-1] + _ = a[0:len(b)] + + _ = a[:] + _ = a[:10] + _ = a[:len(a)] + _ = a[:(len(a))] + _ = a[:len(a)-1] + _ = a[:len(b)] + + _ = s[0:] + _ = s[1:10] + _ = s[2:len(s)] + _ = s[3:(len(s))] + _ = s[len(a) : len(s)-1] + _ = s[0:len(b)] + + _ = s[:] + _ = s[:10] + _ = s[:len(s)] + _ = s[:(len(s))] + _ = s[:len(s)-1] + _ = s[:len(b)] + + _ = t.s[0:] + _ = t.s[1:10] + _ = t.s[2:len(t.s)] + _ = t.s[3:(len(t.s))] + _ = t.s[len(a) : len(t.s)-1] + _ = t.s[0:len(b)] + + _ = t.s[:] + _ = t.s[:10] + _ = t.s[:len(t.s)] + _ = t.s[:(len(t.s))] + _ = t.s[:len(t.s)-1] + _ = t.s[:len(b)] +) + +func _() { + s := s[0:len(s)] + _ = s +} diff --git a/src/cmd/gofmt/testdata/slices2.input b/src/cmd/gofmt/testdata/slices2.input new file mode 100644 index 0000000000000000000000000000000000000000..ab657004e64accaae1c2b1258e3b795fef78bcf0 --- /dev/null +++ b/src/cmd/gofmt/testdata/slices2.input @@ -0,0 +1,63 @@ +//gofmt -s + +// Test cases for slice expression simplification. +// Because of a dot import, these slices must remain untouched. +package p + +import . "math" + +var ( + a [10]byte + b [20]float32 + s []int + t struct { + s []byte + } + + _ = a[0:] + _ = a[1:10] + _ = a[2:len(a)] + _ = a[3:(len(a))] + _ = a[len(a) : len(a)-1] + _ = a[0:len(b)] + + _ = a[:] + _ = a[:10] + _ = a[:len(a)] + _ = a[:(len(a))] + _ = a[:len(a)-1] + _ = a[:len(b)] + + _ = s[0:] + _ = s[1:10] + _ = s[2:len(s)] + _ = s[3:(len(s))] + _ = s[len(a) : len(s)-1] + _ = s[0:len(b)] + + _ = s[:] + _ = s[:10] + _ = s[:len(s)] + _ = s[:(len(s))] + _ = s[:len(s)-1] + _ = s[:len(b)] + + _ = t.s[0:] + _ = t.s[1:10] + _ = t.s[2:len(t.s)] + _ = t.s[3:(len(t.s))] + _ = t.s[len(a) : len(t.s)-1] + _ = t.s[0:len(b)] + + _ = t.s[:] + _ = t.s[:10] + _ = t.s[:len(t.s)] + _ = t.s[:(len(t.s))] + _ = t.s[:len(t.s)-1] + _ = t.s[:len(b)] +) + +func _() { + s := s[0:len(s)] + _ = s +} diff --git a/src/cmd/gofmt/testdata/stdin1.golden b/src/cmd/gofmt/testdata/stdin1.golden new file mode 100644 index 0000000000000000000000000000000000000000..9e4dcd20fe0d563ed51b2bac27567fbc7f5ee63c --- /dev/null +++ b/src/cmd/gofmt/testdata/stdin1.golden @@ -0,0 +1,5 @@ + //gofmt -stdin + + if x { + y + } diff --git a/src/cmd/gofmt/testdata/stdin1.input b/src/cmd/gofmt/testdata/stdin1.input new file mode 100644 index 0000000000000000000000000000000000000000..9e4dcd20fe0d563ed51b2bac27567fbc7f5ee63c --- /dev/null +++ b/src/cmd/gofmt/testdata/stdin1.input @@ -0,0 +1,5 @@ + //gofmt -stdin + + if x { + y + } diff --git a/src/cmd/gofmt/testdata/stdin2.golden b/src/cmd/gofmt/testdata/stdin2.golden new file mode 100644 index 0000000000000000000000000000000000000000..57df35540358c1c15f8cb3dfbdc292ae7d59c225 --- /dev/null +++ b/src/cmd/gofmt/testdata/stdin2.golden @@ -0,0 +1,11 @@ +//gofmt -stdin + +var x int + +func f() { + y := z + /* this is a comment */ + // this is a comment too +} + + diff --git a/src/cmd/gofmt/testdata/stdin2.input b/src/cmd/gofmt/testdata/stdin2.input new file mode 100644 index 0000000000000000000000000000000000000000..69d6bdd682efe8f90e157ef1f93f549c7cc7b4a4 --- /dev/null +++ b/src/cmd/gofmt/testdata/stdin2.input @@ -0,0 +1,11 @@ +//gofmt -stdin + +var x int + + +func f() { y := z + /* this is a comment */ + // this is a comment too +} + + diff --git a/src/cmd/gofmt/testdata/stdin3.golden b/src/cmd/gofmt/testdata/stdin3.golden new file mode 100644 index 0000000000000000000000000000000000000000..d6da0e417a06ce11d31cab2bea97606987ee3288 --- /dev/null +++ b/src/cmd/gofmt/testdata/stdin3.golden @@ -0,0 +1,7 @@ + //gofmt -stdin + + /* note: no newline at end of file */ + for i := 0; i < 10; i++ { + s += i + } + \ No newline at end of file diff --git a/src/cmd/gofmt/testdata/stdin3.input b/src/cmd/gofmt/testdata/stdin3.input new file mode 100644 index 0000000000000000000000000000000000000000..ab46c1063beba078cd8a18c4fd2beb64186e9d0a --- /dev/null +++ b/src/cmd/gofmt/testdata/stdin3.input @@ -0,0 +1,5 @@ + //gofmt -stdin + + /* note: no newline at end of file */ + for i := 0; i < 10; i++ { s += i } + \ No newline at end of file diff --git a/src/cmd/gofmt/testdata/stdin4.golden b/src/cmd/gofmt/testdata/stdin4.golden new file mode 100644 index 0000000000000000000000000000000000000000..0c7acace5d0fa8c557e988699f92311ad74aa659 --- /dev/null +++ b/src/cmd/gofmt/testdata/stdin4.golden @@ -0,0 +1,5 @@ + //gofmt -stdin + + // comment + + i := 0 diff --git a/src/cmd/gofmt/testdata/stdin4.input b/src/cmd/gofmt/testdata/stdin4.input new file mode 100644 index 0000000000000000000000000000000000000000..1fc73f31e5e68aadf77ed9a334655e98754812bf --- /dev/null +++ b/src/cmd/gofmt/testdata/stdin4.input @@ -0,0 +1,5 @@ + //gofmt -stdin + + // comment + + i := 0 diff --git a/src/cmd/gofmt/testdata/stdin5.golden b/src/cmd/gofmt/testdata/stdin5.golden new file mode 100644 index 0000000000000000000000000000000000000000..31ce6b248528bfdc416f712bafc33bd88b99a9fc --- /dev/null +++ b/src/cmd/gofmt/testdata/stdin5.golden @@ -0,0 +1,3 @@ +//gofmt -stdin + +i := 5 // Line comment without newline. \ No newline at end of file diff --git a/src/cmd/gofmt/testdata/stdin5.input b/src/cmd/gofmt/testdata/stdin5.input new file mode 100644 index 0000000000000000000000000000000000000000..0a7c97d180c2ffff94327dc1d506d81a60df58ee --- /dev/null +++ b/src/cmd/gofmt/testdata/stdin5.input @@ -0,0 +1,3 @@ +//gofmt -stdin + +i :=5// Line comment without newline. \ No newline at end of file diff --git a/src/cmd/gofmt/testdata/stdin6.golden b/src/cmd/gofmt/testdata/stdin6.golden new file mode 100644 index 0000000000000000000000000000000000000000..ffcea8011ba53e1c0197eb3c369f4000f9da302a --- /dev/null +++ b/src/cmd/gofmt/testdata/stdin6.golden @@ -0,0 +1,19 @@ + //gofmt -stdin + + if err != nil { + source := strings.NewReader(`line 1. +line 2. +`) + return source + } + + f := func(hat, tail string) { + + fmt.Println(hat+` +foo + + +`+tail, + "more", + "and more") + } diff --git a/src/cmd/gofmt/testdata/stdin6.input b/src/cmd/gofmt/testdata/stdin6.input new file mode 100644 index 0000000000000000000000000000000000000000..78330020c659e07f6a89bcb70d0abbcb73aae123 --- /dev/null +++ b/src/cmd/gofmt/testdata/stdin6.input @@ -0,0 +1,21 @@ + //gofmt -stdin + + if err != nil { + source := strings.NewReader(`line 1. +line 2. +`) + return source + } + + f:=func( hat, tail string){ + + + + fmt. Println ( hat+ ` +foo + + +`+ tail , + "more" , + "and more" ) + } diff --git a/src/cmd/gofmt/testdata/stdin7.golden b/src/cmd/gofmt/testdata/stdin7.golden new file mode 100644 index 0000000000000000000000000000000000000000..bbac7133c86dfbb61b7d65cdbcecb45d16f2f703 --- /dev/null +++ b/src/cmd/gofmt/testdata/stdin7.golden @@ -0,0 +1,19 @@ + //gofmt -stdin + + if err != nil { + source := strings.NewReader(`line 1. +line 2. +`) + return source + } + + f := func(hat, tail string) { + + fmt.Println(hat+` + foo + + + `+tail, + "more", + "and more") + } diff --git a/src/cmd/gofmt/testdata/stdin7.input b/src/cmd/gofmt/testdata/stdin7.input new file mode 100644 index 0000000000000000000000000000000000000000..fd772a3c4e44fa62b022b2357efe6586c1b4f347 --- /dev/null +++ b/src/cmd/gofmt/testdata/stdin7.input @@ -0,0 +1,21 @@ + //gofmt -stdin + + if err != nil { + source := strings.NewReader(`line 1. +line 2. +`) + return source + } + + f:=func( hat, tail string){ + + + + fmt. Println ( hat+ ` + foo + + + `+ tail , + "more" , + "and more" ) + } diff --git a/src/cmd/gofmt/testdata/typeswitch.golden b/src/cmd/gofmt/testdata/typeswitch.golden new file mode 100644 index 0000000000000000000000000000000000000000..2b1905edd3b4fc1c965cbe800ddc3db7a049772e --- /dev/null +++ b/src/cmd/gofmt/testdata/typeswitch.golden @@ -0,0 +1,60 @@ +/* + Parenthesized type switch expressions originally + accepted by gofmt must continue to be rewritten + into the correct unparenthesized form. + + Only type-switches that didn't declare a variable + in the type switch type assertion and which + contained only "expression-like" (named) types in their + cases were permitted to have their type assertion parenthesized + by go/parser (due to a weak predicate in the parser). All others + were rejected always, either with a syntax error in the + type switch header or in the case. + + See also issue 4470. +*/ +package p + +func f() { + var x interface{} + switch x.(type) { // should remain the same + } + switch x.(type) { // should become: switch x.(type) { + } + + switch x.(type) { // should remain the same + case int: + } + switch x.(type) { // should become: switch x.(type) { + case int: + } + + switch x.(type) { // should remain the same + case []int: + } + + // Parenthesized (x.(type)) in type switches containing cases + // with unnamed (literal) types were never permitted by gofmt; + // thus there won't be any code in the wild using this style if + // the code was gofmt-ed. + /* + switch (x.(type)) { + case []int: + } + */ + + switch t := x.(type) { // should remain the same + default: + _ = t + } + + // Parenthesized (x.(type)) in type switches declaring a variable + // were never permitted by gofmt; thus there won't be any code in + // the wild using this style if the code was gofmt-ed. + /* + switch t := (x.(type)) { + default: + _ = t + } + */ +} diff --git a/src/cmd/gofmt/testdata/typeswitch.input b/src/cmd/gofmt/testdata/typeswitch.input new file mode 100644 index 0000000000000000000000000000000000000000..8f8cba9b855abd4f0893422de34a91d9183b2f6c --- /dev/null +++ b/src/cmd/gofmt/testdata/typeswitch.input @@ -0,0 +1,60 @@ +/* + Parenthesized type switch expressions originally + accepted by gofmt must continue to be rewritten + into the correct unparenthesized form. + + Only type-switches that didn't declare a variable + in the type switch type assertion and which + contained only "expression-like" (named) types in their + cases were permitted to have their type assertion parenthesized + by go/parser (due to a weak predicate in the parser). All others + were rejected always, either with a syntax error in the + type switch header or in the case. + + See also issue 4470. +*/ +package p + +func f() { + var x interface{} + switch x.(type) { // should remain the same + } + switch (x.(type)) { // should become: switch x.(type) { + } + + switch x.(type) { // should remain the same + case int: + } + switch (x.(type)) { // should become: switch x.(type) { + case int: + } + + switch x.(type) { // should remain the same + case []int: + } + + // Parenthesized (x.(type)) in type switches containing cases + // with unnamed (literal) types were never permitted by gofmt; + // thus there won't be any code in the wild using this style if + // the code was gofmt-ed. + /* + switch (x.(type)) { + case []int: + } + */ + + switch t := x.(type) { // should remain the same + default: + _ = t + } + + // Parenthesized (x.(type)) in type switches declaring a variable + // were never permitted by gofmt; thus there won't be any code in + // the wild using this style if the code was gofmt-ed. + /* + switch t := (x.(type)) { + default: + _ = t + } + */ +} diff --git a/src/cmd/internal/gcprog/gcprog.go b/src/cmd/internal/gcprog/gcprog.go new file mode 100644 index 0000000000000000000000000000000000000000..5845f7d65e12eae6d5ede240b0873fe7b8f86b90 --- /dev/null +++ b/src/cmd/internal/gcprog/gcprog.go @@ -0,0 +1,298 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package gcprog implements an encoder for packed GC pointer bitmaps, +// known as GC programs. +// +// Program Format +// +// The GC program encodes a sequence of 0 and 1 bits indicating scalar or pointer words in an object. +// The encoding is a simple Lempel-Ziv program, with codes to emit literal bits and to repeat the +// last n bits c times. +// +// The possible codes are: +// +// 00000000: stop +// 0nnnnnnn: emit n bits copied from the next (n+7)/8 bytes, least significant bit first +// 10000000 n c: repeat the previous n bits c times; n, c are varints +// 1nnnnnnn c: repeat the previous n bits c times; c is a varint +// +// The numbers n and c, when they follow a code, are encoded as varints +// using the same encoding as encoding/binary's Uvarint. +// +package gcprog + +import ( + "fmt" + "io" +) + +const progMaxLiteral = 127 // maximum n for literal n bit code + +// A Writer is an encoder for GC programs. +// +// The typical use of a Writer is to call Init, maybe call Debug, +// make a sequence of Ptr, Advance, Repeat, and Append calls +// to describe the data type, and then finally call End. +type Writer struct { + writeByte func(byte) + symoff int + index int64 + b [progMaxLiteral]byte + nb int + debug io.Writer + debugBuf []byte +} + +// Init initializes w to write a new GC program +// by calling writeByte for each byte in the program. +func (w *Writer) Init(writeByte func(byte)) { + w.writeByte = writeByte +} + +// Debug causes the writer to print a debugging trace to out +// during future calls to methods like Ptr, Advance, and End. +// It also enables debugging checks during the encoding. +func (w *Writer) Debug(out io.Writer) { + w.debug = out +} + +// BitIndex returns the number of bits written to the bit stream so far. +func (w *Writer) BitIndex() int64 { + return w.index +} + +// byte writes the byte x to the output. +func (w *Writer) byte(x byte) { + if w.debug != nil { + w.debugBuf = append(w.debugBuf, x) + } + w.writeByte(x) +} + +// End marks the end of the program, writing any remaining bytes. +func (w *Writer) End() { + w.flushlit() + w.byte(0) + if w.debug != nil { + index := progbits(w.debugBuf) + if index != w.index { + println("gcprog: End wrote program for", index, "bits, but current index is", w.index) + panic("gcprog: out of sync") + } + } +} + +// Ptr emits a 1 into the bit stream at the given bit index. +// that is, it records that the index'th word in the object memory is a pointer. +// Any bits between the current index and the new index +// are set to zero, meaning the corresponding words are scalars. +func (w *Writer) Ptr(index int64) { + if index < w.index { + println("gcprog: Ptr at index", index, "but current index is", w.index) + panic("gcprog: invalid Ptr index") + } + w.ZeroUntil(index) + if w.debug != nil { + fmt.Fprintf(w.debug, "gcprog: ptr at %d\n", index) + } + w.lit(1) +} + +// ShouldRepeat reports whether it would be worthwhile to +// use a Repeat to describe c elements of n bits each, +// compared to just emitting c copies of the n-bit description. +func (w *Writer) ShouldRepeat(n, c int64) bool { + // Should we lay out the bits directly instead of + // encoding them as a repetition? Certainly if count==1, + // since there's nothing to repeat, but also if the total + // size of the plain pointer bits for the type will fit in + // 4 or fewer bytes, since using a repetition will require + // flushing the current bits plus at least one byte for + // the repeat size and one for the repeat count. + return c > 1 && c*n > 4*8 +} + +// Repeat emits an instruction to repeat the description +// of the last n words c times (including the initial description, c+1 times in total). +func (w *Writer) Repeat(n, c int64) { + if n == 0 || c == 0 { + return + } + w.flushlit() + if w.debug != nil { + fmt.Fprintf(w.debug, "gcprog: repeat %d × %d\n", n, c) + } + if n < 128 { + w.byte(0x80 | byte(n)) + } else { + w.byte(0x80) + w.varint(n) + } + w.varint(c) + w.index += n * c +} + +// ZeroUntil adds zeros to the bit stream until reaching the given index; +// that is, it records that the words from the most recent pointer until +// the index'th word are scalars. +// ZeroUntil is usually called in preparation for a call to Repeat, Append, or End. +func (w *Writer) ZeroUntil(index int64) { + if index < w.index { + println("gcprog: Advance", index, "but index is", w.index) + panic("gcprog: invalid Advance index") + } + skip := (index - w.index) + if skip == 0 { + return + } + if skip < 4*8 { + if w.debug != nil { + fmt.Fprintf(w.debug, "gcprog: advance to %d by literals\n", index) + } + for i := int64(0); i < skip; i++ { + w.lit(0) + } + return + } + + if w.debug != nil { + fmt.Fprintf(w.debug, "gcprog: advance to %d by repeat\n", index) + } + w.lit(0) + w.flushlit() + w.Repeat(1, skip-1) +} + +// Append emits the given GC program into the current output. +// The caller asserts that the program emits n bits (describes n words), +// and Append panics if that is not true. +func (w *Writer) Append(prog []byte, n int64) { + w.flushlit() + if w.debug != nil { + fmt.Fprintf(w.debug, "gcprog: append prog for %d ptrs\n", n) + fmt.Fprintf(w.debug, "\t") + } + n1 := progbits(prog) + if n1 != n { + panic("gcprog: wrong bit count in append") + } + // The last byte of the prog terminates the program. + // Don't emit that, or else our own program will end. + for i, x := range prog[:len(prog)-1] { + if w.debug != nil { + if i > 0 { + fmt.Fprintf(w.debug, " ") + } + fmt.Fprintf(w.debug, "%02x", x) + } + w.byte(x) + } + if w.debug != nil { + fmt.Fprintf(w.debug, "\n") + } + w.index += n +} + +// progbits returns the length of the bit stream encoded by the program p. +func progbits(p []byte) int64 { + var n int64 + for len(p) > 0 { + x := p[0] + p = p[1:] + if x == 0 { + break + } + if x&0x80 == 0 { + count := x &^ 0x80 + n += int64(count) + p = p[(count+7)/8:] + continue + } + nbit := int64(x &^ 0x80) + if nbit == 0 { + nbit, p = readvarint(p) + } + var count int64 + count, p = readvarint(p) + n += nbit * count + } + if len(p) > 0 { + println("gcprog: found end instruction after", n, "ptrs, with", len(p), "bytes remaining") + panic("gcprog: extra data at end of program") + } + return n +} + +// readvarint reads a varint from p, returning the value and the remainder of p. +func readvarint(p []byte) (int64, []byte) { + var v int64 + var nb uint + for { + c := p[0] + p = p[1:] + v |= int64(c&^0x80) << nb + nb += 7 + if c&0x80 == 0 { + break + } + } + return v, p +} + +// lit adds a single literal bit to w. +func (w *Writer) lit(x byte) { + if w.nb == progMaxLiteral { + w.flushlit() + } + w.b[w.nb] = x + w.nb++ + w.index++ +} + +// varint emits the varint encoding of x. +func (w *Writer) varint(x int64) { + if x < 0 { + panic("gcprog: negative varint") + } + for x >= 0x80 { + w.byte(byte(0x80 | x)) + x >>= 7 + } + w.byte(byte(x)) +} + +// flushlit flushes any pending literal bits. +func (w *Writer) flushlit() { + if w.nb == 0 { + return + } + if w.debug != nil { + fmt.Fprintf(w.debug, "gcprog: flush %d literals\n", w.nb) + fmt.Fprintf(w.debug, "\t%v\n", w.b[:w.nb]) + fmt.Fprintf(w.debug, "\t%02x", byte(w.nb)) + } + w.byte(byte(w.nb)) + var bits uint8 + for i := 0; i < w.nb; i++ { + bits |= w.b[i] << uint(i%8) + if (i+1)%8 == 0 { + if w.debug != nil { + fmt.Fprintf(w.debug, " %02x", bits) + } + w.byte(bits) + bits = 0 + } + } + if w.nb%8 != 0 { + if w.debug != nil { + fmt.Fprintf(w.debug, " %02x", bits) + } + w.byte(bits) + } + if w.debug != nil { + fmt.Fprintf(w.debug, "\n") + } + w.nb = 0 +} diff --git a/src/cmd/internal/goobj/read.go b/src/cmd/internal/goobj/read.go new file mode 100644 index 0000000000000000000000000000000000000000..1b0c9646bc8a6d00a4f40115d5602eeddb9fe5db --- /dev/null +++ b/src/cmd/internal/goobj/read.go @@ -0,0 +1,668 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package goobj implements reading of Go object files and archives. +// +// TODO(rsc): Decide where this package should live. (golang.org/issue/6932) +// TODO(rsc): Decide the appropriate integer types for various fields. +// TODO(rsc): Write tests. (File format still up in the air a little.) +package goobj + +import ( + "bufio" + "bytes" + "cmd/internal/obj" + "errors" + "fmt" + "io" + "strconv" + "strings" +) + +// A SymKind describes the kind of memory represented by a symbol. +type SymKind int + +// This list is taken from include/link.h. + +// Defined SymKind values. +// TODO(rsc): Give idiomatic Go names. +// TODO(rsc): Reduce the number of symbol types in the object files. +const ( + _ SymKind = iota + + // readonly, executable + STEXT SymKind = obj.STEXT + SELFRXSECT SymKind = obj.SELFRXSECT + + // readonly, non-executable + STYPE SymKind = obj.STYPE + SSTRING SymKind = obj.SSTRING + SGOSTRING SymKind = obj.SGOSTRING + SGOFUNC SymKind = obj.SGOFUNC + SRODATA SymKind = obj.SRODATA + SFUNCTAB SymKind = obj.SFUNCTAB + STYPELINK SymKind = obj.STYPELINK + SSYMTAB SymKind = obj.SSYMTAB // TODO: move to unmapped section + SPCLNTAB SymKind = obj.SPCLNTAB + SELFROSECT SymKind = obj.SELFROSECT + + // writable, non-executable + SMACHOPLT SymKind = obj.SMACHOPLT + SELFSECT SymKind = obj.SELFSECT + SMACHO SymKind = obj.SMACHO // Mach-O __nl_symbol_ptr + SMACHOGOT SymKind = obj.SMACHOGOT + SWINDOWS SymKind = obj.SWINDOWS + SELFGOT SymKind = obj.SELFGOT + SNOPTRDATA SymKind = obj.SNOPTRDATA + SINITARR SymKind = obj.SINITARR + SDATA SymKind = obj.SDATA + SBSS SymKind = obj.SBSS + SNOPTRBSS SymKind = obj.SNOPTRBSS + STLSBSS SymKind = obj.STLSBSS + + // not mapped + SXREF SymKind = obj.SXREF + SMACHOSYMSTR SymKind = obj.SMACHOSYMSTR + SMACHOSYMTAB SymKind = obj.SMACHOSYMTAB + SMACHOINDIRECTPLT SymKind = obj.SMACHOINDIRECTPLT + SMACHOINDIRECTGOT SymKind = obj.SMACHOINDIRECTGOT + SFILE SymKind = obj.SFILE + SFILEPATH SymKind = obj.SFILEPATH + SCONST SymKind = obj.SCONST + SDYNIMPORT SymKind = obj.SDYNIMPORT + SHOSTOBJ SymKind = obj.SHOSTOBJ +) + +var symKindStrings = []string{ + SBSS: "SBSS", + SCONST: "SCONST", + SDATA: "SDATA", + SDYNIMPORT: "SDYNIMPORT", + SELFROSECT: "SELFROSECT", + SELFRXSECT: "SELFRXSECT", + SELFSECT: "SELFSECT", + SFILE: "SFILE", + SFILEPATH: "SFILEPATH", + SFUNCTAB: "SFUNCTAB", + SGOFUNC: "SGOFUNC", + SGOSTRING: "SGOSTRING", + SHOSTOBJ: "SHOSTOBJ", + SINITARR: "SINITARR", + SMACHO: "SMACHO", + SMACHOGOT: "SMACHOGOT", + SMACHOINDIRECTGOT: "SMACHOINDIRECTGOT", + SMACHOINDIRECTPLT: "SMACHOINDIRECTPLT", + SMACHOPLT: "SMACHOPLT", + SMACHOSYMSTR: "SMACHOSYMSTR", + SMACHOSYMTAB: "SMACHOSYMTAB", + SNOPTRBSS: "SNOPTRBSS", + SNOPTRDATA: "SNOPTRDATA", + SPCLNTAB: "SPCLNTAB", + SRODATA: "SRODATA", + SSTRING: "SSTRING", + SSYMTAB: "SSYMTAB", + STEXT: "STEXT", + STLSBSS: "STLSBSS", + STYPE: "STYPE", + STYPELINK: "STYPELINK", + SWINDOWS: "SWINDOWS", + SXREF: "SXREF", +} + +func (k SymKind) String() string { + if k < 0 || int(k) >= len(symKindStrings) { + return fmt.Sprintf("SymKind(%d)", k) + } + return symKindStrings[k] +} + +// A Sym is a named symbol in an object file. +type Sym struct { + SymID // symbol identifier (name and version) + Kind SymKind // kind of symbol + DupOK bool // are duplicate definitions okay? + Size int // size of corresponding data + Type SymID // symbol for Go type information + Data Data // memory image of symbol + Reloc []Reloc // relocations to apply to Data + Func *Func // additional data for functions +} + +// A SymID - the combination of Name and Version - uniquely identifies +// a symbol within a package. +type SymID struct { + // Name is the name of a symbol. + Name string + + // Version is zero for symbols with global visibility. + // Symbols with only file visibility (such as file-level static + // declarations in C) have a non-zero version distinguishing + // a symbol in one file from a symbol of the same name + // in another file + Version int +} + +func (s SymID) String() string { + if s.Version == 0 { + return s.Name + } + return fmt.Sprintf("%s<%d>", s.Name, s.Version) +} + +// A Data is a reference to data stored in an object file. +// It records the offset and size of the data, so that a client can +// read the data only if necessary. +type Data struct { + Offset int64 + Size int64 +} + +// A Reloc describes a relocation applied to a memory image to refer +// to an address within a particular symbol. +type Reloc struct { + // The bytes at [Offset, Offset+Size) within the memory image + // should be updated to refer to the address Add bytes after the start + // of the symbol Sym. + Offset int + Size int + Sym SymID + Add int + + // The Type records the form of address expected in the bytes + // described by the previous fields: absolute, PC-relative, and so on. + // TODO(rsc): The interpretation of Type is not exposed by this package. + Type int +} + +// A Var describes a variable in a function stack frame: a declared +// local variable, an input argument, or an output result. +type Var struct { + // The combination of Name, Kind, and Offset uniquely + // identifies a variable in a function stack frame. + // Using fewer of these - in particular, using only Name - does not. + Name string // Name of variable. + Kind int // TODO(rsc): Define meaning. + Offset int // Frame offset. TODO(rsc): Define meaning. + + Type SymID // Go type for variable. +} + +// Func contains additional per-symbol information specific to functions. +type Func struct { + Args int // size in bytes of argument frame: inputs and outputs + Frame int // size in bytes of local variable frame + Leaf bool // function omits save of link register (ARM) + NoSplit bool // function omits stack split prologue + Var []Var // detail about local variables + PCSP Data // PC → SP offset map + PCFile Data // PC → file number map (index into File) + PCLine Data // PC → line number map + PCData []Data // PC → runtime support data map + FuncData []FuncData // non-PC-specific runtime support data + File []string // paths indexed by PCFile +} + +// TODO: Add PCData []byte and PCDataIter (similar to liblink). + +// A FuncData is a single function-specific data value. +type FuncData struct { + Sym SymID // symbol holding data + Offset int64 // offset into symbol for funcdata pointer +} + +// A Package is a parsed Go object file or archive defining a Go package. +type Package struct { + ImportPath string // import path denoting this package + Imports []string // packages imported by this package + Syms []*Sym // symbols defined by this package + MaxVersion int // maximum Version in any SymID in Syms +} + +var ( + archiveHeader = []byte("!\n") + archiveMagic = []byte("`\n") + goobjHeader = []byte("go objec") // truncated to size of archiveHeader + + errCorruptArchive = errors.New("corrupt archive") + errTruncatedArchive = errors.New("truncated archive") + errNotArchive = errors.New("unrecognized archive format") + + errCorruptObject = errors.New("corrupt object file") + errTruncatedObject = errors.New("truncated object file") + errNotObject = errors.New("unrecognized object file format") +) + +// An objReader is an object file reader. +type objReader struct { + p *Package + b *bufio.Reader + f io.ReadSeeker + err error + offset int64 + limit int64 + tmp [256]byte + pkg string + pkgprefix string +} + +// importPathToPrefix returns the prefix that will be used in the +// final symbol table for the given import path. +// We escape '%', '"', all control characters and non-ASCII bytes, +// and any '.' after the final slash. +// +// See ../../../cmd/ld/lib.c:/^pathtoprefix and +// ../../../cmd/gc/subr.c:/^pathtoprefix. +func importPathToPrefix(s string) string { + // find index of last slash, if any, or else -1. + // used for determining whether an index is after the last slash. + slash := strings.LastIndex(s, "/") + + // check for chars that need escaping + n := 0 + for r := 0; r < len(s); r++ { + if c := s[r]; c <= ' ' || (c == '.' && r > slash) || c == '%' || c == '"' || c >= 0x7F { + n++ + } + } + + // quick exit + if n == 0 { + return s + } + + // escape + const hex = "0123456789abcdef" + p := make([]byte, 0, len(s)+2*n) + for r := 0; r < len(s); r++ { + if c := s[r]; c <= ' ' || (c == '.' && r > slash) || c == '%' || c == '"' || c >= 0x7F { + p = append(p, '%', hex[c>>4], hex[c&0xF]) + } else { + p = append(p, c) + } + } + + return string(p) +} + +// init initializes r to read package p from f. +func (r *objReader) init(f io.ReadSeeker, p *Package) { + r.f = f + r.p = p + r.offset, _ = f.Seek(0, 1) + r.limit, _ = f.Seek(0, 2) + f.Seek(r.offset, 0) + r.b = bufio.NewReader(f) + r.pkgprefix = importPathToPrefix(p.ImportPath) + "." +} + +// error records that an error occurred. +// It returns only the first error, so that an error +// caused by an earlier error does not discard information +// about the earlier error. +func (r *objReader) error(err error) error { + if r.err == nil { + if err == io.EOF { + err = io.ErrUnexpectedEOF + } + r.err = err + } + // panic("corrupt") // useful for debugging + return r.err +} + +// readByte reads and returns a byte from the input file. +// On I/O error or EOF, it records the error but returns byte 0. +// A sequence of 0 bytes will eventually terminate any +// parsing state in the object file. In particular, it ends the +// reading of a varint. +func (r *objReader) readByte() byte { + if r.err != nil { + return 0 + } + if r.offset >= r.limit { + r.error(io.ErrUnexpectedEOF) + return 0 + } + b, err := r.b.ReadByte() + if err != nil { + if err == io.EOF { + err = io.ErrUnexpectedEOF + } + r.error(err) + b = 0 + } else { + r.offset++ + } + return b +} + +// read reads exactly len(b) bytes from the input file. +// If an error occurs, read returns the error but also +// records it, so it is safe for callers to ignore the result +// as long as delaying the report is not a problem. +func (r *objReader) readFull(b []byte) error { + if r.err != nil { + return r.err + } + if r.offset+int64(len(b)) > r.limit { + return r.error(io.ErrUnexpectedEOF) + } + n, err := io.ReadFull(r.b, b) + r.offset += int64(n) + if err != nil { + return r.error(err) + } + return nil +} + +// readInt reads a zigzag varint from the input file. +func (r *objReader) readInt() int { + var u uint64 + + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + r.error(errCorruptObject) + return 0 + } + c := r.readByte() + u |= uint64(c&0x7F) << shift + if c&0x80 == 0 { + break + } + } + + v := int64(u>>1) ^ (int64(u) << 63 >> 63) + if int64(int(v)) != v { + r.error(errCorruptObject) // TODO + return 0 + } + return int(v) +} + +// readString reads a length-delimited string from the input file. +func (r *objReader) readString() string { + n := r.readInt() + buf := make([]byte, n) + r.readFull(buf) + return string(buf) +} + +// readSymID reads a SymID from the input file. +func (r *objReader) readSymID() SymID { + name, vers := r.readString(), r.readInt() + + // In a symbol name in an object file, "". denotes the + // prefix for the package in which the object file has been found. + // Expand it. + name = strings.Replace(name, `"".`, r.pkgprefix, -1) + + // An individual object file only records version 0 (extern) or 1 (static). + // To make static symbols unique across all files being read, we + // replace version 1 with the version corresponding to the current + // file number. The number is incremented on each call to parseObject. + if vers != 0 { + vers = r.p.MaxVersion + } + + return SymID{name, vers} +} + +// readData reads a data reference from the input file. +func (r *objReader) readData() Data { + n := r.readInt() + d := Data{Offset: r.offset, Size: int64(n)} + r.skip(int64(n)) + return d +} + +// skip skips n bytes in the input. +func (r *objReader) skip(n int64) { + if n < 0 { + r.error(fmt.Errorf("debug/goobj: internal error: misuse of skip")) + } + if n < int64(len(r.tmp)) { + // Since the data is so small, a just reading from the buffered + // reader is better than flushing the buffer and seeking. + r.readFull(r.tmp[:n]) + } else if n <= int64(r.b.Buffered()) { + // Even though the data is not small, it has already been read. + // Advance the buffer instead of seeking. + for n > int64(len(r.tmp)) { + r.readFull(r.tmp[:]) + n -= int64(len(r.tmp)) + } + r.readFull(r.tmp[:n]) + } else { + // Seek, giving up buffered data. + _, err := r.f.Seek(r.offset+n, 0) + if err != nil { + r.error(err) + } + r.offset += n + r.b.Reset(r.f) + } +} + +// Parse parses an object file or archive from r, +// assuming that its import path is pkgpath. +func Parse(r io.ReadSeeker, pkgpath string) (*Package, error) { + if pkgpath == "" { + pkgpath = `""` + } + p := new(Package) + p.ImportPath = pkgpath + + var rd objReader + rd.init(r, p) + err := rd.readFull(rd.tmp[:8]) + if err != nil { + if err == io.EOF { + err = io.ErrUnexpectedEOF + } + return nil, err + } + + switch { + default: + return nil, errNotObject + + case bytes.Equal(rd.tmp[:8], archiveHeader): + if err := rd.parseArchive(); err != nil { + return nil, err + } + case bytes.Equal(rd.tmp[:8], goobjHeader): + if err := rd.parseObject(goobjHeader); err != nil { + return nil, err + } + } + + return p, nil +} + +// trimSpace removes trailing spaces from b and returns the corresponding string. +// This effectively parses the form used in archive headers. +func trimSpace(b []byte) string { + return string(bytes.TrimRight(b, " ")) +} + +// parseArchive parses a Unix archive of Go object files. +// TODO(rsc): Need to skip non-Go object files. +// TODO(rsc): Maybe record table of contents in r.p so that +// linker can avoid having code to parse archives too. +func (r *objReader) parseArchive() error { + for r.offset < r.limit { + if err := r.readFull(r.tmp[:60]); err != nil { + return err + } + data := r.tmp[:60] + + // Each file is preceded by this text header (slice indices in first column): + // 0:16 name + // 16:28 date + // 28:34 uid + // 34:40 gid + // 40:48 mode + // 48:58 size + // 58:60 magic - `\n + // We only care about name, size, and magic. + // The fields are space-padded on the right. + // The size is in decimal. + // The file data - size bytes - follows the header. + // Headers are 2-byte aligned, so if size is odd, an extra padding + // byte sits between the file data and the next header. + // The file data that follows is padded to an even number of bytes: + // if size is odd, an extra padding byte is inserted betw the next header. + if len(data) < 60 { + return errTruncatedArchive + } + if !bytes.Equal(data[58:60], archiveMagic) { + return errCorruptArchive + } + name := trimSpace(data[0:16]) + size, err := strconv.ParseInt(trimSpace(data[48:58]), 10, 64) + if err != nil { + return errCorruptArchive + } + data = data[60:] + fsize := size + size&1 + if fsize < 0 || fsize < size { + return errCorruptArchive + } + switch name { + case "__.SYMDEF", "__.GOSYMDEF", "__.PKGDEF": + r.skip(size) + default: + oldLimit := r.limit + r.limit = r.offset + size + if err := r.parseObject(nil); err != nil { + return fmt.Errorf("parsing archive member %q: %v", name, err) + } + r.skip(r.limit - r.offset) + r.limit = oldLimit + } + if size&1 != 0 { + r.skip(1) + } + } + return nil +} + +// parseObject parses a single Go object file. +// The prefix is the bytes already read from the file, +// typically in order to detect that this is an object file. +// The object file consists of a textual header ending in "\n!\n" +// and then the part we want to parse begins. +// The format of that part is defined in a comment at the top +// of src/liblink/objfile.c. +func (r *objReader) parseObject(prefix []byte) error { + // TODO(rsc): Maybe use prefix and the initial input to + // record the header line from the file, which would + // give the architecture and other version information. + + r.p.MaxVersion++ + var c1, c2, c3 byte + for { + c1, c2, c3 = c2, c3, r.readByte() + if c3 == 0 { // NUL or EOF, either is bad + return errCorruptObject + } + if c1 == '\n' && c2 == '!' && c3 == '\n' { + break + } + } + + r.readFull(r.tmp[:8]) + if !bytes.Equal(r.tmp[:8], []byte("\x00\x00go13ld")) { + return r.error(errCorruptObject) + } + + b := r.readByte() + if b != 1 { + return r.error(errCorruptObject) + } + + // Direct package dependencies. + for { + s := r.readString() + if s == "" { + break + } + r.p.Imports = append(r.p.Imports, s) + } + + // Symbols. + for { + if b := r.readByte(); b != 0xfe { + if b != 0xff { + return r.error(errCorruptObject) + } + break + } + + typ := r.readInt() + s := &Sym{SymID: r.readSymID()} + r.p.Syms = append(r.p.Syms, s) + s.Kind = SymKind(typ) + flags := r.readInt() + s.DupOK = flags&1 != 0 + s.Size = r.readInt() + s.Type = r.readSymID() + s.Data = r.readData() + s.Reloc = make([]Reloc, r.readInt()) + for i := range s.Reloc { + rel := &s.Reloc[i] + rel.Offset = r.readInt() + rel.Size = r.readInt() + rel.Type = r.readInt() + rel.Add = r.readInt() + r.readInt() // Xadd - ignored + rel.Sym = r.readSymID() + r.readSymID() // Xsym - ignored + } + + if s.Kind == STEXT { + f := new(Func) + s.Func = f + f.Args = r.readInt() + f.Frame = r.readInt() + flags := r.readInt() + f.Leaf = flags&1 != 0 + f.NoSplit = r.readInt() != 0 + f.Var = make([]Var, r.readInt()) + for i := range f.Var { + v := &f.Var[i] + v.Name = r.readSymID().Name + v.Offset = r.readInt() + v.Kind = r.readInt() + v.Type = r.readSymID() + } + + f.PCSP = r.readData() + f.PCFile = r.readData() + f.PCLine = r.readData() + f.PCData = make([]Data, r.readInt()) + for i := range f.PCData { + f.PCData[i] = r.readData() + } + f.FuncData = make([]FuncData, r.readInt()) + for i := range f.FuncData { + f.FuncData[i].Sym = r.readSymID() + } + for i := range f.FuncData { + f.FuncData[i].Offset = int64(r.readInt()) // TODO + } + f.File = make([]string, r.readInt()) + for i := range f.File { + f.File[i] = r.readSymID().Name + } + } + } + + r.readFull(r.tmp[:7]) + if !bytes.Equal(r.tmp[:7], []byte("\xffgo13ld")) { + return r.error(errCorruptObject) + } + + return nil +} diff --git a/src/cmd/internal/goobj/read_test.go b/src/cmd/internal/goobj/read_test.go new file mode 100644 index 0000000000000000000000000000000000000000..cc991e5d9163c4d8e17b89c35b869b95ac441433 --- /dev/null +++ b/src/cmd/internal/goobj/read_test.go @@ -0,0 +1,28 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package goobj + +import "testing" + +var importPathToPrefixTests = []struct { + in string + out string +}{ + {"runtime", "runtime"}, + {"sync/atomic", "sync/atomic"}, + {"golang.org/x/tools/godoc", "golang.org/x/tools/godoc"}, + {"foo.bar/baz.quux", "foo.bar/baz%2equux"}, + {"", ""}, + {"%foo%bar", "%25foo%25bar"}, + {"\x01\x00\x7F☺", "%01%00%7f%e2%98%ba"}, +} + +func TestImportPathToPrefix(t *testing.T) { + for _, tt := range importPathToPrefixTests { + if out := importPathToPrefix(tt.in); out != tt.out { + t.Errorf("importPathToPrefix(%q) = %q, want %q", tt.in, out, tt.out) + } + } +} diff --git a/src/cmd/internal/obj/ar.go b/src/cmd/internal/obj/ar.go new file mode 100644 index 0000000000000000000000000000000000000000..7cbeafdda5e4e0d0f73450b4b174f54f52d4da5c --- /dev/null +++ b/src/cmd/internal/obj/ar.go @@ -0,0 +1,45 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package obj + +// Inferno utils/include/ar.h +// http://code.google.com/p/inferno-os/source/browse/utils/include/ar.h +// +// Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved. +// Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net) +// Portions Copyright © 1997-1999 Vita Nuova Limited +// Portions Copyright © 2000-2007 Vita Nuova Holdings Limited (www.vitanuova.com) +// Portions Copyright © 2004,2006 Bruce Ellis +// Portions Copyright © 2005-2007 C H Forsyth (forsyth@terzarima.net) +// Revisions Copyright © 2000-2007 Lucent Technologies Inc. and others +// Portions Copyright © 2009 The Go Authors. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +type ar_hdr struct { + name string + date string + uid string + gid string + mode string + size string + fmag string +} diff --git a/src/cmd/internal/obj/arm/a.out.go b/src/cmd/internal/obj/arm/a.out.go new file mode 100644 index 0000000000000000000000000000000000000000..1cb561d4b2939efaf91671c82cf4221f349d1294 --- /dev/null +++ b/src/cmd/internal/obj/arm/a.out.go @@ -0,0 +1,328 @@ +// Inferno utils/5c/5.out.h +// http://code.google.com/p/inferno-os/source/browse/utils/5c/5.out.h +// +// Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved. +// Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net) +// Portions Copyright © 1997-1999 Vita Nuova Limited +// Portions Copyright © 2000-2007 Vita Nuova Holdings Limited (www.vitanuova.com) +// Portions Copyright © 2004,2006 Bruce Ellis +// Portions Copyright © 2005-2007 C H Forsyth (forsyth@terzarima.net) +// Revisions Copyright © 2000-2007 Lucent Technologies Inc. and others +// Portions Copyright © 2009 The Go Authors. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +package arm + +import "cmd/internal/obj" + +//go:generate go run ../stringer.go -i $GOFILE -o anames.go -p arm + +const ( + NSNAME = 8 + NSYM = 50 + NREG = 16 +) + +/* -1 disables use of REGARG */ +const ( + REGARG = -1 +) + +const ( + REG_R0 = obj.RBaseARM + iota // must be 16-aligned + REG_R1 + REG_R2 + REG_R3 + REG_R4 + REG_R5 + REG_R6 + REG_R7 + REG_R8 + REG_R9 + REG_R10 + REG_R11 + REG_R12 + REG_R13 + REG_R14 + REG_R15 + + REG_F0 // must be 16-aligned + REG_F1 + REG_F2 + REG_F3 + REG_F4 + REG_F5 + REG_F6 + REG_F7 + REG_F8 + REG_F9 + REG_F10 + REG_F11 + REG_F12 + REG_F13 + REG_F14 + REG_F15 + + REG_FPSR // must be 2-aligned + REG_FPCR + + REG_CPSR // must be 2-aligned + REG_SPSR + + MAXREG + REGRET = REG_R0 + /* compiler allocates R1 up as temps */ + /* compiler allocates register variables R3 up */ + /* compiler allocates external registers R10 down */ + REGEXT = REG_R10 + /* these two registers are declared in runtime.h */ + REGG = REGEXT - 0 + REGM = REGEXT - 1 + + REGCTXT = REG_R7 + REGTMP = REG_R11 + REGSP = REG_R13 + REGLINK = REG_R14 + REGPC = REG_R15 + + NFREG = 16 + /* compiler allocates register variables F0 up */ + /* compiler allocates external registers F7 down */ + FREGRET = REG_F0 + FREGEXT = REG_F7 + FREGTMP = REG_F15 +) + +const ( + C_NONE = iota + C_REG + C_REGREG + C_REGREG2 + C_REGLIST + C_SHIFT + C_FREG + C_PSR + C_FCR + + C_RCON /* 0xff rotated */ + C_NCON /* ~RCON */ + C_SCON /* 0xffff */ + C_LCON + C_LCONADDR + C_ZFCON + C_SFCON + C_LFCON + + C_RACON + C_LACON + + C_SBRA + C_LBRA + + C_HAUTO /* halfword insn offset (-0xff to 0xff) */ + C_FAUTO /* float insn offset (0 to 0x3fc, word aligned) */ + C_HFAUTO /* both H and F */ + C_SAUTO /* -0xfff to 0xfff */ + C_LAUTO + + C_HOREG + C_FOREG + C_HFOREG + C_SOREG + C_ROREG + C_SROREG /* both nil and R */ + C_LOREG + + C_PC + C_SP + C_HREG + + C_ADDR /* reference to relocatable address */ + C_TEXTSIZE + + C_GOK + + C_NCLASS /* must be the last */ +) + +const ( + AAND = obj.ABaseARM + obj.A_ARCHSPECIFIC + iota + AEOR + ASUB + ARSB + AADD + AADC + ASBC + ARSC + ATST + ATEQ + ACMP + ACMN + AORR + ABIC + + AMVN + + /* + * Do not reorder or fragment the conditional branch + * opcodes, or the predication code will break + */ + ABEQ + ABNE + ABCS + ABHS + ABCC + ABLO + ABMI + ABPL + ABVS + ABVC + ABHI + ABLS + ABGE + ABLT + ABGT + ABLE + + AMOVWD + AMOVWF + AMOVDW + AMOVFW + AMOVFD + AMOVDF + AMOVF + AMOVD + + ACMPF + ACMPD + AADDF + AADDD + ASUBF + ASUBD + AMULF + AMULD + ADIVF + ADIVD + ASQRTF + ASQRTD + AABSF + AABSD + + ASRL + ASRA + ASLL + AMULU + ADIVU + AMUL + ADIV + AMOD + AMODU + + AMOVB + AMOVBS + AMOVBU + AMOVH + AMOVHS + AMOVHU + AMOVW + AMOVM + ASWPBU + ASWPW + + ARFE + ASWI + AMULA + + AWORD + ABCASE + ACASE + + AMULL + AMULAL + AMULLU + AMULALU + + ABX + ABXRET + ADWORD + + ALDREX + ASTREX + ALDREXD + ASTREXD + + APLD + + ACLZ + + AMULWT + AMULWB + AMULAWT + AMULAWB + + ADATABUNDLE + ADATABUNDLEEND + + AMRC // MRC/MCR + + ALAST + + // aliases + AB = obj.AJMP + ABL = obj.ACALL +) + +/* scond byte */ +const ( + C_SCOND = (1 << 4) - 1 + C_SBIT = 1 << 4 + C_PBIT = 1 << 5 + C_WBIT = 1 << 6 + C_FBIT = 1 << 7 /* psr flags-only */ + C_UBIT = 1 << 7 /* up bit, unsigned bit */ + + // These constants are the ARM condition codes encodings, + // XORed with 14 so that C_SCOND_NONE has value 0, + // so that a zeroed Prog.scond means "always execute". + C_SCOND_XOR = 14 + + C_SCOND_EQ = 0 ^ C_SCOND_XOR + C_SCOND_NE = 1 ^ C_SCOND_XOR + C_SCOND_HS = 2 ^ C_SCOND_XOR + C_SCOND_LO = 3 ^ C_SCOND_XOR + C_SCOND_MI = 4 ^ C_SCOND_XOR + C_SCOND_PL = 5 ^ C_SCOND_XOR + C_SCOND_VS = 6 ^ C_SCOND_XOR + C_SCOND_VC = 7 ^ C_SCOND_XOR + C_SCOND_HI = 8 ^ C_SCOND_XOR + C_SCOND_LS = 9 ^ C_SCOND_XOR + C_SCOND_GE = 10 ^ C_SCOND_XOR + C_SCOND_LT = 11 ^ C_SCOND_XOR + C_SCOND_GT = 12 ^ C_SCOND_XOR + C_SCOND_LE = 13 ^ C_SCOND_XOR + C_SCOND_NONE = 14 ^ C_SCOND_XOR + C_SCOND_NV = 15 ^ C_SCOND_XOR + + /* D_SHIFT type */ + SHIFT_LL = 0 << 5 + SHIFT_LR = 1 << 5 + SHIFT_AR = 2 << 5 + SHIFT_RR = 3 << 5 +) diff --git a/src/cmd/internal/obj/arm/anames.go b/src/cmd/internal/obj/arm/anames.go new file mode 100644 index 0000000000000000000000000000000000000000..1a924f0381b2ed30ac105fc2f229f73107ea7c29 --- /dev/null +++ b/src/cmd/internal/obj/arm/anames.go @@ -0,0 +1,108 @@ +// Generated by stringer -i a.out.go -o anames.go -p arm +// Do not edit. + +package arm + +import "cmd/internal/obj" + +var Anames = []string{ + obj.A_ARCHSPECIFIC: "AND", + "EOR", + "SUB", + "RSB", + "ADD", + "ADC", + "SBC", + "RSC", + "TST", + "TEQ", + "CMP", + "CMN", + "ORR", + "BIC", + "MVN", + "BEQ", + "BNE", + "BCS", + "BHS", + "BCC", + "BLO", + "BMI", + "BPL", + "BVS", + "BVC", + "BHI", + "BLS", + "BGE", + "BLT", + "BGT", + "BLE", + "MOVWD", + "MOVWF", + "MOVDW", + "MOVFW", + "MOVFD", + "MOVDF", + "MOVF", + "MOVD", + "CMPF", + "CMPD", + "ADDF", + "ADDD", + "SUBF", + "SUBD", + "MULF", + "MULD", + "DIVF", + "DIVD", + "SQRTF", + "SQRTD", + "ABSF", + "ABSD", + "SRL", + "SRA", + "SLL", + "MULU", + "DIVU", + "MUL", + "DIV", + "MOD", + "MODU", + "MOVB", + "MOVBS", + "MOVBU", + "MOVH", + "MOVHS", + "MOVHU", + "MOVW", + "MOVM", + "SWPBU", + "SWPW", + "RFE", + "SWI", + "MULA", + "WORD", + "BCASE", + "CASE", + "MULL", + "MULAL", + "MULLU", + "MULALU", + "BX", + "BXRET", + "DWORD", + "LDREX", + "STREX", + "LDREXD", + "STREXD", + "PLD", + "CLZ", + "MULWT", + "MULWB", + "MULAWT", + "MULAWB", + "DATABUNDLE", + "DATABUNDLEEND", + "MRC", + "LAST", +} diff --git a/src/cmd/internal/obj/arm/anames5.go b/src/cmd/internal/obj/arm/anames5.go new file mode 100644 index 0000000000000000000000000000000000000000..2e3a1f92dd8bd1745d8bd92cb27b694ec1a0c322 --- /dev/null +++ b/src/cmd/internal/obj/arm/anames5.go @@ -0,0 +1,70 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package arm + +var cnames5 = []string{ + "NONE", + "REG", + "REGREG", + "REGREG2", + "SHIFT", + "FREG", + "PSR", + "FCR", + "RCON", + "NCON", + "SCON", + "LCON", + "LCONADDR", + "ZFCON", + "SFCON", + "LFCON", + "RACON", + "LACON", + "SBRA", + "LBRA", + "HAUTO", + "FAUTO", + "HFAUTO", + "SAUTO", + "LAUTO", + "HOREG", + "FOREG", + "HFOREG", + "SOREG", + "ROREG", + "SROREG", + "LOREG", + "PC", + "SP", + "HREG", + "ADDR", + "TEXTSIZE", + "GOK", + "NCLASS", + "SCOND = (1<<4)-1", + "SBIT = 1<<4", + "PBIT = 1<<5", + "WBIT = 1<<6", + "FBIT = 1<<7", + "UBIT = 1<<7", + "SCOND_XOR = 14", + "SCOND_EQ = 0 ^ C_SCOND_XOR", + "SCOND_NE = 1 ^ C_SCOND_XOR", + "SCOND_HS = 2 ^ C_SCOND_XOR", + "SCOND_LO = 3 ^ C_SCOND_XOR", + "SCOND_MI = 4 ^ C_SCOND_XOR", + "SCOND_PL = 5 ^ C_SCOND_XOR", + "SCOND_VS = 6 ^ C_SCOND_XOR", + "SCOND_VC = 7 ^ C_SCOND_XOR", + "SCOND_HI = 8 ^ C_SCOND_XOR", + "SCOND_LS = 9 ^ C_SCOND_XOR", + "SCOND_GE = 10 ^ C_SCOND_XOR", + "SCOND_LT = 11 ^ C_SCOND_XOR", + "SCOND_GT = 12 ^ C_SCOND_XOR", + "SCOND_LE = 13 ^ C_SCOND_XOR", + "SCOND_NONE = 14 ^ C_SCOND_XOR", + "SCOND_NV = 15 ^ C_SCOND_XOR", +} diff --git a/src/cmd/internal/obj/arm/asm5.go b/src/cmd/internal/obj/arm/asm5.go new file mode 100644 index 0000000000000000000000000000000000000000..610637c42edea38388fdd2c2a4343ac5fe050331 --- /dev/null +++ b/src/cmd/internal/obj/arm/asm5.go @@ -0,0 +1,2855 @@ +// Inferno utils/5l/span.c +// http://code.google.com/p/inferno-os/source/browse/utils/5l/span.c +// +// Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved. +// Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net) +// Portions Copyright © 1997-1999 Vita Nuova Limited +// Portions Copyright © 2000-2007 Vita Nuova Holdings Limited (www.vitanuova.com) +// Portions Copyright © 2004,2006 Bruce Ellis +// Portions Copyright © 2005-2007 C H Forsyth (forsyth@terzarima.net) +// Revisions Copyright © 2000-2007 Lucent Technologies Inc. and others +// Portions Copyright © 2009 The Go Authors. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +package arm + +import ( + "cmd/internal/obj" + "fmt" + "log" + "math" + "sort" +) + +type Optab struct { + as uint16 + a1 uint8 + a2 int8 + a3 uint8 + type_ uint8 + size int8 + param int16 + flag int8 + pcrelsiz uint8 +} + +type Oprang struct { + start []Optab + stop []Optab +} + +type Opcross [32][2][32]uint8 + +const ( + LFROM = 1 << 0 + LTO = 1 << 1 + LPOOL = 1 << 2 + LPCREL = 1 << 3 +) + +var optab = []Optab{ + /* struct Optab: + OPCODE, from, prog->reg, to, type,size,param,flag */ + Optab{obj.ATEXT, C_ADDR, C_NONE, C_TEXTSIZE, 0, 0, 0, 0, 0}, + Optab{AADD, C_REG, C_REG, C_REG, 1, 4, 0, 0, 0}, + Optab{AADD, C_REG, C_NONE, C_REG, 1, 4, 0, 0, 0}, + Optab{AMOVW, C_REG, C_NONE, C_REG, 1, 4, 0, 0, 0}, + Optab{AMVN, C_REG, C_NONE, C_REG, 1, 4, 0, 0, 0}, + Optab{ACMP, C_REG, C_REG, C_NONE, 1, 4, 0, 0, 0}, + Optab{AADD, C_RCON, C_REG, C_REG, 2, 4, 0, 0, 0}, + Optab{AADD, C_RCON, C_NONE, C_REG, 2, 4, 0, 0, 0}, + Optab{AMOVW, C_RCON, C_NONE, C_REG, 2, 4, 0, 0, 0}, + Optab{AMVN, C_RCON, C_NONE, C_REG, 2, 4, 0, 0, 0}, + Optab{ACMP, C_RCON, C_REG, C_NONE, 2, 4, 0, 0, 0}, + Optab{AADD, C_SHIFT, C_REG, C_REG, 3, 4, 0, 0, 0}, + Optab{AADD, C_SHIFT, C_NONE, C_REG, 3, 4, 0, 0, 0}, + Optab{AMVN, C_SHIFT, C_NONE, C_REG, 3, 4, 0, 0, 0}, + Optab{ACMP, C_SHIFT, C_REG, C_NONE, 3, 4, 0, 0, 0}, + Optab{AMOVW, C_RACON, C_NONE, C_REG, 4, 4, REGSP, 0, 0}, + Optab{AB, C_NONE, C_NONE, C_SBRA, 5, 4, 0, LPOOL, 0}, + Optab{ABL, C_NONE, C_NONE, C_SBRA, 5, 4, 0, 0, 0}, + Optab{ABX, C_NONE, C_NONE, C_SBRA, 74, 20, 0, 0, 0}, + Optab{ABEQ, C_NONE, C_NONE, C_SBRA, 5, 4, 0, 0, 0}, + Optab{ABEQ, C_RCON, C_NONE, C_SBRA, 5, 4, 0, 0, 0}, // prediction hinted form, hint ignored + + Optab{AB, C_NONE, C_NONE, C_ROREG, 6, 4, 0, LPOOL, 0}, + Optab{ABL, C_NONE, C_NONE, C_ROREG, 7, 4, 0, 0, 0}, + Optab{ABL, C_REG, C_NONE, C_ROREG, 7, 4, 0, 0, 0}, + Optab{ABX, C_NONE, C_NONE, C_ROREG, 75, 12, 0, 0, 0}, + Optab{ABXRET, C_NONE, C_NONE, C_ROREG, 76, 4, 0, 0, 0}, + Optab{ASLL, C_RCON, C_REG, C_REG, 8, 4, 0, 0, 0}, + Optab{ASLL, C_RCON, C_NONE, C_REG, 8, 4, 0, 0, 0}, + Optab{ASLL, C_REG, C_NONE, C_REG, 9, 4, 0, 0, 0}, + Optab{ASLL, C_REG, C_REG, C_REG, 9, 4, 0, 0, 0}, + Optab{ASWI, C_NONE, C_NONE, C_NONE, 10, 4, 0, 0, 0}, + Optab{ASWI, C_NONE, C_NONE, C_LOREG, 10, 4, 0, 0, 0}, + Optab{ASWI, C_NONE, C_NONE, C_LCON, 10, 4, 0, 0, 0}, + Optab{AWORD, C_NONE, C_NONE, C_LCON, 11, 4, 0, 0, 0}, + Optab{AWORD, C_NONE, C_NONE, C_LCONADDR, 11, 4, 0, 0, 0}, + Optab{AWORD, C_NONE, C_NONE, C_ADDR, 11, 4, 0, 0, 0}, + Optab{AMOVW, C_NCON, C_NONE, C_REG, 12, 4, 0, 0, 0}, + Optab{AMOVW, C_LCON, C_NONE, C_REG, 12, 4, 0, LFROM, 0}, + Optab{AMOVW, C_LCONADDR, C_NONE, C_REG, 12, 4, 0, LFROM | LPCREL, 4}, + Optab{AADD, C_NCON, C_REG, C_REG, 13, 8, 0, 0, 0}, + Optab{AADD, C_NCON, C_NONE, C_REG, 13, 8, 0, 0, 0}, + Optab{AMVN, C_NCON, C_NONE, C_REG, 13, 8, 0, 0, 0}, + Optab{ACMP, C_NCON, C_REG, C_NONE, 13, 8, 0, 0, 0}, + Optab{AADD, C_LCON, C_REG, C_REG, 13, 8, 0, LFROM, 0}, + Optab{AADD, C_LCON, C_NONE, C_REG, 13, 8, 0, LFROM, 0}, + Optab{AMVN, C_LCON, C_NONE, C_REG, 13, 8, 0, LFROM, 0}, + Optab{ACMP, C_LCON, C_REG, C_NONE, 13, 8, 0, LFROM, 0}, + Optab{AMOVB, C_REG, C_NONE, C_REG, 1, 4, 0, 0, 0}, + Optab{AMOVBS, C_REG, C_NONE, C_REG, 14, 8, 0, 0, 0}, + Optab{AMOVBU, C_REG, C_NONE, C_REG, 58, 4, 0, 0, 0}, + Optab{AMOVH, C_REG, C_NONE, C_REG, 1, 4, 0, 0, 0}, + Optab{AMOVHS, C_REG, C_NONE, C_REG, 14, 8, 0, 0, 0}, + Optab{AMOVHU, C_REG, C_NONE, C_REG, 14, 8, 0, 0, 0}, + Optab{AMUL, C_REG, C_REG, C_REG, 15, 4, 0, 0, 0}, + Optab{AMUL, C_REG, C_NONE, C_REG, 15, 4, 0, 0, 0}, + Optab{ADIV, C_REG, C_REG, C_REG, 16, 4, 0, 0, 0}, + Optab{ADIV, C_REG, C_NONE, C_REG, 16, 4, 0, 0, 0}, + Optab{AMULL, C_REG, C_REG, C_REGREG, 17, 4, 0, 0, 0}, + Optab{AMULA, C_REG, C_REG, C_REGREG2, 17, 4, 0, 0, 0}, + Optab{AMOVW, C_REG, C_NONE, C_SAUTO, 20, 4, REGSP, 0, 0}, + Optab{AMOVW, C_REG, C_NONE, C_SOREG, 20, 4, 0, 0, 0}, + Optab{AMOVB, C_REG, C_NONE, C_SAUTO, 20, 4, REGSP, 0, 0}, + Optab{AMOVB, C_REG, C_NONE, C_SOREG, 20, 4, 0, 0, 0}, + Optab{AMOVBS, C_REG, C_NONE, C_SAUTO, 20, 4, REGSP, 0, 0}, + Optab{AMOVBS, C_REG, C_NONE, C_SOREG, 20, 4, 0, 0, 0}, + Optab{AMOVBU, C_REG, C_NONE, C_SAUTO, 20, 4, REGSP, 0, 0}, + Optab{AMOVBU, C_REG, C_NONE, C_SOREG, 20, 4, 0, 0, 0}, + Optab{AMOVW, C_SAUTO, C_NONE, C_REG, 21, 4, REGSP, 0, 0}, + Optab{AMOVW, C_SOREG, C_NONE, C_REG, 21, 4, 0, 0, 0}, + Optab{AMOVBU, C_SAUTO, C_NONE, C_REG, 21, 4, REGSP, 0, 0}, + Optab{AMOVBU, C_SOREG, C_NONE, C_REG, 21, 4, 0, 0, 0}, + Optab{AMOVW, C_REG, C_NONE, C_LAUTO, 30, 8, REGSP, LTO, 0}, + Optab{AMOVW, C_REG, C_NONE, C_LOREG, 30, 8, 0, LTO, 0}, + Optab{AMOVW, C_REG, C_NONE, C_ADDR, 64, 8, 0, LTO | LPCREL, 4}, + Optab{AMOVB, C_REG, C_NONE, C_LAUTO, 30, 8, REGSP, LTO, 0}, + Optab{AMOVB, C_REG, C_NONE, C_LOREG, 30, 8, 0, LTO, 0}, + Optab{AMOVB, C_REG, C_NONE, C_ADDR, 64, 8, 0, LTO | LPCREL, 4}, + Optab{AMOVBS, C_REG, C_NONE, C_LAUTO, 30, 8, REGSP, LTO, 0}, + Optab{AMOVBS, C_REG, C_NONE, C_LOREG, 30, 8, 0, LTO, 0}, + Optab{AMOVBS, C_REG, C_NONE, C_ADDR, 64, 8, 0, LTO | LPCREL, 4}, + Optab{AMOVBU, C_REG, C_NONE, C_LAUTO, 30, 8, REGSP, LTO, 0}, + Optab{AMOVBU, C_REG, C_NONE, C_LOREG, 30, 8, 0, LTO, 0}, + Optab{AMOVBU, C_REG, C_NONE, C_ADDR, 64, 8, 0, LTO | LPCREL, 4}, + Optab{AMOVW, C_LAUTO, C_NONE, C_REG, 31, 8, REGSP, LFROM, 0}, + Optab{AMOVW, C_LOREG, C_NONE, C_REG, 31, 8, 0, LFROM, 0}, + Optab{AMOVW, C_ADDR, C_NONE, C_REG, 65, 8, 0, LFROM | LPCREL, 4}, + Optab{AMOVBU, C_LAUTO, C_NONE, C_REG, 31, 8, REGSP, LFROM, 0}, + Optab{AMOVBU, C_LOREG, C_NONE, C_REG, 31, 8, 0, LFROM, 0}, + Optab{AMOVBU, C_ADDR, C_NONE, C_REG, 65, 8, 0, LFROM | LPCREL, 4}, + Optab{AMOVW, C_LACON, C_NONE, C_REG, 34, 8, REGSP, LFROM, 0}, + Optab{AMOVW, C_PSR, C_NONE, C_REG, 35, 4, 0, 0, 0}, + Optab{AMOVW, C_REG, C_NONE, C_PSR, 36, 4, 0, 0, 0}, + Optab{AMOVW, C_RCON, C_NONE, C_PSR, 37, 4, 0, 0, 0}, + Optab{AMOVM, C_REGLIST, C_NONE, C_SOREG, 38, 4, 0, 0, 0}, + Optab{AMOVM, C_SOREG, C_NONE, C_REGLIST, 39, 4, 0, 0, 0}, + Optab{ASWPW, C_SOREG, C_REG, C_REG, 40, 4, 0, 0, 0}, + Optab{ARFE, C_NONE, C_NONE, C_NONE, 41, 4, 0, 0, 0}, + Optab{AMOVF, C_FREG, C_NONE, C_FAUTO, 50, 4, REGSP, 0, 0}, + Optab{AMOVF, C_FREG, C_NONE, C_FOREG, 50, 4, 0, 0, 0}, + Optab{AMOVF, C_FAUTO, C_NONE, C_FREG, 51, 4, REGSP, 0, 0}, + Optab{AMOVF, C_FOREG, C_NONE, C_FREG, 51, 4, 0, 0, 0}, + Optab{AMOVF, C_FREG, C_NONE, C_LAUTO, 52, 12, REGSP, LTO, 0}, + Optab{AMOVF, C_FREG, C_NONE, C_LOREG, 52, 12, 0, LTO, 0}, + Optab{AMOVF, C_LAUTO, C_NONE, C_FREG, 53, 12, REGSP, LFROM, 0}, + Optab{AMOVF, C_LOREG, C_NONE, C_FREG, 53, 12, 0, LFROM, 0}, + Optab{AMOVF, C_FREG, C_NONE, C_ADDR, 68, 8, 0, LTO | LPCREL, 4}, + Optab{AMOVF, C_ADDR, C_NONE, C_FREG, 69, 8, 0, LFROM | LPCREL, 4}, + Optab{AADDF, C_FREG, C_NONE, C_FREG, 54, 4, 0, 0, 0}, + Optab{AADDF, C_FREG, C_REG, C_FREG, 54, 4, 0, 0, 0}, + Optab{AMOVF, C_FREG, C_NONE, C_FREG, 54, 4, 0, 0, 0}, + Optab{AMOVW, C_REG, C_NONE, C_FCR, 56, 4, 0, 0, 0}, + Optab{AMOVW, C_FCR, C_NONE, C_REG, 57, 4, 0, 0, 0}, + Optab{AMOVW, C_SHIFT, C_NONE, C_REG, 59, 4, 0, 0, 0}, + Optab{AMOVBU, C_SHIFT, C_NONE, C_REG, 59, 4, 0, 0, 0}, + Optab{AMOVB, C_SHIFT, C_NONE, C_REG, 60, 4, 0, 0, 0}, + Optab{AMOVBS, C_SHIFT, C_NONE, C_REG, 60, 4, 0, 0, 0}, + Optab{AMOVW, C_REG, C_NONE, C_SHIFT, 61, 4, 0, 0, 0}, + Optab{AMOVB, C_REG, C_NONE, C_SHIFT, 61, 4, 0, 0, 0}, + Optab{AMOVBS, C_REG, C_NONE, C_SHIFT, 61, 4, 0, 0, 0}, + Optab{AMOVBU, C_REG, C_NONE, C_SHIFT, 61, 4, 0, 0, 0}, + Optab{ACASE, C_REG, C_NONE, C_NONE, 62, 4, 0, LPCREL, 8}, + Optab{ABCASE, C_NONE, C_NONE, C_SBRA, 63, 4, 0, LPCREL, 0}, + Optab{AMOVH, C_REG, C_NONE, C_HAUTO, 70, 4, REGSP, 0, 0}, + Optab{AMOVH, C_REG, C_NONE, C_HOREG, 70, 4, 0, 0, 0}, + Optab{AMOVHS, C_REG, C_NONE, C_HAUTO, 70, 4, REGSP, 0, 0}, + Optab{AMOVHS, C_REG, C_NONE, C_HOREG, 70, 4, 0, 0, 0}, + Optab{AMOVHU, C_REG, C_NONE, C_HAUTO, 70, 4, REGSP, 0, 0}, + Optab{AMOVHU, C_REG, C_NONE, C_HOREG, 70, 4, 0, 0, 0}, + Optab{AMOVB, C_HAUTO, C_NONE, C_REG, 71, 4, REGSP, 0, 0}, + Optab{AMOVB, C_HOREG, C_NONE, C_REG, 71, 4, 0, 0, 0}, + Optab{AMOVBS, C_HAUTO, C_NONE, C_REG, 71, 4, REGSP, 0, 0}, + Optab{AMOVBS, C_HOREG, C_NONE, C_REG, 71, 4, 0, 0, 0}, + Optab{AMOVH, C_HAUTO, C_NONE, C_REG, 71, 4, REGSP, 0, 0}, + Optab{AMOVH, C_HOREG, C_NONE, C_REG, 71, 4, 0, 0, 0}, + Optab{AMOVHS, C_HAUTO, C_NONE, C_REG, 71, 4, REGSP, 0, 0}, + Optab{AMOVHS, C_HOREG, C_NONE, C_REG, 71, 4, 0, 0, 0}, + Optab{AMOVHU, C_HAUTO, C_NONE, C_REG, 71, 4, REGSP, 0, 0}, + Optab{AMOVHU, C_HOREG, C_NONE, C_REG, 71, 4, 0, 0, 0}, + Optab{AMOVH, C_REG, C_NONE, C_LAUTO, 72, 8, REGSP, LTO, 0}, + Optab{AMOVH, C_REG, C_NONE, C_LOREG, 72, 8, 0, LTO, 0}, + Optab{AMOVH, C_REG, C_NONE, C_ADDR, 94, 8, 0, LTO | LPCREL, 4}, + Optab{AMOVHS, C_REG, C_NONE, C_LAUTO, 72, 8, REGSP, LTO, 0}, + Optab{AMOVHS, C_REG, C_NONE, C_LOREG, 72, 8, 0, LTO, 0}, + Optab{AMOVHS, C_REG, C_NONE, C_ADDR, 94, 8, 0, LTO | LPCREL, 4}, + Optab{AMOVHU, C_REG, C_NONE, C_LAUTO, 72, 8, REGSP, LTO, 0}, + Optab{AMOVHU, C_REG, C_NONE, C_LOREG, 72, 8, 0, LTO, 0}, + Optab{AMOVHU, C_REG, C_NONE, C_ADDR, 94, 8, 0, LTO | LPCREL, 4}, + Optab{AMOVB, C_LAUTO, C_NONE, C_REG, 73, 8, REGSP, LFROM, 0}, + Optab{AMOVB, C_LOREG, C_NONE, C_REG, 73, 8, 0, LFROM, 0}, + Optab{AMOVB, C_ADDR, C_NONE, C_REG, 93, 8, 0, LFROM | LPCREL, 4}, + Optab{AMOVBS, C_LAUTO, C_NONE, C_REG, 73, 8, REGSP, LFROM, 0}, + Optab{AMOVBS, C_LOREG, C_NONE, C_REG, 73, 8, 0, LFROM, 0}, + Optab{AMOVBS, C_ADDR, C_NONE, C_REG, 93, 8, 0, LFROM | LPCREL, 4}, + Optab{AMOVH, C_LAUTO, C_NONE, C_REG, 73, 8, REGSP, LFROM, 0}, + Optab{AMOVH, C_LOREG, C_NONE, C_REG, 73, 8, 0, LFROM, 0}, + Optab{AMOVH, C_ADDR, C_NONE, C_REG, 93, 8, 0, LFROM | LPCREL, 4}, + Optab{AMOVHS, C_LAUTO, C_NONE, C_REG, 73, 8, REGSP, LFROM, 0}, + Optab{AMOVHS, C_LOREG, C_NONE, C_REG, 73, 8, 0, LFROM, 0}, + Optab{AMOVHS, C_ADDR, C_NONE, C_REG, 93, 8, 0, LFROM | LPCREL, 4}, + Optab{AMOVHU, C_LAUTO, C_NONE, C_REG, 73, 8, REGSP, LFROM, 0}, + Optab{AMOVHU, C_LOREG, C_NONE, C_REG, 73, 8, 0, LFROM, 0}, + Optab{AMOVHU, C_ADDR, C_NONE, C_REG, 93, 8, 0, LFROM | LPCREL, 4}, + Optab{ALDREX, C_SOREG, C_NONE, C_REG, 77, 4, 0, 0, 0}, + Optab{ASTREX, C_SOREG, C_REG, C_REG, 78, 4, 0, 0, 0}, + Optab{AMOVF, C_ZFCON, C_NONE, C_FREG, 80, 8, 0, 0, 0}, + Optab{AMOVF, C_SFCON, C_NONE, C_FREG, 81, 4, 0, 0, 0}, + Optab{ACMPF, C_FREG, C_REG, C_NONE, 82, 8, 0, 0, 0}, + Optab{ACMPF, C_FREG, C_NONE, C_NONE, 83, 8, 0, 0, 0}, + Optab{AMOVFW, C_FREG, C_NONE, C_FREG, 84, 4, 0, 0, 0}, + Optab{AMOVWF, C_FREG, C_NONE, C_FREG, 85, 4, 0, 0, 0}, + Optab{AMOVFW, C_FREG, C_NONE, C_REG, 86, 8, 0, 0, 0}, + Optab{AMOVWF, C_REG, C_NONE, C_FREG, 87, 8, 0, 0, 0}, + Optab{AMOVW, C_REG, C_NONE, C_FREG, 88, 4, 0, 0, 0}, + Optab{AMOVW, C_FREG, C_NONE, C_REG, 89, 4, 0, 0, 0}, + Optab{ATST, C_REG, C_NONE, C_NONE, 90, 4, 0, 0, 0}, + Optab{ALDREXD, C_SOREG, C_NONE, C_REG, 91, 4, 0, 0, 0}, + Optab{ASTREXD, C_SOREG, C_REG, C_REG, 92, 4, 0, 0, 0}, + Optab{APLD, C_SOREG, C_NONE, C_NONE, 95, 4, 0, 0, 0}, + Optab{obj.AUNDEF, C_NONE, C_NONE, C_NONE, 96, 4, 0, 0, 0}, + Optab{ACLZ, C_REG, C_NONE, C_REG, 97, 4, 0, 0, 0}, + Optab{AMULWT, C_REG, C_REG, C_REG, 98, 4, 0, 0, 0}, + Optab{AMULAWT, C_REG, C_REG, C_REGREG2, 99, 4, 0, 0, 0}, + Optab{obj.AUSEFIELD, C_ADDR, C_NONE, C_NONE, 0, 0, 0, 0, 0}, + Optab{obj.APCDATA, C_LCON, C_NONE, C_LCON, 0, 0, 0, 0, 0}, + Optab{obj.AFUNCDATA, C_LCON, C_NONE, C_ADDR, 0, 0, 0, 0, 0}, + Optab{obj.ANOP, C_NONE, C_NONE, C_NONE, 0, 0, 0, 0, 0}, + Optab{obj.ADUFFZERO, C_NONE, C_NONE, C_SBRA, 5, 4, 0, 0, 0}, // same as ABL + Optab{obj.ADUFFCOPY, C_NONE, C_NONE, C_SBRA, 5, 4, 0, 0, 0}, // same as ABL + + Optab{ADATABUNDLE, C_NONE, C_NONE, C_NONE, 100, 4, 0, 0, 0}, + Optab{ADATABUNDLEEND, C_NONE, C_NONE, C_NONE, 100, 0, 0, 0, 0}, + Optab{obj.AXXX, C_NONE, C_NONE, C_NONE, 0, 4, 0, 0, 0}, +} + +var pool struct { + start uint32 + size uint32 + extra uint32 +} + +var oprange [ALAST & obj.AMask]Oprang + +var xcmp [C_GOK + 1][C_GOK + 1]uint8 + +var deferreturn *obj.LSym + +/* size of a case statement including jump table */ +func casesz(ctxt *obj.Link, p *obj.Prog) int32 { + var jt int = 0 + var n int32 = 0 + var o *Optab + + for ; p != nil; p = p.Link { + if p.As == ABCASE { + jt = 1 + } else if jt != 0 { + break + } + o = oplook(ctxt, p) + n += int32(o.size) + } + + return n +} + +// Note about encoding: Prog.scond holds the condition encoding, +// but XOR'ed with C_SCOND_XOR, so that C_SCOND_NONE == 0. +// The code that shifts the value << 28 has the responsibility +// for XORing with C_SCOND_XOR too. + +// asmoutnacl assembles the instruction p. It replaces asmout for NaCl. +// It returns the total number of bytes put in out, and it can change +// p->pc if extra padding is necessary. +// In rare cases, asmoutnacl might split p into two instructions. +// origPC is the PC for this Prog (no padding is taken into account). +func asmoutnacl(ctxt *obj.Link, origPC int32, p *obj.Prog, o *Optab, out []uint32) int { + size := int(o.size) + + // instruction specific + switch p.As { + default: + if out != nil { + asmout(ctxt, p, o, out) + } + + case ADATABUNDLE, // align to 16-byte boundary + ADATABUNDLEEND: // zero width instruction, just to align next instruction to 16-byte boundary + p.Pc = (p.Pc + 15) &^ 15 + + if out != nil { + asmout(ctxt, p, o, out) + } + + case obj.AUNDEF, + APLD: + size = 4 + if out != nil { + switch p.As { + case obj.AUNDEF: + out[0] = 0xe7fedef0 // NACL_INSTR_ARM_ABORT_NOW (UDF #0xEDE0) + + case APLD: + out[0] = 0xe1a01001 // (MOVW R1, R1) + } + } + + case AB, ABL: + if p.To.Type != obj.TYPE_MEM { + if out != nil { + asmout(ctxt, p, o, out) + } + } else { + if p.To.Offset != 0 || size != 4 || p.To.Reg > REG_R15 || p.To.Reg < REG_R0 { + ctxt.Diag("unsupported instruction: %v", p) + } + if p.Pc&15 == 12 { + p.Pc += 4 + } + if out != nil { + out[0] = ((uint32(p.Scond)&C_SCOND)^C_SCOND_XOR)<<28 | 0x03c0013f | (uint32(p.To.Reg)&15)<<12 | (uint32(p.To.Reg)&15)<<16 // BIC $0xc000000f, Rx + if p.As == AB { + out[1] = ((uint32(p.Scond)&C_SCOND)^C_SCOND_XOR)<<28 | 0x012fff10 | (uint32(p.To.Reg)&15)<<0 // BX Rx + } else { // ABL + out[1] = ((uint32(p.Scond)&C_SCOND)^C_SCOND_XOR)<<28 | 0x012fff30 | (uint32(p.To.Reg)&15)<<0 // BLX Rx + } + } + + size = 8 + } + + // align the last instruction (the actual BL) to the last instruction in a bundle + if p.As == ABL { + if deferreturn == nil { + deferreturn = obj.Linklookup(ctxt, "runtime.deferreturn", 0) + } + if p.To.Sym == deferreturn { + p.Pc = ((int64(origPC) + 15) &^ 15) + 16 - int64(size) + } else { + p.Pc += (16 - ((p.Pc + int64(size)) & 15)) & 15 + } + } + + case ALDREX, + ALDREXD, + AMOVB, + AMOVBS, + AMOVBU, + AMOVD, + AMOVF, + AMOVH, + AMOVHS, + AMOVHU, + AMOVM, + AMOVW, + ASTREX, + ASTREXD: + if p.To.Type == obj.TYPE_REG && p.To.Reg == REG_R15 && p.From.Reg == REG_R13 { // MOVW.W x(R13), PC + if out != nil { + asmout(ctxt, p, o, out) + } + if size == 4 { + if out != nil { + // Note: 5c and 5g reg.c know that DIV/MOD smashes R12 + // so that this return instruction expansion is valid. + out[0] = out[0] &^ 0x3000 // change PC to R12 + out[1] = ((uint32(p.Scond)&C_SCOND)^C_SCOND_XOR)<<28 | 0x03ccc13f // BIC $0xc000000f, R12 + out[2] = ((uint32(p.Scond)&C_SCOND)^C_SCOND_XOR)<<28 | 0x012fff1c // BX R12 + } + + size += 8 + if (p.Pc+int64(size))&15 == 4 { + p.Pc += 4 + } + break + } else { + // if the instruction used more than 4 bytes, then it must have used a very large + // offset to update R13, so we need to additionally mask R13. + if out != nil { + out[size/4-1] &^= 0x3000 // change PC to R12 + out[size/4] = ((uint32(p.Scond)&C_SCOND)^C_SCOND_XOR)<<28 | 0x03cdd103 // BIC $0xc0000000, R13 + out[size/4+1] = ((uint32(p.Scond)&C_SCOND)^C_SCOND_XOR)<<28 | 0x03ccc13f // BIC $0xc000000f, R12 + out[size/4+2] = ((uint32(p.Scond)&C_SCOND)^C_SCOND_XOR)<<28 | 0x012fff1c // BX R12 + } + + // p->pc+size is only ok at 4 or 12 mod 16. + if (p.Pc+int64(size))%8 == 0 { + p.Pc += 4 + } + size += 12 + break + } + } + + if p.To.Type == obj.TYPE_REG && p.To.Reg == REG_R15 { + ctxt.Diag("unsupported instruction (move to another register and use indirect jump instead): %v", p) + } + + if p.To.Type == obj.TYPE_MEM && p.To.Reg == REG_R13 && (p.Scond&C_WBIT != 0) && size > 4 { + // function prolog with very large frame size: MOVW.W R14,-100004(R13) + // split it into two instructions: + // ADD $-100004, R13 + // MOVW R14, 0(R13) + q := ctxt.NewProg() + + p.Scond &^= C_WBIT + *q = *p + a := &p.To + var a2 *obj.Addr + if p.To.Type == obj.TYPE_MEM { + a2 = &q.To + } else { + a2 = &q.From + } + obj.Nocache(q) + obj.Nocache(p) + + // insert q after p + q.Link = p.Link + + p.Link = q + q.Pcond = nil + + // make p into ADD $X, R13 + p.As = AADD + + p.From = *a + p.From.Reg = 0 + p.From.Type = obj.TYPE_CONST + p.To = obj.Addr{} + p.To.Type = obj.TYPE_REG + p.To.Reg = REG_R13 + + // make q into p but load/store from 0(R13) + q.Spadj = 0 + + *a2 = obj.Addr{} + a2.Type = obj.TYPE_MEM + a2.Reg = REG_R13 + a2.Sym = nil + a2.Offset = 0 + size = int(oplook(ctxt, p).size) + break + } + + if (p.To.Type == obj.TYPE_MEM && p.To.Reg != REG_R9) || // MOVW Rx, X(Ry), y != 9 + (p.From.Type == obj.TYPE_MEM && p.From.Reg != REG_R9) { // MOVW X(Rx), Ry, x != 9 + var a *obj.Addr + if p.To.Type == obj.TYPE_MEM { + a = &p.To + } else { + a = &p.From + } + reg := int(a.Reg) + if size == 4 { + // if addr.reg == 0, then it is probably load from x(FP) with small x, no need to modify. + if reg == 0 { + if out != nil { + asmout(ctxt, p, o, out) + } + } else { + if out != nil { + out[0] = ((uint32(p.Scond)&C_SCOND)^C_SCOND_XOR)<<28 | 0x03c00103 | (uint32(reg)&15)<<16 | (uint32(reg)&15)<<12 // BIC $0xc0000000, Rx + } + if p.Pc&15 == 12 { + p.Pc += 4 + } + size += 4 + if out != nil { + asmout(ctxt, p, o, out[1:]) + } + } + + break + } else { + // if a load/store instruction takes more than 1 word to implement, then + // we need to separate the instruction into two: + // 1. explicitly load the address into R11. + // 2. load/store from R11. + // This won't handle .W/.P, so we should reject such code. + if p.Scond&(C_PBIT|C_WBIT) != 0 { + ctxt.Diag("unsupported instruction (.P/.W): %v", p) + } + q := ctxt.NewProg() + *q = *p + var a2 *obj.Addr + if p.To.Type == obj.TYPE_MEM { + a2 = &q.To + } else { + a2 = &q.From + } + obj.Nocache(q) + obj.Nocache(p) + + // insert q after p + q.Link = p.Link + + p.Link = q + q.Pcond = nil + + // make p into MOVW $X(R), R11 + p.As = AMOVW + + p.From = *a + p.From.Type = obj.TYPE_ADDR + p.To = obj.Addr{} + p.To.Type = obj.TYPE_REG + p.To.Reg = REG_R11 + + // make q into p but load/store from 0(R11) + *a2 = obj.Addr{} + + a2.Type = obj.TYPE_MEM + a2.Reg = REG_R11 + a2.Sym = nil + a2.Offset = 0 + size = int(oplook(ctxt, p).size) + break + } + } else if out != nil { + asmout(ctxt, p, o, out) + } + } + + // destination register specific + if p.To.Type == obj.TYPE_REG { + switch p.To.Reg { + case REG_R9: + ctxt.Diag("invalid instruction, cannot write to R9: %v", p) + + case REG_R13: + if out != nil { + out[size/4] = 0xe3cdd103 // BIC $0xc0000000, R13 + } + if (p.Pc+int64(size))&15 == 0 { + p.Pc += 4 + } + size += 4 + } + } + + return size +} + +func span5(ctxt *obj.Link, cursym *obj.LSym) { + var p *obj.Prog + var op *obj.Prog + + p = cursym.Text + if p == nil || p.Link == nil { // handle external functions and ELF section symbols + return + } + + if oprange[AAND&obj.AMask].start == nil { + buildop(ctxt) + } + + ctxt.Cursym = cursym + + ctxt.Autosize = int32(p.To.Offset + 4) + c := int32(0) + + op = p + p = p.Link + var i int + var m int + var o *Optab + for ; p != nil || ctxt.Blitrl != nil; op, p = p, p.Link { + if p == nil { + if checkpool(ctxt, op, 0) { + p = op + continue + } + + // can't happen: blitrl is not nil, but checkpool didn't flushpool + ctxt.Diag("internal inconsistency") + + break + } + + ctxt.Curp = p + p.Pc = int64(c) + o = oplook(ctxt, p) + if ctxt.Headtype != obj.Hnacl { + m = int(o.size) + } else { + m = asmoutnacl(ctxt, c, p, o, nil) + c = int32(p.Pc) // asmoutnacl might change pc for alignment + o = oplook(ctxt, p) // asmoutnacl might change p in rare cases + } + + if m%4 != 0 || p.Pc%4 != 0 { + ctxt.Diag("!pc invalid: %v size=%d", p, m) + } + + // must check literal pool here in case p generates many instructions + if ctxt.Blitrl != nil { + i = m + if p.As == ACASE { + i = int(casesz(ctxt, p)) + } + if checkpool(ctxt, op, i) { + p = op + continue + } + } + + if m == 0 && (p.As != obj.AFUNCDATA && p.As != obj.APCDATA && p.As != ADATABUNDLEEND && p.As != obj.ANOP) { + ctxt.Diag("zero-width instruction\n%v", p) + continue + } + + switch o.flag & (LFROM | LTO | LPOOL) { + case LFROM: + addpool(ctxt, p, &p.From) + + case LTO: + addpool(ctxt, p, &p.To) + + case LPOOL: + if p.Scond&C_SCOND == C_SCOND_NONE { + flushpool(ctxt, p, 0, 0) + } + } + + if p.As == AMOVW && p.To.Type == obj.TYPE_REG && p.To.Reg == REGPC && p.Scond&C_SCOND == C_SCOND_NONE { + flushpool(ctxt, p, 0, 0) + } + c += int32(m) + } + + cursym.Size = int64(c) + + /* + * if any procedure is large enough to + * generate a large SBRA branch, then + * generate extra passes putting branches + * around jmps to fix. this is rare. + */ + times := 0 + + var bflag int + var opc int32 + var out [6 + 3]uint32 + for { + if ctxt.Debugvlog != 0 { + fmt.Fprintf(ctxt.Bso, "%5.2f span1\n", obj.Cputime()) + } + bflag = 0 + c = 0 + times++ + cursym.Text.Pc = 0 // force re-layout the code. + for p = cursym.Text; p != nil; p = p.Link { + ctxt.Curp = p + o = oplook(ctxt, p) + if int64(c) > p.Pc { + p.Pc = int64(c) + } + + /* very large branches + if(o->type == 6 && p->pcond) { + otxt = p->pcond->pc - c; + if(otxt < 0) + otxt = -otxt; + if(otxt >= (1L<<17) - 10) { + q = emallocz(sizeof(Prog)); + q->link = p->link; + p->link = q; + q->as = AB; + q->to.type = TYPE_BRANCH; + q->pcond = p->pcond; + p->pcond = q; + q = emallocz(sizeof(Prog)); + q->link = p->link; + p->link = q; + q->as = AB; + q->to.type = TYPE_BRANCH; + q->pcond = q->link->link; + bflag = 1; + } + } + */ + opc = int32(p.Pc) + + if ctxt.Headtype != obj.Hnacl { + m = int(o.size) + } else { + m = asmoutnacl(ctxt, c, p, o, nil) + } + if p.Pc != int64(opc) { + bflag = 1 + } + + //print("%v pc changed %d to %d in iter. %d\n", p, opc, (int32)p->pc, times); + c = int32(p.Pc + int64(m)) + + if m%4 != 0 || p.Pc%4 != 0 { + ctxt.Diag("pc invalid: %v size=%d", p, m) + } + + if m/4 > len(out) { + ctxt.Diag("instruction size too large: %d > %d", m/4, len(out)) + } + if m == 0 && (p.As != obj.AFUNCDATA && p.As != obj.APCDATA && p.As != ADATABUNDLEEND && p.As != obj.ANOP) { + if p.As == obj.ATEXT { + ctxt.Autosize = int32(p.To.Offset + 4) + continue + } + + ctxt.Diag("zero-width instruction\n%v", p) + continue + } + } + + cursym.Size = int64(c) + if bflag == 0 { + break + } + } + + if c%4 != 0 { + ctxt.Diag("sym->size=%d, invalid", c) + } + + /* + * lay out the code. all the pc-relative code references, + * even cross-function, are resolved now; + * only data references need to be relocated. + * with more work we could leave cross-function + * code references to be relocated too, and then + * perhaps we'd be able to parallelize the span loop above. + */ + if ctxt.Tlsg == nil { + ctxt.Tlsg = obj.Linklookup(ctxt, "runtime.tlsg", 0) + } + + p = cursym.Text + ctxt.Autosize = int32(p.To.Offset + 4) + obj.Symgrow(ctxt, cursym, cursym.Size) + + bp := cursym.P + c = int32(p.Pc) // even p->link might need extra padding + var v int + for p = p.Link; p != nil; p = p.Link { + ctxt.Pc = p.Pc + ctxt.Curp = p + o = oplook(ctxt, p) + opc = int32(p.Pc) + if ctxt.Headtype != obj.Hnacl { + asmout(ctxt, p, o, out[:]) + m = int(o.size) + } else { + m = asmoutnacl(ctxt, c, p, o, out[:]) + if int64(opc) != p.Pc { + ctxt.Diag("asmoutnacl broken: pc changed (%d->%d) in last stage: %v", opc, int32(p.Pc), p) + } + } + + if m%4 != 0 || p.Pc%4 != 0 { + ctxt.Diag("final stage: pc invalid: %v size=%d", p, m) + } + + if int64(c) > p.Pc { + ctxt.Diag("PC padding invalid: want %#d, has %#d: %v", p.Pc, c, p) + } + for int64(c) != p.Pc { + // emit 0xe1a00000 (MOVW R0, R0) + bp[0] = 0x00 + bp = bp[1:] + + bp[0] = 0x00 + bp = bp[1:] + bp[0] = 0xa0 + bp = bp[1:] + bp[0] = 0xe1 + bp = bp[1:] + c += 4 + } + + for i = 0; i < m/4; i++ { + v = int(out[i]) + bp[0] = byte(v) + bp = bp[1:] + bp[0] = byte(v >> 8) + bp = bp[1:] + bp[0] = byte(v >> 16) + bp = bp[1:] + bp[0] = byte(v >> 24) + bp = bp[1:] + } + + c += int32(m) + } +} + +/* + * when the first reference to the literal pool threatens + * to go out of range of a 12-bit PC-relative offset, + * drop the pool now, and branch round it. + * this happens only in extended basic blocks that exceed 4k. + */ +func checkpool(ctxt *obj.Link, p *obj.Prog, sz int) bool { + if pool.size >= 0xff0 || immaddr(int32((p.Pc+int64(sz)+4)+4+int64(12+pool.size)-int64(pool.start+8))) == 0 { + return flushpool(ctxt, p, 1, 0) + } else if p.Link == nil { + return flushpool(ctxt, p, 2, 0) + } + return false +} + +func flushpool(ctxt *obj.Link, p *obj.Prog, skip int, force int) bool { + if ctxt.Blitrl != nil { + if skip != 0 { + if false && skip == 1 { + fmt.Printf("note: flush literal pool at %x: len=%d ref=%x\n", uint64(p.Pc+4), pool.size, pool.start) + } + q := ctxt.NewProg() + q.As = AB + q.To.Type = obj.TYPE_BRANCH + q.Pcond = p.Link + q.Link = ctxt.Blitrl + q.Lineno = p.Lineno + ctxt.Blitrl = q + } else if force == 0 && (p.Pc+int64(12+pool.size)-int64(pool.start) < 2048) { // 12 take into account the maximum nacl literal pool alignment padding size + return false + } + if ctxt.Headtype == obj.Hnacl && pool.size%16 != 0 { + // if pool is not multiple of 16 bytes, add an alignment marker + q := ctxt.NewProg() + + q.As = ADATABUNDLEEND + ctxt.Elitrl.Link = q + ctxt.Elitrl = q + } + + // The line number for constant pool entries doesn't really matter. + // We set it to the line number of the preceding instruction so that + // there are no deltas to encode in the pc-line tables. + for q := ctxt.Blitrl; q != nil; q = q.Link { + q.Lineno = p.Lineno + } + + ctxt.Elitrl.Link = p.Link + p.Link = ctxt.Blitrl + + ctxt.Blitrl = nil /* BUG: should refer back to values until out-of-range */ + ctxt.Elitrl = nil + pool.size = 0 + pool.start = 0 + pool.extra = 0 + return true + } + + return false +} + +func addpool(ctxt *obj.Link, p *obj.Prog, a *obj.Addr) { + var t obj.Prog + + c := aclass(ctxt, a) + + t.Ctxt = ctxt + t.As = AWORD + + switch c { + default: + t.To.Offset = a.Offset + t.To.Sym = a.Sym + t.To.Type = a.Type + t.To.Name = a.Name + + if ctxt.Flag_shared != 0 && t.To.Sym != nil { + t.Rel = p + } + + case C_SROREG, + C_LOREG, + C_ROREG, + C_FOREG, + C_SOREG, + C_HOREG, + C_FAUTO, + C_SAUTO, + C_LAUTO, + C_LACON: + t.To.Type = obj.TYPE_CONST + t.To.Offset = ctxt.Instoffset + } + + if t.Rel == nil { + for q := ctxt.Blitrl; q != nil; q = q.Link { /* could hash on t.t0.offset */ + if q.Rel == nil && q.To == t.To { + p.Pcond = q + return + } + } + } + + if ctxt.Headtype == obj.Hnacl && pool.size%16 == 0 { + // start a new data bundle + q := ctxt.NewProg() + q.As = ADATABUNDLE + q.Pc = int64(pool.size) + pool.size += 4 + if ctxt.Blitrl == nil { + ctxt.Blitrl = q + pool.start = uint32(p.Pc) + } else { + ctxt.Elitrl.Link = q + } + + ctxt.Elitrl = q + } + + q := ctxt.NewProg() + *q = t + q.Pc = int64(pool.size) + + if ctxt.Blitrl == nil { + ctxt.Blitrl = q + pool.start = uint32(p.Pc) + } else { + ctxt.Elitrl.Link = q + } + ctxt.Elitrl = q + pool.size += 4 + + p.Pcond = q +} + +func regoff(ctxt *obj.Link, a *obj.Addr) int32 { + ctxt.Instoffset = 0 + aclass(ctxt, a) + return int32(ctxt.Instoffset) +} + +func immrot(v uint32) int32 { + for i := 0; i < 16; i++ { + if v&^0xff == 0 { + return int32(uint32(int32(i)<<8) | v | 1<<25) + } + v = v<<2 | v>>30 + } + + return 0 +} + +func immaddr(v int32) int32 { + if v >= 0 && v <= 0xfff { + return v&0xfff | 1<<24 | 1<<23 /* pre indexing */ /* pre indexing, up */ + } + if v >= -0xfff && v < 0 { + return -v&0xfff | 1<<24 /* pre indexing */ + } + return 0 +} + +func immfloat(v int32) bool { + return v&0xC03 == 0 /* offset will fit in floating-point load/store */ +} + +func immhalf(v int32) bool { + if v >= 0 && v <= 0xff { + return v|1<<24|1<<23 != 0 /* pre indexing */ /* pre indexing, up */ + } + if v >= -0xff && v < 0 { + return -v&0xff|1<<24 != 0 /* pre indexing */ + } + return false +} + +func aclass(ctxt *obj.Link, a *obj.Addr) int { + switch a.Type { + case obj.TYPE_NONE: + return C_NONE + + case obj.TYPE_REG: + if REG_R0 <= a.Reg && a.Reg <= REG_R15 { + return C_REG + } + if REG_F0 <= a.Reg && a.Reg <= REG_F15 { + return C_FREG + } + if a.Reg == REG_FPSR || a.Reg == REG_FPCR { + return C_FCR + } + if a.Reg == REG_CPSR || a.Reg == REG_SPSR { + return C_PSR + } + return C_GOK + + case obj.TYPE_REGREG: + return C_REGREG + + case obj.TYPE_REGREG2: + return C_REGREG2 + + case obj.TYPE_REGLIST: + return C_REGLIST + + case obj.TYPE_SHIFT: + return C_SHIFT + + case obj.TYPE_MEM: + switch a.Name { + case obj.NAME_EXTERN, + obj.NAME_STATIC: + if a.Sym == nil || a.Sym.Name == "" { + fmt.Printf("null sym external\n") + return C_GOK + } + + ctxt.Instoffset = 0 // s.b. unused but just in case + return C_ADDR + + case obj.NAME_AUTO: + ctxt.Instoffset = int64(ctxt.Autosize) + a.Offset + t := int(immaddr(int32(ctxt.Instoffset))) + if t != 0 { + if immhalf(int32(ctxt.Instoffset)) { + if immfloat(int32(t)) { + return C_HFAUTO + } + return C_HAUTO + } + + if immfloat(int32(t)) { + return C_FAUTO + } + return C_SAUTO + } + + return C_LAUTO + + case obj.NAME_PARAM: + ctxt.Instoffset = int64(ctxt.Autosize) + a.Offset + 4 + t := int(immaddr(int32(ctxt.Instoffset))) + if t != 0 { + if immhalf(int32(ctxt.Instoffset)) { + if immfloat(int32(t)) { + return C_HFAUTO + } + return C_HAUTO + } + + if immfloat(int32(t)) { + return C_FAUTO + } + return C_SAUTO + } + + return C_LAUTO + + case obj.TYPE_NONE: + ctxt.Instoffset = a.Offset + t := int(immaddr(int32(ctxt.Instoffset))) + if t != 0 { + if immhalf(int32(ctxt.Instoffset)) { /* n.b. that it will also satisfy immrot */ + if immfloat(int32(t)) { + return C_HFOREG + } + return C_HOREG + } + + if immfloat(int32(t)) { + return C_FOREG /* n.b. that it will also satisfy immrot */ + } + t := int(immrot(uint32(ctxt.Instoffset))) + if t != 0 { + return C_SROREG + } + if immhalf(int32(ctxt.Instoffset)) { + return C_HOREG + } + return C_SOREG + } + + t = int(immrot(uint32(ctxt.Instoffset))) + if t != 0 { + return C_ROREG + } + return C_LOREG + } + + return C_GOK + + case obj.TYPE_FCONST: + if chipzero5(ctxt, a.Val.(float64)) >= 0 { + return C_ZFCON + } + if chipfloat5(ctxt, a.Val.(float64)) >= 0 { + return C_SFCON + } + return C_LFCON + + case obj.TYPE_TEXTSIZE: + return C_TEXTSIZE + + case obj.TYPE_CONST, + obj.TYPE_ADDR: + switch a.Name { + case obj.TYPE_NONE: + ctxt.Instoffset = a.Offset + if a.Reg != 0 { + return aconsize(ctxt) + } + + t := int(immrot(uint32(ctxt.Instoffset))) + if t != 0 { + return C_RCON + } + t = int(immrot(^uint32(ctxt.Instoffset))) + if t != 0 { + return C_NCON + } + return C_LCON + + case obj.NAME_EXTERN, + obj.NAME_STATIC: + s := a.Sym + if s == nil { + break + } + ctxt.Instoffset = 0 // s.b. unused but just in case + return C_LCONADDR + + case obj.NAME_AUTO: + ctxt.Instoffset = int64(ctxt.Autosize) + a.Offset + return aconsize(ctxt) + + case obj.NAME_PARAM: + ctxt.Instoffset = int64(ctxt.Autosize) + a.Offset + 4 + return aconsize(ctxt) + } + + return C_GOK + + case obj.TYPE_BRANCH: + return C_SBRA + } + + return C_GOK +} + +func aconsize(ctxt *obj.Link) int { + t := int(immrot(uint32(ctxt.Instoffset))) + if t != 0 { + return C_RACON + } + return C_LACON +} + +func prasm(p *obj.Prog) { + fmt.Printf("%v\n", p) +} + +func oplook(ctxt *obj.Link, p *obj.Prog) *Optab { + a1 := int(p.Optab) + if a1 != 0 { + return &optab[a1-1:][0] + } + a1 = int(p.From.Class) + if a1 == 0 { + a1 = aclass(ctxt, &p.From) + 1 + p.From.Class = int8(a1) + } + + a1-- + a3 := int(p.To.Class) + if a3 == 0 { + a3 = aclass(ctxt, &p.To) + 1 + p.To.Class = int8(a3) + } + + a3-- + a2 := C_NONE + if p.Reg != 0 { + a2 = C_REG + } + r := p.As & obj.AMask + o := oprange[r].start + if o == nil { + o = oprange[r].stop /* just generate an error */ + } + + if false { /*debug['O']*/ + fmt.Printf("oplook %v %v %v %v\n", obj.Aconv(int(p.As)), DRconv(a1), DRconv(a2), DRconv(a3)) + fmt.Printf("\t\t%d %d\n", p.From.Type, p.To.Type) + } + + e := oprange[r].stop + c1 := xcmp[a1][:] + c3 := xcmp[a3][:] + for ; -cap(o) < -cap(e); o = o[1:] { + if int(o[0].a2) == a2 { + if c1[o[0].a1] != 0 { + if c3[o[0].a3] != 0 { + p.Optab = uint16((-cap(o) + cap(optab)) + 1) + return &o[0] + } + } + } + } + + ctxt.Diag("illegal combination %v; %v %v %v, %d %d", p, DRconv(a1), DRconv(a2), DRconv(a3), p.From.Type, p.To.Type) + ctxt.Diag("from %d %d to %d %d\n", p.From.Type, p.From.Name, p.To.Type, p.To.Name) + prasm(p) + if o == nil { + o = optab + } + return &o[0] +} + +func cmp(a int, b int) bool { + if a == b { + return true + } + switch a { + case C_LCON: + if b == C_RCON || b == C_NCON { + return true + } + + case C_LACON: + if b == C_RACON { + return true + } + + case C_LFCON: + if b == C_ZFCON || b == C_SFCON { + return true + } + + case C_HFAUTO: + return b == C_HAUTO || b == C_FAUTO + + case C_FAUTO, C_HAUTO: + return b == C_HFAUTO + + case C_SAUTO: + return cmp(C_HFAUTO, b) + + case C_LAUTO: + return cmp(C_SAUTO, b) + + case C_HFOREG: + return b == C_HOREG || b == C_FOREG + + case C_FOREG, C_HOREG: + return b == C_HFOREG + + case C_SROREG: + return cmp(C_SOREG, b) || cmp(C_ROREG, b) + + case C_SOREG, C_ROREG: + return b == C_SROREG || cmp(C_HFOREG, b) + + case C_LOREG: + return cmp(C_SROREG, b) + + case C_LBRA: + if b == C_SBRA { + return true + } + + case C_HREG: + return cmp(C_SP, b) || cmp(C_PC, b) + } + + return false +} + +type ocmp []Optab + +func (x ocmp) Len() int { + return len(x) +} + +func (x ocmp) Swap(i, j int) { + x[i], x[j] = x[j], x[i] +} + +func (x ocmp) Less(i, j int) bool { + p1 := &x[i] + p2 := &x[j] + n := int(p1.as) - int(p2.as) + if n != 0 { + return n < 0 + } + n = int(p1.a1) - int(p2.a1) + if n != 0 { + return n < 0 + } + n = int(p1.a2) - int(p2.a2) + if n != 0 { + return n < 0 + } + n = int(p1.a3) - int(p2.a3) + if n != 0 { + return n < 0 + } + return false +} + +func opset(a, b0 uint16) { + oprange[a&obj.AMask] = oprange[b0] +} + +func buildop(ctxt *obj.Link) { + var n int + + for i := 0; i < C_GOK; i++ { + for n = 0; n < C_GOK; n++ { + if cmp(n, i) { + xcmp[i][n] = 1 + } + } + } + for n = 0; optab[n].as != obj.AXXX; n++ { + if optab[n].flag&LPCREL != 0 { + if ctxt.Flag_shared != 0 { + optab[n].size += int8(optab[n].pcrelsiz) + } else { + optab[n].flag &^= LPCREL + } + } + } + + sort.Sort(ocmp(optab[:n])) + for i := 0; i < n; i++ { + r := optab[i].as + r0 := r & obj.AMask + oprange[r0].start = optab[i:] + for optab[i].as == r { + i++ + } + oprange[r0].stop = optab[i:] + i-- + + switch r { + default: + ctxt.Diag("unknown op in build: %v", obj.Aconv(int(r))) + log.Fatalf("bad code") + + case AADD: + opset(AAND, r0) + opset(AEOR, r0) + opset(ASUB, r0) + opset(ARSB, r0) + opset(AADC, r0) + opset(ASBC, r0) + opset(ARSC, r0) + opset(AORR, r0) + opset(ABIC, r0) + + case ACMP: + opset(ATEQ, r0) + opset(ACMN, r0) + + case AMVN: + break + + case ABEQ: + opset(ABNE, r0) + opset(ABCS, r0) + opset(ABHS, r0) + opset(ABCC, r0) + opset(ABLO, r0) + opset(ABMI, r0) + opset(ABPL, r0) + opset(ABVS, r0) + opset(ABVC, r0) + opset(ABHI, r0) + opset(ABLS, r0) + opset(ABGE, r0) + opset(ABLT, r0) + opset(ABGT, r0) + opset(ABLE, r0) + + case ASLL: + opset(ASRL, r0) + opset(ASRA, r0) + + case AMUL: + opset(AMULU, r0) + + case ADIV: + opset(AMOD, r0) + opset(AMODU, r0) + opset(ADIVU, r0) + + case AMOVW, + AMOVB, + AMOVBS, + AMOVBU, + AMOVH, + AMOVHS, + AMOVHU: + break + + case ASWPW: + opset(ASWPBU, r0) + + case AB, + ABL, + ABX, + ABXRET, + obj.ADUFFZERO, + obj.ADUFFCOPY, + ASWI, + AWORD, + AMOVM, + ARFE, + obj.ATEXT, + obj.AUSEFIELD, + ACASE, + ABCASE, + obj.ATYPE: + break + + case AADDF: + opset(AADDD, r0) + opset(ASUBF, r0) + opset(ASUBD, r0) + opset(AMULF, r0) + opset(AMULD, r0) + opset(ADIVF, r0) + opset(ADIVD, r0) + opset(ASQRTF, r0) + opset(ASQRTD, r0) + opset(AMOVFD, r0) + opset(AMOVDF, r0) + opset(AABSF, r0) + opset(AABSD, r0) + + case ACMPF: + opset(ACMPD, r0) + + case AMOVF: + opset(AMOVD, r0) + + case AMOVFW: + opset(AMOVDW, r0) + + case AMOVWF: + opset(AMOVWD, r0) + + case AMULL: + opset(AMULAL, r0) + opset(AMULLU, r0) + opset(AMULALU, r0) + + case AMULWT: + opset(AMULWB, r0) + + case AMULAWT: + opset(AMULAWB, r0) + + case AMULA, + ALDREX, + ASTREX, + ALDREXD, + ASTREXD, + ATST, + APLD, + obj.AUNDEF, + ACLZ, + obj.AFUNCDATA, + obj.APCDATA, + obj.ANOP, + ADATABUNDLE, + ADATABUNDLEEND: + break + } + } +} + +func asmout(ctxt *obj.Link, p *obj.Prog, o *Optab, out []uint32) { + ctxt.Printp = p + o1 := uint32(0) + o2 := uint32(0) + o3 := uint32(0) + o4 := uint32(0) + o5 := uint32(0) + o6 := uint32(0) + ctxt.Armsize += int32(o.size) + if false { /*debug['P']*/ + fmt.Printf("%x: %v\ttype %d\n", uint32(p.Pc), p, o.type_) + } + switch o.type_ { + default: + ctxt.Diag("unknown asm %d", o.type_) + prasm(p) + + case 0: /* pseudo ops */ + if false { /*debug['G']*/ + fmt.Printf("%x: %s: arm\n", uint32(p.Pc), p.From.Sym.Name) + } + + case 1: /* op R,[R],R */ + o1 = oprrr(ctxt, int(p.As), int(p.Scond)) + + rf := int(p.From.Reg) + rt := int(p.To.Reg) + r := int(p.Reg) + if p.To.Type == obj.TYPE_NONE { + rt = 0 + } + if p.As == AMOVB || p.As == AMOVH || p.As == AMOVW || p.As == AMVN { + r = 0 + } else if r == 0 { + r = rt + } + o1 |= (uint32(rf)&15)<<0 | (uint32(r)&15)<<16 | (uint32(rt)&15)<<12 + + case 2: /* movbu $I,[R],R */ + aclass(ctxt, &p.From) + + o1 = oprrr(ctxt, int(p.As), int(p.Scond)) + o1 |= uint32(immrot(uint32(ctxt.Instoffset))) + rt := int(p.To.Reg) + r := int(p.Reg) + if p.To.Type == obj.TYPE_NONE { + rt = 0 + } + if p.As == AMOVW || p.As == AMVN { + r = 0 + } else if r == 0 { + r = rt + } + o1 |= (uint32(r)&15)<<16 | (uint32(rt)&15)<<12 + + case 3: /* add R<<[IR],[R],R */ + o1 = mov(ctxt, p) + + case 4: /* add $I,[R],R */ + aclass(ctxt, &p.From) + + o1 = oprrr(ctxt, AADD, int(p.Scond)) + o1 |= uint32(immrot(uint32(ctxt.Instoffset))) + r := int(p.From.Reg) + if r == 0 { + r = int(o.param) + } + o1 |= (uint32(r) & 15) << 16 + o1 |= (uint32(p.To.Reg) & 15) << 12 + + case 5: /* bra s */ + o1 = opbra(ctxt, int(p.As), int(p.Scond)) + + v := int32(-8) + if p.To.Sym != nil { + rel := obj.Addrel(ctxt.Cursym) + rel.Off = int32(ctxt.Pc) + rel.Siz = 4 + rel.Sym = p.To.Sym + v += int32(p.To.Offset) + rel.Add = int64(o1) | (int64(v)>>2)&0xffffff + rel.Type = obj.R_CALLARM + break + } + + if p.Pcond != nil { + v = int32((p.Pcond.Pc - ctxt.Pc) - 8) + } + o1 |= (uint32(v) >> 2) & 0xffffff + + case 6: /* b ,O(R) -> add $O,R,PC */ + aclass(ctxt, &p.To) + + o1 = oprrr(ctxt, AADD, int(p.Scond)) + o1 |= uint32(immrot(uint32(ctxt.Instoffset))) + o1 |= (uint32(p.To.Reg) & 15) << 16 + o1 |= (REGPC & 15) << 12 + + case 7: /* bl (R) -> blx R */ + aclass(ctxt, &p.To) + + if ctxt.Instoffset != 0 { + ctxt.Diag("%v: doesn't support BL offset(REG) where offset != 0", p) + } + o1 = oprrr(ctxt, ABL, int(p.Scond)) + o1 |= (uint32(p.To.Reg) & 15) << 0 + rel := obj.Addrel(ctxt.Cursym) + rel.Off = int32(ctxt.Pc) + rel.Siz = 0 + rel.Type = obj.R_CALLIND + + case 8: /* sll $c,[R],R -> mov (R<<$c),R */ + aclass(ctxt, &p.From) + + o1 = oprrr(ctxt, int(p.As), int(p.Scond)) + r := int(p.Reg) + if r == 0 { + r = int(p.To.Reg) + } + o1 |= (uint32(r) & 15) << 0 + o1 |= uint32((ctxt.Instoffset & 31) << 7) + o1 |= (uint32(p.To.Reg) & 15) << 12 + + case 9: /* sll R,[R],R -> mov (R< lr */ + aclass(ctxt, &p.From) + + r := int(p.From.Reg) + if r == 0 { + r = int(o.param) + } + o1 = olr(ctxt, int32(ctxt.Instoffset), r, int(p.To.Reg), int(p.Scond)) + if p.As != AMOVW { + o1 |= 1 << 22 + } + + case 30: /* mov/movb/movbu R,L(R) */ + o1 = omvl(ctxt, p, &p.To, REGTMP) + + if o1 == 0 { + break + } + r := int(p.To.Reg) + if r == 0 { + r = int(o.param) + } + o2 = osrr(ctxt, int(p.From.Reg), REGTMP&15, r, int(p.Scond)) + if p.As != AMOVW { + o2 |= 1 << 22 + } + + case 31: /* mov/movbu L(R),R -> lr[b] */ + o1 = omvl(ctxt, p, &p.From, REGTMP) + + if o1 == 0 { + break + } + r := int(p.From.Reg) + if r == 0 { + r = int(o.param) + } + o2 = olrr(ctxt, REGTMP&15, r, int(p.To.Reg), int(p.Scond)) + if p.As == AMOVBU || p.As == AMOVBS || p.As == AMOVB { + o2 |= 1 << 22 + } + + case 34: /* mov $lacon,R */ + o1 = omvl(ctxt, p, &p.From, REGTMP) + + if o1 == 0 { + break + } + + o2 = oprrr(ctxt, AADD, int(p.Scond)) + o2 |= REGTMP & 15 + r := int(p.From.Reg) + if r == 0 { + r = int(o.param) + } + o2 |= (uint32(r) & 15) << 16 + if p.To.Type != obj.TYPE_NONE { + o2 |= (uint32(p.To.Reg) & 15) << 12 + } + + case 35: /* mov PSR,R */ + o1 = 2<<23 | 0xf<<16 | 0<<0 + + o1 |= ((uint32(p.Scond) & C_SCOND) ^ C_SCOND_XOR) << 28 + o1 |= (uint32(p.From.Reg) & 1) << 22 + o1 |= (uint32(p.To.Reg) & 15) << 12 + + case 36: /* mov R,PSR */ + o1 = 2<<23 | 0x29f<<12 | 0<<4 + + if p.Scond&C_FBIT != 0 { + o1 ^= 0x010 << 12 + } + o1 |= ((uint32(p.Scond) & C_SCOND) ^ C_SCOND_XOR) << 28 + o1 |= (uint32(p.To.Reg) & 1) << 22 + o1 |= (uint32(p.From.Reg) & 15) << 0 + + case 37: /* mov $con,PSR */ + aclass(ctxt, &p.From) + + o1 = 2<<23 | 0x29f<<12 | 0<<4 + if p.Scond&C_FBIT != 0 { + o1 ^= 0x010 << 12 + } + o1 |= ((uint32(p.Scond) & C_SCOND) ^ C_SCOND_XOR) << 28 + o1 |= uint32(immrot(uint32(ctxt.Instoffset))) + o1 |= (uint32(p.To.Reg) & 1) << 22 + o1 |= (uint32(p.From.Reg) & 15) << 0 + + case 38, 39: + switch o.type_ { + case 38: /* movm $con,oreg -> stm */ + o1 = 0x4 << 25 + + o1 |= uint32(p.From.Offset & 0xffff) + o1 |= (uint32(p.To.Reg) & 15) << 16 + aclass(ctxt, &p.To) + + case 39: /* movm oreg,$con -> ldm */ + o1 = 0x4<<25 | 1<<20 + + o1 |= uint32(p.To.Offset & 0xffff) + o1 |= (uint32(p.From.Reg) & 15) << 16 + aclass(ctxt, &p.From) + } + + if ctxt.Instoffset != 0 { + ctxt.Diag("offset must be zero in MOVM; %v", p) + } + o1 |= ((uint32(p.Scond) & C_SCOND) ^ C_SCOND_XOR) << 28 + if p.Scond&C_PBIT != 0 { + o1 |= 1 << 24 + } + if p.Scond&C_UBIT != 0 { + o1 |= 1 << 23 + } + if p.Scond&C_SBIT != 0 { + o1 |= 1 << 22 + } + if p.Scond&C_WBIT != 0 { + o1 |= 1 << 21 + } + + case 40: /* swp oreg,reg,reg */ + aclass(ctxt, &p.From) + + if ctxt.Instoffset != 0 { + ctxt.Diag("offset must be zero in SWP") + } + o1 = 0x2<<23 | 0x9<<4 + if p.As != ASWPW { + o1 |= 1 << 22 + } + o1 |= (uint32(p.From.Reg) & 15) << 16 + o1 |= (uint32(p.Reg) & 15) << 0 + o1 |= (uint32(p.To.Reg) & 15) << 12 + o1 |= ((uint32(p.Scond) & C_SCOND) ^ C_SCOND_XOR) << 28 + + case 41: /* rfe -> movm.s.w.u 0(r13),[r15] */ + o1 = 0xe8fd8000 + + case 50: /* floating point store */ + v := regoff(ctxt, &p.To) + + r := int(p.To.Reg) + if r == 0 { + r = int(o.param) + } + o1 = ofsr(ctxt, int(p.As), int(p.From.Reg), v, r, int(p.Scond), p) + + case 51: /* floating point load */ + v := regoff(ctxt, &p.From) + + r := int(p.From.Reg) + if r == 0 { + r = int(o.param) + } + o1 = ofsr(ctxt, int(p.As), int(p.To.Reg), v, r, int(p.Scond), p) | 1<<20 + + case 52: /* floating point store, int32 offset UGLY */ + o1 = omvl(ctxt, p, &p.To, REGTMP) + + if o1 == 0 { + break + } + r := int(p.To.Reg) + if r == 0 { + r = int(o.param) + } + o2 = oprrr(ctxt, AADD, int(p.Scond)) | (REGTMP&15)<<12 | (REGTMP&15)<<16 | (uint32(r)&15)<<0 + o3 = ofsr(ctxt, int(p.As), int(p.From.Reg), 0, REGTMP, int(p.Scond), p) + + case 53: /* floating point load, int32 offset UGLY */ + o1 = omvl(ctxt, p, &p.From, REGTMP) + + if o1 == 0 { + break + } + r := int(p.From.Reg) + if r == 0 { + r = int(o.param) + } + o2 = oprrr(ctxt, AADD, int(p.Scond)) | (REGTMP&15)<<12 | (REGTMP&15)<<16 | (uint32(r)&15)<<0 + o3 = ofsr(ctxt, int(p.As), int(p.To.Reg), 0, (REGTMP&15), int(p.Scond), p) | 1<<20 + + case 54: /* floating point arith */ + o1 = oprrr(ctxt, int(p.As), int(p.Scond)) + + rf := int(p.From.Reg) + rt := int(p.To.Reg) + r := int(p.Reg) + if r == 0 { + r = rt + if p.As == AMOVF || p.As == AMOVD || p.As == AMOVFD || p.As == AMOVDF || p.As == ASQRTF || p.As == ASQRTD || p.As == AABSF || p.As == AABSD { + r = 0 + } + } + + o1 |= (uint32(rf)&15)<<0 | (uint32(r)&15)<<16 | (uint32(rt)&15)<<12 + + case 56: /* move to FP[CS]R */ + o1 = ((uint32(p.Scond)&C_SCOND)^C_SCOND_XOR)<<28 | 0xe<<24 | 1<<8 | 1<<4 + + o1 |= ((uint32(p.To.Reg)&1)+1)<<21 | (uint32(p.From.Reg)&15)<<12 + + case 57: /* move from FP[CS]R */ + o1 = ((uint32(p.Scond)&C_SCOND)^C_SCOND_XOR)<<28 | 0xe<<24 | 1<<8 | 1<<4 + + o1 |= ((uint32(p.From.Reg)&1)+1)<<21 | (uint32(p.To.Reg)&15)<<12 | 1<<20 + + case 58: /* movbu R,R */ + o1 = oprrr(ctxt, AAND, int(p.Scond)) + + o1 |= uint32(immrot(0xff)) + rt := int(p.To.Reg) + r := int(p.From.Reg) + if p.To.Type == obj.TYPE_NONE { + rt = 0 + } + if r == 0 { + r = rt + } + o1 |= (uint32(r)&15)<<16 | (uint32(rt)&15)<<12 + + case 59: /* movw/bu R< ldr indexed */ + if p.From.Reg == 0 { + if p.As != AMOVW { + ctxt.Diag("byte MOV from shifter operand") + } + o1 = mov(ctxt, p) + break + } + + if p.From.Offset&(1<<4) != 0 { + ctxt.Diag("bad shift in LDR") + } + o1 = olrr(ctxt, int(p.From.Offset), int(p.From.Reg), int(p.To.Reg), int(p.Scond)) + if p.As == AMOVBU { + o1 |= 1 << 22 + } + + case 60: /* movb R(R),R -> ldrsb indexed */ + if p.From.Reg == 0 { + ctxt.Diag("byte MOV from shifter operand") + o1 = mov(ctxt, p) + break + } + + if p.From.Offset&(^0xf) != 0 { + ctxt.Diag("bad shift in LDRSB") + } + o1 = olhrr(ctxt, int(p.From.Offset), int(p.From.Reg), int(p.To.Reg), int(p.Scond)) + o1 ^= 1<<5 | 1<<6 + + case 61: /* movw/b/bu R,R<<[IR](R) -> str indexed */ + if p.To.Reg == 0 { + ctxt.Diag("MOV to shifter operand") + } + o1 = osrr(ctxt, int(p.From.Reg), int(p.To.Offset), int(p.To.Reg), int(p.Scond)) + if p.As == AMOVB || p.As == AMOVBS || p.As == AMOVBU { + o1 |= 1 << 22 + } + + case 62: /* case R -> movw R<<2(PC),PC */ + if o.flag&LPCREL != 0 { + o1 = oprrr(ctxt, AADD, int(p.Scond)) | uint32(immrot(1)) | (uint32(p.From.Reg)&15)<<16 | (REGTMP&15)<<12 + o2 = olrr(ctxt, REGTMP&15, REGPC, REGTMP, int(p.Scond)) + o2 |= 2 << 7 + o3 = oprrr(ctxt, AADD, int(p.Scond)) | REGTMP&15 | (REGPC&15)<<16 | (REGPC&15)<<12 + } else { + o1 = olrr(ctxt, int(p.From.Reg)&15, REGPC, REGPC, int(p.Scond)) + o1 |= 2 << 7 + } + + case 63: /* bcase */ + if p.Pcond != nil { + rel := obj.Addrel(ctxt.Cursym) + rel.Off = int32(ctxt.Pc) + rel.Siz = 4 + if p.To.Sym != nil && p.To.Sym.Type != 0 { + rel.Sym = p.To.Sym + rel.Add = p.To.Offset + } else { + rel.Sym = ctxt.Cursym + rel.Add = p.Pcond.Pc + } + + if o.flag&LPCREL != 0 { + rel.Type = obj.R_PCREL + rel.Add += ctxt.Pc - p.Rel.Pc - 16 + int64(rel.Siz) + } else { + rel.Type = obj.R_ADDR + } + o1 = 0 + } + + /* reloc ops */ + case 64: /* mov/movb/movbu R,addr */ + o1 = omvl(ctxt, p, &p.To, REGTMP) + + if o1 == 0 { + break + } + o2 = osr(ctxt, int(p.As), int(p.From.Reg), 0, REGTMP, int(p.Scond)) + if o.flag&LPCREL != 0 { + o3 = o2 + o2 = oprrr(ctxt, AADD, int(p.Scond)) | REGTMP&15 | (REGPC&15)<<16 | (REGTMP&15)<<12 + } + + case 65: /* mov/movbu addr,R */ + o1 = omvl(ctxt, p, &p.From, REGTMP) + + if o1 == 0 { + break + } + o2 = olr(ctxt, 0, REGTMP, int(p.To.Reg), int(p.Scond)) + if p.As == AMOVBU || p.As == AMOVBS || p.As == AMOVB { + o2 |= 1 << 22 + } + if o.flag&LPCREL != 0 { + o3 = o2 + o2 = oprrr(ctxt, AADD, int(p.Scond)) | REGTMP&15 | (REGPC&15)<<16 | (REGTMP&15)<<12 + } + + case 68: /* floating point store -> ADDR */ + o1 = omvl(ctxt, p, &p.To, REGTMP) + + if o1 == 0 { + break + } + o2 = ofsr(ctxt, int(p.As), int(p.From.Reg), 0, REGTMP, int(p.Scond), p) + if o.flag&LPCREL != 0 { + o3 = o2 + o2 = oprrr(ctxt, AADD, int(p.Scond)) | REGTMP&15 | (REGPC&15)<<16 | (REGTMP&15)<<12 + } + + case 69: /* floating point load <- ADDR */ + o1 = omvl(ctxt, p, &p.From, REGTMP) + + if o1 == 0 { + break + } + o2 = ofsr(ctxt, int(p.As), int(p.To.Reg), 0, (REGTMP&15), int(p.Scond), p) | 1<<20 + if o.flag&LPCREL != 0 { + o3 = o2 + o2 = oprrr(ctxt, AADD, int(p.Scond)) | REGTMP&15 | (REGPC&15)<<16 | (REGTMP&15)<<12 + } + + /* ArmV4 ops: */ + case 70: /* movh/movhu R,O(R) -> strh */ + aclass(ctxt, &p.To) + + r := int(p.To.Reg) + if r == 0 { + r = int(o.param) + } + o1 = oshr(ctxt, int(p.From.Reg), int32(ctxt.Instoffset), r, int(p.Scond)) + + case 71: /* movb/movh/movhu O(R),R -> ldrsb/ldrsh/ldrh */ + aclass(ctxt, &p.From) + + r := int(p.From.Reg) + if r == 0 { + r = int(o.param) + } + o1 = olhr(ctxt, int32(ctxt.Instoffset), r, int(p.To.Reg), int(p.Scond)) + if p.As == AMOVB || p.As == AMOVBS { + o1 ^= 1<<5 | 1<<6 + } else if p.As == AMOVH || p.As == AMOVHS { + o1 ^= (1 << 6) + } + + case 72: /* movh/movhu R,L(R) -> strh */ + o1 = omvl(ctxt, p, &p.To, REGTMP) + + if o1 == 0 { + break + } + r := int(p.To.Reg) + if r == 0 { + r = int(o.param) + } + o2 = oshrr(ctxt, int(p.From.Reg), REGTMP&15, r, int(p.Scond)) + + case 73: /* movb/movh/movhu L(R),R -> ldrsb/ldrsh/ldrh */ + o1 = omvl(ctxt, p, &p.From, REGTMP) + + if o1 == 0 { + break + } + r := int(p.From.Reg) + if r == 0 { + r = int(o.param) + } + o2 = olhrr(ctxt, REGTMP&15, r, int(p.To.Reg), int(p.Scond)) + if p.As == AMOVB || p.As == AMOVBS { + o2 ^= 1<<5 | 1<<6 + } else if p.As == AMOVH || p.As == AMOVHS { + o2 ^= (1 << 6) + } + + case 74: /* bx $I */ + ctxt.Diag("ABX $I") + + case 75: /* bx O(R) */ + aclass(ctxt, &p.To) + + if ctxt.Instoffset != 0 { + ctxt.Diag("non-zero offset in ABX") + } + + /* + o1 = oprrr(ctxt, AADD, p->scond) | immrot(0) | ((REGPC&15)<<16) | ((REGLINK&15)<<12); // mov PC, LR + o2 = (((p->scond&C_SCOND) ^ C_SCOND_XOR)<<28) | (0x12fff<<8) | (1<<4) | ((p->to.reg&15) << 0); // BX R + */ + // p->to.reg may be REGLINK + o1 = oprrr(ctxt, AADD, int(p.Scond)) + + o1 |= uint32(immrot(uint32(ctxt.Instoffset))) + o1 |= (uint32(p.To.Reg) & 15) << 16 + o1 |= (REGTMP & 15) << 12 + o2 = oprrr(ctxt, AADD, int(p.Scond)) | uint32(immrot(0)) | (REGPC&15)<<16 | (REGLINK&15)<<12 // mov PC, LR + o3 = ((uint32(p.Scond)&C_SCOND)^C_SCOND_XOR)<<28 | 0x12fff<<8 | 1<<4 | REGTMP&15 // BX Rtmp + + case 76: /* bx O(R) when returning from fn*/ + ctxt.Diag("ABXRET") + + case 77: /* ldrex oreg,reg */ + aclass(ctxt, &p.From) + + if ctxt.Instoffset != 0 { + ctxt.Diag("offset must be zero in LDREX") + } + o1 = 0x19<<20 | 0xf9f + o1 |= (uint32(p.From.Reg) & 15) << 16 + o1 |= (uint32(p.To.Reg) & 15) << 12 + o1 |= ((uint32(p.Scond) & C_SCOND) ^ C_SCOND_XOR) << 28 + + case 78: /* strex reg,oreg,reg */ + aclass(ctxt, &p.From) + + if ctxt.Instoffset != 0 { + ctxt.Diag("offset must be zero in STREX") + } + o1 = 0x18<<20 | 0xf90 + o1 |= (uint32(p.From.Reg) & 15) << 16 + o1 |= (uint32(p.Reg) & 15) << 0 + o1 |= (uint32(p.To.Reg) & 15) << 12 + o1 |= ((uint32(p.Scond) & C_SCOND) ^ C_SCOND_XOR) << 28 + + case 80: /* fmov zfcon,freg */ + if p.As == AMOVD { + o1 = 0xeeb00b00 // VMOV imm 64 + o2 = oprrr(ctxt, ASUBD, int(p.Scond)) + } else { + o1 = 0x0eb00a00 // VMOV imm 32 + o2 = oprrr(ctxt, ASUBF, int(p.Scond)) + } + + v := int32(0x70) // 1.0 + r := (int(p.To.Reg) & 15) << 0 + + // movf $1.0, r + o1 |= ((uint32(p.Scond) & C_SCOND) ^ C_SCOND_XOR) << 28 + + o1 |= (uint32(r) & 15) << 12 + o1 |= (uint32(v) & 0xf) << 0 + o1 |= (uint32(v) & 0xf0) << 12 + + // subf r,r,r + o2 |= (uint32(r)&15)<<0 | (uint32(r)&15)<<16 | (uint32(r)&15)<<12 + + case 81: /* fmov sfcon,freg */ + o1 = 0x0eb00a00 // VMOV imm 32 + if p.As == AMOVD { + o1 = 0xeeb00b00 // VMOV imm 64 + } + o1 |= ((uint32(p.Scond) & C_SCOND) ^ C_SCOND_XOR) << 28 + o1 |= (uint32(p.To.Reg) & 15) << 12 + v := int32(chipfloat5(ctxt, p.From.Val.(float64))) + o1 |= (uint32(v) & 0xf) << 0 + o1 |= (uint32(v) & 0xf0) << 12 + + case 82: /* fcmp freg,freg, */ + o1 = oprrr(ctxt, int(p.As), int(p.Scond)) + + o1 |= (uint32(p.Reg)&15)<<12 | (uint32(p.From.Reg)&15)<<0 + o2 = 0x0ef1fa10 // VMRS R15 + o2 |= ((uint32(p.Scond) & C_SCOND) ^ C_SCOND_XOR) << 28 + + case 83: /* fcmp freg,, */ + o1 = oprrr(ctxt, int(p.As), int(p.Scond)) + + o1 |= (uint32(p.From.Reg)&15)<<12 | 1<<16 + o2 = 0x0ef1fa10 // VMRS R15 + o2 |= ((uint32(p.Scond) & C_SCOND) ^ C_SCOND_XOR) << 28 + + case 84: /* movfw freg,freg - truncate float-to-fix */ + o1 = oprrr(ctxt, int(p.As), int(p.Scond)) + + o1 |= (uint32(p.From.Reg) & 15) << 0 + o1 |= (uint32(p.To.Reg) & 15) << 12 + + case 85: /* movwf freg,freg - fix-to-float */ + o1 = oprrr(ctxt, int(p.As), int(p.Scond)) + + o1 |= (uint32(p.From.Reg) & 15) << 0 + o1 |= (uint32(p.To.Reg) & 15) << 12 + + // macro for movfw freg,FTMP; movw FTMP,reg + case 86: /* movfw freg,reg - truncate float-to-fix */ + o1 = oprrr(ctxt, int(p.As), int(p.Scond)) + + o1 |= (uint32(p.From.Reg) & 15) << 0 + o1 |= (FREGTMP & 15) << 12 + o2 = oprrr(ctxt, AMOVFW+ALAST, int(p.Scond)) + o2 |= (FREGTMP & 15) << 16 + o2 |= (uint32(p.To.Reg) & 15) << 12 + + // macro for movw reg,FTMP; movwf FTMP,freg + case 87: /* movwf reg,freg - fix-to-float */ + o1 = oprrr(ctxt, AMOVWF+ALAST, int(p.Scond)) + + o1 |= (uint32(p.From.Reg) & 15) << 12 + o1 |= (FREGTMP & 15) << 16 + o2 = oprrr(ctxt, int(p.As), int(p.Scond)) + o2 |= (FREGTMP & 15) << 0 + o2 |= (uint32(p.To.Reg) & 15) << 12 + + case 88: /* movw reg,freg */ + o1 = oprrr(ctxt, AMOVWF+ALAST, int(p.Scond)) + + o1 |= (uint32(p.From.Reg) & 15) << 12 + o1 |= (uint32(p.To.Reg) & 15) << 16 + + case 89: /* movw freg,reg */ + o1 = oprrr(ctxt, AMOVFW+ALAST, int(p.Scond)) + + o1 |= (uint32(p.From.Reg) & 15) << 16 + o1 |= (uint32(p.To.Reg) & 15) << 12 + + case 90: /* tst reg */ + o1 = oprrr(ctxt, ACMP+ALAST, int(p.Scond)) + + o1 |= (uint32(p.From.Reg) & 15) << 16 + + case 91: /* ldrexd oreg,reg */ + aclass(ctxt, &p.From) + + if ctxt.Instoffset != 0 { + ctxt.Diag("offset must be zero in LDREX") + } + o1 = 0x1b<<20 | 0xf9f + o1 |= (uint32(p.From.Reg) & 15) << 16 + o1 |= (uint32(p.To.Reg) & 15) << 12 + o1 |= ((uint32(p.Scond) & C_SCOND) ^ C_SCOND_XOR) << 28 + + case 92: /* strexd reg,oreg,reg */ + aclass(ctxt, &p.From) + + if ctxt.Instoffset != 0 { + ctxt.Diag("offset must be zero in STREX") + } + o1 = 0x1a<<20 | 0xf90 + o1 |= (uint32(p.From.Reg) & 15) << 16 + o1 |= (uint32(p.Reg) & 15) << 0 + o1 |= (uint32(p.To.Reg) & 15) << 12 + o1 |= ((uint32(p.Scond) & C_SCOND) ^ C_SCOND_XOR) << 28 + + case 93: /* movb/movh/movhu addr,R -> ldrsb/ldrsh/ldrh */ + o1 = omvl(ctxt, p, &p.From, REGTMP) + + if o1 == 0 { + break + } + o2 = olhr(ctxt, 0, REGTMP, int(p.To.Reg), int(p.Scond)) + if p.As == AMOVB || p.As == AMOVBS { + o2 ^= 1<<5 | 1<<6 + } else if p.As == AMOVH || p.As == AMOVHS { + o2 ^= (1 << 6) + } + if o.flag&LPCREL != 0 { + o3 = o2 + o2 = oprrr(ctxt, AADD, int(p.Scond)) | REGTMP&15 | (REGPC&15)<<16 | (REGTMP&15)<<12 + } + + case 94: /* movh/movhu R,addr -> strh */ + o1 = omvl(ctxt, p, &p.To, REGTMP) + + if o1 == 0 { + break + } + o2 = oshr(ctxt, int(p.From.Reg), 0, REGTMP, int(p.Scond)) + if o.flag&LPCREL != 0 { + o3 = o2 + o2 = oprrr(ctxt, AADD, int(p.Scond)) | REGTMP&15 | (REGPC&15)<<16 | (REGTMP&15)<<12 + } + + case 95: /* PLD off(reg) */ + o1 = 0xf5d0f000 + + o1 |= (uint32(p.From.Reg) & 15) << 16 + if p.From.Offset < 0 { + o1 &^= (1 << 23) + o1 |= uint32((-p.From.Offset) & 0xfff) + } else { + o1 |= uint32(p.From.Offset & 0xfff) + } + + // This is supposed to be something that stops execution. + // It's not supposed to be reached, ever, but if it is, we'd + // like to be able to tell how we got there. Assemble as + // 0xf7fabcfd which is guaranteed to raise undefined instruction + // exception. + case 96: /* UNDEF */ + o1 = 0xf7fabcfd + + case 97: /* CLZ Rm, Rd */ + o1 = oprrr(ctxt, int(p.As), int(p.Scond)) + + o1 |= (uint32(p.To.Reg) & 15) << 12 + o1 |= (uint32(p.From.Reg) & 15) << 0 + + case 98: /* MULW{T,B} Rs, Rm, Rd */ + o1 = oprrr(ctxt, int(p.As), int(p.Scond)) + + o1 |= (uint32(p.To.Reg) & 15) << 16 + o1 |= (uint32(p.From.Reg) & 15) << 8 + o1 |= (uint32(p.Reg) & 15) << 0 + + case 99: /* MULAW{T,B} Rs, Rm, Rn, Rd */ + o1 = oprrr(ctxt, int(p.As), int(p.Scond)) + + o1 |= (uint32(p.To.Reg) & 15) << 12 + o1 |= (uint32(p.From.Reg) & 15) << 8 + o1 |= (uint32(p.Reg) & 15) << 0 + o1 |= uint32((p.To.Offset & 15) << 16) + + // DATABUNDLE: BKPT $0x5be0, signify the start of NaCl data bundle; + // DATABUNDLEEND: zero width alignment marker + case 100: + if p.As == ADATABUNDLE { + o1 = 0xe125be70 + } + } + + out[0] = o1 + out[1] = o2 + out[2] = o3 + out[3] = o4 + out[4] = o5 + out[5] = o6 + return +} + +func mov(ctxt *obj.Link, p *obj.Prog) uint32 { + aclass(ctxt, &p.From) + o1 := oprrr(ctxt, int(p.As), int(p.Scond)) + o1 |= uint32(p.From.Offset) + rt := int(p.To.Reg) + if p.To.Type == obj.TYPE_NONE { + rt = 0 + } + r := int(p.Reg) + if p.As == AMOVW || p.As == AMVN { + r = 0 + } else if r == 0 { + r = rt + } + o1 |= (uint32(r)&15)<<16 | (uint32(rt)&15)<<12 + return o1 +} + +func oprrr(ctxt *obj.Link, a int, sc int) uint32 { + o := ((uint32(sc) & C_SCOND) ^ C_SCOND_XOR) << 28 + if sc&C_SBIT != 0 { + o |= 1 << 20 + } + if sc&(C_PBIT|C_WBIT) != 0 { + ctxt.Diag(".nil/.W on dp instruction") + } + switch a { + case AMULU, AMUL: + return o | 0x0<<21 | 0x9<<4 + case AMULA: + return o | 0x1<<21 | 0x9<<4 + case AMULLU: + return o | 0x4<<21 | 0x9<<4 + case AMULL: + return o | 0x6<<21 | 0x9<<4 + case AMULALU: + return o | 0x5<<21 | 0x9<<4 + case AMULAL: + return o | 0x7<<21 | 0x9<<4 + case AAND: + return o | 0x0<<21 + case AEOR: + return o | 0x1<<21 + case ASUB: + return o | 0x2<<21 + case ARSB: + return o | 0x3<<21 + case AADD: + return o | 0x4<<21 + case AADC: + return o | 0x5<<21 + case ASBC: + return o | 0x6<<21 + case ARSC: + return o | 0x7<<21 + case ATST: + return o | 0x8<<21 | 1<<20 + case ATEQ: + return o | 0x9<<21 | 1<<20 + case ACMP: + return o | 0xa<<21 | 1<<20 + case ACMN: + return o | 0xb<<21 | 1<<20 + case AORR: + return o | 0xc<<21 + + case AMOVB, AMOVH, AMOVW: + return o | 0xd<<21 + case ABIC: + return o | 0xe<<21 + case AMVN: + return o | 0xf<<21 + case ASLL: + return o | 0xd<<21 | 0<<5 + case ASRL: + return o | 0xd<<21 | 1<<5 + case ASRA: + return o | 0xd<<21 | 2<<5 + case ASWI: + return o | 0xf<<24 + + case AADDD: + return o | 0xe<<24 | 0x3<<20 | 0xb<<8 | 0<<4 + case AADDF: + return o | 0xe<<24 | 0x3<<20 | 0xa<<8 | 0<<4 + case ASUBD: + return o | 0xe<<24 | 0x3<<20 | 0xb<<8 | 4<<4 + case ASUBF: + return o | 0xe<<24 | 0x3<<20 | 0xa<<8 | 4<<4 + case AMULD: + return o | 0xe<<24 | 0x2<<20 | 0xb<<8 | 0<<4 + case AMULF: + return o | 0xe<<24 | 0x2<<20 | 0xa<<8 | 0<<4 + case ADIVD: + return o | 0xe<<24 | 0x8<<20 | 0xb<<8 | 0<<4 + case ADIVF: + return o | 0xe<<24 | 0x8<<20 | 0xa<<8 | 0<<4 + case ASQRTD: + return o | 0xe<<24 | 0xb<<20 | 1<<16 | 0xb<<8 | 0xc<<4 + case ASQRTF: + return o | 0xe<<24 | 0xb<<20 | 1<<16 | 0xa<<8 | 0xc<<4 + case AABSD: + return o | 0xe<<24 | 0xb<<20 | 0<<16 | 0xb<<8 | 0xc<<4 + case AABSF: + return o | 0xe<<24 | 0xb<<20 | 0<<16 | 0xa<<8 | 0xc<<4 + case ACMPD: + return o | 0xe<<24 | 0xb<<20 | 4<<16 | 0xb<<8 | 0xc<<4 + case ACMPF: + return o | 0xe<<24 | 0xb<<20 | 4<<16 | 0xa<<8 | 0xc<<4 + + case AMOVF: + return o | 0xe<<24 | 0xb<<20 | 0<<16 | 0xa<<8 | 4<<4 + case AMOVD: + return o | 0xe<<24 | 0xb<<20 | 0<<16 | 0xb<<8 | 4<<4 + + case AMOVDF: + return o | 0xe<<24 | 0xb<<20 | 7<<16 | 0xa<<8 | 0xc<<4 | 1<<8 // dtof + case AMOVFD: + return o | 0xe<<24 | 0xb<<20 | 7<<16 | 0xa<<8 | 0xc<<4 | 0<<8 // dtof + + case AMOVWF: + if sc&C_UBIT == 0 { + o |= 1 << 7 /* signed */ + } + return o | 0xe<<24 | 0xb<<20 | 8<<16 | 0xa<<8 | 4<<4 | 0<<18 | 0<<8 // toint, double + + case AMOVWD: + if sc&C_UBIT == 0 { + o |= 1 << 7 /* signed */ + } + return o | 0xe<<24 | 0xb<<20 | 8<<16 | 0xa<<8 | 4<<4 | 0<<18 | 1<<8 // toint, double + + case AMOVFW: + if sc&C_UBIT == 0 { + o |= 1 << 16 /* signed */ + } + return o | 0xe<<24 | 0xb<<20 | 8<<16 | 0xa<<8 | 4<<4 | 1<<18 | 0<<8 | 1<<7 // toint, double, trunc + + case AMOVDW: + if sc&C_UBIT == 0 { + o |= 1 << 16 /* signed */ + } + return o | 0xe<<24 | 0xb<<20 | 8<<16 | 0xa<<8 | 4<<4 | 1<<18 | 1<<8 | 1<<7 // toint, double, trunc + + case AMOVWF + ALAST: // copy WtoF + return o | 0xe<<24 | 0x0<<20 | 0xb<<8 | 1<<4 + + case AMOVFW + ALAST: // copy FtoW + return o | 0xe<<24 | 0x1<<20 | 0xb<<8 | 1<<4 + + case ACMP + ALAST: // cmp imm + return o | 0x3<<24 | 0x5<<20 + + // CLZ doesn't support .nil + case ACLZ: + return o&(0xf<<28) | 0x16f<<16 | 0xf1<<4 + + case AMULWT: + return o&(0xf<<28) | 0x12<<20 | 0xe<<4 + + case AMULWB: + return o&(0xf<<28) | 0x12<<20 | 0xa<<4 + + case AMULAWT: + return o&(0xf<<28) | 0x12<<20 | 0xc<<4 + + case AMULAWB: + return o&(0xf<<28) | 0x12<<20 | 0x8<<4 + + case ABL: // BLX REG + return o&(0xf<<28) | 0x12fff3<<4 + } + + ctxt.Diag("bad rrr %d", a) + prasm(ctxt.Curp) + return 0 +} + +func opbra(ctxt *obj.Link, a int, sc int) uint32 { + if sc&(C_SBIT|C_PBIT|C_WBIT) != 0 { + ctxt.Diag(".nil/.nil/.W on bra instruction") + } + sc &= C_SCOND + sc ^= C_SCOND_XOR + if a == ABL || a == obj.ADUFFZERO || a == obj.ADUFFCOPY { + return uint32(sc)<<28 | 0x5<<25 | 0x1<<24 + } + if sc != 0xe { + ctxt.Diag(".COND on bcond instruction") + } + switch a { + case ABEQ: + return 0x0<<28 | 0x5<<25 + case ABNE: + return 0x1<<28 | 0x5<<25 + case ABCS: + return 0x2<<28 | 0x5<<25 + case ABHS: + return 0x2<<28 | 0x5<<25 + case ABCC: + return 0x3<<28 | 0x5<<25 + case ABLO: + return 0x3<<28 | 0x5<<25 + case ABMI: + return 0x4<<28 | 0x5<<25 + case ABPL: + return 0x5<<28 | 0x5<<25 + case ABVS: + return 0x6<<28 | 0x5<<25 + case ABVC: + return 0x7<<28 | 0x5<<25 + case ABHI: + return 0x8<<28 | 0x5<<25 + case ABLS: + return 0x9<<28 | 0x5<<25 + case ABGE: + return 0xa<<28 | 0x5<<25 + case ABLT: + return 0xb<<28 | 0x5<<25 + case ABGT: + return 0xc<<28 | 0x5<<25 + case ABLE: + return 0xd<<28 | 0x5<<25 + case AB: + return 0xe<<28 | 0x5<<25 + } + + ctxt.Diag("bad bra %v", obj.Aconv(a)) + prasm(ctxt.Curp) + return 0 +} + +func olr(ctxt *obj.Link, v int32, b int, r int, sc int) uint32 { + if sc&C_SBIT != 0 { + ctxt.Diag(".nil on LDR/STR instruction") + } + o := ((uint32(sc) & C_SCOND) ^ C_SCOND_XOR) << 28 + if sc&C_PBIT == 0 { + o |= 1 << 24 + } + if sc&C_UBIT == 0 { + o |= 1 << 23 + } + if sc&C_WBIT != 0 { + o |= 1 << 21 + } + o |= 1<<26 | 1<<20 + if v < 0 { + if sc&C_UBIT != 0 { + ctxt.Diag(".U on neg offset") + } + v = -v + o ^= 1 << 23 + } + + if v >= 1<<12 || v < 0 { + ctxt.Diag("literal span too large: %d (R%d)\n%v", v, b, ctxt.Printp) + } + o |= uint32(v) + o |= (uint32(b) & 15) << 16 + o |= (uint32(r) & 15) << 12 + return o +} + +func olhr(ctxt *obj.Link, v int32, b int, r int, sc int) uint32 { + if sc&C_SBIT != 0 { + ctxt.Diag(".nil on LDRH/STRH instruction") + } + o := ((uint32(sc) & C_SCOND) ^ C_SCOND_XOR) << 28 + if sc&C_PBIT == 0 { + o |= 1 << 24 + } + if sc&C_WBIT != 0 { + o |= 1 << 21 + } + o |= 1<<23 | 1<<20 | 0xb<<4 + if v < 0 { + v = -v + o ^= 1 << 23 + } + + if v >= 1<<8 || v < 0 { + ctxt.Diag("literal span too large: %d (R%d)\n%v", v, b, ctxt.Printp) + } + o |= uint32(v)&0xf | (uint32(v)>>4)<<8 | 1<<22 + o |= (uint32(b) & 15) << 16 + o |= (uint32(r) & 15) << 12 + return o +} + +func osr(ctxt *obj.Link, a int, r int, v int32, b int, sc int) uint32 { + o := olr(ctxt, v, b, r, sc) ^ (1 << 20) + if a != AMOVW { + o |= 1 << 22 + } + return o +} + +func oshr(ctxt *obj.Link, r int, v int32, b int, sc int) uint32 { + o := olhr(ctxt, v, b, r, sc) ^ (1 << 20) + return o +} + +func osrr(ctxt *obj.Link, r int, i int, b int, sc int) uint32 { + return olr(ctxt, int32(i), b, r, sc) ^ (1<<25 | 1<<20) +} + +func oshrr(ctxt *obj.Link, r int, i int, b int, sc int) uint32 { + return olhr(ctxt, int32(i), b, r, sc) ^ (1<<22 | 1<<20) +} + +func olrr(ctxt *obj.Link, i int, b int, r int, sc int) uint32 { + return olr(ctxt, int32(i), b, r, sc) ^ (1 << 25) +} + +func olhrr(ctxt *obj.Link, i int, b int, r int, sc int) uint32 { + return olhr(ctxt, int32(i), b, r, sc) ^ (1 << 22) +} + +func ofsr(ctxt *obj.Link, a int, r int, v int32, b int, sc int, p *obj.Prog) uint32 { + if sc&C_SBIT != 0 { + ctxt.Diag(".nil on FLDR/FSTR instruction") + } + o := ((uint32(sc) & C_SCOND) ^ C_SCOND_XOR) << 28 + if sc&C_PBIT == 0 { + o |= 1 << 24 + } + if sc&C_WBIT != 0 { + o |= 1 << 21 + } + o |= 6<<25 | 1<<24 | 1<<23 | 10<<8 + if v < 0 { + v = -v + o ^= 1 << 23 + } + + if v&3 != 0 { + ctxt.Diag("odd offset for floating point op: %d\n%v", v, p) + } else if v >= 1<<10 || v < 0 { + ctxt.Diag("literal span too large: %d\n%v", v, p) + } + o |= (uint32(v) >> 2) & 0xFF + o |= (uint32(b) & 15) << 16 + o |= (uint32(r) & 15) << 12 + + switch a { + default: + ctxt.Diag("bad fst %v", obj.Aconv(a)) + fallthrough + + case AMOVD: + o |= 1 << 8 + fallthrough + + case AMOVF: + break + } + + return o +} + +func omvl(ctxt *obj.Link, p *obj.Prog, a *obj.Addr, dr int) uint32 { + var o1 uint32 + if p.Pcond == nil { + aclass(ctxt, a) + v := immrot(^uint32(ctxt.Instoffset)) + if v == 0 { + ctxt.Diag("missing literal") + prasm(p) + return 0 + } + + o1 = oprrr(ctxt, AMVN, int(p.Scond)&C_SCOND) + o1 |= uint32(v) + o1 |= (uint32(dr) & 15) << 12 + } else { + v := int32(p.Pcond.Pc - p.Pc - 8) + o1 = olr(ctxt, v, REGPC, dr, int(p.Scond)&C_SCOND) + } + + return o1 +} + +func chipzero5(ctxt *obj.Link, e float64) int { + // We use GOARM=7 to gate the use of VFPv3 vmov (imm) instructions. + if ctxt.Goarm < 7 || e != 0 { + return -1 + } + return 0 +} + +func chipfloat5(ctxt *obj.Link, e float64) int { + // We use GOARM=7 to gate the use of VFPv3 vmov (imm) instructions. + if ctxt.Goarm < 7 { + return -1 + } + + ei := math.Float64bits(e) + l := uint32(ei) + h := uint32(ei >> 32) + + if l != 0 || h&0xffff != 0 { + return -1 + } + h1 := h & 0x7fc00000 + if h1 != 0x40000000 && h1 != 0x3fc00000 { + return -1 + } + n := 0 + + // sign bit (a) + if h&0x80000000 != 0 { + n |= 1 << 7 + } + + // exp sign bit (b) + if h1 == 0x3fc00000 { + n |= 1 << 6 + } + + // rest of exp and mantissa (cd-efgh) + n |= int((h >> 16) & 0x3f) + + //print("match %.8lux %.8lux %d\n", l, h, n); + return n +} diff --git a/src/cmd/internal/obj/arm/list5.go b/src/cmd/internal/obj/arm/list5.go new file mode 100644 index 0000000000000000000000000000000000000000..bb2ac20e5370c679ac9e12c9191f494865f57887 --- /dev/null +++ b/src/cmd/internal/obj/arm/list5.go @@ -0,0 +1,83 @@ +// Inferno utils/5c/list.c +// http://code.google.com/p/inferno-os/source/browse/utils/5c/list.c +// +// Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved. +// Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net) +// Portions Copyright © 1997-1999 Vita Nuova Limited +// Portions Copyright © 2000-2007 Vita Nuova Holdings Limited (www.vitanuova.com) +// Portions Copyright © 2004,2006 Bruce Ellis +// Portions Copyright © 2005-2007 C H Forsyth (forsyth@terzarima.net) +// Revisions Copyright © 2000-2007 Lucent Technologies Inc. and others +// Portions Copyright © 2009 The Go Authors. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +package arm + +import ( + "cmd/internal/obj" + "fmt" +) + +func init() { + obj.RegisterRegister(obj.RBaseARM, MAXREG, Rconv) + obj.RegisterOpcode(obj.ABaseARM, Anames) +} + +func Rconv(r int) string { + if r == 0 { + return "NONE" + } + if r == REGG { + // Special case. + return "g" + } + if REG_R0 <= r && r <= REG_R15 { + return fmt.Sprintf("R%d", r-REG_R0) + } + if REG_F0 <= r && r <= REG_F15 { + return fmt.Sprintf("F%d", r-REG_F0) + } + + switch r { + case REG_FPSR: + return "FPSR" + + case REG_FPCR: + return "FPCR" + + case REG_CPSR: + return "CPSR" + + case REG_SPSR: + return "SPSR" + } + + return fmt.Sprintf("Rgok(%d)", r-obj.RBaseARM) +} + +func DRconv(a int) string { + s := "C_??" + if a >= C_NONE && a <= C_NCLASS { + s = cnames5[a] + } + var fp string + fp += s + return fp +} diff --git a/src/cmd/internal/obj/arm/obj5.go b/src/cmd/internal/obj/arm/obj5.go new file mode 100644 index 0000000000000000000000000000000000000000..3ecf6bc9d536be4e1beceb9b36530f146147c0b4 --- /dev/null +++ b/src/cmd/internal/obj/arm/obj5.go @@ -0,0 +1,1020 @@ +// Derived from Inferno utils/5c/swt.c +// http://code.google.com/p/inferno-os/source/browse/utils/5c/swt.c +// +// Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved. +// Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net) +// Portions Copyright © 1997-1999 Vita Nuova Limited +// Portions Copyright © 2000-2007 Vita Nuova Holdings Limited (www.vitanuova.com) +// Portions Copyright © 2004,2006 Bruce Ellis +// Portions Copyright © 2005-2007 C H Forsyth (forsyth@terzarima.net) +// Revisions Copyright © 2000-2007 Lucent Technologies Inc. and others +// Portions Copyright © 2009 The Go Authors. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +package arm + +import ( + "cmd/internal/obj" + "encoding/binary" + "fmt" + "log" + "math" +) + +var progedit_tlsfallback *obj.LSym + +func progedit(ctxt *obj.Link, p *obj.Prog) { + p.From.Class = 0 + p.To.Class = 0 + + // Rewrite B/BL to symbol as TYPE_BRANCH. + switch p.As { + case AB, + ABL, + obj.ADUFFZERO, + obj.ADUFFCOPY: + if p.To.Type == obj.TYPE_MEM && (p.To.Name == obj.NAME_EXTERN || p.To.Name == obj.NAME_STATIC) && p.To.Sym != nil { + p.To.Type = obj.TYPE_BRANCH + } + } + + // Replace TLS register fetches on older ARM procesors. + switch p.As { + // Treat MRC 15, 0, , C13, C0, 3 specially. + case AMRC: + if p.To.Offset&0xffff0fff == 0xee1d0f70 { + // Because the instruction might be rewriten to a BL which returns in R0 + // the register must be zero. + if p.To.Offset&0xf000 != 0 { + ctxt.Diag("%v: TLS MRC instruction must write to R0 as it might get translated into a BL instruction", p.Line()) + } + + if ctxt.Goarm < 7 { + // Replace it with BL runtime.read_tls_fallback(SB) for ARM CPUs that lack the tls extension. + if progedit_tlsfallback == nil { + progedit_tlsfallback = obj.Linklookup(ctxt, "runtime.read_tls_fallback", 0) + } + + // MOVW LR, R11 + p.As = AMOVW + + p.From.Type = obj.TYPE_REG + p.From.Reg = REGLINK + p.To.Type = obj.TYPE_REG + p.To.Reg = REGTMP + + // BL runtime.read_tls_fallback(SB) + p = obj.Appendp(ctxt, p) + + p.As = ABL + p.To.Type = obj.TYPE_BRANCH + p.To.Sym = progedit_tlsfallback + p.To.Offset = 0 + + // MOVW R11, LR + p = obj.Appendp(ctxt, p) + + p.As = AMOVW + p.From.Type = obj.TYPE_REG + p.From.Reg = REGTMP + p.To.Type = obj.TYPE_REG + p.To.Reg = REGLINK + break + } + } + + // Otherwise, MRC/MCR instructions need no further treatment. + p.As = AWORD + } + + // Rewrite float constants to values stored in memory. + switch p.As { + case AMOVF: + if p.From.Type == obj.TYPE_FCONST && chipfloat5(ctxt, p.From.Val.(float64)) < 0 && (chipzero5(ctxt, p.From.Val.(float64)) < 0 || p.Scond&C_SCOND != C_SCOND_NONE) { + f32 := float32(p.From.Val.(float64)) + i32 := math.Float32bits(f32) + literal := fmt.Sprintf("$f32.%08x", i32) + s := obj.Linklookup(ctxt, literal, 0) + p.From.Type = obj.TYPE_MEM + p.From.Sym = s + p.From.Name = obj.NAME_EXTERN + p.From.Offset = 0 + } + + case AMOVD: + if p.From.Type == obj.TYPE_FCONST && chipfloat5(ctxt, p.From.Val.(float64)) < 0 && (chipzero5(ctxt, p.From.Val.(float64)) < 0 || p.Scond&C_SCOND != C_SCOND_NONE) { + i64 := math.Float64bits(p.From.Val.(float64)) + literal := fmt.Sprintf("$f64.%016x", i64) + s := obj.Linklookup(ctxt, literal, 0) + p.From.Type = obj.TYPE_MEM + p.From.Sym = s + p.From.Name = obj.NAME_EXTERN + p.From.Offset = 0 + } + } + + if ctxt.Flag_shared != 0 { + // Shared libraries use R_ARM_TLS_IE32 instead of + // R_ARM_TLS_LE32, replacing the link time constant TLS offset in + // runtime.tlsg with an address to a GOT entry containing the + // offset. Rewrite $runtime.tlsg(SB) to runtime.tlsg(SB) to + // compensate. + if ctxt.Tlsg == nil { + ctxt.Tlsg = obj.Linklookup(ctxt, "runtime.tlsg", 0) + } + + if p.From.Type == obj.TYPE_ADDR && p.From.Name == obj.NAME_EXTERN && p.From.Sym == ctxt.Tlsg { + p.From.Type = obj.TYPE_MEM + } + if p.To.Type == obj.TYPE_ADDR && p.To.Name == obj.NAME_EXTERN && p.To.Sym == ctxt.Tlsg { + p.To.Type = obj.TYPE_MEM + } + } +} + +// Prog.mark +const ( + FOLL = 1 << 0 + LABEL = 1 << 1 + LEAF = 1 << 2 +) + +func linkcase(casep *obj.Prog) { + for p := casep; p != nil; p = p.Link { + if p.As == ABCASE { + for ; p != nil && p.As == ABCASE; p = p.Link { + p.Rel = casep + } + break + } + } +} + +func preprocess(ctxt *obj.Link, cursym *obj.LSym) { + autosize := int32(0) + + ctxt.Cursym = cursym + + if cursym.Text == nil || cursym.Text.Link == nil { + return + } + + softfloat(ctxt, cursym) + + p := cursym.Text + autoffset := int32(p.To.Offset) + if autoffset < 0 { + autoffset = 0 + } + cursym.Locals = autoffset + cursym.Args = p.To.Val.(int32) + + if ctxt.Debugzerostack != 0 { + if autoffset != 0 && p.From3.Offset&obj.NOSPLIT == 0 { + // MOVW $4(R13), R1 + p = obj.Appendp(ctxt, p) + + p.As = AMOVW + p.From.Type = obj.TYPE_ADDR + p.From.Reg = REG_R13 + p.From.Offset = 4 + p.To.Type = obj.TYPE_REG + p.To.Reg = REG_R1 + + // MOVW $n(R13), R2 + p = obj.Appendp(ctxt, p) + + p.As = AMOVW + p.From.Type = obj.TYPE_ADDR + p.From.Reg = REG_R13 + p.From.Offset = 4 + int64(autoffset) + p.To.Type = obj.TYPE_REG + p.To.Reg = REG_R2 + + // MOVW $0, R3 + p = obj.Appendp(ctxt, p) + + p.As = AMOVW + p.From.Type = obj.TYPE_CONST + p.From.Offset = 0 + p.To.Type = obj.TYPE_REG + p.To.Reg = REG_R3 + + // L: + // MOVW.nil R3, 0(R1) +4 + // CMP R1, R2 + // BNE L + pl := obj.Appendp(ctxt, p) + p := pl + + p.As = AMOVW + p.From.Type = obj.TYPE_REG + p.From.Reg = REG_R3 + p.To.Type = obj.TYPE_MEM + p.To.Reg = REG_R1 + p.To.Offset = 4 + p.Scond |= C_PBIT + + p = obj.Appendp(ctxt, p) + p.As = ACMP + p.From.Type = obj.TYPE_REG + p.From.Reg = REG_R1 + p.Reg = REG_R2 + + p = obj.Appendp(ctxt, p) + p.As = ABNE + p.To.Type = obj.TYPE_BRANCH + p.Pcond = pl + } + } + + /* + * find leaf subroutines + * strip NOPs + * expand RET + * expand BECOME pseudo + */ + var q1 *obj.Prog + var q *obj.Prog + for p := cursym.Text; p != nil; p = p.Link { + switch p.As { + case ACASE: + if ctxt.Flag_shared != 0 { + linkcase(p) + } + + case obj.ATEXT: + p.Mark |= LEAF + + case obj.ARET: + break + + case ADIV, ADIVU, AMOD, AMODU: + q = p + if ctxt.Sym_div == nil { + initdiv(ctxt) + } + cursym.Text.Mark &^= LEAF + continue + + case obj.ANOP: + q1 = p.Link + q.Link = q1 /* q is non-nop */ + if q1 != nil { + q1.Mark |= p.Mark + } + continue + + case ABL, + ABX, + obj.ADUFFZERO, + obj.ADUFFCOPY: + cursym.Text.Mark &^= LEAF + fallthrough + + case ABCASE, + AB, + ABEQ, + ABNE, + ABCS, + ABHS, + ABCC, + ABLO, + ABMI, + ABPL, + ABVS, + ABVC, + ABHI, + ABLS, + ABGE, + ABLT, + ABGT, + ABLE: + q1 = p.Pcond + if q1 != nil { + for q1.As == obj.ANOP { + q1 = q1.Link + p.Pcond = q1 + } + } + } + + q = p + } + + var o int + var p1 *obj.Prog + var p2 *obj.Prog + var q2 *obj.Prog + for p := cursym.Text; p != nil; p = p.Link { + o = int(p.As) + switch o { + case obj.ATEXT: + autosize = int32(p.To.Offset + 4) + if autosize <= 4 { + if cursym.Text.Mark&LEAF != 0 { + p.To.Offset = -4 + autosize = 0 + } + } + + if autosize == 0 && cursym.Text.Mark&LEAF == 0 { + if ctxt.Debugvlog != 0 { + fmt.Fprintf(ctxt.Bso, "save suppressed in: %s\n", cursym.Name) + ctxt.Bso.Flush() + } + + cursym.Text.Mark |= LEAF + } + + if cursym.Text.Mark&LEAF != 0 { + cursym.Leaf = 1 + if autosize == 0 { + break + } + } + + if p.From3.Offset&obj.NOSPLIT == 0 { + p = stacksplit(ctxt, p, autosize) // emit split check + } + + // MOVW.W R14,$-autosize(SP) + p = obj.Appendp(ctxt, p) + + p.As = AMOVW + p.Scond |= C_WBIT + p.From.Type = obj.TYPE_REG + p.From.Reg = REGLINK + p.To.Type = obj.TYPE_MEM + p.To.Offset = int64(-autosize) + p.To.Reg = REGSP + p.Spadj = autosize + + if cursym.Text.From3.Offset&obj.WRAPPER != 0 { + // if(g->panic != nil && g->panic->argp == FP) g->panic->argp = bottom-of-frame + // + // MOVW g_panic(g), R1 + // CMP $0, R1 + // B.EQ end + // MOVW panic_argp(R1), R2 + // ADD $(autosize+4), R13, R3 + // CMP R2, R3 + // B.NE end + // ADD $4, R13, R4 + // MOVW R4, panic_argp(R1) + // end: + // NOP + // + // The NOP is needed to give the jumps somewhere to land. + // It is a liblink NOP, not an ARM NOP: it encodes to 0 instruction bytes. + + p = obj.Appendp(ctxt, p) + + p.As = AMOVW + p.From.Type = obj.TYPE_MEM + p.From.Reg = REGG + p.From.Offset = 4 * int64(ctxt.Arch.Ptrsize) // G.panic + p.To.Type = obj.TYPE_REG + p.To.Reg = REG_R1 + + p = obj.Appendp(ctxt, p) + p.As = ACMP + p.From.Type = obj.TYPE_CONST + p.From.Offset = 0 + p.Reg = REG_R1 + + p = obj.Appendp(ctxt, p) + p.As = ABEQ + p.To.Type = obj.TYPE_BRANCH + p1 = p + + p = obj.Appendp(ctxt, p) + p.As = AMOVW + p.From.Type = obj.TYPE_MEM + p.From.Reg = REG_R1 + p.From.Offset = 0 // Panic.argp + p.To.Type = obj.TYPE_REG + p.To.Reg = REG_R2 + + p = obj.Appendp(ctxt, p) + p.As = AADD + p.From.Type = obj.TYPE_CONST + p.From.Offset = int64(autosize) + 4 + p.Reg = REG_R13 + p.To.Type = obj.TYPE_REG + p.To.Reg = REG_R3 + + p = obj.Appendp(ctxt, p) + p.As = ACMP + p.From.Type = obj.TYPE_REG + p.From.Reg = REG_R2 + p.Reg = REG_R3 + + p = obj.Appendp(ctxt, p) + p.As = ABNE + p.To.Type = obj.TYPE_BRANCH + p2 = p + + p = obj.Appendp(ctxt, p) + p.As = AADD + p.From.Type = obj.TYPE_CONST + p.From.Offset = 4 + p.Reg = REG_R13 + p.To.Type = obj.TYPE_REG + p.To.Reg = REG_R4 + + p = obj.Appendp(ctxt, p) + p.As = AMOVW + p.From.Type = obj.TYPE_REG + p.From.Reg = REG_R4 + p.To.Type = obj.TYPE_MEM + p.To.Reg = REG_R1 + p.To.Offset = 0 // Panic.argp + + p = obj.Appendp(ctxt, p) + + p.As = obj.ANOP + p1.Pcond = p + p2.Pcond = p + } + + case obj.ARET: + obj.Nocache(p) + if cursym.Text.Mark&LEAF != 0 { + if autosize == 0 { + p.As = AB + p.From = obj.Addr{} + if p.To.Sym != nil { // retjmp + p.To.Type = obj.TYPE_BRANCH + } else { + p.To.Type = obj.TYPE_MEM + p.To.Offset = 0 + p.To.Reg = REGLINK + } + + break + } + } + + p.As = AMOVW + p.Scond |= C_PBIT + p.From.Type = obj.TYPE_MEM + p.From.Offset = int64(autosize) + p.From.Reg = REGSP + p.To.Type = obj.TYPE_REG + p.To.Reg = REGPC + + // If there are instructions following + // this ARET, they come from a branch + // with the same stackframe, so no spadj. + if p.To.Sym != nil { // retjmp + p.To.Reg = REGLINK + q2 = obj.Appendp(ctxt, p) + q2.As = AB + q2.To.Type = obj.TYPE_BRANCH + q2.To.Sym = p.To.Sym + p.To.Sym = nil + p = q2 + } + + case AADD: + if p.From.Type == obj.TYPE_CONST && p.From.Reg == 0 && p.To.Type == obj.TYPE_REG && p.To.Reg == REGSP { + p.Spadj = int32(-p.From.Offset) + } + + case ASUB: + if p.From.Type == obj.TYPE_CONST && p.From.Reg == 0 && p.To.Type == obj.TYPE_REG && p.To.Reg == REGSP { + p.Spadj = int32(p.From.Offset) + } + + case ADIV, ADIVU, AMOD, AMODU: + if cursym.Text.From3.Offset&obj.NOSPLIT != 0 { + ctxt.Diag("cannot divide in NOSPLIT function") + } + if ctxt.Debugdivmod != 0 { + break + } + if p.From.Type != obj.TYPE_REG { + break + } + if p.To.Type != obj.TYPE_REG { + break + } + + // Make copy because we overwrite p below. + q1 := *p + if q1.Reg == REGTMP || q1.Reg == 0 && q1.To.Reg == REGTMP { + ctxt.Diag("div already using REGTMP: %v", p) + } + + /* MOV m(g),REGTMP */ + p.As = AMOVW + p.Lineno = q1.Lineno + p.From.Type = obj.TYPE_MEM + p.From.Reg = REGG + p.From.Offset = 6 * 4 // offset of g.m + p.Reg = 0 + p.To.Type = obj.TYPE_REG + p.To.Reg = REGTMP + + /* MOV a,m_divmod(REGTMP) */ + p = obj.Appendp(ctxt, p) + p.As = AMOVW + p.Lineno = q1.Lineno + p.From.Type = obj.TYPE_REG + p.From.Reg = q1.From.Reg + p.To.Type = obj.TYPE_MEM + p.To.Reg = REGTMP + p.To.Offset = 8 * 4 // offset of m.divmod + + /* MOV b,REGTMP */ + p = obj.Appendp(ctxt, p) + p.As = AMOVW + p.Lineno = q1.Lineno + p.From.Type = obj.TYPE_REG + p.From.Reg = q1.Reg + if q1.Reg == 0 { + p.From.Reg = q1.To.Reg + } + p.To.Type = obj.TYPE_REG + p.To.Reg = REGTMP + p.To.Offset = 0 + + /* CALL appropriate */ + p = obj.Appendp(ctxt, p) + p.As = ABL + p.Lineno = q1.Lineno + p.To.Type = obj.TYPE_BRANCH + switch o { + case ADIV: + p.To.Sym = ctxt.Sym_div + + case ADIVU: + p.To.Sym = ctxt.Sym_divu + + case AMOD: + p.To.Sym = ctxt.Sym_mod + + case AMODU: + p.To.Sym = ctxt.Sym_modu + } + + /* MOV REGTMP, b */ + p = obj.Appendp(ctxt, p) + p.As = AMOVW + p.Lineno = q1.Lineno + p.From.Type = obj.TYPE_REG + p.From.Reg = REGTMP + p.From.Offset = 0 + p.To.Type = obj.TYPE_REG + p.To.Reg = q1.To.Reg + + case AMOVW: + if (p.Scond&C_WBIT != 0) && p.To.Type == obj.TYPE_MEM && p.To.Reg == REGSP { + p.Spadj = int32(-p.To.Offset) + } + if (p.Scond&C_PBIT != 0) && p.From.Type == obj.TYPE_MEM && p.From.Reg == REGSP && p.To.Reg != REGPC { + p.Spadj = int32(-p.From.Offset) + } + if p.From.Type == obj.TYPE_ADDR && p.From.Reg == REGSP && p.To.Type == obj.TYPE_REG && p.To.Reg == REGSP { + p.Spadj = int32(-p.From.Offset) + } + } + } +} + +func isfloatreg(a *obj.Addr) bool { + return a.Type == obj.TYPE_REG && REG_F0 <= a.Reg && a.Reg <= REG_F15 +} + +func softfloat(ctxt *obj.Link, cursym *obj.LSym) { + if ctxt.Goarm > 5 { + return + } + + symsfloat := obj.Linklookup(ctxt, "_sfloat", 0) + + wasfloat := 0 + for p := cursym.Text; p != nil; p = p.Link { + if p.Pcond != nil { + p.Pcond.Mark |= LABEL + } + } + var next *obj.Prog + for p := cursym.Text; p != nil; p = p.Link { + switch p.As { + case AMOVW: + if isfloatreg(&p.To) || isfloatreg(&p.From) { + goto soft + } + goto notsoft + + case AMOVWD, + AMOVWF, + AMOVDW, + AMOVFW, + AMOVFD, + AMOVDF, + AMOVF, + AMOVD, + ACMPF, + ACMPD, + AADDF, + AADDD, + ASUBF, + ASUBD, + AMULF, + AMULD, + ADIVF, + ADIVD, + ASQRTF, + ASQRTD, + AABSF, + AABSD: + goto soft + + default: + goto notsoft + } + + soft: + if wasfloat == 0 || (p.Mark&LABEL != 0) { + next = ctxt.NewProg() + *next = *p + + // BL _sfloat(SB) + *p = obj.Prog{} + p.Ctxt = ctxt + p.Link = next + p.As = ABL + p.To.Type = obj.TYPE_BRANCH + p.To.Sym = symsfloat + p.Lineno = next.Lineno + + p = next + wasfloat = 1 + } + + continue + + notsoft: + wasfloat = 0 + } +} + +func stacksplit(ctxt *obj.Link, p *obj.Prog, framesize int32) *obj.Prog { + // MOVW g_stackguard(g), R1 + p = obj.Appendp(ctxt, p) + + p.As = AMOVW + p.From.Type = obj.TYPE_MEM + p.From.Reg = REGG + p.From.Offset = 2 * int64(ctxt.Arch.Ptrsize) // G.stackguard0 + if ctxt.Cursym.Cfunc != 0 { + p.From.Offset = 3 * int64(ctxt.Arch.Ptrsize) // G.stackguard1 + } + p.To.Type = obj.TYPE_REG + p.To.Reg = REG_R1 + + if framesize <= obj.StackSmall { + // small stack: SP < stackguard + // CMP stackguard, SP + p = obj.Appendp(ctxt, p) + + p.As = ACMP + p.From.Type = obj.TYPE_REG + p.From.Reg = REG_R1 + p.Reg = REGSP + } else if framesize <= obj.StackBig { + // large stack: SP-framesize < stackguard-StackSmall + // MOVW $-framesize(SP), R2 + // CMP stackguard, R2 + p = obj.Appendp(ctxt, p) + + p.As = AMOVW + p.From.Type = obj.TYPE_ADDR + p.From.Reg = REGSP + p.From.Offset = int64(-framesize) + p.To.Type = obj.TYPE_REG + p.To.Reg = REG_R2 + + p = obj.Appendp(ctxt, p) + p.As = ACMP + p.From.Type = obj.TYPE_REG + p.From.Reg = REG_R1 + p.Reg = REG_R2 + } else { + // Such a large stack we need to protect against wraparound + // if SP is close to zero. + // SP-stackguard+StackGuard < framesize + (StackGuard-StackSmall) + // The +StackGuard on both sides is required to keep the left side positive: + // SP is allowed to be slightly below stackguard. See stack.h. + // CMP $StackPreempt, R1 + // MOVW.NE $StackGuard(SP), R2 + // SUB.NE R1, R2 + // MOVW.NE $(framesize+(StackGuard-StackSmall)), R3 + // CMP.NE R3, R2 + p = obj.Appendp(ctxt, p) + + p.As = ACMP + p.From.Type = obj.TYPE_CONST + p.From.Offset = int64(uint32(obj.StackPreempt & (1<<32 - 1))) + p.Reg = REG_R1 + + p = obj.Appendp(ctxt, p) + p.As = AMOVW + p.From.Type = obj.TYPE_ADDR + p.From.Reg = REGSP + p.From.Offset = obj.StackGuard + p.To.Type = obj.TYPE_REG + p.To.Reg = REG_R2 + p.Scond = C_SCOND_NE + + p = obj.Appendp(ctxt, p) + p.As = ASUB + p.From.Type = obj.TYPE_REG + p.From.Reg = REG_R1 + p.To.Type = obj.TYPE_REG + p.To.Reg = REG_R2 + p.Scond = C_SCOND_NE + + p = obj.Appendp(ctxt, p) + p.As = AMOVW + p.From.Type = obj.TYPE_ADDR + p.From.Offset = int64(framesize) + (obj.StackGuard - obj.StackSmall) + p.To.Type = obj.TYPE_REG + p.To.Reg = REG_R3 + p.Scond = C_SCOND_NE + + p = obj.Appendp(ctxt, p) + p.As = ACMP + p.From.Type = obj.TYPE_REG + p.From.Reg = REG_R3 + p.Reg = REG_R2 + p.Scond = C_SCOND_NE + } + + // BLS call-to-morestack + bls := obj.Appendp(ctxt, p) + bls.As = ABLS + bls.To.Type = obj.TYPE_BRANCH + + var last *obj.Prog + for last = ctxt.Cursym.Text; last.Link != nil; last = last.Link { + } + + // MOVW LR, R3 + movw := obj.Appendp(ctxt, last) + movw.As = AMOVW + movw.From.Type = obj.TYPE_REG + movw.From.Reg = REGLINK + movw.To.Type = obj.TYPE_REG + movw.To.Reg = REG_R3 + + bls.Pcond = movw + + // BL runtime.morestack + call := obj.Appendp(ctxt, movw) + call.As = obj.ACALL + call.To.Type = obj.TYPE_BRANCH + morestack := "runtime.morestack" + switch { + case ctxt.Cursym.Cfunc != 0: + morestack = "runtime.morestackc" + case ctxt.Cursym.Text.From3.Offset&obj.NEEDCTXT == 0: + morestack = "runtime.morestack_noctxt" + } + call.To.Sym = obj.Linklookup(ctxt, morestack, 0) + + // B start + b := obj.Appendp(ctxt, call) + b.As = obj.AJMP + b.To.Type = obj.TYPE_BRANCH + b.Pcond = ctxt.Cursym.Text.Link + + return bls +} + +func initdiv(ctxt *obj.Link) { + if ctxt.Sym_div != nil { + return + } + ctxt.Sym_div = obj.Linklookup(ctxt, "_div", 0) + ctxt.Sym_divu = obj.Linklookup(ctxt, "_divu", 0) + ctxt.Sym_mod = obj.Linklookup(ctxt, "_mod", 0) + ctxt.Sym_modu = obj.Linklookup(ctxt, "_modu", 0) +} + +func follow(ctxt *obj.Link, s *obj.LSym) { + ctxt.Cursym = s + + firstp := ctxt.NewProg() + lastp := firstp + xfol(ctxt, s.Text, &lastp) + lastp.Link = nil + s.Text = firstp.Link +} + +func relinv(a int) int { + switch a { + case ABEQ: + return ABNE + case ABNE: + return ABEQ + case ABCS: + return ABCC + case ABHS: + return ABLO + case ABCC: + return ABCS + case ABLO: + return ABHS + case ABMI: + return ABPL + case ABPL: + return ABMI + case ABVS: + return ABVC + case ABVC: + return ABVS + case ABHI: + return ABLS + case ABLS: + return ABHI + case ABGE: + return ABLT + case ABLT: + return ABGE + case ABGT: + return ABLE + case ABLE: + return ABGT + } + + log.Fatalf("unknown relation: %s", Anames[a]) + return 0 +} + +func xfol(ctxt *obj.Link, p *obj.Prog, last **obj.Prog) { + var q *obj.Prog + var r *obj.Prog + var a int + var i int + +loop: + if p == nil { + return + } + a = int(p.As) + if a == AB { + q = p.Pcond + if q != nil && q.As != obj.ATEXT { + p.Mark |= FOLL + p = q + if p.Mark&FOLL == 0 { + goto loop + } + } + } + + if p.Mark&FOLL != 0 { + i = 0 + q = p + for ; i < 4; i, q = i+1, q.Link { + if q == *last || q == nil { + break + } + a = int(q.As) + if a == obj.ANOP { + i-- + continue + } + + if a == AB || (a == obj.ARET && q.Scond == C_SCOND_NONE) || a == ARFE || a == obj.AUNDEF { + goto copy + } + if q.Pcond == nil || (q.Pcond.Mark&FOLL != 0) { + continue + } + if a != ABEQ && a != ABNE { + continue + } + + copy: + for { + r = ctxt.NewProg() + *r = *p + if r.Mark&FOLL == 0 { + fmt.Printf("can't happen 1\n") + } + r.Mark |= FOLL + if p != q { + p = p.Link + (*last).Link = r + *last = r + continue + } + + (*last).Link = r + *last = r + if a == AB || (a == obj.ARET && q.Scond == C_SCOND_NONE) || a == ARFE || a == obj.AUNDEF { + return + } + r.As = ABNE + if a == ABNE { + r.As = ABEQ + } + r.Pcond = p.Link + r.Link = p.Pcond + if r.Link.Mark&FOLL == 0 { + xfol(ctxt, r.Link, last) + } + if r.Pcond.Mark&FOLL == 0 { + fmt.Printf("can't happen 2\n") + } + return + } + } + + a = AB + q = ctxt.NewProg() + q.As = int16(a) + q.Lineno = p.Lineno + q.To.Type = obj.TYPE_BRANCH + q.To.Offset = p.Pc + q.Pcond = p + p = q + } + + p.Mark |= FOLL + (*last).Link = p + *last = p + if a == AB || (a == obj.ARET && p.Scond == C_SCOND_NONE) || a == ARFE || a == obj.AUNDEF { + return + } + + if p.Pcond != nil { + if a != ABL && a != ABX && p.Link != nil { + q = obj.Brchain(ctxt, p.Link) + if a != obj.ATEXT && a != ABCASE { + if q != nil && (q.Mark&FOLL != 0) { + p.As = int16(relinv(a)) + p.Link = p.Pcond + p.Pcond = q + } + } + + xfol(ctxt, p.Link, last) + q = obj.Brchain(ctxt, p.Pcond) + if q == nil { + q = p.Pcond + } + if q.Mark&FOLL != 0 { + p.Pcond = q + return + } + + p = q + goto loop + } + } + + p = p.Link + goto loop +} + +var unaryDst = map[int]bool{ + ASWI: true, + AWORD: true, +} + +var Linkarm = obj.LinkArch{ + ByteOrder: binary.LittleEndian, + Name: "arm", + Thechar: '5', + Preprocess: preprocess, + Assemble: span5, + Follow: follow, + Progedit: progedit, + UnaryDst: unaryDst, + Minlc: 4, + Ptrsize: 4, + Regsize: 4, +} diff --git a/src/cmd/internal/obj/arm64/a.out.go b/src/cmd/internal/obj/arm64/a.out.go new file mode 100644 index 0000000000000000000000000000000000000000..67b37aae6fc4ae3d0342a8bbf923c76be28ab9d0 --- /dev/null +++ b/src/cmd/internal/obj/arm64/a.out.go @@ -0,0 +1,711 @@ +// cmd/7c/7.out.h from Vita Nuova. +// https://code.google.com/p/ken-cc/source/browse/src/cmd/7c/7.out.h +// +// Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved. +// Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net) +// Portions Copyright © 1997-1999 Vita Nuova Limited +// Portions Copyright © 2000-2007 Vita Nuova Holdings Limited (www.vitanuova.com) +// Portions Copyright © 2004,2006 Bruce Ellis +// Portions Copyright © 2005-2007 C H Forsyth (forsyth@terzarima.net) +// Revisions Copyright © 2000-2007 Lucent Technologies Inc. and others +// Portions Copyright © 2009 The Go Authors. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +package arm64 + +import "cmd/internal/obj" + +const ( + NSNAME = 8 + NSYM = 50 + NREG = 32 /* number of general registers */ + NFREG = 32 /* number of floating point registers */ +) + +// General purpose registers, kept in the low bits of Prog.Reg. +const ( + // integer + REG_R0 = obj.RBaseARM64 + iota + REG_R1 + REG_R2 + REG_R3 + REG_R4 + REG_R5 + REG_R6 + REG_R7 + REG_R8 + REG_R9 + REG_R10 + REG_R11 + REG_R12 + REG_R13 + REG_R14 + REG_R15 + REG_R16 + REG_R17 + REG_R18 + REG_R19 + REG_R20 + REG_R21 + REG_R22 + REG_R23 + REG_R24 + REG_R25 + REG_R26 + REG_R27 + REG_R28 + REG_R29 + REG_R30 + REG_R31 + + // scalar floating point + REG_F0 + REG_F1 + REG_F2 + REG_F3 + REG_F4 + REG_F5 + REG_F6 + REG_F7 + REG_F8 + REG_F9 + REG_F10 + REG_F11 + REG_F12 + REG_F13 + REG_F14 + REG_F15 + REG_F16 + REG_F17 + REG_F18 + REG_F19 + REG_F20 + REG_F21 + REG_F22 + REG_F23 + REG_F24 + REG_F25 + REG_F26 + REG_F27 + REG_F28 + REG_F29 + REG_F30 + REG_F31 + + // SIMD + REG_V0 + REG_V1 + REG_V2 + REG_V3 + REG_V4 + REG_V5 + REG_V6 + REG_V7 + REG_V8 + REG_V9 + REG_V10 + REG_V11 + REG_V12 + REG_V13 + REG_V14 + REG_V15 + REG_V16 + REG_V17 + REG_V18 + REG_V19 + REG_V20 + REG_V21 + REG_V22 + REG_V23 + REG_V24 + REG_V25 + REG_V26 + REG_V27 + REG_V28 + REG_V29 + REG_V30 + REG_V31 + + // The EQ in + // CSET EQ, R0 + // is encoded as TYPE_REG, even though it's not really a register. + COND_EQ + COND_NE + COND_HS + COND_LO + COND_MI + COND_PL + COND_VS + COND_VC + COND_HI + COND_LS + COND_GE + COND_LT + COND_GT + COND_LE + COND_AL + COND_NV + + REG_RSP = REG_V31 + 32 // to differentiate ZR/SP, REG_RSP&0x1f = 31 +) + +// Not registers, but flags that can be combined with regular register +// constants to indicate extended register conversion. When checking, +// you should subtract obj.RBaseARM64 first. From this difference, bit 11 +// indicates extended register, bits 8-10 select the conversion mode. +const REG_EXT = obj.RBaseARM64 + 1<<11 + +const ( + REG_UXTB = REG_EXT + iota<<8 + REG_UXTH + REG_UXTW + REG_UXTX + REG_SXTB + REG_SXTH + REG_SXTW + REG_SXTX +) + +// Special registers, after subtracting obj.RBaseARM64, bit 12 indicates +// a special register and the low bits select the register. +const ( + REG_SPECIAL = obj.RBaseARM64 + 1<<12 + iota + REG_DAIF + REG_NZCV + REG_FPSR + REG_FPCR + REG_SPSR_EL1 + REG_ELR_EL1 + REG_SPSR_EL2 + REG_ELR_EL2 + REG_CurrentEL + REG_SP_EL0 + REG_SPSel + REG_DAIFSet + REG_DAIFClr +) + +// Register assignments: +// +// compiler allocates R0 up as temps +// compiler allocates register variables R7-R25 +// compiler allocates external registers R26 down +// +// compiler allocates register variables F7-F26 +// compiler allocates external registers F26 down +const ( + REGMIN = REG_R7 // register variables allocated from here to REGMAX + REGRT1 = REG_R16 // ARM64 IP0, for external linker, runtime, duffzero and duffcopy + REGRT2 = REG_R17 // ARM64 IP1, for external linker, runtime, duffcopy + REGPR = REG_R18 // ARM64 platform register, unused in the Go toolchain + REGMAX = REG_R25 + + REGCTXT = REG_R26 // environment for closures + REGTMP = REG_R27 // reserved for liblink + REGG = REG_R28 // G + REGFP = REG_R29 // frame pointer, unused in the Go toolchain + REGLINK = REG_R30 + + // ARM64 uses R31 as both stack pointer and zero register, + // depending on the instruction. To differentiate RSP from ZR, + // we use a different numeric value for REGZERO and REGSP. + REGZERO = REG_R31 + REGSP = REG_RSP + + FREGRET = REG_F0 + FREGMIN = REG_F7 // first register variable + FREGMAX = REG_F26 // last register variable for 7g only + FREGEXT = REG_F26 // first external register + FREGZERO = REG_F28 // both float and double + FREGHALF = REG_F29 // double + FREGONE = REG_F30 // double + FREGTWO = REG_F31 // double +) + +const ( + BIG = 2048 - 8 +) + +const ( + /* mark flags */ + LABEL = 1 << iota + LEAF + FLOAT + BRANCH + LOAD + FCMP + SYNC + LIST + FOLL + NOSCHED +) + +const ( + C_NONE = iota + C_REG // R0..R30 + C_RSP // R0..R30, RSP + C_FREG // F0..F31 + C_VREG // V0..V31 + C_PAIR // (Rn, Rm) + C_SHIFT // Rn<<2 + C_EXTREG // Rn.UXTB<<3 + C_SPR // REG_NZCV + C_COND // EQ, NE, etc + + C_ZCON // $0 or ZR + C_ADDCON0 // 12-bit unsigned, unshifted + C_ADDCON // 12-bit unsigned, shifted left by 0 or 12 + C_MOVCON // generated by a 16-bit constant, optionally inverted and/or shifted by multiple of 16 + C_BITCON // bitfield and logical immediate masks + C_ABCON // could be C_ADDCON or C_BITCON + C_MBCON // could be C_MOVCON or C_BITCON + C_LCON // 32-bit constant + C_VCON // 64-bit constant + C_FCON // floating-point constant + C_VCONADDR // 64-bit memory address + + C_AACON // ADDCON offset in auto constant $a(FP) + C_LACON // 32-bit offset in auto constant $a(FP) + C_AECON // ADDCON offset in extern constant $e(SB) + + // TODO(aram): only one branch class should be enough + C_SBRA // for TYPE_BRANCH + C_LBRA + + C_NPAUTO // -512 <= x < 0, 0 mod 8 + C_NSAUTO // -256 <= x < 0 + C_PSAUTO // 0 to 255 + C_PPAUTO // 0 to 504, 0 mod 8 + C_UAUTO4K // 0 to 4095 + C_UAUTO8K // 0 to 8190, 0 mod 2 + C_UAUTO16K // 0 to 16380, 0 mod 4 + C_UAUTO32K // 0 to 32760, 0 mod 8 + C_UAUTO64K // 0 to 65520, 0 mod 16 + C_LAUTO // any other 32-bit constant + + C_SEXT1 // 0 to 4095, direct + C_SEXT2 // 0 to 8190 + C_SEXT4 // 0 to 16380 + C_SEXT8 // 0 to 32760 + C_SEXT16 // 0 to 65520 + C_LEXT + + // TODO(aram): s/AUTO/INDIR/ + C_ZOREG // 0(R) + C_NPOREG // mirror NPAUTO, etc + C_NSOREG + C_PSOREG + C_PPOREG + C_UOREG4K + C_UOREG8K + C_UOREG16K + C_UOREG32K + C_UOREG64K + C_LOREG + + C_ADDR // TODO(aram): explain difference from C_VCONADDR + C_ROFF // register offset (including register extended) + + C_GOK + C_TEXTSIZE + C_NCLASS // must be last +) + +const ( + C_XPRE = 1 << 6 // match arm.C_WBIT, so Prog.String know how to print it + C_XPOST = 1 << 5 // match arm.C_PBIT, so Prog.String know how to print it +) + +//go:generate go run ../stringer.go -i $GOFILE -o anames.go -p arm64 + +const ( + AADC = obj.ABaseARM64 + obj.A_ARCHSPECIFIC + iota + AADCS + AADCSW + AADCW + AADD + AADDS + AADDSW + AADDW + AADR + AADRP + AAND + AANDS + AANDSW + AANDW + AASR + AASRW + AAT + ABFI + ABFIW + ABFM + ABFMW + ABFXIL + ABFXILW + ABIC + ABICS + ABICSW + ABICW + ABRK + ACBNZ + ACBNZW + ACBZ + ACBZW + ACCMN + ACCMNW + ACCMP + ACCMPW + ACINC + ACINCW + ACINV + ACINVW + ACLREX + ACLS + ACLSW + ACLZ + ACLZW + ACMN + ACMNW + ACMP + ACMPW + ACNEG + ACNEGW + ACRC32B + ACRC32CB + ACRC32CH + ACRC32CW + ACRC32CX + ACRC32H + ACRC32W + ACRC32X + ACSEL + ACSELW + ACSET + ACSETM + ACSETMW + ACSETW + ACSINC + ACSINCW + ACSINV + ACSINVW + ACSNEG + ACSNEGW + ADC + ADCPS1 + ADCPS2 + ADCPS3 + ADMB + ADRPS + ADSB + AEON + AEONW + AEOR + AEORW + AERET + AEXTR + AEXTRW + AHINT + AHLT + AHVC + AIC + AISB + ALDAR + ALDARB + ALDARH + ALDARW + ALDAXP + ALDAXPW + ALDAXR + ALDAXRB + ALDAXRH + ALDAXRW + ALDP + ALDXR + ALDXRB + ALDXRH + ALDXRW + ALDXP + ALDXPW + ALSL + ALSLW + ALSR + ALSRW + AMADD + AMADDW + AMNEG + AMNEGW + AMOVK + AMOVKW + AMOVN + AMOVNW + AMOVZ + AMOVZW + AMRS + AMSR + AMSUB + AMSUBW + AMUL + AMULW + AMVN + AMVNW + ANEG + ANEGS + ANEGSW + ANEGW + ANGC + ANGCS + ANGCSW + ANGCW + AORN + AORNW + AORR + AORRW + APRFM + APRFUM + ARBIT + ARBITW + AREM + AREMW + AREV + AREV16 + AREV16W + AREV32 + AREVW + AROR + ARORW + ASBC + ASBCS + ASBCSW + ASBCW + ASBFIZ + ASBFIZW + ASBFM + ASBFMW + ASBFX + ASBFXW + ASDIV + ASDIVW + ASEV + ASEVL + ASMADDL + ASMC + ASMNEGL + ASMSUBL + ASMULH + ASMULL + ASTXR + ASTXRB + ASTXRH + ASTXP + ASTXPW + ASTXRW + ASTLP + ASTLPW + ASTLR + ASTLRB + ASTLRH + ASTLRW + ASTLXP + ASTLXPW + ASTLXR + ASTLXRB + ASTLXRH + ASTLXRW + ASTP + ASUB + ASUBS + ASUBSW + ASUBW + ASVC + ASXTB + ASXTBW + ASXTH + ASXTHW + ASXTW + ASYS + ASYSL + ATBNZ + ATBZ + ATLBI + ATST + ATSTW + AUBFIZ + AUBFIZW + AUBFM + AUBFMW + AUBFX + AUBFXW + AUDIV + AUDIVW + AUMADDL + AUMNEGL + AUMSUBL + AUMULH + AUMULL + AUREM + AUREMW + AUXTB + AUXTH + AUXTW + AUXTBW + AUXTHW + AWFE + AWFI + AYIELD + AMOVB + AMOVBU + AMOVH + AMOVHU + AMOVW + AMOVWU + AMOVD + AMOVNP + AMOVNPW + AMOVP + AMOVPD + AMOVPQ + AMOVPS + AMOVPSW + AMOVPW + ABEQ + ABNE + ABCS + ABHS + ABCC + ABLO + ABMI + ABPL + ABVS + ABVC + ABHI + ABLS + ABGE + ABLT + ABGT + ABLE + AFABSD + AFABSS + AFADDD + AFADDS + AFCCMPD + AFCCMPED + AFCCMPS + AFCCMPES + AFCMPD + AFCMPED + AFCMPES + AFCMPS + AFCVTSD + AFCVTDS + AFCVTZSD + AFCVTZSDW + AFCVTZSS + AFCVTZSSW + AFCVTZUD + AFCVTZUDW + AFCVTZUS + AFCVTZUSW + AFDIVD + AFDIVS + AFMOVD + AFMOVS + AFMULD + AFMULS + AFNEGD + AFNEGS + AFSQRTD + AFSQRTS + AFSUBD + AFSUBS + ASCVTFD + ASCVTFS + ASCVTFWD + ASCVTFWS + AUCVTFD + AUCVTFS + AUCVTFWD + AUCVTFWS + AHISTORY + ANAME + AWORD + ADYNT + AINIT + ABCASE + ACASE + ADWORD + ASIGNAME + AGOK + AEND + AFCSELS + AFCSELD + AFMAXS + AFMINS + AFMAXD + AFMIND + AFMAXNMS + AFMAXNMD + AFNMULS + AFNMULD + AFRINTNS + AFRINTND + AFRINTPS + AFRINTPD + AFRINTMS + AFRINTMD + AFRINTZS + AFRINTZD + AFRINTAS + AFRINTAD + AFRINTXS + AFRINTXD + AFRINTIS + AFRINTID + AFMADDS + AFMADDD + AFMSUBS + AFMSUBD + AFNMADDS + AFNMADDD + AFNMSUBS + AFNMSUBD + AFMINNMS + AFMINNMD + AFCVTDH + AFCVTHS + AFCVTHD + AFCVTSH + AAESD + AAESE + AAESIMC + AAESMC + ASHA1C + ASHA1H + ASHA1M + ASHA1P + ASHA1SU0 + ASHA1SU1 + ASHA256H + ASHA256H2 + ASHA256SU0 + ASHA256SU1 + ALAST + AB = obj.AJMP + ABL = obj.ACALL +) diff --git a/src/cmd/internal/obj/arm64/anames.go b/src/cmd/internal/obj/arm64/anames.go new file mode 100644 index 0000000000000000000000000000000000000000..28454189de0a82b4b063868407fdadacbdc613c6 --- /dev/null +++ b/src/cmd/internal/obj/arm64/anames.go @@ -0,0 +1,379 @@ +// Generated by stringer -i a.out.go -o anames.go -p arm64 +// Do not edit. + +package arm64 + +import "cmd/internal/obj" + +var Anames = []string{ + obj.A_ARCHSPECIFIC: "ADC", + "ADCS", + "ADCSW", + "ADCW", + "ADD", + "ADDS", + "ADDSW", + "ADDW", + "ADR", + "ADRP", + "AND", + "ANDS", + "ANDSW", + "ANDW", + "ASR", + "ASRW", + "AT", + "BFI", + "BFIW", + "BFM", + "BFMW", + "BFXIL", + "BFXILW", + "BIC", + "BICS", + "BICSW", + "BICW", + "BRK", + "CBNZ", + "CBNZW", + "CBZ", + "CBZW", + "CCMN", + "CCMNW", + "CCMP", + "CCMPW", + "CINC", + "CINCW", + "CINV", + "CINVW", + "CLREX", + "CLS", + "CLSW", + "CLZ", + "CLZW", + "CMN", + "CMNW", + "CMP", + "CMPW", + "CNEG", + "CNEGW", + "CRC32B", + "CRC32CB", + "CRC32CH", + "CRC32CW", + "CRC32CX", + "CRC32H", + "CRC32W", + "CRC32X", + "CSEL", + "CSELW", + "CSET", + "CSETM", + "CSETMW", + "CSETW", + "CSINC", + "CSINCW", + "CSINV", + "CSINVW", + "CSNEG", + "CSNEGW", + "DC", + "DCPS1", + "DCPS2", + "DCPS3", + "DMB", + "DRPS", + "DSB", + "EON", + "EONW", + "EOR", + "EORW", + "ERET", + "EXTR", + "EXTRW", + "HINT", + "HLT", + "HVC", + "IC", + "ISB", + "LDAR", + "LDARB", + "LDARH", + "LDARW", + "LDAXP", + "LDAXPW", + "LDAXR", + "LDAXRB", + "LDAXRH", + "LDAXRW", + "LDP", + "LDXR", + "LDXRB", + "LDXRH", + "LDXRW", + "LDXP", + "LDXPW", + "LSL", + "LSLW", + "LSR", + "LSRW", + "MADD", + "MADDW", + "MNEG", + "MNEGW", + "MOVK", + "MOVKW", + "MOVN", + "MOVNW", + "MOVZ", + "MOVZW", + "MRS", + "MSR", + "MSUB", + "MSUBW", + "MUL", + "MULW", + "MVN", + "MVNW", + "NEG", + "NEGS", + "NEGSW", + "NEGW", + "NGC", + "NGCS", + "NGCSW", + "NGCW", + "ORN", + "ORNW", + "ORR", + "ORRW", + "PRFM", + "PRFUM", + "RBIT", + "RBITW", + "REM", + "REMW", + "REV", + "REV16", + "REV16W", + "REV32", + "REVW", + "ROR", + "RORW", + "SBC", + "SBCS", + "SBCSW", + "SBCW", + "SBFIZ", + "SBFIZW", + "SBFM", + "SBFMW", + "SBFX", + "SBFXW", + "SDIV", + "SDIVW", + "SEV", + "SEVL", + "SMADDL", + "SMC", + "SMNEGL", + "SMSUBL", + "SMULH", + "SMULL", + "STXR", + "STXRB", + "STXRH", + "STXP", + "STXPW", + "STXRW", + "STLP", + "STLPW", + "STLR", + "STLRB", + "STLRH", + "STLRW", + "STLXP", + "STLXPW", + "STLXR", + "STLXRB", + "STLXRH", + "STLXRW", + "STP", + "SUB", + "SUBS", + "SUBSW", + "SUBW", + "SVC", + "SXTB", + "SXTBW", + "SXTH", + "SXTHW", + "SXTW", + "SYS", + "SYSL", + "TBNZ", + "TBZ", + "TLBI", + "TST", + "TSTW", + "UBFIZ", + "UBFIZW", + "UBFM", + "UBFMW", + "UBFX", + "UBFXW", + "UDIV", + "UDIVW", + "UMADDL", + "UMNEGL", + "UMSUBL", + "UMULH", + "UMULL", + "UREM", + "UREMW", + "UXTB", + "UXTH", + "UXTW", + "UXTBW", + "UXTHW", + "WFE", + "WFI", + "YIELD", + "MOVB", + "MOVBU", + "MOVH", + "MOVHU", + "MOVW", + "MOVWU", + "MOVD", + "MOVNP", + "MOVNPW", + "MOVP", + "MOVPD", + "MOVPQ", + "MOVPS", + "MOVPSW", + "MOVPW", + "BEQ", + "BNE", + "BCS", + "BHS", + "BCC", + "BLO", + "BMI", + "BPL", + "BVS", + "BVC", + "BHI", + "BLS", + "BGE", + "BLT", + "BGT", + "BLE", + "FABSD", + "FABSS", + "FADDD", + "FADDS", + "FCCMPD", + "FCCMPED", + "FCCMPS", + "FCCMPES", + "FCMPD", + "FCMPED", + "FCMPES", + "FCMPS", + "FCVTSD", + "FCVTDS", + "FCVTZSD", + "FCVTZSDW", + "FCVTZSS", + "FCVTZSSW", + "FCVTZUD", + "FCVTZUDW", + "FCVTZUS", + "FCVTZUSW", + "FDIVD", + "FDIVS", + "FMOVD", + "FMOVS", + "FMULD", + "FMULS", + "FNEGD", + "FNEGS", + "FSQRTD", + "FSQRTS", + "FSUBD", + "FSUBS", + "SCVTFD", + "SCVTFS", + "SCVTFWD", + "SCVTFWS", + "UCVTFD", + "UCVTFS", + "UCVTFWD", + "UCVTFWS", + "HISTORY", + "NAME", + "WORD", + "DYNT", + "INIT", + "BCASE", + "CASE", + "DWORD", + "SIGNAME", + "GOK", + "END", + "FCSELS", + "FCSELD", + "FMAXS", + "FMINS", + "FMAXD", + "FMIND", + "FMAXNMS", + "FMAXNMD", + "FNMULS", + "FNMULD", + "FRINTNS", + "FRINTND", + "FRINTPS", + "FRINTPD", + "FRINTMS", + "FRINTMD", + "FRINTZS", + "FRINTZD", + "FRINTAS", + "FRINTAD", + "FRINTXS", + "FRINTXD", + "FRINTIS", + "FRINTID", + "FMADDS", + "FMADDD", + "FMSUBS", + "FMSUBD", + "FNMADDS", + "FNMADDD", + "FNMSUBS", + "FNMSUBD", + "FMINNMS", + "FMINNMD", + "FCVTDH", + "FCVTHS", + "FCVTHD", + "FCVTSH", + "AESD", + "AESE", + "AESIMC", + "AESMC", + "SHA1C", + "SHA1H", + "SHA1M", + "SHA1P", + "SHA1SU0", + "SHA1SU1", + "SHA256H", + "SHA256H2", + "SHA256SU0", + "SHA256SU1", + "LAST", +} diff --git a/src/cmd/internal/obj/arm64/anames7.go b/src/cmd/internal/obj/arm64/anames7.go new file mode 100644 index 0000000000000000000000000000000000000000..3ff429f4135266c3df3abae3902b744e66330d68 --- /dev/null +++ b/src/cmd/internal/obj/arm64/anames7.go @@ -0,0 +1,62 @@ +package arm64 + +var cnames7 = []string{ + "NONE", + "REG", + "RSP", + "FREG", + "VREG", + "PAIR", + "SHIFT", + "EXTREG", + "SPR", + "COND", + "ZCON", + "ADDCON0", + "ADDCON", + "MOVCON", + "BITCON", + "ABCON", + "MBCON", + "LCON", + "VCON", + "FCON", + "VCONADDR", + "AACON", + "LACON", + "AECON", + "SBRA", + "LBRA", + "NPAUTO", + "NSAUTO", + "PSAUTO", + "PPAUTO", + "UAUTO4K", + "UAUTO8K", + "UAUTO16K", + "UAUTO32K", + "UAUTO64K", + "LAUTO", + "SEXT1", + "SEXT2", + "SEXT4", + "SEXT8", + "SEXT16", + "LEXT", + "ZOREG", + "NPOREG", + "NSOREG", + "PSOREG", + "PPOREG", + "UOREG4K", + "UOREG8K", + "UOREG16K", + "UOREG32K", + "UOREG64K", + "LOREG", + "ADDR", + "ROFF", + "GOK", + "TEXTSIZE", + "NCLASS", +} diff --git a/src/cmd/internal/obj/arm64/asm7.go b/src/cmd/internal/obj/arm64/asm7.go new file mode 100644 index 0000000000000000000000000000000000000000..ab0f7aebdb608f712ac1a179e0a3488affb007b8 --- /dev/null +++ b/src/cmd/internal/obj/arm64/asm7.go @@ -0,0 +1,4158 @@ +// cmd/7l/asm.c, cmd/7l/asmout.c, cmd/7l/optab.c, cmd/7l/span.c, cmd/ld/sub.c, cmd/ld/mod.c, from Vita Nuova. +// https://code.google.com/p/ken-cc/source/browse/ +// +// Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved. +// Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net) +// Portions Copyright © 1997-1999 Vita Nuova Limited +// Portions Copyright © 2000-2007 Vita Nuova Holdings Limited (www.vitanuova.com) +// Portions Copyright © 2004,2006 Bruce Ellis +// Portions Copyright © 2005-2007 C H Forsyth (forsyth@terzarima.net) +// Revisions Copyright © 2000-2007 Lucent Technologies Inc. and others +// Portions Copyright © 2009 The Go Authors. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +package arm64 + +import ( + "cmd/internal/obj" + "fmt" + "log" + "math" + "sort" +) + +const ( + FuncAlign = 16 +) + +const ( + REGFROM = 1 +) + +type Optab struct { + as uint16 + a1 uint8 + a2 uint8 + a3 uint8 + type_ int8 + size int8 + param int16 + flag int8 + scond uint16 +} + +type Oprange struct { + start []Optab + stop []Optab +} + +var oprange [ALAST]Oprange + +var xcmp [C_NCLASS][C_NCLASS]uint8 + +const ( + S32 = 0 << 31 + S64 = 1 << 31 + Sbit = 1 << 29 + LSL0_32 = 2 << 13 + LSL0_64 = 3 << 13 +) + +func OPDP2(x uint32) uint32 { + return 0<<30 | 0<<29 | 0xd6<<21 | x<<10 +} + +func OPDP3(sf uint32, op54 uint32, op31 uint32, o0 uint32) uint32 { + return sf<<31 | op54<<29 | 0x1B<<24 | op31<<21 | o0<<15 +} + +func OPBcc(x uint32) uint32 { + return 0x2A<<25 | 0<<24 | 0<<4 | x&15 +} + +func OPBLR(x uint32) uint32 { + /* x=0, JMP; 1, CALL; 2, RET */ + return 0x6B<<25 | 0<<23 | x<<21 | 0x1F<<16 | 0<<10 +} + +func SYSOP(l uint32, op0 uint32, op1 uint32, crn uint32, crm uint32, op2 uint32, rt uint32) uint32 { + return 0x354<<22 | l<<21 | op0<<19 | op1<<16 | crn&15<<12 | crm&15<<8 | op2<<5 | rt +} + +func SYSHINT(x uint32) uint32 { + return SYSOP(0, 0, 3, 2, 0, x, 0x1F) +} + +func LDSTR12U(sz uint32, v uint32, opc uint32) uint32 { + return sz<<30 | 7<<27 | v<<26 | 1<<24 | opc<<22 +} + +func LDSTR9S(sz uint32, v uint32, opc uint32) uint32 { + return sz<<30 | 7<<27 | v<<26 | 0<<24 | opc<<22 +} + +func LD2STR(o uint32) uint32 { + return o &^ (3 << 22) +} + +func LDSTX(sz uint32, o2 uint32, l uint32, o1 uint32, o0 uint32) uint32 { + return sz<<30 | 0x8<<24 | o2<<23 | l<<22 | o1<<21 | o0<<15 +} + +func FPCMP(m uint32, s uint32, type_ uint32, op uint32, op2 uint32) uint32 { + return m<<31 | s<<29 | 0x1E<<24 | type_<<22 | 1<<21 | op<<14 | 8<<10 | op2 +} + +func FPCCMP(m uint32, s uint32, type_ uint32, op uint32) uint32 { + return m<<31 | s<<29 | 0x1E<<24 | type_<<22 | 1<<21 | 1<<10 | op<<4 +} + +func FPOP1S(m uint32, s uint32, type_ uint32, op uint32) uint32 { + return m<<31 | s<<29 | 0x1E<<24 | type_<<22 | 1<<21 | op<<15 | 0x10<<10 +} + +func FPOP2S(m uint32, s uint32, type_ uint32, op uint32) uint32 { + return m<<31 | s<<29 | 0x1E<<24 | type_<<22 | 1<<21 | op<<12 | 2<<10 +} + +func FPCVTI(sf uint32, s uint32, type_ uint32, rmode uint32, op uint32) uint32 { + return sf<<31 | s<<29 | 0x1E<<24 | type_<<22 | 1<<21 | rmode<<19 | op<<16 | 0<<10 +} + +func ADR(p uint32, o uint32, rt uint32) uint32 { + return p<<31 | (o&3)<<29 | 0x10<<24 | ((o>>2)&0x7FFFF)<<5 | rt&31 +} + +func OPBIT(x uint32) uint32 { + return 1<<30 | 0<<29 | 0xD6<<21 | 0<<16 | x<<10 +} + +const ( + LFROM = 1 << 0 + LTO = 1 << 1 + LPOOL = 1 << 2 +) + +var optab = []Optab{ + /* struct Optab: + OPCODE, from, prog->reg, to, type,size,param,flag,scond */ + {obj.ATEXT, C_ADDR, C_NONE, C_TEXTSIZE, 0, 0, 0, 0, 0}, + + /* arithmetic operations */ + {AADD, C_REG, C_REG, C_REG, 1, 4, 0, 0, 0}, + {AADD, C_REG, C_NONE, C_REG, 1, 4, 0, 0, 0}, + {AADC, C_REG, C_REG, C_REG, 1, 4, 0, 0, 0}, + {AADC, C_REG, C_NONE, C_REG, 1, 4, 0, 0, 0}, + {ANEG, C_REG, C_NONE, C_REG, 25, 4, 0, 0, 0}, + {ANGC, C_REG, C_NONE, C_REG, 17, 4, 0, 0, 0}, + {ACMP, C_REG, C_REG, C_NONE, 1, 4, 0, 0, 0}, + {AADD, C_ADDCON, C_RSP, C_RSP, 2, 4, 0, 0, 0}, + {AADD, C_ADDCON, C_NONE, C_RSP, 2, 4, 0, 0, 0}, + {ACMP, C_ADDCON, C_RSP, C_NONE, 2, 4, 0, 0, 0}, + // TODO: these don't work properly. + // {AADD, C_MBCON, C_RSP, C_RSP, 2, 4, 0, 0, 0}, + // {AADD, C_MBCON, C_NONE, C_RSP, 2, 4, 0, 0, 0}, + // {ACMP, C_MBCON, C_RSP, C_NONE, 2, 4, 0, 0, 0}, + {AADD, C_VCON, C_RSP, C_RSP, 13, 8, 0, LFROM, 0}, + {AADD, C_VCON, C_NONE, C_RSP, 13, 8, 0, LFROM, 0}, + {ACMP, C_VCON, C_REG, C_NONE, 13, 8, 0, LFROM, 0}, + {AADD, C_SHIFT, C_REG, C_REG, 3, 4, 0, 0, 0}, + {AADD, C_SHIFT, C_NONE, C_REG, 3, 4, 0, 0, 0}, + {AMVN, C_SHIFT, C_NONE, C_REG, 3, 4, 0, 0, 0}, + {ACMP, C_SHIFT, C_REG, C_NONE, 3, 4, 0, 0, 0}, + {ANEG, C_SHIFT, C_NONE, C_REG, 26, 4, 0, 0, 0}, + {AADD, C_REG, C_RSP, C_RSP, 27, 4, 0, 0, 0}, + {AADD, C_REG, C_NONE, C_RSP, 27, 4, 0, 0, 0}, + {ACMP, C_REG, C_RSP, C_NONE, 27, 4, 0, 0, 0}, + {AADD, C_EXTREG, C_RSP, C_RSP, 27, 4, 0, 0, 0}, + {AADD, C_EXTREG, C_NONE, C_RSP, 27, 4, 0, 0, 0}, + {AMVN, C_EXTREG, C_NONE, C_RSP, 27, 4, 0, 0, 0}, + {ACMP, C_EXTREG, C_RSP, C_NONE, 27, 4, 0, 0, 0}, + {AADD, C_REG, C_REG, C_REG, 1, 4, 0, 0, 0}, + {AADD, C_REG, C_NONE, C_REG, 1, 4, 0, 0, 0}, + + /* logical operations */ + {AAND, C_REG, C_REG, C_REG, 1, 4, 0, 0, 0}, + {AAND, C_REG, C_NONE, C_REG, 1, 4, 0, 0, 0}, + {ABIC, C_REG, C_REG, C_REG, 1, 4, 0, 0, 0}, + {ABIC, C_REG, C_NONE, C_REG, 1, 4, 0, 0, 0}, + // TODO: these don't work properly. + // {AAND, C_BITCON, C_REG, C_REG, 53, 4, 0, 0, 0}, + // {AAND, C_BITCON, C_NONE, C_REG, 53, 4, 0, 0, 0}, + // {ABIC, C_BITCON, C_REG, C_REG, 53, 4, 0, 0, 0}, + // {ABIC, C_BITCON, C_NONE, C_REG, 53, 4, 0, 0, 0}, + {AAND, C_VCON, C_REG, C_REG, 28, 8, 0, LFROM, 0}, + {AAND, C_VCON, C_NONE, C_REG, 28, 8, 0, LFROM, 0}, + {ABIC, C_VCON, C_REG, C_REG, 28, 8, 0, LFROM, 0}, + {ABIC, C_VCON, C_NONE, C_REG, 28, 8, 0, LFROM, 0}, + {AAND, C_SHIFT, C_REG, C_REG, 3, 4, 0, 0, 0}, + {AAND, C_SHIFT, C_NONE, C_REG, 3, 4, 0, 0, 0}, + {ABIC, C_SHIFT, C_REG, C_REG, 3, 4, 0, 0, 0}, + {ABIC, C_SHIFT, C_NONE, C_REG, 3, 4, 0, 0, 0}, + {AMOVD, C_RSP, C_NONE, C_RSP, 24, 4, 0, 0, 0}, + {AMVN, C_REG, C_NONE, C_REG, 24, 4, 0, 0, 0}, + {AMOVB, C_REG, C_NONE, C_REG, 45, 4, 0, 0, 0}, + {AMOVBU, C_REG, C_NONE, C_REG, 45, 4, 0, 0, 0}, + {AMOVH, C_REG, C_NONE, C_REG, 45, 4, 0, 0, 0}, /* also MOVHU */ + {AMOVW, C_REG, C_NONE, C_REG, 45, 4, 0, 0, 0}, /* also MOVWU */ + /* TODO: MVN C_SHIFT */ + + /* MOVs that become MOVK/MOVN/MOVZ/ADD/SUB/OR */ + {AMOVW, C_MOVCON, C_NONE, C_REG, 32, 4, 0, 0, 0}, + {AMOVD, C_MOVCON, C_NONE, C_REG, 32, 4, 0, 0, 0}, + + // TODO: these don't work properly. + // { AMOVW, C_ADDCON, C_NONE, C_REG, 2, 4, 0 , 0}, + // { AMOVD, C_ADDCON, C_NONE, C_REG, 2, 4, 0 , 0}, + // { AMOVW, C_BITCON, C_NONE, C_REG, 53, 4, 0 , 0}, + // { AMOVD, C_BITCON, C_NONE, C_REG, 53, 4, 0 , 0}, + + {AMOVK, C_VCON, C_NONE, C_REG, 33, 4, 0, 0, 0}, + {AMOVD, C_AACON, C_NONE, C_REG, 4, 4, REGFROM, 0, 0}, + {ASDIV, C_REG, C_NONE, C_REG, 1, 4, 0, 0, 0}, + {ASDIV, C_REG, C_REG, C_REG, 1, 4, 0, 0, 0}, + {AB, C_NONE, C_NONE, C_SBRA, 5, 4, 0, 0, 0}, + {ABL, C_NONE, C_NONE, C_SBRA, 5, 4, 0, 0, 0}, + {AB, C_NONE, C_NONE, C_ZOREG, 6, 4, 0, 0, 0}, + {ABL, C_NONE, C_NONE, C_REG, 6, 4, 0, 0, 0}, + {ABL, C_REG, C_NONE, C_REG, 6, 4, 0, 0, 0}, + {ABL, C_NONE, C_NONE, C_ZOREG, 6, 4, 0, 0, 0}, + {obj.ARET, C_NONE, C_NONE, C_REG, 6, 4, 0, 0, 0}, + {obj.ARET, C_NONE, C_NONE, C_ZOREG, 6, 4, 0, 0, 0}, + {AADRP, C_SBRA, C_NONE, C_REG, 60, 4, 0, 0, 0}, + {AADR, C_SBRA, C_NONE, C_REG, 61, 4, 0, 0, 0}, + {ABFM, C_VCON, C_REG, C_REG, 42, 4, 0, 0, 0}, + {ABFI, C_VCON, C_REG, C_REG, 43, 4, 0, 0, 0}, + {AEXTR, C_VCON, C_REG, C_REG, 44, 4, 0, 0, 0}, + {ASXTB, C_REG, C_NONE, C_REG, 45, 4, 0, 0, 0}, + {ACLS, C_REG, C_NONE, C_REG, 46, 4, 0, 0, 0}, + {ABEQ, C_NONE, C_NONE, C_SBRA, 7, 4, 0, 0, 0}, + {ALSL, C_VCON, C_REG, C_REG, 8, 4, 0, 0, 0}, + {ALSL, C_VCON, C_NONE, C_REG, 8, 4, 0, 0, 0}, + {ALSL, C_REG, C_NONE, C_REG, 9, 4, 0, 0, 0}, + {ALSL, C_REG, C_REG, C_REG, 9, 4, 0, 0, 0}, + {ASVC, C_NONE, C_NONE, C_VCON, 10, 4, 0, 0, 0}, + {ASVC, C_NONE, C_NONE, C_NONE, 10, 4, 0, 0, 0}, + {ADWORD, C_NONE, C_NONE, C_VCON, 11, 8, 0, 0, 0}, + {ADWORD, C_NONE, C_NONE, C_LEXT, 11, 8, 0, 0, 0}, + {ADWORD, C_NONE, C_NONE, C_ADDR, 11, 8, 0, 0, 0}, + {ADWORD, C_NONE, C_NONE, C_LACON, 11, 8, 0, 0, 0}, + {AWORD, C_NONE, C_NONE, C_LCON, 14, 4, 0, 0, 0}, + {AWORD, C_NONE, C_NONE, C_LEXT, 14, 4, 0, 0, 0}, + {AWORD, C_NONE, C_NONE, C_ADDR, 14, 4, 0, 0, 0}, + {AMOVW, C_VCON, C_NONE, C_REG, 12, 4, 0, LFROM, 0}, + {AMOVW, C_VCONADDR, C_NONE, C_REG, 68, 8, 0, 0, 0}, + {AMOVD, C_VCON, C_NONE, C_REG, 12, 4, 0, LFROM, 0}, + {AMOVD, C_VCONADDR, C_NONE, C_REG, 68, 8, 0, 0, 0}, + {AMOVB, C_REG, C_NONE, C_ADDR, 64, 12, 0, 0, 0}, + {AMOVBU, C_REG, C_NONE, C_ADDR, 64, 12, 0, 0, 0}, + {AMOVH, C_REG, C_NONE, C_ADDR, 64, 12, 0, 0, 0}, + {AMOVW, C_REG, C_NONE, C_ADDR, 64, 12, 0, 0, 0}, + {AMOVD, C_REG, C_NONE, C_ADDR, 64, 12, 0, 0, 0}, + {AMOVB, C_ADDR, C_NONE, C_REG, 65, 12, 0, 0, 0}, + {AMOVBU, C_ADDR, C_NONE, C_REG, 65, 12, 0, 0, 0}, + {AMOVH, C_ADDR, C_NONE, C_REG, 65, 12, 0, 0, 0}, + {AMOVW, C_ADDR, C_NONE, C_REG, 65, 12, 0, 0, 0}, + {AMOVD, C_ADDR, C_NONE, C_REG, 65, 12, 0, 0, 0}, + {AMUL, C_REG, C_REG, C_REG, 15, 4, 0, 0, 0}, + {AMUL, C_REG, C_NONE, C_REG, 15, 4, 0, 0, 0}, + {AMADD, C_REG, C_REG, C_REG, 15, 4, 0, 0, 0}, + {AREM, C_REG, C_REG, C_REG, 16, 8, 0, 0, 0}, + {AREM, C_REG, C_NONE, C_REG, 16, 8, 0, 0, 0}, + {ACSEL, C_COND, C_REG, C_REG, 18, 4, 0, 0, 0}, /* from3 optional */ + {ACSET, C_COND, C_NONE, C_REG, 18, 4, 0, 0, 0}, + {ACCMN, C_COND, C_REG, C_VCON, 19, 4, 0, 0, 0}, /* from3 either C_REG or C_VCON */ + + /* scaled 12-bit unsigned displacement store */ + {AMOVB, C_REG, C_NONE, C_UAUTO4K, 20, 4, REGSP, 0, 0}, + {AMOVB, C_REG, C_NONE, C_UOREG4K, 20, 4, 0, 0, 0}, + {AMOVBU, C_REG, C_NONE, C_UAUTO4K, 20, 4, REGSP, 0, 0}, + {AMOVBU, C_REG, C_NONE, C_UOREG4K, 20, 4, 0, 0, 0}, + + {AMOVH, C_REG, C_NONE, C_UAUTO8K, 20, 4, REGSP, 0, 0}, + {AMOVH, C_REG, C_NONE, C_ZOREG, 20, 4, 0, 0, 0}, + {AMOVH, C_REG, C_NONE, C_UOREG8K, 20, 4, 0, 0, 0}, + + {AMOVW, C_REG, C_NONE, C_UAUTO16K, 20, 4, REGSP, 0, 0}, + {AMOVW, C_REG, C_NONE, C_ZOREG, 20, 4, 0, 0, 0}, + {AMOVW, C_REG, C_NONE, C_UOREG16K, 20, 4, 0, 0, 0}, + + /* unscaled 9-bit signed displacement store */ + {AMOVB, C_REG, C_NONE, C_NSAUTO, 20, 4, REGSP, 0, 0}, + {AMOVB, C_REG, C_NONE, C_NSOREG, 20, 4, 0, 0, 0}, + {AMOVBU, C_REG, C_NONE, C_NSAUTO, 20, 4, REGSP, 0, 0}, + {AMOVBU, C_REG, C_NONE, C_NSOREG, 20, 4, 0, 0, 0}, + + {AMOVH, C_REG, C_NONE, C_NSAUTO, 20, 4, REGSP, 0, 0}, + {AMOVH, C_REG, C_NONE, C_NSOREG, 20, 4, 0, 0, 0}, + {AMOVW, C_REG, C_NONE, C_NSAUTO, 20, 4, REGSP, 0, 0}, + {AMOVW, C_REG, C_NONE, C_NSOREG, 20, 4, 0, 0, 0}, + + {AMOVD, C_REG, C_NONE, C_UAUTO32K, 20, 4, REGSP, 0, 0}, + {AMOVD, C_REG, C_NONE, C_ZOREG, 20, 4, 0, 0, 0}, + {AMOVD, C_REG, C_NONE, C_UOREG32K, 20, 4, 0, 0, 0}, + {AMOVD, C_REG, C_NONE, C_NSOREG, 20, 4, 0, 0, 0}, + {AMOVD, C_REG, C_NONE, C_NSAUTO, 20, 4, REGSP, 0, 0}, + + /* short displacement load */ + {AMOVB, C_UAUTO4K, C_NONE, C_REG, 21, 4, REGSP, 0, 0}, + {AMOVB, C_NSAUTO, C_NONE, C_REG, 21, 4, REGSP, 0, 0}, + {AMOVB, C_ZOREG, C_NONE, C_REG, 21, 4, 0, 0, 0}, + {AMOVB, C_UOREG4K, C_NONE, C_REG, 21, 4, REGSP, 0, 0}, + {AMOVB, C_NSOREG, C_NONE, C_REG, 21, 4, REGSP, 0, 0}, + + {AMOVBU, C_UAUTO4K, C_NONE, C_REG, 21, 4, REGSP, 0, 0}, + {AMOVBU, C_NSAUTO, C_NONE, C_REG, 21, 4, REGSP, 0, 0}, + {AMOVBU, C_ZOREG, C_NONE, C_REG, 21, 4, 0, 0, 0}, + {AMOVBU, C_UOREG4K, C_NONE, C_REG, 21, 4, REGSP, 0, 0}, + {AMOVBU, C_NSOREG, C_NONE, C_REG, 21, 4, REGSP, 0, 0}, + + {AMOVH, C_UAUTO8K, C_NONE, C_REG, 21, 4, REGSP, 0, 0}, + {AMOVH, C_NSAUTO, C_NONE, C_REG, 21, 4, REGSP, 0, 0}, + {AMOVH, C_ZOREG, C_NONE, C_REG, 21, 4, 0, 0, 0}, + {AMOVH, C_UOREG8K, C_NONE, C_REG, 21, 4, REGSP, 0, 0}, + {AMOVH, C_NSOREG, C_NONE, C_REG, 21, 4, REGSP, 0, 0}, + + {AMOVW, C_UAUTO16K, C_NONE, C_REG, 21, 4, REGSP, 0, 0}, + {AMOVW, C_NSAUTO, C_NONE, C_REG, 21, 4, REGSP, 0, 0}, + {AMOVW, C_ZOREG, C_NONE, C_REG, 21, 4, 0, 0, 0}, + {AMOVW, C_UOREG16K, C_NONE, C_REG, 21, 4, REGSP, 0, 0}, + {AMOVW, C_NSOREG, C_NONE, C_REG, 21, 4, REGSP, 0, 0}, + + {AMOVD, C_UAUTO32K, C_NONE, C_REG, 21, 4, REGSP, 0, 0}, + {AMOVD, C_NSAUTO, C_NONE, C_REG, 21, 4, REGSP, 0, 0}, + {AMOVD, C_ZOREG, C_NONE, C_REG, 21, 4, 0, 0, 0}, + {AMOVD, C_UOREG32K, C_NONE, C_REG, 21, 4, REGSP, 0, 0}, + {AMOVD, C_NSOREG, C_NONE, C_REG, 21, 4, REGSP, 0, 0}, + + /* long displacement store */ + {AMOVB, C_REG, C_NONE, C_LAUTO, 30, 8, REGSP, 0, 0}, + {AMOVB, C_REG, C_NONE, C_LOREG, 30, 8, 0, 0, 0}, + {AMOVBU, C_REG, C_NONE, C_LAUTO, 30, 8, REGSP, 0, 0}, + {AMOVBU, C_REG, C_NONE, C_LOREG, 30, 8, 0, 0, 0}, + {AMOVH, C_REG, C_NONE, C_LAUTO, 30, 8, REGSP, 0, 0}, + {AMOVH, C_REG, C_NONE, C_LOREG, 30, 8, 0, 0, 0}, + {AMOVW, C_REG, C_NONE, C_LAUTO, 30, 8, REGSP, 0, 0}, + {AMOVW, C_REG, C_NONE, C_LOREG, 30, 8, 0, 0, 0}, + {AMOVD, C_REG, C_NONE, C_LAUTO, 30, 8, REGSP, 0, 0}, + {AMOVD, C_REG, C_NONE, C_LOREG, 30, 8, 0, 0, 0}, + + /* long displacement load */ + {AMOVB, C_LAUTO, C_NONE, C_REG, 31, 8, REGSP, 0, 0}, + {AMOVB, C_LOREG, C_NONE, C_REG, 31, 8, 0, 0, 0}, + {AMOVB, C_LOREG, C_NONE, C_REG, 31, 8, 0, 0, 0}, + {AMOVBU, C_LAUTO, C_NONE, C_REG, 31, 8, REGSP, 0, 0}, + {AMOVBU, C_LOREG, C_NONE, C_REG, 31, 8, 0, 0, 0}, + {AMOVBU, C_LOREG, C_NONE, C_REG, 31, 8, 0, 0, 0}, + {AMOVH, C_LAUTO, C_NONE, C_REG, 31, 8, REGSP, 0, 0}, + {AMOVH, C_LOREG, C_NONE, C_REG, 31, 8, 0, 0, 0}, + {AMOVH, C_LOREG, C_NONE, C_REG, 31, 8, 0, 0, 0}, + {AMOVW, C_LAUTO, C_NONE, C_REG, 31, 8, REGSP, 0, 0}, + {AMOVW, C_LOREG, C_NONE, C_REG, 31, 8, 0, 0, 0}, + {AMOVW, C_LOREG, C_NONE, C_REG, 31, 8, 0, 0, 0}, + {AMOVD, C_LAUTO, C_NONE, C_REG, 31, 8, REGSP, 0, 0}, + {AMOVD, C_LOREG, C_NONE, C_REG, 31, 8, 0, 0, 0}, + {AMOVD, C_LOREG, C_NONE, C_REG, 31, 8, 0, 0, 0}, + + /* load long effective stack address (load int32 offset and add) */ + {AMOVD, C_LACON, C_NONE, C_REG, 34, 8, REGSP, LFROM, 0}, + + /* pre/post-indexed load (unscaled, signed 9-bit offset) */ + {AMOVD, C_LOREG, C_NONE, C_REG, 22, 4, 0, 0, C_XPOST}, + {AMOVW, C_LOREG, C_NONE, C_REG, 22, 4, 0, 0, C_XPOST}, + {AMOVH, C_LOREG, C_NONE, C_REG, 22, 4, 0, 0, C_XPOST}, + {AMOVB, C_LOREG, C_NONE, C_REG, 22, 4, 0, 0, C_XPOST}, + {AMOVBU, C_LOREG, C_NONE, C_REG, 22, 4, 0, 0, C_XPOST}, + {AFMOVS, C_LOREG, C_NONE, C_FREG, 22, 4, 0, 0, C_XPOST}, + {AFMOVD, C_LOREG, C_NONE, C_FREG, 22, 4, 0, 0, C_XPOST}, + {AMOVD, C_LOREG, C_NONE, C_REG, 22, 4, 0, 0, C_XPRE}, + {AMOVW, C_LOREG, C_NONE, C_REG, 22, 4, 0, 0, C_XPRE}, + {AMOVH, C_LOREG, C_NONE, C_REG, 22, 4, 0, 0, C_XPRE}, + {AMOVB, C_LOREG, C_NONE, C_REG, 22, 4, 0, 0, C_XPRE}, + {AMOVBU, C_LOREG, C_NONE, C_REG, 22, 4, 0, 0, C_XPRE}, + {AFMOVS, C_LOREG, C_NONE, C_FREG, 22, 4, 0, 0, C_XPRE}, + {AFMOVD, C_LOREG, C_NONE, C_FREG, 22, 4, 0, 0, C_XPRE}, + + /* pre/post-indexed store (unscaled, signed 9-bit offset) */ + {AMOVD, C_REG, C_NONE, C_LOREG, 23, 4, 0, 0, C_XPOST}, + {AMOVW, C_REG, C_NONE, C_LOREG, 23, 4, 0, 0, C_XPOST}, + {AMOVH, C_REG, C_NONE, C_LOREG, 23, 4, 0, 0, C_XPOST}, + {AMOVB, C_REG, C_NONE, C_LOREG, 23, 4, 0, 0, C_XPOST}, + {AMOVBU, C_REG, C_NONE, C_LOREG, 23, 4, 0, 0, C_XPOST}, + {AFMOVS, C_FREG, C_NONE, C_LOREG, 23, 4, 0, 0, C_XPOST}, + {AFMOVD, C_FREG, C_NONE, C_LOREG, 23, 4, 0, 0, C_XPOST}, + {AMOVD, C_REG, C_NONE, C_LOREG, 23, 4, 0, 0, C_XPRE}, + {AMOVW, C_REG, C_NONE, C_LOREG, 23, 4, 0, 0, C_XPRE}, + {AMOVH, C_REG, C_NONE, C_LOREG, 23, 4, 0, 0, C_XPRE}, + {AMOVB, C_REG, C_NONE, C_LOREG, 23, 4, 0, 0, C_XPRE}, + {AMOVBU, C_REG, C_NONE, C_LOREG, 23, 4, 0, 0, C_XPRE}, + {AFMOVS, C_FREG, C_NONE, C_LOREG, 23, 4, 0, 0, C_XPRE}, + {AFMOVD, C_FREG, C_NONE, C_LOREG, 23, 4, 0, 0, C_XPRE}, + + /* pre/post-indexed load/store register pair + (unscaled, signed 10-bit quad-aligned offset) */ + {ALDP, C_LOREG, C_NONE, C_PAIR, 66, 4, 0, 0, C_XPRE}, + {ALDP, C_LOREG, C_NONE, C_PAIR, 66, 4, 0, 0, C_XPOST}, + {ASTP, C_PAIR, C_NONE, C_LOREG, 67, 4, 0, 0, C_XPRE}, + {ASTP, C_PAIR, C_NONE, C_LOREG, 67, 4, 0, 0, C_XPOST}, + + /* special */ + {AMOVD, C_SPR, C_NONE, C_REG, 35, 4, 0, 0, 0}, + {AMRS, C_SPR, C_NONE, C_REG, 35, 4, 0, 0, 0}, + {AMOVD, C_REG, C_NONE, C_SPR, 36, 4, 0, 0, 0}, + {AMSR, C_REG, C_NONE, C_SPR, 36, 4, 0, 0, 0}, + {AMOVD, C_VCON, C_NONE, C_SPR, 37, 4, 0, 0, 0}, + {AMSR, C_VCON, C_NONE, C_SPR, 37, 4, 0, 0, 0}, + {AERET, C_NONE, C_NONE, C_NONE, 41, 4, 0, 0, 0}, + {AFMOVS, C_FREG, C_NONE, C_UAUTO16K, 20, 4, REGSP, 0, 0}, + {AFMOVS, C_FREG, C_NONE, C_NSAUTO, 20, 4, REGSP, 0, 0}, + {AFMOVS, C_FREG, C_NONE, C_ZOREG, 20, 4, 0, 0, 0}, + {AFMOVS, C_FREG, C_NONE, C_UOREG16K, 20, 4, 0, 0, 0}, + {AFMOVS, C_FREG, C_NONE, C_NSOREG, 20, 4, 0, 0, 0}, + {AFMOVD, C_FREG, C_NONE, C_UAUTO32K, 20, 4, REGSP, 0, 0}, + {AFMOVD, C_FREG, C_NONE, C_NSAUTO, 20, 4, REGSP, 0, 0}, + {AFMOVD, C_FREG, C_NONE, C_ZOREG, 20, 4, 0, 0, 0}, + {AFMOVD, C_FREG, C_NONE, C_UOREG32K, 20, 4, 0, 0, 0}, + {AFMOVD, C_FREG, C_NONE, C_NSOREG, 20, 4, 0, 0, 0}, + {AFMOVS, C_UAUTO16K, C_NONE, C_FREG, 21, 4, REGSP, 0, 0}, + {AFMOVS, C_NSAUTO, C_NONE, C_FREG, 21, 4, REGSP, 0, 0}, + {AFMOVS, C_ZOREG, C_NONE, C_FREG, 21, 4, 0, 0, 0}, + {AFMOVS, C_UOREG16K, C_NONE, C_FREG, 21, 4, 0, 0, 0}, + {AFMOVS, C_NSOREG, C_NONE, C_FREG, 21, 4, 0, 0, 0}, + {AFMOVD, C_UAUTO32K, C_NONE, C_FREG, 21, 4, REGSP, 0, 0}, + {AFMOVD, C_NSAUTO, C_NONE, C_FREG, 21, 4, REGSP, 0, 0}, + {AFMOVD, C_ZOREG, C_NONE, C_FREG, 21, 4, 0, 0, 0}, + {AFMOVD, C_UOREG32K, C_NONE, C_FREG, 21, 4, 0, 0, 0}, + {AFMOVD, C_NSOREG, C_NONE, C_FREG, 21, 4, 0, 0, 0}, + {AFMOVS, C_FREG, C_NONE, C_LAUTO, 30, 8, REGSP, LTO, 0}, + {AFMOVS, C_FREG, C_NONE, C_LOREG, 30, 8, 0, LTO, 0}, + {AFMOVD, C_FREG, C_NONE, C_LAUTO, 30, 8, REGSP, LTO, 0}, + {AFMOVD, C_FREG, C_NONE, C_LOREG, 30, 8, 0, LTO, 0}, + {AFMOVS, C_LAUTO, C_NONE, C_FREG, 31, 8, REGSP, LFROM, 0}, + {AFMOVS, C_LOREG, C_NONE, C_FREG, 31, 8, 0, LFROM, 0}, + {AFMOVD, C_LAUTO, C_NONE, C_FREG, 31, 8, REGSP, LFROM, 0}, + {AFMOVD, C_LOREG, C_NONE, C_FREG, 31, 8, 0, LFROM, 0}, + {AFMOVS, C_FREG, C_NONE, C_ADDR, 64, 12, 0, 0, 0}, + {AFMOVS, C_ADDR, C_NONE, C_FREG, 65, 12, 0, 0, 0}, + {AFMOVD, C_FREG, C_NONE, C_ADDR, 64, 12, 0, 0, 0}, + {AFMOVD, C_ADDR, C_NONE, C_FREG, 65, 12, 0, 0, 0}, + {AFADDS, C_FREG, C_NONE, C_FREG, 54, 4, 0, 0, 0}, + {AFADDS, C_FREG, C_FREG, C_FREG, 54, 4, 0, 0, 0}, + {AFADDS, C_FCON, C_NONE, C_FREG, 54, 4, 0, 0, 0}, + {AFADDS, C_FCON, C_FREG, C_FREG, 54, 4, 0, 0, 0}, + {AFMOVS, C_FCON, C_NONE, C_FREG, 54, 4, 0, 0, 0}, + {AFMOVS, C_FREG, C_NONE, C_FREG, 54, 4, 0, 0, 0}, + {AFMOVD, C_FCON, C_NONE, C_FREG, 54, 4, 0, 0, 0}, + {AFMOVD, C_FREG, C_NONE, C_FREG, 54, 4, 0, 0, 0}, + {AFCVTZSD, C_FREG, C_NONE, C_REG, 29, 4, 0, 0, 0}, + {ASCVTFD, C_REG, C_NONE, C_FREG, 29, 4, 0, 0, 0}, + {AFCMPS, C_FREG, C_FREG, C_NONE, 56, 4, 0, 0, 0}, + {AFCMPS, C_FCON, C_FREG, C_NONE, 56, 4, 0, 0, 0}, + {AFCCMPS, C_COND, C_REG, C_VCON, 57, 4, 0, 0, 0}, + {AFCSELD, C_COND, C_REG, C_FREG, 18, 4, 0, 0, 0}, + {AFCVTSD, C_FREG, C_NONE, C_FREG, 29, 4, 0, 0, 0}, + {ACASE, C_REG, C_NONE, C_REG, 62, 4 * 4, 0, 0, 0}, + {ABCASE, C_NONE, C_NONE, C_SBRA, 63, 4, 0, 0, 0}, + {ACLREX, C_NONE, C_NONE, C_VCON, 38, 4, 0, 0, 0}, + {ACLREX, C_NONE, C_NONE, C_NONE, 38, 4, 0, 0, 0}, + {ACBZ, C_REG, C_NONE, C_SBRA, 39, 4, 0, 0, 0}, + {ATBZ, C_VCON, C_REG, C_SBRA, 40, 4, 0, 0, 0}, + {ASYS, C_VCON, C_NONE, C_NONE, 50, 4, 0, 0, 0}, + {ASYS, C_VCON, C_REG, C_NONE, 50, 4, 0, 0, 0}, + {ASYSL, C_VCON, C_NONE, C_REG, 50, 4, 0, 0, 0}, + {ADMB, C_VCON, C_NONE, C_NONE, 51, 4, 0, 0, 0}, + {AHINT, C_VCON, C_NONE, C_NONE, 52, 4, 0, 0, 0}, + {ALDAR, C_ZOREG, C_NONE, C_REG, 58, 4, 0, 0, 0}, + {ALDXR, C_ZOREG, C_NONE, C_REG, 58, 4, 0, 0, 0}, + {ALDAXR, C_ZOREG, C_NONE, C_REG, 58, 4, 0, 0, 0}, + {ALDXP, C_ZOREG, C_REG, C_REG, 58, 4, 0, 0, 0}, + {ASTLR, C_REG, C_NONE, C_ZOREG, 59, 4, 0, 0, 0}, // to3=C_NONE + {ASTXR, C_REG, C_NONE, C_ZOREG, 59, 4, 0, 0, 0}, // to3=C_REG + {ASTLXR, C_REG, C_NONE, C_ZOREG, 59, 4, 0, 0, 0}, // to3=C_REG + + // { ASTXP, C_REG, C_NONE, C_ZOREG, 59, 4, 0 , 0}, // TODO(aram): + + {AAESD, C_VREG, C_NONE, C_VREG, 29, 4, 0, 0, 0}, + {ASHA1C, C_VREG, C_REG, C_VREG, 1, 4, 0, 0, 0}, + + {obj.AUNDEF, C_NONE, C_NONE, C_NONE, 90, 4, 0, 0, 0}, + {obj.AUSEFIELD, C_ADDR, C_NONE, C_NONE, 0, 0, 0, 0, 0}, + {obj.APCDATA, C_VCON, C_NONE, C_VCON, 0, 0, 0, 0, 0}, + {obj.AFUNCDATA, C_VCON, C_NONE, C_ADDR, 0, 0, 0, 0, 0}, + {obj.ANOP, C_NONE, C_NONE, C_NONE, 0, 0, 0, 0, 0}, + {obj.ADUFFZERO, C_NONE, C_NONE, C_SBRA, 5, 4, 0, 0, 0}, // same as AB/ABL + {obj.ADUFFCOPY, C_NONE, C_NONE, C_SBRA, 5, 4, 0, 0, 0}, // same as AB/ABL + + {obj.AXXX, C_NONE, C_NONE, C_NONE, 0, 4, 0, 0, 0}, +} + +/* + * valid pstate field values, and value to use in instruction + */ +var pstatefield = []struct { + a uint32 + b uint32 +}{ + {REG_SPSel, 0<<16 | 4<<12 | 5<<5}, + {REG_DAIFSet, 3<<16 | 4<<12 | 6<<5}, + {REG_DAIFClr, 3<<16 | 4<<12 | 7<<5}, +} + +var pool struct { + start uint32 + size uint32 +} + +func prasm(p *obj.Prog) { + fmt.Printf("%v\n", p) +} + +func span7(ctxt *obj.Link, cursym *obj.LSym) { + p := cursym.Text + if p == nil || p.Link == nil { // handle external functions and ELF section symbols + return + } + ctxt.Cursym = cursym + ctxt.Autosize = int32(p.To.Offset&0xffffffff) + 8 + + if oprange[AAND].start == nil { + buildop(ctxt) + } + + bflag := 0 + c := int32(0) + p.Pc = int64(c) + var m int + var o *Optab + for p = p.Link; p != nil; p = p.Link { + ctxt.Curp = p + if p.As == ADWORD && (c&7) != 0 { + c += 4 + } + p.Pc = int64(c) + o = oplook(ctxt, p) + m = int(o.size) + if m == 0 { + if p.As != obj.ANOP && p.As != obj.AFUNCDATA && p.As != obj.APCDATA { + ctxt.Diag("zero-width instruction\n%v", p) + } + continue + } + + switch o.flag & (LFROM | LTO) { + case LFROM: + addpool(ctxt, p, &p.From) + + case LTO: + addpool(ctxt, p, &p.To) + break + } + + if p.As == AB || p.As == obj.ARET || p.As == AERET { /* TODO: other unconditional operations */ + checkpool(ctxt, p, 0) + } + c += int32(m) + if ctxt.Blitrl != nil { + checkpool(ctxt, p, 1) + } + } + + cursym.Size = int64(c) + + /* + * if any procedure is large enough to + * generate a large SBRA branch, then + * generate extra passes putting branches + * around jmps to fix. this is rare. + */ + for bflag != 0 { + bflag = 0 + c = 0 + for p = cursym.Text; p != nil; p = p.Link { + if p.As == ADWORD && (c&7) != 0 { + c += 4 + } + p.Pc = int64(c) + o = oplook(ctxt, p) + + /* very large branches + if(o->type == 6 && p->cond) { + otxt = p->cond->pc - c; + if(otxt < 0) + otxt = -otxt; + if(otxt >= (1L<<17) - 10) { + q = ctxt->arch->prg(); + q->link = p->link; + p->link = q; + q->as = AB; + q->to.type = obj.TYPE_BRANCH; + q->cond = p->cond; + p->cond = q; + q = ctxt->arch->prg(); + q->link = p->link; + p->link = q; + q->as = AB; + q->to.type = obj.TYPE_BRANCH; + q->cond = q->link->link; + bflag = 1; + } + } + */ + m = int(o.size) + + if m == 0 { + if p.As != obj.ANOP && p.As != obj.AFUNCDATA && p.As != obj.APCDATA { + ctxt.Diag("zero-width instruction\n%v", p) + } + continue + } + + c += int32(m) + } + } + + c += -c & (FuncAlign - 1) + cursym.Size = int64(c) + + /* + * lay out the code, emitting code and data relocations. + */ + if ctxt.Tlsg == nil { + ctxt.Tlsg = obj.Linklookup(ctxt, "runtime.tlsg", 0) + } + obj.Symgrow(ctxt, cursym, cursym.Size) + bp := cursym.P + psz := int32(0) + var i int + var out [6]uint32 + for p := cursym.Text.Link; p != nil; p = p.Link { + ctxt.Pc = p.Pc + ctxt.Curp = p + o = oplook(ctxt, p) + + // need to align DWORDs on 8-byte boundary. The ISA doesn't + // require it, but the various 64-bit loads we generate assume it. + if o.as == ADWORD && psz%8 != 0 { + bp[3] = 0 + bp[2] = bp[3] + bp[1] = bp[2] + bp[0] = bp[1] + bp = bp[4:] + psz += 4 + } + + if int(o.size) > 4*len(out) { + log.Fatalf("out array in span7 is too small, need at least %d for %v", o.size/4, p) + } + asmout(ctxt, p, o, out[:]) + for i = 0; i < int(o.size/4); i++ { + ctxt.Arch.ByteOrder.PutUint32(bp, out[i]) + bp = bp[4:] + psz += 4 + } + } +} + +/* + * when the first reference to the literal pool threatens + * to go out of range of a 1Mb PC-relative offset + * drop the pool now, and branch round it. + */ +func checkpool(ctxt *obj.Link, p *obj.Prog, skip int) { + if pool.size >= 0xffff0 || !(ispcdisp(int32(p.Pc+4+int64(pool.size)-int64(pool.start)+8)) != 0) { + flushpool(ctxt, p, skip) + } else if p.Link == nil { + flushpool(ctxt, p, 2) + } +} + +func flushpool(ctxt *obj.Link, p *obj.Prog, skip int) { + if ctxt.Blitrl != nil { + if skip != 0 { + if ctxt.Debugvlog != 0 && skip == 1 { + fmt.Printf("note: flush literal pool at %#x: len=%d ref=%x\n", uint64(p.Pc+4), pool.size, pool.start) + } + q := ctxt.NewProg() + q.As = AB + q.To.Type = obj.TYPE_BRANCH + q.Pcond = p.Link + q.Link = ctxt.Blitrl + q.Lineno = p.Lineno + ctxt.Blitrl = q + } else if p.Pc+int64(pool.size)-int64(pool.start) < 1024*1024 { + return + } + + // The line number for constant pool entries doesn't really matter. + // We set it to the line number of the preceding instruction so that + // there are no deltas to encode in the pc-line tables. + for q := ctxt.Blitrl; q != nil; q = q.Link { + q.Lineno = p.Lineno + } + + ctxt.Elitrl.Link = p.Link + p.Link = ctxt.Blitrl + + ctxt.Blitrl = nil /* BUG: should refer back to values until out-of-range */ + ctxt.Elitrl = nil + pool.size = 0 + pool.start = 0 + } +} + +/* + * TODO: hash + */ +func addpool(ctxt *obj.Link, p *obj.Prog, a *obj.Addr) { + c := aclass(ctxt, a) + t := *ctxt.NewProg() + t.As = AWORD + sz := 4 + + // MOVW foo(SB), R is actually + // MOV addr, REGTEMP + // MOVW REGTEMP, R + // where addr is the address of the DWORD containing the address of foo. + if p.As == AMOVD || c == C_ADDR || c == C_VCON { + t.As = ADWORD + sz = 8 + } + + switch c { + // TODO(aram): remove. + default: + if a.Name != obj.NAME_EXTERN { + fmt.Printf("addpool: %v in %v shouldn't go to default case\n", DRconv(c), p) + } + + t.To.Offset = a.Offset + t.To.Sym = a.Sym + t.To.Type = a.Type + t.To.Name = a.Name + + /* This is here to work around a bug where we generate negative + operands that match C_MOVCON, but we use them with + instructions that only accept unsigned immediates. This + will cause oplook to return a variant of the instruction + that loads the negative constant from memory, rather than + using the immediate form. Because of that load, we get here, + so we need to know what to do with C_MOVCON. + + The correct fix is to use the "negation" instruction variant, + e.g. CMN $1, R instead of CMP $-1, R, or SUB $1, R instead + of ADD $-1, R. */ + case C_MOVCON, + + /* This is here because MOV uint12<<12, R is disabled in optab. + Because of this, we need to load the constant from memory. */ + C_ADDCON, + + /* These are here because they are disabled in optab. + Because of this, we need to load the constant from memory. */ + C_BITCON, + C_ABCON, + C_MBCON, + C_PSAUTO, + C_PPAUTO, + C_UAUTO4K, + C_UAUTO8K, + C_UAUTO16K, + C_UAUTO32K, + C_UAUTO64K, + C_NSAUTO, + C_NPAUTO, + C_LAUTO, + C_PPOREG, + C_PSOREG, + C_UOREG4K, + C_UOREG8K, + C_UOREG16K, + C_UOREG32K, + C_UOREG64K, + C_NSOREG, + C_NPOREG, + C_LOREG, + C_LACON, + C_LCON, + C_VCON: + if a.Name == obj.NAME_EXTERN { + fmt.Printf("addpool: %v in %v needs reloc\n", DRconv(c), p) + } + + t.To.Type = obj.TYPE_CONST + t.To.Offset = ctxt.Instoffset + break + } + + for q := ctxt.Blitrl; q != nil; q = q.Link { /* could hash on t.t0.offset */ + if q.To == t.To { + p.Pcond = q + return + } + } + + q := ctxt.NewProg() + *q = t + q.Pc = int64(pool.size) + if ctxt.Blitrl == nil { + ctxt.Blitrl = q + pool.start = uint32(p.Pc) + } else { + ctxt.Elitrl.Link = q + } + ctxt.Elitrl = q + pool.size = -pool.size & (FuncAlign - 1) + pool.size += uint32(sz) + p.Pcond = q +} + +func regoff(ctxt *obj.Link, a *obj.Addr) uint32 { + ctxt.Instoffset = 0 + aclass(ctxt, a) + return uint32(ctxt.Instoffset) +} + +func ispcdisp(v int32) int { + /* pc-relative addressing will reach? */ + return obj.Bool2int(v >= -0xfffff && v <= 0xfffff && (v&3) == 0) +} + +func isaddcon(v int64) int { + /* uimm12 or uimm24? */ + if v < 0 { + return 0 + } + if (v & 0xFFF) == 0 { + v >>= 12 + } + return obj.Bool2int(v <= 0xFFF) +} + +func isbitcon(v uint64) int { + /* fancy bimm32 or bimm64? */ + // TODO(aram): + return 0 + // return obj.Bool2int(findmask(v) != nil || (v>>32) == 0 && findmask(v|(v<<32)) != nil) +} + +func autoclass(l int64) int { + if l < 0 { + if l >= -256 { + return C_NSAUTO + } + if l >= -512 && (l&7) == 0 { + return C_NPAUTO + } + return C_LAUTO + } + + if l <= 255 { + return C_PSAUTO + } + if l <= 504 && (l&7) == 0 { + return C_PPAUTO + } + if l <= 4095 { + return C_UAUTO4K + } + if l <= 8190 && (l&1) == 0 { + return C_UAUTO8K + } + if l <= 16380 && (l&3) == 0 { + return C_UAUTO16K + } + if l <= 32760 && (l&7) == 0 { + return C_UAUTO32K + } + if l <= 65520 && (l&0xF) == 0 { + return C_UAUTO64K + } + return C_LAUTO +} + +func oregclass(l int64) int { + if l == 0 { + return C_ZOREG + } + return autoclass(l) - C_NPAUTO + C_NPOREG +} + +/* + * given an offset v and a class c (see above) + * return the offset value to use in the instruction, + * scaled if necessary + */ +func offsetshift(ctxt *obj.Link, v int64, c int) int64 { + s := 0 + if c >= C_SEXT1 && c <= C_SEXT16 { + s = c - C_SEXT1 + } else if c >= C_UAUTO4K && c <= C_UAUTO64K { + s = c - C_UAUTO4K + } else if c >= C_UOREG4K && c <= C_UOREG64K { + s = c - C_UOREG4K + } + vs := v >> uint(s) + if vs<= REG_SPECIAL: + return C_SPR + } + return C_GOK +} + +func aclass(ctxt *obj.Link, a *obj.Addr) int { + switch a.Type { + case obj.TYPE_NONE: + return C_NONE + + case obj.TYPE_REG: + return rclass(a.Reg) + + case obj.TYPE_REGREG: + return C_PAIR + + case obj.TYPE_SHIFT: + return C_SHIFT + + case obj.TYPE_MEM: + switch a.Name { + case obj.NAME_EXTERN, + obj.NAME_STATIC: + if a.Sym == nil { + break + } + ctxt.Instoffset = a.Offset + if a.Sym != nil { // use relocation + return C_ADDR + } + return C_LEXT + + case obj.NAME_AUTO: + ctxt.Instoffset = int64(ctxt.Autosize) + a.Offset + return autoclass(ctxt.Instoffset) + + case obj.NAME_PARAM: + ctxt.Instoffset = int64(ctxt.Autosize) + a.Offset + 8 + return autoclass(ctxt.Instoffset) + + case obj.TYPE_NONE: + ctxt.Instoffset = a.Offset + return oregclass(ctxt.Instoffset) + } + return C_GOK + + case obj.TYPE_FCONST: + return C_FCON + + case obj.TYPE_TEXTSIZE: + return C_TEXTSIZE + + case obj.TYPE_CONST, + obj.TYPE_ADDR: + switch a.Name { + case obj.TYPE_NONE: + ctxt.Instoffset = a.Offset + if a.Reg != 0 && a.Reg != REGZERO { + goto aconsize + } + v := ctxt.Instoffset + if v == 0 { + return C_ZCON + } + if isaddcon(v) != 0 { + if v <= 0xFFF { + return C_ADDCON0 + } + if isbitcon(uint64(v)) != 0 { + return C_ABCON + } + return C_ADDCON + } + + t := movcon(v) + if t >= 0 { + if isbitcon(uint64(v)) != 0 { + return C_MBCON + } + return C_MOVCON + } + + t = movcon(^v) + if t >= 0 { + if isbitcon(uint64(v)) != 0 { + return C_MBCON + } + return C_MOVCON + } + + if isbitcon(uint64(v)) != 0 { + return C_BITCON + } + + if uint64(v) == uint64(uint32(v)) || v == int64(int32(v)) { + return C_LCON + } + return C_VCON + + case obj.NAME_EXTERN, + obj.NAME_STATIC: + s := a.Sym + if s == nil { + break + } + ctxt.Instoffset = a.Offset + return C_VCONADDR + + case obj.NAME_AUTO: + ctxt.Instoffset = int64(ctxt.Autosize) + a.Offset + goto aconsize + + case obj.NAME_PARAM: + ctxt.Instoffset = int64(ctxt.Autosize) + a.Offset + 8 + goto aconsize + } + return C_GOK + + aconsize: + if isaddcon(ctxt.Instoffset) != 0 { + return C_AACON + } + return C_LACON + + case obj.TYPE_BRANCH: + return C_SBRA + } + + return C_GOK +} + +func oplook(ctxt *obj.Link, p *obj.Prog) *Optab { + a1 := int(p.Optab) + if a1 != 0 { + return &optab[a1-1:][0] + } + a1 = int(p.From.Class) + if a1 == 0 { + a1 = aclass(ctxt, &p.From) + 1 + p.From.Class = int8(a1) + } + + a1-- + a3 := int(p.To.Class) + if a3 == 0 { + a3 = aclass(ctxt, &p.To) + 1 + p.To.Class = int8(a3) + } + + a3-- + a2 := C_NONE + if p.Reg != 0 { + a2 = rclass(p.Reg) + } + r := int(p.As) + o := oprange[r].start + if o == nil { + o = oprange[r].stop /* just generate an error */ + } + + if false { + fmt.Printf("oplook %v %d %d %d\n", obj.Aconv(int(p.As)), a1, a2, a3) + fmt.Printf("\t\t%d %d\n", p.From.Type, p.To.Type) + } + + e := oprange[r].stop + c1 := xcmp[a1][:] + c2 := xcmp[a2][:] + c3 := xcmp[a3][:] + c4 := xcmp[p.Scond>>5][:] + for ; -cap(o) < -cap(e); o = o[1:] { + if int(o[0].a2) == a2 || c2[o[0].a2] != 0 { + if c4[o[0].scond>>5] != 0 { + if c1[o[0].a1] != 0 { + if c3[o[0].a3] != 0 { + p.Optab = uint16((-cap(o) + cap(optab)) + 1) + return &o[0] + } + } + } + } + } + + ctxt.Diag("illegal combination %v %v %v %v, %d %d", p, DRconv(a1), DRconv(a2), DRconv(a3), p.From.Type, p.To.Type) + prasm(p) + if o == nil { + o = optab + } + return &o[0] +} + +func cmp(a int, b int) bool { + if a == b { + return true + } + switch a { + case C_RSP: + if b == C_REG { + return true + } + + case C_REG: + if b == C_ZCON { + return true + } + + case C_ADDCON0: + if b == C_ZCON { + return true + } + + case C_ADDCON: + if b == C_ZCON || b == C_ADDCON0 || b == C_ABCON { + return true + } + + case C_BITCON: + if b == C_ABCON || b == C_MBCON { + return true + } + + case C_MOVCON: + if b == C_MBCON || b == C_ZCON || b == C_ADDCON0 { + return true + } + + case C_LCON: + if b == C_ZCON || b == C_BITCON || b == C_ADDCON || b == C_ADDCON0 || b == C_ABCON || b == C_MBCON || b == C_MOVCON { + return true + } + + case C_VCON: + return cmp(C_LCON, b) + + case C_LACON: + if b == C_AACON { + return true + } + + case C_SEXT2: + if b == C_SEXT1 { + return true + } + + case C_SEXT4: + if b == C_SEXT1 || b == C_SEXT2 { + return true + } + + case C_SEXT8: + if b >= C_SEXT1 && b <= C_SEXT4 { + return true + } + + case C_SEXT16: + if b >= C_SEXT1 && b <= C_SEXT8 { + return true + } + + case C_LEXT: + if b >= C_SEXT1 && b <= C_SEXT16 { + return true + } + + case C_PPAUTO: + if b == C_PSAUTO { + return true + } + + case C_UAUTO4K: + if b == C_PSAUTO || b == C_PPAUTO { + return true + } + + case C_UAUTO8K: + return cmp(C_UAUTO4K, b) + + case C_UAUTO16K: + return cmp(C_UAUTO8K, b) + + case C_UAUTO32K: + return cmp(C_UAUTO16K, b) + + case C_UAUTO64K: + return cmp(C_UAUTO32K, b) + + case C_NPAUTO: + return cmp(C_NSAUTO, b) + + case C_LAUTO: + return cmp(C_NPAUTO, b) || cmp(C_UAUTO64K, b) + + case C_PSOREG: + if b == C_ZOREG { + return true + } + + case C_PPOREG: + if b == C_ZOREG || b == C_PSOREG { + return true + } + + case C_UOREG4K: + if b == C_ZOREG || b == C_PSAUTO || b == C_PSOREG || b == C_PPAUTO || b == C_PPOREG { + return true + } + + case C_UOREG8K: + return cmp(C_UOREG4K, b) + + case C_UOREG16K: + return cmp(C_UOREG8K, b) + + case C_UOREG32K: + return cmp(C_UOREG16K, b) + + case C_UOREG64K: + return cmp(C_UOREG32K, b) + + case C_NPOREG: + return cmp(C_NSOREG, b) + + case C_LOREG: + return cmp(C_NPOREG, b) || cmp(C_UOREG64K, b) + + case C_LBRA: + if b == C_SBRA { + return true + } + } + + return false +} + +type ocmp []Optab + +func (x ocmp) Len() int { + return len(x) +} + +func (x ocmp) Swap(i, j int) { + x[i], x[j] = x[j], x[i] +} + +func (x ocmp) Less(i, j int) bool { + p1 := &x[i] + p2 := &x[j] + n := int(p1.as) - int(p2.as) + if n != 0 { + return n < 0 + } + n = int(p1.a1) - int(p2.a1) + if n != 0 { + return n < 0 + } + n = int(p1.a2) - int(p2.a2) + if n != 0 { + return n < 0 + } + n = int(p1.a3) - int(p2.a3) + if n != 0 { + return n < 0 + } + n = int(p1.scond) - int(p2.scond) + if n != 0 { + return n < 0 + } + return false +} + +func buildop(ctxt *obj.Link) { + var n int + for i := 0; i < C_GOK; i++ { + for n = 0; n < C_GOK; n++ { + if cmp(n, i) { + xcmp[i][n] = 1 + } + } + } + for n = 0; optab[n].as != obj.AXXX; n++ { + } + sort.Sort(ocmp(optab[:n])) + var r int + var t Oprange + for i := 0; i < n; i++ { + r = int(optab[i].as) + oprange[r].start = optab[i:] + for int(optab[i].as) == r { + i++ + } + oprange[r].stop = optab[i:] + i-- + t = oprange[r] + switch r { + default: + ctxt.Diag("unknown op in build: %v", obj.Aconv(r)) + log.Fatalf("bad code") + + case AADD: + oprange[AADDS] = t + oprange[ASUB] = t + oprange[ASUBS] = t + oprange[AADDW] = t + oprange[AADDSW] = t + oprange[ASUBW] = t + oprange[ASUBSW] = t + + case AAND: /* logical immediate, logical shifted register */ + oprange[AANDS] = t + + oprange[AANDSW] = t + oprange[AANDW] = t + oprange[AEOR] = t + oprange[AEORW] = t + oprange[AORR] = t + oprange[AORRW] = t + + case ABIC: /* only logical shifted register */ + oprange[ABICS] = t + + oprange[ABICSW] = t + oprange[ABICW] = t + oprange[AEON] = t + oprange[AEONW] = t + oprange[AORN] = t + oprange[AORNW] = t + + case ANEG: + oprange[ANEGS] = t + oprange[ANEGSW] = t + oprange[ANEGW] = t + + case AADC: /* rn=Rd */ + oprange[AADCW] = t + + oprange[AADCS] = t + oprange[AADCSW] = t + oprange[ASBC] = t + oprange[ASBCW] = t + oprange[ASBCS] = t + oprange[ASBCSW] = t + + case ANGC: /* rn=REGZERO */ + oprange[ANGCW] = t + + oprange[ANGCS] = t + oprange[ANGCSW] = t + + case ACMP: + oprange[ACMPW] = t + oprange[ACMN] = t + oprange[ACMNW] = t + + case ATST: + oprange[ATSTW] = t + + /* register/register, and shifted */ + case AMVN: + oprange[AMVNW] = t + + case AMOVK: + oprange[AMOVKW] = t + oprange[AMOVN] = t + oprange[AMOVNW] = t + oprange[AMOVZ] = t + oprange[AMOVZW] = t + + case ABEQ: + oprange[ABNE] = t + oprange[ABCS] = t + oprange[ABHS] = t + oprange[ABCC] = t + oprange[ABLO] = t + oprange[ABMI] = t + oprange[ABPL] = t + oprange[ABVS] = t + oprange[ABVC] = t + oprange[ABHI] = t + oprange[ABLS] = t + oprange[ABGE] = t + oprange[ABLT] = t + oprange[ABGT] = t + oprange[ABLE] = t + + case ALSL: + oprange[ALSLW] = t + oprange[ALSR] = t + oprange[ALSRW] = t + oprange[AASR] = t + oprange[AASRW] = t + oprange[AROR] = t + oprange[ARORW] = t + + case ACLS: + oprange[ACLSW] = t + oprange[ACLZ] = t + oprange[ACLZW] = t + oprange[ARBIT] = t + oprange[ARBITW] = t + oprange[AREV] = t + oprange[AREVW] = t + oprange[AREV16] = t + oprange[AREV16W] = t + oprange[AREV32] = t + + case ASDIV: + oprange[ASDIVW] = t + oprange[AUDIV] = t + oprange[AUDIVW] = t + oprange[ACRC32B] = t + oprange[ACRC32CB] = t + oprange[ACRC32CH] = t + oprange[ACRC32CW] = t + oprange[ACRC32CX] = t + oprange[ACRC32H] = t + oprange[ACRC32W] = t + oprange[ACRC32X] = t + + case AMADD: + oprange[AMADDW] = t + oprange[AMSUB] = t + oprange[AMSUBW] = t + oprange[ASMADDL] = t + oprange[ASMSUBL] = t + oprange[AUMADDL] = t + oprange[AUMSUBL] = t + + case AREM: + oprange[AREMW] = t + oprange[AUREM] = t + oprange[AUREMW] = t + + case AMUL: + oprange[AMULW] = t + oprange[AMNEG] = t + oprange[AMNEGW] = t + oprange[ASMNEGL] = t + oprange[ASMULL] = t + oprange[ASMULH] = t + oprange[AUMNEGL] = t + oprange[AUMULH] = t + oprange[AUMULL] = t + + case AMOVB: + oprange[AMOVBU] = t + + case AMOVH: + oprange[AMOVHU] = t + + case AMOVW: + oprange[AMOVWU] = t + + case ABFM: + oprange[ABFMW] = t + oprange[ASBFM] = t + oprange[ASBFMW] = t + oprange[AUBFM] = t + oprange[AUBFMW] = t + + case ABFI: + oprange[ABFIW] = t + oprange[ABFXIL] = t + oprange[ABFXILW] = t + oprange[ASBFIZ] = t + oprange[ASBFIZW] = t + oprange[ASBFX] = t + oprange[ASBFXW] = t + oprange[AUBFIZ] = t + oprange[AUBFIZW] = t + oprange[AUBFX] = t + oprange[AUBFXW] = t + + case AEXTR: + oprange[AEXTRW] = t + + case ASXTB: + oprange[ASXTBW] = t + oprange[ASXTH] = t + oprange[ASXTHW] = t + oprange[ASXTW] = t + oprange[AUXTB] = t + oprange[AUXTH] = t + oprange[AUXTW] = t + oprange[AUXTBW] = t + oprange[AUXTHW] = t + + case ACCMN: + oprange[ACCMNW] = t + oprange[ACCMP] = t + oprange[ACCMPW] = t + + case ACSEL: + oprange[ACSELW] = t + oprange[ACSINC] = t + oprange[ACSINCW] = t + oprange[ACSINV] = t + oprange[ACSINVW] = t + oprange[ACSNEG] = t + oprange[ACSNEGW] = t + + // aliases Rm=Rn, !cond + oprange[ACINC] = t + + oprange[ACINCW] = t + oprange[ACINV] = t + oprange[ACINVW] = t + oprange[ACNEG] = t + oprange[ACNEGW] = t + + // aliases, Rm=Rn=REGZERO, !cond + case ACSET: + oprange[ACSETW] = t + + oprange[ACSETM] = t + oprange[ACSETMW] = t + + case AMOVD, + AMOVBU, + AB, + ABL, + AWORD, + ADWORD, + obj.ARET, + obj.ATEXT, + ACASE, + ABCASE, + ASTP, + ALDP: + break + + case AERET: + oprange[AWFE] = t + oprange[AWFI] = t + oprange[AYIELD] = t + oprange[ASEV] = t + oprange[ASEVL] = t + oprange[ADRPS] = t + + case ACBZ: + oprange[ACBZW] = t + oprange[ACBNZ] = t + oprange[ACBNZW] = t + + case ATBZ: + oprange[ATBNZ] = t + + case AADR, AADRP: + break + + case ACLREX: + break + + case ASVC: + oprange[AHLT] = t + oprange[AHVC] = t + oprange[ASMC] = t + oprange[ABRK] = t + oprange[ADCPS1] = t + oprange[ADCPS2] = t + oprange[ADCPS3] = t + + case AFADDS: + oprange[AFADDD] = t + oprange[AFSUBS] = t + oprange[AFSUBD] = t + oprange[AFMULS] = t + oprange[AFMULD] = t + oprange[AFNMULS] = t + oprange[AFNMULD] = t + oprange[AFDIVS] = t + oprange[AFMAXD] = t + oprange[AFMAXS] = t + oprange[AFMIND] = t + oprange[AFMINS] = t + oprange[AFMAXNMD] = t + oprange[AFMAXNMS] = t + oprange[AFMINNMD] = t + oprange[AFMINNMS] = t + oprange[AFDIVD] = t + + case AFCVTSD: + oprange[AFCVTDS] = t + oprange[AFABSD] = t + oprange[AFABSS] = t + oprange[AFNEGD] = t + oprange[AFNEGS] = t + oprange[AFSQRTD] = t + oprange[AFSQRTS] = t + oprange[AFRINTNS] = t + oprange[AFRINTND] = t + oprange[AFRINTPS] = t + oprange[AFRINTPD] = t + oprange[AFRINTMS] = t + oprange[AFRINTMD] = t + oprange[AFRINTZS] = t + oprange[AFRINTZD] = t + oprange[AFRINTAS] = t + oprange[AFRINTAD] = t + oprange[AFRINTXS] = t + oprange[AFRINTXD] = t + oprange[AFRINTIS] = t + oprange[AFRINTID] = t + oprange[AFCVTDH] = t + oprange[AFCVTHS] = t + oprange[AFCVTHD] = t + oprange[AFCVTSH] = t + + case AFCMPS: + oprange[AFCMPD] = t + oprange[AFCMPES] = t + oprange[AFCMPED] = t + + case AFCCMPS: + oprange[AFCCMPD] = t + oprange[AFCCMPES] = t + oprange[AFCCMPED] = t + + case AFCSELD: + oprange[AFCSELS] = t + + case AFMOVS, AFMOVD: + break + + case AFCVTZSD: + oprange[AFCVTZSDW] = t + oprange[AFCVTZSS] = t + oprange[AFCVTZSSW] = t + oprange[AFCVTZUD] = t + oprange[AFCVTZUDW] = t + oprange[AFCVTZUS] = t + oprange[AFCVTZUSW] = t + + case ASCVTFD: + oprange[ASCVTFS] = t + oprange[ASCVTFWD] = t + oprange[ASCVTFWS] = t + oprange[AUCVTFD] = t + oprange[AUCVTFS] = t + oprange[AUCVTFWD] = t + oprange[AUCVTFWS] = t + + case ASYS: + oprange[AAT] = t + oprange[ADC] = t + oprange[AIC] = t + oprange[ATLBI] = t + + case ASYSL, AHINT: + break + + case ADMB: + oprange[ADSB] = t + oprange[AISB] = t + + case AMRS, AMSR: + break + + case ALDAR: + oprange[ALDARW] = t + fallthrough + + case ALDXR: + oprange[ALDXRB] = t + oprange[ALDXRH] = t + oprange[ALDXRW] = t + + case ALDAXR: + oprange[ALDAXRW] = t + + case ALDXP: + oprange[ALDXPW] = t + + case ASTLR: + oprange[ASTLRW] = t + + case ASTXR: + oprange[ASTXRB] = t + oprange[ASTXRH] = t + oprange[ASTXRW] = t + + case ASTLXR: + oprange[ASTLXRW] = t + + case ASTXP: + oprange[ASTXPW] = t + + case AAESD: + oprange[AAESE] = t + oprange[AAESMC] = t + oprange[AAESIMC] = t + oprange[ASHA1H] = t + oprange[ASHA1SU1] = t + oprange[ASHA256SU0] = t + + case ASHA1C: + oprange[ASHA1P] = t + oprange[ASHA1M] = t + oprange[ASHA1SU0] = t + oprange[ASHA256H] = t + oprange[ASHA256H2] = t + oprange[ASHA256SU1] = t + + case obj.ANOP, + obj.AUNDEF, + obj.AUSEFIELD, + obj.AFUNCDATA, + obj.APCDATA, + obj.ADUFFZERO, + obj.ADUFFCOPY: + break + } + } +} + +func chipfloat7(ctxt *obj.Link, e float64) int { + ei := math.Float64bits(e) + l := uint32(int32(ei)) + h := uint32(int32(ei >> 32)) + + if l != 0 || h&0xffff != 0 { + return -1 + } + h1 := h & 0x7fc00000 + if h1 != 0x40000000 && h1 != 0x3fc00000 { + return -1 + } + n := 0 + + // sign bit (a) + if h&0x80000000 != 0 { + n |= 1 << 7 + } + + // exp sign bit (b) + if h1 == 0x3fc00000 { + n |= 1 << 6 + } + + // rest of exp and mantissa (cd-efgh) + n |= int((h >> 16) & 0x3f) + + //print("match %.8lux %.8lux %d\n", l, h, n); + return n +} + +/* form offset parameter to SYS; special register number */ +func SYSARG5(op0 int, op1 int, Cn int, Cm int, op2 int) int { + return op0<<19 | op1<<16 | Cn<<12 | Cm<<8 | op2<<5 +} + +func SYSARG4(op1 int, Cn int, Cm int, op2 int) int { + return SYSARG5(0, op1, Cn, Cm, op2) +} + +func asmout(ctxt *obj.Link, p *obj.Prog, o *Optab, out []uint32) { + var lastcase *obj.Prog + o1 := uint32(0) + o2 := uint32(0) + o3 := uint32(0) + o4 := uint32(0) + o5 := uint32(0) + if false { /*debug['P']*/ + fmt.Printf("%x: %v\ttype %d\n", uint32(p.Pc), p, o.type_) + } + switch o.type_ { + default: + ctxt.Diag("unknown asm %d", o.type_) + prasm(p) + + case 0: /* pseudo ops */ + break + + case 1: /* op Rm,[Rn],Rd; default Rn=Rd -> op Rm<<0,[Rn,]Rd (shifted register) */ + o1 = oprrr(ctxt, int(p.As)) + + rf := int(p.From.Reg) + rt := int(p.To.Reg) + r := int(p.Reg) + if p.To.Type == obj.TYPE_NONE { + rt = REGZERO + } + if r == 0 { + r = rt + } + o1 |= (uint32(rf&31) << 16) | (uint32(r&31) << 5) | uint32(rt&31) + + case 2: /* add/sub $(uimm12|uimm24)[,R],R; cmp $(uimm12|uimm24),R */ + o1 = opirr(ctxt, int(p.As)) + + rt := int(p.To.Reg) + if p.To.Type == obj.TYPE_NONE { + if (o1 & Sbit) == 0 { + ctxt.Diag("ineffective ZR destination\n%v", p) + } + rt = REGZERO + } + + r := int(p.Reg) + if r == 0 { + r = rt + } + v := int32(regoff(ctxt, &p.From)) + o1 = oaddi(ctxt, int32(o1), v, r, rt) + + case 3: /* op R<>= 12 + o1 |= 1 << 22 /* shift, by 12 */ + } + + o1 |= ((uint32(v) & 0xFFF) << 10) | (uint32(r&31) << 5) | uint32(rt&31) + + case 5: /* b s; bl s */ + o1 = opbra(ctxt, int(p.As)) + + if p.To.Sym == nil { + o1 |= uint32(brdist(ctxt, p, 0, 26, 2)) + break + } + + rel := obj.Addrel(ctxt.Cursym) + rel.Off = int32(ctxt.Pc) + rel.Siz = 4 + rel.Sym = p.To.Sym + rel.Add = int64(o1) | (p.To.Offset>>2)&0x3ffffff + rel.Type = obj.R_CALLARM64 + + case 6: /* b ,O(R); bl ,O(R) */ + o1 = opbrr(ctxt, int(p.As)) + + o1 |= uint32(p.To.Reg&31) << 5 + rel := obj.Addrel(ctxt.Cursym) + rel.Off = int32(ctxt.Pc) + rel.Siz = 0 + rel.Type = obj.R_CALLIND + + case 7: /* beq s */ + o1 = opbra(ctxt, int(p.As)) + + o1 |= uint32(brdist(ctxt, p, 0, 19, 2) << 5) + + case 8: /* lsl $c,[R],R -> ubfm $(W-1)-c,$(-c MOD (W-1)),Rn,Rd */ + rt := int(p.To.Reg) + + rf := int(p.Reg) + if rf == 0 { + rf = rt + } + v := int32(p.From.Offset) + switch p.As { + case AASR: + o1 = opbfm(ctxt, ASBFM, int(v), 63, rf, rt) + + case AASRW: + o1 = opbfm(ctxt, ASBFMW, int(v), 31, rf, rt) + + case ALSL: + o1 = opbfm(ctxt, AUBFM, int((64-v)&63), int(63-v), rf, rt) + + case ALSLW: + o1 = opbfm(ctxt, AUBFMW, int((32-v)&31), int(31-v), rf, rt) + + case ALSR: + o1 = opbfm(ctxt, AUBFM, int(v), 63, rf, rt) + + case ALSRW: + o1 = opbfm(ctxt, AUBFMW, int(v), 31, rf, rt) + + case AROR: + o1 = opextr(ctxt, AEXTR, v, rf, rf, rt) + + case ARORW: + o1 = opextr(ctxt, AEXTRW, v, rf, rf, rt) + + default: + ctxt.Diag("bad shift $con\n%v", ctxt.Curp) + break + } + + case 9: /* lsl Rm,[Rn],Rd -> lslv Rm, Rn, Rd */ + o1 = oprrr(ctxt, int(p.As)) + + r := int(p.Reg) + if r == 0 { + r = int(p.To.Reg) + } + o1 |= (uint32(p.From.Reg&31) << 16) | (uint32(r&31) << 5) | uint32(p.To.Reg&31) + + case 10: /* brk/hvc/.../svc [$con] */ + o1 = opimm(ctxt, int(p.As)) + + if p.To.Type != obj.TYPE_NONE { + o1 |= uint32((p.To.Offset & 0xffff) << 5) + } + + case 11: /* dword */ + aclass(ctxt, &p.To) + + o1 = uint32(ctxt.Instoffset) + o2 = uint32(ctxt.Instoffset >> 32) + if p.To.Sym != nil { + rel := obj.Addrel(ctxt.Cursym) + rel.Off = int32(ctxt.Pc) + rel.Siz = 8 + rel.Sym = p.To.Sym + rel.Add = p.To.Offset + rel.Type = obj.R_ADDR + o2 = 0 + o1 = o2 + } + + case 12: /* movT $vcon, reg */ + o1 = omovlit(ctxt, int(p.As), p, &p.From, int(p.To.Reg)) + + case 13: /* addop $vcon, [R], R (64 bit literal); cmp $lcon,R -> addop $lcon,R, ZR */ + o1 = omovlit(ctxt, AMOVD, p, &p.From, REGTMP) + + if !(o1 != 0) { + break + } + rt := int(p.To.Reg) + if p.To.Type == obj.TYPE_NONE { + rt = REGZERO + } + r := int(p.Reg) + if r == 0 { + r = rt + } + if p.To.Type != obj.TYPE_NONE && (p.To.Reg == REGSP || r == REGSP) { + o2 = opxrrr(ctxt, int(p.As)) + o2 |= REGTMP & 31 << 16 + o2 |= LSL0_64 + } else { + o2 = oprrr(ctxt, int(p.As)) + o2 |= REGTMP & 31 << 16 /* shift is 0 */ + } + + o2 |= uint32(r&31) << 5 + o2 |= uint32(rt & 31) + + case 14: /* word */ + if aclass(ctxt, &p.To) == C_ADDR { + ctxt.Diag("address constant needs DWORD\n%v", p) + } + o1 = uint32(ctxt.Instoffset) + if p.To.Sym != nil { + // This case happens with words generated + // in the PC stream as part of the literal pool. + rel := obj.Addrel(ctxt.Cursym) + + rel.Off = int32(ctxt.Pc) + rel.Siz = 4 + rel.Sym = p.To.Sym + rel.Add = p.To.Offset + rel.Type = obj.R_ADDR + o1 = 0 + } + + case 15: /* mul/mneg/umulh/umull r,[r,]r; madd/msub Rm,Rn,Ra,Rd */ + o1 = oprrr(ctxt, int(p.As)) + + rf := int(p.From.Reg) + rt := int(p.To.Reg) + var r int + var ra int + if p.From3Type() == obj.TYPE_REG { + r = int(p.From3.Reg) + ra = int(p.Reg) + if ra == 0 { + ra = REGZERO + } + } else { + r = int(p.Reg) + if r == 0 { + r = rt + } + ra = REGZERO + } + + o1 |= (uint32(rf&31) << 16) | (uint32(ra&31) << 10) | (uint32(r&31) << 5) | uint32(rt&31) + + case 16: /* XremY R[,R],R -> XdivY; XmsubY */ + o1 = oprrr(ctxt, int(p.As)) + + rf := int(p.From.Reg) + rt := int(p.To.Reg) + r := int(p.Reg) + if r == 0 { + r = rt + } + o1 |= (uint32(rf&31) << 16) | (uint32(r&31) << 5) | REGTMP&31 + o2 = oprrr(ctxt, AMSUBW) + o2 |= o1 & (1 << 31) /* same size */ + o2 |= (uint32(rf&31) << 16) | (uint32(r&31) << 10) | (REGTMP & 31 << 5) | uint32(rt&31) + + case 17: /* op Rm,[Rn],Rd; default Rn=ZR */ + o1 = oprrr(ctxt, int(p.As)) + + rf := int(p.From.Reg) + rt := int(p.To.Reg) + r := int(p.Reg) + if p.To.Type == obj.TYPE_NONE { + rt = REGZERO + } + if r == 0 { + r = REGZERO + } + o1 |= (uint32(rf&31) << 16) | (uint32(r&31) << 5) | uint32(rt&31) + + case 18: /* csel cond,Rn,Rm,Rd; cinc/cinv/cneg cond,Rn,Rd; cset cond,Rd */ + o1 = oprrr(ctxt, int(p.As)) + + cond := int(p.From.Reg) + r := int(p.Reg) + var rf int + if r != 0 { + if p.From3Type() == obj.TYPE_NONE { + /* CINC/CINV/CNEG */ + rf = r + + cond ^= 1 + } else { + rf = int(p.From3.Reg) /* CSEL */ + } + } else { + /* CSET */ + if p.From3Type() != obj.TYPE_NONE { + ctxt.Diag("invalid combination\n%v", p) + } + rf = REGZERO + r = rf + cond ^= 1 + } + + rt := int(p.To.Reg) + o1 |= (uint32(rf&31) << 16) | (uint32(cond&31) << 12) | (uint32(r&31) << 5) | uint32(rt&31) + + case 19: /* CCMN cond, (Rm|uimm5),Rn, uimm4 -> ccmn Rn,Rm,uimm4,cond */ + nzcv := int(p.To.Offset) + + cond := int(p.From.Reg) + var rf int + if p.From3.Type == obj.TYPE_REG { + o1 = oprrr(ctxt, int(p.As)) + rf = int(p.From3.Reg) /* Rm */ + } else { + o1 = opirr(ctxt, int(p.As)) + rf = int(p.From3.Offset & 0x1F) + } + + o1 |= (uint32(rf&31) << 16) | (uint32(cond) << 12) | (uint32(p.Reg&31) << 5) | uint32(nzcv) + + case 20: /* movT R,O(R) -> strT */ + v := int32(regoff(ctxt, &p.To)) + + r := int(p.To.Reg) + if r == 0 { + r = int(o.param) + } + if v < 0 { /* unscaled 9-bit signed */ + o1 = olsr9s(ctxt, int32(opstr9(ctxt, int(p.As))), v, r, int(p.From.Reg)) + } else { + v = int32(offsetshift(ctxt, int64(v), int(o.a3))) + o1 = olsr12u(ctxt, int32(opstr12(ctxt, int(p.As))), v, r, int(p.From.Reg)) + } + + case 21: /* movT O(R),R -> ldrT */ + v := int32(regoff(ctxt, &p.From)) + + r := int(p.From.Reg) + if r == 0 { + r = int(o.param) + } + if v < 0 { /* unscaled 9-bit signed */ + o1 = olsr9s(ctxt, int32(opldr9(ctxt, int(p.As))), v, r, int(p.To.Reg)) + } else { + v = int32(offsetshift(ctxt, int64(v), int(o.a1))) + + //print("offset=%lld v=%ld a1=%d\n", instoffset, v, o->a1); + o1 = olsr12u(ctxt, int32(opldr12(ctxt, int(p.As))), v, r, int(p.To.Reg)) + } + + case 22: /* movT (R)O!,R; movT O(R)!, R -> ldrT */ + v := int32(p.From.Offset) + + if v < -256 || v > 255 { + ctxt.Diag("offset out of range\n%v", p) + } + o1 = opldrpp(ctxt, int(p.As)) + if o.scond == C_XPOST { + o1 |= 1 << 10 + } else { + o1 |= 3 << 10 + } + o1 |= ((uint32(v) & 0x1FF) << 12) | (uint32(p.From.Reg&31) << 5) | uint32(p.To.Reg&31) + + case 23: /* movT R,(R)O!; movT O(R)!, R -> strT */ + v := int32(p.To.Offset) + + if v < -256 || v > 255 { + ctxt.Diag("offset out of range\n%v", p) + } + o1 = LD2STR(opldrpp(ctxt, int(p.As))) + if o.scond == C_XPOST { + o1 |= 1 << 10 + } else { + o1 |= 3 << 10 + } + o1 |= ((uint32(v) & 0x1FF) << 12) | (uint32(p.To.Reg&31) << 5) | uint32(p.From.Reg&31) + + case 24: /* mov/mvn Rs,Rd -> add $0,Rs,Rd or orr Rs,ZR,Rd */ + rf := int(p.From.Reg) + rt := int(p.To.Reg) + s := obj.Bool2int(rf == REGSP || rt == REGSP) + if p.As == AMVN || p.As == AMVNW { + if s != 0 { + ctxt.Diag("illegal SP reference\n%v", p) + } + o1 = oprrr(ctxt, int(p.As)) + o1 |= (uint32(rf&31) << 16) | (REGZERO & 31 << 5) | uint32(rt&31) + } else if s != 0 { + o1 = opirr(ctxt, int(p.As)) + o1 |= (uint32(rf&31) << 5) | uint32(rt&31) + } else { + o1 = oprrr(ctxt, int(p.As)) + o1 |= (uint32(rf&31) << 16) | (REGZERO & 31 << 5) | uint32(rt&31) + } + + case 25: /* negX Rs, Rd -> subX Rs<<0, ZR, Rd */ + o1 = oprrr(ctxt, int(p.As)) + + rf := int(p.From.Reg) + rt := int(p.To.Reg) + o1 |= (uint32(rf&31) << 16) | (REGZERO & 31 << 5) | uint32(rt&31) + + case 26: /* negX Rm< subX Rm< strT */ + s := movesize(int(o.as)) + + if s < 0 { + ctxt.Diag("unexpected long move, op %v tab %v\n%v", obj.Aconv(int(p.As)), obj.Aconv(int(o.as)), p) + } + v := int32(regoff(ctxt, &p.To)) + if v < 0 { + ctxt.Diag("negative large offset\n%v", p) + } + if (v & ((1 << uint(s)) - 1)) != 0 { + ctxt.Diag("misaligned offset\n%v", p) + } + hi := v - (v & (0xFFF << uint(s))) + if (hi & 0xFFF) != 0 { + ctxt.Diag("internal: miscalculated offset %d [%d]\n%v", v, s, p) + } + + //fprint(2, "v=%ld (%#lux) s=%d hi=%ld (%#lux) v'=%ld (%#lux)\n", v, v, s, hi, hi, ((v-hi)>>s)&0xFFF, ((v-hi)>>s)&0xFFF); + r := int(p.To.Reg) + + if r == 0 { + r = int(o.param) + } + o1 = oaddi(ctxt, int32(opirr(ctxt, AADD)), hi, r, REGTMP) + o2 = olsr12u(ctxt, int32(opstr12(ctxt, int(p.As))), ((v-hi)>>uint(s))&0xFFF, REGTMP, int(p.From.Reg)) + + case 31: /* movT L(R), R -> ldrT */ + s := movesize(int(o.as)) + + if s < 0 { + ctxt.Diag("unexpected long move, op %v tab %v\n%v", obj.Aconv(int(p.As)), obj.Aconv(int(o.as)), p) + } + v := int32(regoff(ctxt, &p.From)) + if v < 0 { + ctxt.Diag("negative large offset\n%v", p) + } + if (v & ((1 << uint(s)) - 1)) != 0 { + ctxt.Diag("misaligned offset\n%v", p) + } + hi := v - (v & (0xFFF << uint(s))) + if (hi & 0xFFF) != 0 { + ctxt.Diag("internal: miscalculated offset %d [%d]\n%v", v, s, p) + } + + //fprint(2, "v=%ld (%#lux) s=%d hi=%ld (%#lux) v'=%ld (%#lux)\n", v, v, s, hi, hi, ((v-hi)>>s)&0xFFF, ((v-hi)>>s)&0xFFF); + r := int(p.From.Reg) + + if r == 0 { + r = int(o.param) + } + o1 = oaddi(ctxt, int32(opirr(ctxt, AADD)), hi, r, REGTMP) + o2 = olsr12u(ctxt, int32(opldr12(ctxt, int(p.As))), ((v-hi)>>uint(s))&0xFFF, REGTMP, int(p.To.Reg)) + + case 32: /* mov $con, R -> movz/movn */ + r := 32 + + if p.As == AMOVD { + r = 64 + } + d := p.From.Offset + s := movcon(d) + if s < 0 || s >= r { + d = ^d + s = movcon(d) + if s < 0 || s >= r { + ctxt.Diag("impossible move wide: %#x\n%v", uint64(p.From.Offset), p) + } + if p.As == AMOVD { + o1 = opirr(ctxt, AMOVN) + } else { + o1 = opirr(ctxt, AMOVNW) + } + } else { + if p.As == AMOVD { + o1 = opirr(ctxt, AMOVZ) + } else { + o1 = opirr(ctxt, AMOVZW) + } + } + + rt := int(p.To.Reg) + o1 |= uint32((((d >> uint(s*16)) & 0xFFFF) << 5) | int64((uint32(s)&3)<<21) | int64(rt&31)) + + case 33: /* movk $uimm16 << pos */ + o1 = opirr(ctxt, int(p.As)) + + d := p.From.Offset + if (d >> 16) != 0 { + ctxt.Diag("requires uimm16\n%v", p) + } + s := 0 + if p.From3Type() != obj.TYPE_NONE { + if p.From3.Type != obj.TYPE_CONST { + ctxt.Diag("missing bit position\n%v", p) + } + s = int(p.From3.Offset / 16) + if (s*16&0xF) != 0 || s >= 4 || (o1&S64) == 0 && s >= 2 { + ctxt.Diag("illegal bit position\n%v", p) + } + } + + rt := int(p.To.Reg) + o1 |= uint32(((d & 0xFFFF) << 5) | int64((uint32(s)&3)<<21) | int64(rt&31)) + + case 34: /* mov $lacon,R */ + o1 = omovlit(ctxt, AMOVD, p, &p.From, REGTMP) + + if !(o1 != 0) { + break + } + o2 = opxrrr(ctxt, AADD) + o2 |= REGTMP & 31 << 16 + o2 |= LSL0_64 + r := int(p.From.Reg) + if r == 0 { + r = int(o.param) + } + o2 |= uint32(r&31) << 5 + o2 |= uint32(p.To.Reg & 31) + + case 35: /* mov SPR,R -> mrs */ + o1 = oprrr(ctxt, AMRS) + + v := int32(p.From.Offset) + if (o1 & uint32(v&^(3<<19))) != 0 { + ctxt.Diag("MRS register value overlap\n%v", p) + } + o1 |= uint32(v) + o1 |= uint32(p.To.Reg & 31) + + case 36: /* mov R,SPR */ + o1 = oprrr(ctxt, AMSR) + + v := int32(p.To.Offset) + if (o1 & uint32(v&^(3<<19))) != 0 { + ctxt.Diag("MSR register value overlap\n%v", p) + } + o1 |= uint32(v) + o1 |= uint32(p.From.Reg & 31) + + case 37: /* mov $con,PSTATEfield -> MSR [immediate] */ + if (uint64(p.From.Offset) &^ uint64(0xF)) != 0 { + ctxt.Diag("illegal immediate for PSTATE field\n%v", p) + } + o1 = opirr(ctxt, AMSR) + o1 |= uint32((p.From.Offset & 0xF) << 8) /* Crm */ + v := int32(0) + for i := 0; i < len(pstatefield); i++ { + if int64(pstatefield[i].a) == p.To.Offset { + v = int32(pstatefield[i].b) + break + } + } + + if v == 0 { + ctxt.Diag("illegal PSTATE field for immediate move\n%v", p) + } + o1 |= uint32(v) + + case 38: /* clrex [$imm] */ + o1 = opimm(ctxt, int(p.As)) + + if p.To.Type == obj.TYPE_NONE { + o1 |= 0xF << 8 + } else { + o1 |= uint32((p.To.Offset & 0xF) << 8) + } + + case 39: /* cbz R, rel */ + o1 = opirr(ctxt, int(p.As)) + + o1 |= uint32(p.From.Reg & 31) + o1 |= uint32(brdist(ctxt, p, 0, 19, 2) << 5) + + case 40: /* tbz */ + o1 = opirr(ctxt, int(p.As)) + + v := int32(p.From.Offset) + if v < 0 || v > 63 { + ctxt.Diag("illegal bit number\n%v", p) + } + o1 |= ((uint32(v) & 0x20) << (31 - 5)) | ((uint32(v) & 0x1F) << 19) + o1 |= uint32(brdist(ctxt, p, 0, 14, 2) << 5) + o1 |= uint32(p.Reg) + + case 41: /* eret, nop, others with no operands */ + o1 = op0(ctxt, int(p.As)) + + case 42: /* bfm R,r,s,R */ + o1 = opbfm(ctxt, int(p.As), int(p.From.Offset), int(p.From3.Offset), int(p.Reg), int(p.To.Reg)) + + case 43: /* bfm aliases */ + r := int(p.From.Offset) + + s := int(p.From3.Offset) + rf := int(p.Reg) + rt := int(p.To.Reg) + if rf == 0 { + rf = rt + } + switch p.As { + case ABFI: + o1 = opbfm(ctxt, ABFM, 64-r, s-1, rf, rt) + + case ABFIW: + o1 = opbfm(ctxt, ABFMW, 32-r, s-1, rf, rt) + + case ABFXIL: + o1 = opbfm(ctxt, ABFM, r, r+s-1, rf, rt) + + case ABFXILW: + o1 = opbfm(ctxt, ABFMW, r, r+s-1, rf, rt) + + case ASBFIZ: + o1 = opbfm(ctxt, ASBFM, 64-r, s-1, rf, rt) + + case ASBFIZW: + o1 = opbfm(ctxt, ASBFMW, 32-r, s-1, rf, rt) + + case ASBFX: + o1 = opbfm(ctxt, ASBFM, r, r+s-1, rf, rt) + + case ASBFXW: + o1 = opbfm(ctxt, ASBFMW, r, r+s-1, rf, rt) + + case AUBFIZ: + o1 = opbfm(ctxt, AUBFM, 64-r, s-1, rf, rt) + + case AUBFIZW: + o1 = opbfm(ctxt, AUBFMW, 32-r, s-1, rf, rt) + + case AUBFX: + o1 = opbfm(ctxt, AUBFM, r, r+s-1, rf, rt) + + case AUBFXW: + o1 = opbfm(ctxt, AUBFMW, r, r+s-1, rf, rt) + + default: + ctxt.Diag("bad bfm alias\n%v", ctxt.Curp) + break + } + + case 44: /* extr $b, Rn, Rm, Rd */ + o1 = opextr(ctxt, int(p.As), int32(p.From.Offset), int(p.From3.Reg), int(p.Reg), int(p.To.Reg)) + + case 45: /* sxt/uxt[bhw] R,R; movT R,R -> sxtT R,R */ + rf := int(p.From.Reg) + + rt := int(p.To.Reg) + as := int(p.As) + if rf == REGZERO { + as = AMOVWU /* clearer in disassembly */ + } + switch as { + case AMOVB, ASXTB: + o1 = opbfm(ctxt, ASBFM, 0, 7, rf, rt) + + case AMOVH, ASXTH: + o1 = opbfm(ctxt, ASBFM, 0, 15, rf, rt) + + case AMOVW, ASXTW: + o1 = opbfm(ctxt, ASBFM, 0, 31, rf, rt) + + case AMOVBU, AUXTB: + o1 = opbfm(ctxt, AUBFM, 0, 7, rf, rt) + + case AMOVHU, AUXTH: + o1 = opbfm(ctxt, AUBFM, 0, 15, rf, rt) + + case AMOVWU: + o1 = oprrr(ctxt, as) | (uint32(rf&31) << 16) | (REGZERO & 31 << 5) | uint32(rt&31) + + case AUXTW: + o1 = opbfm(ctxt, AUBFM, 0, 31, rf, rt) + + case ASXTBW: + o1 = opbfm(ctxt, ASBFMW, 0, 7, rf, rt) + + case ASXTHW: + o1 = opbfm(ctxt, ASBFMW, 0, 15, rf, rt) + + case AUXTBW: + o1 = opbfm(ctxt, AUBFMW, 0, 7, rf, rt) + + case AUXTHW: + o1 = opbfm(ctxt, AUBFMW, 0, 15, rf, rt) + + default: + ctxt.Diag("bad sxt %v", obj.Aconv(as)) + break + } + + case 46: /* cls */ + o1 = opbit(ctxt, int(p.As)) + + o1 |= uint32(p.From.Reg&31) << 5 + o1 |= uint32(p.To.Reg & 31) + + case 47: /* movT R,V(R) -> strT (huge offset) */ + o1 = omovlit(ctxt, AMOVW, p, &p.To, REGTMP) + + if !(o1 != 0) { + break + } + r := int(p.To.Reg) + if r == 0 { + r = int(o.param) + } + o2 = olsxrr(ctxt, int(p.As), REGTMP, r, int(p.From.Reg)) + + case 48: /* movT V(R), R -> ldrT (huge offset) */ + o1 = omovlit(ctxt, AMOVW, p, &p.From, REGTMP) + + if !(o1 != 0) { + break + } + r := int(p.From.Reg) + if r == 0 { + r = int(o.param) + } + o2 = olsxrr(ctxt, int(p.As), REGTMP, r, int(p.To.Reg)) + + case 50: /* sys/sysl */ + o1 = opirr(ctxt, int(p.As)) + + if (p.From.Offset &^ int64(SYSARG4(0x7, 0xF, 0xF, 0x7))) != 0 { + ctxt.Diag("illegal SYS argument\n%v", p) + } + o1 |= uint32(p.From.Offset) + if p.To.Type == obj.TYPE_REG { + o1 |= uint32(p.To.Reg & 31) + } else if p.Reg != 0 { + o1 |= uint32(p.Reg & 31) + } else { + o1 |= 0x1F + } + + case 51: /* dmb */ + o1 = opirr(ctxt, int(p.As)) + + if p.From.Type == obj.TYPE_CONST { + o1 |= uint32((p.From.Offset & 0xF) << 8) + } + + case 52: /* hint */ + o1 = opirr(ctxt, int(p.As)) + + o1 |= uint32((p.From.Offset & 0x7F) << 5) + + case 53: /* and/or/eor/bic/... $bimmN, Rn, Rd -> op (N,r,s), Rn, Rd */ + ctxt.Diag("bitmask immediate not implemented\n%v", p) + + case 54: /* floating point arith */ + o1 = oprrr(ctxt, int(p.As)) + + var rf int + if p.From.Type == obj.TYPE_CONST { + rf = chipfloat7(ctxt, p.From.Val.(float64)) + if rf < 0 || true { + ctxt.Diag("invalid floating-point immediate\n%v", p) + rf = 0 + } + + rf |= (1 << 3) + } else { + rf = int(p.From.Reg) + } + rt := int(p.To.Reg) + r := int(p.Reg) + if (o1&(0x1F<<24)) == (0x1E<<24) && (o1&(1<<11)) == 0 { /* monadic */ + r = rf + rf = 0 + } else if r == 0 { + r = rt + } + o1 |= (uint32(rf&31) << 16) | (uint32(r&31) << 5) | uint32(rt&31) + + case 56: /* floating point compare */ + o1 = oprrr(ctxt, int(p.As)) + + var rf int + if p.From.Type == obj.TYPE_CONST { + o1 |= 8 /* zero */ + rf = 0 + } else { + rf = int(p.From.Reg) + } + rt := int(p.Reg) + o1 |= uint32(rf&31)<<16 | uint32(rt&31)<<5 + + case 57: /* floating point conditional compare */ + o1 = oprrr(ctxt, int(p.As)) + + cond := int(p.From.Reg) + nzcv := int(p.To.Offset) + if nzcv&^0xF != 0 { + ctxt.Diag("implausible condition\n%v", p) + } + rf := int(p.Reg) + if p.From3 == nil || p.From3.Reg < REG_F0 || p.From3.Reg > REG_F31 { + ctxt.Diag("illegal FCCMP\n%v", p) + break + } + rt := int(p.From3.Reg) + o1 |= uint32(rf&31)<<16 | uint32(cond)<<12 | uint32(rt&31)<<5 | uint32(nzcv) + + case 58: /* ldar/ldxr/ldaxr */ + o1 = opload(ctxt, int(p.As)) + + o1 |= 0x1F << 16 + o1 |= uint32(p.From.Reg) << 5 + if p.Reg != 0 { + o1 |= uint32(p.Reg) << 10 + } else { + o1 |= 0x1F << 10 + } + o1 |= uint32(p.To.Reg & 31) + + case 59: /* stxr/stlxr */ + o1 = opstore(ctxt, int(p.As)) + + if p.RegTo2 != obj.REG_NONE { + o1 |= uint32(p.RegTo2&31) << 16 + } else { + o1 |= 0x1F << 16 + } + + // TODO(aram): add support for STXP + o1 |= uint32(p.To.Reg&31) << 5 + + o1 |= uint32(p.From.Reg & 31) + + case 60: /* adrp label,r */ + d := brdist(ctxt, p, 12, 21, 0) + + o1 = ADR(1, uint32(d), uint32(p.To.Reg)) + + case 61: /* adr label, r */ + d := brdist(ctxt, p, 0, 21, 0) + + o1 = ADR(0, uint32(d), uint32(p.To.Reg)) + + case 62: /* case Rv, Rt -> adr tab, Rt; movw Rt[R<<2], Rl; add Rt, Rl; br (Rl) */ + // adr 4(pc), Rt + o1 = ADR(0, 4*4, uint32(p.To.Reg)) + // movw Rt[Rv<<2], REGTMP + o2 = (2 << 30) | (7 << 27) | (2 << 22) | (1 << 21) | (3 << 13) | (1 << 12) | (2 << 10) | (uint32(p.From.Reg&31) << 16) | (uint32(p.To.Reg&31) << 5) | REGTMP&31 + // add Rt, REGTMP + o3 = oprrr(ctxt, AADD) | (uint32(p.To.Reg) << 16) | (REGTMP << 5) | REGTMP + // br (REGTMP) + o4 = (0x6b << 25) | (0x1F << 16) | (REGTMP & 31 << 5) + lastcase = p + + case 63: /* bcase */ + if lastcase == nil { + ctxt.Diag("missing CASE\n%v", p) + break + } + + if p.Pcond != nil { + o1 = uint32(p.Pcond.Pc - (lastcase.Pc + 4*4)) + ctxt.Diag("FIXME: some relocation needed in bcase\n%v", p) + } + + /* reloc ops */ + case 64: /* movT R,addr -> adrp + add + movT R, (REGTMP) */ + o1 = ADR(1, 0, REGTMP) + o2 = opirr(ctxt, AADD) | REGTMP&31<<5 | REGTMP&31 + rel := obj.Addrel(ctxt.Cursym) + rel.Off = int32(ctxt.Pc) + rel.Siz = 8 + rel.Sym = p.To.Sym + rel.Add = p.To.Offset + rel.Type = obj.R_ADDRARM64 + o3 = olsr12u(ctxt, int32(opstr12(ctxt, int(p.As))), 0, REGTMP, int(p.From.Reg)) + + case 65: /* movT addr,R -> adrp + add + movT (REGTMP), R */ + o1 = ADR(1, 0, REGTMP) + o2 = opirr(ctxt, AADD) | REGTMP&31<<5 | REGTMP&31 + rel := obj.Addrel(ctxt.Cursym) + rel.Off = int32(ctxt.Pc) + rel.Siz = 8 + rel.Sym = p.From.Sym + rel.Add = p.From.Offset + rel.Type = obj.R_ADDRARM64 + o3 = olsr12u(ctxt, int32(opldr12(ctxt, int(p.As))), 0, REGTMP, int(p.To.Reg)) + + case 66: /* ldp O(R)!, (r1, r2); ldp (R)O!, (r1, r2) */ + v := int32(p.From.Offset) + + if v < -512 || v > 504 { + ctxt.Diag("offset out of range\n%v", p) + } + if o.scond == C_XPOST { + o1 |= 1 << 23 + } else { + o1 |= 3 << 23 + } + o1 |= 1 << 22 + o1 |= uint32(int64(2<<30|5<<27|((uint32(v)/8)&0x7f)<<15) | p.To.Offset<<10 | int64(uint32(p.From.Reg&31)<<5) | int64(p.To.Reg&31)) + + case 67: /* stp (r1, r2), O(R)!; stp (r1, r2), (R)O! */ + v := int32(p.To.Offset) + + if v < -512 || v > 504 { + ctxt.Diag("offset out of range\n%v", p) + } + if o.scond == C_XPOST { + o1 |= 1 << 23 + } else { + o1 |= 3 << 23 + } + o1 |= uint32(int64(2<<30|5<<27|((uint32(v)/8)&0x7f)<<15) | p.From.Offset<<10 | int64(uint32(p.To.Reg&31)<<5) | int64(p.From.Reg&31)) + + case 68: /* movT $vconaddr(SB), reg -> adrp + add + reloc */ + if p.As == AMOVW { + ctxt.Diag("invalid load of 32-bit address: %v", p) + } + o1 = ADR(1, 0, uint32(p.To.Reg)) + o2 = opirr(ctxt, AADD) | uint32(p.To.Reg&31)<<5 | uint32(p.To.Reg&31) + rel := obj.Addrel(ctxt.Cursym) + rel.Off = int32(ctxt.Pc) + rel.Siz = 8 + rel.Sym = p.From.Sym + rel.Add = p.From.Offset + rel.Type = obj.R_ADDRARM64 + + // This is supposed to be something that stops execution. + // It's not supposed to be reached, ever, but if it is, we'd + // like to be able to tell how we got there. Assemble as + // 0xbea71700 which is guaranteed to raise undefined instruction + // exception. + case 90: + o1 = 0xbea71700 + + break + } + + out[0] = o1 + out[1] = o2 + out[2] = o3 + out[3] = o4 + out[4] = o5 + return +} + +/* + * basic Rm op Rn -> Rd (using shifted register with 0) + * also op Rn -> Rt + * also Rm*Rn op Ra -> Rd + */ +func oprrr(ctxt *obj.Link, a int) uint32 { + switch a { + case AADC: + return S64 | 0<<30 | 0<<29 | 0xd0<<21 | 0<<10 + + case AADCW: + return S32 | 0<<30 | 0<<29 | 0xd0<<21 | 0<<10 + + case AADCS: + return S64 | 0<<30 | 1<<29 | 0xd0<<21 | 0<<10 + + case AADCSW: + return S32 | 0<<30 | 1<<29 | 0xd0<<21 | 0<<10 + + case ANGC, ASBC: + return S64 | 1<<30 | 0<<29 | 0xd0<<21 | 0<<10 + + case ANGCS, ASBCS: + return S64 | 1<<30 | 1<<29 | 0xd0<<21 | 0<<10 + + case ANGCW, ASBCW: + return S32 | 1<<30 | 0<<29 | 0xd0<<21 | 0<<10 + + case ANGCSW, ASBCSW: + return S32 | 1<<30 | 1<<29 | 0xd0<<21 | 0<<10 + + case AADD: + return S64 | 0<<30 | 0<<29 | 0x0b<<24 | 0<<22 | 0<<21 | 0<<10 + + case AADDW: + return S32 | 0<<30 | 0<<29 | 0x0b<<24 | 0<<22 | 0<<21 | 0<<10 + + case ACMN, AADDS: + return S64 | 0<<30 | 1<<29 | 0x0b<<24 | 0<<22 | 0<<21 | 0<<10 + + case ACMNW, AADDSW: + return S32 | 0<<30 | 1<<29 | 0x0b<<24 | 0<<22 | 0<<21 | 0<<10 + + case ASUB: + return S64 | 1<<30 | 0<<29 | 0x0b<<24 | 0<<22 | 0<<21 | 0<<10 + + case ASUBW: + return S32 | 1<<30 | 0<<29 | 0x0b<<24 | 0<<22 | 0<<21 | 0<<10 + + case ACMP, ASUBS: + return S64 | 1<<30 | 1<<29 | 0x0b<<24 | 0<<22 | 0<<21 | 0<<10 + + case ACMPW, ASUBSW: + return S32 | 1<<30 | 1<<29 | 0x0b<<24 | 0<<22 | 0<<21 | 0<<10 + + case AAND: + return S64 | 0<<29 | 0xA<<24 + + case AANDW: + return S32 | 0<<29 | 0xA<<24 + + case AMOVD, AORR: + return S64 | 1<<29 | 0xA<<24 + + // case AMOVW: + case AMOVWU, AORRW: + return S32 | 1<<29 | 0xA<<24 + + case AEOR: + return S64 | 2<<29 | 0xA<<24 + + case AEORW: + return S32 | 2<<29 | 0xA<<24 + + case AANDS: + return S64 | 3<<29 | 0xA<<24 + + case AANDSW: + return S32 | 3<<29 | 0xA<<24 + + case ABIC: + return S64 | 0<<29 | 0xA<<24 | 1<<21 + + case ABICW: + return S32 | 0<<29 | 0xA<<24 | 1<<21 + + case ABICS: + return S64 | 3<<29 | 0xA<<24 | 1<<21 + + case ABICSW: + return S32 | 3<<29 | 0xA<<24 | 1<<21 + + case AEON: + return S64 | 2<<29 | 0xA<<24 | 1<<21 + + case AEONW: + return S32 | 2<<29 | 0xA<<24 | 1<<21 + + case AMVN, AORN: + return S64 | 1<<29 | 0xA<<24 | 1<<21 + + case AMVNW, AORNW: + return S32 | 1<<29 | 0xA<<24 | 1<<21 + + case AASR: + return S64 | OPDP2(10) /* also ASRV */ + + case AASRW: + return S32 | OPDP2(10) + + case ALSL: + return S64 | OPDP2(8) + + case ALSLW: + return S32 | OPDP2(8) + + case ALSR: + return S64 | OPDP2(9) + + case ALSRW: + return S32 | OPDP2(9) + + case AROR: + return S64 | OPDP2(11) + + case ARORW: + return S32 | OPDP2(11) + + case ACCMN: + return S64 | 0<<30 | 1<<29 | 0xD2<<21 | 0<<11 | 0<<10 | 0<<4 /* cond<<12 | nzcv<<0 */ + + case ACCMNW: + return S32 | 0<<30 | 1<<29 | 0xD2<<21 | 0<<11 | 0<<10 | 0<<4 + + case ACCMP: + return S64 | 1<<30 | 1<<29 | 0xD2<<21 | 0<<11 | 0<<10 | 0<<4 /* imm5<<16 | cond<<12 | nzcv<<0 */ + + case ACCMPW: + return S32 | 1<<30 | 1<<29 | 0xD2<<21 | 0<<11 | 0<<10 | 0<<4 + + case ACRC32B: + return S32 | OPDP2(16) + + case ACRC32H: + return S32 | OPDP2(17) + + case ACRC32W: + return S32 | OPDP2(18) + + case ACRC32X: + return S64 | OPDP2(19) + + case ACRC32CB: + return S32 | OPDP2(20) + + case ACRC32CH: + return S32 | OPDP2(21) + + case ACRC32CW: + return S32 | OPDP2(22) + + case ACRC32CX: + return S64 | OPDP2(23) + + case ACSEL: + return S64 | 0<<30 | 0<<29 | 0xD4<<21 | 0<<11 | 0<<10 + + case ACSELW: + return S32 | 0<<30 | 0<<29 | 0xD4<<21 | 0<<11 | 0<<10 + + case ACSET: + return S64 | 0<<30 | 0<<29 | 0xD4<<21 | 0<<11 | 1<<10 + + case ACSETW: + return S32 | 0<<30 | 0<<29 | 0xD4<<21 | 0<<11 | 1<<10 + + case ACSETM: + return S64 | 1<<30 | 0<<29 | 0xD4<<21 | 0<<11 | 0<<10 + + case ACSETMW: + return S32 | 1<<30 | 0<<29 | 0xD4<<21 | 0<<11 | 0<<10 + + case ACINC, ACSINC: + return S64 | 0<<30 | 0<<29 | 0xD4<<21 | 0<<11 | 1<<10 + + case ACINCW, ACSINCW: + return S32 | 0<<30 | 0<<29 | 0xD4<<21 | 0<<11 | 1<<10 + + case ACINV, ACSINV: + return S64 | 1<<30 | 0<<29 | 0xD4<<21 | 0<<11 | 0<<10 + + case ACINVW, ACSINVW: + return S32 | 1<<30 | 0<<29 | 0xD4<<21 | 0<<11 | 0<<10 + + case ACNEG, ACSNEG: + return S64 | 1<<30 | 0<<29 | 0xD4<<21 | 0<<11 | 1<<10 + + case ACNEGW, ACSNEGW: + return S32 | 1<<30 | 0<<29 | 0xD4<<21 | 0<<11 | 1<<10 + + case AMUL, AMADD: + return S64 | 0<<29 | 0x1B<<24 | 0<<21 | 0<<15 + + case AMULW, AMADDW: + return S32 | 0<<29 | 0x1B<<24 | 0<<21 | 0<<15 + + case AMNEG, AMSUB: + return S64 | 0<<29 | 0x1B<<24 | 0<<21 | 1<<15 + + case AMNEGW, AMSUBW: + return S32 | 0<<29 | 0x1B<<24 | 0<<21 | 1<<15 + + case AMRS: + return SYSOP(1, 2, 0, 0, 0, 0, 0) + + case AMSR: + return SYSOP(0, 2, 0, 0, 0, 0, 0) + + case ANEG: + return S64 | 1<<30 | 0<<29 | 0xB<<24 | 0<<21 + + case ANEGW: + return S32 | 1<<30 | 0<<29 | 0xB<<24 | 0<<21 + + case ANEGS: + return S64 | 1<<30 | 1<<29 | 0xB<<24 | 0<<21 + + case ANEGSW: + return S32 | 1<<30 | 1<<29 | 0xB<<24 | 0<<21 + + case AREM, ASDIV: + return S64 | OPDP2(3) + + case AREMW, ASDIVW: + return S32 | OPDP2(3) + + case ASMULL, ASMADDL: + return OPDP3(1, 0, 1, 0) + + case ASMNEGL, ASMSUBL: + return OPDP3(1, 0, 1, 1) + + case ASMULH: + return OPDP3(1, 0, 2, 0) + + case AUMULL, AUMADDL: + return OPDP3(1, 0, 5, 0) + + case AUMNEGL, AUMSUBL: + return OPDP3(1, 0, 5, 1) + + case AUMULH: + return OPDP3(1, 0, 6, 0) + + case AUREM, AUDIV: + return S64 | OPDP2(2) + + case AUREMW, AUDIVW: + return S32 | OPDP2(2) + + case AAESE: + return 0x4E<<24 | 2<<20 | 8<<16 | 4<<12 | 2<<10 + + case AAESD: + return 0x4E<<24 | 2<<20 | 8<<16 | 5<<12 | 2<<10 + + case AAESMC: + return 0x4E<<24 | 2<<20 | 8<<16 | 6<<12 | 2<<10 + + case AAESIMC: + return 0x4E<<24 | 2<<20 | 8<<16 | 7<<12 | 2<<10 + + case ASHA1C: + return 0x5E<<24 | 0<<12 + + case ASHA1P: + return 0x5E<<24 | 1<<12 + + case ASHA1M: + return 0x5E<<24 | 2<<12 + + case ASHA1SU0: + return 0x5E<<24 | 3<<12 + + case ASHA256H: + return 0x5E<<24 | 4<<12 + + case ASHA256H2: + return 0x5E<<24 | 5<<12 + + case ASHA256SU1: + return 0x5E<<24 | 6<<12 + + case ASHA1H: + return 0x5E<<24 | 2<<20 | 8<<16 | 0<<12 | 2<<10 + + case ASHA1SU1: + return 0x5E<<24 | 2<<20 | 8<<16 | 1<<12 | 2<<10 + + case ASHA256SU0: + return 0x5E<<24 | 2<<20 | 8<<16 | 2<<12 | 2<<10 + + case AFCVTZSD: + return FPCVTI(1, 0, 1, 3, 0) + + case AFCVTZSDW: + return FPCVTI(0, 0, 1, 3, 0) + + case AFCVTZSS: + return FPCVTI(1, 0, 0, 3, 0) + + case AFCVTZSSW: + return FPCVTI(0, 0, 0, 3, 0) + + case AFCVTZUD: + return FPCVTI(1, 0, 1, 3, 1) + + case AFCVTZUDW: + return FPCVTI(0, 0, 1, 3, 1) + + case AFCVTZUS: + return FPCVTI(1, 0, 0, 3, 1) + + case AFCVTZUSW: + return FPCVTI(0, 0, 0, 3, 1) + + case ASCVTFD: + return FPCVTI(1, 0, 1, 0, 2) + + case ASCVTFS: + return FPCVTI(1, 0, 0, 0, 2) + + case ASCVTFWD: + return FPCVTI(0, 0, 1, 0, 2) + + case ASCVTFWS: + return FPCVTI(0, 0, 0, 0, 2) + + case AUCVTFD: + return FPCVTI(1, 0, 1, 0, 3) + + case AUCVTFS: + return FPCVTI(1, 0, 0, 0, 3) + + case AUCVTFWD: + return FPCVTI(0, 0, 1, 0, 3) + + case AUCVTFWS: + return FPCVTI(0, 0, 0, 0, 3) + + case AFADDS: + return FPOP2S(0, 0, 0, 2) + + case AFADDD: + return FPOP2S(0, 0, 1, 2) + + case AFSUBS: + return FPOP2S(0, 0, 0, 3) + + case AFSUBD: + return FPOP2S(0, 0, 1, 3) + + case AFMULS: + return FPOP2S(0, 0, 0, 0) + + case AFMULD: + return FPOP2S(0, 0, 1, 0) + + case AFDIVS: + return FPOP2S(0, 0, 0, 1) + + case AFDIVD: + return FPOP2S(0, 0, 1, 1) + + case AFMAXS: + return FPOP2S(0, 0, 0, 4) + + case AFMINS: + return FPOP2S(0, 0, 0, 5) + + case AFMAXD: + return FPOP2S(0, 0, 1, 4) + + case AFMIND: + return FPOP2S(0, 0, 1, 5) + + case AFMAXNMS: + return FPOP2S(0, 0, 0, 6) + + case AFMAXNMD: + return FPOP2S(0, 0, 1, 6) + + case AFMINNMS: + return FPOP2S(0, 0, 0, 7) + + case AFMINNMD: + return FPOP2S(0, 0, 1, 7) + + case AFNMULS: + return FPOP2S(0, 0, 0, 8) + + case AFNMULD: + return FPOP2S(0, 0, 1, 8) + + case AFCMPS: + return FPCMP(0, 0, 0, 0, 0) + + case AFCMPD: + return FPCMP(0, 0, 1, 0, 0) + + case AFCMPES: + return FPCMP(0, 0, 0, 0, 16) + + case AFCMPED: + return FPCMP(0, 0, 1, 0, 16) + + case AFCCMPS: + return FPCCMP(0, 0, 0, 0) + + case AFCCMPD: + return FPCCMP(0, 0, 1, 0) + + case AFCCMPES: + return FPCCMP(0, 0, 0, 1) + + case AFCCMPED: + return FPCCMP(0, 0, 1, 1) + + case AFCSELS: + return 0x1E<<24 | 0<<22 | 1<<21 | 3<<10 + + case AFCSELD: + return 0x1E<<24 | 1<<22 | 1<<21 | 3<<10 + + case AFMOVS: + return FPOP1S(0, 0, 0, 0) + + case AFABSS: + return FPOP1S(0, 0, 0, 1) + + case AFNEGS: + return FPOP1S(0, 0, 0, 2) + + case AFSQRTS: + return FPOP1S(0, 0, 0, 3) + + case AFCVTSD: + return FPOP1S(0, 0, 0, 5) + + case AFCVTSH: + return FPOP1S(0, 0, 0, 7) + + case AFRINTNS: + return FPOP1S(0, 0, 0, 8) + + case AFRINTPS: + return FPOP1S(0, 0, 0, 9) + + case AFRINTMS: + return FPOP1S(0, 0, 0, 10) + + case AFRINTZS: + return FPOP1S(0, 0, 0, 11) + + case AFRINTAS: + return FPOP1S(0, 0, 0, 12) + + case AFRINTXS: + return FPOP1S(0, 0, 0, 14) + + case AFRINTIS: + return FPOP1S(0, 0, 0, 15) + + case AFMOVD: + return FPOP1S(0, 0, 1, 0) + + case AFABSD: + return FPOP1S(0, 0, 1, 1) + + case AFNEGD: + return FPOP1S(0, 0, 1, 2) + + case AFSQRTD: + return FPOP1S(0, 0, 1, 3) + + case AFCVTDS: + return FPOP1S(0, 0, 1, 4) + + case AFCVTDH: + return FPOP1S(0, 0, 1, 7) + + case AFRINTND: + return FPOP1S(0, 0, 1, 8) + + case AFRINTPD: + return FPOP1S(0, 0, 1, 9) + + case AFRINTMD: + return FPOP1S(0, 0, 1, 10) + + case AFRINTZD: + return FPOP1S(0, 0, 1, 11) + + case AFRINTAD: + return FPOP1S(0, 0, 1, 12) + + case AFRINTXD: + return FPOP1S(0, 0, 1, 14) + + case AFRINTID: + return FPOP1S(0, 0, 1, 15) + + case AFCVTHS: + return FPOP1S(0, 0, 3, 4) + + case AFCVTHD: + return FPOP1S(0, 0, 3, 5) + } + + ctxt.Diag("bad rrr %d %v", a, obj.Aconv(a)) + prasm(ctxt.Curp) + return 0 +} + +/* + * imm -> Rd + * imm op Rn -> Rd + */ +func opirr(ctxt *obj.Link, a int) uint32 { + switch a { + /* op $addcon, Rn, Rd */ + case AMOVD, AADD: + return S64 | 0<<30 | 0<<29 | 0x11<<24 + + case ACMN, AADDS: + return S64 | 0<<30 | 1<<29 | 0x11<<24 + + case AMOVW, AADDW: + return S32 | 0<<30 | 0<<29 | 0x11<<24 + + case ACMNW, AADDSW: + return S32 | 0<<30 | 1<<29 | 0x11<<24 + + case ASUB: + return S64 | 1<<30 | 0<<29 | 0x11<<24 + + case ACMP, ASUBS: + return S64 | 1<<30 | 1<<29 | 0x11<<24 + + case ASUBW: + return S32 | 1<<30 | 0<<29 | 0x11<<24 + + case ACMPW, ASUBSW: + return S32 | 1<<30 | 1<<29 | 0x11<<24 + + /* op $imm(SB), Rd; op label, Rd */ + case AADR: + return 0<<31 | 0x10<<24 + + case AADRP: + return 1<<31 | 0x10<<24 + + /* op $bimm, Rn, Rd */ + case AAND: + return S64 | 0<<29 | 0x24<<23 + + case AANDW: + return S32 | 0<<29 | 0x24<<23 | 0<<22 + + case AORR: + return S64 | 1<<29 | 0x24<<23 + + case AORRW: + return S32 | 1<<29 | 0x24<<23 | 0<<22 + + case AEOR: + return S64 | 2<<29 | 0x24<<23 + + case AEORW: + return S32 | 2<<29 | 0x24<<23 | 0<<22 + + case AANDS: + return S64 | 3<<29 | 0x24<<23 + + case AANDSW: + return S32 | 3<<29 | 0x24<<23 | 0<<22 + + case AASR: + return S64 | 0<<29 | 0x26<<23 /* alias of SBFM */ + + case AASRW: + return S32 | 0<<29 | 0x26<<23 | 0<<22 + + /* op $width, $lsb, Rn, Rd */ + case ABFI: + return S64 | 2<<29 | 0x26<<23 | 1<<22 + /* alias of BFM */ + + case ABFIW: + return S32 | 2<<29 | 0x26<<23 | 0<<22 + + /* op $imms, $immr, Rn, Rd */ + case ABFM: + return S64 | 1<<29 | 0x26<<23 | 1<<22 + + case ABFMW: + return S32 | 1<<29 | 0x26<<23 | 0<<22 + + case ASBFM: + return S64 | 0<<29 | 0x26<<23 | 1<<22 + + case ASBFMW: + return S32 | 0<<29 | 0x26<<23 | 0<<22 + + case AUBFM: + return S64 | 2<<29 | 0x26<<23 | 1<<22 + + case AUBFMW: + return S32 | 2<<29 | 0x26<<23 | 0<<22 + + case ABFXIL: + return S64 | 1<<29 | 0x26<<23 | 1<<22 /* alias of BFM */ + + case ABFXILW: + return S32 | 1<<29 | 0x26<<23 | 0<<22 + + case AEXTR: + return S64 | 0<<29 | 0x27<<23 | 1<<22 | 0<<21 + + case AEXTRW: + return S32 | 0<<29 | 0x27<<23 | 0<<22 | 0<<21 + + case ACBNZ: + return S64 | 0x1A<<25 | 1<<24 + + case ACBNZW: + return S32 | 0x1A<<25 | 1<<24 + + case ACBZ: + return S64 | 0x1A<<25 | 0<<24 + + case ACBZW: + return S32 | 0x1A<<25 | 0<<24 + + case ACCMN: + return S64 | 0<<30 | 1<<29 | 0xD2<<21 | 1<<11 | 0<<10 | 0<<4 /* imm5<<16 | cond<<12 | nzcv<<0 */ + + case ACCMNW: + return S32 | 0<<30 | 1<<29 | 0xD2<<21 | 1<<11 | 0<<10 | 0<<4 + + case ACCMP: + return S64 | 1<<30 | 1<<29 | 0xD2<<21 | 1<<11 | 0<<10 | 0<<4 /* imm5<<16 | cond<<12 | nzcv<<0 */ + + case ACCMPW: + return S32 | 1<<30 | 1<<29 | 0xD2<<21 | 1<<11 | 0<<10 | 0<<4 + + case AMOVK: + return S64 | 3<<29 | 0x25<<23 + + case AMOVKW: + return S32 | 3<<29 | 0x25<<23 + + case AMOVN: + return S64 | 0<<29 | 0x25<<23 + + case AMOVNW: + return S32 | 0<<29 | 0x25<<23 + + case AMOVZ: + return S64 | 2<<29 | 0x25<<23 + + case AMOVZW: + return S32 | 2<<29 | 0x25<<23 + + case AMSR: + return SYSOP(0, 0, 0, 4, 0, 0, 0x1F) /* MSR (immediate) */ + + case AAT, + ADC, + AIC, + ATLBI, + ASYS: + return SYSOP(0, 1, 0, 0, 0, 0, 0) + + case ASYSL: + return SYSOP(1, 1, 0, 0, 0, 0, 0) + + case ATBZ: + return 0x36 << 24 + + case ATBNZ: + return 0x37 << 24 + + case ADSB: + return SYSOP(0, 0, 3, 3, 0, 4, 0x1F) + + case ADMB: + return SYSOP(0, 0, 3, 3, 0, 5, 0x1F) + + case AISB: + return SYSOP(0, 0, 3, 3, 0, 6, 0x1F) + + case AHINT: + return SYSOP(0, 0, 3, 2, 0, 0, 0x1F) + } + + ctxt.Diag("bad irr %v", obj.Aconv(a)) + prasm(ctxt.Curp) + return 0 +} + +func opbit(ctxt *obj.Link, a int) uint32 { + switch a { + case ACLS: + return S64 | OPBIT(5) + + case ACLSW: + return S32 | OPBIT(5) + + case ACLZ: + return S64 | OPBIT(4) + + case ACLZW: + return S32 | OPBIT(4) + + case ARBIT: + return S64 | OPBIT(0) + + case ARBITW: + return S32 | OPBIT(0) + + case AREV: + return S64 | OPBIT(3) + + case AREVW: + return S32 | OPBIT(2) + + case AREV16: + return S64 | OPBIT(1) + + case AREV16W: + return S32 | OPBIT(1) + + case AREV32: + return S64 | OPBIT(2) + + default: + ctxt.Diag("bad bit op\n%v", ctxt.Curp) + return 0 + } +} + +/* + * add/subtract extended register + */ +func opxrrr(ctxt *obj.Link, a int) uint32 { + switch a { + case AADD: + return S64 | 0<<30 | 0<<29 | 0x0b<<24 | 0<<22 | 1<<21 | LSL0_64 + + case AADDW: + return S32 | 0<<30 | 0<<29 | 0x0b<<24 | 0<<22 | 1<<21 | LSL0_32 + + case ACMN, AADDS: + return S64 | 0<<30 | 1<<29 | 0x0b<<24 | 0<<22 | 1<<21 | LSL0_64 + + case ACMNW, AADDSW: + return S32 | 0<<30 | 1<<29 | 0x0b<<24 | 0<<22 | 1<<21 | LSL0_32 + + case ASUB: + return S64 | 1<<30 | 0<<29 | 0x0b<<24 | 0<<22 | 1<<21 | LSL0_64 + + case ASUBW: + return S32 | 1<<30 | 0<<29 | 0x0b<<24 | 0<<22 | 1<<21 | LSL0_32 + + case ACMP, ASUBS: + return S64 | 1<<30 | 1<<29 | 0x0b<<24 | 0<<22 | 1<<21 | LSL0_64 + + case ACMPW, ASUBSW: + return S32 | 1<<30 | 1<<29 | 0x0b<<24 | 0<<22 | 1<<21 | LSL0_32 + } + + ctxt.Diag("bad opxrrr %v\n%v", obj.Aconv(a), ctxt.Curp) + return 0 +} + +func opimm(ctxt *obj.Link, a int) uint32 { + switch a { + case ASVC: + return 0xD4<<24 | 0<<21 | 1 /* imm16<<5 */ + + case AHVC: + return 0xD4<<24 | 0<<21 | 2 + + case ASMC: + return 0xD4<<24 | 0<<21 | 3 + + case ABRK: + return 0xD4<<24 | 1<<21 | 0 + + case AHLT: + return 0xD4<<24 | 2<<21 | 0 + + case ADCPS1: + return 0xD4<<24 | 5<<21 | 1 + + case ADCPS2: + return 0xD4<<24 | 5<<21 | 2 + + case ADCPS3: + return 0xD4<<24 | 5<<21 | 3 + + case ACLREX: + return SYSOP(0, 0, 3, 3, 0, 2, 0x1F) + } + + ctxt.Diag("bad imm %v", obj.Aconv(a)) + prasm(ctxt.Curp) + return 0 +} + +func brdist(ctxt *obj.Link, p *obj.Prog, preshift int, flen int, shift int) int64 { + v := int64(0) + t := int64(0) + if p.Pcond != nil { + v = (p.Pcond.Pc >> uint(preshift)) - (ctxt.Pc >> uint(preshift)) + if (v & ((1 << uint(shift)) - 1)) != 0 { + ctxt.Diag("misaligned label\n%v", p) + } + v >>= uint(shift) + t = int64(1) << uint(flen-1) + if v < -t || v >= t { + ctxt.Diag("branch too far\n%v", p) + } + } + + return v & ((t << 1) - 1) +} + +/* + * pc-relative branches + */ +func opbra(ctxt *obj.Link, a int) uint32 { + switch a { + case ABEQ: + return OPBcc(0x0) + + case ABNE: + return OPBcc(0x1) + + case ABCS: + return OPBcc(0x2) + + case ABHS: + return OPBcc(0x2) + + case ABCC: + return OPBcc(0x3) + + case ABLO: + return OPBcc(0x3) + + case ABMI: + return OPBcc(0x4) + + case ABPL: + return OPBcc(0x5) + + case ABVS: + return OPBcc(0x6) + + case ABVC: + return OPBcc(0x7) + + case ABHI: + return OPBcc(0x8) + + case ABLS: + return OPBcc(0x9) + + case ABGE: + return OPBcc(0xa) + + case ABLT: + return OPBcc(0xb) + + case ABGT: + return OPBcc(0xc) + + case ABLE: + return OPBcc(0xd) /* imm19<<5 | cond */ + + case AB: + return 0<<31 | 5<<26 /* imm26 */ + + case obj.ADUFFZERO, + ABL: + return 1<<31 | 5<<26 + } + + ctxt.Diag("bad bra %v", obj.Aconv(a)) + prasm(ctxt.Curp) + return 0 +} + +func opbrr(ctxt *obj.Link, a int) uint32 { + switch a { + case ABL: + return OPBLR(1) /* BLR */ + + case AB: + return OPBLR(0) /* BR */ + + case obj.ARET: + return OPBLR(2) /* RET */ + } + + ctxt.Diag("bad brr %v", obj.Aconv(a)) + prasm(ctxt.Curp) + return 0 +} + +func op0(ctxt *obj.Link, a int) uint32 { + switch a { + case ADRPS: + return 0x6B<<25 | 5<<21 | 0x1F<<16 | 0x1F<<5 + + case AERET: + return 0x6B<<25 | 4<<21 | 0x1F<<16 | 0<<10 | 0x1F<<5 + + // case ANOP: + // return SYSHINT(0) + + case AYIELD: + return SYSHINT(1) + + case AWFE: + return SYSHINT(2) + + case AWFI: + return SYSHINT(3) + + case ASEV: + return SYSHINT(4) + + case ASEVL: + return SYSHINT(5) + } + + ctxt.Diag("bad op0 %v", obj.Aconv(a)) + prasm(ctxt.Curp) + return 0 +} + +/* + * register offset + */ +func opload(ctxt *obj.Link, a int) uint32 { + switch a { + case ALDAR: + return LDSTX(3, 1, 1, 0, 1) | 0x1F<<10 + + case ALDARW: + return LDSTX(2, 1, 1, 0, 1) | 0x1F<<10 + + case ALDARB: + return LDSTX(0, 1, 1, 0, 1) | 0x1F<<10 + + case ALDARH: + return LDSTX(1, 1, 1, 0, 1) | 0x1F<<10 + + case ALDAXP: + return LDSTX(3, 0, 1, 1, 1) + + case ALDAXPW: + return LDSTX(2, 0, 1, 1, 1) + + case ALDAXR: + return LDSTX(3, 0, 1, 0, 1) | 0x1F<<10 + + case ALDAXRW: + return LDSTX(2, 0, 1, 0, 1) | 0x1F<<10 + + case ALDAXRB: + return LDSTX(0, 0, 1, 0, 1) | 0x1F<<10 + + case ALDAXRH: + return LDSTX(1, 0, 1, 0, 1) | 0x1F<<10 + + case ALDXR: + return LDSTX(3, 0, 1, 0, 0) | 0x1F<<10 + + case ALDXRB: + return LDSTX(0, 0, 1, 0, 0) | 0x1F<<10 + + case ALDXRH: + return LDSTX(1, 0, 1, 0, 0) | 0x1F<<10 + + case ALDXRW: + return LDSTX(2, 0, 1, 0, 0) | 0x1F<<10 + + case ALDXP: + return LDSTX(3, 0, 1, 1, 0) + + case ALDXPW: + return LDSTX(2, 0, 1, 1, 0) + + case AMOVNP: + return S64 | 0<<30 | 5<<27 | 0<<26 | 0<<23 | 1<<22 + + case AMOVNPW: + return S32 | 0<<30 | 5<<27 | 0<<26 | 0<<23 | 1<<22 + } + + ctxt.Diag("bad opload %v\n%v", obj.Aconv(a), ctxt.Curp) + return 0 +} + +func opstore(ctxt *obj.Link, a int) uint32 { + switch a { + case ASTLR: + return LDSTX(3, 1, 0, 0, 1) | 0x1F<<10 + + case ASTLRB: + return LDSTX(0, 1, 0, 0, 1) | 0x1F<<10 + + case ASTLRH: + return LDSTX(1, 1, 0, 0, 1) | 0x1F<<10 + + case ASTLP: + return LDSTX(3, 0, 0, 1, 1) + + case ASTLPW: + return LDSTX(2, 0, 0, 1, 1) + + case ASTLRW: + return LDSTX(2, 1, 0, 0, 1) | 0x1F<<10 + + case ASTLXP: + return LDSTX(2, 0, 0, 1, 1) + + case ASTLXPW: + return LDSTX(3, 0, 0, 1, 1) + + case ASTLXR: + return LDSTX(3, 0, 0, 0, 1) | 0x1F<<10 + + case ASTLXRB: + return LDSTX(0, 0, 0, 0, 1) | 0x1F<<10 + + case ASTLXRH: + return LDSTX(1, 0, 0, 0, 1) | 0x1F<<10 + + case ASTLXRW: + return LDSTX(2, 0, 0, 0, 1) | 0x1F<<10 + + case ASTXR: + return LDSTX(3, 0, 0, 0, 0) | 0x1F<<10 + + case ASTXRB: + return LDSTX(0, 0, 0, 0, 0) | 0x1F<<10 + + case ASTXRH: + return LDSTX(1, 0, 0, 0, 0) | 0x1F<<10 + + case ASTXP: + return LDSTX(3, 0, 0, 1, 0) + + case ASTXPW: + return LDSTX(2, 0, 0, 1, 0) + + case ASTXRW: + return LDSTX(2, 0, 0, 0, 0) | 0x1F<<10 + + case AMOVNP: + return S64 | 0<<30 | 5<<27 | 0<<26 | 0<<23 | 1<<22 + + case AMOVNPW: + return S32 | 0<<30 | 5<<27 | 0<<26 | 0<<23 | 1<<22 + } + + ctxt.Diag("bad opstore %v\n%v", obj.Aconv(a), ctxt.Curp) + return 0 +} + +/* + * load/store register (unsigned immediate) C3.3.13 + * these produce 64-bit values (when there's an option) + */ +func olsr12u(ctxt *obj.Link, o int32, v int32, b int, r int) uint32 { + if v < 0 || v >= (1<<12) { + ctxt.Diag("offset out of range: %d\n%v", v, ctxt.Curp) + } + o |= (v & 0xFFF) << 10 + o |= int32(b&31) << 5 + o |= int32(r & 31) + return uint32(o) +} + +func opldr12(ctxt *obj.Link, a int) uint32 { + switch a { + case AMOVD: + return LDSTR12U(3, 0, 1) /* imm12<<10 | Rn<<5 | Rt */ + + case AMOVW: + return LDSTR12U(2, 0, 2) + + case AMOVWU: + return LDSTR12U(2, 0, 1) + + case AMOVH: + return LDSTR12U(1, 0, 2) + + case AMOVHU: + return LDSTR12U(1, 0, 1) + + case AMOVB: + return LDSTR12U(0, 0, 2) + + case AMOVBU: + return LDSTR12U(0, 0, 1) + + case AFMOVS: + return LDSTR12U(2, 1, 1) + + case AFMOVD: + return LDSTR12U(3, 1, 1) + } + + ctxt.Diag("bad opldr12 %v\n%v", obj.Aconv(a), ctxt.Curp) + return 0 +} + +func opstr12(ctxt *obj.Link, a int) uint32 { + return LD2STR(opldr12(ctxt, a)) +} + +/* + * load/store register (unscaled immediate) C3.3.12 + */ +func olsr9s(ctxt *obj.Link, o int32, v int32, b int, r int) uint32 { + if v < -256 || v > 255 { + ctxt.Diag("offset out of range: %d\n%v", v, ctxt.Curp) + } + o |= (v & 0x1FF) << 12 + o |= int32(b&31) << 5 + o |= int32(r & 31) + return uint32(o) +} + +func opldr9(ctxt *obj.Link, a int) uint32 { + switch a { + case AMOVD: + return LDSTR9S(3, 0, 1) /* simm9<<12 | Rn<<5 | Rt */ + + case AMOVW: + return LDSTR9S(2, 0, 2) + + case AMOVWU: + return LDSTR9S(2, 0, 1) + + case AMOVH: + return LDSTR9S(1, 0, 2) + + case AMOVHU: + return LDSTR9S(1, 0, 1) + + case AMOVB: + return LDSTR9S(0, 0, 2) + + case AMOVBU: + return LDSTR9S(0, 0, 1) + + case AFMOVS: + return LDSTR9S(2, 1, 1) + + case AFMOVD: + return LDSTR9S(3, 1, 1) + } + + ctxt.Diag("bad opldr9 %v\n%v", obj.Aconv(a), ctxt.Curp) + return 0 +} + +func opstr9(ctxt *obj.Link, a int) uint32 { + return LD2STR(opldr9(ctxt, a)) +} + +func opldrpp(ctxt *obj.Link, a int) uint32 { + switch a { + case AMOVD: + return 3<<30 | 7<<27 | 0<<26 | 0<<24 | 1<<22 /* simm9<<12 | Rn<<5 | Rt */ + + case AMOVW: + return 2<<30 | 7<<27 | 0<<26 | 0<<24 | 2<<22 + + case AMOVWU: + return 2<<30 | 7<<27 | 0<<26 | 0<<24 | 1<<22 + + case AMOVH: + return 1<<30 | 7<<27 | 0<<26 | 0<<24 | 2<<22 + + case AMOVHU: + return 1<<30 | 7<<27 | 0<<26 | 0<<24 | 1<<22 + + case AMOVB: + return 0<<30 | 7<<27 | 0<<26 | 0<<24 | 2<<22 + + case AMOVBU: + return 0<<30 | 7<<27 | 0<<26 | 0<<24 | 1<<22 + } + + ctxt.Diag("bad opldr %v\n%v", obj.Aconv(a), ctxt.Curp) + return 0 +} + +/* + * load/store register (extended register) + */ +func olsxrr(ctxt *obj.Link, as int, rt int, r1 int, r2 int) uint32 { + ctxt.Diag("need load/store extended register\n%v", ctxt.Curp) + return 0xffffffff +} + +func oaddi(ctxt *obj.Link, o1 int32, v int32, r int, rt int) uint32 { + if (v & 0xFFF000) != 0 { + if v&0xFFF != 0 { + ctxt.Diag("%v misuses oaddi", ctxt.Curp) + } + v >>= 12 + o1 |= 1 << 22 + } + + o1 |= ((v & 0xFFF) << 10) | (int32(r&31) << 5) | int32(rt&31) + return uint32(o1) +} + +/* + * load a a literal value into dr + */ +func omovlit(ctxt *obj.Link, as int, p *obj.Prog, a *obj.Addr, dr int) uint32 { + var o1 int32 + if p.Pcond == nil { /* not in literal pool */ + aclass(ctxt, a) + fmt.Fprintf(ctxt.Bso, "omovlit add %d (%#x)\n", ctxt.Instoffset, uint64(ctxt.Instoffset)) + + /* TODO: could be clever, and use general constant builder */ + o1 = int32(opirr(ctxt, AADD)) + + v := int32(ctxt.Instoffset) + if v != 0 && (v&0xFFF) == 0 { + v >>= 12 + o1 |= 1 << 22 /* shift, by 12 */ + } + + o1 |= ((v & 0xFFF) << 10) | (REGZERO & 31 << 5) | int32(dr&31) + } else { + fp := 0 + w := 0 /* default: 32 bit, unsigned */ + switch as { + case AFMOVS: + fp = 1 + + case AFMOVD: + fp = 1 + w = 1 /* 64 bit simd&fp */ + + case AMOVD: + if p.Pcond.As == ADWORD { + w = 1 /* 64 bit */ + } else if p.Pcond.To.Offset < 0 { + w = 2 /* sign extend */ + } + + case AMOVB, AMOVH, AMOVW: + w = 2 /* 32 bit, sign-extended to 64 */ + break + } + + v := int32(brdist(ctxt, p, 0, 19, 2)) + o1 = (int32(w) << 30) | (int32(fp) << 26) | (3 << 27) + o1 |= (v & 0x7FFFF) << 5 + o1 |= int32(dr & 31) + } + + return uint32(o1) +} + +func opbfm(ctxt *obj.Link, a int, r int, s int, rf int, rt int) uint32 { + var c uint32 + o := opirr(ctxt, a) + if (o & (1 << 31)) == 0 { + c = 32 + } else { + c = 64 + } + if r < 0 || uint32(r) >= c { + ctxt.Diag("illegal bit number\n%v", ctxt.Curp) + } + o |= (uint32(r) & 0x3F) << 16 + if s < 0 || uint32(s) >= c { + ctxt.Diag("illegal bit number\n%v", ctxt.Curp) + } + o |= (uint32(s) & 0x3F) << 10 + o |= (uint32(rf&31) << 5) | uint32(rt&31) + return o +} + +func opextr(ctxt *obj.Link, a int, v int32, rn int, rm int, rt int) uint32 { + var c uint32 + o := opirr(ctxt, a) + if (o & (1 << 31)) != 0 { + c = 63 + } else { + c = 31 + } + if v < 0 || uint32(v) > c { + ctxt.Diag("illegal bit number\n%v", ctxt.Curp) + } + o |= uint32(v) << 10 + o |= uint32(rn&31) << 5 + o |= uint32(rm&31) << 16 + o |= uint32(rt & 31) + return o +} + +/* + * size in log2(bytes) + */ +func movesize(a int) int { + switch a { + case AMOVD: + return 3 + + case AMOVW, AMOVWU: + return 2 + + case AMOVH, AMOVHU: + return 1 + + case AMOVB, AMOVBU: + return 0 + + case AFMOVS: + return 2 + + case AFMOVD: + return 3 + + default: + return -1 + } +} diff --git a/src/cmd/internal/obj/arm64/list7.go b/src/cmd/internal/obj/arm64/list7.go new file mode 100644 index 0000000000000000000000000000000000000000..53d67c91bbd462a6c3e0e471fb9fe83b01d286c2 --- /dev/null +++ b/src/cmd/internal/obj/arm64/list7.go @@ -0,0 +1,114 @@ +// cmd/7l/list.c and cmd/7l/sub.c from Vita Nuova. +// https://code.google.com/p/ken-cc/source/browse/ +// +// Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved. +// Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net) +// Portions Copyright © 1997-1999 Vita Nuova Limited +// Portions Copyright © 2000-2007 Vita Nuova Holdings Limited (www.vitanuova.com) +// Portions Copyright © 2004,2006 Bruce Ellis +// Portions Copyright © 2005-2007 C H Forsyth (forsyth@terzarima.net) +// Revisions Copyright © 2000-2007 Lucent Technologies Inc. and others +// Portions Copyright © 2009 The Go Authors. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +package arm64 + +import ( + "cmd/internal/obj" + "fmt" +) + +var strcond = [16]string{ + "EQ", + "NE", + "HS", + "LO", + "MI", + "PL", + "VS", + "VC", + "HI", + "LS", + "GE", + "LT", + "GT", + "LE", + "AL", + "NV", +} + +func init() { + obj.RegisterRegister(obj.RBaseARM64, REG_SPECIAL+1024, Rconv) + obj.RegisterOpcode(obj.ABaseARM64, Anames) +} + +func Rconv(r int) string { + if r == REGG { + return "g" + } + switch { + case REG_R0 <= r && r <= REG_R30: + return fmt.Sprintf("R%d", r-REG_R0) + case r == REG_R31: + return "ZR" + case REG_F0 <= r && r <= REG_F31: + return fmt.Sprintf("F%d", r-REG_F0) + case REG_V0 <= r && r <= REG_V31: + return fmt.Sprintf("V%d", r-REG_F0) + case COND_EQ <= r && r <= COND_NV: + return strcond[r-COND_EQ] + case r == REGSP: + return "RSP" + case r == REG_DAIF: + return "DAIF" + case r == REG_NZCV: + return "NZCV" + case r == REG_FPSR: + return "FPSR" + case r == REG_FPCR: + return "FPCR" + case r == REG_SPSR_EL1: + return "SPSR_EL1" + case r == REG_ELR_EL1: + return "ELR_EL1" + case r == REG_SPSR_EL2: + return "SPSR_EL2" + case r == REG_ELR_EL2: + return "ELR_EL2" + case r == REG_CurrentEL: + return "CurrentEL" + case r == REG_SP_EL0: + return "SP_EL0" + case r == REG_SPSel: + return "SPSel" + case r == REG_DAIFSet: + return "DAIFSet" + case r == REG_DAIFClr: + return "DAIFClr" + } + return fmt.Sprintf("badreg(%d)", r) +} + +func DRconv(a int) string { + if a >= C_NONE && a <= C_NCLASS { + return cnames7[a] + } + return "C_??" +} diff --git a/src/cmd/internal/obj/arm64/obj7.go b/src/cmd/internal/obj/arm64/obj7.go new file mode 100644 index 0000000000000000000000000000000000000000..f43ce0374cdb0b907e43dcf5d93947be3e33bad2 --- /dev/null +++ b/src/cmd/internal/obj/arm64/obj7.go @@ -0,0 +1,836 @@ +// cmd/7l/noop.c, cmd/7l/obj.c, cmd/ld/pass.c from Vita Nuova. +// https://code.google.com/p/ken-cc/source/browse/ +// +// Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved. +// Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net) +// Portions Copyright © 1997-1999 Vita Nuova Limited +// Portions Copyright © 2000-2007 Vita Nuova Holdings Limited (www.vitanuova.com) +// Portions Copyright © 2004,2006 Bruce Ellis +// Portions Copyright © 2005-2007 C H Forsyth (forsyth@terzarima.net) +// Revisions Copyright © 2000-2007 Lucent Technologies Inc. and others +// Portions Copyright © 2009 The Go Authors. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +package arm64 + +import ( + "cmd/internal/obj" + "encoding/binary" + "fmt" + "log" + "math" +) + +var complements = []int16{ + AADD: ASUB, + AADDW: ASUBW, + ASUB: AADD, + ASUBW: AADDW, + ACMP: ACMN, + ACMPW: ACMNW, + ACMN: ACMP, + ACMNW: ACMPW, +} + +func stacksplit(ctxt *obj.Link, p *obj.Prog, framesize int32) *obj.Prog { + // MOV g_stackguard(g), R1 + p = obj.Appendp(ctxt, p) + + p.As = AMOVD + p.From.Type = obj.TYPE_MEM + p.From.Reg = REGG + p.From.Offset = 2 * int64(ctxt.Arch.Ptrsize) // G.stackguard0 + if ctxt.Cursym.Cfunc != 0 { + p.From.Offset = 3 * int64(ctxt.Arch.Ptrsize) // G.stackguard1 + } + p.To.Type = obj.TYPE_REG + p.To.Reg = REG_R1 + + q := (*obj.Prog)(nil) + if framesize <= obj.StackSmall { + // small stack: SP < stackguard + // MOV SP, R2 + // CMP stackguard, R2 + p = obj.Appendp(ctxt, p) + + p.As = AMOVD + p.From.Type = obj.TYPE_REG + p.From.Reg = REGSP + p.To.Type = obj.TYPE_REG + p.To.Reg = REG_R2 + + p = obj.Appendp(ctxt, p) + p.As = ACMP + p.From.Type = obj.TYPE_REG + p.From.Reg = REG_R1 + p.Reg = REG_R2 + } else if framesize <= obj.StackBig { + // large stack: SP-framesize < stackguard-StackSmall + // SUB $framesize, SP, R2 + // CMP stackguard, R2 + p = obj.Appendp(ctxt, p) + + p.As = ASUB + p.From.Type = obj.TYPE_CONST + p.From.Offset = int64(framesize) + p.Reg = REGSP + p.To.Type = obj.TYPE_REG + p.To.Reg = REG_R2 + + p = obj.Appendp(ctxt, p) + p.As = ACMP + p.From.Type = obj.TYPE_REG + p.From.Reg = REG_R1 + p.Reg = REG_R2 + } else { + // Such a large stack we need to protect against wraparound + // if SP is close to zero. + // SP-stackguard+StackGuard < framesize + (StackGuard-StackSmall) + // The +StackGuard on both sides is required to keep the left side positive: + // SP is allowed to be slightly below stackguard. See stack.h. + // CMP $StackPreempt, R1 + // BEQ label_of_call_to_morestack + // ADD $StackGuard, SP, R2 + // SUB R1, R2 + // MOV $(framesize+(StackGuard-StackSmall)), R3 + // CMP R3, R2 + p = obj.Appendp(ctxt, p) + + p.As = ACMP + p.From.Type = obj.TYPE_CONST + p.From.Offset = obj.StackPreempt + p.Reg = REG_R1 + + p = obj.Appendp(ctxt, p) + q = p + p.As = ABEQ + p.To.Type = obj.TYPE_BRANCH + + p = obj.Appendp(ctxt, p) + p.As = AADD + p.From.Type = obj.TYPE_CONST + p.From.Offset = obj.StackGuard + p.Reg = REGSP + p.To.Type = obj.TYPE_REG + p.To.Reg = REG_R2 + + p = obj.Appendp(ctxt, p) + p.As = ASUB + p.From.Type = obj.TYPE_REG + p.From.Reg = REG_R1 + p.To.Type = obj.TYPE_REG + p.To.Reg = REG_R2 + + p = obj.Appendp(ctxt, p) + p.As = AMOVD + p.From.Type = obj.TYPE_CONST + p.From.Offset = int64(framesize) + (obj.StackGuard - obj.StackSmall) + p.To.Type = obj.TYPE_REG + p.To.Reg = REG_R3 + + p = obj.Appendp(ctxt, p) + p.As = ACMP + p.From.Type = obj.TYPE_REG + p.From.Reg = REG_R3 + p.Reg = REG_R2 + } + + // BLS do-morestack + bls := obj.Appendp(ctxt, p) + bls.As = ABLS + bls.To.Type = obj.TYPE_BRANCH + + var last *obj.Prog + for last = ctxt.Cursym.Text; last.Link != nil; last = last.Link { + } + + // MOV LR, R3 + movlr := obj.Appendp(ctxt, last) + movlr.As = AMOVD + movlr.From.Type = obj.TYPE_REG + movlr.From.Reg = REGLINK + movlr.To.Type = obj.TYPE_REG + movlr.To.Reg = REG_R3 + if q != nil { + q.Pcond = movlr + } + bls.Pcond = movlr + + debug := movlr + if false { + debug = obj.Appendp(ctxt, debug) + debug.As = AMOVD + debug.From.Type = obj.TYPE_CONST + debug.From.Offset = int64(framesize) + debug.To.Type = obj.TYPE_REG + debug.To.Reg = REGTMP + } + + // BL runtime.morestack(SB) + call := obj.Appendp(ctxt, debug) + call.As = ABL + call.To.Type = obj.TYPE_BRANCH + morestack := "runtime.morestack" + switch { + case ctxt.Cursym.Cfunc != 0: + morestack = "runtime.morestackc" + case ctxt.Cursym.Text.From3.Offset&obj.NEEDCTXT == 0: + morestack = "runtime.morestack_noctxt" + } + call.To.Sym = obj.Linklookup(ctxt, morestack, 0) + + // B start + jmp := obj.Appendp(ctxt, call) + jmp.As = AB + jmp.To.Type = obj.TYPE_BRANCH + jmp.Pcond = ctxt.Cursym.Text.Link + + // placeholder for bls's jump target + // p = obj.Appendp(ctxt, p) + // p.As = obj.ANOP + + return bls +} + +func progedit(ctxt *obj.Link, p *obj.Prog) { + p.From.Class = 0 + p.To.Class = 0 + + // $0 results in C_ZCON, which matches both C_REG and various + // C_xCON, however the C_REG cases in asmout don't expect a + // constant, so they will use the register fields and assemble + // a R0. To prevent that, rewrite $0 as ZR. + if p.From.Type == obj.TYPE_CONST && p.From.Offset == 0 { + p.From.Type = obj.TYPE_REG + p.From.Reg = REGZERO + } + if p.To.Type == obj.TYPE_CONST && p.To.Offset == 0 { + p.To.Type = obj.TYPE_REG + p.To.Reg = REGZERO + } + + // Rewrite BR/BL to symbol as TYPE_BRANCH. + switch p.As { + case AB, + ABL, + obj.ARET, + obj.ADUFFZERO, + obj.ADUFFCOPY: + if p.To.Sym != nil { + p.To.Type = obj.TYPE_BRANCH + } + break + } + + // Rewrite float constants to values stored in memory. + switch p.As { + case AFMOVS: + if p.From.Type == obj.TYPE_FCONST { + f32 := float32(p.From.Val.(float64)) + i32 := math.Float32bits(f32) + literal := fmt.Sprintf("$f32.%08x", uint32(i32)) + s := obj.Linklookup(ctxt, literal, 0) + s.Size = 4 + p.From.Type = obj.TYPE_MEM + p.From.Sym = s + p.From.Name = obj.NAME_EXTERN + p.From.Offset = 0 + } + + case AFMOVD: + if p.From.Type == obj.TYPE_FCONST { + i64 := math.Float64bits(p.From.Val.(float64)) + literal := fmt.Sprintf("$f64.%016x", uint64(i64)) + s := obj.Linklookup(ctxt, literal, 0) + s.Size = 8 + p.From.Type = obj.TYPE_MEM + p.From.Sym = s + p.From.Name = obj.NAME_EXTERN + p.From.Offset = 0 + } + + break + } + + // Rewrite negative immediates as positive immediates with + // complementary instruction. + switch p.As { + case AADD, + AADDW, + ASUB, + ASUBW, + ACMP, + ACMPW, + ACMN, + ACMNW: + if p.From.Type == obj.NAME_EXTERN && p.From.Offset < 0 { + p.From.Offset = -p.From.Offset + p.As = complements[p.As] + } + + break + } +} + +func follow(ctxt *obj.Link, s *obj.LSym) { + ctxt.Cursym = s + + firstp := ctxt.NewProg() + lastp := firstp + xfol(ctxt, s.Text, &lastp) + lastp.Link = nil + s.Text = firstp.Link +} + +func relinv(a int) int { + switch a { + case ABEQ: + return ABNE + case ABNE: + return ABEQ + case ABCS: + return ABCC + case ABHS: + return ABLO + case ABCC: + return ABCS + case ABLO: + return ABHS + case ABMI: + return ABPL + case ABPL: + return ABMI + case ABVS: + return ABVC + case ABVC: + return ABVS + case ABHI: + return ABLS + case ABLS: + return ABHI + case ABGE: + return ABLT + case ABLT: + return ABGE + case ABGT: + return ABLE + case ABLE: + return ABGT + } + + log.Fatalf("unknown relation: %s", Anames[a]) + return 0 +} + +func xfol(ctxt *obj.Link, p *obj.Prog, last **obj.Prog) { + var q *obj.Prog + var r *obj.Prog + var a int + var i int + +loop: + if p == nil { + return + } + a = int(p.As) + if a == AB { + q = p.Pcond + if q != nil { + p.Mark |= FOLL + p = q + if !(p.Mark&FOLL != 0) { + goto loop + } + } + } + + if p.Mark&FOLL != 0 { + i = 0 + q = p + for ; i < 4; i, q = i+1, q.Link { + if q == *last || q == nil { + break + } + a = int(q.As) + if a == obj.ANOP { + i-- + continue + } + + if a == AB || a == obj.ARET || a == AERET { + goto copy + } + if q.Pcond == nil || (q.Pcond.Mark&FOLL != 0) { + continue + } + if a != ABEQ && a != ABNE { + continue + } + + copy: + for { + r = ctxt.NewProg() + *r = *p + if !(r.Mark&FOLL != 0) { + fmt.Printf("cant happen 1\n") + } + r.Mark |= FOLL + if p != q { + p = p.Link + (*last).Link = r + *last = r + continue + } + + (*last).Link = r + *last = r + if a == AB || a == obj.ARET || a == AERET { + return + } + if a == ABNE { + r.As = ABEQ + } else { + r.As = ABNE + } + r.Pcond = p.Link + r.Link = p.Pcond + if !(r.Link.Mark&FOLL != 0) { + xfol(ctxt, r.Link, last) + } + if !(r.Pcond.Mark&FOLL != 0) { + fmt.Printf("cant happen 2\n") + } + return + } + } + + a = AB + q = ctxt.NewProg() + q.As = int16(a) + q.Lineno = p.Lineno + q.To.Type = obj.TYPE_BRANCH + q.To.Offset = p.Pc + q.Pcond = p + p = q + } + + p.Mark |= FOLL + (*last).Link = p + *last = p + if a == AB || a == obj.ARET || a == AERET { + return + } + if p.Pcond != nil { + if a != ABL && p.Link != nil { + q = obj.Brchain(ctxt, p.Link) + if a != obj.ATEXT && a != ABCASE { + if q != nil && (q.Mark&FOLL != 0) { + p.As = int16(relinv(a)) + p.Link = p.Pcond + p.Pcond = q + } + } + + xfol(ctxt, p.Link, last) + q = obj.Brchain(ctxt, p.Pcond) + if q == nil { + q = p.Pcond + } + if q.Mark&FOLL != 0 { + p.Pcond = q + return + } + + p = q + goto loop + } + } + + p = p.Link + goto loop +} + +func preprocess(ctxt *obj.Link, cursym *obj.LSym) { + ctxt.Cursym = cursym + + if cursym.Text == nil || cursym.Text.Link == nil { + return + } + + p := cursym.Text + textstksiz := p.To.Offset + aoffset := int32(textstksiz) + + cursym.Args = p.To.Val.(int32) + cursym.Locals = int32(textstksiz) + + /* + * find leaf subroutines + * strip NOPs + * expand RET + */ + ctxt.Bso.Flush() + q := (*obj.Prog)(nil) + var q1 *obj.Prog + for p := cursym.Text; p != nil; p = p.Link { + switch p.As { + case obj.ATEXT: + p.Mark |= LEAF + + case obj.ARET: + break + + case obj.ANOP: + q1 = p.Link + q.Link = q1 /* q is non-nop */ + q1.Mark |= p.Mark + continue + + case ABL, + obj.ADUFFZERO, + obj.ADUFFCOPY: + cursym.Text.Mark &^= LEAF + fallthrough + + case ACBNZ, + ACBZ, + ACBNZW, + ACBZW, + ATBZ, + ATBNZ, + ABCASE, + AB, + ABEQ, + ABNE, + ABCS, + ABHS, + ABCC, + ABLO, + ABMI, + ABPL, + ABVS, + ABVC, + ABHI, + ABLS, + ABGE, + ABLT, + ABGT, + ABLE, + AADR, /* strange */ + AADRP: + q1 = p.Pcond + + if q1 != nil { + for q1.As == obj.ANOP { + q1 = q1.Link + p.Pcond = q1 + } + } + + break + } + + q = p + } + + var o int + var q2 *obj.Prog + var retjmp *obj.LSym + for p := cursym.Text; p != nil; p = p.Link { + o = int(p.As) + switch o { + case obj.ATEXT: + cursym.Text = p + if textstksiz < 0 { + ctxt.Autosize = 0 + } else { + ctxt.Autosize = int32(textstksiz + 8) + } + if (cursym.Text.Mark&LEAF != 0) && ctxt.Autosize <= 8 { + ctxt.Autosize = 0 + } else if ctxt.Autosize&(16-1) != 0 { + // The frame includes an LR. + // If the frame size is 8, it's only an LR, + // so there's no potential for breaking references to + // local variables by growing the frame size, + // because there are no local variables. + // But otherwise, if there is a non-empty locals section, + // the author of the code is responsible for making sure + // that the frame size is 8 mod 16. + if ctxt.Autosize == 8 { + ctxt.Autosize += 8 + cursym.Locals += 8 + } else { + ctxt.Diag("%v: unaligned frame size %d - must be 8 mod 16 (or 0)", p, ctxt.Autosize-8) + } + } + p.To.Offset = int64(ctxt.Autosize) - 8 + if ctxt.Autosize == 0 && !(cursym.Text.Mark&LEAF != 0) { + if ctxt.Debugvlog != 0 { + fmt.Fprintf(ctxt.Bso, "save suppressed in: %s\n", cursym.Text.From.Sym.Name) + } + ctxt.Bso.Flush() + cursym.Text.Mark |= LEAF + } + + if !(p.From3.Offset&obj.NOSPLIT != 0) { + p = stacksplit(ctxt, p, ctxt.Autosize) // emit split check + } + + aoffset = ctxt.Autosize + if aoffset > 0xF0 { + aoffset = 0xF0 + } + if cursym.Text.Mark&LEAF != 0 { + cursym.Leaf = 1 + if ctxt.Autosize == 0 { + break + } + aoffset = 0 + } + + q = p + if ctxt.Autosize > aoffset { + q = ctxt.NewProg() + q.As = ASUB + q.Lineno = p.Lineno + q.From.Type = obj.TYPE_CONST + q.From.Offset = int64(ctxt.Autosize) - int64(aoffset) + q.To.Type = obj.TYPE_REG + q.To.Reg = REGSP + q.Spadj = int32(q.From.Offset) + q.Link = p.Link + p.Link = q + if cursym.Text.Mark&LEAF != 0 { + break + } + } + + q1 = ctxt.NewProg() + q1.As = AMOVD + q1.Lineno = p.Lineno + q1.From.Type = obj.TYPE_REG + q1.From.Reg = REGLINK + q1.To.Type = obj.TYPE_MEM + q1.Scond = C_XPRE + q1.To.Offset = int64(-aoffset) + q1.To.Reg = REGSP + q1.Link = q.Link + q1.Spadj = aoffset + q.Link = q1 + + if cursym.Text.From3.Offset&obj.WRAPPER != 0 { + // if(g->panic != nil && g->panic->argp == FP) g->panic->argp = bottom-of-frame + // + // MOV g_panic(g), R1 + // CMP ZR, R1 + // BEQ end + // MOV panic_argp(R1), R2 + // ADD $(autosize+8), RSP, R3 + // CMP R2, R3 + // BNE end + // ADD $8, RSP, R4 + // MOVD R4, panic_argp(R1) + // end: + // NOP + // + // The NOP is needed to give the jumps somewhere to land. + // It is a liblink NOP, not a ARM64 NOP: it encodes to 0 instruction bytes. + q = q1 + + q = obj.Appendp(ctxt, q) + q.As = AMOVD + q.From.Type = obj.TYPE_MEM + q.From.Reg = REGG + q.From.Offset = 4 * int64(ctxt.Arch.Ptrsize) // G.panic + q.To.Type = obj.TYPE_REG + q.To.Reg = REG_R1 + + q = obj.Appendp(ctxt, q) + q.As = ACMP + q.From.Type = obj.TYPE_REG + q.From.Reg = REGZERO + q.Reg = REG_R1 + + q = obj.Appendp(ctxt, q) + q.As = ABEQ + q.To.Type = obj.TYPE_BRANCH + q1 = q + + q = obj.Appendp(ctxt, q) + q.As = AMOVD + q.From.Type = obj.TYPE_MEM + q.From.Reg = REG_R1 + q.From.Offset = 0 // Panic.argp + q.To.Type = obj.TYPE_REG + q.To.Reg = REG_R2 + + q = obj.Appendp(ctxt, q) + q.As = AADD + q.From.Type = obj.TYPE_CONST + q.From.Offset = int64(ctxt.Autosize) + 8 + q.Reg = REGSP + q.To.Type = obj.TYPE_REG + q.To.Reg = REG_R3 + + q = obj.Appendp(ctxt, q) + q.As = ACMP + q.From.Type = obj.TYPE_REG + q.From.Reg = REG_R2 + q.Reg = REG_R3 + + q = obj.Appendp(ctxt, q) + q.As = ABNE + q.To.Type = obj.TYPE_BRANCH + q2 = q + + q = obj.Appendp(ctxt, q) + q.As = AADD + q.From.Type = obj.TYPE_CONST + q.From.Offset = 8 + q.Reg = REGSP + q.To.Type = obj.TYPE_REG + q.To.Reg = REG_R4 + + q = obj.Appendp(ctxt, q) + q.As = AMOVD + q.From.Type = obj.TYPE_REG + q.From.Reg = REG_R4 + q.To.Type = obj.TYPE_MEM + q.To.Reg = REG_R1 + q.To.Offset = 0 // Panic.argp + + q = obj.Appendp(ctxt, q) + + q.As = obj.ANOP + q1.Pcond = q + q2.Pcond = q + } + + case obj.ARET: + nocache(p) + if p.From.Type == obj.TYPE_CONST { + ctxt.Diag("using BECOME (%v) is not supported!", p) + break + } + + retjmp = p.To.Sym + p.To = obj.Addr{} + if cursym.Text.Mark&LEAF != 0 { + if ctxt.Autosize != 0 { + p.As = AADD + p.From.Type = obj.TYPE_CONST + p.From.Offset = int64(ctxt.Autosize) + p.To.Type = obj.TYPE_REG + p.To.Reg = REGSP + p.Spadj = -ctxt.Autosize + } + } else { + /* want write-back pre-indexed SP+autosize -> SP, loading REGLINK*/ + aoffset = ctxt.Autosize + + if aoffset > 0xF0 { + aoffset = 0xF0 + } + p.As = AMOVD + p.From.Type = obj.TYPE_MEM + p.Scond = C_XPOST + p.From.Offset = int64(aoffset) + p.From.Reg = REGSP + p.To.Type = obj.TYPE_REG + p.To.Reg = REGLINK + p.Spadj = -aoffset + if ctxt.Autosize > aoffset { + q = ctxt.NewProg() + q.As = AADD + q.From.Type = obj.TYPE_CONST + q.From.Offset = int64(ctxt.Autosize) - int64(aoffset) + q.To.Type = obj.TYPE_REG + q.To.Reg = REGSP + q.Link = p.Link + q.Spadj = int32(-q.From.Offset) + q.Lineno = p.Lineno + p.Link = q + p = q + } + } + + if p.As != obj.ARET { + q = ctxt.NewProg() + q.Lineno = p.Lineno + q.Link = p.Link + p.Link = q + p = q + } + + if retjmp != nil { // retjmp + p.As = AB + p.To.Type = obj.TYPE_BRANCH + p.To.Sym = retjmp + p.Spadj = +ctxt.Autosize + break + } + + p.As = obj.ARET + p.To.Type = obj.TYPE_MEM + p.To.Offset = 0 + p.To.Reg = REGLINK + p.Spadj = +ctxt.Autosize + + case AADD, ASUB: + if p.To.Type == obj.TYPE_REG && p.To.Reg == REGSP && p.From.Type == obj.TYPE_CONST { + if p.As == AADD { + p.Spadj = int32(-p.From.Offset) + } else { + p.Spadj = int32(+p.From.Offset) + } + } + break + } + } +} + +func nocache(p *obj.Prog) { + p.Optab = 0 + p.From.Class = 0 + p.To.Class = 0 +} + +var unaryDst = map[int]bool{ + AWORD: true, + ADWORD: true, + ABL: true, + AB: true, + ASVC: true, +} + +var Linkarm64 = obj.LinkArch{ + ByteOrder: binary.LittleEndian, + Name: "arm64", + Thechar: '7', + Preprocess: preprocess, + Assemble: span7, + Follow: follow, + Progedit: progedit, + UnaryDst: unaryDst, + Minlc: 4, + Ptrsize: 8, + Regsize: 8, +} diff --git a/src/cmd/internal/obj/data.go b/src/cmd/internal/obj/data.go new file mode 100644 index 0000000000000000000000000000000000000000..6e01e6e3709505079e0b636781b876e183b6d06a --- /dev/null +++ b/src/cmd/internal/obj/data.go @@ -0,0 +1,268 @@ +// Derived from Inferno utils/6l/obj.c and utils/6l/span.c +// http://code.google.com/p/inferno-os/source/browse/utils/6l/obj.c +// http://code.google.com/p/inferno-os/source/browse/utils/6l/span.c +// +// Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved. +// Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net) +// Portions Copyright © 1997-1999 Vita Nuova Limited +// Portions Copyright © 2000-2007 Vita Nuova Holdings Limited (www.vitanuova.com) +// Portions Copyright © 2004,2006 Bruce Ellis +// Portions Copyright © 2005-2007 C H Forsyth (forsyth@terzarima.net) +// Revisions Copyright © 2000-2007 Lucent Technologies Inc. and others +// Portions Copyright © 2009 The Go Authors. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +package obj + +import ( + "log" + "math" +) + +func mangle(file string) { + log.Fatalf("%s: mangled input file", file) +} + +func Symgrow(ctxt *Link, s *LSym, lsiz int64) { + siz := int(lsiz) + if int64(siz) != lsiz { + log.Fatalf("Symgrow size %d too long", lsiz) + } + if len(s.P) >= siz { + return + } + for cap(s.P) < siz { + s.P = append(s.P[:cap(s.P)], 0) + } + s.P = s.P[:siz] +} + +func savedata(ctxt *Link, s *LSym, p *Prog, pn string) { + off := int32(p.From.Offset) + siz := int32(p.From3.Offset) + if off < 0 || siz < 0 || off >= 1<<30 || siz >= 100 { + mangle(pn) + } + if ctxt.Enforce_data_order != 0 && off < int32(len(s.P)) { + ctxt.Diag("data out of order (already have %d)\n%v", len(s.P), p) + } + Symgrow(ctxt, s, int64(off+siz)) + + switch int(p.To.Type) { + default: + ctxt.Diag("bad data: %v", p) + + case TYPE_FCONST: + switch siz { + default: + ctxt.Diag("unexpected %d-byte floating point constant", siz) + + case 4: + flt := math.Float32bits(float32(p.To.Val.(float64))) + ctxt.Arch.ByteOrder.PutUint32(s.P[off:], flt) + + case 8: + flt := math.Float64bits(p.To.Val.(float64)) + ctxt.Arch.ByteOrder.PutUint64(s.P[off:], flt) + } + + case TYPE_SCONST: + copy(s.P[off:off+siz], p.To.Val.(string)) + + case TYPE_CONST, TYPE_ADDR: + if p.To.Sym != nil || int(p.To.Type) == TYPE_ADDR { + r := Addrel(s) + r.Off = off + r.Siz = uint8(siz) + r.Sym = p.To.Sym + r.Type = R_ADDR + r.Add = p.To.Offset + break + } + o := p.To.Offset + switch siz { + default: + ctxt.Diag("unexpected %d-byte integer constant", siz) + case 1: + s.P[off] = byte(o) + case 2: + ctxt.Arch.ByteOrder.PutUint16(s.P[off:], uint16(o)) + case 4: + ctxt.Arch.ByteOrder.PutUint32(s.P[off:], uint32(o)) + case 8: + ctxt.Arch.ByteOrder.PutUint64(s.P[off:], uint64(o)) + } + } +} + +func Addrel(s *LSym) *Reloc { + s.R = append(s.R, Reloc{}) + return &s.R[len(s.R)-1] +} + +func Setuintxx(ctxt *Link, s *LSym, off int64, v uint64, wid int64) int64 { + if s.Type == 0 { + s.Type = SDATA + } + if s.Size < off+wid { + s.Size = off + wid + Symgrow(ctxt, s, s.Size) + } + + switch wid { + case 1: + s.P[off] = uint8(v) + case 2: + ctxt.Arch.ByteOrder.PutUint16(s.P[off:], uint16(v)) + case 4: + ctxt.Arch.ByteOrder.PutUint32(s.P[off:], uint32(v)) + case 8: + ctxt.Arch.ByteOrder.PutUint64(s.P[off:], uint64(v)) + } + + return off + wid +} + +func adduintxx(ctxt *Link, s *LSym, v uint64, wid int) int64 { + off := s.Size + Setuintxx(ctxt, s, off, v, int64(wid)) + return off +} + +func adduint8(ctxt *Link, s *LSym, v uint8) int64 { + return adduintxx(ctxt, s, uint64(v), 1) +} + +func adduint16(ctxt *Link, s *LSym, v uint16) int64 { + return adduintxx(ctxt, s, uint64(v), 2) +} + +func Adduint32(ctxt *Link, s *LSym, v uint32) int64 { + return adduintxx(ctxt, s, uint64(v), 4) +} + +func Adduint64(ctxt *Link, s *LSym, v uint64) int64 { + return adduintxx(ctxt, s, v, 8) +} + +func setuint8(ctxt *Link, s *LSym, r int64, v uint8) int64 { + return Setuintxx(ctxt, s, r, uint64(v), 1) +} + +func setuint16(ctxt *Link, s *LSym, r int64, v uint16) int64 { + return Setuintxx(ctxt, s, r, uint64(v), 2) +} + +func setuint32(ctxt *Link, s *LSym, r int64, v uint32) int64 { + return Setuintxx(ctxt, s, r, uint64(v), 4) +} + +func setuint64(ctxt *Link, s *LSym, r int64, v uint64) int64 { + return Setuintxx(ctxt, s, r, v, 8) +} + +func addaddrplus(ctxt *Link, s *LSym, t *LSym, add int64) int64 { + if s.Type == 0 { + s.Type = SDATA + } + i := s.Size + s.Size += int64(ctxt.Arch.Ptrsize) + Symgrow(ctxt, s, s.Size) + r := Addrel(s) + r.Sym = t + r.Off = int32(i) + r.Siz = uint8(ctxt.Arch.Ptrsize) + r.Type = R_ADDR + r.Add = add + return i + int64(r.Siz) +} + +func addpcrelplus(ctxt *Link, s *LSym, t *LSym, add int64) int64 { + if s.Type == 0 { + s.Type = SDATA + } + i := s.Size + s.Size += 4 + Symgrow(ctxt, s, s.Size) + r := Addrel(s) + r.Sym = t + r.Off = int32(i) + r.Add = add + r.Type = R_PCREL + r.Siz = 4 + return i + int64(r.Siz) +} + +func addaddr(ctxt *Link, s *LSym, t *LSym) int64 { + return addaddrplus(ctxt, s, t, 0) +} + +func setaddrplus(ctxt *Link, s *LSym, off int64, t *LSym, add int64) int64 { + if s.Type == 0 { + s.Type = SDATA + } + if off+int64(ctxt.Arch.Ptrsize) > s.Size { + s.Size = off + int64(ctxt.Arch.Ptrsize) + Symgrow(ctxt, s, s.Size) + } + + r := Addrel(s) + r.Sym = t + r.Off = int32(off) + r.Siz = uint8(ctxt.Arch.Ptrsize) + r.Type = R_ADDR + r.Add = add + return off + int64(r.Siz) +} + +func setaddr(ctxt *Link, s *LSym, off int64, t *LSym) int64 { + return setaddrplus(ctxt, s, off, t, 0) +} + +func addsize(ctxt *Link, s *LSym, t *LSym) int64 { + if s.Type == 0 { + s.Type = SDATA + } + i := s.Size + s.Size += int64(ctxt.Arch.Ptrsize) + Symgrow(ctxt, s, s.Size) + r := Addrel(s) + r.Sym = t + r.Off = int32(i) + r.Siz = uint8(ctxt.Arch.Ptrsize) + r.Type = R_SIZE + return i + int64(r.Siz) +} + +func addaddrplus4(ctxt *Link, s *LSym, t *LSym, add int64) int64 { + if s.Type == 0 { + s.Type = SDATA + } + i := s.Size + s.Size += 4 + Symgrow(ctxt, s, s.Size) + r := Addrel(s) + r.Sym = t + r.Off = int32(i) + r.Siz = 4 + r.Type = R_ADDR + r.Add = add + return i + int64(r.Siz) +} diff --git a/src/cmd/internal/obj/flag.go b/src/cmd/internal/obj/flag.go new file mode 100644 index 0000000000000000000000000000000000000000..0664f5cf8ed3338c69c2e1c864dddb45930e6006 --- /dev/null +++ b/src/cmd/internal/obj/flag.go @@ -0,0 +1,120 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package obj + +import ( + "flag" + "fmt" + "os" + "strconv" +) + +func Flagfn2(string, string, func(string, string)) { panic("flag") } + +func Flagcount(name, usage string, val *int) { + flag.Var((*count)(val), name, usage) +} + +func Flagint32(name, usage string, val *int32) { + flag.Var((*int32Value)(val), name, usage) +} + +func Flagint64(name, usage string, val *int64) { + flag.Int64Var(val, name, *val, usage) +} + +func Flagstr(name, usage string, val *string) { + flag.StringVar(val, name, *val, usage) +} + +func Flagfn0(name, usage string, f func()) { + flag.Var(fn0(f), name, usage) +} + +func Flagfn1(name, usage string, f func(string)) { + flag.Var(fn1(f), name, usage) +} + +func Flagprint(fd int) { + if fd == 1 { + flag.CommandLine.SetOutput(os.Stdout) + } + flag.PrintDefaults() +} + +func Flagparse(usage func()) { + flag.Usage = usage + flag.Parse() +} + +// count is a flag.Value that is like a flag.Bool and a flag.Int. +// If used as -name, it increments the count, but -name=x sets the count. +// Used for verbose flag -v. +type count int + +func (c *count) String() string { + return fmt.Sprint(int(*c)) +} + +func (c *count) Set(s string) error { + switch s { + case "true": + *c++ + case "false": + *c = 0 + default: + n, err := strconv.Atoi(s) + if err != nil { + return fmt.Errorf("invalid count %q", s) + } + *c = count(n) + } + return nil +} + +func (c *count) IsBoolFlag() bool { + return true +} + +type int32Value int32 + +func newIntValue(val int32, p *int32) *int32Value { + *p = val + return (*int32Value)(p) +} + +func (i *int32Value) Set(s string) error { + v, err := strconv.ParseInt(s, 0, 64) + *i = int32Value(v) + return err +} + +func (i *int32Value) Get() interface{} { return int32(*i) } + +func (i *int32Value) String() string { return fmt.Sprint(*i) } + +type fn0 func() + +func (f fn0) Set(s string) error { + f() + return nil +} + +func (f fn0) Get() interface{} { return nil } + +func (f fn0) String() string { return "" } + +func (f fn0) IsBoolFlag() bool { + return true +} + +type fn1 func(string) + +func (f fn1) Set(s string) error { + f(s) + return nil +} + +func (f fn1) String() string { return "" } diff --git a/src/cmd/internal/obj/fmt.go b/src/cmd/internal/obj/fmt.go new file mode 100644 index 0000000000000000000000000000000000000000..1268f426a5aeac19ed1c69c350be1916599b14e0 --- /dev/null +++ b/src/cmd/internal/obj/fmt.go @@ -0,0 +1,34 @@ +/* + * The authors of this software are Rob Pike and Ken Thompson. + * Copyright (c) 2002 by Lucent Technologies. + * Permission to use, copy, modify, and distribute this software for any + * purpose without fee is hereby granted, provided that this entire notice + * is included in all copies of any software which is or includes a copy + * or modification of this software and in all copies of the supporting + * documentation for such software. + * THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED + * WARRANTY. IN PARTICULAR, NEITHER THE AUTHORS NOR LUCENT TECHNOLOGIES MAKE ANY + * REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY + * OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. + */ + +package obj + +const ( + FmtWidth = 1 << iota + FmtLeft + FmtPrec + FmtSharp + FmtSpace + FmtSign + FmtApost + FmtZero + FmtUnsigned + FmtShort + FmtLong + FmtVLong + FmtComma + FmtByte + FmtLDouble + FmtFlag +) diff --git a/src/cmd/internal/obj/funcdata.go b/src/cmd/internal/obj/funcdata.go new file mode 100644 index 0000000000000000000000000000000000000000..44cba7aae894e4e95526711f02e4b7ced3dbc259 --- /dev/null +++ b/src/cmd/internal/obj/funcdata.go @@ -0,0 +1,79 @@ +// Inferno utils/5c/list.c +// http://code.google.com/p/inferno-os/source/browse/utils/5c/list.c +// +// Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved. +// Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net) +// Portions Copyright © 1997-1999 Vita Nuova Limited +// Portions Copyright © 2000-2007 Vita Nuova Holdings Limited (www.vitanuova.com) +// Portions Copyright © 2004,2006 Bruce Ellis +// Portions Copyright © 2005-2007 C H Forsyth (forsyth@terzarima.net) +// Revisions Copyright © 2000-2007 Lucent Technologies Inc. and others +// Portions Copyright © 2009 The Go Authors. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +package obj + +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// This file defines the IDs for PCDATA and FUNCDATA instructions +// in Go binaries. It is included by assembly sources, so it must +// be written using #defines. +// +// The Go compiler also #includes this file, for now. +// +// symtab.go also contains a copy of these constants. + +// Pseudo-assembly statements. + +// GO_ARGS, GO_RESULTS_INITIALIZED, and NO_LOCAL_POINTERS are macros +// that communicate to the runtime information about the location and liveness +// of pointers in an assembly function's arguments, results, and stack frame. +// This communication is only required in assembly functions that make calls +// to other functions that might be preempted or grow the stack. +// NOSPLIT functions that make no calls do not need to use these macros. + +// GO_ARGS indicates that the Go prototype for this assembly function +// defines the pointer map for the function's arguments. +// GO_ARGS should be the first instruction in a function that uses it. +// It can be omitted if there are no arguments at all. +// GO_ARGS is inserted implicitly by the linker for any function +// that also has a Go prototype and therefore is usually not necessary +// to write explicitly. + +// GO_RESULTS_INITIALIZED indicates that the assembly function +// has initialized the stack space for its results and that those results +// should be considered live for the remainder of the function. + +// NO_LOCAL_POINTERS indicates that the assembly function stores +// no pointers to heap objects in its local stack variables. + +// ArgsSizeUnknown is set in Func.argsize to mark all functions +// whose argument size is unknown (C vararg functions, and +// assembly code without an explicit specification). +// This value is generated by the compiler, assembler, or linker. +const ( + PCDATA_StackMapIndex = 0 + FUNCDATA_ArgsPointerMaps = 0 + FUNCDATA_LocalsPointerMaps = 1 + FUNCDATA_DeadValueMaps = 2 + ArgsSizeUnknown = -0x80000000 +) diff --git a/src/cmd/internal/obj/go.go b/src/cmd/internal/obj/go.go new file mode 100644 index 0000000000000000000000000000000000000000..3e6cd2163624255e58ffaa47c67a674514dfcc30 --- /dev/null +++ b/src/cmd/internal/obj/go.go @@ -0,0 +1,83 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package obj + +import ( + "fmt" + "os" + "strings" +) + +// go-specific code shared across loaders (5l, 6l, 8l). + +var ( + Framepointer_enabled int + Fieldtrack_enabled int +) + +// Toolchain experiments. +// These are controlled by the GOEXPERIMENT environment +// variable recorded when the toolchain is built. +// This list is also known to cmd/gc. +var exper = []struct { + name string + val *int +}{ + {"fieldtrack", &Fieldtrack_enabled}, + {"framepointer", &Framepointer_enabled}, +} + +func addexp(s string) { + for i := 0; i < len(exper); i++ { + if exper[i].name == s { + if exper[i].val != nil { + *exper[i].val = 1 + } + return + } + } + + fmt.Printf("unknown experiment %s\n", s) + os.Exit(2) +} + +func init() { + for _, f := range strings.Split(goexperiment, ",") { + if f != "" { + addexp(f) + } + } +} + +func Nopout(p *Prog) { + p.As = ANOP + p.Scond = 0 + p.From = Addr{} + p.From3 = nil + p.Reg = 0 + p.To = Addr{} +} + +func Nocache(p *Prog) { + p.Optab = 0 + p.From.Class = 0 + if p.From3 != nil { + p.From3.Class = 0 + } + p.To.Class = 0 +} + +func Expstring() string { + buf := "X" + for i := range exper { + if *exper[i].val != 0 { + buf += "," + exper[i].name + } + } + if buf == "X" { + buf += ",none" + } + return "X:" + buf[2:] +} diff --git a/src/cmd/internal/obj/ld.go b/src/cmd/internal/obj/ld.go new file mode 100644 index 0000000000000000000000000000000000000000..4d2e4293aadd2a1323098cc5acca1b0052fa0dff --- /dev/null +++ b/src/cmd/internal/obj/ld.go @@ -0,0 +1,92 @@ +// Derived from Inferno utils/6l/obj.c and utils/6l/span.c +// http://code.google.com/p/inferno-os/source/browse/utils/6l/obj.c +// http://code.google.com/p/inferno-os/source/browse/utils/6l/span.c +// +// Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved. +// Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net) +// Portions Copyright © 1997-1999 Vita Nuova Limited +// Portions Copyright © 2000-2007 Vita Nuova Holdings Limited (www.vitanuova.com) +// Portions Copyright © 2004,2006 Bruce Ellis +// Portions Copyright © 2005-2007 C H Forsyth (forsyth@terzarima.net) +// Revisions Copyright © 2000-2007 Lucent Technologies Inc. and others +// Portions Copyright © 2009 The Go Authors. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +package obj + +/* + * add library to library list. + * srcref: src file referring to package + * objref: object file referring to package + * file: object file, e.g., /home/rsc/go/pkg/container/vector.a + * pkg: package import path, e.g. container/vector + */ + +const ( + LOG = 5 +) + +func mkfwd(sym *LSym) { + var dwn [LOG]int32 + var cnt [LOG]int32 + var lst [LOG]*Prog + + for i := 0; i < LOG; i++ { + if i == 0 { + cnt[i] = 1 + } else { + cnt[i] = LOG * cnt[i-1] + } + dwn[i] = 1 + lst[i] = nil + } + + i := 0 + for p := sym.Text; p != nil && p.Link != nil; p = p.Link { + i-- + if i < 0 { + i = LOG - 1 + } + p.Forwd = nil + dwn[i]-- + if dwn[i] <= 0 { + dwn[i] = cnt[i] + if lst[i] != nil { + lst[i].Forwd = p + } + lst[i] = p + } + } +} + +func Copyp(ctxt *Link, q *Prog) *Prog { + p := ctxt.NewProg() + *p = *q + return p +} + +func Appendp(ctxt *Link, q *Prog) *Prog { + p := ctxt.NewProg() + p.Link = q.Link + q.Link = p + p.Lineno = q.Lineno + p.Mode = q.Mode + return p +} diff --git a/src/cmd/internal/obj/libc.go b/src/cmd/internal/obj/libc.go new file mode 100644 index 0000000000000000000000000000000000000000..b200b2604700449230c9af080f9e4905aa8ce734 --- /dev/null +++ b/src/cmd/internal/obj/libc.go @@ -0,0 +1,12 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package obj + +const ( + AEXIST = 0 + BOM = 0xFEFF +) + +var GOEXPERIMENT string diff --git a/src/cmd/internal/obj/line_test.go b/src/cmd/internal/obj/line_test.go new file mode 100644 index 0000000000000000000000000000000000000000..5486f0d6485e848136c7c6b1c67da638ecb3abc8 --- /dev/null +++ b/src/cmd/internal/obj/line_test.go @@ -0,0 +1,51 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package obj + +import ( + "fmt" + "testing" +) + +func TestLineHist(t *testing.T) { + ctxt := new(Link) + ctxt.Hash = make(map[SymVer]*LSym) + + ctxt.LineHist.Push(1, "a.c") + ctxt.LineHist.Push(3, "a.h") + ctxt.LineHist.Pop(5) + ctxt.LineHist.Update(7, "linedir", 2) + ctxt.LineHist.Pop(9) + ctxt.LineHist.Push(11, "b.c") + ctxt.LineHist.Pop(13) + + var expect = []string{ + 0: "??:0", + 1: "a.c:1", + 2: "a.c:2", + 3: "a.h:1", + 4: "a.h:2", + 5: "a.c:3", + 6: "a.c:4", + 7: "linedir:2", + 8: "linedir:3", + 9: "??:0", + 10: "??:0", + 11: "b.c:1", + 12: "b.c:2", + 13: "??:0", + 14: "??:0", + } + + for i, want := range expect { + var f *LSym + var l int32 + linkgetline(ctxt, int32(i), &f, &l) + have := fmt.Sprintf("%s:%d", f.Name, l) + if have != want { + t.Errorf("linkgetline(%d) = %q, want %q", i, have, want) + } + } +} diff --git a/src/cmd/internal/obj/link.go b/src/cmd/internal/obj/link.go new file mode 100644 index 0000000000000000000000000000000000000000..688c2785d13e0422802fc23f44c1da74ce708a16 --- /dev/null +++ b/src/cmd/internal/obj/link.go @@ -0,0 +1,569 @@ +// Derived from Inferno utils/6l/l.h and related files. +// http://code.google.com/p/inferno-os/source/browse/utils/6l/l.h +// +// Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved. +// Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net) +// Portions Copyright © 1997-1999 Vita Nuova Limited +// Portions Copyright © 2000-2007 Vita Nuova Holdings Limited (www.vitanuova.com) +// Portions Copyright © 2004,2006 Bruce Ellis +// Portions Copyright © 2005-2007 C H Forsyth (forsyth@terzarima.net) +// Revisions Copyright © 2000-2007 Lucent Technologies Inc. and others +// Portions Copyright © 2009 The Go Authors. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +package obj + +import "encoding/binary" + +// An Addr is an argument to an instruction. +// The general forms and their encodings are: +// +// sym±offset(symkind)(reg)(index*scale) +// Memory reference at address &sym(symkind) + offset + reg + index*scale. +// Any of sym(symkind), ±offset, (reg), (index*scale), and *scale can be omitted. +// If (reg) and *scale are both omitted, the resulting expression (index) is parsed as (reg). +// To force a parsing as index*scale, write (index*1). +// Encoding: +// type = TYPE_MEM +// name = symkind (NAME_AUTO, ...) or 0 (NAME_NONE) +// sym = sym +// offset = ±offset +// reg = reg (REG_*) +// index = index (REG_*) +// scale = scale (1, 2, 4, 8) +// +// $ +// Effective address of memory reference , defined above. +// Encoding: same as memory reference, but type = TYPE_ADDR. +// +// $<±integer value> +// This is a special case of $, in which only ±offset is present. +// It has a separate type for easy recognition. +// Encoding: +// type = TYPE_CONST +// offset = ±integer value +// +// * +// Indirect reference through memory reference , defined above. +// Only used on x86 for CALL/JMP *sym(SB), which calls/jumps to a function +// pointer stored in the data word sym(SB), not a function named sym(SB). +// Encoding: same as above, but type = TYPE_INDIR. +// +// $*$ +// No longer used. +// On machines with actual SB registers, $*$ forced the +// instruction encoding to use a full 32-bit constant, never a +// reference relative to SB. +// +// $ +// Floating point constant value. +// Encoding: +// type = TYPE_FCONST +// val = floating point value +// +// $ +// String literal value (raw bytes used for DATA instruction). +// Encoding: +// type = TYPE_SCONST +// val = string +// +// +// Any register: integer, floating point, control, segment, and so on. +// If looking for specific register kind, must check type and reg value range. +// Encoding: +// type = TYPE_REG +// reg = reg (REG_*) +// +// x(PC) +// Encoding: +// type = TYPE_BRANCH +// val = Prog* reference OR ELSE offset = target pc (branch takes priority) +// +// $±x-±y +// Final argument to TEXT, specifying local frame size x and argument size y. +// In this form, x and y are integer literals only, not arbitrary expressions. +// This avoids parsing ambiguities due to the use of - as a separator. +// The ± are optional. +// If the final argument to TEXT omits the -±y, the encoding should still +// use TYPE_TEXTSIZE (not TYPE_CONST), with u.argsize = ArgsSizeUnknown. +// Encoding: +// type = TYPE_TEXTSIZE +// offset = x +// val = int32(y) +// +// reg<>shift, reg->shift, reg@>shift +// Shifted register value, for ARM. +// In this form, reg must be a register and shift can be a register or an integer constant. +// Encoding: +// type = TYPE_SHIFT +// offset = (reg&15) | shifttype<<5 | count +// shifttype = 0, 1, 2, 3 for <<, >>, ->, @> +// count = (reg&15)<<8 | 1<<4 for a register shift count, (n&31)<<7 for an integer constant. +// +// (reg, reg) +// A destination register pair. When used as the last argument of an instruction, +// this form makes clear that both registers are destinations. +// Encoding: +// type = TYPE_REGREG +// reg = first register +// offset = second register +// +// [reg, reg, reg-reg] +// Register list for ARM. +// Encoding: +// type = TYPE_REGLIST +// offset = bit mask of registers in list; R0 is low bit. +// +// reg, reg +// Register pair for ARM. +// TYPE_REGREG2 +// +// (reg+reg) +// Register pair for PPC64. +// Encoding: +// type = TYPE_MEM +// reg = first register +// index = second register +// scale = 1 +// +type Addr struct { + Type int16 + Reg int16 + Index int16 + Scale int16 // Sometimes holds a register. + Name int8 + Class int8 + Etype uint8 + Offset int64 + Width int64 + Sym *LSym + Gotype *LSym + + // argument value: + // for TYPE_SCONST, a string + // for TYPE_FCONST, a float64 + // for TYPE_BRANCH, a *Prog (optional) + // for TYPE_TEXTSIZE, an int32 (optional) + Val interface{} + + Node interface{} // for use by compiler +} + +const ( + NAME_NONE = 0 + iota + NAME_EXTERN + NAME_STATIC + NAME_AUTO + NAME_PARAM + // A reference to name@GOT(SB) is a reference to the entry in the global offset + // table for 'name'. + NAME_GOTREF +) + +const ( + TYPE_NONE = 0 +) + +const ( + TYPE_BRANCH = 5 + iota + TYPE_TEXTSIZE + TYPE_MEM + TYPE_CONST + TYPE_FCONST + TYPE_SCONST + TYPE_REG + TYPE_ADDR + TYPE_SHIFT + TYPE_REGREG + TYPE_REGREG2 + TYPE_INDIR + TYPE_REGLIST +) + +// TODO(rsc): Describe prog. +// TODO(rsc): Describe TEXT/GLOBL flag in from3, DATA width in from3. +type Prog struct { + Ctxt *Link + Link *Prog + From Addr + From3 *Addr // optional + To Addr + Opt interface{} + Forwd *Prog + Pcond *Prog + Rel *Prog // Source of forward jumps on x86; pcrel on arm + Pc int64 + Lineno int32 + Spadj int32 + As int16 + Reg int16 + RegTo2 int16 // 2nd register output operand + Mark uint16 + Optab uint16 + Scond uint8 + Back uint8 + Ft uint8 + Tt uint8 + Isize uint8 + Mode int8 + + Info ProgInfo +} + +// From3Type returns From3.Type, or TYPE_NONE when From3 is nil. +func (p *Prog) From3Type() int16 { + if p.From3 == nil { + return TYPE_NONE + } + return p.From3.Type +} + +// From3Offset returns From3.Offset, or 0 when From3 is nil. +func (p *Prog) From3Offset() int64 { + if p.From3 == nil { + return 0 + } + return p.From3.Offset +} + +// ProgInfo holds information about the instruction for use +// by clients such as the compiler. The exact meaning of this +// data is up to the client and is not interpreted by the cmd/internal/obj/... packages. +type ProgInfo struct { + Flags uint32 // flag bits + Reguse uint64 // registers implicitly used by this instruction + Regset uint64 // registers implicitly set by this instruction + Regindex uint64 // registers used by addressing mode +} + +// Prog.as opcodes. +// These are the portable opcodes, common to all architectures. +// Each architecture defines many more arch-specific opcodes, +// with values starting at A_ARCHSPECIFIC. +// Each architecture adds an offset to this so each machine has +// distinct space for its instructions. The offset is a power of +// two so it can be masked to return to origin zero. +// See the definitions of ABase386 etc. +const ( + AXXX = 0 + iota + ACALL + ACHECKNIL + ADATA + ADUFFCOPY + ADUFFZERO + AEND + AFUNCDATA + AGLOBL + AJMP + ANOP + APCDATA + ARET + ATEXT + ATYPE + AUNDEF + AUSEFIELD + AVARDEF + AVARKILL + A_ARCHSPECIFIC +) + +// An LSym is the sort of symbol that is written to an object file. +type LSym struct { + Name string + Type int16 + Version int16 + Dupok uint8 + Cfunc uint8 + Nosplit uint8 + Leaf uint8 + Seenglobl uint8 + Onlist uint8 + // Local means make the symbol local even when compiling Go code to reference Go + // symbols in other shared libraries, as in this mode symbols are global by + // default. "local" here means in the sense of the dynamic linker, i.e. not + // visible outside of the module (shared library or executable) that contains its + // definition. (When not compiling to support Go shared libraries, all symbols are + // local in this sense unless there is a cgo_export_* directive). + Local bool + Args int32 + Locals int32 + Value int64 + Size int64 + Next *LSym + Gotype *LSym + Autom *Auto + Text *Prog + Etext *Prog + Pcln *Pcln + P []byte + R []Reloc +} + +type Pcln struct { + Pcsp Pcdata + Pcfile Pcdata + Pcline Pcdata + Pcdata []Pcdata + Funcdata []*LSym + Funcdataoff []int64 + File []*LSym + Lastfile *LSym + Lastindex int +} + +// LSym.type +const ( + Sxxx = iota + STEXT + SELFRXSECT + STYPE + SSTRING + SGOSTRING + SGOFUNC + SGCBITS + SRODATA + SFUNCTAB + STYPELINK + SSYMTAB + SPCLNTAB + SELFROSECT + SMACHOPLT + SELFSECT + SMACHO + SMACHOGOT + SWINDOWS + SELFGOT + SNOPTRDATA + SINITARR + SDATA + SBSS + SNOPTRBSS + STLSBSS + SXREF + SMACHOSYMSTR + SMACHOSYMTAB + SMACHOINDIRECTPLT + SMACHOINDIRECTGOT + SFILE + SFILEPATH + SCONST + SDYNIMPORT + SHOSTOBJ + SSUB = 1 << 8 + SMASK = SSUB - 1 + SHIDDEN = 1 << 9 + SCONTAINER = 1 << 10 // has a sub-symbol +) + +type Reloc struct { + Off int32 + Siz uint8 + Type int32 + Add int64 + Sym *LSym +} + +// Reloc.type +const ( + R_ADDR = 1 + iota + R_ADDRPOWER + R_ADDRARM64 + R_SIZE + R_CALL + R_CALLARM + R_CALLARM64 + R_CALLIND + R_CALLPOWER + R_CONST + R_PCREL + // R_TLS (only used on arm currently, and not on android and darwin where tlsg is + // a regular variable) resolves to data needed to access the thread-local g. It is + // interpreted differently depending on toolchain flags to implement either the + // "local exec" or "inital exec" model for tls access. + // TODO(mwhudson): change to use R_TLS_LE or R_TLS_IE as appropriate, not having + // R_TLS do double duty. + R_TLS + // R_TLS_LE (only used on 386 and amd64 currently) resolves to the offset of the + // thread-local g from the thread local base and is used to implement the "local + // exec" model for tls access (r.Sym is not set by the compiler for this case but + // is set to Tlsg in the linker when externally linking). + R_TLS_LE + // R_TLS_IE (only used on 386 and amd64 currently) resolves to the PC-relative + // offset to a GOT slot containing the offset the thread-local g from the thread + // local base and is used to implemented the "initial exec" model for tls access + // (r.Sym is not set by the compiler for this case but is set to Tlsg in the + // linker when externally linking). + R_TLS_IE + R_GOTOFF + R_PLT0 + R_PLT1 + R_PLT2 + R_USEFIELD + R_POWER_TOC + R_GOTPCREL +) + +type Auto struct { + Asym *LSym + Link *Auto + Aoffset int32 + Name int16 + Gotype *LSym +} + +// Auto.name +const ( + A_AUTO = 1 + iota + A_PARAM +) + +type Pcdata struct { + P []byte +} + +// Pcdata iterator. +// for(pciterinit(ctxt, &it, &pcd); !it.done; pciternext(&it)) { it.value holds in [it.pc, it.nextpc) } +type Pciter struct { + d Pcdata + p []byte + pc uint32 + nextpc uint32 + pcscale uint32 + value int32 + start int + done int +} + +// symbol version, incremented each time a file is loaded. +// version==1 is reserved for savehist. +const ( + HistVersion = 1 +) + +// Link holds the context for writing object code from a compiler +// to be linker input or for reading that input into the linker. +type Link struct { + Goarm int32 + Headtype int + Arch *LinkArch + Debugasm int32 + Debugvlog int32 + Debugzerostack int32 + Debugdivmod int32 + Debugpcln int32 + Flag_shared int32 + Flag_dynlink bool + Bso *Biobuf + Pathname string + Windows int32 + Goroot string + Goroot_final string + Enforce_data_order int32 + Hash map[SymVer]*LSym + LineHist LineHist + Imports []string + Plist *Plist + Plast *Plist + Sym_div *LSym + Sym_divu *LSym + Sym_mod *LSym + Sym_modu *LSym + Tlsg *LSym + Plan9privates *LSym + Curp *Prog + Printp *Prog + Blitrl *Prog + Elitrl *Prog + Rexflag int + Rep int + Repn int + Lock int + Asmode int + Andptr []byte + And [100]uint8 + Instoffset int64 + Autosize int32 + Armsize int32 + Pc int64 + Tlsoffset int + Diag func(string, ...interface{}) + Mode int + Cursym *LSym + Version int + Textp *LSym + Etextp *LSym +} + +type SymVer struct { + Name string + Version int // TODO: make int16 to match LSym.Version? +} + +// LinkArch is the definition of a single architecture. +type LinkArch struct { + ByteOrder binary.ByteOrder + Name string + Thechar int + Preprocess func(*Link, *LSym) + Assemble func(*Link, *LSym) + Follow func(*Link, *LSym) + Progedit func(*Link, *Prog) + UnaryDst map[int]bool // Instruction takes one operand, a destination. + Minlc int + Ptrsize int + Regsize int +} + +/* executable header types */ +const ( + Hunknown = 0 + iota + Hdarwin + Hdragonfly + Helf + Hfreebsd + Hlinux + Hnacl + Hnetbsd + Hopenbsd + Hplan9 + Hsolaris + Hwindows +) + +type Plist struct { + Name *LSym + Firstpc *Prog + Recur int + Link *Plist +} + +/* + * start a new Prog list. + */ +func Linknewplist(ctxt *Link) *Plist { + pl := new(Plist) + if ctxt.Plist == nil { + ctxt.Plist = pl + } else { + ctxt.Plast.Link = pl + } + ctxt.Plast = pl + return pl +} diff --git a/src/cmd/internal/obj/mgc0.go b/src/cmd/internal/obj/mgc0.go new file mode 100644 index 0000000000000000000000000000000000000000..a385d607bb41baa7875e98313c71b686f7f58bb7 --- /dev/null +++ b/src/cmd/internal/obj/mgc0.go @@ -0,0 +1,30 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package obj + +// Garbage collector liveness bitmap generation. + +// The command line flag -live causes this code to print debug information. +// The levels are: +// +// -live (aka -live=1): print liveness lists as code warnings at safe points +// -live=2: print an assembly listing with liveness annotations +// -live=3: print information during each computation phase (much chattier) +// +// Each level includes the earlier output as well. + +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Used by cmd/gc. + +const ( + InsData = 1 + iota + InsArray + InsArrayEnd + InsEnd + MaxGCMask = 65536 +) diff --git a/src/cmd/internal/obj/obj.go b/src/cmd/internal/obj/obj.go new file mode 100644 index 0000000000000000000000000000000000000000..af3290d3a599d0c19c54d1d83d297ae0afcc89d2 --- /dev/null +++ b/src/cmd/internal/obj/obj.go @@ -0,0 +1,283 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package obj + +import ( + "fmt" + "path/filepath" + "sort" + "strings" +) + +// A LineHist records the history of the file input stack, which maps the virtual line number, +// an incrementing count of lines processed in any input file and typically named lineno, +// to a stack of file:line pairs showing the path of inclusions that led to that position. +// The first line directive (//line in Go, #line in assembly) is treated as pushing +// a new entry on the stack, so that errors can report both the actual and translated +// line number. +// +// In typical use, the virtual lineno begins at 1, and file line numbers also begin at 1, +// but the only requirements placed upon the numbers by this code are: +// - calls to Push, Update, and Pop must be monotonically increasing in lineno +// - except as specified by those methods, virtual and file line number increase +// together, so that given (only) calls Push(10, "x.go", 1) and Pop(15), +// virtual line 12 corresponds to x.go line 3. +type LineHist struct { + Top *LineStack // current top of stack + Ranges []LineRange // ranges for lookup + Dir string // directory to qualify relative paths + TrimPathPrefix string // remove leading TrimPath from recorded file names + GOROOT string // current GOROOT + GOROOT_FINAL string // target GOROOT +} + +// A LineStack is an entry in the recorded line history. +// Although the history at any given line number is a stack, +// the record for all line processed forms a tree, with common +// stack prefixes acting as parents. +type LineStack struct { + Parent *LineStack // parent in inclusion stack + Lineno int // virtual line number where this entry takes effect + File string // file name used to open source file, for error messages + AbsFile string // absolute file name, for pcln tables + FileLine int // line number in file at Lineno + Directive bool + Sym *LSym // for linkgetline - TODO(rsc): remove +} + +func (stk *LineStack) fileLineAt(lineno int) int { + return stk.FileLine + lineno - stk.Lineno +} + +// The span of valid linenos in the recorded line history can be broken +// into a set of ranges, each with a particular stack. +// A LineRange records one such range. +type LineRange struct { + Start int // starting lineno + Stack *LineStack // top of stack for this range +} + +// startRange starts a new range with the given top of stack. +func (h *LineHist) startRange(lineno int, top *LineStack) { + h.Top = top + h.Ranges = append(h.Ranges, LineRange{top.Lineno, top}) +} + +// setFile sets stk.File = file and also derives stk.AbsFile. +func (h *LineHist) setFile(stk *LineStack, file string) { + // Note: The exclusion of stk.Directive may be wrong but matches what we've done before. + // The check for < avoids putting a path prefix on "". + abs := file + if h.Dir != "" && !filepath.IsAbs(file) && !strings.HasPrefix(file, "<") && !stk.Directive { + abs = filepath.Join(h.Dir, file) + } + + // Remove leading TrimPathPrefix, or else rewrite $GOROOT to $GOROOT_FINAL. + if h.TrimPathPrefix != "" && hasPathPrefix(abs, h.TrimPathPrefix) { + if abs == h.TrimPathPrefix { + abs = "" + } else { + abs = abs[len(h.TrimPathPrefix)+1:] + } + } else if h.GOROOT_FINAL != "" && h.GOROOT_FINAL != h.GOROOT && hasPathPrefix(abs, h.GOROOT) { + abs = h.GOROOT_FINAL + abs[len(h.GOROOT):] + } + if abs == "" { + abs = "??" + } + abs = filepath.Clean(abs) + stk.AbsFile = abs + + if file == "" { + file = "??" + } + stk.File = file +} + +// Does s have t as a path prefix? +// That is, does s == t or does s begin with t followed by a slash? +// For portability, we allow ASCII case folding, so that hasPathPrefix("a/b/c", "A/B") is true. +// Similarly, we allow slash folding, so that hasPathPrefix("a/b/c", "a\\b") is true. +// We do not allow full Unicode case folding, for fear of causing more confusion +// or harm than good. (For an example of the kinds of things that can go wrong, +// see http://article.gmane.org/gmane.linux.kernel/1853266.) +func hasPathPrefix(s string, t string) bool { + if len(t) > len(s) { + return false + } + var i int + for i = 0; i < len(t); i++ { + cs := int(s[i]) + ct := int(t[i]) + if 'A' <= cs && cs <= 'Z' { + cs += 'a' - 'A' + } + if 'A' <= ct && ct <= 'Z' { + ct += 'a' - 'A' + } + if cs == '\\' { + cs = '/' + } + if ct == '\\' { + ct = '/' + } + if cs != ct { + return false + } + } + return i >= len(s) || s[i] == '/' || s[i] == '\\' +} + +// Push records that at that lineno a new file with the given name was pushed onto the input stack. +func (h *LineHist) Push(lineno int, file string) { + stk := &LineStack{ + Parent: h.Top, + Lineno: lineno, + FileLine: 1, + } + h.setFile(stk, file) + h.startRange(lineno, stk) +} + +// Pop records that at lineno the current file was popped from the input stack. +func (h *LineHist) Pop(lineno int) { + top := h.Top + if top == nil { + return + } + if top.Directive && top.Parent != nil { // pop #line level too + top = top.Parent + } + next := top.Parent + if next == nil { + h.Top = nil + h.Ranges = append(h.Ranges, LineRange{lineno, nil}) + return + } + + // Popping included file. Update parent offset to account for + // the virtual line number range taken by the included file. + // Cannot modify the LineStack directly, or else lookups + // for the earlier line numbers will get the wrong answers, + // so make a new one. + stk := new(LineStack) + *stk = *next + stk.Lineno = lineno + stk.FileLine = next.fileLineAt(top.Lineno) + h.startRange(lineno, stk) +} + +// Update records that at lineno the file name and line number were changed using +// a line directive (//line in Go, #line in assembly). +func (h *LineHist) Update(lineno int, file string, line int) { + top := h.Top + if top == nil { + return // shouldn't happen + } + var stk *LineStack + if top.Directive { + // Update existing entry, except make copy to avoid changing earlier history. + stk = new(LineStack) + *stk = *top + } else { + // Push new entry. + stk = &LineStack{ + Parent: top, + Directive: true, + } + } + stk.Lineno = lineno + if stk.File != file { + h.setFile(stk, file) // only retain string if needed + } + stk.FileLine = line + h.startRange(lineno, stk) +} + +// AddImport adds a package to the list of imported packages. +func (ctxt *Link) AddImport(pkg string) { + ctxt.Imports = append(ctxt.Imports, pkg) +} + +// At returns the input stack in effect at lineno. +func (h *LineHist) At(lineno int) *LineStack { + i := sort.Search(len(h.Ranges), func(i int) bool { + return h.Ranges[i].Start > lineno + }) + // Found first entry beyond lineno. + if i == 0 { + return nil + } + return h.Ranges[i-1].Stack +} + +// LineString returns a string giving the file and line number +// corresponding to lineno, for use in error messages. +func (h *LineHist) LineString(lineno int) string { + stk := h.At(lineno) + if stk == nil { + return "" + } + + text := fmt.Sprintf("%s:%d", stk.File, stk.fileLineAt(lineno)) + if stk.Directive && stk.Parent != nil { + stk = stk.Parent + text += fmt.Sprintf("[%s:%d]", stk.File, stk.fileLineAt(lineno)) + } + const showFullStack = false // was used by old C compilers + if showFullStack { + for stk.Parent != nil { + lineno = stk.Lineno - 1 + stk = stk.Parent + text += fmt.Sprintf(" %s:%d", stk.File, stk.fileLineAt(lineno)) + if stk.Directive && stk.Parent != nil { + stk = stk.Parent + text += fmt.Sprintf("[%s:%d]", stk.File, stk.fileLineAt(lineno)) + } + } + } + return text +} + +// FileLine returns the file name and line number +// at the top of the stack for the given lineno. +func (h *LineHist) FileLine(lineno int) (file string, line int) { + stk := h.At(lineno) + if stk == nil { + return "??", 0 + } + return stk.File, stk.fileLineAt(lineno) +} + +// AbsFileLine returns the absolute file name and line number +// at the top of the stack for the given lineno. +func (h *LineHist) AbsFileLine(lineno int) (file string, line int) { + stk := h.At(lineno) + if stk == nil { + return "??", 0 + } + return stk.AbsFile, stk.fileLineAt(lineno) +} + +// This is a simplified copy of linklinefmt above. +// It doesn't allow printing the full stack, and it returns the file name and line number separately. +// TODO: Unify with linklinefmt somehow. +func linkgetline(ctxt *Link, lineno int32, f **LSym, l *int32) { + stk := ctxt.LineHist.At(int(lineno)) + if stk == nil || stk.AbsFile == "" { + *f = Linklookup(ctxt, "??", HistVersion) + *l = 0 + return + } + if stk.Sym == nil { + stk.Sym = Linklookup(ctxt, stk.AbsFile, HistVersion) + } + *f = stk.Sym + *l = int32(stk.fileLineAt(int(lineno))) +} + +func Linkprfile(ctxt *Link, line int) { + fmt.Printf("%s ", ctxt.LineHist.LineString(line)) +} diff --git a/src/cmd/internal/obj/objfile.go b/src/cmd/internal/obj/objfile.go new file mode 100644 index 0000000000000000000000000000000000000000..c5f48203628f4c3f49bc40ed5418391b81845019 --- /dev/null +++ b/src/cmd/internal/obj/objfile.go @@ -0,0 +1,523 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Writing of Go object files. +// +// Originally, Go object files were Plan 9 object files, but no longer. +// Now they are more like standard object files, in that each symbol is defined +// by an associated memory image (bytes) and a list of relocations to apply +// during linking. We do not (yet?) use a standard file format, however. +// For now, the format is chosen to be as simple as possible to read and write. +// It may change for reasons of efficiency, or we may even switch to a +// standard file format if there are compelling benefits to doing so. +// See golang.org/s/go13linker for more background. +// +// The file format is: +// +// - magic header: "\x00\x00go13ld" +// - byte 1 - version number +// - sequence of strings giving dependencies (imported packages) +// - empty string (marks end of sequence) +// - sequence of defined symbols +// - byte 0xff (marks end of sequence) +// - magic footer: "\xff\xffgo13ld" +// +// All integers are stored in a zigzag varint format. +// See golang.org/s/go12symtab for a definition. +// +// Data blocks and strings are both stored as an integer +// followed by that many bytes. +// +// A symbol reference is a string name followed by a version. +// An empty name corresponds to a nil LSym* pointer. +// +// Each symbol is laid out as the following fields (taken from LSym*): +// +// - byte 0xfe (sanity check for synchronization) +// - type [int] +// - name [string] +// - version [int] +// - flags [int] +// 1 dupok +// - size [int] +// - gotype [symbol reference] +// - p [data block] +// - nr [int] +// - r [nr relocations, sorted by off] +// +// If type == STEXT, there are a few more fields: +// +// - args [int] +// - locals [int] +// - nosplit [int] +// - flags [int] +// 1 leaf +// 2 C function +// - nlocal [int] +// - local [nlocal automatics] +// - pcln [pcln table] +// +// Each relocation has the encoding: +// +// - off [int] +// - siz [int] +// - type [int] +// - add [int] +// - xadd [int] +// - sym [symbol reference] +// - xsym [symbol reference] +// +// Each local has the encoding: +// +// - asym [symbol reference] +// - offset [int] +// - type [int] +// - gotype [symbol reference] +// +// The pcln table has the encoding: +// +// - pcsp [data block] +// - pcfile [data block] +// - pcline [data block] +// - npcdata [int] +// - pcdata [npcdata data blocks] +// - nfuncdata [int] +// - funcdata [nfuncdata symbol references] +// - funcdatasym [nfuncdata ints] +// - nfile [int] +// - file [nfile symbol references] +// +// The file layout and meaning of type integers are architecture-independent. +// +// TODO(rsc): The file format is good for a first pass but needs work. +// - There are SymID in the object file that should really just be strings. +// - The actual symbol memory images are interlaced with the symbol +// metadata. They should be separated, to reduce the I/O required to +// load just the metadata. +// - The symbol references should be shortened, either with a symbol +// table or by using a simple backward index to an earlier mentioned symbol. + +package obj + +import ( + "fmt" + "log" + "path/filepath" + "strings" +) + +var outfile string + +// The Go and C compilers, and the assembler, call writeobj to write +// out a Go object file. The linker does not call this; the linker +// does not write out object files. +func Writeobjdirect(ctxt *Link, b *Biobuf) { + var flag int + var s *LSym + var p *Prog + var plink *Prog + var a *Auto + + // Build list of symbols, and assign instructions to lists. + // Ignore ctxt->plist boundaries. There are no guarantees there, + // and the C compilers and assemblers just use one big list. + var text *LSym + + var curtext *LSym + var data *LSym + var etext *LSym + var edata *LSym + for pl := ctxt.Plist; pl != nil; pl = pl.Link { + for p = pl.Firstpc; p != nil; p = plink { + if ctxt.Debugasm != 0 && ctxt.Debugvlog != 0 { + fmt.Printf("obj: %v\n", p) + } + plink = p.Link + p.Link = nil + + if p.As == AEND { + continue + } + + if p.As == ATYPE { + // Assume each TYPE instruction describes + // a different local variable or parameter, + // so no dedup. + // Using only the TYPE instructions means + // that we discard location information about local variables + // in C and assembly functions; that information is inferred + // from ordinary references, because there are no TYPE + // instructions there. Without the type information, gdb can't + // use the locations, so we don't bother to save them. + // If something else could use them, we could arrange to + // preserve them. + if curtext == nil { + continue + } + a = new(Auto) + a.Asym = p.From.Sym + a.Aoffset = int32(p.From.Offset) + a.Name = int16(p.From.Name) + a.Gotype = p.From.Gotype + a.Link = curtext.Autom + curtext.Autom = a + continue + } + + if p.As == AGLOBL { + s = p.From.Sym + tmp6 := s.Seenglobl + s.Seenglobl++ + if tmp6 != 0 { + fmt.Printf("duplicate %v\n", p) + } + if s.Onlist != 0 { + log.Fatalf("symbol %s listed multiple times", s.Name) + } + s.Onlist = 1 + if data == nil { + data = s + } else { + edata.Next = s + } + s.Next = nil + s.Size = p.To.Offset + if s.Type == 0 || s.Type == SXREF { + s.Type = SBSS + } + flag = int(p.From3.Offset) + if flag&DUPOK != 0 { + s.Dupok = 1 + } + if flag&RODATA != 0 { + s.Type = SRODATA + } else if flag&NOPTR != 0 { + s.Type = SNOPTRBSS + } + edata = s + continue + } + + if p.As == ADATA { + savedata(ctxt, p.From.Sym, p, "") + continue + } + + if p.As == ATEXT { + s = p.From.Sym + if s == nil { + // func _() { } + curtext = nil + + continue + } + + if s.Text != nil { + log.Fatalf("duplicate TEXT for %s", s.Name) + } + if s.Onlist != 0 { + log.Fatalf("symbol %s listed multiple times", s.Name) + } + s.Onlist = 1 + if text == nil { + text = s + } else { + etext.Next = s + } + etext = s + flag = int(p.From3Offset()) + if flag&DUPOK != 0 { + s.Dupok = 1 + } + if flag&NOSPLIT != 0 { + s.Nosplit = 1 + } + s.Next = nil + s.Type = STEXT + s.Text = p + s.Etext = p + curtext = s + continue + } + + if p.As == AFUNCDATA { + // Rewrite reference to go_args_stackmap(SB) to the Go-provided declaration information. + if curtext == nil { // func _() {} + continue + } + if p.To.Sym.Name == "go_args_stackmap" { + if p.From.Type != TYPE_CONST || p.From.Offset != FUNCDATA_ArgsPointerMaps { + ctxt.Diag("FUNCDATA use of go_args_stackmap(SB) without FUNCDATA_ArgsPointerMaps") + } + p.To.Sym = Linklookup(ctxt, fmt.Sprintf("%s.args_stackmap", curtext.Name), int(curtext.Version)) + } + } + + if curtext == nil { + continue + } + s = curtext + s.Etext.Link = p + s.Etext = p + } + } + + // Add reference to Go arguments for C or assembly functions without them. + var found int + for s := text; s != nil; s = s.Next { + if !strings.HasPrefix(s.Name, "\"\".") { + continue + } + found = 0 + for p = s.Text; p != nil; p = p.Link { + if p.As == AFUNCDATA && p.From.Type == TYPE_CONST && p.From.Offset == FUNCDATA_ArgsPointerMaps { + found = 1 + break + } + } + + if found == 0 { + p = Appendp(ctxt, s.Text) + p.As = AFUNCDATA + p.From.Type = TYPE_CONST + p.From.Offset = FUNCDATA_ArgsPointerMaps + p.To.Type = TYPE_MEM + p.To.Name = NAME_EXTERN + p.To.Sym = Linklookup(ctxt, fmt.Sprintf("%s.args_stackmap", s.Name), int(s.Version)) + } + } + + // Turn functions into machine code images. + for s := text; s != nil; s = s.Next { + mkfwd(s) + linkpatch(ctxt, s) + ctxt.Arch.Follow(ctxt, s) + ctxt.Arch.Preprocess(ctxt, s) + ctxt.Arch.Assemble(ctxt, s) + linkpcln(ctxt, s) + } + + // Emit header. + Bputc(b, 0) + + Bputc(b, 0) + fmt.Fprintf(b, "go13ld") + Bputc(b, 1) // version + + // Emit autolib. + for _, pkg := range ctxt.Imports { + wrstring(b, pkg) + } + wrstring(b, "") + + // Emit symbols. + for s := text; s != nil; s = s.Next { + writesym(ctxt, b, s) + } + for s := data; s != nil; s = s.Next { + writesym(ctxt, b, s) + } + + // Emit footer. + Bputc(b, 0xff) + + Bputc(b, 0xff) + fmt.Fprintf(b, "go13ld") +} + +func writesym(ctxt *Link, b *Biobuf, s *LSym) { + if ctxt.Debugasm != 0 { + fmt.Fprintf(ctxt.Bso, "%s ", s.Name) + if s.Version != 0 { + fmt.Fprintf(ctxt.Bso, "v=%d ", s.Version) + } + if s.Type != 0 { + fmt.Fprintf(ctxt.Bso, "t=%d ", s.Type) + } + if s.Dupok != 0 { + fmt.Fprintf(ctxt.Bso, "dupok ") + } + if s.Cfunc != 0 { + fmt.Fprintf(ctxt.Bso, "cfunc ") + } + if s.Nosplit != 0 { + fmt.Fprintf(ctxt.Bso, "nosplit ") + } + fmt.Fprintf(ctxt.Bso, "size=%d value=%d", int64(s.Size), int64(s.Value)) + if s.Type == STEXT { + fmt.Fprintf(ctxt.Bso, " args=%#x locals=%#x", uint64(s.Args), uint64(s.Locals)) + if s.Leaf != 0 { + fmt.Fprintf(ctxt.Bso, " leaf") + } + } + + fmt.Fprintf(ctxt.Bso, "\n") + for p := s.Text; p != nil; p = p.Link { + fmt.Fprintf(ctxt.Bso, "\t%#04x %v\n", uint(int(p.Pc)), p) + } + var c int + var j int + for i := 0; i < len(s.P); { + fmt.Fprintf(ctxt.Bso, "\t%#04x", uint(i)) + for j = i; j < i+16 && j < len(s.P); j++ { + fmt.Fprintf(ctxt.Bso, " %02x", s.P[j]) + } + for ; j < i+16; j++ { + fmt.Fprintf(ctxt.Bso, " ") + } + fmt.Fprintf(ctxt.Bso, " ") + for j = i; j < i+16 && j < len(s.P); j++ { + c = int(s.P[j]) + if ' ' <= c && c <= 0x7e { + fmt.Fprintf(ctxt.Bso, "%c", c) + } else { + fmt.Fprintf(ctxt.Bso, ".") + } + } + + fmt.Fprintf(ctxt.Bso, "\n") + i += 16 + } + + var r *Reloc + var name string + for i := 0; i < len(s.R); i++ { + r = &s.R[i] + name = "" + if r.Sym != nil { + name = r.Sym.Name + } + if ctxt.Arch.Thechar == '5' || ctxt.Arch.Thechar == '9' { + fmt.Fprintf(ctxt.Bso, "\trel %d+%d t=%d %s+%x\n", int(r.Off), r.Siz, r.Type, name, uint64(int64(r.Add))) + } else { + fmt.Fprintf(ctxt.Bso, "\trel %d+%d t=%d %s+%d\n", int(r.Off), r.Siz, r.Type, name, int64(r.Add)) + } + } + } + + Bputc(b, 0xfe) + wrint(b, int64(s.Type)) + wrstring(b, s.Name) + wrint(b, int64(s.Version)) + flags := int64(s.Dupok) + if s.Local { + flags |= 2 + } + wrint(b, flags) + wrint(b, s.Size) + wrsym(b, s.Gotype) + wrdata(b, s.P) + + wrint(b, int64(len(s.R))) + var r *Reloc + for i := 0; i < len(s.R); i++ { + r = &s.R[i] + wrint(b, int64(r.Off)) + wrint(b, int64(r.Siz)) + wrint(b, int64(r.Type)) + wrint(b, r.Add) + wrint(b, 0) // Xadd, ignored + wrsym(b, r.Sym) + wrsym(b, nil) // Xsym, ignored + } + + if s.Type == STEXT { + wrint(b, int64(s.Args)) + wrint(b, int64(s.Locals)) + wrint(b, int64(s.Nosplit)) + wrint(b, int64(s.Leaf)|int64(s.Cfunc)<<1) + n := 0 + for a := s.Autom; a != nil; a = a.Link { + n++ + } + wrint(b, int64(n)) + for a := s.Autom; a != nil; a = a.Link { + wrsym(b, a.Asym) + wrint(b, int64(a.Aoffset)) + if a.Name == NAME_AUTO { + wrint(b, A_AUTO) + } else if a.Name == NAME_PARAM { + wrint(b, A_PARAM) + } else { + log.Fatalf("%s: invalid local variable type %d", s.Name, a.Name) + } + wrsym(b, a.Gotype) + } + + pc := s.Pcln + wrdata(b, pc.Pcsp.P) + wrdata(b, pc.Pcfile.P) + wrdata(b, pc.Pcline.P) + wrint(b, int64(len(pc.Pcdata))) + for i := 0; i < len(pc.Pcdata); i++ { + wrdata(b, pc.Pcdata[i].P) + } + wrint(b, int64(len(pc.Funcdataoff))) + for i := 0; i < len(pc.Funcdataoff); i++ { + wrsym(b, pc.Funcdata[i]) + } + for i := 0; i < len(pc.Funcdataoff); i++ { + wrint(b, pc.Funcdataoff[i]) + } + wrint(b, int64(len(pc.File))) + for i := 0; i < len(pc.File); i++ { + wrpathsym(ctxt, b, pc.File[i]) + } + } +} + +// Reusable buffer to avoid allocations. +// This buffer was responsible for 15% of gc's allocations. +var varintbuf [10]uint8 + +func wrint(b *Biobuf, sval int64) { + var v uint64 + uv := (uint64(sval) << 1) ^ uint64(int64(sval>>63)) + p := varintbuf[:] + for v = uv; v >= 0x80; v >>= 7 { + p[0] = uint8(v | 0x80) + p = p[1:] + } + p[0] = uint8(v) + p = p[1:] + b.Write(varintbuf[:len(varintbuf)-len(p)]) +} + +func wrstring(b *Biobuf, s string) { + wrint(b, int64(len(s))) + b.w.WriteString(s) +} + +// wrpath writes a path just like a string, but on windows, it +// translates '\\' to '/' in the process. +func wrpath(ctxt *Link, b *Biobuf, p string) { + wrstring(b, filepath.ToSlash(p)) +} + +func wrdata(b *Biobuf, v []byte) { + wrint(b, int64(len(v))) + b.Write(v) +} + +func wrpathsym(ctxt *Link, b *Biobuf, s *LSym) { + if s == nil { + wrint(b, 0) + wrint(b, 0) + return + } + + wrpath(ctxt, b, s.Name) + wrint(b, int64(s.Version)) +} + +func wrsym(b *Biobuf, s *LSym) { + if s == nil { + wrint(b, 0) + wrint(b, 0) + return + } + + wrstring(b, s.Name) + wrint(b, int64(s.Version)) +} diff --git a/src/cmd/internal/obj/pass.go b/src/cmd/internal/obj/pass.go new file mode 100644 index 0000000000000000000000000000000000000000..b92dfe23fb4c5bd3cc055d857950a9063b8de01e --- /dev/null +++ b/src/cmd/internal/obj/pass.go @@ -0,0 +1,216 @@ +// Inferno utils/6l/pass.c +// http://code.google.com/p/inferno-os/source/browse/utils/6l/pass.c +// +// Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved. +// Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net) +// Portions Copyright © 1997-1999 Vita Nuova Limited +// Portions Copyright © 2000-2007 Vita Nuova Holdings Limited (www.vitanuova.com) +// Portions Copyright © 2004,2006 Bruce Ellis +// Portions Copyright © 2005-2007 C H Forsyth (forsyth@terzarima.net) +// Revisions Copyright © 2000-2007 Lucent Technologies Inc. and others +// Portions Copyright © 2009 The Go Authors. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +package obj + +// Code and data passes. + +func Brchain(ctxt *Link, p *Prog) *Prog { + for i := 0; i < 20; i++ { + if p == nil || p.As != AJMP || p.Pcond == nil { + return p + } + p = p.Pcond + } + + return nil +} + +func brloop(ctxt *Link, p *Prog) *Prog { + var q *Prog + + c := 0 + for q = p; q != nil; q = q.Pcond { + if q.As != AJMP || q.Pcond == nil { + break + } + c++ + if c >= 5000 { + return nil + } + } + + return q +} + +func checkaddr(ctxt *Link, p *Prog, a *Addr) { + // Check expected encoding, especially TYPE_CONST vs TYPE_ADDR. + switch a.Type { + case TYPE_NONE: + return + + case TYPE_BRANCH: + if a.Reg != 0 || a.Index != 0 || a.Scale != 0 || a.Name != 0 { + break + } + return + + case TYPE_TEXTSIZE: + if a.Reg != 0 || a.Index != 0 || a.Scale != 0 || a.Name != 0 { + break + } + return + + //if(a->u.bits != 0) + // break; + case TYPE_MEM: + return + + // TODO(rsc): After fixing SHRQ, check a->index != 0 too. + case TYPE_CONST: + if a.Name != 0 || a.Sym != nil || a.Reg != 0 { + ctxt.Diag("argument is TYPE_CONST, should be TYPE_ADDR, in %v", p) + return + } + + if a.Reg != 0 || a.Scale != 0 || a.Name != 0 || a.Sym != nil || a.Val != nil { + break + } + return + + case TYPE_FCONST, TYPE_SCONST: + if a.Reg != 0 || a.Index != 0 || a.Scale != 0 || a.Name != 0 || a.Offset != 0 || a.Sym != nil { + break + } + return + + // TODO(rsc): After fixing PINSRQ, check a->offset != 0 too. + // TODO(rsc): After fixing SHRQ, check a->index != 0 too. + case TYPE_REG: + if a.Scale != 0 || a.Name != 0 || a.Sym != nil { + break + } + return + + case TYPE_ADDR: + if a.Val != nil { + break + } + if a.Reg == 0 && a.Index == 0 && a.Scale == 0 && a.Name == 0 && a.Sym == nil { + ctxt.Diag("argument is TYPE_ADDR, should be TYPE_CONST, in %v", p) + } + return + + case TYPE_SHIFT: + if a.Index != 0 || a.Scale != 0 || a.Name != 0 || a.Sym != nil || a.Val != nil { + break + } + return + + case TYPE_REGREG: + if a.Index != 0 || a.Scale != 0 || a.Name != 0 || a.Sym != nil || a.Val != nil { + break + } + return + + case TYPE_REGREG2: + return + + case TYPE_REGLIST: + return + + // Expect sym and name to be set, nothing else. + // Technically more is allowed, but this is only used for *name(SB). + case TYPE_INDIR: + if a.Reg != 0 || a.Index != 0 || a.Scale != 0 || a.Name == 0 || a.Offset != 0 || a.Sym == nil || a.Val != nil { + break + } + return + } + + ctxt.Diag("invalid encoding for argument %v", p) +} + +func linkpatch(ctxt *Link, sym *LSym) { + var c int32 + var name string + var q *Prog + + ctxt.Cursym = sym + + for p := sym.Text; p != nil; p = p.Link { + checkaddr(ctxt, p, &p.From) + if p.From3 != nil { + checkaddr(ctxt, p, p.From3) + } + checkaddr(ctxt, p, &p.To) + + if ctxt.Arch.Progedit != nil { + ctxt.Arch.Progedit(ctxt, p) + } + if p.To.Type != TYPE_BRANCH { + continue + } + if p.To.Val != nil { + // TODO: Remove To.Val.(*Prog) in favor of p->pcond. + p.Pcond = p.To.Val.(*Prog) + continue + } + + if p.To.Sym != nil { + continue + } + c = int32(p.To.Offset) + for q = sym.Text; q != nil; { + if int64(c) == q.Pc { + break + } + if q.Forwd != nil && int64(c) >= q.Forwd.Pc { + q = q.Forwd + } else { + q = q.Link + } + } + + if q == nil { + name = "" + if p.To.Sym != nil { + name = p.To.Sym.Name + } + ctxt.Diag("branch out of range (%#x)\n%v [%s]", uint32(c), p, name) + p.To.Type = TYPE_NONE + } + + p.To.Val = q + p.Pcond = q + } + + for p := sym.Text; p != nil; p = p.Link { + p.Mark = 0 /* initialization for follow */ + if p.Pcond != nil { + p.Pcond = brloop(ctxt, p.Pcond) + if p.Pcond != nil { + if p.To.Type == TYPE_BRANCH { + p.To.Offset = p.Pcond.Pc + } + } + } + } +} diff --git a/src/cmd/internal/obj/pcln.go b/src/cmd/internal/obj/pcln.go new file mode 100644 index 0000000000000000000000000000000000000000..91c9293bb216c437645a29bce5e9b719c395b4dd --- /dev/null +++ b/src/cmd/internal/obj/pcln.go @@ -0,0 +1,338 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package obj + +import ( + "fmt" + "log" +) + +func addvarint(ctxt *Link, d *Pcdata, val uint32) { + var v uint32 + for v = val; v >= 0x80; v >>= 7 { + d.P = append(d.P, uint8(v|0x80)) + } + d.P = append(d.P, uint8(v)) +} + +// funcpctab writes to dst a pc-value table mapping the code in func to the values +// returned by valfunc parameterized by arg. The invocation of valfunc to update the +// current value is, for each p, +// +// val = valfunc(func, val, p, 0, arg); +// record val as value at p->pc; +// val = valfunc(func, val, p, 1, arg); +// +// where func is the function, val is the current value, p is the instruction being +// considered, and arg can be used to further parameterize valfunc. +func funcpctab(ctxt *Link, dst *Pcdata, func_ *LSym, desc string, valfunc func(*Link, *LSym, int32, *Prog, int32, interface{}) int32, arg interface{}) { + // To debug a specific function, uncomment second line and change name. + dbg := 0 + + //dbg = strcmp(func->name, "main.main") == 0; + //dbg = strcmp(desc, "pctofile") == 0; + + ctxt.Debugpcln += int32(dbg) + + dst.P = dst.P[:0] + + if ctxt.Debugpcln != 0 { + fmt.Fprintf(ctxt.Bso, "funcpctab %s [valfunc=%s]\n", func_.Name, desc) + } + + val := int32(-1) + oldval := val + if func_.Text == nil { + ctxt.Debugpcln -= int32(dbg) + return + } + + pc := func_.Text.Pc + + if ctxt.Debugpcln != 0 { + fmt.Fprintf(ctxt.Bso, "%6x %6d %v\n", uint64(pc), val, func_.Text) + } + + started := int32(0) + var delta uint32 + for p := func_.Text; p != nil; p = p.Link { + // Update val. If it's not changing, keep going. + val = valfunc(ctxt, func_, val, p, 0, arg) + + if val == oldval && started != 0 { + val = valfunc(ctxt, func_, val, p, 1, arg) + if ctxt.Debugpcln != 0 { + fmt.Fprintf(ctxt.Bso, "%6x %6s %v\n", uint64(int64(p.Pc)), "", p) + } + continue + } + + // If the pc of the next instruction is the same as the + // pc of this instruction, this instruction is not a real + // instruction. Keep going, so that we only emit a delta + // for a true instruction boundary in the program. + if p.Link != nil && p.Link.Pc == p.Pc { + val = valfunc(ctxt, func_, val, p, 1, arg) + if ctxt.Debugpcln != 0 { + fmt.Fprintf(ctxt.Bso, "%6x %6s %v\n", uint64(int64(p.Pc)), "", p) + } + continue + } + + // The table is a sequence of (value, pc) pairs, where each + // pair states that the given value is in effect from the current position + // up to the given pc, which becomes the new current position. + // To generate the table as we scan over the program instructions, + // we emit a "(value" when pc == func->value, and then + // each time we observe a change in value we emit ", pc) (value". + // When the scan is over, we emit the closing ", pc)". + // + // The table is delta-encoded. The value deltas are signed and + // transmitted in zig-zag form, where a complement bit is placed in bit 0, + // and the pc deltas are unsigned. Both kinds of deltas are sent + // as variable-length little-endian base-128 integers, + // where the 0x80 bit indicates that the integer continues. + + if ctxt.Debugpcln != 0 { + fmt.Fprintf(ctxt.Bso, "%6x %6d %v\n", uint64(int64(p.Pc)), val, p) + } + + if started != 0 { + addvarint(ctxt, dst, uint32((p.Pc-pc)/int64(ctxt.Arch.Minlc))) + pc = p.Pc + } + + delta = uint32(val) - uint32(oldval) + if delta>>31 != 0 { + delta = 1 | ^(delta << 1) + } else { + delta <<= 1 + } + addvarint(ctxt, dst, delta) + oldval = val + started = 1 + val = valfunc(ctxt, func_, val, p, 1, arg) + } + + if started != 0 { + if ctxt.Debugpcln != 0 { + fmt.Fprintf(ctxt.Bso, "%6x done\n", uint64(int64(func_.Text.Pc)+func_.Size)) + } + addvarint(ctxt, dst, uint32((func_.Value+func_.Size-pc)/int64(ctxt.Arch.Minlc))) + addvarint(ctxt, dst, 0) // terminator + } + + if ctxt.Debugpcln != 0 { + fmt.Fprintf(ctxt.Bso, "wrote %d bytes to %p\n", len(dst.P), dst) + for i := 0; i < len(dst.P); i++ { + fmt.Fprintf(ctxt.Bso, " %02x", dst.P[i]) + } + fmt.Fprintf(ctxt.Bso, "\n") + } + + ctxt.Debugpcln -= int32(dbg) +} + +// pctofileline computes either the file number (arg == 0) +// or the line number (arg == 1) to use at p. +// Because p->lineno applies to p, phase == 0 (before p) +// takes care of the update. +func pctofileline(ctxt *Link, sym *LSym, oldval int32, p *Prog, phase int32, arg interface{}) int32 { + if p.As == ATEXT || p.As == ANOP || p.As == AUSEFIELD || p.Lineno == 0 || phase == 1 { + return oldval + } + var l int32 + var f *LSym + linkgetline(ctxt, p.Lineno, &f, &l) + if f == nil { + // print("getline failed for %s %v\n", ctxt->cursym->name, p); + return oldval + } + + if arg == nil { + return l + } + pcln := arg.(*Pcln) + + if f == pcln.Lastfile { + return int32(pcln.Lastindex) + } + + var i int32 + for i = 0; i < int32(len(pcln.File)); i++ { + file := pcln.File[i] + if file == f { + pcln.Lastfile = f + pcln.Lastindex = int(i) + return int32(i) + } + } + pcln.File = append(pcln.File, f) + pcln.Lastfile = f + pcln.Lastindex = int(i) + return i +} + +// pctospadj computes the sp adjustment in effect. +// It is oldval plus any adjustment made by p itself. +// The adjustment by p takes effect only after p, so we +// apply the change during phase == 1. +func pctospadj(ctxt *Link, sym *LSym, oldval int32, p *Prog, phase int32, arg interface{}) int32 { + if oldval == -1 { // starting + oldval = 0 + } + if phase == 0 { + return oldval + } + if oldval+p.Spadj < -10000 || oldval+p.Spadj > 1100000000 { + ctxt.Diag("overflow in spadj: %d + %d = %d", oldval, p.Spadj, oldval+p.Spadj) + log.Fatalf("bad code") + } + + return oldval + p.Spadj +} + +// pctopcdata computes the pcdata value in effect at p. +// A PCDATA instruction sets the value in effect at future +// non-PCDATA instructions. +// Since PCDATA instructions have no width in the final code, +// it does not matter which phase we use for the update. +func pctopcdata(ctxt *Link, sym *LSym, oldval int32, p *Prog, phase int32, arg interface{}) int32 { + if phase == 0 || p.As != APCDATA || p.From.Offset != int64(arg.(uint32)) { + return oldval + } + if int64(int32(p.To.Offset)) != p.To.Offset { + ctxt.Diag("overflow in PCDATA instruction: %v", p) + log.Fatalf("bad code") + } + + return int32(p.To.Offset) +} + +func linkpcln(ctxt *Link, cursym *LSym) { + ctxt.Cursym = cursym + + pcln := new(Pcln) + cursym.Pcln = pcln + + npcdata := 0 + nfuncdata := 0 + for p := cursym.Text; p != nil; p = p.Link { + if p.As == APCDATA && p.From.Offset >= int64(npcdata) { + npcdata = int(p.From.Offset + 1) + } + if p.As == AFUNCDATA && p.From.Offset >= int64(nfuncdata) { + nfuncdata = int(p.From.Offset + 1) + } + } + + pcln.Pcdata = make([]Pcdata, npcdata) + pcln.Pcdata = pcln.Pcdata[:npcdata] + pcln.Funcdata = make([]*LSym, nfuncdata) + pcln.Funcdataoff = make([]int64, nfuncdata) + pcln.Funcdataoff = pcln.Funcdataoff[:nfuncdata] + + funcpctab(ctxt, &pcln.Pcsp, cursym, "pctospadj", pctospadj, nil) + funcpctab(ctxt, &pcln.Pcfile, cursym, "pctofile", pctofileline, pcln) + funcpctab(ctxt, &pcln.Pcline, cursym, "pctoline", pctofileline, nil) + + // tabulate which pc and func data we have. + havepc := make([]uint32, (npcdata+31)/32) + havefunc := make([]uint32, (nfuncdata+31)/32) + for p := cursym.Text; p != nil; p = p.Link { + if p.As == AFUNCDATA { + if (havefunc[p.From.Offset/32]>>uint64(p.From.Offset%32))&1 != 0 { + ctxt.Diag("multiple definitions for FUNCDATA $%d", p.From.Offset) + } + havefunc[p.From.Offset/32] |= 1 << uint64(p.From.Offset%32) + } + + if p.As == APCDATA { + havepc[p.From.Offset/32] |= 1 << uint64(p.From.Offset%32) + } + } + + // pcdata. + for i := 0; i < npcdata; i++ { + if (havepc[i/32]>>uint(i%32))&1 == 0 { + continue + } + funcpctab(ctxt, &pcln.Pcdata[i], cursym, "pctopcdata", pctopcdata, interface{}(uint32(i))) + } + + // funcdata + if nfuncdata > 0 { + var i int + for p := cursym.Text; p != nil; p = p.Link { + if p.As == AFUNCDATA { + i = int(p.From.Offset) + pcln.Funcdataoff[i] = p.To.Offset + if p.To.Type != TYPE_CONST { + // TODO: Dedup. + //funcdata_bytes += p->to.sym->size; + pcln.Funcdata[i] = p.To.Sym + } + } + } + } +} + +// iteration over encoded pcdata tables. + +func getvarint(pp *[]byte) uint32 { + v := uint32(0) + p := *pp + for shift := 0; ; shift += 7 { + v |= uint32(p[0]&0x7F) << uint(shift) + tmp7 := p + p = p[1:] + if tmp7[0]&0x80 == 0 { + break + } + } + + *pp = p + return v +} + +func pciternext(it *Pciter) { + it.pc = it.nextpc + if it.done != 0 { + return + } + if -cap(it.p) >= -cap(it.d.P[len(it.d.P):]) { + it.done = 1 + return + } + + // value delta + v := getvarint(&it.p) + + if v == 0 && it.start == 0 { + it.done = 1 + return + } + + it.start = 0 + dv := int32(v>>1) ^ (int32(v<<31) >> 31) + it.value += dv + + // pc delta + v = getvarint(&it.p) + + it.nextpc = it.pc + v*it.pcscale +} + +func pciterinit(ctxt *Link, it *Pciter, d *Pcdata) { + it.d = *d + it.p = it.d.P + it.pc = 0 + it.nextpc = 0 + it.value = -1 + it.start = 1 + it.done = 0 + it.pcscale = uint32(ctxt.Arch.Minlc) + pciternext(it) +} diff --git a/src/cmd/internal/obj/ppc64/a.out.go b/src/cmd/internal/obj/ppc64/a.out.go new file mode 100644 index 0000000000000000000000000000000000000000..3028b6cac8d41850d8221825636251f4fbd80e4a --- /dev/null +++ b/src/cmd/internal/obj/ppc64/a.out.go @@ -0,0 +1,538 @@ +// cmd/9c/9.out.h from Vita Nuova. +// +// Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved. +// Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net) +// Portions Copyright © 1997-1999 Vita Nuova Limited +// Portions Copyright © 2000-2008 Vita Nuova Holdings Limited (www.vitanuova.com) +// Portions Copyright © 2004,2006 Bruce Ellis +// Portions Copyright © 2005-2007 C H Forsyth (forsyth@terzarima.net) +// Revisions Copyright © 2000-2008 Lucent Technologies Inc. and others +// Portions Copyright © 2009 The Go Authors. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +package ppc64 + +import "cmd/internal/obj" + +//go:generate go run ../stringer.go -i $GOFILE -o anames.go -p ppc64 + +/* + * powerpc 64 + */ +const ( + NSNAME = 8 + NSYM = 50 + NREG = 32 /* number of general registers */ + NFREG = 32 /* number of floating point registers */ +) + +const ( + REG_R0 = obj.RBasePPC64 + iota + REG_R1 + REG_R2 + REG_R3 + REG_R4 + REG_R5 + REG_R6 + REG_R7 + REG_R8 + REG_R9 + REG_R10 + REG_R11 + REG_R12 + REG_R13 + REG_R14 + REG_R15 + REG_R16 + REG_R17 + REG_R18 + REG_R19 + REG_R20 + REG_R21 + REG_R22 + REG_R23 + REG_R24 + REG_R25 + REG_R26 + REG_R27 + REG_R28 + REG_R29 + REG_R30 + REG_R31 + + REG_F0 + REG_F1 + REG_F2 + REG_F3 + REG_F4 + REG_F5 + REG_F6 + REG_F7 + REG_F8 + REG_F9 + REG_F10 + REG_F11 + REG_F12 + REG_F13 + REG_F14 + REG_F15 + REG_F16 + REG_F17 + REG_F18 + REG_F19 + REG_F20 + REG_F21 + REG_F22 + REG_F23 + REG_F24 + REG_F25 + REG_F26 + REG_F27 + REG_F28 + REG_F29 + REG_F30 + REG_F31 + + REG_CR0 + REG_CR1 + REG_CR2 + REG_CR3 + REG_CR4 + REG_CR5 + REG_CR6 + REG_CR7 + + REG_MSR + REG_FPSCR + REG_CR + + REG_SPECIAL = REG_CR0 + + REG_SPR0 = obj.RBasePPC64 + 1024 // first of 1024 registers + REG_DCR0 = obj.RBasePPC64 + 2048 // first of 1024 registers + + REG_XER = REG_SPR0 + 1 + REG_LR = REG_SPR0 + 8 + REG_CTR = REG_SPR0 + 9 + + REGZERO = REG_R0 /* set to zero */ + REGSP = REG_R1 + REGSB = REG_R2 + REGRET = REG_R3 + REGARG = -1 /* -1 disables passing the first argument in register */ + REGRT1 = REG_R3 /* reserved for runtime, duffzero and duffcopy */ + REGRT2 = REG_R4 /* reserved for runtime, duffcopy */ + REGMIN = REG_R7 /* register variables allocated from here to REGMAX */ + REGCTXT = REG_R11 /* context for closures */ + REGTLS = REG_R13 /* C ABI TLS base pointer */ + REGMAX = REG_R27 + REGEXT = REG_R30 /* external registers allocated from here down */ + REGG = REG_R30 /* G */ + REGTMP = REG_R31 /* used by the linker */ + FREGRET = REG_F0 + FREGMIN = REG_F17 /* first register variable */ + FREGMAX = REG_F26 /* last register variable for 9g only */ + FREGEXT = REG_F26 /* first external register */ + FREGCVI = REG_F27 /* floating conversion constant */ + FREGZERO = REG_F28 /* both float and double */ + FREGHALF = REG_F29 /* double */ + FREGONE = REG_F30 /* double */ + FREGTWO = REG_F31 /* double */ +) + +/* + * GENERAL: + * + * compiler allocates R3 up as temps + * compiler allocates register variables R7-R27 + * compiler allocates external registers R30 down + * + * compiler allocates register variables F17-F26 + * compiler allocates external registers F26 down + */ +const ( + BIG = 32768 - 8 +) + +const ( + /* mark flags */ + LABEL = 1 << 0 + LEAF = 1 << 1 + FLOAT = 1 << 2 + BRANCH = 1 << 3 + LOAD = 1 << 4 + FCMP = 1 << 5 + SYNC = 1 << 6 + LIST = 1 << 7 + FOLL = 1 << 8 + NOSCHED = 1 << 9 +) + +const ( + C_NONE = iota + C_REG + C_FREG + C_CREG + C_SPR /* special processor register */ + C_ZCON + C_SCON /* 16 bit signed */ + C_UCON /* 32 bit signed, low 16 bits 0 */ + C_ADDCON /* -0x8000 <= v < 0 */ + C_ANDCON /* 0 < v <= 0xFFFF */ + C_LCON /* other 32 */ + C_DCON /* other 64 (could subdivide further) */ + C_SACON /* $n(REG) where n <= int16 */ + C_SECON + C_LACON /* $n(REG) where int16 < n <= int32 */ + C_LECON + C_DACON /* $n(REG) where int32 < n */ + C_SBRA + C_LBRA + C_SAUTO + C_LAUTO + C_SEXT + C_LEXT + C_ZOREG + C_SOREG + C_LOREG + C_FPSCR + C_MSR + C_XER + C_LR + C_CTR + C_ANY + C_GOK + C_ADDR + C_TEXTSIZE + + C_NCLASS /* must be the last */ +) + +const ( + AADD = obj.ABasePPC64 + obj.A_ARCHSPECIFIC + iota + AADDCC + AADDV + AADDVCC + AADDC + AADDCCC + AADDCV + AADDCVCC + AADDME + AADDMECC + AADDMEVCC + AADDMEV + AADDE + AADDECC + AADDEVCC + AADDEV + AADDZE + AADDZECC + AADDZEVCC + AADDZEV + AAND + AANDCC + AANDN + AANDNCC + ABC + ABCL + ABEQ + ABGE + ABGT + ABLE + ABLT + ABNE + ABVC + ABVS + ACMP + ACMPU + ACNTLZW + ACNTLZWCC + ACRAND + ACRANDN + ACREQV + ACRNAND + ACRNOR + ACROR + ACRORN + ACRXOR + ADIVW + ADIVWCC + ADIVWVCC + ADIVWV + ADIVWU + ADIVWUCC + ADIVWUVCC + ADIVWUV + AEQV + AEQVCC + AEXTSB + AEXTSBCC + AEXTSH + AEXTSHCC + AFABS + AFABSCC + AFADD + AFADDCC + AFADDS + AFADDSCC + AFCMPO + AFCMPU + AFCTIW + AFCTIWCC + AFCTIWZ + AFCTIWZCC + AFDIV + AFDIVCC + AFDIVS + AFDIVSCC + AFMADD + AFMADDCC + AFMADDS + AFMADDSCC + AFMOVD + AFMOVDCC + AFMOVDU + AFMOVS + AFMOVSU + AFMSUB + AFMSUBCC + AFMSUBS + AFMSUBSCC + AFMUL + AFMULCC + AFMULS + AFMULSCC + AFNABS + AFNABSCC + AFNEG + AFNEGCC + AFNMADD + AFNMADDCC + AFNMADDS + AFNMADDSCC + AFNMSUB + AFNMSUBCC + AFNMSUBS + AFNMSUBSCC + AFRSP + AFRSPCC + AFSUB + AFSUBCC + AFSUBS + AFSUBSCC + AMOVMW + ALSW + ALWAR + AMOVWBR + AMOVB + AMOVBU + AMOVBZ + AMOVBZU + AMOVH + AMOVHBR + AMOVHU + AMOVHZ + AMOVHZU + AMOVW + AMOVWU + AMOVFL + AMOVCRFS + AMTFSB0 + AMTFSB0CC + AMTFSB1 + AMTFSB1CC + AMULHW + AMULHWCC + AMULHWU + AMULHWUCC + AMULLW + AMULLWCC + AMULLWVCC + AMULLWV + ANAND + ANANDCC + ANEG + ANEGCC + ANEGVCC + ANEGV + ANOR + ANORCC + AOR + AORCC + AORN + AORNCC + AREM + AREMCC + AREMV + AREMVCC + AREMU + AREMUCC + AREMUV + AREMUVCC + ARFI + ARLWMI + ARLWMICC + ARLWNM + ARLWNMCC + ASLW + ASLWCC + ASRW + ASRAW + ASRAWCC + ASRWCC + ASTSW + ASTWCCC + ASUB + ASUBCC + ASUBVCC + ASUBC + ASUBCCC + ASUBCV + ASUBCVCC + ASUBME + ASUBMECC + ASUBMEVCC + ASUBMEV + ASUBV + ASUBE + ASUBECC + ASUBEV + ASUBEVCC + ASUBZE + ASUBZECC + ASUBZEVCC + ASUBZEV + ASYNC + AXOR + AXORCC + + ADCBF + ADCBI + ADCBST + ADCBT + ADCBTST + ADCBZ + AECIWX + AECOWX + AEIEIO + AICBI + AISYNC + APTESYNC + ATLBIE + ATLBIEL + ATLBSYNC + ATW + + ASYSCALL + AWORD + + ARFCI + + /* optional on 32-bit */ + AFRES + AFRESCC + AFRSQRTE + AFRSQRTECC + AFSEL + AFSELCC + AFSQRT + AFSQRTCC + AFSQRTS + AFSQRTSCC + + /* 64-bit */ + + ACNTLZD + ACNTLZDCC + ACMPW /* CMP with L=0 */ + ACMPWU + ADIVD + ADIVDCC + ADIVDVCC + ADIVDV + ADIVDU + ADIVDUCC + ADIVDUVCC + ADIVDUV + AEXTSW + AEXTSWCC + /* AFCFIW; AFCFIWCC */ + AFCFID + AFCFIDCC + AFCTID + AFCTIDCC + AFCTIDZ + AFCTIDZCC + ALDAR + AMOVD + AMOVDU + AMOVWZ + AMOVWZU + AMULHD + AMULHDCC + AMULHDU + AMULHDUCC + AMULLD + AMULLDCC + AMULLDVCC + AMULLDV + ARFID + ARLDMI + ARLDMICC + ARLDC + ARLDCCC + ARLDCR + ARLDCRCC + ARLDCL + ARLDCLCC + ASLBIA + ASLBIE + ASLBMFEE + ASLBMFEV + ASLBMTE + ASLD + ASLDCC + ASRD + ASRAD + ASRADCC + ASRDCC + ASTDCCC + ATD + + /* 64-bit pseudo operation */ + ADWORD + AREMD + AREMDCC + AREMDV + AREMDVCC + AREMDU + AREMDUCC + AREMDUV + AREMDUVCC + + /* more 64-bit operations */ + AHRFID + + ALAST + + // aliases + ABR = obj.AJMP + ABL = obj.ACALL +) diff --git a/src/cmd/internal/obj/ppc64/anames.go b/src/cmd/internal/obj/ppc64/anames.go new file mode 100644 index 0000000000000000000000000000000000000000..1ae7a520152f26ca022c4eefa009ba06d3d8fdc2 --- /dev/null +++ b/src/cmd/internal/obj/ppc64/anames.go @@ -0,0 +1,300 @@ +// Generated by stringer -i a.out.go -o anames.go -p ppc64 +// Do not edit. + +package ppc64 + +import "cmd/internal/obj" + +var Anames = []string{ + obj.A_ARCHSPECIFIC: "ADD", + "ADDCC", + "ADDV", + "ADDVCC", + "ADDC", + "ADDCCC", + "ADDCV", + "ADDCVCC", + "ADDME", + "ADDMECC", + "ADDMEVCC", + "ADDMEV", + "ADDE", + "ADDECC", + "ADDEVCC", + "ADDEV", + "ADDZE", + "ADDZECC", + "ADDZEVCC", + "ADDZEV", + "AND", + "ANDCC", + "ANDN", + "ANDNCC", + "BC", + "BCL", + "BEQ", + "BGE", + "BGT", + "BLE", + "BLT", + "BNE", + "BVC", + "BVS", + "CMP", + "CMPU", + "CNTLZW", + "CNTLZWCC", + "CRAND", + "CRANDN", + "CREQV", + "CRNAND", + "CRNOR", + "CROR", + "CRORN", + "CRXOR", + "DIVW", + "DIVWCC", + "DIVWVCC", + "DIVWV", + "DIVWU", + "DIVWUCC", + "DIVWUVCC", + "DIVWUV", + "EQV", + "EQVCC", + "EXTSB", + "EXTSBCC", + "EXTSH", + "EXTSHCC", + "FABS", + "FABSCC", + "FADD", + "FADDCC", + "FADDS", + "FADDSCC", + "FCMPO", + "FCMPU", + "FCTIW", + "FCTIWCC", + "FCTIWZ", + "FCTIWZCC", + "FDIV", + "FDIVCC", + "FDIVS", + "FDIVSCC", + "FMADD", + "FMADDCC", + "FMADDS", + "FMADDSCC", + "FMOVD", + "FMOVDCC", + "FMOVDU", + "FMOVS", + "FMOVSU", + "FMSUB", + "FMSUBCC", + "FMSUBS", + "FMSUBSCC", + "FMUL", + "FMULCC", + "FMULS", + "FMULSCC", + "FNABS", + "FNABSCC", + "FNEG", + "FNEGCC", + "FNMADD", + "FNMADDCC", + "FNMADDS", + "FNMADDSCC", + "FNMSUB", + "FNMSUBCC", + "FNMSUBS", + "FNMSUBSCC", + "FRSP", + "FRSPCC", + "FSUB", + "FSUBCC", + "FSUBS", + "FSUBSCC", + "MOVMW", + "LSW", + "LWAR", + "MOVWBR", + "MOVB", + "MOVBU", + "MOVBZ", + "MOVBZU", + "MOVH", + "MOVHBR", + "MOVHU", + "MOVHZ", + "MOVHZU", + "MOVW", + "MOVWU", + "MOVFL", + "MOVCRFS", + "MTFSB0", + "MTFSB0CC", + "MTFSB1", + "MTFSB1CC", + "MULHW", + "MULHWCC", + "MULHWU", + "MULHWUCC", + "MULLW", + "MULLWCC", + "MULLWVCC", + "MULLWV", + "NAND", + "NANDCC", + "NEG", + "NEGCC", + "NEGVCC", + "NEGV", + "NOR", + "NORCC", + "OR", + "ORCC", + "ORN", + "ORNCC", + "REM", + "REMCC", + "REMV", + "REMVCC", + "REMU", + "REMUCC", + "REMUV", + "REMUVCC", + "RFI", + "RLWMI", + "RLWMICC", + "RLWNM", + "RLWNMCC", + "SLW", + "SLWCC", + "SRW", + "SRAW", + "SRAWCC", + "SRWCC", + "STSW", + "STWCCC", + "SUB", + "SUBCC", + "SUBVCC", + "SUBC", + "SUBCCC", + "SUBCV", + "SUBCVCC", + "SUBME", + "SUBMECC", + "SUBMEVCC", + "SUBMEV", + "SUBV", + "SUBE", + "SUBECC", + "SUBEV", + "SUBEVCC", + "SUBZE", + "SUBZECC", + "SUBZEVCC", + "SUBZEV", + "SYNC", + "XOR", + "XORCC", + "DCBF", + "DCBI", + "DCBST", + "DCBT", + "DCBTST", + "DCBZ", + "ECIWX", + "ECOWX", + "EIEIO", + "ICBI", + "ISYNC", + "PTESYNC", + "TLBIE", + "TLBIEL", + "TLBSYNC", + "TW", + "SYSCALL", + "WORD", + "RFCI", + "FRES", + "FRESCC", + "FRSQRTE", + "FRSQRTECC", + "FSEL", + "FSELCC", + "FSQRT", + "FSQRTCC", + "FSQRTS", + "FSQRTSCC", + "CNTLZD", + "CNTLZDCC", + "CMPW", + "CMPWU", + "DIVD", + "DIVDCC", + "DIVDVCC", + "DIVDV", + "DIVDU", + "DIVDUCC", + "DIVDUVCC", + "DIVDUV", + "EXTSW", + "EXTSWCC", + "FCFID", + "FCFIDCC", + "FCTID", + "FCTIDCC", + "FCTIDZ", + "FCTIDZCC", + "LDAR", + "MOVD", + "MOVDU", + "MOVWZ", + "MOVWZU", + "MULHD", + "MULHDCC", + "MULHDU", + "MULHDUCC", + "MULLD", + "MULLDCC", + "MULLDVCC", + "MULLDV", + "RFID", + "RLDMI", + "RLDMICC", + "RLDC", + "RLDCCC", + "RLDCR", + "RLDCRCC", + "RLDCL", + "RLDCLCC", + "SLBIA", + "SLBIE", + "SLBMFEE", + "SLBMFEV", + "SLBMTE", + "SLD", + "SLDCC", + "SRD", + "SRAD", + "SRADCC", + "SRDCC", + "STDCCC", + "TD", + "DWORD", + "REMD", + "REMDCC", + "REMDV", + "REMDVCC", + "REMDU", + "REMDUCC", + "REMDUV", + "REMDUVCC", + "HRFID", + "LAST", +} diff --git a/src/cmd/internal/obj/ppc64/anames9.go b/src/cmd/internal/obj/ppc64/anames9.go new file mode 100644 index 0000000000000000000000000000000000000000..b48e5162b01a6b84ffb26cdaa7642d66d713a6b7 --- /dev/null +++ b/src/cmd/internal/obj/ppc64/anames9.go @@ -0,0 +1,40 @@ +package ppc64 + +var cnames9 = []string{ + "NONE", + "REG", + "FREG", + "CREG", + "SPR", + "ZCON", + "SCON", + "UCON", + "ADDCON", + "ANDCON", + "LCON", + "DCON", + "SACON", + "SECON", + "LACON", + "LECON", + "DACON", + "SBRA", + "LBRA", + "SAUTO", + "LAUTO", + "SEXT", + "LEXT", + "ZOREG", + "SOREG", + "LOREG", + "FPSCR", + "MSR", + "XER", + "LR", + "CTR", + "ANY", + "GOK", + "ADDR", + "TEXTSIZE", + "NCLASS", +} diff --git a/src/cmd/internal/obj/ppc64/asm9.go b/src/cmd/internal/obj/ppc64/asm9.go new file mode 100644 index 0000000000000000000000000000000000000000..2955a0023d3da4eeb89aeeba1919e86e5edaff58 --- /dev/null +++ b/src/cmd/internal/obj/ppc64/asm9.go @@ -0,0 +1,3247 @@ +// cmd/9l/optab.c, cmd/9l/asmout.c from Vita Nuova. +// +// Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved. +// Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net) +// Portions Copyright © 1997-1999 Vita Nuova Limited +// Portions Copyright © 2000-2008 Vita Nuova Holdings Limited (www.vitanuova.com) +// Portions Copyright © 2004,2006 Bruce Ellis +// Portions Copyright © 2005-2007 C H Forsyth (forsyth@terzarima.net) +// Revisions Copyright © 2000-2008 Lucent Technologies Inc. and others +// Portions Copyright © 2009 The Go Authors. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +package ppc64 + +import ( + "cmd/internal/obj" + "encoding/binary" + "fmt" + "log" + "sort" +) + +// Instruction layout. + +const ( + FuncAlign = 8 +) + +const ( + r0iszero = 1 +) + +type Optab struct { + as int16 + a1 uint8 + a2 uint8 + a3 uint8 + a4 uint8 + type_ int8 + size int8 + param int16 +} + +var optab = []Optab{ + Optab{obj.ATEXT, C_LEXT, C_NONE, C_NONE, C_TEXTSIZE, 0, 0, 0}, + Optab{obj.ATEXT, C_LEXT, C_NONE, C_LCON, C_TEXTSIZE, 0, 0, 0}, + Optab{obj.ATEXT, C_ADDR, C_NONE, C_NONE, C_TEXTSIZE, 0, 0, 0}, + Optab{obj.ATEXT, C_ADDR, C_NONE, C_LCON, C_TEXTSIZE, 0, 0, 0}, + /* move register */ + Optab{AMOVD, C_REG, C_NONE, C_NONE, C_REG, 1, 4, 0}, + Optab{AMOVB, C_REG, C_NONE, C_NONE, C_REG, 12, 4, 0}, + Optab{AMOVBZ, C_REG, C_NONE, C_NONE, C_REG, 13, 4, 0}, + Optab{AMOVW, C_REG, C_NONE, C_NONE, C_REG, 12, 4, 0}, + Optab{AMOVWZ, C_REG, C_NONE, C_NONE, C_REG, 13, 4, 0}, + Optab{AADD, C_REG, C_REG, C_NONE, C_REG, 2, 4, 0}, + Optab{AADD, C_REG, C_NONE, C_NONE, C_REG, 2, 4, 0}, + Optab{AADD, C_ADDCON, C_REG, C_NONE, C_REG, 4, 4, 0}, + Optab{AADD, C_ADDCON, C_NONE, C_NONE, C_REG, 4, 4, 0}, + Optab{AADD, C_UCON, C_REG, C_NONE, C_REG, 20, 4, 0}, + Optab{AADD, C_UCON, C_NONE, C_NONE, C_REG, 20, 4, 0}, + Optab{AADD, C_LCON, C_REG, C_NONE, C_REG, 22, 12, 0}, + Optab{AADD, C_LCON, C_NONE, C_NONE, C_REG, 22, 12, 0}, + Optab{AADDC, C_REG, C_REG, C_NONE, C_REG, 2, 4, 0}, + Optab{AADDC, C_REG, C_NONE, C_NONE, C_REG, 2, 4, 0}, + Optab{AADDC, C_ADDCON, C_REG, C_NONE, C_REG, 4, 4, 0}, + Optab{AADDC, C_ADDCON, C_NONE, C_NONE, C_REG, 4, 4, 0}, + Optab{AADDC, C_LCON, C_REG, C_NONE, C_REG, 22, 12, 0}, + Optab{AADDC, C_LCON, C_NONE, C_NONE, C_REG, 22, 12, 0}, + Optab{AAND, C_REG, C_REG, C_NONE, C_REG, 6, 4, 0}, /* logical, no literal */ + Optab{AAND, C_REG, C_NONE, C_NONE, C_REG, 6, 4, 0}, + Optab{AANDCC, C_REG, C_REG, C_NONE, C_REG, 6, 4, 0}, + Optab{AANDCC, C_REG, C_NONE, C_NONE, C_REG, 6, 4, 0}, + Optab{AANDCC, C_ANDCON, C_NONE, C_NONE, C_REG, 58, 4, 0}, + Optab{AANDCC, C_ANDCON, C_REG, C_NONE, C_REG, 58, 4, 0}, + Optab{AANDCC, C_UCON, C_NONE, C_NONE, C_REG, 59, 4, 0}, + Optab{AANDCC, C_UCON, C_REG, C_NONE, C_REG, 59, 4, 0}, + Optab{AANDCC, C_LCON, C_NONE, C_NONE, C_REG, 23, 12, 0}, + Optab{AANDCC, C_LCON, C_REG, C_NONE, C_REG, 23, 12, 0}, + Optab{AMULLW, C_REG, C_REG, C_NONE, C_REG, 2, 4, 0}, + Optab{AMULLW, C_REG, C_NONE, C_NONE, C_REG, 2, 4, 0}, + Optab{AMULLW, C_ADDCON, C_REG, C_NONE, C_REG, 4, 4, 0}, + Optab{AMULLW, C_ADDCON, C_NONE, C_NONE, C_REG, 4, 4, 0}, + Optab{AMULLW, C_ANDCON, C_REG, C_NONE, C_REG, 4, 4, 0}, + Optab{AMULLW, C_ANDCON, C_NONE, C_NONE, C_REG, 4, 4, 0}, + Optab{AMULLW, C_LCON, C_REG, C_NONE, C_REG, 22, 12, 0}, + Optab{AMULLW, C_LCON, C_NONE, C_NONE, C_REG, 22, 12, 0}, + Optab{ASUBC, C_REG, C_REG, C_NONE, C_REG, 10, 4, 0}, + Optab{ASUBC, C_REG, C_NONE, C_NONE, C_REG, 10, 4, 0}, + Optab{ASUBC, C_REG, C_NONE, C_ADDCON, C_REG, 27, 4, 0}, + Optab{ASUBC, C_REG, C_NONE, C_LCON, C_REG, 28, 12, 0}, + Optab{AOR, C_REG, C_REG, C_NONE, C_REG, 6, 4, 0}, /* logical, literal not cc (or/xor) */ + Optab{AOR, C_REG, C_NONE, C_NONE, C_REG, 6, 4, 0}, + Optab{AOR, C_ANDCON, C_NONE, C_NONE, C_REG, 58, 4, 0}, + Optab{AOR, C_ANDCON, C_REG, C_NONE, C_REG, 58, 4, 0}, + Optab{AOR, C_UCON, C_NONE, C_NONE, C_REG, 59, 4, 0}, + Optab{AOR, C_UCON, C_REG, C_NONE, C_REG, 59, 4, 0}, + Optab{AOR, C_LCON, C_NONE, C_NONE, C_REG, 23, 12, 0}, + Optab{AOR, C_LCON, C_REG, C_NONE, C_REG, 23, 12, 0}, + Optab{ADIVW, C_REG, C_REG, C_NONE, C_REG, 2, 4, 0}, /* op r1[,r2],r3 */ + Optab{ADIVW, C_REG, C_NONE, C_NONE, C_REG, 2, 4, 0}, + Optab{ASUB, C_REG, C_REG, C_NONE, C_REG, 10, 4, 0}, /* op r2[,r1],r3 */ + Optab{ASUB, C_REG, C_NONE, C_NONE, C_REG, 10, 4, 0}, + Optab{ASLW, C_REG, C_NONE, C_NONE, C_REG, 6, 4, 0}, + Optab{ASLW, C_REG, C_REG, C_NONE, C_REG, 6, 4, 0}, + Optab{ASLD, C_REG, C_NONE, C_NONE, C_REG, 6, 4, 0}, + Optab{ASLD, C_REG, C_REG, C_NONE, C_REG, 6, 4, 0}, + Optab{ASLD, C_SCON, C_REG, C_NONE, C_REG, 25, 4, 0}, + Optab{ASLD, C_SCON, C_NONE, C_NONE, C_REG, 25, 4, 0}, + Optab{ASLW, C_SCON, C_REG, C_NONE, C_REG, 57, 4, 0}, + Optab{ASLW, C_SCON, C_NONE, C_NONE, C_REG, 57, 4, 0}, + Optab{ASRAW, C_REG, C_NONE, C_NONE, C_REG, 6, 4, 0}, + Optab{ASRAW, C_REG, C_REG, C_NONE, C_REG, 6, 4, 0}, + Optab{ASRAW, C_SCON, C_REG, C_NONE, C_REG, 56, 4, 0}, + Optab{ASRAW, C_SCON, C_NONE, C_NONE, C_REG, 56, 4, 0}, + Optab{ASRAD, C_REG, C_NONE, C_NONE, C_REG, 6, 4, 0}, + Optab{ASRAD, C_REG, C_REG, C_NONE, C_REG, 6, 4, 0}, + Optab{ASRAD, C_SCON, C_REG, C_NONE, C_REG, 56, 4, 0}, + Optab{ASRAD, C_SCON, C_NONE, C_NONE, C_REG, 56, 4, 0}, + Optab{ARLWMI, C_SCON, C_REG, C_LCON, C_REG, 62, 4, 0}, + Optab{ARLWMI, C_REG, C_REG, C_LCON, C_REG, 63, 4, 0}, + Optab{ARLDMI, C_SCON, C_REG, C_LCON, C_REG, 30, 4, 0}, + Optab{ARLDC, C_SCON, C_REG, C_LCON, C_REG, 29, 4, 0}, + Optab{ARLDCL, C_SCON, C_REG, C_LCON, C_REG, 29, 4, 0}, + Optab{ARLDCL, C_REG, C_REG, C_LCON, C_REG, 14, 4, 0}, + Optab{ARLDCL, C_REG, C_NONE, C_LCON, C_REG, 14, 4, 0}, + Optab{AFADD, C_FREG, C_NONE, C_NONE, C_FREG, 2, 4, 0}, + Optab{AFADD, C_FREG, C_REG, C_NONE, C_FREG, 2, 4, 0}, + Optab{AFABS, C_FREG, C_NONE, C_NONE, C_FREG, 33, 4, 0}, + Optab{AFABS, C_NONE, C_NONE, C_NONE, C_FREG, 33, 4, 0}, + Optab{AFMOVD, C_FREG, C_NONE, C_NONE, C_FREG, 33, 4, 0}, + Optab{AFMADD, C_FREG, C_REG, C_FREG, C_FREG, 34, 4, 0}, + Optab{AFMUL, C_FREG, C_NONE, C_NONE, C_FREG, 32, 4, 0}, + Optab{AFMUL, C_FREG, C_REG, C_NONE, C_FREG, 32, 4, 0}, + + /* store, short offset */ + Optab{AMOVD, C_REG, C_REG, C_NONE, C_ZOREG, 7, 4, REGZERO}, + Optab{AMOVW, C_REG, C_REG, C_NONE, C_ZOREG, 7, 4, REGZERO}, + Optab{AMOVWZ, C_REG, C_REG, C_NONE, C_ZOREG, 7, 4, REGZERO}, + Optab{AMOVBZ, C_REG, C_REG, C_NONE, C_ZOREG, 7, 4, REGZERO}, + Optab{AMOVBZU, C_REG, C_REG, C_NONE, C_ZOREG, 7, 4, REGZERO}, + Optab{AMOVB, C_REG, C_REG, C_NONE, C_ZOREG, 7, 4, REGZERO}, + Optab{AMOVBU, C_REG, C_REG, C_NONE, C_ZOREG, 7, 4, REGZERO}, + Optab{AMOVD, C_REG, C_NONE, C_NONE, C_SEXT, 7, 4, REGSB}, + Optab{AMOVW, C_REG, C_NONE, C_NONE, C_SEXT, 7, 4, REGSB}, + Optab{AMOVWZ, C_REG, C_NONE, C_NONE, C_SEXT, 7, 4, REGSB}, + Optab{AMOVBZ, C_REG, C_NONE, C_NONE, C_SEXT, 7, 4, REGSB}, + Optab{AMOVB, C_REG, C_NONE, C_NONE, C_SEXT, 7, 4, REGSB}, + Optab{AMOVD, C_REG, C_NONE, C_NONE, C_SAUTO, 7, 4, REGSP}, + Optab{AMOVW, C_REG, C_NONE, C_NONE, C_SAUTO, 7, 4, REGSP}, + Optab{AMOVWZ, C_REG, C_NONE, C_NONE, C_SAUTO, 7, 4, REGSP}, + Optab{AMOVBZ, C_REG, C_NONE, C_NONE, C_SAUTO, 7, 4, REGSP}, + Optab{AMOVB, C_REG, C_NONE, C_NONE, C_SAUTO, 7, 4, REGSP}, + Optab{AMOVD, C_REG, C_NONE, C_NONE, C_SOREG, 7, 4, REGZERO}, + Optab{AMOVW, C_REG, C_NONE, C_NONE, C_SOREG, 7, 4, REGZERO}, + Optab{AMOVWZ, C_REG, C_NONE, C_NONE, C_SOREG, 7, 4, REGZERO}, + Optab{AMOVBZ, C_REG, C_NONE, C_NONE, C_SOREG, 7, 4, REGZERO}, + Optab{AMOVBZU, C_REG, C_NONE, C_NONE, C_SOREG, 7, 4, REGZERO}, + Optab{AMOVB, C_REG, C_NONE, C_NONE, C_SOREG, 7, 4, REGZERO}, + Optab{AMOVBU, C_REG, C_NONE, C_NONE, C_SOREG, 7, 4, REGZERO}, + + /* load, short offset */ + Optab{AMOVD, C_ZOREG, C_REG, C_NONE, C_REG, 8, 4, REGZERO}, + Optab{AMOVW, C_ZOREG, C_REG, C_NONE, C_REG, 8, 4, REGZERO}, + Optab{AMOVWZ, C_ZOREG, C_REG, C_NONE, C_REG, 8, 4, REGZERO}, + Optab{AMOVBZ, C_ZOREG, C_REG, C_NONE, C_REG, 8, 4, REGZERO}, + Optab{AMOVBZU, C_ZOREG, C_REG, C_NONE, C_REG, 8, 4, REGZERO}, + Optab{AMOVB, C_ZOREG, C_REG, C_NONE, C_REG, 9, 8, REGZERO}, + Optab{AMOVBU, C_ZOREG, C_REG, C_NONE, C_REG, 9, 8, REGZERO}, + Optab{AMOVD, C_SEXT, C_NONE, C_NONE, C_REG, 8, 4, REGSB}, + Optab{AMOVW, C_SEXT, C_NONE, C_NONE, C_REG, 8, 4, REGSB}, + Optab{AMOVWZ, C_SEXT, C_NONE, C_NONE, C_REG, 8, 4, REGSB}, + Optab{AMOVBZ, C_SEXT, C_NONE, C_NONE, C_REG, 8, 4, REGSB}, + Optab{AMOVB, C_SEXT, C_NONE, C_NONE, C_REG, 9, 8, REGSB}, + Optab{AMOVD, C_SAUTO, C_NONE, C_NONE, C_REG, 8, 4, REGSP}, + Optab{AMOVW, C_SAUTO, C_NONE, C_NONE, C_REG, 8, 4, REGSP}, + Optab{AMOVWZ, C_SAUTO, C_NONE, C_NONE, C_REG, 8, 4, REGSP}, + Optab{AMOVBZ, C_SAUTO, C_NONE, C_NONE, C_REG, 8, 4, REGSP}, + Optab{AMOVB, C_SAUTO, C_NONE, C_NONE, C_REG, 9, 8, REGSP}, + Optab{AMOVD, C_SOREG, C_NONE, C_NONE, C_REG, 8, 4, REGZERO}, + Optab{AMOVW, C_SOREG, C_NONE, C_NONE, C_REG, 8, 4, REGZERO}, + Optab{AMOVWZ, C_SOREG, C_NONE, C_NONE, C_REG, 8, 4, REGZERO}, + Optab{AMOVBZ, C_SOREG, C_NONE, C_NONE, C_REG, 8, 4, REGZERO}, + Optab{AMOVBZU, C_SOREG, C_NONE, C_NONE, C_REG, 8, 4, REGZERO}, + Optab{AMOVB, C_SOREG, C_NONE, C_NONE, C_REG, 9, 8, REGZERO}, + Optab{AMOVBU, C_SOREG, C_NONE, C_NONE, C_REG, 9, 8, REGZERO}, + + /* store, long offset */ + Optab{AMOVD, C_REG, C_NONE, C_NONE, C_LEXT, 35, 8, REGSB}, + Optab{AMOVW, C_REG, C_NONE, C_NONE, C_LEXT, 35, 8, REGSB}, + Optab{AMOVWZ, C_REG, C_NONE, C_NONE, C_LEXT, 35, 8, REGSB}, + Optab{AMOVBZ, C_REG, C_NONE, C_NONE, C_LEXT, 35, 8, REGSB}, + Optab{AMOVB, C_REG, C_NONE, C_NONE, C_LEXT, 35, 8, REGSB}, + Optab{AMOVD, C_REG, C_NONE, C_NONE, C_LAUTO, 35, 8, REGSP}, + Optab{AMOVW, C_REG, C_NONE, C_NONE, C_LAUTO, 35, 8, REGSP}, + Optab{AMOVWZ, C_REG, C_NONE, C_NONE, C_LAUTO, 35, 8, REGSP}, + Optab{AMOVBZ, C_REG, C_NONE, C_NONE, C_LAUTO, 35, 8, REGSP}, + Optab{AMOVB, C_REG, C_NONE, C_NONE, C_LAUTO, 35, 8, REGSP}, + Optab{AMOVD, C_REG, C_NONE, C_NONE, C_LOREG, 35, 8, REGZERO}, + Optab{AMOVW, C_REG, C_NONE, C_NONE, C_LOREG, 35, 8, REGZERO}, + Optab{AMOVWZ, C_REG, C_NONE, C_NONE, C_LOREG, 35, 8, REGZERO}, + Optab{AMOVBZ, C_REG, C_NONE, C_NONE, C_LOREG, 35, 8, REGZERO}, + Optab{AMOVB, C_REG, C_NONE, C_NONE, C_LOREG, 35, 8, REGZERO}, + Optab{AMOVD, C_REG, C_NONE, C_NONE, C_ADDR, 74, 8, 0}, + Optab{AMOVW, C_REG, C_NONE, C_NONE, C_ADDR, 74, 8, 0}, + Optab{AMOVWZ, C_REG, C_NONE, C_NONE, C_ADDR, 74, 8, 0}, + Optab{AMOVBZ, C_REG, C_NONE, C_NONE, C_ADDR, 74, 8, 0}, + Optab{AMOVB, C_REG, C_NONE, C_NONE, C_ADDR, 74, 8, 0}, + + /* load, long offset */ + Optab{AMOVD, C_LEXT, C_NONE, C_NONE, C_REG, 36, 8, REGSB}, + Optab{AMOVW, C_LEXT, C_NONE, C_NONE, C_REG, 36, 8, REGSB}, + Optab{AMOVWZ, C_LEXT, C_NONE, C_NONE, C_REG, 36, 8, REGSB}, + Optab{AMOVBZ, C_LEXT, C_NONE, C_NONE, C_REG, 36, 8, REGSB}, + Optab{AMOVB, C_LEXT, C_NONE, C_NONE, C_REG, 37, 12, REGSB}, + Optab{AMOVD, C_LAUTO, C_NONE, C_NONE, C_REG, 36, 8, REGSP}, + Optab{AMOVW, C_LAUTO, C_NONE, C_NONE, C_REG, 36, 8, REGSP}, + Optab{AMOVWZ, C_LAUTO, C_NONE, C_NONE, C_REG, 36, 8, REGSP}, + Optab{AMOVBZ, C_LAUTO, C_NONE, C_NONE, C_REG, 36, 8, REGSP}, + Optab{AMOVB, C_LAUTO, C_NONE, C_NONE, C_REG, 37, 12, REGSP}, + Optab{AMOVD, C_LOREG, C_NONE, C_NONE, C_REG, 36, 8, REGZERO}, + Optab{AMOVW, C_LOREG, C_NONE, C_NONE, C_REG, 36, 8, REGZERO}, + Optab{AMOVWZ, C_LOREG, C_NONE, C_NONE, C_REG, 36, 8, REGZERO}, + Optab{AMOVBZ, C_LOREG, C_NONE, C_NONE, C_REG, 36, 8, REGZERO}, + Optab{AMOVB, C_LOREG, C_NONE, C_NONE, C_REG, 37, 12, REGZERO}, + Optab{AMOVD, C_ADDR, C_NONE, C_NONE, C_REG, 75, 8, 0}, + Optab{AMOVW, C_ADDR, C_NONE, C_NONE, C_REG, 75, 8, 0}, + Optab{AMOVWZ, C_ADDR, C_NONE, C_NONE, C_REG, 75, 8, 0}, + Optab{AMOVBZ, C_ADDR, C_NONE, C_NONE, C_REG, 75, 8, 0}, + Optab{AMOVB, C_ADDR, C_NONE, C_NONE, C_REG, 76, 12, 0}, + + /* load constant */ + Optab{AMOVD, C_SECON, C_NONE, C_NONE, C_REG, 3, 4, REGSB}, + Optab{AMOVD, C_SACON, C_NONE, C_NONE, C_REG, 3, 4, REGSP}, + Optab{AMOVD, C_LECON, C_NONE, C_NONE, C_REG, 26, 8, REGSB}, + Optab{AMOVD, C_LACON, C_NONE, C_NONE, C_REG, 26, 8, REGSP}, + Optab{AMOVD, C_ADDCON, C_NONE, C_NONE, C_REG, 3, 4, REGZERO}, + Optab{AMOVW, C_SECON, C_NONE, C_NONE, C_REG, 3, 4, REGSB}, /* TO DO: check */ + Optab{AMOVW, C_SACON, C_NONE, C_NONE, C_REG, 3, 4, REGSP}, + Optab{AMOVW, C_LECON, C_NONE, C_NONE, C_REG, 26, 8, REGSB}, + Optab{AMOVW, C_LACON, C_NONE, C_NONE, C_REG, 26, 8, REGSP}, + Optab{AMOVW, C_ADDCON, C_NONE, C_NONE, C_REG, 3, 4, REGZERO}, + Optab{AMOVWZ, C_SECON, C_NONE, C_NONE, C_REG, 3, 4, REGSB}, /* TO DO: check */ + Optab{AMOVWZ, C_SACON, C_NONE, C_NONE, C_REG, 3, 4, REGSP}, + Optab{AMOVWZ, C_LECON, C_NONE, C_NONE, C_REG, 26, 8, REGSB}, + Optab{AMOVWZ, C_LACON, C_NONE, C_NONE, C_REG, 26, 8, REGSP}, + Optab{AMOVWZ, C_ADDCON, C_NONE, C_NONE, C_REG, 3, 4, REGZERO}, + + /* load unsigned/long constants (TO DO: check) */ + Optab{AMOVD, C_UCON, C_NONE, C_NONE, C_REG, 3, 4, REGZERO}, + Optab{AMOVD, C_LCON, C_NONE, C_NONE, C_REG, 19, 8, 0}, + Optab{AMOVW, C_UCON, C_NONE, C_NONE, C_REG, 3, 4, REGZERO}, + Optab{AMOVW, C_LCON, C_NONE, C_NONE, C_REG, 19, 8, 0}, + Optab{AMOVWZ, C_UCON, C_NONE, C_NONE, C_REG, 3, 4, REGZERO}, + Optab{AMOVWZ, C_LCON, C_NONE, C_NONE, C_REG, 19, 8, 0}, + Optab{AMOVHBR, C_ZOREG, C_REG, C_NONE, C_REG, 45, 4, 0}, + Optab{AMOVHBR, C_ZOREG, C_NONE, C_NONE, C_REG, 45, 4, 0}, + Optab{AMOVHBR, C_REG, C_REG, C_NONE, C_ZOREG, 44, 4, 0}, + Optab{AMOVHBR, C_REG, C_NONE, C_NONE, C_ZOREG, 44, 4, 0}, + Optab{ASYSCALL, C_NONE, C_NONE, C_NONE, C_NONE, 5, 4, 0}, + Optab{ASYSCALL, C_REG, C_NONE, C_NONE, C_NONE, 77, 12, 0}, + Optab{ASYSCALL, C_SCON, C_NONE, C_NONE, C_NONE, 77, 12, 0}, + Optab{ABEQ, C_NONE, C_NONE, C_NONE, C_SBRA, 16, 4, 0}, + Optab{ABEQ, C_CREG, C_NONE, C_NONE, C_SBRA, 16, 4, 0}, + Optab{ABR, C_NONE, C_NONE, C_NONE, C_LBRA, 11, 4, 0}, + Optab{ABC, C_SCON, C_REG, C_NONE, C_SBRA, 16, 4, 0}, + Optab{ABC, C_SCON, C_REG, C_NONE, C_LBRA, 17, 4, 0}, + Optab{ABR, C_NONE, C_NONE, C_NONE, C_LR, 18, 4, 0}, + Optab{ABR, C_NONE, C_NONE, C_NONE, C_CTR, 18, 4, 0}, + Optab{ABR, C_REG, C_NONE, C_NONE, C_CTR, 18, 4, 0}, + Optab{ABR, C_NONE, C_NONE, C_NONE, C_ZOREG, 15, 8, 0}, + Optab{ABC, C_NONE, C_REG, C_NONE, C_LR, 18, 4, 0}, + Optab{ABC, C_NONE, C_REG, C_NONE, C_CTR, 18, 4, 0}, + Optab{ABC, C_SCON, C_REG, C_NONE, C_LR, 18, 4, 0}, + Optab{ABC, C_SCON, C_REG, C_NONE, C_CTR, 18, 4, 0}, + Optab{ABC, C_NONE, C_NONE, C_NONE, C_ZOREG, 15, 8, 0}, + Optab{AFMOVD, C_SEXT, C_NONE, C_NONE, C_FREG, 8, 4, REGSB}, + Optab{AFMOVD, C_SAUTO, C_NONE, C_NONE, C_FREG, 8, 4, REGSP}, + Optab{AFMOVD, C_SOREG, C_NONE, C_NONE, C_FREG, 8, 4, REGZERO}, + Optab{AFMOVD, C_LEXT, C_NONE, C_NONE, C_FREG, 36, 8, REGSB}, + Optab{AFMOVD, C_LAUTO, C_NONE, C_NONE, C_FREG, 36, 8, REGSP}, + Optab{AFMOVD, C_LOREG, C_NONE, C_NONE, C_FREG, 36, 8, REGZERO}, + Optab{AFMOVD, C_ADDR, C_NONE, C_NONE, C_FREG, 75, 8, 0}, + Optab{AFMOVD, C_FREG, C_NONE, C_NONE, C_SEXT, 7, 4, REGSB}, + Optab{AFMOVD, C_FREG, C_NONE, C_NONE, C_SAUTO, 7, 4, REGSP}, + Optab{AFMOVD, C_FREG, C_NONE, C_NONE, C_SOREG, 7, 4, REGZERO}, + Optab{AFMOVD, C_FREG, C_NONE, C_NONE, C_LEXT, 35, 8, REGSB}, + Optab{AFMOVD, C_FREG, C_NONE, C_NONE, C_LAUTO, 35, 8, REGSP}, + Optab{AFMOVD, C_FREG, C_NONE, C_NONE, C_LOREG, 35, 8, REGZERO}, + Optab{AFMOVD, C_FREG, C_NONE, C_NONE, C_ADDR, 74, 8, 0}, + Optab{ASYNC, C_NONE, C_NONE, C_NONE, C_NONE, 46, 4, 0}, + Optab{AWORD, C_LCON, C_NONE, C_NONE, C_NONE, 40, 4, 0}, + Optab{ADWORD, C_LCON, C_NONE, C_NONE, C_NONE, 31, 8, 0}, + Optab{ADWORD, C_DCON, C_NONE, C_NONE, C_NONE, 31, 8, 0}, + Optab{AADDME, C_REG, C_NONE, C_NONE, C_REG, 47, 4, 0}, + Optab{AEXTSB, C_REG, C_NONE, C_NONE, C_REG, 48, 4, 0}, + Optab{AEXTSB, C_NONE, C_NONE, C_NONE, C_REG, 48, 4, 0}, + Optab{ANEG, C_REG, C_NONE, C_NONE, C_REG, 47, 4, 0}, + Optab{ANEG, C_NONE, C_NONE, C_NONE, C_REG, 47, 4, 0}, + Optab{AREM, C_REG, C_NONE, C_NONE, C_REG, 50, 12, 0}, + Optab{AREM, C_REG, C_REG, C_NONE, C_REG, 50, 12, 0}, + Optab{AREMU, C_REG, C_NONE, C_NONE, C_REG, 50, 16, 0}, + Optab{AREMU, C_REG, C_REG, C_NONE, C_REG, 50, 16, 0}, + Optab{AREMD, C_REG, C_NONE, C_NONE, C_REG, 51, 12, 0}, + Optab{AREMD, C_REG, C_REG, C_NONE, C_REG, 51, 12, 0}, + Optab{AREMDU, C_REG, C_NONE, C_NONE, C_REG, 51, 12, 0}, + Optab{AREMDU, C_REG, C_REG, C_NONE, C_REG, 51, 12, 0}, + Optab{AMTFSB0, C_SCON, C_NONE, C_NONE, C_NONE, 52, 4, 0}, + Optab{AMOVFL, C_FPSCR, C_NONE, C_NONE, C_FREG, 53, 4, 0}, + Optab{AMOVFL, C_FREG, C_NONE, C_NONE, C_FPSCR, 64, 4, 0}, + Optab{AMOVFL, C_FREG, C_NONE, C_LCON, C_FPSCR, 64, 4, 0}, + Optab{AMOVFL, C_LCON, C_NONE, C_NONE, C_FPSCR, 65, 4, 0}, + Optab{AMOVD, C_MSR, C_NONE, C_NONE, C_REG, 54, 4, 0}, /* mfmsr */ + Optab{AMOVD, C_REG, C_NONE, C_NONE, C_MSR, 54, 4, 0}, /* mtmsrd */ + Optab{AMOVWZ, C_REG, C_NONE, C_NONE, C_MSR, 54, 4, 0}, /* mtmsr */ + + /* 64-bit special registers */ + Optab{AMOVD, C_REG, C_NONE, C_NONE, C_SPR, 66, 4, 0}, + Optab{AMOVD, C_REG, C_NONE, C_NONE, C_LR, 66, 4, 0}, + Optab{AMOVD, C_REG, C_NONE, C_NONE, C_CTR, 66, 4, 0}, + Optab{AMOVD, C_REG, C_NONE, C_NONE, C_XER, 66, 4, 0}, + Optab{AMOVD, C_SPR, C_NONE, C_NONE, C_REG, 66, 4, 0}, + Optab{AMOVD, C_LR, C_NONE, C_NONE, C_REG, 66, 4, 0}, + Optab{AMOVD, C_CTR, C_NONE, C_NONE, C_REG, 66, 4, 0}, + Optab{AMOVD, C_XER, C_NONE, C_NONE, C_REG, 66, 4, 0}, + + /* 32-bit special registers (gloss over sign-extension or not?) */ + Optab{AMOVW, C_REG, C_NONE, C_NONE, C_SPR, 66, 4, 0}, + Optab{AMOVW, C_REG, C_NONE, C_NONE, C_CTR, 66, 4, 0}, + Optab{AMOVW, C_REG, C_NONE, C_NONE, C_XER, 66, 4, 0}, + Optab{AMOVW, C_SPR, C_NONE, C_NONE, C_REG, 66, 4, 0}, + Optab{AMOVW, C_XER, C_NONE, C_NONE, C_REG, 66, 4, 0}, + Optab{AMOVWZ, C_REG, C_NONE, C_NONE, C_SPR, 66, 4, 0}, + Optab{AMOVWZ, C_REG, C_NONE, C_NONE, C_CTR, 66, 4, 0}, + Optab{AMOVWZ, C_REG, C_NONE, C_NONE, C_XER, 66, 4, 0}, + Optab{AMOVWZ, C_SPR, C_NONE, C_NONE, C_REG, 66, 4, 0}, + Optab{AMOVWZ, C_XER, C_NONE, C_NONE, C_REG, 66, 4, 0}, + Optab{AMOVFL, C_FPSCR, C_NONE, C_NONE, C_CREG, 73, 4, 0}, + Optab{AMOVFL, C_CREG, C_NONE, C_NONE, C_CREG, 67, 4, 0}, + Optab{AMOVW, C_CREG, C_NONE, C_NONE, C_REG, 68, 4, 0}, + Optab{AMOVWZ, C_CREG, C_NONE, C_NONE, C_REG, 68, 4, 0}, + Optab{AMOVFL, C_REG, C_NONE, C_LCON, C_CREG, 69, 4, 0}, + Optab{AMOVFL, C_REG, C_NONE, C_NONE, C_CREG, 69, 4, 0}, + Optab{AMOVW, C_REG, C_NONE, C_NONE, C_CREG, 69, 4, 0}, + Optab{AMOVWZ, C_REG, C_NONE, C_NONE, C_CREG, 69, 4, 0}, + Optab{ACMP, C_REG, C_NONE, C_NONE, C_REG, 70, 4, 0}, + Optab{ACMP, C_REG, C_REG, C_NONE, C_REG, 70, 4, 0}, + Optab{ACMP, C_REG, C_NONE, C_NONE, C_ADDCON, 71, 4, 0}, + Optab{ACMP, C_REG, C_REG, C_NONE, C_ADDCON, 71, 4, 0}, + Optab{ACMPU, C_REG, C_NONE, C_NONE, C_REG, 70, 4, 0}, + Optab{ACMPU, C_REG, C_REG, C_NONE, C_REG, 70, 4, 0}, + Optab{ACMPU, C_REG, C_NONE, C_NONE, C_ANDCON, 71, 4, 0}, + Optab{ACMPU, C_REG, C_REG, C_NONE, C_ANDCON, 71, 4, 0}, + Optab{AFCMPO, C_FREG, C_NONE, C_NONE, C_FREG, 70, 4, 0}, + Optab{AFCMPO, C_FREG, C_REG, C_NONE, C_FREG, 70, 4, 0}, + Optab{ATW, C_LCON, C_REG, C_NONE, C_REG, 60, 4, 0}, + Optab{ATW, C_LCON, C_REG, C_NONE, C_ADDCON, 61, 4, 0}, + Optab{ADCBF, C_ZOREG, C_NONE, C_NONE, C_NONE, 43, 4, 0}, + Optab{ADCBF, C_ZOREG, C_REG, C_NONE, C_NONE, 43, 4, 0}, + Optab{AECOWX, C_REG, C_REG, C_NONE, C_ZOREG, 44, 4, 0}, + Optab{AECIWX, C_ZOREG, C_REG, C_NONE, C_REG, 45, 4, 0}, + Optab{AECOWX, C_REG, C_NONE, C_NONE, C_ZOREG, 44, 4, 0}, + Optab{AECIWX, C_ZOREG, C_NONE, C_NONE, C_REG, 45, 4, 0}, + Optab{AEIEIO, C_NONE, C_NONE, C_NONE, C_NONE, 46, 4, 0}, + Optab{ATLBIE, C_REG, C_NONE, C_NONE, C_NONE, 49, 4, 0}, + Optab{ATLBIE, C_SCON, C_NONE, C_NONE, C_REG, 49, 4, 0}, + Optab{ASLBMFEE, C_REG, C_NONE, C_NONE, C_REG, 55, 4, 0}, + Optab{ASLBMTE, C_REG, C_NONE, C_NONE, C_REG, 55, 4, 0}, + Optab{ASTSW, C_REG, C_NONE, C_NONE, C_ZOREG, 44, 4, 0}, + Optab{ASTSW, C_REG, C_NONE, C_LCON, C_ZOREG, 41, 4, 0}, + Optab{ALSW, C_ZOREG, C_NONE, C_NONE, C_REG, 45, 4, 0}, + Optab{ALSW, C_ZOREG, C_NONE, C_LCON, C_REG, 42, 4, 0}, + Optab{obj.AUNDEF, C_NONE, C_NONE, C_NONE, C_NONE, 78, 4, 0}, + Optab{obj.AUSEFIELD, C_ADDR, C_NONE, C_NONE, C_NONE, 0, 0, 0}, + Optab{obj.APCDATA, C_LCON, C_NONE, C_NONE, C_LCON, 0, 0, 0}, + Optab{obj.AFUNCDATA, C_SCON, C_NONE, C_NONE, C_ADDR, 0, 0, 0}, + Optab{obj.ANOP, C_NONE, C_NONE, C_NONE, C_NONE, 0, 0, 0}, + Optab{obj.ADUFFZERO, C_NONE, C_NONE, C_NONE, C_LBRA, 11, 4, 0}, // same as ABR/ABL + Optab{obj.ADUFFCOPY, C_NONE, C_NONE, C_NONE, C_LBRA, 11, 4, 0}, // same as ABR/ABL + + Optab{obj.AXXX, C_NONE, C_NONE, C_NONE, C_NONE, 0, 4, 0}, +} + +type Oprang struct { + start []Optab + stop []Optab +} + +var oprange [ALAST & obj.AMask]Oprang + +var xcmp [C_NCLASS][C_NCLASS]uint8 + +func span9(ctxt *obj.Link, cursym *obj.LSym) { + p := cursym.Text + if p == nil || p.Link == nil { // handle external functions and ELF section symbols + return + } + ctxt.Cursym = cursym + ctxt.Autosize = int32(p.To.Offset + 8) + + if oprange[AANDN&obj.AMask].start == nil { + buildop(ctxt) + } + + c := int64(0) + p.Pc = c + + var m int + var o *Optab + for p = p.Link; p != nil; p = p.Link { + ctxt.Curp = p + p.Pc = c + o = oplook(ctxt, p) + m = int(o.size) + if m == 0 { + if p.As != obj.ANOP && p.As != obj.AFUNCDATA && p.As != obj.APCDATA { + ctxt.Diag("zero-width instruction\n%v", p) + } + continue + } + + c += int64(m) + } + + cursym.Size = c + + /* + * if any procedure is large enough to + * generate a large SBRA branch, then + * generate extra passes putting branches + * around jmps to fix. this is rare. + */ + bflag := 1 + + var otxt int64 + var q *obj.Prog + for bflag != 0 { + if ctxt.Debugvlog != 0 { + fmt.Fprintf(ctxt.Bso, "%5.2f span1\n", obj.Cputime()) + } + bflag = 0 + c = 0 + for p = cursym.Text.Link; p != nil; p = p.Link { + p.Pc = c + o = oplook(ctxt, p) + + // very large conditional branches + if (o.type_ == 16 || o.type_ == 17) && p.Pcond != nil { + otxt = p.Pcond.Pc - c + if otxt < -(1<<15)+10 || otxt >= (1<<15)-10 { + q = ctxt.NewProg() + q.Link = p.Link + p.Link = q + q.As = ABR + q.To.Type = obj.TYPE_BRANCH + q.Pcond = p.Pcond + p.Pcond = q + q = ctxt.NewProg() + q.Link = p.Link + p.Link = q + q.As = ABR + q.To.Type = obj.TYPE_BRANCH + q.Pcond = q.Link.Link + + //addnop(p->link); + //addnop(p); + bflag = 1 + } + } + + m = int(o.size) + if m == 0 { + if p.As != obj.ANOP && p.As != obj.AFUNCDATA && p.As != obj.APCDATA { + ctxt.Diag("zero-width instruction\n%v", p) + } + continue + } + + c += int64(m) + } + + cursym.Size = c + } + + c += -c & (FuncAlign - 1) + cursym.Size = c + + /* + * lay out the code, emitting code and data relocations. + */ + if ctxt.Tlsg == nil { + ctxt.Tlsg = obj.Linklookup(ctxt, "runtime.tlsg", 0) + } + + obj.Symgrow(ctxt, cursym, cursym.Size) + + bp := cursym.P + var i int32 + var out [6]uint32 + for p := cursym.Text.Link; p != nil; p = p.Link { + ctxt.Pc = p.Pc + ctxt.Curp = p + o = oplook(ctxt, p) + if int(o.size) > 4*len(out) { + log.Fatalf("out array in span9 is too small, need at least %d for %v", o.size/4, p) + } + asmout(ctxt, p, o, out[:]) + for i = 0; i < int32(o.size/4); i++ { + ctxt.Arch.ByteOrder.PutUint32(bp, out[i]) + bp = bp[4:] + } + } +} + +func isint32(v int64) bool { + return int64(int32(v)) == v +} + +func isuint32(v uint64) bool { + return uint64(uint32(v)) == v +} + +func aclass(ctxt *obj.Link, a *obj.Addr) int { + switch a.Type { + case obj.TYPE_NONE: + return C_NONE + + case obj.TYPE_REG: + if REG_R0 <= a.Reg && a.Reg <= REG_R31 { + return C_REG + } + if REG_F0 <= a.Reg && a.Reg <= REG_F31 { + return C_FREG + } + if REG_CR0 <= a.Reg && a.Reg <= REG_CR7 || a.Reg == REG_CR { + return C_CREG + } + if REG_SPR0 <= a.Reg && a.Reg <= REG_SPR0+1023 { + switch a.Reg { + case REG_LR: + return C_LR + + case REG_XER: + return C_XER + + case REG_CTR: + return C_CTR + } + + return C_SPR + } + + if REG_DCR0 <= a.Reg && a.Reg <= REG_DCR0+1023 { + return C_SPR + } + if a.Reg == REG_FPSCR { + return C_FPSCR + } + if a.Reg == REG_MSR { + return C_MSR + } + return C_GOK + + case obj.TYPE_MEM: + switch a.Name { + case obj.NAME_EXTERN, + obj.NAME_STATIC: + if a.Sym == nil { + break + } + ctxt.Instoffset = a.Offset + if a.Sym != nil { // use relocation + return C_ADDR + } + return C_LEXT + + case obj.NAME_AUTO: + ctxt.Instoffset = int64(ctxt.Autosize) + a.Offset + if ctxt.Instoffset >= -BIG && ctxt.Instoffset < BIG { + return C_SAUTO + } + return C_LAUTO + + case obj.NAME_PARAM: + ctxt.Instoffset = int64(ctxt.Autosize) + a.Offset + 8 + if ctxt.Instoffset >= -BIG && ctxt.Instoffset < BIG { + return C_SAUTO + } + return C_LAUTO + + case obj.NAME_NONE: + ctxt.Instoffset = a.Offset + if ctxt.Instoffset == 0 { + return C_ZOREG + } + if ctxt.Instoffset >= -BIG && ctxt.Instoffset < BIG { + return C_SOREG + } + return C_LOREG + } + + return C_GOK + + case obj.TYPE_TEXTSIZE: + return C_TEXTSIZE + + case obj.TYPE_CONST, + obj.TYPE_ADDR: + switch a.Name { + case obj.TYPE_NONE: + ctxt.Instoffset = a.Offset + if a.Reg != 0 { + if -BIG <= ctxt.Instoffset && ctxt.Instoffset <= BIG { + return C_SACON + } + if isint32(ctxt.Instoffset) { + return C_LACON + } + return C_DACON + } + + goto consize + + case obj.NAME_EXTERN, + obj.NAME_STATIC: + s := a.Sym + if s == nil { + break + } + if s.Type == obj.SCONST { + ctxt.Instoffset = s.Value + a.Offset + goto consize + } + + ctxt.Instoffset = s.Value + a.Offset + + /* not sure why this barfs */ + return C_LCON + + case obj.NAME_AUTO: + ctxt.Instoffset = int64(ctxt.Autosize) + a.Offset + if ctxt.Instoffset >= -BIG && ctxt.Instoffset < BIG { + return C_SACON + } + return C_LACON + + case obj.NAME_PARAM: + ctxt.Instoffset = int64(ctxt.Autosize) + a.Offset + 8 + if ctxt.Instoffset >= -BIG && ctxt.Instoffset < BIG { + return C_SACON + } + return C_LACON + } + + return C_GOK + + consize: + if ctxt.Instoffset >= 0 { + if ctxt.Instoffset == 0 { + return C_ZCON + } + if ctxt.Instoffset <= 0x7fff { + return C_SCON + } + if ctxt.Instoffset <= 0xffff { + return C_ANDCON + } + if ctxt.Instoffset&0xffff == 0 && isuint32(uint64(ctxt.Instoffset)) { /* && (instoffset & (1<<31)) == 0) */ + return C_UCON + } + if isint32(ctxt.Instoffset) || isuint32(uint64(ctxt.Instoffset)) { + return C_LCON + } + return C_DCON + } + + if ctxt.Instoffset >= -0x8000 { + return C_ADDCON + } + if ctxt.Instoffset&0xffff == 0 && isint32(ctxt.Instoffset) { + return C_UCON + } + if isint32(ctxt.Instoffset) { + return C_LCON + } + return C_DCON + + case obj.TYPE_BRANCH: + return C_SBRA + } + + return C_GOK +} + +func prasm(p *obj.Prog) { + fmt.Printf("%v\n", p) +} + +func oplook(ctxt *obj.Link, p *obj.Prog) *Optab { + a1 := int(p.Optab) + if a1 != 0 { + return &optab[a1-1:][0] + } + a1 = int(p.From.Class) + if a1 == 0 { + a1 = aclass(ctxt, &p.From) + 1 + p.From.Class = int8(a1) + } + + a1-- + a3 := C_NONE + 1 + if p.From3 != nil { + a3 = int(p.From3.Class) + if a3 == 0 { + a3 = aclass(ctxt, p.From3) + 1 + p.From3.Class = int8(a3) + } + } + + a3-- + a4 := int(p.To.Class) + if a4 == 0 { + a4 = aclass(ctxt, &p.To) + 1 + p.To.Class = int8(a4) + } + + a4-- + a2 := C_NONE + if p.Reg != 0 { + a2 = C_REG + } + + //print("oplook %v %d %d %d %d\n", p, a1, a2, a3, a4); + r0 := p.As & obj.AMask + + o := oprange[r0].start + if o == nil { + o = oprange[r0].stop /* just generate an error */ + } + e := oprange[r0].stop + c1 := xcmp[a1][:] + c3 := xcmp[a3][:] + c4 := xcmp[a4][:] + for ; -cap(o) < -cap(e); o = o[1:] { + if int(o[0].a2) == a2 { + if c1[o[0].a1] != 0 { + if c3[o[0].a3] != 0 { + if c4[o[0].a4] != 0 { + p.Optab = uint16((-cap(o) + cap(optab)) + 1) + return &o[0] + } + } + } + } + } + + ctxt.Diag("illegal combination %v %v %v %v %v", obj.Aconv(int(p.As)), DRconv(a1), DRconv(a2), DRconv(a3), DRconv(a4)) + prasm(p) + if o == nil { + o = optab + } + return &o[0] +} + +func cmp(a int, b int) bool { + if a == b { + return true + } + switch a { + case C_LCON: + if b == C_ZCON || b == C_SCON || b == C_UCON || b == C_ADDCON || b == C_ANDCON { + return true + } + + case C_ADDCON: + if b == C_ZCON || b == C_SCON { + return true + } + + case C_ANDCON: + if b == C_ZCON || b == C_SCON { + return true + } + + case C_SPR: + if b == C_LR || b == C_XER || b == C_CTR { + return true + } + + case C_UCON: + if b == C_ZCON { + return true + } + + case C_SCON: + if b == C_ZCON { + return true + } + + case C_LACON: + if b == C_SACON { + return true + } + + case C_LBRA: + if b == C_SBRA { + return true + } + + case C_LEXT: + if b == C_SEXT { + return true + } + + case C_LAUTO: + if b == C_SAUTO { + return true + } + + case C_REG: + if b == C_ZCON { + return r0iszero != 0 /*TypeKind(100016)*/ + } + + case C_LOREG: + if b == C_ZOREG || b == C_SOREG { + return true + } + + case C_SOREG: + if b == C_ZOREG { + return true + } + + case C_ANY: + return true + } + + return false +} + +type ocmp []Optab + +func (x ocmp) Len() int { + return len(x) +} + +func (x ocmp) Swap(i, j int) { + x[i], x[j] = x[j], x[i] +} + +func (x ocmp) Less(i, j int) bool { + p1 := &x[i] + p2 := &x[j] + n := int(p1.as) - int(p2.as) + if n != 0 { + return n < 0 + } + n = int(p1.a1) - int(p2.a1) + if n != 0 { + return n < 0 + } + n = int(p1.a2) - int(p2.a2) + if n != 0 { + return n < 0 + } + n = int(p1.a3) - int(p2.a3) + if n != 0 { + return n < 0 + } + n = int(p1.a4) - int(p2.a4) + if n != 0 { + return n < 0 + } + return false +} +func opset(a, b0 int16) { + oprange[a&obj.AMask] = oprange[b0] +} + +func buildop(ctxt *obj.Link) { + var n int + + for i := 0; i < C_NCLASS; i++ { + for n = 0; n < C_NCLASS; n++ { + if cmp(n, i) { + xcmp[i][n] = 1 + } + } + } + for n = 0; optab[n].as != obj.AXXX; n++ { + } + sort.Sort(ocmp(optab[:n])) + for i := 0; i < n; i++ { + r := optab[i].as + r0 := r & obj.AMask + oprange[r0].start = optab[i:] + for optab[i].as == r { + i++ + } + oprange[r0].stop = optab[i:] + i-- + + switch r { + default: + ctxt.Diag("unknown op in build: %v", obj.Aconv(int(r))) + log.Fatalf("bad code") + + case ADCBF: /* unary indexed: op (b+a); op (b) */ + opset(ADCBI, r0) + + opset(ADCBST, r0) + opset(ADCBT, r0) + opset(ADCBTST, r0) + opset(ADCBZ, r0) + opset(AICBI, r0) + + case AECOWX: /* indexed store: op s,(b+a); op s,(b) */ + opset(ASTWCCC, r0) + + opset(ASTDCCC, r0) + + case AREM: /* macro */ + opset(AREMCC, r0) + + opset(AREMV, r0) + opset(AREMVCC, r0) + + case AREMU: + opset(AREMU, r0) + opset(AREMUCC, r0) + opset(AREMUV, r0) + opset(AREMUVCC, r0) + + case AREMD: + opset(AREMDCC, r0) + opset(AREMDV, r0) + opset(AREMDVCC, r0) + + case AREMDU: + opset(AREMDU, r0) + opset(AREMDUCC, r0) + opset(AREMDUV, r0) + opset(AREMDUVCC, r0) + + case ADIVW: /* op Rb[,Ra],Rd */ + opset(AMULHW, r0) + + opset(AMULHWCC, r0) + opset(AMULHWU, r0) + opset(AMULHWUCC, r0) + opset(AMULLWCC, r0) + opset(AMULLWVCC, r0) + opset(AMULLWV, r0) + opset(ADIVWCC, r0) + opset(ADIVWV, r0) + opset(ADIVWVCC, r0) + opset(ADIVWU, r0) + opset(ADIVWUCC, r0) + opset(ADIVWUV, r0) + opset(ADIVWUVCC, r0) + opset(AADDCC, r0) + opset(AADDCV, r0) + opset(AADDCVCC, r0) + opset(AADDV, r0) + opset(AADDVCC, r0) + opset(AADDE, r0) + opset(AADDECC, r0) + opset(AADDEV, r0) + opset(AADDEVCC, r0) + opset(ACRAND, r0) + opset(ACRANDN, r0) + opset(ACREQV, r0) + opset(ACRNAND, r0) + opset(ACRNOR, r0) + opset(ACROR, r0) + opset(ACRORN, r0) + opset(ACRXOR, r0) + opset(AMULHD, r0) + opset(AMULHDCC, r0) + opset(AMULHDU, r0) + opset(AMULHDUCC, r0) + opset(AMULLD, r0) + opset(AMULLDCC, r0) + opset(AMULLDVCC, r0) + opset(AMULLDV, r0) + opset(ADIVD, r0) + opset(ADIVDCC, r0) + opset(ADIVDVCC, r0) + opset(ADIVDV, r0) + opset(ADIVDU, r0) + opset(ADIVDUCC, r0) + opset(ADIVDUVCC, r0) + opset(ADIVDUCC, r0) + + case AMOVBZ: /* lbz, stz, rlwm(r/r), lhz, lha, stz, and x variants */ + opset(AMOVH, r0) + + opset(AMOVHZ, r0) + + case AMOVBZU: /* lbz[x]u, stb[x]u, lhz[x]u, lha[x]u, sth[u]x, ld[x]u, std[u]x */ + opset(AMOVHU, r0) + + opset(AMOVHZU, r0) + opset(AMOVWU, r0) + opset(AMOVWZU, r0) + opset(AMOVDU, r0) + opset(AMOVMW, r0) + + case AAND: /* logical op Rb,Rs,Ra; no literal */ + opset(AANDN, r0) + + opset(AANDNCC, r0) + opset(AEQV, r0) + opset(AEQVCC, r0) + opset(ANAND, r0) + opset(ANANDCC, r0) + opset(ANOR, r0) + opset(ANORCC, r0) + opset(AORCC, r0) + opset(AORN, r0) + opset(AORNCC, r0) + opset(AXORCC, r0) + + case AADDME: /* op Ra, Rd */ + opset(AADDMECC, r0) + + opset(AADDMEV, r0) + opset(AADDMEVCC, r0) + opset(AADDZE, r0) + opset(AADDZECC, r0) + opset(AADDZEV, r0) + opset(AADDZEVCC, r0) + opset(ASUBME, r0) + opset(ASUBMECC, r0) + opset(ASUBMEV, r0) + opset(ASUBMEVCC, r0) + opset(ASUBZE, r0) + opset(ASUBZECC, r0) + opset(ASUBZEV, r0) + opset(ASUBZEVCC, r0) + + case AADDC: + opset(AADDCCC, r0) + + case ABEQ: + opset(ABGE, r0) + opset(ABGT, r0) + opset(ABLE, r0) + opset(ABLT, r0) + opset(ABNE, r0) + opset(ABVC, r0) + opset(ABVS, r0) + + case ABR: + opset(ABL, r0) + + case ABC: + opset(ABCL, r0) + + case AEXTSB: /* op Rs, Ra */ + opset(AEXTSBCC, r0) + + opset(AEXTSH, r0) + opset(AEXTSHCC, r0) + opset(ACNTLZW, r0) + opset(ACNTLZWCC, r0) + opset(ACNTLZD, r0) + opset(AEXTSW, r0) + opset(AEXTSWCC, r0) + opset(ACNTLZDCC, r0) + + case AFABS: /* fop [s,]d */ + opset(AFABSCC, r0) + + opset(AFNABS, r0) + opset(AFNABSCC, r0) + opset(AFNEG, r0) + opset(AFNEGCC, r0) + opset(AFRSP, r0) + opset(AFRSPCC, r0) + opset(AFCTIW, r0) + opset(AFCTIWCC, r0) + opset(AFCTIWZ, r0) + opset(AFCTIWZCC, r0) + opset(AFCTID, r0) + opset(AFCTIDCC, r0) + opset(AFCTIDZ, r0) + opset(AFCTIDZCC, r0) + opset(AFCFID, r0) + opset(AFCFIDCC, r0) + opset(AFRES, r0) + opset(AFRESCC, r0) + opset(AFRSQRTE, r0) + opset(AFRSQRTECC, r0) + opset(AFSQRT, r0) + opset(AFSQRTCC, r0) + opset(AFSQRTS, r0) + opset(AFSQRTSCC, r0) + + case AFADD: + opset(AFADDS, r0) + opset(AFADDCC, r0) + opset(AFADDSCC, r0) + opset(AFDIV, r0) + opset(AFDIVS, r0) + opset(AFDIVCC, r0) + opset(AFDIVSCC, r0) + opset(AFSUB, r0) + opset(AFSUBS, r0) + opset(AFSUBCC, r0) + opset(AFSUBSCC, r0) + + case AFMADD: + opset(AFMADDCC, r0) + opset(AFMADDS, r0) + opset(AFMADDSCC, r0) + opset(AFMSUB, r0) + opset(AFMSUBCC, r0) + opset(AFMSUBS, r0) + opset(AFMSUBSCC, r0) + opset(AFNMADD, r0) + opset(AFNMADDCC, r0) + opset(AFNMADDS, r0) + opset(AFNMADDSCC, r0) + opset(AFNMSUB, r0) + opset(AFNMSUBCC, r0) + opset(AFNMSUBS, r0) + opset(AFNMSUBSCC, r0) + opset(AFSEL, r0) + opset(AFSELCC, r0) + + case AFMUL: + opset(AFMULS, r0) + opset(AFMULCC, r0) + opset(AFMULSCC, r0) + + case AFCMPO: + opset(AFCMPU, r0) + + case AMTFSB0: + opset(AMTFSB0CC, r0) + opset(AMTFSB1, r0) + opset(AMTFSB1CC, r0) + + case ANEG: /* op [Ra,] Rd */ + opset(ANEGCC, r0) + + opset(ANEGV, r0) + opset(ANEGVCC, r0) + + case AOR: /* or/xor Rb,Rs,Ra; ori/xori $uimm,Rs,Ra; oris/xoris $uimm,Rs,Ra */ + opset(AXOR, r0) + + case ASLW: + opset(ASLWCC, r0) + opset(ASRW, r0) + opset(ASRWCC, r0) + + case ASLD: + opset(ASLDCC, r0) + opset(ASRD, r0) + opset(ASRDCC, r0) + + case ASRAW: /* sraw Rb,Rs,Ra; srawi sh,Rs,Ra */ + opset(ASRAWCC, r0) + + case ASRAD: /* sraw Rb,Rs,Ra; srawi sh,Rs,Ra */ + opset(ASRADCC, r0) + + case ASUB: /* SUB Ra,Rb,Rd => subf Rd,ra,rb */ + opset(ASUB, r0) + + opset(ASUBCC, r0) + opset(ASUBV, r0) + opset(ASUBVCC, r0) + opset(ASUBCCC, r0) + opset(ASUBCV, r0) + opset(ASUBCVCC, r0) + opset(ASUBE, r0) + opset(ASUBECC, r0) + opset(ASUBEV, r0) + opset(ASUBEVCC, r0) + + case ASYNC: + opset(AISYNC, r0) + opset(APTESYNC, r0) + opset(ATLBSYNC, r0) + + case ARLWMI: + opset(ARLWMICC, r0) + opset(ARLWNM, r0) + opset(ARLWNMCC, r0) + + case ARLDMI: + opset(ARLDMICC, r0) + + case ARLDC: + opset(ARLDCCC, r0) + + case ARLDCL: + opset(ARLDCR, r0) + opset(ARLDCLCC, r0) + opset(ARLDCRCC, r0) + + case AFMOVD: + opset(AFMOVDCC, r0) + opset(AFMOVDU, r0) + opset(AFMOVS, r0) + opset(AFMOVSU, r0) + + case AECIWX: + opset(ALWAR, r0) + opset(ALDAR, r0) + + case ASYSCALL: /* just the op; flow of control */ + opset(ARFI, r0) + + opset(ARFCI, r0) + opset(ARFID, r0) + opset(AHRFID, r0) + + case AMOVHBR: + opset(AMOVWBR, r0) + + case ASLBMFEE: + opset(ASLBMFEV, r0) + + case ATW: + opset(ATD, r0) + + case ATLBIE: + opset(ASLBIE, r0) + opset(ATLBIEL, r0) + + case AEIEIO: + opset(ASLBIA, r0) + + case ACMP: + opset(ACMPW, r0) + + case ACMPU: + opset(ACMPWU, r0) + + case AADD, + AANDCC, /* and. Rb,Rs,Ra; andi. $uimm,Rs,Ra; andis. $uimm,Rs,Ra */ + ALSW, + AMOVW, + /* load/store/move word with sign extension; special 32-bit move; move 32-bit literals */ + AMOVWZ, /* load/store/move word with zero extension; move 32-bit literals */ + AMOVD, /* load/store/move 64-bit values, including 32-bit literals with/without sign-extension */ + AMOVB, /* macro: move byte with sign extension */ + AMOVBU, /* macro: move byte with sign extension & update */ + AMOVFL, + AMULLW, + /* op $s[,r2],r3; op r1[,r2],r3; no cc/v */ + ASUBC, /* op r1,$s,r3; op r1[,r2],r3 */ + ASTSW, + ASLBMTE, + AWORD, + ADWORD, + obj.ANOP, + obj.ATEXT, + obj.AUNDEF, + obj.AUSEFIELD, + obj.AFUNCDATA, + obj.APCDATA, + obj.ADUFFZERO, + obj.ADUFFCOPY: + break + } + } +} + +func OPVCC(o uint32, xo uint32, oe uint32, rc uint32) uint32 { + return o<<26 | xo<<1 | oe<<10 | rc&1 +} + +func OPCC(o uint32, xo uint32, rc uint32) uint32 { + return OPVCC(o, xo, 0, rc) +} + +func OP(o uint32, xo uint32) uint32 { + return OPVCC(o, xo, 0, 0) +} + +/* the order is dest, a/s, b/imm for both arithmetic and logical operations */ +func AOP_RRR(op uint32, d uint32, a uint32, b uint32) uint32 { + return op | (d&31)<<21 | (a&31)<<16 | (b&31)<<11 +} + +func AOP_IRR(op uint32, d uint32, a uint32, simm uint32) uint32 { + return op | (d&31)<<21 | (a&31)<<16 | simm&0xFFFF +} + +func LOP_RRR(op uint32, a uint32, s uint32, b uint32) uint32 { + return op | (s&31)<<21 | (a&31)<<16 | (b&31)<<11 +} + +func LOP_IRR(op uint32, a uint32, s uint32, uimm uint32) uint32 { + return op | (s&31)<<21 | (a&31)<<16 | uimm&0xFFFF +} + +func OP_BR(op uint32, li uint32, aa uint32) uint32 { + return op | li&0x03FFFFFC | aa<<1 +} + +func OP_BC(op uint32, bo uint32, bi uint32, bd uint32, aa uint32) uint32 { + return op | (bo&0x1F)<<21 | (bi&0x1F)<<16 | bd&0xFFFC | aa<<1 +} + +func OP_BCR(op uint32, bo uint32, bi uint32) uint32 { + return op | (bo&0x1F)<<21 | (bi&0x1F)<<16 +} + +func OP_RLW(op uint32, a uint32, s uint32, sh uint32, mb uint32, me uint32) uint32 { + return op | (s&31)<<21 | (a&31)<<16 | (sh&31)<<11 | (mb&31)<<6 | (me&31)<<1 +} + +const ( + /* each rhs is OPVCC(_, _, _, _) */ + OP_ADD = 31<<26 | 266<<1 | 0<<10 | 0 + OP_ADDI = 14<<26 | 0<<1 | 0<<10 | 0 + OP_ADDIS = 15<<26 | 0<<1 | 0<<10 | 0 + OP_ANDI = 28<<26 | 0<<1 | 0<<10 | 0 + OP_EXTSB = 31<<26 | 954<<1 | 0<<10 | 0 + OP_EXTSH = 31<<26 | 922<<1 | 0<<10 | 0 + OP_EXTSW = 31<<26 | 986<<1 | 0<<10 | 0 + OP_MCRF = 19<<26 | 0<<1 | 0<<10 | 0 + OP_MCRFS = 63<<26 | 64<<1 | 0<<10 | 0 + OP_MCRXR = 31<<26 | 512<<1 | 0<<10 | 0 + OP_MFCR = 31<<26 | 19<<1 | 0<<10 | 0 + OP_MFFS = 63<<26 | 583<<1 | 0<<10 | 0 + OP_MFMSR = 31<<26 | 83<<1 | 0<<10 | 0 + OP_MFSPR = 31<<26 | 339<<1 | 0<<10 | 0 + OP_MFSR = 31<<26 | 595<<1 | 0<<10 | 0 + OP_MFSRIN = 31<<26 | 659<<1 | 0<<10 | 0 + OP_MTCRF = 31<<26 | 144<<1 | 0<<10 | 0 + OP_MTFSF = 63<<26 | 711<<1 | 0<<10 | 0 + OP_MTFSFI = 63<<26 | 134<<1 | 0<<10 | 0 + OP_MTMSR = 31<<26 | 146<<1 | 0<<10 | 0 + OP_MTMSRD = 31<<26 | 178<<1 | 0<<10 | 0 + OP_MTSPR = 31<<26 | 467<<1 | 0<<10 | 0 + OP_MTSR = 31<<26 | 210<<1 | 0<<10 | 0 + OP_MTSRIN = 31<<26 | 242<<1 | 0<<10 | 0 + OP_MULLW = 31<<26 | 235<<1 | 0<<10 | 0 + OP_MULLD = 31<<26 | 233<<1 | 0<<10 | 0 + OP_OR = 31<<26 | 444<<1 | 0<<10 | 0 + OP_ORI = 24<<26 | 0<<1 | 0<<10 | 0 + OP_ORIS = 25<<26 | 0<<1 | 0<<10 | 0 + OP_RLWINM = 21<<26 | 0<<1 | 0<<10 | 0 + OP_SUBF = 31<<26 | 40<<1 | 0<<10 | 0 + OP_RLDIC = 30<<26 | 4<<1 | 0<<10 | 0 + OP_RLDICR = 30<<26 | 2<<1 | 0<<10 | 0 + OP_RLDICL = 30<<26 | 0<<1 | 0<<10 | 0 +) + +func oclass(a *obj.Addr) int { + return int(a.Class) - 1 +} + +// add R_ADDRPOWER relocation to symbol s for the two instructions o1 and o2. +func addaddrreloc(ctxt *obj.Link, s *obj.LSym, o1 *uint32, o2 *uint32) { + rel := obj.Addrel(ctxt.Cursym) + rel.Off = int32(ctxt.Pc) + rel.Siz = 8 + rel.Sym = s + rel.Add = int64(uint64(*o1)<<32 | uint64(uint32(*o2))) + rel.Type = obj.R_ADDRPOWER +} + +/* + * 32-bit masks + */ +func getmask(m []byte, v uint32) bool { + m[1] = 0 + m[0] = m[1] + if v != ^uint32(0) && v&(1<<31) != 0 && v&1 != 0 { /* MB > ME */ + if getmask(m, ^v) { + i := int(m[0]) + m[0] = m[1] + 1 + m[1] = byte(i - 1) + return true + } + + return false + } + + for i := 0; i < 32; i++ { + if v&(1<= 32 || v&(1<= 64 || v&(uint64(1)<> 16) + if isuint32(uint64(d)) { + return LOP_IRR(OP_ORIS, uint32(r), REGZERO, uint32(v)) + } + return AOP_IRR(OP_ADDIS, uint32(r), REGZERO, uint32(v)) +} + +func high16adjusted(d int32) uint16 { + if d&0x8000 != 0 { + return uint16((d >> 16) + 1) + } + return uint16(d >> 16) +} + +func asmout(ctxt *obj.Link, p *obj.Prog, o *Optab, out []uint32) { + o1 := uint32(0) + o2 := uint32(0) + o3 := uint32(0) + o4 := uint32(0) + o5 := uint32(0) + + //print("%v => case %d\n", p, o->type); + switch o.type_ { + default: + ctxt.Diag("unknown type %d", o.type_) + prasm(p) + + case 0: /* pseudo ops */ + break + + case 1: /* mov r1,r2 ==> OR Rs,Rs,Ra */ + if p.To.Reg == REGZERO && p.From.Type == obj.TYPE_CONST { + v := regoff(ctxt, &p.From) + if r0iszero != 0 /*TypeKind(100016)*/ && v != 0 { + //nerrors--; + ctxt.Diag("literal operation on R0\n%v", p) + } + + o1 = LOP_IRR(OP_ADDI, REGZERO, REGZERO, uint32(v)) + break + } + + o1 = LOP_RRR(OP_OR, uint32(p.To.Reg), uint32(p.From.Reg), uint32(p.From.Reg)) + + case 2: /* int/cr/fp op Rb,[Ra],Rd */ + r := int(p.Reg) + + if r == 0 { + r = int(p.To.Reg) + } + o1 = AOP_RRR(uint32(oprrr(ctxt, int(p.As))), uint32(p.To.Reg), uint32(r), uint32(p.From.Reg)) + + case 3: /* mov $soreg/addcon/ucon, r ==> addis/addi $i,reg',r */ + d := vregoff(ctxt, &p.From) + + v := int32(d) + r := int(p.From.Reg) + if r == 0 { + r = int(o.param) + } + if r0iszero != 0 /*TypeKind(100016)*/ && p.To.Reg == 0 && (r != 0 || v != 0) { + ctxt.Diag("literal operation on R0\n%v", p) + } + a := OP_ADDI + if o.a1 == C_UCON { + if d&0xffff != 0 { + log.Fatalf("invalid handling of %v", p) + } + v >>= 16 + if r == REGZERO && isuint32(uint64(d)) { + o1 = LOP_IRR(OP_ORIS, uint32(p.To.Reg), REGZERO, uint32(v)) + break + } + + a = OP_ADDIS + } else { + if int64(int16(d)) != d { + log.Fatalf("invalid handling of %v", p) + } + } + + o1 = AOP_IRR(uint32(a), uint32(p.To.Reg), uint32(r), uint32(v)) + + case 4: /* add/mul $scon,[r1],r2 */ + v := regoff(ctxt, &p.From) + + r := int(p.Reg) + if r == 0 { + r = int(p.To.Reg) + } + if r0iszero != 0 /*TypeKind(100016)*/ && p.To.Reg == 0 { + ctxt.Diag("literal operation on R0\n%v", p) + } + if int32(int16(v)) != v { + log.Fatalf("mishandled instruction %v", p) + } + o1 = AOP_IRR(uint32(opirr(ctxt, int(p.As))), uint32(p.To.Reg), uint32(r), uint32(v)) + + case 5: /* syscall */ + o1 = uint32(oprrr(ctxt, int(p.As))) + + case 6: /* logical op Rb,[Rs,]Ra; no literal */ + r := int(p.Reg) + + if r == 0 { + r = int(p.To.Reg) + } + o1 = LOP_RRR(uint32(oprrr(ctxt, int(p.As))), uint32(p.To.Reg), uint32(r), uint32(p.From.Reg)) + + case 7: /* mov r, soreg ==> stw o(r) */ + r := int(p.To.Reg) + + if r == 0 { + r = int(o.param) + } + v := regoff(ctxt, &p.To) + if p.To.Type == obj.TYPE_MEM && p.To.Index != 0 { + if v != 0 { + ctxt.Diag("illegal indexed instruction\n%v", p) + } + o1 = AOP_RRR(uint32(opstorex(ctxt, int(p.As))), uint32(p.From.Reg), uint32(p.To.Index), uint32(r)) + } else { + if int32(int16(v)) != v { + log.Fatalf("mishandled instruction %v", p) + } + o1 = AOP_IRR(uint32(opstore(ctxt, int(p.As))), uint32(p.From.Reg), uint32(r), uint32(v)) + } + + case 8: /* mov soreg, r ==> lbz/lhz/lwz o(r) */ + r := int(p.From.Reg) + + if r == 0 { + r = int(o.param) + } + v := regoff(ctxt, &p.From) + if p.From.Type == obj.TYPE_MEM && p.From.Index != 0 { + if v != 0 { + ctxt.Diag("illegal indexed instruction\n%v", p) + } + o1 = AOP_RRR(uint32(oploadx(ctxt, int(p.As))), uint32(p.To.Reg), uint32(p.From.Index), uint32(r)) + } else { + if int32(int16(v)) != v { + log.Fatalf("mishandled instruction %v", p) + } + o1 = AOP_IRR(uint32(opload(ctxt, int(p.As))), uint32(p.To.Reg), uint32(r), uint32(v)) + } + + case 9: /* movb soreg, r ==> lbz o(r),r2; extsb r2,r2 */ + r := int(p.From.Reg) + + if r == 0 { + r = int(o.param) + } + v := regoff(ctxt, &p.From) + if p.From.Type == obj.TYPE_MEM && p.From.Index != 0 { + if v != 0 { + ctxt.Diag("illegal indexed instruction\n%v", p) + } + o1 = AOP_RRR(uint32(oploadx(ctxt, int(p.As))), uint32(p.To.Reg), uint32(p.From.Index), uint32(r)) + } else { + o1 = AOP_IRR(uint32(opload(ctxt, int(p.As))), uint32(p.To.Reg), uint32(r), uint32(v)) + } + o2 = LOP_RRR(OP_EXTSB, uint32(p.To.Reg), uint32(p.To.Reg), 0) + + case 10: /* sub Ra,[Rb],Rd => subf Rd,Ra,Rb */ + r := int(p.Reg) + + if r == 0 { + r = int(p.To.Reg) + } + o1 = AOP_RRR(uint32(oprrr(ctxt, int(p.As))), uint32(p.To.Reg), uint32(p.From.Reg), uint32(r)) + + case 11: /* br/bl lbra */ + v := int32(0) + + if p.Pcond != nil { + v = int32(p.Pcond.Pc - p.Pc) + if v&03 != 0 { + ctxt.Diag("odd branch target address\n%v", p) + v &^= 03 + } + + if v < -(1<<25) || v >= 1<<24 { + ctxt.Diag("branch too far\n%v", p) + } + } + + o1 = OP_BR(uint32(opirr(ctxt, int(p.As))), uint32(v), 0) + if p.To.Sym != nil { + rel := obj.Addrel(ctxt.Cursym) + rel.Off = int32(ctxt.Pc) + rel.Siz = 4 + rel.Sym = p.To.Sym + v += int32(p.To.Offset) + if v&03 != 0 { + ctxt.Diag("odd branch target address\n%v", p) + v &^= 03 + } + + rel.Add = int64(v) + rel.Type = obj.R_CALLPOWER + } + + case 12: /* movb r,r (extsb); movw r,r (extsw) */ + if p.To.Reg == REGZERO && p.From.Type == obj.TYPE_CONST { + v := regoff(ctxt, &p.From) + if r0iszero != 0 /*TypeKind(100016)*/ && v != 0 { + ctxt.Diag("literal operation on R0\n%v", p) + } + + o1 = LOP_IRR(OP_ADDI, REGZERO, REGZERO, uint32(v)) + break + } + + if p.As == AMOVW { + o1 = LOP_RRR(OP_EXTSW, uint32(p.To.Reg), uint32(p.From.Reg), 0) + } else { + o1 = LOP_RRR(OP_EXTSB, uint32(p.To.Reg), uint32(p.From.Reg), 0) + } + + case 13: /* mov[bhw]z r,r; uses rlwinm not andi. to avoid changing CC */ + if p.As == AMOVBZ { + o1 = OP_RLW(OP_RLWINM, uint32(p.To.Reg), uint32(p.From.Reg), 0, 24, 31) + } else if p.As == AMOVH { + o1 = LOP_RRR(OP_EXTSH, uint32(p.To.Reg), uint32(p.From.Reg), 0) + } else if p.As == AMOVHZ { + o1 = OP_RLW(OP_RLWINM, uint32(p.To.Reg), uint32(p.From.Reg), 0, 16, 31) + } else if p.As == AMOVWZ { + o1 = OP_RLW(OP_RLDIC, uint32(p.To.Reg), uint32(p.From.Reg), 0, 0, 0) | 1<<5 /* MB=32 */ + } else { + ctxt.Diag("internal: bad mov[bhw]z\n%v", p) + } + + case 14: /* rldc[lr] Rb,Rs,$mask,Ra -- left, right give different masks */ + r := int(p.Reg) + + if r == 0 { + r = int(p.To.Reg) + } + d := vregoff(ctxt, p.From3) + var mask [2]uint8 + maskgen64(ctxt, p, mask[:], uint64(d)) + var a int + switch p.As { + case ARLDCL, ARLDCLCC: + a = int(mask[0]) /* MB */ + if mask[1] != 63 { + ctxt.Diag("invalid mask for rotate: %x (end != bit 63)\n%v", uint64(d), p) + } + + case ARLDCR, ARLDCRCC: + a = int(mask[1]) /* ME */ + if mask[0] != 0 { + ctxt.Diag("invalid mask for rotate: %x (start != 0)\n%v", uint64(d), p) + } + + default: + ctxt.Diag("unexpected op in rldc case\n%v", p) + a = 0 + } + + o1 = LOP_RRR(uint32(oprrr(ctxt, int(p.As))), uint32(p.To.Reg), uint32(r), uint32(p.From.Reg)) + o1 |= (uint32(a) & 31) << 6 + if a&0x20 != 0 { + o1 |= 1 << 5 /* mb[5] is top bit */ + } + + case 17, /* bc bo,bi,lbra (same for now) */ + 16: /* bc bo,bi,sbra */ + a := 0 + + if p.From.Type == obj.TYPE_CONST { + a = int(regoff(ctxt, &p.From)) + } + r := int(p.Reg) + if r == 0 { + r = 0 + } + v := int32(0) + if p.Pcond != nil { + v = int32(p.Pcond.Pc - p.Pc) + } + if v&03 != 0 { + ctxt.Diag("odd branch target address\n%v", p) + v &^= 03 + } + + if v < -(1<<16) || v >= 1<<15 { + ctxt.Diag("branch too far\n%v", p) + } + o1 = OP_BC(uint32(opirr(ctxt, int(p.As))), uint32(a), uint32(r), uint32(v), 0) + + case 15: /* br/bl (r) => mov r,lr; br/bl (lr) */ + var v int32 + if p.As == ABC || p.As == ABCL { + v = regoff(ctxt, &p.To) & 31 + } else { + v = 20 /* unconditional */ + } + o1 = AOP_RRR(OP_MTSPR, uint32(p.To.Reg), 0, 0) | (REG_LR&0x1f)<<16 | ((REG_LR>>5)&0x1f)<<11 + o2 = OPVCC(19, 16, 0, 0) + if p.As == ABL || p.As == ABCL { + o2 |= 1 + } + o2 = OP_BCR(o2, uint32(v), uint32(p.To.Index)) + + case 18: /* br/bl (lr/ctr); bc/bcl bo,bi,(lr/ctr) */ + var v int32 + if p.As == ABC || p.As == ABCL { + v = regoff(ctxt, &p.From) & 31 + } else { + v = 20 /* unconditional */ + } + r := int(p.Reg) + if r == 0 { + r = 0 + } + switch oclass(&p.To) { + case C_CTR: + o1 = OPVCC(19, 528, 0, 0) + + case C_LR: + o1 = OPVCC(19, 16, 0, 0) + + default: + ctxt.Diag("bad optab entry (18): %d\n%v", p.To.Class, p) + v = 0 + } + + if p.As == ABL || p.As == ABCL { + o1 |= 1 + } + o1 = OP_BCR(o1, uint32(v), uint32(r)) + + case 19: /* mov $lcon,r ==> cau+or */ + d := vregoff(ctxt, &p.From) + + if p.From.Sym == nil { + o1 = loadu32(int(p.To.Reg), d) + o2 = LOP_IRR(OP_ORI, uint32(p.To.Reg), uint32(p.To.Reg), uint32(int32(d))) + } else { + o1 = AOP_IRR(OP_ADDIS, REGTMP, REGZERO, uint32(high16adjusted(int32(d)))) + o2 = AOP_IRR(OP_ADDI, uint32(p.To.Reg), REGTMP, uint32(d)) + addaddrreloc(ctxt, p.From.Sym, &o1, &o2) + } + + //if(dlm) reloc(&p->from, p->pc, 0); + + case 20: /* add $ucon,,r */ + v := regoff(ctxt, &p.From) + + r := int(p.Reg) + if r == 0 { + r = int(p.To.Reg) + } + if p.As == AADD && (r0iszero == 0 /*TypeKind(100016)*/ && p.Reg == 0 || r0iszero != 0 /*TypeKind(100016)*/ && p.To.Reg == 0) { + ctxt.Diag("literal operation on R0\n%v", p) + } + o1 = AOP_IRR(uint32(opirr(ctxt, int(p.As)+ALAST)), uint32(p.To.Reg), uint32(r), uint32(v)>>16) + + case 22: /* add $lcon,r1,r2 ==> cau+or+add */ /* could do add/sub more efficiently */ + if p.To.Reg == REGTMP || p.Reg == REGTMP { + ctxt.Diag("cant synthesize large constant\n%v", p) + } + d := vregoff(ctxt, &p.From) + o1 = loadu32(REGTMP, d) + o2 = LOP_IRR(OP_ORI, REGTMP, REGTMP, uint32(int32(d))) + r := int(p.Reg) + if r == 0 { + r = int(p.To.Reg) + } + o3 = AOP_RRR(uint32(oprrr(ctxt, int(p.As))), uint32(p.To.Reg), REGTMP, uint32(r)) + if p.From.Sym != nil { + ctxt.Diag("%v is not supported", p) + } + + //if(dlm) reloc(&p->from, p->pc, 0); + + case 23: /* and $lcon,r1,r2 ==> cau+or+and */ /* masks could be done using rlnm etc. */ + if p.To.Reg == REGTMP || p.Reg == REGTMP { + ctxt.Diag("cant synthesize large constant\n%v", p) + } + d := vregoff(ctxt, &p.From) + o1 = loadu32(REGTMP, d) + o2 = LOP_IRR(OP_ORI, REGTMP, REGTMP, uint32(int32(d))) + r := int(p.Reg) + if r == 0 { + r = int(p.To.Reg) + } + o3 = LOP_RRR(uint32(oprrr(ctxt, int(p.As))), uint32(p.To.Reg), REGTMP, uint32(r)) + if p.From.Sym != nil { + ctxt.Diag("%v is not supported", p) + } + + //if(dlm) reloc(&p->from, p->pc, 0); + + /*24*/ + case 25: + /* sld[.] $sh,rS,rA -> rldicr[.] $sh,rS,mask(0,63-sh),rA; srd[.] -> rldicl */ + v := regoff(ctxt, &p.From) + + if v < 0 { + v = 0 + } else if v > 63 { + v = 63 + } + r := int(p.Reg) + if r == 0 { + r = int(p.To.Reg) + } + var a int + switch p.As { + case ASLD, ASLDCC: + a = int(63 - v) + o1 = OP_RLDICR + + case ASRD, ASRDCC: + a = int(v) + v = 64 - v + o1 = OP_RLDICL + + default: + ctxt.Diag("unexpected op in sldi case\n%v", p) + a = 0 + o1 = 0 + } + + o1 = AOP_RRR(o1, uint32(r), uint32(p.To.Reg), (uint32(v) & 0x1F)) + o1 |= (uint32(a) & 31) << 6 + if v&0x20 != 0 { + o1 |= 1 << 1 + } + if a&0x20 != 0 { + o1 |= 1 << 5 /* mb[5] is top bit */ + } + if p.As == ASLDCC || p.As == ASRDCC { + o1 |= 1 /* Rc */ + } + + case 26: /* mov $lsext/auto/oreg,,r2 ==> addis+addi */ + if p.To.Reg == REGTMP { + ctxt.Diag("can't synthesize large constant\n%v", p) + } + v := regoff(ctxt, &p.From) + r := int(p.From.Reg) + if r == 0 { + r = int(o.param) + } + o1 = AOP_IRR(OP_ADDIS, REGTMP, uint32(r), uint32(high16adjusted(v))) + o2 = AOP_IRR(OP_ADDI, uint32(p.To.Reg), REGTMP, uint32(v)) + + case 27: /* subc ra,$simm,rd => subfic rd,ra,$simm */ + v := regoff(ctxt, p.From3) + + r := int(p.From.Reg) + o1 = AOP_IRR(uint32(opirr(ctxt, int(p.As))), uint32(p.To.Reg), uint32(r), uint32(v)) + + case 28: /* subc r1,$lcon,r2 ==> cau+or+subfc */ + if p.To.Reg == REGTMP || p.From.Reg == REGTMP { + ctxt.Diag("can't synthesize large constant\n%v", p) + } + v := regoff(ctxt, p.From3) + o1 = AOP_IRR(OP_ADDIS, REGTMP, REGZERO, uint32(v)>>16) + o2 = LOP_IRR(OP_ORI, REGTMP, REGTMP, uint32(v)) + o3 = AOP_RRR(uint32(oprrr(ctxt, int(p.As))), uint32(p.To.Reg), uint32(p.From.Reg), REGTMP) + if p.From.Sym != nil { + ctxt.Diag("%v is not supported", p) + } + + //if(dlm) reloc(&p->from3, p->pc, 0); + + case 29: /* rldic[lr]? $sh,s,$mask,a -- left, right, plain give different masks */ + v := regoff(ctxt, &p.From) + + d := vregoff(ctxt, p.From3) + var mask [2]uint8 + maskgen64(ctxt, p, mask[:], uint64(d)) + var a int + switch p.As { + case ARLDC, ARLDCCC: + a = int(mask[0]) /* MB */ + if int32(mask[1]) != (63 - v) { + ctxt.Diag("invalid mask for shift: %x (shift %d)\n%v", uint64(d), v, p) + } + + case ARLDCL, ARLDCLCC: + a = int(mask[0]) /* MB */ + if mask[1] != 63 { + ctxt.Diag("invalid mask for shift: %x (shift %d)\n%v", uint64(d), v, p) + } + + case ARLDCR, ARLDCRCC: + a = int(mask[1]) /* ME */ + if mask[0] != 0 { + ctxt.Diag("invalid mask for shift: %x (shift %d)\n%v", uint64(d), v, p) + } + + default: + ctxt.Diag("unexpected op in rldic case\n%v", p) + a = 0 + } + + o1 = AOP_RRR(uint32(opirr(ctxt, int(p.As))), uint32(p.Reg), uint32(p.To.Reg), (uint32(v) & 0x1F)) + o1 |= (uint32(a) & 31) << 6 + if v&0x20 != 0 { + o1 |= 1 << 1 + } + if a&0x20 != 0 { + o1 |= 1 << 5 /* mb[5] is top bit */ + } + + case 30: /* rldimi $sh,s,$mask,a */ + v := regoff(ctxt, &p.From) + + d := vregoff(ctxt, p.From3) + var mask [2]uint8 + maskgen64(ctxt, p, mask[:], uint64(d)) + if int32(mask[1]) != (63 - v) { + ctxt.Diag("invalid mask for shift: %x (shift %d)\n%v", uint64(d), v, p) + } + o1 = AOP_RRR(uint32(opirr(ctxt, int(p.As))), uint32(p.Reg), uint32(p.To.Reg), (uint32(v) & 0x1F)) + o1 |= (uint32(mask[0]) & 31) << 6 + if v&0x20 != 0 { + o1 |= 1 << 1 + } + if mask[0]&0x20 != 0 { + o1 |= 1 << 5 /* mb[5] is top bit */ + } + + case 31: /* dword */ + d := vregoff(ctxt, &p.From) + + if ctxt.Arch.ByteOrder == binary.BigEndian { + o1 = uint32(d >> 32) + o2 = uint32(d) + } else { + o1 = uint32(d) + o2 = uint32(d >> 32) + } + + if p.From.Sym != nil { + rel := obj.Addrel(ctxt.Cursym) + rel.Off = int32(ctxt.Pc) + rel.Siz = 8 + rel.Sym = p.From.Sym + rel.Add = p.From.Offset + rel.Type = obj.R_ADDR + o2 = 0 + o1 = o2 + } + + case 32: /* fmul frc,fra,frd */ + r := int(p.Reg) + + if r == 0 { + r = int(p.To.Reg) + } + o1 = AOP_RRR(uint32(oprrr(ctxt, int(p.As))), uint32(p.To.Reg), uint32(r), 0) | (uint32(p.From.Reg)&31)<<6 + + case 33: /* fabs [frb,]frd; fmr. frb,frd */ + r := int(p.From.Reg) + + if oclass(&p.From) == C_NONE { + r = int(p.To.Reg) + } + o1 = AOP_RRR(uint32(oprrr(ctxt, int(p.As))), uint32(p.To.Reg), 0, uint32(r)) + + case 34: /* FMADDx fra,frb,frc,frd (d=a*b+c); FSELx a<0? (d=b): (d=c) */ + o1 = AOP_RRR(uint32(oprrr(ctxt, int(p.As))), uint32(p.To.Reg), uint32(p.From.Reg), uint32(p.Reg)) | (uint32(p.From3.Reg)&31)<<6 + + case 35: /* mov r,lext/lauto/loreg ==> cau $(v>>16),sb,r'; store o(r') */ + v := regoff(ctxt, &p.To) + + r := int(p.To.Reg) + if r == 0 { + r = int(o.param) + } + o1 = AOP_IRR(OP_ADDIS, REGTMP, uint32(r), uint32(high16adjusted(v))) + o2 = AOP_IRR(uint32(opstore(ctxt, int(p.As))), uint32(p.From.Reg), REGTMP, uint32(v)) + + case 36: /* mov bz/h/hz lext/lauto/lreg,r ==> lbz/lha/lhz etc */ + v := regoff(ctxt, &p.From) + + r := int(p.From.Reg) + if r == 0 { + r = int(o.param) + } + o1 = AOP_IRR(OP_ADDIS, REGTMP, uint32(r), uint32(high16adjusted(v))) + o2 = AOP_IRR(uint32(opload(ctxt, int(p.As))), uint32(p.To.Reg), REGTMP, uint32(v)) + + case 37: /* movb lext/lauto/lreg,r ==> lbz o(reg),r; extsb r */ + v := regoff(ctxt, &p.From) + + r := int(p.From.Reg) + if r == 0 { + r = int(o.param) + } + o1 = AOP_IRR(OP_ADDIS, REGTMP, uint32(r), uint32(high16adjusted(v))) + o2 = AOP_IRR(uint32(opload(ctxt, int(p.As))), uint32(p.To.Reg), REGTMP, uint32(v)) + o3 = LOP_RRR(OP_EXTSB, uint32(p.To.Reg), uint32(p.To.Reg), 0) + + case 40: /* word */ + o1 = uint32(regoff(ctxt, &p.From)) + + case 41: /* stswi */ + o1 = AOP_RRR(uint32(opirr(ctxt, int(p.As))), uint32(p.From.Reg), uint32(p.To.Reg), 0) | (uint32(regoff(ctxt, p.From3))&0x7F)<<11 + + case 42: /* lswi */ + o1 = AOP_RRR(uint32(opirr(ctxt, int(p.As))), uint32(p.To.Reg), uint32(p.From.Reg), 0) | (uint32(regoff(ctxt, p.From3))&0x7F)<<11 + + case 43: /* unary indexed source: dcbf (b); dcbf (a+b) */ + o1 = AOP_RRR(uint32(oprrr(ctxt, int(p.As))), 0, uint32(p.From.Index), uint32(p.From.Reg)) + + case 44: /* indexed store */ + o1 = AOP_RRR(uint32(opstorex(ctxt, int(p.As))), uint32(p.From.Reg), uint32(p.To.Index), uint32(p.To.Reg)) + + case 45: /* indexed load */ + o1 = AOP_RRR(uint32(oploadx(ctxt, int(p.As))), uint32(p.To.Reg), uint32(p.From.Index), uint32(p.From.Reg)) + + case 46: /* plain op */ + o1 = uint32(oprrr(ctxt, int(p.As))) + + case 47: /* op Ra, Rd; also op [Ra,] Rd */ + r := int(p.From.Reg) + + if r == 0 { + r = int(p.To.Reg) + } + o1 = AOP_RRR(uint32(oprrr(ctxt, int(p.As))), uint32(p.To.Reg), uint32(r), 0) + + case 48: /* op Rs, Ra */ + r := int(p.From.Reg) + + if r == 0 { + r = int(p.To.Reg) + } + o1 = LOP_RRR(uint32(oprrr(ctxt, int(p.As))), uint32(p.To.Reg), uint32(r), 0) + + case 49: /* op Rb; op $n, Rb */ + if p.From.Type != obj.TYPE_REG { /* tlbie $L, rB */ + v := regoff(ctxt, &p.From) & 1 + o1 = AOP_RRR(uint32(oprrr(ctxt, int(p.As))), 0, 0, uint32(p.To.Reg)) | uint32(v)<<21 + } else { + o1 = AOP_RRR(uint32(oprrr(ctxt, int(p.As))), 0, 0, uint32(p.From.Reg)) + } + + case 50: /* rem[u] r1[,r2],r3 */ + r := int(p.Reg) + + if r == 0 { + r = int(p.To.Reg) + } + v := oprrr(ctxt, int(p.As)) + t := v & (1<<10 | 1) /* OE|Rc */ + o1 = AOP_RRR(uint32(v)&^uint32(t), REGTMP, uint32(r), uint32(p.From.Reg)) + o2 = AOP_RRR(OP_MULLW, REGTMP, REGTMP, uint32(p.From.Reg)) + o3 = AOP_RRR(OP_SUBF|uint32(t), uint32(p.To.Reg), REGTMP, uint32(r)) + if p.As == AREMU { + o4 = o3 + + /* Clear top 32 bits */ + o3 = OP_RLW(OP_RLDIC, REGTMP, REGTMP, 0, 0, 0) | 1<<5 + } + + case 51: /* remd[u] r1[,r2],r3 */ + r := int(p.Reg) + + if r == 0 { + r = int(p.To.Reg) + } + v := oprrr(ctxt, int(p.As)) + t := v & (1<<10 | 1) /* OE|Rc */ + o1 = AOP_RRR(uint32(v)&^uint32(t), REGTMP, uint32(r), uint32(p.From.Reg)) + o2 = AOP_RRR(OP_MULLD, REGTMP, REGTMP, uint32(p.From.Reg)) + o3 = AOP_RRR(OP_SUBF|uint32(t), uint32(p.To.Reg), REGTMP, uint32(r)) + + case 52: /* mtfsbNx cr(n) */ + v := regoff(ctxt, &p.From) & 31 + + o1 = AOP_RRR(uint32(oprrr(ctxt, int(p.As))), uint32(v), 0, 0) + + case 53: /* mffsX ,fr1 */ + o1 = AOP_RRR(OP_MFFS, uint32(p.To.Reg), 0, 0) + + case 54: /* mov msr,r1; mov r1, msr*/ + if oclass(&p.From) == C_REG { + if p.As == AMOVD { + o1 = AOP_RRR(OP_MTMSRD, uint32(p.From.Reg), 0, 0) + } else { + o1 = AOP_RRR(OP_MTMSR, uint32(p.From.Reg), 0, 0) + } + } else { + o1 = AOP_RRR(OP_MFMSR, uint32(p.To.Reg), 0, 0) + } + + case 55: /* op Rb, Rd */ + o1 = AOP_RRR(uint32(oprrr(ctxt, int(p.As))), uint32(p.To.Reg), 0, uint32(p.From.Reg)) + + case 56: /* sra $sh,[s,]a; srd $sh,[s,]a */ + v := regoff(ctxt, &p.From) + + r := int(p.Reg) + if r == 0 { + r = int(p.To.Reg) + } + o1 = AOP_RRR(uint32(opirr(ctxt, int(p.As))), uint32(r), uint32(p.To.Reg), uint32(v)&31) + if p.As == ASRAD && (v&0x20 != 0) { + o1 |= 1 << 1 /* mb[5] */ + } + + case 57: /* slw $sh,[s,]a -> rlwinm ... */ + v := regoff(ctxt, &p.From) + + r := int(p.Reg) + if r == 0 { + r = int(p.To.Reg) + } + + /* + * Let user (gs) shoot himself in the foot. + * qc has already complained. + * + if(v < 0 || v > 31) + ctxt->diag("illegal shift %ld\n%v", v, p); + */ + if v < 0 { + v = 0 + } else if v > 32 { + v = 32 + } + var mask [2]uint8 + if p.As == ASRW || p.As == ASRWCC { /* shift right */ + mask[0] = uint8(v) + mask[1] = 31 + v = 32 - v + } else { + mask[0] = 0 + mask[1] = uint8(31 - v) + } + + o1 = OP_RLW(OP_RLWINM, uint32(p.To.Reg), uint32(r), uint32(v), uint32(mask[0]), uint32(mask[1])) + if p.As == ASLWCC || p.As == ASRWCC { + o1 |= 1 /* Rc */ + } + + case 58: /* logical $andcon,[s],a */ + v := regoff(ctxt, &p.From) + + r := int(p.Reg) + if r == 0 { + r = int(p.To.Reg) + } + o1 = LOP_IRR(uint32(opirr(ctxt, int(p.As))), uint32(p.To.Reg), uint32(r), uint32(v)) + + case 59: /* or/and $ucon,,r */ + v := regoff(ctxt, &p.From) + + r := int(p.Reg) + if r == 0 { + r = int(p.To.Reg) + } + o1 = LOP_IRR(uint32(opirr(ctxt, int(p.As)+ALAST)), uint32(p.To.Reg), uint32(r), uint32(v)>>16) /* oris, xoris, andis */ + + case 60: /* tw to,a,b */ + r := int(regoff(ctxt, &p.From) & 31) + + o1 = AOP_RRR(uint32(oprrr(ctxt, int(p.As))), uint32(r), uint32(p.Reg), uint32(p.To.Reg)) + + case 61: /* tw to,a,$simm */ + r := int(regoff(ctxt, &p.From) & 31) + + v := regoff(ctxt, &p.To) + o1 = AOP_IRR(uint32(opirr(ctxt, int(p.As))), uint32(r), uint32(p.Reg), uint32(v)) + + case 62: /* rlwmi $sh,s,$mask,a */ + v := regoff(ctxt, &p.From) + + var mask [2]uint8 + maskgen(ctxt, p, mask[:], uint32(regoff(ctxt, p.From3))) + o1 = AOP_RRR(uint32(opirr(ctxt, int(p.As))), uint32(p.Reg), uint32(p.To.Reg), uint32(v)) + o1 |= (uint32(mask[0])&31)<<6 | (uint32(mask[1])&31)<<1 + + case 63: /* rlwmi b,s,$mask,a */ + var mask [2]uint8 + maskgen(ctxt, p, mask[:], uint32(regoff(ctxt, p.From3))) + + o1 = AOP_RRR(uint32(opirr(ctxt, int(p.As))), uint32(p.Reg), uint32(p.To.Reg), uint32(p.From.Reg)) + o1 |= (uint32(mask[0])&31)<<6 | (uint32(mask[1])&31)<<1 + + case 64: /* mtfsf fr[, $m] {,fpcsr} */ + var v int32 + if p.From3Type() != obj.TYPE_NONE { + v = regoff(ctxt, p.From3) & 255 + } else { + v = 255 + } + o1 = OP_MTFSF | uint32(v)<<17 | uint32(p.From.Reg)<<11 + + case 65: /* MOVFL $imm,FPSCR(n) => mtfsfi crfd,imm */ + if p.To.Reg == 0 { + ctxt.Diag("must specify FPSCR(n)\n%v", p) + } + o1 = OP_MTFSFI | (uint32(p.To.Reg)&15)<<23 | (uint32(regoff(ctxt, &p.From))&31)<<12 + + case 66: /* mov spr,r1; mov r1,spr, also dcr */ + var r int + var v int32 + if REG_R0 <= p.From.Reg && p.From.Reg <= REG_R31 { + r = int(p.From.Reg) + v = int32(p.To.Reg) + if REG_DCR0 <= v && v <= REG_DCR0+1023 { + o1 = OPVCC(31, 451, 0, 0) /* mtdcr */ + } else { + o1 = OPVCC(31, 467, 0, 0) /* mtspr */ + } + } else { + r = int(p.To.Reg) + v = int32(p.From.Reg) + if REG_DCR0 <= v && v <= REG_DCR0+1023 { + o1 = OPVCC(31, 323, 0, 0) /* mfdcr */ + } else { + o1 = OPVCC(31, 339, 0, 0) /* mfspr */ + } + } + + o1 = AOP_RRR(o1, uint32(r), 0, 0) | (uint32(v)&0x1f)<<16 | ((uint32(v)>>5)&0x1f)<<11 + + case 67: /* mcrf crfD,crfS */ + if p.From.Type != obj.TYPE_REG || p.From.Reg < REG_CR0 || REG_CR7 < p.From.Reg || p.To.Type != obj.TYPE_REG || p.To.Reg < REG_CR0 || REG_CR7 < p.To.Reg { + ctxt.Diag("illegal CR field number\n%v", p) + } + o1 = AOP_RRR(OP_MCRF, ((uint32(p.To.Reg) & 7) << 2), ((uint32(p.From.Reg) & 7) << 2), 0) + + case 68: /* mfcr rD; mfocrf CRM,rD */ + if p.From.Type == obj.TYPE_REG && REG_CR0 <= p.From.Reg && p.From.Reg <= REG_CR7 { + v := int32(1 << uint(7-(p.To.Reg&7))) /* CR(n) */ + o1 = AOP_RRR(OP_MFCR, uint32(p.To.Reg), 0, 0) | 1<<20 | uint32(v)<<12 /* new form, mfocrf */ + } else { + o1 = AOP_RRR(OP_MFCR, uint32(p.To.Reg), 0, 0) /* old form, whole register */ + } + + case 69: /* mtcrf CRM,rS */ + var v int32 + if p.From3Type() != obj.TYPE_NONE { + if p.To.Reg != 0 { + ctxt.Diag("can't use both mask and CR(n)\n%v", p) + } + v = regoff(ctxt, p.From3) & 0xff + } else { + if p.To.Reg == 0 { + v = 0xff /* CR */ + } else { + v = 1 << uint(7-(p.To.Reg&7)) /* CR(n) */ + } + } + + o1 = AOP_RRR(OP_MTCRF, uint32(p.From.Reg), 0, 0) | uint32(v)<<12 + + case 70: /* [f]cmp r,r,cr*/ + var r int + if p.Reg == 0 { + r = 0 + } else { + r = (int(p.Reg) & 7) << 2 + } + o1 = AOP_RRR(uint32(oprrr(ctxt, int(p.As))), uint32(r), uint32(p.From.Reg), uint32(p.To.Reg)) + + case 71: /* cmp[l] r,i,cr*/ + var r int + if p.Reg == 0 { + r = 0 + } else { + r = (int(p.Reg) & 7) << 2 + } + o1 = AOP_RRR(uint32(opirr(ctxt, int(p.As))), uint32(r), uint32(p.From.Reg), 0) | uint32(regoff(ctxt, &p.To))&0xffff + + case 72: /* slbmte (Rb+Rs -> slb[Rb]) -> Rs, Rb */ + o1 = AOP_RRR(uint32(oprrr(ctxt, int(p.As))), uint32(p.From.Reg), 0, uint32(p.To.Reg)) + + case 73: /* mcrfs crfD,crfS */ + if p.From.Type != obj.TYPE_REG || p.From.Reg != REG_FPSCR || p.To.Type != obj.TYPE_REG || p.To.Reg < REG_CR0 || REG_CR7 < p.To.Reg { + ctxt.Diag("illegal FPSCR/CR field number\n%v", p) + } + o1 = AOP_RRR(OP_MCRFS, ((uint32(p.To.Reg) & 7) << 2), ((0 & 7) << 2), 0) + + case 77: /* syscall $scon, syscall Rx */ + if p.From.Type == obj.TYPE_CONST { + if p.From.Offset > BIG || p.From.Offset < -BIG { + ctxt.Diag("illegal syscall, sysnum too large: %v", p) + } + o1 = AOP_IRR(OP_ADDI, REGZERO, REGZERO, uint32(p.From.Offset)) + } else if p.From.Type == obj.TYPE_REG { + o1 = LOP_RRR(OP_OR, REGZERO, uint32(p.From.Reg), uint32(p.From.Reg)) + } else { + ctxt.Diag("illegal syscall: %v", p) + o1 = 0x7fe00008 // trap always + } + + o2 = uint32(oprrr(ctxt, int(p.As))) + o3 = AOP_RRR(uint32(oprrr(ctxt, AXOR)), REGZERO, REGZERO, REGZERO) // XOR R0, R0 + + case 78: /* undef */ + o1 = 0 /* "An instruction consisting entirely of binary 0s is guaranteed + always to be an illegal instruction." */ + + /* relocation operations */ + case 74: + v := regoff(ctxt, &p.To) + + o1 = AOP_IRR(OP_ADDIS, REGTMP, REGZERO, uint32(high16adjusted(v))) + o2 = AOP_IRR(uint32(opstore(ctxt, int(p.As))), uint32(p.From.Reg), REGTMP, uint32(v)) + addaddrreloc(ctxt, p.To.Sym, &o1, &o2) + + //if(dlm) reloc(&p->to, p->pc, 1); + + case 75: + v := regoff(ctxt, &p.From) + o1 = AOP_IRR(OP_ADDIS, REGTMP, REGZERO, uint32(high16adjusted(v))) + o2 = AOP_IRR(uint32(opload(ctxt, int(p.As))), uint32(p.To.Reg), REGTMP, uint32(v)) + addaddrreloc(ctxt, p.From.Sym, &o1, &o2) + + //if(dlm) reloc(&p->from, p->pc, 1); + + case 76: + v := regoff(ctxt, &p.From) + o1 = AOP_IRR(OP_ADDIS, REGTMP, REGZERO, uint32(high16adjusted(v))) + o2 = AOP_IRR(uint32(opload(ctxt, int(p.As))), uint32(p.To.Reg), REGTMP, uint32(v)) + addaddrreloc(ctxt, p.From.Sym, &o1, &o2) + o3 = LOP_RRR(OP_EXTSB, uint32(p.To.Reg), uint32(p.To.Reg), 0) + + //if(dlm) reloc(&p->from, p->pc, 1); + + } + + out[0] = o1 + out[1] = o2 + out[2] = o3 + out[3] = o4 + out[4] = o5 + return +} + +func vregoff(ctxt *obj.Link, a *obj.Addr) int64 { + ctxt.Instoffset = 0 + if a != nil { + aclass(ctxt, a) + } + return ctxt.Instoffset +} + +func regoff(ctxt *obj.Link, a *obj.Addr) int32 { + return int32(vregoff(ctxt, a)) +} + +func oprrr(ctxt *obj.Link, a int) int32 { + switch a { + case AADD: + return int32(OPVCC(31, 266, 0, 0)) + case AADDCC: + return int32(OPVCC(31, 266, 0, 1)) + case AADDV: + return int32(OPVCC(31, 266, 1, 0)) + case AADDVCC: + return int32(OPVCC(31, 266, 1, 1)) + case AADDC: + return int32(OPVCC(31, 10, 0, 0)) + case AADDCCC: + return int32(OPVCC(31, 10, 0, 1)) + case AADDCV: + return int32(OPVCC(31, 10, 1, 0)) + case AADDCVCC: + return int32(OPVCC(31, 10, 1, 1)) + case AADDE: + return int32(OPVCC(31, 138, 0, 0)) + case AADDECC: + return int32(OPVCC(31, 138, 0, 1)) + case AADDEV: + return int32(OPVCC(31, 138, 1, 0)) + case AADDEVCC: + return int32(OPVCC(31, 138, 1, 1)) + case AADDME: + return int32(OPVCC(31, 234, 0, 0)) + case AADDMECC: + return int32(OPVCC(31, 234, 0, 1)) + case AADDMEV: + return int32(OPVCC(31, 234, 1, 0)) + case AADDMEVCC: + return int32(OPVCC(31, 234, 1, 1)) + case AADDZE: + return int32(OPVCC(31, 202, 0, 0)) + case AADDZECC: + return int32(OPVCC(31, 202, 0, 1)) + case AADDZEV: + return int32(OPVCC(31, 202, 1, 0)) + case AADDZEVCC: + return int32(OPVCC(31, 202, 1, 1)) + + case AAND: + return int32(OPVCC(31, 28, 0, 0)) + case AANDCC: + return int32(OPVCC(31, 28, 0, 1)) + case AANDN: + return int32(OPVCC(31, 60, 0, 0)) + case AANDNCC: + return int32(OPVCC(31, 60, 0, 1)) + + case ACMP: + return int32(OPVCC(31, 0, 0, 0) | 1<<21) /* L=1 */ + case ACMPU: + return int32(OPVCC(31, 32, 0, 0) | 1<<21) + case ACMPW: + return int32(OPVCC(31, 0, 0, 0)) /* L=0 */ + case ACMPWU: + return int32(OPVCC(31, 32, 0, 0)) + + case ACNTLZW: + return int32(OPVCC(31, 26, 0, 0)) + case ACNTLZWCC: + return int32(OPVCC(31, 26, 0, 1)) + case ACNTLZD: + return int32(OPVCC(31, 58, 0, 0)) + case ACNTLZDCC: + return int32(OPVCC(31, 58, 0, 1)) + + case ACRAND: + return int32(OPVCC(19, 257, 0, 0)) + case ACRANDN: + return int32(OPVCC(19, 129, 0, 0)) + case ACREQV: + return int32(OPVCC(19, 289, 0, 0)) + case ACRNAND: + return int32(OPVCC(19, 225, 0, 0)) + case ACRNOR: + return int32(OPVCC(19, 33, 0, 0)) + case ACROR: + return int32(OPVCC(19, 449, 0, 0)) + case ACRORN: + return int32(OPVCC(19, 417, 0, 0)) + case ACRXOR: + return int32(OPVCC(19, 193, 0, 0)) + + case ADCBF: + return int32(OPVCC(31, 86, 0, 0)) + case ADCBI: + return int32(OPVCC(31, 470, 0, 0)) + case ADCBST: + return int32(OPVCC(31, 54, 0, 0)) + case ADCBT: + return int32(OPVCC(31, 278, 0, 0)) + case ADCBTST: + return int32(OPVCC(31, 246, 0, 0)) + case ADCBZ: + return int32(OPVCC(31, 1014, 0, 0)) + + case AREM, ADIVW: + return int32(OPVCC(31, 491, 0, 0)) + + case AREMCC, ADIVWCC: + return int32(OPVCC(31, 491, 0, 1)) + + case AREMV, ADIVWV: + return int32(OPVCC(31, 491, 1, 0)) + + case AREMVCC, ADIVWVCC: + return int32(OPVCC(31, 491, 1, 1)) + + case AREMU, ADIVWU: + return int32(OPVCC(31, 459, 0, 0)) + + case AREMUCC, ADIVWUCC: + return int32(OPVCC(31, 459, 0, 1)) + + case AREMUV, ADIVWUV: + return int32(OPVCC(31, 459, 1, 0)) + + case AREMUVCC, ADIVWUVCC: + return int32(OPVCC(31, 459, 1, 1)) + + case AREMD, ADIVD: + return int32(OPVCC(31, 489, 0, 0)) + + case AREMDCC, ADIVDCC: + return int32(OPVCC(31, 489, 0, 1)) + + case AREMDV, ADIVDV: + return int32(OPVCC(31, 489, 1, 0)) + + case AREMDVCC, ADIVDVCC: + return int32(OPVCC(31, 489, 1, 1)) + + case AREMDU, ADIVDU: + return int32(OPVCC(31, 457, 0, 0)) + + case AREMDUCC, ADIVDUCC: + return int32(OPVCC(31, 457, 0, 1)) + + case AREMDUV, ADIVDUV: + return int32(OPVCC(31, 457, 1, 0)) + + case AREMDUVCC, ADIVDUVCC: + return int32(OPVCC(31, 457, 1, 1)) + + case AEIEIO: + return int32(OPVCC(31, 854, 0, 0)) + + case AEQV: + return int32(OPVCC(31, 284, 0, 0)) + case AEQVCC: + return int32(OPVCC(31, 284, 0, 1)) + + case AEXTSB: + return int32(OPVCC(31, 954, 0, 0)) + case AEXTSBCC: + return int32(OPVCC(31, 954, 0, 1)) + case AEXTSH: + return int32(OPVCC(31, 922, 0, 0)) + case AEXTSHCC: + return int32(OPVCC(31, 922, 0, 1)) + case AEXTSW: + return int32(OPVCC(31, 986, 0, 0)) + case AEXTSWCC: + return int32(OPVCC(31, 986, 0, 1)) + + case AFABS: + return int32(OPVCC(63, 264, 0, 0)) + case AFABSCC: + return int32(OPVCC(63, 264, 0, 1)) + case AFADD: + return int32(OPVCC(63, 21, 0, 0)) + case AFADDCC: + return int32(OPVCC(63, 21, 0, 1)) + case AFADDS: + return int32(OPVCC(59, 21, 0, 0)) + case AFADDSCC: + return int32(OPVCC(59, 21, 0, 1)) + case AFCMPO: + return int32(OPVCC(63, 32, 0, 0)) + case AFCMPU: + return int32(OPVCC(63, 0, 0, 0)) + case AFCFID: + return int32(OPVCC(63, 846, 0, 0)) + case AFCFIDCC: + return int32(OPVCC(63, 846, 0, 1)) + case AFCTIW: + return int32(OPVCC(63, 14, 0, 0)) + case AFCTIWCC: + return int32(OPVCC(63, 14, 0, 1)) + case AFCTIWZ: + return int32(OPVCC(63, 15, 0, 0)) + case AFCTIWZCC: + return int32(OPVCC(63, 15, 0, 1)) + case AFCTID: + return int32(OPVCC(63, 814, 0, 0)) + case AFCTIDCC: + return int32(OPVCC(63, 814, 0, 1)) + case AFCTIDZ: + return int32(OPVCC(63, 815, 0, 0)) + case AFCTIDZCC: + return int32(OPVCC(63, 815, 0, 1)) + case AFDIV: + return int32(OPVCC(63, 18, 0, 0)) + case AFDIVCC: + return int32(OPVCC(63, 18, 0, 1)) + case AFDIVS: + return int32(OPVCC(59, 18, 0, 0)) + case AFDIVSCC: + return int32(OPVCC(59, 18, 0, 1)) + case AFMADD: + return int32(OPVCC(63, 29, 0, 0)) + case AFMADDCC: + return int32(OPVCC(63, 29, 0, 1)) + case AFMADDS: + return int32(OPVCC(59, 29, 0, 0)) + case AFMADDSCC: + return int32(OPVCC(59, 29, 0, 1)) + + case AFMOVS, AFMOVD: + return int32(OPVCC(63, 72, 0, 0)) /* load */ + case AFMOVDCC: + return int32(OPVCC(63, 72, 0, 1)) + case AFMSUB: + return int32(OPVCC(63, 28, 0, 0)) + case AFMSUBCC: + return int32(OPVCC(63, 28, 0, 1)) + case AFMSUBS: + return int32(OPVCC(59, 28, 0, 0)) + case AFMSUBSCC: + return int32(OPVCC(59, 28, 0, 1)) + case AFMUL: + return int32(OPVCC(63, 25, 0, 0)) + case AFMULCC: + return int32(OPVCC(63, 25, 0, 1)) + case AFMULS: + return int32(OPVCC(59, 25, 0, 0)) + case AFMULSCC: + return int32(OPVCC(59, 25, 0, 1)) + case AFNABS: + return int32(OPVCC(63, 136, 0, 0)) + case AFNABSCC: + return int32(OPVCC(63, 136, 0, 1)) + case AFNEG: + return int32(OPVCC(63, 40, 0, 0)) + case AFNEGCC: + return int32(OPVCC(63, 40, 0, 1)) + case AFNMADD: + return int32(OPVCC(63, 31, 0, 0)) + case AFNMADDCC: + return int32(OPVCC(63, 31, 0, 1)) + case AFNMADDS: + return int32(OPVCC(59, 31, 0, 0)) + case AFNMADDSCC: + return int32(OPVCC(59, 31, 0, 1)) + case AFNMSUB: + return int32(OPVCC(63, 30, 0, 0)) + case AFNMSUBCC: + return int32(OPVCC(63, 30, 0, 1)) + case AFNMSUBS: + return int32(OPVCC(59, 30, 0, 0)) + case AFNMSUBSCC: + return int32(OPVCC(59, 30, 0, 1)) + case AFRES: + return int32(OPVCC(59, 24, 0, 0)) + case AFRESCC: + return int32(OPVCC(59, 24, 0, 1)) + case AFRSP: + return int32(OPVCC(63, 12, 0, 0)) + case AFRSPCC: + return int32(OPVCC(63, 12, 0, 1)) + case AFRSQRTE: + return int32(OPVCC(63, 26, 0, 0)) + case AFRSQRTECC: + return int32(OPVCC(63, 26, 0, 1)) + case AFSEL: + return int32(OPVCC(63, 23, 0, 0)) + case AFSELCC: + return int32(OPVCC(63, 23, 0, 1)) + case AFSQRT: + return int32(OPVCC(63, 22, 0, 0)) + case AFSQRTCC: + return int32(OPVCC(63, 22, 0, 1)) + case AFSQRTS: + return int32(OPVCC(59, 22, 0, 0)) + case AFSQRTSCC: + return int32(OPVCC(59, 22, 0, 1)) + case AFSUB: + return int32(OPVCC(63, 20, 0, 0)) + case AFSUBCC: + return int32(OPVCC(63, 20, 0, 1)) + case AFSUBS: + return int32(OPVCC(59, 20, 0, 0)) + case AFSUBSCC: + return int32(OPVCC(59, 20, 0, 1)) + + case AICBI: + return int32(OPVCC(31, 982, 0, 0)) + case AISYNC: + return int32(OPVCC(19, 150, 0, 0)) + + case AMTFSB0: + return int32(OPVCC(63, 70, 0, 0)) + case AMTFSB0CC: + return int32(OPVCC(63, 70, 0, 1)) + case AMTFSB1: + return int32(OPVCC(63, 38, 0, 0)) + case AMTFSB1CC: + return int32(OPVCC(63, 38, 0, 1)) + + case AMULHW: + return int32(OPVCC(31, 75, 0, 0)) + case AMULHWCC: + return int32(OPVCC(31, 75, 0, 1)) + case AMULHWU: + return int32(OPVCC(31, 11, 0, 0)) + case AMULHWUCC: + return int32(OPVCC(31, 11, 0, 1)) + case AMULLW: + return int32(OPVCC(31, 235, 0, 0)) + case AMULLWCC: + return int32(OPVCC(31, 235, 0, 1)) + case AMULLWV: + return int32(OPVCC(31, 235, 1, 0)) + case AMULLWVCC: + return int32(OPVCC(31, 235, 1, 1)) + + case AMULHD: + return int32(OPVCC(31, 73, 0, 0)) + case AMULHDCC: + return int32(OPVCC(31, 73, 0, 1)) + case AMULHDU: + return int32(OPVCC(31, 9, 0, 0)) + case AMULHDUCC: + return int32(OPVCC(31, 9, 0, 1)) + case AMULLD: + return int32(OPVCC(31, 233, 0, 0)) + case AMULLDCC: + return int32(OPVCC(31, 233, 0, 1)) + case AMULLDV: + return int32(OPVCC(31, 233, 1, 0)) + case AMULLDVCC: + return int32(OPVCC(31, 233, 1, 1)) + + case ANAND: + return int32(OPVCC(31, 476, 0, 0)) + case ANANDCC: + return int32(OPVCC(31, 476, 0, 1)) + case ANEG: + return int32(OPVCC(31, 104, 0, 0)) + case ANEGCC: + return int32(OPVCC(31, 104, 0, 1)) + case ANEGV: + return int32(OPVCC(31, 104, 1, 0)) + case ANEGVCC: + return int32(OPVCC(31, 104, 1, 1)) + case ANOR: + return int32(OPVCC(31, 124, 0, 0)) + case ANORCC: + return int32(OPVCC(31, 124, 0, 1)) + case AOR: + return int32(OPVCC(31, 444, 0, 0)) + case AORCC: + return int32(OPVCC(31, 444, 0, 1)) + case AORN: + return int32(OPVCC(31, 412, 0, 0)) + case AORNCC: + return int32(OPVCC(31, 412, 0, 1)) + + case ARFI: + return int32(OPVCC(19, 50, 0, 0)) + case ARFCI: + return int32(OPVCC(19, 51, 0, 0)) + case ARFID: + return int32(OPVCC(19, 18, 0, 0)) + case AHRFID: + return int32(OPVCC(19, 274, 0, 0)) + + case ARLWMI: + return int32(OPVCC(20, 0, 0, 0)) + case ARLWMICC: + return int32(OPVCC(20, 0, 0, 1)) + case ARLWNM: + return int32(OPVCC(23, 0, 0, 0)) + case ARLWNMCC: + return int32(OPVCC(23, 0, 0, 1)) + + case ARLDCL: + return int32(OPVCC(30, 8, 0, 0)) + case ARLDCR: + return int32(OPVCC(30, 9, 0, 0)) + + case ASYSCALL: + return int32(OPVCC(17, 1, 0, 0)) + + case ASLW: + return int32(OPVCC(31, 24, 0, 0)) + case ASLWCC: + return int32(OPVCC(31, 24, 0, 1)) + case ASLD: + return int32(OPVCC(31, 27, 0, 0)) + case ASLDCC: + return int32(OPVCC(31, 27, 0, 1)) + + case ASRAW: + return int32(OPVCC(31, 792, 0, 0)) + case ASRAWCC: + return int32(OPVCC(31, 792, 0, 1)) + case ASRAD: + return int32(OPVCC(31, 794, 0, 0)) + case ASRADCC: + return int32(OPVCC(31, 794, 0, 1)) + + case ASRW: + return int32(OPVCC(31, 536, 0, 0)) + case ASRWCC: + return int32(OPVCC(31, 536, 0, 1)) + case ASRD: + return int32(OPVCC(31, 539, 0, 0)) + case ASRDCC: + return int32(OPVCC(31, 539, 0, 1)) + + case ASUB: + return int32(OPVCC(31, 40, 0, 0)) + case ASUBCC: + return int32(OPVCC(31, 40, 0, 1)) + case ASUBV: + return int32(OPVCC(31, 40, 1, 0)) + case ASUBVCC: + return int32(OPVCC(31, 40, 1, 1)) + case ASUBC: + return int32(OPVCC(31, 8, 0, 0)) + case ASUBCCC: + return int32(OPVCC(31, 8, 0, 1)) + case ASUBCV: + return int32(OPVCC(31, 8, 1, 0)) + case ASUBCVCC: + return int32(OPVCC(31, 8, 1, 1)) + case ASUBE: + return int32(OPVCC(31, 136, 0, 0)) + case ASUBECC: + return int32(OPVCC(31, 136, 0, 1)) + case ASUBEV: + return int32(OPVCC(31, 136, 1, 0)) + case ASUBEVCC: + return int32(OPVCC(31, 136, 1, 1)) + case ASUBME: + return int32(OPVCC(31, 232, 0, 0)) + case ASUBMECC: + return int32(OPVCC(31, 232, 0, 1)) + case ASUBMEV: + return int32(OPVCC(31, 232, 1, 0)) + case ASUBMEVCC: + return int32(OPVCC(31, 232, 1, 1)) + case ASUBZE: + return int32(OPVCC(31, 200, 0, 0)) + case ASUBZECC: + return int32(OPVCC(31, 200, 0, 1)) + case ASUBZEV: + return int32(OPVCC(31, 200, 1, 0)) + case ASUBZEVCC: + return int32(OPVCC(31, 200, 1, 1)) + + case ASYNC: + return int32(OPVCC(31, 598, 0, 0)) + case APTESYNC: + return int32(OPVCC(31, 598, 0, 0) | 2<<21) + + case ATLBIE: + return int32(OPVCC(31, 306, 0, 0)) + case ATLBIEL: + return int32(OPVCC(31, 274, 0, 0)) + case ATLBSYNC: + return int32(OPVCC(31, 566, 0, 0)) + case ASLBIA: + return int32(OPVCC(31, 498, 0, 0)) + case ASLBIE: + return int32(OPVCC(31, 434, 0, 0)) + case ASLBMFEE: + return int32(OPVCC(31, 915, 0, 0)) + case ASLBMFEV: + return int32(OPVCC(31, 851, 0, 0)) + case ASLBMTE: + return int32(OPVCC(31, 402, 0, 0)) + + case ATW: + return int32(OPVCC(31, 4, 0, 0)) + case ATD: + return int32(OPVCC(31, 68, 0, 0)) + + case AXOR: + return int32(OPVCC(31, 316, 0, 0)) + case AXORCC: + return int32(OPVCC(31, 316, 0, 1)) + } + + ctxt.Diag("bad r/r opcode %v", obj.Aconv(a)) + return 0 +} + +func opirr(ctxt *obj.Link, a int) int32 { + switch a { + case AADD: + return int32(OPVCC(14, 0, 0, 0)) + case AADDC: + return int32(OPVCC(12, 0, 0, 0)) + case AADDCCC: + return int32(OPVCC(13, 0, 0, 0)) + case AADD + ALAST: + return int32(OPVCC(15, 0, 0, 0)) /* ADDIS/CAU */ + + case AANDCC: + return int32(OPVCC(28, 0, 0, 0)) + case AANDCC + ALAST: + return int32(OPVCC(29, 0, 0, 0)) /* ANDIS./ANDIU. */ + + case ABR: + return int32(OPVCC(18, 0, 0, 0)) + case ABL: + return int32(OPVCC(18, 0, 0, 0) | 1) + case obj.ADUFFZERO: + return int32(OPVCC(18, 0, 0, 0) | 1) + case obj.ADUFFCOPY: + return int32(OPVCC(18, 0, 0, 0) | 1) + case ABC: + return int32(OPVCC(16, 0, 0, 0)) + case ABCL: + return int32(OPVCC(16, 0, 0, 0) | 1) + + case ABEQ: + return int32(AOP_RRR(16<<26, 12, 2, 0)) + case ABGE: + return int32(AOP_RRR(16<<26, 4, 0, 0)) + case ABGT: + return int32(AOP_RRR(16<<26, 12, 1, 0)) + case ABLE: + return int32(AOP_RRR(16<<26, 4, 1, 0)) + case ABLT: + return int32(AOP_RRR(16<<26, 12, 0, 0)) + case ABNE: + return int32(AOP_RRR(16<<26, 4, 2, 0)) + case ABVC: + return int32(AOP_RRR(16<<26, 4, 3, 0)) + case ABVS: + return int32(AOP_RRR(16<<26, 12, 3, 0)) + + case ACMP: + return int32(OPVCC(11, 0, 0, 0) | 1<<21) /* L=1 */ + case ACMPU: + return int32(OPVCC(10, 0, 0, 0) | 1<<21) + case ACMPW: + return int32(OPVCC(11, 0, 0, 0)) /* L=0 */ + case ACMPWU: + return int32(OPVCC(10, 0, 0, 0)) + case ALSW: + return int32(OPVCC(31, 597, 0, 0)) + + case AMULLW: + return int32(OPVCC(7, 0, 0, 0)) + + case AOR: + return int32(OPVCC(24, 0, 0, 0)) + case AOR + ALAST: + return int32(OPVCC(25, 0, 0, 0)) /* ORIS/ORIU */ + + case ARLWMI: + return int32(OPVCC(20, 0, 0, 0)) /* rlwimi */ + case ARLWMICC: + return int32(OPVCC(20, 0, 0, 1)) + case ARLDMI: + return int32(OPVCC(30, 0, 0, 0) | 3<<2) /* rldimi */ + case ARLDMICC: + return int32(OPVCC(30, 0, 0, 1) | 3<<2) + + case ARLWNM: + return int32(OPVCC(21, 0, 0, 0)) /* rlwinm */ + case ARLWNMCC: + return int32(OPVCC(21, 0, 0, 1)) + + case ARLDCL: + return int32(OPVCC(30, 0, 0, 0)) /* rldicl */ + case ARLDCLCC: + return int32(OPVCC(30, 0, 0, 1)) + case ARLDCR: + return int32(OPVCC(30, 1, 0, 0)) /* rldicr */ + case ARLDCRCC: + return int32(OPVCC(30, 1, 0, 1)) + case ARLDC: + return int32(OPVCC(30, 0, 0, 0) | 2<<2) + case ARLDCCC: + return int32(OPVCC(30, 0, 0, 1) | 2<<2) + + case ASRAW: + return int32(OPVCC(31, 824, 0, 0)) + case ASRAWCC: + return int32(OPVCC(31, 824, 0, 1)) + case ASRAD: + return int32(OPVCC(31, (413 << 1), 0, 0)) + case ASRADCC: + return int32(OPVCC(31, (413 << 1), 0, 1)) + + case ASTSW: + return int32(OPVCC(31, 725, 0, 0)) + + case ASUBC: + return int32(OPVCC(8, 0, 0, 0)) + + case ATW: + return int32(OPVCC(3, 0, 0, 0)) + case ATD: + return int32(OPVCC(2, 0, 0, 0)) + + case AXOR: + return int32(OPVCC(26, 0, 0, 0)) /* XORIL */ + case AXOR + ALAST: + return int32(OPVCC(27, 0, 0, 0)) /* XORIU */ + } + + ctxt.Diag("bad opcode i/r %v", obj.Aconv(a)) + return 0 +} + +/* + * load o(a),d + */ +func opload(ctxt *obj.Link, a int) int32 { + switch a { + case AMOVD: + return int32(OPVCC(58, 0, 0, 0)) /* ld */ + case AMOVDU: + return int32(OPVCC(58, 0, 0, 1)) /* ldu */ + case AMOVWZ: + return int32(OPVCC(32, 0, 0, 0)) /* lwz */ + case AMOVWZU: + return int32(OPVCC(33, 0, 0, 0)) /* lwzu */ + case AMOVW: + return int32(OPVCC(58, 0, 0, 0) | 1<<1) /* lwa */ + + /* no AMOVWU */ + case AMOVB, AMOVBZ: + return int32(OPVCC(34, 0, 0, 0)) + /* load */ + + case AMOVBU, AMOVBZU: + return int32(OPVCC(35, 0, 0, 0)) + case AFMOVD: + return int32(OPVCC(50, 0, 0, 0)) + case AFMOVDU: + return int32(OPVCC(51, 0, 0, 0)) + case AFMOVS: + return int32(OPVCC(48, 0, 0, 0)) + case AFMOVSU: + return int32(OPVCC(49, 0, 0, 0)) + case AMOVH: + return int32(OPVCC(42, 0, 0, 0)) + case AMOVHU: + return int32(OPVCC(43, 0, 0, 0)) + case AMOVHZ: + return int32(OPVCC(40, 0, 0, 0)) + case AMOVHZU: + return int32(OPVCC(41, 0, 0, 0)) + case AMOVMW: + return int32(OPVCC(46, 0, 0, 0)) /* lmw */ + } + + ctxt.Diag("bad load opcode %v", obj.Aconv(a)) + return 0 +} + +/* + * indexed load a(b),d + */ +func oploadx(ctxt *obj.Link, a int) int32 { + switch a { + case AMOVWZ: + return int32(OPVCC(31, 23, 0, 0)) /* lwzx */ + case AMOVWZU: + return int32(OPVCC(31, 55, 0, 0)) /* lwzux */ + case AMOVW: + return int32(OPVCC(31, 341, 0, 0)) /* lwax */ + case AMOVWU: + return int32(OPVCC(31, 373, 0, 0)) /* lwaux */ + + case AMOVB, AMOVBZ: + return int32(OPVCC(31, 87, 0, 0)) /* lbzx */ + + case AMOVBU, AMOVBZU: + return int32(OPVCC(31, 119, 0, 0)) /* lbzux */ + case AFMOVD: + return int32(OPVCC(31, 599, 0, 0)) /* lfdx */ + case AFMOVDU: + return int32(OPVCC(31, 631, 0, 0)) /* lfdux */ + case AFMOVS: + return int32(OPVCC(31, 535, 0, 0)) /* lfsx */ + case AFMOVSU: + return int32(OPVCC(31, 567, 0, 0)) /* lfsux */ + case AMOVH: + return int32(OPVCC(31, 343, 0, 0)) /* lhax */ + case AMOVHU: + return int32(OPVCC(31, 375, 0, 0)) /* lhaux */ + case AMOVHBR: + return int32(OPVCC(31, 790, 0, 0)) /* lhbrx */ + case AMOVWBR: + return int32(OPVCC(31, 534, 0, 0)) /* lwbrx */ + case AMOVHZ: + return int32(OPVCC(31, 279, 0, 0)) /* lhzx */ + case AMOVHZU: + return int32(OPVCC(31, 311, 0, 0)) /* lhzux */ + case AECIWX: + return int32(OPVCC(31, 310, 0, 0)) /* eciwx */ + case ALWAR: + return int32(OPVCC(31, 20, 0, 0)) /* lwarx */ + case ALDAR: + return int32(OPVCC(31, 84, 0, 0)) + case ALSW: + return int32(OPVCC(31, 533, 0, 0)) /* lswx */ + case AMOVD: + return int32(OPVCC(31, 21, 0, 0)) /* ldx */ + case AMOVDU: + return int32(OPVCC(31, 53, 0, 0)) /* ldux */ + } + + ctxt.Diag("bad loadx opcode %v", obj.Aconv(a)) + return 0 +} + +/* + * store s,o(d) + */ +func opstore(ctxt *obj.Link, a int) int32 { + switch a { + case AMOVB, AMOVBZ: + return int32(OPVCC(38, 0, 0, 0)) /* stb */ + + case AMOVBU, AMOVBZU: + return int32(OPVCC(39, 0, 0, 0)) /* stbu */ + case AFMOVD: + return int32(OPVCC(54, 0, 0, 0)) /* stfd */ + case AFMOVDU: + return int32(OPVCC(55, 0, 0, 0)) /* stfdu */ + case AFMOVS: + return int32(OPVCC(52, 0, 0, 0)) /* stfs */ + case AFMOVSU: + return int32(OPVCC(53, 0, 0, 0)) /* stfsu */ + + case AMOVHZ, AMOVH: + return int32(OPVCC(44, 0, 0, 0)) /* sth */ + + case AMOVHZU, AMOVHU: + return int32(OPVCC(45, 0, 0, 0)) /* sthu */ + case AMOVMW: + return int32(OPVCC(47, 0, 0, 0)) /* stmw */ + case ASTSW: + return int32(OPVCC(31, 725, 0, 0)) /* stswi */ + + case AMOVWZ, AMOVW: + return int32(OPVCC(36, 0, 0, 0)) /* stw */ + + case AMOVWZU, AMOVWU: + return int32(OPVCC(37, 0, 0, 0)) /* stwu */ + case AMOVD: + return int32(OPVCC(62, 0, 0, 0)) /* std */ + case AMOVDU: + return int32(OPVCC(62, 0, 0, 1)) /* stdu */ + } + + ctxt.Diag("unknown store opcode %v", obj.Aconv(a)) + return 0 +} + +/* + * indexed store s,a(b) + */ +func opstorex(ctxt *obj.Link, a int) int32 { + switch a { + case AMOVB, AMOVBZ: + return int32(OPVCC(31, 215, 0, 0)) /* stbx */ + + case AMOVBU, AMOVBZU: + return int32(OPVCC(31, 247, 0, 0)) /* stbux */ + case AFMOVD: + return int32(OPVCC(31, 727, 0, 0)) /* stfdx */ + case AFMOVDU: + return int32(OPVCC(31, 759, 0, 0)) /* stfdux */ + case AFMOVS: + return int32(OPVCC(31, 663, 0, 0)) /* stfsx */ + case AFMOVSU: + return int32(OPVCC(31, 695, 0, 0)) /* stfsux */ + + case AMOVHZ, AMOVH: + return int32(OPVCC(31, 407, 0, 0)) /* sthx */ + case AMOVHBR: + return int32(OPVCC(31, 918, 0, 0)) /* sthbrx */ + + case AMOVHZU, AMOVHU: + return int32(OPVCC(31, 439, 0, 0)) /* sthux */ + + case AMOVWZ, AMOVW: + return int32(OPVCC(31, 151, 0, 0)) /* stwx */ + + case AMOVWZU, AMOVWU: + return int32(OPVCC(31, 183, 0, 0)) /* stwux */ + case ASTSW: + return int32(OPVCC(31, 661, 0, 0)) /* stswx */ + case AMOVWBR: + return int32(OPVCC(31, 662, 0, 0)) /* stwbrx */ + case ASTWCCC: + return int32(OPVCC(31, 150, 0, 1)) /* stwcx. */ + case ASTDCCC: + return int32(OPVCC(31, 214, 0, 1)) /* stwdx. */ + case AECOWX: + return int32(OPVCC(31, 438, 0, 0)) /* ecowx */ + case AMOVD: + return int32(OPVCC(31, 149, 0, 0)) /* stdx */ + case AMOVDU: + return int32(OPVCC(31, 181, 0, 0)) /* stdux */ + } + + ctxt.Diag("unknown storex opcode %v", obj.Aconv(a)) + return 0 +} diff --git a/src/cmd/internal/obj/ppc64/list9.go b/src/cmd/internal/obj/ppc64/list9.go new file mode 100644 index 0000000000000000000000000000000000000000..4cdcfbcd27952b5120ed2d0ef769d59e1046e36f --- /dev/null +++ b/src/cmd/internal/obj/ppc64/list9.go @@ -0,0 +1,98 @@ +// cmd/9l/list.c from Vita Nuova. +// +// Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved. +// Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net) +// Portions Copyright © 1997-1999 Vita Nuova Limited +// Portions Copyright © 2000-2008 Vita Nuova Holdings Limited (www.vitanuova.com) +// Portions Copyright © 2004,2006 Bruce Ellis +// Portions Copyright © 2005-2007 C H Forsyth (forsyth@terzarima.net) +// Revisions Copyright © 2000-2008 Lucent Technologies Inc. and others +// Portions Copyright © 2009 The Go Authors. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +package ppc64 + +import ( + "cmd/internal/obj" + "fmt" +) + +func init() { + obj.RegisterRegister(obj.RBasePPC64, REG_DCR0+1024, Rconv) + obj.RegisterOpcode(obj.ABasePPC64, Anames) +} + +func Rconv(r int) string { + if r == 0 { + return "NONE" + } + if r == REGG { + // Special case. + return "g" + } + if REG_R0 <= r && r <= REG_R31 { + return fmt.Sprintf("R%d", r-REG_R0) + } + if REG_F0 <= r && r <= REG_F31 { + return fmt.Sprintf("F%d", r-REG_F0) + } + if REG_CR0 <= r && r <= REG_CR7 { + return fmt.Sprintf("CR%d", r-REG_CR0) + } + if r == REG_CR { + return "CR" + } + if REG_SPR0 <= r && r <= REG_SPR0+1023 { + switch r { + case REG_XER: + return "XER" + + case REG_LR: + return "LR" + + case REG_CTR: + return "CTR" + } + + return fmt.Sprintf("SPR(%d)", r-REG_SPR0) + } + + if REG_DCR0 <= r && r <= REG_DCR0+1023 { + return fmt.Sprintf("DCR(%d)", r-REG_DCR0) + } + if r == REG_FPSCR { + return "FPSCR" + } + if r == REG_MSR { + return "MSR" + } + + return fmt.Sprintf("Rgok(%d)", r-obj.RBasePPC64) +} + +func DRconv(a int) string { + s := "C_??" + if a >= C_NONE && a <= C_NCLASS { + s = cnames9[a] + } + var fp string + fp += s + return fp +} diff --git a/src/cmd/internal/obj/ppc64/obj9.go b/src/cmd/internal/obj/ppc64/obj9.go new file mode 100644 index 0000000000000000000000000000000000000000..1eddc6fc6cba97e77b0de2279ce1c902d2b6668f --- /dev/null +++ b/src/cmd/internal/obj/ppc64/obj9.go @@ -0,0 +1,968 @@ +// cmd/9l/noop.c, cmd/9l/pass.c, cmd/9l/span.c from Vita Nuova. +// +// Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved. +// Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net) +// Portions Copyright © 1997-1999 Vita Nuova Limited +// Portions Copyright © 2000-2008 Vita Nuova Holdings Limited (www.vitanuova.com) +// Portions Copyright © 2004,2006 Bruce Ellis +// Portions Copyright © 2005-2007 C H Forsyth (forsyth@terzarima.net) +// Revisions Copyright © 2000-2008 Lucent Technologies Inc. and others +// Portions Copyright © 2009 The Go Authors. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +package ppc64 + +import ( + "cmd/internal/obj" + "encoding/binary" + "fmt" + "math" +) + +func progedit(ctxt *obj.Link, p *obj.Prog) { + p.From.Class = 0 + p.To.Class = 0 + + // Rewrite BR/BL to symbol as TYPE_BRANCH. + switch p.As { + case ABR, + ABL, + obj.ARET, + obj.ADUFFZERO, + obj.ADUFFCOPY: + if p.To.Sym != nil { + p.To.Type = obj.TYPE_BRANCH + } + } + + // Rewrite float constants to values stored in memory. + switch p.As { + case AFMOVS: + if p.From.Type == obj.TYPE_FCONST { + f32 := float32(p.From.Val.(float64)) + i32 := math.Float32bits(f32) + literal := fmt.Sprintf("$f32.%08x", i32) + s := obj.Linklookup(ctxt, literal, 0) + s.Size = 4 + p.From.Type = obj.TYPE_MEM + p.From.Sym = s + p.From.Name = obj.NAME_EXTERN + p.From.Offset = 0 + } + + case AFMOVD: + if p.From.Type == obj.TYPE_FCONST { + i64 := math.Float64bits(p.From.Val.(float64)) + literal := fmt.Sprintf("$f64.%016x", i64) + s := obj.Linklookup(ctxt, literal, 0) + s.Size = 8 + p.From.Type = obj.TYPE_MEM + p.From.Sym = s + p.From.Name = obj.NAME_EXTERN + p.From.Offset = 0 + } + + // Put >32-bit constants in memory and load them + case AMOVD: + if p.From.Type == obj.TYPE_CONST && p.From.Name == obj.NAME_NONE && p.From.Reg == 0 && int64(int32(p.From.Offset)) != p.From.Offset { + literal := fmt.Sprintf("$i64.%016x", uint64(p.From.Offset)) + s := obj.Linklookup(ctxt, literal, 0) + s.Size = 8 + p.From.Type = obj.TYPE_MEM + p.From.Sym = s + p.From.Name = obj.NAME_EXTERN + p.From.Offset = 0 + } + } + + // Rewrite SUB constants into ADD. + switch p.As { + case ASUBC: + if p.From.Type == obj.TYPE_CONST { + p.From.Offset = -p.From.Offset + p.As = AADDC + } + + case ASUBCCC: + if p.From.Type == obj.TYPE_CONST { + p.From.Offset = -p.From.Offset + p.As = AADDCCC + } + + case ASUB: + if p.From.Type == obj.TYPE_CONST { + p.From.Offset = -p.From.Offset + p.As = AADD + } + } +} + +func preprocess(ctxt *obj.Link, cursym *obj.LSym) { + // TODO(minux): add morestack short-cuts with small fixed frame-size. + ctxt.Cursym = cursym + + if cursym.Text == nil || cursym.Text.Link == nil { + return + } + + p := cursym.Text + textstksiz := p.To.Offset + + cursym.Args = p.To.Val.(int32) + cursym.Locals = int32(textstksiz) + + /* + * find leaf subroutines + * strip NOPs + * expand RET + * expand BECOME pseudo + */ + if ctxt.Debugvlog != 0 { + fmt.Fprintf(ctxt.Bso, "%5.2f noops\n", obj.Cputime()) + } + ctxt.Bso.Flush() + + var q *obj.Prog + var q1 *obj.Prog + for p := cursym.Text; p != nil; p = p.Link { + switch p.As { + /* too hard, just leave alone */ + case obj.ATEXT: + q = p + + p.Mark |= LABEL | LEAF | SYNC + if p.Link != nil { + p.Link.Mark |= LABEL + } + + case ANOR: + q = p + if p.To.Type == obj.TYPE_REG { + if p.To.Reg == REGZERO { + p.Mark |= LABEL | SYNC + } + } + + case ALWAR, + ASTWCCC, + AECIWX, + AECOWX, + AEIEIO, + AICBI, + AISYNC, + ATLBIE, + ATLBIEL, + ASLBIA, + ASLBIE, + ASLBMFEE, + ASLBMFEV, + ASLBMTE, + ADCBF, + ADCBI, + ADCBST, + ADCBT, + ADCBTST, + ADCBZ, + ASYNC, + ATLBSYNC, + APTESYNC, + ATW, + AWORD, + ARFI, + ARFCI, + ARFID, + AHRFID: + q = p + p.Mark |= LABEL | SYNC + continue + + case AMOVW, AMOVWZ, AMOVD: + q = p + if p.From.Reg >= REG_SPECIAL || p.To.Reg >= REG_SPECIAL { + p.Mark |= LABEL | SYNC + } + continue + + case AFABS, + AFABSCC, + AFADD, + AFADDCC, + AFCTIW, + AFCTIWCC, + AFCTIWZ, + AFCTIWZCC, + AFDIV, + AFDIVCC, + AFMADD, + AFMADDCC, + AFMOVD, + AFMOVDU, + /* case AFMOVDS: */ + AFMOVS, + AFMOVSU, + + /* case AFMOVSD: */ + AFMSUB, + AFMSUBCC, + AFMUL, + AFMULCC, + AFNABS, + AFNABSCC, + AFNEG, + AFNEGCC, + AFNMADD, + AFNMADDCC, + AFNMSUB, + AFNMSUBCC, + AFRSP, + AFRSPCC, + AFSUB, + AFSUBCC: + q = p + + p.Mark |= FLOAT + continue + + case ABL, + ABCL, + obj.ADUFFZERO, + obj.ADUFFCOPY: + cursym.Text.Mark &^= LEAF + fallthrough + + case ABC, + ABEQ, + ABGE, + ABGT, + ABLE, + ABLT, + ABNE, + ABR, + ABVC, + ABVS: + p.Mark |= BRANCH + q = p + q1 = p.Pcond + if q1 != nil { + for q1.As == obj.ANOP { + q1 = q1.Link + p.Pcond = q1 + } + + if q1.Mark&LEAF == 0 { + q1.Mark |= LABEL + } + } else { + p.Mark |= LABEL + } + q1 = p.Link + if q1 != nil { + q1.Mark |= LABEL + } + continue + + case AFCMPO, AFCMPU: + q = p + p.Mark |= FCMP | FLOAT + continue + + case obj.ARET: + q = p + if p.Link != nil { + p.Link.Mark |= LABEL + } + continue + + case obj.ANOP: + q1 = p.Link + q.Link = q1 /* q is non-nop */ + q1.Mark |= p.Mark + continue + + default: + q = p + continue + } + } + + autosize := int32(0) + var aoffset int + var mov int + var o int + var p1 *obj.Prog + var p2 *obj.Prog + for p := cursym.Text; p != nil; p = p.Link { + o = int(p.As) + switch o { + case obj.ATEXT: + mov = AMOVD + aoffset = 0 + autosize = int32(textstksiz + 8) + if (p.Mark&LEAF != 0) && autosize <= 8 { + autosize = 0 + } else if autosize&4 != 0 { + autosize += 4 + } + p.To.Offset = int64(autosize) - 8 + + if p.From3.Offset&obj.NOSPLIT == 0 { + p = stacksplit(ctxt, p, autosize) // emit split check + } + + q = p + + if autosize != 0 { + /* use MOVDU to adjust R1 when saving R31, if autosize is small */ + if cursym.Text.Mark&LEAF == 0 && autosize >= -BIG && autosize <= BIG { + mov = AMOVDU + aoffset = int(-autosize) + } else { + q = obj.Appendp(ctxt, p) + q.As = AADD + q.Lineno = p.Lineno + q.From.Type = obj.TYPE_CONST + q.From.Offset = int64(-autosize) + q.To.Type = obj.TYPE_REG + q.To.Reg = REGSP + q.Spadj = +autosize + } + } else if cursym.Text.Mark&LEAF == 0 { + if ctxt.Debugvlog != 0 { + fmt.Fprintf(ctxt.Bso, "save suppressed in: %s\n", cursym.Name) + ctxt.Bso.Flush() + } + + cursym.Text.Mark |= LEAF + } + + if cursym.Text.Mark&LEAF != 0 { + cursym.Leaf = 1 + break + } + + q = obj.Appendp(ctxt, q) + q.As = AMOVD + q.Lineno = p.Lineno + q.From.Type = obj.TYPE_REG + q.From.Reg = REG_LR + q.To.Type = obj.TYPE_REG + q.To.Reg = REGTMP + + q = obj.Appendp(ctxt, q) + q.As = int16(mov) + q.Lineno = p.Lineno + q.From.Type = obj.TYPE_REG + q.From.Reg = REGTMP + q.To.Type = obj.TYPE_MEM + q.To.Offset = int64(aoffset) + q.To.Reg = REGSP + if q.As == AMOVDU { + q.Spadj = int32(-aoffset) + } + + if cursym.Text.From3.Offset&obj.WRAPPER != 0 { + // if(g->panic != nil && g->panic->argp == FP) g->panic->argp = bottom-of-frame + // + // MOVD g_panic(g), R3 + // CMP R0, R3 + // BEQ end + // MOVD panic_argp(R3), R4 + // ADD $(autosize+8), R1, R5 + // CMP R4, R5 + // BNE end + // ADD $8, R1, R6 + // MOVD R6, panic_argp(R3) + // end: + // NOP + // + // The NOP is needed to give the jumps somewhere to land. + // It is a liblink NOP, not a ppc64 NOP: it encodes to 0 instruction bytes. + + q = obj.Appendp(ctxt, q) + + q.As = AMOVD + q.From.Type = obj.TYPE_MEM + q.From.Reg = REGG + q.From.Offset = 4 * int64(ctxt.Arch.Ptrsize) // G.panic + q.To.Type = obj.TYPE_REG + q.To.Reg = REG_R3 + + q = obj.Appendp(ctxt, q) + q.As = ACMP + q.From.Type = obj.TYPE_REG + q.From.Reg = REG_R0 + q.To.Type = obj.TYPE_REG + q.To.Reg = REG_R3 + + q = obj.Appendp(ctxt, q) + q.As = ABEQ + q.To.Type = obj.TYPE_BRANCH + p1 = q + + q = obj.Appendp(ctxt, q) + q.As = AMOVD + q.From.Type = obj.TYPE_MEM + q.From.Reg = REG_R3 + q.From.Offset = 0 // Panic.argp + q.To.Type = obj.TYPE_REG + q.To.Reg = REG_R4 + + q = obj.Appendp(ctxt, q) + q.As = AADD + q.From.Type = obj.TYPE_CONST + q.From.Offset = int64(autosize) + 8 + q.Reg = REGSP + q.To.Type = obj.TYPE_REG + q.To.Reg = REG_R5 + + q = obj.Appendp(ctxt, q) + q.As = ACMP + q.From.Type = obj.TYPE_REG + q.From.Reg = REG_R4 + q.To.Type = obj.TYPE_REG + q.To.Reg = REG_R5 + + q = obj.Appendp(ctxt, q) + q.As = ABNE + q.To.Type = obj.TYPE_BRANCH + p2 = q + + q = obj.Appendp(ctxt, q) + q.As = AADD + q.From.Type = obj.TYPE_CONST + q.From.Offset = 8 + q.Reg = REGSP + q.To.Type = obj.TYPE_REG + q.To.Reg = REG_R6 + + q = obj.Appendp(ctxt, q) + q.As = AMOVD + q.From.Type = obj.TYPE_REG + q.From.Reg = REG_R6 + q.To.Type = obj.TYPE_MEM + q.To.Reg = REG_R3 + q.To.Offset = 0 // Panic.argp + + q = obj.Appendp(ctxt, q) + + q.As = obj.ANOP + p1.Pcond = q + p2.Pcond = q + } + + case obj.ARET: + if p.From.Type == obj.TYPE_CONST { + ctxt.Diag("using BECOME (%v) is not supported!", p) + break + } + + if p.To.Sym != nil { // retjmp + p.As = ABR + p.To.Type = obj.TYPE_BRANCH + break + } + + if cursym.Text.Mark&LEAF != 0 { + if autosize == 0 { + p.As = ABR + p.From = obj.Addr{} + p.To.Type = obj.TYPE_REG + p.To.Reg = REG_LR + p.Mark |= BRANCH + break + } + + p.As = AADD + p.From.Type = obj.TYPE_CONST + p.From.Offset = int64(autosize) + p.To.Type = obj.TYPE_REG + p.To.Reg = REGSP + p.Spadj = -autosize + + q = ctxt.NewProg() + q.As = ABR + q.Lineno = p.Lineno + q.To.Type = obj.TYPE_REG + q.To.Reg = REG_LR + q.Mark |= BRANCH + q.Spadj = +autosize + + q.Link = p.Link + p.Link = q + break + } + + p.As = AMOVD + p.From.Type = obj.TYPE_MEM + p.From.Offset = 0 + p.From.Reg = REGSP + p.To.Type = obj.TYPE_REG + p.To.Reg = REGTMP + + q = ctxt.NewProg() + q.As = AMOVD + q.Lineno = p.Lineno + q.From.Type = obj.TYPE_REG + q.From.Reg = REGTMP + q.To.Type = obj.TYPE_REG + q.To.Reg = REG_LR + + q.Link = p.Link + p.Link = q + p = q + + if false { + // Debug bad returns + q = ctxt.NewProg() + + q.As = AMOVD + q.Lineno = p.Lineno + q.From.Type = obj.TYPE_MEM + q.From.Offset = 0 + q.From.Reg = REGTMP + q.To.Type = obj.TYPE_REG + q.To.Reg = REGTMP + + q.Link = p.Link + p.Link = q + p = q + } + + if autosize != 0 { + q = ctxt.NewProg() + q.As = AADD + q.Lineno = p.Lineno + q.From.Type = obj.TYPE_CONST + q.From.Offset = int64(autosize) + q.To.Type = obj.TYPE_REG + q.To.Reg = REGSP + q.Spadj = -autosize + + q.Link = p.Link + p.Link = q + } + + q1 = ctxt.NewProg() + q1.As = ABR + q1.Lineno = p.Lineno + q1.To.Type = obj.TYPE_REG + q1.To.Reg = REG_LR + q1.Mark |= BRANCH + q1.Spadj = +autosize + + q1.Link = q.Link + q.Link = q1 + + case AADD: + if p.To.Type == obj.TYPE_REG && p.To.Reg == REGSP && p.From.Type == obj.TYPE_CONST { + p.Spadj = int32(-p.From.Offset) + } + } + } +} + +/* +// instruction scheduling + if(debug['Q'] == 0) + return; + + curtext = nil; + q = nil; // p - 1 + q1 = firstp; // top of block + o = 0; // count of instructions + for(p = firstp; p != nil; p = p1) { + p1 = p->link; + o++; + if(p->mark & NOSCHED){ + if(q1 != p){ + sched(q1, q); + } + for(; p != nil; p = p->link){ + if(!(p->mark & NOSCHED)) + break; + q = p; + } + p1 = p; + q1 = p; + o = 0; + continue; + } + if(p->mark & (LABEL|SYNC)) { + if(q1 != p) + sched(q1, q); + q1 = p; + o = 1; + } + if(p->mark & (BRANCH|SYNC)) { + sched(q1, p); + q1 = p1; + o = 0; + } + if(o >= NSCHED) { + sched(q1, p); + q1 = p1; + o = 0; + } + q = p; + } +*/ +func stacksplit(ctxt *obj.Link, p *obj.Prog, framesize int32) *obj.Prog { + // MOVD g_stackguard(g), R3 + p = obj.Appendp(ctxt, p) + + p.As = AMOVD + p.From.Type = obj.TYPE_MEM + p.From.Reg = REGG + p.From.Offset = 2 * int64(ctxt.Arch.Ptrsize) // G.stackguard0 + if ctxt.Cursym.Cfunc != 0 { + p.From.Offset = 3 * int64(ctxt.Arch.Ptrsize) // G.stackguard1 + } + p.To.Type = obj.TYPE_REG + p.To.Reg = REG_R3 + + var q *obj.Prog + if framesize <= obj.StackSmall { + // small stack: SP < stackguard + // CMP stackguard, SP + p = obj.Appendp(ctxt, p) + + p.As = ACMPU + p.From.Type = obj.TYPE_REG + p.From.Reg = REG_R3 + p.To.Type = obj.TYPE_REG + p.To.Reg = REGSP + } else if framesize <= obj.StackBig { + // large stack: SP-framesize < stackguard-StackSmall + // ADD $-framesize, SP, R4 + // CMP stackguard, R4 + p = obj.Appendp(ctxt, p) + + p.As = AADD + p.From.Type = obj.TYPE_CONST + p.From.Offset = int64(-framesize) + p.Reg = REGSP + p.To.Type = obj.TYPE_REG + p.To.Reg = REG_R4 + + p = obj.Appendp(ctxt, p) + p.As = ACMPU + p.From.Type = obj.TYPE_REG + p.From.Reg = REG_R3 + p.To.Type = obj.TYPE_REG + p.To.Reg = REG_R4 + } else { + // Such a large stack we need to protect against wraparound. + // If SP is close to zero: + // SP-stackguard+StackGuard <= framesize + (StackGuard-StackSmall) + // The +StackGuard on both sides is required to keep the left side positive: + // SP is allowed to be slightly below stackguard. See stack.h. + // + // Preemption sets stackguard to StackPreempt, a very large value. + // That breaks the math above, so we have to check for that explicitly. + // // stackguard is R3 + // CMP R3, $StackPreempt + // BEQ label-of-call-to-morestack + // ADD $StackGuard, SP, R4 + // SUB R3, R4 + // MOVD $(framesize+(StackGuard-StackSmall)), R31 + // CMPU R31, R4 + p = obj.Appendp(ctxt, p) + + p.As = ACMP + p.From.Type = obj.TYPE_REG + p.From.Reg = REG_R3 + p.To.Type = obj.TYPE_CONST + p.To.Offset = obj.StackPreempt + + p = obj.Appendp(ctxt, p) + q = p + p.As = ABEQ + p.To.Type = obj.TYPE_BRANCH + + p = obj.Appendp(ctxt, p) + p.As = AADD + p.From.Type = obj.TYPE_CONST + p.From.Offset = obj.StackGuard + p.Reg = REGSP + p.To.Type = obj.TYPE_REG + p.To.Reg = REG_R4 + + p = obj.Appendp(ctxt, p) + p.As = ASUB + p.From.Type = obj.TYPE_REG + p.From.Reg = REG_R3 + p.To.Type = obj.TYPE_REG + p.To.Reg = REG_R4 + + p = obj.Appendp(ctxt, p) + p.As = AMOVD + p.From.Type = obj.TYPE_CONST + p.From.Offset = int64(framesize) + obj.StackGuard - obj.StackSmall + p.To.Type = obj.TYPE_REG + p.To.Reg = REGTMP + + p = obj.Appendp(ctxt, p) + p.As = ACMPU + p.From.Type = obj.TYPE_REG + p.From.Reg = REGTMP + p.To.Type = obj.TYPE_REG + p.To.Reg = REG_R4 + } + + // q1: BLT done + p = obj.Appendp(ctxt, p) + q1 := p + + p.As = ABLT + p.To.Type = obj.TYPE_BRANCH + + // MOVD LR, R5 + p = obj.Appendp(ctxt, p) + + p.As = AMOVD + p.From.Type = obj.TYPE_REG + p.From.Reg = REG_LR + p.To.Type = obj.TYPE_REG + p.To.Reg = REG_R5 + if q != nil { + q.Pcond = p + } + + // BL runtime.morestack(SB) + p = obj.Appendp(ctxt, p) + + p.As = ABL + p.To.Type = obj.TYPE_BRANCH + if ctxt.Cursym.Cfunc != 0 { + p.To.Sym = obj.Linklookup(ctxt, "runtime.morestackc", 0) + } else if ctxt.Cursym.Text.From3.Offset&obj.NEEDCTXT == 0 { + p.To.Sym = obj.Linklookup(ctxt, "runtime.morestack_noctxt", 0) + } else { + p.To.Sym = obj.Linklookup(ctxt, "runtime.morestack", 0) + } + + // BR start + p = obj.Appendp(ctxt, p) + + p.As = ABR + p.To.Type = obj.TYPE_BRANCH + p.Pcond = ctxt.Cursym.Text.Link + + // placeholder for q1's jump target + p = obj.Appendp(ctxt, p) + + p.As = obj.ANOP // zero-width place holder + q1.Pcond = p + + return p +} + +func follow(ctxt *obj.Link, s *obj.LSym) { + ctxt.Cursym = s + + firstp := ctxt.NewProg() + lastp := firstp + xfol(ctxt, s.Text, &lastp) + lastp.Link = nil + s.Text = firstp.Link +} + +func relinv(a int) int { + switch a { + case ABEQ: + return ABNE + case ABNE: + return ABEQ + + case ABGE: + return ABLT + case ABLT: + return ABGE + + case ABGT: + return ABLE + case ABLE: + return ABGT + + case ABVC: + return ABVS + case ABVS: + return ABVC + } + + return 0 +} + +func xfol(ctxt *obj.Link, p *obj.Prog, last **obj.Prog) { + var q *obj.Prog + var r *obj.Prog + var a int + var b int + var i int + +loop: + if p == nil { + return + } + a = int(p.As) + if a == ABR { + q = p.Pcond + if (p.Mark&NOSCHED != 0) || q != nil && (q.Mark&NOSCHED != 0) { + p.Mark |= FOLL + (*last).Link = p + *last = p + p = p.Link + xfol(ctxt, p, last) + p = q + if p != nil && p.Mark&FOLL == 0 { + goto loop + } + return + } + + if q != nil { + p.Mark |= FOLL + p = q + if p.Mark&FOLL == 0 { + goto loop + } + } + } + + if p.Mark&FOLL != 0 { + i = 0 + q = p + for ; i < 4; i, q = i+1, q.Link { + if q == *last || (q.Mark&NOSCHED != 0) { + break + } + b = 0 /* set */ + a = int(q.As) + if a == obj.ANOP { + i-- + continue + } + + if a == ABR || a == obj.ARET || a == ARFI || a == ARFCI || a == ARFID || a == AHRFID { + goto copy + } + if q.Pcond == nil || (q.Pcond.Mark&FOLL != 0) { + continue + } + b = relinv(a) + if b == 0 { + continue + } + + copy: + for { + r = ctxt.NewProg() + *r = *p + if r.Mark&FOLL == 0 { + fmt.Printf("cant happen 1\n") + } + r.Mark |= FOLL + if p != q { + p = p.Link + (*last).Link = r + *last = r + continue + } + + (*last).Link = r + *last = r + if a == ABR || a == obj.ARET || a == ARFI || a == ARFCI || a == ARFID || a == AHRFID { + return + } + r.As = int16(b) + r.Pcond = p.Link + r.Link = p.Pcond + if r.Link.Mark&FOLL == 0 { + xfol(ctxt, r.Link, last) + } + if r.Pcond.Mark&FOLL == 0 { + fmt.Printf("cant happen 2\n") + } + return + } + } + + a = ABR + q = ctxt.NewProg() + q.As = int16(a) + q.Lineno = p.Lineno + q.To.Type = obj.TYPE_BRANCH + q.To.Offset = p.Pc + q.Pcond = p + p = q + } + + p.Mark |= FOLL + (*last).Link = p + *last = p + if a == ABR || a == obj.ARET || a == ARFI || a == ARFCI || a == ARFID || a == AHRFID { + if p.Mark&NOSCHED != 0 { + p = p.Link + goto loop + } + + return + } + + if p.Pcond != nil { + if a != ABL && p.Link != nil { + xfol(ctxt, p.Link, last) + p = p.Pcond + if p == nil || (p.Mark&FOLL != 0) { + return + } + goto loop + } + } + + p = p.Link + goto loop +} + +var Linkppc64 = obj.LinkArch{ + ByteOrder: binary.BigEndian, + Name: "ppc64", + Thechar: '9', + Preprocess: preprocess, + Assemble: span9, + Follow: follow, + Progedit: progedit, + Minlc: 4, + Ptrsize: 8, + Regsize: 8, +} + +var Linkppc64le = obj.LinkArch{ + ByteOrder: binary.LittleEndian, + Name: "ppc64le", + Thechar: '9', + Preprocess: preprocess, + Assemble: span9, + Follow: follow, + Progedit: progedit, + Minlc: 4, + Ptrsize: 8, + Regsize: 8, +} diff --git a/src/cmd/internal/obj/stack.go b/src/cmd/internal/obj/stack.go new file mode 100644 index 0000000000000000000000000000000000000000..87698b3eeb82e148f53b82cfd919c65e69ed2411 --- /dev/null +++ b/src/cmd/internal/obj/stack.go @@ -0,0 +1,51 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Inferno utils/5l/span.c +// http://code.google.com/p/inferno-os/source/browse/utils/5l/span.c +// +// Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved. +// Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net) +// Portions Copyright © 1997-1999 Vita Nuova Limited +// Portions Copyright © 2000-2007 Vita Nuova Holdings Limited (www.vitanuova.com) +// Portions Copyright © 2004,2006 Bruce Ellis +// Portions Copyright © 2005-2007 C H Forsyth (forsyth@terzarima.net) +// Revisions Copyright © 2000-2007 Lucent Technologies Inc. and others +// Portions Copyright © 2009 The Go Authors. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +package obj + +// For the linkers. Must match Go definitions. +// TODO(rsc): Share Go definitions with linkers directly. + +const ( + STACKSYSTEM = 0 + StackSystem = STACKSYSTEM + StackBig = 4096 + StackGuard = 640*stackGuardMultiplier + StackSystem + StackSmall = 128 + StackLimit = StackGuard - StackSystem - StackSmall +) + +const ( + StackPreempt = -1314 // 0xfff...fade +) diff --git a/src/cmd/internal/obj/stringer.go b/src/cmd/internal/obj/stringer.go new file mode 100644 index 0000000000000000000000000000000000000000..c4b3712359453cd8c921083a1284fcbc0355cb28 --- /dev/null +++ b/src/cmd/internal/obj/stringer.go @@ -0,0 +1,104 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build ignore + +// This is a mini version of the stringer tool customized for the Anames table +// in the architecture support for obj. +// This version just generates the slice of strings, not the String method. + +package main + +import ( + "bufio" + "flag" + "fmt" + "log" + "os" + "regexp" + "strings" +) + +var ( + input = flag.String("i", "", "input file name") + output = flag.String("o", "", "output file name") + pkg = flag.String("p", "", "package name") +) + +var Are = regexp.MustCompile(`^\tA([A-Z0-9]+)`) + +func main() { + flag.Parse() + if *input == "" || *output == "" || *pkg == "" { + flag.Usage() + os.Exit(2) + } + in, err := os.Open(*input) + if err != nil { + log.Fatal(err) + } + fd, err := os.Create(*output) + if err != nil { + log.Fatal(err) + } + out := bufio.NewWriter(fd) + defer out.Flush() + var on = false + s := bufio.NewScanner(in) + first := true + for s.Scan() { + line := s.Text() + if !on { + // First relevant line contains "= obj.ABase". + // If we find it, delete the = so we don't stop immediately. + const prefix = "= obj.ABase" + index := strings.Index(line, prefix) + if index < 0 { + continue + } + // It's on. Start with the header. + fmt.Fprintf(out, header, *input, *output, *pkg, *pkg) + on = true + line = line[:index] + } + // Strip comments so their text won't defeat our heuristic. + index := strings.Index(line, "//") + if index > 0 { + line = line[:index] + } + index = strings.Index(line, "/*") + if index > 0 { + line = line[:index] + } + // Termination condition: Any line with an = changes the sequence, + // so stop there, and stop at a closing brace. + if strings.HasPrefix(line, "}") || strings.ContainsRune(line, '=') { + break + } + sub := Are.FindStringSubmatch(line) + if len(sub) < 2 { + continue + } + if first { + fmt.Fprintf(out, "\tobj.A_ARCHSPECIFIC: %q,\n", sub[1]) + first = false + } else { + fmt.Fprintf(out, "\t%q,\n", sub[1]) + } + } + fmt.Fprintln(out, "}") + if s.Err() != nil { + log.Fatal(err) + } +} + +const header = `// Generated by stringer -i %s -o %s -p %s +// Do not edit. + +package %s + +import "cmd/internal/obj" + +var Anames = []string{ +` diff --git a/src/cmd/internal/obj/sym.go b/src/cmd/internal/obj/sym.go new file mode 100644 index 0000000000000000000000000000000000000000..37bb40b4add69e90341ca38ffaaba9313a3dac1c --- /dev/null +++ b/src/cmd/internal/obj/sym.go @@ -0,0 +1,213 @@ +// Derived from Inferno utils/6l/obj.c and utils/6l/span.c +// http://code.google.com/p/inferno-os/source/browse/utils/6l/obj.c +// http://code.google.com/p/inferno-os/source/browse/utils/6l/span.c +// +// Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved. +// Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net) +// Portions Copyright © 1997-1999 Vita Nuova Limited +// Portions Copyright © 2000-2007 Vita Nuova Holdings Limited (www.vitanuova.com) +// Portions Copyright © 2004,2006 Bruce Ellis +// Portions Copyright © 2005-2007 C H Forsyth (forsyth@terzarima.net) +// Revisions Copyright © 2000-2007 Lucent Technologies Inc. and others +// Portions Copyright © 2009 The Go Authors. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +package obj + +import ( + "log" + "os" + "path/filepath" + "runtime" + "strconv" +) + +var headers = []struct { + name string + val int +}{ + {"darwin", Hdarwin}, + {"dragonfly", Hdragonfly}, + {"elf", Helf}, + {"freebsd", Hfreebsd}, + {"linux", Hlinux}, + {"android", Hlinux}, // must be after "linux" entry or else headstr(Hlinux) == "android" + {"nacl", Hnacl}, + {"netbsd", Hnetbsd}, + {"openbsd", Hopenbsd}, + {"plan9", Hplan9}, + {"solaris", Hsolaris}, + {"windows", Hwindows}, + {"windowsgui", Hwindows}, +} + +func headtype(name string) int { + for i := 0; i < len(headers); i++ { + if name == headers[i].name { + return headers[i].val + } + } + return -1 +} + +func Headstr(v int) string { + for i := 0; i < len(headers); i++ { + if v == headers[i].val { + return headers[i].name + } + } + return strconv.Itoa(v) +} + +func Linknew(arch *LinkArch) *Link { + ctxt := new(Link) + ctxt.Hash = make(map[SymVer]*LSym) + ctxt.Arch = arch + ctxt.Version = HistVersion + ctxt.Goroot = Getgoroot() + ctxt.Goroot_final = os.Getenv("GOROOT_FINAL") + if runtime.GOOS == "windows" { + // TODO(rsc): Remove ctxt.Windows and let callers use runtime.GOOS. + ctxt.Windows = 1 + } + + var buf string + buf, _ = os.Getwd() + if buf == "" { + buf = "/???" + } + buf = filepath.ToSlash(buf) + ctxt.Pathname = buf + + ctxt.LineHist.GOROOT = ctxt.Goroot + ctxt.LineHist.GOROOT_FINAL = ctxt.Goroot_final + ctxt.LineHist.Dir = ctxt.Pathname + + ctxt.Headtype = headtype(Getgoos()) + if ctxt.Headtype < 0 { + log.Fatalf("unknown goos %s", Getgoos()) + } + + // Record thread-local storage offset. + // TODO(rsc): Move tlsoffset back into the linker. + switch ctxt.Headtype { + default: + log.Fatalf("unknown thread-local storage offset for %s", Headstr(ctxt.Headtype)) + + case Hplan9, Hwindows: + break + + /* + * ELF uses TLS offset negative from FS. + * Translate 0(FS) and 8(FS) into -16(FS) and -8(FS). + * Known to low-level assembly in package runtime and runtime/cgo. + */ + case Hlinux, + Hfreebsd, + Hnetbsd, + Hopenbsd, + Hdragonfly, + Hsolaris: + ctxt.Tlsoffset = -1 * ctxt.Arch.Ptrsize + + case Hnacl: + switch ctxt.Arch.Thechar { + default: + log.Fatalf("unknown thread-local storage offset for nacl/%s", ctxt.Arch.Name) + + case '5': + ctxt.Tlsoffset = 0 + + case '6': + ctxt.Tlsoffset = 0 + + case '8': + ctxt.Tlsoffset = -8 + } + + /* + * OS X system constants - offset from 0(GS) to our TLS. + * Explained in ../../runtime/cgo/gcc_darwin_*.c. + */ + case Hdarwin: + switch ctxt.Arch.Thechar { + default: + log.Fatalf("unknown thread-local storage offset for darwin/%s", ctxt.Arch.Name) + + case '5': + ctxt.Tlsoffset = 0 // dummy value, not needed + + case '6': + ctxt.Tlsoffset = 0x8a0 + + case '7': + ctxt.Tlsoffset = 0 // dummy value, not needed + + case '8': + ctxt.Tlsoffset = 0x468 + } + } + + // On arm, record goarm. + if ctxt.Arch.Thechar == '5' { + p := Getgoarm() + if p != "" { + ctxt.Goarm = int32(Atoi(p)) + } else { + ctxt.Goarm = 6 + } + } + + return ctxt +} + +func _lookup(ctxt *Link, symb string, v int, create bool) *LSym { + s := ctxt.Hash[SymVer{symb, v}] + if s != nil || !create { + return s + } + + s = &LSym{ + Name: symb, + Type: 0, + Version: int16(v), + Value: 0, + Size: 0, + } + ctxt.Hash[SymVer{symb, v}] = s + + return s +} + +func Linklookup(ctxt *Link, name string, v int) *LSym { + return _lookup(ctxt, name, v, true) +} + +// read-only lookup +func linkrlookup(ctxt *Link, name string, v int) *LSym { + return _lookup(ctxt, name, v, false) +} + +func Linksymfmt(s *LSym) string { + if s == nil { + return "" + } + return s.Name +} diff --git a/src/cmd/internal/obj/textflag.go b/src/cmd/internal/obj/textflag.go new file mode 100644 index 0000000000000000000000000000000000000000..dbd1bc8a7b2e998e4e897d1b7fd49fea2e8fdd2e --- /dev/null +++ b/src/cmd/internal/obj/textflag.go @@ -0,0 +1,38 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// This file defines flags attached to various functions +// and data objects. The compilers, assemblers, and linker must +// all agree on these values. + +package obj + +const ( + // Don't profile the marked routine. + // + // Deprecated: Not implemented, do not use. + NOPROF = 1 + + // It is ok for the linker to get multiple of these symbols. It will + // pick one of the duplicates to use. + DUPOK = 2 + + // Don't insert stack check preamble. + NOSPLIT = 4 + + // Put this data in a read-only section. + RODATA = 8 + + // This data contains no pointers. + NOPTR = 16 + + // This is a wrapper function and should not count as disabling 'recover'. + WRAPPER = 32 + + // This function uses its incoming context register. + NEEDCTXT = 64 + + // When passed to ggloblsym, causes Local to be set to true on the LSym it creates. + LOCAL = 128 +) diff --git a/src/cmd/internal/obj/typekind.go b/src/cmd/internal/obj/typekind.go new file mode 100644 index 0000000000000000000000000000000000000000..21932716786f846d427384495aad04fd17895bf9 --- /dev/null +++ b/src/cmd/internal/obj/typekind.go @@ -0,0 +1,41 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package obj + +// Must match runtime and reflect. +// Included by cmd/gc. + +const ( + KindBool = 1 + iota + KindInt + KindInt8 + KindInt16 + KindInt32 + KindInt64 + KindUint + KindUint8 + KindUint16 + KindUint32 + KindUint64 + KindUintptr + KindFloat32 + KindFloat64 + KindComplex64 + KindComplex128 + KindArray + KindChan + KindFunc + KindInterface + KindMap + KindPtr + KindSlice + KindString + KindStruct + KindUnsafePointer + KindDirectIface = 1 << 5 + KindGCProg = 1 << 6 + KindNoPointers = 1 << 7 + KindMask = (1 << 5) - 1 +) diff --git a/src/cmd/internal/obj/util.go b/src/cmd/internal/obj/util.go new file mode 100644 index 0000000000000000000000000000000000000000..3c3fc8867480770585b33086d35a57f40013b105 --- /dev/null +++ b/src/cmd/internal/obj/util.go @@ -0,0 +1,645 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package obj + +import ( + "bufio" + "bytes" + "fmt" + "io" + "log" + "os" + "strconv" + "strings" + "time" +) + +const REG_NONE = 0 + +var start time.Time + +func Cputime() float64 { + if start.IsZero() { + start = time.Now() + } + return time.Since(start).Seconds() +} + +type Biobuf struct { + f *os.File + r *bufio.Reader + w *bufio.Writer + linelen int +} + +func Bopenw(name string) (*Biobuf, error) { + f, err := os.Create(name) + if err != nil { + return nil, err + } + return &Biobuf{f: f, w: bufio.NewWriter(f)}, nil +} + +func Bopenr(name string) (*Biobuf, error) { + f, err := os.Open(name) + if err != nil { + return nil, err + } + return &Biobuf{f: f, r: bufio.NewReader(f)}, nil +} + +func Binitw(w io.Writer) *Biobuf { + return &Biobuf{w: bufio.NewWriter(w)} +} + +func (b *Biobuf) Write(p []byte) (int, error) { + return b.w.Write(p) +} + +func Bwritestring(b *Biobuf, p string) (int, error) { + return b.w.WriteString(p) +} + +func Bseek(b *Biobuf, offset int64, whence int) int64 { + if b.w != nil { + if err := b.w.Flush(); err != nil { + log.Fatalf("writing output: %v", err) + } + } else if b.r != nil { + if whence == 1 { + offset -= int64(b.r.Buffered()) + } + } + off, err := b.f.Seek(offset, whence) + if err != nil { + log.Fatalf("seeking in output: %v", err) + } + if b.r != nil { + b.r.Reset(b.f) + } + return off +} + +func Boffset(b *Biobuf) int64 { + if b.w != nil { + if err := b.w.Flush(); err != nil { + log.Fatalf("writing output: %v", err) + } + } + off, err := b.f.Seek(0, 1) + if err != nil { + log.Fatalf("seeking in output [0, 1]: %v", err) + } + if b.r != nil { + off -= int64(b.r.Buffered()) + } + return off +} + +func (b *Biobuf) Flush() error { + return b.w.Flush() +} + +func Bputc(b *Biobuf, c byte) { + b.w.WriteByte(c) +} + +const Beof = -1 + +func Bread(b *Biobuf, p []byte) int { + n, err := io.ReadFull(b.r, p) + if n == 0 { + if err != nil && err != io.EOF { + n = -1 + } + } + return n +} + +func Bgetc(b *Biobuf) int { + c, err := b.r.ReadByte() + if err != nil { + return -1 + } + return int(c) +} + +func Bgetrune(b *Biobuf) int { + r, _, err := b.r.ReadRune() + if err != nil { + return -1 + } + return int(r) +} + +func Bungetrune(b *Biobuf) { + b.r.UnreadRune() +} + +func (b *Biobuf) Read(p []byte) (int, error) { + return b.r.Read(p) +} + +func (b *Biobuf) Peek(n int) ([]byte, error) { + return b.r.Peek(n) +} + +func Brdline(b *Biobuf, delim int) string { + s, err := b.r.ReadBytes(byte(delim)) + if err != nil { + log.Fatalf("reading input: %v", err) + } + b.linelen = len(s) + return string(s) +} + +func Brdstr(b *Biobuf, delim int, cut int) string { + s, err := b.r.ReadString(byte(delim)) + if err != nil { + log.Fatalf("reading input: %v", err) + } + if len(s) > 0 && cut > 0 { + s = s[:len(s)-1] + } + return s +} + +func Access(name string, mode int) int { + if mode != 0 { + panic("bad access") + } + _, err := os.Stat(name) + if err != nil { + return -1 + } + return 0 +} + +func Blinelen(b *Biobuf) int { + return b.linelen +} + +func Bterm(b *Biobuf) error { + var err error + if b.w != nil { + err = b.w.Flush() + } + err1 := b.f.Close() + if err == nil { + err = err1 + } + return err +} + +func envOr(key, value string) string { + if x := os.Getenv(key); x != "" { + return x + } + return value +} + +func Getgoroot() string { + return envOr("GOROOT", defaultGOROOT) +} + +func Getgoarch() string { + return envOr("GOARCH", defaultGOARCH) +} + +func Getgoos() string { + return envOr("GOOS", defaultGOOS) +} + +func Getgoarm() string { + switch v := envOr("GOARM", defaultGOARM); v { + case "5", "6", "7": + return v + } + // Fail here, rather than validate at multiple call sites. + log.Fatalf("Invalid GOARM value. Must be 5, 6, or 7.") + panic("unreachable") +} + +func Getgo386() string { + // Validated by cmd/compile. + return envOr("GO386", defaultGO386) +} + +func Getgoextlinkenabled() string { + return envOr("GO_EXTLINK_ENABLED", defaultGO_EXTLINK_ENABLED) +} + +func Getgoversion() string { + return version +} + +func Atoi(s string) int { + i, _ := strconv.Atoi(s) + return i +} + +func (p *Prog) Line() string { + return p.Ctxt.LineHist.LineString(int(p.Lineno)) +} + +var armCondCode = []string{ + ".EQ", + ".NE", + ".CS", + ".CC", + ".MI", + ".PL", + ".VS", + ".VC", + ".HI", + ".LS", + ".GE", + ".LT", + ".GT", + ".LE", + "", + ".NV", +} + +/* ARM scond byte */ +const ( + C_SCOND = (1 << 4) - 1 + C_SBIT = 1 << 4 + C_PBIT = 1 << 5 + C_WBIT = 1 << 6 + C_FBIT = 1 << 7 + C_UBIT = 1 << 7 + C_SCOND_XOR = 14 +) + +// CConv formats ARM condition codes. +func CConv(s uint8) string { + if s == 0 { + return "" + } + sc := armCondCode[(s&C_SCOND)^C_SCOND_XOR] + if s&C_SBIT != 0 { + sc += ".S" + } + if s&C_PBIT != 0 { + sc += ".P" + } + if s&C_WBIT != 0 { + sc += ".W" + } + if s&C_UBIT != 0 { /* ambiguous with FBIT */ + sc += ".U" + } + return sc +} + +func (p *Prog) String() string { + if p.Ctxt == nil { + return "" + } + + sc := CConv(p.Scond) + + var buf bytes.Buffer + + fmt.Fprintf(&buf, "%.5d (%v)\t%v%s", p.Pc, p.Line(), Aconv(int(p.As)), sc) + sep := "\t" + if p.From.Type != TYPE_NONE { + fmt.Fprintf(&buf, "%s%v", sep, Dconv(p, &p.From)) + sep = ", " + } + if p.Reg != REG_NONE { + // Should not happen but might as well show it if it does. + fmt.Fprintf(&buf, "%s%v", sep, Rconv(int(p.Reg))) + sep = ", " + } + if p.From3Type() != TYPE_NONE { + if p.From3.Type == TYPE_CONST && (p.As == ADATA || p.As == ATEXT || p.As == AGLOBL) { + // Special case - omit $. + fmt.Fprintf(&buf, "%s%d", sep, p.From3.Offset) + } else { + fmt.Fprintf(&buf, "%s%v", sep, Dconv(p, p.From3)) + } + sep = ", " + } + if p.To.Type != TYPE_NONE { + fmt.Fprintf(&buf, "%s%v", sep, Dconv(p, &p.To)) + } + if p.RegTo2 != REG_NONE { + fmt.Fprintf(&buf, "%s%v", sep, Rconv(int(p.RegTo2))) + } + return buf.String() +} + +func (ctxt *Link) NewProg() *Prog { + p := new(Prog) // should be the only call to this; all others should use ctxt.NewProg + p.Ctxt = ctxt + return p +} + +func (ctxt *Link) Line(n int) string { + return ctxt.LineHist.LineString(n) +} + +func Getcallerpc(interface{}) uintptr { + return 1 +} + +func (ctxt *Link) Dconv(a *Addr) string { + return Dconv(nil, a) +} + +func Dconv(p *Prog, a *Addr) string { + var str string + + switch a.Type { + default: + str = fmt.Sprintf("type=%d", a.Type) + + case TYPE_NONE: + str = "" + if a.Name != NAME_NONE || a.Reg != 0 || a.Sym != nil { + str = fmt.Sprintf("%v(%v)(NONE)", Mconv(a), Rconv(int(a.Reg))) + } + + case TYPE_REG: + // TODO(rsc): This special case is for x86 instructions like + // PINSRQ CX,$1,X6 + // where the $1 is included in the p->to Addr. + // Move into a new field. + if a.Offset != 0 { + str = fmt.Sprintf("$%d,%v", a.Offset, Rconv(int(a.Reg))) + break + } + + str = Rconv(int(a.Reg)) + if a.Name != TYPE_NONE || a.Sym != nil { + str = fmt.Sprintf("%v(%v)(REG)", Mconv(a), Rconv(int(a.Reg))) + } + + case TYPE_BRANCH: + if a.Sym != nil { + str = fmt.Sprintf("%s(SB)", a.Sym.Name) + } else if p != nil && p.Pcond != nil { + str = fmt.Sprint(p.Pcond.Pc) + } else if a.Val != nil { + str = fmt.Sprint(a.Val.(*Prog).Pc) + } else { + str = fmt.Sprintf("%d(PC)", a.Offset) + } + + case TYPE_INDIR: + str = fmt.Sprintf("*%s", Mconv(a)) + + case TYPE_MEM: + str = Mconv(a) + if a.Index != REG_NONE { + str += fmt.Sprintf("(%v*%d)", Rconv(int(a.Index)), int(a.Scale)) + } + + case TYPE_CONST: + if a.Reg != 0 { + str = fmt.Sprintf("$%v(%v)", Mconv(a), Rconv(int(a.Reg))) + } else { + str = fmt.Sprintf("$%v", Mconv(a)) + } + + case TYPE_TEXTSIZE: + if a.Val.(int32) == ArgsSizeUnknown { + str = fmt.Sprintf("$%d", a.Offset) + } else { + str = fmt.Sprintf("$%d-%d", a.Offset, a.Val.(int32)) + } + + case TYPE_FCONST: + str = fmt.Sprintf("%.17g", a.Val.(float64)) + // Make sure 1 prints as 1.0 + if !strings.ContainsAny(str, ".e") { + str += ".0" + } + str = fmt.Sprintf("$(%s)", str) + + case TYPE_SCONST: + str = fmt.Sprintf("$%q", a.Val.(string)) + + case TYPE_ADDR: + str = fmt.Sprintf("$%s", Mconv(a)) + + case TYPE_SHIFT: + v := int(a.Offset) + op := string("<<>>->@>"[((v>>5)&3)<<1:]) + if v&(1<<4) != 0 { + str = fmt.Sprintf("R%d%c%cR%d", v&15, op[0], op[1], (v>>8)&15) + } else { + str = fmt.Sprintf("R%d%c%c%d", v&15, op[0], op[1], (v>>7)&31) + } + if a.Reg != 0 { + str += fmt.Sprintf("(%v)", Rconv(int(a.Reg))) + } + + case TYPE_REGREG: + str = fmt.Sprintf("(%v, %v)", Rconv(int(a.Reg)), Rconv(int(a.Offset))) + + case TYPE_REGREG2: + str = fmt.Sprintf("%v, %v", Rconv(int(a.Reg)), Rconv(int(a.Offset))) + + case TYPE_REGLIST: + str = regListConv(int(a.Offset)) + } + + return str +} + +func Mconv(a *Addr) string { + var str string + + switch a.Name { + default: + str = fmt.Sprintf("name=%d", a.Name) + + case NAME_NONE: + switch { + case a.Reg == REG_NONE: + str = fmt.Sprint(a.Offset) + case a.Offset == 0: + str = fmt.Sprintf("(%v)", Rconv(int(a.Reg))) + case a.Offset != 0: + str = fmt.Sprintf("%d(%v)", a.Offset, Rconv(int(a.Reg))) + } + + case NAME_EXTERN: + str = fmt.Sprintf("%s%s(SB)", a.Sym.Name, offConv(a.Offset)) + + case NAME_GOTREF: + str = fmt.Sprintf("%s%s@GOT(SB)", a.Sym.Name, offConv(a.Offset)) + + case NAME_STATIC: + str = fmt.Sprintf("%s<>%s(SB)", a.Sym.Name, offConv(a.Offset)) + + case NAME_AUTO: + if a.Sym != nil { + str = fmt.Sprintf("%s%s(SP)", a.Sym.Name, offConv(a.Offset)) + } else { + str = fmt.Sprintf("%s(SP)", offConv(a.Offset)) + } + + case NAME_PARAM: + if a.Sym != nil { + str = fmt.Sprintf("%s%s(FP)", a.Sym.Name, offConv(a.Offset)) + } else { + str = fmt.Sprintf("%s(FP)", offConv(a.Offset)) + } + } + return str +} + +func offConv(off int64) string { + if off == 0 { + return "" + } + return fmt.Sprintf("%+d", off) +} + +type regSet struct { + lo int + hi int + Rconv func(int) string +} + +// Few enough architectures that a linear scan is fastest. +// Not even worth sorting. +var regSpace []regSet + +/* + Each architecture defines a register space as a unique + integer range. + Here is the list of architectures and the base of their register spaces. +*/ + +const ( + // Because of masking operations in the encodings, each register + // space should start at 0 modulo some power of 2. + RBase386 = 1 * 1024 + RBaseAMD64 = 2 * 1024 + RBaseARM = 3 * 1024 + RBasePPC64 = 4 * 1024 // range [4k, 8k) + RBaseARM64 = 8 * 1024 // range [8k, 12k) +) + +// RegisterRegister binds a pretty-printer (Rconv) for register +// numbers to a given register number range. Lo is inclusive, +// hi exclusive (valid registers are lo through hi-1). +func RegisterRegister(lo, hi int, Rconv func(int) string) { + regSpace = append(regSpace, regSet{lo, hi, Rconv}) +} + +func Rconv(reg int) string { + if reg == REG_NONE { + return "NONE" + } + for i := range regSpace { + rs := ®Space[i] + if rs.lo <= reg && reg < rs.hi { + return rs.Rconv(reg) + } + } + return fmt.Sprintf("R???%d", reg) +} + +func regListConv(list int) string { + str := "" + + for i := 0; i < 16; i++ { // TODO: 16 is ARM-specific. + if list&(1< xmm2 + {Yxr, Ynone, Yxm, Zr_m_xm_nr, 2}, // Pe, 0xd6 MOVQ xmm1 -> xmm2/m64 + + // valid only in 64-bit mode, usually with 64-bit prefix + {Yrl, Ynone, Yml, Zr_m, 1}, // 0x89 + {Yml, Ynone, Yrl, Zm_r, 1}, // 0x8b + {Yi0, Ynone, Yrl, Zclr, 1}, // 0x31 + {Ys32, Ynone, Yrl, Zilo_m, 2}, // 32 bit signed 0xc7,(0) + {Yi64, Ynone, Yrl, Ziq_rp, 1}, // 0xb8 -- 32/64 bit immediate + {Yi32, Ynone, Yml, Zilo_m, 2}, // 0xc7,(0) + {Ymm, Ynone, Ymr, Zm_r_xm, 1}, // 0x6e MMX MOVD + {Ymr, Ynone, Ymm, Zr_m_xm, 1}, // 0x7e MMX MOVD + {Yml, Ynone, Yxr, Zm_r_xm, 2}, // Pe, 0x6e MOVD xmm load + {Yxr, Ynone, Yml, Zr_m_xm, 2}, // Pe, 0x7e MOVD xmm store + {Yiauto, Ynone, Yrl, Zaut_r, 1}, // 0 built-in LEAQ +} + +var ym_rl = []ytab{ + {Ym, Ynone, Yrl, Zm_r, 1}, +} + +var yrl_m = []ytab{ + {Yrl, Ynone, Ym, Zr_m, 1}, +} + +var ymb_rl = []ytab{ + {Ymb, Ynone, Yrl, Zmb_r, 1}, +} + +var yml_rl = []ytab{ + {Yml, Ynone, Yrl, Zm_r, 1}, +} + +var yrl_ml = []ytab{ + {Yrl, Ynone, Yml, Zr_m, 1}, +} + +var yml_mb = []ytab{ + {Yrb, Ynone, Ymb, Zr_m, 1}, + {Ymb, Ynone, Yrb, Zm_r, 1}, +} + +var yrb_mb = []ytab{ + {Yrb, Ynone, Ymb, Zr_m, 1}, +} + +var yxchg = []ytab{ + {Yax, Ynone, Yrl, Z_rp, 1}, + {Yrl, Ynone, Yax, Zrp_, 1}, + {Yrl, Ynone, Yml, Zr_m, 1}, + {Yml, Ynone, Yrl, Zm_r, 1}, +} + +var ydivl = []ytab{ + {Yml, Ynone, Ynone, Zm_o, 2}, +} + +var ydivb = []ytab{ + {Ymb, Ynone, Ynone, Zm_o, 2}, +} + +var yimul = []ytab{ + {Yml, Ynone, Ynone, Zm_o, 2}, + {Yi8, Ynone, Yrl, Zib_rr, 1}, + {Yi32, Ynone, Yrl, Zil_rr, 1}, + {Yml, Ynone, Yrl, Zm_r, 2}, +} + +var yimul3 = []ytab{ + {Yi8, Yml, Yrl, Zibm_r, 2}, +} + +var ybyte = []ytab{ + {Yi64, Ynone, Ynone, Zbyte, 1}, +} + +var yin = []ytab{ + {Yi32, Ynone, Ynone, Zib_, 1}, + {Ynone, Ynone, Ynone, Zlit, 1}, +} + +var yint = []ytab{ + {Yi32, Ynone, Ynone, Zib_, 1}, +} + +var ypushl = []ytab{ + {Yrl, Ynone, Ynone, Zrp_, 1}, + {Ym, Ynone, Ynone, Zm_o, 2}, + {Yi8, Ynone, Ynone, Zib_, 1}, + {Yi32, Ynone, Ynone, Zil_, 1}, +} + +var ypopl = []ytab{ + {Ynone, Ynone, Yrl, Z_rp, 1}, + {Ynone, Ynone, Ym, Zo_m, 2}, +} + +var ybswap = []ytab{ + {Ynone, Ynone, Yrl, Z_rp, 2}, +} + +var yscond = []ytab{ + {Ynone, Ynone, Ymb, Zo_m, 2}, +} + +var yjcond = []ytab{ + {Ynone, Ynone, Ybr, Zbr, 0}, + {Yi0, Ynone, Ybr, Zbr, 0}, + {Yi1, Ynone, Ybr, Zbr, 1}, +} + +var yloop = []ytab{ + {Ynone, Ynone, Ybr, Zloop, 1}, +} + +var ycall = []ytab{ + {Ynone, Ynone, Yml, Zcallindreg, 0}, + {Yrx, Ynone, Yrx, Zcallindreg, 2}, + {Ynone, Ynone, Yindir, Zcallind, 2}, + {Ynone, Ynone, Ybr, Zcall, 0}, + {Ynone, Ynone, Yi32, Zcallcon, 1}, +} + +var yduff = []ytab{ + {Ynone, Ynone, Yi32, Zcallduff, 1}, +} + +var yjmp = []ytab{ + {Ynone, Ynone, Yml, Zo_m64, 2}, + {Ynone, Ynone, Ybr, Zjmp, 0}, + {Ynone, Ynone, Yi32, Zjmpcon, 1}, +} + +var yfmvd = []ytab{ + {Ym, Ynone, Yf0, Zm_o, 2}, + {Yf0, Ynone, Ym, Zo_m, 2}, + {Yrf, Ynone, Yf0, Zm_o, 2}, + {Yf0, Ynone, Yrf, Zo_m, 2}, +} + +var yfmvdp = []ytab{ + {Yf0, Ynone, Ym, Zo_m, 2}, + {Yf0, Ynone, Yrf, Zo_m, 2}, +} + +var yfmvf = []ytab{ + {Ym, Ynone, Yf0, Zm_o, 2}, + {Yf0, Ynone, Ym, Zo_m, 2}, +} + +var yfmvx = []ytab{ + {Ym, Ynone, Yf0, Zm_o, 2}, +} + +var yfmvp = []ytab{ + {Yf0, Ynone, Ym, Zo_m, 2}, +} + +var yfcmv = []ytab{ + {Yrf, Ynone, Yf0, Zm_o, 2}, +} + +var yfadd = []ytab{ + {Ym, Ynone, Yf0, Zm_o, 2}, + {Yrf, Ynone, Yf0, Zm_o, 2}, + {Yf0, Ynone, Yrf, Zo_m, 2}, +} + +var yfaddp = []ytab{ + {Yf0, Ynone, Yrf, Zo_m, 2}, +} + +var yfxch = []ytab{ + {Yf0, Ynone, Yrf, Zo_m, 2}, + {Yrf, Ynone, Yf0, Zm_o, 2}, +} + +var ycompp = []ytab{ + {Yf0, Ynone, Yrf, Zo_m, 2}, /* botch is really f0,f1 */ +} + +var ystsw = []ytab{ + {Ynone, Ynone, Ym, Zo_m, 2}, + {Ynone, Ynone, Yax, Zlit, 1}, +} + +var ystcw = []ytab{ + {Ynone, Ynone, Ym, Zo_m, 2}, + {Ym, Ynone, Ynone, Zm_o, 2}, +} + +var ysvrs = []ytab{ + {Ynone, Ynone, Ym, Zo_m, 2}, + {Ym, Ynone, Ynone, Zm_o, 2}, +} + +var ymm = []ytab{ + {Ymm, Ynone, Ymr, Zm_r_xm, 1}, + {Yxm, Ynone, Yxr, Zm_r_xm, 2}, +} + +var yxm = []ytab{ + {Yxm, Ynone, Yxr, Zm_r_xm, 1}, +} + +var yxcvm1 = []ytab{ + {Yxm, Ynone, Yxr, Zm_r_xm, 2}, + {Yxm, Ynone, Ymr, Zm_r_xm, 2}, +} + +var yxcvm2 = []ytab{ + {Yxm, Ynone, Yxr, Zm_r_xm, 2}, + {Ymm, Ynone, Yxr, Zm_r_xm, 2}, +} + +/* +var yxmq = []ytab{ + {Yxm, Ynone, Yxr, Zm_r_xm, 2}, +} +*/ + +var yxr = []ytab{ + {Yxr, Ynone, Yxr, Zm_r_xm, 1}, +} + +var yxr_ml = []ytab{ + {Yxr, Ynone, Yml, Zr_m_xm, 1}, +} + +var ymr = []ytab{ + {Ymr, Ynone, Ymr, Zm_r, 1}, +} + +var ymr_ml = []ytab{ + {Ymr, Ynone, Yml, Zr_m_xm, 1}, +} + +var yxcmp = []ytab{ + {Yxm, Ynone, Yxr, Zm_r_xm, 1}, +} + +var yxcmpi = []ytab{ + {Yxm, Yxr, Yi8, Zm_r_i_xm, 2}, +} + +var yxmov = []ytab{ + {Yxm, Ynone, Yxr, Zm_r_xm, 1}, + {Yxr, Ynone, Yxm, Zr_m_xm, 1}, +} + +var yxcvfl = []ytab{ + {Yxm, Ynone, Yrl, Zm_r_xm, 1}, +} + +var yxcvlf = []ytab{ + {Yml, Ynone, Yxr, Zm_r_xm, 1}, +} + +var yxcvfq = []ytab{ + {Yxm, Ynone, Yrl, Zm_r_xm, 2}, +} + +var yxcvqf = []ytab{ + {Yml, Ynone, Yxr, Zm_r_xm, 2}, +} + +var yps = []ytab{ + {Ymm, Ynone, Ymr, Zm_r_xm, 1}, + {Yi8, Ynone, Ymr, Zibo_m_xm, 2}, + {Yxm, Ynone, Yxr, Zm_r_xm, 2}, + {Yi8, Ynone, Yxr, Zibo_m_xm, 3}, +} + +var yxrrl = []ytab{ + {Yxr, Ynone, Yrl, Zm_r, 1}, +} + +var ymfp = []ytab{ + {Ymm, Ynone, Ymr, Zm_r_3d, 1}, +} + +var ymrxr = []ytab{ + {Ymr, Ynone, Yxr, Zm_r, 1}, + {Yxm, Ynone, Yxr, Zm_r_xm, 1}, +} + +var ymshuf = []ytab{ + {Yi8, Ymm, Ymr, Zibm_r, 2}, +} + +var ymshufb = []ytab{ + {Yxm, Ynone, Yxr, Zm2_r, 2}, +} + +var yxshuf = []ytab{ + {Yu8, Yxm, Yxr, Zibm_r, 2}, +} + +var yextrw = []ytab{ + {Yu8, Yxr, Yrl, Zibm_r, 2}, +} + +var yinsrw = []ytab{ + {Yu8, Yml, Yxr, Zibm_r, 2}, +} + +var yinsr = []ytab{ + {Yu8, Ymm, Yxr, Zibm_r, 3}, +} + +var ypsdq = []ytab{ + {Yi8, Ynone, Yxr, Zibo_m, 2}, +} + +var ymskb = []ytab{ + {Yxr, Ynone, Yrl, Zm_r_xm, 2}, + {Ymr, Ynone, Yrl, Zm_r_xm, 1}, +} + +var ycrc32l = []ytab{ + {Yml, Ynone, Yrl, Zlitm_r, 0}, +} + +var yprefetch = []ytab{ + {Ym, Ynone, Ynone, Zm_o, 2}, +} + +var yaes = []ytab{ + {Yxm, Ynone, Yxr, Zlitm_r, 2}, +} + +var yaes2 = []ytab{ + {Yu8, Yxm, Yxr, Zibm_r, 2}, +} + +/* + * You are doasm, holding in your hand a Prog* with p->as set to, say, ACRC32, + * and p->from and p->to as operands (Addr*). The linker scans optab to find + * the entry with the given p->as and then looks through the ytable for that + * instruction (the second field in the optab struct) for a line whose first + * two values match the Ytypes of the p->from and p->to operands. The function + * oclass in span.c computes the specific Ytype of an operand and then the set + * of more general Ytypes that it satisfies is implied by the ycover table, set + * up in instinit. For example, oclass distinguishes the constants 0 and 1 + * from the more general 8-bit constants, but instinit says + * + * ycover[Yi0*Ymax + Ys32] = 1; + * ycover[Yi1*Ymax + Ys32] = 1; + * ycover[Yi8*Ymax + Ys32] = 1; + * + * which means that Yi0, Yi1, and Yi8 all count as Ys32 (signed 32) + * if that's what an instruction can handle. + * + * In parallel with the scan through the ytable for the appropriate line, there + * is a z pointer that starts out pointing at the strange magic byte list in + * the Optab struct. With each step past a non-matching ytable line, z + * advances by the 4th entry in the line. When a matching line is found, that + * z pointer has the extra data to use in laying down the instruction bytes. + * The actual bytes laid down are a function of the 3rd entry in the line (that + * is, the Ztype) and the z bytes. + * + * For example, let's look at AADDL. The optab line says: + * { AADDL, yaddl, Px, 0x83,(00),0x05,0x81,(00),0x01,0x03 }, + * + * and yaddl says + * uchar yaddl[] = + * { + * Yi8, Yml, Zibo_m, 2, + * Yi32, Yax, Zil_, 1, + * Yi32, Yml, Zilo_m, 2, + * Yrl, Yml, Zr_m, 1, + * Yml, Yrl, Zm_r, 1, + * 0 + * }; + * + * so there are 5 possible types of ADDL instruction that can be laid down, and + * possible states used to lay them down (Ztype and z pointer, assuming z + * points at {0x83,(00),0x05,0x81,(00),0x01,0x03}) are: + * + * Yi8, Yml -> Zibo_m, z (0x83, 00) + * Yi32, Yax -> Zil_, z+2 (0x05) + * Yi32, Yml -> Zilo_m, z+2+1 (0x81, 0x00) + * Yrl, Yml -> Zr_m, z+2+1+2 (0x01) + * Yml, Yrl -> Zm_r, z+2+1+2+1 (0x03) + * + * The Pconstant in the optab line controls the prefix bytes to emit. That's + * relatively straightforward as this program goes. + * + * The switch on t[2] in doasm implements the various Z cases. Zibo_m, for + * example, is an opcode byte (z[0]) then an asmando (which is some kind of + * encoded addressing mode for the Yml arg), and then a single immediate byte. + * Zilo_m is the same but a long (32-bit) immediate. + */ +var optab = +/* as, ytab, andproto, opcode */ +[]Optab{ + Optab{obj.AXXX, nil, 0, [23]uint8{}}, + Optab{AAAA, ynone, P32, [23]uint8{0x37}}, + Optab{AAAD, ynone, P32, [23]uint8{0xd5, 0x0a}}, + Optab{AAAM, ynone, P32, [23]uint8{0xd4, 0x0a}}, + Optab{AAAS, ynone, P32, [23]uint8{0x3f}}, + Optab{AADCB, yxorb, Pb, [23]uint8{0x14, 0x80, 02, 0x10, 0x10}}, + Optab{AADCL, yxorl, Px, [23]uint8{0x83, 02, 0x15, 0x81, 02, 0x11, 0x13}}, + Optab{AADCQ, yxorl, Pw, [23]uint8{0x83, 02, 0x15, 0x81, 02, 0x11, 0x13}}, + Optab{AADCW, yxorl, Pe, [23]uint8{0x83, 02, 0x15, 0x81, 02, 0x11, 0x13}}, + Optab{AADDB, yxorb, Pb, [23]uint8{0x04, 0x80, 00, 0x00, 0x02}}, + Optab{AADDL, yaddl, Px, [23]uint8{0x83, 00, 0x05, 0x81, 00, 0x01, 0x03}}, + Optab{AADDPD, yxm, Pq, [23]uint8{0x58}}, + Optab{AADDPS, yxm, Pm, [23]uint8{0x58}}, + Optab{AADDQ, yaddl, Pw, [23]uint8{0x83, 00, 0x05, 0x81, 00, 0x01, 0x03}}, + Optab{AADDSD, yxm, Pf2, [23]uint8{0x58}}, + Optab{AADDSS, yxm, Pf3, [23]uint8{0x58}}, + Optab{AADDW, yaddl, Pe, [23]uint8{0x83, 00, 0x05, 0x81, 00, 0x01, 0x03}}, + Optab{AADJSP, nil, 0, [23]uint8{}}, + Optab{AANDB, yxorb, Pb, [23]uint8{0x24, 0x80, 04, 0x20, 0x22}}, + Optab{AANDL, yxorl, Px, [23]uint8{0x83, 04, 0x25, 0x81, 04, 0x21, 0x23}}, + Optab{AANDNPD, yxm, Pq, [23]uint8{0x55}}, + Optab{AANDNPS, yxm, Pm, [23]uint8{0x55}}, + Optab{AANDPD, yxm, Pq, [23]uint8{0x54}}, + Optab{AANDPS, yxm, Pq, [23]uint8{0x54}}, + Optab{AANDQ, yxorl, Pw, [23]uint8{0x83, 04, 0x25, 0x81, 04, 0x21, 0x23}}, + Optab{AANDW, yxorl, Pe, [23]uint8{0x83, 04, 0x25, 0x81, 04, 0x21, 0x23}}, + Optab{AARPL, yrl_ml, P32, [23]uint8{0x63}}, + Optab{ABOUNDL, yrl_m, P32, [23]uint8{0x62}}, + Optab{ABOUNDW, yrl_m, Pe, [23]uint8{0x62}}, + Optab{ABSFL, yml_rl, Pm, [23]uint8{0xbc}}, + Optab{ABSFQ, yml_rl, Pw, [23]uint8{0x0f, 0xbc}}, + Optab{ABSFW, yml_rl, Pq, [23]uint8{0xbc}}, + Optab{ABSRL, yml_rl, Pm, [23]uint8{0xbd}}, + Optab{ABSRQ, yml_rl, Pw, [23]uint8{0x0f, 0xbd}}, + Optab{ABSRW, yml_rl, Pq, [23]uint8{0xbd}}, + Optab{ABSWAPL, ybswap, Px, [23]uint8{0x0f, 0xc8}}, + Optab{ABSWAPQ, ybswap, Pw, [23]uint8{0x0f, 0xc8}}, + Optab{ABTCL, ybtl, Pm, [23]uint8{0xba, 07, 0xbb}}, + Optab{ABTCQ, ybtl, Pw, [23]uint8{0x0f, 0xba, 07, 0x0f, 0xbb}}, + Optab{ABTCW, ybtl, Pq, [23]uint8{0xba, 07, 0xbb}}, + Optab{ABTL, ybtl, Pm, [23]uint8{0xba, 04, 0xa3}}, + Optab{ABTQ, ybtl, Pw, [23]uint8{0x0f, 0xba, 04, 0x0f, 0xa3}}, + Optab{ABTRL, ybtl, Pm, [23]uint8{0xba, 06, 0xb3}}, + Optab{ABTRQ, ybtl, Pw, [23]uint8{0x0f, 0xba, 06, 0x0f, 0xb3}}, + Optab{ABTRW, ybtl, Pq, [23]uint8{0xba, 06, 0xb3}}, + Optab{ABTSL, ybtl, Pm, [23]uint8{0xba, 05, 0xab}}, + Optab{ABTSQ, ybtl, Pw, [23]uint8{0x0f, 0xba, 05, 0x0f, 0xab}}, + Optab{ABTSW, ybtl, Pq, [23]uint8{0xba, 05, 0xab}}, + Optab{ABTW, ybtl, Pq, [23]uint8{0xba, 04, 0xa3}}, + Optab{ABYTE, ybyte, Px, [23]uint8{1}}, + Optab{obj.ACALL, ycall, Px, [23]uint8{0xff, 02, 0xff, 0x15, 0xe8}}, + Optab{ACDQ, ynone, Px, [23]uint8{0x99}}, + Optab{ACLC, ynone, Px, [23]uint8{0xf8}}, + Optab{ACLD, ynone, Px, [23]uint8{0xfc}}, + Optab{ACLI, ynone, Px, [23]uint8{0xfa}}, + Optab{ACLTS, ynone, Pm, [23]uint8{0x06}}, + Optab{ACMC, ynone, Px, [23]uint8{0xf5}}, + Optab{ACMOVLCC, yml_rl, Pm, [23]uint8{0x43}}, + Optab{ACMOVLCS, yml_rl, Pm, [23]uint8{0x42}}, + Optab{ACMOVLEQ, yml_rl, Pm, [23]uint8{0x44}}, + Optab{ACMOVLGE, yml_rl, Pm, [23]uint8{0x4d}}, + Optab{ACMOVLGT, yml_rl, Pm, [23]uint8{0x4f}}, + Optab{ACMOVLHI, yml_rl, Pm, [23]uint8{0x47}}, + Optab{ACMOVLLE, yml_rl, Pm, [23]uint8{0x4e}}, + Optab{ACMOVLLS, yml_rl, Pm, [23]uint8{0x46}}, + Optab{ACMOVLLT, yml_rl, Pm, [23]uint8{0x4c}}, + Optab{ACMOVLMI, yml_rl, Pm, [23]uint8{0x48}}, + Optab{ACMOVLNE, yml_rl, Pm, [23]uint8{0x45}}, + Optab{ACMOVLOC, yml_rl, Pm, [23]uint8{0x41}}, + Optab{ACMOVLOS, yml_rl, Pm, [23]uint8{0x40}}, + Optab{ACMOVLPC, yml_rl, Pm, [23]uint8{0x4b}}, + Optab{ACMOVLPL, yml_rl, Pm, [23]uint8{0x49}}, + Optab{ACMOVLPS, yml_rl, Pm, [23]uint8{0x4a}}, + Optab{ACMOVQCC, yml_rl, Pw, [23]uint8{0x0f, 0x43}}, + Optab{ACMOVQCS, yml_rl, Pw, [23]uint8{0x0f, 0x42}}, + Optab{ACMOVQEQ, yml_rl, Pw, [23]uint8{0x0f, 0x44}}, + Optab{ACMOVQGE, yml_rl, Pw, [23]uint8{0x0f, 0x4d}}, + Optab{ACMOVQGT, yml_rl, Pw, [23]uint8{0x0f, 0x4f}}, + Optab{ACMOVQHI, yml_rl, Pw, [23]uint8{0x0f, 0x47}}, + Optab{ACMOVQLE, yml_rl, Pw, [23]uint8{0x0f, 0x4e}}, + Optab{ACMOVQLS, yml_rl, Pw, [23]uint8{0x0f, 0x46}}, + Optab{ACMOVQLT, yml_rl, Pw, [23]uint8{0x0f, 0x4c}}, + Optab{ACMOVQMI, yml_rl, Pw, [23]uint8{0x0f, 0x48}}, + Optab{ACMOVQNE, yml_rl, Pw, [23]uint8{0x0f, 0x45}}, + Optab{ACMOVQOC, yml_rl, Pw, [23]uint8{0x0f, 0x41}}, + Optab{ACMOVQOS, yml_rl, Pw, [23]uint8{0x0f, 0x40}}, + Optab{ACMOVQPC, yml_rl, Pw, [23]uint8{0x0f, 0x4b}}, + Optab{ACMOVQPL, yml_rl, Pw, [23]uint8{0x0f, 0x49}}, + Optab{ACMOVQPS, yml_rl, Pw, [23]uint8{0x0f, 0x4a}}, + Optab{ACMOVWCC, yml_rl, Pq, [23]uint8{0x43}}, + Optab{ACMOVWCS, yml_rl, Pq, [23]uint8{0x42}}, + Optab{ACMOVWEQ, yml_rl, Pq, [23]uint8{0x44}}, + Optab{ACMOVWGE, yml_rl, Pq, [23]uint8{0x4d}}, + Optab{ACMOVWGT, yml_rl, Pq, [23]uint8{0x4f}}, + Optab{ACMOVWHI, yml_rl, Pq, [23]uint8{0x47}}, + Optab{ACMOVWLE, yml_rl, Pq, [23]uint8{0x4e}}, + Optab{ACMOVWLS, yml_rl, Pq, [23]uint8{0x46}}, + Optab{ACMOVWLT, yml_rl, Pq, [23]uint8{0x4c}}, + Optab{ACMOVWMI, yml_rl, Pq, [23]uint8{0x48}}, + Optab{ACMOVWNE, yml_rl, Pq, [23]uint8{0x45}}, + Optab{ACMOVWOC, yml_rl, Pq, [23]uint8{0x41}}, + Optab{ACMOVWOS, yml_rl, Pq, [23]uint8{0x40}}, + Optab{ACMOVWPC, yml_rl, Pq, [23]uint8{0x4b}}, + Optab{ACMOVWPL, yml_rl, Pq, [23]uint8{0x49}}, + Optab{ACMOVWPS, yml_rl, Pq, [23]uint8{0x4a}}, + Optab{ACMPB, ycmpb, Pb, [23]uint8{0x3c, 0x80, 07, 0x38, 0x3a}}, + Optab{ACMPL, ycmpl, Px, [23]uint8{0x83, 07, 0x3d, 0x81, 07, 0x39, 0x3b}}, + Optab{ACMPPD, yxcmpi, Px, [23]uint8{Pe, 0xc2}}, + Optab{ACMPPS, yxcmpi, Pm, [23]uint8{0xc2, 0}}, + Optab{ACMPQ, ycmpl, Pw, [23]uint8{0x83, 07, 0x3d, 0x81, 07, 0x39, 0x3b}}, + Optab{ACMPSB, ynone, Pb, [23]uint8{0xa6}}, + Optab{ACMPSD, yxcmpi, Px, [23]uint8{Pf2, 0xc2}}, + Optab{ACMPSL, ynone, Px, [23]uint8{0xa7}}, + Optab{ACMPSQ, ynone, Pw, [23]uint8{0xa7}}, + Optab{ACMPSS, yxcmpi, Px, [23]uint8{Pf3, 0xc2}}, + Optab{ACMPSW, ynone, Pe, [23]uint8{0xa7}}, + Optab{ACMPW, ycmpl, Pe, [23]uint8{0x83, 07, 0x3d, 0x81, 07, 0x39, 0x3b}}, + Optab{ACOMISD, yxcmp, Pe, [23]uint8{0x2f}}, + Optab{ACOMISS, yxcmp, Pm, [23]uint8{0x2f}}, + Optab{ACPUID, ynone, Pm, [23]uint8{0xa2}}, + Optab{ACVTPL2PD, yxcvm2, Px, [23]uint8{Pf3, 0xe6, Pe, 0x2a}}, + Optab{ACVTPL2PS, yxcvm2, Pm, [23]uint8{0x5b, 0, 0x2a, 0}}, + Optab{ACVTPD2PL, yxcvm1, Px, [23]uint8{Pf2, 0xe6, Pe, 0x2d}}, + Optab{ACVTPD2PS, yxm, Pe, [23]uint8{0x5a}}, + Optab{ACVTPS2PL, yxcvm1, Px, [23]uint8{Pe, 0x5b, Pm, 0x2d}}, + Optab{ACVTPS2PD, yxm, Pm, [23]uint8{0x5a}}, + Optab{API2FW, ymfp, Px, [23]uint8{0x0c}}, + Optab{ACVTSD2SL, yxcvfl, Pf2, [23]uint8{0x2d}}, + Optab{ACVTSD2SQ, yxcvfq, Pw, [23]uint8{Pf2, 0x2d}}, + Optab{ACVTSD2SS, yxm, Pf2, [23]uint8{0x5a}}, + Optab{ACVTSL2SD, yxcvlf, Pf2, [23]uint8{0x2a}}, + Optab{ACVTSQ2SD, yxcvqf, Pw, [23]uint8{Pf2, 0x2a}}, + Optab{ACVTSL2SS, yxcvlf, Pf3, [23]uint8{0x2a}}, + Optab{ACVTSQ2SS, yxcvqf, Pw, [23]uint8{Pf3, 0x2a}}, + Optab{ACVTSS2SD, yxm, Pf3, [23]uint8{0x5a}}, + Optab{ACVTSS2SL, yxcvfl, Pf3, [23]uint8{0x2d}}, + Optab{ACVTSS2SQ, yxcvfq, Pw, [23]uint8{Pf3, 0x2d}}, + Optab{ACVTTPD2PL, yxcvm1, Px, [23]uint8{Pe, 0xe6, Pe, 0x2c}}, + Optab{ACVTTPS2PL, yxcvm1, Px, [23]uint8{Pf3, 0x5b, Pm, 0x2c}}, + Optab{ACVTTSD2SL, yxcvfl, Pf2, [23]uint8{0x2c}}, + Optab{ACVTTSD2SQ, yxcvfq, Pw, [23]uint8{Pf2, 0x2c}}, + Optab{ACVTTSS2SL, yxcvfl, Pf3, [23]uint8{0x2c}}, + Optab{ACVTTSS2SQ, yxcvfq, Pw, [23]uint8{Pf3, 0x2c}}, + Optab{ACWD, ynone, Pe, [23]uint8{0x99}}, + Optab{ACQO, ynone, Pw, [23]uint8{0x99}}, + Optab{ADAA, ynone, P32, [23]uint8{0x27}}, + Optab{ADAS, ynone, P32, [23]uint8{0x2f}}, + Optab{obj.ADATA, nil, 0, [23]uint8{}}, + Optab{ADECB, yincb, Pb, [23]uint8{0xfe, 01}}, + Optab{ADECL, yincl, Px1, [23]uint8{0x48, 0xff, 01}}, + Optab{ADECQ, yincq, Pw, [23]uint8{0xff, 01}}, + Optab{ADECW, yincw, Pe, [23]uint8{0xff, 01}}, + Optab{ADIVB, ydivb, Pb, [23]uint8{0xf6, 06}}, + Optab{ADIVL, ydivl, Px, [23]uint8{0xf7, 06}}, + Optab{ADIVPD, yxm, Pe, [23]uint8{0x5e}}, + Optab{ADIVPS, yxm, Pm, [23]uint8{0x5e}}, + Optab{ADIVQ, ydivl, Pw, [23]uint8{0xf7, 06}}, + Optab{ADIVSD, yxm, Pf2, [23]uint8{0x5e}}, + Optab{ADIVSS, yxm, Pf3, [23]uint8{0x5e}}, + Optab{ADIVW, ydivl, Pe, [23]uint8{0xf7, 06}}, + Optab{AEMMS, ynone, Pm, [23]uint8{0x77}}, + Optab{AENTER, nil, 0, [23]uint8{}}, /* botch */ + Optab{AFXRSTOR, ysvrs, Pm, [23]uint8{0xae, 01, 0xae, 01}}, + Optab{AFXSAVE, ysvrs, Pm, [23]uint8{0xae, 00, 0xae, 00}}, + Optab{AFXRSTOR64, ysvrs, Pw, [23]uint8{0x0f, 0xae, 01, 0x0f, 0xae, 01}}, + Optab{AFXSAVE64, ysvrs, Pw, [23]uint8{0x0f, 0xae, 00, 0x0f, 0xae, 00}}, + Optab{obj.AGLOBL, nil, 0, [23]uint8{}}, + Optab{AHLT, ynone, Px, [23]uint8{0xf4}}, + Optab{AIDIVB, ydivb, Pb, [23]uint8{0xf6, 07}}, + Optab{AIDIVL, ydivl, Px, [23]uint8{0xf7, 07}}, + Optab{AIDIVQ, ydivl, Pw, [23]uint8{0xf7, 07}}, + Optab{AIDIVW, ydivl, Pe, [23]uint8{0xf7, 07}}, + Optab{AIMULB, ydivb, Pb, [23]uint8{0xf6, 05}}, + Optab{AIMULL, yimul, Px, [23]uint8{0xf7, 05, 0x6b, 0x69, Pm, 0xaf}}, + Optab{AIMULQ, yimul, Pw, [23]uint8{0xf7, 05, 0x6b, 0x69, Pm, 0xaf}}, + Optab{AIMULW, yimul, Pe, [23]uint8{0xf7, 05, 0x6b, 0x69, Pm, 0xaf}}, + Optab{AIMUL3Q, yimul3, Pw, [23]uint8{0x6b, 00}}, + Optab{AINB, yin, Pb, [23]uint8{0xe4, 0xec}}, + Optab{AINCB, yincb, Pb, [23]uint8{0xfe, 00}}, + Optab{AINCL, yincl, Px1, [23]uint8{0x40, 0xff, 00}}, + Optab{AINCQ, yincq, Pw, [23]uint8{0xff, 00}}, + Optab{AINCW, yincw, Pe, [23]uint8{0xff, 00}}, + Optab{AINL, yin, Px, [23]uint8{0xe5, 0xed}}, + Optab{AINSB, ynone, Pb, [23]uint8{0x6c}}, + Optab{AINSL, ynone, Px, [23]uint8{0x6d}}, + Optab{AINSW, ynone, Pe, [23]uint8{0x6d}}, + Optab{AINT, yint, Px, [23]uint8{0xcd}}, + Optab{AINTO, ynone, P32, [23]uint8{0xce}}, + Optab{AINW, yin, Pe, [23]uint8{0xe5, 0xed}}, + Optab{AIRETL, ynone, Px, [23]uint8{0xcf}}, + Optab{AIRETQ, ynone, Pw, [23]uint8{0xcf}}, + Optab{AIRETW, ynone, Pe, [23]uint8{0xcf}}, + Optab{AJCC, yjcond, Px, [23]uint8{0x73, 0x83, 00}}, + Optab{AJCS, yjcond, Px, [23]uint8{0x72, 0x82}}, + Optab{AJCXZL, yloop, Px, [23]uint8{0xe3}}, + Optab{AJCXZW, yloop, Px, [23]uint8{0xe3}}, + Optab{AJCXZQ, yloop, Px, [23]uint8{0xe3}}, + Optab{AJEQ, yjcond, Px, [23]uint8{0x74, 0x84}}, + Optab{AJGE, yjcond, Px, [23]uint8{0x7d, 0x8d}}, + Optab{AJGT, yjcond, Px, [23]uint8{0x7f, 0x8f}}, + Optab{AJHI, yjcond, Px, [23]uint8{0x77, 0x87}}, + Optab{AJLE, yjcond, Px, [23]uint8{0x7e, 0x8e}}, + Optab{AJLS, yjcond, Px, [23]uint8{0x76, 0x86}}, + Optab{AJLT, yjcond, Px, [23]uint8{0x7c, 0x8c}}, + Optab{AJMI, yjcond, Px, [23]uint8{0x78, 0x88}}, + Optab{obj.AJMP, yjmp, Px, [23]uint8{0xff, 04, 0xeb, 0xe9}}, + Optab{AJNE, yjcond, Px, [23]uint8{0x75, 0x85}}, + Optab{AJOC, yjcond, Px, [23]uint8{0x71, 0x81, 00}}, + Optab{AJOS, yjcond, Px, [23]uint8{0x70, 0x80, 00}}, + Optab{AJPC, yjcond, Px, [23]uint8{0x7b, 0x8b}}, + Optab{AJPL, yjcond, Px, [23]uint8{0x79, 0x89}}, + Optab{AJPS, yjcond, Px, [23]uint8{0x7a, 0x8a}}, + Optab{ALAHF, ynone, Px, [23]uint8{0x9f}}, + Optab{ALARL, yml_rl, Pm, [23]uint8{0x02}}, + Optab{ALARW, yml_rl, Pq, [23]uint8{0x02}}, + Optab{ALDMXCSR, ysvrs, Pm, [23]uint8{0xae, 02, 0xae, 02}}, + Optab{ALEAL, ym_rl, Px, [23]uint8{0x8d}}, + Optab{ALEAQ, ym_rl, Pw, [23]uint8{0x8d}}, + Optab{ALEAVEL, ynone, P32, [23]uint8{0xc9}}, + Optab{ALEAVEQ, ynone, Py, [23]uint8{0xc9}}, + Optab{ALEAVEW, ynone, Pe, [23]uint8{0xc9}}, + Optab{ALEAW, ym_rl, Pe, [23]uint8{0x8d}}, + Optab{ALOCK, ynone, Px, [23]uint8{0xf0}}, + Optab{ALODSB, ynone, Pb, [23]uint8{0xac}}, + Optab{ALODSL, ynone, Px, [23]uint8{0xad}}, + Optab{ALODSQ, ynone, Pw, [23]uint8{0xad}}, + Optab{ALODSW, ynone, Pe, [23]uint8{0xad}}, + Optab{ALONG, ybyte, Px, [23]uint8{4}}, + Optab{ALOOP, yloop, Px, [23]uint8{0xe2}}, + Optab{ALOOPEQ, yloop, Px, [23]uint8{0xe1}}, + Optab{ALOOPNE, yloop, Px, [23]uint8{0xe0}}, + Optab{ALSLL, yml_rl, Pm, [23]uint8{0x03}}, + Optab{ALSLW, yml_rl, Pq, [23]uint8{0x03}}, + Optab{AMASKMOVOU, yxr, Pe, [23]uint8{0xf7}}, + Optab{AMASKMOVQ, ymr, Pm, [23]uint8{0xf7}}, + Optab{AMAXPD, yxm, Pe, [23]uint8{0x5f}}, + Optab{AMAXPS, yxm, Pm, [23]uint8{0x5f}}, + Optab{AMAXSD, yxm, Pf2, [23]uint8{0x5f}}, + Optab{AMAXSS, yxm, Pf3, [23]uint8{0x5f}}, + Optab{AMINPD, yxm, Pe, [23]uint8{0x5d}}, + Optab{AMINPS, yxm, Pm, [23]uint8{0x5d}}, + Optab{AMINSD, yxm, Pf2, [23]uint8{0x5d}}, + Optab{AMINSS, yxm, Pf3, [23]uint8{0x5d}}, + Optab{AMOVAPD, yxmov, Pe, [23]uint8{0x28, 0x29}}, + Optab{AMOVAPS, yxmov, Pm, [23]uint8{0x28, 0x29}}, + Optab{AMOVB, ymovb, Pb, [23]uint8{0x88, 0x8a, 0xb0, 0xc6, 00}}, + Optab{AMOVBLSX, ymb_rl, Pm, [23]uint8{0xbe}}, + Optab{AMOVBLZX, ymb_rl, Pm, [23]uint8{0xb6}}, + Optab{AMOVBQSX, ymb_rl, Pw, [23]uint8{0x0f, 0xbe}}, + Optab{AMOVBQZX, ymb_rl, Pm, [23]uint8{0xb6}}, + Optab{AMOVBWSX, ymb_rl, Pq, [23]uint8{0xbe}}, + Optab{AMOVBWZX, ymb_rl, Pq, [23]uint8{0xb6}}, + Optab{AMOVO, yxmov, Pe, [23]uint8{0x6f, 0x7f}}, + Optab{AMOVOU, yxmov, Pf3, [23]uint8{0x6f, 0x7f}}, + Optab{AMOVHLPS, yxr, Pm, [23]uint8{0x12}}, + Optab{AMOVHPD, yxmov, Pe, [23]uint8{0x16, 0x17}}, + Optab{AMOVHPS, yxmov, Pm, [23]uint8{0x16, 0x17}}, + Optab{AMOVL, ymovl, Px, [23]uint8{0x89, 0x8b, 0x31, 0xb8, 0xc7, 00, 0x6e, 0x7e, Pe, 0x6e, Pe, 0x7e, 0}}, + Optab{AMOVLHPS, yxr, Pm, [23]uint8{0x16}}, + Optab{AMOVLPD, yxmov, Pe, [23]uint8{0x12, 0x13}}, + Optab{AMOVLPS, yxmov, Pm, [23]uint8{0x12, 0x13}}, + Optab{AMOVLQSX, yml_rl, Pw, [23]uint8{0x63}}, + Optab{AMOVLQZX, yml_rl, Px, [23]uint8{0x8b}}, + Optab{AMOVMSKPD, yxrrl, Pq, [23]uint8{0x50}}, + Optab{AMOVMSKPS, yxrrl, Pm, [23]uint8{0x50}}, + Optab{AMOVNTO, yxr_ml, Pe, [23]uint8{0xe7}}, + Optab{AMOVNTPD, yxr_ml, Pe, [23]uint8{0x2b}}, + Optab{AMOVNTPS, yxr_ml, Pm, [23]uint8{0x2b}}, + Optab{AMOVNTQ, ymr_ml, Pm, [23]uint8{0xe7}}, + Optab{AMOVQ, ymovq, Pw8, [23]uint8{0x6f, 0x7f, Pf2, 0xd6, Pf3, 0x7e, Pe, 0xd6, 0x89, 0x8b, 0x31, 0xc7, 00, 0xb8, 0xc7, 00, 0x6e, 0x7e, Pe, 0x6e, Pe, 0x7e, 0}}, + Optab{AMOVQOZX, ymrxr, Pf3, [23]uint8{0xd6, 0x7e}}, + Optab{AMOVSB, ynone, Pb, [23]uint8{0xa4}}, + Optab{AMOVSD, yxmov, Pf2, [23]uint8{0x10, 0x11}}, + Optab{AMOVSL, ynone, Px, [23]uint8{0xa5}}, + Optab{AMOVSQ, ynone, Pw, [23]uint8{0xa5}}, + Optab{AMOVSS, yxmov, Pf3, [23]uint8{0x10, 0x11}}, + Optab{AMOVSW, ynone, Pe, [23]uint8{0xa5}}, + Optab{AMOVUPD, yxmov, Pe, [23]uint8{0x10, 0x11}}, + Optab{AMOVUPS, yxmov, Pm, [23]uint8{0x10, 0x11}}, + Optab{AMOVW, ymovw, Pe, [23]uint8{0x89, 0x8b, 0x31, 0xb8, 0xc7, 00, 0}}, + Optab{AMOVWLSX, yml_rl, Pm, [23]uint8{0xbf}}, + Optab{AMOVWLZX, yml_rl, Pm, [23]uint8{0xb7}}, + Optab{AMOVWQSX, yml_rl, Pw, [23]uint8{0x0f, 0xbf}}, + Optab{AMOVWQZX, yml_rl, Pw, [23]uint8{0x0f, 0xb7}}, + Optab{AMULB, ydivb, Pb, [23]uint8{0xf6, 04}}, + Optab{AMULL, ydivl, Px, [23]uint8{0xf7, 04}}, + Optab{AMULPD, yxm, Pe, [23]uint8{0x59}}, + Optab{AMULPS, yxm, Ym, [23]uint8{0x59}}, + Optab{AMULQ, ydivl, Pw, [23]uint8{0xf7, 04}}, + Optab{AMULSD, yxm, Pf2, [23]uint8{0x59}}, + Optab{AMULSS, yxm, Pf3, [23]uint8{0x59}}, + Optab{AMULW, ydivl, Pe, [23]uint8{0xf7, 04}}, + Optab{ANEGB, yscond, Pb, [23]uint8{0xf6, 03}}, + Optab{ANEGL, yscond, Px, [23]uint8{0xf7, 03}}, + Optab{ANEGQ, yscond, Pw, [23]uint8{0xf7, 03}}, + Optab{ANEGW, yscond, Pe, [23]uint8{0xf7, 03}}, + Optab{obj.ANOP, ynop, Px, [23]uint8{0, 0}}, + Optab{ANOTB, yscond, Pb, [23]uint8{0xf6, 02}}, + Optab{ANOTL, yscond, Px, [23]uint8{0xf7, 02}}, // TODO(rsc): yscond is wrong here. + Optab{ANOTQ, yscond, Pw, [23]uint8{0xf7, 02}}, + Optab{ANOTW, yscond, Pe, [23]uint8{0xf7, 02}}, + Optab{AORB, yxorb, Pb, [23]uint8{0x0c, 0x80, 01, 0x08, 0x0a}}, + Optab{AORL, yxorl, Px, [23]uint8{0x83, 01, 0x0d, 0x81, 01, 0x09, 0x0b}}, + Optab{AORPD, yxm, Pq, [23]uint8{0x56}}, + Optab{AORPS, yxm, Pm, [23]uint8{0x56}}, + Optab{AORQ, yxorl, Pw, [23]uint8{0x83, 01, 0x0d, 0x81, 01, 0x09, 0x0b}}, + Optab{AORW, yxorl, Pe, [23]uint8{0x83, 01, 0x0d, 0x81, 01, 0x09, 0x0b}}, + Optab{AOUTB, yin, Pb, [23]uint8{0xe6, 0xee}}, + Optab{AOUTL, yin, Px, [23]uint8{0xe7, 0xef}}, + Optab{AOUTSB, ynone, Pb, [23]uint8{0x6e}}, + Optab{AOUTSL, ynone, Px, [23]uint8{0x6f}}, + Optab{AOUTSW, ynone, Pe, [23]uint8{0x6f}}, + Optab{AOUTW, yin, Pe, [23]uint8{0xe7, 0xef}}, + Optab{APACKSSLW, ymm, Py1, [23]uint8{0x6b, Pe, 0x6b}}, + Optab{APACKSSWB, ymm, Py1, [23]uint8{0x63, Pe, 0x63}}, + Optab{APACKUSWB, ymm, Py1, [23]uint8{0x67, Pe, 0x67}}, + Optab{APADDB, ymm, Py1, [23]uint8{0xfc, Pe, 0xfc}}, + Optab{APADDL, ymm, Py1, [23]uint8{0xfe, Pe, 0xfe}}, + Optab{APADDQ, yxm, Pe, [23]uint8{0xd4}}, + Optab{APADDSB, ymm, Py1, [23]uint8{0xec, Pe, 0xec}}, + Optab{APADDSW, ymm, Py1, [23]uint8{0xed, Pe, 0xed}}, + Optab{APADDUSB, ymm, Py1, [23]uint8{0xdc, Pe, 0xdc}}, + Optab{APADDUSW, ymm, Py1, [23]uint8{0xdd, Pe, 0xdd}}, + Optab{APADDW, ymm, Py1, [23]uint8{0xfd, Pe, 0xfd}}, + Optab{APAND, ymm, Py1, [23]uint8{0xdb, Pe, 0xdb}}, + Optab{APANDN, ymm, Py1, [23]uint8{0xdf, Pe, 0xdf}}, + Optab{APAUSE, ynone, Px, [23]uint8{0xf3, 0x90}}, + Optab{APAVGB, ymm, Py1, [23]uint8{0xe0, Pe, 0xe0}}, + Optab{APAVGW, ymm, Py1, [23]uint8{0xe3, Pe, 0xe3}}, + Optab{APCMPEQB, ymm, Py1, [23]uint8{0x74, Pe, 0x74}}, + Optab{APCMPEQL, ymm, Py1, [23]uint8{0x76, Pe, 0x76}}, + Optab{APCMPEQW, ymm, Py1, [23]uint8{0x75, Pe, 0x75}}, + Optab{APCMPGTB, ymm, Py1, [23]uint8{0x64, Pe, 0x64}}, + Optab{APCMPGTL, ymm, Py1, [23]uint8{0x66, Pe, 0x66}}, + Optab{APCMPGTW, ymm, Py1, [23]uint8{0x65, Pe, 0x65}}, + Optab{APEXTRW, yextrw, Pq, [23]uint8{0xc5, 00}}, + Optab{APF2IL, ymfp, Px, [23]uint8{0x1d}}, + Optab{APF2IW, ymfp, Px, [23]uint8{0x1c}}, + Optab{API2FL, ymfp, Px, [23]uint8{0x0d}}, + Optab{APFACC, ymfp, Px, [23]uint8{0xae}}, + Optab{APFADD, ymfp, Px, [23]uint8{0x9e}}, + Optab{APFCMPEQ, ymfp, Px, [23]uint8{0xb0}}, + Optab{APFCMPGE, ymfp, Px, [23]uint8{0x90}}, + Optab{APFCMPGT, ymfp, Px, [23]uint8{0xa0}}, + Optab{APFMAX, ymfp, Px, [23]uint8{0xa4}}, + Optab{APFMIN, ymfp, Px, [23]uint8{0x94}}, + Optab{APFMUL, ymfp, Px, [23]uint8{0xb4}}, + Optab{APFNACC, ymfp, Px, [23]uint8{0x8a}}, + Optab{APFPNACC, ymfp, Px, [23]uint8{0x8e}}, + Optab{APFRCP, ymfp, Px, [23]uint8{0x96}}, + Optab{APFRCPIT1, ymfp, Px, [23]uint8{0xa6}}, + Optab{APFRCPI2T, ymfp, Px, [23]uint8{0xb6}}, + Optab{APFRSQIT1, ymfp, Px, [23]uint8{0xa7}}, + Optab{APFRSQRT, ymfp, Px, [23]uint8{0x97}}, + Optab{APFSUB, ymfp, Px, [23]uint8{0x9a}}, + Optab{APFSUBR, ymfp, Px, [23]uint8{0xaa}}, + Optab{APINSRW, yinsrw, Pq, [23]uint8{0xc4, 00}}, + Optab{APINSRD, yinsr, Pq, [23]uint8{0x3a, 0x22, 00}}, + Optab{APINSRQ, yinsr, Pq3, [23]uint8{0x3a, 0x22, 00}}, + Optab{APMADDWL, ymm, Py1, [23]uint8{0xf5, Pe, 0xf5}}, + Optab{APMAXSW, yxm, Pe, [23]uint8{0xee}}, + Optab{APMAXUB, yxm, Pe, [23]uint8{0xde}}, + Optab{APMINSW, yxm, Pe, [23]uint8{0xea}}, + Optab{APMINUB, yxm, Pe, [23]uint8{0xda}}, + Optab{APMOVMSKB, ymskb, Px, [23]uint8{Pe, 0xd7, 0xd7}}, + Optab{APMULHRW, ymfp, Px, [23]uint8{0xb7}}, + Optab{APMULHUW, ymm, Py1, [23]uint8{0xe4, Pe, 0xe4}}, + Optab{APMULHW, ymm, Py1, [23]uint8{0xe5, Pe, 0xe5}}, + Optab{APMULLW, ymm, Py1, [23]uint8{0xd5, Pe, 0xd5}}, + Optab{APMULULQ, ymm, Py1, [23]uint8{0xf4, Pe, 0xf4}}, + Optab{APOPAL, ynone, P32, [23]uint8{0x61}}, + Optab{APOPAW, ynone, Pe, [23]uint8{0x61}}, + Optab{APOPFL, ynone, P32, [23]uint8{0x9d}}, + Optab{APOPFQ, ynone, Py, [23]uint8{0x9d}}, + Optab{APOPFW, ynone, Pe, [23]uint8{0x9d}}, + Optab{APOPL, ypopl, P32, [23]uint8{0x58, 0x8f, 00}}, + Optab{APOPQ, ypopl, Py, [23]uint8{0x58, 0x8f, 00}}, + Optab{APOPW, ypopl, Pe, [23]uint8{0x58, 0x8f, 00}}, + Optab{APOR, ymm, Py1, [23]uint8{0xeb, Pe, 0xeb}}, + Optab{APSADBW, yxm, Pq, [23]uint8{0xf6}}, + Optab{APSHUFHW, yxshuf, Pf3, [23]uint8{0x70, 00}}, + Optab{APSHUFL, yxshuf, Pq, [23]uint8{0x70, 00}}, + Optab{APSHUFLW, yxshuf, Pf2, [23]uint8{0x70, 00}}, + Optab{APSHUFW, ymshuf, Pm, [23]uint8{0x70, 00}}, + Optab{APSHUFB, ymshufb, Pq, [23]uint8{0x38, 0x00}}, + Optab{APSLLO, ypsdq, Pq, [23]uint8{0x73, 07}}, + Optab{APSLLL, yps, Py3, [23]uint8{0xf2, 0x72, 06, Pe, 0xf2, Pe, 0x72, 06}}, + Optab{APSLLQ, yps, Py3, [23]uint8{0xf3, 0x73, 06, Pe, 0xf3, Pe, 0x73, 06}}, + Optab{APSLLW, yps, Py3, [23]uint8{0xf1, 0x71, 06, Pe, 0xf1, Pe, 0x71, 06}}, + Optab{APSRAL, yps, Py3, [23]uint8{0xe2, 0x72, 04, Pe, 0xe2, Pe, 0x72, 04}}, + Optab{APSRAW, yps, Py3, [23]uint8{0xe1, 0x71, 04, Pe, 0xe1, Pe, 0x71, 04}}, + Optab{APSRLO, ypsdq, Pq, [23]uint8{0x73, 03}}, + Optab{APSRLL, yps, Py3, [23]uint8{0xd2, 0x72, 02, Pe, 0xd2, Pe, 0x72, 02}}, + Optab{APSRLQ, yps, Py3, [23]uint8{0xd3, 0x73, 02, Pe, 0xd3, Pe, 0x73, 02}}, + Optab{APSRLW, yps, Py3, [23]uint8{0xd1, 0x71, 02, Pe, 0xe1, Pe, 0x71, 02}}, + Optab{APSUBB, yxm, Pe, [23]uint8{0xf8}}, + Optab{APSUBL, yxm, Pe, [23]uint8{0xfa}}, + Optab{APSUBQ, yxm, Pe, [23]uint8{0xfb}}, + Optab{APSUBSB, yxm, Pe, [23]uint8{0xe8}}, + Optab{APSUBSW, yxm, Pe, [23]uint8{0xe9}}, + Optab{APSUBUSB, yxm, Pe, [23]uint8{0xd8}}, + Optab{APSUBUSW, yxm, Pe, [23]uint8{0xd9}}, + Optab{APSUBW, yxm, Pe, [23]uint8{0xf9}}, + Optab{APSWAPL, ymfp, Px, [23]uint8{0xbb}}, + Optab{APUNPCKHBW, ymm, Py1, [23]uint8{0x68, Pe, 0x68}}, + Optab{APUNPCKHLQ, ymm, Py1, [23]uint8{0x6a, Pe, 0x6a}}, + Optab{APUNPCKHQDQ, yxm, Pe, [23]uint8{0x6d}}, + Optab{APUNPCKHWL, ymm, Py1, [23]uint8{0x69, Pe, 0x69}}, + Optab{APUNPCKLBW, ymm, Py1, [23]uint8{0x60, Pe, 0x60}}, + Optab{APUNPCKLLQ, ymm, Py1, [23]uint8{0x62, Pe, 0x62}}, + Optab{APUNPCKLQDQ, yxm, Pe, [23]uint8{0x6c}}, + Optab{APUNPCKLWL, ymm, Py1, [23]uint8{0x61, Pe, 0x61}}, + Optab{APUSHAL, ynone, P32, [23]uint8{0x60}}, + Optab{APUSHAW, ynone, Pe, [23]uint8{0x60}}, + Optab{APUSHFL, ynone, P32, [23]uint8{0x9c}}, + Optab{APUSHFQ, ynone, Py, [23]uint8{0x9c}}, + Optab{APUSHFW, ynone, Pe, [23]uint8{0x9c}}, + Optab{APUSHL, ypushl, P32, [23]uint8{0x50, 0xff, 06, 0x6a, 0x68}}, + Optab{APUSHQ, ypushl, Py, [23]uint8{0x50, 0xff, 06, 0x6a, 0x68}}, + Optab{APUSHW, ypushl, Pe, [23]uint8{0x50, 0xff, 06, 0x6a, 0x68}}, + Optab{APXOR, ymm, Py1, [23]uint8{0xef, Pe, 0xef}}, + Optab{AQUAD, ybyte, Px, [23]uint8{8}}, + Optab{ARCLB, yshb, Pb, [23]uint8{0xd0, 02, 0xc0, 02, 0xd2, 02}}, + Optab{ARCLL, yshl, Px, [23]uint8{0xd1, 02, 0xc1, 02, 0xd3, 02, 0xd3, 02}}, + Optab{ARCLQ, yshl, Pw, [23]uint8{0xd1, 02, 0xc1, 02, 0xd3, 02, 0xd3, 02}}, + Optab{ARCLW, yshl, Pe, [23]uint8{0xd1, 02, 0xc1, 02, 0xd3, 02, 0xd3, 02}}, + Optab{ARCPPS, yxm, Pm, [23]uint8{0x53}}, + Optab{ARCPSS, yxm, Pf3, [23]uint8{0x53}}, + Optab{ARCRB, yshb, Pb, [23]uint8{0xd0, 03, 0xc0, 03, 0xd2, 03}}, + Optab{ARCRL, yshl, Px, [23]uint8{0xd1, 03, 0xc1, 03, 0xd3, 03, 0xd3, 03}}, + Optab{ARCRQ, yshl, Pw, [23]uint8{0xd1, 03, 0xc1, 03, 0xd3, 03, 0xd3, 03}}, + Optab{ARCRW, yshl, Pe, [23]uint8{0xd1, 03, 0xc1, 03, 0xd3, 03, 0xd3, 03}}, + Optab{AREP, ynone, Px, [23]uint8{0xf3}}, + Optab{AREPN, ynone, Px, [23]uint8{0xf2}}, + Optab{obj.ARET, ynone, Px, [23]uint8{0xc3}}, + Optab{ARETFW, yret, Pe, [23]uint8{0xcb, 0xca}}, + Optab{ARETFL, yret, Px, [23]uint8{0xcb, 0xca}}, + Optab{ARETFQ, yret, Pw, [23]uint8{0xcb, 0xca}}, + Optab{AROLB, yshb, Pb, [23]uint8{0xd0, 00, 0xc0, 00, 0xd2, 00}}, + Optab{AROLL, yshl, Px, [23]uint8{0xd1, 00, 0xc1, 00, 0xd3, 00, 0xd3, 00}}, + Optab{AROLQ, yshl, Pw, [23]uint8{0xd1, 00, 0xc1, 00, 0xd3, 00, 0xd3, 00}}, + Optab{AROLW, yshl, Pe, [23]uint8{0xd1, 00, 0xc1, 00, 0xd3, 00, 0xd3, 00}}, + Optab{ARORB, yshb, Pb, [23]uint8{0xd0, 01, 0xc0, 01, 0xd2, 01}}, + Optab{ARORL, yshl, Px, [23]uint8{0xd1, 01, 0xc1, 01, 0xd3, 01, 0xd3, 01}}, + Optab{ARORQ, yshl, Pw, [23]uint8{0xd1, 01, 0xc1, 01, 0xd3, 01, 0xd3, 01}}, + Optab{ARORW, yshl, Pe, [23]uint8{0xd1, 01, 0xc1, 01, 0xd3, 01, 0xd3, 01}}, + Optab{ARSQRTPS, yxm, Pm, [23]uint8{0x52}}, + Optab{ARSQRTSS, yxm, Pf3, [23]uint8{0x52}}, + Optab{ASAHF, ynone, Px1, [23]uint8{0x9e, 00, 0x86, 0xe0, 0x50, 0x9d}}, /* XCHGB AH,AL; PUSH AX; POPFL */ + Optab{ASALB, yshb, Pb, [23]uint8{0xd0, 04, 0xc0, 04, 0xd2, 04}}, + Optab{ASALL, yshl, Px, [23]uint8{0xd1, 04, 0xc1, 04, 0xd3, 04, 0xd3, 04}}, + Optab{ASALQ, yshl, Pw, [23]uint8{0xd1, 04, 0xc1, 04, 0xd3, 04, 0xd3, 04}}, + Optab{ASALW, yshl, Pe, [23]uint8{0xd1, 04, 0xc1, 04, 0xd3, 04, 0xd3, 04}}, + Optab{ASARB, yshb, Pb, [23]uint8{0xd0, 07, 0xc0, 07, 0xd2, 07}}, + Optab{ASARL, yshl, Px, [23]uint8{0xd1, 07, 0xc1, 07, 0xd3, 07, 0xd3, 07}}, + Optab{ASARQ, yshl, Pw, [23]uint8{0xd1, 07, 0xc1, 07, 0xd3, 07, 0xd3, 07}}, + Optab{ASARW, yshl, Pe, [23]uint8{0xd1, 07, 0xc1, 07, 0xd3, 07, 0xd3, 07}}, + Optab{ASBBB, yxorb, Pb, [23]uint8{0x1c, 0x80, 03, 0x18, 0x1a}}, + Optab{ASBBL, yxorl, Px, [23]uint8{0x83, 03, 0x1d, 0x81, 03, 0x19, 0x1b}}, + Optab{ASBBQ, yxorl, Pw, [23]uint8{0x83, 03, 0x1d, 0x81, 03, 0x19, 0x1b}}, + Optab{ASBBW, yxorl, Pe, [23]uint8{0x83, 03, 0x1d, 0x81, 03, 0x19, 0x1b}}, + Optab{ASCASB, ynone, Pb, [23]uint8{0xae}}, + Optab{ASCASL, ynone, Px, [23]uint8{0xaf}}, + Optab{ASCASQ, ynone, Pw, [23]uint8{0xaf}}, + Optab{ASCASW, ynone, Pe, [23]uint8{0xaf}}, + Optab{ASETCC, yscond, Pb, [23]uint8{0x0f, 0x93, 00}}, + Optab{ASETCS, yscond, Pb, [23]uint8{0x0f, 0x92, 00}}, + Optab{ASETEQ, yscond, Pb, [23]uint8{0x0f, 0x94, 00}}, + Optab{ASETGE, yscond, Pb, [23]uint8{0x0f, 0x9d, 00}}, + Optab{ASETGT, yscond, Pb, [23]uint8{0x0f, 0x9f, 00}}, + Optab{ASETHI, yscond, Pb, [23]uint8{0x0f, 0x97, 00}}, + Optab{ASETLE, yscond, Pb, [23]uint8{0x0f, 0x9e, 00}}, + Optab{ASETLS, yscond, Pb, [23]uint8{0x0f, 0x96, 00}}, + Optab{ASETLT, yscond, Pb, [23]uint8{0x0f, 0x9c, 00}}, + Optab{ASETMI, yscond, Pb, [23]uint8{0x0f, 0x98, 00}}, + Optab{ASETNE, yscond, Pb, [23]uint8{0x0f, 0x95, 00}}, + Optab{ASETOC, yscond, Pb, [23]uint8{0x0f, 0x91, 00}}, + Optab{ASETOS, yscond, Pb, [23]uint8{0x0f, 0x90, 00}}, + Optab{ASETPC, yscond, Pb, [23]uint8{0x0f, 0x9b, 00}}, + Optab{ASETPL, yscond, Pb, [23]uint8{0x0f, 0x99, 00}}, + Optab{ASETPS, yscond, Pb, [23]uint8{0x0f, 0x9a, 00}}, + Optab{ASHLB, yshb, Pb, [23]uint8{0xd0, 04, 0xc0, 04, 0xd2, 04}}, + Optab{ASHLL, yshl, Px, [23]uint8{0xd1, 04, 0xc1, 04, 0xd3, 04, 0xd3, 04}}, + Optab{ASHLQ, yshl, Pw, [23]uint8{0xd1, 04, 0xc1, 04, 0xd3, 04, 0xd3, 04}}, + Optab{ASHLW, yshl, Pe, [23]uint8{0xd1, 04, 0xc1, 04, 0xd3, 04, 0xd3, 04}}, + Optab{ASHRB, yshb, Pb, [23]uint8{0xd0, 05, 0xc0, 05, 0xd2, 05}}, + Optab{ASHRL, yshl, Px, [23]uint8{0xd1, 05, 0xc1, 05, 0xd3, 05, 0xd3, 05}}, + Optab{ASHRQ, yshl, Pw, [23]uint8{0xd1, 05, 0xc1, 05, 0xd3, 05, 0xd3, 05}}, + Optab{ASHRW, yshl, Pe, [23]uint8{0xd1, 05, 0xc1, 05, 0xd3, 05, 0xd3, 05}}, + Optab{ASHUFPD, yxshuf, Pq, [23]uint8{0xc6, 00}}, + Optab{ASHUFPS, yxshuf, Pm, [23]uint8{0xc6, 00}}, + Optab{ASQRTPD, yxm, Pe, [23]uint8{0x51}}, + Optab{ASQRTPS, yxm, Pm, [23]uint8{0x51}}, + Optab{ASQRTSD, yxm, Pf2, [23]uint8{0x51}}, + Optab{ASQRTSS, yxm, Pf3, [23]uint8{0x51}}, + Optab{ASTC, ynone, Px, [23]uint8{0xf9}}, + Optab{ASTD, ynone, Px, [23]uint8{0xfd}}, + Optab{ASTI, ynone, Px, [23]uint8{0xfb}}, + Optab{ASTMXCSR, ysvrs, Pm, [23]uint8{0xae, 03, 0xae, 03}}, + Optab{ASTOSB, ynone, Pb, [23]uint8{0xaa}}, + Optab{ASTOSL, ynone, Px, [23]uint8{0xab}}, + Optab{ASTOSQ, ynone, Pw, [23]uint8{0xab}}, + Optab{ASTOSW, ynone, Pe, [23]uint8{0xab}}, + Optab{ASUBB, yxorb, Pb, [23]uint8{0x2c, 0x80, 05, 0x28, 0x2a}}, + Optab{ASUBL, yaddl, Px, [23]uint8{0x83, 05, 0x2d, 0x81, 05, 0x29, 0x2b}}, + Optab{ASUBPD, yxm, Pe, [23]uint8{0x5c}}, + Optab{ASUBPS, yxm, Pm, [23]uint8{0x5c}}, + Optab{ASUBQ, yaddl, Pw, [23]uint8{0x83, 05, 0x2d, 0x81, 05, 0x29, 0x2b}}, + Optab{ASUBSD, yxm, Pf2, [23]uint8{0x5c}}, + Optab{ASUBSS, yxm, Pf3, [23]uint8{0x5c}}, + Optab{ASUBW, yaddl, Pe, [23]uint8{0x83, 05, 0x2d, 0x81, 05, 0x29, 0x2b}}, + Optab{ASWAPGS, ynone, Pm, [23]uint8{0x01, 0xf8}}, + Optab{ASYSCALL, ynone, Px, [23]uint8{0x0f, 0x05}}, /* fast syscall */ + Optab{ATESTB, ytestb, Pb, [23]uint8{0xa8, 0xf6, 00, 0x84, 0x84}}, + Optab{ATESTL, ytestl, Px, [23]uint8{0xa9, 0xf7, 00, 0x85, 0x85}}, + Optab{ATESTQ, ytestl, Pw, [23]uint8{0xa9, 0xf7, 00, 0x85, 0x85}}, + Optab{ATESTW, ytestl, Pe, [23]uint8{0xa9, 0xf7, 00, 0x85, 0x85}}, + Optab{obj.ATEXT, ytext, Px, [23]uint8{}}, + Optab{AUCOMISD, yxcmp, Pe, [23]uint8{0x2e}}, + Optab{AUCOMISS, yxcmp, Pm, [23]uint8{0x2e}}, + Optab{AUNPCKHPD, yxm, Pe, [23]uint8{0x15}}, + Optab{AUNPCKHPS, yxm, Pm, [23]uint8{0x15}}, + Optab{AUNPCKLPD, yxm, Pe, [23]uint8{0x14}}, + Optab{AUNPCKLPS, yxm, Pm, [23]uint8{0x14}}, + Optab{AVERR, ydivl, Pm, [23]uint8{0x00, 04}}, + Optab{AVERW, ydivl, Pm, [23]uint8{0x00, 05}}, + Optab{AWAIT, ynone, Px, [23]uint8{0x9b}}, + Optab{AWORD, ybyte, Px, [23]uint8{2}}, + Optab{AXCHGB, yml_mb, Pb, [23]uint8{0x86, 0x86}}, + Optab{AXCHGL, yxchg, Px, [23]uint8{0x90, 0x90, 0x87, 0x87}}, + Optab{AXCHGQ, yxchg, Pw, [23]uint8{0x90, 0x90, 0x87, 0x87}}, + Optab{AXCHGW, yxchg, Pe, [23]uint8{0x90, 0x90, 0x87, 0x87}}, + Optab{AXLAT, ynone, Px, [23]uint8{0xd7}}, + Optab{AXORB, yxorb, Pb, [23]uint8{0x34, 0x80, 06, 0x30, 0x32}}, + Optab{AXORL, yxorl, Px, [23]uint8{0x83, 06, 0x35, 0x81, 06, 0x31, 0x33}}, + Optab{AXORPD, yxm, Pe, [23]uint8{0x57}}, + Optab{AXORPS, yxm, Pm, [23]uint8{0x57}}, + Optab{AXORQ, yxorl, Pw, [23]uint8{0x83, 06, 0x35, 0x81, 06, 0x31, 0x33}}, + Optab{AXORW, yxorl, Pe, [23]uint8{0x83, 06, 0x35, 0x81, 06, 0x31, 0x33}}, + Optab{AFMOVB, yfmvx, Px, [23]uint8{0xdf, 04}}, + Optab{AFMOVBP, yfmvp, Px, [23]uint8{0xdf, 06}}, + Optab{AFMOVD, yfmvd, Px, [23]uint8{0xdd, 00, 0xdd, 02, 0xd9, 00, 0xdd, 02}}, + Optab{AFMOVDP, yfmvdp, Px, [23]uint8{0xdd, 03, 0xdd, 03}}, + Optab{AFMOVF, yfmvf, Px, [23]uint8{0xd9, 00, 0xd9, 02}}, + Optab{AFMOVFP, yfmvp, Px, [23]uint8{0xd9, 03}}, + Optab{AFMOVL, yfmvf, Px, [23]uint8{0xdb, 00, 0xdb, 02}}, + Optab{AFMOVLP, yfmvp, Px, [23]uint8{0xdb, 03}}, + Optab{AFMOVV, yfmvx, Px, [23]uint8{0xdf, 05}}, + Optab{AFMOVVP, yfmvp, Px, [23]uint8{0xdf, 07}}, + Optab{AFMOVW, yfmvf, Px, [23]uint8{0xdf, 00, 0xdf, 02}}, + Optab{AFMOVWP, yfmvp, Px, [23]uint8{0xdf, 03}}, + Optab{AFMOVX, yfmvx, Px, [23]uint8{0xdb, 05}}, + Optab{AFMOVXP, yfmvp, Px, [23]uint8{0xdb, 07}}, + Optab{AFCMOVCC, yfcmv, Px, [23]uint8{0xdb, 00}}, + Optab{AFCMOVCS, yfcmv, Px, [23]uint8{0xda, 00}}, + Optab{AFCMOVEQ, yfcmv, Px, [23]uint8{0xda, 01}}, + Optab{AFCMOVHI, yfcmv, Px, [23]uint8{0xdb, 02}}, + Optab{AFCMOVLS, yfcmv, Px, [23]uint8{0xda, 02}}, + Optab{AFCMOVNE, yfcmv, Px, [23]uint8{0xdb, 01}}, + Optab{AFCMOVNU, yfcmv, Px, [23]uint8{0xdb, 03}}, + Optab{AFCMOVUN, yfcmv, Px, [23]uint8{0xda, 03}}, + Optab{AFCOMB, nil, 0, [23]uint8{}}, + Optab{AFCOMBP, nil, 0, [23]uint8{}}, + Optab{AFCOMD, yfadd, Px, [23]uint8{0xdc, 02, 0xd8, 02, 0xdc, 02}}, /* botch */ + Optab{AFCOMDP, yfadd, Px, [23]uint8{0xdc, 03, 0xd8, 03, 0xdc, 03}}, /* botch */ + Optab{AFCOMDPP, ycompp, Px, [23]uint8{0xde, 03}}, + Optab{AFCOMF, yfmvx, Px, [23]uint8{0xd8, 02}}, + Optab{AFCOMFP, yfmvx, Px, [23]uint8{0xd8, 03}}, + Optab{AFCOMI, yfmvx, Px, [23]uint8{0xdb, 06}}, + Optab{AFCOMIP, yfmvx, Px, [23]uint8{0xdf, 06}}, + Optab{AFCOML, yfmvx, Px, [23]uint8{0xda, 02}}, + Optab{AFCOMLP, yfmvx, Px, [23]uint8{0xda, 03}}, + Optab{AFCOMW, yfmvx, Px, [23]uint8{0xde, 02}}, + Optab{AFCOMWP, yfmvx, Px, [23]uint8{0xde, 03}}, + Optab{AFUCOM, ycompp, Px, [23]uint8{0xdd, 04}}, + Optab{AFUCOMI, ycompp, Px, [23]uint8{0xdb, 05}}, + Optab{AFUCOMIP, ycompp, Px, [23]uint8{0xdf, 05}}, + Optab{AFUCOMP, ycompp, Px, [23]uint8{0xdd, 05}}, + Optab{AFUCOMPP, ycompp, Px, [23]uint8{0xda, 13}}, + Optab{AFADDDP, yfaddp, Px, [23]uint8{0xde, 00}}, + Optab{AFADDW, yfmvx, Px, [23]uint8{0xde, 00}}, + Optab{AFADDL, yfmvx, Px, [23]uint8{0xda, 00}}, + Optab{AFADDF, yfmvx, Px, [23]uint8{0xd8, 00}}, + Optab{AFADDD, yfadd, Px, [23]uint8{0xdc, 00, 0xd8, 00, 0xdc, 00}}, + Optab{AFMULDP, yfaddp, Px, [23]uint8{0xde, 01}}, + Optab{AFMULW, yfmvx, Px, [23]uint8{0xde, 01}}, + Optab{AFMULL, yfmvx, Px, [23]uint8{0xda, 01}}, + Optab{AFMULF, yfmvx, Px, [23]uint8{0xd8, 01}}, + Optab{AFMULD, yfadd, Px, [23]uint8{0xdc, 01, 0xd8, 01, 0xdc, 01}}, + Optab{AFSUBDP, yfaddp, Px, [23]uint8{0xde, 05}}, + Optab{AFSUBW, yfmvx, Px, [23]uint8{0xde, 04}}, + Optab{AFSUBL, yfmvx, Px, [23]uint8{0xda, 04}}, + Optab{AFSUBF, yfmvx, Px, [23]uint8{0xd8, 04}}, + Optab{AFSUBD, yfadd, Px, [23]uint8{0xdc, 04, 0xd8, 04, 0xdc, 05}}, + Optab{AFSUBRDP, yfaddp, Px, [23]uint8{0xde, 04}}, + Optab{AFSUBRW, yfmvx, Px, [23]uint8{0xde, 05}}, + Optab{AFSUBRL, yfmvx, Px, [23]uint8{0xda, 05}}, + Optab{AFSUBRF, yfmvx, Px, [23]uint8{0xd8, 05}}, + Optab{AFSUBRD, yfadd, Px, [23]uint8{0xdc, 05, 0xd8, 05, 0xdc, 04}}, + Optab{AFDIVDP, yfaddp, Px, [23]uint8{0xde, 07}}, + Optab{AFDIVW, yfmvx, Px, [23]uint8{0xde, 06}}, + Optab{AFDIVL, yfmvx, Px, [23]uint8{0xda, 06}}, + Optab{AFDIVF, yfmvx, Px, [23]uint8{0xd8, 06}}, + Optab{AFDIVD, yfadd, Px, [23]uint8{0xdc, 06, 0xd8, 06, 0xdc, 07}}, + Optab{AFDIVRDP, yfaddp, Px, [23]uint8{0xde, 06}}, + Optab{AFDIVRW, yfmvx, Px, [23]uint8{0xde, 07}}, + Optab{AFDIVRL, yfmvx, Px, [23]uint8{0xda, 07}}, + Optab{AFDIVRF, yfmvx, Px, [23]uint8{0xd8, 07}}, + Optab{AFDIVRD, yfadd, Px, [23]uint8{0xdc, 07, 0xd8, 07, 0xdc, 06}}, + Optab{AFXCHD, yfxch, Px, [23]uint8{0xd9, 01, 0xd9, 01}}, + Optab{AFFREE, nil, 0, [23]uint8{}}, + Optab{AFLDCW, ystcw, Px, [23]uint8{0xd9, 05, 0xd9, 05}}, + Optab{AFLDENV, ystcw, Px, [23]uint8{0xd9, 04, 0xd9, 04}}, + Optab{AFRSTOR, ysvrs, Px, [23]uint8{0xdd, 04, 0xdd, 04}}, + Optab{AFSAVE, ysvrs, Px, [23]uint8{0xdd, 06, 0xdd, 06}}, + Optab{AFSTCW, ystcw, Px, [23]uint8{0xd9, 07, 0xd9, 07}}, + Optab{AFSTENV, ystcw, Px, [23]uint8{0xd9, 06, 0xd9, 06}}, + Optab{AFSTSW, ystsw, Px, [23]uint8{0xdd, 07, 0xdf, 0xe0}}, + Optab{AF2XM1, ynone, Px, [23]uint8{0xd9, 0xf0}}, + Optab{AFABS, ynone, Px, [23]uint8{0xd9, 0xe1}}, + Optab{AFCHS, ynone, Px, [23]uint8{0xd9, 0xe0}}, + Optab{AFCLEX, ynone, Px, [23]uint8{0xdb, 0xe2}}, + Optab{AFCOS, ynone, Px, [23]uint8{0xd9, 0xff}}, + Optab{AFDECSTP, ynone, Px, [23]uint8{0xd9, 0xf6}}, + Optab{AFINCSTP, ynone, Px, [23]uint8{0xd9, 0xf7}}, + Optab{AFINIT, ynone, Px, [23]uint8{0xdb, 0xe3}}, + Optab{AFLD1, ynone, Px, [23]uint8{0xd9, 0xe8}}, + Optab{AFLDL2E, ynone, Px, [23]uint8{0xd9, 0xea}}, + Optab{AFLDL2T, ynone, Px, [23]uint8{0xd9, 0xe9}}, + Optab{AFLDLG2, ynone, Px, [23]uint8{0xd9, 0xec}}, + Optab{AFLDLN2, ynone, Px, [23]uint8{0xd9, 0xed}}, + Optab{AFLDPI, ynone, Px, [23]uint8{0xd9, 0xeb}}, + Optab{AFLDZ, ynone, Px, [23]uint8{0xd9, 0xee}}, + Optab{AFNOP, ynone, Px, [23]uint8{0xd9, 0xd0}}, + Optab{AFPATAN, ynone, Px, [23]uint8{0xd9, 0xf3}}, + Optab{AFPREM, ynone, Px, [23]uint8{0xd9, 0xf8}}, + Optab{AFPREM1, ynone, Px, [23]uint8{0xd9, 0xf5}}, + Optab{AFPTAN, ynone, Px, [23]uint8{0xd9, 0xf2}}, + Optab{AFRNDINT, ynone, Px, [23]uint8{0xd9, 0xfc}}, + Optab{AFSCALE, ynone, Px, [23]uint8{0xd9, 0xfd}}, + Optab{AFSIN, ynone, Px, [23]uint8{0xd9, 0xfe}}, + Optab{AFSINCOS, ynone, Px, [23]uint8{0xd9, 0xfb}}, + Optab{AFSQRT, ynone, Px, [23]uint8{0xd9, 0xfa}}, + Optab{AFTST, ynone, Px, [23]uint8{0xd9, 0xe4}}, + Optab{AFXAM, ynone, Px, [23]uint8{0xd9, 0xe5}}, + Optab{AFXTRACT, ynone, Px, [23]uint8{0xd9, 0xf4}}, + Optab{AFYL2X, ynone, Px, [23]uint8{0xd9, 0xf1}}, + Optab{AFYL2XP1, ynone, Px, [23]uint8{0xd9, 0xf9}}, + Optab{ACMPXCHGB, yrb_mb, Pb, [23]uint8{0x0f, 0xb0}}, + Optab{ACMPXCHGL, yrl_ml, Px, [23]uint8{0x0f, 0xb1}}, + Optab{ACMPXCHGW, yrl_ml, Pe, [23]uint8{0x0f, 0xb1}}, + Optab{ACMPXCHGQ, yrl_ml, Pw, [23]uint8{0x0f, 0xb1}}, + Optab{ACMPXCHG8B, yscond, Pm, [23]uint8{0xc7, 01}}, + Optab{AINVD, ynone, Pm, [23]uint8{0x08}}, + Optab{AINVLPG, ymbs, Pm, [23]uint8{0x01, 07}}, + Optab{ALFENCE, ynone, Pm, [23]uint8{0xae, 0xe8}}, + Optab{AMFENCE, ynone, Pm, [23]uint8{0xae, 0xf0}}, + Optab{AMOVNTIL, yrl_ml, Pm, [23]uint8{0xc3}}, + Optab{AMOVNTIQ, yrl_ml, Pw, [23]uint8{0x0f, 0xc3}}, + Optab{ARDMSR, ynone, Pm, [23]uint8{0x32}}, + Optab{ARDPMC, ynone, Pm, [23]uint8{0x33}}, + Optab{ARDTSC, ynone, Pm, [23]uint8{0x31}}, + Optab{ARSM, ynone, Pm, [23]uint8{0xaa}}, + Optab{ASFENCE, ynone, Pm, [23]uint8{0xae, 0xf8}}, + Optab{ASYSRET, ynone, Pm, [23]uint8{0x07}}, + Optab{AWBINVD, ynone, Pm, [23]uint8{0x09}}, + Optab{AWRMSR, ynone, Pm, [23]uint8{0x30}}, + Optab{AXADDB, yrb_mb, Pb, [23]uint8{0x0f, 0xc0}}, + Optab{AXADDL, yrl_ml, Px, [23]uint8{0x0f, 0xc1}}, + Optab{AXADDQ, yrl_ml, Pw, [23]uint8{0x0f, 0xc1}}, + Optab{AXADDW, yrl_ml, Pe, [23]uint8{0x0f, 0xc1}}, + Optab{ACRC32B, ycrc32l, Px, [23]uint8{0xf2, 0x0f, 0x38, 0xf0, 0}}, + Optab{ACRC32Q, ycrc32l, Pw, [23]uint8{0xf2, 0x0f, 0x38, 0xf1, 0}}, + Optab{APREFETCHT0, yprefetch, Pm, [23]uint8{0x18, 01}}, + Optab{APREFETCHT1, yprefetch, Pm, [23]uint8{0x18, 02}}, + Optab{APREFETCHT2, yprefetch, Pm, [23]uint8{0x18, 03}}, + Optab{APREFETCHNTA, yprefetch, Pm, [23]uint8{0x18, 00}}, + Optab{AMOVQL, yrl_ml, Px, [23]uint8{0x89}}, + Optab{obj.AUNDEF, ynone, Px, [23]uint8{0x0f, 0x0b}}, + Optab{AAESENC, yaes, Pq, [23]uint8{0x38, 0xdc, 0}}, + Optab{AAESENCLAST, yaes, Pq, [23]uint8{0x38, 0xdd, 0}}, + Optab{AAESDEC, yaes, Pq, [23]uint8{0x38, 0xde, 0}}, + Optab{AAESDECLAST, yaes, Pq, [23]uint8{0x38, 0xdf, 0}}, + Optab{AAESIMC, yaes, Pq, [23]uint8{0x38, 0xdb, 0}}, + Optab{AAESKEYGENASSIST, yaes2, Pq, [23]uint8{0x3a, 0xdf, 0}}, + Optab{APSHUFD, yxshuf, Pq, [23]uint8{0x70, 0}}, + Optab{APCLMULQDQ, yxshuf, Pq, [23]uint8{0x3a, 0x44, 0}}, + Optab{obj.AUSEFIELD, ynop, Px, [23]uint8{0, 0}}, + Optab{obj.ATYPE, nil, 0, [23]uint8{}}, + Optab{obj.AFUNCDATA, yfuncdata, Px, [23]uint8{0, 0}}, + Optab{obj.APCDATA, ypcdata, Px, [23]uint8{0, 0}}, + Optab{obj.ACHECKNIL, nil, 0, [23]uint8{}}, + Optab{obj.AVARDEF, nil, 0, [23]uint8{}}, + Optab{obj.AVARKILL, nil, 0, [23]uint8{}}, + Optab{obj.ADUFFCOPY, yduff, Px, [23]uint8{0xe8}}, + Optab{obj.ADUFFZERO, yduff, Px, [23]uint8{0xe8}}, + Optab{obj.AEND, nil, 0, [23]uint8{}}, + Optab{0, nil, 0, [23]uint8{}}, +} + +var opindex [(ALAST + 1) & obj.AMask]*Optab + +// isextern reports whether s describes an external symbol that must avoid pc-relative addressing. +// This happens on systems like Solaris that call .so functions instead of system calls. +// It does not seem to be necessary for any other systems. This is probably working +// around a Solaris-specific bug that should be fixed differently, but we don't know +// what that bug is. And this does fix it. +func isextern(s *obj.LSym) bool { + // All the Solaris dynamic imports from libc.so begin with "libc_". + return strings.HasPrefix(s.Name, "libc_") +} + +// single-instruction no-ops of various lengths. +// constructed by hand and disassembled with gdb to verify. +// see http://www.agner.org/optimize/optimizing_assembly.pdf for discussion. +var nop = [][16]uint8{ + [16]uint8{0x90}, + [16]uint8{0x66, 0x90}, + [16]uint8{0x0F, 0x1F, 0x00}, + [16]uint8{0x0F, 0x1F, 0x40, 0x00}, + [16]uint8{0x0F, 0x1F, 0x44, 0x00, 0x00}, + [16]uint8{0x66, 0x0F, 0x1F, 0x44, 0x00, 0x00}, + [16]uint8{0x0F, 0x1F, 0x80, 0x00, 0x00, 0x00, 0x00}, + [16]uint8{0x0F, 0x1F, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00}, + [16]uint8{0x66, 0x0F, 0x1F, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00}, +} + +// Native Client rejects the repeated 0x66 prefix. +// {0x66, 0x66, 0x0F, 0x1F, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00}, +func fillnop(p []byte, n int) { + var m int + + for n > 0 { + m = n + if m > len(nop) { + m = len(nop) + } + copy(p[:m], nop[m-1][:m]) + p = p[m:] + n -= m + } +} + +func naclpad(ctxt *obj.Link, s *obj.LSym, c int32, pad int32) int32 { + obj.Symgrow(ctxt, s, int64(c)+int64(pad)) + fillnop(s.P[c:], int(pad)) + return c + pad +} + +func spadjop(ctxt *obj.Link, p *obj.Prog, l int, q int) int { + if p.Mode != 64 || ctxt.Arch.Ptrsize == 4 { + return l + } + return q +} + +func span6(ctxt *obj.Link, s *obj.LSym) { + ctxt.Cursym = s + + if s.P != nil { + return + } + + if ycover[0] == 0 { + instinit() + } + + var v int32 + for p := ctxt.Cursym.Text; p != nil; p = p.Link { + if p.To.Type == obj.TYPE_BRANCH { + if p.Pcond == nil { + p.Pcond = p + } + } + if p.As == AADJSP { + p.To.Type = obj.TYPE_REG + p.To.Reg = REG_SP + v = int32(-p.From.Offset) + p.From.Offset = int64(v) + p.As = int16(spadjop(ctxt, p, AADDL, AADDQ)) + if v < 0 { + p.As = int16(spadjop(ctxt, p, ASUBL, ASUBQ)) + v = -v + p.From.Offset = int64(v) + } + + if v == 0 { + p.As = obj.ANOP + } + } + } + + var q *obj.Prog + for p := s.Text; p != nil; p = p.Link { + p.Back = 2 // use short branches first time through + q = p.Pcond + if q != nil && (q.Back&2 != 0) { + p.Back |= 1 // backward jump + q.Back |= 4 // loop head + } + + if p.As == AADJSP { + p.To.Type = obj.TYPE_REG + p.To.Reg = REG_SP + v = int32(-p.From.Offset) + p.From.Offset = int64(v) + p.As = int16(spadjop(ctxt, p, AADDL, AADDQ)) + if v < 0 { + p.As = int16(spadjop(ctxt, p, ASUBL, ASUBQ)) + v = -v + p.From.Offset = int64(v) + } + + if v == 0 { + p.As = obj.ANOP + } + } + } + + n := 0 + var bp []byte + var c int32 + var i int + var loop int32 + var m int + var p *obj.Prog + for { + loop = 0 + for i = 0; i < len(s.R); i++ { + s.R[i] = obj.Reloc{} + } + s.R = s.R[:0] + s.P = s.P[:0] + c = 0 + for p = s.Text; p != nil; p = p.Link { + if ctxt.Headtype == obj.Hnacl && p.Isize > 0 { + var deferreturn *obj.LSym + + if deferreturn == nil { + deferreturn = obj.Linklookup(ctxt, "runtime.deferreturn", 0) + } + + // pad everything to avoid crossing 32-byte boundary + if c>>5 != (c+int32(p.Isize)-1)>>5 { + c = naclpad(ctxt, s, c, -c&31) + } + + // pad call deferreturn to start at 32-byte boundary + // so that subtracting 5 in jmpdefer will jump back + // to that boundary and rerun the call. + if p.As == obj.ACALL && p.To.Sym == deferreturn { + c = naclpad(ctxt, s, c, -c&31) + } + + // pad call to end at 32-byte boundary + if p.As == obj.ACALL { + c = naclpad(ctxt, s, c, -(c+int32(p.Isize))&31) + } + + // the linker treats REP and STOSQ as different instructions + // but in fact the REP is a prefix on the STOSQ. + // make sure REP has room for 2 more bytes, so that + // padding will not be inserted before the next instruction. + if (p.As == AREP || p.As == AREPN) && c>>5 != (c+3-1)>>5 { + c = naclpad(ctxt, s, c, -c&31) + } + + // same for LOCK. + // various instructions follow; the longest is 4 bytes. + // give ourselves 8 bytes so as to avoid surprises. + if p.As == ALOCK && c>>5 != (c+8-1)>>5 { + c = naclpad(ctxt, s, c, -c&31) + } + } + + if (p.Back&4 != 0) && c&(LoopAlign-1) != 0 { + // pad with NOPs + v = -c & (LoopAlign - 1) + + if v <= MaxLoopPad { + obj.Symgrow(ctxt, s, int64(c)+int64(v)) + fillnop(s.P[c:], int(v)) + c += v + } + } + + p.Pc = int64(c) + + // process forward jumps to p + for q = p.Rel; q != nil; q = q.Forwd { + v = int32(p.Pc - (q.Pc + int64(q.Mark))) + if q.Back&2 != 0 { // short + if v > 127 { + loop++ + q.Back ^= 2 + } + + if q.As == AJCXZL { + s.P[q.Pc+2] = byte(v) + } else { + s.P[q.Pc+1] = byte(v) + } + } else { + bp = s.P[q.Pc+int64(q.Mark)-4:] + bp[0] = byte(v) + bp = bp[1:] + bp[0] = byte(v >> 8) + bp = bp[1:] + bp[0] = byte(v >> 16) + bp = bp[1:] + bp[0] = byte(v >> 24) + } + } + + p.Rel = nil + + p.Pc = int64(c) + asmins(ctxt, p) + m = -cap(ctxt.Andptr) + cap(ctxt.And[:]) + if int(p.Isize) != m { + p.Isize = uint8(m) + loop++ + } + + obj.Symgrow(ctxt, s, p.Pc+int64(m)) + copy(s.P[p.Pc:][:m], ctxt.And[:m]) + p.Mark = uint16(m) + c += int32(m) + } + + n++ + if n > 20 { + ctxt.Diag("span must be looping") + log.Fatalf("loop") + } + if loop == 0 { + break + } + } + + if ctxt.Headtype == obj.Hnacl { + c = naclpad(ctxt, s, c, -c&31) + } + + c += -c & (FuncAlign - 1) + s.Size = int64(c) + + if false { /* debug['a'] > 1 */ + fmt.Printf("span1 %s %d (%d tries)\n %.6x", s.Name, s.Size, n, 0) + var i int + for i = 0; i < len(s.P); i++ { + fmt.Printf(" %.2x", s.P[i]) + if i%16 == 15 { + fmt.Printf("\n %.6x", uint(i+1)) + } + } + + if i%16 != 0 { + fmt.Printf("\n") + } + + for i := 0; i < len(s.R); i++ { + r := &s.R[i] + fmt.Printf(" rel %#.4x/%d %s%+d\n", uint32(r.Off), r.Siz, r.Sym.Name, r.Add) + } + } +} + +func instinit() { + var c int + + for i := 1; optab[i].as != 0; i++ { + c = int(optab[i].as) + if opindex[c&obj.AMask] != nil { + log.Fatalf("phase error in optab: %d (%v)", i, obj.Aconv(c)) + } + opindex[c&obj.AMask] = &optab[i] + } + + for i := 0; i < Ymax; i++ { + ycover[i*Ymax+i] = 1 + } + + ycover[Yi0*Ymax+Yi8] = 1 + ycover[Yi1*Ymax+Yi8] = 1 + ycover[Yu7*Ymax+Yi8] = 1 + + ycover[Yi0*Ymax+Yu7] = 1 + ycover[Yi1*Ymax+Yu7] = 1 + + ycover[Yi0*Ymax+Yu8] = 1 + ycover[Yi1*Ymax+Yu8] = 1 + ycover[Yu7*Ymax+Yu8] = 1 + + ycover[Yi0*Ymax+Ys32] = 1 + ycover[Yi1*Ymax+Ys32] = 1 + ycover[Yu7*Ymax+Ys32] = 1 + ycover[Yu8*Ymax+Ys32] = 1 + ycover[Yi8*Ymax+Ys32] = 1 + + ycover[Yi0*Ymax+Yi32] = 1 + ycover[Yi1*Ymax+Yi32] = 1 + ycover[Yu7*Ymax+Yi32] = 1 + ycover[Yu8*Ymax+Yi32] = 1 + ycover[Yi8*Ymax+Yi32] = 1 + ycover[Ys32*Ymax+Yi32] = 1 + + ycover[Yi0*Ymax+Yi64] = 1 + ycover[Yi1*Ymax+Yi64] = 1 + ycover[Yu7*Ymax+Yi64] = 1 + ycover[Yu8*Ymax+Yi64] = 1 + ycover[Yi8*Ymax+Yi64] = 1 + ycover[Ys32*Ymax+Yi64] = 1 + ycover[Yi32*Ymax+Yi64] = 1 + + ycover[Yal*Ymax+Yrb] = 1 + ycover[Ycl*Ymax+Yrb] = 1 + ycover[Yax*Ymax+Yrb] = 1 + ycover[Ycx*Ymax+Yrb] = 1 + ycover[Yrx*Ymax+Yrb] = 1 + ycover[Yrl*Ymax+Yrb] = 1 // but not Yrl32 + + ycover[Ycl*Ymax+Ycx] = 1 + + ycover[Yax*Ymax+Yrx] = 1 + ycover[Ycx*Ymax+Yrx] = 1 + + ycover[Yax*Ymax+Yrl] = 1 + ycover[Ycx*Ymax+Yrl] = 1 + ycover[Yrx*Ymax+Yrl] = 1 + ycover[Yrl32*Ymax+Yrl] = 1 + + ycover[Yf0*Ymax+Yrf] = 1 + + ycover[Yal*Ymax+Ymb] = 1 + ycover[Ycl*Ymax+Ymb] = 1 + ycover[Yax*Ymax+Ymb] = 1 + ycover[Ycx*Ymax+Ymb] = 1 + ycover[Yrx*Ymax+Ymb] = 1 + ycover[Yrb*Ymax+Ymb] = 1 + ycover[Yrl*Ymax+Ymb] = 1 // but not Yrl32 + ycover[Ym*Ymax+Ymb] = 1 + + ycover[Yax*Ymax+Yml] = 1 + ycover[Ycx*Ymax+Yml] = 1 + ycover[Yrx*Ymax+Yml] = 1 + ycover[Yrl*Ymax+Yml] = 1 + ycover[Yrl32*Ymax+Yml] = 1 + ycover[Ym*Ymax+Yml] = 1 + + ycover[Yax*Ymax+Ymm] = 1 + ycover[Ycx*Ymax+Ymm] = 1 + ycover[Yrx*Ymax+Ymm] = 1 + ycover[Yrl*Ymax+Ymm] = 1 + ycover[Yrl32*Ymax+Ymm] = 1 + ycover[Ym*Ymax+Ymm] = 1 + ycover[Ymr*Ymax+Ymm] = 1 + + ycover[Ym*Ymax+Yxm] = 1 + ycover[Yxr*Ymax+Yxm] = 1 + + for i := 0; i < MAXREG; i++ { + reg[i] = -1 + if i >= REG_AL && i <= REG_R15B { + reg[i] = (i - REG_AL) & 7 + if i >= REG_SPB && i <= REG_DIB { + regrex[i] = 0x40 + } + if i >= REG_R8B && i <= REG_R15B { + regrex[i] = Rxr | Rxx | Rxb + } + } + + if i >= REG_AH && i <= REG_BH { + reg[i] = 4 + ((i - REG_AH) & 7) + } + if i >= REG_AX && i <= REG_R15 { + reg[i] = (i - REG_AX) & 7 + if i >= REG_R8 { + regrex[i] = Rxr | Rxx | Rxb + } + } + + if i >= REG_F0 && i <= REG_F0+7 { + reg[i] = (i - REG_F0) & 7 + } + if i >= REG_M0 && i <= REG_M0+7 { + reg[i] = (i - REG_M0) & 7 + } + if i >= REG_X0 && i <= REG_X0+15 { + reg[i] = (i - REG_X0) & 7 + if i >= REG_X0+8 { + regrex[i] = Rxr | Rxx | Rxb + } + } + + if i >= REG_CR+8 && i <= REG_CR+15 { + regrex[i] = Rxr + } + } +} + +func prefixof(ctxt *obj.Link, p *obj.Prog, a *obj.Addr) int { + if a.Reg < REG_CS && a.Index < REG_CS { // fast path + return 0 + } + if a.Type == obj.TYPE_MEM && a.Name == obj.NAME_NONE { + switch a.Reg { + case REG_CS: + return 0x2e + + case REG_DS: + return 0x3e + + case REG_ES: + return 0x26 + + case REG_FS: + return 0x64 + + case REG_GS: + return 0x65 + + case REG_TLS: + // NOTE: Systems listed here should be only systems that + // support direct TLS references like 8(TLS) implemented as + // direct references from FS or GS. Systems that require + // the initial-exec model, where you load the TLS base into + // a register and then index from that register, do not reach + // this code and should not be listed. + if p.Mode == 32 { + switch ctxt.Headtype { + default: + log.Fatalf("unknown TLS base register for %s", obj.Headstr(ctxt.Headtype)) + + case obj.Hdarwin, + obj.Hdragonfly, + obj.Hfreebsd, + obj.Hnetbsd, + obj.Hopenbsd: + return 0x65 // GS + } + } + + switch ctxt.Headtype { + default: + log.Fatalf("unknown TLS base register for %s", obj.Headstr(ctxt.Headtype)) + + case obj.Hlinux: + if ctxt.Flag_shared != 0 { + log.Fatalf("unknown TLS base register for linux with -shared") + } else { + return 0x64 // FS + } + + case obj.Hdragonfly, + obj.Hfreebsd, + obj.Hnetbsd, + obj.Hopenbsd, + obj.Hsolaris: + return 0x64 // FS + + case obj.Hdarwin: + return 0x65 // GS + } + } + } + + if p.Mode == 32 { + return 0 + } + + switch a.Index { + case REG_CS: + return 0x2e + + case REG_DS: + return 0x3e + + case REG_ES: + return 0x26 + + case REG_TLS: + if ctxt.Flag_shared != 0 { + // When building for inclusion into a shared library, an instruction of the form + // MOV 0(CX)(TLS*1), AX + // becomes + // mov %fs:(%rcx), %rax + // which assumes that the correct TLS offset has been loaded into %rcx (today + // there is only one TLS variable -- g -- so this is OK). When not building for + // a shared library the instruction does not require a prefix. + if a.Offset != 0 { + log.Fatalf("cannot handle non-0 offsets to TLS") + } + return 0x64 + } + + case REG_FS: + return 0x64 + + case REG_GS: + return 0x65 + } + + return 0 +} + +func oclass(ctxt *obj.Link, p *obj.Prog, a *obj.Addr) int { + switch a.Type { + case obj.TYPE_NONE: + return Ynone + + case obj.TYPE_BRANCH: + return Ybr + + case obj.TYPE_INDIR: + if a.Name != obj.NAME_NONE && a.Reg == REG_NONE && a.Index == REG_NONE && a.Scale == 0 { + return Yindir + } + return Yxxx + + case obj.TYPE_MEM: + return Ym + + case obj.TYPE_ADDR: + switch a.Name { + case obj.NAME_EXTERN, + obj.NAME_GOTREF, + obj.NAME_STATIC: + if a.Sym != nil && isextern(a.Sym) || p.Mode == 32 { + return Yi32 + } + return Yiauto // use pc-relative addressing + + case obj.NAME_AUTO, + obj.NAME_PARAM: + return Yiauto + } + + // TODO(rsc): DUFFZERO/DUFFCOPY encoding forgot to set a->index + // and got Yi32 in an earlier version of this code. + // Keep doing that until we fix yduff etc. + if a.Sym != nil && strings.HasPrefix(a.Sym.Name, "runtime.duff") { + return Yi32 + } + + if a.Sym != nil || a.Name != obj.NAME_NONE { + ctxt.Diag("unexpected addr: %v", obj.Dconv(p, a)) + } + fallthrough + + // fall through + + case obj.TYPE_CONST: + if a.Sym != nil { + ctxt.Diag("TYPE_CONST with symbol: %v", obj.Dconv(p, a)) + } + + v := a.Offset + if p.Mode == 32 { + v = int64(int32(v)) + } + if v == 0 { + return Yi0 + } + if v == 1 { + return Yi1 + } + if v >= 0 && v <= 127 { + return Yu7 + } + if v >= 0 && v <= 255 { + return Yu8 + } + if v >= -128 && v <= 127 { + return Yi8 + } + if p.Mode == 32 { + return Yi32 + } + l := int32(v) + if int64(l) == v { + return Ys32 /* can sign extend */ + } + if v>>32 == 0 { + return Yi32 /* unsigned */ + } + return Yi64 + + case obj.TYPE_TEXTSIZE: + return Ytextsize + } + + if a.Type != obj.TYPE_REG { + ctxt.Diag("unexpected addr1: type=%d %v", a.Type, obj.Dconv(p, a)) + return Yxxx + } + + switch a.Reg { + case REG_AL: + return Yal + + case REG_AX: + return Yax + + /* + case REG_SPB: + */ + case REG_BPB, + REG_SIB, + REG_DIB, + REG_R8B, + REG_R9B, + REG_R10B, + REG_R11B, + REG_R12B, + REG_R13B, + REG_R14B, + REG_R15B: + if ctxt.Asmode != 64 { + return Yxxx + } + fallthrough + + case REG_DL, + REG_BL, + REG_AH, + REG_CH, + REG_DH, + REG_BH: + return Yrb + + case REG_CL: + return Ycl + + case REG_CX: + return Ycx + + case REG_DX, REG_BX: + return Yrx + + case REG_R8, /* not really Yrl */ + REG_R9, + REG_R10, + REG_R11, + REG_R12, + REG_R13, + REG_R14, + REG_R15: + if ctxt.Asmode != 64 { + return Yxxx + } + fallthrough + + case REG_SP, REG_BP, REG_SI, REG_DI: + if p.Mode == 32 { + return Yrl32 + } + return Yrl + + case REG_F0 + 0: + return Yf0 + + case REG_F0 + 1, + REG_F0 + 2, + REG_F0 + 3, + REG_F0 + 4, + REG_F0 + 5, + REG_F0 + 6, + REG_F0 + 7: + return Yrf + + case REG_M0 + 0, + REG_M0 + 1, + REG_M0 + 2, + REG_M0 + 3, + REG_M0 + 4, + REG_M0 + 5, + REG_M0 + 6, + REG_M0 + 7: + return Ymr + + case REG_X0 + 0, + REG_X0 + 1, + REG_X0 + 2, + REG_X0 + 3, + REG_X0 + 4, + REG_X0 + 5, + REG_X0 + 6, + REG_X0 + 7, + REG_X0 + 8, + REG_X0 + 9, + REG_X0 + 10, + REG_X0 + 11, + REG_X0 + 12, + REG_X0 + 13, + REG_X0 + 14, + REG_X0 + 15: + return Yxr + + case REG_CS: + return Ycs + case REG_SS: + return Yss + case REG_DS: + return Yds + case REG_ES: + return Yes + case REG_FS: + return Yfs + case REG_GS: + return Ygs + case REG_TLS: + return Ytls + + case REG_GDTR: + return Ygdtr + case REG_IDTR: + return Yidtr + case REG_LDTR: + return Yldtr + case REG_MSW: + return Ymsw + case REG_TASK: + return Ytask + + case REG_CR + 0: + return Ycr0 + case REG_CR + 1: + return Ycr1 + case REG_CR + 2: + return Ycr2 + case REG_CR + 3: + return Ycr3 + case REG_CR + 4: + return Ycr4 + case REG_CR + 5: + return Ycr5 + case REG_CR + 6: + return Ycr6 + case REG_CR + 7: + return Ycr7 + case REG_CR + 8: + return Ycr8 + + case REG_DR + 0: + return Ydr0 + case REG_DR + 1: + return Ydr1 + case REG_DR + 2: + return Ydr2 + case REG_DR + 3: + return Ydr3 + case REG_DR + 4: + return Ydr4 + case REG_DR + 5: + return Ydr5 + case REG_DR + 6: + return Ydr6 + case REG_DR + 7: + return Ydr7 + + case REG_TR + 0: + return Ytr0 + case REG_TR + 1: + return Ytr1 + case REG_TR + 2: + return Ytr2 + case REG_TR + 3: + return Ytr3 + case REG_TR + 4: + return Ytr4 + case REG_TR + 5: + return Ytr5 + case REG_TR + 6: + return Ytr6 + case REG_TR + 7: + return Ytr7 + } + + return Yxxx +} + +func asmidx(ctxt *obj.Link, scale int, index int, base int) { + var i int + + switch index { + default: + goto bad + + case REG_NONE: + i = 4 << 3 + goto bas + + case REG_R8, + REG_R9, + REG_R10, + REG_R11, + REG_R12, + REG_R13, + REG_R14, + REG_R15: + if ctxt.Asmode != 64 { + goto bad + } + fallthrough + + case REG_AX, + REG_CX, + REG_DX, + REG_BX, + REG_BP, + REG_SI, + REG_DI: + i = reg[index] << 3 + } + + switch scale { + default: + goto bad + + case 1: + break + + case 2: + i |= 1 << 6 + + case 4: + i |= 2 << 6 + + case 8: + i |= 3 << 6 + } + +bas: + switch base { + default: + goto bad + + case REG_NONE: /* must be mod=00 */ + i |= 5 + + case REG_R8, + REG_R9, + REG_R10, + REG_R11, + REG_R12, + REG_R13, + REG_R14, + REG_R15: + if ctxt.Asmode != 64 { + goto bad + } + fallthrough + + case REG_AX, + REG_CX, + REG_DX, + REG_BX, + REG_SP, + REG_BP, + REG_SI, + REG_DI: + i |= reg[base] + } + + ctxt.Andptr[0] = byte(i) + ctxt.Andptr = ctxt.Andptr[1:] + return + +bad: + ctxt.Diag("asmidx: bad address %d/%d/%d", scale, index, base) + ctxt.Andptr[0] = 0 + ctxt.Andptr = ctxt.Andptr[1:] + return +} + +func put4(ctxt *obj.Link, v int32) { + ctxt.Andptr[0] = byte(v) + ctxt.Andptr[1] = byte(v >> 8) + ctxt.Andptr[2] = byte(v >> 16) + ctxt.Andptr[3] = byte(v >> 24) + ctxt.Andptr = ctxt.Andptr[4:] +} + +func relput4(ctxt *obj.Link, p *obj.Prog, a *obj.Addr) { + var rel obj.Reloc + + v := vaddr(ctxt, p, a, &rel) + if rel.Siz != 0 { + if rel.Siz != 4 { + ctxt.Diag("bad reloc") + } + r := obj.Addrel(ctxt.Cursym) + *r = rel + r.Off = int32(p.Pc + int64(-cap(ctxt.Andptr)+cap(ctxt.And[:]))) + } + + put4(ctxt, int32(v)) +} + +func put8(ctxt *obj.Link, v int64) { + ctxt.Andptr[0] = byte(v) + ctxt.Andptr[1] = byte(v >> 8) + ctxt.Andptr[2] = byte(v >> 16) + ctxt.Andptr[3] = byte(v >> 24) + ctxt.Andptr[4] = byte(v >> 32) + ctxt.Andptr[5] = byte(v >> 40) + ctxt.Andptr[6] = byte(v >> 48) + ctxt.Andptr[7] = byte(v >> 56) + ctxt.Andptr = ctxt.Andptr[8:] +} + +/* +static void +relput8(Prog *p, Addr *a) +{ + vlong v; + Reloc rel, *r; + + v = vaddr(ctxt, p, a, &rel); + if(rel.siz != 0) { + r = addrel(ctxt->cursym); + *r = rel; + r->siz = 8; + r->off = p->pc + ctxt->andptr - ctxt->and; + } + put8(ctxt, v); +} +*/ +func vaddr(ctxt *obj.Link, p *obj.Prog, a *obj.Addr, r *obj.Reloc) int64 { + if r != nil { + *r = obj.Reloc{} + } + + switch a.Name { + case obj.NAME_STATIC, + obj.NAME_GOTREF, + obj.NAME_EXTERN: + s := a.Sym + if r == nil { + ctxt.Diag("need reloc for %v", obj.Dconv(p, a)) + log.Fatalf("reloc") + } + + if a.Name == obj.NAME_GOTREF { + r.Siz = 4 + r.Type = obj.R_GOTPCREL + } else if isextern(s) || p.Mode != 64 { + r.Siz = 4 + r.Type = obj.R_ADDR + } else { + r.Siz = 4 + r.Type = obj.R_PCREL + } + + r.Off = -1 // caller must fill in + r.Sym = s + r.Add = a.Offset + + return 0 + } + + if (a.Type == obj.TYPE_MEM || a.Type == obj.TYPE_ADDR) && a.Reg == REG_TLS { + if r == nil { + ctxt.Diag("need reloc for %v", obj.Dconv(p, a)) + log.Fatalf("reloc") + } + + r.Type = obj.R_TLS_LE + r.Siz = 4 + r.Off = -1 // caller must fill in + r.Add = a.Offset + return 0 + } + + return a.Offset +} + +func asmandsz(ctxt *obj.Link, p *obj.Prog, a *obj.Addr, r int, rex int, m64 int) { + var base int + var rel obj.Reloc + + rex &= 0x40 | Rxr + v := int32(a.Offset) + rel.Siz = 0 + + switch a.Type { + case obj.TYPE_ADDR: + if a.Name == obj.NAME_NONE { + ctxt.Diag("unexpected TYPE_ADDR with NAME_NONE") + } + if a.Index == REG_TLS { + ctxt.Diag("unexpected TYPE_ADDR with index==REG_TLS") + } + goto bad + + case obj.TYPE_REG: + if a.Reg < REG_AL || REG_X0+15 < a.Reg { + goto bad + } + if v != 0 { + goto bad + } + ctxt.Andptr[0] = byte(3<<6 | reg[a.Reg]<<0 | r<<3) + ctxt.Andptr = ctxt.Andptr[1:] + ctxt.Rexflag |= regrex[a.Reg]&(0x40|Rxb) | rex + return + } + + if a.Type != obj.TYPE_MEM { + goto bad + } + + if a.Index != REG_NONE && a.Index != REG_TLS { + base := int(a.Reg) + switch a.Name { + case obj.NAME_EXTERN, + obj.NAME_GOTREF, + obj.NAME_STATIC: + if !isextern(a.Sym) && p.Mode == 64 { + goto bad + } + base = REG_NONE + v = int32(vaddr(ctxt, p, a, &rel)) + + case obj.NAME_AUTO, + obj.NAME_PARAM: + base = REG_SP + } + + ctxt.Rexflag |= regrex[int(a.Index)]&Rxx | regrex[base]&Rxb | rex + if base == REG_NONE { + ctxt.Andptr[0] = byte(0<<6 | 4<<0 | r<<3) + ctxt.Andptr = ctxt.Andptr[1:] + asmidx(ctxt, int(a.Scale), int(a.Index), base) + goto putrelv + } + + if v == 0 && rel.Siz == 0 && base != REG_BP && base != REG_R13 { + ctxt.Andptr[0] = byte(0<<6 | 4<<0 | r<<3) + ctxt.Andptr = ctxt.Andptr[1:] + asmidx(ctxt, int(a.Scale), int(a.Index), base) + return + } + + if v >= -128 && v < 128 && rel.Siz == 0 { + ctxt.Andptr[0] = byte(1<<6 | 4<<0 | r<<3) + ctxt.Andptr = ctxt.Andptr[1:] + asmidx(ctxt, int(a.Scale), int(a.Index), base) + ctxt.Andptr[0] = byte(v) + ctxt.Andptr = ctxt.Andptr[1:] + return + } + + ctxt.Andptr[0] = byte(2<<6 | 4<<0 | r<<3) + ctxt.Andptr = ctxt.Andptr[1:] + asmidx(ctxt, int(a.Scale), int(a.Index), base) + goto putrelv + } + + base = int(a.Reg) + switch a.Name { + case obj.NAME_STATIC, + obj.NAME_GOTREF, + obj.NAME_EXTERN: + if a.Sym == nil { + ctxt.Diag("bad addr: %v", p) + } + base = REG_NONE + v = int32(vaddr(ctxt, p, a, &rel)) + + case obj.NAME_AUTO, + obj.NAME_PARAM: + base = REG_SP + } + + if base == REG_TLS { + v = int32(vaddr(ctxt, p, a, &rel)) + } + + ctxt.Rexflag |= regrex[base]&Rxb | rex + if base == REG_NONE || (REG_CS <= base && base <= REG_GS) || base == REG_TLS { + if (a.Sym == nil || !isextern(a.Sym)) && base == REG_NONE && (a.Name == obj.NAME_STATIC || a.Name == obj.NAME_EXTERN || a.Name == obj.NAME_GOTREF) || p.Mode != 64 { + if a.Name == obj.NAME_GOTREF && (a.Offset != 0 || a.Index != 0 || a.Scale != 0) { + ctxt.Diag("%v has offset against gotref", p) + } + ctxt.Andptr[0] = byte(0<<6 | 5<<0 | r<<3) + ctxt.Andptr = ctxt.Andptr[1:] + goto putrelv + } + + /* temporary */ + ctxt.Andptr[0] = byte(0<<6 | 4<<0 | r<<3) + ctxt.Andptr = ctxt.Andptr[1:] /* sib present */ + ctxt.Andptr[0] = 0<<6 | 4<<3 | 5<<0 + ctxt.Andptr = ctxt.Andptr[1:] /* DS:d32 */ + goto putrelv + } + + if base == REG_SP || base == REG_R12 { + if v == 0 { + ctxt.Andptr[0] = byte(0<<6 | reg[base]<<0 | r<<3) + ctxt.Andptr = ctxt.Andptr[1:] + asmidx(ctxt, int(a.Scale), REG_NONE, base) + return + } + + if v >= -128 && v < 128 { + ctxt.Andptr[0] = byte(1<<6 | reg[base]<<0 | r<<3) + ctxt.Andptr = ctxt.Andptr[1:] + asmidx(ctxt, int(a.Scale), REG_NONE, base) + ctxt.Andptr[0] = byte(v) + ctxt.Andptr = ctxt.Andptr[1:] + return + } + + ctxt.Andptr[0] = byte(2<<6 | reg[base]<<0 | r<<3) + ctxt.Andptr = ctxt.Andptr[1:] + asmidx(ctxt, int(a.Scale), REG_NONE, base) + goto putrelv + } + + if REG_AX <= base && base <= REG_R15 { + if a.Index == REG_TLS && ctxt.Flag_shared == 0 { + rel = obj.Reloc{} + rel.Type = obj.R_TLS_LE + rel.Siz = 4 + rel.Sym = nil + rel.Add = int64(v) + v = 0 + } + + if v == 0 && rel.Siz == 0 && base != REG_BP && base != REG_R13 { + ctxt.Andptr[0] = byte(0<<6 | reg[base]<<0 | r<<3) + ctxt.Andptr = ctxt.Andptr[1:] + return + } + + if v >= -128 && v < 128 && rel.Siz == 0 { + ctxt.Andptr[0] = byte(1<<6 | reg[base]<<0 | r<<3) + ctxt.Andptr[1] = byte(v) + ctxt.Andptr = ctxt.Andptr[2:] + return + } + + ctxt.Andptr[0] = byte(2<<6 | reg[base]<<0 | r<<3) + ctxt.Andptr = ctxt.Andptr[1:] + goto putrelv + } + + goto bad + +putrelv: + if rel.Siz != 0 { + if rel.Siz != 4 { + ctxt.Diag("bad rel") + goto bad + } + + r := obj.Addrel(ctxt.Cursym) + *r = rel + r.Off = int32(ctxt.Curp.Pc + int64(-cap(ctxt.Andptr)+cap(ctxt.And[:]))) + } + + put4(ctxt, v) + return + +bad: + ctxt.Diag("asmand: bad address %v", obj.Dconv(p, a)) + return +} + +func asmand(ctxt *obj.Link, p *obj.Prog, a *obj.Addr, ra *obj.Addr) { + asmandsz(ctxt, p, a, reg[ra.Reg], regrex[ra.Reg], 0) +} + +func asmando(ctxt *obj.Link, p *obj.Prog, a *obj.Addr, o int) { + asmandsz(ctxt, p, a, o, 0, 0) +} + +func bytereg(a *obj.Addr, t *uint8) { + if a.Type == obj.TYPE_REG && a.Index == REG_NONE && (REG_AX <= a.Reg && a.Reg <= REG_R15) { + a.Reg += REG_AL - REG_AX + *t = 0 + } +} + +func unbytereg(a *obj.Addr, t *uint8) { + if a.Type == obj.TYPE_REG && a.Index == REG_NONE && (REG_AL <= a.Reg && a.Reg <= REG_R15B) { + a.Reg += REG_AX - REG_AL + *t = 0 + } +} + +const ( + E = 0xff +) + +var ymovtab = []Movtab{ + /* push */ + Movtab{APUSHL, Ycs, Ynone, Ynone, 0, [4]uint8{0x0e, E, 0, 0}}, + Movtab{APUSHL, Yss, Ynone, Ynone, 0, [4]uint8{0x16, E, 0, 0}}, + Movtab{APUSHL, Yds, Ynone, Ynone, 0, [4]uint8{0x1e, E, 0, 0}}, + Movtab{APUSHL, Yes, Ynone, Ynone, 0, [4]uint8{0x06, E, 0, 0}}, + Movtab{APUSHL, Yfs, Ynone, Ynone, 0, [4]uint8{0x0f, 0xa0, E, 0}}, + Movtab{APUSHL, Ygs, Ynone, Ynone, 0, [4]uint8{0x0f, 0xa8, E, 0}}, + Movtab{APUSHQ, Yfs, Ynone, Ynone, 0, [4]uint8{0x0f, 0xa0, E, 0}}, + Movtab{APUSHQ, Ygs, Ynone, Ynone, 0, [4]uint8{0x0f, 0xa8, E, 0}}, + Movtab{APUSHW, Ycs, Ynone, Ynone, 0, [4]uint8{Pe, 0x0e, E, 0}}, + Movtab{APUSHW, Yss, Ynone, Ynone, 0, [4]uint8{Pe, 0x16, E, 0}}, + Movtab{APUSHW, Yds, Ynone, Ynone, 0, [4]uint8{Pe, 0x1e, E, 0}}, + Movtab{APUSHW, Yes, Ynone, Ynone, 0, [4]uint8{Pe, 0x06, E, 0}}, + Movtab{APUSHW, Yfs, Ynone, Ynone, 0, [4]uint8{Pe, 0x0f, 0xa0, E}}, + Movtab{APUSHW, Ygs, Ynone, Ynone, 0, [4]uint8{Pe, 0x0f, 0xa8, E}}, + + /* pop */ + Movtab{APOPL, Ynone, Ynone, Yds, 0, [4]uint8{0x1f, E, 0, 0}}, + Movtab{APOPL, Ynone, Ynone, Yes, 0, [4]uint8{0x07, E, 0, 0}}, + Movtab{APOPL, Ynone, Ynone, Yss, 0, [4]uint8{0x17, E, 0, 0}}, + Movtab{APOPL, Ynone, Ynone, Yfs, 0, [4]uint8{0x0f, 0xa1, E, 0}}, + Movtab{APOPL, Ynone, Ynone, Ygs, 0, [4]uint8{0x0f, 0xa9, E, 0}}, + Movtab{APOPQ, Ynone, Ynone, Yfs, 0, [4]uint8{0x0f, 0xa1, E, 0}}, + Movtab{APOPQ, Ynone, Ynone, Ygs, 0, [4]uint8{0x0f, 0xa9, E, 0}}, + Movtab{APOPW, Ynone, Ynone, Yds, 0, [4]uint8{Pe, 0x1f, E, 0}}, + Movtab{APOPW, Ynone, Ynone, Yes, 0, [4]uint8{Pe, 0x07, E, 0}}, + Movtab{APOPW, Ynone, Ynone, Yss, 0, [4]uint8{Pe, 0x17, E, 0}}, + Movtab{APOPW, Ynone, Ynone, Yfs, 0, [4]uint8{Pe, 0x0f, 0xa1, E}}, + Movtab{APOPW, Ynone, Ynone, Ygs, 0, [4]uint8{Pe, 0x0f, 0xa9, E}}, + + /* mov seg */ + Movtab{AMOVW, Yes, Ynone, Yml, 1, [4]uint8{0x8c, 0, 0, 0}}, + Movtab{AMOVW, Ycs, Ynone, Yml, 1, [4]uint8{0x8c, 1, 0, 0}}, + Movtab{AMOVW, Yss, Ynone, Yml, 1, [4]uint8{0x8c, 2, 0, 0}}, + Movtab{AMOVW, Yds, Ynone, Yml, 1, [4]uint8{0x8c, 3, 0, 0}}, + Movtab{AMOVW, Yfs, Ynone, Yml, 1, [4]uint8{0x8c, 4, 0, 0}}, + Movtab{AMOVW, Ygs, Ynone, Yml, 1, [4]uint8{0x8c, 5, 0, 0}}, + Movtab{AMOVW, Yml, Ynone, Yes, 2, [4]uint8{0x8e, 0, 0, 0}}, + Movtab{AMOVW, Yml, Ynone, Ycs, 2, [4]uint8{0x8e, 1, 0, 0}}, + Movtab{AMOVW, Yml, Ynone, Yss, 2, [4]uint8{0x8e, 2, 0, 0}}, + Movtab{AMOVW, Yml, Ynone, Yds, 2, [4]uint8{0x8e, 3, 0, 0}}, + Movtab{AMOVW, Yml, Ynone, Yfs, 2, [4]uint8{0x8e, 4, 0, 0}}, + Movtab{AMOVW, Yml, Ynone, Ygs, 2, [4]uint8{0x8e, 5, 0, 0}}, + + /* mov cr */ + Movtab{AMOVL, Ycr0, Ynone, Yml, 3, [4]uint8{0x0f, 0x20, 0, 0}}, + Movtab{AMOVL, Ycr2, Ynone, Yml, 3, [4]uint8{0x0f, 0x20, 2, 0}}, + Movtab{AMOVL, Ycr3, Ynone, Yml, 3, [4]uint8{0x0f, 0x20, 3, 0}}, + Movtab{AMOVL, Ycr4, Ynone, Yml, 3, [4]uint8{0x0f, 0x20, 4, 0}}, + Movtab{AMOVL, Ycr8, Ynone, Yml, 3, [4]uint8{0x0f, 0x20, 8, 0}}, + Movtab{AMOVQ, Ycr0, Ynone, Yml, 3, [4]uint8{0x0f, 0x20, 0, 0}}, + Movtab{AMOVQ, Ycr2, Ynone, Yml, 3, [4]uint8{0x0f, 0x20, 2, 0}}, + Movtab{AMOVQ, Ycr3, Ynone, Yml, 3, [4]uint8{0x0f, 0x20, 3, 0}}, + Movtab{AMOVQ, Ycr4, Ynone, Yml, 3, [4]uint8{0x0f, 0x20, 4, 0}}, + Movtab{AMOVQ, Ycr8, Ynone, Yml, 3, [4]uint8{0x0f, 0x20, 8, 0}}, + Movtab{AMOVL, Yml, Ynone, Ycr0, 4, [4]uint8{0x0f, 0x22, 0, 0}}, + Movtab{AMOVL, Yml, Ynone, Ycr2, 4, [4]uint8{0x0f, 0x22, 2, 0}}, + Movtab{AMOVL, Yml, Ynone, Ycr3, 4, [4]uint8{0x0f, 0x22, 3, 0}}, + Movtab{AMOVL, Yml, Ynone, Ycr4, 4, [4]uint8{0x0f, 0x22, 4, 0}}, + Movtab{AMOVL, Yml, Ynone, Ycr8, 4, [4]uint8{0x0f, 0x22, 8, 0}}, + Movtab{AMOVQ, Yml, Ynone, Ycr0, 4, [4]uint8{0x0f, 0x22, 0, 0}}, + Movtab{AMOVQ, Yml, Ynone, Ycr2, 4, [4]uint8{0x0f, 0x22, 2, 0}}, + Movtab{AMOVQ, Yml, Ynone, Ycr3, 4, [4]uint8{0x0f, 0x22, 3, 0}}, + Movtab{AMOVQ, Yml, Ynone, Ycr4, 4, [4]uint8{0x0f, 0x22, 4, 0}}, + Movtab{AMOVQ, Yml, Ynone, Ycr8, 4, [4]uint8{0x0f, 0x22, 8, 0}}, + + /* mov dr */ + Movtab{AMOVL, Ydr0, Ynone, Yml, 3, [4]uint8{0x0f, 0x21, 0, 0}}, + Movtab{AMOVL, Ydr6, Ynone, Yml, 3, [4]uint8{0x0f, 0x21, 6, 0}}, + Movtab{AMOVL, Ydr7, Ynone, Yml, 3, [4]uint8{0x0f, 0x21, 7, 0}}, + Movtab{AMOVQ, Ydr0, Ynone, Yml, 3, [4]uint8{0x0f, 0x21, 0, 0}}, + Movtab{AMOVQ, Ydr6, Ynone, Yml, 3, [4]uint8{0x0f, 0x21, 6, 0}}, + Movtab{AMOVQ, Ydr7, Ynone, Yml, 3, [4]uint8{0x0f, 0x21, 7, 0}}, + Movtab{AMOVL, Yml, Ynone, Ydr0, 4, [4]uint8{0x0f, 0x23, 0, 0}}, + Movtab{AMOVL, Yml, Ynone, Ydr6, 4, [4]uint8{0x0f, 0x23, 6, 0}}, + Movtab{AMOVL, Yml, Ynone, Ydr7, 4, [4]uint8{0x0f, 0x23, 7, 0}}, + Movtab{AMOVQ, Yml, Ynone, Ydr0, 4, [4]uint8{0x0f, 0x23, 0, 0}}, + Movtab{AMOVQ, Yml, Ynone, Ydr6, 4, [4]uint8{0x0f, 0x23, 6, 0}}, + Movtab{AMOVQ, Yml, Ynone, Ydr7, 4, [4]uint8{0x0f, 0x23, 7, 0}}, + + /* mov tr */ + Movtab{AMOVL, Ytr6, Ynone, Yml, 3, [4]uint8{0x0f, 0x24, 6, 0}}, + Movtab{AMOVL, Ytr7, Ynone, Yml, 3, [4]uint8{0x0f, 0x24, 7, 0}}, + Movtab{AMOVL, Yml, Ynone, Ytr6, 4, [4]uint8{0x0f, 0x26, 6, E}}, + Movtab{AMOVL, Yml, Ynone, Ytr7, 4, [4]uint8{0x0f, 0x26, 7, E}}, + + /* lgdt, sgdt, lidt, sidt */ + Movtab{AMOVL, Ym, Ynone, Ygdtr, 4, [4]uint8{0x0f, 0x01, 2, 0}}, + Movtab{AMOVL, Ygdtr, Ynone, Ym, 3, [4]uint8{0x0f, 0x01, 0, 0}}, + Movtab{AMOVL, Ym, Ynone, Yidtr, 4, [4]uint8{0x0f, 0x01, 3, 0}}, + Movtab{AMOVL, Yidtr, Ynone, Ym, 3, [4]uint8{0x0f, 0x01, 1, 0}}, + Movtab{AMOVQ, Ym, Ynone, Ygdtr, 4, [4]uint8{0x0f, 0x01, 2, 0}}, + Movtab{AMOVQ, Ygdtr, Ynone, Ym, 3, [4]uint8{0x0f, 0x01, 0, 0}}, + Movtab{AMOVQ, Ym, Ynone, Yidtr, 4, [4]uint8{0x0f, 0x01, 3, 0}}, + Movtab{AMOVQ, Yidtr, Ynone, Ym, 3, [4]uint8{0x0f, 0x01, 1, 0}}, + + /* lldt, sldt */ + Movtab{AMOVW, Yml, Ynone, Yldtr, 4, [4]uint8{0x0f, 0x00, 2, 0}}, + Movtab{AMOVW, Yldtr, Ynone, Yml, 3, [4]uint8{0x0f, 0x00, 0, 0}}, + + /* lmsw, smsw */ + Movtab{AMOVW, Yml, Ynone, Ymsw, 4, [4]uint8{0x0f, 0x01, 6, 0}}, + Movtab{AMOVW, Ymsw, Ynone, Yml, 3, [4]uint8{0x0f, 0x01, 4, 0}}, + + /* ltr, str */ + Movtab{AMOVW, Yml, Ynone, Ytask, 4, [4]uint8{0x0f, 0x00, 3, 0}}, + Movtab{AMOVW, Ytask, Ynone, Yml, 3, [4]uint8{0x0f, 0x00, 1, 0}}, + + /* load full pointer - unsupported + Movtab{AMOVL, Yml, Ycol, 5, [4]uint8{0, 0, 0, 0}}, + Movtab{AMOVW, Yml, Ycol, 5, [4]uint8{Pe, 0, 0, 0}}, + */ + + /* double shift */ + Movtab{ASHLL, Yi8, Yrl, Yml, 6, [4]uint8{0xa4, 0xa5, 0, 0}}, + Movtab{ASHLL, Ycl, Yrl, Yml, 6, [4]uint8{0xa4, 0xa5, 0, 0}}, + Movtab{ASHLL, Ycx, Yrl, Yml, 6, [4]uint8{0xa4, 0xa5, 0, 0}}, + Movtab{ASHRL, Yi8, Yrl, Yml, 6, [4]uint8{0xac, 0xad, 0, 0}}, + Movtab{ASHRL, Ycl, Yrl, Yml, 6, [4]uint8{0xac, 0xad, 0, 0}}, + Movtab{ASHRL, Ycx, Yrl, Yml, 6, [4]uint8{0xac, 0xad, 0, 0}}, + Movtab{ASHLQ, Yi8, Yrl, Yml, 6, [4]uint8{Pw, 0xa4, 0xa5, 0}}, + Movtab{ASHLQ, Ycl, Yrl, Yml, 6, [4]uint8{Pw, 0xa4, 0xa5, 0}}, + Movtab{ASHLQ, Ycx, Yrl, Yml, 6, [4]uint8{Pw, 0xa4, 0xa5, 0}}, + Movtab{ASHRQ, Yi8, Yrl, Yml, 6, [4]uint8{Pw, 0xac, 0xad, 0}}, + Movtab{ASHRQ, Ycl, Yrl, Yml, 6, [4]uint8{Pw, 0xac, 0xad, 0}}, + Movtab{ASHRQ, Ycx, Yrl, Yml, 6, [4]uint8{Pw, 0xac, 0xad, 0}}, + Movtab{ASHLW, Yi8, Yrl, Yml, 6, [4]uint8{Pe, 0xa4, 0xa5, 0}}, + Movtab{ASHLW, Ycl, Yrl, Yml, 6, [4]uint8{Pe, 0xa4, 0xa5, 0}}, + Movtab{ASHLW, Ycx, Yrl, Yml, 6, [4]uint8{Pe, 0xa4, 0xa5, 0}}, + Movtab{ASHRW, Yi8, Yrl, Yml, 6, [4]uint8{Pe, 0xac, 0xad, 0}}, + Movtab{ASHRW, Ycl, Yrl, Yml, 6, [4]uint8{Pe, 0xac, 0xad, 0}}, + Movtab{ASHRW, Ycx, Yrl, Yml, 6, [4]uint8{Pe, 0xac, 0xad, 0}}, + + /* load TLS base */ + Movtab{AMOVL, Ytls, Ynone, Yrl, 7, [4]uint8{0, 0, 0, 0}}, + Movtab{AMOVQ, Ytls, Ynone, Yrl, 7, [4]uint8{0, 0, 0, 0}}, + Movtab{0, 0, 0, 0, 0, [4]uint8{}}, +} + +func isax(a *obj.Addr) bool { + switch a.Reg { + case REG_AX, REG_AL, REG_AH: + return true + } + + if a.Index == REG_AX { + return true + } + return false +} + +func subreg(p *obj.Prog, from int, to int) { + if false { /* debug['Q'] */ + fmt.Printf("\n%v\ts/%v/%v/\n", p, Rconv(from), Rconv(to)) + } + + if int(p.From.Reg) == from { + p.From.Reg = int16(to) + p.Ft = 0 + } + + if int(p.To.Reg) == from { + p.To.Reg = int16(to) + p.Tt = 0 + } + + if int(p.From.Index) == from { + p.From.Index = int16(to) + p.Ft = 0 + } + + if int(p.To.Index) == from { + p.To.Index = int16(to) + p.Tt = 0 + } + + if false { /* debug['Q'] */ + fmt.Printf("%v\n", p) + } +} + +func mediaop(ctxt *obj.Link, o *Optab, op int, osize int, z int) int { + switch op { + case Pm, Pe, Pf2, Pf3: + if osize != 1 { + if op != Pm { + ctxt.Andptr[0] = byte(op) + ctxt.Andptr = ctxt.Andptr[1:] + } + ctxt.Andptr[0] = Pm + ctxt.Andptr = ctxt.Andptr[1:] + z++ + op = int(o.op[z]) + break + } + fallthrough + + default: + if -cap(ctxt.Andptr) == -cap(ctxt.And) || ctxt.And[-cap(ctxt.Andptr)+cap(ctxt.And[:])-1] != Pm { + ctxt.Andptr[0] = Pm + ctxt.Andptr = ctxt.Andptr[1:] + } + } + + ctxt.Andptr[0] = byte(op) + ctxt.Andptr = ctxt.Andptr[1:] + return z +} + +var bpduff1 = []byte{ + 0x48, 0x89, 0x6c, 0x24, 0xf0, // MOVQ BP, -16(SP) + 0x48, 0x8d, 0x6c, 0x24, 0xf0, // LEAQ -16(SP), BP +} + +var bpduff2 = []byte{ + 0x48, 0x8b, 0x6d, 0x00, // MOVQ 0(BP), BP +} + +func doasm(ctxt *obj.Link, p *obj.Prog) { + ctxt.Curp = p // TODO + + o := opindex[p.As&obj.AMask] + + if o == nil { + ctxt.Diag("asmins: missing op %v", p) + return + } + + pre := prefixof(ctxt, p, &p.From) + if pre != 0 { + ctxt.Andptr[0] = byte(pre) + ctxt.Andptr = ctxt.Andptr[1:] + } + pre = prefixof(ctxt, p, &p.To) + if pre != 0 { + ctxt.Andptr[0] = byte(pre) + ctxt.Andptr = ctxt.Andptr[1:] + } + + // TODO(rsc): This special case is for SHRQ $3, AX:DX, + // which encodes as SHRQ $32(DX*0), AX. + // Similarly SHRQ CX, AX:DX is really SHRQ CX(DX*0), AX. + // Change encoding generated by assemblers and compilers and remove. + if (p.From.Type == obj.TYPE_CONST || p.From.Type == obj.TYPE_REG) && p.From.Index != REG_NONE && p.From.Scale == 0 { + p.From3 = new(obj.Addr) + p.From3.Type = obj.TYPE_REG + p.From3.Reg = p.From.Index + p.From.Index = 0 + } + + // TODO(rsc): This special case is for PINSRQ etc, CMPSD etc. + // Change encoding generated by assemblers and compilers (if any) and remove. + switch p.As { + case AIMUL3Q, APEXTRW, APINSRW, APINSRD, APINSRQ, APSHUFHW, APSHUFL, APSHUFW, ASHUFPD, ASHUFPS, AAESKEYGENASSIST, APSHUFD, APCLMULQDQ: + if p.From3Type() == obj.TYPE_NONE { + p.From3 = new(obj.Addr) + *p.From3 = p.From + p.From = obj.Addr{} + p.From.Type = obj.TYPE_CONST + p.From.Offset = p.To.Offset + p.To.Offset = 0 + } + case ACMPSD, ACMPSS, ACMPPS, ACMPPD: + if p.From3Type() == obj.TYPE_NONE { + p.From3 = new(obj.Addr) + *p.From3 = p.To + p.To = obj.Addr{} + p.To.Type = obj.TYPE_CONST + p.To.Offset = p.From3.Offset + p.From3.Offset = 0 + } + } + + if p.Ft == 0 { + p.Ft = uint8(oclass(ctxt, p, &p.From)) + } + if p.Tt == 0 { + p.Tt = uint8(oclass(ctxt, p, &p.To)) + } + + ft := int(p.Ft) * Ymax + f3t := Ynone * Ymax + if p.From3 != nil { + f3t = oclass(ctxt, p, p.From3) * Ymax + } + tt := int(p.Tt) * Ymax + + xo := obj.Bool2int(o.op[0] == 0x0f) + z := 0 + var a *obj.Addr + var l int + var op int + var q *obj.Prog + var r *obj.Reloc + var rel obj.Reloc + var v int64 + for i := range o.ytab { + yt := &o.ytab[i] + if ycover[ft+int(yt.from)] != 0 && ycover[f3t+int(yt.from3)] != 0 && ycover[tt+int(yt.to)] != 0 { + switch o.prefix { + case Px1: /* first option valid only in 32-bit mode */ + if ctxt.Mode == 64 && z == 0 { + z += int(yt.zoffset) + xo + continue + } + case Pq: /* 16 bit escape and opcode escape */ + ctxt.Andptr[0] = Pe + ctxt.Andptr = ctxt.Andptr[1:] + + ctxt.Andptr[0] = Pm + ctxt.Andptr = ctxt.Andptr[1:] + + case Pq3: /* 16 bit escape, Rex.w, and opcode escape */ + ctxt.Andptr[0] = Pe + ctxt.Andptr = ctxt.Andptr[1:] + + ctxt.Andptr[0] = Pw + ctxt.Andptr = ctxt.Andptr[1:] + ctxt.Andptr[0] = Pm + ctxt.Andptr = ctxt.Andptr[1:] + + case Pf2, /* xmm opcode escape */ + Pf3: + ctxt.Andptr[0] = byte(o.prefix) + ctxt.Andptr = ctxt.Andptr[1:] + + ctxt.Andptr[0] = Pm + ctxt.Andptr = ctxt.Andptr[1:] + + case Pm: /* opcode escape */ + ctxt.Andptr[0] = Pm + ctxt.Andptr = ctxt.Andptr[1:] + + case Pe: /* 16 bit escape */ + ctxt.Andptr[0] = Pe + ctxt.Andptr = ctxt.Andptr[1:] + + case Pw: /* 64-bit escape */ + if p.Mode != 64 { + ctxt.Diag("asmins: illegal 64: %v", p) + } + ctxt.Rexflag |= Pw + + case Pw8: /* 64-bit escape if z >= 8 */ + if z >= 8 { + if p.Mode != 64 { + ctxt.Diag("asmins: illegal 64: %v", p) + } + ctxt.Rexflag |= Pw + } + + case Pb: /* botch */ + if p.Mode != 64 && (isbadbyte(&p.From) || isbadbyte(&p.To)) { + goto bad + } + // NOTE(rsc): This is probably safe to do always, + // but when enabled it chooses different encodings + // than the old cmd/internal/obj/i386 code did, + // which breaks our "same bits out" checks. + // In particular, CMPB AX, $0 encodes as 80 f8 00 + // in the original obj/i386, and it would encode + // (using a valid, shorter form) as 3c 00 if we enabled + // the call to bytereg here. + if p.Mode == 64 { + bytereg(&p.From, &p.Ft) + bytereg(&p.To, &p.Tt) + } + + case P32: /* 32 bit but illegal if 64-bit mode */ + if p.Mode == 64 { + ctxt.Diag("asmins: illegal in 64-bit mode: %v", p) + } + + case Py: /* 64-bit only, no prefix */ + if p.Mode != 64 { + ctxt.Diag("asmins: illegal in %d-bit mode: %v", p.Mode, p) + } + + case Py1: /* 64-bit only if z < 1, no prefix */ + if z < 1 && p.Mode != 64 { + ctxt.Diag("asmins: illegal in %d-bit mode: %v", p.Mode, p) + } + + case Py3: /* 64-bit only if z < 3, no prefix */ + if z < 3 && p.Mode != 64 { + ctxt.Diag("asmins: illegal in %d-bit mode: %v", p.Mode, p) + } + } + + if z >= len(o.op) { + log.Fatalf("asmins bad table %v", p) + } + op = int(o.op[z]) + if op == 0x0f { + ctxt.Andptr[0] = byte(op) + ctxt.Andptr = ctxt.Andptr[1:] + z++ + op = int(o.op[z]) + } + + switch yt.zcase { + default: + ctxt.Diag("asmins: unknown z %d %v", yt.zcase, p) + return + + case Zpseudo: + break + + case Zlit: + for ; ; z++ { + op = int(o.op[z]) + if op == 0 { + break + } + ctxt.Andptr[0] = byte(op) + ctxt.Andptr = ctxt.Andptr[1:] + } + + case Zlitm_r: + for ; ; z++ { + op = int(o.op[z]) + if op == 0 { + break + } + ctxt.Andptr[0] = byte(op) + ctxt.Andptr = ctxt.Andptr[1:] + } + asmand(ctxt, p, &p.From, &p.To) + + case Zmb_r: + bytereg(&p.From, &p.Ft) + fallthrough + + /* fall through */ + case Zm_r: + ctxt.Andptr[0] = byte(op) + ctxt.Andptr = ctxt.Andptr[1:] + + asmand(ctxt, p, &p.From, &p.To) + + case Zm2_r: + ctxt.Andptr[0] = byte(op) + ctxt.Andptr = ctxt.Andptr[1:] + ctxt.Andptr[0] = byte(o.op[z+1]) + ctxt.Andptr = ctxt.Andptr[1:] + asmand(ctxt, p, &p.From, &p.To) + + case Zm_r_xm: + mediaop(ctxt, o, op, int(yt.zoffset), z) + asmand(ctxt, p, &p.From, &p.To) + + case Zm_r_xm_nr: + ctxt.Rexflag = 0 + mediaop(ctxt, o, op, int(yt.zoffset), z) + asmand(ctxt, p, &p.From, &p.To) + + case Zm_r_i_xm: + mediaop(ctxt, o, op, int(yt.zoffset), z) + asmand(ctxt, p, &p.From, p.From3) + ctxt.Andptr[0] = byte(p.To.Offset) + ctxt.Andptr = ctxt.Andptr[1:] + + case Zm_r_3d: + ctxt.Andptr[0] = 0x0f + ctxt.Andptr = ctxt.Andptr[1:] + ctxt.Andptr[0] = 0x0f + ctxt.Andptr = ctxt.Andptr[1:] + asmand(ctxt, p, &p.From, &p.To) + ctxt.Andptr[0] = byte(op) + ctxt.Andptr = ctxt.Andptr[1:] + + case Zibm_r: + for { + tmp1 := z + z++ + op = int(o.op[tmp1]) + if op == 0 { + break + } + ctxt.Andptr[0] = byte(op) + ctxt.Andptr = ctxt.Andptr[1:] + } + asmand(ctxt, p, p.From3, &p.To) + ctxt.Andptr[0] = byte(p.From.Offset) + ctxt.Andptr = ctxt.Andptr[1:] + + case Zaut_r: + ctxt.Andptr[0] = 0x8d + ctxt.Andptr = ctxt.Andptr[1:] /* leal */ + if p.From.Type != obj.TYPE_ADDR { + ctxt.Diag("asmins: Zaut sb type ADDR") + } + p.From.Type = obj.TYPE_MEM + asmand(ctxt, p, &p.From, &p.To) + p.From.Type = obj.TYPE_ADDR + + case Zm_o: + ctxt.Andptr[0] = byte(op) + ctxt.Andptr = ctxt.Andptr[1:] + asmando(ctxt, p, &p.From, int(o.op[z+1])) + + case Zr_m: + ctxt.Andptr[0] = byte(op) + ctxt.Andptr = ctxt.Andptr[1:] + asmand(ctxt, p, &p.To, &p.From) + + case Zr_m_xm: + mediaop(ctxt, o, op, int(yt.zoffset), z) + asmand(ctxt, p, &p.To, &p.From) + + case Zr_m_xm_nr: + ctxt.Rexflag = 0 + mediaop(ctxt, o, op, int(yt.zoffset), z) + asmand(ctxt, p, &p.To, &p.From) + + case Zo_m: + ctxt.Andptr[0] = byte(op) + ctxt.Andptr = ctxt.Andptr[1:] + asmando(ctxt, p, &p.To, int(o.op[z+1])) + + case Zcallindreg: + r = obj.Addrel(ctxt.Cursym) + r.Off = int32(p.Pc) + r.Type = obj.R_CALLIND + r.Siz = 0 + fallthrough + + case Zo_m64: + ctxt.Andptr[0] = byte(op) + ctxt.Andptr = ctxt.Andptr[1:] + asmandsz(ctxt, p, &p.To, int(o.op[z+1]), 0, 1) + + case Zm_ibo: + ctxt.Andptr[0] = byte(op) + ctxt.Andptr = ctxt.Andptr[1:] + asmando(ctxt, p, &p.From, int(o.op[z+1])) + ctxt.Andptr[0] = byte(vaddr(ctxt, p, &p.To, nil)) + ctxt.Andptr = ctxt.Andptr[1:] + + case Zibo_m: + ctxt.Andptr[0] = byte(op) + ctxt.Andptr = ctxt.Andptr[1:] + asmando(ctxt, p, &p.To, int(o.op[z+1])) + ctxt.Andptr[0] = byte(vaddr(ctxt, p, &p.From, nil)) + ctxt.Andptr = ctxt.Andptr[1:] + + case Zibo_m_xm: + z = mediaop(ctxt, o, op, int(yt.zoffset), z) + asmando(ctxt, p, &p.To, int(o.op[z+1])) + ctxt.Andptr[0] = byte(vaddr(ctxt, p, &p.From, nil)) + ctxt.Andptr = ctxt.Andptr[1:] + + case Z_ib, Zib_: + if yt.zcase == Zib_ { + a = &p.From + } else { + a = &p.To + } + ctxt.Andptr[0] = byte(op) + ctxt.Andptr = ctxt.Andptr[1:] + ctxt.Andptr[0] = byte(vaddr(ctxt, p, a, nil)) + ctxt.Andptr = ctxt.Andptr[1:] + + case Zib_rp: + ctxt.Rexflag |= regrex[p.To.Reg] & (Rxb | 0x40) + ctxt.Andptr[0] = byte(op + reg[p.To.Reg]) + ctxt.Andptr = ctxt.Andptr[1:] + ctxt.Andptr[0] = byte(vaddr(ctxt, p, &p.From, nil)) + ctxt.Andptr = ctxt.Andptr[1:] + + case Zil_rp: + ctxt.Rexflag |= regrex[p.To.Reg] & Rxb + ctxt.Andptr[0] = byte(op + reg[p.To.Reg]) + ctxt.Andptr = ctxt.Andptr[1:] + if o.prefix == Pe { + v = vaddr(ctxt, p, &p.From, nil) + ctxt.Andptr[0] = byte(v) + ctxt.Andptr = ctxt.Andptr[1:] + ctxt.Andptr[0] = byte(v >> 8) + ctxt.Andptr = ctxt.Andptr[1:] + } else { + relput4(ctxt, p, &p.From) + } + + case Zo_iw: + ctxt.Andptr[0] = byte(op) + ctxt.Andptr = ctxt.Andptr[1:] + if p.From.Type != obj.TYPE_NONE { + v = vaddr(ctxt, p, &p.From, nil) + ctxt.Andptr[0] = byte(v) + ctxt.Andptr = ctxt.Andptr[1:] + ctxt.Andptr[0] = byte(v >> 8) + ctxt.Andptr = ctxt.Andptr[1:] + } + + case Ziq_rp: + v = vaddr(ctxt, p, &p.From, &rel) + l = int(v >> 32) + if l == 0 && rel.Siz != 8 { + //p->mark |= 0100; + //print("zero: %llux %v\n", v, p); + ctxt.Rexflag &^= (0x40 | Rxw) + + ctxt.Rexflag |= regrex[p.To.Reg] & Rxb + ctxt.Andptr[0] = byte(0xb8 + reg[p.To.Reg]) + ctxt.Andptr = ctxt.Andptr[1:] + if rel.Type != 0 { + r = obj.Addrel(ctxt.Cursym) + *r = rel + r.Off = int32(p.Pc + int64(-cap(ctxt.Andptr)+cap(ctxt.And[:]))) + } + + put4(ctxt, int32(v)) + } else if l == -1 && uint64(v)&(uint64(1)<<31) != 0 { /* sign extend */ + + //p->mark |= 0100; + //print("sign: %llux %v\n", v, p); + ctxt.Andptr[0] = 0xc7 + ctxt.Andptr = ctxt.Andptr[1:] + + asmando(ctxt, p, &p.To, 0) + put4(ctxt, int32(v)) /* need all 8 */ + } else { + //print("all: %llux %v\n", v, p); + ctxt.Rexflag |= regrex[p.To.Reg] & Rxb + + ctxt.Andptr[0] = byte(op + reg[p.To.Reg]) + ctxt.Andptr = ctxt.Andptr[1:] + if rel.Type != 0 { + r = obj.Addrel(ctxt.Cursym) + *r = rel + r.Off = int32(p.Pc + int64(-cap(ctxt.Andptr)+cap(ctxt.And[:]))) + } + + put8(ctxt, v) + } + + case Zib_rr: + ctxt.Andptr[0] = byte(op) + ctxt.Andptr = ctxt.Andptr[1:] + asmand(ctxt, p, &p.To, &p.To) + ctxt.Andptr[0] = byte(vaddr(ctxt, p, &p.From, nil)) + ctxt.Andptr = ctxt.Andptr[1:] + + case Z_il, Zil_: + if yt.zcase == Zil_ { + a = &p.From + } else { + a = &p.To + } + ctxt.Andptr[0] = byte(op) + ctxt.Andptr = ctxt.Andptr[1:] + if o.prefix == Pe { + v = vaddr(ctxt, p, a, nil) + ctxt.Andptr[0] = byte(v) + ctxt.Andptr = ctxt.Andptr[1:] + ctxt.Andptr[0] = byte(v >> 8) + ctxt.Andptr = ctxt.Andptr[1:] + } else { + relput4(ctxt, p, a) + } + + case Zm_ilo, Zilo_m: + ctxt.Andptr[0] = byte(op) + ctxt.Andptr = ctxt.Andptr[1:] + if yt.zcase == Zilo_m { + a = &p.From + asmando(ctxt, p, &p.To, int(o.op[z+1])) + } else { + a = &p.To + asmando(ctxt, p, &p.From, int(o.op[z+1])) + } + + if o.prefix == Pe { + v = vaddr(ctxt, p, a, nil) + ctxt.Andptr[0] = byte(v) + ctxt.Andptr = ctxt.Andptr[1:] + ctxt.Andptr[0] = byte(v >> 8) + ctxt.Andptr = ctxt.Andptr[1:] + } else { + relput4(ctxt, p, a) + } + + case Zil_rr: + ctxt.Andptr[0] = byte(op) + ctxt.Andptr = ctxt.Andptr[1:] + asmand(ctxt, p, &p.To, &p.To) + if o.prefix == Pe { + v = vaddr(ctxt, p, &p.From, nil) + ctxt.Andptr[0] = byte(v) + ctxt.Andptr = ctxt.Andptr[1:] + ctxt.Andptr[0] = byte(v >> 8) + ctxt.Andptr = ctxt.Andptr[1:] + } else { + relput4(ctxt, p, &p.From) + } + + case Z_rp: + ctxt.Rexflag |= regrex[p.To.Reg] & (Rxb | 0x40) + ctxt.Andptr[0] = byte(op + reg[p.To.Reg]) + ctxt.Andptr = ctxt.Andptr[1:] + + case Zrp_: + ctxt.Rexflag |= regrex[p.From.Reg] & (Rxb | 0x40) + ctxt.Andptr[0] = byte(op + reg[p.From.Reg]) + ctxt.Andptr = ctxt.Andptr[1:] + + case Zclr: + ctxt.Rexflag &^= Pw + ctxt.Andptr[0] = byte(op) + ctxt.Andptr = ctxt.Andptr[1:] + asmand(ctxt, p, &p.To, &p.To) + + case Zcallcon, Zjmpcon: + if yt.zcase == Zcallcon { + ctxt.Andptr[0] = byte(op) + ctxt.Andptr = ctxt.Andptr[1:] + } else { + ctxt.Andptr[0] = byte(o.op[z+1]) + ctxt.Andptr = ctxt.Andptr[1:] + } + r = obj.Addrel(ctxt.Cursym) + r.Off = int32(p.Pc + int64(-cap(ctxt.Andptr)+cap(ctxt.And[:]))) + r.Type = obj.R_PCREL + r.Siz = 4 + r.Add = p.To.Offset + put4(ctxt, 0) + + case Zcallind: + ctxt.Andptr[0] = byte(op) + ctxt.Andptr = ctxt.Andptr[1:] + ctxt.Andptr[0] = byte(o.op[z+1]) + ctxt.Andptr = ctxt.Andptr[1:] + r = obj.Addrel(ctxt.Cursym) + r.Off = int32(p.Pc + int64(-cap(ctxt.Andptr)+cap(ctxt.And[:]))) + r.Type = obj.R_ADDR + r.Siz = 4 + r.Add = p.To.Offset + r.Sym = p.To.Sym + put4(ctxt, 0) + + case Zcall, Zcallduff: + if p.To.Sym == nil { + ctxt.Diag("call without target") + log.Fatalf("bad code") + } + + if yt.zcase == Zcallduff && ctxt.Flag_dynlink { + ctxt.Diag("directly calling duff when dynamically linking Go") + } + + if obj.Framepointer_enabled != 0 && yt.zcase == Zcallduff && p.Mode == 64 { + // Maintain BP around call, since duffcopy/duffzero can't do it + // (the call jumps into the middle of the function). + // This makes it possible to see call sites for duffcopy/duffzero in + // BP-based profiling tools like Linux perf (which is the + // whole point of obj.Framepointer_enabled). + // MOVQ BP, -16(SP) + // LEAQ -16(SP), BP + copy(ctxt.Andptr, bpduff1) + ctxt.Andptr = ctxt.Andptr[len(bpduff1):] + } + ctxt.Andptr[0] = byte(op) + ctxt.Andptr = ctxt.Andptr[1:] + r = obj.Addrel(ctxt.Cursym) + r.Off = int32(p.Pc + int64(-cap(ctxt.Andptr)+cap(ctxt.And[:]))) + r.Sym = p.To.Sym + r.Add = p.To.Offset + r.Type = obj.R_CALL + r.Siz = 4 + put4(ctxt, 0) + + if obj.Framepointer_enabled != 0 && yt.zcase == Zcallduff && p.Mode == 64 { + // Pop BP pushed above. + // MOVQ 0(BP), BP + copy(ctxt.Andptr, bpduff2) + ctxt.Andptr = ctxt.Andptr[len(bpduff2):] + } + + // TODO: jump across functions needs reloc + case Zbr, Zjmp, Zloop: + if p.To.Sym != nil { + if yt.zcase != Zjmp { + ctxt.Diag("branch to ATEXT") + log.Fatalf("bad code") + } + + ctxt.Andptr[0] = byte(o.op[z+1]) + ctxt.Andptr = ctxt.Andptr[1:] + r = obj.Addrel(ctxt.Cursym) + r.Off = int32(p.Pc + int64(-cap(ctxt.Andptr)+cap(ctxt.And[:]))) + r.Sym = p.To.Sym + r.Type = obj.R_PCREL + r.Siz = 4 + put4(ctxt, 0) + break + } + + // Assumes q is in this function. + // TODO: Check in input, preserve in brchain. + + // Fill in backward jump now. + q = p.Pcond + + if q == nil { + ctxt.Diag("jmp/branch/loop without target") + log.Fatalf("bad code") + } + + if p.Back&1 != 0 { + v = q.Pc - (p.Pc + 2) + if v >= -128 { + if p.As == AJCXZL { + ctxt.Andptr[0] = 0x67 + ctxt.Andptr = ctxt.Andptr[1:] + } + ctxt.Andptr[0] = byte(op) + ctxt.Andptr = ctxt.Andptr[1:] + ctxt.Andptr[0] = byte(v) + ctxt.Andptr = ctxt.Andptr[1:] + } else if yt.zcase == Zloop { + ctxt.Diag("loop too far: %v", p) + } else { + v -= 5 - 2 + if yt.zcase == Zbr { + ctxt.Andptr[0] = 0x0f + ctxt.Andptr = ctxt.Andptr[1:] + v-- + } + + ctxt.Andptr[0] = byte(o.op[z+1]) + ctxt.Andptr = ctxt.Andptr[1:] + ctxt.Andptr[0] = byte(v) + ctxt.Andptr = ctxt.Andptr[1:] + ctxt.Andptr[0] = byte(v >> 8) + ctxt.Andptr = ctxt.Andptr[1:] + ctxt.Andptr[0] = byte(v >> 16) + ctxt.Andptr = ctxt.Andptr[1:] + ctxt.Andptr[0] = byte(v >> 24) + ctxt.Andptr = ctxt.Andptr[1:] + } + + break + } + + // Annotate target; will fill in later. + p.Forwd = q.Rel + + q.Rel = p + if p.Back&2 != 0 { // short + if p.As == AJCXZL { + ctxt.Andptr[0] = 0x67 + ctxt.Andptr = ctxt.Andptr[1:] + } + ctxt.Andptr[0] = byte(op) + ctxt.Andptr = ctxt.Andptr[1:] + ctxt.Andptr[0] = 0 + ctxt.Andptr = ctxt.Andptr[1:] + } else if yt.zcase == Zloop { + ctxt.Diag("loop too far: %v", p) + } else { + if yt.zcase == Zbr { + ctxt.Andptr[0] = 0x0f + ctxt.Andptr = ctxt.Andptr[1:] + } + ctxt.Andptr[0] = byte(o.op[z+1]) + ctxt.Andptr = ctxt.Andptr[1:] + ctxt.Andptr[0] = 0 + ctxt.Andptr = ctxt.Andptr[1:] + ctxt.Andptr[0] = 0 + ctxt.Andptr = ctxt.Andptr[1:] + ctxt.Andptr[0] = 0 + ctxt.Andptr = ctxt.Andptr[1:] + ctxt.Andptr[0] = 0 + ctxt.Andptr = ctxt.Andptr[1:] + } + + break + + /* + v = q->pc - p->pc - 2; + if((v >= -128 && v <= 127) || p->pc == -1 || q->pc == -1) { + *ctxt->andptr++ = op; + *ctxt->andptr++ = v; + } else { + v -= 5-2; + if(yt.zcase == Zbr) { + *ctxt->andptr++ = 0x0f; + v--; + } + *ctxt->andptr++ = o->op[z+1]; + *ctxt->andptr++ = v; + *ctxt->andptr++ = v>>8; + *ctxt->andptr++ = v>>16; + *ctxt->andptr++ = v>>24; + } + */ + + case Zbyte: + v = vaddr(ctxt, p, &p.From, &rel) + if rel.Siz != 0 { + rel.Siz = uint8(op) + r = obj.Addrel(ctxt.Cursym) + *r = rel + r.Off = int32(p.Pc + int64(-cap(ctxt.Andptr)+cap(ctxt.And[:]))) + } + + ctxt.Andptr[0] = byte(v) + ctxt.Andptr = ctxt.Andptr[1:] + if op > 1 { + ctxt.Andptr[0] = byte(v >> 8) + ctxt.Andptr = ctxt.Andptr[1:] + if op > 2 { + ctxt.Andptr[0] = byte(v >> 16) + ctxt.Andptr = ctxt.Andptr[1:] + ctxt.Andptr[0] = byte(v >> 24) + ctxt.Andptr = ctxt.Andptr[1:] + if op > 4 { + ctxt.Andptr[0] = byte(v >> 32) + ctxt.Andptr = ctxt.Andptr[1:] + ctxt.Andptr[0] = byte(v >> 40) + ctxt.Andptr = ctxt.Andptr[1:] + ctxt.Andptr[0] = byte(v >> 48) + ctxt.Andptr = ctxt.Andptr[1:] + ctxt.Andptr[0] = byte(v >> 56) + ctxt.Andptr = ctxt.Andptr[1:] + } + } + } + } + + return + } + z += int(yt.zoffset) + xo + } + for mo := ymovtab; mo[0].as != 0; mo = mo[1:] { + var pp obj.Prog + var t []byte + if p.As == mo[0].as { + if ycover[ft+int(mo[0].ft)] != 0 && ycover[f3t+int(mo[0].f3t)] != 0 && ycover[tt+int(mo[0].tt)] != 0 { + t = mo[0].op[:] + switch mo[0].code { + default: + ctxt.Diag("asmins: unknown mov %d %v", mo[0].code, p) + + case 0: /* lit */ + for z = 0; t[z] != E; z++ { + ctxt.Andptr[0] = t[z] + ctxt.Andptr = ctxt.Andptr[1:] + } + + case 1: /* r,m */ + ctxt.Andptr[0] = t[0] + ctxt.Andptr = ctxt.Andptr[1:] + + asmando(ctxt, p, &p.To, int(t[1])) + + case 2: /* m,r */ + ctxt.Andptr[0] = t[0] + ctxt.Andptr = ctxt.Andptr[1:] + + asmando(ctxt, p, &p.From, int(t[1])) + + case 3: /* r,m - 2op */ + ctxt.Andptr[0] = t[0] + ctxt.Andptr = ctxt.Andptr[1:] + + ctxt.Andptr[0] = t[1] + ctxt.Andptr = ctxt.Andptr[1:] + asmando(ctxt, p, &p.To, int(t[2])) + ctxt.Rexflag |= regrex[p.From.Reg] & (Rxr | 0x40) + + case 4: /* m,r - 2op */ + ctxt.Andptr[0] = t[0] + ctxt.Andptr = ctxt.Andptr[1:] + + ctxt.Andptr[0] = t[1] + ctxt.Andptr = ctxt.Andptr[1:] + asmando(ctxt, p, &p.From, int(t[2])) + ctxt.Rexflag |= regrex[p.To.Reg] & (Rxr | 0x40) + + case 5: /* load full pointer, trash heap */ + if t[0] != 0 { + ctxt.Andptr[0] = t[0] + ctxt.Andptr = ctxt.Andptr[1:] + } + switch p.To.Index { + default: + goto bad + + case REG_DS: + ctxt.Andptr[0] = 0xc5 + ctxt.Andptr = ctxt.Andptr[1:] + + case REG_SS: + ctxt.Andptr[0] = 0x0f + ctxt.Andptr = ctxt.Andptr[1:] + ctxt.Andptr[0] = 0xb2 + ctxt.Andptr = ctxt.Andptr[1:] + + case REG_ES: + ctxt.Andptr[0] = 0xc4 + ctxt.Andptr = ctxt.Andptr[1:] + + case REG_FS: + ctxt.Andptr[0] = 0x0f + ctxt.Andptr = ctxt.Andptr[1:] + ctxt.Andptr[0] = 0xb4 + ctxt.Andptr = ctxt.Andptr[1:] + + case REG_GS: + ctxt.Andptr[0] = 0x0f + ctxt.Andptr = ctxt.Andptr[1:] + ctxt.Andptr[0] = 0xb5 + ctxt.Andptr = ctxt.Andptr[1:] + } + + asmand(ctxt, p, &p.From, &p.To) + + case 6: /* double shift */ + if t[0] == Pw { + if p.Mode != 64 { + ctxt.Diag("asmins: illegal 64: %v", p) + } + ctxt.Rexflag |= Pw + t = t[1:] + } else if t[0] == Pe { + ctxt.Andptr[0] = Pe + ctxt.Andptr = ctxt.Andptr[1:] + t = t[1:] + } + + switch p.From.Type { + default: + goto bad + + case obj.TYPE_CONST: + ctxt.Andptr[0] = 0x0f + ctxt.Andptr = ctxt.Andptr[1:] + ctxt.Andptr[0] = t[0] + ctxt.Andptr = ctxt.Andptr[1:] + asmandsz(ctxt, p, &p.To, reg[p.From3.Reg], regrex[p.From3.Reg], 0) + ctxt.Andptr[0] = byte(p.From.Offset) + ctxt.Andptr = ctxt.Andptr[1:] + + case obj.TYPE_REG: + switch p.From.Reg { + default: + goto bad + + case REG_CL, REG_CX: + ctxt.Andptr[0] = 0x0f + ctxt.Andptr = ctxt.Andptr[1:] + ctxt.Andptr[0] = t[1] + ctxt.Andptr = ctxt.Andptr[1:] + asmandsz(ctxt, p, &p.To, reg[p.From3.Reg], regrex[p.From3.Reg], 0) + } + } + + // NOTE: The systems listed here are the ones that use the "TLS initial exec" model, + // where you load the TLS base register into a register and then index off that + // register to access the actual TLS variables. Systems that allow direct TLS access + // are handled in prefixof above and should not be listed here. + case 7: /* mov tls, r */ + if p.Mode == 64 && p.As != AMOVQ || p.Mode == 32 && p.As != AMOVL { + ctxt.Diag("invalid load of TLS: %v", p) + } + + if p.Mode == 32 { + // NOTE: The systems listed here are the ones that use the "TLS initial exec" model, + // where you load the TLS base register into a register and then index off that + // register to access the actual TLS variables. Systems that allow direct TLS access + // are handled in prefixof above and should not be listed here. + switch ctxt.Headtype { + default: + log.Fatalf("unknown TLS base location for %s", obj.Headstr(ctxt.Headtype)) + + case obj.Hlinux, + obj.Hnacl: + // ELF TLS base is 0(GS). + pp.From = p.From + + pp.From.Type = obj.TYPE_MEM + pp.From.Reg = REG_GS + pp.From.Offset = 0 + pp.From.Index = REG_NONE + pp.From.Scale = 0 + ctxt.Andptr[0] = 0x65 + ctxt.Andptr = ctxt.Andptr[1:] // GS + ctxt.Andptr[0] = 0x8B + ctxt.Andptr = ctxt.Andptr[1:] + asmand(ctxt, p, &pp.From, &p.To) + + case obj.Hplan9: + if ctxt.Plan9privates == nil { + ctxt.Plan9privates = obj.Linklookup(ctxt, "_privates", 0) + } + pp.From = obj.Addr{} + pp.From.Type = obj.TYPE_MEM + pp.From.Name = obj.NAME_EXTERN + pp.From.Sym = ctxt.Plan9privates + pp.From.Offset = 0 + pp.From.Index = REG_NONE + ctxt.Andptr[0] = 0x8B + ctxt.Andptr = ctxt.Andptr[1:] + asmand(ctxt, p, &pp.From, &p.To) + + case obj.Hwindows: + // Windows TLS base is always 0x14(FS). + pp.From = p.From + + pp.From.Type = obj.TYPE_MEM + pp.From.Reg = REG_FS + pp.From.Offset = 0x14 + pp.From.Index = REG_NONE + pp.From.Scale = 0 + ctxt.Andptr[0] = 0x64 + ctxt.Andptr = ctxt.Andptr[1:] // FS + ctxt.Andptr[0] = 0x8B + ctxt.Andptr = ctxt.Andptr[1:] + asmand(ctxt, p, &pp.From, &p.To) + } + break + } + + switch ctxt.Headtype { + default: + log.Fatalf("unknown TLS base location for %s", obj.Headstr(ctxt.Headtype)) + + case obj.Hlinux: + if ctxt.Flag_shared == 0 { + log.Fatalf("unknown TLS base location for linux without -shared") + } + // Note that this is not generating the same insn as the other cases. + // MOV TLS, R_to + // becomes + // movq g@gottpoff(%rip), R_to + // which is encoded as + // movq 0(%rip), R_to + // and a R_TLS_IE reloc. This all assumes the only tls variable we access + // is g, which we can't check here, but will when we assemble the second + // instruction. + ctxt.Rexflag = Pw | (regrex[p.To.Reg] & Rxr) + + ctxt.Andptr[0] = 0x8B + ctxt.Andptr = ctxt.Andptr[1:] + ctxt.Andptr[0] = byte(0x05 | (reg[p.To.Reg] << 3)) + ctxt.Andptr = ctxt.Andptr[1:] + r = obj.Addrel(ctxt.Cursym) + r.Off = int32(p.Pc + int64(-cap(ctxt.Andptr)+cap(ctxt.And[:]))) + r.Type = obj.R_TLS_IE + r.Siz = 4 + r.Add = -4 + put4(ctxt, 0) + + case obj.Hplan9: + if ctxt.Plan9privates == nil { + ctxt.Plan9privates = obj.Linklookup(ctxt, "_privates", 0) + } + pp.From = obj.Addr{} + pp.From.Type = obj.TYPE_MEM + pp.From.Name = obj.NAME_EXTERN + pp.From.Sym = ctxt.Plan9privates + pp.From.Offset = 0 + pp.From.Index = REG_NONE + ctxt.Rexflag |= Pw + ctxt.Andptr[0] = 0x8B + ctxt.Andptr = ctxt.Andptr[1:] + asmand(ctxt, p, &pp.From, &p.To) + + case obj.Hsolaris: // TODO(rsc): Delete Hsolaris from list. Should not use this code. See progedit in obj6.c. + // TLS base is 0(FS). + pp.From = p.From + + pp.From.Type = obj.TYPE_MEM + pp.From.Name = obj.NAME_NONE + pp.From.Reg = REG_NONE + pp.From.Offset = 0 + pp.From.Index = REG_NONE + pp.From.Scale = 0 + ctxt.Rexflag |= Pw + ctxt.Andptr[0] = 0x64 + ctxt.Andptr = ctxt.Andptr[1:] // FS + ctxt.Andptr[0] = 0x8B + ctxt.Andptr = ctxt.Andptr[1:] + asmand(ctxt, p, &pp.From, &p.To) + + case obj.Hwindows: + // Windows TLS base is always 0x28(GS). + pp.From = p.From + + pp.From.Type = obj.TYPE_MEM + pp.From.Name = obj.NAME_NONE + pp.From.Reg = REG_GS + pp.From.Offset = 0x28 + pp.From.Index = REG_NONE + pp.From.Scale = 0 + ctxt.Rexflag |= Pw + ctxt.Andptr[0] = 0x65 + ctxt.Andptr = ctxt.Andptr[1:] // GS + ctxt.Andptr[0] = 0x8B + ctxt.Andptr = ctxt.Andptr[1:] + asmand(ctxt, p, &pp.From, &p.To) + } + } + return + } + } + } + goto bad + +bad: + if p.Mode != 64 { + /* + * here, the assembly has failed. + * if its a byte instruction that has + * unaddressable registers, try to + * exchange registers and reissue the + * instruction with the operands renamed. + */ + pp := *p + + unbytereg(&pp.From, &pp.Ft) + unbytereg(&pp.To, &pp.Tt) + + z := int(p.From.Reg) + if p.From.Type == obj.TYPE_REG && z >= REG_BP && z <= REG_DI { + // TODO(rsc): Use this code for x86-64 too. It has bug fixes not present in the amd64 code base. + // For now, different to keep bit-for-bit compatibility. + if p.Mode == 32 { + breg := byteswapreg(ctxt, &p.To) + if breg != REG_AX { + ctxt.Andptr[0] = 0x87 + ctxt.Andptr = ctxt.Andptr[1:] /* xchg lhs,bx */ + asmando(ctxt, p, &p.From, reg[breg]) + subreg(&pp, z, breg) + doasm(ctxt, &pp) + ctxt.Andptr[0] = 0x87 + ctxt.Andptr = ctxt.Andptr[1:] /* xchg lhs,bx */ + asmando(ctxt, p, &p.From, reg[breg]) + } else { + ctxt.Andptr[0] = byte(0x90 + reg[z]) + ctxt.Andptr = ctxt.Andptr[1:] /* xchg lsh,ax */ + subreg(&pp, z, REG_AX) + doasm(ctxt, &pp) + ctxt.Andptr[0] = byte(0x90 + reg[z]) + ctxt.Andptr = ctxt.Andptr[1:] /* xchg lsh,ax */ + } + return + } + + if isax(&p.To) || p.To.Type == obj.TYPE_NONE { + // We certainly don't want to exchange + // with AX if the op is MUL or DIV. + ctxt.Andptr[0] = 0x87 + ctxt.Andptr = ctxt.Andptr[1:] /* xchg lhs,bx */ + asmando(ctxt, p, &p.From, reg[REG_BX]) + subreg(&pp, z, REG_BX) + doasm(ctxt, &pp) + ctxt.Andptr[0] = 0x87 + ctxt.Andptr = ctxt.Andptr[1:] /* xchg lhs,bx */ + asmando(ctxt, p, &p.From, reg[REG_BX]) + } else { + ctxt.Andptr[0] = byte(0x90 + reg[z]) + ctxt.Andptr = ctxt.Andptr[1:] /* xchg lsh,ax */ + subreg(&pp, z, REG_AX) + doasm(ctxt, &pp) + ctxt.Andptr[0] = byte(0x90 + reg[z]) + ctxt.Andptr = ctxt.Andptr[1:] /* xchg lsh,ax */ + } + return + } + + z = int(p.To.Reg) + if p.To.Type == obj.TYPE_REG && z >= REG_BP && z <= REG_DI { + // TODO(rsc): Use this code for x86-64 too. It has bug fixes not present in the amd64 code base. + // For now, different to keep bit-for-bit compatibility. + if p.Mode == 32 { + breg := byteswapreg(ctxt, &p.From) + if breg != REG_AX { + ctxt.Andptr[0] = 0x87 + ctxt.Andptr = ctxt.Andptr[1:] /* xchg rhs,bx */ + asmando(ctxt, p, &p.To, reg[breg]) + subreg(&pp, z, breg) + doasm(ctxt, &pp) + ctxt.Andptr[0] = 0x87 + ctxt.Andptr = ctxt.Andptr[1:] /* xchg rhs,bx */ + asmando(ctxt, p, &p.To, reg[breg]) + } else { + ctxt.Andptr[0] = byte(0x90 + reg[z]) + ctxt.Andptr = ctxt.Andptr[1:] /* xchg rsh,ax */ + subreg(&pp, z, REG_AX) + doasm(ctxt, &pp) + ctxt.Andptr[0] = byte(0x90 + reg[z]) + ctxt.Andptr = ctxt.Andptr[1:] /* xchg rsh,ax */ + } + return + } + + if isax(&p.From) { + ctxt.Andptr[0] = 0x87 + ctxt.Andptr = ctxt.Andptr[1:] /* xchg rhs,bx */ + asmando(ctxt, p, &p.To, reg[REG_BX]) + subreg(&pp, z, REG_BX) + doasm(ctxt, &pp) + ctxt.Andptr[0] = 0x87 + ctxt.Andptr = ctxt.Andptr[1:] /* xchg rhs,bx */ + asmando(ctxt, p, &p.To, reg[REG_BX]) + } else { + ctxt.Andptr[0] = byte(0x90 + reg[z]) + ctxt.Andptr = ctxt.Andptr[1:] /* xchg rsh,ax */ + subreg(&pp, z, REG_AX) + doasm(ctxt, &pp) + ctxt.Andptr[0] = byte(0x90 + reg[z]) + ctxt.Andptr = ctxt.Andptr[1:] /* xchg rsh,ax */ + } + return + } + } + + ctxt.Diag("doasm: notfound ft=%d tt=%d %v %d %d", p.Ft, p.Tt, p, oclass(ctxt, p, &p.From), oclass(ctxt, p, &p.To)) + return +} + +// byteswapreg returns a byte-addressable register (AX, BX, CX, DX) +// which is not referenced in a. +// If a is empty, it returns BX to account for MULB-like instructions +// that might use DX and AX. +func byteswapreg(ctxt *obj.Link, a *obj.Addr) int { + cand := 1 + canc := cand + canb := canc + cana := canb + + if a.Type == obj.TYPE_NONE { + cand = 0 + cana = cand + } + + if a.Type == obj.TYPE_REG || ((a.Type == obj.TYPE_MEM || a.Type == obj.TYPE_ADDR) && a.Name == obj.NAME_NONE) { + switch a.Reg { + case REG_NONE: + cand = 0 + cana = cand + + case REG_AX, REG_AL, REG_AH: + cana = 0 + + case REG_BX, REG_BL, REG_BH: + canb = 0 + + case REG_CX, REG_CL, REG_CH: + canc = 0 + + case REG_DX, REG_DL, REG_DH: + cand = 0 + } + } + + if a.Type == obj.TYPE_MEM || a.Type == obj.TYPE_ADDR { + switch a.Index { + case REG_AX: + cana = 0 + + case REG_BX: + canb = 0 + + case REG_CX: + canc = 0 + + case REG_DX: + cand = 0 + } + } + + if cana != 0 { + return REG_AX + } + if canb != 0 { + return REG_BX + } + if canc != 0 { + return REG_CX + } + if cand != 0 { + return REG_DX + } + + ctxt.Diag("impossible byte register") + log.Fatalf("bad code") + return 0 +} + +func isbadbyte(a *obj.Addr) bool { + return a.Type == obj.TYPE_REG && (REG_BP <= a.Reg && a.Reg <= REG_DI || REG_BPB <= a.Reg && a.Reg <= REG_DIB) +} + +var naclret = []uint8{ + 0x5e, // POPL SI + // 0x8b, 0x7d, 0x00, // MOVL (BP), DI - catch return to invalid address, for debugging + 0x83, + 0xe6, + 0xe0, // ANDL $~31, SI + 0x4c, + 0x01, + 0xfe, // ADDQ R15, SI + 0xff, + 0xe6, // JMP SI +} + +var naclret8 = []uint8{ + 0x5d, // POPL BP + // 0x8b, 0x7d, 0x00, // MOVL (BP), DI - catch return to invalid address, for debugging + 0x83, + 0xe5, + 0xe0, // ANDL $~31, BP + 0xff, + 0xe5, // JMP BP +} + +var naclspfix = []uint8{0x4c, 0x01, 0xfc} // ADDQ R15, SP + +var naclbpfix = []uint8{0x4c, 0x01, 0xfd} // ADDQ R15, BP + +var naclmovs = []uint8{ + 0x89, + 0xf6, // MOVL SI, SI + 0x49, + 0x8d, + 0x34, + 0x37, // LEAQ (R15)(SI*1), SI + 0x89, + 0xff, // MOVL DI, DI + 0x49, + 0x8d, + 0x3c, + 0x3f, // LEAQ (R15)(DI*1), DI +} + +var naclstos = []uint8{ + 0x89, + 0xff, // MOVL DI, DI + 0x49, + 0x8d, + 0x3c, + 0x3f, // LEAQ (R15)(DI*1), DI +} + +func nacltrunc(ctxt *obj.Link, reg int) { + if reg >= REG_R8 { + ctxt.Andptr[0] = 0x45 + ctxt.Andptr = ctxt.Andptr[1:] + } + reg = (reg - REG_AX) & 7 + ctxt.Andptr[0] = 0x89 + ctxt.Andptr = ctxt.Andptr[1:] + ctxt.Andptr[0] = byte(3<<6 | reg<<3 | reg) + ctxt.Andptr = ctxt.Andptr[1:] +} + +func asmins(ctxt *obj.Link, p *obj.Prog) { + ctxt.Andptr = ctxt.And[:] + ctxt.Asmode = int(p.Mode) + + if p.As == obj.AUSEFIELD { + r := obj.Addrel(ctxt.Cursym) + r.Off = 0 + r.Siz = 0 + r.Sym = p.From.Sym + r.Type = obj.R_USEFIELD + return + } + + if ctxt.Headtype == obj.Hnacl && p.Mode == 32 { + switch p.As { + case obj.ARET: + copy(ctxt.Andptr, naclret8) + ctxt.Andptr = ctxt.Andptr[len(naclret8):] + return + + case obj.ACALL, + obj.AJMP: + if p.To.Type == obj.TYPE_REG && REG_AX <= p.To.Reg && p.To.Reg <= REG_DI { + ctxt.Andptr[0] = 0x83 + ctxt.Andptr = ctxt.Andptr[1:] + ctxt.Andptr[0] = byte(0xe0 | (p.To.Reg - REG_AX)) + ctxt.Andptr = ctxt.Andptr[1:] + ctxt.Andptr[0] = 0xe0 + ctxt.Andptr = ctxt.Andptr[1:] + } + + case AINT: + ctxt.Andptr[0] = 0xf4 + ctxt.Andptr = ctxt.Andptr[1:] + return + } + } + + if ctxt.Headtype == obj.Hnacl && p.Mode == 64 { + if p.As == AREP { + ctxt.Rep++ + return + } + + if p.As == AREPN { + ctxt.Repn++ + return + } + + if p.As == ALOCK { + ctxt.Lock++ + return + } + + if p.As != ALEAQ && p.As != ALEAL { + if p.From.Index != obj.TYPE_NONE && p.From.Scale > 0 { + nacltrunc(ctxt, int(p.From.Index)) + } + if p.To.Index != obj.TYPE_NONE && p.To.Scale > 0 { + nacltrunc(ctxt, int(p.To.Index)) + } + } + + switch p.As { + case obj.ARET: + copy(ctxt.Andptr, naclret) + ctxt.Andptr = ctxt.Andptr[len(naclret):] + return + + case obj.ACALL, + obj.AJMP: + if p.To.Type == obj.TYPE_REG && REG_AX <= p.To.Reg && p.To.Reg <= REG_DI { + // ANDL $~31, reg + ctxt.Andptr[0] = 0x83 + ctxt.Andptr = ctxt.Andptr[1:] + + ctxt.Andptr[0] = byte(0xe0 | (p.To.Reg - REG_AX)) + ctxt.Andptr = ctxt.Andptr[1:] + ctxt.Andptr[0] = 0xe0 + ctxt.Andptr = ctxt.Andptr[1:] + + // ADDQ R15, reg + ctxt.Andptr[0] = 0x4c + ctxt.Andptr = ctxt.Andptr[1:] + + ctxt.Andptr[0] = 0x01 + ctxt.Andptr = ctxt.Andptr[1:] + ctxt.Andptr[0] = byte(0xf8 | (p.To.Reg - REG_AX)) + ctxt.Andptr = ctxt.Andptr[1:] + } + + if p.To.Type == obj.TYPE_REG && REG_R8 <= p.To.Reg && p.To.Reg <= REG_R15 { + // ANDL $~31, reg + ctxt.Andptr[0] = 0x41 + ctxt.Andptr = ctxt.Andptr[1:] + + ctxt.Andptr[0] = 0x83 + ctxt.Andptr = ctxt.Andptr[1:] + ctxt.Andptr[0] = byte(0xe0 | (p.To.Reg - REG_R8)) + ctxt.Andptr = ctxt.Andptr[1:] + ctxt.Andptr[0] = 0xe0 + ctxt.Andptr = ctxt.Andptr[1:] + + // ADDQ R15, reg + ctxt.Andptr[0] = 0x4d + ctxt.Andptr = ctxt.Andptr[1:] + + ctxt.Andptr[0] = 0x01 + ctxt.Andptr = ctxt.Andptr[1:] + ctxt.Andptr[0] = byte(0xf8 | (p.To.Reg - REG_R8)) + ctxt.Andptr = ctxt.Andptr[1:] + } + + case AINT: + ctxt.Andptr[0] = 0xf4 + ctxt.Andptr = ctxt.Andptr[1:] + return + + case ASCASB, + ASCASW, + ASCASL, + ASCASQ, + ASTOSB, + ASTOSW, + ASTOSL, + ASTOSQ: + copy(ctxt.Andptr, naclstos) + ctxt.Andptr = ctxt.Andptr[len(naclstos):] + + case AMOVSB, AMOVSW, AMOVSL, AMOVSQ: + copy(ctxt.Andptr, naclmovs) + ctxt.Andptr = ctxt.Andptr[len(naclmovs):] + } + + if ctxt.Rep != 0 { + ctxt.Andptr[0] = 0xf3 + ctxt.Andptr = ctxt.Andptr[1:] + ctxt.Rep = 0 + } + + if ctxt.Repn != 0 { + ctxt.Andptr[0] = 0xf2 + ctxt.Andptr = ctxt.Andptr[1:] + ctxt.Repn = 0 + } + + if ctxt.Lock != 0 { + ctxt.Andptr[0] = 0xf0 + ctxt.Andptr = ctxt.Andptr[1:] + ctxt.Lock = 0 + } + } + + ctxt.Rexflag = 0 + and0 := ctxt.Andptr + ctxt.Asmode = int(p.Mode) + doasm(ctxt, p) + if ctxt.Rexflag != 0 { + /* + * as befits the whole approach of the architecture, + * the rex prefix must appear before the first opcode byte + * (and thus after any 66/67/f2/f3/26/2e/3e prefix bytes, but + * before the 0f opcode escape!), or it might be ignored. + * note that the handbook often misleadingly shows 66/f2/f3 in `opcode'. + */ + if p.Mode != 64 { + ctxt.Diag("asmins: illegal in mode %d: %v (%d %d)", p.Mode, p, p.Ft, p.Tt) + } + n := -cap(ctxt.Andptr) + cap(and0) + var c int + var np int + for np = 0; np < n; np++ { + c = int(and0[np]) + if c != 0xf2 && c != 0xf3 && (c < 0x64 || c > 0x67) && c != 0x2e && c != 0x3e && c != 0x26 { + break + } + } + + copy(and0[np+1:], and0[np:n]) + and0[np] = byte(0x40 | ctxt.Rexflag) + ctxt.Andptr = ctxt.Andptr[1:] + } + + n := -cap(ctxt.Andptr) + cap(ctxt.And[:]) + var r *obj.Reloc + for i := len(ctxt.Cursym.R) - 1; i >= 0; i-- { + r = &ctxt.Cursym.R[i:][0] + if int64(r.Off) < p.Pc { + break + } + if ctxt.Rexflag != 0 { + r.Off++ + } + if r.Type == obj.R_PCREL { + // PC-relative addressing is relative to the end of the instruction, + // but the relocations applied by the linker are relative to the end + // of the relocation. Because immediate instruction + // arguments can follow the PC-relative memory reference in the + // instruction encoding, the two may not coincide. In this case, + // adjust addend so that linker can keep relocating relative to the + // end of the relocation. + r.Add -= p.Pc + int64(n) - (int64(r.Off) + int64(r.Siz)) + } + } + + if p.Mode == 64 && ctxt.Headtype == obj.Hnacl && p.As != ACMPL && p.As != ACMPQ && p.To.Type == obj.TYPE_REG { + switch p.To.Reg { + case REG_SP: + copy(ctxt.Andptr, naclspfix) + ctxt.Andptr = ctxt.Andptr[len(naclspfix):] + + case REG_BP: + copy(ctxt.Andptr, naclbpfix) + ctxt.Andptr = ctxt.Andptr[len(naclbpfix):] + } + } +} diff --git a/src/cmd/internal/obj/x86/list6.go b/src/cmd/internal/obj/x86/list6.go new file mode 100644 index 0000000000000000000000000000000000000000..fc79b902a264deaf5a5e9524337261e2afa4c1f8 --- /dev/null +++ b/src/cmd/internal/obj/x86/list6.go @@ -0,0 +1,164 @@ +// Inferno utils/6c/list.c +// http://code.google.com/p/inferno-os/source/browse/utils/6c/list.c +// +// Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved. +// Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net) +// Portions Copyright © 1997-1999 Vita Nuova Limited +// Portions Copyright © 2000-2007 Vita Nuova Holdings Limited (www.vitanuova.com) +// Portions Copyright © 2004,2006 Bruce Ellis +// Portions Copyright © 2005-2007 C H Forsyth (forsyth@terzarima.net) +// Revisions Copyright © 2000-2007 Lucent Technologies Inc. and others +// Portions Copyright © 2009 The Go Authors. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +package x86 + +import ( + "cmd/internal/obj" + "fmt" +) + +var Register = []string{ + "AL", /* [D_AL] */ + "CL", + "DL", + "BL", + "SPB", + "BPB", + "SIB", + "DIB", + "R8B", + "R9B", + "R10B", + "R11B", + "R12B", + "R13B", + "R14B", + "R15B", + "AX", /* [D_AX] */ + "CX", + "DX", + "BX", + "SP", + "BP", + "SI", + "DI", + "R8", + "R9", + "R10", + "R11", + "R12", + "R13", + "R14", + "R15", + "AH", + "CH", + "DH", + "BH", + "F0", /* [D_F0] */ + "F1", + "F2", + "F3", + "F4", + "F5", + "F6", + "F7", + "M0", + "M1", + "M2", + "M3", + "M4", + "M5", + "M6", + "M7", + "X0", + "X1", + "X2", + "X3", + "X4", + "X5", + "X6", + "X7", + "X8", + "X9", + "X10", + "X11", + "X12", + "X13", + "X14", + "X15", + "CS", /* [D_CS] */ + "SS", + "DS", + "ES", + "FS", + "GS", + "GDTR", /* [D_GDTR] */ + "IDTR", /* [D_IDTR] */ + "LDTR", /* [D_LDTR] */ + "MSW", /* [D_MSW] */ + "TASK", /* [D_TASK] */ + "CR0", /* [D_CR] */ + "CR1", + "CR2", + "CR3", + "CR4", + "CR5", + "CR6", + "CR7", + "CR8", + "CR9", + "CR10", + "CR11", + "CR12", + "CR13", + "CR14", + "CR15", + "DR0", /* [D_DR] */ + "DR1", + "DR2", + "DR3", + "DR4", + "DR5", + "DR6", + "DR7", + "TR0", /* [D_TR] */ + "TR1", + "TR2", + "TR3", + "TR4", + "TR5", + "TR6", + "TR7", + "TLS", /* [D_TLS] */ + "MAXREG", /* [MAXREG] */ +} + +func init() { + obj.RegisterRegister(REG_AL, REG_AL+len(Register), Rconv) + obj.RegisterOpcode(obj.ABaseAMD64, Anames) +} + +func Rconv(r int) string { + if REG_AL <= r && r-REG_AL < len(Register) { + return Register[r-REG_AL] + } + return fmt.Sprintf("Rgok(%d)", r-obj.RBaseAMD64) +} diff --git a/src/cmd/internal/obj/x86/obj6.go b/src/cmd/internal/obj/x86/obj6.go new file mode 100644 index 0000000000000000000000000000000000000000..fa9c474adb344f8f66089330bcd408e7a4b07ff8 --- /dev/null +++ b/src/cmd/internal/obj/x86/obj6.go @@ -0,0 +1,1330 @@ +// Inferno utils/6l/pass.c +// http://code.google.com/p/inferno-os/source/browse/utils/6l/pass.c +// +// Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved. +// Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net) +// Portions Copyright © 1997-1999 Vita Nuova Limited +// Portions Copyright © 2000-2007 Vita Nuova Holdings Limited (www.vitanuova.com) +// Portions Copyright © 2004,2006 Bruce Ellis +// Portions Copyright © 2005-2007 C H Forsyth (forsyth@terzarima.net) +// Revisions Copyright © 2000-2007 Lucent Technologies Inc. and others +// Portions Copyright © 2009 The Go Authors. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +package x86 + +import ( + "cmd/internal/obj" + "encoding/binary" + "fmt" + "log" + "math" +) + +func canuse1insntls(ctxt *obj.Link) bool { + if ctxt.Arch.Regsize == 4 { + switch ctxt.Headtype { + case obj.Hlinux, + obj.Hnacl, + obj.Hplan9, + obj.Hwindows: + return false + } + + return true + } + + switch ctxt.Headtype { + case obj.Hplan9, + obj.Hwindows: + return false + case obj.Hlinux: + return ctxt.Flag_shared == 0 + } + + return true +} + +func progedit(ctxt *obj.Link, p *obj.Prog) { + // Maintain information about code generation mode. + if ctxt.Mode == 0 { + ctxt.Mode = ctxt.Arch.Regsize * 8 + } + p.Mode = int8(ctxt.Mode) + + switch p.As { + case AMODE: + if p.From.Type == obj.TYPE_CONST || (p.From.Type == obj.TYPE_MEM && p.From.Reg == REG_NONE) { + switch int(p.From.Offset) { + case 16, 32, 64: + ctxt.Mode = int(p.From.Offset) + } + } + obj.Nopout(p) + } + + // Thread-local storage references use the TLS pseudo-register. + // As a register, TLS refers to the thread-local storage base, and it + // can only be loaded into another register: + // + // MOVQ TLS, AX + // + // An offset from the thread-local storage base is written off(reg)(TLS*1). + // Semantically it is off(reg), but the (TLS*1) annotation marks this as + // indexing from the loaded TLS base. This emits a relocation so that + // if the linker needs to adjust the offset, it can. For example: + // + // MOVQ TLS, AX + // MOVQ 0(AX)(TLS*1), CX // load g into CX + // + // On systems that support direct access to the TLS memory, this + // pair of instructions can be reduced to a direct TLS memory reference: + // + // MOVQ 0(TLS), CX // load g into CX + // + // The 2-instruction and 1-instruction forms correspond to the two code + // sequences for loading a TLS variable in the local exec model given in "ELF + // Handling For Thread-Local Storage". + // + // We apply this rewrite on systems that support the 1-instruction form. + // The decision is made using only the operating system and the -shared flag, + // not the link mode. If some link modes on a particular operating system + // require the 2-instruction form, then all builds for that operating system + // will use the 2-instruction form, so that the link mode decision can be + // delayed to link time. + // + // In this way, all supported systems use identical instructions to + // access TLS, and they are rewritten appropriately first here in + // liblink and then finally using relocations in the linker. + // + // When -shared is passed, we leave the code in the 2-instruction form but + // assemble (and relocate) them in different ways to generate the initial + // exec code sequence. It's a bit of a fluke that this is possible without + // rewriting the instructions more comprehensively, and it only does because + // we only support a single TLS variable (g). + + if canuse1insntls(ctxt) { + // Reduce 2-instruction sequence to 1-instruction sequence. + // Sequences like + // MOVQ TLS, BX + // ... off(BX)(TLS*1) ... + // become + // NOP + // ... off(TLS) ... + // + // TODO(rsc): Remove the Hsolaris special case. It exists only to + // guarantee we are producing byte-identical binaries as before this code. + // But it should be unnecessary. + if (p.As == AMOVQ || p.As == AMOVL) && p.From.Type == obj.TYPE_REG && p.From.Reg == REG_TLS && p.To.Type == obj.TYPE_REG && REG_AX <= p.To.Reg && p.To.Reg <= REG_R15 && ctxt.Headtype != obj.Hsolaris { + obj.Nopout(p) + } + if p.From.Type == obj.TYPE_MEM && p.From.Index == REG_TLS && REG_AX <= p.From.Reg && p.From.Reg <= REG_R15 { + p.From.Reg = REG_TLS + p.From.Scale = 0 + p.From.Index = REG_NONE + } + + if p.To.Type == obj.TYPE_MEM && p.To.Index == REG_TLS && REG_AX <= p.To.Reg && p.To.Reg <= REG_R15 { + p.To.Reg = REG_TLS + p.To.Scale = 0 + p.To.Index = REG_NONE + } + } else { + // load_g_cx, below, always inserts the 1-instruction sequence. Rewrite it + // as the 2-instruction sequence if necessary. + // MOVQ 0(TLS), BX + // becomes + // MOVQ TLS, BX + // MOVQ 0(BX)(TLS*1), BX + if (p.As == AMOVQ || p.As == AMOVL) && p.From.Type == obj.TYPE_MEM && p.From.Reg == REG_TLS && p.To.Type == obj.TYPE_REG && REG_AX <= p.To.Reg && p.To.Reg <= REG_R15 { + q := obj.Appendp(ctxt, p) + q.As = p.As + q.From = p.From + q.From.Type = obj.TYPE_MEM + q.From.Reg = p.To.Reg + q.From.Index = REG_TLS + q.From.Scale = 2 // TODO: use 1 + q.To = p.To + p.From.Type = obj.TYPE_REG + p.From.Reg = REG_TLS + p.From.Index = REG_NONE + p.From.Offset = 0 + } + } + + // TODO: Remove. + if ctxt.Headtype == obj.Hwindows && p.Mode == 64 || ctxt.Headtype == obj.Hplan9 { + if p.From.Scale == 1 && p.From.Index == REG_TLS { + p.From.Scale = 2 + } + if p.To.Scale == 1 && p.To.Index == REG_TLS { + p.To.Scale = 2 + } + } + + // Rewrite 0 to $0 in 3rd argment to CMPPS etc. + // That's what the tables expect. + switch p.As { + case ACMPPD, ACMPPS, ACMPSD, ACMPSS: + if p.To.Type == obj.TYPE_MEM && p.To.Name == obj.NAME_NONE && p.To.Reg == REG_NONE && p.To.Index == REG_NONE && p.To.Sym == nil { + p.To.Type = obj.TYPE_CONST + } + } + + // Rewrite CALL/JMP/RET to symbol as TYPE_BRANCH. + switch p.As { + case obj.ACALL, obj.AJMP, obj.ARET: + if p.To.Type == obj.TYPE_MEM && (p.To.Name == obj.NAME_EXTERN || p.To.Name == obj.NAME_STATIC) && p.To.Sym != nil { + p.To.Type = obj.TYPE_BRANCH + } + } + + // Rewrite MOVL/MOVQ $XXX(FP/SP) as LEAL/LEAQ. + if p.From.Type == obj.TYPE_ADDR && (ctxt.Arch.Thechar == '6' || p.From.Name != obj.NAME_EXTERN && p.From.Name != obj.NAME_STATIC) { + switch p.As { + case AMOVL: + p.As = ALEAL + p.From.Type = obj.TYPE_MEM + case AMOVQ: + p.As = ALEAQ + p.From.Type = obj.TYPE_MEM + } + } + + if ctxt.Headtype == obj.Hnacl && p.Mode == 64 { + if p.From3 != nil { + nacladdr(ctxt, p, p.From3) + } + nacladdr(ctxt, p, &p.From) + nacladdr(ctxt, p, &p.To) + } + + // Rewrite float constants to values stored in memory. + switch p.As { + // Convert AMOVSS $(0), Xx to AXORPS Xx, Xx + case AMOVSS: + if p.From.Type == obj.TYPE_FCONST { + if p.From.Val.(float64) == 0 { + if p.To.Type == obj.TYPE_REG && REG_X0 <= p.To.Reg && p.To.Reg <= REG_X15 { + p.As = AXORPS + p.From = p.To + break + } + } + } + fallthrough + + case AFMOVF, + AFADDF, + AFSUBF, + AFSUBRF, + AFMULF, + AFDIVF, + AFDIVRF, + AFCOMF, + AFCOMFP, + AADDSS, + ASUBSS, + AMULSS, + ADIVSS, + ACOMISS, + AUCOMISS: + if p.From.Type == obj.TYPE_FCONST { + f32 := float32(p.From.Val.(float64)) + i32 := math.Float32bits(f32) + literal := fmt.Sprintf("$f32.%08x", i32) + s := obj.Linklookup(ctxt, literal, 0) + p.From.Type = obj.TYPE_MEM + p.From.Name = obj.NAME_EXTERN + p.From.Sym = s + p.From.Sym.Local = true + p.From.Offset = 0 + } + + case AMOVSD: + // Convert AMOVSD $(0), Xx to AXORPS Xx, Xx + if p.From.Type == obj.TYPE_FCONST { + if p.From.Val.(float64) == 0 { + if p.To.Type == obj.TYPE_REG && REG_X0 <= p.To.Reg && p.To.Reg <= REG_X15 { + p.As = AXORPS + p.From = p.To + break + } + } + } + fallthrough + + case AFMOVD, + AFADDD, + AFSUBD, + AFSUBRD, + AFMULD, + AFDIVD, + AFDIVRD, + AFCOMD, + AFCOMDP, + AADDSD, + ASUBSD, + AMULSD, + ADIVSD, + ACOMISD, + AUCOMISD: + if p.From.Type == obj.TYPE_FCONST { + i64 := math.Float64bits(p.From.Val.(float64)) + literal := fmt.Sprintf("$f64.%016x", i64) + s := obj.Linklookup(ctxt, literal, 0) + p.From.Type = obj.TYPE_MEM + p.From.Name = obj.NAME_EXTERN + p.From.Sym = s + p.From.Sym.Local = true + p.From.Offset = 0 + } + } + + if ctxt.Flag_dynlink && (p.As == obj.ADUFFCOPY || p.As == obj.ADUFFZERO) { + var sym *obj.LSym + if p.As == obj.ADUFFZERO { + sym = obj.Linklookup(ctxt, "runtime.duffzero", 0) + } else { + sym = obj.Linklookup(ctxt, "runtime.duffcopy", 0) + } + offset := p.To.Offset + p.As = AMOVQ + p.From.Type = obj.TYPE_MEM + p.From.Name = obj.NAME_GOTREF + p.From.Sym = sym + p.To.Type = obj.TYPE_REG + p.To.Reg = REG_R15 + p.To.Offset = 0 + p.To.Sym = nil + p1 := obj.Appendp(ctxt, p) + p1.As = AADDQ + p1.From.Type = obj.TYPE_CONST + p1.From.Offset = offset + p1.To.Type = obj.TYPE_REG + p1.To.Reg = REG_R15 + p2 := obj.Appendp(ctxt, p1) + p2.As = obj.ACALL + p2.To.Type = obj.TYPE_REG + p2.To.Reg = REG_R15 + } + + if ctxt.Flag_dynlink { + if p.As == ALEAQ && p.From.Type == obj.TYPE_MEM && p.From.Name == obj.NAME_EXTERN && !p.From.Sym.Local { + p.As = AMOVQ + p.From.Type = obj.TYPE_ADDR + } + if p.From.Type == obj.TYPE_ADDR && p.From.Name == obj.NAME_EXTERN && !p.From.Sym.Local { + if p.As != AMOVQ { + ctxt.Diag("do not know how to handle TYPE_ADDR in %v with -dynlink", p) + } + if p.To.Type != obj.TYPE_REG { + ctxt.Diag("do not know how to handle LEAQ-type insn to non-register in %v with -dynlink", p) + } + p.From.Type = obj.TYPE_MEM + p.From.Name = obj.NAME_GOTREF + if p.From.Offset != 0 { + q := obj.Appendp(ctxt, p) + q.As = AADDQ + q.From.Type = obj.TYPE_CONST + q.From.Offset = p.From.Offset + q.To = p.To + p.From.Offset = 0 + } + } + if p.From3 != nil && p.From3.Name == obj.NAME_EXTERN { + ctxt.Diag("don't know how to handle %v with -dynlink", p) + } + var source *obj.Addr + if p.From.Name == obj.NAME_EXTERN && !p.From.Sym.Local { + if p.To.Name == obj.NAME_EXTERN && !p.To.Sym.Local { + ctxt.Diag("cannot handle NAME_EXTERN on both sides in %v with -dynlink", p) + } + source = &p.From + } else if p.To.Name == obj.NAME_EXTERN && !p.To.Sym.Local { + source = &p.To + } else { + return + } + if p.As == obj.ATEXT || p.As == obj.AFUNCDATA || p.As == obj.ACALL || p.As == obj.ARET || p.As == obj.AJMP { + return + } + if source.Type != obj.TYPE_MEM { + ctxt.Diag("don't know how to handle %v with -dynlink", p) + } + p1 := obj.Appendp(ctxt, p) + p2 := obj.Appendp(ctxt, p1) + + p1.As = AMOVQ + p1.From.Type = obj.TYPE_MEM + p1.From.Sym = source.Sym + p1.From.Name = obj.NAME_GOTREF + p1.To.Type = obj.TYPE_REG + p1.To.Reg = REG_R15 + + p2.As = p.As + p2.From = p.From + p2.To = p.To + if p.From.Name == obj.NAME_EXTERN { + p2.From.Reg = REG_R15 + p2.From.Name = obj.NAME_NONE + p2.From.Sym = nil + } else if p.To.Name == obj.NAME_EXTERN { + p2.To.Reg = REG_R15 + p2.To.Name = obj.NAME_NONE + p2.To.Sym = nil + } else { + return + } + l := p.Link + l2 := p2.Link + *p = *p1 + *p1 = *p2 + p.Link = l + p1.Link = l2 + } +} + +func nacladdr(ctxt *obj.Link, p *obj.Prog, a *obj.Addr) { + if p.As == ALEAL || p.As == ALEAQ { + return + } + + if a.Reg == REG_BP { + ctxt.Diag("invalid address: %v", p) + return + } + + if a.Reg == REG_TLS { + a.Reg = REG_BP + } + if a.Type == obj.TYPE_MEM && a.Name == obj.NAME_NONE { + switch a.Reg { + // all ok + case REG_BP, REG_SP, REG_R15: + break + + default: + if a.Index != REG_NONE { + ctxt.Diag("invalid address %v", p) + } + a.Index = a.Reg + if a.Index != REG_NONE { + a.Scale = 1 + } + a.Reg = REG_R15 + } + } +} + +func preprocess(ctxt *obj.Link, cursym *obj.LSym) { + if ctxt.Tlsg == nil { + ctxt.Tlsg = obj.Linklookup(ctxt, "runtime.tlsg", 0) + } + + if ctxt.Headtype == obj.Hplan9 && ctxt.Plan9privates == nil { + ctxt.Plan9privates = obj.Linklookup(ctxt, "_privates", 0) + } + + ctxt.Cursym = cursym + + if cursym.Text == nil || cursym.Text.Link == nil { + return + } + + p := cursym.Text + autoffset := int32(p.To.Offset) + if autoffset < 0 { + autoffset = 0 + } + + var bpsize int + if p.Mode == 64 && obj.Framepointer_enabled != 0 && autoffset > 0 { + // Make room for to save a base pointer. If autoffset == 0, + // this might do something special like a tail jump to + // another function, so in that case we omit this. + bpsize = ctxt.Arch.Ptrsize + + autoffset += int32(bpsize) + p.To.Offset += int64(bpsize) + } else { + bpsize = 0 + } + + textarg := int64(p.To.Val.(int32)) + cursym.Args = int32(textarg) + cursym.Locals = int32(p.To.Offset) + + // TODO(rsc): Remove. + if p.Mode == 32 && cursym.Locals < 0 { + cursym.Locals = 0 + } + + // TODO(rsc): Remove 'p.Mode == 64 &&'. + if p.Mode == 64 && autoffset < obj.StackSmall && p.From3Offset()&obj.NOSPLIT == 0 { + for q := p; q != nil; q = q.Link { + if q.As == obj.ACALL { + goto noleaf + } + if (q.As == obj.ADUFFCOPY || q.As == obj.ADUFFZERO) && autoffset >= obj.StackSmall-8 { + goto noleaf + } + } + + p.From3.Offset |= obj.NOSPLIT + noleaf: + } + + if p.From3Offset()&obj.NOSPLIT == 0 || p.From3Offset()&obj.WRAPPER != 0 { + p = obj.Appendp(ctxt, p) + p = load_g_cx(ctxt, p) // load g into CX + } + + if cursym.Text.From3Offset()&obj.NOSPLIT == 0 { + p = stacksplit(ctxt, p, autoffset, int32(textarg)) // emit split check + } + + if autoffset != 0 { + if autoffset%int32(ctxt.Arch.Regsize) != 0 { + ctxt.Diag("unaligned stack size %d", autoffset) + } + p = obj.Appendp(ctxt, p) + p.As = AADJSP + p.From.Type = obj.TYPE_CONST + p.From.Offset = int64(autoffset) + p.Spadj = autoffset + } else { + // zero-byte stack adjustment. + // Insert a fake non-zero adjustment so that stkcheck can + // recognize the end of the stack-splitting prolog. + p = obj.Appendp(ctxt, p) + + p.As = obj.ANOP + p.Spadj = int32(-ctxt.Arch.Ptrsize) + p = obj.Appendp(ctxt, p) + p.As = obj.ANOP + p.Spadj = int32(ctxt.Arch.Ptrsize) + } + + deltasp := autoffset + + if bpsize > 0 { + // Save caller's BP + p = obj.Appendp(ctxt, p) + + p.As = AMOVQ + p.From.Type = obj.TYPE_REG + p.From.Reg = REG_BP + p.To.Type = obj.TYPE_MEM + p.To.Reg = REG_SP + p.To.Scale = 1 + p.To.Offset = int64(autoffset) - int64(bpsize) + + // Move current frame to BP + p = obj.Appendp(ctxt, p) + + p.As = ALEAQ + p.From.Type = obj.TYPE_MEM + p.From.Reg = REG_SP + p.From.Scale = 1 + p.From.Offset = int64(autoffset) - int64(bpsize) + p.To.Type = obj.TYPE_REG + p.To.Reg = REG_BP + } + + if cursym.Text.From3Offset()&obj.WRAPPER != 0 { + // if(g->panic != nil && g->panic->argp == FP) g->panic->argp = bottom-of-frame + // + // MOVQ g_panic(CX), BX + // TESTQ BX, BX + // JEQ end + // LEAQ (autoffset+8)(SP), DI + // CMPQ panic_argp(BX), DI + // JNE end + // MOVQ SP, panic_argp(BX) + // end: + // NOP + // + // The NOP is needed to give the jumps somewhere to land. + // It is a liblink NOP, not an x86 NOP: it encodes to 0 instruction bytes. + + p = obj.Appendp(ctxt, p) + + p.As = AMOVQ + p.From.Type = obj.TYPE_MEM + p.From.Reg = REG_CX + p.From.Offset = 4 * int64(ctxt.Arch.Ptrsize) // G.panic + p.To.Type = obj.TYPE_REG + p.To.Reg = REG_BX + if ctxt.Headtype == obj.Hnacl && p.Mode == 64 { + p.As = AMOVL + p.From.Type = obj.TYPE_MEM + p.From.Reg = REG_R15 + p.From.Scale = 1 + p.From.Index = REG_CX + } + if p.Mode == 32 { + p.As = AMOVL + } + + p = obj.Appendp(ctxt, p) + p.As = ATESTQ + p.From.Type = obj.TYPE_REG + p.From.Reg = REG_BX + p.To.Type = obj.TYPE_REG + p.To.Reg = REG_BX + if ctxt.Headtype == obj.Hnacl || p.Mode == 32 { + p.As = ATESTL + } + + p = obj.Appendp(ctxt, p) + p.As = AJEQ + p.To.Type = obj.TYPE_BRANCH + p1 := p + + p = obj.Appendp(ctxt, p) + p.As = ALEAQ + p.From.Type = obj.TYPE_MEM + p.From.Reg = REG_SP + p.From.Offset = int64(autoffset) + int64(ctxt.Arch.Regsize) + p.To.Type = obj.TYPE_REG + p.To.Reg = REG_DI + if ctxt.Headtype == obj.Hnacl || p.Mode == 32 { + p.As = ALEAL + } + + p = obj.Appendp(ctxt, p) + p.As = ACMPQ + p.From.Type = obj.TYPE_MEM + p.From.Reg = REG_BX + p.From.Offset = 0 // Panic.argp + p.To.Type = obj.TYPE_REG + p.To.Reg = REG_DI + if ctxt.Headtype == obj.Hnacl && p.Mode == 64 { + p.As = ACMPL + p.From.Type = obj.TYPE_MEM + p.From.Reg = REG_R15 + p.From.Scale = 1 + p.From.Index = REG_BX + } + if p.Mode == 32 { + p.As = ACMPL + } + + p = obj.Appendp(ctxt, p) + p.As = AJNE + p.To.Type = obj.TYPE_BRANCH + p2 := p + + p = obj.Appendp(ctxt, p) + p.As = AMOVQ + p.From.Type = obj.TYPE_REG + p.From.Reg = REG_SP + p.To.Type = obj.TYPE_MEM + p.To.Reg = REG_BX + p.To.Offset = 0 // Panic.argp + if ctxt.Headtype == obj.Hnacl && p.Mode == 64 { + p.As = AMOVL + p.To.Type = obj.TYPE_MEM + p.To.Reg = REG_R15 + p.To.Scale = 1 + p.To.Index = REG_BX + } + if p.Mode == 32 { + p.As = AMOVL + } + + p = obj.Appendp(ctxt, p) + p.As = obj.ANOP + p1.Pcond = p + p2.Pcond = p + } + + if ctxt.Debugzerostack != 0 && autoffset != 0 && cursym.Text.From3.Offset&obj.NOSPLIT == 0 { + // 6l -Z means zero the stack frame on entry. + // This slows down function calls but can help avoid + // false positives in garbage collection. + p = obj.Appendp(ctxt, p) + + p.As = AMOVQ + p.From.Type = obj.TYPE_REG + p.From.Reg = REG_SP + p.To.Type = obj.TYPE_REG + p.To.Reg = REG_DI + if p.Mode == 32 { + p.As = AMOVL + } + + p = obj.Appendp(ctxt, p) + p.As = AMOVQ + p.From.Type = obj.TYPE_CONST + p.From.Offset = int64(autoffset) / int64(ctxt.Arch.Regsize) + p.To.Type = obj.TYPE_REG + p.To.Reg = REG_CX + if p.Mode == 32 { + p.As = AMOVL + } + + p = obj.Appendp(ctxt, p) + p.As = AMOVQ + p.From.Type = obj.TYPE_CONST + p.From.Offset = 0 + p.To.Type = obj.TYPE_REG + p.To.Reg = REG_AX + if p.Mode == 32 { + p.As = AMOVL + } + + p = obj.Appendp(ctxt, p) + p.As = AREP + + p = obj.Appendp(ctxt, p) + p.As = ASTOSQ + if p.Mode == 32 { + p.As = ASTOSL + } + } + + var a int + var pcsize int + for ; p != nil; p = p.Link { + pcsize = int(p.Mode) / 8 + a = int(p.From.Name) + if a == obj.NAME_AUTO { + p.From.Offset += int64(deltasp) - int64(bpsize) + } + if a == obj.NAME_PARAM { + p.From.Offset += int64(deltasp) + int64(pcsize) + } + if p.From3 != nil { + a = int(p.From3.Name) + if a == obj.NAME_AUTO { + p.From3.Offset += int64(deltasp) - int64(bpsize) + } + if a == obj.NAME_PARAM { + p.From3.Offset += int64(deltasp) + int64(pcsize) + } + } + a = int(p.To.Name) + if a == obj.NAME_AUTO { + p.To.Offset += int64(deltasp) - int64(bpsize) + } + if a == obj.NAME_PARAM { + p.To.Offset += int64(deltasp) + int64(pcsize) + } + + switch p.As { + default: + continue + + case APUSHL, APUSHFL: + deltasp += 4 + p.Spadj = 4 + continue + + case APUSHQ, APUSHFQ: + deltasp += 8 + p.Spadj = 8 + continue + + case APUSHW, APUSHFW: + deltasp += 2 + p.Spadj = 2 + continue + + case APOPL, APOPFL: + deltasp -= 4 + p.Spadj = -4 + continue + + case APOPQ, APOPFQ: + deltasp -= 8 + p.Spadj = -8 + continue + + case APOPW, APOPFW: + deltasp -= 2 + p.Spadj = -2 + continue + + case obj.ARET: + break + } + + if autoffset != deltasp { + ctxt.Diag("unbalanced PUSH/POP") + } + + if autoffset != 0 { + if bpsize > 0 { + // Restore caller's BP + p.As = AMOVQ + + p.From.Type = obj.TYPE_MEM + p.From.Reg = REG_SP + p.From.Scale = 1 + p.From.Offset = int64(autoffset) - int64(bpsize) + p.To.Type = obj.TYPE_REG + p.To.Reg = REG_BP + p = obj.Appendp(ctxt, p) + } + + p.As = AADJSP + p.From.Type = obj.TYPE_CONST + p.From.Offset = int64(-autoffset) + p.Spadj = -autoffset + p = obj.Appendp(ctxt, p) + p.As = obj.ARET + + // If there are instructions following + // this ARET, they come from a branch + // with the same stackframe, so undo + // the cleanup. + p.Spadj = +autoffset + } + + if p.To.Sym != nil { // retjmp + p.As = obj.AJMP + } + } +} + +func indir_cx(ctxt *obj.Link, p *obj.Prog, a *obj.Addr) { + if ctxt.Headtype == obj.Hnacl && p.Mode == 64 { + a.Type = obj.TYPE_MEM + a.Reg = REG_R15 + a.Index = REG_CX + a.Scale = 1 + return + } + + a.Type = obj.TYPE_MEM + a.Reg = REG_CX +} + +// Append code to p to load g into cx. +// Overwrites p with the first instruction (no first appendp). +// Overwriting p is unusual but it lets use this in both the +// prologue (caller must call appendp first) and in the epilogue. +// Returns last new instruction. +func load_g_cx(ctxt *obj.Link, p *obj.Prog) *obj.Prog { + p.As = AMOVQ + if ctxt.Arch.Ptrsize == 4 { + p.As = AMOVL + } + p.From.Type = obj.TYPE_MEM + p.From.Reg = REG_TLS + p.From.Offset = 0 + p.To.Type = obj.TYPE_REG + p.To.Reg = REG_CX + + next := p.Link + progedit(ctxt, p) + for p.Link != next { + p = p.Link + } + + if p.From.Index == REG_TLS { + p.From.Scale = 2 + } + + return p +} + +// Append code to p to check for stack split. +// Appends to (does not overwrite) p. +// Assumes g is in CX. +// Returns last new instruction. +func stacksplit(ctxt *obj.Link, p *obj.Prog, framesize int32, textarg int32) *obj.Prog { + cmp := ACMPQ + lea := ALEAQ + mov := AMOVQ + sub := ASUBQ + + if ctxt.Headtype == obj.Hnacl || p.Mode == 32 { + cmp = ACMPL + lea = ALEAL + mov = AMOVL + sub = ASUBL + } + + var q1 *obj.Prog + if framesize <= obj.StackSmall { + // small stack: SP <= stackguard + // CMPQ SP, stackguard + p = obj.Appendp(ctxt, p) + + p.As = int16(cmp) + p.From.Type = obj.TYPE_REG + p.From.Reg = REG_SP + indir_cx(ctxt, p, &p.To) + p.To.Offset = 2 * int64(ctxt.Arch.Ptrsize) // G.stackguard0 + if ctxt.Cursym.Cfunc != 0 { + p.To.Offset = 3 * int64(ctxt.Arch.Ptrsize) // G.stackguard1 + } + } else if framesize <= obj.StackBig { + // large stack: SP-framesize <= stackguard-StackSmall + // LEAQ -xxx(SP), AX + // CMPQ AX, stackguard + p = obj.Appendp(ctxt, p) + + p.As = int16(lea) + p.From.Type = obj.TYPE_MEM + p.From.Reg = REG_SP + p.From.Offset = -(int64(framesize) - obj.StackSmall) + p.To.Type = obj.TYPE_REG + p.To.Reg = REG_AX + + p = obj.Appendp(ctxt, p) + p.As = int16(cmp) + p.From.Type = obj.TYPE_REG + p.From.Reg = REG_AX + indir_cx(ctxt, p, &p.To) + p.To.Offset = 2 * int64(ctxt.Arch.Ptrsize) // G.stackguard0 + if ctxt.Cursym.Cfunc != 0 { + p.To.Offset = 3 * int64(ctxt.Arch.Ptrsize) // G.stackguard1 + } + } else { + // Such a large stack we need to protect against wraparound. + // If SP is close to zero: + // SP-stackguard+StackGuard <= framesize + (StackGuard-StackSmall) + // The +StackGuard on both sides is required to keep the left side positive: + // SP is allowed to be slightly below stackguard. See stack.h. + // + // Preemption sets stackguard to StackPreempt, a very large value. + // That breaks the math above, so we have to check for that explicitly. + // MOVQ stackguard, CX + // CMPQ CX, $StackPreempt + // JEQ label-of-call-to-morestack + // LEAQ StackGuard(SP), AX + // SUBQ CX, AX + // CMPQ AX, $(framesize+(StackGuard-StackSmall)) + + p = obj.Appendp(ctxt, p) + + p.As = int16(mov) + indir_cx(ctxt, p, &p.From) + p.From.Offset = 2 * int64(ctxt.Arch.Ptrsize) // G.stackguard0 + if ctxt.Cursym.Cfunc != 0 { + p.From.Offset = 3 * int64(ctxt.Arch.Ptrsize) // G.stackguard1 + } + p.To.Type = obj.TYPE_REG + p.To.Reg = REG_SI + + p = obj.Appendp(ctxt, p) + p.As = int16(cmp) + p.From.Type = obj.TYPE_REG + p.From.Reg = REG_SI + p.To.Type = obj.TYPE_CONST + p.To.Offset = obj.StackPreempt + if p.Mode == 32 { + p.To.Offset = int64(uint32(obj.StackPreempt & (1<<32 - 1))) + } + + p = obj.Appendp(ctxt, p) + p.As = AJEQ + p.To.Type = obj.TYPE_BRANCH + q1 = p + + p = obj.Appendp(ctxt, p) + p.As = int16(lea) + p.From.Type = obj.TYPE_MEM + p.From.Reg = REG_SP + p.From.Offset = obj.StackGuard + p.To.Type = obj.TYPE_REG + p.To.Reg = REG_AX + + p = obj.Appendp(ctxt, p) + p.As = int16(sub) + p.From.Type = obj.TYPE_REG + p.From.Reg = REG_SI + p.To.Type = obj.TYPE_REG + p.To.Reg = REG_AX + + p = obj.Appendp(ctxt, p) + p.As = int16(cmp) + p.From.Type = obj.TYPE_REG + p.From.Reg = REG_AX + p.To.Type = obj.TYPE_CONST + p.To.Offset = int64(framesize) + (obj.StackGuard - obj.StackSmall) + } + + // common + jls := obj.Appendp(ctxt, p) + jls.As = AJLS + jls.To.Type = obj.TYPE_BRANCH + + var last *obj.Prog + for last = ctxt.Cursym.Text; last.Link != nil; last = last.Link { + } + + call := obj.Appendp(ctxt, last) + call.Lineno = ctxt.Cursym.Text.Lineno + call.Mode = ctxt.Cursym.Text.Mode + call.As = obj.ACALL + call.To.Type = obj.TYPE_BRANCH + morestack := "runtime.morestack" + switch { + case ctxt.Cursym.Cfunc != 0: + morestack = "runtime.morestackc" + case ctxt.Cursym.Text.From3Offset()&obj.NEEDCTXT == 0: + morestack = "runtime.morestack_noctxt" + } + call.To.Sym = obj.Linklookup(ctxt, morestack, 0) + + jmp := obj.Appendp(ctxt, call) + jmp.As = obj.AJMP + jmp.To.Type = obj.TYPE_BRANCH + jmp.Pcond = ctxt.Cursym.Text.Link + + jls.Pcond = call + if q1 != nil { + q1.Pcond = call + } + + return jls +} + +func follow(ctxt *obj.Link, s *obj.LSym) { + ctxt.Cursym = s + + firstp := ctxt.NewProg() + lastp := firstp + xfol(ctxt, s.Text, &lastp) + lastp.Link = nil + s.Text = firstp.Link +} + +func nofollow(a int) bool { + switch a { + case obj.AJMP, + obj.ARET, + AIRETL, + AIRETQ, + AIRETW, + ARETFL, + ARETFQ, + ARETFW, + obj.AUNDEF: + return true + } + + return false +} + +func pushpop(a int) bool { + switch a { + case APUSHL, + APUSHFL, + APUSHQ, + APUSHFQ, + APUSHW, + APUSHFW, + APOPL, + APOPFL, + APOPQ, + APOPFQ, + APOPW, + APOPFW: + return true + } + + return false +} + +func relinv(a int16) int16 { + switch a { + case AJEQ: + return AJNE + case AJNE: + return AJEQ + case AJLE: + return AJGT + case AJLS: + return AJHI + case AJLT: + return AJGE + case AJMI: + return AJPL + case AJGE: + return AJLT + case AJPL: + return AJMI + case AJGT: + return AJLE + case AJHI: + return AJLS + case AJCS: + return AJCC + case AJCC: + return AJCS + case AJPS: + return AJPC + case AJPC: + return AJPS + case AJOS: + return AJOC + case AJOC: + return AJOS + } + + log.Fatalf("unknown relation: %s", obj.Aconv(int(a))) + return 0 +} + +func xfol(ctxt *obj.Link, p *obj.Prog, last **obj.Prog) { + var q *obj.Prog + var i int + var a int + +loop: + if p == nil { + return + } + if p.As == obj.AJMP { + q = p.Pcond + if q != nil && q.As != obj.ATEXT { + /* mark instruction as done and continue layout at target of jump */ + p.Mark = 1 + + p = q + if p.Mark == 0 { + goto loop + } + } + } + + if p.Mark != 0 { + /* + * p goes here, but already used it elsewhere. + * copy up to 4 instructions or else branch to other copy. + */ + i = 0 + q = p + for ; i < 4; i, q = i+1, q.Link { + if q == nil { + break + } + if q == *last { + break + } + a = int(q.As) + if a == obj.ANOP { + i-- + continue + } + + if nofollow(a) || pushpop(a) { + break // NOTE(rsc): arm does goto copy + } + if q.Pcond == nil || q.Pcond.Mark != 0 { + continue + } + if a == obj.ACALL || a == ALOOP { + continue + } + for { + if p.As == obj.ANOP { + p = p.Link + continue + } + + q = obj.Copyp(ctxt, p) + p = p.Link + q.Mark = 1 + (*last).Link = q + *last = q + if int(q.As) != a || q.Pcond == nil || q.Pcond.Mark != 0 { + continue + } + + q.As = relinv(q.As) + p = q.Pcond + q.Pcond = q.Link + q.Link = p + xfol(ctxt, q.Link, last) + p = q.Link + if p.Mark != 0 { + return + } + goto loop + /* */ + } + } + q = ctxt.NewProg() + q.As = obj.AJMP + q.Lineno = p.Lineno + q.To.Type = obj.TYPE_BRANCH + q.To.Offset = p.Pc + q.Pcond = p + p = q + } + + /* emit p */ + p.Mark = 1 + + (*last).Link = p + *last = p + a = int(p.As) + + /* continue loop with what comes after p */ + if nofollow(a) { + return + } + if p.Pcond != nil && a != obj.ACALL { + /* + * some kind of conditional branch. + * recurse to follow one path. + * continue loop on the other. + */ + q = obj.Brchain(ctxt, p.Pcond) + if q != nil { + p.Pcond = q + } + q = obj.Brchain(ctxt, p.Link) + if q != nil { + p.Link = q + } + if p.From.Type == obj.TYPE_CONST { + if p.From.Offset == 1 { + /* + * expect conditional jump to be taken. + * rewrite so that's the fall-through case. + */ + p.As = relinv(int16(a)) + + q = p.Link + p.Link = p.Pcond + p.Pcond = q + } + } else { + q = p.Link + if q.Mark != 0 { + if a != ALOOP { + p.As = relinv(int16(a)) + p.Link = p.Pcond + p.Pcond = q + } + } + } + + xfol(ctxt, p.Link, last) + if p.Pcond.Mark != 0 { + return + } + p = p.Pcond + goto loop + } + + p = p.Link + goto loop +} + +var unaryDst = map[int]bool{ + ABSWAPL: true, + ABSWAPQ: true, + ACMPXCHG8B: true, + ADECB: true, + ADECL: true, + ADECQ: true, + ADECW: true, + AINCB: true, + AINCL: true, + AINCQ: true, + AINCW: true, + ANEGB: true, + ANEGL: true, + ANEGQ: true, + ANEGW: true, + ANOTB: true, + ANOTL: true, + ANOTQ: true, + ANOTW: true, + APOPL: true, + APOPQ: true, + APOPW: true, + ASETCC: true, + ASETCS: true, + ASETEQ: true, + ASETGE: true, + ASETGT: true, + ASETHI: true, + ASETLE: true, + ASETLS: true, + ASETLT: true, + ASETMI: true, + ASETNE: true, + ASETOC: true, + ASETOS: true, + ASETPC: true, + ASETPL: true, + ASETPS: true, + AFFREE: true, + AFLDENV: true, + AFSAVE: true, + AFSTCW: true, + AFSTENV: true, + AFSTSW: true, + AFXSAVE: true, + AFXSAVE64: true, + ASTMXCSR: true, +} + +var Linkamd64 = obj.LinkArch{ + ByteOrder: binary.LittleEndian, + Name: "amd64", + Thechar: '6', + Preprocess: preprocess, + Assemble: span6, + Follow: follow, + Progedit: progedit, + UnaryDst: unaryDst, + Minlc: 1, + Ptrsize: 8, + Regsize: 8, +} + +var Linkamd64p32 = obj.LinkArch{ + ByteOrder: binary.LittleEndian, + Name: "amd64p32", + Thechar: '6', + Preprocess: preprocess, + Assemble: span6, + Follow: follow, + Progedit: progedit, + UnaryDst: unaryDst, + Minlc: 1, + Ptrsize: 4, + Regsize: 8, +} + +var Link386 = obj.LinkArch{ + ByteOrder: binary.LittleEndian, + Name: "386", + Thechar: '8', + Preprocess: preprocess, + Assemble: span6, + Follow: follow, + Progedit: progedit, + UnaryDst: unaryDst, + Minlc: 1, + Ptrsize: 4, + Regsize: 4, +} diff --git a/src/cmd/internal/obj/x86/obj6_test.go b/src/cmd/internal/obj/x86/obj6_test.go new file mode 100644 index 0000000000000000000000000000000000000000..63021075367c3e5461e1505e673cf4c1e4235f4a --- /dev/null +++ b/src/cmd/internal/obj/x86/obj6_test.go @@ -0,0 +1,170 @@ +package x86_test + +import ( + "bufio" + "bytes" + "fmt" + "go/build" + "internal/testenv" + "io/ioutil" + "os" + "os/exec" + "path/filepath" + "regexp" + "strconv" + "strings" + "testing" +) + +const testdata = ` +MOVQ AX, AX -> MOVQ AX, AX + +LEAQ name(SB), AX -> MOVQ name@GOT(SB), AX +LEAQ name+10(SB), AX -> MOVQ name@GOT(SB), AX; ADDQ $10, AX +MOVQ $name(SB), AX -> MOVQ name@GOT(SB), AX +MOVQ $name+10(SB), AX -> MOVQ name@GOT(SB), AX; ADDQ $10, AX + +MOVQ name(SB), AX -> MOVQ name@GOT(SB), R15; MOVQ (R15), AX +MOVQ name+10(SB), AX -> MOVQ name@GOT(SB), R15; MOVQ 10(R15), AX + +CMPQ name(SB), $0 -> MOVQ name@GOT(SB), R15; CMPQ (R15), $0 + +MOVQ $1, name(SB) -> MOVQ name@GOT(SB), R15; MOVQ $1, (R15) +MOVQ $1, name+10(SB) -> MOVQ name@GOT(SB), R15; MOVQ $1, 10(R15) +` + +type ParsedTestData struct { + input string + marks []int + marker_to_input map[int][]string + marker_to_expected map[int][]string + marker_to_output map[int][]string +} + +const marker_start = 1234 + +func parseTestData(t *testing.T) *ParsedTestData { + r := &ParsedTestData{} + scanner := bufio.NewScanner(strings.NewReader(testdata)) + r.marker_to_input = make(map[int][]string) + r.marker_to_expected = make(map[int][]string) + marker := marker_start + input_insns := []string{} + for scanner.Scan() { + line := scanner.Text() + if len(strings.TrimSpace(line)) == 0 { + continue + } + parts := strings.Split(line, "->") + if len(parts) != 2 { + t.Fatalf("malformed line %v", line) + } + r.marks = append(r.marks, marker) + marker_insn := fmt.Sprintf("MOVQ $%d, AX", marker) + input_insns = append(input_insns, marker_insn) + for _, input_insn := range strings.Split(parts[0], ";") { + input_insns = append(input_insns, input_insn) + r.marker_to_input[marker] = append(r.marker_to_input[marker], normalize(input_insn)) + } + for _, expected_insn := range strings.Split(parts[1], ";") { + r.marker_to_expected[marker] = append(r.marker_to_expected[marker], normalize(expected_insn)) + } + marker++ + } + r.input = "TEXT ·foo(SB),$0\n" + strings.Join(input_insns, "\n") + "\n" + return r +} + +var spaces_re *regexp.Regexp = regexp.MustCompile("\\s+") +var marker_re *regexp.Regexp = regexp.MustCompile("MOVQ \\$([0-9]+), AX") + +func normalize(s string) string { + return spaces_re.ReplaceAllLiteralString(strings.TrimSpace(s), " ") +} + +func asmOutput(t *testing.T, s string) []byte { + tmpdir, err := ioutil.TempDir("", "progedittest") + if err != nil { + t.Fatal(err) + } + defer os.RemoveAll(tmpdir) + tmpfile, err := os.Create(filepath.Join(tmpdir, "input.s")) + if err != nil { + t.Fatal(err) + } + defer tmpfile.Close() + _, err = tmpfile.WriteString(s) + if err != nil { + t.Fatal(err) + } + gofolder := filepath.Join(build.Default.GOROOT, "bin") + if gobin := os.Getenv("GOBIN"); len(gobin) != 0 { + gofolder = gobin + } + + cmd := exec.Command( + filepath.Join(gofolder, "go"), "tool", "asm", "-S", "-dynlink", + "-o", filepath.Join(tmpdir, "output.6"), tmpfile.Name()) + + var env []string + for _, v := range os.Environ() { + if !strings.HasPrefix(v, "GOARCH=") { + env = append(env, v) + } + } + cmd.Env = append(env, "GOARCH=amd64") + asmout, err := cmd.CombinedOutput() + if err != nil { + t.Fatalf("error %s output %s", err, asmout) + } + return asmout +} + +func parseOutput(t *testing.T, td *ParsedTestData, asmout []byte) { + scanner := bufio.NewScanner(bytes.NewReader(asmout)) + marker := regexp.MustCompile("MOVQ \\$([0-9]+), AX") + mark := -1 + td.marker_to_output = make(map[int][]string) + for scanner.Scan() { + line := scanner.Text() + if line[0] != '\t' { + continue + } + parts := strings.SplitN(line, "\t", 3) + if len(parts) != 3 { + continue + } + n := normalize(parts[2]) + mark_matches := marker.FindStringSubmatch(n) + if mark_matches != nil { + mark, _ = strconv.Atoi(mark_matches[1]) + if _, ok := td.marker_to_input[mark]; !ok { + t.Fatalf("unexpected marker %d", mark) + } + } else if mark != -1 { + td.marker_to_output[mark] = append(td.marker_to_output[mark], n) + } + } +} + +func TestDynlink(t *testing.T) { + testenv.MustHaveGoBuild(t) + + testdata := parseTestData(t) + asmout := asmOutput(t, testdata.input) + parseOutput(t, testdata, asmout) + for _, m := range testdata.marks { + i := strings.Join(testdata.marker_to_input[m], "; ") + o := strings.Join(testdata.marker_to_output[m], "; ") + e := strings.Join(testdata.marker_to_expected[m], "; ") + if o != e { + if o == i { + t.Errorf("%s was unchanged; should have become %s", i, e) + } else { + t.Errorf("%s became %s; should have become %s", i, o, e) + } + } else if i != e { + t.Logf("%s correctly became %s", i, o) + } + } +} diff --git a/src/cmd/internal/objfile/disasm.go b/src/cmd/internal/objfile/disasm.go new file mode 100644 index 0000000000000000000000000000000000000000..9838ce2856f3145378620b1693327806e2b4bc8c --- /dev/null +++ b/src/cmd/internal/objfile/disasm.go @@ -0,0 +1,248 @@ +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package objfile + +import ( + "bufio" + "debug/gosym" + "encoding/binary" + "fmt" + "io" + "regexp" + "sort" + "strings" + "text/tabwriter" + + "cmd/internal/rsc.io/arm/armasm" + "cmd/internal/rsc.io/x86/x86asm" +) + +// Disasm is a disassembler for a given File. +type Disasm struct { + syms []Sym //symbols in file, sorted by address + pcln *gosym.Table // pcln table + text []byte // bytes of text segment (actual instructions) + textStart uint64 // start PC of text + textEnd uint64 // end PC of text + goarch string // GOARCH string + disasm disasmFunc // disassembler function for goarch + byteOrder binary.ByteOrder // byte order for goarch +} + +// Disasm returns a disassembler for the file f. +func (f *File) Disasm() (*Disasm, error) { + syms, err := f.Symbols() + if err != nil { + return nil, err + } + + pcln, err := f.PCLineTable() + if err != nil { + return nil, err + } + + textStart, textBytes, err := f.Text() + if err != nil { + return nil, err + } + + goarch := f.GOARCH() + disasm := disasms[goarch] + byteOrder := byteOrders[goarch] + if disasm == nil || byteOrder == nil { + return nil, fmt.Errorf("unsupported architecture") + } + + // Filter out section symbols, overwriting syms in place. + keep := syms[:0] + for _, sym := range syms { + switch sym.Name { + case "runtime.text", "text", "_text", "runtime.etext", "etext", "_etext": + // drop + default: + keep = append(keep, sym) + } + } + syms = keep + d := &Disasm{ + syms: syms, + pcln: pcln, + text: textBytes, + textStart: textStart, + textEnd: textStart + uint64(len(textBytes)), + goarch: goarch, + disasm: disasm, + byteOrder: byteOrder, + } + + return d, nil +} + +// lookup finds the symbol name containing addr. +func (d *Disasm) lookup(addr uint64) (name string, base uint64) { + i := sort.Search(len(d.syms), func(i int) bool { return addr < d.syms[i].Addr }) + if i > 0 { + s := d.syms[i-1] + if s.Addr != 0 && s.Addr <= addr && addr < s.Addr+uint64(s.Size) { + return s.Name, s.Addr + } + } + return "", 0 +} + +// base returns the final element in the path. +// It works on both Windows and Unix paths, +// regardless of host operating system. +func base(path string) string { + path = path[strings.LastIndex(path, "/")+1:] + path = path[strings.LastIndex(path, `\`)+1:] + return path +} + +// Print prints a disassembly of the file to w. +// If filter is non-nil, the disassembly only includes functions with names matching filter. +// The disassembly only includes functions that overlap the range [start, end). +func (d *Disasm) Print(w io.Writer, filter *regexp.Regexp, start, end uint64) { + if start < d.textStart { + start = d.textStart + } + if end > d.textEnd { + end = d.textEnd + } + printed := false + bw := bufio.NewWriter(w) + for _, sym := range d.syms { + symStart := sym.Addr + symEnd := sym.Addr + uint64(sym.Size) + if sym.Code != 'T' && sym.Code != 't' || + symStart < d.textStart || + symEnd <= start || end <= symStart || + filter != nil && !filter.MatchString(sym.Name) { + continue + } + if printed { + fmt.Fprintf(bw, "\n") + } + printed = true + + file, _, _ := d.pcln.PCToLine(sym.Addr) + fmt.Fprintf(bw, "TEXT %s(SB) %s\n", sym.Name, file) + + tw := tabwriter.NewWriter(bw, 1, 8, 1, '\t', 0) + if symEnd > end { + symEnd = end + } + code := d.text[:end-d.textStart] + d.Decode(symStart, symEnd, func(pc, size uint64, file string, line int, text string) { + i := pc - d.textStart + fmt.Fprintf(tw, "\t%s:%d\t%#x\t", base(file), line, pc) + if size%4 != 0 || d.goarch == "386" || d.goarch == "amd64" { + // Print instruction as bytes. + fmt.Fprintf(tw, "%x", code[i:i+size]) + } else { + // Print instruction as 32-bit words. + for j := uint64(0); j < size; j += 4 { + if j > 0 { + fmt.Fprintf(tw, " ") + } + fmt.Fprintf(tw, "%08x", d.byteOrder.Uint32(code[i+j:])) + } + } + fmt.Fprintf(tw, "\t%s\n", text) + }) + tw.Flush() + } + bw.Flush() +} + +// Decode disassembles the text segment range [start, end), calling f for each instruction. +func (d *Disasm) Decode(start, end uint64, f func(pc, size uint64, file string, line int, text string)) { + if start < d.textStart { + start = d.textStart + } + if end > d.textEnd { + end = d.textEnd + } + code := d.text[:end-d.textStart] + lookup := d.lookup + for pc := start; pc < end; { + i := pc - d.textStart + text, size := d.disasm(code[i:], pc, lookup) + file, line, _ := d.pcln.PCToLine(pc) + f(pc, uint64(size), file, line, text) + pc += uint64(size) + } +} + +type lookupFunc func(addr uint64) (sym string, base uint64) +type disasmFunc func(code []byte, pc uint64, lookup lookupFunc) (text string, size int) + +func disasm_386(code []byte, pc uint64, lookup lookupFunc) (string, int) { + return disasm_x86(code, pc, lookup, 32) +} + +func disasm_amd64(code []byte, pc uint64, lookup lookupFunc) (string, int) { + return disasm_x86(code, pc, lookup, 64) +} + +func disasm_x86(code []byte, pc uint64, lookup lookupFunc, arch int) (string, int) { + inst, err := x86asm.Decode(code, 64) + var text string + size := inst.Len + if err != nil || size == 0 || inst.Op == 0 { + size = 1 + text = "?" + } else { + text = x86asm.Plan9Syntax(inst, pc, lookup) + } + return text, size +} + +type textReader struct { + code []byte + pc uint64 +} + +func (r textReader) ReadAt(data []byte, off int64) (n int, err error) { + if off < 0 || uint64(off) < r.pc { + return 0, io.EOF + } + d := uint64(off) - r.pc + if d >= uint64(len(r.code)) { + return 0, io.EOF + } + n = copy(data, r.code[d:]) + if n < len(data) { + err = io.ErrUnexpectedEOF + } + return +} + +func disasm_arm(code []byte, pc uint64, lookup lookupFunc) (string, int) { + inst, err := armasm.Decode(code, armasm.ModeARM) + var text string + size := inst.Len + if err != nil || size == 0 || inst.Op == 0 { + size = 4 + text = "?" + } else { + text = armasm.Plan9Syntax(inst, pc, lookup, textReader{code, pc}) + } + return text, size +} + +var disasms = map[string]disasmFunc{ + "386": disasm_386, + "amd64": disasm_amd64, + "arm": disasm_arm, +} + +var byteOrders = map[string]binary.ByteOrder{ + "386": binary.LittleEndian, + "amd64": binary.LittleEndian, + "arm": binary.LittleEndian, + "ppc64": binary.BigEndian, + "ppc64le": binary.LittleEndian, +} diff --git a/src/cmd/internal/objfile/elf.go b/src/cmd/internal/objfile/elf.go new file mode 100644 index 0000000000000000000000000000000000000000..305706d4341e722260dba70d58c62c0c166471fe --- /dev/null +++ b/src/cmd/internal/objfile/elf.go @@ -0,0 +1,104 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Parsing of ELF executables (Linux, FreeBSD, and so on). + +package objfile + +import ( + "debug/elf" + "fmt" + "os" +) + +type elfFile struct { + elf *elf.File +} + +func openElf(r *os.File) (rawFile, error) { + f, err := elf.NewFile(r) + if err != nil { + return nil, err + } + return &elfFile{f}, nil +} + +func (f *elfFile) symbols() ([]Sym, error) { + elfSyms, err := f.elf.Symbols() + if err != nil { + return nil, err + } + + var syms []Sym + for _, s := range elfSyms { + sym := Sym{Addr: s.Value, Name: s.Name, Size: int64(s.Size), Code: '?'} + switch s.Section { + case elf.SHN_UNDEF: + sym.Code = 'U' + case elf.SHN_COMMON: + sym.Code = 'B' + default: + i := int(s.Section) + if i < 0 || i >= len(f.elf.Sections) { + break + } + sect := f.elf.Sections[i] + switch sect.Flags & (elf.SHF_WRITE | elf.SHF_ALLOC | elf.SHF_EXECINSTR) { + case elf.SHF_ALLOC | elf.SHF_EXECINSTR: + sym.Code = 'T' + case elf.SHF_ALLOC: + sym.Code = 'R' + case elf.SHF_ALLOC | elf.SHF_WRITE: + sym.Code = 'D' + } + } + if elf.ST_BIND(s.Info) == elf.STB_LOCAL { + sym.Code += 'a' - 'A' + } + syms = append(syms, sym) + } + + return syms, nil +} + +func (f *elfFile) pcln() (textStart uint64, symtab, pclntab []byte, err error) { + if sect := f.elf.Section(".text"); sect != nil { + textStart = sect.Addr + } + if sect := f.elf.Section(".gosymtab"); sect != nil { + if symtab, err = sect.Data(); err != nil { + return 0, nil, nil, err + } + } + if sect := f.elf.Section(".gopclntab"); sect != nil { + if pclntab, err = sect.Data(); err != nil { + return 0, nil, nil, err + } + } + return textStart, symtab, pclntab, nil +} + +func (f *elfFile) text() (textStart uint64, text []byte, err error) { + sect := f.elf.Section(".text") + if sect == nil { + return 0, nil, fmt.Errorf("text section not found") + } + textStart = sect.Addr + text, err = sect.Data() + return +} + +func (f *elfFile) goarch() string { + switch f.elf.Machine { + case elf.EM_386: + return "386" + case elf.EM_X86_64: + return "amd64" + case elf.EM_ARM: + return "arm" + case elf.EM_PPC64: + return "ppc64" + } + return "" +} diff --git a/src/cmd/internal/objfile/goobj.go b/src/cmd/internal/objfile/goobj.go new file mode 100644 index 0000000000000000000000000000000000000000..6b1607a1725a5b598bb0f1fcbac2cb77080db9c0 --- /dev/null +++ b/src/cmd/internal/objfile/goobj.go @@ -0,0 +1,93 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Parsing of Go intermediate object files and archives. + +package objfile + +import ( + "cmd/internal/goobj" + "fmt" + "os" +) + +type goobjFile struct { + goobj *goobj.Package +} + +func openGoobj(r *os.File) (rawFile, error) { + f, err := goobj.Parse(r, `""`) + if err != nil { + return nil, err + } + return &goobjFile{f}, nil +} + +func goobjName(id goobj.SymID) string { + if id.Version == 0 { + return id.Name + } + return fmt.Sprintf("%s<%d>", id.Name, id.Version) +} + +func (f *goobjFile) symbols() ([]Sym, error) { + seen := make(map[goobj.SymID]bool) + + var syms []Sym + for _, s := range f.goobj.Syms { + seen[s.SymID] = true + sym := Sym{Addr: uint64(s.Data.Offset), Name: goobjName(s.SymID), Size: int64(s.Size), Type: s.Type.Name, Code: '?'} + switch s.Kind { + case goobj.STEXT, goobj.SELFRXSECT: + sym.Code = 'T' + case goobj.STYPE, goobj.SSTRING, goobj.SGOSTRING, goobj.SGOFUNC, goobj.SRODATA, goobj.SFUNCTAB, goobj.STYPELINK, goobj.SSYMTAB, goobj.SPCLNTAB, goobj.SELFROSECT: + sym.Code = 'R' + case goobj.SMACHOPLT, goobj.SELFSECT, goobj.SMACHO, goobj.SMACHOGOT, goobj.SNOPTRDATA, goobj.SINITARR, goobj.SDATA, goobj.SWINDOWS: + sym.Code = 'D' + case goobj.SBSS, goobj.SNOPTRBSS, goobj.STLSBSS: + sym.Code = 'B' + case goobj.SXREF, goobj.SMACHOSYMSTR, goobj.SMACHOSYMTAB, goobj.SMACHOINDIRECTPLT, goobj.SMACHOINDIRECTGOT, goobj.SFILE, goobj.SFILEPATH, goobj.SCONST, goobj.SDYNIMPORT, goobj.SHOSTOBJ: + sym.Code = 'X' // should not see + } + if s.Version != 0 { + sym.Code += 'a' - 'A' + } + syms = append(syms, sym) + } + + for _, s := range f.goobj.Syms { + for _, r := range s.Reloc { + if !seen[r.Sym] { + seen[r.Sym] = true + sym := Sym{Name: goobjName(r.Sym), Code: 'U'} + if s.Version != 0 { + // should not happen but handle anyway + sym.Code = 'u' + } + syms = append(syms, sym) + } + } + } + + return syms, nil +} + +// pcln does not make sense for Go object files, because each +// symbol has its own individual pcln table, so there is no global +// space of addresses to map. +func (f *goobjFile) pcln() (textStart uint64, symtab, pclntab []byte, err error) { + return 0, nil, nil, fmt.Errorf("pcln not available in go object file") +} + +// text does not make sense for Go object files, because +// each function has a separate section. +func (f *goobjFile) text() (textStart uint64, text []byte, err error) { + return 0, nil, fmt.Errorf("text not available in go object file") +} + +// goarch makes sense but is not exposed in debug/goobj's API, +// and we don't need it yet for any users of internal/objfile. +func (f *goobjFile) goarch() string { + return "GOARCH unimplemented for debug/goobj files" +} diff --git a/src/cmd/internal/objfile/macho.go b/src/cmd/internal/objfile/macho.go new file mode 100644 index 0000000000000000000000000000000000000000..7371c0d9d1cb80da06f8a56cc6b5f3b895db4715 --- /dev/null +++ b/src/cmd/internal/objfile/macho.go @@ -0,0 +1,125 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Parsing of Mach-O executables (OS X). + +package objfile + +import ( + "debug/macho" + "fmt" + "os" + "sort" +) + +const stabTypeMask = 0xe0 + +type machoFile struct { + macho *macho.File +} + +func openMacho(r *os.File) (rawFile, error) { + f, err := macho.NewFile(r) + if err != nil { + return nil, err + } + return &machoFile{f}, nil +} + +func (f *machoFile) symbols() ([]Sym, error) { + if f.macho.Symtab == nil { + return nil, fmt.Errorf("missing symbol table") + } + + // Build sorted list of addresses of all symbols. + // We infer the size of a symbol by looking at where the next symbol begins. + var addrs []uint64 + for _, s := range f.macho.Symtab.Syms { + // Skip stab debug info. + if s.Type&stabTypeMask == 0 { + addrs = append(addrs, s.Value) + } + } + sort.Sort(uint64s(addrs)) + + var syms []Sym + for _, s := range f.macho.Symtab.Syms { + if s.Type&stabTypeMask != 0 { + // Skip stab debug info. + continue + } + sym := Sym{Name: s.Name, Addr: s.Value, Code: '?'} + i := sort.Search(len(addrs), func(x int) bool { return addrs[x] > s.Value }) + if i < len(addrs) { + sym.Size = int64(addrs[i] - s.Value) + } + if s.Sect == 0 { + sym.Code = 'U' + } else if int(s.Sect) <= len(f.macho.Sections) { + sect := f.macho.Sections[s.Sect-1] + switch sect.Seg { + case "__TEXT": + sym.Code = 'R' + case "__DATA": + sym.Code = 'D' + } + switch sect.Seg + " " + sect.Name { + case "__TEXT __text": + sym.Code = 'T' + case "__DATA __bss", "__DATA __noptrbss": + sym.Code = 'B' + } + } + syms = append(syms, sym) + } + + return syms, nil +} + +func (f *machoFile) pcln() (textStart uint64, symtab, pclntab []byte, err error) { + if sect := f.macho.Section("__text"); sect != nil { + textStart = sect.Addr + } + if sect := f.macho.Section("__gosymtab"); sect != nil { + if symtab, err = sect.Data(); err != nil { + return 0, nil, nil, err + } + } + if sect := f.macho.Section("__gopclntab"); sect != nil { + if pclntab, err = sect.Data(); err != nil { + return 0, nil, nil, err + } + } + return textStart, symtab, pclntab, nil +} + +func (f *machoFile) text() (textStart uint64, text []byte, err error) { + sect := f.macho.Section("__text") + if sect == nil { + return 0, nil, fmt.Errorf("text section not found") + } + textStart = sect.Addr + text, err = sect.Data() + return +} + +func (f *machoFile) goarch() string { + switch f.macho.Cpu { + case macho.Cpu386: + return "386" + case macho.CpuAmd64: + return "amd64" + case macho.CpuArm: + return "arm" + case macho.CpuPpc64: + return "ppc64" + } + return "" +} + +type uint64s []uint64 + +func (x uint64s) Len() int { return len(x) } +func (x uint64s) Swap(i, j int) { x[i], x[j] = x[j], x[i] } +func (x uint64s) Less(i, j int) bool { return x[i] < x[j] } diff --git a/src/cmd/internal/objfile/objfile.go b/src/cmd/internal/objfile/objfile.go new file mode 100644 index 0000000000000000000000000000000000000000..9227ef387ff6ac5ad415a9635f2d72b93b8eacf0 --- /dev/null +++ b/src/cmd/internal/objfile/objfile.go @@ -0,0 +1,94 @@ +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package objfile implements portable access to OS-specific executable files. +package objfile + +import ( + "debug/gosym" + "fmt" + "os" + "sort" +) + +type rawFile interface { + symbols() (syms []Sym, err error) + pcln() (textStart uint64, symtab, pclntab []byte, err error) + text() (textStart uint64, text []byte, err error) + goarch() string +} + +// A File is an opened executable file. +type File struct { + r *os.File + raw rawFile +} + +// A Sym is a symbol defined in an executable file. +type Sym struct { + Name string // symbol name + Addr uint64 // virtual address of symbol + Size int64 // size in bytes + Code rune // nm code (T for text, D for data, and so on) + Type string // XXX? +} + +var openers = []func(*os.File) (rawFile, error){ + openElf, + openGoobj, + openMacho, + openPE, + openPlan9, +} + +// Open opens the named file. +// The caller must call f.Close when the file is no longer needed. +func Open(name string) (*File, error) { + r, err := os.Open(name) + if err != nil { + return nil, err + } + for _, try := range openers { + if raw, err := try(r); err == nil { + return &File{r, raw}, nil + } + } + r.Close() + return nil, fmt.Errorf("open %s: unrecognized object file", name) +} + +func (f *File) Close() error { + return f.r.Close() +} + +func (f *File) Symbols() ([]Sym, error) { + syms, err := f.raw.symbols() + if err != nil { + return nil, err + } + sort.Sort(byAddr(syms)) + return syms, nil +} + +type byAddr []Sym + +func (x byAddr) Less(i, j int) bool { return x[i].Addr < x[j].Addr } +func (x byAddr) Len() int { return len(x) } +func (x byAddr) Swap(i, j int) { x[i], x[j] = x[j], x[i] } + +func (f *File) PCLineTable() (*gosym.Table, error) { + textStart, symtab, pclntab, err := f.raw.pcln() + if err != nil { + return nil, err + } + return gosym.NewTable(symtab, gosym.NewLineTable(pclntab, textStart)) +} + +func (f *File) Text() (uint64, []byte, error) { + return f.raw.text() +} + +func (f *File) GOARCH() string { + return f.raw.goarch() +} diff --git a/src/cmd/internal/objfile/pe.go b/src/cmd/internal/objfile/pe.go new file mode 100644 index 0000000000000000000000000000000000000000..67e59c226b0f85dfaef20eec1183646e8c0ff6dc --- /dev/null +++ b/src/cmd/internal/objfile/pe.go @@ -0,0 +1,201 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Parsing of PE executables (Microsoft Windows). + +package objfile + +import ( + "debug/pe" + "fmt" + "os" + "sort" +) + +type peFile struct { + pe *pe.File +} + +func openPE(r *os.File) (rawFile, error) { + f, err := pe.NewFile(r) + if err != nil { + return nil, err + } + switch f.OptionalHeader.(type) { + case *pe.OptionalHeader32, *pe.OptionalHeader64: + // ok + default: + return nil, fmt.Errorf("unrecognized PE format") + } + return &peFile{f}, nil +} + +func (f *peFile) symbols() ([]Sym, error) { + // Build sorted list of addresses of all symbols. + // We infer the size of a symbol by looking at where the next symbol begins. + var addrs []uint64 + + var imageBase uint64 + switch oh := f.pe.OptionalHeader.(type) { + case *pe.OptionalHeader32: + imageBase = uint64(oh.ImageBase) + case *pe.OptionalHeader64: + imageBase = oh.ImageBase + } + + var syms []Sym + for _, s := range f.pe.Symbols { + const ( + N_UNDEF = 0 // An undefined (extern) symbol + N_ABS = -1 // An absolute symbol (e_value is a constant, not an address) + N_DEBUG = -2 // A debugging symbol + ) + sym := Sym{Name: s.Name, Addr: uint64(s.Value), Code: '?'} + switch s.SectionNumber { + case N_UNDEF: + sym.Code = 'U' + case N_ABS: + sym.Code = 'C' + case N_DEBUG: + sym.Code = '?' + default: + if s.SectionNumber < 0 || len(f.pe.Sections) < int(s.SectionNumber) { + return nil, fmt.Errorf("invalid section number in symbol table") + } + sect := f.pe.Sections[s.SectionNumber-1] + const ( + text = 0x20 + data = 0x40 + bss = 0x80 + permX = 0x20000000 + permR = 0x40000000 + permW = 0x80000000 + ) + ch := sect.Characteristics + switch { + case ch&text != 0: + sym.Code = 'T' + case ch&data != 0: + if ch&permW == 0 { + sym.Code = 'R' + } else { + sym.Code = 'D' + } + case ch&bss != 0: + sym.Code = 'B' + } + sym.Addr += imageBase + uint64(sect.VirtualAddress) + } + syms = append(syms, sym) + addrs = append(addrs, sym.Addr) + } + + sort.Sort(uint64s(addrs)) + for i := range syms { + j := sort.Search(len(addrs), func(x int) bool { return addrs[x] > syms[i].Addr }) + if j < len(addrs) { + syms[i].Size = int64(addrs[j] - syms[i].Addr) + } + } + + return syms, nil +} + +func (f *peFile) pcln() (textStart uint64, symtab, pclntab []byte, err error) { + var imageBase uint64 + switch oh := f.pe.OptionalHeader.(type) { + case *pe.OptionalHeader32: + imageBase = uint64(oh.ImageBase) + case *pe.OptionalHeader64: + imageBase = oh.ImageBase + default: + return 0, nil, nil, fmt.Errorf("pe file format not recognized") + } + if sect := f.pe.Section(".text"); sect != nil { + textStart = imageBase + uint64(sect.VirtualAddress) + } + if pclntab, err = loadPETable(f.pe, "runtime.pclntab", "runtime.epclntab"); err != nil { + // We didn't find the symbols, so look for the names used in 1.3 and earlier. + // TODO: Remove code looking for the old symbols when we no longer care about 1.3. + var err2 error + if pclntab, err2 = loadPETable(f.pe, "pclntab", "epclntab"); err2 != nil { + return 0, nil, nil, err + } + } + if symtab, err = loadPETable(f.pe, "runtime.symtab", "runtime.esymtab"); err != nil { + // Same as above. + var err2 error + if symtab, err2 = loadPETable(f.pe, "symtab", "esymtab"); err2 != nil { + return 0, nil, nil, err + } + } + return textStart, symtab, pclntab, nil +} + +func (f *peFile) text() (textStart uint64, text []byte, err error) { + var imageBase uint64 + switch oh := f.pe.OptionalHeader.(type) { + case *pe.OptionalHeader32: + imageBase = uint64(oh.ImageBase) + case *pe.OptionalHeader64: + imageBase = oh.ImageBase + default: + return 0, nil, fmt.Errorf("pe file format not recognized") + } + sect := f.pe.Section(".text") + if sect == nil { + return 0, nil, fmt.Errorf("text section not found") + } + textStart = imageBase + uint64(sect.VirtualAddress) + text, err = sect.Data() + return +} + +func findPESymbol(f *pe.File, name string) (*pe.Symbol, error) { + for _, s := range f.Symbols { + if s.Name != name { + continue + } + if s.SectionNumber <= 0 { + return nil, fmt.Errorf("symbol %s: invalid section number %d", name, s.SectionNumber) + } + if len(f.Sections) < int(s.SectionNumber) { + return nil, fmt.Errorf("symbol %s: section number %d is larger than max %d", name, s.SectionNumber, len(f.Sections)) + } + return s, nil + } + return nil, fmt.Errorf("no %s symbol found", name) +} + +func loadPETable(f *pe.File, sname, ename string) ([]byte, error) { + ssym, err := findPESymbol(f, sname) + if err != nil { + return nil, err + } + esym, err := findPESymbol(f, ename) + if err != nil { + return nil, err + } + if ssym.SectionNumber != esym.SectionNumber { + return nil, fmt.Errorf("%s and %s symbols must be in the same section", sname, ename) + } + sect := f.Sections[ssym.SectionNumber-1] + data, err := sect.Data() + if err != nil { + return nil, err + } + return data[ssym.Value:esym.Value], nil +} + +func (f *peFile) goarch() string { + // Not sure how to get the info we want from PE header. + // Look in symbol table for telltale rt0 symbol. + if _, err := findPESymbol(f.pe, "_rt0_386_windows"); err == nil { + return "386" + } + if _, err := findPESymbol(f.pe, "_rt0_amd64_windows"); err == nil { + return "amd64" + } + return "" +} diff --git a/src/cmd/internal/objfile/plan9obj.go b/src/cmd/internal/objfile/plan9obj.go new file mode 100644 index 0000000000000000000000000000000000000000..eb6cba5eb1e8f281d7c7a0ba8328da292323acea --- /dev/null +++ b/src/cmd/internal/objfile/plan9obj.go @@ -0,0 +1,146 @@ +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Parsing of Plan 9 a.out executables. + +package objfile + +import ( + "debug/plan9obj" + "fmt" + "os" + "sort" +) + +var validSymType = map[rune]bool{ + 'T': true, + 't': true, + 'D': true, + 'd': true, + 'B': true, + 'b': true, +} + +type plan9File struct { + plan9 *plan9obj.File +} + +func openPlan9(r *os.File) (rawFile, error) { + f, err := plan9obj.NewFile(r) + if err != nil { + return nil, err + } + return &plan9File{f}, nil +} + +func (f *plan9File) symbols() ([]Sym, error) { + plan9Syms, err := f.plan9.Symbols() + if err != nil { + return nil, err + } + + // Build sorted list of addresses of all symbols. + // We infer the size of a symbol by looking at where the next symbol begins. + var addrs []uint64 + for _, s := range plan9Syms { + if !validSymType[s.Type] { + continue + } + addrs = append(addrs, s.Value) + } + sort.Sort(uint64s(addrs)) + + var syms []Sym + + for _, s := range plan9Syms { + if !validSymType[s.Type] { + continue + } + sym := Sym{Addr: s.Value, Name: s.Name, Code: rune(s.Type)} + i := sort.Search(len(addrs), func(x int) bool { return addrs[x] > s.Value }) + if i < len(addrs) { + sym.Size = int64(addrs[i] - s.Value) + } + syms = append(syms, sym) + } + + return syms, nil +} + +func (f *plan9File) pcln() (textStart uint64, symtab, pclntab []byte, err error) { + textStart = f.plan9.LoadAddress + f.plan9.HdrSize + if pclntab, err = loadPlan9Table(f.plan9, "runtime.pclntab", "runtime.epclntab"); err != nil { + // We didn't find the symbols, so look for the names used in 1.3 and earlier. + // TODO: Remove code looking for the old symbols when we no longer care about 1.3. + var err2 error + if pclntab, err2 = loadPlan9Table(f.plan9, "pclntab", "epclntab"); err2 != nil { + return 0, nil, nil, err + } + } + if symtab, err = loadPlan9Table(f.plan9, "runtime.symtab", "runtime.esymtab"); err != nil { + // Same as above. + var err2 error + if symtab, err2 = loadPlan9Table(f.plan9, "symtab", "esymtab"); err2 != nil { + return 0, nil, nil, err + } + } + return textStart, symtab, pclntab, nil +} + +func (f *plan9File) text() (textStart uint64, text []byte, err error) { + sect := f.plan9.Section("text") + if sect == nil { + return 0, nil, fmt.Errorf("text section not found") + } + textStart = f.plan9.LoadAddress + f.plan9.HdrSize + text, err = sect.Data() + return +} + +func findPlan9Symbol(f *plan9obj.File, name string) (*plan9obj.Sym, error) { + syms, err := f.Symbols() + if err != nil { + return nil, err + } + for _, s := range syms { + if s.Name != name { + continue + } + return &s, nil + } + return nil, fmt.Errorf("no %s symbol found", name) +} + +func loadPlan9Table(f *plan9obj.File, sname, ename string) ([]byte, error) { + ssym, err := findPlan9Symbol(f, sname) + if err != nil { + return nil, err + } + esym, err := findPlan9Symbol(f, ename) + if err != nil { + return nil, err + } + sect := f.Section("text") + if sect == nil { + return nil, err + } + data, err := sect.Data() + if err != nil { + return nil, err + } + textStart := f.LoadAddress + f.HdrSize + return data[ssym.Value-textStart : esym.Value-textStart], nil +} + +func (f *plan9File) goarch() string { + switch f.plan9.Magic { + case plan9obj.Magic386: + return "386" + case plan9obj.MagicAMD64: + return "amd64" + case plan9obj.MagicARM: + return "arm" + } + return "" +} diff --git a/src/cmd/internal/rsc.io/arm/armasm/Makefile b/src/cmd/internal/rsc.io/arm/armasm/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..a3f57001f6edfdc4f61a2232bd6f8363fce16734 --- /dev/null +++ b/src/cmd/internal/rsc.io/arm/armasm/Makefile @@ -0,0 +1,2 @@ +tables.go: ../armmap/map.go ../arm.csv + go run ../armmap/map.go -fmt=decoder ../arm.csv >_tables.go && gofmt _tables.go >tables.go && rm _tables.go diff --git a/src/cmd/internal/rsc.io/arm/armasm/decode.go b/src/cmd/internal/rsc.io/arm/armasm/decode.go new file mode 100644 index 0000000000000000000000000000000000000000..6b4d73841be7357be6730ecfe9c05fae4b4d18a8 --- /dev/null +++ b/src/cmd/internal/rsc.io/arm/armasm/decode.go @@ -0,0 +1,567 @@ +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package armasm + +import ( + "encoding/binary" + "fmt" +) + +// An instFormat describes the format of an instruction encoding. +// An instruction with 32-bit value x matches the format if x&mask == value +// and the condition matches. +// The condition matches if x>>28 == 0xF && value>>28==0xF +// or if x>>28 != 0xF and value>>28 == 0. +// If x matches the format, then the rest of the fields describe how to interpret x. +// The opBits describe bits that should be extracted from x and added to the opcode. +// For example opBits = 0x1234 means that the value +// (2 bits at offset 1) followed by (4 bits at offset 3) +// should be added to op. +// Finally the args describe how to decode the instruction arguments. +// args is stored as a fixed-size array; if there are fewer than len(args) arguments, +// args[i] == 0 marks the end of the argument list. +type instFormat struct { + mask uint32 + value uint32 + priority int8 + op Op + opBits uint64 + args instArgs +} + +type instArgs [4]instArg + +var ( + errMode = fmt.Errorf("unsupported execution mode") + errShort = fmt.Errorf("truncated instruction") + errUnknown = fmt.Errorf("unknown instruction") +) + +var decoderCover []bool + +// Decode decodes the leading bytes in src as a single instruction. +func Decode(src []byte, mode Mode) (inst Inst, err error) { + if mode != ModeARM { + return Inst{}, errMode + } + if len(src) < 4 { + return Inst{}, errShort + } + + if decoderCover == nil { + decoderCover = make([]bool, len(instFormats)) + } + + x := binary.LittleEndian.Uint32(src) + + // The instFormat table contains both conditional and unconditional instructions. + // Considering only the top 4 bits, the conditional instructions use mask=0, value=0, + // while the unconditional instructions use mask=f, value=f. + // Prepare a version of x with the condition cleared to 0 in conditional instructions + // and then assume mask=f during matching. + const condMask = 0xf0000000 + xNoCond := x + if x&condMask != condMask { + xNoCond &^= condMask + } + var priority int8 +Search: + for i := range instFormats { + f := &instFormats[i] + if xNoCond&(f.mask|condMask) != f.value || f.priority <= priority { + continue + } + delta := uint32(0) + deltaShift := uint(0) + for opBits := f.opBits; opBits != 0; opBits >>= 16 { + n := uint(opBits & 0xFF) + off := uint((opBits >> 8) & 0xFF) + delta |= (x >> off) & (1<> 8) & (1<<4 - 1)) + case arg_R_12: + return Reg((x >> 12) & (1<<4 - 1)) + case arg_R_16: + return Reg((x >> 16) & (1<<4 - 1)) + + case arg_R_12_nzcv: + r := Reg((x >> 12) & (1<<4 - 1)) + if r == R15 { + return APSR_nzcv + } + return r + + case arg_R_16_WB: + mode := AddrLDM + if (x>>21)&1 != 0 { + mode = AddrLDM_WB + } + return Mem{Base: Reg((x >> 16) & (1<<4 - 1)), Mode: mode} + + case arg_R_rotate: + Rm := Reg(x & (1<<4 - 1)) + typ, count := decodeShift(x) + // ROR #0 here means ROR #0, but decodeShift rewrites to RRX #1. + if typ == RotateRightExt { + return Reg(Rm) + } + return RegShift{Rm, typ, uint8(count)} + + case arg_R_shift_R: + Rm := Reg(x & (1<<4 - 1)) + Rs := Reg((x >> 8) & (1<<4 - 1)) + typ := Shift((x >> 5) & (1<<2 - 1)) + return RegShiftReg{Rm, typ, Rs} + + case arg_R_shift_imm: + Rm := Reg(x & (1<<4 - 1)) + typ, count := decodeShift(x) + if typ == ShiftLeft && count == 0 { + return Reg(Rm) + } + return RegShift{Rm, typ, uint8(count)} + + case arg_R1_0: + return Reg((x & (1<<4 - 1))) + case arg_R1_12: + return Reg(((x >> 12) & (1<<4 - 1))) + case arg_R2_0: + return Reg((x & (1<<4 - 1)) | 1) + case arg_R2_12: + return Reg(((x >> 12) & (1<<4 - 1)) | 1) + + case arg_SP: + return SP + + case arg_Sd_Dd: + v := (x >> 12) & (1<<4 - 1) + vx := (x >> 22) & 1 + sz := (x >> 8) & 1 + if sz != 0 { + return D0 + Reg(vx<<4+v) + } else { + return S0 + Reg(v<<1+vx) + } + + case arg_Dd_Sd: + return decodeArg(arg_Sd_Dd, x^(1<<8)) + + case arg_Sd: + v := (x >> 12) & (1<<4 - 1) + vx := (x >> 22) & 1 + return S0 + Reg(v<<1+vx) + + case arg_Sm_Dm: + v := (x >> 0) & (1<<4 - 1) + vx := (x >> 5) & 1 + sz := (x >> 8) & 1 + if sz != 0 { + return D0 + Reg(vx<<4+v) + } else { + return S0 + Reg(v<<1+vx) + } + + case arg_Sm: + v := (x >> 0) & (1<<4 - 1) + vx := (x >> 5) & 1 + return S0 + Reg(v<<1+vx) + + case arg_Dn_half: + v := (x >> 16) & (1<<4 - 1) + vx := (x >> 7) & 1 + return RegX{D0 + Reg(vx<<4+v), int((x >> 21) & 1)} + + case arg_Sn_Dn: + v := (x >> 16) & (1<<4 - 1) + vx := (x >> 7) & 1 + sz := (x >> 8) & 1 + if sz != 0 { + return D0 + Reg(vx<<4+v) + } else { + return S0 + Reg(v<<1+vx) + } + + case arg_Sn: + v := (x >> 16) & (1<<4 - 1) + vx := (x >> 7) & 1 + return S0 + Reg(v<<1+vx) + + case arg_const: + v := x & (1<<8 - 1) + rot := (x >> 8) & (1<<4 - 1) * 2 + if rot > 0 && v&3 == 0 { + // could rotate less + return ImmAlt{uint8(v), uint8(rot)} + } + if rot >= 24 && ((v<<(32-rot))&0xFF)>>(32-rot) == v { + // could wrap around to rot==0. + return ImmAlt{uint8(v), uint8(rot)} + } + return Imm(v>>rot | v<<(32-rot)) + + case arg_endian: + return Endian((x >> 9) & 1) + + case arg_fbits: + return Imm((16 << ((x >> 7) & 1)) - ((x&(1<<4-1))<<1 | (x>>5)&1)) + + case arg_fp_0: + return Imm(0) + + case arg_imm24: + return Imm(x & (1<<24 - 1)) + + case arg_imm5: + return Imm((x >> 7) & (1<<5 - 1)) + + case arg_imm5_32: + x = (x >> 7) & (1<<5 - 1) + if x == 0 { + x = 32 + } + return Imm(x) + + case arg_imm5_nz: + x = (x >> 7) & (1<<5 - 1) + if x == 0 { + return nil + } + return Imm(x) + + case arg_imm_4at16_12at0: + return Imm((x>>16)&(1<<4-1)<<12 | x&(1<<12-1)) + + case arg_imm_12at8_4at0: + return Imm((x>>8)&(1<<12-1)<<4 | x&(1<<4-1)) + + case arg_imm_vfp: + x = (x>>16)&(1<<4-1)<<4 | x&(1<<4-1) + return Imm(x) + + case arg_label24: + imm := (x & (1<<24 - 1)) << 2 + return PCRel(int32(imm<<6) >> 6) + + case arg_label24H: + h := (x >> 24) & 1 + imm := (x&(1<<24-1))<<2 | h<<1 + return PCRel(int32(imm<<6) >> 6) + + case arg_label_m_12: + d := int32(x & (1<<12 - 1)) + return Mem{Base: PC, Mode: AddrOffset, Offset: int16(-d)} + + case arg_label_p_12: + d := int32(x & (1<<12 - 1)) + return Mem{Base: PC, Mode: AddrOffset, Offset: int16(d)} + + case arg_label_pm_12: + d := int32(x & (1<<12 - 1)) + u := (x >> 23) & 1 + if u == 0 { + d = -d + } + return Mem{Base: PC, Mode: AddrOffset, Offset: int16(d)} + + case arg_label_pm_4_4: + d := int32((x>>8)&(1<<4-1)<<4 | x&(1<<4-1)) + u := (x >> 23) & 1 + if u == 0 { + d = -d + } + return PCRel(d) + + case arg_lsb_width: + lsb := (x >> 7) & (1<<5 - 1) + msb := (x >> 16) & (1<<5 - 1) + if msb < lsb || msb >= 32 { + return nil + } + return Imm(msb + 1 - lsb) + + case arg_mem_R: + Rn := Reg((x >> 16) & (1<<4 - 1)) + return Mem{Base: Rn, Mode: AddrOffset} + + case arg_mem_R_pm_R_postindex: + // Treat [],+/- like [,+/-{,}]{!} + // by forcing shift bits to <<0 and P=0, W=0 (postindex=true). + return decodeArg(arg_mem_R_pm_R_shift_imm_W, x&^((1<<7-1)<<5|1<<24|1<<21)) + + case arg_mem_R_pm_R_W: + // Treat [,+/-]{!} like [,+/-{,}]{!} + // by forcing shift bits to <<0. + return decodeArg(arg_mem_R_pm_R_shift_imm_W, x&^((1<<7-1)<<5)) + + case arg_mem_R_pm_R_shift_imm_offset: + // Treat [],+/-{,} like [,+/-{,}]{!} + // by forcing P=1, W=0 (index=false, wback=false). + return decodeArg(arg_mem_R_pm_R_shift_imm_W, x&^(1<<21)|1<<24) + + case arg_mem_R_pm_R_shift_imm_postindex: + // Treat [],+/-{,} like [,+/-{,}]{!} + // by forcing P=0, W=0 (postindex=true). + return decodeArg(arg_mem_R_pm_R_shift_imm_W, x&^(1<<24|1<<21)) + + case arg_mem_R_pm_R_shift_imm_W: + Rn := Reg((x >> 16) & (1<<4 - 1)) + Rm := Reg(x & (1<<4 - 1)) + typ, count := decodeShift(x) + u := (x >> 23) & 1 + w := (x >> 21) & 1 + p := (x >> 24) & 1 + if p == 0 && w == 1 { + return nil + } + sign := int8(+1) + if u == 0 { + sign = -1 + } + mode := AddrMode(uint8(p<<1) | uint8(w^1)) + return Mem{Base: Rn, Mode: mode, Sign: sign, Index: Rm, Shift: typ, Count: count} + + case arg_mem_R_pm_imm12_offset: + // Treat [,#+/-] like [{,#+/-}]{!} + // by forcing P=1, W=0 (index=false, wback=false). + return decodeArg(arg_mem_R_pm_imm12_W, x&^(1<<21)|1<<24) + + case arg_mem_R_pm_imm12_postindex: + // Treat [],#+/- like [{,#+/-}]{!} + // by forcing P=0, W=0 (postindex=true). + return decodeArg(arg_mem_R_pm_imm12_W, x&^(1<<24|1<<21)) + + case arg_mem_R_pm_imm12_W: + Rn := Reg((x >> 16) & (1<<4 - 1)) + u := (x >> 23) & 1 + w := (x >> 21) & 1 + p := (x >> 24) & 1 + if p == 0 && w == 1 { + return nil + } + sign := int8(+1) + if u == 0 { + sign = -1 + } + imm := int16(x & (1<<12 - 1)) + mode := AddrMode(uint8(p<<1) | uint8(w^1)) + return Mem{Base: Rn, Mode: mode, Offset: int16(sign) * imm} + + case arg_mem_R_pm_imm8_postindex: + // Treat [],#+/- like [{,#+/-}]{!} + // by forcing P=0, W=0 (postindex=true). + return decodeArg(arg_mem_R_pm_imm8_W, x&^(1<<24|1<<21)) + + case arg_mem_R_pm_imm8_W: + Rn := Reg((x >> 16) & (1<<4 - 1)) + u := (x >> 23) & 1 + w := (x >> 21) & 1 + p := (x >> 24) & 1 + if p == 0 && w == 1 { + return nil + } + sign := int8(+1) + if u == 0 { + sign = -1 + } + imm := int16((x>>8)&(1<<4-1)<<4 | x&(1<<4-1)) + mode := AddrMode(uint8(p<<1) | uint8(w^1)) + return Mem{Base: Rn, Mode: mode, Offset: int16(sign) * imm} + + case arg_mem_R_pm_imm8at0_offset: + Rn := Reg((x >> 16) & (1<<4 - 1)) + u := (x >> 23) & 1 + sign := int8(+1) + if u == 0 { + sign = -1 + } + imm := int16(x&(1<<8-1)) << 2 + return Mem{Base: Rn, Mode: AddrOffset, Offset: int16(sign) * imm} + + case arg_option: + return Imm(x & (1<<4 - 1)) + + case arg_registers: + return RegList(x & (1<<16 - 1)) + + case arg_registers2: + x &= 1<<16 - 1 + n := 0 + for i := 0; i < 16; i++ { + if x>>uint(i)&1 != 0 { + n++ + } + } + if n < 2 { + return nil + } + return RegList(x) + + case arg_registers1: + Rt := (x >> 12) & (1<<4 - 1) + return RegList(1 << Rt) + + case arg_satimm4: + return Imm((x >> 16) & (1<<4 - 1)) + + case arg_satimm5: + return Imm((x >> 16) & (1<<5 - 1)) + + case arg_satimm4m1: + return Imm((x>>16)&(1<<4-1) + 1) + + case arg_satimm5m1: + return Imm((x>>16)&(1<<5-1) + 1) + + case arg_widthm1: + return Imm((x>>16)&(1<<5-1) + 1) + + } +} + +// decodeShift decodes the shift-by-immediate encoded in x. +func decodeShift(x uint32) (Shift, uint8) { + count := (x >> 7) & (1<<5 - 1) + typ := Shift((x >> 5) & (1<<2 - 1)) + switch typ { + case ShiftRight, ShiftRightSigned: + if count == 0 { + count = 32 + } + case RotateRight: + if count == 0 { + typ = RotateRightExt + count = 1 + } + } + return typ, uint8(count) +} diff --git a/src/cmd/internal/rsc.io/arm/armasm/decode_test.go b/src/cmd/internal/rsc.io/arm/armasm/decode_test.go new file mode 100644 index 0000000000000000000000000000000000000000..25a345a882e8167eda2d0077ade434cca84d5bc6 --- /dev/null +++ b/src/cmd/internal/rsc.io/arm/armasm/decode_test.go @@ -0,0 +1,69 @@ +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package armasm + +import ( + "encoding/hex" + "io/ioutil" + "strconv" + "strings" + "testing" +) + +func TestDecode(t *testing.T) { + data, err := ioutil.ReadFile("testdata/decode.txt") + if err != nil { + t.Fatal(err) + } + all := string(data) + for strings.Contains(all, "\t\t") { + all = strings.Replace(all, "\t\t", "\t", -1) + } + for _, line := range strings.Split(all, "\n") { + line = strings.TrimSpace(line) + if line == "" || strings.HasPrefix(line, "#") { + continue + } + f := strings.SplitN(line, "\t", 4) + i := strings.Index(f[0], "|") + if i < 0 { + t.Errorf("parsing %q: missing | separator", f[0]) + continue + } + if i%2 != 0 { + t.Errorf("parsing %q: misaligned | separator", f[0]) + } + size := i / 2 + code, err := hex.DecodeString(f[0][:i] + f[0][i+1:]) + if err != nil { + t.Errorf("parsing %q: %v", f[0], err) + continue + } + mode, err := strconv.Atoi(f[1]) + if err != nil { + t.Errorf("invalid mode %q in: %s", f[1], line) + continue + } + syntax, asm := f[2], f[3] + inst, err := Decode(code, Mode(mode)) + var out string + if err != nil { + out = "error: " + err.Error() + } else { + switch syntax { + case "gnu": + out = GNUSyntax(inst) + case "plan9": + out = Plan9Syntax(inst, 0, nil, nil) + default: + t.Errorf("unknown syntax %q", syntax) + continue + } + } + if out != asm || inst.Len != size { + t.Errorf("Decode(%s) [%s] = %s, %d, want %s, %d", f[0], syntax, out, inst.Len, asm, size) + } + } +} diff --git a/src/cmd/internal/rsc.io/arm/armasm/ext_test.go b/src/cmd/internal/rsc.io/arm/armasm/ext_test.go new file mode 100644 index 0000000000000000000000000000000000000000..aa87cf930ad90743fbb1bbdf44a82c4c0221f13a --- /dev/null +++ b/src/cmd/internal/rsc.io/arm/armasm/ext_test.go @@ -0,0 +1,614 @@ +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Support for testing against external disassembler program. +// Copied and simplified from rsc.io/x86/x86asm/ext_test.go. + +package armasm + +import ( + "bufio" + "bytes" + "encoding/hex" + "flag" + "fmt" + "io/ioutil" + "log" + "math/rand" + "os" + "os/exec" + "regexp" + "runtime" + "strings" + "testing" + "time" +) + +var ( + printTests = flag.Bool("printtests", false, "print test cases that exercise new code paths") + dumpTest = flag.Bool("dump", false, "dump all encodings") + mismatch = flag.Bool("mismatch", false, "log allowed mismatches") + longTest = flag.Bool("long", false, "long test") + keep = flag.Bool("keep", false, "keep object files around") + debug = false +) + +// A ExtInst represents a single decoded instruction parsed +// from an external disassembler's output. +type ExtInst struct { + addr uint32 + enc [4]byte + nenc int + text string +} + +func (r ExtInst) String() string { + return fmt.Sprintf("%#x: % x: %s", r.addr, r.enc, r.text) +} + +// An ExtDis is a connection between an external disassembler and a test. +type ExtDis struct { + Arch Mode + Dec chan ExtInst + File *os.File + Size int + KeepFile bool + Cmd *exec.Cmd +} + +// Run runs the given command - the external disassembler - and returns +// a buffered reader of its standard output. +func (ext *ExtDis) Run(cmd ...string) (*bufio.Reader, error) { + if *keep { + log.Printf("%s\n", strings.Join(cmd, " ")) + } + ext.Cmd = exec.Command(cmd[0], cmd[1:]...) + out, err := ext.Cmd.StdoutPipe() + if err != nil { + return nil, fmt.Errorf("stdoutpipe: %v", err) + } + if err := ext.Cmd.Start(); err != nil { + return nil, fmt.Errorf("exec: %v", err) + } + + b := bufio.NewReaderSize(out, 1<<20) + return b, nil +} + +// Wait waits for the command started with Run to exit. +func (ext *ExtDis) Wait() error { + return ext.Cmd.Wait() +} + +// testExtDis tests a set of byte sequences against an external disassembler. +// The disassembler is expected to produce the given syntax and be run +// in the given architecture mode (16, 32, or 64-bit). +// The extdis function must start the external disassembler +// and then parse its output, sending the parsed instructions on ext.Dec. +// The generate function calls its argument f once for each byte sequence +// to be tested. The generate function itself will be called twice, and it must +// make the same sequence of calls to f each time. +// When a disassembly does not match the internal decoding, +// allowedMismatch determines whether this mismatch should be +// allowed, or else considered an error. +func testExtDis( + t *testing.T, + syntax string, + arch Mode, + extdis func(ext *ExtDis) error, + generate func(f func([]byte)), + allowedMismatch func(text string, size int, inst *Inst, dec ExtInst) bool, +) { + start := time.Now() + ext := &ExtDis{ + Dec: make(chan ExtInst), + Arch: arch, + } + errc := make(chan error) + + // First pass: write instructions to input file for external disassembler. + file, f, size, err := writeInst(generate) + if err != nil { + t.Fatal(err) + } + ext.Size = size + ext.File = f + defer func() { + f.Close() + if !*keep { + os.Remove(file) + } + }() + + // Second pass: compare disassembly against our decodings. + var ( + totalTests = 0 + totalSkips = 0 + totalErrors = 0 + + errors = make([]string, 0, 100) // sampled errors, at most cap + ) + go func() { + errc <- extdis(ext) + }() + generate(func(enc []byte) { + dec, ok := <-ext.Dec + if !ok { + t.Errorf("decoding stream ended early") + return + } + inst, text := disasm(syntax, arch, pad(enc)) + totalTests++ + if *dumpTest { + fmt.Printf("%x -> %s [%d]\n", enc[:len(enc)], dec.text, dec.nenc) + } + if text != dec.text || inst.Len != dec.nenc { + suffix := "" + if allowedMismatch(text, size, &inst, dec) { + totalSkips++ + if !*mismatch { + return + } + suffix += " (allowed mismatch)" + } + totalErrors++ + if len(errors) >= cap(errors) { + j := rand.Intn(totalErrors) + if j >= cap(errors) { + return + } + errors = append(errors[:j], errors[j+1:]...) + } + errors = append(errors, fmt.Sprintf("decode(%x) = %q, %d, want %q, %d%s", enc, text, inst.Len, dec.text, dec.nenc, suffix)) + } + }) + + if *mismatch { + totalErrors -= totalSkips + } + + for _, b := range errors { + t.Log(b) + } + + if totalErrors > 0 { + t.Fail() + } + t.Logf("%d test cases, %d expected mismatches, %d failures; %.0f cases/second", totalTests, totalSkips, totalErrors, float64(totalTests)/time.Since(start).Seconds()) + + if err := <-errc; err != nil { + t.Fatal("external disassembler: %v", err) + } + +} + +const start = 0x8000 // start address of text + +// writeInst writes the generated byte sequences to a new file +// starting at offset start. That file is intended to be the input to +// the external disassembler. +func writeInst(generate func(func([]byte))) (file string, f *os.File, size int, err error) { + f, err = ioutil.TempFile("", "armasm") + if err != nil { + return + } + + file = f.Name() + + f.Seek(start, 0) + w := bufio.NewWriter(f) + defer w.Flush() + size = 0 + generate(func(x []byte) { + if len(x) > 4 { + x = x[:4] + } + if debug { + fmt.Printf("%#x: %x%x\n", start+size, x, zeros[len(x):]) + } + w.Write(x) + w.Write(zeros[len(x):]) + size += len(zeros) + }) + return file, f, size, nil +} + +var zeros = []byte{0, 0, 0, 0} + +// pad pads the code sequence with pops. +func pad(enc []byte) []byte { + if len(enc) < 4 { + enc = append(enc[:len(enc):len(enc)], zeros[:4-len(enc)]...) + } + return enc +} + +// disasm returns the decoded instruction and text +// for the given source bytes, using the given syntax and mode. +func disasm(syntax string, mode Mode, src []byte) (inst Inst, text string) { + // If printTests is set, we record the coverage value + // before and after, and we write out the inputs for which + // coverage went up, in the format expected in testdata/decode.text. + // This produces a fairly small set of test cases that exercise nearly + // all the code. + var cover float64 + if *printTests { + cover -= coverage() + } + + inst, err := Decode(src, mode) + if err != nil { + text = "error: " + err.Error() + } else { + text = inst.String() + switch syntax { + //case "arm": + // text = ARMSyntax(inst) + case "gnu": + text = GNUSyntax(inst) + //case "plan9": + // text = Plan9Syntax(inst, 0, nil) + default: + text = "error: unknown syntax " + syntax + } + } + + if *printTests { + cover += coverage() + if cover > 0 { + max := len(src) + if max > 4 && inst.Len <= 4 { + max = 4 + } + fmt.Printf("%x|%x\t%d\t%s\t%s\n", src[:inst.Len], src[inst.Len:max], mode, syntax, text) + } + } + + return +} + +// coverage returns a floating point number denoting the +// test coverage until now. The number increases when new code paths are exercised, +// both in the Go program and in the decoder byte code. +func coverage() float64 { + /* + testing.Coverage is not in the main distribution. + The implementation, which must go in package testing, is: + + // Coverage reports the current code coverage as a fraction in the range [0, 1]. + func Coverage() float64 { + var n, d int64 + for _, counters := range cover.Counters { + for _, c := range counters { + if c > 0 { + n++ + } + d++ + } + } + if d == 0 { + return 0 + } + return float64(n) / float64(d) + } + */ + + var f float64 + f += testing.Coverage() + f += decodeCoverage() + return f +} + +func decodeCoverage() float64 { + n := 0 + for _, t := range decoderCover { + if t { + n++ + } + } + return float64(1+n) / float64(1+len(decoderCover)) +} + +// Helpers for writing disassembler output parsers. + +// hasPrefix reports whether any of the space-separated words in the text s +// begins with any of the given prefixes. +func hasPrefix(s string, prefixes ...string) bool { + for _, prefix := range prefixes { + for s := s; s != ""; { + if strings.HasPrefix(s, prefix) { + return true + } + i := strings.Index(s, " ") + if i < 0 { + break + } + s = s[i+1:] + } + } + return false +} + +// contains reports whether the text s contains any of the given substrings. +func contains(s string, substrings ...string) bool { + for _, sub := range substrings { + if strings.Contains(s, sub) { + return true + } + } + return false +} + +// isHex reports whether b is a hexadecimal character (0-9A-Fa-f). +func isHex(b byte) bool { return b == '0' || unhex[b] > 0 } + +// parseHex parses the hexadecimal byte dump in hex, +// appending the parsed bytes to raw and returning the updated slice. +// The returned bool signals whether any invalid hex was found. +// Spaces and tabs between bytes are okay but any other non-hex is not. +func parseHex(hex []byte, raw []byte) ([]byte, bool) { + hex = trimSpace(hex) + for j := 0; j < len(hex); { + for hex[j] == ' ' || hex[j] == '\t' { + j++ + } + if j >= len(hex) { + break + } + if j+2 > len(hex) || !isHex(hex[j]) || !isHex(hex[j+1]) { + return nil, false + } + raw = append(raw, unhex[hex[j]]<<4|unhex[hex[j+1]]) + j += 2 + } + return raw, true +} + +var unhex = [256]byte{ + '0': 0, + '1': 1, + '2': 2, + '3': 3, + '4': 4, + '5': 5, + '6': 6, + '7': 7, + '8': 8, + '9': 9, + 'A': 10, + 'B': 11, + 'C': 12, + 'D': 13, + 'E': 14, + 'F': 15, + 'a': 10, + 'b': 11, + 'c': 12, + 'd': 13, + 'e': 14, + 'f': 15, +} + +// index is like bytes.Index(s, []byte(t)) but avoids the allocation. +func index(s []byte, t string) int { + i := 0 + for { + j := bytes.IndexByte(s[i:], t[0]) + if j < 0 { + return -1 + } + i = i + j + if i+len(t) > len(s) { + return -1 + } + for k := 1; k < len(t); k++ { + if s[i+k] != t[k] { + goto nomatch + } + } + return i + nomatch: + i++ + } +} + +// fixSpace rewrites runs of spaces, tabs, and newline characters into single spaces in s. +// If s must be rewritten, it is rewritten in place. +func fixSpace(s []byte) []byte { + s = trimSpace(s) + for i := 0; i < len(s); i++ { + if s[i] == '\t' || s[i] == '\n' || i > 0 && s[i] == ' ' && s[i-1] == ' ' { + goto Fix + } + } + return s + +Fix: + b := s + w := 0 + for i := 0; i < len(s); i++ { + c := s[i] + if c == '\t' || c == '\n' { + c = ' ' + } + if c == ' ' && w > 0 && b[w-1] == ' ' { + continue + } + b[w] = c + w++ + } + if w > 0 && b[w-1] == ' ' { + w-- + } + return b[:w] +} + +// trimSpace trims leading and trailing space from s, returning a subslice of s. +func trimSpace(s []byte) []byte { + j := len(s) + for j > 0 && (s[j-1] == ' ' || s[j-1] == '\t' || s[j-1] == '\n') { + j-- + } + i := 0 + for i < j && (s[i] == ' ' || s[i] == '\t') { + i++ + } + return s[i:j] +} + +// pcrel matches instructions using relative addressing mode. +var ( + pcrel = regexp.MustCompile(`^((?:.* )?(?:b|bl)x?(?:eq|ne|cs|cc|mi|pl|vs|vc|hi|ls|ge|lt|gt|le)?) 0x([0-9a-f]+)$`) +) + +// Generators. +// +// The test cases are described as functions that invoke a callback repeatedly, +// with a new input sequence each time. These helpers make writing those +// a little easier. + +// condCases generates conditional instructions. +func condCases(t *testing.T) func(func([]byte)) { + return func(try func([]byte)) { + // All the strides are relatively prime to 2 and therefore to 2²⁸, + // so we will not repeat any instructions until we have tried all 2²⁸. + // Using a stride other than 1 is meant to visit the instructions in a + // pseudorandom order, which gives better variety in the set of + // test cases chosen by -printtests. + stride := uint32(10007) + n := 1 << 28 / 7 + if testing.Short() { + stride = 100003 + n = 1 << 28 / 1001 + } else if *longTest { + stride = 200000033 + n = 1 << 28 + } + x := uint32(0) + for i := 0; i < n; i++ { + enc := (x%15)<<28 | x&(1<<28-1) + try([]byte{byte(enc), byte(enc >> 8), byte(enc >> 16), byte(enc >> 24)}) + x += stride + } + } +} + +// uncondCases generates unconditional instructions. +func uncondCases(t *testing.T) func(func([]byte)) { + return func(try func([]byte)) { + condCases(t)(func(enc []byte) { + enc[3] |= 0xF0 + try(enc) + }) + } +} + +func countBits(x uint32) int { + n := 0 + for ; x != 0; x >>= 1 { + n += int(x & 1) + } + return n +} + +func expandBits(x, m uint32) uint32 { + var out uint32 + for i := uint(0); i < 32; i++ { + out >>= 1 + if m&1 != 0 { + out |= (x & 1) << 31 + x >>= 1 + } + m >>= 1 + } + return out +} + +func tryCondMask(mask, val uint32, try func([]byte)) { + n := countBits(^mask) + bits := uint32(0) + for i := 0; i < 1<> 8), byte(x >> 16), byte(x >> 24)}) + } +} + +// vfpCases generates VFP instructions. +func vfpCases(t *testing.T) func(func([]byte)) { + const ( + vfpmask uint32 = 0xFF00FE10 + vfp uint32 = 0x0E009A00 + ) + return func(try func([]byte)) { + tryCondMask(0xff00fe10, 0x0e009a00, try) // standard VFP instruction space + tryCondMask(0xffc00f7f, 0x0e000b10, try) // VFP MOV core reg to/from float64 half + tryCondMask(0xffe00f7f, 0x0e000a10, try) // VFP MOV core reg to/from float32 + tryCondMask(0xffef0fff, 0x0ee10a10, try) // VFP MOV core reg to/from cond codes + } +} + +// hexCases generates the cases written in hexadecimal in the encoded string. +// Spaces in 'encoded' separate entire test cases, not individual bytes. +func hexCases(t *testing.T, encoded string) func(func([]byte)) { + return func(try func([]byte)) { + for _, x := range strings.Fields(encoded) { + src, err := hex.DecodeString(x) + if err != nil { + t.Errorf("parsing %q: %v", x, err) + } + try(src) + } + } +} + +// testdataCases generates the test cases recorded in testdata/decode.txt. +// It only uses the inputs; it ignores the answers recorded in that file. +func testdataCases(t *testing.T) func(func([]byte)) { + var codes [][]byte + data, err := ioutil.ReadFile("testdata/decode.txt") + if err != nil { + t.Fatal(err) + } + for _, line := range strings.Split(string(data), "\n") { + line = strings.TrimSpace(line) + if line == "" || strings.HasPrefix(line, "#") { + continue + } + f := strings.Fields(line)[0] + i := strings.Index(f, "|") + if i < 0 { + t.Errorf("parsing %q: missing | separator", f) + continue + } + if i%2 != 0 { + t.Errorf("parsing %q: misaligned | separator", f) + } + code, err := hex.DecodeString(f[:i] + f[i+1:]) + if err != nil { + t.Errorf("parsing %q: %v", f, err) + continue + } + codes = append(codes, code) + } + + return func(try func([]byte)) { + for _, code := range codes { + try(code) + } + } +} + +func caller(skip int) string { + pc, _, _, _ := runtime.Caller(skip) + f := runtime.FuncForPC(pc) + name := "?" + if f != nil { + name = f.Name() + if i := strings.LastIndex(name, "."); i >= 0 { + name = name[i+1:] + } + } + return name +} diff --git a/src/cmd/internal/rsc.io/arm/armasm/gnu.go b/src/cmd/internal/rsc.io/arm/armasm/gnu.go new file mode 100644 index 0000000000000000000000000000000000000000..1a97a5a844fdc228c3b9cd6b5e851c5faa3e029e --- /dev/null +++ b/src/cmd/internal/rsc.io/arm/armasm/gnu.go @@ -0,0 +1,164 @@ +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package armasm + +import ( + "bytes" + "fmt" + "strings" +) + +var saveDot = strings.NewReplacer( + ".F16", "_dot_F16", + ".F32", "_dot_F32", + ".F64", "_dot_F64", + ".S32", "_dot_S32", + ".U32", "_dot_U32", + ".FXS", "_dot_S", + ".FXU", "_dot_U", + ".32", "_dot_32", +) + +// GNUSyntax returns the GNU assembler syntax for the instruction, as defined by GNU binutils. +// This form typically matches the syntax defined in the ARM Reference Manual. +func GNUSyntax(inst Inst) string { + var buf bytes.Buffer + op := inst.Op.String() + op = saveDot.Replace(op) + op = strings.Replace(op, ".", "", -1) + op = strings.Replace(op, "_dot_", ".", -1) + op = strings.ToLower(op) + buf.WriteString(op) + sep := " " + for i, arg := range inst.Args { + if arg == nil { + break + } + text := gnuArg(&inst, i, arg) + if text == "" { + continue + } + buf.WriteString(sep) + sep = ", " + buf.WriteString(text) + } + return buf.String() +} + +func gnuArg(inst *Inst, argIndex int, arg Arg) string { + switch inst.Op &^ 15 { + case LDRD_EQ, LDREXD_EQ, STRD_EQ: + if argIndex == 1 { + // second argument in consecutive pair not printed + return "" + } + case STREXD_EQ: + if argIndex == 2 { + // second argument in consecutive pair not printed + return "" + } + } + + switch arg := arg.(type) { + case Imm: + switch inst.Op &^ 15 { + case BKPT_EQ: + return fmt.Sprintf("%#04x", uint32(arg)) + case SVC_EQ: + return fmt.Sprintf("%#08x", uint32(arg)) + } + return fmt.Sprintf("#%d", int32(arg)) + + case ImmAlt: + return fmt.Sprintf("#%d, %d", arg.Val, arg.Rot) + + case Mem: + R := gnuArg(inst, -1, arg.Base) + X := "" + if arg.Sign != 0 { + X = "" + if arg.Sign < 0 { + X = "-" + } + X += gnuArg(inst, -1, arg.Index) + if arg.Shift == ShiftLeft && arg.Count == 0 { + // nothing + } else if arg.Shift == RotateRightExt { + X += ", rrx" + } else { + X += fmt.Sprintf(", %s #%d", strings.ToLower(arg.Shift.String()), arg.Count) + } + } else { + X = fmt.Sprintf("#%d", arg.Offset) + } + + switch arg.Mode { + case AddrOffset: + if X == "#0" { + return fmt.Sprintf("[%s]", R) + } + return fmt.Sprintf("[%s, %s]", R, X) + case AddrPreIndex: + return fmt.Sprintf("[%s, %s]!", R, X) + case AddrPostIndex: + return fmt.Sprintf("[%s], %s", R, X) + case AddrLDM: + if X == "#0" { + return R + } + case AddrLDM_WB: + if X == "#0" { + return R + "!" + } + } + return fmt.Sprintf("[%s Mode(%d) %s]", R, int(arg.Mode), X) + + case PCRel: + return fmt.Sprintf(".%+#x", int32(arg)+4) + + case Reg: + switch inst.Op &^ 15 { + case LDREX_EQ: + if argIndex == 0 { + return fmt.Sprintf("r%d", int32(arg)) + } + } + switch arg { + case R10: + return "sl" + case R11: + return "fp" + case R12: + return "ip" + } + + case RegList: + var buf bytes.Buffer + fmt.Fprintf(&buf, "{") + sep := "" + for i := 0; i < 16; i++ { + if arg&(1<= Op(len(opstr)) || opstr[op] == "" { + return fmt.Sprintf("Op(%d)", int(op)) + } + return opstr[op] +} + +// An Inst is a single instruction. +type Inst struct { + Op Op // Opcode mnemonic + Enc uint32 // Raw encoding bits. + Len int // Length of encoding in bytes. + Args Args // Instruction arguments, in ARM manual order. +} + +func (i Inst) String() string { + var buf bytes.Buffer + buf.WriteString(i.Op.String()) + for j, arg := range i.Args { + if arg == nil { + break + } + if j == 0 { + buf.WriteString(" ") + } else { + buf.WriteString(", ") + } + buf.WriteString(arg.String()) + } + return buf.String() +} + +// An Args holds the instruction arguments. +// If an instruction has fewer than 4 arguments, +// the final elements in the array are nil. +type Args [4]Arg + +// An Arg is a single instruction argument, one of these types: +// Endian, Imm, Mem, PCRel, Reg, RegList, RegShift, RegShiftReg. +type Arg interface { + IsArg() + String() string +} + +type Float32Imm float32 + +func (Float32Imm) IsArg() {} + +func (f Float32Imm) String() string { + return fmt.Sprintf("#%v", float32(f)) +} + +type Float64Imm float32 + +func (Float64Imm) IsArg() {} + +func (f Float64Imm) String() string { + return fmt.Sprintf("#%v", float64(f)) +} + +// An Imm is an integer constant. +type Imm uint32 + +func (Imm) IsArg() {} + +func (i Imm) String() string { + return fmt.Sprintf("#%#x", uint32(i)) +} + +// A ImmAlt is an alternate encoding of an integer constant. +type ImmAlt struct { + Val uint8 + Rot uint8 +} + +func (ImmAlt) IsArg() {} + +func (i ImmAlt) Imm() Imm { + v := uint32(i.Val) + r := uint(i.Rot) + return Imm(v>>r | v<<(32-r)) +} + +func (i ImmAlt) String() string { + return fmt.Sprintf("#%#x, %d", i.Val, i.Rot) +} + +// A Label is a text (code) address. +type Label uint32 + +func (Label) IsArg() {} + +func (i Label) String() string { + return fmt.Sprintf("%#x", uint32(i)) +} + +// A Reg is a single register. +// The zero value denotes R0, not the absence of a register. +type Reg uint8 + +const ( + R0 Reg = iota + R1 + R2 + R3 + R4 + R5 + R6 + R7 + R8 + R9 + R10 + R11 + R12 + R13 + R14 + R15 + + S0 + S1 + S2 + S3 + S4 + S5 + S6 + S7 + S8 + S9 + S10 + S11 + S12 + S13 + S14 + S15 + S16 + S17 + S18 + S19 + S20 + S21 + S22 + S23 + S24 + S25 + S26 + S27 + S28 + S29 + S30 + S31 + + D0 + D1 + D2 + D3 + D4 + D5 + D6 + D7 + D8 + D9 + D10 + D11 + D12 + D13 + D14 + D15 + D16 + D17 + D18 + D19 + D20 + D21 + D22 + D23 + D24 + D25 + D26 + D27 + D28 + D29 + D30 + D31 + + APSR + APSR_nzcv + FPSCR + + SP = R13 + LR = R14 + PC = R15 +) + +func (Reg) IsArg() {} + +func (r Reg) String() string { + switch r { + case APSR: + return "APSR" + case APSR_nzcv: + return "APSR_nzcv" + case FPSCR: + return "FPSCR" + case SP: + return "SP" + case PC: + return "PC" + case LR: + return "LR" + } + if R0 <= r && r <= R15 { + return fmt.Sprintf("R%d", int(r-R0)) + } + if S0 <= r && r <= S31 { + return fmt.Sprintf("S%d", int(r-S0)) + } + if D0 <= r && r <= D31 { + return fmt.Sprintf("D%d", int(r-D0)) + } + return fmt.Sprintf("Reg(%d)", int(r)) +} + +// A RegX represents a fraction of a multi-value register. +// The Index field specifies the index number, +// but the size of the fraction is not specified. +// It must be inferred from the instruction and the register type. +// For example, in a VMOV instruction, RegX{D5, 1} represents +// the top 32 bits of the 64-bit D5 register. +type RegX struct { + Reg Reg + Index int +} + +func (RegX) IsArg() {} + +func (r RegX) String() string { + return fmt.Sprintf("%s[%d]", r.Reg, r.Index) +} + +// A RegList is a register list. +// Bits at indexes x = 0 through 15 indicate whether the corresponding Rx register is in the list. +type RegList uint16 + +func (RegList) IsArg() {} + +func (r RegList) String() string { + var buf bytes.Buffer + fmt.Fprintf(&buf, "{") + sep := "" + for i := 0; i < 16; i++ { + if r&(1<= 4 { + raw := binary.LittleEndian.Uint32(dec.enc[:4]) + + // word 21FFF0B5. + // the manual is clear that this is pre-indexed mode (with !) but libopcodes generates post-index (without !). + if raw&0x01200000 == 0x01200000 && strings.Replace(text, "!", "", -1) == dec.text { + return true + } + + // word C100543E: libopcodes says tst, but no evidence for that. + if strings.HasPrefix(dec.text, "tst") && raw&0x0ff00000 != 0x03100000 && raw&0x0ff00000 != 0x01100000 { + return true + } + + // word C3203CE8: libopcodes says teq, but no evidence for that. + if strings.HasPrefix(dec.text, "teq") && raw&0x0ff00000 != 0x03300000 && raw&0x0ff00000 != 0x01300000 { + return true + } + + // word D14C552E: libopcodes says cmp but no evidence for that. + if strings.HasPrefix(dec.text, "cmp") && raw&0x0ff00000 != 0x03500000 && raw&0x0ff00000 != 0x01500000 { + return true + } + + // word 2166AA4A: libopcodes says cmn but no evidence for that. + if strings.HasPrefix(dec.text, "cmn") && raw&0x0ff00000 != 0x03700000 && raw&0x0ff00000 != 0x01700000 { + return true + } + + // word E70AEEEF: libopcodes says str but no evidence for that. + if strings.HasPrefix(dec.text, "str") && len(dec.text) >= 5 && (dec.text[3] == ' ' || dec.text[5] == ' ') && raw&0x0e500018 != 0x06000000 && raw&0x0e500000 != 0x0400000 { + return true + } + + // word B0AF48F4: libopcodes says strd but P=0,W=1 which is unpredictable. + if hasPrefix(dec.text, "ldr", "str") && raw&0x01200000 == 0x00200000 { + return true + } + + // word B6CC1C76: libopcodes inexplicably says 'uxtab16lt r1, ip, r6, ROR #24' instead of 'uxtab16lt r1, ip, r6, ror #24' + if strings.ToLower(dec.text) == text { + return true + } + + // word F410FDA1: libopcodes says PLDW but the manual is clear that PLDW is F5/F7, not F4. + // word F7D0FB17: libopcodes says PLDW but the manual is clear that PLDW has 0x10 clear + if hasPrefix(dec.text, "pld") && raw&0xfd000010 != 0xf5000000 { + return true + } + + // word F650FE14: libopcodes says PLI but the manual is clear that PLI has 0x10 clear + if hasPrefix(dec.text, "pli") && raw&0xff000010 != 0xf6000000 { + return true + } + } + + return false +} + +// Instructions known to libopcodes (or xed) but not to us. +// Most of these are floating point coprocessor instructions. +var unsupported = strings.Fields(` + abs + acs + adf + aes + asn + atn + cdp + cf + cmf + cnf + cos + cps + crc32 + dvf + eret + exp + fadd + fcmp + fcpy + fcvt + fdiv + fdv + fix + fld + flt + fmac + fmd + fml + fmr + fms + fmul + fmx + fneg + fnm + frd + fsit + fsq + fst + fsu + fto + fui + hlt + hvc + lda + ldc + ldf + lfm + lgn + log + mar + mcr + mcrr + mia + mnf + mra + mrc + mrrc + mrs + msr + msr + muf + mvf + nrm + pol + pow + rdf + rfc + rfe + rfs + rmf + rnd + rpw + rsf + sdiv + sev + sfm + sha1 + sha256 + sin + smc + sqt + srs + stc + stf + stl + suf + tan + udf + udiv + urd + vfma + vfms + vfnma + vfnms + vrint + wfc + wfs +`) diff --git a/src/cmd/internal/rsc.io/arm/armasm/objdumpext_test.go b/src/cmd/internal/rsc.io/arm/armasm/objdumpext_test.go new file mode 100644 index 0000000000000000000000000000000000000000..d88c67fc0571c38c22083379aa2143e4a25549ea --- /dev/null +++ b/src/cmd/internal/rsc.io/arm/armasm/objdumpext_test.go @@ -0,0 +1,260 @@ +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Copied and simplified from rsc.io/x86/x86asm/objdumpext_test.go. + +package armasm + +import ( + "bytes" + "debug/elf" + "encoding/binary" + "fmt" + "io" + "log" + "os" + "strconv" + "strings" + "testing" +) + +const objdumpPath = "/usr/local/bin/arm-linux-elf-objdump" + +func testObjdumpARM(t *testing.T, generate func(func([]byte))) { + testObjdumpArch(t, generate, ModeARM) +} + +func testObjdumpArch(t *testing.T, generate func(func([]byte)), arch Mode) { + if testing.Short() { + t.Skip("skipping objdump test in short mode") + } + + if _, err := os.Stat(objdumpPath); err != nil { + t.Fatal(err) + } + + testExtDis(t, "gnu", arch, objdump, generate, allowedMismatchObjdump) +} + +func objdump(ext *ExtDis) error { + // File already written with instructions; add ELF header. + if ext.Arch == ModeARM { + if err := writeELF32(ext.File, ext.Size); err != nil { + return err + } + } else { + panic("unknown arch") + } + + b, err := ext.Run(objdumpPath, "-d", "-z", ext.File.Name()) + if err != nil { + return err + } + + var ( + nmatch int + reading bool + next uint32 = start + addr uint32 + encbuf [4]byte + enc []byte + text string + ) + flush := func() { + if addr == next { + if m := pcrel.FindStringSubmatch(text); m != nil { + targ, _ := strconv.ParseUint(m[2], 16, 64) + text = fmt.Sprintf("%s .%+#x", m[1], int32(uint32(targ)-addr-uint32(len(enc)))) + } + if strings.HasPrefix(text, "stmia") { + text = "stm" + text[5:] + } + if strings.HasPrefix(text, "stmfd") { + text = "stmdb" + text[5:] + } + if strings.HasPrefix(text, "ldmfd") { + text = "ldm" + text[5:] + } + text = strings.Replace(text, "#0.0", "#0", -1) + if text == "undefined" && len(enc) == 4 { + text = "error: unknown instruction" + enc = nil + } + if len(enc) == 4 { + // prints as word but we want to record bytes + enc[0], enc[3] = enc[3], enc[0] + enc[1], enc[2] = enc[2], enc[1] + } + ext.Dec <- ExtInst{addr, encbuf, len(enc), text} + encbuf = [4]byte{} + enc = nil + next += 4 + } + } + var textangle = []byte("<.text>:") + for { + line, err := b.ReadSlice('\n') + if err != nil { + if err == io.EOF { + break + } + return fmt.Errorf("reading objdump output: %v", err) + } + if bytes.Contains(line, textangle) { + reading = true + continue + } + if !reading { + continue + } + if debug { + os.Stdout.Write(line) + } + if enc1 := parseContinuation(line, encbuf[:len(enc)]); enc1 != nil { + enc = enc1 + continue + } + flush() + nmatch++ + addr, enc, text = parseLine(line, encbuf[:0]) + if addr > next { + return fmt.Errorf("address out of sync expected <= %#x at %q in:\n%s", next, line, line) + } + } + flush() + if next != start+uint32(ext.Size) { + return fmt.Errorf("not enough results found [%d %d]", next, start+ext.Size) + } + if err := ext.Wait(); err != nil { + return fmt.Errorf("exec: %v", err) + } + + return nil +} + +var ( + undefined = []byte("") + unpredictable = []byte("") + illegalShifter = []byte("") +) + +func parseLine(line []byte, encstart []byte) (addr uint32, enc []byte, text string) { + oline := line + i := index(line, ":\t") + if i < 0 { + log.Fatalf("cannot parse disassembly: %q", oline) + } + x, err := strconv.ParseUint(string(trimSpace(line[:i])), 16, 32) + if err != nil { + log.Fatalf("cannot parse disassembly: %q", oline) + } + addr = uint32(x) + line = line[i+2:] + i = bytes.IndexByte(line, '\t') + if i < 0 { + log.Fatalf("cannot parse disassembly: %q", oline) + } + enc, ok := parseHex(line[:i], encstart) + if !ok { + log.Fatalf("cannot parse disassembly: %q", oline) + } + line = trimSpace(line[i:]) + if bytes.Contains(line, undefined) { + text = "undefined" + return + } + if bytes.Contains(line, illegalShifter) { + text = "undefined" + return + } + if false && bytes.Contains(line, unpredictable) { + text = "unpredictable" + return + } + if i := bytes.IndexByte(line, ';'); i >= 0 { + line = trimSpace(line[:i]) + } + text = string(fixSpace(line)) + return +} + +func parseContinuation(line []byte, enc []byte) []byte { + i := index(line, ":\t") + if i < 0 { + return nil + } + line = line[i+1:] + enc, _ = parseHex(line, enc) + return enc +} + +// writeELF32 writes an ELF32 header to the file, +// describing a text segment that starts at start +// and extends for size bytes. +func writeELF32(f *os.File, size int) error { + f.Seek(0, 0) + var hdr elf.Header32 + var prog elf.Prog32 + var sect elf.Section32 + var buf bytes.Buffer + binary.Write(&buf, binary.LittleEndian, &hdr) + off1 := buf.Len() + binary.Write(&buf, binary.LittleEndian, &prog) + off2 := buf.Len() + binary.Write(&buf, binary.LittleEndian, §) + off3 := buf.Len() + buf.Reset() + data := byte(elf.ELFDATA2LSB) + hdr = elf.Header32{ + Ident: [16]byte{0x7F, 'E', 'L', 'F', 1, data, 1}, + Type: 2, + Machine: uint16(elf.EM_ARM), + Version: 1, + Entry: start, + Phoff: uint32(off1), + Shoff: uint32(off2), + Flags: 0x05000002, + Ehsize: uint16(off1), + Phentsize: uint16(off2 - off1), + Phnum: 1, + Shentsize: uint16(off3 - off2), + Shnum: 3, + Shstrndx: 2, + } + binary.Write(&buf, binary.LittleEndian, &hdr) + prog = elf.Prog32{ + Type: 1, + Off: start, + Vaddr: start, + Paddr: start, + Filesz: uint32(size), + Memsz: uint32(size), + Flags: 5, + Align: start, + } + binary.Write(&buf, binary.LittleEndian, &prog) + binary.Write(&buf, binary.LittleEndian, §) // NULL section + sect = elf.Section32{ + Name: 1, + Type: uint32(elf.SHT_PROGBITS), + Addr: start, + Off: start, + Size: uint32(size), + Flags: uint32(elf.SHF_ALLOC | elf.SHF_EXECINSTR), + Addralign: 4, + } + binary.Write(&buf, binary.LittleEndian, §) // .text + sect = elf.Section32{ + Name: uint32(len("\x00.text\x00")), + Type: uint32(elf.SHT_STRTAB), + Addr: 0, + Off: uint32(off2 + (off3-off2)*3), + Size: uint32(len("\x00.text\x00.shstrtab\x00")), + Addralign: 1, + } + binary.Write(&buf, binary.LittleEndian, §) + buf.WriteString("\x00.text\x00.shstrtab\x00") + f.Write(buf.Bytes()) + return nil +} diff --git a/src/cmd/internal/rsc.io/arm/armasm/plan9x.go b/src/cmd/internal/rsc.io/arm/armasm/plan9x.go new file mode 100644 index 0000000000000000000000000000000000000000..952c5190b6e2088ebea3f42f804a506adb29618c --- /dev/null +++ b/src/cmd/internal/rsc.io/arm/armasm/plan9x.go @@ -0,0 +1,211 @@ +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package armasm + +import ( + "bytes" + "encoding/binary" + "fmt" + "io" + "strings" +) + +// Plan9Syntax returns the Go assembler syntax for the instruction. +// The syntax was originally defined by Plan 9. +// The pc is the program counter of the instruction, used for expanding +// PC-relative addresses into absolute ones. +// The symname function queries the symbol table for the program +// being disassembled. Given a target address it returns the name and base +// address of the symbol containing the target, if any; otherwise it returns "", 0. +// The reader r should read from the text segment using text addresses +// as offsets; it is used to display pc-relative loads as constant loads. +func Plan9Syntax(inst Inst, pc uint64, symname func(uint64) (string, uint64), text io.ReaderAt) string { + if symname == nil { + symname = func(uint64) (string, uint64) { return "", 0 } + } + + var args []string + for _, a := range inst.Args { + if a == nil { + break + } + args = append(args, plan9Arg(&inst, pc, symname, a)) + } + + op := inst.Op.String() + + switch inst.Op &^ 15 { + case LDR_EQ, LDRB_EQ, LDRH_EQ: + // Check for RET + reg, _ := inst.Args[0].(Reg) + mem, _ := inst.Args[1].(Mem) + if inst.Op&^15 == LDR_EQ && reg == R15 && mem.Base == SP && mem.Sign == 0 && mem.Mode == AddrPostIndex { + return fmt.Sprintf("RET%s #%d", op[3:], mem.Offset) + } + + // Check for PC-relative load. + if mem.Base == PC && mem.Sign == 0 && mem.Mode == AddrOffset && text != nil { + addr := uint32(pc) + 8 + uint32(mem.Offset) + buf := make([]byte, 4) + switch inst.Op &^ 15 { + case LDRB_EQ: + if _, err := text.ReadAt(buf[:1], int64(addr)); err != nil { + break + } + args[1] = fmt.Sprintf("$%#x", buf[0]) + + case LDRH_EQ: + if _, err := text.ReadAt(buf[:2], int64(addr)); err != nil { + break + } + args[1] = fmt.Sprintf("$%#x", binary.LittleEndian.Uint16(buf)) + + case LDR_EQ: + if _, err := text.ReadAt(buf, int64(addr)); err != nil { + break + } + x := binary.LittleEndian.Uint32(buf) + if s, base := symname(uint64(x)); s != "" && uint64(x) == base { + args[1] = fmt.Sprintf("$%s(SB)", s) + } else { + args[1] = fmt.Sprintf("$%#x", x) + } + } + } + } + + // Move addressing mode into opcode suffix. + suffix := "" + switch inst.Op &^ 15 { + case LDR_EQ, LDRB_EQ, LDRH_EQ, STR_EQ, STRB_EQ, STRH_EQ: + mem, _ := inst.Args[1].(Mem) + switch mem.Mode { + case AddrOffset, AddrLDM: + // no suffix + case AddrPreIndex, AddrLDM_WB: + suffix = ".W" + case AddrPostIndex: + suffix = ".P" + } + off := "" + if mem.Offset != 0 { + off = fmt.Sprintf("%#x", mem.Offset) + } + base := fmt.Sprintf("(R%d)", int(mem.Base)) + index := "" + if mem.Sign != 0 { + sign := "" + if mem.Sign < 0 { + sign = "" + } + shift := "" + if mem.Count != 0 { + shift = fmt.Sprintf("%s%d", plan9Shift[mem.Shift], mem.Count) + } + index = fmt.Sprintf("(%sR%d%s)", sign, int(mem.Index), shift) + } + args[1] = off + base + index + } + + // Reverse args, placing dest last. + for i, j := 0, len(args)-1; i < j; i, j = i+1, j-1 { + args[i], args[j] = args[j], args[i] + } + + switch inst.Op &^ 15 { + case MOV_EQ: + op = "MOVW" + op[3:] + + case LDR_EQ: + op = "MOVW" + op[3:] + suffix + case LDRB_EQ: + op = "MOVB" + op[4:] + suffix + case LDRH_EQ: + op = "MOVH" + op[4:] + suffix + + case STR_EQ: + op = "MOVW" + op[3:] + suffix + args[0], args[1] = args[1], args[0] + case STRB_EQ: + op = "MOVB" + op[4:] + suffix + args[0], args[1] = args[1], args[0] + case STRH_EQ: + op = "MOVH" + op[4:] + suffix + args[0], args[1] = args[1], args[0] + } + + if args != nil { + op += " " + strings.Join(args, ", ") + } + + return op +} + +// assembler syntax for the various shifts. +// @x> is a lie; the assembler uses @> 0 +// instead of @x> 1, but i wanted to be clear that it +// was a different operation (rotate right extended, not rotate right). +var plan9Shift = []string{"<<", ">>", "->", "@>", "@x>"} + +func plan9Arg(inst *Inst, pc uint64, symname func(uint64) (string, uint64), arg Arg) string { + switch a := arg.(type) { + case Endian: + + case Imm: + return fmt.Sprintf("$%d", int(a)) + + case Mem: + + case PCRel: + addr := uint32(pc) + 8 + uint32(a) + if s, base := symname(uint64(addr)); s != "" && uint64(addr) == base { + return fmt.Sprintf("%s(SB)", s) + } + return fmt.Sprintf("%#x", addr) + + case Reg: + if a < 16 { + return fmt.Sprintf("R%d", int(a)) + } + + case RegList: + var buf bytes.Buffer + start := -2 + end := -2 + fmt.Fprintf(&buf, "[") + flush := func() { + if start >= 0 { + if buf.Len() > 1 { + fmt.Fprintf(&buf, ",") + } + if start == end { + fmt.Fprintf(&buf, "R%d", start) + } else { + fmt.Fprintf(&buf, "R%d-R%d", start, end) + } + } + } + for i := 0; i < 16; i++ { + if a&(1< ,,# cond:4|0|0|1|0|1|0|1|S|Rn:4|Rd:4|imm12:12 + {0x0fe00090, 0x00a00010, 4, ADC_EQ, 0x14011c04, instArgs{arg_R_12, arg_R_16, arg_R_shift_R}}, // ADC{S} ,,, cond:4|0|0|0|0|1|0|1|S|Rn:4|Rd:4|Rs:4|0|type:2|1|Rm:4 + {0x0fe00010, 0x00a00000, 2, ADC_EQ, 0x14011c04, instArgs{arg_R_12, arg_R_16, arg_R_shift_imm}}, // ADC{S} ,,{,} cond:4|0|0|0|0|1|0|1|S|Rn:4|Rd:4|imm5:5|type:2|0|Rm:4 + {0x0fe00000, 0x02800000, 2, ADD_EQ, 0x14011c04, instArgs{arg_R_12, arg_R_16, arg_const}}, // ADD{S} ,,# cond:4|0|0|1|0|1|0|0|S|Rn:4|Rd:4|imm12:12 + {0x0fe00090, 0x00800010, 4, ADD_EQ, 0x14011c04, instArgs{arg_R_12, arg_R_16, arg_R_shift_R}}, // ADD{S} ,,, cond:4|0|0|0|0|1|0|0|S|Rn:4|Rd:4|Rs:4|0|type:2|1|Rm:4 + {0x0fe00010, 0x00800000, 2, ADD_EQ, 0x14011c04, instArgs{arg_R_12, arg_R_16, arg_R_shift_imm}}, // ADD{S} ,,{,} cond:4|0|0|0|0|1|0|0|S|Rn:4|Rd:4|imm5:5|type:2|0|Rm:4 + {0x0fef0000, 0x028d0000, 2, ADD_EQ, 0x14011c04, instArgs{arg_R_12, arg_SP, arg_const}}, // ADD{S} ,SP,# cond:4|0|0|1|0|1|0|0|S|1|1|0|1|Rd:4|imm12:12 + {0x0fef0010, 0x008d0000, 2, ADD_EQ, 0x14011c04, instArgs{arg_R_12, arg_SP, arg_R_shift_imm}}, // ADD{S} ,SP,{,} cond:4|0|0|0|0|1|0|0|S|1|1|0|1|Rd:4|imm5:5|type:2|0|Rm:4 + {0x0fe00000, 0x02000000, 2, AND_EQ, 0x14011c04, instArgs{arg_R_12, arg_R_16, arg_const}}, // AND{S} ,,# cond:4|0|0|1|0|0|0|0|S|Rn:4|Rd:4|imm12:12 + {0x0fe00090, 0x00000010, 4, AND_EQ, 0x14011c04, instArgs{arg_R_12, arg_R_16, arg_R_shift_R}}, // AND{S} ,,, cond:4|0|0|0|0|0|0|0|S|Rn:4|Rd:4|Rs:4|0|type:2|1|Rm:4 + {0x0fe00010, 0x00000000, 2, AND_EQ, 0x14011c04, instArgs{arg_R_12, arg_R_16, arg_R_shift_imm}}, // AND{S} ,,{,} cond:4|0|0|0|0|0|0|0|S|Rn:4|Rd:4|imm5:5|type:2|0|Rm:4 + {0x0fef0070, 0x01a00040, 4, ASR_EQ, 0x14011c04, instArgs{arg_R_12, arg_R_0, arg_imm5_32}}, // ASR{S} ,,# cond:4|0|0|0|1|1|0|1|S|0|0|0|0|Rd:4|imm5:5|1|0|0|Rm:4 + {0x0fef00f0, 0x01a00050, 4, ASR_EQ, 0x14011c04, instArgs{arg_R_12, arg_R_0, arg_R_8}}, // ASR{S} ,, cond:4|0|0|0|1|1|0|1|S|0|0|0|0|Rd:4|Rm:4|0|1|0|1|Rn:4 + {0x0f000000, 0x0a000000, 4, B_EQ, 0x1c04, instArgs{arg_label24}}, // B cond:4|1|0|1|0|imm24:24 + {0x0fe0007f, 0x07c0001f, 4, BFC_EQ, 0x1c04, instArgs{arg_R_12, arg_imm5, arg_lsb_width}}, // BFC ,#,# cond:4|0|1|1|1|1|1|0|msb:5|Rd:4|lsb:5|0|0|1|1|1|1|1 + {0x0fe00070, 0x07c00010, 2, BFI_EQ, 0x1c04, instArgs{arg_R_12, arg_R_0, arg_imm5, arg_lsb_width}}, // BFI ,,#,# cond:4|0|1|1|1|1|1|0|msb:5|Rd:4|lsb:5|0|0|1|Rn:4 + {0x0fe00000, 0x03c00000, 2, BIC_EQ, 0x14011c04, instArgs{arg_R_12, arg_R_16, arg_const}}, // BIC{S} ,,# cond:4|0|0|1|1|1|1|0|S|Rn:4|Rd:4|imm12:12 + {0x0fe00090, 0x01c00010, 4, BIC_EQ, 0x14011c04, instArgs{arg_R_12, arg_R_16, arg_R_shift_R}}, // BIC{S} ,,, cond:4|0|0|0|1|1|1|0|S|Rn:4|Rd:4|Rs:4|0|type:2|1|Rm:4 + {0x0fe00010, 0x01c00000, 2, BIC_EQ, 0x14011c04, instArgs{arg_R_12, arg_R_16, arg_R_shift_imm}}, // BIC{S} ,,{,} cond:4|0|0|0|1|1|1|0|S|Rn:4|Rd:4|imm5:5|type:2|0|Rm:4 + {0x0ff000f0, 0x01200070, 4, BKPT_EQ, 0x1c04, instArgs{arg_imm_12at8_4at0}}, // BKPT # cond:4|0|0|0|1|0|0|1|0|imm12:12|0|1|1|1|imm4:4 + {0x0f000000, 0x0b000000, 4, BL_EQ, 0x1c04, instArgs{arg_label24}}, // BL cond:4|1|0|1|1|imm24:24 + {0xfe000000, 0xfa000000, 4, BLX, 0x0, instArgs{arg_label24H}}, // BLX 1|1|1|1|1|0|1|H|imm24:24 + {0x0ffffff0, 0x012fff30, 4, BLX_EQ, 0x1c04, instArgs{arg_R_0}}, // BLX cond:4|0|0|0|1|0|0|1|0|(1)|(1)|(1)|(1)|(1)|(1)|(1)|(1)|(1)|(1)|(1)|(1)|0|0|1|1|Rm:4 + {0x0ff000f0, 0x012fff30, 3, BLX_EQ, 0x1c04, instArgs{arg_R_0}}, // BLX cond:4|0|0|0|1|0|0|1|0|(1)|(1)|(1)|(1)|(1)|(1)|(1)|(1)|(1)|(1)|(1)|(1)|0|0|1|1|Rm:4 + {0x0ffffff0, 0x012fff10, 4, BX_EQ, 0x1c04, instArgs{arg_R_0}}, // BX cond:4|0|0|0|1|0|0|1|0|(1)|(1)|(1)|(1)|(1)|(1)|(1)|(1)|(1)|(1)|(1)|(1)|0|0|0|1|Rm:4 + {0x0ff000f0, 0x012fff10, 3, BX_EQ, 0x1c04, instArgs{arg_R_0}}, // BX cond:4|0|0|0|1|0|0|1|0|(1)|(1)|(1)|(1)|(1)|(1)|(1)|(1)|(1)|(1)|(1)|(1)|0|0|0|1|Rm:4 + {0x0ffffff0, 0x012fff20, 4, BXJ_EQ, 0x1c04, instArgs{arg_R_0}}, // BXJ cond:4|0|0|0|1|0|0|1|0|(1)|(1)|(1)|(1)|(1)|(1)|(1)|(1)|(1)|(1)|(1)|(1)|0|0|1|0|Rm:4 + {0x0ff000f0, 0x012fff20, 3, BXJ_EQ, 0x1c04, instArgs{arg_R_0}}, // BXJ cond:4|0|0|0|1|0|0|1|0|(1)|(1)|(1)|(1)|(1)|(1)|(1)|(1)|(1)|(1)|(1)|(1)|0|0|1|0|Rm:4 + {0xffffffff, 0xf57ff01f, 4, CLREX, 0x0, instArgs{}}, // CLREX 1|1|1|1|0|1|0|1|0|1|1|1|(1)|(1)|(1)|(1)|(1)|(1)|(1)|(1)|(0)|(0)|(0)|(0)|0|0|0|1|(1)|(1)|(1)|(1) + {0xfff000f0, 0xf57ff01f, 3, CLREX, 0x0, instArgs{}}, // CLREX 1|1|1|1|0|1|0|1|0|1|1|1|(1)|(1)|(1)|(1)|(1)|(1)|(1)|(1)|(0)|(0)|(0)|(0)|0|0|0|1|(1)|(1)|(1)|(1) + {0x0fff0ff0, 0x016f0f10, 4, CLZ_EQ, 0x1c04, instArgs{arg_R_12, arg_R_0}}, // CLZ , cond:4|0|0|0|1|0|1|1|0|(1)|(1)|(1)|(1)|Rd:4|(1)|(1)|(1)|(1)|0|0|0|1|Rm:4 + {0x0ff000f0, 0x016f0f10, 3, CLZ_EQ, 0x1c04, instArgs{arg_R_12, arg_R_0}}, // CLZ , cond:4|0|0|0|1|0|1|1|0|(1)|(1)|(1)|(1)|Rd:4|(1)|(1)|(1)|(1)|0|0|0|1|Rm:4 + {0x0ff0f000, 0x03700000, 4, CMN_EQ, 0x1c04, instArgs{arg_R_16, arg_const}}, // CMN ,# cond:4|0|0|1|1|0|1|1|1|Rn:4|(0)|(0)|(0)|(0)|imm12:12 + {0x0ff00000, 0x03700000, 3, CMN_EQ, 0x1c04, instArgs{arg_R_16, arg_const}}, // CMN ,# cond:4|0|0|1|1|0|1|1|1|Rn:4|(0)|(0)|(0)|(0)|imm12:12 + {0x0ff0f090, 0x01700010, 4, CMN_EQ, 0x1c04, instArgs{arg_R_16, arg_R_shift_R}}, // CMN ,, cond:4|0|0|0|1|0|1|1|1|Rn:4|(0)|(0)|(0)|(0)|Rs:4|0|type:2|1|Rm:4 + {0x0ff00090, 0x01700010, 3, CMN_EQ, 0x1c04, instArgs{arg_R_16, arg_R_shift_R}}, // CMN ,, cond:4|0|0|0|1|0|1|1|1|Rn:4|(0)|(0)|(0)|(0)|Rs:4|0|type:2|1|Rm:4 + {0x0ff0f010, 0x01700000, 4, CMN_EQ, 0x1c04, instArgs{arg_R_16, arg_R_shift_imm}}, // CMN ,{,} cond:4|0|0|0|1|0|1|1|1|Rn:4|(0)|(0)|(0)|(0)|imm5:5|type:2|0|Rm:4 + {0x0ff00010, 0x01700000, 3, CMN_EQ, 0x1c04, instArgs{arg_R_16, arg_R_shift_imm}}, // CMN ,{,} cond:4|0|0|0|1|0|1|1|1|Rn:4|(0)|(0)|(0)|(0)|imm5:5|type:2|0|Rm:4 + {0x0ff0f000, 0x03500000, 4, CMP_EQ, 0x1c04, instArgs{arg_R_16, arg_const}}, // CMP ,# cond:4|0|0|1|1|0|1|0|1|Rn:4|(0)|(0)|(0)|(0)|imm12:12 + {0x0ff00000, 0x03500000, 3, CMP_EQ, 0x1c04, instArgs{arg_R_16, arg_const}}, // CMP ,# cond:4|0|0|1|1|0|1|0|1|Rn:4|(0)|(0)|(0)|(0)|imm12:12 + {0x0ff0f090, 0x01500010, 4, CMP_EQ, 0x1c04, instArgs{arg_R_16, arg_R_shift_R}}, // CMP ,, cond:4|0|0|0|1|0|1|0|1|Rn:4|(0)|(0)|(0)|(0)|Rs:4|0|type:2|1|Rm:4 + {0x0ff00090, 0x01500010, 3, CMP_EQ, 0x1c04, instArgs{arg_R_16, arg_R_shift_R}}, // CMP ,, cond:4|0|0|0|1|0|1|0|1|Rn:4|(0)|(0)|(0)|(0)|Rs:4|0|type:2|1|Rm:4 + {0x0ff0f010, 0x01500000, 4, CMP_EQ, 0x1c04, instArgs{arg_R_16, arg_R_shift_imm}}, // CMP ,{,} cond:4|0|0|0|1|0|1|0|1|Rn:4|(0)|(0)|(0)|(0)|imm5:5|type:2|0|Rm:4 + {0x0ff00010, 0x01500000, 3, CMP_EQ, 0x1c04, instArgs{arg_R_16, arg_R_shift_imm}}, // CMP ,{,} cond:4|0|0|0|1|0|1|0|1|Rn:4|(0)|(0)|(0)|(0)|imm5:5|type:2|0|Rm:4 + {0x0ffffff0, 0x0320f0f0, 4, DBG_EQ, 0x1c04, instArgs{arg_option}}, // DBG #
{{.Name}} N={{.N}}
+{{end}} + + +`)) + +// httpGoroutine serves list of goroutines in a particular group. +func httpGoroutine(w http.ResponseWriter, r *http.Request) { + events, err := parseEvents() + if err != nil { + http.Error(w, err.Error(), http.StatusInternalServerError) + return + } + pc, err := strconv.ParseUint(r.FormValue("id"), 10, 64) + if err != nil { + http.Error(w, fmt.Sprintf("failed to parse id parameter '%v': %v", r.FormValue("id"), err), http.StatusInternalServerError) + return + } + analyzeGoroutines(events) + var glist gdescList + for _, g := range gs { + if g.PC != pc || g.ExecTime == 0 { + continue + } + glist = append(glist, g) + } + sort.Sort(glist) + err = templGoroutine.Execute(w, glist) + if err != nil { + http.Error(w, fmt.Sprintf("failed to execute template: %v", err), http.StatusInternalServerError) + return + } +} + +var templGoroutine = template.Must(template.New("").Parse(` + + + + + + + + + + + + + + +{{range $}} + + + + + + + + + + + +{{end}} +
Goroutine Total time, ns Execution time, ns Network wait time, ns Sync block time, ns Blocking syscall time, ns Scheduler wait time, ns GC sweeping time, ns GC pause time, ns
{{.ID}} {{.TotalTime}} {{.ExecTime}} {{.IOTime}} {{.BlockTime}} {{.SyscallTime}} {{.SchedWaitTime}} {{.SweepTime}} {{.GCTime}}
+ + +`)) diff --git a/src/cmd/trace/main.go b/src/cmd/trace/main.go new file mode 100644 index 0000000000000000000000000000000000000000..27d8699b5aafdbc7c4c5c4b48d8f22e0c8e4cf38 --- /dev/null +++ b/src/cmd/trace/main.go @@ -0,0 +1,156 @@ +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +/* +Trace is a tool for viewing trace files. + +Trace files can be generated with: + - runtime/trace.Start + - net/http/pprof package + - go test -trace + +Example usage: +Generate a trace file with 'go test': + go test -trace trace.out pkg +View the trace in a web browser: + go tool trace pkg.test trace.out +*/ +package main + +import ( + "bufio" + "flag" + "fmt" + "internal/trace" + "net" + "net/http" + "os" + "os/exec" + "runtime" + "sync" +) + +const usageMessage = "" + + `Usage of 'go tool trace': +Given a trace file produced by 'go test': + go test -trace=trace.out pkg + +Open a web browser displaying trace: + go tool trace [flags] pkg.test trace.out + +Flags: + -http=addr: HTTP service address (e.g., ':6060') +` + +var ( + httpFlag = flag.String("http", "localhost:0", "HTTP service address (e.g., ':6060')") + + // The binary file name, left here for serveSVGProfile. + programBinary string + traceFile string +) + +func main() { + flag.Usage = func() { + fmt.Fprintln(os.Stderr, usageMessage) + os.Exit(2) + } + flag.Parse() + + // Usage information when no arguments. + if flag.NArg() != 2 { + flag.Usage() + } + programBinary = flag.Arg(0) + traceFile = flag.Arg(1) + + ln, err := net.Listen("tcp", *httpFlag) + if err != nil { + dief("failed to create server socket: %v\n", err) + } + // Open browser. + if !startBrowser("http://" + ln.Addr().String()) { + dief("failed to start browser\n") + } + + // Parse and symbolize trace asynchronously while browser opens. + go parseEvents() + + // Start http server. + http.HandleFunc("/", httpMain) + err = http.Serve(ln, nil) + dief("failed to start http server: %v\n", err) +} + +var loader struct { + once sync.Once + events []*trace.Event + err error +} + +func parseEvents() ([]*trace.Event, error) { + loader.once.Do(func() { + tracef, err := os.Open(flag.Arg(1)) + if err != nil { + loader.err = fmt.Errorf("failed to open trace file: %v", err) + return + } + defer tracef.Close() + + // Parse and symbolize. + events, err := trace.Parse(bufio.NewReader(tracef)) + if err != nil { + loader.err = fmt.Errorf("failed to parse trace: %v", err) + return + } + err = trace.Symbolize(events, programBinary) + if err != nil { + loader.err = fmt.Errorf("failed to symbolize trace: %v", err) + return + } + loader.events = events + }) + return loader.events, loader.err +} + +// httpMain serves the starting page. +func httpMain(w http.ResponseWriter, r *http.Request) { + w.Write(templMain) +} + +var templMain = []byte(` + + +View trace
+Goroutine analysis
+Network blocking profile
+Synchronization blocking profile
+Syscall blocking profile
+Scheduler latency profile
+ + +`) + +// startBrowser tries to open the URL in a browser +// and reports whether it succeeds. +// Note: copied from x/tools/cmd/cover/html.go +func startBrowser(url string) bool { + // try to start the browser + var args []string + switch runtime.GOOS { + case "darwin": + args = []string{"open"} + case "windows": + args = []string{"cmd", "/c", "start"} + default: + args = []string{"xdg-open"} + } + cmd := exec.Command(args[0], append(args[1:], url)...) + return cmd.Start() == nil +} + +func dief(msg string, args ...interface{}) { + fmt.Fprintf(os.Stderr, msg, args...) + os.Exit(1) +} diff --git a/src/cmd/trace/pprof.go b/src/cmd/trace/pprof.go new file mode 100644 index 0000000000000000000000000000000000000000..154f04d56c568587c3ef8c6aa171310f50b03183 --- /dev/null +++ b/src/cmd/trace/pprof.go @@ -0,0 +1,166 @@ +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Serving of pprof-like profiles. + +package main + +import ( + "bufio" + "fmt" + "internal/trace" + "io/ioutil" + "net/http" + "os" + "os/exec" +) + +func init() { + http.HandleFunc("/io", httpIO) + http.HandleFunc("/block", httpBlock) + http.HandleFunc("/syscall", httpSyscall) + http.HandleFunc("/sched", httpSched) +} + +// Record represents one entry in pprof-like profiles. +type Record struct { + stk []*trace.Frame + n uint64 + time int64 +} + +// httpIO serves IO pprof-like profile (time spent in IO wait). +func httpIO(w http.ResponseWriter, r *http.Request) { + events, err := parseEvents() + if err != nil { + http.Error(w, err.Error(), http.StatusInternalServerError) + return + } + prof := make(map[uint64]Record) + for _, ev := range events { + if ev.Type != trace.EvGoBlockNet || ev.Link == nil || ev.StkID == 0 || len(ev.Stk) == 0 { + continue + } + rec := prof[ev.StkID] + rec.stk = ev.Stk + rec.n++ + rec.time += ev.Link.Ts - ev.Ts + prof[ev.StkID] = rec + } + serveSVGProfile(w, r, prof) +} + +// httpBlock serves blocking pprof-like profile (time spent blocked on synchronization primitives). +func httpBlock(w http.ResponseWriter, r *http.Request) { + events, err := parseEvents() + if err != nil { + http.Error(w, err.Error(), http.StatusInternalServerError) + return + } + prof := make(map[uint64]Record) + for _, ev := range events { + switch ev.Type { + case trace.EvGoBlockSend, trace.EvGoBlockRecv, trace.EvGoBlockSelect, + trace.EvGoBlockSync, trace.EvGoBlockCond: + default: + continue + } + if ev.Link == nil || ev.StkID == 0 || len(ev.Stk) == 0 { + continue + } + rec := prof[ev.StkID] + rec.stk = ev.Stk + rec.n++ + rec.time += ev.Link.Ts - ev.Ts + prof[ev.StkID] = rec + } + serveSVGProfile(w, r, prof) +} + +// httpSyscall serves syscall pprof-like profile (time spent blocked in syscalls). +func httpSyscall(w http.ResponseWriter, r *http.Request) { + events, err := parseEvents() + if err != nil { + http.Error(w, err.Error(), http.StatusInternalServerError) + return + } + prof := make(map[uint64]Record) + for _, ev := range events { + if ev.Type != trace.EvGoSysCall || ev.Link == nil || ev.StkID == 0 || len(ev.Stk) == 0 { + continue + } + rec := prof[ev.StkID] + rec.stk = ev.Stk + rec.n++ + rec.time += ev.Link.Ts - ev.Ts + prof[ev.StkID] = rec + } + serveSVGProfile(w, r, prof) +} + +// httpSched serves scheduler latency pprof-like profile +// (time between a goroutine become runnable and actually scheduled for execution). +func httpSched(w http.ResponseWriter, r *http.Request) { + events, err := parseEvents() + if err != nil { + http.Error(w, err.Error(), http.StatusInternalServerError) + return + } + prof := make(map[uint64]Record) + for _, ev := range events { + if (ev.Type != trace.EvGoUnblock && ev.Type != trace.EvGoCreate) || + ev.Link == nil || ev.StkID == 0 || len(ev.Stk) == 0 { + continue + } + rec := prof[ev.StkID] + rec.stk = ev.Stk + rec.n++ + rec.time += ev.Link.Ts - ev.Ts + prof[ev.StkID] = rec + } + serveSVGProfile(w, r, prof) +} + +// generateSVGProfile generates pprof-like profile stored in prof and writes in to w. +func serveSVGProfile(w http.ResponseWriter, r *http.Request, prof map[uint64]Record) { + if len(prof) == 0 { + http.Error(w, "The profile is empty", http.StatusNotFound) + return + } + blockf, err := ioutil.TempFile("", "block") + if err != nil { + http.Error(w, fmt.Sprintf("failed to create temp file: %v", err), http.StatusInternalServerError) + return + } + defer os.Remove(blockf.Name()) + blockb := bufio.NewWriter(blockf) + fmt.Fprintf(blockb, "--- contention:\ncycles/second=1000000000\n") + for _, rec := range prof { + fmt.Fprintf(blockb, "%v %v @", rec.time, rec.n) + for _, f := range rec.stk { + fmt.Fprintf(blockb, " 0x%x", f.PC) + } + fmt.Fprintf(blockb, "\n") + } + err = blockb.Flush() + if err != nil { + http.Error(w, fmt.Sprintf("failed to flush temp file: %v", err), http.StatusInternalServerError) + return + } + err = blockf.Close() + if err != nil { + http.Error(w, fmt.Sprintf("failed to close temp file: %v", err), http.StatusInternalServerError) + return + } + + svgFilename := blockf.Name() + ".svg" + _, err = exec.Command("go", "tool", "pprof", "-svg", "-output", svgFilename, programBinary, blockf.Name()).CombinedOutput() + if err != nil { + http.Error(w, fmt.Sprintf("failed to execute go tool pprof: %v", err), http.StatusInternalServerError) + return + } + defer os.Remove(svgFilename) + w.Header().Set("Content-Type", "image/svg+xml") + http.ServeFile(w, r, svgFilename) +} diff --git a/src/cmd/trace/trace.go b/src/cmd/trace/trace.go new file mode 100644 index 0000000000000000000000000000000000000000..e6eb320aa23b83ef78a741460d9582b4823d4cce --- /dev/null +++ b/src/cmd/trace/trace.go @@ -0,0 +1,445 @@ +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +import ( + "encoding/json" + "fmt" + "internal/trace" + "log" + "net/http" + "path/filepath" + "runtime" + "strconv" + "strings" +) + +func init() { + http.HandleFunc("/trace", httpTrace) + http.HandleFunc("/jsontrace", httpJsonTrace) + http.HandleFunc("/trace_viewer_html", httpTraceViewerHTML) +} + +// httpTrace serves either whole trace (goid==0) or trace for goid goroutine. +func httpTrace(w http.ResponseWriter, r *http.Request) { + _, err := parseEvents() + if err != nil { + http.Error(w, err.Error(), http.StatusInternalServerError) + return + } + + params := "" + if goids := r.FormValue("goid"); goids != "" { + goid, err := strconv.ParseUint(goids, 10, 64) + if err != nil { + http.Error(w, fmt.Sprintf("failed to parse goid parameter '%v': %v", goids, err), http.StatusInternalServerError) + return + } + params = fmt.Sprintf("?goid=%v", goid) + } + html := strings.Replace(templTrace, "{{PARAMS}}", params, -1) + w.Write([]byte(html)) + +} + +var templTrace = ` + + + + + + + + +` + +// httpTraceViewerHTML serves static part of trace-viewer. +// This URL is queried from templTrace HTML. +func httpTraceViewerHTML(w http.ResponseWriter, r *http.Request) { + http.ServeFile(w, r, filepath.Join(runtime.GOROOT(), "misc", "trace", "trace_viewer_lean.html")) +} + +// httpJsonTrace serves json trace, requested from within templTrace HTML. +func httpJsonTrace(w http.ResponseWriter, r *http.Request) { + // This is an AJAX handler, so instead of http.Error we use log.Printf to log errors. + events, err := parseEvents() + if err != nil { + log.Printf("failed to parse trace: %v", err) + return + } + + params := &traceParams{ + events: events, + endTime: int64(1<<63 - 1), + } + + if goids := r.FormValue("goid"); goids != "" { + goid, err := strconv.ParseUint(goids, 10, 64) + if err != nil { + log.Printf("failed to parse goid parameter '%v': %v", goids, err) + return + } + analyzeGoroutines(events) + g := gs[goid] + params.gtrace = true + params.startTime = g.StartTime + params.endTime = g.EndTime + params.maing = goid + params.gs = trace.RelatedGoroutines(events, goid) + } + + err = json.NewEncoder(w).Encode(generateTrace(params)) + if err != nil { + log.Printf("failed to serialize trace: %v", err) + return + } +} + +type traceParams struct { + events []*trace.Event + gtrace bool + startTime int64 + endTime int64 + maing uint64 + gs map[uint64]bool +} + +type traceContext struct { + *traceParams + data ViewerData + frameTree frameNode + frameSeq int + arrowSeq uint64 + heapAlloc uint64 + nextGC uint64 + gcount uint64 + grunnable uint64 + grunning uint64 + insyscall uint64 + prunning uint64 +} + +type frameNode struct { + id int + children map[uint64]frameNode +} + +type ViewerData struct { + Events []*ViewerEvent `json:"traceEvents"` + Frames map[string]ViewerFrame `json:"stackFrames"` + TimeUnit string `json:"displayTimeUnit"` +} + +type ViewerEvent struct { + Name string `json:"name,omitempty"` + Phase string `json:"ph"` + Scope string `json:"s,omitempty"` + Time float64 `json:"ts"` + Dur float64 `json:"dur,omitempty"` + Pid uint64 `json:"pid"` + Tid uint64 `json:"tid"` + ID uint64 `json:"id,omitempty"` + Stack int `json:"sf,omitempty"` + EndStack int `json:"esf,omitempty"` + Arg interface{} `json:"args,omitempty"` +} + +type ViewerFrame struct { + Name string `json:"name"` + Parent int `json:"parent,omitempty"` +} + +type NameArg struct { + Name string `json:"name"` +} + +type SortIndexArg struct { + Index int `json:"sort_index"` +} + +// generateTrace generates json trace for trace-viewer: +// https://github.com/google/trace-viewer +// Trace format is described at: +// https://docs.google.com/document/d/1CvAClvFfyA5R-PhYUmn5OOQtYMH4h6I0nSsKchNAySU/view +// If gtrace=true, generate trace for goroutine goid, otherwise whole trace. +// startTime, endTime determine part of the trace that we are interested in. +// gset restricts goroutines that are included in the resulting trace. +func generateTrace(params *traceParams) ViewerData { + ctx := &traceContext{traceParams: params} + ctx.frameTree.children = make(map[uint64]frameNode) + ctx.data.Frames = make(map[string]ViewerFrame) + ctx.data.TimeUnit = "ns" + maxProc := 0 + gnames := make(map[uint64]string) + for _, ev := range ctx.events { + // Handle trace.EvGoStart separately, because we need the goroutine name + // even if ignore the event otherwise. + if ev.Type == trace.EvGoStart { + if _, ok := gnames[ev.G]; !ok { + if len(ev.Stk) > 0 { + gnames[ev.G] = fmt.Sprintf("G%v %s", ev.G, ev.Stk[0].Fn) + } else { + gnames[ev.G] = fmt.Sprintf("G%v", ev.G) + } + } + } + + // Ignore events that are from uninteresting goroutines + // or outside of the interesting timeframe. + if ctx.gs != nil && ev.P < trace.FakeP && !ctx.gs[ev.G] { + continue + } + if ev.Ts < ctx.startTime || ev.Ts > ctx.endTime { + continue + } + + if ev.P < trace.FakeP && ev.P > maxProc { + maxProc = ev.P + } + + switch ev.Type { + case trace.EvProcStart: + if ctx.gtrace { + continue + } + ctx.prunning++ + ctx.emitThreadCounters(ev) + ctx.emitInstant(ev, "proc start") + case trace.EvProcStop: + if ctx.gtrace { + continue + } + ctx.prunning-- + ctx.emitThreadCounters(ev) + ctx.emitInstant(ev, "proc stop") + case trace.EvGCStart: + ctx.emitSlice(ev, "GC") + case trace.EvGCDone: + case trace.EvGCScanStart: + if ctx.gtrace { + continue + } + ctx.emitSlice(ev, "MARK") + case trace.EvGCScanDone: + case trace.EvGCSweepStart: + ctx.emitSlice(ev, "SWEEP") + case trace.EvGCSweepDone: + case trace.EvGoStart: + ctx.grunnable-- + ctx.grunning++ + ctx.emitGoroutineCounters(ev) + ctx.emitSlice(ev, gnames[ev.G]) + case trace.EvGoCreate: + ctx.gcount++ + ctx.grunnable++ + ctx.emitGoroutineCounters(ev) + ctx.emitArrow(ev, "go") + case trace.EvGoEnd: + ctx.gcount-- + ctx.grunning-- + ctx.emitGoroutineCounters(ev) + case trace.EvGoUnblock: + ctx.grunnable++ + ctx.emitGoroutineCounters(ev) + ctx.emitArrow(ev, "unblock") + case trace.EvGoSysCall: + ctx.emitInstant(ev, "syscall") + case trace.EvGoSysExit: + ctx.grunnable++ + ctx.emitGoroutineCounters(ev) + ctx.insyscall-- + ctx.emitThreadCounters(ev) + ctx.emitArrow(ev, "sysexit") + case trace.EvGoSysBlock: + ctx.grunning-- + ctx.emitGoroutineCounters(ev) + ctx.insyscall++ + ctx.emitThreadCounters(ev) + case trace.EvGoSched, trace.EvGoPreempt: + ctx.grunnable++ + ctx.grunning-- + ctx.emitGoroutineCounters(ev) + case trace.EvGoStop, + trace.EvGoSleep, trace.EvGoBlock, trace.EvGoBlockSend, trace.EvGoBlockRecv, + trace.EvGoBlockSelect, trace.EvGoBlockSync, trace.EvGoBlockCond, trace.EvGoBlockNet: + ctx.grunning-- + ctx.emitGoroutineCounters(ev) + case trace.EvGoWaiting: + ctx.grunnable-- + ctx.emitGoroutineCounters(ev) + case trace.EvGoInSyscall: + ctx.insyscall++ + ctx.emitThreadCounters(ev) + case trace.EvHeapAlloc: + ctx.heapAlloc = ev.Args[0] + ctx.emitHeapCounters(ev) + case trace.EvNextGC: + ctx.nextGC = ev.Args[0] + ctx.emitHeapCounters(ev) + } + } + + ctx.emit(&ViewerEvent{Name: "process_name", Phase: "M", Pid: 0, Arg: &NameArg{"PROCS"}}) + ctx.emit(&ViewerEvent{Name: "process_sort_index", Phase: "M", Pid: 0, Arg: &SortIndexArg{1}}) + + ctx.emit(&ViewerEvent{Name: "process_name", Phase: "M", Pid: 1, Arg: &NameArg{"STATS"}}) + ctx.emit(&ViewerEvent{Name: "process_sort_index", Phase: "M", Pid: 1, Arg: &SortIndexArg{0}}) + + ctx.emit(&ViewerEvent{Name: "thread_name", Phase: "M", Pid: 0, Tid: trace.NetpollP, Arg: &NameArg{"Network"}}) + ctx.emit(&ViewerEvent{Name: "thread_sort_index", Phase: "M", Pid: 0, Tid: trace.NetpollP, Arg: &SortIndexArg{-5}}) + + ctx.emit(&ViewerEvent{Name: "thread_name", Phase: "M", Pid: 0, Tid: trace.TimerP, Arg: &NameArg{"Timers"}}) + ctx.emit(&ViewerEvent{Name: "thread_sort_index", Phase: "M", Pid: 0, Tid: trace.TimerP, Arg: &SortIndexArg{-4}}) + + ctx.emit(&ViewerEvent{Name: "thread_name", Phase: "M", Pid: 0, Tid: trace.SyscallP, Arg: &NameArg{"Syscalls"}}) + ctx.emit(&ViewerEvent{Name: "thread_sort_index", Phase: "M", Pid: 0, Tid: trace.SyscallP, Arg: &SortIndexArg{-3}}) + + if !ctx.gtrace { + for i := 0; i <= maxProc; i++ { + ctx.emit(&ViewerEvent{Name: "thread_name", Phase: "M", Pid: 0, Tid: uint64(i), Arg: &NameArg{fmt.Sprintf("Proc %v", i)}}) + ctx.emit(&ViewerEvent{Name: "thread_sort_index", Phase: "M", Pid: 0, Tid: uint64(i), Arg: &SortIndexArg{i}}) + } + } + + if ctx.gtrace && ctx.gs != nil { + for k, v := range gnames { + if !ctx.gs[k] { + continue + } + ctx.emit(&ViewerEvent{Name: "thread_name", Phase: "M", Pid: 0, Tid: k, Arg: &NameArg{v}}) + } + ctx.emit(&ViewerEvent{Name: "thread_sort_index", Phase: "M", Pid: 0, Tid: ctx.maing, Arg: &SortIndexArg{-2}}) + ctx.emit(&ViewerEvent{Name: "thread_sort_index", Phase: "M", Pid: 0, Tid: 0, Arg: &SortIndexArg{-1}}) + } + + return ctx.data +} + +func (ctx *traceContext) emit(e *ViewerEvent) { + ctx.data.Events = append(ctx.data.Events, e) +} + +func (ctx *traceContext) time(ev *trace.Event) float64 { + // Trace viewer wants timestamps in microseconds. + return float64(ev.Ts-ctx.startTime) / 1000 +} + +func (ctx *traceContext) proc(ev *trace.Event) uint64 { + if ctx.gtrace && ev.P < trace.FakeP { + return ev.G + } else { + return uint64(ev.P) + } +} + +func (ctx *traceContext) emitSlice(ev *trace.Event, name string) { + ctx.emit(&ViewerEvent{ + Name: name, + Phase: "X", + Time: ctx.time(ev), + Dur: ctx.time(ev.Link) - ctx.time(ev), + Tid: ctx.proc(ev), + Stack: ctx.stack(ev.Stk), + EndStack: ctx.stack(ev.Link.Stk), + }) +} + +func (ctx *traceContext) emitHeapCounters(ev *trace.Event) { + type Arg struct { + Allocated uint64 + NextGC uint64 + } + if ctx.gtrace { + return + } + diff := uint64(0) + if ctx.nextGC > ctx.heapAlloc { + diff = ctx.nextGC - ctx.heapAlloc + } + ctx.emit(&ViewerEvent{Name: "Heap", Phase: "C", Time: ctx.time(ev), Pid: 1, Arg: &Arg{ctx.heapAlloc, diff}}) +} + +func (ctx *traceContext) emitGoroutineCounters(ev *trace.Event) { + type Arg struct { + Running uint64 + Runnable uint64 + } + if ctx.gtrace { + return + } + ctx.emit(&ViewerEvent{Name: "Goroutines", Phase: "C", Time: ctx.time(ev), Pid: 1, Arg: &Arg{ctx.grunning, ctx.grunnable}}) +} + +func (ctx *traceContext) emitThreadCounters(ev *trace.Event) { + type Arg struct { + Running uint64 + InSyscall uint64 + } + if ctx.gtrace { + return + } + ctx.emit(&ViewerEvent{Name: "Threads", Phase: "C", Time: ctx.time(ev), Pid: 1, Arg: &Arg{ctx.prunning, ctx.insyscall}}) +} + +func (ctx *traceContext) emitInstant(ev *trace.Event, name string) { + var arg interface{} + if ev.Type == trace.EvProcStart { + type Arg struct { + ThreadID uint64 + } + arg = &Arg{ev.Args[0]} + } + ctx.emit(&ViewerEvent{Name: name, Phase: "I", Scope: "t", Time: ctx.time(ev), Tid: ctx.proc(ev), Stack: ctx.stack(ev.Stk), Arg: arg}) +} + +func (ctx *traceContext) emitArrow(ev *trace.Event, name string) { + if ev.Link == nil { + // The other end of the arrow is not captured in the trace. + // For example, a goroutine was unblocked but was not scheduled before trace stop. + return + } + if ctx.gtrace && (!ctx.gs[ev.Link.G] || ev.Link.Ts < ctx.startTime || ev.Link.Ts > ctx.endTime) { + return + } + + if ev.P == trace.NetpollP || ev.P == trace.TimerP || ev.P == trace.SyscallP { + // Trace-viewer discards arrows if they don't start/end inside of a slice or instant. + // So emit a fake instant at the start of the arrow. + ctx.emitInstant(&trace.Event{P: ev.P, Ts: ev.Ts}, "unblock") + } + + ctx.arrowSeq++ + ctx.emit(&ViewerEvent{Name: name, Phase: "s", Tid: ctx.proc(ev), ID: ctx.arrowSeq, Time: ctx.time(ev), Stack: ctx.stack(ev.Stk)}) + ctx.emit(&ViewerEvent{Name: name, Phase: "t", Tid: ctx.proc(ev.Link), ID: ctx.arrowSeq, Time: ctx.time(ev.Link)}) +} + +func (ctx *traceContext) stack(stk []*trace.Frame) int { + return ctx.buildBranch(ctx.frameTree, stk) +} + +// buildBranch builds one branch in the prefix tree rooted at ctx.frameTree. +func (ctx *traceContext) buildBranch(parent frameNode, stk []*trace.Frame) int { + if len(stk) == 0 { + return parent.id + } + last := len(stk) - 1 + frame := stk[last] + stk = stk[:last] + + node, ok := parent.children[frame.PC] + if !ok { + ctx.frameSeq++ + node.id = ctx.frameSeq + node.children = make(map[uint64]frameNode) + parent.children[frame.PC] = node + ctx.data.Frames[strconv.Itoa(node.id)] = ViewerFrame{fmt.Sprintf("%v:%v", frame.Fn, frame.Line), parent.id} + } + return ctx.buildBranch(node, stk) +} diff --git a/src/cmd/vet/asmdecl.go b/src/cmd/vet/asmdecl.go new file mode 100644 index 0000000000000000000000000000000000000000..e4a9871a2146ddfd17f5318ec5bd5e46ae334a6e --- /dev/null +++ b/src/cmd/vet/asmdecl.go @@ -0,0 +1,662 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Identify mismatches between assembly files and Go func declarations. + +package main + +import ( + "bytes" + "fmt" + "go/ast" + "go/token" + "regexp" + "strconv" + "strings" +) + +// 'kind' is a kind of assembly variable. +// The kinds 1, 2, 4, 8 stand for values of that size. +type asmKind int + +// These special kinds are not valid sizes. +const ( + asmString asmKind = 100 + iota + asmSlice + asmInterface + asmEmptyInterface +) + +// An asmArch describes assembly parameters for an architecture +type asmArch struct { + name string + ptrSize int + intSize int + maxAlign int + bigEndian bool + stack string + lr bool +} + +// An asmFunc describes the expected variables for a function on a given architecture. +type asmFunc struct { + arch *asmArch + size int // size of all arguments + vars map[string]*asmVar + varByOffset map[int]*asmVar +} + +// An asmVar describes a single assembly variable. +type asmVar struct { + name string + kind asmKind + typ string + off int + size int + inner []*asmVar +} + +var ( + asmArch386 = asmArch{"386", 4, 4, 4, false, "SP", false} + asmArchArm = asmArch{"arm", 4, 4, 4, false, "R13", true} + asmArchArm64 = asmArch{"arm64", 8, 8, 8, false, "RSP", true} + asmArchAmd64 = asmArch{"amd64", 8, 8, 8, false, "SP", false} + asmArchAmd64p32 = asmArch{"amd64p32", 4, 4, 8, false, "SP", false} + asmArchPpc64 = asmArch{"ppc64", 8, 8, 8, true, "R1", true} + asmArchPpc64LE = asmArch{"ppc64le", 8, 8, 8, false, "R1", true} + + arches = []*asmArch{ + &asmArch386, + &asmArchArm, + &asmArchArm64, + &asmArchAmd64, + &asmArchAmd64p32, + &asmArchPpc64, + &asmArchPpc64LE, + } +) + +var ( + re = regexp.MustCompile + asmPlusBuild = re(`//\s+\+build\s+([^\n]+)`) + asmTEXT = re(`\bTEXT\b.*·([^\(]+)\(SB\)(?:\s*,\s*([0-9A-Z|+]+))?(?:\s*,\s*\$(-?[0-9]+)(?:-([0-9]+))?)?`) + asmDATA = re(`\b(DATA|GLOBL)\b`) + asmNamedFP = re(`([a-zA-Z0-9_\xFF-\x{10FFFF}]+)(?:\+([0-9]+))\(FP\)`) + asmUnnamedFP = re(`[^+\-0-9](([0-9]+)\(FP\))`) + asmSP = re(`[^+\-0-9](([0-9]+)\(([A-Z0-9]+)\))`) + asmOpcode = re(`^\s*(?:[A-Z0-9a-z_]+:)?\s*([A-Z]+)\s*([^,]*)(?:,\s*(.*))?`) + ppc64Suff = re(`([BHWD])(ZU|Z|U|BR)?$`) +) + +func asmCheck(pkg *Package) { + if !vet("asmdecl") { + return + } + + // No work if no assembly files. + if !pkg.hasFileWithSuffix(".s") { + return + } + + // Gather declarations. knownFunc[name][arch] is func description. + knownFunc := make(map[string]map[string]*asmFunc) + + for _, f := range pkg.files { + if f.file != nil { + for _, decl := range f.file.Decls { + if decl, ok := decl.(*ast.FuncDecl); ok && decl.Body == nil { + knownFunc[decl.Name.Name] = f.asmParseDecl(decl) + } + } + } + } + +Files: + for _, f := range pkg.files { + if !strings.HasSuffix(f.name, ".s") { + continue + } + Println("Checking file", f.name) + + // Determine architecture from file name if possible. + var arch string + var archDef *asmArch + for _, a := range arches { + if strings.HasSuffix(f.name, "_"+a.name+".s") { + arch = a.name + archDef = a + break + } + } + + lines := strings.SplitAfter(string(f.content), "\n") + var ( + fn *asmFunc + fnName string + localSize, argSize int + wroteSP bool + haveRetArg bool + retLine []int + ) + + flushRet := func() { + if fn != nil && fn.vars["ret"] != nil && !haveRetArg && len(retLine) > 0 { + v := fn.vars["ret"] + for _, line := range retLine { + f.Badf(token.NoPos, "%s:%d: [%s] %s: RET without writing to %d-byte ret+%d(FP)", f.name, line, arch, fnName, v.size, v.off) + } + } + retLine = nil + } + for lineno, line := range lines { + lineno++ + + badf := func(format string, args ...interface{}) { + f.Badf(token.NoPos, "%s:%d: [%s] %s: %s", f.name, lineno, arch, fnName, fmt.Sprintf(format, args...)) + } + + if arch == "" { + // Determine architecture from +build line if possible. + if m := asmPlusBuild.FindStringSubmatch(line); m != nil { + Fields: + for _, fld := range strings.Fields(m[1]) { + for _, a := range arches { + if a.name == fld { + arch = a.name + archDef = a + break Fields + } + } + } + } + } + + if m := asmTEXT.FindStringSubmatch(line); m != nil { + flushRet() + if arch == "" { + f.Warnf(token.NoPos, "%s: cannot determine architecture for assembly file", f.name) + continue Files + } + fnName = m[1] + fn = knownFunc[m[1]][arch] + if fn != nil { + size, _ := strconv.Atoi(m[4]) + if size != fn.size && (m[2] != "7" && !strings.Contains(m[2], "NOSPLIT") || size != 0) { + badf("wrong argument size %d; expected $...-%d", size, fn.size) + } + } + localSize, _ = strconv.Atoi(m[3]) + localSize += archDef.intSize + if archDef.lr { + // Account for caller's saved LR + localSize += archDef.intSize + } + argSize, _ = strconv.Atoi(m[4]) + if fn == nil && !strings.Contains(fnName, "<>") { + badf("function %s missing Go declaration", fnName) + } + wroteSP = false + haveRetArg = false + continue + } else if strings.Contains(line, "TEXT") && strings.Contains(line, "SB") { + // function, but not visible from Go (didn't match asmTEXT), so stop checking + flushRet() + fn = nil + fnName = "" + continue + } + + if strings.Contains(line, "RET") { + retLine = append(retLine, lineno) + } + + if fnName == "" { + continue + } + + if asmDATA.FindStringSubmatch(line) != nil { + fn = nil + } + + if archDef == nil { + continue + } + + if strings.Contains(line, ", "+archDef.stack) || strings.Contains(line, ",\t"+archDef.stack) { + wroteSP = true + continue + } + + for _, m := range asmSP.FindAllStringSubmatch(line, -1) { + if m[3] != archDef.stack || wroteSP { + continue + } + off := 0 + if m[1] != "" { + off, _ = strconv.Atoi(m[2]) + } + if off >= localSize { + if fn != nil { + v := fn.varByOffset[off-localSize] + if v != nil { + badf("%s should be %s+%d(FP)", m[1], v.name, off-localSize) + continue + } + } + if off >= localSize+argSize { + badf("use of %s points beyond argument frame", m[1]) + continue + } + badf("use of %s to access argument frame", m[1]) + } + } + + if fn == nil { + continue + } + + for _, m := range asmUnnamedFP.FindAllStringSubmatch(line, -1) { + off, _ := strconv.Atoi(m[2]) + v := fn.varByOffset[off] + if v != nil { + badf("use of unnamed argument %s; offset %d is %s+%d(FP)", m[1], off, v.name, v.off) + } else { + badf("use of unnamed argument %s", m[1]) + } + } + + for _, m := range asmNamedFP.FindAllStringSubmatch(line, -1) { + name := m[1] + off := 0 + if m[2] != "" { + off, _ = strconv.Atoi(m[2]) + } + if name == "ret" || strings.HasPrefix(name, "ret_") { + haveRetArg = true + } + v := fn.vars[name] + if v == nil { + // Allow argframe+0(FP). + if name == "argframe" && off == 0 { + continue + } + v = fn.varByOffset[off] + if v != nil { + badf("unknown variable %s; offset %d is %s+%d(FP)", name, off, v.name, v.off) + } else { + badf("unknown variable %s", name) + } + continue + } + asmCheckVar(badf, fn, line, m[0], off, v) + } + } + flushRet() + } +} + +// asmParseDecl parses a function decl for expected assembly variables. +func (f *File) asmParseDecl(decl *ast.FuncDecl) map[string]*asmFunc { + var ( + arch *asmArch + fn *asmFunc + offset int + failed bool + ) + + addVar := func(outer string, v asmVar) { + if vo := fn.vars[outer]; vo != nil { + vo.inner = append(vo.inner, &v) + } + fn.vars[v.name] = &v + for i := 0; i < v.size; i++ { + fn.varByOffset[v.off+i] = &v + } + } + + addParams := func(list []*ast.Field) { + for i, fld := range list { + // Determine alignment, size, and kind of type in declaration. + var align, size int + var kind asmKind + names := fld.Names + typ := f.gofmt(fld.Type) + switch t := fld.Type.(type) { + default: + switch typ { + default: + f.Warnf(fld.Type.Pos(), "unknown assembly argument type %s", typ) + failed = true + return + case "int8", "uint8", "byte", "bool": + size = 1 + case "int16", "uint16": + size = 2 + case "int32", "uint32", "float32": + size = 4 + case "int64", "uint64", "float64": + align = arch.maxAlign + size = 8 + case "int", "uint": + size = arch.intSize + case "uintptr", "iword", "Word", "Errno", "unsafe.Pointer": + size = arch.ptrSize + case "string", "ErrorString": + size = arch.ptrSize * 2 + align = arch.ptrSize + kind = asmString + } + case *ast.ChanType, *ast.FuncType, *ast.MapType, *ast.StarExpr: + size = arch.ptrSize + case *ast.InterfaceType: + align = arch.ptrSize + size = 2 * arch.ptrSize + if len(t.Methods.List) > 0 { + kind = asmInterface + } else { + kind = asmEmptyInterface + } + case *ast.ArrayType: + if t.Len == nil { + size = arch.ptrSize + 2*arch.intSize + align = arch.ptrSize + kind = asmSlice + break + } + f.Warnf(fld.Type.Pos(), "unsupported assembly argument type %s", typ) + failed = true + case *ast.StructType: + f.Warnf(fld.Type.Pos(), "unsupported assembly argument type %s", typ) + failed = true + } + if align == 0 { + align = size + } + if kind == 0 { + kind = asmKind(size) + } + offset += -offset & (align - 1) + + // Create variable for each name being declared with this type. + if len(names) == 0 { + name := "unnamed" + if decl.Type.Results != nil && len(decl.Type.Results.List) > 0 && &list[0] == &decl.Type.Results.List[0] && i == 0 { + // Assume assembly will refer to single unnamed result as r. + name = "ret" + } + names = []*ast.Ident{{Name: name}} + } + for _, id := range names { + name := id.Name + addVar("", asmVar{ + name: name, + kind: kind, + typ: typ, + off: offset, + size: size, + }) + switch kind { + case 8: + if arch.ptrSize == 4 { + w1, w2 := "lo", "hi" + if arch.bigEndian { + w1, w2 = w2, w1 + } + addVar(name, asmVar{ + name: name + "_" + w1, + kind: 4, + typ: "half " + typ, + off: offset, + size: 4, + }) + addVar(name, asmVar{ + name: name + "_" + w2, + kind: 4, + typ: "half " + typ, + off: offset + 4, + size: 4, + }) + } + + case asmEmptyInterface: + addVar(name, asmVar{ + name: name + "_type", + kind: asmKind(arch.ptrSize), + typ: "interface type", + off: offset, + size: arch.ptrSize, + }) + addVar(name, asmVar{ + name: name + "_data", + kind: asmKind(arch.ptrSize), + typ: "interface data", + off: offset + arch.ptrSize, + size: arch.ptrSize, + }) + + case asmInterface: + addVar(name, asmVar{ + name: name + "_itable", + kind: asmKind(arch.ptrSize), + typ: "interface itable", + off: offset, + size: arch.ptrSize, + }) + addVar(name, asmVar{ + name: name + "_data", + kind: asmKind(arch.ptrSize), + typ: "interface data", + off: offset + arch.ptrSize, + size: arch.ptrSize, + }) + + case asmSlice: + addVar(name, asmVar{ + name: name + "_base", + kind: asmKind(arch.ptrSize), + typ: "slice base", + off: offset, + size: arch.ptrSize, + }) + addVar(name, asmVar{ + name: name + "_len", + kind: asmKind(arch.intSize), + typ: "slice len", + off: offset + arch.ptrSize, + size: arch.intSize, + }) + addVar(name, asmVar{ + name: name + "_cap", + kind: asmKind(arch.intSize), + typ: "slice cap", + off: offset + arch.ptrSize + arch.intSize, + size: arch.intSize, + }) + + case asmString: + addVar(name, asmVar{ + name: name + "_base", + kind: asmKind(arch.ptrSize), + typ: "string base", + off: offset, + size: arch.ptrSize, + }) + addVar(name, asmVar{ + name: name + "_len", + kind: asmKind(arch.intSize), + typ: "string len", + off: offset + arch.ptrSize, + size: arch.intSize, + }) + } + offset += size + } + } + } + + m := make(map[string]*asmFunc) + for _, arch = range arches { + fn = &asmFunc{ + arch: arch, + vars: make(map[string]*asmVar), + varByOffset: make(map[int]*asmVar), + } + offset = 0 + addParams(decl.Type.Params.List) + if decl.Type.Results != nil && len(decl.Type.Results.List) > 0 { + offset += -offset & (arch.maxAlign - 1) + addParams(decl.Type.Results.List) + } + fn.size = offset + m[arch.name] = fn + } + + if failed { + return nil + } + return m +} + +// asmCheckVar checks a single variable reference. +func asmCheckVar(badf func(string, ...interface{}), fn *asmFunc, line, expr string, off int, v *asmVar) { + m := asmOpcode.FindStringSubmatch(line) + if m == nil { + if !strings.HasPrefix(strings.TrimSpace(line), "//") { + badf("cannot find assembly opcode") + } + return + } + + // Determine operand sizes from instruction. + // Typically the suffix suffices, but there are exceptions. + var src, dst, kind asmKind + op := m[1] + switch fn.arch.name + "." + op { + case "386.FMOVLP": + src, dst = 8, 4 + case "arm.MOVD": + src = 8 + case "arm.MOVW": + src = 4 + case "arm.MOVH", "arm.MOVHU": + src = 2 + case "arm.MOVB", "arm.MOVBU": + src = 1 + // LEA* opcodes don't really read the second arg. + // They just take the address of it. + case "386.LEAL": + dst = 4 + case "amd64.LEAQ": + dst = 8 + case "amd64p32.LEAL": + dst = 4 + default: + switch fn.arch.name { + case "386", "amd64": + if strings.HasPrefix(op, "F") && (strings.HasSuffix(op, "D") || strings.HasSuffix(op, "DP")) { + // FMOVDP, FXCHD, etc + src = 8 + break + } + if strings.HasPrefix(op, "F") && (strings.HasSuffix(op, "F") || strings.HasSuffix(op, "FP")) { + // FMOVFP, FXCHF, etc + src = 4 + break + } + if strings.HasSuffix(op, "SD") { + // MOVSD, SQRTSD, etc + src = 8 + break + } + if strings.HasSuffix(op, "SS") { + // MOVSS, SQRTSS, etc + src = 4 + break + } + if strings.HasPrefix(op, "SET") { + // SETEQ, etc + src = 1 + break + } + switch op[len(op)-1] { + case 'B': + src = 1 + case 'W': + src = 2 + case 'L': + src = 4 + case 'D', 'Q': + src = 8 + } + case "ppc64", "ppc64le": + // Strip standard suffixes to reveal size letter. + m := ppc64Suff.FindStringSubmatch(op) + if m != nil { + switch m[1][0] { + case 'B': + src = 1 + case 'H': + src = 2 + case 'W': + src = 4 + case 'D': + src = 8 + } + } + } + } + if dst == 0 { + dst = src + } + + // Determine whether the match we're holding + // is the first or second argument. + if strings.Index(line, expr) > strings.Index(line, ",") { + kind = dst + } else { + kind = src + } + + vk := v.kind + vt := v.typ + switch vk { + case asmInterface, asmEmptyInterface, asmString, asmSlice: + // allow reference to first word (pointer) + vk = v.inner[0].kind + vt = v.inner[0].typ + } + + if off != v.off { + var inner bytes.Buffer + for i, vi := range v.inner { + if len(v.inner) > 1 { + fmt.Fprintf(&inner, ",") + } + fmt.Fprintf(&inner, " ") + if i == len(v.inner)-1 { + fmt.Fprintf(&inner, "or ") + } + fmt.Fprintf(&inner, "%s+%d(FP)", vi.name, vi.off) + } + badf("invalid offset %s; expected %s+%d(FP)%s", expr, v.name, v.off, inner.String()) + return + } + if kind != 0 && kind != vk { + var inner bytes.Buffer + if len(v.inner) > 0 { + fmt.Fprintf(&inner, " containing") + for i, vi := range v.inner { + if i > 0 && len(v.inner) > 2 { + fmt.Fprintf(&inner, ",") + } + fmt.Fprintf(&inner, " ") + if i > 0 && i == len(v.inner)-1 { + fmt.Fprintf(&inner, "and ") + } + fmt.Fprintf(&inner, "%s+%d(FP)", vi.name, vi.off) + } + } + badf("invalid %s of %s; %s is %d-byte value%s", op, expr, vt, vk, inner.String()) + } +} diff --git a/src/cmd/vet/assign.go b/src/cmd/vet/assign.go new file mode 100644 index 0000000000000000000000000000000000000000..54c1ae1fdc3f9142699a7a36bceb7bbed135b904 --- /dev/null +++ b/src/cmd/vet/assign.go @@ -0,0 +1,49 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +/* +This file contains the code to check for useless assignments. +*/ + +package main + +import ( + "go/ast" + "go/token" + "reflect" +) + +func init() { + register("assign", + "check for useless assignments", + checkAssignStmt, + assignStmt) +} + +// TODO: should also check for assignments to struct fields inside methods +// that are on T instead of *T. + +// checkAssignStmt checks for assignments of the form " = ". +// These are almost always useless, and even when they aren't they are usually a mistake. +func checkAssignStmt(f *File, node ast.Node) { + stmt := node.(*ast.AssignStmt) + if stmt.Tok != token.ASSIGN { + return // ignore := + } + if len(stmt.Lhs) != len(stmt.Rhs) { + // If LHS and RHS have different cardinality, they can't be the same. + return + } + for i, lhs := range stmt.Lhs { + rhs := stmt.Rhs[i] + if reflect.TypeOf(lhs) != reflect.TypeOf(rhs) { + continue // short-circuit the heavy-weight gofmt check + } + le := f.gofmt(lhs) + re := f.gofmt(rhs) + if le == re { + f.Badf(stmt.Pos(), "self-assignment of %s to %s", re, le) + } + } +} diff --git a/src/cmd/vet/atomic.go b/src/cmd/vet/atomic.go new file mode 100644 index 0000000000000000000000000000000000000000..c084f13ab3fcdfafcd0cf427312dd1e32194f61a --- /dev/null +++ b/src/cmd/vet/atomic.go @@ -0,0 +1,66 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +import ( + "go/ast" + "go/token" +) + +func init() { + register("atomic", + "check for common mistaken usages of the sync/atomic package", + checkAtomicAssignment, + assignStmt) +} + +// checkAtomicAssignment walks the assignment statement checking for common +// mistaken usage of atomic package, such as: x = atomic.AddUint64(&x, 1) +func checkAtomicAssignment(f *File, node ast.Node) { + n := node.(*ast.AssignStmt) + if len(n.Lhs) != len(n.Rhs) { + return + } + + for i, right := range n.Rhs { + call, ok := right.(*ast.CallExpr) + if !ok { + continue + } + sel, ok := call.Fun.(*ast.SelectorExpr) + if !ok { + continue + } + pkg, ok := sel.X.(*ast.Ident) + if !ok || pkg.Name != "atomic" { + continue + } + + switch sel.Sel.Name { + case "AddInt32", "AddInt64", "AddUint32", "AddUint64", "AddUintptr": + f.checkAtomicAddAssignment(n.Lhs[i], call) + } + } +} + +// checkAtomicAddAssignment walks the atomic.Add* method calls checking for assigning the return value +// to the same variable being used in the operation +func (f *File) checkAtomicAddAssignment(left ast.Expr, call *ast.CallExpr) { + if len(call.Args) != 2 { + return + } + arg := call.Args[0] + broken := false + + if uarg, ok := arg.(*ast.UnaryExpr); ok && uarg.Op == token.AND { + broken = f.gofmt(left) == f.gofmt(uarg.X) + } else if star, ok := left.(*ast.StarExpr); ok { + broken = f.gofmt(star.X) == f.gofmt(arg) + } + + if broken { + f.Bad(left.Pos(), "direct assignment to atomic value") + } +} diff --git a/src/cmd/vet/bool.go b/src/cmd/vet/bool.go new file mode 100644 index 0000000000000000000000000000000000000000..07c2a93dffa3c2218d86244f1d8f2fed90b4aa88 --- /dev/null +++ b/src/cmd/vet/bool.go @@ -0,0 +1,186 @@ +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// This file contains boolean condition tests. + +package main + +import ( + "go/ast" + "go/token" +) + +func init() { + register("bool", + "check for mistakes involving boolean operators", + checkBool, + binaryExpr) +} + +func checkBool(f *File, n ast.Node) { + e := n.(*ast.BinaryExpr) + + var op boolOp + switch e.Op { + case token.LOR: + op = or + case token.LAND: + op = and + default: + return + } + + comm := op.commutativeSets(e) + for _, exprs := range comm { + op.checkRedundant(f, exprs) + op.checkSuspect(f, exprs) + } +} + +type boolOp struct { + name string + tok token.Token // token corresponding to this operator + badEq token.Token // token corresponding to the equality test that should not be used with this operator +} + +var ( + or = boolOp{"or", token.LOR, token.NEQ} + and = boolOp{"and", token.LAND, token.EQL} +) + +// commutativeSets returns all side effect free sets of +// expressions in e that are connected by op. +// For example, given 'a || b || f() || c || d' with the or op, +// commutativeSets returns {{b, a}, {d, c}}. +func (op boolOp) commutativeSets(e *ast.BinaryExpr) [][]ast.Expr { + exprs := op.split(e) + + // Partition the slice of expressions into commutative sets. + i := 0 + var sets [][]ast.Expr + for j := 0; j <= len(exprs); j++ { + if j == len(exprs) || hasSideEffects(exprs[j]) { + if i < j { + sets = append(sets, exprs[i:j]) + } + i = j + 1 + } + } + + return sets +} + +// checkRedundant checks for expressions of the form +// e && e +// e || e +// Exprs must contain only side effect free expressions. +func (op boolOp) checkRedundant(f *File, exprs []ast.Expr) { + seen := make(map[string]bool) + for _, e := range exprs { + efmt := f.gofmt(e) + if seen[efmt] { + f.Badf(e.Pos(), "redundant %s: %s %s %s", op.name, efmt, op.tok, efmt) + } else { + seen[efmt] = true + } + } +} + +// checkSuspect checks for expressions of the form +// x != c1 || x != c2 +// x == c1 && x == c2 +// where c1 and c2 are constant expressions. +// If c1 and c2 are the same then it's redundant; +// if c1 and c2 are different then it's always true or always false. +// Exprs must contain only side effect free expressions. +func (op boolOp) checkSuspect(f *File, exprs []ast.Expr) { + // seen maps from expressions 'x' to equality expressions 'x != c'. + seen := make(map[string]string) + + for _, e := range exprs { + bin, ok := e.(*ast.BinaryExpr) + if !ok || bin.Op != op.badEq { + continue + } + + // In order to avoid false positives, restrict to cases + // in which one of the operands is constant. We're then + // interested in the other operand. + // In the rare case in which both operands are constant + // (e.g. runtime.GOOS and "windows"), we'll only catch + // mistakes if the LHS is repeated, which is how most + // code is written. + var x ast.Expr + switch { + case f.pkg.types[bin.Y].Value != nil: + x = bin.X + case f.pkg.types[bin.X].Value != nil: + x = bin.Y + default: + continue + } + + // e is of the form 'x != c' or 'x == c'. + xfmt := f.gofmt(x) + efmt := f.gofmt(e) + if prev, found := seen[xfmt]; found { + // checkRedundant handles the case in which efmt == prev. + if efmt != prev { + f.Badf(e.Pos(), "suspect %s: %s %s %s", op.name, efmt, op.tok, prev) + } + } else { + seen[xfmt] = efmt + } + } +} + +// hasSideEffects reports whether evaluation of e has side effects. +func hasSideEffects(e ast.Expr) bool { + safe := true + ast.Inspect(e, func(node ast.Node) bool { + switch n := node.(type) { + // Using CallExpr here will catch conversions + // as well as function and method invocations. + // We'll live with the false negatives for now. + case *ast.CallExpr: + safe = false + return false + case *ast.UnaryExpr: + if n.Op == token.ARROW { + safe = false + return false + } + } + return true + }) + return !safe +} + +// split returns a slice of all subexpressions in e that are connected by op. +// For example, given 'a || (b || c) || d' with the or op, +// split returns []{d, c, b, a}. +func (op boolOp) split(e ast.Expr) (exprs []ast.Expr) { + for { + e = unparen(e) + if b, ok := e.(*ast.BinaryExpr); ok && b.Op == op.tok { + exprs = append(exprs, op.split(b.Y)...) + e = b.X + } else { + exprs = append(exprs, e) + break + } + } + return +} + +// unparen returns e with any enclosing parentheses stripped. +func unparen(e ast.Expr) ast.Expr { + for { + p, ok := e.(*ast.ParenExpr) + if !ok { + return e + } + e = p.X + } +} diff --git a/src/cmd/vet/buildtag.go b/src/cmd/vet/buildtag.go new file mode 100644 index 0000000000000000000000000000000000000000..2d86edf734f378858a8b4c25c748f46059187502 --- /dev/null +++ b/src/cmd/vet/buildtag.go @@ -0,0 +1,91 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +import ( + "bytes" + "fmt" + "os" + "strings" + "unicode" +) + +var ( + nl = []byte("\n") + slashSlash = []byte("//") + plusBuild = []byte("+build") +) + +// checkBuildTag checks that build tags are in the correct location and well-formed. +func checkBuildTag(name string, data []byte) { + if !vet("buildtags") { + return + } + lines := bytes.SplitAfter(data, nl) + + // Determine cutpoint where +build comments are no longer valid. + // They are valid in leading // comments in the file followed by + // a blank line. + var cutoff int + for i, line := range lines { + line = bytes.TrimSpace(line) + if len(line) == 0 { + cutoff = i + continue + } + if bytes.HasPrefix(line, slashSlash) { + continue + } + break + } + + for i, line := range lines { + line = bytes.TrimSpace(line) + if !bytes.HasPrefix(line, slashSlash) { + continue + } + text := bytes.TrimSpace(line[2:]) + if bytes.HasPrefix(text, plusBuild) { + fields := bytes.Fields(text) + if !bytes.Equal(fields[0], plusBuild) { + // Comment is something like +buildasdf not +build. + fmt.Fprintf(os.Stderr, "%s:%d: possible malformed +build comment\n", name, i+1) + continue + } + if i >= cutoff { + fmt.Fprintf(os.Stderr, "%s:%d: +build comment must appear before package clause and be followed by a blank line\n", name, i+1) + setExit(1) + continue + } + // Check arguments. + Args: + for _, arg := range fields[1:] { + for _, elem := range strings.Split(string(arg), ",") { + if strings.HasPrefix(elem, "!!") { + fmt.Fprintf(os.Stderr, "%s:%d: invalid double negative in build constraint: %s\n", name, i+1, arg) + setExit(1) + break Args + } + if strings.HasPrefix(elem, "!") { + elem = elem[1:] + } + for _, c := range elem { + if !unicode.IsLetter(c) && !unicode.IsDigit(c) && c != '_' && c != '.' { + fmt.Fprintf(os.Stderr, "%s:%d: invalid non-alphanumeric build constraint: %s\n", name, i+1, arg) + setExit(1) + break Args + } + } + } + } + continue + } + // Comment with +build but not at beginning. + if bytes.Contains(line, plusBuild) && i < cutoff { + fmt.Fprintf(os.Stderr, "%s:%d: possible malformed +build comment\n", name, i+1) + continue + } + } +} diff --git a/src/cmd/vet/composite.go b/src/cmd/vet/composite.go new file mode 100644 index 0000000000000000000000000000000000000000..80b45e2064fc03bd98fb61e7c47a989fa295ddad --- /dev/null +++ b/src/cmd/vet/composite.go @@ -0,0 +1,124 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// This file contains the test for unkeyed struct literals. + +package main + +import ( + "cmd/vet/whitelist" + "flag" + "go/ast" + "strings" +) + +var compositeWhiteList = flag.Bool("compositewhitelist", true, "use composite white list; for testing only") + +func init() { + register("composites", + "check that composite literals used field-keyed elements", + checkUnkeyedLiteral, + compositeLit) +} + +// checkUnkeyedLiteral checks if a composite literal is a struct literal with +// unkeyed fields. +func checkUnkeyedLiteral(f *File, node ast.Node) { + c := node.(*ast.CompositeLit) + typ := c.Type + for { + if typ1, ok := c.Type.(*ast.ParenExpr); ok { + typ = typ1 + continue + } + break + } + + switch typ.(type) { + case *ast.ArrayType: + return + case *ast.MapType: + return + case *ast.StructType: + return // a literal struct type does not need to use keys + case *ast.Ident: + // A simple type name like t or T does not need keys either, + // since it is almost certainly declared in the current package. + // (The exception is names being used via import . "pkg", but + // those are already breaking the Go 1 compatibility promise, + // so not reporting potential additional breakage seems okay.) + return + } + + // Otherwise the type is a selector like pkg.Name. + // We only care if pkg.Name is a struct, not if it's a map, array, or slice. + isStruct, typeString := f.pkg.isStruct(c) + if !isStruct { + return + } + + if typeString == "" { // isStruct doesn't know + typeString = f.gofmt(typ) + } + + // It's a struct, or we can't tell it's not a struct because we don't have types. + + // Check if the CompositeLit contains an unkeyed field. + allKeyValue := true + for _, e := range c.Elts { + if _, ok := e.(*ast.KeyValueExpr); !ok { + allKeyValue = false + break + } + } + if allKeyValue { + return + } + + // Check that the CompositeLit's type has the form pkg.Typ. + s, ok := c.Type.(*ast.SelectorExpr) + if !ok { + return + } + pkg, ok := s.X.(*ast.Ident) + if !ok { + return + } + + // Convert the package name to an import path, and compare to a whitelist. + path := pkgPath(f, pkg.Name) + if path == "" { + f.Badf(c.Pos(), "unresolvable package for %s.%s literal", pkg.Name, s.Sel.Name) + return + } + typeName := path + "." + s.Sel.Name + if *compositeWhiteList && whitelist.UnkeyedLiteral[typeName] { + return + } + + f.Bad(c.Pos(), typeString+" composite literal uses unkeyed fields") +} + +// pkgPath returns the import path "image/png" for the package name "png". +// +// This is based purely on syntax and convention, and not on the imported +// package's contents. It will be incorrect if a package name differs from the +// leaf element of the import path, or if the package was a dot import. +func pkgPath(f *File, pkgName string) (path string) { + for _, x := range f.file.Imports { + s := strings.Trim(x.Path.Value, `"`) + if x.Name != nil { + // Catch `import pkgName "foo/bar"`. + if x.Name.Name == pkgName { + return s + } + } else { + // Catch `import "pkgName"` or `import "foo/bar/pkgName"`. + if s == pkgName || strings.HasSuffix(s, "/"+pkgName) { + return s + } + } + } + return "" +} diff --git a/src/cmd/vet/copylock.go b/src/cmd/vet/copylock.go new file mode 100644 index 0000000000000000000000000000000000000000..6c71061b3e645e77a71bd691faa052ef26142de8 --- /dev/null +++ b/src/cmd/vet/copylock.go @@ -0,0 +1,156 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// This file contains the code to check that locks are not passed by value. + +package main + +import ( + "bytes" + "fmt" + "go/ast" + "go/token" + "go/types" +) + +func init() { + register("copylocks", + "check that locks are not passed by value", + checkCopyLocks, + funcDecl, rangeStmt, funcLit) +} + +// checkCopyLocks checks whether node might +// inadvertently copy a lock. +func checkCopyLocks(f *File, node ast.Node) { + switch node := node.(type) { + case *ast.RangeStmt: + checkCopyLocksRange(f, node) + case *ast.FuncDecl: + checkCopyLocksFunc(f, node.Name.Name, node.Recv, node.Type) + case *ast.FuncLit: + checkCopyLocksFunc(f, "func", nil, node.Type) + } +} + +// checkCopyLocksFunc checks whether a function might +// inadvertently copy a lock, by checking whether +// its receiver, parameters, or return values +// are locks. +func checkCopyLocksFunc(f *File, name string, recv *ast.FieldList, typ *ast.FuncType) { + if recv != nil && len(recv.List) > 0 { + expr := recv.List[0].Type + if path := lockPath(f.pkg.typesPkg, f.pkg.types[expr].Type); path != nil { + f.Badf(expr.Pos(), "%s passes Lock by value: %v", name, path) + } + } + + if typ.Params != nil { + for _, field := range typ.Params.List { + expr := field.Type + if path := lockPath(f.pkg.typesPkg, f.pkg.types[expr].Type); path != nil { + f.Badf(expr.Pos(), "%s passes Lock by value: %v", name, path) + } + } + } + + if typ.Results != nil { + for _, field := range typ.Results.List { + expr := field.Type + if path := lockPath(f.pkg.typesPkg, f.pkg.types[expr].Type); path != nil { + f.Badf(expr.Pos(), "%s returns Lock by value: %v", name, path) + } + } + } +} + +// checkCopyLocksRange checks whether a range statement +// might inadvertently copy a lock by checking whether +// any of the range variables are locks. +func checkCopyLocksRange(f *File, r *ast.RangeStmt) { + checkCopyLocksRangeVar(f, r.Tok, r.Key) + checkCopyLocksRangeVar(f, r.Tok, r.Value) +} + +func checkCopyLocksRangeVar(f *File, rtok token.Token, e ast.Expr) { + if e == nil { + return + } + id, isId := e.(*ast.Ident) + if isId && id.Name == "_" { + return + } + + var typ types.Type + if rtok == token.DEFINE { + if !isId { + return + } + obj := f.pkg.defs[id] + if obj == nil { + return + } + typ = obj.Type() + } else { + typ = f.pkg.types[e].Type + } + + if typ == nil { + return + } + if path := lockPath(f.pkg.typesPkg, typ); path != nil { + f.Badf(e.Pos(), "range var %s copies Lock: %v", f.gofmt(e), path) + } +} + +type typePath []types.Type + +// String pretty-prints a typePath. +func (path typePath) String() string { + n := len(path) + var buf bytes.Buffer + for i := range path { + if i > 0 { + fmt.Fprint(&buf, " contains ") + } + // The human-readable path is in reverse order, outermost to innermost. + fmt.Fprint(&buf, path[n-i-1].String()) + } + return buf.String() +} + +// lockPath returns a typePath describing the location of a lock value +// contained in typ. If there is no contained lock, it returns nil. +func lockPath(tpkg *types.Package, typ types.Type) typePath { + if typ == nil { + return nil + } + + // We're only interested in the case in which the underlying + // type is a struct. (Interfaces and pointers are safe to copy.) + styp, ok := typ.Underlying().(*types.Struct) + if !ok { + return nil + } + + // We're looking for cases in which a reference to this type + // can be locked, but a value cannot. This differentiates + // embedded interfaces from embedded values. + if plock := types.NewMethodSet(types.NewPointer(typ)).Lookup(tpkg, "Lock"); plock != nil { + if lock := types.NewMethodSet(typ).Lookup(tpkg, "Lock"); lock == nil { + return []types.Type{typ} + } + } + + nfields := styp.NumFields() + for i := 0; i < nfields; i++ { + ftyp := styp.Field(i).Type() + subpath := lockPath(tpkg, ftyp) + if subpath != nil { + return append(subpath, typ) + } + } + + return nil +} diff --git a/src/cmd/vet/deadcode.go b/src/cmd/vet/deadcode.go new file mode 100644 index 0000000000000000000000000000000000000000..3b306c21045e417a3f5645f763ca5db9f3170ec6 --- /dev/null +++ b/src/cmd/vet/deadcode.go @@ -0,0 +1,296 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Check for syntactically unreachable code. + +package main + +import ( + "go/ast" + "go/token" +) + +func init() { + register("unreachable", + "check for unreachable code", + checkUnreachable, + funcDecl, funcLit) +} + +type deadState struct { + f *File + hasBreak map[ast.Stmt]bool + hasGoto map[string]bool + labels map[string]ast.Stmt + breakTarget ast.Stmt + + reachable bool +} + +// checkUnreachable checks a function body for dead code. +func checkUnreachable(f *File, node ast.Node) { + var body *ast.BlockStmt + switch n := node.(type) { + case *ast.FuncDecl: + body = n.Body + case *ast.FuncLit: + body = n.Body + } + if body == nil { + return + } + + d := &deadState{ + f: f, + hasBreak: make(map[ast.Stmt]bool), + hasGoto: make(map[string]bool), + labels: make(map[string]ast.Stmt), + } + + d.findLabels(body) + + d.reachable = true + d.findDead(body) +} + +// findLabels gathers information about the labels defined and used by stmt +// and about which statements break, whether a label is involved or not. +func (d *deadState) findLabels(stmt ast.Stmt) { + switch x := stmt.(type) { + default: + d.f.Warnf(x.Pos(), "internal error in findLabels: unexpected statement %T", x) + + case *ast.AssignStmt, + *ast.BadStmt, + *ast.DeclStmt, + *ast.DeferStmt, + *ast.EmptyStmt, + *ast.ExprStmt, + *ast.GoStmt, + *ast.IncDecStmt, + *ast.ReturnStmt, + *ast.SendStmt: + // no statements inside + + case *ast.BlockStmt: + for _, stmt := range x.List { + d.findLabels(stmt) + } + + case *ast.BranchStmt: + switch x.Tok { + case token.GOTO: + if x.Label != nil { + d.hasGoto[x.Label.Name] = true + } + + case token.BREAK: + stmt := d.breakTarget + if x.Label != nil { + stmt = d.labels[x.Label.Name] + } + if stmt != nil { + d.hasBreak[stmt] = true + } + } + + case *ast.IfStmt: + d.findLabels(x.Body) + if x.Else != nil { + d.findLabels(x.Else) + } + + case *ast.LabeledStmt: + d.labels[x.Label.Name] = x.Stmt + d.findLabels(x.Stmt) + + // These cases are all the same, but the x.Body only works + // when the specific type of x is known, so the cases cannot + // be merged. + case *ast.ForStmt: + outer := d.breakTarget + d.breakTarget = x + d.findLabels(x.Body) + d.breakTarget = outer + + case *ast.RangeStmt: + outer := d.breakTarget + d.breakTarget = x + d.findLabels(x.Body) + d.breakTarget = outer + + case *ast.SelectStmt: + outer := d.breakTarget + d.breakTarget = x + d.findLabels(x.Body) + d.breakTarget = outer + + case *ast.SwitchStmt: + outer := d.breakTarget + d.breakTarget = x + d.findLabels(x.Body) + d.breakTarget = outer + + case *ast.TypeSwitchStmt: + outer := d.breakTarget + d.breakTarget = x + d.findLabels(x.Body) + d.breakTarget = outer + + case *ast.CommClause: + for _, stmt := range x.Body { + d.findLabels(stmt) + } + + case *ast.CaseClause: + for _, stmt := range x.Body { + d.findLabels(stmt) + } + } +} + +// findDead walks the statement looking for dead code. +// If d.reachable is false on entry, stmt itself is dead. +// When findDead returns, d.reachable tells whether the +// statement following stmt is reachable. +func (d *deadState) findDead(stmt ast.Stmt) { + // Is this a labeled goto target? + // If so, assume it is reachable due to the goto. + // This is slightly conservative, in that we don't + // check that the goto is reachable, so + // L: goto L + // will not provoke a warning. + // But it's good enough. + if x, isLabel := stmt.(*ast.LabeledStmt); isLabel && d.hasGoto[x.Label.Name] { + d.reachable = true + } + + if !d.reachable { + switch stmt.(type) { + case *ast.EmptyStmt: + // do not warn about unreachable empty statements + default: + d.f.Bad(stmt.Pos(), "unreachable code") + d.reachable = true // silence error about next statement + } + } + + switch x := stmt.(type) { + default: + d.f.Warnf(x.Pos(), "internal error in findDead: unexpected statement %T", x) + + case *ast.AssignStmt, + *ast.BadStmt, + *ast.DeclStmt, + *ast.DeferStmt, + *ast.EmptyStmt, + *ast.GoStmt, + *ast.IncDecStmt, + *ast.SendStmt: + // no control flow + + case *ast.BlockStmt: + for _, stmt := range x.List { + d.findDead(stmt) + } + + case *ast.BranchStmt: + switch x.Tok { + case token.BREAK, token.GOTO, token.FALLTHROUGH: + d.reachable = false + case token.CONTINUE: + // NOTE: We accept "continue" statements as terminating. + // They are not necessary in the spec definition of terminating, + // because a continue statement cannot be the final statement + // before a return. But for the more general problem of syntactically + // identifying dead code, continue redirects control flow just + // like the other terminating statements. + d.reachable = false + } + + case *ast.ExprStmt: + // Call to panic? + call, ok := x.X.(*ast.CallExpr) + if ok { + name, ok := call.Fun.(*ast.Ident) + if ok && name.Name == "panic" && name.Obj == nil { + d.reachable = false + } + } + + case *ast.ForStmt: + d.findDead(x.Body) + d.reachable = x.Cond != nil || d.hasBreak[x] + + case *ast.IfStmt: + d.findDead(x.Body) + if x.Else != nil { + r := d.reachable + d.reachable = true + d.findDead(x.Else) + d.reachable = d.reachable || r + } else { + // might not have executed if statement + d.reachable = true + } + + case *ast.LabeledStmt: + d.findDead(x.Stmt) + + case *ast.RangeStmt: + d.findDead(x.Body) + d.reachable = true + + case *ast.ReturnStmt: + d.reachable = false + + case *ast.SelectStmt: + // NOTE: Unlike switch and type switch below, we don't care + // whether a select has a default, because a select without a + // default blocks until one of the cases can run. That's different + // from a switch without a default, which behaves like it has + // a default with an empty body. + anyReachable := false + for _, comm := range x.Body.List { + d.reachable = true + for _, stmt := range comm.(*ast.CommClause).Body { + d.findDead(stmt) + } + anyReachable = anyReachable || d.reachable + } + d.reachable = anyReachable || d.hasBreak[x] + + case *ast.SwitchStmt: + anyReachable := false + hasDefault := false + for _, cas := range x.Body.List { + cc := cas.(*ast.CaseClause) + if cc.List == nil { + hasDefault = true + } + d.reachable = true + for _, stmt := range cc.Body { + d.findDead(stmt) + } + anyReachable = anyReachable || d.reachable + } + d.reachable = anyReachable || d.hasBreak[x] || !hasDefault + + case *ast.TypeSwitchStmt: + anyReachable := false + hasDefault := false + for _, cas := range x.Body.List { + cc := cas.(*ast.CaseClause) + if cc.List == nil { + hasDefault = true + } + d.reachable = true + for _, stmt := range cc.Body { + d.findDead(stmt) + } + anyReachable = anyReachable || d.reachable + } + d.reachable = anyReachable || d.hasBreak[x] || !hasDefault + } +} diff --git a/src/cmd/vet/doc.go b/src/cmd/vet/doc.go new file mode 100644 index 0000000000000000000000000000000000000000..ea4654ae5fff8236a99b16585f40dd3976bc73fe --- /dev/null +++ b/src/cmd/vet/doc.go @@ -0,0 +1,191 @@ +// Copyright 2010 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +/* + +Vet examines Go source code and reports suspicious constructs, such as Printf +calls whose arguments do not align with the format string. Vet uses heuristics +that do not guarantee all reports are genuine problems, but it can find errors +not caught by the compilers. + +It can be invoked three ways: + +By package, from the go tool: + go vet package/path/name +vets the package whose path is provided. + +By files: + go tool vet source/directory/*.go +vets the files named, all of which must be in the same package. + +By directory: + go tool vet source/directory +recursively descends the directory, vetting each package it finds. + +Vet's exit code is 2 for erroneous invocation of the tool, 1 if a +problem was reported, and 0 otherwise. Note that the tool does not +check every possible problem and depends on unreliable heuristics +so it should be used as guidance only, not as a firm indicator of +program correctness. + +By default all checks are performed. If any flags are explicitly set +to true, only those tests are run. Conversely, if any flag is +explicitly set to false, only those tests are disabled. +Thus -printf=true runs the printf check, -printf=false runs all checks +except the printf check. + +Available checks: + +Printf family + +Flag: -printf + +Suspicious calls to functions in the Printf family, including any functions +with these names, disregarding case: + Print Printf Println + Fprint Fprintf Fprintln + Sprint Sprintf Sprintln + Error Errorf + Fatal Fatalf + Log Logf + Panic Panicf Panicln +The -printfuncs flag can be used to redefine this list. +If the function name ends with an 'f', the function is assumed to take +a format descriptor string in the manner of fmt.Printf. If not, vet +complains about arguments that look like format descriptor strings. + +It also checks for errors such as using a Writer as the first argument of +Printf. + +Methods + +Flag: -methods + +Non-standard signatures for methods with familiar names, including: + Format GobEncode GobDecode MarshalJSON MarshalXML + Peek ReadByte ReadFrom ReadRune Scan Seek + UnmarshalJSON UnreadByte UnreadRune WriteByte + WriteTo + +Struct tags + +Flag: -structtags + +Struct tags that do not follow the format understood by reflect.StructTag.Get. +Well-known encoding struct tags (json, xml) used with unexported fields. + +Unkeyed composite literals + +Flag: -composites + +Composite struct literals that do not use the field-keyed syntax. + +Assembly declarations + +Flag: -asmdecl + +Mismatches between assembly files and Go function declarations. + +Useless assignments + +Flag: -assign + +Check for useless assignments. + +Atomic mistakes + +Flag: -atomic + +Common mistaken usages of the sync/atomic package. + +Boolean conditions + +Flag: -bool + +Mistakes involving boolean operators. + +Build tags + +Flag: -buildtags + +Badly formed or misplaced +build tags. + +Copying locks + +Flag: -copylocks + +Locks that are erroneously passed by value. + +Nil function comparison + +Flag: -nilfunc + +Comparisons between functions and nil. + +Range loop variables + +Flag: -rangeloops + +Incorrect uses of range loop variables in closures. + +Unreachable code + +Flag: -unreachable + +Unreachable code. + +Shadowed variables + +Flag: -shadow=false (experimental; must be set explicitly) + +Variables that may have been unintentionally shadowed. + +Misuse of unsafe Pointers + +Flag: -unsafeptr + +Likely incorrect uses of unsafe.Pointer to convert integers to pointers. +A conversion from uintptr to unsafe.Pointer is invalid if it implies that +there is a uintptr-typed word in memory that holds a pointer value, +because that word will be invisible to stack copying and to the garbage +collector. + +Unused result of certain function calls + +Flag: -unusedresult + +Calls to well-known functions and methods that return a value that is +discarded. By default, this includes functions like fmt.Errorf and +fmt.Sprintf and methods like String and Error. The flags -unusedfuncs +and -unusedstringmethods control the set. + +Shifts + +Flag: -shift + +Shifts equal to or longer than the variable's length. + +Other flags + +These flags configure the behavior of vet: + + -all (default true) + Check everything; disabled if any explicit check is requested. + -v + Verbose mode + -printfuncs + A comma-separated list of print-like functions to supplement the + standard list. Each entry is in the form Name:N where N is the + zero-based argument position of the first argument involved in the + print: either the format or the first print argument for non-formatted + prints. For example, if you have Warn and Warnf functions that + take an io.Writer as their first argument, like Fprintf, + -printfuncs=Warn:1,Warnf:1 + For more information, see the discussion of the -printf flag. + -shadowstrict + Whether to be strict about shadowing; can be noisy. + -test + For testing only: sets -all and -shadow. +*/ +package main // import "golang.org/x/tools/cmd/vet" diff --git a/src/cmd/vet/main.go b/src/cmd/vet/main.go new file mode 100644 index 0000000000000000000000000000000000000000..453cfe0ce0c448cd9c3e6aa3dc888f24af979dc3 --- /dev/null +++ b/src/cmd/vet/main.go @@ -0,0 +1,486 @@ +// Copyright 2010 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Vet is a simple checker for static errors in Go source code. +// See doc.go for more information. +package main + +import ( + "bytes" + "flag" + "fmt" + "go/ast" + "go/build" + "go/parser" + "go/printer" + "go/token" + "go/types" + "io/ioutil" + "os" + "path/filepath" + "strconv" + "strings" +) + +var ( + verbose = flag.Bool("v", false, "verbose") + testFlag = flag.Bool("test", false, "for testing only: sets -all and -shadow") + tags = flag.String("tags", "", "comma-separated list of build tags to apply when parsing") + tagList = []string{} // exploded version of tags flag; set in main +) + +var exitCode = 0 + +// "all" is here only for the appearance of backwards compatibility. +// It has no effect; the triState flags do the work. +var all = flag.Bool("all", true, "check everything; disabled if any explicit check is requested") + +// Flags to control which individual checks to perform. +var report = map[string]*triState{ + // Only unusual checks are written here. + // Most checks that operate during the AST walk are added by register. + "asmdecl": triStateFlag("asmdecl", unset, "check assembly against Go declarations"), + "buildtags": triStateFlag("buildtags", unset, "check that +build tags are valid"), +} + +// experimental records the flags enabling experimental features. These must be +// requested explicitly; they are not enabled by -all. +var experimental = map[string]bool{} + +// setTrueCount record how many flags are explicitly set to true. +var setTrueCount int + +// A triState is a boolean that knows whether it has been set to either true or false. +// It is used to identify if a flag appears; the standard boolean flag cannot +// distinguish missing from unset. It also satisfies flag.Value. +type triState int + +const ( + unset triState = iota + setTrue + setFalse +) + +func triStateFlag(name string, value triState, usage string) *triState { + flag.Var(&value, name, usage) + return &value +} + +// triState implements flag.Value, flag.Getter, and flag.boolFlag. +// They work like boolean flags: we can say vet -printf as well as vet -printf=true +func (ts *triState) Get() interface{} { + return *ts == setTrue +} + +func (ts triState) isTrue() bool { + return ts == setTrue +} + +func (ts *triState) Set(value string) error { + b, err := strconv.ParseBool(value) + if err != nil { + return err + } + if b { + *ts = setTrue + setTrueCount++ + } else { + *ts = setFalse + } + return nil +} + +func (ts *triState) String() string { + switch *ts { + case unset: + return "unset" + case setTrue: + return "true" + case setFalse: + return "false" + } + panic("not reached") +} + +func (ts triState) IsBoolFlag() bool { + return true +} + +// vet tells whether to report errors for the named check, a flag name. +func vet(name string) bool { + if *testFlag { + return true + } + return report[name].isTrue() +} + +// setExit sets the value for os.Exit when it is called, later. It +// remembers the highest value. +func setExit(err int) { + if err > exitCode { + exitCode = err + } +} + +var ( + // Each of these vars has a corresponding case in (*File).Visit. + assignStmt *ast.AssignStmt + binaryExpr *ast.BinaryExpr + callExpr *ast.CallExpr + compositeLit *ast.CompositeLit + exprStmt *ast.ExprStmt + field *ast.Field + funcDecl *ast.FuncDecl + funcLit *ast.FuncLit + genDecl *ast.GenDecl + interfaceType *ast.InterfaceType + rangeStmt *ast.RangeStmt + + // checkers is a two-level map. + // The outer level is keyed by a nil pointer, one of the AST vars above. + // The inner level is keyed by checker name. + checkers = make(map[ast.Node]map[string]func(*File, ast.Node)) +) + +func register(name, usage string, fn func(*File, ast.Node), types ...ast.Node) { + report[name] = triStateFlag(name, unset, usage) + for _, typ := range types { + m := checkers[typ] + if m == nil { + m = make(map[string]func(*File, ast.Node)) + checkers[typ] = m + } + m[name] = fn + } +} + +// Usage is a replacement usage function for the flags package. +func Usage() { + fmt.Fprintf(os.Stderr, "Usage of %s:\n", os.Args[0]) + fmt.Fprintf(os.Stderr, "\tvet [flags] directory...\n") + fmt.Fprintf(os.Stderr, "\tvet [flags] files... # Must be a single package\n") + fmt.Fprintf(os.Stderr, "For more information run\n") + fmt.Fprintf(os.Stderr, "\tgodoc golang.org/x/tools/cmd/vet\n\n") + fmt.Fprintf(os.Stderr, "Flags:\n") + flag.PrintDefaults() + os.Exit(2) +} + +// File is a wrapper for the state of a file used in the parser. +// The parse tree walkers are all methods of this type. +type File struct { + pkg *Package + fset *token.FileSet + name string + content []byte + file *ast.File + b bytes.Buffer // for use by methods + + // The objects that are receivers of a "String() string" method. + // This is used by the recursiveStringer method in print.go. + stringers map[*ast.Object]bool + + // Registered checkers to run. + checkers map[ast.Node][]func(*File, ast.Node) +} + +func main() { + flag.Usage = Usage + flag.Parse() + + // If any flag is set, we run only those checks requested. + // If no flags are set true, set all the non-experimental ones not explicitly set (in effect, set the "-all" flag). + if setTrueCount == 0 { + for name, setting := range report { + if *setting == unset && !experimental[name] { + *setting = setTrue + } + } + } + + tagList = strings.Split(*tags, ",") + + initPrintFlags() + initUnusedFlags() + + if flag.NArg() == 0 { + Usage() + } + dirs := false + files := false + for _, name := range flag.Args() { + // Is it a directory? + fi, err := os.Stat(name) + if err != nil { + warnf("error walking tree: %s", err) + continue + } + if fi.IsDir() { + dirs = true + } else { + files = true + } + } + if dirs && files { + Usage() + } + if dirs { + for _, name := range flag.Args() { + walkDir(name) + } + os.Exit(exitCode) + } + if !doPackage(".", flag.Args()) { + warnf("no files checked") + } + os.Exit(exitCode) +} + +// prefixDirectory places the directory name on the beginning of each name in the list. +func prefixDirectory(directory string, names []string) { + if directory != "." { + for i, name := range names { + names[i] = filepath.Join(directory, name) + } + } +} + +// doPackageDir analyzes the single package found in the directory, if there is one, +// plus a test package, if there is one. +func doPackageDir(directory string) { + context := build.Default + if len(context.BuildTags) != 0 { + warnf("build tags %s previously set", context.BuildTags) + } + context.BuildTags = append(tagList, context.BuildTags...) + + pkg, err := context.ImportDir(directory, 0) + if err != nil { + // If it's just that there are no go source files, that's fine. + if _, nogo := err.(*build.NoGoError); nogo { + return + } + // Non-fatal: we are doing a recursive walk and there may be other directories. + warnf("cannot process directory %s: %s", directory, err) + return + } + var names []string + names = append(names, pkg.GoFiles...) + names = append(names, pkg.CgoFiles...) + names = append(names, pkg.TestGoFiles...) // These are also in the "foo" package. + names = append(names, pkg.SFiles...) + prefixDirectory(directory, names) + doPackage(directory, names) + // Is there also a "foo_test" package? If so, do that one as well. + if len(pkg.XTestGoFiles) > 0 { + names = pkg.XTestGoFiles + prefixDirectory(directory, names) + doPackage(directory, names) + } +} + +type Package struct { + path string + defs map[*ast.Ident]types.Object + uses map[*ast.Ident]types.Object + selectors map[*ast.SelectorExpr]*types.Selection + types map[ast.Expr]types.TypeAndValue + spans map[types.Object]Span + files []*File + typesPkg *types.Package +} + +// doPackage analyzes the single package constructed from the named files. +// It returns whether any files were checked. +func doPackage(directory string, names []string) bool { + var files []*File + var astFiles []*ast.File + fs := token.NewFileSet() + for _, name := range names { + data, err := ioutil.ReadFile(name) + if err != nil { + // Warn but continue to next package. + warnf("%s: %s", name, err) + return false + } + checkBuildTag(name, data) + var parsedFile *ast.File + if strings.HasSuffix(name, ".go") { + parsedFile, err = parser.ParseFile(fs, name, data, 0) + if err != nil { + warnf("%s: %s", name, err) + return false + } + astFiles = append(astFiles, parsedFile) + } + files = append(files, &File{fset: fs, content: data, name: name, file: parsedFile}) + } + if len(astFiles) == 0 { + return false + } + pkg := new(Package) + pkg.path = astFiles[0].Name.Name + pkg.files = files + // Type check the package. + err := pkg.check(fs, astFiles) + if err != nil && *verbose { + warnf("%s", err) + } + + // Check. + chk := make(map[ast.Node][]func(*File, ast.Node)) + for typ, set := range checkers { + for name, fn := range set { + if vet(name) { + chk[typ] = append(chk[typ], fn) + } + } + } + for _, file := range files { + file.pkg = pkg + file.checkers = chk + if file.file != nil { + file.walkFile(file.name, file.file) + } + } + asmCheck(pkg) + return true +} + +func visit(path string, f os.FileInfo, err error) error { + if err != nil { + warnf("walk error: %s", err) + return err + } + // One package per directory. Ignore the files themselves. + if !f.IsDir() { + return nil + } + doPackageDir(path) + return nil +} + +func (pkg *Package) hasFileWithSuffix(suffix string) bool { + for _, f := range pkg.files { + if strings.HasSuffix(f.name, suffix) { + return true + } + } + return false +} + +// walkDir recursively walks the tree looking for Go packages. +func walkDir(root string) { + filepath.Walk(root, visit) +} + +// errorf formats the error to standard error, adding program +// identification and a newline, and exits. +func errorf(format string, args ...interface{}) { + fmt.Fprintf(os.Stderr, "vet: "+format+"\n", args...) + os.Exit(2) +} + +// warnf formats the error to standard error, adding program +// identification and a newline, but does not exit. +func warnf(format string, args ...interface{}) { + fmt.Fprintf(os.Stderr, "vet: "+format+"\n", args...) + setExit(1) +} + +// Println is fmt.Println guarded by -v. +func Println(args ...interface{}) { + if !*verbose { + return + } + fmt.Println(args...) +} + +// Printf is fmt.Printf guarded by -v. +func Printf(format string, args ...interface{}) { + if !*verbose { + return + } + fmt.Printf(format+"\n", args...) +} + +// Bad reports an error and sets the exit code.. +func (f *File) Bad(pos token.Pos, args ...interface{}) { + f.Warn(pos, args...) + setExit(1) +} + +// Badf reports a formatted error and sets the exit code. +func (f *File) Badf(pos token.Pos, format string, args ...interface{}) { + f.Warnf(pos, format, args...) + setExit(1) +} + +// loc returns a formatted representation of the position. +func (f *File) loc(pos token.Pos) string { + if pos == token.NoPos { + return "" + } + // Do not print columns. Because the pos often points to the start of an + // expression instead of the inner part with the actual error, the + // precision can mislead. + posn := f.fset.Position(pos) + return fmt.Sprintf("%s:%d: ", posn.Filename, posn.Line) +} + +// Warn reports an error but does not set the exit code. +func (f *File) Warn(pos token.Pos, args ...interface{}) { + fmt.Fprint(os.Stderr, f.loc(pos)+fmt.Sprintln(args...)) +} + +// Warnf reports a formatted error but does not set the exit code. +func (f *File) Warnf(pos token.Pos, format string, args ...interface{}) { + fmt.Fprintf(os.Stderr, f.loc(pos)+format+"\n", args...) +} + +// walkFile walks the file's tree. +func (f *File) walkFile(name string, file *ast.File) { + Println("Checking file", name) + ast.Walk(f, file) +} + +// Visit implements the ast.Visitor interface. +func (f *File) Visit(node ast.Node) ast.Visitor { + var key ast.Node + switch node.(type) { + case *ast.AssignStmt: + key = assignStmt + case *ast.BinaryExpr: + key = binaryExpr + case *ast.CallExpr: + key = callExpr + case *ast.CompositeLit: + key = compositeLit + case *ast.ExprStmt: + key = exprStmt + case *ast.Field: + key = field + case *ast.FuncDecl: + key = funcDecl + case *ast.FuncLit: + key = funcLit + case *ast.GenDecl: + key = genDecl + case *ast.InterfaceType: + key = interfaceType + case *ast.RangeStmt: + key = rangeStmt + } + for _, fn := range f.checkers[key] { + fn(f, node) + } + return f +} + +// gofmt returns a string representation of the expression. +func (f *File) gofmt(x ast.Expr) string { + f.b.Reset() + printer.Fprint(&f.b, f.fset, x) + return f.b.String() +} diff --git a/src/cmd/vet/method.go b/src/cmd/vet/method.go new file mode 100644 index 0000000000000000000000000000000000000000..00949df437295c5505ec960c6f869105fb1d44dc --- /dev/null +++ b/src/cmd/vet/method.go @@ -0,0 +1,182 @@ +// Copyright 2010 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// This file contains the code to check canonical methods. + +package main + +import ( + "fmt" + "go/ast" + "go/printer" + "strings" +) + +func init() { + register("methods", + "check that canonically named methods are canonically defined", + checkCanonicalMethod, + funcDecl, interfaceType) +} + +type MethodSig struct { + args []string + results []string +} + +// canonicalMethods lists the input and output types for Go methods +// that are checked using dynamic interface checks. Because the +// checks are dynamic, such methods would not cause a compile error +// if they have the wrong signature: instead the dynamic check would +// fail, sometimes mysteriously. If a method is found with a name listed +// here but not the input/output types listed here, vet complains. +// +// A few of the canonical methods have very common names. +// For example, a type might implement a Scan method that +// has nothing to do with fmt.Scanner, but we still want to check +// the methods that are intended to implement fmt.Scanner. +// To do that, the arguments that have a = prefix are treated as +// signals that the canonical meaning is intended: if a Scan +// method doesn't have a fmt.ScanState as its first argument, +// we let it go. But if it does have a fmt.ScanState, then the +// rest has to match. +var canonicalMethods = map[string]MethodSig{ + // "Flush": {{}, {"error"}}, // http.Flusher and jpeg.writer conflict + "Format": {[]string{"=fmt.State", "rune"}, []string{}}, // fmt.Formatter + "GobDecode": {[]string{"[]byte"}, []string{"error"}}, // gob.GobDecoder + "GobEncode": {[]string{}, []string{"[]byte", "error"}}, // gob.GobEncoder + "MarshalJSON": {[]string{}, []string{"[]byte", "error"}}, // json.Marshaler + "MarshalXML": {[]string{"*xml.Encoder", "xml.StartElement"}, []string{"error"}}, // xml.Marshaler + "Peek": {[]string{"=int"}, []string{"[]byte", "error"}}, // image.reader (matching bufio.Reader) + "ReadByte": {[]string{}, []string{"byte", "error"}}, // io.ByteReader + "ReadFrom": {[]string{"=io.Reader"}, []string{"int64", "error"}}, // io.ReaderFrom + "ReadRune": {[]string{}, []string{"rune", "int", "error"}}, // io.RuneReader + "Scan": {[]string{"=fmt.ScanState", "rune"}, []string{"error"}}, // fmt.Scanner + "Seek": {[]string{"=int64", "int"}, []string{"int64", "error"}}, // io.Seeker + "UnmarshalJSON": {[]string{"[]byte"}, []string{"error"}}, // json.Unmarshaler + "UnmarshalXML": {[]string{"*xml.Decoder", "xml.StartElement"}, []string{"error"}}, // xml.Unmarshaler + "UnreadByte": {[]string{}, []string{"error"}}, + "UnreadRune": {[]string{}, []string{"error"}}, + "WriteByte": {[]string{"byte"}, []string{"error"}}, // jpeg.writer (matching bufio.Writer) + "WriteTo": {[]string{"=io.Writer"}, []string{"int64", "error"}}, // io.WriterTo +} + +func checkCanonicalMethod(f *File, node ast.Node) { + switch n := node.(type) { + case *ast.FuncDecl: + if n.Recv != nil { + canonicalMethod(f, n.Name, n.Type) + } + case *ast.InterfaceType: + for _, field := range n.Methods.List { + for _, id := range field.Names { + canonicalMethod(f, id, field.Type.(*ast.FuncType)) + } + } + } +} + +func canonicalMethod(f *File, id *ast.Ident, t *ast.FuncType) { + // Expected input/output. + expect, ok := canonicalMethods[id.Name] + if !ok { + return + } + + // Actual input/output + args := typeFlatten(t.Params.List) + var results []ast.Expr + if t.Results != nil { + results = typeFlatten(t.Results.List) + } + + // Do the =s (if any) all match? + if !f.matchParams(expect.args, args, "=") || !f.matchParams(expect.results, results, "=") { + return + } + + // Everything must match. + if !f.matchParams(expect.args, args, "") || !f.matchParams(expect.results, results, "") { + expectFmt := id.Name + "(" + argjoin(expect.args) + ")" + if len(expect.results) == 1 { + expectFmt += " " + argjoin(expect.results) + } else if len(expect.results) > 1 { + expectFmt += " (" + argjoin(expect.results) + ")" + } + + f.b.Reset() + if err := printer.Fprint(&f.b, f.fset, t); err != nil { + fmt.Fprintf(&f.b, "<%s>", err) + } + actual := f.b.String() + actual = strings.TrimPrefix(actual, "func") + actual = id.Name + actual + + f.Badf(id.Pos(), "method %s should have signature %s", actual, expectFmt) + } +} + +func argjoin(x []string) string { + y := make([]string, len(x)) + for i, s := range x { + if s[0] == '=' { + s = s[1:] + } + y[i] = s + } + return strings.Join(y, ", ") +} + +// Turn parameter list into slice of types +// (in the ast, types are Exprs). +// Have to handle f(int, bool) and f(x, y, z int) +// so not a simple 1-to-1 conversion. +func typeFlatten(l []*ast.Field) []ast.Expr { + var t []ast.Expr + for _, f := range l { + if len(f.Names) == 0 { + t = append(t, f.Type) + continue + } + for _ = range f.Names { + t = append(t, f.Type) + } + } + return t +} + +// Does each type in expect with the given prefix match the corresponding type in actual? +func (f *File) matchParams(expect []string, actual []ast.Expr, prefix string) bool { + for i, x := range expect { + if !strings.HasPrefix(x, prefix) { + continue + } + if i >= len(actual) { + return false + } + if !f.matchParamType(x, actual[i]) { + return false + } + } + if prefix == "" && len(actual) > len(expect) { + return false + } + return true +} + +// Does this one type match? +func (f *File) matchParamType(expect string, actual ast.Expr) bool { + if strings.HasPrefix(expect, "=") { + expect = expect[1:] + } + // Strip package name if we're in that package. + if n := len(f.file.Name.Name); len(expect) > n && expect[:n] == f.file.Name.Name && expect[n] == '.' { + expect = expect[n+1:] + } + + // Overkill but easy. + f.b.Reset() + printer.Fprint(&f.b, f.fset, actual) + return f.b.String() == expect +} diff --git a/src/cmd/vet/nilfunc.go b/src/cmd/vet/nilfunc.go new file mode 100644 index 0000000000000000000000000000000000000000..bfe05e3353da9a098ac2c84e749876cdbae93ad7 --- /dev/null +++ b/src/cmd/vet/nilfunc.go @@ -0,0 +1,67 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +/* +This file contains the code to check for useless function comparisons. +A useless comparison is one like f == nil as opposed to f() == nil. +*/ + +package main + +import ( + "go/ast" + "go/token" + "go/types" +) + +func init() { + register("nilfunc", + "check for comparisons between functions and nil", + checkNilFuncComparison, + binaryExpr) +} + +func checkNilFuncComparison(f *File, node ast.Node) { + e := node.(*ast.BinaryExpr) + + // Only want == or != comparisons. + if e.Op != token.EQL && e.Op != token.NEQ { + return + } + + // Only want comparisons with a nil identifier on one side. + var e2 ast.Expr + switch { + case f.isNil(e.X): + e2 = e.Y + case f.isNil(e.Y): + e2 = e.X + default: + return + } + + // Only want identifiers or selector expressions. + var obj types.Object + switch v := e2.(type) { + case *ast.Ident: + obj = f.pkg.uses[v] + case *ast.SelectorExpr: + obj = f.pkg.uses[v.Sel] + default: + return + } + + // Only want functions. + if _, ok := obj.(*types.Func); !ok { + return + } + + f.Badf(e.Pos(), "comparison of function %v %v nil is always %v", obj.Name(), e.Op, e.Op == token.NEQ) +} + +// isNil reports whether the provided expression is the built-in nil +// identifier. +func (f *File) isNil(e ast.Expr) bool { + return f.pkg.types[e].Type == types.Typ[types.UntypedNil] +} diff --git a/src/cmd/vet/print.go b/src/cmd/vet/print.go new file mode 100644 index 0000000000000000000000000000000000000000..d79b0967ab7ffd9a7d6cdc28b744b9cdaec43690 --- /dev/null +++ b/src/cmd/vet/print.go @@ -0,0 +1,586 @@ +// Copyright 2010 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// This file contains the printf-checker. + +package main + +import ( + "bytes" + "flag" + "go/ast" + "go/constant" + "go/token" + "go/types" + "strconv" + "strings" + "unicode/utf8" +) + +var printfuncs = flag.String("printfuncs", "", "comma-separated list of print function names to check") + +func init() { + register("printf", + "check printf-like invocations", + checkFmtPrintfCall, + funcDecl, callExpr) +} + +func initPrintFlags() { + if *printfuncs == "" { + return + } + for _, name := range strings.Split(*printfuncs, ",") { + if len(name) == 0 { + flag.Usage() + } + skip := 0 + if colon := strings.LastIndex(name, ":"); colon > 0 { + var err error + skip, err = strconv.Atoi(name[colon+1:]) + if err != nil { + errorf(`illegal format for "Func:N" argument %q; %s`, name, err) + } + name = name[:colon] + } + name = strings.ToLower(name) + if name[len(name)-1] == 'f' { + printfList[name] = skip + } else { + printList[name] = skip + } + } +} + +// printfList records the formatted-print functions. The value is the location +// of the format parameter. Names are lower-cased so the lookup is +// case insensitive. +var printfList = map[string]int{ + "errorf": 0, + "fatalf": 0, + "fprintf": 1, + "logf": 0, + "panicf": 0, + "printf": 0, + "sprintf": 0, +} + +// printList records the unformatted-print functions. The value is the location +// of the first parameter to be printed. Names are lower-cased so the lookup is +// case insensitive. +var printList = map[string]int{ + "error": 0, + "fatal": 0, + "fprint": 1, "fprintln": 1, + "log": 0, + "panic": 0, "panicln": 0, + "print": 0, "println": 0, + "sprint": 0, "sprintln": 0, +} + +// checkCall triggers the print-specific checks if the call invokes a print function. +func checkFmtPrintfCall(f *File, node ast.Node) { + if d, ok := node.(*ast.FuncDecl); ok && isStringer(f, d) { + // Remember we saw this. + if f.stringers == nil { + f.stringers = make(map[*ast.Object]bool) + } + if l := d.Recv.List; len(l) == 1 { + if n := l[0].Names; len(n) == 1 { + f.stringers[n[0].Obj] = true + } + } + return + } + + call, ok := node.(*ast.CallExpr) + if !ok { + return + } + var Name string + switch x := call.Fun.(type) { + case *ast.Ident: + Name = x.Name + case *ast.SelectorExpr: + Name = x.Sel.Name + default: + return + } + + name := strings.ToLower(Name) + if skip, ok := printfList[name]; ok { + f.checkPrintf(call, Name, skip) + return + } + if skip, ok := printList[name]; ok { + f.checkPrint(call, Name, skip) + return + } +} + +// isStringer returns true if the provided declaration is a "String() string" +// method, an implementation of fmt.Stringer. +func isStringer(f *File, d *ast.FuncDecl) bool { + return d.Recv != nil && d.Name.Name == "String" && d.Type.Results != nil && + len(d.Type.Params.List) == 0 && len(d.Type.Results.List) == 1 && + f.pkg.types[d.Type.Results.List[0].Type].Type == types.Typ[types.String] +} + +// formatState holds the parsed representation of a printf directive such as "%3.*[4]d". +// It is constructed by parsePrintfVerb. +type formatState struct { + verb rune // the format verb: 'd' for "%d" + format string // the full format directive from % through verb, "%.3d". + name string // Printf, Sprintf etc. + flags []byte // the list of # + etc. + argNums []int // the successive argument numbers that are consumed, adjusted to refer to actual arg in call + indexed bool // whether an indexing expression appears: %[1]d. + firstArg int // Index of first argument after the format in the Printf call. + // Used only during parse. + file *File + call *ast.CallExpr + argNum int // Which argument we're expecting to format now. + indexPending bool // Whether we have an indexed argument that has not resolved. + nbytes int // number of bytes of the format string consumed. +} + +// checkPrintf checks a call to a formatted print routine such as Printf. +// call.Args[formatIndex] is (well, should be) the format argument. +func (f *File) checkPrintf(call *ast.CallExpr, name string, formatIndex int) { + if formatIndex >= len(call.Args) { + f.Bad(call.Pos(), "too few arguments in call to", name) + return + } + lit := f.pkg.types[call.Args[formatIndex]].Value + if lit == nil { + if *verbose { + f.Warn(call.Pos(), "can't check non-constant format in call to", name) + } + return + } + if lit.Kind() != constant.String { + f.Badf(call.Pos(), "constant %v not a string in call to %s", lit, name) + return + } + format := constant.StringVal(lit) + firstArg := formatIndex + 1 // Arguments are immediately after format string. + if !strings.Contains(format, "%") { + if len(call.Args) > firstArg { + f.Badf(call.Pos(), "no formatting directive in %s call", name) + } + return + } + // Hard part: check formats against args. + argNum := firstArg + indexed := false + for i, w := 0, 0; i < len(format); i += w { + w = 1 + if format[i] == '%' { + state := f.parsePrintfVerb(call, name, format[i:], firstArg, argNum) + if state == nil { + return + } + w = len(state.format) + if state.indexed { + indexed = true + } + if !f.okPrintfArg(call, state) { // One error per format is enough. + return + } + if len(state.argNums) > 0 { + // Continue with the next sequential argument. + argNum = state.argNums[len(state.argNums)-1] + 1 + } + } + } + // Dotdotdot is hard. + if call.Ellipsis.IsValid() && argNum >= len(call.Args)-1 { + return + } + // If the arguments were direct indexed, we assume the programmer knows what's up. + // Otherwise, there should be no leftover arguments. + if !indexed && argNum != len(call.Args) { + expect := argNum - firstArg + numArgs := len(call.Args) - firstArg + f.Badf(call.Pos(), "wrong number of args for format in %s call: %d needed but %d args", name, expect, numArgs) + } +} + +// parseFlags accepts any printf flags. +func (s *formatState) parseFlags() { + for s.nbytes < len(s.format) { + switch c := s.format[s.nbytes]; c { + case '#', '0', '+', '-', ' ': + s.flags = append(s.flags, c) + s.nbytes++ + default: + return + } + } +} + +// scanNum advances through a decimal number if present. +func (s *formatState) scanNum() { + for ; s.nbytes < len(s.format); s.nbytes++ { + c := s.format[s.nbytes] + if c < '0' || '9' < c { + return + } + } +} + +// parseIndex scans an index expression. It returns false if there is a syntax error. +func (s *formatState) parseIndex() bool { + if s.nbytes == len(s.format) || s.format[s.nbytes] != '[' { + return true + } + // Argument index present. + s.indexed = true + s.nbytes++ // skip '[' + start := s.nbytes + s.scanNum() + if s.nbytes == len(s.format) || s.nbytes == start || s.format[s.nbytes] != ']' { + s.file.Badf(s.call.Pos(), "illegal syntax for printf argument index") + return false + } + arg32, err := strconv.ParseInt(s.format[start:s.nbytes], 10, 32) + if err != nil { + s.file.Badf(s.call.Pos(), "illegal syntax for printf argument index: %s", err) + return false + } + s.nbytes++ // skip ']' + arg := int(arg32) + arg += s.firstArg - 1 // We want to zero-index the actual arguments. + s.argNum = arg + s.indexPending = true + return true +} + +// parseNum scans a width or precision (or *). It returns false if there's a bad index expression. +func (s *formatState) parseNum() bool { + if s.nbytes < len(s.format) && s.format[s.nbytes] == '*' { + if s.indexPending { // Absorb it. + s.indexPending = false + } + s.nbytes++ + s.argNums = append(s.argNums, s.argNum) + s.argNum++ + } else { + s.scanNum() + } + return true +} + +// parsePrecision scans for a precision. It returns false if there's a bad index expression. +func (s *formatState) parsePrecision() bool { + // If there's a period, there may be a precision. + if s.nbytes < len(s.format) && s.format[s.nbytes] == '.' { + s.flags = append(s.flags, '.') // Treat precision as a flag. + s.nbytes++ + if !s.parseIndex() { + return false + } + if !s.parseNum() { + return false + } + } + return true +} + +// parsePrintfVerb looks the formatting directive that begins the format string +// and returns a formatState that encodes what the directive wants, without looking +// at the actual arguments present in the call. The result is nil if there is an error. +func (f *File) parsePrintfVerb(call *ast.CallExpr, name, format string, firstArg, argNum int) *formatState { + state := &formatState{ + format: format, + name: name, + flags: make([]byte, 0, 5), + argNum: argNum, + argNums: make([]int, 0, 1), + nbytes: 1, // There's guaranteed to be a percent sign. + indexed: false, + firstArg: firstArg, + file: f, + call: call, + } + // There may be flags. + state.parseFlags() + indexPending := false + // There may be an index. + if !state.parseIndex() { + return nil + } + // There may be a width. + if !state.parseNum() { + return nil + } + // There may be a precision. + if !state.parsePrecision() { + return nil + } + // Now a verb, possibly prefixed by an index (which we may already have). + if !indexPending && !state.parseIndex() { + return nil + } + if state.nbytes == len(state.format) { + f.Badf(call.Pos(), "missing verb at end of format string in %s call", name) + return nil + } + verb, w := utf8.DecodeRuneInString(state.format[state.nbytes:]) + state.verb = verb + state.nbytes += w + if verb != '%' { + state.argNums = append(state.argNums, state.argNum) + } + state.format = state.format[:state.nbytes] + return state +} + +// printfArgType encodes the types of expressions a printf verb accepts. It is a bitmask. +type printfArgType int + +const ( + argBool printfArgType = 1 << iota + argInt + argRune + argString + argFloat + argComplex + argPointer + anyType printfArgType = ^0 +) + +type printVerb struct { + verb rune // User may provide verb through Formatter; could be a rune. + flags string // known flags are all ASCII + typ printfArgType +} + +// Common flag sets for printf verbs. +const ( + noFlag = "" + numFlag = " -+.0" + sharpNumFlag = " -+.0#" + allFlags = " -+.0#" +) + +// printVerbs identifies which flags are known to printf for each verb. +// TODO: A type that implements Formatter may do what it wants, and vet +// will complain incorrectly. +var printVerbs = []printVerb{ + // '-' is a width modifier, always valid. + // '.' is a precision for float, max width for strings. + // '+' is required sign for numbers, Go format for %v. + // '#' is alternate format for several verbs. + // ' ' is spacer for numbers + {'%', noFlag, 0}, + {'b', numFlag, argInt | argFloat | argComplex}, + {'c', "-", argRune | argInt}, + {'d', numFlag, argInt}, + {'e', numFlag, argFloat | argComplex}, + {'E', numFlag, argFloat | argComplex}, + {'f', numFlag, argFloat | argComplex}, + {'F', numFlag, argFloat | argComplex}, + {'g', numFlag, argFloat | argComplex}, + {'G', numFlag, argFloat | argComplex}, + {'o', sharpNumFlag, argInt}, + {'p', "-#", argPointer}, + {'q', " -+.0#", argRune | argInt | argString}, + {'s', " -+.0", argString}, + {'t', "-", argBool}, + {'T', "-", anyType}, + {'U', "-#", argRune | argInt}, + {'v', allFlags, anyType}, + {'x', sharpNumFlag, argRune | argInt | argString}, + {'X', sharpNumFlag, argRune | argInt | argString}, +} + +// okPrintfArg compares the formatState to the arguments actually present, +// reporting any discrepancies it can discern. If the final argument is ellipsissed, +// there's little it can do for that. +func (f *File) okPrintfArg(call *ast.CallExpr, state *formatState) (ok bool) { + var v printVerb + found := false + // Linear scan is fast enough for a small list. + for _, v = range printVerbs { + if v.verb == state.verb { + found = true + break + } + } + if !found { + f.Badf(call.Pos(), "unrecognized printf verb %q", state.verb) + return false + } + for _, flag := range state.flags { + if !strings.ContainsRune(v.flags, rune(flag)) { + f.Badf(call.Pos(), "unrecognized printf flag for verb %q: %q", state.verb, flag) + return false + } + } + // Verb is good. If len(state.argNums)>trueArgs, we have something like %.*s and all + // but the final arg must be an integer. + trueArgs := 1 + if state.verb == '%' { + trueArgs = 0 + } + nargs := len(state.argNums) + for i := 0; i < nargs-trueArgs; i++ { + argNum := state.argNums[i] + if !f.argCanBeChecked(call, i, true, state) { + return + } + arg := call.Args[argNum] + if !f.matchArgType(argInt, nil, arg) { + f.Badf(call.Pos(), "arg %s for * in printf format not of type int", f.gofmt(arg)) + return false + } + } + if state.verb == '%' { + return true + } + argNum := state.argNums[len(state.argNums)-1] + if !f.argCanBeChecked(call, len(state.argNums)-1, false, state) { + return false + } + arg := call.Args[argNum] + if !f.matchArgType(v.typ, nil, arg) { + typeString := "" + if typ := f.pkg.types[arg].Type; typ != nil { + typeString = typ.String() + } + f.Badf(call.Pos(), "arg %s for printf verb %%%c of wrong type: %s", f.gofmt(arg), state.verb, typeString) + return false + } + if v.typ&argString != 0 && v.verb != 'T' && !bytes.Contains(state.flags, []byte{'#'}) && f.recursiveStringer(arg) { + f.Badf(call.Pos(), "arg %s for printf causes recursive call to String method", f.gofmt(arg)) + return false + } + return true +} + +// recursiveStringer reports whether the provided argument is r or &r for the +// fmt.Stringer receiver identifier r. +func (f *File) recursiveStringer(e ast.Expr) bool { + if len(f.stringers) == 0 { + return false + } + var obj *ast.Object + switch e := e.(type) { + case *ast.Ident: + obj = e.Obj + case *ast.UnaryExpr: + if id, ok := e.X.(*ast.Ident); ok && e.Op == token.AND { + obj = id.Obj + } + } + + // It's unlikely to be a recursive stringer if it has a Format method. + if typ := f.pkg.types[e].Type; typ != nil { + // Not a perfect match; see issue 6259. + if f.hasMethod(typ, "Format") { + return false + } + } + + // We compare the underlying Object, which checks that the identifier + // is the one we declared as the receiver for the String method in + // which this printf appears. + return f.stringers[obj] +} + +// argCanBeChecked reports whether the specified argument is statically present; +// it may be beyond the list of arguments or in a terminal slice... argument, which +// means we can't see it. +func (f *File) argCanBeChecked(call *ast.CallExpr, formatArg int, isStar bool, state *formatState) bool { + argNum := state.argNums[formatArg] + if argNum < 0 { + // Shouldn't happen, so catch it with prejudice. + panic("negative arg num") + } + if argNum == 0 { + f.Badf(call.Pos(), `index value [0] for %s("%s"); indexes start at 1`, state.name, state.format) + return false + } + if argNum < len(call.Args)-1 { + return true // Always OK. + } + if call.Ellipsis.IsValid() { + return false // We just can't tell; there could be many more arguments. + } + if argNum < len(call.Args) { + return true + } + // There are bad indexes in the format or there are fewer arguments than the format needs. + // This is the argument number relative to the format: Printf("%s", "hi") will give 1 for the "hi". + arg := argNum - state.firstArg + 1 // People think of arguments as 1-indexed. + f.Badf(call.Pos(), `missing argument for %s("%s"): format reads arg %d, have only %d args`, state.name, state.format, arg, len(call.Args)-state.firstArg) + return false +} + +// checkPrint checks a call to an unformatted print routine such as Println. +// call.Args[firstArg] is the first argument to be printed. +func (f *File) checkPrint(call *ast.CallExpr, name string, firstArg int) { + isLn := strings.HasSuffix(name, "ln") + isF := strings.HasPrefix(name, "F") + args := call.Args + if name == "Log" && len(args) > 0 { + // Special case: Don't complain about math.Log or cmplx.Log. + // Not strictly necessary because the only complaint likely is for Log("%d") + // but it feels wrong to check that math.Log is a good print function. + if sel, ok := args[0].(*ast.SelectorExpr); ok { + if x, ok := sel.X.(*ast.Ident); ok { + if x.Name == "math" || x.Name == "cmplx" { + return + } + } + } + } + // check for Println(os.Stderr, ...) + if firstArg == 0 && !isF && len(args) > 0 { + if sel, ok := args[0].(*ast.SelectorExpr); ok { + if x, ok := sel.X.(*ast.Ident); ok { + if x.Name == "os" && strings.HasPrefix(sel.Sel.Name, "Std") { + f.Badf(call.Pos(), "first argument to %s is %s.%s", name, x.Name, sel.Sel.Name) + } + } + } + } + if len(args) <= firstArg { + // If we have a call to a method called Error that satisfies the Error interface, + // then it's ok. Otherwise it's something like (*T).Error from the testing package + // and we need to check it. + if name == "Error" && f.isErrorMethodCall(call) { + return + } + // If it's an Error call now, it's probably for printing errors. + if !isLn { + // Check the signature to be sure: there are niladic functions called "error". + if firstArg != 0 || f.numArgsInSignature(call) != firstArg { + f.Badf(call.Pos(), "no args in %s call", name) + } + } + return + } + arg := args[firstArg] + if lit, ok := arg.(*ast.BasicLit); ok && lit.Kind == token.STRING { + if strings.Contains(lit.Value, "%") { + f.Badf(call.Pos(), "possible formatting directive in %s call", name) + } + } + if isLn { + // The last item, if a string, should not have a newline. + arg = args[len(call.Args)-1] + if lit, ok := arg.(*ast.BasicLit); ok && lit.Kind == token.STRING { + if strings.HasSuffix(lit.Value, `\n"`) { + f.Badf(call.Pos(), "%s call ends with newline", name) + } + } + } + for _, arg := range args { + if f.recursiveStringer(arg) { + f.Badf(call.Pos(), "arg %s for print causes recursive call to String method", f.gofmt(arg)) + } + } +} diff --git a/src/cmd/vet/rangeloop.go b/src/cmd/vet/rangeloop.go new file mode 100644 index 0000000000000000000000000000000000000000..11eef59d90cd043071cf710ea8d16161c51880ab --- /dev/null +++ b/src/cmd/vet/rangeloop.go @@ -0,0 +1,70 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +/* +This file contains the code to check range loop variables bound inside function +literals that are deferred or launched in new goroutines. We only check +instances where the defer or go statement is the last statement in the loop +body, as otherwise we would need whole program analysis. + +For example: + + for i, v := range s { + go func() { + println(i, v) // not what you might expect + }() + } + +See: https://golang.org/doc/go_faq.html#closures_and_goroutines +*/ + +package main + +import "go/ast" + +func init() { + register("rangeloops", + "check that range loop variables are used correctly", + checkRangeLoop, + rangeStmt) +} + +// checkRangeLoop walks the body of the provided range statement, checking if +// its index or value variables are used unsafely inside goroutines or deferred +// function literals. +func checkRangeLoop(f *File, node ast.Node) { + n := node.(*ast.RangeStmt) + key, _ := n.Key.(*ast.Ident) + val, _ := n.Value.(*ast.Ident) + if key == nil && val == nil { + return + } + sl := n.Body.List + if len(sl) == 0 { + return + } + var last *ast.CallExpr + switch s := sl[len(sl)-1].(type) { + case *ast.GoStmt: + last = s.Call + case *ast.DeferStmt: + last = s.Call + default: + return + } + lit, ok := last.Fun.(*ast.FuncLit) + if !ok { + return + } + ast.Inspect(lit.Body, func(n ast.Node) bool { + id, ok := n.(*ast.Ident) + if !ok || id.Obj == nil { + return true + } + if key != nil && id.Obj == key.Obj || val != nil && id.Obj == val.Obj { + f.Bad(id.Pos(), "range variable", id.Name, "captured by func literal") + } + return true + }) +} diff --git a/src/cmd/vet/shadow.go b/src/cmd/vet/shadow.go new file mode 100644 index 0000000000000000000000000000000000000000..2149e70ce2890c0ac8d52561f05f2f427e7c2365 --- /dev/null +++ b/src/cmd/vet/shadow.go @@ -0,0 +1,244 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +/* +This file contains the code to check for shadowed variables. +A shadowed variable is a variable declared in an inner scope +with the same name and type as a variable in an outer scope, +and where the outer variable is mentioned after the inner one +is declared. + +(This definition can be refined; the module generates too many +false positives and is not yet enabled by default.) + +For example: + + func BadRead(f *os.File, buf []byte) error { + var err error + for { + n, err := f.Read(buf) // shadows the function variable 'err' + if err != nil { + break // causes return of wrong value + } + foo(buf) + } + return err + } + +*/ + +package main + +import ( + "flag" + "go/ast" + "go/token" + "go/types" +) + +var strictShadowing = flag.Bool("shadowstrict", false, "whether to be strict about shadowing; can be noisy") + +func init() { + register("shadow", + "check for shadowed variables (experimental; must be set explicitly)", + checkShadow, + assignStmt, genDecl) + experimental["shadow"] = true +} + +func checkShadow(f *File, node ast.Node) { + switch n := node.(type) { + case *ast.AssignStmt: + checkShadowAssignment(f, n) + case *ast.GenDecl: + checkShadowDecl(f, n) + } +} + +// Span stores the minimum range of byte positions in the file in which a +// given variable (types.Object) is mentioned. It is lexically defined: it spans +// from the beginning of its first mention to the end of its last mention. +// A variable is considered shadowed (if *strictShadowing is off) only if the +// shadowing variable is declared within the span of the shadowed variable. +// In other words, if a variable is shadowed but not used after the shadowed +// variable is declared, it is inconsequential and not worth complaining about. +// This simple check dramatically reduces the nuisance rate for the shadowing +// check, at least until something cleverer comes along. +// +// One wrinkle: A "naked return" is a silent use of a variable that the Span +// will not capture, but the compilers catch naked returns of shadowed +// variables so we don't need to. +// +// Cases this gets wrong (TODO): +// - If a for loop's continuation statement mentions a variable redeclared in +// the block, we should complain about it but don't. +// - A variable declared inside a function literal can falsely be identified +// as shadowing a variable in the outer function. +// +type Span struct { + min token.Pos + max token.Pos +} + +// contains reports whether the position is inside the span. +func (s Span) contains(pos token.Pos) bool { + return s.min <= pos && pos < s.max +} + +// growSpan expands the span for the object to contain the instance represented +// by the identifier. +func (pkg *Package) growSpan(ident *ast.Ident, obj types.Object) { + if *strictShadowing { + return // No need + } + pos := ident.Pos() + end := ident.End() + span, ok := pkg.spans[obj] + if ok { + if span.min > pos { + span.min = pos + } + if span.max < end { + span.max = end + } + } else { + span = Span{pos, end} + } + pkg.spans[obj] = span +} + +// checkShadowAssignment checks for shadowing in a short variable declaration. +func checkShadowAssignment(f *File, a *ast.AssignStmt) { + if a.Tok != token.DEFINE { + return + } + if f.idiomaticShortRedecl(a) { + return + } + for _, expr := range a.Lhs { + ident, ok := expr.(*ast.Ident) + if !ok { + f.Badf(expr.Pos(), "invalid AST: short variable declaration of non-identifier") + return + } + checkShadowing(f, ident) + } +} + +// idiomaticShortRedecl reports whether this short declaration can be ignored for +// the purposes of shadowing, that is, that any redeclarations it contains are deliberate. +func (f *File) idiomaticShortRedecl(a *ast.AssignStmt) bool { + // Don't complain about deliberate redeclarations of the form + // i := i + // Such constructs are idiomatic in range loops to create a new variable + // for each iteration. Another example is + // switch n := n.(type) + if len(a.Rhs) != len(a.Lhs) { + return false + } + // We know it's an assignment, so the LHS must be all identifiers. (We check anyway.) + for i, expr := range a.Lhs { + lhs, ok := expr.(*ast.Ident) + if !ok { + f.Badf(expr.Pos(), "invalid AST: short variable declaration of non-identifier") + return true // Don't do any more processing. + } + switch rhs := a.Rhs[i].(type) { + case *ast.Ident: + if lhs.Name != rhs.Name { + return false + } + case *ast.TypeAssertExpr: + if id, ok := rhs.X.(*ast.Ident); ok { + if lhs.Name != id.Name { + return false + } + } + } + } + return true +} + +// idiomaticRedecl reports whether this declaration spec can be ignored for +// the purposes of shadowing, that is, that any redeclarations it contains are deliberate. +func (f *File) idiomaticRedecl(d *ast.ValueSpec) bool { + // Don't complain about deliberate redeclarations of the form + // var i, j = i, j + if len(d.Names) != len(d.Values) { + return false + } + for i, lhs := range d.Names { + if rhs, ok := d.Values[i].(*ast.Ident); ok { + if lhs.Name != rhs.Name { + return false + } + } + } + return true +} + +// checkShadowDecl checks for shadowing in a general variable declaration. +func checkShadowDecl(f *File, d *ast.GenDecl) { + if d.Tok != token.VAR { + return + } + for _, spec := range d.Specs { + valueSpec, ok := spec.(*ast.ValueSpec) + if !ok { + f.Badf(spec.Pos(), "invalid AST: var GenDecl not ValueSpec") + return + } + // Don't complain about deliberate redeclarations of the form + // var i = i + if f.idiomaticRedecl(valueSpec) { + return + } + for _, ident := range valueSpec.Names { + checkShadowing(f, ident) + } + } +} + +// checkShadowing checks whether the identifier shadows an identifier in an outer scope. +func checkShadowing(f *File, ident *ast.Ident) { + if ident.Name == "_" { + // Can't shadow the blank identifier. + return + } + obj := f.pkg.defs[ident] + if obj == nil { + return + } + // obj.Parent.Parent is the surrounding scope. If we can find another declaration + // starting from there, we have a shadowed identifier. + _, shadowed := obj.Parent().Parent().LookupParent(obj.Name(), obj.Pos()) + if shadowed == nil { + return + } + // Don't complain if it's shadowing a universe-declared identifier; that's fine. + if shadowed.Parent() == types.Universe { + return + } + if *strictShadowing { + // The shadowed identifier must appear before this one to be an instance of shadowing. + if shadowed.Pos() > ident.Pos() { + return + } + } else { + // Don't complain if the span of validity of the shadowed identifier doesn't include + // the shadowing identifier. + span, ok := f.pkg.spans[shadowed] + if !ok { + f.Badf(ident.Pos(), "internal error: no range for %s", ident.Name) + return + } + if !span.contains(ident.Pos()) { + return + } + } + // Don't complain if the types differ: that implies the programmer really wants two different things. + if types.Identical(obj.Type(), shadowed.Type()) { + f.Badf(ident.Pos(), "declaration of %s shadows declaration at %s", obj.Name(), f.loc(shadowed.Pos())) + } +} diff --git a/src/cmd/vet/shift.go b/src/cmd/vet/shift.go new file mode 100644 index 0000000000000000000000000000000000000000..8c038b4bdd792b916fbaf71e374cd1d23508a30d --- /dev/null +++ b/src/cmd/vet/shift.go @@ -0,0 +1,82 @@ +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +/* +This file contains the code to check for suspicious shifts. +*/ + +package main + +import ( + "go/ast" + "go/constant" + "go/token" + "go/types" +) + +func init() { + register("shift", + "check for useless shifts", + checkShift, + binaryExpr, assignStmt) +} + +func checkShift(f *File, node ast.Node) { + switch node := node.(type) { + case *ast.BinaryExpr: + if node.Op == token.SHL || node.Op == token.SHR { + checkLongShift(f, node, node.X, node.Y) + } + case *ast.AssignStmt: + if len(node.Lhs) != 1 || len(node.Rhs) != 1 { + return + } + if node.Tok == token.SHL_ASSIGN || node.Tok == token.SHR_ASSIGN { + checkLongShift(f, node, node.Lhs[0], node.Rhs[0]) + } + } +} + +// checkLongShift checks if shift or shift-assign operations shift by more than +// the length of the underlying variable. +func checkLongShift(f *File, node ast.Node, x, y ast.Expr) { + v := f.pkg.types[y].Value + if v == nil { + return + } + amt, ok := constant.Int64Val(v) + if !ok { + return + } + t := f.pkg.types[x].Type + if t == nil { + return + } + b, ok := t.Underlying().(*types.Basic) + if !ok { + return + } + var size int64 + var msg string + switch b.Kind() { + case types.Uint8, types.Int8: + size = 8 + case types.Uint16, types.Int16: + size = 16 + case types.Uint32, types.Int32: + size = 32 + case types.Uint64, types.Int64: + size = 64 + case types.Int, types.Uint, types.Uintptr: + // These types may be as small as 32 bits, but no smaller. + size = 32 + msg = "might be " + default: + return + } + if amt >= size { + ident := f.gofmt(x) + f.Badf(node.Pos(), "%s %stoo small for shift of %d", ident, msg, amt) + } +} diff --git a/src/cmd/vet/structtag.go b/src/cmd/vet/structtag.go new file mode 100644 index 0000000000000000000000000000000000000000..e8164a46f93d4fd55c152327fcef4d16fd7a6b7c --- /dev/null +++ b/src/cmd/vet/structtag.go @@ -0,0 +1,122 @@ +// Copyright 2010 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// This file contains the test for canonical struct tags. + +package main + +import ( + "errors" + "go/ast" + "reflect" + "strconv" +) + +func init() { + register("structtags", + "check that struct field tags have canonical format and apply to exported fields as needed", + checkCanonicalFieldTag, + field) +} + +// checkCanonicalFieldTag checks a struct field tag. +func checkCanonicalFieldTag(f *File, node ast.Node) { + field := node.(*ast.Field) + if field.Tag == nil { + return + } + + tag, err := strconv.Unquote(field.Tag.Value) + if err != nil { + f.Badf(field.Pos(), "unable to read struct tag %s", field.Tag.Value) + return + } + + if err := validateStructTag(tag); err != nil { + f.Badf(field.Pos(), "struct field tag %s not compatible with reflect.StructTag.Get: %s", field.Tag.Value, err) + } + + // Check for use of json or xml tags with unexported fields. + + // Embedded struct. Nothing to do for now, but that + // may change, depending on what happens with issue 7363. + if len(field.Names) == 0 { + return + } + + if field.Names[0].IsExported() { + return + } + + st := reflect.StructTag(tag) + for _, enc := range [...]string{"json", "xml"} { + if st.Get(enc) != "" { + f.Badf(field.Pos(), "struct field %s has %s tag but is not exported", field.Names[0].Name, enc) + return + } + } +} + +var ( + errTagSyntax = errors.New("bad syntax for struct tag pair") + errTagKeySyntax = errors.New("bad syntax for struct tag key") + errTagValueSyntax = errors.New("bad syntax for struct tag value") +) + +// validateStructTag parses the struct tag and returns an error if it is not +// in the canonical format, which is a space-separated list of key:"value" +// settings. The value may contain spaces. +func validateStructTag(tag string) error { + // This code is based on the StructTag.Get code in package reflect. + + for tag != "" { + // Skip leading space. + i := 0 + for i < len(tag) && tag[i] == ' ' { + i++ + } + tag = tag[i:] + if tag == "" { + break + } + + // Scan to colon. A space, a quote or a control character is a syntax error. + // Strictly speaking, control chars include the range [0x7f, 0x9f], not just + // [0x00, 0x1f], but in practice, we ignore the multi-byte control characters + // as it is simpler to inspect the tag's bytes than the tag's runes. + i = 0 + for i < len(tag) && tag[i] > ' ' && tag[i] != ':' && tag[i] != '"' && tag[i] != 0x7f { + i++ + } + if i == 0 { + return errTagKeySyntax + } + if i+1 >= len(tag) || tag[i] != ':' { + return errTagSyntax + } + if tag[i+1] != '"' { + return errTagValueSyntax + } + tag = tag[i+1:] + + // Scan quoted string to find value. + i = 1 + for i < len(tag) && tag[i] != '"' { + if tag[i] == '\\' { + i++ + } + i++ + } + if i >= len(tag) { + return errTagValueSyntax + } + qvalue := string(tag[:i+1]) + tag = tag[i+1:] + + if _, err := strconv.Unquote(qvalue); err != nil { + return errTagValueSyntax + } + } + return nil +} diff --git a/src/cmd/vet/testdata/asm.go b/src/cmd/vet/testdata/asm.go new file mode 100644 index 0000000000000000000000000000000000000000..9a3d5315ad56c05697981c9425d6515e7609864f --- /dev/null +++ b/src/cmd/vet/testdata/asm.go @@ -0,0 +1,33 @@ +// Copyright 2010 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build ignore + +// This file contains declarations to test the assembly in test_asm.s. + +package testdata + +func arg1(x int8, y uint8) +func arg2(x int16, y uint16) +func arg4(x int32, y uint32) +func arg8(x int64, y uint64) +func argint(x int, y uint) +func argptr(x *byte, y *byte, c chan int, m map[int]int, f func()) +func argstring(x, y string) +func argslice(x, y []string) +func argiface(x interface{}, y interface { + m() +}) +func returnint() int +func returnbyte(x int) byte +func returnnamed(x byte) (r1 int, r2 int16, r3 string, r4 byte) +func returnintmissing() int +func leaf(x, y int) int + +func noprof(x int) +func dupok(x int) +func nosplit(x int) +func rodata(x int) +func noptr(x int) +func wrapper(x int) diff --git a/src/cmd/vet/testdata/asm1.s b/src/cmd/vet/testdata/asm1.s new file mode 100644 index 0000000000000000000000000000000000000000..62f423cd8ba205e320bdb8a53b21ade781163d50 --- /dev/null +++ b/src/cmd/vet/testdata/asm1.s @@ -0,0 +1,254 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build amd64 +// +build vet_test + +TEXT ·arg1(SB),0,$0-2 + MOVB x+0(FP), AX + // MOVB x+0(FP), AX // commented out instructions used to panic + MOVB y+1(FP), BX + MOVW x+0(FP), AX // ERROR "\[amd64\] arg1: invalid MOVW of x\+0\(FP\); int8 is 1-byte value" + MOVW y+1(FP), AX // ERROR "invalid MOVW of y\+1\(FP\); uint8 is 1-byte value" + MOVL x+0(FP), AX // ERROR "invalid MOVL of x\+0\(FP\); int8 is 1-byte value" + MOVL y+1(FP), AX // ERROR "invalid MOVL of y\+1\(FP\); uint8 is 1-byte value" + MOVQ x+0(FP), AX // ERROR "invalid MOVQ of x\+0\(FP\); int8 is 1-byte value" + MOVQ y+1(FP), AX // ERROR "invalid MOVQ of y\+1\(FP\); uint8 is 1-byte value" + MOVB x+1(FP), AX // ERROR "invalid offset x\+1\(FP\); expected x\+0\(FP\)" + MOVB y+2(FP), AX // ERROR "invalid offset y\+2\(FP\); expected y\+1\(FP\)" + TESTB x+0(FP), AX + TESTB y+1(FP), BX + TESTW x+0(FP), AX // ERROR "invalid TESTW of x\+0\(FP\); int8 is 1-byte value" + TESTW y+1(FP), AX // ERROR "invalid TESTW of y\+1\(FP\); uint8 is 1-byte value" + TESTL x+0(FP), AX // ERROR "invalid TESTL of x\+0\(FP\); int8 is 1-byte value" + TESTL y+1(FP), AX // ERROR "invalid TESTL of y\+1\(FP\); uint8 is 1-byte value" + TESTQ x+0(FP), AX // ERROR "invalid TESTQ of x\+0\(FP\); int8 is 1-byte value" + TESTQ y+1(FP), AX // ERROR "invalid TESTQ of y\+1\(FP\); uint8 is 1-byte value" + TESTB x+1(FP), AX // ERROR "invalid offset x\+1\(FP\); expected x\+0\(FP\)" + TESTB y+2(FP), AX // ERROR "invalid offset y\+2\(FP\); expected y\+1\(FP\)" + MOVB 8(SP), AX // ERROR "8\(SP\) should be x\+0\(FP\)" + MOVB 9(SP), AX // ERROR "9\(SP\) should be y\+1\(FP\)" + MOVB 10(SP), AX // ERROR "use of 10\(SP\) points beyond argument frame" + RET + +TEXT ·arg2(SB),0,$0-4 + MOVB x+0(FP), AX // ERROR "arg2: invalid MOVB of x\+0\(FP\); int16 is 2-byte value" + MOVB y+2(FP), AX // ERROR "invalid MOVB of y\+2\(FP\); uint16 is 2-byte value" + MOVW x+0(FP), AX + MOVW y+2(FP), BX + MOVL x+0(FP), AX // ERROR "invalid MOVL of x\+0\(FP\); int16 is 2-byte value" + MOVL y+2(FP), AX // ERROR "invalid MOVL of y\+2\(FP\); uint16 is 2-byte value" + MOVQ x+0(FP), AX // ERROR "invalid MOVQ of x\+0\(FP\); int16 is 2-byte value" + MOVQ y+2(FP), AX // ERROR "invalid MOVQ of y\+2\(FP\); uint16 is 2-byte value" + MOVW x+2(FP), AX // ERROR "invalid offset x\+2\(FP\); expected x\+0\(FP\)" + MOVW y+0(FP), AX // ERROR "invalid offset y\+0\(FP\); expected y\+2\(FP\)" + TESTB x+0(FP), AX // ERROR "invalid TESTB of x\+0\(FP\); int16 is 2-byte value" + TESTB y+2(FP), AX // ERROR "invalid TESTB of y\+2\(FP\); uint16 is 2-byte value" + TESTW x+0(FP), AX + TESTW y+2(FP), BX + TESTL x+0(FP), AX // ERROR "invalid TESTL of x\+0\(FP\); int16 is 2-byte value" + TESTL y+2(FP), AX // ERROR "invalid TESTL of y\+2\(FP\); uint16 is 2-byte value" + TESTQ x+0(FP), AX // ERROR "invalid TESTQ of x\+0\(FP\); int16 is 2-byte value" + TESTQ y+2(FP), AX // ERROR "invalid TESTQ of y\+2\(FP\); uint16 is 2-byte value" + TESTW x+2(FP), AX // ERROR "invalid offset x\+2\(FP\); expected x\+0\(FP\)" + TESTW y+0(FP), AX // ERROR "invalid offset y\+0\(FP\); expected y\+2\(FP\)" + RET + +TEXT ·arg4(SB),0,$0-2 // ERROR "arg4: wrong argument size 2; expected \$\.\.\.-8" + MOVB x+0(FP), AX // ERROR "invalid MOVB of x\+0\(FP\); int32 is 4-byte value" + MOVB y+4(FP), BX // ERROR "invalid MOVB of y\+4\(FP\); uint32 is 4-byte value" + MOVW x+0(FP), AX // ERROR "invalid MOVW of x\+0\(FP\); int32 is 4-byte value" + MOVW y+4(FP), AX // ERROR "invalid MOVW of y\+4\(FP\); uint32 is 4-byte value" + MOVL x+0(FP), AX + MOVL y+4(FP), AX + MOVQ x+0(FP), AX // ERROR "invalid MOVQ of x\+0\(FP\); int32 is 4-byte value" + MOVQ y+4(FP), AX // ERROR "invalid MOVQ of y\+4\(FP\); uint32 is 4-byte value" + MOVL x+4(FP), AX // ERROR "invalid offset x\+4\(FP\); expected x\+0\(FP\)" + MOVL y+2(FP), AX // ERROR "invalid offset y\+2\(FP\); expected y\+4\(FP\)" + TESTB x+0(FP), AX // ERROR "invalid TESTB of x\+0\(FP\); int32 is 4-byte value" + TESTB y+4(FP), BX // ERROR "invalid TESTB of y\+4\(FP\); uint32 is 4-byte value" + TESTW x+0(FP), AX // ERROR "invalid TESTW of x\+0\(FP\); int32 is 4-byte value" + TESTW y+4(FP), AX // ERROR "invalid TESTW of y\+4\(FP\); uint32 is 4-byte value" + TESTL x+0(FP), AX + TESTL y+4(FP), AX + TESTQ x+0(FP), AX // ERROR "invalid TESTQ of x\+0\(FP\); int32 is 4-byte value" + TESTQ y+4(FP), AX // ERROR "invalid TESTQ of y\+4\(FP\); uint32 is 4-byte value" + TESTL x+4(FP), AX // ERROR "invalid offset x\+4\(FP\); expected x\+0\(FP\)" + TESTL y+2(FP), AX // ERROR "invalid offset y\+2\(FP\); expected y\+4\(FP\)" + RET + +TEXT ·arg8(SB),7,$0-2 // ERROR "wrong argument size 2; expected \$\.\.\.-16" + MOVB x+0(FP), AX // ERROR "invalid MOVB of x\+0\(FP\); int64 is 8-byte value" + MOVB y+8(FP), BX // ERROR "invalid MOVB of y\+8\(FP\); uint64 is 8-byte value" + MOVW x+0(FP), AX // ERROR "invalid MOVW of x\+0\(FP\); int64 is 8-byte value" + MOVW y+8(FP), AX // ERROR "invalid MOVW of y\+8\(FP\); uint64 is 8-byte value" + MOVL x+0(FP), AX // ERROR "invalid MOVL of x\+0\(FP\); int64 is 8-byte value" + MOVL y+8(FP), AX // ERROR "invalid MOVL of y\+8\(FP\); uint64 is 8-byte value" + MOVQ x+0(FP), AX + MOVQ y+8(FP), AX + MOVQ x+8(FP), AX // ERROR "invalid offset x\+8\(FP\); expected x\+0\(FP\)" + MOVQ y+2(FP), AX // ERROR "invalid offset y\+2\(FP\); expected y\+8\(FP\)" + TESTB x+0(FP), AX // ERROR "invalid TESTB of x\+0\(FP\); int64 is 8-byte value" + TESTB y+8(FP), BX // ERROR "invalid TESTB of y\+8\(FP\); uint64 is 8-byte value" + TESTW x+0(FP), AX // ERROR "invalid TESTW of x\+0\(FP\); int64 is 8-byte value" + TESTW y+8(FP), AX // ERROR "invalid TESTW of y\+8\(FP\); uint64 is 8-byte value" + TESTL x+0(FP), AX // ERROR "invalid TESTL of x\+0\(FP\); int64 is 8-byte value" + TESTL y+8(FP), AX // ERROR "invalid TESTL of y\+8\(FP\); uint64 is 8-byte value" + TESTQ x+0(FP), AX + TESTQ y+8(FP), AX + TESTQ x+8(FP), AX // ERROR "invalid offset x\+8\(FP\); expected x\+0\(FP\)" + TESTQ y+2(FP), AX // ERROR "invalid offset y\+2\(FP\); expected y\+8\(FP\)" + RET + +TEXT ·argint(SB),0,$0-2 // ERROR "wrong argument size 2; expected \$\.\.\.-16" + MOVB x+0(FP), AX // ERROR "invalid MOVB of x\+0\(FP\); int is 8-byte value" + MOVB y+8(FP), BX // ERROR "invalid MOVB of y\+8\(FP\); uint is 8-byte value" + MOVW x+0(FP), AX // ERROR "invalid MOVW of x\+0\(FP\); int is 8-byte value" + MOVW y+8(FP), AX // ERROR "invalid MOVW of y\+8\(FP\); uint is 8-byte value" + MOVL x+0(FP), AX // ERROR "invalid MOVL of x\+0\(FP\); int is 8-byte value" + MOVL y+8(FP), AX // ERROR "invalid MOVL of y\+8\(FP\); uint is 8-byte value" + MOVQ x+0(FP), AX + MOVQ y+8(FP), AX + MOVQ x+8(FP), AX // ERROR "invalid offset x\+8\(FP\); expected x\+0\(FP\)" + MOVQ y+2(FP), AX // ERROR "invalid offset y\+2\(FP\); expected y\+8\(FP\)" + TESTB x+0(FP), AX // ERROR "invalid TESTB of x\+0\(FP\); int is 8-byte value" + TESTB y+8(FP), BX // ERROR "invalid TESTB of y\+8\(FP\); uint is 8-byte value" + TESTW x+0(FP), AX // ERROR "invalid TESTW of x\+0\(FP\); int is 8-byte value" + TESTW y+8(FP), AX // ERROR "invalid TESTW of y\+8\(FP\); uint is 8-byte value" + TESTL x+0(FP), AX // ERROR "invalid TESTL of x\+0\(FP\); int is 8-byte value" + TESTL y+8(FP), AX // ERROR "invalid TESTL of y\+8\(FP\); uint is 8-byte value" + TESTQ x+0(FP), AX + TESTQ y+8(FP), AX + TESTQ x+8(FP), AX // ERROR "invalid offset x\+8\(FP\); expected x\+0\(FP\)" + TESTQ y+2(FP), AX // ERROR "invalid offset y\+2\(FP\); expected y\+8\(FP\)" + RET + +TEXT ·argptr(SB),7,$0-2 // ERROR "wrong argument size 2; expected \$\.\.\.-40" + MOVB x+0(FP), AX // ERROR "invalid MOVB of x\+0\(FP\); \*byte is 8-byte value" + MOVB y+8(FP), BX // ERROR "invalid MOVB of y\+8\(FP\); \*byte is 8-byte value" + MOVW x+0(FP), AX // ERROR "invalid MOVW of x\+0\(FP\); \*byte is 8-byte value" + MOVW y+8(FP), AX // ERROR "invalid MOVW of y\+8\(FP\); \*byte is 8-byte value" + MOVL x+0(FP), AX // ERROR "invalid MOVL of x\+0\(FP\); \*byte is 8-byte value" + MOVL y+8(FP), AX // ERROR "invalid MOVL of y\+8\(FP\); \*byte is 8-byte value" + MOVQ x+0(FP), AX + MOVQ y+8(FP), AX + MOVQ x+8(FP), AX // ERROR "invalid offset x\+8\(FP\); expected x\+0\(FP\)" + MOVQ y+2(FP), AX // ERROR "invalid offset y\+2\(FP\); expected y\+8\(FP\)" + TESTB x+0(FP), AX // ERROR "invalid TESTB of x\+0\(FP\); \*byte is 8-byte value" + TESTB y+8(FP), BX // ERROR "invalid TESTB of y\+8\(FP\); \*byte is 8-byte value" + TESTW x+0(FP), AX // ERROR "invalid TESTW of x\+0\(FP\); \*byte is 8-byte value" + TESTW y+8(FP), AX // ERROR "invalid TESTW of y\+8\(FP\); \*byte is 8-byte value" + TESTL x+0(FP), AX // ERROR "invalid TESTL of x\+0\(FP\); \*byte is 8-byte value" + TESTL y+8(FP), AX // ERROR "invalid TESTL of y\+8\(FP\); \*byte is 8-byte value" + TESTQ x+0(FP), AX + TESTQ y+8(FP), AX + TESTQ x+8(FP), AX // ERROR "invalid offset x\+8\(FP\); expected x\+0\(FP\)" + TESTQ y+2(FP), AX // ERROR "invalid offset y\+2\(FP\); expected y\+8\(FP\)" + MOVL c+16(FP), AX // ERROR "invalid MOVL of c\+16\(FP\); chan int is 8-byte value" + MOVL m+24(FP), AX // ERROR "invalid MOVL of m\+24\(FP\); map\[int\]int is 8-byte value" + MOVL f+32(FP), AX // ERROR "invalid MOVL of f\+32\(FP\); func\(\) is 8-byte value" + RET + +TEXT ·argstring(SB),0,$32 // ERROR "wrong argument size 0; expected \$\.\.\.-32" + MOVW x+0(FP), AX // ERROR "invalid MOVW of x\+0\(FP\); string base is 8-byte value" + MOVL x+0(FP), AX // ERROR "invalid MOVL of x\+0\(FP\); string base is 8-byte value" + MOVQ x+0(FP), AX + MOVW x_base+0(FP), AX // ERROR "invalid MOVW of x_base\+0\(FP\); string base is 8-byte value" + MOVL x_base+0(FP), AX // ERROR "invalid MOVL of x_base\+0\(FP\); string base is 8-byte value" + MOVQ x_base+0(FP), AX + MOVW x_len+0(FP), AX // ERROR "invalid offset x_len\+0\(FP\); expected x_len\+8\(FP\)" + MOVL x_len+0(FP), AX // ERROR "invalid offset x_len\+0\(FP\); expected x_len\+8\(FP\)" + MOVQ x_len+0(FP), AX // ERROR "invalid offset x_len\+0\(FP\); expected x_len\+8\(FP\)" + MOVW x_len+8(FP), AX // ERROR "invalid MOVW of x_len\+8\(FP\); string len is 8-byte value" + MOVL x_len+8(FP), AX // ERROR "invalid MOVL of x_len\+8\(FP\); string len is 8-byte value" + MOVQ x_len+8(FP), AX + MOVQ y+0(FP), AX // ERROR "invalid offset y\+0\(FP\); expected y\+16\(FP\)" + MOVQ y_len+8(FP), AX // ERROR "invalid offset y_len\+8\(FP\); expected y_len\+24\(FP\)" + RET + +TEXT ·argslice(SB),0,$48 // ERROR "wrong argument size 0; expected \$\.\.\.-48" + MOVW x+0(FP), AX // ERROR "invalid MOVW of x\+0\(FP\); slice base is 8-byte value" + MOVL x+0(FP), AX // ERROR "invalid MOVL of x\+0\(FP\); slice base is 8-byte value" + MOVQ x+0(FP), AX + MOVW x_base+0(FP), AX // ERROR "invalid MOVW of x_base\+0\(FP\); slice base is 8-byte value" + MOVL x_base+0(FP), AX // ERROR "invalid MOVL of x_base\+0\(FP\); slice base is 8-byte value" + MOVQ x_base+0(FP), AX + MOVW x_len+0(FP), AX // ERROR "invalid offset x_len\+0\(FP\); expected x_len\+8\(FP\)" + MOVL x_len+0(FP), AX // ERROR "invalid offset x_len\+0\(FP\); expected x_len\+8\(FP\)" + MOVQ x_len+0(FP), AX // ERROR "invalid offset x_len\+0\(FP\); expected x_len\+8\(FP\)" + MOVW x_len+8(FP), AX // ERROR "invalid MOVW of x_len\+8\(FP\); slice len is 8-byte value" + MOVL x_len+8(FP), AX // ERROR "invalid MOVL of x_len\+8\(FP\); slice len is 8-byte value" + MOVQ x_len+8(FP), AX + MOVW x_cap+0(FP), AX // ERROR "invalid offset x_cap\+0\(FP\); expected x_cap\+16\(FP\)" + MOVL x_cap+0(FP), AX // ERROR "invalid offset x_cap\+0\(FP\); expected x_cap\+16\(FP\)" + MOVQ x_cap+0(FP), AX // ERROR "invalid offset x_cap\+0\(FP\); expected x_cap\+16\(FP\)" + MOVW x_cap+16(FP), AX // ERROR "invalid MOVW of x_cap\+16\(FP\); slice cap is 8-byte value" + MOVL x_cap+16(FP), AX // ERROR "invalid MOVL of x_cap\+16\(FP\); slice cap is 8-byte value" + MOVQ x_cap+16(FP), AX + MOVQ y+0(FP), AX // ERROR "invalid offset y\+0\(FP\); expected y\+24\(FP\)" + MOVQ y_len+8(FP), AX // ERROR "invalid offset y_len\+8\(FP\); expected y_len\+32\(FP\)" + MOVQ y_cap+16(FP), AX // ERROR "invalid offset y_cap\+16\(FP\); expected y_cap\+40\(FP\)" + RET + +TEXT ·argiface(SB),0,$0-32 + MOVW x+0(FP), AX // ERROR "invalid MOVW of x\+0\(FP\); interface type is 8-byte value" + MOVL x+0(FP), AX // ERROR "invalid MOVL of x\+0\(FP\); interface type is 8-byte value" + MOVQ x+0(FP), AX + MOVW x_type+0(FP), AX // ERROR "invalid MOVW of x_type\+0\(FP\); interface type is 8-byte value" + MOVL x_type+0(FP), AX // ERROR "invalid MOVL of x_type\+0\(FP\); interface type is 8-byte value" + MOVQ x_type+0(FP), AX + MOVQ x_itable+0(FP), AX // ERROR "unknown variable x_itable; offset 0 is x_type\+0\(FP\)" + MOVQ x_itable+1(FP), AX // ERROR "unknown variable x_itable; offset 1 is x_type\+0\(FP\)" + MOVW x_data+0(FP), AX // ERROR "invalid offset x_data\+0\(FP\); expected x_data\+8\(FP\)" + MOVL x_data+0(FP), AX // ERROR "invalid offset x_data\+0\(FP\); expected x_data\+8\(FP\)" + MOVQ x_data+0(FP), AX // ERROR "invalid offset x_data\+0\(FP\); expected x_data\+8\(FP\)" + MOVW x_data+8(FP), AX // ERROR "invalid MOVW of x_data\+8\(FP\); interface data is 8-byte value" + MOVL x_data+8(FP), AX // ERROR "invalid MOVL of x_data\+8\(FP\); interface data is 8-byte value" + MOVQ x_data+8(FP), AX + MOVW y+16(FP), AX // ERROR "invalid MOVW of y\+16\(FP\); interface itable is 8-byte value" + MOVL y+16(FP), AX // ERROR "invalid MOVL of y\+16\(FP\); interface itable is 8-byte value" + MOVQ y+16(FP), AX + MOVW y_itable+16(FP), AX // ERROR "invalid MOVW of y_itable\+16\(FP\); interface itable is 8-byte value" + MOVL y_itable+16(FP), AX // ERROR "invalid MOVL of y_itable\+16\(FP\); interface itable is 8-byte value" + MOVQ y_itable+16(FP), AX + MOVQ y_type+16(FP), AX // ERROR "unknown variable y_type; offset 16 is y_itable\+16\(FP\)" + MOVW y_data+16(FP), AX // ERROR "invalid offset y_data\+16\(FP\); expected y_data\+24\(FP\)" + MOVL y_data+16(FP), AX // ERROR "invalid offset y_data\+16\(FP\); expected y_data\+24\(FP\)" + MOVQ y_data+16(FP), AX // ERROR "invalid offset y_data\+16\(FP\); expected y_data\+24\(FP\)" + MOVW y_data+24(FP), AX // ERROR "invalid MOVW of y_data\+24\(FP\); interface data is 8-byte value" + MOVL y_data+24(FP), AX // ERROR "invalid MOVL of y_data\+24\(FP\); interface data is 8-byte value" + MOVQ y_data+24(FP), AX + RET + +TEXT ·returnint(SB),0,$0-8 + MOVB AX, ret+0(FP) // ERROR "invalid MOVB of ret\+0\(FP\); int is 8-byte value" + MOVW AX, ret+0(FP) // ERROR "invalid MOVW of ret\+0\(FP\); int is 8-byte value" + MOVL AX, ret+0(FP) // ERROR "invalid MOVL of ret\+0\(FP\); int is 8-byte value" + MOVQ AX, ret+0(FP) + MOVQ AX, ret+1(FP) // ERROR "invalid offset ret\+1\(FP\); expected ret\+0\(FP\)" + MOVQ AX, r+0(FP) // ERROR "unknown variable r; offset 0 is ret\+0\(FP\)" + RET + +TEXT ·returnbyte(SB),0,$0-9 + MOVQ x+0(FP), AX + MOVB AX, ret+8(FP) + MOVW AX, ret+8(FP) // ERROR "invalid MOVW of ret\+8\(FP\); byte is 1-byte value" + MOVL AX, ret+8(FP) // ERROR "invalid MOVL of ret\+8\(FP\); byte is 1-byte value" + MOVQ AX, ret+8(FP) // ERROR "invalid MOVQ of ret\+8\(FP\); byte is 1-byte value" + MOVB AX, ret+7(FP) // ERROR "invalid offset ret\+7\(FP\); expected ret\+8\(FP\)" + RET + +TEXT ·returnnamed(SB),0,$0-41 + MOVB x+0(FP), AX + MOVQ AX, r1+8(FP) + MOVW AX, r2+16(FP) + MOVQ AX, r3+24(FP) + MOVQ AX, r3_base+24(FP) + MOVQ AX, r3_len+32(FP) + MOVB AX, r4+40(FP) + MOVL AX, r1+8(FP) // ERROR "invalid MOVL of r1\+8\(FP\); int is 8-byte value" + RET + +TEXT ·returnintmissing(SB),0,$0-8 + RET // ERROR "RET without writing to 8-byte ret\+0\(FP\)" diff --git a/src/cmd/vet/testdata/asm2.s b/src/cmd/vet/testdata/asm2.s new file mode 100644 index 0000000000000000000000000000000000000000..c33c02a70b27e34ad5205501eb0bd935750be51d --- /dev/null +++ b/src/cmd/vet/testdata/asm2.s @@ -0,0 +1,257 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build 386 +// +build vet_test + +TEXT ·arg1(SB),0,$0-2 + MOVB x+0(FP), AX + MOVB y+1(FP), BX + MOVW x+0(FP), AX // ERROR "\[386\] arg1: invalid MOVW of x\+0\(FP\); int8 is 1-byte value" + MOVW y+1(FP), AX // ERROR "invalid MOVW of y\+1\(FP\); uint8 is 1-byte value" + MOVL x+0(FP), AX // ERROR "invalid MOVL of x\+0\(FP\); int8 is 1-byte value" + MOVL y+1(FP), AX // ERROR "invalid MOVL of y\+1\(FP\); uint8 is 1-byte value" + MOVQ x+0(FP), AX // ERROR "invalid MOVQ of x\+0\(FP\); int8 is 1-byte value" + MOVQ y+1(FP), AX // ERROR "invalid MOVQ of y\+1\(FP\); uint8 is 1-byte value" + MOVB x+1(FP), AX // ERROR "invalid offset x\+1\(FP\); expected x\+0\(FP\)" + MOVB y+2(FP), AX // ERROR "invalid offset y\+2\(FP\); expected y\+1\(FP\)" + TESTB x+0(FP), AX + TESTB y+1(FP), BX + TESTW x+0(FP), AX // ERROR "invalid TESTW of x\+0\(FP\); int8 is 1-byte value" + TESTW y+1(FP), AX // ERROR "invalid TESTW of y\+1\(FP\); uint8 is 1-byte value" + TESTL x+0(FP), AX // ERROR "invalid TESTL of x\+0\(FP\); int8 is 1-byte value" + TESTL y+1(FP), AX // ERROR "invalid TESTL of y\+1\(FP\); uint8 is 1-byte value" + TESTQ x+0(FP), AX // ERROR "invalid TESTQ of x\+0\(FP\); int8 is 1-byte value" + TESTQ y+1(FP), AX // ERROR "invalid TESTQ of y\+1\(FP\); uint8 is 1-byte value" + TESTB x+1(FP), AX // ERROR "invalid offset x\+1\(FP\); expected x\+0\(FP\)" + TESTB y+2(FP), AX // ERROR "invalid offset y\+2\(FP\); expected y\+1\(FP\)" + MOVB 4(SP), AX // ERROR "4\(SP\) should be x\+0\(FP\)" + MOVB 5(SP), AX // ERROR "5\(SP\) should be y\+1\(FP\)" + MOVB 6(SP), AX // ERROR "use of 6\(SP\) points beyond argument frame" + RET + +TEXT ·arg2(SB),0,$0-4 + MOVB x+0(FP), AX // ERROR "arg2: invalid MOVB of x\+0\(FP\); int16 is 2-byte value" + MOVB y+2(FP), AX // ERROR "invalid MOVB of y\+2\(FP\); uint16 is 2-byte value" + MOVW x+0(FP), AX + MOVW y+2(FP), BX + MOVL x+0(FP), AX // ERROR "invalid MOVL of x\+0\(FP\); int16 is 2-byte value" + MOVL y+2(FP), AX // ERROR "invalid MOVL of y\+2\(FP\); uint16 is 2-byte value" + MOVQ x+0(FP), AX // ERROR "invalid MOVQ of x\+0\(FP\); int16 is 2-byte value" + MOVQ y+2(FP), AX // ERROR "invalid MOVQ of y\+2\(FP\); uint16 is 2-byte value" + MOVW x+2(FP), AX // ERROR "invalid offset x\+2\(FP\); expected x\+0\(FP\)" + MOVW y+0(FP), AX // ERROR "invalid offset y\+0\(FP\); expected y\+2\(FP\)" + TESTB x+0(FP), AX // ERROR "invalid TESTB of x\+0\(FP\); int16 is 2-byte value" + TESTB y+2(FP), AX // ERROR "invalid TESTB of y\+2\(FP\); uint16 is 2-byte value" + TESTW x+0(FP), AX + TESTW y+2(FP), BX + TESTL x+0(FP), AX // ERROR "invalid TESTL of x\+0\(FP\); int16 is 2-byte value" + TESTL y+2(FP), AX // ERROR "invalid TESTL of y\+2\(FP\); uint16 is 2-byte value" + TESTQ x+0(FP), AX // ERROR "invalid TESTQ of x\+0\(FP\); int16 is 2-byte value" + TESTQ y+2(FP), AX // ERROR "invalid TESTQ of y\+2\(FP\); uint16 is 2-byte value" + TESTW x+2(FP), AX // ERROR "invalid offset x\+2\(FP\); expected x\+0\(FP\)" + TESTW y+0(FP), AX // ERROR "invalid offset y\+0\(FP\); expected y\+2\(FP\)" + RET + +TEXT ·arg4(SB),0,$0-2 // ERROR "arg4: wrong argument size 2; expected \$\.\.\.-8" + MOVB x+0(FP), AX // ERROR "invalid MOVB of x\+0\(FP\); int32 is 4-byte value" + MOVB y+4(FP), BX // ERROR "invalid MOVB of y\+4\(FP\); uint32 is 4-byte value" + MOVW x+0(FP), AX // ERROR "invalid MOVW of x\+0\(FP\); int32 is 4-byte value" + MOVW y+4(FP), AX // ERROR "invalid MOVW of y\+4\(FP\); uint32 is 4-byte value" + MOVL x+0(FP), AX + MOVL y+4(FP), AX + MOVQ x+0(FP), AX // ERROR "invalid MOVQ of x\+0\(FP\); int32 is 4-byte value" + MOVQ y+4(FP), AX // ERROR "invalid MOVQ of y\+4\(FP\); uint32 is 4-byte value" + MOVL x+4(FP), AX // ERROR "invalid offset x\+4\(FP\); expected x\+0\(FP\)" + MOVL y+2(FP), AX // ERROR "invalid offset y\+2\(FP\); expected y\+4\(FP\)" + TESTB x+0(FP), AX // ERROR "invalid TESTB of x\+0\(FP\); int32 is 4-byte value" + TESTB y+4(FP), BX // ERROR "invalid TESTB of y\+4\(FP\); uint32 is 4-byte value" + TESTW x+0(FP), AX // ERROR "invalid TESTW of x\+0\(FP\); int32 is 4-byte value" + TESTW y+4(FP), AX // ERROR "invalid TESTW of y\+4\(FP\); uint32 is 4-byte value" + TESTL x+0(FP), AX + TESTL y+4(FP), AX + TESTQ x+0(FP), AX // ERROR "invalid TESTQ of x\+0\(FP\); int32 is 4-byte value" + TESTQ y+4(FP), AX // ERROR "invalid TESTQ of y\+4\(FP\); uint32 is 4-byte value" + TESTL x+4(FP), AX // ERROR "invalid offset x\+4\(FP\); expected x\+0\(FP\)" + TESTL y+2(FP), AX // ERROR "invalid offset y\+2\(FP\); expected y\+4\(FP\)" + RET + +TEXT ·arg8(SB),7,$0-2 // ERROR "wrong argument size 2; expected \$\.\.\.-16" + MOVB x+0(FP), AX // ERROR "invalid MOVB of x\+0\(FP\); int64 is 8-byte value" + MOVB y+8(FP), BX // ERROR "invalid MOVB of y\+8\(FP\); uint64 is 8-byte value" + MOVW x+0(FP), AX // ERROR "invalid MOVW of x\+0\(FP\); int64 is 8-byte value" + MOVW y+8(FP), AX // ERROR "invalid MOVW of y\+8\(FP\); uint64 is 8-byte value" + MOVL x+0(FP), AX // ERROR "invalid MOVL of x\+0\(FP\); int64 is 8-byte value containing x_lo\+0\(FP\) and x_hi\+4\(FP\)" + MOVL x_lo+0(FP), AX + MOVL x_hi+4(FP), AX + MOVL y+8(FP), AX // ERROR "invalid MOVL of y\+8\(FP\); uint64 is 8-byte value containing y_lo\+8\(FP\) and y_hi\+12\(FP\)" + MOVL y_lo+8(FP), AX + MOVL y_hi+12(FP), AX + MOVQ x+0(FP), AX + MOVQ y+8(FP), AX + MOVQ x+8(FP), AX // ERROR "invalid offset x\+8\(FP\); expected x\+0\(FP\)" + MOVQ y+2(FP), AX // ERROR "invalid offset y\+2\(FP\); expected y\+8\(FP\)" + TESTB x+0(FP), AX // ERROR "invalid TESTB of x\+0\(FP\); int64 is 8-byte value" + TESTB y+8(FP), BX // ERROR "invalid TESTB of y\+8\(FP\); uint64 is 8-byte value" + TESTW x+0(FP), AX // ERROR "invalid TESTW of x\+0\(FP\); int64 is 8-byte value" + TESTW y+8(FP), AX // ERROR "invalid TESTW of y\+8\(FP\); uint64 is 8-byte value" + TESTL x+0(FP), AX // ERROR "invalid TESTL of x\+0\(FP\); int64 is 8-byte value containing x_lo\+0\(FP\) and x_hi\+4\(FP\)" + TESTL y+8(FP), AX // ERROR "invalid TESTL of y\+8\(FP\); uint64 is 8-byte value containing y_lo\+8\(FP\) and y_hi\+12\(FP\)" + TESTQ x+0(FP), AX + TESTQ y+8(FP), AX + TESTQ x+8(FP), AX // ERROR "invalid offset x\+8\(FP\); expected x\+0\(FP\)" + TESTQ y+2(FP), AX // ERROR "invalid offset y\+2\(FP\); expected y\+8\(FP\)" + RET + +TEXT ·argint(SB),0,$0-2 // ERROR "wrong argument size 2; expected \$\.\.\.-8" + MOVB x+0(FP), AX // ERROR "invalid MOVB of x\+0\(FP\); int is 4-byte value" + MOVB y+4(FP), BX // ERROR "invalid MOVB of y\+4\(FP\); uint is 4-byte value" + MOVW x+0(FP), AX // ERROR "invalid MOVW of x\+0\(FP\); int is 4-byte value" + MOVW y+4(FP), AX // ERROR "invalid MOVW of y\+4\(FP\); uint is 4-byte value" + MOVL x+0(FP), AX + MOVL y+4(FP), AX + MOVQ x+0(FP), AX // ERROR "invalid MOVQ of x\+0\(FP\); int is 4-byte value" + MOVQ y+4(FP), AX // ERROR "invalid MOVQ of y\+4\(FP\); uint is 4-byte value" + MOVQ x+4(FP), AX // ERROR "invalid offset x\+4\(FP\); expected x\+0\(FP\)" + MOVQ y+2(FP), AX // ERROR "invalid offset y\+2\(FP\); expected y\+4\(FP\)" + TESTB x+0(FP), AX // ERROR "invalid TESTB of x\+0\(FP\); int is 4-byte value" + TESTB y+4(FP), BX // ERROR "invalid TESTB of y\+4\(FP\); uint is 4-byte value" + TESTW x+0(FP), AX // ERROR "invalid TESTW of x\+0\(FP\); int is 4-byte value" + TESTW y+4(FP), AX // ERROR "invalid TESTW of y\+4\(FP\); uint is 4-byte value" + TESTL x+0(FP), AX + TESTL y+4(FP), AX + TESTQ x+0(FP), AX // ERROR "invalid TESTQ of x\+0\(FP\); int is 4-byte value" + TESTQ y+4(FP), AX // ERROR "invalid TESTQ of y\+4\(FP\); uint is 4-byte value" + TESTQ x+4(FP), AX // ERROR "invalid offset x\+4\(FP\); expected x\+0\(FP\)" + TESTQ y+2(FP), AX // ERROR "invalid offset y\+2\(FP\); expected y\+4\(FP\)" + RET + +TEXT ·argptr(SB),7,$0-2 // ERROR "wrong argument size 2; expected \$\.\.\.-20" + MOVB x+0(FP), AX // ERROR "invalid MOVB of x\+0\(FP\); \*byte is 4-byte value" + MOVB y+4(FP), BX // ERROR "invalid MOVB of y\+4\(FP\); \*byte is 4-byte value" + MOVW x+0(FP), AX // ERROR "invalid MOVW of x\+0\(FP\); \*byte is 4-byte value" + MOVW y+4(FP), AX // ERROR "invalid MOVW of y\+4\(FP\); \*byte is 4-byte value" + MOVL x+0(FP), AX + MOVL y+4(FP), AX + MOVQ x+0(FP), AX // ERROR "invalid MOVQ of x\+0\(FP\); \*byte is 4-byte value" + MOVQ y+4(FP), AX // ERROR "invalid MOVQ of y\+4\(FP\); \*byte is 4-byte value" + MOVQ x+4(FP), AX // ERROR "invalid offset x\+4\(FP\); expected x\+0\(FP\)" + MOVQ y+2(FP), AX // ERROR "invalid offset y\+2\(FP\); expected y\+4\(FP\)" + TESTB x+0(FP), AX // ERROR "invalid TESTB of x\+0\(FP\); \*byte is 4-byte value" + TESTB y+4(FP), BX // ERROR "invalid TESTB of y\+4\(FP\); \*byte is 4-byte value" + TESTW x+0(FP), AX // ERROR "invalid TESTW of x\+0\(FP\); \*byte is 4-byte value" + TESTW y+4(FP), AX // ERROR "invalid TESTW of y\+4\(FP\); \*byte is 4-byte value" + TESTL x+0(FP), AX + TESTL y+4(FP), AX + TESTQ x+0(FP), AX // ERROR "invalid TESTQ of x\+0\(FP\); \*byte is 4-byte value" + TESTQ y+4(FP), AX // ERROR "invalid TESTQ of y\+4\(FP\); \*byte is 4-byte value" + TESTQ x+4(FP), AX // ERROR "invalid offset x\+4\(FP\); expected x\+0\(FP\)" + TESTQ y+2(FP), AX // ERROR "invalid offset y\+2\(FP\); expected y\+4\(FP\)" + MOVW c+8(FP), AX // ERROR "invalid MOVW of c\+8\(FP\); chan int is 4-byte value" + MOVW m+12(FP), AX // ERROR "invalid MOVW of m\+12\(FP\); map\[int\]int is 4-byte value" + MOVW f+16(FP), AX // ERROR "invalid MOVW of f\+16\(FP\); func\(\) is 4-byte value" + RET + +TEXT ·argstring(SB),0,$16 // ERROR "wrong argument size 0; expected \$\.\.\.-16" + MOVW x+0(FP), AX // ERROR "invalid MOVW of x\+0\(FP\); string base is 4-byte value" + MOVL x+0(FP), AX + MOVQ x+0(FP), AX // ERROR "invalid MOVQ of x\+0\(FP\); string base is 4-byte value" + MOVW x_base+0(FP), AX // ERROR "invalid MOVW of x_base\+0\(FP\); string base is 4-byte value" + MOVL x_base+0(FP), AX + MOVQ x_base+0(FP), AX // ERROR "invalid MOVQ of x_base\+0\(FP\); string base is 4-byte value" + MOVW x_len+0(FP), AX // ERROR "invalid offset x_len\+0\(FP\); expected x_len\+4\(FP\)" + MOVL x_len+0(FP), AX // ERROR "invalid offset x_len\+0\(FP\); expected x_len\+4\(FP\)" + MOVQ x_len+0(FP), AX // ERROR "invalid offset x_len\+0\(FP\); expected x_len\+4\(FP\)" + MOVW x_len+4(FP), AX // ERROR "invalid MOVW of x_len\+4\(FP\); string len is 4-byte value" + MOVL x_len+4(FP), AX + MOVQ x_len+4(FP), AX // ERROR "invalid MOVQ of x_len\+4\(FP\); string len is 4-byte value" + MOVQ y+0(FP), AX // ERROR "invalid offset y\+0\(FP\); expected y\+8\(FP\)" + MOVQ y_len+4(FP), AX // ERROR "invalid offset y_len\+4\(FP\); expected y_len\+12\(FP\)" + RET + +TEXT ·argslice(SB),0,$24 // ERROR "wrong argument size 0; expected \$\.\.\.-24" + MOVW x+0(FP), AX // ERROR "invalid MOVW of x\+0\(FP\); slice base is 4-byte value" + MOVL x+0(FP), AX + MOVQ x+0(FP), AX // ERROR "invalid MOVQ of x\+0\(FP\); slice base is 4-byte value" + MOVW x_base+0(FP), AX // ERROR "invalid MOVW of x_base\+0\(FP\); slice base is 4-byte value" + MOVL x_base+0(FP), AX + MOVQ x_base+0(FP), AX // ERROR "invalid MOVQ of x_base\+0\(FP\); slice base is 4-byte value" + MOVW x_len+0(FP), AX // ERROR "invalid offset x_len\+0\(FP\); expected x_len\+4\(FP\)" + MOVL x_len+0(FP), AX // ERROR "invalid offset x_len\+0\(FP\); expected x_len\+4\(FP\)" + MOVQ x_len+0(FP), AX // ERROR "invalid offset x_len\+0\(FP\); expected x_len\+4\(FP\)" + MOVW x_len+4(FP), AX // ERROR "invalid MOVW of x_len\+4\(FP\); slice len is 4-byte value" + MOVL x_len+4(FP), AX + MOVQ x_len+4(FP), AX // ERROR "invalid MOVQ of x_len\+4\(FP\); slice len is 4-byte value" + MOVW x_cap+0(FP), AX // ERROR "invalid offset x_cap\+0\(FP\); expected x_cap\+8\(FP\)" + MOVL x_cap+0(FP), AX // ERROR "invalid offset x_cap\+0\(FP\); expected x_cap\+8\(FP\)" + MOVQ x_cap+0(FP), AX // ERROR "invalid offset x_cap\+0\(FP\); expected x_cap\+8\(FP\)" + MOVW x_cap+8(FP), AX // ERROR "invalid MOVW of x_cap\+8\(FP\); slice cap is 4-byte value" + MOVL x_cap+8(FP), AX + MOVQ x_cap+8(FP), AX // ERROR "invalid MOVQ of x_cap\+8\(FP\); slice cap is 4-byte value" + MOVQ y+0(FP), AX // ERROR "invalid offset y\+0\(FP\); expected y\+12\(FP\)" + MOVQ y_len+4(FP), AX // ERROR "invalid offset y_len\+4\(FP\); expected y_len\+16\(FP\)" + MOVQ y_cap+8(FP), AX // ERROR "invalid offset y_cap\+8\(FP\); expected y_cap\+20\(FP\)" + RET + +TEXT ·argiface(SB),0,$0-16 + MOVW x+0(FP), AX // ERROR "invalid MOVW of x\+0\(FP\); interface type is 4-byte value" + MOVL x+0(FP), AX + MOVQ x+0(FP), AX // ERROR "invalid MOVQ of x\+0\(FP\); interface type is 4-byte value" + MOVW x_type+0(FP), AX // ERROR "invalid MOVW of x_type\+0\(FP\); interface type is 4-byte value" + MOVL x_type+0(FP), AX + MOVQ x_type+0(FP), AX // ERROR "invalid MOVQ of x_type\+0\(FP\); interface type is 4-byte value" + MOVQ x_itable+0(FP), AX // ERROR "unknown variable x_itable; offset 0 is x_type\+0\(FP\)" + MOVQ x_itable+1(FP), AX // ERROR "unknown variable x_itable; offset 1 is x_type\+0\(FP\)" + MOVW x_data+0(FP), AX // ERROR "invalid offset x_data\+0\(FP\); expected x_data\+4\(FP\)" + MOVL x_data+0(FP), AX // ERROR "invalid offset x_data\+0\(FP\); expected x_data\+4\(FP\)" + MOVQ x_data+0(FP), AX // ERROR "invalid offset x_data\+0\(FP\); expected x_data\+4\(FP\)" + MOVW x_data+4(FP), AX // ERROR "invalid MOVW of x_data\+4\(FP\); interface data is 4-byte value" + MOVL x_data+4(FP), AX + MOVQ x_data+4(FP), AX // ERROR "invalid MOVQ of x_data\+4\(FP\); interface data is 4-byte value" + MOVW y+8(FP), AX // ERROR "invalid MOVW of y\+8\(FP\); interface itable is 4-byte value" + MOVL y+8(FP), AX + MOVQ y+8(FP), AX // ERROR "invalid MOVQ of y\+8\(FP\); interface itable is 4-byte value" + MOVW y_itable+8(FP), AX // ERROR "invalid MOVW of y_itable\+8\(FP\); interface itable is 4-byte value" + MOVL y_itable+8(FP), AX + MOVQ y_itable+8(FP), AX // ERROR "invalid MOVQ of y_itable\+8\(FP\); interface itable is 4-byte value" + MOVQ y_type+8(FP), AX // ERROR "unknown variable y_type; offset 8 is y_itable\+8\(FP\)" + MOVW y_data+8(FP), AX // ERROR "invalid offset y_data\+8\(FP\); expected y_data\+12\(FP\)" + MOVL y_data+8(FP), AX // ERROR "invalid offset y_data\+8\(FP\); expected y_data\+12\(FP\)" + MOVQ y_data+8(FP), AX // ERROR "invalid offset y_data\+8\(FP\); expected y_data\+12\(FP\)" + MOVW y_data+12(FP), AX // ERROR "invalid MOVW of y_data\+12\(FP\); interface data is 4-byte value" + MOVL y_data+12(FP), AX + MOVQ y_data+12(FP), AX // ERROR "invalid MOVQ of y_data\+12\(FP\); interface data is 4-byte value" + RET + +TEXT ·returnint(SB),0,$0-4 + MOVB AX, ret+0(FP) // ERROR "invalid MOVB of ret\+0\(FP\); int is 4-byte value" + MOVW AX, ret+0(FP) // ERROR "invalid MOVW of ret\+0\(FP\); int is 4-byte value" + MOVL AX, ret+0(FP) + MOVQ AX, ret+0(FP) // ERROR "invalid MOVQ of ret\+0\(FP\); int is 4-byte value" + MOVQ AX, ret+1(FP) // ERROR "invalid offset ret\+1\(FP\); expected ret\+0\(FP\)" + MOVQ AX, r+0(FP) // ERROR "unknown variable r; offset 0 is ret\+0\(FP\)" + RET + +TEXT ·returnbyte(SB),0,$0-5 + MOVL x+0(FP), AX + MOVB AX, ret+4(FP) + MOVW AX, ret+4(FP) // ERROR "invalid MOVW of ret\+4\(FP\); byte is 1-byte value" + MOVL AX, ret+4(FP) // ERROR "invalid MOVL of ret\+4\(FP\); byte is 1-byte value" + MOVQ AX, ret+4(FP) // ERROR "invalid MOVQ of ret\+4\(FP\); byte is 1-byte value" + MOVB AX, ret+3(FP) // ERROR "invalid offset ret\+3\(FP\); expected ret\+4\(FP\)" + RET + +TEXT ·returnnamed(SB),0,$0-21 + MOVB x+0(FP), AX + MOVL AX, r1+4(FP) + MOVW AX, r2+8(FP) + MOVL AX, r3+12(FP) + MOVL AX, r3_base+12(FP) + MOVL AX, r3_len+16(FP) + MOVB AX, r4+20(FP) + MOVQ AX, r1+4(FP) // ERROR "invalid MOVQ of r1\+4\(FP\); int is 4-byte value" + RET + +TEXT ·returnintmissing(SB),0,$0-4 + RET // ERROR "RET without writing to 4-byte ret\+0\(FP\)" diff --git a/src/cmd/vet/testdata/asm3.s b/src/cmd/vet/testdata/asm3.s new file mode 100644 index 0000000000000000000000000000000000000000..3d69356a0f93f811fdf1e727964e7da5acc3a5e3 --- /dev/null +++ b/src/cmd/vet/testdata/asm3.s @@ -0,0 +1,178 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build arm +// +build vet_test + +TEXT ·arg1(SB),0,$0-2 + MOVB x+0(FP), AX + MOVB y+1(FP), BX + MOVH x+0(FP), AX // ERROR "\[arm\] arg1: invalid MOVH of x\+0\(FP\); int8 is 1-byte value" + MOVH y+1(FP), AX // ERROR "invalid MOVH of y\+1\(FP\); uint8 is 1-byte value" + MOVW x+0(FP), AX // ERROR "invalid MOVW of x\+0\(FP\); int8 is 1-byte value" + MOVW y+1(FP), AX // ERROR "invalid MOVW of y\+1\(FP\); uint8 is 1-byte value" + MOVB x+1(FP), AX // ERROR "invalid offset x\+1\(FP\); expected x\+0\(FP\)" + MOVB y+2(FP), AX // ERROR "invalid offset y\+2\(FP\); expected y\+1\(FP\)" + MOVB 8(R13), AX // ERROR "8\(R13\) should be x\+0\(FP\)" + MOVB 9(R13), AX // ERROR "9\(R13\) should be y\+1\(FP\)" + MOVB 10(R13), AX // ERROR "use of 10\(R13\) points beyond argument frame" + RET + +TEXT ·arg2(SB),0,$0-4 + MOVB x+0(FP), AX // ERROR "arg2: invalid MOVB of x\+0\(FP\); int16 is 2-byte value" + MOVB y+2(FP), AX // ERROR "invalid MOVB of y\+2\(FP\); uint16 is 2-byte value" + MOVH x+0(FP), AX + MOVH y+2(FP), BX + MOVW x+0(FP), AX // ERROR "invalid MOVW of x\+0\(FP\); int16 is 2-byte value" + MOVW y+2(FP), AX // ERROR "invalid MOVW of y\+2\(FP\); uint16 is 2-byte value" + MOVH x+2(FP), AX // ERROR "invalid offset x\+2\(FP\); expected x\+0\(FP\)" + MOVH y+0(FP), AX // ERROR "invalid offset y\+0\(FP\); expected y\+2\(FP\)" + RET + +TEXT ·arg4(SB),0,$0-2 // ERROR "arg4: wrong argument size 2; expected \$\.\.\.-8" + MOVB x+0(FP), AX // ERROR "invalid MOVB of x\+0\(FP\); int32 is 4-byte value" + MOVB y+4(FP), BX // ERROR "invalid MOVB of y\+4\(FP\); uint32 is 4-byte value" + MOVH x+0(FP), AX // ERROR "invalid MOVH of x\+0\(FP\); int32 is 4-byte value" + MOVH y+4(FP), AX // ERROR "invalid MOVH of y\+4\(FP\); uint32 is 4-byte value" + MOVW x+0(FP), AX + MOVW y+4(FP), AX + MOVW x+4(FP), AX // ERROR "invalid offset x\+4\(FP\); expected x\+0\(FP\)" + MOVW y+2(FP), AX // ERROR "invalid offset y\+2\(FP\); expected y\+4\(FP\)" + RET + +TEXT ·arg8(SB),7,$0-2 // ERROR "wrong argument size 2; expected \$\.\.\.-16" + MOVB x+0(FP), AX // ERROR "invalid MOVB of x\+0\(FP\); int64 is 8-byte value" + MOVB y+8(FP), BX // ERROR "invalid MOVB of y\+8\(FP\); uint64 is 8-byte value" + MOVH x+0(FP), AX // ERROR "invalid MOVH of x\+0\(FP\); int64 is 8-byte value" + MOVH y+8(FP), AX // ERROR "invalid MOVH of y\+8\(FP\); uint64 is 8-byte value" + MOVW x+0(FP), AX // ERROR "invalid MOVW of x\+0\(FP\); int64 is 8-byte value containing x_lo\+0\(FP\) and x_hi\+4\(FP\)" + MOVW x_lo+0(FP), AX + MOVW x_hi+4(FP), AX + MOVW y+8(FP), AX // ERROR "invalid MOVW of y\+8\(FP\); uint64 is 8-byte value containing y_lo\+8\(FP\) and y_hi\+12\(FP\)" + MOVW y_lo+8(FP), AX + MOVW y_hi+12(FP), AX + MOVQ x+0(FP), AX + MOVQ y+8(FP), AX + MOVQ x+8(FP), AX // ERROR "invalid offset x\+8\(FP\); expected x\+0\(FP\)" + MOVQ y+2(FP), AX // ERROR "invalid offset y\+2\(FP\); expected y\+8\(FP\)" + RET + +TEXT ·argint(SB),0,$0-2 // ERROR "wrong argument size 2; expected \$\.\.\.-8" + MOVB x+0(FP), AX // ERROR "invalid MOVB of x\+0\(FP\); int is 4-byte value" + MOVB y+4(FP), BX // ERROR "invalid MOVB of y\+4\(FP\); uint is 4-byte value" + MOVH x+0(FP), AX // ERROR "invalid MOVH of x\+0\(FP\); int is 4-byte value" + MOVH y+4(FP), AX // ERROR "invalid MOVH of y\+4\(FP\); uint is 4-byte value" + MOVW x+0(FP), AX + MOVW y+4(FP), AX + MOVQ x+4(FP), AX // ERROR "invalid offset x\+4\(FP\); expected x\+0\(FP\)" + MOVQ y+2(FP), AX // ERROR "invalid offset y\+2\(FP\); expected y\+4\(FP\)" + RET + +TEXT ·argptr(SB),7,$0-2 // ERROR "wrong argument size 2; expected \$\.\.\.-20" + MOVB x+0(FP), AX // ERROR "invalid MOVB of x\+0\(FP\); \*byte is 4-byte value" + MOVB y+4(FP), BX // ERROR "invalid MOVB of y\+4\(FP\); \*byte is 4-byte value" + MOVH x+0(FP), AX // ERROR "invalid MOVH of x\+0\(FP\); \*byte is 4-byte value" + MOVH y+4(FP), AX // ERROR "invalid MOVH of y\+4\(FP\); \*byte is 4-byte value" + MOVW x+0(FP), AX + MOVW y+4(FP), AX + MOVQ x+4(FP), AX // ERROR "invalid offset x\+4\(FP\); expected x\+0\(FP\)" + MOVQ y+2(FP), AX // ERROR "invalid offset y\+2\(FP\); expected y\+4\(FP\)" + MOVH c+8(FP), AX // ERROR "invalid MOVH of c\+8\(FP\); chan int is 4-byte value" + MOVH m+12(FP), AX // ERROR "invalid MOVH of m\+12\(FP\); map\[int\]int is 4-byte value" + MOVH f+16(FP), AX // ERROR "invalid MOVH of f\+16\(FP\); func\(\) is 4-byte value" + RET + +TEXT ·argstring(SB),0,$16 // ERROR "wrong argument size 0; expected \$\.\.\.-16" + MOVH x+0(FP), AX // ERROR "invalid MOVH of x\+0\(FP\); string base is 4-byte value" + MOVW x+0(FP), AX + MOVH x_base+0(FP), AX // ERROR "invalid MOVH of x_base\+0\(FP\); string base is 4-byte value" + MOVW x_base+0(FP), AX + MOVH x_len+0(FP), AX // ERROR "invalid offset x_len\+0\(FP\); expected x_len\+4\(FP\)" + MOVW x_len+0(FP), AX // ERROR "invalid offset x_len\+0\(FP\); expected x_len\+4\(FP\)" + MOVQ x_len+0(FP), AX // ERROR "invalid offset x_len\+0\(FP\); expected x_len\+4\(FP\)" + MOVH x_len+4(FP), AX // ERROR "invalid MOVH of x_len\+4\(FP\); string len is 4-byte value" + MOVW x_len+4(FP), AX + MOVQ y+0(FP), AX // ERROR "invalid offset y\+0\(FP\); expected y\+8\(FP\)" + MOVQ y_len+4(FP), AX // ERROR "invalid offset y_len\+4\(FP\); expected y_len\+12\(FP\)" + RET + +TEXT ·argslice(SB),0,$24 // ERROR "wrong argument size 0; expected \$\.\.\.-24" + MOVH x+0(FP), AX // ERROR "invalid MOVH of x\+0\(FP\); slice base is 4-byte value" + MOVW x+0(FP), AX + MOVH x_base+0(FP), AX // ERROR "invalid MOVH of x_base\+0\(FP\); slice base is 4-byte value" + MOVW x_base+0(FP), AX + MOVH x_len+0(FP), AX // ERROR "invalid offset x_len\+0\(FP\); expected x_len\+4\(FP\)" + MOVW x_len+0(FP), AX // ERROR "invalid offset x_len\+0\(FP\); expected x_len\+4\(FP\)" + MOVQ x_len+0(FP), AX // ERROR "invalid offset x_len\+0\(FP\); expected x_len\+4\(FP\)" + MOVH x_len+4(FP), AX // ERROR "invalid MOVH of x_len\+4\(FP\); slice len is 4-byte value" + MOVW x_len+4(FP), AX + MOVH x_cap+0(FP), AX // ERROR "invalid offset x_cap\+0\(FP\); expected x_cap\+8\(FP\)" + MOVW x_cap+0(FP), AX // ERROR "invalid offset x_cap\+0\(FP\); expected x_cap\+8\(FP\)" + MOVQ x_cap+0(FP), AX // ERROR "invalid offset x_cap\+0\(FP\); expected x_cap\+8\(FP\)" + MOVH x_cap+8(FP), AX // ERROR "invalid MOVH of x_cap\+8\(FP\); slice cap is 4-byte value" + MOVW x_cap+8(FP), AX + MOVQ y+0(FP), AX // ERROR "invalid offset y\+0\(FP\); expected y\+12\(FP\)" + MOVQ y_len+4(FP), AX // ERROR "invalid offset y_len\+4\(FP\); expected y_len\+16\(FP\)" + MOVQ y_cap+8(FP), AX // ERROR "invalid offset y_cap\+8\(FP\); expected y_cap\+20\(FP\)" + RET + +TEXT ·argiface(SB),0,$0-16 + MOVH x+0(FP), AX // ERROR "invalid MOVH of x\+0\(FP\); interface type is 4-byte value" + MOVW x+0(FP), AX + MOVH x_type+0(FP), AX // ERROR "invalid MOVH of x_type\+0\(FP\); interface type is 4-byte value" + MOVW x_type+0(FP), AX + MOVQ x_itable+0(FP), AX // ERROR "unknown variable x_itable; offset 0 is x_type\+0\(FP\)" + MOVQ x_itable+1(FP), AX // ERROR "unknown variable x_itable; offset 1 is x_type\+0\(FP\)" + MOVH x_data+0(FP), AX // ERROR "invalid offset x_data\+0\(FP\); expected x_data\+4\(FP\)" + MOVW x_data+0(FP), AX // ERROR "invalid offset x_data\+0\(FP\); expected x_data\+4\(FP\)" + MOVQ x_data+0(FP), AX // ERROR "invalid offset x_data\+0\(FP\); expected x_data\+4\(FP\)" + MOVH x_data+4(FP), AX // ERROR "invalid MOVH of x_data\+4\(FP\); interface data is 4-byte value" + MOVW x_data+4(FP), AX + MOVH y+8(FP), AX // ERROR "invalid MOVH of y\+8\(FP\); interface itable is 4-byte value" + MOVW y+8(FP), AX + MOVH y_itable+8(FP), AX // ERROR "invalid MOVH of y_itable\+8\(FP\); interface itable is 4-byte value" + MOVW y_itable+8(FP), AX + MOVQ y_type+8(FP), AX // ERROR "unknown variable y_type; offset 8 is y_itable\+8\(FP\)" + MOVH y_data+8(FP), AX // ERROR "invalid offset y_data\+8\(FP\); expected y_data\+12\(FP\)" + MOVW y_data+8(FP), AX // ERROR "invalid offset y_data\+8\(FP\); expected y_data\+12\(FP\)" + MOVQ y_data+8(FP), AX // ERROR "invalid offset y_data\+8\(FP\); expected y_data\+12\(FP\)" + MOVH y_data+12(FP), AX // ERROR "invalid MOVH of y_data\+12\(FP\); interface data is 4-byte value" + MOVW y_data+12(FP), AX + RET + +TEXT ·returnint(SB),0,$0-4 + MOVB AX, ret+0(FP) // ERROR "invalid MOVB of ret\+0\(FP\); int is 4-byte value" + MOVH AX, ret+0(FP) // ERROR "invalid MOVH of ret\+0\(FP\); int is 4-byte value" + MOVW AX, ret+0(FP) + MOVQ AX, ret+1(FP) // ERROR "invalid offset ret\+1\(FP\); expected ret\+0\(FP\)" + MOVQ AX, r+0(FP) // ERROR "unknown variable r; offset 0 is ret\+0\(FP\)" + RET + +TEXT ·returnbyte(SB),0,$0-5 + MOVW x+0(FP), AX + MOVB AX, ret+4(FP) + MOVH AX, ret+4(FP) // ERROR "invalid MOVH of ret\+4\(FP\); byte is 1-byte value" + MOVW AX, ret+4(FP) // ERROR "invalid MOVW of ret\+4\(FP\); byte is 1-byte value" + MOVB AX, ret+3(FP) // ERROR "invalid offset ret\+3\(FP\); expected ret\+4\(FP\)" + RET + +TEXT ·returnnamed(SB),0,$0-21 + MOVB x+0(FP), AX + MOVW AX, r1+4(FP) + MOVH AX, r2+8(FP) + MOVW AX, r3+12(FP) + MOVW AX, r3_base+12(FP) + MOVW AX, r3_len+16(FP) + MOVB AX, r4+20(FP) + MOVB AX, r1+4(FP) // ERROR "invalid MOVB of r1\+4\(FP\); int is 4-byte value" + RET + +TEXT ·returnintmissing(SB),0,$0-4 + RET // ERROR "RET without writing to 4-byte ret\+0\(FP\)" + +TEXT ·leaf(SB),0,$-4-12 + MOVW x+0(FP), AX + MOVW y+4(FP), AX + MOVW AX, ret+8(FP) + RET diff --git a/src/cmd/vet/testdata/asm4.s b/src/cmd/vet/testdata/asm4.s new file mode 100644 index 0000000000000000000000000000000000000000..044b050b6b99e1426f1cc653bb4c25428dd1b52d --- /dev/null +++ b/src/cmd/vet/testdata/asm4.s @@ -0,0 +1,26 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build amd64 +// +build vet_test + +// Test cases for symbolic NOSPLIT etc. on TEXT symbols. + +TEXT ·noprof(SB),NOPROF,$0-8 + RET + +TEXT ·dupok(SB),DUPOK,$0-8 + RET + +TEXT ·nosplit(SB),NOSPLIT,$0 + RET + +TEXT ·rodata(SB),RODATA,$0-8 + RET + +TEXT ·noptr(SB),NOPTR|NOSPLIT,$0 + RET + +TEXT ·wrapper(SB),WRAPPER,$0-8 + RET diff --git a/src/cmd/vet/testdata/assign.go b/src/cmd/vet/testdata/assign.go new file mode 100644 index 0000000000000000000000000000000000000000..32ba8683c148522a7f2cfa618e6a661c470e3a0f --- /dev/null +++ b/src/cmd/vet/testdata/assign.go @@ -0,0 +1,18 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// This file contains tests for the useless-assignment checker. + +package testdata + +type ST struct { + x int +} + +func (s *ST) SetX(x int) { + // Accidental self-assignment; it should be "s.x = x" + x = x // ERROR "self-assignment of x to x" + // Another mistake + s.x = s.x // ERROR "self-assignment of s.x to s.x" +} diff --git a/src/cmd/vet/testdata/atomic.go b/src/cmd/vet/testdata/atomic.go new file mode 100644 index 0000000000000000000000000000000000000000..1ba261d9412a2b47684e113f4562b447c1cf80e2 --- /dev/null +++ b/src/cmd/vet/testdata/atomic.go @@ -0,0 +1,43 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// This file contains tests for the atomic checker. + +package testdata + +import ( + "sync/atomic" +) + +type Counter uint64 + +func AtomicTests() { + x := uint64(1) + x = atomic.AddUint64(&x, 1) // ERROR "direct assignment to atomic value" + _, x = 10, atomic.AddUint64(&x, 1) // ERROR "direct assignment to atomic value" + x, _ = atomic.AddUint64(&x, 1), 10 // ERROR "direct assignment to atomic value" + + y := &x + *y = atomic.AddUint64(y, 1) // ERROR "direct assignment to atomic value" + + var su struct{ Counter uint64 } + su.Counter = atomic.AddUint64(&su.Counter, 1) // ERROR "direct assignment to atomic value" + z1 := atomic.AddUint64(&su.Counter, 1) + _ = z1 // Avoid err "z declared and not used" + + var sp struct{ Counter *uint64 } + *sp.Counter = atomic.AddUint64(sp.Counter, 1) // ERROR "direct assignment to atomic value" + z2 := atomic.AddUint64(sp.Counter, 1) + _ = z2 // Avoid err "z declared and not used" + + au := []uint64{10, 20} + au[0] = atomic.AddUint64(&au[0], 1) // ERROR "direct assignment to atomic value" + au[1] = atomic.AddUint64(&au[0], 1) + + ap := []*uint64{&au[0], &au[1]} + *ap[0] = atomic.AddUint64(ap[0], 1) // ERROR "direct assignment to atomic value" + *ap[1] = atomic.AddUint64(ap[0], 1) + + x = atomic.AddUint64() // Used to make vet crash; now silently ignored. +} diff --git a/src/cmd/vet/testdata/bool.go b/src/cmd/vet/testdata/bool.go new file mode 100644 index 0000000000000000000000000000000000000000..af6cc011dd60c4d95fcdae7400945b4c943d1e67 --- /dev/null +++ b/src/cmd/vet/testdata/bool.go @@ -0,0 +1,113 @@ +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// This file contains tests for the bool checker. + +package testdata + +import "io" + +func RatherStupidConditions() { + var f, g func() int + if f() == 0 || f() == 0 { // OK f might have side effects + } + if v, w := f(), g(); v == w || v == w { // ERROR "redundant or: v == w || v == w" + } + _ = f == nil || f == nil // ERROR "redundant or: f == nil || f == nil" + + _ = i == byte(1) || i == byte(1) // TODO conversions are treated as if they may have side effects + + var c chan int + _ = 0 == <-c || 0 == <-c // OK subsequent receives may yield different values + for i, j := <-c, <-c; i == j || i == j; i, j = <-c, <-c { // ERROR "redundant or: i == j || i == j" + } + + var i, j, k int + _ = i+1 == 1 || i+1 == 1 // ERROR "redundant or: i\+1 == 1 || i\+1 == 1" + _ = i == 1 || j+1 == i || i == 1 // ERROR "redundant or: i == 1 || i == 1" + + _ = i == 1 || i == 1 || f() == 1 // ERROR "redundant or: i == 1 || i == 1" + _ = i == 1 || f() == 1 || i == 1 // OK f may alter i as a side effect + _ = f() == 1 || i == 1 || i == 1 // ERROR "redundant or: i == 1 || i == 1" + + // Test partition edge cases + _ = f() == 1 || i == 1 || i == 1 || j == 1 // ERROR "redundant or: i == 1 || i == 1" + _ = f() == 1 || j == 1 || i == 1 || i == 1 // ERROR "redundant or: i == 1 || i == 1" + _ = i == 1 || f() == 1 || i == 1 || i == 1 // ERROR "redundant or: i == 1 || i == 1" + _ = i == 1 || i == 1 || f() == 1 || i == 1 // ERROR "redundant or: i == 1 || i == 1" + _ = i == 1 || i == 1 || j == 1 || f() == 1 // ERROR "redundant or: i == 1 || i == 1" + _ = j == 1 || i == 1 || i == 1 || f() == 1 // ERROR "redundant or: i == 1 || i == 1" + _ = i == 1 || f() == 1 || f() == 1 || i == 1 + + _ = i == 1 || (i == 1 || i == 2) // ERROR "redundant or: i == 1 || i == 1" + _ = i == 1 || (f() == 1 || i == 1) // OK f may alter i as a side effect + _ = i == 1 || (i == 1 || f() == 1) // ERROR "redundant or: i == 1 || i == 1" + _ = i == 1 || (i == 2 || (i == 1 || i == 3)) // ERROR "redundant or: i == 1 || i == 1" + + var a, b bool + _ = i == 1 || (a || (i == 1 || b)) // ERROR "redundant or: i == 1 || i == 1" + + // Check that all redundant ors are flagged + _ = j == 0 || + i == 1 || + f() == 1 || + j == 0 || // ERROR "redundant or: j == 0 || j == 0" + i == 1 || // ERROR "redundant or: i == 1 || i == 1" + i == 1 || // ERROR "redundant or: i == 1 || i == 1" + i == 1 || + j == 0 || + k == 0 + + _ = i == 1*2*3 || i == 1*2*3 // ERROR "redundant or: i == 1\*2\*3 || i == 1\*2\*3" + + // These test that redundant, suspect expressions do not trigger multiple errors. + _ = i != 0 || i != 0 // ERROR "redundant or: i != 0 || i != 0" + _ = i == 0 && i == 0 // ERROR "redundant and: i == 0 && i == 0" + + // and is dual to or; check the basics and + // let the or tests pull the rest of the weight. + _ = 0 != <-c && 0 != <-c // OK subsequent receives may yield different values + _ = f() != 0 && f() != 0 // OK f might have side effects + _ = f != nil && f != nil // ERROR "redundant and: f != nil && f != nil" + _ = i != 1 && i != 1 && f() != 1 // ERROR "redundant and: i != 1 && i != 1" + _ = i != 1 && f() != 1 && i != 1 // OK f may alter i as a side effect + _ = f() != 1 && i != 1 && i != 1 // ERROR "redundant and: i != 1 && i != 1" +} + +func RoyallySuspectConditions() { + var i, j int + + _ = i == 0 || i == 1 // OK + _ = i != 0 || i != 1 // ERROR "suspect or: i != 0 || i != 1" + _ = i != 0 || 1 != i // ERROR "suspect or: i != 0 || 1 != i" + _ = 0 != i || 1 != i // ERROR "suspect or: 0 != i || 1 != i" + _ = 0 != i || i != 1 // ERROR "suspect or: 0 != i || i != 1" + + _ = (0 != i) || i != 1 // ERROR "suspect or: 0 != i || i != 1" + + _ = i+3 != 7 || j+5 == 0 || i+3 != 9 // ERROR "suspect or: i\+3 != 7 || i\+3 != 9" + + _ = i != 0 || j == 0 || i != 1 // ERROR "suspect or: i != 0 || i != 1" + + _ = i != 0 || i != 1<<4 // ERROR "suspect or: i != 0 || i != 1<<4" + + _ = i != 0 || j != 0 + _ = 0 != i || 0 != j + + var s string + _ = s != "one" || s != "the other" // ERROR "suspect or: s != .one. || s != .the other." + + _ = "et" != "alii" || "et" != "cetera" // ERROR "suspect or: .et. != .alii. || .et. != .cetera." + _ = "me gustas" != "tu" || "le gustas" != "tu" // OK we could catch this case, but it's not worth the code + + var err error + _ = err != nil || err != io.EOF // TODO catch this case? + + // Sanity check and. + _ = i != 0 && i != 1 // OK + _ = i == 0 && i == 1 // ERROR "suspect and: i == 0 && i == 1" + _ = i == 0 && 1 == i // ERROR "suspect and: i == 0 && 1 == i" + _ = 0 == i && 1 == i // ERROR "suspect and: 0 == i && 1 == i" + _ = 0 == i && i == 1 // ERROR "suspect and: 0 == i && i == 1" +} diff --git a/src/cmd/vet/testdata/buildtag.go b/src/cmd/vet/testdata/buildtag.go new file mode 100644 index 0000000000000000000000000000000000000000..eb36fd32592eee89609a0c92a3c8f5eb9e9dfc28 --- /dev/null +++ b/src/cmd/vet/testdata/buildtag.go @@ -0,0 +1,14 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// This file contains tests for the buildtag checker. + +// +builder // ERROR "possible malformed \+build comment" +// +build !ignore + +package testdata + +// +build toolate // ERROR "build comment must appear before package clause and be followed by a blank line" + +var _ = 3 diff --git a/src/cmd/vet/testdata/buildtag_bad.go b/src/cmd/vet/testdata/buildtag_bad.go new file mode 100644 index 0000000000000000000000000000000000000000..fbe10cf748f58b1a1291117d4d684b0dc941c782 --- /dev/null +++ b/src/cmd/vet/testdata/buildtag_bad.go @@ -0,0 +1,15 @@ +// This file contains misplaced or malformed build constraints. +// The Go tool will skip it, because the constraints are invalid. +// It serves only to test the tag checker during make test. + +// Mention +build // ERROR "possible malformed \+build comment" + +// +build !!bang // ERROR "invalid double negative in build constraint" +// +build @#$ // ERROR "invalid non-alphanumeric build constraint" + +// +build toolate // ERROR "build comment must appear before package clause and be followed by a blank line" +package bad + +// This is package 'bad' rather than 'main' so the erroneous build +// tag doesn't end up looking like a package doc for the vet command +// when examined by godoc. diff --git a/src/cmd/vet/testdata/composite.go b/src/cmd/vet/testdata/composite.go new file mode 100644 index 0000000000000000000000000000000000000000..69e7d7ccb0a84e2a8a02e1a8aebaaeb752881e4d --- /dev/null +++ b/src/cmd/vet/testdata/composite.go @@ -0,0 +1,63 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// This file contains tests for the untagged struct literal checker. + +// This file contains the test for untagged struct literals. + +package testdata + +import ( + "flag" + "go/scanner" +) + +var Okay1 = []string{ + "Name", + "Usage", + "DefValue", +} + +var Okay2 = map[string]bool{ + "Name": true, + "Usage": true, + "DefValue": true, +} + +var Okay3 = struct { + X string + Y string + Z string +}{ + "Name", + "Usage", + "DefValue", +} + +type MyStruct struct { + X string + Y string + Z string +} + +var Okay4 = MyStruct{ + "Name", + "Usage", + "DefValue", +} + +// Testing is awkward because we need to reference things from a separate package +// to trigger the warnings. + +var BadStructLiteralUsedInTests = flag.Flag{ // ERROR "unkeyed fields" + "Name", + "Usage", + nil, // Value + "DefValue", +} + +// Used to test the check for slices and arrays: If that test is disabled and +// vet is run with --compositewhitelist=false, this line triggers an error. +// Clumsy but sufficient. +var scannerErrorListTest = scanner.ErrorList{nil, nil} diff --git a/src/cmd/vet/testdata/copylock_func.go b/src/cmd/vet/testdata/copylock_func.go new file mode 100644 index 0000000000000000000000000000000000000000..d83957fe1832f6b6afa9255f005e7e98a5769287 --- /dev/null +++ b/src/cmd/vet/testdata/copylock_func.go @@ -0,0 +1,95 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// This file contains tests for the copylock checker's +// function declaration analysis. + +package testdata + +import "sync" + +func OkFunc(*sync.Mutex) {} +func BadFunc(sync.Mutex) {} // ERROR "BadFunc passes Lock by value: sync.Mutex" +func OkRet() *sync.Mutex {} +func BadRet() sync.Mutex {} // ERROR "BadRet returns Lock by value: sync.Mutex" + +var ( + OkClosure = func(*sync.Mutex) {} + BadClosure = func(sync.Mutex) {} // ERROR "func passes Lock by value: sync.Mutex" +) + +type EmbeddedRWMutex struct { + sync.RWMutex +} + +func (*EmbeddedRWMutex) OkMeth() {} +func (EmbeddedRWMutex) BadMeth() {} // ERROR "BadMeth passes Lock by value: testdata.EmbeddedRWMutex" +func OkFunc(e *EmbeddedRWMutex) {} +func BadFunc(EmbeddedRWMutex) {} // ERROR "BadFunc passes Lock by value: testdata.EmbeddedRWMutex" +func OkRet() *EmbeddedRWMutex {} +func BadRet() EmbeddedRWMutex {} // ERROR "BadRet returns Lock by value: testdata.EmbeddedRWMutex" + +type FieldMutex struct { + s sync.Mutex +} + +func (*FieldMutex) OkMeth() {} +func (FieldMutex) BadMeth() {} // ERROR "BadMeth passes Lock by value: testdata.FieldMutex contains sync.Mutex" +func OkFunc(*FieldMutex) {} +func BadFunc(FieldMutex, int) {} // ERROR "BadFunc passes Lock by value: testdata.FieldMutex contains sync.Mutex" + +type L0 struct { + L1 +} + +type L1 struct { + l L2 +} + +type L2 struct { + sync.Mutex +} + +func (*L0) Ok() {} +func (L0) Bad() {} // ERROR "Bad passes Lock by value: testdata.L0 contains testdata.L1 contains testdata.L2" + +type EmbeddedMutexPointer struct { + s *sync.Mutex // safe to copy this pointer +} + +func (*EmbeddedMutexPointer) Ok() {} +func (EmbeddedMutexPointer) AlsoOk() {} +func StillOk(EmbeddedMutexPointer) {} +func LookinGood() EmbeddedMutexPointer {} + +type EmbeddedLocker struct { + sync.Locker // safe to copy interface values +} + +func (*EmbeddedLocker) Ok() {} +func (EmbeddedLocker) AlsoOk() {} + +type CustomLock struct{} + +func (*CustomLock) Lock() {} +func (*CustomLock) Unlock() {} + +func Ok(*CustomLock) {} +func Bad(CustomLock) {} // ERROR "Bad passes Lock by value: testdata.CustomLock" + +// TODO: Unfortunate cases + +// Non-ideal error message: +// Since we're looking for Lock methods, sync.Once's underlying +// sync.Mutex gets called out, but without any reference to the sync.Once. +type LocalOnce sync.Once + +func (LocalOnce) Bad() {} // ERROR "Bad passes Lock by value: testdata.LocalOnce contains sync.Mutex" + +// False negative: +// LocalMutex doesn't have a Lock method. +// Nevertheless, it is probably a bad idea to pass it by value. +type LocalMutex sync.Mutex + +func (LocalMutex) Bad() {} // WANTED: An error here :( diff --git a/src/cmd/vet/testdata/copylock_range.go b/src/cmd/vet/testdata/copylock_range.go new file mode 100644 index 0000000000000000000000000000000000000000..f95b0252b6f4da6f6d57e408915cec381df53944 --- /dev/null +++ b/src/cmd/vet/testdata/copylock_range.go @@ -0,0 +1,67 @@ +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// This file contains tests for the copylock checker's +// range statement analysis. + +package testdata + +import "sync" + +func rangeMutex() { + var mu sync.Mutex + var i int + + var s []sync.Mutex + for range s { + } + for i = range s { + } + for i := range s { + } + for i, _ = range s { + } + for i, _ := range s { + } + for _, mu = range s { // ERROR "range var mu copies Lock: sync.Mutex" + } + for _, m := range s { // ERROR "range var m copies Lock: sync.Mutex" + } + for i, mu = range s { // ERROR "range var mu copies Lock: sync.Mutex" + } + for i, m := range s { // ERROR "range var m copies Lock: sync.Mutex" + } + + var a [3]sync.Mutex + for _, m := range a { // ERROR "range var m copies Lock: sync.Mutex" + } + + var m map[sync.Mutex]sync.Mutex + for k := range m { // ERROR "range var k copies Lock: sync.Mutex" + } + for mu, _ = range m { // ERROR "range var mu copies Lock: sync.Mutex" + } + for k, _ := range m { // ERROR "range var k copies Lock: sync.Mutex" + } + for _, mu = range m { // ERROR "range var mu copies Lock: sync.Mutex" + } + for _, v := range m { // ERROR "range var v copies Lock: sync.Mutex" + } + + var c chan sync.Mutex + for range c { + } + for mu = range c { // ERROR "range var mu copies Lock: sync.Mutex" + } + for v := range c { // ERROR "range var v copies Lock: sync.Mutex" + } + + // Test non-idents in range variables + var t struct { + i int + mu sync.Mutex + } + for t.i, t.mu = range s { // ERROR "range var t.mu copies Lock: sync.Mutex" + } +} diff --git a/src/cmd/vet/testdata/deadcode.go b/src/cmd/vet/testdata/deadcode.go new file mode 100644 index 0000000000000000000000000000000000000000..5370bc32f6577e37222d0ee10ac7ac3d4a0b657d --- /dev/null +++ b/src/cmd/vet/testdata/deadcode.go @@ -0,0 +1,2125 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build ignore + +// This file contains tests for the dead code checker. + +package testdata + +type T int + +var x interface{} +var c chan int + +func external() int // ok + +func _() int { +} + +func _() int { + print(1) +} + +func _() int { + print(1) + return 2 + println() // ERROR "unreachable code" +} + +func _() int { +L: + print(1) + goto L + println() // ERROR "unreachable code" +} + +func _() int { + print(1) + panic(2) + println() // ERROR "unreachable code" +} + +// but only builtin panic +func _() int { + var panic = func(int) {} + print(1) + panic(2) + println() // ok +} + +func _() int { + { + print(1) + return 2 + println() // ERROR "unreachable code" + } + println() // ok +} + +func _() int { + { + print(1) + return 2 + } + println() // ERROR "unreachable code" +} + +func _() int { +L: + { + print(1) + goto L + println() // ERROR "unreachable code" + } + println() // ok +} + +func _() int { +L: + { + print(1) + goto L + } + println() // ERROR "unreachable code" +} + +func _() int { + print(1) + { + panic(2) + } +} + +func _() int { + print(1) + { + panic(2) + println() // ERROR "unreachable code" + } +} + +func _() int { + print(1) + { + panic(2) + } + println() // ERROR "unreachable code" +} + +func _() int { + print(1) + return 2 + { // ERROR "unreachable code" + } +} + +func _() int { +L: + print(1) + goto L + { // ERROR "unreachable code" + } +} + +func _() int { + print(1) + panic(2) + { // ERROR "unreachable code" + } +} + +func _() int { + { + print(1) + return 2 + { // ERROR "unreachable code" + } + } +} + +func _() int { +L: + { + print(1) + goto L + { // ERROR "unreachable code" + } + } +} + +func _() int { + print(1) + { + panic(2) + { // ERROR "unreachable code" + } + } +} + +func _() int { + { + print(1) + return 2 + } + { // ERROR "unreachable code" + } +} + +func _() int { +L: + { + print(1) + goto L + } + { // ERROR "unreachable code" + } +} + +func _() int { + print(1) + { + panic(2) + } + { // ERROR "unreachable code" + } +} + +func _() int { + print(1) + if x == nil { + panic(2) + } else { + panic(3) + } + println() // ERROR "unreachable code" +} + +func _() int { +L: + print(1) + if x == nil { + panic(2) + } else { + goto L + } + println() // ERROR "unreachable code" +} + +func _() int { +L: + print(1) + if x == nil { + panic(2) + } else if x == 1 { + return 0 + } else if x != 2 { + panic(3) + } else { + goto L + } + println() // ERROR "unreachable code" +} + +// if-else chain missing final else is not okay, even if the +// conditions cover every possible case. + +func _() int { + print(1) + if x == nil { + panic(2) + } else if x != nil { + panic(3) + } + println() // ok +} + +func _() int { + print(1) + if x == nil { + panic(2) + } + println() // ok +} + +func _() int { +L: + print(1) + if x == nil { + panic(2) + } else if x == 1 { + return 0 + } else if x != 1 { + panic(3) + } + println() // ok +} + +func _() int { + print(1) + for { + } + println() // ERROR "unreachable code" +} + +func _() int { + for { + for { + break + } + } + println() // ERROR "unreachable code" +} + +func _() int { + for { + for { + break + println() // ERROR "unreachable code" + } + } +} + +func _() int { + for { + for { + continue + println() // ERROR "unreachable code" + } + } +} + +func _() int { + for { + L: + for { + break L + } + } + println() // ERROR "unreachable code" +} + +func _() int { + print(1) + for { + break + } + println() // ok +} + +func _() int { + for { + for { + } + break // ERROR "unreachable code" + } + println() // ok +} + +func _() int { +L: + for { + for { + break L + } + } + println() // ok +} + +func _() int { + print(1) + for x == nil { + } + println() // ok +} + +func _() int { + for x == nil { + for { + break + } + } + println() // ok +} + +func _() int { + for x == nil { + L: + for { + break L + } + } + println() // ok +} + +func _() int { + print(1) + for true { + } + println() // ok +} + +func _() int { + for true { + for { + break + } + } + println() // ok +} + +func _() int { + for true { + L: + for { + break L + } + } + println() // ok +} + +func _() int { + print(1) + select {} + println() // ERROR "unreachable code" +} + +func _() int { + print(1) + select { + case <-c: + print(2) + panic("abc") + println() // ERROR "unreachable code" + } +} + +func _() int { + print(1) + select { + case <-c: + print(2) + panic("abc") + } + println() // ERROR "unreachable code" +} + +func _() int { + print(1) + select { + case <-c: + print(2) + for { + } + println() // ERROR "unreachable code" + } +} + +func _() int { + print(1) + select { + case <-c: + print(2) + for { + } + } + println() // ERROR "unreachable code" +} + +func _() int { +L: + print(1) + select { + case <-c: + print(2) + panic("abc") + println() // ERROR "unreachable code" + case c <- 1: + print(2) + goto L + println() // ERROR "unreachable code" + } +} + +func _() int { +L: + print(1) + select { + case <-c: + print(2) + panic("abc") + case c <- 1: + print(2) + goto L + } + println() // ERROR "unreachable code" +} + +func _() int { + print(1) + select { + case <-c: + print(2) + panic("abc") + println() // ERROR "unreachable code" + default: + select {} + println() // ERROR "unreachable code" + } +} + +func _() int { + print(1) + select { + case <-c: + print(2) + panic("abc") + default: + select {} + } + println() // ERROR "unreachable code" +} + +func _() int { + print(1) + select { + case <-c: + print(2) + } + println() // ok +} + +func _() int { +L: + print(1) + select { + case <-c: + print(2) + panic("abc") + goto L // ERROR "unreachable code" + case c <- 1: + print(2) + } + println() // ok +} + +func _() int { + print(1) + select { + case <-c: + print(2) + panic("abc") + default: + print(2) + } + println() // ok +} + +func _() int { + print(1) + select { + default: + break + } + println() // ok +} + +func _() int { + print(1) + select { + case <-c: + print(2) + panic("abc") + break // ERROR "unreachable code" + } + println() // ok +} + +func _() int { + print(1) +L: + select { + case <-c: + print(2) + for { + break L + } + } + println() // ok +} + +func _() int { + print(1) +L: + select { + case <-c: + print(2) + panic("abc") + case c <- 1: + print(2) + break L + } + println() // ok +} + +func _() int { + print(1) + select { + case <-c: + print(1) + panic("abc") + default: + select {} + break // ERROR "unreachable code" + } + println() // ok +} + +func _() int { + print(1) + switch x { + case 1: + print(2) + panic(3) + println() // ERROR "unreachable code" + default: + return 4 + println() // ERROR "unreachable code" + } +} + +func _() int { + print(1) + switch x { + case 1: + print(2) + panic(3) + default: + return 4 + } + println() // ERROR "unreachable code" +} + +func _() int { + print(1) + switch x { + default: + return 4 + println() // ERROR "unreachable code" + case 1: + print(2) + panic(3) + println() // ERROR "unreachable code" + } +} + +func _() int { + print(1) + switch x { + default: + return 4 + case 1: + print(2) + panic(3) + } + println() // ERROR "unreachable code" +} + +func _() int { + print(1) + switch x { + case 1: + print(2) + fallthrough + default: + return 4 + println() // ERROR "unreachable code" + } +} + +func _() int { + print(1) + switch x { + case 1: + print(2) + fallthrough + default: + return 4 + } + println() // ERROR "unreachable code" +} + +func _() int { + print(1) + switch { + } + println() // ok +} + +func _() int { + print(1) + switch x { + case 1: + print(2) + panic(3) + case 2: + return 4 + } + println() // ok +} + +func _() int { + print(1) + switch x { + case 2: + return 4 + case 1: + print(2) + panic(3) + } + println() // ok +} + +func _() int { + print(1) + switch x { + case 1: + print(2) + fallthrough + case 2: + return 4 + } + println() // ok +} + +func _() int { + print(1) + switch x { + case 1: + print(2) + panic(3) + } + println() // ok +} + +func _() int { + print(1) +L: + switch x { + case 1: + print(2) + panic(3) + break L // ERROR "unreachable code" + default: + return 4 + } + println() // ok +} + +func _() int { + print(1) + switch x { + default: + return 4 + break // ERROR "unreachable code" + case 1: + print(2) + panic(3) + } + println() // ok +} + +func _() int { + print(1) +L: + switch x { + case 1: + print(2) + for { + break L + } + default: + return 4 + } + println() // ok +} + +func _() int { + print(1) + switch x.(type) { + case int: + print(2) + panic(3) + println() // ERROR "unreachable code" + default: + return 4 + println() // ERROR "unreachable code" + } +} + +func _() int { + print(1) + switch x.(type) { + case int: + print(2) + panic(3) + default: + return 4 + } + println() // ERROR "unreachable code" +} + +func _() int { + print(1) + switch x.(type) { + default: + return 4 + println() // ERROR "unreachable code" + case int: + print(2) + panic(3) + println() // ERROR "unreachable code" + } +} + +func _() int { + print(1) + switch x.(type) { + default: + return 4 + case int: + print(2) + panic(3) + } + println() // ERROR "unreachable code" +} + +func _() int { + print(1) + switch x.(type) { + case int: + print(2) + fallthrough + default: + return 4 + println() // ERROR "unreachable code" + } +} + +func _() int { + print(1) + switch x.(type) { + case int: + print(2) + fallthrough + default: + return 4 + } + println() // ERROR "unreachable code" +} + +func _() int { + print(1) + switch { + } + println() // ok +} + +func _() int { + print(1) + switch x.(type) { + case int: + print(2) + panic(3) + case float64: + return 4 + } + println() // ok +} + +func _() int { + print(1) + switch x.(type) { + case float64: + return 4 + case int: + print(2) + panic(3) + } + println() // ok +} + +func _() int { + print(1) + switch x.(type) { + case int: + print(2) + fallthrough + case float64: + return 4 + } + println() // ok +} + +func _() int { + print(1) + switch x.(type) { + case int: + print(2) + panic(3) + } + println() // ok +} + +func _() int { + print(1) +L: + switch x.(type) { + case int: + print(2) + panic(3) + break L // ERROR "unreachable code" + default: + return 4 + } + println() // ok +} + +func _() int { + print(1) + switch x.(type) { + default: + return 4 + break // ERROR "unreachable code" + case int: + print(2) + panic(3) + } + println() // ok +} + +func _() int { + print(1) +L: + switch x.(type) { + case int: + print(2) + for { + break L + } + default: + return 4 + } + println() // ok +} + +// again, but without the leading print(1). +// testing that everything works when the terminating statement is first. + +func _() int { + println() // ok +} + +func _() int { + return 2 + println() // ERROR "unreachable code" +} + +func _() int { +L: + goto L + println() // ERROR "unreachable code" +} + +func _() int { + panic(2) + println() // ERROR "unreachable code" +} + +// but only builtin panic +func _() int { + var panic = func(int) {} + panic(2) + println() // ok +} + +func _() int { + { + return 2 + println() // ERROR "unreachable code" + } +} + +func _() int { + { + return 2 + } + println() // ERROR "unreachable code" +} + +func _() int { +L: + { + goto L + println() // ERROR "unreachable code" + } +} + +func _() int { +L: + { + goto L + } + println() // ERROR "unreachable code" +} + +func _() int { + { + panic(2) + println() // ERROR "unreachable code" + } +} + +func _() int { + { + panic(2) + } + println() // ERROR "unreachable code" +} + +func _() int { + return 2 + { // ERROR "unreachable code" + } + println() // ok +} + +func _() int { +L: + goto L + { // ERROR "unreachable code" + } + println() // ok +} + +func _() int { + panic(2) + { // ERROR "unreachable code" + } + println() // ok +} + +func _() int { + { + return 2 + { // ERROR "unreachable code" + } + } + println() // ok +} + +func _() int { +L: + { + goto L + { // ERROR "unreachable code" + } + } + println() // ok +} + +func _() int { + { + panic(2) + { // ERROR "unreachable code" + } + } + println() // ok +} + +func _() int { + { + return 2 + } + { // ERROR "unreachable code" + } + println() // ok +} + +func _() int { +L: + { + goto L + } + { // ERROR "unreachable code" + } + println() // ok +} + +func _() int { + { + panic(2) + } + { // ERROR "unreachable code" + } + println() // ok +} + +// again, with func literals + +var _ = func() int { +} + +var _ = func() int { + print(1) +} + +var _ = func() int { + print(1) + return 2 + println() // ERROR "unreachable code" +} + +var _ = func() int { +L: + print(1) + goto L + println() // ERROR "unreachable code" +} + +var _ = func() int { + print(1) + panic(2) + println() // ERROR "unreachable code" +} + +// but only builtin panic +var _ = func() int { + var panic = func(int) {} + print(1) + panic(2) + println() // ok +} + +var _ = func() int { + { + print(1) + return 2 + println() // ERROR "unreachable code" + } + println() // ok +} + +var _ = func() int { + { + print(1) + return 2 + } + println() // ERROR "unreachable code" +} + +var _ = func() int { +L: + { + print(1) + goto L + println() // ERROR "unreachable code" + } + println() // ok +} + +var _ = func() int { +L: + { + print(1) + goto L + } + println() // ERROR "unreachable code" +} + +var _ = func() int { + print(1) + { + panic(2) + } +} + +var _ = func() int { + print(1) + { + panic(2) + println() // ERROR "unreachable code" + } +} + +var _ = func() int { + print(1) + { + panic(2) + } + println() // ERROR "unreachable code" +} + +var _ = func() int { + print(1) + return 2 + { // ERROR "unreachable code" + } +} + +var _ = func() int { +L: + print(1) + goto L + { // ERROR "unreachable code" + } +} + +var _ = func() int { + print(1) + panic(2) + { // ERROR "unreachable code" + } +} + +var _ = func() int { + { + print(1) + return 2 + { // ERROR "unreachable code" + } + } +} + +var _ = func() int { +L: + { + print(1) + goto L + { // ERROR "unreachable code" + } + } +} + +var _ = func() int { + print(1) + { + panic(2) + { // ERROR "unreachable code" + } + } +} + +var _ = func() int { + { + print(1) + return 2 + } + { // ERROR "unreachable code" + } +} + +var _ = func() int { +L: + { + print(1) + goto L + } + { // ERROR "unreachable code" + } +} + +var _ = func() int { + print(1) + { + panic(2) + } + { // ERROR "unreachable code" + } +} + +var _ = func() int { + print(1) + if x == nil { + panic(2) + } else { + panic(3) + } + println() // ERROR "unreachable code" +} + +var _ = func() int { +L: + print(1) + if x == nil { + panic(2) + } else { + goto L + } + println() // ERROR "unreachable code" +} + +var _ = func() int { +L: + print(1) + if x == nil { + panic(2) + } else if x == 1 { + return 0 + } else if x != 2 { + panic(3) + } else { + goto L + } + println() // ERROR "unreachable code" +} + +// if-else chain missing final else is not okay, even if the +// conditions cover every possible case. + +var _ = func() int { + print(1) + if x == nil { + panic(2) + } else if x != nil { + panic(3) + } + println() // ok +} + +var _ = func() int { + print(1) + if x == nil { + panic(2) + } + println() // ok +} + +var _ = func() int { +L: + print(1) + if x == nil { + panic(2) + } else if x == 1 { + return 0 + } else if x != 1 { + panic(3) + } + println() // ok +} + +var _ = func() int { + print(1) + for { + } + println() // ERROR "unreachable code" +} + +var _ = func() int { + for { + for { + break + } + } + println() // ERROR "unreachable code" +} + +var _ = func() int { + for { + for { + break + println() // ERROR "unreachable code" + } + } +} + +var _ = func() int { + for { + for { + continue + println() // ERROR "unreachable code" + } + } +} + +var _ = func() int { + for { + L: + for { + break L + } + } + println() // ERROR "unreachable code" +} + +var _ = func() int { + print(1) + for { + break + } + println() // ok +} + +var _ = func() int { + for { + for { + } + break // ERROR "unreachable code" + } + println() // ok +} + +var _ = func() int { +L: + for { + for { + break L + } + } + println() // ok +} + +var _ = func() int { + print(1) + for x == nil { + } + println() // ok +} + +var _ = func() int { + for x == nil { + for { + break + } + } + println() // ok +} + +var _ = func() int { + for x == nil { + L: + for { + break L + } + } + println() // ok +} + +var _ = func() int { + print(1) + for true { + } + println() // ok +} + +var _ = func() int { + for true { + for { + break + } + } + println() // ok +} + +var _ = func() int { + for true { + L: + for { + break L + } + } + println() // ok +} + +var _ = func() int { + print(1) + select {} + println() // ERROR "unreachable code" +} + +var _ = func() int { + print(1) + select { + case <-c: + print(2) + panic("abc") + println() // ERROR "unreachable code" + } +} + +var _ = func() int { + print(1) + select { + case <-c: + print(2) + panic("abc") + } + println() // ERROR "unreachable code" +} + +var _ = func() int { + print(1) + select { + case <-c: + print(2) + for { + } + println() // ERROR "unreachable code" + } +} + +var _ = func() int { + print(1) + select { + case <-c: + print(2) + for { + } + } + println() // ERROR "unreachable code" +} + +var _ = func() int { +L: + print(1) + select { + case <-c: + print(2) + panic("abc") + println() // ERROR "unreachable code" + case c <- 1: + print(2) + goto L + println() // ERROR "unreachable code" + } +} + +var _ = func() int { +L: + print(1) + select { + case <-c: + print(2) + panic("abc") + case c <- 1: + print(2) + goto L + } + println() // ERROR "unreachable code" +} + +var _ = func() int { + print(1) + select { + case <-c: + print(2) + panic("abc") + println() // ERROR "unreachable code" + default: + select {} + println() // ERROR "unreachable code" + } +} + +var _ = func() int { + print(1) + select { + case <-c: + print(2) + panic("abc") + default: + select {} + } + println() // ERROR "unreachable code" +} + +var _ = func() int { + print(1) + select { + case <-c: + print(2) + } + println() // ok +} + +var _ = func() int { +L: + print(1) + select { + case <-c: + print(2) + panic("abc") + goto L // ERROR "unreachable code" + case c <- 1: + print(2) + } + println() // ok +} + +var _ = func() int { + print(1) + select { + case <-c: + print(2) + panic("abc") + default: + print(2) + } + println() // ok +} + +var _ = func() int { + print(1) + select { + default: + break + } + println() // ok +} + +var _ = func() int { + print(1) + select { + case <-c: + print(2) + panic("abc") + break // ERROR "unreachable code" + } + println() // ok +} + +var _ = func() int { + print(1) +L: + select { + case <-c: + print(2) + for { + break L + } + } + println() // ok +} + +var _ = func() int { + print(1) +L: + select { + case <-c: + print(2) + panic("abc") + case c <- 1: + print(2) + break L + } + println() // ok +} + +var _ = func() int { + print(1) + select { + case <-c: + print(1) + panic("abc") + default: + select {} + break // ERROR "unreachable code" + } + println() // ok +} + +var _ = func() int { + print(1) + switch x { + case 1: + print(2) + panic(3) + println() // ERROR "unreachable code" + default: + return 4 + println() // ERROR "unreachable code" + } +} + +var _ = func() int { + print(1) + switch x { + case 1: + print(2) + panic(3) + default: + return 4 + } + println() // ERROR "unreachable code" +} + +var _ = func() int { + print(1) + switch x { + default: + return 4 + println() // ERROR "unreachable code" + case 1: + print(2) + panic(3) + println() // ERROR "unreachable code" + } +} + +var _ = func() int { + print(1) + switch x { + default: + return 4 + case 1: + print(2) + panic(3) + } + println() // ERROR "unreachable code" +} + +var _ = func() int { + print(1) + switch x { + case 1: + print(2) + fallthrough + default: + return 4 + println() // ERROR "unreachable code" + } +} + +var _ = func() int { + print(1) + switch x { + case 1: + print(2) + fallthrough + default: + return 4 + } + println() // ERROR "unreachable code" +} + +var _ = func() int { + print(1) + switch { + } + println() // ok +} + +var _ = func() int { + print(1) + switch x { + case 1: + print(2) + panic(3) + case 2: + return 4 + } + println() // ok +} + +var _ = func() int { + print(1) + switch x { + case 2: + return 4 + case 1: + print(2) + panic(3) + } + println() // ok +} + +var _ = func() int { + print(1) + switch x { + case 1: + print(2) + fallthrough + case 2: + return 4 + } + println() // ok +} + +var _ = func() int { + print(1) + switch x { + case 1: + print(2) + panic(3) + } + println() // ok +} + +var _ = func() int { + print(1) +L: + switch x { + case 1: + print(2) + panic(3) + break L // ERROR "unreachable code" + default: + return 4 + } + println() // ok +} + +var _ = func() int { + print(1) + switch x { + default: + return 4 + break // ERROR "unreachable code" + case 1: + print(2) + panic(3) + } + println() // ok +} + +var _ = func() int { + print(1) +L: + switch x { + case 1: + print(2) + for { + break L + } + default: + return 4 + } + println() // ok +} + +var _ = func() int { + print(1) + switch x.(type) { + case int: + print(2) + panic(3) + println() // ERROR "unreachable code" + default: + return 4 + println() // ERROR "unreachable code" + } +} + +var _ = func() int { + print(1) + switch x.(type) { + case int: + print(2) + panic(3) + default: + return 4 + } + println() // ERROR "unreachable code" +} + +var _ = func() int { + print(1) + switch x.(type) { + default: + return 4 + println() // ERROR "unreachable code" + case int: + print(2) + panic(3) + println() // ERROR "unreachable code" + } +} + +var _ = func() int { + print(1) + switch x.(type) { + default: + return 4 + case int: + print(2) + panic(3) + } + println() // ERROR "unreachable code" +} + +var _ = func() int { + print(1) + switch x.(type) { + case int: + print(2) + fallthrough + default: + return 4 + println() // ERROR "unreachable code" + } +} + +var _ = func() int { + print(1) + switch x.(type) { + case int: + print(2) + fallthrough + default: + return 4 + } + println() // ERROR "unreachable code" +} + +var _ = func() int { + print(1) + switch { + } + println() // ok +} + +var _ = func() int { + print(1) + switch x.(type) { + case int: + print(2) + panic(3) + case float64: + return 4 + } + println() // ok +} + +var _ = func() int { + print(1) + switch x.(type) { + case float64: + return 4 + case int: + print(2) + panic(3) + } + println() // ok +} + +var _ = func() int { + print(1) + switch x.(type) { + case int: + print(2) + fallthrough + case float64: + return 4 + } + println() // ok +} + +var _ = func() int { + print(1) + switch x.(type) { + case int: + print(2) + panic(3) + } + println() // ok +} + +var _ = func() int { + print(1) +L: + switch x.(type) { + case int: + print(2) + panic(3) + break L // ERROR "unreachable code" + default: + return 4 + } + println() // ok +} + +var _ = func() int { + print(1) + switch x.(type) { + default: + return 4 + break // ERROR "unreachable code" + case int: + print(2) + panic(3) + } + println() // ok +} + +var _ = func() int { + print(1) +L: + switch x.(type) { + case int: + print(2) + for { + break L + } + default: + return 4 + } + println() // ok +} + +// again, but without the leading print(1). +// testing that everything works when the terminating statement is first. + +var _ = func() int { + println() // ok +} + +var _ = func() int { + return 2 + println() // ERROR "unreachable code" +} + +var _ = func() int { +L: + goto L + println() // ERROR "unreachable code" +} + +var _ = func() int { + panic(2) + println() // ERROR "unreachable code" +} + +// but only builtin panic +var _ = func() int { + var panic = func(int) {} + panic(2) + println() // ok +} + +var _ = func() int { + { + return 2 + println() // ERROR "unreachable code" + } +} + +var _ = func() int { + { + return 2 + } + println() // ERROR "unreachable code" +} + +var _ = func() int { +L: + { + goto L + println() // ERROR "unreachable code" + } +} + +var _ = func() int { +L: + { + goto L + } + println() // ERROR "unreachable code" +} + +var _ = func() int { + { + panic(2) + println() // ERROR "unreachable code" + } +} + +var _ = func() int { + { + panic(2) + } + println() // ERROR "unreachable code" +} + +var _ = func() int { + return 2 + { // ERROR "unreachable code" + } + println() // ok +} + +var _ = func() int { +L: + goto L + { // ERROR "unreachable code" + } + println() // ok +} + +var _ = func() int { + panic(2) + { // ERROR "unreachable code" + } + println() // ok +} + +var _ = func() int { + { + return 2 + { // ERROR "unreachable code" + } + } + println() // ok +} + +var _ = func() int { +L: + { + goto L + { // ERROR "unreachable code" + } + } + println() // ok +} + +var _ = func() int { + { + panic(2) + { // ERROR "unreachable code" + } + } + println() // ok +} + +var _ = func() int { + { + return 2 + } + { // ERROR "unreachable code" + } + println() // ok +} + +var _ = func() int { +L: + { + goto L + } + { // ERROR "unreachable code" + } + println() // ok +} + +var _ = func() int { + { + panic(2) + } + { // ERROR "unreachable code" + } + println() // ok +} + +var _ = func() { + // goto without label used to panic + goto +} diff --git a/src/cmd/vet/testdata/method.go b/src/cmd/vet/testdata/method.go new file mode 100644 index 0000000000000000000000000000000000000000..52b500df272803645f904ae22e9323117bdc83e6 --- /dev/null +++ b/src/cmd/vet/testdata/method.go @@ -0,0 +1,22 @@ +// Copyright 2010 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// This file contains tests for the canonical method checker. + +// This file contains the code to check canonical methods. + +package testdata + +import ( + "fmt" +) + +type MethodTest int + +func (t *MethodTest) Scan(x fmt.ScanState, c byte) { // ERROR "should have signature Scan" +} + +type MethodTestInterface interface { + ReadByte() byte // ERROR "should have signature ReadByte" +} diff --git a/src/cmd/vet/testdata/nilfunc.go b/src/cmd/vet/testdata/nilfunc.go new file mode 100644 index 0000000000000000000000000000000000000000..2ce7bc8ca82eccc641e7d6879ac7dcdb02f5399d --- /dev/null +++ b/src/cmd/vet/testdata/nilfunc.go @@ -0,0 +1,35 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package testdata + +func F() {} + +type T struct { + F func() +} + +func (T) M() {} + +var Fv = F + +func Comparison() { + var t T + var fn func() + if fn == nil || Fv == nil || t.F == nil { + // no error; these func vars or fields may be nil + } + if F == nil { // ERROR "comparison of function F == nil is always false" + panic("can't happen") + } + if t.M == nil { // ERROR "comparison of function M == nil is always false" + panic("can't happen") + } + if F != nil { // ERROR "comparison of function F != nil is always true" + if t.M != nil { // ERROR "comparison of function M != nil is always true" + return + } + } + panic("can't happen") +} diff --git a/src/cmd/vet/testdata/print.go b/src/cmd/vet/testdata/print.go new file mode 100644 index 0000000000000000000000000000000000000000..3390a31f2c4328962214654af2f99edeab75aba6 --- /dev/null +++ b/src/cmd/vet/testdata/print.go @@ -0,0 +1,342 @@ +// Copyright 2010 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// This file contains tests for the printf checker. + +package testdata + +import ( + "fmt" + "math" + "os" + "unsafe" // just for test case printing unsafe.Pointer +) + +func UnsafePointerPrintfTest() { + var up unsafe.Pointer + fmt.Printf("%p, %x %X", up, up, up) +} + +// Error methods that do not satisfy the Error interface and should be checked. +type errorTest1 int + +func (errorTest1) Error(...interface{}) string { + return "hi" +} + +type errorTest2 int // Analogous to testing's *T type. +func (errorTest2) Error(...interface{}) { +} + +type errorTest3 int + +func (errorTest3) Error() { // No return value. +} + +type errorTest4 int + +func (errorTest4) Error() int { // Different return type. + return 3 +} + +type errorTest5 int + +func (errorTest5) error() { // niladic; don't complain if no args (was bug) +} + +// This function never executes, but it serves as a simple test for the program. +// Test with make test. +func PrintfTests() { + var b bool + var i int + var r rune + var s string + var x float64 + var p *int + var imap map[int]int + var fslice []float64 + var c complex64 + // Some good format/argtypes + fmt.Printf("") + fmt.Printf("%b %b %b", 3, i, x) + fmt.Printf("%c %c %c %c", 3, i, 'x', r) + fmt.Printf("%d %d %d", 3, i, imap) + fmt.Printf("%e %e %e %e", 3e9, x, fslice, c) + fmt.Printf("%E %E %E %E", 3e9, x, fslice, c) + fmt.Printf("%f %f %f %f", 3e9, x, fslice, c) + fmt.Printf("%F %F %F %F", 3e9, x, fslice, c) + fmt.Printf("%g %g %g %g", 3e9, x, fslice, c) + fmt.Printf("%G %G %G %G", 3e9, x, fslice, c) + fmt.Printf("%b %b %b %b", 3e9, x, fslice, c) + fmt.Printf("%o %o", 3, i) + fmt.Printf("%p %p", p, nil) + fmt.Printf("%q %q %q %q", 3, i, 'x', r) + fmt.Printf("%s %s %s", "hi", s, []byte{65}) + fmt.Printf("%t %t", true, b) + fmt.Printf("%T %T", 3, i) + fmt.Printf("%U %U", 3, i) + fmt.Printf("%v %v", 3, i) + fmt.Printf("%x %x %x %x", 3, i, "hi", s) + fmt.Printf("%X %X %X %X", 3, i, "hi", s) + fmt.Printf("%.*s %d %g", 3, "hi", 23, 2.3) + fmt.Printf("%s", &stringerv) + fmt.Printf("%v", &stringerv) + fmt.Printf("%T", &stringerv) + fmt.Printf("%v", notstringerv) + fmt.Printf("%T", notstringerv) + fmt.Printf("%q", stringerarrayv) + fmt.Printf("%v", stringerarrayv) + fmt.Printf("%s", stringerarrayv) + fmt.Printf("%v", notstringerarrayv) + fmt.Printf("%T", notstringerarrayv) + fmt.Printf("%d", new(Formatter)) + fmt.Printf("%*%", 2) // Ridiculous but allowed. + fmt.Printf("%s", interface{}(nil)) // Nothing useful we can say. + + fmt.Printf("%g", 1+2i) + // Some bad format/argTypes + fmt.Printf("%b", "hi") // ERROR "arg .hi. for printf verb %b of wrong type" + fmt.Printf("%t", c) // ERROR "arg c for printf verb %t of wrong type" + fmt.Printf("%t", 1+2i) // ERROR "arg 1 \+ 2i for printf verb %t of wrong type" + fmt.Printf("%c", 2.3) // ERROR "arg 2.3 for printf verb %c of wrong type" + fmt.Printf("%d", 2.3) // ERROR "arg 2.3 for printf verb %d of wrong type" + fmt.Printf("%e", "hi") // ERROR "arg .hi. for printf verb %e of wrong type" + fmt.Printf("%E", true) // ERROR "arg true for printf verb %E of wrong type" + fmt.Printf("%f", "hi") // ERROR "arg .hi. for printf verb %f of wrong type" + fmt.Printf("%F", 'x') // ERROR "arg 'x' for printf verb %F of wrong type" + fmt.Printf("%g", "hi") // ERROR "arg .hi. for printf verb %g of wrong type" + fmt.Printf("%g", imap) // ERROR "arg imap for printf verb %g of wrong type" + fmt.Printf("%G", i) // ERROR "arg i for printf verb %G of wrong type" + fmt.Printf("%o", x) // ERROR "arg x for printf verb %o of wrong type" + fmt.Printf("%p", 23) // ERROR "arg 23 for printf verb %p of wrong type" + fmt.Printf("%q", x) // ERROR "arg x for printf verb %q of wrong type" + fmt.Printf("%s", b) // ERROR "arg b for printf verb %s of wrong type" + fmt.Printf("%s", byte(65)) // ERROR "arg byte\(65\) for printf verb %s of wrong type" + fmt.Printf("%t", 23) // ERROR "arg 23 for printf verb %t of wrong type" + fmt.Printf("%U", x) // ERROR "arg x for printf verb %U of wrong type" + fmt.Printf("%x", nil) // ERROR "arg nil for printf verb %x of wrong type" + fmt.Printf("%X", 2.3) // ERROR "arg 2.3 for printf verb %X of wrong type" + fmt.Printf("%s", stringerv) // ERROR "arg stringerv for printf verb %s of wrong type" + fmt.Printf("%t", stringerv) // ERROR "arg stringerv for printf verb %t of wrong type" + fmt.Printf("%q", notstringerv) // ERROR "arg notstringerv for printf verb %q of wrong type" + fmt.Printf("%t", notstringerv) // ERROR "arg notstringerv for printf verb %t of wrong type" + fmt.Printf("%t", stringerarrayv) // ERROR "arg stringerarrayv for printf verb %t of wrong type" + fmt.Printf("%t", notstringerarrayv) // ERROR "arg notstringerarrayv for printf verb %t of wrong type" + fmt.Printf("%q", notstringerarrayv) // ERROR "arg notstringerarrayv for printf verb %q of wrong type" + fmt.Printf("%d", Formatter(true)) // correct (the type is responsible for formatting) + fmt.Printf("%s", nonemptyinterface) // correct (the dynamic type of nonemptyinterface may be a stringer) + fmt.Printf("%.*s %d %g", 3, "hi", 23, 'x') // ERROR "arg 'x' for printf verb %g of wrong type" + fmt.Println() // not an error + fmt.Println("%s", "hi") // ERROR "possible formatting directive in Println call" + fmt.Printf("%s", "hi", 3) // ERROR "wrong number of args for format in Printf call" + _ = fmt.Sprintf("%"+("s"), "hi", 3) // ERROR "wrong number of args for format in Sprintf call" + fmt.Printf("%s%%%d", "hi", 3) // correct + fmt.Printf("%08s", "woo") // correct + fmt.Printf("% 8s", "woo") // correct + fmt.Printf("%.*d", 3, 3) // correct + fmt.Printf("%.*d", 3, 3, 3, 3) // ERROR "wrong number of args for format in Printf call.*4 args" + fmt.Printf("%.*d", "hi", 3) // ERROR "arg .hi. for \* in printf format not of type int" + fmt.Printf("%.*d", i, 3) // correct + fmt.Printf("%.*d", s, 3) // ERROR "arg s for \* in printf format not of type int" + fmt.Printf("%*%", 0.22) // ERROR "arg 0.22 for \* in printf format not of type int" + fmt.Printf("%q %q", multi()...) // ok + fmt.Printf("%#q", `blah`) // ok + printf("now is the time", "buddy") // ERROR "no formatting directive" + Printf("now is the time", "buddy") // ERROR "no formatting directive" + Printf("hi") // ok + const format = "%s %s\n" + Printf(format, "hi", "there") + Printf(format, "hi") // ERROR "missing argument for Printf..%s..: format reads arg 2, have only 1" + Printf("%s %d %.3v %q", "str", 4) // ERROR "missing argument for Printf..%.3v..: format reads arg 3, have only 2" + f := new(stringer) + f.Warn(0, "%s", "hello", 3) // ERROR "possible formatting directive in Warn call" + f.Warnf(0, "%s", "hello", 3) // ERROR "wrong number of args for format in Warnf call" + f.Warnf(0, "%r", "hello") // ERROR "unrecognized printf verb" + f.Warnf(0, "%#s", "hello") // ERROR "unrecognized printf flag" + Printf("d%", 2) // ERROR "missing verb at end of format string in Printf call" + Printf("%d", percentDV) + Printf("%d", &percentDV) + Printf("%d", notPercentDV) // ERROR "arg notPercentDV for printf verb %d of wrong type" + Printf("%d", ¬PercentDV) // ERROR "arg ¬PercentDV for printf verb %d of wrong type" + Printf("%p", ¬PercentDV) // Works regardless: we print it as a pointer. + Printf("%s", percentSV) + Printf("%s", &percentSV) + // Good argument reorderings. + Printf("%[1]d", 3) + Printf("%[1]*d", 3, 1) + Printf("%[2]*[1]d", 1, 3) + Printf("%[2]*.[1]*[3]d", 2, 3, 4) + fmt.Fprintf(os.Stderr, "%[2]*.[1]*[3]d", 2, 3, 4) // Use Fprintf to make sure we count arguments correctly. + // Bad argument reorderings. + Printf("%[xd", 3) // ERROR "illegal syntax for printf argument index" + Printf("%[x]d", 3) // ERROR "illegal syntax for printf argument index" + Printf("%[3]*s", "hi", 2) // ERROR "missing argument for Printf.* reads arg 3, have only 2" + _ = fmt.Sprintf("%[3]d", 2) // ERROR "missing argument for Sprintf.* reads arg 3, have only 1" + Printf("%[2]*.[1]*[3]d", 2, "hi", 4) // ERROR "arg .hi. for \* in printf format not of type int" + Printf("%[0]s", "arg1") // ERROR "index value \[0\] for Printf.*; indexes start at 1" + Printf("%[0]d", 1) // ERROR "index value \[0\] for Printf.*; indexes start at 1" + // Something that satisfies the error interface. + var e error + fmt.Println(e.Error()) // ok + // Something that looks like an error interface but isn't, such as the (*T).Error method + // in the testing package. + var et1 errorTest1 + fmt.Println(et1.Error()) // ERROR "no args in Error call" + fmt.Println(et1.Error("hi")) // ok + fmt.Println(et1.Error("%d", 3)) // ERROR "possible formatting directive in Error call" + var et2 errorTest2 + et2.Error() // ERROR "no args in Error call" + et2.Error("hi") // ok, not an error method. + et2.Error("%d", 3) // ERROR "possible formatting directive in Error call" + var et3 errorTest3 + et3.Error() // ok, not an error method. + var et4 errorTest4 + et4.Error() // ok, not an error method. + var et5 errorTest5 + et5.error() // ok, not an error method. + // Bug: used to recur forever. + Printf("%p %x", recursiveStructV, recursiveStructV.next) + Printf("%p %x", recursiveStruct1V, recursiveStruct1V.next) + Printf("%p %x", recursiveSliceV, recursiveSliceV) + Printf("%p %x", recursiveMapV, recursiveMapV) + // Special handling for Log. + math.Log(3) // OK + Log(3) // OK + Log("%d", 3) // ERROR "possible formatting directive in Log call" + Logf("%d", 3) + Logf("%d", "hi") // ERROR "arg .hi. for printf verb %d of wrong type: untyped string" + +} + +// Printf is used by the test so we must declare it. +func Printf(format string, args ...interface{}) { + panic("don't call - testing only") +} + +// printf is used by the test so we must declare it. +func printf(format string, args ...interface{}) { + panic("don't call - testing only") +} + +// multi is used by the test. +func multi() []interface{} { + panic("don't call - testing only") +} + +type stringer float64 + +var stringerv stringer + +func (*stringer) String() string { + return "string" +} + +func (*stringer) Warn(int, ...interface{}) string { + return "warn" +} + +func (*stringer) Warnf(int, string, ...interface{}) string { + return "warnf" +} + +type notstringer struct { + f float64 +} + +var notstringerv notstringer + +type stringerarray [4]float64 + +func (stringerarray) String() string { + return "string" +} + +var stringerarrayv stringerarray + +type notstringerarray [4]float64 + +var notstringerarrayv notstringerarray + +var nonemptyinterface = interface { + f() +}(nil) + +// A data type we can print with "%d". +type percentDStruct struct { + a int + b []byte + c *float64 +} + +var percentDV percentDStruct + +// A data type we cannot print correctly with "%d". +type notPercentDStruct struct { + a int + b []byte + c bool +} + +var notPercentDV notPercentDStruct + +// A data type we can print with "%s". +type percentSStruct struct { + a string + b []byte + c stringerarray +} + +var percentSV percentSStruct + +type recursiveStringer int + +func (s recursiveStringer) String() string { + _ = fmt.Sprintf("%d", s) + _ = fmt.Sprintf("%#v", s) + _ = fmt.Sprintf("%v", s) // ERROR "arg s for printf causes recursive call to String method" + _ = fmt.Sprintf("%v", &s) // ERROR "arg &s for printf causes recursive call to String method" + _ = fmt.Sprintf("%T", s) // ok; does not recursively call String + return fmt.Sprintln(s) // ERROR "arg s for print causes recursive call to String method" +} + +type recursivePtrStringer int + +func (p *recursivePtrStringer) String() string { + _ = fmt.Sprintf("%v", *p) + return fmt.Sprintln(p) // ERROR "arg p for print causes recursive call to String method" +} + +type Formatter bool + +func (*Formatter) Format(fmt.State, rune) { +} + +type RecursiveSlice []RecursiveSlice + +var recursiveSliceV = &RecursiveSlice{} + +type RecursiveMap map[int]RecursiveMap + +var recursiveMapV = make(RecursiveMap) + +type RecursiveStruct struct { + next *RecursiveStruct +} + +var recursiveStructV = &RecursiveStruct{} + +type RecursiveStruct1 struct { + next *Recursive2Struct +} + +type RecursiveStruct2 struct { + next *Recursive1Struct +} + +var recursiveStruct1V = &RecursiveStruct1{} + +// Fix for issue 7149: Missing return type on String method caused fault. +func (int) String() { + return "" +} diff --git a/src/cmd/vet/testdata/rangeloop.go b/src/cmd/vet/testdata/rangeloop.go new file mode 100644 index 0000000000000000000000000000000000000000..37b5940ddd2137e94259d7736c0df52ab6c4e070 --- /dev/null +++ b/src/cmd/vet/testdata/rangeloop.go @@ -0,0 +1,59 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// This file contains tests for the rangeloop checker. + +package testdata + +func RangeLoopTests() { + var s []int + for i, v := range s { + go func() { + println(i) // ERROR "range variable i captured by func literal" + println(v) // ERROR "range variable v captured by func literal" + }() + } + for i, v := range s { + defer func() { + println(i) // ERROR "range variable i captured by func literal" + println(v) // ERROR "range variable v captured by func literal" + }() + } + for i := range s { + go func() { + println(i) // ERROR "range variable i captured by func literal" + }() + } + for _, v := range s { + go func() { + println(v) // ERROR "range variable v captured by func literal" + }() + } + for i, v := range s { + go func() { + println(i, v) + }() + println("unfortunately, we don't catch the error above because of this statement") + } + for i, v := range s { + go func(i, v int) { + println(i, v) + }(i, v) + } + for i, v := range s { + i, v := i, v + go func() { + println(i, v) + }() + } + // If the key of the range statement is not an identifier + // the code should not panic (it used to). + var x [2]int + var f int + for x[0], f = range s { + go func() { + _ = f // ERROR "range variable f captured by func literal" + }() + } +} diff --git a/src/cmd/vet/testdata/shadow.go b/src/cmd/vet/testdata/shadow.go new file mode 100644 index 0000000000000000000000000000000000000000..34a680681be337baa4ab0aa4e96e1338e820c33f --- /dev/null +++ b/src/cmd/vet/testdata/shadow.go @@ -0,0 +1,54 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// This file contains tests for the shadowed variable checker. +// Some of these errors are caught by the compiler (shadowed return parameters for example) +// but are nonetheless useful tests. + +package testdata + +import "os" + +func ShadowRead(f *os.File, buf []byte) (err error) { + var x int + if f != nil { + err := 3 // OK - different type. + _ = err + } + if f != nil { + _, err := f.Read(buf) // ERROR "declaration of err shadows declaration at testdata/shadow.go:13" + if err != nil { + return err + } + i := 3 // OK + _ = i + } + if f != nil { + var _, err = f.Read(buf) // ERROR "declaration of err shadows declaration at testdata/shadow.go:13" + if err != nil { + return err + } + } + for i := 0; i < 10; i++ { + i := i // OK: obviously intentional idiomatic redeclaration + go func() { + println(i) + }() + } + var shadowTemp interface{} + switch shadowTemp := shadowTemp.(type) { // OK: obviously intentional idiomatic redeclaration + case int: + println("OK") + _ = shadowTemp + } + if shadowTemp := shadowTemp; true { // OK: obviously intentional idiomatic redeclaration + var f *os.File // OK because f is not mentioned later in the function. + // The declaration of x is a shadow because x is mentioned below. + var x int // ERROR "declaration of x shadows declaration at testdata/shadow.go:14" + _, _, _ = x, f, shadowTemp + } + // Use a couple of variables to trigger shadowing errors. + _, _ = err, x + return +} diff --git a/src/cmd/vet/testdata/shift.go b/src/cmd/vet/testdata/shift.go new file mode 100644 index 0000000000000000000000000000000000000000..6624f09cc1617bd19a4991104f945a28428574bc --- /dev/null +++ b/src/cmd/vet/testdata/shift.go @@ -0,0 +1,78 @@ +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// This file contains tests for the suspicious shift checker. + +package testdata + +func ShiftTest() { + var i8 int8 + _ = i8 << 7 + _ = (i8 + 1) << 8 // ERROR "\(i8 \+ 1\) too small for shift of 8" + _ = i8 << (7 + 1) // ERROR "i8 too small for shift of 8" + _ = i8 >> 8 // ERROR "i8 too small for shift of 8" + i8 <<= 8 // ERROR "i8 too small for shift of 8" + i8 >>= 8 // ERROR "i8 too small for shift of 8" + var i16 int16 + _ = i16 << 15 + _ = i16 << 16 // ERROR "i16 too small for shift of 16" + _ = i16 >> 16 // ERROR "i16 too small for shift of 16" + i16 <<= 16 // ERROR "i16 too small for shift of 16" + i16 >>= 16 // ERROR "i16 too small for shift of 16" + var i32 int32 + _ = i32 << 31 + _ = i32 << 32 // ERROR "i32 too small for shift of 32" + _ = i32 >> 32 // ERROR "i32 too small for shift of 32" + i32 <<= 32 // ERROR "i32 too small for shift of 32" + i32 >>= 32 // ERROR "i32 too small for shift of 32" + var i64 int64 + _ = i64 << 63 + _ = i64 << 64 // ERROR "i64 too small for shift of 64" + _ = i64 >> 64 // ERROR "i64 too small for shift of 64" + i64 <<= 64 // ERROR "i64 too small for shift of 64" + i64 >>= 64 // ERROR "i64 too small for shift of 64" + var u8 uint8 + _ = u8 << 7 + _ = u8 << 8 // ERROR "u8 too small for shift of 8" + _ = u8 >> 8 // ERROR "u8 too small for shift of 8" + u8 <<= 8 // ERROR "u8 too small for shift of 8" + u8 >>= 8 // ERROR "u8 too small for shift of 8" + var u16 uint16 + _ = u16 << 15 + _ = u16 << 16 // ERROR "u16 too small for shift of 16" + _ = u16 >> 16 // ERROR "u16 too small for shift of 16" + u16 <<= 16 // ERROR "u16 too small for shift of 16" + u16 >>= 16 // ERROR "u16 too small for shift of 16" + var u32 uint32 + _ = u32 << 31 + _ = u32 << 32 // ERROR "u32 too small for shift of 32" + _ = u32 >> 32 // ERROR "u32 too small for shift of 32" + u32 <<= 32 // ERROR "u32 too small for shift of 32" + u32 >>= 32 // ERROR "u32 too small for shift of 32" + var u64 uint64 + _ = u64 << 63 + _ = u64 << 64 // ERROR "u64 too small for shift of 64" + _ = u64 >> 64 // ERROR "u64 too small for shift of 64" + u64 <<= 64 // ERROR "u64 too small for shift of 64" + u64 >>= 64 // ERROR "u64 too small for shift of 64" + _ = u64 << u64 // Non-constant shifts should succeed. + var i int + _ = i << 31 + _ = i << 32 // ERROR "i might be too small for shift of 32" + _ = i >> 32 // ERROR "i might be too small for shift of 32" + i <<= 32 // ERROR "i might be too small for shift of 32" + i >>= 32 // ERROR "i might be too small for shift of 32" + var u uint + _ = u << 31 + _ = u << 32 // ERROR "u might be too small for shift of 32" + _ = u >> 32 // ERROR "u might be too small for shift of 32" + u <<= 32 // ERROR "u might be too small for shift of 32" + u >>= 32 // ERROR "u might be too small for shift of 32" + var p uintptr + _ = p << 31 + _ = p << 32 // ERROR "p might be too small for shift of 32" + _ = p >> 32 // ERROR "p might be too small for shift of 32" + p <<= 32 // ERROR "p might be too small for shift of 32" + p >>= 32 // ERROR "p might be too small for shift of 32" +} diff --git a/src/cmd/vet/testdata/structtag.go b/src/cmd/vet/testdata/structtag.go new file mode 100644 index 0000000000000000000000000000000000000000..6878f5642d9a920fdfd482c8b7936df485061ab5 --- /dev/null +++ b/src/cmd/vet/testdata/structtag.go @@ -0,0 +1,36 @@ +// Copyright 2010 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// This file contains the test for canonical struct tags. + +package testdata + +type StructTagTest struct { + A int "hello" // ERROR "not compatible with reflect.StructTag.Get: bad syntax for struct tag pair" + B int "\tx:\"y\"" // ERROR "not compatible with reflect.StructTag.Get: bad syntax for struct tag key" + C int "x:\"y\"\tx:\"y\"" // ERROR "not compatible with reflect.StructTag.Get" + D int "x:`y`" // ERROR "not compatible with reflect.StructTag.Get: bad syntax for struct tag value" + E int "ct\brl:\"char\"" // ERROR "not compatible with reflect.StructTag.Get: bad syntax for struct tag pair" + F int `:"emptykey"` // ERROR "not compatible with reflect.StructTag.Get: bad syntax for struct tag key" + G int `x:"noEndQuote` // ERROR "not compatible with reflect.StructTag.Get: bad syntax for struct tag value" + H int `x:"trunc\x0"` // ERROR "not compatible with reflect.StructTag.Get: bad syntax for struct tag value" + OK0 int `x:"y" u:"v" w:""` + OK1 int `x:"y:z" u:"v" w:""` // note multiple colons. + OK2 int "k0:\"values contain spaces\" k1:\"literal\ttabs\" k2:\"and\\tescaped\\tabs\"" + OK3 int `under_scores:"and" CAPS:"ARE_OK"` +} + +type UnexportedEncodingTagTest struct { + x int `json:"xx"` // ERROR "struct field x has json tag but is not exported" + y int `xml:"yy"` // ERROR "struct field y has xml tag but is not exported" + z int + A int `json:"aa" xml:"bb"` +} + +type unexp struct{} + +type JSONEmbeddedField struct { + UnexportedEncodingTagTest `is:"embedded"` + unexp `is:"embedded,notexported" json:"unexp"` // OK for now, see issue 7363 +} diff --git a/src/cmd/vet/testdata/tagtest/file1.go b/src/cmd/vet/testdata/tagtest/file1.go new file mode 100644 index 0000000000000000000000000000000000000000..22a1509acc0bc6d92cf0d1757f6e3fc0b636d416 --- /dev/null +++ b/src/cmd/vet/testdata/tagtest/file1.go @@ -0,0 +1,10 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build testtag + +package main + +func main() { +} diff --git a/src/cmd/vet/testdata/tagtest/file2.go b/src/cmd/vet/testdata/tagtest/file2.go new file mode 100644 index 0000000000000000000000000000000000000000..ba7dd91bbd89c8e2936765f07d05bba3b8e7adef --- /dev/null +++ b/src/cmd/vet/testdata/tagtest/file2.go @@ -0,0 +1,10 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build !testtag + +package main + +func ignore() { +} diff --git a/src/cmd/vet/testdata/unsafeptr.go b/src/cmd/vet/testdata/unsafeptr.go new file mode 100644 index 0000000000000000000000000000000000000000..8f64030b85689b75edbd9fd826cadb1d65308dd8 --- /dev/null +++ b/src/cmd/vet/testdata/unsafeptr.go @@ -0,0 +1,61 @@ +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package testdata + +import ( + "reflect" + "unsafe" +) + +func f() { + var x unsafe.Pointer + var y uintptr + x = unsafe.Pointer(y) // ERROR "possible misuse of unsafe.Pointer" + y = uintptr(x) + + // only allowed pointer arithmetic is ptr +/- num. + // num+ptr is technically okay but still flagged: write ptr+num instead. + x = unsafe.Pointer(uintptr(x) + 1) + x = unsafe.Pointer(1 + uintptr(x)) // ERROR "possible misuse of unsafe.Pointer" + x = unsafe.Pointer(uintptr(x) + uintptr(x)) // ERROR "possible misuse of unsafe.Pointer" + x = unsafe.Pointer(uintptr(x) - 1) + x = unsafe.Pointer(1 - uintptr(x)) // ERROR "possible misuse of unsafe.Pointer" + + // certain uses of reflect are okay + var v reflect.Value + x = unsafe.Pointer(v.Pointer()) + x = unsafe.Pointer(v.UnsafeAddr()) + var s1 *reflect.StringHeader + x = unsafe.Pointer(s1.Data) + var s2 *reflect.SliceHeader + x = unsafe.Pointer(s2.Data) + var s3 reflect.StringHeader + x = unsafe.Pointer(s3.Data) // ERROR "possible misuse of unsafe.Pointer" + var s4 reflect.SliceHeader + x = unsafe.Pointer(s4.Data) // ERROR "possible misuse of unsafe.Pointer" + + // but only in reflect + var vv V + x = unsafe.Pointer(vv.Pointer()) // ERROR "possible misuse of unsafe.Pointer" + x = unsafe.Pointer(vv.UnsafeAddr()) // ERROR "possible misuse of unsafe.Pointer" + var ss1 *StringHeader + x = unsafe.Pointer(ss1.Data) // ERROR "possible misuse of unsafe.Pointer" + var ss2 *SliceHeader + x = unsafe.Pointer(ss2.Data) // ERROR "possible misuse of unsafe.Pointer" + +} + +type V interface { + Pointer() uintptr + UnsafeAddr() uintptr +} + +type StringHeader struct { + Data uintptr +} + +type SliceHeader struct { + Data uintptr +} diff --git a/src/cmd/vet/testdata/unused.go b/src/cmd/vet/testdata/unused.go new file mode 100644 index 0000000000000000000000000000000000000000..d50f6594d9b464e340b35af78406d5e4d933c54d --- /dev/null +++ b/src/cmd/vet/testdata/unused.go @@ -0,0 +1,29 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// This file contains tests for the unusedresult checker. + +package testdata + +import ( + "bytes" + "errors" + "fmt" +) + +func _() { + fmt.Errorf("") // ERROR "result of fmt.Errorf call not used" + _ = fmt.Errorf("") + + errors.New("") // ERROR "result of errors.New call not used" + + err := errors.New("") + err.Error() // ERROR "result of \(error\).Error call not used" + + var buf bytes.Buffer + buf.String() // ERROR "result of \(bytes.Buffer\).String call not used" + + fmt.Sprint("") // ERROR "result of fmt.Sprint call not used" + fmt.Sprintf("") // ERROR "result of fmt.Sprintf call not used" +} diff --git a/src/cmd/vet/types.go b/src/cmd/vet/types.go new file mode 100644 index 0000000000000000000000000000000000000000..692bae61927e282fe478cbc1998273ca7a697709 --- /dev/null +++ b/src/cmd/vet/types.go @@ -0,0 +1,370 @@ +// Copyright 2010 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// This file contains the pieces of the tool that use typechecking from the go/types package. + +package main + +import ( + "go/ast" + "go/importer" + "go/token" + "go/types" +) + +// stdImporter is the importer we use to import packages. +// It is created during initialization so that all packages +// are imported by the same importer. +var stdImporter = importer.Default() + +var ( + errorType *types.Interface + stringerType *types.Interface // possibly nil + formatterType *types.Interface // possibly nil +) + +func init() { + errorType = types.Universe.Lookup("error").Type().Underlying().(*types.Interface) + + if typ := importType("fmt", "Stringer"); typ != nil { + stringerType = typ.Underlying().(*types.Interface) + } + + if typ := importType("fmt", "Formatter"); typ != nil { + formatterType = typ.Underlying().(*types.Interface) + } +} + +// importType returns the type denoted by the qualified identifier +// path.name, and adds the respective package to the imports map +// as a side effect. In case of an error, importType returns nil. +func importType(path, name string) types.Type { + pkg, err := stdImporter.Import(path) + if err != nil { + // This can happen if the package at path hasn't been compiled yet. + warnf("import failed: %v", err) + return nil + } + if obj, ok := pkg.Scope().Lookup(name).(*types.TypeName); ok { + return obj.Type() + } + warnf("invalid type name %q", name) + return nil +} + +func (pkg *Package) check(fs *token.FileSet, astFiles []*ast.File) error { + pkg.defs = make(map[*ast.Ident]types.Object) + pkg.uses = make(map[*ast.Ident]types.Object) + pkg.selectors = make(map[*ast.SelectorExpr]*types.Selection) + pkg.spans = make(map[types.Object]Span) + pkg.types = make(map[ast.Expr]types.TypeAndValue) + config := types.Config{ + // We use the same importer for all imports to ensure that + // everybody sees identical packages for the given paths. + Importer: stdImporter, + // By providing a Config with our own error function, it will continue + // past the first error. There is no need for that function to do anything. + Error: func(error) {}, + } + info := &types.Info{ + Selections: pkg.selectors, + Types: pkg.types, + Defs: pkg.defs, + Uses: pkg.uses, + } + typesPkg, err := config.Check(pkg.path, fs, astFiles, info) + pkg.typesPkg = typesPkg + // update spans + for id, obj := range pkg.defs { + pkg.growSpan(id, obj) + } + for id, obj := range pkg.uses { + pkg.growSpan(id, obj) + } + return err +} + +// isStruct reports whether the composite literal c is a struct. +// If it is not (probably a struct), it returns a printable form of the type. +func (pkg *Package) isStruct(c *ast.CompositeLit) (bool, string) { + // Check that the CompositeLit's type is a slice or array (which needs no field keys), if possible. + typ := pkg.types[c].Type + // If it's a named type, pull out the underlying type. If it's not, the Underlying + // method returns the type itself. + actual := typ + if actual != nil { + actual = actual.Underlying() + } + if actual == nil { + // No type information available. Assume true, so we do the check. + return true, "" + } + switch actual.(type) { + case *types.Struct: + return true, typ.String() + default: + return false, "" + } +} + +// matchArgType reports an error if printf verb t is not appropriate +// for operand arg. +// +// typ is used only for recursive calls; external callers must supply nil. +// +// (Recursion arises from the compound types {map,chan,slice} which +// may be printed with %d etc. if that is appropriate for their element +// types.) +func (f *File) matchArgType(t printfArgType, typ types.Type, arg ast.Expr) bool { + return f.matchArgTypeInternal(t, typ, arg, make(map[types.Type]bool)) +} + +// matchArgTypeInternal is the internal version of matchArgType. It carries a map +// remembering what types are in progress so we don't recur when faced with recursive +// types or mutually recursive types. +func (f *File) matchArgTypeInternal(t printfArgType, typ types.Type, arg ast.Expr, inProgress map[types.Type]bool) bool { + // %v, %T accept any argument type. + if t == anyType { + return true + } + if typ == nil { + // external call + typ = f.pkg.types[arg].Type + if typ == nil { + return true // probably a type check problem + } + } + // If the type implements fmt.Formatter, we have nothing to check. + // formatterTyp may be nil - be conservative and check for Format method in that case. + if formatterType != nil && types.Implements(typ, formatterType) || f.hasMethod(typ, "Format") { + return true + } + // If we can use a string, might arg (dynamically) implement the Stringer or Error interface? + if t&argString != 0 { + if types.AssertableTo(errorType, typ) || stringerType != nil && types.AssertableTo(stringerType, typ) { + return true + } + } + + typ = typ.Underlying() + if inProgress[typ] { + // We're already looking at this type. The call that started it will take care of it. + return true + } + inProgress[typ] = true + + switch typ := typ.(type) { + case *types.Signature: + return t&argPointer != 0 + + case *types.Map: + // Recur: map[int]int matches %d. + return t&argPointer != 0 || + (f.matchArgTypeInternal(t, typ.Key(), arg, inProgress) && f.matchArgTypeInternal(t, typ.Elem(), arg, inProgress)) + + case *types.Chan: + return t&argPointer != 0 + + case *types.Array: + // Same as slice. + if types.Identical(typ.Elem().Underlying(), types.Typ[types.Byte]) && t&argString != 0 { + return true // %s matches []byte + } + // Recur: []int matches %d. + return t&argPointer != 0 || f.matchArgTypeInternal(t, typ.Elem().Underlying(), arg, inProgress) + + case *types.Slice: + // Same as array. + if types.Identical(typ.Elem().Underlying(), types.Typ[types.Byte]) && t&argString != 0 { + return true // %s matches []byte + } + // Recur: []int matches %d. But watch out for + // type T []T + // If the element is a pointer type (type T[]*T), it's handled fine by the Pointer case below. + return t&argPointer != 0 || f.matchArgTypeInternal(t, typ.Elem(), arg, inProgress) + + case *types.Pointer: + // Ugly, but dealing with an edge case: a known pointer to an invalid type, + // probably something from a failed import. + if typ.Elem().String() == "invalid type" { + if *verbose { + f.Warnf(arg.Pos(), "printf argument %v is pointer to invalid or unknown type", f.gofmt(arg)) + } + return true // special case + } + // If it's actually a pointer with %p, it prints as one. + if t == argPointer { + return true + } + // If it's pointer to struct, that's equivalent in our analysis to whether we can print the struct. + if str, ok := typ.Elem().Underlying().(*types.Struct); ok { + return f.matchStructArgType(t, str, arg, inProgress) + } + // The rest can print with %p as pointers, or as integers with %x etc. + return t&(argInt|argPointer) != 0 + + case *types.Struct: + return f.matchStructArgType(t, typ, arg, inProgress) + + case *types.Interface: + // If the static type of the argument is empty interface, there's little we can do. + // Example: + // func f(x interface{}) { fmt.Printf("%s", x) } + // Whether x is valid for %s depends on the type of the argument to f. One day + // we will be able to do better. For now, we assume that empty interface is OK + // but non-empty interfaces, with Stringer and Error handled above, are errors. + return typ.NumMethods() == 0 + + case *types.Basic: + switch typ.Kind() { + case types.UntypedBool, + types.Bool: + return t&argBool != 0 + + case types.UntypedInt, + types.Int, + types.Int8, + types.Int16, + types.Int32, + types.Int64, + types.Uint, + types.Uint8, + types.Uint16, + types.Uint32, + types.Uint64, + types.Uintptr: + return t&argInt != 0 + + case types.UntypedFloat, + types.Float32, + types.Float64: + return t&argFloat != 0 + + case types.UntypedComplex, + types.Complex64, + types.Complex128: + return t&argComplex != 0 + + case types.UntypedString, + types.String: + return t&argString != 0 + + case types.UnsafePointer: + return t&(argPointer|argInt) != 0 + + case types.UntypedRune: + return t&(argInt|argRune) != 0 + + case types.UntypedNil: + return t&argPointer != 0 // TODO? + + case types.Invalid: + if *verbose { + f.Warnf(arg.Pos(), "printf argument %v has invalid or unknown type", f.gofmt(arg)) + } + return true // Probably a type check problem. + } + panic("unreachable") + } + + return false +} + +// hasBasicType reports whether x's type is a types.Basic with the given kind. +func (f *File) hasBasicType(x ast.Expr, kind types.BasicKind) bool { + t := f.pkg.types[x].Type + if t != nil { + t = t.Underlying() + } + b, ok := t.(*types.Basic) + return ok && b.Kind() == kind +} + +// matchStructArgType reports whether all the elements of the struct match the expected +// type. For instance, with "%d" all the elements must be printable with the "%d" format. +func (f *File) matchStructArgType(t printfArgType, typ *types.Struct, arg ast.Expr, inProgress map[types.Type]bool) bool { + for i := 0; i < typ.NumFields(); i++ { + if !f.matchArgTypeInternal(t, typ.Field(i).Type(), arg, inProgress) { + return false + } + } + return true +} + +// numArgsInSignature tells how many formal arguments the function type +// being called has. +func (f *File) numArgsInSignature(call *ast.CallExpr) int { + // Check the type of the function or method declaration + typ := f.pkg.types[call.Fun].Type + if typ == nil { + return 0 + } + // The type must be a signature, but be sure for safety. + sig, ok := typ.(*types.Signature) + if !ok { + return 0 + } + return sig.Params().Len() +} + +// isErrorMethodCall reports whether the call is of a method with signature +// func Error() string +// where "string" is the universe's string type. We know the method is called "Error". +func (f *File) isErrorMethodCall(call *ast.CallExpr) bool { + typ := f.pkg.types[call].Type + if typ != nil { + // We know it's called "Error", so just check the function signature + // (stringerType has exactly one method, String). + if stringerType != nil && stringerType.NumMethods() == 1 { + return types.Identical(f.pkg.types[call.Fun].Type, stringerType.Method(0).Type()) + } + } + // Without types, we can still check by hand. + // Is it a selector expression? Otherwise it's a function call, not a method call. + sel, ok := call.Fun.(*ast.SelectorExpr) + if !ok { + return false + } + // The package is type-checked, so if there are no arguments, we're done. + if len(call.Args) > 0 { + return false + } + // Check the type of the method declaration + typ = f.pkg.types[sel].Type + if typ == nil { + return false + } + // The type must be a signature, but be sure for safety. + sig, ok := typ.(*types.Signature) + if !ok { + return false + } + // There must be a receiver for it to be a method call. Otherwise it is + // a function, not something that satisfies the error interface. + if sig.Recv() == nil { + return false + } + // There must be no arguments. Already verified by type checking, but be thorough. + if sig.Params().Len() > 0 { + return false + } + // Finally the real questions. + // There must be one result. + if sig.Results().Len() != 1 { + return false + } + // It must have return type "string" from the universe. + return sig.Results().At(0).Type() == types.Typ[types.String] +} + +// hasMethod reports whether the type contains a method with the given name. +// It is part of the workaround for Formatters and should be deleted when +// that workaround is no longer necessary. +// TODO: This could be better once issue 6259 is fixed. +func (f *File) hasMethod(typ types.Type, name string) bool { + // assume we have an addressable variable of type typ + obj, _, _ := types.LookupFieldOrMethod(typ, true, f.pkg.typesPkg, name) + _, ok := obj.(*types.Func) + return ok +} diff --git a/src/cmd/vet/unsafeptr.go b/src/cmd/vet/unsafeptr.go new file mode 100644 index 0000000000000000000000000000000000000000..9ca27dce0e5c8d36d5c3a07634c1028d3e18eb58 --- /dev/null +++ b/src/cmd/vet/unsafeptr.go @@ -0,0 +1,97 @@ +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Check for invalid uintptr -> unsafe.Pointer conversions. + +package main + +import ( + "go/ast" + "go/token" + "go/types" +) + +func init() { + register("unsafeptr", + "check for misuse of unsafe.Pointer", + checkUnsafePointer, + callExpr) +} + +func checkUnsafePointer(f *File, node ast.Node) { + x := node.(*ast.CallExpr) + if len(x.Args) != 1 { + return + } + if f.hasBasicType(x.Fun, types.UnsafePointer) && f.hasBasicType(x.Args[0], types.Uintptr) && !f.isSafeUintptr(x.Args[0]) { + f.Badf(x.Pos(), "possible misuse of unsafe.Pointer") + } +} + +// isSafeUintptr reports whether x - already known to be a uintptr - +// is safe to convert to unsafe.Pointer. It is safe if x is itself derived +// directly from an unsafe.Pointer via conversion and pointer arithmetic +// or if x is the result of reflect.Value.Pointer or reflect.Value.UnsafeAddr +// or obtained from the Data field of a *reflect.SliceHeader or *reflect.StringHeader. +func (f *File) isSafeUintptr(x ast.Expr) bool { + switch x := x.(type) { + case *ast.ParenExpr: + return f.isSafeUintptr(x.X) + + case *ast.SelectorExpr: + switch x.Sel.Name { + case "Data": + // reflect.SliceHeader and reflect.StringHeader are okay, + // but only if they are pointing at a real slice or string. + // It's not okay to do: + // var x SliceHeader + // x.Data = uintptr(unsafe.Pointer(...)) + // ... use x ... + // p := unsafe.Pointer(x.Data) + // because in the middle the garbage collector doesn't + // see x.Data as a pointer and so x.Data may be dangling + // by the time we get to the conversion at the end. + // For now approximate by saying that *Header is okay + // but Header is not. + pt, ok := f.pkg.types[x.X].Type.(*types.Pointer) + if ok { + t, ok := pt.Elem().(*types.Named) + if ok && t.Obj().Pkg().Path() == "reflect" { + switch t.Obj().Name() { + case "StringHeader", "SliceHeader": + return true + } + } + } + } + + case *ast.CallExpr: + switch len(x.Args) { + case 0: + // maybe call to reflect.Value.Pointer or reflect.Value.UnsafeAddr. + sel, ok := x.Fun.(*ast.SelectorExpr) + if !ok { + break + } + switch sel.Sel.Name { + case "Pointer", "UnsafeAddr": + t, ok := f.pkg.types[sel.X].Type.(*types.Named) + if ok && t.Obj().Pkg().Path() == "reflect" && t.Obj().Name() == "Value" { + return true + } + } + + case 1: + // maybe conversion of uintptr to unsafe.Pointer + return f.hasBasicType(x.Fun, types.Uintptr) && f.hasBasicType(x.Args[0], types.UnsafePointer) + } + + case *ast.BinaryExpr: + switch x.Op { + case token.ADD, token.SUB: + return f.isSafeUintptr(x.X) && !f.isSafeUintptr(x.Y) + } + } + return false +} diff --git a/src/cmd/vet/unused.go b/src/cmd/vet/unused.go new file mode 100644 index 0000000000000000000000000000000000000000..df2317a4365f6eb7120af02fda61a342db4b9f87 --- /dev/null +++ b/src/cmd/vet/unused.go @@ -0,0 +1,93 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// This file defines the check for unused results of calls to certain +// pure functions. + +package main + +import ( + "flag" + "go/ast" + "go/token" + "go/types" + "strings" +) + +var unusedFuncsFlag = flag.String("unusedfuncs", + "errors.New,fmt.Errorf,fmt.Sprintf,fmt.Sprint,sort.Reverse", + "comma-separated list of functions whose results must be used") + +var unusedStringMethodsFlag = flag.String("unusedstringmethods", + "Error,String", + "comma-separated list of names of methods of type func() string whose results must be used") + +func init() { + register("unusedresult", + "check for unused result of calls to functions in -unusedfuncs list and methods in -unusedstringmethods list", + checkUnusedResult, + exprStmt) +} + +// func() string +var sigNoArgsStringResult = types.NewSignature(nil, nil, + types.NewTuple(types.NewVar(token.NoPos, nil, "", types.Typ[types.String])), + false) + +var unusedFuncs = make(map[string]bool) +var unusedStringMethods = make(map[string]bool) + +func initUnusedFlags() { + commaSplit := func(s string, m map[string]bool) { + if s != "" { + for _, name := range strings.Split(s, ",") { + if len(name) == 0 { + flag.Usage() + } + m[name] = true + } + } + } + commaSplit(*unusedFuncsFlag, unusedFuncs) + commaSplit(*unusedStringMethodsFlag, unusedStringMethods) +} + +func checkUnusedResult(f *File, n ast.Node) { + call, ok := unparen(n.(*ast.ExprStmt).X).(*ast.CallExpr) + if !ok { + return // not a call statement + } + fun := unparen(call.Fun) + + if f.pkg.types[fun].IsType() { + return // a conversion, not a call + } + + selector, ok := fun.(*ast.SelectorExpr) + if !ok { + return // neither a method call nor a qualified ident + } + + sel, ok := f.pkg.selectors[selector] + if ok && sel.Kind() == types.MethodVal { + // method (e.g. foo.String()) + obj := sel.Obj().(*types.Func) + sig := sel.Type().(*types.Signature) + if types.Identical(sig, sigNoArgsStringResult) { + if unusedStringMethods[obj.Name()] { + f.Badf(call.Lparen, "result of (%s).%s call not used", + sig.Recv().Type(), obj.Name()) + } + } + } else if !ok { + // package-qualified function (e.g. fmt.Errorf) + obj, _ := f.pkg.uses[selector.Sel] + if obj, ok := obj.(*types.Func); ok { + qname := obj.Pkg().Path() + "." + obj.Name() + if unusedFuncs[qname] { + f.Badf(call.Lparen, "result of %v call not used", qname) + } + } + } +} diff --git a/src/cmd/vet/vet_test.go b/src/cmd/vet/vet_test.go new file mode 100644 index 0000000000000000000000000000000000000000..9aae8dd930fff3ab8fa89fbf09dddd826bfa6a98 --- /dev/null +++ b/src/cmd/vet/vet_test.go @@ -0,0 +1,107 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main_test + +import ( + "bytes" + "internal/testenv" + "os" + "os/exec" + "path/filepath" + "runtime" + "testing" +) + +const ( + dataDir = "testdata" + binary = "testvet.exe" +) + +// Run this shell script, but do it in Go so it can be run by "go test". +// go build -o testvet +// $(GOROOT)/test/errchk ./testvet -shadow -printfuncs='Warn:1,Warnf:1' testdata/*.go testdata/*.s +// rm testvet +// +func TestVet(t *testing.T) { + testenv.MustHaveGoBuild(t) + + switch runtime.GOOS { + case "plan9", "windows": + // Plan 9 and Windows systems can't be guaranteed to have Perl and so can't run errchk. + t.Skipf("skipping test; no Perl on %q", runtime.GOOS) + } + + // go build + cmd := exec.Command("go", "build", "-o", binary) + run(cmd, t) + + // defer removal of vet + defer os.Remove(binary) + + // errchk ./testvet + gos, err := filepath.Glob(filepath.Join(dataDir, "*.go")) + if err != nil { + t.Fatal(err) + } + asms, err := filepath.Glob(filepath.Join(dataDir, "*.s")) + if err != nil { + t.Fatal(err) + } + files := append(gos, asms...) + errchk := filepath.Join(runtime.GOROOT(), "test", "errchk") + flags := []string{ + "./" + binary, + "-printfuncs=Warn:1,Warnf:1", + "-test", // TODO: Delete once -shadow is part of -all. + } + cmd = exec.Command(errchk, append(flags, files...)...) + if !run(cmd, t) { + t.Fatal("vet command failed") + } +} + +func run(c *exec.Cmd, t *testing.T) bool { + output, err := c.CombinedOutput() + os.Stderr.Write(output) + if err != nil { + t.Fatal(err) + } + // Errchk delights by not returning non-zero status if it finds errors, so we look at the output. + // It prints "BUG" if there is a failure. + if !c.ProcessState.Success() { + return false + } + return !bytes.Contains(output, []byte("BUG")) +} + +// TestTags verifies that the -tags argument controls which files to check. +func TestTags(t *testing.T) { + testenv.MustHaveGoBuild(t) + + // go build + cmd := exec.Command("go", "build", "-o", binary) + run(cmd, t) + + // defer removal of vet + defer os.Remove(binary) + + args := []string{ + "-tags=testtag", + "-v", // We're going to look at the files it examines. + "testdata/tagtest", + } + cmd = exec.Command("./"+binary, args...) + output, err := cmd.CombinedOutput() + if err != nil { + t.Fatal(err) + } + // file1 has testtag and file2 has !testtag. + if !bytes.Contains(output, []byte(filepath.Join("tagtest", "file1.go"))) { + t.Error("file1 was excluded, should be included") + } + if bytes.Contains(output, []byte(filepath.Join("tagtest", "file2.go"))) { + t.Error("file2 was included, should be excluded") + } +} diff --git a/src/cmd/vet/whitelist/whitelist.go b/src/cmd/vet/whitelist/whitelist.go new file mode 100644 index 0000000000000000000000000000000000000000..bf4b4bf48a0c8a11c657746b75876e000fd1567a --- /dev/null +++ b/src/cmd/vet/whitelist/whitelist.go @@ -0,0 +1,53 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package whitelist defines exceptions for the vet tool. +package whitelist // import "cmd/vet/whitelist" + +// UnkeyedLiteral are types that are actually slices, but +// syntactically, we cannot tell whether the Typ in pkg.Typ{1, 2, 3} +// is a slice or a struct, so we whitelist all the standard package +// library's exported slice types. +var UnkeyedLiteral = map[string]bool{ + /* + find $GOROOT/src -type f | grep -v _test.go | xargs grep '^type.*\[\]' | \ + grep -v ' map\[' | sed 's,/[^/]*go.type,,' | sed 's,.*src/,,' | \ + sed 's, ,.,' | sed 's, .*,,' | grep -v '\.[a-z]' | \ + sort | awk '{ print "\"" $0 "\": true," }' + */ + "crypto/x509/pkix.RDNSequence": true, + "crypto/x509/pkix.RelativeDistinguishedNameSET": true, + "database/sql.RawBytes": true, + "debug/macho.LoadBytes": true, + "encoding/asn1.ObjectIdentifier": true, + "encoding/asn1.RawContent": true, + "encoding/json.RawMessage": true, + "encoding/xml.CharData": true, + "encoding/xml.Comment": true, + "encoding/xml.Directive": true, + "go/scanner.ErrorList": true, + "image/color.Palette": true, + "net.HardwareAddr": true, + "net.IP": true, + "net.IPMask": true, + "sort.Float64Slice": true, + "sort.IntSlice": true, + "sort.StringSlice": true, + "unicode.SpecialCase": true, + + // These image and image/color struct types are frozen. We will never add fields to them. + "image/color.Alpha16": true, + "image/color.Alpha": true, + "image/color.CMYK": true, + "image/color.Gray16": true, + "image/color.Gray": true, + "image/color.NRGBA64": true, + "image/color.NRGBA": true, + "image/color.RGBA64": true, + "image/color.RGBA": true, + "image/color.YCbCr": true, + "image.Point": true, + "image.Rectangle": true, + "image.Uniform": true, +} diff --git a/src/cmd/yacc/doc.go b/src/cmd/yacc/doc.go new file mode 100644 index 0000000000000000000000000000000000000000..328d87b9da53efe301ff16d001b50b537aeaaca3 --- /dev/null +++ b/src/cmd/yacc/doc.go @@ -0,0 +1,69 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +/* + +Yacc is a version of yacc for Go. +It is written in Go and generates parsers written in Go. + +Usage: + + go tool yacc args... + +It is largely transliterated from the Inferno version written in Limbo +which in turn was largely transliterated from the Plan 9 version +written in C and documented at + + http://plan9.bell-labs.com/magic/man2html/1/yacc + +Adepts of the original yacc will have no trouble adapting to this +form of the tool. + +The directory $GOROOT/src/cmd/yacc/testdata/expr is a yacc program +for a very simple expression parser. See expr.y and main.go in that +directory for examples of how to write and build yacc programs. + +The generated parser is reentrant. The parsing function yyParse expects +to be given an argument that conforms to the following interface: + + type yyLexer interface { + Lex(lval *yySymType) int + Error(e string) + } + +Lex should return the token identifier, and place other token +information in lval (which replaces the usual yylval). +Error is equivalent to yyerror in the original yacc. + +Code inside the grammar actions may refer to the variable yylex, +which holds the yyLexer passed to yyParse. + +Clients that need to understand more about the parser state can +create the parser separately from invoking it. The function yyNewParser +returns a yyParser conforming to the following interface: + + type yyParser interface { + Parse(yyLex) int + Lookahead() int + } + +Parse runs the parser; the top-level call yyParse(yylex) is equivalent +to yyNewParser().Parse(yylex). + +Lookahead can be called during grammar actions to read (but not consume) +the value of the current lookahead token, as returned by yylex.Lex. +If there is no current lookahead token (because the parser has not called Lex +or has consumed the token returned by the most recent call to Lex), +Lookahead returns -1. Calling Lookahead is equivalent to reading +yychar from within in a grammar action. + +Multiple grammars compiled into a single program should be placed in +distinct packages. If that is impossible, the "-p prefix" flag to +yacc sets the prefix, by default yy, that begins the names of +symbols, including types, the parser, and the lexer, generated and +referenced by yacc's generated code. Setting it to distinct values +allows multiple grammars to be placed in a single package. + +*/ +package main diff --git a/src/cmd/yacc/testdata/expr/README b/src/cmd/yacc/testdata/expr/README new file mode 100644 index 0000000000000000000000000000000000000000..302ef57a7d36ccd94c79bf33cabcb0687b9ee718 --- /dev/null +++ b/src/cmd/yacc/testdata/expr/README @@ -0,0 +1,20 @@ +This directory contains a simple program demonstrating how to use +the Go version of yacc. + +To build it: + + $ go generate + $ go build + +or + + $ go generate + $ go run expr.go + +The file main.go contains the "go generate" command to run yacc to +create expr.go from expr.y. It also has the package doc comment, +as godoc will not scan the .y file. + +The actual implementation is in expr.y. + +The program is not installed in the binary distributions of Go. diff --git a/src/cmd/yacc/testdata/expr/expr.y b/src/cmd/yacc/testdata/expr/expr.y new file mode 100644 index 0000000000000000000000000000000000000000..bb8e9bfd84416d0b7e4a588cc6b1f0814fad5b9d --- /dev/null +++ b/src/cmd/yacc/testdata/expr/expr.y @@ -0,0 +1,202 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// This is an example of a goyacc program. +// To build it: +// go tool yacc -p "expr" expr.y (produces y.go) +// go build -o expr y.go +// expr +// > + +%{ + +package main + +import ( + "bufio" + "bytes" + "fmt" + "io" + "log" + "math/big" + "os" + "unicode/utf8" +) + +%} + +%union { + num *big.Rat +} + +%type expr expr1 expr2 expr3 + +%token '+' '-' '*' '/' '(' ')' + +%token NUM + +%% + +top: + expr + { + if $1.IsInt() { + fmt.Println($1.Num().String()) + } else { + fmt.Println($1.String()) + } + } + +expr: + expr1 +| '+' expr + { + $$ = $2 + } +| '-' expr + { + $$ = $2.Neg($2) + } + +expr1: + expr2 +| expr1 '+' expr2 + { + $$ = $1.Add($1, $3) + } +| expr1 '-' expr2 + { + $$ = $1.Sub($1, $3) + } + +expr2: + expr3 +| expr2 '*' expr3 + { + $$ = $1.Mul($1, $3) + } +| expr2 '/' expr3 + { + $$ = $1.Quo($1, $3) + } + +expr3: + NUM +| '(' expr ')' + { + $$ = $2 + } + + +%% + +// The parser expects the lexer to return 0 on EOF. Give it a name +// for clarity. +const eof = 0 + +// The parser uses the type Lex as a lexer. It must provide +// the methods Lex(*SymType) int and Error(string). +type exprLex struct { + line []byte + peek rune +} + +// The parser calls this method to get each new token. This +// implementation returns operators and NUM. +func (x *exprLex) Lex(yylval *exprSymType) int { + for { + c := x.next() + switch c { + case eof: + return eof + case '0', '1', '2', '3', '4', '5', '6', '7', '8', '9': + return x.num(c, yylval) + case '+', '-', '*', '/', '(', ')': + return int(c) + + // Recognize Unicode multiplication and division + // symbols, returning what the parser expects. + case '×': + return '*' + case '÷': + return '/' + + case ' ', '\t', '\n', '\r': + default: + log.Printf("unrecognized character %q", c) + } + } +} + +// Lex a number. +func (x *exprLex) num(c rune, yylval *exprSymType) int { + add := func(b *bytes.Buffer, c rune) { + if _, err := b.WriteRune(c); err != nil { + log.Fatalf("WriteRune: %s", err) + } + } + var b bytes.Buffer + add(&b, c) + L: for { + c = x.next() + switch c { + case '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '.', 'e', 'E': + add(&b, c) + default: + break L + } + } + if c != eof { + x.peek = c + } + yylval.num = &big.Rat{} + _, ok := yylval.num.SetString(b.String()) + if !ok { + log.Printf("bad number %q", b.String()) + return eof + } + return NUM +} + +// Return the next rune for the lexer. +func (x *exprLex) next() rune { + if x.peek != eof { + r := x.peek + x.peek = eof + return r + } + if len(x.line) == 0 { + return eof + } + c, size := utf8.DecodeRune(x.line) + x.line = x.line[size:] + if c == utf8.RuneError && size == 1 { + log.Print("invalid utf8") + return x.next() + } + return c +} + +// The parser calls this method on a parse error. +func (x *exprLex) Error(s string) { + log.Printf("parse error: %s", s) +} + +func main() { + in := bufio.NewReader(os.Stdin) + for { + if _, err := os.Stdout.WriteString("> "); err != nil { + log.Fatalf("WriteString: %s", err) + } + line, err := in.ReadBytes('\n') + if err == io.EOF { + return + } + if err != nil { + log.Fatalf("ReadBytes: %s", err) + } + + exprParse(&exprLex{line: line}) + } +} diff --git a/src/cmd/yacc/testdata/expr/main.go b/src/cmd/yacc/testdata/expr/main.go new file mode 100644 index 0000000000000000000000000000000000000000..37f0023cff53c576da509e9ad003f76a0d9a03f3 --- /dev/null +++ b/src/cmd/yacc/testdata/expr/main.go @@ -0,0 +1,15 @@ +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// This file holds the go generate command to run yacc on the grammar in expr.y. +// To build expr: +// % go generate +// % go build + +//go:generate -command yacc go tool yacc +//go:generate yacc -o expr.go -p "expr" expr.y + +// Expr is a simple expression evaluator that serves as a working example of +// how to use Go's yacc implementation. +package main diff --git a/src/cmd/yacc/yacc.go b/src/cmd/yacc/yacc.go new file mode 100644 index 0000000000000000000000000000000000000000..4f83f50e4606aafe939c5cec3aa8186236b2b7bd --- /dev/null +++ b/src/cmd/yacc/yacc.go @@ -0,0 +1,3649 @@ +/* +Derived from Inferno's utils/iyacc/yacc.c +http://code.google.com/p/inferno-os/source/browse/utils/iyacc/yacc.c + +This copyright NOTICE applies to all files in this directory and +subdirectories, unless another copyright notice appears in a given +file or subdirectory. If you take substantial code from this software to use in +other programs, you must somehow include with it an appropriate +copyright notice that includes the copyright notice and the other +notices below. It is fine (and often tidier) to do that in a separate +file such as NOTICE, LICENCE or COPYING. + + Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved. + Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net) + Portions Copyright © 1997-1999 Vita Nuova Limited + Portions Copyright © 2000-2007 Vita Nuova Holdings Limited (www.vitanuova.com) + Portions Copyright © 2004,2006 Bruce Ellis + Portions Copyright © 2005-2007 C H Forsyth (forsyth@terzarima.net) + Revisions Copyright © 2000-2007 Lucent Technologies Inc. and others + Portions Copyright © 2009 The Go Authors. All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +*/ + +package main + +// yacc +// major difference is lack of stem ("y" variable) +// + +import ( + "bufio" + "bytes" + "flag" + "fmt" + "go/format" + "io/ioutil" + "os" + "strconv" + "strings" + "unicode" +) + +// the following are adjustable +// according to memory size +const ( + ACTSIZE = 30000 + NSTATES = 2000 + TEMPSIZE = 2000 + + SYMINC = 50 // increase for non-term or term + RULEINC = 50 // increase for max rule length prodptr[i] + PRODINC = 100 // increase for productions prodptr + WSETINC = 50 // increase for working sets wsets + STATEINC = 200 // increase for states statemem + + NAMESIZE = 50 + NTYPES = 63 + ISIZE = 400 + + PRIVATE = 0xE000 // unicode private use + + // relationships which must hold: + // TEMPSIZE >= NTERMS + NNONTERM + 1; + // TEMPSIZE >= NSTATES; + // + + NTBASE = 010000 + ERRCODE = 8190 + ACCEPTCODE = 8191 + YYLEXUNK = 3 + TOKSTART = 4 //index of first defined token +) + +// no, left, right, binary assoc. +const ( + NOASC = iota + LASC + RASC + BASC +) + +// flags for state generation +const ( + DONE = iota + MUSTDO + MUSTLOOKAHEAD +) + +// flags for a rule having an action, and being reduced +const ( + ACTFLAG = 1 << (iota + 2) + REDFLAG +) + +// output parser flags +const yyFlag = -1000 + +// parse tokens +const ( + IDENTIFIER = PRIVATE + iota + MARK + TERM + LEFT + RIGHT + BINARY + PREC + LCURLY + IDENTCOLON + NUMBER + START + TYPEDEF + TYPENAME + UNION + ERROR +) + +const ENDFILE = 0 +const EMPTY = 1 +const WHOKNOWS = 0 +const OK = 1 +const NOMORE = -1000 + +// macros for getting associativity and precedence levels +func ASSOC(i int) int { return i & 3 } + +func PLEVEL(i int) int { return (i >> 4) & 077 } + +func TYPE(i int) int { return (i >> 10) & 077 } + +// macros for setting associativity and precedence levels +func SETASC(i, j int) int { return i | j } + +func SETPLEV(i, j int) int { return i | (j << 4) } + +func SETTYPE(i, j int) int { return i | (j << 10) } + +// I/O descriptors +var finput *bufio.Reader // input file +var stderr *bufio.Writer +var ftable *bufio.Writer // y.go file +var fcode = &bytes.Buffer{} // saved code +var foutput *bufio.Writer // y.output file + +var fmtImported bool // output file has recorded an import of "fmt" + +var oflag string // -o [y.go] - y.go file +var vflag string // -v [y.output] - y.output file +var lflag bool // -l - disable line directives +var prefix string // name prefix for identifiers, default yy + +func init() { + flag.StringVar(&oflag, "o", "y.go", "parser output") + flag.StringVar(&prefix, "p", "yy", "name prefix to use in generated code") + flag.StringVar(&vflag, "v", "y.output", "create parsing tables") + flag.BoolVar(&lflag, "l", false, "disable line directives") +} + +var stacksize = 200 + +// communication variables between various I/O routines +var infile string // input file name +var numbval int // value of an input number +var tokname string // input token name, slop for runes and 0 +var tokflag = false + +// structure declarations +type Lkset []int + +type Pitem struct { + prod []int + off int // offset within the production + first int // first term or non-term in item + prodno int // production number for sorting +} + +type Item struct { + pitem Pitem + look Lkset +} + +type Symb struct { + name string + noconst bool + value int +} + +type Wset struct { + pitem Pitem + flag int + ws Lkset +} + +// storage of types +var ntypes int // number of types defined +var typeset [NTYPES]string // pointers to type tags + +// token information + +var ntokens = 0 // number of tokens +var tokset []Symb +var toklev []int // vector with the precedence of the terminals + +// nonterminal information + +var nnonter = -1 // the number of nonterminals +var nontrst []Symb +var start int // start symbol + +// state information + +var nstate = 0 // number of states +var pstate = make([]int, NSTATES+2) // index into statemem to the descriptions of the states +var statemem []Item +var tystate = make([]int, NSTATES) // contains type information about the states +var tstates []int // states generated by terminal gotos +var ntstates []int // states generated by nonterminal gotos +var mstates = make([]int, NSTATES) // chain of overflows of term/nonterm generation lists +var lastred int // number of last reduction of a state +var defact = make([]int, NSTATES) // default actions of states + +// lookahead set information + +var lkst []Lkset +var nolook = 0 // flag to turn off lookahead computations +var tbitset = 0 // size of lookahead sets +var clset Lkset // temporary storage for lookahead computations + +// working set information + +var wsets []Wset +var cwp int + +// storage for action table + +var amem []int // action table storage +var memp int // next free action table position +var indgo = make([]int, NSTATES) // index to the stored goto table + +// temporary vector, indexable by states, terms, or ntokens + +var temp1 = make([]int, TEMPSIZE) // temporary storage, indexed by terms + ntokens or states +var lineno = 1 // current input line number +var fatfl = 1 // if on, error is fatal +var nerrors = 0 // number of errors + +// assigned token type values + +var extval = 0 + +// grammar rule information + +var nprod = 1 // number of productions +var prdptr [][]int // pointers to descriptions of productions +var levprd []int // precedence levels for the productions +var rlines []int // line number for this rule + +// statistics collection variables + +var zzgoent = 0 +var zzgobest = 0 +var zzacent = 0 +var zzexcp = 0 +var zzclose = 0 +var zzrrconf = 0 +var zzsrconf = 0 +var zzstate = 0 + +// optimizer arrays + +var yypgo [][]int +var optst [][]int +var ggreed []int +var pgo []int + +var maxspr int // maximum spread of any entry +var maxoff int // maximum offset into a array +var maxa int + +// storage for information about the nonterminals + +var pres [][][]int // vector of pointers to productions yielding each nonterminal +var pfirst []Lkset +var pempty []int // vector of nonterminals nontrivially deriving e + +// random stuff picked out from between functions + +var indebug = 0 // debugging flag for cpfir +var pidebug = 0 // debugging flag for putitem +var gsdebug = 0 // debugging flag for stagen +var cldebug = 0 // debugging flag for closure +var pkdebug = 0 // debugging flag for apack +var g2debug = 0 // debugging for go2gen +var adb = 0 // debugging for callopt + +type Resrv struct { + name string + value int +} + +var resrv = []Resrv{ + {"binary", BINARY}, + {"left", LEFT}, + {"nonassoc", BINARY}, + {"prec", PREC}, + {"right", RIGHT}, + {"start", START}, + {"term", TERM}, + {"token", TERM}, + {"type", TYPEDEF}, + {"union", UNION}, + {"struct", UNION}, + {"error", ERROR}, +} + +type Error struct { + lineno int + tokens []string + msg string +} + +var errors []Error + +type Row struct { + actions []int + defaultAction int +} + +var stateTable []Row + +var zznewstate = 0 + +const EOF = -1 + +func main() { + + setup() // initialize and read productions + + tbitset = (ntokens + 32) / 32 + cpres() // make table of which productions yield a given nonterminal + cempty() // make a table of which nonterminals can match the empty string + cpfir() // make a table of firsts of nonterminals + + stagen() // generate the states + + yypgo = make([][]int, nnonter+1) + optst = make([][]int, nstate) + output() // write the states and the tables + go2out() + + hideprod() + summary() + + callopt() + + others() + + exit(0) +} + +func setup() { + var j, ty int + + stderr = bufio.NewWriter(os.Stderr) + foutput = nil + + flag.Parse() + if flag.NArg() != 1 { + usage() + } + if stacksize < 1 { + // never set so cannot happen + fmt.Fprintf(stderr, "yacc: stack size too small\n") + usage() + } + yaccpar = strings.Replace(yaccpartext, "$$", prefix, -1) + openup() + + defin(0, "$end") + extval = PRIVATE // tokens start in unicode 'private use' + defin(0, "error") + defin(1, "$accept") + defin(0, "$unk") + i := 0 + + t := gettok() + +outer: + for { + switch t { + default: + errorf("syntax error tok=%v", t-PRIVATE) + + case MARK, ENDFILE: + break outer + + case ';': + + case START: + t = gettok() + if t != IDENTIFIER { + errorf("bad %%start construction") + } + start = chfind(1, tokname) + + case ERROR: + lno := lineno + var tokens []string + for { + t := gettok() + if t == ':' { + break + } + if t != IDENTIFIER && t != IDENTCOLON { + errorf("bad syntax in %%error") + } + tokens = append(tokens, tokname) + if t == IDENTCOLON { + break + } + } + if gettok() != IDENTIFIER { + errorf("bad syntax in %%error") + } + errors = append(errors, Error{lno, tokens, tokname}) + + case TYPEDEF: + t = gettok() + if t != TYPENAME { + errorf("bad syntax in %%type") + } + ty = numbval + for { + t = gettok() + switch t { + case IDENTIFIER: + t = chfind(1, tokname) + if t < NTBASE { + j = TYPE(toklev[t]) + if j != 0 && j != ty { + errorf("type redeclaration of token %s", + tokset[t].name) + } else { + toklev[t] = SETTYPE(toklev[t], ty) + } + } else { + j = nontrst[t-NTBASE].value + if j != 0 && j != ty { + errorf("type redeclaration of nonterminal %v", + nontrst[t-NTBASE].name) + } else { + nontrst[t-NTBASE].value = ty + } + } + continue + + case ',': + continue + } + break + } + continue + + case UNION: + cpyunion() + + case LEFT, BINARY, RIGHT, TERM: + // nonzero means new prec. and assoc. + lev := t - TERM + if lev != 0 { + i++ + } + ty = 0 + + // get identifiers so defined + t = gettok() + + // there is a type defined + if t == TYPENAME { + ty = numbval + t = gettok() + } + for { + switch t { + case ',': + t = gettok() + continue + + case ';': + break + + case IDENTIFIER: + j = chfind(0, tokname) + if j >= NTBASE { + errorf("%v defined earlier as nonterminal", tokname) + } + if lev != 0 { + if ASSOC(toklev[j]) != 0 { + errorf("redeclaration of precedence of %v", tokname) + } + toklev[j] = SETASC(toklev[j], lev) + toklev[j] = SETPLEV(toklev[j], i) + } + if ty != 0 { + if TYPE(toklev[j]) != 0 { + errorf("redeclaration of type of %v", tokname) + } + toklev[j] = SETTYPE(toklev[j], ty) + } + t = gettok() + if t == NUMBER { + tokset[j].value = numbval + t = gettok() + } + + continue + } + break + } + continue + + case LCURLY: + cpycode() + } + t = gettok() + } + + if t == ENDFILE { + errorf("unexpected EOF before %%") + } + + fmt.Fprintf(fcode, "switch %snt {\n", prefix) + + moreprod() + prdptr[0] = []int{NTBASE, start, 1, 0} + + nprod = 1 + curprod := make([]int, RULEINC) + t = gettok() + if t != IDENTCOLON { + errorf("bad syntax on first rule") + } + + if start == 0 { + prdptr[0][1] = chfind(1, tokname) + } + + // read rules + // put into prdptr array in the format + // target + // followed by id's of terminals and non-terminals + // followed by -nprod + + for t != MARK && t != ENDFILE { + mem := 0 + + // process a rule + rlines[nprod] = lineno + ruleline := lineno + if t == '|' { + curprod[mem] = prdptr[nprod-1][0] + mem++ + } else if t == IDENTCOLON { + curprod[mem] = chfind(1, tokname) + if curprod[mem] < NTBASE { + lerrorf(ruleline, "token illegal on LHS of grammar rule") + } + mem++ + } else { + lerrorf(ruleline, "illegal rule: missing semicolon or | ?") + } + + // read rule body + t = gettok() + for { + for t == IDENTIFIER { + curprod[mem] = chfind(1, tokname) + if curprod[mem] < NTBASE { + levprd[nprod] = toklev[curprod[mem]] + } + mem++ + if mem >= len(curprod) { + ncurprod := make([]int, mem+RULEINC) + copy(ncurprod, curprod) + curprod = ncurprod + } + t = gettok() + } + if t == PREC { + if gettok() != IDENTIFIER { + lerrorf(ruleline, "illegal %%prec syntax") + } + j = chfind(2, tokname) + if j >= NTBASE { + lerrorf(ruleline, "nonterminal "+nontrst[j-NTBASE].name+" illegal after %%prec") + } + levprd[nprod] = toklev[j] + t = gettok() + } + if t != '=' { + break + } + levprd[nprod] |= ACTFLAG + fmt.Fprintf(fcode, "\n\tcase %v:", nprod) + fmt.Fprintf(fcode, "\n\t\t%sDollar = %sS[%spt-%v:%spt+1]", prefix, prefix, prefix, mem-1, prefix) + cpyact(curprod, mem) + + // action within rule... + t = gettok() + if t == IDENTIFIER { + // make it a nonterminal + j = chfind(1, fmt.Sprintf("$$%v", nprod)) + + // + // the current rule will become rule number nprod+1 + // enter null production for action + // + prdptr[nprod] = make([]int, 2) + prdptr[nprod][0] = j + prdptr[nprod][1] = -nprod + + // update the production information + nprod++ + moreprod() + levprd[nprod] = levprd[nprod-1] & ^ACTFLAG + levprd[nprod-1] = ACTFLAG + rlines[nprod] = lineno + + // make the action appear in the original rule + curprod[mem] = j + mem++ + if mem >= len(curprod) { + ncurprod := make([]int, mem+RULEINC) + copy(ncurprod, curprod) + curprod = ncurprod + } + } + } + + for t == ';' { + t = gettok() + } + curprod[mem] = -nprod + mem++ + + // check that default action is reasonable + if ntypes != 0 && (levprd[nprod]&ACTFLAG) == 0 && + nontrst[curprod[0]-NTBASE].value != 0 { + // no explicit action, LHS has value + tempty := curprod[1] + if tempty < 0 { + lerrorf(ruleline, "must return a value, since LHS has a type") + } + if tempty >= NTBASE { + tempty = nontrst[tempty-NTBASE].value + } else { + tempty = TYPE(toklev[tempty]) + } + if tempty != nontrst[curprod[0]-NTBASE].value { + lerrorf(ruleline, "default action causes potential type clash") + } + } + moreprod() + prdptr[nprod] = make([]int, mem) + copy(prdptr[nprod], curprod) + nprod++ + moreprod() + levprd[nprod] = 0 + } + + // + // end of all rules + // dump out the prefix code + // + + fmt.Fprintf(fcode, "\n\t}") + + // put out non-literal terminals + for i := TOKSTART; i <= ntokens; i++ { + // non-literals + if !tokset[i].noconst { + fmt.Fprintf(ftable, "const %v = %v\n", tokset[i].name, tokset[i].value) + } + } + + // put out names of tokens + ftable.WriteRune('\n') + fmt.Fprintf(ftable, "var %sToknames = [...]string{\n", prefix) + for i := 1; i <= ntokens; i++ { + fmt.Fprintf(ftable, "\t%q,\n", tokset[i].name) + } + fmt.Fprintf(ftable, "}\n") + + // put out names of states. + // commented out to avoid a huge table just for debugging. + // re-enable to have the names in the binary. + fmt.Fprintf(ftable, "var %sStatenames = [...]string{", prefix) + // for i:=TOKSTART; i<=ntokens; i++ { + // fmt.Fprintf(ftable, "\t%q,\n", tokset[i].name); + // } + fmt.Fprintf(ftable, "}\n") + + ftable.WriteRune('\n') + fmt.Fprintf(ftable, "const %sEofCode = 1\n", prefix) + fmt.Fprintf(ftable, "const %sErrCode = 2\n", prefix) + fmt.Fprintf(ftable, "const %sMaxDepth = %v\n", prefix, stacksize) + + // + // copy any postfix code + // + if t == MARK { + if !lflag { + fmt.Fprintf(ftable, "\n//line %v:%v\n", infile, lineno) + } + for { + c := getrune(finput) + if c == EOF { + break + } + ftable.WriteRune(c) + } + } +} + +// +// allocate enough room to hold another production +// +func moreprod() { + n := len(prdptr) + if nprod >= n { + nn := n + PRODINC + aprod := make([][]int, nn) + alevprd := make([]int, nn) + arlines := make([]int, nn) + + copy(aprod, prdptr) + copy(alevprd, levprd) + copy(arlines, rlines) + + prdptr = aprod + levprd = alevprd + rlines = arlines + } +} + +// +// define s to be a terminal if nt==0 +// or a nonterminal if nt==1 +// +func defin(nt int, s string) int { + val := 0 + if nt != 0 { + nnonter++ + if nnonter >= len(nontrst) { + anontrst := make([]Symb, nnonter+SYMINC) + copy(anontrst, nontrst) + nontrst = anontrst + } + nontrst[nnonter] = Symb{name: s} + return NTBASE + nnonter + } + + // must be a token + ntokens++ + if ntokens >= len(tokset) { + nn := ntokens + SYMINC + atokset := make([]Symb, nn) + atoklev := make([]int, nn) + + copy(atoklev, toklev) + copy(atokset, tokset) + + tokset = atokset + toklev = atoklev + } + tokset[ntokens].name = s + toklev[ntokens] = 0 + + // establish value for token + // single character literal + if s[0] == '\'' || s[0] == '"' { + q, err := strconv.Unquote(s) + if err != nil { + errorf("invalid token: %s", err) + } + rq := []rune(q) + if len(rq) != 1 { + errorf("character token too long: %s", s) + } + val = int(rq[0]) + if val == 0 { + errorf("token value 0 is illegal") + } + tokset[ntokens].noconst = true + } else { + val = extval + extval++ + if s[0] == '$' { + tokset[ntokens].noconst = true + } + } + + tokset[ntokens].value = val + return ntokens +} + +var peekline = 0 + +func gettok() int { + var i int + var match, c rune + + tokname = "" + for { + lineno += peekline + peekline = 0 + c = getrune(finput) + for c == ' ' || c == '\n' || c == '\t' || c == '\v' || c == '\r' { + if c == '\n' { + lineno++ + } + c = getrune(finput) + } + + // skip comment -- fix + if c != '/' { + break + } + lineno += skipcom() + } + + switch c { + case EOF: + if tokflag { + fmt.Printf(">>> ENDFILE %v\n", lineno) + } + return ENDFILE + + case '{': + ungetrune(finput, c) + if tokflag { + fmt.Printf(">>> ={ %v\n", lineno) + } + return '=' + + case '<': + // get, and look up, a type name (union member name) + c = getrune(finput) + for c != '>' && c != EOF && c != '\n' { + tokname += string(c) + c = getrune(finput) + } + + if c != '>' { + errorf("unterminated < ... > clause") + } + + for i = 1; i <= ntypes; i++ { + if typeset[i] == tokname { + numbval = i + if tokflag { + fmt.Printf(">>> TYPENAME old <%v> %v\n", tokname, lineno) + } + return TYPENAME + } + } + ntypes++ + numbval = ntypes + typeset[numbval] = tokname + if tokflag { + fmt.Printf(">>> TYPENAME new <%v> %v\n", tokname, lineno) + } + return TYPENAME + + case '"', '\'': + match = c + tokname = string(c) + for { + c = getrune(finput) + if c == '\n' || c == EOF { + errorf("illegal or missing ' or \"") + } + if c == '\\' { + tokname += string('\\') + c = getrune(finput) + } else if c == match { + if tokflag { + fmt.Printf(">>> IDENTIFIER \"%v\" %v\n", tokname, lineno) + } + tokname += string(c) + return IDENTIFIER + } + tokname += string(c) + } + + case '%': + c = getrune(finput) + switch c { + case '%': + if tokflag { + fmt.Printf(">>> MARK %%%% %v\n", lineno) + } + return MARK + case '=': + if tokflag { + fmt.Printf(">>> PREC %%= %v\n", lineno) + } + return PREC + case '{': + if tokflag { + fmt.Printf(">>> LCURLY %%{ %v\n", lineno) + } + return LCURLY + } + + getword(c) + // find a reserved word + for i := range resrv { + if tokname == resrv[i].name { + if tokflag { + fmt.Printf(">>> %%%v %v %v\n", tokname, + resrv[i].value-PRIVATE, lineno) + } + return resrv[i].value + } + } + errorf("invalid escape, or illegal reserved word: %v", tokname) + + case '0', '1', '2', '3', '4', '5', '6', '7', '8', '9': + numbval = int(c - '0') + for { + c = getrune(finput) + if !isdigit(c) { + break + } + numbval = numbval*10 + int(c-'0') + } + ungetrune(finput, c) + if tokflag { + fmt.Printf(">>> NUMBER %v %v\n", numbval, lineno) + } + return NUMBER + + default: + if isword(c) || c == '.' || c == '$' { + getword(c) + break + } + if tokflag { + fmt.Printf(">>> OPERATOR %v %v\n", string(c), lineno) + } + return int(c) + } + + // look ahead to distinguish IDENTIFIER from IDENTCOLON + c = getrune(finput) + for c == ' ' || c == '\t' || c == '\n' || c == '\v' || c == '\r' || c == '/' { + if c == '\n' { + peekline++ + } + // look for comments + if c == '/' { + peekline += skipcom() + } + c = getrune(finput) + } + if c == ':' { + if tokflag { + fmt.Printf(">>> IDENTCOLON %v: %v\n", tokname, lineno) + } + return IDENTCOLON + } + + ungetrune(finput, c) + if tokflag { + fmt.Printf(">>> IDENTIFIER %v %v\n", tokname, lineno) + } + return IDENTIFIER +} + +func getword(c rune) { + tokname = "" + for isword(c) || isdigit(c) || c == '.' || c == '$' { + tokname += string(c) + c = getrune(finput) + } + ungetrune(finput, c) +} + +// +// determine the type of a symbol +// +func fdtype(t int) int { + var v int + var s string + + if t >= NTBASE { + v = nontrst[t-NTBASE].value + s = nontrst[t-NTBASE].name + } else { + v = TYPE(toklev[t]) + s = tokset[t].name + } + if v <= 0 { + errorf("must specify type for %v", s) + } + return v +} + +func chfind(t int, s string) int { + if s[0] == '"' || s[0] == '\'' { + t = 0 + } + for i := 0; i <= ntokens; i++ { + if s == tokset[i].name { + return i + } + } + for i := 0; i <= nnonter; i++ { + if s == nontrst[i].name { + return NTBASE + i + } + } + + // cannot find name + if t > 1 { + errorf("%v should have been defined earlier", s) + } + return defin(t, s) +} + +// +// copy the union declaration to the output, and the define file if present +// +func cpyunion() { + + if !lflag { + fmt.Fprintf(ftable, "\n//line %v:%v\n", infile, lineno) + } + fmt.Fprintf(ftable, "type %sSymType struct", prefix) + + level := 0 + +out: + for { + c := getrune(finput) + if c == EOF { + errorf("EOF encountered while processing %%union") + } + ftable.WriteRune(c) + switch c { + case '\n': + lineno++ + case '{': + if level == 0 { + fmt.Fprintf(ftable, "\n\tyys int") + } + level++ + case '}': + level-- + if level == 0 { + break out + } + } + } + fmt.Fprintf(ftable, "\n\n") +} + +// +// saves code between %{ and %} +// adds an import for __fmt__ the first time +// +func cpycode() { + lno := lineno + + c := getrune(finput) + if c == '\n' { + c = getrune(finput) + lineno++ + } + if !lflag { + fmt.Fprintf(ftable, "\n//line %v:%v\n", infile, lineno) + } + // accumulate until %} + code := make([]rune, 0, 1024) + for c != EOF { + if c == '%' { + c = getrune(finput) + if c == '}' { + emitcode(code, lno+1) + return + } + code = append(code, '%') + } + code = append(code, c) + if c == '\n' { + lineno++ + } + c = getrune(finput) + } + lineno = lno + errorf("eof before %%}") +} + +// +// emits code saved up from between %{ and %} +// called by cpycode +// adds an import for __yyfmt__ after the package clause +// +func emitcode(code []rune, lineno int) { + for i, line := range lines(code) { + writecode(line) + if !fmtImported && isPackageClause(line) { + fmt.Fprintln(ftable, `import __yyfmt__ "fmt"`) + if !lflag { + fmt.Fprintf(ftable, "//line %v:%v\n\t\t", infile, lineno+i) + } + fmtImported = true + } + } +} + +// +// does this line look like a package clause? not perfect: might be confused by early comments. +// +func isPackageClause(line []rune) bool { + line = skipspace(line) + + // must be big enough. + if len(line) < len("package X\n") { + return false + } + + // must start with "package" + for i, r := range []rune("package") { + if line[i] != r { + return false + } + } + line = skipspace(line[len("package"):]) + + // must have another identifier. + if len(line) == 0 || (!unicode.IsLetter(line[0]) && line[0] != '_') { + return false + } + for len(line) > 0 { + if !unicode.IsLetter(line[0]) && !unicode.IsDigit(line[0]) && line[0] != '_' { + break + } + line = line[1:] + } + line = skipspace(line) + + // eol, newline, or comment must follow + if len(line) == 0 { + return true + } + if line[0] == '\r' || line[0] == '\n' { + return true + } + if len(line) >= 2 { + return line[0] == '/' && (line[1] == '/' || line[1] == '*') + } + return false +} + +// +// skip initial spaces +// +func skipspace(line []rune) []rune { + for len(line) > 0 { + if line[0] != ' ' && line[0] != '\t' { + break + } + line = line[1:] + } + return line +} + +// +// break code into lines +// +func lines(code []rune) [][]rune { + l := make([][]rune, 0, 100) + for len(code) > 0 { + // one line per loop + var i int + for i = range code { + if code[i] == '\n' { + break + } + } + l = append(l, code[:i+1]) + code = code[i+1:] + } + return l +} + +// +// writes code to ftable +// +func writecode(code []rune) { + for _, r := range code { + ftable.WriteRune(r) + } +} + +// +// skip over comments +// skipcom is called after reading a '/' +// +func skipcom() int { + var c rune + + c = getrune(finput) + if c == '/' { + for c != EOF { + if c == '\n' { + return 1 + } + c = getrune(finput) + } + errorf("EOF inside comment") + return 0 + } + if c != '*' { + errorf("illegal comment") + } + + nl := 0 // lines skipped + c = getrune(finput) + +l1: + switch c { + case '*': + c = getrune(finput) + if c == '/' { + break + } + goto l1 + + case '\n': + nl++ + fallthrough + + default: + c = getrune(finput) + goto l1 + } + return nl +} + +func dumpprod(curprod []int, max int) { + fmt.Printf("\n") + for i := 0; i < max; i++ { + p := curprod[i] + if p < 0 { + fmt.Printf("[%v] %v\n", i, p) + } else { + fmt.Printf("[%v] %v\n", i, symnam(p)) + } + } +} + +// +// copy action to the next ; or closing } +// +func cpyact(curprod []int, max int) { + + if !lflag { + fmt.Fprintf(fcode, "\n\t\t//line %v:%v\n\t\t", infile, lineno) + } + + lno := lineno + brac := 0 + +loop: + for { + c := getrune(finput) + + swt: + switch c { + case ';': + if brac == 0 { + fcode.WriteRune(c) + return + } + + case '{': + if brac == 0 { + } + brac++ + + case '$': + s := 1 + tok := -1 + c = getrune(finput) + + // type description + if c == '<' { + ungetrune(finput, c) + if gettok() != TYPENAME { + errorf("bad syntax on $ clause") + } + tok = numbval + c = getrune(finput) + } + if c == '$' { + fmt.Fprintf(fcode, "%sVAL", prefix) + + // put out the proper tag... + if ntypes != 0 { + if tok < 0 { + tok = fdtype(curprod[0]) + } + fmt.Fprintf(fcode, ".%v", typeset[tok]) + } + continue loop + } + if c == '-' { + s = -s + c = getrune(finput) + } + j := 0 + if isdigit(c) { + for isdigit(c) { + j = j*10 + int(c-'0') + c = getrune(finput) + } + ungetrune(finput, c) + j = j * s + if j >= max { + errorf("Illegal use of $%v", j) + } + } else if isword(c) || c == '.' { + // look for $name + ungetrune(finput, c) + if gettok() != IDENTIFIER { + errorf("$ must be followed by an identifier") + } + tokn := chfind(2, tokname) + fnd := -1 + c = getrune(finput) + if c != '@' { + ungetrune(finput, c) + } else if gettok() != NUMBER { + errorf("@ must be followed by number") + } else { + fnd = numbval + } + for j = 1; j < max; j++ { + if tokn == curprod[j] { + fnd-- + if fnd <= 0 { + break + } + } + } + if j >= max { + errorf("$name or $name@number not found") + } + } else { + fcode.WriteRune('$') + if s < 0 { + fcode.WriteRune('-') + } + ungetrune(finput, c) + continue loop + } + fmt.Fprintf(fcode, "%sDollar[%v]", prefix, j) + + // put out the proper tag + if ntypes != 0 { + if j <= 0 && tok < 0 { + errorf("must specify type of $%v", j) + } + if tok < 0 { + tok = fdtype(curprod[j]) + } + fmt.Fprintf(fcode, ".%v", typeset[tok]) + } + continue loop + + case '}': + brac-- + if brac != 0 { + break + } + fcode.WriteRune(c) + return + + case '/': + nc := getrune(finput) + if nc != '/' && nc != '*' { + ungetrune(finput, nc) + break + } + // a comment + fcode.WriteRune(c) + fcode.WriteRune(nc) + c = getrune(finput) + for c != EOF { + switch { + case c == '\n': + lineno++ + if nc == '/' { // end of // comment + break swt + } + case c == '*' && nc == '*': // end of /* comment? + nnc := getrune(finput) + if nnc == '/' { + fcode.WriteRune('*') + fcode.WriteRune('/') + c = getrune(finput) + break swt + } + ungetrune(finput, nnc) + } + fcode.WriteRune(c) + c = getrune(finput) + } + errorf("EOF inside comment") + + case '\'', '"': + // character string or constant + match := c + fcode.WriteRune(c) + c = getrune(finput) + for c != EOF { + if c == '\\' { + fcode.WriteRune(c) + c = getrune(finput) + if c == '\n' { + lineno++ + } + } else if c == match { + break swt + } + if c == '\n' { + errorf("newline in string or char const") + } + fcode.WriteRune(c) + c = getrune(finput) + } + errorf("EOF in string or character constant") + + case EOF: + lineno = lno + errorf("action does not terminate") + + case '\n': + fmt.Fprint(fcode, "\n\t") + lineno++ + continue loop + } + + fcode.WriteRune(c) + } +} + +func openup() { + infile = flag.Arg(0) + finput = open(infile) + if finput == nil { + errorf("cannot open %v", infile) + } + + foutput = nil + if vflag != "" { + foutput = create(vflag) + if foutput == nil { + errorf("can't create file %v", vflag) + } + } + + ftable = nil + if oflag == "" { + oflag = "y.go" + } + ftable = create(oflag) + if ftable == nil { + errorf("can't create file %v", oflag) + } + +} + +// +// return a pointer to the name of symbol i +// +func symnam(i int) string { + var s string + + if i >= NTBASE { + s = nontrst[i-NTBASE].name + } else { + s = tokset[i].name + } + return s +} + +// +// set elements 0 through n-1 to c +// +func aryfil(v []int, n, c int) { + for i := 0; i < n; i++ { + v[i] = c + } +} + +// +// compute an array with the beginnings of productions yielding given nonterminals +// The array pres points to these lists +// the array pyield has the lists: the total size is only NPROD+1 +// +func cpres() { + pres = make([][][]int, nnonter+1) + curres := make([][]int, nprod) + + if false { + for j := 0; j <= nnonter; j++ { + fmt.Printf("nnonter[%v] = %v\n", j, nontrst[j].name) + } + for j := 0; j < nprod; j++ { + fmt.Printf("prdptr[%v][0] = %v+NTBASE\n", j, prdptr[j][0]-NTBASE) + } + } + + fatfl = 0 // make undefined symbols nonfatal + for i := 0; i <= nnonter; i++ { + n := 0 + c := i + NTBASE + for j := 0; j < nprod; j++ { + if prdptr[j][0] == c { + curres[n] = prdptr[j][1:] + n++ + } + } + if n == 0 { + errorf("nonterminal %v not defined", nontrst[i].name) + continue + } + pres[i] = make([][]int, n) + copy(pres[i], curres) + } + fatfl = 1 + if nerrors != 0 { + summary() + exit(1) + } +} + +func dumppres() { + for i := 0; i <= nnonter; i++ { + fmt.Printf("nonterm %d\n", i) + curres := pres[i] + for j := 0; j < len(curres); j++ { + fmt.Printf("\tproduction %d:", j) + prd := curres[j] + for k := 0; k < len(prd); k++ { + fmt.Printf(" %d", prd[k]) + } + fmt.Print("\n") + } + } +} + +// +// mark nonterminals which derive the empty string +// also, look for nonterminals which don't derive any token strings +// +func cempty() { + var i, p, np int + var prd []int + + pempty = make([]int, nnonter+1) + + // first, use the array pempty to detect productions that can never be reduced + // set pempty to WHONOWS + aryfil(pempty, nnonter+1, WHOKNOWS) + + // now, look at productions, marking nonterminals which derive something +more: + for { + for i = 0; i < nprod; i++ { + prd = prdptr[i] + if pempty[prd[0]-NTBASE] != 0 { + continue + } + np = len(prd) - 1 + for p = 1; p < np; p++ { + if prd[p] >= NTBASE && pempty[prd[p]-NTBASE] == WHOKNOWS { + break + } + } + // production can be derived + if p == np { + pempty[prd[0]-NTBASE] = OK + continue more + } + } + break + } + + // now, look at the nonterminals, to see if they are all OK + for i = 0; i <= nnonter; i++ { + // the added production rises or falls as the start symbol ... + if i == 0 { + continue + } + if pempty[i] != OK { + fatfl = 0 + errorf("nonterminal " + nontrst[i].name + " never derives any token string") + } + } + + if nerrors != 0 { + summary() + exit(1) + } + + // now, compute the pempty array, to see which nonterminals derive the empty string + // set pempty to WHOKNOWS + aryfil(pempty, nnonter+1, WHOKNOWS) + + // loop as long as we keep finding empty nonterminals + +again: + for { + next: + for i = 1; i < nprod; i++ { + // not known to be empty + prd = prdptr[i] + if pempty[prd[0]-NTBASE] != WHOKNOWS { + continue + } + np = len(prd) - 1 + for p = 1; p < np; p++ { + if prd[p] < NTBASE || pempty[prd[p]-NTBASE] != EMPTY { + continue next + } + } + + // we have a nontrivially empty nonterminal + pempty[prd[0]-NTBASE] = EMPTY + + // got one ... try for another + continue again + } + return + } +} + +func dumpempty() { + for i := 0; i <= nnonter; i++ { + if pempty[i] == EMPTY { + fmt.Printf("non-term %d %s matches empty\n", i, symnam(i+NTBASE)) + } + } +} + +// +// compute an array with the first of nonterminals +// +func cpfir() { + var s, n, p, np, ch, i int + var curres [][]int + var prd []int + + wsets = make([]Wset, nnonter+WSETINC) + pfirst = make([]Lkset, nnonter+1) + for i = 0; i <= nnonter; i++ { + wsets[i].ws = mkset() + pfirst[i] = mkset() + curres = pres[i] + n = len(curres) + + // initially fill the sets + for s = 0; s < n; s++ { + prd = curres[s] + np = len(prd) - 1 + for p = 0; p < np; p++ { + ch = prd[p] + if ch < NTBASE { + setbit(pfirst[i], ch) + break + } + if pempty[ch-NTBASE] == 0 { + break + } + } + } + } + + // now, reflect transitivity + changes := 1 + for changes != 0 { + changes = 0 + for i = 0; i <= nnonter; i++ { + curres = pres[i] + n = len(curres) + for s = 0; s < n; s++ { + prd = curres[s] + np = len(prd) - 1 + for p = 0; p < np; p++ { + ch = prd[p] - NTBASE + if ch < 0 { + break + } + changes |= setunion(pfirst[i], pfirst[ch]) + if pempty[ch] == 0 { + break + } + } + } + } + } + + if indebug == 0 { + return + } + if foutput != nil { + for i = 0; i <= nnonter; i++ { + fmt.Fprintf(foutput, "\n%v: %v %v\n", + nontrst[i].name, pfirst[i], pempty[i]) + } + } +} + +// +// generate the states +// +func stagen() { + // initialize + nstate = 0 + tstates = make([]int, ntokens+1) // states generated by terminal gotos + ntstates = make([]int, nnonter+1) // states generated by nonterminal gotos + amem = make([]int, ACTSIZE) + memp = 0 + + clset = mkset() + pstate[0] = 0 + pstate[1] = 0 + aryfil(clset, tbitset, 0) + putitem(Pitem{prdptr[0], 0, 0, 0}, clset) + tystate[0] = MUSTDO + nstate = 1 + pstate[2] = pstate[1] + + // + // now, the main state generation loop + // first pass generates all of the states + // later passes fix up lookahead + // could be sped up a lot by remembering + // results of the first pass rather than recomputing + // + first := 1 + for more := 1; more != 0; first = 0 { + more = 0 + for i := 0; i < nstate; i++ { + if tystate[i] != MUSTDO { + continue + } + + tystate[i] = DONE + aryfil(temp1, nnonter+1, 0) + + // take state i, close it, and do gotos + closure(i) + + // generate goto's + for p := 0; p < cwp; p++ { + pi := wsets[p] + if pi.flag != 0 { + continue + } + wsets[p].flag = 1 + c := pi.pitem.first + if c <= 1 { + if pstate[i+1]-pstate[i] <= p { + tystate[i] = MUSTLOOKAHEAD + } + continue + } + + // do a goto on c + putitem(wsets[p].pitem, wsets[p].ws) + for q := p + 1; q < cwp; q++ { + // this item contributes to the goto + if c == wsets[q].pitem.first { + putitem(wsets[q].pitem, wsets[q].ws) + wsets[q].flag = 1 + } + } + + if c < NTBASE { + state(c) // register new state + } else { + temp1[c-NTBASE] = state(c) + } + } + + if gsdebug != 0 && foutput != nil { + fmt.Fprintf(foutput, "%v: ", i) + for j := 0; j <= nnonter; j++ { + if temp1[j] != 0 { + fmt.Fprintf(foutput, "%v %v,", nontrst[j].name, temp1[j]) + } + } + fmt.Fprintf(foutput, "\n") + } + + if first != 0 { + indgo[i] = apack(temp1[1:], nnonter-1) - 1 + } + + more++ + } + } +} + +// +// generate the closure of state i +// +func closure(i int) { + zzclose++ + + // first, copy kernel of state i to wsets + cwp = 0 + q := pstate[i+1] + for p := pstate[i]; p < q; p++ { + wsets[cwp].pitem = statemem[p].pitem + wsets[cwp].flag = 1 // this item must get closed + copy(wsets[cwp].ws, statemem[p].look) + cwp++ + } + + // now, go through the loop, closing each item + work := 1 + for work != 0 { + work = 0 + for u := 0; u < cwp; u++ { + if wsets[u].flag == 0 { + continue + } + + // dot is before c + c := wsets[u].pitem.first + if c < NTBASE { + wsets[u].flag = 0 + // only interesting case is where . is before nonterminal + continue + } + + // compute the lookahead + aryfil(clset, tbitset, 0) + + // find items involving c + for v := u; v < cwp; v++ { + if wsets[v].flag != 1 || wsets[v].pitem.first != c { + continue + } + pi := wsets[v].pitem.prod + ipi := wsets[v].pitem.off + 1 + + wsets[v].flag = 0 + if nolook != 0 { + continue + } + + ch := pi[ipi] + ipi++ + for ch > 0 { + // terminal symbol + if ch < NTBASE { + setbit(clset, ch) + break + } + + // nonterminal symbol + setunion(clset, pfirst[ch-NTBASE]) + if pempty[ch-NTBASE] == 0 { + break + } + ch = pi[ipi] + ipi++ + } + if ch <= 0 { + setunion(clset, wsets[v].ws) + } + } + + // + // now loop over productions derived from c + // + curres := pres[c-NTBASE] + n := len(curres) + + nexts: + // initially fill the sets + for s := 0; s < n; s++ { + prd := curres[s] + + // + // put these items into the closure + // is the item there + // + for v := 0; v < cwp; v++ { + // yes, it is there + if wsets[v].pitem.off == 0 && + aryeq(wsets[v].pitem.prod, prd) != 0 { + if nolook == 0 && + setunion(wsets[v].ws, clset) != 0 { + wsets[v].flag = 1 + work = 1 + } + continue nexts + } + } + + // not there; make a new entry + if cwp >= len(wsets) { + awsets := make([]Wset, cwp+WSETINC) + copy(awsets, wsets) + wsets = awsets + } + wsets[cwp].pitem = Pitem{prd, 0, prd[0], -prd[len(prd)-1]} + wsets[cwp].flag = 1 + wsets[cwp].ws = mkset() + if nolook == 0 { + work = 1 + copy(wsets[cwp].ws, clset) + } + cwp++ + } + } + } + + // have computed closure; flags are reset; return + if cldebug != 0 && foutput != nil { + fmt.Fprintf(foutput, "\nState %v, nolook = %v\n", i, nolook) + for u := 0; u < cwp; u++ { + if wsets[u].flag != 0 { + fmt.Fprintf(foutput, "flag set\n") + } + wsets[u].flag = 0 + fmt.Fprintf(foutput, "\t%v", writem(wsets[u].pitem)) + prlook(wsets[u].ws) + fmt.Fprintf(foutput, "\n") + } + } +} + +// +// sorts last state,and sees if it equals earlier ones. returns state number +// +func state(c int) int { + zzstate++ + p1 := pstate[nstate] + p2 := pstate[nstate+1] + if p1 == p2 { + return 0 // null state + } + + // sort the items + var k, l int + for k = p1 + 1; k < p2; k++ { // make k the biggest + for l = k; l > p1; l-- { + if statemem[l].pitem.prodno < statemem[l-1].pitem.prodno || + statemem[l].pitem.prodno == statemem[l-1].pitem.prodno && + statemem[l].pitem.off < statemem[l-1].pitem.off { + s := statemem[l] + statemem[l] = statemem[l-1] + statemem[l-1] = s + } else { + break + } + } + } + + size1 := p2 - p1 // size of state + + var i int + if c >= NTBASE { + i = ntstates[c-NTBASE] + } else { + i = tstates[c] + } + +look: + for ; i != 0; i = mstates[i] { + // get ith state + q1 := pstate[i] + q2 := pstate[i+1] + size2 := q2 - q1 + if size1 != size2 { + continue + } + k = p1 + for l = q1; l < q2; l++ { + if aryeq(statemem[l].pitem.prod, statemem[k].pitem.prod) == 0 || + statemem[l].pitem.off != statemem[k].pitem.off { + continue look + } + k++ + } + + // found it + pstate[nstate+1] = pstate[nstate] // delete last state + + // fix up lookaheads + if nolook != 0 { + return i + } + k = p1 + for l = q1; l < q2; l++ { + if setunion(statemem[l].look, statemem[k].look) != 0 { + tystate[i] = MUSTDO + } + k++ + } + return i + } + + // state is new + zznewstate++ + if nolook != 0 { + errorf("yacc state/nolook error") + } + pstate[nstate+2] = p2 + if nstate+1 >= NSTATES { + errorf("too many states") + } + if c >= NTBASE { + mstates[nstate] = ntstates[c-NTBASE] + ntstates[c-NTBASE] = nstate + } else { + mstates[nstate] = tstates[c] + tstates[c] = nstate + } + tystate[nstate] = MUSTDO + nstate++ + return nstate - 1 +} + +func putitem(p Pitem, set Lkset) { + p.off++ + p.first = p.prod[p.off] + + if pidebug != 0 && foutput != nil { + fmt.Fprintf(foutput, "putitem(%v), state %v\n", writem(p), nstate) + } + j := pstate[nstate+1] + if j >= len(statemem) { + asm := make([]Item, j+STATEINC) + copy(asm, statemem) + statemem = asm + } + statemem[j].pitem = p + if nolook == 0 { + s := mkset() + copy(s, set) + statemem[j].look = s + } + j++ + pstate[nstate+1] = j +} + +// +// creates output string for item pointed to by pp +// +func writem(pp Pitem) string { + var i int + + p := pp.prod + q := chcopy(nontrst[prdptr[pp.prodno][0]-NTBASE].name) + ": " + npi := pp.off + + pi := aryeq(p, prdptr[pp.prodno]) + + for { + c := ' ' + if pi == npi { + c = '.' + } + q += string(c) + + i = p[pi] + pi++ + if i <= 0 { + break + } + q += chcopy(symnam(i)) + } + + // an item calling for a reduction + i = p[npi] + if i < 0 { + q += fmt.Sprintf(" (%v)", -i) + } + + return q +} + +// +// pack state i from temp1 into amem +// +func apack(p []int, n int) int { + // + // we don't need to worry about checking because + // we will only look at entries known to be there... + // eliminate leading and trailing 0's + // + off := 0 + pp := 0 + for ; pp <= n && p[pp] == 0; pp++ { + off-- + } + + // no actions + if pp > n { + return 0 + } + for ; n > pp && p[n] == 0; n-- { + } + p = p[pp : n+1] + + // now, find a place for the elements from p to q, inclusive + r := len(amem) - len(p) + +nextk: + for rr := 0; rr <= r; rr++ { + qq := rr + for pp = 0; pp < len(p); pp++ { + if p[pp] != 0 { + if p[pp] != amem[qq] && amem[qq] != 0 { + continue nextk + } + } + qq++ + } + + // we have found an acceptable k + if pkdebug != 0 && foutput != nil { + fmt.Fprintf(foutput, "off = %v, k = %v\n", off+rr, rr) + } + qq = rr + for pp = 0; pp < len(p); pp++ { + if p[pp] != 0 { + if qq > memp { + memp = qq + } + amem[qq] = p[pp] + } + qq++ + } + if pkdebug != 0 && foutput != nil { + for pp = 0; pp <= memp; pp += 10 { + fmt.Fprintf(foutput, "\n") + for qq = pp; qq <= pp+9; qq++ { + fmt.Fprintf(foutput, "%v ", amem[qq]) + } + fmt.Fprintf(foutput, "\n") + } + } + return off + rr + } + errorf("no space in action table") + return 0 +} + +// +// print the output for the states +// +func output() { + var c, u, v int + + if !lflag { + fmt.Fprintf(ftable, "\n//line yacctab:1") + } + fmt.Fprintf(ftable, "\nvar %sExca = [...]int{\n", prefix) + + if len(errors) > 0 { + stateTable = make([]Row, nstate) + } + + noset := mkset() + + // output the stuff for state i + for i := 0; i < nstate; i++ { + nolook = 0 + if tystate[i] != MUSTLOOKAHEAD { + nolook = 1 + } + closure(i) + + // output actions + nolook = 1 + aryfil(temp1, ntokens+nnonter+1, 0) + for u = 0; u < cwp; u++ { + c = wsets[u].pitem.first + if c > 1 && c < NTBASE && temp1[c] == 0 { + for v = u; v < cwp; v++ { + if c == wsets[v].pitem.first { + putitem(wsets[v].pitem, noset) + } + } + temp1[c] = state(c) + } else if c > NTBASE { + c -= NTBASE + if temp1[c+ntokens] == 0 { + temp1[c+ntokens] = amem[indgo[i]+c] + } + } + } + if i == 1 { + temp1[1] = ACCEPTCODE + } + + // now, we have the shifts; look at the reductions + lastred = 0 + for u = 0; u < cwp; u++ { + c = wsets[u].pitem.first + + // reduction + if c > 0 { + continue + } + lastred = -c + us := wsets[u].ws + for k := 0; k <= ntokens; k++ { + if bitset(us, k) == 0 { + continue + } + if temp1[k] == 0 { + temp1[k] = c + } else if temp1[k] < 0 { // reduce/reduce conflict + if foutput != nil { + fmt.Fprintf(foutput, + "\n %v: reduce/reduce conflict (red'ns "+ + "%v and %v) on %v", + i, -temp1[k], lastred, symnam(k)) + } + if -temp1[k] > lastred { + temp1[k] = -lastred + } + zzrrconf++ + } else { + // potential shift/reduce conflict + precftn(lastred, k, i) + } + } + } + wract(i) + } + + fmt.Fprintf(ftable, "}\n") + ftable.WriteRune('\n') + fmt.Fprintf(ftable, "const %sNprod = %v\n", prefix, nprod) + fmt.Fprintf(ftable, "const %sPrivate = %v\n", prefix, PRIVATE) + ftable.WriteRune('\n') + fmt.Fprintf(ftable, "var %sTokenNames []string\n", prefix) + fmt.Fprintf(ftable, "var %sStates []string\n", prefix) +} + +// +// decide a shift/reduce conflict by precedence. +// r is a rule number, t a token number +// the conflict is in state s +// temp1[t] is changed to reflect the action +// +func precftn(r, t, s int) { + var action int + + lp := levprd[r] + lt := toklev[t] + if PLEVEL(lt) == 0 || PLEVEL(lp) == 0 { + // conflict + if foutput != nil { + fmt.Fprintf(foutput, + "\n%v: shift/reduce conflict (shift %v(%v), red'n %v(%v)) on %v", + s, temp1[t], PLEVEL(lt), r, PLEVEL(lp), symnam(t)) + } + zzsrconf++ + return + } + if PLEVEL(lt) == PLEVEL(lp) { + action = ASSOC(lt) + } else if PLEVEL(lt) > PLEVEL(lp) { + action = RASC // shift + } else { + action = LASC + } // reduce + switch action { + case BASC: // error action + temp1[t] = ERRCODE + case LASC: // reduce + temp1[t] = -r + } +} + +// +// output state i +// temp1 has the actions, lastred the default +// +func wract(i int) { + var p, p1 int + + // find the best choice for lastred + lastred = 0 + ntimes := 0 + for j := 0; j <= ntokens; j++ { + if temp1[j] >= 0 { + continue + } + if temp1[j]+lastred == 0 { + continue + } + // count the number of appearances of temp1[j] + count := 0 + tred := -temp1[j] + levprd[tred] |= REDFLAG + for p = 0; p <= ntokens; p++ { + if temp1[p]+tred == 0 { + count++ + } + } + if count > ntimes { + lastred = tred + ntimes = count + } + } + + // + // for error recovery, arrange that, if there is a shift on the + // error recovery token, `error', that the default be the error action + // + if temp1[2] > 0 { + lastred = 0 + } + + // clear out entries in temp1 which equal lastred + // count entries in optst table + n := 0 + for p = 0; p <= ntokens; p++ { + p1 = temp1[p] + if p1+lastred == 0 { + temp1[p] = 0 + p1 = 0 + } + if p1 > 0 && p1 != ACCEPTCODE && p1 != ERRCODE { + n++ + } + } + + wrstate(i) + defact[i] = lastred + flag := 0 + os := make([]int, n*2) + n = 0 + for p = 0; p <= ntokens; p++ { + p1 = temp1[p] + if p1 != 0 { + if p1 < 0 { + p1 = -p1 + } else if p1 == ACCEPTCODE { + p1 = -1 + } else if p1 == ERRCODE { + p1 = 0 + } else { + os[n] = p + n++ + os[n] = p1 + n++ + zzacent++ + continue + } + if flag == 0 { + fmt.Fprintf(ftable, "\t-1, %v,\n", i) + } + flag++ + fmt.Fprintf(ftable, "\t%v, %v,\n", p, p1) + zzexcp++ + } + } + if flag != 0 { + defact[i] = -2 + fmt.Fprintf(ftable, "\t-2, %v,\n", lastred) + } + optst[i] = os +} + +// +// writes state i +// +func wrstate(i int) { + var j0, j1, u int + var pp, qq int + + if len(errors) > 0 { + actions := append([]int(nil), temp1...) + defaultAction := ERRCODE + if lastred != 0 { + defaultAction = -lastred + } + stateTable[i] = Row{actions, defaultAction} + } + + if foutput == nil { + return + } + fmt.Fprintf(foutput, "\nstate %v\n", i) + qq = pstate[i+1] + for pp = pstate[i]; pp < qq; pp++ { + fmt.Fprintf(foutput, "\t%v\n", writem(statemem[pp].pitem)) + } + if tystate[i] == MUSTLOOKAHEAD { + // print out empty productions in closure + for u = pstate[i+1] - pstate[i]; u < cwp; u++ { + if wsets[u].pitem.first < 0 { + fmt.Fprintf(foutput, "\t%v\n", writem(wsets[u].pitem)) + } + } + } + + // check for state equal to another + for j0 = 0; j0 <= ntokens; j0++ { + j1 = temp1[j0] + if j1 != 0 { + fmt.Fprintf(foutput, "\n\t%v ", symnam(j0)) + + // shift, error, or accept + if j1 > 0 { + if j1 == ACCEPTCODE { + fmt.Fprintf(foutput, "accept") + } else if j1 == ERRCODE { + fmt.Fprintf(foutput, "error") + } else { + fmt.Fprintf(foutput, "shift %v", j1) + } + } else { + fmt.Fprintf(foutput, "reduce %v (src line %v)", -j1, rlines[-j1]) + } + } + } + + // output the final production + if lastred != 0 { + fmt.Fprintf(foutput, "\n\t. reduce %v (src line %v)\n\n", + lastred, rlines[lastred]) + } else { + fmt.Fprintf(foutput, "\n\t. error\n\n") + } + + // now, output nonterminal actions + j1 = ntokens + for j0 = 1; j0 <= nnonter; j0++ { + j1++ + if temp1[j1] != 0 { + fmt.Fprintf(foutput, "\t%v goto %v\n", symnam(j0+NTBASE), temp1[j1]) + } + } +} + +// +// output the gotos for the nontermninals +// +func go2out() { + for i := 1; i <= nnonter; i++ { + go2gen(i) + + // find the best one to make default + best := -1 + times := 0 + + // is j the most frequent + for j := 0; j < nstate; j++ { + if tystate[j] == 0 { + continue + } + if tystate[j] == best { + continue + } + + // is tystate[j] the most frequent + count := 0 + cbest := tystate[j] + for k := j; k < nstate; k++ { + if tystate[k] == cbest { + count++ + } + } + if count > times { + best = cbest + times = count + } + } + + // best is now the default entry + zzgobest += times - 1 + n := 0 + for j := 0; j < nstate; j++ { + if tystate[j] != 0 && tystate[j] != best { + n++ + } + } + goent := make([]int, 2*n+1) + n = 0 + for j := 0; j < nstate; j++ { + if tystate[j] != 0 && tystate[j] != best { + goent[n] = j + n++ + goent[n] = tystate[j] + n++ + zzgoent++ + } + } + + // now, the default + if best == -1 { + best = 0 + } + + zzgoent++ + goent[n] = best + yypgo[i] = goent + } +} + +// +// output the gotos for nonterminal c +// +func go2gen(c int) { + var i, cc, p, q int + + // first, find nonterminals with gotos on c + aryfil(temp1, nnonter+1, 0) + temp1[c] = 1 + work := 1 + for work != 0 { + work = 0 + for i = 0; i < nprod; i++ { + // cc is a nonterminal with a goto on c + cc = prdptr[i][1] - NTBASE + if cc >= 0 && temp1[cc] != 0 { + // thus, the left side of production i does too + cc = prdptr[i][0] - NTBASE + if temp1[cc] == 0 { + work = 1 + temp1[cc] = 1 + } + } + } + } + + // now, we have temp1[c] = 1 if a goto on c in closure of cc + if g2debug != 0 && foutput != nil { + fmt.Fprintf(foutput, "%v: gotos on ", nontrst[c].name) + for i = 0; i <= nnonter; i++ { + if temp1[i] != 0 { + fmt.Fprintf(foutput, "%v ", nontrst[i].name) + } + } + fmt.Fprintf(foutput, "\n") + } + + // now, go through and put gotos into tystate + aryfil(tystate, nstate, 0) + for i = 0; i < nstate; i++ { + q = pstate[i+1] + for p = pstate[i]; p < q; p++ { + cc = statemem[p].pitem.first + if cc >= NTBASE { + // goto on c is possible + if temp1[cc-NTBASE] != 0 { + tystate[i] = amem[indgo[i]+c] + break + } + } + } + } +} + +// +// in order to free up the mem and amem arrays for the optimizer, +// and still be able to output yyr1, etc., after the sizes of +// the action array is known, we hide the nonterminals +// derived by productions in levprd. +// +func hideprod() { + nred := 0 + levprd[0] = 0 + for i := 1; i < nprod; i++ { + if (levprd[i] & REDFLAG) == 0 { + if foutput != nil { + fmt.Fprintf(foutput, "Rule not reduced: %v\n", + writem(Pitem{prdptr[i], 0, 0, i})) + } + fmt.Printf("rule %v never reduced\n", writem(Pitem{prdptr[i], 0, 0, i})) + nred++ + } + levprd[i] = prdptr[i][0] - NTBASE + } + if nred != 0 { + fmt.Printf("%v rules never reduced\n", nred) + } +} + +func callopt() { + var j, k, p, q, i int + var v []int + + pgo = make([]int, nnonter+1) + pgo[0] = 0 + maxoff = 0 + maxspr = 0 + for i = 0; i < nstate; i++ { + k = 32000 + j = 0 + v = optst[i] + q = len(v) + for p = 0; p < q; p += 2 { + if v[p] > j { + j = v[p] + } + if v[p] < k { + k = v[p] + } + } + + // nontrivial situation + if k <= j { + // j is now the range + // j -= k; // call scj + if k > maxoff { + maxoff = k + } + } + tystate[i] = q + 2*j + if j > maxspr { + maxspr = j + } + } + + // initialize ggreed table + ggreed = make([]int, nnonter+1) + for i = 1; i <= nnonter; i++ { + ggreed[i] = 1 + j = 0 + + // minimum entry index is always 0 + v = yypgo[i] + q = len(v) - 1 + for p = 0; p < q; p += 2 { + ggreed[i] += 2 + if v[p] > j { + j = v[p] + } + } + ggreed[i] = ggreed[i] + 2*j + if j > maxoff { + maxoff = j + } + } + + // now, prepare to put the shift actions into the amem array + for i = 0; i < ACTSIZE; i++ { + amem[i] = 0 + } + maxa = 0 + for i = 0; i < nstate; i++ { + if tystate[i] == 0 && adb > 1 { + fmt.Fprintf(ftable, "State %v: null\n", i) + } + indgo[i] = yyFlag + } + + i = nxti() + for i != NOMORE { + if i >= 0 { + stin(i) + } else { + gin(-i) + } + i = nxti() + } + + // print amem array + if adb > 2 { + for p = 0; p <= maxa; p += 10 { + fmt.Fprintf(ftable, "%v ", p) + for i = 0; i < 10; i++ { + fmt.Fprintf(ftable, "%v ", amem[p+i]) + } + ftable.WriteRune('\n') + } + } + + aoutput() + osummary() +} + +// +// finds the next i +// +func nxti() int { + max := 0 + maxi := 0 + for i := 1; i <= nnonter; i++ { + if ggreed[i] >= max { + max = ggreed[i] + maxi = -i + } + } + for i := 0; i < nstate; i++ { + if tystate[i] >= max { + max = tystate[i] + maxi = i + } + } + if max == 0 { + return NOMORE + } + return maxi +} + +func gin(i int) { + var s int + + // enter gotos on nonterminal i into array amem + ggreed[i] = 0 + + q := yypgo[i] + nq := len(q) - 1 + + // now, find amem place for it +nextgp: + for p := 0; p < ACTSIZE; p++ { + if amem[p] != 0 { + continue + } + for r := 0; r < nq; r += 2 { + s = p + q[r] + 1 + if s > maxa { + maxa = s + if maxa >= ACTSIZE { + errorf("a array overflow") + } + } + if amem[s] != 0 { + continue nextgp + } + } + + // we have found amem spot + amem[p] = q[nq] + if p > maxa { + maxa = p + } + for r := 0; r < nq; r += 2 { + s = p + q[r] + 1 + amem[s] = q[r+1] + } + pgo[i] = p + if adb > 1 { + fmt.Fprintf(ftable, "Nonterminal %v, entry at %v\n", i, pgo[i]) + } + return + } + errorf("cannot place goto %v\n", i) +} + +func stin(i int) { + var s int + + tystate[i] = 0 + + // enter state i into the amem array + q := optst[i] + nq := len(q) + +nextn: + // find an acceptable place + for n := -maxoff; n < ACTSIZE; n++ { + flag := 0 + for r := 0; r < nq; r += 2 { + s = q[r] + n + if s < 0 || s > ACTSIZE { + continue nextn + } + if amem[s] == 0 { + flag++ + } else if amem[s] != q[r+1] { + continue nextn + } + } + + // check the position equals another only if the states are identical + for j := 0; j < nstate; j++ { + if indgo[j] == n { + + // we have some disagreement + if flag != 0 { + continue nextn + } + if nq == len(optst[j]) { + + // states are equal + indgo[i] = n + if adb > 1 { + fmt.Fprintf(ftable, "State %v: entry at"+ + "%v equals state %v\n", + i, n, j) + } + return + } + + // we have some disagreement + continue nextn + } + } + + for r := 0; r < nq; r += 2 { + s = q[r] + n + if s > maxa { + maxa = s + } + if amem[s] != 0 && amem[s] != q[r+1] { + errorf("clobber of a array, pos'n %v, by %v", s, q[r+1]) + } + amem[s] = q[r+1] + } + indgo[i] = n + if adb > 1 { + fmt.Fprintf(ftable, "State %v: entry at %v\n", i, indgo[i]) + } + return + } + errorf("Error; failure to place state %v", i) +} + +// +// this version is for limbo +// write out the optimized parser +// +func aoutput() { + ftable.WriteRune('\n') + fmt.Fprintf(ftable, "const %sLast = %v\n\n", prefix, maxa+1) + arout("Act", amem, maxa+1) + arout("Pact", indgo, nstate) + arout("Pgo", pgo, nnonter+1) +} + +// +// put out other arrays, copy the parsers +// +func others() { + var i, j int + + arout("R1", levprd, nprod) + aryfil(temp1, nprod, 0) + + // + //yyr2 is the number of rules for each production + // + for i = 1; i < nprod; i++ { + temp1[i] = len(prdptr[i]) - 2 + } + arout("R2", temp1, nprod) + + aryfil(temp1, nstate, -1000) + for i = 0; i <= ntokens; i++ { + for j := tstates[i]; j != 0; j = mstates[j] { + temp1[j] = i + } + } + for i = 0; i <= nnonter; i++ { + for j = ntstates[i]; j != 0; j = mstates[j] { + temp1[j] = -i + } + } + arout("Chk", temp1, nstate) + arout("Def", defact, nstate) + + // put out token translation tables + // table 1 has 0-256 + aryfil(temp1, 256, 0) + c := 0 + for i = 1; i <= ntokens; i++ { + j = tokset[i].value + if j >= 0 && j < 256 { + if temp1[j] != 0 { + fmt.Print("yacc bug -- cannot have 2 different Ts with same value\n") + fmt.Printf(" %s and %s\n", tokset[i].name, tokset[temp1[j]].name) + nerrors++ + } + temp1[j] = i + if j > c { + c = j + } + } + } + for i = 0; i <= c; i++ { + if temp1[i] == 0 { + temp1[i] = YYLEXUNK + } + } + arout("Tok1", temp1, c+1) + + // table 2 has PRIVATE-PRIVATE+256 + aryfil(temp1, 256, 0) + c = 0 + for i = 1; i <= ntokens; i++ { + j = tokset[i].value - PRIVATE + if j >= 0 && j < 256 { + if temp1[j] != 0 { + fmt.Print("yacc bug -- cannot have 2 different Ts with same value\n") + fmt.Printf(" %s and %s\n", tokset[i].name, tokset[temp1[j]].name) + nerrors++ + } + temp1[j] = i + if j > c { + c = j + } + } + } + arout("Tok2", temp1, c+1) + + // table 3 has everything else + fmt.Fprintf(ftable, "var %sTok3 = [...]int{\n\t", prefix) + c = 0 + for i = 1; i <= ntokens; i++ { + j = tokset[i].value + if j >= 0 && j < 256 { + continue + } + if j >= PRIVATE && j < 256+PRIVATE { + continue + } + + if c%5 != 0 { + ftable.WriteRune(' ') + } + fmt.Fprintf(ftable, "%d, %d,", j, i) + c++ + if c%5 == 0 { + fmt.Fprint(ftable, "\n\t") + } + } + if c%5 != 0 { + ftable.WriteRune(' ') + } + fmt.Fprintf(ftable, "%d,\n}\n", 0) + + // Custom error messages. + fmt.Fprintf(ftable, "\n") + fmt.Fprintf(ftable, "var %sErrorMessages = [...]struct {\n", prefix) + fmt.Fprintf(ftable, "\tstate int\n") + fmt.Fprintf(ftable, "\ttoken int\n") + fmt.Fprintf(ftable, "\tmsg string\n") + fmt.Fprintf(ftable, "}{\n") + for _, error := range errors { + lineno = error.lineno + state, token := runMachine(error.tokens) + fmt.Fprintf(ftable, "\t{%v, %v, %s},\n", state, token, error.msg) + } + fmt.Fprintf(ftable, "}\n") + + // copy parser text + ch := getrune(finput) + for ch != EOF { + ftable.WriteRune(ch) + ch = getrune(finput) + } + + // copy yaccpar + if !lflag { + fmt.Fprintf(ftable, "\n//line yaccpar:1\n") + } + + parts := strings.SplitN(yaccpar, prefix+"run()", 2) + fmt.Fprintf(ftable, "%v", parts[0]) + ftable.Write(fcode.Bytes()) + fmt.Fprintf(ftable, "%v", parts[1]) +} + +func runMachine(tokens []string) (state, token int) { + var stack []int + i := 0 + token = -1 + +Loop: + if token < 0 { + token = chfind(2, tokens[i]) + i++ + } + + row := stateTable[state] + + c := token + if token >= NTBASE { + c = token - NTBASE + ntokens + } + action := row.actions[c] + if action == 0 { + action = row.defaultAction + } + + switch { + case action == ACCEPTCODE: + errorf("tokens are accepted") + return + case action == ERRCODE: + if token >= NTBASE { + errorf("error at non-terminal token %s", symnam(token)) + } + return + case action > 0: + // Shift to state action. + stack = append(stack, state) + state = action + token = -1 + goto Loop + default: + // Reduce by production -action. + prod := prdptr[-action] + if rhsLen := len(prod) - 2; rhsLen > 0 { + n := len(stack) - rhsLen + state = stack[n] + stack = stack[:n] + } + if token >= 0 { + i-- + } + token = prod[0] + goto Loop + } +} + +func arout(s string, v []int, n int) { + s = prefix + s + fmt.Fprintf(ftable, "var %v = [...]int{\n", s) + for i := 0; i < n; i++ { + if i%10 == 0 { + fmt.Fprintf(ftable, "\n\t") + } else { + ftable.WriteRune(' ') + } + fmt.Fprintf(ftable, "%d,", v[i]) + } + fmt.Fprintf(ftable, "\n}\n") +} + +// +// output the summary on y.output +// +func summary() { + if foutput != nil { + fmt.Fprintf(foutput, "\n%v terminals, %v nonterminals\n", ntokens, nnonter+1) + fmt.Fprintf(foutput, "%v grammar rules, %v/%v states\n", nprod, nstate, NSTATES) + fmt.Fprintf(foutput, "%v shift/reduce, %v reduce/reduce conflicts reported\n", zzsrconf, zzrrconf) + fmt.Fprintf(foutput, "%v working sets used\n", len(wsets)) + fmt.Fprintf(foutput, "memory: parser %v/%v\n", memp, ACTSIZE) + fmt.Fprintf(foutput, "%v extra closures\n", zzclose-2*nstate) + fmt.Fprintf(foutput, "%v shift entries, %v exceptions\n", zzacent, zzexcp) + fmt.Fprintf(foutput, "%v goto entries\n", zzgoent) + fmt.Fprintf(foutput, "%v entries saved by goto default\n", zzgobest) + } + if zzsrconf != 0 || zzrrconf != 0 { + fmt.Printf("\nconflicts: ") + if zzsrconf != 0 { + fmt.Printf("%v shift/reduce", zzsrconf) + } + if zzsrconf != 0 && zzrrconf != 0 { + fmt.Printf(", ") + } + if zzrrconf != 0 { + fmt.Printf("%v reduce/reduce", zzrrconf) + } + fmt.Printf("\n") + } +} + +// +// write optimizer summary +// +func osummary() { + if foutput == nil { + return + } + i := 0 + for p := maxa; p >= 0; p-- { + if amem[p] == 0 { + i++ + } + } + + fmt.Fprintf(foutput, "Optimizer space used: output %v/%v\n", maxa+1, ACTSIZE) + fmt.Fprintf(foutput, "%v table entries, %v zero\n", maxa+1, i) + fmt.Fprintf(foutput, "maximum spread: %v, maximum offset: %v\n", maxspr, maxoff) +} + +// +// copies and protects "'s in q +// +func chcopy(q string) string { + s := "" + i := 0 + j := 0 + for i = 0; i < len(q); i++ { + if q[i] == '"' { + s += q[j:i] + "\\" + j = i + } + } + return s + q[j:i] +} + +func usage() { + fmt.Fprintf(stderr, "usage: yacc [-o output] [-v parsetable] input\n") + exit(1) +} + +func bitset(set Lkset, bit int) int { return set[bit>>5] & (1 << uint(bit&31)) } + +func setbit(set Lkset, bit int) { set[bit>>5] |= (1 << uint(bit&31)) } + +func mkset() Lkset { return make([]int, tbitset) } + +// +// set a to the union of a and b +// return 1 if b is not a subset of a, 0 otherwise +// +func setunion(a, b []int) int { + sub := 0 + for i := 0; i < tbitset; i++ { + x := a[i] + y := x | b[i] + a[i] = y + if y != x { + sub = 1 + } + } + return sub +} + +func prlook(p Lkset) { + if p == nil { + fmt.Fprintf(foutput, "\tNULL") + return + } + fmt.Fprintf(foutput, " { ") + for j := 0; j <= ntokens; j++ { + if bitset(p, j) != 0 { + fmt.Fprintf(foutput, "%v ", symnam(j)) + } + } + fmt.Fprintf(foutput, "}") +} + +// +// utility routines +// +var peekrune rune + +func isdigit(c rune) bool { return c >= '0' && c <= '9' } + +func isword(c rune) bool { + return c >= 0xa0 || c == '_' || (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') +} + +func mktemp(t string) string { return t } + +// +// return 1 if 2 arrays are equal +// return 0 if not equal +// +func aryeq(a []int, b []int) int { + n := len(a) + if len(b) != n { + return 0 + } + for ll := 0; ll < n; ll++ { + if a[ll] != b[ll] { + return 0 + } + } + return 1 +} + +func putrune(f *bufio.Writer, c int) { + s := string(c) + for i := 0; i < len(s); i++ { + f.WriteByte(s[i]) + } +} + +func getrune(f *bufio.Reader) rune { + var r rune + + if peekrune != 0 { + if peekrune == EOF { + return EOF + } + r = peekrune + peekrune = 0 + return r + } + + c, n, err := f.ReadRune() + if n == 0 { + return EOF + } + if err != nil { + errorf("read error: %v", err) + } + //fmt.Printf("rune = %v n=%v\n", string(c), n); + return c +} + +func ungetrune(f *bufio.Reader, c rune) { + if f != finput { + panic("ungetc - not finput") + } + if peekrune != 0 { + panic("ungetc - 2nd unget") + } + peekrune = c +} + +func write(f *bufio.Writer, b []byte, n int) int { + panic("write") +} + +func open(s string) *bufio.Reader { + fi, err := os.Open(s) + if err != nil { + errorf("error opening %v: %v", s, err) + } + //fmt.Printf("open %v\n", s); + return bufio.NewReader(fi) +} + +func create(s string) *bufio.Writer { + fo, err := os.Create(s) + if err != nil { + errorf("error creating %v: %v", s, err) + } + //fmt.Printf("create %v mode %v\n", s); + return bufio.NewWriter(fo) +} + +// +// write out error comment +// +func lerrorf(lineno int, s string, v ...interface{}) { + nerrors++ + fmt.Fprintf(stderr, s, v...) + fmt.Fprintf(stderr, ": %v:%v\n", infile, lineno) + if fatfl != 0 { + summary() + exit(1) + } +} + +func errorf(s string, v ...interface{}) { + lerrorf(lineno, s, v...) +} + +func exit(status int) { + if ftable != nil { + ftable.Flush() + ftable = nil + gofmt() + } + if foutput != nil { + foutput.Flush() + foutput = nil + } + if stderr != nil { + stderr.Flush() + stderr = nil + } + os.Exit(status) +} + +func gofmt() { + src, err := ioutil.ReadFile(oflag) + if err != nil { + return + } + src, err = format.Source(src) + if err != nil { + return + } + ioutil.WriteFile(oflag, src, 0666) +} + +var yaccpar string // will be processed version of yaccpartext: s/$$/prefix/g +var yaccpartext = ` +/* parser for yacc output */ + +var ( + $$Debug = 0 + $$ErrorVerbose = false +) + +type $$Lexer interface { + Lex(lval *$$SymType) int + Error(s string) +} + +type $$Parser interface { + Parse($$Lexer) int + Lookahead() int +} + +type $$ParserImpl struct { + lookahead func() int +} + +func (p *$$ParserImpl) Lookahead() int { + return p.lookahead() +} + +func $$NewParser() $$Parser { + p := &$$ParserImpl{ + lookahead: func() int { return -1 }, + } + return p +} + +const $$Flag = -1000 + +func $$Tokname(c int) string { + if c >= 1 && c-1 < len($$Toknames) { + if $$Toknames[c-1] != "" { + return $$Toknames[c-1] + } + } + return __yyfmt__.Sprintf("tok-%v", c) +} + +func $$Statname(s int) string { + if s >= 0 && s < len($$Statenames) { + if $$Statenames[s] != "" { + return $$Statenames[s] + } + } + return __yyfmt__.Sprintf("state-%v", s) +} + +func $$ErrorMessage(state, lookAhead int) string { + const TOKSTART = 4 + + if !$$ErrorVerbose { + return "syntax error" + } + + for _, e := range $$ErrorMessages { + if e.state == state && e.token == lookAhead { + return "syntax error: " + e.msg + } + } + + res := "syntax error: unexpected " + $$Tokname(lookAhead) + + // To match Bison, suggest at most four expected tokens. + expected := make([]int, 0, 4) + + // Look for shiftable tokens. + base := $$Pact[state] + for tok := TOKSTART; tok-1 < len($$Toknames); tok++ { + if n := base + tok; n >= 0 && n < $$Last && $$Chk[$$Act[n]] == tok { + if len(expected) == cap(expected) { + return res + } + expected = append(expected, tok) + } + } + + if $$Def[state] == -2 { + i := 0 + for $$Exca[i] != -1 || $$Exca[i+1] != state { + i += 2 + } + + // Look for tokens that we accept or reduce. + for i += 2; $$Exca[i] >= 0; i += 2 { + tok := $$Exca[i] + if tok < TOKSTART || $$Exca[i+1] == 0 { + continue + } + if len(expected) == cap(expected) { + return res + } + expected = append(expected, tok) + } + + // If the default action is to accept or reduce, give up. + if $$Exca[i+1] != 0 { + return res + } + } + + for i, tok := range expected { + if i == 0 { + res += ", expecting " + } else { + res += " or " + } + res += $$Tokname(tok) + } + return res +} + +func $$lex1(lex $$Lexer, lval *$$SymType) (char, token int) { + token = 0 + char = lex.Lex(lval) + if char <= 0 { + token = $$Tok1[0] + goto out + } + if char < len($$Tok1) { + token = $$Tok1[char] + goto out + } + if char >= $$Private { + if char < $$Private+len($$Tok2) { + token = $$Tok2[char-$$Private] + goto out + } + } + for i := 0; i < len($$Tok3); i += 2 { + token = $$Tok3[i+0] + if token == char { + token = $$Tok3[i+1] + goto out + } + } + +out: + if token == 0 { + token = $$Tok2[1] /* unknown char */ + } + if $$Debug >= 3 { + __yyfmt__.Printf("lex %s(%d)\n", $$Tokname(token), uint(char)) + } + return char, token +} + +func $$Parse($$lex $$Lexer) int { + return $$NewParser().Parse($$lex) +} + +func ($$rcvr *$$ParserImpl) Parse($$lex $$Lexer) int { + var $$n int + var $$lval $$SymType + var $$VAL $$SymType + var $$Dollar []$$SymType + _ = $$Dollar // silence set and not used + $$S := make([]$$SymType, $$MaxDepth) + + Nerrs := 0 /* number of errors */ + Errflag := 0 /* error recovery flag */ + $$state := 0 + $$char := -1 + $$token := -1 // $$char translated into internal numbering + $$rcvr.lookahead = func() int { return $$char } + defer func() { + // Make sure we report no lookahead when not parsing. + $$state = -1 + $$char = -1 + $$token = -1 + }() + $$p := -1 + goto $$stack + +ret0: + return 0 + +ret1: + return 1 + +$$stack: + /* put a state and value onto the stack */ + if $$Debug >= 4 { + __yyfmt__.Printf("char %v in %v\n", $$Tokname($$token), $$Statname($$state)) + } + + $$p++ + if $$p >= len($$S) { + nyys := make([]$$SymType, len($$S)*2) + copy(nyys, $$S) + $$S = nyys + } + $$S[$$p] = $$VAL + $$S[$$p].yys = $$state + +$$newstate: + $$n = $$Pact[$$state] + if $$n <= $$Flag { + goto $$default /* simple state */ + } + if $$char < 0 { + $$char, $$token = $$lex1($$lex, &$$lval) + } + $$n += $$token + if $$n < 0 || $$n >= $$Last { + goto $$default + } + $$n = $$Act[$$n] + if $$Chk[$$n] == $$token { /* valid shift */ + $$char = -1 + $$token = -1 + $$VAL = $$lval + $$state = $$n + if Errflag > 0 { + Errflag-- + } + goto $$stack + } + +$$default: + /* default state action */ + $$n = $$Def[$$state] + if $$n == -2 { + if $$char < 0 { + $$char, $$token = $$lex1($$lex, &$$lval) + } + + /* look through exception table */ + xi := 0 + for { + if $$Exca[xi+0] == -1 && $$Exca[xi+1] == $$state { + break + } + xi += 2 + } + for xi += 2; ; xi += 2 { + $$n = $$Exca[xi+0] + if $$n < 0 || $$n == $$token { + break + } + } + $$n = $$Exca[xi+1] + if $$n < 0 { + goto ret0 + } + } + if $$n == 0 { + /* error ... attempt to resume parsing */ + switch Errflag { + case 0: /* brand new error */ + $$lex.Error($$ErrorMessage($$state, $$token)) + Nerrs++ + if $$Debug >= 1 { + __yyfmt__.Printf("%s", $$Statname($$state)) + __yyfmt__.Printf(" saw %s\n", $$Tokname($$token)) + } + fallthrough + + case 1, 2: /* incompletely recovered error ... try again */ + Errflag = 3 + + /* find a state where "error" is a legal shift action */ + for $$p >= 0 { + $$n = $$Pact[$$S[$$p].yys] + $$ErrCode + if $$n >= 0 && $$n < $$Last { + $$state = $$Act[$$n] /* simulate a shift of "error" */ + if $$Chk[$$state] == $$ErrCode { + goto $$stack + } + } + + /* the current p has no shift on "error", pop stack */ + if $$Debug >= 2 { + __yyfmt__.Printf("error recovery pops state %d\n", $$S[$$p].yys) + } + $$p-- + } + /* there is no state on the stack with an error shift ... abort */ + goto ret1 + + case 3: /* no shift yet; clobber input char */ + if $$Debug >= 2 { + __yyfmt__.Printf("error recovery discards %s\n", $$Tokname($$token)) + } + if $$token == $$EofCode { + goto ret1 + } + $$char = -1 + $$token = -1 + goto $$newstate /* try again in the same state */ + } + } + + /* reduction by production $$n */ + if $$Debug >= 2 { + __yyfmt__.Printf("reduce %v in:\n\t%v\n", $$n, $$Statname($$state)) + } + + $$nt := $$n + $$pt := $$p + _ = $$pt // guard against "declared and not used" + + $$p -= $$R2[$$n] + // $$p is now the index of $0. Perform the default action. Iff the + // reduced production is ε, $1 is possibly out of range. + if $$p+1 >= len($$S) { + nyys := make([]$$SymType, len($$S)*2) + copy(nyys, $$S) + $$S = nyys + } + $$VAL = $$S[$$p+1] + + /* consult goto table to find next state */ + $$n = $$R1[$$n] + $$g := $$Pgo[$$n] + $$j := $$g + $$S[$$p].yys + 1 + + if $$j >= $$Last { + $$state = $$Act[$$g] + } else { + $$state = $$Act[$$j] + if $$Chk[$$state] != -$$n { + $$state = $$Act[$$g] + } + } + // dummy call; replaced with literal code + $$run() + goto $$stack /* stack new state and value */ +} +` diff --git a/src/compress/bzip2/bit_reader.go b/src/compress/bzip2/bit_reader.go new file mode 100644 index 0000000000000000000000000000000000000000..32d1036ae1b759df5f4094e5641867e1b8555038 --- /dev/null +++ b/src/compress/bzip2/bit_reader.go @@ -0,0 +1,90 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package bzip2 + +import ( + "bufio" + "io" +) + +// bitReader wraps an io.Reader and provides the ability to read values, +// bit-by-bit, from it. Its Read* methods don't return the usual error +// because the error handling was verbose. Instead, any error is kept and can +// be checked afterwards. +type bitReader struct { + r io.ByteReader + n uint64 + bits uint + err error +} + +// newBitReader returns a new bitReader reading from r. If r is not +// already an io.ByteReader, it will be converted via a bufio.Reader. +func newBitReader(r io.Reader) bitReader { + byter, ok := r.(io.ByteReader) + if !ok { + byter = bufio.NewReader(r) + } + return bitReader{r: byter} +} + +// ReadBits64 reads the given number of bits and returns them in the +// least-significant part of a uint64. In the event of an error, it returns 0 +// and the error can be obtained by calling Err(). +func (br *bitReader) ReadBits64(bits uint) (n uint64) { + for bits > br.bits { + b, err := br.r.ReadByte() + if err == io.EOF { + err = io.ErrUnexpectedEOF + } + if err != nil { + br.err = err + return 0 + } + br.n <<= 8 + br.n |= uint64(b) + br.bits += 8 + } + + // br.n looks like this (assuming that br.bits = 14 and bits = 6): + // Bit: 111111 + // 5432109876543210 + // + // (6 bits, the desired output) + // |-----| + // V V + // 0101101101001110 + // ^ ^ + // |------------| + // br.bits (num valid bits) + // + // This the next line right shifts the desired bits into the + // least-significant places and masks off anything above. + n = (br.n >> (br.bits - bits)) & ((1 << bits) - 1) + br.bits -= bits + return +} + +func (br *bitReader) ReadBits(bits uint) (n int) { + n64 := br.ReadBits64(bits) + return int(n64) +} + +func (br *bitReader) ReadBit() bool { + n := br.ReadBits(1) + return n != 0 +} + +func (br *bitReader) TryReadBit() (bit byte, ok bool) { + if br.bits > 0 { + br.bits-- + return byte(br.n>>br.bits) & 1, true + } + return 0, false +} + +func (br *bitReader) Err() error { + return br.err +} diff --git a/src/compress/bzip2/bzip2.go b/src/compress/bzip2/bzip2.go new file mode 100644 index 0000000000000000000000000000000000000000..689795727089d9b16b1e740f9ef1b390a11cd1ac --- /dev/null +++ b/src/compress/bzip2/bzip2.go @@ -0,0 +1,503 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package bzip2 implements bzip2 decompression. +package bzip2 + +import "io" + +// There's no RFC for bzip2. I used the Wikipedia page for reference and a lot +// of guessing: http://en.wikipedia.org/wiki/Bzip2 +// The source code to pyflate was useful for debugging: +// http://www.paul.sladen.org/projects/pyflate + +// A StructuralError is returned when the bzip2 data is found to be +// syntactically invalid. +type StructuralError string + +func (s StructuralError) Error() string { + return "bzip2 data invalid: " + string(s) +} + +// A reader decompresses bzip2 compressed data. +type reader struct { + br bitReader + fileCRC uint32 + blockCRC uint32 + wantBlockCRC uint32 + setupDone bool // true if we have parsed the bzip2 header. + blockSize int // blockSize in bytes, i.e. 900 * 1024. + eof bool + buf []byte // stores Burrows-Wheeler transformed data. + c [256]uint // the `C' array for the inverse BWT. + tt []uint32 // mirrors the `tt' array in the bzip2 source and contains the P array in the upper 24 bits. + tPos uint32 // Index of the next output byte in tt. + + preRLE []uint32 // contains the RLE data still to be processed. + preRLEUsed int // number of entries of preRLE used. + lastByte int // the last byte value seen. + byteRepeats uint // the number of repeats of lastByte seen. + repeats uint // the number of copies of lastByte to output. +} + +// NewReader returns an io.Reader which decompresses bzip2 data from r. +// If r does not also implement io.ByteReader, +// the decompressor may read more data than necessary from r. +func NewReader(r io.Reader) io.Reader { + bz2 := new(reader) + bz2.br = newBitReader(r) + return bz2 +} + +const bzip2FileMagic = 0x425a // "BZ" +const bzip2BlockMagic = 0x314159265359 +const bzip2FinalMagic = 0x177245385090 + +// setup parses the bzip2 header. +func (bz2 *reader) setup(needMagic bool) error { + br := &bz2.br + + if needMagic { + magic := br.ReadBits(16) + if magic != bzip2FileMagic { + return StructuralError("bad magic value") + } + } + + t := br.ReadBits(8) + if t != 'h' { + return StructuralError("non-Huffman entropy encoding") + } + + level := br.ReadBits(8) + if level < '1' || level > '9' { + return StructuralError("invalid compression level") + } + + bz2.fileCRC = 0 + bz2.blockSize = 100 * 1024 * (int(level) - '0') + if bz2.blockSize > len(bz2.tt) { + bz2.tt = make([]uint32, bz2.blockSize) + } + return nil +} + +func (bz2 *reader) Read(buf []byte) (n int, err error) { + if bz2.eof { + return 0, io.EOF + } + + if !bz2.setupDone { + err = bz2.setup(true) + brErr := bz2.br.Err() + if brErr != nil { + err = brErr + } + if err != nil { + return 0, err + } + bz2.setupDone = true + } + + n, err = bz2.read(buf) + brErr := bz2.br.Err() + if brErr != nil { + err = brErr + } + return +} + +func (bz2 *reader) readFromBlock(buf []byte) int { + // bzip2 is a block based compressor, except that it has a run-length + // preprocessing step. The block based nature means that we can + // preallocate fixed-size buffers and reuse them. However, the RLE + // preprocessing would require allocating huge buffers to store the + // maximum expansion. Thus we process blocks all at once, except for + // the RLE which we decompress as required. + n := 0 + for (bz2.repeats > 0 || bz2.preRLEUsed < len(bz2.preRLE)) && n < len(buf) { + // We have RLE data pending. + + // The run-length encoding works like this: + // Any sequence of four equal bytes is followed by a length + // byte which contains the number of repeats of that byte to + // include. (The number of repeats can be zero.) Because we are + // decompressing on-demand our state is kept in the reader + // object. + + if bz2.repeats > 0 { + buf[n] = byte(bz2.lastByte) + n++ + bz2.repeats-- + if bz2.repeats == 0 { + bz2.lastByte = -1 + } + continue + } + + bz2.tPos = bz2.preRLE[bz2.tPos] + b := byte(bz2.tPos) + bz2.tPos >>= 8 + bz2.preRLEUsed++ + + if bz2.byteRepeats == 3 { + bz2.repeats = uint(b) + bz2.byteRepeats = 0 + continue + } + + if bz2.lastByte == int(b) { + bz2.byteRepeats++ + } else { + bz2.byteRepeats = 0 + } + bz2.lastByte = int(b) + + buf[n] = b + n++ + } + + return n +} + +func (bz2 *reader) read(buf []byte) (int, error) { + for { + n := bz2.readFromBlock(buf) + if n > 0 { + bz2.blockCRC = updateCRC(bz2.blockCRC, buf[:n]) + return n, nil + } + + // End of block. Check CRC. + if bz2.blockCRC != bz2.wantBlockCRC { + bz2.br.err = StructuralError("block checksum mismatch") + return 0, bz2.br.err + } + + // Find next block. + br := &bz2.br + switch br.ReadBits64(48) { + default: + return 0, StructuralError("bad magic value found") + + case bzip2BlockMagic: + // Start of block. + err := bz2.readBlock() + if err != nil { + return 0, err + } + + case bzip2FinalMagic: + // Check end-of-file CRC. + wantFileCRC := uint32(br.ReadBits64(32)) + if br.err != nil { + return 0, br.err + } + if bz2.fileCRC != wantFileCRC { + br.err = StructuralError("file checksum mismatch") + return 0, br.err + } + + // Skip ahead to byte boundary. + // Is there a file concatenated to this one? + // It would start with BZ. + if br.bits%8 != 0 { + br.ReadBits(br.bits % 8) + } + b, err := br.r.ReadByte() + if err == io.EOF { + br.err = io.EOF + bz2.eof = true + return 0, io.EOF + } + if err != nil { + br.err = err + return 0, err + } + z, err := br.r.ReadByte() + if err != nil { + if err == io.EOF { + err = io.ErrUnexpectedEOF + } + br.err = err + return 0, err + } + if b != 'B' || z != 'Z' { + return 0, StructuralError("bad magic value in continuation file") + } + if err := bz2.setup(false); err != nil { + return 0, err + } + } + } +} + +// readBlock reads a bzip2 block. The magic number should already have been consumed. +func (bz2 *reader) readBlock() (err error) { + br := &bz2.br + bz2.wantBlockCRC = uint32(br.ReadBits64(32)) // skip checksum. TODO: check it if we can figure out what it is. + bz2.blockCRC = 0 + bz2.fileCRC = (bz2.fileCRC<<1 | bz2.fileCRC>>31) ^ bz2.wantBlockCRC + randomized := br.ReadBits(1) + if randomized != 0 { + return StructuralError("deprecated randomized files") + } + origPtr := uint(br.ReadBits(24)) + + // If not every byte value is used in the block (i.e., it's text) then + // the symbol set is reduced. The symbols used are stored as a + // two-level, 16x16 bitmap. + symbolRangeUsedBitmap := br.ReadBits(16) + symbolPresent := make([]bool, 256) + numSymbols := 0 + for symRange := uint(0); symRange < 16; symRange++ { + if symbolRangeUsedBitmap&(1<<(15-symRange)) != 0 { + bits := br.ReadBits(16) + for symbol := uint(0); symbol < 16; symbol++ { + if bits&(1<<(15-symbol)) != 0 { + symbolPresent[16*symRange+symbol] = true + numSymbols++ + } + } + } + } + + if numSymbols == 0 { + // There must be an EOF symbol. + return StructuralError("no symbols in input") + } + + // A block uses between two and six different Huffman trees. + numHuffmanTrees := br.ReadBits(3) + if numHuffmanTrees < 2 || numHuffmanTrees > 6 { + return StructuralError("invalid number of Huffman trees") + } + + // The Huffman tree can switch every 50 symbols so there's a list of + // tree indexes telling us which tree to use for each 50 symbol block. + numSelectors := br.ReadBits(15) + treeIndexes := make([]uint8, numSelectors) + + // The tree indexes are move-to-front transformed and stored as unary + // numbers. + mtfTreeDecoder := newMTFDecoderWithRange(numHuffmanTrees) + for i := range treeIndexes { + c := 0 + for { + inc := br.ReadBits(1) + if inc == 0 { + break + } + c++ + } + if c >= numHuffmanTrees { + return StructuralError("tree index too large") + } + treeIndexes[i] = uint8(mtfTreeDecoder.Decode(c)) + } + + // The list of symbols for the move-to-front transform is taken from + // the previously decoded symbol bitmap. + symbols := make([]byte, numSymbols) + nextSymbol := 0 + for i := 0; i < 256; i++ { + if symbolPresent[i] { + symbols[nextSymbol] = byte(i) + nextSymbol++ + } + } + mtf := newMTFDecoder(symbols) + + numSymbols += 2 // to account for RUNA and RUNB symbols + huffmanTrees := make([]huffmanTree, numHuffmanTrees) + + // Now we decode the arrays of code-lengths for each tree. + lengths := make([]uint8, numSymbols) + for i := range huffmanTrees { + // The code lengths are delta encoded from a 5-bit base value. + length := br.ReadBits(5) + for j := range lengths { + for { + if !br.ReadBit() { + break + } + if br.ReadBit() { + length-- + } else { + length++ + } + } + if length < 0 || length > 20 { + return StructuralError("Huffman length out of range") + } + lengths[j] = uint8(length) + } + huffmanTrees[i], err = newHuffmanTree(lengths) + if err != nil { + return err + } + } + + selectorIndex := 1 // the next tree index to use + if len(treeIndexes) == 0 { + return StructuralError("no tree selectors given") + } + if int(treeIndexes[0]) >= len(huffmanTrees) { + return StructuralError("tree selector out of range") + } + currentHuffmanTree := huffmanTrees[treeIndexes[0]] + bufIndex := 0 // indexes bz2.buf, the output buffer. + // The output of the move-to-front transform is run-length encoded and + // we merge the decoding into the Huffman parsing loop. These two + // variables accumulate the repeat count. See the Wikipedia page for + // details. + repeat := 0 + repeatPower := 0 + + // The `C' array (used by the inverse BWT) needs to be zero initialized. + for i := range bz2.c { + bz2.c[i] = 0 + } + + decoded := 0 // counts the number of symbols decoded by the current tree. + for { + if decoded == 50 { + if selectorIndex >= numSelectors { + return StructuralError("insufficient selector indices for number of symbols") + } + if int(treeIndexes[selectorIndex]) >= len(huffmanTrees) { + return StructuralError("tree selector out of range") + } + currentHuffmanTree = huffmanTrees[treeIndexes[selectorIndex]] + selectorIndex++ + decoded = 0 + } + + v := currentHuffmanTree.Decode(br) + decoded++ + + if v < 2 { + // This is either the RUNA or RUNB symbol. + if repeat == 0 { + repeatPower = 1 + } + repeat += repeatPower << v + repeatPower <<= 1 + + // This limit of 2 million comes from the bzip2 source + // code. It prevents repeat from overflowing. + if repeat > 2*1024*1024 { + return StructuralError("repeat count too large") + } + continue + } + + if repeat > 0 { + // We have decoded a complete run-length so we need to + // replicate the last output symbol. + if repeat > bz2.blockSize-bufIndex { + return StructuralError("repeats past end of block") + } + for i := 0; i < repeat; i++ { + b := byte(mtf.First()) + bz2.tt[bufIndex] = uint32(b) + bz2.c[b]++ + bufIndex++ + } + repeat = 0 + } + + if int(v) == numSymbols-1 { + // This is the EOF symbol. Because it's always at the + // end of the move-to-front list, and never gets moved + // to the front, it has this unique value. + break + } + + // Since two metasymbols (RUNA and RUNB) have values 0 and 1, + // one would expect |v-2| to be passed to the MTF decoder. + // However, the front of the MTF list is never referenced as 0, + // it's always referenced with a run-length of 1. Thus 0 + // doesn't need to be encoded and we have |v-1| in the next + // line. + b := byte(mtf.Decode(int(v - 1))) + if bufIndex >= bz2.blockSize { + return StructuralError("data exceeds block size") + } + bz2.tt[bufIndex] = uint32(b) + bz2.c[b]++ + bufIndex++ + } + + if origPtr >= uint(bufIndex) { + return StructuralError("origPtr out of bounds") + } + + // We have completed the entropy decoding. Now we can perform the + // inverse BWT and setup the RLE buffer. + bz2.preRLE = bz2.tt[:bufIndex] + bz2.preRLEUsed = 0 + bz2.tPos = inverseBWT(bz2.preRLE, origPtr, bz2.c[:]) + bz2.lastByte = -1 + bz2.byteRepeats = 0 + bz2.repeats = 0 + + return nil +} + +// inverseBWT implements the inverse Burrows-Wheeler transform as described in +// http://www.hpl.hp.com/techreports/Compaq-DEC/SRC-RR-124.pdf, section 4.2. +// In that document, origPtr is called `I' and c is the `C' array after the +// first pass over the data. It's an argument here because we merge the first +// pass with the Huffman decoding. +// +// This also implements the `single array' method from the bzip2 source code +// which leaves the output, still shuffled, in the bottom 8 bits of tt with the +// index of the next byte in the top 24-bits. The index of the first byte is +// returned. +func inverseBWT(tt []uint32, origPtr uint, c []uint) uint32 { + sum := uint(0) + for i := 0; i < 256; i++ { + sum += c[i] + c[i] = sum - c[i] + } + + for i := range tt { + b := tt[i] & 0xff + tt[c[b]] |= uint32(i) << 8 + c[b]++ + } + + return tt[origPtr] >> 8 +} + +// This is a standard CRC32 like in hash/crc32 except that all the shifts are reversed, +// causing the bits in the input to be processed in the reverse of the usual order. + +var crctab [256]uint32 + +func init() { + const poly = 0x04C11DB7 + for i := range crctab { + crc := uint32(i) << 24 + for j := 0; j < 8; j++ { + if crc&0x80000000 != 0 { + crc = (crc << 1) ^ poly + } else { + crc <<= 1 + } + } + crctab[i] = crc + } +} + +// updateCRC updates the crc value to incorporate the data in b. +// The initial value is 0. +func updateCRC(val uint32, b []byte) uint32 { + crc := ^val + for _, v := range b { + crc = crctab[byte(crc>>24)^v] ^ (crc << 8) + } + return ^crc +} diff --git a/src/compress/bzip2/bzip2_test.go b/src/compress/bzip2/bzip2_test.go new file mode 100644 index 0000000000000000000000000000000000000000..77c50dfe948b6dc9c52b0a693ba50228431bf2d2 --- /dev/null +++ b/src/compress/bzip2/bzip2_test.go @@ -0,0 +1,419 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package bzip2 + +import ( + "bytes" + "encoding/base64" + "encoding/hex" + "io" + "io/ioutil" + "testing" +) + +func TestBitReader(t *testing.T) { + buf := bytes.NewReader([]byte{0xaa}) + br := newBitReader(buf) + if n := br.ReadBits(1); n != 1 { + t.Errorf("read 1 wrong") + } + if n := br.ReadBits(1); n != 0 { + t.Errorf("read 2 wrong") + } + if n := br.ReadBits(1); n != 1 { + t.Errorf("read 3 wrong") + } + if n := br.ReadBits(1); n != 0 { + t.Errorf("read 4 wrong") + } +} + +func TestBitReaderLarge(t *testing.T) { + buf := bytes.NewReader([]byte{0x12, 0x34, 0x56, 0x78}) + br := newBitReader(buf) + if n := br.ReadBits(32); n != 0x12345678 { + t.Errorf("got: %x want: %x", n, 0x12345678) + } +} + +func readerFromHex(s string) io.Reader { + data, err := hex.DecodeString(s) + if err != nil { + panic("readerFromHex: bad input") + } + return bytes.NewReader(data) +} + +func decompressHex(s string) (out []byte, err error) { + r := NewReader(readerFromHex(s)) + return ioutil.ReadAll(r) +} + +func TestHelloWorldBZ2(t *testing.T) { + out, err := decompressHex(helloWorldBZ2Hex) + if err != nil { + t.Errorf("error from Read: %s", err) + return + } + + if !bytes.Equal(helloWorld, out) { + t.Errorf("got %x, want %x", out, helloWorld) + } +} + +func TestConcat(t *testing.T) { + out, err := decompressHex(helloWorldBZ2Hex + helloWorldBZ2Hex) + if err != nil { + t.Errorf("error from Read: %s", err) + return + } + + hello2 := bytes.Repeat(helloWorld, 2) + if !bytes.Equal(hello2, out) { + t.Errorf("got %x, want %x", out, hello2) + } +} + +func testZeros(t *testing.T, inHex string, n int) { + out, err := decompressHex(inHex) + if err != nil { + t.Errorf("error from Read: %s", err) + return + } + + expected := make([]byte, n) + + if !bytes.Equal(expected, out) { + allZeros := true + for _, b := range out { + if b != 0 { + allZeros = false + break + } + } + t.Errorf("incorrect result, got %d bytes (allZeros: %t)", len(out), allZeros) + } +} + +func Test32Zeros(t *testing.T) { + testZeros(t, thirtyTwoZerosBZ2Hex, 32) +} + +func Test1MBZeros(t *testing.T) { + testZeros(t, oneMBZerosBZ2Hex, 1024*1024) +} + +func testRandomData(t *testing.T, compressedHex, uncompressedHex string) { + out, err := decompressHex(compressedHex) + if err != nil { + t.Errorf("error from Read: %s", err) + return + } + + expected, _ := hex.DecodeString(uncompressedHex) + + if !bytes.Equal(out, expected) { + t.Errorf("incorrect result\ngot: %x\nwant: %x", out, expected) + } +} + +func TestRandomData1(t *testing.T) { + testRandomData(t, randBZ2Hex, randHex) +} + +func TestRandomData2(t *testing.T) { + // This test involves several repeated bytes in the output, but they + // should trigger RLE decoding. + testRandomData(t, rand2BZ2Hex, rand2Hex) +} + +func TestRandomData3(t *testing.T) { + // This test uses the full range of symbols. + testRandomData(t, rand3BZ2Hex, rand3Hex) +} + +func Test1MBSawtooth(t *testing.T) { + out, err := decompressHex(oneMBSawtoothBZ2Hex) + if err != nil { + t.Errorf("error from Read: %s", err) + return + } + + expected := make([]byte, 1024*1024) + + for i := range expected { + expected[i] = byte(i) + } + + if !bytes.Equal(out, expected) { + t.Error("incorrect result") + } +} + +const helloWorldBZ2Hex = "425a68393141592653594eece83600000251800010400006449080200031064c4101a7a9a580bb9431f8bb9229c28482776741b0" + +var helloWorld = []byte("hello world\n") + +const thirtyTwoZerosBZ2Hex = "425a6839314159265359b5aa5098000000600040000004200021008283177245385090b5aa5098" +const oneMBZerosBZ2Hex = "425a683931415926535938571ce50008084000c0040008200030cc0529a60806c4201e2ee48a70a12070ae39ca" + +const randBZ2Hex = "425a6839314159265359905d990d0001957fffffffffffafffffffffffffffffbfff6fffdfffffffffffffffffffffffffffffc002b6dd75676ed5b77720098320d11a64626981323d4da47a83131a13d09e8040f534cd4f4d27a464d193008cd09804601347a980026350c9886234d36864193d1351b44c136919e90340d26127a4cd264c32023009898981310c0344c340027a8303427a99a04c00003534c230d034f5006468d268cf54d36a3009a69a62626261311b40026013d34201a6934c9a604c98ca6c8460989fa9346234d30d3469a2604fd4131a7aa6d0046043d4c62098479269e89e835190d018d4c046001a11e801a0264792321932308c43a130688c260d46686804cd01a9e80981193684c6a68c00000004c4c20c04627a4c0000260003400d04c0681a01334026009a6f48041466132581ec5212b081d96b0effc16543e2228b052fcd30f2567ee8d970e0f10aabca68dd8270591c376cfc1baae0dba00aaff2d6caf6b211322c997cc18eaee5927f75185336bf907021324c71626c1dd20e22b9b0977f05d0f901eaa51db9fbaf7c603b4c87bc82890e6dd7e61d0079e27ec050dd788fd958152061cd01e222f9547cb9efc465d775b6fc98bac7d387bffd151ae09dadf19494f7a638e2eae58e550faba5fe6820ea520eb986096de4e527d80def3ba625e71fbefdcf7e7844e0a25d29b52dcd1344fca083737d42692aab38d230485f3c8ed54c2ed31f15cf0270c8143765b10b92157233fa1dfe0d7ce8ffe70b8b8f7250071701dfe9f1c94de362c9031455951c93eb098a6b50ee45c6131fefc3b6f9643e21f4adc59497138e246f5c57d834aa67c4f10d8bd8b3908d8130dd7388409c299a268eab3664fa4907c5c31574874bd8d388a4ab22b339660804e53e1b8d05867d40e3082560608d35d5d2c6054e8bab23da28f61f83efd41d25529ad6ea15fb50505cacfabb0902166427354ca3830a2c8415f21b19e592690fbe447020d685a4bcd16ecc4ff1a1c0e572627d0ef6265c008a43fc243240541061ed7840606be466d1c0dac2c53250ed567507d926c844154560d631960c65e15157829b2c7f16859f111a3a8cb72bf24ffa57a680c3be67b1be67c8dd8aea73ac2437a78df5b686d427080ebc01bd30b71a49f6ea31dc0f08e4849e38face96717690239538bc08b6cc5aa8d467cb9c36aa83d40ac7e58bddbfa185b22065e89a86c0145569d9e23726651aec49e31588d70f40fe9a4449dcf4f89eac220171e9c938e803dc195679651004b79ad33cc0c13aeeba5941b33ffeeb8fbe16e76c7811445c67b4269c90479433ddf9e8ed1d00c166b6c17217fb22c3ef1b0c1c7e28e185446a111c37f1ea6c07a59fbcc6546ecc6968d36ba58bc5489a5640647e426b0c39350cb6f07d5dc7a717648c4ec7f841467597ae1f65f408fd2d9940a4b1b860b3c9ae351dcae0b4425f7e8538710f2e40b7f70d13b51ac05ccc6ecda8264a88cad2d721d18132a9b9110a9e759c2483c77dcefc7e464ec88588174cb0c9abff93230ea0bed8decdd8ed8bfe2b5df0a253803678df04fab44c03b9ab7cc97d6e6d6fd0c4c840ce0efc498436f453bbb181603459471f2b588724592b222ec990614db530e10cadd84705621cfdd9261fa44a5f5806a2d74b575056b3c915255c65678f9c16e6dc00a99180fef1a840aff0e842ac02731080cc92782538360a60a727991013984da4fad95f79d5030677b7528d076b2483685fca4429edf804682fdc110dfc2f7c30e23e20a72e039108a0ad6fdee2f76985a4b4be4f5afc6101bf9d5042b657a05dc914e1424241766434" +const randHex = "c95138082bdf2b9bfa5b1072b23f729735d42c785eeb94320fb14c265b9c2ca421d01a3db986df1ac2acde5a0e6bf955d6f95e61261540905928e195f1a66644cc7f37281744fff4dc6df35566a494c41a8167151950eb74f5fc45f85ad0e5ed28b49adfe218aa7ec1707e8e1d55825f61f72beda3b4c006b8c9188d7336a5d875329b1b58c27cc4e89ecbae02c7712400c39dd131d2c6de82e2863da51d472bdfb21ecce62cc9cf769ed28aedc7583d755da45a0d90874bda269dd53283a9bdfd05f95fc8e9a304bb338ea1a2111894678c18134f17d31a15d9bfc1237894650f3e715e2548639ecbddb845cfe4a46a7b3a3c540f48629488e8c869f1e9f3f4c552243a8105b20eb8e264994214349dae83b165fd6c2a5b8e83fce09fc0a80d3281c8d53a9a08095bd19cbc1388df23975646ed259e003d39261ee68cbece8bcf32971f7fe7e588e8ba8f5e8597909abaea693836a79a1964050ed910a45a0f13a58cd2d3ae18992c5b23082407fd920d0bf01e33118a017bb5e39f44931346845af52128f7965206759433a346034ea481671f501280067567619f5ecef6cded077f92ed7f3b3ce8e308c80f34ba06939e9303f91b4318c8c1dd4cc223c1f057ac0c91211c629cd30e46ee9ec1d9fd493086b7bc2bc83e33f08749a5d430b0ed4f79d70f481940c9b0930b16321886a0df4fa5a1465d5208c7d3494a7987d9a5e42aa256f0c9523947f8318d0ef0af3d59a45cfc2418d0785c9a548b32b81e7de18be7d55a69a4c156bbb3d7579c0ac8e9c72b24646e54b0d0e8725f8f49fb44ae3c6b9d0287be118586255a90a4a83483ed0328518037e52aa959c5748ed83e13023e532306be98b8288da306bbb040bcf5d92176f84a9306dc6b274b040370b61d71fde58dd6d20e6fee348eae0c54bd0a5a487b2d005f329794f2a902c296af0a4c1f638f63292a1fa18e006c1b1838636f4de71c73635b25660d32e88a0917e1a5677f6a02ca65585b82cbd99fb4badbfa97a585da1e6cadf6737b4ec6ca33f245d66ee6a9fae6785d69b003c17b9fc6ec34fe5824ab8caae5e8e14dc6f9e116e7bf4a60c04388783c8ae929e1b46b3ef3bbe81b38f2fa6da771bf39dfba2374d3d2ed356b8e2c42081d885a91a3afb2f31986d2f9873354c48cf5448492c32e62385af423aa4f83db6d1b2669650379a1134b0a04cbca0862d6f9743c791cbb527d36cd5d1f0fc7f503831c8bd1b7a0ef8ae1a5ed1155dfdd9e32b6bb33138112d3d476b802179cb85a2a6c354ccfed2f31604fbd8d6ec4baf9f1c8454f72c6588c06a7df3178c43a6970bfa02dd6f74cb5ec3b63f9eddaa17db5cbf27fac6de8e57c384afd0954179f7b5690c3bee42abc4fa79b4b12101a9cf5f0b9aecdda945def0bd04163237247d3539850e123fe18139f316fa0256d5bd2faa8" + +const oneMBSawtoothBZ2Hex = "425a683931415926535971931ea00006ddffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe007de00000000000000024c00130001300000000000000000000000000000000000000000000000000000000126000980009800000000000000000000000000000000000000000000000000000000930004c0004c000000000000000000000000000000000000000000000000000000004980026000260000000000000000000000000000000000000000000000000000000009aaaaa0000000000000000000000000000000000000000000000000000000000000000498002600026000000000000000000000000000000000000000000000000000000007fc42271980d044c0a822607411304a08982d044c1a82260f411308a08984d044c2a82261741130ca08986d044c3a82261f411310a08988d044c4a822627411314a0898ad044c5a82262f411318a0898cd044c6a82263741131ca0898ed044c7a82263f411320a08990d044c8a822647411324a08992d044c9a82264f411328a08994d044caa82265741132ca08996d044cba82265f411330a08998d044cca822667411334a0899ad044cda82266f411338a0899cd044cea82267741133ca0899ed044cfa82267f411340a089a0d044d0a822687411344a089a2d044d1a82268f411348a089a4d044d2a82269741134ca089a6d044d3a82269f411350a089a8d044d4a8226a7411354a089aad044d5a8226af411358a089acd044d6a8226b741135ca089aed044d7a8226bf411360a089b0d044d8a8226c7411364a089b2d044d9a8226cf411368a089b4d044daa8226d741136ca089b6d044dba8226df411370a089b8d044dca8226e7411374a089bad044dda8226ef411378a089bcd044dea8226f741137ca089bed044dfa8226ff411380a089c0d044e0a822707411384a089c2d044e1a82270f411388a089c4d044e2a82271741138ca089c59089c69089c71089c79089c81089c89089c91089c99089ca1089ca9089cb1089cb9089cc1089cc9089cd1089cd9089ce1089ce9089cf1089cf9089d01089d09089d11089d19089d21089d29089d31089d39089d41089d49089d51089d59089d61089d69089d71089d79089d81089d89089d91089d99089da1089da9089db1089db9089dc1089dc9089dd1089dd9089de1089de9089df1089df9089e01089e09089e11089e19089e21089e29089e31089e39089e41089e49089e51089e59089e61089e69089e71089e79089e81089e89089e91089e99089ea1089ea9089eb1089eb9089ec1089ec9089ed1089ed9089ee1089ee9089ef1089ef9089f01089f09089f11089f19089f21089f29089f31089f39089f41089f49089f51089f59089f61089f69089f71089f79089f81089f89089f91089f99089fa1089fa9089fb1089fb9089fc1089fc9089fd1089fd9089fe1089fe9089ff1089ff98a0ac9329acf23ba884804fdd3ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0034f800000000000024c00130001300000000000000000000000000000000000000000000000000000000126000980009800000000000000000000000000000000000000000000000000000000930004c0004c000000000000000000000000000000000000000000000000000000004980026000260000000000000000000000000000000000000000000000000000000024c0013000130000000000000000000000000000000000000000000000000000000002955540000000000000000000000000000000000000000000000000000000000000001ff108c00846024230221181908c108460a4230621183908c20846124230a21185908c308461a4230e21187908c40846224231221189908c508462a423162118b908c60846324231a2118d908c708463a4231e2118f908c80846424232221191908c908464a4232621193908ca0846524232a21195908cb08465a4232e21197908cc0846624233221199908cd08466a423362119b908ce0846724233a2119d908cf08467a4233e2119f908d008468242342211a1908d108468a42346211a3908d20846924234a211a5908d308469a4234e211a7908d40846a242352211a9908d50846aa42356211ab908d60846b24235a211ad908d70846ba4235e211af908d80846c242362211b1908d90846ca42366211b3908da0846d24236a211b5908db0846da4236e211b7908dc0846e242372211b9908dd0846ea42376211bb908de0846f24237a211bd908df0846fa4237e211bf908e008470242382211c1908e108470a42386211c3908e20847124238a211c5908e2f8c211c6c8471d211c7c84721211c8c84725211c9c84729211cac8472d211cbc84731211ccc84735211cdc84739211cec8473d211cfc84741211d0c84745211d1c84749211d2c8474d211d3c84751211d4c84755211d5c84759211d6c8475d211d7c84761211d8c84765211d9c84769211dac8476d211dbc84771211dcc84775211ddc84779211dec8477d211dfc84781211e0c84785211e1c84789211e2c8478d211e3c84791211e4c84795211e5c84799211e6c8479d211e7c847a1211e8c847a5211e9c847a9211eac847ad211ebc847b1211ecc847b5211edc847b9211eec847bd211efc847c1211f0c847c5211f1c847c9211f2c847cd211f3c847d1211f4c847d5211f5c847d9211f6c847dd211f7c847e1211f8c847e5211f9c847e9211fac847ed211fbc847f1211fcc847f5211fdc847f9211fec847fd211ff8bb9229c284803a8b6248" + +const rand2BZ2Hex = "425a6839314159265359d992d0f60000137dfe84020310091c1e280e100e042801099210094806c0110002e70806402000546034000034000000f2830000032000d3403264049270eb7a9280d308ca06ad28f6981bee1bf8160727c7364510d73a1e123083421b63f031f63993a0f40051fbf177245385090d992d0f60" +const rand2Hex = "92d5652616ac444a4a04af1a8a3964aca0450d43d6cf233bd03233f4ba92f8719e6c2a2bd4f5f88db07ecd0da3a33b263483db9b2c158786ad6363be35d17335ba" + +const rand3BZ2Hex = "425a68393141592653593be669d00000327ffffffffffffffffffffffffffffffffffff7ffffffffffffffffffffffffffffffc002b3b2b1b6e2bae400004c00132300004c0d268c004c08c0130026001a008683234c0684c34008c230261a04c0260064d07a8d00034000d27a1268c9931a8d327a3427a41faa69ea0da264c1a34219326869b51b49a6469a3268c689fa53269a62794687a9a68f5189994c9e487a8f534fd49a3d34043629e8c93d04da4f4648d30d4f44d3234c4d3023d0840680984d309934c234d3131a000640984f536a6132601300130130c8d00d04d1841ea7a8d31a02609b40023460010c01a34d4c1a0d04d3069306810034d0d0d4c0046130d034d0131a9a64d321804c68003400098344c13000991808c0001a00000000098004d3d4da4604c47a13012140aadf8d673c922c607ef6212a8c0403adea4b28aee578900e653b9cdeb8d11e6b838815f3ebaad5a01c5408d84a332170aff8734d4e06612d3c2889f31925fb89e33561f5100ae89b1f7047102e729373d3667e58d73aaa80fa7be368a1cc2dadd81d81ec8e1b504bd772ca31d03649269b01ceddaca07bf3d4eba24de141be3f86f93601e03714c0f64654671684f9f9528626fd4e1b76753dc0c54b842486b8d59d8ab314e86ca818e7a1f079463cbbd70d9b79b283c7edc419406311022e4be98c2c1374df9cdde2d008ce1d00e5f06ad1024baf555631f70831fc1023034e62be7c4bcb648caf276963ffa20e96bb50377fe1c113da0db4625b50741c35a058edb009c6ee5dbf93b8a6b060eec568180e8db791b82aab96cbf4326ca98361461379425ba8dcc347be670bdba7641883e5526ae3d833f6e9cb9bac9557747c79e206151072f7f0071dff3880411846f66bf4075c7462f302b53cb3400a74cf35652ad5641ed33572fd54e7ed7f85f58a0acba89327e7c6be5c58cb71528b99df2431f1d0358f8d28d81d95292da631fb06701decabb205fac59ff0fb1df536afc681eece6ea658c4d9eaa45f1342aa1ff70bdaff2ddaf25ec88c22f12829a0553db1ec2505554cb17d7b282e213a5a2aa30431ded2bce665bb199d023840832fedb2c0c350a27291407ff77440792872137df281592e82076a05c64c345ffb058c64f7f7c207ef78420b7010520610f17e302cc4dfcfaef72a0ed091aab4b541eb0531bbe941ca2f792bf7b31ca6162882b68054a8470115bc2c19f2df2023f7800432b39b04d3a304e8085ba3f1f0ca5b1ba4d38d339e6084de979cdea6d0e244c6c9fa0366bd890621e3d30846f5e8497e21597b8f29bbf52c961a485dfbea647600da0fc1f25ce4d203a8352ece310c39073525044e7ac46acf2ed9120bae1b4f6f02364abfe343f80b290983160c103557af1c68416480d024cc31b6c06cfec011456f1e95c420a12b48b1c3fe220c2879a982fb099948ac440db844b9a112a5188c7783fd3b19593290785f908d95c9db4b280bafe89c1313aeec24772046d9bc089645f0d182a21184e143823c5f52de50e5d7e98d3d7ab56f5413bbccd1415c9bcff707def475b643fb7f29842582104d4cc1dbaaca8f10a2f44273c339e0984f2b1e06ab2f0771db01fafa8142298345f3196f23e5847bda024034b6f59b11c29e981c881456e40d211929fd4f766200258aad8212016322bd5c605790dcfdf1bd2a93d99c9b8f498722d311d7eae7ff420496a31804c55f4759a7b13aaaf5f7ce006c3a8a998897d5e0a504398c2b627852545baf440798bcc5cc049357cf3f17d9771e4528a1af3d77dc794a11346e1bdf5efe37a405b127b4c43b616d61fbc5dc914e14240ef99a7400" +const rand3Hex = "1744b384d68c042371244e13500d4bfb98c6244e3d71a5b700224420b59c593553f33bd786e3d0ce31626f511bc985f59d1a88aa38ba8ad6218d306abee60dd9172540232b95be1af146c69e72e5fde667a090dc3f93bdc5c5af0ab80acdbaa7a505f628c59dc0247b31a439cacf5010a94376d71521df08c178b02fb96fdb1809144ea38c68536187c53201fea8631fb0a880b4451ccdca7cc61f6aafca21cc7449d920599db61789ac3b1e164b3390124f95022aeea39ccca3ec1053f4fa10de2978e2861ea58e477085c2220021a0927aa94c5d0006b5055abba340e4f9eba22e969978dfd18e278a8b89d877328ae34268bc0174cfe211954c0036f078025217d1269fac1932a03b05a0b616012271bbe1fb554171c7a59b196d8a4479f45a77931b5d97aaf6c0c673cbe597b79b96e2a0c1eae2e66e46ccc8c85798e23ffe972ebdaa3f6caea243c004e60321eb47cd79137d78fd0613be606feacc5b3637bdc96a89c13746db8cad886f3ccf912b2178c823bcac395f06d28080269bdca2debf3419c66c690fd1adcfbd53e32e79443d7a42511a84cb22ca94fffad9149275a075b2f8ae0b021dcde9bf62b102db920733b897560518b06e1ad7f4b03458493ddaa7f4fa2c1609f7a1735aeeb1b3e2cea3ab45fc376323cc91873b7e9c90d07c192e38d3f5dfc9bfab1fd821c854da9e607ea596c391c7ec4161c6c4493929a8176badaa5a5af7211c623f29643a937677d3df0da9266181b7c4da5dd40376db677fe8f4a1dc456adf6f33c1e37cec471dd318c2647644fe52f93707a77da7d1702380a80e14cc0fdce7bf2eed48a529090bae0388ee277ce6c7018c5fb00b88362554362205c641f0d0fab94fd5b8357b5ff08b207fee023709bc126ec90cfb17c006754638f8186aaeb1265e80be0c1189ec07d01d5f6f96cb9ce82744147d18490de7dc72862f42f024a16968891a356f5e7e0e695d8c933ba5b5e43ad4c4ade5399bc2cae9bb6189b7870d7f22956194d277f28b10e01c10c6ffe3e065f7e2d6d056aa790db5649ca84dc64c35566c0af1b68c32b5b7874aaa66467afa44f40e9a0846a07ae75360a641dd2acc69d93219b2891f190621511e62a27f5e4fbe641ece1fa234fc7e9a74f48d2a760d82160d9540f649256b169d1fed6fbefdc491126530f3cbad7913e19fbd7aa53b1e243fbf28d5f38c10ebd77c8b986775975cc1d619efb27cdcd733fa1ca36cffe9c0a33cc9f02463c91a886601fd349efee85ef1462065ef9bd2c8f533220ad93138b8382d5938103ab25b2d9af8ae106e1211eb9b18793fba033900c809c02cd6d17e2f3e6fc84dae873411f8e87c3f0a8f1765b7825d185ce3730f299c3028d4a62da9ee95c2b870fb70c79370d485f9d5d9acb78926d20444033d960524d2776dc31988ec7c0dbf23b9905d" + +const ( + digits = iota + twain +) + +var testfiles = []string{ + // Digits is the digits of the irrational number e. Its decimal representation + // does not repeat, but there are only 10 possible digits, so it should be + // reasonably compressible. + digits: "testdata/e.txt.bz2", + // Twain is Project Gutenberg's edition of Mark Twain's classic English novel. + twain: "testdata/Mark.Twain-Tom.Sawyer.txt.bz2", +} + +func benchmarkDecode(b *testing.B, testfile int) { + compressed, err := ioutil.ReadFile(testfiles[testfile]) + if err != nil { + b.Fatal(err) + } + b.SetBytes(int64(len(compressed))) + for i := 0; i < b.N; i++ { + r := bytes.NewReader(compressed) + io.Copy(ioutil.Discard, NewReader(r)) + } +} + +func BenchmarkDecodeDigits(b *testing.B) { benchmarkDecode(b, digits) } +func BenchmarkDecodeTwain(b *testing.B) { benchmarkDecode(b, twain) } + +func TestBufferOverrun(t *testing.T) { + // Tests https://golang.org/issue/5747. + buffer := bytes.NewReader([]byte(bufferOverrunBase64)) + decoder := base64.NewDecoder(base64.StdEncoding, buffer) + decompressor := NewReader(decoder) + // This shouldn't panic. + ioutil.ReadAll(decompressor) +} + +func TestOutOfRangeSelector(t *testing.T) { + // Tests https://golang.org/issue/8363. + buffer := bytes.NewReader(outOfRangeSelector) + decompressor := NewReader(buffer) + // This shouldn't panic. + ioutil.ReadAll(decompressor) +} + +func TestMTF(t *testing.T) { + mtf := newMTFDecoderWithRange(5) + + // 0 1 2 3 4 + expect := byte(1) + x := mtf.Decode(1) + if x != expect { + t.Errorf("expected %v, got %v", expect, x) + } + + // 1 0 2 3 4 + x = mtf.Decode(0) + if x != expect { + t.Errorf("expected %v, got %v", expect, x) + } + + // 1 0 2 3 4 + expect = byte(0) + x = mtf.Decode(1) + if x != expect { + t.Errorf("expected %v, got %v", expect, x) + } + + // 0 1 2 3 4 + expect = byte(4) + x = mtf.Decode(4) + if x != expect { + t.Errorf("expected %v, got %v", expect, x) + } + + // 4 0 1 2 3 + expect = byte(0) + x = mtf.Decode(1) + if x != expect { + t.Errorf("expected %v, got %v", expect, x) + } +} + +var bufferOverrunBase64 string = ` +QlpoNTFBWSZTWTzyiGcACMP/////////////////////////////////3/7f3/// +////4N/fCZODak2Xo44GIHZgkGzDRbFAuwAAKoFV7T6AO6qwA6APb6s2rOoAkAAD +oACUoDtndh0iQAPkAAAAaPWihQoCgr5t97Obju21ChQB0NBm3RbA7apXrRoBooAA +AhA+IAHWl2Us3O7t9yieb3udvd76+4+fd33nd3HO1bVvfcGRne6+3vfPvfc++995 +w7k973eJhasLVec970tzDNXdX28LoPXZ3H3K9z0s5ufWAfes49d5594c3dUYtI+2 ++h1dvtpRa+uvrVEAG9bl893RVEN7cWvroSqWjPMGgAQi7Gq8TJSgKKdjKFBIB9Ae +LqWxleu715eXe7ml9e5098Z6G1vr7t1QZ6ot76YzPd3j7333t2ql2Chm7XrA9ICQ +VF77z3rVBWqkSXtlfb099hyezAr6USbGpICTSCFAaqHrKo+tUnm32rpE4Ue+t2mj +bKUeipEqwc93EdhhTwmQpOhhesC9iqDSPNTWYNSnUtBdm1nsA0nqqNd7OWwDXtFL +ONmmA6Ubke26I9UblvWIPR5VOWOnctai443URunnDy77uVC59OfRvezlDu33Z7Ly +3NNuuHW63088xu3t3NHZhkZbG7tXRlj00qOtbaXTJUUdspTbABR9R6EUwQAEAAAA +EMEwRpoAAAABMmhoAAjBNNAaCMhponpoGpgJpk9TEyp6niGKZkAaAEfqMQ09U80p ++pMGSCKngIAAAAgAAg0AAJhGgABGCEaaTyTKeNI1PE0wkj01GajMSNPSZGnqbU9T +anlPUNAHqGQ0DQAMg9TamgAAYRU/IAAICAmjQJgjQBMEwp5DTSaaYmhTeqfplPID +U1T9TynoU82pT1NPU/VP0j1NHqRpk9TTR7SnqaNNGmmQAaAD1Aeo0PSAAAAaaBiK +eBAQBGgIABGQA0AmBNNBoaAgaJmpglPEyYap6npiTT0agGjJjUaaDTQAAAAAAM1A +9QAaAAAADU8iEAQAEyAJk0NNNJgIZTJ5E00YSemiaZNGm1MpGNJ+lPU9qm9U2RDM +oY0EzJB6h6nqDID1NMBDDRpo1AGNAjCMmhkMgaYSJIgAAAQyAAEyBoATECCNhTT0 +U/IZAmCM1DSTxkzUE8p6NDaGiZGJqntTFHvUyU9qPQp7Kn5GgKNPU9QAGg9QAAA3 +wz0Pk/g/m/m9P9H4vxv2+dH3gCS8nhbbbbbYxtgNsBsG0m2MbG0NNtsbYNsaY0wb +bBibGmm22mxptNpsaGNDTY02JsG0MY0xg2MaYNNDbGwG0L5vsK/F9DO+EAA447Kq +p7Wdf6Y+5c20T7DfHyMXIzRKrZexw72uiQI+y55vOe52xpqbCLC2uR20JdER7Zvr +7ufuKb6zhiBxLuj0eA27v8RpMLucw9Ohwcizi2wrpt+yU1FdpM7ZYPcwS3XTef+A +Wzjxwhdrgw3aH1LeC1eZW900x8V9Nv4hTPXp4l067P/4ANVZFF/imOe/d5bdueam +/DFFokQWnFaU+ZqLBCM+d0PialJQWnLqRQZk/KhfbbYc2pCUTgffcSYbrCM1N+8l +HU6gSz+h2GJXs+tbrNviL83M97X0vcTn/F82P8wen8/3/h3sHY+sf9CSej9ThYTV +3lQ+FUHpfpGD4kv7dYMV995dpDX/y3xR8FoXx1bjUxBTNxuutwQ/h/Eedn9wpn6w +E3+ND8YhN1HSriIxRE/6uFyMv6/oC6Elarw3aHMMqHJkGiiz6tejmvnYLQa+Qm6G +deZ7jXTZV6NlpocgDnRdimS06bTYSkvPAL/xoWNLkX6N6VljU0dfKSBmm2uZE/xu +sutQ1EdP7GdjhglIq4xlOFUFEQpmX+xx7R8y6c0GSAaqusOjNZwxZRudOvmXm1tZ +T+YnbeB2ir9eiHNrtJNSLD/J/WDyuQpwBUtLKo0krccY/wIILP7f86teb9Z/9oyz +OX05qEWbObfhpRw+9+rCvp/35ML8KX3aHaI0n+tudbFRsV5FLW+Oa8ruLN4peyVL +DWjTHrXNthq/s7zAJYMeFJZkZt5mT9rfpH+5g3nc+piOSZ+J5nHtOnKI7Ff8Xl+j +0t76XTNucCHQ6whav1OHdF53TY5wuv5OzvrdnxoId8fTyUvERr0ERINu/8XxZZ5f +B5/kTZ8bBO0wv54Jp+ED/GQI8lZHzIQCP3vfQhwnCTj9TvITic7P4mYLDbH3fyzR +i+6EajCcpXLWSGf+ZXkOrWspDWDhXtEKas0v3UqWksqgY1rTj45krX4KihN+daXs +pZl5WPlta5p06CX6Xm2SfzqkMw12/3ix1bpnnZ+kFeBNX7A+E9zzG6OZaN78GOpl +9Ht/eZn9PqWdav852zr0zqkDK2H5IjdvNah+b1YVGdQGzwR4Nw+f13yEKnV+y66W +djfq7zWp7m5w+hzfv+Ly8O7oet5Vvd8/wQvO7qzOZ2vjf9X8Tj8PnMb/nc/nKqRR ++ml4UEhOOwfCeJEEI109CMYSh91iAJqPjMyH6KjrPD7W25llZVcREYNCTg6htbQt +M38wYoquCWP6tdKYlVIv14xTNUeUf4El/FunCf6csZkmv+9tfWx7t59wuKIa3saU +tZs9M+3HFOZtz3OLg/Unoaj9BYazYqA78xBU9tZzrtmF/rQL9CGJt90o/oYnSfcS +SL3haaw351LXWQ1XOsv1SmH3v6ymuxEpPPnEDmBELaTYsvvMIWJsmPZFFww++Kd7 +s/Jo0JFeUU7uNtI+gVosAIpVVuWfI/9tOIycz7I5Z7zjV+NR2OuZbYtW5F08KX4o +2k/xuJIchcNFPtxPfw9dkDgscRbMckyFMrzuZ3IvrcGzk0J6iI5ytrv37bGpAXMz +WK9mMMPebepNevmLjjo/QWoM968Sjv7ldlPS5AinHcXwsFv6dmmh8lJt7UOJWoKu +lMD1cB2ksIGpMdv8iuqR42Rn/kn+17BhhUZcwDBaUXVdX6bKW7fxlUYbq+mlqIcf +a9v8HF87M9ANbi9bq9onf9TD7nQ6Xf6vZci8TBPX+/GI0He6j31fTVQYW+NsQxvO +J8xrx+e58CCLQNjxeIyPt+F+qk/QMiXw+LyxGVkV/XcGQT9X03jSDP6beJ5QG1JW +9Q3qLv/YixWI7gPV9Mrhf2oRYTc/9KLFRhkE3SjKOTKuSSBKQ24fI+hEznamH71D +66Hwez8/0et7AtTv9zvamv2OD5He6fMV4k+ePl6+qPfO5CdHtK+eCDZL5+4f5yrl +gTcRFiq8fXbc5IaI5fbbc1KMM/2T0Mr7+Hwaco6FtXm0fmhCgTZRqY4pKiEIfmaz +QwHNOOCrtMJ2VwsyMumt7xsOolGnizRev6lILH43qPcczQM7Gc5zRin80YvFt1Qm +h/57Z0auR2h0fuX50MBO4XQ+26y5l6v4j902R66c0j3z2KHstKQ04J/h6LbuNQE4 +D6cu/lyfK69DxxX8wb8XaQkMUcJdo1LzqUGDAb3Kfn/A3P/JYc99MO9qv67+SxWb +wYTyqKdWTd+1KbR/Rcn0Io5zI/QquX7FA1bxfMytjQ/X+l0fh0Pf+Hx97meH4fQL +7/T8/sdTm9Tn8nELvedyhydLlPPTScINdXyLIq9wgIJr4fWPbp9ZhFh/56fdSgOG +HDXg+gkXsN2Rddr4HQ5P3u+RhLzmSjhzoqY5EsPC4QvRlX9JXjB84rPV5USR66qa +/kjw4156GJnzoXtydKJE53t6PHfZWO+3ujsfI6iAdshc7OFzGXiZB9PtItKodhYq +nABkTKdcpu4+TOpf9h5piX5slsaBjkeTnj/Ba02ilboQfcDVigxrYn/iTH5ySWUW +/lHtg78s5UZM8sErwhNe3N3w+6ZOMnU+5i86/xFNtqZfDdXTGy1H3PzGbdtZXYT+ +Ixx2vpwBYzbPVYHxKosM5rPiVmcTllI9nuoSfeh9ib4foFWauOpvdmhBDqpTpKTX +u8EO2l2Z195G2RIV7TlKSxGWjR5sl/nALu1uzBeLd9zpSujzMTd1uTX9Qk/Q1S+r +vaW6bm8qqPO4jb6Wx6XIkm321nrIF6Ae25d1+Dpv/P5G4NoLd2j6/EtENC3FeR5z +oo7bA+tI8yEQRhiF0z1FlJXLD5ZbhNNWQm/j/IbzRfh8JtOFZU7ruShLvHXysW9S +9V909tr9jn8/E/Hb5N/1NVNHnZu2HIUvJvHJiHd2ucmeI9PWUMnppmE65GQ5E9xV +ZRlGEH0X85EvmHyEupkMrCC0oMv9RCq+/H8gcfpe00Hs/S+regT5p58cyYomh93v +qvuw/A06BE/wzJESuYbN9pqYpoXqXFemW1NksHEJ2w+PYMJ27WJyD5FpaXB85VaW +qMOhDfO8E3QdH8ybyKt/UgI8/tDGpFbyOlaVdIv1FXJhoLp8soAA4Djg6/KZ066N +ZFYuS8WdjpSZGP4/Lw+1yaXlzNznc/k2uHe2uXP3uFuPcHx+Dm44utxldoO1uBPy ++jzOs14+MIgOjOHMVNqAbMd8fUedLlhJMCfMtm4uz01enLNKcMrtLlPIR37Yukh1 +YEMXYpm7eU4XU+j+Jj3pDyaXtXs+p1fWfTN/cy9/Oxs4umUXQ4uHh1kObtayDJ56 +/QMxiHobjHNKuKfMxsrYEwN+QVIyVjAwMDYuMjQ1AAA9IwJniiBLRkZDAAAXt0Ja +aDQxQVkmU1lZtwytAACLf///////////////////+//////v//////////bv78// +/+AXO133uwO2xB2UxIvbKXrCqCoURUBL2ytFI82AFdcOwMhVTHtk5rD3szEVNYD4 +aIQINCaMRoTaSn7SbSMJiYmEwieTEp+psqbMCp+VNPaFNpqbBNR7UmanlPUeKfqm +j1PU0/VPU08o9Q9EeKHlPJtKbYqeTCYhN6U9T1NH6mp+lPyoGNTI/Knkyg1MggAg +CaMEyQnqZoaaRtRtJpppppoDaTR6hpphGh6mmgHpMQBpkGTTEAAaAAAA00AZDag0 +ADIBkGgABqemiRNTI0k8aU0PRGRoAZlP0UAAAGgAAAyAADQaAAAaAAAAAAAAAAAA +AaAAAAM0kgRBJ5MlPFP1Gj0jTTTUaekxNAbUGjTQMgaZANNAAAAaAADTQAAAAAAA +ANAA0AAANADQ0QAAAAAAAAAaGgAAAAAAABoA0AAA0AAAAAAAAAAAAANAAAAAkSEI +aTRpomp5DUxNNDTJPTKaep6T09Kemmo2JG0aTQ9ENogaaGhkABo0NHqaBoDTI0DC +Gj0gNAMhoDQ9QMQNAGQAaDDwyMPIMlbG1vhRBTFo6JksSupgpAjPbY0ec02IGXjb +eS+FBsh01+O4ZOaD+srUZCFaT4DRjVDLx7uKIsFtESIDUg1ZkhyCSYov05C00MtR +BdNNa/AYPGOQZWcs+VegXOPrkushFbZ3mBoRD6WamClkpBaHZrUhUl02bIfRXX4w +b3/9cW9nHDVxh2qFBxqgRKfmq7/Jc/tdJk05nVrGbckGVy2PnIy30CDhpWmqrSot +K2bOnX0NbP1iy2cd0Na0ZmbRstm4MzMzbbMySTd35F7f+zPP8DC+NJLYcakkkkRd +NZlupJt3OMFoDAD2g+N3FAMCydhIpoRHRQAdFI5nNg4ugEXHCYxkMyGCwtaJmial +y0IMlpSYYM/weXNJAhFqS0GNmvaPEtYGjbvaucMdklOTmBX1vfVAkTYB1uXCSK64 +UNIixOqRKLuRCFtqIQtgwqaFrCkIYbbewErWABa+VGADWsJXJjfx5SJViLuwiGXq +Ru6vCuwmU5CJiJz3UiBpmLv0r2wskxUhY4tzPVGQ9RMXJl65eLSNwZVwaSyGZ9Cm +A3jztQUUpFeUryBTskW95iVwRMFrhBCwZBAFJBZvhMEMNoDJJlUoIhQkAkjbExp2 +YZio+ZYeAZUwmH1qUbdQixmxf0+61+aVgJ1hwxsO1yG3hFx4pfjc09ITVht0pG8u +FtVFhPa1KE0gTRUSVXywkITucqk0Waz5Fs6qJpVHYdNrbYRFxnFsQGY1qmsTLjK6 +4QX5Rddo6krM/Bx9CqIAKq4CzVQYHrmIAd2EBhYmwVYwLvhzKIUrc2EirnGIvyuD +O4YZDSwsVTA0BpVvUOjDErkCraBoSutcKwUSSLGhVvNYHLz3klgZD++wWsa/swLw +gvNDY2De+sncOv8X2lq4HD95ZdwPuTIMXCwSbg4RrIqv+L0y6F17pqDecyQYPEj3 +iN/0BBeWZlJAyBMi5U3Q1zAlsK8IlDhaXGmvZrgISq5CfNjmUgxDeMggOKqxu4sI +OrilS49Lkl1J3u3GjXTuH+rX+4ccyFAQnizCpPClcY77F59j63S6fr5vr+y99tuO +7Ox7Wg/ljwhdyaK4xMmXczeJbx7x07htJNtC4xcQfAtvzeznLrN6MN/ILIBOI65I +qIA2D5fHHj1XN4aN6TvOjWDaSbSWqxCSCvXUpzkNJAkWXAuTwF8k5uSJvQj/rVo0 +hAhEMEIYkCRGx9AX+byIuXWlLMbbVeliHNUL5AQYmNwLFu4SkmGD+UWtBMyVHQOQ +ss0ggoVKSKOBUgnVS6ljt7WE1qXqJJ4QA1pEwYNLEaguEE1LtPNoVr5WzjbSbWPk +V9OW3y9IneUDLoIV5pAkEFTEFGFVjeTFxtpzBBfGgycBxVCdz8eESBIzsamRchAa +TQunQH8DHnpfod9QuAuRvc7JBlKUCYmCjMvynLcxIFohxCaYrDvGw4QbXZB7oWQ7 +hpoGlz23ayDfB8NrRRzdilsEQyQniu9ASLQg7RrGZnoTr1ai12IbCEUCGdFq03P5 +nBnRFAGmisQGcyykV9gKtcVMWLhCuVmXg86dndn7slUpRNSSEAU20oaWIm1maFTu +E0DT4gTbg0nuhjtz3kNOz+i7sBm0bkXjxQWuLqlZEmp60ZTyRZJDUqKSEKg6hqcy +ERxdU22CSNOO10RYUUiDVpKhPNdKTOIE1thp02sBNoNTFSht8WJtaBQ09qN3jd5r +dOLX4IA5fevRyCCzDgRXfV4wzik4KROjmxmTMglBySlIMEzcXehnDXCRiZSlvwA2 +0YsIOROcm4UrIRFxJHctJH7OdN5u1aHVHb5UaLHpv48NgmFRE56KTSoaWunqm2st +S0mrAdOiqcR12PWVbdVRJKcQ0DQuhwlAPcRtpxN3D4kbXJjToSYJIFw406G2CSaK +jQMIJPZGlQmgyFhoCSzeGS1VSq5SKKQQxs5RqKUcVUNY57YUETb4mXzV84SPngKi +nsce0mXByZq5BKUA9puHZWLNwQIYuDaJUNgG+E01E3pDYVNLKYQ0hsVesgV5gZY0 +htDsRdGtm0+iGnkN6+Ea9YJtUZNAkx2GgSoix12nTW0avTUfxR3oYcpvZ7IdtABE +UhBcjG4qZtDZsS1JQHys243vhLaDTSvvTeBiJA2tmokqECTBcSOCAGkAxMKlVAva +4IsLRaBBqhxDbcGtgdw03mFcLUaFuhtKuuEIEkUleJQwby/zwu9uvvZK4xTV+ECM +a8lmzxKmqkBggYK1+xPdbmJclm6tSZhE/OSJtCEjs+unJIQkT9hCWgBJqGMS07Eh +AJNmBiuVEVdTyjkIJkavuZmx2sJF13htgEZUCC23lZFOE6gWbM9WyYNJTM8yCQrb +0Sx3OQvBML5cRATAQkSQkAJOAhoxpQkNi4ZiEVDbdtJAME0RXNDXGHA3M3Q0mm1o +IEwbWpaM1DQCSMbGRCAu3iRIQiT6RlBpT1n3tfwvUXz3gIVlx3mEximY/kZW1kNG +sgEJIrBisaEoGYPJ+1CQUYFBw+eGEHJQBpNHjErXUJY2iWHQ30hXwFBuMSxQ2lB5 +bg+/LX3euG6HsHUB1lFvBvaiaBrITVwkCTa1d0s9CHZCiDZjbWReKyrpPE2oSa7o +LPrR4BJvys9ttjUpzETSSMxh8vsr9dXTwKBtK+1xCTGDQmNIaE29HmHdS5GSxpya +MismcAUSEgSxHBrKtgsZzduG7vHZn16l3kFkVITtENIzS2JsiBwFTDlhgexsjBHv +5HXOYxHBzoSDCcPZ0ctvkY9aS5XpoQuFYkGJgCsqjJZeUMNUEpDSbKcnUc1PifIA +CbR2UoXawBlspkEBr9HBfvUi/MUakZVOf1WKYrqSaIXce62JOyhJLq3qJBloTA0F +VbILEtM+heFmNRCFt70GJrExVJri0ArYbCRbADSGDBpBXxxb/6fo+s3C7uaL7RjM +LV2IQBNrAJrKFeJwTsPnxbAsemirUx2lk1kaxschzdK4TQNJN5wQnolIFg401OZ4 +2na11LnT3lR+1k1TMJhiAjXMk0F1ooHnYlt9LKfJ3ZIOmeY+2l9bUQHWFNGyEyfj +EAcu3kpGLq0Ez7XOS+EpAASRQTAYMATfVQibHLTT30zG732+pNe9za1JNt8sNJYn +RjWuJ6jL5ILV0rcd9vT7X9fObvcXitpvJ2XBJE+PhX2HaTkyWeF9pwnlQNrTe9hV +tzhA+ihZrDrHNmLcQjZbnv/IMubqq8egxY80t5n6vZ6U5TR6U9uZJvai1xtqAyCR +NWkW52m00rDTEuO6BA4q2RHDWwbETF55rRsWLIgNW9qJCyMHPbTM/dMBmWMQSMxz +4M2pRzt47SICxA327UqSCEERqMFybmYi3nUxePtLgHYplqRiw4ynMbXd/kiQ0LE0 +PKJSSCXA42ymziCpAxNWflzpzQdJZusahRFr6t6m+4p273/Taj7k+hZyNgBAgXAY +8F7pTts6orLb8IA6o4TOwkwQYmKvKu9VwMrE7+GUhVIAgY9a8DyQMiDBkEAwh7S1 +KgCBfao8DK1CwSS8Z3WjL5MEgt93z2koUQCD/YxMBppiCMp7SDVSmkkIHptfGpeh +t+M13Ccv1tavIASFiaQl6rBz3K4N3DSGwNkCibrvEAC0fQirOWnc4NVbcLKpFG1l +NQXF/eqdT79wq1Mvlap3QSCLhcD2D3fCkKVWid4aSjtp9FOX1Uaf7P9eT93zd9Sv +mj2yNLRUGzyI/0oONNSzmmkvJ5Cq2X2CdldIWMGZO57RJ8oyATAWTQmRmNkfh0Sx +uuR/J9oUsomVy1AEntc0dlPivkqBkBqrxU3j5PnWkaI3ZRGc0gg9spCQEISh4xEU +pMhVrnmDQLfLP8Ouqpx917MAw7hkjQk6BJFTAbXDsz3LSHIxo/gB8qrA1vbvdZZh +LtR0frJdfdppX8nAQX/TAxOQ8+H6yw8a9i7/zJEfSYIhop59N/fhcWW2F14cj2Xc +fyHaZ04lTO4uPnly91jwuFPaREuZVp8AxImIhlkxkAN61tWdWG7tEbaCgszh6VIz +ThFnHo2Vi8SQXPrXCN7J9Tc9ZYiAYqoThV/u6SYsea5aZL8deOvKBQCgZZuIxX1z +4EnfcqG176vY4VqMBIC4pMJz0WcHJYqN+j7BiwGoMBwExrIdTB7q4XIFLotcIpS0 +1MqyVsesvoQq7WObmGQXdMliMirSLcDuSx8Qy+4pIBgGDIyMp1qbonnGdcHYvU8S +O0A8s/iua5oFdNZTWvbVI4FUH9sKcLiB3/fIAF+sB4n8q6L+UCfmbPcAo/crQ6b3 +HqhDBMY9J0q/jdz9GNYZ/1fbXdkUqAQKFePhtzJDRBZba27+LPQNMCcrHMq06F1T +4QmLmkHt7LxB2pAczUO+T2O9bHEw/HWw+dYf2MoRDUw= +` + +var outOfRangeSelector = []byte{ + 0x42, 0x5a, 0x68, 0x39, 0x31, 0x41, 0x59, 0x26, + 0x53, 0x59, 0x4e, 0xec, 0xe8, 0x36, 0x00, 0x00, + 0x02, 0x51, 0x80, 0x00, 0x10, 0x40, 0x00, 0x06, + 0x44, 0x90, 0x80, 0x20, 0x00, 0x31, 0x06, 0x4c, + 0x41, 0x01, 0xa7, 0xa9, 0xa5, 0x80, 0xbb, 0x94, + 0x31, 0x17, 0x72, 0x45, 0x38, 0x50, 0x90, 0x00, + 0x00, 0x00, 0x00, +} diff --git a/src/compress/bzip2/huffman.go b/src/compress/bzip2/huffman.go new file mode 100644 index 0000000000000000000000000000000000000000..75a6223d8134c42fb41ba9c95050a2bc2c45271e --- /dev/null +++ b/src/compress/bzip2/huffman.go @@ -0,0 +1,251 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package bzip2 + +import "sort" + +// A huffmanTree is a binary tree which is navigated, bit-by-bit to reach a +// symbol. +type huffmanTree struct { + // nodes contains all the non-leaf nodes in the tree. nodes[0] is the + // root of the tree and nextNode contains the index of the next element + // of nodes to use when the tree is being constructed. + nodes []huffmanNode + nextNode int +} + +// A huffmanNode is a node in the tree. left and right contain indexes into the +// nodes slice of the tree. If left or right is invalidNodeValue then the child +// is a left node and its value is in leftValue/rightValue. +// +// The symbols are uint16s because bzip2 encodes not only MTF indexes in the +// tree, but also two magic values for run-length encoding and an EOF symbol. +// Thus there are more than 256 possible symbols. +type huffmanNode struct { + left, right uint16 + leftValue, rightValue uint16 +} + +// invalidNodeValue is an invalid index which marks a leaf node in the tree. +const invalidNodeValue = 0xffff + +// Decode reads bits from the given bitReader and navigates the tree until a +// symbol is found. +func (t *huffmanTree) Decode(br *bitReader) (v uint16) { + nodeIndex := uint16(0) // node 0 is the root of the tree. + + for { + node := &t.nodes[nodeIndex] + bit, ok := br.TryReadBit() + if !ok && br.ReadBit() { + bit = 1 + } + // bzip2 encodes left as a true bit. + if bit != 0 { + // left + if node.left == invalidNodeValue { + return node.leftValue + } + nodeIndex = node.left + } else { + // right + if node.right == invalidNodeValue { + return node.rightValue + } + nodeIndex = node.right + } + } +} + +// newHuffmanTree builds a Huffman tree from a slice containing the code +// lengths of each symbol. The maximum code length is 32 bits. +func newHuffmanTree(lengths []uint8) (huffmanTree, error) { + // There are many possible trees that assign the same code length to + // each symbol (consider reflecting a tree down the middle, for + // example). Since the code length assignments determine the + // efficiency of the tree, each of these trees is equally good. In + // order to minimize the amount of information needed to build a tree + // bzip2 uses a canonical tree so that it can be reconstructed given + // only the code length assignments. + + if len(lengths) < 2 { + panic("newHuffmanTree: too few symbols") + } + + var t huffmanTree + + // First we sort the code length assignments by ascending code length, + // using the symbol value to break ties. + pairs := huffmanSymbolLengthPairs(make([]huffmanSymbolLengthPair, len(lengths))) + for i, length := range lengths { + pairs[i].value = uint16(i) + pairs[i].length = length + } + + sort.Sort(pairs) + + // Now we assign codes to the symbols, starting with the longest code. + // We keep the codes packed into a uint32, at the most-significant end. + // So branches are taken from the MSB downwards. This makes it easy to + // sort them later. + code := uint32(0) + length := uint8(32) + + codes := huffmanCodes(make([]huffmanCode, len(lengths))) + for i := len(pairs) - 1; i >= 0; i-- { + if length > pairs[i].length { + // If the code length decreases we shift in order to + // zero any bits beyond the end of the code. + length >>= 32 - pairs[i].length + length <<= 32 - pairs[i].length + length = pairs[i].length + } + codes[i].code = code + codes[i].codeLen = length + codes[i].value = pairs[i].value + // We need to 'increment' the code, which means treating |code| + // like a |length| bit number. + code += 1 << (32 - length) + } + + // Now we can sort by the code so that the left half of each branch are + // grouped together, recursively. + sort.Sort(codes) + + t.nodes = make([]huffmanNode, len(codes)) + _, err := buildHuffmanNode(&t, codes, 0) + return t, err +} + +// huffmanSymbolLengthPair contains a symbol and its code length. +type huffmanSymbolLengthPair struct { + value uint16 + length uint8 +} + +// huffmanSymbolLengthPair is used to provide an interface for sorting. +type huffmanSymbolLengthPairs []huffmanSymbolLengthPair + +func (h huffmanSymbolLengthPairs) Len() int { + return len(h) +} + +func (h huffmanSymbolLengthPairs) Less(i, j int) bool { + if h[i].length < h[j].length { + return true + } + if h[i].length > h[j].length { + return false + } + if h[i].value < h[j].value { + return true + } + return false +} + +func (h huffmanSymbolLengthPairs) Swap(i, j int) { + h[i], h[j] = h[j], h[i] +} + +// huffmanCode contains a symbol, its code and code length. +type huffmanCode struct { + code uint32 + codeLen uint8 + value uint16 +} + +// huffmanCodes is used to provide an interface for sorting. +type huffmanCodes []huffmanCode + +func (n huffmanCodes) Len() int { + return len(n) +} + +func (n huffmanCodes) Less(i, j int) bool { + return n[i].code < n[j].code +} + +func (n huffmanCodes) Swap(i, j int) { + n[i], n[j] = n[j], n[i] +} + +// buildHuffmanNode takes a slice of sorted huffmanCodes and builds a node in +// the Huffman tree at the given level. It returns the index of the newly +// constructed node. +func buildHuffmanNode(t *huffmanTree, codes []huffmanCode, level uint32) (nodeIndex uint16, err error) { + test := uint32(1) << (31 - level) + + // We have to search the list of codes to find the divide between the left and right sides. + firstRightIndex := len(codes) + for i, code := range codes { + if code.code&test != 0 { + firstRightIndex = i + break + } + } + + left := codes[:firstRightIndex] + right := codes[firstRightIndex:] + + if len(left) == 0 || len(right) == 0 { + // There is a superfluous level in the Huffman tree indicating + // a bug in the encoder. However, this bug has been observed in + // the wild so we handle it. + + // If this function was called recursively then we know that + // len(codes) >= 2 because, otherwise, we would have hit the + // "leaf node" case, below, and not recursed. + // + // However, for the initial call it's possible that len(codes) + // is zero or one. Both cases are invalid because a zero length + // tree cannot encode anything and a length-1 tree can only + // encode EOF and so is superfluous. We reject both. + if len(codes) < 2 { + return 0, StructuralError("empty Huffman tree") + } + + // In this case the recursion doesn't always reduce the length + // of codes so we need to ensure termination via another + // mechanism. + if level == 31 { + // Since len(codes) >= 2 the only way that the values + // can match at all 32 bits is if they are equal, which + // is invalid. This ensures that we never enter + // infinite recursion. + return 0, StructuralError("equal symbols in Huffman tree") + } + + if len(left) == 0 { + return buildHuffmanNode(t, right, level+1) + } + return buildHuffmanNode(t, left, level+1) + } + + nodeIndex = uint16(t.nextNode) + node := &t.nodes[t.nextNode] + t.nextNode++ + + if len(left) == 1 { + // leaf node + node.left = invalidNodeValue + node.leftValue = left[0].value + } else { + node.left, err = buildHuffmanNode(t, left, level+1) + } + + if err != nil { + return + } + + if len(right) == 1 { + // leaf node + node.right = invalidNodeValue + node.rightValue = right[0].value + } else { + node.right, err = buildHuffmanNode(t, right, level+1) + } + + return +} diff --git a/src/compress/bzip2/move_to_front.go b/src/compress/bzip2/move_to_front.go new file mode 100644 index 0000000000000000000000000000000000000000..526dfb34cc06db6dcc2a61cc35e82b3e3b9bf0af --- /dev/null +++ b/src/compress/bzip2/move_to_front.go @@ -0,0 +1,53 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package bzip2 + +// moveToFrontDecoder implements a move-to-front list. Such a list is an +// efficient way to transform a string with repeating elements into one with +// many small valued numbers, which is suitable for entropy encoding. It works +// by starting with an initial list of symbols and references symbols by their +// index into that list. When a symbol is referenced, it's moved to the front +// of the list. Thus, a repeated symbol ends up being encoded with many zeros, +// as the symbol will be at the front of the list after the first access. +type moveToFrontDecoder []byte + +// newMTFDecoder creates a move-to-front decoder with an explicit initial list +// of symbols. +func newMTFDecoder(symbols []byte) moveToFrontDecoder { + if len(symbols) > 256 { + panic("too many symbols") + } + return moveToFrontDecoder(symbols) +} + +// newMTFDecoderWithRange creates a move-to-front decoder with an initial +// symbol list of 0...n-1. +func newMTFDecoderWithRange(n int) moveToFrontDecoder { + if n > 256 { + panic("newMTFDecoderWithRange: cannot have > 256 symbols") + } + + m := make([]byte, n) + for i := 0; i < n; i++ { + m[i] = byte(i) + } + return moveToFrontDecoder(m) +} + +func (m moveToFrontDecoder) Decode(n int) (b byte) { + // Implement move-to-front with a simple copy. This approach + // beats more sophisticated approaches in benchmarking, probably + // because it has high locality of reference inside of a + // single cache line (most move-to-front operations have n < 64). + b = m[n] + copy(m[1:], m[:n]) + m[0] = b + return +} + +// First returns the symbol at the front of the list. +func (m moveToFrontDecoder) First() byte { + return m[0] +} diff --git a/src/compress/bzip2/testdata/Mark.Twain-Tom.Sawyer.txt.bz2 b/src/compress/bzip2/testdata/Mark.Twain-Tom.Sawyer.txt.bz2 new file mode 100644 index 0000000000000000000000000000000000000000..0bd61a6d4e369a68f7e1cbf2943526814fde53a8 Binary files /dev/null and b/src/compress/bzip2/testdata/Mark.Twain-Tom.Sawyer.txt.bz2 differ diff --git a/src/compress/bzip2/testdata/e.txt.bz2 b/src/compress/bzip2/testdata/e.txt.bz2 new file mode 100644 index 0000000000000000000000000000000000000000..65bf3b4c32a4742140c57c59ed46a06f859f9ca1 Binary files /dev/null and b/src/compress/bzip2/testdata/e.txt.bz2 differ diff --git a/src/compress/flate/copy.go b/src/compress/flate/copy.go new file mode 100644 index 0000000000000000000000000000000000000000..a3200a8f49e8cf106cbc77b0c1029c69877f797a --- /dev/null +++ b/src/compress/flate/copy.go @@ -0,0 +1,32 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package flate + +// forwardCopy is like the built-in copy function except that it always goes +// forward from the start, even if the dst and src overlap. +// It is equivalent to: +// for i := 0; i < n; i++ { +// mem[dst+i] = mem[src+i] +// } +func forwardCopy(mem []byte, dst, src, n int) { + if dst <= src { + copy(mem[dst:dst+n], mem[src:src+n]) + return + } + for { + if dst >= src+n { + copy(mem[dst:dst+n], mem[src:src+n]) + return + } + // There is some forward overlap. The destination + // will be filled with a repeated pattern of mem[src:src+k]. + // We copy one instance of the pattern here, then repeat. + // Each time around this loop k will double. + k := dst - src + copy(mem[dst:dst+k], mem[src:src+k]) + n -= k + dst += k + } +} diff --git a/src/compress/flate/copy_test.go b/src/compress/flate/copy_test.go new file mode 100644 index 0000000000000000000000000000000000000000..2011b1547c934cccae2540cd378b600ce789a0e8 --- /dev/null +++ b/src/compress/flate/copy_test.go @@ -0,0 +1,54 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package flate + +import ( + "testing" +) + +func TestForwardCopy(t *testing.T) { + testCases := []struct { + dst0, dst1 int + src0, src1 int + want string + }{ + {0, 9, 0, 9, "012345678"}, + {0, 5, 4, 9, "45678"}, + {4, 9, 0, 5, "01230"}, + {1, 6, 3, 8, "34567"}, + {3, 8, 1, 6, "12121"}, + {0, 9, 3, 6, "345"}, + {3, 6, 0, 9, "012"}, + {1, 6, 0, 9, "00000"}, + {0, 4, 7, 8, "7"}, + {0, 1, 6, 8, "6"}, + {4, 4, 6, 9, ""}, + {2, 8, 6, 6, ""}, + {0, 0, 0, 0, ""}, + } + for _, tc := range testCases { + b := []byte("0123456789") + n := tc.dst1 - tc.dst0 + if tc.src1-tc.src0 < n { + n = tc.src1 - tc.src0 + } + forwardCopy(b, tc.dst0, tc.src0, n) + got := string(b[tc.dst0 : tc.dst0+n]) + if got != tc.want { + t.Errorf("dst=b[%d:%d], src=b[%d:%d]: got %q, want %q", + tc.dst0, tc.dst1, tc.src0, tc.src1, got, tc.want) + } + // Check that the bytes outside of dst[:n] were not modified. + for i, x := range b { + if i >= tc.dst0 && i < tc.dst0+n { + continue + } + if int(x) != '0'+i { + t.Errorf("dst=b[%d:%d], src=b[%d:%d]: copy overrun at b[%d]: got '%c', want '%c'", + tc.dst0, tc.dst1, tc.src0, tc.src1, i, x, '0'+i) + } + } + } +} diff --git a/src/compress/flate/deflate.go b/src/compress/flate/deflate.go new file mode 100644 index 0000000000000000000000000000000000000000..169a0c7b2ebe4b169212e73ddc7a6539ee8f7ac6 --- /dev/null +++ b/src/compress/flate/deflate.go @@ -0,0 +1,571 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package flate + +import ( + "fmt" + "io" + "math" +) + +const ( + NoCompression = 0 + BestSpeed = 1 + fastCompression = 3 + BestCompression = 9 + DefaultCompression = -1 + logWindowSize = 15 + windowSize = 1 << logWindowSize + windowMask = windowSize - 1 + logMaxOffsetSize = 15 // Standard DEFLATE + minMatchLength = 3 // The smallest match that the compressor looks for + maxMatchLength = 258 // The longest match for the compressor + minOffsetSize = 1 // The shortest offset that makes any sense + + // The maximum number of tokens we put into a single flat block, just to + // stop things from getting too large. + maxFlateBlockTokens = 1 << 14 + maxStoreBlockSize = 65535 + hashBits = 17 + hashSize = 1 << hashBits + hashMask = (1 << hashBits) - 1 + hashShift = (hashBits + minMatchLength - 1) / minMatchLength + maxHashOffset = 1 << 24 + + skipNever = math.MaxInt32 +) + +type compressionLevel struct { + good, lazy, nice, chain, fastSkipHashing int +} + +var levels = []compressionLevel{ + {}, // 0 + // For levels 1-3 we don't bother trying with lazy matches + {3, 0, 8, 4, 4}, + {3, 0, 16, 8, 5}, + {3, 0, 32, 32, 6}, + // Levels 4-9 use increasingly more lazy matching + // and increasingly stringent conditions for "good enough". + {4, 4, 16, 16, skipNever}, + {8, 16, 32, 32, skipNever}, + {8, 16, 128, 128, skipNever}, + {8, 32, 128, 256, skipNever}, + {32, 128, 258, 1024, skipNever}, + {32, 258, 258, 4096, skipNever}, +} + +type compressor struct { + compressionLevel + + w *huffmanBitWriter + + // compression algorithm + fill func(*compressor, []byte) int // copy data to window + step func(*compressor) // process window + sync bool // requesting flush + + // Input hash chains + // hashHead[hashValue] contains the largest inputIndex with the specified hash value + // If hashHead[hashValue] is within the current window, then + // hashPrev[hashHead[hashValue] & windowMask] contains the previous index + // with the same hash value. + chainHead int + hashHead []int + hashPrev []int + hashOffset int + + // input window: unprocessed data is window[index:windowEnd] + index int + window []byte + windowEnd int + blockStart int // window index where current tokens start + byteAvailable bool // if true, still need to process window[index-1]. + + // queued output tokens + tokens []token + + // deflate state + length int + offset int + hash int + maxInsertIndex int + err error +} + +func (d *compressor) fillDeflate(b []byte) int { + if d.index >= 2*windowSize-(minMatchLength+maxMatchLength) { + // shift the window by windowSize + copy(d.window, d.window[windowSize:2*windowSize]) + d.index -= windowSize + d.windowEnd -= windowSize + if d.blockStart >= windowSize { + d.blockStart -= windowSize + } else { + d.blockStart = math.MaxInt32 + } + d.hashOffset += windowSize + if d.hashOffset > maxHashOffset { + delta := d.hashOffset - 1 + d.hashOffset -= delta + d.chainHead -= delta + for i, v := range d.hashPrev { + if v > delta { + d.hashPrev[i] -= delta + } else { + d.hashPrev[i] = 0 + } + } + for i, v := range d.hashHead { + if v > delta { + d.hashHead[i] -= delta + } else { + d.hashHead[i] = 0 + } + } + } + } + n := copy(d.window[d.windowEnd:], b) + d.windowEnd += n + return n +} + +func (d *compressor) writeBlock(tokens []token, index int, eof bool) error { + if index > 0 || eof { + var window []byte + if d.blockStart <= index { + window = d.window[d.blockStart:index] + } + d.blockStart = index + d.w.writeBlock(tokens, eof, window) + return d.w.err + } + return nil +} + +// Try to find a match starting at index whose length is greater than prevSize. +// We only look at chainCount possibilities before giving up. +func (d *compressor) findMatch(pos int, prevHead int, prevLength int, lookahead int) (length, offset int, ok bool) { + minMatchLook := maxMatchLength + if lookahead < minMatchLook { + minMatchLook = lookahead + } + + win := d.window[0 : pos+minMatchLook] + + // We quit when we get a match that's at least nice long + nice := len(win) - pos + if d.nice < nice { + nice = d.nice + } + + // If we've got a match that's good enough, only look in 1/4 the chain. + tries := d.chain + length = prevLength + if length >= d.good { + tries >>= 2 + } + + w0 := win[pos] + w1 := win[pos+1] + wEnd := win[pos+length] + minIndex := pos - windowSize + + for i := prevHead; tries > 0; tries-- { + if w0 == win[i] && w1 == win[i+1] && wEnd == win[i+length] { + // The hash function ensures that if win[i] and win[i+1] match, win[i+2] matches + + n := 3 + for pos+n < len(win) && win[i+n] == win[pos+n] { + n++ + } + if n > length && (n > 3 || pos-i <= 4096) { + length = n + offset = pos - i + ok = true + if n >= nice { + // The match is good enough that we don't try to find a better one. + break + } + wEnd = win[pos+n] + } + } + if i == minIndex { + // hashPrev[i & windowMask] has already been overwritten, so stop now. + break + } + if i = d.hashPrev[i&windowMask] - d.hashOffset; i < minIndex || i < 0 { + break + } + } + return +} + +func (d *compressor) writeStoredBlock(buf []byte) error { + if d.w.writeStoredHeader(len(buf), false); d.w.err != nil { + return d.w.err + } + d.w.writeBytes(buf) + return d.w.err +} + +func (d *compressor) initDeflate() { + d.hashHead = make([]int, hashSize) + d.hashPrev = make([]int, windowSize) + d.window = make([]byte, 2*windowSize) + d.hashOffset = 1 + d.tokens = make([]token, 0, maxFlateBlockTokens+1) + d.length = minMatchLength - 1 + d.offset = 0 + d.byteAvailable = false + d.index = 0 + d.hash = 0 + d.chainHead = -1 +} + +func (d *compressor) deflate() { + if d.windowEnd-d.index < minMatchLength+maxMatchLength && !d.sync { + return + } + + d.maxInsertIndex = d.windowEnd - (minMatchLength - 1) + if d.index < d.maxInsertIndex { + d.hash = int(d.window[d.index])< d.windowEnd { + panic("index > windowEnd") + } + lookahead := d.windowEnd - d.index + if lookahead < minMatchLength+maxMatchLength { + if !d.sync { + break Loop + } + if d.index > d.windowEnd { + panic("index > windowEnd") + } + if lookahead == 0 { + // Flush current output block if any. + if d.byteAvailable { + // There is still one pending token that needs to be flushed + d.tokens = append(d.tokens, literalToken(uint32(d.window[d.index-1]))) + d.byteAvailable = false + } + if len(d.tokens) > 0 { + if d.err = d.writeBlock(d.tokens, d.index, false); d.err != nil { + return + } + d.tokens = d.tokens[:0] + } + break Loop + } + } + if d.index < d.maxInsertIndex { + // Update the hash + d.hash = (d.hash<= minIndex && + (d.fastSkipHashing != skipNever && lookahead > minMatchLength-1 || + d.fastSkipHashing == skipNever && lookahead > prevLength && prevLength < d.lazy) { + if newLength, newOffset, ok := d.findMatch(d.index, d.chainHead-d.hashOffset, minMatchLength-1, lookahead); ok { + d.length = newLength + d.offset = newOffset + } + } + if d.fastSkipHashing != skipNever && d.length >= minMatchLength || + d.fastSkipHashing == skipNever && prevLength >= minMatchLength && d.length <= prevLength { + // There was a match at the previous step, and the current match is + // not better. Output the previous match. + if d.fastSkipHashing != skipNever { + d.tokens = append(d.tokens, matchToken(uint32(d.length-minMatchLength), uint32(d.offset-minOffsetSize))) + } else { + d.tokens = append(d.tokens, matchToken(uint32(prevLength-minMatchLength), uint32(prevOffset-minOffsetSize))) + } + // Insert in the hash table all strings up to the end of the match. + // index and index-1 are already inserted. If there is not enough + // lookahead, the last two strings are not inserted into the hash + // table. + if d.length <= d.fastSkipHashing { + var newIndex int + if d.fastSkipHashing != skipNever { + newIndex = d.index + d.length + } else { + newIndex = d.index + prevLength - 1 + } + for d.index++; d.index < newIndex; d.index++ { + if d.index < d.maxInsertIndex { + d.hash = (d.hash< 0 { + d.err = d.writeStoredBlock(d.window[:d.windowEnd]) + } + d.windowEnd = 0 +} + +func (d *compressor) write(b []byte) (n int, err error) { + n = len(b) + b = b[d.fill(d, b):] + for len(b) > 0 { + d.step(d) + b = b[d.fill(d, b):] + } + return n, d.err +} + +func (d *compressor) syncFlush() error { + d.sync = true + d.step(d) + if d.err == nil { + d.w.writeStoredHeader(0, false) + d.w.flush() + d.err = d.w.err + } + d.sync = false + return d.err +} + +func (d *compressor) init(w io.Writer, level int) (err error) { + d.w = newHuffmanBitWriter(w) + + switch { + case level == NoCompression: + d.window = make([]byte, maxStoreBlockSize) + d.fill = (*compressor).fillStore + d.step = (*compressor).store + case level == DefaultCompression: + level = 6 + fallthrough + case 1 <= level && level <= 9: + d.compressionLevel = levels[level] + d.initDeflate() + d.fill = (*compressor).fillDeflate + d.step = (*compressor).deflate + default: + return fmt.Errorf("flate: invalid compression level %d: want value in range [-1, 9]", level) + } + return nil +} + +var zeroes [32]int +var bzeroes [256]byte + +func (d *compressor) reset(w io.Writer) { + d.w.reset(w) + d.sync = false + d.err = nil + switch d.compressionLevel.chain { + case 0: + // level was NoCompression. + for i := range d.window { + d.window[i] = 0 + } + d.windowEnd = 0 + default: + d.chainHead = -1 + for s := d.hashHead; len(s) > 0; { + n := copy(s, zeroes[:]) + s = s[n:] + } + for s := d.hashPrev; len(s) > 0; s = s[len(zeroes):] { + copy(s, zeroes[:]) + } + d.hashOffset = 1 + + d.index, d.windowEnd = 0, 0 + for s := d.window; len(s) > 0; { + n := copy(s, bzeroes[:]) + s = s[n:] + } + d.blockStart, d.byteAvailable = 0, false + + d.tokens = d.tokens[:maxFlateBlockTokens+1] + for i := 0; i <= maxFlateBlockTokens; i++ { + d.tokens[i] = 0 + } + d.tokens = d.tokens[:0] + d.length = minMatchLength - 1 + d.offset = 0 + d.hash = 0 + d.maxInsertIndex = 0 + } +} + +func (d *compressor) close() error { + d.sync = true + d.step(d) + if d.err != nil { + return d.err + } + if d.w.writeStoredHeader(0, true); d.w.err != nil { + return d.w.err + } + d.w.flush() + return d.w.err +} + +// NewWriter returns a new Writer compressing data at the given level. +// Following zlib, levels range from 1 (BestSpeed) to 9 (BestCompression); +// higher levels typically run slower but compress more. Level 0 +// (NoCompression) does not attempt any compression; it only adds the +// necessary DEFLATE framing. Level -1 (DefaultCompression) uses the default +// compression level. +// +// If level is in the range [-1, 9] then the error returned will be nil. +// Otherwise the error returned will be non-nil. +func NewWriter(w io.Writer, level int) (*Writer, error) { + var dw Writer + if err := dw.d.init(w, level); err != nil { + return nil, err + } + return &dw, nil +} + +// NewWriterDict is like NewWriter but initializes the new +// Writer with a preset dictionary. The returned Writer behaves +// as if the dictionary had been written to it without producing +// any compressed output. The compressed data written to w +// can only be decompressed by a Reader initialized with the +// same dictionary. +func NewWriterDict(w io.Writer, level int, dict []byte) (*Writer, error) { + dw := &dictWriter{w, false} + zw, err := NewWriter(dw, level) + if err != nil { + return nil, err + } + zw.Write(dict) + zw.Flush() + dw.enabled = true + zw.dict = append(zw.dict, dict...) // duplicate dictionary for Reset method. + return zw, err +} + +type dictWriter struct { + w io.Writer + enabled bool +} + +func (w *dictWriter) Write(b []byte) (n int, err error) { + if w.enabled { + return w.w.Write(b) + } + return len(b), nil +} + +// A Writer takes data written to it and writes the compressed +// form of that data to an underlying writer (see NewWriter). +type Writer struct { + d compressor + dict []byte +} + +// Write writes data to w, which will eventually write the +// compressed form of data to its underlying writer. +func (w *Writer) Write(data []byte) (n int, err error) { + return w.d.write(data) +} + +// Flush flushes any pending compressed data to the underlying writer. +// It is useful mainly in compressed network protocols, to ensure that +// a remote reader has enough data to reconstruct a packet. +// Flush does not return until the data has been written. +// If the underlying writer returns an error, Flush returns that error. +// +// In the terminology of the zlib library, Flush is equivalent to Z_SYNC_FLUSH. +func (w *Writer) Flush() error { + // For more about flushing: + // http://www.bolet.org/~pornin/deflate-flush.html + return w.d.syncFlush() +} + +// Close flushes and closes the writer. +func (w *Writer) Close() error { + return w.d.close() +} + +// Reset discards the writer's state and makes it equivalent to +// the result of NewWriter or NewWriterDict called with dst +// and w's level and dictionary. +func (w *Writer) Reset(dst io.Writer) { + if dw, ok := w.d.w.w.(*dictWriter); ok { + // w was created with NewWriterDict + dw.w = dst + w.d.reset(dw) + dw.enabled = false + w.Write(w.dict) + w.Flush() + dw.enabled = true + } else { + // w was created with NewWriter + w.d.reset(dst) + } +} diff --git a/src/compress/flate/deflate_test.go b/src/compress/flate/deflate_test.go new file mode 100644 index 0000000000000000000000000000000000000000..d5d6e732cf1192305a874a79e45f0ee35eb7a3d8 --- /dev/null +++ b/src/compress/flate/deflate_test.go @@ -0,0 +1,490 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package flate + +import ( + "bytes" + "fmt" + "io" + "io/ioutil" + "reflect" + "sync" + "testing" +) + +type deflateTest struct { + in []byte + level int + out []byte +} + +type deflateInflateTest struct { + in []byte +} + +type reverseBitsTest struct { + in uint16 + bitCount uint8 + out uint16 +} + +var deflateTests = []*deflateTest{ + {[]byte{}, 0, []byte{1, 0, 0, 255, 255}}, + {[]byte{0x11}, -1, []byte{18, 4, 4, 0, 0, 255, 255}}, + {[]byte{0x11}, DefaultCompression, []byte{18, 4, 4, 0, 0, 255, 255}}, + {[]byte{0x11}, 4, []byte{18, 4, 4, 0, 0, 255, 255}}, + + {[]byte{0x11}, 0, []byte{0, 1, 0, 254, 255, 17, 1, 0, 0, 255, 255}}, + {[]byte{0x11, 0x12}, 0, []byte{0, 2, 0, 253, 255, 17, 18, 1, 0, 0, 255, 255}}, + {[]byte{0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11}, 0, + []byte{0, 8, 0, 247, 255, 17, 17, 17, 17, 17, 17, 17, 17, 1, 0, 0, 255, 255}, + }, + {[]byte{}, 1, []byte{1, 0, 0, 255, 255}}, + {[]byte{0x11}, 1, []byte{18, 4, 4, 0, 0, 255, 255}}, + {[]byte{0x11, 0x12}, 1, []byte{18, 20, 2, 4, 0, 0, 255, 255}}, + {[]byte{0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11}, 1, []byte{18, 132, 2, 64, 0, 0, 0, 255, 255}}, + {[]byte{}, 9, []byte{1, 0, 0, 255, 255}}, + {[]byte{0x11}, 9, []byte{18, 4, 4, 0, 0, 255, 255}}, + {[]byte{0x11, 0x12}, 9, []byte{18, 20, 2, 4, 0, 0, 255, 255}}, + {[]byte{0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11}, 9, []byte{18, 132, 2, 64, 0, 0, 0, 255, 255}}, +} + +var deflateInflateTests = []*deflateInflateTest{ + {[]byte{}}, + {[]byte{0x11}}, + {[]byte{0x11, 0x12}}, + {[]byte{0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11}}, + {[]byte{0x11, 0x10, 0x13, 0x41, 0x21, 0x21, 0x41, 0x13, 0x87, 0x78, 0x13}}, + {largeDataChunk()}, +} + +var reverseBitsTests = []*reverseBitsTest{ + {1, 1, 1}, + {1, 2, 2}, + {1, 3, 4}, + {1, 4, 8}, + {1, 5, 16}, + {17, 5, 17}, + {257, 9, 257}, + {29, 5, 23}, +} + +func largeDataChunk() []byte { + result := make([]byte, 100000) + for i := range result { + result[i] = byte(i * i & 0xFF) + } + return result +} + +func TestDeflate(t *testing.T) { + for _, h := range deflateTests { + var buf bytes.Buffer + w, err := NewWriter(&buf, h.level) + if err != nil { + t.Errorf("NewWriter: %v", err) + continue + } + w.Write(h.in) + w.Close() + if !bytes.Equal(buf.Bytes(), h.out) { + t.Errorf("Deflate(%d, %x) = %x, want %x", h.level, h.in, buf.Bytes(), h.out) + } + } +} + +// A sparseReader returns a stream consisting of 0s followed by 1<<16 1s. +// This tests missing hash references in a very large input. +type sparseReader struct { + l int64 + cur int64 +} + +func (r *sparseReader) Read(b []byte) (n int, err error) { + if r.cur >= r.l { + return 0, io.EOF + } + n = len(b) + cur := r.cur + int64(n) + if cur > r.l { + n -= int(cur - r.l) + cur = r.l + } + for i := range b[0:n] { + if r.cur+int64(i) >= r.l-1<<16 { + b[i] = 1 + } else { + b[i] = 0 + } + } + r.cur = cur + return +} + +func TestVeryLongSparseChunk(t *testing.T) { + if testing.Short() { + t.Skip("skipping sparse chunk during short test") + } + w, err := NewWriter(ioutil.Discard, 1) + if err != nil { + t.Errorf("NewWriter: %v", err) + return + } + if _, err = io.Copy(w, &sparseReader{l: 23E8}); err != nil { + t.Errorf("Compress failed: %v", err) + return + } +} + +type syncBuffer struct { + buf bytes.Buffer + mu sync.RWMutex + closed bool + ready chan bool +} + +func newSyncBuffer() *syncBuffer { + return &syncBuffer{ready: make(chan bool, 1)} +} + +func (b *syncBuffer) Read(p []byte) (n int, err error) { + for { + b.mu.RLock() + n, err = b.buf.Read(p) + b.mu.RUnlock() + if n > 0 || b.closed { + return + } + <-b.ready + } +} + +func (b *syncBuffer) signal() { + select { + case b.ready <- true: + default: + } +} + +func (b *syncBuffer) Write(p []byte) (n int, err error) { + n, err = b.buf.Write(p) + b.signal() + return +} + +func (b *syncBuffer) WriteMode() { + b.mu.Lock() +} + +func (b *syncBuffer) ReadMode() { + b.mu.Unlock() + b.signal() +} + +func (b *syncBuffer) Close() error { + b.closed = true + b.signal() + return nil +} + +func testSync(t *testing.T, level int, input []byte, name string) { + if len(input) == 0 { + return + } + + t.Logf("--testSync %d, %d, %s", level, len(input), name) + buf := newSyncBuffer() + buf1 := new(bytes.Buffer) + buf.WriteMode() + w, err := NewWriter(io.MultiWriter(buf, buf1), level) + if err != nil { + t.Errorf("NewWriter: %v", err) + return + } + r := NewReader(buf) + + // Write half the input and read back. + for i := 0; i < 2; i++ { + var lo, hi int + if i == 0 { + lo, hi = 0, (len(input)+1)/2 + } else { + lo, hi = (len(input)+1)/2, len(input) + } + t.Logf("#%d: write %d-%d", i, lo, hi) + if _, err := w.Write(input[lo:hi]); err != nil { + t.Errorf("testSync: write: %v", err) + return + } + if i == 0 { + if err := w.Flush(); err != nil { + t.Errorf("testSync: flush: %v", err) + return + } + } else { + if err := w.Close(); err != nil { + t.Errorf("testSync: close: %v", err) + } + } + buf.ReadMode() + out := make([]byte, hi-lo+1) + m, err := io.ReadAtLeast(r, out, hi-lo) + t.Logf("#%d: read %d", i, m) + if m != hi-lo || err != nil { + t.Errorf("testSync/%d (%d, %d, %s): read %d: %d, %v (%d left)", i, level, len(input), name, hi-lo, m, err, buf.buf.Len()) + return + } + if !bytes.Equal(input[lo:hi], out[:hi-lo]) { + t.Errorf("testSync/%d: read wrong bytes: %x vs %x", i, input[lo:hi], out[:hi-lo]) + return + } + // This test originally checked that after reading + // the first half of the input, there was nothing left + // in the read buffer (buf.buf.Len() != 0) but that is + // not necessarily the case: the write Flush may emit + // some extra framing bits that are not necessary + // to process to obtain the first half of the uncompressed + // data. The test ran correctly most of the time, because + // the background goroutine had usually read even + // those extra bits by now, but it's not a useful thing to + // check. + buf.WriteMode() + } + buf.ReadMode() + out := make([]byte, 10) + if n, err := r.Read(out); n > 0 || err != io.EOF { + t.Errorf("testSync (%d, %d, %s): final Read: %d, %v (hex: %x)", level, len(input), name, n, err, out[0:n]) + } + if buf.buf.Len() != 0 { + t.Errorf("testSync (%d, %d, %s): extra data at end", level, len(input), name) + } + r.Close() + + // stream should work for ordinary reader too + r = NewReader(buf1) + out, err = ioutil.ReadAll(r) + if err != nil { + t.Errorf("testSync: read: %s", err) + return + } + r.Close() + if !bytes.Equal(input, out) { + t.Errorf("testSync: decompress(compress(data)) != data: level=%d input=%s", level, name) + } +} + +func testToFromWithLevelAndLimit(t *testing.T, level int, input []byte, name string, limit int) { + var buffer bytes.Buffer + w, err := NewWriter(&buffer, level) + if err != nil { + t.Errorf("NewWriter: %v", err) + return + } + w.Write(input) + w.Close() + if limit > 0 && buffer.Len() > limit { + t.Errorf("level: %d, len(compress(data)) = %d > limit = %d", level, buffer.Len(), limit) + return + } + r := NewReader(&buffer) + out, err := ioutil.ReadAll(r) + if err != nil { + t.Errorf("read: %s", err) + return + } + r.Close() + if !bytes.Equal(input, out) { + t.Errorf("decompress(compress(data)) != data: level=%d input=%s", level, name) + return + } + testSync(t, level, input, name) +} + +func testToFromWithLimit(t *testing.T, input []byte, name string, limit [10]int) { + for i := 0; i < 10; i++ { + testToFromWithLevelAndLimit(t, i, input, name, limit[i]) + } +} + +func TestDeflateInflate(t *testing.T) { + for i, h := range deflateInflateTests { + testToFromWithLimit(t, h.in, fmt.Sprintf("#%d", i), [10]int{}) + } +} + +func TestReverseBits(t *testing.T) { + for _, h := range reverseBitsTests { + if v := reverseBits(h.in, h.bitCount); v != h.out { + t.Errorf("reverseBits(%v,%v) = %v, want %v", + h.in, h.bitCount, v, h.out) + } + } +} + +type deflateInflateStringTest struct { + filename string + label string + limit [10]int +} + +var deflateInflateStringTests = []deflateInflateStringTest{ + { + "../testdata/e.txt", + "2.718281828...", + [...]int{100018, 50650, 50960, 51150, 50930, 50790, 50790, 50790, 50790, 50790}, + }, + { + "../testdata/Mark.Twain-Tom.Sawyer.txt", + "Mark.Twain-Tom.Sawyer", + [...]int{407330, 187598, 180361, 172974, 169160, 163476, 160936, 160506, 160295, 160295}, + }, +} + +func TestDeflateInflateString(t *testing.T) { + for _, test := range deflateInflateStringTests { + gold, err := ioutil.ReadFile(test.filename) + if err != nil { + t.Error(err) + } + testToFromWithLimit(t, gold, test.label, test.limit) + if testing.Short() { + break + } + } +} + +func TestReaderDict(t *testing.T) { + const ( + dict = "hello world" + text = "hello again world" + ) + var b bytes.Buffer + w, err := NewWriter(&b, 5) + if err != nil { + t.Fatalf("NewWriter: %v", err) + } + w.Write([]byte(dict)) + w.Flush() + b.Reset() + w.Write([]byte(text)) + w.Close() + + r := NewReaderDict(&b, []byte(dict)) + data, err := ioutil.ReadAll(r) + if err != nil { + t.Fatal(err) + } + if string(data) != "hello again world" { + t.Fatalf("read returned %q want %q", string(data), text) + } +} + +func TestWriterDict(t *testing.T) { + const ( + dict = "hello world" + text = "hello again world" + ) + var b bytes.Buffer + w, err := NewWriter(&b, 5) + if err != nil { + t.Fatalf("NewWriter: %v", err) + } + w.Write([]byte(dict)) + w.Flush() + b.Reset() + w.Write([]byte(text)) + w.Close() + + var b1 bytes.Buffer + w, _ = NewWriterDict(&b1, 5, []byte(dict)) + w.Write([]byte(text)) + w.Close() + + if !bytes.Equal(b1.Bytes(), b.Bytes()) { + t.Fatalf("writer wrote %q want %q", b1.Bytes(), b.Bytes()) + } +} + +// See https://golang.org/issue/2508 +func TestRegression2508(t *testing.T) { + if testing.Short() { + t.Logf("test disabled with -short") + return + } + w, err := NewWriter(ioutil.Discard, 1) + if err != nil { + t.Fatalf("NewWriter: %v", err) + } + buf := make([]byte, 1024) + for i := 0; i < 131072; i++ { + if _, err := w.Write(buf); err != nil { + t.Fatalf("writer failed: %v", err) + } + } + w.Close() +} + +func TestWriterReset(t *testing.T) { + for level := 0; level <= 9; level++ { + if testing.Short() && level > 1 { + break + } + w, err := NewWriter(ioutil.Discard, level) + if err != nil { + t.Fatalf("NewWriter: %v", err) + } + buf := []byte("hello world") + for i := 0; i < 1024; i++ { + w.Write(buf) + } + w.Reset(ioutil.Discard) + + wref, err := NewWriter(ioutil.Discard, level) + if err != nil { + t.Fatalf("NewWriter: %v", err) + } + + // DeepEqual doesn't compare functions. + w.d.fill, wref.d.fill = nil, nil + w.d.step, wref.d.step = nil, nil + if !reflect.DeepEqual(w, wref) { + t.Errorf("level %d Writer not reset after Reset", level) + } + } + testResetOutput(t, func(w io.Writer) (*Writer, error) { return NewWriter(w, NoCompression) }) + testResetOutput(t, func(w io.Writer) (*Writer, error) { return NewWriter(w, DefaultCompression) }) + testResetOutput(t, func(w io.Writer) (*Writer, error) { return NewWriter(w, BestCompression) }) + dict := []byte("we are the world") + testResetOutput(t, func(w io.Writer) (*Writer, error) { return NewWriterDict(w, NoCompression, dict) }) + testResetOutput(t, func(w io.Writer) (*Writer, error) { return NewWriterDict(w, DefaultCompression, dict) }) + testResetOutput(t, func(w io.Writer) (*Writer, error) { return NewWriterDict(w, BestCompression, dict) }) +} + +func testResetOutput(t *testing.T, newWriter func(w io.Writer) (*Writer, error)) { + buf := new(bytes.Buffer) + w, err := newWriter(buf) + if err != nil { + t.Fatalf("NewWriter: %v", err) + } + b := []byte("hello world") + for i := 0; i < 1024; i++ { + w.Write(b) + } + w.Close() + out1 := buf.String() + + buf2 := new(bytes.Buffer) + w.Reset(buf2) + for i := 0; i < 1024; i++ { + w.Write(b) + } + w.Close() + out2 := buf2.String() + + if out1 != out2 { + t.Errorf("got %q, expected %q", out2, out1) + } + t.Logf("got %d bytes", len(out1)) +} diff --git a/src/compress/flate/fixedhuff.go b/src/compress/flate/fixedhuff.go new file mode 100644 index 0000000000000000000000000000000000000000..7df8b9a293f796637caa09df0678ea43bb2be702 --- /dev/null +++ b/src/compress/flate/fixedhuff.go @@ -0,0 +1,78 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package flate + +// autogenerated by go run gen.go -output fixedhuff.go, DO NOT EDIT + +var fixedHuffmanDecoder = huffmanDecoder{ + 7, + [huffmanNumChunks]uint32{ + 0x1007, 0x0508, 0x0108, 0x1188, 0x1107, 0x0708, 0x0308, 0x0c09, + 0x1087, 0x0608, 0x0208, 0x0a09, 0x0008, 0x0808, 0x0408, 0x0e09, + 0x1047, 0x0588, 0x0188, 0x0909, 0x1147, 0x0788, 0x0388, 0x0d09, + 0x10c7, 0x0688, 0x0288, 0x0b09, 0x0088, 0x0888, 0x0488, 0x0f09, + 0x1027, 0x0548, 0x0148, 0x11c8, 0x1127, 0x0748, 0x0348, 0x0c89, + 0x10a7, 0x0648, 0x0248, 0x0a89, 0x0048, 0x0848, 0x0448, 0x0e89, + 0x1067, 0x05c8, 0x01c8, 0x0989, 0x1167, 0x07c8, 0x03c8, 0x0d89, + 0x10e7, 0x06c8, 0x02c8, 0x0b89, 0x00c8, 0x08c8, 0x04c8, 0x0f89, + 0x1017, 0x0528, 0x0128, 0x11a8, 0x1117, 0x0728, 0x0328, 0x0c49, + 0x1097, 0x0628, 0x0228, 0x0a49, 0x0028, 0x0828, 0x0428, 0x0e49, + 0x1057, 0x05a8, 0x01a8, 0x0949, 0x1157, 0x07a8, 0x03a8, 0x0d49, + 0x10d7, 0x06a8, 0x02a8, 0x0b49, 0x00a8, 0x08a8, 0x04a8, 0x0f49, + 0x1037, 0x0568, 0x0168, 0x11e8, 0x1137, 0x0768, 0x0368, 0x0cc9, + 0x10b7, 0x0668, 0x0268, 0x0ac9, 0x0068, 0x0868, 0x0468, 0x0ec9, + 0x1077, 0x05e8, 0x01e8, 0x09c9, 0x1177, 0x07e8, 0x03e8, 0x0dc9, + 0x10f7, 0x06e8, 0x02e8, 0x0bc9, 0x00e8, 0x08e8, 0x04e8, 0x0fc9, + 0x1007, 0x0518, 0x0118, 0x1198, 0x1107, 0x0718, 0x0318, 0x0c29, + 0x1087, 0x0618, 0x0218, 0x0a29, 0x0018, 0x0818, 0x0418, 0x0e29, + 0x1047, 0x0598, 0x0198, 0x0929, 0x1147, 0x0798, 0x0398, 0x0d29, + 0x10c7, 0x0698, 0x0298, 0x0b29, 0x0098, 0x0898, 0x0498, 0x0f29, + 0x1027, 0x0558, 0x0158, 0x11d8, 0x1127, 0x0758, 0x0358, 0x0ca9, + 0x10a7, 0x0658, 0x0258, 0x0aa9, 0x0058, 0x0858, 0x0458, 0x0ea9, + 0x1067, 0x05d8, 0x01d8, 0x09a9, 0x1167, 0x07d8, 0x03d8, 0x0da9, + 0x10e7, 0x06d8, 0x02d8, 0x0ba9, 0x00d8, 0x08d8, 0x04d8, 0x0fa9, + 0x1017, 0x0538, 0x0138, 0x11b8, 0x1117, 0x0738, 0x0338, 0x0c69, + 0x1097, 0x0638, 0x0238, 0x0a69, 0x0038, 0x0838, 0x0438, 0x0e69, + 0x1057, 0x05b8, 0x01b8, 0x0969, 0x1157, 0x07b8, 0x03b8, 0x0d69, + 0x10d7, 0x06b8, 0x02b8, 0x0b69, 0x00b8, 0x08b8, 0x04b8, 0x0f69, + 0x1037, 0x0578, 0x0178, 0x11f8, 0x1137, 0x0778, 0x0378, 0x0ce9, + 0x10b7, 0x0678, 0x0278, 0x0ae9, 0x0078, 0x0878, 0x0478, 0x0ee9, + 0x1077, 0x05f8, 0x01f8, 0x09e9, 0x1177, 0x07f8, 0x03f8, 0x0de9, + 0x10f7, 0x06f8, 0x02f8, 0x0be9, 0x00f8, 0x08f8, 0x04f8, 0x0fe9, + 0x1007, 0x0508, 0x0108, 0x1188, 0x1107, 0x0708, 0x0308, 0x0c19, + 0x1087, 0x0608, 0x0208, 0x0a19, 0x0008, 0x0808, 0x0408, 0x0e19, + 0x1047, 0x0588, 0x0188, 0x0919, 0x1147, 0x0788, 0x0388, 0x0d19, + 0x10c7, 0x0688, 0x0288, 0x0b19, 0x0088, 0x0888, 0x0488, 0x0f19, + 0x1027, 0x0548, 0x0148, 0x11c8, 0x1127, 0x0748, 0x0348, 0x0c99, + 0x10a7, 0x0648, 0x0248, 0x0a99, 0x0048, 0x0848, 0x0448, 0x0e99, + 0x1067, 0x05c8, 0x01c8, 0x0999, 0x1167, 0x07c8, 0x03c8, 0x0d99, + 0x10e7, 0x06c8, 0x02c8, 0x0b99, 0x00c8, 0x08c8, 0x04c8, 0x0f99, + 0x1017, 0x0528, 0x0128, 0x11a8, 0x1117, 0x0728, 0x0328, 0x0c59, + 0x1097, 0x0628, 0x0228, 0x0a59, 0x0028, 0x0828, 0x0428, 0x0e59, + 0x1057, 0x05a8, 0x01a8, 0x0959, 0x1157, 0x07a8, 0x03a8, 0x0d59, + 0x10d7, 0x06a8, 0x02a8, 0x0b59, 0x00a8, 0x08a8, 0x04a8, 0x0f59, + 0x1037, 0x0568, 0x0168, 0x11e8, 0x1137, 0x0768, 0x0368, 0x0cd9, + 0x10b7, 0x0668, 0x0268, 0x0ad9, 0x0068, 0x0868, 0x0468, 0x0ed9, + 0x1077, 0x05e8, 0x01e8, 0x09d9, 0x1177, 0x07e8, 0x03e8, 0x0dd9, + 0x10f7, 0x06e8, 0x02e8, 0x0bd9, 0x00e8, 0x08e8, 0x04e8, 0x0fd9, + 0x1007, 0x0518, 0x0118, 0x1198, 0x1107, 0x0718, 0x0318, 0x0c39, + 0x1087, 0x0618, 0x0218, 0x0a39, 0x0018, 0x0818, 0x0418, 0x0e39, + 0x1047, 0x0598, 0x0198, 0x0939, 0x1147, 0x0798, 0x0398, 0x0d39, + 0x10c7, 0x0698, 0x0298, 0x0b39, 0x0098, 0x0898, 0x0498, 0x0f39, + 0x1027, 0x0558, 0x0158, 0x11d8, 0x1127, 0x0758, 0x0358, 0x0cb9, + 0x10a7, 0x0658, 0x0258, 0x0ab9, 0x0058, 0x0858, 0x0458, 0x0eb9, + 0x1067, 0x05d8, 0x01d8, 0x09b9, 0x1167, 0x07d8, 0x03d8, 0x0db9, + 0x10e7, 0x06d8, 0x02d8, 0x0bb9, 0x00d8, 0x08d8, 0x04d8, 0x0fb9, + 0x1017, 0x0538, 0x0138, 0x11b8, 0x1117, 0x0738, 0x0338, 0x0c79, + 0x1097, 0x0638, 0x0238, 0x0a79, 0x0038, 0x0838, 0x0438, 0x0e79, + 0x1057, 0x05b8, 0x01b8, 0x0979, 0x1157, 0x07b8, 0x03b8, 0x0d79, + 0x10d7, 0x06b8, 0x02b8, 0x0b79, 0x00b8, 0x08b8, 0x04b8, 0x0f79, + 0x1037, 0x0578, 0x0178, 0x11f8, 0x1137, 0x0778, 0x0378, 0x0cf9, + 0x10b7, 0x0678, 0x0278, 0x0af9, 0x0078, 0x0878, 0x0478, 0x0ef9, + 0x1077, 0x05f8, 0x01f8, 0x09f9, 0x1177, 0x07f8, 0x03f8, 0x0df9, + 0x10f7, 0x06f8, 0x02f8, 0x0bf9, 0x00f8, 0x08f8, 0x04f8, 0x0ff9, + }, + nil, 0, +} diff --git a/src/compress/flate/flate_test.go b/src/compress/flate/flate_test.go new file mode 100644 index 0000000000000000000000000000000000000000..3f67025cd76b5f98ba26bc615dd87a80d28bd583 --- /dev/null +++ b/src/compress/flate/flate_test.go @@ -0,0 +1,260 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// This test tests some internals of the flate package. +// The tests in package compress/gzip serve as the +// end-to-end test of the decompressor. + +package flate + +import ( + "bytes" + "encoding/hex" + "io/ioutil" + "testing" +) + +// The following test should not panic. +func TestIssue5915(t *testing.T) { + bits := []int{4, 0, 0, 6, 4, 3, 2, 3, 3, 4, 4, 5, 0, 0, 0, 0, 5, 5, 6, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 8, 6, 0, 11, 0, 8, 0, 6, 6, 10, 8} + var h huffmanDecoder + if h.init(bits) { + t.Fatalf("Given sequence of bits is bad, and should not succeed.") + } +} + +// The following test should not panic. +func TestIssue5962(t *testing.T) { + bits := []int{4, 0, 0, 6, 4, 3, 2, 3, 3, 4, 4, 5, 0, 0, 0, 0, + 5, 5, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11} + var h huffmanDecoder + if h.init(bits) { + t.Fatalf("Given sequence of bits is bad, and should not succeed.") + } +} + +// The following test should not panic. +func TestIssue6255(t *testing.T) { + bits1 := []int{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 11} + bits2 := []int{11, 13} + var h huffmanDecoder + if !h.init(bits1) { + t.Fatalf("Given sequence of bits is good and should succeed.") + } + if h.init(bits2) { + t.Fatalf("Given sequence of bits is bad and should not succeed.") + } +} + +func TestInvalidEncoding(t *testing.T) { + // Initialize Huffman decoder to recognize "0". + var h huffmanDecoder + if !h.init([]int{1}) { + t.Fatal("Failed to initialize Huffman decoder") + } + + // Initialize decompressor with invalid Huffman coding. + var f decompressor + f.r = bytes.NewReader([]byte{0xff}) + + _, err := f.huffSym(&h) + if err == nil { + t.Fatal("Should have rejected invalid bit sequence") + } +} + +func TestInvalidBits(t *testing.T) { + oversubscribed := []int{1, 2, 3, 4, 4, 5} + incomplete := []int{1, 2, 4, 4} + var h huffmanDecoder + if h.init(oversubscribed) { + t.Fatal("Should reject oversubscribed bit-length set") + } + if h.init(incomplete) { + t.Fatal("Should reject incomplete bit-length set") + } +} + +func TestStreams(t *testing.T) { + // To verify any of these hexstrings as valid or invalid flate streams + // according to the C zlib library, you can use the Python wrapper library: + // >>> hex_string = "010100feff11" + // >>> import zlib + // >>> zlib.decompress(hex_string.decode("hex"), -15) # Negative means raw DEFLATE + // '\x11' + + testCases := []struct { + desc string // Description of the stream + stream string // Hexstring of the input DEFLATE stream + want string // Expected result. Use "fail" to expect failure + }{{ + "degenerate HCLenTree", + "05e0010000000000100000000000000000000000000000000000000000000000" + + "00000000000000000004", + "fail", + }, { + "complete HCLenTree, empty HLitTree, empty HDistTree", + "05e0010400000000000000000000000000000000000000000000000000000000" + + "00000000000000000010", + "fail", + }, { + "empty HCLenTree", + "05e0010000000000000000000000000000000000000000000000000000000000" + + "00000000000000000010", + "fail", + }, { + "complete HCLenTree, complete HLitTree, empty HDistTree, use missing HDist symbol", + "000100feff000de0010400000000100000000000000000000000000000000000" + + "0000000000000000000000000000002c", + "fail", + }, { + "complete HCLenTree, complete HLitTree, degenerate HDistTree, use missing HDist symbol", + "000100feff000de0010000000000000000000000000000000000000000000000" + + "00000000000000000610000000004070", + "fail", + }, { + "complete HCLenTree, empty HLitTree, empty HDistTree", + "05e0010400000000100400000000000000000000000000000000000000000000" + + "0000000000000000000000000008", + "fail", + }, { + "complete HCLenTree, empty HLitTree, degenerate HDistTree", + "05e0010400000000100400000000000000000000000000000000000000000000" + + "0000000000000000000800000008", + "fail", + }, { + "complete HCLenTree, degenerate HLitTree, degenerate HDistTree, use missing HLit symbol", + "05e0010400000000100000000000000000000000000000000000000000000000" + + "0000000000000000001c", + "fail", + }, { + "complete HCLenTree, complete HLitTree, too large HDistTree", + "edff870500000000200400000000000000000000000000000000000000000000" + + "000000000000000000080000000000000004", + "fail", + }, { + "complete HCLenTree, complete HLitTree, empty HDistTree, excessive repeater code", + "edfd870500000000200400000000000000000000000000000000000000000000" + + "000000000000000000e8b100", + "fail", + }, { + "complete HCLenTree, complete HLitTree, empty HDistTree of normal length 30", + "05fd01240000000000f8ffffffffffffffffffffffffffffffffffffffffffff" + + "ffffffffffffffffff07000000fe01", + "", + }, { + "complete HCLenTree, complete HLitTree, empty HDistTree of excessive length 31", + "05fe01240000000000f8ffffffffffffffffffffffffffffffffffffffffffff" + + "ffffffffffffffffff07000000fc03", + "fail", + }, { + "complete HCLenTree, over-subscribed HLitTree, empty HDistTree", + "05e001240000000000fcffffffffffffffffffffffffffffffffffffffffffff" + + "ffffffffffffffffff07f00f", + "fail", + }, { + "complete HCLenTree, under-subscribed HLitTree, empty HDistTree", + "05e001240000000000fcffffffffffffffffffffffffffffffffffffffffffff" + + "fffffffffcffffffff07f00f", + "fail", + }, { + "complete HCLenTree, complete HLitTree with single code, empty HDistTree", + "05e001240000000000f8ffffffffffffffffffffffffffffffffffffffffffff" + + "ffffffffffffffffff07f00f", + "01", + }, { + "complete HCLenTree, complete HLitTree with multiple codes, empty HDistTree", + "05e301240000000000f8ffffffffffffffffffffffffffffffffffffffffffff" + + "ffffffffffffffffff07807f", + "01", + }, { + "complete HCLenTree, complete HLitTree, degenerate HDistTree, use valid HDist symbol", + "000100feff000de0010400000000100000000000000000000000000000000000" + + "0000000000000000000000000000003c", + "00000000", + }, { + "complete HCLenTree, degenerate HLitTree, degenerate HDistTree", + "05e0010400000000100000000000000000000000000000000000000000000000" + + "0000000000000000000c", + "", + }, { + "complete HCLenTree, degenerate HLitTree, empty HDistTree", + "05e0010400000000100000000000000000000000000000000000000000000000" + + "00000000000000000004", + "", + }, { + "complete HCLenTree, complete HLitTree, empty HDistTree, spanning repeater code", + "edfd870500000000200400000000000000000000000000000000000000000000" + + "000000000000000000e8b000", + "", + }, { + "complete HCLenTree with length codes, complete HLitTree, empty HDistTree", + "ede0010400000000100000000000000000000000000000000000000000000000" + + "0000000000000000000400004000", + "", + }, { + "complete HCLenTree, complete HLitTree, degenerate HDistTree, use valid HLit symbol 284 with count 31", + "000100feff00ede0010400000000100000000000000000000000000000000000" + + "000000000000000000000000000000040000407f00", + "0000000000000000000000000000000000000000000000000000000000000000" + + "0000000000000000000000000000000000000000000000000000000000000000" + + "0000000000000000000000000000000000000000000000000000000000000000" + + "0000000000000000000000000000000000000000000000000000000000000000" + + "0000000000000000000000000000000000000000000000000000000000000000" + + "0000000000000000000000000000000000000000000000000000000000000000" + + "0000000000000000000000000000000000000000000000000000000000000000" + + "0000000000000000000000000000000000000000000000000000000000000000" + + "000000", + }, { + "complete HCLenTree, complete HLitTree, degenerate HDistTree, use valid HLit and HDist symbols", + "0cc2010d00000082b0ac4aff0eb07d27060000ffff", + "616263616263", + }, { + "fixed block, use reserved symbol 287", + "33180700", + "fail", + }, { + "raw block", + "010100feff11", + "11", + }, { + "issue 10426 - over-subscribed HCLenTree causes a hang", + "344c4a4e494d4b070000ff2e2eff2e2e2e2e2eff", + "fail", + }, { + "issue 11030 - empty HDistTree unexpectedly leads to error", + "05c0070600000080400fff37a0ca", + "", + }, { + "issue 11033 - empty HDistTree unexpectedly leads to error", + "050fb109c020cca5d017dcbca044881ee1034ec149c8980bbc413c2ab35be9dc" + + "b1473449922449922411202306ee97b0383a521b4ffdcf3217f9f7d3adb701", + "3130303634342068652e706870005d05355f7ed957ff084a90925d19e3ebc6d0" + + "c6d7", + }} + + for i, tc := range testCases { + data, err := hex.DecodeString(tc.stream) + if err != nil { + t.Fatal(err) + } + data, err = ioutil.ReadAll(NewReader(bytes.NewReader(data))) + if tc.want == "fail" { + if err == nil { + t.Errorf("#%d (%s): got nil error, want non-nil", i, tc.desc) + } + } else { + if err != nil { + t.Errorf("#%d (%s): %v", i, tc.desc, err) + continue + } + if got := hex.EncodeToString(data); got != tc.want { + t.Errorf("#%d (%s):\ngot %q\nwant %q", i, tc.desc, got, tc.want) + } + + } + } +} diff --git a/src/compress/flate/gen.go b/src/compress/flate/gen.go new file mode 100644 index 0000000000000000000000000000000000000000..154c89a488e08c2ed8d321e6034d88124a7e0b8e --- /dev/null +++ b/src/compress/flate/gen.go @@ -0,0 +1,265 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build ignore + +// This program generates fixedhuff.go +// Invoke as +// +// go run gen.go -output fixedhuff.go + +package main + +import ( + "bytes" + "flag" + "fmt" + "go/format" + "io/ioutil" + "log" +) + +var filename = flag.String("output", "fixedhuff.go", "output file name") + +const maxCodeLen = 16 + +// Note: the definition of the huffmanDecoder struct is copied from +// inflate.go, as it is private to the implementation. + +// chunk & 15 is number of bits +// chunk >> 4 is value, including table link + +const ( + huffmanChunkBits = 9 + huffmanNumChunks = 1 << huffmanChunkBits + huffmanCountMask = 15 + huffmanValueShift = 4 +) + +type huffmanDecoder struct { + min int // the minimum code length + chunks [huffmanNumChunks]uint32 // chunks as described above + links [][]uint32 // overflow links + linkMask uint32 // mask the width of the link table +} + +// Initialize Huffman decoding tables from array of code lengths. +// Following this function, h is guaranteed to be initialized into a complete +// tree (i.e., neither over-subscribed nor under-subscribed). The exception is a +// degenerate case where the tree has only a single symbol with length 1. Empty +// trees are permitted. +func (h *huffmanDecoder) init(bits []int) bool { + // Sanity enables additional runtime tests during Huffman + // table construction. It's intended to be used during + // development to supplement the currently ad-hoc unit tests. + const sanity = false + + if h.min != 0 { + *h = huffmanDecoder{} + } + + // Count number of codes of each length, + // compute min and max length. + var count [maxCodeLen]int + var min, max int + for _, n := range bits { + if n == 0 { + continue + } + if min == 0 || n < min { + min = n + } + if n > max { + max = n + } + count[n]++ + } + + // Empty tree. The decompressor.huffSym function will fail later if the tree + // is used. Technically, an empty tree is only valid for the HDIST tree and + // not the HCLEN and HLIT tree. However, a stream with an empty HCLEN tree + // is guaranteed to fail since it will attempt to use the tree to decode the + // codes for the HLIT and HDIST trees. Similarly, an empty HLIT tree is + // guaranteed to fail later since the compressed data section must be + // composed of at least one symbol (the end-of-block marker). + if max == 0 { + return true + } + + code := 0 + var nextcode [maxCodeLen]int + for i := min; i <= max; i++ { + code <<= 1 + nextcode[i] = code + code += count[i] + } + + // Check that the coding is complete (i.e., that we've + // assigned all 2-to-the-max possible bit sequences). + // Exception: To be compatible with zlib, we also need to + // accept degenerate single-code codings. See also + // TestDegenerateHuffmanCoding. + if code != 1< huffmanChunkBits { + numLinks := 1 << (uint(max) - huffmanChunkBits) + h.linkMask = uint32(numLinks - 1) + + // create link tables + link := nextcode[huffmanChunkBits+1] >> 1 + h.links = make([][]uint32, huffmanNumChunks-link) + for j := uint(link); j < huffmanNumChunks; j++ { + reverse := int(reverseByte[j>>8]) | int(reverseByte[j&0xff])<<8 + reverse >>= uint(16 - huffmanChunkBits) + off := j - uint(link) + if sanity && h.chunks[reverse] != 0 { + panic("impossible: overwriting existing chunk") + } + h.chunks[reverse] = uint32(off<>8]) | int(reverseByte[code&0xff])<<8 + reverse >>= uint(16 - n) + if n <= huffmanChunkBits { + for off := reverse; off < len(h.chunks); off += 1 << uint(n) { + // We should never need to overwrite + // an existing chunk. Also, 0 is + // never a valid chunk, because the + // lower 4 "count" bits should be + // between 1 and 15. + if sanity && h.chunks[off] != 0 { + panic("impossible: overwriting existing chunk") + } + h.chunks[off] = chunk + } + } else { + j := reverse & (huffmanNumChunks - 1) + if sanity && h.chunks[j]&huffmanCountMask != huffmanChunkBits+1 { + // Longer codes should have been + // associated with a link table above. + panic("impossible: not an indirect chunk") + } + value := h.chunks[j] >> huffmanValueShift + linktab := h.links[value] + reverse >>= huffmanChunkBits + for off := reverse; off < len(linktab); off += 1 << uint(n-huffmanChunkBits) { + if sanity && linktab[off] != 0 { + panic("impossible: overwriting existing chunk") + } + linktab[off] = chunk + } + } + } + + if sanity { + // Above we've sanity checked that we never overwrote + // an existing entry. Here we additionally check that + // we filled the tables completely. + for i, chunk := range h.chunks { + if chunk == 0 { + // As an exception, in the degenerate + // single-code case, we allow odd + // chunks to be missing. + if code == 1 && i%2 == 1 { + continue + } + panic("impossible: missing chunk") + } + } + for _, linktab := range h.links { + for _, chunk := range linktab { + if chunk == 0 { + panic("impossible: missing chunk") + } + } + } + } + + return true +} + +func main() { + flag.Parse() + + var h huffmanDecoder + var bits [288]int + initReverseByte() + for i := 0; i < 144; i++ { + bits[i] = 8 + } + for i := 144; i < 256; i++ { + bits[i] = 9 + } + for i := 256; i < 280; i++ { + bits[i] = 7 + } + for i := 280; i < 288; i++ { + bits[i] = 8 + } + h.init(bits[:]) + if h.links != nil { + log.Fatal("Unexpected links table in fixed Huffman decoder") + } + + var buf bytes.Buffer + + fmt.Fprintf(&buf, `// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file.`+"\n\n") + + fmt.Fprintln(&buf, "package flate") + fmt.Fprintln(&buf) + fmt.Fprintln(&buf, "// autogenerated by go run gen.go -output fixedhuff.go, DO NOT EDIT") + fmt.Fprintln(&buf) + fmt.Fprintln(&buf, "var fixedHuffmanDecoder = huffmanDecoder{") + fmt.Fprintf(&buf, "\t%d,\n", h.min) + fmt.Fprintln(&buf, "\t[huffmanNumChunks]uint32{") + for i := 0; i < huffmanNumChunks; i++ { + if i&7 == 0 { + fmt.Fprintf(&buf, "\t\t") + } else { + fmt.Fprintf(&buf, " ") + } + fmt.Fprintf(&buf, "0x%04x,", h.chunks[i]) + if i&7 == 7 { + fmt.Fprintln(&buf) + } + } + fmt.Fprintln(&buf, "\t},") + fmt.Fprintln(&buf, "\tnil, 0,") + fmt.Fprintln(&buf, "}") + + data, err := format.Source(buf.Bytes()) + if err != nil { + log.Fatal(err) + } + err = ioutil.WriteFile(*filename, data, 0644) + if err != nil { + log.Fatal(err) + } +} + +var reverseByte [256]byte + +func initReverseByte() { + for x := 0; x < 256; x++ { + var result byte + for i := uint(0); i < 8; i++ { + result |= byte(((x >> i) & 1) << (7 - i)) + } + reverseByte[x] = result + } +} diff --git a/src/compress/flate/huffman_bit_writer.go b/src/compress/flate/huffman_bit_writer.go new file mode 100644 index 0000000000000000000000000000000000000000..616440412e4b2b869d22859bd873ea43a8145286 --- /dev/null +++ b/src/compress/flate/huffman_bit_writer.go @@ -0,0 +1,517 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package flate + +import ( + "io" + "math" +) + +const ( + // The largest offset code. + offsetCodeCount = 30 + + // The special code used to mark the end of a block. + endBlockMarker = 256 + + // The first length code. + lengthCodesStart = 257 + + // The number of codegen codes. + codegenCodeCount = 19 + badCode = 255 +) + +// The number of extra bits needed by length code X - LENGTH_CODES_START. +var lengthExtraBits = []int8{ + /* 257 */ 0, 0, 0, + /* 260 */ 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, + /* 270 */ 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, + /* 280 */ 4, 5, 5, 5, 5, 0, +} + +// The length indicated by length code X - LENGTH_CODES_START. +var lengthBase = []uint32{ + 0, 1, 2, 3, 4, 5, 6, 7, 8, 10, + 12, 14, 16, 20, 24, 28, 32, 40, 48, 56, + 64, 80, 96, 112, 128, 160, 192, 224, 255, +} + +// offset code word extra bits. +var offsetExtraBits = []int8{ + 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, + 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, + 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, + /* extended window */ + 14, 14, 15, 15, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, +} + +var offsetBase = []uint32{ + /* normal deflate */ + 0x000000, 0x000001, 0x000002, 0x000003, 0x000004, + 0x000006, 0x000008, 0x00000c, 0x000010, 0x000018, + 0x000020, 0x000030, 0x000040, 0x000060, 0x000080, + 0x0000c0, 0x000100, 0x000180, 0x000200, 0x000300, + 0x000400, 0x000600, 0x000800, 0x000c00, 0x001000, + 0x001800, 0x002000, 0x003000, 0x004000, 0x006000, + + /* extended window */ + 0x008000, 0x00c000, 0x010000, 0x018000, 0x020000, + 0x030000, 0x040000, 0x060000, 0x080000, 0x0c0000, + 0x100000, 0x180000, 0x200000, 0x300000, +} + +// The odd order in which the codegen code sizes are written. +var codegenOrder = []uint32{16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15} + +type huffmanBitWriter struct { + w io.Writer + // Data waiting to be written is bytes[0:nbytes] + // and then the low nbits of bits. + bits uint32 + nbits uint32 + bytes [64]byte + nbytes int + literalFreq []int32 + offsetFreq []int32 + codegen []uint8 + codegenFreq []int32 + literalEncoding *huffmanEncoder + offsetEncoding *huffmanEncoder + codegenEncoding *huffmanEncoder + err error +} + +func newHuffmanBitWriter(w io.Writer) *huffmanBitWriter { + return &huffmanBitWriter{ + w: w, + literalFreq: make([]int32, maxNumLit), + offsetFreq: make([]int32, offsetCodeCount), + codegen: make([]uint8, maxNumLit+offsetCodeCount+1), + codegenFreq: make([]int32, codegenCodeCount), + literalEncoding: newHuffmanEncoder(maxNumLit), + offsetEncoding: newHuffmanEncoder(offsetCodeCount), + codegenEncoding: newHuffmanEncoder(codegenCodeCount), + } +} + +func (w *huffmanBitWriter) reset(writer io.Writer) { + w.w = writer + w.bits, w.nbits, w.nbytes, w.err = 0, 0, 0, nil + w.bytes = [64]byte{} + for i := range w.codegen { + w.codegen[i] = 0 + } + for _, s := range [...][]int32{w.literalFreq, w.offsetFreq, w.codegenFreq} { + for i := range s { + s[i] = 0 + } + } + for _, enc := range [...]*huffmanEncoder{ + w.literalEncoding, + w.offsetEncoding, + w.codegenEncoding} { + for i := range enc.code { + enc.code[i] = 0 + } + for i := range enc.codeBits { + enc.codeBits[i] = 0 + } + } +} + +func (w *huffmanBitWriter) flushBits() { + if w.err != nil { + w.nbits = 0 + return + } + bits := w.bits + w.bits >>= 16 + w.nbits -= 16 + n := w.nbytes + w.bytes[n] = byte(bits) + w.bytes[n+1] = byte(bits >> 8) + if n += 2; n >= len(w.bytes) { + _, w.err = w.w.Write(w.bytes[0:]) + n = 0 + } + w.nbytes = n +} + +func (w *huffmanBitWriter) flush() { + if w.err != nil { + w.nbits = 0 + return + } + n := w.nbytes + if w.nbits > 8 { + w.bytes[n] = byte(w.bits) + w.bits >>= 8 + w.nbits -= 8 + n++ + } + if w.nbits > 0 { + w.bytes[n] = byte(w.bits) + w.nbits = 0 + n++ + } + w.bits = 0 + _, w.err = w.w.Write(w.bytes[0:n]) + w.nbytes = 0 +} + +func (w *huffmanBitWriter) writeBits(b, nb int32) { + w.bits |= uint32(b) << w.nbits + if w.nbits += uint32(nb); w.nbits >= 16 { + w.flushBits() + } +} + +func (w *huffmanBitWriter) writeBytes(bytes []byte) { + if w.err != nil { + return + } + n := w.nbytes + if w.nbits == 8 { + w.bytes[n] = byte(w.bits) + w.nbits = 0 + n++ + } + if w.nbits != 0 { + w.err = InternalError("writeBytes with unfinished bits") + return + } + if n != 0 { + _, w.err = w.w.Write(w.bytes[0:n]) + if w.err != nil { + return + } + } + w.nbytes = 0 + _, w.err = w.w.Write(bytes) +} + +// RFC 1951 3.2.7 specifies a special run-length encoding for specifying +// the literal and offset lengths arrays (which are concatenated into a single +// array). This method generates that run-length encoding. +// +// The result is written into the codegen array, and the frequencies +// of each code is written into the codegenFreq array. +// Codes 0-15 are single byte codes. Codes 16-18 are followed by additional +// information. Code badCode is an end marker +// +// numLiterals The number of literals in literalEncoding +// numOffsets The number of offsets in offsetEncoding +func (w *huffmanBitWriter) generateCodegen(numLiterals int, numOffsets int) { + for i := range w.codegenFreq { + w.codegenFreq[i] = 0 + } + // Note that we are using codegen both as a temporary variable for holding + // a copy of the frequencies, and as the place where we put the result. + // This is fine because the output is always shorter than the input used + // so far. + codegen := w.codegen // cache + // Copy the concatenated code sizes to codegen. Put a marker at the end. + copy(codegen[0:numLiterals], w.literalEncoding.codeBits) + copy(codegen[numLiterals:numLiterals+numOffsets], w.offsetEncoding.codeBits) + codegen[numLiterals+numOffsets] = badCode + + size := codegen[0] + count := 1 + outIndex := 0 + for inIndex := 1; size != badCode; inIndex++ { + // INVARIANT: We have seen "count" copies of size that have not yet + // had output generated for them. + nextSize := codegen[inIndex] + if nextSize == size { + count++ + continue + } + // We need to generate codegen indicating "count" of size. + if size != 0 { + codegen[outIndex] = size + outIndex++ + w.codegenFreq[size]++ + count-- + for count >= 3 { + n := 6 + if n > count { + n = count + } + codegen[outIndex] = 16 + outIndex++ + codegen[outIndex] = uint8(n - 3) + outIndex++ + w.codegenFreq[16]++ + count -= n + } + } else { + for count >= 11 { + n := 138 + if n > count { + n = count + } + codegen[outIndex] = 18 + outIndex++ + codegen[outIndex] = uint8(n - 11) + outIndex++ + w.codegenFreq[18]++ + count -= n + } + if count >= 3 { + // count >= 3 && count <= 10 + codegen[outIndex] = 17 + outIndex++ + codegen[outIndex] = uint8(count - 3) + outIndex++ + w.codegenFreq[17]++ + count = 0 + } + } + count-- + for ; count >= 0; count-- { + codegen[outIndex] = size + outIndex++ + w.codegenFreq[size]++ + } + // Set up invariant for next time through the loop. + size = nextSize + count = 1 + } + // Marker indicating the end of the codegen. + codegen[outIndex] = badCode +} + +func (w *huffmanBitWriter) writeCode(code *huffmanEncoder, literal uint32) { + if w.err != nil { + return + } + w.writeBits(int32(code.code[literal]), int32(code.codeBits[literal])) +} + +// Write the header of a dynamic Huffman block to the output stream. +// +// numLiterals The number of literals specified in codegen +// numOffsets The number of offsets specified in codegen +// numCodegens The number of codegens used in codegen +func (w *huffmanBitWriter) writeDynamicHeader(numLiterals int, numOffsets int, numCodegens int, isEof bool) { + if w.err != nil { + return + } + var firstBits int32 = 4 + if isEof { + firstBits = 5 + } + w.writeBits(firstBits, 3) + w.writeBits(int32(numLiterals-257), 5) + w.writeBits(int32(numOffsets-1), 5) + w.writeBits(int32(numCodegens-4), 4) + + for i := 0; i < numCodegens; i++ { + value := w.codegenEncoding.codeBits[codegenOrder[i]] + w.writeBits(int32(value), 3) + } + + i := 0 + for { + var codeWord int = int(w.codegen[i]) + i++ + if codeWord == badCode { + break + } + // The low byte contains the actual code to generate. + w.writeCode(w.codegenEncoding, uint32(codeWord)) + + switch codeWord { + case 16: + w.writeBits(int32(w.codegen[i]), 2) + i++ + break + case 17: + w.writeBits(int32(w.codegen[i]), 3) + i++ + break + case 18: + w.writeBits(int32(w.codegen[i]), 7) + i++ + break + } + } +} + +func (w *huffmanBitWriter) writeStoredHeader(length int, isEof bool) { + if w.err != nil { + return + } + var flag int32 + if isEof { + flag = 1 + } + w.writeBits(flag, 3) + w.flush() + w.writeBits(int32(length), 16) + w.writeBits(int32(^uint16(length)), 16) +} + +func (w *huffmanBitWriter) writeFixedHeader(isEof bool) { + if w.err != nil { + return + } + // Indicate that we are a fixed Huffman block + var value int32 = 2 + if isEof { + value = 3 + } + w.writeBits(value, 3) +} + +func (w *huffmanBitWriter) writeBlock(tokens []token, eof bool, input []byte) { + if w.err != nil { + return + } + for i := range w.literalFreq { + w.literalFreq[i] = 0 + } + for i := range w.offsetFreq { + w.offsetFreq[i] = 0 + } + + n := len(tokens) + tokens = tokens[0 : n+1] + tokens[n] = endBlockMarker + + for _, t := range tokens { + switch t.typ() { + case literalType: + w.literalFreq[t.literal()]++ + case matchType: + length := t.length() + offset := t.offset() + w.literalFreq[lengthCodesStart+lengthCode(length)]++ + w.offsetFreq[offsetCode(offset)]++ + } + } + + // get the number of literals + numLiterals := len(w.literalFreq) + for w.literalFreq[numLiterals-1] == 0 { + numLiterals-- + } + // get the number of offsets + numOffsets := len(w.offsetFreq) + for numOffsets > 0 && w.offsetFreq[numOffsets-1] == 0 { + numOffsets-- + } + if numOffsets == 0 { + // We haven't found a single match. If we want to go with the dynamic encoding, + // we should count at least one offset to be sure that the offset huffman tree could be encoded. + w.offsetFreq[0] = 1 + numOffsets = 1 + } + + w.literalEncoding.generate(w.literalFreq, 15) + w.offsetEncoding.generate(w.offsetFreq, 15) + + storedBytes := 0 + if input != nil { + storedBytes = len(input) + } + var extraBits int64 + var storedSize int64 = math.MaxInt64 + if storedBytes <= maxStoreBlockSize && input != nil { + storedSize = int64((storedBytes + 5) * 8) + // We only bother calculating the costs of the extra bits required by + // the length of offset fields (which will be the same for both fixed + // and dynamic encoding), if we need to compare those two encodings + // against stored encoding. + for lengthCode := lengthCodesStart + 8; lengthCode < numLiterals; lengthCode++ { + // First eight length codes have extra size = 0. + extraBits += int64(w.literalFreq[lengthCode]) * int64(lengthExtraBits[lengthCode-lengthCodesStart]) + } + for offsetCode := 4; offsetCode < numOffsets; offsetCode++ { + // First four offset codes have extra size = 0. + extraBits += int64(w.offsetFreq[offsetCode]) * int64(offsetExtraBits[offsetCode]) + } + } + + // Figure out smallest code. + // Fixed Huffman baseline. + var size = int64(3) + + fixedLiteralEncoding.bitLength(w.literalFreq) + + fixedOffsetEncoding.bitLength(w.offsetFreq) + + extraBits + var literalEncoding = fixedLiteralEncoding + var offsetEncoding = fixedOffsetEncoding + + // Dynamic Huffman? + var numCodegens int + + // Generate codegen and codegenFrequencies, which indicates how to encode + // the literalEncoding and the offsetEncoding. + w.generateCodegen(numLiterals, numOffsets) + w.codegenEncoding.generate(w.codegenFreq, 7) + numCodegens = len(w.codegenFreq) + for numCodegens > 4 && w.codegenFreq[codegenOrder[numCodegens-1]] == 0 { + numCodegens-- + } + dynamicHeader := int64(3+5+5+4+(3*numCodegens)) + + w.codegenEncoding.bitLength(w.codegenFreq) + + int64(extraBits) + + int64(w.codegenFreq[16]*2) + + int64(w.codegenFreq[17]*3) + + int64(w.codegenFreq[18]*7) + dynamicSize := dynamicHeader + + w.literalEncoding.bitLength(w.literalFreq) + + w.offsetEncoding.bitLength(w.offsetFreq) + + if dynamicSize < size { + size = dynamicSize + literalEncoding = w.literalEncoding + offsetEncoding = w.offsetEncoding + } + + // Stored bytes? + if storedSize < size { + w.writeStoredHeader(storedBytes, eof) + w.writeBytes(input[0:storedBytes]) + return + } + + // Huffman. + if literalEncoding == fixedLiteralEncoding { + w.writeFixedHeader(eof) + } else { + w.writeDynamicHeader(numLiterals, numOffsets, numCodegens, eof) + } + for _, t := range tokens { + switch t.typ() { + case literalType: + w.writeCode(literalEncoding, t.literal()) + break + case matchType: + // Write the length + length := t.length() + lengthCode := lengthCode(length) + w.writeCode(literalEncoding, lengthCode+lengthCodesStart) + extraLengthBits := int32(lengthExtraBits[lengthCode]) + if extraLengthBits > 0 { + extraLength := int32(length - lengthBase[lengthCode]) + w.writeBits(extraLength, extraLengthBits) + } + // Write the offset + offset := t.offset() + offsetCode := offsetCode(offset) + w.writeCode(offsetEncoding, offsetCode) + extraOffsetBits := int32(offsetExtraBits[offsetCode]) + if extraOffsetBits > 0 { + extraOffset := int32(offset - offsetBase[offsetCode]) + w.writeBits(extraOffset, extraOffsetBits) + } + break + default: + panic("unknown token type: " + string(t)) + } + } +} diff --git a/src/compress/flate/huffman_code.go b/src/compress/flate/huffman_code.go new file mode 100644 index 0000000000000000000000000000000000000000..50ec79c94051e1ba610e5926c77633514ffb83ab --- /dev/null +++ b/src/compress/flate/huffman_code.go @@ -0,0 +1,323 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package flate + +import ( + "math" + "sort" +) + +type huffmanEncoder struct { + codeBits []uint8 + code []uint16 +} + +type literalNode struct { + literal uint16 + freq int32 +} + +// A levelInfo describes the state of the constructed tree for a given depth. +type levelInfo struct { + // Our level. for better printing + level int32 + + // The frequency of the last node at this level + lastFreq int32 + + // The frequency of the next character to add to this level + nextCharFreq int32 + + // The frequency of the next pair (from level below) to add to this level. + // Only valid if the "needed" value of the next lower level is 0. + nextPairFreq int32 + + // The number of chains remaining to generate for this level before moving + // up to the next level + needed int32 +} + +func maxNode() literalNode { return literalNode{math.MaxUint16, math.MaxInt32} } + +func newHuffmanEncoder(size int) *huffmanEncoder { + return &huffmanEncoder{make([]uint8, size), make([]uint16, size)} +} + +// Generates a HuffmanCode corresponding to the fixed literal table +func generateFixedLiteralEncoding() *huffmanEncoder { + h := newHuffmanEncoder(maxNumLit) + codeBits := h.codeBits + code := h.code + var ch uint16 + for ch = 0; ch < maxNumLit; ch++ { + var bits uint16 + var size uint8 + switch { + case ch < 144: + // size 8, 000110000 .. 10111111 + bits = ch + 48 + size = 8 + break + case ch < 256: + // size 9, 110010000 .. 111111111 + bits = ch + 400 - 144 + size = 9 + break + case ch < 280: + // size 7, 0000000 .. 0010111 + bits = ch - 256 + size = 7 + break + default: + // size 8, 11000000 .. 11000111 + bits = ch + 192 - 280 + size = 8 + } + codeBits[ch] = size + code[ch] = reverseBits(bits, size) + } + return h +} + +func generateFixedOffsetEncoding() *huffmanEncoder { + h := newHuffmanEncoder(30) + codeBits := h.codeBits + code := h.code + for ch := uint16(0); ch < 30; ch++ { + codeBits[ch] = 5 + code[ch] = reverseBits(ch, 5) + } + return h +} + +var fixedLiteralEncoding *huffmanEncoder = generateFixedLiteralEncoding() +var fixedOffsetEncoding *huffmanEncoder = generateFixedOffsetEncoding() + +func (h *huffmanEncoder) bitLength(freq []int32) int64 { + var total int64 + for i, f := range freq { + if f != 0 { + total += int64(f) * int64(h.codeBits[i]) + } + } + return total +} + +const maxBitsLimit = 16 + +// Return the number of literals assigned to each bit size in the Huffman encoding +// +// This method is only called when list.length >= 3 +// The cases of 0, 1, and 2 literals are handled by special case code. +// +// list An array of the literals with non-zero frequencies +// and their associated frequencies. The array is in order of increasing +// frequency, and has as its last element a special element with frequency +// MaxInt32 +// maxBits The maximum number of bits that should be used to encode any literal. +// Must be less than 16. +// return An integer array in which array[i] indicates the number of literals +// that should be encoded in i bits. +func (h *huffmanEncoder) bitCounts(list []literalNode, maxBits int32) []int32 { + if maxBits >= maxBitsLimit { + panic("flate: maxBits too large") + } + n := int32(len(list)) + list = list[0 : n+1] + list[n] = maxNode() + + // The tree can't have greater depth than n - 1, no matter what. This + // saves a little bit of work in some small cases + if maxBits > n-1 { + maxBits = n - 1 + } + + // Create information about each of the levels. + // A bogus "Level 0" whose sole purpose is so that + // level1.prev.needed==0. This makes level1.nextPairFreq + // be a legitimate value that never gets chosen. + var levels [maxBitsLimit]levelInfo + // leafCounts[i] counts the number of literals at the left + // of ancestors of the rightmost node at level i. + // leafCounts[i][j] is the number of literals at the left + // of the level j ancestor. + var leafCounts [maxBitsLimit][maxBitsLimit]int32 + + for level := int32(1); level <= maxBits; level++ { + // For every level, the first two items are the first two characters. + // We initialize the levels as if we had already figured this out. + levels[level] = levelInfo{ + level: level, + lastFreq: list[1].freq, + nextCharFreq: list[2].freq, + nextPairFreq: list[0].freq + list[1].freq, + } + leafCounts[level][level] = 2 + if level == 1 { + levels[level].nextPairFreq = math.MaxInt32 + } + } + + // We need a total of 2*n - 2 items at top level and have already generated 2. + levels[maxBits].needed = 2*n - 4 + + level := maxBits + for { + l := &levels[level] + if l.nextPairFreq == math.MaxInt32 && l.nextCharFreq == math.MaxInt32 { + // We've run out of both leafs and pairs. + // End all calculations for this level. + // To make sure we never come back to this level or any lower level, + // set nextPairFreq impossibly large. + l.needed = 0 + levels[level+1].nextPairFreq = math.MaxInt32 + level++ + continue + } + + prevFreq := l.lastFreq + if l.nextCharFreq < l.nextPairFreq { + // The next item on this row is a leaf node. + n := leafCounts[level][level] + 1 + l.lastFreq = l.nextCharFreq + // Lower leafCounts are the same of the previous node. + leafCounts[level][level] = n + l.nextCharFreq = list[n].freq + } else { + // The next item on this row is a pair from the previous row. + // nextPairFreq isn't valid until we generate two + // more values in the level below + l.lastFreq = l.nextPairFreq + // Take leaf counts from the lower level, except counts[level] remains the same. + copy(leafCounts[level][:level], leafCounts[level-1][:level]) + levels[l.level-1].needed = 2 + } + + if l.needed--; l.needed == 0 { + // We've done everything we need to do for this level. + // Continue calculating one level up. Fill in nextPairFreq + // of that level with the sum of the two nodes we've just calculated on + // this level. + if l.level == maxBits { + // All done! + break + } + levels[l.level+1].nextPairFreq = prevFreq + l.lastFreq + level++ + } else { + // If we stole from below, move down temporarily to replenish it. + for levels[level-1].needed > 0 { + level-- + } + } + } + + // Somethings is wrong if at the end, the top level is null or hasn't used + // all of the leaves. + if leafCounts[maxBits][maxBits] != n { + panic("leafCounts[maxBits][maxBits] != n") + } + + bitCount := make([]int32, maxBits+1) + bits := 1 + counts := &leafCounts[maxBits] + for level := maxBits; level > 0; level-- { + // chain.leafCount gives the number of literals requiring at least "bits" + // bits to encode. + bitCount[bits] = counts[level] - counts[level-1] + bits++ + } + return bitCount +} + +// Look at the leaves and assign them a bit count and an encoding as specified +// in RFC 1951 3.2.2 +func (h *huffmanEncoder) assignEncodingAndSize(bitCount []int32, list []literalNode) { + code := uint16(0) + for n, bits := range bitCount { + code <<= 1 + if n == 0 || bits == 0 { + continue + } + // The literals list[len(list)-bits] .. list[len(list)-bits] + // are encoded using "bits" bits, and get the values + // code, code + 1, .... The code values are + // assigned in literal order (not frequency order). + chunk := list[len(list)-int(bits):] + sortByLiteral(chunk) + for _, node := range chunk { + h.codeBits[node.literal] = uint8(n) + h.code[node.literal] = reverseBits(code, uint8(n)) + code++ + } + list = list[0 : len(list)-int(bits)] + } +} + +// Update this Huffman Code object to be the minimum code for the specified frequency count. +// +// freq An array of frequencies, in which frequency[i] gives the frequency of literal i. +// maxBits The maximum number of bits to use for any literal. +func (h *huffmanEncoder) generate(freq []int32, maxBits int32) { + list := make([]literalNode, len(freq)+1) + // Number of non-zero literals + count := 0 + // Set list to be the set of all non-zero literals and their frequencies + for i, f := range freq { + if f != 0 { + list[count] = literalNode{uint16(i), f} + count++ + } else { + h.codeBits[i] = 0 + } + } + // If freq[] is shorter than codeBits[], fill rest of codeBits[] with zeros + h.codeBits = h.codeBits[0:len(freq)] + list = list[0:count] + if count <= 2 { + // Handle the small cases here, because they are awkward for the general case code. With + // two or fewer literals, everything has bit length 1. + for i, node := range list { + // "list" is in order of increasing literal value. + h.codeBits[node.literal] = 1 + h.code[node.literal] = uint16(i) + } + return + } + sortByFreq(list) + + // Get the number of literals for each bit count + bitCount := h.bitCounts(list, maxBits) + // And do the assignment + h.assignEncodingAndSize(bitCount, list) +} + +type literalNodeSorter struct { + a []literalNode + less func(i, j int) bool +} + +func (s literalNodeSorter) Len() int { return len(s.a) } + +func (s literalNodeSorter) Less(i, j int) bool { + return s.less(i, j) +} + +func (s literalNodeSorter) Swap(i, j int) { s.a[i], s.a[j] = s.a[j], s.a[i] } + +func sortByFreq(a []literalNode) { + s := &literalNodeSorter{a, func(i, j int) bool { + if a[i].freq == a[j].freq { + return a[i].literal < a[j].literal + } + return a[i].freq < a[j].freq + }} + sort.Sort(s) +} + +func sortByLiteral(a []literalNode) { + s := &literalNodeSorter{a, func(i, j int) bool { return a[i].literal < a[j].literal }} + sort.Sort(s) +} diff --git a/src/compress/flate/inflate.go b/src/compress/flate/inflate.go new file mode 100644 index 0000000000000000000000000000000000000000..04372dec2419c86a7f66b9965cfc0d16fffdaa38 --- /dev/null +++ b/src/compress/flate/inflate.go @@ -0,0 +1,811 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:generate go run gen.go -output fixedhuff.go + +// Package flate implements the DEFLATE compressed data format, described in +// RFC 1951. The gzip and zlib packages implement access to DEFLATE-based file +// formats. +package flate + +import ( + "bufio" + "io" + "strconv" +) + +const ( + maxCodeLen = 16 // max length of Huffman code + maxHist = 32768 // max history required + // The next three numbers come from the RFC section 3.2.7, with the + // additional proviso in section 3.2.5 which implies that distance codes + // 30 and 31 should never occur in compressed data. + maxNumLit = 286 + maxNumDist = 30 + numCodes = 19 // number of codes in Huffman meta-code +) + +// A CorruptInputError reports the presence of corrupt input at a given offset. +type CorruptInputError int64 + +func (e CorruptInputError) Error() string { + return "flate: corrupt input before offset " + strconv.FormatInt(int64(e), 10) +} + +// An InternalError reports an error in the flate code itself. +type InternalError string + +func (e InternalError) Error() string { return "flate: internal error: " + string(e) } + +// A ReadError reports an error encountered while reading input. +type ReadError struct { + Offset int64 // byte offset where error occurred + Err error // error returned by underlying Read +} + +func (e *ReadError) Error() string { + return "flate: read error at offset " + strconv.FormatInt(e.Offset, 10) + ": " + e.Err.Error() +} + +// A WriteError reports an error encountered while writing output. +type WriteError struct { + Offset int64 // byte offset where error occurred + Err error // error returned by underlying Write +} + +func (e *WriteError) Error() string { + return "flate: write error at offset " + strconv.FormatInt(e.Offset, 10) + ": " + e.Err.Error() +} + +// Resetter resets a ReadCloser returned by NewReader or NewReaderDict to +// to switch to a new underlying Reader. This permits reusing a ReadCloser +// instead of allocating a new one. +type Resetter interface { + // Reset discards any buffered data and resets the Resetter as if it was + // newly initialized with the given reader. + Reset(r io.Reader, dict []byte) error +} + +// Note that much of the implementation of huffmanDecoder is also copied +// into gen.go (in package main) for the purpose of precomputing the +// fixed huffman tables so they can be included statically. + +// The data structure for decoding Huffman tables is based on that of +// zlib. There is a lookup table of a fixed bit width (huffmanChunkBits), +// For codes smaller than the table width, there are multiple entries +// (each combination of trailing bits has the same value). For codes +// larger than the table width, the table contains a link to an overflow +// table. The width of each entry in the link table is the maximum code +// size minus the chunk width. + +// Note that you can do a lookup in the table even without all bits +// filled. Since the extra bits are zero, and the DEFLATE Huffman codes +// have the property that shorter codes come before longer ones, the +// bit length estimate in the result is a lower bound on the actual +// number of bits. + +// chunk & 15 is number of bits +// chunk >> 4 is value, including table link + +const ( + huffmanChunkBits = 9 + huffmanNumChunks = 1 << huffmanChunkBits + huffmanCountMask = 15 + huffmanValueShift = 4 +) + +type huffmanDecoder struct { + min int // the minimum code length + chunks [huffmanNumChunks]uint32 // chunks as described above + links [][]uint32 // overflow links + linkMask uint32 // mask the width of the link table +} + +// Initialize Huffman decoding tables from array of code lengths. +// Following this function, h is guaranteed to be initialized into a complete +// tree (i.e., neither over-subscribed nor under-subscribed). The exception is a +// degenerate case where the tree has only a single symbol with length 1. Empty +// trees are permitted. +func (h *huffmanDecoder) init(bits []int) bool { + // Sanity enables additional runtime tests during Huffman + // table construction. It's intended to be used during + // development to supplement the currently ad-hoc unit tests. + const sanity = false + + if h.min != 0 { + *h = huffmanDecoder{} + } + + // Count number of codes of each length, + // compute min and max length. + var count [maxCodeLen]int + var min, max int + for _, n := range bits { + if n == 0 { + continue + } + if min == 0 || n < min { + min = n + } + if n > max { + max = n + } + count[n]++ + } + + // Empty tree. The decompressor.huffSym function will fail later if the tree + // is used. Technically, an empty tree is only valid for the HDIST tree and + // not the HCLEN and HLIT tree. However, a stream with an empty HCLEN tree + // is guaranteed to fail since it will attempt to use the tree to decode the + // codes for the HLIT and HDIST trees. Similarly, an empty HLIT tree is + // guaranteed to fail later since the compressed data section must be + // composed of at least one symbol (the end-of-block marker). + if max == 0 { + return true + } + + code := 0 + var nextcode [maxCodeLen]int + for i := min; i <= max; i++ { + code <<= 1 + nextcode[i] = code + code += count[i] + } + + // Check that the coding is complete (i.e., that we've + // assigned all 2-to-the-max possible bit sequences). + // Exception: To be compatible with zlib, we also need to + // accept degenerate single-code codings. See also + // TestDegenerateHuffmanCoding. + if code != 1< huffmanChunkBits { + numLinks := 1 << (uint(max) - huffmanChunkBits) + h.linkMask = uint32(numLinks - 1) + + // create link tables + link := nextcode[huffmanChunkBits+1] >> 1 + h.links = make([][]uint32, huffmanNumChunks-link) + for j := uint(link); j < huffmanNumChunks; j++ { + reverse := int(reverseByte[j>>8]) | int(reverseByte[j&0xff])<<8 + reverse >>= uint(16 - huffmanChunkBits) + off := j - uint(link) + if sanity && h.chunks[reverse] != 0 { + panic("impossible: overwriting existing chunk") + } + h.chunks[reverse] = uint32(off<>8]) | int(reverseByte[code&0xff])<<8 + reverse >>= uint(16 - n) + if n <= huffmanChunkBits { + for off := reverse; off < len(h.chunks); off += 1 << uint(n) { + // We should never need to overwrite + // an existing chunk. Also, 0 is + // never a valid chunk, because the + // lower 4 "count" bits should be + // between 1 and 15. + if sanity && h.chunks[off] != 0 { + panic("impossible: overwriting existing chunk") + } + h.chunks[off] = chunk + } + } else { + j := reverse & (huffmanNumChunks - 1) + if sanity && h.chunks[j]&huffmanCountMask != huffmanChunkBits+1 { + // Longer codes should have been + // associated with a link table above. + panic("impossible: not an indirect chunk") + } + value := h.chunks[j] >> huffmanValueShift + linktab := h.links[value] + reverse >>= huffmanChunkBits + for off := reverse; off < len(linktab); off += 1 << uint(n-huffmanChunkBits) { + if sanity && linktab[off] != 0 { + panic("impossible: overwriting existing chunk") + } + linktab[off] = chunk + } + } + } + + if sanity { + // Above we've sanity checked that we never overwrote + // an existing entry. Here we additionally check that + // we filled the tables completely. + for i, chunk := range h.chunks { + if chunk == 0 { + // As an exception, in the degenerate + // single-code case, we allow odd + // chunks to be missing. + if code == 1 && i%2 == 1 { + continue + } + panic("impossible: missing chunk") + } + } + for _, linktab := range h.links { + for _, chunk := range linktab { + if chunk == 0 { + panic("impossible: missing chunk") + } + } + } + } + + return true +} + +// The actual read interface needed by NewReader. +// If the passed in io.Reader does not also have ReadByte, +// the NewReader will introduce its own buffering. +type Reader interface { + io.Reader + io.ByteReader +} + +// Decompress state. +type decompressor struct { + // Input source. + r Reader + roffset int64 + woffset int64 + + // Input bits, in top of b. + b uint32 + nb uint + + // Huffman decoders for literal/length, distance. + h1, h2 huffmanDecoder + + // Length arrays used to define Huffman codes. + bits *[maxNumLit + maxNumDist]int + codebits *[numCodes]int + + // Output history, buffer. + hist *[maxHist]byte + hp int // current output position in buffer + hw int // have written hist[0:hw] already + hfull bool // buffer has filled at least once + + // Temporary buffer (avoids repeated allocation). + buf [4]byte + + // Next step in the decompression, + // and decompression state. + step func(*decompressor) + final bool + err error + toRead []byte + hl, hd *huffmanDecoder + copyLen int + copyDist int +} + +func (f *decompressor) nextBlock() { + if f.final { + if f.hw != f.hp { + f.flush((*decompressor).nextBlock) + return + } + f.err = io.EOF + return + } + for f.nb < 1+2 { + if f.err = f.moreBits(); f.err != nil { + return + } + } + f.final = f.b&1 == 1 + f.b >>= 1 + typ := f.b & 3 + f.b >>= 2 + f.nb -= 1 + 2 + switch typ { + case 0: + f.dataBlock() + case 1: + // compressed, fixed Huffman tables + f.hl = &fixedHuffmanDecoder + f.hd = nil + f.huffmanBlock() + case 2: + // compressed, dynamic Huffman tables + if f.err = f.readHuffman(); f.err != nil { + break + } + f.hl = &f.h1 + f.hd = &f.h2 + f.huffmanBlock() + default: + // 3 is reserved. + f.err = CorruptInputError(f.roffset) + } +} + +func (f *decompressor) Read(b []byte) (int, error) { + for { + if len(f.toRead) > 0 { + n := copy(b, f.toRead) + f.toRead = f.toRead[n:] + return n, nil + } + if f.err != nil { + return 0, f.err + } + f.step(f) + } +} + +func (f *decompressor) Close() error { + if f.err == io.EOF { + return nil + } + return f.err +} + +// RFC 1951 section 3.2.7. +// Compression with dynamic Huffman codes + +var codeOrder = [...]int{16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15} + +func (f *decompressor) readHuffman() error { + // HLIT[5], HDIST[5], HCLEN[4]. + for f.nb < 5+5+4 { + if err := f.moreBits(); err != nil { + return err + } + } + nlit := int(f.b&0x1F) + 257 + if nlit > maxNumLit { + return CorruptInputError(f.roffset) + } + f.b >>= 5 + ndist := int(f.b&0x1F) + 1 + if ndist > maxNumDist { + return CorruptInputError(f.roffset) + } + f.b >>= 5 + nclen := int(f.b&0xF) + 4 + // numCodes is 19, so nclen is always valid. + f.b >>= 4 + f.nb -= 5 + 5 + 4 + + // (HCLEN+4)*3 bits: code lengths in the magic codeOrder order. + for i := 0; i < nclen; i++ { + for f.nb < 3 { + if err := f.moreBits(); err != nil { + return err + } + } + f.codebits[codeOrder[i]] = int(f.b & 0x7) + f.b >>= 3 + f.nb -= 3 + } + for i := nclen; i < len(codeOrder); i++ { + f.codebits[codeOrder[i]] = 0 + } + if !f.h1.init(f.codebits[0:]) { + return CorruptInputError(f.roffset) + } + + // HLIT + 257 code lengths, HDIST + 1 code lengths, + // using the code length Huffman code. + for i, n := 0, nlit+ndist; i < n; { + x, err := f.huffSym(&f.h1) + if err != nil { + return err + } + if x < 16 { + // Actual length. + f.bits[i] = x + i++ + continue + } + // Repeat previous length or zero. + var rep int + var nb uint + var b int + switch x { + default: + return InternalError("unexpected length code") + case 16: + rep = 3 + nb = 2 + if i == 0 { + return CorruptInputError(f.roffset) + } + b = f.bits[i-1] + case 17: + rep = 3 + nb = 3 + b = 0 + case 18: + rep = 11 + nb = 7 + b = 0 + } + for f.nb < nb { + if err := f.moreBits(); err != nil { + return err + } + } + rep += int(f.b & uint32(1<>= nb + f.nb -= nb + if i+rep > n { + return CorruptInputError(f.roffset) + } + for j := 0; j < rep; j++ { + f.bits[i] = b + i++ + } + } + + if !f.h1.init(f.bits[0:nlit]) || !f.h2.init(f.bits[nlit:nlit+ndist]) { + return CorruptInputError(f.roffset) + } + + return nil +} + +// Decode a single Huffman block from f. +// hl and hd are the Huffman states for the lit/length values +// and the distance values, respectively. If hd == nil, using the +// fixed distance encoding associated with fixed Huffman blocks. +func (f *decompressor) huffmanBlock() { + for { + v, err := f.huffSym(f.hl) + if err != nil { + f.err = err + return + } + var n uint // number of bits extra + var length int + switch { + case v < 256: + f.hist[f.hp] = byte(v) + f.hp++ + if f.hp == len(f.hist) { + // After the flush, continue this loop. + f.flush((*decompressor).huffmanBlock) + return + } + continue + case v == 256: + // Done with huffman block; read next block. + f.step = (*decompressor).nextBlock + return + // otherwise, reference to older data + case v < 265: + length = v - (257 - 3) + n = 0 + case v < 269: + length = v*2 - (265*2 - 11) + n = 1 + case v < 273: + length = v*4 - (269*4 - 19) + n = 2 + case v < 277: + length = v*8 - (273*8 - 35) + n = 3 + case v < 281: + length = v*16 - (277*16 - 67) + n = 4 + case v < 285: + length = v*32 - (281*32 - 131) + n = 5 + case v < maxNumLit: + length = 258 + n = 0 + default: + f.err = CorruptInputError(f.roffset) + return + } + if n > 0 { + for f.nb < n { + if err = f.moreBits(); err != nil { + f.err = err + return + } + } + length += int(f.b & uint32(1<>= n + f.nb -= n + } + + var dist int + if f.hd == nil { + for f.nb < 5 { + if err = f.moreBits(); err != nil { + f.err = err + return + } + } + dist = int(reverseByte[(f.b&0x1F)<<3]) + f.b >>= 5 + f.nb -= 5 + } else { + if dist, err = f.huffSym(f.hd); err != nil { + f.err = err + return + } + } + + switch { + case dist < 4: + dist++ + case dist < maxNumDist: + nb := uint(dist-2) >> 1 + // have 1 bit in bottom of dist, need nb more. + extra := (dist & 1) << nb + for f.nb < nb { + if err = f.moreBits(); err != nil { + f.err = err + return + } + } + extra |= int(f.b & uint32(1<>= nb + f.nb -= nb + dist = 1<<(nb+1) + 1 + extra + default: + f.err = CorruptInputError(f.roffset) + return + } + + // Copy history[-dist:-dist+length] into output. + if dist > len(f.hist) { + f.err = InternalError("bad history distance") + return + } + + // No check on length; encoding can be prescient. + if !f.hfull && dist > f.hp { + f.err = CorruptInputError(f.roffset) + return + } + + f.copyLen, f.copyDist = length, dist + if f.copyHist() { + return + } + } +} + +// copyHist copies f.copyLen bytes from f.hist (f.copyDist bytes ago) to itself. +// It reports whether the f.hist buffer is full. +func (f *decompressor) copyHist() bool { + p := f.hp - f.copyDist + if p < 0 { + p += len(f.hist) + } + for f.copyLen > 0 { + n := f.copyLen + if x := len(f.hist) - f.hp; n > x { + n = x + } + if x := len(f.hist) - p; n > x { + n = x + } + forwardCopy(f.hist[:], f.hp, p, n) + p += n + f.hp += n + f.copyLen -= n + if f.hp == len(f.hist) { + // After flush continue copying out of history. + f.flush((*decompressor).copyHuff) + return true + } + if p == len(f.hist) { + p = 0 + } + } + return false +} + +func (f *decompressor) copyHuff() { + if f.copyHist() { + return + } + f.huffmanBlock() +} + +// Copy a single uncompressed data block from input to output. +func (f *decompressor) dataBlock() { + // Uncompressed. + // Discard current half-byte. + f.nb = 0 + f.b = 0 + + // Length then ones-complement of length. + nr, err := io.ReadFull(f.r, f.buf[0:4]) + f.roffset += int64(nr) + if err != nil { + f.err = &ReadError{f.roffset, err} + return + } + n := int(f.buf[0]) | int(f.buf[1])<<8 + nn := int(f.buf[2]) | int(f.buf[3])<<8 + if uint16(nn) != uint16(^n) { + f.err = CorruptInputError(f.roffset) + return + } + + if n == 0 { + // 0-length block means sync + f.flush((*decompressor).nextBlock) + return + } + + f.copyLen = n + f.copyData() +} + +// copyData copies f.copyLen bytes from the underlying reader into f.hist. +// It pauses for reads when f.hist is full. +func (f *decompressor) copyData() { + n := f.copyLen + for n > 0 { + m := len(f.hist) - f.hp + if m > n { + m = n + } + m, err := io.ReadFull(f.r, f.hist[f.hp:f.hp+m]) + f.roffset += int64(m) + if err != nil { + f.err = &ReadError{f.roffset, err} + return + } + n -= m + f.hp += m + if f.hp == len(f.hist) { + f.copyLen = n + f.flush((*decompressor).copyData) + return + } + } + f.step = (*decompressor).nextBlock +} + +func (f *decompressor) setDict(dict []byte) { + if len(dict) > len(f.hist) { + // Will only remember the tail. + dict = dict[len(dict)-len(f.hist):] + } + + f.hp = copy(f.hist[:], dict) + if f.hp == len(f.hist) { + f.hp = 0 + f.hfull = true + } + f.hw = f.hp +} + +func (f *decompressor) moreBits() error { + c, err := f.r.ReadByte() + if err != nil { + if err == io.EOF { + err = io.ErrUnexpectedEOF + } + return err + } + f.roffset++ + f.b |= uint32(c) << f.nb + f.nb += 8 + return nil +} + +// Read the next Huffman-encoded symbol from f according to h. +func (f *decompressor) huffSym(h *huffmanDecoder) (int, error) { + // Since a huffmanDecoder can be empty or be composed of a degenerate tree + // with single element, huffSym must error on these two edge cases. In both + // cases, the chunks slice will be 0 for the invalid sequence, leading it + // satisfy the n == 0 check below. + n := uint(h.min) + for { + for f.nb < n { + if err := f.moreBits(); err != nil { + return 0, err + } + } + chunk := h.chunks[f.b&(huffmanNumChunks-1)] + n = uint(chunk & huffmanCountMask) + if n > huffmanChunkBits { + chunk = h.links[chunk>>huffmanValueShift][(f.b>>huffmanChunkBits)&h.linkMask] + n = uint(chunk & huffmanCountMask) + } + if n <= f.nb { + if n == 0 { + f.err = CorruptInputError(f.roffset) + return 0, f.err + } + f.b >>= n + f.nb -= n + return int(chunk >> huffmanValueShift), nil + } + } +} + +// Flush any buffered output to the underlying writer. +func (f *decompressor) flush(step func(*decompressor)) { + f.toRead = f.hist[f.hw:f.hp] + f.woffset += int64(f.hp - f.hw) + f.hw = f.hp + if f.hp == len(f.hist) { + f.hp = 0 + f.hw = 0 + f.hfull = true + } + f.step = step +} + +func makeReader(r io.Reader) Reader { + if rr, ok := r.(Reader); ok { + return rr + } + return bufio.NewReader(r) +} + +func (f *decompressor) Reset(r io.Reader, dict []byte) error { + *f = decompressor{ + r: makeReader(r), + bits: f.bits, + codebits: f.codebits, + hist: f.hist, + step: (*decompressor).nextBlock, + } + if dict != nil { + f.setDict(dict) + } + return nil +} + +// NewReader returns a new ReadCloser that can be used +// to read the uncompressed version of r. +// If r does not also implement io.ByteReader, +// the decompressor may read more data than necessary from r. +// It is the caller's responsibility to call Close on the ReadCloser +// when finished reading. +// +// The ReadCloser returned by NewReader also implements Resetter. +func NewReader(r io.Reader) io.ReadCloser { + var f decompressor + f.bits = new([maxNumLit + maxNumDist]int) + f.codebits = new([numCodes]int) + f.r = makeReader(r) + f.hist = new([maxHist]byte) + f.step = (*decompressor).nextBlock + return &f +} + +// NewReaderDict is like NewReader but initializes the reader +// with a preset dictionary. The returned Reader behaves as if +// the uncompressed data stream started with the given dictionary, +// which has already been read. NewReaderDict is typically used +// to read data compressed by NewWriterDict. +// +// The ReadCloser returned by NewReader also implements Resetter. +func NewReaderDict(r io.Reader, dict []byte) io.ReadCloser { + var f decompressor + f.r = makeReader(r) + f.hist = new([maxHist]byte) + f.bits = new([maxNumLit + maxNumDist]int) + f.codebits = new([numCodes]int) + f.step = (*decompressor).nextBlock + f.setDict(dict) + return &f +} diff --git a/src/compress/flate/inflate_test.go b/src/compress/flate/inflate_test.go new file mode 100644 index 0000000000000000000000000000000000000000..9f25d30b35cd0684608371e9044a3ff1fd198263 --- /dev/null +++ b/src/compress/flate/inflate_test.go @@ -0,0 +1,39 @@ +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package flate + +import ( + "bytes" + "io" + "testing" +) + +func TestReset(t *testing.T) { + ss := []string{ + "lorem ipsum izzle fo rizzle", + "the quick brown fox jumped over", + } + + deflated := make([]bytes.Buffer, 2) + for i, s := range ss { + w, _ := NewWriter(&deflated[i], 1) + w.Write([]byte(s)) + w.Close() + } + + inflated := make([]bytes.Buffer, 2) + + f := NewReader(&deflated[0]) + io.Copy(&inflated[0], f) + f.(Resetter).Reset(&deflated[1], nil) + io.Copy(&inflated[1], f) + f.Close() + + for i, s := range ss { + if s != inflated[i].String() { + t.Errorf("inflated[%d]:\ngot %q\nwant %q", i, inflated[i], s) + } + } +} diff --git a/src/compress/flate/reader_test.go b/src/compress/flate/reader_test.go new file mode 100644 index 0000000000000000000000000000000000000000..a62ef741df336161397cc132cc4bec2ca656cfc1 --- /dev/null +++ b/src/compress/flate/reader_test.go @@ -0,0 +1,96 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package flate + +import ( + "bytes" + "io" + "io/ioutil" + "runtime" + "strings" + "testing" +) + +func TestNlitOutOfRange(t *testing.T) { + // Trying to decode this bogus flate data, which has a Huffman table + // with nlit=288, should not panic. + io.Copy(ioutil.Discard, NewReader(strings.NewReader( + "\xfc\xfe\x36\xe7\x5e\x1c\xef\xb3\x55\x58\x77\xb6\x56\xb5\x43\xf4"+ + "\x6f\xf2\xd2\xe6\x3d\x99\xa0\x85\x8c\x48\xeb\xf8\xda\x83\x04\x2a"+ + "\x75\xc4\xf8\x0f\x12\x11\xb9\xb4\x4b\x09\xa0\xbe\x8b\x91\x4c"))) +} + +const ( + digits = iota + twain +) + +var testfiles = []string{ + // Digits is the digits of the irrational number e. Its decimal representation + // does not repeat, but there are only 10 possible digits, so it should be + // reasonably compressible. + digits: "../testdata/e.txt", + // Twain is Project Gutenberg's edition of Mark Twain's classic English novel. + twain: "../testdata/Mark.Twain-Tom.Sawyer.txt", +} + +func benchmarkDecode(b *testing.B, testfile, level, n int) { + b.ReportAllocs() + b.StopTimer() + b.SetBytes(int64(n)) + buf0, err := ioutil.ReadFile(testfiles[testfile]) + if err != nil { + b.Fatal(err) + } + if len(buf0) == 0 { + b.Fatalf("test file %q has no data", testfiles[testfile]) + } + compressed := new(bytes.Buffer) + w, err := NewWriter(compressed, level) + if err != nil { + b.Fatal(err) + } + for i := 0; i < n; i += len(buf0) { + if len(buf0) > n-i { + buf0 = buf0[:n-i] + } + io.Copy(w, bytes.NewReader(buf0)) + } + w.Close() + buf1 := compressed.Bytes() + buf0, compressed, w = nil, nil, nil + runtime.GC() + b.StartTimer() + for i := 0; i < b.N; i++ { + io.Copy(ioutil.Discard, NewReader(bytes.NewReader(buf1))) + } +} + +// These short names are so that gofmt doesn't break the BenchmarkXxx function +// bodies below over multiple lines. +const ( + speed = BestSpeed + default_ = DefaultCompression + compress = BestCompression +) + +func BenchmarkDecodeDigitsSpeed1e4(b *testing.B) { benchmarkDecode(b, digits, speed, 1e4) } +func BenchmarkDecodeDigitsSpeed1e5(b *testing.B) { benchmarkDecode(b, digits, speed, 1e5) } +func BenchmarkDecodeDigitsSpeed1e6(b *testing.B) { benchmarkDecode(b, digits, speed, 1e6) } +func BenchmarkDecodeDigitsDefault1e4(b *testing.B) { benchmarkDecode(b, digits, default_, 1e4) } +func BenchmarkDecodeDigitsDefault1e5(b *testing.B) { benchmarkDecode(b, digits, default_, 1e5) } +func BenchmarkDecodeDigitsDefault1e6(b *testing.B) { benchmarkDecode(b, digits, default_, 1e6) } +func BenchmarkDecodeDigitsCompress1e4(b *testing.B) { benchmarkDecode(b, digits, compress, 1e4) } +func BenchmarkDecodeDigitsCompress1e5(b *testing.B) { benchmarkDecode(b, digits, compress, 1e5) } +func BenchmarkDecodeDigitsCompress1e6(b *testing.B) { benchmarkDecode(b, digits, compress, 1e6) } +func BenchmarkDecodeTwainSpeed1e4(b *testing.B) { benchmarkDecode(b, twain, speed, 1e4) } +func BenchmarkDecodeTwainSpeed1e5(b *testing.B) { benchmarkDecode(b, twain, speed, 1e5) } +func BenchmarkDecodeTwainSpeed1e6(b *testing.B) { benchmarkDecode(b, twain, speed, 1e6) } +func BenchmarkDecodeTwainDefault1e4(b *testing.B) { benchmarkDecode(b, twain, default_, 1e4) } +func BenchmarkDecodeTwainDefault1e5(b *testing.B) { benchmarkDecode(b, twain, default_, 1e5) } +func BenchmarkDecodeTwainDefault1e6(b *testing.B) { benchmarkDecode(b, twain, default_, 1e6) } +func BenchmarkDecodeTwainCompress1e4(b *testing.B) { benchmarkDecode(b, twain, compress, 1e4) } +func BenchmarkDecodeTwainCompress1e5(b *testing.B) { benchmarkDecode(b, twain, compress, 1e5) } +func BenchmarkDecodeTwainCompress1e6(b *testing.B) { benchmarkDecode(b, twain, compress, 1e6) } diff --git a/src/compress/flate/reverse_bits.go b/src/compress/flate/reverse_bits.go new file mode 100644 index 0000000000000000000000000000000000000000..c1a02720d1a9bcb2500c4156b2fc35a31e71b3bf --- /dev/null +++ b/src/compress/flate/reverse_bits.go @@ -0,0 +1,48 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package flate + +var reverseByte = [256]byte{ + 0x00, 0x80, 0x40, 0xc0, 0x20, 0xa0, 0x60, 0xe0, + 0x10, 0x90, 0x50, 0xd0, 0x30, 0xb0, 0x70, 0xf0, + 0x08, 0x88, 0x48, 0xc8, 0x28, 0xa8, 0x68, 0xe8, + 0x18, 0x98, 0x58, 0xd8, 0x38, 0xb8, 0x78, 0xf8, + 0x04, 0x84, 0x44, 0xc4, 0x24, 0xa4, 0x64, 0xe4, + 0x14, 0x94, 0x54, 0xd4, 0x34, 0xb4, 0x74, 0xf4, + 0x0c, 0x8c, 0x4c, 0xcc, 0x2c, 0xac, 0x6c, 0xec, + 0x1c, 0x9c, 0x5c, 0xdc, 0x3c, 0xbc, 0x7c, 0xfc, + 0x02, 0x82, 0x42, 0xc2, 0x22, 0xa2, 0x62, 0xe2, + 0x12, 0x92, 0x52, 0xd2, 0x32, 0xb2, 0x72, 0xf2, + 0x0a, 0x8a, 0x4a, 0xca, 0x2a, 0xaa, 0x6a, 0xea, + 0x1a, 0x9a, 0x5a, 0xda, 0x3a, 0xba, 0x7a, 0xfa, + 0x06, 0x86, 0x46, 0xc6, 0x26, 0xa6, 0x66, 0xe6, + 0x16, 0x96, 0x56, 0xd6, 0x36, 0xb6, 0x76, 0xf6, + 0x0e, 0x8e, 0x4e, 0xce, 0x2e, 0xae, 0x6e, 0xee, + 0x1e, 0x9e, 0x5e, 0xde, 0x3e, 0xbe, 0x7e, 0xfe, + 0x01, 0x81, 0x41, 0xc1, 0x21, 0xa1, 0x61, 0xe1, + 0x11, 0x91, 0x51, 0xd1, 0x31, 0xb1, 0x71, 0xf1, + 0x09, 0x89, 0x49, 0xc9, 0x29, 0xa9, 0x69, 0xe9, + 0x19, 0x99, 0x59, 0xd9, 0x39, 0xb9, 0x79, 0xf9, + 0x05, 0x85, 0x45, 0xc5, 0x25, 0xa5, 0x65, 0xe5, + 0x15, 0x95, 0x55, 0xd5, 0x35, 0xb5, 0x75, 0xf5, + 0x0d, 0x8d, 0x4d, 0xcd, 0x2d, 0xad, 0x6d, 0xed, + 0x1d, 0x9d, 0x5d, 0xdd, 0x3d, 0xbd, 0x7d, 0xfd, + 0x03, 0x83, 0x43, 0xc3, 0x23, 0xa3, 0x63, 0xe3, + 0x13, 0x93, 0x53, 0xd3, 0x33, 0xb3, 0x73, 0xf3, + 0x0b, 0x8b, 0x4b, 0xcb, 0x2b, 0xab, 0x6b, 0xeb, + 0x1b, 0x9b, 0x5b, 0xdb, 0x3b, 0xbb, 0x7b, 0xfb, + 0x07, 0x87, 0x47, 0xc7, 0x27, 0xa7, 0x67, 0xe7, + 0x17, 0x97, 0x57, 0xd7, 0x37, 0xb7, 0x77, 0xf7, + 0x0f, 0x8f, 0x4f, 0xcf, 0x2f, 0xaf, 0x6f, 0xef, + 0x1f, 0x9f, 0x5f, 0xdf, 0x3f, 0xbf, 0x7f, 0xff, +} + +func reverseUint16(v uint16) uint16 { + return uint16(reverseByte[v>>8]) | uint16(reverseByte[v&0xFF])<<8 +} + +func reverseBits(number uint16, bitLength byte) uint16 { + return reverseUint16(number << uint8(16-bitLength)) +} diff --git a/src/compress/flate/token.go b/src/compress/flate/token.go new file mode 100644 index 0000000000000000000000000000000000000000..4d491768717f8ccd945130ad8ff49618db3d8fa9 --- /dev/null +++ b/src/compress/flate/token.go @@ -0,0 +1,102 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package flate + +const ( + // 2 bits: type 0 = literal 1=EOF 2=Match 3=Unused + // 8 bits: xlength = length - MIN_MATCH_LENGTH + // 22 bits xoffset = offset - MIN_OFFSET_SIZE, or literal + lengthShift = 22 + offsetMask = 1< pair into a match token. +func matchToken(xlength uint32, xoffset uint32) token { + return token(matchType + xlength<> lengthShift) } + +func lengthCode(len uint32) uint32 { return lengthCodes[len] } + +// Returns the offset code corresponding to a specific offset +func offsetCode(off uint32) uint32 { + const n = uint32(len(offsetCodes)) + switch { + case off < n: + return offsetCodes[off] + case off>>7 < n: + return offsetCodes[off>>7] + 14 + default: + return offsetCodes[off>>14] + 28 + } +} diff --git a/src/compress/flate/writer_test.go b/src/compress/flate/writer_test.go new file mode 100644 index 0000000000000000000000000000000000000000..58431774e0e3c2e77dc536704fe81519c986c8c3 --- /dev/null +++ b/src/compress/flate/writer_test.go @@ -0,0 +1,60 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package flate + +import ( + "io/ioutil" + "runtime" + "testing" +) + +func benchmarkEncoder(b *testing.B, testfile, level, n int) { + b.StopTimer() + b.SetBytes(int64(n)) + buf0, err := ioutil.ReadFile(testfiles[testfile]) + if err != nil { + b.Fatal(err) + } + if len(buf0) == 0 { + b.Fatalf("test file %q has no data", testfiles[testfile]) + } + buf1 := make([]byte, n) + for i := 0; i < n; i += len(buf0) { + if len(buf0) > n-i { + buf0 = buf0[:n-i] + } + copy(buf1[i:], buf0) + } + buf0 = nil + runtime.GC() + b.StartTimer() + for i := 0; i < b.N; i++ { + w, err := NewWriter(ioutil.Discard, level) + if err != nil { + b.Fatal(err) + } + w.Write(buf1) + w.Close() + } +} + +func BenchmarkEncodeDigitsSpeed1e4(b *testing.B) { benchmarkEncoder(b, digits, speed, 1e4) } +func BenchmarkEncodeDigitsSpeed1e5(b *testing.B) { benchmarkEncoder(b, digits, speed, 1e5) } +func BenchmarkEncodeDigitsSpeed1e6(b *testing.B) { benchmarkEncoder(b, digits, speed, 1e6) } +func BenchmarkEncodeDigitsDefault1e4(b *testing.B) { benchmarkEncoder(b, digits, default_, 1e4) } +func BenchmarkEncodeDigitsDefault1e5(b *testing.B) { benchmarkEncoder(b, digits, default_, 1e5) } +func BenchmarkEncodeDigitsDefault1e6(b *testing.B) { benchmarkEncoder(b, digits, default_, 1e6) } +func BenchmarkEncodeDigitsCompress1e4(b *testing.B) { benchmarkEncoder(b, digits, compress, 1e4) } +func BenchmarkEncodeDigitsCompress1e5(b *testing.B) { benchmarkEncoder(b, digits, compress, 1e5) } +func BenchmarkEncodeDigitsCompress1e6(b *testing.B) { benchmarkEncoder(b, digits, compress, 1e6) } +func BenchmarkEncodeTwainSpeed1e4(b *testing.B) { benchmarkEncoder(b, twain, speed, 1e4) } +func BenchmarkEncodeTwainSpeed1e5(b *testing.B) { benchmarkEncoder(b, twain, speed, 1e5) } +func BenchmarkEncodeTwainSpeed1e6(b *testing.B) { benchmarkEncoder(b, twain, speed, 1e6) } +func BenchmarkEncodeTwainDefault1e4(b *testing.B) { benchmarkEncoder(b, twain, default_, 1e4) } +func BenchmarkEncodeTwainDefault1e5(b *testing.B) { benchmarkEncoder(b, twain, default_, 1e5) } +func BenchmarkEncodeTwainDefault1e6(b *testing.B) { benchmarkEncoder(b, twain, default_, 1e6) } +func BenchmarkEncodeTwainCompress1e4(b *testing.B) { benchmarkEncoder(b, twain, compress, 1e4) } +func BenchmarkEncodeTwainCompress1e5(b *testing.B) { benchmarkEncoder(b, twain, compress, 1e5) } +func BenchmarkEncodeTwainCompress1e6(b *testing.B) { benchmarkEncoder(b, twain, compress, 1e6) } diff --git a/src/compress/gzip/gunzip.go b/src/compress/gzip/gunzip.go new file mode 100644 index 0000000000000000000000000000000000000000..72ee55c4fabdf5a310688bd7fda031c389510e1c --- /dev/null +++ b/src/compress/gzip/gunzip.go @@ -0,0 +1,287 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package gzip implements reading and writing of gzip format compressed files, +// as specified in RFC 1952. +package gzip + +import ( + "bufio" + "compress/flate" + "errors" + "hash" + "hash/crc32" + "io" + "time" +) + +const ( + gzipID1 = 0x1f + gzipID2 = 0x8b + gzipDeflate = 8 + flagText = 1 << 0 + flagHdrCrc = 1 << 1 + flagExtra = 1 << 2 + flagName = 1 << 3 + flagComment = 1 << 4 +) + +func makeReader(r io.Reader) flate.Reader { + if rr, ok := r.(flate.Reader); ok { + return rr + } + return bufio.NewReader(r) +} + +var ( + // ErrChecksum is returned when reading GZIP data that has an invalid checksum. + ErrChecksum = errors.New("gzip: invalid checksum") + // ErrHeader is returned when reading GZIP data that has an invalid header. + ErrHeader = errors.New("gzip: invalid header") +) + +// The gzip file stores a header giving metadata about the compressed file. +// That header is exposed as the fields of the Writer and Reader structs. +type Header struct { + Comment string // comment + Extra []byte // "extra data" + ModTime time.Time // modification time + Name string // file name + OS byte // operating system type +} + +// A Reader is an io.Reader that can be read to retrieve +// uncompressed data from a gzip-format compressed file. +// +// In general, a gzip file can be a concatenation of gzip files, +// each with its own header. Reads from the Reader +// return the concatenation of the uncompressed data of each. +// Only the first header is recorded in the Reader fields. +// +// Gzip files store a length and checksum of the uncompressed data. +// The Reader will return a ErrChecksum when Read +// reaches the end of the uncompressed data if it does not +// have the expected length or checksum. Clients should treat data +// returned by Read as tentative until they receive the io.EOF +// marking the end of the data. +type Reader struct { + Header + r flate.Reader + decompressor io.ReadCloser + digest hash.Hash32 + size uint32 + flg byte + buf [512]byte + err error + multistream bool +} + +// NewReader creates a new Reader reading the given reader. +// If r does not also implement io.ByteReader, +// the decompressor may read more data than necessary from r. +// It is the caller's responsibility to call Close on the Reader when done. +func NewReader(r io.Reader) (*Reader, error) { + z := new(Reader) + z.r = makeReader(r) + z.multistream = true + z.digest = crc32.NewIEEE() + if err := z.readHeader(true); err != nil { + return nil, err + } + return z, nil +} + +// Reset discards the Reader z's state and makes it equivalent to the +// result of its original state from NewReader, but reading from r instead. +// This permits reusing a Reader rather than allocating a new one. +func (z *Reader) Reset(r io.Reader) error { + z.r = makeReader(r) + if z.digest == nil { + z.digest = crc32.NewIEEE() + } else { + z.digest.Reset() + } + z.size = 0 + z.err = nil + z.multistream = true + return z.readHeader(true) +} + +// Multistream controls whether the reader supports multistream files. +// +// If enabled (the default), the Reader expects the input to be a sequence +// of individually gzipped data streams, each with its own header and +// trailer, ending at EOF. The effect is that the concatenation of a sequence +// of gzipped files is treated as equivalent to the gzip of the concatenation +// of the sequence. This is standard behavior for gzip readers. +// +// Calling Multistream(false) disables this behavior; disabling the behavior +// can be useful when reading file formats that distinguish individual gzip +// data streams or mix gzip data streams with other data streams. +// In this mode, when the Reader reaches the end of the data stream, +// Read returns io.EOF. If the underlying reader implements io.ByteReader, +// it will be left positioned just after the gzip stream. +// To start the next stream, call z.Reset(r) followed by z.Multistream(false). +// If there is no next stream, z.Reset(r) will return io.EOF. +func (z *Reader) Multistream(ok bool) { + z.multistream = ok +} + +// GZIP (RFC 1952) is little-endian, unlike ZLIB (RFC 1950). +func get4(p []byte) uint32 { + return uint32(p[0]) | uint32(p[1])<<8 | uint32(p[2])<<16 | uint32(p[3])<<24 +} + +func (z *Reader) readString() (string, error) { + var err error + needconv := false + for i := 0; ; i++ { + if i >= len(z.buf) { + return "", ErrHeader + } + z.buf[i], err = z.r.ReadByte() + if err != nil { + return "", err + } + if z.buf[i] > 0x7f { + needconv = true + } + if z.buf[i] == 0 { + // GZIP (RFC 1952) specifies that strings are NUL-terminated ISO 8859-1 (Latin-1). + if needconv { + s := make([]rune, 0, i) + for _, v := range z.buf[0:i] { + s = append(s, rune(v)) + } + return string(s), nil + } + return string(z.buf[0:i]), nil + } + } +} + +func (z *Reader) read2() (uint32, error) { + _, err := io.ReadFull(z.r, z.buf[0:2]) + if err != nil { + return 0, err + } + return uint32(z.buf[0]) | uint32(z.buf[1])<<8, nil +} + +func (z *Reader) readHeader(save bool) error { + _, err := io.ReadFull(z.r, z.buf[0:10]) + if err != nil { + return err + } + if z.buf[0] != gzipID1 || z.buf[1] != gzipID2 || z.buf[2] != gzipDeflate { + return ErrHeader + } + z.flg = z.buf[3] + if save { + z.ModTime = time.Unix(int64(get4(z.buf[4:8])), 0) + // z.buf[8] is xfl, ignored + z.OS = z.buf[9] + } + z.digest.Reset() + z.digest.Write(z.buf[0:10]) + + if z.flg&flagExtra != 0 { + n, err := z.read2() + if err != nil { + return err + } + data := make([]byte, n) + if _, err = io.ReadFull(z.r, data); err != nil { + return err + } + if save { + z.Extra = data + } + } + + var s string + if z.flg&flagName != 0 { + if s, err = z.readString(); err != nil { + return err + } + if save { + z.Name = s + } + } + + if z.flg&flagComment != 0 { + if s, err = z.readString(); err != nil { + return err + } + if save { + z.Comment = s + } + } + + if z.flg&flagHdrCrc != 0 { + n, err := z.read2() + if err != nil { + return err + } + sum := z.digest.Sum32() & 0xFFFF + if n != sum { + return ErrHeader + } + } + + z.digest.Reset() + if z.decompressor == nil { + z.decompressor = flate.NewReader(z.r) + } else { + z.decompressor.(flate.Resetter).Reset(z.r, nil) + } + return nil +} + +func (z *Reader) Read(p []byte) (n int, err error) { + if z.err != nil { + return 0, z.err + } + if len(p) == 0 { + return 0, nil + } + + n, err = z.decompressor.Read(p) + z.digest.Write(p[0:n]) + z.size += uint32(n) + if n != 0 || err != io.EOF { + z.err = err + return + } + + // Finished file; check checksum + size. + if _, err := io.ReadFull(z.r, z.buf[0:8]); err != nil { + z.err = err + return 0, err + } + crc32, isize := get4(z.buf[0:4]), get4(z.buf[4:8]) + sum := z.digest.Sum32() + if sum != crc32 || isize != z.size { + z.err = ErrChecksum + return 0, z.err + } + + // File is ok; is there another? + if !z.multistream { + return 0, io.EOF + } + + if err = z.readHeader(false); err != nil { + z.err = err + return + } + + // Yes. Reset and read from it. + z.digest.Reset() + z.size = 0 + return z.Read(p) +} + +// Close closes the Reader. It does not close the underlying io.Reader. +func (z *Reader) Close() error { return z.decompressor.Close() } diff --git a/src/compress/gzip/gunzip_test.go b/src/compress/gzip/gunzip_test.go new file mode 100644 index 0000000000000000000000000000000000000000..0636dec9ab01d208857673d7f8e566444eda9627 --- /dev/null +++ b/src/compress/gzip/gunzip_test.go @@ -0,0 +1,410 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package gzip + +import ( + "bytes" + "io" + "io/ioutil" + "os" + "strings" + "testing" + "time" +) + +type gunzipTest struct { + name string + desc string + raw string + gzip []byte + err error +} + +var gunzipTests = []gunzipTest{ + { // has 1 empty fixed-huffman block + "empty.txt", + "empty.txt", + "", + []byte{ + 0x1f, 0x8b, 0x08, 0x08, 0xf7, 0x5e, 0x14, 0x4a, + 0x00, 0x03, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, + 0x74, 0x78, 0x74, 0x00, 0x03, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + }, + nil, + }, + { // has 1 non-empty fixed huffman block + "hello.txt", + "hello.txt", + "hello world\n", + []byte{ + 0x1f, 0x8b, 0x08, 0x08, 0xc8, 0x58, 0x13, 0x4a, + 0x00, 0x03, 0x68, 0x65, 0x6c, 0x6c, 0x6f, 0x2e, + 0x74, 0x78, 0x74, 0x00, 0xcb, 0x48, 0xcd, 0xc9, + 0xc9, 0x57, 0x28, 0xcf, 0x2f, 0xca, 0x49, 0xe1, + 0x02, 0x00, 0x2d, 0x3b, 0x08, 0xaf, 0x0c, 0x00, + 0x00, 0x00, + }, + nil, + }, + { // concatenation + "hello.txt", + "hello.txt x2", + "hello world\n" + + "hello world\n", + []byte{ + 0x1f, 0x8b, 0x08, 0x08, 0xc8, 0x58, 0x13, 0x4a, + 0x00, 0x03, 0x68, 0x65, 0x6c, 0x6c, 0x6f, 0x2e, + 0x74, 0x78, 0x74, 0x00, 0xcb, 0x48, 0xcd, 0xc9, + 0xc9, 0x57, 0x28, 0xcf, 0x2f, 0xca, 0x49, 0xe1, + 0x02, 0x00, 0x2d, 0x3b, 0x08, 0xaf, 0x0c, 0x00, + 0x00, 0x00, + 0x1f, 0x8b, 0x08, 0x08, 0xc8, 0x58, 0x13, 0x4a, + 0x00, 0x03, 0x68, 0x65, 0x6c, 0x6c, 0x6f, 0x2e, + 0x74, 0x78, 0x74, 0x00, 0xcb, 0x48, 0xcd, 0xc9, + 0xc9, 0x57, 0x28, 0xcf, 0x2f, 0xca, 0x49, 0xe1, + 0x02, 0x00, 0x2d, 0x3b, 0x08, 0xaf, 0x0c, 0x00, + 0x00, 0x00, + }, + nil, + }, + { // has a fixed huffman block with some length-distance pairs + "shesells.txt", + "shesells.txt", + "she sells seashells by the seashore\n", + []byte{ + 0x1f, 0x8b, 0x08, 0x08, 0x72, 0x66, 0x8b, 0x4a, + 0x00, 0x03, 0x73, 0x68, 0x65, 0x73, 0x65, 0x6c, + 0x6c, 0x73, 0x2e, 0x74, 0x78, 0x74, 0x00, 0x2b, + 0xce, 0x48, 0x55, 0x28, 0x4e, 0xcd, 0xc9, 0x29, + 0x06, 0x92, 0x89, 0xc5, 0x19, 0x60, 0x56, 0x52, + 0xa5, 0x42, 0x09, 0x58, 0x18, 0x28, 0x90, 0x5f, + 0x94, 0xca, 0x05, 0x00, 0x76, 0xb0, 0x3b, 0xeb, + 0x24, 0x00, 0x00, 0x00, + }, + nil, + }, + { // has dynamic huffman blocks + "gettysburg", + "gettysburg", + " Four score and seven years ago our fathers brought forth on\n" + + "this continent, a new nation, conceived in Liberty, and dedicated\n" + + "to the proposition that all men are created equal.\n" + + " Now we are engaged in a great Civil War, testing whether that\n" + + "nation, or any nation so conceived and so dedicated, can long\n" + + "endure.\n" + + " We are met on a great battle-field of that war.\n" + + " We have come to dedicate a portion of that field, as a final\n" + + "resting place for those who here gave their lives that that\n" + + "nation might live. It is altogether fitting and proper that\n" + + "we should do this.\n" + + " But, in a larger sense, we can not dedicate — we can not\n" + + "consecrate — we can not hallow — this ground.\n" + + " The brave men, living and dead, who struggled here, have\n" + + "consecrated it, far above our poor power to add or detract.\n" + + "The world will little note, nor long remember what we say here,\n" + + "but it can never forget what they did here.\n" + + " It is for us the living, rather, to be dedicated here to the\n" + + "unfinished work which they who fought here have thus far so\n" + + "nobly advanced. It is rather for us to be here dedicated to\n" + + "the great task remaining before us — that from these honored\n" + + "dead we take increased devotion to that cause for which they\n" + + "gave the last full measure of devotion —\n" + + " that we here highly resolve that these dead shall not have\n" + + "died in vain — that this nation, under God, shall have a new\n" + + "birth of freedom — and that government of the people, by the\n" + + "people, for the people, shall not perish from this earth.\n" + + "\n" + + "Abraham Lincoln, November 19, 1863, Gettysburg, Pennsylvania\n", + []byte{ + 0x1f, 0x8b, 0x08, 0x08, 0xd1, 0x12, 0x2b, 0x4a, + 0x00, 0x03, 0x67, 0x65, 0x74, 0x74, 0x79, 0x73, + 0x62, 0x75, 0x72, 0x67, 0x00, 0x65, 0x54, 0xcd, + 0x6e, 0xd4, 0x30, 0x10, 0xbe, 0xfb, 0x29, 0xe6, + 0x01, 0x42, 0xa5, 0x0a, 0x09, 0xc1, 0x11, 0x90, + 0x40, 0x48, 0xa8, 0xe2, 0x80, 0xd4, 0xf3, 0x24, + 0x9e, 0x24, 0x56, 0xbd, 0x9e, 0xc5, 0x76, 0x76, + 0x95, 0x1b, 0x0f, 0xc1, 0x13, 0xf2, 0x24, 0x7c, + 0x63, 0x77, 0x9b, 0x4a, 0x5c, 0xaa, 0x6e, 0x6c, + 0xcf, 0x7c, 0x7f, 0x33, 0x44, 0x5f, 0x74, 0xcb, + 0x54, 0x26, 0xcd, 0x42, 0x9c, 0x3c, 0x15, 0xb9, + 0x48, 0xa2, 0x5d, 0x38, 0x17, 0xe2, 0x45, 0xc9, + 0x4e, 0x67, 0xae, 0xab, 0xe0, 0xf7, 0x98, 0x75, + 0x5b, 0xd6, 0x4a, 0xb3, 0xe6, 0xba, 0x92, 0x26, + 0x57, 0xd7, 0x50, 0x68, 0xd2, 0x54, 0x43, 0x92, + 0x54, 0x07, 0x62, 0x4a, 0x72, 0xa5, 0xc4, 0x35, + 0x68, 0x1a, 0xec, 0x60, 0x92, 0x70, 0x11, 0x4f, + 0x21, 0xd1, 0xf7, 0x30, 0x4a, 0xae, 0xfb, 0xd0, + 0x9a, 0x78, 0xf1, 0x61, 0xe2, 0x2a, 0xde, 0x55, + 0x25, 0xd4, 0xa6, 0x73, 0xd6, 0xb3, 0x96, 0x60, + 0xef, 0xf0, 0x9b, 0x2b, 0x71, 0x8c, 0x74, 0x02, + 0x10, 0x06, 0xac, 0x29, 0x8b, 0xdd, 0x25, 0xf9, + 0xb5, 0x71, 0xbc, 0x73, 0x44, 0x0f, 0x7a, 0xa5, + 0xab, 0xb4, 0x33, 0x49, 0x0b, 0x2f, 0xbd, 0x03, + 0xd3, 0x62, 0x17, 0xe9, 0x73, 0xb8, 0x84, 0x48, + 0x8f, 0x9c, 0x07, 0xaa, 0x52, 0x00, 0x6d, 0xa1, + 0xeb, 0x2a, 0xc6, 0xa0, 0x95, 0x76, 0x37, 0x78, + 0x9a, 0x81, 0x65, 0x7f, 0x46, 0x4b, 0x45, 0x5f, + 0xe1, 0x6d, 0x42, 0xe8, 0x01, 0x13, 0x5c, 0x38, + 0x51, 0xd4, 0xb4, 0x38, 0x49, 0x7e, 0xcb, 0x62, + 0x28, 0x1e, 0x3b, 0x82, 0x93, 0x54, 0x48, 0xf1, + 0xd2, 0x7d, 0xe4, 0x5a, 0xa3, 0xbc, 0x99, 0x83, + 0x44, 0x4f, 0x3a, 0x77, 0x36, 0x57, 0xce, 0xcf, + 0x2f, 0x56, 0xbe, 0x80, 0x90, 0x9e, 0x84, 0xea, + 0x51, 0x1f, 0x8f, 0xcf, 0x90, 0xd4, 0x60, 0xdc, + 0x5e, 0xb4, 0xf7, 0x10, 0x0b, 0x26, 0xe0, 0xff, + 0xc4, 0xd1, 0xe5, 0x67, 0x2e, 0xe7, 0xc8, 0x93, + 0x98, 0x05, 0xb8, 0xa8, 0x45, 0xc0, 0x4d, 0x09, + 0xdc, 0x84, 0x16, 0x2b, 0x0d, 0x9a, 0x21, 0x53, + 0x04, 0x8b, 0xd2, 0x0b, 0xbd, 0xa2, 0x4c, 0xa7, + 0x60, 0xee, 0xd9, 0xe1, 0x1d, 0xd1, 0xb7, 0x4a, + 0x30, 0x8f, 0x63, 0xd5, 0xa5, 0x8b, 0x33, 0x87, + 0xda, 0x1a, 0x18, 0x79, 0xf3, 0xe3, 0xa6, 0x17, + 0x94, 0x2e, 0xab, 0x6e, 0xa0, 0xe3, 0xcd, 0xac, + 0x50, 0x8c, 0xca, 0xa7, 0x0d, 0x76, 0x37, 0xd1, + 0x23, 0xe7, 0x05, 0x57, 0x8b, 0xa4, 0x22, 0x83, + 0xd9, 0x62, 0x52, 0x25, 0xad, 0x07, 0xbb, 0xbf, + 0xbf, 0xff, 0xbc, 0xfa, 0xee, 0x20, 0x73, 0x91, + 0x29, 0xff, 0x7f, 0x02, 0x71, 0x62, 0x84, 0xb5, + 0xf6, 0xb5, 0x25, 0x6b, 0x41, 0xde, 0x92, 0xb7, + 0x76, 0x3f, 0x91, 0x91, 0x31, 0x1b, 0x41, 0x84, + 0x62, 0x30, 0x0a, 0x37, 0xa4, 0x5e, 0x18, 0x3a, + 0x99, 0x08, 0xa5, 0xe6, 0x6d, 0x59, 0x22, 0xec, + 0x33, 0x39, 0x86, 0x26, 0xf5, 0xab, 0x66, 0xc8, + 0x08, 0x20, 0xcf, 0x0c, 0xd7, 0x47, 0x45, 0x21, + 0x0b, 0xf6, 0x59, 0xd5, 0xfe, 0x5c, 0x8d, 0xaa, + 0x12, 0x7b, 0x6f, 0xa1, 0xf0, 0x52, 0x33, 0x4f, + 0xf5, 0xce, 0x59, 0xd3, 0xab, 0x66, 0x10, 0xbf, + 0x06, 0xc4, 0x31, 0x06, 0x73, 0xd6, 0x80, 0xa2, + 0x78, 0xc2, 0x45, 0xcb, 0x03, 0x65, 0x39, 0xc9, + 0x09, 0xd1, 0x06, 0x04, 0x33, 0x1a, 0x5a, 0xf1, + 0xde, 0x01, 0xb8, 0x71, 0x83, 0xc4, 0xb5, 0xb3, + 0xc3, 0x54, 0x65, 0x33, 0x0d, 0x5a, 0xf7, 0x9b, + 0x90, 0x7c, 0x27, 0x1f, 0x3a, 0x58, 0xa3, 0xd8, + 0xfd, 0x30, 0x5f, 0xb7, 0xd2, 0x66, 0xa2, 0x93, + 0x1c, 0x28, 0xb7, 0xe9, 0x1b, 0x0c, 0xe1, 0x28, + 0x47, 0x26, 0xbb, 0xe9, 0x7d, 0x7e, 0xdc, 0x96, + 0x10, 0x92, 0x50, 0x56, 0x7c, 0x06, 0xe2, 0x27, + 0xb4, 0x08, 0xd3, 0xda, 0x7b, 0x98, 0x34, 0x73, + 0x9f, 0xdb, 0xf6, 0x62, 0xed, 0x31, 0x41, 0x13, + 0xd3, 0xa2, 0xa8, 0x4b, 0x3a, 0xc6, 0x1d, 0xe4, + 0x2f, 0x8c, 0xf8, 0xfb, 0x97, 0x64, 0xf4, 0xb6, + 0x2f, 0x80, 0x5a, 0xf3, 0x56, 0xe0, 0x40, 0x50, + 0xd5, 0x19, 0xd0, 0x1e, 0xfc, 0xca, 0xe5, 0xc9, + 0xd4, 0x60, 0x00, 0x81, 0x2e, 0xa3, 0xcc, 0xb6, + 0x52, 0xf0, 0xb4, 0xdb, 0x69, 0x99, 0xce, 0x7a, + 0x32, 0x4c, 0x08, 0xed, 0xaa, 0x10, 0x10, 0xe3, + 0x6f, 0xee, 0x99, 0x68, 0x95, 0x9f, 0x04, 0x71, + 0xb2, 0x49, 0x2f, 0x62, 0xa6, 0x5e, 0xb4, 0xef, + 0x02, 0xed, 0x4f, 0x27, 0xde, 0x4a, 0x0f, 0xfd, + 0xc1, 0xcc, 0xdd, 0x02, 0x8f, 0x08, 0x16, 0x54, + 0xdf, 0xda, 0xca, 0xe0, 0x82, 0xf1, 0xb4, 0x31, + 0x7a, 0xa9, 0x81, 0xfe, 0x90, 0xb7, 0x3e, 0xdb, + 0xd3, 0x35, 0xc0, 0x20, 0x80, 0x33, 0x46, 0x4a, + 0x63, 0xab, 0xd1, 0x0d, 0x29, 0xd2, 0xe2, 0x84, + 0xb8, 0xdb, 0xfa, 0xe9, 0x89, 0x44, 0x86, 0x7c, + 0xe8, 0x0b, 0xe6, 0x02, 0x6a, 0x07, 0x9b, 0x96, + 0xd0, 0xdb, 0x2e, 0x41, 0x4c, 0xa1, 0xd5, 0x57, + 0x45, 0x14, 0xfb, 0xe3, 0xa6, 0x72, 0x5b, 0x87, + 0x6e, 0x0c, 0x6d, 0x5b, 0xce, 0xe0, 0x2f, 0xe2, + 0x21, 0x81, 0x95, 0xb0, 0xe8, 0xb6, 0x32, 0x0b, + 0xb2, 0x98, 0x13, 0x52, 0x5d, 0xfb, 0xec, 0x63, + 0x17, 0x8a, 0x9e, 0x23, 0x22, 0x36, 0xee, 0xcd, + 0xda, 0xdb, 0xcf, 0x3e, 0xf1, 0xc7, 0xf1, 0x01, + 0x12, 0x93, 0x0a, 0xeb, 0x6f, 0xf2, 0x02, 0x15, + 0x96, 0x77, 0x5d, 0xef, 0x9c, 0xfb, 0x88, 0x91, + 0x59, 0xf9, 0x84, 0xdd, 0x9b, 0x26, 0x8d, 0x80, + 0xf9, 0x80, 0x66, 0x2d, 0xac, 0xf7, 0x1f, 0x06, + 0xba, 0x7f, 0xff, 0xee, 0xed, 0x40, 0x5f, 0xa5, + 0xd6, 0xbd, 0x8c, 0x5b, 0x46, 0xd2, 0x7e, 0x48, + 0x4a, 0x65, 0x8f, 0x08, 0x42, 0x60, 0xf7, 0x0f, + 0xb9, 0x16, 0x0b, 0x0c, 0x1a, 0x06, 0x00, 0x00, + }, + nil, + }, + { // has 1 non-empty fixed huffman block then garbage + "hello.txt", + "hello.txt + garbage", + "hello world\n", + []byte{ + 0x1f, 0x8b, 0x08, 0x08, 0xc8, 0x58, 0x13, 0x4a, + 0x00, 0x03, 0x68, 0x65, 0x6c, 0x6c, 0x6f, 0x2e, + 0x74, 0x78, 0x74, 0x00, 0xcb, 0x48, 0xcd, 0xc9, + 0xc9, 0x57, 0x28, 0xcf, 0x2f, 0xca, 0x49, 0xe1, + 0x02, 0x00, 0x2d, 0x3b, 0x08, 0xaf, 0x0c, 0x00, + 0x00, 0x00, 'g', 'a', 'r', 'b', 'a', 'g', 'e', '!', '!', '!', + }, + ErrHeader, + }, + { // has 1 non-empty fixed huffman block not enough header + "hello.txt", + "hello.txt + garbage", + "hello world\n", + []byte{ + 0x1f, 0x8b, 0x08, 0x08, 0xc8, 0x58, 0x13, 0x4a, + 0x00, 0x03, 0x68, 0x65, 0x6c, 0x6c, 0x6f, 0x2e, + 0x74, 0x78, 0x74, 0x00, 0xcb, 0x48, 0xcd, 0xc9, + 0xc9, 0x57, 0x28, 0xcf, 0x2f, 0xca, 0x49, 0xe1, + 0x02, 0x00, 0x2d, 0x3b, 0x08, 0xaf, 0x0c, 0x00, + 0x00, 0x00, gzipID1, + }, + io.ErrUnexpectedEOF, + }, + { // has 1 non-empty fixed huffman block but corrupt checksum + "hello.txt", + "hello.txt + corrupt checksum", + "hello world\n", + []byte{ + 0x1f, 0x8b, 0x08, 0x08, 0xc8, 0x58, 0x13, 0x4a, + 0x00, 0x03, 0x68, 0x65, 0x6c, 0x6c, 0x6f, 0x2e, + 0x74, 0x78, 0x74, 0x00, 0xcb, 0x48, 0xcd, 0xc9, + 0xc9, 0x57, 0x28, 0xcf, 0x2f, 0xca, 0x49, 0xe1, + 0x02, 0x00, 0xff, 0xff, 0xff, 0xff, 0x0c, 0x00, + 0x00, 0x00, + }, + ErrChecksum, + }, + { // has 1 non-empty fixed huffman block but corrupt size + "hello.txt", + "hello.txt + corrupt size", + "hello world\n", + []byte{ + 0x1f, 0x8b, 0x08, 0x08, 0xc8, 0x58, 0x13, 0x4a, + 0x00, 0x03, 0x68, 0x65, 0x6c, 0x6c, 0x6f, 0x2e, + 0x74, 0x78, 0x74, 0x00, 0xcb, 0x48, 0xcd, 0xc9, + 0xc9, 0x57, 0x28, 0xcf, 0x2f, 0xca, 0x49, 0xe1, + 0x02, 0x00, 0x2d, 0x3b, 0x08, 0xaf, 0xff, 0x00, + 0x00, 0x00, + }, + ErrChecksum, + }, +} + +func TestDecompressor(t *testing.T) { + b := new(bytes.Buffer) + for _, tt := range gunzipTests { + in := bytes.NewReader(tt.gzip) + gzip, err := NewReader(in) + if err != nil { + t.Errorf("%s: NewReader: %s", tt.name, err) + continue + } + defer gzip.Close() + if tt.name != gzip.Name { + t.Errorf("%s: got name %s", tt.name, gzip.Name) + } + b.Reset() + n, err := io.Copy(b, gzip) + if err != tt.err { + t.Errorf("%s: io.Copy: %v want %v", tt.name, err, tt.err) + } + s := b.String() + if s != tt.raw { + t.Errorf("%s: got %d-byte %q want %d-byte %q", tt.name, n, s, len(tt.raw), tt.raw) + } + + // Test Reader Reset. + in = bytes.NewReader(tt.gzip) + err = gzip.Reset(in) + if err != nil { + t.Errorf("%s: Reset: %s", tt.name, err) + continue + } + if tt.name != gzip.Name { + t.Errorf("%s: got name %s", tt.name, gzip.Name) + } + b.Reset() + n, err = io.Copy(b, gzip) + if err != tt.err { + t.Errorf("%s: io.Copy: %v want %v", tt.name, err, tt.err) + } + s = b.String() + if s != tt.raw { + t.Errorf("%s: got %d-byte %q want %d-byte %q", tt.name, n, s, len(tt.raw), tt.raw) + } + } +} + +func TestIssue6550(t *testing.T) { + f, err := os.Open("testdata/issue6550.gz") + if err != nil { + t.Fatal(err) + } + gzip, err := NewReader(f) + if err != nil { + t.Fatalf("NewReader(testdata/issue6550.gz): %v", err) + } + defer gzip.Close() + done := make(chan bool, 1) + go func() { + _, err := io.Copy(ioutil.Discard, gzip) + if err == nil { + t.Errorf("Copy succeeded") + } else { + t.Logf("Copy failed (correctly): %v", err) + } + done <- true + }() + select { + case <-time.After(1 * time.Second): + t.Errorf("Copy hung") + case <-done: + // ok + } +} + +func TestInitialReset(t *testing.T) { + var r Reader + if err := r.Reset(bytes.NewReader(gunzipTests[1].gzip)); err != nil { + t.Error(err) + } + var buf bytes.Buffer + if _, err := io.Copy(&buf, &r); err != nil { + t.Error(err) + } + if s := buf.String(); s != gunzipTests[1].raw { + t.Errorf("got %q want %q", s, gunzipTests[1].raw) + } +} + +func TestMultistreamFalse(t *testing.T) { + // Find concatenation test. + var tt gunzipTest + for _, tt = range gunzipTests { + if strings.HasSuffix(tt.desc, " x2") { + goto Found + } + } + t.Fatal("cannot find hello.txt x2 in gunzip tests") + +Found: + br := bytes.NewReader(tt.gzip) + var r Reader + if err := r.Reset(br); err != nil { + t.Fatalf("first reset: %v", err) + } + + // Expect two streams with "hello world\n", then real EOF. + const hello = "hello world\n" + + r.Multistream(false) + data, err := ioutil.ReadAll(&r) + if string(data) != hello || err != nil { + t.Fatalf("first stream = %q, %v, want %q, %v", string(data), err, hello, nil) + } + + if err := r.Reset(br); err != nil { + t.Fatalf("second reset: %v", err) + } + r.Multistream(false) + data, err = ioutil.ReadAll(&r) + if string(data) != hello || err != nil { + t.Fatalf("second stream = %q, %v, want %q, %v", string(data), err, hello, nil) + } + + if err := r.Reset(br); err != io.EOF { + t.Fatalf("third reset: err=%v, want io.EOF", err) + } +} diff --git a/src/compress/gzip/gzip.go b/src/compress/gzip/gzip.go new file mode 100644 index 0000000000000000000000000000000000000000..5131d128e4e21e348e975d4180b0207878a164dc --- /dev/null +++ b/src/compress/gzip/gzip.go @@ -0,0 +1,272 @@ +// Copyright 2010 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package gzip + +import ( + "compress/flate" + "errors" + "fmt" + "hash" + "hash/crc32" + "io" +) + +// These constants are copied from the flate package, so that code that imports +// "compress/gzip" does not also have to import "compress/flate". +const ( + NoCompression = flate.NoCompression + BestSpeed = flate.BestSpeed + BestCompression = flate.BestCompression + DefaultCompression = flate.DefaultCompression +) + +// A Writer is an io.WriteCloser. +// Writes to a Writer are compressed and written to w. +type Writer struct { + Header + w io.Writer + level int + wroteHeader bool + compressor *flate.Writer + digest hash.Hash32 + size uint32 + closed bool + buf [10]byte + err error +} + +// NewWriter returns a new Writer. +// Writes to the returned writer are compressed and written to w. +// +// It is the caller's responsibility to call Close on the WriteCloser when done. +// Writes may be buffered and not flushed until Close. +// +// Callers that wish to set the fields in Writer.Header must do so before +// the first call to Write or Close. The Comment and Name header fields are +// UTF-8 strings in Go, but the underlying format requires NUL-terminated ISO +// 8859-1 (Latin-1). NUL or non-Latin-1 runes in those strings will lead to an +// error on Write. +func NewWriter(w io.Writer) *Writer { + z, _ := NewWriterLevel(w, DefaultCompression) + return z +} + +// NewWriterLevel is like NewWriter but specifies the compression level instead +// of assuming DefaultCompression. +// +// The compression level can be DefaultCompression, NoCompression, or any +// integer value between BestSpeed and BestCompression inclusive. The error +// returned will be nil if the level is valid. +func NewWriterLevel(w io.Writer, level int) (*Writer, error) { + if level < DefaultCompression || level > BestCompression { + return nil, fmt.Errorf("gzip: invalid compression level: %d", level) + } + z := new(Writer) + z.init(w, level) + return z, nil +} + +func (z *Writer) init(w io.Writer, level int) { + digest := z.digest + if digest != nil { + digest.Reset() + } else { + digest = crc32.NewIEEE() + } + compressor := z.compressor + if compressor != nil { + compressor.Reset(w) + } + *z = Writer{ + Header: Header{ + OS: 255, // unknown + }, + w: w, + level: level, + digest: digest, + compressor: compressor, + } +} + +// Reset discards the Writer z's state and makes it equivalent to the +// result of its original state from NewWriter or NewWriterLevel, but +// writing to w instead. This permits reusing a Writer rather than +// allocating a new one. +func (z *Writer) Reset(w io.Writer) { + z.init(w, z.level) +} + +// GZIP (RFC 1952) is little-endian, unlike ZLIB (RFC 1950). +func put2(p []byte, v uint16) { + p[0] = uint8(v >> 0) + p[1] = uint8(v >> 8) +} + +func put4(p []byte, v uint32) { + p[0] = uint8(v >> 0) + p[1] = uint8(v >> 8) + p[2] = uint8(v >> 16) + p[3] = uint8(v >> 24) +} + +// writeBytes writes a length-prefixed byte slice to z.w. +func (z *Writer) writeBytes(b []byte) error { + if len(b) > 0xffff { + return errors.New("gzip.Write: Extra data is too large") + } + put2(z.buf[0:2], uint16(len(b))) + _, err := z.w.Write(z.buf[0:2]) + if err != nil { + return err + } + _, err = z.w.Write(b) + return err +} + +// writeString writes a UTF-8 string s in GZIP's format to z.w. +// GZIP (RFC 1952) specifies that strings are NUL-terminated ISO 8859-1 (Latin-1). +func (z *Writer) writeString(s string) (err error) { + // GZIP stores Latin-1 strings; error if non-Latin-1; convert if non-ASCII. + needconv := false + for _, v := range s { + if v == 0 || v > 0xff { + return errors.New("gzip.Write: non-Latin-1 header string") + } + if v > 0x7f { + needconv = true + } + } + if needconv { + b := make([]byte, 0, len(s)) + for _, v := range s { + b = append(b, byte(v)) + } + _, err = z.w.Write(b) + } else { + _, err = io.WriteString(z.w, s) + } + if err != nil { + return err + } + // GZIP strings are NUL-terminated. + z.buf[0] = 0 + _, err = z.w.Write(z.buf[0:1]) + return err +} + +// Write writes a compressed form of p to the underlying io.Writer. The +// compressed bytes are not necessarily flushed until the Writer is closed. +func (z *Writer) Write(p []byte) (int, error) { + if z.err != nil { + return 0, z.err + } + var n int + // Write the GZIP header lazily. + if !z.wroteHeader { + z.wroteHeader = true + z.buf[0] = gzipID1 + z.buf[1] = gzipID2 + z.buf[2] = gzipDeflate + z.buf[3] = 0 + if z.Extra != nil { + z.buf[3] |= 0x04 + } + if z.Name != "" { + z.buf[3] |= 0x08 + } + if z.Comment != "" { + z.buf[3] |= 0x10 + } + put4(z.buf[4:8], uint32(z.ModTime.Unix())) + if z.level == BestCompression { + z.buf[8] = 2 + } else if z.level == BestSpeed { + z.buf[8] = 4 + } else { + z.buf[8] = 0 + } + z.buf[9] = z.OS + n, z.err = z.w.Write(z.buf[0:10]) + if z.err != nil { + return n, z.err + } + if z.Extra != nil { + z.err = z.writeBytes(z.Extra) + if z.err != nil { + return n, z.err + } + } + if z.Name != "" { + z.err = z.writeString(z.Name) + if z.err != nil { + return n, z.err + } + } + if z.Comment != "" { + z.err = z.writeString(z.Comment) + if z.err != nil { + return n, z.err + } + } + if z.compressor == nil { + z.compressor, _ = flate.NewWriter(z.w, z.level) + } + } + z.size += uint32(len(p)) + z.digest.Write(p) + n, z.err = z.compressor.Write(p) + return n, z.err +} + +// Flush flushes any pending compressed data to the underlying writer. +// +// It is useful mainly in compressed network protocols, to ensure that +// a remote reader has enough data to reconstruct a packet. Flush does +// not return until the data has been written. If the underlying +// writer returns an error, Flush returns that error. +// +// In the terminology of the zlib library, Flush is equivalent to Z_SYNC_FLUSH. +func (z *Writer) Flush() error { + if z.err != nil { + return z.err + } + if z.closed { + return nil + } + if !z.wroteHeader { + z.Write(nil) + if z.err != nil { + return z.err + } + } + z.err = z.compressor.Flush() + return z.err +} + +// Close closes the Writer, flushing any unwritten data to the underlying +// io.Writer, but does not close the underlying io.Writer. +func (z *Writer) Close() error { + if z.err != nil { + return z.err + } + if z.closed { + return nil + } + z.closed = true + if !z.wroteHeader { + z.Write(nil) + if z.err != nil { + return z.err + } + } + z.err = z.compressor.Close() + if z.err != nil { + return z.err + } + put4(z.buf[0:4], z.digest.Sum32()) + put4(z.buf[4:8], z.size) + _, z.err = z.w.Write(z.buf[0:8]) + return z.err +} diff --git a/src/compress/gzip/gzip_test.go b/src/compress/gzip/gzip_test.go new file mode 100644 index 0000000000000000000000000000000000000000..09271b24e92037492a7e9e753ec58f96a88d8ace --- /dev/null +++ b/src/compress/gzip/gzip_test.go @@ -0,0 +1,231 @@ +// Copyright 2010 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package gzip + +import ( + "bufio" + "bytes" + "io/ioutil" + "testing" + "time" +) + +// TestEmpty tests that an empty payload still forms a valid GZIP stream. +func TestEmpty(t *testing.T) { + buf := new(bytes.Buffer) + + if err := NewWriter(buf).Close(); err != nil { + t.Fatalf("Writer.Close: %v", err) + } + + r, err := NewReader(buf) + if err != nil { + t.Fatalf("NewReader: %v", err) + } + b, err := ioutil.ReadAll(r) + if err != nil { + t.Fatalf("ReadAll: %v", err) + } + if len(b) != 0 { + t.Fatalf("got %d bytes, want 0", len(b)) + } + if err := r.Close(); err != nil { + t.Fatalf("Reader.Close: %v", err) + } +} + +// TestRoundTrip tests that gzipping and then gunzipping is the identity +// function. +func TestRoundTrip(t *testing.T) { + buf := new(bytes.Buffer) + + w := NewWriter(buf) + w.Comment = "comment" + w.Extra = []byte("extra") + w.ModTime = time.Unix(1e8, 0) + w.Name = "name" + if _, err := w.Write([]byte("payload")); err != nil { + t.Fatalf("Write: %v", err) + } + if err := w.Close(); err != nil { + t.Fatalf("Writer.Close: %v", err) + } + + r, err := NewReader(buf) + if err != nil { + t.Fatalf("NewReader: %v", err) + } + b, err := ioutil.ReadAll(r) + if err != nil { + t.Fatalf("ReadAll: %v", err) + } + if string(b) != "payload" { + t.Fatalf("payload is %q, want %q", string(b), "payload") + } + if r.Comment != "comment" { + t.Fatalf("comment is %q, want %q", r.Comment, "comment") + } + if string(r.Extra) != "extra" { + t.Fatalf("extra is %q, want %q", r.Extra, "extra") + } + if r.ModTime.Unix() != 1e8 { + t.Fatalf("mtime is %d, want %d", r.ModTime.Unix(), uint32(1e8)) + } + if r.Name != "name" { + t.Fatalf("name is %q, want %q", r.Name, "name") + } + if err := r.Close(); err != nil { + t.Fatalf("Reader.Close: %v", err) + } +} + +// TestLatin1 tests the internal functions for converting to and from Latin-1. +func TestLatin1(t *testing.T) { + latin1 := []byte{0xc4, 'u', 0xdf, 'e', 'r', 'u', 'n', 'g', 0} + utf8 := "Äußerung" + z := Reader{r: bufio.NewReader(bytes.NewReader(latin1))} + s, err := z.readString() + if err != nil { + t.Fatalf("readString: %v", err) + } + if s != utf8 { + t.Fatalf("read latin-1: got %q, want %q", s, utf8) + } + + buf := bytes.NewBuffer(make([]byte, 0, len(latin1))) + c := Writer{w: buf} + if err = c.writeString(utf8); err != nil { + t.Fatalf("writeString: %v", err) + } + s = buf.String() + if s != string(latin1) { + t.Fatalf("write utf-8: got %q, want %q", s, string(latin1)) + } +} + +// TestLatin1RoundTrip tests that metadata that is representable in Latin-1 +// survives a round trip. +func TestLatin1RoundTrip(t *testing.T) { + testCases := []struct { + name string + ok bool + }{ + {"", true}, + {"ASCII is OK", true}, + {"unless it contains a NUL\x00", false}, + {"no matter where \x00 occurs", false}, + {"\x00\x00\x00", false}, + {"Látin-1 also passes (U+00E1)", true}, + {"but LĀtin Extended-A (U+0100) does not", false}, + {"neither does 日本語", false}, + {"invalid UTF-8 also \xffails", false}, + {"\x00 as does Látin-1 with NUL", false}, + } + for _, tc := range testCases { + buf := new(bytes.Buffer) + + w := NewWriter(buf) + w.Name = tc.name + err := w.Close() + if (err == nil) != tc.ok { + t.Errorf("Writer.Close: name = %q, err = %v", tc.name, err) + continue + } + if !tc.ok { + continue + } + + r, err := NewReader(buf) + if err != nil { + t.Errorf("NewReader: %v", err) + continue + } + _, err = ioutil.ReadAll(r) + if err != nil { + t.Errorf("ReadAll: %v", err) + continue + } + if r.Name != tc.name { + t.Errorf("name is %q, want %q", r.Name, tc.name) + continue + } + if err := r.Close(); err != nil { + t.Errorf("Reader.Close: %v", err) + continue + } + } +} + +func TestWriterFlush(t *testing.T) { + buf := new(bytes.Buffer) + + w := NewWriter(buf) + w.Comment = "comment" + w.Extra = []byte("extra") + w.ModTime = time.Unix(1e8, 0) + w.Name = "name" + + n0 := buf.Len() + if n0 != 0 { + t.Fatalf("buffer size = %d before writes; want 0", n0) + } + + if err := w.Flush(); err != nil { + t.Fatal(err) + } + + n1 := buf.Len() + if n1 == 0 { + t.Fatal("no data after first flush") + } + + w.Write([]byte("x")) + + n2 := buf.Len() + if n1 != n2 { + t.Fatalf("after writing a single byte, size changed from %d to %d; want no change", n1, n2) + } + + if err := w.Flush(); err != nil { + t.Fatal(err) + } + + n3 := buf.Len() + if n2 == n3 { + t.Fatal("Flush didn't flush any data") + } +} + +// Multiple gzip files concatenated form a valid gzip file. +func TestConcat(t *testing.T) { + var buf bytes.Buffer + w := NewWriter(&buf) + w.Write([]byte("hello ")) + w.Close() + w = NewWriter(&buf) + w.Write([]byte("world\n")) + w.Close() + + r, err := NewReader(&buf) + data, err := ioutil.ReadAll(r) + if string(data) != "hello world\n" || err != nil { + t.Fatalf("ReadAll = %q, %v, want %q, nil", data, err, "hello world") + } +} + +func TestWriterReset(t *testing.T) { + buf := new(bytes.Buffer) + buf2 := new(bytes.Buffer) + z := NewWriter(buf) + msg := []byte("hello world") + z.Write(msg) + z.Close() + z.Reset(buf2) + z.Write(msg) + z.Close() + if buf.String() != buf2.String() { + t.Errorf("buf2 %q != original buf of %q", buf2.String(), buf.String()) + } +} diff --git a/src/compress/gzip/testdata/issue6550.gz b/src/compress/gzip/testdata/issue6550.gz new file mode 100644 index 0000000000000000000000000000000000000000..57972b636680170bbe26d3876481b24f54d4ab55 Binary files /dev/null and b/src/compress/gzip/testdata/issue6550.gz differ diff --git a/src/compress/lzw/reader.go b/src/compress/lzw/reader.go new file mode 100644 index 0000000000000000000000000000000000000000..1353831eca9d8ad4d9a243da5f8cfc6cef1ae31c --- /dev/null +++ b/src/compress/lzw/reader.go @@ -0,0 +1,262 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package lzw implements the Lempel-Ziv-Welch compressed data format, +// described in T. A. Welch, ``A Technique for High-Performance Data +// Compression'', Computer, 17(6) (June 1984), pp 8-19. +// +// In particular, it implements LZW as used by the GIF and PDF file +// formats, which means variable-width codes up to 12 bits and the first +// two non-literal codes are a clear code and an EOF code. +// +// The TIFF file format uses a similar but incompatible version of the LZW +// algorithm. See the golang.org/x/image/tiff/lzw package for an +// implementation. +package lzw + +// TODO(nigeltao): check that PDF uses LZW in the same way as GIF, +// modulo LSB/MSB packing order. + +import ( + "bufio" + "errors" + "fmt" + "io" +) + +// Order specifies the bit ordering in an LZW data stream. +type Order int + +const ( + // LSB means Least Significant Bits first, as used in the GIF file format. + LSB Order = iota + // MSB means Most Significant Bits first, as used in the TIFF and PDF + // file formats. + MSB +) + +const ( + maxWidth = 12 + decoderInvalidCode = 0xffff + flushBuffer = 1 << maxWidth +) + +// decoder is the state from which the readXxx method converts a byte +// stream into a code stream. +type decoder struct { + r io.ByteReader + bits uint32 + nBits uint + width uint + read func(*decoder) (uint16, error) // readLSB or readMSB + litWidth int // width in bits of literal codes + err error + + // The first 1<= 1<>= d.width + d.nBits -= d.width + return code, nil +} + +// readMSB returns the next code for "Most Significant Bits first" data. +func (d *decoder) readMSB() (uint16, error) { + for d.nBits < d.width { + x, err := d.r.ReadByte() + if err != nil { + return 0, err + } + d.bits |= uint32(x) << (24 - d.nBits) + d.nBits += 8 + } + code := uint16(d.bits >> (32 - d.width)) + d.bits <<= d.width + d.nBits -= d.width + return code, nil +} + +func (d *decoder) Read(b []byte) (int, error) { + for { + if len(d.toRead) > 0 { + n := copy(b, d.toRead) + d.toRead = d.toRead[n:] + return n, nil + } + if d.err != nil { + return 0, d.err + } + d.decode() + } +} + +// decode decompresses bytes from r and leaves them in d.toRead. +// read specifies how to decode bytes into codes. +// litWidth is the width in bits of literal codes. +func (d *decoder) decode() { + // Loop over the code stream, converting codes into decompressed bytes. + for { + code, err := d.read(d) + if err != nil { + if err == io.EOF { + err = io.ErrUnexpectedEOF + } + d.err = err + d.flush() + return + } + switch { + case code < d.clear: + // We have a literal code. + d.output[d.o] = uint8(code) + d.o++ + if d.last != decoderInvalidCode { + // Save what the hi code expands to. + d.suffix[d.hi] = uint8(code) + d.prefix[d.hi] = d.last + } + case code == d.clear: + d.width = 1 + uint(d.litWidth) + d.hi = d.eof + d.overflow = 1 << d.width + d.last = decoderInvalidCode + continue + case code == d.eof: + d.flush() + d.err = io.EOF + return + case code <= d.hi: + c, i := code, len(d.output)-1 + if code == d.hi { + // code == hi is a special case which expands to the last expansion + // followed by the head of the last expansion. To find the head, we walk + // the prefix chain until we find a literal code. + c = d.last + for c >= d.clear { + c = d.prefix[c] + } + d.output[i] = uint8(c) + i-- + c = d.last + } + // Copy the suffix chain into output and then write that to w. + for c >= d.clear { + d.output[i] = d.suffix[c] + i-- + c = d.prefix[c] + } + d.output[i] = uint8(c) + d.o += copy(d.output[d.o:], d.output[i:]) + if d.last != decoderInvalidCode { + // Save what the hi code expands to. + d.suffix[d.hi] = uint8(c) + d.prefix[d.hi] = d.last + } + default: + d.err = errors.New("lzw: invalid code") + d.flush() + return + } + d.last, d.hi = code, d.hi+1 + if d.hi >= d.overflow { + if d.width == maxWidth { + d.last = decoderInvalidCode + } else { + d.width++ + d.overflow <<= 1 + } + } + if d.o >= flushBuffer { + d.flush() + return + } + } +} + +func (d *decoder) flush() { + d.toRead = d.output[:d.o] + d.o = 0 +} + +var errClosed = errors.New("lzw: reader/writer is closed") + +func (d *decoder) Close() error { + d.err = errClosed // in case any Reads come along + return nil +} + +// NewReader creates a new io.ReadCloser. +// Reads from the returned io.ReadCloser read and decompress data from r. +// If r does not also implement io.ByteReader, +// the decompressor may read more data than necessary from r. +// It is the caller's responsibility to call Close on the ReadCloser when +// finished reading. +// The number of bits to use for literal codes, litWidth, must be in the +// range [2,8] and is typically 8. It must equal the litWidth +// used during compression. +func NewReader(r io.Reader, order Order, litWidth int) io.ReadCloser { + d := new(decoder) + switch order { + case LSB: + d.read = (*decoder).readLSB + case MSB: + d.read = (*decoder).readMSB + default: + d.err = errors.New("lzw: unknown order") + return d + } + if litWidth < 2 || 8 < litWidth { + d.err = fmt.Errorf("lzw: litWidth %d out of range", litWidth) + return d + } + if br, ok := r.(io.ByteReader); ok { + d.r = br + } else { + d.r = bufio.NewReader(r) + } + d.litWidth = litWidth + d.width = 1 + uint(litWidth) + d.clear = uint16(1) << uint(litWidth) + d.eof, d.hi = d.clear+1, d.clear+1 + d.overflow = uint16(1) << d.width + d.last = decoderInvalidCode + + return d +} diff --git a/src/compress/lzw/reader_test.go b/src/compress/lzw/reader_test.go new file mode 100644 index 0000000000000000000000000000000000000000..c3a5c3a0aaacdf3bfce7fbbf111786cb9310e98a --- /dev/null +++ b/src/compress/lzw/reader_test.go @@ -0,0 +1,159 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package lzw + +import ( + "bytes" + "io" + "io/ioutil" + "runtime" + "strconv" + "strings" + "testing" +) + +type lzwTest struct { + desc string + raw string + compressed string + err error +} + +var lzwTests = []lzwTest{ + { + "empty;LSB;8", + "", + "\x01\x01", + nil, + }, + { + "empty;MSB;8", + "", + "\x80\x80", + nil, + }, + { + "tobe;LSB;7", + "TOBEORNOTTOBEORTOBEORNOT", + "\x54\x4f\x42\x45\x4f\x52\x4e\x4f\x54\x82\x84\x86\x8b\x85\x87\x89\x81", + nil, + }, + { + "tobe;LSB;8", + "TOBEORNOTTOBEORTOBEORNOT", + "\x54\x9e\x08\x29\xf2\x44\x8a\x93\x27\x54\x04\x12\x34\xb8\xb0\xe0\xc1\x84\x01\x01", + nil, + }, + { + "tobe;MSB;7", + "TOBEORNOTTOBEORTOBEORNOT", + "\x54\x4f\x42\x45\x4f\x52\x4e\x4f\x54\x82\x84\x86\x8b\x85\x87\x89\x81", + nil, + }, + { + "tobe;MSB;8", + "TOBEORNOTTOBEORTOBEORNOT", + "\x2a\x13\xc8\x44\x52\x79\x48\x9c\x4f\x2a\x40\xa0\x90\x68\x5c\x16\x0f\x09\x80\x80", + nil, + }, + { + "tobe-truncated;LSB;8", + "TOBEORNOTTOBEORTOBEORNOT", + "\x54\x9e\x08\x29\xf2\x44\x8a\x93\x27\x54\x04", + io.ErrUnexpectedEOF, + }, + // This example comes from http://en.wikipedia.org/wiki/Graphics_Interchange_Format. + { + "gif;LSB;8", + "\x28\xff\xff\xff\x28\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff", + "\x00\x51\xfc\x1b\x28\x70\xa0\xc1\x83\x01\x01", + nil, + }, + // This example comes from http://compgroups.net/comp.lang.ruby/Decompressing-LZW-compression-from-PDF-file + { + "pdf;MSB;8", + "-----A---B", + "\x80\x0b\x60\x50\x22\x0c\x0c\x85\x01", + nil, + }, +} + +func TestReader(t *testing.T) { + var b bytes.Buffer + for _, tt := range lzwTests { + d := strings.Split(tt.desc, ";") + var order Order + switch d[1] { + case "LSB": + order = LSB + case "MSB": + order = MSB + default: + t.Errorf("%s: bad order %q", tt.desc, d[1]) + } + litWidth, _ := strconv.Atoi(d[2]) + rc := NewReader(strings.NewReader(tt.compressed), order, litWidth) + defer rc.Close() + b.Reset() + n, err := io.Copy(&b, rc) + s := b.String() + if err != nil { + if err != tt.err { + t.Errorf("%s: io.Copy: %v want %v", tt.desc, err, tt.err) + } + if err == io.ErrUnexpectedEOF { + // Even if the input is truncated, we should still return the + // partial decoded result. + if n == 0 || !strings.HasPrefix(tt.raw, s) { + t.Errorf("got %d bytes (%q), want a non-empty prefix of %q", n, s, tt.raw) + } + } + continue + } + if s != tt.raw { + t.Errorf("%s: got %d-byte %q want %d-byte %q", tt.desc, n, s, len(tt.raw), tt.raw) + } + } +} + +func benchmarkDecoder(b *testing.B, n int) { + b.StopTimer() + b.SetBytes(int64(n)) + buf0, err := ioutil.ReadFile("../testdata/e.txt") + if err != nil { + b.Fatal(err) + } + if len(buf0) == 0 { + b.Fatalf("test file has no data") + } + compressed := new(bytes.Buffer) + w := NewWriter(compressed, LSB, 8) + for i := 0; i < n; i += len(buf0) { + if len(buf0) > n-i { + buf0 = buf0[:n-i] + } + w.Write(buf0) + } + w.Close() + buf1 := compressed.Bytes() + buf0, compressed, w = nil, nil, nil + runtime.GC() + b.StartTimer() + for i := 0; i < b.N; i++ { + io.Copy(ioutil.Discard, NewReader(bytes.NewReader(buf1), LSB, 8)) + } +} + +func BenchmarkDecoder1e4(b *testing.B) { + benchmarkDecoder(b, 1e4) +} + +func BenchmarkDecoder1e5(b *testing.B) { + benchmarkDecoder(b, 1e5) +} + +func BenchmarkDecoder1e6(b *testing.B) { + benchmarkDecoder(b, 1e6) +} diff --git a/src/compress/lzw/writer.go b/src/compress/lzw/writer.go new file mode 100644 index 0000000000000000000000000000000000000000..7367c29651d772b6a6f5eeba0ba0af5ac1959d57 --- /dev/null +++ b/src/compress/lzw/writer.go @@ -0,0 +1,269 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package lzw + +import ( + "bufio" + "errors" + "fmt" + "io" +) + +// A writer is a buffered, flushable writer. +type writer interface { + io.ByteWriter + Flush() error +} + +// An errWriteCloser is an io.WriteCloser that always returns a given error. +type errWriteCloser struct { + err error +} + +func (e *errWriteCloser) Write([]byte) (int, error) { + return 0, e.err +} + +func (e *errWriteCloser) Close() error { + return e.err +} + +const ( + // A code is a 12 bit value, stored as a uint32 when encoding to avoid + // type conversions when shifting bits. + maxCode = 1<<12 - 1 + invalidCode = 1<<32 - 1 + // There are 1<<12 possible codes, which is an upper bound on the number of + // valid hash table entries at any given point in time. tableSize is 4x that. + tableSize = 4 * 1 << 12 + tableMask = tableSize - 1 + // A hash table entry is a uint32. Zero is an invalid entry since the + // lower 12 bits of a valid entry must be a non-literal code. + invalidEntry = 0 +) + +// encoder is LZW compressor. +type encoder struct { + // w is the writer that compressed bytes are written to. + w writer + // order, write, bits, nBits and width are the state for + // converting a code stream into a byte stream. + order Order + write func(*encoder, uint32) error + bits uint32 + nBits uint + width uint + // litWidth is the width in bits of literal codes. + litWidth uint + // hi is the code implied by the next code emission. + // overflow is the code at which hi overflows the code width. + hi, overflow uint32 + // savedCode is the accumulated code at the end of the most recent Write + // call. It is equal to invalidCode if there was no such call. + savedCode uint32 + // err is the first error encountered during writing. Closing the encoder + // will make any future Write calls return errClosed + err error + // table is the hash table from 20-bit keys to 12-bit values. Each table + // entry contains key<<12|val and collisions resolve by linear probing. + // The keys consist of a 12-bit code prefix and an 8-bit byte suffix. + // The values are a 12-bit code. + table [tableSize]uint32 +} + +// writeLSB writes the code c for "Least Significant Bits first" data. +func (e *encoder) writeLSB(c uint32) error { + e.bits |= c << e.nBits + e.nBits += e.width + for e.nBits >= 8 { + if err := e.w.WriteByte(uint8(e.bits)); err != nil { + return err + } + e.bits >>= 8 + e.nBits -= 8 + } + return nil +} + +// writeMSB writes the code c for "Most Significant Bits first" data. +func (e *encoder) writeMSB(c uint32) error { + e.bits |= c << (32 - e.width - e.nBits) + e.nBits += e.width + for e.nBits >= 8 { + if err := e.w.WriteByte(uint8(e.bits >> 24)); err != nil { + return err + } + e.bits <<= 8 + e.nBits -= 8 + } + return nil +} + +// errOutOfCodes is an internal error that means that the encoder has run out +// of unused codes and a clear code needs to be sent next. +var errOutOfCodes = errors.New("lzw: out of codes") + +// incHi increments e.hi and checks for both overflow and running out of +// unused codes. In the latter case, incHi sends a clear code, resets the +// encoder state and returns errOutOfCodes. +func (e *encoder) incHi() error { + e.hi++ + if e.hi == e.overflow { + e.width++ + e.overflow <<= 1 + } + if e.hi == maxCode { + clear := uint32(1) << e.litWidth + if err := e.write(e, clear); err != nil { + return err + } + e.width = uint(e.litWidth) + 1 + e.hi = clear + 1 + e.overflow = clear << 1 + for i := range e.table { + e.table[i] = invalidEntry + } + return errOutOfCodes + } + return nil +} + +// Write writes a compressed representation of p to e's underlying writer. +func (e *encoder) Write(p []byte) (n int, err error) { + if e.err != nil { + return 0, e.err + } + if len(p) == 0 { + return 0, nil + } + if maxLit := uint8(1< maxLit { + e.err = errors.New("lzw: input byte too large for the litWidth") + return 0, e.err + } + } + } + n = len(p) + code := e.savedCode + if code == invalidCode { + // The first code sent is always a literal code. + code, p = uint32(p[0]), p[1:] + } +loop: + for _, x := range p { + literal := uint32(x) + key := code<<8 | literal + // If there is a hash table hit for this key then we continue the loop + // and do not emit a code yet. + hash := (key>>12 ^ key) & tableMask + for h, t := hash, e.table[hash]; t != invalidEntry; { + if key == t>>12 { + code = t & maxCode + continue loop + } + h = (h + 1) & tableMask + t = e.table[h] + } + // Otherwise, write the current code, and literal becomes the start of + // the next emitted code. + if e.err = e.write(e, code); e.err != nil { + return 0, e.err + } + code = literal + // Increment e.hi, the next implied code. If we run out of codes, reset + // the encoder state (including clearing the hash table) and continue. + if err1 := e.incHi(); err1 != nil { + if err1 == errOutOfCodes { + continue + } + e.err = err1 + return 0, e.err + } + // Otherwise, insert key -> e.hi into the map that e.table represents. + for { + if e.table[hash] == invalidEntry { + e.table[hash] = (key << 12) | e.hi + break + } + hash = (hash + 1) & tableMask + } + } + e.savedCode = code + return n, nil +} + +// Close closes the encoder, flushing any pending output. It does not close or +// flush e's underlying writer. +func (e *encoder) Close() error { + if e.err != nil { + if e.err == errClosed { + return nil + } + return e.err + } + // Make any future calls to Write return errClosed. + e.err = errClosed + // Write the savedCode if valid. + if e.savedCode != invalidCode { + if err := e.write(e, e.savedCode); err != nil { + return err + } + if err := e.incHi(); err != nil && err != errOutOfCodes { + return err + } + } + // Write the eof code. + eof := uint32(1)< 0 { + if e.order == MSB { + e.bits >>= 24 + } + if err := e.w.WriteByte(uint8(e.bits)); err != nil { + return err + } + } + return e.w.Flush() +} + +// NewWriter creates a new io.WriteCloser. +// Writes to the returned io.WriteCloser are compressed and written to w. +// It is the caller's responsibility to call Close on the WriteCloser when +// finished writing. +// The number of bits to use for literal codes, litWidth, must be in the +// range [2,8] and is typically 8. Input bytes must be less than 1<= 1<<2: got nil error, want non-nil") + } +} + +func benchmarkEncoder(b *testing.B, n int) { + b.StopTimer() + b.SetBytes(int64(n)) + buf0, err := ioutil.ReadFile("../testdata/e.txt") + if err != nil { + b.Fatal(err) + } + if len(buf0) == 0 { + b.Fatalf("test file has no data") + } + buf1 := make([]byte, n) + for i := 0; i < n; i += len(buf0) { + if len(buf0) > n-i { + buf0 = buf0[:n-i] + } + copy(buf1[i:], buf0) + } + buf0 = nil + runtime.GC() + b.StartTimer() + for i := 0; i < b.N; i++ { + w := NewWriter(ioutil.Discard, LSB, 8) + w.Write(buf1) + w.Close() + } +} + +func BenchmarkEncoder1e4(b *testing.B) { + benchmarkEncoder(b, 1e4) +} + +func BenchmarkEncoder1e5(b *testing.B) { + benchmarkEncoder(b, 1e5) +} + +func BenchmarkEncoder1e6(b *testing.B) { + benchmarkEncoder(b, 1e6) +} diff --git a/src/compress/testdata/Mark.Twain-Tom.Sawyer.txt b/src/compress/testdata/Mark.Twain-Tom.Sawyer.txt new file mode 100644 index 0000000000000000000000000000000000000000..c97da7eccf34b333e95a02fa256ba2f4413e03ba --- /dev/null +++ b/src/compress/testdata/Mark.Twain-Tom.Sawyer.txt @@ -0,0 +1,8858 @@ +The Project Gutenberg EBook of The Adventures of Tom Sawyer, Complete +by Mark Twain (Samuel Clemens) + +This eBook is for the use of anyone anywhere at no cost and with +almost no restrictions whatsoever. You may copy it, give it away or +re-use it under the terms of the Project Gutenberg License included +with this eBook or online at www.gutenberg.net + + +Title: The Adventures of Tom Sawyer, Complete + +Author: Mark Twain (Samuel Clemens) + +Release Date: August 20, 2006 [EBook #74] +[Last updated: May 3, 2011] + +Language: English + + +*** START OF THIS PROJECT GUTENBERG EBOOK TOM SAWYER *** + + + + +Produced by David Widger. The previous edition was updated by Jose +Menendez. + + + + + + THE ADVENTURES OF TOM SAWYER + BY + MARK TWAIN + (Samuel Langhorne Clemens) + + + + + P R E F A C E + +MOST of the adventures recorded in this book really occurred; one or +two were experiences of my own, the rest those of boys who were +schoolmates of mine. Huck Finn is drawn from life; Tom Sawyer also, but +not from an individual--he is a combination of the characteristics of +three boys whom I knew, and therefore belongs to the composite order of +architecture. + +The odd superstitions touched upon were all prevalent among children +and slaves in the West at the period of this story--that is to say, +thirty or forty years ago. + +Although my book is intended mainly for the entertainment of boys and +girls, I hope it will not be shunned by men and women on that account, +for part of my plan has been to try to pleasantly remind adults of what +they once were themselves, and of how they felt and thought and talked, +and what queer enterprises they sometimes engaged in. + + THE AUTHOR. + +HARTFORD, 1876. + + + + T O M S A W Y E R + + + +CHAPTER I + +"TOM!" + +No answer. + +"TOM!" + +No answer. + +"What's gone with that boy, I wonder? You TOM!" + +No answer. + +The old lady pulled her spectacles down and looked over them about the +room; then she put them up and looked out under them. She seldom or +never looked THROUGH them for so small a thing as a boy; they were her +state pair, the pride of her heart, and were built for "style," not +service--she could have seen through a pair of stove-lids just as well. +She looked perplexed for a moment, and then said, not fiercely, but +still loud enough for the furniture to hear: + +"Well, I lay if I get hold of you I'll--" + +She did not finish, for by this time she was bending down and punching +under the bed with the broom, and so she needed breath to punctuate the +punches with. She resurrected nothing but the cat. + +"I never did see the beat of that boy!" + +She went to the open door and stood in it and looked out among the +tomato vines and "jimpson" weeds that constituted the garden. No Tom. +So she lifted up her voice at an angle calculated for distance and +shouted: + +"Y-o-u-u TOM!" + +There was a slight noise behind her and she turned just in time to +seize a small boy by the slack of his roundabout and arrest his flight. + +"There! I might 'a' thought of that closet. What you been doing in +there?" + +"Nothing." + +"Nothing! Look at your hands. And look at your mouth. What IS that +truck?" + +"I don't know, aunt." + +"Well, I know. It's jam--that's what it is. Forty times I've said if +you didn't let that jam alone I'd skin you. Hand me that switch." + +The switch hovered in the air--the peril was desperate-- + +"My! Look behind you, aunt!" + +The old lady whirled round, and snatched her skirts out of danger. The +lad fled on the instant, scrambled up the high board-fence, and +disappeared over it. + +His aunt Polly stood surprised a moment, and then broke into a gentle +laugh. + +"Hang the boy, can't I never learn anything? Ain't he played me tricks +enough like that for me to be looking out for him by this time? But old +fools is the biggest fools there is. Can't learn an old dog new tricks, +as the saying is. But my goodness, he never plays them alike, two days, +and how is a body to know what's coming? He 'pears to know just how +long he can torment me before I get my dander up, and he knows if he +can make out to put me off for a minute or make me laugh, it's all down +again and I can't hit him a lick. I ain't doing my duty by that boy, +and that's the Lord's truth, goodness knows. Spare the rod and spile +the child, as the Good Book says. I'm a laying up sin and suffering for +us both, I know. He's full of the Old Scratch, but laws-a-me! he's my +own dead sister's boy, poor thing, and I ain't got the heart to lash +him, somehow. Every time I let him off, my conscience does hurt me so, +and every time I hit him my old heart most breaks. Well-a-well, man +that is born of woman is of few days and full of trouble, as the +Scripture says, and I reckon it's so. He'll play hookey this evening, * +and [* Southwestern for "afternoon"] I'll just be obleeged to make him +work, to-morrow, to punish him. It's mighty hard to make him work +Saturdays, when all the boys is having holiday, but he hates work more +than he hates anything else, and I've GOT to do some of my duty by him, +or I'll be the ruination of the child." + +Tom did play hookey, and he had a very good time. He got back home +barely in season to help Jim, the small colored boy, saw next-day's +wood and split the kindlings before supper--at least he was there in +time to tell his adventures to Jim while Jim did three-fourths of the +work. Tom's younger brother (or rather half-brother) Sid was already +through with his part of the work (picking up chips), for he was a +quiet boy, and had no adventurous, troublesome ways. + +While Tom was eating his supper, and stealing sugar as opportunity +offered, Aunt Polly asked him questions that were full of guile, and +very deep--for she wanted to trap him into damaging revealments. Like +many other simple-hearted souls, it was her pet vanity to believe she +was endowed with a talent for dark and mysterious diplomacy, and she +loved to contemplate her most transparent devices as marvels of low +cunning. Said she: + +"Tom, it was middling warm in school, warn't it?" + +"Yes'm." + +"Powerful warm, warn't it?" + +"Yes'm." + +"Didn't you want to go in a-swimming, Tom?" + +A bit of a scare shot through Tom--a touch of uncomfortable suspicion. +He searched Aunt Polly's face, but it told him nothing. So he said: + +"No'm--well, not very much." + +The old lady reached out her hand and felt Tom's shirt, and said: + +"But you ain't too warm now, though." And it flattered her to reflect +that she had discovered that the shirt was dry without anybody knowing +that that was what she had in her mind. But in spite of her, Tom knew +where the wind lay, now. So he forestalled what might be the next move: + +"Some of us pumped on our heads--mine's damp yet. See?" + +Aunt Polly was vexed to think she had overlooked that bit of +circumstantial evidence, and missed a trick. Then she had a new +inspiration: + +"Tom, you didn't have to undo your shirt collar where I sewed it, to +pump on your head, did you? Unbutton your jacket!" + +The trouble vanished out of Tom's face. He opened his jacket. His +shirt collar was securely sewed. + +"Bother! Well, go 'long with you. I'd made sure you'd played hookey +and been a-swimming. But I forgive ye, Tom. I reckon you're a kind of a +singed cat, as the saying is--better'n you look. THIS time." + +She was half sorry her sagacity had miscarried, and half glad that Tom +had stumbled into obedient conduct for once. + +But Sidney said: + +"Well, now, if I didn't think you sewed his collar with white thread, +but it's black." + +"Why, I did sew it with white! Tom!" + +But Tom did not wait for the rest. As he went out at the door he said: + +"Siddy, I'll lick you for that." + +In a safe place Tom examined two large needles which were thrust into +the lapels of his jacket, and had thread bound about them--one needle +carried white thread and the other black. He said: + +"She'd never noticed if it hadn't been for Sid. Confound it! sometimes +she sews it with white, and sometimes she sews it with black. I wish to +geeminy she'd stick to one or t'other--I can't keep the run of 'em. But +I bet you I'll lam Sid for that. I'll learn him!" + +He was not the Model Boy of the village. He knew the model boy very +well though--and loathed him. + +Within two minutes, or even less, he had forgotten all his troubles. +Not because his troubles were one whit less heavy and bitter to him +than a man's are to a man, but because a new and powerful interest bore +them down and drove them out of his mind for the time--just as men's +misfortunes are forgotten in the excitement of new enterprises. This +new interest was a valued novelty in whistling, which he had just +acquired from a negro, and he was suffering to practise it undisturbed. +It consisted in a peculiar bird-like turn, a sort of liquid warble, +produced by touching the tongue to the roof of the mouth at short +intervals in the midst of the music--the reader probably remembers how +to do it, if he has ever been a boy. Diligence and attention soon gave +him the knack of it, and he strode down the street with his mouth full +of harmony and his soul full of gratitude. He felt much as an +astronomer feels who has discovered a new planet--no doubt, as far as +strong, deep, unalloyed pleasure is concerned, the advantage was with +the boy, not the astronomer. + +The summer evenings were long. It was not dark, yet. Presently Tom +checked his whistle. A stranger was before him--a boy a shade larger +than himself. A new-comer of any age or either sex was an impressive +curiosity in the poor little shabby village of St. Petersburg. This boy +was well dressed, too--well dressed on a week-day. This was simply +astounding. His cap was a dainty thing, his close-buttoned blue cloth +roundabout was new and natty, and so were his pantaloons. He had shoes +on--and it was only Friday. He even wore a necktie, a bright bit of +ribbon. He had a citified air about him that ate into Tom's vitals. The +more Tom stared at the splendid marvel, the higher he turned up his +nose at his finery and the shabbier and shabbier his own outfit seemed +to him to grow. Neither boy spoke. If one moved, the other moved--but +only sidewise, in a circle; they kept face to face and eye to eye all +the time. Finally Tom said: + +"I can lick you!" + +"I'd like to see you try it." + +"Well, I can do it." + +"No you can't, either." + +"Yes I can." + +"No you can't." + +"I can." + +"You can't." + +"Can!" + +"Can't!" + +An uncomfortable pause. Then Tom said: + +"What's your name?" + +"'Tisn't any of your business, maybe." + +"Well I 'low I'll MAKE it my business." + +"Well why don't you?" + +"If you say much, I will." + +"Much--much--MUCH. There now." + +"Oh, you think you're mighty smart, DON'T you? I could lick you with +one hand tied behind me, if I wanted to." + +"Well why don't you DO it? You SAY you can do it." + +"Well I WILL, if you fool with me." + +"Oh yes--I've seen whole families in the same fix." + +"Smarty! You think you're SOME, now, DON'T you? Oh, what a hat!" + +"You can lump that hat if you don't like it. I dare you to knock it +off--and anybody that'll take a dare will suck eggs." + +"You're a liar!" + +"You're another." + +"You're a fighting liar and dasn't take it up." + +"Aw--take a walk!" + +"Say--if you give me much more of your sass I'll take and bounce a +rock off'n your head." + +"Oh, of COURSE you will." + +"Well I WILL." + +"Well why don't you DO it then? What do you keep SAYING you will for? +Why don't you DO it? It's because you're afraid." + +"I AIN'T afraid." + +"You are." + +"I ain't." + +"You are." + +Another pause, and more eying and sidling around each other. Presently +they were shoulder to shoulder. Tom said: + +"Get away from here!" + +"Go away yourself!" + +"I won't." + +"I won't either." + +So they stood, each with a foot placed at an angle as a brace, and +both shoving with might and main, and glowering at each other with +hate. But neither could get an advantage. After struggling till both +were hot and flushed, each relaxed his strain with watchful caution, +and Tom said: + +"You're a coward and a pup. I'll tell my big brother on you, and he +can thrash you with his little finger, and I'll make him do it, too." + +"What do I care for your big brother? I've got a brother that's bigger +than he is--and what's more, he can throw him over that fence, too." +[Both brothers were imaginary.] + +"That's a lie." + +"YOUR saying so don't make it so." + +Tom drew a line in the dust with his big toe, and said: + +"I dare you to step over that, and I'll lick you till you can't stand +up. Anybody that'll take a dare will steal sheep." + +The new boy stepped over promptly, and said: + +"Now you said you'd do it, now let's see you do it." + +"Don't you crowd me now; you better look out." + +"Well, you SAID you'd do it--why don't you do it?" + +"By jingo! for two cents I WILL do it." + +The new boy took two broad coppers out of his pocket and held them out +with derision. Tom struck them to the ground. In an instant both boys +were rolling and tumbling in the dirt, gripped together like cats; and +for the space of a minute they tugged and tore at each other's hair and +clothes, punched and scratched each other's nose, and covered +themselves with dust and glory. Presently the confusion took form, and +through the fog of battle Tom appeared, seated astride the new boy, and +pounding him with his fists. "Holler 'nuff!" said he. + +The boy only struggled to free himself. He was crying--mainly from rage. + +"Holler 'nuff!"--and the pounding went on. + +At last the stranger got out a smothered "'Nuff!" and Tom let him up +and said: + +"Now that'll learn you. Better look out who you're fooling with next +time." + +The new boy went off brushing the dust from his clothes, sobbing, +snuffling, and occasionally looking back and shaking his head and +threatening what he would do to Tom the "next time he caught him out." +To which Tom responded with jeers, and started off in high feather, and +as soon as his back was turned the new boy snatched up a stone, threw +it and hit him between the shoulders and then turned tail and ran like +an antelope. Tom chased the traitor home, and thus found out where he +lived. He then held a position at the gate for some time, daring the +enemy to come outside, but the enemy only made faces at him through the +window and declined. At last the enemy's mother appeared, and called +Tom a bad, vicious, vulgar child, and ordered him away. So he went +away; but he said he "'lowed" to "lay" for that boy. + +He got home pretty late that night, and when he climbed cautiously in +at the window, he uncovered an ambuscade, in the person of his aunt; +and when she saw the state his clothes were in her resolution to turn +his Saturday holiday into captivity at hard labor became adamantine in +its firmness. + + + +CHAPTER II + +SATURDAY morning was come, and all the summer world was bright and +fresh, and brimming with life. There was a song in every heart; and if +the heart was young the music issued at the lips. There was cheer in +every face and a spring in every step. The locust-trees were in bloom +and the fragrance of the blossoms filled the air. Cardiff Hill, beyond +the village and above it, was green with vegetation and it lay just far +enough away to seem a Delectable Land, dreamy, reposeful, and inviting. + +Tom appeared on the sidewalk with a bucket of whitewash and a +long-handled brush. He surveyed the fence, and all gladness left him and +a deep melancholy settled down upon his spirit. Thirty yards of board +fence nine feet high. Life to him seemed hollow, and existence but a +burden. Sighing, he dipped his brush and passed it along the topmost +plank; repeated the operation; did it again; compared the insignificant +whitewashed streak with the far-reaching continent of unwhitewashed +fence, and sat down on a tree-box discouraged. Jim came skipping out at +the gate with a tin pail, and singing Buffalo Gals. Bringing water from +the town pump had always been hateful work in Tom's eyes, before, but +now it did not strike him so. He remembered that there was company at +the pump. White, mulatto, and negro boys and girls were always there +waiting their turns, resting, trading playthings, quarrelling, +fighting, skylarking. And he remembered that although the pump was only +a hundred and fifty yards off, Jim never got back with a bucket of +water under an hour--and even then somebody generally had to go after +him. Tom said: + +"Say, Jim, I'll fetch the water if you'll whitewash some." + +Jim shook his head and said: + +"Can't, Mars Tom. Ole missis, she tole me I got to go an' git dis +water an' not stop foolin' roun' wid anybody. She say she spec' Mars +Tom gwine to ax me to whitewash, an' so she tole me go 'long an' 'tend +to my own business--she 'lowed SHE'D 'tend to de whitewashin'." + +"Oh, never you mind what she said, Jim. That's the way she always +talks. Gimme the bucket--I won't be gone only a a minute. SHE won't +ever know." + +"Oh, I dasn't, Mars Tom. Ole missis she'd take an' tar de head off'n +me. 'Deed she would." + +"SHE! She never licks anybody--whacks 'em over the head with her +thimble--and who cares for that, I'd like to know. She talks awful, but +talk don't hurt--anyways it don't if she don't cry. Jim, I'll give you +a marvel. I'll give you a white alley!" + +Jim began to waver. + +"White alley, Jim! And it's a bully taw." + +"My! Dat's a mighty gay marvel, I tell you! But Mars Tom I's powerful +'fraid ole missis--" + +"And besides, if you will I'll show you my sore toe." + +Jim was only human--this attraction was too much for him. He put down +his pail, took the white alley, and bent over the toe with absorbing +interest while the bandage was being unwound. In another moment he was +flying down the street with his pail and a tingling rear, Tom was +whitewashing with vigor, and Aunt Polly was retiring from the field +with a slipper in her hand and triumph in her eye. + +But Tom's energy did not last. He began to think of the fun he had +planned for this day, and his sorrows multiplied. Soon the free boys +would come tripping along on all sorts of delicious expeditions, and +they would make a world of fun of him for having to work--the very +thought of it burnt him like fire. He got out his worldly wealth and +examined it--bits of toys, marbles, and trash; enough to buy an +exchange of WORK, maybe, but not half enough to buy so much as half an +hour of pure freedom. So he returned his straitened means to his +pocket, and gave up the idea of trying to buy the boys. At this dark +and hopeless moment an inspiration burst upon him! Nothing less than a +great, magnificent inspiration. + +He took up his brush and went tranquilly to work. Ben Rogers hove in +sight presently--the very boy, of all boys, whose ridicule he had been +dreading. Ben's gait was the hop-skip-and-jump--proof enough that his +heart was light and his anticipations high. He was eating an apple, and +giving a long, melodious whoop, at intervals, followed by a deep-toned +ding-dong-dong, ding-dong-dong, for he was personating a steamboat. As +he drew near, he slackened speed, took the middle of the street, leaned +far over to starboard and rounded to ponderously and with laborious +pomp and circumstance--for he was personating the Big Missouri, and +considered himself to be drawing nine feet of water. He was boat and +captain and engine-bells combined, so he had to imagine himself +standing on his own hurricane-deck giving the orders and executing them: + +"Stop her, sir! Ting-a-ling-ling!" The headway ran almost out, and he +drew up slowly toward the sidewalk. + +"Ship up to back! Ting-a-ling-ling!" His arms straightened and +stiffened down his sides. + +"Set her back on the stabboard! Ting-a-ling-ling! Chow! ch-chow-wow! +Chow!" His right hand, meantime, describing stately circles--for it was +representing a forty-foot wheel. + +"Let her go back on the labboard! Ting-a-lingling! Chow-ch-chow-chow!" +The left hand began to describe circles. + +"Stop the stabboard! Ting-a-ling-ling! Stop the labboard! Come ahead +on the stabboard! Stop her! Let your outside turn over slow! +Ting-a-ling-ling! Chow-ow-ow! Get out that head-line! LIVELY now! +Come--out with your spring-line--what're you about there! Take a turn +round that stump with the bight of it! Stand by that stage, now--let her +go! Done with the engines, sir! Ting-a-ling-ling! SH'T! S'H'T! SH'T!" +(trying the gauge-cocks). + +Tom went on whitewashing--paid no attention to the steamboat. Ben +stared a moment and then said: "Hi-YI! YOU'RE up a stump, ain't you!" + +No answer. Tom surveyed his last touch with the eye of an artist, then +he gave his brush another gentle sweep and surveyed the result, as +before. Ben ranged up alongside of him. Tom's mouth watered for the +apple, but he stuck to his work. Ben said: + +"Hello, old chap, you got to work, hey?" + +Tom wheeled suddenly and said: + +"Why, it's you, Ben! I warn't noticing." + +"Say--I'm going in a-swimming, I am. Don't you wish you could? But of +course you'd druther WORK--wouldn't you? Course you would!" + +Tom contemplated the boy a bit, and said: + +"What do you call work?" + +"Why, ain't THAT work?" + +Tom resumed his whitewashing, and answered carelessly: + +"Well, maybe it is, and maybe it ain't. All I know, is, it suits Tom +Sawyer." + +"Oh come, now, you don't mean to let on that you LIKE it?" + +The brush continued to move. + +"Like it? Well, I don't see why I oughtn't to like it. Does a boy get +a chance to whitewash a fence every day?" + +That put the thing in a new light. Ben stopped nibbling his apple. Tom +swept his brush daintily back and forth--stepped back to note the +effect--added a touch here and there--criticised the effect again--Ben +watching every move and getting more and more interested, more and more +absorbed. Presently he said: + +"Say, Tom, let ME whitewash a little." + +Tom considered, was about to consent; but he altered his mind: + +"No--no--I reckon it wouldn't hardly do, Ben. You see, Aunt Polly's +awful particular about this fence--right here on the street, you know +--but if it was the back fence I wouldn't mind and SHE wouldn't. Yes, +she's awful particular about this fence; it's got to be done very +careful; I reckon there ain't one boy in a thousand, maybe two +thousand, that can do it the way it's got to be done." + +"No--is that so? Oh come, now--lemme just try. Only just a little--I'd +let YOU, if you was me, Tom." + +"Ben, I'd like to, honest injun; but Aunt Polly--well, Jim wanted to +do it, but she wouldn't let him; Sid wanted to do it, and she wouldn't +let Sid. Now don't you see how I'm fixed? If you was to tackle this +fence and anything was to happen to it--" + +"Oh, shucks, I'll be just as careful. Now lemme try. Say--I'll give +you the core of my apple." + +"Well, here--No, Ben, now don't. I'm afeard--" + +"I'll give you ALL of it!" + +Tom gave up the brush with reluctance in his face, but alacrity in his +heart. And while the late steamer Big Missouri worked and sweated in +the sun, the retired artist sat on a barrel in the shade close by, +dangled his legs, munched his apple, and planned the slaughter of more +innocents. There was no lack of material; boys happened along every +little while; they came to jeer, but remained to whitewash. By the time +Ben was fagged out, Tom had traded the next chance to Billy Fisher for +a kite, in good repair; and when he played out, Johnny Miller bought in +for a dead rat and a string to swing it with--and so on, and so on, +hour after hour. And when the middle of the afternoon came, from being +a poor poverty-stricken boy in the morning, Tom was literally rolling +in wealth. He had besides the things before mentioned, twelve marbles, +part of a jews-harp, a piece of blue bottle-glass to look through, a +spool cannon, a key that wouldn't unlock anything, a fragment of chalk, +a glass stopper of a decanter, a tin soldier, a couple of tadpoles, six +fire-crackers, a kitten with only one eye, a brass doorknob, a +dog-collar--but no dog--the handle of a knife, four pieces of +orange-peel, and a dilapidated old window sash. + +He had had a nice, good, idle time all the while--plenty of company +--and the fence had three coats of whitewash on it! If he hadn't run out +of whitewash he would have bankrupted every boy in the village. + +Tom said to himself that it was not such a hollow world, after all. He +had discovered a great law of human action, without knowing it--namely, +that in order to make a man or a boy covet a thing, it is only +necessary to make the thing difficult to attain. If he had been a great +and wise philosopher, like the writer of this book, he would now have +comprehended that Work consists of whatever a body is OBLIGED to do, +and that Play consists of whatever a body is not obliged to do. And +this would help him to understand why constructing artificial flowers +or performing on a tread-mill is work, while rolling ten-pins or +climbing Mont Blanc is only amusement. There are wealthy gentlemen in +England who drive four-horse passenger-coaches twenty or thirty miles +on a daily line, in the summer, because the privilege costs them +considerable money; but if they were offered wages for the service, +that would turn it into work and then they would resign. + +The boy mused awhile over the substantial change which had taken place +in his worldly circumstances, and then wended toward headquarters to +report. + + + +CHAPTER III + +TOM presented himself before Aunt Polly, who was sitting by an open +window in a pleasant rearward apartment, which was bedroom, +breakfast-room, dining-room, and library, combined. The balmy summer +air, the restful quiet, the odor of the flowers, and the drowsing murmur +of the bees had had their effect, and she was nodding over her knitting +--for she had no company but the cat, and it was asleep in her lap. Her +spectacles were propped up on her gray head for safety. She had thought +that of course Tom had deserted long ago, and she wondered at seeing him +place himself in her power again in this intrepid way. He said: "Mayn't +I go and play now, aunt?" + +"What, a'ready? How much have you done?" + +"It's all done, aunt." + +"Tom, don't lie to me--I can't bear it." + +"I ain't, aunt; it IS all done." + +Aunt Polly placed small trust in such evidence. She went out to see +for herself; and she would have been content to find twenty per cent. +of Tom's statement true. When she found the entire fence whitewashed, +and not only whitewashed but elaborately coated and recoated, and even +a streak added to the ground, her astonishment was almost unspeakable. +She said: + +"Well, I never! There's no getting round it, you can work when you're +a mind to, Tom." And then she diluted the compliment by adding, "But +it's powerful seldom you're a mind to, I'm bound to say. Well, go 'long +and play; but mind you get back some time in a week, or I'll tan you." + +She was so overcome by the splendor of his achievement that she took +him into the closet and selected a choice apple and delivered it to +him, along with an improving lecture upon the added value and flavor a +treat took to itself when it came without sin through virtuous effort. +And while she closed with a happy Scriptural flourish, he "hooked" a +doughnut. + +Then he skipped out, and saw Sid just starting up the outside stairway +that led to the back rooms on the second floor. Clods were handy and +the air was full of them in a twinkling. They raged around Sid like a +hail-storm; and before Aunt Polly could collect her surprised faculties +and sally to the rescue, six or seven clods had taken personal effect, +and Tom was over the fence and gone. There was a gate, but as a general +thing he was too crowded for time to make use of it. His soul was at +peace, now that he had settled with Sid for calling attention to his +black thread and getting him into trouble. + +Tom skirted the block, and came round into a muddy alley that led by +the back of his aunt's cow-stable. He presently got safely beyond the +reach of capture and punishment, and hastened toward the public square +of the village, where two "military" companies of boys had met for +conflict, according to previous appointment. Tom was General of one of +these armies, Joe Harper (a bosom friend) General of the other. These +two great commanders did not condescend to fight in person--that being +better suited to the still smaller fry--but sat together on an eminence +and conducted the field operations by orders delivered through +aides-de-camp. Tom's army won a great victory, after a long and +hard-fought battle. Then the dead were counted, prisoners exchanged, +the terms of the next disagreement agreed upon, and the day for the +necessary battle appointed; after which the armies fell into line and +marched away, and Tom turned homeward alone. + +As he was passing by the house where Jeff Thatcher lived, he saw a new +girl in the garden--a lovely little blue-eyed creature with yellow hair +plaited into two long-tails, white summer frock and embroidered +pantalettes. The fresh-crowned hero fell without firing a shot. A +certain Amy Lawrence vanished out of his heart and left not even a +memory of herself behind. He had thought he loved her to distraction; +he had regarded his passion as adoration; and behold it was only a poor +little evanescent partiality. He had been months winning her; she had +confessed hardly a week ago; he had been the happiest and the proudest +boy in the world only seven short days, and here in one instant of time +she had gone out of his heart like a casual stranger whose visit is +done. + +He worshipped this new angel with furtive eye, till he saw that she +had discovered him; then he pretended he did not know she was present, +and began to "show off" in all sorts of absurd boyish ways, in order to +win her admiration. He kept up this grotesque foolishness for some +time; but by-and-by, while he was in the midst of some dangerous +gymnastic performances, he glanced aside and saw that the little girl +was wending her way toward the house. Tom came up to the fence and +leaned on it, grieving, and hoping she would tarry yet awhile longer. +She halted a moment on the steps and then moved toward the door. Tom +heaved a great sigh as she put her foot on the threshold. But his face +lit up, right away, for she tossed a pansy over the fence a moment +before she disappeared. + +The boy ran around and stopped within a foot or two of the flower, and +then shaded his eyes with his hand and began to look down street as if +he had discovered something of interest going on in that direction. +Presently he picked up a straw and began trying to balance it on his +nose, with his head tilted far back; and as he moved from side to side, +in his efforts, he edged nearer and nearer toward the pansy; finally +his bare foot rested upon it, his pliant toes closed upon it, and he +hopped away with the treasure and disappeared round the corner. But +only for a minute--only while he could button the flower inside his +jacket, next his heart--or next his stomach, possibly, for he was not +much posted in anatomy, and not hypercritical, anyway. + +He returned, now, and hung about the fence till nightfall, "showing +off," as before; but the girl never exhibited herself again, though Tom +comforted himself a little with the hope that she had been near some +window, meantime, and been aware of his attentions. Finally he strode +home reluctantly, with his poor head full of visions. + +All through supper his spirits were so high that his aunt wondered +"what had got into the child." He took a good scolding about clodding +Sid, and did not seem to mind it in the least. He tried to steal sugar +under his aunt's very nose, and got his knuckles rapped for it. He said: + +"Aunt, you don't whack Sid when he takes it." + +"Well, Sid don't torment a body the way you do. You'd be always into +that sugar if I warn't watching you." + +Presently she stepped into the kitchen, and Sid, happy in his +immunity, reached for the sugar-bowl--a sort of glorying over Tom which +was wellnigh unbearable. But Sid's fingers slipped and the bowl dropped +and broke. Tom was in ecstasies. In such ecstasies that he even +controlled his tongue and was silent. He said to himself that he would +not speak a word, even when his aunt came in, but would sit perfectly +still till she asked who did the mischief; and then he would tell, and +there would be nothing so good in the world as to see that pet model +"catch it." He was so brimful of exultation that he could hardly hold +himself when the old lady came back and stood above the wreck +discharging lightnings of wrath from over her spectacles. He said to +himself, "Now it's coming!" And the next instant he was sprawling on +the floor! The potent palm was uplifted to strike again when Tom cried +out: + +"Hold on, now, what 'er you belting ME for?--Sid broke it!" + +Aunt Polly paused, perplexed, and Tom looked for healing pity. But +when she got her tongue again, she only said: + +"Umf! Well, you didn't get a lick amiss, I reckon. You been into some +other audacious mischief when I wasn't around, like enough." + +Then her conscience reproached her, and she yearned to say something +kind and loving; but she judged that this would be construed into a +confession that she had been in the wrong, and discipline forbade that. +So she kept silence, and went about her affairs with a troubled heart. +Tom sulked in a corner and exalted his woes. He knew that in her heart +his aunt was on her knees to him, and he was morosely gratified by the +consciousness of it. He would hang out no signals, he would take notice +of none. He knew that a yearning glance fell upon him, now and then, +through a film of tears, but he refused recognition of it. He pictured +himself lying sick unto death and his aunt bending over him beseeching +one little forgiving word, but he would turn his face to the wall, and +die with that word unsaid. Ah, how would she feel then? And he pictured +himself brought home from the river, dead, with his curls all wet, and +his sore heart at rest. How she would throw herself upon him, and how +her tears would fall like rain, and her lips pray God to give her back +her boy and she would never, never abuse him any more! But he would lie +there cold and white and make no sign--a poor little sufferer, whose +griefs were at an end. He so worked upon his feelings with the pathos +of these dreams, that he had to keep swallowing, he was so like to +choke; and his eyes swam in a blur of water, which overflowed when he +winked, and ran down and trickled from the end of his nose. And such a +luxury to him was this petting of his sorrows, that he could not bear +to have any worldly cheeriness or any grating delight intrude upon it; +it was too sacred for such contact; and so, presently, when his cousin +Mary danced in, all alive with the joy of seeing home again after an +age-long visit of one week to the country, he got up and moved in +clouds and darkness out at one door as she brought song and sunshine in +at the other. + +He wandered far from the accustomed haunts of boys, and sought +desolate places that were in harmony with his spirit. A log raft in the +river invited him, and he seated himself on its outer edge and +contemplated the dreary vastness of the stream, wishing, the while, +that he could only be drowned, all at once and unconsciously, without +undergoing the uncomfortable routine devised by nature. Then he thought +of his flower. He got it out, rumpled and wilted, and it mightily +increased his dismal felicity. He wondered if she would pity him if she +knew? Would she cry, and wish that she had a right to put her arms +around his neck and comfort him? Or would she turn coldly away like all +the hollow world? This picture brought such an agony of pleasurable +suffering that he worked it over and over again in his mind and set it +up in new and varied lights, till he wore it threadbare. At last he +rose up sighing and departed in the darkness. + +About half-past nine or ten o'clock he came along the deserted street +to where the Adored Unknown lived; he paused a moment; no sound fell +upon his listening ear; a candle was casting a dull glow upon the +curtain of a second-story window. Was the sacred presence there? He +climbed the fence, threaded his stealthy way through the plants, till +he stood under that window; he looked up at it long, and with emotion; +then he laid him down on the ground under it, disposing himself upon +his back, with his hands clasped upon his breast and holding his poor +wilted flower. And thus he would die--out in the cold world, with no +shelter over his homeless head, no friendly hand to wipe the +death-damps from his brow, no loving face to bend pityingly over him +when the great agony came. And thus SHE would see him when she looked +out upon the glad morning, and oh! would she drop one little tear upon +his poor, lifeless form, would she heave one little sigh to see a bright +young life so rudely blighted, so untimely cut down? + +The window went up, a maid-servant's discordant voice profaned the +holy calm, and a deluge of water drenched the prone martyr's remains! + +The strangling hero sprang up with a relieving snort. There was a whiz +as of a missile in the air, mingled with the murmur of a curse, a sound +as of shivering glass followed, and a small, vague form went over the +fence and shot away in the gloom. + +Not long after, as Tom, all undressed for bed, was surveying his +drenched garments by the light of a tallow dip, Sid woke up; but if he +had any dim idea of making any "references to allusions," he thought +better of it and held his peace, for there was danger in Tom's eye. + +Tom turned in without the added vexation of prayers, and Sid made +mental note of the omission. + + + +CHAPTER IV + +THE sun rose upon a tranquil world, and beamed down upon the peaceful +village like a benediction. Breakfast over, Aunt Polly had family +worship: it began with a prayer built from the ground up of solid +courses of Scriptural quotations, welded together with a thin mortar of +originality; and from the summit of this she delivered a grim chapter +of the Mosaic Law, as from Sinai. + +Then Tom girded up his loins, so to speak, and went to work to "get +his verses." Sid had learned his lesson days before. Tom bent all his +energies to the memorizing of five verses, and he chose part of the +Sermon on the Mount, because he could find no verses that were shorter. +At the end of half an hour Tom had a vague general idea of his lesson, +but no more, for his mind was traversing the whole field of human +thought, and his hands were busy with distracting recreations. Mary +took his book to hear him recite, and he tried to find his way through +the fog: + +"Blessed are the--a--a--" + +"Poor"-- + +"Yes--poor; blessed are the poor--a--a--" + +"In spirit--" + +"In spirit; blessed are the poor in spirit, for they--they--" + +"THEIRS--" + +"For THEIRS. Blessed are the poor in spirit, for theirs is the kingdom +of heaven. Blessed are they that mourn, for they--they--" + +"Sh--" + +"For they--a--" + +"S, H, A--" + +"For they S, H--Oh, I don't know what it is!" + +"SHALL!" + +"Oh, SHALL! for they shall--for they shall--a--a--shall mourn--a--a-- +blessed are they that shall--they that--a--they that shall mourn, for +they shall--a--shall WHAT? Why don't you tell me, Mary?--what do you +want to be so mean for?" + +"Oh, Tom, you poor thick-headed thing, I'm not teasing you. I wouldn't +do that. You must go and learn it again. Don't you be discouraged, Tom, +you'll manage it--and if you do, I'll give you something ever so nice. +There, now, that's a good boy." + +"All right! What is it, Mary, tell me what it is." + +"Never you mind, Tom. You know if I say it's nice, it is nice." + +"You bet you that's so, Mary. All right, I'll tackle it again." + +And he did "tackle it again"--and under the double pressure of +curiosity and prospective gain he did it with such spirit that he +accomplished a shining success. Mary gave him a brand-new "Barlow" +knife worth twelve and a half cents; and the convulsion of delight that +swept his system shook him to his foundations. True, the knife would +not cut anything, but it was a "sure-enough" Barlow, and there was +inconceivable grandeur in that--though where the Western boys ever got +the idea that such a weapon could possibly be counterfeited to its +injury is an imposing mystery and will always remain so, perhaps. Tom +contrived to scarify the cupboard with it, and was arranging to begin +on the bureau, when he was called off to dress for Sunday-school. + +Mary gave him a tin basin of water and a piece of soap, and he went +outside the door and set the basin on a little bench there; then he +dipped the soap in the water and laid it down; turned up his sleeves; +poured out the water on the ground, gently, and then entered the +kitchen and began to wipe his face diligently on the towel behind the +door. But Mary removed the towel and said: + +"Now ain't you ashamed, Tom. You mustn't be so bad. Water won't hurt +you." + +Tom was a trifle disconcerted. The basin was refilled, and this time +he stood over it a little while, gathering resolution; took in a big +breath and began. When he entered the kitchen presently, with both eyes +shut and groping for the towel with his hands, an honorable testimony +of suds and water was dripping from his face. But when he emerged from +the towel, he was not yet satisfactory, for the clean territory stopped +short at his chin and his jaws, like a mask; below and beyond this line +there was a dark expanse of unirrigated soil that spread downward in +front and backward around his neck. Mary took him in hand, and when she +was done with him he was a man and a brother, without distinction of +color, and his saturated hair was neatly brushed, and its short curls +wrought into a dainty and symmetrical general effect. [He privately +smoothed out the curls, with labor and difficulty, and plastered his +hair close down to his head; for he held curls to be effeminate, and +his own filled his life with bitterness.] Then Mary got out a suit of +his clothing that had been used only on Sundays during two years--they +were simply called his "other clothes"--and so by that we know the +size of his wardrobe. The girl "put him to rights" after he had dressed +himself; she buttoned his neat roundabout up to his chin, turned his +vast shirt collar down over his shoulders, brushed him off and crowned +him with his speckled straw hat. He now looked exceedingly improved and +uncomfortable. He was fully as uncomfortable as he looked; for there +was a restraint about whole clothes and cleanliness that galled him. He +hoped that Mary would forget his shoes, but the hope was blighted; she +coated them thoroughly with tallow, as was the custom, and brought them +out. He lost his temper and said he was always being made to do +everything he didn't want to do. But Mary said, persuasively: + +"Please, Tom--that's a good boy." + +So he got into the shoes snarling. Mary was soon ready, and the three +children set out for Sunday-school--a place that Tom hated with his +whole heart; but Sid and Mary were fond of it. + +Sabbath-school hours were from nine to half-past ten; and then church +service. Two of the children always remained for the sermon +voluntarily, and the other always remained too--for stronger reasons. +The church's high-backed, uncushioned pews would seat about three +hundred persons; the edifice was but a small, plain affair, with a sort +of pine board tree-box on top of it for a steeple. At the door Tom +dropped back a step and accosted a Sunday-dressed comrade: + +"Say, Billy, got a yaller ticket?" + +"Yes." + +"What'll you take for her?" + +"What'll you give?" + +"Piece of lickrish and a fish-hook." + +"Less see 'em." + +Tom exhibited. They were satisfactory, and the property changed hands. +Then Tom traded a couple of white alleys for three red tickets, and +some small trifle or other for a couple of blue ones. He waylaid other +boys as they came, and went on buying tickets of various colors ten or +fifteen minutes longer. He entered the church, now, with a swarm of +clean and noisy boys and girls, proceeded to his seat and started a +quarrel with the first boy that came handy. The teacher, a grave, +elderly man, interfered; then turned his back a moment and Tom pulled a +boy's hair in the next bench, and was absorbed in his book when the boy +turned around; stuck a pin in another boy, presently, in order to hear +him say "Ouch!" and got a new reprimand from his teacher. Tom's whole +class were of a pattern--restless, noisy, and troublesome. When they +came to recite their lessons, not one of them knew his verses +perfectly, but had to be prompted all along. However, they worried +through, and each got his reward--in small blue tickets, each with a +passage of Scripture on it; each blue ticket was pay for two verses of +the recitation. Ten blue tickets equalled a red one, and could be +exchanged for it; ten red tickets equalled a yellow one; for ten yellow +tickets the superintendent gave a very plainly bound Bible (worth forty +cents in those easy times) to the pupil. How many of my readers would +have the industry and application to memorize two thousand verses, even +for a Dore Bible? And yet Mary had acquired two Bibles in this way--it +was the patient work of two years--and a boy of German parentage had +won four or five. He once recited three thousand verses without +stopping; but the strain upon his mental faculties was too great, and +he was little better than an idiot from that day forth--a grievous +misfortune for the school, for on great occasions, before company, the +superintendent (as Tom expressed it) had always made this boy come out +and "spread himself." Only the older pupils managed to keep their +tickets and stick to their tedious work long enough to get a Bible, and +so the delivery of one of these prizes was a rare and noteworthy +circumstance; the successful pupil was so great and conspicuous for +that day that on the spot every scholar's heart was fired with a fresh +ambition that often lasted a couple of weeks. It is possible that Tom's +mental stomach had never really hungered for one of those prizes, but +unquestionably his entire being had for many a day longed for the glory +and the eclat that came with it. + +In due course the superintendent stood up in front of the pulpit, with +a closed hymn-book in his hand and his forefinger inserted between its +leaves, and commanded attention. When a Sunday-school superintendent +makes his customary little speech, a hymn-book in the hand is as +necessary as is the inevitable sheet of music in the hand of a singer +who stands forward on the platform and sings a solo at a concert +--though why, is a mystery: for neither the hymn-book nor the sheet of +music is ever referred to by the sufferer. This superintendent was a +slim creature of thirty-five, with a sandy goatee and short sandy hair; +he wore a stiff standing-collar whose upper edge almost reached his +ears and whose sharp points curved forward abreast the corners of his +mouth--a fence that compelled a straight lookout ahead, and a turning +of the whole body when a side view was required; his chin was propped +on a spreading cravat which was as broad and as long as a bank-note, +and had fringed ends; his boot toes were turned sharply up, in the +fashion of the day, like sleigh-runners--an effect patiently and +laboriously produced by the young men by sitting with their toes +pressed against a wall for hours together. Mr. Walters was very earnest +of mien, and very sincere and honest at heart; and he held sacred +things and places in such reverence, and so separated them from worldly +matters, that unconsciously to himself his Sunday-school voice had +acquired a peculiar intonation which was wholly absent on week-days. He +began after this fashion: + +"Now, children, I want you all to sit up just as straight and pretty +as you can and give me all your attention for a minute or two. There +--that is it. That is the way good little boys and girls should do. I see +one little girl who is looking out of the window--I am afraid she +thinks I am out there somewhere--perhaps up in one of the trees making +a speech to the little birds. [Applausive titter.] I want to tell you +how good it makes me feel to see so many bright, clean little faces +assembled in a place like this, learning to do right and be good." And +so forth and so on. It is not necessary to set down the rest of the +oration. It was of a pattern which does not vary, and so it is familiar +to us all. + +The latter third of the speech was marred by the resumption of fights +and other recreations among certain of the bad boys, and by fidgetings +and whisperings that extended far and wide, washing even to the bases +of isolated and incorruptible rocks like Sid and Mary. But now every +sound ceased suddenly, with the subsidence of Mr. Walters' voice, and +the conclusion of the speech was received with a burst of silent +gratitude. + +A good part of the whispering had been occasioned by an event which +was more or less rare--the entrance of visitors: lawyer Thatcher, +accompanied by a very feeble and aged man; a fine, portly, middle-aged +gentleman with iron-gray hair; and a dignified lady who was doubtless +the latter's wife. The lady was leading a child. Tom had been restless +and full of chafings and repinings; conscience-smitten, too--he could +not meet Amy Lawrence's eye, he could not brook her loving gaze. But +when he saw this small new-comer his soul was all ablaze with bliss in +a moment. The next moment he was "showing off" with all his might +--cuffing boys, pulling hair, making faces--in a word, using every art +that seemed likely to fascinate a girl and win her applause. His +exaltation had but one alloy--the memory of his humiliation in this +angel's garden--and that record in sand was fast washing out, under +the waves of happiness that were sweeping over it now. + +The visitors were given the highest seat of honor, and as soon as Mr. +Walters' speech was finished, he introduced them to the school. The +middle-aged man turned out to be a prodigious personage--no less a one +than the county judge--altogether the most august creation these +children had ever looked upon--and they wondered what kind of material +he was made of--and they half wanted to hear him roar, and were half +afraid he might, too. He was from Constantinople, twelve miles away--so +he had travelled, and seen the world--these very eyes had looked upon +the county court-house--which was said to have a tin roof. The awe +which these reflections inspired was attested by the impressive silence +and the ranks of staring eyes. This was the great Judge Thatcher, +brother of their own lawyer. Jeff Thatcher immediately went forward, to +be familiar with the great man and be envied by the school. It would +have been music to his soul to hear the whisperings: + +"Look at him, Jim! He's a going up there. Say--look! he's a going to +shake hands with him--he IS shaking hands with him! By jings, don't you +wish you was Jeff?" + +Mr. Walters fell to "showing off," with all sorts of official +bustlings and activities, giving orders, delivering judgments, +discharging directions here, there, everywhere that he could find a +target. The librarian "showed off"--running hither and thither with his +arms full of books and making a deal of the splutter and fuss that +insect authority delights in. The young lady teachers "showed off" +--bending sweetly over pupils that were lately being boxed, lifting +pretty warning fingers at bad little boys and patting good ones +lovingly. The young gentlemen teachers "showed off" with small +scoldings and other little displays of authority and fine attention to +discipline--and most of the teachers, of both sexes, found business up +at the library, by the pulpit; and it was business that frequently had +to be done over again two or three times (with much seeming vexation). +The little girls "showed off" in various ways, and the little boys +"showed off" with such diligence that the air was thick with paper wads +and the murmur of scufflings. And above it all the great man sat and +beamed a majestic judicial smile upon all the house, and warmed himself +in the sun of his own grandeur--for he was "showing off," too. + +There was only one thing wanting to make Mr. Walters' ecstasy +complete, and that was a chance to deliver a Bible-prize and exhibit a +prodigy. Several pupils had a few yellow tickets, but none had enough +--he had been around among the star pupils inquiring. He would have given +worlds, now, to have that German lad back again with a sound mind. + +And now at this moment, when hope was dead, Tom Sawyer came forward +with nine yellow tickets, nine red tickets, and ten blue ones, and +demanded a Bible. This was a thunderbolt out of a clear sky. Walters +was not expecting an application from this source for the next ten +years. But there was no getting around it--here were the certified +checks, and they were good for their face. Tom was therefore elevated +to a place with the Judge and the other elect, and the great news was +announced from headquarters. It was the most stunning surprise of the +decade, and so profound was the sensation that it lifted the new hero +up to the judicial one's altitude, and the school had two marvels to +gaze upon in place of one. The boys were all eaten up with envy--but +those that suffered the bitterest pangs were those who perceived too +late that they themselves had contributed to this hated splendor by +trading tickets to Tom for the wealth he had amassed in selling +whitewashing privileges. These despised themselves, as being the dupes +of a wily fraud, a guileful snake in the grass. + +The prize was delivered to Tom with as much effusion as the +superintendent could pump up under the circumstances; but it lacked +somewhat of the true gush, for the poor fellow's instinct taught him +that there was a mystery here that could not well bear the light, +perhaps; it was simply preposterous that this boy had warehoused two +thousand sheaves of Scriptural wisdom on his premises--a dozen would +strain his capacity, without a doubt. + +Amy Lawrence was proud and glad, and she tried to make Tom see it in +her face--but he wouldn't look. She wondered; then she was just a grain +troubled; next a dim suspicion came and went--came again; she watched; +a furtive glance told her worlds--and then her heart broke, and she was +jealous, and angry, and the tears came and she hated everybody. Tom +most of all (she thought). + +Tom was introduced to the Judge; but his tongue was tied, his breath +would hardly come, his heart quaked--partly because of the awful +greatness of the man, but mainly because he was her parent. He would +have liked to fall down and worship him, if it were in the dark. The +Judge put his hand on Tom's head and called him a fine little man, and +asked him what his name was. The boy stammered, gasped, and got it out: + +"Tom." + +"Oh, no, not Tom--it is--" + +"Thomas." + +"Ah, that's it. I thought there was more to it, maybe. That's very +well. But you've another one I daresay, and you'll tell it to me, won't +you?" + +"Tell the gentleman your other name, Thomas," said Walters, "and say +sir. You mustn't forget your manners." + +"Thomas Sawyer--sir." + +"That's it! That's a good boy. Fine boy. Fine, manly little fellow. +Two thousand verses is a great many--very, very great many. And you +never can be sorry for the trouble you took to learn them; for +knowledge is worth more than anything there is in the world; it's what +makes great men and good men; you'll be a great man and a good man +yourself, some day, Thomas, and then you'll look back and say, It's all +owing to the precious Sunday-school privileges of my boyhood--it's all +owing to my dear teachers that taught me to learn--it's all owing to +the good superintendent, who encouraged me, and watched over me, and +gave me a beautiful Bible--a splendid elegant Bible--to keep and have +it all for my own, always--it's all owing to right bringing up! That is +what you will say, Thomas--and you wouldn't take any money for those +two thousand verses--no indeed you wouldn't. And now you wouldn't mind +telling me and this lady some of the things you've learned--no, I know +you wouldn't--for we are proud of little boys that learn. Now, no +doubt you know the names of all the twelve disciples. Won't you tell us +the names of the first two that were appointed?" + +Tom was tugging at a button-hole and looking sheepish. He blushed, +now, and his eyes fell. Mr. Walters' heart sank within him. He said to +himself, it is not possible that the boy can answer the simplest +question--why DID the Judge ask him? Yet he felt obliged to speak up +and say: + +"Answer the gentleman, Thomas--don't be afraid." + +Tom still hung fire. + +"Now I know you'll tell me," said the lady. "The names of the first +two disciples were--" + +"DAVID AND GOLIAH!" + +Let us draw the curtain of charity over the rest of the scene. + + + +CHAPTER V + +ABOUT half-past ten the cracked bell of the small church began to +ring, and presently the people began to gather for the morning sermon. +The Sunday-school children distributed themselves about the house and +occupied pews with their parents, so as to be under supervision. Aunt +Polly came, and Tom and Sid and Mary sat with her--Tom being placed +next the aisle, in order that he might be as far away from the open +window and the seductive outside summer scenes as possible. The crowd +filed up the aisles: the aged and needy postmaster, who had seen better +days; the mayor and his wife--for they had a mayor there, among other +unnecessaries; the justice of the peace; the widow Douglass, fair, +smart, and forty, a generous, good-hearted soul and well-to-do, her +hill mansion the only palace in the town, and the most hospitable and +much the most lavish in the matter of festivities that St. Petersburg +could boast; the bent and venerable Major and Mrs. Ward; lawyer +Riverson, the new notable from a distance; next the belle of the +village, followed by a troop of lawn-clad and ribbon-decked young +heart-breakers; then all the young clerks in town in a body--for they +had stood in the vestibule sucking their cane-heads, a circling wall of +oiled and simpering admirers, till the last girl had run their gantlet; +and last of all came the Model Boy, Willie Mufferson, taking as heedful +care of his mother as if she were cut glass. He always brought his +mother to church, and was the pride of all the matrons. The boys all +hated him, he was so good. And besides, he had been "thrown up to them" +so much. His white handkerchief was hanging out of his pocket behind, as +usual on Sundays--accidentally. Tom had no handkerchief, and he looked +upon boys who had as snobs. + +The congregation being fully assembled, now, the bell rang once more, +to warn laggards and stragglers, and then a solemn hush fell upon the +church which was only broken by the tittering and whispering of the +choir in the gallery. The choir always tittered and whispered all +through service. There was once a church choir that was not ill-bred, +but I have forgotten where it was, now. It was a great many years ago, +and I can scarcely remember anything about it, but I think it was in +some foreign country. + +The minister gave out the hymn, and read it through with a relish, in +a peculiar style which was much admired in that part of the country. +His voice began on a medium key and climbed steadily up till it reached +a certain point, where it bore with strong emphasis upon the topmost +word and then plunged down as if from a spring-board: + + Shall I be car-ri-ed toe the skies, on flow'ry BEDS of ease, + + Whilst others fight to win the prize, and sail thro' BLOODY seas? + +He was regarded as a wonderful reader. At church "sociables" he was +always called upon to read poetry; and when he was through, the ladies +would lift up their hands and let them fall helplessly in their laps, +and "wall" their eyes, and shake their heads, as much as to say, "Words +cannot express it; it is too beautiful, TOO beautiful for this mortal +earth." + +After the hymn had been sung, the Rev. Mr. Sprague turned himself into +a bulletin-board, and read off "notices" of meetings and societies and +things till it seemed that the list would stretch out to the crack of +doom--a queer custom which is still kept up in America, even in cities, +away here in this age of abundant newspapers. Often, the less there is +to justify a traditional custom, the harder it is to get rid of it. + +And now the minister prayed. A good, generous prayer it was, and went +into details: it pleaded for the church, and the little children of the +church; for the other churches of the village; for the village itself; +for the county; for the State; for the State officers; for the United +States; for the churches of the United States; for Congress; for the +President; for the officers of the Government; for poor sailors, tossed +by stormy seas; for the oppressed millions groaning under the heel of +European monarchies and Oriental despotisms; for such as have the light +and the good tidings, and yet have not eyes to see nor ears to hear +withal; for the heathen in the far islands of the sea; and closed with +a supplication that the words he was about to speak might find grace +and favor, and be as seed sown in fertile ground, yielding in time a +grateful harvest of good. Amen. + +There was a rustling of dresses, and the standing congregation sat +down. The boy whose history this book relates did not enjoy the prayer, +he only endured it--if he even did that much. He was restive all +through it; he kept tally of the details of the prayer, unconsciously +--for he was not listening, but he knew the ground of old, and the +clergyman's regular route over it--and when a little trifle of new +matter was interlarded, his ear detected it and his whole nature +resented it; he considered additions unfair, and scoundrelly. In the +midst of the prayer a fly had lit on the back of the pew in front of +him and tortured his spirit by calmly rubbing its hands together, +embracing its head with its arms, and polishing it so vigorously that +it seemed to almost part company with the body, and the slender thread +of a neck was exposed to view; scraping its wings with its hind legs +and smoothing them to its body as if they had been coat-tails; going +through its whole toilet as tranquilly as if it knew it was perfectly +safe. As indeed it was; for as sorely as Tom's hands itched to grab for +it they did not dare--he believed his soul would be instantly destroyed +if he did such a thing while the prayer was going on. But with the +closing sentence his hand began to curve and steal forward; and the +instant the "Amen" was out the fly was a prisoner of war. His aunt +detected the act and made him let it go. + +The minister gave out his text and droned along monotonously through +an argument that was so prosy that many a head by and by began to nod +--and yet it was an argument that dealt in limitless fire and brimstone +and thinned the predestined elect down to a company so small as to be +hardly worth the saving. Tom counted the pages of the sermon; after +church he always knew how many pages there had been, but he seldom knew +anything else about the discourse. However, this time he was really +interested for a little while. The minister made a grand and moving +picture of the assembling together of the world's hosts at the +millennium when the lion and the lamb should lie down together and a +little child should lead them. But the pathos, the lesson, the moral of +the great spectacle were lost upon the boy; he only thought of the +conspicuousness of the principal character before the on-looking +nations; his face lit with the thought, and he said to himself that he +wished he could be that child, if it was a tame lion. + +Now he lapsed into suffering again, as the dry argument was resumed. +Presently he bethought him of a treasure he had and got it out. It was +a large black beetle with formidable jaws--a "pinchbug," he called it. +It was in a percussion-cap box. The first thing the beetle did was to +take him by the finger. A natural fillip followed, the beetle went +floundering into the aisle and lit on its back, and the hurt finger +went into the boy's mouth. The beetle lay there working its helpless +legs, unable to turn over. Tom eyed it, and longed for it; but it was +safe out of his reach. Other people uninterested in the sermon found +relief in the beetle, and they eyed it too. Presently a vagrant poodle +dog came idling along, sad at heart, lazy with the summer softness and +the quiet, weary of captivity, sighing for change. He spied the beetle; +the drooping tail lifted and wagged. He surveyed the prize; walked +around it; smelt at it from a safe distance; walked around it again; +grew bolder, and took a closer smell; then lifted his lip and made a +gingerly snatch at it, just missing it; made another, and another; +began to enjoy the diversion; subsided to his stomach with the beetle +between his paws, and continued his experiments; grew weary at last, +and then indifferent and absent-minded. His head nodded, and little by +little his chin descended and touched the enemy, who seized it. There +was a sharp yelp, a flirt of the poodle's head, and the beetle fell a +couple of yards away, and lit on its back once more. The neighboring +spectators shook with a gentle inward joy, several faces went behind +fans and handkerchiefs, and Tom was entirely happy. The dog looked +foolish, and probably felt so; but there was resentment in his heart, +too, and a craving for revenge. So he went to the beetle and began a +wary attack on it again; jumping at it from every point of a circle, +lighting with his fore-paws within an inch of the creature, making even +closer snatches at it with his teeth, and jerking his head till his +ears flapped again. But he grew tired once more, after a while; tried +to amuse himself with a fly but found no relief; followed an ant +around, with his nose close to the floor, and quickly wearied of that; +yawned, sighed, forgot the beetle entirely, and sat down on it. Then +there was a wild yelp of agony and the poodle went sailing up the +aisle; the yelps continued, and so did the dog; he crossed the house in +front of the altar; he flew down the other aisle; he crossed before the +doors; he clamored up the home-stretch; his anguish grew with his +progress, till presently he was but a woolly comet moving in its orbit +with the gleam and the speed of light. At last the frantic sufferer +sheered from its course, and sprang into its master's lap; he flung it +out of the window, and the voice of distress quickly thinned away and +died in the distance. + +By this time the whole church was red-faced and suffocating with +suppressed laughter, and the sermon had come to a dead standstill. The +discourse was resumed presently, but it went lame and halting, all +possibility of impressiveness being at an end; for even the gravest +sentiments were constantly being received with a smothered burst of +unholy mirth, under cover of some remote pew-back, as if the poor +parson had said a rarely facetious thing. It was a genuine relief to +the whole congregation when the ordeal was over and the benediction +pronounced. + +Tom Sawyer went home quite cheerful, thinking to himself that there +was some satisfaction about divine service when there was a bit of +variety in it. He had but one marring thought; he was willing that the +dog should play with his pinchbug, but he did not think it was upright +in him to carry it off. + + + +CHAPTER VI + +MONDAY morning found Tom Sawyer miserable. Monday morning always found +him so--because it began another week's slow suffering in school. He +generally began that day with wishing he had had no intervening +holiday, it made the going into captivity and fetters again so much +more odious. + +Tom lay thinking. Presently it occurred to him that he wished he was +sick; then he could stay home from school. Here was a vague +possibility. He canvassed his system. No ailment was found, and he +investigated again. This time he thought he could detect colicky +symptoms, and he began to encourage them with considerable hope. But +they soon grew feeble, and presently died wholly away. He reflected +further. Suddenly he discovered something. One of his upper front teeth +was loose. This was lucky; he was about to begin to groan, as a +"starter," as he called it, when it occurred to him that if he came +into court with that argument, his aunt would pull it out, and that +would hurt. So he thought he would hold the tooth in reserve for the +present, and seek further. Nothing offered for some little time, and +then he remembered hearing the doctor tell about a certain thing that +laid up a patient for two or three weeks and threatened to make him +lose a finger. So the boy eagerly drew his sore toe from under the +sheet and held it up for inspection. But now he did not know the +necessary symptoms. However, it seemed well worth while to chance it, +so he fell to groaning with considerable spirit. + +But Sid slept on unconscious. + +Tom groaned louder, and fancied that he began to feel pain in the toe. + +No result from Sid. + +Tom was panting with his exertions by this time. He took a rest and +then swelled himself up and fetched a succession of admirable groans. + +Sid snored on. + +Tom was aggravated. He said, "Sid, Sid!" and shook him. This course +worked well, and Tom began to groan again. Sid yawned, stretched, then +brought himself up on his elbow with a snort, and began to stare at +Tom. Tom went on groaning. Sid said: + +"Tom! Say, Tom!" [No response.] "Here, Tom! TOM! What is the matter, +Tom?" And he shook him and looked in his face anxiously. + +Tom moaned out: + +"Oh, don't, Sid. Don't joggle me." + +"Why, what's the matter, Tom? I must call auntie." + +"No--never mind. It'll be over by and by, maybe. Don't call anybody." + +"But I must! DON'T groan so, Tom, it's awful. How long you been this +way?" + +"Hours. Ouch! Oh, don't stir so, Sid, you'll kill me." + +"Tom, why didn't you wake me sooner? Oh, Tom, DON'T! It makes my +flesh crawl to hear you. Tom, what is the matter?" + +"I forgive you everything, Sid. [Groan.] Everything you've ever done +to me. When I'm gone--" + +"Oh, Tom, you ain't dying, are you? Don't, Tom--oh, don't. Maybe--" + +"I forgive everybody, Sid. [Groan.] Tell 'em so, Sid. And Sid, you +give my window-sash and my cat with one eye to that new girl that's +come to town, and tell her--" + +But Sid had snatched his clothes and gone. Tom was suffering in +reality, now, so handsomely was his imagination working, and so his +groans had gathered quite a genuine tone. + +Sid flew down-stairs and said: + +"Oh, Aunt Polly, come! Tom's dying!" + +"Dying!" + +"Yes'm. Don't wait--come quick!" + +"Rubbage! I don't believe it!" + +But she fled up-stairs, nevertheless, with Sid and Mary at her heels. +And her face grew white, too, and her lip trembled. When she reached +the bedside she gasped out: + +"You, Tom! Tom, what's the matter with you?" + +"Oh, auntie, I'm--" + +"What's the matter with you--what is the matter with you, child?" + +"Oh, auntie, my sore toe's mortified!" + +The old lady sank down into a chair and laughed a little, then cried a +little, then did both together. This restored her and she said: + +"Tom, what a turn you did give me. Now you shut up that nonsense and +climb out of this." + +The groans ceased and the pain vanished from the toe. The boy felt a +little foolish, and he said: + +"Aunt Polly, it SEEMED mortified, and it hurt so I never minded my +tooth at all." + +"Your tooth, indeed! What's the matter with your tooth?" + +"One of them's loose, and it aches perfectly awful." + +"There, there, now, don't begin that groaning again. Open your mouth. +Well--your tooth IS loose, but you're not going to die about that. +Mary, get me a silk thread, and a chunk of fire out of the kitchen." + +Tom said: + +"Oh, please, auntie, don't pull it out. It don't hurt any more. I wish +I may never stir if it does. Please don't, auntie. I don't want to stay +home from school." + +"Oh, you don't, don't you? So all this row was because you thought +you'd get to stay home from school and go a-fishing? Tom, Tom, I love +you so, and you seem to try every way you can to break my old heart +with your outrageousness." By this time the dental instruments were +ready. The old lady made one end of the silk thread fast to Tom's tooth +with a loop and tied the other to the bedpost. Then she seized the +chunk of fire and suddenly thrust it almost into the boy's face. The +tooth hung dangling by the bedpost, now. + +But all trials bring their compensations. As Tom wended to school +after breakfast, he was the envy of every boy he met because the gap in +his upper row of teeth enabled him to expectorate in a new and +admirable way. He gathered quite a following of lads interested in the +exhibition; and one that had cut his finger and had been a centre of +fascination and homage up to this time, now found himself suddenly +without an adherent, and shorn of his glory. His heart was heavy, and +he said with a disdain which he did not feel that it wasn't anything to +spit like Tom Sawyer; but another boy said, "Sour grapes!" and he +wandered away a dismantled hero. + +Shortly Tom came upon the juvenile pariah of the village, Huckleberry +Finn, son of the town drunkard. Huckleberry was cordially hated and +dreaded by all the mothers of the town, because he was idle and lawless +and vulgar and bad--and because all their children admired him so, and +delighted in his forbidden society, and wished they dared to be like +him. Tom was like the rest of the respectable boys, in that he envied +Huckleberry his gaudy outcast condition, and was under strict orders +not to play with him. So he played with him every time he got a chance. +Huckleberry was always dressed in the cast-off clothes of full-grown +men, and they were in perennial bloom and fluttering with rags. His hat +was a vast ruin with a wide crescent lopped out of its brim; his coat, +when he wore one, hung nearly to his heels and had the rearward buttons +far down the back; but one suspender supported his trousers; the seat +of the trousers bagged low and contained nothing, the fringed legs +dragged in the dirt when not rolled up. + +Huckleberry came and went, at his own free will. He slept on doorsteps +in fine weather and in empty hogsheads in wet; he did not have to go to +school or to church, or call any being master or obey anybody; he could +go fishing or swimming when and where he chose, and stay as long as it +suited him; nobody forbade him to fight; he could sit up as late as he +pleased; he was always the first boy that went barefoot in the spring +and the last to resume leather in the fall; he never had to wash, nor +put on clean clothes; he could swear wonderfully. In a word, everything +that goes to make life precious that boy had. So thought every +harassed, hampered, respectable boy in St. Petersburg. + +Tom hailed the romantic outcast: + +"Hello, Huckleberry!" + +"Hello yourself, and see how you like it." + +"What's that you got?" + +"Dead cat." + +"Lemme see him, Huck. My, he's pretty stiff. Where'd you get him?" + +"Bought him off'n a boy." + +"What did you give?" + +"I give a blue ticket and a bladder that I got at the slaughter-house." + +"Where'd you get the blue ticket?" + +"Bought it off'n Ben Rogers two weeks ago for a hoop-stick." + +"Say--what is dead cats good for, Huck?" + +"Good for? Cure warts with." + +"No! Is that so? I know something that's better." + +"I bet you don't. What is it?" + +"Why, spunk-water." + +"Spunk-water! I wouldn't give a dern for spunk-water." + +"You wouldn't, wouldn't you? D'you ever try it?" + +"No, I hain't. But Bob Tanner did." + +"Who told you so!" + +"Why, he told Jeff Thatcher, and Jeff told Johnny Baker, and Johnny +told Jim Hollis, and Jim told Ben Rogers, and Ben told a nigger, and +the nigger told me. There now!" + +"Well, what of it? They'll all lie. Leastways all but the nigger. I +don't know HIM. But I never see a nigger that WOULDN'T lie. Shucks! Now +you tell me how Bob Tanner done it, Huck." + +"Why, he took and dipped his hand in a rotten stump where the +rain-water was." + +"In the daytime?" + +"Certainly." + +"With his face to the stump?" + +"Yes. Least I reckon so." + +"Did he say anything?" + +"I don't reckon he did. I don't know." + +"Aha! Talk about trying to cure warts with spunk-water such a blame +fool way as that! Why, that ain't a-going to do any good. You got to go +all by yourself, to the middle of the woods, where you know there's a +spunk-water stump, and just as it's midnight you back up against the +stump and jam your hand in and say: + + 'Barley-corn, barley-corn, injun-meal shorts, + Spunk-water, spunk-water, swaller these warts,' + +and then walk away quick, eleven steps, with your eyes shut, and then +turn around three times and walk home without speaking to anybody. +Because if you speak the charm's busted." + +"Well, that sounds like a good way; but that ain't the way Bob Tanner +done." + +"No, sir, you can bet he didn't, becuz he's the wartiest boy in this +town; and he wouldn't have a wart on him if he'd knowed how to work +spunk-water. I've took off thousands of warts off of my hands that way, +Huck. I play with frogs so much that I've always got considerable many +warts. Sometimes I take 'em off with a bean." + +"Yes, bean's good. I've done that." + +"Have you? What's your way?" + +"You take and split the bean, and cut the wart so as to get some +blood, and then you put the blood on one piece of the bean and take and +dig a hole and bury it 'bout midnight at the crossroads in the dark of +the moon, and then you burn up the rest of the bean. You see that piece +that's got the blood on it will keep drawing and drawing, trying to +fetch the other piece to it, and so that helps the blood to draw the +wart, and pretty soon off she comes." + +"Yes, that's it, Huck--that's it; though when you're burying it if you +say 'Down bean; off wart; come no more to bother me!' it's better. +That's the way Joe Harper does, and he's been nearly to Coonville and +most everywheres. But say--how do you cure 'em with dead cats?" + +"Why, you take your cat and go and get in the graveyard 'long about +midnight when somebody that was wicked has been buried; and when it's +midnight a devil will come, or maybe two or three, but you can't see +'em, you can only hear something like the wind, or maybe hear 'em talk; +and when they're taking that feller away, you heave your cat after 'em +and say, 'Devil follow corpse, cat follow devil, warts follow cat, I'm +done with ye!' That'll fetch ANY wart." + +"Sounds right. D'you ever try it, Huck?" + +"No, but old Mother Hopkins told me." + +"Well, I reckon it's so, then. Becuz they say she's a witch." + +"Say! Why, Tom, I KNOW she is. She witched pap. Pap says so his own +self. He come along one day, and he see she was a-witching him, so he +took up a rock, and if she hadn't dodged, he'd a got her. Well, that +very night he rolled off'n a shed wher' he was a layin drunk, and broke +his arm." + +"Why, that's awful. How did he know she was a-witching him?" + +"Lord, pap can tell, easy. Pap says when they keep looking at you +right stiddy, they're a-witching you. Specially if they mumble. Becuz +when they mumble they're saying the Lord's Prayer backards." + +"Say, Hucky, when you going to try the cat?" + +"To-night. I reckon they'll come after old Hoss Williams to-night." + +"But they buried him Saturday. Didn't they get him Saturday night?" + +"Why, how you talk! How could their charms work till midnight?--and +THEN it's Sunday. Devils don't slosh around much of a Sunday, I don't +reckon." + +"I never thought of that. That's so. Lemme go with you?" + +"Of course--if you ain't afeard." + +"Afeard! 'Tain't likely. Will you meow?" + +"Yes--and you meow back, if you get a chance. Last time, you kep' me +a-meowing around till old Hays went to throwing rocks at me and says +'Dern that cat!' and so I hove a brick through his window--but don't +you tell." + +"I won't. I couldn't meow that night, becuz auntie was watching me, +but I'll meow this time. Say--what's that?" + +"Nothing but a tick." + +"Where'd you get him?" + +"Out in the woods." + +"What'll you take for him?" + +"I don't know. I don't want to sell him." + +"All right. It's a mighty small tick, anyway." + +"Oh, anybody can run a tick down that don't belong to them. I'm +satisfied with it. It's a good enough tick for me." + +"Sho, there's ticks a plenty. I could have a thousand of 'em if I +wanted to." + +"Well, why don't you? Becuz you know mighty well you can't. This is a +pretty early tick, I reckon. It's the first one I've seen this year." + +"Say, Huck--I'll give you my tooth for him." + +"Less see it." + +Tom got out a bit of paper and carefully unrolled it. Huckleberry +viewed it wistfully. The temptation was very strong. At last he said: + +"Is it genuwyne?" + +Tom lifted his lip and showed the vacancy. + +"Well, all right," said Huckleberry, "it's a trade." + +Tom enclosed the tick in the percussion-cap box that had lately been +the pinchbug's prison, and the boys separated, each feeling wealthier +than before. + +When Tom reached the little isolated frame schoolhouse, he strode in +briskly, with the manner of one who had come with all honest speed. +He hung his hat on a peg and flung himself into his seat with +business-like alacrity. The master, throned on high in his great +splint-bottom arm-chair, was dozing, lulled by the drowsy hum of study. +The interruption roused him. + +"Thomas Sawyer!" + +Tom knew that when his name was pronounced in full, it meant trouble. + +"Sir!" + +"Come up here. Now, sir, why are you late again, as usual?" + +Tom was about to take refuge in a lie, when he saw two long tails of +yellow hair hanging down a back that he recognized by the electric +sympathy of love; and by that form was THE ONLY VACANT PLACE on the +girls' side of the schoolhouse. He instantly said: + +"I STOPPED TO TALK WITH HUCKLEBERRY FINN!" + +The master's pulse stood still, and he stared helplessly. The buzz of +study ceased. The pupils wondered if this foolhardy boy had lost his +mind. The master said: + +"You--you did what?" + +"Stopped to talk with Huckleberry Finn." + +There was no mistaking the words. + +"Thomas Sawyer, this is the most astounding confession I have ever +listened to. No mere ferule will answer for this offence. Take off your +jacket." + +The master's arm performed until it was tired and the stock of +switches notably diminished. Then the order followed: + +"Now, sir, go and sit with the girls! And let this be a warning to you." + +The titter that rippled around the room appeared to abash the boy, but +in reality that result was caused rather more by his worshipful awe of +his unknown idol and the dread pleasure that lay in his high good +fortune. He sat down upon the end of the pine bench and the girl +hitched herself away from him with a toss of her head. Nudges and winks +and whispers traversed the room, but Tom sat still, with his arms upon +the long, low desk before him, and seemed to study his book. + +By and by attention ceased from him, and the accustomed school murmur +rose upon the dull air once more. Presently the boy began to steal +furtive glances at the girl. She observed it, "made a mouth" at him and +gave him the back of her head for the space of a minute. When she +cautiously faced around again, a peach lay before her. She thrust it +away. Tom gently put it back. She thrust it away again, but with less +animosity. Tom patiently returned it to its place. Then she let it +remain. Tom scrawled on his slate, "Please take it--I got more." The +girl glanced at the words, but made no sign. Now the boy began to draw +something on the slate, hiding his work with his left hand. For a time +the girl refused to notice; but her human curiosity presently began to +manifest itself by hardly perceptible signs. The boy worked on, +apparently unconscious. The girl made a sort of noncommittal attempt to +see, but the boy did not betray that he was aware of it. At last she +gave in and hesitatingly whispered: + +"Let me see it." + +Tom partly uncovered a dismal caricature of a house with two gable +ends to it and a corkscrew of smoke issuing from the chimney. Then the +girl's interest began to fasten itself upon the work and she forgot +everything else. When it was finished, she gazed a moment, then +whispered: + +"It's nice--make a man." + +The artist erected a man in the front yard, that resembled a derrick. +He could have stepped over the house; but the girl was not +hypercritical; she was satisfied with the monster, and whispered: + +"It's a beautiful man--now make me coming along." + +Tom drew an hour-glass with a full moon and straw limbs to it and +armed the spreading fingers with a portentous fan. The girl said: + +"It's ever so nice--I wish I could draw." + +"It's easy," whispered Tom, "I'll learn you." + +"Oh, will you? When?" + +"At noon. Do you go home to dinner?" + +"I'll stay if you will." + +"Good--that's a whack. What's your name?" + +"Becky Thatcher. What's yours? Oh, I know. It's Thomas Sawyer." + +"That's the name they lick me by. I'm Tom when I'm good. You call me +Tom, will you?" + +"Yes." + +Now Tom began to scrawl something on the slate, hiding the words from +the girl. But she was not backward this time. She begged to see. Tom +said: + +"Oh, it ain't anything." + +"Yes it is." + +"No it ain't. You don't want to see." + +"Yes I do, indeed I do. Please let me." + +"You'll tell." + +"No I won't--deed and deed and double deed won't." + +"You won't tell anybody at all? Ever, as long as you live?" + +"No, I won't ever tell ANYbody. Now let me." + +"Oh, YOU don't want to see!" + +"Now that you treat me so, I WILL see." And she put her small hand +upon his and a little scuffle ensued, Tom pretending to resist in +earnest but letting his hand slip by degrees till these words were +revealed: "I LOVE YOU." + +"Oh, you bad thing!" And she hit his hand a smart rap, but reddened +and looked pleased, nevertheless. + +Just at this juncture the boy felt a slow, fateful grip closing on his +ear, and a steady lifting impulse. In that wise he was borne across the +house and deposited in his own seat, under a peppering fire of giggles +from the whole school. Then the master stood over him during a few +awful moments, and finally moved away to his throne without saying a +word. But although Tom's ear tingled, his heart was jubilant. + +As the school quieted down Tom made an honest effort to study, but the +turmoil within him was too great. In turn he took his place in the +reading class and made a botch of it; then in the geography class and +turned lakes into mountains, mountains into rivers, and rivers into +continents, till chaos was come again; then in the spelling class, and +got "turned down," by a succession of mere baby words, till he brought +up at the foot and yielded up the pewter medal which he had worn with +ostentation for months. + + + +CHAPTER VII + +THE harder Tom tried to fasten his mind on his book, the more his +ideas wandered. So at last, with a sigh and a yawn, he gave it up. It +seemed to him that the noon recess would never come. The air was +utterly dead. There was not a breath stirring. It was the sleepiest of +sleepy days. The drowsing murmur of the five and twenty studying +scholars soothed the soul like the spell that is in the murmur of bees. +Away off in the flaming sunshine, Cardiff Hill lifted its soft green +sides through a shimmering veil of heat, tinted with the purple of +distance; a few birds floated on lazy wing high in the air; no other +living thing was visible but some cows, and they were asleep. Tom's +heart ached to be free, or else to have something of interest to do to +pass the dreary time. His hand wandered into his pocket and his face +lit up with a glow of gratitude that was prayer, though he did not know +it. Then furtively the percussion-cap box came out. He released the +tick and put him on the long flat desk. The creature probably glowed +with a gratitude that amounted to prayer, too, at this moment, but it +was premature: for when he started thankfully to travel off, Tom turned +him aside with a pin and made him take a new direction. + +Tom's bosom friend sat next him, suffering just as Tom had been, and +now he was deeply and gratefully interested in this entertainment in an +instant. This bosom friend was Joe Harper. The two boys were sworn +friends all the week, and embattled enemies on Saturdays. Joe took a +pin out of his lapel and began to assist in exercising the prisoner. +The sport grew in interest momently. Soon Tom said that they were +interfering with each other, and neither getting the fullest benefit of +the tick. So he put Joe's slate on the desk and drew a line down the +middle of it from top to bottom. + +"Now," said he, "as long as he is on your side you can stir him up and +I'll let him alone; but if you let him get away and get on my side, +you're to leave him alone as long as I can keep him from crossing over." + +"All right, go ahead; start him up." + +The tick escaped from Tom, presently, and crossed the equator. Joe +harassed him awhile, and then he got away and crossed back again. This +change of base occurred often. While one boy was worrying the tick with +absorbing interest, the other would look on with interest as strong, +the two heads bowed together over the slate, and the two souls dead to +all things else. At last luck seemed to settle and abide with Joe. The +tick tried this, that, and the other course, and got as excited and as +anxious as the boys themselves, but time and again just as he would +have victory in his very grasp, so to speak, and Tom's fingers would be +twitching to begin, Joe's pin would deftly head him off, and keep +possession. At last Tom could stand it no longer. The temptation was +too strong. So he reached out and lent a hand with his pin. Joe was +angry in a moment. Said he: + +"Tom, you let him alone." + +"I only just want to stir him up a little, Joe." + +"No, sir, it ain't fair; you just let him alone." + +"Blame it, I ain't going to stir him much." + +"Let him alone, I tell you." + +"I won't!" + +"You shall--he's on my side of the line." + +"Look here, Joe Harper, whose is that tick?" + +"I don't care whose tick he is--he's on my side of the line, and you +sha'n't touch him." + +"Well, I'll just bet I will, though. He's my tick and I'll do what I +blame please with him, or die!" + +A tremendous whack came down on Tom's shoulders, and its duplicate on +Joe's; and for the space of two minutes the dust continued to fly from +the two jackets and the whole school to enjoy it. The boys had been too +absorbed to notice the hush that had stolen upon the school awhile +before when the master came tiptoeing down the room and stood over +them. He had contemplated a good part of the performance before he +contributed his bit of variety to it. + +When school broke up at noon, Tom flew to Becky Thatcher, and +whispered in her ear: + +"Put on your bonnet and let on you're going home; and when you get to +the corner, give the rest of 'em the slip, and turn down through the +lane and come back. I'll go the other way and come it over 'em the same +way." + +So the one went off with one group of scholars, and the other with +another. In a little while the two met at the bottom of the lane, and +when they reached the school they had it all to themselves. Then they +sat together, with a slate before them, and Tom gave Becky the pencil +and held her hand in his, guiding it, and so created another surprising +house. When the interest in art began to wane, the two fell to talking. +Tom was swimming in bliss. He said: + +"Do you love rats?" + +"No! I hate them!" + +"Well, I do, too--LIVE ones. But I mean dead ones, to swing round your +head with a string." + +"No, I don't care for rats much, anyway. What I like is chewing-gum." + +"Oh, I should say so! I wish I had some now." + +"Do you? I've got some. I'll let you chew it awhile, but you must give +it back to me." + +That was agreeable, so they chewed it turn about, and dangled their +legs against the bench in excess of contentment. + +"Was you ever at a circus?" said Tom. + +"Yes, and my pa's going to take me again some time, if I'm good." + +"I been to the circus three or four times--lots of times. Church ain't +shucks to a circus. There's things going on at a circus all the time. +I'm going to be a clown in a circus when I grow up." + +"Oh, are you! That will be nice. They're so lovely, all spotted up." + +"Yes, that's so. And they get slathers of money--most a dollar a day, +Ben Rogers says. Say, Becky, was you ever engaged?" + +"What's that?" + +"Why, engaged to be married." + +"No." + +"Would you like to?" + +"I reckon so. I don't know. What is it like?" + +"Like? Why it ain't like anything. You only just tell a boy you won't +ever have anybody but him, ever ever ever, and then you kiss and that's +all. Anybody can do it." + +"Kiss? What do you kiss for?" + +"Why, that, you know, is to--well, they always do that." + +"Everybody?" + +"Why, yes, everybody that's in love with each other. Do you remember +what I wrote on the slate?" + +"Ye--yes." + +"What was it?" + +"I sha'n't tell you." + +"Shall I tell YOU?" + +"Ye--yes--but some other time." + +"No, now." + +"No, not now--to-morrow." + +"Oh, no, NOW. Please, Becky--I'll whisper it, I'll whisper it ever so +easy." + +Becky hesitating, Tom took silence for consent, and passed his arm +about her waist and whispered the tale ever so softly, with his mouth +close to her ear. And then he added: + +"Now you whisper it to me--just the same." + +She resisted, for a while, and then said: + +"You turn your face away so you can't see, and then I will. But you +mustn't ever tell anybody--WILL you, Tom? Now you won't, WILL you?" + +"No, indeed, indeed I won't. Now, Becky." + +He turned his face away. She bent timidly around till her breath +stirred his curls and whispered, "I--love--you!" + +Then she sprang away and ran around and around the desks and benches, +with Tom after her, and took refuge in a corner at last, with her +little white apron to her face. Tom clasped her about her neck and +pleaded: + +"Now, Becky, it's all done--all over but the kiss. Don't you be afraid +of that--it ain't anything at all. Please, Becky." And he tugged at her +apron and the hands. + +By and by she gave up, and let her hands drop; her face, all glowing +with the struggle, came up and submitted. Tom kissed the red lips and +said: + +"Now it's all done, Becky. And always after this, you know, you ain't +ever to love anybody but me, and you ain't ever to marry anybody but +me, ever never and forever. Will you?" + +"No, I'll never love anybody but you, Tom, and I'll never marry +anybody but you--and you ain't to ever marry anybody but me, either." + +"Certainly. Of course. That's PART of it. And always coming to school +or when we're going home, you're to walk with me, when there ain't +anybody looking--and you choose me and I choose you at parties, because +that's the way you do when you're engaged." + +"It's so nice. I never heard of it before." + +"Oh, it's ever so gay! Why, me and Amy Lawrence--" + +The big eyes told Tom his blunder and he stopped, confused. + +"Oh, Tom! Then I ain't the first you've ever been engaged to!" + +The child began to cry. Tom said: + +"Oh, don't cry, Becky, I don't care for her any more." + +"Yes, you do, Tom--you know you do." + +Tom tried to put his arm about her neck, but she pushed him away and +turned her face to the wall, and went on crying. Tom tried again, with +soothing words in his mouth, and was repulsed again. Then his pride was +up, and he strode away and went outside. He stood about, restless and +uneasy, for a while, glancing at the door, every now and then, hoping +she would repent and come to find him. But she did not. Then he began +to feel badly and fear that he was in the wrong. It was a hard struggle +with him to make new advances, now, but he nerved himself to it and +entered. She was still standing back there in the corner, sobbing, with +her face to the wall. Tom's heart smote him. He went to her and stood a +moment, not knowing exactly how to proceed. Then he said hesitatingly: + +"Becky, I--I don't care for anybody but you." + +No reply--but sobs. + +"Becky"--pleadingly. "Becky, won't you say something?" + +More sobs. + +Tom got out his chiefest jewel, a brass knob from the top of an +andiron, and passed it around her so that she could see it, and said: + +"Please, Becky, won't you take it?" + +She struck it to the floor. Then Tom marched out of the house and over +the hills and far away, to return to school no more that day. Presently +Becky began to suspect. She ran to the door; he was not in sight; she +flew around to the play-yard; he was not there. Then she called: + +"Tom! Come back, Tom!" + +She listened intently, but there was no answer. She had no companions +but silence and loneliness. So she sat down to cry again and upbraid +herself; and by this time the scholars began to gather again, and she +had to hide her griefs and still her broken heart and take up the cross +of a long, dreary, aching afternoon, with none among the strangers +about her to exchange sorrows with. + + + +CHAPTER VIII + +TOM dodged hither and thither through lanes until he was well out of +the track of returning scholars, and then fell into a moody jog. He +crossed a small "branch" two or three times, because of a prevailing +juvenile superstition that to cross water baffled pursuit. Half an hour +later he was disappearing behind the Douglas mansion on the summit of +Cardiff Hill, and the schoolhouse was hardly distinguishable away off +in the valley behind him. He entered a dense wood, picked his pathless +way to the centre of it, and sat down on a mossy spot under a spreading +oak. There was not even a zephyr stirring; the dead noonday heat had +even stilled the songs of the birds; nature lay in a trance that was +broken by no sound but the occasional far-off hammering of a +woodpecker, and this seemed to render the pervading silence and sense +of loneliness the more profound. The boy's soul was steeped in +melancholy; his feelings were in happy accord with his surroundings. He +sat long with his elbows on his knees and his chin in his hands, +meditating. It seemed to him that life was but a trouble, at best, and +he more than half envied Jimmy Hodges, so lately released; it must be +very peaceful, he thought, to lie and slumber and dream forever and +ever, with the wind whispering through the trees and caressing the +grass and the flowers over the grave, and nothing to bother and grieve +about, ever any more. If he only had a clean Sunday-school record he +could be willing to go, and be done with it all. Now as to this girl. +What had he done? Nothing. He had meant the best in the world, and been +treated like a dog--like a very dog. She would be sorry some day--maybe +when it was too late. Ah, if he could only die TEMPORARILY! + +But the elastic heart of youth cannot be compressed into one +constrained shape long at a time. Tom presently began to drift +insensibly back into the concerns of this life again. What if he turned +his back, now, and disappeared mysteriously? What if he went away--ever +so far away, into unknown countries beyond the seas--and never came +back any more! How would she feel then! The idea of being a clown +recurred to him now, only to fill him with disgust. For frivolity and +jokes and spotted tights were an offense, when they intruded themselves +upon a spirit that was exalted into the vague august realm of the +romantic. No, he would be a soldier, and return after long years, all +war-worn and illustrious. No--better still, he would join the Indians, +and hunt buffaloes and go on the warpath in the mountain ranges and the +trackless great plains of the Far West, and away in the future come +back a great chief, bristling with feathers, hideous with paint, and +prance into Sunday-school, some drowsy summer morning, with a +bloodcurdling war-whoop, and sear the eyeballs of all his companions +with unappeasable envy. But no, there was something gaudier even than +this. He would be a pirate! That was it! NOW his future lay plain +before him, and glowing with unimaginable splendor. How his name would +fill the world, and make people shudder! How gloriously he would go +plowing the dancing seas, in his long, low, black-hulled racer, the +Spirit of the Storm, with his grisly flag flying at the fore! And at +the zenith of his fame, how he would suddenly appear at the old village +and stalk into church, brown and weather-beaten, in his black velvet +doublet and trunks, his great jack-boots, his crimson sash, his belt +bristling with horse-pistols, his crime-rusted cutlass at his side, his +slouch hat with waving plumes, his black flag unfurled, with the skull +and crossbones on it, and hear with swelling ecstasy the whisperings, +"It's Tom Sawyer the Pirate!--the Black Avenger of the Spanish Main!" + +Yes, it was settled; his career was determined. He would run away from +home and enter upon it. He would start the very next morning. Therefore +he must now begin to get ready. He would collect his resources +together. He went to a rotten log near at hand and began to dig under +one end of it with his Barlow knife. He soon struck wood that sounded +hollow. He put his hand there and uttered this incantation impressively: + +"What hasn't come here, come! What's here, stay here!" + +Then he scraped away the dirt, and exposed a pine shingle. He took it +up and disclosed a shapely little treasure-house whose bottom and sides +were of shingles. In it lay a marble. Tom's astonishment was boundless! +He scratched his head with a perplexed air, and said: + +"Well, that beats anything!" + +Then he tossed the marble away pettishly, and stood cogitating. The +truth was, that a superstition of his had failed, here, which he and +all his comrades had always looked upon as infallible. If you buried a +marble with certain necessary incantations, and left it alone a +fortnight, and then opened the place with the incantation he had just +used, you would find that all the marbles you had ever lost had +gathered themselves together there, meantime, no matter how widely they +had been separated. But now, this thing had actually and unquestionably +failed. Tom's whole structure of faith was shaken to its foundations. +He had many a time heard of this thing succeeding but never of its +failing before. It did not occur to him that he had tried it several +times before, himself, but could never find the hiding-places +afterward. He puzzled over the matter some time, and finally decided +that some witch had interfered and broken the charm. He thought he +would satisfy himself on that point; so he searched around till he +found a small sandy spot with a little funnel-shaped depression in it. +He laid himself down and put his mouth close to this depression and +called-- + +"Doodle-bug, doodle-bug, tell me what I want to know! Doodle-bug, +doodle-bug, tell me what I want to know!" + +The sand began to work, and presently a small black bug appeared for a +second and then darted under again in a fright. + +"He dasn't tell! So it WAS a witch that done it. I just knowed it." + +He well knew the futility of trying to contend against witches, so he +gave up discouraged. But it occurred to him that he might as well have +the marble he had just thrown away, and therefore he went and made a +patient search for it. But he could not find it. Now he went back to +his treasure-house and carefully placed himself just as he had been +standing when he tossed the marble away; then he took another marble +from his pocket and tossed it in the same way, saying: + +"Brother, go find your brother!" + +He watched where it stopped, and went there and looked. But it must +have fallen short or gone too far; so he tried twice more. The last +repetition was successful. The two marbles lay within a foot of each +other. + +Just here the blast of a toy tin trumpet came faintly down the green +aisles of the forest. Tom flung off his jacket and trousers, turned a +suspender into a belt, raked away some brush behind the rotten log, +disclosing a rude bow and arrow, a lath sword and a tin trumpet, and in +a moment had seized these things and bounded away, barelegged, with +fluttering shirt. He presently halted under a great elm, blew an +answering blast, and then began to tiptoe and look warily out, this way +and that. He said cautiously--to an imaginary company: + +"Hold, my merry men! Keep hid till I blow." + +Now appeared Joe Harper, as airily clad and elaborately armed as Tom. +Tom called: + +"Hold! Who comes here into Sherwood Forest without my pass?" + +"Guy of Guisborne wants no man's pass. Who art thou that--that--" + +"Dares to hold such language," said Tom, prompting--for they talked +"by the book," from memory. + +"Who art thou that dares to hold such language?" + +"I, indeed! I am Robin Hood, as thy caitiff carcase soon shall know." + +"Then art thou indeed that famous outlaw? Right gladly will I dispute +with thee the passes of the merry wood. Have at thee!" + +They took their lath swords, dumped their other traps on the ground, +struck a fencing attitude, foot to foot, and began a grave, careful +combat, "two up and two down." Presently Tom said: + +"Now, if you've got the hang, go it lively!" + +So they "went it lively," panting and perspiring with the work. By and +by Tom shouted: + +"Fall! fall! Why don't you fall?" + +"I sha'n't! Why don't you fall yourself? You're getting the worst of +it." + +"Why, that ain't anything. I can't fall; that ain't the way it is in +the book. The book says, 'Then with one back-handed stroke he slew poor +Guy of Guisborne.' You're to turn around and let me hit you in the +back." + +There was no getting around the authorities, so Joe turned, received +the whack and fell. + +"Now," said Joe, getting up, "you got to let me kill YOU. That's fair." + +"Why, I can't do that, it ain't in the book." + +"Well, it's blamed mean--that's all." + +"Well, say, Joe, you can be Friar Tuck or Much the miller's son, and +lam me with a quarter-staff; or I'll be the Sheriff of Nottingham and +you be Robin Hood a little while and kill me." + +This was satisfactory, and so these adventures were carried out. Then +Tom became Robin Hood again, and was allowed by the treacherous nun to +bleed his strength away through his neglected wound. And at last Joe, +representing a whole tribe of weeping outlaws, dragged him sadly forth, +gave his bow into his feeble hands, and Tom said, "Where this arrow +falls, there bury poor Robin Hood under the greenwood tree." Then he +shot the arrow and fell back and would have died, but he lit on a +nettle and sprang up too gaily for a corpse. + +The boys dressed themselves, hid their accoutrements, and went off +grieving that there were no outlaws any more, and wondering what modern +civilization could claim to have done to compensate for their loss. +They said they would rather be outlaws a year in Sherwood Forest than +President of the United States forever. + + + +CHAPTER IX + +AT half-past nine, that night, Tom and Sid were sent to bed, as usual. +They said their prayers, and Sid was soon asleep. Tom lay awake and +waited, in restless impatience. When it seemed to him that it must be +nearly daylight, he heard the clock strike ten! This was despair. He +would have tossed and fidgeted, as his nerves demanded, but he was +afraid he might wake Sid. So he lay still, and stared up into the dark. +Everything was dismally still. By and by, out of the stillness, little, +scarcely perceptible noises began to emphasize themselves. The ticking +of the clock began to bring itself into notice. Old beams began to +crack mysteriously. The stairs creaked faintly. Evidently spirits were +abroad. A measured, muffled snore issued from Aunt Polly's chamber. And +now the tiresome chirping of a cricket that no human ingenuity could +locate, began. Next the ghastly ticking of a deathwatch in the wall at +the bed's head made Tom shudder--it meant that somebody's days were +numbered. Then the howl of a far-off dog rose on the night air, and was +answered by a fainter howl from a remoter distance. Tom was in an +agony. At last he was satisfied that time had ceased and eternity +begun; he began to doze, in spite of himself; the clock chimed eleven, +but he did not hear it. And then there came, mingling with his +half-formed dreams, a most melancholy caterwauling. The raising of a +neighboring window disturbed him. A cry of "Scat! you devil!" and the +crash of an empty bottle against the back of his aunt's woodshed +brought him wide awake, and a single minute later he was dressed and +out of the window and creeping along the roof of the "ell" on all +fours. He "meow'd" with caution once or twice, as he went; then jumped +to the roof of the woodshed and thence to the ground. Huckleberry Finn +was there, with his dead cat. The boys moved off and disappeared in the +gloom. At the end of half an hour they were wading through the tall +grass of the graveyard. + +It was a graveyard of the old-fashioned Western kind. It was on a +hill, about a mile and a half from the village. It had a crazy board +fence around it, which leaned inward in places, and outward the rest of +the time, but stood upright nowhere. Grass and weeds grew rank over the +whole cemetery. All the old graves were sunken in, there was not a +tombstone on the place; round-topped, worm-eaten boards staggered over +the graves, leaning for support and finding none. "Sacred to the memory +of" So-and-So had been painted on them once, but it could no longer +have been read, on the most of them, now, even if there had been light. + +A faint wind moaned through the trees, and Tom feared it might be the +spirits of the dead, complaining at being disturbed. The boys talked +little, and only under their breath, for the time and the place and the +pervading solemnity and silence oppressed their spirits. They found the +sharp new heap they were seeking, and ensconced themselves within the +protection of three great elms that grew in a bunch within a few feet +of the grave. + +Then they waited in silence for what seemed a long time. The hooting +of a distant owl was all the sound that troubled the dead stillness. +Tom's reflections grew oppressive. He must force some talk. So he said +in a whisper: + +"Hucky, do you believe the dead people like it for us to be here?" + +Huckleberry whispered: + +"I wisht I knowed. It's awful solemn like, AIN'T it?" + +"I bet it is." + +There was a considerable pause, while the boys canvassed this matter +inwardly. Then Tom whispered: + +"Say, Hucky--do you reckon Hoss Williams hears us talking?" + +"O' course he does. Least his sperrit does." + +Tom, after a pause: + +"I wish I'd said Mister Williams. But I never meant any harm. +Everybody calls him Hoss." + +"A body can't be too partic'lar how they talk 'bout these-yer dead +people, Tom." + +This was a damper, and conversation died again. + +Presently Tom seized his comrade's arm and said: + +"Sh!" + +"What is it, Tom?" And the two clung together with beating hearts. + +"Sh! There 'tis again! Didn't you hear it?" + +"I--" + +"There! Now you hear it." + +"Lord, Tom, they're coming! They're coming, sure. What'll we do?" + +"I dono. Think they'll see us?" + +"Oh, Tom, they can see in the dark, same as cats. I wisht I hadn't +come." + +"Oh, don't be afeard. I don't believe they'll bother us. We ain't +doing any harm. If we keep perfectly still, maybe they won't notice us +at all." + +"I'll try to, Tom, but, Lord, I'm all of a shiver." + +"Listen!" + +The boys bent their heads together and scarcely breathed. A muffled +sound of voices floated up from the far end of the graveyard. + +"Look! See there!" whispered Tom. "What is it?" + +"It's devil-fire. Oh, Tom, this is awful." + +Some vague figures approached through the gloom, swinging an +old-fashioned tin lantern that freckled the ground with innumerable +little spangles of light. Presently Huckleberry whispered with a +shudder: + +"It's the devils sure enough. Three of 'em! Lordy, Tom, we're goners! +Can you pray?" + +"I'll try, but don't you be afeard. They ain't going to hurt us. 'Now +I lay me down to sleep, I--'" + +"Sh!" + +"What is it, Huck?" + +"They're HUMANS! One of 'em is, anyway. One of 'em's old Muff Potter's +voice." + +"No--'tain't so, is it?" + +"I bet I know it. Don't you stir nor budge. He ain't sharp enough to +notice us. Drunk, the same as usual, likely--blamed old rip!" + +"All right, I'll keep still. Now they're stuck. Can't find it. Here +they come again. Now they're hot. Cold again. Hot again. Red hot! +They're p'inted right, this time. Say, Huck, I know another o' them +voices; it's Injun Joe." + +"That's so--that murderin' half-breed! I'd druther they was devils a +dern sight. What kin they be up to?" + +The whisper died wholly out, now, for the three men had reached the +grave and stood within a few feet of the boys' hiding-place. + +"Here it is," said the third voice; and the owner of it held the +lantern up and revealed the face of young Doctor Robinson. + +Potter and Injun Joe were carrying a handbarrow with a rope and a +couple of shovels on it. They cast down their load and began to open +the grave. The doctor put the lantern at the head of the grave and came +and sat down with his back against one of the elm trees. He was so +close the boys could have touched him. + +"Hurry, men!" he said, in a low voice; "the moon might come out at any +moment." + +They growled a response and went on digging. For some time there was +no noise but the grating sound of the spades discharging their freight +of mould and gravel. It was very monotonous. Finally a spade struck +upon the coffin with a dull woody accent, and within another minute or +two the men had hoisted it out on the ground. They pried off the lid +with their shovels, got out the body and dumped it rudely on the +ground. The moon drifted from behind the clouds and exposed the pallid +face. The barrow was got ready and the corpse placed on it, covered +with a blanket, and bound to its place with the rope. Potter took out a +large spring-knife and cut off the dangling end of the rope and then +said: + +"Now the cussed thing's ready, Sawbones, and you'll just out with +another five, or here she stays." + +"That's the talk!" said Injun Joe. + +"Look here, what does this mean?" said the doctor. "You required your +pay in advance, and I've paid you." + +"Yes, and you done more than that," said Injun Joe, approaching the +doctor, who was now standing. "Five years ago you drove me away from +your father's kitchen one night, when I come to ask for something to +eat, and you said I warn't there for any good; and when I swore I'd get +even with you if it took a hundred years, your father had me jailed for +a vagrant. Did you think I'd forget? The Injun blood ain't in me for +nothing. And now I've GOT you, and you got to SETTLE, you know!" + +He was threatening the doctor, with his fist in his face, by this +time. The doctor struck out suddenly and stretched the ruffian on the +ground. Potter dropped his knife, and exclaimed: + +"Here, now, don't you hit my pard!" and the next moment he had +grappled with the doctor and the two were struggling with might and +main, trampling the grass and tearing the ground with their heels. +Injun Joe sprang to his feet, his eyes flaming with passion, snatched +up Potter's knife, and went creeping, catlike and stooping, round and +round about the combatants, seeking an opportunity. All at once the +doctor flung himself free, seized the heavy headboard of Williams' +grave and felled Potter to the earth with it--and in the same instant +the half-breed saw his chance and drove the knife to the hilt in the +young man's breast. He reeled and fell partly upon Potter, flooding him +with his blood, and in the same moment the clouds blotted out the +dreadful spectacle and the two frightened boys went speeding away in +the dark. + +Presently, when the moon emerged again, Injun Joe was standing over +the two forms, contemplating them. The doctor murmured inarticulately, +gave a long gasp or two and was still. The half-breed muttered: + +"THAT score is settled--damn you." + +Then he robbed the body. After which he put the fatal knife in +Potter's open right hand, and sat down on the dismantled coffin. Three +--four--five minutes passed, and then Potter began to stir and moan. His +hand closed upon the knife; he raised it, glanced at it, and let it +fall, with a shudder. Then he sat up, pushing the body from him, and +gazed at it, and then around him, confusedly. His eyes met Joe's. + +"Lord, how is this, Joe?" he said. + +"It's a dirty business," said Joe, without moving. + +"What did you do it for?" + +"I! I never done it!" + +"Look here! That kind of talk won't wash." + +Potter trembled and grew white. + +"I thought I'd got sober. I'd no business to drink to-night. But it's +in my head yet--worse'n when we started here. I'm all in a muddle; +can't recollect anything of it, hardly. Tell me, Joe--HONEST, now, old +feller--did I do it? Joe, I never meant to--'pon my soul and honor, I +never meant to, Joe. Tell me how it was, Joe. Oh, it's awful--and him +so young and promising." + +"Why, you two was scuffling, and he fetched you one with the headboard +and you fell flat; and then up you come, all reeling and staggering +like, and snatched the knife and jammed it into him, just as he fetched +you another awful clip--and here you've laid, as dead as a wedge til +now." + +"Oh, I didn't know what I was a-doing. I wish I may die this minute if +I did. It was all on account of the whiskey and the excitement, I +reckon. I never used a weepon in my life before, Joe. I've fought, but +never with weepons. They'll all say that. Joe, don't tell! Say you +won't tell, Joe--that's a good feller. I always liked you, Joe, and +stood up for you, too. Don't you remember? You WON'T tell, WILL you, +Joe?" And the poor creature dropped on his knees before the stolid +murderer, and clasped his appealing hands. + +"No, you've always been fair and square with me, Muff Potter, and I +won't go back on you. There, now, that's as fair as a man can say." + +"Oh, Joe, you're an angel. I'll bless you for this the longest day I +live." And Potter began to cry. + +"Come, now, that's enough of that. This ain't any time for blubbering. +You be off yonder way and I'll go this. Move, now, and don't leave any +tracks behind you." + +Potter started on a trot that quickly increased to a run. The +half-breed stood looking after him. He muttered: + +"If he's as much stunned with the lick and fuddled with the rum as he +had the look of being, he won't think of the knife till he's gone so +far he'll be afraid to come back after it to such a place by himself +--chicken-heart!" + +Two or three minutes later the murdered man, the blanketed corpse, the +lidless coffin, and the open grave were under no inspection but the +moon's. The stillness was complete again, too. + + + +CHAPTER X + +THE two boys flew on and on, toward the village, speechless with +horror. They glanced backward over their shoulders from time to time, +apprehensively, as if they feared they might be followed. Every stump +that started up in their path seemed a man and an enemy, and made them +catch their breath; and as they sped by some outlying cottages that lay +near the village, the barking of the aroused watch-dogs seemed to give +wings to their feet. + +"If we can only get to the old tannery before we break down!" +whispered Tom, in short catches between breaths. "I can't stand it much +longer." + +Huckleberry's hard pantings were his only reply, and the boys fixed +their eyes on the goal of their hopes and bent to their work to win it. +They gained steadily on it, and at last, breast to breast, they burst +through the open door and fell grateful and exhausted in the sheltering +shadows beyond. By and by their pulses slowed down, and Tom whispered: + +"Huckleberry, what do you reckon'll come of this?" + +"If Doctor Robinson dies, I reckon hanging'll come of it." + +"Do you though?" + +"Why, I KNOW it, Tom." + +Tom thought a while, then he said: + +"Who'll tell? We?" + +"What are you talking about? S'pose something happened and Injun Joe +DIDN'T hang? Why, he'd kill us some time or other, just as dead sure as +we're a laying here." + +"That's just what I was thinking to myself, Huck." + +"If anybody tells, let Muff Potter do it, if he's fool enough. He's +generally drunk enough." + +Tom said nothing--went on thinking. Presently he whispered: + +"Huck, Muff Potter don't know it. How can he tell?" + +"What's the reason he don't know it?" + +"Because he'd just got that whack when Injun Joe done it. D'you reckon +he could see anything? D'you reckon he knowed anything?" + +"By hokey, that's so, Tom!" + +"And besides, look-a-here--maybe that whack done for HIM!" + +"No, 'taint likely, Tom. He had liquor in him; I could see that; and +besides, he always has. Well, when pap's full, you might take and belt +him over the head with a church and you couldn't phase him. He says so, +his own self. So it's the same with Muff Potter, of course. But if a +man was dead sober, I reckon maybe that whack might fetch him; I dono." + +After another reflective silence, Tom said: + +"Hucky, you sure you can keep mum?" + +"Tom, we GOT to keep mum. You know that. That Injun devil wouldn't +make any more of drownding us than a couple of cats, if we was to +squeak 'bout this and they didn't hang him. Now, look-a-here, Tom, less +take and swear to one another--that's what we got to do--swear to keep +mum." + +"I'm agreed. It's the best thing. Would you just hold hands and swear +that we--" + +"Oh no, that wouldn't do for this. That's good enough for little +rubbishy common things--specially with gals, cuz THEY go back on you +anyway, and blab if they get in a huff--but there orter be writing +'bout a big thing like this. And blood." + +Tom's whole being applauded this idea. It was deep, and dark, and +awful; the hour, the circumstances, the surroundings, were in keeping +with it. He picked up a clean pine shingle that lay in the moonlight, +took a little fragment of "red keel" out of his pocket, got the moon on +his work, and painfully scrawled these lines, emphasizing each slow +down-stroke by clamping his tongue between his teeth, and letting up +the pressure on the up-strokes. [See next page.] + + "Huck Finn and + Tom Sawyer swears + they will keep mum + about This and They + wish They may Drop + down dead in Their + Tracks if They ever + Tell and Rot." + +Huckleberry was filled with admiration of Tom's facility in writing, +and the sublimity of his language. He at once took a pin from his lapel +and was going to prick his flesh, but Tom said: + +"Hold on! Don't do that. A pin's brass. It might have verdigrease on +it." + +"What's verdigrease?" + +"It's p'ison. That's what it is. You just swaller some of it once +--you'll see." + +So Tom unwound the thread from one of his needles, and each boy +pricked the ball of his thumb and squeezed out a drop of blood. In +time, after many squeezes, Tom managed to sign his initials, using the +ball of his little finger for a pen. Then he showed Huckleberry how to +make an H and an F, and the oath was complete. They buried the shingle +close to the wall, with some dismal ceremonies and incantations, and +the fetters that bound their tongues were considered to be locked and +the key thrown away. + +A figure crept stealthily through a break in the other end of the +ruined building, now, but they did not notice it. + +"Tom," whispered Huckleberry, "does this keep us from EVER telling +--ALWAYS?" + +"Of course it does. It don't make any difference WHAT happens, we got +to keep mum. We'd drop down dead--don't YOU know that?" + +"Yes, I reckon that's so." + +They continued to whisper for some little time. Presently a dog set up +a long, lugubrious howl just outside--within ten feet of them. The boys +clasped each other suddenly, in an agony of fright. + +"Which of us does he mean?" gasped Huckleberry. + +"I dono--peep through the crack. Quick!" + +"No, YOU, Tom!" + +"I can't--I can't DO it, Huck!" + +"Please, Tom. There 'tis again!" + +"Oh, lordy, I'm thankful!" whispered Tom. "I know his voice. It's Bull +Harbison." * + +[* If Mr. Harbison owned a slave named Bull, Tom would have spoken of +him as "Harbison's Bull," but a son or a dog of that name was "Bull +Harbison."] + +"Oh, that's good--I tell you, Tom, I was most scared to death; I'd a +bet anything it was a STRAY dog." + +The dog howled again. The boys' hearts sank once more. + +"Oh, my! that ain't no Bull Harbison!" whispered Huckleberry. "DO, Tom!" + +Tom, quaking with fear, yielded, and put his eye to the crack. His +whisper was hardly audible when he said: + +"Oh, Huck, IT S A STRAY DOG!" + +"Quick, Tom, quick! Who does he mean?" + +"Huck, he must mean us both--we're right together." + +"Oh, Tom, I reckon we're goners. I reckon there ain't no mistake 'bout +where I'LL go to. I been so wicked." + +"Dad fetch it! This comes of playing hookey and doing everything a +feller's told NOT to do. I might a been good, like Sid, if I'd a tried +--but no, I wouldn't, of course. But if ever I get off this time, I lay +I'll just WALLER in Sunday-schools!" And Tom began to snuffle a little. + +"YOU bad!" and Huckleberry began to snuffle too. "Consound it, Tom +Sawyer, you're just old pie, 'longside o' what I am. Oh, LORDY, lordy, +lordy, I wisht I only had half your chance." + +Tom choked off and whispered: + +"Look, Hucky, look! He's got his BACK to us!" + +Hucky looked, with joy in his heart. + +"Well, he has, by jingoes! Did he before?" + +"Yes, he did. But I, like a fool, never thought. Oh, this is bully, +you know. NOW who can he mean?" + +The howling stopped. Tom pricked up his ears. + +"Sh! What's that?" he whispered. + +"Sounds like--like hogs grunting. No--it's somebody snoring, Tom." + +"That IS it! Where 'bouts is it, Huck?" + +"I bleeve it's down at 'tother end. Sounds so, anyway. Pap used to +sleep there, sometimes, 'long with the hogs, but laws bless you, he +just lifts things when HE snores. Besides, I reckon he ain't ever +coming back to this town any more." + +The spirit of adventure rose in the boys' souls once more. + +"Hucky, do you das't to go if I lead?" + +"I don't like to, much. Tom, s'pose it's Injun Joe!" + +Tom quailed. But presently the temptation rose up strong again and the +boys agreed to try, with the understanding that they would take to +their heels if the snoring stopped. So they went tiptoeing stealthily +down, the one behind the other. When they had got to within five steps +of the snorer, Tom stepped on a stick, and it broke with a sharp snap. +The man moaned, writhed a little, and his face came into the moonlight. +It was Muff Potter. The boys' hearts had stood still, and their hopes +too, when the man moved, but their fears passed away now. They tiptoed +out, through the broken weather-boarding, and stopped at a little +distance to exchange a parting word. That long, lugubrious howl rose on +the night air again! They turned and saw the strange dog standing +within a few feet of where Potter was lying, and FACING Potter, with +his nose pointing heavenward. + +"Oh, geeminy, it's HIM!" exclaimed both boys, in a breath. + +"Say, Tom--they say a stray dog come howling around Johnny Miller's +house, 'bout midnight, as much as two weeks ago; and a whippoorwill +come in and lit on the banisters and sung, the very same evening; and +there ain't anybody dead there yet." + +"Well, I know that. And suppose there ain't. Didn't Gracie Miller fall +in the kitchen fire and burn herself terrible the very next Saturday?" + +"Yes, but she ain't DEAD. And what's more, she's getting better, too." + +"All right, you wait and see. She's a goner, just as dead sure as Muff +Potter's a goner. That's what the niggers say, and they know all about +these kind of things, Huck." + +Then they separated, cogitating. When Tom crept in at his bedroom +window the night was almost spent. He undressed with excessive caution, +and fell asleep congratulating himself that nobody knew of his +escapade. He was not aware that the gently-snoring Sid was awake, and +had been so for an hour. + +When Tom awoke, Sid was dressed and gone. There was a late look in the +light, a late sense in the atmosphere. He was startled. Why had he not +been called--persecuted till he was up, as usual? The thought filled +him with bodings. Within five minutes he was dressed and down-stairs, +feeling sore and drowsy. The family were still at table, but they had +finished breakfast. There was no voice of rebuke; but there were +averted eyes; there was a silence and an air of solemnity that struck a +chill to the culprit's heart. He sat down and tried to seem gay, but it +was up-hill work; it roused no smile, no response, and he lapsed into +silence and let his heart sink down to the depths. + +After breakfast his aunt took him aside, and Tom almost brightened in +the hope that he was going to be flogged; but it was not so. His aunt +wept over him and asked him how he could go and break her old heart so; +and finally told him to go on, and ruin himself and bring her gray +hairs with sorrow to the grave, for it was no use for her to try any +more. This was worse than a thousand whippings, and Tom's heart was +sorer now than his body. He cried, he pleaded for forgiveness, promised +to reform over and over again, and then received his dismissal, feeling +that he had won but an imperfect forgiveness and established but a +feeble confidence. + +He left the presence too miserable to even feel revengeful toward Sid; +and so the latter's prompt retreat through the back gate was +unnecessary. He moped to school gloomy and sad, and took his flogging, +along with Joe Harper, for playing hookey the day before, with the air +of one whose heart was busy with heavier woes and wholly dead to +trifles. Then he betook himself to his seat, rested his elbows on his +desk and his jaws in his hands, and stared at the wall with the stony +stare of suffering that has reached the limit and can no further go. +His elbow was pressing against some hard substance. After a long time +he slowly and sadly changed his position, and took up this object with +a sigh. It was in a paper. He unrolled it. A long, lingering, colossal +sigh followed, and his heart broke. It was his brass andiron knob! + +This final feather broke the camel's back. + + + +CHAPTER XI + +CLOSE upon the hour of noon the whole village was suddenly electrified +with the ghastly news. No need of the as yet undreamed-of telegraph; +the tale flew from man to man, from group to group, from house to +house, with little less than telegraphic speed. Of course the +schoolmaster gave holiday for that afternoon; the town would have +thought strangely of him if he had not. + +A gory knife had been found close to the murdered man, and it had been +recognized by somebody as belonging to Muff Potter--so the story ran. +And it was said that a belated citizen had come upon Potter washing +himself in the "branch" about one or two o'clock in the morning, and +that Potter had at once sneaked off--suspicious circumstances, +especially the washing which was not a habit with Potter. It was also +said that the town had been ransacked for this "murderer" (the public +are not slow in the matter of sifting evidence and arriving at a +verdict), but that he could not be found. Horsemen had departed down +all the roads in every direction, and the Sheriff "was confident" that +he would be captured before night. + +All the town was drifting toward the graveyard. Tom's heartbreak +vanished and he joined the procession, not because he would not a +thousand times rather go anywhere else, but because an awful, +unaccountable fascination drew him on. Arrived at the dreadful place, +he wormed his small body through the crowd and saw the dismal +spectacle. It seemed to him an age since he was there before. Somebody +pinched his arm. He turned, and his eyes met Huckleberry's. Then both +looked elsewhere at once, and wondered if anybody had noticed anything +in their mutual glance. But everybody was talking, and intent upon the +grisly spectacle before them. + +"Poor fellow!" "Poor young fellow!" "This ought to be a lesson to +grave robbers!" "Muff Potter'll hang for this if they catch him!" This +was the drift of remark; and the minister said, "It was a judgment; His +hand is here." + +Now Tom shivered from head to heel; for his eye fell upon the stolid +face of Injun Joe. At this moment the crowd began to sway and struggle, +and voices shouted, "It's him! it's him! he's coming himself!" + +"Who? Who?" from twenty voices. + +"Muff Potter!" + +"Hallo, he's stopped!--Look out, he's turning! Don't let him get away!" + +People in the branches of the trees over Tom's head said he wasn't +trying to get away--he only looked doubtful and perplexed. + +"Infernal impudence!" said a bystander; "wanted to come and take a +quiet look at his work, I reckon--didn't expect any company." + +The crowd fell apart, now, and the Sheriff came through, +ostentatiously leading Potter by the arm. The poor fellow's face was +haggard, and his eyes showed the fear that was upon him. When he stood +before the murdered man, he shook as with a palsy, and he put his face +in his hands and burst into tears. + +"I didn't do it, friends," he sobbed; "'pon my word and honor I never +done it." + +"Who's accused you?" shouted a voice. + +This shot seemed to carry home. Potter lifted his face and looked +around him with a pathetic hopelessness in his eyes. He saw Injun Joe, +and exclaimed: + +"Oh, Injun Joe, you promised me you'd never--" + +"Is that your knife?" and it was thrust before him by the Sheriff. + +Potter would have fallen if they had not caught him and eased him to +the ground. Then he said: + +"Something told me 't if I didn't come back and get--" He shuddered; +then waved his nerveless hand with a vanquished gesture and said, "Tell +'em, Joe, tell 'em--it ain't any use any more." + +Then Huckleberry and Tom stood dumb and staring, and heard the +stony-hearted liar reel off his serene statement, they expecting every +moment that the clear sky would deliver God's lightnings upon his head, +and wondering to see how long the stroke was delayed. And when he had +finished and still stood alive and whole, their wavering impulse to +break their oath and save the poor betrayed prisoner's life faded and +vanished away, for plainly this miscreant had sold himself to Satan and +it would be fatal to meddle with the property of such a power as that. + +"Why didn't you leave? What did you want to come here for?" somebody +said. + +"I couldn't help it--I couldn't help it," Potter moaned. "I wanted to +run away, but I couldn't seem to come anywhere but here." And he fell +to sobbing again. + +Injun Joe repeated his statement, just as calmly, a few minutes +afterward on the inquest, under oath; and the boys, seeing that the +lightnings were still withheld, were confirmed in their belief that Joe +had sold himself to the devil. He was now become, to them, the most +balefully interesting object they had ever looked upon, and they could +not take their fascinated eyes from his face. + +They inwardly resolved to watch him nights, when opportunity should +offer, in the hope of getting a glimpse of his dread master. + +Injun Joe helped to raise the body of the murdered man and put it in a +wagon for removal; and it was whispered through the shuddering crowd +that the wound bled a little! The boys thought that this happy +circumstance would turn suspicion in the right direction; but they were +disappointed, for more than one villager remarked: + +"It was within three feet of Muff Potter when it done it." + +Tom's fearful secret and gnawing conscience disturbed his sleep for as +much as a week after this; and at breakfast one morning Sid said: + +"Tom, you pitch around and talk in your sleep so much that you keep me +awake half the time." + +Tom blanched and dropped his eyes. + +"It's a bad sign," said Aunt Polly, gravely. "What you got on your +mind, Tom?" + +"Nothing. Nothing 't I know of." But the boy's hand shook so that he +spilled his coffee. + +"And you do talk such stuff," Sid said. "Last night you said, 'It's +blood, it's blood, that's what it is!' You said that over and over. And +you said, 'Don't torment me so--I'll tell!' Tell WHAT? What is it +you'll tell?" + +Everything was swimming before Tom. There is no telling what might +have happened, now, but luckily the concern passed out of Aunt Polly's +face and she came to Tom's relief without knowing it. She said: + +"Sho! It's that dreadful murder. I dream about it most every night +myself. Sometimes I dream it's me that done it." + +Mary said she had been affected much the same way. Sid seemed +satisfied. Tom got out of the presence as quick as he plausibly could, +and after that he complained of toothache for a week, and tied up his +jaws every night. He never knew that Sid lay nightly watching, and +frequently slipped the bandage free and then leaned on his elbow +listening a good while at a time, and afterward slipped the bandage +back to its place again. Tom's distress of mind wore off gradually and +the toothache grew irksome and was discarded. If Sid really managed to +make anything out of Tom's disjointed mutterings, he kept it to himself. + +It seemed to Tom that his schoolmates never would get done holding +inquests on dead cats, and thus keeping his trouble present to his +mind. Sid noticed that Tom never was coroner at one of these inquiries, +though it had been his habit to take the lead in all new enterprises; +he noticed, too, that Tom never acted as a witness--and that was +strange; and Sid did not overlook the fact that Tom even showed a +marked aversion to these inquests, and always avoided them when he +could. Sid marvelled, but said nothing. However, even inquests went out +of vogue at last, and ceased to torture Tom's conscience. + +Every day or two, during this time of sorrow, Tom watched his +opportunity and went to the little grated jail-window and smuggled such +small comforts through to the "murderer" as he could get hold of. The +jail was a trifling little brick den that stood in a marsh at the edge +of the village, and no guards were afforded for it; indeed, it was +seldom occupied. These offerings greatly helped to ease Tom's +conscience. + +The villagers had a strong desire to tar-and-feather Injun Joe and +ride him on a rail, for body-snatching, but so formidable was his +character that nobody could be found who was willing to take the lead +in the matter, so it was dropped. He had been careful to begin both of +his inquest-statements with the fight, without confessing the +grave-robbery that preceded it; therefore it was deemed wisest not +to try the case in the courts at present. + + + +CHAPTER XII + +ONE of the reasons why Tom's mind had drifted away from its secret +troubles was, that it had found a new and weighty matter to interest +itself about. Becky Thatcher had stopped coming to school. Tom had +struggled with his pride a few days, and tried to "whistle her down the +wind," but failed. He began to find himself hanging around her father's +house, nights, and feeling very miserable. She was ill. What if she +should die! There was distraction in the thought. He no longer took an +interest in war, nor even in piracy. The charm of life was gone; there +was nothing but dreariness left. He put his hoop away, and his bat; +there was no joy in them any more. His aunt was concerned. She began to +try all manner of remedies on him. She was one of those people who are +infatuated with patent medicines and all new-fangled methods of +producing health or mending it. She was an inveterate experimenter in +these things. When something fresh in this line came out she was in a +fever, right away, to try it; not on herself, for she was never ailing, +but on anybody else that came handy. She was a subscriber for all the +"Health" periodicals and phrenological frauds; and the solemn ignorance +they were inflated with was breath to her nostrils. All the "rot" they +contained about ventilation, and how to go to bed, and how to get up, +and what to eat, and what to drink, and how much exercise to take, and +what frame of mind to keep one's self in, and what sort of clothing to +wear, was all gospel to her, and she never observed that her +health-journals of the current month customarily upset everything they +had recommended the month before. She was as simple-hearted and honest +as the day was long, and so she was an easy victim. She gathered +together her quack periodicals and her quack medicines, and thus armed +with death, went about on her pale horse, metaphorically speaking, with +"hell following after." But she never suspected that she was not an +angel of healing and the balm of Gilead in disguise, to the suffering +neighbors. + +The water treatment was new, now, and Tom's low condition was a +windfall to her. She had him out at daylight every morning, stood him +up in the woodshed and drowned him with a deluge of cold water; then +she scrubbed him down with a towel like a file, and so brought him to; +then she rolled him up in a wet sheet and put him away under blankets +till she sweated his soul clean and "the yellow stains of it came +through his pores"--as Tom said. + +Yet notwithstanding all this, the boy grew more and more melancholy +and pale and dejected. She added hot baths, sitz baths, shower baths, +and plunges. The boy remained as dismal as a hearse. She began to +assist the water with a slim oatmeal diet and blister-plasters. She +calculated his capacity as she would a jug's, and filled him up every +day with quack cure-alls. + +Tom had become indifferent to persecution by this time. This phase +filled the old lady's heart with consternation. This indifference must +be broken up at any cost. Now she heard of Pain-killer for the first +time. She ordered a lot at once. She tasted it and was filled with +gratitude. It was simply fire in a liquid form. She dropped the water +treatment and everything else, and pinned her faith to Pain-killer. She +gave Tom a teaspoonful and watched with the deepest anxiety for the +result. Her troubles were instantly at rest, her soul at peace again; +for the "indifference" was broken up. The boy could not have shown a +wilder, heartier interest, if she had built a fire under him. + +Tom felt that it was time to wake up; this sort of life might be +romantic enough, in his blighted condition, but it was getting to have +too little sentiment and too much distracting variety about it. So he +thought over various plans for relief, and finally hit pon that of +professing to be fond of Pain-killer. He asked for it so often that he +became a nuisance, and his aunt ended by telling him to help himself +and quit bothering her. If it had been Sid, she would have had no +misgivings to alloy her delight; but since it was Tom, she watched the +bottle clandestinely. She found that the medicine did really diminish, +but it did not occur to her that the boy was mending the health of a +crack in the sitting-room floor with it. + +One day Tom was in the act of dosing the crack when his aunt's yellow +cat came along, purring, eying the teaspoon avariciously, and begging +for a taste. Tom said: + +"Don't ask for it unless you want it, Peter." + +But Peter signified that he did want it. + +"You better make sure." + +Peter was sure. + +"Now you've asked for it, and I'll give it to you, because there ain't +anything mean about me; but if you find you don't like it, you mustn't +blame anybody but your own self." + +Peter was agreeable. So Tom pried his mouth open and poured down the +Pain-killer. Peter sprang a couple of yards in the air, and then +delivered a war-whoop and set off round and round the room, banging +against furniture, upsetting flower-pots, and making general havoc. +Next he rose on his hind feet and pranced around, in a frenzy of +enjoyment, with his head over his shoulder and his voice proclaiming +his unappeasable happiness. Then he went tearing around the house again +spreading chaos and destruction in his path. Aunt Polly entered in time +to see him throw a few double summersets, deliver a final mighty +hurrah, and sail through the open window, carrying the rest of the +flower-pots with him. The old lady stood petrified with astonishment, +peering over her glasses; Tom lay on the floor expiring with laughter. + +"Tom, what on earth ails that cat?" + +"I don't know, aunt," gasped the boy. + +"Why, I never see anything like it. What did make him act so?" + +"Deed I don't know, Aunt Polly; cats always act so when they're having +a good time." + +"They do, do they?" There was something in the tone that made Tom +apprehensive. + +"Yes'm. That is, I believe they do." + +"You DO?" + +"Yes'm." + +The old lady was bending down, Tom watching, with interest emphasized +by anxiety. Too late he divined her "drift." The handle of the telltale +teaspoon was visible under the bed-valance. Aunt Polly took it, held it +up. Tom winced, and dropped his eyes. Aunt Polly raised him by the +usual handle--his ear--and cracked his head soundly with her thimble. + +"Now, sir, what did you want to treat that poor dumb beast so, for?" + +"I done it out of pity for him--because he hadn't any aunt." + +"Hadn't any aunt!--you numskull. What has that got to do with it?" + +"Heaps. Because if he'd had one she'd a burnt him out herself! She'd a +roasted his bowels out of him 'thout any more feeling than if he was a +human!" + +Aunt Polly felt a sudden pang of remorse. This was putting the thing +in a new light; what was cruelty to a cat MIGHT be cruelty to a boy, +too. She began to soften; she felt sorry. Her eyes watered a little, +and she put her hand on Tom's head and said gently: + +"I was meaning for the best, Tom. And, Tom, it DID do you good." + +Tom looked up in her face with just a perceptible twinkle peeping +through his gravity. + +"I know you was meaning for the best, aunty, and so was I with Peter. +It done HIM good, too. I never see him get around so since--" + +"Oh, go 'long with you, Tom, before you aggravate me again. And you +try and see if you can't be a good boy, for once, and you needn't take +any more medicine." + +Tom reached school ahead of time. It was noticed that this strange +thing had been occurring every day latterly. And now, as usual of late, +he hung about the gate of the schoolyard instead of playing with his +comrades. He was sick, he said, and he looked it. He tried to seem to +be looking everywhere but whither he really was looking--down the road. +Presently Jeff Thatcher hove in sight, and Tom's face lighted; he gazed +a moment, and then turned sorrowfully away. When Jeff arrived, Tom +accosted him; and "led up" warily to opportunities for remark about +Becky, but the giddy lad never could see the bait. Tom watched and +watched, hoping whenever a frisking frock came in sight, and hating the +owner of it as soon as he saw she was not the right one. At last frocks +ceased to appear, and he dropped hopelessly into the dumps; he entered +the empty schoolhouse and sat down to suffer. Then one more frock +passed in at the gate, and Tom's heart gave a great bound. The next +instant he was out, and "going on" like an Indian; yelling, laughing, +chasing boys, jumping over the fence at risk of life and limb, throwing +handsprings, standing on his head--doing all the heroic things he could +conceive of, and keeping a furtive eye out, all the while, to see if +Becky Thatcher was noticing. But she seemed to be unconscious of it +all; she never looked. Could it be possible that she was not aware that +he was there? He carried his exploits to her immediate vicinity; came +war-whooping around, snatched a boy's cap, hurled it to the roof of the +schoolhouse, broke through a group of boys, tumbling them in every +direction, and fell sprawling, himself, under Becky's nose, almost +upsetting her--and she turned, with her nose in the air, and he heard +her say: "Mf! some people think they're mighty smart--always showing +off!" + +Tom's cheeks burned. He gathered himself up and sneaked off, crushed +and crestfallen. + + + +CHAPTER XIII + +TOM'S mind was made up now. He was gloomy and desperate. He was a +forsaken, friendless boy, he said; nobody loved him; when they found +out what they had driven him to, perhaps they would be sorry; he had +tried to do right and get along, but they would not let him; since +nothing would do them but to be rid of him, let it be so; and let them +blame HIM for the consequences--why shouldn't they? What right had the +friendless to complain? Yes, they had forced him to it at last: he +would lead a life of crime. There was no choice. + +By this time he was far down Meadow Lane, and the bell for school to +"take up" tinkled faintly upon his ear. He sobbed, now, to think he +should never, never hear that old familiar sound any more--it was very +hard, but it was forced on him; since he was driven out into the cold +world, he must submit--but he forgave them. Then the sobs came thick +and fast. + +Just at this point he met his soul's sworn comrade, Joe Harper +--hard-eyed, and with evidently a great and dismal purpose in his heart. +Plainly here were "two souls with but a single thought." Tom, wiping +his eyes with his sleeve, began to blubber out something about a +resolution to escape from hard usage and lack of sympathy at home by +roaming abroad into the great world never to return; and ended by +hoping that Joe would not forget him. + +But it transpired that this was a request which Joe had just been +going to make of Tom, and had come to hunt him up for that purpose. His +mother had whipped him for drinking some cream which he had never +tasted and knew nothing about; it was plain that she was tired of him +and wished him to go; if she felt that way, there was nothing for him +to do but succumb; he hoped she would be happy, and never regret having +driven her poor boy out into the unfeeling world to suffer and die. + +As the two boys walked sorrowing along, they made a new compact to +stand by each other and be brothers and never separate till death +relieved them of their troubles. Then they began to lay their plans. +Joe was for being a hermit, and living on crusts in a remote cave, and +dying, some time, of cold and want and grief; but after listening to +Tom, he conceded that there were some conspicuous advantages about a +life of crime, and so he consented to be a pirate. + +Three miles below St. Petersburg, at a point where the Mississippi +River was a trifle over a mile wide, there was a long, narrow, wooded +island, with a shallow bar at the head of it, and this offered well as +a rendezvous. It was not inhabited; it lay far over toward the further +shore, abreast a dense and almost wholly unpeopled forest. So Jackson's +Island was chosen. Who were to be the subjects of their piracies was a +matter that did not occur to them. Then they hunted up Huckleberry +Finn, and he joined them promptly, for all careers were one to him; he +was indifferent. They presently separated to meet at a lonely spot on +the river-bank two miles above the village at the favorite hour--which +was midnight. There was a small log raft there which they meant to +capture. Each would bring hooks and lines, and such provision as he +could steal in the most dark and mysterious way--as became outlaws. And +before the afternoon was done, they had all managed to enjoy the sweet +glory of spreading the fact that pretty soon the town would "hear +something." All who got this vague hint were cautioned to "be mum and +wait." + +About midnight Tom arrived with a boiled ham and a few trifles, +and stopped in a dense undergrowth on a small bluff overlooking the +meeting-place. It was starlight, and very still. The mighty river lay +like an ocean at rest. Tom listened a moment, but no sound disturbed the +quiet. Then he gave a low, distinct whistle. It was answered from under +the bluff. Tom whistled twice more; these signals were answered in the +same way. Then a guarded voice said: + +"Who goes there?" + +"Tom Sawyer, the Black Avenger of the Spanish Main. Name your names." + +"Huck Finn the Red-Handed, and Joe Harper the Terror of the Seas." Tom +had furnished these titles, from his favorite literature. + +"'Tis well. Give the countersign." + +Two hoarse whispers delivered the same awful word simultaneously to +the brooding night: + +"BLOOD!" + +Then Tom tumbled his ham over the bluff and let himself down after it, +tearing both skin and clothes to some extent in the effort. There was +an easy, comfortable path along the shore under the bluff, but it +lacked the advantages of difficulty and danger so valued by a pirate. + +The Terror of the Seas had brought a side of bacon, and had about worn +himself out with getting it there. Finn the Red-Handed had stolen a +skillet and a quantity of half-cured leaf tobacco, and had also brought +a few corn-cobs to make pipes with. But none of the pirates smoked or +"chewed" but himself. The Black Avenger of the Spanish Main said it +would never do to start without some fire. That was a wise thought; +matches were hardly known there in that day. They saw a fire +smouldering upon a great raft a hundred yards above, and they went +stealthily thither and helped themselves to a chunk. They made an +imposing adventure of it, saying, "Hist!" every now and then, and +suddenly halting with finger on lip; moving with hands on imaginary +dagger-hilts; and giving orders in dismal whispers that if "the foe" +stirred, to "let him have it to the hilt," because "dead men tell no +tales." They knew well enough that the raftsmen were all down at the +village laying in stores or having a spree, but still that was no +excuse for their conducting this thing in an unpiratical way. + +They shoved off, presently, Tom in command, Huck at the after oar and +Joe at the forward. Tom stood amidships, gloomy-browed, and with folded +arms, and gave his orders in a low, stern whisper: + +"Luff, and bring her to the wind!" + +"Aye-aye, sir!" + +"Steady, steady-y-y-y!" + +"Steady it is, sir!" + +"Let her go off a point!" + +"Point it is, sir!" + +As the boys steadily and monotonously drove the raft toward mid-stream +it was no doubt understood that these orders were given only for +"style," and were not intended to mean anything in particular. + +"What sail's she carrying?" + +"Courses, tops'ls, and flying-jib, sir." + +"Send the r'yals up! Lay out aloft, there, half a dozen of ye +--foretopmaststuns'l! Lively, now!" + +"Aye-aye, sir!" + +"Shake out that maintogalans'l! Sheets and braces! NOW my hearties!" + +"Aye-aye, sir!" + +"Hellum-a-lee--hard a port! Stand by to meet her when she comes! Port, +port! NOW, men! With a will! Stead-y-y-y!" + +"Steady it is, sir!" + +The raft drew beyond the middle of the river; the boys pointed her +head right, and then lay on their oars. The river was not high, so +there was not more than a two or three mile current. Hardly a word was +said during the next three-quarters of an hour. Now the raft was +passing before the distant town. Two or three glimmering lights showed +where it lay, peacefully sleeping, beyond the vague vast sweep of +star-gemmed water, unconscious of the tremendous event that was happening. +The Black Avenger stood still with folded arms, "looking his last" upon +the scene of his former joys and his later sufferings, and wishing +"she" could see him now, abroad on the wild sea, facing peril and death +with dauntless heart, going to his doom with a grim smile on his lips. +It was but a small strain on his imagination to remove Jackson's Island +beyond eyeshot of the village, and so he "looked his last" with a +broken and satisfied heart. The other pirates were looking their last, +too; and they all looked so long that they came near letting the +current drift them out of the range of the island. But they discovered +the danger in time, and made shift to avert it. About two o'clock in +the morning the raft grounded on the bar two hundred yards above the +head of the island, and they waded back and forth until they had landed +their freight. Part of the little raft's belongings consisted of an old +sail, and this they spread over a nook in the bushes for a tent to +shelter their provisions; but they themselves would sleep in the open +air in good weather, as became outlaws. + +They built a fire against the side of a great log twenty or thirty +steps within the sombre depths of the forest, and then cooked some +bacon in the frying-pan for supper, and used up half of the corn "pone" +stock they had brought. It seemed glorious sport to be feasting in that +wild, free way in the virgin forest of an unexplored and uninhabited +island, far from the haunts of men, and they said they never would +return to civilization. The climbing fire lit up their faces and threw +its ruddy glare upon the pillared tree-trunks of their forest temple, +and upon the varnished foliage and festooning vines. + +When the last crisp slice of bacon was gone, and the last allowance of +corn pone devoured, the boys stretched themselves out on the grass, +filled with contentment. They could have found a cooler place, but they +would not deny themselves such a romantic feature as the roasting +camp-fire. + +"AIN'T it gay?" said Joe. + +"It's NUTS!" said Tom. "What would the boys say if they could see us?" + +"Say? Well, they'd just die to be here--hey, Hucky!" + +"I reckon so," said Huckleberry; "anyways, I'm suited. I don't want +nothing better'n this. I don't ever get enough to eat, gen'ally--and +here they can't come and pick at a feller and bullyrag him so." + +"It's just the life for me," said Tom. "You don't have to get up, +mornings, and you don't have to go to school, and wash, and all that +blame foolishness. You see a pirate don't have to do ANYTHING, Joe, +when he's ashore, but a hermit HE has to be praying considerable, and +then he don't have any fun, anyway, all by himself that way." + +"Oh yes, that's so," said Joe, "but I hadn't thought much about it, +you know. I'd a good deal rather be a pirate, now that I've tried it." + +"You see," said Tom, "people don't go much on hermits, nowadays, like +they used to in old times, but a pirate's always respected. And a +hermit's got to sleep on the hardest place he can find, and put +sackcloth and ashes on his head, and stand out in the rain, and--" + +"What does he put sackcloth and ashes on his head for?" inquired Huck. + +"I dono. But they've GOT to do it. Hermits always do. You'd have to do +that if you was a hermit." + +"Dern'd if I would," said Huck. + +"Well, what would you do?" + +"I dono. But I wouldn't do that." + +"Why, Huck, you'd HAVE to. How'd you get around it?" + +"Why, I just wouldn't stand it. I'd run away." + +"Run away! Well, you WOULD be a nice old slouch of a hermit. You'd be +a disgrace." + +The Red-Handed made no response, being better employed. He had +finished gouging out a cob, and now he fitted a weed stem to it, loaded +it with tobacco, and was pressing a coal to the charge and blowing a +cloud of fragrant smoke--he was in the full bloom of luxurious +contentment. The other pirates envied him this majestic vice, and +secretly resolved to acquire it shortly. Presently Huck said: + +"What does pirates have to do?" + +Tom said: + +"Oh, they have just a bully time--take ships and burn them, and get +the money and bury it in awful places in their island where there's +ghosts and things to watch it, and kill everybody in the ships--make +'em walk a plank." + +"And they carry the women to the island," said Joe; "they don't kill +the women." + +"No," assented Tom, "they don't kill the women--they're too noble. And +the women's always beautiful, too. + +"And don't they wear the bulliest clothes! Oh no! All gold and silver +and di'monds," said Joe, with enthusiasm. + +"Who?" said Huck. + +"Why, the pirates." + +Huck scanned his own clothing forlornly. + +"I reckon I ain't dressed fitten for a pirate," said he, with a +regretful pathos in his voice; "but I ain't got none but these." + +But the other boys told him the fine clothes would come fast enough, +after they should have begun their adventures. They made him understand +that his poor rags would do to begin with, though it was customary for +wealthy pirates to start with a proper wardrobe. + +Gradually their talk died out and drowsiness began to steal upon the +eyelids of the little waifs. The pipe dropped from the fingers of the +Red-Handed, and he slept the sleep of the conscience-free and the +weary. The Terror of the Seas and the Black Avenger of the Spanish Main +had more difficulty in getting to sleep. They said their prayers +inwardly, and lying down, since there was nobody there with authority +to make them kneel and recite aloud; in truth, they had a mind not to +say them at all, but they were afraid to proceed to such lengths as +that, lest they might call down a sudden and special thunderbolt from +heaven. Then at once they reached and hovered upon the imminent verge +of sleep--but an intruder came, now, that would not "down." It was +conscience. They began to feel a vague fear that they had been doing +wrong to run away; and next they thought of the stolen meat, and then +the real torture came. They tried to argue it away by reminding +conscience that they had purloined sweetmeats and apples scores of +times; but conscience was not to be appeased by such thin +plausibilities; it seemed to them, in the end, that there was no +getting around the stubborn fact that taking sweetmeats was only +"hooking," while taking bacon and hams and such valuables was plain +simple stealing--and there was a command against that in the Bible. So +they inwardly resolved that so long as they remained in the business, +their piracies should not again be sullied with the crime of stealing. +Then conscience granted a truce, and these curiously inconsistent +pirates fell peacefully to sleep. + + + +CHAPTER XIV + +WHEN Tom awoke in the morning, he wondered where he was. He sat up and +rubbed his eyes and looked around. Then he comprehended. It was the +cool gray dawn, and there was a delicious sense of repose and peace in +the deep pervading calm and silence of the woods. Not a leaf stirred; +not a sound obtruded upon great Nature's meditation. Beaded dewdrops +stood upon the leaves and grasses. A white layer of ashes covered the +fire, and a thin blue breath of smoke rose straight into the air. Joe +and Huck still slept. + +Now, far away in the woods a bird called; another answered; presently +the hammering of a woodpecker was heard. Gradually the cool dim gray of +the morning whitened, and as gradually sounds multiplied and life +manifested itself. The marvel of Nature shaking off sleep and going to +work unfolded itself to the musing boy. A little green worm came +crawling over a dewy leaf, lifting two-thirds of his body into the air +from time to time and "sniffing around," then proceeding again--for he +was measuring, Tom said; and when the worm approached him, of its own +accord, he sat as still as a stone, with his hopes rising and falling, +by turns, as the creature still came toward him or seemed inclined to +go elsewhere; and when at last it considered a painful moment with its +curved body in the air and then came decisively down upon Tom's leg and +began a journey over him, his whole heart was glad--for that meant that +he was going to have a new suit of clothes--without the shadow of a +doubt a gaudy piratical uniform. Now a procession of ants appeared, +from nowhere in particular, and went about their labors; one struggled +manfully by with a dead spider five times as big as itself in its arms, +and lugged it straight up a tree-trunk. A brown spotted lady-bug +climbed the dizzy height of a grass blade, and Tom bent down close to +it and said, "Lady-bug, lady-bug, fly away home, your house is on fire, +your children's alone," and she took wing and went off to see about it +--which did not surprise the boy, for he knew of old that this insect was +credulous about conflagrations, and he had practised upon its +simplicity more than once. A tumblebug came next, heaving sturdily at +its ball, and Tom touched the creature, to see it shut its legs against +its body and pretend to be dead. The birds were fairly rioting by this +time. A catbird, the Northern mocker, lit in a tree over Tom's head, +and trilled out her imitations of her neighbors in a rapture of +enjoyment; then a shrill jay swept down, a flash of blue flame, and +stopped on a twig almost within the boy's reach, cocked his head to one +side and eyed the strangers with a consuming curiosity; a gray squirrel +and a big fellow of the "fox" kind came skurrying along, sitting up at +intervals to inspect and chatter at the boys, for the wild things had +probably never seen a human being before and scarcely knew whether to +be afraid or not. All Nature was wide awake and stirring, now; long +lances of sunlight pierced down through the dense foliage far and near, +and a few butterflies came fluttering upon the scene. + +Tom stirred up the other pirates and they all clattered away with a +shout, and in a minute or two were stripped and chasing after and +tumbling over each other in the shallow limpid water of the white +sandbar. They felt no longing for the little village sleeping in the +distance beyond the majestic waste of water. A vagrant current or a +slight rise in the river had carried off their raft, but this only +gratified them, since its going was something like burning the bridge +between them and civilization. + +They came back to camp wonderfully refreshed, glad-hearted, and +ravenous; and they soon had the camp-fire blazing up again. Huck found +a spring of clear cold water close by, and the boys made cups of broad +oak or hickory leaves, and felt that water, sweetened with such a +wildwood charm as that, would be a good enough substitute for coffee. +While Joe was slicing bacon for breakfast, Tom and Huck asked him to +hold on a minute; they stepped to a promising nook in the river-bank +and threw in their lines; almost immediately they had reward. Joe had +not had time to get impatient before they were back again with some +handsome bass, a couple of sun-perch and a small catfish--provisions +enough for quite a family. They fried the fish with the bacon, and were +astonished; for no fish had ever seemed so delicious before. They did +not know that the quicker a fresh-water fish is on the fire after he is +caught the better he is; and they reflected little upon what a sauce +open-air sleeping, open-air exercise, bathing, and a large ingredient +of hunger make, too. + +They lay around in the shade, after breakfast, while Huck had a smoke, +and then went off through the woods on an exploring expedition. They +tramped gayly along, over decaying logs, through tangled underbrush, +among solemn monarchs of the forest, hung from their crowns to the +ground with a drooping regalia of grape-vines. Now and then they came +upon snug nooks carpeted with grass and jeweled with flowers. + +They found plenty of things to be delighted with, but nothing to be +astonished at. They discovered that the island was about three miles +long and a quarter of a mile wide, and that the shore it lay closest to +was only separated from it by a narrow channel hardly two hundred yards +wide. They took a swim about every hour, so it was close upon the +middle of the afternoon when they got back to camp. They were too +hungry to stop to fish, but they fared sumptuously upon cold ham, and +then threw themselves down in the shade to talk. But the talk soon +began to drag, and then died. The stillness, the solemnity that brooded +in the woods, and the sense of loneliness, began to tell upon the +spirits of the boys. They fell to thinking. A sort of undefined longing +crept upon them. This took dim shape, presently--it was budding +homesickness. Even Finn the Red-Handed was dreaming of his doorsteps +and empty hogsheads. But they were all ashamed of their weakness, and +none was brave enough to speak his thought. + +For some time, now, the boys had been dully conscious of a peculiar +sound in the distance, just as one sometimes is of the ticking of a +clock which he takes no distinct note of. But now this mysterious sound +became more pronounced, and forced a recognition. The boys started, +glanced at each other, and then each assumed a listening attitude. +There was a long silence, profound and unbroken; then a deep, sullen +boom came floating down out of the distance. + +"What is it!" exclaimed Joe, under his breath. + +"I wonder," said Tom in a whisper. + +"'Tain't thunder," said Huckleberry, in an awed tone, "becuz thunder--" + +"Hark!" said Tom. "Listen--don't talk." + +They waited a time that seemed an age, and then the same muffled boom +troubled the solemn hush. + +"Let's go and see." + +They sprang to their feet and hurried to the shore toward the town. +They parted the bushes on the bank and peered out over the water. The +little steam ferryboat was about a mile below the village, drifting +with the current. Her broad deck seemed crowded with people. There were +a great many skiffs rowing about or floating with the stream in the +neighborhood of the ferryboat, but the boys could not determine what +the men in them were doing. Presently a great jet of white smoke burst +from the ferryboat's side, and as it expanded and rose in a lazy cloud, +that same dull throb of sound was borne to the listeners again. + +"I know now!" exclaimed Tom; "somebody's drownded!" + +"That's it!" said Huck; "they done that last summer, when Bill Turner +got drownded; they shoot a cannon over the water, and that makes him +come up to the top. Yes, and they take loaves of bread and put +quicksilver in 'em and set 'em afloat, and wherever there's anybody +that's drownded, they'll float right there and stop." + +"Yes, I've heard about that," said Joe. "I wonder what makes the bread +do that." + +"Oh, it ain't the bread, so much," said Tom; "I reckon it's mostly +what they SAY over it before they start it out." + +"But they don't say anything over it," said Huck. "I've seen 'em and +they don't." + +"Well, that's funny," said Tom. "But maybe they say it to themselves. +Of COURSE they do. Anybody might know that." + +The other boys agreed that there was reason in what Tom said, because +an ignorant lump of bread, uninstructed by an incantation, could not be +expected to act very intelligently when set upon an errand of such +gravity. + +"By jings, I wish I was over there, now," said Joe. + +"I do too" said Huck "I'd give heaps to know who it is." + +The boys still listened and watched. Presently a revealing thought +flashed through Tom's mind, and he exclaimed: + +"Boys, I know who's drownded--it's us!" + +They felt like heroes in an instant. Here was a gorgeous triumph; they +were missed; they were mourned; hearts were breaking on their account; +tears were being shed; accusing memories of unkindness to these poor +lost lads were rising up, and unavailing regrets and remorse were being +indulged; and best of all, the departed were the talk of the whole +town, and the envy of all the boys, as far as this dazzling notoriety +was concerned. This was fine. It was worth while to be a pirate, after +all. + +As twilight drew on, the ferryboat went back to her accustomed +business and the skiffs disappeared. The pirates returned to camp. They +were jubilant with vanity over their new grandeur and the illustrious +trouble they were making. They caught fish, cooked supper and ate it, +and then fell to guessing at what the village was thinking and saying +about them; and the pictures they drew of the public distress on their +account were gratifying to look upon--from their point of view. But +when the shadows of night closed them in, they gradually ceased to +talk, and sat gazing into the fire, with their minds evidently +wandering elsewhere. The excitement was gone, now, and Tom and Joe +could not keep back thoughts of certain persons at home who were not +enjoying this fine frolic as much as they were. Misgivings came; they +grew troubled and unhappy; a sigh or two escaped, unawares. By and by +Joe timidly ventured upon a roundabout "feeler" as to how the others +might look upon a return to civilization--not right now, but-- + +Tom withered him with derision! Huck, being uncommitted as yet, joined +in with Tom, and the waverer quickly "explained," and was glad to get +out of the scrape with as little taint of chicken-hearted homesickness +clinging to his garments as he could. Mutiny was effectually laid to +rest for the moment. + +As the night deepened, Huck began to nod, and presently to snore. Joe +followed next. Tom lay upon his elbow motionless, for some time, +watching the two intently. At last he got up cautiously, on his knees, +and went searching among the grass and the flickering reflections flung +by the camp-fire. He picked up and inspected several large +semi-cylinders of the thin white bark of a sycamore, and finally chose +two which seemed to suit him. Then he knelt by the fire and painfully +wrote something upon each of these with his "red keel"; one he rolled up +and put in his jacket pocket, and the other he put in Joe's hat and +removed it to a little distance from the owner. And he also put into the +hat certain schoolboy treasures of almost inestimable value--among them +a lump of chalk, an India-rubber ball, three fishhooks, and one of that +kind of marbles known as a "sure 'nough crystal." Then he tiptoed his +way cautiously among the trees till he felt that he was out of hearing, +and straightway broke into a keen run in the direction of the sandbar. + + + +CHAPTER XV + +A FEW minutes later Tom was in the shoal water of the bar, wading +toward the Illinois shore. Before the depth reached his middle he was +half-way over; the current would permit no more wading, now, so he +struck out confidently to swim the remaining hundred yards. He swam +quartering upstream, but still was swept downward rather faster than he +had expected. However, he reached the shore finally, and drifted along +till he found a low place and drew himself out. He put his hand on his +jacket pocket, found his piece of bark safe, and then struck through +the woods, following the shore, with streaming garments. Shortly before +ten o'clock he came out into an open place opposite the village, and +saw the ferryboat lying in the shadow of the trees and the high bank. +Everything was quiet under the blinking stars. He crept down the bank, +watching with all his eyes, slipped into the water, swam three or four +strokes and climbed into the skiff that did "yawl" duty at the boat's +stern. He laid himself down under the thwarts and waited, panting. + +Presently the cracked bell tapped and a voice gave the order to "cast +off." A minute or two later the skiff's head was standing high up, +against the boat's swell, and the voyage was begun. Tom felt happy in +his success, for he knew it was the boat's last trip for the night. At +the end of a long twelve or fifteen minutes the wheels stopped, and Tom +slipped overboard and swam ashore in the dusk, landing fifty yards +downstream, out of danger of possible stragglers. + +He flew along unfrequented alleys, and shortly found himself at his +aunt's back fence. He climbed over, approached the "ell," and looked in +at the sitting-room window, for a light was burning there. There sat +Aunt Polly, Sid, Mary, and Joe Harper's mother, grouped together, +talking. They were by the bed, and the bed was between them and the +door. Tom went to the door and began to softly lift the latch; then he +pressed gently and the door yielded a crack; he continued pushing +cautiously, and quaking every time it creaked, till he judged he might +squeeze through on his knees; so he put his head through and began, +warily. + +"What makes the candle blow so?" said Aunt Polly. Tom hurried up. +"Why, that door's open, I believe. Why, of course it is. No end of +strange things now. Go 'long and shut it, Sid." + +Tom disappeared under the bed just in time. He lay and "breathed" +himself for a time, and then crept to where he could almost touch his +aunt's foot. + +"But as I was saying," said Aunt Polly, "he warn't BAD, so to say +--only mischEEvous. Only just giddy, and harum-scarum, you know. He +warn't any more responsible than a colt. HE never meant any harm, and +he was the best-hearted boy that ever was"--and she began to cry. + +"It was just so with my Joe--always full of his devilment, and up to +every kind of mischief, but he was just as unselfish and kind as he +could be--and laws bless me, to think I went and whipped him for taking +that cream, never once recollecting that I throwed it out myself +because it was sour, and I never to see him again in this world, never, +never, never, poor abused boy!" And Mrs. Harper sobbed as if her heart +would break. + +"I hope Tom's better off where he is," said Sid, "but if he'd been +better in some ways--" + +"SID!" Tom felt the glare of the old lady's eye, though he could not +see it. "Not a word against my Tom, now that he's gone! God'll take +care of HIM--never you trouble YOURself, sir! Oh, Mrs. Harper, I don't +know how to give him up! I don't know how to give him up! He was such a +comfort to me, although he tormented my old heart out of me, 'most." + +"The Lord giveth and the Lord hath taken away--Blessed be the name of +the Lord! But it's so hard--Oh, it's so hard! Only last Saturday my +Joe busted a firecracker right under my nose and I knocked him +sprawling. Little did I know then, how soon--Oh, if it was to do over +again I'd hug him and bless him for it." + +"Yes, yes, yes, I know just how you feel, Mrs. Harper, I know just +exactly how you feel. No longer ago than yesterday noon, my Tom took +and filled the cat full of Pain-killer, and I did think the cretur +would tear the house down. And God forgive me, I cracked Tom's head +with my thimble, poor boy, poor dead boy. But he's out of all his +troubles now. And the last words I ever heard him say was to reproach--" + +But this memory was too much for the old lady, and she broke entirely +down. Tom was snuffling, now, himself--and more in pity of himself than +anybody else. He could hear Mary crying, and putting in a kindly word +for him from time to time. He began to have a nobler opinion of himself +than ever before. Still, he was sufficiently touched by his aunt's +grief to long to rush out from under the bed and overwhelm her with +joy--and the theatrical gorgeousness of the thing appealed strongly to +his nature, too, but he resisted and lay still. + +He went on listening, and gathered by odds and ends that it was +conjectured at first that the boys had got drowned while taking a swim; +then the small raft had been missed; next, certain boys said the +missing lads had promised that the village should "hear something" +soon; the wise-heads had "put this and that together" and decided that +the lads had gone off on that raft and would turn up at the next town +below, presently; but toward noon the raft had been found, lodged +against the Missouri shore some five or six miles below the village +--and then hope perished; they must be drowned, else hunger would have +driven them home by nightfall if not sooner. It was believed that the +search for the bodies had been a fruitless effort merely because the +drowning must have occurred in mid-channel, since the boys, being good +swimmers, would otherwise have escaped to shore. This was Wednesday +night. If the bodies continued missing until Sunday, all hope would be +given over, and the funerals would be preached on that morning. Tom +shuddered. + +Mrs. Harper gave a sobbing good-night and turned to go. Then with a +mutual impulse the two bereaved women flung themselves into each +other's arms and had a good, consoling cry, and then parted. Aunt Polly +was tender far beyond her wont, in her good-night to Sid and Mary. Sid +snuffled a bit and Mary went off crying with all her heart. + +Aunt Polly knelt down and prayed for Tom so touchingly, so +appealingly, and with such measureless love in her words and her old +trembling voice, that he was weltering in tears again, long before she +was through. + +He had to keep still long after she went to bed, for she kept making +broken-hearted ejaculations from time to time, tossing unrestfully, and +turning over. But at last she was still, only moaning a little in her +sleep. Now the boy stole out, rose gradually by the bedside, shaded the +candle-light with his hand, and stood regarding her. His heart was full +of pity for her. He took out his sycamore scroll and placed it by the +candle. But something occurred to him, and he lingered considering. His +face lighted with a happy solution of his thought; he put the bark +hastily in his pocket. Then he bent over and kissed the faded lips, and +straightway made his stealthy exit, latching the door behind him. + +He threaded his way back to the ferry landing, found nobody at large +there, and walked boldly on board the boat, for he knew she was +tenantless except that there was a watchman, who always turned in and +slept like a graven image. He untied the skiff at the stern, slipped +into it, and was soon rowing cautiously upstream. When he had pulled a +mile above the village, he started quartering across and bent himself +stoutly to his work. He hit the landing on the other side neatly, for +this was a familiar bit of work to him. He was moved to capture the +skiff, arguing that it might be considered a ship and therefore +legitimate prey for a pirate, but he knew a thorough search would be +made for it and that might end in revelations. So he stepped ashore and +entered the woods. + +He sat down and took a long rest, torturing himself meanwhile to keep +awake, and then started warily down the home-stretch. The night was far +spent. It was broad daylight before he found himself fairly abreast the +island bar. He rested again until the sun was well up and gilding the +great river with its splendor, and then he plunged into the stream. A +little later he paused, dripping, upon the threshold of the camp, and +heard Joe say: + +"No, Tom's true-blue, Huck, and he'll come back. He won't desert. He +knows that would be a disgrace to a pirate, and Tom's too proud for +that sort of thing. He's up to something or other. Now I wonder what?" + +"Well, the things is ours, anyway, ain't they?" + +"Pretty near, but not yet, Huck. The writing says they are if he ain't +back here to breakfast." + +"Which he is!" exclaimed Tom, with fine dramatic effect, stepping +grandly into camp. + +A sumptuous breakfast of bacon and fish was shortly provided, and as +the boys set to work upon it, Tom recounted (and adorned) his +adventures. They were a vain and boastful company of heroes when the +tale was done. Then Tom hid himself away in a shady nook to sleep till +noon, and the other pirates got ready to fish and explore. + + + +CHAPTER XVI + +AFTER dinner all the gang turned out to hunt for turtle eggs on the +bar. They went about poking sticks into the sand, and when they found a +soft place they went down on their knees and dug with their hands. +Sometimes they would take fifty or sixty eggs out of one hole. They +were perfectly round white things a trifle smaller than an English +walnut. They had a famous fried-egg feast that night, and another on +Friday morning. + +After breakfast they went whooping and prancing out on the bar, and +chased each other round and round, shedding clothes as they went, until +they were naked, and then continued the frolic far away up the shoal +water of the bar, against the stiff current, which latter tripped their +legs from under them from time to time and greatly increased the fun. +And now and then they stooped in a group and splashed water in each +other's faces with their palms, gradually approaching each other, with +averted faces to avoid the strangling sprays, and finally gripping and +struggling till the best man ducked his neighbor, and then they all +went under in a tangle of white legs and arms and came up blowing, +sputtering, laughing, and gasping for breath at one and the same time. + +When they were well exhausted, they would run out and sprawl on the +dry, hot sand, and lie there and cover themselves up with it, and by +and by break for the water again and go through the original +performance once more. Finally it occurred to them that their naked +skin represented flesh-colored "tights" very fairly; so they drew a +ring in the sand and had a circus--with three clowns in it, for none +would yield this proudest post to his neighbor. + +Next they got their marbles and played "knucks" and "ring-taw" and +"keeps" till that amusement grew stale. Then Joe and Huck had another +swim, but Tom would not venture, because he found that in kicking off +his trousers he had kicked his string of rattlesnake rattles off his +ankle, and he wondered how he had escaped cramp so long without the +protection of this mysterious charm. He did not venture again until he +had found it, and by that time the other boys were tired and ready to +rest. They gradually wandered apart, dropped into the "dumps," and fell +to gazing longingly across the wide river to where the village lay +drowsing in the sun. Tom found himself writing "BECKY" in the sand with +his big toe; he scratched it out, and was angry with himself for his +weakness. But he wrote it again, nevertheless; he could not help it. He +erased it once more and then took himself out of temptation by driving +the other boys together and joining them. + +But Joe's spirits had gone down almost beyond resurrection. He was so +homesick that he could hardly endure the misery of it. The tears lay +very near the surface. Huck was melancholy, too. Tom was downhearted, +but tried hard not to show it. He had a secret which he was not ready +to tell, yet, but if this mutinous depression was not broken up soon, +he would have to bring it out. He said, with a great show of +cheerfulness: + +"I bet there's been pirates on this island before, boys. We'll explore +it again. They've hid treasures here somewhere. How'd you feel to light +on a rotten chest full of gold and silver--hey?" + +But it roused only faint enthusiasm, which faded out, with no reply. +Tom tried one or two other seductions; but they failed, too. It was +discouraging work. Joe sat poking up the sand with a stick and looking +very gloomy. Finally he said: + +"Oh, boys, let's give it up. I want to go home. It's so lonesome." + +"Oh no, Joe, you'll feel better by and by," said Tom. "Just think of +the fishing that's here." + +"I don't care for fishing. I want to go home." + +"But, Joe, there ain't such another swimming-place anywhere." + +"Swimming's no good. I don't seem to care for it, somehow, when there +ain't anybody to say I sha'n't go in. I mean to go home." + +"Oh, shucks! Baby! You want to see your mother, I reckon." + +"Yes, I DO want to see my mother--and you would, too, if you had one. +I ain't any more baby than you are." And Joe snuffled a little. + +"Well, we'll let the cry-baby go home to his mother, won't we, Huck? +Poor thing--does it want to see its mother? And so it shall. You like +it here, don't you, Huck? We'll stay, won't we?" + +Huck said, "Y-e-s"--without any heart in it. + +"I'll never speak to you again as long as I live," said Joe, rising. +"There now!" And he moved moodily away and began to dress himself. + +"Who cares!" said Tom. "Nobody wants you to. Go 'long home and get +laughed at. Oh, you're a nice pirate. Huck and me ain't cry-babies. +We'll stay, won't we, Huck? Let him go if he wants to. I reckon we can +get along without him, per'aps." + +But Tom was uneasy, nevertheless, and was alarmed to see Joe go +sullenly on with his dressing. And then it was discomforting to see +Huck eying Joe's preparations so wistfully, and keeping up such an +ominous silence. Presently, without a parting word, Joe began to wade +off toward the Illinois shore. Tom's heart began to sink. He glanced at +Huck. Huck could not bear the look, and dropped his eyes. Then he said: + +"I want to go, too, Tom. It was getting so lonesome anyway, and now +it'll be worse. Let's us go, too, Tom." + +"I won't! You can all go, if you want to. I mean to stay." + +"Tom, I better go." + +"Well, go 'long--who's hendering you." + +Huck began to pick up his scattered clothes. He said: + +"Tom, I wisht you'd come, too. Now you think it over. We'll wait for +you when we get to shore." + +"Well, you'll wait a blame long time, that's all." + +Huck started sorrowfully away, and Tom stood looking after him, with a +strong desire tugging at his heart to yield his pride and go along too. +He hoped the boys would stop, but they still waded slowly on. It +suddenly dawned on Tom that it was become very lonely and still. He +made one final struggle with his pride, and then darted after his +comrades, yelling: + +"Wait! Wait! I want to tell you something!" + +They presently stopped and turned around. When he got to where they +were, he began unfolding his secret, and they listened moodily till at +last they saw the "point" he was driving at, and then they set up a +war-whoop of applause and said it was "splendid!" and said if he had +told them at first, they wouldn't have started away. He made a plausible +excuse; but his real reason had been the fear that not even the secret +would keep them with him any very great length of time, and so he had +meant to hold it in reserve as a last seduction. + +The lads came gayly back and went at their sports again with a will, +chattering all the time about Tom's stupendous plan and admiring the +genius of it. After a dainty egg and fish dinner, Tom said he wanted to +learn to smoke, now. Joe caught at the idea and said he would like to +try, too. So Huck made pipes and filled them. These novices had never +smoked anything before but cigars made of grape-vine, and they "bit" +the tongue, and were not considered manly anyway. + +Now they stretched themselves out on their elbows and began to puff, +charily, and with slender confidence. The smoke had an unpleasant +taste, and they gagged a little, but Tom said: + +"Why, it's just as easy! If I'd a knowed this was all, I'd a learnt +long ago." + +"So would I," said Joe. "It's just nothing." + +"Why, many a time I've looked at people smoking, and thought well I +wish I could do that; but I never thought I could," said Tom. + +"That's just the way with me, hain't it, Huck? You've heard me talk +just that way--haven't you, Huck? I'll leave it to Huck if I haven't." + +"Yes--heaps of times," said Huck. + +"Well, I have too," said Tom; "oh, hundreds of times. Once down by the +slaughter-house. Don't you remember, Huck? Bob Tanner was there, and +Johnny Miller, and Jeff Thatcher, when I said it. Don't you remember, +Huck, 'bout me saying that?" + +"Yes, that's so," said Huck. "That was the day after I lost a white +alley. No, 'twas the day before." + +"There--I told you so," said Tom. "Huck recollects it." + +"I bleeve I could smoke this pipe all day," said Joe. "I don't feel +sick." + +"Neither do I," said Tom. "I could smoke it all day. But I bet you +Jeff Thatcher couldn't." + +"Jeff Thatcher! Why, he'd keel over just with two draws. Just let him +try it once. HE'D see!" + +"I bet he would. And Johnny Miller--I wish could see Johnny Miller +tackle it once." + +"Oh, don't I!" said Joe. "Why, I bet you Johnny Miller couldn't any +more do this than nothing. Just one little snifter would fetch HIM." + +"'Deed it would, Joe. Say--I wish the boys could see us now." + +"So do I." + +"Say--boys, don't say anything about it, and some time when they're +around, I'll come up to you and say, 'Joe, got a pipe? I want a smoke.' +And you'll say, kind of careless like, as if it warn't anything, you'll +say, 'Yes, I got my OLD pipe, and another one, but my tobacker ain't +very good.' And I'll say, 'Oh, that's all right, if it's STRONG +enough.' And then you'll out with the pipes, and we'll light up just as +ca'm, and then just see 'em look!" + +"By jings, that'll be gay, Tom! I wish it was NOW!" + +"So do I! And when we tell 'em we learned when we was off pirating, +won't they wish they'd been along?" + +"Oh, I reckon not! I'll just BET they will!" + +So the talk ran on. But presently it began to flag a trifle, and grow +disjointed. The silences widened; the expectoration marvellously +increased. Every pore inside the boys' cheeks became a spouting +fountain; they could scarcely bail out the cellars under their tongues +fast enough to prevent an inundation; little overflowings down their +throats occurred in spite of all they could do, and sudden retchings +followed every time. Both boys were looking very pale and miserable, +now. Joe's pipe dropped from his nerveless fingers. Tom's followed. +Both fountains were going furiously and both pumps bailing with might +and main. Joe said feebly: + +"I've lost my knife. I reckon I better go and find it." + +Tom said, with quivering lips and halting utterance: + +"I'll help you. You go over that way and I'll hunt around by the +spring. No, you needn't come, Huck--we can find it." + +So Huck sat down again, and waited an hour. Then he found it lonesome, +and went to find his comrades. They were wide apart in the woods, both +very pale, both fast asleep. But something informed him that if they +had had any trouble they had got rid of it. + +They were not talkative at supper that night. They had a humble look, +and when Huck prepared his pipe after the meal and was going to prepare +theirs, they said no, they were not feeling very well--something they +ate at dinner had disagreed with them. + +About midnight Joe awoke, and called the boys. There was a brooding +oppressiveness in the air that seemed to bode something. The boys +huddled themselves together and sought the friendly companionship of +the fire, though the dull dead heat of the breathless atmosphere was +stifling. They sat still, intent and waiting. The solemn hush +continued. Beyond the light of the fire everything was swallowed up in +the blackness of darkness. Presently there came a quivering glow that +vaguely revealed the foliage for a moment and then vanished. By and by +another came, a little stronger. Then another. Then a faint moan came +sighing through the branches of the forest and the boys felt a fleeting +breath upon their cheeks, and shuddered with the fancy that the Spirit +of the Night had gone by. There was a pause. Now a weird flash turned +night into day and showed every little grass-blade, separate and +distinct, that grew about their feet. And it showed three white, +startled faces, too. A deep peal of thunder went rolling and tumbling +down the heavens and lost itself in sullen rumblings in the distance. A +sweep of chilly air passed by, rustling all the leaves and snowing the +flaky ashes broadcast about the fire. Another fierce glare lit up the +forest and an instant crash followed that seemed to rend the tree-tops +right over the boys' heads. They clung together in terror, in the thick +gloom that followed. A few big rain-drops fell pattering upon the +leaves. + +"Quick! boys, go for the tent!" exclaimed Tom. + +They sprang away, stumbling over roots and among vines in the dark, no +two plunging in the same direction. A furious blast roared through the +trees, making everything sing as it went. One blinding flash after +another came, and peal on peal of deafening thunder. And now a +drenching rain poured down and the rising hurricane drove it in sheets +along the ground. The boys cried out to each other, but the roaring +wind and the booming thunder-blasts drowned their voices utterly. +However, one by one they straggled in at last and took shelter under +the tent, cold, scared, and streaming with water; but to have company +in misery seemed something to be grateful for. They could not talk, the +old sail flapped so furiously, even if the other noises would have +allowed them. The tempest rose higher and higher, and presently the +sail tore loose from its fastenings and went winging away on the blast. +The boys seized each others' hands and fled, with many tumblings and +bruises, to the shelter of a great oak that stood upon the river-bank. +Now the battle was at its highest. Under the ceaseless conflagration of +lightning that flamed in the skies, everything below stood out in +clean-cut and shadowless distinctness: the bending trees, the billowy +river, white with foam, the driving spray of spume-flakes, the dim +outlines of the high bluffs on the other side, glimpsed through the +drifting cloud-rack and the slanting veil of rain. Every little while +some giant tree yielded the fight and fell crashing through the younger +growth; and the unflagging thunder-peals came now in ear-splitting +explosive bursts, keen and sharp, and unspeakably appalling. The storm +culminated in one matchless effort that seemed likely to tear the island +to pieces, burn it up, drown it to the tree-tops, blow it away, and +deafen every creature in it, all at one and the same moment. It was a +wild night for homeless young heads to be out in. + +But at last the battle was done, and the forces retired with weaker +and weaker threatenings and grumblings, and peace resumed her sway. The +boys went back to camp, a good deal awed; but they found there was +still something to be thankful for, because the great sycamore, the +shelter of their beds, was a ruin, now, blasted by the lightnings, and +they were not under it when the catastrophe happened. + +Everything in camp was drenched, the camp-fire as well; for they were +but heedless lads, like their generation, and had made no provision +against rain. Here was matter for dismay, for they were soaked through +and chilled. They were eloquent in their distress; but they presently +discovered that the fire had eaten so far up under the great log it had +been built against (where it curved upward and separated itself from +the ground), that a handbreadth or so of it had escaped wetting; so +they patiently wrought until, with shreds and bark gathered from the +under sides of sheltered logs, they coaxed the fire to burn again. Then +they piled on great dead boughs till they had a roaring furnace, and +were glad-hearted once more. They dried their boiled ham and had a +feast, and after that they sat by the fire and expanded and glorified +their midnight adventure until morning, for there was not a dry spot to +sleep on, anywhere around. + +As the sun began to steal in upon the boys, drowsiness came over them, +and they went out on the sandbar and lay down to sleep. They got +scorched out by and by, and drearily set about getting breakfast. After +the meal they felt rusty, and stiff-jointed, and a little homesick once +more. Tom saw the signs, and fell to cheering up the pirates as well as +he could. But they cared nothing for marbles, or circus, or swimming, +or anything. He reminded them of the imposing secret, and raised a ray +of cheer. While it lasted, he got them interested in a new device. This +was to knock off being pirates, for a while, and be Indians for a +change. They were attracted by this idea; so it was not long before +they were stripped, and striped from head to heel with black mud, like +so many zebras--all of them chiefs, of course--and then they went +tearing through the woods to attack an English settlement. + +By and by they separated into three hostile tribes, and darted upon +each other from ambush with dreadful war-whoops, and killed and scalped +each other by thousands. It was a gory day. Consequently it was an +extremely satisfactory one. + +They assembled in camp toward supper-time, hungry and happy; but now a +difficulty arose--hostile Indians could not break the bread of +hospitality together without first making peace, and this was a simple +impossibility without smoking a pipe of peace. There was no other +process that ever they had heard of. Two of the savages almost wished +they had remained pirates. However, there was no other way; so with +such show of cheerfulness as they could muster they called for the pipe +and took their whiff as it passed, in due form. + +And behold, they were glad they had gone into savagery, for they had +gained something; they found that they could now smoke a little without +having to go and hunt for a lost knife; they did not get sick enough to +be seriously uncomfortable. They were not likely to fool away this high +promise for lack of effort. No, they practised cautiously, after +supper, with right fair success, and so they spent a jubilant evening. +They were prouder and happier in their new acquirement than they would +have been in the scalping and skinning of the Six Nations. We will +leave them to smoke and chatter and brag, since we have no further use +for them at present. + + + +CHAPTER XVII + +BUT there was no hilarity in the little town that same tranquil +Saturday afternoon. The Harpers, and Aunt Polly's family, were being +put into mourning, with great grief and many tears. An unusual quiet +possessed the village, although it was ordinarily quiet enough, in all +conscience. The villagers conducted their concerns with an absent air, +and talked little; but they sighed often. The Saturday holiday seemed a +burden to the children. They had no heart in their sports, and +gradually gave them up. + +In the afternoon Becky Thatcher found herself moping about the +deserted schoolhouse yard, and feeling very melancholy. But she found +nothing there to comfort her. She soliloquized: + +"Oh, if I only had a brass andiron-knob again! But I haven't got +anything now to remember him by." And she choked back a little sob. + +Presently she stopped, and said to herself: + +"It was right here. Oh, if it was to do over again, I wouldn't say +that--I wouldn't say it for the whole world. But he's gone now; I'll +never, never, never see him any more." + +This thought broke her down, and she wandered away, with tears rolling +down her cheeks. Then quite a group of boys and girls--playmates of +Tom's and Joe's--came by, and stood looking over the paling fence and +talking in reverent tones of how Tom did so-and-so the last time they +saw him, and how Joe said this and that small trifle (pregnant with +awful prophecy, as they could easily see now!)--and each speaker +pointed out the exact spot where the lost lads stood at the time, and +then added something like "and I was a-standing just so--just as I am +now, and as if you was him--I was as close as that--and he smiled, just +this way--and then something seemed to go all over me, like--awful, you +know--and I never thought what it meant, of course, but I can see now!" + +Then there was a dispute about who saw the dead boys last in life, and +many claimed that dismal distinction, and offered evidences, more or +less tampered with by the witness; and when it was ultimately decided +who DID see the departed last, and exchanged the last words with them, +the lucky parties took upon themselves a sort of sacred importance, and +were gaped at and envied by all the rest. One poor chap, who had no +other grandeur to offer, said with tolerably manifest pride in the +remembrance: + +"Well, Tom Sawyer he licked me once." + +But that bid for glory was a failure. Most of the boys could say that, +and so that cheapened the distinction too much. The group loitered +away, still recalling memories of the lost heroes, in awed voices. + +When the Sunday-school hour was finished, the next morning, the bell +began to toll, instead of ringing in the usual way. It was a very still +Sabbath, and the mournful sound seemed in keeping with the musing hush +that lay upon nature. The villagers began to gather, loitering a moment +in the vestibule to converse in whispers about the sad event. But there +was no whispering in the house; only the funereal rustling of dresses +as the women gathered to their seats disturbed the silence there. None +could remember when the little church had been so full before. There +was finally a waiting pause, an expectant dumbness, and then Aunt Polly +entered, followed by Sid and Mary, and they by the Harper family, all +in deep black, and the whole congregation, the old minister as well, +rose reverently and stood until the mourners were seated in the front +pew. There was another communing silence, broken at intervals by +muffled sobs, and then the minister spread his hands abroad and prayed. +A moving hymn was sung, and the text followed: "I am the Resurrection +and the Life." + +As the service proceeded, the clergyman drew such pictures of the +graces, the winning ways, and the rare promise of the lost lads that +every soul there, thinking he recognized these pictures, felt a pang in +remembering that he had persistently blinded himself to them always +before, and had as persistently seen only faults and flaws in the poor +boys. The minister related many a touching incident in the lives of the +departed, too, which illustrated their sweet, generous natures, and the +people could easily see, now, how noble and beautiful those episodes +were, and remembered with grief that at the time they occurred they had +seemed rank rascalities, well deserving of the cowhide. The +congregation became more and more moved, as the pathetic tale went on, +till at last the whole company broke down and joined the weeping +mourners in a chorus of anguished sobs, the preacher himself giving way +to his feelings, and crying in the pulpit. + +There was a rustle in the gallery, which nobody noticed; a moment +later the church door creaked; the minister raised his streaming eyes +above his handkerchief, and stood transfixed! First one and then +another pair of eyes followed the minister's, and then almost with one +impulse the congregation rose and stared while the three dead boys came +marching up the aisle, Tom in the lead, Joe next, and Huck, a ruin of +drooping rags, sneaking sheepishly in the rear! They had been hid in +the unused gallery listening to their own funeral sermon! + +Aunt Polly, Mary, and the Harpers threw themselves upon their restored +ones, smothered them with kisses and poured out thanksgivings, while +poor Huck stood abashed and uncomfortable, not knowing exactly what to +do or where to hide from so many unwelcoming eyes. He wavered, and +started to slink away, but Tom seized him and said: + +"Aunt Polly, it ain't fair. Somebody's got to be glad to see Huck." + +"And so they shall. I'm glad to see him, poor motherless thing!" And +the loving attentions Aunt Polly lavished upon him were the one thing +capable of making him more uncomfortable than he was before. + +Suddenly the minister shouted at the top of his voice: "Praise God +from whom all blessings flow--SING!--and put your hearts in it!" + +And they did. Old Hundred swelled up with a triumphant burst, and +while it shook the rafters Tom Sawyer the Pirate looked around upon the +envying juveniles about him and confessed in his heart that this was +the proudest moment of his life. + +As the "sold" congregation trooped out they said they would almost be +willing to be made ridiculous again to hear Old Hundred sung like that +once more. + +Tom got more cuffs and kisses that day--according to Aunt Polly's +varying moods--than he had earned before in a year; and he hardly knew +which expressed the most gratefulness to God and affection for himself. + + + +CHAPTER XVIII + +THAT was Tom's great secret--the scheme to return home with his +brother pirates and attend their own funerals. They had paddled over to +the Missouri shore on a log, at dusk on Saturday, landing five or six +miles below the village; they had slept in the woods at the edge of the +town till nearly daylight, and had then crept through back lanes and +alleys and finished their sleep in the gallery of the church among a +chaos of invalided benches. + +At breakfast, Monday morning, Aunt Polly and Mary were very loving to +Tom, and very attentive to his wants. There was an unusual amount of +talk. In the course of it Aunt Polly said: + +"Well, I don't say it wasn't a fine joke, Tom, to keep everybody +suffering 'most a week so you boys had a good time, but it is a pity +you could be so hard-hearted as to let me suffer so. If you could come +over on a log to go to your funeral, you could have come over and give +me a hint some way that you warn't dead, but only run off." + +"Yes, you could have done that, Tom," said Mary; "and I believe you +would if you had thought of it." + +"Would you, Tom?" said Aunt Polly, her face lighting wistfully. "Say, +now, would you, if you'd thought of it?" + +"I--well, I don't know. 'Twould 'a' spoiled everything." + +"Tom, I hoped you loved me that much," said Aunt Polly, with a grieved +tone that discomforted the boy. "It would have been something if you'd +cared enough to THINK of it, even if you didn't DO it." + +"Now, auntie, that ain't any harm," pleaded Mary; "it's only Tom's +giddy way--he is always in such a rush that he never thinks of +anything." + +"More's the pity. Sid would have thought. And Sid would have come and +DONE it, too. Tom, you'll look back, some day, when it's too late, and +wish you'd cared a little more for me when it would have cost you so +little." + +"Now, auntie, you know I do care for you," said Tom. + +"I'd know it better if you acted more like it." + +"I wish now I'd thought," said Tom, with a repentant tone; "but I +dreamt about you, anyway. That's something, ain't it?" + +"It ain't much--a cat does that much--but it's better than nothing. +What did you dream?" + +"Why, Wednesday night I dreamt that you was sitting over there by the +bed, and Sid was sitting by the woodbox, and Mary next to him." + +"Well, so we did. So we always do. I'm glad your dreams could take +even that much trouble about us." + +"And I dreamt that Joe Harper's mother was here." + +"Why, she was here! Did you dream any more?" + +"Oh, lots. But it's so dim, now." + +"Well, try to recollect--can't you?" + +"Somehow it seems to me that the wind--the wind blowed the--the--" + +"Try harder, Tom! The wind did blow something. Come!" + +Tom pressed his fingers on his forehead an anxious minute, and then +said: + +"I've got it now! I've got it now! It blowed the candle!" + +"Mercy on us! Go on, Tom--go on!" + +"And it seems to me that you said, 'Why, I believe that that door--'" + +"Go ON, Tom!" + +"Just let me study a moment--just a moment. Oh, yes--you said you +believed the door was open." + +"As I'm sitting here, I did! Didn't I, Mary! Go on!" + +"And then--and then--well I won't be certain, but it seems like as if +you made Sid go and--and--" + +"Well? Well? What did I make him do, Tom? What did I make him do?" + +"You made him--you--Oh, you made him shut it." + +"Well, for the land's sake! I never heard the beat of that in all my +days! Don't tell ME there ain't anything in dreams, any more. Sereny +Harper shall know of this before I'm an hour older. I'd like to see her +get around THIS with her rubbage 'bout superstition. Go on, Tom!" + +"Oh, it's all getting just as bright as day, now. Next you said I +warn't BAD, only mischeevous and harum-scarum, and not any more +responsible than--than--I think it was a colt, or something." + +"And so it was! Well, goodness gracious! Go on, Tom!" + +"And then you began to cry." + +"So I did. So I did. Not the first time, neither. And then--" + +"Then Mrs. Harper she began to cry, and said Joe was just the same, +and she wished she hadn't whipped him for taking cream when she'd +throwed it out her own self--" + +"Tom! The sperrit was upon you! You was a prophesying--that's what you +was doing! Land alive, go on, Tom!" + +"Then Sid he said--he said--" + +"I don't think I said anything," said Sid. + +"Yes you did, Sid," said Mary. + +"Shut your heads and let Tom go on! What did he say, Tom?" + +"He said--I THINK he said he hoped I was better off where I was gone +to, but if I'd been better sometimes--" + +"THERE, d'you hear that! It was his very words!" + +"And you shut him up sharp." + +"I lay I did! There must 'a' been an angel there. There WAS an angel +there, somewheres!" + +"And Mrs. Harper told about Joe scaring her with a firecracker, and +you told about Peter and the Painkiller--" + +"Just as true as I live!" + +"And then there was a whole lot of talk 'bout dragging the river for +us, and 'bout having the funeral Sunday, and then you and old Miss +Harper hugged and cried, and she went." + +"It happened just so! It happened just so, as sure as I'm a-sitting in +these very tracks. Tom, you couldn't told it more like if you'd 'a' +seen it! And then what? Go on, Tom!" + +"Then I thought you prayed for me--and I could see you and hear every +word you said. And you went to bed, and I was so sorry that I took and +wrote on a piece of sycamore bark, 'We ain't dead--we are only off +being pirates,' and put it on the table by the candle; and then you +looked so good, laying there asleep, that I thought I went and leaned +over and kissed you on the lips." + +"Did you, Tom, DID you! I just forgive you everything for that!" And +she seized the boy in a crushing embrace that made him feel like the +guiltiest of villains. + +"It was very kind, even though it was only a--dream," Sid soliloquized +just audibly. + +"Shut up, Sid! A body does just the same in a dream as he'd do if he +was awake. Here's a big Milum apple I've been saving for you, Tom, if +you was ever found again--now go 'long to school. I'm thankful to the +good God and Father of us all I've got you back, that's long-suffering +and merciful to them that believe on Him and keep His word, though +goodness knows I'm unworthy of it, but if only the worthy ones got His +blessings and had His hand to help them over the rough places, there's +few enough would smile here or ever enter into His rest when the long +night comes. Go 'long Sid, Mary, Tom--take yourselves off--you've +hendered me long enough." + +The children left for school, and the old lady to call on Mrs. Harper +and vanquish her realism with Tom's marvellous dream. Sid had better +judgment than to utter the thought that was in his mind as he left the +house. It was this: "Pretty thin--as long a dream as that, without any +mistakes in it!" + +What a hero Tom was become, now! He did not go skipping and prancing, +but moved with a dignified swagger as became a pirate who felt that the +public eye was on him. And indeed it was; he tried not to seem to see +the looks or hear the remarks as he passed along, but they were food +and drink to him. Smaller boys than himself flocked at his heels, as +proud to be seen with him, and tolerated by him, as if he had been the +drummer at the head of a procession or the elephant leading a menagerie +into town. Boys of his own size pretended not to know he had been away +at all; but they were consuming with envy, nevertheless. They would +have given anything to have that swarthy suntanned skin of his, and his +glittering notoriety; and Tom would not have parted with either for a +circus. + +At school the children made so much of him and of Joe, and delivered +such eloquent admiration from their eyes, that the two heroes were not +long in becoming insufferably "stuck-up." They began to tell their +adventures to hungry listeners--but they only began; it was not a thing +likely to have an end, with imaginations like theirs to furnish +material. And finally, when they got out their pipes and went serenely +puffing around, the very summit of glory was reached. + +Tom decided that he could be independent of Becky Thatcher now. Glory +was sufficient. He would live for glory. Now that he was distinguished, +maybe she would be wanting to "make up." Well, let her--she should see +that he could be as indifferent as some other people. Presently she +arrived. Tom pretended not to see her. He moved away and joined a group +of boys and girls and began to talk. Soon he observed that she was +tripping gayly back and forth with flushed face and dancing eyes, +pretending to be busy chasing schoolmates, and screaming with laughter +when she made a capture; but he noticed that she always made her +captures in his vicinity, and that she seemed to cast a conscious eye +in his direction at such times, too. It gratified all the vicious +vanity that was in him; and so, instead of winning him, it only "set +him up" the more and made him the more diligent to avoid betraying that +he knew she was about. Presently she gave over skylarking, and moved +irresolutely about, sighing once or twice and glancing furtively and +wistfully toward Tom. Then she observed that now Tom was talking more +particularly to Amy Lawrence than to any one else. She felt a sharp +pang and grew disturbed and uneasy at once. She tried to go away, but +her feet were treacherous, and carried her to the group instead. She +said to a girl almost at Tom's elbow--with sham vivacity: + +"Why, Mary Austin! you bad girl, why didn't you come to Sunday-school?" + +"I did come--didn't you see me?" + +"Why, no! Did you? Where did you sit?" + +"I was in Miss Peters' class, where I always go. I saw YOU." + +"Did you? Why, it's funny I didn't see you. I wanted to tell you about +the picnic." + +"Oh, that's jolly. Who's going to give it?" + +"My ma's going to let me have one." + +"Oh, goody; I hope she'll let ME come." + +"Well, she will. The picnic's for me. She'll let anybody come that I +want, and I want you." + +"That's ever so nice. When is it going to be?" + +"By and by. Maybe about vacation." + +"Oh, won't it be fun! You going to have all the girls and boys?" + +"Yes, every one that's friends to me--or wants to be"; and she glanced +ever so furtively at Tom, but he talked right along to Amy Lawrence +about the terrible storm on the island, and how the lightning tore the +great sycamore tree "all to flinders" while he was "standing within +three feet of it." + +"Oh, may I come?" said Grace Miller. + +"Yes." + +"And me?" said Sally Rogers. + +"Yes." + +"And me, too?" said Susy Harper. "And Joe?" + +"Yes." + +And so on, with clapping of joyful hands till all the group had begged +for invitations but Tom and Amy. Then Tom turned coolly away, still +talking, and took Amy with him. Becky's lips trembled and the tears +came to her eyes; she hid these signs with a forced gayety and went on +chattering, but the life had gone out of the picnic, now, and out of +everything else; she got away as soon as she could and hid herself and +had what her sex call "a good cry." Then she sat moody, with wounded +pride, till the bell rang. She roused up, now, with a vindictive cast +in her eye, and gave her plaited tails a shake and said she knew what +SHE'D do. + +At recess Tom continued his flirtation with Amy with jubilant +self-satisfaction. And he kept drifting about to find Becky and lacerate +her with the performance. At last he spied her, but there was a sudden +falling of his mercury. She was sitting cosily on a little bench behind +the schoolhouse looking at a picture-book with Alfred Temple--and so +absorbed were they, and their heads so close together over the book, +that they did not seem to be conscious of anything in the world besides. +Jealousy ran red-hot through Tom's veins. He began to hate himself for +throwing away the chance Becky had offered for a reconciliation. He +called himself a fool, and all the hard names he could think of. He +wanted to cry with vexation. Amy chatted happily along, as they walked, +for her heart was singing, but Tom's tongue had lost its function. He +did not hear what Amy was saying, and whenever she paused expectantly he +could only stammer an awkward assent, which was as often misplaced as +otherwise. He kept drifting to the rear of the schoolhouse, again and +again, to sear his eyeballs with the hateful spectacle there. He could +not help it. And it maddened him to see, as he thought he saw, that +Becky Thatcher never once suspected that he was even in the land of the +living. But she did see, nevertheless; and she knew she was winning her +fight, too, and was glad to see him suffer as she had suffered. + +Amy's happy prattle became intolerable. Tom hinted at things he had to +attend to; things that must be done; and time was fleeting. But in +vain--the girl chirped on. Tom thought, "Oh, hang her, ain't I ever +going to get rid of her?" At last he must be attending to those +things--and she said artlessly that she would be "around" when school +let out. And he hastened away, hating her for it. + +"Any other boy!" Tom thought, grating his teeth. "Any boy in the whole +town but that Saint Louis smarty that thinks he dresses so fine and is +aristocracy! Oh, all right, I licked you the first day you ever saw +this town, mister, and I'll lick you again! You just wait till I catch +you out! I'll just take and--" + +And he went through the motions of thrashing an imaginary boy +--pummelling the air, and kicking and gouging. "Oh, you do, do you? You +holler 'nough, do you? Now, then, let that learn you!" And so the +imaginary flogging was finished to his satisfaction. + +Tom fled home at noon. His conscience could not endure any more of +Amy's grateful happiness, and his jealousy could bear no more of the +other distress. Becky resumed her picture inspections with Alfred, but +as the minutes dragged along and no Tom came to suffer, her triumph +began to cloud and she lost interest; gravity and absent-mindedness +followed, and then melancholy; two or three times she pricked up her +ear at a footstep, but it was a false hope; no Tom came. At last she +grew entirely miserable and wished she hadn't carried it so far. When +poor Alfred, seeing that he was losing her, he did not know how, kept +exclaiming: "Oh, here's a jolly one! look at this!" she lost patience +at last, and said, "Oh, don't bother me! I don't care for them!" and +burst into tears, and got up and walked away. + +Alfred dropped alongside and was going to try to comfort her, but she +said: + +"Go away and leave me alone, can't you! I hate you!" + +So the boy halted, wondering what he could have done--for she had said +she would look at pictures all through the nooning--and she walked on, +crying. Then Alfred went musing into the deserted schoolhouse. He was +humiliated and angry. He easily guessed his way to the truth--the girl +had simply made a convenience of him to vent her spite upon Tom Sawyer. +He was far from hating Tom the less when this thought occurred to him. +He wished there was some way to get that boy into trouble without much +risk to himself. Tom's spelling-book fell under his eye. Here was his +opportunity. He gratefully opened to the lesson for the afternoon and +poured ink upon the page. + +Becky, glancing in at a window behind him at the moment, saw the act, +and moved on, without discovering herself. She started homeward, now, +intending to find Tom and tell him; Tom would be thankful and their +troubles would be healed. Before she was half way home, however, she +had changed her mind. The thought of Tom's treatment of her when she +was talking about her picnic came scorching back and filled her with +shame. She resolved to let him get whipped on the damaged +spelling-book's account, and to hate him forever, into the bargain. + + + +CHAPTER XIX + +TOM arrived at home in a dreary mood, and the first thing his aunt +said to him showed him that he had brought his sorrows to an +unpromising market: + +"Tom, I've a notion to skin you alive!" + +"Auntie, what have I done?" + +"Well, you've done enough. Here I go over to Sereny Harper, like an +old softy, expecting I'm going to make her believe all that rubbage +about that dream, when lo and behold you she'd found out from Joe that +you was over here and heard all the talk we had that night. Tom, I +don't know what is to become of a boy that will act like that. It makes +me feel so bad to think you could let me go to Sereny Harper and make +such a fool of myself and never say a word." + +This was a new aspect of the thing. His smartness of the morning had +seemed to Tom a good joke before, and very ingenious. It merely looked +mean and shabby now. He hung his head and could not think of anything +to say for a moment. Then he said: + +"Auntie, I wish I hadn't done it--but I didn't think." + +"Oh, child, you never think. You never think of anything but your own +selfishness. You could think to come all the way over here from +Jackson's Island in the night to laugh at our troubles, and you could +think to fool me with a lie about a dream; but you couldn't ever think +to pity us and save us from sorrow." + +"Auntie, I know now it was mean, but I didn't mean to be mean. I +didn't, honest. And besides, I didn't come over here to laugh at you +that night." + +"What did you come for, then?" + +"It was to tell you not to be uneasy about us, because we hadn't got +drownded." + +"Tom, Tom, I would be the thankfullest soul in this world if I could +believe you ever had as good a thought as that, but you know you never +did--and I know it, Tom." + +"Indeed and 'deed I did, auntie--I wish I may never stir if I didn't." + +"Oh, Tom, don't lie--don't do it. It only makes things a hundred times +worse." + +"It ain't a lie, auntie; it's the truth. I wanted to keep you from +grieving--that was all that made me come." + +"I'd give the whole world to believe that--it would cover up a power +of sins, Tom. I'd 'most be glad you'd run off and acted so bad. But it +ain't reasonable; because, why didn't you tell me, child?" + +"Why, you see, when you got to talking about the funeral, I just got +all full of the idea of our coming and hiding in the church, and I +couldn't somehow bear to spoil it. So I just put the bark back in my +pocket and kept mum." + +"What bark?" + +"The bark I had wrote on to tell you we'd gone pirating. I wish, now, +you'd waked up when I kissed you--I do, honest." + +The hard lines in his aunt's face relaxed and a sudden tenderness +dawned in her eyes. + +"DID you kiss me, Tom?" + +"Why, yes, I did." + +"Are you sure you did, Tom?" + +"Why, yes, I did, auntie--certain sure." + +"What did you kiss me for, Tom?" + +"Because I loved you so, and you laid there moaning and I was so sorry." + +The words sounded like truth. The old lady could not hide a tremor in +her voice when she said: + +"Kiss me again, Tom!--and be off with you to school, now, and don't +bother me any more." + +The moment he was gone, she ran to a closet and got out the ruin of a +jacket which Tom had gone pirating in. Then she stopped, with it in her +hand, and said to herself: + +"No, I don't dare. Poor boy, I reckon he's lied about it--but it's a +blessed, blessed lie, there's such a comfort come from it. I hope the +Lord--I KNOW the Lord will forgive him, because it was such +goodheartedness in him to tell it. But I don't want to find out it's a +lie. I won't look." + +She put the jacket away, and stood by musing a minute. Twice she put +out her hand to take the garment again, and twice she refrained. Once +more she ventured, and this time she fortified herself with the +thought: "It's a good lie--it's a good lie--I won't let it grieve me." +So she sought the jacket pocket. A moment later she was reading Tom's +piece of bark through flowing tears and saying: "I could forgive the +boy, now, if he'd committed a million sins!" + + + +CHAPTER XX + +THERE was something about Aunt Polly's manner, when she kissed Tom, +that swept away his low spirits and made him lighthearted and happy +again. He started to school and had the luck of coming upon Becky +Thatcher at the head of Meadow Lane. His mood always determined his +manner. Without a moment's hesitation he ran to her and said: + +"I acted mighty mean to-day, Becky, and I'm so sorry. I won't ever, +ever do that way again, as long as ever I live--please make up, won't +you?" + +The girl stopped and looked him scornfully in the face: + +"I'll thank you to keep yourself TO yourself, Mr. Thomas Sawyer. I'll +never speak to you again." + +She tossed her head and passed on. Tom was so stunned that he had not +even presence of mind enough to say "Who cares, Miss Smarty?" until the +right time to say it had gone by. So he said nothing. But he was in a +fine rage, nevertheless. He moped into the schoolyard wishing she were +a boy, and imagining how he would trounce her if she were. He presently +encountered her and delivered a stinging remark as he passed. She +hurled one in return, and the angry breach was complete. It seemed to +Becky, in her hot resentment, that she could hardly wait for school to +"take in," she was so impatient to see Tom flogged for the injured +spelling-book. If she had had any lingering notion of exposing Alfred +Temple, Tom's offensive fling had driven it entirely away. + +Poor girl, she did not know how fast she was nearing trouble herself. +The master, Mr. Dobbins, had reached middle age with an unsatisfied +ambition. The darling of his desires was, to be a doctor, but poverty +had decreed that he should be nothing higher than a village +schoolmaster. Every day he took a mysterious book out of his desk and +absorbed himself in it at times when no classes were reciting. He kept +that book under lock and key. There was not an urchin in school but was +perishing to have a glimpse of it, but the chance never came. Every boy +and girl had a theory about the nature of that book; but no two +theories were alike, and there was no way of getting at the facts in +the case. Now, as Becky was passing by the desk, which stood near the +door, she noticed that the key was in the lock! It was a precious +moment. She glanced around; found herself alone, and the next instant +she had the book in her hands. The title-page--Professor Somebody's +ANATOMY--carried no information to her mind; so she began to turn the +leaves. She came at once upon a handsomely engraved and colored +frontispiece--a human figure, stark naked. At that moment a shadow fell +on the page and Tom Sawyer stepped in at the door and caught a glimpse +of the picture. Becky snatched at the book to close it, and had the +hard luck to tear the pictured page half down the middle. She thrust +the volume into the desk, turned the key, and burst out crying with +shame and vexation. + +"Tom Sawyer, you are just as mean as you can be, to sneak up on a +person and look at what they're looking at." + +"How could I know you was looking at anything?" + +"You ought to be ashamed of yourself, Tom Sawyer; you know you're +going to tell on me, and oh, what shall I do, what shall I do! I'll be +whipped, and I never was whipped in school." + +Then she stamped her little foot and said: + +"BE so mean if you want to! I know something that's going to happen. +You just wait and you'll see! Hateful, hateful, hateful!"--and she +flung out of the house with a new explosion of crying. + +Tom stood still, rather flustered by this onslaught. Presently he said +to himself: + +"What a curious kind of a fool a girl is! Never been licked in school! +Shucks! What's a licking! That's just like a girl--they're so +thin-skinned and chicken-hearted. Well, of course I ain't going to tell +old Dobbins on this little fool, because there's other ways of getting +even on her, that ain't so mean; but what of it? Old Dobbins will ask +who it was tore his book. Nobody'll answer. Then he'll do just the way +he always does--ask first one and then t'other, and when he comes to the +right girl he'll know it, without any telling. Girls' faces always tell +on them. They ain't got any backbone. She'll get licked. Well, it's a +kind of a tight place for Becky Thatcher, because there ain't any way +out of it." Tom conned the thing a moment longer, and then added: "All +right, though; she'd like to see me in just such a fix--let her sweat it +out!" + +Tom joined the mob of skylarking scholars outside. In a few moments +the master arrived and school "took in." Tom did not feel a strong +interest in his studies. Every time he stole a glance at the girls' +side of the room Becky's face troubled him. Considering all things, he +did not want to pity her, and yet it was all he could do to help it. He +could get up no exultation that was really worthy the name. Presently +the spelling-book discovery was made, and Tom's mind was entirely full +of his own matters for a while after that. Becky roused up from her +lethargy of distress and showed good interest in the proceedings. She +did not expect that Tom could get out of his trouble by denying that he +spilt the ink on the book himself; and she was right. The denial only +seemed to make the thing worse for Tom. Becky supposed she would be +glad of that, and she tried to believe she was glad of it, but she +found she was not certain. When the worst came to the worst, she had an +impulse to get up and tell on Alfred Temple, but she made an effort and +forced herself to keep still--because, said she to herself, "he'll tell +about me tearing the picture sure. I wouldn't say a word, not to save +his life!" + +Tom took his whipping and went back to his seat not at all +broken-hearted, for he thought it was possible that he had unknowingly +upset the ink on the spelling-book himself, in some skylarking bout--he +had denied it for form's sake and because it was custom, and had stuck +to the denial from principle. + +A whole hour drifted by, the master sat nodding in his throne, the air +was drowsy with the hum of study. By and by, Mr. Dobbins straightened +himself up, yawned, then unlocked his desk, and reached for his book, +but seemed undecided whether to take it out or leave it. Most of the +pupils glanced up languidly, but there were two among them that watched +his movements with intent eyes. Mr. Dobbins fingered his book absently +for a while, then took it out and settled himself in his chair to read! +Tom shot a glance at Becky. He had seen a hunted and helpless rabbit +look as she did, with a gun levelled at its head. Instantly he forgot +his quarrel with her. Quick--something must be done! done in a flash, +too! But the very imminence of the emergency paralyzed his invention. +Good!--he had an inspiration! He would run and snatch the book, spring +through the door and fly. But his resolution shook for one little +instant, and the chance was lost--the master opened the volume. If Tom +only had the wasted opportunity back again! Too late. There was no help +for Becky now, he said. The next moment the master faced the school. +Every eye sank under his gaze. There was that in it which smote even +the innocent with fear. There was silence while one might count ten +--the master was gathering his wrath. Then he spoke: "Who tore this book?" + +There was not a sound. One could have heard a pin drop. The stillness +continued; the master searched face after face for signs of guilt. + +"Benjamin Rogers, did you tear this book?" + +A denial. Another pause. + +"Joseph Harper, did you?" + +Another denial. Tom's uneasiness grew more and more intense under the +slow torture of these proceedings. The master scanned the ranks of +boys--considered a while, then turned to the girls: + +"Amy Lawrence?" + +A shake of the head. + +"Gracie Miller?" + +The same sign. + +"Susan Harper, did you do this?" + +Another negative. The next girl was Becky Thatcher. Tom was trembling +from head to foot with excitement and a sense of the hopelessness of +the situation. + +"Rebecca Thatcher" [Tom glanced at her face--it was white with terror] +--"did you tear--no, look me in the face" [her hands rose in appeal] +--"did you tear this book?" + +A thought shot like lightning through Tom's brain. He sprang to his +feet and shouted--"I done it!" + +The school stared in perplexity at this incredible folly. Tom stood a +moment, to gather his dismembered faculties; and when he stepped +forward to go to his punishment the surprise, the gratitude, the +adoration that shone upon him out of poor Becky's eyes seemed pay +enough for a hundred floggings. Inspired by the splendor of his own +act, he took without an outcry the most merciless flaying that even Mr. +Dobbins had ever administered; and also received with indifference the +added cruelty of a command to remain two hours after school should be +dismissed--for he knew who would wait for him outside till his +captivity was done, and not count the tedious time as loss, either. + +Tom went to bed that night planning vengeance against Alfred Temple; +for with shame and repentance Becky had told him all, not forgetting +her own treachery; but even the longing for vengeance had to give way, +soon, to pleasanter musings, and he fell asleep at last with Becky's +latest words lingering dreamily in his ear-- + +"Tom, how COULD you be so noble!" + + + +CHAPTER XXI + +VACATION was approaching. The schoolmaster, always severe, grew +severer and more exacting than ever, for he wanted the school to make a +good showing on "Examination" day. His rod and his ferule were seldom +idle now--at least among the smaller pupils. Only the biggest boys, and +young ladies of eighteen and twenty, escaped lashing. Mr. Dobbins' +lashings were very vigorous ones, too; for although he carried, under +his wig, a perfectly bald and shiny head, he had only reached middle +age, and there was no sign of feebleness in his muscle. As the great +day approached, all the tyranny that was in him came to the surface; he +seemed to take a vindictive pleasure in punishing the least +shortcomings. The consequence was, that the smaller boys spent their +days in terror and suffering and their nights in plotting revenge. They +threw away no opportunity to do the master a mischief. But he kept +ahead all the time. The retribution that followed every vengeful +success was so sweeping and majestic that the boys always retired from +the field badly worsted. At last they conspired together and hit upon a +plan that promised a dazzling victory. They swore in the sign-painter's +boy, told him the scheme, and asked his help. He had his own reasons +for being delighted, for the master boarded in his father's family and +had given the boy ample cause to hate him. The master's wife would go +on a visit to the country in a few days, and there would be nothing to +interfere with the plan; the master always prepared himself for great +occasions by getting pretty well fuddled, and the sign-painter's boy +said that when the dominie had reached the proper condition on +Examination Evening he would "manage the thing" while he napped in his +chair; then he would have him awakened at the right time and hurried +away to school. + +In the fulness of time the interesting occasion arrived. At eight in +the evening the schoolhouse was brilliantly lighted, and adorned with +wreaths and festoons of foliage and flowers. The master sat throned in +his great chair upon a raised platform, with his blackboard behind him. +He was looking tolerably mellow. Three rows of benches on each side and +six rows in front of him were occupied by the dignitaries of the town +and by the parents of the pupils. To his left, back of the rows of +citizens, was a spacious temporary platform upon which were seated the +scholars who were to take part in the exercises of the evening; rows of +small boys, washed and dressed to an intolerable state of discomfort; +rows of gawky big boys; snowbanks of girls and young ladies clad in +lawn and muslin and conspicuously conscious of their bare arms, their +grandmothers' ancient trinkets, their bits of pink and blue ribbon and +the flowers in their hair. All the rest of the house was filled with +non-participating scholars. + +The exercises began. A very little boy stood up and sheepishly +recited, "You'd scarce expect one of my age to speak in public on the +stage," etc.--accompanying himself with the painfully exact and +spasmodic gestures which a machine might have used--supposing the +machine to be a trifle out of order. But he got through safely, though +cruelly scared, and got a fine round of applause when he made his +manufactured bow and retired. + +A little shamefaced girl lisped, "Mary had a little lamb," etc., +performed a compassion-inspiring curtsy, got her meed of applause, and +sat down flushed and happy. + +Tom Sawyer stepped forward with conceited confidence and soared into +the unquenchable and indestructible "Give me liberty or give me death" +speech, with fine fury and frantic gesticulation, and broke down in the +middle of it. A ghastly stage-fright seized him, his legs quaked under +him and he was like to choke. True, he had the manifest sympathy of the +house but he had the house's silence, too, which was even worse than +its sympathy. The master frowned, and this completed the disaster. Tom +struggled awhile and then retired, utterly defeated. There was a weak +attempt at applause, but it died early. + +"The Boy Stood on the Burning Deck" followed; also "The Assyrian Came +Down," and other declamatory gems. Then there were reading exercises, +and a spelling fight. The meagre Latin class recited with honor. The +prime feature of the evening was in order, now--original "compositions" +by the young ladies. Each in her turn stepped forward to the edge of +the platform, cleared her throat, held up her manuscript (tied with +dainty ribbon), and proceeded to read, with labored attention to +"expression" and punctuation. The themes were the same that had been +illuminated upon similar occasions by their mothers before them, their +grandmothers, and doubtless all their ancestors in the female line +clear back to the Crusades. "Friendship" was one; "Memories of Other +Days"; "Religion in History"; "Dream Land"; "The Advantages of +Culture"; "Forms of Political Government Compared and Contrasted"; +"Melancholy"; "Filial Love"; "Heart Longings," etc., etc. + +A prevalent feature in these compositions was a nursed and petted +melancholy; another was a wasteful and opulent gush of "fine language"; +another was a tendency to lug in by the ears particularly prized words +and phrases until they were worn entirely out; and a peculiarity that +conspicuously marked and marred them was the inveterate and intolerable +sermon that wagged its crippled tail at the end of each and every one +of them. No matter what the subject might be, a brain-racking effort +was made to squirm it into some aspect or other that the moral and +religious mind could contemplate with edification. The glaring +insincerity of these sermons was not sufficient to compass the +banishment of the fashion from the schools, and it is not sufficient +to-day; it never will be sufficient while the world stands, perhaps. +There is no school in all our land where the young ladies do not feel +obliged to close their compositions with a sermon; and you will find +that the sermon of the most frivolous and the least religious girl in +the school is always the longest and the most relentlessly pious. But +enough of this. Homely truth is unpalatable. + +Let us return to the "Examination." The first composition that was +read was one entitled "Is this, then, Life?" Perhaps the reader can +endure an extract from it: + + "In the common walks of life, with what delightful + emotions does the youthful mind look forward to some + anticipated scene of festivity! Imagination is busy + sketching rose-tinted pictures of joy. In fancy, the + voluptuous votary of fashion sees herself amid the + festive throng, 'the observed of all observers.' Her + graceful form, arrayed in snowy robes, is whirling + through the mazes of the joyous dance; her eye is + brightest, her step is lightest in the gay assembly. + + "In such delicious fancies time quickly glides by, + and the welcome hour arrives for her entrance into + the Elysian world, of which she has had such bright + dreams. How fairy-like does everything appear to + her enchanted vision! Each new scene is more charming + than the last. But after a while she finds that + beneath this goodly exterior, all is vanity, the + flattery which once charmed her soul, now grates + harshly upon her ear; the ball-room has lost its + charms; and with wasted health and imbittered heart, + she turns away with the conviction that earthly + pleasures cannot satisfy the longings of the soul!" + +And so forth and so on. There was a buzz of gratification from time to +time during the reading, accompanied by whispered ejaculations of "How +sweet!" "How eloquent!" "So true!" etc., and after the thing had closed +with a peculiarly afflicting sermon the applause was enthusiastic. + +Then arose a slim, melancholy girl, whose face had the "interesting" +paleness that comes of pills and indigestion, and read a "poem." Two +stanzas of it will do: + + "A MISSOURI MAIDEN'S FAREWELL TO ALABAMA + + "Alabama, good-bye! I love thee well! + But yet for a while do I leave thee now! + Sad, yes, sad thoughts of thee my heart doth swell, + And burning recollections throng my brow! + For I have wandered through thy flowery woods; + Have roamed and read near Tallapoosa's stream; + Have listened to Tallassee's warring floods, + And wooed on Coosa's side Aurora's beam. + + "Yet shame I not to bear an o'er-full heart, + Nor blush to turn behind my tearful eyes; + 'Tis from no stranger land I now must part, + 'Tis to no strangers left I yield these sighs. + Welcome and home were mine within this State, + Whose vales I leave--whose spires fade fast from me + And cold must be mine eyes, and heart, and tete, + When, dear Alabama! they turn cold on thee!" + +There were very few there who knew what "tete" meant, but the poem was +very satisfactory, nevertheless. + +Next appeared a dark-complexioned, black-eyed, black-haired young +lady, who paused an impressive moment, assumed a tragic expression, and +began to read in a measured, solemn tone: + + "A VISION + + "Dark and tempestuous was night. Around the + throne on high not a single star quivered; but + the deep intonations of the heavy thunder + constantly vibrated upon the ear; whilst the + terrific lightning revelled in angry mood + through the cloudy chambers of heaven, seeming + to scorn the power exerted over its terror by + the illustrious Franklin! Even the boisterous + winds unanimously came forth from their mystic + homes, and blustered about as if to enhance by + their aid the wildness of the scene. + + "At such a time, so dark, so dreary, for human + sympathy my very spirit sighed; but instead thereof, + + "'My dearest friend, my counsellor, my comforter + and guide--My joy in grief, my second bliss + in joy,' came to my side. She moved like one of + those bright beings pictured in the sunny walks + of fancy's Eden by the romantic and young, a + queen of beauty unadorned save by her own + transcendent loveliness. So soft was her step, it + failed to make even a sound, and but for the + magical thrill imparted by her genial touch, as + other unobtrusive beauties, she would have glided + away un-perceived--unsought. A strange sadness + rested upon her features, like icy tears upon + the robe of December, as she pointed to the + contending elements without, and bade me contemplate + the two beings presented." + +This nightmare occupied some ten pages of manuscript and wound up with +a sermon so destructive of all hope to non-Presbyterians that it took +the first prize. This composition was considered to be the very finest +effort of the evening. The mayor of the village, in delivering the +prize to the author of it, made a warm speech in which he said that it +was by far the most "eloquent" thing he had ever listened to, and that +Daniel Webster himself might well be proud of it. + +It may be remarked, in passing, that the number of compositions in +which the word "beauteous" was over-fondled, and human experience +referred to as "life's page," was up to the usual average. + +Now the master, mellow almost to the verge of geniality, put his chair +aside, turned his back to the audience, and began to draw a map of +America on the blackboard, to exercise the geography class upon. But he +made a sad business of it with his unsteady hand, and a smothered +titter rippled over the house. He knew what the matter was, and set +himself to right it. He sponged out lines and remade them; but he only +distorted them more than ever, and the tittering was more pronounced. +He threw his entire attention upon his work, now, as if determined not +to be put down by the mirth. He felt that all eyes were fastened upon +him; he imagined he was succeeding, and yet the tittering continued; it +even manifestly increased. And well it might. There was a garret above, +pierced with a scuttle over his head; and down through this scuttle +came a cat, suspended around the haunches by a string; she had a rag +tied about her head and jaws to keep her from mewing; as she slowly +descended she curved upward and clawed at the string, she swung +downward and clawed at the intangible air. The tittering rose higher +and higher--the cat was within six inches of the absorbed teacher's +head--down, down, a little lower, and she grabbed his wig with her +desperate claws, clung to it, and was snatched up into the garret in an +instant with her trophy still in her possession! And how the light did +blaze abroad from the master's bald pate--for the sign-painter's boy +had GILDED it! + +That broke up the meeting. The boys were avenged. Vacation had come. + + NOTE:--The pretended "compositions" quoted in + this chapter are taken without alteration from a + volume entitled "Prose and Poetry, by a Western + Lady"--but they are exactly and precisely after + the schoolgirl pattern, and hence are much + happier than any mere imitations could be. + + + +CHAPTER XXII + +TOM joined the new order of Cadets of Temperance, being attracted by +the showy character of their "regalia." He promised to abstain from +smoking, chewing, and profanity as long as he remained a member. Now he +found out a new thing--namely, that to promise not to do a thing is the +surest way in the world to make a body want to go and do that very +thing. Tom soon found himself tormented with a desire to drink and +swear; the desire grew to be so intense that nothing but the hope of a +chance to display himself in his red sash kept him from withdrawing +from the order. Fourth of July was coming; but he soon gave that up +--gave it up before he had worn his shackles over forty-eight hours--and +fixed his hopes upon old Judge Frazer, justice of the peace, who was +apparently on his deathbed and would have a big public funeral, since +he was so high an official. During three days Tom was deeply concerned +about the Judge's condition and hungry for news of it. Sometimes his +hopes ran high--so high that he would venture to get out his regalia +and practise before the looking-glass. But the Judge had a most +discouraging way of fluctuating. At last he was pronounced upon the +mend--and then convalescent. Tom was disgusted; and felt a sense of +injury, too. He handed in his resignation at once--and that night the +Judge suffered a relapse and died. Tom resolved that he would never +trust a man like that again. + +The funeral was a fine thing. The Cadets paraded in a style calculated +to kill the late member with envy. Tom was a free boy again, however +--there was something in that. He could drink and swear, now--but found +to his surprise that he did not want to. The simple fact that he could, +took the desire away, and the charm of it. + +Tom presently wondered to find that his coveted vacation was beginning +to hang a little heavily on his hands. + +He attempted a diary--but nothing happened during three days, and so +he abandoned it. + +The first of all the negro minstrel shows came to town, and made a +sensation. Tom and Joe Harper got up a band of performers and were +happy for two days. + +Even the Glorious Fourth was in some sense a failure, for it rained +hard, there was no procession in consequence, and the greatest man in +the world (as Tom supposed), Mr. Benton, an actual United States +Senator, proved an overwhelming disappointment--for he was not +twenty-five feet high, nor even anywhere in the neighborhood of it. + +A circus came. The boys played circus for three days afterward in +tents made of rag carpeting--admission, three pins for boys, two for +girls--and then circusing was abandoned. + +A phrenologist and a mesmerizer came--and went again and left the +village duller and drearier than ever. + +There were some boys-and-girls' parties, but they were so few and so +delightful that they only made the aching voids between ache the harder. + +Becky Thatcher was gone to her Constantinople home to stay with her +parents during vacation--so there was no bright side to life anywhere. + +The dreadful secret of the murder was a chronic misery. It was a very +cancer for permanency and pain. + +Then came the measles. + +During two long weeks Tom lay a prisoner, dead to the world and its +happenings. He was very ill, he was interested in nothing. When he got +upon his feet at last and moved feebly down-town, a melancholy change +had come over everything and every creature. There had been a +"revival," and everybody had "got religion," not only the adults, but +even the boys and girls. Tom went about, hoping against hope for the +sight of one blessed sinful face, but disappointment crossed him +everywhere. He found Joe Harper studying a Testament, and turned sadly +away from the depressing spectacle. He sought Ben Rogers, and found him +visiting the poor with a basket of tracts. He hunted up Jim Hollis, who +called his attention to the precious blessing of his late measles as a +warning. Every boy he encountered added another ton to his depression; +and when, in desperation, he flew for refuge at last to the bosom of +Huckleberry Finn and was received with a Scriptural quotation, his +heart broke and he crept home and to bed realizing that he alone of all +the town was lost, forever and forever. + +And that night there came on a terrific storm, with driving rain, +awful claps of thunder and blinding sheets of lightning. He covered his +head with the bedclothes and waited in a horror of suspense for his +doom; for he had not the shadow of a doubt that all this hubbub was +about him. He believed he had taxed the forbearance of the powers above +to the extremity of endurance and that this was the result. It might +have seemed to him a waste of pomp and ammunition to kill a bug with a +battery of artillery, but there seemed nothing incongruous about the +getting up such an expensive thunderstorm as this to knock the turf +from under an insect like himself. + +By and by the tempest spent itself and died without accomplishing its +object. The boy's first impulse was to be grateful, and reform. His +second was to wait--for there might not be any more storms. + +The next day the doctors were back; Tom had relapsed. The three weeks +he spent on his back this time seemed an entire age. When he got abroad +at last he was hardly grateful that he had been spared, remembering how +lonely was his estate, how companionless and forlorn he was. He drifted +listlessly down the street and found Jim Hollis acting as judge in a +juvenile court that was trying a cat for murder, in the presence of her +victim, a bird. He found Joe Harper and Huck Finn up an alley eating a +stolen melon. Poor lads! they--like Tom--had suffered a relapse. + + + +CHAPTER XXIII + +AT last the sleepy atmosphere was stirred--and vigorously: the murder +trial came on in the court. It became the absorbing topic of village +talk immediately. Tom could not get away from it. Every reference to +the murder sent a shudder to his heart, for his troubled conscience and +fears almost persuaded him that these remarks were put forth in his +hearing as "feelers"; he did not see how he could be suspected of +knowing anything about the murder, but still he could not be +comfortable in the midst of this gossip. It kept him in a cold shiver +all the time. He took Huck to a lonely place to have a talk with him. +It would be some relief to unseal his tongue for a little while; to +divide his burden of distress with another sufferer. Moreover, he +wanted to assure himself that Huck had remained discreet. + +"Huck, have you ever told anybody about--that?" + +"'Bout what?" + +"You know what." + +"Oh--'course I haven't." + +"Never a word?" + +"Never a solitary word, so help me. What makes you ask?" + +"Well, I was afeard." + +"Why, Tom Sawyer, we wouldn't be alive two days if that got found out. +YOU know that." + +Tom felt more comfortable. After a pause: + +"Huck, they couldn't anybody get you to tell, could they?" + +"Get me to tell? Why, if I wanted that half-breed devil to drownd me +they could get me to tell. They ain't no different way." + +"Well, that's all right, then. I reckon we're safe as long as we keep +mum. But let's swear again, anyway. It's more surer." + +"I'm agreed." + +So they swore again with dread solemnities. + +"What is the talk around, Huck? I've heard a power of it." + +"Talk? Well, it's just Muff Potter, Muff Potter, Muff Potter all the +time. It keeps me in a sweat, constant, so's I want to hide som'ers." + +"That's just the same way they go on round me. I reckon he's a goner. +Don't you feel sorry for him, sometimes?" + +"Most always--most always. He ain't no account; but then he hain't +ever done anything to hurt anybody. Just fishes a little, to get money +to get drunk on--and loafs around considerable; but lord, we all do +that--leastways most of us--preachers and such like. But he's kind of +good--he give me half a fish, once, when there warn't enough for two; +and lots of times he's kind of stood by me when I was out of luck." + +"Well, he's mended kites for me, Huck, and knitted hooks on to my +line. I wish we could get him out of there." + +"My! we couldn't get him out, Tom. And besides, 'twouldn't do any +good; they'd ketch him again." + +"Yes--so they would. But I hate to hear 'em abuse him so like the +dickens when he never done--that." + +"I do too, Tom. Lord, I hear 'em say he's the bloodiest looking +villain in this country, and they wonder he wasn't ever hung before." + +"Yes, they talk like that, all the time. I've heard 'em say that if he +was to get free they'd lynch him." + +"And they'd do it, too." + +The boys had a long talk, but it brought them little comfort. As the +twilight drew on, they found themselves hanging about the neighborhood +of the little isolated jail, perhaps with an undefined hope that +something would happen that might clear away their difficulties. But +nothing happened; there seemed to be no angels or fairies interested in +this luckless captive. + +The boys did as they had often done before--went to the cell grating +and gave Potter some tobacco and matches. He was on the ground floor +and there were no guards. + +His gratitude for their gifts had always smote their consciences +before--it cut deeper than ever, this time. They felt cowardly and +treacherous to the last degree when Potter said: + +"You've been mighty good to me, boys--better'n anybody else in this +town. And I don't forget it, I don't. Often I says to myself, says I, +'I used to mend all the boys' kites and things, and show 'em where the +good fishin' places was, and befriend 'em what I could, and now they've +all forgot old Muff when he's in trouble; but Tom don't, and Huck +don't--THEY don't forget him, says I, 'and I don't forget them.' Well, +boys, I done an awful thing--drunk and crazy at the time--that's the +only way I account for it--and now I got to swing for it, and it's +right. Right, and BEST, too, I reckon--hope so, anyway. Well, we won't +talk about that. I don't want to make YOU feel bad; you've befriended +me. But what I want to say, is, don't YOU ever get drunk--then you won't +ever get here. Stand a litter furder west--so--that's it; it's a prime +comfort to see faces that's friendly when a body's in such a muck of +trouble, and there don't none come here but yourn. Good friendly +faces--good friendly faces. Git up on one another's backs and let me +touch 'em. That's it. Shake hands--yourn'll come through the bars, but +mine's too big. Little hands, and weak--but they've helped Muff Potter +a power, and they'd help him more if they could." + +Tom went home miserable, and his dreams that night were full of +horrors. The next day and the day after, he hung about the court-room, +drawn by an almost irresistible impulse to go in, but forcing himself +to stay out. Huck was having the same experience. They studiously +avoided each other. Each wandered away, from time to time, but the same +dismal fascination always brought them back presently. Tom kept his +ears open when idlers sauntered out of the court-room, but invariably +heard distressing news--the toils were closing more and more +relentlessly around poor Potter. At the end of the second day the +village talk was to the effect that Injun Joe's evidence stood firm and +unshaken, and that there was not the slightest question as to what the +jury's verdict would be. + +Tom was out late, that night, and came to bed through the window. He +was in a tremendous state of excitement. It was hours before he got to +sleep. All the village flocked to the court-house the next morning, for +this was to be the great day. Both sexes were about equally represented +in the packed audience. After a long wait the jury filed in and took +their places; shortly afterward, Potter, pale and haggard, timid and +hopeless, was brought in, with chains upon him, and seated where all +the curious eyes could stare at him; no less conspicuous was Injun Joe, +stolid as ever. There was another pause, and then the judge arrived and +the sheriff proclaimed the opening of the court. The usual whisperings +among the lawyers and gathering together of papers followed. These +details and accompanying delays worked up an atmosphere of preparation +that was as impressive as it was fascinating. + +Now a witness was called who testified that he found Muff Potter +washing in the brook, at an early hour of the morning that the murder +was discovered, and that he immediately sneaked away. After some +further questioning, counsel for the prosecution said: + +"Take the witness." + +The prisoner raised his eyes for a moment, but dropped them again when +his own counsel said: + +"I have no questions to ask him." + +The next witness proved the finding of the knife near the corpse. +Counsel for the prosecution said: + +"Take the witness." + +"I have no questions to ask him," Potter's lawyer replied. + +A third witness swore he had often seen the knife in Potter's +possession. + +"Take the witness." + +Counsel for Potter declined to question him. The faces of the audience +began to betray annoyance. Did this attorney mean to throw away his +client's life without an effort? + +Several witnesses deposed concerning Potter's guilty behavior when +brought to the scene of the murder. They were allowed to leave the +stand without being cross-questioned. + +Every detail of the damaging circumstances that occurred in the +graveyard upon that morning which all present remembered so well was +brought out by credible witnesses, but none of them were cross-examined +by Potter's lawyer. The perplexity and dissatisfaction of the house +expressed itself in murmurs and provoked a reproof from the bench. +Counsel for the prosecution now said: + +"By the oaths of citizens whose simple word is above suspicion, we +have fastened this awful crime, beyond all possibility of question, +upon the unhappy prisoner at the bar. We rest our case here." + +A groan escaped from poor Potter, and he put his face in his hands and +rocked his body softly to and fro, while a painful silence reigned in +the court-room. Many men were moved, and many women's compassion +testified itself in tears. Counsel for the defence rose and said: + +"Your honor, in our remarks at the opening of this trial, we +foreshadowed our purpose to prove that our client did this fearful deed +while under the influence of a blind and irresponsible delirium +produced by drink. We have changed our mind. We shall not offer that +plea." [Then to the clerk:] "Call Thomas Sawyer!" + +A puzzled amazement awoke in every face in the house, not even +excepting Potter's. Every eye fastened itself with wondering interest +upon Tom as he rose and took his place upon the stand. The boy looked +wild enough, for he was badly scared. The oath was administered. + +"Thomas Sawyer, where were you on the seventeenth of June, about the +hour of midnight?" + +Tom glanced at Injun Joe's iron face and his tongue failed him. The +audience listened breathless, but the words refused to come. After a +few moments, however, the boy got a little of his strength back, and +managed to put enough of it into his voice to make part of the house +hear: + +"In the graveyard!" + +"A little bit louder, please. Don't be afraid. You were--" + +"In the graveyard." + +A contemptuous smile flitted across Injun Joe's face. + +"Were you anywhere near Horse Williams' grave?" + +"Yes, sir." + +"Speak up--just a trifle louder. How near were you?" + +"Near as I am to you." + +"Were you hidden, or not?" + +"I was hid." + +"Where?" + +"Behind the elms that's on the edge of the grave." + +Injun Joe gave a barely perceptible start. + +"Any one with you?" + +"Yes, sir. I went there with--" + +"Wait--wait a moment. Never mind mentioning your companion's name. We +will produce him at the proper time. Did you carry anything there with +you." + +Tom hesitated and looked confused. + +"Speak out, my boy--don't be diffident. The truth is always +respectable. What did you take there?" + +"Only a--a--dead cat." + +There was a ripple of mirth, which the court checked. + +"We will produce the skeleton of that cat. Now, my boy, tell us +everything that occurred--tell it in your own way--don't skip anything, +and don't be afraid." + +Tom began--hesitatingly at first, but as he warmed to his subject his +words flowed more and more easily; in a little while every sound ceased +but his own voice; every eye fixed itself upon him; with parted lips +and bated breath the audience hung upon his words, taking no note of +time, rapt in the ghastly fascinations of the tale. The strain upon +pent emotion reached its climax when the boy said: + +"--and as the doctor fetched the board around and Muff Potter fell, +Injun Joe jumped with the knife and--" + +Crash! Quick as lightning the half-breed sprang for a window, tore his +way through all opposers, and was gone! + + + +CHAPTER XXIV + +TOM was a glittering hero once more--the pet of the old, the envy of +the young. His name even went into immortal print, for the village +paper magnified him. There were some that believed he would be +President, yet, if he escaped hanging. + +As usual, the fickle, unreasoning world took Muff Potter to its bosom +and fondled him as lavishly as it had abused him before. But that sort +of conduct is to the world's credit; therefore it is not well to find +fault with it. + +Tom's days were days of splendor and exultation to him, but his nights +were seasons of horror. Injun Joe infested all his dreams, and always +with doom in his eye. Hardly any temptation could persuade the boy to +stir abroad after nightfall. Poor Huck was in the same state of +wretchedness and terror, for Tom had told the whole story to the lawyer +the night before the great day of the trial, and Huck was sore afraid +that his share in the business might leak out, yet, notwithstanding +Injun Joe's flight had saved him the suffering of testifying in court. +The poor fellow had got the attorney to promise secrecy, but what of +that? Since Tom's harassed conscience had managed to drive him to the +lawyer's house by night and wring a dread tale from lips that had been +sealed with the dismalest and most formidable of oaths, Huck's +confidence in the human race was well-nigh obliterated. + +Daily Muff Potter's gratitude made Tom glad he had spoken; but nightly +he wished he had sealed up his tongue. + +Half the time Tom was afraid Injun Joe would never be captured; the +other half he was afraid he would be. He felt sure he never could draw +a safe breath again until that man was dead and he had seen the corpse. + +Rewards had been offered, the country had been scoured, but no Injun +Joe was found. One of those omniscient and awe-inspiring marvels, a +detective, came up from St. Louis, moused around, shook his head, +looked wise, and made that sort of astounding success which members of +that craft usually achieve. That is to say, he "found a clew." But you +can't hang a "clew" for murder, and so after that detective had got +through and gone home, Tom felt just as insecure as he was before. + +The slow days drifted on, and each left behind it a slightly lightened +weight of apprehension. + + + +CHAPTER XXV + +THERE comes a time in every rightly-constructed boy's life when he has +a raging desire to go somewhere and dig for hidden treasure. This +desire suddenly came upon Tom one day. He sallied out to find Joe +Harper, but failed of success. Next he sought Ben Rogers; he had gone +fishing. Presently he stumbled upon Huck Finn the Red-Handed. Huck +would answer. Tom took him to a private place and opened the matter to +him confidentially. Huck was willing. Huck was always willing to take a +hand in any enterprise that offered entertainment and required no +capital, for he had a troublesome superabundance of that sort of time +which is not money. "Where'll we dig?" said Huck. + +"Oh, most anywhere." + +"Why, is it hid all around?" + +"No, indeed it ain't. It's hid in mighty particular places, Huck +--sometimes on islands, sometimes in rotten chests under the end of a +limb of an old dead tree, just where the shadow falls at midnight; but +mostly under the floor in ha'nted houses." + +"Who hides it?" + +"Why, robbers, of course--who'd you reckon? Sunday-school +sup'rintendents?" + +"I don't know. If 'twas mine I wouldn't hide it; I'd spend it and have +a good time." + +"So would I. But robbers don't do that way. They always hide it and +leave it there." + +"Don't they come after it any more?" + +"No, they think they will, but they generally forget the marks, or +else they die. Anyway, it lays there a long time and gets rusty; and by +and by somebody finds an old yellow paper that tells how to find the +marks--a paper that's got to be ciphered over about a week because it's +mostly signs and hy'roglyphics." + +"Hyro--which?" + +"Hy'roglyphics--pictures and things, you know, that don't seem to mean +anything." + +"Have you got one of them papers, Tom?" + +"No." + +"Well then, how you going to find the marks?" + +"I don't want any marks. They always bury it under a ha'nted house or +on an island, or under a dead tree that's got one limb sticking out. +Well, we've tried Jackson's Island a little, and we can try it again +some time; and there's the old ha'nted house up the Still-House branch, +and there's lots of dead-limb trees--dead loads of 'em." + +"Is it under all of them?" + +"How you talk! No!" + +"Then how you going to know which one to go for?" + +"Go for all of 'em!" + +"Why, Tom, it'll take all summer." + +"Well, what of that? Suppose you find a brass pot with a hundred +dollars in it, all rusty and gray, or rotten chest full of di'monds. +How's that?" + +Huck's eyes glowed. + +"That's bully. Plenty bully enough for me. Just you gimme the hundred +dollars and I don't want no di'monds." + +"All right. But I bet you I ain't going to throw off on di'monds. Some +of 'em's worth twenty dollars apiece--there ain't any, hardly, but's +worth six bits or a dollar." + +"No! Is that so?" + +"Cert'nly--anybody'll tell you so. Hain't you ever seen one, Huck?" + +"Not as I remember." + +"Oh, kings have slathers of them." + +"Well, I don' know no kings, Tom." + +"I reckon you don't. But if you was to go to Europe you'd see a raft +of 'em hopping around." + +"Do they hop?" + +"Hop?--your granny! No!" + +"Well, what did you say they did, for?" + +"Shucks, I only meant you'd SEE 'em--not hopping, of course--what do +they want to hop for?--but I mean you'd just see 'em--scattered around, +you know, in a kind of a general way. Like that old humpbacked Richard." + +"Richard? What's his other name?" + +"He didn't have any other name. Kings don't have any but a given name." + +"No?" + +"But they don't." + +"Well, if they like it, Tom, all right; but I don't want to be a king +and have only just a given name, like a nigger. But say--where you +going to dig first?" + +"Well, I don't know. S'pose we tackle that old dead-limb tree on the +hill t'other side of Still-House branch?" + +"I'm agreed." + +So they got a crippled pick and a shovel, and set out on their +three-mile tramp. They arrived hot and panting, and threw themselves +down in the shade of a neighboring elm to rest and have a smoke. + +"I like this," said Tom. + +"So do I." + +"Say, Huck, if we find a treasure here, what you going to do with your +share?" + +"Well, I'll have pie and a glass of soda every day, and I'll go to +every circus that comes along. I bet I'll have a gay time." + +"Well, ain't you going to save any of it?" + +"Save it? What for?" + +"Why, so as to have something to live on, by and by." + +"Oh, that ain't any use. Pap would come back to thish-yer town some +day and get his claws on it if I didn't hurry up, and I tell you he'd +clean it out pretty quick. What you going to do with yourn, Tom?" + +"I'm going to buy a new drum, and a sure-'nough sword, and a red +necktie and a bull pup, and get married." + +"Married!" + +"That's it." + +"Tom, you--why, you ain't in your right mind." + +"Wait--you'll see." + +"Well, that's the foolishest thing you could do. Look at pap and my +mother. Fight! Why, they used to fight all the time. I remember, mighty +well." + +"That ain't anything. The girl I'm going to marry won't fight." + +"Tom, I reckon they're all alike. They'll all comb a body. Now you +better think 'bout this awhile. I tell you you better. What's the name +of the gal?" + +"It ain't a gal at all--it's a girl." + +"It's all the same, I reckon; some says gal, some says girl--both's +right, like enough. Anyway, what's her name, Tom?" + +"I'll tell you some time--not now." + +"All right--that'll do. Only if you get married I'll be more lonesomer +than ever." + +"No you won't. You'll come and live with me. Now stir out of this and +we'll go to digging." + +They worked and sweated for half an hour. No result. They toiled +another half-hour. Still no result. Huck said: + +"Do they always bury it as deep as this?" + +"Sometimes--not always. Not generally. I reckon we haven't got the +right place." + +So they chose a new spot and began again. The labor dragged a little, +but still they made progress. They pegged away in silence for some +time. Finally Huck leaned on his shovel, swabbed the beaded drops from +his brow with his sleeve, and said: + +"Where you going to dig next, after we get this one?" + +"I reckon maybe we'll tackle the old tree that's over yonder on +Cardiff Hill back of the widow's." + +"I reckon that'll be a good one. But won't the widow take it away from +us, Tom? It's on her land." + +"SHE take it away! Maybe she'd like to try it once. Whoever finds one +of these hid treasures, it belongs to him. It don't make any difference +whose land it's on." + +That was satisfactory. The work went on. By and by Huck said: + +"Blame it, we must be in the wrong place again. What do you think?" + +"It is mighty curious, Huck. I don't understand it. Sometimes witches +interfere. I reckon maybe that's what's the trouble now." + +"Shucks! Witches ain't got no power in the daytime." + +"Well, that's so. I didn't think of that. Oh, I know what the matter +is! What a blamed lot of fools we are! You got to find out where the +shadow of the limb falls at midnight, and that's where you dig!" + +"Then consound it, we've fooled away all this work for nothing. Now +hang it all, we got to come back in the night. It's an awful long way. +Can you get out?" + +"I bet I will. We've got to do it to-night, too, because if somebody +sees these holes they'll know in a minute what's here and they'll go +for it." + +"Well, I'll come around and maow to-night." + +"All right. Let's hide the tools in the bushes." + +The boys were there that night, about the appointed time. They sat in +the shadow waiting. It was a lonely place, and an hour made solemn by +old traditions. Spirits whispered in the rustling leaves, ghosts lurked +in the murky nooks, the deep baying of a hound floated up out of the +distance, an owl answered with his sepulchral note. The boys were +subdued by these solemnities, and talked little. By and by they judged +that twelve had come; they marked where the shadow fell, and began to +dig. Their hopes commenced to rise. Their interest grew stronger, and +their industry kept pace with it. The hole deepened and still deepened, +but every time their hearts jumped to hear the pick strike upon +something, they only suffered a new disappointment. It was only a stone +or a chunk. At last Tom said: + +"It ain't any use, Huck, we're wrong again." + +"Well, but we CAN'T be wrong. We spotted the shadder to a dot." + +"I know it, but then there's another thing." + +"What's that?". + +"Why, we only guessed at the time. Like enough it was too late or too +early." + +Huck dropped his shovel. + +"That's it," said he. "That's the very trouble. We got to give this +one up. We can't ever tell the right time, and besides this kind of +thing's too awful, here this time of night with witches and ghosts +a-fluttering around so. I feel as if something's behind me all the time; +and I'm afeard to turn around, becuz maybe there's others in front +a-waiting for a chance. I been creeping all over, ever since I got here." + +"Well, I've been pretty much so, too, Huck. They most always put in a +dead man when they bury a treasure under a tree, to look out for it." + +"Lordy!" + +"Yes, they do. I've always heard that." + +"Tom, I don't like to fool around much where there's dead people. A +body's bound to get into trouble with 'em, sure." + +"I don't like to stir 'em up, either. S'pose this one here was to +stick his skull out and say something!" + +"Don't Tom! It's awful." + +"Well, it just is. Huck, I don't feel comfortable a bit." + +"Say, Tom, let's give this place up, and try somewheres else." + +"All right, I reckon we better." + +"What'll it be?" + +Tom considered awhile; and then said: + +"The ha'nted house. That's it!" + +"Blame it, I don't like ha'nted houses, Tom. Why, they're a dern sight +worse'n dead people. Dead people might talk, maybe, but they don't come +sliding around in a shroud, when you ain't noticing, and peep over your +shoulder all of a sudden and grit their teeth, the way a ghost does. I +couldn't stand such a thing as that, Tom--nobody could." + +"Yes, but, Huck, ghosts don't travel around only at night. They won't +hender us from digging there in the daytime." + +"Well, that's so. But you know mighty well people don't go about that +ha'nted house in the day nor the night." + +"Well, that's mostly because they don't like to go where a man's been +murdered, anyway--but nothing's ever been seen around that house except +in the night--just some blue lights slipping by the windows--no regular +ghosts." + +"Well, where you see one of them blue lights flickering around, Tom, +you can bet there's a ghost mighty close behind it. It stands to +reason. Becuz you know that they don't anybody but ghosts use 'em." + +"Yes, that's so. But anyway they don't come around in the daytime, so +what's the use of our being afeard?" + +"Well, all right. We'll tackle the ha'nted house if you say so--but I +reckon it's taking chances." + +They had started down the hill by this time. There in the middle of +the moonlit valley below them stood the "ha'nted" house, utterly +isolated, its fences gone long ago, rank weeds smothering the very +doorsteps, the chimney crumbled to ruin, the window-sashes vacant, a +corner of the roof caved in. The boys gazed awhile, half expecting to +see a blue light flit past a window; then talking in a low tone, as +befitted the time and the circumstances, they struck far off to the +right, to give the haunted house a wide berth, and took their way +homeward through the woods that adorned the rearward side of Cardiff +Hill. + + + +CHAPTER XXVI + +ABOUT noon the next day the boys arrived at the dead tree; they had +come for their tools. Tom was impatient to go to the haunted house; +Huck was measurably so, also--but suddenly said: + +"Lookyhere, Tom, do you know what day it is?" + +Tom mentally ran over the days of the week, and then quickly lifted +his eyes with a startled look in them-- + +"My! I never once thought of it, Huck!" + +"Well, I didn't neither, but all at once it popped onto me that it was +Friday." + +"Blame it, a body can't be too careful, Huck. We might 'a' got into an +awful scrape, tackling such a thing on a Friday." + +"MIGHT! Better say we WOULD! There's some lucky days, maybe, but +Friday ain't." + +"Any fool knows that. I don't reckon YOU was the first that found it +out, Huck." + +"Well, I never said I was, did I? And Friday ain't all, neither. I had +a rotten bad dream last night--dreampt about rats." + +"No! Sure sign of trouble. Did they fight?" + +"No." + +"Well, that's good, Huck. When they don't fight it's only a sign that +there's trouble around, you know. All we got to do is to look mighty +sharp and keep out of it. We'll drop this thing for to-day, and play. +Do you know Robin Hood, Huck?" + +"No. Who's Robin Hood?" + +"Why, he was one of the greatest men that was ever in England--and the +best. He was a robber." + +"Cracky, I wisht I was. Who did he rob?" + +"Only sheriffs and bishops and rich people and kings, and such like. +But he never bothered the poor. He loved 'em. He always divided up with +'em perfectly square." + +"Well, he must 'a' been a brick." + +"I bet you he was, Huck. Oh, he was the noblest man that ever was. +They ain't any such men now, I can tell you. He could lick any man in +England, with one hand tied behind him; and he could take his yew bow +and plug a ten-cent piece every time, a mile and a half." + +"What's a YEW bow?" + +"I don't know. It's some kind of a bow, of course. And if he hit that +dime only on the edge he would set down and cry--and curse. But we'll +play Robin Hood--it's nobby fun. I'll learn you." + +"I'm agreed." + +So they played Robin Hood all the afternoon, now and then casting a +yearning eye down upon the haunted house and passing a remark about the +morrow's prospects and possibilities there. As the sun began to sink +into the west they took their way homeward athwart the long shadows of +the trees and soon were buried from sight in the forests of Cardiff +Hill. + +On Saturday, shortly after noon, the boys were at the dead tree again. +They had a smoke and a chat in the shade, and then dug a little in +their last hole, not with great hope, but merely because Tom said there +were so many cases where people had given up a treasure after getting +down within six inches of it, and then somebody else had come along and +turned it up with a single thrust of a shovel. The thing failed this +time, however, so the boys shouldered their tools and went away feeling +that they had not trifled with fortune, but had fulfilled all the +requirements that belong to the business of treasure-hunting. + +When they reached the haunted house there was something so weird and +grisly about the dead silence that reigned there under the baking sun, +and something so depressing about the loneliness and desolation of the +place, that they were afraid, for a moment, to venture in. Then they +crept to the door and took a trembling peep. They saw a weed-grown, +floorless room, unplastered, an ancient fireplace, vacant windows, a +ruinous staircase; and here, there, and everywhere hung ragged and +abandoned cobwebs. They presently entered, softly, with quickened +pulses, talking in whispers, ears alert to catch the slightest sound, +and muscles tense and ready for instant retreat. + +In a little while familiarity modified their fears and they gave the +place a critical and interested examination, rather admiring their own +boldness, and wondering at it, too. Next they wanted to look up-stairs. +This was something like cutting off retreat, but they got to daring +each other, and of course there could be but one result--they threw +their tools into a corner and made the ascent. Up there were the same +signs of decay. In one corner they found a closet that promised +mystery, but the promise was a fraud--there was nothing in it. Their +courage was up now and well in hand. They were about to go down and +begin work when-- + +"Sh!" said Tom. + +"What is it?" whispered Huck, blanching with fright. + +"Sh!... There!... Hear it?" + +"Yes!... Oh, my! Let's run!" + +"Keep still! Don't you budge! They're coming right toward the door." + +The boys stretched themselves upon the floor with their eyes to +knot-holes in the planking, and lay waiting, in a misery of fear. + +"They've stopped.... No--coming.... Here they are. Don't whisper +another word, Huck. My goodness, I wish I was out of this!" + +Two men entered. Each boy said to himself: "There's the old deaf and +dumb Spaniard that's been about town once or twice lately--never saw +t'other man before." + +"T'other" was a ragged, unkempt creature, with nothing very pleasant +in his face. The Spaniard was wrapped in a serape; he had bushy white +whiskers; long white hair flowed from under his sombrero, and he wore +green goggles. When they came in, "t'other" was talking in a low voice; +they sat down on the ground, facing the door, with their backs to the +wall, and the speaker continued his remarks. His manner became less +guarded and his words more distinct as he proceeded: + +"No," said he, "I've thought it all over, and I don't like it. It's +dangerous." + +"Dangerous!" grunted the "deaf and dumb" Spaniard--to the vast +surprise of the boys. "Milksop!" + +This voice made the boys gasp and quake. It was Injun Joe's! There was +silence for some time. Then Joe said: + +"What's any more dangerous than that job up yonder--but nothing's come +of it." + +"That's different. Away up the river so, and not another house about. +'Twon't ever be known that we tried, anyway, long as we didn't succeed." + +"Well, what's more dangerous than coming here in the daytime!--anybody +would suspicion us that saw us." + +"I know that. But there warn't any other place as handy after that +fool of a job. I want to quit this shanty. I wanted to yesterday, only +it warn't any use trying to stir out of here, with those infernal boys +playing over there on the hill right in full view." + +"Those infernal boys" quaked again under the inspiration of this +remark, and thought how lucky it was that they had remembered it was +Friday and concluded to wait a day. They wished in their hearts they +had waited a year. + +The two men got out some food and made a luncheon. After a long and +thoughtful silence, Injun Joe said: + +"Look here, lad--you go back up the river where you belong. Wait there +till you hear from me. I'll take the chances on dropping into this town +just once more, for a look. We'll do that 'dangerous' job after I've +spied around a little and think things look well for it. Then for +Texas! We'll leg it together!" + +This was satisfactory. Both men presently fell to yawning, and Injun +Joe said: + +"I'm dead for sleep! It's your turn to watch." + +He curled down in the weeds and soon began to snore. His comrade +stirred him once or twice and he became quiet. Presently the watcher +began to nod; his head drooped lower and lower, both men began to snore +now. + +The boys drew a long, grateful breath. Tom whispered: + +"Now's our chance--come!" + +Huck said: + +"I can't--I'd die if they was to wake." + +Tom urged--Huck held back. At last Tom rose slowly and softly, and +started alone. But the first step he made wrung such a hideous creak +from the crazy floor that he sank down almost dead with fright. He +never made a second attempt. The boys lay there counting the dragging +moments till it seemed to them that time must be done and eternity +growing gray; and then they were grateful to note that at last the sun +was setting. + +Now one snore ceased. Injun Joe sat up, stared around--smiled grimly +upon his comrade, whose head was drooping upon his knees--stirred him +up with his foot and said: + +"Here! YOU'RE a watchman, ain't you! All right, though--nothing's +happened." + +"My! have I been asleep?" + +"Oh, partly, partly. Nearly time for us to be moving, pard. What'll we +do with what little swag we've got left?" + +"I don't know--leave it here as we've always done, I reckon. No use to +take it away till we start south. Six hundred and fifty in silver's +something to carry." + +"Well--all right--it won't matter to come here once more." + +"No--but I'd say come in the night as we used to do--it's better." + +"Yes: but look here; it may be a good while before I get the right +chance at that job; accidents might happen; 'tain't in such a very good +place; we'll just regularly bury it--and bury it deep." + +"Good idea," said the comrade, who walked across the room, knelt down, +raised one of the rearward hearth-stones and took out a bag that +jingled pleasantly. He subtracted from it twenty or thirty dollars for +himself and as much for Injun Joe, and passed the bag to the latter, +who was on his knees in the corner, now, digging with his bowie-knife. + +The boys forgot all their fears, all their miseries in an instant. +With gloating eyes they watched every movement. Luck!--the splendor of +it was beyond all imagination! Six hundred dollars was money enough to +make half a dozen boys rich! Here was treasure-hunting under the +happiest auspices--there would not be any bothersome uncertainty as to +where to dig. They nudged each other every moment--eloquent nudges and +easily understood, for they simply meant--"Oh, but ain't you glad NOW +we're here!" + +Joe's knife struck upon something. + +"Hello!" said he. + +"What is it?" said his comrade. + +"Half-rotten plank--no, it's a box, I believe. Here--bear a hand and +we'll see what it's here for. Never mind, I've broke a hole." + +He reached his hand in and drew it out-- + +"Man, it's money!" + +The two men examined the handful of coins. They were gold. The boys +above were as excited as themselves, and as delighted. + +Joe's comrade said: + +"We'll make quick work of this. There's an old rusty pick over amongst +the weeds in the corner the other side of the fireplace--I saw it a +minute ago." + +He ran and brought the boys' pick and shovel. Injun Joe took the pick, +looked it over critically, shook his head, muttered something to +himself, and then began to use it. The box was soon unearthed. It was +not very large; it was iron bound and had been very strong before the +slow years had injured it. The men contemplated the treasure awhile in +blissful silence. + +"Pard, there's thousands of dollars here," said Injun Joe. + +"'Twas always said that Murrel's gang used to be around here one +summer," the stranger observed. + +"I know it," said Injun Joe; "and this looks like it, I should say." + +"Now you won't need to do that job." + +The half-breed frowned. Said he: + +"You don't know me. Least you don't know all about that thing. 'Tain't +robbery altogether--it's REVENGE!" and a wicked light flamed in his +eyes. "I'll need your help in it. When it's finished--then Texas. Go +home to your Nance and your kids, and stand by till you hear from me." + +"Well--if you say so; what'll we do with this--bury it again?" + +"Yes. [Ravishing delight overhead.] NO! by the great Sachem, no! +[Profound distress overhead.] I'd nearly forgot. That pick had fresh +earth on it! [The boys were sick with terror in a moment.] What +business has a pick and a shovel here? What business with fresh earth +on them? Who brought them here--and where are they gone? Have you heard +anybody?--seen anybody? What! bury it again and leave them to come and +see the ground disturbed? Not exactly--not exactly. We'll take it to my +den." + +"Why, of course! Might have thought of that before. You mean Number +One?" + +"No--Number Two--under the cross. The other place is bad--too common." + +"All right. It's nearly dark enough to start." + +Injun Joe got up and went about from window to window cautiously +peeping out. Presently he said: + +"Who could have brought those tools here? Do you reckon they can be +up-stairs?" + +The boys' breath forsook them. Injun Joe put his hand on his knife, +halted a moment, undecided, and then turned toward the stairway. The +boys thought of the closet, but their strength was gone. The steps came +creaking up the stairs--the intolerable distress of the situation woke +the stricken resolution of the lads--they were about to spring for the +closet, when there was a crash of rotten timbers and Injun Joe landed +on the ground amid the debris of the ruined stairway. He gathered +himself up cursing, and his comrade said: + +"Now what's the use of all that? If it's anybody, and they're up +there, let them STAY there--who cares? If they want to jump down, now, +and get into trouble, who objects? It will be dark in fifteen minutes +--and then let them follow us if they want to. I'm willing. In my +opinion, whoever hove those things in here caught a sight of us and +took us for ghosts or devils or something. I'll bet they're running +yet." + +Joe grumbled awhile; then he agreed with his friend that what daylight +was left ought to be economized in getting things ready for leaving. +Shortly afterward they slipped out of the house in the deepening +twilight, and moved toward the river with their precious box. + +Tom and Huck rose up, weak but vastly relieved, and stared after them +through the chinks between the logs of the house. Follow? Not they. +They were content to reach ground again without broken necks, and take +the townward track over the hill. They did not talk much. They were too +much absorbed in hating themselves--hating the ill luck that made them +take the spade and the pick there. But for that, Injun Joe never would +have suspected. He would have hidden the silver with the gold to wait +there till his "revenge" was satisfied, and then he would have had the +misfortune to find that money turn up missing. Bitter, bitter luck that +the tools were ever brought there! + +They resolved to keep a lookout for that Spaniard when he should come +to town spying out for chances to do his revengeful job, and follow him +to "Number Two," wherever that might be. Then a ghastly thought +occurred to Tom. + +"Revenge? What if he means US, Huck!" + +"Oh, don't!" said Huck, nearly fainting. + +They talked it all over, and as they entered town they agreed to +believe that he might possibly mean somebody else--at least that he +might at least mean nobody but Tom, since only Tom had testified. + +Very, very small comfort it was to Tom to be alone in danger! Company +would be a palpable improvement, he thought. + + + +CHAPTER XXVII + +THE adventure of the day mightily tormented Tom's dreams that night. +Four times he had his hands on that rich treasure and four times it +wasted to nothingness in his fingers as sleep forsook him and +wakefulness brought back the hard reality of his misfortune. As he lay +in the early morning recalling the incidents of his great adventure, he +noticed that they seemed curiously subdued and far away--somewhat as if +they had happened in another world, or in a time long gone by. Then it +occurred to him that the great adventure itself must be a dream! There +was one very strong argument in favor of this idea--namely, that the +quantity of coin he had seen was too vast to be real. He had never seen +as much as fifty dollars in one mass before, and he was like all boys +of his age and station in life, in that he imagined that all references +to "hundreds" and "thousands" were mere fanciful forms of speech, and +that no such sums really existed in the world. He never had supposed +for a moment that so large a sum as a hundred dollars was to be found +in actual money in any one's possession. If his notions of hidden +treasure had been analyzed, they would have been found to consist of a +handful of real dimes and a bushel of vague, splendid, ungraspable +dollars. + +But the incidents of his adventure grew sensibly sharper and clearer +under the attrition of thinking them over, and so he presently found +himself leaning to the impression that the thing might not have been a +dream, after all. This uncertainty must be swept away. He would snatch +a hurried breakfast and go and find Huck. Huck was sitting on the +gunwale of a flatboat, listlessly dangling his feet in the water and +looking very melancholy. Tom concluded to let Huck lead up to the +subject. If he did not do it, then the adventure would be proved to +have been only a dream. + +"Hello, Huck!" + +"Hello, yourself." + +Silence, for a minute. + +"Tom, if we'd 'a' left the blame tools at the dead tree, we'd 'a' got +the money. Oh, ain't it awful!" + +"'Tain't a dream, then, 'tain't a dream! Somehow I most wish it was. +Dog'd if I don't, Huck." + +"What ain't a dream?" + +"Oh, that thing yesterday. I been half thinking it was." + +"Dream! If them stairs hadn't broke down you'd 'a' seen how much dream +it was! I've had dreams enough all night--with that patch-eyed Spanish +devil going for me all through 'em--rot him!" + +"No, not rot him. FIND him! Track the money!" + +"Tom, we'll never find him. A feller don't have only one chance for +such a pile--and that one's lost. I'd feel mighty shaky if I was to see +him, anyway." + +"Well, so'd I; but I'd like to see him, anyway--and track him out--to +his Number Two." + +"Number Two--yes, that's it. I been thinking 'bout that. But I can't +make nothing out of it. What do you reckon it is?" + +"I dono. It's too deep. Say, Huck--maybe it's the number of a house!" + +"Goody!... No, Tom, that ain't it. If it is, it ain't in this +one-horse town. They ain't no numbers here." + +"Well, that's so. Lemme think a minute. Here--it's the number of a +room--in a tavern, you know!" + +"Oh, that's the trick! They ain't only two taverns. We can find out +quick." + +"You stay here, Huck, till I come." + +Tom was off at once. He did not care to have Huck's company in public +places. He was gone half an hour. He found that in the best tavern, No. +2 had long been occupied by a young lawyer, and was still so occupied. +In the less ostentatious house, No. 2 was a mystery. The +tavern-keeper's young son said it was kept locked all the time, and he +never saw anybody go into it or come out of it except at night; he did +not know any particular reason for this state of things; had had some +little curiosity, but it was rather feeble; had made the most of the +mystery by entertaining himself with the idea that that room was +"ha'nted"; had noticed that there was a light in there the night before. + +"That's what I've found out, Huck. I reckon that's the very No. 2 +we're after." + +"I reckon it is, Tom. Now what you going to do?" + +"Lemme think." + +Tom thought a long time. Then he said: + +"I'll tell you. The back door of that No. 2 is the door that comes out +into that little close alley between the tavern and the old rattle trap +of a brick store. Now you get hold of all the door-keys you can find, +and I'll nip all of auntie's, and the first dark night we'll go there +and try 'em. And mind you, keep a lookout for Injun Joe, because he +said he was going to drop into town and spy around once more for a +chance to get his revenge. If you see him, you just follow him; and if +he don't go to that No. 2, that ain't the place." + +"Lordy, I don't want to foller him by myself!" + +"Why, it'll be night, sure. He mightn't ever see you--and if he did, +maybe he'd never think anything." + +"Well, if it's pretty dark I reckon I'll track him. I dono--I dono. +I'll try." + +"You bet I'll follow him, if it's dark, Huck. Why, he might 'a' found +out he couldn't get his revenge, and be going right after that money." + +"It's so, Tom, it's so. I'll foller him; I will, by jingoes!" + +"Now you're TALKING! Don't you ever weaken, Huck, and I won't." + + + +CHAPTER XXVIII + +THAT night Tom and Huck were ready for their adventure. They hung +about the neighborhood of the tavern until after nine, one watching the +alley at a distance and the other the tavern door. Nobody entered the +alley or left it; nobody resembling the Spaniard entered or left the +tavern door. The night promised to be a fair one; so Tom went home with +the understanding that if a considerable degree of darkness came on, +Huck was to come and "maow," whereupon he would slip out and try the +keys. But the night remained clear, and Huck closed his watch and +retired to bed in an empty sugar hogshead about twelve. + +Tuesday the boys had the same ill luck. Also Wednesday. But Thursday +night promised better. Tom slipped out in good season with his aunt's +old tin lantern, and a large towel to blindfold it with. He hid the +lantern in Huck's sugar hogshead and the watch began. An hour before +midnight the tavern closed up and its lights (the only ones +thereabouts) were put out. No Spaniard had been seen. Nobody had +entered or left the alley. Everything was auspicious. The blackness of +darkness reigned, the perfect stillness was interrupted only by +occasional mutterings of distant thunder. + +Tom got his lantern, lit it in the hogshead, wrapped it closely in the +towel, and the two adventurers crept in the gloom toward the tavern. +Huck stood sentry and Tom felt his way into the alley. Then there was a +season of waiting anxiety that weighed upon Huck's spirits like a +mountain. He began to wish he could see a flash from the lantern--it +would frighten him, but it would at least tell him that Tom was alive +yet. It seemed hours since Tom had disappeared. Surely he must have +fainted; maybe he was dead; maybe his heart had burst under terror and +excitement. In his uneasiness Huck found himself drawing closer and +closer to the alley; fearing all sorts of dreadful things, and +momentarily expecting some catastrophe to happen that would take away +his breath. There was not much to take away, for he seemed only able to +inhale it by thimblefuls, and his heart would soon wear itself out, the +way it was beating. Suddenly there was a flash of light and Tom came +tearing by him: "Run!" said he; "run, for your life!" + +He needn't have repeated it; once was enough; Huck was making thirty +or forty miles an hour before the repetition was uttered. The boys +never stopped till they reached the shed of a deserted slaughter-house +at the lower end of the village. Just as they got within its shelter +the storm burst and the rain poured down. As soon as Tom got his breath +he said: + +"Huck, it was awful! I tried two of the keys, just as soft as I could; +but they seemed to make such a power of racket that I couldn't hardly +get my breath I was so scared. They wouldn't turn in the lock, either. +Well, without noticing what I was doing, I took hold of the knob, and +open comes the door! It warn't locked! I hopped in, and shook off the +towel, and, GREAT CAESAR'S GHOST!" + +"What!--what'd you see, Tom?" + +"Huck, I most stepped onto Injun Joe's hand!" + +"No!" + +"Yes! He was lying there, sound asleep on the floor, with his old +patch on his eye and his arms spread out." + +"Lordy, what did you do? Did he wake up?" + +"No, never budged. Drunk, I reckon. I just grabbed that towel and +started!" + +"I'd never 'a' thought of the towel, I bet!" + +"Well, I would. My aunt would make me mighty sick if I lost it." + +"Say, Tom, did you see that box?" + +"Huck, I didn't wait to look around. I didn't see the box, I didn't +see the cross. I didn't see anything but a bottle and a tin cup on the +floor by Injun Joe; yes, I saw two barrels and lots more bottles in the +room. Don't you see, now, what's the matter with that ha'nted room?" + +"How?" + +"Why, it's ha'nted with whiskey! Maybe ALL the Temperance Taverns have +got a ha'nted room, hey, Huck?" + +"Well, I reckon maybe that's so. Who'd 'a' thought such a thing? But +say, Tom, now's a mighty good time to get that box, if Injun Joe's +drunk." + +"It is, that! You try it!" + +Huck shuddered. + +"Well, no--I reckon not." + +"And I reckon not, Huck. Only one bottle alongside of Injun Joe ain't +enough. If there'd been three, he'd be drunk enough and I'd do it." + +There was a long pause for reflection, and then Tom said: + +"Lookyhere, Huck, less not try that thing any more till we know Injun +Joe's not in there. It's too scary. Now, if we watch every night, we'll +be dead sure to see him go out, some time or other, and then we'll +snatch that box quicker'n lightning." + +"Well, I'm agreed. I'll watch the whole night long, and I'll do it +every night, too, if you'll do the other part of the job." + +"All right, I will. All you got to do is to trot up Hooper Street a +block and maow--and if I'm asleep, you throw some gravel at the window +and that'll fetch me." + +"Agreed, and good as wheat!" + +"Now, Huck, the storm's over, and I'll go home. It'll begin to be +daylight in a couple of hours. You go back and watch that long, will +you?" + +"I said I would, Tom, and I will. I'll ha'nt that tavern every night +for a year! I'll sleep all day and I'll stand watch all night." + +"That's all right. Now, where you going to sleep?" + +"In Ben Rogers' hayloft. He lets me, and so does his pap's nigger man, +Uncle Jake. I tote water for Uncle Jake whenever he wants me to, and +any time I ask him he gives me a little something to eat if he can +spare it. That's a mighty good nigger, Tom. He likes me, becuz I don't +ever act as if I was above him. Sometime I've set right down and eat +WITH him. But you needn't tell that. A body's got to do things when +he's awful hungry he wouldn't want to do as a steady thing." + +"Well, if I don't want you in the daytime, I'll let you sleep. I won't +come bothering around. Any time you see something's up, in the night, +just skip right around and maow." + + + +CHAPTER XXIX + +THE first thing Tom heard on Friday morning was a glad piece of news +--Judge Thatcher's family had come back to town the night before. Both +Injun Joe and the treasure sunk into secondary importance for a moment, +and Becky took the chief place in the boy's interest. He saw her and +they had an exhausting good time playing "hi-spy" and "gully-keeper" +with a crowd of their school-mates. The day was completed and crowned +in a peculiarly satisfactory way: Becky teased her mother to appoint +the next day for the long-promised and long-delayed picnic, and she +consented. The child's delight was boundless; and Tom's not more +moderate. The invitations were sent out before sunset, and straightway +the young folks of the village were thrown into a fever of preparation +and pleasurable anticipation. Tom's excitement enabled him to keep +awake until a pretty late hour, and he had good hopes of hearing Huck's +"maow," and of having his treasure to astonish Becky and the picnickers +with, next day; but he was disappointed. No signal came that night. + +Morning came, eventually, and by ten or eleven o'clock a giddy and +rollicking company were gathered at Judge Thatcher's, and everything +was ready for a start. It was not the custom for elderly people to mar +the picnics with their presence. The children were considered safe +enough under the wings of a few young ladies of eighteen and a few +young gentlemen of twenty-three or thereabouts. The old steam ferryboat +was chartered for the occasion; presently the gay throng filed up the +main street laden with provision-baskets. Sid was sick and had to miss +the fun; Mary remained at home to entertain him. The last thing Mrs. +Thatcher said to Becky, was: + +"You'll not get back till late. Perhaps you'd better stay all night +with some of the girls that live near the ferry-landing, child." + +"Then I'll stay with Susy Harper, mamma." + +"Very well. And mind and behave yourself and don't be any trouble." + +Presently, as they tripped along, Tom said to Becky: + +"Say--I'll tell you what we'll do. 'Stead of going to Joe Harper's +we'll climb right up the hill and stop at the Widow Douglas'. She'll +have ice-cream! She has it most every day--dead loads of it. And she'll +be awful glad to have us." + +"Oh, that will be fun!" + +Then Becky reflected a moment and said: + +"But what will mamma say?" + +"How'll she ever know?" + +The girl turned the idea over in her mind, and said reluctantly: + +"I reckon it's wrong--but--" + +"But shucks! Your mother won't know, and so what's the harm? All she +wants is that you'll be safe; and I bet you she'd 'a' said go there if +she'd 'a' thought of it. I know she would!" + +The Widow Douglas' splendid hospitality was a tempting bait. It and +Tom's persuasions presently carried the day. So it was decided to say +nothing anybody about the night's programme. Presently it occurred to +Tom that maybe Huck might come this very night and give the signal. The +thought took a deal of the spirit out of his anticipations. Still he +could not bear to give up the fun at Widow Douglas'. And why should he +give it up, he reasoned--the signal did not come the night before, so +why should it be any more likely to come to-night? The sure fun of the +evening outweighed the uncertain treasure; and, boy-like, he determined +to yield to the stronger inclination and not allow himself to think of +the box of money another time that day. + +Three miles below town the ferryboat stopped at the mouth of a woody +hollow and tied up. The crowd swarmed ashore and soon the forest +distances and craggy heights echoed far and near with shoutings and +laughter. All the different ways of getting hot and tired were gone +through with, and by-and-by the rovers straggled back to camp fortified +with responsible appetites, and then the destruction of the good things +began. After the feast there was a refreshing season of rest and chat +in the shade of spreading oaks. By-and-by somebody shouted: + +"Who's ready for the cave?" + +Everybody was. Bundles of candles were procured, and straightway there +was a general scamper up the hill. The mouth of the cave was up the +hillside--an opening shaped like a letter A. Its massive oaken door +stood unbarred. Within was a small chamber, chilly as an ice-house, and +walled by Nature with solid limestone that was dewy with a cold sweat. +It was romantic and mysterious to stand here in the deep gloom and look +out upon the green valley shining in the sun. But the impressiveness of +the situation quickly wore off, and the romping began again. The moment +a candle was lighted there was a general rush upon the owner of it; a +struggle and a gallant defence followed, but the candle was soon +knocked down or blown out, and then there was a glad clamor of laughter +and a new chase. But all things have an end. By-and-by the procession +went filing down the steep descent of the main avenue, the flickering +rank of lights dimly revealing the lofty walls of rock almost to their +point of junction sixty feet overhead. This main avenue was not more +than eight or ten feet wide. Every few steps other lofty and still +narrower crevices branched from it on either hand--for McDougal's cave +was but a vast labyrinth of crooked aisles that ran into each other and +out again and led nowhere. It was said that one might wander days and +nights together through its intricate tangle of rifts and chasms, and +never find the end of the cave; and that he might go down, and down, +and still down, into the earth, and it was just the same--labyrinth +under labyrinth, and no end to any of them. No man "knew" the cave. +That was an impossible thing. Most of the young men knew a portion of +it, and it was not customary to venture much beyond this known portion. +Tom Sawyer knew as much of the cave as any one. + +The procession moved along the main avenue some three-quarters of a +mile, and then groups and couples began to slip aside into branch +avenues, fly along the dismal corridors, and take each other by +surprise at points where the corridors joined again. Parties were able +to elude each other for the space of half an hour without going beyond +the "known" ground. + +By-and-by, one group after another came straggling back to the mouth +of the cave, panting, hilarious, smeared from head to foot with tallow +drippings, daubed with clay, and entirely delighted with the success of +the day. Then they were astonished to find that they had been taking no +note of time and that night was about at hand. The clanging bell had +been calling for half an hour. However, this sort of close to the day's +adventures was romantic and therefore satisfactory. When the ferryboat +with her wild freight pushed into the stream, nobody cared sixpence for +the wasted time but the captain of the craft. + +Huck was already upon his watch when the ferryboat's lights went +glinting past the wharf. He heard no noise on board, for the young +people were as subdued and still as people usually are who are nearly +tired to death. He wondered what boat it was, and why she did not stop +at the wharf--and then he dropped her out of his mind and put his +attention upon his business. The night was growing cloudy and dark. Ten +o'clock came, and the noise of vehicles ceased, scattered lights began +to wink out, all straggling foot-passengers disappeared, the village +betook itself to its slumbers and left the small watcher alone with the +silence and the ghosts. Eleven o'clock came, and the tavern lights were +put out; darkness everywhere, now. Huck waited what seemed a weary long +time, but nothing happened. His faith was weakening. Was there any use? +Was there really any use? Why not give it up and turn in? + +A noise fell upon his ear. He was all attention in an instant. The +alley door closed softly. He sprang to the corner of the brick store. +The next moment two men brushed by him, and one seemed to have +something under his arm. It must be that box! So they were going to +remove the treasure. Why call Tom now? It would be absurd--the men +would get away with the box and never be found again. No, he would +stick to their wake and follow them; he would trust to the darkness for +security from discovery. So communing with himself, Huck stepped out +and glided along behind the men, cat-like, with bare feet, allowing +them to keep just far enough ahead not to be invisible. + +They moved up the river street three blocks, then turned to the left +up a cross-street. They went straight ahead, then, until they came to +the path that led up Cardiff Hill; this they took. They passed by the +old Welshman's house, half-way up the hill, without hesitating, and +still climbed upward. Good, thought Huck, they will bury it in the old +quarry. But they never stopped at the quarry. They passed on, up the +summit. They plunged into the narrow path between the tall sumach +bushes, and were at once hidden in the gloom. Huck closed up and +shortened his distance, now, for they would never be able to see him. +He trotted along awhile; then slackened his pace, fearing he was +gaining too fast; moved on a piece, then stopped altogether; listened; +no sound; none, save that he seemed to hear the beating of his own +heart. The hooting of an owl came over the hill--ominous sound! But no +footsteps. Heavens, was everything lost! He was about to spring with +winged feet, when a man cleared his throat not four feet from him! +Huck's heart shot into his throat, but he swallowed it again; and then +he stood there shaking as if a dozen agues had taken charge of him at +once, and so weak that he thought he must surely fall to the ground. He +knew where he was. He knew he was within five steps of the stile +leading into Widow Douglas' grounds. Very well, he thought, let them +bury it there; it won't be hard to find. + +Now there was a voice--a very low voice--Injun Joe's: + +"Damn her, maybe she's got company--there's lights, late as it is." + +"I can't see any." + +This was that stranger's voice--the stranger of the haunted house. A +deadly chill went to Huck's heart--this, then, was the "revenge" job! +His thought was, to fly. Then he remembered that the Widow Douglas had +been kind to him more than once, and maybe these men were going to +murder her. He wished he dared venture to warn her; but he knew he +didn't dare--they might come and catch him. He thought all this and +more in the moment that elapsed between the stranger's remark and Injun +Joe's next--which was-- + +"Because the bush is in your way. Now--this way--now you see, don't +you?" + +"Yes. Well, there IS company there, I reckon. Better give it up." + +"Give it up, and I just leaving this country forever! Give it up and +maybe never have another chance. I tell you again, as I've told you +before, I don't care for her swag--you may have it. But her husband was +rough on me--many times he was rough on me--and mainly he was the +justice of the peace that jugged me for a vagrant. And that ain't all. +It ain't a millionth part of it! He had me HORSEWHIPPED!--horsewhipped +in front of the jail, like a nigger!--with all the town looking on! +HORSEWHIPPED!--do you understand? He took advantage of me and died. But +I'll take it out of HER." + +"Oh, don't kill her! Don't do that!" + +"Kill? Who said anything about killing? I would kill HIM if he was +here; but not her. When you want to get revenge on a woman you don't +kill her--bosh! you go for her looks. You slit her nostrils--you notch +her ears like a sow!" + +"By God, that's--" + +"Keep your opinion to yourself! It will be safest for you. I'll tie +her to the bed. If she bleeds to death, is that my fault? I'll not cry, +if she does. My friend, you'll help me in this thing--for MY sake +--that's why you're here--I mightn't be able alone. If you flinch, I'll +kill you. Do you understand that? And if I have to kill you, I'll kill +her--and then I reckon nobody'll ever know much about who done this +business." + +"Well, if it's got to be done, let's get at it. The quicker the +better--I'm all in a shiver." + +"Do it NOW? And company there? Look here--I'll get suspicious of you, +first thing you know. No--we'll wait till the lights are out--there's +no hurry." + +Huck felt that a silence was going to ensue--a thing still more awful +than any amount of murderous talk; so he held his breath and stepped +gingerly back; planted his foot carefully and firmly, after balancing, +one-legged, in a precarious way and almost toppling over, first on one +side and then on the other. He took another step back, with the same +elaboration and the same risks; then another and another, and--a twig +snapped under his foot! His breath stopped and he listened. There was +no sound--the stillness was perfect. His gratitude was measureless. Now +he turned in his tracks, between the walls of sumach bushes--turned +himself as carefully as if he were a ship--and then stepped quickly but +cautiously along. When he emerged at the quarry he felt secure, and so +he picked up his nimble heels and flew. Down, down he sped, till he +reached the Welshman's. He banged at the door, and presently the heads +of the old man and his two stalwart sons were thrust from windows. + +"What's the row there? Who's banging? What do you want?" + +"Let me in--quick! I'll tell everything." + +"Why, who are you?" + +"Huckleberry Finn--quick, let me in!" + +"Huckleberry Finn, indeed! It ain't a name to open many doors, I +judge! But let him in, lads, and let's see what's the trouble." + +"Please don't ever tell I told you," were Huck's first words when he +got in. "Please don't--I'd be killed, sure--but the widow's been good +friends to me sometimes, and I want to tell--I WILL tell if you'll +promise you won't ever say it was me." + +"By George, he HAS got something to tell, or he wouldn't act so!" +exclaimed the old man; "out with it and nobody here'll ever tell, lad." + +Three minutes later the old man and his sons, well armed, were up the +hill, and just entering the sumach path on tiptoe, their weapons in +their hands. Huck accompanied them no further. He hid behind a great +bowlder and fell to listening. There was a lagging, anxious silence, +and then all of a sudden there was an explosion of firearms and a cry. + +Huck waited for no particulars. He sprang away and sped down the hill +as fast as his legs could carry him. + + + +CHAPTER XXX + +AS the earliest suspicion of dawn appeared on Sunday morning, Huck +came groping up the hill and rapped gently at the old Welshman's door. +The inmates were asleep, but it was a sleep that was set on a +hair-trigger, on account of the exciting episode of the night. A call +came from a window: + +"Who's there!" + +Huck's scared voice answered in a low tone: + +"Please let me in! It's only Huck Finn!" + +"It's a name that can open this door night or day, lad!--and welcome!" + +These were strange words to the vagabond boy's ears, and the +pleasantest he had ever heard. He could not recollect that the closing +word had ever been applied in his case before. The door was quickly +unlocked, and he entered. Huck was given a seat and the old man and his +brace of tall sons speedily dressed themselves. + +"Now, my boy, I hope you're good and hungry, because breakfast will be +ready as soon as the sun's up, and we'll have a piping hot one, too +--make yourself easy about that! I and the boys hoped you'd turn up and +stop here last night." + +"I was awful scared," said Huck, "and I run. I took out when the +pistols went off, and I didn't stop for three mile. I've come now becuz +I wanted to know about it, you know; and I come before daylight becuz I +didn't want to run across them devils, even if they was dead." + +"Well, poor chap, you do look as if you'd had a hard night of it--but +there's a bed here for you when you've had your breakfast. No, they +ain't dead, lad--we are sorry enough for that. You see we knew right +where to put our hands on them, by your description; so we crept along +on tiptoe till we got within fifteen feet of them--dark as a cellar +that sumach path was--and just then I found I was going to sneeze. It +was the meanest kind of luck! I tried to keep it back, but no use +--'twas bound to come, and it did come! I was in the lead with my pistol +raised, and when the sneeze started those scoundrels a-rustling to get +out of the path, I sung out, 'Fire boys!' and blazed away at the place +where the rustling was. So did the boys. But they were off in a jiffy, +those villains, and we after them, down through the woods. I judge we +never touched them. They fired a shot apiece as they started, but their +bullets whizzed by and didn't do us any harm. As soon as we lost the +sound of their feet we quit chasing, and went down and stirred up the +constables. They got a posse together, and went off to guard the river +bank, and as soon as it is light the sheriff and a gang are going to +beat up the woods. My boys will be with them presently. I wish we had +some sort of description of those rascals--'twould help a good deal. +But you couldn't see what they were like, in the dark, lad, I suppose?" + +"Oh yes; I saw them down-town and follered them." + +"Splendid! Describe them--describe them, my boy!" + +"One's the old deaf and dumb Spaniard that's ben around here once or +twice, and t'other's a mean-looking, ragged--" + +"That's enough, lad, we know the men! Happened on them in the woods +back of the widow's one day, and they slunk away. Off with you, boys, +and tell the sheriff--get your breakfast to-morrow morning!" + +The Welshman's sons departed at once. As they were leaving the room +Huck sprang up and exclaimed: + +"Oh, please don't tell ANYbody it was me that blowed on them! Oh, +please!" + +"All right if you say it, Huck, but you ought to have the credit of +what you did." + +"Oh no, no! Please don't tell!" + +When the young men were gone, the old Welshman said: + +"They won't tell--and I won't. But why don't you want it known?" + +Huck would not explain, further than to say that he already knew too +much about one of those men and would not have the man know that he +knew anything against him for the whole world--he would be killed for +knowing it, sure. + +The old man promised secrecy once more, and said: + +"How did you come to follow these fellows, lad? Were they looking +suspicious?" + +Huck was silent while he framed a duly cautious reply. Then he said: + +"Well, you see, I'm a kind of a hard lot,--least everybody says so, +and I don't see nothing agin it--and sometimes I can't sleep much, on +account of thinking about it and sort of trying to strike out a new way +of doing. That was the way of it last night. I couldn't sleep, and so I +come along up-street 'bout midnight, a-turning it all over, and when I +got to that old shackly brick store by the Temperance Tavern, I backed +up agin the wall to have another think. Well, just then along comes +these two chaps slipping along close by me, with something under their +arm, and I reckoned they'd stole it. One was a-smoking, and t'other one +wanted a light; so they stopped right before me and the cigars lit up +their faces and I see that the big one was the deaf and dumb Spaniard, +by his white whiskers and the patch on his eye, and t'other one was a +rusty, ragged-looking devil." + +"Could you see the rags by the light of the cigars?" + +This staggered Huck for a moment. Then he said: + +"Well, I don't know--but somehow it seems as if I did." + +"Then they went on, and you--" + +"Follered 'em--yes. That was it. I wanted to see what was up--they +sneaked along so. I dogged 'em to the widder's stile, and stood in the +dark and heard the ragged one beg for the widder, and the Spaniard +swear he'd spile her looks just as I told you and your two--" + +"What! The DEAF AND DUMB man said all that!" + +Huck had made another terrible mistake! He was trying his best to keep +the old man from getting the faintest hint of who the Spaniard might +be, and yet his tongue seemed determined to get him into trouble in +spite of all he could do. He made several efforts to creep out of his +scrape, but the old man's eye was upon him and he made blunder after +blunder. Presently the Welshman said: + +"My boy, don't be afraid of me. I wouldn't hurt a hair of your head +for all the world. No--I'd protect you--I'd protect you. This Spaniard +is not deaf and dumb; you've let that slip without intending it; you +can't cover that up now. You know something about that Spaniard that +you want to keep dark. Now trust me--tell me what it is, and trust me +--I won't betray you." + +Huck looked into the old man's honest eyes a moment, then bent over +and whispered in his ear: + +"'Tain't a Spaniard--it's Injun Joe!" + +The Welshman almost jumped out of his chair. In a moment he said: + +"It's all plain enough, now. When you talked about notching ears and +slitting noses I judged that that was your own embellishment, because +white men don't take that sort of revenge. But an Injun! That's a +different matter altogether." + +During breakfast the talk went on, and in the course of it the old man +said that the last thing which he and his sons had done, before going +to bed, was to get a lantern and examine the stile and its vicinity for +marks of blood. They found none, but captured a bulky bundle of-- + +"Of WHAT?" + +If the words had been lightning they could not have leaped with a more +stunning suddenness from Huck's blanched lips. His eyes were staring +wide, now, and his breath suspended--waiting for the answer. The +Welshman started--stared in return--three seconds--five seconds--ten +--then replied: + +"Of burglar's tools. Why, what's the MATTER with you?" + +Huck sank back, panting gently, but deeply, unutterably grateful. The +Welshman eyed him gravely, curiously--and presently said: + +"Yes, burglar's tools. That appears to relieve you a good deal. But +what did give you that turn? What were YOU expecting we'd found?" + +Huck was in a close place--the inquiring eye was upon him--he would +have given anything for material for a plausible answer--nothing +suggested itself--the inquiring eye was boring deeper and deeper--a +senseless reply offered--there was no time to weigh it, so at a venture +he uttered it--feebly: + +"Sunday-school books, maybe." + +Poor Huck was too distressed to smile, but the old man laughed loud +and joyously, shook up the details of his anatomy from head to foot, +and ended by saying that such a laugh was money in a-man's pocket, +because it cut down the doctor's bill like everything. Then he added: + +"Poor old chap, you're white and jaded--you ain't well a bit--no +wonder you're a little flighty and off your balance. But you'll come +out of it. Rest and sleep will fetch you out all right, I hope." + +Huck was irritated to think he had been such a goose and betrayed such +a suspicious excitement, for he had dropped the idea that the parcel +brought from the tavern was the treasure, as soon as he had heard the +talk at the widow's stile. He had only thought it was not the treasure, +however--he had not known that it wasn't--and so the suggestion of a +captured bundle was too much for his self-possession. But on the whole +he felt glad the little episode had happened, for now he knew beyond +all question that that bundle was not THE bundle, and so his mind was +at rest and exceedingly comfortable. In fact, everything seemed to be +drifting just in the right direction, now; the treasure must be still +in No. 2, the men would be captured and jailed that day, and he and Tom +could seize the gold that night without any trouble or any fear of +interruption. + +Just as breakfast was completed there was a knock at the door. Huck +jumped for a hiding-place, for he had no mind to be connected even +remotely with the late event. The Welshman admitted several ladies and +gentlemen, among them the Widow Douglas, and noticed that groups of +citizens were climbing up the hill--to stare at the stile. So the news +had spread. The Welshman had to tell the story of the night to the +visitors. The widow's gratitude for her preservation was outspoken. + +"Don't say a word about it, madam. There's another that you're more +beholden to than you are to me and my boys, maybe, but he don't allow +me to tell his name. We wouldn't have been there but for him." + +Of course this excited a curiosity so vast that it almost belittled +the main matter--but the Welshman allowed it to eat into the vitals of +his visitors, and through them be transmitted to the whole town, for he +refused to part with his secret. When all else had been learned, the +widow said: + +"I went to sleep reading in bed and slept straight through all that +noise. Why didn't you come and wake me?" + +"We judged it warn't worth while. Those fellows warn't likely to come +again--they hadn't any tools left to work with, and what was the use of +waking you up and scaring you to death? My three negro men stood guard +at your house all the rest of the night. They've just come back." + +More visitors came, and the story had to be told and retold for a +couple of hours more. + +There was no Sabbath-school during day-school vacation, but everybody +was early at church. The stirring event was well canvassed. News came +that not a sign of the two villains had been yet discovered. When the +sermon was finished, Judge Thatcher's wife dropped alongside of Mrs. +Harper as she moved down the aisle with the crowd and said: + +"Is my Becky going to sleep all day? I just expected she would be +tired to death." + +"Your Becky?" + +"Yes," with a startled look--"didn't she stay with you last night?" + +"Why, no." + +Mrs. Thatcher turned pale, and sank into a pew, just as Aunt Polly, +talking briskly with a friend, passed by. Aunt Polly said: + +"Good-morning, Mrs. Thatcher. Good-morning, Mrs. Harper. I've got a +boy that's turned up missing. I reckon my Tom stayed at your house last +night--one of you. And now he's afraid to come to church. I've got to +settle with him." + +Mrs. Thatcher shook her head feebly and turned paler than ever. + +"He didn't stay with us," said Mrs. Harper, beginning to look uneasy. +A marked anxiety came into Aunt Polly's face. + +"Joe Harper, have you seen my Tom this morning?" + +"No'm." + +"When did you see him last?" + +Joe tried to remember, but was not sure he could say. The people had +stopped moving out of church. Whispers passed along, and a boding +uneasiness took possession of every countenance. Children were +anxiously questioned, and young teachers. They all said they had not +noticed whether Tom and Becky were on board the ferryboat on the +homeward trip; it was dark; no one thought of inquiring if any one was +missing. One young man finally blurted out his fear that they were +still in the cave! Mrs. Thatcher swooned away. Aunt Polly fell to +crying and wringing her hands. + +The alarm swept from lip to lip, from group to group, from street to +street, and within five minutes the bells were wildly clanging and the +whole town was up! The Cardiff Hill episode sank into instant +insignificance, the burglars were forgotten, horses were saddled, +skiffs were manned, the ferryboat ordered out, and before the horror +was half an hour old, two hundred men were pouring down highroad and +river toward the cave. + +All the long afternoon the village seemed empty and dead. Many women +visited Aunt Polly and Mrs. Thatcher and tried to comfort them. They +cried with them, too, and that was still better than words. All the +tedious night the town waited for news; but when the morning dawned at +last, all the word that came was, "Send more candles--and send food." +Mrs. Thatcher was almost crazed; and Aunt Polly, also. Judge Thatcher +sent messages of hope and encouragement from the cave, but they +conveyed no real cheer. + +The old Welshman came home toward daylight, spattered with +candle-grease, smeared with clay, and almost worn out. He found Huck +still in the bed that had been provided for him, and delirious with +fever. The physicians were all at the cave, so the Widow Douglas came +and took charge of the patient. She said she would do her best by him, +because, whether he was good, bad, or indifferent, he was the Lord's, +and nothing that was the Lord's was a thing to be neglected. The +Welshman said Huck had good spots in him, and the widow said: + +"You can depend on it. That's the Lord's mark. He don't leave it off. +He never does. Puts it somewhere on every creature that comes from his +hands." + +Early in the forenoon parties of jaded men began to straggle into the +village, but the strongest of the citizens continued searching. All the +news that could be gained was that remotenesses of the cavern were +being ransacked that had never been visited before; that every corner +and crevice was going to be thoroughly searched; that wherever one +wandered through the maze of passages, lights were to be seen flitting +hither and thither in the distance, and shoutings and pistol-shots sent +their hollow reverberations to the ear down the sombre aisles. In one +place, far from the section usually traversed by tourists, the names +"BECKY & TOM" had been found traced upon the rocky wall with +candle-smoke, and near at hand a grease-soiled bit of ribbon. Mrs. +Thatcher recognized the ribbon and cried over it. She said it was the +last relic she should ever have of her child; and that no other memorial +of her could ever be so precious, because this one parted latest from +the living body before the awful death came. Some said that now and +then, in the cave, a far-away speck of light would glimmer, and then a +glorious shout would burst forth and a score of men go trooping down the +echoing aisle--and then a sickening disappointment always followed; the +children were not there; it was only a searcher's light. + +Three dreadful days and nights dragged their tedious hours along, and +the village sank into a hopeless stupor. No one had heart for anything. +The accidental discovery, just made, that the proprietor of the +Temperance Tavern kept liquor on his premises, scarcely fluttered the +public pulse, tremendous as the fact was. In a lucid interval, Huck +feebly led up to the subject of taverns, and finally asked--dimly +dreading the worst--if anything had been discovered at the Temperance +Tavern since he had been ill. + +"Yes," said the widow. + +Huck started up in bed, wild-eyed: + +"What? What was it?" + +"Liquor!--and the place has been shut up. Lie down, child--what a turn +you did give me!" + +"Only tell me just one thing--only just one--please! Was it Tom Sawyer +that found it?" + +The widow burst into tears. "Hush, hush, child, hush! I've told you +before, you must NOT talk. You are very, very sick!" + +Then nothing but liquor had been found; there would have been a great +powwow if it had been the gold. So the treasure was gone forever--gone +forever! But what could she be crying about? Curious that she should +cry. + +These thoughts worked their dim way through Huck's mind, and under the +weariness they gave him he fell asleep. The widow said to herself: + +"There--he's asleep, poor wreck. Tom Sawyer find it! Pity but somebody +could find Tom Sawyer! Ah, there ain't many left, now, that's got hope +enough, or strength enough, either, to go on searching." + + + +CHAPTER XXXI + +NOW to return to Tom and Becky's share in the picnic. They tripped +along the murky aisles with the rest of the company, visiting the +familiar wonders of the cave--wonders dubbed with rather +over-descriptive names, such as "The Drawing-Room," "The Cathedral," +"Aladdin's Palace," and so on. Presently the hide-and-seek frolicking +began, and Tom and Becky engaged in it with zeal until the exertion +began to grow a trifle wearisome; then they wandered down a sinuous +avenue holding their candles aloft and reading the tangled web-work of +names, dates, post-office addresses, and mottoes with which the rocky +walls had been frescoed (in candle-smoke). Still drifting along and +talking, they scarcely noticed that they were now in a part of the cave +whose walls were not frescoed. They smoked their own names under an +overhanging shelf and moved on. Presently they came to a place where a +little stream of water, trickling over a ledge and carrying a limestone +sediment with it, had, in the slow-dragging ages, formed a laced and +ruffled Niagara in gleaming and imperishable stone. Tom squeezed his +small body behind it in order to illuminate it for Becky's +gratification. He found that it curtained a sort of steep natural +stairway which was enclosed between narrow walls, and at once the +ambition to be a discoverer seized him. Becky responded to his call, +and they made a smoke-mark for future guidance, and started upon their +quest. They wound this way and that, far down into the secret depths of +the cave, made another mark, and branched off in search of novelties to +tell the upper world about. In one place they found a spacious cavern, +from whose ceiling depended a multitude of shining stalactites of the +length and circumference of a man's leg; they walked all about it, +wondering and admiring, and presently left it by one of the numerous +passages that opened into it. This shortly brought them to a bewitching +spring, whose basin was incrusted with a frostwork of glittering +crystals; it was in the midst of a cavern whose walls were supported by +many fantastic pillars which had been formed by the joining of great +stalactites and stalagmites together, the result of the ceaseless +water-drip of centuries. Under the roof vast knots of bats had packed +themselves together, thousands in a bunch; the lights disturbed the +creatures and they came flocking down by hundreds, squeaking and +darting furiously at the candles. Tom knew their ways and the danger of +this sort of conduct. He seized Becky's hand and hurried her into the +first corridor that offered; and none too soon, for a bat struck +Becky's light out with its wing while she was passing out of the +cavern. The bats chased the children a good distance; but the fugitives +plunged into every new passage that offered, and at last got rid of the +perilous things. Tom found a subterranean lake, shortly, which +stretched its dim length away until its shape was lost in the shadows. +He wanted to explore its borders, but concluded that it would be best +to sit down and rest awhile, first. Now, for the first time, the deep +stillness of the place laid a clammy hand upon the spirits of the +children. Becky said: + +"Why, I didn't notice, but it seems ever so long since I heard any of +the others." + +"Come to think, Becky, we are away down below them--and I don't know +how far away north, or south, or east, or whichever it is. We couldn't +hear them here." + +Becky grew apprehensive. + +"I wonder how long we've been down here, Tom? We better start back." + +"Yes, I reckon we better. P'raps we better." + +"Can you find the way, Tom? It's all a mixed-up crookedness to me." + +"I reckon I could find it--but then the bats. If they put our candles +out it will be an awful fix. Let's try some other way, so as not to go +through there." + +"Well. But I hope we won't get lost. It would be so awful!" and the +girl shuddered at the thought of the dreadful possibilities. + +They started through a corridor, and traversed it in silence a long +way, glancing at each new opening, to see if there was anything +familiar about the look of it; but they were all strange. Every time +Tom made an examination, Becky would watch his face for an encouraging +sign, and he would say cheerily: + +"Oh, it's all right. This ain't the one, but we'll come to it right +away!" + +But he felt less and less hopeful with each failure, and presently +began to turn off into diverging avenues at sheer random, in desperate +hope of finding the one that was wanted. He still said it was "all +right," but there was such a leaden dread at his heart that the words +had lost their ring and sounded just as if he had said, "All is lost!" +Becky clung to his side in an anguish of fear, and tried hard to keep +back the tears, but they would come. At last she said: + +"Oh, Tom, never mind the bats, let's go back that way! We seem to get +worse and worse off all the time." + +"Listen!" said he. + +Profound silence; silence so deep that even their breathings were +conspicuous in the hush. Tom shouted. The call went echoing down the +empty aisles and died out in the distance in a faint sound that +resembled a ripple of mocking laughter. + +"Oh, don't do it again, Tom, it is too horrid," said Becky. + +"It is horrid, but I better, Becky; they might hear us, you know," and +he shouted again. + +The "might" was even a chillier horror than the ghostly laughter, it +so confessed a perishing hope. The children stood still and listened; +but there was no result. Tom turned upon the back track at once, and +hurried his steps. It was but a little while before a certain +indecision in his manner revealed another fearful fact to Becky--he +could not find his way back! + +"Oh, Tom, you didn't make any marks!" + +"Becky, I was such a fool! Such a fool! I never thought we might want +to come back! No--I can't find the way. It's all mixed up." + +"Tom, Tom, we're lost! we're lost! We never can get out of this awful +place! Oh, why DID we ever leave the others!" + +She sank to the ground and burst into such a frenzy of crying that Tom +was appalled with the idea that she might die, or lose her reason. He +sat down by her and put his arms around her; she buried her face in his +bosom, she clung to him, she poured out her terrors, her unavailing +regrets, and the far echoes turned them all to jeering laughter. Tom +begged her to pluck up hope again, and she said she could not. He fell +to blaming and abusing himself for getting her into this miserable +situation; this had a better effect. She said she would try to hope +again, she would get up and follow wherever he might lead if only he +would not talk like that any more. For he was no more to blame than +she, she said. + +So they moved on again--aimlessly--simply at random--all they could do +was to move, keep moving. For a little while, hope made a show of +reviving--not with any reason to back it, but only because it is its +nature to revive when the spring has not been taken out of it by age +and familiarity with failure. + +By-and-by Tom took Becky's candle and blew it out. This economy meant +so much! Words were not needed. Becky understood, and her hope died +again. She knew that Tom had a whole candle and three or four pieces in +his pockets--yet he must economize. + +By-and-by, fatigue began to assert its claims; the children tried to +pay attention, for it was dreadful to think of sitting down when time +was grown to be so precious, moving, in some direction, in any +direction, was at least progress and might bear fruit; but to sit down +was to invite death and shorten its pursuit. + +At last Becky's frail limbs refused to carry her farther. She sat +down. Tom rested with her, and they talked of home, and the friends +there, and the comfortable beds and, above all, the light! Becky cried, +and Tom tried to think of some way of comforting her, but all his +encouragements were grown threadbare with use, and sounded like +sarcasms. Fatigue bore so heavily upon Becky that she drowsed off to +sleep. Tom was grateful. He sat looking into her drawn face and saw it +grow smooth and natural under the influence of pleasant dreams; and +by-and-by a smile dawned and rested there. The peaceful face reflected +somewhat of peace and healing into his own spirit, and his thoughts +wandered away to bygone times and dreamy memories. While he was deep in +his musings, Becky woke up with a breezy little laugh--but it was +stricken dead upon her lips, and a groan followed it. + +"Oh, how COULD I sleep! I wish I never, never had waked! No! No, I +don't, Tom! Don't look so! I won't say it again." + +"I'm glad you've slept, Becky; you'll feel rested, now, and we'll find +the way out." + +"We can try, Tom; but I've seen such a beautiful country in my dream. +I reckon we are going there." + +"Maybe not, maybe not. Cheer up, Becky, and let's go on trying." + +They rose up and wandered along, hand in hand and hopeless. They tried +to estimate how long they had been in the cave, but all they knew was +that it seemed days and weeks, and yet it was plain that this could not +be, for their candles were not gone yet. A long time after this--they +could not tell how long--Tom said they must go softly and listen for +dripping water--they must find a spring. They found one presently, and +Tom said it was time to rest again. Both were cruelly tired, yet Becky +said she thought she could go a little farther. She was surprised to +hear Tom dissent. She could not understand it. They sat down, and Tom +fastened his candle to the wall in front of them with some clay. +Thought was soon busy; nothing was said for some time. Then Becky broke +the silence: + +"Tom, I am so hungry!" + +Tom took something out of his pocket. + +"Do you remember this?" said he. + +Becky almost smiled. + +"It's our wedding-cake, Tom." + +"Yes--I wish it was as big as a barrel, for it's all we've got." + +"I saved it from the picnic for us to dream on, Tom, the way grown-up +people do with wedding-cake--but it'll be our--" + +She dropped the sentence where it was. Tom divided the cake and Becky +ate with good appetite, while Tom nibbled at his moiety. There was +abundance of cold water to finish the feast with. By-and-by Becky +suggested that they move on again. Tom was silent a moment. Then he +said: + +"Becky, can you bear it if I tell you something?" + +Becky's face paled, but she thought she could. + +"Well, then, Becky, we must stay here, where there's water to drink. +That little piece is our last candle!" + +Becky gave loose to tears and wailings. Tom did what he could to +comfort her, but with little effect. At length Becky said: + +"Tom!" + +"Well, Becky?" + +"They'll miss us and hunt for us!" + +"Yes, they will! Certainly they will!" + +"Maybe they're hunting for us now, Tom." + +"Why, I reckon maybe they are. I hope they are." + +"When would they miss us, Tom?" + +"When they get back to the boat, I reckon." + +"Tom, it might be dark then--would they notice we hadn't come?" + +"I don't know. But anyway, your mother would miss you as soon as they +got home." + +A frightened look in Becky's face brought Tom to his senses and he saw +that he had made a blunder. Becky was not to have gone home that night! +The children became silent and thoughtful. In a moment a new burst of +grief from Becky showed Tom that the thing in his mind had struck hers +also--that the Sabbath morning might be half spent before Mrs. Thatcher +discovered that Becky was not at Mrs. Harper's. + +The children fastened their eyes upon their bit of candle and watched +it melt slowly and pitilessly away; saw the half inch of wick stand +alone at last; saw the feeble flame rise and fall, climb the thin +column of smoke, linger at its top a moment, and then--the horror of +utter darkness reigned! + +How long afterward it was that Becky came to a slow consciousness that +she was crying in Tom's arms, neither could tell. All that they knew +was, that after what seemed a mighty stretch of time, both awoke out of +a dead stupor of sleep and resumed their miseries once more. Tom said +it might be Sunday, now--maybe Monday. He tried to get Becky to talk, +but her sorrows were too oppressive, all her hopes were gone. Tom said +that they must have been missed long ago, and no doubt the search was +going on. He would shout and maybe some one would come. He tried it; +but in the darkness the distant echoes sounded so hideously that he +tried it no more. + +The hours wasted away, and hunger came to torment the captives again. +A portion of Tom's half of the cake was left; they divided and ate it. +But they seemed hungrier than before. The poor morsel of food only +whetted desire. + +By-and-by Tom said: + +"SH! Did you hear that?" + +Both held their breath and listened. There was a sound like the +faintest, far-off shout. Instantly Tom answered it, and leading Becky +by the hand, started groping down the corridor in its direction. +Presently he listened again; again the sound was heard, and apparently +a little nearer. + +"It's them!" said Tom; "they're coming! Come along, Becky--we're all +right now!" + +The joy of the prisoners was almost overwhelming. Their speed was +slow, however, because pitfalls were somewhat common, and had to be +guarded against. They shortly came to one and had to stop. It might be +three feet deep, it might be a hundred--there was no passing it at any +rate. Tom got down on his breast and reached as far down as he could. +No bottom. They must stay there and wait until the searchers came. They +listened; evidently the distant shoutings were growing more distant! a +moment or two more and they had gone altogether. The heart-sinking +misery of it! Tom whooped until he was hoarse, but it was of no use. He +talked hopefully to Becky; but an age of anxious waiting passed and no +sounds came again. + +The children groped their way back to the spring. The weary time +dragged on; they slept again, and awoke famished and woe-stricken. Tom +believed it must be Tuesday by this time. + +Now an idea struck him. There were some side passages near at hand. It +would be better to explore some of these than bear the weight of the +heavy time in idleness. He took a kite-line from his pocket, tied it to +a projection, and he and Becky started, Tom in the lead, unwinding the +line as he groped along. At the end of twenty steps the corridor ended +in a "jumping-off place." Tom got down on his knees and felt below, and +then as far around the corner as he could reach with his hands +conveniently; he made an effort to stretch yet a little farther to the +right, and at that moment, not twenty yards away, a human hand, holding +a candle, appeared from behind a rock! Tom lifted up a glorious shout, +and instantly that hand was followed by the body it belonged to--Injun +Joe's! Tom was paralyzed; he could not move. He was vastly gratified +the next moment, to see the "Spaniard" take to his heels and get +himself out of sight. Tom wondered that Joe had not recognized his +voice and come over and killed him for testifying in court. But the +echoes must have disguised the voice. Without doubt, that was it, he +reasoned. Tom's fright weakened every muscle in his body. He said to +himself that if he had strength enough to get back to the spring he +would stay there, and nothing should tempt him to run the risk of +meeting Injun Joe again. He was careful to keep from Becky what it was +he had seen. He told her he had only shouted "for luck." + +But hunger and wretchedness rise superior to fears in the long run. +Another tedious wait at the spring and another long sleep brought +changes. The children awoke tortured with a raging hunger. Tom believed +that it must be Wednesday or Thursday or even Friday or Saturday, now, +and that the search had been given over. He proposed to explore another +passage. He felt willing to risk Injun Joe and all other terrors. But +Becky was very weak. She had sunk into a dreary apathy and would not be +roused. She said she would wait, now, where she was, and die--it would +not be long. She told Tom to go with the kite-line and explore if he +chose; but she implored him to come back every little while and speak +to her; and she made him promise that when the awful time came, he +would stay by her and hold her hand until all was over. + +Tom kissed her, with a choking sensation in his throat, and made a +show of being confident of finding the searchers or an escape from the +cave; then he took the kite-line in his hand and went groping down one +of the passages on his hands and knees, distressed with hunger and sick +with bodings of coming doom. + + + +CHAPTER XXXII + +TUESDAY afternoon came, and waned to the twilight. The village of St. +Petersburg still mourned. The lost children had not been found. Public +prayers had been offered up for them, and many and many a private +prayer that had the petitioner's whole heart in it; but still no good +news came from the cave. The majority of the searchers had given up the +quest and gone back to their daily avocations, saying that it was plain +the children could never be found. Mrs. Thatcher was very ill, and a +great part of the time delirious. People said it was heartbreaking to +hear her call her child, and raise her head and listen a whole minute +at a time, then lay it wearily down again with a moan. Aunt Polly had +drooped into a settled melancholy, and her gray hair had grown almost +white. The village went to its rest on Tuesday night, sad and forlorn. + +Away in the middle of the night a wild peal burst from the village +bells, and in a moment the streets were swarming with frantic half-clad +people, who shouted, "Turn out! turn out! they're found! they're +found!" Tin pans and horns were added to the din, the population massed +itself and moved toward the river, met the children coming in an open +carriage drawn by shouting citizens, thronged around it, joined its +homeward march, and swept magnificently up the main street roaring +huzzah after huzzah! + +The village was illuminated; nobody went to bed again; it was the +greatest night the little town had ever seen. During the first half-hour +a procession of villagers filed through Judge Thatcher's house, seized +the saved ones and kissed them, squeezed Mrs. Thatcher's hand, tried to +speak but couldn't--and drifted out raining tears all over the place. + +Aunt Polly's happiness was complete, and Mrs. Thatcher's nearly so. It +would be complete, however, as soon as the messenger dispatched with +the great news to the cave should get the word to her husband. Tom lay +upon a sofa with an eager auditory about him and told the history of +the wonderful adventure, putting in many striking additions to adorn it +withal; and closed with a description of how he left Becky and went on +an exploring expedition; how he followed two avenues as far as his +kite-line would reach; how he followed a third to the fullest stretch of +the kite-line, and was about to turn back when he glimpsed a far-off +speck that looked like daylight; dropped the line and groped toward it, +pushed his head and shoulders through a small hole, and saw the broad +Mississippi rolling by! And if it had only happened to be night he would +not have seen that speck of daylight and would not have explored that +passage any more! He told how he went back for Becky and broke the good +news and she told him not to fret her with such stuff, for she was +tired, and knew she was going to die, and wanted to. He described how he +labored with her and convinced her; and how she almost died for joy when +she had groped to where she actually saw the blue speck of daylight; how +he pushed his way out at the hole and then helped her out; how they sat +there and cried for gladness; how some men came along in a skiff and Tom +hailed them and told them their situation and their famished condition; +how the men didn't believe the wild tale at first, "because," said they, +"you are five miles down the river below the valley the cave is in" +--then took them aboard, rowed to a house, gave them supper, made them +rest till two or three hours after dark and then brought them home. + +Before day-dawn, Judge Thatcher and the handful of searchers with him +were tracked out, in the cave, by the twine clews they had strung +behind them, and informed of the great news. + +Three days and nights of toil and hunger in the cave were not to be +shaken off at once, as Tom and Becky soon discovered. They were +bedridden all of Wednesday and Thursday, and seemed to grow more and +more tired and worn, all the time. Tom got about, a little, on +Thursday, was down-town Friday, and nearly as whole as ever Saturday; +but Becky did not leave her room until Sunday, and then she looked as +if she had passed through a wasting illness. + +Tom learned of Huck's sickness and went to see him on Friday, but +could not be admitted to the bedroom; neither could he on Saturday or +Sunday. He was admitted daily after that, but was warned to keep still +about his adventure and introduce no exciting topic. The Widow Douglas +stayed by to see that he obeyed. At home Tom learned of the Cardiff +Hill event; also that the "ragged man's" body had eventually been found +in the river near the ferry-landing; he had been drowned while trying +to escape, perhaps. + +About a fortnight after Tom's rescue from the cave, he started off to +visit Huck, who had grown plenty strong enough, now, to hear exciting +talk, and Tom had some that would interest him, he thought. Judge +Thatcher's house was on Tom's way, and he stopped to see Becky. The +Judge and some friends set Tom to talking, and some one asked him +ironically if he wouldn't like to go to the cave again. Tom said he +thought he wouldn't mind it. The Judge said: + +"Well, there are others just like you, Tom, I've not the least doubt. +But we have taken care of that. Nobody will get lost in that cave any +more." + +"Why?" + +"Because I had its big door sheathed with boiler iron two weeks ago, +and triple-locked--and I've got the keys." + +Tom turned as white as a sheet. + +"What's the matter, boy! Here, run, somebody! Fetch a glass of water!" + +The water was brought and thrown into Tom's face. + +"Ah, now you're all right. What was the matter with you, Tom?" + +"Oh, Judge, Injun Joe's in the cave!" + + + +CHAPTER XXXIII + +WITHIN a few minutes the news had spread, and a dozen skiff-loads of +men were on their way to McDougal's cave, and the ferryboat, well +filled with passengers, soon followed. Tom Sawyer was in the skiff that +bore Judge Thatcher. + +When the cave door was unlocked, a sorrowful sight presented itself in +the dim twilight of the place. Injun Joe lay stretched upon the ground, +dead, with his face close to the crack of the door, as if his longing +eyes had been fixed, to the latest moment, upon the light and the cheer +of the free world outside. Tom was touched, for he knew by his own +experience how this wretch had suffered. His pity was moved, but +nevertheless he felt an abounding sense of relief and security, now, +which revealed to him in a degree which he had not fully appreciated +before how vast a weight of dread had been lying upon him since the day +he lifted his voice against this bloody-minded outcast. + +Injun Joe's bowie-knife lay close by, its blade broken in two. The +great foundation-beam of the door had been chipped and hacked through, +with tedious labor; useless labor, too, it was, for the native rock +formed a sill outside it, and upon that stubborn material the knife had +wrought no effect; the only damage done was to the knife itself. But if +there had been no stony obstruction there the labor would have been +useless still, for if the beam had been wholly cut away Injun Joe could +not have squeezed his body under the door, and he knew it. So he had +only hacked that place in order to be doing something--in order to pass +the weary time--in order to employ his tortured faculties. Ordinarily +one could find half a dozen bits of candle stuck around in the crevices +of this vestibule, left there by tourists; but there were none now. The +prisoner had searched them out and eaten them. He had also contrived to +catch a few bats, and these, also, he had eaten, leaving only their +claws. The poor unfortunate had starved to death. In one place, near at +hand, a stalagmite had been slowly growing up from the ground for ages, +builded by the water-drip from a stalactite overhead. The captive had +broken off the stalagmite, and upon the stump had placed a stone, +wherein he had scooped a shallow hollow to catch the precious drop +that fell once in every three minutes with the dreary regularity of a +clock-tick--a dessertspoonful once in four and twenty hours. That drop +was falling when the Pyramids were new; when Troy fell; when the +foundations of Rome were laid; when Christ was crucified; when the +Conqueror created the British empire; when Columbus sailed; when the +massacre at Lexington was "news." It is falling now; it will still be +falling when all these things shall have sunk down the afternoon of +history, and the twilight of tradition, and been swallowed up in the +thick night of oblivion. Has everything a purpose and a mission? Did +this drop fall patiently during five thousand years to be ready for +this flitting human insect's need? and has it another important object +to accomplish ten thousand years to come? No matter. It is many and +many a year since the hapless half-breed scooped out the stone to catch +the priceless drops, but to this day the tourist stares longest at that +pathetic stone and that slow-dropping water when he comes to see the +wonders of McDougal's cave. Injun Joe's cup stands first in the list of +the cavern's marvels; even "Aladdin's Palace" cannot rival it. + +Injun Joe was buried near the mouth of the cave; and people flocked +there in boats and wagons from the towns and from all the farms and +hamlets for seven miles around; they brought their children, and all +sorts of provisions, and confessed that they had had almost as +satisfactory a time at the funeral as they could have had at the +hanging. + +This funeral stopped the further growth of one thing--the petition to +the governor for Injun Joe's pardon. The petition had been largely +signed; many tearful and eloquent meetings had been held, and a +committee of sappy women been appointed to go in deep mourning and wail +around the governor, and implore him to be a merciful ass and trample +his duty under foot. Injun Joe was believed to have killed five +citizens of the village, but what of that? If he had been Satan himself +there would have been plenty of weaklings ready to scribble their names +to a pardon-petition, and drip a tear on it from their permanently +impaired and leaky water-works. + +The morning after the funeral Tom took Huck to a private place to have +an important talk. Huck had learned all about Tom's adventure from the +Welshman and the Widow Douglas, by this time, but Tom said he reckoned +there was one thing they had not told him; that thing was what he +wanted to talk about now. Huck's face saddened. He said: + +"I know what it is. You got into No. 2 and never found anything but +whiskey. Nobody told me it was you; but I just knowed it must 'a' ben +you, soon as I heard 'bout that whiskey business; and I knowed you +hadn't got the money becuz you'd 'a' got at me some way or other and +told me even if you was mum to everybody else. Tom, something's always +told me we'd never get holt of that swag." + +"Why, Huck, I never told on that tavern-keeper. YOU know his tavern +was all right the Saturday I went to the picnic. Don't you remember you +was to watch there that night?" + +"Oh yes! Why, it seems 'bout a year ago. It was that very night that I +follered Injun Joe to the widder's." + +"YOU followed him?" + +"Yes--but you keep mum. I reckon Injun Joe's left friends behind him, +and I don't want 'em souring on me and doing me mean tricks. If it +hadn't ben for me he'd be down in Texas now, all right." + +Then Huck told his entire adventure in confidence to Tom, who had only +heard of the Welshman's part of it before. + +"Well," said Huck, presently, coming back to the main question, +"whoever nipped the whiskey in No. 2, nipped the money, too, I reckon +--anyways it's a goner for us, Tom." + +"Huck, that money wasn't ever in No. 2!" + +"What!" Huck searched his comrade's face keenly. "Tom, have you got on +the track of that money again?" + +"Huck, it's in the cave!" + +Huck's eyes blazed. + +"Say it again, Tom." + +"The money's in the cave!" + +"Tom--honest injun, now--is it fun, or earnest?" + +"Earnest, Huck--just as earnest as ever I was in my life. Will you go +in there with me and help get it out?" + +"I bet I will! I will if it's where we can blaze our way to it and not +get lost." + +"Huck, we can do that without the least little bit of trouble in the +world." + +"Good as wheat! What makes you think the money's--" + +"Huck, you just wait till we get in there. If we don't find it I'll +agree to give you my drum and every thing I've got in the world. I +will, by jings." + +"All right--it's a whiz. When do you say?" + +"Right now, if you say it. Are you strong enough?" + +"Is it far in the cave? I ben on my pins a little, three or four days, +now, but I can't walk more'n a mile, Tom--least I don't think I could." + +"It's about five mile into there the way anybody but me would go, +Huck, but there's a mighty short cut that they don't anybody but me +know about. Huck, I'll take you right to it in a skiff. I'll float the +skiff down there, and I'll pull it back again all by myself. You +needn't ever turn your hand over." + +"Less start right off, Tom." + +"All right. We want some bread and meat, and our pipes, and a little +bag or two, and two or three kite-strings, and some of these +new-fangled things they call lucifer matches. I tell you, many's +the time I wished I had some when I was in there before." + +A trifle after noon the boys borrowed a small skiff from a citizen who +was absent, and got under way at once. When they were several miles +below "Cave Hollow," Tom said: + +"Now you see this bluff here looks all alike all the way down from the +cave hollow--no houses, no wood-yards, bushes all alike. But do you see +that white place up yonder where there's been a landslide? Well, that's +one of my marks. We'll get ashore, now." + +They landed. + +"Now, Huck, where we're a-standing you could touch that hole I got out +of with a fishing-pole. See if you can find it." + +Huck searched all the place about, and found nothing. Tom proudly +marched into a thick clump of sumach bushes and said: + +"Here you are! Look at it, Huck; it's the snuggest hole in this +country. You just keep mum about it. All along I've been wanting to be +a robber, but I knew I'd got to have a thing like this, and where to +run across it was the bother. We've got it now, and we'll keep it +quiet, only we'll let Joe Harper and Ben Rogers in--because of course +there's got to be a Gang, or else there wouldn't be any style about it. +Tom Sawyer's Gang--it sounds splendid, don't it, Huck?" + +"Well, it just does, Tom. And who'll we rob?" + +"Oh, most anybody. Waylay people--that's mostly the way." + +"And kill them?" + +"No, not always. Hive them in the cave till they raise a ransom." + +"What's a ransom?" + +"Money. You make them raise all they can, off'n their friends; and +after you've kept them a year, if it ain't raised then you kill them. +That's the general way. Only you don't kill the women. You shut up the +women, but you don't kill them. They're always beautiful and rich, and +awfully scared. You take their watches and things, but you always take +your hat off and talk polite. They ain't anybody as polite as robbers +--you'll see that in any book. Well, the women get to loving you, and +after they've been in the cave a week or two weeks they stop crying and +after that you couldn't get them to leave. If you drove them out they'd +turn right around and come back. It's so in all the books." + +"Why, it's real bully, Tom. I believe it's better'n to be a pirate." + +"Yes, it's better in some ways, because it's close to home and +circuses and all that." + +By this time everything was ready and the boys entered the hole, Tom +in the lead. They toiled their way to the farther end of the tunnel, +then made their spliced kite-strings fast and moved on. A few steps +brought them to the spring, and Tom felt a shudder quiver all through +him. He showed Huck the fragment of candle-wick perched on a lump of +clay against the wall, and described how he and Becky had watched the +flame struggle and expire. + +The boys began to quiet down to whispers, now, for the stillness and +gloom of the place oppressed their spirits. They went on, and presently +entered and followed Tom's other corridor until they reached the +"jumping-off place." The candles revealed the fact that it was not +really a precipice, but only a steep clay hill twenty or thirty feet +high. Tom whispered: + +"Now I'll show you something, Huck." + +He held his candle aloft and said: + +"Look as far around the corner as you can. Do you see that? There--on +the big rock over yonder--done with candle-smoke." + +"Tom, it's a CROSS!" + +"NOW where's your Number Two? 'UNDER THE CROSS,' hey? Right yonder's +where I saw Injun Joe poke up his candle, Huck!" + +Huck stared at the mystic sign awhile, and then said with a shaky voice: + +"Tom, less git out of here!" + +"What! and leave the treasure?" + +"Yes--leave it. Injun Joe's ghost is round about there, certain." + +"No it ain't, Huck, no it ain't. It would ha'nt the place where he +died--away out at the mouth of the cave--five mile from here." + +"No, Tom, it wouldn't. It would hang round the money. I know the ways +of ghosts, and so do you." + +Tom began to fear that Huck was right. Misgivings gathered in his +mind. But presently an idea occurred to him-- + +"Lookyhere, Huck, what fools we're making of ourselves! Injun Joe's +ghost ain't a going to come around where there's a cross!" + +The point was well taken. It had its effect. + +"Tom, I didn't think of that. But that's so. It's luck for us, that +cross is. I reckon we'll climb down there and have a hunt for that box." + +Tom went first, cutting rude steps in the clay hill as he descended. +Huck followed. Four avenues opened out of the small cavern which the +great rock stood in. The boys examined three of them with no result. +They found a small recess in the one nearest the base of the rock, with +a pallet of blankets spread down in it; also an old suspender, some +bacon rind, and the well-gnawed bones of two or three fowls. But there +was no money-box. The lads searched and researched this place, but in +vain. Tom said: + +"He said UNDER the cross. Well, this comes nearest to being under the +cross. It can't be under the rock itself, because that sets solid on +the ground." + +They searched everywhere once more, and then sat down discouraged. +Huck could suggest nothing. By-and-by Tom said: + +"Lookyhere, Huck, there's footprints and some candle-grease on the +clay about one side of this rock, but not on the other sides. Now, +what's that for? I bet you the money IS under the rock. I'm going to +dig in the clay." + +"That ain't no bad notion, Tom!" said Huck with animation. + +Tom's "real Barlow" was out at once, and he had not dug four inches +before he struck wood. + +"Hey, Huck!--you hear that?" + +Huck began to dig and scratch now. Some boards were soon uncovered and +removed. They had concealed a natural chasm which led under the rock. +Tom got into this and held his candle as far under the rock as he +could, but said he could not see to the end of the rift. He proposed to +explore. He stooped and passed under; the narrow way descended +gradually. He followed its winding course, first to the right, then to +the left, Huck at his heels. Tom turned a short curve, by-and-by, and +exclaimed: + +"My goodness, Huck, lookyhere!" + +It was the treasure-box, sure enough, occupying a snug little cavern, +along with an empty powder-keg, a couple of guns in leather cases, two +or three pairs of old moccasins, a leather belt, and some other rubbish +well soaked with the water-drip. + +"Got it at last!" said Huck, ploughing among the tarnished coins with +his hand. "My, but we're rich, Tom!" + +"Huck, I always reckoned we'd get it. It's just too good to believe, +but we HAVE got it, sure! Say--let's not fool around here. Let's snake +it out. Lemme see if I can lift the box." + +It weighed about fifty pounds. Tom could lift it, after an awkward +fashion, but could not carry it conveniently. + +"I thought so," he said; "THEY carried it like it was heavy, that day +at the ha'nted house. I noticed that. I reckon I was right to think of +fetching the little bags along." + +The money was soon in the bags and the boys took it up to the cross +rock. + +"Now less fetch the guns and things," said Huck. + +"No, Huck--leave them there. They're just the tricks to have when we +go to robbing. We'll keep them there all the time, and we'll hold our +orgies there, too. It's an awful snug place for orgies." + +"What orgies?" + +"I dono. But robbers always have orgies, and of course we've got to +have them, too. Come along, Huck, we've been in here a long time. It's +getting late, I reckon. I'm hungry, too. We'll eat and smoke when we +get to the skiff." + +They presently emerged into the clump of sumach bushes, looked warily +out, found the coast clear, and were soon lunching and smoking in the +skiff. As the sun dipped toward the horizon they pushed out and got +under way. Tom skimmed up the shore through the long twilight, chatting +cheerily with Huck, and landed shortly after dark. + +"Now, Huck," said Tom, "we'll hide the money in the loft of the +widow's woodshed, and I'll come up in the morning and we'll count it +and divide, and then we'll hunt up a place out in the woods for it +where it will be safe. Just you lay quiet here and watch the stuff till +I run and hook Benny Taylor's little wagon; I won't be gone a minute." + +He disappeared, and presently returned with the wagon, put the two +small sacks into it, threw some old rags on top of them, and started +off, dragging his cargo behind him. When the boys reached the +Welshman's house, they stopped to rest. Just as they were about to move +on, the Welshman stepped out and said: + +"Hallo, who's that?" + +"Huck and Tom Sawyer." + +"Good! Come along with me, boys, you are keeping everybody waiting. +Here--hurry up, trot ahead--I'll haul the wagon for you. Why, it's not +as light as it might be. Got bricks in it?--or old metal?" + +"Old metal," said Tom. + +"I judged so; the boys in this town will take more trouble and fool +away more time hunting up six bits' worth of old iron to sell to the +foundry than they would to make twice the money at regular work. But +that's human nature--hurry along, hurry along!" + +The boys wanted to know what the hurry was about. + +"Never mind; you'll see, when we get to the Widow Douglas'." + +Huck said with some apprehension--for he was long used to being +falsely accused: + +"Mr. Jones, we haven't been doing nothing." + +The Welshman laughed. + +"Well, I don't know, Huck, my boy. I don't know about that. Ain't you +and the widow good friends?" + +"Yes. Well, she's ben good friends to me, anyway." + +"All right, then. What do you want to be afraid for?" + +This question was not entirely answered in Huck's slow mind before he +found himself pushed, along with Tom, into Mrs. Douglas' drawing-room. +Mr. Jones left the wagon near the door and followed. + +The place was grandly lighted, and everybody that was of any +consequence in the village was there. The Thatchers were there, the +Harpers, the Rogerses, Aunt Polly, Sid, Mary, the minister, the editor, +and a great many more, and all dressed in their best. The widow +received the boys as heartily as any one could well receive two such +looking beings. They were covered with clay and candle-grease. Aunt +Polly blushed crimson with humiliation, and frowned and shook her head +at Tom. Nobody suffered half as much as the two boys did, however. Mr. +Jones said: + +"Tom wasn't at home, yet, so I gave him up; but I stumbled on him and +Huck right at my door, and so I just brought them along in a hurry." + +"And you did just right," said the widow. "Come with me, boys." + +She took them to a bedchamber and said: + +"Now wash and dress yourselves. Here are two new suits of clothes +--shirts, socks, everything complete. They're Huck's--no, no thanks, +Huck--Mr. Jones bought one and I the other. But they'll fit both of you. +Get into them. We'll wait--come down when you are slicked up enough." + +Then she left. + + + +CHAPTER XXXIV + +HUCK said: "Tom, we can slope, if we can find a rope. The window ain't +high from the ground." + +"Shucks! what do you want to slope for?" + +"Well, I ain't used to that kind of a crowd. I can't stand it. I ain't +going down there, Tom." + +"Oh, bother! It ain't anything. I don't mind it a bit. I'll take care +of you." + +Sid appeared. + +"Tom," said he, "auntie has been waiting for you all the afternoon. +Mary got your Sunday clothes ready, and everybody's been fretting about +you. Say--ain't this grease and clay, on your clothes?" + +"Now, Mr. Siddy, you jist 'tend to your own business. What's all this +blow-out about, anyway?" + +"It's one of the widow's parties that she's always having. This time +it's for the Welshman and his sons, on account of that scrape they +helped her out of the other night. And say--I can tell you something, +if you want to know." + +"Well, what?" + +"Why, old Mr. Jones is going to try to spring something on the people +here to-night, but I overheard him tell auntie to-day about it, as a +secret, but I reckon it's not much of a secret now. Everybody knows +--the widow, too, for all she tries to let on she don't. Mr. Jones was +bound Huck should be here--couldn't get along with his grand secret +without Huck, you know!" + +"Secret about what, Sid?" + +"About Huck tracking the robbers to the widow's. I reckon Mr. Jones +was going to make a grand time over his surprise, but I bet you it will +drop pretty flat." + +Sid chuckled in a very contented and satisfied way. + +"Sid, was it you that told?" + +"Oh, never mind who it was. SOMEBODY told--that's enough." + +"Sid, there's only one person in this town mean enough to do that, and +that's you. If you had been in Huck's place you'd 'a' sneaked down the +hill and never told anybody on the robbers. You can't do any but mean +things, and you can't bear to see anybody praised for doing good ones. +There--no thanks, as the widow says"--and Tom cuffed Sid's ears and +helped him to the door with several kicks. "Now go and tell auntie if +you dare--and to-morrow you'll catch it!" + +Some minutes later the widow's guests were at the supper-table, and a +dozen children were propped up at little side-tables in the same room, +after the fashion of that country and that day. At the proper time Mr. +Jones made his little speech, in which he thanked the widow for the +honor she was doing himself and his sons, but said that there was +another person whose modesty-- + +And so forth and so on. He sprung his secret about Huck's share in the +adventure in the finest dramatic manner he was master of, but the +surprise it occasioned was largely counterfeit and not as clamorous and +effusive as it might have been under happier circumstances. However, +the widow made a pretty fair show of astonishment, and heaped so many +compliments and so much gratitude upon Huck that he almost forgot the +nearly intolerable discomfort of his new clothes in the entirely +intolerable discomfort of being set up as a target for everybody's gaze +and everybody's laudations. + +The widow said she meant to give Huck a home under her roof and have +him educated; and that when she could spare the money she would start +him in business in a modest way. Tom's chance was come. He said: + +"Huck don't need it. Huck's rich." + +Nothing but a heavy strain upon the good manners of the company kept +back the due and proper complimentary laugh at this pleasant joke. But +the silence was a little awkward. Tom broke it: + +"Huck's got money. Maybe you don't believe it, but he's got lots of +it. Oh, you needn't smile--I reckon I can show you. You just wait a +minute." + +Tom ran out of doors. The company looked at each other with a +perplexed interest--and inquiringly at Huck, who was tongue-tied. + +"Sid, what ails Tom?" said Aunt Polly. "He--well, there ain't ever any +making of that boy out. I never--" + +Tom entered, struggling with the weight of his sacks, and Aunt Polly +did not finish her sentence. Tom poured the mass of yellow coin upon +the table and said: + +"There--what did I tell you? Half of it's Huck's and half of it's mine!" + +The spectacle took the general breath away. All gazed, nobody spoke +for a moment. Then there was a unanimous call for an explanation. Tom +said he could furnish it, and he did. The tale was long, but brimful of +interest. There was scarcely an interruption from any one to break the +charm of its flow. When he had finished, Mr. Jones said: + +"I thought I had fixed up a little surprise for this occasion, but it +don't amount to anything now. This one makes it sing mighty small, I'm +willing to allow." + +The money was counted. The sum amounted to a little over twelve +thousand dollars. It was more than any one present had ever seen at one +time before, though several persons were there who were worth +considerably more than that in property. + + + +CHAPTER XXXV + +THE reader may rest satisfied that Tom's and Huck's windfall made a +mighty stir in the poor little village of St. Petersburg. So vast a +sum, all in actual cash, seemed next to incredible. It was talked +about, gloated over, glorified, until the reason of many of the +citizens tottered under the strain of the unhealthy excitement. Every +"haunted" house in St. Petersburg and the neighboring villages was +dissected, plank by plank, and its foundations dug up and ransacked for +hidden treasure--and not by boys, but men--pretty grave, unromantic +men, too, some of them. Wherever Tom and Huck appeared they were +courted, admired, stared at. The boys were not able to remember that +their remarks had possessed weight before; but now their sayings were +treasured and repeated; everything they did seemed somehow to be +regarded as remarkable; they had evidently lost the power of doing and +saying commonplace things; moreover, their past history was raked up +and discovered to bear marks of conspicuous originality. The village +paper published biographical sketches of the boys. + +The Widow Douglas put Huck's money out at six per cent., and Judge +Thatcher did the same with Tom's at Aunt Polly's request. Each lad had +an income, now, that was simply prodigious--a dollar for every week-day +in the year and half of the Sundays. It was just what the minister got +--no, it was what he was promised--he generally couldn't collect it. A +dollar and a quarter a week would board, lodge, and school a boy in +those old simple days--and clothe him and wash him, too, for that +matter. + +Judge Thatcher had conceived a great opinion of Tom. He said that no +commonplace boy would ever have got his daughter out of the cave. When +Becky told her father, in strict confidence, how Tom had taken her +whipping at school, the Judge was visibly moved; and when she pleaded +grace for the mighty lie which Tom had told in order to shift that +whipping from her shoulders to his own, the Judge said with a fine +outburst that it was a noble, a generous, a magnanimous lie--a lie that +was worthy to hold up its head and march down through history breast to +breast with George Washington's lauded Truth about the hatchet! Becky +thought her father had never looked so tall and so superb as when he +walked the floor and stamped his foot and said that. She went straight +off and told Tom about it. + +Judge Thatcher hoped to see Tom a great lawyer or a great soldier some +day. He said he meant to look to it that Tom should be admitted to the +National Military Academy and afterward trained in the best law school +in the country, in order that he might be ready for either career or +both. + +Huck Finn's wealth and the fact that he was now under the Widow +Douglas' protection introduced him into society--no, dragged him into +it, hurled him into it--and his sufferings were almost more than he +could bear. The widow's servants kept him clean and neat, combed and +brushed, and they bedded him nightly in unsympathetic sheets that had +not one little spot or stain which he could press to his heart and know +for a friend. He had to eat with a knife and fork; he had to use +napkin, cup, and plate; he had to learn his book, he had to go to +church; he had to talk so properly that speech was become insipid in +his mouth; whithersoever he turned, the bars and shackles of +civilization shut him in and bound him hand and foot. + +He bravely bore his miseries three weeks, and then one day turned up +missing. For forty-eight hours the widow hunted for him everywhere in +great distress. The public were profoundly concerned; they searched +high and low, they dragged the river for his body. Early the third +morning Tom Sawyer wisely went poking among some old empty hogsheads +down behind the abandoned slaughter-house, and in one of them he found +the refugee. Huck had slept there; he had just breakfasted upon some +stolen odds and ends of food, and was lying off, now, in comfort, with +his pipe. He was unkempt, uncombed, and clad in the same old ruin of +rags that had made him picturesque in the days when he was free and +happy. Tom routed him out, told him the trouble he had been causing, +and urged him to go home. Huck's face lost its tranquil content, and +took a melancholy cast. He said: + +"Don't talk about it, Tom. I've tried it, and it don't work; it don't +work, Tom. It ain't for me; I ain't used to it. The widder's good to +me, and friendly; but I can't stand them ways. She makes me get up just +at the same time every morning; she makes me wash, they comb me all to +thunder; she won't let me sleep in the woodshed; I got to wear them +blamed clothes that just smothers me, Tom; they don't seem to any air +git through 'em, somehow; and they're so rotten nice that I can't set +down, nor lay down, nor roll around anywher's; I hain't slid on a +cellar-door for--well, it 'pears to be years; I got to go to church and +sweat and sweat--I hate them ornery sermons! I can't ketch a fly in +there, I can't chaw. I got to wear shoes all Sunday. The widder eats by +a bell; she goes to bed by a bell; she gits up by a bell--everything's +so awful reg'lar a body can't stand it." + +"Well, everybody does that way, Huck." + +"Tom, it don't make no difference. I ain't everybody, and I can't +STAND it. It's awful to be tied up so. And grub comes too easy--I don't +take no interest in vittles, that way. I got to ask to go a-fishing; I +got to ask to go in a-swimming--dern'd if I hain't got to ask to do +everything. Well, I'd got to talk so nice it wasn't no comfort--I'd got +to go up in the attic and rip out awhile, every day, to git a taste in +my mouth, or I'd a died, Tom. The widder wouldn't let me smoke; she +wouldn't let me yell, she wouldn't let me gape, nor stretch, nor +scratch, before folks--" [Then with a spasm of special irritation and +injury]--"And dad fetch it, she prayed all the time! I never see such a +woman! I HAD to shove, Tom--I just had to. And besides, that school's +going to open, and I'd a had to go to it--well, I wouldn't stand THAT, +Tom. Looky here, Tom, being rich ain't what it's cracked up to be. It's +just worry and worry, and sweat and sweat, and a-wishing you was dead +all the time. Now these clothes suits me, and this bar'l suits me, and +I ain't ever going to shake 'em any more. Tom, I wouldn't ever got into +all this trouble if it hadn't 'a' ben for that money; now you just take +my sheer of it along with your'n, and gimme a ten-center sometimes--not +many times, becuz I don't give a dern for a thing 'thout it's tollable +hard to git--and you go and beg off for me with the widder." + +"Oh, Huck, you know I can't do that. 'Tain't fair; and besides if +you'll try this thing just a while longer you'll come to like it." + +"Like it! Yes--the way I'd like a hot stove if I was to set on it long +enough. No, Tom, I won't be rich, and I won't live in them cussed +smothery houses. I like the woods, and the river, and hogsheads, and +I'll stick to 'em, too. Blame it all! just as we'd got guns, and a +cave, and all just fixed to rob, here this dern foolishness has got to +come up and spile it all!" + +Tom saw his opportunity-- + +"Lookyhere, Huck, being rich ain't going to keep me back from turning +robber." + +"No! Oh, good-licks; are you in real dead-wood earnest, Tom?" + +"Just as dead earnest as I'm sitting here. But Huck, we can't let you +into the gang if you ain't respectable, you know." + +Huck's joy was quenched. + +"Can't let me in, Tom? Didn't you let me go for a pirate?" + +"Yes, but that's different. A robber is more high-toned than what a +pirate is--as a general thing. In most countries they're awful high up +in the nobility--dukes and such." + +"Now, Tom, hain't you always ben friendly to me? You wouldn't shet me +out, would you, Tom? You wouldn't do that, now, WOULD you, Tom?" + +"Huck, I wouldn't want to, and I DON'T want to--but what would people +say? Why, they'd say, 'Mph! Tom Sawyer's Gang! pretty low characters in +it!' They'd mean you, Huck. You wouldn't like that, and I wouldn't." + +Huck was silent for some time, engaged in a mental struggle. Finally +he said: + +"Well, I'll go back to the widder for a month and tackle it and see if +I can come to stand it, if you'll let me b'long to the gang, Tom." + +"All right, Huck, it's a whiz! Come along, old chap, and I'll ask the +widow to let up on you a little, Huck." + +"Will you, Tom--now will you? That's good. If she'll let up on some of +the roughest things, I'll smoke private and cuss private, and crowd +through or bust. When you going to start the gang and turn robbers?" + +"Oh, right off. We'll get the boys together and have the initiation +to-night, maybe." + +"Have the which?" + +"Have the initiation." + +"What's that?" + +"It's to swear to stand by one another, and never tell the gang's +secrets, even if you're chopped all to flinders, and kill anybody and +all his family that hurts one of the gang." + +"That's gay--that's mighty gay, Tom, I tell you." + +"Well, I bet it is. And all that swearing's got to be done at +midnight, in the lonesomest, awfulest place you can find--a ha'nted +house is the best, but they're all ripped up now." + +"Well, midnight's good, anyway, Tom." + +"Yes, so it is. And you've got to swear on a coffin, and sign it with +blood." + +"Now, that's something LIKE! Why, it's a million times bullier than +pirating. I'll stick to the widder till I rot, Tom; and if I git to be +a reg'lar ripper of a robber, and everybody talking 'bout it, I reckon +she'll be proud she snaked me in out of the wet." + + + +CONCLUSION + +SO endeth this chronicle. It being strictly a history of a BOY, it +must stop here; the story could not go much further without becoming +the history of a MAN. When one writes a novel about grown people, he +knows exactly where to stop--that is, with a marriage; but when he +writes of juveniles, he must stop where he best can. + +Most of the characters that perform in this book still live, and are +prosperous and happy. Some day it may seem worth while to take up the +story of the younger ones again and see what sort of men and women they +turned out to be; therefore it will be wisest not to reveal any of that +part of their lives at present. + + + + + +End of the Project Gutenberg EBook of The Adventures of Tom Sawyer, Complete +by Mark Twain (Samuel Clemens) + +*** END OF THIS PROJECT GUTENBERG EBOOK TOM SAWYER *** + +***** This file should be named 74.txt or 74.zip ***** +This and all associated files of various formats will be found in: + http://www.gutenberg.net/7/74/ + +Produced by David Widger. The previous edition was update by Jose +Menendez. + + +Updated editions will replace the previous one--the old editions +will be renamed. + +Creating the works from public domain print editions means that no +one owns a United States copyright in these works, so the Foundation +(and you!) can copy and distribute it in the United States without +permission and without paying copyright royalties. Special rules, +set forth in the General Terms of Use part of this license, apply to +copying and distributing Project Gutenberg-tm electronic works to +protect the PROJECT GUTENBERG-tm concept and trademark. Project +Gutenberg is a registered trademark, and may not be used if you +charge for the eBooks, unless you receive specific permission. If you +do not charge anything for copies of this eBook, complying with the +rules is very easy. You may use this eBook for nearly any purpose +such as creation of derivative works, reports, performances and +research. They may be modified and printed and given away--you may do +practically ANYTHING with public domain eBooks. Redistribution is +subject to the trademark license, especially commercial +redistribution. + + + +*** START: FULL LICENSE *** + +THE FULL PROJECT GUTENBERG LICENSE +PLEASE READ THIS BEFORE YOU DISTRIBUTE OR USE THIS WORK + +To protect the Project Gutenberg-tm mission of promoting the free +distribution of electronic works, by using or distributing this work +(or any other work associated in any way with the phrase "Project +Gutenberg"), you agree to comply with all the terms of the Full Project +Gutenberg-tm License (available with this file or online at +http://gutenberg.net/license). + + +Section 1. General Terms of Use and Redistributing Project Gutenberg-tm +electronic works + +1.A. By reading or using any part of this Project Gutenberg-tm +electronic work, you indicate that you have read, understand, agree to +and accept all the terms of this license and intellectual property +(trademark/copyright) agreement. If you do not agree to abide by all +the terms of this agreement, you must cease using and return or destroy +all copies of Project Gutenberg-tm electronic works in your possession. +If you paid a fee for obtaining a copy of or access to a Project +Gutenberg-tm electronic work and you do not agree to be bound by the +terms of this agreement, you may obtain a refund from the person or +entity to whom you paid the fee as set forth in paragraph 1.E.8. + +1.B. "Project Gutenberg" is a registered trademark. It may only be +used on or associated in any way with an electronic work by people who +agree to be bound by the terms of this agreement. There are a few +things that you can do with most Project Gutenberg-tm electronic works +even without complying with the full terms of this agreement. See +paragraph 1.C below. There are a lot of things you can do with Project +Gutenberg-tm electronic works if you follow the terms of this agreement +and help preserve free future access to Project Gutenberg-tm electronic +works. See paragraph 1.E below. + +1.C. The Project Gutenberg Literary Archive Foundation ("the Foundation" +or PGLAF), owns a compilation copyright in the collection of Project +Gutenberg-tm electronic works. Nearly all the individual works in the +collection are in the public domain in the United States. If an +individual work is in the public domain in the United States and you are +located in the United States, we do not claim a right to prevent you from +copying, distributing, performing, displaying or creating derivative +works based on the work as long as all references to Project Gutenberg +are removed. Of course, we hope that you will support the Project +Gutenberg-tm mission of promoting free access to electronic works by +freely sharing Project Gutenberg-tm works in compliance with the terms of +this agreement for keeping the Project Gutenberg-tm name associated with +the work. You can easily comply with the terms of this agreement by +keeping this work in the same format with its attached full Project +Gutenberg-tm License when you share it without charge with others. + +1.D. The copyright laws of the place where you are located also govern +what you can do with this work. Copyright laws in most countries are in +a constant state of change. If you are outside the United States, check +the laws of your country in addition to the terms of this agreement +before downloading, copying, displaying, performing, distributing or +creating derivative works based on this work or any other Project +Gutenberg-tm work. The Foundation makes no representations concerning +the copyright status of any work in any country outside the United +States. + +1.E. Unless you have removed all references to Project Gutenberg: + +1.E.1. The following sentence, with active links to, or other immediate +access to, the full Project Gutenberg-tm License must appear prominently +whenever any copy of a Project Gutenberg-tm work (any work on which the +phrase "Project Gutenberg" appears, or with which the phrase "Project +Gutenberg" is associated) is accessed, displayed, performed, viewed, +copied or distributed: + +This eBook is for the use of anyone anywhere at no cost and with +almost no restrictions whatsoever. You may copy it, give it away or +re-use it under the terms of the Project Gutenberg License included +with this eBook or online at www.gutenberg.net + +1.E.2. If an individual Project Gutenberg-tm electronic work is derived +from the public domain (does not contain a notice indicating that it is +posted with permission of the copyright holder), the work can be copied +and distributed to anyone in the United States without paying any fees +or charges. If you are redistributing or providing access to a work +with the phrase "Project Gutenberg" associated with or appearing on the +work, you must comply either with the requirements of paragraphs 1.E.1 +through 1.E.7 or obtain permission for the use of the work and the +Project Gutenberg-tm trademark as set forth in paragraphs 1.E.8 or +1.E.9. + +1.E.3. If an individual Project Gutenberg-tm electronic work is posted +with the permission of the copyright holder, your use and distribution +must comply with both paragraphs 1.E.1 through 1.E.7 and any additional +terms imposed by the copyright holder. Additional terms will be linked +to the Project Gutenberg-tm License for all works posted with the +permission of the copyright holder found at the beginning of this work. + +1.E.4. Do not unlink or detach or remove the full Project Gutenberg-tm +License terms from this work, or any files containing a part of this +work or any other work associated with Project Gutenberg-tm. + +1.E.5. Do not copy, display, perform, distribute or redistribute this +electronic work, or any part of this electronic work, without +prominently displaying the sentence set forth in paragraph 1.E.1 with +active links or immediate access to the full terms of the Project +Gutenberg-tm License. + +1.E.6. You may convert to and distribute this work in any binary, +compressed, marked up, nonproprietary or proprietary form, including any +word processing or hypertext form. However, if you provide access to or +distribute copies of a Project Gutenberg-tm work in a format other than +"Plain Vanilla ASCII" or other format used in the official version +posted on the official Project Gutenberg-tm web site (www.gutenberg.net), +you must, at no additional cost, fee or expense to the user, provide a +copy, a means of exporting a copy, or a means of obtaining a copy upon +request, of the work in its original "Plain Vanilla ASCII" or other +form. Any alternate format must include the full Project Gutenberg-tm +License as specified in paragraph 1.E.1. + +1.E.7. Do not charge a fee for access to, viewing, displaying, +performing, copying or distributing any Project Gutenberg-tm works +unless you comply with paragraph 1.E.8 or 1.E.9. + +1.E.8. You may charge a reasonable fee for copies of or providing +access to or distributing Project Gutenberg-tm electronic works provided +that + +- You pay a royalty fee of 20% of the gross profits you derive from + the use of Project Gutenberg-tm works calculated using the method + you already use to calculate your applicable taxes. The fee is + owed to the owner of the Project Gutenberg-tm trademark, but he + has agreed to donate royalties under this paragraph to the + Project Gutenberg Literary Archive Foundation. Royalty payments + must be paid within 60 days following each date on which you + prepare (or are legally required to prepare) your periodic tax + returns. Royalty payments should be clearly marked as such and + sent to the Project Gutenberg Literary Archive Foundation at the + address specified in Section 4, "Information about donations to + the Project Gutenberg Literary Archive Foundation." + +- You provide a full refund of any money paid by a user who notifies + you in writing (or by e-mail) within 30 days of receipt that s/he + does not agree to the terms of the full Project Gutenberg-tm + License. You must require such a user to return or + destroy all copies of the works possessed in a physical medium + and discontinue all use of and all access to other copies of + Project Gutenberg-tm works. + +- You provide, in accordance with paragraph 1.F.3, a full refund of any + money paid for a work or a replacement copy, if a defect in the + electronic work is discovered and reported to you within 90 days + of receipt of the work. + +- You comply with all other terms of this agreement for free + distribution of Project Gutenberg-tm works. + +1.E.9. If you wish to charge a fee or distribute a Project Gutenberg-tm +electronic work or group of works on different terms than are set +forth in this agreement, you must obtain permission in writing from +both the Project Gutenberg Literary Archive Foundation and Michael +Hart, the owner of the Project Gutenberg-tm trademark. Contact the +Foundation as set forth in Section 3 below. + +1.F. + +1.F.1. Project Gutenberg volunteers and employees expend considerable +effort to identify, do copyright research on, transcribe and proofread +public domain works in creating the Project Gutenberg-tm +collection. Despite these efforts, Project Gutenberg-tm electronic +works, and the medium on which they may be stored, may contain +"Defects," such as, but not limited to, incomplete, inaccurate or +corrupt data, transcription errors, a copyright or other intellectual +property infringement, a defective or damaged disk or other medium, a +computer virus, or computer codes that damage or cannot be read by +your equipment. + +1.F.2. LIMITED WARRANTY, DISCLAIMER OF DAMAGES - Except for the "Right +of Replacement or Refund" described in paragraph 1.F.3, the Project +Gutenberg Literary Archive Foundation, the owner of the Project +Gutenberg-tm trademark, and any other party distributing a Project +Gutenberg-tm electronic work under this agreement, disclaim all +liability to you for damages, costs and expenses, including legal +fees. YOU AGREE THAT YOU HAVE NO REMEDIES FOR NEGLIGENCE, STRICT +LIABILITY, BREACH OF WARRANTY OR BREACH OF CONTRACT EXCEPT THOSE +PROVIDED IN PARAGRAPH F3. YOU AGREE THAT THE FOUNDATION, THE +TRADEMARK OWNER, AND ANY DISTRIBUTOR UNDER THIS AGREEMENT WILL NOT BE +LIABLE TO YOU FOR ACTUAL, DIRECT, INDIRECT, CONSEQUENTIAL, PUNITIVE OR +INCIDENTAL DAMAGES EVEN IF YOU GIVE NOTICE OF THE POSSIBILITY OF SUCH +DAMAGE. + +1.F.3. LIMITED RIGHT OF REPLACEMENT OR REFUND - If you discover a +defect in this electronic work within 90 days of receiving it, you can +receive a refund of the money (if any) you paid for it by sending a +written explanation to the person you received the work from. If you +received the work on a physical medium, you must return the medium with +your written explanation. The person or entity that provided you with +the defective work may elect to provide a replacement copy in lieu of a +refund. If you received the work electronically, the person or entity +providing it to you may choose to give you a second opportunity to +receive the work electronically in lieu of a refund. If the second copy +is also defective, you may demand a refund in writing without further +opportunities to fix the problem. + +1.F.4. Except for the limited right of replacement or refund set forth +in paragraph 1.F.3, this work is provided to you 'AS-IS' WITH NO OTHER +WARRANTIES OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO +WARRANTIES OF MERCHANTIBILITY OR FITNESS FOR ANY PURPOSE. + +1.F.5. Some states do not allow disclaimers of certain implied +warranties or the exclusion or limitation of certain types of damages. +If any disclaimer or limitation set forth in this agreement violates the +law of the state applicable to this agreement, the agreement shall be +interpreted to make the maximum disclaimer or limitation permitted by +the applicable state law. The invalidity or unenforceability of any +provision of this agreement shall not void the remaining provisions. + +1.F.6. INDEMNITY - You agree to indemnify and hold the Foundation, the +trademark owner, any agent or employee of the Foundation, anyone +providing copies of Project Gutenberg-tm electronic works in accordance +with this agreement, and any volunteers associated with the production, +promotion and distribution of Project Gutenberg-tm electronic works, +harmless from all liability, costs and expenses, including legal fees, +that arise directly or indirectly from any of the following which you do +or cause to occur: (a) distribution of this or any Project Gutenberg-tm +work, (b) alteration, modification, or additions or deletions to any +Project Gutenberg-tm work, and (c) any Defect you cause. + + +Section 2. Information about the Mission of Project Gutenberg-tm + +Project Gutenberg-tm is synonymous with the free distribution of +electronic works in formats readable by the widest variety of computers +including obsolete, old, middle-aged and new computers. It exists +because of the efforts of hundreds of volunteers and donations from +people in all walks of life. + +Volunteers and financial support to provide volunteers with the +assistance they need, is critical to reaching Project Gutenberg-tm's +goals and ensuring that the Project Gutenberg-tm collection will +remain freely available for generations to come. In 2001, the Project +Gutenberg Literary Archive Foundation was created to provide a secure +and permanent future for Project Gutenberg-tm and future generations. +To learn more about the Project Gutenberg Literary Archive Foundation +and how your efforts and donations can help, see Sections 3 and 4 +and the Foundation web page at http://www.pglaf.org. + + +Section 3. Information about the Project Gutenberg Literary Archive +Foundation + +The Project Gutenberg Literary Archive Foundation is a non profit +501(c)(3) educational corporation organized under the laws of the +state of Mississippi and granted tax exempt status by the Internal +Revenue Service. The Foundation's EIN or federal tax identification +number is 64-6221541. Its 501(c)(3) letter is posted at +http://pglaf.org/fundraising. Contributions to the Project Gutenberg +Literary Archive Foundation are tax deductible to the full extent +permitted by U.S. federal laws and your state's laws. + +The Foundation's principal office is located at 4557 Melan Dr. S. +Fairbanks, AK, 99712., but its volunteers and employees are scattered +throughout numerous locations. Its business office is located at +809 North 1500 West, Salt Lake City, UT 84116, (801) 596-1887, email +business@pglaf.org. Email contact links and up to date contact +information can be found at the Foundation's web site and official +page at http://pglaf.org + +For additional contact information: + Dr. Gregory B. Newby + Chief Executive and Director + gbnewby@pglaf.org + + +Section 4. Information about Donations to the Project Gutenberg +Literary Archive Foundation + +Project Gutenberg-tm depends upon and cannot survive without wide +spread public support and donations to carry out its mission of +increasing the number of public domain and licensed works that can be +freely distributed in machine readable form accessible by the widest +array of equipment including outdated equipment. Many small donations +($1 to $5,000) are particularly important to maintaining tax exempt +status with the IRS. + +The Foundation is committed to complying with the laws regulating +charities and charitable donations in all 50 states of the United +States. Compliance requirements are not uniform and it takes a +considerable effort, much paperwork and many fees to meet and keep up +with these requirements. We do not solicit donations in locations +where we have not received written confirmation of compliance. To +SEND DONATIONS or determine the status of compliance for any +particular state visit http://pglaf.org + +While we cannot and do not solicit contributions from states where we +have not met the solicitation requirements, we know of no prohibition +against accepting unsolicited donations from donors in such states who +approach us with offers to donate. + +International donations are gratefully accepted, but we cannot make +any statements concerning tax treatment of donations received from +outside the United States. U.S. laws alone swamp our small staff. + +Please check the Project Gutenberg Web pages for current donation +methods and addresses. Donations are accepted in a number of other +ways including including checks, online payments and credit card +donations. To donate, please visit: http://pglaf.org/donate + + +Section 5. General Information About Project Gutenberg-tm electronic +works. + +Professor Michael S. Hart is the originator of the Project Gutenberg-tm +concept of a library of electronic works that could be freely shared +with anyone. For thirty years, he produced and distributed Project +Gutenberg-tm eBooks with only a loose network of volunteer support. + + +Project Gutenberg-tm eBooks are often created from several printed +editions, all of which are confirmed as Public Domain in the U.S. +unless a copyright notice is included. Thus, we do not necessarily +keep eBooks in compliance with any particular paper edition. + + +Most people start at our Web site which has the main PG search facility: + + http://www.gutenberg.net + +This Web site includes information about Project Gutenberg-tm, +including how to make donations to the Project Gutenberg Literary +Archive Foundation, how to help produce our new eBooks, and how to +subscribe to our email newsletter to hear about new eBooks. diff --git a/src/compress/testdata/e.txt b/src/compress/testdata/e.txt new file mode 100644 index 0000000000000000000000000000000000000000..5ca186f14c1591c83e5348389ae018235af354e8 --- /dev/null +++ b/src/compress/testdata/e.txt @@ -0,0 +1 @@ +2.7182818284590452353602874713526624977572470936999595749669676277240766303535475945713821785251664274274663919320030599218174135966290435729003342952605956307381323286279434907632338298807531952510190115738341879307021540891499348841675092447614606680822648001684774118537423454424371075390777449920695517027618386062613313845830007520449338265602976067371132007093287091274437470472306969772093101416928368190255151086574637721112523897844250569536967707854499699679468644549059879316368892300987931277361782154249992295763514822082698951936680331825288693984964651058209392398294887933203625094431173012381970684161403970198376793206832823764648042953118023287825098194558153017567173613320698112509961818815930416903515988885193458072738667385894228792284998920868058257492796104841984443634632449684875602336248270419786232090021609902353043699418491463140934317381436405462531520961836908887070167683964243781405927145635490613031072085103837505101157477041718986106873969655212671546889570350354021234078498193343210681701210056278802351930332247450158539047304199577770935036604169973297250886876966403555707162268447162560798826517871341951246652010305921236677194325278675398558944896970964097545918569563802363701621120477427228364896134225164450781824423529486363721417402388934412479635743702637552944483379980161254922785092577825620926226483262779333865664816277251640191059004916449982893150566047258027786318641551956532442586982946959308019152987211725563475463964479101459040905862984967912874068705048958586717479854667757573205681288459205413340539220001137863009455606881667400169842055804033637953764520304024322566135278369511778838638744396625322498506549958862342818997077332761717839280349465014345588970719425863987727547109629537415211151368350627526023264847287039207643100595841166120545297030236472549296669381151373227536450988890313602057248176585118063036442812314965507047510254465011727211555194866850800368532281831521960037356252794495158284188294787610852639813955990067376482922443752871846245780361929819713991475644882626039033814418232625150974827987779964373089970388867782271383605772978824125611907176639465070633045279546618550966661856647097113444740160704626215680717481877844371436988218559670959102596862002353718588748569652200050311734392073211390803293634479727355955277349071783793421637012050054513263835440001863239914907054797780566978533580489669062951194324730995876552368128590413832411607226029983305353708761389396391779574540161372236187893652605381558415871869255386061647798340254351284396129460352913325942794904337299085731580290958631382683291477116396337092400316894586360606458459251269946557248391865642097526850823075442545993769170419777800853627309417101634349076964237222943523661255725088147792231519747780605696725380171807763603462459278778465850656050780844211529697521890874019660906651803516501792504619501366585436632712549639908549144200014574760819302212066024330096412704894390397177195180699086998606636583232278709376502260149291011517177635944602023249300280401867723910288097866605651183260043688508817157238669842242201024950551881694803221002515426494639812873677658927688163598312477886520141174110913601164995076629077943646005851941998560162647907615321038727557126992518275687989302761761146162549356495903798045838182323368612016243736569846703785853305275833337939907521660692380533698879565137285593883499894707416181550125397064648171946708348197214488898790676503795903669672494992545279033729636162658976039498576741397359441023744329709355477982629614591442936451428617158587339746791897571211956187385783644758448423555581050025611492391518893099463428413936080383091662818811503715284967059741625628236092168075150177725387402564253470879089137291722828611515915683725241630772254406337875931059826760944203261924285317018781772960235413060672136046000389661093647095141417185777014180606443636815464440053316087783143174440811949422975599314011888683314832802706553833004693290115744147563139997221703804617092894579096271662260740718749975359212756084414737823303270330168237193648002173285734935947564334129943024850235732214597843282641421684878721673367010615094243456984401873312810107945127223737886126058165668053714396127888732527373890392890506865324138062796025930387727697783792868409325365880733988457218746021005311483351323850047827169376218004904795597959290591655470505777514308175112698985188408718564026035305583737832422924185625644255022672155980274012617971928047139600689163828665277009752767069777036439260224372841840883251848770472638440379530166905465937461619323840363893131364327137688841026811219891275223056256756254701725086349765367288605966752740868627407912856576996313789753034660616669804218267724560530660773899624218340859882071864682623215080288286359746839654358856685503773131296587975810501214916207656769950659715344763470320853215603674828608378656803073062657633469774295634643716709397193060876963495328846833613038829431040800296873869117066666146800015121143442256023874474325250769387077775193299942137277211258843608715834835626961661980572526612206797540621062080649882918454395301529982092503005498257043390553570168653120526495614857249257386206917403695213533732531666345466588597286659451136441370331393672118569553952108458407244323835586063106806964924851232632699514603596037297253198368423363904632136710116192821711150282801604488058802382031981493096369596735832742024988245684941273860566491352526706046234450549227581151709314921879592718001940968866986837037302200475314338181092708030017205935530520700706072233999463990571311587099635777359027196285061146514837526209565346713290025994397663114545902685898979115837093419370441155121920117164880566945938131183843765620627846310490346293950029458341164824114969758326011800731699437393506966295712410273239138741754923071862454543222039552735295240245903805744502892246886285336542213815722131163288112052146489805180092024719391710555390113943316681515828843687606961102505171007392762385553386272553538830960671644662370922646809671254061869502143176211668140097595281493907222601112681153108387317617323235263605838173151034595736538223534992935822836851007810884634349983518404451704270189381994243410090575376257767571118090088164183319201962623416288166521374717325477727783488774366518828752156685719506371936565390389449366421764003121527870222366463635755503565576948886549500270853923617105502131147413744106134445544192101336172996285694899193369184729478580729156088510396781959429833186480756083679551496636448965592948187851784038773326247051945050419847742014183947731202815886845707290544057510601285258056594703046836344592652552137008068752009593453607316226118728173928074623094685367823106097921599360019946237993434210687813497346959246469752506246958616909178573976595199392993995567542714654910456860702099012606818704984178079173924071945996323060254707901774527513186809982284730860766536866855516467702911336827563107223346726113705490795365834538637196235856312618387156774118738527722922594743373785695538456246801013905727871016512966636764451872465653730402443684140814488732957847348490003019477888020460324660842875351848364959195082888323206522128104190448047247949291342284951970022601310430062410717971502793433263407995960531446053230488528972917659876016667811937932372453857209607582277178483361613582612896226118129455927462767137794487586753657544861407611931125958512655759734573015333642630767985443385761715333462325270572005303988289499034259566232975782488735029259166825894456894655992658454762694528780516501720674785417887982276806536650641910973434528878338621726156269582654478205672987756426325321594294418039943217000090542650763095588465895171709147607437136893319469090981904501290307099566226620303182649365733698419555776963787624918852865686607600566025605445711337286840205574416030837052312242587223438854123179481388550075689381124935386318635287083799845692619981794523364087429591180747453419551420351726184200845509170845682368200897739455842679214273477560879644279202708312150156406341341617166448069815483764491573900121217041547872591998943825364950514771379399147205219529079396137621107238494290616357604596231253506068537651423115349665683715116604220796394466621163255157729070978473156278277598788136491951257483328793771571459091064841642678309949723674420175862269402159407924480541255360431317992696739157542419296607312393763542139230617876753958711436104089409966089471418340698362993675362621545247298464213752891079884381306095552622720837518629837066787224430195793793786072107254277289071732854874374355781966511716618330881129120245204048682200072344035025448202834254187884653602591506445271657700044521097735585897622655484941621714989532383421600114062950718490427789258552743035221396835679018076406042138307308774460170842688272261177180842664333651780002171903449234264266292261456004337383868335555343453004264818473989215627086095650629340405264943244261445665921291225648893569655009154306426134252668472594914314239398845432486327461842846655985332312210466259890141712103446084271616619001257195870793217569698544013397622096749454185407118446433946990162698351607848924514058940946395267807354579700307051163682519487701189764002827648414160587206184185297189154019688253289309149665345753571427318482016384644832499037886069008072709327673127581966563941148961716832980455139729506687604740915420428429993541025829113502241690769431668574242522509026939034814856451303069925199590436384028429267412573422447765584177886171737265462085498294498946787350929581652632072258992368768457017823038096567883112289305809140572610865884845873101658151167533327674887014829167419701512559782572707406431808601428149024146780472327597684269633935773542930186739439716388611764209004068663398856841681003872389214483176070116684503887212364367043314091155733280182977988736590916659612402021778558854876176161989370794380056663364884365089144805571039765214696027662583599051987042300179465536788567430285974600143785483237068701190078499404930918919181649327259774030074879681484882342932023012128032327460392219687528340516906974194257614673978110715464186273369091584973185011183960482533518748438923177292613543024932562896371361977285456622924461644497284597867711574125670307871885109336344480149675240618536569532074170533486782754827815415561966911055101472799040386897220465550833170782394808785990501947563108984124144672821865459971596639015641941751820935932616316888380132758752601460507676098392625726411120135288591317848299475682472564885533357279772205543568126302535748216585414000805314820697137262149755576051890481622376790414926742600071045922695314835188137463887104273544767623577933993970632396604969145303273887874557905934937772320142954803345000695256980935282887783710670585567749481373858630385762823040694005665340584887527005308832459182183494318049834199639981458773435863115940570443683515285383609442955964360676090221741896883548131643997437764158365242234642619597390455450680695232850751868719449064767791886720306418630751053512149851051207313846648717547518382979990189317751550639981016466414592102406838294603208535554058147159273220677567669213664081505900806952540610628536408293276621931939933861623836069111767785448236129326858199965239275488427435414402884536455595124735546139403154952097397051896240157976832639450633230452192645049651735466775699295718989690470902730288544945416699791992948038254980285946029052763145580316514066229171223429375806143993484914362107993576737317948964252488813720435579287511385856973381976083524423240466778020948399639946684833774706725483618848273000648319163826022110555221246733323184463005504481849916996622087746140216157021029603318588727333298779352570182393861244026868339555870607758169954398469568540671174444932479519572159419645863736126915526457574786985964242176592896862383506370433939811671397544736228625506803682664135541448048997721373174119199970017293907303350869020922519124447393278376156321810842898207706974138707053266117683698647741787180202729412982310888796831880854367327806879771659111654224453806625861711729498038248879986504061563975629936962809358189761491017145343556659542757064194408833816841111166200759787244137082333917886114708228657531078536674695018462140736493917366254937783014074302668422150335117736471853872324040421037907750266020114814935482228916663640782450166815341213505278578539332606110249802273093636740213515386431693015267460536064351732154701091440650878823636764236831187390937464232609021646365627553976834019482932795750624399645272578624400375983422050808935129023122475970644105678361870877172333555465482598906861201410107222465904008553798235253885171623518256518482203125214950700378300411216212126052726059944320443056274522916128891766814160639131235975350390320077529587392412476451850809163911459296071156344204347133544720981178461451077872399140606290228276664309264900592249810291068759434533858330391178747575977065953570979640012224092199031158229259667913153991561438070129260780197022589662923368154312499412259460023399472228171056603931877226800493833148980338548909468685130789292064242819174795866199944411196208730498064385006852620258432842085582338566936649849720817046135376163584015342840674118587581546514598270228676671855309311923340191286170613364873183197560812569460089402953094429119590295968563923037689976327462283900735457144596414108229285922239332836210192822937243590283003884445701383771632056518351970100115722010956997890484964453434612129224964732356126321951155701565824427661599326463155806672053127596948538057364208384918887095176052287817339462747644656858900936266123311152910816041524100214195937349786431661556732702792109593543055579732660554677963552005378304619540636971842916168582734122217145885870814274090248185446421774876925093328785670674677381226752831653559245204578070541352576903253522738963847495646255940378924925007624386893776475310102323746733771474581625530698032499033676455430305274561512961214585944432150749051491453950981001388737926379964873728396416897555132275962011838248650746985492038097691932606437608743209385602815642849756549307909733854185583515789409814007691892389063090542534883896831762904120212949167195811935791203162514344096503132835216728021372415947344095498316138322505486708172221475138425166790445416617303200820330902895488808516797258495813407132180533988828139346049850532340472595097214331492586604248511405819579711564191458842833000525684776874305916390494306871343118796189637475503362820939949343690321031976898112055595369465424704173323895394046035325396758354395350516720261647961347790912327995264929045151148307923369382166010702872651938143844844532639517394110131152502750465749343063766541866128915264446926222884366299462732467958736383501937142786471398054038215513463223702071533134887083174146591492406359493020921122052610312390682941345696785958518393491382340884274312419099152870804332809132993078936867127413922890033069995875921815297612482409116951587789964090352577345938248232053055567238095022266790439614231852991989181065554412477204508510210071522352342792531266930108270633942321762570076323139159349709946933241013908779161651226804414809765618979735043151396066913258379033748620836695475083280318786707751177525663963479259219733577949555498655214193398170268639987388347010255262052312317215254062571636771270010760912281528326508984359568975961038372157726831170734552250194121701541318793651818502020877326906133592182000762327269503283827391243828198170871168108951187896746707073377869592565542713340052326706040004348843432902760360498027862160749469654989210474443927871934536701798673920803845633723311983855862638008516345597194441994344624761123844617615736242015935078520825600604101556889899501732554337298073561699861101908472096600708320280569917042590103876928658336557728758684250492690370934262028022399861803400211320742198642917383679176232826444645756330336556777374808644109969141827774253417010988435853189339175934511574023847292909015468559163792696196841000676598399744972047287881831200233383298030567865480871476464512824264478216644266616732096012564794514827125671326697067367144617795643752391742928503987022583734069852309190464967260243411270345611114149835783901793499713790913696706497637127248466613279908254305449295528594932793818341607827091326680865655921102733746700132583428715240835661522165574998431236278287106649401564670141943713823863454729606978693335973109537126499416282656463708490580151538205338326511289504938566468752921135932220265681856418260827538790002407915892646028490894922299966167437731347776134150965262448332709343898412056926145108857812249139616912534202918139898683901335795857624435194008943955180554746554000051766240202825944828833811886381749594284892013520090951007864941868256009273977667585642598378587497776669563350170748579027248701370264203283965756348010818356182372177082236423186591595883669487322411726504487268392328453010991677518376831599821263237123854357312681202445175401852132663740538802901249728180895021553100673598184430429105288459323064725590442355960551978839325930339572934663055160430923785677229293537208416693134575284011873746854691620648991164726909428982971065606801805807843600461866223562874591385185904416250663222249561448724413813849763797102676020845531824111963927941069619465426480006761727618115630063644321116224837379105623611358836334550102286170517890440570419577859833348463317921904494652923021469259756566389965893747728751393377105569802455757436190501772466214587592374418657530064998056688376964229825501195065837843125232135309371235243969149662310110328243570065781487677299160941153954063362752423712935549926713485031578238899567545287915578420483105749330060197958207739558522807307048950936235550769837881926357141779338750216344391014187576711938914416277109602859415809719913429313295145924373636456473035037374538503489286113141638094752301745088784885645741275003353303416138096560043105860548355773946625033230034341587814634602169235079216111013148948281895391028916816328709309713184139815427678818067628650978085718262117003140003377301581536334149093237034703637513354537634521050370995452942055232078817449370937677056009306353645510913481627378204985657055608784211964039972344556458607689515569686899384896439195225232309703301037277227710870564912966121061494072782442033414057441446459968236966118878411656290355117839944070961772567164919790168195234523807446299877664824873753313018142763910519234685081979001796519907050490865237442841652776611425351538665162781316090964802801234493372427866930894827913465443931965254154829494577875758599482099181824522449312077768250830768282335001597040419199560509705364696473142448453825888112602753909548852639708652339052941829691802357120545328231809270356491743371932080628731303589640570873779967845174740515317401384878082881006046388936711640477755985481263907504747295012609419990373721246201677030517790352952793168766305099837441859803498821239340919805055103821539827677291373138006715339240126954586376422065097810852907639079727841301764553247527073788764069366420012194745702358295481365781809867944020220280822637957006755393575808086318932075864444206644691649334467698180811716568665213389686173592450920801465312529777966137198695916451869432324246404401672381978020728394418264502183131483366019384891972317817154372192103946638473715630226701801343515930442853848941825678870721238520597263859224934763623122188113706307506918260109689069251417142514218153491532129077723748506635489170892850760234351768218355008829647410655814882049239533702270536705630750317499788187009989251020178015601042277836283644323729779929935160925884515772055232896978333126427671291093993103773425910592303277652667641874842441076564447767097790392324958416348527735171981064673837142742974468992320406932506062834468937543016787815320616009057693404906146176607094380110915443261929000745209895959201159412324102274845482605404361871836330268992858623582145643879695210235266673372434423091577183277565800211928270391042391966426911155333594569685782817020325495552528875464466074620294766116004435551604735044292127916358748473501590215522120388281168021413865865168464569964810015633741255098479730138656275460161279246359783661480163871602794405482710196290774543628092612567507181773641749763254436773503632580004042919906963117397787875081560227368824967077635559869284901628768699628053790181848148810833946900016380791075960745504688912686792812391148880036720729730801354431325347713094186717178607522981373539126772812593958220524289991371690685650421575056729991274177149279608831502358697816190894908487717722503860872618384947939757440664912760518878124233683125467278331513186758915668300679210215947336858591201395360301678110413444411030903388761520488296909104689167671555373346622545575975202624771242796225983278405833585897671474205724047439720232895903726148688388003174146490203843590358527993123871042845981608996101945691646983837718267264685264869172948414153004604004299585035164101899027529366867431834955447458124140190754681607770977920579383895378192128847409929537040546962226547278807248685508046571043123854873351653070570784584243335550958221912862797205455466267099131902370311779690892786623112661337671178512943059323281605826535623848164192144732543731002062738466812351691016359252588256806438946389880872735284406462208149513862275239938938734905082625472417781702582044129853760499827899020083498387362992498125742354568439023012261733665820546785671147973065077035475620567428300187473019197310881157516777005071432012726354601912460800451608108641835539669946936947322271670748972850464195392966434725254724357659192969949061670189061433616907056148280980363243454128229968275980226694045642181328624517549652147221620839824594576613342710564957193564431561774500828376935700995419541839029151033187933907614207467028867968594985439789457300768939890070073924697461812855764662265412913204052279071212820653775058280040897163467163709024906774736309136904002615646432159560910851092445162454420141442641660181385990017417408244245378610158433361777292580611159192008414091888191208858207627011483671760749046980914443057262211104583300789331698191603917150622792986282709446275915009683226345073725451366858172483498470080840163868209726371345205439802277866337293290829914010645589761697455978409211409167684020269370229231743334499986901841510888993165125090001163719114994852024821586396216294981753094623047604832399379391002142532996476235163569009445086058091202459904612118623318278614464727795523218635916551883057930657703331498510068357135624341881884405780028844018129031378653794869614630467726914552953690154167025838032477842272417994513653582260971652588356712133519546838335349801503269359798167463231847628306340588324731228951257944267639877946713121042763380872695738609314631539148548792514028885025189788076023838995615684850391995855029256054176767663145354058496296796781349420116003325874431438746248313850214980401681940795687219268462617287403480967931949965604299190281810597603263251746405016454606266765529010639868703668263299050577706266397868453584384057673298268163448646707439990917504018892319267557518354054956017732907127219134577524905771512773358423314008356080926962298894163047287780054743798498545562870729968407382937218623831766524716090967192007237658894226186550487552614557855898773008703234726418384831040394818743616224455286163287628541175946460497027724490799275146445792982549802258601001772437840167723166802004162547244179415547810554178036773553354467030326469619447560812831933095679685582771932031205941616693902049665352189672822671972640029493307384717544753761937017882976382487233361813499414541694736549254840633793674361541081593464960431603544354737728802361047743115330785159902977771499610274627769759612488879448609863349422852847651310277926279743981957617505591300993377368240510902583759345170015340522266144077237050890044496613295859536020556034009492820943862994618834790932894161098856594954213114335608810239423706087108026465913203560121875933791639666437282836752328391688865373751335794859860107569374889645657187292540448508624449947816273842517229343960137212406286783636675845331904743954740664015260871940915743955282773904303868772728262065663129387459875317749973799293043294371763801856280061141619563942414312254397099163565102848315765427037906837175764870230052388197498746636856292655058222887713221781440489538099681072143012394693530931524054081215705402274414521876541901428386744260011889041724570537470755550581632831687247110220353727166112304857340460879272501694701067831178927095527253222125224361673343366384756590949728221809418684074238351567868893421148203905824224324264643630201441787982022116248471657468291146315407563770222740135841109076078464780070182766336227978104546331131294044833570134869585165267459515187680033395522410548181767867772152798270250117195816577603549732923724732067853690257536233971216884390878879262188202305529937132397194333083536231248870386416194361506529551267334207198502259771408638122015980894363561808597010080081622557455039101321981979045520049618583777721048046635533806616517023595097133203631578945644487800945620369784973459902004606886572701865867757842758530645706617127194967371083950603267501532435909029491516973738110897934782297684100117657987098185725131372267749706609250481876835516003714638685918913011736805218743265426063700710595364425062760458252336880552521181566417553430681181548267844169315284408461087588214317641649835663127518728182948655658524206852221830755306118393326934164459415342651778653397980580828158806300749952897558204686612590853678738603318442905510689778698417735603118111677563872589911516803236547002987989628986181014596471307916144369564690909518788574398821730583884980809523077569358851616027719521488998358632323127308909861560777386006984035267826785387215920936255817889813416247486456433211043194821421299793188104636399541496539441501383868748384870224681829391860319598667962363489309283087840712400431022706137591368056518861313458307990705003607588327248867879324093380071864152853317943535073401891193638546730000660453783784472469288830546979000131248952100446949032058838294923613919284305249167833012980192255157050378521810552961623637523647962685751660066539364142273063001648652613891842243501797455993616794063303522111829071597538821839777552812981538570168702202620274678647916644030729018445497956399844836807851997088201407769199261674991148329821854382718946282165387064858588646221611410343570342878862979083418871606214430014533275029715104673156021000043869510583773779766003460887624861640938645252177935289947578496255243925598620521409052346250847830487046492688313289470553891357290706967599556298586669559721686506052072801342104355762779184021797626656484580261591407173477009039475168017709900129391137881248534255949312866653465033728846390649968460644741907524313323903404908195233044389559060547854954620263256676813262435925020249516275607080900436460421497025691488555265022810327762115842282433269528629137662675481993546118143913367579700141255870143319434764035725376914388899683088262844616425575034001428982557620386364384137906519612917777354183694676232982904981261717676191554292570438432239918482261744350470199171258214687683172646078959690569981353264435973965173473319484798758064137926885413552523275720457329477215706850016950046959758389373527538622664943456437071610511521617176237598050900553232154896062817794302268640579555845730600598376482703339859420098582351400179507104569019191359062304102336798080907240196312675268916362136351032648077232914950859151265812143823371072949148088472355286394195993455684156344577951727033374238129903260198160571971183950662758220321837136059718025940870615534713104482272716848395524105913605919812444978458110854511231668173534838253724825347636777581712867205865148285317273569069839935110763432091319780314031658897379628301178409806410175016511072932907832177487566289310650383806093372841399226733384778203302020700517188941706465146238366720632742644336612174011766914919235570905644803016342294301837655263108450172510307540942604409687066288066265900569082451407632599158164499361455172452057020443093722305550217222299706209749268609762787409626448772056043078634808885709143464793241536214303199965695610753570417207285334250171325558818113295504095217830139465216436594262960768570585698507157151317262928960072587601564840556088613165411835958628710665496282599535127193244635791046554389165150954187306071015034430609582302257455974944275067630926322529966338219395202927917973247094559691016402983683080426309910481567503623509654924302589575273521412445149542462972258510120707802110188106722347972579330653187713438466713807546383471635428854957610942841898601794658721444495198801550804042506452191484989920400007310672369944655246020908767882300064337725657385010969899058191290957079866699453765080407917852438222041070599278889267745752084287526377986730360561230710723922581504781379172731261234878334034473833573601973235946604273704635201327182592410906040097638585857716958419563109577748529579836844756803121874818202833941887076311731615289811756429711334181497218078040465077657204457082859417475114926179367379999220181789399433337731146911970737861041963986422166045588965683206701337505745038872111332436739840284188639147633491695114032583475841514170325690161784931455706904169858050217798497637014758914810543205854914100662201721719726878930012101267481270235940855162601689425111458499658315589660460091525797881670384625905383256920520425791378948827579603278877535466861441826827797651258953563761485994485049706638406266121957141911063246061774180577212381659872472432252969098533628440799030007594546281549235506086481557928961969617060715201589825299772803520002610888814176506636216905928021516429198484077446143617891415191517976537848282687018750030264867608433204658525470555882410254654806040437372771834769014720664234434374255514129178503032471263418076525187802925534774001104853996960549926508093910691337614841834884596365621526610332239417467064368340504749943339802285610313083038484571294767389856293937641914407036507544622061186499127249643799875806537850203753189972618014404667793050140301580709266213229273649718653952866567538572115133606114457222800851183757899219543063413692302293139751143702404830227357629039911794499248480915071002444078482866598579406525539141041497342780203520135419925977628178182825372022920108186449448349255421793982723279357095828748597126780783134286180750497175747373730296280477376908932558914598141724852658299510882230055223242218586191394795184220131553319634363922684259164168669438122537135960710031743651959027712571604588486044820674410935215327906816032054215967959066411120187618531256710150212239401285668608469435937408158536481912528004920724042172170913983123118054043277015835629513656274610248827706488865037765175678806872498861657094846665770674577000207144332525555736557083150320019082992096545498737419756608619533492312940263904930982014700371161829485939931199955070455381196711289367735249958182011774799788636393286405807810818657337668157893827656450642917396685579555053188715314552353070355994740186225988149854660737787698781542360397080977412361518245964026869979609564523828584235953564615185448165799966460648261396618720304839119560250381111550938420209894591555760083897989949964566262540514195610780090298667014635238532066032574466820259430618801773091109212741138269148784355679352572808875543164693077235363768226036080174040660997151176880434927489197133087822951123746632635635328517394189466510943745768270782209928468034684157443127739811044186762032954475468077511126663685479944460934809992951875666499902261686019672053749149951226823637895865245462813439289338365156536992413109638102559114643923805213907862893561660998836479175633176725856523591069520326895990054884753424160586689820067483163174286329119633399132709086065074595260357157323069712106423424081597068328707624437165532750228797802598690981111226558888151520837482450034463046505984569690276166958278982913613535306291331427881888249342136442417833519319786543940201465328083410341785272489879050919932369270996567133507711905899945951923990615156165480300145359212550696405345263823452155999210578191371030188979206408883974767667144727314254467923500524618849237455307575734902707342496298879996942094595961008702501329453325358045689285707241207965919809225550560061971283541270202072583994171175520920820151096509526685113897577150810849443508285458749912943857563115668324566827992991861539009255871716840495663991959154034218364537212023678608655364745175654879318925644085274489190918193411667583563439758886046349413111875241038425467937999203546910411935443113219136068129657568583611774564654674861061988591414805799318725367531243470335482637527081353105570818049642498584646147973467599315946514787025065271083508782350656532331797738656666181652390017664988485456054961300215776115255813396184027067814900350252876823607822107397102339146870159735868589015297010347780503292154014359595298683404657471756232196640515401477953167461726208727304820634652469109953327375561090578378455945469160223687689641425960164689647106348074109928546482353083540132332924864037318003195202317476206537726163717445360549726690601711176761047774971666890152163838974311714180622222345718567941507299526201086205084783127474791909996889937275229053674785020500038630036526218800670926674104806027341997756660029427941090400064654281074454007616429525362460261476180471744322889953285828397762184600967669267581270302806519535452053173536808954589902180783145775891280203970053633193821100095443241244197949192916205234421346395653840781209416214835001155883618421164283992454027590719621537570187067083731012246141362048926555668109467076386536083015847614512581588569610030337081197058344452874666198891534664244887911940711423940115986970795745946337170243268484864632018986352827092313047089215684758207753034387689978702323438584381125011714013265769320554911860153519551654627941175593967947958810333935413289702528893533748106257875620364294270257512121137330213811951395756419122685155962476203282038726342066227347868223036522019655729325905068134849292299647248229359787842720945578267329975853818536442370617353517653060396801087899490506654491544577952166038552398013798104340564182403396162494910454712104839439200945914647542424785991096900046541371091630096785951563947332190934511838669964622788855817353221326876634958059123761251203010983867841195725887799206041260049865895027247133146763722204388398558347770112599424691208308595666787531942465131444389971195968105937957532155524204659410081418351120174196853432672343271868099625045432475688702055341969199545300952644398446384346598830418262932239295612610045884644244285011551557765935780379565026806130721758672048541797157896401554276881090475899564605488362989140226580026134158039480357971019004151547655018391755772677897148793477372747525743898158705040701968215101218826088040084551332795162841280679678965570163917067779841529149397403158167896865448841319046368332179115059107813898261026271979696826411179918656038993895418928488851750122504754778999508544083983800725431468842988412616042682248823097788556495765424017114510393927980290997604904428832198976751320535115230545666467143795931915272680278210241540629795828828466355623580986725638200565215519951793551069127710538552661926903526081367717666435071213453983711357500975854405939558661737828297120544693182260401670308530911657973113259516101749193468250063285777004686987177255226525708428745733039859744230639751837209975339055095883623642814493247460522424051972825153787541962759327436278819283740253185668545040893929401040561666867664402868211607294830305236465560955351079987185041352121321534713770667681396211443891632403235741573773787908838267618458756361026435182951815392455211729022985278518025598478407179607904114472041476091765804302984501746867981277584971731733287305281134969591668387877072315968334322509070204019030503595891994666652037530271923764252552910347950343816357721698115464329245608951158732012675424975710520894362639501382962152214033621065422821876739580121286442788547491928976959315766891987305176388698461503354594898541849550251690616888419122873385522699976822609645007504500096116866129171093180282355042553653997166054753907348915189650027442328981181709248273610863801576007240601649547082331349361582435128299050405405333992577071321011503713898695076713447940748097845416328110406350804863393555238405735580863718763530261867971725608155328716436111474875107033512913923595452951407437943144900950809932872153235195999616750297532475931909938012968640379783553559071355708369947311923538531051736669154087312467233440702525006918026747725078958903448856673081487299464807786497709361969389290891718228134002845552513917355978456150353144603409441211512001738697261466786933733154341007587514908295822756919350542184106448264951943804240543255345965248373785310657979037977505031436474651422484768831323479762673689855474944277949916560108528257618964374464656819789319422077536824661110427671936481836360534108748971066866318805026555929568123959680449295166615409802610781691689418764353363449482900125929366840591370059526914934421861891742142561071896846626335874414976973921566392767687720145153302241853125308442727245771161505550519076276250016522166274796257424425420546785767478190959486500575711016264847833741198041625940813327229905891486422127968042984725356237202887830051788539737909455265135144073130049869453403245984236934627060242579432563660640597549471239092372458126154582526667304702319359866523378856244229188278436440434628094888288712101968642736370461639297485616780079779959696843367730352483047478240669928277140069031660709951473154191919911453182543906294573298686613524886500574780251977607442660798300291573030523199052185718628543687577860915726925232573171665625274275808460620177046433101212443409281314659760221360416223031167750085960128475289259463348312408766740128170543067985261868949895004918275008304998926472034986965363326210919830621495095877228260815566702155693484634079776879525038204442326697479264829899016938511552124688935873289878336267819361764023681714606495185508780596635354698788205094762016350757090024201498400967867845405354130050482404996646978558002628931826518708714613909521454987992300431779500489569529280112698632533646737179519363094399609176354568799002814515169743717518330632232942199132137614506411391269837128970829395360832883050256072727563548374205497856659895469089938558918441085605111510354367477810778500572718180809661542709143010161515013086522842238721618109043183163796046431523184434669799904865336375319295967726080853457652274714047941973192220960296582500937408249714373040087376988068797038047223488825819819025644086847749767508999164153502160223967816357097637814023962825054332801828798160046910336602415904504637333597488119998663995617171089911809851197616486499233594328274275983382931099806461605360243604040848379619072542165869409486682092396143083817303621520642297839982533698027039931804024928814430649614747600087654305571672697259114631990688823893005380061568007730984416061355843701277573463708822073792921409548717956947854414951731561828176343929570234710460088230637509877521391223419548471196982303169544468045517922669260631327498272520906329003279972932906827204647650366969765227673645419031639887433042226322021325368176044169612053532174352764937901877252263626883107879345194133825996368795020985033021472307603375442346871647223795507794130304865403488955400210765171630884759704098331306109510294140865574071074640401937347718815339902047036749084359309086354777210564861918603858715882024476138160390378532660185842568914109194464566162667753712365992832481865739251429498555141512136758288423285957759412684479036912662015308418041737698963759002546999454131659341985624780714434977201991702665380714107259910648709897259362243300706760476097690456341576573395549588448948093604077155688747288451838106069038026528318275560395905381507241627615047252487759578650784894547389096573312763852962664517004459626327934637721151028545472312880039058405918498833810711366073657536918428084655898982349219315205257478363855266205400703561310260405145079325925798227406012199249391735122145336707913500607486561657301854049217477162051678486507913573336334257685988361252720250944019430674728667983441293018131344299088234006652915385763779110955708000600143579956351811596764725075668367726052352939773016348235753572874236648294604770429166438403558846422370760111774821079625901180265548868995181239470625954254584491340203400196442965370643088660925268811549596291166168612036195319253262662271108142149856132646467211954801142455133946382385908540917878668826947602781853283155445565265933912487885639504644196022475186011405239187543742526581685003052301877096152411653980646785444273124462179491306502631062903402737260479940181929954454297256377507172705659271779285537195547433852182309492703218343678206382655341157162788603990157495208065443409462446634653253581574814022471260618973060860559065082163068709634119751925774318683671722139063093061019303182326666420628155129647685313861018672921889347039342072245556791239578260248978371473556820782675452142687314252252601795889759116238720807580527221031327444754083319215135934526961397220564699247718289310588394769170851420631557192703636345039529604362885088555160008371973526383838996789184600327073682083234847108471706160879195227388252347506380811606090840124222431476103563328940609282430125462013806032608121942876847907192546246309055749298781661271916548229644317263587524548607563020667656942355342774617635549231817456159185668061686428714964129290560130053913469569829490891003991259088290348791943368696942620662946948514931472688923571615032405542263391673583102728579723061998175868700492227418629077079508809336215346303842967525604369606110193842723883107587771653594778681499030978765900869583480043137176832954871752604714113064847270887246697164585218774442100900090916189819413456305028950484575822161887397443918833085509908566008543102796375247476265353031558684515120283396640547496946343986288291957510384781539068343717740714095628337554413567955424664601335663617305811711646062717854078898495334329100315985673932305693426085376230981047171826940937686754301837015557540822371538037838383342702379535934403549452173960327095407712107332936507766465603712364707109272580867897181182493799540477008369348889220963814281561595610931815183701135104790176383595168144627670903450457460997444500166918675661035889313483800512736411157304599205955471122443903196476642761038164285918037488354360663299436899730090925177601162043761411616688128178292382311221745850238080733727204908880095181889576314103157447684338100457385008523652069340710078955916549813037292944462306371284357984809871964143085146878525033128989319500645722582281175483887671061073178169281242483613796475692482076321356427357261609825142445262515952514875273805633150964052552659776922077806644338105562443538136258941809788015677378951310313157361136026047890761945591820289365770116416881703644242694283057457471567494391573593353763114830246668754727566653059819746822346578699972291792416156043557665183382167059157867799311835820189855730344883681934418305987021880502259192818047775223884407167894780414701414651073580452021499197980812095692195622632313741870979731320870864552236740416185590793816745658234353037283309503729022429802768451559528656923189798000383061378732434546500582722712325031420712488100290697226311129067629080951145758060270806092801504406139446350643069742785469477459876821004441453438033759717384777232052065301037861326418823586036569054773343070911759152582503029410738914441818378779490613137536794654893375260322906277631983337976816641721083140551864133302224787118511817036598365960493964571491686005656771360533192423185262166760222073368844844409234470948568027905894191829969467724456269443308241243846160408284006424867072583661011433404214473683453638496544701067827313169538435919120440283949541956874453676459875488726170687163109591315801609722382049772577307454562979127906177531663252857205858766376754282917933549923678212008601904369428956102301731743150352204665675088491593025926618816581008701658499456495586855628208747248318351516339189292646558880593601275151838235485893426165223086697314511412035659916934103076974774451947043836739600076578628245472064617380804602903639144493859012422380173377038154675297645596518492676039300171943042511794045679862114630138402371099347243455794730048929825402680821621522346560274258486595687074510352794291633405915025075992398611224340312056999780516223878772230396359709132856830486160362127579561601328561866388146004722200580017580282279272167842720649966956840905752590774886105493806116954293569077377792821084159737469613143291808510446953973485067590503662391722108732333169909603363771705474725026941732982890400239372879549386540463828596742216318201530139629734398479588628632934746650690284066719018081265539973675916799759010867483920062877888531102781695087545740384607594616919584610655963327283485609570305572502494416337066573150237126843581984154103154401008430380631442183776750349813408169325201240813452285974626715177152223063741359255747513535160669108359443999692315898156732033027129284241219651936303734407981204656795322986357374589031654007016472204989445629050395873788912680565516464274460174738175296313458739390484560414203426465560422112239134631023161290836446988901247285192778589195228773637440432659264672239982186452797664826673070168802722052338600372842903155828454593854349099449420750911108532138744823216151007808922516285123275724355101999038195993350032641446053470357293073912578481757987468353429629749652545426864234949270336399427519354240001973125098882419600095766257217621860474573769577649582201796258392376391717855799468922496750179251915218219624653575570564228220399546682648329822996167217080156801080799777126517156274295763666959661983507435667132218383358509536665806605597148376773866922551603463644386269977295750658468929599809168949981898588529537874489519527097766262684177088590284321676352132630838812766335363319004134332844347630067982023716933653652880580156390360562722752187272454764258840995216482554453662083811789117725225682611478014242896970967121967502094421226279437073328703410646312100557376727450271638975234111426287828736758358819056742163061523416789476056879277154789714326222041069587947186435439940738639948986836168919377836648327137363654676901173760246643082285362494712605173293777247276797635865806019396287718060679122426813922872134061694882029506831654589707623668302556167559477498715183426989208952182644710514911419441192277010977616645850068963849426165593473112961064282379048216056210094265076173838082479030510998790719611852832556787472942907151041468948104916751035295897242381802288151276582257190705537652455285511598636421244284176256230139538669970308943645907600684938040875210854159851278070333207779865635907968462191534944587677170063778573171211036517486371634098385626541555573292664616402279791195975248525300376741774056125700303625811704838385391207273191845064713669122576415213769896260940351804147432053600369234179035440735703058314741623452840188940808983125191307741823338981880316339159565954543405777784331681162551898060409183018907512170192983622897099598983405484962284289398469847938668614293324543983592637036699355184231661615244505980576745765335552338715678211466689996845227042954589710922163652573965950289645637766038988037941517917867910675199009966139206238732318786758420544279396366759104126821843375015743069045967947046685602358283919759975285865384338189120042853787549302768972168199113340697282255535300044743958830079799736518459131437946494086272149669719100359399974735262764126125995350902609540048669398955899487421379590802893196914845826873123710180229775301190684280440780938156598081694611679374425663244656799606363751546304833112722231812338371779800439731087402647536582575657351059978314264831879619843765495877803685261751835391844920488198629786329743136948511780579298636452193232481339393090754566368038513630619718033957979522539508697432546502659123585049283028832934489284591373621624852528877442891851104093746333590660233239711922814450735588373324057814862662207486215513375036775585494138678352928273109003823116855374520901095101174796663003330352534143230024288248051396631446632656081582045216883922312025671065388459503224002320453633895521539919011035217362720909565500846486605368975498478995875596103167696587161281951919668893326641203784750417081752273735270989343717167642329956935697166213782736138899530515711822960896394055380431939398453970864418654291655853168697537052760701061488025700785387150835779480952313152747735711713643356413242974208137266896149109564214803567792270566625834289773407718710649866150447478726164249976671481383053947984958938064202886667951943482750168192023591633247099185942520392818083953020434979919361853380201407072481627304313418985942503858404365993281651941497377286729589582881907490040331593436076189609669494800067194371424058105327517721952474344983414191979918179909864631583246021516575531754156198940698289315745851842783390581029411600498699307751428513021286202539508732388779357409781288187000829944831476678183644656510024467827445695591845768068704978044824105799710771577579093525803824227377612436908709875189149049904225568041463131309240101049368241449253427992201346380538342369643767428862595140146178201810734100565466708236854312816339049676558789901487477972479202502227218169405159042170892104287552188658308608452708423928652597536146290037780167001654671681605343292907573031466562485809639550080023347676187068086526878722783177420214068980703410506200235273632267291964034093571225623659496432076928058165514428643204955256838543079254299909353199329432966018220787933122323225928276556048763399988478426451731890365879756498207607478270258861409976050788036706732268192473513646356758611212953074644777149423343867876705824452296605797007134458987594126654609414211447540007211790607458330686866231309155780005966522736183536340439991445294960728379007338249976020630448806064574892740547730693971337007962746135534442514745423654662752252624869916077111131569725392943756732215758704952417232428206555322808868670153681482911738542735797154157943689491063759749151524510096986573825654899585216747260540468342338610760823605782941948009334370046866568258579827323875158302566720152604684361412652956519894291184887986819088277339147282063794512260294515707367105637720023427811802621502691790400488001808901847311751199425460594416773315777951735444490965752131026306836047140331442314298077895617051256930051804287472368435536402764392777908638966566390166776625678575354239947427919442544664643315554138265543388487778859972063679660692327601733858843763144148113561693030468420017434061395220072403658812798249143261731617813894970955038369479594617979829257740992171922783223006387384996138434398468502234780438733784470928703890536420557474836284616809363650973790900204118525835525201575239280826462555785658190226958376345342663420946214426672453987171047721482128157607275305173330963455909323664528978019175132987747952929099598069790148515839540444283988381797511245355548426126784217797728268989735007954505834273726937288386902125284843370917479603207479554080911491866208687184899550445210616155437083299502854903659617362726552868081324793106686855857401668022408227992433394360936223390321499357262507480617409173636062365464458476384647869520547719533384203403990244761056010612777546471464177412625548519830144627405538601855708359981544891286863480720710061787059669365218674805943569985859699554089329219507269337550235821561424994538234781138316591662683103065194730233419384164076823699357668723462219641322516076261161976034708844046473083172682611277723613381938490606534404043904909864126903479263503943531836741051762565704797064478004684323069430241749029731181951132935746854550484711078742905499870600373983113761544808189067620753424526993443755719446665453524088287267537759197074526286322840219629557247932987132852479994638938924943286917770190128914220188747760484939855471168524810559991574441551507431214406120333762869533792439547155394213121021954430556748370425907553004950664994802614794524739012802842646689229455664958621308118913500279654910344806150170407268010067948926855360944990373928383520627992820181576427054962997401900837493444950600754365525758905546552402103412862124809003162941975876195941956592556732874237856112669741771367104424821916671499611728903944393665340294226514575682907490402153401026923964977275904729573320027982816062130523130658731513076913832317193626664465502290735017347656293033318520949298475227462534564256702254695786484819977513326393221579478212493307051107367474918016345667888810782101151826314878755138027101379868751299375133303843885631415175908928986956197561123025310875057188962535763225834275763348421016668109884514141469311719314272028007223449941999003964948245457520704922091620614222912795322688239046498239081592961111003756999529251250673688233852648213896986384052437049402152187547825163347082430303521036927849762517317825860862215614519165573478940019558704784741658847364803865995119651409542615026615147651220820245816010801218275982577477652393859159165067449846149161165153821266726927461290533753163055654440793427876550267301214578324885948736899073512166118397877342715872870912311383472485146035661382188014840560716074652441118841800734067898587159273982452147328317214621907330492060817440914125388918087968538960627860118193099489240811702350413554126823863744341209267781729790694714759018264824761112414556423937732224538665992861551475342773370683344173073150805440138894084087253197595538897613986400165639906934600670780501058567196636796167140097031535132386972899001749862948883362389858632127176571330142071330179992326381982094042993377790345261665892577931395405145369730429462079488033141099249907113241694504241391265397274078984953073730364134893688060340009640631540701820289244667315059736321311926231179142794944897281477264038321021720718017561601025111179022163703476297572233435788863537030535008357679180120653016668316780269873860755423748298548246360981608957670421903145684942967286646362305101773132268579232832164818921732941553151386988781837232271364011755881332524294135348699384658137175857614330952147617551708342432434174779579226338663454959438736807839569911987059388085500837507984051126658973018149321061950769007587519836861526164087252594820126991923916722273718430385263107266000047367872474915828601694439920041571102706081507270147619679971490141639274282889578424398001497985658130305740620028554097382687819891158955487586486645709231721825870342960508203415938806006561845735081804032347750084214100574577342802985404049555529215986404933246481040773076611691605586804857302606467764258503301836174306413323887707999698641372275526317649662882467901094531117120243890323410259937511584651917675138077575448307953064925086002835629697045016137935696266759775923436166369375035368699454550392874449940328328128905560530091416446608691247256021455381248285307613556149618444364923014290938289373215312818797541139219415606631622784836152140668972661027123715779503062132916001988806369127647416567067485490795342762338253943990022498972883660263920518704790601584084302914787302246651371144395418253441269003331181914268070735159284180415100555199146564934872796969351992963117195821262627236458009708099166752820365818699111948365866102758375863322993225541477479210421324166848264953111826527351008031659958888814809945737293785681411438021523876706455063233067233939551964260397443829874822322662036352861302543796600943104500158604854027036789711934695579989189112302233381602302236277726084846296189550730850698061500281436425336666311433321645213882557346329366870956708432252564333895997812402164189946978348320376011613913855499933990786652305860332060641949298931012423081105800169745975038516887112037747631577311831360002742502722451570906304496369230938382329175076469684003556425503797106891999812319602533733677437970687713814747552190142928586781724044248049323750330957002929126630316970587409214456472022710796484778657310660832173093768033821742156446602190335203981531618935787083561603302255162155107179460621892674335641960083663483835896703409115513087820138723494714321400450513941428998350576038799343355677628023346565854351219361896876831439866735726040869511136649881229957801618882834124004126142251475184552502502640896823664946401177803776799157180146386554733265278569418005501363433953502870836220605121839418516239153709790768084909674194289061134979961034672077354959593868862427986411437928435620575955500144308051267664432183688321434583708549082240014585748228606859593502657405750939203135881722442164955416889785558265198046245527898343289578416968890756237467281044803018524217706136533236073856228166664597654076844715963930782091017090763377917711485205493367936868430832404126789220929930411890501756484917499452393770674524578019171841679541825554377930299249277892416277257788147974770446005423669346157135208417428211847353652367573702352791459837645712257646122605628127852169580892808988394594406165340521932514843306105322700231133680378433377389724881307874325614952744243584753011150345103737688223837573804282007358586938044331529253129961025096113761670187568525921208929131354473196308440066835155160913925692912175784379179004808848023029304392630921342768601226558630456913133560978156776098711809238440656353136182676923761613389237802972720736243967239854144480757286813436768000573823963610796223140429490728058551444771338682314499547929338131259971996894072233847404542592316639781608209399269744676323921370773991899853301483814622364299493902073285072098040905300059160091641710175605409814301906444379905831277826625762288108104414704097708248077905168225857235732665234414956169007985520848841886027352780861218049418060017941147110410688703738674378147161236141950474056521041002268987858525470689031657094677131822113205505046579701869337769278257145248837213394613987859786320048011792814546859096532616616068403160077901584946840224344163938313618742275417712170336151163782359059685168880561304838542087505126933144171705880517278127917564053282929427357971823360842784676292324980318169828654166132873909074116734612367109059236155113860447246378721244612580406931724769152219217409096880209008801535633471775664392125733993165330324425899852598966724744126503608416484160724482125980550754851232313331300621490042708542735985913041306918279258584509440150719217604794274047740253314305451367710311947544521321732225875550489799267468541529538871443696399406391099267018219539890685186755868574434469213792094590683677929528246795437302263472495359466300235998990248299853826140395410812427393530207575128774273992824866921285637240069184859771126480352376025469714309316636539718514623865421671429236191647402172547787238964043145364190541101514371773797752463632741619269990461595895793940622986041489302535678633503526382069821487003578061101552210224486633247184367035502326672749787730470216165019711937442505629639916559369593557640005236360445141148916155147776301876302136068825296274460238077523189646894043033182148655637014692476427395401909403584437251915352134557610698046469739424511797999048754951422010043090235713636892619493763602673645872492900162675597083797995647487354531686531900176427222751039446099641439322672532108666047912598938351926694497553568096931962642014042788365702610390456105151611792018698900673027082384103280213487456720062839744828713298223957579105420819286308176631987048287388639069922461848323992902685392499812367091421613488781501234093387999776097433615750910992585468475923085725368613605356762146929424264323906626708602846163376051573599050869800314239735368928435294958099434465414316189806451480849292695749412903363373410480943579407321266012450796613789442208485840536446021616517885568969302685188950832476793300404851688934411125834396590422211152736276278672366665845757559585409486248261694480201791748223085835007862255216359325125768382924978090431102048708975715033330963651576804501966025215527080352103848176167004443740572131294252820989545456276344353575741673638980108310579931697917916718271145837435222026387771805250290791645414791173616253155840768495583288190293564201219633684854080865928095131505012602919562576032932512847250469881908146475324342363863860247943921015193235101390117789997483527186469346024554247028375300033725403910085997650987642832802908445662021678362267272292737780213652404028817217012490974899454430826861772239385250883760749742195942655217301733355851389407457348144161511380845358039740277795072051893487170722955427683655826706766313911972211811528466502223383490906676554168336907959409404576472940901354356409277969379842065738891481990225399022315913388145851487225126560927576795873759207013915029216513720851137197522734365458411622066281660256333632074449918511469174455062297146086578736313585389023662557285424516018080487167823688885575325066254262367702604215835160174851981885460860036597606743233346410471991027562358645341748631726556391320606407754779439671383653877377610828300019937359760370467245737880967939894493795829602910746901609451288456550071458091887879542641820145369659962842686882363495879277007025298960996798975941955735253914237782443302746708282008722602053415292735847582937522487377937899136764642153727843553986244015856488692101644781661602962113570056638347990334049623875941092886778920270077504951511405782565295015024484968204744379710872943108541684540513016310902267112951959140520827546866418137305837933236150599142045255880213558474751516267815309465541240524091663857551298894834797423322854504140527354235070335984964593699534959698554244978249586929179182415068053002553370412778703476446244329205906832901886692400222391918714603175399666877477960121790688623311002908668305431787009355066944389131913333586368037447530664502418437136030852288582121720231274167009740351431532131803978033680228154223490183737494117973254478594157962104378787072154814091725163615415163381388912588517924237727229603497305533840942889918919161186249580560073570527227874940321250645426206304469470804277945973817146810395192821550688079136701210109944220737024613687196031491162370967939354636396448139025711768057799751751298979667073292674886430097398814873780767363792886767781170520534367705731566895899181530825761606591843760505051704242093231358724816618683821026679970982966436224723644898648976857100173643547336955619347638598187756855912376232580849341570570863450733443976604780386678461711520325115528237161469200634713570383377229877321365028868868859434051205798386937002783312365427450532283462669786446920780944052138528653384627970748017872477988461146015077617116261800781557915472305214759943058006652042710117125674185860274188801377931279938153727692612114066810156521441903567333926116697140453812010040811760123270513163743154487571768761575554916236601762880220601068655524141619314312671535587154866747899398685510873576261006923021359580838145290642217792987748784161516349497309700794368305080955621264592795333690631936594413261117944256602433064619312002953123619348034504503004315096798588111896950537335671086336886944665564112662287921812114121425167348136472449021275252555647623248505638391391630760976364990288930588053406631352470996993362568102360392264043588787550723319888417590521211390376609272658409023873553418516426444865247805763826160023858280693148922231457758783791564902227590699346481624734399733206013058796068136378152964615963260698744961105368384203105364183675373594176373955988088591188920114871545460924735613515979992999722298041707112256996310945945097765566409972722824015293663094891067963296735505830412258608050740410916678539569261234499102819759563955711753011823480304181029089719655278245770283085321733741593938595853203645590564229716679900322284081259569032886928291260139267587858284765599075828016611120063145411315144108875767081854894287737618991537664505164279985451077400771946398046265077776614053524831090497899859510873112620613018757108643735744708366215377470972660188656210681516328000908086198554303597948479869789466434027029290899143432223920333487108261968698934611177160561910681226015874410833093070377506876977485840324132474643763087889666151972556180371472590029550718424245405129246729039791532535999005557334600111693557020225722442772950263840538309433999383388018839553821540371447394465152512354603526742382254148328248990134023054550811390236768038649723899924257800315803725555410178461863478690646045865826036072306952576113184134225274786464852363324759102670562466350802553058142201552282050989197818420425028259521880098846231828512448393059455162005455907776121981297954040150653985341579053629101777939776957892084510979265382905626736402636703151957650493344879513766262192237185642999150828898080904189181015450813145034385734032579549707819385285699926238835221520814478940626889936085239827537174490903769904145555260249190126341431327373827075950390882531223536876389814182564965563294518709637484074360669912550026080424160562533591856230955376566866124027875883101021495284600804805028045254063691285010599912421270508133194975917146762267305044225075915290251742774636494555052325186322411388406191257012917881384181566918237215400893603475101448554254698937834239606460813666829750019379115061709452680984785152862123171377897417492087541064556959508967969794980679770961683057941674310519254486327358885118436597143583348756027405400165571178309126113117314169066606067613797690123141099672013123730329707678988740099317309687380126740538923612230370779727025191340850390101739924877352408881040807749924412635346413181858792480760553268122881584307471326768283097203149049868884456187976015468233715478415429742230166504759393312132256510189175368566338139736836336126010908419590215582111816677413843969205870515074254852744810154541079359513596653630049188769523677579147319184225806802539818418929888943038224766186405856591859943091324575886587044653095332668532261321209825839180538360814144791320319699276037194760191286674308615217243049852806380129834255379486287824758850820609389214668693729881191560115633701248675404205911464930888219050248857645752083363921499441937170268576222251074166230901665867067714568862793343153513505688216165112807318529333124070912343832502302341169501745502360505475824093175657701604884577017762183184615567978427541088499501610912720817913532406784267161792013428902861583277304794830971705537485109380418091491750245433432217445924133037928381694330975012918544596923388733288616144238100112755828623259628572648121538348900698511503485369544461542161283241700533583180520082915722904696365553178152398468725451306350506984981006205514844020769539324155096762680887603572463913955278222246439122592651921288446961107463586148252820017348957533954255019475442643148903233373926763409115527189768429887783617346613535388507656327107814312435018965109238453660236940276060642119384227665755210663671879603217527184404651560427289869560206997012906367847161654793068868305846508082886614111979138822898112498261434559408961813509226857611474609406147937240008842153535862052780125014270055274468359151840373309373580494342483940467505708347927948338133276237937844629209323999417593374917899786484958148818865149169302451512835579818112344900827168644548306546633975256079615935830821400021951611342337058359111545217293721664061708131602078213341260356852013161345136871600980378712556766143923146458085652084039744217352744813741215277475202259244561520365608268890193913957991844109971588312780020898275935898106482117936157951837937026741451400902833064466209280549839169261068975151083963132117128513257434964510681479694782619701483204392206140109523453209269311762298139422044308117317394338867965739135764377642819353621467837436136161591167926578700137748127848510041447845416464568496606699139509524527949914769441031612575776863713634644477006787131066832417871556281779122339077841275184193161188155887229676749605752053192594847679397486414128879475647133049543555044790277128690095643357913405127375570391806822344718167939329121448449553897728696601037841520390662890781218240141299368590465146519209198605347788576842696538459445700169758422531241268031418456268722581132040056433413524302102739213788415250475704533878002467378571470021087314693254557923134757243640544448132093266582986850659125571745568328831440322798049274104403921761438405750750288608423536966715191668510428001748971774811216784160854454400190449242294333666338347684438072624307319019363571067447363413698467328522605570126450123348367412135721830146848071241856625742852208909104583727386227300781566668914250733456373259567253354316171586533339843321723688126003809020585719930855573100508771533737446465211874481748868710652311198691114058503492239156755462142467550498676710264926176510110766876596258810039163948397811986615585196216487695936398904500383258041054420595482859955239065758108017936807080830518996468540836412752905182813744878769639548306385089756146421874889271294890398025623046812175145502330254086076115859321603465240763923593699949180470780496764486889980902123735780457040380820770357387588525976042434608851075199334470112741787878845674656640471901619633546770714090590826954225196409446319547658653032104723804625249971910690110456227579220926904132753699634145768795242244563973018311291451151322757841320376225862458224784696669785947914981610522628786944136373683125108310682898766123782697506343047263278453719024447970975017396831214493357290791648779915089163278018852504558488782722376705263811803792477835540018117452957747339714012352011459901984753358434861297092928529424139865507522507808919352104173963493428604871342370429572757862549365917805401652536330410692033704691093097588782938291296447890613200063096560747882082122140978472301680600835812336957051454650181292694364578357815608503303392466039553797630836137289498678842851139853615593352782103740733076818433040893624460576706096188294529171362940967592507631348636606011346115980434147450705511490716640635688739020690279453438236930531133440901381392849163507484449076828386687476663619303412376248380175840467851210698290605196112357188811150723607303158506622574566366740720668999061320627793994112805759798332878792144188725498543014546662945079670707688135022230580562225942983096887732856788971494623888272184647618153045844390967248232348259587963698908456664795754200195991919240707615823002328977439748112690476546256873684352229063217889227643289360535947903046811114130586348244566489159211382258867880972564351646404364328416076247766114349880319792230537889671148058968061594279189647401954989466232962162567264739015818692956765601444248501821713300527995551312539849919933907083138030214072556753022600033565715934283182650908979350869698950542635843046765145668997627989606295925119763672907762567862769469947280606094290314917493590511523235698715397127866718077578671910380368991445381484562682604003456798248689847811138328054940490519768008320299631757043011485087384048591850157264392187414592464617404735275250506783992273121600117160338604710710015235631159734711153198198710616109850375758965576728904060387168114313084172893710817412764581206119054145955378853200366615264923610030157044627231777788649806700723598889528747481372190175074700005571108178930354895017924552067329003818814068686247959272205591627902292600592107710510448103392878991286820705448979977319695574374529708195463942431669050083984398993036790655541596099324867822475424361758944371791403787168166189093900243862038610001362193667280872414291108080291896093127526202667881902085595708111853836166128848729527875143202956393295910508349687029060692838441522579419764824996318479414814660898281725690484184326061946254276693688953540732363428302189694947766126078346328490315128061501009539164530614554234923393806214007779256337619373052025699319099789404390847443596972052065999017828537676265683558625452697455260991024576619614037537859594506363227095122489241931813728141668427013096050734578659047904243852086508154491350136491698639048125666610843702294730266721499164849610746803261583352580352858275799038584091667618877199539888680431991650866887781701439663176815592262016991396613153738021294160006906947533431677802632207226265881842757216055461439677336258462997385077307751473833315101468395296411397329672457933540390136107395245686243008096720460995545708974893048753897955544443791303790422346037768729236001386569593952300768091377768847789746299699489949016141866131552200856673695770822720338936659590666350594330040363762591189195691561626122704788696510356062748423100605472091437069471661080277379848576543481249822444235828329813543645124092220896643987201997945619030397327254617823136363375927622656301565813545578319730419339269008282952718252138855126583037630477490625995514925943105307478901043009876580816508144862607975129633326675259272351611791836777128931053144471668835182920514343609292493191180249366051791485330421043899773019267686085347768149502299280938065840007311767895491286098112311307002535600347898600653805084532572431553654422067661352337408211307834360326940015926958459588297845649462271300855594293344520727007718206398887404742186697709349647758173683580193168322111365547392288184271373843690526638607662451284299368435082612881367358536293873792369928837047900484722240370919885912556341130849457067599032002751632513926694249485692320904596897775676762684224768120033279577059394613185252356456291805905295974791266162882381429824622654141067246487216174351317397697122228010100668178786776119825961537643641828573481088089988571570279722274734750248439022607880448075724807701621064670166965100202654371260046641935546165838945950143502160890185703558173661823437491622669077311800121188299737319891006060966841193266075165452741829459541189277264192546108246351931647783837078295218389645376236304858042774417907169146356546201215125418664885396161542055152375000426794253417764590821513675258479774465114750438460596325820468809667795709044645884673847481638045635188183210386594798204376334738389017759714236223057776395541011294523488098341476645559342209402059733452337956309441446698222457026367119493286653989491344225517746402732596722993581333110831711807234044326813737231209669052411856734897392234152750707954137453460386506786693396236535556479102508529284294227710593056660625152290924148057080971159783458351173168204129645967070633303569271821496292272073250126955216172649821895790908865085382490848904421755530946832055636316431893917626269931034289485184392539670922412565933079102365485294162132200251193795272480340133135247014182195618419055761030190199521647459734401211601239235679307823190770288415814605647291481745105388060109787505925537152356112290181284710137917215124667428500061818271276125025241876177485994084521492727902567005925854431027704636911098800554312457229683836980470864041706010966962231877065395275783874454229129966623016408054769705821417128636329650130416501278156397799631957412627634011130135082721772287129164002237230234809031485343677016544959380750634285293053131127965945266651960426350406454862543383772209428482543536823186182982713182489884498260285705690699045790998144649193654563259496570044689011049923939218088155626191834404362264965506449848521612498442375928443642612004256628602157801140467879662339228190804577624109076487087406157070486658398144845855803277997327929143195789110373530019873110486895656281917362036703039179710646309906285483702836118486672219457621775034511770110458001291255925462680537427727378863726783016568351092332280649908459179620305691566806180826586923920561895421631986004793961133953226395999749526798801074576466538377400437463695133685671362553184054638475191646737948743270916620098057717103475575333102702706317395612448413745782734376330101853438497450236265733191742446567787499665000938706441886733491099877926005340862442833450486907338279348425305698737469497333364267191968992849534561045719338665222471536681145666596959735075972188416698767321649331898967182978657974612216573922404856900225324160367805329990925438960169901664189038843548375648056012628830409421321300206164540821986138099462721214327234457806819925823202851398237118926541234460723597174777907172041523181575194793527456442984630888846385381068621715274531612303165705848974316209831401326306699896632888532682145204083110738032052784669279984003137878996525635126885368435559620598057278951754498694219326972133205286374577983487319388899574634252048213337552584571056619586932031563299451502519194559691231437579991138301656117185508816658756751184338145761060365142858427872190232598107834593970738225147111878311540875777560020664124562293239116606733386480367086953749244898068000217666674827426925968686433731916548717750106343608307376281613984107392410037196754833838054369880310983922140260514297591221159148505938770679068701351029862207502287721123345624421024715163941251258954337788492834236361124473822814504596821452253550035968325337489186278678359443979041598043992124889848660795045011701169092519383155609441705397900600291315024253848282782826223304151370929502192196508374714697845805550615914539506437316401173317807741497557116733034632008408954066541694665746735785483133770133628948904397670025863002540635264006601631712883920305576358989492412827022489373848906764385339931878608019223108328847459816417701264089078551777830131616162049792779670521847212730327970738223860581986744668610994383049960437407323195784473254857416239738852016202384784256163512597161783106850156299135559874758848151014815490937380933394074455700842090155903853444962128368313687375166780513082594599771257467939781491953642874321122421579851584491669362551569370916855252644720786527971466476760328471332985501945689772758983450586004316822658631176606237201721007922216410188299330808409384014213759697185976897042759041500946595252763487628135867117352364964121058854934496645898651826545634382851159137631569519895230262881794959971545221250667461174394884433312659432286710965281109501693028351496524082850120190831078678067061851145740970787563117610746428835593915985421673115153096948758378955979586132649569817205284291038172721213138681565524428109871168862743968021885581515367531218374119972919471325465199144188500672036481975944167950887487934416759598361960010994838744709079104099785974656112459851972157558134628546189728615020774374529539536929655449012953097288963767713353842429715394179547179095580120134210175150931491664699052366350233024087218654727629639065723341455005903913890253699317155917179823065162679744711857951506573868504088229934804445549850597823297898617029498418376255258757455303112991914341109413088238114443068843062655305601658801408561023324210300218460588586954418502977463085858496130037238190325162225570729975710727306066072916922978033647048840958711228045188511908718588299514331534128549297173849768523136276076868494780364948299904475715771141080958058141208956059471668626290036145602625334863284986816039463372436667112964460292915746181117789169695839947080954788863503281129626899231110099889317815313946681882028368363373822281414974006917942192888817139116283910295684918233358930813360131488748366464224381776081007739183393749346933644748150564933649323157235306109385796839902153381449126925350768211098738352197507736653475499431740580563099143218212547336281359488317681489194306530426029773885492974570569448783077945878865062970895499843760181694031056909587141386804846359853684034105948341788438963179956468815791937174656705047441528027712541569401365862097760735632832966564135817028088013546326104892768731829917950379944446328158595181380144716817284996793061814177131912099236282922612543236071226270324572637946863533391758737446552006008819975294017572421299723542069630427857950608911113416534893431149175314953530067419744979017235181671568754163484949491289001739377451431928382431183263265079530371177806185851153508809998200482761808307209649636476943066172549186143700971387567940218696710148540307471561091358933165600167252126542502898612259306484105898847129649230941215144563947889999327145875969555737090855150648002321476443037232466147111552578583071024936898814562568786834745518893385181791667579054210421036349316257870476543126790661216644142285017446278477132740595579600648343288827864837043456066966456899746910373987712891593313271266247505582258634928427718355831641593667712218537642376222104779338956378722902509543014182257180331300148113377736941508488867501893156994849838936052666818012783912005801431596441910546663236810148207799356523056490420711364192200177189107935243234322761787712568251126481332974354926568682748715986654943041648468220593921673359485057849622807932422649812705271398407720995707236227009245067665680069149966555737866411877079767754867028786431817941521796178310655030287157272282250812017060713380339641841211253856248920130010782462165136989511064611133562443838185366273563783436921279354709230119655914915800561707258518503167289370411936374780625824298250726464801821523430268081486978164824349353456855843696378384153838051184406043696871666416514036129729992912630842812149152469877429332305214999981829046119471676727503742221367186614654042534463141660649871499001000660041544868437352208483059495953182872280520828676300361091734508632133033647289584176588755345227938480297724485711815574893561311524926772006362198369980664159549388683836411891430443767715498026544959061738265591178545999378510861446014967645550103653971251138583505085112442517772923814396233043724036032603181442991365750246012787514117944901305803452199992701148071712847770301254994886841867572975189214295652512486943983729047410363121899124217339550688778643130750024823361832738729697376598820053895902935486054979802320400472236873557411858132734337978931582039412878989728973298812553514507641535360519462112217000676321611195841029252568536561813138784086477147099724553013170761712163186600291464501378587854802096244703771373587720086738054108140042311418525803293267396324596914044834665722042880679280616029884043400536534009706581694636096660911110968789751801325224478246957913251892122653056085866541115373584912790254654369020869419871125588453729063224423222287139122012248769976837147645598526739225904997885514250047585260297929306159913444898341973583316070107516452301310796620382579278533125161760789984630103493496981494261055367836366022561213767081421091373531780682420175737470287189310207606953355721704357535177461573524838432101571399813798596607129664438314791296359275429627129436142685922138993054980645399144588692472767598544271527788443836760149912897358259961869729756588978741082189422337344547375227693199222635973520722998387368484349176841191020246627479579564349615012657433845758638834735832242535328142047826934473129971189346354502994681747128179298167439644524956655532311649920677163664580318205849626132234652606175413532444702007661807418914040158148560001030119994109595492321434406067634769713089513389171050503856336503545166431774489640061738861761193622676890576955693918707703942304940038440622614449572516631017080642923345170422426679607075404028551182398361531383751432493056398381877995594942545196756559181968690885283434886050828529642437578712929439366177362830136595872723080969468398938676366226456791132977469812675226595621009318322081754694778878755356188335083870248295346078597023609865656376722755704495258739871812593441903785275571333409842450127258596692434317689018966145404453679047136294238156127656824247864736176671770647002431119711090007474065945650315375044177982192306323700872039212085499569681061379189029961178936752146022386905665481382858280449537530160921422195940638787074787991194920898374091788534417523064715030278397979864517336625329511775105559014160459873338186887977858817291976604516353353556047648420520888811722831990044504284486852338334530105533929637308039738230604714104525470094899407601215247602819963846343554852932377161410869591950786873276075400085220065031871239272857835807010762542769655355964789450166013816295177908531139811092831583216931563867459747449584385282701658246192092219529134323496779345585613140207765996142546463288677356891785576835169608392864188830094883324700447958316931533832382377876344426323456301679513671047510469669001217777128065522453689371871451567394733440447280450959433090683667110655953338602938000999949010642769859623260401863733572846679531229683156358145420890540651226419162015504500430562136991850941034609601030543816694795964585804425194905110733387679946734471718615647723811737035654917628707589456035519195603962301157866323750234725054461073979402475184415558178087962822231972692984516683306919505079993357259165675557294585962182052650473353712351623662770479333289322136141858785972771685682725303734836891911847197133753088446777943274857148827821608844765700041403499921376794209627560883081509438030705666022764678117533361028187800710219794428777313146387857817205661409023041499923248268982477222109852189758140879763486146763606368674611966620347304608917277240045953051376938375381543486981101990651706961774052218247422657652138152740612699012706880875386408669901461740890540981877671880076124151967064152117653084325544261017536348281196837493395825742541244634247233586360777980960199745187758845459645895956779558869098404768259253477849930457883128541747079059795909431627722327844578918694214929451540174214623240300841907975296782445969183509474202123617940309048634960534054931299919496087957952586977170236680033862505764938088740994009589948109397983231108838769236490221499111120870639202892490698435333152727991330986335454324971441378059132240814960156485679843966464780280409057580889190254236606774500413415794312112501275232250148067232979652230488493751166084976116412777395311302041566848265531411348993243747890268935173904043294851610659785832253168204202834993641595980197343889883020994152152288611175126686173051956249367180053845637855129171848417841594797435580617856680758491080185805695567990185198397660693358224779136504562705766735170961550493338390452612404395517449136885115987454340932040102218982707539212403241042424451570052968378815749468441508011138612561164102477190903050040240662278945607061512108266146098662040425010583978098192019726759010749924884966139441184159734610382401178556739080566483321039073867083298691078093495828888707110651559651222542929154212923108071159723275797510859911398076844732639426419452063138217862260999160086752446265457028969067192282283045169111363652774517975842147102219099906257373383472726498678244401048998507631630668050267115944636293525120269424810854530602810627264236538250773340575475701704367039596467715959261029438313074897245505729085688496091346323165819468660587092144653716755655531962091865952628448253731353698162517351930115341581171353292035873164168839107994000677266031617527582917398395852606454113318985505747847121053505795649095931672167565624818782002769963734155880000867852567422461511406015760115910256449002264980039498403358091309140197877843650167960167465370287466062584346329708303725980494653589318912163976013193079476972058034710553111117215859219066231028099212084069283091906017370764654655683413207556315315006453462321007133584907633048328153458698497332599801187479664273140279381289961720524540674695271948079930396730194274036466594154400092799908634806622334906695224044652158992864203435098858422692019340575496840904812955522654754650713532842543496616084954788090727649930252702815067862810825243222979985391759845188868387004477101866772159439708514664612871148749531862180941719676843144666435175837688436786081446319641912566574047718699160915550910878919431253671945651261878486910876729910565595155159739659034383628124629118117760949411880105946336671039049777312004243578115790429823045072038322781246413671297959415082918378213212876890545963586369344879749784841123274921331663162812456388238288715648447883142417650147980187858215768793063001153788998014623690135803753306246148576074932567807682651045738059018831237617271889933790487113395588485234240255002352200613574914318259142479829367775490496399350755839668967578364316618369307625603528602940662803255416535431518013714821941772672244005268401996533334184004345525296592918502940131600651124395297874364222806977720437363717873457948420238745151249157913139411148608416429347958793681868609689684640858334131017858142710955416293375915178392341303110543328703526599993904966822112768158316511246866451167351378214345336650598328347443536290312393672084593164394941881138607974670134709640378534907149089842317891739783650654751982883367395714360000003439863363212091718954899055748693397700245632475954504411422582410783866837655467400137324322809113692670682805397549111166171102397437749479335174036135005397581475520834285772800986189401984375446435081498218360112577632447389452051636938585136484259964518361856989088721789764694721246807900330925083496645841656554261294195108847197209106605105540933731954888406444080280579549008076040034154662137669606444293774985897353625591959618552448187940317374508256072895120945456562159540405425814886929842786582357673195799285293120866275922366115137445767916063621675267440451221051052090834707443986137829082352772895849625656881972792768694795806100573787084121444815034797422312103295359297822377134077549545477791813823542607184617108389097825964406170543546968567030745411634244134486308676327949177682923093183221341455482591367202823284396549001805653203960795517074496039006696990334199278212696767771835209083959545341866777944872740383733381985235884202840150981579594685874537989503257362809837592216229258598599123843993575573285028613155970362934249814178056461615863415338635077223269996508860870999964899373049307170967888740149746147542880387421250689212155876692242387434701120990859082164073576380817386959755176083877600277517253037133445654852635661720197563001580049790223419586738061442401502436288957503206533690825756785507020555105572381878574650371086308158185862815883054564662297694803970618265491385181326737485227188267917919091354407852685476254126683398240534022469989966652573155637645862251862823092085424412805997628505488913098331761884983352975136073772030571342739638126588567405013841074788943393996603591853934198416322617654857376671943132840050626295140357877264680649549355746326408186979718630218760025813995719923601345374229758918285167511358171472625828596940798518571870075823122317068134867930884899275181661399609753105295773584618525865211893339375771859916335112163441037910451845019023066893064178977808158101360449495409665363660370075881004450265734935127707426742578608784898185628869980851665713320835842613381142623855420315774246613108873106318111989880289722849790551075148403702290580483052731884959994156606537314021296702220821915862905952604040620011815269664910068587592655660567562963361434230232810747488395040380984981860056164646099819257616235478710913832967563761506732550860683433720438748186791668975746563456020002562889601191100980453350423842063824039434163502977688802779835087481178298349417211674919425601608685332435385951152061809031241698182079314615062073826097180458265687043623935757495737332781578904386011378078508110273049446611821957450170106059384336519458628360682108585130499820420578458577175933849015564447305834515291412561679970569657426139901681932056241927977282026714297258700193234337873153939403115411184101414292741703537542003698760608765500109345299007034032401334806388514095769557147190364152027721127070187421548123931953220997506553022646844227700020589045922742423904937051507367764629844971682121994198274794049092601715727439368569721862936007387077810797440975556627807371228030350048829843919546433753355787895064018998685060281902452191177018634505171087023903398550540704454189088472042376499749035038518949505897971286631644699407490959473411581934618336692169573605081585080837952036335619947691937965065016808710250735070825260046821242820434367245824478859256555487861614478717581068572356895150707602217433511627331709472765932413249132702425519391509083601346239612335001086614623850633127072987745618984384288764099836164964775714638573247333226653894523588365972955159905187411779288608760239306160016168434070611663449248395156319152882728822831375458678269830696691220130954815935450754923554167766876455212545681242936427474153815692219503331560151614492247512488957534835926226263545406704767033866410025277276800886383266629488582740369655329362236090572479794734434077704284318507901973469071141230364111729224929307731939309795452877412451183953480382210373644697046967493042810911797232448615413264031578430955396671061468083815548947146733652483679138566431084747848676243012018489329109615281108087617422779131629345494425395422727309645057976122885347393189600810965202090151104579377602529543130188938184010247010134929317443562883578609861545691161669857388024973756940558138630581099823372565164920155443216861690537054630176154809626620800633059320775897175589925862195462096455464624399535391743228225433267174308492508396461328929584567927365409119947616225155964704061297047759818551878441419948614013153859322060745185909608884280218943358691959604936409651570327527570641500776261323783648149005245481413195989296398441371781402764122087644989688629798910870164270169014007825748311598976330612951195680427485317886333041169767175063822135213839779138443325644288490872919067009802496281560626258636942322658490628628035057282983101266919109637258378149363774960594515216932644945188292639525772348420077356021656909077097264985642831778694777804964343991762549216500608626285329471055602670413384500507827390640287529864161287496473708235188892189612641279553536442286955430551308700009878557534223100547153412810957024870812654319123261956462149376527526356402127388765103883255007364899937167183280028398832319373301564123277185395654932422977953016534830128490677845037490891749347389015649588574802194996722621185874361039774946338633057887487405540005440439344888192044102134790034598411927024921557026873700970995205391930979319495883265922171508324621942300185974396706491149559411733728199869021311629886680267446443489233020607003821262841723679627307191405008084085703978151998148822390059948911946474438682533745889962375133378280532928272016815977970066488394482446332210928320504045983008943565954267256879714918703447338237767914829203283196838105907715727191903042365315650957464549643425328069510396558733549803850995143463506175361480050195045201350200180281506933241918267855737764414097080945745624854867704904368368717590918057269794010465019484853146726642978667687697789291431128505043098192949736165944259471754765135205245072597538577958372797702972231435199958499522344049394502115428867244188717409524554771867484911475031801773304689909317974472957035192387686405544278134169807249382219749124257510162187439772902147704638010731470653154201300583810458905006764557332998149945854655105526374914354195867992595981412218735238407957416123372264063860431988936249867649693592569592128495906254446474331759999685163660305216426770428154681777589339252115538590526823311608302751194384823861552852465010329467297198112105314125898165100120742688143577590825227466863206188376830450921784582526239594189673003640808624233657620979111641766331328852352062487922978959456450333733139422384778582717195412347860434376165241568717943562570215636666680088531006728947033079540804583324192188488870712275670333173939262509073556164513677064199539111948881240659821685787131385056850623094155206877987539740658484250135205615103489821873770245063583314243624807432542464195984647411575625441010389671576677263196442524931941806472423789334668561083789808830313571333157729435664956078125304917594015895146954965223118559669048559467607968190167266634650186182955669893965019614544401768162810604465068448139561667220729261210164692339016793399632833013163850830967942792934551268435760356901970523138364640961311774904600772840862214747547653221505518116489887879087780918009050706040061220010051271575991225725282523378026809030528461581739558198122397010092017202251606352922464781615533532275453264543087093320924631855976580561717446840450048285353396546862678852330044967795580761661801833668792312510460809773895565488962815089519622093675058841609752282328250433712970186608193748968699961301486924694482420723632912367052542145464162968910442981633373266871675946715392611950649224725627254543274193495995569590243279097174392258098103601486364409101491734183079646345064833303404765711827040276868271418084574998493392039317445402616663674646668754385093967129918067471909885312710726724428584870694307099756567949198418996425748884764622030325637751112534060087936904565779272035205921345924272965206683338510673615276261016026647772485083344719891986802656197236420847504962661607797092906844757798251795569758235084371746103310387911789239441630112634077535773520558040066982523191225570519133631407211349723226549151062961739050617857127509403623146700931176133132018631158730886798239298009805089491510788371194099750375473674305745187265414016446924576792185753680363289139664155342066705623272936001177781498886100830877849571709880858667023104043242526785955562077310543072298032125941107957349146684680220501816192150766649106862033378713826058987655210423668198670177861672671972374156917880001690656659046965316154923604061891820982414006103779407166342002735828911994182647812782659666207030384795881442790246669264032799404016800137293477301530941805070587421153284642203006550763966756168318897005152026656649929417382840327305940740147117478464839241225676523593418554066440983706083636457657081801664285044258224551650808864421212113914352453935225522162483791737330329812349528984098613273709957407786789349311975204237925022851375880436791854547836416773151821457226504640800104202100410766027807729152555503218182387221708112766208665317651926458452495269685376314437998340336947124447247796973890514941120010934140073794061859447165516612674930799374705772930521750426383798367668159183589049652163726492960837147204067428996276720315410211504333742057182854090136325721437592054640471894328548696883599785122262130812989581571391597464534806099601555877223193450760315411663112963843719400333736013305526352571490454327925190794007111504785378036370897340146753465517470747096935814912797188187854376797751675927822300312945518595042883902735494672667647506072643698761394806879080593531793001711000214417701504495496412454361656210150919997862972495905809191825255486358703529320142005857057855419217730505342687533799076038746689684283402648733290888881745453047194740939258407362058242849349024756883352446212456101562729065130618520732925434179252299417447855189995098959999877410951464170076989305620163502192692653166599093238118295411937545448509428621839424186218067457128099385258842631930670182098008050900019819621758458932516877698594110522845465835679362969619219080897536813210484518784516230623911878024604050824909336069998094776253792973597037759066145994638578378211017122446355845171941670344732162722443265914858595797823752976323442911242311368603724514438765801271594060878788638511089680883165505046309006148832545452819908256238805872042843941834687865142541377686054291079721004271658 diff --git a/src/compress/testdata/pi.txt b/src/compress/testdata/pi.txt new file mode 100644 index 0000000000000000000000000000000000000000..ca99bbc2a2553d83b4a34d062294b9043bbbb46b --- /dev/null +++ b/src/compress/testdata/pi.txt @@ -0,0 +1 @@ +3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632788659361533818279682303019520353018529689957736225994138912497217752834791315155748572424541506959508295331168617278558890750983817546374649393192550604009277016711390098488240128583616035637076601047101819429555961989467678374494482553797747268471040475346462080466842590694912933136770289891521047521620569660240580381501935112533824300355876402474964732639141992726042699227967823547816360093417216412199245863150302861829745557067498385054945885869269956909272107975093029553211653449872027559602364806654991198818347977535663698074265425278625518184175746728909777727938000816470600161452491921732172147723501414419735685481613611573525521334757418494684385233239073941433345477624168625189835694855620992192221842725502542568876717904946016534668049886272327917860857843838279679766814541009538837863609506800642251252051173929848960841284886269456042419652850222106611863067442786220391949450471237137869609563643719172874677646575739624138908658326459958133904780275900994657640789512694683983525957098258226205224894077267194782684826014769909026401363944374553050682034962524517493996514314298091906592509372216964615157098583874105978859597729754989301617539284681382686838689427741559918559252459539594310499725246808459872736446958486538367362226260991246080512438843904512441365497627807977156914359977001296160894416948685558484063534220722258284886481584560285060168427394522674676788952521385225499546667278239864565961163548862305774564980355936345681743241125150760694794510965960940252288797108931456691368672287489405601015033086179286809208747609178249385890097149096759852613655497818931297848216829989487226588048575640142704775551323796414515237462343645428584447952658678210511413547357395231134271661021359695362314429524849371871101457654035902799344037420073105785390621983874478084784896833214457138687519435064302184531910484810053706146806749192781911979399520614196634287544406437451237181921799983910159195618146751426912397489409071864942319615679452080951465502252316038819301420937621378559566389377870830390697920773467221825625996615014215030680384477345492026054146659252014974428507325186660021324340881907104863317346496514539057962685610055081066587969981635747363840525714591028970641401109712062804390397595156771577004203378699360072305587631763594218731251471205329281918261861258673215791984148488291644706095752706957220917567116722910981690915280173506712748583222871835209353965725121083579151369882091444210067510334671103141267111369908658516398315019701651511685171437657618351556508849099898599823873455283316355076479185358932261854896321329330898570642046752590709154814165498594616371802709819943099244889575712828905923233260972997120844335732654893823911932597463667305836041428138830320382490375898524374417029132765618093773444030707469211201913020330380197621101100449293215160842444859637669838952286847831235526582131449576857262433441893039686426243410773226978028073189154411010446823252716201052652272111660396665573092547110557853763466820653109896526918620564769312570586356620185581007293606598764861179104533488503461136576867532494416680396265797877185560845529654126654085306143444318586769751456614068007002378776591344017127494704205622305389945613140711270004078547332699390814546646458807972708266830634328587856983052358089330657574067954571637752542021149557615814002501262285941302164715509792592309907965473761255176567513575178296664547791745011299614890304639947132962107340437518957359614589019389713111790429782856475032031986915140287080859904801094121472213179476477726224142548545403321571853061422881375850430633217518297986622371721591607716692547487389866549494501146540628433663937900397692656721463853067360965712091807638327166416274888800786925602902284721040317211860820419000422966171196377921337575114959501566049631862947265473642523081770367515906735023507283540567040386743513622224771589150495309844489333096340878076932599397805419341447377441842631298608099888687413260472156951623965864573021631598193195167353812974167729478672422924654366800980676928238280689964004824354037014163149658979409243237896907069779422362508221688957383798623001593776471651228935786015881617557829735233446042815126272037343146531977774160319906655418763979293344195215413418994854447345673831624993419131814809277771038638773431772075456545322077709212019051660962804909263601975988281613323166636528619326686336062735676303544776280350450777235547105859548702790814356240145171806246436267945612753181340783303362542327839449753824372058353114771199260638133467768796959703098339130771098704085913374641442822772634659470474587847787201927715280731767907707157213444730605700733492436931138350493163128404251219256517980694113528013147013047816437885185290928545201165839341965621349143415956258658655705526904965209858033850722426482939728584783163057777560688876446248246857926039535277348030480290058760758251047470916439613626760449256274204208320856611906254543372131535958450687724602901618766795240616342522577195429162991930645537799140373404328752628889639958794757291746426357455254079091451357111369410911939325191076020825202618798531887705842972591677813149699009019211697173727847684726860849003377024242916513005005168323364350389517029893922334517220138128069650117844087451960121228599371623130171144484640903890644954440061986907548516026327505298349187407866808818338510228334508504860825039302133219715518430635455007668282949304137765527939751754613953984683393638304746119966538581538420568533862186725233402830871123282789212507712629463229563989898935821167456270102183564622013496715188190973038119800497340723961036854066431939509790190699639552453005450580685501956730229219139339185680344903982059551002263535361920419947455385938102343955449597783779023742161727111723643435439478221818528624085140066604433258885698670543154706965747458550332323342107301545940516553790686627333799585115625784322988273723198987571415957811196358330059408730681216028764962867446047746491599505497374256269010490377819868359381465741268049256487985561453723478673303904688383436346553794986419270563872931748723320837601123029911367938627089438799362016295154133714248928307220126901475466847653576164773794675200490757155527819653621323926406160136358155907422020203187277605277219005561484255518792530343513984425322341576233610642506390497500865627109535919465897514131034822769306247435363256916078154781811528436679570611086153315044521274739245449454236828860613408414863776700961207151249140430272538607648236341433462351897576645216413767969031495019108575984423919862916421939949072362346468441173940326591840443780513338945257423995082965912285085558215725031071257012668302402929525220118726767562204154205161841634847565169998116141010029960783869092916030288400269104140792886215078424516709087000699282120660418371806535567252532567532861291042487761825829765157959847035622262934860034158722980534989650226291748788202734209222245339856264766914905562842503912757710284027998066365825488926488025456610172967026640765590429099456815065265305371829412703369313785178609040708667114965583434347693385781711386455873678123014587687126603489139095620099393610310291616152881384379099042317473363948045759314931405297634757481193567091101377517210080315590248530906692037671922033229094334676851422144773793937517034436619910403375111735471918550464490263655128162288244625759163330391072253837421821408835086573917715096828874782656995995744906617583441375223970968340800535598491754173818839994469748676265516582765848358845314277568790029095170283529716344562129640435231176006651012412006597558512761785838292041974844236080071930457618932349229279650198751872127267507981255470958904556357921221033346697499235630254947802490114195212382815309114079073860251522742995818072471625916685451333123948049470791191532673430282441860414263639548000448002670496248201792896476697583183271314251702969234889627668440323260927524960357996469256504936818360900323809293459588970695365349406034021665443755890045632882250545255640564482465151875471196218443965825337543885690941130315095261793780029741207665147939425902989695946995565761218656196733786236256125216320862869222103274889218654364802296780705765615144632046927906821207388377814233562823608963208068222468012248261177185896381409183903673672220888321513755600372798394004152970028783076670944474560134556417254370906979396122571429894671543578468788614445812314593571984922528471605049221242470141214780573455105008019086996033027634787081081754501193071412233908663938339529425786905076431006383519834389341596131854347546495569781038293097164651438407007073604112373599843452251610507027056235266012764848308407611830130527932054274628654036036745328651057065874882256981579367897669742205750596834408697350201410206723585020072452256326513410559240190274216248439140359989535394590944070469120914093870012645600162374288021092764579310657922955249887275846101264836999892256959688159205600101655256375678566722796619885782794848855834397518744545512965634434803966420557982936804352202770984294232533022576341807039476994159791594530069752148293366555661567873640053666564165473217043903521329543529169414599041608753201868379370234888689479151071637852902345292440773659495630510074210871426134974595615138498713757047101787957310422969066670214498637464595280824369445789772330048764765241339075920434019634039114732023380715095222010682563427471646024335440051521266932493419673977041595683753555166730273900749729736354964533288869844061196496162773449518273695588220757355176651589855190986665393549481068873206859907540792342402300925900701731960362254756478940647548346647760411463233905651343306844953979070903023460461470961696886885014083470405460742958699138296682468185710318879065287036650832431974404771855678934823089431068287027228097362480939962706074726455399253994428081137369433887294063079261595995462624629707062594845569034711972996409089418059534393251236235508134949004364278527138315912568989295196427287573946914272534366941532361004537304881985517065941217352462589548730167600298865925786628561249665523533829428785425340483083307016537228563559152534784459818313411290019992059813522051173365856407826484942764411376393866924803118364453698589175442647399882284621844900877769776312795722672655562596282542765318300134070922334365779160128093179401718598599933849235495640057099558561134980252499066984233017350358044081168552653117099570899427328709258487894436460050410892266917835258707859512983441729535195378855345737426085902908176515578039059464087350612322611200937310804854852635722825768203416050484662775045003126200800799804925485346941469775164932709504934639382432227188515974054702148289711177792376122578873477188196825462981268685817050740272550263329044976277894423621674119186269439650671515779586756482399391760426017633870454990176143641204692182370764887834196896861181558158736062938603810171215855272668300823834046564758804051380801633638874216371406435495561868964112282140753302655100424104896783528588290243670904887118190909494533144218287661810310073547705498159680772009474696134360928614849417850171807793068108546900094458995279424398139213505586422196483491512639012803832001097738680662877923971801461343244572640097374257007359210031541508936793008169980536520276007277496745840028362405346037263416554259027601834840306811381855105979705664007509426087885735796037324514146786703688098806097164258497595138069309449401515422221943291302173912538355915031003330325111749156969174502714943315155885403922164097229101129035521815762823283182342548326111912800928252561902052630163911477247331485739107775874425387611746578671169414776421441111263583553871361011023267987756410246824032264834641766369806637857681349204530224081972785647198396308781543221166912246415911776732253264335686146186545222681268872684459684424161078540167681420808850280054143613146230821025941737562389942075713627516745731891894562835257044133543758575342698699472547031656613991999682628247270641336222178923903176085428943733935618891651250424404008952719837873864805847268954624388234375178852014395600571048119498842390606136957342315590796703461491434478863604103182350736502778590897578272731305048893989009923913503373250855982655867089242612429473670193907727130706869170926462548423240748550366080136046689511840093668609546325002145852930950000907151058236267293264537382104938724996699339424685516483261134146110680267446637334375340764294026682973865220935701626384648528514903629320199199688285171839536691345222444708045923966028171565515656661113598231122506289058549145097157553900243931535190902107119457300243880176615035270862602537881797519478061013715004489917210022201335013106016391541589578037117792775225978742891917915522417189585361680594741234193398420218745649256443462392531953135103311476394911995072858430658361935369329699289837914941939406085724863968836903265564364216644257607914710869984315733749648835292769328220762947282381537409961545598798259891093717126218283025848112389011968221429457667580718653806506487026133892822994972574530332838963818439447707794022843598834100358385423897354243956475556840952248445541392394100016207693636846776413017819659379971557468541946334893748439129742391433659360410035234377706588867781139498616478747140793263858738624732889645643598774667638479466504074111825658378878454858148962961273998413442726086061872455452360643153710112746809778704464094758280348769758948328241239292960582948619196670918958089833201210318430340128495116203534280144127617285830243559830032042024512072872535581195840149180969253395075778400067465526031446167050827682772223534191102634163157147406123850425845988419907611287258059113935689601431668283176323567325417073420817332230462987992804908514094790368878687894930546955703072619009502076433493359106024545086453628935456862958531315337183868265617862273637169757741830239860065914816164049449650117321313895747062088474802365371031150898427992754426853277974311395143574172219759799359685252285745263796289612691572357986620573408375766873884266405990993505000813375432454635967504844235284874701443545419576258473564216198134073468541117668831186544893776979566517279662326714810338643913751865946730024434500544995399742372328712494834706044063471606325830649829795510109541836235030309453097335834462839476304775645015008507578949548931393944899216125525597701436858943585877526379625597081677643800125436502371412783467926101995585224717220177723700417808419423948725406801556035998390548985723546745642390585850216719031395262944554391316631345308939062046784387785054239390524731362012947691874975191011472315289326772533918146607300089027768963114810902209724520759167297007850580717186381054967973100167870850694207092232908070383263453452038027860990556900134137182368370991949516489600755049341267876436746384902063964019766685592335654639138363185745698147196210841080961884605456039038455343729141446513474940784884423772175154334260306698831768331001133108690421939031080143784334151370924353013677631084913516156422698475074303297167469640666531527035325467112667522460551199581831963763707617991919203579582007595605302346267757943936307463056901080114942714100939136913810725813781357894005599500183542511841721360557275221035268037357265279224173736057511278872181908449006178013889710770822931002797665935838758909395688148560263224393726562472776037890814458837855019702843779362407825052704875816470324581290878395232453237896029841669225489649715606981192186584926770403956481278102179913217416305810554598801300484562997651121241536374515005635070127815926714241342103301566165356024733807843028655257222753049998837015348793008062601809623815161366903341111386538510919367393835229345888322550887064507539473952043968079067086806445096986548801682874343786126453815834280753061845485903798217994599681154419742536344399602902510015888272164745006820704193761584547123183460072629339550548239557137256840232268213012476794522644820910235647752723082081063518899152692889108455571126603965034397896278250016110153235160519655904211844949907789992007329476905868577878720982901352956613978884860509786085957017731298155314951681467176959760994210036183559138777817698458758104466283998806006162298486169353373865787735983361613384133853684211978938900185295691967804554482858483701170967212535338758621582310133103877668272115726949518179589754693992642197915523385766231676275475703546994148929041301863861194391962838870543677743224276809132365449485366768000001065262485473055861598999140170769838548318875014293890899506854530765116803337322265175662207526951791442252808165171667766727930354851542040238174608923283917032754257508676551178593950027933895920576682789677644531840404185540104351348389531201326378369283580827193783126549617459970567450718332065034556644034490453627560011250184335607361222765949278393706478426456763388188075656121689605041611390390639601620221536849410926053876887148379895599991120991646464411918568277004574243434021672276445589330127781586869525069499364610175685060167145354315814801054588605645501332037586454858403240298717093480910556211671546848477803944756979804263180991756422809873998766973237695737015808068229045992123661689025962730430679316531149401764737693873514093361833216142802149763399189835484875625298752423873077559555955465196394401821840998412489826236737714672260616336432964063357281070788758164043814850188411431885988276944901193212968271588841338694346828590066640806314077757725705630729400492940302420498416565479736705485580445865720227637840466823379852827105784319753541795011347273625774080213476826045022851579795797647467022840999561601569108903845824502679265942055503958792298185264800706837650418365620945554346135134152570065974881916341359556719649654032187271602648593049039787489589066127250794828276938953521753621850796297785146188432719223223810158744450528665238022532843891375273845892384422535472653098171578447834215822327020690287232330053862163479885094695472004795231120150432932266282727632177908840087861480221475376578105819702226309717495072127248479478169572961423658595782090830733233560348465318730293026659645013718375428897557971449924654038681799213893469244741985097334626793321072686870768062639919361965044099542167627840914669856925715074315740793805323925239477557441591845821562518192155233709607483329234921034514626437449805596103307994145347784574699992128599999399612281615219314888769388022281083001986016549416542616968586788372609587745676182507275992950893180521872924610867639958916145855058397274209809097817293239301067663868240401113040247007350857828724627134946368531815469690466968693925472519413992914652423857762550047485295476814795467007050347999588867695016124972282040303995463278830695976249361510102436555352230690612949388599015734661023712235478911292547696176005047974928060721268039226911027772261025441492215765045081206771735712027180242968106203776578837166909109418074487814049075517820385653909910477594141321543284406250301802757169650820964273484146957263978842560084531214065935809041271135920041975985136254796160632288736181367373244506079244117639975974619383584574915988097667447093006546342423460634237474666080431701260052055928493695941434081468529815053947178900451835755154125223590590687264878635752541911288877371766374860276606349603536794702692322971868327717393236192007774522126247518698334951510198642698878471719396649769070825217423365662725928440620430214113719922785269984698847702323823840055655517889087661360130477098438611687052310553149162517283732728676007248172987637569816335415074608838663640693470437206688651275688266149730788657015685016918647488541679154596507234287730699853713904300266530783987763850323818215535597323530686043010675760838908627049841888595138091030423595782495143988590113185835840667472370297149785084145853085781339156270760356390763947311455495832266945702494139831634332378975955680856836297253867913275055542524491943589128405045226953812179131914513500993846311774017971512283785460116035955402864405902496466930707769055481028850208085800878115773817191741776017330738554758006056014337743299012728677253043182519757916792969965041460706645712588834697979642931622965520168797300035646304579308840327480771811555330909887025505207680463034608658165394876951960044084820659673794731680864156456505300498816164905788311543454850526600698230931577765003780704661264706021457505793270962047825615247145918965223608396645624105195510522357239739512881816405978591427914816542632892004281609136937773722299983327082082969955737727375667615527113922588055201898876201141680054687365580633471603734291703907986396522961312801782679717289822936070288069087768660593252746378405397691848082041021944719713869256084162451123980620113184541244782050110798760717155683154078865439041210873032402010685341947230476666721749869868547076781205124736792479193150856444775379853799732234456122785843296846647513336573692387201464723679427870042503255589926884349592876124007558756946413705625140011797133166207153715436006876477318675587148783989081074295309410605969443158477539700943988394914432353668539209946879645066533985738887866147629443414010498889931600512076781035886116602029611936396821349607501116498327856353161451684576956871090029997698412632665023477167286573785790857466460772283415403114415294188047825438761770790430001566986776795760909966936075594965152736349811896413043311662774712338817406037317439705406703109676765748695358789670031925866259410510533584384656023391796749267844763708474978333655579007384191473198862713525954625181604342253729962863267496824058060296421146386436864224724887283434170441573482481833301640566959668866769563491416328426414974533349999480002669987588815935073578151958899005395120853510357261373640343675347141048360175464883004078464167452167371904831096767113443494819262681110739948250607394950735031690197318521195526356325843390998224986240670310768318446607291248747540316179699411397387765899868554170318847788675929026070043212666179192235209382278788809886335991160819235355570464634911320859189796132791319756490976000139962344455350143464268604644958624769094347048293294140411146540923988344435159133201077394411184074107684981066347241048239358274019449356651610884631256785297769734684303061462418035852933159734583038455410337010916767763742762102137013548544509263071901147318485749233181672072137279355679528443925481560913728128406333039373562420016045664557414588166052166608738748047243391212955877763906969037078828527753894052460758496231574369171131761347838827194168606625721036851321566478001476752310393578606896111259960281839309548709059073861351914591819510297327875571049729011487171897180046961697770017913919613791417162707018958469214343696762927459109940060084983568425201915593703701011049747339493877885989417433031785348707603221982970579751191440510994235883034546353492349826883624043327267415540301619505680654180939409982020609994140216890900708213307230896621197755306659188141191577836272927461561857103721724710095214236964830864102592887457999322374955191221951903424452307535133806856807354464995127203174487195403976107308060269906258076020292731455252078079914184290638844373499681458273372072663917670201183004648190002413083508846584152148991276106513741539435657211390328574918769094413702090517031487773461652879848235338297260136110984514841823808120540996125274580881099486972216128524897425555516076371675054896173016809613803811914361143992106380050832140987604599309324851025168294467260666138151745712559754953580239983146982203613380828499356705575524712902745397762140493182014658008021566536067765508783804304134310591804606800834591136640834887408005741272586704792258319127415739080914383138456424150940849133918096840251163991936853225557338966953749026620923261318855891580832455571948453875628786128859004106006073746501402627824027346962528217174941582331749239683530136178653673760642166778137739951006589528877427662636841830680190804609849809469763667335662282915132352788806157768278159588669180238940333076441912403412022316368577860357276941541778826435238131905028087018575047046312933353757285386605888904583111450773942935201994321971171642235005644042979892081594307167019857469273848653833436145794634175922573898588001698014757420542995801242958105456510831046297282937584161162532562516572498078492099897990620035936509934721582965174135798491047111660791587436986541222348341887722929446335178653856731962559852026072947674072616767145573649812105677716893484917660771705277187601199908144113058645577910525684304811440261938402322470939249802933550731845890355397133088446174107959162511714864874468611247605428673436709046678468670274091881014249711149657817724279347070216688295610877794405048437528443375108828264771978540006509704033021862556147332117771174413350281608840351781452541964320309576018694649088681545285621346988355444560249556668436602922195124830910605377201980218310103270417838665447181260397190688462370857518080035327047185659499476124248110999288679158969049563947624608424065930948621507690314987020673533848349550836366017848771060809804269247132410009464014373603265645184566792456669551001502298330798496079949882497061723674493612262229617908143114146609412341593593095854079139087208322733549572080757165171876599449856937956238755516175754380917805280294642004472153962807463602113294255916002570735628126387331060058910652457080244749375431841494014821199962764531068006631183823761639663180931444671298615527598201451410275600689297502463040173514891945763607893528555053173314164570504996443890936308438744847839616840518452732884032345202470568516465716477139323775517294795126132398229602394548579754586517458787713318138752959809412174227300352296508089177705068259248822322154938048371454781647213976820963320508305647920482085920475499857320388876391601995240918938945576768749730856955958010659526503036266159750662225084067428898265907510637563569968211510949669744580547288693631020367823250182323708459790111548472087618212477813266330412076216587312970811230758159821248639807212407868878114501655825136178903070860870198975889807456643955157415363193191981070575336633738038272152798849350397480015890519420879711308051233933221903466249917169150948541401871060354603794643379005890957721180804465743962806186717861017156740967662080295766577051291209907944304632892947306159510430902221439371849560634056189342513057268291465783293340524635028929175470872564842600349629611654138230077313327298305001602567240141851520418907011542885799208121984493156999059182011819733500126187728036812481995877070207532406361259313438595542547781961142935163561223496661522614735399674051584998603552953329245752388810136202347624669055816438967863097627365504724348643071218494373485300606387644566272186661701238127715621379746149861328744117714552444708997144522885662942440230184791205478498574521634696448973892062401943518310088283480249249085403077863875165911302873958787098100772718271874529013972836614842142871705531796543076504534324600536361472618180969976933486264077435199928686323835088756683595097265574815431940195576850437248001020413749831872259677387154958399718444907279141965845930083942637020875635398216962055324803212267498911402678528599673405242031091797899905718821949391320753431707980023736590985375520238911643467185582906853711897952626234492483392496342449714656846591248918556629589329909035239233333647435203707701010843880032907598342170185542283861617210417603011645918780539367447472059985023582891833692922337323999480437108419659473162654825748099482509991833006976569367159689364493348864744213500840700660883597235039532340179582557036016936990988671132109798897070517280755855191269930673099250704070245568507786790694766126298082251633136399521170984528092630375922426742575599892892783704744452189363203489415521044597261883800300677617931381399162058062701651024458869247649246891924612125310275731390840470007143561362316992371694848132554200914530410371354532966206392105479824392125172540132314902740585892063217589494345489068463993137570910346332714153162232805522972979538018801628590735729554162788676498274186164218789885741071649069191851162815285486794173638906653885764229158342500673612453849160674137340173572779956341043326883569507814931378007362354180070619180267328551191942676091221035987469241172837493126163395001239599240508454375698507957046222664619000103500490183034153545842833764378111988556318777792537201166718539541835984438305203762819440761594106820716970302285152250573126093046898423433152732131361216582808075212631547730604423774753505952287174402666389148817173086436111389069420279088143119448799417154042103412190847094080254023932942945493878640230512927119097513536000921971105412096683111516328705423028470073120658032626417116165957613272351566662536672718998534199895236884830999302757419916463841427077988708874229277053891227172486322028898425125287217826030500994510824783572905691988555467886079462805371227042466543192145281760741482403827835829719301017888345674167811398954750448339314689630763396657226727043393216745421824557062524797219978668542798977992339579057581890622525473582205236424850783407110144980478726691990186438822932305382318559732869780922253529591017341407334884761005564018242392192695062083183814546983923664613639891012102177095976704908305081854704194664371312299692358895384930136356576186106062228705599423371631021278457446463989738188566746260879482018647487672727222062676465338099801966883680994159075776852639865146253336312450536402610569605513183813174261184420189088853196356986962795036738424313011331753305329802016688817481342988681585577810343231753064784983210629718425184385534427620128234570716988530518326179641178579608888150329602290705614476220915094739035946646916235396809201394578175891088931992112260073928149169481615273842736264298098234063200244024495894456129167049508235812487391799648641133480324757775219708932772262349486015046652681439877051615317026696929704928316285504212898146706195331970269507214378230476875280287354126166391708245925170010714180854800636923259462019002278087409859771921805158532147392653251559035410209284665925299914353791825314545290598415817637058927906909896911164381187809435371521332261443625314490127454772695739393481546916311624928873574718824071503995009446731954316193855485207665738825139639163576723151005556037263394867208207808653734942440115799667507360711159351331959197120948964717553024531364770942094635696982226673775209945168450643623824211853534887989395673187806606107885440005508276570305587448541805778891719207881423351138662929667179643468760077047999537883387870348718021842437342112273940255717690819603092018240188427057046092622564178375265263358324240661253311529423457965569502506810018310900411245379015332966156970522379210325706937051090830789479999004999395322153622748476603613677697978567386584670936679588583788795625946464891376652199588286933801836011932368578558558195556042156250883650203322024513762158204618106705195330653060606501054887167245377942831338871631395596905832083416898476065607118347136218123246227258841990286142087284956879639325464285343075301105285713829643709990356948885285190402956047346131138263878897551788560424998748316382804046848618938189590542039889872650697620201995548412650005394428203930127481638158530396439925470201672759328574366661644110962566337305409219519675148328734808957477775278344221091073111351828046036347198185655572957144747682552857863349342858423118749440003229690697758315903858039353521358860079600342097547392296733310649395601812237812854584317605561733861126734780745850676063048229409653041118306671081893031108871728167519579675347188537229309616143204006381322465841111157758358581135018569047815368938137718472814751998350504781297718599084707621974605887423256995828892535041937958260616211842368768511418316068315867994601652057740529423053601780313357263267054790338401257305912339601880137825421927094767337191987287385248057421248921183470876629667207272325650565129333126059505777727542471241648312832982072361750574673870128209575544305968395555686861188397135522084452852640081252027665557677495969626612604565245684086139238265768583384698499778726706555191854468698469478495734622606294219624557085371272776523098955450193037732166649182578154677292005212667143463209637891852323215018976126034373684067194193037746880999296877582441047878123266253181845960453853543839114496775312864260925211537673258866722604042523491087026958099647595805794663973419064010036361904042033113579336542426303561457009011244800890020801478056603710154122328891465722393145076071670643556827437743965789067972687438473076346451677562103098604092717090951280863090297385044527182892749689212106670081648583395537735919136950153162018908887484210798706899114804669270650940762046502772528650728905328548561433160812693005693785417861096969202538865034577183176686885923681488475276498468821949739729707737187188400414323127636504814531122850990020742409255859252926103021067368154347015252348786351643976235860419194129697690405264832347009911154242601273438022089331096686367898694977994001260164227609260823493041180643829138347354679725399262338791582998486459271734059225620749105308531537182911681637219395188700957788181586850464507699343940987433514431626330317247747486897918209239480833143970840673084079589358108966564775859905563769525232653614424780230826811831037735887089240613031336477371011628214614661679404090518615260360092521947218890918107335871964142144478654899528582343947050079830388538860831035719306002771194558021911942899922722353458707566246926177663178855144350218287026685610665003531050216318206017609217984684936863161293727951873078972637353717150256378733579771808184878458866504335824377004147710414934927438457587107159731559439426412570270965125108115548247939403597681188117282472158250109496096625393395380922195591918188552678062149923172763163218339896938075616855911752998450132067129392404144593862398809381240452191484831646210147389182510109096773869066404158973610476436500068077105656718486281496371118832192445663945814491486165500495676982690308911185687986929470513524816091743243015383684707292898982846022237301452655679898627767968091469798378268764311598832109043715611299766521539635464420869197567370005738764978437686287681792497469438427465256316323005551304174227341646455127812784577772457520386543754282825671412885834544435132562054464241011037955464190581168623059644769587054072141985212106734332410756767575818456990693046047522770167005684543969234041711089888993416350585157887353430815520811772071880379104046983069578685473937656433631979786803671873079693924236321448450354776315670255390065423117920153464977929066241508328858395290542637687668968805033317227800185885069736232403894700471897619347344308437443759925034178807972235859134245813144049847701732361694719765715353197754997162785663119046912609182591249890367654176979903623755286526375733763526969344354400473067198868901968147428767790866979688522501636949856730217523132529265375896415171479559538784278499866456302878831962099830494519874396369070682762657485810439112232618794059941554063270131989895703761105323606298674803779153767511583043208498720920280929752649812569163425000522908872646925284666104665392171482080130502298052637836426959733707053922789153510568883938113249757071331029504430346715989448786847116438328050692507766274500122003526203709466023414648998390252588830148678162196775194583167718762757200505439794412459900771152051546199305098386982542846407255540927403132571632640792934183342147090412542533523248021932277075355546795871638358750181593387174236061551171013123525633485820365146141870049205704372018261733194715700867578539336078622739558185797587258744102542077105475361294047460100094095444959662881486915903899071865980563617137692227290764197755177720104276496949611056220592502420217704269622154958726453989227697660310524980855759471631075870133208861463266412591148633881220284440694169488261529577625325019870359870674380469821942056381255833436421949232275937221289056420943082352544084110864545369404969271494003319782861318186188811118408257865928757426384450059944229568586460481033015388911499486935436030221810943466764000022362550573631294626296096198760564259963946138692330837196265954739234624134597795748524647837980795693198650815977675350553918991151335252298736112779182748542008689539658359421963331502869561192012298889887006079992795411188269023078913107603617634779489432032102773359416908650071932804017163840644987871753756781185321328408216571107549528294974936214608215583205687232185574065161096274874375098092230211609982633033915469494644491004515280925089745074896760324090768983652940657920198315265410658136823791984090645712468948470209357761193139980246813405200394781949866202624008902150166163813538381515037735022966074627952910384068685569070157516624192987244482719429331004854824454580718897633003232525821581280327467962002814762431828622171054352898348208273451680186131719593324711074662228508710666117703465352839577625997744672185715816126411143271794347885990892808486694914139097716736900277758502686646540565950394867841110790116104008572744562938425494167594605487117235946429105850909950214958793112196135908315882620682332156153086833730838173279328196983875087083483880463884784418840031847126974543709373298362402875197920802321878744882872843727378017827008058782410749357514889978911739746129320351081432703251409030487462262942344327571260086642508333187688650756429271605525289544921537651751492196367181049435317858383453865255656640657251363575064353236508936790431702597878177190314867963840828810209461490079715137717099061954969640070867667102330048672631475510537231757114322317411411680622864206388906210192355223546711662137499693269321737043105987225039456574924616978260970253359475020913836673772894438696400028110344026084712899000746807764844088711341352503367877316797709372778682166117865344231732264637847697875144332095340001650692130546476890985050203015044880834261845208730530973189492916425322933612431514306578264070283898409841602950309241897120971601649265613413433422298827909921786042679812457285345801338260995877178113102167340256562744007296834066198480676615805021691833723680399027931606420436812079900316264449146190219458229690992122788553948783538305646864881655562294315673128274390826450611628942803501661336697824051770155219626522725455850738640585299830379180350432876703809252167907571204061237596327685674845079151147313440001832570344920909712435809447900462494313455028900680648704293534037436032625820535790118395649089354345101342969617545249573960621490288728932792520696535386396443225388327522499605986974759882329916263545973324445163755334377492928990581175786355555626937426910947117002165411718219750519831787137106051063795558588905568852887989084750915764639074693619881507814685262133252473837651192990156109189777922008705793396463827490680698769168197492365624226087154176100430608904377976678519661891404144925270480881971498801542057787006521594009289777601330756847966992955433656139847738060394368895887646054983871478968482805384701730871117761159663505039979343869339119789887109156541709133082607647406305711411098839388095481437828474528838368079418884342666222070438722887413947801017721392281911992365405516395893474263953824829609036900288359327745855060801317988407162446563997948275783650195514221551339281978226984278638391679715091262410548725700924070045488485692950448110738087996547481568913935380943474556972128919827177020766613602489581468119133614121258783895577357194986317210844398901423948496659251731388171602663261931065366535041473070804414939169363262373767777095850313255990095762731957308648042467701212327020533742667053142448208168130306397378736642483672539837487690980602182785786216512738563513290148903509883270617258932575363993979055729175160097615459044771692265806315111028038436017374742152476085152099016158582312571590733421736576267142390478279587281505095633092802668458937649649770232973641319060982740633531089792464242134583740901169391964250459128813403498810635400887596820054408364386516617880557608956896727531538081942077332597917278437625661184319891025007491829086475149794003160703845549465385946027452447466812314687943441610993338908992638411847425257044572517459325738989565185716575961481266020310797628254165590506042479114016957900338356574869252800743025623419498286467914476322774005529460903940177536335655471931000175430047504719144899841040015867946179241610016454716551337074073950260442769538553834397550548871099785205401175169747581344926079433689543783221172450687344231989878844128542064742809735625807066983106979935260693392135685881391214807354728463227784908087002467776303605551232386656295178853719673034634701222939581606792509153217489030840886516061119011498443412350124646928028805996134283511884715449771278473361766285062169778717743824362565711779450064477718370221999106695021656757644044997940765037999954845002710665987813603802314126836905783190460792765297277694043613023051787080546511542469395265127101052927070306673024447125973939950514628404767431363739978259184541176413327906460636584152927019030276017339474866960348694976541752429306040727005059039503148522921392575594845078867977925253931765156416197168443524369794447355964260633391055126826061595726217036698506473281266724521989060549880280782881429796336696744124805982192146339565745722102298677599746738126069367069134081559412016115960190237753525556300606247983261249881288192937343476862689219239777833910733106588256813777172328315329082525092733047850724977139448333892552081175608452966590553940965568541706001179857293813998258319293679100391844099286575605993598910002969864460974714718470101531283762631146774209145574041815908800064943237855839308530828305476076799524357391631221886057549673832243195650655460852881201902363644712703748634421727257879503428486312944916318475347531435041392096108796057730987201352484075057637199253650470908582513936863463863368042891767107602111159828875539940120076013947033661793715396306139863655492213741597905119083588290097656647300733879314678913181465109316761575821351424860442292445304113160652700974330088499034675405518640677342603583409608605533747362760935658853109760994238347382222087292464497684560579562516765574088410321731345627735856052358236389532038534024842273371639123973215995440828421666636023296545694703577184873442034227706653837387506169212768015766181095420097708363604361110592409117889540338021426523948929686439808926114635414571535194342850721353453018315875628275733898268898523557799295727645229391567477566676051087887648453493636068278050564622813598885879259940946446041705204470046315137975431737187756039815962647501410906658866162180038266989961965580587208639721176995219466789857011798332440601811575658074284182910615193917630059194314434605154047710570054339000182453117733718955857603607182860506356479979004139761808955363669603162193113250223851791672055180659263518036251214575926238369348222665895576994660491938112486609099798128571823494006615552196112207203092277646200999315244273589488710576623894693889446495093960330454340842102462401048723328750081749179875543879387381439894238011762700837196053094383940063756116458560943129517597713935396074322792489221267045808183313764165818269562105872892447740035947009268662659651422050630078592002488291860839743732353849083964326147000532423540647042089499210250404726781059083644007466380020870126664209457181702946752278540074508552377720890581683918446592829417018288233014971554235235911774818628592967605048203864343108779562892925405638946621948268711042828163893975711757786915430165058602965217459581988878680408110328432739867198621306205559855266036405046282152306154594474489908839081999738747452969810776201487134000122535522246695409315213115337915798026979555710508507473874750758068765376445782524432638046143042889235934852961058269382103498000405248407084403561167817170512813378805705643450616119330424440798260377951198548694559152051960093041271007277849301555038895360338261929343797081874320949914159593396368110627557295278004254863060054523839151068998913578820019411786535682149118528207852130125518518493711503422159542244511900207393539627400208110465530207932867254740543652717595893500716336076321614725815407642053020045340183572338292661915308354095120226329165054426123619197051613839357326693760156914429944943744856809775696303129588719161129294681884936338647392747601226964158848900965717086160598147204467428664208765334799858222090619802173211614230419477754990738738567941189824660913091691772274207233367635032678340586301930193242996397204445179288122854478211953530898910125342975524727635730226281382091807439748671453590778633530160821559911314144205091447293535022230817193663509346865858656314855575862447818620108711889760652969899269328178705576435143382060141077329261063431525337182243385263520217735440715281898137698755157574546939727150488469793619500477720970561793913828989845327426227288647108883270173723258818244658436249580592560338105215606206155713299156084892064340303395262263451454283678698288074251422567451806184149564686111635404971897682154227722479474033571527436819409892050113653400123846714296551867344153741615042563256713430247655125219218035780169240326699541746087592409207004669340396510178134857835694440760470232540755557764728450751826890418293966113310160131119077398632462778219023650660374041606724962490137433217246454097412995570529142438208076098364823465973886691349919784013108015581343979194852830436739012482082444814128095443773898320059864909159505322857914576884962578665885999179867520554558099004556461178755249370124553217170194282884617402736649978475508294228020232901221630102309772151569446427909802190826689868834263071609207914085197695235553488657743425277531197247430873043619511396119080030255878387644206085044730631299277888942729189727169890575925244679660189707482960949190648764693702750773866432391919042254290235318923377293166736086996228032557185308919284403805071030064776847863243191000223929785255372375566213644740096760539439838235764606992465260089090624105904215453927904411529580345334500256244101006359530039598864466169595626351878060688513723462707997327233134693971456285542615467650632465676620279245208581347717608521691340946520307673391841147504140168924121319826881568664561485380287539331160232292555618941042995335640095786495340935115266454024418775949316930560448686420862757201172319526405023099774567647838488973464317215980626787671838005247696884084989185086149003432403476742686245952395890358582135006450998178244636087317754378859677672919526111213859194725451400301180503437875277664402762618941017576872680428176623860680477885242887430259145247073950546525135339459598789619778911041890292943818567205070964606263541732944649576612651953495701860015412623962286413897796733329070567376962156498184506842263690367849555970026079867996261019039331263768556968767029295371162528005543100786408728939225714512481135778627664902425161990277471090335933309304948380597856628844787441469841499067123764789582263294904679812089984857163571087831191848630254501620929805829208334813638405421720056121989353669371336733392464416125223196943471206417375491216357008573694397305979709719726666642267431117762176403068681310351899112271339724036887000996862922546465006385288620393800504778276912835603372548255793912985251506829969107754257647488325341412132800626717094009098223529657957997803018282428490221470748111124018607613415150387569830918652780658896682362523937845272634530420418802508442363190383318384550522367992357752929106925043261446950109861088899914658551881873582528164302520939285258077969737620845637482114433988162710031703151334402309526351929588680690821355853680161000213740851154484912685841268695899174149133820578492800698255195740201818105641297250836070356851055331787840829000041552511865779453963317538532092149720526607831260281961164858098684587525129997404092797683176639914655386108937587952214971731728131517932904431121815871023518740757222100123768721944747209349312324107065080618562372526732540733324875754482967573450019321902199119960797989373383673242576103938985349278777473980508080015544764061053522202325409443567718794565430406735896491017610775948364540823486130254718476485189575836674399791508512858020607820554462991723202028222914886959399729974297471155371858924238493855858595407438104882624648788053304271463011941589896328792678327322456103852197011130466587100500083285177311776489735230926661234588873102883515626446023671996644554727608310118788389151149340939344750073025855814756190881398752357812331342279866503522725367171230756861045004548970360079569827626392344107146584895780241408158405229536937499710665594894459246286619963556350652623405339439142111271810691052290024657423604130093691889255865784668461215679554256605416005071276641766056874274200329577160643448606201239821698271723197826816628249938714995449137302051843669076723577400053932662622760323659751718925901801104290384274185507894887438832703063283279963007200698012244365116394086922220745320244624121155804354542064215121585056896157356414313068883443185280853975927734433655384188340303517822946253702015782157373265523185763554098954033236382319219892171177449469403678296185920803403867575834111518824177439145077366384071880489358256868542011645031357633355509440319236720348651010561049872726472131986543435450409131859513145181276437310438972507004981987052176272494065214619959232142314439776546708351714749367986186552791715824080651063799500184295938799158350171580759883784962257398512129810326379376218322456594236685376799113140108043139732335449090824910499143325843298821033984698141715756010829706583065211347076803680695322971990599904451209087275776225351040902392888779424630483280319132710495478599180196967835321464441189260631526618167443193550817081875477050802654025294109218264858213857526688155584113198560022135158887210365696087515063187533002942118682221893775546027227291290504292259787710667873840000616772154638441292371193521828499824350920891801685572798156421858191197490985730570332667646460728757430565372602768982373259745084479649545648030771598153955827779139373601717422996027353102768719449444917939785144631597314435351850491413941557329382048542123508173912549749819308714396615132942045919380106231421774199184060180347949887691051557905554806953878540066453375981862846419905220452803306263695626490910827627115903856995051246529996062855443838330327638599800792922846659503551211245284087516229060262011857775313747949362055496401073001348853150735487353905602908933526400713274732621960311773433943673385759124508149335736911664541281788171454023054750667136518258284898099512139193995633241336556777098003081910272040997148687418134667006094051021462690280449159646545330107754695413088714165312544813061192407821188690056027781824235022696189344352547633573536485619363254417756613981703930632872166905722259745209192917262199844409646158269456380239502837121686446561785235565164127712826918688615572716201474934052276946595712198314943381622114006936307430444173284786101777743837977037231795255434107223445512555589998646183876764903972461167959018100035098928641204195163551108763204267612979826529425882951141275841262732790798807559751851576841264742209479721843309352972665210015662514552994745127631550917636730259462132930190402837954246323258550301096706922720227074863419005438302650681214142135057154175057508639907673946335146209082888934938376439399256900604067311422093312195936202982972351163259386772241477911629572780752395056251581603133359382311500518626890530658368129988108663263271980611271548858798093487912913707498230575929091862939195014721197586067270092547718025750337730799397134539532646195269996596385654917590458333585799102012713204583903200853878881633637685182083727885131175227769609787962142372162545214591281831798216044111311671406914827170981015457781939202311563871950805024679725792497605772625913328559726371211201905720771409148645074094926718035815157571514050397610963846755569298970383547314100223802583468767350129775413279532060971154506484212185936490997917766874774481882870632315515865032898164228288232746866106592732197907162384642153489852476216789050260998045266483929542357287343977680495774091449538391575565485459058976495198513801007958010783759945775299196700547602252552034453988712538780171960718164078124847847257912407824544361682345239570689514272269750431873633263011103053423335821609333191218806608268341428910415173247216053355849993224548730778822905252324234861531520976938461042582849714963475341837562003014915703279685301868631572488401526639835689563634657435321783493199825542117308467745297085839507616458229630324424328237737450517028560698067889521768198156710781633405266759539424926280756968326107495323390536223090807081455919837355377748742029039018142937311529334644468151212945097596534306284215319445727118614900017650558177095302468875263250119705209476159416768727784472000192789137251841622857783792284439084301181121496366424659033634194540657183544771912446621259392656620306888520055599121235363718226922531781458792593750441448933981608657900876165024635197045828895481793756681046474614105142498870252139936870509372305447734112641354892806841059107716677821238332810262185587751312721179344448201440425745083063944738363793906283008973306241380614589414227694747931665717623182472168350678076487573420491557628217583972975134478990696589532548940335615613167403276472469212505759116251529654568544633498114317670257295661844775487469378464233737238981920662048511894378868224807279352022501796545343757274163910791972952950812942922205347717304184477915673991738418311710362524395716152714669005814700002633010452643547865903290733205468338872078735444762647925297690170912007874183736735087713376977683496344252419949951388315074877537433849458259765560996555954318040920178497184685497370696212088524377013853757681416632722412634423982152941645378000492507262765150789085071265997036708726692764308377229685985169122305037462744310852934305273078865283977335246017463527703205938179125396915621063637625882937571373840754406468964783100704580613446731271591194608435935825987782835266531151065041623295329047772174083559349723758552138048305090009646676088301540612824308740645594431853413755220166305812111033453120745086824339432159043594430312431227471385842030390106070940315235556172767994160020393975099897629335325855575624808996691829864222677502360193257974726742578211119734709402357457222271212526852384295874273501563660093188045493338989741571490544182559738080871565281430102670460284316819230392535297795765862414392701549740879273131051636119137577008929564823323648298263024607975875767745377160102490804624301856524161756655600160859121534556267602192689982855377872583145144082654583484409478463178777374794653580169960779405568701192328608041130904629350871827125934668712766694873899824598527786499569165464029458935064964335809824765965165142090986755203808309203230487342703468288751604071546653834619611223013759451579252696743642531927390036038608236450762698827497618723575476762889950752114804852527950845033958570838130476937881321123674281319487950228066320170022460331989671970649163741175854851878484012054844672588851401562725019821719066960812627785485964818369621410721714214986361918774754509650308957099470934337856981674465828267911940611956037845397855839240761276344105766751024307559814552786167815949657062559755074306521085301597908073343736079432866757890533483669555486803913433720156498834220893399971641479746938696905480089193067138057171505857307148815649920714086758259602876056459782423770242469805328056632787041926768467116266879463486950464507420219373945259262668613552940624781361206202636498199999498405143868285258956342264328707663299304891723400725471764188685351372332667877921738347541480022803392997357936152412755829569276837231234798989446274330454566790062032420516396282588443085438307201495672106460533238537203143242112607424485845094580494081820927639140008540422023556260218564348994145439950410980591817948882628052066441086319001688568155169229486203010738897181007709290590480749092427141018933542818429995988169660993836961644381528877214085268088757488293258735809905670755817017949161906114001908553744882726200936685604475596557476485674008177381703307380305476973609786543859382187220583902344443508867499866506040645874346005331827436296177862518081893144363251205107094690813586440519229512932450078833398788429339342435126343365204385812912834345297308652909783300671261798130316794385535726296998740359570458452230856390098913179475948752126397078375944861139451960286751210561638976008880092746115860800207803341591451797073036835196977766076373785333012024120112046988609209339085365773222392412449051532780950955866459477634482269986074813297302630975028812103517723124465095349653693090018637764094094349837313251321862080214809922685502948454661814715557444709669530177690434272031892770604717784527939160472281534379803539679861424370956683221491465438014593829277393396032754048009552231816667380357183932757077142046723838624617803976292377131209580789363841447929802588065522129262093623930637313496640186619510811583471173312025805866727639992763579078063818813069156366274125431259589936119647626101405563503399523140323113819656236327198961837254845333702062563464223952766943568376761368711962921818754576081617053031590728828700712313666308722754918661395773730546065997437810987649802414011242142773668082751390959313404155826266789510846776118665957660165998178089414985754976284387856100263796543178313634025135814161151902096499133548733131115022700681930135929595971640197196053625033558479980963488718039111612813595968565478868325856437896173159762002419621552896297904819822199462269487137462444729093456470028537694958859591606789282491054412515996300781368367490209374915732896270028656829344431342347351239298259166739503425995868970697267332582735903121288746660451461487850346142827765991608090398652575717263081833494441820193533385071292345774375579344062178711330063106003324053991693682603746176638565758877580201229366353270267100681261825172914608202541892885935244491070138206211553827793565296914576502048643282865557934707209634807372692141186895467322767751335690190153723669036865389161291688887876407525493494249733427181178892759931596719354758988097924525262363659036320070854440784544797348291802082044926670634420437555325050527522833778887040804033531923407685630109347772125639088640413101073817853338316038135280828119040832564401842053746792992622037698718018061122624490909242641985820861751177113789051609140381575003366424156095216328197122335023167422600567941281406217219641842705784328959802882335059828208196666249035857789940333152274817776952843681630088531769694783690580671064828083598046698841098135158654906933319522394363287923990534810987830274500172065433699066117784554364687723631844464768069142828004551074686645392805399409108754939166095731619715033166968309929466349142798780842257220697148875580637480308862995118473187124777291910070227588893486939456289515802965372150409603107761289831263589964893410247036036645058687287589051406841238124247386385427908282733827973326885504935874303160274749063129572349742611221517417153133618622410913869500688835898962349276317316478340077460886655598733382113829928776911495492184192087771606068472874673681886167507221017261103830671787856694812948785048943063086169948798703160515884108282351274153538513365895332948629494495061868514779105804696039069372662670386512905201137810858616188886947957607413585534585151768051973334433495230120395770739623771316030242887200537320998253008977618973129817881944671731160647231476248457551928732782825127182446807824215216469567819294098238926284943760248852279003620219386696482215628093605373178040863727268426696421929946819214908701707533361094791381804063287387593848269535583077395761447997270003472880182785281389503217986345216111066608839314053226944905455527867894417579202440021450780192099804461382547805858048442416404775031536054906591430078158372430123137511562284015838644270890718284816757527123846782459534334449622010096071051370608461801187543120725491334994247617115633321408934609156561550600317384218701570226103101916603887064661438897736318780940711527528174689576401581047016965247557740891644568677717158500583269943401677202156767724068128366565264122982439465133197359199709403275938502669557470231813203243716420586141033606524536939160050644953060161267822648942437397166717661231048975031885732165554988342121802846912529086101485527815277625623750456375769497734336846015607727035509629049392487088406281067943622418704747008368842671022558302403599841645951122485272633632645114017395248086194635840783753556885622317115520947223065437092606797351000565549381224575483728545711797393615756167641692895805257297522338558611388322171107362265816218842443178857488798109026653793426664216990914056536432249301334867988154886628665052346997235574738424830590423677143278792316422403877764330192600192284778313837632536121025336935812624086866699738275977365682227907215832478888642369346396164363308730139814211430306008730666164803678984091335926293402304324974926887831643602681011309570716141912830686577323532639653677390317661361315965553584999398600565155921936759977717933019744688148371103206503693192894521402650915465184309936553493337183425298433679915939417466223900389527673813330617747629574943868716978453767219493506590875711917720875477107189937960894774512654757501871194870738736785890200617373321075693302216320628432065671192096950585761173961632326217708945426214609858410237813215817727602222738133495410481003073275107799948991977963883530734443457532975914263768405442264784216063122769646967156473999043715903323906560726644116438605404838847161912109008701019130726071044114143241976796828547885524779476481802959736049439700479596040292746299203572099761950140348315380947714601056333446998820822120587281510729182971211917876424880354672316916541852256729234429187128163232596965413548589577133208339911288775917226115273379010341362085614577992398778325083550730199818459025958355989260553299673770491722454935329683300002230181517226575787524058832249085821280089747909326100762578770428656006996176212176845478996440705066241710213327486796237430229155358200780141165348065647488230615003392068983794766255036549822805329662862117930628430170492402301985719978948836897183043805182174419147660429752437251683435411217038631379411422095295885798060152938752753799030938871683572095760715221900279379292786303637268765822681241993384808166021603722154710143007377537792699069587121289288019052031601285861825494413353820784883465311632650407642428390870121015194231961652268422003711230464300673442064747718021353070124098860353399152667923871101706221865883573781210935179775604425634694999787251125440854522274810914874307259869602040275941178942581281882159952359658979181144077653354321757595255536158128001163846720319346507296807990793963714961774312119402021297573125165253768017359101557338153772001952444543620071848475663415407442328621060997613243487548847434539665981338717466093020535070271952983943271425371155766600025784423031073429551533945060486222764966687624079324353192992639253731076892135352572321080889819339168668278948281170472624501948409700975760920983724090074717973340788141825195842598096241747610138252643955135259311885045636264188300338539652435997416931322894719878308427600401368074703904097238473945834896186539790594118599310356168436869219485382055780395773881360679549900085123259442529724486666766834641402189915944565309423440650667851948417766779470472041958822043295380326310537494883122180391279678446100139726753892195119117836587662528083690053249004597410947068772912328214304635337283519953648274325833119144459017809607782883583730111857543659958982724531925310588115026307542571493943024453931870179923608166611305426253995833897942971602070338767815033010280120095997252222280801423571094760351925544434929986767817891045559063015953809761875920358937341978962358931125983902598310267193304189215109689156225069659119828323455503059081730735195503721665870288053992138576037035377105178021280129566841984140362872725623214428754302210909472721073474134975514190737043318276626177275996888826027225247133683353452816692779591328861381766349857728936900965749562287103024362590772412219094300871755692625758065709912016659622436080242870024547362036394841255954881727272473653467783647201918303998717627037515724649922289467932322693619177641614618795613956699567783068290316589699430767333508234990790624100202506134057344300695745474682175690441651540636584680463692621274211075399042188716127617787014258864825775223889184599523376292377915585744549477361295525952226578636462118377598473700347971408206994145580719080213590732269233100831759510659019121294795408603640757358750205890208704579670007055262505811420663907459215273309406823649441590891009220296680523325266198911311842016291631076894084723564366808182168657219688268358402785500782804043453710183651096951782335743030504852653738073531074185917705610397395062640355442275156101107261779370634723804990666922161971194259120445084641746383589938239946517395509000859479990136026674261494290066467115067175422177038774507673563742154782905911012619157555870238957001405117822646989944917908301795475876760168094100135837613578591356924455647764464178667115391951357696104864922490083446715486383054477914330097680486878348184672733758436892724310447406807685278625585165092088263813233623148733336714764520450876627614950389949504809560460989604329123358348859990294526400284994280878624039811814884767301216754161106629995553668193123287425702063738352020086863691311733469731741219153633246745325630871347302792174956227014687325867891734558379964351358800959350877556356248810493852999007675135513527792412429277488565888566513247302514710210575352516511814850902750476845518252096331899068527614435138213662152368890578786699432288816028377482035506016029894009119713850179871683633744139275973644017007014763706655703504338121113576415018451821413619823495159601064752712575935185304332875537783057509567425442684712219618709178560783936144511383335649103256405733898667178123972237519316430617013859539474367843392670986712452211189690840236327411496601243483098929941738030588417166613073040067588380432111555379440605497721705942821514886165672771240903387727745629097110134885184374118695655449745736845218066982911045058004299887953899027804383596282409421860556287788428802127553884803728640019441614257499904272009595204654170598104989967504511936471172772220436102614079750809686975176600237187748348016120310234680567112644766123747627852190241202569943534716226660893675219833111813511146503854895025120655772636145473604426859498074396932331297127377157347099713952291182653485155587137336629120242714302503763269501350911612952993785864681307226486008270881333538193703682598867893321238327053297625857382790097826460545598555131836688844628265133798491667839409761353766251798258249663458771950124384040359140849209733754642474488176184070023569580177410177696925077814893386672557898564589851056891960924398841569280696983352240225634570497312245269354193837004843183357196516626721575524193401933099018319309196582920969656247667683659647019595754739345514337413708761517323677204227385674279170698204549953095918872434939524094441678998846319845504852393662972079777452814399418256789457795712552426826089940863317371538896262889629402112108884427376568624527612130371017300785135715404533041507959447776143597437803742436646973247138410492124314138903579092416036406314038149831481905251720937103964026808994832572297954564042701757722904173234796073618787889913318305843069394825961318713816423467218730845133877219086975104942843769325024981656673816260615941768252509993741672883951744066932549653403101452225316189009235376486378482881344209870048096227171226407489571939002918573307460104360729190945767994614929290427981687729426487729952858434647775386906950148984133924540394144680263625402118614317031251117577642829914644533408920976961699098372652361768745605894704968170136974909523072082682887890730190018253425805343421705928713931737993142410852647390948284596418093614138475831136130576108462366837237695913492615824516221552134879244145041756848064120636520170386330129532777699023118648020067556905682295016354931992305914246396217025329747573114094220180199368035026495636955866425906762685687372110339156793839895765565193177883000241613539562437777840801748819373095020699900890899328088397430367736595524891300156633294077907139615464534088791510300651321934486673248275907946807879819425019582622320395131252014109960531260696555404248670549986786923021746989009547850725672978794769888831093487464426400718183160331655511534276155622405474473378049246214952133258527698847336269182649174338987824789278468918828054669982303689939783413747587025805716349413568433929396068192061773331791738208562436433635359863494496890781064019674074436583667071586924521182997893804077137501290858646578905771426833582768978554717687184427726120509266486102051535642840632368481807287940717127966820060727559555904040233178749447346454760628189541512139162918444297651066947969354016866010055196077687335396511614930937570968554559381513789569039251014953265628147011998326992200066392875374713135236421589265126204072887716578358405219646054105435443642166562244565042999010256586927279142752931172082793937751326106052881235373451068372939893580871243869385934389175713376300720319760816604464683937725806909237297523486702916910426369262090199605204121024077648190316014085863558427609537086558164273995349346546314504040199528537252004957805254656251154109252437991326262713609099402902262062836752132305065183934057450112099341464918433323646569371725914489324159006242020612885732926133596808726500045628284557574596592120530341310111827501306961509835515632004310784601906565493806542525229161991819959602752327702249855738824899882707465936355768582560518068964285376850772012220347920993936179268206590142165615925306737944568949070853263568196831861772268249911472615732035807646298116244013316737892788689229032593349861797021994981925739617673075834417098559222170171825712777534491508205278430904619460835217402005838672849709411023266953921445461066215006410674740207009189911951376466904481267253691537162290791385403937560077835153374167747942100384002308951850994548779039346122220865060160500351776264831611153325587705073541279249909859373473787081194253055121436979749914951860535920403830235716352727630874693219622190064260886183676103346002255477477813641012691906569686495012688376296907233961276287223041141813610060264044030035996988919945827397624114613744804059697062576764723766065541618574690527229238228275186799156983390747671146103022776606020061246876477728819096791613354019881402757992174167678799231603963569492851513633647219540611171767387372555728522940054361785176502307544693869307873499110352182532929726044553210797887711449898870911511237250604238753734841257086064069052058452122754533848008205302450456517669518576913200042816758054924811780519832646032445792829730129105318385636821206215531288668564956512613892261367064093953334570526986959692350353094224543865278677673027540402702246384483553239914751363441044050092330361271496081355490531539021002299595756583705381261965683144286057956696622154721695620870013727768536960840704833325132793112232507148630206951245395003735723346807094656483089209801534878705633491092366057554050864111521441481434630437273271045027768661953107858323334857840297160925215326092558932655600672124359464255065996771770388445396181632879614460817789272171836908880126778207430106422524634807454300476492885553409062185153654355474125476152769772667769772777058315801412185688011705028365275543214803488004442979998062157904564161957212784508928489806426497427090579129069217807298769477975112447305991406050629946894280931034216416629935614828130998870745292716048433630818404126469637925843094185442216359084576146078558562473814931427078266215185541603870206876980461747400808324343665382354555109449498431093494759944672673665352517662706772194183191977196378015702169933675083760057163454643671776723387588643405644871566964321041282595645349841388412890420682047007615596916843038999348366793542549210328113363184722592305554383058206941675629992013373175489122037230349072681068534454035993561823576312837767640631013125335212141994611869350833176587852047112364331226765129964171325217513553261867681942338790365468908001827135283584888444111761234101179918709236507184857856221021104009776994453121795022479578069506532965940383987369907240797679040826794007618729547835963492793904576973661643405359792219285870574957481696694062334272619733518136626063735982575552496509807260123668283605928341855848026958413772558970883789942910549800331113884603401939166122186696058491571485733568286149500019097591125218800396419762163559375743718011480559442298730418196808085647265713547612831629200449880315402105530597076666362749328308916880932359290081787411985738317192616728834918402429721290434965526942726402559641463525914348400675867690350382320572934132981593533044446496829441367323442158380761694831219333119819061096142952201536170298575105594326461468505452684975764807808009221335811378197749271768545075538328768874474591593731162470601091244609829424841287520224462594477638749491997840446829257360968534549843266536862844489365704111817793806441616531223600214918768769467398407517176307516849856359201486892943105940202457969622924566644881967576294349535326382171613395757790766370764569570259738800438415805894336137106551859987600754924187211714889295221737721146081154344982665479872580056674724051122007383459271575727715218589946948117940644466399432370044291140747218180224825837736017346685300744985564715420036123593397312914458591522887408719508708632218837288262822884631843717261903305777147651564143822306791847386039147683108141358275755853643597721650028277803713422869688787349795096031108899196143386664068450697420787700280509367203387232629637856038653216432348815557557018469089074647879122436375556668678067610544955017260791142930831285761254481944449473244819093795369008206384631678225064809531810406570254327604385703505922818919878065865412184299217273720955103242251079718077833042609086794273428955735559252723805511440438001239041687716445180226491681641927401106451622431101700056691121733189423400547959684669804298017362570406733282129962153684881404102194463424646220745575643960452985313071409084608499653767803793201899140865814662175319337665970114330608625009829566917638846056762972931464911493704624469351984039534449135141193667933301936617663652555149174982307987072280860859626112660504289296966535652516688885572112276802772743708917389639772257564890533401038855931125679991516589025016486961427207005916056166159702451989051832969278935550303934681219761582183980483960562523091462638447386296039848924386187298507775928792722068554807210497817653286210187476766897248841139560349480376727036316921007350834073865261684507482496448597428134936480372426116704266870831925040997615319076855770327421785010006441984124207396400139603601583810565928413684574119102736420274163723488214524101347716529603128408658419787951116511529827814620379139855006399960326591248525308493690313130100799977191362230866011099929142871249388541612038020411340188887219693477904497527454288072803509305828754420755134816660927879353566521255620139988249628478726214432362853676502591450468377635282587652139156480972141929675549384375582600253168536356731379262475878049445944183429172756988376226261846365452743497662411138451305481449836311789784489732076719508784158618879692955819733250699951402601511675529750575437810242238957925786562128432731202200716730574069286869363930186765958251326499145950260917069347519408975357464016830811798846452473618956056479426358070562563281189269663026479535951097127659136233180866921535788607812759910537171402204506186075374866306350591483916467656723205714516886170790984695932236724946737583099607042589220481550799132752088583781117685214269334786921895240622657921043620348852926267984013953216458791151579050460579710838983371864038024417511347226472547010794793996953554669619726763255229914654933499663234185951450360980344092212206712567698723427940708857070474293173329188523896721971353924492426178641188637790962814486917869468177591717150669111480020759432012061969637795103227089029566085562225452602610460736131368869009281721068198618553780982018471154163630326265699283424155023600978046417108525537612728905335045506135684143775854429677977014660294387687225115363801191758154028120818255606485410787933598921064427244898618961629413418001295130683638609294100083136673372153008352696235737175330738653338204842190308186449184093723944033405244909554558016406460761581010301767488475017661908692946098769201691202181688291040870709560951470416921147027413390052253340834812870353031023919699978597413908593605433599697075604460134242453682496098772581311024732798562072126572499003468293886872304895562253204463602639854225258416464324271611419817802482595563544907219226583863662663750835944314877635156145710745528016159677048442714194435183275698407552677926411261765250615965235457187956673170913319358761628255920783080185206890151504713340386100310055914817852110384754542933389188444120517943969970194112695119526564919594189975418393234647424290702718875223534393673633663200307232747037407123982562024662651974090199762452056198557625760008708173083288344381831070054514493545885422678578551915372292379555494333410174420169600090696415612732297770221217951868376359082255128816470021992348864043959153018464004714321186360622527011541122283802778538911098490201342741014121559769965438877197485376431158229838533123071751132961904559007938064276695819014842627991221792947987348901868471676503827328552059082984529806259250352128451925927986593506132961946796252373972565584157853744567558998032405492186962888490332560851455344391660226257775512916200772796852629387937530454181080729285891989715381797343496187232927614747850192611450413274873242970583408471112333746274617274626582415324271059322506255302314738759251724787322881491455915605036334575424233779160374952502493022351481961381162563911415610326844958072508273431765944054098269765269344579863479709743124498271933113863873159636361218623497261409556079920628316999420072054811525353393946076850019909886553861433495781650089961649079678142901148387645682174914075623767618453775144031475411206760160726460556859257799322070337333398916369504346690694828436629980037414527627716547623825546170883189810868806847853705536480469350958818025360529740793538676511195079373282083146268960071075175520614433784114549950136432446328193346389050936545714506900864483440180428363390513578157273973334537284263372174065775771079830517555721036795976901889958494130195999573017901240193908681356585539661941371794487632079868800371607303220547423572266896801882123424391885984168972277652194032493227314793669234004848976059037958094696041754279613782553781223947646147832926976545162290281701100437846038756544151739433960048915318817576650500951697402415644771293656614253949368884230517400129920556854289853897942669956777027089146513736892206104415481662156804219838476730871787590279209175900695273456682026513373111518000181434120962601658629821076663523361774007837783423709152644063054071807843358061072961105550020415131696373046849213356837265400307509829089364612047891114753037049893952833457824082817386441322710002968311940203323456420826473276233830294639378998375836554559919340866235090967961134004867027123176526663710778725111860354037554487418693519733656621772359229396776463251562023487570113795712096237723431370212031004965152111976013176419408203437348512852602913334915125083119802850177855710725373149139215709105130965059885999931560863655477403551898166733535880048214665099741433761182777723351910741217572841592580872591315074606025634903777263373914461377038021318347447301113032670296917335047701632106616227830027269283365584011791419447808748253360714403296252285775009808599609040936312635621328162071453406104224112083010008587264252112262480142647519426184325853386753874054743491072710049754281159466017136122590440158991600229827801796035194080046513534752698777609527839984368086908989197839693532179980139135442552717910225397010810632143048511378291498511381969143043497500189980681644412123273328307192824362406733196554692677851193152775113446468905504248113361434984604849051258345683266441528489713972376040328212660253516693914082049947320486021627759791771234751097502403078935759937715095021751693555827072533911892334070223832077585802137174778378778391015234132098489423459613692340497998279304144463162707214796117456975719681239291913740982925805561955207434243295982898980529233366415419256367380689494201471241340525072204061794355252555225008748790086568314542835167750542294803274783044056438581591952666758282929705226127628711040134801787224801789684052407924360582742467443076721645270313451354167649668901274786801010295133862698649748212118629040337691568576240699296372493097201628707200189835423690364149270236961938547372480329855045112089192879829874467864129159417531675602533435310626745254507114181483239880607297140234725520713490798398982355268723950909365667878992383712578976248755990443228895388377317348941122757071410959790047919301046740750411435381782464630795989555638991884773781341347070246747362112048986226991888517456251732519341352038115863350123913054441910073628447567514161050410973505852762044489190978901984315485280533985777844313933883994310444465669244550885946314081751220331390681596592510546858013133838152176418210433429788826119630443111388796258746090226130900849975430395771243230616906262919403921439740270894777663702488155499322458825979020631257436910946393252806241642476868495455324938017639371615636847859823715902385421265840615367228607131702674740131145261063765383390315921943469817605358380310612887852051546933639241088467632009567089718367490578163085158138161966882222047570437590614338040725853862083565176998426774523195824182683698270160237414938363496629351576854061397342746470899685618170160551104880971554859118617189668025973541705423985135560018720335079060946421271143993196046527424050882225359773481519135438571253258540493946010865793798058620143366078825219717809025817370870916460452727977153509910340736425020386386718220522879694458387652947951048660717390229327455426785669776865939923416834122274663015062155320502655341460995249356050854921756549134830958906536175693817637473644183378974229700703545206663170929607591989627732423090252397443861014263098687733913882518684316501027964911497737582888913450341148865948670215492101084328080783428089417298008983297536940644969903125399863919581601468995220880662285408414864274786281975546629278814621607171381880180840572084715868906836919393381864278454537956719272397972364651667592011057995663962598535512763558768140213409829016296873429850792471846056874828331381259161962476156902875901072733103299140623864608333378638257926302391590003557609032477281338887339178096966601469615031754226751125993315529674213336300222964906480934582008181061802100227664580400278213336758573019011371754672763059044353131319036092489097246427928455549913490005180295707082919052556781889913899625138662319380053611346224294610248954072404857123256628888931722116432947816190554868054943441034090680716088028227959686950133643814268252170472870863010137301155236861416908375675747637239763185757038109443390564564468524183028148107998376918512127201935044041804604721626939445788377090105974693219720558114078775989772072009689382249303236830515862657281114637996983137517937623215111252349734305240622105244234353732905655163406669506165892878218707756794176080712973781335187117931650033155523822487730653444179453415395202424449703410120874072188109388268167512042299404948179449472732894770111574139441228455521828424922240658752689172272780607116754046973008037039618787796694882555614674384392570115829546661358678671897661297311267200072971553613027503556167817765442287442114729881614802705243806817653573275578602505847084013208837932816008769081300492491473682517035382219619039014999523495387105997351143478292339499187936608692301375596368532373806703591144243268561512109404259582639301678017128669239283231057658851714020211196957064799814031505633045141564414623163763809904402816256917576489142569714163598439317433270237812336938043012892626375382667795034169334323607500248175741808750388475094939454896209740485442635637164995949920980884294790363666297526003243856352945844728944547166209297495496616877414120882130477022816116456044007236351581149729739218966737382647204722642221242016560150284971306332795814302516013694825567014780935790889657134926158161346901806965089556310121218491805847922720691871696316330044858020102860657858591269974637661741463934159569539554203314628026518951167938074573315759846086173702687867602943677780500244673391332431669880354073232388281847501051641331189537036488422690270478052742490603492082954755054003457160184072574536938145531175354210726557835615499874447480427323457880061873149341566046352979779455075359304795687209316724536547208381685855606043801977030764246083489876101345709394877002946175792061952549255757109038525171488525265671045349813419803390641529876343695420256080277614421914318921393908834543131769685101840103844472348948869520981943531906506555354617335814045544837884752526253949665869992058417652780125341033896469818642430034146791380619028059607854888010789705516946215228773090104467462497979992627120951684779568482583341402266477210843362437593741610536734041954738964197895425335036301861400951534766961476255651873823292468547356935802896011536791787303553159378363082248615177770541577576561759358512016692943111138863582159667618830326104164651714846979385422621687161400122378213779774131268977266712992025922017408770076956283473932201088159356286281928563571893384958850603853158179760679479840878360975960149733420572704603521790605647603285569276273495182203236144112584182426247712012035776388895974318232827871314608053533574494297621796789034568169889553518504478325616380709476951699086247100019748809205009521943632378719764870339223811540363475488626845956159755193765410115014067001226927474393888589943859730245414801061235908036274585288493563251585384383242493252666087588908318700709100237377106576985056433928854337658342596750653715005333514489908293887737352051459333049626531415141386124437935885070944688045486975358170212908490787347806814366323322819415827345671356443171537967818058195852464840084032909981943781718177302317003989733050495387356116261023999433259780126893432605584710278764901070923443884634011735556865903585244919370181041626208504299258697435817098133894045934471937493877624232409852832762266604942385129709453245586252103600829286649724174919141988966129558076770979594795306013119159011773943104209049079424448868513086844493705909026006120649425744710353547657859242708130410618546219881830090634588187038755856274911587375421064667951346487586771543838018521348281915812462599335160198935595167968932852205824799421034512715877163345222995418839680448835529753361286837225935390079201666941339091168758803988828869216002373257361588207163516271332810518187602104852180675526648673908900907195138058626735124312215691637902277328705410842037841525683288718046987952513073266340278519059417338920358540395677035611329354482585628287610610698229721420961993509331312171187891078766872044548876089410174798647137882462153955933333275562009439580434537919782280590395959927436913793778664940964048777841748336432684026282932406260081908081804390914556351936856063045089142289645219987798849347477729132797266027658401667890136490508741142126861969862044126965282981087045479861559545338021201155646979976785738920186243599326777689454060508218838227909833627167124490026761178498264377033002081844590009717235204331994708242098771514449751017055643029542821819670009202515615844174205933658148134902693111517093872260026458630561325605792560927332265579346280805683443921373688405650434307396574061017779370141424615493070741360805442100295600095663588977899267630517718781943706761498217564186590116160865408635391513039201316805769034172596453692350806417446562351523929050409479953184074862151210561833854566176652606393713658802521666223576132201941701372664966073252010771947931265282763302413805164907174565964853748354669194523580315301969160480994606814904037819829732360930087135760798621425422096419004367905479049930078372421581954535418371129368658430553842717628035279128821129308351575656599944741788438381565148434229858704245592434693295232821803508333726283791830216591836181554217157448465778420134329982594566884558266171979012180849480332448787258183774805522268151011371745368417870280274452442905474518234674919564188551244421337783521423865979925988203287085109338386829906571994614906290257427686038850511032638544540419184958866538545040571323629681069146814847869659166861842756798460041868762298055562963045953227923051616721591968675849523635298935788507746081537321454642984792310511676357749494622952569497660359473962430995343310404994209677883827002714478494069037073249106444151696053256560586778757417472110827435774315194060757983563629143326397812218946287447798119807225646714664054850131009656786314880090303749338875364183165134982546694673316118123364854397649325026179549357204305402182974871251107404011611405899911093062492312813116340549262571356721818628932786138833718028535056503591952741400869510926167541476792668032109237467087213606278332922386413619594121339278036118276324106004740971111048140003623342714514483334641675466354699731494756643423659493496845884551524150756376605086632827424794136062876041290644913828519456402643153225858624043141838669590633245063000392213192647625962691510904457695301444054618037857503036686212462278639752746667870121003392984873375014475600322100622358029343774955032037012738468163061026570300872275462966796880890587127676361066225722352229739206443093524327228100859973095132528630601105497915644791845004618046762408928925680912930592960642357021061524646205023248966593987324933967376952023991760898474571843531936646529125848064480196520162838795189499336759241485626136995945307287254532463291529110128763770605570609531377527751867923292134955245133089867969165129073841302167573238637575820080363575728002754490327953079900799442541108725693188014667935595834676432868876966610097395749967836593397846346959948950610490383647409504695226063858046758073069912290474089879166872117147527644711604401952718169508289733537148530928937046384420893299771125856840846608339934045689026787516008775461267988015465856522061210953490796707365539702576199431376639960606061106406959330828171876426043573425361756943784848495250108266488395159700490598380812105221111091943323951136051446459834210799058082093716464523127704023160072138543723461267260997870385657091998507595634613248460188409850194287687902268734556500519121546544063829253851276317663922050938345204300773017029940362615434001322763910912988327863920412300445551684054889809080779174636092439334912641164240093880746356607262336695842764583698268734815881961058571835767462009650526065929263548291499045768307210893245857073701660717398194485028842603963660746031184786225831056580870870305567595861341700745402965687634774176431051751036732869245558582082372038601781739405175130437994868822320044378043103170921034261674998000073016094814586374488778522273076330495383944345382770608760763542098445008306247630253572781032783461766970544287155315340016497076657195985041748199087201490875686037783591994719343352772947285537925787684832301101859365800717291186967617655053775030293033830706448912811412025506150896411007623824574488655182581058140345320124754723269087547507078577659732542844459353044992070014538748948226556442223696365544194225441338212225477497535494624827680533336983284156138692363443358553868471111430498248398991803165458638289353799130535222833430137953372954016257623228081138499491876144141322933767106563492528814528239506209022357876684650116660097382753660405446941653422239052108314585847035529352219928272760574821266065291385530345549744551470344939486863429459658431024190785923680224560763936784166270518555178702904073557304620639692453307795782245949710420188043000183881429008173039450507342787013124466860092778581811040911511729374873627887874907465285565434748886831064110051023020875107768918781525622735251550379532444857787277617001964853703555167655209119339343762866284619844026295252183678522367475108809781507098978413086245881522660963551401874495836926917799047120726494905737264286005211403581231076006699518536124862746756375896225299116496066876508261734178484789337295056739007878617925351440621045366250640463728815698232317500596261080921955211150859302955654967538862612972339914628358476048627627027309739202001432248707582337354915246085608210328882974183906478869923273691360048837436615223517058437705545210815513361262142911815615301758882573594892507108879262128641392443309383797333867806131795237315266773820858024701433527009243803266951742119507670884326346442749127558907746863582162166042741315170212458586056233631493164646913946562497471741958354218607748711057338458433689939645913740603382159352243594751626239188685307822821763983237306180204246560477527943104796189724299533029792497481684052893791044947004590864991872727345413508101983881864673609392571930511968645601855782450218231065889437986522432050677379966196955472440585922417953006820451795370043472451762893566770508490213107736625751697335527462302943031203596260953423574397249659211010657817826108745318874803187430823573699195156340957162700992444929749105489851519658664740148225106335367949737142510229341882585117371994499115097583746130105505064197721531929354875371191630262030328588658528480193509225875775597425276584011721342323648084027143356367542046375182552524944329657043861387865901965738802868401894087672816714137033661732650120578653915780703088714261519075001492576112927675193096728453971160213606303090542243966320674323582797889332324405779199278484633339777737655901870574806828678347965624146102899508487399692970750432753029972872297327934442988646412725348160603779707298299173029296308695801996312413304939350493325412355071054461182591141116454534710329881047844067780138077131465400099386306481266614330858206811395838319169545558259426895769841428893743467084107946318932539106963955780706021245974898293564613560788983472419979478564362042094613412387613198865352358312996862268948608408456655606876954501274486631405054735351746873009806322780468912246821460806727627708402402266155485024008952891657117617439020337584877842911289623247059191874691042005848326140677333751027195653994697162517248312230633919328707983800748485726516123434933273356664473358556430235280883924348278760886164943289399166399210488307847777048045728491456303353265070029588906265915498509407972767567129795010098229476228961891591441520032283878773485130979081019129267227103778898053964156362364169154985768408398468861684375407065121039062506128107663799047908879674778069738473170475253442156390387201238806323688037017949308954900776331523063548374256816653361606641980030188287123767481898330246836371488309259283375902278942588060087286038859168849730693948020511221766359138251524278670094406942355120201568377778851824670025651708509249623747726813694284350062938814429987905301056217375459182679973217735029368928065210025396268807498092643458011655715886700443503976505323478287327368840863540002740676783821963522226539290939807367391364082898722017776747168118195856133721583119054682936083236976113450281757830202934845982925000895682630271263295866292147653142233351793093387951357095346377183684092444422096319331295620305575517340067973740614162107923633423805646850092037167152642556371853889571416419772387422610596667396997173168169415435095283193556417705668622215217991151355639707143312893657553844648326201206424338016955862698561022460646069330793847858814367407000599769703649019273328826135329363112403650698652160638987250267238087403396744397830258296894256896741864336134979475245526291426522842419243083388103580053787023999542172113686550275341362211693140694669513186928102574795985605145005021715913317751609957865551981886193211282110709442287240442481153406055895958355815232012184605820563592699303478851132068626627588771446035996656108430725696500563064489187599466596772847171539573612108180841547273142661748933134174632662354222072600146012701206934639520564445543291662986660783089068118790090815295063626782075614388815781351134695366303878412092346942868730839320432333872775496805210302821544324723388845215343727250128589747691460808314404125868181540049187772287869801853454537006526655649170915429522756709222217474112062720656622989806032891672068743654948246108697367225547404812889242471854323605753411672850757552057131156697954584887398742228135887985840783135060548290551482785294891121905383195624228719484759407859398047901094194070671764439032730712135887385049993638838205501683402777496070276844880281912220636888636811043569529300652195528261526991271637277388418993287130563464688227398288763198645709836308917786487086676185485680047672552675414742851028145807403152992197814557756843681110185317498167016426647884090262682824448258027532094549915104518517716546311804904567985713257528117913656278158111288816562285876030875974963849435275676612168959261485030785362045274507752950631012480341804584059432926079854435620093708091821523920371790678121992280496069738238743312626730306795943960954957189577217915597300588693646845576676092450906088202212235719254536715191834872587423919410890444115959932760044506556206461164655665487594247369252336955993030355095817626176231849561906494839673002037763874369343999829430209147073618947932692762445186560239559053705128978163455423320114975994896278424327483788032701418676952621180975006405149755889650293004867605208010491537885413909424531691719987628941277221129464568294860281493181560249677887949813777216229359437811004448060797672429276249510784153446429150842764520002042769470698041775832209097020291657347251582904630910359037842977572651720877244740952267166306005469716387943171196873484688738186656751279298575016363411314627530499019135646823804329970695770150789337728658035712790913767420805655493624646 diff --git a/src/compress/zlib/example_test.go b/src/compress/zlib/example_test.go new file mode 100644 index 0000000000000000000000000000000000000000..70408895ffd5a03e3aa405fd43b9b5f60fa76edd --- /dev/null +++ b/src/compress/zlib/example_test.go @@ -0,0 +1,37 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package zlib_test + +import ( + "bytes" + "compress/zlib" + "fmt" + "io" + "os" +) + +func ExampleNewWriter() { + var b bytes.Buffer + + w := zlib.NewWriter(&b) + w.Write([]byte("hello, world\n")) + w.Close() + fmt.Println(b.Bytes()) + // Output: [120 156 202 72 205 201 201 215 81 40 207 47 202 73 225 2 4 0 0 255 255 33 231 4 147] +} + +func ExampleNewReader() { + buff := []byte{120, 156, 202, 72, 205, 201, 201, 215, 81, 40, 207, + 47, 202, 73, 225, 2, 4, 0, 0, 255, 255, 33, 231, 4, 147} + b := bytes.NewReader(buff) + + r, err := zlib.NewReader(b) + if err != nil { + panic(err) + } + io.Copy(os.Stdout, r) + // Output: hello, world + r.Close() +} diff --git a/src/compress/zlib/reader.go b/src/compress/zlib/reader.go new file mode 100644 index 0000000000000000000000000000000000000000..816f1bf6bd06e73dd24b781a2af8839fb08e25b9 --- /dev/null +++ b/src/compress/zlib/reader.go @@ -0,0 +1,161 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +/* +Package zlib implements reading and writing of zlib format compressed data, +as specified in RFC 1950. + +The implementation provides filters that uncompress during reading +and compress during writing. For example, to write compressed data +to a buffer: + + var b bytes.Buffer + w := zlib.NewWriter(&b) + w.Write([]byte("hello, world\n")) + w.Close() + +and to read that data back: + + r, err := zlib.NewReader(&b) + io.Copy(os.Stdout, r) + r.Close() +*/ +package zlib + +import ( + "bufio" + "compress/flate" + "errors" + "hash" + "hash/adler32" + "io" +) + +const zlibDeflate = 8 + +var ( + // ErrChecksum is returned when reading ZLIB data that has an invalid checksum. + ErrChecksum = errors.New("zlib: invalid checksum") + // ErrDictionary is returned when reading ZLIB data that has an invalid dictionary. + ErrDictionary = errors.New("zlib: invalid dictionary") + // ErrHeader is returned when reading ZLIB data that has an invalid header. + ErrHeader = errors.New("zlib: invalid header") +) + +type reader struct { + r flate.Reader + decompressor io.ReadCloser + digest hash.Hash32 + err error + scratch [4]byte +} + +// Resetter resets a ReadCloser returned by NewReader or NewReaderDict to +// to switch to a new underlying Reader. This permits reusing a ReadCloser +// instead of allocating a new one. +type Resetter interface { + // Reset discards any buffered data and resets the Resetter as if it was + // newly initialized with the given reader. + Reset(r io.Reader, dict []byte) error +} + +// NewReader creates a new ReadCloser. +// Reads from the returned ReadCloser read and decompress data from r. +// The implementation buffers input and may read more data than necessary from r. +// It is the caller's responsibility to call Close on the ReadCloser when done. +// +// The ReadCloser returned by NewReader also implements Resetter. +func NewReader(r io.Reader) (io.ReadCloser, error) { + return NewReaderDict(r, nil) +} + +// NewReaderDict is like NewReader but uses a preset dictionary. +// NewReaderDict ignores the dictionary if the compressed data does not refer to it. +// If the compressed data refers to a different dictionary, NewReaderDict returns ErrDictionary. +// +// The ReadCloser returned by NewReaderDict also implements Resetter. +func NewReaderDict(r io.Reader, dict []byte) (io.ReadCloser, error) { + z := new(reader) + err := z.Reset(r, dict) + if err != nil { + return nil, err + } + return z, nil +} + +func (z *reader) Read(p []byte) (n int, err error) { + if z.err != nil { + return 0, z.err + } + if len(p) == 0 { + return 0, nil + } + + n, err = z.decompressor.Read(p) + z.digest.Write(p[0:n]) + if n != 0 || err != io.EOF { + z.err = err + return + } + + // Finished file; check checksum. + if _, err := io.ReadFull(z.r, z.scratch[0:4]); err != nil { + z.err = err + return 0, err + } + // ZLIB (RFC 1950) is big-endian, unlike GZIP (RFC 1952). + checksum := uint32(z.scratch[0])<<24 | uint32(z.scratch[1])<<16 | uint32(z.scratch[2])<<8 | uint32(z.scratch[3]) + if checksum != z.digest.Sum32() { + z.err = ErrChecksum + return 0, z.err + } + return +} + +// Calling Close does not close the wrapped io.Reader originally passed to NewReader. +func (z *reader) Close() error { + if z.err != nil { + return z.err + } + z.err = z.decompressor.Close() + return z.err +} + +func (z *reader) Reset(r io.Reader, dict []byte) error { + if fr, ok := r.(flate.Reader); ok { + z.r = fr + } else { + z.r = bufio.NewReader(r) + } + _, err := io.ReadFull(z.r, z.scratch[0:2]) + if err != nil { + return err + } + h := uint(z.scratch[0])<<8 | uint(z.scratch[1]) + if (z.scratch[0]&0x0f != zlibDeflate) || (h%31 != 0) { + return ErrHeader + } + haveDict := z.scratch[1]&0x20 != 0 + if haveDict { + _, err = io.ReadFull(z.r, z.scratch[0:4]) + if err != nil { + return err + } + checksum := uint32(z.scratch[0])<<24 | uint32(z.scratch[1])<<16 | uint32(z.scratch[2])<<8 | uint32(z.scratch[3]) + if checksum != adler32.Checksum(dict) { + return ErrDictionary + } + } + if z.decompressor == nil { + if haveDict { + z.decompressor = flate.NewReaderDict(z.r, dict) + } else { + z.decompressor = flate.NewReader(z.r) + } + } else { + z.decompressor.(flate.Resetter).Reset(z.r, dict) + } + z.digest = adler32.New() + return nil +} diff --git a/src/compress/zlib/reader_test.go b/src/compress/zlib/reader_test.go new file mode 100644 index 0000000000000000000000000000000000000000..218ccba14110fcdcd0a64a778891c377d454284b --- /dev/null +++ b/src/compress/zlib/reader_test.go @@ -0,0 +1,127 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package zlib + +import ( + "bytes" + "io" + "testing" +) + +type zlibTest struct { + desc string + raw string + compressed []byte + dict []byte + err error +} + +// Compare-to-golden test data was generated by the ZLIB example program at +// http://www.zlib.net/zpipe.c + +var zlibTests = []zlibTest{ + { + "empty", + "", + []byte{0x78, 0x9c, 0x03, 0x00, 0x00, 0x00, 0x00, 0x01}, + nil, + nil, + }, + { + "goodbye", + "goodbye, world", + []byte{ + 0x78, 0x9c, 0x4b, 0xcf, 0xcf, 0x4f, 0x49, 0xaa, + 0x4c, 0xd5, 0x51, 0x28, 0xcf, 0x2f, 0xca, 0x49, + 0x01, 0x00, 0x28, 0xa5, 0x05, 0x5e, + }, + nil, + nil, + }, + { + "bad header", + "", + []byte{0x78, 0x9f, 0x03, 0x00, 0x00, 0x00, 0x00, 0x01}, + nil, + ErrHeader, + }, + { + "bad checksum", + "", + []byte{0x78, 0x9c, 0x03, 0x00, 0x00, 0x00, 0x00, 0xff}, + nil, + ErrChecksum, + }, + { + "not enough data", + "", + []byte{0x78, 0x9c, 0x03, 0x00, 0x00, 0x00}, + nil, + io.ErrUnexpectedEOF, + }, + { + "excess data is silently ignored", + "", + []byte{ + 0x78, 0x9c, 0x03, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x78, 0x9c, 0xff, + }, + nil, + nil, + }, + { + "dictionary", + "Hello, World!\n", + []byte{ + 0x78, 0xbb, 0x1c, 0x32, 0x04, 0x27, 0xf3, 0x00, + 0xb1, 0x75, 0x20, 0x1c, 0x45, 0x2e, 0x00, 0x24, + 0x12, 0x04, 0x74, + }, + []byte{ + 0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x20, 0x57, 0x6f, 0x72, 0x6c, 0x64, 0x0a, + }, + nil, + }, + { + "wrong dictionary", + "", + []byte{ + 0x78, 0xbb, 0x1c, 0x32, 0x04, 0x27, 0xf3, 0x00, + 0xb1, 0x75, 0x20, 0x1c, 0x45, 0x2e, 0x00, 0x24, + 0x12, 0x04, 0x74, + }, + []byte{ + 0x48, 0x65, 0x6c, 0x6c, + }, + ErrDictionary, + }, +} + +func TestDecompressor(t *testing.T) { + b := new(bytes.Buffer) + for _, tt := range zlibTests { + in := bytes.NewReader(tt.compressed) + zlib, err := NewReaderDict(in, tt.dict) + if err != nil { + if err != tt.err { + t.Errorf("%s: NewReader: %s", tt.desc, err) + } + continue + } + defer zlib.Close() + b.Reset() + n, err := io.Copy(b, zlib) + if err != nil { + if err != tt.err { + t.Errorf("%s: io.Copy: %v want %v", tt.desc, err, tt.err) + } + continue + } + s := b.String() + if s != tt.raw { + t.Errorf("%s: got %d-byte %q want %d-byte %q", tt.desc, n, s, len(tt.raw), tt.raw) + } + } +} diff --git a/src/compress/zlib/writer.go b/src/compress/zlib/writer.go new file mode 100644 index 0000000000000000000000000000000000000000..3b4313a8beaf56268629dc09664c4a3d3bcc3208 --- /dev/null +++ b/src/compress/zlib/writer.go @@ -0,0 +1,198 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package zlib + +import ( + "compress/flate" + "fmt" + "hash" + "hash/adler32" + "io" +) + +// These constants are copied from the flate package, so that code that imports +// "compress/zlib" does not also have to import "compress/flate". +const ( + NoCompression = flate.NoCompression + BestSpeed = flate.BestSpeed + BestCompression = flate.BestCompression + DefaultCompression = flate.DefaultCompression +) + +// A Writer takes data written to it and writes the compressed +// form of that data to an underlying writer (see NewWriter). +type Writer struct { + w io.Writer + level int + dict []byte + compressor *flate.Writer + digest hash.Hash32 + err error + scratch [4]byte + wroteHeader bool +} + +// NewWriter creates a new Writer. +// Writes to the returned Writer are compressed and written to w. +// +// It is the caller's responsibility to call Close on the WriteCloser when done. +// Writes may be buffered and not flushed until Close. +func NewWriter(w io.Writer) *Writer { + z, _ := NewWriterLevelDict(w, DefaultCompression, nil) + return z +} + +// NewWriterLevel is like NewWriter but specifies the compression level instead +// of assuming DefaultCompression. +// +// The compression level can be DefaultCompression, NoCompression, or any +// integer value between BestSpeed and BestCompression inclusive. The error +// returned will be nil if the level is valid. +func NewWriterLevel(w io.Writer, level int) (*Writer, error) { + return NewWriterLevelDict(w, level, nil) +} + +// NewWriterLevelDict is like NewWriterLevel but specifies a dictionary to +// compress with. +// +// The dictionary may be nil. If not, its contents should not be modified until +// the Writer is closed. +func NewWriterLevelDict(w io.Writer, level int, dict []byte) (*Writer, error) { + if level < DefaultCompression || level > BestCompression { + return nil, fmt.Errorf("zlib: invalid compression level: %d", level) + } + return &Writer{ + w: w, + level: level, + dict: dict, + }, nil +} + +// Reset clears the state of the Writer z such that it is equivalent to its +// initial state from NewWriterLevel or NewWriterLevelDict, but instead writing +// to w. +func (z *Writer) Reset(w io.Writer) { + z.w = w + // z.level and z.dict left unchanged. + if z.compressor != nil { + z.compressor.Reset(w) + } + if z.digest != nil { + z.digest.Reset() + } + z.err = nil + z.scratch = [4]byte{} + z.wroteHeader = false +} + +// writeHeader writes the ZLIB header. +func (z *Writer) writeHeader() (err error) { + z.wroteHeader = true + // ZLIB has a two-byte header (as documented in RFC 1950). + // The first four bits is the CINFO (compression info), which is 7 for the default deflate window size. + // The next four bits is the CM (compression method), which is 8 for deflate. + z.scratch[0] = 0x78 + // The next two bits is the FLEVEL (compression level). The four values are: + // 0=fastest, 1=fast, 2=default, 3=best. + // The next bit, FDICT, is set if a dictionary is given. + // The final five FCHECK bits form a mod-31 checksum. + switch z.level { + case 0, 1: + z.scratch[1] = 0 << 6 + case 2, 3, 4, 5: + z.scratch[1] = 1 << 6 + case 6, -1: + z.scratch[1] = 2 << 6 + case 7, 8, 9: + z.scratch[1] = 3 << 6 + default: + panic("unreachable") + } + if z.dict != nil { + z.scratch[1] |= 1 << 5 + } + z.scratch[1] += uint8(31 - (uint16(z.scratch[0])<<8+uint16(z.scratch[1]))%31) + if _, err = z.w.Write(z.scratch[0:2]); err != nil { + return err + } + if z.dict != nil { + // The next four bytes are the Adler-32 checksum of the dictionary. + checksum := adler32.Checksum(z.dict) + z.scratch[0] = uint8(checksum >> 24) + z.scratch[1] = uint8(checksum >> 16) + z.scratch[2] = uint8(checksum >> 8) + z.scratch[3] = uint8(checksum >> 0) + if _, err = z.w.Write(z.scratch[0:4]); err != nil { + return err + } + } + if z.compressor == nil { + // Initialize deflater unless the Writer is being reused + // after a Reset call. + z.compressor, err = flate.NewWriterDict(z.w, z.level, z.dict) + if err != nil { + return err + } + z.digest = adler32.New() + } + return nil +} + +// Write writes a compressed form of p to the underlying io.Writer. The +// compressed bytes are not necessarily flushed until the Writer is closed or +// explicitly flushed. +func (z *Writer) Write(p []byte) (n int, err error) { + if !z.wroteHeader { + z.err = z.writeHeader() + } + if z.err != nil { + return 0, z.err + } + if len(p) == 0 { + return 0, nil + } + n, err = z.compressor.Write(p) + if err != nil { + z.err = err + return + } + z.digest.Write(p) + return +} + +// Flush flushes the Writer to its underlying io.Writer. +func (z *Writer) Flush() error { + if !z.wroteHeader { + z.err = z.writeHeader() + } + if z.err != nil { + return z.err + } + z.err = z.compressor.Flush() + return z.err +} + +// Close closes the Writer, flushing any unwritten data to the underlying +// io.Writer, but does not close the underlying io.Writer. +func (z *Writer) Close() error { + if !z.wroteHeader { + z.err = z.writeHeader() + } + if z.err != nil { + return z.err + } + z.err = z.compressor.Close() + if z.err != nil { + return z.err + } + checksum := z.digest.Sum32() + // ZLIB (RFC 1950) is big-endian, unlike GZIP (RFC 1952). + z.scratch[0] = uint8(checksum >> 24) + z.scratch[1] = uint8(checksum >> 16) + z.scratch[2] = uint8(checksum >> 8) + z.scratch[3] = uint8(checksum >> 0) + _, z.err = z.w.Write(z.scratch[0:4]) + return z.err +} diff --git a/src/compress/zlib/writer_test.go b/src/compress/zlib/writer_test.go new file mode 100644 index 0000000000000000000000000000000000000000..71ba81aaa764b5a471ae06a9b903692b4f3c1a1f --- /dev/null +++ b/src/compress/zlib/writer_test.go @@ -0,0 +1,205 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package zlib + +import ( + "bytes" + "fmt" + "io" + "io/ioutil" + "os" + "testing" +) + +var filenames = []string{ + "../testdata/e.txt", + "../testdata/pi.txt", +} + +var data = []string{ + "test a reasonable sized string that can be compressed", +} + +// Tests that compressing and then decompressing the given file at the given compression level and dictionary +// yields equivalent bytes to the original file. +func testFileLevelDict(t *testing.T, fn string, level int, d string) { + // Read the file, as golden output. + golden, err := os.Open(fn) + if err != nil { + t.Errorf("%s (level=%d, dict=%q): %v", fn, level, d, err) + return + } + defer golden.Close() + b0, err0 := ioutil.ReadAll(golden) + if err0 != nil { + t.Errorf("%s (level=%d, dict=%q): %v", fn, level, d, err0) + return + } + testLevelDict(t, fn, b0, level, d) +} + +func testLevelDict(t *testing.T, fn string, b0 []byte, level int, d string) { + // Make dictionary, if given. + var dict []byte + if d != "" { + dict = []byte(d) + } + + // Push data through a pipe that compresses at the write end, and decompresses at the read end. + piper, pipew := io.Pipe() + defer piper.Close() + go func() { + defer pipew.Close() + zlibw, err := NewWriterLevelDict(pipew, level, dict) + if err != nil { + t.Errorf("%s (level=%d, dict=%q): %v", fn, level, d, err) + return + } + defer zlibw.Close() + _, err = zlibw.Write(b0) + if err != nil { + t.Errorf("%s (level=%d, dict=%q): %v", fn, level, d, err) + return + } + }() + zlibr, err := NewReaderDict(piper, dict) + if err != nil { + t.Errorf("%s (level=%d, dict=%q): %v", fn, level, d, err) + return + } + defer zlibr.Close() + + // Compare the decompressed data. + b1, err1 := ioutil.ReadAll(zlibr) + if err1 != nil { + t.Errorf("%s (level=%d, dict=%q): %v", fn, level, d, err1) + return + } + if len(b0) != len(b1) { + t.Errorf("%s (level=%d, dict=%q): length mismatch %d versus %d", fn, level, d, len(b0), len(b1)) + return + } + for i := 0; i < len(b0); i++ { + if b0[i] != b1[i] { + t.Errorf("%s (level=%d, dict=%q): mismatch at %d, 0x%02x versus 0x%02x\n", fn, level, d, i, b0[i], b1[i]) + return + } + } +} + +func testFileLevelDictReset(t *testing.T, fn string, level int, dict []byte) { + var b0 []byte + var err error + if fn != "" { + b0, err = ioutil.ReadFile(fn) + if err != nil { + t.Errorf("%s (level=%d): %v", fn, level, err) + return + } + } + + // Compress once. + buf := new(bytes.Buffer) + var zlibw *Writer + if dict == nil { + zlibw, err = NewWriterLevel(buf, level) + } else { + zlibw, err = NewWriterLevelDict(buf, level, dict) + } + if err == nil { + _, err = zlibw.Write(b0) + } + if err == nil { + err = zlibw.Close() + } + if err != nil { + t.Errorf("%s (level=%d): %v", fn, level, err) + return + } + out := buf.String() + + // Reset and compress again. + buf2 := new(bytes.Buffer) + zlibw.Reset(buf2) + _, err = zlibw.Write(b0) + if err == nil { + err = zlibw.Close() + } + if err != nil { + t.Errorf("%s (level=%d): %v", fn, level, err) + return + } + out2 := buf2.String() + + if out2 != out { + t.Errorf("%s (level=%d): different output after reset (got %d bytes, expected %d", + fn, level, len(out2), len(out)) + } +} + +func TestWriter(t *testing.T) { + for i, s := range data { + b := []byte(s) + tag := fmt.Sprintf("#%d", i) + testLevelDict(t, tag, b, DefaultCompression, "") + testLevelDict(t, tag, b, NoCompression, "") + for level := BestSpeed; level <= BestCompression; level++ { + testLevelDict(t, tag, b, level, "") + } + } +} + +func TestWriterBig(t *testing.T) { + for _, fn := range filenames { + testFileLevelDict(t, fn, DefaultCompression, "") + testFileLevelDict(t, fn, NoCompression, "") + for level := BestSpeed; level <= BestCompression; level++ { + testFileLevelDict(t, fn, level, "") + } + } +} + +func TestWriterDict(t *testing.T) { + const dictionary = "0123456789." + for _, fn := range filenames { + testFileLevelDict(t, fn, DefaultCompression, dictionary) + testFileLevelDict(t, fn, NoCompression, dictionary) + for level := BestSpeed; level <= BestCompression; level++ { + testFileLevelDict(t, fn, level, dictionary) + } + } +} + +func TestWriterReset(t *testing.T) { + const dictionary = "0123456789." + for _, fn := range filenames { + testFileLevelDictReset(t, fn, NoCompression, nil) + testFileLevelDictReset(t, fn, DefaultCompression, nil) + testFileLevelDictReset(t, fn, NoCompression, []byte(dictionary)) + testFileLevelDictReset(t, fn, DefaultCompression, []byte(dictionary)) + if !testing.Short() { + for level := BestSpeed; level <= BestCompression; level++ { + testFileLevelDictReset(t, fn, level, nil) + } + } + } +} + +func TestWriterDictIsUsed(t *testing.T) { + var input = []byte("Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.") + var buf bytes.Buffer + compressor, err := NewWriterLevelDict(&buf, BestCompression, input) + if err != nil { + t.Errorf("error in NewWriterLevelDict: %s", err) + return + } + compressor.Write(input) + compressor.Close() + const expectedMaxSize = 25 + output := buf.Bytes() + if len(output) > expectedMaxSize { + t.Errorf("result too large (got %d, want <= %d bytes). Is the dictionary being used?", len(output), expectedMaxSize) + } +} diff --git a/src/container/heap/example_intheap_test.go b/src/container/heap/example_intheap_test.go new file mode 100644 index 0000000000000000000000000000000000000000..02d3d8668ee01c84aa7338c8c6f3a60769843305 --- /dev/null +++ b/src/container/heap/example_intheap_test.go @@ -0,0 +1,47 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// This example demonstrates an integer heap built using the heap interface. +package heap_test + +import ( + "container/heap" + "fmt" +) + +// An IntHeap is a min-heap of ints. +type IntHeap []int + +func (h IntHeap) Len() int { return len(h) } +func (h IntHeap) Less(i, j int) bool { return h[i] < h[j] } +func (h IntHeap) Swap(i, j int) { h[i], h[j] = h[j], h[i] } + +func (h *IntHeap) Push(x interface{}) { + // Push and Pop use pointer receivers because they modify the slice's length, + // not just its contents. + *h = append(*h, x.(int)) +} + +func (h *IntHeap) Pop() interface{} { + old := *h + n := len(old) + x := old[n-1] + *h = old[0 : n-1] + return x +} + +// This example inserts several ints into an IntHeap, checks the minimum, +// and removes them in order of priority. +func Example_intHeap() { + h := &IntHeap{2, 1, 5} + heap.Init(h) + heap.Push(h, 3) + fmt.Printf("minimum: %d\n", (*h)[0]) + for h.Len() > 0 { + fmt.Printf("%d ", heap.Pop(h)) + } + // Output: + // minimum: 1 + // 1 2 3 5 +} diff --git a/src/container/heap/example_pq_test.go b/src/container/heap/example_pq_test.go new file mode 100644 index 0000000000000000000000000000000000000000..7017095cb8496316e03ef96f09a28d45b9c0b4fd --- /dev/null +++ b/src/container/heap/example_pq_test.go @@ -0,0 +1,97 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// This example demonstrates a priority queue built using the heap interface. +package heap_test + +import ( + "container/heap" + "fmt" +) + +// An Item is something we manage in a priority queue. +type Item struct { + value string // The value of the item; arbitrary. + priority int // The priority of the item in the queue. + // The index is needed by update and is maintained by the heap.Interface methods. + index int // The index of the item in the heap. +} + +// A PriorityQueue implements heap.Interface and holds Items. +type PriorityQueue []*Item + +func (pq PriorityQueue) Len() int { return len(pq) } + +func (pq PriorityQueue) Less(i, j int) bool { + // We want Pop to give us the highest, not lowest, priority so we use greater than here. + return pq[i].priority > pq[j].priority +} + +func (pq PriorityQueue) Swap(i, j int) { + pq[i], pq[j] = pq[j], pq[i] + pq[i].index = i + pq[j].index = j +} + +func (pq *PriorityQueue) Push(x interface{}) { + n := len(*pq) + item := x.(*Item) + item.index = n + *pq = append(*pq, item) +} + +func (pq *PriorityQueue) Pop() interface{} { + old := *pq + n := len(old) + item := old[n-1] + item.index = -1 // for safety + *pq = old[0 : n-1] + return item +} + +// update modifies the priority and value of an Item in the queue. +func (pq *PriorityQueue) update(item *Item, value string, priority int) { + item.value = value + item.priority = priority + heap.Fix(pq, item.index) +} + +// This example creates a PriorityQueue with some items, adds and manipulates an item, +// and then removes the items in priority order. +func Example_priorityQueue() { + // Some items and their priorities. + items := map[string]int{ + "banana": 3, "apple": 2, "pear": 4, + } + + // Create a priority queue, put the items in it, and + // establish the priority queue (heap) invariants. + pq := make(PriorityQueue, len(items)) + i := 0 + for value, priority := range items { + pq[i] = &Item{ + value: value, + priority: priority, + index: i, + } + i++ + } + heap.Init(&pq) + + // Insert a new item and then modify its priority. + item := &Item{ + value: "orange", + priority: 1, + } + heap.Push(&pq, item) + pq.update(item, item.value, 5) + + // Take the items out; they arrive in decreasing priority order. + for pq.Len() > 0 { + item := heap.Pop(&pq).(*Item) + fmt.Printf("%.2d:%s ", item.priority, item.value) + } + // Output: + // 05:orange 04:pear 03:banana 02:apple +} diff --git a/src/container/heap/heap.go b/src/container/heap/heap.go new file mode 100644 index 0000000000000000000000000000000000000000..c467a11910c9f5e395d30c75c7078fbdcf53c574 --- /dev/null +++ b/src/container/heap/heap.go @@ -0,0 +1,117 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package heap provides heap operations for any type that implements +// heap.Interface. A heap is a tree with the property that each node is the +// minimum-valued node in its subtree. +// +// The minimum element in the tree is the root, at index 0. +// +// A heap is a common way to implement a priority queue. To build a priority +// queue, implement the Heap interface with the (negative) priority as the +// ordering for the Less method, so Push adds items while Pop removes the +// highest-priority item from the queue. The Examples include such an +// implementation; the file example_pq_test.go has the complete source. +// +package heap + +import "sort" + +// Any type that implements heap.Interface may be used as a +// min-heap with the following invariants (established after +// Init has been called or if the data is empty or sorted): +// +// !h.Less(j, i) for 0 <= i < h.Len() and 2*i+1 <= j <= 2*i+2 and j < h.Len() +// +// Note that Push and Pop in this interface are for package heap's +// implementation to call. To add and remove things from the heap, +// use heap.Push and heap.Pop. +type Interface interface { + sort.Interface + Push(x interface{}) // add x as element Len() + Pop() interface{} // remove and return element Len() - 1. +} + +// A heap must be initialized before any of the heap operations +// can be used. Init is idempotent with respect to the heap invariants +// and may be called whenever the heap invariants may have been invalidated. +// Its complexity is O(n) where n = h.Len(). +// +func Init(h Interface) { + // heapify + n := h.Len() + for i := n/2 - 1; i >= 0; i-- { + down(h, i, n) + } +} + +// Push pushes the element x onto the heap. The complexity is +// O(log(n)) where n = h.Len(). +// +func Push(h Interface, x interface{}) { + h.Push(x) + up(h, h.Len()-1) +} + +// Pop removes the minimum element (according to Less) from the heap +// and returns it. The complexity is O(log(n)) where n = h.Len(). +// It is equivalent to Remove(h, 0). +// +func Pop(h Interface) interface{} { + n := h.Len() - 1 + h.Swap(0, n) + down(h, 0, n) + return h.Pop() +} + +// Remove removes the element at index i from the heap. +// The complexity is O(log(n)) where n = h.Len(). +// +func Remove(h Interface, i int) interface{} { + n := h.Len() - 1 + if n != i { + h.Swap(i, n) + down(h, i, n) + up(h, i) + } + return h.Pop() +} + +// Fix re-establishes the heap ordering after the element at index i has changed its value. +// Changing the value of the element at index i and then calling Fix is equivalent to, +// but less expensive than, calling Remove(h, i) followed by a Push of the new value. +// The complexity is O(log(n)) where n = h.Len(). +func Fix(h Interface, i int) { + down(h, i, h.Len()) + up(h, i) +} + +func up(h Interface, j int) { + for { + i := (j - 1) / 2 // parent + if i == j || !h.Less(j, i) { + break + } + h.Swap(i, j) + j = i + } +} + +func down(h Interface, i, n int) { + for { + j1 := 2*i + 1 + if j1 >= n || j1 < 0 { // j1 < 0 after int overflow + break + } + j := j1 // left child + if j2 := j1 + 1; j2 < n && !h.Less(j1, j2) { + j = j2 // = 2*i + 2 // right child + } + if !h.Less(j, i) { + break + } + h.Swap(i, j) + i = j + } +} diff --git a/src/container/heap/heap_test.go b/src/container/heap/heap_test.go new file mode 100644 index 0000000000000000000000000000000000000000..b3d054c5f39783e3832ec3d68d15431caa9651a0 --- /dev/null +++ b/src/container/heap/heap_test.go @@ -0,0 +1,213 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package heap + +import ( + "math/rand" + "testing" +) + +type myHeap []int + +func (h *myHeap) Less(i, j int) bool { + return (*h)[i] < (*h)[j] +} + +func (h *myHeap) Swap(i, j int) { + (*h)[i], (*h)[j] = (*h)[j], (*h)[i] +} + +func (h *myHeap) Len() int { + return len(*h) +} + +func (h *myHeap) Pop() (v interface{}) { + *h, v = (*h)[:h.Len()-1], (*h)[h.Len()-1] + return +} + +func (h *myHeap) Push(v interface{}) { + *h = append(*h, v.(int)) +} + +func (h myHeap) verify(t *testing.T, i int) { + n := h.Len() + j1 := 2*i + 1 + j2 := 2*i + 2 + if j1 < n { + if h.Less(j1, i) { + t.Errorf("heap invariant invalidated [%d] = %d > [%d] = %d", i, h[i], j1, h[j1]) + return + } + h.verify(t, j1) + } + if j2 < n { + if h.Less(j2, i) { + t.Errorf("heap invariant invalidated [%d] = %d > [%d] = %d", i, h[i], j1, h[j2]) + return + } + h.verify(t, j2) + } +} + +func TestInit0(t *testing.T) { + h := new(myHeap) + for i := 20; i > 0; i-- { + h.Push(0) // all elements are the same + } + Init(h) + h.verify(t, 0) + + for i := 1; h.Len() > 0; i++ { + x := Pop(h).(int) + h.verify(t, 0) + if x != 0 { + t.Errorf("%d.th pop got %d; want %d", i, x, 0) + } + } +} + +func TestInit1(t *testing.T) { + h := new(myHeap) + for i := 20; i > 0; i-- { + h.Push(i) // all elements are different + } + Init(h) + h.verify(t, 0) + + for i := 1; h.Len() > 0; i++ { + x := Pop(h).(int) + h.verify(t, 0) + if x != i { + t.Errorf("%d.th pop got %d; want %d", i, x, i) + } + } +} + +func Test(t *testing.T) { + h := new(myHeap) + h.verify(t, 0) + + for i := 20; i > 10; i-- { + h.Push(i) + } + Init(h) + h.verify(t, 0) + + for i := 10; i > 0; i-- { + Push(h, i) + h.verify(t, 0) + } + + for i := 1; h.Len() > 0; i++ { + x := Pop(h).(int) + if i < 20 { + Push(h, 20+i) + } + h.verify(t, 0) + if x != i { + t.Errorf("%d.th pop got %d; want %d", i, x, i) + } + } +} + +func TestRemove0(t *testing.T) { + h := new(myHeap) + for i := 0; i < 10; i++ { + h.Push(i) + } + h.verify(t, 0) + + for h.Len() > 0 { + i := h.Len() - 1 + x := Remove(h, i).(int) + if x != i { + t.Errorf("Remove(%d) got %d; want %d", i, x, i) + } + h.verify(t, 0) + } +} + +func TestRemove1(t *testing.T) { + h := new(myHeap) + for i := 0; i < 10; i++ { + h.Push(i) + } + h.verify(t, 0) + + for i := 0; h.Len() > 0; i++ { + x := Remove(h, 0).(int) + if x != i { + t.Errorf("Remove(0) got %d; want %d", x, i) + } + h.verify(t, 0) + } +} + +func TestRemove2(t *testing.T) { + N := 10 + + h := new(myHeap) + for i := 0; i < N; i++ { + h.Push(i) + } + h.verify(t, 0) + + m := make(map[int]bool) + for h.Len() > 0 { + m[Remove(h, (h.Len()-1)/2).(int)] = true + h.verify(t, 0) + } + + if len(m) != N { + t.Errorf("len(m) = %d; want %d", len(m), N) + } + for i := 0; i < len(m); i++ { + if !m[i] { + t.Errorf("m[%d] doesn't exist", i) + } + } +} + +func BenchmarkDup(b *testing.B) { + const n = 10000 + h := make(myHeap, n) + for i := 0; i < b.N; i++ { + for j := 0; j < n; j++ { + Push(&h, 0) // all elements are the same + } + for h.Len() > 0 { + Pop(&h) + } + } +} + +func TestFix(t *testing.T) { + h := new(myHeap) + h.verify(t, 0) + + for i := 200; i > 0; i -= 10 { + Push(h, i) + } + h.verify(t, 0) + + if (*h)[0] != 10 { + t.Fatalf("Expected head to be 10, was %d", (*h)[0]) + } + (*h)[0] = 210 + Fix(h, 0) + h.verify(t, 0) + + for i := 100; i > 0; i-- { + elem := rand.Intn(h.Len()) + if i&1 == 0 { + (*h)[elem] *= 2 + } else { + (*h)[elem] /= 2 + } + Fix(h, elem) + h.verify(t, 0) + } +} diff --git a/src/container/list/example_test.go b/src/container/list/example_test.go new file mode 100644 index 0000000000000000000000000000000000000000..362178401716d7ffffa896ed0b044ef04ecc1541 --- /dev/null +++ b/src/container/list/example_test.go @@ -0,0 +1,30 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package list_test + +import ( + "container/list" + "fmt" +) + +func Example() { + // Create a new list and put some numbers in it. + l := list.New() + e4 := l.PushBack(4) + e1 := l.PushFront(1) + l.InsertBefore(3, e4) + l.InsertAfter(2, e1) + + // Iterate through list and print its contents. + for e := l.Front(); e != nil; e = e.Next() { + fmt.Println(e.Value) + } + + // Output: + // 1 + // 2 + // 3 + // 4 +} diff --git a/src/container/list/list.go b/src/container/list/list.go new file mode 100644 index 0000000000000000000000000000000000000000..0256768efe58adab88c3a89a60946b606e6336a0 --- /dev/null +++ b/src/container/list/list.go @@ -0,0 +1,216 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package list implements a doubly linked list. +// +// To iterate over a list (where l is a *List): +// for e := l.Front(); e != nil; e = e.Next() { +// // do something with e.Value +// } +// +package list + +// Element is an element of a linked list. +type Element struct { + // Next and previous pointers in the doubly-linked list of elements. + // To simplify the implementation, internally a list l is implemented + // as a ring, such that &l.root is both the next element of the last + // list element (l.Back()) and the previous element of the first list + // element (l.Front()). + next, prev *Element + + // The list to which this element belongs. + list *List + + // The value stored with this element. + Value interface{} +} + +// Next returns the next list element or nil. +func (e *Element) Next() *Element { + if p := e.next; e.list != nil && p != &e.list.root { + return p + } + return nil +} + +// Prev returns the previous list element or nil. +func (e *Element) Prev() *Element { + if p := e.prev; e.list != nil && p != &e.list.root { + return p + } + return nil +} + +// List represents a doubly linked list. +// The zero value for List is an empty list ready to use. +type List struct { + root Element // sentinel list element, only &root, root.prev, and root.next are used + len int // current list length excluding (this) sentinel element +} + +// Init initializes or clears list l. +func (l *List) Init() *List { + l.root.next = &l.root + l.root.prev = &l.root + l.len = 0 + return l +} + +// New returns an initialized list. +func New() *List { return new(List).Init() } + +// Len returns the number of elements of list l. +// The complexity is O(1). +func (l *List) Len() int { return l.len } + +// Front returns the first element of list l or nil. +func (l *List) Front() *Element { + if l.len == 0 { + return nil + } + return l.root.next +} + +// Back returns the last element of list l or nil. +func (l *List) Back() *Element { + if l.len == 0 { + return nil + } + return l.root.prev +} + +// lazyInit lazily initializes a zero List value. +func (l *List) lazyInit() { + if l.root.next == nil { + l.Init() + } +} + +// insert inserts e after at, increments l.len, and returns e. +func (l *List) insert(e, at *Element) *Element { + n := at.next + at.next = e + e.prev = at + e.next = n + n.prev = e + e.list = l + l.len++ + return e +} + +// insertValue is a convenience wrapper for insert(&Element{Value: v}, at). +func (l *List) insertValue(v interface{}, at *Element) *Element { + return l.insert(&Element{Value: v}, at) +} + +// remove removes e from its list, decrements l.len, and returns e. +func (l *List) remove(e *Element) *Element { + e.prev.next = e.next + e.next.prev = e.prev + e.next = nil // avoid memory leaks + e.prev = nil // avoid memory leaks + e.list = nil + l.len-- + return e +} + +// Remove removes e from l if e is an element of list l. +// It returns the element value e.Value. +func (l *List) Remove(e *Element) interface{} { + if e.list == l { + // if e.list == l, l must have been initialized when e was inserted + // in l or l == nil (e is a zero Element) and l.remove will crash + l.remove(e) + } + return e.Value +} + +// PushFront inserts a new element e with value v at the front of list l and returns e. +func (l *List) PushFront(v interface{}) *Element { + l.lazyInit() + return l.insertValue(v, &l.root) +} + +// PushBack inserts a new element e with value v at the back of list l and returns e. +func (l *List) PushBack(v interface{}) *Element { + l.lazyInit() + return l.insertValue(v, l.root.prev) +} + +// InsertBefore inserts a new element e with value v immediately before mark and returns e. +// If mark is not an element of l, the list is not modified. +func (l *List) InsertBefore(v interface{}, mark *Element) *Element { + if mark.list != l { + return nil + } + // see comment in List.Remove about initialization of l + return l.insertValue(v, mark.prev) +} + +// InsertAfter inserts a new element e with value v immediately after mark and returns e. +// If mark is not an element of l, the list is not modified. +func (l *List) InsertAfter(v interface{}, mark *Element) *Element { + if mark.list != l { + return nil + } + // see comment in List.Remove about initialization of l + return l.insertValue(v, mark) +} + +// MoveToFront moves element e to the front of list l. +// If e is not an element of l, the list is not modified. +func (l *List) MoveToFront(e *Element) { + if e.list != l || l.root.next == e { + return + } + // see comment in List.Remove about initialization of l + l.insert(l.remove(e), &l.root) +} + +// MoveToBack moves element e to the back of list l. +// If e is not an element of l, the list is not modified. +func (l *List) MoveToBack(e *Element) { + if e.list != l || l.root.prev == e { + return + } + // see comment in List.Remove about initialization of l + l.insert(l.remove(e), l.root.prev) +} + +// MoveBefore moves element e to its new position before mark. +// If e or mark is not an element of l, or e == mark, the list is not modified. +func (l *List) MoveBefore(e, mark *Element) { + if e.list != l || e == mark || mark.list != l { + return + } + l.insert(l.remove(e), mark.prev) +} + +// MoveAfter moves element e to its new position after mark. +// If e or mark is not an element of l, or e == mark, the list is not modified. +func (l *List) MoveAfter(e, mark *Element) { + if e.list != l || e == mark || mark.list != l { + return + } + l.insert(l.remove(e), mark) +} + +// PushBackList inserts a copy of an other list at the back of list l. +// The lists l and other may be the same. +func (l *List) PushBackList(other *List) { + l.lazyInit() + for i, e := other.Len(), other.Front(); i > 0; i, e = i-1, e.Next() { + l.insertValue(e.Value, l.root.prev) + } +} + +// PushFrontList inserts a copy of an other list at the front of list l. +// The lists l and other may be the same. +func (l *List) PushFrontList(other *List) { + l.lazyInit() + for i, e := other.Len(), other.Back(); i > 0; i, e = i-1, e.Prev() { + l.insertValue(e.Value, &l.root) + } +} diff --git a/src/container/list/list_test.go b/src/container/list/list_test.go new file mode 100644 index 0000000000000000000000000000000000000000..4d8bfc2bf0791bd6148420e374e306e1a0dd3beb --- /dev/null +++ b/src/container/list/list_test.go @@ -0,0 +1,343 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package list + +import "testing" + +func checkListLen(t *testing.T, l *List, len int) bool { + if n := l.Len(); n != len { + t.Errorf("l.Len() = %d, want %d", n, len) + return false + } + return true +} + +func checkListPointers(t *testing.T, l *List, es []*Element) { + root := &l.root + + if !checkListLen(t, l, len(es)) { + return + } + + // zero length lists must be the zero value or properly initialized (sentinel circle) + if len(es) == 0 { + if l.root.next != nil && l.root.next != root || l.root.prev != nil && l.root.prev != root { + t.Errorf("l.root.next = %p, l.root.prev = %p; both should both be nil or %p", l.root.next, l.root.prev, root) + } + return + } + // len(es) > 0 + + // check internal and external prev/next connections + for i, e := range es { + prev := root + Prev := (*Element)(nil) + if i > 0 { + prev = es[i-1] + Prev = prev + } + if p := e.prev; p != prev { + t.Errorf("elt[%d](%p).prev = %p, want %p", i, e, p, prev) + } + if p := e.Prev(); p != Prev { + t.Errorf("elt[%d](%p).Prev() = %p, want %p", i, e, p, Prev) + } + + next := root + Next := (*Element)(nil) + if i < len(es)-1 { + next = es[i+1] + Next = next + } + if n := e.next; n != next { + t.Errorf("elt[%d](%p).next = %p, want %p", i, e, n, next) + } + if n := e.Next(); n != Next { + t.Errorf("elt[%d](%p).Next() = %p, want %p", i, e, n, Next) + } + } +} + +func TestList(t *testing.T) { + l := New() + checkListPointers(t, l, []*Element{}) + + // Single element list + e := l.PushFront("a") + checkListPointers(t, l, []*Element{e}) + l.MoveToFront(e) + checkListPointers(t, l, []*Element{e}) + l.MoveToBack(e) + checkListPointers(t, l, []*Element{e}) + l.Remove(e) + checkListPointers(t, l, []*Element{}) + + // Bigger list + e2 := l.PushFront(2) + e1 := l.PushFront(1) + e3 := l.PushBack(3) + e4 := l.PushBack("banana") + checkListPointers(t, l, []*Element{e1, e2, e3, e4}) + + l.Remove(e2) + checkListPointers(t, l, []*Element{e1, e3, e4}) + + l.MoveToFront(e3) // move from middle + checkListPointers(t, l, []*Element{e3, e1, e4}) + + l.MoveToFront(e1) + l.MoveToBack(e3) // move from middle + checkListPointers(t, l, []*Element{e1, e4, e3}) + + l.MoveToFront(e3) // move from back + checkListPointers(t, l, []*Element{e3, e1, e4}) + l.MoveToFront(e3) // should be no-op + checkListPointers(t, l, []*Element{e3, e1, e4}) + + l.MoveToBack(e3) // move from front + checkListPointers(t, l, []*Element{e1, e4, e3}) + l.MoveToBack(e3) // should be no-op + checkListPointers(t, l, []*Element{e1, e4, e3}) + + e2 = l.InsertBefore(2, e1) // insert before front + checkListPointers(t, l, []*Element{e2, e1, e4, e3}) + l.Remove(e2) + e2 = l.InsertBefore(2, e4) // insert before middle + checkListPointers(t, l, []*Element{e1, e2, e4, e3}) + l.Remove(e2) + e2 = l.InsertBefore(2, e3) // insert before back + checkListPointers(t, l, []*Element{e1, e4, e2, e3}) + l.Remove(e2) + + e2 = l.InsertAfter(2, e1) // insert after front + checkListPointers(t, l, []*Element{e1, e2, e4, e3}) + l.Remove(e2) + e2 = l.InsertAfter(2, e4) // insert after middle + checkListPointers(t, l, []*Element{e1, e4, e2, e3}) + l.Remove(e2) + e2 = l.InsertAfter(2, e3) // insert after back + checkListPointers(t, l, []*Element{e1, e4, e3, e2}) + l.Remove(e2) + + // Check standard iteration. + sum := 0 + for e := l.Front(); e != nil; e = e.Next() { + if i, ok := e.Value.(int); ok { + sum += i + } + } + if sum != 4 { + t.Errorf("sum over l = %d, want 4", sum) + } + + // Clear all elements by iterating + var next *Element + for e := l.Front(); e != nil; e = next { + next = e.Next() + l.Remove(e) + } + checkListPointers(t, l, []*Element{}) +} + +func checkList(t *testing.T, l *List, es []interface{}) { + if !checkListLen(t, l, len(es)) { + return + } + + i := 0 + for e := l.Front(); e != nil; e = e.Next() { + le := e.Value.(int) + if le != es[i] { + t.Errorf("elt[%d].Value = %v, want %v", i, le, es[i]) + } + i++ + } +} + +func TestExtending(t *testing.T) { + l1 := New() + l2 := New() + + l1.PushBack(1) + l1.PushBack(2) + l1.PushBack(3) + + l2.PushBack(4) + l2.PushBack(5) + + l3 := New() + l3.PushBackList(l1) + checkList(t, l3, []interface{}{1, 2, 3}) + l3.PushBackList(l2) + checkList(t, l3, []interface{}{1, 2, 3, 4, 5}) + + l3 = New() + l3.PushFrontList(l2) + checkList(t, l3, []interface{}{4, 5}) + l3.PushFrontList(l1) + checkList(t, l3, []interface{}{1, 2, 3, 4, 5}) + + checkList(t, l1, []interface{}{1, 2, 3}) + checkList(t, l2, []interface{}{4, 5}) + + l3 = New() + l3.PushBackList(l1) + checkList(t, l3, []interface{}{1, 2, 3}) + l3.PushBackList(l3) + checkList(t, l3, []interface{}{1, 2, 3, 1, 2, 3}) + + l3 = New() + l3.PushFrontList(l1) + checkList(t, l3, []interface{}{1, 2, 3}) + l3.PushFrontList(l3) + checkList(t, l3, []interface{}{1, 2, 3, 1, 2, 3}) + + l3 = New() + l1.PushBackList(l3) + checkList(t, l1, []interface{}{1, 2, 3}) + l1.PushFrontList(l3) + checkList(t, l1, []interface{}{1, 2, 3}) +} + +func TestRemove(t *testing.T) { + l := New() + e1 := l.PushBack(1) + e2 := l.PushBack(2) + checkListPointers(t, l, []*Element{e1, e2}) + e := l.Front() + l.Remove(e) + checkListPointers(t, l, []*Element{e2}) + l.Remove(e) + checkListPointers(t, l, []*Element{e2}) +} + +func TestIssue4103(t *testing.T) { + l1 := New() + l1.PushBack(1) + l1.PushBack(2) + + l2 := New() + l2.PushBack(3) + l2.PushBack(4) + + e := l1.Front() + l2.Remove(e) // l2 should not change because e is not an element of l2 + if n := l2.Len(); n != 2 { + t.Errorf("l2.Len() = %d, want 2", n) + } + + l1.InsertBefore(8, e) + if n := l1.Len(); n != 3 { + t.Errorf("l1.Len() = %d, want 3", n) + } +} + +func TestIssue6349(t *testing.T) { + l := New() + l.PushBack(1) + l.PushBack(2) + + e := l.Front() + l.Remove(e) + if e.Value != 1 { + t.Errorf("e.value = %d, want 1", e.Value) + } + if e.Next() != nil { + t.Errorf("e.Next() != nil") + } + if e.Prev() != nil { + t.Errorf("e.Prev() != nil") + } +} + +func TestMove(t *testing.T) { + l := New() + e1 := l.PushBack(1) + e2 := l.PushBack(2) + e3 := l.PushBack(3) + e4 := l.PushBack(4) + + l.MoveAfter(e3, e3) + checkListPointers(t, l, []*Element{e1, e2, e3, e4}) + l.MoveBefore(e2, e2) + checkListPointers(t, l, []*Element{e1, e2, e3, e4}) + + l.MoveAfter(e3, e2) + checkListPointers(t, l, []*Element{e1, e2, e3, e4}) + l.MoveBefore(e2, e3) + checkListPointers(t, l, []*Element{e1, e2, e3, e4}) + + l.MoveBefore(e2, e4) + checkListPointers(t, l, []*Element{e1, e3, e2, e4}) + e1, e2, e3, e4 = e1, e3, e2, e4 + + l.MoveBefore(e4, e1) + checkListPointers(t, l, []*Element{e4, e1, e2, e3}) + e1, e2, e3, e4 = e4, e1, e2, e3 + + l.MoveAfter(e4, e1) + checkListPointers(t, l, []*Element{e1, e4, e2, e3}) + e1, e2, e3, e4 = e1, e4, e2, e3 + + l.MoveAfter(e2, e3) + checkListPointers(t, l, []*Element{e1, e3, e2, e4}) + e1, e2, e3, e4 = e1, e3, e2, e4 +} + +// Test PushFront, PushBack, PushFrontList, PushBackList with uninitialized List +func TestZeroList(t *testing.T) { + var l1 = new(List) + l1.PushFront(1) + checkList(t, l1, []interface{}{1}) + + var l2 = new(List) + l2.PushBack(1) + checkList(t, l2, []interface{}{1}) + + var l3 = new(List) + l3.PushFrontList(l1) + checkList(t, l3, []interface{}{1}) + + var l4 = new(List) + l4.PushBackList(l2) + checkList(t, l4, []interface{}{1}) +} + +// Test that a list l is not modified when calling InsertBefore with a mark that is not an element of l. +func TestInsertBeforeUnknownMark(t *testing.T) { + var l List + l.PushBack(1) + l.PushBack(2) + l.PushBack(3) + l.InsertBefore(1, new(Element)) + checkList(t, &l, []interface{}{1, 2, 3}) +} + +// Test that a list l is not modified when calling InsertAfter with a mark that is not an element of l. +func TestInsertAfterUnknownMark(t *testing.T) { + var l List + l.PushBack(1) + l.PushBack(2) + l.PushBack(3) + l.InsertAfter(1, new(Element)) + checkList(t, &l, []interface{}{1, 2, 3}) +} + +// Test that a list l is not modified when calling MoveAfter or MoveBefore with a mark that is not an element of l. +func TestMoveUnkownMark(t *testing.T) { + var l1 List + e1 := l1.PushBack(1) + + var l2 List + e2 := l2.PushBack(2) + + l1.MoveAfter(e1, e2) + checkList(t, &l1, []interface{}{1}) + checkList(t, &l2, []interface{}{2}) + + l1.MoveBefore(e1, e2) + checkList(t, &l1, []interface{}{1}) + checkList(t, &l2, []interface{}{2}) +} diff --git a/src/container/ring/ring.go b/src/container/ring/ring.go new file mode 100644 index 0000000000000000000000000000000000000000..6d3b3e5b322266bd5bebc90f949c564947ff9fa8 --- /dev/null +++ b/src/container/ring/ring.go @@ -0,0 +1,141 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package ring implements operations on circular lists. +package ring + +// A Ring is an element of a circular list, or ring. +// Rings do not have a beginning or end; a pointer to any ring element +// serves as reference to the entire ring. Empty rings are represented +// as nil Ring pointers. The zero value for a Ring is a one-element +// ring with a nil Value. +// +type Ring struct { + next, prev *Ring + Value interface{} // for use by client; untouched by this library +} + +func (r *Ring) init() *Ring { + r.next = r + r.prev = r + return r +} + +// Next returns the next ring element. r must not be empty. +func (r *Ring) Next() *Ring { + if r.next == nil { + return r.init() + } + return r.next +} + +// Prev returns the previous ring element. r must not be empty. +func (r *Ring) Prev() *Ring { + if r.next == nil { + return r.init() + } + return r.prev +} + +// Move moves n % r.Len() elements backward (n < 0) or forward (n >= 0) +// in the ring and returns that ring element. r must not be empty. +// +func (r *Ring) Move(n int) *Ring { + if r.next == nil { + return r.init() + } + switch { + case n < 0: + for ; n < 0; n++ { + r = r.prev + } + case n > 0: + for ; n > 0; n-- { + r = r.next + } + } + return r +} + +// New creates a ring of n elements. +func New(n int) *Ring { + if n <= 0 { + return nil + } + r := new(Ring) + p := r + for i := 1; i < n; i++ { + p.next = &Ring{prev: p} + p = p.next + } + p.next = r + r.prev = p + return r +} + +// Link connects ring r with ring s such that r.Next() +// becomes s and returns the original value for r.Next(). +// r must not be empty. +// +// If r and s point to the same ring, linking +// them removes the elements between r and s from the ring. +// The removed elements form a subring and the result is a +// reference to that subring (if no elements were removed, +// the result is still the original value for r.Next(), +// and not nil). +// +// If r and s point to different rings, linking +// them creates a single ring with the elements of s inserted +// after r. The result points to the element following the +// last element of s after insertion. +// +func (r *Ring) Link(s *Ring) *Ring { + n := r.Next() + if s != nil { + p := s.Prev() + // Note: Cannot use multiple assignment because + // evaluation order of LHS is not specified. + r.next = s + s.prev = r + n.prev = p + p.next = n + } + return n +} + +// Unlink removes n % r.Len() elements from the ring r, starting +// at r.Next(). If n % r.Len() == 0, r remains unchanged. +// The result is the removed subring. r must not be empty. +// +func (r *Ring) Unlink(n int) *Ring { + if n <= 0 { + return nil + } + return r.Link(r.Move(n + 1)) +} + +// Len computes the number of elements in ring r. +// It executes in time proportional to the number of elements. +// +func (r *Ring) Len() int { + n := 0 + if r != nil { + n = 1 + for p := r.Next(); p != r; p = p.next { + n++ + } + } + return n +} + +// Do calls function f on each element of the ring, in forward order. +// The behavior of Do is undefined if f changes *r. +func (r *Ring) Do(f func(interface{})) { + if r != nil { + f(r.Value) + for p := r.Next(); p != r; p = p.next { + f(p.Value) + } + } +} diff --git a/src/container/ring/ring_test.go b/src/container/ring/ring_test.go new file mode 100644 index 0000000000000000000000000000000000000000..552f0e24b55b964635c24a147c40c59d4b1d5522 --- /dev/null +++ b/src/container/ring/ring_test.go @@ -0,0 +1,228 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package ring + +import ( + "fmt" + "testing" +) + +// For debugging - keep around. +func dump(r *Ring) { + if r == nil { + fmt.Println("empty") + return + } + i, n := 0, r.Len() + for p := r; i < n; p = p.next { + fmt.Printf("%4d: %p = {<- %p | %p ->}\n", i, p, p.prev, p.next) + i++ + } + fmt.Println() +} + +func verify(t *testing.T, r *Ring, N int, sum int) { + // Len + n := r.Len() + if n != N { + t.Errorf("r.Len() == %d; expected %d", n, N) + } + + // iteration + n = 0 + s := 0 + r.Do(func(p interface{}) { + n++ + if p != nil { + s += p.(int) + } + }) + if n != N { + t.Errorf("number of forward iterations == %d; expected %d", n, N) + } + if sum >= 0 && s != sum { + t.Errorf("forward ring sum = %d; expected %d", s, sum) + } + + if r == nil { + return + } + + // connections + if r.next != nil { + var p *Ring // previous element + for q := r; p == nil || q != r; q = q.next { + if p != nil && p != q.prev { + t.Errorf("prev = %p, expected q.prev = %p\n", p, q.prev) + } + p = q + } + if p != r.prev { + t.Errorf("prev = %p, expected r.prev = %p\n", p, r.prev) + } + } + + // Next, Prev + if r.Next() != r.next { + t.Errorf("r.Next() != r.next") + } + if r.Prev() != r.prev { + t.Errorf("r.Prev() != r.prev") + } + + // Move + if r.Move(0) != r { + t.Errorf("r.Move(0) != r") + } + if r.Move(N) != r { + t.Errorf("r.Move(%d) != r", N) + } + if r.Move(-N) != r { + t.Errorf("r.Move(%d) != r", -N) + } + for i := 0; i < 10; i++ { + ni := N + i + mi := ni % N + if r.Move(ni) != r.Move(mi) { + t.Errorf("r.Move(%d) != r.Move(%d)", ni, mi) + } + if r.Move(-ni) != r.Move(-mi) { + t.Errorf("r.Move(%d) != r.Move(%d)", -ni, -mi) + } + } +} + +func TestCornerCases(t *testing.T) { + var ( + r0 *Ring + r1 Ring + ) + // Basics + verify(t, r0, 0, 0) + verify(t, &r1, 1, 0) + // Insert + r1.Link(r0) + verify(t, r0, 0, 0) + verify(t, &r1, 1, 0) + // Insert + r1.Link(r0) + verify(t, r0, 0, 0) + verify(t, &r1, 1, 0) + // Unlink + r1.Unlink(0) + verify(t, &r1, 1, 0) +} + +func makeN(n int) *Ring { + r := New(n) + for i := 1; i <= n; i++ { + r.Value = i + r = r.Next() + } + return r +} + +func sumN(n int) int { return (n*n + n) / 2 } + +func TestNew(t *testing.T) { + for i := 0; i < 10; i++ { + r := New(i) + verify(t, r, i, -1) + } + for i := 0; i < 10; i++ { + r := makeN(i) + verify(t, r, i, sumN(i)) + } +} + +func TestLink1(t *testing.T) { + r1a := makeN(1) + var r1b Ring + r2a := r1a.Link(&r1b) + verify(t, r2a, 2, 1) + if r2a != r1a { + t.Errorf("a) 2-element link failed") + } + + r2b := r2a.Link(r2a.Next()) + verify(t, r2b, 2, 1) + if r2b != r2a.Next() { + t.Errorf("b) 2-element link failed") + } + + r1c := r2b.Link(r2b) + verify(t, r1c, 1, 1) + verify(t, r2b, 1, 0) +} + +func TestLink2(t *testing.T) { + var r0 *Ring + r1a := &Ring{Value: 42} + r1b := &Ring{Value: 77} + r10 := makeN(10) + + r1a.Link(r0) + verify(t, r1a, 1, 42) + + r1a.Link(r1b) + verify(t, r1a, 2, 42+77) + + r10.Link(r0) + verify(t, r10, 10, sumN(10)) + + r10.Link(r1a) + verify(t, r10, 12, sumN(10)+42+77) +} + +func TestLink3(t *testing.T) { + var r Ring + n := 1 + for i := 1; i < 100; i++ { + n += i + verify(t, r.Link(New(i)), n, -1) + } +} + +func TestUnlink(t *testing.T) { + r10 := makeN(10) + s10 := r10.Move(6) + + sum10 := sumN(10) + + verify(t, r10, 10, sum10) + verify(t, s10, 10, sum10) + + r0 := r10.Unlink(0) + verify(t, r0, 0, 0) + + r1 := r10.Unlink(1) + verify(t, r1, 1, 2) + verify(t, r10, 9, sum10-2) + + r9 := r10.Unlink(9) + verify(t, r9, 9, sum10-2) + verify(t, r10, 9, sum10-2) +} + +func TestLinkUnlink(t *testing.T) { + for i := 1; i < 4; i++ { + ri := New(i) + for j := 0; j < i; j++ { + rj := ri.Unlink(j) + verify(t, rj, j, -1) + verify(t, ri, i-j, -1) + ri.Link(rj) + verify(t, ri, i, -1) + } + } +} + +// Test that calling Move() on an empty Ring initializes it. +func TestMoveEmptyRing(t *testing.T) { + var r Ring + + r.Move(1) + verify(t, &r, 1, 0) +} diff --git a/src/crypto/aes/aes_test.go b/src/crypto/aes/aes_test.go new file mode 100644 index 0000000000000000000000000000000000000000..363180931c77182c73e620bcc51557d3881066d8 --- /dev/null +++ b/src/crypto/aes/aes_test.go @@ -0,0 +1,421 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package aes + +import ( + "testing" +) + +// See const.go for overview of math here. + +// Test that powx is initialized correctly. +// (Can adapt this code to generate it too.) +func TestPowx(t *testing.T) { + p := 1 + for i := 0; i < len(powx); i++ { + if powx[i] != byte(p) { + t.Errorf("powx[%d] = %#x, want %#x", i, powx[i], p) + } + p <<= 1 + if p&0x100 != 0 { + p ^= poly + } + } +} + +// Multiply b and c as GF(2) polynomials modulo poly +func mul(b, c uint32) uint32 { + i := b + j := c + s := uint32(0) + for k := uint32(1); k < 0x100 && j != 0; k <<= 1 { + // Invariant: k == 1<>8 + } + } +} + +// Test that decryption tables are correct. +// (Can adapt this code to generate them too.) +func TestTd(t *testing.T) { + for i := 0; i < 256; i++ { + s := uint32(sbox1[i]) + s9 := mul(s, 0x9) + sb := mul(s, 0xb) + sd := mul(s, 0xd) + se := mul(s, 0xe) + w := se<<24 | s9<<16 | sd<<8 | sb + td := [][256]uint32{td0, td1, td2, td3} + for j := 0; j < 4; j++ { + if x := td[j][i]; x != w { + t.Fatalf("td[%d][%d] = %#x, want %#x", j, i, x, w) + } + w = w<<24 | w>>8 + } + } +} + +// Test vectors are from FIPS 197: +// http://www.csrc.nist.gov/publications/fips/fips197/fips-197.pdf + +// Appendix A of FIPS 197: Key expansion examples +type KeyTest struct { + key []byte + enc []uint32 + dec []uint32 // decryption expansion; not in FIPS 197, computed from C implementation. +} + +var keyTests = []KeyTest{ + { + // A.1. Expansion of a 128-bit Cipher Key + []byte{0x2b, 0x7e, 0x15, 0x16, 0x28, 0xae, 0xd2, 0xa6, 0xab, 0xf7, 0x15, 0x88, 0x09, 0xcf, 0x4f, 0x3c}, + []uint32{ + 0x2b7e1516, 0x28aed2a6, 0xabf71588, 0x09cf4f3c, + 0xa0fafe17, 0x88542cb1, 0x23a33939, 0x2a6c7605, + 0xf2c295f2, 0x7a96b943, 0x5935807a, 0x7359f67f, + 0x3d80477d, 0x4716fe3e, 0x1e237e44, 0x6d7a883b, + 0xef44a541, 0xa8525b7f, 0xb671253b, 0xdb0bad00, + 0xd4d1c6f8, 0x7c839d87, 0xcaf2b8bc, 0x11f915bc, + 0x6d88a37a, 0x110b3efd, 0xdbf98641, 0xca0093fd, + 0x4e54f70e, 0x5f5fc9f3, 0x84a64fb2, 0x4ea6dc4f, + 0xead27321, 0xb58dbad2, 0x312bf560, 0x7f8d292f, + 0xac7766f3, 0x19fadc21, 0x28d12941, 0x575c006e, + 0xd014f9a8, 0xc9ee2589, 0xe13f0cc8, 0xb6630ca6, + }, + []uint32{ + 0xd014f9a8, 0xc9ee2589, 0xe13f0cc8, 0xb6630ca6, + 0xc7b5a63, 0x1319eafe, 0xb0398890, 0x664cfbb4, + 0xdf7d925a, 0x1f62b09d, 0xa320626e, 0xd6757324, + 0x12c07647, 0xc01f22c7, 0xbc42d2f3, 0x7555114a, + 0x6efcd876, 0xd2df5480, 0x7c5df034, 0xc917c3b9, + 0x6ea30afc, 0xbc238cf6, 0xae82a4b4, 0xb54a338d, + 0x90884413, 0xd280860a, 0x12a12842, 0x1bc89739, + 0x7c1f13f7, 0x4208c219, 0xc021ae48, 0x969bf7b, + 0xcc7505eb, 0x3e17d1ee, 0x82296c51, 0xc9481133, + 0x2b3708a7, 0xf262d405, 0xbc3ebdbf, 0x4b617d62, + 0x2b7e1516, 0x28aed2a6, 0xabf71588, 0x9cf4f3c, + }, + }, + { + // A.2. Expansion of a 192-bit Cipher Key + []byte{ + 0x8e, 0x73, 0xb0, 0xf7, 0xda, 0x0e, 0x64, 0x52, 0xc8, 0x10, 0xf3, 0x2b, 0x80, 0x90, 0x79, 0xe5, + 0x62, 0xf8, 0xea, 0xd2, 0x52, 0x2c, 0x6b, 0x7b, + }, + []uint32{ + 0x8e73b0f7, 0xda0e6452, 0xc810f32b, 0x809079e5, + 0x62f8ead2, 0x522c6b7b, 0xfe0c91f7, 0x2402f5a5, + 0xec12068e, 0x6c827f6b, 0x0e7a95b9, 0x5c56fec2, + 0x4db7b4bd, 0x69b54118, 0x85a74796, 0xe92538fd, + 0xe75fad44, 0xbb095386, 0x485af057, 0x21efb14f, + 0xa448f6d9, 0x4d6dce24, 0xaa326360, 0x113b30e6, + 0xa25e7ed5, 0x83b1cf9a, 0x27f93943, 0x6a94f767, + 0xc0a69407, 0xd19da4e1, 0xec1786eb, 0x6fa64971, + 0x485f7032, 0x22cb8755, 0xe26d1352, 0x33f0b7b3, + 0x40beeb28, 0x2f18a259, 0x6747d26b, 0x458c553e, + 0xa7e1466c, 0x9411f1df, 0x821f750a, 0xad07d753, + 0xca400538, 0x8fcc5006, 0x282d166a, 0xbc3ce7b5, + 0xe98ba06f, 0x448c773c, 0x8ecc7204, 0x01002202, + }, + nil, + }, + { + // A.3. Expansion of a 256-bit Cipher Key + []byte{ + 0x60, 0x3d, 0xeb, 0x10, 0x15, 0xca, 0x71, 0xbe, 0x2b, 0x73, 0xae, 0xf0, 0x85, 0x7d, 0x77, 0x81, + 0x1f, 0x35, 0x2c, 0x07, 0x3b, 0x61, 0x08, 0xd7, 0x2d, 0x98, 0x10, 0xa3, 0x09, 0x14, 0xdf, 0xf4, + }, + []uint32{ + 0x603deb10, 0x15ca71be, 0x2b73aef0, 0x857d7781, + 0x1f352c07, 0x3b6108d7, 0x2d9810a3, 0x0914dff4, + 0x9ba35411, 0x8e6925af, 0xa51a8b5f, 0x2067fcde, + 0xa8b09c1a, 0x93d194cd, 0xbe49846e, 0xb75d5b9a, + 0xd59aecb8, 0x5bf3c917, 0xfee94248, 0xde8ebe96, + 0xb5a9328a, 0x2678a647, 0x98312229, 0x2f6c79b3, + 0x812c81ad, 0xdadf48ba, 0x24360af2, 0xfab8b464, + 0x98c5bfc9, 0xbebd198e, 0x268c3ba7, 0x09e04214, + 0x68007bac, 0xb2df3316, 0x96e939e4, 0x6c518d80, + 0xc814e204, 0x76a9fb8a, 0x5025c02d, 0x59c58239, + 0xde136967, 0x6ccc5a71, 0xfa256395, 0x9674ee15, + 0x5886ca5d, 0x2e2f31d7, 0x7e0af1fa, 0x27cf73c3, + 0x749c47ab, 0x18501dda, 0xe2757e4f, 0x7401905a, + 0xcafaaae3, 0xe4d59b34, 0x9adf6ace, 0xbd10190d, + 0xfe4890d1, 0xe6188d0b, 0x046df344, 0x706c631e, + }, + nil, + }, +} + +// Test key expansion against FIPS 197 examples. +func TestExpandKey(t *testing.T) { +L: + for i, tt := range keyTests { + enc := make([]uint32, len(tt.enc)) + var dec []uint32 + if tt.dec != nil { + dec = make([]uint32, len(tt.dec)) + } + // This test could only test Go version of expandKey because asm + // version might use different memory layout for expanded keys + // This is OK because we don't expose expanded keys to the outside + expandKeyGo(tt.key, enc, dec) + for j, v := range enc { + if v != tt.enc[j] { + t.Errorf("key %d: enc[%d] = %#x, want %#x", i, j, v, tt.enc[j]) + continue L + } + } + if dec != nil { + for j, v := range dec { + if v != tt.dec[j] { + t.Errorf("key %d: dec[%d] = %#x, want %#x", i, j, v, tt.dec[j]) + continue L + } + } + } + } +} + +// Appendix B, C of FIPS 197: Cipher examples, Example vectors. +type CryptTest struct { + key []byte + in []byte + out []byte +} + +var encryptTests = []CryptTest{ + { + // Appendix B. + []byte{0x2b, 0x7e, 0x15, 0x16, 0x28, 0xae, 0xd2, 0xa6, 0xab, 0xf7, 0x15, 0x88, 0x09, 0xcf, 0x4f, 0x3c}, + []byte{0x32, 0x43, 0xf6, 0xa8, 0x88, 0x5a, 0x30, 0x8d, 0x31, 0x31, 0x98, 0xa2, 0xe0, 0x37, 0x07, 0x34}, + []byte{0x39, 0x25, 0x84, 0x1d, 0x02, 0xdc, 0x09, 0xfb, 0xdc, 0x11, 0x85, 0x97, 0x19, 0x6a, 0x0b, 0x32}, + }, + { + // Appendix C.1. AES-128 + []byte{0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f}, + []byte{0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff}, + []byte{0x69, 0xc4, 0xe0, 0xd8, 0x6a, 0x7b, 0x04, 0x30, 0xd8, 0xcd, 0xb7, 0x80, 0x70, 0xb4, 0xc5, 0x5a}, + }, + { + // Appendix C.2. AES-192 + []byte{0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, + 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, + }, + []byte{0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff}, + []byte{0xdd, 0xa9, 0x7c, 0xa4, 0x86, 0x4c, 0xdf, 0xe0, 0x6e, 0xaf, 0x70, 0xa0, 0xec, 0x0d, 0x71, 0x91}, + }, + { + // Appendix C.3. AES-256 + []byte{0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, + 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, + }, + []byte{0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff}, + []byte{0x8e, 0xa2, 0xb7, 0xca, 0x51, 0x67, 0x45, 0xbf, 0xea, 0xfc, 0x49, 0x90, 0x4b, 0x49, 0x60, 0x89}, + }, +} + +// Test encryptBlock against FIPS 197 examples. +func TestEncryptBlock(t *testing.T) { + for i, tt := range encryptTests { + n := len(tt.key) + 28 + enc := make([]uint32, n) + dec := make([]uint32, n) + expandKey(tt.key, enc, dec) + out := make([]byte, len(tt.in)) + encryptBlock(enc, out, tt.in) + for j, v := range out { + if v != tt.out[j] { + t.Errorf("encryptBlock %d: out[%d] = %#x, want %#x", i, j, v, tt.out[j]) + break + } + } + } +} + +// Test decryptBlock against FIPS 197 examples. +func TestDecryptBlock(t *testing.T) { + for i, tt := range encryptTests { + n := len(tt.key) + 28 + enc := make([]uint32, n) + dec := make([]uint32, n) + expandKey(tt.key, enc, dec) + plain := make([]byte, len(tt.in)) + decryptBlock(dec, plain, tt.out) + for j, v := range plain { + if v != tt.in[j] { + t.Errorf("decryptBlock %d: plain[%d] = %#x, want %#x", i, j, v, tt.in[j]) + break + } + } + } +} + +// Test Cipher Encrypt method against FIPS 197 examples. +func TestCipherEncrypt(t *testing.T) { + for i, tt := range encryptTests { + c, err := NewCipher(tt.key) + if err != nil { + t.Errorf("NewCipher(%d bytes) = %s", len(tt.key), err) + continue + } + out := make([]byte, len(tt.in)) + c.Encrypt(out, tt.in) + for j, v := range out { + if v != tt.out[j] { + t.Errorf("Cipher.Encrypt %d: out[%d] = %#x, want %#x", i, j, v, tt.out[j]) + break + } + } + } +} + +// Test Cipher Decrypt against FIPS 197 examples. +func TestCipherDecrypt(t *testing.T) { + for i, tt := range encryptTests { + c, err := NewCipher(tt.key) + if err != nil { + t.Errorf("NewCipher(%d bytes) = %s", len(tt.key), err) + continue + } + plain := make([]byte, len(tt.in)) + c.Decrypt(plain, tt.out) + for j, v := range plain { + if v != tt.in[j] { + t.Errorf("decryptBlock %d: plain[%d] = %#x, want %#x", i, j, v, tt.in[j]) + break + } + } + } +} + +// Test short input/output. +// Assembly used to not notice. +// See issue 7928. +func TestShortBlocks(t *testing.T) { + bytes := func(n int) []byte { return make([]byte, n) } + + c, _ := NewCipher(bytes(16)) + + mustPanic(t, "crypto/aes: input not full block", func() { c.Encrypt(bytes(1), bytes(1)) }) + mustPanic(t, "crypto/aes: input not full block", func() { c.Decrypt(bytes(1), bytes(1)) }) + mustPanic(t, "crypto/aes: input not full block", func() { c.Encrypt(bytes(100), bytes(1)) }) + mustPanic(t, "crypto/aes: input not full block", func() { c.Decrypt(bytes(100), bytes(1)) }) + mustPanic(t, "crypto/aes: output not full block", func() { c.Encrypt(bytes(1), bytes(100)) }) + mustPanic(t, "crypto/aes: output not full block", func() { c.Decrypt(bytes(1), bytes(100)) }) +} + +func mustPanic(t *testing.T, msg string, f func()) { + defer func() { + err := recover() + if err == nil { + t.Errorf("function did not panic, wanted %q", msg) + } else if err != msg { + t.Errorf("got panic %v, wanted %q", err, msg) + } + }() + f() +} + +func BenchmarkEncrypt(b *testing.B) { + tt := encryptTests[0] + c, err := NewCipher(tt.key) + if err != nil { + b.Fatal("NewCipher:", err) + } + out := make([]byte, len(tt.in)) + b.SetBytes(int64(len(out))) + b.ResetTimer() + for i := 0; i < b.N; i++ { + c.Encrypt(out, tt.in) + } +} + +func BenchmarkDecrypt(b *testing.B) { + tt := encryptTests[0] + c, err := NewCipher(tt.key) + if err != nil { + b.Fatal("NewCipher:", err) + } + out := make([]byte, len(tt.out)) + b.SetBytes(int64(len(out))) + b.ResetTimer() + for i := 0; i < b.N; i++ { + c.Decrypt(out, tt.out) + } +} + +func BenchmarkExpand(b *testing.B) { + tt := encryptTests[0] + n := len(tt.key) + 28 + c := &aesCipher{make([]uint32, n), make([]uint32, n)} + b.ResetTimer() + for i := 0; i < b.N; i++ { + expandKey(tt.key, c.enc, c.dec) + } +} diff --git a/src/crypto/aes/asm_amd64.s b/src/crypto/aes/asm_amd64.s new file mode 100644 index 0000000000000000000000000000000000000000..6a6e6ac4b9d5821a97e54262d6158c963907b4cc --- /dev/null +++ b/src/crypto/aes/asm_amd64.s @@ -0,0 +1,289 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +#include "textflag.h" + +// func hasAsm() bool +// returns whether AES-NI is supported +TEXT ·hasAsm(SB),NOSPLIT,$0 + XORQ AX, AX + INCL AX + CPUID + SHRQ $25, CX + ANDQ $1, CX + MOVB CX, ret+0(FP) + RET + +// func encryptBlockAsm(nr int, xk *uint32, dst, src *byte) +TEXT ·encryptBlockAsm(SB),NOSPLIT,$0 + MOVQ nr+0(FP), CX + MOVQ xk+8(FP), AX + MOVQ dst+16(FP), DX + MOVQ src+24(FP), BX + MOVUPS 0(AX), X1 + MOVUPS 0(BX), X0 + ADDQ $16, AX + PXOR X1, X0 + SUBQ $12, CX + JE Lenc196 + JB Lenc128 +Lenc256: + MOVUPS 0(AX), X1 + AESENC X1, X0 + MOVUPS 16(AX), X1 + AESENC X1, X0 + ADDQ $32, AX +Lenc196: + MOVUPS 0(AX), X1 + AESENC X1, X0 + MOVUPS 16(AX), X1 + AESENC X1, X0 + ADDQ $32, AX +Lenc128: + MOVUPS 0(AX), X1 + AESENC X1, X0 + MOVUPS 16(AX), X1 + AESENC X1, X0 + MOVUPS 32(AX), X1 + AESENC X1, X0 + MOVUPS 48(AX), X1 + AESENC X1, X0 + MOVUPS 64(AX), X1 + AESENC X1, X0 + MOVUPS 80(AX), X1 + AESENC X1, X0 + MOVUPS 96(AX), X1 + AESENC X1, X0 + MOVUPS 112(AX), X1 + AESENC X1, X0 + MOVUPS 128(AX), X1 + AESENC X1, X0 + MOVUPS 144(AX), X1 + AESENCLAST X1, X0 + MOVUPS X0, 0(DX) + RET + +// func decryptBlockAsm(nr int, xk *uint32, dst, src *byte) +TEXT ·decryptBlockAsm(SB),NOSPLIT,$0 + MOVQ nr+0(FP), CX + MOVQ xk+8(FP), AX + MOVQ dst+16(FP), DX + MOVQ src+24(FP), BX + MOVUPS 0(AX), X1 + MOVUPS 0(BX), X0 + ADDQ $16, AX + PXOR X1, X0 + SUBQ $12, CX + JE Ldec196 + JB Ldec128 +Ldec256: + MOVUPS 0(AX), X1 + AESDEC X1, X0 + MOVUPS 16(AX), X1 + AESDEC X1, X0 + ADDQ $32, AX +Ldec196: + MOVUPS 0(AX), X1 + AESDEC X1, X0 + MOVUPS 16(AX), X1 + AESDEC X1, X0 + ADDQ $32, AX +Ldec128: + MOVUPS 0(AX), X1 + AESDEC X1, X0 + MOVUPS 16(AX), X1 + AESDEC X1, X0 + MOVUPS 32(AX), X1 + AESDEC X1, X0 + MOVUPS 48(AX), X1 + AESDEC X1, X0 + MOVUPS 64(AX), X1 + AESDEC X1, X0 + MOVUPS 80(AX), X1 + AESDEC X1, X0 + MOVUPS 96(AX), X1 + AESDEC X1, X0 + MOVUPS 112(AX), X1 + AESDEC X1, X0 + MOVUPS 128(AX), X1 + AESDEC X1, X0 + MOVUPS 144(AX), X1 + AESDECLAST X1, X0 + MOVUPS X0, 0(DX) + RET + +// func expandKeyAsm(nr int, key *byte, enc, dec *uint32) { +// Note that round keys are stored in uint128 format, not uint32 +TEXT ·expandKeyAsm(SB),NOSPLIT,$0 + MOVQ nr+0(FP), CX + MOVQ key+8(FP), AX + MOVQ enc+16(FP), BX + MOVQ dec+24(FP), DX + MOVUPS (AX), X0 + // enc + MOVUPS X0, (BX) + ADDQ $16, BX + PXOR X4, X4 // _expand_key_* expect X4 to be zero + CMPL CX, $12 + JE Lexp_enc196 + JB Lexp_enc128 +Lexp_enc256: + MOVUPS 16(AX), X2 + MOVUPS X2, (BX) + ADDQ $16, BX + AESKEYGENASSIST $0x01, X2, X1 + CALL _expand_key_256a<>(SB) + AESKEYGENASSIST $0x01, X0, X1 + CALL _expand_key_256b<>(SB) + AESKEYGENASSIST $0x02, X2, X1 + CALL _expand_key_256a<>(SB) + AESKEYGENASSIST $0x02, X0, X1 + CALL _expand_key_256b<>(SB) + AESKEYGENASSIST $0x04, X2, X1 + CALL _expand_key_256a<>(SB) + AESKEYGENASSIST $0x04, X0, X1 + CALL _expand_key_256b<>(SB) + AESKEYGENASSIST $0x08, X2, X1 + CALL _expand_key_256a<>(SB) + AESKEYGENASSIST $0x08, X0, X1 + CALL _expand_key_256b<>(SB) + AESKEYGENASSIST $0x10, X2, X1 + CALL _expand_key_256a<>(SB) + AESKEYGENASSIST $0x10, X0, X1 + CALL _expand_key_256b<>(SB) + AESKEYGENASSIST $0x20, X2, X1 + CALL _expand_key_256a<>(SB) + AESKEYGENASSIST $0x20, X0, X1 + CALL _expand_key_256b<>(SB) + AESKEYGENASSIST $0x40, X2, X1 + CALL _expand_key_256a<>(SB) + JMP Lexp_dec +Lexp_enc196: + MOVQ 16(AX), X2 + AESKEYGENASSIST $0x01, X2, X1 + CALL _expand_key_192a<>(SB) + AESKEYGENASSIST $0x02, X2, X1 + CALL _expand_key_192b<>(SB) + AESKEYGENASSIST $0x04, X2, X1 + CALL _expand_key_192a<>(SB) + AESKEYGENASSIST $0x08, X2, X1 + CALL _expand_key_192b<>(SB) + AESKEYGENASSIST $0x10, X2, X1 + CALL _expand_key_192a<>(SB) + AESKEYGENASSIST $0x20, X2, X1 + CALL _expand_key_192b<>(SB) + AESKEYGENASSIST $0x40, X2, X1 + CALL _expand_key_192a<>(SB) + AESKEYGENASSIST $0x80, X2, X1 + CALL _expand_key_192b<>(SB) + JMP Lexp_dec +Lexp_enc128: + AESKEYGENASSIST $0x01, X0, X1 + CALL _expand_key_128<>(SB) + AESKEYGENASSIST $0x02, X0, X1 + CALL _expand_key_128<>(SB) + AESKEYGENASSIST $0x04, X0, X1 + CALL _expand_key_128<>(SB) + AESKEYGENASSIST $0x08, X0, X1 + CALL _expand_key_128<>(SB) + AESKEYGENASSIST $0x10, X0, X1 + CALL _expand_key_128<>(SB) + AESKEYGENASSIST $0x20, X0, X1 + CALL _expand_key_128<>(SB) + AESKEYGENASSIST $0x40, X0, X1 + CALL _expand_key_128<>(SB) + AESKEYGENASSIST $0x80, X0, X1 + CALL _expand_key_128<>(SB) + AESKEYGENASSIST $0x1b, X0, X1 + CALL _expand_key_128<>(SB) + AESKEYGENASSIST $0x36, X0, X1 + CALL _expand_key_128<>(SB) +Lexp_dec: + // dec + SUBQ $16, BX + MOVUPS (BX), X1 + MOVUPS X1, (DX) + DECQ CX +Lexp_dec_loop: + MOVUPS -16(BX), X1 + AESIMC X1, X0 + MOVUPS X0, 16(DX) + SUBQ $16, BX + ADDQ $16, DX + DECQ CX + JNZ Lexp_dec_loop + MOVUPS -16(BX), X0 + MOVUPS X0, 16(DX) + RET + +#define PSHUFD_X0_X0_ BYTE $0x66; BYTE $0x0f; BYTE $0x70; BYTE $0xc0 +#define PSHUFD_X1_X1_ BYTE $0x66; BYTE $0x0f; BYTE $0x70; BYTE $0xc9 +TEXT _expand_key_128<>(SB),NOSPLIT,$0 + PSHUFD $0xff, X1, X1 + SHUFPS $0x10, X0, X4 + PXOR X4, X0 + SHUFPS $0x8c, X0, X4 + PXOR X4, X0 + PXOR X1, X0 + MOVUPS X0, (BX) + ADDQ $16, BX + RET + +#define PSLLDQ_X5_ BYTE $0x66; BYTE $0x0f; BYTE $0x73; BYTE $0xfd +#define PSHUFD_X0_X3_ BYTE $0x66; BYTE $0x0f; BYTE $0x70; BYTE $0xd8 +TEXT _expand_key_192a<>(SB),NOSPLIT,$0 + PSHUFD $0x55, X1, X1 + SHUFPS $0x10, X0, X4 + PXOR X4, X0 + SHUFPS $0x8c, X0, X4 + PXOR X4, X0 + PXOR X1, X0 + + MOVAPS X2, X5 + MOVAPS X2, X6 + PSLLDQ_X5_; BYTE $0x4 + PSHUFD $0xff, X0, X3 + PXOR X3, X2 + PXOR X5, X2 + + MOVAPS X0, X1 + SHUFPS $0x44, X0, X6 + MOVUPS X6, (BX) + SHUFPS $0x4e, X2, X1 + MOVUPS X1, 16(BX) + ADDQ $32, BX + RET + +TEXT _expand_key_192b<>(SB),NOSPLIT,$0 + PSHUFD $0x55, X1, X1 + SHUFPS $0x10, X0, X4 + PXOR X4, X0 + SHUFPS $0x8c, X0, X4 + PXOR X4, X0 + PXOR X1, X0 + + MOVAPS X2, X5 + PSLLDQ_X5_; BYTE $0x4 + PSHUFD $0xff, X0, X3 + PXOR X3, X2 + PXOR X5, X2 + + MOVUPS X0, (BX) + ADDQ $16, BX + RET + +TEXT _expand_key_256a<>(SB),NOSPLIT,$0 + JMP _expand_key_128<>(SB) + +TEXT _expand_key_256b<>(SB),NOSPLIT,$0 + PSHUFD $0xaa, X1, X1 + SHUFPS $0x10, X2, X4 + PXOR X4, X2 + SHUFPS $0x8c, X2, X4 + PXOR X4, X2 + PXOR X1, X2 + + MOVUPS X2, (BX) + ADDQ $16, BX + RET diff --git a/src/crypto/aes/block.go b/src/crypto/aes/block.go new file mode 100644 index 0000000000000000000000000000000000000000..57a7e9e25f2f36abdba68c03f6fd5f011e5fd2e9 --- /dev/null +++ b/src/crypto/aes/block.go @@ -0,0 +1,176 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// This Go implementation is derived in part from the reference +// ANSI C implementation, which carries the following notice: +// +// rijndael-alg-fst.c +// +// @version 3.0 (December 2000) +// +// Optimised ANSI C code for the Rijndael cipher (now AES) +// +// @author Vincent Rijmen +// @author Antoon Bosselaers +// @author Paulo Barreto +// +// This code is hereby placed in the public domain. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHORS ''AS IS'' AND ANY EXPRESS +// OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE +// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +// BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +// EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// See FIPS 197 for specification, and see Daemen and Rijmen's Rijndael submission +// for implementation details. +// http://www.csrc.nist.gov/publications/fips/fips197/fips-197.pdf +// http://csrc.nist.gov/archive/aes/rijndael/Rijndael-ammended.pdf + +package aes + +// Encrypt one block from src into dst, using the expanded key xk. +func encryptBlockGo(xk []uint32, dst, src []byte) { + var s0, s1, s2, s3, t0, t1, t2, t3 uint32 + + s0 = uint32(src[0])<<24 | uint32(src[1])<<16 | uint32(src[2])<<8 | uint32(src[3]) + s1 = uint32(src[4])<<24 | uint32(src[5])<<16 | uint32(src[6])<<8 | uint32(src[7]) + s2 = uint32(src[8])<<24 | uint32(src[9])<<16 | uint32(src[10])<<8 | uint32(src[11]) + s3 = uint32(src[12])<<24 | uint32(src[13])<<16 | uint32(src[14])<<8 | uint32(src[15]) + + // First round just XORs input with key. + s0 ^= xk[0] + s1 ^= xk[1] + s2 ^= xk[2] + s3 ^= xk[3] + + // Middle rounds shuffle using tables. + // Number of rounds is set by length of expanded key. + nr := len(xk)/4 - 2 // - 2: one above, one more below + k := 4 + for r := 0; r < nr; r++ { + t0 = xk[k+0] ^ te0[uint8(s0>>24)] ^ te1[uint8(s1>>16)] ^ te2[uint8(s2>>8)] ^ te3[uint8(s3)] + t1 = xk[k+1] ^ te0[uint8(s1>>24)] ^ te1[uint8(s2>>16)] ^ te2[uint8(s3>>8)] ^ te3[uint8(s0)] + t2 = xk[k+2] ^ te0[uint8(s2>>24)] ^ te1[uint8(s3>>16)] ^ te2[uint8(s0>>8)] ^ te3[uint8(s1)] + t3 = xk[k+3] ^ te0[uint8(s3>>24)] ^ te1[uint8(s0>>16)] ^ te2[uint8(s1>>8)] ^ te3[uint8(s2)] + k += 4 + s0, s1, s2, s3 = t0, t1, t2, t3 + } + + // Last round uses s-box directly and XORs to produce output. + s0 = uint32(sbox0[t0>>24])<<24 | uint32(sbox0[t1>>16&0xff])<<16 | uint32(sbox0[t2>>8&0xff])<<8 | uint32(sbox0[t3&0xff]) + s1 = uint32(sbox0[t1>>24])<<24 | uint32(sbox0[t2>>16&0xff])<<16 | uint32(sbox0[t3>>8&0xff])<<8 | uint32(sbox0[t0&0xff]) + s2 = uint32(sbox0[t2>>24])<<24 | uint32(sbox0[t3>>16&0xff])<<16 | uint32(sbox0[t0>>8&0xff])<<8 | uint32(sbox0[t1&0xff]) + s3 = uint32(sbox0[t3>>24])<<24 | uint32(sbox0[t0>>16&0xff])<<16 | uint32(sbox0[t1>>8&0xff])<<8 | uint32(sbox0[t2&0xff]) + + s0 ^= xk[k+0] + s1 ^= xk[k+1] + s2 ^= xk[k+2] + s3 ^= xk[k+3] + + dst[0], dst[1], dst[2], dst[3] = byte(s0>>24), byte(s0>>16), byte(s0>>8), byte(s0) + dst[4], dst[5], dst[6], dst[7] = byte(s1>>24), byte(s1>>16), byte(s1>>8), byte(s1) + dst[8], dst[9], dst[10], dst[11] = byte(s2>>24), byte(s2>>16), byte(s2>>8), byte(s2) + dst[12], dst[13], dst[14], dst[15] = byte(s3>>24), byte(s3>>16), byte(s3>>8), byte(s3) +} + +// Decrypt one block from src into dst, using the expanded key xk. +func decryptBlockGo(xk []uint32, dst, src []byte) { + var s0, s1, s2, s3, t0, t1, t2, t3 uint32 + + s0 = uint32(src[0])<<24 | uint32(src[1])<<16 | uint32(src[2])<<8 | uint32(src[3]) + s1 = uint32(src[4])<<24 | uint32(src[5])<<16 | uint32(src[6])<<8 | uint32(src[7]) + s2 = uint32(src[8])<<24 | uint32(src[9])<<16 | uint32(src[10])<<8 | uint32(src[11]) + s3 = uint32(src[12])<<24 | uint32(src[13])<<16 | uint32(src[14])<<8 | uint32(src[15]) + + // First round just XORs input with key. + s0 ^= xk[0] + s1 ^= xk[1] + s2 ^= xk[2] + s3 ^= xk[3] + + // Middle rounds shuffle using tables. + // Number of rounds is set by length of expanded key. + nr := len(xk)/4 - 2 // - 2: one above, one more below + k := 4 + for r := 0; r < nr; r++ { + t0 = xk[k+0] ^ td0[uint8(s0>>24)] ^ td1[uint8(s3>>16)] ^ td2[uint8(s2>>8)] ^ td3[uint8(s1)] + t1 = xk[k+1] ^ td0[uint8(s1>>24)] ^ td1[uint8(s0>>16)] ^ td2[uint8(s3>>8)] ^ td3[uint8(s2)] + t2 = xk[k+2] ^ td0[uint8(s2>>24)] ^ td1[uint8(s1>>16)] ^ td2[uint8(s0>>8)] ^ td3[uint8(s3)] + t3 = xk[k+3] ^ td0[uint8(s3>>24)] ^ td1[uint8(s2>>16)] ^ td2[uint8(s1>>8)] ^ td3[uint8(s0)] + k += 4 + s0, s1, s2, s3 = t0, t1, t2, t3 + } + + // Last round uses s-box directly and XORs to produce output. + s0 = uint32(sbox1[t0>>24])<<24 | uint32(sbox1[t3>>16&0xff])<<16 | uint32(sbox1[t2>>8&0xff])<<8 | uint32(sbox1[t1&0xff]) + s1 = uint32(sbox1[t1>>24])<<24 | uint32(sbox1[t0>>16&0xff])<<16 | uint32(sbox1[t3>>8&0xff])<<8 | uint32(sbox1[t2&0xff]) + s2 = uint32(sbox1[t2>>24])<<24 | uint32(sbox1[t1>>16&0xff])<<16 | uint32(sbox1[t0>>8&0xff])<<8 | uint32(sbox1[t3&0xff]) + s3 = uint32(sbox1[t3>>24])<<24 | uint32(sbox1[t2>>16&0xff])<<16 | uint32(sbox1[t1>>8&0xff])<<8 | uint32(sbox1[t0&0xff]) + + s0 ^= xk[k+0] + s1 ^= xk[k+1] + s2 ^= xk[k+2] + s3 ^= xk[k+3] + + dst[0], dst[1], dst[2], dst[3] = byte(s0>>24), byte(s0>>16), byte(s0>>8), byte(s0) + dst[4], dst[5], dst[6], dst[7] = byte(s1>>24), byte(s1>>16), byte(s1>>8), byte(s1) + dst[8], dst[9], dst[10], dst[11] = byte(s2>>24), byte(s2>>16), byte(s2>>8), byte(s2) + dst[12], dst[13], dst[14], dst[15] = byte(s3>>24), byte(s3>>16), byte(s3>>8), byte(s3) +} + +// Apply sbox0 to each byte in w. +func subw(w uint32) uint32 { + return uint32(sbox0[w>>24])<<24 | + uint32(sbox0[w>>16&0xff])<<16 | + uint32(sbox0[w>>8&0xff])<<8 | + uint32(sbox0[w&0xff]) +} + +// Rotate +func rotw(w uint32) uint32 { return w<<8 | w>>24 } + +// Key expansion algorithm. See FIPS-197, Figure 11. +// Their rcon[i] is our powx[i-1] << 24. +func expandKeyGo(key []byte, enc, dec []uint32) { + // Encryption key setup. + var i int + nk := len(key) / 4 + for i = 0; i < nk; i++ { + enc[i] = uint32(key[4*i])<<24 | uint32(key[4*i+1])<<16 | uint32(key[4*i+2])<<8 | uint32(key[4*i+3]) + } + for ; i < len(enc); i++ { + t := enc[i-1] + if i%nk == 0 { + t = subw(rotw(t)) ^ (uint32(powx[i/nk-1]) << 24) + } else if nk > 6 && i%nk == 4 { + t = subw(t) + } + enc[i] = enc[i-nk] ^ t + } + + // Derive decryption key from encryption key. + // Reverse the 4-word round key sets from enc to produce dec. + // All sets but the first and last get the MixColumn transform applied. + if dec == nil { + return + } + n := len(enc) + for i := 0; i < n; i += 4 { + ei := n - i - 4 + for j := 0; j < 4; j++ { + x := enc[ei+j] + if i > 0 && i+4 < n { + x = td0[sbox0[x>>24]] ^ td1[sbox0[x>>16&0xff]] ^ td2[sbox0[x>>8&0xff]] ^ td3[sbox0[x&0xff]] + } + dec[i+j] = x + } + } +} diff --git a/src/crypto/aes/cipher.go b/src/crypto/aes/cipher.go new file mode 100644 index 0000000000000000000000000000000000000000..2c6bb0a89c7b753359f862081c0f858879b7c99b --- /dev/null +++ b/src/crypto/aes/cipher.go @@ -0,0 +1,66 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package aes + +import ( + "crypto/cipher" + "strconv" +) + +// The AES block size in bytes. +const BlockSize = 16 + +// A cipher is an instance of AES encryption using a particular key. +type aesCipher struct { + enc []uint32 + dec []uint32 +} + +type KeySizeError int + +func (k KeySizeError) Error() string { + return "crypto/aes: invalid key size " + strconv.Itoa(int(k)) +} + +// NewCipher creates and returns a new cipher.Block. +// The key argument should be the AES key, +// either 16, 24, or 32 bytes to select +// AES-128, AES-192, or AES-256. +func NewCipher(key []byte) (cipher.Block, error) { + k := len(key) + switch k { + default: + return nil, KeySizeError(k) + case 16, 24, 32: + break + } + + n := k + 28 + c := &aesCipher{make([]uint32, n), make([]uint32, n)} + expandKey(key, c.enc, c.dec) + return c, nil +} + +func (c *aesCipher) BlockSize() int { return BlockSize } + +func (c *aesCipher) Encrypt(dst, src []byte) { + if len(src) < BlockSize { + panic("crypto/aes: input not full block") + } + if len(dst) < BlockSize { + panic("crypto/aes: output not full block") + } + encryptBlock(c.enc, dst, src) +} + +func (c *aesCipher) Decrypt(dst, src []byte) { + if len(src) < BlockSize { + panic("crypto/aes: input not full block") + } + if len(dst) < BlockSize { + panic("crypto/aes: output not full block") + } + decryptBlock(c.dec, dst, src) +} diff --git a/src/crypto/aes/cipher_asm.go b/src/crypto/aes/cipher_asm.go new file mode 100644 index 0000000000000000000000000000000000000000..964eaaa6f886f9f474be72e1832fa5a7c95d7e1f --- /dev/null +++ b/src/crypto/aes/cipher_asm.go @@ -0,0 +1,48 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build amd64 + +package aes + +// defined in asm_$GOARCH.s +func hasAsm() bool +func encryptBlockAsm(nr int, xk *uint32, dst, src *byte) +func decryptBlockAsm(nr int, xk *uint32, dst, src *byte) +func expandKeyAsm(nr int, key *byte, enc *uint32, dec *uint32) + +var useAsm = hasAsm() + +func encryptBlock(xk []uint32, dst, src []byte) { + if useAsm { + encryptBlockAsm(len(xk)/4-1, &xk[0], &dst[0], &src[0]) + } else { + encryptBlockGo(xk, dst, src) + } +} + +func decryptBlock(xk []uint32, dst, src []byte) { + if useAsm { + decryptBlockAsm(len(xk)/4-1, &xk[0], &dst[0], &src[0]) + } else { + decryptBlockGo(xk, dst, src) + } +} + +func expandKey(key []byte, enc, dec []uint32) { + if useAsm { + rounds := 10 + switch len(key) { + case 128 / 8: + rounds = 10 + case 192 / 8: + rounds = 12 + case 256 / 8: + rounds = 14 + } + expandKeyAsm(rounds, &key[0], &enc[0], &dec[0]) + } else { + expandKeyGo(key, enc, dec) + } +} diff --git a/src/crypto/aes/cipher_generic.go b/src/crypto/aes/cipher_generic.go new file mode 100644 index 0000000000000000000000000000000000000000..1714e0f1e5cbdba4d890998e9f0f6bc9388ac5fe --- /dev/null +++ b/src/crypto/aes/cipher_generic.go @@ -0,0 +1,19 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build !amd64 + +package aes + +func encryptBlock(xk []uint32, dst, src []byte) { + encryptBlockGo(xk, dst, src) +} + +func decryptBlock(xk []uint32, dst, src []byte) { + decryptBlockGo(xk, dst, src) +} + +func expandKey(key []byte, enc, dec []uint32) { + expandKeyGo(key, enc, dec) +} diff --git a/src/crypto/aes/const.go b/src/crypto/aes/const.go new file mode 100644 index 0000000000000000000000000000000000000000..aee73a7c52c75eb2f6d2c1e451c3905949debfd1 --- /dev/null +++ b/src/crypto/aes/const.go @@ -0,0 +1,358 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package aes implements AES encryption (formerly Rijndael), as defined in +// U.S. Federal Information Processing Standards Publication 197. +package aes + +// This file contains AES constants - 8720 bytes of initialized data. + +// http://www.csrc.nist.gov/publications/fips/fips197/fips-197.pdf + +// AES is based on the mathematical behavior of binary polynomials +// (polynomials over GF(2)) modulo the irreducible polynomial x⁸ + x⁴ + x³ + x + 1. +// Addition of these binary polynomials corresponds to binary xor. +// Reducing mod poly corresponds to binary xor with poly every +// time a 0x100 bit appears. +const poly = 1<<8 | 1<<4 | 1<<3 | 1<<1 | 1<<0 // x⁸ + x⁴ + x³ + x + 1 + +// Powers of x mod poly in GF(2). +var powx = [16]byte{ + 0x01, + 0x02, + 0x04, + 0x08, + 0x10, + 0x20, + 0x40, + 0x80, + 0x1b, + 0x36, + 0x6c, + 0xd8, + 0xab, + 0x4d, + 0x9a, + 0x2f, +} + +// FIPS-197 Figure 7. S-box substitution values in hexadecimal format. +var sbox0 = [256]byte{ + 0x63, 0x7c, 0x77, 0x7b, 0xf2, 0x6b, 0x6f, 0xc5, 0x30, 0x01, 0x67, 0x2b, 0xfe, 0xd7, 0xab, 0x76, + 0xca, 0x82, 0xc9, 0x7d, 0xfa, 0x59, 0x47, 0xf0, 0xad, 0xd4, 0xa2, 0xaf, 0x9c, 0xa4, 0x72, 0xc0, + 0xb7, 0xfd, 0x93, 0x26, 0x36, 0x3f, 0xf7, 0xcc, 0x34, 0xa5, 0xe5, 0xf1, 0x71, 0xd8, 0x31, 0x15, + 0x04, 0xc7, 0x23, 0xc3, 0x18, 0x96, 0x05, 0x9a, 0x07, 0x12, 0x80, 0xe2, 0xeb, 0x27, 0xb2, 0x75, + 0x09, 0x83, 0x2c, 0x1a, 0x1b, 0x6e, 0x5a, 0xa0, 0x52, 0x3b, 0xd6, 0xb3, 0x29, 0xe3, 0x2f, 0x84, + 0x53, 0xd1, 0x00, 0xed, 0x20, 0xfc, 0xb1, 0x5b, 0x6a, 0xcb, 0xbe, 0x39, 0x4a, 0x4c, 0x58, 0xcf, + 0xd0, 0xef, 0xaa, 0xfb, 0x43, 0x4d, 0x33, 0x85, 0x45, 0xf9, 0x02, 0x7f, 0x50, 0x3c, 0x9f, 0xa8, + 0x51, 0xa3, 0x40, 0x8f, 0x92, 0x9d, 0x38, 0xf5, 0xbc, 0xb6, 0xda, 0x21, 0x10, 0xff, 0xf3, 0xd2, + 0xcd, 0x0c, 0x13, 0xec, 0x5f, 0x97, 0x44, 0x17, 0xc4, 0xa7, 0x7e, 0x3d, 0x64, 0x5d, 0x19, 0x73, + 0x60, 0x81, 0x4f, 0xdc, 0x22, 0x2a, 0x90, 0x88, 0x46, 0xee, 0xb8, 0x14, 0xde, 0x5e, 0x0b, 0xdb, + 0xe0, 0x32, 0x3a, 0x0a, 0x49, 0x06, 0x24, 0x5c, 0xc2, 0xd3, 0xac, 0x62, 0x91, 0x95, 0xe4, 0x79, + 0xe7, 0xc8, 0x37, 0x6d, 0x8d, 0xd5, 0x4e, 0xa9, 0x6c, 0x56, 0xf4, 0xea, 0x65, 0x7a, 0xae, 0x08, + 0xba, 0x78, 0x25, 0x2e, 0x1c, 0xa6, 0xb4, 0xc6, 0xe8, 0xdd, 0x74, 0x1f, 0x4b, 0xbd, 0x8b, 0x8a, + 0x70, 0x3e, 0xb5, 0x66, 0x48, 0x03, 0xf6, 0x0e, 0x61, 0x35, 0x57, 0xb9, 0x86, 0xc1, 0x1d, 0x9e, + 0xe1, 0xf8, 0x98, 0x11, 0x69, 0xd9, 0x8e, 0x94, 0x9b, 0x1e, 0x87, 0xe9, 0xce, 0x55, 0x28, 0xdf, + 0x8c, 0xa1, 0x89, 0x0d, 0xbf, 0xe6, 0x42, 0x68, 0x41, 0x99, 0x2d, 0x0f, 0xb0, 0x54, 0xbb, 0x16, +} + +// FIPS-197 Figure 14. Inverse S-box substitution values in hexadecimal format. +var sbox1 = [256]byte{ + 0x52, 0x09, 0x6a, 0xd5, 0x30, 0x36, 0xa5, 0x38, 0xbf, 0x40, 0xa3, 0x9e, 0x81, 0xf3, 0xd7, 0xfb, + 0x7c, 0xe3, 0x39, 0x82, 0x9b, 0x2f, 0xff, 0x87, 0x34, 0x8e, 0x43, 0x44, 0xc4, 0xde, 0xe9, 0xcb, + 0x54, 0x7b, 0x94, 0x32, 0xa6, 0xc2, 0x23, 0x3d, 0xee, 0x4c, 0x95, 0x0b, 0x42, 0xfa, 0xc3, 0x4e, + 0x08, 0x2e, 0xa1, 0x66, 0x28, 0xd9, 0x24, 0xb2, 0x76, 0x5b, 0xa2, 0x49, 0x6d, 0x8b, 0xd1, 0x25, + 0x72, 0xf8, 0xf6, 0x64, 0x86, 0x68, 0x98, 0x16, 0xd4, 0xa4, 0x5c, 0xcc, 0x5d, 0x65, 0xb6, 0x92, + 0x6c, 0x70, 0x48, 0x50, 0xfd, 0xed, 0xb9, 0xda, 0x5e, 0x15, 0x46, 0x57, 0xa7, 0x8d, 0x9d, 0x84, + 0x90, 0xd8, 0xab, 0x00, 0x8c, 0xbc, 0xd3, 0x0a, 0xf7, 0xe4, 0x58, 0x05, 0xb8, 0xb3, 0x45, 0x06, + 0xd0, 0x2c, 0x1e, 0x8f, 0xca, 0x3f, 0x0f, 0x02, 0xc1, 0xaf, 0xbd, 0x03, 0x01, 0x13, 0x8a, 0x6b, + 0x3a, 0x91, 0x11, 0x41, 0x4f, 0x67, 0xdc, 0xea, 0x97, 0xf2, 0xcf, 0xce, 0xf0, 0xb4, 0xe6, 0x73, + 0x96, 0xac, 0x74, 0x22, 0xe7, 0xad, 0x35, 0x85, 0xe2, 0xf9, 0x37, 0xe8, 0x1c, 0x75, 0xdf, 0x6e, + 0x47, 0xf1, 0x1a, 0x71, 0x1d, 0x29, 0xc5, 0x89, 0x6f, 0xb7, 0x62, 0x0e, 0xaa, 0x18, 0xbe, 0x1b, + 0xfc, 0x56, 0x3e, 0x4b, 0xc6, 0xd2, 0x79, 0x20, 0x9a, 0xdb, 0xc0, 0xfe, 0x78, 0xcd, 0x5a, 0xf4, + 0x1f, 0xdd, 0xa8, 0x33, 0x88, 0x07, 0xc7, 0x31, 0xb1, 0x12, 0x10, 0x59, 0x27, 0x80, 0xec, 0x5f, + 0x60, 0x51, 0x7f, 0xa9, 0x19, 0xb5, 0x4a, 0x0d, 0x2d, 0xe5, 0x7a, 0x9f, 0x93, 0xc9, 0x9c, 0xef, + 0xa0, 0xe0, 0x3b, 0x4d, 0xae, 0x2a, 0xf5, 0xb0, 0xc8, 0xeb, 0xbb, 0x3c, 0x83, 0x53, 0x99, 0x61, + 0x17, 0x2b, 0x04, 0x7e, 0xba, 0x77, 0xd6, 0x26, 0xe1, 0x69, 0x14, 0x63, 0x55, 0x21, 0x0c, 0x7d, +} + +// Lookup tables for encryption. +// These can be recomputed by adapting the tests in aes_test.go. + +var te0 = [256]uint32{ + 0xc66363a5, 0xf87c7c84, 0xee777799, 0xf67b7b8d, 0xfff2f20d, 0xd66b6bbd, 0xde6f6fb1, 0x91c5c554, + 0x60303050, 0x02010103, 0xce6767a9, 0x562b2b7d, 0xe7fefe19, 0xb5d7d762, 0x4dababe6, 0xec76769a, + 0x8fcaca45, 0x1f82829d, 0x89c9c940, 0xfa7d7d87, 0xeffafa15, 0xb25959eb, 0x8e4747c9, 0xfbf0f00b, + 0x41adadec, 0xb3d4d467, 0x5fa2a2fd, 0x45afafea, 0x239c9cbf, 0x53a4a4f7, 0xe4727296, 0x9bc0c05b, + 0x75b7b7c2, 0xe1fdfd1c, 0x3d9393ae, 0x4c26266a, 0x6c36365a, 0x7e3f3f41, 0xf5f7f702, 0x83cccc4f, + 0x6834345c, 0x51a5a5f4, 0xd1e5e534, 0xf9f1f108, 0xe2717193, 0xabd8d873, 0x62313153, 0x2a15153f, + 0x0804040c, 0x95c7c752, 0x46232365, 0x9dc3c35e, 0x30181828, 0x379696a1, 0x0a05050f, 0x2f9a9ab5, + 0x0e070709, 0x24121236, 0x1b80809b, 0xdfe2e23d, 0xcdebeb26, 0x4e272769, 0x7fb2b2cd, 0xea75759f, + 0x1209091b, 0x1d83839e, 0x582c2c74, 0x341a1a2e, 0x361b1b2d, 0xdc6e6eb2, 0xb45a5aee, 0x5ba0a0fb, + 0xa45252f6, 0x763b3b4d, 0xb7d6d661, 0x7db3b3ce, 0x5229297b, 0xdde3e33e, 0x5e2f2f71, 0x13848497, + 0xa65353f5, 0xb9d1d168, 0x00000000, 0xc1eded2c, 0x40202060, 0xe3fcfc1f, 0x79b1b1c8, 0xb65b5bed, + 0xd46a6abe, 0x8dcbcb46, 0x67bebed9, 0x7239394b, 0x944a4ade, 0x984c4cd4, 0xb05858e8, 0x85cfcf4a, + 0xbbd0d06b, 0xc5efef2a, 0x4faaaae5, 0xedfbfb16, 0x864343c5, 0x9a4d4dd7, 0x66333355, 0x11858594, + 0x8a4545cf, 0xe9f9f910, 0x04020206, 0xfe7f7f81, 0xa05050f0, 0x783c3c44, 0x259f9fba, 0x4ba8a8e3, + 0xa25151f3, 0x5da3a3fe, 0x804040c0, 0x058f8f8a, 0x3f9292ad, 0x219d9dbc, 0x70383848, 0xf1f5f504, + 0x63bcbcdf, 0x77b6b6c1, 0xafdada75, 0x42212163, 0x20101030, 0xe5ffff1a, 0xfdf3f30e, 0xbfd2d26d, + 0x81cdcd4c, 0x180c0c14, 0x26131335, 0xc3ecec2f, 0xbe5f5fe1, 0x359797a2, 0x884444cc, 0x2e171739, + 0x93c4c457, 0x55a7a7f2, 0xfc7e7e82, 0x7a3d3d47, 0xc86464ac, 0xba5d5de7, 0x3219192b, 0xe6737395, + 0xc06060a0, 0x19818198, 0x9e4f4fd1, 0xa3dcdc7f, 0x44222266, 0x542a2a7e, 0x3b9090ab, 0x0b888883, + 0x8c4646ca, 0xc7eeee29, 0x6bb8b8d3, 0x2814143c, 0xa7dede79, 0xbc5e5ee2, 0x160b0b1d, 0xaddbdb76, + 0xdbe0e03b, 0x64323256, 0x743a3a4e, 0x140a0a1e, 0x924949db, 0x0c06060a, 0x4824246c, 0xb85c5ce4, + 0x9fc2c25d, 0xbdd3d36e, 0x43acacef, 0xc46262a6, 0x399191a8, 0x319595a4, 0xd3e4e437, 0xf279798b, + 0xd5e7e732, 0x8bc8c843, 0x6e373759, 0xda6d6db7, 0x018d8d8c, 0xb1d5d564, 0x9c4e4ed2, 0x49a9a9e0, + 0xd86c6cb4, 0xac5656fa, 0xf3f4f407, 0xcfeaea25, 0xca6565af, 0xf47a7a8e, 0x47aeaee9, 0x10080818, + 0x6fbabad5, 0xf0787888, 0x4a25256f, 0x5c2e2e72, 0x381c1c24, 0x57a6a6f1, 0x73b4b4c7, 0x97c6c651, + 0xcbe8e823, 0xa1dddd7c, 0xe874749c, 0x3e1f1f21, 0x964b4bdd, 0x61bdbddc, 0x0d8b8b86, 0x0f8a8a85, + 0xe0707090, 0x7c3e3e42, 0x71b5b5c4, 0xcc6666aa, 0x904848d8, 0x06030305, 0xf7f6f601, 0x1c0e0e12, + 0xc26161a3, 0x6a35355f, 0xae5757f9, 0x69b9b9d0, 0x17868691, 0x99c1c158, 0x3a1d1d27, 0x279e9eb9, + 0xd9e1e138, 0xebf8f813, 0x2b9898b3, 0x22111133, 0xd26969bb, 0xa9d9d970, 0x078e8e89, 0x339494a7, + 0x2d9b9bb6, 0x3c1e1e22, 0x15878792, 0xc9e9e920, 0x87cece49, 0xaa5555ff, 0x50282878, 0xa5dfdf7a, + 0x038c8c8f, 0x59a1a1f8, 0x09898980, 0x1a0d0d17, 0x65bfbfda, 0xd7e6e631, 0x844242c6, 0xd06868b8, + 0x824141c3, 0x299999b0, 0x5a2d2d77, 0x1e0f0f11, 0x7bb0b0cb, 0xa85454fc, 0x6dbbbbd6, 0x2c16163a, +} +var te1 = [256]uint32{ + 0xa5c66363, 0x84f87c7c, 0x99ee7777, 0x8df67b7b, 0x0dfff2f2, 0xbdd66b6b, 0xb1de6f6f, 0x5491c5c5, + 0x50603030, 0x03020101, 0xa9ce6767, 0x7d562b2b, 0x19e7fefe, 0x62b5d7d7, 0xe64dabab, 0x9aec7676, + 0x458fcaca, 0x9d1f8282, 0x4089c9c9, 0x87fa7d7d, 0x15effafa, 0xebb25959, 0xc98e4747, 0x0bfbf0f0, + 0xec41adad, 0x67b3d4d4, 0xfd5fa2a2, 0xea45afaf, 0xbf239c9c, 0xf753a4a4, 0x96e47272, 0x5b9bc0c0, + 0xc275b7b7, 0x1ce1fdfd, 0xae3d9393, 0x6a4c2626, 0x5a6c3636, 0x417e3f3f, 0x02f5f7f7, 0x4f83cccc, + 0x5c683434, 0xf451a5a5, 0x34d1e5e5, 0x08f9f1f1, 0x93e27171, 0x73abd8d8, 0x53623131, 0x3f2a1515, + 0x0c080404, 0x5295c7c7, 0x65462323, 0x5e9dc3c3, 0x28301818, 0xa1379696, 0x0f0a0505, 0xb52f9a9a, + 0x090e0707, 0x36241212, 0x9b1b8080, 0x3ddfe2e2, 0x26cdebeb, 0x694e2727, 0xcd7fb2b2, 0x9fea7575, + 0x1b120909, 0x9e1d8383, 0x74582c2c, 0x2e341a1a, 0x2d361b1b, 0xb2dc6e6e, 0xeeb45a5a, 0xfb5ba0a0, + 0xf6a45252, 0x4d763b3b, 0x61b7d6d6, 0xce7db3b3, 0x7b522929, 0x3edde3e3, 0x715e2f2f, 0x97138484, + 0xf5a65353, 0x68b9d1d1, 0x00000000, 0x2cc1eded, 0x60402020, 0x1fe3fcfc, 0xc879b1b1, 0xedb65b5b, + 0xbed46a6a, 0x468dcbcb, 0xd967bebe, 0x4b723939, 0xde944a4a, 0xd4984c4c, 0xe8b05858, 0x4a85cfcf, + 0x6bbbd0d0, 0x2ac5efef, 0xe54faaaa, 0x16edfbfb, 0xc5864343, 0xd79a4d4d, 0x55663333, 0x94118585, + 0xcf8a4545, 0x10e9f9f9, 0x06040202, 0x81fe7f7f, 0xf0a05050, 0x44783c3c, 0xba259f9f, 0xe34ba8a8, + 0xf3a25151, 0xfe5da3a3, 0xc0804040, 0x8a058f8f, 0xad3f9292, 0xbc219d9d, 0x48703838, 0x04f1f5f5, + 0xdf63bcbc, 0xc177b6b6, 0x75afdada, 0x63422121, 0x30201010, 0x1ae5ffff, 0x0efdf3f3, 0x6dbfd2d2, + 0x4c81cdcd, 0x14180c0c, 0x35261313, 0x2fc3ecec, 0xe1be5f5f, 0xa2359797, 0xcc884444, 0x392e1717, + 0x5793c4c4, 0xf255a7a7, 0x82fc7e7e, 0x477a3d3d, 0xacc86464, 0xe7ba5d5d, 0x2b321919, 0x95e67373, + 0xa0c06060, 0x98198181, 0xd19e4f4f, 0x7fa3dcdc, 0x66442222, 0x7e542a2a, 0xab3b9090, 0x830b8888, + 0xca8c4646, 0x29c7eeee, 0xd36bb8b8, 0x3c281414, 0x79a7dede, 0xe2bc5e5e, 0x1d160b0b, 0x76addbdb, + 0x3bdbe0e0, 0x56643232, 0x4e743a3a, 0x1e140a0a, 0xdb924949, 0x0a0c0606, 0x6c482424, 0xe4b85c5c, + 0x5d9fc2c2, 0x6ebdd3d3, 0xef43acac, 0xa6c46262, 0xa8399191, 0xa4319595, 0x37d3e4e4, 0x8bf27979, + 0x32d5e7e7, 0x438bc8c8, 0x596e3737, 0xb7da6d6d, 0x8c018d8d, 0x64b1d5d5, 0xd29c4e4e, 0xe049a9a9, + 0xb4d86c6c, 0xfaac5656, 0x07f3f4f4, 0x25cfeaea, 0xafca6565, 0x8ef47a7a, 0xe947aeae, 0x18100808, + 0xd56fbaba, 0x88f07878, 0x6f4a2525, 0x725c2e2e, 0x24381c1c, 0xf157a6a6, 0xc773b4b4, 0x5197c6c6, + 0x23cbe8e8, 0x7ca1dddd, 0x9ce87474, 0x213e1f1f, 0xdd964b4b, 0xdc61bdbd, 0x860d8b8b, 0x850f8a8a, + 0x90e07070, 0x427c3e3e, 0xc471b5b5, 0xaacc6666, 0xd8904848, 0x05060303, 0x01f7f6f6, 0x121c0e0e, + 0xa3c26161, 0x5f6a3535, 0xf9ae5757, 0xd069b9b9, 0x91178686, 0x5899c1c1, 0x273a1d1d, 0xb9279e9e, + 0x38d9e1e1, 0x13ebf8f8, 0xb32b9898, 0x33221111, 0xbbd26969, 0x70a9d9d9, 0x89078e8e, 0xa7339494, + 0xb62d9b9b, 0x223c1e1e, 0x92158787, 0x20c9e9e9, 0x4987cece, 0xffaa5555, 0x78502828, 0x7aa5dfdf, + 0x8f038c8c, 0xf859a1a1, 0x80098989, 0x171a0d0d, 0xda65bfbf, 0x31d7e6e6, 0xc6844242, 0xb8d06868, + 0xc3824141, 0xb0299999, 0x775a2d2d, 0x111e0f0f, 0xcb7bb0b0, 0xfca85454, 0xd66dbbbb, 0x3a2c1616, +} +var te2 = [256]uint32{ + 0x63a5c663, 0x7c84f87c, 0x7799ee77, 0x7b8df67b, 0xf20dfff2, 0x6bbdd66b, 0x6fb1de6f, 0xc55491c5, + 0x30506030, 0x01030201, 0x67a9ce67, 0x2b7d562b, 0xfe19e7fe, 0xd762b5d7, 0xabe64dab, 0x769aec76, + 0xca458fca, 0x829d1f82, 0xc94089c9, 0x7d87fa7d, 0xfa15effa, 0x59ebb259, 0x47c98e47, 0xf00bfbf0, + 0xadec41ad, 0xd467b3d4, 0xa2fd5fa2, 0xafea45af, 0x9cbf239c, 0xa4f753a4, 0x7296e472, 0xc05b9bc0, + 0xb7c275b7, 0xfd1ce1fd, 0x93ae3d93, 0x266a4c26, 0x365a6c36, 0x3f417e3f, 0xf702f5f7, 0xcc4f83cc, + 0x345c6834, 0xa5f451a5, 0xe534d1e5, 0xf108f9f1, 0x7193e271, 0xd873abd8, 0x31536231, 0x153f2a15, + 0x040c0804, 0xc75295c7, 0x23654623, 0xc35e9dc3, 0x18283018, 0x96a13796, 0x050f0a05, 0x9ab52f9a, + 0x07090e07, 0x12362412, 0x809b1b80, 0xe23ddfe2, 0xeb26cdeb, 0x27694e27, 0xb2cd7fb2, 0x759fea75, + 0x091b1209, 0x839e1d83, 0x2c74582c, 0x1a2e341a, 0x1b2d361b, 0x6eb2dc6e, 0x5aeeb45a, 0xa0fb5ba0, + 0x52f6a452, 0x3b4d763b, 0xd661b7d6, 0xb3ce7db3, 0x297b5229, 0xe33edde3, 0x2f715e2f, 0x84971384, + 0x53f5a653, 0xd168b9d1, 0x00000000, 0xed2cc1ed, 0x20604020, 0xfc1fe3fc, 0xb1c879b1, 0x5bedb65b, + 0x6abed46a, 0xcb468dcb, 0xbed967be, 0x394b7239, 0x4ade944a, 0x4cd4984c, 0x58e8b058, 0xcf4a85cf, + 0xd06bbbd0, 0xef2ac5ef, 0xaae54faa, 0xfb16edfb, 0x43c58643, 0x4dd79a4d, 0x33556633, 0x85941185, + 0x45cf8a45, 0xf910e9f9, 0x02060402, 0x7f81fe7f, 0x50f0a050, 0x3c44783c, 0x9fba259f, 0xa8e34ba8, + 0x51f3a251, 0xa3fe5da3, 0x40c08040, 0x8f8a058f, 0x92ad3f92, 0x9dbc219d, 0x38487038, 0xf504f1f5, + 0xbcdf63bc, 0xb6c177b6, 0xda75afda, 0x21634221, 0x10302010, 0xff1ae5ff, 0xf30efdf3, 0xd26dbfd2, + 0xcd4c81cd, 0x0c14180c, 0x13352613, 0xec2fc3ec, 0x5fe1be5f, 0x97a23597, 0x44cc8844, 0x17392e17, + 0xc45793c4, 0xa7f255a7, 0x7e82fc7e, 0x3d477a3d, 0x64acc864, 0x5de7ba5d, 0x192b3219, 0x7395e673, + 0x60a0c060, 0x81981981, 0x4fd19e4f, 0xdc7fa3dc, 0x22664422, 0x2a7e542a, 0x90ab3b90, 0x88830b88, + 0x46ca8c46, 0xee29c7ee, 0xb8d36bb8, 0x143c2814, 0xde79a7de, 0x5ee2bc5e, 0x0b1d160b, 0xdb76addb, + 0xe03bdbe0, 0x32566432, 0x3a4e743a, 0x0a1e140a, 0x49db9249, 0x060a0c06, 0x246c4824, 0x5ce4b85c, + 0xc25d9fc2, 0xd36ebdd3, 0xacef43ac, 0x62a6c462, 0x91a83991, 0x95a43195, 0xe437d3e4, 0x798bf279, + 0xe732d5e7, 0xc8438bc8, 0x37596e37, 0x6db7da6d, 0x8d8c018d, 0xd564b1d5, 0x4ed29c4e, 0xa9e049a9, + 0x6cb4d86c, 0x56faac56, 0xf407f3f4, 0xea25cfea, 0x65afca65, 0x7a8ef47a, 0xaee947ae, 0x08181008, + 0xbad56fba, 0x7888f078, 0x256f4a25, 0x2e725c2e, 0x1c24381c, 0xa6f157a6, 0xb4c773b4, 0xc65197c6, + 0xe823cbe8, 0xdd7ca1dd, 0x749ce874, 0x1f213e1f, 0x4bdd964b, 0xbddc61bd, 0x8b860d8b, 0x8a850f8a, + 0x7090e070, 0x3e427c3e, 0xb5c471b5, 0x66aacc66, 0x48d89048, 0x03050603, 0xf601f7f6, 0x0e121c0e, + 0x61a3c261, 0x355f6a35, 0x57f9ae57, 0xb9d069b9, 0x86911786, 0xc15899c1, 0x1d273a1d, 0x9eb9279e, + 0xe138d9e1, 0xf813ebf8, 0x98b32b98, 0x11332211, 0x69bbd269, 0xd970a9d9, 0x8e89078e, 0x94a73394, + 0x9bb62d9b, 0x1e223c1e, 0x87921587, 0xe920c9e9, 0xce4987ce, 0x55ffaa55, 0x28785028, 0xdf7aa5df, + 0x8c8f038c, 0xa1f859a1, 0x89800989, 0x0d171a0d, 0xbfda65bf, 0xe631d7e6, 0x42c68442, 0x68b8d068, + 0x41c38241, 0x99b02999, 0x2d775a2d, 0x0f111e0f, 0xb0cb7bb0, 0x54fca854, 0xbbd66dbb, 0x163a2c16, +} +var te3 = [256]uint32{ + 0x6363a5c6, 0x7c7c84f8, 0x777799ee, 0x7b7b8df6, 0xf2f20dff, 0x6b6bbdd6, 0x6f6fb1de, 0xc5c55491, + 0x30305060, 0x01010302, 0x6767a9ce, 0x2b2b7d56, 0xfefe19e7, 0xd7d762b5, 0xababe64d, 0x76769aec, + 0xcaca458f, 0x82829d1f, 0xc9c94089, 0x7d7d87fa, 0xfafa15ef, 0x5959ebb2, 0x4747c98e, 0xf0f00bfb, + 0xadadec41, 0xd4d467b3, 0xa2a2fd5f, 0xafafea45, 0x9c9cbf23, 0xa4a4f753, 0x727296e4, 0xc0c05b9b, + 0xb7b7c275, 0xfdfd1ce1, 0x9393ae3d, 0x26266a4c, 0x36365a6c, 0x3f3f417e, 0xf7f702f5, 0xcccc4f83, + 0x34345c68, 0xa5a5f451, 0xe5e534d1, 0xf1f108f9, 0x717193e2, 0xd8d873ab, 0x31315362, 0x15153f2a, + 0x04040c08, 0xc7c75295, 0x23236546, 0xc3c35e9d, 0x18182830, 0x9696a137, 0x05050f0a, 0x9a9ab52f, + 0x0707090e, 0x12123624, 0x80809b1b, 0xe2e23ddf, 0xebeb26cd, 0x2727694e, 0xb2b2cd7f, 0x75759fea, + 0x09091b12, 0x83839e1d, 0x2c2c7458, 0x1a1a2e34, 0x1b1b2d36, 0x6e6eb2dc, 0x5a5aeeb4, 0xa0a0fb5b, + 0x5252f6a4, 0x3b3b4d76, 0xd6d661b7, 0xb3b3ce7d, 0x29297b52, 0xe3e33edd, 0x2f2f715e, 0x84849713, + 0x5353f5a6, 0xd1d168b9, 0x00000000, 0xeded2cc1, 0x20206040, 0xfcfc1fe3, 0xb1b1c879, 0x5b5bedb6, + 0x6a6abed4, 0xcbcb468d, 0xbebed967, 0x39394b72, 0x4a4ade94, 0x4c4cd498, 0x5858e8b0, 0xcfcf4a85, + 0xd0d06bbb, 0xefef2ac5, 0xaaaae54f, 0xfbfb16ed, 0x4343c586, 0x4d4dd79a, 0x33335566, 0x85859411, + 0x4545cf8a, 0xf9f910e9, 0x02020604, 0x7f7f81fe, 0x5050f0a0, 0x3c3c4478, 0x9f9fba25, 0xa8a8e34b, + 0x5151f3a2, 0xa3a3fe5d, 0x4040c080, 0x8f8f8a05, 0x9292ad3f, 0x9d9dbc21, 0x38384870, 0xf5f504f1, + 0xbcbcdf63, 0xb6b6c177, 0xdada75af, 0x21216342, 0x10103020, 0xffff1ae5, 0xf3f30efd, 0xd2d26dbf, + 0xcdcd4c81, 0x0c0c1418, 0x13133526, 0xecec2fc3, 0x5f5fe1be, 0x9797a235, 0x4444cc88, 0x1717392e, + 0xc4c45793, 0xa7a7f255, 0x7e7e82fc, 0x3d3d477a, 0x6464acc8, 0x5d5de7ba, 0x19192b32, 0x737395e6, + 0x6060a0c0, 0x81819819, 0x4f4fd19e, 0xdcdc7fa3, 0x22226644, 0x2a2a7e54, 0x9090ab3b, 0x8888830b, + 0x4646ca8c, 0xeeee29c7, 0xb8b8d36b, 0x14143c28, 0xdede79a7, 0x5e5ee2bc, 0x0b0b1d16, 0xdbdb76ad, + 0xe0e03bdb, 0x32325664, 0x3a3a4e74, 0x0a0a1e14, 0x4949db92, 0x06060a0c, 0x24246c48, 0x5c5ce4b8, + 0xc2c25d9f, 0xd3d36ebd, 0xacacef43, 0x6262a6c4, 0x9191a839, 0x9595a431, 0xe4e437d3, 0x79798bf2, + 0xe7e732d5, 0xc8c8438b, 0x3737596e, 0x6d6db7da, 0x8d8d8c01, 0xd5d564b1, 0x4e4ed29c, 0xa9a9e049, + 0x6c6cb4d8, 0x5656faac, 0xf4f407f3, 0xeaea25cf, 0x6565afca, 0x7a7a8ef4, 0xaeaee947, 0x08081810, + 0xbabad56f, 0x787888f0, 0x25256f4a, 0x2e2e725c, 0x1c1c2438, 0xa6a6f157, 0xb4b4c773, 0xc6c65197, + 0xe8e823cb, 0xdddd7ca1, 0x74749ce8, 0x1f1f213e, 0x4b4bdd96, 0xbdbddc61, 0x8b8b860d, 0x8a8a850f, + 0x707090e0, 0x3e3e427c, 0xb5b5c471, 0x6666aacc, 0x4848d890, 0x03030506, 0xf6f601f7, 0x0e0e121c, + 0x6161a3c2, 0x35355f6a, 0x5757f9ae, 0xb9b9d069, 0x86869117, 0xc1c15899, 0x1d1d273a, 0x9e9eb927, + 0xe1e138d9, 0xf8f813eb, 0x9898b32b, 0x11113322, 0x6969bbd2, 0xd9d970a9, 0x8e8e8907, 0x9494a733, + 0x9b9bb62d, 0x1e1e223c, 0x87879215, 0xe9e920c9, 0xcece4987, 0x5555ffaa, 0x28287850, 0xdfdf7aa5, + 0x8c8c8f03, 0xa1a1f859, 0x89898009, 0x0d0d171a, 0xbfbfda65, 0xe6e631d7, 0x4242c684, 0x6868b8d0, + 0x4141c382, 0x9999b029, 0x2d2d775a, 0x0f0f111e, 0xb0b0cb7b, 0x5454fca8, 0xbbbbd66d, 0x16163a2c, +} + +// Lookup tables for decryption. +// These can be recomputed by adapting the tests in aes_test.go. + +var td0 = [256]uint32{ + 0x51f4a750, 0x7e416553, 0x1a17a4c3, 0x3a275e96, 0x3bab6bcb, 0x1f9d45f1, 0xacfa58ab, 0x4be30393, + 0x2030fa55, 0xad766df6, 0x88cc7691, 0xf5024c25, 0x4fe5d7fc, 0xc52acbd7, 0x26354480, 0xb562a38f, + 0xdeb15a49, 0x25ba1b67, 0x45ea0e98, 0x5dfec0e1, 0xc32f7502, 0x814cf012, 0x8d4697a3, 0x6bd3f9c6, + 0x038f5fe7, 0x15929c95, 0xbf6d7aeb, 0x955259da, 0xd4be832d, 0x587421d3, 0x49e06929, 0x8ec9c844, + 0x75c2896a, 0xf48e7978, 0x99583e6b, 0x27b971dd, 0xbee14fb6, 0xf088ad17, 0xc920ac66, 0x7dce3ab4, + 0x63df4a18, 0xe51a3182, 0x97513360, 0x62537f45, 0xb16477e0, 0xbb6bae84, 0xfe81a01c, 0xf9082b94, + 0x70486858, 0x8f45fd19, 0x94de6c87, 0x527bf8b7, 0xab73d323, 0x724b02e2, 0xe31f8f57, 0x6655ab2a, + 0xb2eb2807, 0x2fb5c203, 0x86c57b9a, 0xd33708a5, 0x302887f2, 0x23bfa5b2, 0x02036aba, 0xed16825c, + 0x8acf1c2b, 0xa779b492, 0xf307f2f0, 0x4e69e2a1, 0x65daf4cd, 0x0605bed5, 0xd134621f, 0xc4a6fe8a, + 0x342e539d, 0xa2f355a0, 0x058ae132, 0xa4f6eb75, 0x0b83ec39, 0x4060efaa, 0x5e719f06, 0xbd6e1051, + 0x3e218af9, 0x96dd063d, 0xdd3e05ae, 0x4de6bd46, 0x91548db5, 0x71c45d05, 0x0406d46f, 0x605015ff, + 0x1998fb24, 0xd6bde997, 0x894043cc, 0x67d99e77, 0xb0e842bd, 0x07898b88, 0xe7195b38, 0x79c8eedb, + 0xa17c0a47, 0x7c420fe9, 0xf8841ec9, 0x00000000, 0x09808683, 0x322bed48, 0x1e1170ac, 0x6c5a724e, + 0xfd0efffb, 0x0f853856, 0x3daed51e, 0x362d3927, 0x0a0fd964, 0x685ca621, 0x9b5b54d1, 0x24362e3a, + 0x0c0a67b1, 0x9357e70f, 0xb4ee96d2, 0x1b9b919e, 0x80c0c54f, 0x61dc20a2, 0x5a774b69, 0x1c121a16, + 0xe293ba0a, 0xc0a02ae5, 0x3c22e043, 0x121b171d, 0x0e090d0b, 0xf28bc7ad, 0x2db6a8b9, 0x141ea9c8, + 0x57f11985, 0xaf75074c, 0xee99ddbb, 0xa37f60fd, 0xf701269f, 0x5c72f5bc, 0x44663bc5, 0x5bfb7e34, + 0x8b432976, 0xcb23c6dc, 0xb6edfc68, 0xb8e4f163, 0xd731dcca, 0x42638510, 0x13972240, 0x84c61120, + 0x854a247d, 0xd2bb3df8, 0xaef93211, 0xc729a16d, 0x1d9e2f4b, 0xdcb230f3, 0x0d8652ec, 0x77c1e3d0, + 0x2bb3166c, 0xa970b999, 0x119448fa, 0x47e96422, 0xa8fc8cc4, 0xa0f03f1a, 0x567d2cd8, 0x223390ef, + 0x87494ec7, 0xd938d1c1, 0x8ccaa2fe, 0x98d40b36, 0xa6f581cf, 0xa57ade28, 0xdab78e26, 0x3fadbfa4, + 0x2c3a9de4, 0x5078920d, 0x6a5fcc9b, 0x547e4662, 0xf68d13c2, 0x90d8b8e8, 0x2e39f75e, 0x82c3aff5, + 0x9f5d80be, 0x69d0937c, 0x6fd52da9, 0xcf2512b3, 0xc8ac993b, 0x10187da7, 0xe89c636e, 0xdb3bbb7b, + 0xcd267809, 0x6e5918f4, 0xec9ab701, 0x834f9aa8, 0xe6956e65, 0xaaffe67e, 0x21bccf08, 0xef15e8e6, + 0xbae79bd9, 0x4a6f36ce, 0xea9f09d4, 0x29b07cd6, 0x31a4b2af, 0x2a3f2331, 0xc6a59430, 0x35a266c0, + 0x744ebc37, 0xfc82caa6, 0xe090d0b0, 0x33a7d815, 0xf104984a, 0x41ecdaf7, 0x7fcd500e, 0x1791f62f, + 0x764dd68d, 0x43efb04d, 0xccaa4d54, 0xe49604df, 0x9ed1b5e3, 0x4c6a881b, 0xc12c1fb8, 0x4665517f, + 0x9d5eea04, 0x018c355d, 0xfa877473, 0xfb0b412e, 0xb3671d5a, 0x92dbd252, 0xe9105633, 0x6dd64713, + 0x9ad7618c, 0x37a10c7a, 0x59f8148e, 0xeb133c89, 0xcea927ee, 0xb761c935, 0xe11ce5ed, 0x7a47b13c, + 0x9cd2df59, 0x55f2733f, 0x1814ce79, 0x73c737bf, 0x53f7cdea, 0x5ffdaa5b, 0xdf3d6f14, 0x7844db86, + 0xcaaff381, 0xb968c43e, 0x3824342c, 0xc2a3405f, 0x161dc372, 0xbce2250c, 0x283c498b, 0xff0d9541, + 0x39a80171, 0x080cb3de, 0xd8b4e49c, 0x6456c190, 0x7bcb8461, 0xd532b670, 0x486c5c74, 0xd0b85742, +} +var td1 = [256]uint32{ + 0x5051f4a7, 0x537e4165, 0xc31a17a4, 0x963a275e, 0xcb3bab6b, 0xf11f9d45, 0xabacfa58, 0x934be303, + 0x552030fa, 0xf6ad766d, 0x9188cc76, 0x25f5024c, 0xfc4fe5d7, 0xd7c52acb, 0x80263544, 0x8fb562a3, + 0x49deb15a, 0x6725ba1b, 0x9845ea0e, 0xe15dfec0, 0x02c32f75, 0x12814cf0, 0xa38d4697, 0xc66bd3f9, + 0xe7038f5f, 0x9515929c, 0xebbf6d7a, 0xda955259, 0x2dd4be83, 0xd3587421, 0x2949e069, 0x448ec9c8, + 0x6a75c289, 0x78f48e79, 0x6b99583e, 0xdd27b971, 0xb6bee14f, 0x17f088ad, 0x66c920ac, 0xb47dce3a, + 0x1863df4a, 0x82e51a31, 0x60975133, 0x4562537f, 0xe0b16477, 0x84bb6bae, 0x1cfe81a0, 0x94f9082b, + 0x58704868, 0x198f45fd, 0x8794de6c, 0xb7527bf8, 0x23ab73d3, 0xe2724b02, 0x57e31f8f, 0x2a6655ab, + 0x07b2eb28, 0x032fb5c2, 0x9a86c57b, 0xa5d33708, 0xf2302887, 0xb223bfa5, 0xba02036a, 0x5ced1682, + 0x2b8acf1c, 0x92a779b4, 0xf0f307f2, 0xa14e69e2, 0xcd65daf4, 0xd50605be, 0x1fd13462, 0x8ac4a6fe, + 0x9d342e53, 0xa0a2f355, 0x32058ae1, 0x75a4f6eb, 0x390b83ec, 0xaa4060ef, 0x065e719f, 0x51bd6e10, + 0xf93e218a, 0x3d96dd06, 0xaedd3e05, 0x464de6bd, 0xb591548d, 0x0571c45d, 0x6f0406d4, 0xff605015, + 0x241998fb, 0x97d6bde9, 0xcc894043, 0x7767d99e, 0xbdb0e842, 0x8807898b, 0x38e7195b, 0xdb79c8ee, + 0x47a17c0a, 0xe97c420f, 0xc9f8841e, 0x00000000, 0x83098086, 0x48322bed, 0xac1e1170, 0x4e6c5a72, + 0xfbfd0eff, 0x560f8538, 0x1e3daed5, 0x27362d39, 0x640a0fd9, 0x21685ca6, 0xd19b5b54, 0x3a24362e, + 0xb10c0a67, 0x0f9357e7, 0xd2b4ee96, 0x9e1b9b91, 0x4f80c0c5, 0xa261dc20, 0x695a774b, 0x161c121a, + 0x0ae293ba, 0xe5c0a02a, 0x433c22e0, 0x1d121b17, 0x0b0e090d, 0xadf28bc7, 0xb92db6a8, 0xc8141ea9, + 0x8557f119, 0x4caf7507, 0xbbee99dd, 0xfda37f60, 0x9ff70126, 0xbc5c72f5, 0xc544663b, 0x345bfb7e, + 0x768b4329, 0xdccb23c6, 0x68b6edfc, 0x63b8e4f1, 0xcad731dc, 0x10426385, 0x40139722, 0x2084c611, + 0x7d854a24, 0xf8d2bb3d, 0x11aef932, 0x6dc729a1, 0x4b1d9e2f, 0xf3dcb230, 0xec0d8652, 0xd077c1e3, + 0x6c2bb316, 0x99a970b9, 0xfa119448, 0x2247e964, 0xc4a8fc8c, 0x1aa0f03f, 0xd8567d2c, 0xef223390, + 0xc787494e, 0xc1d938d1, 0xfe8ccaa2, 0x3698d40b, 0xcfa6f581, 0x28a57ade, 0x26dab78e, 0xa43fadbf, + 0xe42c3a9d, 0x0d507892, 0x9b6a5fcc, 0x62547e46, 0xc2f68d13, 0xe890d8b8, 0x5e2e39f7, 0xf582c3af, + 0xbe9f5d80, 0x7c69d093, 0xa96fd52d, 0xb3cf2512, 0x3bc8ac99, 0xa710187d, 0x6ee89c63, 0x7bdb3bbb, + 0x09cd2678, 0xf46e5918, 0x01ec9ab7, 0xa8834f9a, 0x65e6956e, 0x7eaaffe6, 0x0821bccf, 0xe6ef15e8, + 0xd9bae79b, 0xce4a6f36, 0xd4ea9f09, 0xd629b07c, 0xaf31a4b2, 0x312a3f23, 0x30c6a594, 0xc035a266, + 0x37744ebc, 0xa6fc82ca, 0xb0e090d0, 0x1533a7d8, 0x4af10498, 0xf741ecda, 0x0e7fcd50, 0x2f1791f6, + 0x8d764dd6, 0x4d43efb0, 0x54ccaa4d, 0xdfe49604, 0xe39ed1b5, 0x1b4c6a88, 0xb8c12c1f, 0x7f466551, + 0x049d5eea, 0x5d018c35, 0x73fa8774, 0x2efb0b41, 0x5ab3671d, 0x5292dbd2, 0x33e91056, 0x136dd647, + 0x8c9ad761, 0x7a37a10c, 0x8e59f814, 0x89eb133c, 0xeecea927, 0x35b761c9, 0xede11ce5, 0x3c7a47b1, + 0x599cd2df, 0x3f55f273, 0x791814ce, 0xbf73c737, 0xea53f7cd, 0x5b5ffdaa, 0x14df3d6f, 0x867844db, + 0x81caaff3, 0x3eb968c4, 0x2c382434, 0x5fc2a340, 0x72161dc3, 0x0cbce225, 0x8b283c49, 0x41ff0d95, + 0x7139a801, 0xde080cb3, 0x9cd8b4e4, 0x906456c1, 0x617bcb84, 0x70d532b6, 0x74486c5c, 0x42d0b857, +} +var td2 = [256]uint32{ + 0xa75051f4, 0x65537e41, 0xa4c31a17, 0x5e963a27, 0x6bcb3bab, 0x45f11f9d, 0x58abacfa, 0x03934be3, + 0xfa552030, 0x6df6ad76, 0x769188cc, 0x4c25f502, 0xd7fc4fe5, 0xcbd7c52a, 0x44802635, 0xa38fb562, + 0x5a49deb1, 0x1b6725ba, 0x0e9845ea, 0xc0e15dfe, 0x7502c32f, 0xf012814c, 0x97a38d46, 0xf9c66bd3, + 0x5fe7038f, 0x9c951592, 0x7aebbf6d, 0x59da9552, 0x832dd4be, 0x21d35874, 0x692949e0, 0xc8448ec9, + 0x896a75c2, 0x7978f48e, 0x3e6b9958, 0x71dd27b9, 0x4fb6bee1, 0xad17f088, 0xac66c920, 0x3ab47dce, + 0x4a1863df, 0x3182e51a, 0x33609751, 0x7f456253, 0x77e0b164, 0xae84bb6b, 0xa01cfe81, 0x2b94f908, + 0x68587048, 0xfd198f45, 0x6c8794de, 0xf8b7527b, 0xd323ab73, 0x02e2724b, 0x8f57e31f, 0xab2a6655, + 0x2807b2eb, 0xc2032fb5, 0x7b9a86c5, 0x08a5d337, 0x87f23028, 0xa5b223bf, 0x6aba0203, 0x825ced16, + 0x1c2b8acf, 0xb492a779, 0xf2f0f307, 0xe2a14e69, 0xf4cd65da, 0xbed50605, 0x621fd134, 0xfe8ac4a6, + 0x539d342e, 0x55a0a2f3, 0xe132058a, 0xeb75a4f6, 0xec390b83, 0xefaa4060, 0x9f065e71, 0x1051bd6e, + 0x8af93e21, 0x063d96dd, 0x05aedd3e, 0xbd464de6, 0x8db59154, 0x5d0571c4, 0xd46f0406, 0x15ff6050, + 0xfb241998, 0xe997d6bd, 0x43cc8940, 0x9e7767d9, 0x42bdb0e8, 0x8b880789, 0x5b38e719, 0xeedb79c8, + 0x0a47a17c, 0x0fe97c42, 0x1ec9f884, 0x00000000, 0x86830980, 0xed48322b, 0x70ac1e11, 0x724e6c5a, + 0xfffbfd0e, 0x38560f85, 0xd51e3dae, 0x3927362d, 0xd9640a0f, 0xa621685c, 0x54d19b5b, 0x2e3a2436, + 0x67b10c0a, 0xe70f9357, 0x96d2b4ee, 0x919e1b9b, 0xc54f80c0, 0x20a261dc, 0x4b695a77, 0x1a161c12, + 0xba0ae293, 0x2ae5c0a0, 0xe0433c22, 0x171d121b, 0x0d0b0e09, 0xc7adf28b, 0xa8b92db6, 0xa9c8141e, + 0x198557f1, 0x074caf75, 0xddbbee99, 0x60fda37f, 0x269ff701, 0xf5bc5c72, 0x3bc54466, 0x7e345bfb, + 0x29768b43, 0xc6dccb23, 0xfc68b6ed, 0xf163b8e4, 0xdccad731, 0x85104263, 0x22401397, 0x112084c6, + 0x247d854a, 0x3df8d2bb, 0x3211aef9, 0xa16dc729, 0x2f4b1d9e, 0x30f3dcb2, 0x52ec0d86, 0xe3d077c1, + 0x166c2bb3, 0xb999a970, 0x48fa1194, 0x642247e9, 0x8cc4a8fc, 0x3f1aa0f0, 0x2cd8567d, 0x90ef2233, + 0x4ec78749, 0xd1c1d938, 0xa2fe8cca, 0x0b3698d4, 0x81cfa6f5, 0xde28a57a, 0x8e26dab7, 0xbfa43fad, + 0x9de42c3a, 0x920d5078, 0xcc9b6a5f, 0x4662547e, 0x13c2f68d, 0xb8e890d8, 0xf75e2e39, 0xaff582c3, + 0x80be9f5d, 0x937c69d0, 0x2da96fd5, 0x12b3cf25, 0x993bc8ac, 0x7da71018, 0x636ee89c, 0xbb7bdb3b, + 0x7809cd26, 0x18f46e59, 0xb701ec9a, 0x9aa8834f, 0x6e65e695, 0xe67eaaff, 0xcf0821bc, 0xe8e6ef15, + 0x9bd9bae7, 0x36ce4a6f, 0x09d4ea9f, 0x7cd629b0, 0xb2af31a4, 0x23312a3f, 0x9430c6a5, 0x66c035a2, + 0xbc37744e, 0xcaa6fc82, 0xd0b0e090, 0xd81533a7, 0x984af104, 0xdaf741ec, 0x500e7fcd, 0xf62f1791, + 0xd68d764d, 0xb04d43ef, 0x4d54ccaa, 0x04dfe496, 0xb5e39ed1, 0x881b4c6a, 0x1fb8c12c, 0x517f4665, + 0xea049d5e, 0x355d018c, 0x7473fa87, 0x412efb0b, 0x1d5ab367, 0xd25292db, 0x5633e910, 0x47136dd6, + 0x618c9ad7, 0x0c7a37a1, 0x148e59f8, 0x3c89eb13, 0x27eecea9, 0xc935b761, 0xe5ede11c, 0xb13c7a47, + 0xdf599cd2, 0x733f55f2, 0xce791814, 0x37bf73c7, 0xcdea53f7, 0xaa5b5ffd, 0x6f14df3d, 0xdb867844, + 0xf381caaf, 0xc43eb968, 0x342c3824, 0x405fc2a3, 0xc372161d, 0x250cbce2, 0x498b283c, 0x9541ff0d, + 0x017139a8, 0xb3de080c, 0xe49cd8b4, 0xc1906456, 0x84617bcb, 0xb670d532, 0x5c74486c, 0x5742d0b8, +} +var td3 = [256]uint32{ + 0xf4a75051, 0x4165537e, 0x17a4c31a, 0x275e963a, 0xab6bcb3b, 0x9d45f11f, 0xfa58abac, 0xe303934b, + 0x30fa5520, 0x766df6ad, 0xcc769188, 0x024c25f5, 0xe5d7fc4f, 0x2acbd7c5, 0x35448026, 0x62a38fb5, + 0xb15a49de, 0xba1b6725, 0xea0e9845, 0xfec0e15d, 0x2f7502c3, 0x4cf01281, 0x4697a38d, 0xd3f9c66b, + 0x8f5fe703, 0x929c9515, 0x6d7aebbf, 0x5259da95, 0xbe832dd4, 0x7421d358, 0xe0692949, 0xc9c8448e, + 0xc2896a75, 0x8e7978f4, 0x583e6b99, 0xb971dd27, 0xe14fb6be, 0x88ad17f0, 0x20ac66c9, 0xce3ab47d, + 0xdf4a1863, 0x1a3182e5, 0x51336097, 0x537f4562, 0x6477e0b1, 0x6bae84bb, 0x81a01cfe, 0x082b94f9, + 0x48685870, 0x45fd198f, 0xde6c8794, 0x7bf8b752, 0x73d323ab, 0x4b02e272, 0x1f8f57e3, 0x55ab2a66, + 0xeb2807b2, 0xb5c2032f, 0xc57b9a86, 0x3708a5d3, 0x2887f230, 0xbfa5b223, 0x036aba02, 0x16825ced, + 0xcf1c2b8a, 0x79b492a7, 0x07f2f0f3, 0x69e2a14e, 0xdaf4cd65, 0x05bed506, 0x34621fd1, 0xa6fe8ac4, + 0x2e539d34, 0xf355a0a2, 0x8ae13205, 0xf6eb75a4, 0x83ec390b, 0x60efaa40, 0x719f065e, 0x6e1051bd, + 0x218af93e, 0xdd063d96, 0x3e05aedd, 0xe6bd464d, 0x548db591, 0xc45d0571, 0x06d46f04, 0x5015ff60, + 0x98fb2419, 0xbde997d6, 0x4043cc89, 0xd99e7767, 0xe842bdb0, 0x898b8807, 0x195b38e7, 0xc8eedb79, + 0x7c0a47a1, 0x420fe97c, 0x841ec9f8, 0x00000000, 0x80868309, 0x2bed4832, 0x1170ac1e, 0x5a724e6c, + 0x0efffbfd, 0x8538560f, 0xaed51e3d, 0x2d392736, 0x0fd9640a, 0x5ca62168, 0x5b54d19b, 0x362e3a24, + 0x0a67b10c, 0x57e70f93, 0xee96d2b4, 0x9b919e1b, 0xc0c54f80, 0xdc20a261, 0x774b695a, 0x121a161c, + 0x93ba0ae2, 0xa02ae5c0, 0x22e0433c, 0x1b171d12, 0x090d0b0e, 0x8bc7adf2, 0xb6a8b92d, 0x1ea9c814, + 0xf1198557, 0x75074caf, 0x99ddbbee, 0x7f60fda3, 0x01269ff7, 0x72f5bc5c, 0x663bc544, 0xfb7e345b, + 0x4329768b, 0x23c6dccb, 0xedfc68b6, 0xe4f163b8, 0x31dccad7, 0x63851042, 0x97224013, 0xc6112084, + 0x4a247d85, 0xbb3df8d2, 0xf93211ae, 0x29a16dc7, 0x9e2f4b1d, 0xb230f3dc, 0x8652ec0d, 0xc1e3d077, + 0xb3166c2b, 0x70b999a9, 0x9448fa11, 0xe9642247, 0xfc8cc4a8, 0xf03f1aa0, 0x7d2cd856, 0x3390ef22, + 0x494ec787, 0x38d1c1d9, 0xcaa2fe8c, 0xd40b3698, 0xf581cfa6, 0x7ade28a5, 0xb78e26da, 0xadbfa43f, + 0x3a9de42c, 0x78920d50, 0x5fcc9b6a, 0x7e466254, 0x8d13c2f6, 0xd8b8e890, 0x39f75e2e, 0xc3aff582, + 0x5d80be9f, 0xd0937c69, 0xd52da96f, 0x2512b3cf, 0xac993bc8, 0x187da710, 0x9c636ee8, 0x3bbb7bdb, + 0x267809cd, 0x5918f46e, 0x9ab701ec, 0x4f9aa883, 0x956e65e6, 0xffe67eaa, 0xbccf0821, 0x15e8e6ef, + 0xe79bd9ba, 0x6f36ce4a, 0x9f09d4ea, 0xb07cd629, 0xa4b2af31, 0x3f23312a, 0xa59430c6, 0xa266c035, + 0x4ebc3774, 0x82caa6fc, 0x90d0b0e0, 0xa7d81533, 0x04984af1, 0xecdaf741, 0xcd500e7f, 0x91f62f17, + 0x4dd68d76, 0xefb04d43, 0xaa4d54cc, 0x9604dfe4, 0xd1b5e39e, 0x6a881b4c, 0x2c1fb8c1, 0x65517f46, + 0x5eea049d, 0x8c355d01, 0x877473fa, 0x0b412efb, 0x671d5ab3, 0xdbd25292, 0x105633e9, 0xd647136d, + 0xd7618c9a, 0xa10c7a37, 0xf8148e59, 0x133c89eb, 0xa927eece, 0x61c935b7, 0x1ce5ede1, 0x47b13c7a, + 0xd2df599c, 0xf2733f55, 0x14ce7918, 0xc737bf73, 0xf7cdea53, 0xfdaa5b5f, 0x3d6f14df, 0x44db8678, + 0xaff381ca, 0x68c43eb9, 0x24342c38, 0xa3405fc2, 0x1dc37216, 0xe2250cbc, 0x3c498b28, 0x0d9541ff, + 0xa8017139, 0x0cb3de08, 0xb4e49cd8, 0x56c19064, 0xcb84617b, 0x32b670d5, 0x6c5c7448, 0xb85742d0, +} diff --git a/src/crypto/cipher/benchmark_test.go b/src/crypto/cipher/benchmark_test.go new file mode 100644 index 0000000000000000000000000000000000000000..027b24851055080af962b010609e510d7c7c8b36 --- /dev/null +++ b/src/crypto/cipher/benchmark_test.go @@ -0,0 +1,139 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package cipher_test + +import ( + "crypto/aes" + "crypto/cipher" + "testing" +) + +func BenchmarkAESGCMSeal1K(b *testing.B) { + buf := make([]byte, 1024) + b.SetBytes(int64(len(buf))) + + var key [16]byte + var nonce [12]byte + aes, _ := aes.NewCipher(key[:]) + aesgcm, _ := cipher.NewGCM(aes) + var out []byte + + b.ResetTimer() + for i := 0; i < b.N; i++ { + out = aesgcm.Seal(out[:0], nonce[:], buf, nonce[:]) + } +} + +func BenchmarkAESGCMOpen1K(b *testing.B) { + buf := make([]byte, 1024) + b.SetBytes(int64(len(buf))) + + var key [16]byte + var nonce [12]byte + aes, _ := aes.NewCipher(key[:]) + aesgcm, _ := cipher.NewGCM(aes) + var out []byte + out = aesgcm.Seal(out[:0], nonce[:], buf, nonce[:]) + + b.ResetTimer() + for i := 0; i < b.N; i++ { + _, err := aesgcm.Open(buf[:0], nonce[:], out, nonce[:]) + if err != nil { + b.Errorf("Open: %v", err) + } + } +} + +// If we test exactly 1K blocks, we would generate exact multiples of +// the cipher's block size, and the cipher stream fragments would +// always be wordsize aligned, whereas non-aligned is a more typical +// use-case. +const almost1K = 1024 - 5 + +func BenchmarkAESCFBEncrypt1K(b *testing.B) { + buf := make([]byte, almost1K) + b.SetBytes(int64(len(buf))) + + var key [16]byte + var iv [16]byte + aes, _ := aes.NewCipher(key[:]) + ctr := cipher.NewCFBEncrypter(aes, iv[:]) + + b.ResetTimer() + for i := 0; i < b.N; i++ { + ctr.XORKeyStream(buf, buf) + } +} + +func BenchmarkAESCFBDecrypt1K(b *testing.B) { + buf := make([]byte, almost1K) + b.SetBytes(int64(len(buf))) + + var key [16]byte + var iv [16]byte + aes, _ := aes.NewCipher(key[:]) + ctr := cipher.NewCFBDecrypter(aes, iv[:]) + + b.ResetTimer() + for i := 0; i < b.N; i++ { + ctr.XORKeyStream(buf, buf) + } +} + +func BenchmarkAESOFB1K(b *testing.B) { + buf := make([]byte, almost1K) + b.SetBytes(int64(len(buf))) + + var key [16]byte + var iv [16]byte + aes, _ := aes.NewCipher(key[:]) + ctr := cipher.NewOFB(aes, iv[:]) + + b.ResetTimer() + for i := 0; i < b.N; i++ { + ctr.XORKeyStream(buf, buf) + } +} + +func BenchmarkAESCTR1K(b *testing.B) { + buf := make([]byte, almost1K) + b.SetBytes(int64(len(buf))) + + var key [16]byte + var iv [16]byte + aes, _ := aes.NewCipher(key[:]) + ctr := cipher.NewCTR(aes, iv[:]) + + b.ResetTimer() + for i := 0; i < b.N; i++ { + ctr.XORKeyStream(buf, buf) + } +} + +func BenchmarkAESCBCEncrypt1K(b *testing.B) { + buf := make([]byte, 1024) + b.SetBytes(int64(len(buf))) + + var key [16]byte + var iv [16]byte + aes, _ := aes.NewCipher(key[:]) + cbc := cipher.NewCBCEncrypter(aes, iv[:]) + for i := 0; i < b.N; i++ { + cbc.CryptBlocks(buf, buf) + } +} + +func BenchmarkAESCBCDecrypt1K(b *testing.B) { + buf := make([]byte, 1024) + b.SetBytes(int64(len(buf))) + + var key [16]byte + var iv [16]byte + aes, _ := aes.NewCipher(key[:]) + cbc := cipher.NewCBCDecrypter(aes, iv[:]) + for i := 0; i < b.N; i++ { + cbc.CryptBlocks(buf, buf) + } +} diff --git a/src/crypto/cipher/cbc.go b/src/crypto/cipher/cbc.go new file mode 100644 index 0000000000000000000000000000000000000000..241e122ee80079e31e36d6b545ba9b00a4893fd6 --- /dev/null +++ b/src/crypto/cipher/cbc.go @@ -0,0 +1,133 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Cipher block chaining (CBC) mode. + +// CBC provides confidentiality by xoring (chaining) each plaintext block +// with the previous ciphertext block before applying the block cipher. + +// See NIST SP 800-38A, pp 10-11 + +package cipher + +type cbc struct { + b Block + blockSize int + iv []byte + tmp []byte +} + +func newCBC(b Block, iv []byte) *cbc { + return &cbc{ + b: b, + blockSize: b.BlockSize(), + iv: dup(iv), + tmp: make([]byte, b.BlockSize()), + } +} + +type cbcEncrypter cbc + +// NewCBCEncrypter returns a BlockMode which encrypts in cipher block chaining +// mode, using the given Block. The length of iv must be the same as the +// Block's block size. +func NewCBCEncrypter(b Block, iv []byte) BlockMode { + if len(iv) != b.BlockSize() { + panic("cipher.NewCBCEncrypter: IV length must equal block size") + } + return (*cbcEncrypter)(newCBC(b, iv)) +} + +func (x *cbcEncrypter) BlockSize() int { return x.blockSize } + +func (x *cbcEncrypter) CryptBlocks(dst, src []byte) { + if len(src)%x.blockSize != 0 { + panic("crypto/cipher: input not full blocks") + } + if len(dst) < len(src) { + panic("crypto/cipher: output smaller than input") + } + + iv := x.iv + + for len(src) > 0 { + // Write the xor to dst, then encrypt in place. + xorBytes(dst[:x.blockSize], src[:x.blockSize], iv) + x.b.Encrypt(dst[:x.blockSize], dst[:x.blockSize]) + + // Move to the next block with this block as the next iv. + iv = dst[:x.blockSize] + src = src[x.blockSize:] + dst = dst[x.blockSize:] + } + + // Save the iv for the next CryptBlocks call. + copy(x.iv, iv) +} + +func (x *cbcEncrypter) SetIV(iv []byte) { + if len(iv) != len(x.iv) { + panic("cipher: incorrect length IV") + } + copy(x.iv, iv) +} + +type cbcDecrypter cbc + +// NewCBCDecrypter returns a BlockMode which decrypts in cipher block chaining +// mode, using the given Block. The length of iv must be the same as the +// Block's block size and must match the iv used to encrypt the data. +func NewCBCDecrypter(b Block, iv []byte) BlockMode { + if len(iv) != b.BlockSize() { + panic("cipher.NewCBCDecrypter: IV length must equal block size") + } + return (*cbcDecrypter)(newCBC(b, iv)) +} + +func (x *cbcDecrypter) BlockSize() int { return x.blockSize } + +func (x *cbcDecrypter) CryptBlocks(dst, src []byte) { + if len(src)%x.blockSize != 0 { + panic("crypto/cipher: input not full blocks") + } + if len(dst) < len(src) { + panic("crypto/cipher: output smaller than input") + } + if len(src) == 0 { + return + } + + // For each block, we need to xor the decrypted data with the previous block's ciphertext (the iv). + // To avoid making a copy each time, we loop over the blocks BACKWARDS. + end := len(src) + start := end - x.blockSize + prev := start - x.blockSize + + // Copy the last block of ciphertext in preparation as the new iv. + copy(x.tmp, src[start:end]) + + // Loop over all but the first block. + for start > 0 { + x.b.Decrypt(dst[start:end], src[start:end]) + xorBytes(dst[start:end], dst[start:end], src[prev:start]) + + end = start + start = prev + prev -= x.blockSize + } + + // The first block is special because it uses the saved iv. + x.b.Decrypt(dst[start:end], src[start:end]) + xorBytes(dst[start:end], dst[start:end], x.iv) + + // Set the new iv to the first block we copied earlier. + x.iv, x.tmp = x.tmp, x.iv +} + +func (x *cbcDecrypter) SetIV(iv []byte) { + if len(iv) != len(x.iv) { + panic("cipher: incorrect length IV") + } + copy(x.iv, iv) +} diff --git a/src/crypto/cipher/cbc_aes_test.go b/src/crypto/cipher/cbc_aes_test.go new file mode 100644 index 0000000000000000000000000000000000000000..bf9e7ad7018a290cbd199cd50ebd49e12cae3068 --- /dev/null +++ b/src/crypto/cipher/cbc_aes_test.go @@ -0,0 +1,104 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// CBC AES test vectors. + +// See U.S. National Institute of Standards and Technology (NIST) +// Special Publication 800-38A, ``Recommendation for Block Cipher +// Modes of Operation,'' 2001 Edition, pp. 24-29. + +package cipher_test + +import ( + "bytes" + "crypto/aes" + "crypto/cipher" + "testing" +) + +var cbcAESTests = []struct { + name string + key []byte + iv []byte + in []byte + out []byte +}{ + // NIST SP 800-38A pp 27-29 + { + "CBC-AES128", + commonKey128, + commonIV, + commonInput, + []byte{ + 0x76, 0x49, 0xab, 0xac, 0x81, 0x19, 0xb2, 0x46, 0xce, 0xe9, 0x8e, 0x9b, 0x12, 0xe9, 0x19, 0x7d, + 0x50, 0x86, 0xcb, 0x9b, 0x50, 0x72, 0x19, 0xee, 0x95, 0xdb, 0x11, 0x3a, 0x91, 0x76, 0x78, 0xb2, + 0x73, 0xbe, 0xd6, 0xb8, 0xe3, 0xc1, 0x74, 0x3b, 0x71, 0x16, 0xe6, 0x9e, 0x22, 0x22, 0x95, 0x16, + 0x3f, 0xf1, 0xca, 0xa1, 0x68, 0x1f, 0xac, 0x09, 0x12, 0x0e, 0xca, 0x30, 0x75, 0x86, 0xe1, 0xa7, + }, + }, + { + "CBC-AES192", + commonKey192, + commonIV, + commonInput, + []byte{ + 0x4f, 0x02, 0x1d, 0xb2, 0x43, 0xbc, 0x63, 0x3d, 0x71, 0x78, 0x18, 0x3a, 0x9f, 0xa0, 0x71, 0xe8, + 0xb4, 0xd9, 0xad, 0xa9, 0xad, 0x7d, 0xed, 0xf4, 0xe5, 0xe7, 0x38, 0x76, 0x3f, 0x69, 0x14, 0x5a, + 0x57, 0x1b, 0x24, 0x20, 0x12, 0xfb, 0x7a, 0xe0, 0x7f, 0xa9, 0xba, 0xac, 0x3d, 0xf1, 0x02, 0xe0, + 0x08, 0xb0, 0xe2, 0x79, 0x88, 0x59, 0x88, 0x81, 0xd9, 0x20, 0xa9, 0xe6, 0x4f, 0x56, 0x15, 0xcd, + }, + }, + { + "CBC-AES256", + commonKey256, + commonIV, + commonInput, + []byte{ + 0xf5, 0x8c, 0x4c, 0x04, 0xd6, 0xe5, 0xf1, 0xba, 0x77, 0x9e, 0xab, 0xfb, 0x5f, 0x7b, 0xfb, 0xd6, + 0x9c, 0xfc, 0x4e, 0x96, 0x7e, 0xdb, 0x80, 0x8d, 0x67, 0x9f, 0x77, 0x7b, 0xc6, 0x70, 0x2c, 0x7d, + 0x39, 0xf2, 0x33, 0x69, 0xa9, 0xd9, 0xba, 0xcf, 0xa5, 0x30, 0xe2, 0x63, 0x04, 0x23, 0x14, 0x61, + 0xb2, 0xeb, 0x05, 0xe2, 0xc3, 0x9b, 0xe9, 0xfc, 0xda, 0x6c, 0x19, 0x07, 0x8c, 0x6a, 0x9d, 0x1b, + }, + }, +} + +func TestCBCEncrypterAES(t *testing.T) { + for _, test := range cbcAESTests { + c, err := aes.NewCipher(test.key) + if err != nil { + t.Errorf("%s: NewCipher(%d bytes) = %s", test.name, len(test.key), err) + continue + } + + encrypter := cipher.NewCBCEncrypter(c, test.iv) + + data := make([]byte, len(test.in)) + copy(data, test.in) + + encrypter.CryptBlocks(data, data) + if !bytes.Equal(test.out, data) { + t.Errorf("%s: CBCEncrypter\nhave %x\nwant %x", test.name, data, test.out) + } + } +} + +func TestCBCDecrypterAES(t *testing.T) { + for _, test := range cbcAESTests { + c, err := aes.NewCipher(test.key) + if err != nil { + t.Errorf("%s: NewCipher(%d bytes) = %s", test.name, len(test.key), err) + continue + } + + decrypter := cipher.NewCBCDecrypter(c, test.iv) + + data := make([]byte, len(test.out)) + copy(data, test.out) + + decrypter.CryptBlocks(data, data) + if !bytes.Equal(test.in, data) { + t.Errorf("%s: CBCDecrypter\nhave %x\nwant %x", test.name, data, test.in) + } + } +} diff --git a/src/crypto/cipher/cfb.go b/src/crypto/cipher/cfb.go new file mode 100644 index 0000000000000000000000000000000000000000..9b4eebf5b454164c794e6e166f1e2769a1c3adbd --- /dev/null +++ b/src/crypto/cipher/cfb.go @@ -0,0 +1,72 @@ +// Copyright 2010 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// CFB (Cipher Feedback) Mode. + +package cipher + +type cfb struct { + b Block + next []byte + out []byte + outUsed int + + decrypt bool +} + +func (x *cfb) XORKeyStream(dst, src []byte) { + for len(src) > 0 { + if x.outUsed == len(x.out) { + x.b.Encrypt(x.out, x.next) + x.outUsed = 0 + } + + if x.decrypt { + // We can precompute a larger segment of the + // keystream on decryption. This will allow + // larger batches for xor, and we should be + // able to match CTR/OFB performance. + copy(x.next[x.outUsed:], src) + } + n := xorBytes(dst, src, x.out[x.outUsed:]) + if !x.decrypt { + copy(x.next[x.outUsed:], dst) + } + dst = dst[n:] + src = src[n:] + x.outUsed += n + } +} + +// NewCFBEncrypter returns a Stream which encrypts with cipher feedback mode, +// using the given Block. The iv must be the same length as the Block's block +// size. +func NewCFBEncrypter(block Block, iv []byte) Stream { + return newCFB(block, iv, false) +} + +// NewCFBDecrypter returns a Stream which decrypts with cipher feedback mode, +// using the given Block. The iv must be the same length as the Block's block +// size. +func NewCFBDecrypter(block Block, iv []byte) Stream { + return newCFB(block, iv, true) +} + +func newCFB(block Block, iv []byte, decrypt bool) Stream { + blockSize := block.BlockSize() + if len(iv) != blockSize { + // stack trace will indicate whether it was de or encryption + panic("cipher.newCFB: IV length must equal block size") + } + x := &cfb{ + b: block, + out: make([]byte, blockSize), + next: make([]byte, blockSize), + outUsed: blockSize, + decrypt: decrypt, + } + copy(x.next, iv) + + return x +} diff --git a/src/crypto/cipher/cfb_test.go b/src/crypto/cipher/cfb_test.go new file mode 100644 index 0000000000000000000000000000000000000000..9b544bb2118b70226c1e6d143f8d5aea971ec989 --- /dev/null +++ b/src/crypto/cipher/cfb_test.go @@ -0,0 +1,113 @@ +// Copyright 2010 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package cipher_test + +import ( + "bytes" + "crypto/aes" + "crypto/cipher" + "crypto/rand" + "encoding/hex" + "testing" +) + +// cfbTests contains the test vectors from +// http://csrc.nist.gov/publications/nistpubs/800-38a/sp800-38a.pdf, section +// F.3.13. +var cfbTests = []struct { + key, iv, plaintext, ciphertext string +}{ + { + "2b7e151628aed2a6abf7158809cf4f3c", + "000102030405060708090a0b0c0d0e0f", + "6bc1bee22e409f96e93d7e117393172a", + "3b3fd92eb72dad20333449f8e83cfb4a", + }, + { + "2b7e151628aed2a6abf7158809cf4f3c", + "3B3FD92EB72DAD20333449F8E83CFB4A", + "ae2d8a571e03ac9c9eb76fac45af8e51", + "c8a64537a0b3a93fcde3cdad9f1ce58b", + }, + { + "2b7e151628aed2a6abf7158809cf4f3c", + "C8A64537A0B3A93FCDE3CDAD9F1CE58B", + "30c81c46a35ce411e5fbc1191a0a52ef", + "26751f67a3cbb140b1808cf187a4f4df", + }, + { + "2b7e151628aed2a6abf7158809cf4f3c", + "26751F67A3CBB140B1808CF187A4F4DF", + "f69f2445df4f9b17ad2b417be66c3710", + "c04b05357c5d1c0eeac4c66f9ff7f2e6", + }, +} + +func TestCFBVectors(t *testing.T) { + for i, test := range cfbTests { + key, err := hex.DecodeString(test.key) + if err != nil { + t.Fatal(err) + } + iv, err := hex.DecodeString(test.iv) + if err != nil { + t.Fatal(err) + } + plaintext, err := hex.DecodeString(test.plaintext) + if err != nil { + t.Fatal(err) + } + expected, err := hex.DecodeString(test.ciphertext) + if err != nil { + t.Fatal(err) + } + + block, err := aes.NewCipher(key) + if err != nil { + t.Fatal(err) + } + + ciphertext := make([]byte, len(plaintext)) + cfb := cipher.NewCFBEncrypter(block, iv) + cfb.XORKeyStream(ciphertext, plaintext) + + if !bytes.Equal(ciphertext, expected) { + t.Errorf("#%d: wrong output: got %x, expected %x", i, ciphertext, expected) + } + + cfbdec := cipher.NewCFBDecrypter(block, iv) + plaintextCopy := make([]byte, len(ciphertext)) + cfbdec.XORKeyStream(plaintextCopy, ciphertext) + + if !bytes.Equal(plaintextCopy, plaintextCopy) { + t.Errorf("#%d: wrong plaintext: got %x, expected %x", i, plaintextCopy, plaintext) + } + } +} + +func TestCFBInverse(t *testing.T) { + block, err := aes.NewCipher(commonKey128) + if err != nil { + t.Error(err) + return + } + + plaintext := []byte("this is the plaintext. this is the plaintext.") + iv := make([]byte, block.BlockSize()) + rand.Reader.Read(iv) + cfb := cipher.NewCFBEncrypter(block, iv) + ciphertext := make([]byte, len(plaintext)) + copy(ciphertext, plaintext) + cfb.XORKeyStream(ciphertext, ciphertext) + + cfbdec := cipher.NewCFBDecrypter(block, iv) + plaintextCopy := make([]byte, len(plaintext)) + copy(plaintextCopy, ciphertext) + cfbdec.XORKeyStream(plaintextCopy, plaintextCopy) + + if !bytes.Equal(plaintextCopy, plaintext) { + t.Errorf("got: %x, want: %x", plaintextCopy, plaintext) + } +} diff --git a/src/crypto/cipher/cipher.go b/src/crypto/cipher/cipher.go new file mode 100644 index 0000000000000000000000000000000000000000..7d27fde61d8fac2a0fd63548d35d0b8bf02a7493 --- /dev/null +++ b/src/crypto/cipher/cipher.go @@ -0,0 +1,56 @@ +// Copyright 2010 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package cipher implements standard block cipher modes that can be wrapped +// around low-level block cipher implementations. +// See http://csrc.nist.gov/groups/ST/toolkit/BCM/current_modes.html +// and NIST Special Publication 800-38A. +package cipher + +// A Block represents an implementation of block cipher +// using a given key. It provides the capability to encrypt +// or decrypt individual blocks. The mode implementations +// extend that capability to streams of blocks. +type Block interface { + // BlockSize returns the cipher's block size. + BlockSize() int + + // Encrypt encrypts the first block in src into dst. + // Dst and src may point at the same memory. + Encrypt(dst, src []byte) + + // Decrypt decrypts the first block in src into dst. + // Dst and src may point at the same memory. + Decrypt(dst, src []byte) +} + +// A Stream represents a stream cipher. +type Stream interface { + // XORKeyStream XORs each byte in the given slice with a byte from the + // cipher's key stream. Dst and src may point to the same memory. + // If len(dst) < len(src), XORKeyStream should panic. It is acceptable + // to pass a dst bigger than src, and in that case, XORKeyStream will + // only update dst[:len(src)] and will not touch the rest of dst. + XORKeyStream(dst, src []byte) +} + +// A BlockMode represents a block cipher running in a block-based mode (CBC, +// ECB etc). +type BlockMode interface { + // BlockSize returns the mode's block size. + BlockSize() int + + // CryptBlocks encrypts or decrypts a number of blocks. The length of + // src must be a multiple of the block size. Dst and src may point to + // the same memory. + CryptBlocks(dst, src []byte) +} + +// Utility routines + +func dup(p []byte) []byte { + q := make([]byte, len(p)) + copy(q, p) + return q +} diff --git a/src/crypto/cipher/cipher_test.go b/src/crypto/cipher/cipher_test.go new file mode 100644 index 0000000000000000000000000000000000000000..8da5bce93ff01261e581900c8e9b668a72efe418 --- /dev/null +++ b/src/crypto/cipher/cipher_test.go @@ -0,0 +1,36 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package cipher_test + +import ( + "crypto/aes" + "crypto/cipher" + "testing" +) + +func TestCryptBlocks(t *testing.T) { + buf := make([]byte, 16) + block, _ := aes.NewCipher(buf) + + mode := cipher.NewCBCDecrypter(block, buf) + mustPanic(t, "crypto/cipher: input not full blocks", func() { mode.CryptBlocks(buf, buf[:3]) }) + mustPanic(t, "crypto/cipher: output smaller than input", func() { mode.CryptBlocks(buf[:3], buf) }) + + mode = cipher.NewCBCEncrypter(block, buf) + mustPanic(t, "crypto/cipher: input not full blocks", func() { mode.CryptBlocks(buf, buf[:3]) }) + mustPanic(t, "crypto/cipher: output smaller than input", func() { mode.CryptBlocks(buf[:3], buf) }) +} + +func mustPanic(t *testing.T, msg string, f func()) { + defer func() { + err := recover() + if err == nil { + t.Errorf("function did not panic, wanted %q", msg) + } else if err != msg { + t.Errorf("got panic %v, wanted %q", err, msg) + } + }() + f() +} diff --git a/src/crypto/cipher/common_test.go b/src/crypto/cipher/common_test.go new file mode 100644 index 0000000000000000000000000000000000000000..c75c919d1758078aa280e712b205dd66b40db614 --- /dev/null +++ b/src/crypto/cipher/common_test.go @@ -0,0 +1,28 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package cipher_test + +// Common values for tests. + +var commonInput = []byte{ + 0x6b, 0xc1, 0xbe, 0xe2, 0x2e, 0x40, 0x9f, 0x96, 0xe9, 0x3d, 0x7e, 0x11, 0x73, 0x93, 0x17, 0x2a, + 0xae, 0x2d, 0x8a, 0x57, 0x1e, 0x03, 0xac, 0x9c, 0x9e, 0xb7, 0x6f, 0xac, 0x45, 0xaf, 0x8e, 0x51, + 0x30, 0xc8, 0x1c, 0x46, 0xa3, 0x5c, 0xe4, 0x11, 0xe5, 0xfb, 0xc1, 0x19, 0x1a, 0x0a, 0x52, 0xef, + 0xf6, 0x9f, 0x24, 0x45, 0xdf, 0x4f, 0x9b, 0x17, 0xad, 0x2b, 0x41, 0x7b, 0xe6, 0x6c, 0x37, 0x10, +} + +var commonKey128 = []byte{0x2b, 0x7e, 0x15, 0x16, 0x28, 0xae, 0xd2, 0xa6, 0xab, 0xf7, 0x15, 0x88, 0x09, 0xcf, 0x4f, 0x3c} + +var commonKey192 = []byte{ + 0x8e, 0x73, 0xb0, 0xf7, 0xda, 0x0e, 0x64, 0x52, 0xc8, 0x10, 0xf3, 0x2b, 0x80, 0x90, 0x79, 0xe5, + 0x62, 0xf8, 0xea, 0xd2, 0x52, 0x2c, 0x6b, 0x7b, +} + +var commonKey256 = []byte{ + 0x60, 0x3d, 0xeb, 0x10, 0x15, 0xca, 0x71, 0xbe, 0x2b, 0x73, 0xae, 0xf0, 0x85, 0x7d, 0x77, 0x81, + 0x1f, 0x35, 0x2c, 0x07, 0x3b, 0x61, 0x08, 0xd7, 0x2d, 0x98, 0x10, 0xa3, 0x09, 0x14, 0xdf, 0xf4, +} + +var commonIV = []byte{0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f} diff --git a/src/crypto/cipher/ctr.go b/src/crypto/cipher/ctr.go new file mode 100644 index 0000000000000000000000000000000000000000..70ac40f6a7afbd32d58658bd57120c3bc685c899 --- /dev/null +++ b/src/crypto/cipher/ctr.go @@ -0,0 +1,76 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Counter (CTR) mode. + +// CTR converts a block cipher into a stream cipher by +// repeatedly encrypting an incrementing counter and +// xoring the resulting stream of data with the input. + +// See NIST SP 800-38A, pp 13-15 + +package cipher + +type ctr struct { + b Block + ctr []byte + out []byte + outUsed int +} + +const streamBufferSize = 512 + +// NewCTR returns a Stream which encrypts/decrypts using the given Block in +// counter mode. The length of iv must be the same as the Block's block size. +func NewCTR(block Block, iv []byte) Stream { + if len(iv) != block.BlockSize() { + panic("cipher.NewCTR: IV length must equal block size") + } + bufSize := streamBufferSize + if bufSize < block.BlockSize() { + bufSize = block.BlockSize() + } + return &ctr{ + b: block, + ctr: dup(iv), + out: make([]byte, 0, bufSize), + outUsed: 0, + } +} + +func (x *ctr) refill() { + remain := len(x.out) - x.outUsed + if remain > x.outUsed { + return + } + copy(x.out, x.out[x.outUsed:]) + x.out = x.out[:cap(x.out)] + bs := x.b.BlockSize() + for remain < len(x.out)-bs { + x.b.Encrypt(x.out[remain:], x.ctr) + remain += bs + + // Increment counter + for i := len(x.ctr) - 1; i >= 0; i-- { + x.ctr[i]++ + if x.ctr[i] != 0 { + break + } + } + } + x.out = x.out[:remain] + x.outUsed = 0 +} + +func (x *ctr) XORKeyStream(dst, src []byte) { + for len(src) > 0 { + if x.outUsed >= len(x.out)-x.b.BlockSize() { + x.refill() + } + n := xorBytes(dst, src, x.out[x.outUsed:]) + dst = dst[n:] + src = src[n:] + x.outUsed += n + } +} diff --git a/src/crypto/cipher/ctr_aes_test.go b/src/crypto/cipher/ctr_aes_test.go new file mode 100644 index 0000000000000000000000000000000000000000..d019ae0d022eb803e6a00ca74e23bad5b973ea58 --- /dev/null +++ b/src/crypto/cipher/ctr_aes_test.go @@ -0,0 +1,102 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// CTR AES test vectors. + +// See U.S. National Institute of Standards and Technology (NIST) +// Special Publication 800-38A, ``Recommendation for Block Cipher +// Modes of Operation,'' 2001 Edition, pp. 55-58. + +package cipher_test + +import ( + "bytes" + "crypto/aes" + "crypto/cipher" + "testing" +) + +var commonCounter = []byte{0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff} + +var ctrAESTests = []struct { + name string + key []byte + iv []byte + in []byte + out []byte +}{ + // NIST SP 800-38A pp 55-58 + { + "CTR-AES128", + commonKey128, + commonCounter, + commonInput, + []byte{ + 0x87, 0x4d, 0x61, 0x91, 0xb6, 0x20, 0xe3, 0x26, 0x1b, 0xef, 0x68, 0x64, 0x99, 0x0d, 0xb6, 0xce, + 0x98, 0x06, 0xf6, 0x6b, 0x79, 0x70, 0xfd, 0xff, 0x86, 0x17, 0x18, 0x7b, 0xb9, 0xff, 0xfd, 0xff, + 0x5a, 0xe4, 0xdf, 0x3e, 0xdb, 0xd5, 0xd3, 0x5e, 0x5b, 0x4f, 0x09, 0x02, 0x0d, 0xb0, 0x3e, 0xab, + 0x1e, 0x03, 0x1d, 0xda, 0x2f, 0xbe, 0x03, 0xd1, 0x79, 0x21, 0x70, 0xa0, 0xf3, 0x00, 0x9c, 0xee, + }, + }, + { + "CTR-AES192", + commonKey192, + commonCounter, + commonInput, + []byte{ + 0x1a, 0xbc, 0x93, 0x24, 0x17, 0x52, 0x1c, 0xa2, 0x4f, 0x2b, 0x04, 0x59, 0xfe, 0x7e, 0x6e, 0x0b, + 0x09, 0x03, 0x39, 0xec, 0x0a, 0xa6, 0xfa, 0xef, 0xd5, 0xcc, 0xc2, 0xc6, 0xf4, 0xce, 0x8e, 0x94, + 0x1e, 0x36, 0xb2, 0x6b, 0xd1, 0xeb, 0xc6, 0x70, 0xd1, 0xbd, 0x1d, 0x66, 0x56, 0x20, 0xab, 0xf7, + 0x4f, 0x78, 0xa7, 0xf6, 0xd2, 0x98, 0x09, 0x58, 0x5a, 0x97, 0xda, 0xec, 0x58, 0xc6, 0xb0, 0x50, + }, + }, + { + "CTR-AES256", + commonKey256, + commonCounter, + commonInput, + []byte{ + 0x60, 0x1e, 0xc3, 0x13, 0x77, 0x57, 0x89, 0xa5, 0xb7, 0xa7, 0xf5, 0x04, 0xbb, 0xf3, 0xd2, 0x28, + 0xf4, 0x43, 0xe3, 0xca, 0x4d, 0x62, 0xb5, 0x9a, 0xca, 0x84, 0xe9, 0x90, 0xca, 0xca, 0xf5, 0xc5, + 0x2b, 0x09, 0x30, 0xda, 0xa2, 0x3d, 0xe9, 0x4c, 0xe8, 0x70, 0x17, 0xba, 0x2d, 0x84, 0x98, 0x8d, + 0xdf, 0xc9, 0xc5, 0x8d, 0xb6, 0x7a, 0xad, 0xa6, 0x13, 0xc2, 0xdd, 0x08, 0x45, 0x79, 0x41, 0xa6, + }, + }, +} + +func TestCTR_AES(t *testing.T) { + for _, tt := range ctrAESTests { + test := tt.name + + c, err := aes.NewCipher(tt.key) + if err != nil { + t.Errorf("%s: NewCipher(%d bytes) = %s", test, len(tt.key), err) + continue + } + + for j := 0; j <= 5; j += 5 { + in := tt.in[0 : len(tt.in)-j] + ctr := cipher.NewCTR(c, tt.iv) + encrypted := make([]byte, len(in)) + ctr.XORKeyStream(encrypted, in) + if out := tt.out[0:len(in)]; !bytes.Equal(out, encrypted) { + t.Errorf("%s/%d: CTR\ninpt %x\nhave %x\nwant %x", test, len(in), in, encrypted, out) + } + } + + for j := 0; j <= 7; j += 7 { + in := tt.out[0 : len(tt.out)-j] + ctr := cipher.NewCTR(c, tt.iv) + plain := make([]byte, len(in)) + ctr.XORKeyStream(plain, in) + if out := tt.in[0:len(in)]; !bytes.Equal(out, plain) { + t.Errorf("%s/%d: CTRReader\nhave %x\nwant %x", test, len(out), plain, out) + } + } + + if t.Failed() { + break + } + } +} diff --git a/src/crypto/cipher/example_test.go b/src/crypto/cipher/example_test.go new file mode 100644 index 0000000000000000000000000000000000000000..1cfa982df4ba4d7de1fa2db172078002ed64a6dc --- /dev/null +++ b/src/crypto/cipher/example_test.go @@ -0,0 +1,283 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package cipher_test + +import ( + "crypto/aes" + "crypto/cipher" + "crypto/rand" + "encoding/hex" + "fmt" + "io" + "os" +) + +func ExampleNewCBCDecrypter() { + key := []byte("example key 1234") + ciphertext, _ := hex.DecodeString("f363f3ccdcb12bb883abf484ba77d9cd7d32b5baecb3d4b1b3e0e4beffdb3ded") + + block, err := aes.NewCipher(key) + if err != nil { + panic(err) + } + + // The IV needs to be unique, but not secure. Therefore it's common to + // include it at the beginning of the ciphertext. + if len(ciphertext) < aes.BlockSize { + panic("ciphertext too short") + } + iv := ciphertext[:aes.BlockSize] + ciphertext = ciphertext[aes.BlockSize:] + + // CBC mode always works in whole blocks. + if len(ciphertext)%aes.BlockSize != 0 { + panic("ciphertext is not a multiple of the block size") + } + + mode := cipher.NewCBCDecrypter(block, iv) + + // CryptBlocks can work in-place if the two arguments are the same. + mode.CryptBlocks(ciphertext, ciphertext) + + // If the original plaintext lengths are not a multiple of the block + // size, padding would have to be added when encrypting, which would be + // removed at this point. For an example, see + // https://tools.ietf.org/html/rfc5246#section-6.2.3.2. However, it's + // critical to note that ciphertexts must be authenticated (i.e. by + // using crypto/hmac) before being decrypted in order to avoid creating + // a padding oracle. + + fmt.Printf("%s\n", ciphertext) + // Output: exampleplaintext +} + +func ExampleNewCBCEncrypter() { + key := []byte("example key 1234") + plaintext := []byte("exampleplaintext") + + // CBC mode works on blocks so plaintexts may need to be padded to the + // next whole block. For an example of such padding, see + // https://tools.ietf.org/html/rfc5246#section-6.2.3.2. Here we'll + // assume that the plaintext is already of the correct length. + if len(plaintext)%aes.BlockSize != 0 { + panic("plaintext is not a multiple of the block size") + } + + block, err := aes.NewCipher(key) + if err != nil { + panic(err) + } + + // The IV needs to be unique, but not secure. Therefore it's common to + // include it at the beginning of the ciphertext. + ciphertext := make([]byte, aes.BlockSize+len(plaintext)) + iv := ciphertext[:aes.BlockSize] + if _, err := io.ReadFull(rand.Reader, iv); err != nil { + panic(err) + } + + mode := cipher.NewCBCEncrypter(block, iv) + mode.CryptBlocks(ciphertext[aes.BlockSize:], plaintext) + + // It's important to remember that ciphertexts must be authenticated + // (i.e. by using crypto/hmac) as well as being encrypted in order to + // be secure. + + fmt.Printf("%x\n", ciphertext) +} + +func ExampleNewCFBDecrypter() { + key := []byte("example key 1234") + ciphertext, _ := hex.DecodeString("22277966616d9bc47177bd02603d08c9a67d5380d0fe8cf3b44438dff7b9") + + block, err := aes.NewCipher(key) + if err != nil { + panic(err) + } + + // The IV needs to be unique, but not secure. Therefore it's common to + // include it at the beginning of the ciphertext. + if len(ciphertext) < aes.BlockSize { + panic("ciphertext too short") + } + iv := ciphertext[:aes.BlockSize] + ciphertext = ciphertext[aes.BlockSize:] + + stream := cipher.NewCFBDecrypter(block, iv) + + // XORKeyStream can work in-place if the two arguments are the same. + stream.XORKeyStream(ciphertext, ciphertext) + fmt.Printf("%s", ciphertext) + // Output: some plaintext +} + +func ExampleNewCFBEncrypter() { + key := []byte("example key 1234") + plaintext := []byte("some plaintext") + + block, err := aes.NewCipher(key) + if err != nil { + panic(err) + } + + // The IV needs to be unique, but not secure. Therefore it's common to + // include it at the beginning of the ciphertext. + ciphertext := make([]byte, aes.BlockSize+len(plaintext)) + iv := ciphertext[:aes.BlockSize] + if _, err := io.ReadFull(rand.Reader, iv); err != nil { + panic(err) + } + + stream := cipher.NewCFBEncrypter(block, iv) + stream.XORKeyStream(ciphertext[aes.BlockSize:], plaintext) + + // It's important to remember that ciphertexts must be authenticated + // (i.e. by using crypto/hmac) as well as being encrypted in order to + // be secure. +} + +func ExampleNewCTR() { + key := []byte("example key 1234") + plaintext := []byte("some plaintext") + + block, err := aes.NewCipher(key) + if err != nil { + panic(err) + } + + // The IV needs to be unique, but not secure. Therefore it's common to + // include it at the beginning of the ciphertext. + ciphertext := make([]byte, aes.BlockSize+len(plaintext)) + iv := ciphertext[:aes.BlockSize] + if _, err := io.ReadFull(rand.Reader, iv); err != nil { + panic(err) + } + + stream := cipher.NewCTR(block, iv) + stream.XORKeyStream(ciphertext[aes.BlockSize:], plaintext) + + // It's important to remember that ciphertexts must be authenticated + // (i.e. by using crypto/hmac) as well as being encrypted in order to + // be secure. + + // CTR mode is the same for both encryption and decryption, so we can + // also decrypt that ciphertext with NewCTR. + + plaintext2 := make([]byte, len(plaintext)) + stream = cipher.NewCTR(block, iv) + stream.XORKeyStream(plaintext2, ciphertext[aes.BlockSize:]) + + fmt.Printf("%s\n", plaintext2) + // Output: some plaintext +} + +func ExampleNewOFB() { + key := []byte("example key 1234") + plaintext := []byte("some plaintext") + + block, err := aes.NewCipher(key) + if err != nil { + panic(err) + } + + // The IV needs to be unique, but not secure. Therefore it's common to + // include it at the beginning of the ciphertext. + ciphertext := make([]byte, aes.BlockSize+len(plaintext)) + iv := ciphertext[:aes.BlockSize] + if _, err := io.ReadFull(rand.Reader, iv); err != nil { + panic(err) + } + + stream := cipher.NewOFB(block, iv) + stream.XORKeyStream(ciphertext[aes.BlockSize:], plaintext) + + // It's important to remember that ciphertexts must be authenticated + // (i.e. by using crypto/hmac) as well as being encrypted in order to + // be secure. + + // OFB mode is the same for both encryption and decryption, so we can + // also decrypt that ciphertext with NewOFB. + + plaintext2 := make([]byte, len(plaintext)) + stream = cipher.NewOFB(block, iv) + stream.XORKeyStream(plaintext2, ciphertext[aes.BlockSize:]) + + fmt.Printf("%s\n", plaintext2) + // Output: some plaintext +} + +func ExampleStreamReader() { + key := []byte("example key 1234") + + inFile, err := os.Open("encrypted-file") + if err != nil { + panic(err) + } + defer inFile.Close() + + block, err := aes.NewCipher(key) + if err != nil { + panic(err) + } + + // If the key is unique for each ciphertext, then it's ok to use a zero + // IV. + var iv [aes.BlockSize]byte + stream := cipher.NewOFB(block, iv[:]) + + outFile, err := os.OpenFile("decrypted-file", os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0600) + if err != nil { + panic(err) + } + defer outFile.Close() + + reader := &cipher.StreamReader{S: stream, R: inFile} + // Copy the input file to the output file, decrypting as we go. + if _, err := io.Copy(outFile, reader); err != nil { + panic(err) + } + + // Note that this example is simplistic in that it omits any + // authentication of the encrypted data. If you were actually to use + // StreamReader in this manner, an attacker could flip arbitrary bits in + // the output. +} + +func ExampleStreamWriter() { + key := []byte("example key 1234") + + inFile, err := os.Open("plaintext-file") + if err != nil { + panic(err) + } + defer inFile.Close() + + block, err := aes.NewCipher(key) + if err != nil { + panic(err) + } + + // If the key is unique for each ciphertext, then it's ok to use a zero + // IV. + var iv [aes.BlockSize]byte + stream := cipher.NewOFB(block, iv[:]) + + outFile, err := os.OpenFile("encrypted-file", os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0600) + if err != nil { + panic(err) + } + defer outFile.Close() + + writer := &cipher.StreamWriter{S: stream, W: outFile} + // Copy the input file to the output file, encrypting as we go. + if _, err := io.Copy(writer, inFile); err != nil { + panic(err) + } + + // Note that this example is simplistic in that it omits any + // authentication of the encrypted data. If you were actually to use + // StreamReader in this manner, an attacker could flip arbitrary bits in + // the decrypted result. +} diff --git a/src/crypto/cipher/gcm.go b/src/crypto/cipher/gcm.go new file mode 100644 index 0000000000000000000000000000000000000000..bbdf9f5d3df7eb9da5a97c0330f55b2486de8c1e --- /dev/null +++ b/src/crypto/cipher/gcm.go @@ -0,0 +1,373 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package cipher + +import ( + "crypto/subtle" + "errors" +) + +// AEAD is a cipher mode providing authenticated encryption with associated +// data. +type AEAD interface { + // NonceSize returns the size of the nonce that must be passed to Seal + // and Open. + NonceSize() int + + // Overhead returns the maximum difference between the lengths of a + // plaintext and ciphertext. + Overhead() int + + // Seal encrypts and authenticates plaintext, authenticates the + // additional data and appends the result to dst, returning the updated + // slice. The nonce must be NonceSize() bytes long and unique for all + // time, for a given key. + // + // The plaintext and dst may alias exactly or not at all. + Seal(dst, nonce, plaintext, data []byte) []byte + + // Open decrypts and authenticates ciphertext, authenticates the + // additional data and, if successful, appends the resulting plaintext + // to dst, returning the updated slice. The nonce must be NonceSize() + // bytes long and both it and the additional data must match the + // value passed to Seal. + // + // The ciphertext and dst may alias exactly or not at all. + Open(dst, nonce, ciphertext, data []byte) ([]byte, error) +} + +// gcmFieldElement represents a value in GF(2¹²⁸). In order to reflect the GCM +// standard and make getUint64 suitable for marshaling these values, the bits +// are stored backwards. For example: +// the coefficient of x⁰ can be obtained by v.low >> 63. +// the coefficient of x⁶³ can be obtained by v.low & 1. +// the coefficient of x⁶⁴ can be obtained by v.high >> 63. +// the coefficient of x¹²⁷ can be obtained by v.high & 1. +type gcmFieldElement struct { + low, high uint64 +} + +// gcm represents a Galois Counter Mode with a specific key. See +// http://csrc.nist.gov/groups/ST/toolkit/BCM/documents/proposedmodes/gcm/gcm-revised-spec.pdf +type gcm struct { + cipher Block + nonceSize int + // productTable contains the first sixteen powers of the key, H. + // However, they are in bit reversed order. See NewGCMWithNonceSize. + productTable [16]gcmFieldElement +} + +// NewGCM returns the given 128-bit, block cipher wrapped in Galois Counter Mode +// with the standard nonce length. +func NewGCM(cipher Block) (AEAD, error) { + return NewGCMWithNonceSize(cipher, gcmStandardNonceSize) +} + +// NewGCMWithNonceSize returns the given 128-bit, block cipher wrapped in Galois +// Counter Mode, which accepts nonces of the given length. +// +// Only use this function if you require compatibility with an existing +// cryptosystem that uses non-standard nonce lengths. All other users should use +// NewGCM, which is faster and more resistant to misuse. +func NewGCMWithNonceSize(cipher Block, size int) (AEAD, error) { + if cipher.BlockSize() != gcmBlockSize { + return nil, errors.New("cipher: NewGCM requires 128-bit block cipher") + } + + var key [gcmBlockSize]byte + cipher.Encrypt(key[:], key[:]) + + g := &gcm{cipher: cipher, nonceSize: size} + + // We precompute 16 multiples of |key|. However, when we do lookups + // into this table we'll be using bits from a field element and + // therefore the bits will be in the reverse order. So normally one + // would expect, say, 4*key to be in index 4 of the table but due to + // this bit ordering it will actually be in index 0010 (base 2) = 2. + x := gcmFieldElement{ + getUint64(key[:8]), + getUint64(key[8:]), + } + g.productTable[reverseBits(1)] = x + + for i := 2; i < 16; i += 2 { + g.productTable[reverseBits(i)] = gcmDouble(&g.productTable[reverseBits(i/2)]) + g.productTable[reverseBits(i+1)] = gcmAdd(&g.productTable[reverseBits(i)], &x) + } + + return g, nil +} + +const ( + gcmBlockSize = 16 + gcmTagSize = 16 + gcmStandardNonceSize = 12 +) + +func (g *gcm) NonceSize() int { + return g.nonceSize +} + +func (*gcm) Overhead() int { + return gcmTagSize +} + +func (g *gcm) Seal(dst, nonce, plaintext, data []byte) []byte { + if len(nonce) != g.nonceSize { + panic("cipher: incorrect nonce length given to GCM") + } + ret, out := sliceForAppend(dst, len(plaintext)+gcmTagSize) + + var counter, tagMask [gcmBlockSize]byte + g.deriveCounter(&counter, nonce) + + g.cipher.Encrypt(tagMask[:], counter[:]) + gcmInc32(&counter) + + g.counterCrypt(out, plaintext, &counter) + g.auth(out[len(plaintext):], out[:len(plaintext)], data, &tagMask) + + return ret +} + +var errOpen = errors.New("cipher: message authentication failed") + +func (g *gcm) Open(dst, nonce, ciphertext, data []byte) ([]byte, error) { + if len(nonce) != g.nonceSize { + panic("cipher: incorrect nonce length given to GCM") + } + + if len(ciphertext) < gcmTagSize { + return nil, errOpen + } + tag := ciphertext[len(ciphertext)-gcmTagSize:] + ciphertext = ciphertext[:len(ciphertext)-gcmTagSize] + + var counter, tagMask [gcmBlockSize]byte + g.deriveCounter(&counter, nonce) + + g.cipher.Encrypt(tagMask[:], counter[:]) + gcmInc32(&counter) + + var expectedTag [gcmTagSize]byte + g.auth(expectedTag[:], ciphertext, data, &tagMask) + + if subtle.ConstantTimeCompare(expectedTag[:], tag) != 1 { + return nil, errOpen + } + + ret, out := sliceForAppend(dst, len(ciphertext)) + g.counterCrypt(out, ciphertext, &counter) + + return ret, nil +} + +// reverseBits reverses the order of the bits of 4-bit number in i. +func reverseBits(i int) int { + i = ((i << 2) & 0xc) | ((i >> 2) & 0x3) + i = ((i << 1) & 0xa) | ((i >> 1) & 0x5) + return i +} + +// gcmAdd adds two elements of GF(2¹²⁸) and returns the sum. +func gcmAdd(x, y *gcmFieldElement) gcmFieldElement { + // Addition in a characteristic 2 field is just XOR. + return gcmFieldElement{x.low ^ y.low, x.high ^ y.high} +} + +// gcmDouble returns the result of doubling an element of GF(2¹²⁸). +func gcmDouble(x *gcmFieldElement) (double gcmFieldElement) { + msbSet := x.high&1 == 1 + + // Because of the bit-ordering, doubling is actually a right shift. + double.high = x.high >> 1 + double.high |= x.low << 63 + double.low = x.low >> 1 + + // If the most-significant bit was set before shifting then it, + // conceptually, becomes a term of x^128. This is greater than the + // irreducible polynomial so the result has to be reduced. The + // irreducible polynomial is 1+x+x^2+x^7+x^128. We can subtract that to + // eliminate the term at x^128 which also means subtracting the other + // four terms. In characteristic 2 fields, subtraction == addition == + // XOR. + if msbSet { + double.low ^= 0xe100000000000000 + } + + return +} + +var gcmReductionTable = []uint16{ + 0x0000, 0x1c20, 0x3840, 0x2460, 0x7080, 0x6ca0, 0x48c0, 0x54e0, + 0xe100, 0xfd20, 0xd940, 0xc560, 0x9180, 0x8da0, 0xa9c0, 0xb5e0, +} + +// mul sets y to y*H, where H is the GCM key, fixed during NewGCMWithNonceSize. +func (g *gcm) mul(y *gcmFieldElement) { + var z gcmFieldElement + + for i := 0; i < 2; i++ { + word := y.high + if i == 1 { + word = y.low + } + + // Multiplication works by multiplying z by 16 and adding in + // one of the precomputed multiples of H. + for j := 0; j < 64; j += 4 { + msw := z.high & 0xf + z.high >>= 4 + z.high |= z.low << 60 + z.low >>= 4 + z.low ^= uint64(gcmReductionTable[msw]) << 48 + + // the values in |table| are ordered for + // little-endian bit positions. See the comment + // in NewGCMWithNonceSize. + t := &g.productTable[word&0xf] + + z.low ^= t.low + z.high ^= t.high + word >>= 4 + } + } + + *y = z +} + +// updateBlocks extends y with more polynomial terms from blocks, based on +// Horner's rule. There must be a multiple of gcmBlockSize bytes in blocks. +func (g *gcm) updateBlocks(y *gcmFieldElement, blocks []byte) { + for len(blocks) > 0 { + y.low ^= getUint64(blocks) + y.high ^= getUint64(blocks[8:]) + g.mul(y) + blocks = blocks[gcmBlockSize:] + } +} + +// update extends y with more polynomial terms from data. If data is not a +// multiple of gcmBlockSize bytes long then the remainder is zero padded. +func (g *gcm) update(y *gcmFieldElement, data []byte) { + fullBlocks := (len(data) >> 4) << 4 + g.updateBlocks(y, data[:fullBlocks]) + + if len(data) != fullBlocks { + var partialBlock [gcmBlockSize]byte + copy(partialBlock[:], data[fullBlocks:]) + g.updateBlocks(y, partialBlock[:]) + } +} + +// gcmInc32 treats the final four bytes of counterBlock as a big-endian value +// and increments it. +func gcmInc32(counterBlock *[16]byte) { + for i := gcmBlockSize - 1; i >= gcmBlockSize-4; i-- { + counterBlock[i]++ + if counterBlock[i] != 0 { + break + } + } +} + +// sliceForAppend takes a slice and a requested number of bytes. It returns a +// slice with the contents of the given slice followed by that many bytes and a +// second slice that aliases into it and contains only the extra bytes. If the +// original slice has sufficient capacity then no allocation is performed. +func sliceForAppend(in []byte, n int) (head, tail []byte) { + if total := len(in) + n; cap(in) >= total { + head = in[:total] + } else { + head = make([]byte, total) + copy(head, in) + } + tail = head[len(in):] + return +} + +// counterCrypt crypts in to out using g.cipher in counter mode. +func (g *gcm) counterCrypt(out, in []byte, counter *[gcmBlockSize]byte) { + var mask [gcmBlockSize]byte + + for len(in) >= gcmBlockSize { + g.cipher.Encrypt(mask[:], counter[:]) + gcmInc32(counter) + + xorWords(out, in, mask[:]) + out = out[gcmBlockSize:] + in = in[gcmBlockSize:] + } + + if len(in) > 0 { + g.cipher.Encrypt(mask[:], counter[:]) + gcmInc32(counter) + xorBytes(out, in, mask[:]) + } +} + +// deriveCounter computes the initial GCM counter state from the given nonce. +// See NIST SP 800-38D, section 7.1. This assumes that counter is filled with +// zeros on entry. +func (g *gcm) deriveCounter(counter *[gcmBlockSize]byte, nonce []byte) { + // GCM has two modes of operation with respect to the initial counter + // state: a "fast path" for 96-bit (12-byte) nonces, and a "slow path" + // for nonces of other lengths. For a 96-bit nonce, the nonce, along + // with a four-byte big-endian counter starting at one, is used + // directly as the starting counter. For other nonce sizes, the counter + // is computed by passing it through the GHASH function. + if len(nonce) == gcmStandardNonceSize { + copy(counter[:], nonce) + counter[gcmBlockSize-1] = 1 + } else { + var y gcmFieldElement + g.update(&y, nonce) + y.high ^= uint64(len(nonce)) * 8 + g.mul(&y) + putUint64(counter[:8], y.low) + putUint64(counter[8:], y.high) + } +} + +// auth calculates GHASH(ciphertext, additionalData), masks the result with +// tagMask and writes the result to out. +func (g *gcm) auth(out, ciphertext, additionalData []byte, tagMask *[gcmTagSize]byte) { + var y gcmFieldElement + g.update(&y, additionalData) + g.update(&y, ciphertext) + + y.low ^= uint64(len(additionalData)) * 8 + y.high ^= uint64(len(ciphertext)) * 8 + + g.mul(&y) + + putUint64(out, y.low) + putUint64(out[8:], y.high) + + xorWords(out, out, tagMask[:]) +} + +func getUint64(data []byte) uint64 { + r := uint64(data[0])<<56 | + uint64(data[1])<<48 | + uint64(data[2])<<40 | + uint64(data[3])<<32 | + uint64(data[4])<<24 | + uint64(data[5])<<16 | + uint64(data[6])<<8 | + uint64(data[7]) + return r +} + +func putUint64(out []byte, v uint64) { + out[0] = byte(v >> 56) + out[1] = byte(v >> 48) + out[2] = byte(v >> 40) + out[3] = byte(v >> 32) + out[4] = byte(v >> 24) + out[5] = byte(v >> 16) + out[6] = byte(v >> 8) + out[7] = byte(v) +} diff --git a/src/crypto/cipher/gcm_test.go b/src/crypto/cipher/gcm_test.go new file mode 100644 index 0000000000000000000000000000000000000000..81b9aa241912f76fc93d7d9194f5466c4acadfb2 --- /dev/null +++ b/src/crypto/cipher/gcm_test.go @@ -0,0 +1,188 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package cipher_test + +import ( + "bytes" + "crypto/aes" + "crypto/cipher" + "encoding/hex" + "testing" +) + +// AES-GCM test vectors taken from gcmEncryptExtIV128.rsp from +// http://csrc.nist.gov/groups/STM/cavp/index.html. +var aesGCMTests = []struct { + key, nonce, plaintext, ad, result string +}{ + { + "11754cd72aec309bf52f7687212e8957", + "3c819d9a9bed087615030b65", + "", + "", + "250327c674aaf477aef2675748cf6971", + }, + { + "ca47248ac0b6f8372a97ac43508308ed", + "ffd2b598feabc9019262d2be", + "", + "", + "60d20404af527d248d893ae495707d1a", + }, + { + "77be63708971c4e240d1cb79e8d77feb", + "e0e00f19fed7ba0136a797f3", + "", + "7a43ec1d9c0a5a78a0b16533a6213cab", + "209fcc8d3675ed938e9c7166709dd946", + }, + { + "7680c5d3ca6154758e510f4d25b98820", + "f8f105f9c3df4965780321f8", + "", + "c94c410194c765e3dcc7964379758ed3", + "94dca8edfcf90bb74b153c8d48a17930", + }, + { + "7fddb57453c241d03efbed3ac44e371c", + "ee283a3fc75575e33efd4887", + "d5de42b461646c255c87bd2962d3b9a2", + "", + "2ccda4a5415cb91e135c2a0f78c9b2fdb36d1df9b9d5e596f83e8b7f52971cb3", + }, + { + "ab72c77b97cb5fe9a382d9fe81ffdbed", + "54cc7dc2c37ec006bcc6d1da", + "007c5e5b3e59df24a7c355584fc1518d", + "", + "0e1bde206a07a9c2c1b65300f8c649972b4401346697138c7a4891ee59867d0c", + }, + { + "fe47fcce5fc32665d2ae399e4eec72ba", + "5adb9609dbaeb58cbd6e7275", + "7c0e88c88899a779228465074797cd4c2e1498d259b54390b85e3eef1c02df60e743f1b840382c4bccaf3bafb4ca8429bea063", + "88319d6e1d3ffa5f987199166c8a9b56c2aeba5a", + "98f4826f05a265e6dd2be82db241c0fbbbf9ffb1c173aa83964b7cf5393043736365253ddbc5db8778371495da76d269e5db3e291ef1982e4defedaa2249f898556b47", + }, + { + "ec0c2ba17aa95cd6afffe949da9cc3a8", + "296bce5b50b7d66096d627ef", + "b85b3753535b825cbe5f632c0b843c741351f18aa484281aebec2f45bb9eea2d79d987b764b9611f6c0f8641843d5d58f3a242", + "f8d00f05d22bf68599bcdeb131292ad6e2df5d14", + "a7443d31c26bdf2a1c945e29ee4bd344a99cfaf3aa71f8b3f191f83c2adfc7a07162995506fde6309ffc19e716eddf1a828c5a890147971946b627c40016da1ecf3e77", + }, + { + "2c1f21cf0f6fb3661943155c3e3d8492", + "23cb5ff362e22426984d1907", + "42f758836986954db44bf37c6ef5e4ac0adaf38f27252a1b82d02ea949c8a1a2dbc0d68b5615ba7c1220ff6510e259f06655d8", + "5d3624879d35e46849953e45a32a624d6a6c536ed9857c613b572b0333e701557a713e3f010ecdf9a6bd6c9e3e44b065208645aff4aabee611b391528514170084ccf587177f4488f33cfb5e979e42b6e1cfc0a60238982a7aec", + "81824f0e0d523db30d3da369fdc0d60894c7a0a20646dd015073ad2732bd989b14a222b6ad57af43e1895df9dca2a5344a62cc57a3ee28136e94c74838997ae9823f3a", + }, + { + "d9f7d2411091f947b4d6f1e2d1f0fb2e", + "e1934f5db57cc983e6b180e7", + "73ed042327f70fe9c572a61545eda8b2a0c6e1d6c291ef19248e973aee6c312012f490c2c6f6166f4a59431e182663fcaea05a", + "0a8a18a7150e940c3d87b38e73baee9a5c049ee21795663e264b694a949822b639092d0e67015e86363583fcf0ca645af9f43375f05fdb4ce84f411dcbca73c2220dea03a20115d2e51398344b16bee1ed7c499b353d6c597af8", + "aaadbd5c92e9151ce3db7210b8714126b73e43436d242677afa50384f2149b831f1d573c7891c2a91fbc48db29967ec9542b2321b51ca862cb637cdd03b99a0f93b134", + }, + { + "fe9bb47deb3a61e423c2231841cfd1fb", + "4d328eb776f500a2f7fb47aa", + "f1cc3818e421876bb6b8bbd6c9", + "", + "b88c5c1977b35b517b0aeae96743fd4727fe5cdb4b5b42818dea7ef8c9", + }, + { + "6703df3701a7f54911ca72e24dca046a", + "12823ab601c350ea4bc2488c", + "793cd125b0b84a043e3ac67717", + "", + "b2051c80014f42f08735a7b0cd38e6bcd29962e5f2c13626b85a877101", + }, + // These cases test non-standard nonce sizes. + { + "1672c3537afa82004c6b8a46f6f0d026", + "05", + "", + "", + "8e2ad721f9455f74d8b53d3141f27e8e", + }, + { + "9a4fea86a621a91ab371e492457796c0", + "75", + "ca6131faf0ff210e4e693d6c31c109fc5b6f54224eb120f37de31dc59ec669b6", + "4f6e2585c161f05a9ae1f2f894e9f0ab52b45d0f", + "5698c0a384241d30004290aac56bb3ece6fe8eacc5c4be98954deb9c3ff6aebf5d50e1af100509e1fba2a5e8a0af9670", + }, + { + "d0f1f4defa1e8c08b4b26d576392027c", + "42b4f01eb9f5a1ea5b1eb73b0fb0baed54f387ecaa0393c7d7dffc6af50146ecc021abf7eb9038d4303d91f8d741a11743166c0860208bcc02c6258fd9511a2fa626f96d60b72fcff773af4e88e7a923506e4916ecbd814651e9f445adef4ad6a6b6c7290cc13b956130eef5b837c939fcac0cbbcc9656cd75b13823ee5acdac", + "", + "", + "7ab49b57ddf5f62c427950111c5c4f0d", + }, + { + "4a0c00a3d284dea9d4bf8b8dde86685e", + "f8cbe82588e784bcacbe092cd9089b51e01527297f635bf294b3aa787d91057ef23869789698ac960707857f163ecb242135a228ad93964f5dc4a4d7f88fd7b3b07dd0a5b37f9768fb05a523639f108c34c661498a56879e501a2321c8a4a94d7e1b89db255ac1f685e185263368e99735ebe62a7f2931b47282be8eb165e4d7", + "6d4bf87640a6a48a50d28797b7", + "8d8c7ffc55086d539b5a8f0d1232654c", + "0d803ec309482f35b8e6226f2b56303239298e06b281c2d51aaba3c125", + }, +} + +func TestAESGCM(t *testing.T) { + for i, test := range aesGCMTests { + key, _ := hex.DecodeString(test.key) + aes, err := aes.NewCipher(key) + if err != nil { + t.Fatal(err) + } + + nonce, _ := hex.DecodeString(test.nonce) + plaintext, _ := hex.DecodeString(test.plaintext) + ad, _ := hex.DecodeString(test.ad) + aesgcm, err := cipher.NewGCMWithNonceSize(aes, len(nonce)) + if err != nil { + t.Fatal(err) + } + + ct := aesgcm.Seal(nil, nonce, plaintext, ad) + if ctHex := hex.EncodeToString(ct); ctHex != test.result { + t.Errorf("#%d: got %s, want %s", i, ctHex, test.result) + continue + } + + plaintext2, err := aesgcm.Open(nil, nonce, ct, ad) + if err != nil { + t.Errorf("#%d: Open failed", i) + continue + } + + if !bytes.Equal(plaintext, plaintext2) { + t.Errorf("#%d: plaintext's don't match: got %x vs %x", i, plaintext2, plaintext) + continue + } + + if len(ad) > 0 { + ad[0] ^= 0x80 + if _, err := aesgcm.Open(nil, nonce, ct, ad); err == nil { + t.Errorf("#%d: Open was successful after altering additional data", i) + } + ad[0] ^= 0x80 + } + + nonce[0] ^= 0x80 + if _, err := aesgcm.Open(nil, nonce, ct, ad); err == nil { + t.Errorf("#%d: Open was successful after altering nonce", i) + } + nonce[0] ^= 0x80 + + ct[0] ^= 0x80 + if _, err := aesgcm.Open(nil, nonce, ct, ad); err == nil { + t.Errorf("#%d: Open was successful after altering ciphertext", i) + } + ct[0] ^= 0x80 + } +} diff --git a/src/crypto/cipher/io.go b/src/crypto/cipher/io.go new file mode 100644 index 0000000000000000000000000000000000000000..3938c0a4c8883e20a0d8989a9786bc09845d5d71 --- /dev/null +++ b/src/crypto/cipher/io.go @@ -0,0 +1,55 @@ +// Copyright 2010 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package cipher + +import "io" + +// The Stream* objects are so simple that all their members are public. Users +// can create them themselves. + +// StreamReader wraps a Stream into an io.Reader. It calls XORKeyStream +// to process each slice of data which passes through. +type StreamReader struct { + S Stream + R io.Reader +} + +func (r StreamReader) Read(dst []byte) (n int, err error) { + n, err = r.R.Read(dst) + r.S.XORKeyStream(dst[:n], dst[:n]) + return +} + +// StreamWriter wraps a Stream into an io.Writer. It calls XORKeyStream +// to process each slice of data which passes through. If any Write call +// returns short then the StreamWriter is out of sync and must be discarded. +// A StreamWriter has no internal buffering; Close does not need +// to be called to flush write data. +type StreamWriter struct { + S Stream + W io.Writer + Err error // unused +} + +func (w StreamWriter) Write(src []byte) (n int, err error) { + c := make([]byte, len(src)) + w.S.XORKeyStream(c, src) + n, err = w.W.Write(c) + if n != len(src) { + if err == nil { // should never happen + err = io.ErrShortWrite + } + } + return +} + +// Close closes the underlying Writer and returns its Close return value, if the Writer +// is also an io.Closer. Otherwise it returns nil. +func (w StreamWriter) Close() error { + if c, ok := w.W.(io.Closer); ok { + return c.Close() + } + return nil +} diff --git a/src/crypto/cipher/ofb.go b/src/crypto/cipher/ofb.go new file mode 100644 index 0000000000000000000000000000000000000000..e86ebcb237ee3ce2ef203c92adaaa94042d94d46 --- /dev/null +++ b/src/crypto/cipher/ofb.go @@ -0,0 +1,66 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// OFB (Output Feedback) Mode. + +package cipher + +type ofb struct { + b Block + cipher []byte + out []byte + outUsed int +} + +// NewOFB returns a Stream that encrypts or decrypts using the block cipher b +// in output feedback mode. The initialization vector iv's length must be equal +// to b's block size. +func NewOFB(b Block, iv []byte) Stream { + blockSize := b.BlockSize() + if len(iv) != blockSize { + return nil + } + bufSize := streamBufferSize + if bufSize < blockSize { + bufSize = blockSize + } + x := &ofb{ + b: b, + cipher: make([]byte, blockSize), + out: make([]byte, 0, bufSize), + outUsed: 0, + } + + copy(x.cipher, iv) + return x +} + +func (x *ofb) refill() { + bs := x.b.BlockSize() + remain := len(x.out) - x.outUsed + if remain > x.outUsed { + return + } + copy(x.out, x.out[x.outUsed:]) + x.out = x.out[:cap(x.out)] + for remain < len(x.out)-bs { + x.b.Encrypt(x.cipher, x.cipher) + copy(x.out[remain:], x.cipher) + remain += bs + } + x.out = x.out[:remain] + x.outUsed = 0 +} + +func (x *ofb) XORKeyStream(dst, src []byte) { + for len(src) > 0 { + if x.outUsed >= len(x.out)-x.b.BlockSize() { + x.refill() + } + n := xorBytes(dst, src, x.out[x.outUsed:]) + dst = dst[n:] + src = src[n:] + x.outUsed += n + } +} diff --git a/src/crypto/cipher/ofb_test.go b/src/crypto/cipher/ofb_test.go new file mode 100644 index 0000000000000000000000000000000000000000..8d3c5d3a3899bdb0510deb5147fda2fd2c48c439 --- /dev/null +++ b/src/crypto/cipher/ofb_test.go @@ -0,0 +1,102 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// OFB AES test vectors. + +// See U.S. National Institute of Standards and Technology (NIST) +// Special Publication 800-38A, ``Recommendation for Block Cipher +// Modes of Operation,'' 2001 Edition, pp. 52-55. + +package cipher_test + +import ( + "bytes" + "crypto/aes" + "crypto/cipher" + "testing" +) + +type ofbTest struct { + name string + key []byte + iv []byte + in []byte + out []byte +} + +var ofbTests = []ofbTest{ + // NIST SP 800-38A pp 52-55 + { + "OFB-AES128", + commonKey128, + commonIV, + commonInput, + []byte{ + 0x3b, 0x3f, 0xd9, 0x2e, 0xb7, 0x2d, 0xad, 0x20, 0x33, 0x34, 0x49, 0xf8, 0xe8, 0x3c, 0xfb, 0x4a, + 0x77, 0x89, 0x50, 0x8d, 0x16, 0x91, 0x8f, 0x03, 0xf5, 0x3c, 0x52, 0xda, 0xc5, 0x4e, 0xd8, 0x25, + 0x97, 0x40, 0x05, 0x1e, 0x9c, 0x5f, 0xec, 0xf6, 0x43, 0x44, 0xf7, 0xa8, 0x22, 0x60, 0xed, 0xcc, + 0x30, 0x4c, 0x65, 0x28, 0xf6, 0x59, 0xc7, 0x78, 0x66, 0xa5, 0x10, 0xd9, 0xc1, 0xd6, 0xae, 0x5e, + }, + }, + { + "OFB-AES192", + commonKey192, + commonIV, + commonInput, + []byte{ + 0xcd, 0xc8, 0x0d, 0x6f, 0xdd, 0xf1, 0x8c, 0xab, 0x34, 0xc2, 0x59, 0x09, 0xc9, 0x9a, 0x41, 0x74, + 0xfc, 0xc2, 0x8b, 0x8d, 0x4c, 0x63, 0x83, 0x7c, 0x09, 0xe8, 0x17, 0x00, 0xc1, 0x10, 0x04, 0x01, + 0x8d, 0x9a, 0x9a, 0xea, 0xc0, 0xf6, 0x59, 0x6f, 0x55, 0x9c, 0x6d, 0x4d, 0xaf, 0x59, 0xa5, 0xf2, + 0x6d, 0x9f, 0x20, 0x08, 0x57, 0xca, 0x6c, 0x3e, 0x9c, 0xac, 0x52, 0x4b, 0xd9, 0xac, 0xc9, 0x2a, + }, + }, + { + "OFB-AES256", + commonKey256, + commonIV, + commonInput, + []byte{ + 0xdc, 0x7e, 0x84, 0xbf, 0xda, 0x79, 0x16, 0x4b, 0x7e, 0xcd, 0x84, 0x86, 0x98, 0x5d, 0x38, 0x60, + 0x4f, 0xeb, 0xdc, 0x67, 0x40, 0xd2, 0x0b, 0x3a, 0xc8, 0x8f, 0x6a, 0xd8, 0x2a, 0x4f, 0xb0, 0x8d, + 0x71, 0xab, 0x47, 0xa0, 0x86, 0xe8, 0x6e, 0xed, 0xf3, 0x9d, 0x1c, 0x5b, 0xba, 0x97, 0xc4, 0x08, + 0x01, 0x26, 0x14, 0x1d, 0x67, 0xf3, 0x7b, 0xe8, 0x53, 0x8f, 0x5a, 0x8b, 0xe7, 0x40, 0xe4, 0x84, + }, + }, +} + +func TestOFB(t *testing.T) { + for _, tt := range ofbTests { + test := tt.name + + c, err := aes.NewCipher(tt.key) + if err != nil { + t.Errorf("%s: NewCipher(%d bytes) = %s", test, len(tt.key), err) + continue + } + + for j := 0; j <= 5; j += 5 { + plaintext := tt.in[0 : len(tt.in)-j] + ofb := cipher.NewOFB(c, tt.iv) + ciphertext := make([]byte, len(plaintext)) + ofb.XORKeyStream(ciphertext, plaintext) + if !bytes.Equal(ciphertext, tt.out[:len(plaintext)]) { + t.Errorf("%s/%d: encrypting\ninput % x\nhave % x\nwant % x", test, len(plaintext), plaintext, ciphertext, tt.out) + } + } + + for j := 0; j <= 5; j += 5 { + ciphertext := tt.out[0 : len(tt.in)-j] + ofb := cipher.NewOFB(c, tt.iv) + plaintext := make([]byte, len(ciphertext)) + ofb.XORKeyStream(plaintext, ciphertext) + if !bytes.Equal(plaintext, tt.in[:len(ciphertext)]) { + t.Errorf("%s/%d: decrypting\nhave % x\nwant % x", test, len(ciphertext), plaintext, tt.in) + } + } + + if t.Failed() { + break + } + } +} diff --git a/src/crypto/cipher/xor.go b/src/crypto/cipher/xor.go new file mode 100644 index 0000000000000000000000000000000000000000..f88dc8914ac8c98fa8691947ee4721326930e292 --- /dev/null +++ b/src/crypto/cipher/xor.go @@ -0,0 +1,84 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package cipher + +import ( + "runtime" + "unsafe" +) + +const wordSize = int(unsafe.Sizeof(uintptr(0))) +const supportsUnaligned = runtime.GOARCH == "386" || runtime.GOARCH == "amd64" + +// fastXORBytes xors in bulk. It only works on architectures that +// support unaligned read/writes. +func fastXORBytes(dst, a, b []byte) int { + n := len(a) + if len(b) < n { + n = len(b) + } + + w := n / wordSize + if w > 0 { + dw := *(*[]uintptr)(unsafe.Pointer(&dst)) + aw := *(*[]uintptr)(unsafe.Pointer(&a)) + bw := *(*[]uintptr)(unsafe.Pointer(&b)) + for i := 0; i < w; i++ { + dw[i] = aw[i] ^ bw[i] + } + } + + for i := (n - n%wordSize); i < n; i++ { + dst[i] = a[i] ^ b[i] + } + + return n +} + +func safeXORBytes(dst, a, b []byte) int { + n := len(a) + if len(b) < n { + n = len(b) + } + for i := 0; i < n; i++ { + dst[i] = a[i] ^ b[i] + } + return n +} + +// xorBytes xors the bytes in a and b. The destination is assumed to have enough +// space. Returns the number of bytes xor'd. +func xorBytes(dst, a, b []byte) int { + if supportsUnaligned { + return fastXORBytes(dst, a, b) + } else { + // TODO(hanwen): if (dst, a, b) have common alignment + // we could still try fastXORBytes. It is not clear + // how often this happens, and it's only worth it if + // the block encryption itself is hardware + // accelerated. + return safeXORBytes(dst, a, b) + } +} + +// fastXORWords XORs multiples of 4 or 8 bytes (depending on architecture.) +// The arguments are assumed to be of equal length. +func fastXORWords(dst, a, b []byte) { + dw := *(*[]uintptr)(unsafe.Pointer(&dst)) + aw := *(*[]uintptr)(unsafe.Pointer(&a)) + bw := *(*[]uintptr)(unsafe.Pointer(&b)) + n := len(b) / wordSize + for i := 0; i < n; i++ { + dw[i] = aw[i] ^ bw[i] + } +} + +func xorWords(dst, a, b []byte) { + if supportsUnaligned { + fastXORWords(dst, a, b) + } else { + safeXORBytes(dst, a, b) + } +} diff --git a/src/crypto/cipher/xor_test.go b/src/crypto/cipher/xor_test.go new file mode 100644 index 0000000000000000000000000000000000000000..cc1c9d72d5591d8130920f34bd6b29f14bb83020 --- /dev/null +++ b/src/crypto/cipher/xor_test.go @@ -0,0 +1,28 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package cipher + +import ( + "bytes" + "testing" +) + +func TestXOR(t *testing.T) { + for alignP := 0; alignP < 2; alignP++ { + for alignQ := 0; alignQ < 2; alignQ++ { + for alignD := 0; alignD < 2; alignD++ { + p := make([]byte, 1024)[alignP:] + q := make([]byte, 1024)[alignQ:] + d1 := make([]byte, 1024+alignD)[alignD:] + d2 := make([]byte, 1024+alignD)[alignD:] + xorBytes(d1, p, q) + safeXORBytes(d2, p, q) + if bytes.Compare(d1, d2) != 0 { + t.Error("not equal") + } + } + } + } +} diff --git a/src/crypto/crypto.go b/src/crypto/crypto.go new file mode 100644 index 0000000000000000000000000000000000000000..184ea9d4d62c74ae04419ca5cf8edb1f7f883d17 --- /dev/null +++ b/src/crypto/crypto.go @@ -0,0 +1,146 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package crypto collects common cryptographic constants. +package crypto + +import ( + "hash" + "io" + "strconv" +) + +// Hash identifies a cryptographic hash function that is implemented in another +// package. +type Hash uint + +// HashFunc simply returns the value of h so that Hash implements SignerOpts. +func (h Hash) HashFunc() Hash { + return h +} + +const ( + MD4 Hash = 1 + iota // import golang.org/x/crypto/md4 + MD5 // import crypto/md5 + SHA1 // import crypto/sha1 + SHA224 // import crypto/sha256 + SHA256 // import crypto/sha256 + SHA384 // import crypto/sha512 + SHA512 // import crypto/sha512 + MD5SHA1 // no implementation; MD5+SHA1 used for TLS RSA + RIPEMD160 // import golang.org/x/crypto/ripemd160 + SHA3_224 // import golang.org/x/crypto/sha3 + SHA3_256 // import golang.org/x/crypto/sha3 + SHA3_384 // import golang.org/x/crypto/sha3 + SHA3_512 // import golang.org/x/crypto/sha3 + SHA512_224 // import crypto/sha512 + SHA512_256 // import crypto/sha512 + maxHash +) + +var digestSizes = []uint8{ + MD4: 16, + MD5: 16, + SHA1: 20, + SHA224: 28, + SHA256: 32, + SHA384: 48, + SHA512: 64, + SHA512_224: 28, + SHA512_256: 32, + SHA3_224: 28, + SHA3_256: 32, + SHA3_384: 48, + SHA3_512: 64, + MD5SHA1: 36, + RIPEMD160: 20, +} + +// Size returns the length, in bytes, of a digest resulting from the given hash +// function. It doesn't require that the hash function in question be linked +// into the program. +func (h Hash) Size() int { + if h > 0 && h < maxHash { + return int(digestSizes[h]) + } + panic("crypto: Size of unknown hash function") +} + +var hashes = make([]func() hash.Hash, maxHash) + +// New returns a new hash.Hash calculating the given hash function. New panics +// if the hash function is not linked into the binary. +func (h Hash) New() hash.Hash { + if h > 0 && h < maxHash { + f := hashes[h] + if f != nil { + return f() + } + } + panic("crypto: requested hash function #" + strconv.Itoa(int(h)) + " is unavailable") +} + +// Available reports whether the given hash function is linked into the binary. +func (h Hash) Available() bool { + return h < maxHash && hashes[h] != nil +} + +// RegisterHash registers a function that returns a new instance of the given +// hash function. This is intended to be called from the init function in +// packages that implement hash functions. +func RegisterHash(h Hash, f func() hash.Hash) { + if h >= maxHash { + panic("crypto: RegisterHash of unknown hash function") + } + hashes[h] = f +} + +// PublicKey represents a public key using an unspecified algorithm. +type PublicKey interface{} + +// PrivateKey represents a private key using an unspecified algorithm. +type PrivateKey interface{} + +// Signer is an interface for an opaque private key that can be used for +// signing operations. For example, an RSA key kept in a hardware module. +type Signer interface { + // Public returns the public key corresponding to the opaque, + // private key. + Public() PublicKey + + // Sign signs msg with the private key, possibly using entropy from + // rand. For an RSA key, the resulting signature should be either a + // PKCS#1 v1.5 or PSS signature (as indicated by opts). For an (EC)DSA + // key, it should be a DER-serialised, ASN.1 signature structure. + // + // Hash implements the SignerOpts interface and, in most cases, one can + // simply pass in the hash function used as opts. Sign may also attempt + // to type assert opts to other types in order to obtain algorithm + // specific values. See the documentation in each package for details. + Sign(rand io.Reader, msg []byte, opts SignerOpts) (signature []byte, err error) +} + +// SignerOpts contains options for signing with a Signer. +type SignerOpts interface { + // HashFunc returns an identifier for the hash function used to produce + // the message passed to Signer.Sign, or else zero to indicate that no + // hashing was done. + HashFunc() Hash +} + +// Decrypter is an interface for an opaque private key that can be used for +// asymmetric decryption operations. An example would be an RSA key +// kept in a hardware module. +type Decrypter interface { + // Public returns the public key corresponding to the opaque, + // private key. + Public() PublicKey + + // Decrypt decrypts msg. The opts argument should be appropriate for + // the primitive used. See the documentation in each implementation for + // details. + Decrypt(rand io.Reader, msg []byte, opts DecrypterOpts) (plaintext []byte, err error) +} + +type DecrypterOpts interface{} diff --git a/src/crypto/des/block.go b/src/crypto/des/block.go new file mode 100644 index 0000000000000000000000000000000000000000..26355a22e714bebecc0a9c6243a1954e0dbf82d3 --- /dev/null +++ b/src/crypto/des/block.go @@ -0,0 +1,223 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package des + +import ( + "encoding/binary" +) + +func cryptBlock(subkeys []uint64, dst, src []byte, decrypt bool) { + b := binary.BigEndian.Uint64(src) + b = permuteInitialBlock(b) + left, right := uint32(b>>32), uint32(b) + + var subkey uint64 + for i := 0; i < 16; i++ { + if decrypt { + subkey = subkeys[15-i] + } else { + subkey = subkeys[i] + } + + left, right = right, left^feistel(right, subkey) + } + // switch left & right and perform final permutation + preOutput := (uint64(right) << 32) | uint64(left) + binary.BigEndian.PutUint64(dst, permuteFinalBlock(preOutput)) +} + +// Encrypt one block from src into dst, using the subkeys. +func encryptBlock(subkeys []uint64, dst, src []byte) { + cryptBlock(subkeys, dst, src, false) +} + +// Decrypt one block from src into dst, using the subkeys. +func decryptBlock(subkeys []uint64, dst, src []byte) { + cryptBlock(subkeys, dst, src, true) +} + +// DES Feistel function +func feistel(right uint32, key uint64) (result uint32) { + sBoxLocations := key ^ expandBlock(right) + var sBoxResult uint32 + for i := uint8(0); i < 8; i++ { + sBoxLocation := uint8(sBoxLocations>>42) & 0x3f + sBoxLocations <<= 6 + // row determined by 1st and 6th bit + // column is middle four bits + row := (sBoxLocation & 0x1) | ((sBoxLocation & 0x20) >> 4) + column := (sBoxLocation >> 1) & 0xf + sBoxResult ^= feistelBox[i][16*row+column] + } + return sBoxResult +} + +// feistelBox[s][16*i+j] contains the output of permutationFunction +// for sBoxes[s][i][j] << 4*(7-s) +var feistelBox [8][64]uint32 + +// general purpose function to perform DES block permutations +func permuteBlock(src uint64, permutation []uint8) (block uint64) { + for position, n := range permutation { + bit := (src >> n) & 1 + block |= bit << uint((len(permutation)-1)-position) + } + return +} + +func init() { + for s := range sBoxes { + for i := 0; i < 4; i++ { + for j := 0; j < 16; j++ { + f := uint64(sBoxes[s][i][j]) << (4 * (7 - uint(s))) + f = permuteBlock(uint64(f), permutationFunction[:]) + feistelBox[s][16*i+j] = uint32(f) + } + } + } +} + +// expandBlock expands an input block of 32 bits, +// producing an output block of 48 bits. +func expandBlock(src uint32) (block uint64) { + // rotate the 5 highest bits to the right. + src = (src << 5) | (src >> 27) + for i := 0; i < 8; i++ { + block <<= 6 + // take the 6 bits on the right + block |= uint64(src) & (1<<6 - 1) + // advance by 4 bits. + src = (src << 4) | (src >> 28) + } + return +} + +// permuteInitialBlock is equivalent to the permutation defined +// by initialPermutation. +func permuteInitialBlock(block uint64) uint64 { + // block = b7 b6 b5 b4 b3 b2 b1 b0 (8 bytes) + b1 := block >> 48 + b2 := block << 48 + block ^= b1 ^ b2 ^ b1<<48 ^ b2>>48 + + // block = b1 b0 b5 b4 b3 b2 b7 b6 + b1 = block >> 32 & 0xff00ff + b2 = (block & 0xff00ff00) + block ^= b1<<32 ^ b2 ^ b1<<8 ^ b2<<24 // exchange b0 b4 with b3 b7 + + // block is now b1 b3 b5 b7 b0 b2 b4 b7, the permutation: + // ... 8 + // ... 24 + // ... 40 + // ... 56 + // 7 6 5 4 3 2 1 0 + // 23 22 21 20 19 18 17 16 + // ... 32 + // ... 48 + + // exchange 4,5,6,7 with 32,33,34,35 etc. + b1 = block & 0x0f0f00000f0f0000 + b2 = block & 0x0000f0f00000f0f0 + block ^= b1 ^ b2 ^ b1>>12 ^ b2<<12 + + // block is the permutation: + // + // [+8] [+40] + // + // 7 6 5 4 + // 23 22 21 20 + // 3 2 1 0 + // 19 18 17 16 [+32] + + // exchange 0,1,4,5 with 18,19,22,23 + b1 = block & 0x3300330033003300 + b2 = block & 0x00cc00cc00cc00cc + block ^= b1 ^ b2 ^ b1>>6 ^ b2<<6 + + // block is the permutation: + // 15 14 + // 13 12 + // 11 10 + // 9 8 + // 7 6 + // 5 4 + // 3 2 + // 1 0 [+16] [+32] [+64] + + // exchange 0,2,4,6 with 9,11,13,15: + b1 = block & 0xaaaaaaaa55555555 + block ^= b1 ^ b1>>33 ^ b1<<33 + + // block is the permutation: + // 6 14 22 30 38 46 54 62 + // 4 12 20 28 36 44 52 60 + // 2 10 18 26 34 42 50 58 + // 0 8 16 24 32 40 48 56 + // 7 15 23 31 39 47 55 63 + // 5 13 21 29 37 45 53 61 + // 3 11 19 27 35 43 51 59 + // 1 9 17 25 33 41 49 57 + return block +} + +// permuteInitialBlock is equivalent to the permutation defined +// by finalPermutation. +func permuteFinalBlock(block uint64) uint64 { + // Perform the same bit exchanges as permuteInitialBlock + // but in reverse order. + b1 := block & 0xaaaaaaaa55555555 + block ^= b1 ^ b1>>33 ^ b1<<33 + + b1 = block & 0x3300330033003300 + b2 := block & 0x00cc00cc00cc00cc + block ^= b1 ^ b2 ^ b1>>6 ^ b2<<6 + + b1 = block & 0x0f0f00000f0f0000 + b2 = block & 0x0000f0f00000f0f0 + block ^= b1 ^ b2 ^ b1>>12 ^ b2<<12 + + b1 = block >> 32 & 0xff00ff + b2 = (block & 0xff00ff00) + block ^= b1<<32 ^ b2 ^ b1<<8 ^ b2<<24 + + b1 = block >> 48 + b2 = block << 48 + block ^= b1 ^ b2 ^ b1<<48 ^ b2>>48 + return block +} + +// creates 16 28-bit blocks rotated according +// to the rotation schedule +func ksRotate(in uint32) (out []uint32) { + out = make([]uint32, 16) + last := in + for i := 0; i < 16; i++ { + // 28-bit circular left shift + left := (last << (4 + ksRotations[i])) >> 4 + right := (last << 4) >> (32 - ksRotations[i]) + out[i] = left | right + last = out[i] + } + return +} + +// creates 16 56-bit subkeys from the original key +func (c *desCipher) generateSubkeys(keyBytes []byte) { + // apply PC1 permutation to key + key := binary.BigEndian.Uint64(keyBytes) + permutedKey := permuteBlock(key, permutedChoice1[:]) + + // rotate halves of permuted key according to the rotation schedule + leftRotations := ksRotate(uint32(permutedKey >> 28)) + rightRotations := ksRotate(uint32(permutedKey<<4) >> 4) + + // generate subkeys + for i := 0; i < 16; i++ { + // combine halves to form 56-bit input to PC2 + pc2Input := uint64(leftRotations[i])<<28 | uint64(rightRotations[i]) + // apply PC2 permutation to 7 byte input + c.subkeys[i] = permuteBlock(pc2Input, permutedChoice2[:]) + } +} diff --git a/src/crypto/des/cipher.go b/src/crypto/des/cipher.go new file mode 100644 index 0000000000000000000000000000000000000000..2f929ca7bed0356e337c85699ebb1d153ef6f4d7 --- /dev/null +++ b/src/crypto/des/cipher.go @@ -0,0 +1,73 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package des + +import ( + "crypto/cipher" + "strconv" +) + +// The DES block size in bytes. +const BlockSize = 8 + +type KeySizeError int + +func (k KeySizeError) Error() string { + return "crypto/des: invalid key size " + strconv.Itoa(int(k)) +} + +// desCipher is an instance of DES encryption. +type desCipher struct { + subkeys [16]uint64 +} + +// NewCipher creates and returns a new cipher.Block. +func NewCipher(key []byte) (cipher.Block, error) { + if len(key) != 8 { + return nil, KeySizeError(len(key)) + } + + c := new(desCipher) + c.generateSubkeys(key) + return c, nil +} + +func (c *desCipher) BlockSize() int { return BlockSize } + +func (c *desCipher) Encrypt(dst, src []byte) { encryptBlock(c.subkeys[:], dst, src) } + +func (c *desCipher) Decrypt(dst, src []byte) { decryptBlock(c.subkeys[:], dst, src) } + +// A tripleDESCipher is an instance of TripleDES encryption. +type tripleDESCipher struct { + cipher1, cipher2, cipher3 desCipher +} + +// NewTripleDESCipher creates and returns a new cipher.Block. +func NewTripleDESCipher(key []byte) (cipher.Block, error) { + if len(key) != 24 { + return nil, KeySizeError(len(key)) + } + + c := new(tripleDESCipher) + c.cipher1.generateSubkeys(key[:8]) + c.cipher2.generateSubkeys(key[8:16]) + c.cipher3.generateSubkeys(key[16:]) + return c, nil +} + +func (c *tripleDESCipher) BlockSize() int { return BlockSize } + +func (c *tripleDESCipher) Encrypt(dst, src []byte) { + c.cipher1.Encrypt(dst, src) + c.cipher2.Decrypt(dst, dst) + c.cipher3.Encrypt(dst, dst) +} + +func (c *tripleDESCipher) Decrypt(dst, src []byte) { + c.cipher3.Decrypt(dst, src) + c.cipher2.Encrypt(dst, dst) + c.cipher1.Decrypt(dst, dst) +} diff --git a/src/crypto/des/const.go b/src/crypto/des/const.go new file mode 100644 index 0000000000000000000000000000000000000000..2bd485ee80e00022abd145944fc1eaa959d6469d --- /dev/null +++ b/src/crypto/des/const.go @@ -0,0 +1,139 @@ +// Copyright 2010 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package des implements the Data Encryption Standard (DES) and the +// Triple Data Encryption Algorithm (TDEA) as defined +// in U.S. Federal Information Processing Standards Publication 46-3. +package des + +// Used to perform an initial permutation of a 64-bit input block. +var initialPermutation = [64]byte{ + 6, 14, 22, 30, 38, 46, 54, 62, + 4, 12, 20, 28, 36, 44, 52, 60, + 2, 10, 18, 26, 34, 42, 50, 58, + 0, 8, 16, 24, 32, 40, 48, 56, + 7, 15, 23, 31, 39, 47, 55, 63, + 5, 13, 21, 29, 37, 45, 53, 61, + 3, 11, 19, 27, 35, 43, 51, 59, + 1, 9, 17, 25, 33, 41, 49, 57, +} + +// Used to perform a final permutation of a 4-bit preoutput block. This is the +// inverse of initialPermutation +var finalPermutation = [64]byte{ + 24, 56, 16, 48, 8, 40, 0, 32, + 25, 57, 17, 49, 9, 41, 1, 33, + 26, 58, 18, 50, 10, 42, 2, 34, + 27, 59, 19, 51, 11, 43, 3, 35, + 28, 60, 20, 52, 12, 44, 4, 36, + 29, 61, 21, 53, 13, 45, 5, 37, + 30, 62, 22, 54, 14, 46, 6, 38, + 31, 63, 23, 55, 15, 47, 7, 39, +} + +// Used to expand an input block of 32 bits, producing an output block of 48 +// bits. +var expansionFunction = [48]byte{ + 0, 31, 30, 29, 28, 27, 28, 27, + 26, 25, 24, 23, 24, 23, 22, 21, + 20, 19, 20, 19, 18, 17, 16, 15, + 16, 15, 14, 13, 12, 11, 12, 11, + 10, 9, 8, 7, 8, 7, 6, 5, + 4, 3, 4, 3, 2, 1, 0, 31, +} + +// Yields a 32-bit output from a 32-bit input +var permutationFunction = [32]byte{ + 16, 25, 12, 11, 3, 20, 4, 15, + 31, 17, 9, 6, 27, 14, 1, 22, + 30, 24, 8, 18, 0, 5, 29, 23, + 13, 19, 2, 26, 10, 21, 28, 7, +} + +// Used in the key schedule to select 56 bits +// from a 64-bit input. +var permutedChoice1 = [56]byte{ + 7, 15, 23, 31, 39, 47, 55, 63, + 6, 14, 22, 30, 38, 46, 54, 62, + 5, 13, 21, 29, 37, 45, 53, 61, + 4, 12, 20, 28, 1, 9, 17, 25, + 33, 41, 49, 57, 2, 10, 18, 26, + 34, 42, 50, 58, 3, 11, 19, 27, + 35, 43, 51, 59, 36, 44, 52, 60, +} + +// Used in the key schedule to produce each subkey by selecting 48 bits from +// the 56-bit input +var permutedChoice2 = [48]byte{ + 42, 39, 45, 32, 55, 51, 53, 28, + 41, 50, 35, 46, 33, 37, 44, 52, + 30, 48, 40, 49, 29, 36, 43, 54, + 15, 4, 25, 19, 9, 1, 26, 16, + 5, 11, 23, 8, 12, 7, 17, 0, + 22, 3, 10, 14, 6, 20, 27, 24, +} + +// 8 S-boxes composed of 4 rows and 16 columns +// Used in the DES cipher function +var sBoxes = [8][4][16]uint8{ + // S-box 1 + { + {14, 4, 13, 1, 2, 15, 11, 8, 3, 10, 6, 12, 5, 9, 0, 7}, + {0, 15, 7, 4, 14, 2, 13, 1, 10, 6, 12, 11, 9, 5, 3, 8}, + {4, 1, 14, 8, 13, 6, 2, 11, 15, 12, 9, 7, 3, 10, 5, 0}, + {15, 12, 8, 2, 4, 9, 1, 7, 5, 11, 3, 14, 10, 0, 6, 13}, + }, + // S-box 2 + { + {15, 1, 8, 14, 6, 11, 3, 4, 9, 7, 2, 13, 12, 0, 5, 10}, + {3, 13, 4, 7, 15, 2, 8, 14, 12, 0, 1, 10, 6, 9, 11, 5}, + {0, 14, 7, 11, 10, 4, 13, 1, 5, 8, 12, 6, 9, 3, 2, 15}, + {13, 8, 10, 1, 3, 15, 4, 2, 11, 6, 7, 12, 0, 5, 14, 9}, + }, + // S-box 3 + { + {10, 0, 9, 14, 6, 3, 15, 5, 1, 13, 12, 7, 11, 4, 2, 8}, + {13, 7, 0, 9, 3, 4, 6, 10, 2, 8, 5, 14, 12, 11, 15, 1}, + {13, 6, 4, 9, 8, 15, 3, 0, 11, 1, 2, 12, 5, 10, 14, 7}, + {1, 10, 13, 0, 6, 9, 8, 7, 4, 15, 14, 3, 11, 5, 2, 12}, + }, + // S-box 4 + { + {7, 13, 14, 3, 0, 6, 9, 10, 1, 2, 8, 5, 11, 12, 4, 15}, + {13, 8, 11, 5, 6, 15, 0, 3, 4, 7, 2, 12, 1, 10, 14, 9}, + {10, 6, 9, 0, 12, 11, 7, 13, 15, 1, 3, 14, 5, 2, 8, 4}, + {3, 15, 0, 6, 10, 1, 13, 8, 9, 4, 5, 11, 12, 7, 2, 14}, + }, + // S-box 5 + { + {2, 12, 4, 1, 7, 10, 11, 6, 8, 5, 3, 15, 13, 0, 14, 9}, + {14, 11, 2, 12, 4, 7, 13, 1, 5, 0, 15, 10, 3, 9, 8, 6}, + {4, 2, 1, 11, 10, 13, 7, 8, 15, 9, 12, 5, 6, 3, 0, 14}, + {11, 8, 12, 7, 1, 14, 2, 13, 6, 15, 0, 9, 10, 4, 5, 3}, + }, + // S-box 6 + { + {12, 1, 10, 15, 9, 2, 6, 8, 0, 13, 3, 4, 14, 7, 5, 11}, + {10, 15, 4, 2, 7, 12, 9, 5, 6, 1, 13, 14, 0, 11, 3, 8}, + {9, 14, 15, 5, 2, 8, 12, 3, 7, 0, 4, 10, 1, 13, 11, 6}, + {4, 3, 2, 12, 9, 5, 15, 10, 11, 14, 1, 7, 6, 0, 8, 13}, + }, + // S-box 7 + { + {4, 11, 2, 14, 15, 0, 8, 13, 3, 12, 9, 7, 5, 10, 6, 1}, + {13, 0, 11, 7, 4, 9, 1, 10, 14, 3, 5, 12, 2, 15, 8, 6}, + {1, 4, 11, 13, 12, 3, 7, 14, 10, 15, 6, 8, 0, 5, 9, 2}, + {6, 11, 13, 8, 1, 4, 10, 7, 9, 5, 0, 15, 14, 2, 3, 12}, + }, + // S-box 8 + { + {13, 2, 8, 4, 6, 15, 11, 1, 10, 9, 3, 14, 5, 0, 12, 7}, + {1, 15, 13, 8, 10, 3, 7, 4, 12, 5, 6, 11, 0, 14, 9, 2}, + {7, 11, 4, 1, 9, 12, 14, 2, 0, 6, 10, 13, 15, 3, 5, 8}, + {2, 1, 14, 7, 4, 10, 8, 13, 15, 12, 9, 0, 3, 5, 6, 11}, + }, +} + +// Size of left rotation per round in each half of the key schedule +var ksRotations = [16]uint8{1, 1, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 1} diff --git a/src/crypto/des/des_test.go b/src/crypto/des/des_test.go new file mode 100644 index 0000000000000000000000000000000000000000..2bd525afecce9503b36672031ab8d50f386636e5 --- /dev/null +++ b/src/crypto/des/des_test.go @@ -0,0 +1,1566 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package des + +import ( + "bytes" + "testing" +) + +type CryptTest struct { + key []byte + in []byte + out []byte +} + +// some custom tests for DES +var encryptDESTests = []CryptTest{ + { + []byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, + []byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, + []byte{0x8c, 0xa6, 0x4d, 0xe9, 0xc1, 0xb1, 0x23, 0xa7}}, + { + []byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, + []byte{0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff}, + []byte{0x35, 0x55, 0x50, 0xb2, 0x15, 0x0e, 0x24, 0x51}}, + { + []byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, + []byte{0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef}, + []byte{0x61, 0x7b, 0x3a, 0x0c, 0xe8, 0xf0, 0x71, 0x00}}, + { + []byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, + []byte{0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10}, + []byte{0x92, 0x31, 0xf2, 0x36, 0xff, 0x9a, 0xa9, 0x5c}}, + { + []byte{0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff}, + []byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, + []byte{0xca, 0xaa, 0xaf, 0x4d, 0xea, 0xf1, 0xdb, 0xae}}, + { + []byte{0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff}, + []byte{0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff}, + []byte{0x73, 0x59, 0xb2, 0x16, 0x3e, 0x4e, 0xdc, 0x58}}, + { + []byte{0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff}, + []byte{0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef}, + []byte{0x6d, 0xce, 0x0d, 0xc9, 0x00, 0x65, 0x56, 0xa3}}, + { + []byte{0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff}, + []byte{0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10}, + []byte{0x9e, 0x84, 0xc5, 0xf3, 0x17, 0x0f, 0x8e, 0xff}}, + { + []byte{0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef}, + []byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, + []byte{0xd5, 0xd4, 0x4f, 0xf7, 0x20, 0x68, 0x3d, 0x0d}}, + { + []byte{0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef}, + []byte{0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff}, + []byte{0x59, 0x73, 0x23, 0x56, 0xf3, 0x6f, 0xde, 0x06}}, + { + []byte{0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef}, + []byte{0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef}, + []byte{0x56, 0xcc, 0x09, 0xe7, 0xcf, 0xdc, 0x4c, 0xef}}, + { + []byte{0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef}, + []byte{0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10}, + []byte{0x12, 0xc6, 0x26, 0xaf, 0x05, 0x8b, 0x43, 0x3b}}, + { + []byte{0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10}, + []byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, + []byte{0xa6, 0x8c, 0xdc, 0xa9, 0x0c, 0x90, 0x21, 0xf9}}, + { + []byte{0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10}, + []byte{0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff}, + []byte{0x2a, 0x2b, 0xb0, 0x08, 0xdf, 0x97, 0xc2, 0xf2}}, + { + []byte{0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10}, + []byte{0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef}, + []byte{0xed, 0x39, 0xd9, 0x50, 0xfa, 0x74, 0xbc, 0xc4}}, + { + []byte{0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10}, + []byte{0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10}, + []byte{0xa9, 0x33, 0xf6, 0x18, 0x30, 0x23, 0xb3, 0x10}}, + { + []byte{0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef}, + []byte{0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11}, + []byte{0x17, 0x66, 0x8d, 0xfc, 0x72, 0x92, 0x53, 0x2d}}, + { + []byte{0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef}, + []byte{0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}, + []byte{0xb4, 0xfd, 0x23, 0x16, 0x47, 0xa5, 0xbe, 0xc0}}, + { + []byte{0x0e, 0x32, 0x92, 0x32, 0xea, 0x6d, 0x0d, 0x73}, + []byte{0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87}, + []byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, + { + []byte{0x73, 0x65, 0x63, 0x52, 0x33, 0x74, 0x24, 0x3b}, // "secR3t$;" + []byte{0x61, 0x20, 0x74, 0x65, 0x73, 0x74, 0x31, 0x32}, // "a test12" + []byte{0x37, 0x0d, 0xee, 0x2c, 0x1f, 0xb4, 0xf7, 0xa5}}, + { + []byte{0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68}, // "abcdefgh" + []byte{0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68}, // "abcdefgh" + []byte{0x2a, 0x8d, 0x69, 0xde, 0x9d, 0x5f, 0xdf, 0xf9}}, + { + []byte{0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68}, // "abcdefgh" + []byte{0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38}, // "12345678" + []byte{0x21, 0xc6, 0x0d, 0xa5, 0x34, 0x24, 0x8b, 0xce}}, + { + []byte{0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38}, // "12345678" + []byte{0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68}, // "abcdefgh" + []byte{0x94, 0xd4, 0x43, 0x6b, 0xc3, 0xb5, 0xb6, 0x93}}, + { + []byte{0x1f, 0x79, 0x90, 0x5f, 0x88, 0x01, 0xc8, 0x88}, // random + []byte{0xc7, 0x46, 0x18, 0x73, 0xaf, 0x48, 0x5f, 0xb3}, // random + []byte{0xb0, 0x93, 0x50, 0x88, 0xf9, 0x92, 0x44, 0x6a}}, + { + []byte{0xe6, 0xf4, 0xf2, 0xdb, 0x31, 0x42, 0x53, 0x01}, // random + []byte{0xff, 0x3d, 0x25, 0x50, 0x12, 0xe3, 0x4a, 0xc5}, // random + []byte{0x86, 0x08, 0xd3, 0xd1, 0x6c, 0x2f, 0xd2, 0x55}}, + { + []byte{0x69, 0xc1, 0x9d, 0xc1, 0x15, 0xc5, 0xfb, 0x2b}, // random + []byte{0x1a, 0x22, 0x5c, 0xaf, 0x1f, 0x1d, 0xa3, 0xf9}, // random + []byte{0x64, 0xba, 0x31, 0x67, 0x56, 0x91, 0x1e, 0xa7}}, + { + []byte{0x6e, 0x5e, 0xe2, 0x47, 0xc4, 0xbf, 0xf6, 0x51}, // random + []byte{0x11, 0xc9, 0x57, 0xff, 0x66, 0x89, 0x0e, 0xf0}, // random + []byte{0x94, 0xc5, 0x35, 0xb2, 0xc5, 0x8b, 0x39, 0x72}}, +} + +var weakKeyTests = []CryptTest{ + { + []byte{0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}, + []byte{0x55, 0x74, 0xc0, 0xbd, 0x7c, 0xdf, 0xf7, 0x39}, // random + nil}, + { + []byte{0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe}, + []byte{0xe8, 0xe1, 0xa7, 0xc1, 0xde, 0x11, 0x89, 0xaa}, // random + nil}, + { + []byte{0xe0, 0xe0, 0xe0, 0xe0, 0xf1, 0xf1, 0xf1, 0xf1}, + []byte{0x50, 0x6a, 0x4b, 0x94, 0x3b, 0xed, 0x7d, 0xdc}, // random + nil}, + { + []byte{0x1f, 0x1f, 0x1f, 0x1f, 0x0e, 0x0e, 0x0e, 0x0e}, + []byte{0x88, 0x81, 0x56, 0x38, 0xec, 0x3b, 0x1c, 0x97}, // random + nil}, + { + []byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, + []byte{0x17, 0xa0, 0x83, 0x62, 0x32, 0xfe, 0x9a, 0x0b}, // random + nil}, + { + []byte{0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff}, + []byte{0xca, 0x8f, 0xca, 0x1f, 0x50, 0xc5, 0x7b, 0x49}, // random + nil}, + { + []byte{0xe1, 0xe1, 0xe1, 0xe1, 0xf0, 0xf0, 0xf0, 0xf0}, + []byte{0xb1, 0xea, 0xad, 0x7d, 0xe7, 0xc3, 0x7a, 0x43}, // random + nil}, + { + []byte{0x1e, 0x1e, 0x1e, 0x1e, 0x0f, 0x0f, 0x0f, 0x0f}, + []byte{0xae, 0x74, 0x7d, 0x6f, 0xef, 0x16, 0xbb, 0x81}, // random + nil}, +} + +var semiWeakKeyTests = []CryptTest{ + // key and out contain the semi-weak key pair + { + []byte{0x01, 0x1f, 0x01, 0x1f, 0x01, 0x0e, 0x01, 0x0e}, + []byte{0x12, 0xfa, 0x31, 0x16, 0xf9, 0xc5, 0x0a, 0xe4}, // random + []byte{0x1f, 0x01, 0x1f, 0x01, 0x0e, 0x01, 0x0e, 0x01}}, + { + []byte{0x01, 0xe0, 0x01, 0xe0, 0x01, 0xf1, 0x01, 0xf1}, + []byte{0xb0, 0x4c, 0x7a, 0xee, 0xd2, 0xe5, 0x4d, 0xb7}, // random + []byte{0xe0, 0x01, 0xe0, 0x01, 0xf1, 0x01, 0xf1, 0x01}}, + { + []byte{0x01, 0xfe, 0x01, 0xfe, 0x01, 0xfe, 0x01, 0xfe}, + []byte{0xa4, 0x81, 0xcd, 0xb1, 0x64, 0x6f, 0xd3, 0xbc}, // random + []byte{0xfe, 0x01, 0xfe, 0x01, 0xfe, 0x01, 0xfe, 0x01}}, + { + []byte{0x1f, 0xe0, 0x1f, 0xe0, 0x0e, 0xf1, 0x0e, 0xf1}, + []byte{0xee, 0x27, 0xdd, 0x88, 0x4c, 0x22, 0xcd, 0xce}, // random + []byte{0xe0, 0x1f, 0xe0, 0x1f, 0xf1, 0x0e, 0xf1, 0x0e}}, + { + []byte{0x1f, 0xfe, 0x1f, 0xfe, 0x0e, 0xfe, 0x0e, 0xfe}, + []byte{0x19, 0x3d, 0xcf, 0x97, 0x70, 0xfb, 0xab, 0xe1}, // random + []byte{0xfe, 0x1f, 0xfe, 0x1f, 0xfe, 0x0e, 0xfe, 0x0e}}, + { + []byte{0xe0, 0xfe, 0xe0, 0xfe, 0xf1, 0xfe, 0xf1, 0xfe}, + []byte{0x7c, 0x82, 0x69, 0xe4, 0x1e, 0x86, 0x99, 0xd7}, // random + []byte{0xfe, 0xe0, 0xfe, 0xe0, 0xfe, 0xf1, 0xfe, 0xf1}}, +} + +// some custom tests for TripleDES +var encryptTripleDESTests = []CryptTest{ + { + []byte{ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, + []byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, + []byte{0x92, 0x95, 0xb5, 0x9b, 0xb3, 0x84, 0x73, 0x6e}}, + { + []byte{ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, + []byte{0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff}, + []byte{0xc1, 0x97, 0xf5, 0x58, 0x74, 0x8a, 0x20, 0xe7}}, + { + []byte{ + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff}, + []byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, + []byte{0x3e, 0x68, 0x0a, 0xa7, 0x8b, 0x75, 0xdf, 0x18}}, + { + []byte{ + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff}, + []byte{0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff}, + []byte{0x6d, 0x6a, 0x4a, 0x64, 0x4c, 0x7b, 0x8c, 0x91}}, + { + []byte{ // "abcdefgh12345678ABCDEFGH" + 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, + 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, + 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48}, + []byte{0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30}, // "00000000" + []byte{0xe4, 0x61, 0xb7, 0x59, 0x68, 0x8b, 0xff, 0x66}}, + { + []byte{ // "abcdefgh12345678ABCDEFGH" + 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, + 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, + 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48}, + []byte{0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38}, // "12345678" + []byte{0xdb, 0xd0, 0x92, 0xde, 0xf8, 0x34, 0xff, 0x58}}, + { + []byte{ // "abcdefgh12345678ABCDEFGH" + 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, + 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, + 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48}, + []byte{0xf0, 0xc5, 0x82, 0x22, 0xd3, 0xe6, 0x12, 0xd2}, // random + []byte{0xba, 0xe4, 0x41, 0xb1, 0x3c, 0x37, 0x4d, 0xf4}}, + { + []byte{ // random + 0xd3, 0x7d, 0x45, 0xee, 0x22, 0xe9, 0xcf, 0x52, + 0xf4, 0x65, 0xa2, 0x4f, 0x70, 0xd1, 0x81, 0x8a, + 0x3d, 0xbe, 0x2f, 0x39, 0xc7, 0x71, 0xd2, 0xe9}, + []byte{0x49, 0x53, 0xc3, 0xe9, 0x78, 0xdf, 0x9f, 0xaf}, // random + []byte{0x53, 0x40, 0x51, 0x24, 0xd8, 0x3c, 0xf9, 0x88}}, + { + []byte{ // random + 0xcb, 0x10, 0x7d, 0xda, 0x7e, 0x96, 0x57, 0x0a, + 0xe8, 0xeb, 0xe8, 0x07, 0x8e, 0x87, 0xd3, 0x57, + 0xb2, 0x61, 0x12, 0xb8, 0x2a, 0x90, 0xb7, 0x2f}, + []byte{0xa3, 0xc2, 0x60, 0xb1, 0x0b, 0xb7, 0x28, 0x6e}, // random + []byte{0x56, 0x73, 0x7d, 0xfb, 0xb5, 0xa1, 0xc3, 0xde}}, +} + +// NIST Special Publication 800-20, Appendix A +// Key for use with Table A.1 tests +var tableA1Key = []byte{ + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, +} + +// Table A.1 Resulting Ciphertext from the Variable Plaintext Known Answer Test +var tableA1Tests = []CryptTest{ + {nil, // 0 + []byte{0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, + []byte{0x95, 0xf8, 0xa5, 0xe5, 0xdd, 0x31, 0xd9, 0x00}}, + {nil, // 1 + []byte{0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, + []byte{0xdd, 0x7f, 0x12, 0x1c, 0xa5, 0x01, 0x56, 0x19}}, + {nil, // 2 + []byte{0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, + []byte{0x2e, 0x86, 0x53, 0x10, 0x4f, 0x38, 0x34, 0xea}}, + {nil, // 3 + []byte{0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, + []byte{0x4b, 0xd3, 0x88, 0xff, 0x6c, 0xd8, 0x1d, 0x4f}}, + {nil, // 4 + []byte{0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, + []byte{0x20, 0xb9, 0xe7, 0x67, 0xb2, 0xfb, 0x14, 0x56}}, + {nil, // 5 + []byte{0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, + []byte{0x55, 0x57, 0x93, 0x80, 0xd7, 0x71, 0x38, 0xef}}, + {nil, // 6 + []byte{0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, + []byte{0x6c, 0xc5, 0xde, 0xfa, 0xaf, 0x04, 0x51, 0x2f}}, + {nil, // 7 + []byte{0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, + []byte{0x0d, 0x9f, 0x27, 0x9b, 0xa5, 0xd8, 0x72, 0x60}}, + {nil, // 8 + []byte{0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, + []byte{0xd9, 0x03, 0x1b, 0x02, 0x71, 0xbd, 0x5a, 0x0a}}, + {nil, // 9 + []byte{0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, + []byte{0x42, 0x42, 0x50, 0xb3, 0x7c, 0x3d, 0xd9, 0x51}}, + {nil, // 10 + []byte{0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, + []byte{0xb8, 0x06, 0x1b, 0x7e, 0xcd, 0x9a, 0x21, 0xe5}}, + {nil, // 11 + []byte{0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, + []byte{0xf1, 0x5d, 0x0f, 0x28, 0x6b, 0x65, 0xbd, 0x28}}, + {nil, // 12 + []byte{0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, + []byte{0xad, 0xd0, 0xcc, 0x8d, 0x6e, 0x5d, 0xeb, 0xa1}}, + {nil, // 13 + []byte{0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, + []byte{0xe6, 0xd5, 0xf8, 0x27, 0x52, 0xad, 0x63, 0xd1}}, + {nil, // 14 + []byte{0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, + []byte{0xec, 0xbf, 0xe3, 0xbd, 0x3f, 0x59, 0x1a, 0x5e}}, + {nil, // 15 + []byte{0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, + []byte{0xf3, 0x56, 0x83, 0x43, 0x79, 0xd1, 0x65, 0xcd}}, + {nil, // 16 + []byte{0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00}, + []byte{0x2b, 0x9f, 0x98, 0x2f, 0x20, 0x03, 0x7f, 0xa9}}, + {nil, // 17 + []byte{0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00}, + []byte{0x88, 0x9d, 0xe0, 0x68, 0xa1, 0x6f, 0x0b, 0xe6}}, + {nil, // 18 + []byte{0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00}, + []byte{0xe1, 0x9e, 0x27, 0x5d, 0x84, 0x6a, 0x12, 0x98}}, + {nil, // 19 + []byte{0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00}, + []byte{0x32, 0x9a, 0x8e, 0xd5, 0x23, 0xd7, 0x1a, 0xec}}, + {nil, // 20 + []byte{0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00}, + []byte{0xe7, 0xfc, 0xe2, 0x25, 0x57, 0xd2, 0x3c, 0x97}}, + {nil, // 21 + []byte{0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00}, + []byte{0x12, 0xa9, 0xf5, 0x81, 0x7f, 0xf2, 0xd6, 0x5d}}, + {nil, // 22 + []byte{0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00}, + []byte{0xa4, 0x84, 0xc3, 0xad, 0x38, 0xdc, 0x9c, 0x19}}, + {nil, // 23 + []byte{0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00}, + []byte{0xfb, 0xe0, 0x0a, 0x8a, 0x1e, 0xf8, 0xad, 0x72}}, + {nil, // 24 + []byte{0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00}, + []byte{0x75, 0x0d, 0x07, 0x94, 0x07, 0x52, 0x13, 0x63}}, + {nil, // 25 + []byte{0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00}, + []byte{0x64, 0xfe, 0xed, 0x9c, 0x72, 0x4c, 0x2f, 0xaf}}, + {nil, // 26 + []byte{0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00}, + []byte{0xf0, 0x2b, 0x26, 0x3b, 0x32, 0x8e, 0x2b, 0x60}}, + {nil, // 27 + []byte{0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00}, + []byte{0x9d, 0x64, 0x55, 0x5a, 0x9a, 0x10, 0xb8, 0x52}}, + {nil, // 28 + []byte{0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00}, + []byte{0xd1, 0x06, 0xff, 0x0b, 0xed, 0x52, 0x55, 0xd7}}, + {nil, // 29 + []byte{0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00}, + []byte{0xe1, 0x65, 0x2c, 0x6b, 0x13, 0x8c, 0x64, 0xa5}}, + {nil, // 30 + []byte{0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00}, + []byte{0xe4, 0x28, 0x58, 0x11, 0x86, 0xec, 0x8f, 0x46}}, + {nil, // 31 + []byte{0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00}, + []byte{0xae, 0xb5, 0xf5, 0xed, 0xe2, 0x2d, 0x1a, 0x36}}, + {nil, // 32 + []byte{0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00}, + []byte{0xe9, 0x43, 0xd7, 0x56, 0x8a, 0xec, 0x0c, 0x5c}}, + {nil, // 33 + []byte{0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00}, + []byte{0xdf, 0x98, 0xc8, 0x27, 0x6f, 0x54, 0xb0, 0x4b}}, + {nil, // 34 + []byte{0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00}, + []byte{0xb1, 0x60, 0xe4, 0x68, 0x0f, 0x6c, 0x69, 0x6f}}, + {nil, // 35 + []byte{0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00}, + []byte{0xfa, 0x07, 0x52, 0xb0, 0x7d, 0x9c, 0x4a, 0xb8}}, + {nil, // 36 + []byte{0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00}, + []byte{0xca, 0x3a, 0x2b, 0x03, 0x6d, 0xbc, 0x85, 0x02}}, + {nil, // 37 + []byte{0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00}, + []byte{0x5e, 0x09, 0x05, 0x51, 0x7b, 0xb5, 0x9b, 0xcf}}, + {nil, // 38 + []byte{0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00}, + []byte{0x81, 0x4e, 0xeb, 0x3b, 0x91, 0xd9, 0x07, 0x26}}, + {nil, // 39 + []byte{0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00}, + []byte{0x4d, 0x49, 0xdb, 0x15, 0x32, 0x91, 0x9c, 0x9f}}, + {nil, // 40 + []byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00}, + []byte{0x25, 0xeb, 0x5f, 0xc3, 0xf8, 0xcf, 0x06, 0x21}}, + {nil, // 41 + []byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00}, + []byte{0xab, 0x6a, 0x20, 0xc0, 0x62, 0x0d, 0x1c, 0x6f}}, + {nil, // 42 + []byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00}, + []byte{0x79, 0xe9, 0x0d, 0xbc, 0x98, 0xf9, 0x2c, 0xca}}, + {nil, // 43 + []byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00}, + []byte{0x86, 0x6e, 0xce, 0xdd, 0x80, 0x72, 0xbb, 0x0e}}, + {nil, // 44 + []byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00}, + []byte{0x8b, 0x54, 0x53, 0x6f, 0x2f, 0x3e, 0x64, 0xa8}}, + {nil, // 45 + []byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00}, + []byte{0xea, 0x51, 0xd3, 0x97, 0x55, 0x95, 0xb8, 0x6b}}, + {nil, // 46 + []byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00}, + []byte{0xca, 0xff, 0xc6, 0xac, 0x45, 0x42, 0xde, 0x31}}, + {nil, // 47 + []byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00}, + []byte{0x8d, 0xd4, 0x5a, 0x2d, 0xdf, 0x90, 0x79, 0x6c}}, + {nil, // 48 + []byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00}, + []byte{0x10, 0x29, 0xd5, 0x5e, 0x88, 0x0e, 0xc2, 0xd0}}, + {nil, // 49 + []byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00}, + []byte{0x5d, 0x86, 0xcb, 0x23, 0x63, 0x9d, 0xbe, 0xa9}}, + {nil, // 50 + []byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00}, + []byte{0x1d, 0x1c, 0xa8, 0x53, 0xae, 0x7c, 0x0c, 0x5f}}, + {nil, // 51 + []byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00}, + []byte{0xce, 0x33, 0x23, 0x29, 0x24, 0x8f, 0x32, 0x28}}, + {nil, // 52 + []byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00}, + []byte{0x84, 0x05, 0xd1, 0xab, 0xe2, 0x4f, 0xb9, 0x42}}, + {nil, // 53 + []byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00}, + []byte{0xe6, 0x43, 0xd7, 0x80, 0x90, 0xca, 0x42, 0x07}}, + {nil, // 54 + []byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00}, + []byte{0x48, 0x22, 0x1b, 0x99, 0x37, 0x74, 0x8a, 0x23}}, + {nil, // 55 + []byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00}, + []byte{0xdd, 0x7c, 0x0b, 0xbd, 0x61, 0xfa, 0xfd, 0x54}}, + {nil, // 56 + []byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80}, + []byte{0x2f, 0xbc, 0x29, 0x1a, 0x57, 0x0d, 0xb5, 0xc4}}, + {nil, // 57 + []byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40}, + []byte{0xe0, 0x7c, 0x30, 0xd7, 0xe4, 0xe2, 0x6e, 0x12}}, + {nil, // 58 + []byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20}, + []byte{0x09, 0x53, 0xe2, 0x25, 0x8e, 0x8e, 0x90, 0xa1}}, + {nil, // 59 + []byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10}, + []byte{0x5b, 0x71, 0x1b, 0xc4, 0xce, 0xeb, 0xf2, 0xee}}, + {nil, // 60 + []byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08}, + []byte{0xcc, 0x08, 0x3f, 0x1e, 0x6d, 0x9e, 0x85, 0xf6}}, + {nil, // 61 + []byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04}, + []byte{0xd2, 0xfd, 0x88, 0x67, 0xd5, 0x0d, 0x2d, 0xfe}}, + {nil, // 62 + []byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02}, + []byte{0x06, 0xe7, 0xea, 0x22, 0xce, 0x92, 0x70, 0x8f}}, + {nil, // 63 + []byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01}, + []byte{0x16, 0x6b, 0x40, 0xb4, 0x4a, 0xba, 0x4b, 0xd6}}, +} + +// Plaintext for use with Table A.2 tests +var tableA2Plaintext = []byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00} + +// Table A.2 Resulting Ciphertext from the Variable Key Known Answer Test +var tableA2Tests = []CryptTest{ + { // 0 + []byte{ + 0x80, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x80, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x80, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}, + nil, + []byte{0x95, 0xa8, 0xd7, 0x28, 0x13, 0xda, 0xa9, 0x4d}}, + { // 1 + []byte{ + 0x40, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x40, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x40, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}, + nil, + []byte{0x0e, 0xec, 0x14, 0x87, 0xdd, 0x8c, 0x26, 0xd5}}, + { // 2 + []byte{ + 0x20, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x20, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x20, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}, + nil, + []byte{0x7a, 0xd1, 0x6f, 0xfb, 0x79, 0xc4, 0x59, 0x26}}, + { // 3 + []byte{ + 0x10, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x10, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x10, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}, + nil, + []byte{0xd3, 0x74, 0x62, 0x94, 0xca, 0x6a, 0x6c, 0xf3}}, + { // 4 + []byte{ + 0x08, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x08, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x08, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}, + nil, + []byte{0x80, 0x9f, 0x5f, 0x87, 0x3c, 0x1f, 0xd7, 0x61}}, + { // 5 + []byte{ + 0x04, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x04, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x04, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}, + nil, + []byte{0xc0, 0x2f, 0xaf, 0xfe, 0xc9, 0x89, 0xd1, 0xfc}}, + { // 6 + []byte{ + 0x02, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x02, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x02, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}, + nil, + []byte{0x46, 0x15, 0xaa, 0x1d, 0x33, 0xe7, 0x2f, 0x10}}, + { // 7 + []byte{ + 0x01, 0x80, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x80, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x80, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}, + nil, + []byte{0x20, 0x55, 0x12, 0x33, 0x50, 0xc0, 0x08, 0x58}}, + { // 8 + []byte{ + 0x01, 0x40, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x40, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x40, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}, + nil, + []byte{0xdf, 0x3b, 0x99, 0xd6, 0x57, 0x73, 0x97, 0xc8}}, + { // 9 + []byte{ + 0x01, 0x20, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x20, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x20, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}, + nil, + []byte{0x31, 0xfe, 0x17, 0x36, 0x9b, 0x52, 0x88, 0xc9}}, + { // 10 + []byte{ + 0x01, 0x10, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x10, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x10, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}, + nil, + []byte{0xdf, 0xdd, 0x3c, 0xc6, 0x4d, 0xae, 0x16, 0x42}}, + { // 11 + []byte{ + 0x01, 0x08, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x08, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x08, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}, + nil, + []byte{0x17, 0x8c, 0x83, 0xce, 0x2b, 0x39, 0x9d, 0x94}}, + { // 12 + []byte{ + 0x01, 0x04, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x04, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x04, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}, + nil, + []byte{0x50, 0xf6, 0x36, 0x32, 0x4a, 0x9b, 0x7f, 0x80}}, + { // 13 + []byte{ + 0x01, 0x02, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x02, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x02, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}, + nil, + []byte{0xa8, 0x46, 0x8e, 0xe3, 0xbc, 0x18, 0xf0, 0x6d}}, + { // 14 + []byte{ + 0x01, 0x01, 0x80, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x80, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x80, 0x01, 0x01, 0x01, 0x01, 0x01}, + nil, + []byte{0xa2, 0xdc, 0x9e, 0x92, 0xfd, 0x3c, 0xde, 0x92}}, + { // 15 + []byte{ + 0x01, 0x01, 0x40, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x40, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x40, 0x01, 0x01, 0x01, 0x01, 0x01}, + nil, + []byte{0xca, 0xc0, 0x9f, 0x79, 0x7d, 0x03, 0x12, 0x87}}, + { // 16 + []byte{ + 0x01, 0x01, 0x20, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x20, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x20, 0x01, 0x01, 0x01, 0x01, 0x01}, + nil, + []byte{0x90, 0xba, 0x68, 0x0b, 0x22, 0xae, 0xb5, 0x25}}, + { // 17 + []byte{ + 0x01, 0x01, 0x10, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x10, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x10, 0x01, 0x01, 0x01, 0x01, 0x01}, + nil, + []byte{0xce, 0x7a, 0x24, 0xf3, 0x50, 0xe2, 0x80, 0xb6}}, + { // 18 + []byte{ + 0x01, 0x01, 0x08, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x08, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x08, 0x01, 0x01, 0x01, 0x01, 0x01}, + nil, + []byte{0x88, 0x2b, 0xff, 0x0a, 0xa0, 0x1a, 0x0b, 0x87}}, + { // 19 + []byte{ + 0x01, 0x01, 0x04, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x04, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x04, 0x01, 0x01, 0x01, 0x01, 0x01}, + nil, + []byte{0x25, 0x61, 0x02, 0x88, 0x92, 0x45, 0x11, 0xc2}}, + { // 20 + []byte{ + 0x01, 0x01, 0x02, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x02, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x02, 0x01, 0x01, 0x01, 0x01, 0x01}, + nil, + []byte{0xc7, 0x15, 0x16, 0xc2, 0x9c, 0x75, 0xd1, 0x70}}, + { // 21 + []byte{ + 0x01, 0x01, 0x01, 0x80, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x80, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x80, 0x01, 0x01, 0x01, 0x01}, + nil, + []byte{0x51, 0x99, 0xc2, 0x9a, 0x52, 0xc9, 0xf0, 0x59}}, + { // 22 + []byte{ + 0x01, 0x01, 0x01, 0x40, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x40, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x40, 0x01, 0x01, 0x01, 0x01}, + nil, + []byte{0xc2, 0x2f, 0x0a, 0x29, 0x4a, 0x71, 0xf2, 0x9f}}, + { // 23 + []byte{ + 0x01, 0x01, 0x01, 0x20, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x20, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x20, 0x01, 0x01, 0x01, 0x01}, + nil, + []byte{0xee, 0x37, 0x14, 0x83, 0x71, 0x4c, 0x02, 0xea}}, + { // 24 + []byte{ + 0x01, 0x01, 0x01, 0x10, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x10, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x10, 0x01, 0x01, 0x01, 0x01}, + nil, + []byte{0xa8, 0x1f, 0xbd, 0x44, 0x8f, 0x9e, 0x52, 0x2f}}, + { // 25 + []byte{ + 0x01, 0x01, 0x01, 0x08, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x08, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x08, 0x01, 0x01, 0x01, 0x01}, + nil, + []byte{0x4f, 0x64, 0x4c, 0x92, 0xe1, 0x92, 0xdf, 0xed}}, + { // 26 + []byte{ + 0x01, 0x01, 0x01, 0x04, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x04, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x04, 0x01, 0x01, 0x01, 0x01}, + nil, + []byte{0x1a, 0xfa, 0x9a, 0x66, 0xa6, 0xdf, 0x92, 0xae}}, + { // 27 + []byte{ + 0x01, 0x01, 0x01, 0x02, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x02, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x02, 0x01, 0x01, 0x01, 0x01}, + nil, + []byte{0xb3, 0xc1, 0xcc, 0x71, 0x5c, 0xb8, 0x79, 0xd8}}, + { // 28 + []byte{ + 0x01, 0x01, 0x01, 0x01, 0x80, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x80, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x80, 0x01, 0x01, 0x01}, + nil, + []byte{0x19, 0xd0, 0x32, 0xe6, 0x4a, 0xb0, 0xbd, 0x8b}}, + { // 29 + []byte{ + 0x01, 0x01, 0x01, 0x01, 0x40, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x40, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x40, 0x01, 0x01, 0x01}, + nil, + []byte{0x3c, 0xfa, 0xa7, 0xa7, 0xdc, 0x87, 0x20, 0xdc}}, + { // 30 + []byte{ + 0x01, 0x01, 0x01, 0x01, 0x20, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x20, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x20, 0x01, 0x01, 0x01}, + nil, + []byte{0xb7, 0x26, 0x5f, 0x7f, 0x44, 0x7a, 0xc6, 0xf3}}, + { // 31 + []byte{ + 0x01, 0x01, 0x01, 0x01, 0x10, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x10, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x10, 0x01, 0x01, 0x01}, + nil, + []byte{0x9d, 0xb7, 0x3b, 0x3c, 0x0d, 0x16, 0x3f, 0x54}}, + { // 32 + []byte{ + 0x01, 0x01, 0x01, 0x01, 0x08, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x08, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x08, 0x01, 0x01, 0x01}, + nil, + []byte{0x81, 0x81, 0xb6, 0x5b, 0xab, 0xf4, 0xa9, 0x75}}, + { // 33 + []byte{ + 0x01, 0x01, 0x01, 0x01, 0x04, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x04, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x04, 0x01, 0x01, 0x01}, + nil, + []byte{0x93, 0xc9, 0xb6, 0x40, 0x42, 0xea, 0xa2, 0x40}}, + { // 34 + []byte{ + 0x01, 0x01, 0x01, 0x01, 0x02, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x02, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x02, 0x01, 0x01, 0x01}, + nil, + []byte{0x55, 0x70, 0x53, 0x08, 0x29, 0x70, 0x55, 0x92}}, + { // 35 + []byte{ + 0x01, 0x01, 0x01, 0x01, 0x01, 0x80, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x80, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x80, 0x01, 0x01}, + nil, + []byte{0x86, 0x38, 0x80, 0x9e, 0x87, 0x87, 0x87, 0xa0}}, + { // 36 + []byte{ + 0x01, 0x01, 0x01, 0x01, 0x01, 0x40, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x40, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x40, 0x01, 0x01}, + nil, + []byte{0x41, 0xb9, 0xa7, 0x9a, 0xf7, 0x9a, 0xc2, 0x08}}, + { // 37 + []byte{ + 0x01, 0x01, 0x01, 0x01, 0x01, 0x20, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x20, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x20, 0x01, 0x01}, + nil, + []byte{0x7a, 0x9b, 0xe4, 0x2f, 0x20, 0x09, 0xa8, 0x92}}, + { // 38 + []byte{ + 0x01, 0x01, 0x01, 0x01, 0x01, 0x10, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x10, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x10, 0x01, 0x01}, + nil, + []byte{0x29, 0x03, 0x8d, 0x56, 0xba, 0x6d, 0x27, 0x45}}, + { // 39 + []byte{ + 0x01, 0x01, 0x01, 0x01, 0x01, 0x08, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x08, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x08, 0x01, 0x01}, + nil, + []byte{0x54, 0x95, 0xc6, 0xab, 0xf1, 0xe5, 0xdf, 0x51}}, + { // 40 + []byte{ + 0x01, 0x01, 0x01, 0x01, 0x01, 0x04, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x04, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x04, 0x01, 0x01}, + nil, + []byte{0xae, 0x13, 0xdb, 0xd5, 0x61, 0x48, 0x89, 0x33}}, + { // 41 + []byte{ + 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x01, 0x01}, + nil, + []byte{0x02, 0x4d, 0x1f, 0xfa, 0x89, 0x04, 0xe3, 0x89}}, + { // 42 + []byte{ + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x80, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x80, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x80, 0x01}, + nil, + []byte{0xd1, 0x39, 0x97, 0x12, 0xf9, 0x9b, 0xf0, 0x2e}}, + { // 43 + []byte{ + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x40, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x40, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x40, 0x01}, + nil, + []byte{0x14, 0xc1, 0xd7, 0xc1, 0xcf, 0xfe, 0xc7, 0x9e}}, + { // 44 + []byte{ + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x20, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x20, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x20, 0x01}, + nil, + []byte{0x1d, 0xe5, 0x27, 0x9d, 0xae, 0x3b, 0xed, 0x6f}}, + { // 45 + []byte{ + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x10, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x10, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x10, 0x01}, + nil, + []byte{0xe9, 0x41, 0xa3, 0x3f, 0x85, 0x50, 0x13, 0x03}}, + { // 46 + []byte{ + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x08, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x08, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x08, 0x01}, + nil, + []byte{0xda, 0x99, 0xdb, 0xbc, 0x9a, 0x03, 0xf3, 0x79}}, + { // 47 + []byte{ + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x04, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x04, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x04, 0x01}, + nil, + []byte{0xb7, 0xfc, 0x92, 0xf9, 0x1d, 0x8e, 0x92, 0xe9}}, + { // 48 + []byte{ + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x01}, + nil, + []byte{0xae, 0x8e, 0x5c, 0xaa, 0x3c, 0xa0, 0x4e, 0x85}}, + { // 49 + []byte{ + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x80, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x80, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x80}, + nil, + []byte{0x9c, 0xc6, 0x2d, 0xf4, 0x3b, 0x6e, 0xed, 0x74}}, + { // 50 + []byte{ + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x40, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x40, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x40}, + nil, + []byte{0xd8, 0x63, 0xdb, 0xb5, 0xc5, 0x9a, 0x91, 0xa0}}, + { // 50 + []byte{ + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x20, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x20, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x20}, + nil, + []byte{0xa1, 0xab, 0x21, 0x90, 0x54, 0x5b, 0x91, 0xd7}}, + { // 52 + []byte{ + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x10, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x10, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x10}, + nil, + []byte{0x08, 0x75, 0x04, 0x1e, 0x64, 0xc5, 0x70, 0xf7}}, + { // 53 + []byte{ + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x08, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x08, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x08}, + nil, + []byte{0x5a, 0x59, 0x45, 0x28, 0xbe, 0xbe, 0xf1, 0xcc}}, + { // 54 + []byte{ + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x04, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x04, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x04}, + nil, + []byte{0xfc, 0xdb, 0x32, 0x91, 0xde, 0x21, 0xf0, 0xc0}}, + { // 55 + []byte{ + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02}, + nil, + []byte{0x86, 0x9e, 0xfd, 0x7f, 0x9f, 0x26, 0x5a, 0x09}}, +} + +// Plaintext for use with Table A.3 tests +var tableA3Plaintext = []byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00} + +// Table A.3 Values To Be Used for the Permutation Operation Known Answer Test +var tableA3Tests = []CryptTest{ + { // 0 + []byte{ + 0x10, 0x46, 0x91, 0x34, 0x89, 0x98, 0x01, 0x31, + 0x10, 0x46, 0x91, 0x34, 0x89, 0x98, 0x01, 0x31, + 0x10, 0x46, 0x91, 0x34, 0x89, 0x98, 0x01, 0x31, + }, + nil, + []byte{0x88, 0xd5, 0x5e, 0x54, 0xf5, 0x4c, 0x97, 0xb4}}, + { // 1 + []byte{ + 0x10, 0x07, 0x10, 0x34, 0x89, 0x98, 0x80, 0x20, + 0x10, 0x07, 0x10, 0x34, 0x89, 0x98, 0x80, 0x20, + 0x10, 0x07, 0x10, 0x34, 0x89, 0x98, 0x80, 0x20, + }, + nil, + []byte{0x0c, 0x0c, 0xc0, 0x0c, 0x83, 0xea, 0x48, 0xfd}}, + { // 2 + []byte{ + 0x10, 0x07, 0x10, 0x34, 0xc8, 0x98, 0x01, 0x20, + 0x10, 0x07, 0x10, 0x34, 0xc8, 0x98, 0x01, 0x20, + 0x10, 0x07, 0x10, 0x34, 0xc8, 0x98, 0x01, 0x20, + }, + nil, + []byte{0x83, 0xbc, 0x8e, 0xf3, 0xa6, 0x57, 0x01, 0x83}}, + { // 3 + []byte{ + 0x10, 0x46, 0x10, 0x34, 0x89, 0x98, 0x80, 0x20, + 0x10, 0x46, 0x10, 0x34, 0x89, 0x98, 0x80, 0x20, + 0x10, 0x46, 0x10, 0x34, 0x89, 0x98, 0x80, 0x20, + }, + nil, + []byte{0xdf, 0x72, 0x5d, 0xca, 0xd9, 0x4e, 0xa2, 0xe9}}, + { // 4 + []byte{ + 0x10, 0x86, 0x91, 0x15, 0x19, 0x19, 0x01, 0x01, + 0x10, 0x86, 0x91, 0x15, 0x19, 0x19, 0x01, 0x01, + 0x10, 0x86, 0x91, 0x15, 0x19, 0x19, 0x01, 0x01, + }, + nil, + []byte{0xe6, 0x52, 0xb5, 0x3b, 0x55, 0x0b, 0xe8, 0xb0}}, + { // 5 + []byte{ + 0x10, 0x86, 0x91, 0x15, 0x19, 0x58, 0x01, 0x01, + 0x10, 0x86, 0x91, 0x15, 0x19, 0x58, 0x01, 0x01, + 0x10, 0x86, 0x91, 0x15, 0x19, 0x58, 0x01, 0x01, + }, + nil, + []byte{0xaf, 0x52, 0x71, 0x20, 0xc4, 0x85, 0xcb, 0xb0}}, + { // 6 + []byte{ + 0x51, 0x07, 0xb0, 0x15, 0x19, 0x58, 0x01, 0x01, + 0x51, 0x07, 0xb0, 0x15, 0x19, 0x58, 0x01, 0x01, + 0x51, 0x07, 0xb0, 0x15, 0x19, 0x58, 0x01, 0x01, + }, + nil, + []byte{0x0f, 0x04, 0xce, 0x39, 0x3d, 0xb9, 0x26, 0xd5}}, + { // 7 + []byte{ + 0x10, 0x07, 0xb0, 0x15, 0x19, 0x19, 0x01, 0x01, + 0x10, 0x07, 0xb0, 0x15, 0x19, 0x19, 0x01, 0x01, + 0x10, 0x07, 0xb0, 0x15, 0x19, 0x19, 0x01, 0x01, + }, + nil, + []byte{0xc9, 0xf0, 0x0f, 0xfc, 0x74, 0x07, 0x90, 0x67}}, + { // 8 + []byte{ + 0x31, 0x07, 0x91, 0x54, 0x98, 0x08, 0x01, 0x01, + 0x31, 0x07, 0x91, 0x54, 0x98, 0x08, 0x01, 0x01, + 0x31, 0x07, 0x91, 0x54, 0x98, 0x08, 0x01, 0x01, + }, + nil, + []byte{0x7c, 0xfd, 0x82, 0xa5, 0x93, 0x25, 0x2b, 0x4e}}, + { // 9 + []byte{ + 0x31, 0x07, 0x91, 0x94, 0x98, 0x08, 0x01, 0x01, + 0x31, 0x07, 0x91, 0x94, 0x98, 0x08, 0x01, 0x01, + 0x31, 0x07, 0x91, 0x94, 0x98, 0x08, 0x01, 0x01, + }, + nil, + []byte{0xcb, 0x49, 0xa2, 0xf9, 0xe9, 0x13, 0x63, 0xe3}}, + { // 10 + []byte{ + 0x10, 0x07, 0x91, 0x15, 0xb9, 0x08, 0x01, 0x40, + 0x10, 0x07, 0x91, 0x15, 0xb9, 0x08, 0x01, 0x40, + 0x10, 0x07, 0x91, 0x15, 0xb9, 0x08, 0x01, 0x40, + }, + nil, + []byte{0x00, 0xb5, 0x88, 0xbe, 0x70, 0xd2, 0x3f, 0x56}}, + { // 11 + []byte{ + 0x31, 0x07, 0x91, 0x15, 0x98, 0x08, 0x01, 0x40, + 0x31, 0x07, 0x91, 0x15, 0x98, 0x08, 0x01, 0x40, + 0x31, 0x07, 0x91, 0x15, 0x98, 0x08, 0x01, 0x40, + }, + nil, + []byte{0x40, 0x6a, 0x9a, 0x6a, 0xb4, 0x33, 0x99, 0xae}}, + { // 12 + []byte{ + 0x10, 0x07, 0xd0, 0x15, 0x89, 0x98, 0x01, 0x01, + 0x10, 0x07, 0xd0, 0x15, 0x89, 0x98, 0x01, 0x01, + 0x10, 0x07, 0xd0, 0x15, 0x89, 0x98, 0x01, 0x01, + }, + nil, + []byte{0x6c, 0xb7, 0x73, 0x61, 0x1d, 0xca, 0x9a, 0xda}}, + { // 13 + []byte{ + 0x91, 0x07, 0x91, 0x15, 0x89, 0x98, 0x01, 0x01, + 0x91, 0x07, 0x91, 0x15, 0x89, 0x98, 0x01, 0x01, + 0x91, 0x07, 0x91, 0x15, 0x89, 0x98, 0x01, 0x01, + }, + nil, + []byte{0x67, 0xfd, 0x21, 0xc1, 0x7d, 0xbb, 0x5d, 0x70}}, + { // 14 + []byte{ + 0x91, 0x07, 0xd0, 0x15, 0x89, 0x19, 0x01, 0x01, + 0x91, 0x07, 0xd0, 0x15, 0x89, 0x19, 0x01, 0x01, + 0x91, 0x07, 0xd0, 0x15, 0x89, 0x19, 0x01, 0x01, + }, + nil, + []byte{0x95, 0x92, 0xcb, 0x41, 0x10, 0x43, 0x07, 0x87}}, + { // 15 + []byte{ + 0x10, 0x07, 0xd0, 0x15, 0x98, 0x98, 0x01, 0x20, + 0x10, 0x07, 0xd0, 0x15, 0x98, 0x98, 0x01, 0x20, + 0x10, 0x07, 0xd0, 0x15, 0x98, 0x98, 0x01, 0x20, + }, + nil, + []byte{0xa6, 0xb7, 0xff, 0x68, 0xa3, 0x18, 0xdd, 0xd3}}, + { // 16 + []byte{ + 0x10, 0x07, 0x94, 0x04, 0x98, 0x19, 0x01, 0x01, + 0x10, 0x07, 0x94, 0x04, 0x98, 0x19, 0x01, 0x01, + 0x10, 0x07, 0x94, 0x04, 0x98, 0x19, 0x01, 0x01, + }, + nil, + []byte{0x4d, 0x10, 0x21, 0x96, 0xc9, 0x14, 0xca, 0x16}}, + { // 17 + []byte{ + 0x01, 0x07, 0x91, 0x04, 0x91, 0x19, 0x04, 0x01, + 0x01, 0x07, 0x91, 0x04, 0x91, 0x19, 0x04, 0x01, + 0x01, 0x07, 0x91, 0x04, 0x91, 0x19, 0x04, 0x01, + }, + nil, + []byte{0x2d, 0xfa, 0x9f, 0x45, 0x73, 0x59, 0x49, 0x65}}, + { // 18 + []byte{ + 0x01, 0x07, 0x91, 0x04, 0x91, 0x19, 0x01, 0x01, + 0x01, 0x07, 0x91, 0x04, 0x91, 0x19, 0x01, 0x01, + 0x01, 0x07, 0x91, 0x04, 0x91, 0x19, 0x01, 0x01, + }, + nil, + []byte{0xb4, 0x66, 0x04, 0x81, 0x6c, 0x0e, 0x07, 0x74}}, + { // 19 + []byte{ + 0x01, 0x07, 0x94, 0x04, 0x91, 0x19, 0x04, 0x01, + 0x01, 0x07, 0x94, 0x04, 0x91, 0x19, 0x04, 0x01, + 0x01, 0x07, 0x94, 0x04, 0x91, 0x19, 0x04, 0x01, + }, + nil, + []byte{0x6e, 0x7e, 0x62, 0x21, 0xa4, 0xf3, 0x4e, 0x87}}, + { // 20 + []byte{ + 0x19, 0x07, 0x92, 0x10, 0x98, 0x1a, 0x01, 0x01, + 0x19, 0x07, 0x92, 0x10, 0x98, 0x1a, 0x01, 0x01, + 0x19, 0x07, 0x92, 0x10, 0x98, 0x1a, 0x01, 0x01, + }, + nil, + []byte{0xaa, 0x85, 0xe7, 0x46, 0x43, 0x23, 0x31, 0x99}}, + { // 21 + []byte{ + 0x10, 0x07, 0x91, 0x19, 0x98, 0x19, 0x08, 0x01, + 0x10, 0x07, 0x91, 0x19, 0x98, 0x19, 0x08, 0x01, + 0x10, 0x07, 0x91, 0x19, 0x98, 0x19, 0x08, 0x01, + }, + nil, + []byte{0x2e, 0x5a, 0x19, 0xdb, 0x4d, 0x19, 0x62, 0xd6}}, + { // 22 + []byte{ + 0x10, 0x07, 0x91, 0x19, 0x98, 0x1a, 0x08, 0x01, + 0x10, 0x07, 0x91, 0x19, 0x98, 0x1a, 0x08, 0x01, + 0x10, 0x07, 0x91, 0x19, 0x98, 0x1a, 0x08, 0x01, + }, + nil, + []byte{0x23, 0xa8, 0x66, 0xa8, 0x09, 0xd3, 0x08, 0x94}}, + { // 23 + []byte{ + 0x10, 0x07, 0x92, 0x10, 0x98, 0x19, 0x01, 0x01, + 0x10, 0x07, 0x92, 0x10, 0x98, 0x19, 0x01, 0x01, + 0x10, 0x07, 0x92, 0x10, 0x98, 0x19, 0x01, 0x01, + }, + nil, + []byte{0xd8, 0x12, 0xd9, 0x61, 0xf0, 0x17, 0xd3, 0x20}}, + { // 24 + []byte{ + 0x10, 0x07, 0x91, 0x15, 0x98, 0x19, 0x01, 0x0b, + 0x10, 0x07, 0x91, 0x15, 0x98, 0x19, 0x01, 0x0b, + 0x10, 0x07, 0x91, 0x15, 0x98, 0x19, 0x01, 0x0b, + }, + nil, + []byte{0x05, 0x56, 0x05, 0x81, 0x6e, 0x58, 0x60, 0x8f}}, + { // 25 + []byte{ + 0x10, 0x04, 0x80, 0x15, 0x98, 0x19, 0x01, 0x01, + 0x10, 0x04, 0x80, 0x15, 0x98, 0x19, 0x01, 0x01, + 0x10, 0x04, 0x80, 0x15, 0x98, 0x19, 0x01, 0x01, + }, + nil, + []byte{0xab, 0xd8, 0x8e, 0x8b, 0x1b, 0x77, 0x16, 0xf1}}, + { // 26 + []byte{ + 0x10, 0x04, 0x80, 0x15, 0x98, 0x19, 0x01, 0x02, + 0x10, 0x04, 0x80, 0x15, 0x98, 0x19, 0x01, 0x02, + 0x10, 0x04, 0x80, 0x15, 0x98, 0x19, 0x01, 0x02, + }, + nil, + []byte{0x53, 0x7a, 0xc9, 0x5b, 0xe6, 0x9d, 0xa1, 0xe1}}, + { // 27 + []byte{ + 0x10, 0x04, 0x80, 0x15, 0x98, 0x19, 0x01, 0x08, + 0x10, 0x04, 0x80, 0x15, 0x98, 0x19, 0x01, 0x08, + 0x10, 0x04, 0x80, 0x15, 0x98, 0x19, 0x01, 0x08, + }, + nil, + []byte{0xae, 0xd0, 0xf6, 0xae, 0x3c, 0x25, 0xcd, 0xd8}}, + { // 28 + []byte{ + 0x10, 0x02, 0x91, 0x15, 0x98, 0x10, 0x01, 0x04, + 0x10, 0x02, 0x91, 0x15, 0x98, 0x10, 0x01, 0x04, + 0x10, 0x02, 0x91, 0x15, 0x98, 0x10, 0x01, 0x04, + }, + nil, + []byte{0xb3, 0xe3, 0x5a, 0x5e, 0xe5, 0x3e, 0x7b, 0x8d}}, + { // 29 + []byte{ + 0x10, 0x02, 0x91, 0x15, 0x98, 0x19, 0x01, 0x04, + 0x10, 0x02, 0x91, 0x15, 0x98, 0x19, 0x01, 0x04, + 0x10, 0x02, 0x91, 0x15, 0x98, 0x19, 0x01, 0x04, + }, + nil, + []byte{0x61, 0xc7, 0x9c, 0x71, 0x92, 0x1a, 0x2e, 0xf8}}, + { // 30 + []byte{ + 0x10, 0x02, 0x91, 0x15, 0x98, 0x10, 0x02, 0x01, + 0x10, 0x02, 0x91, 0x15, 0x98, 0x10, 0x02, 0x01, + 0x10, 0x02, 0x91, 0x15, 0x98, 0x10, 0x02, 0x01, + }, + nil, + []byte{0xe2, 0xf5, 0x72, 0x8f, 0x09, 0x95, 0x01, 0x3c}}, + { // 31 + []byte{ + 0x10, 0x02, 0x91, 0x16, 0x98, 0x10, 0x01, 0x01, + 0x10, 0x02, 0x91, 0x16, 0x98, 0x10, 0x01, 0x01, + 0x10, 0x02, 0x91, 0x16, 0x98, 0x10, 0x01, 0x01, + }, + nil, + []byte{0x1a, 0xea, 0xc3, 0x9a, 0x61, 0xf0, 0xa4, 0x64}}, +} + +// Table A.4 Values To Be Used for the Substitution Table Known Answer Test +var tableA4Tests = []CryptTest{ + { // 0 + []byte{ + 0x7c, 0xa1, 0x10, 0x45, 0x4a, 0x1a, 0x6e, 0x57, + 0x7c, 0xa1, 0x10, 0x45, 0x4a, 0x1a, 0x6e, 0x57, + 0x7c, 0xa1, 0x10, 0x45, 0x4a, 0x1a, 0x6e, 0x57}, + []byte{0x01, 0xa1, 0xd6, 0xd0, 0x39, 0x77, 0x67, 0x42}, + []byte{0x69, 0x0f, 0x5b, 0x0d, 0x9a, 0x26, 0x93, 0x9b}}, + { // 1 + []byte{ + 0x01, 0x31, 0xd9, 0x61, 0x9d, 0xc1, 0x37, 0x6e, + 0x01, 0x31, 0xd9, 0x61, 0x9d, 0xc1, 0x37, 0x6e, + 0x01, 0x31, 0xd9, 0x61, 0x9d, 0xc1, 0x37, 0x6e}, + []byte{0x5c, 0xd5, 0x4c, 0xa8, 0x3d, 0xef, 0x57, 0xda}, + []byte{0x7a, 0x38, 0x9d, 0x10, 0x35, 0x4b, 0xd2, 0x71}}, + { // 2 + []byte{ + 0x07, 0xa1, 0x13, 0x3e, 0x4a, 0x0b, 0x26, 0x86, + 0x07, 0xa1, 0x13, 0x3e, 0x4a, 0x0b, 0x26, 0x86, + 0x07, 0xa1, 0x13, 0x3e, 0x4a, 0x0b, 0x26, 0x86}, + []byte{0x02, 0x48, 0xd4, 0x38, 0x06, 0xf6, 0x71, 0x72}, + []byte{0x86, 0x8e, 0xbb, 0x51, 0xca, 0xb4, 0x59, 0x9a}}, + { // 3 + []byte{ + 0x38, 0x49, 0x67, 0x4c, 0x26, 0x02, 0x31, 0x9e, + 0x38, 0x49, 0x67, 0x4c, 0x26, 0x02, 0x31, 0x9e, + 0x38, 0x49, 0x67, 0x4c, 0x26, 0x02, 0x31, 0x9e}, + []byte{0x51, 0x45, 0x4b, 0x58, 0x2d, 0xdf, 0x44, 0x0a}, + []byte{0x71, 0x78, 0x87, 0x6e, 0x01, 0xf1, 0x9b, 0x2a}}, + { // 4 + []byte{ + 0x04, 0xb9, 0x15, 0xba, 0x43, 0xfe, 0xb5, 0xb6, + 0x04, 0xb9, 0x15, 0xba, 0x43, 0xfe, 0xb5, 0xb6, + 0x04, 0xb9, 0x15, 0xba, 0x43, 0xfe, 0xb5, 0xb6}, + []byte{0x42, 0xfd, 0x44, 0x30, 0x59, 0x57, 0x7f, 0xa2}, + []byte{0xaf, 0x37, 0xfb, 0x42, 0x1f, 0x8c, 0x40, 0x95}}, + { // 5 + []byte{ + 0x01, 0x13, 0xb9, 0x70, 0xfd, 0x34, 0xf2, 0xce, + 0x01, 0x13, 0xb9, 0x70, 0xfd, 0x34, 0xf2, 0xce, + 0x01, 0x13, 0xb9, 0x70, 0xfd, 0x34, 0xf2, 0xce}, + []byte{0x05, 0x9b, 0x5e, 0x08, 0x51, 0xcf, 0x14, 0x3a}, + []byte{0x86, 0xa5, 0x60, 0xf1, 0x0e, 0xc6, 0xd8, 0x5b}}, + { // 6 + []byte{ + 0x01, 0x70, 0xf1, 0x75, 0x46, 0x8f, 0xb5, 0xe6, + 0x01, 0x70, 0xf1, 0x75, 0x46, 0x8f, 0xb5, 0xe6, + 0x01, 0x70, 0xf1, 0x75, 0x46, 0x8f, 0xb5, 0xe6}, + []byte{0x07, 0x56, 0xd8, 0xe0, 0x77, 0x47, 0x61, 0xd2}, + []byte{0x0c, 0xd3, 0xda, 0x02, 0x00, 0x21, 0xdc, 0x09}}, + { // 7 + []byte{ + 0x43, 0x29, 0x7f, 0xad, 0x38, 0xe3, 0x73, 0xfe, + 0x43, 0x29, 0x7f, 0xad, 0x38, 0xe3, 0x73, 0xfe, + 0x43, 0x29, 0x7f, 0xad, 0x38, 0xe3, 0x73, 0xfe}, + []byte{0x76, 0x25, 0x14, 0xb8, 0x29, 0xbf, 0x48, 0x6a}, + []byte{0xea, 0x67, 0x6b, 0x2c, 0xb7, 0xdb, 0x2b, 0x7a}}, + { // 8 + []byte{ + 0x07, 0xa7, 0x13, 0x70, 0x45, 0xda, 0x2a, 0x16, + 0x07, 0xa7, 0x13, 0x70, 0x45, 0xda, 0x2a, 0x16, + 0x07, 0xa7, 0x13, 0x70, 0x45, 0xda, 0x2a, 0x16}, + []byte{0x3b, 0xdd, 0x11, 0x90, 0x49, 0x37, 0x28, 0x02}, + []byte{0xdf, 0xd6, 0x4a, 0x81, 0x5c, 0xaf, 0x1a, 0x0f}}, + { // 9 + []byte{ + 0x04, 0x68, 0x91, 0x04, 0xc2, 0xfd, 0x3b, 0x2f, + 0x04, 0x68, 0x91, 0x04, 0xc2, 0xfd, 0x3b, 0x2f, + 0x04, 0x68, 0x91, 0x04, 0xc2, 0xfd, 0x3b, 0x2f}, + []byte{0x26, 0x95, 0x5f, 0x68, 0x35, 0xaf, 0x60, 0x9a}, + []byte{0x5c, 0x51, 0x3c, 0x9c, 0x48, 0x86, 0xc0, 0x88}}, + { // 10 + []byte{ + 0x37, 0xd0, 0x6b, 0xb5, 0x16, 0xcb, 0x75, 0x46, + 0x37, 0xd0, 0x6b, 0xb5, 0x16, 0xcb, 0x75, 0x46, + 0x37, 0xd0, 0x6b, 0xb5, 0x16, 0xcb, 0x75, 0x46}, + []byte{0x16, 0x4d, 0x5e, 0x40, 0x4f, 0x27, 0x52, 0x32}, + []byte{0x0a, 0x2a, 0xee, 0xae, 0x3f, 0xf4, 0xab, 0x77}}, + { // 11 + []byte{ + 0x1f, 0x08, 0x26, 0x0d, 0x1a, 0xc2, 0x46, 0x5e, + 0x1f, 0x08, 0x26, 0x0d, 0x1a, 0xc2, 0x46, 0x5e, + 0x1f, 0x08, 0x26, 0x0d, 0x1a, 0xc2, 0x46, 0x5e}, + []byte{0x6b, 0x05, 0x6e, 0x18, 0x75, 0x9f, 0x5c, 0xca}, + []byte{0xef, 0x1b, 0xf0, 0x3e, 0x5d, 0xfa, 0x57, 0x5a}}, + { // 12 + []byte{ + 0x58, 0x40, 0x23, 0x64, 0x1a, 0xba, 0x61, 0x76, + 0x58, 0x40, 0x23, 0x64, 0x1a, 0xba, 0x61, 0x76, + 0x58, 0x40, 0x23, 0x64, 0x1a, 0xba, 0x61, 0x76}, + []byte{0x00, 0x4b, 0xd6, 0xef, 0x09, 0x17, 0x60, 0x62}, + []byte{0x88, 0xbf, 0x0d, 0xb6, 0xd7, 0x0d, 0xee, 0x56}}, + { // 13 + []byte{ + 0x02, 0x58, 0x16, 0x16, 0x46, 0x29, 0xb0, 0x07, + 0x02, 0x58, 0x16, 0x16, 0x46, 0x29, 0xb0, 0x07, + 0x02, 0x58, 0x16, 0x16, 0x46, 0x29, 0xb0, 0x07}, + []byte{0x48, 0x0d, 0x39, 0x00, 0x6e, 0xe7, 0x62, 0xf2}, + []byte{0xa1, 0xf9, 0x91, 0x55, 0x41, 0x02, 0x0b, 0x56}}, + { // 14 + []byte{ + 0x49, 0x79, 0x3e, 0xbc, 0x79, 0xb3, 0x25, 0x8f, + 0x49, 0x79, 0x3e, 0xbc, 0x79, 0xb3, 0x25, 0x8f, + 0x49, 0x79, 0x3e, 0xbc, 0x79, 0xb3, 0x25, 0x8f}, + []byte{0x43, 0x75, 0x40, 0xc8, 0x69, 0x8f, 0x3c, 0xfa}, + []byte{0x6f, 0xbf, 0x1c, 0xaf, 0xcf, 0xfd, 0x05, 0x56}}, + { // 15 + []byte{ + 0x4f, 0xb0, 0x5e, 0x15, 0x15, 0xab, 0x73, 0xa7, + 0x4f, 0xb0, 0x5e, 0x15, 0x15, 0xab, 0x73, 0xa7, + 0x4f, 0xb0, 0x5e, 0x15, 0x15, 0xab, 0x73, 0xa7}, + []byte{0x07, 0x2d, 0x43, 0xa0, 0x77, 0x07, 0x52, 0x92}, + []byte{0x2f, 0x22, 0xe4, 0x9b, 0xab, 0x7c, 0xa1, 0xac}}, + { // 16 + []byte{ + 0x49, 0xe9, 0x5d, 0x6d, 0x4c, 0xa2, 0x29, 0xbf, + 0x49, 0xe9, 0x5d, 0x6d, 0x4c, 0xa2, 0x29, 0xbf, + 0x49, 0xe9, 0x5d, 0x6d, 0x4c, 0xa2, 0x29, 0xbf}, + []byte{0x02, 0xfe, 0x55, 0x77, 0x81, 0x17, 0xf1, 0x2a}, + []byte{0x5a, 0x6b, 0x61, 0x2c, 0xc2, 0x6c, 0xce, 0x4a}}, + { // 17 + []byte{ + 0x01, 0x83, 0x10, 0xdc, 0x40, 0x9b, 0x26, 0xd6, + 0x01, 0x83, 0x10, 0xdc, 0x40, 0x9b, 0x26, 0xd6, + 0x01, 0x83, 0x10, 0xdc, 0x40, 0x9b, 0x26, 0xd6}, + []byte{0x1d, 0x9d, 0x5c, 0x50, 0x18, 0xf7, 0x28, 0xc2}, + []byte{0x5f, 0x4c, 0x03, 0x8e, 0xd1, 0x2b, 0x2e, 0x41}}, + { // 18 + []byte{ + 0x1c, 0x58, 0x7f, 0x1c, 0x13, 0x92, 0x4f, 0xef, + 0x1c, 0x58, 0x7f, 0x1c, 0x13, 0x92, 0x4f, 0xef, + 0x1c, 0x58, 0x7f, 0x1c, 0x13, 0x92, 0x4f, 0xef}, + []byte{0x30, 0x55, 0x32, 0x28, 0x6d, 0x6f, 0x29, 0x5a}, + []byte{0x63, 0xfa, 0xc0, 0xd0, 0x34, 0xd9, 0xf7, 0x93}}, +} + +func newCipher(key []byte) *desCipher { + c, err := NewCipher(key) + if err != nil { + panic("NewCipher failed: " + err.Error()) + } + return c.(*desCipher) +} + +// Use the known weak keys to test DES implementation +func TestWeakKeys(t *testing.T) { + for i, tt := range weakKeyTests { + var encrypt = func(in []byte) (out []byte) { + c := newCipher(tt.key) + out = make([]byte, len(in)) + encryptBlock(c.subkeys[:], out, in) + return + } + + // Encrypting twice with a DES weak + // key should reproduce the original input + result := encrypt(tt.in) + result = encrypt(result) + + if !bytes.Equal(result, tt.in) { + t.Errorf("#%d: result: %x want: %x", i, result, tt.in) + } + } +} + +// Use the known semi-weak key pairs to test DES implementation +func TestSemiWeakKeyPairs(t *testing.T) { + for i, tt := range semiWeakKeyTests { + var encrypt = func(key, in []byte) (out []byte) { + c := newCipher(key) + out = make([]byte, len(in)) + encryptBlock(c.subkeys[:], out, in) + return + } + + // Encrypting with one member of the semi-weak pair + // and then encrypting the result with the other member + // should reproduce the original input. + result := encrypt(tt.key, tt.in) + result = encrypt(tt.out, result) + + if !bytes.Equal(result, tt.in) { + t.Errorf("#%d: result: %x want: %x", i, result, tt.in) + } + } +} + +func TestDESEncryptBlock(t *testing.T) { + for i, tt := range encryptDESTests { + c := newCipher(tt.key) + out := make([]byte, len(tt.in)) + encryptBlock(c.subkeys[:], out, tt.in) + + if !bytes.Equal(out, tt.out) { + t.Errorf("#%d: result: %x want: %x", i, out, tt.out) + } + } +} + +func TestDESDecryptBlock(t *testing.T) { + for i, tt := range encryptDESTests { + c := newCipher(tt.key) + plain := make([]byte, len(tt.in)) + decryptBlock(c.subkeys[:], plain, tt.out) + + if !bytes.Equal(plain, tt.in) { + t.Errorf("#%d: result: %x want: %x", i, plain, tt.in) + } + } +} + +func TestEncryptTripleDES(t *testing.T) { + for i, tt := range encryptTripleDESTests { + c, _ := NewTripleDESCipher(tt.key) + out := make([]byte, len(tt.in)) + c.Encrypt(out, tt.in) + + if !bytes.Equal(out, tt.out) { + t.Errorf("#%d: result: %x want: %x", i, out, tt.out) + } + } +} + +func TestDecryptTripleDES(t *testing.T) { + for i, tt := range encryptTripleDESTests { + c, _ := NewTripleDESCipher(tt.key) + + plain := make([]byte, len(tt.in)) + c.Decrypt(plain, tt.out) + + if !bytes.Equal(plain, tt.in) { + t.Errorf("#%d: result: %x want: %x", i, plain, tt.in) + } + } +} + +// Defined in Pub 800-20 +func TestVariablePlaintextKnownAnswer(t *testing.T) { + for i, tt := range tableA1Tests { + c, _ := NewTripleDESCipher(tableA1Key) + + out := make([]byte, len(tt.in)) + c.Encrypt(out, tt.in) + + if !bytes.Equal(out, tt.out) { + t.Errorf("#%d: result: %x want: %x", i, out, tt.out) + } + } +} + +// Defined in Pub 800-20 +func TestVariableCiphertextKnownAnswer(t *testing.T) { + for i, tt := range tableA1Tests { + c, _ := NewTripleDESCipher(tableA1Key) + + plain := make([]byte, len(tt.out)) + c.Decrypt(plain, tt.out) + + if !bytes.Equal(plain, tt.in) { + t.Errorf("#%d: result: %x want: %x", i, plain, tt.in) + } + } +} + +// Defined in Pub 800-20 +// Encrypting the Table A.1 ciphertext with the +// 0x01... key produces the original plaintext +func TestInversePermutationKnownAnswer(t *testing.T) { + for i, tt := range tableA1Tests { + c, _ := NewTripleDESCipher(tableA1Key) + + plain := make([]byte, len(tt.in)) + c.Encrypt(plain, tt.out) + + if !bytes.Equal(plain, tt.in) { + t.Errorf("#%d: result: %x want: %x", i, plain, tt.in) + } + } +} + +// Defined in Pub 800-20 +// Decrypting the Table A.1 plaintext with the +// 0x01... key produces the corresponding ciphertext +func TestInitialPermutationKnownAnswer(t *testing.T) { + for i, tt := range tableA1Tests { + c, _ := NewTripleDESCipher(tableA1Key) + + out := make([]byte, len(tt.in)) + c.Decrypt(out, tt.in) + + if !bytes.Equal(out, tt.out) { + t.Errorf("#%d: result: %x want: %x", i, out, tt.out) + } + } +} + +// Defined in Pub 800-20 +func TestVariableKeyKnownAnswerEncrypt(t *testing.T) { + for i, tt := range tableA2Tests { + c, _ := NewTripleDESCipher(tt.key) + + out := make([]byte, len(tableA2Plaintext)) + c.Encrypt(out, tableA2Plaintext) + + if !bytes.Equal(out, tt.out) { + t.Errorf("#%d: result: %x want: %x", i, out, tt.out) + } + } +} + +// Defined in Pub 800-20 +func TestVariableKeyKnownAnswerDecrypt(t *testing.T) { + for i, tt := range tableA2Tests { + c, _ := NewTripleDESCipher(tt.key) + + out := make([]byte, len(tt.out)) + c.Decrypt(out, tt.out) + + if !bytes.Equal(out, tableA2Plaintext) { + t.Errorf("#%d: result: %x want: %x", i, out, tableA2Plaintext) + } + } +} + +// Defined in Pub 800-20 +func TestPermutationOperationKnownAnswerEncrypt(t *testing.T) { + for i, tt := range tableA3Tests { + c, _ := NewTripleDESCipher(tt.key) + + out := make([]byte, len(tableA3Plaintext)) + c.Encrypt(out, tableA3Plaintext) + + if !bytes.Equal(out, tt.out) { + t.Errorf("#%d: result: %x want: %x", i, out, tt.out) + } + } +} + +// Defined in Pub 800-20 +func TestPermutationOperationKnownAnswerDecrypt(t *testing.T) { + for i, tt := range tableA3Tests { + c, _ := NewTripleDESCipher(tt.key) + + out := make([]byte, len(tt.out)) + c.Decrypt(out, tt.out) + + if !bytes.Equal(out, tableA3Plaintext) { + t.Errorf("#%d: result: %x want: %x", i, out, tableA3Plaintext) + } + } +} + +// Defined in Pub 800-20 +func TestSubstitutionTableKnownAnswerEncrypt(t *testing.T) { + for i, tt := range tableA4Tests { + c, _ := NewTripleDESCipher(tt.key) + + out := make([]byte, len(tt.in)) + c.Encrypt(out, tt.in) + + if !bytes.Equal(out, tt.out) { + t.Errorf("#%d: result: %x want: %x", i, out, tt.out) + } + } +} + +// Defined in Pub 800-20 +func TestSubstitutionTableKnownAnswerDecrypt(t *testing.T) { + for i, tt := range tableA4Tests { + c, _ := NewTripleDESCipher(tt.key) + + out := make([]byte, len(tt.out)) + c.Decrypt(out, tt.out) + + if !bytes.Equal(out, tt.in) { + t.Errorf("#%d: result: %x want: %x", i, out, tt.in) + } + } +} + +func TestInitialPermute(t *testing.T) { + for i := uint(0); i < 64; i++ { + bit := uint64(1) << i + got := permuteInitialBlock(bit) + want := uint64(1) << finalPermutation[63-i] + if got != want { + t.Errorf("permute(%x) = %x, want %x", bit, got, want) + } + } +} + +func TestFinalPermute(t *testing.T) { + for i := uint(0); i < 64; i++ { + bit := uint64(1) << i + got := permuteFinalBlock(bit) + want := uint64(1) << initialPermutation[63-i] + if got != want { + t.Errorf("permute(%x) = %x, want %x", bit, got, want) + } + } +} + +func TestExpandBlock(t *testing.T) { + for i := uint(0); i < 32; i++ { + bit := uint32(1) << i + got := expandBlock(bit) + want := permuteBlock(uint64(bit), expansionFunction[:]) + if got != want { + t.Errorf("expand(%x) = %x, want %x", bit, got, want) + } + } +} + +func BenchmarkEncrypt(b *testing.B) { + tt := encryptDESTests[0] + c, err := NewCipher(tt.key) + if err != nil { + b.Fatal("NewCipher:", err) + } + out := make([]byte, len(tt.in)) + b.SetBytes(int64(len(out))) + b.ResetTimer() + for i := 0; i < b.N; i++ { + c.Encrypt(out, tt.in) + } +} + +func BenchmarkDecrypt(b *testing.B) { + tt := encryptDESTests[0] + c, err := NewCipher(tt.key) + if err != nil { + b.Fatal("NewCipher:", err) + } + out := make([]byte, len(tt.out)) + b.SetBytes(int64(len(out))) + b.ResetTimer() + for i := 0; i < b.N; i++ { + c.Decrypt(out, tt.out) + } +} diff --git a/src/crypto/des/example_test.go b/src/crypto/des/example_test.go new file mode 100644 index 0000000000000000000000000000000000000000..336b5937569cde27b645bfc8b76b28575f208b85 --- /dev/null +++ b/src/crypto/des/example_test.go @@ -0,0 +1,25 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package des_test + +import "crypto/des" + +func ExampleNewTripleDESCipher() { + // NewTripleDESCipher can also be used when EDE2 is required by + // duplicating the first 8 bytes of the 16-byte key. + ede2Key := []byte("example key 1234") + + var tripleDESKey []byte + tripleDESKey = append(tripleDESKey, ede2Key[:16]...) + tripleDESKey = append(tripleDESKey, ede2Key[:8]...) + + _, err := des.NewTripleDESCipher(tripleDESKey) + if err != nil { + panic(err) + } + + // See crypto/cipher for how to use a cipher.Block for encryption and + // decryption. +} diff --git a/src/crypto/dsa/dsa.go b/src/crypto/dsa/dsa.go new file mode 100644 index 0000000000000000000000000000000000000000..b7565a61b0293899a9fd8e722f6d66fafb3471eb --- /dev/null +++ b/src/crypto/dsa/dsa.go @@ -0,0 +1,278 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package dsa implements the Digital Signature Algorithm, as defined in FIPS 186-3. +package dsa + +import ( + "errors" + "io" + "math/big" +) + +// Parameters represents the domain parameters for a key. These parameters can +// be shared across many keys. The bit length of Q must be a multiple of 8. +type Parameters struct { + P, Q, G *big.Int +} + +// PublicKey represents a DSA public key. +type PublicKey struct { + Parameters + Y *big.Int +} + +// PrivateKey represents a DSA private key. +type PrivateKey struct { + PublicKey + X *big.Int +} + +// ErrInvalidPublicKey results when a public key is not usable by this code. +// FIPS is quite strict about the format of DSA keys, but other code may be +// less so. Thus, when using keys which may have been generated by other code, +// this error must be handled. +var ErrInvalidPublicKey = errors.New("crypto/dsa: invalid public key") + +// ParameterSizes is a enumeration of the acceptable bit lengths of the primes +// in a set of DSA parameters. See FIPS 186-3, section 4.2. +type ParameterSizes int + +const ( + L1024N160 ParameterSizes = iota + L2048N224 + L2048N256 + L3072N256 +) + +// numMRTests is the number of Miller-Rabin primality tests that we perform. We +// pick the largest recommended number from table C.1 of FIPS 186-3. +const numMRTests = 64 + +// GenerateParameters puts a random, valid set of DSA parameters into params. +// This function takes many seconds, even on fast machines. +func GenerateParameters(params *Parameters, rand io.Reader, sizes ParameterSizes) (err error) { + // This function doesn't follow FIPS 186-3 exactly in that it doesn't + // use a verification seed to generate the primes. The verification + // seed doesn't appear to be exported or used by other code and + // omitting it makes the code cleaner. + + var L, N int + switch sizes { + case L1024N160: + L = 1024 + N = 160 + case L2048N224: + L = 2048 + N = 224 + case L2048N256: + L = 2048 + N = 256 + case L3072N256: + L = 3072 + N = 256 + default: + return errors.New("crypto/dsa: invalid ParameterSizes") + } + + qBytes := make([]byte, N/8) + pBytes := make([]byte, L/8) + + q := new(big.Int) + p := new(big.Int) + rem := new(big.Int) + one := new(big.Int) + one.SetInt64(1) + +GeneratePrimes: + for { + _, err = io.ReadFull(rand, qBytes) + if err != nil { + return + } + + qBytes[len(qBytes)-1] |= 1 + qBytes[0] |= 0x80 + q.SetBytes(qBytes) + + if !q.ProbablyPrime(numMRTests) { + continue + } + + for i := 0; i < 4*L; i++ { + _, err = io.ReadFull(rand, pBytes) + if err != nil { + return + } + + pBytes[len(pBytes)-1] |= 1 + pBytes[0] |= 0x80 + + p.SetBytes(pBytes) + rem.Mod(p, q) + rem.Sub(rem, one) + p.Sub(p, rem) + if p.BitLen() < L { + continue + } + + if !p.ProbablyPrime(numMRTests) { + continue + } + + params.P = p + params.Q = q + break GeneratePrimes + } + } + + h := new(big.Int) + h.SetInt64(2) + g := new(big.Int) + + pm1 := new(big.Int).Sub(p, one) + e := new(big.Int).Div(pm1, q) + + for { + g.Exp(h, e, p) + if g.Cmp(one) == 0 { + h.Add(h, one) + continue + } + + params.G = g + return + } +} + +// GenerateKey generates a public&private key pair. The Parameters of the +// PrivateKey must already be valid (see GenerateParameters). +func GenerateKey(priv *PrivateKey, rand io.Reader) error { + if priv.P == nil || priv.Q == nil || priv.G == nil { + return errors.New("crypto/dsa: parameters not set up before generating key") + } + + x := new(big.Int) + xBytes := make([]byte, priv.Q.BitLen()/8) + + for { + _, err := io.ReadFull(rand, xBytes) + if err != nil { + return err + } + x.SetBytes(xBytes) + if x.Sign() != 0 && x.Cmp(priv.Q) < 0 { + break + } + } + + priv.X = x + priv.Y = new(big.Int) + priv.Y.Exp(priv.G, x, priv.P) + return nil +} + +// fermatInverse calculates the inverse of k in GF(P) using Fermat's method. +// This has better constant-time properties than Euclid's method (implemented +// in math/big.Int.ModInverse) although math/big itself isn't strictly +// constant-time so it's not perfect. +func fermatInverse(k, P *big.Int) *big.Int { + two := big.NewInt(2) + pMinus2 := new(big.Int).Sub(P, two) + return new(big.Int).Exp(k, pMinus2, P) +} + +// Sign signs an arbitrary length hash (which should be the result of hashing a +// larger message) using the private key, priv. It returns the signature as a +// pair of integers. The security of the private key depends on the entropy of +// rand. +// +// Note that FIPS 186-3 section 4.6 specifies that the hash should be truncated +// to the byte-length of the subgroup. This function does not perform that +// truncation itself. +func Sign(rand io.Reader, priv *PrivateKey, hash []byte) (r, s *big.Int, err error) { + // FIPS 186-3, section 4.6 + + n := priv.Q.BitLen() + if n&7 != 0 { + err = ErrInvalidPublicKey + return + } + n >>= 3 + + for { + k := new(big.Int) + buf := make([]byte, n) + for { + _, err = io.ReadFull(rand, buf) + if err != nil { + return + } + k.SetBytes(buf) + if k.Sign() > 0 && k.Cmp(priv.Q) < 0 { + break + } + } + + kInv := fermatInverse(k, priv.Q) + + r = new(big.Int).Exp(priv.G, k, priv.P) + r.Mod(r, priv.Q) + + if r.Sign() == 0 { + continue + } + + z := k.SetBytes(hash) + + s = new(big.Int).Mul(priv.X, r) + s.Add(s, z) + s.Mod(s, priv.Q) + s.Mul(s, kInv) + s.Mod(s, priv.Q) + + if s.Sign() != 0 { + break + } + } + + return +} + +// Verify verifies the signature in r, s of hash using the public key, pub. It +// reports whether the signature is valid. +// +// Note that FIPS 186-3 section 4.6 specifies that the hash should be truncated +// to the byte-length of the subgroup. This function does not perform that +// truncation itself. +func Verify(pub *PublicKey, hash []byte, r, s *big.Int) bool { + // FIPS 186-3, section 4.7 + + if r.Sign() < 1 || r.Cmp(pub.Q) >= 0 { + return false + } + if s.Sign() < 1 || s.Cmp(pub.Q) >= 0 { + return false + } + + w := new(big.Int).ModInverse(s, pub.Q) + + n := pub.Q.BitLen() + if n&7 != 0 { + return false + } + z := new(big.Int).SetBytes(hash) + + u1 := new(big.Int).Mul(z, w) + u1.Mod(u1, pub.Q) + u2 := w.Mul(r, w) + u2.Mod(u2, pub.Q) + v := u1.Exp(pub.G, u1, pub.P) + u2.Exp(pub.Y, u2, pub.P) + v.Mul(v, u2) + v.Mod(v, pub.P) + v.Mod(v, pub.Q) + + return v.Cmp(r) == 0 +} diff --git a/src/crypto/dsa/dsa_test.go b/src/crypto/dsa/dsa_test.go new file mode 100644 index 0000000000000000000000000000000000000000..568416d0dfb23377129b7db9d5081a4cb762e4ae --- /dev/null +++ b/src/crypto/dsa/dsa_test.go @@ -0,0 +1,85 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package dsa + +import ( + "crypto/rand" + "math/big" + "testing" +) + +func testSignAndVerify(t *testing.T, i int, priv *PrivateKey) { + hashed := []byte("testing") + r, s, err := Sign(rand.Reader, priv, hashed) + if err != nil { + t.Errorf("%d: error signing: %s", i, err) + return + } + + if !Verify(&priv.PublicKey, hashed, r, s) { + t.Errorf("%d: Verify failed", i) + } +} + +func testParameterGeneration(t *testing.T, sizes ParameterSizes, L, N int) { + var priv PrivateKey + params := &priv.Parameters + + err := GenerateParameters(params, rand.Reader, sizes) + if err != nil { + t.Errorf("%d: %s", int(sizes), err) + return + } + + if params.P.BitLen() != L { + t.Errorf("%d: params.BitLen got:%d want:%d", int(sizes), params.P.BitLen(), L) + } + + if params.Q.BitLen() != N { + t.Errorf("%d: q.BitLen got:%d want:%d", int(sizes), params.Q.BitLen(), L) + } + + one := new(big.Int) + one.SetInt64(1) + pm1 := new(big.Int).Sub(params.P, one) + quo, rem := new(big.Int).DivMod(pm1, params.Q, new(big.Int)) + if rem.Sign() != 0 { + t.Errorf("%d: p-1 mod q != 0", int(sizes)) + } + x := new(big.Int).Exp(params.G, quo, params.P) + if x.Cmp(one) == 0 { + t.Errorf("%d: invalid generator", int(sizes)) + } + + err = GenerateKey(&priv, rand.Reader) + if err != nil { + t.Errorf("error generating key: %s", err) + return + } + + testSignAndVerify(t, int(sizes), &priv) +} + +func TestParameterGeneration(t *testing.T) { + if testing.Short() { + t.Skip("skipping parameter generation test in short mode") + } + + testParameterGeneration(t, L1024N160, 1024, 160) + testParameterGeneration(t, L2048N224, 2048, 224) + testParameterGeneration(t, L2048N256, 2048, 256) + testParameterGeneration(t, L3072N256, 3072, 256) +} + +func TestSignAndVerify(t *testing.T) { + var priv PrivateKey + priv.P, _ = new(big.Int).SetString("A9B5B793FB4785793D246BAE77E8FF63CA52F442DA763C440259919FE1BC1D6065A9350637A04F75A2F039401D49F08E066C4D275A5A65DA5684BC563C14289D7AB8A67163BFBF79D85972619AD2CFF55AB0EE77A9002B0EF96293BDD0F42685EBB2C66C327079F6C98000FBCB79AACDE1BC6F9D5C7B1A97E3D9D54ED7951FEF", 16) + priv.Q, _ = new(big.Int).SetString("E1D3391245933D68A0714ED34BBCB7A1F422B9C1", 16) + priv.G, _ = new(big.Int).SetString("634364FC25248933D01D1993ECABD0657CC0CB2CEED7ED2E3E8AECDFCDC4A25C3B15E9E3B163ACA2984B5539181F3EFF1A5E8903D71D5B95DA4F27202B77D2C44B430BB53741A8D59A8F86887525C9F2A6A5980A195EAA7F2FF910064301DEF89D3AA213E1FAC7768D89365318E370AF54A112EFBA9246D9158386BA1B4EEFDA", 16) + priv.Y, _ = new(big.Int).SetString("32969E5780CFE1C849A1C276D7AEB4F38A23B591739AA2FE197349AEEBD31366AEE5EB7E6C6DDB7C57D02432B30DB5AA66D9884299FAA72568944E4EEDC92EA3FBC6F39F53412FBCC563208F7C15B737AC8910DBC2D9C9B8C001E72FDC40EB694AB1F06A5A2DBD18D9E36C66F31F566742F11EC0A52E9F7B89355C02FB5D32D2", 16) + priv.X, _ = new(big.Int).SetString("5078D4D29795CBE76D3AACFE48C9AF0BCDBEE91A", 16) + + testSignAndVerify(t, 0, &priv) +} diff --git a/src/crypto/ecdsa/ecdsa.go b/src/crypto/ecdsa/ecdsa.go new file mode 100644 index 0000000000000000000000000000000000000000..8d66477fd10d2871e0b4bc571383a683058db4fe --- /dev/null +++ b/src/crypto/ecdsa/ecdsa.go @@ -0,0 +1,246 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package ecdsa implements the Elliptic Curve Digital Signature Algorithm, as +// defined in FIPS 186-3. +// +// This implementation derives the nonce from an AES-CTR CSPRNG keyed by +// ChopMD(256, SHA2-512(priv.D || entropy || hash)). The CSPRNG key is IRO by +// a result of Coron; the AES-CTR stream is IRO under standard assumptions. +package ecdsa + +// References: +// [NSA]: Suite B implementer's guide to FIPS 186-3, +// http://www.nsa.gov/ia/_files/ecdsa.pdf +// [SECG]: SECG, SEC1 +// http://www.secg.org/sec1-v2.pdf + +import ( + "crypto" + "crypto/aes" + "crypto/cipher" + "crypto/elliptic" + "crypto/sha512" + "encoding/asn1" + "io" + "math/big" +) + +const ( + aesIV = "IV for ECDSA CTR" +) + +// PublicKey represents an ECDSA public key. +type PublicKey struct { + elliptic.Curve + X, Y *big.Int +} + +// PrivateKey represents a ECDSA private key. +type PrivateKey struct { + PublicKey + D *big.Int +} + +type ecdsaSignature struct { + R, S *big.Int +} + +// Public returns the public key corresponding to priv. +func (priv *PrivateKey) Public() crypto.PublicKey { + return &priv.PublicKey +} + +// Sign signs msg with priv, reading randomness from rand. This method is +// intended to support keys where the private part is kept in, for example, a +// hardware module. Common uses should use the Sign function in this package +// directly. +func (priv *PrivateKey) Sign(rand io.Reader, msg []byte, opts crypto.SignerOpts) ([]byte, error) { + r, s, err := Sign(rand, priv, msg) + if err != nil { + return nil, err + } + + return asn1.Marshal(ecdsaSignature{r, s}) +} + +var one = new(big.Int).SetInt64(1) + +// randFieldElement returns a random element of the field underlying the given +// curve using the procedure given in [NSA] A.2.1. +func randFieldElement(c elliptic.Curve, rand io.Reader) (k *big.Int, err error) { + params := c.Params() + b := make([]byte, params.BitSize/8+8) + _, err = io.ReadFull(rand, b) + if err != nil { + return + } + + k = new(big.Int).SetBytes(b) + n := new(big.Int).Sub(params.N, one) + k.Mod(k, n) + k.Add(k, one) + return +} + +// GenerateKey generates a public and private key pair. +func GenerateKey(c elliptic.Curve, rand io.Reader) (priv *PrivateKey, err error) { + k, err := randFieldElement(c, rand) + if err != nil { + return + } + + priv = new(PrivateKey) + priv.PublicKey.Curve = c + priv.D = k + priv.PublicKey.X, priv.PublicKey.Y = c.ScalarBaseMult(k.Bytes()) + return +} + +// hashToInt converts a hash value to an integer. There is some disagreement +// about how this is done. [NSA] suggests that this is done in the obvious +// manner, but [SECG] truncates the hash to the bit-length of the curve order +// first. We follow [SECG] because that's what OpenSSL does. Additionally, +// OpenSSL right shifts excess bits from the number if the hash is too large +// and we mirror that too. +func hashToInt(hash []byte, c elliptic.Curve) *big.Int { + orderBits := c.Params().N.BitLen() + orderBytes := (orderBits + 7) / 8 + if len(hash) > orderBytes { + hash = hash[:orderBytes] + } + + ret := new(big.Int).SetBytes(hash) + excess := len(hash)*8 - orderBits + if excess > 0 { + ret.Rsh(ret, uint(excess)) + } + return ret +} + +// fermatInverse calculates the inverse of k in GF(P) using Fermat's method. +// This has better constant-time properties than Euclid's method (implemented +// in math/big.Int.ModInverse) although math/big itself isn't strictly +// constant-time so it's not perfect. +func fermatInverse(k, N *big.Int) *big.Int { + two := big.NewInt(2) + nMinus2 := new(big.Int).Sub(N, two) + return new(big.Int).Exp(k, nMinus2, N) +} + +// Sign signs an arbitrary length hash (which should be the result of hashing a +// larger message) using the private key, priv. It returns the signature as a +// pair of integers. The security of the private key depends on the entropy of +// rand. +func Sign(rand io.Reader, priv *PrivateKey, hash []byte) (r, s *big.Int, err error) { + // Get max(log2(q) / 2, 256) bits of entropy from rand. + entropylen := (priv.Curve.Params().BitSize + 7) / 16 + if entropylen > 32 { + entropylen = 32 + } + entropy := make([]byte, entropylen) + _, err = io.ReadFull(rand, entropy) + if err != nil { + return + } + + // Initialize an SHA-512 hash context; digest ... + md := sha512.New() + md.Write(priv.D.Bytes()) // the private key, + md.Write(entropy) // the entropy, + md.Write(hash) // and the input hash; + key := md.Sum(nil)[:32] // and compute ChopMD-256(SHA-512), + // which is an indifferentiable MAC. + + // Create an AES-CTR instance to use as a CSPRNG. + block, err := aes.NewCipher(key) + if err != nil { + return nil, nil, err + } + + // Create a CSPRNG that xors a stream of zeros with + // the output of the AES-CTR instance. + csprng := cipher.StreamReader{ + R: zeroReader, + S: cipher.NewCTR(block, []byte(aesIV)), + } + + // See [NSA] 3.4.1 + c := priv.PublicKey.Curve + N := c.Params().N + + var k, kInv *big.Int + for { + for { + k, err = randFieldElement(c, csprng) + if err != nil { + r = nil + return + } + + kInv = fermatInverse(k, N) + r, _ = priv.Curve.ScalarBaseMult(k.Bytes()) + r.Mod(r, N) + if r.Sign() != 0 { + break + } + } + + e := hashToInt(hash, c) + s = new(big.Int).Mul(priv.D, r) + s.Add(s, e) + s.Mul(s, kInv) + s.Mod(s, N) + if s.Sign() != 0 { + break + } + } + + return +} + +// Verify verifies the signature in r, s of hash using the public key, pub. Its +// return value records whether the signature is valid. +func Verify(pub *PublicKey, hash []byte, r, s *big.Int) bool { + // See [NSA] 3.4.2 + c := pub.Curve + N := c.Params().N + + if r.Sign() == 0 || s.Sign() == 0 { + return false + } + if r.Cmp(N) >= 0 || s.Cmp(N) >= 0 { + return false + } + e := hashToInt(hash, c) + w := new(big.Int).ModInverse(s, N) + + u1 := e.Mul(e, w) + u1.Mod(u1, N) + u2 := w.Mul(r, w) + u2.Mod(u2, N) + + x1, y1 := c.ScalarBaseMult(u1.Bytes()) + x2, y2 := c.ScalarMult(pub.X, pub.Y, u2.Bytes()) + x, y := c.Add(x1, y1, x2, y2) + if x.Sign() == 0 && y.Sign() == 0 { + return false + } + x.Mod(x, N) + return x.Cmp(r) == 0 +} + +type zr struct { + io.Reader +} + +// Read replaces the contents of dst with zeros. +func (z *zr) Read(dst []byte) (n int, err error) { + for i := range dst { + dst[i] = 0 + } + return len(dst), nil +} + +var zeroReader = &zr{} diff --git a/src/crypto/ecdsa/ecdsa_test.go b/src/crypto/ecdsa/ecdsa_test.go new file mode 100644 index 0000000000000000000000000000000000000000..169944dfb27b2207cd1076aed95dc2a037a21328 --- /dev/null +++ b/src/crypto/ecdsa/ecdsa_test.go @@ -0,0 +1,263 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package ecdsa + +import ( + "bufio" + "compress/bzip2" + "crypto/elliptic" + "crypto/rand" + "crypto/sha1" + "crypto/sha256" + "crypto/sha512" + "encoding/hex" + "hash" + "io" + "math/big" + "os" + "strings" + "testing" +) + +func testKeyGeneration(t *testing.T, c elliptic.Curve, tag string) { + priv, err := GenerateKey(c, rand.Reader) + if err != nil { + t.Errorf("%s: error: %s", tag, err) + return + } + if !c.IsOnCurve(priv.PublicKey.X, priv.PublicKey.Y) { + t.Errorf("%s: public key invalid: %s", tag, err) + } +} + +func TestKeyGeneration(t *testing.T) { + testKeyGeneration(t, elliptic.P224(), "p224") + if testing.Short() { + return + } + testKeyGeneration(t, elliptic.P256(), "p256") + testKeyGeneration(t, elliptic.P384(), "p384") + testKeyGeneration(t, elliptic.P521(), "p521") +} + +func testSignAndVerify(t *testing.T, c elliptic.Curve, tag string) { + priv, _ := GenerateKey(c, rand.Reader) + + hashed := []byte("testing") + r, s, err := Sign(rand.Reader, priv, hashed) + if err != nil { + t.Errorf("%s: error signing: %s", tag, err) + return + } + + if !Verify(&priv.PublicKey, hashed, r, s) { + t.Errorf("%s: Verify failed", tag) + } + + hashed[0] ^= 0xff + if Verify(&priv.PublicKey, hashed, r, s) { + t.Errorf("%s: Verify always works!", tag) + } +} + +func TestSignAndVerify(t *testing.T) { + testSignAndVerify(t, elliptic.P224(), "p224") + if testing.Short() { + return + } + testSignAndVerify(t, elliptic.P256(), "p256") + testSignAndVerify(t, elliptic.P384(), "p384") + testSignAndVerify(t, elliptic.P521(), "p521") +} + +func testNonceSafety(t *testing.T, c elliptic.Curve, tag string) { + priv, _ := GenerateKey(c, rand.Reader) + + hashed := []byte("testing") + r0, s0, err := Sign(zeroReader, priv, hashed) + if err != nil { + t.Errorf("%s: error signing: %s", tag, err) + return + } + + hashed = []byte("testing...") + r1, s1, err := Sign(zeroReader, priv, hashed) + if err != nil { + t.Errorf("%s: error signing: %s", tag, err) + return + } + + if s0.Cmp(s1) == 0 { + // This should never happen. + t.Errorf("%s: the signatures on two different messages were the same") + } + + if r0.Cmp(r1) == 0 { + t.Errorf("%s: the nonce used for two diferent messages was the same") + } +} + +func TestNonceSafety(t *testing.T) { + testNonceSafety(t, elliptic.P224(), "p224") + if testing.Short() { + return + } + testNonceSafety(t, elliptic.P256(), "p256") + testNonceSafety(t, elliptic.P384(), "p384") + testNonceSafety(t, elliptic.P521(), "p521") +} + +func testINDCCA(t *testing.T, c elliptic.Curve, tag string) { + priv, _ := GenerateKey(c, rand.Reader) + + hashed := []byte("testing") + r0, s0, err := Sign(rand.Reader, priv, hashed) + if err != nil { + t.Errorf("%s: error signing: %s", tag, err) + return + } + + r1, s1, err := Sign(rand.Reader, priv, hashed) + if err != nil { + t.Errorf("%s: error signing: %s", tag, err) + return + } + + if s0.Cmp(s1) == 0 { + t.Errorf("%s: two signatures of the same message produced the same result") + } + + if r0.Cmp(r1) == 0 { + t.Errorf("%s: two signatures of the same message produced the same nonce") + } +} + +func TestINDCCA(t *testing.T) { + testINDCCA(t, elliptic.P224(), "p224") + if testing.Short() { + return + } + testINDCCA(t, elliptic.P256(), "p256") + testINDCCA(t, elliptic.P384(), "p384") + testINDCCA(t, elliptic.P521(), "p521") +} + +func fromHex(s string) *big.Int { + r, ok := new(big.Int).SetString(s, 16) + if !ok { + panic("bad hex") + } + return r +} + +func TestVectors(t *testing.T) { + // This test runs the full set of NIST test vectors from + // http://csrc.nist.gov/groups/STM/cavp/documents/dss/186-3ecdsatestvectors.zip + // + // The SigVer.rsp file has been edited to remove test vectors for + // unsupported algorithms and has been compressed. + + if testing.Short() { + return + } + + f, err := os.Open("testdata/SigVer.rsp.bz2") + if err != nil { + t.Fatal(err) + } + + buf := bufio.NewReader(bzip2.NewReader(f)) + + lineNo := 1 + var h hash.Hash + var msg []byte + var hashed []byte + var r, s *big.Int + pub := new(PublicKey) + + for { + line, err := buf.ReadString('\n') + if len(line) == 0 { + if err == io.EOF { + break + } + t.Fatalf("error reading from input: %s", err) + } + lineNo++ + // Need to remove \r\n from the end of the line. + if !strings.HasSuffix(line, "\r\n") { + t.Fatalf("bad line ending (expected \\r\\n) on line %d", lineNo) + } + line = line[:len(line)-2] + + if len(line) == 0 || line[0] == '#' { + continue + } + + if line[0] == '[' { + line = line[1 : len(line)-1] + parts := strings.SplitN(line, ",", 2) + + switch parts[0] { + case "P-224": + pub.Curve = elliptic.P224() + case "P-256": + pub.Curve = elliptic.P256() + case "P-384": + pub.Curve = elliptic.P384() + case "P-521": + pub.Curve = elliptic.P521() + default: + pub.Curve = nil + } + + switch parts[1] { + case "SHA-1": + h = sha1.New() + case "SHA-224": + h = sha256.New224() + case "SHA-256": + h = sha256.New() + case "SHA-384": + h = sha512.New384() + case "SHA-512": + h = sha512.New() + default: + h = nil + } + + continue + } + + if h == nil || pub.Curve == nil { + continue + } + + switch { + case strings.HasPrefix(line, "Msg = "): + if msg, err = hex.DecodeString(line[6:]); err != nil { + t.Fatalf("failed to decode message on line %d: %s", lineNo, err) + } + case strings.HasPrefix(line, "Qx = "): + pub.X = fromHex(line[5:]) + case strings.HasPrefix(line, "Qy = "): + pub.Y = fromHex(line[5:]) + case strings.HasPrefix(line, "R = "): + r = fromHex(line[4:]) + case strings.HasPrefix(line, "S = "): + s = fromHex(line[4:]) + case strings.HasPrefix(line, "Result = "): + expected := line[9] == 'P' + h.Reset() + h.Write(msg) + hashed := h.Sum(hashed[:0]) + if Verify(pub, hashed, r, s) != expected { + t.Fatalf("incorrect result on line %d", lineNo) + } + default: + t.Fatalf("unknown variable on line %d: %s", lineNo, line) + } + } +} diff --git a/src/crypto/ecdsa/testdata/SigVer.rsp.bz2 b/src/crypto/ecdsa/testdata/SigVer.rsp.bz2 new file mode 100644 index 0000000000000000000000000000000000000000..09fe2b4271aa2d31adaec27020d1a317ef44fe70 Binary files /dev/null and b/src/crypto/ecdsa/testdata/SigVer.rsp.bz2 differ diff --git a/src/crypto/elliptic/elliptic.go b/src/crypto/elliptic/elliptic.go new file mode 100644 index 0000000000000000000000000000000000000000..e6b59c5f436b9d24a8a61e093bd2adcc079e72ba --- /dev/null +++ b/src/crypto/elliptic/elliptic.go @@ -0,0 +1,378 @@ +// Copyright 2010 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package elliptic implements several standard elliptic curves over prime +// fields. +package elliptic + +// This package operates, internally, on Jacobian coordinates. For a given +// (x, y) position on the curve, the Jacobian coordinates are (x1, y1, z1) +// where x = x1/z1² and y = y1/z1³. The greatest speedups come when the whole +// calculation can be performed within the transform (as in ScalarMult and +// ScalarBaseMult). But even for Add and Double, it's faster to apply and +// reverse the transform than to operate in affine coordinates. + +import ( + "io" + "math/big" + "sync" +) + +// A Curve represents a short-form Weierstrass curve with a=-3. +// See http://www.hyperelliptic.org/EFD/g1p/auto-shortw.html +type Curve interface { + // Params returns the parameters for the curve. + Params() *CurveParams + // IsOnCurve reports whether the given (x,y) lies on the curve. + IsOnCurve(x, y *big.Int) bool + // Add returns the sum of (x1,y1) and (x2,y2) + Add(x1, y1, x2, y2 *big.Int) (x, y *big.Int) + // Double returns 2*(x,y) + Double(x1, y1 *big.Int) (x, y *big.Int) + // ScalarMult returns k*(Bx,By) where k is a number in big-endian form. + ScalarMult(x1, y1 *big.Int, k []byte) (x, y *big.Int) + // ScalarBaseMult returns k*G, where G is the base point of the group + // and k is an integer in big-endian form. + ScalarBaseMult(k []byte) (x, y *big.Int) +} + +// CurveParams contains the parameters of an elliptic curve and also provides +// a generic, non-constant time implementation of Curve. +type CurveParams struct { + P *big.Int // the order of the underlying field + N *big.Int // the order of the base point + B *big.Int // the constant of the curve equation + Gx, Gy *big.Int // (x,y) of the base point + BitSize int // the size of the underlying field + Name string // the canonical name of the curve +} + +func (curve *CurveParams) Params() *CurveParams { + return curve +} + +func (curve *CurveParams) IsOnCurve(x, y *big.Int) bool { + // y² = x³ - 3x + b + y2 := new(big.Int).Mul(y, y) + y2.Mod(y2, curve.P) + + x3 := new(big.Int).Mul(x, x) + x3.Mul(x3, x) + + threeX := new(big.Int).Lsh(x, 1) + threeX.Add(threeX, x) + + x3.Sub(x3, threeX) + x3.Add(x3, curve.B) + x3.Mod(x3, curve.P) + + return x3.Cmp(y2) == 0 +} + +// zForAffine returns a Jacobian Z value for the affine point (x, y). If x and +// y are zero, it assumes that they represent the point at infinity because (0, +// 0) is not on the any of the curves handled here. +func zForAffine(x, y *big.Int) *big.Int { + z := new(big.Int) + if x.Sign() != 0 || y.Sign() != 0 { + z.SetInt64(1) + } + return z +} + +// affineFromJacobian reverses the Jacobian transform. See the comment at the +// top of the file. If the point is ∞ it returns 0, 0. +func (curve *CurveParams) affineFromJacobian(x, y, z *big.Int) (xOut, yOut *big.Int) { + if z.Sign() == 0 { + return new(big.Int), new(big.Int) + } + + zinv := new(big.Int).ModInverse(z, curve.P) + zinvsq := new(big.Int).Mul(zinv, zinv) + + xOut = new(big.Int).Mul(x, zinvsq) + xOut.Mod(xOut, curve.P) + zinvsq.Mul(zinvsq, zinv) + yOut = new(big.Int).Mul(y, zinvsq) + yOut.Mod(yOut, curve.P) + return +} + +func (curve *CurveParams) Add(x1, y1, x2, y2 *big.Int) (*big.Int, *big.Int) { + z1 := zForAffine(x1, y1) + z2 := zForAffine(x2, y2) + return curve.affineFromJacobian(curve.addJacobian(x1, y1, z1, x2, y2, z2)) +} + +// addJacobian takes two points in Jacobian coordinates, (x1, y1, z1) and +// (x2, y2, z2) and returns their sum, also in Jacobian form. +func (curve *CurveParams) addJacobian(x1, y1, z1, x2, y2, z2 *big.Int) (*big.Int, *big.Int, *big.Int) { + // See http://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#addition-add-2007-bl + x3, y3, z3 := new(big.Int), new(big.Int), new(big.Int) + if z1.Sign() == 0 { + x3.Set(x2) + y3.Set(y2) + z3.Set(z2) + return x3, y3, z3 + } + if z2.Sign() == 0 { + x3.Set(x1) + y3.Set(y1) + z3.Set(z1) + return x3, y3, z3 + } + + z1z1 := new(big.Int).Mul(z1, z1) + z1z1.Mod(z1z1, curve.P) + z2z2 := new(big.Int).Mul(z2, z2) + z2z2.Mod(z2z2, curve.P) + + u1 := new(big.Int).Mul(x1, z2z2) + u1.Mod(u1, curve.P) + u2 := new(big.Int).Mul(x2, z1z1) + u2.Mod(u2, curve.P) + h := new(big.Int).Sub(u2, u1) + xEqual := h.Sign() == 0 + if h.Sign() == -1 { + h.Add(h, curve.P) + } + i := new(big.Int).Lsh(h, 1) + i.Mul(i, i) + j := new(big.Int).Mul(h, i) + + s1 := new(big.Int).Mul(y1, z2) + s1.Mul(s1, z2z2) + s1.Mod(s1, curve.P) + s2 := new(big.Int).Mul(y2, z1) + s2.Mul(s2, z1z1) + s2.Mod(s2, curve.P) + r := new(big.Int).Sub(s2, s1) + if r.Sign() == -1 { + r.Add(r, curve.P) + } + yEqual := r.Sign() == 0 + if xEqual && yEqual { + return curve.doubleJacobian(x1, y1, z1) + } + r.Lsh(r, 1) + v := new(big.Int).Mul(u1, i) + + x3.Set(r) + x3.Mul(x3, x3) + x3.Sub(x3, j) + x3.Sub(x3, v) + x3.Sub(x3, v) + x3.Mod(x3, curve.P) + + y3.Set(r) + v.Sub(v, x3) + y3.Mul(y3, v) + s1.Mul(s1, j) + s1.Lsh(s1, 1) + y3.Sub(y3, s1) + y3.Mod(y3, curve.P) + + z3.Add(z1, z2) + z3.Mul(z3, z3) + z3.Sub(z3, z1z1) + z3.Sub(z3, z2z2) + z3.Mul(z3, h) + z3.Mod(z3, curve.P) + + return x3, y3, z3 +} + +func (curve *CurveParams) Double(x1, y1 *big.Int) (*big.Int, *big.Int) { + z1 := zForAffine(x1, y1) + return curve.affineFromJacobian(curve.doubleJacobian(x1, y1, z1)) +} + +// doubleJacobian takes a point in Jacobian coordinates, (x, y, z), and +// returns its double, also in Jacobian form. +func (curve *CurveParams) doubleJacobian(x, y, z *big.Int) (*big.Int, *big.Int, *big.Int) { + // See http://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#doubling-dbl-2001-b + delta := new(big.Int).Mul(z, z) + delta.Mod(delta, curve.P) + gamma := new(big.Int).Mul(y, y) + gamma.Mod(gamma, curve.P) + alpha := new(big.Int).Sub(x, delta) + if alpha.Sign() == -1 { + alpha.Add(alpha, curve.P) + } + alpha2 := new(big.Int).Add(x, delta) + alpha.Mul(alpha, alpha2) + alpha2.Set(alpha) + alpha.Lsh(alpha, 1) + alpha.Add(alpha, alpha2) + + beta := alpha2.Mul(x, gamma) + + x3 := new(big.Int).Mul(alpha, alpha) + beta8 := new(big.Int).Lsh(beta, 3) + x3.Sub(x3, beta8) + for x3.Sign() == -1 { + x3.Add(x3, curve.P) + } + x3.Mod(x3, curve.P) + + z3 := new(big.Int).Add(y, z) + z3.Mul(z3, z3) + z3.Sub(z3, gamma) + if z3.Sign() == -1 { + z3.Add(z3, curve.P) + } + z3.Sub(z3, delta) + if z3.Sign() == -1 { + z3.Add(z3, curve.P) + } + z3.Mod(z3, curve.P) + + beta.Lsh(beta, 2) + beta.Sub(beta, x3) + if beta.Sign() == -1 { + beta.Add(beta, curve.P) + } + y3 := alpha.Mul(alpha, beta) + + gamma.Mul(gamma, gamma) + gamma.Lsh(gamma, 3) + gamma.Mod(gamma, curve.P) + + y3.Sub(y3, gamma) + if y3.Sign() == -1 { + y3.Add(y3, curve.P) + } + y3.Mod(y3, curve.P) + + return x3, y3, z3 +} + +func (curve *CurveParams) ScalarMult(Bx, By *big.Int, k []byte) (*big.Int, *big.Int) { + Bz := new(big.Int).SetInt64(1) + x, y, z := new(big.Int), new(big.Int), new(big.Int) + + for _, byte := range k { + for bitNum := 0; bitNum < 8; bitNum++ { + x, y, z = curve.doubleJacobian(x, y, z) + if byte&0x80 == 0x80 { + x, y, z = curve.addJacobian(Bx, By, Bz, x, y, z) + } + byte <<= 1 + } + } + + return curve.affineFromJacobian(x, y, z) +} + +func (curve *CurveParams) ScalarBaseMult(k []byte) (*big.Int, *big.Int) { + return curve.ScalarMult(curve.Gx, curve.Gy, k) +} + +var mask = []byte{0xff, 0x1, 0x3, 0x7, 0xf, 0x1f, 0x3f, 0x7f} + +// GenerateKey returns a public/private key pair. The private key is +// generated using the given reader, which must return random data. +func GenerateKey(curve Curve, rand io.Reader) (priv []byte, x, y *big.Int, err error) { + bitSize := curve.Params().BitSize + byteLen := (bitSize + 7) >> 3 + priv = make([]byte, byteLen) + + for x == nil { + _, err = io.ReadFull(rand, priv) + if err != nil { + return + } + // We have to mask off any excess bits in the case that the size of the + // underlying field is not a whole number of bytes. + priv[0] &= mask[bitSize%8] + // This is because, in tests, rand will return all zeros and we don't + // want to get the point at infinity and loop forever. + priv[1] ^= 0x42 + x, y = curve.ScalarBaseMult(priv) + } + return +} + +// Marshal converts a point into the form specified in section 4.3.6 of ANSI X9.62. +func Marshal(curve Curve, x, y *big.Int) []byte { + byteLen := (curve.Params().BitSize + 7) >> 3 + + ret := make([]byte, 1+2*byteLen) + ret[0] = 4 // uncompressed point + + xBytes := x.Bytes() + copy(ret[1+byteLen-len(xBytes):], xBytes) + yBytes := y.Bytes() + copy(ret[1+2*byteLen-len(yBytes):], yBytes) + return ret +} + +// Unmarshal converts a point, serialized by Marshal, into an x, y pair. +// It is an error if the point is not on the curve. On error, x = nil. +func Unmarshal(curve Curve, data []byte) (x, y *big.Int) { + byteLen := (curve.Params().BitSize + 7) >> 3 + if len(data) != 1+2*byteLen { + return + } + if data[0] != 4 { // uncompressed form + return + } + x = new(big.Int).SetBytes(data[1 : 1+byteLen]) + y = new(big.Int).SetBytes(data[1+byteLen:]) + if !curve.IsOnCurve(x, y) { + x, y = nil, nil + } + return +} + +var initonce sync.Once +var p384 *CurveParams +var p521 *CurveParams + +func initAll() { + initP224() + initP256() + initP384() + initP521() +} + +func initP384() { + // See FIPS 186-3, section D.2.4 + p384 = &CurveParams{Name: "P-384"} + p384.P, _ = new(big.Int).SetString("39402006196394479212279040100143613805079739270465446667948293404245721771496870329047266088258938001861606973112319", 10) + p384.N, _ = new(big.Int).SetString("39402006196394479212279040100143613805079739270465446667946905279627659399113263569398956308152294913554433653942643", 10) + p384.B, _ = new(big.Int).SetString("b3312fa7e23ee7e4988e056be3f82d19181d9c6efe8141120314088f5013875ac656398d8a2ed19d2a85c8edd3ec2aef", 16) + p384.Gx, _ = new(big.Int).SetString("aa87ca22be8b05378eb1c71ef320ad746e1d3b628ba79b9859f741e082542a385502f25dbf55296c3a545e3872760ab7", 16) + p384.Gy, _ = new(big.Int).SetString("3617de4a96262c6f5d9e98bf9292dc29f8f41dbd289a147ce9da3113b5f0b8c00a60b1ce1d7e819d7a431d7c90ea0e5f", 16) + p384.BitSize = 384 +} + +func initP521() { + // See FIPS 186-3, section D.2.5 + p521 = &CurveParams{Name: "P-521"} + p521.P, _ = new(big.Int).SetString("6864797660130609714981900799081393217269435300143305409394463459185543183397656052122559640661454554977296311391480858037121987999716643812574028291115057151", 10) + p521.N, _ = new(big.Int).SetString("6864797660130609714981900799081393217269435300143305409394463459185543183397655394245057746333217197532963996371363321113864768612440380340372808892707005449", 10) + p521.B, _ = new(big.Int).SetString("051953eb9618e1c9a1f929a21a0b68540eea2da725b99b315f3b8b489918ef109e156193951ec7e937b1652c0bd3bb1bf073573df883d2c34f1ef451fd46b503f00", 16) + p521.Gx, _ = new(big.Int).SetString("c6858e06b70404e9cd9e3ecb662395b4429c648139053fb521f828af606b4d3dbaa14b5e77efe75928fe1dc127a2ffa8de3348b3c1856a429bf97e7e31c2e5bd66", 16) + p521.Gy, _ = new(big.Int).SetString("11839296a789a3bc0045c8a5fb42c7d1bd998f54449579b446817afbd17273e662c97ee72995ef42640c550b9013fad0761353c7086a272c24088be94769fd16650", 16) + p521.BitSize = 521 +} + +// P256 returns a Curve which implements P-256 (see FIPS 186-3, section D.2.3) +func P256() Curve { + initonce.Do(initAll) + return p256 +} + +// P384 returns a Curve which implements P-384 (see FIPS 186-3, section D.2.4) +func P384() Curve { + initonce.Do(initAll) + return p384 +} + +// P521 returns a Curve which implements P-521 (see FIPS 186-3, section D.2.5) +func P521() Curve { + initonce.Do(initAll) + return p521 +} diff --git a/src/crypto/elliptic/elliptic_test.go b/src/crypto/elliptic/elliptic_test.go new file mode 100644 index 0000000000000000000000000000000000000000..7e27913dcd0505001411377f2f4fab3ebfb21d65 --- /dev/null +++ b/src/crypto/elliptic/elliptic_test.go @@ -0,0 +1,471 @@ +// Copyright 2010 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package elliptic + +import ( + "crypto/rand" + "encoding/hex" + "fmt" + "math/big" + "testing" +) + +func TestOnCurve(t *testing.T) { + p224 := P224() + if !p224.IsOnCurve(p224.Params().Gx, p224.Params().Gy) { + t.Errorf("FAIL") + } +} + +func TestOffCurve(t *testing.T) { + p224 := P224() + x, y := new(big.Int).SetInt64(1), new(big.Int).SetInt64(1) + if p224.IsOnCurve(x, y) { + t.Errorf("FAIL: point off curve is claimed to be on the curve") + } + b := Marshal(p224, x, y) + x1, y1 := Unmarshal(p224, b) + if x1 != nil || y1 != nil { + t.Errorf("FAIL: unmarshalling a point not on the curve succeeded") + } +} + +type baseMultTest struct { + k string + x, y string +} + +var p224BaseMultTests = []baseMultTest{ + { + "1", + "b70e0cbd6bb4bf7f321390b94a03c1d356c21122343280d6115c1d21", + "bd376388b5f723fb4c22dfe6cd4375a05a07476444d5819985007e34", + }, + { + "2", + "706a46dc76dcb76798e60e6d89474788d16dc18032d268fd1a704fa6", + "1c2b76a7bc25e7702a704fa986892849fca629487acf3709d2e4e8bb", + }, + { + "3", + "df1b1d66a551d0d31eff822558b9d2cc75c2180279fe0d08fd896d04", + "a3f7f03cadd0be444c0aa56830130ddf77d317344e1af3591981a925", + }, + { + "4", + "ae99feebb5d26945b54892092a8aee02912930fa41cd114e40447301", + "482580a0ec5bc47e88bc8c378632cd196cb3fa058a7114eb03054c9", + }, + { + "5", + "31c49ae75bce7807cdff22055d94ee9021fedbb5ab51c57526f011aa", + "27e8bff1745635ec5ba0c9f1c2ede15414c6507d29ffe37e790a079b", + }, + { + "6", + "1f2483f82572251fca975fea40db821df8ad82a3c002ee6c57112408", + "89faf0ccb750d99b553c574fad7ecfb0438586eb3952af5b4b153c7e", + }, + { + "7", + "db2f6be630e246a5cf7d99b85194b123d487e2d466b94b24a03c3e28", + "f3a30085497f2f611ee2517b163ef8c53b715d18bb4e4808d02b963", + }, + { + "8", + "858e6f9cc6c12c31f5df124aa77767b05c8bc021bd683d2b55571550", + "46dcd3ea5c43898c5c5fc4fdac7db39c2f02ebee4e3541d1e78047a", + }, + { + "9", + "2fdcccfee720a77ef6cb3bfbb447f9383117e3daa4a07e36ed15f78d", + "371732e4f41bf4f7883035e6a79fcedc0e196eb07b48171697517463", + }, + { + "10", + "aea9e17a306517eb89152aa7096d2c381ec813c51aa880e7bee2c0fd", + "39bb30eab337e0a521b6cba1abe4b2b3a3e524c14a3fe3eb116b655f", + }, + { + "11", + "ef53b6294aca431f0f3c22dc82eb9050324f1d88d377e716448e507c", + "20b510004092e96636cfb7e32efded8265c266dfb754fa6d6491a6da", + }, + { + "12", + "6e31ee1dc137f81b056752e4deab1443a481033e9b4c93a3044f4f7a", + "207dddf0385bfdeab6e9acda8da06b3bbef224a93ab1e9e036109d13", + }, + { + "13", + "34e8e17a430e43289793c383fac9774247b40e9ebd3366981fcfaeca", + "252819f71c7fb7fbcb159be337d37d3336d7feb963724fdfb0ecb767", + }, + { + "14", + "a53640c83dc208603ded83e4ecf758f24c357d7cf48088b2ce01e9fa", + "d5814cd724199c4a5b974a43685fbf5b8bac69459c9469bc8f23ccaf", + }, + { + "15", + "baa4d8635511a7d288aebeedd12ce529ff102c91f97f867e21916bf9", + "979a5f4759f80f4fb4ec2e34f5566d595680a11735e7b61046127989", + }, + { + "16", + "b6ec4fe1777382404ef679997ba8d1cc5cd8e85349259f590c4c66d", + "3399d464345906b11b00e363ef429221f2ec720d2f665d7dead5b482", + }, + { + "17", + "b8357c3a6ceef288310e17b8bfeff9200846ca8c1942497c484403bc", + "ff149efa6606a6bd20ef7d1b06bd92f6904639dce5174db6cc554a26", + }, + { + "18", + "c9ff61b040874c0568479216824a15eab1a838a797d189746226e4cc", + "ea98d60e5ffc9b8fcf999fab1df7e7ef7084f20ddb61bb045a6ce002", + }, + { + "19", + "a1e81c04f30ce201c7c9ace785ed44cc33b455a022f2acdbc6cae83c", + "dcf1f6c3db09c70acc25391d492fe25b4a180babd6cea356c04719cd", + }, + { + "20", + "fcc7f2b45df1cd5a3c0c0731ca47a8af75cfb0347e8354eefe782455", + "d5d7110274cba7cdee90e1a8b0d394c376a5573db6be0bf2747f530", + }, + { + "112233445566778899", + "61f077c6f62ed802dad7c2f38f5c67f2cc453601e61bd076bb46179e", + "2272f9e9f5933e70388ee652513443b5e289dd135dcc0d0299b225e4", + }, + { + "112233445566778899112233445566778899", + "29895f0af496bfc62b6ef8d8a65c88c613949b03668aab4f0429e35", + "3ea6e53f9a841f2019ec24bde1a75677aa9b5902e61081c01064de93", + }, + { + "6950511619965839450988900688150712778015737983940691968051900319680", + "ab689930bcae4a4aa5f5cb085e823e8ae30fd365eb1da4aba9cf0379", + "3345a121bbd233548af0d210654eb40bab788a03666419be6fbd34e7", + }, + { + "13479972933410060327035789020509431695094902435494295338570602119423", + "bdb6a8817c1f89da1c2f3dd8e97feb4494f2ed302a4ce2bc7f5f4025", + "4c7020d57c00411889462d77a5438bb4e97d177700bf7243a07f1680", + }, + { + "13479971751745682581351455311314208093898607229429740618390390702079", + "d58b61aa41c32dd5eba462647dba75c5d67c83606c0af2bd928446a9", + "d24ba6a837be0460dd107ae77725696d211446c5609b4595976b16bd", + }, + { + "13479972931865328106486971546324465392952975980343228160962702868479", + "dc9fa77978a005510980e929a1485f63716df695d7a0c18bb518df03", + "ede2b016f2ddffc2a8c015b134928275ce09e5661b7ab14ce0d1d403", + }, + { + "11795773708834916026404142434151065506931607341523388140225443265536", + "499d8b2829cfb879c901f7d85d357045edab55028824d0f05ba279ba", + "bf929537b06e4015919639d94f57838fa33fc3d952598dcdbb44d638", + }, + { + "784254593043826236572847595991346435467177662189391577090", + "8246c999137186632c5f9eddf3b1b0e1764c5e8bd0e0d8a554b9cb77", + "e80ed8660bc1cb17ac7d845be40a7a022d3306f116ae9f81fea65947", + }, + { + "13479767645505654746623887797783387853576174193480695826442858012671", + "6670c20afcceaea672c97f75e2e9dd5c8460e54bb38538ebb4bd30eb", + "f280d8008d07a4caf54271f993527d46ff3ff46fd1190a3f1faa4f74", + }, + { + "205688069665150753842126177372015544874550518966168735589597183", + "eca934247425cfd949b795cb5ce1eff401550386e28d1a4c5a8eb", + "d4c01040dba19628931bc8855370317c722cbd9ca6156985f1c2e9ce", + }, + { + "13479966930919337728895168462090683249159702977113823384618282123295", + "ef353bf5c73cd551b96d596fbc9a67f16d61dd9fe56af19de1fba9cd", + "21771b9cdce3e8430c09b3838be70b48c21e15bc09ee1f2d7945b91f", + }, + { + "50210731791415612487756441341851895584393717453129007497216", + "4036052a3091eb481046ad3289c95d3ac905ca0023de2c03ecd451cf", + "d768165a38a2b96f812586a9d59d4136035d9c853a5bf2e1c86a4993", + }, + { + "26959946667150639794667015087019625940457807714424391721682722368041", + "fcc7f2b45df1cd5a3c0c0731ca47a8af75cfb0347e8354eefe782455", + "f2a28eefd8b345832116f1e574f2c6b2c895aa8c24941f40d8b80ad1", + }, + { + "26959946667150639794667015087019625940457807714424391721682722368042", + "a1e81c04f30ce201c7c9ace785ed44cc33b455a022f2acdbc6cae83c", + "230e093c24f638f533dac6e2b6d01da3b5e7f45429315ca93fb8e634", + }, + { + "26959946667150639794667015087019625940457807714424391721682722368043", + "c9ff61b040874c0568479216824a15eab1a838a797d189746226e4cc", + "156729f1a003647030666054e208180f8f7b0df2249e44fba5931fff", + }, + { + "26959946667150639794667015087019625940457807714424391721682722368044", + "b8357c3a6ceef288310e17b8bfeff9200846ca8c1942497c484403bc", + "eb610599f95942df1082e4f9426d086fb9c6231ae8b24933aab5db", + }, + { + "26959946667150639794667015087019625940457807714424391721682722368045", + "b6ec4fe1777382404ef679997ba8d1cc5cd8e85349259f590c4c66d", + "cc662b9bcba6f94ee4ff1c9c10bd6ddd0d138df2d099a282152a4b7f", + }, + { + "26959946667150639794667015087019625940457807714424391721682722368046", + "baa4d8635511a7d288aebeedd12ce529ff102c91f97f867e21916bf9", + "6865a0b8a607f0b04b13d1cb0aa992a5a97f5ee8ca1849efb9ed8678", + }, + { + "26959946667150639794667015087019625940457807714424391721682722368047", + "a53640c83dc208603ded83e4ecf758f24c357d7cf48088b2ce01e9fa", + "2a7eb328dbe663b5a468b5bc97a040a3745396ba636b964370dc3352", + }, + { + "26959946667150639794667015087019625940457807714424391721682722368048", + "34e8e17a430e43289793c383fac9774247b40e9ebd3366981fcfaeca", + "dad7e608e380480434ea641cc82c82cbc92801469c8db0204f13489a", + }, + { + "26959946667150639794667015087019625940457807714424391721682722368049", + "6e31ee1dc137f81b056752e4deab1443a481033e9b4c93a3044f4f7a", + "df82220fc7a4021549165325725f94c3410ddb56c54e161fc9ef62ee", + }, + { + "26959946667150639794667015087019625940457807714424391721682722368050", + "ef53b6294aca431f0f3c22dc82eb9050324f1d88d377e716448e507c", + "df4aefffbf6d1699c930481cd102127c9a3d992048ab05929b6e5927", + }, + { + "26959946667150639794667015087019625940457807714424391721682722368051", + "aea9e17a306517eb89152aa7096d2c381ec813c51aa880e7bee2c0fd", + "c644cf154cc81f5ade49345e541b4d4b5c1adb3eb5c01c14ee949aa2", + }, + { + "26959946667150639794667015087019625940457807714424391721682722368052", + "2fdcccfee720a77ef6cb3bfbb447f9383117e3daa4a07e36ed15f78d", + "c8e8cd1b0be40b0877cfca1958603122f1e6914f84b7e8e968ae8b9e", + }, + { + "26959946667150639794667015087019625940457807714424391721682722368053", + "858e6f9cc6c12c31f5df124aa77767b05c8bc021bd683d2b55571550", + "fb9232c15a3bc7673a3a03b0253824c53d0fd1411b1cabe2e187fb87", + }, + { + "26959946667150639794667015087019625940457807714424391721682722368054", + "db2f6be630e246a5cf7d99b85194b123d487e2d466b94b24a03c3e28", + "f0c5cff7ab680d09ee11dae84e9c1072ac48ea2e744b1b7f72fd469e", + }, + { + "26959946667150639794667015087019625940457807714424391721682722368055", + "1f2483f82572251fca975fea40db821df8ad82a3c002ee6c57112408", + "76050f3348af2664aac3a8b05281304ebc7a7914c6ad50a4b4eac383", + }, + { + "26959946667150639794667015087019625940457807714424391721682722368056", + "31c49ae75bce7807cdff22055d94ee9021fedbb5ab51c57526f011aa", + "d817400e8ba9ca13a45f360e3d121eaaeb39af82d6001c8186f5f866", + }, + { + "26959946667150639794667015087019625940457807714424391721682722368057", + "ae99feebb5d26945b54892092a8aee02912930fa41cd114e40447301", + "fb7da7f5f13a43b81774373c879cd32d6934c05fa758eeb14fcfab38", + }, + { + "26959946667150639794667015087019625940457807714424391721682722368058", + "df1b1d66a551d0d31eff822558b9d2cc75c2180279fe0d08fd896d04", + "5c080fc3522f41bbb3f55a97cfecf21f882ce8cbb1e50ca6e67e56dc", + }, + { + "26959946667150639794667015087019625940457807714424391721682722368059", + "706a46dc76dcb76798e60e6d89474788d16dc18032d268fd1a704fa6", + "e3d4895843da188fd58fb0567976d7b50359d6b78530c8f62d1b1746", + }, + { + "26959946667150639794667015087019625940457807714424391721682722368060", + "b70e0cbd6bb4bf7f321390b94a03c1d356c21122343280d6115c1d21", + "42c89c774a08dc04b3dd201932bc8a5ea5f8b89bbb2a7e667aff81cd", + }, +} + +func TestBaseMult(t *testing.T) { + p224 := P224() + for i, e := range p224BaseMultTests { + k, ok := new(big.Int).SetString(e.k, 10) + if !ok { + t.Errorf("%d: bad value for k: %s", i, e.k) + } + x, y := p224.ScalarBaseMult(k.Bytes()) + if fmt.Sprintf("%x", x) != e.x || fmt.Sprintf("%x", y) != e.y { + t.Errorf("%d: bad output for k=%s: got (%x, %x), want (%s, %s)", i, e.k, x, y, e.x, e.y) + } + if testing.Short() && i > 5 { + break + } + } +} + +func TestGenericBaseMult(t *testing.T) { + // We use the P224 CurveParams directly in order to test the generic implementation. + p224 := P224().Params() + for i, e := range p224BaseMultTests { + k, ok := new(big.Int).SetString(e.k, 10) + if !ok { + t.Errorf("%d: bad value for k: %s", i, e.k) + } + x, y := p224.ScalarBaseMult(k.Bytes()) + if fmt.Sprintf("%x", x) != e.x || fmt.Sprintf("%x", y) != e.y { + t.Errorf("%d: bad output for k=%s: got (%x, %x), want (%s, %s)", i, e.k, x, y, e.x, e.y) + } + if testing.Short() && i > 5 { + break + } + } +} + +func TestP256BaseMult(t *testing.T) { + p256 := P256() + p256Generic := p256.Params() + + scalars := make([]*big.Int, 0, len(p224BaseMultTests)+1) + for _, e := range p224BaseMultTests { + k, _ := new(big.Int).SetString(e.k, 10) + scalars = append(scalars, k) + } + k := new(big.Int).SetInt64(1) + k.Lsh(k, 500) + scalars = append(scalars, k) + + for i, k := range scalars { + x, y := p256.ScalarBaseMult(k.Bytes()) + x2, y2 := p256Generic.ScalarBaseMult(k.Bytes()) + if x.Cmp(x2) != 0 || y.Cmp(y2) != 0 { + t.Errorf("#%d: got (%x, %x), want (%x, %x)", i, x, y, x2, y2) + } + + if testing.Short() && i > 5 { + break + } + } +} + +func TestP256Mult(t *testing.T) { + p256 := P256() + p256Generic := p256.Params() + + for i, e := range p224BaseMultTests { + x, _ := new(big.Int).SetString(e.x, 16) + y, _ := new(big.Int).SetString(e.y, 16) + k, _ := new(big.Int).SetString(e.k, 10) + + xx, yy := p256.ScalarMult(x, y, k.Bytes()) + xx2, yy2 := p256Generic.ScalarMult(x, y, k.Bytes()) + if xx.Cmp(xx2) != 0 || yy.Cmp(yy2) != 0 { + t.Errorf("#%d: got (%x, %x), want (%x, %x)", i, xx, yy, xx2, yy2) + } + if testing.Short() && i > 5 { + break + } + } +} + +func TestInfinity(t *testing.T) { + tests := []struct { + name string + curve Curve + }{ + {"p224", P224()}, + {"p256", P256()}, + } + + for _, test := range tests { + curve := test.curve + x, y := curve.ScalarBaseMult(nil) + if x.Sign() != 0 || y.Sign() != 0 { + t.Errorf("%s: x^0 != ∞", test.name) + } + x.SetInt64(0) + y.SetInt64(0) + + x2, y2 := curve.Double(x, y) + if x2.Sign() != 0 || y2.Sign() != 0 { + t.Errorf("%s: 2∞ != ∞", test.name) + } + + baseX := curve.Params().Gx + baseY := curve.Params().Gy + + x3, y3 := curve.Add(baseX, baseY, x, y) + if x3.Cmp(baseX) != 0 || y3.Cmp(baseY) != 0 { + t.Errorf("%s: x+∞ != x", test.name) + } + + x4, y4 := curve.Add(x, y, baseX, baseY) + if x4.Cmp(baseX) != 0 || y4.Cmp(baseY) != 0 { + t.Errorf("%s: ∞+x != x", test.name) + } + } +} + +func BenchmarkBaseMult(b *testing.B) { + b.ResetTimer() + p224 := P224() + e := p224BaseMultTests[25] + k, _ := new(big.Int).SetString(e.k, 10) + b.StartTimer() + for i := 0; i < b.N; i++ { + p224.ScalarBaseMult(k.Bytes()) + } +} + +func BenchmarkBaseMultP256(b *testing.B) { + b.ResetTimer() + p256 := P256() + e := p224BaseMultTests[25] + k, _ := new(big.Int).SetString(e.k, 10) + b.StartTimer() + for i := 0; i < b.N; i++ { + p256.ScalarBaseMult(k.Bytes()) + } +} + +func TestMarshal(t *testing.T) { + p224 := P224() + _, x, y, err := GenerateKey(p224, rand.Reader) + if err != nil { + t.Error(err) + return + } + serialized := Marshal(p224, x, y) + xx, yy := Unmarshal(p224, serialized) + if xx == nil { + t.Error("failed to unmarshal") + return + } + if xx.Cmp(x) != 0 || yy.Cmp(y) != 0 { + t.Error("unmarshal returned different values") + return + } +} + +func TestP224Overflow(t *testing.T) { + // This tests for a specific bug in the P224 implementation. + p224 := P224() + pointData, _ := hex.DecodeString("049B535B45FB0A2072398A6831834624C7E32CCFD5A4B933BCEAF77F1DD945E08BBE5178F5EDF5E733388F196D2A631D2E075BB16CBFEEA15B") + x, y := Unmarshal(p224, pointData) + if !p224.IsOnCurve(x, y) { + t.Error("P224 failed to validate a correct point") + } +} diff --git a/src/crypto/elliptic/p224.go b/src/crypto/elliptic/p224.go new file mode 100644 index 0000000000000000000000000000000000000000..2d3fac74fbfa4bd019ae6a0997ad79354037aa17 --- /dev/null +++ b/src/crypto/elliptic/p224.go @@ -0,0 +1,765 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package elliptic + +// This is a constant-time, 32-bit implementation of P224. See FIPS 186-3, +// section D.2.2. +// +// See http://www.imperialviolet.org/2010/12/04/ecc.html ([1]) for background. + +import ( + "math/big" +) + +var p224 p224Curve + +type p224Curve struct { + *CurveParams + gx, gy, b p224FieldElement +} + +func initP224() { + // See FIPS 186-3, section D.2.2 + p224.CurveParams = &CurveParams{Name: "P-224"} + p224.P, _ = new(big.Int).SetString("26959946667150639794667015087019630673557916260026308143510066298881", 10) + p224.N, _ = new(big.Int).SetString("26959946667150639794667015087019625940457807714424391721682722368061", 10) + p224.B, _ = new(big.Int).SetString("b4050a850c04b3abf54132565044b0b7d7bfd8ba270b39432355ffb4", 16) + p224.Gx, _ = new(big.Int).SetString("b70e0cbd6bb4bf7f321390b94a03c1d356c21122343280d6115c1d21", 16) + p224.Gy, _ = new(big.Int).SetString("bd376388b5f723fb4c22dfe6cd4375a05a07476444d5819985007e34", 16) + p224.BitSize = 224 + + p224FromBig(&p224.gx, p224.Gx) + p224FromBig(&p224.gy, p224.Gy) + p224FromBig(&p224.b, p224.B) +} + +// P224 returns a Curve which implements P-224 (see FIPS 186-3, section D.2.2) +func P224() Curve { + initonce.Do(initAll) + return p224 +} + +func (curve p224Curve) Params() *CurveParams { + return curve.CurveParams +} + +func (curve p224Curve) IsOnCurve(bigX, bigY *big.Int) bool { + var x, y p224FieldElement + p224FromBig(&x, bigX) + p224FromBig(&y, bigY) + + // y² = x³ - 3x + b + var tmp p224LargeFieldElement + var x3 p224FieldElement + p224Square(&x3, &x, &tmp) + p224Mul(&x3, &x3, &x, &tmp) + + for i := 0; i < 8; i++ { + x[i] *= 3 + } + p224Sub(&x3, &x3, &x) + p224Reduce(&x3) + p224Add(&x3, &x3, &curve.b) + p224Contract(&x3, &x3) + + p224Square(&y, &y, &tmp) + p224Contract(&y, &y) + + for i := 0; i < 8; i++ { + if y[i] != x3[i] { + return false + } + } + return true +} + +func (p224Curve) Add(bigX1, bigY1, bigX2, bigY2 *big.Int) (x, y *big.Int) { + var x1, y1, z1, x2, y2, z2, x3, y3, z3 p224FieldElement + + p224FromBig(&x1, bigX1) + p224FromBig(&y1, bigY1) + if bigX1.Sign() != 0 || bigY1.Sign() != 0 { + z1[0] = 1 + } + p224FromBig(&x2, bigX2) + p224FromBig(&y2, bigY2) + if bigX2.Sign() != 0 || bigY2.Sign() != 0 { + z2[0] = 1 + } + + p224AddJacobian(&x3, &y3, &z3, &x1, &y1, &z1, &x2, &y2, &z2) + return p224ToAffine(&x3, &y3, &z3) +} + +func (p224Curve) Double(bigX1, bigY1 *big.Int) (x, y *big.Int) { + var x1, y1, z1, x2, y2, z2 p224FieldElement + + p224FromBig(&x1, bigX1) + p224FromBig(&y1, bigY1) + z1[0] = 1 + + p224DoubleJacobian(&x2, &y2, &z2, &x1, &y1, &z1) + return p224ToAffine(&x2, &y2, &z2) +} + +func (p224Curve) ScalarMult(bigX1, bigY1 *big.Int, scalar []byte) (x, y *big.Int) { + var x1, y1, z1, x2, y2, z2 p224FieldElement + + p224FromBig(&x1, bigX1) + p224FromBig(&y1, bigY1) + z1[0] = 1 + + p224ScalarMult(&x2, &y2, &z2, &x1, &y1, &z1, scalar) + return p224ToAffine(&x2, &y2, &z2) +} + +func (curve p224Curve) ScalarBaseMult(scalar []byte) (x, y *big.Int) { + var z1, x2, y2, z2 p224FieldElement + + z1[0] = 1 + p224ScalarMult(&x2, &y2, &z2, &curve.gx, &curve.gy, &z1, scalar) + return p224ToAffine(&x2, &y2, &z2) +} + +// Field element functions. +// +// The field that we're dealing with is ℤ/pℤ where p = 2**224 - 2**96 + 1. +// +// Field elements are represented by a FieldElement, which is a typedef to an +// array of 8 uint32's. The value of a FieldElement, a, is: +// a[0] + 2**28·a[1] + 2**56·a[1] + ... + 2**196·a[7] +// +// Using 28-bit limbs means that there's only 4 bits of headroom, which is less +// than we would really like. But it has the useful feature that we hit 2**224 +// exactly, making the reflections during a reduce much nicer. +type p224FieldElement [8]uint32 + +// p224P is the order of the field, represented as a p224FieldElement. +var p224P = [8]uint32{1, 0, 0, 0xffff000, 0xfffffff, 0xfffffff, 0xfffffff, 0xfffffff} + +// p224IsZero returns 1 if a == 0 mod p and 0 otherwise. +// +// a[i] < 2**29 +func p224IsZero(a *p224FieldElement) uint32 { + // Since a p224FieldElement contains 224 bits there are two possible + // representations of 0: 0 and p. + var minimal p224FieldElement + p224Contract(&minimal, a) + + var isZero, isP uint32 + for i, v := range minimal { + isZero |= v + isP |= v - p224P[i] + } + + // If either isZero or isP is 0, then we should return 1. + isZero |= isZero >> 16 + isZero |= isZero >> 8 + isZero |= isZero >> 4 + isZero |= isZero >> 2 + isZero |= isZero >> 1 + + isP |= isP >> 16 + isP |= isP >> 8 + isP |= isP >> 4 + isP |= isP >> 2 + isP |= isP >> 1 + + // For isZero and isP, the LSB is 0 iff all the bits are zero. + result := isZero & isP + result = (^result) & 1 + + return result +} + +// p224Add computes *out = a+b +// +// a[i] + b[i] < 2**32 +func p224Add(out, a, b *p224FieldElement) { + for i := 0; i < 8; i++ { + out[i] = a[i] + b[i] + } +} + +const two31p3 = 1<<31 + 1<<3 +const two31m3 = 1<<31 - 1<<3 +const two31m15m3 = 1<<31 - 1<<15 - 1<<3 + +// p224ZeroModP31 is 0 mod p where bit 31 is set in all limbs so that we can +// subtract smaller amounts without underflow. See the section "Subtraction" in +// [1] for reasoning. +var p224ZeroModP31 = []uint32{two31p3, two31m3, two31m3, two31m15m3, two31m3, two31m3, two31m3, two31m3} + +// p224Sub computes *out = a-b +// +// a[i], b[i] < 2**30 +// out[i] < 2**32 +func p224Sub(out, a, b *p224FieldElement) { + for i := 0; i < 8; i++ { + out[i] = a[i] + p224ZeroModP31[i] - b[i] + } +} + +// LargeFieldElement also represents an element of the field. The limbs are +// still spaced 28-bits apart and in little-endian order. So the limbs are at +// 0, 28, 56, ..., 392 bits, each 64-bits wide. +type p224LargeFieldElement [15]uint64 + +const two63p35 = 1<<63 + 1<<35 +const two63m35 = 1<<63 - 1<<35 +const two63m35m19 = 1<<63 - 1<<35 - 1<<19 + +// p224ZeroModP63 is 0 mod p where bit 63 is set in all limbs. See the section +// "Subtraction" in [1] for why. +var p224ZeroModP63 = [8]uint64{two63p35, two63m35, two63m35, two63m35, two63m35m19, two63m35, two63m35, two63m35} + +const bottom12Bits = 0xfff +const bottom28Bits = 0xfffffff + +// p224Mul computes *out = a*b +// +// a[i] < 2**29, b[i] < 2**30 (or vice versa) +// out[i] < 2**29 +func p224Mul(out, a, b *p224FieldElement, tmp *p224LargeFieldElement) { + for i := 0; i < 15; i++ { + tmp[i] = 0 + } + + for i := 0; i < 8; i++ { + for j := 0; j < 8; j++ { + tmp[i+j] += uint64(a[i]) * uint64(b[j]) + } + } + + p224ReduceLarge(out, tmp) +} + +// Square computes *out = a*a +// +// a[i] < 2**29 +// out[i] < 2**29 +func p224Square(out, a *p224FieldElement, tmp *p224LargeFieldElement) { + for i := 0; i < 15; i++ { + tmp[i] = 0 + } + + for i := 0; i < 8; i++ { + for j := 0; j <= i; j++ { + r := uint64(a[i]) * uint64(a[j]) + if i == j { + tmp[i+j] += r + } else { + tmp[i+j] += r << 1 + } + } + } + + p224ReduceLarge(out, tmp) +} + +// ReduceLarge converts a p224LargeFieldElement to a p224FieldElement. +// +// in[i] < 2**62 +func p224ReduceLarge(out *p224FieldElement, in *p224LargeFieldElement) { + for i := 0; i < 8; i++ { + in[i] += p224ZeroModP63[i] + } + + // Eliminate the coefficients at 2**224 and greater. + for i := 14; i >= 8; i-- { + in[i-8] -= in[i] + in[i-5] += (in[i] & 0xffff) << 12 + in[i-4] += in[i] >> 16 + } + in[8] = 0 + // in[0..8] < 2**64 + + // As the values become small enough, we start to store them in |out| + // and use 32-bit operations. + for i := 1; i < 8; i++ { + in[i+1] += in[i] >> 28 + out[i] = uint32(in[i] & bottom28Bits) + } + in[0] -= in[8] + out[3] += uint32(in[8]&0xffff) << 12 + out[4] += uint32(in[8] >> 16) + // in[0] < 2**64 + // out[3] < 2**29 + // out[4] < 2**29 + // out[1,2,5..7] < 2**28 + + out[0] = uint32(in[0] & bottom28Bits) + out[1] += uint32((in[0] >> 28) & bottom28Bits) + out[2] += uint32(in[0] >> 56) + // out[0] < 2**28 + // out[1..4] < 2**29 + // out[5..7] < 2**28 +} + +// Reduce reduces the coefficients of a to smaller bounds. +// +// On entry: a[i] < 2**31 + 2**30 +// On exit: a[i] < 2**29 +func p224Reduce(a *p224FieldElement) { + for i := 0; i < 7; i++ { + a[i+1] += a[i] >> 28 + a[i] &= bottom28Bits + } + top := a[7] >> 28 + a[7] &= bottom28Bits + + // top < 2**4 + mask := top + mask |= mask >> 2 + mask |= mask >> 1 + mask <<= 31 + mask = uint32(int32(mask) >> 31) + // Mask is all ones if top != 0, all zero otherwise + + a[0] -= top + a[3] += top << 12 + + // We may have just made a[0] negative but, if we did, then we must + // have added something to a[3], this it's > 2**12. Therefore we can + // carry down to a[0]. + a[3] -= 1 & mask + a[2] += mask & (1<<28 - 1) + a[1] += mask & (1<<28 - 1) + a[0] += mask & (1 << 28) +} + +// p224Invert calculates *out = in**-1 by computing in**(2**224 - 2**96 - 1), +// i.e. Fermat's little theorem. +func p224Invert(out, in *p224FieldElement) { + var f1, f2, f3, f4 p224FieldElement + var c p224LargeFieldElement + + p224Square(&f1, in, &c) // 2 + p224Mul(&f1, &f1, in, &c) // 2**2 - 1 + p224Square(&f1, &f1, &c) // 2**3 - 2 + p224Mul(&f1, &f1, in, &c) // 2**3 - 1 + p224Square(&f2, &f1, &c) // 2**4 - 2 + p224Square(&f2, &f2, &c) // 2**5 - 4 + p224Square(&f2, &f2, &c) // 2**6 - 8 + p224Mul(&f1, &f1, &f2, &c) // 2**6 - 1 + p224Square(&f2, &f1, &c) // 2**7 - 2 + for i := 0; i < 5; i++ { // 2**12 - 2**6 + p224Square(&f2, &f2, &c) + } + p224Mul(&f2, &f2, &f1, &c) // 2**12 - 1 + p224Square(&f3, &f2, &c) // 2**13 - 2 + for i := 0; i < 11; i++ { // 2**24 - 2**12 + p224Square(&f3, &f3, &c) + } + p224Mul(&f2, &f3, &f2, &c) // 2**24 - 1 + p224Square(&f3, &f2, &c) // 2**25 - 2 + for i := 0; i < 23; i++ { // 2**48 - 2**24 + p224Square(&f3, &f3, &c) + } + p224Mul(&f3, &f3, &f2, &c) // 2**48 - 1 + p224Square(&f4, &f3, &c) // 2**49 - 2 + for i := 0; i < 47; i++ { // 2**96 - 2**48 + p224Square(&f4, &f4, &c) + } + p224Mul(&f3, &f3, &f4, &c) // 2**96 - 1 + p224Square(&f4, &f3, &c) // 2**97 - 2 + for i := 0; i < 23; i++ { // 2**120 - 2**24 + p224Square(&f4, &f4, &c) + } + p224Mul(&f2, &f4, &f2, &c) // 2**120 - 1 + for i := 0; i < 6; i++ { // 2**126 - 2**6 + p224Square(&f2, &f2, &c) + } + p224Mul(&f1, &f1, &f2, &c) // 2**126 - 1 + p224Square(&f1, &f1, &c) // 2**127 - 2 + p224Mul(&f1, &f1, in, &c) // 2**127 - 1 + for i := 0; i < 97; i++ { // 2**224 - 2**97 + p224Square(&f1, &f1, &c) + } + p224Mul(out, &f1, &f3, &c) // 2**224 - 2**96 - 1 +} + +// p224Contract converts a FieldElement to its unique, minimal form. +// +// On entry, in[i] < 2**29 +// On exit, in[i] < 2**28 +func p224Contract(out, in *p224FieldElement) { + copy(out[:], in[:]) + + for i := 0; i < 7; i++ { + out[i+1] += out[i] >> 28 + out[i] &= bottom28Bits + } + top := out[7] >> 28 + out[7] &= bottom28Bits + + out[0] -= top + out[3] += top << 12 + + // We may just have made out[i] negative. So we carry down. If we made + // out[0] negative then we know that out[3] is sufficiently positive + // because we just added to it. + for i := 0; i < 3; i++ { + mask := uint32(int32(out[i]) >> 31) + out[i] += (1 << 28) & mask + out[i+1] -= 1 & mask + } + + // We might have pushed out[3] over 2**28 so we perform another, partial, + // carry chain. + for i := 3; i < 7; i++ { + out[i+1] += out[i] >> 28 + out[i] &= bottom28Bits + } + top = out[7] >> 28 + out[7] &= bottom28Bits + + // Eliminate top while maintaining the same value mod p. + out[0] -= top + out[3] += top << 12 + + // There are two cases to consider for out[3]: + // 1) The first time that we eliminated top, we didn't push out[3] over + // 2**28. In this case, the partial carry chain didn't change any values + // and top is zero. + // 2) We did push out[3] over 2**28 the first time that we eliminated top. + // The first value of top was in [0..16), therefore, prior to eliminating + // the first top, 0xfff1000 <= out[3] <= 0xfffffff. Therefore, after + // overflowing and being reduced by the second carry chain, out[3] <= + // 0xf000. Thus it cannot have overflowed when we eliminated top for the + // second time. + + // Again, we may just have made out[0] negative, so do the same carry down. + // As before, if we made out[0] negative then we know that out[3] is + // sufficiently positive. + for i := 0; i < 3; i++ { + mask := uint32(int32(out[i]) >> 31) + out[i] += (1 << 28) & mask + out[i+1] -= 1 & mask + } + + // Now we see if the value is >= p and, if so, subtract p. + + // First we build a mask from the top four limbs, which must all be + // equal to bottom28Bits if the whole value is >= p. If top4AllOnes + // ends up with any zero bits in the bottom 28 bits, then this wasn't + // true. + top4AllOnes := uint32(0xffffffff) + for i := 4; i < 8; i++ { + top4AllOnes &= out[i] + } + top4AllOnes |= 0xf0000000 + // Now we replicate any zero bits to all the bits in top4AllOnes. + top4AllOnes &= top4AllOnes >> 16 + top4AllOnes &= top4AllOnes >> 8 + top4AllOnes &= top4AllOnes >> 4 + top4AllOnes &= top4AllOnes >> 2 + top4AllOnes &= top4AllOnes >> 1 + top4AllOnes = uint32(int32(top4AllOnes<<31) >> 31) + + // Now we test whether the bottom three limbs are non-zero. + bottom3NonZero := out[0] | out[1] | out[2] + bottom3NonZero |= bottom3NonZero >> 16 + bottom3NonZero |= bottom3NonZero >> 8 + bottom3NonZero |= bottom3NonZero >> 4 + bottom3NonZero |= bottom3NonZero >> 2 + bottom3NonZero |= bottom3NonZero >> 1 + bottom3NonZero = uint32(int32(bottom3NonZero<<31) >> 31) + + // Everything depends on the value of out[3]. + // If it's > 0xffff000 and top4AllOnes != 0 then the whole value is >= p + // If it's = 0xffff000 and top4AllOnes != 0 and bottom3NonZero != 0, + // then the whole value is >= p + // If it's < 0xffff000, then the whole value is < p + n := out[3] - 0xffff000 + out3Equal := n + out3Equal |= out3Equal >> 16 + out3Equal |= out3Equal >> 8 + out3Equal |= out3Equal >> 4 + out3Equal |= out3Equal >> 2 + out3Equal |= out3Equal >> 1 + out3Equal = ^uint32(int32(out3Equal<<31) >> 31) + + // If out[3] > 0xffff000 then n's MSB will be zero. + out3GT := ^uint32(int32(n) >> 31) + + mask := top4AllOnes & ((out3Equal & bottom3NonZero) | out3GT) + out[0] -= 1 & mask + out[3] -= 0xffff000 & mask + out[4] -= 0xfffffff & mask + out[5] -= 0xfffffff & mask + out[6] -= 0xfffffff & mask + out[7] -= 0xfffffff & mask +} + +// Group element functions. +// +// These functions deal with group elements. The group is an elliptic curve +// group with a = -3 defined in FIPS 186-3, section D.2.2. + +// p224AddJacobian computes *out = a+b where a != b. +func p224AddJacobian(x3, y3, z3, x1, y1, z1, x2, y2, z2 *p224FieldElement) { + // See http://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#addition-p224Add-2007-bl + var z1z1, z2z2, u1, u2, s1, s2, h, i, j, r, v p224FieldElement + var c p224LargeFieldElement + + z1IsZero := p224IsZero(z1) + z2IsZero := p224IsZero(z2) + + // Z1Z1 = Z1² + p224Square(&z1z1, z1, &c) + // Z2Z2 = Z2² + p224Square(&z2z2, z2, &c) + // U1 = X1*Z2Z2 + p224Mul(&u1, x1, &z2z2, &c) + // U2 = X2*Z1Z1 + p224Mul(&u2, x2, &z1z1, &c) + // S1 = Y1*Z2*Z2Z2 + p224Mul(&s1, z2, &z2z2, &c) + p224Mul(&s1, y1, &s1, &c) + // S2 = Y2*Z1*Z1Z1 + p224Mul(&s2, z1, &z1z1, &c) + p224Mul(&s2, y2, &s2, &c) + // H = U2-U1 + p224Sub(&h, &u2, &u1) + p224Reduce(&h) + xEqual := p224IsZero(&h) + // I = (2*H)² + for j := 0; j < 8; j++ { + i[j] = h[j] << 1 + } + p224Reduce(&i) + p224Square(&i, &i, &c) + // J = H*I + p224Mul(&j, &h, &i, &c) + // r = 2*(S2-S1) + p224Sub(&r, &s2, &s1) + p224Reduce(&r) + yEqual := p224IsZero(&r) + if xEqual == 1 && yEqual == 1 && z1IsZero == 0 && z2IsZero == 0 { + p224DoubleJacobian(x3, y3, z3, x1, y1, z1) + return + } + for i := 0; i < 8; i++ { + r[i] <<= 1 + } + p224Reduce(&r) + // V = U1*I + p224Mul(&v, &u1, &i, &c) + // Z3 = ((Z1+Z2)²-Z1Z1-Z2Z2)*H + p224Add(&z1z1, &z1z1, &z2z2) + p224Add(&z2z2, z1, z2) + p224Reduce(&z2z2) + p224Square(&z2z2, &z2z2, &c) + p224Sub(z3, &z2z2, &z1z1) + p224Reduce(z3) + p224Mul(z3, z3, &h, &c) + // X3 = r²-J-2*V + for i := 0; i < 8; i++ { + z1z1[i] = v[i] << 1 + } + p224Add(&z1z1, &j, &z1z1) + p224Reduce(&z1z1) + p224Square(x3, &r, &c) + p224Sub(x3, x3, &z1z1) + p224Reduce(x3) + // Y3 = r*(V-X3)-2*S1*J + for i := 0; i < 8; i++ { + s1[i] <<= 1 + } + p224Mul(&s1, &s1, &j, &c) + p224Sub(&z1z1, &v, x3) + p224Reduce(&z1z1) + p224Mul(&z1z1, &z1z1, &r, &c) + p224Sub(y3, &z1z1, &s1) + p224Reduce(y3) + + p224CopyConditional(x3, x2, z1IsZero) + p224CopyConditional(x3, x1, z2IsZero) + p224CopyConditional(y3, y2, z1IsZero) + p224CopyConditional(y3, y1, z2IsZero) + p224CopyConditional(z3, z2, z1IsZero) + p224CopyConditional(z3, z1, z2IsZero) +} + +// p224DoubleJacobian computes *out = a+a. +func p224DoubleJacobian(x3, y3, z3, x1, y1, z1 *p224FieldElement) { + var delta, gamma, beta, alpha, t p224FieldElement + var c p224LargeFieldElement + + p224Square(&delta, z1, &c) + p224Square(&gamma, y1, &c) + p224Mul(&beta, x1, &gamma, &c) + + // alpha = 3*(X1-delta)*(X1+delta) + p224Add(&t, x1, &delta) + for i := 0; i < 8; i++ { + t[i] += t[i] << 1 + } + p224Reduce(&t) + p224Sub(&alpha, x1, &delta) + p224Reduce(&alpha) + p224Mul(&alpha, &alpha, &t, &c) + + // Z3 = (Y1+Z1)²-gamma-delta + p224Add(z3, y1, z1) + p224Reduce(z3) + p224Square(z3, z3, &c) + p224Sub(z3, z3, &gamma) + p224Reduce(z3) + p224Sub(z3, z3, &delta) + p224Reduce(z3) + + // X3 = alpha²-8*beta + for i := 0; i < 8; i++ { + delta[i] = beta[i] << 3 + } + p224Reduce(&delta) + p224Square(x3, &alpha, &c) + p224Sub(x3, x3, &delta) + p224Reduce(x3) + + // Y3 = alpha*(4*beta-X3)-8*gamma² + for i := 0; i < 8; i++ { + beta[i] <<= 2 + } + p224Sub(&beta, &beta, x3) + p224Reduce(&beta) + p224Square(&gamma, &gamma, &c) + for i := 0; i < 8; i++ { + gamma[i] <<= 3 + } + p224Reduce(&gamma) + p224Mul(y3, &alpha, &beta, &c) + p224Sub(y3, y3, &gamma) + p224Reduce(y3) +} + +// p224CopyConditional sets *out = *in iff the least-significant-bit of control +// is true, and it runs in constant time. +func p224CopyConditional(out, in *p224FieldElement, control uint32) { + control <<= 31 + control = uint32(int32(control) >> 31) + + for i := 0; i < 8; i++ { + out[i] ^= (out[i] ^ in[i]) & control + } +} + +func p224ScalarMult(outX, outY, outZ, inX, inY, inZ *p224FieldElement, scalar []byte) { + var xx, yy, zz p224FieldElement + for i := 0; i < 8; i++ { + outX[i] = 0 + outY[i] = 0 + outZ[i] = 0 + } + + for _, byte := range scalar { + for bitNum := uint(0); bitNum < 8; bitNum++ { + p224DoubleJacobian(outX, outY, outZ, outX, outY, outZ) + bit := uint32((byte >> (7 - bitNum)) & 1) + p224AddJacobian(&xx, &yy, &zz, inX, inY, inZ, outX, outY, outZ) + p224CopyConditional(outX, &xx, bit) + p224CopyConditional(outY, &yy, bit) + p224CopyConditional(outZ, &zz, bit) + } + } +} + +// p224ToAffine converts from Jacobian to affine form. +func p224ToAffine(x, y, z *p224FieldElement) (*big.Int, *big.Int) { + var zinv, zinvsq, outx, outy p224FieldElement + var tmp p224LargeFieldElement + + if isPointAtInfinity := p224IsZero(z); isPointAtInfinity == 1 { + return new(big.Int), new(big.Int) + } + + p224Invert(&zinv, z) + p224Square(&zinvsq, &zinv, &tmp) + p224Mul(x, x, &zinvsq, &tmp) + p224Mul(&zinvsq, &zinvsq, &zinv, &tmp) + p224Mul(y, y, &zinvsq, &tmp) + + p224Contract(&outx, x) + p224Contract(&outy, y) + return p224ToBig(&outx), p224ToBig(&outy) +} + +// get28BitsFromEnd returns the least-significant 28 bits from buf>>shift, +// where buf is interpreted as a big-endian number. +func get28BitsFromEnd(buf []byte, shift uint) (uint32, []byte) { + var ret uint32 + + for i := uint(0); i < 4; i++ { + var b byte + if l := len(buf); l > 0 { + b = buf[l-1] + // We don't remove the byte if we're about to return and we're not + // reading all of it. + if i != 3 || shift == 4 { + buf = buf[:l-1] + } + } + ret |= uint32(b) << (8 * i) >> shift + } + ret &= bottom28Bits + return ret, buf +} + +// p224FromBig sets *out = *in. +func p224FromBig(out *p224FieldElement, in *big.Int) { + bytes := in.Bytes() + out[0], bytes = get28BitsFromEnd(bytes, 0) + out[1], bytes = get28BitsFromEnd(bytes, 4) + out[2], bytes = get28BitsFromEnd(bytes, 0) + out[3], bytes = get28BitsFromEnd(bytes, 4) + out[4], bytes = get28BitsFromEnd(bytes, 0) + out[5], bytes = get28BitsFromEnd(bytes, 4) + out[6], bytes = get28BitsFromEnd(bytes, 0) + out[7], bytes = get28BitsFromEnd(bytes, 4) +} + +// p224ToBig returns in as a big.Int. +func p224ToBig(in *p224FieldElement) *big.Int { + var buf [28]byte + buf[27] = byte(in[0]) + buf[26] = byte(in[0] >> 8) + buf[25] = byte(in[0] >> 16) + buf[24] = byte(((in[0] >> 24) & 0x0f) | (in[1]<<4)&0xf0) + + buf[23] = byte(in[1] >> 4) + buf[22] = byte(in[1] >> 12) + buf[21] = byte(in[1] >> 20) + + buf[20] = byte(in[2]) + buf[19] = byte(in[2] >> 8) + buf[18] = byte(in[2] >> 16) + buf[17] = byte(((in[2] >> 24) & 0x0f) | (in[3]<<4)&0xf0) + + buf[16] = byte(in[3] >> 4) + buf[15] = byte(in[3] >> 12) + buf[14] = byte(in[3] >> 20) + + buf[13] = byte(in[4]) + buf[12] = byte(in[4] >> 8) + buf[11] = byte(in[4] >> 16) + buf[10] = byte(((in[4] >> 24) & 0x0f) | (in[5]<<4)&0xf0) + + buf[9] = byte(in[5] >> 4) + buf[8] = byte(in[5] >> 12) + buf[7] = byte(in[5] >> 20) + + buf[6] = byte(in[6]) + buf[5] = byte(in[6] >> 8) + buf[4] = byte(in[6] >> 16) + buf[3] = byte(((in[6] >> 24) & 0x0f) | (in[7]<<4)&0xf0) + + buf[2] = byte(in[7] >> 4) + buf[1] = byte(in[7] >> 12) + buf[0] = byte(in[7] >> 20) + + return new(big.Int).SetBytes(buf[:]) +} diff --git a/src/crypto/elliptic/p224_test.go b/src/crypto/elliptic/p224_test.go new file mode 100644 index 0000000000000000000000000000000000000000..4b26d1610ed80d8ceb0c9dde2a8ecc4ba5afda46 --- /dev/null +++ b/src/crypto/elliptic/p224_test.go @@ -0,0 +1,47 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package elliptic + +import ( + "math/big" + "testing" +) + +var toFromBigTests = []string{ + "0", + "1", + "23", + "b70e0cb46bb4bf7f321390b94a03c1d356c01122343280d6105c1d21", + "706a46d476dcb76798e6046d89474788d164c18032d268fd10704fa6", +} + +func p224AlternativeToBig(in *p224FieldElement) *big.Int { + ret := new(big.Int) + tmp := new(big.Int) + + for i := uint(0); i < 8; i++ { + tmp.SetInt64(int64(in[i])) + tmp.Lsh(tmp, 28*i) + ret.Add(ret, tmp) + } + ret.Mod(ret, p224.P) + return ret +} + +func TestToFromBig(t *testing.T) { + for i, test := range toFromBigTests { + n, _ := new(big.Int).SetString(test, 16) + var x p224FieldElement + p224FromBig(&x, n) + m := p224ToBig(&x) + if n.Cmp(m) != 0 { + t.Errorf("#%d: %x != %x", i, n, m) + } + q := p224AlternativeToBig(&x) + if n.Cmp(q) != 0 { + t.Errorf("#%d: %x != %x (alternative)", i, n, m) + } + } +} diff --git a/src/crypto/elliptic/p256.go b/src/crypto/elliptic/p256.go new file mode 100644 index 0000000000000000000000000000000000000000..82bc7b3019e62c6d7fd468bb2b59b88c43c3201e --- /dev/null +++ b/src/crypto/elliptic/p256.go @@ -0,0 +1,1186 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package elliptic + +// This file contains a constant-time, 32-bit implementation of P256. + +import ( + "math/big" +) + +type p256Curve struct { + *CurveParams +} + +var ( + p256 p256Curve + // RInverse contains 1/R mod p - the inverse of the Montgomery constant + // (2**257). + p256RInverse *big.Int +) + +func initP256() { + // See FIPS 186-3, section D.2.3 + p256.CurveParams = &CurveParams{Name: "P-256"} + p256.P, _ = new(big.Int).SetString("115792089210356248762697446949407573530086143415290314195533631308867097853951", 10) + p256.N, _ = new(big.Int).SetString("115792089210356248762697446949407573529996955224135760342422259061068512044369", 10) + p256.B, _ = new(big.Int).SetString("5ac635d8aa3a93e7b3ebbd55769886bc651d06b0cc53b0f63bce3c3e27d2604b", 16) + p256.Gx, _ = new(big.Int).SetString("6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296", 16) + p256.Gy, _ = new(big.Int).SetString("4fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5", 16) + p256.BitSize = 256 + + p256RInverse, _ = new(big.Int).SetString("7fffffff00000001fffffffe8000000100000000ffffffff0000000180000000", 16) +} + +func (curve p256Curve) Params() *CurveParams { + return curve.CurveParams +} + +// p256GetScalar endian-swaps the big-endian scalar value from in and writes it +// to out. If the scalar is equal or greater than the order of the group, it's +// reduced modulo that order. +func p256GetScalar(out *[32]byte, in []byte) { + n := new(big.Int).SetBytes(in) + var scalarBytes []byte + + if n.Cmp(p256.N) >= 0 { + n.Mod(n, p256.N) + scalarBytes = n.Bytes() + } else { + scalarBytes = in + } + + for i, v := range scalarBytes { + out[len(scalarBytes)-(1+i)] = v + } +} + +func (p256Curve) ScalarBaseMult(scalar []byte) (x, y *big.Int) { + var scalarReversed [32]byte + p256GetScalar(&scalarReversed, scalar) + + var x1, y1, z1 [p256Limbs]uint32 + p256ScalarBaseMult(&x1, &y1, &z1, &scalarReversed) + return p256ToAffine(&x1, &y1, &z1) +} + +func (p256Curve) ScalarMult(bigX, bigY *big.Int, scalar []byte) (x, y *big.Int) { + var scalarReversed [32]byte + p256GetScalar(&scalarReversed, scalar) + + var px, py, x1, y1, z1 [p256Limbs]uint32 + p256FromBig(&px, bigX) + p256FromBig(&py, bigY) + p256ScalarMult(&x1, &y1, &z1, &px, &py, &scalarReversed) + return p256ToAffine(&x1, &y1, &z1) +} + +// Field elements are represented as nine, unsigned 32-bit words. +// +// The value of an field element is: +// x[0] + (x[1] * 2**29) + (x[2] * 2**57) + ... + (x[8] * 2**228) +// +// That is, each limb is alternately 29 or 28-bits wide in little-endian +// order. +// +// This means that a field element hits 2**257, rather than 2**256 as we would +// like. A 28, 29, ... pattern would cause us to hit 2**256, but that causes +// problems when multiplying as terms end up one bit short of a limb which +// would require much bit-shifting to correct. +// +// Finally, the values stored in a field element are in Montgomery form. So the +// value |y| is stored as (y*R) mod p, where p is the P-256 prime and R is +// 2**257. + +const ( + p256Limbs = 9 + bottom29Bits = 0x1fffffff +) + +var ( + // p256One is the number 1 as a field element. + p256One = [p256Limbs]uint32{2, 0, 0, 0xffff800, 0x1fffffff, 0xfffffff, 0x1fbfffff, 0x1ffffff, 0} + p256Zero = [p256Limbs]uint32{0, 0, 0, 0, 0, 0, 0, 0, 0} + // p256P is the prime modulus as a field element. + p256P = [p256Limbs]uint32{0x1fffffff, 0xfffffff, 0x1fffffff, 0x3ff, 0, 0, 0x200000, 0xf000000, 0xfffffff} + // p2562P is the twice prime modulus as a field element. + p2562P = [p256Limbs]uint32{0x1ffffffe, 0xfffffff, 0x1fffffff, 0x7ff, 0, 0, 0x400000, 0xe000000, 0x1fffffff} +) + +// p256Precomputed contains precomputed values to aid the calculation of scalar +// multiples of the base point, G. It's actually two, equal length, tables +// concatenated. +// +// The first table contains (x,y) field element pairs for 16 multiples of the +// base point, G. +// +// Index | Index (binary) | Value +// 0 | 0000 | 0G (all zeros, omitted) +// 1 | 0001 | G +// 2 | 0010 | 2**64G +// 3 | 0011 | 2**64G + G +// 4 | 0100 | 2**128G +// 5 | 0101 | 2**128G + G +// 6 | 0110 | 2**128G + 2**64G +// 7 | 0111 | 2**128G + 2**64G + G +// 8 | 1000 | 2**192G +// 9 | 1001 | 2**192G + G +// 10 | 1010 | 2**192G + 2**64G +// 11 | 1011 | 2**192G + 2**64G + G +// 12 | 1100 | 2**192G + 2**128G +// 13 | 1101 | 2**192G + 2**128G + G +// 14 | 1110 | 2**192G + 2**128G + 2**64G +// 15 | 1111 | 2**192G + 2**128G + 2**64G + G +// +// The second table follows the same style, but the terms are 2**32G, +// 2**96G, 2**160G, 2**224G. +// +// This is ~2KB of data. +var p256Precomputed = [p256Limbs * 2 * 15 * 2]uint32{ + 0x11522878, 0xe730d41, 0xdb60179, 0x4afe2ff, 0x12883add, 0xcaddd88, 0x119e7edc, 0xd4a6eab, 0x3120bee, + 0x1d2aac15, 0xf25357c, 0x19e45cdd, 0x5c721d0, 0x1992c5a5, 0xa237487, 0x154ba21, 0x14b10bb, 0xae3fe3, + 0xd41a576, 0x922fc51, 0x234994f, 0x60b60d3, 0x164586ae, 0xce95f18, 0x1fe49073, 0x3fa36cc, 0x5ebcd2c, + 0xb402f2f, 0x15c70bf, 0x1561925c, 0x5a26704, 0xda91e90, 0xcdc1c7f, 0x1ea12446, 0xe1ade1e, 0xec91f22, + 0x26f7778, 0x566847e, 0xa0bec9e, 0x234f453, 0x1a31f21a, 0xd85e75c, 0x56c7109, 0xa267a00, 0xb57c050, + 0x98fb57, 0xaa837cc, 0x60c0792, 0xcfa5e19, 0x61bab9e, 0x589e39b, 0xa324c5, 0x7d6dee7, 0x2976e4b, + 0x1fc4124a, 0xa8c244b, 0x1ce86762, 0xcd61c7e, 0x1831c8e0, 0x75774e1, 0x1d96a5a9, 0x843a649, 0xc3ab0fa, + 0x6e2e7d5, 0x7673a2a, 0x178b65e8, 0x4003e9b, 0x1a1f11c2, 0x7816ea, 0xf643e11, 0x58c43df, 0xf423fc2, + 0x19633ffa, 0x891f2b2, 0x123c231c, 0x46add8c, 0x54700dd, 0x59e2b17, 0x172db40f, 0x83e277d, 0xb0dd609, + 0xfd1da12, 0x35c6e52, 0x19ede20c, 0xd19e0c0, 0x97d0f40, 0xb015b19, 0x449e3f5, 0xe10c9e, 0x33ab581, + 0x56a67ab, 0x577734d, 0x1dddc062, 0xc57b10d, 0x149b39d, 0x26a9e7b, 0xc35df9f, 0x48764cd, 0x76dbcca, + 0xca4b366, 0xe9303ab, 0x1a7480e7, 0x57e9e81, 0x1e13eb50, 0xf466cf3, 0x6f16b20, 0x4ba3173, 0xc168c33, + 0x15cb5439, 0x6a38e11, 0x73658bd, 0xb29564f, 0x3f6dc5b, 0x53b97e, 0x1322c4c0, 0x65dd7ff, 0x3a1e4f6, + 0x14e614aa, 0x9246317, 0x1bc83aca, 0xad97eed, 0xd38ce4a, 0xf82b006, 0x341f077, 0xa6add89, 0x4894acd, + 0x9f162d5, 0xf8410ef, 0x1b266a56, 0xd7f223, 0x3e0cb92, 0xe39b672, 0x6a2901a, 0x69a8556, 0x7e7c0, + 0x9b7d8d3, 0x309a80, 0x1ad05f7f, 0xc2fb5dd, 0xcbfd41d, 0x9ceb638, 0x1051825c, 0xda0cf5b, 0x812e881, + 0x6f35669, 0x6a56f2c, 0x1df8d184, 0x345820, 0x1477d477, 0x1645db1, 0xbe80c51, 0xc22be3e, 0xe35e65a, + 0x1aeb7aa0, 0xc375315, 0xf67bc99, 0x7fdd7b9, 0x191fc1be, 0x61235d, 0x2c184e9, 0x1c5a839, 0x47a1e26, + 0xb7cb456, 0x93e225d, 0x14f3c6ed, 0xccc1ac9, 0x17fe37f3, 0x4988989, 0x1a90c502, 0x2f32042, 0xa17769b, + 0xafd8c7c, 0x8191c6e, 0x1dcdb237, 0x16200c0, 0x107b32a1, 0x66c08db, 0x10d06a02, 0x3fc93, 0x5620023, + 0x16722b27, 0x68b5c59, 0x270fcfc, 0xfad0ecc, 0xe5de1c2, 0xeab466b, 0x2fc513c, 0x407f75c, 0xbaab133, + 0x9705fe9, 0xb88b8e7, 0x734c993, 0x1e1ff8f, 0x19156970, 0xabd0f00, 0x10469ea7, 0x3293ac0, 0xcdc98aa, + 0x1d843fd, 0xe14bfe8, 0x15be825f, 0x8b5212, 0xeb3fb67, 0x81cbd29, 0xbc62f16, 0x2b6fcc7, 0xf5a4e29, + 0x13560b66, 0xc0b6ac2, 0x51ae690, 0xd41e271, 0xf3e9bd4, 0x1d70aab, 0x1029f72, 0x73e1c35, 0xee70fbc, + 0xad81baf, 0x9ecc49a, 0x86c741e, 0xfe6be30, 0x176752e7, 0x23d416, 0x1f83de85, 0x27de188, 0x66f70b8, + 0x181cd51f, 0x96b6e4c, 0x188f2335, 0xa5df759, 0x17a77eb6, 0xfeb0e73, 0x154ae914, 0x2f3ec51, 0x3826b59, + 0xb91f17d, 0x1c72949, 0x1362bf0a, 0xe23fddf, 0xa5614b0, 0xf7d8f, 0x79061, 0x823d9d2, 0x8213f39, + 0x1128ae0b, 0xd095d05, 0xb85c0c2, 0x1ecb2ef, 0x24ddc84, 0xe35e901, 0x18411a4a, 0xf5ddc3d, 0x3786689, + 0x52260e8, 0x5ae3564, 0x542b10d, 0x8d93a45, 0x19952aa4, 0x996cc41, 0x1051a729, 0x4be3499, 0x52b23aa, + 0x109f307e, 0x6f5b6bb, 0x1f84e1e7, 0x77a0cfa, 0x10c4df3f, 0x25a02ea, 0xb048035, 0xe31de66, 0xc6ecaa3, + 0x28ea335, 0x2886024, 0x1372f020, 0xf55d35, 0x15e4684c, 0xf2a9e17, 0x1a4a7529, 0xcb7beb1, 0xb2a78a1, + 0x1ab21f1f, 0x6361ccf, 0x6c9179d, 0xb135627, 0x1267b974, 0x4408bad, 0x1cbff658, 0xe3d6511, 0xc7d76f, + 0x1cc7a69, 0xe7ee31b, 0x54fab4f, 0x2b914f, 0x1ad27a30, 0xcd3579e, 0xc50124c, 0x50daa90, 0xb13f72, + 0xb06aa75, 0x70f5cc6, 0x1649e5aa, 0x84a5312, 0x329043c, 0x41c4011, 0x13d32411, 0xb04a838, 0xd760d2d, + 0x1713b532, 0xbaa0c03, 0x84022ab, 0x6bcf5c1, 0x2f45379, 0x18ae070, 0x18c9e11e, 0x20bca9a, 0x66f496b, + 0x3eef294, 0x67500d2, 0xd7f613c, 0x2dbbeb, 0xb741038, 0xe04133f, 0x1582968d, 0xbe985f7, 0x1acbc1a, + 0x1a6a939f, 0x33e50f6, 0xd665ed4, 0xb4b7bd6, 0x1e5a3799, 0x6b33847, 0x17fa56ff, 0x65ef930, 0x21dc4a, + 0x2b37659, 0x450fe17, 0xb357b65, 0xdf5efac, 0x15397bef, 0x9d35a7f, 0x112ac15f, 0x624e62e, 0xa90ae2f, + 0x107eecd2, 0x1f69bbe, 0x77d6bce, 0x5741394, 0x13c684fc, 0x950c910, 0x725522b, 0xdc78583, 0x40eeabb, + 0x1fde328a, 0xbd61d96, 0xd28c387, 0x9e77d89, 0x12550c40, 0x759cb7d, 0x367ef34, 0xae2a960, 0x91b8bdc, + 0x93462a9, 0xf469ef, 0xb2e9aef, 0xd2ca771, 0x54e1f42, 0x7aaa49, 0x6316abb, 0x2413c8e, 0x5425bf9, + 0x1bed3e3a, 0xf272274, 0x1f5e7326, 0x6416517, 0xea27072, 0x9cedea7, 0x6e7633, 0x7c91952, 0xd806dce, + 0x8e2a7e1, 0xe421e1a, 0x418c9e1, 0x1dbc890, 0x1b395c36, 0xa1dc175, 0x1dc4ef73, 0x8956f34, 0xe4b5cf2, + 0x1b0d3a18, 0x3194a36, 0x6c2641f, 0xe44124c, 0xa2f4eaa, 0xa8c25ba, 0xf927ed7, 0x627b614, 0x7371cca, + 0xba16694, 0x417bc03, 0x7c0a7e3, 0x9c35c19, 0x1168a205, 0x8b6b00d, 0x10e3edc9, 0x9c19bf2, 0x5882229, + 0x1b2b4162, 0xa5cef1a, 0x1543622b, 0x9bd433e, 0x364e04d, 0x7480792, 0x5c9b5b3, 0xe85ff25, 0x408ef57, + 0x1814cfa4, 0x121b41b, 0xd248a0f, 0x3b05222, 0x39bb16a, 0xc75966d, 0xa038113, 0xa4a1769, 0x11fbc6c, + 0x917e50e, 0xeec3da8, 0x169d6eac, 0x10c1699, 0xa416153, 0xf724912, 0x15cd60b7, 0x4acbad9, 0x5efc5fa, + 0xf150ed7, 0x122b51, 0x1104b40a, 0xcb7f442, 0xfbb28ff, 0x6ac53ca, 0x196142cc, 0x7bf0fa9, 0x957651, + 0x4e0f215, 0xed439f8, 0x3f46bd5, 0x5ace82f, 0x110916b6, 0x6db078, 0xffd7d57, 0xf2ecaac, 0xca86dec, + 0x15d6b2da, 0x965ecc9, 0x1c92b4c2, 0x1f3811, 0x1cb080f5, 0x2d8b804, 0x19d1c12d, 0xf20bd46, 0x1951fa7, + 0xa3656c3, 0x523a425, 0xfcd0692, 0xd44ddc8, 0x131f0f5b, 0xaf80e4a, 0xcd9fc74, 0x99bb618, 0x2db944c, + 0xa673090, 0x1c210e1, 0x178c8d23, 0x1474383, 0x10b8743d, 0x985a55b, 0x2e74779, 0x576138, 0x9587927, + 0x133130fa, 0xbe05516, 0x9f4d619, 0xbb62570, 0x99ec591, 0xd9468fe, 0x1d07782d, 0xfc72e0b, 0x701b298, + 0x1863863b, 0x85954b8, 0x121a0c36, 0x9e7fedf, 0xf64b429, 0x9b9d71e, 0x14e2f5d8, 0xf858d3a, 0x942eea8, + 0xda5b765, 0x6edafff, 0xa9d18cc, 0xc65e4ba, 0x1c747e86, 0xe4ea915, 0x1981d7a1, 0x8395659, 0x52ed4e2, + 0x87d43b7, 0x37ab11b, 0x19d292ce, 0xf8d4692, 0x18c3053f, 0x8863e13, 0x4c146c0, 0x6bdf55a, 0x4e4457d, + 0x16152289, 0xac78ec2, 0x1a59c5a2, 0x2028b97, 0x71c2d01, 0x295851f, 0x404747b, 0x878558d, 0x7d29aa4, + 0x13d8341f, 0x8daefd7, 0x139c972d, 0x6b7ea75, 0xd4a9dde, 0xff163d8, 0x81d55d7, 0xa5bef68, 0xb7b30d8, + 0xbe73d6f, 0xaa88141, 0xd976c81, 0x7e7a9cc, 0x18beb771, 0xd773cbd, 0x13f51951, 0x9d0c177, 0x1c49a78, +} + +// Field element operations: + +// nonZeroToAllOnes returns: +// 0xffffffff for 0 < x <= 2**31 +// 0 for x == 0 or x > 2**31. +func nonZeroToAllOnes(x uint32) uint32 { + return ((x - 1) >> 31) - 1 +} + +// p256ReduceCarry adds a multiple of p in order to cancel |carry|, +// which is a term at 2**257. +// +// On entry: carry < 2**3, inout[0,2,...] < 2**29, inout[1,3,...] < 2**28. +// On exit: inout[0,2,..] < 2**30, inout[1,3,...] < 2**29. +func p256ReduceCarry(inout *[p256Limbs]uint32, carry uint32) { + carry_mask := nonZeroToAllOnes(carry) + + inout[0] += carry << 1 + inout[3] += 0x10000000 & carry_mask + // carry < 2**3 thus (carry << 11) < 2**14 and we added 2**28 in the + // previous line therefore this doesn't underflow. + inout[3] -= carry << 11 + inout[4] += (0x20000000 - 1) & carry_mask + inout[5] += (0x10000000 - 1) & carry_mask + inout[6] += (0x20000000 - 1) & carry_mask + inout[6] -= carry << 22 + // This may underflow if carry is non-zero but, if so, we'll fix it in the + // next line. + inout[7] -= 1 & carry_mask + inout[7] += carry << 25 +} + +// p256Sum sets out = in+in2. +// +// On entry, in[i]+in2[i] must not overflow a 32-bit word. +// On exit: out[0,2,...] < 2**30, out[1,3,...] < 2**29 +func p256Sum(out, in, in2 *[p256Limbs]uint32) { + carry := uint32(0) + for i := 0; ; i++ { + out[i] = in[i] + in2[i] + out[i] += carry + carry = out[i] >> 29 + out[i] &= bottom29Bits + + i++ + if i == p256Limbs { + break + } + + out[i] = in[i] + in2[i] + out[i] += carry + carry = out[i] >> 28 + out[i] &= bottom28Bits + } + + p256ReduceCarry(out, carry) +} + +const ( + two30m2 = 1<<30 - 1<<2 + two30p13m2 = 1<<30 + 1<<13 - 1<<2 + two31m2 = 1<<31 - 1<<2 + two31p24m2 = 1<<31 + 1<<24 - 1<<2 + two30m27m2 = 1<<30 - 1<<27 - 1<<2 +) + +// p256Zero31 is 0 mod p. +var p256Zero31 = [p256Limbs]uint32{two31m3, two30m2, two31m2, two30p13m2, two31m2, two30m2, two31p24m2, two30m27m2, two31m2} + +// p256Diff sets out = in-in2. +// +// On entry: in[0,2,...] < 2**30, in[1,3,...] < 2**29 and +// in2[0,2,...] < 2**30, in2[1,3,...] < 2**29. +// On exit: out[0,2,...] < 2**30, out[1,3,...] < 2**29. +func p256Diff(out, in, in2 *[p256Limbs]uint32) { + var carry uint32 + + for i := 0; ; i++ { + out[i] = in[i] - in2[i] + out[i] += p256Zero31[i] + out[i] += carry + carry = out[i] >> 29 + out[i] &= bottom29Bits + + i++ + if i == p256Limbs { + break + } + + out[i] = in[i] - in2[i] + out[i] += p256Zero31[i] + out[i] += carry + carry = out[i] >> 28 + out[i] &= bottom28Bits + } + + p256ReduceCarry(out, carry) +} + +// p256ReduceDegree sets out = tmp/R mod p where tmp contains 64-bit words with +// the same 29,28,... bit positions as an field element. +// +// The values in field elements are in Montgomery form: x*R mod p where R = +// 2**257. Since we just multiplied two Montgomery values together, the result +// is x*y*R*R mod p. We wish to divide by R in order for the result also to be +// in Montgomery form. +// +// On entry: tmp[i] < 2**64 +// On exit: out[0,2,...] < 2**30, out[1,3,...] < 2**29 +func p256ReduceDegree(out *[p256Limbs]uint32, tmp [17]uint64) { + // The following table may be helpful when reading this code: + // + // Limb number: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10... + // Width (bits): 29| 28| 29| 28| 29| 28| 29| 28| 29| 28| 29 + // Start bit: 0 | 29| 57| 86|114|143|171|200|228|257|285 + // (odd phase): 0 | 28| 57| 85|114|142|171|199|228|256|285 + var tmp2 [18]uint32 + var carry, x, xMask uint32 + + // tmp contains 64-bit words with the same 29,28,29-bit positions as an + // field element. So the top of an element of tmp might overlap with + // another element two positions down. The following loop eliminates + // this overlap. + tmp2[0] = uint32(tmp[0]) & bottom29Bits + + tmp2[1] = uint32(tmp[0]) >> 29 + tmp2[1] |= (uint32(tmp[0]>>32) << 3) & bottom28Bits + tmp2[1] += uint32(tmp[1]) & bottom28Bits + carry = tmp2[1] >> 28 + tmp2[1] &= bottom28Bits + + for i := 2; i < 17; i++ { + tmp2[i] = (uint32(tmp[i-2] >> 32)) >> 25 + tmp2[i] += (uint32(tmp[i-1])) >> 28 + tmp2[i] += (uint32(tmp[i-1]>>32) << 4) & bottom29Bits + tmp2[i] += uint32(tmp[i]) & bottom29Bits + tmp2[i] += carry + carry = tmp2[i] >> 29 + tmp2[i] &= bottom29Bits + + i++ + if i == 17 { + break + } + tmp2[i] = uint32(tmp[i-2]>>32) >> 25 + tmp2[i] += uint32(tmp[i-1]) >> 29 + tmp2[i] += ((uint32(tmp[i-1] >> 32)) << 3) & bottom28Bits + tmp2[i] += uint32(tmp[i]) & bottom28Bits + tmp2[i] += carry + carry = tmp2[i] >> 28 + tmp2[i] &= bottom28Bits + } + + tmp2[17] = uint32(tmp[15]>>32) >> 25 + tmp2[17] += uint32(tmp[16]) >> 29 + tmp2[17] += uint32(tmp[16]>>32) << 3 + tmp2[17] += carry + + // Montgomery elimination of terms: + // + // Since R is 2**257, we can divide by R with a bitwise shift if we can + // ensure that the right-most 257 bits are all zero. We can make that true + // by adding multiplies of p without affecting the value. + // + // So we eliminate limbs from right to left. Since the bottom 29 bits of p + // are all ones, then by adding tmp2[0]*p to tmp2 we'll make tmp2[0] == 0. + // We can do that for 8 further limbs and then right shift to eliminate the + // extra factor of R. + for i := 0; ; i += 2 { + tmp2[i+1] += tmp2[i] >> 29 + x = tmp2[i] & bottom29Bits + xMask = nonZeroToAllOnes(x) + tmp2[i] = 0 + + // The bounds calculations for this loop are tricky. Each iteration of + // the loop eliminates two words by adding values to words to their + // right. + // + // The following table contains the amounts added to each word (as an + // offset from the value of i at the top of the loop). The amounts are + // accounted for from the first and second half of the loop separately + // and are written as, for example, 28 to mean a value <2**28. + // + // Word: 3 4 5 6 7 8 9 10 + // Added in top half: 28 11 29 21 29 28 + // 28 29 + // 29 + // Added in bottom half: 29 10 28 21 28 28 + // 29 + // + // The value that is currently offset 7 will be offset 5 for the next + // iteration and then offset 3 for the iteration after that. Therefore + // the total value added will be the values added at 7, 5 and 3. + // + // The following table accumulates these values. The sums at the bottom + // are written as, for example, 29+28, to mean a value < 2**29+2**28. + // + // Word: 3 4 5 6 7 8 9 10 11 12 13 + // 28 11 10 29 21 29 28 28 28 28 28 + // 29 28 11 28 29 28 29 28 29 28 + // 29 28 21 21 29 21 29 21 + // 10 29 28 21 28 21 28 + // 28 29 28 29 28 29 28 + // 11 10 29 10 29 10 + // 29 28 11 28 11 + // 29 29 + // -------------------------------------------- + // 30+ 31+ 30+ 31+ 30+ + // 28+ 29+ 28+ 29+ 21+ + // 21+ 28+ 21+ 28+ 10 + // 10 21+ 10 21+ + // 11 11 + // + // So the greatest amount is added to tmp2[10] and tmp2[12]. If + // tmp2[10/12] has an initial value of <2**29, then the maximum value + // will be < 2**31 + 2**30 + 2**28 + 2**21 + 2**11, which is < 2**32, + // as required. + tmp2[i+3] += (x << 10) & bottom28Bits + tmp2[i+4] += (x >> 18) + + tmp2[i+6] += (x << 21) & bottom29Bits + tmp2[i+7] += x >> 8 + + // At position 200, which is the starting bit position for word 7, we + // have a factor of 0xf000000 = 2**28 - 2**24. + tmp2[i+7] += 0x10000000 & xMask + tmp2[i+8] += (x - 1) & xMask + tmp2[i+7] -= (x << 24) & bottom28Bits + tmp2[i+8] -= x >> 4 + + tmp2[i+8] += 0x20000000 & xMask + tmp2[i+8] -= x + tmp2[i+8] += (x << 28) & bottom29Bits + tmp2[i+9] += ((x >> 1) - 1) & xMask + + if i+1 == p256Limbs { + break + } + tmp2[i+2] += tmp2[i+1] >> 28 + x = tmp2[i+1] & bottom28Bits + xMask = nonZeroToAllOnes(x) + tmp2[i+1] = 0 + + tmp2[i+4] += (x << 11) & bottom29Bits + tmp2[i+5] += (x >> 18) + + tmp2[i+7] += (x << 21) & bottom28Bits + tmp2[i+8] += x >> 7 + + // At position 199, which is the starting bit of the 8th word when + // dealing with a context starting on an odd word, we have a factor of + // 0x1e000000 = 2**29 - 2**25. Since we have not updated i, the 8th + // word from i+1 is i+8. + tmp2[i+8] += 0x20000000 & xMask + tmp2[i+9] += (x - 1) & xMask + tmp2[i+8] -= (x << 25) & bottom29Bits + tmp2[i+9] -= x >> 4 + + tmp2[i+9] += 0x10000000 & xMask + tmp2[i+9] -= x + tmp2[i+10] += (x - 1) & xMask + } + + // We merge the right shift with a carry chain. The words above 2**257 have + // widths of 28,29,... which we need to correct when copying them down. + carry = 0 + for i := 0; i < 8; i++ { + // The maximum value of tmp2[i + 9] occurs on the first iteration and + // is < 2**30+2**29+2**28. Adding 2**29 (from tmp2[i + 10]) is + // therefore safe. + out[i] = tmp2[i+9] + out[i] += carry + out[i] += (tmp2[i+10] << 28) & bottom29Bits + carry = out[i] >> 29 + out[i] &= bottom29Bits + + i++ + out[i] = tmp2[i+9] >> 1 + out[i] += carry + carry = out[i] >> 28 + out[i] &= bottom28Bits + } + + out[8] = tmp2[17] + out[8] += carry + carry = out[8] >> 29 + out[8] &= bottom29Bits + + p256ReduceCarry(out, carry) +} + +// p256Square sets out=in*in. +// +// On entry: in[0,2,...] < 2**30, in[1,3,...] < 2**29. +// On exit: out[0,2,...] < 2**30, out[1,3,...] < 2**29. +func p256Square(out, in *[p256Limbs]uint32) { + var tmp [17]uint64 + + tmp[0] = uint64(in[0]) * uint64(in[0]) + tmp[1] = uint64(in[0]) * (uint64(in[1]) << 1) + tmp[2] = uint64(in[0])*(uint64(in[2])<<1) + + uint64(in[1])*(uint64(in[1])<<1) + tmp[3] = uint64(in[0])*(uint64(in[3])<<1) + + uint64(in[1])*(uint64(in[2])<<1) + tmp[4] = uint64(in[0])*(uint64(in[4])<<1) + + uint64(in[1])*(uint64(in[3])<<2) + + uint64(in[2])*uint64(in[2]) + tmp[5] = uint64(in[0])*(uint64(in[5])<<1) + + uint64(in[1])*(uint64(in[4])<<1) + + uint64(in[2])*(uint64(in[3])<<1) + tmp[6] = uint64(in[0])*(uint64(in[6])<<1) + + uint64(in[1])*(uint64(in[5])<<2) + + uint64(in[2])*(uint64(in[4])<<1) + + uint64(in[3])*(uint64(in[3])<<1) + tmp[7] = uint64(in[0])*(uint64(in[7])<<1) + + uint64(in[1])*(uint64(in[6])<<1) + + uint64(in[2])*(uint64(in[5])<<1) + + uint64(in[3])*(uint64(in[4])<<1) + // tmp[8] has the greatest value of 2**61 + 2**60 + 2**61 + 2**60 + 2**60, + // which is < 2**64 as required. + tmp[8] = uint64(in[0])*(uint64(in[8])<<1) + + uint64(in[1])*(uint64(in[7])<<2) + + uint64(in[2])*(uint64(in[6])<<1) + + uint64(in[3])*(uint64(in[5])<<2) + + uint64(in[4])*uint64(in[4]) + tmp[9] = uint64(in[1])*(uint64(in[8])<<1) + + uint64(in[2])*(uint64(in[7])<<1) + + uint64(in[3])*(uint64(in[6])<<1) + + uint64(in[4])*(uint64(in[5])<<1) + tmp[10] = uint64(in[2])*(uint64(in[8])<<1) + + uint64(in[3])*(uint64(in[7])<<2) + + uint64(in[4])*(uint64(in[6])<<1) + + uint64(in[5])*(uint64(in[5])<<1) + tmp[11] = uint64(in[3])*(uint64(in[8])<<1) + + uint64(in[4])*(uint64(in[7])<<1) + + uint64(in[5])*(uint64(in[6])<<1) + tmp[12] = uint64(in[4])*(uint64(in[8])<<1) + + uint64(in[5])*(uint64(in[7])<<2) + + uint64(in[6])*uint64(in[6]) + tmp[13] = uint64(in[5])*(uint64(in[8])<<1) + + uint64(in[6])*(uint64(in[7])<<1) + tmp[14] = uint64(in[6])*(uint64(in[8])<<1) + + uint64(in[7])*(uint64(in[7])<<1) + tmp[15] = uint64(in[7]) * (uint64(in[8]) << 1) + tmp[16] = uint64(in[8]) * uint64(in[8]) + + p256ReduceDegree(out, tmp) +} + +// p256Mul sets out=in*in2. +// +// On entry: in[0,2,...] < 2**30, in[1,3,...] < 2**29 and +// in2[0,2,...] < 2**30, in2[1,3,...] < 2**29. +// On exit: out[0,2,...] < 2**30, out[1,3,...] < 2**29. +func p256Mul(out, in, in2 *[p256Limbs]uint32) { + var tmp [17]uint64 + + tmp[0] = uint64(in[0]) * uint64(in2[0]) + tmp[1] = uint64(in[0])*(uint64(in2[1])<<0) + + uint64(in[1])*(uint64(in2[0])<<0) + tmp[2] = uint64(in[0])*(uint64(in2[2])<<0) + + uint64(in[1])*(uint64(in2[1])<<1) + + uint64(in[2])*(uint64(in2[0])<<0) + tmp[3] = uint64(in[0])*(uint64(in2[3])<<0) + + uint64(in[1])*(uint64(in2[2])<<0) + + uint64(in[2])*(uint64(in2[1])<<0) + + uint64(in[3])*(uint64(in2[0])<<0) + tmp[4] = uint64(in[0])*(uint64(in2[4])<<0) + + uint64(in[1])*(uint64(in2[3])<<1) + + uint64(in[2])*(uint64(in2[2])<<0) + + uint64(in[3])*(uint64(in2[1])<<1) + + uint64(in[4])*(uint64(in2[0])<<0) + tmp[5] = uint64(in[0])*(uint64(in2[5])<<0) + + uint64(in[1])*(uint64(in2[4])<<0) + + uint64(in[2])*(uint64(in2[3])<<0) + + uint64(in[3])*(uint64(in2[2])<<0) + + uint64(in[4])*(uint64(in2[1])<<0) + + uint64(in[5])*(uint64(in2[0])<<0) + tmp[6] = uint64(in[0])*(uint64(in2[6])<<0) + + uint64(in[1])*(uint64(in2[5])<<1) + + uint64(in[2])*(uint64(in2[4])<<0) + + uint64(in[3])*(uint64(in2[3])<<1) + + uint64(in[4])*(uint64(in2[2])<<0) + + uint64(in[5])*(uint64(in2[1])<<1) + + uint64(in[6])*(uint64(in2[0])<<0) + tmp[7] = uint64(in[0])*(uint64(in2[7])<<0) + + uint64(in[1])*(uint64(in2[6])<<0) + + uint64(in[2])*(uint64(in2[5])<<0) + + uint64(in[3])*(uint64(in2[4])<<0) + + uint64(in[4])*(uint64(in2[3])<<0) + + uint64(in[5])*(uint64(in2[2])<<0) + + uint64(in[6])*(uint64(in2[1])<<0) + + uint64(in[7])*(uint64(in2[0])<<0) + // tmp[8] has the greatest value but doesn't overflow. See logic in + // p256Square. + tmp[8] = uint64(in[0])*(uint64(in2[8])<<0) + + uint64(in[1])*(uint64(in2[7])<<1) + + uint64(in[2])*(uint64(in2[6])<<0) + + uint64(in[3])*(uint64(in2[5])<<1) + + uint64(in[4])*(uint64(in2[4])<<0) + + uint64(in[5])*(uint64(in2[3])<<1) + + uint64(in[6])*(uint64(in2[2])<<0) + + uint64(in[7])*(uint64(in2[1])<<1) + + uint64(in[8])*(uint64(in2[0])<<0) + tmp[9] = uint64(in[1])*(uint64(in2[8])<<0) + + uint64(in[2])*(uint64(in2[7])<<0) + + uint64(in[3])*(uint64(in2[6])<<0) + + uint64(in[4])*(uint64(in2[5])<<0) + + uint64(in[5])*(uint64(in2[4])<<0) + + uint64(in[6])*(uint64(in2[3])<<0) + + uint64(in[7])*(uint64(in2[2])<<0) + + uint64(in[8])*(uint64(in2[1])<<0) + tmp[10] = uint64(in[2])*(uint64(in2[8])<<0) + + uint64(in[3])*(uint64(in2[7])<<1) + + uint64(in[4])*(uint64(in2[6])<<0) + + uint64(in[5])*(uint64(in2[5])<<1) + + uint64(in[6])*(uint64(in2[4])<<0) + + uint64(in[7])*(uint64(in2[3])<<1) + + uint64(in[8])*(uint64(in2[2])<<0) + tmp[11] = uint64(in[3])*(uint64(in2[8])<<0) + + uint64(in[4])*(uint64(in2[7])<<0) + + uint64(in[5])*(uint64(in2[6])<<0) + + uint64(in[6])*(uint64(in2[5])<<0) + + uint64(in[7])*(uint64(in2[4])<<0) + + uint64(in[8])*(uint64(in2[3])<<0) + tmp[12] = uint64(in[4])*(uint64(in2[8])<<0) + + uint64(in[5])*(uint64(in2[7])<<1) + + uint64(in[6])*(uint64(in2[6])<<0) + + uint64(in[7])*(uint64(in2[5])<<1) + + uint64(in[8])*(uint64(in2[4])<<0) + tmp[13] = uint64(in[5])*(uint64(in2[8])<<0) + + uint64(in[6])*(uint64(in2[7])<<0) + + uint64(in[7])*(uint64(in2[6])<<0) + + uint64(in[8])*(uint64(in2[5])<<0) + tmp[14] = uint64(in[6])*(uint64(in2[8])<<0) + + uint64(in[7])*(uint64(in2[7])<<1) + + uint64(in[8])*(uint64(in2[6])<<0) + tmp[15] = uint64(in[7])*(uint64(in2[8])<<0) + + uint64(in[8])*(uint64(in2[7])<<0) + tmp[16] = uint64(in[8]) * (uint64(in2[8]) << 0) + + p256ReduceDegree(out, tmp) +} + +func p256Assign(out, in *[p256Limbs]uint32) { + *out = *in +} + +// p256Invert calculates |out| = |in|^{-1} +// +// Based on Fermat's Little Theorem: +// a^p = a (mod p) +// a^{p-1} = 1 (mod p) +// a^{p-2} = a^{-1} (mod p) +func p256Invert(out, in *[p256Limbs]uint32) { + var ftmp, ftmp2 [p256Limbs]uint32 + + // each e_I will hold |in|^{2^I - 1} + var e2, e4, e8, e16, e32, e64 [p256Limbs]uint32 + + p256Square(&ftmp, in) // 2^1 + p256Mul(&ftmp, in, &ftmp) // 2^2 - 2^0 + p256Assign(&e2, &ftmp) + p256Square(&ftmp, &ftmp) // 2^3 - 2^1 + p256Square(&ftmp, &ftmp) // 2^4 - 2^2 + p256Mul(&ftmp, &ftmp, &e2) // 2^4 - 2^0 + p256Assign(&e4, &ftmp) + p256Square(&ftmp, &ftmp) // 2^5 - 2^1 + p256Square(&ftmp, &ftmp) // 2^6 - 2^2 + p256Square(&ftmp, &ftmp) // 2^7 - 2^3 + p256Square(&ftmp, &ftmp) // 2^8 - 2^4 + p256Mul(&ftmp, &ftmp, &e4) // 2^8 - 2^0 + p256Assign(&e8, &ftmp) + for i := 0; i < 8; i++ { + p256Square(&ftmp, &ftmp) + } // 2^16 - 2^8 + p256Mul(&ftmp, &ftmp, &e8) // 2^16 - 2^0 + p256Assign(&e16, &ftmp) + for i := 0; i < 16; i++ { + p256Square(&ftmp, &ftmp) + } // 2^32 - 2^16 + p256Mul(&ftmp, &ftmp, &e16) // 2^32 - 2^0 + p256Assign(&e32, &ftmp) + for i := 0; i < 32; i++ { + p256Square(&ftmp, &ftmp) + } // 2^64 - 2^32 + p256Assign(&e64, &ftmp) + p256Mul(&ftmp, &ftmp, in) // 2^64 - 2^32 + 2^0 + for i := 0; i < 192; i++ { + p256Square(&ftmp, &ftmp) + } // 2^256 - 2^224 + 2^192 + + p256Mul(&ftmp2, &e64, &e32) // 2^64 - 2^0 + for i := 0; i < 16; i++ { + p256Square(&ftmp2, &ftmp2) + } // 2^80 - 2^16 + p256Mul(&ftmp2, &ftmp2, &e16) // 2^80 - 2^0 + for i := 0; i < 8; i++ { + p256Square(&ftmp2, &ftmp2) + } // 2^88 - 2^8 + p256Mul(&ftmp2, &ftmp2, &e8) // 2^88 - 2^0 + for i := 0; i < 4; i++ { + p256Square(&ftmp2, &ftmp2) + } // 2^92 - 2^4 + p256Mul(&ftmp2, &ftmp2, &e4) // 2^92 - 2^0 + p256Square(&ftmp2, &ftmp2) // 2^93 - 2^1 + p256Square(&ftmp2, &ftmp2) // 2^94 - 2^2 + p256Mul(&ftmp2, &ftmp2, &e2) // 2^94 - 2^0 + p256Square(&ftmp2, &ftmp2) // 2^95 - 2^1 + p256Square(&ftmp2, &ftmp2) // 2^96 - 2^2 + p256Mul(&ftmp2, &ftmp2, in) // 2^96 - 3 + + p256Mul(out, &ftmp2, &ftmp) // 2^256 - 2^224 + 2^192 + 2^96 - 3 +} + +// p256Scalar3 sets out=3*out. +// +// On entry: out[0,2,...] < 2**30, out[1,3,...] < 2**29. +// On exit: out[0,2,...] < 2**30, out[1,3,...] < 2**29. +func p256Scalar3(out *[p256Limbs]uint32) { + var carry uint32 + + for i := 0; ; i++ { + out[i] *= 3 + out[i] += carry + carry = out[i] >> 29 + out[i] &= bottom29Bits + + i++ + if i == p256Limbs { + break + } + + out[i] *= 3 + out[i] += carry + carry = out[i] >> 28 + out[i] &= bottom28Bits + } + + p256ReduceCarry(out, carry) +} + +// p256Scalar4 sets out=4*out. +// +// On entry: out[0,2,...] < 2**30, out[1,3,...] < 2**29. +// On exit: out[0,2,...] < 2**30, out[1,3,...] < 2**29. +func p256Scalar4(out *[p256Limbs]uint32) { + var carry, nextCarry uint32 + + for i := 0; ; i++ { + nextCarry = out[i] >> 27 + out[i] <<= 2 + out[i] &= bottom29Bits + out[i] += carry + carry = nextCarry + (out[i] >> 29) + out[i] &= bottom29Bits + + i++ + if i == p256Limbs { + break + } + nextCarry = out[i] >> 26 + out[i] <<= 2 + out[i] &= bottom28Bits + out[i] += carry + carry = nextCarry + (out[i] >> 28) + out[i] &= bottom28Bits + } + + p256ReduceCarry(out, carry) +} + +// p256Scalar8 sets out=8*out. +// +// On entry: out[0,2,...] < 2**30, out[1,3,...] < 2**29. +// On exit: out[0,2,...] < 2**30, out[1,3,...] < 2**29. +func p256Scalar8(out *[p256Limbs]uint32) { + var carry, nextCarry uint32 + + for i := 0; ; i++ { + nextCarry = out[i] >> 26 + out[i] <<= 3 + out[i] &= bottom29Bits + out[i] += carry + carry = nextCarry + (out[i] >> 29) + out[i] &= bottom29Bits + + i++ + if i == p256Limbs { + break + } + nextCarry = out[i] >> 25 + out[i] <<= 3 + out[i] &= bottom28Bits + out[i] += carry + carry = nextCarry + (out[i] >> 28) + out[i] &= bottom28Bits + } + + p256ReduceCarry(out, carry) +} + +// Group operations: +// +// Elements of the elliptic curve group are represented in Jacobian +// coordinates: (x, y, z). An affine point (x', y') is x'=x/z**2, y'=y/z**3 in +// Jacobian form. + +// p256PointDouble sets {xOut,yOut,zOut} = 2*{x,y,z}. +// +// See http://www.hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html#doubling-dbl-2009-l +func p256PointDouble(xOut, yOut, zOut, x, y, z *[p256Limbs]uint32) { + var delta, gamma, alpha, beta, tmp, tmp2 [p256Limbs]uint32 + + p256Square(&delta, z) + p256Square(&gamma, y) + p256Mul(&beta, x, &gamma) + + p256Sum(&tmp, x, &delta) + p256Diff(&tmp2, x, &delta) + p256Mul(&alpha, &tmp, &tmp2) + p256Scalar3(&alpha) + + p256Sum(&tmp, y, z) + p256Square(&tmp, &tmp) + p256Diff(&tmp, &tmp, &gamma) + p256Diff(zOut, &tmp, &delta) + + p256Scalar4(&beta) + p256Square(xOut, &alpha) + p256Diff(xOut, xOut, &beta) + p256Diff(xOut, xOut, &beta) + + p256Diff(&tmp, &beta, xOut) + p256Mul(&tmp, &alpha, &tmp) + p256Square(&tmp2, &gamma) + p256Scalar8(&tmp2) + p256Diff(yOut, &tmp, &tmp2) +} + +// p256PointAddMixed sets {xOut,yOut,zOut} = {x1,y1,z1} + {x2,y2,1}. +// (i.e. the second point is affine.) +// +// See http://www.hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html#addition-add-2007-bl +// +// Note that this function does not handle P+P, infinity+P nor P+infinity +// correctly. +func p256PointAddMixed(xOut, yOut, zOut, x1, y1, z1, x2, y2 *[p256Limbs]uint32) { + var z1z1, z1z1z1, s2, u2, h, i, j, r, rr, v, tmp [p256Limbs]uint32 + + p256Square(&z1z1, z1) + p256Sum(&tmp, z1, z1) + + p256Mul(&u2, x2, &z1z1) + p256Mul(&z1z1z1, z1, &z1z1) + p256Mul(&s2, y2, &z1z1z1) + p256Diff(&h, &u2, x1) + p256Sum(&i, &h, &h) + p256Square(&i, &i) + p256Mul(&j, &h, &i) + p256Diff(&r, &s2, y1) + p256Sum(&r, &r, &r) + p256Mul(&v, x1, &i) + + p256Mul(zOut, &tmp, &h) + p256Square(&rr, &r) + p256Diff(xOut, &rr, &j) + p256Diff(xOut, xOut, &v) + p256Diff(xOut, xOut, &v) + + p256Diff(&tmp, &v, xOut) + p256Mul(yOut, &tmp, &r) + p256Mul(&tmp, y1, &j) + p256Diff(yOut, yOut, &tmp) + p256Diff(yOut, yOut, &tmp) +} + +// p256PointAdd sets {xOut,yOut,zOut} = {x1,y1,z1} + {x2,y2,z2}. +// +// See http://www.hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html#addition-add-2007-bl +// +// Note that this function does not handle P+P, infinity+P nor P+infinity +// correctly. +func p256PointAdd(xOut, yOut, zOut, x1, y1, z1, x2, y2, z2 *[p256Limbs]uint32) { + var z1z1, z1z1z1, z2z2, z2z2z2, s1, s2, u1, u2, h, i, j, r, rr, v, tmp [p256Limbs]uint32 + + p256Square(&z1z1, z1) + p256Square(&z2z2, z2) + p256Mul(&u1, x1, &z2z2) + + p256Sum(&tmp, z1, z2) + p256Square(&tmp, &tmp) + p256Diff(&tmp, &tmp, &z1z1) + p256Diff(&tmp, &tmp, &z2z2) + + p256Mul(&z2z2z2, z2, &z2z2) + p256Mul(&s1, y1, &z2z2z2) + + p256Mul(&u2, x2, &z1z1) + p256Mul(&z1z1z1, z1, &z1z1) + p256Mul(&s2, y2, &z1z1z1) + p256Diff(&h, &u2, &u1) + p256Sum(&i, &h, &h) + p256Square(&i, &i) + p256Mul(&j, &h, &i) + p256Diff(&r, &s2, &s1) + p256Sum(&r, &r, &r) + p256Mul(&v, &u1, &i) + + p256Mul(zOut, &tmp, &h) + p256Square(&rr, &r) + p256Diff(xOut, &rr, &j) + p256Diff(xOut, xOut, &v) + p256Diff(xOut, xOut, &v) + + p256Diff(&tmp, &v, xOut) + p256Mul(yOut, &tmp, &r) + p256Mul(&tmp, &s1, &j) + p256Diff(yOut, yOut, &tmp) + p256Diff(yOut, yOut, &tmp) +} + +// p256CopyConditional sets out=in if mask = 0xffffffff in constant time. +// +// On entry: mask is either 0 or 0xffffffff. +func p256CopyConditional(out, in *[p256Limbs]uint32, mask uint32) { + for i := 0; i < p256Limbs; i++ { + tmp := mask & (in[i] ^ out[i]) + out[i] ^= tmp + } +} + +// p256SelectAffinePoint sets {out_x,out_y} to the index'th entry of table. +// On entry: index < 16, table[0] must be zero. +func p256SelectAffinePoint(xOut, yOut *[p256Limbs]uint32, table []uint32, index uint32) { + for i := range xOut { + xOut[i] = 0 + } + for i := range yOut { + yOut[i] = 0 + } + + for i := uint32(1); i < 16; i++ { + mask := i ^ index + mask |= mask >> 2 + mask |= mask >> 1 + mask &= 1 + mask-- + for j := range xOut { + xOut[j] |= table[0] & mask + table = table[1:] + } + for j := range yOut { + yOut[j] |= table[0] & mask + table = table[1:] + } + } +} + +// p256SelectJacobianPoint sets {out_x,out_y,out_z} to the index'th entry of +// table. +// On entry: index < 16, table[0] must be zero. +func p256SelectJacobianPoint(xOut, yOut, zOut *[p256Limbs]uint32, table *[16][3][p256Limbs]uint32, index uint32) { + for i := range xOut { + xOut[i] = 0 + } + for i := range yOut { + yOut[i] = 0 + } + for i := range zOut { + zOut[i] = 0 + } + + // The implicit value at index 0 is all zero. We don't need to perform that + // iteration of the loop because we already set out_* to zero. + for i := uint32(1); i < 16; i++ { + mask := i ^ index + mask |= mask >> 2 + mask |= mask >> 1 + mask &= 1 + mask-- + for j := range xOut { + xOut[j] |= table[i][0][j] & mask + } + for j := range yOut { + yOut[j] |= table[i][1][j] & mask + } + for j := range zOut { + zOut[j] |= table[i][2][j] & mask + } + } +} + +// p256GetBit returns the bit'th bit of scalar. +func p256GetBit(scalar *[32]uint8, bit uint) uint32 { + return uint32(((scalar[bit>>3]) >> (bit & 7)) & 1) +} + +// p256ScalarBaseMult sets {xOut,yOut,zOut} = scalar*G where scalar is a +// little-endian number. Note that the value of scalar must be less than the +// order of the group. +func p256ScalarBaseMult(xOut, yOut, zOut *[p256Limbs]uint32, scalar *[32]uint8) { + nIsInfinityMask := ^uint32(0) + var pIsNoninfiniteMask, mask, tableOffset uint32 + var px, py, tx, ty, tz [p256Limbs]uint32 + + for i := range xOut { + xOut[i] = 0 + } + for i := range yOut { + yOut[i] = 0 + } + for i := range zOut { + zOut[i] = 0 + } + + // The loop adds bits at positions 0, 64, 128 and 192, followed by + // positions 32,96,160 and 224 and does this 32 times. + for i := uint(0); i < 32; i++ { + if i != 0 { + p256PointDouble(xOut, yOut, zOut, xOut, yOut, zOut) + } + tableOffset = 0 + for j := uint(0); j <= 32; j += 32 { + bit0 := p256GetBit(scalar, 31-i+j) + bit1 := p256GetBit(scalar, 95-i+j) + bit2 := p256GetBit(scalar, 159-i+j) + bit3 := p256GetBit(scalar, 223-i+j) + index := bit0 | (bit1 << 1) | (bit2 << 2) | (bit3 << 3) + + p256SelectAffinePoint(&px, &py, p256Precomputed[tableOffset:], index) + tableOffset += 30 * p256Limbs + + // Since scalar is less than the order of the group, we know that + // {xOut,yOut,zOut} != {px,py,1}, unless both are zero, which we handle + // below. + p256PointAddMixed(&tx, &ty, &tz, xOut, yOut, zOut, &px, &py) + // The result of pointAddMixed is incorrect if {xOut,yOut,zOut} is zero + // (a.k.a. the point at infinity). We handle that situation by + // copying the point from the table. + p256CopyConditional(xOut, &px, nIsInfinityMask) + p256CopyConditional(yOut, &py, nIsInfinityMask) + p256CopyConditional(zOut, &p256One, nIsInfinityMask) + + // Equally, the result is also wrong if the point from the table is + // zero, which happens when the index is zero. We handle that by + // only copying from {tx,ty,tz} to {xOut,yOut,zOut} if index != 0. + pIsNoninfiniteMask = nonZeroToAllOnes(index) + mask = pIsNoninfiniteMask & ^nIsInfinityMask + p256CopyConditional(xOut, &tx, mask) + p256CopyConditional(yOut, &ty, mask) + p256CopyConditional(zOut, &tz, mask) + // If p was not zero, then n is now non-zero. + nIsInfinityMask &= ^pIsNoninfiniteMask + } + } +} + +// p256PointToAffine converts a Jacobian point to an affine point. If the input +// is the point at infinity then it returns (0, 0) in constant time. +func p256PointToAffine(xOut, yOut, x, y, z *[p256Limbs]uint32) { + var zInv, zInvSq [p256Limbs]uint32 + + p256Invert(&zInv, z) + p256Square(&zInvSq, &zInv) + p256Mul(xOut, x, &zInvSq) + p256Mul(&zInv, &zInv, &zInvSq) + p256Mul(yOut, y, &zInv) +} + +// p256ToAffine returns a pair of *big.Int containing the affine representation +// of {x,y,z}. +func p256ToAffine(x, y, z *[p256Limbs]uint32) (xOut, yOut *big.Int) { + var xx, yy [p256Limbs]uint32 + p256PointToAffine(&xx, &yy, x, y, z) + return p256ToBig(&xx), p256ToBig(&yy) +} + +// p256ScalarMult sets {xOut,yOut,zOut} = scalar*{x,y}. +func p256ScalarMult(xOut, yOut, zOut, x, y *[p256Limbs]uint32, scalar *[32]uint8) { + var px, py, pz, tx, ty, tz [p256Limbs]uint32 + var precomp [16][3][p256Limbs]uint32 + var nIsInfinityMask, index, pIsNoninfiniteMask, mask uint32 + + // We precompute 0,1,2,... times {x,y}. + precomp[1][0] = *x + precomp[1][1] = *y + precomp[1][2] = p256One + + for i := 2; i < 16; i += 2 { + p256PointDouble(&precomp[i][0], &precomp[i][1], &precomp[i][2], &precomp[i/2][0], &precomp[i/2][1], &precomp[i/2][2]) + p256PointAddMixed(&precomp[i+1][0], &precomp[i+1][1], &precomp[i+1][2], &precomp[i][0], &precomp[i][1], &precomp[i][2], x, y) + } + + for i := range xOut { + xOut[i] = 0 + } + for i := range yOut { + yOut[i] = 0 + } + for i := range zOut { + zOut[i] = 0 + } + nIsInfinityMask = ^uint32(0) + + // We add in a window of four bits each iteration and do this 64 times. + for i := 0; i < 64; i++ { + if i != 0 { + p256PointDouble(xOut, yOut, zOut, xOut, yOut, zOut) + p256PointDouble(xOut, yOut, zOut, xOut, yOut, zOut) + p256PointDouble(xOut, yOut, zOut, xOut, yOut, zOut) + p256PointDouble(xOut, yOut, zOut, xOut, yOut, zOut) + } + + index = uint32(scalar[31-i/2]) + if (i & 1) == 1 { + index &= 15 + } else { + index >>= 4 + } + + // See the comments in scalarBaseMult about handling infinities. + p256SelectJacobianPoint(&px, &py, &pz, &precomp, index) + p256PointAdd(&tx, &ty, &tz, xOut, yOut, zOut, &px, &py, &pz) + p256CopyConditional(xOut, &px, nIsInfinityMask) + p256CopyConditional(yOut, &py, nIsInfinityMask) + p256CopyConditional(zOut, &pz, nIsInfinityMask) + + pIsNoninfiniteMask = nonZeroToAllOnes(index) + mask = pIsNoninfiniteMask & ^nIsInfinityMask + p256CopyConditional(xOut, &tx, mask) + p256CopyConditional(yOut, &ty, mask) + p256CopyConditional(zOut, &tz, mask) + nIsInfinityMask &= ^pIsNoninfiniteMask + } +} + +// p256FromBig sets out = R*in. +func p256FromBig(out *[p256Limbs]uint32, in *big.Int) { + tmp := new(big.Int).Lsh(in, 257) + tmp.Mod(tmp, p256.P) + + for i := 0; i < p256Limbs; i++ { + if bits := tmp.Bits(); len(bits) > 0 { + out[i] = uint32(bits[0]) & bottom29Bits + } else { + out[i] = 0 + } + tmp.Rsh(tmp, 29) + + i++ + if i == p256Limbs { + break + } + + if bits := tmp.Bits(); len(bits) > 0 { + out[i] = uint32(bits[0]) & bottom28Bits + } else { + out[i] = 0 + } + tmp.Rsh(tmp, 28) + } +} + +// p256ToBig returns a *big.Int containing the value of in. +func p256ToBig(in *[p256Limbs]uint32) *big.Int { + result, tmp := new(big.Int), new(big.Int) + + result.SetInt64(int64(in[p256Limbs-1])) + for i := p256Limbs - 2; i >= 0; i-- { + if (i & 1) == 0 { + result.Lsh(result, 29) + } else { + result.Lsh(result, 28) + } + tmp.SetInt64(int64(in[i])) + result.Add(result, tmp) + } + + result.Mul(result, p256RInverse) + result.Mod(result, p256.P) + return result +} diff --git a/src/crypto/hmac/hmac.go b/src/crypto/hmac/hmac.go new file mode 100644 index 0000000000000000000000000000000000000000..e0cc1d6d2241331c02f2fd489e4c5efff5fb2c52 --- /dev/null +++ b/src/crypto/hmac/hmac.go @@ -0,0 +1,102 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +/* +Package hmac implements the Keyed-Hash Message Authentication Code (HMAC) as +defined in U.S. Federal Information Processing Standards Publication 198. +An HMAC is a cryptographic hash that uses a key to sign a message. +The receiver verifies the hash by recomputing it using the same key. + +Receivers should be careful to use Equal to compare MACs in order to avoid +timing side-channels: + + // CheckMAC reports whether messageMAC is a valid HMAC tag for message. + func CheckMAC(message, messageMAC, key []byte) bool { + mac := hmac.New(sha256.New, key) + mac.Write(message) + expectedMAC := mac.Sum(nil) + return hmac.Equal(messageMAC, expectedMAC) + } +*/ +package hmac + +import ( + "crypto/subtle" + "hash" +) + +// FIPS 198: +// http://csrc.nist.gov/publications/fips/fips198/fips-198a.pdf + +// key is zero padded to the block size of the hash function +// ipad = 0x36 byte repeated for key length +// opad = 0x5c byte repeated for key length +// hmac = H([key ^ opad] H([key ^ ipad] text)) + +type hmac struct { + size int + blocksize int + key, tmp []byte + outer, inner hash.Hash +} + +func (h *hmac) tmpPad(xor byte) { + for i, k := range h.key { + h.tmp[i] = xor ^ k + } + for i := len(h.key); i < h.blocksize; i++ { + h.tmp[i] = xor + } +} + +func (h *hmac) Sum(in []byte) []byte { + origLen := len(in) + in = h.inner.Sum(in) + h.tmpPad(0x5c) + copy(h.tmp[h.blocksize:], in[origLen:]) + h.outer.Reset() + h.outer.Write(h.tmp) + return h.outer.Sum(in[:origLen]) +} + +func (h *hmac) Write(p []byte) (n int, err error) { + return h.inner.Write(p) +} + +func (h *hmac) Size() int { return h.size } + +func (h *hmac) BlockSize() int { return h.blocksize } + +func (h *hmac) Reset() { + h.inner.Reset() + h.tmpPad(0x36) + h.inner.Write(h.tmp[:h.blocksize]) +} + +// New returns a new HMAC hash using the given hash.Hash type and key. +func New(h func() hash.Hash, key []byte) hash.Hash { + hm := new(hmac) + hm.outer = h() + hm.inner = h() + hm.size = hm.inner.Size() + hm.blocksize = hm.inner.BlockSize() + hm.tmp = make([]byte, hm.blocksize+hm.size) + if len(key) > hm.blocksize { + // If key is too big, hash it. + hm.outer.Write(key) + key = hm.outer.Sum(nil) + } + hm.key = make([]byte, len(key)) + copy(hm.key, key) + hm.Reset() + return hm +} + +// Equal compares two MACs for equality without leaking timing information. +func Equal(mac1, mac2 []byte) bool { + // We don't have to be constant time if the lengths of the MACs are + // different as that suggests that a completely different hash function + // was used. + return len(mac1) == len(mac2) && subtle.ConstantTimeCompare(mac1, mac2) == 1 +} diff --git a/src/crypto/hmac/hmac_test.go b/src/crypto/hmac/hmac_test.go new file mode 100644 index 0000000000000000000000000000000000000000..e80b7e0baa0d01faf99ac4c24ccba306f4ab7666 --- /dev/null +++ b/src/crypto/hmac/hmac_test.go @@ -0,0 +1,570 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package hmac + +import ( + "crypto/md5" + "crypto/sha1" + "crypto/sha256" + "crypto/sha512" + "fmt" + "hash" + "testing" +) + +type hmacTest struct { + hash func() hash.Hash + key []byte + in []byte + out string + size int + blocksize int +} + +var hmacTests = []hmacTest{ + // Tests from US FIPS 198 + // http://csrc.nist.gov/publications/fips/fips198/fips-198a.pdf + { + sha1.New, + []byte{ + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, + 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, + 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, + 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, + 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, + 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, + 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, + }, + []byte("Sample #1"), + "4f4ca3d5d68ba7cc0a1208c9c61e9c5da0403c0a", + sha1.Size, + sha1.BlockSize, + }, + { + sha1.New, + []byte{ + 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, + 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, + 0x40, 0x41, 0x42, 0x43, + }, + []byte("Sample #2"), + "0922d3405faa3d194f82a45830737d5cc6c75d24", + sha1.Size, + sha1.BlockSize, + }, + { + sha1.New, + []byte{ + 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, + 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, + 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, + 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, + 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, + 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, + 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, + 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, + 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, + 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, + 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, + 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, + 0xb0, 0xb1, 0xb2, 0xb3, + }, + []byte("Sample #3"), + "bcf41eab8bb2d802f3d05caf7cb092ecf8d1a3aa", + sha1.Size, + sha1.BlockSize, + }, + + // Test from Plan 9. + { + md5.New, + []byte("Jefe"), + []byte("what do ya want for nothing?"), + "750c783e6ab0b503eaa86e310a5db738", + md5.Size, + md5.BlockSize, + }, + + // Tests from RFC 4231 + { + sha256.New, + []byte{ + 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, + 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, + 0x0b, 0x0b, 0x0b, 0x0b, + }, + []byte("Hi There"), + "b0344c61d8db38535ca8afceaf0bf12b881dc200c9833da726e9376c2e32cff7", + sha256.Size, + sha256.BlockSize, + }, + { + sha256.New, + []byte("Jefe"), + []byte("what do ya want for nothing?"), + "5bdcc146bf60754e6a042426089575c75a003f089d2739839dec58b964ec3843", + sha256.Size, + sha256.BlockSize, + }, + { + sha256.New, + []byte{ + 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, + 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, + 0xaa, 0xaa, 0xaa, 0xaa, + }, + []byte{ + 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, + 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, + 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, + 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, + 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, + 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, 0xdd, + 0xdd, 0xdd, + }, + "773ea91e36800e46854db8ebd09181a72959098b3ef8c122d9635514ced565fe", + sha256.Size, + sha256.BlockSize, + }, + { + sha256.New, + []byte{ + 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, + 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, + 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, + 0x19, + }, + []byte{ + 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, + 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, + 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, + 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, + 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, + 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, + 0xcd, 0xcd, + }, + "82558a389a443c0ea4cc819899f2083a85f0faa3e578f8077a2e3ff46729665b", + sha256.Size, + sha256.BlockSize, + }, + { + sha256.New, + []byte{ + 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, + 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, + 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, + 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, + 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, + 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, + 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, + 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, + 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, + 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, + 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, + 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, + 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, + 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, + 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, + 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, + 0xaa, 0xaa, 0xaa, + }, + []byte("Test Using Larger Than Block-Size Key - Hash Key First"), + "60e431591ee0b67f0d8a26aacbf5b77f8e0bc6213728c5140546040f0ee37f54", + sha256.Size, + sha256.BlockSize, + }, + { + sha256.New, + []byte{ + 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, + 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, + 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, + 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, + 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, + 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, + 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, + 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, + 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, + 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, + 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, + 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, + 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, + 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, + 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, + 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, + 0xaa, 0xaa, 0xaa, + }, + []byte("This is a test using a larger than block-size key " + + "and a larger than block-size data. The key needs to " + + "be hashed before being used by the HMAC algorithm."), + "9b09ffa71b942fcb27635fbcd5b0e944bfdc63644f0713938a7f51535c3a35e2", + sha256.Size, + sha256.BlockSize, + }, + + // Tests from http://csrc.nist.gov/groups/ST/toolkit/examples.html + // (truncated tag tests are left out) + { + sha1.New, + []byte{ + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, + 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, + 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, + 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, + 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, + 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, + 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, + }, + []byte("Sample message for keylen=blocklen"), + "5fd596ee78d5553c8ff4e72d266dfd192366da29", + sha1.Size, + sha1.BlockSize, + }, + { + sha1.New, + []byte{ + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, + 0x10, 0x11, 0x12, 0x13, + }, + []byte("Sample message for keylen= chunk { + aa, bb, cc, dd := a, b, c, d + + // This is a constant condition - it is not evaluated on each iteration. + if x86 { + // MD5 was designed so that x86 processors can just iterate + // over the block data directly as uint32s, and we generate + // less code and run 1.3x faster if we take advantage of that. + // My apologies. + X = (*[16]uint32)(unsafe.Pointer(&p[0])) + } else if littleEndian && uintptr(unsafe.Pointer(&p[0]))&(unsafe.Alignof(uint32(0))-1) == 0 { + X = (*[16]uint32)(unsafe.Pointer(&p[0])) + } else { + X = &xbuf + j := 0 + for i := 0; i < 16; i++ { + X[i&15] = uint32(p[j]) | uint32(p[j+1])<<8 | uint32(p[j+2])<<16 | uint32(p[j+3])<<24 + j += 4 + } + } + + {{if .Full}} + // Round 1. + {{range $i, $s := dup 4 .Shift1}} + {{index $.Table1 $i | printf "a += (((c^d)&b)^d) + X[%d] + %d" $i | relabel}} + {{printf "a = a<<%d | a>>(32-%d) + b" $s $s | relabel}} + {{rotate}} + {{end}} + + // Round 2. + {{range $i, $s := dup 4 .Shift2}} + {{index $.Table2 $i | printf "a += (((b^c)&d)^c) + X[(1+5*%d)&15] + %d" $i | relabel}} + {{printf "a = a<<%d | a>>(32-%d) + b" $s $s | relabel}} + {{rotate}} + {{end}} + + // Round 3. + {{range $i, $s := dup 4 .Shift3}} + {{index $.Table3 $i | printf "a += (b^c^d) + X[(5+3*%d)&15] + %d" $i | relabel}} + {{printf "a = a<<%d | a>>(32-%d) + b" $s $s | relabel}} + {{rotate}} + {{end}} + + // Round 4. + {{range $i, $s := dup 4 .Shift4}} + {{index $.Table4 $i | printf "a += (c^(b|^d)) + X[(7*%d)&15] + %d" $i | relabel}} + {{printf "a = a<<%d | a>>(32-%d) + b" $s $s | relabel}} + {{rotate}} + {{end}} + {{else}} + // Round 1. + for i := uint(0); i < 16; { + {{range $s := .Shift1}} + {{printf "a += (((c^d)&b)^d) + X[i&15] + t1[i&15]" | relabel}} + {{printf "a = a<<%d | a>>(32-%d) + b" $s $s | relabel}} + i++ + {{rotate}} + {{end}} + } + + // Round 2. + for i := uint(0); i < 16; { + {{range $s := .Shift2}} + {{printf "a += (((b^c)&d)^c) + X[(1+5*i)&15] + t2[i&15]" | relabel}} + {{printf "a = a<<%d | a>>(32-%d) + b" $s $s | relabel}} + i++ + {{rotate}} + {{end}} + } + + // Round 3. + for i := uint(0); i < 16; { + {{range $s := .Shift3}} + {{printf "a += (b^c^d) + X[(5+3*i)&15] + t3[i&15]" | relabel}} + {{printf "a = a<<%d | a>>(32-%d) + b" $s $s | relabel}} + i++ + {{rotate}} + {{end}} + } + + // Round 4. + for i := uint(0); i < 16; { + {{range $s := .Shift4}} + {{printf "a += (c^(b|^d)) + X[(7*i)&15] + t4[i&15]" | relabel}} + {{printf "a = a<<%d | a>>(32-%d) + b" $s $s | relabel}} + i++ + {{rotate}} + {{end}} + } + {{end}} + + a += aa + b += bb + c += cc + d += dd + + p = p[chunk:] + } + + dig.s[0] = a + dig.s[1] = b + dig.s[2] = c + dig.s[3] = d +} +` diff --git a/src/crypto/md5/md5.go b/src/crypto/md5/md5.go new file mode 100644 index 0000000000000000000000000000000000000000..8c50c6d0bfaa7db920a48988ae5af5ecff7dd411 --- /dev/null +++ b/src/crypto/md5/md5.go @@ -0,0 +1,136 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:generate go run gen.go -full -output md5block.go + +// Package md5 implements the MD5 hash algorithm as defined in RFC 1321. +package md5 + +import ( + "crypto" + "hash" +) + +func init() { + crypto.RegisterHash(crypto.MD5, New) +} + +// The size of an MD5 checksum in bytes. +const Size = 16 + +// The blocksize of MD5 in bytes. +const BlockSize = 64 + +const ( + chunk = 64 + init0 = 0x67452301 + init1 = 0xEFCDAB89 + init2 = 0x98BADCFE + init3 = 0x10325476 +) + +// digest represents the partial evaluation of a checksum. +type digest struct { + s [4]uint32 + x [chunk]byte + nx int + len uint64 +} + +func (d *digest) Reset() { + d.s[0] = init0 + d.s[1] = init1 + d.s[2] = init2 + d.s[3] = init3 + d.nx = 0 + d.len = 0 +} + +// New returns a new hash.Hash computing the MD5 checksum. +func New() hash.Hash { + d := new(digest) + d.Reset() + return d +} + +func (d *digest) Size() int { return Size } + +func (d *digest) BlockSize() int { return BlockSize } + +func (d *digest) Write(p []byte) (nn int, err error) { + nn = len(p) + d.len += uint64(nn) + if d.nx > 0 { + n := len(p) + if n > chunk-d.nx { + n = chunk - d.nx + } + for i := 0; i < n; i++ { + d.x[d.nx+i] = p[i] + } + d.nx += n + if d.nx == chunk { + block(d, d.x[0:chunk]) + d.nx = 0 + } + p = p[n:] + } + if len(p) >= chunk { + n := len(p) &^ (chunk - 1) + block(d, p[:n]) + p = p[n:] + } + if len(p) > 0 { + d.nx = copy(d.x[:], p) + } + return +} + +func (d0 *digest) Sum(in []byte) []byte { + // Make a copy of d0 so that caller can keep writing and summing. + d := *d0 + hash := d.checkSum() + return append(in, hash[:]...) +} + +func (d *digest) checkSum() [Size]byte { + // Padding. Add a 1 bit and 0 bits until 56 bytes mod 64. + len := d.len + var tmp [64]byte + tmp[0] = 0x80 + if len%64 < 56 { + d.Write(tmp[0 : 56-len%64]) + } else { + d.Write(tmp[0 : 64+56-len%64]) + } + + // Length in bits. + len <<= 3 + for i := uint(0); i < 8; i++ { + tmp[i] = byte(len >> (8 * i)) + } + d.Write(tmp[0:8]) + + if d.nx != 0 { + panic("d.nx != 0") + } + + var digest [Size]byte + for i, s := range d.s { + digest[i*4] = byte(s) + digest[i*4+1] = byte(s >> 8) + digest[i*4+2] = byte(s >> 16) + digest[i*4+3] = byte(s >> 24) + } + + return digest +} + +// Sum returns the MD5 checksum of the data. +func Sum(data []byte) [Size]byte { + var d digest + d.Reset() + d.Write(data) + return d.checkSum() +} diff --git a/src/crypto/md5/md5_test.go b/src/crypto/md5/md5_test.go new file mode 100644 index 0000000000000000000000000000000000000000..e7faf4961e43cce6c96c515bd38b39c0a874719d --- /dev/null +++ b/src/crypto/md5/md5_test.go @@ -0,0 +1,163 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package md5 + +import ( + "crypto/rand" + "fmt" + "io" + "testing" + "unsafe" +) + +type md5Test struct { + out string + in string +} + +var golden = []md5Test{ + {"d41d8cd98f00b204e9800998ecf8427e", ""}, + {"0cc175b9c0f1b6a831c399e269772661", "a"}, + {"187ef4436122d1cc2f40dc2b92f0eba0", "ab"}, + {"900150983cd24fb0d6963f7d28e17f72", "abc"}, + {"e2fc714c4727ee9395f324cd2e7f331f", "abcd"}, + {"ab56b4d92b40713acc5af89985d4b786", "abcde"}, + {"e80b5017098950fc58aad83c8c14978e", "abcdef"}, + {"7ac66c0f148de9519b8bd264312c4d64", "abcdefg"}, + {"e8dc4081b13434b45189a720b77b6818", "abcdefgh"}, + {"8aa99b1f439ff71293e95357bac6fd94", "abcdefghi"}, + {"a925576942e94b2ef57a066101b48876", "abcdefghij"}, + {"d747fc1719c7eacb84058196cfe56d57", "Discard medicine more than two years old."}, + {"bff2dcb37ef3a44ba43ab144768ca837", "He who has a shady past knows that nice guys finish last."}, + {"0441015ecb54a7342d017ed1bcfdbea5", "I wouldn't marry him with a ten foot pole."}, + {"9e3cac8e9e9757a60c3ea391130d3689", "Free! Free!/A trip/to Mars/for 900/empty jars/Burma Shave"}, + {"a0f04459b031f916a59a35cc482dc039", "The days of the digital watch are numbered. -Tom Stoppard"}, + {"e7a48e0fe884faf31475d2a04b1362cc", "Nepal premier won't resign."}, + {"637d2fe925c07c113800509964fb0e06", "For every action there is an equal and opposite government program."}, + {"834a8d18d5c6562119cf4c7f5086cb71", "His money is twice tainted: 'taint yours and 'taint mine."}, + {"de3a4d2fd6c73ec2db2abad23b444281", "There is no reason for any individual to have a computer in their home. -Ken Olsen, 1977"}, + {"acf203f997e2cf74ea3aff86985aefaf", "It's a tiny change to the code and not completely disgusting. - Bob Manchek"}, + {"e1c1384cb4d2221dfdd7c795a4222c9a", "size: a.out: bad magic"}, + {"c90f3ddecc54f34228c063d7525bf644", "The major problem is with sendmail. -Mark Horton"}, + {"cdf7ab6c1fd49bd9933c43f3ea5af185", "Give me a rock, paper and scissors and I will move the world. CCFestoon"}, + {"83bc85234942fc883c063cbd7f0ad5d0", "If the enemy is within range, then so are you."}, + {"277cbe255686b48dd7e8f389394d9299", "It's well we cannot hear the screams/That we create in others' dreams."}, + {"fd3fb0a7ffb8af16603f3d3af98f8e1f", "You remind me of a TV show, but that's all right: I watch it anyway."}, + {"469b13a78ebf297ecda64d4723655154", "C is as portable as Stonehedge!!"}, + {"63eb3a2f466410104731c4b037600110", "Even if I could be Shakespeare, I think I should still choose to be Faraday. - A. Huxley"}, + {"72c2ed7592debca1c90fc0100f931a2f", "The fugacity of a constituent in a mixture of gases at a given temperature is proportional to its mole fraction. Lewis-Randall Rule"}, + {"132f7619d33b523b1d9e5bd8e0928355", "How can you write a big system without C++? -Paul Glick"}, +} + +func TestGolden(t *testing.T) { + for i := 0; i < len(golden); i++ { + g := golden[i] + s := fmt.Sprintf("%x", Sum([]byte(g.in))) + if s != g.out { + t.Fatalf("Sum function: md5(%s) = %s want %s", g.in, s, g.out) + } + c := New() + buf := make([]byte, len(g.in)+4) + for j := 0; j < 3+4; j++ { + if j < 2 { + io.WriteString(c, g.in) + } else if j == 2 { + io.WriteString(c, g.in[0:len(g.in)/2]) + c.Sum(nil) + io.WriteString(c, g.in[len(g.in)/2:]) + } else if j > 2 { + // test unaligned write + buf = buf[1:] + copy(buf, g.in) + c.Write(buf[:len(g.in)]) + } + s := fmt.Sprintf("%x", c.Sum(nil)) + if s != g.out { + t.Fatalf("md5[%d](%s) = %s want %s", j, g.in, s, g.out) + } + c.Reset() + } + } +} + +func TestLarge(t *testing.T) { + const N = 10000 + ok := "2bb571599a4180e1d542f76904adc3df" // md5sum of "0123456789" * 1000 + block := make([]byte, 10004) + c := New() + for offset := 0; offset < 4; offset++ { + for i := 0; i < N; i++ { + block[offset+i] = '0' + byte(i%10) + } + for blockSize := 10; blockSize <= N; blockSize *= 10 { + blocks := N / blockSize + b := block[offset : offset+blockSize] + c.Reset() + for i := 0; i < blocks; i++ { + c.Write(b) + } + s := fmt.Sprintf("%x", c.Sum(nil)) + if s != ok { + t.Fatalf("md5 TestLarge offset=%d, blockSize=%d = %s want %s", offset, blockSize, s, ok) + } + } + } +} + +// Tests that blockGeneric (pure Go) and block (in assembly for amd64, 386, arm) match. +func TestBlockGeneric(t *testing.T) { + gen, asm := New().(*digest), New().(*digest) + buf := make([]byte, BlockSize*20) // arbitrary factor + rand.Read(buf) + blockGeneric(gen, buf) + block(asm, buf) + if *gen != *asm { + t.Error("block and blockGeneric resulted in different states") + } +} + +var bench = New() +var buf = make([]byte, 8192+1) +var sum = make([]byte, bench.Size()) + +func benchmarkSize(b *testing.B, size int, unaligned bool) { + b.SetBytes(int64(size)) + buf := buf + if unaligned { + if uintptr(unsafe.Pointer(&buf[0]))&(unsafe.Alignof(uint32(0))-1) == 0 { + buf = buf[1:] + } + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + bench.Reset() + bench.Write(buf[:size]) + bench.Sum(sum[:0]) + } +} + +func BenchmarkHash8Bytes(b *testing.B) { + benchmarkSize(b, 8, false) +} + +func BenchmarkHash1K(b *testing.B) { + benchmarkSize(b, 1024, false) +} + +func BenchmarkHash8K(b *testing.B) { + benchmarkSize(b, 8192, false) +} + +func BenchmarkHash8BytesUnaligned(b *testing.B) { + benchmarkSize(b, 8, true) +} + +func BenchmarkHash1KUnaligned(b *testing.B) { + benchmarkSize(b, 1024, true) +} + +func BenchmarkHash8KUnaligned(b *testing.B) { + benchmarkSize(b, 8192, true) +} diff --git a/src/crypto/md5/md5block.go b/src/crypto/md5/md5block.go new file mode 100644 index 0000000000000000000000000000000000000000..64e1e7c1efdb15e8c06dce73f87f1cedaccea99e --- /dev/null +++ b/src/crypto/md5/md5block.go @@ -0,0 +1,265 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// DO NOT EDIT. +// Generate with: go run gen.go -full -output md5block.go + +package md5 + +import ( + "runtime" + "unsafe" +) + +const x86 = runtime.GOARCH == "amd64" || runtime.GOARCH == "386" + +var littleEndian bool + +func init() { + x := uint32(0x04030201) + y := [4]byte{0x1, 0x2, 0x3, 0x4} + littleEndian = *(*[4]byte)(unsafe.Pointer(&x)) == y +} + +func blockGeneric(dig *digest, p []byte) { + a := dig.s[0] + b := dig.s[1] + c := dig.s[2] + d := dig.s[3] + var X *[16]uint32 + var xbuf [16]uint32 + for len(p) >= chunk { + aa, bb, cc, dd := a, b, c, d + + // This is a constant condition - it is not evaluated on each iteration. + if x86 { + // MD5 was designed so that x86 processors can just iterate + // over the block data directly as uint32s, and we generate + // less code and run 1.3x faster if we take advantage of that. + // My apologies. + X = (*[16]uint32)(unsafe.Pointer(&p[0])) + } else if littleEndian && uintptr(unsafe.Pointer(&p[0]))&(unsafe.Alignof(uint32(0))-1) == 0 { + X = (*[16]uint32)(unsafe.Pointer(&p[0])) + } else { + X = &xbuf + j := 0 + for i := 0; i < 16; i++ { + X[i&15] = uint32(p[j]) | uint32(p[j+1])<<8 | uint32(p[j+2])<<16 | uint32(p[j+3])<<24 + j += 4 + } + } + + // Round 1. + + a += (((c ^ d) & b) ^ d) + X[0] + 3614090360 + a = a<<7 | a>>(32-7) + b + + d += (((b ^ c) & a) ^ c) + X[1] + 3905402710 + d = d<<12 | d>>(32-12) + a + + c += (((a ^ b) & d) ^ b) + X[2] + 606105819 + c = c<<17 | c>>(32-17) + d + + b += (((d ^ a) & c) ^ a) + X[3] + 3250441966 + b = b<<22 | b>>(32-22) + c + + a += (((c ^ d) & b) ^ d) + X[4] + 4118548399 + a = a<<7 | a>>(32-7) + b + + d += (((b ^ c) & a) ^ c) + X[5] + 1200080426 + d = d<<12 | d>>(32-12) + a + + c += (((a ^ b) & d) ^ b) + X[6] + 2821735955 + c = c<<17 | c>>(32-17) + d + + b += (((d ^ a) & c) ^ a) + X[7] + 4249261313 + b = b<<22 | b>>(32-22) + c + + a += (((c ^ d) & b) ^ d) + X[8] + 1770035416 + a = a<<7 | a>>(32-7) + b + + d += (((b ^ c) & a) ^ c) + X[9] + 2336552879 + d = d<<12 | d>>(32-12) + a + + c += (((a ^ b) & d) ^ b) + X[10] + 4294925233 + c = c<<17 | c>>(32-17) + d + + b += (((d ^ a) & c) ^ a) + X[11] + 2304563134 + b = b<<22 | b>>(32-22) + c + + a += (((c ^ d) & b) ^ d) + X[12] + 1804603682 + a = a<<7 | a>>(32-7) + b + + d += (((b ^ c) & a) ^ c) + X[13] + 4254626195 + d = d<<12 | d>>(32-12) + a + + c += (((a ^ b) & d) ^ b) + X[14] + 2792965006 + c = c<<17 | c>>(32-17) + d + + b += (((d ^ a) & c) ^ a) + X[15] + 1236535329 + b = b<<22 | b>>(32-22) + c + + // Round 2. + + a += (((b ^ c) & d) ^ c) + X[(1+5*0)&15] + 4129170786 + a = a<<5 | a>>(32-5) + b + + d += (((a ^ b) & c) ^ b) + X[(1+5*1)&15] + 3225465664 + d = d<<9 | d>>(32-9) + a + + c += (((d ^ a) & b) ^ a) + X[(1+5*2)&15] + 643717713 + c = c<<14 | c>>(32-14) + d + + b += (((c ^ d) & a) ^ d) + X[(1+5*3)&15] + 3921069994 + b = b<<20 | b>>(32-20) + c + + a += (((b ^ c) & d) ^ c) + X[(1+5*4)&15] + 3593408605 + a = a<<5 | a>>(32-5) + b + + d += (((a ^ b) & c) ^ b) + X[(1+5*5)&15] + 38016083 + d = d<<9 | d>>(32-9) + a + + c += (((d ^ a) & b) ^ a) + X[(1+5*6)&15] + 3634488961 + c = c<<14 | c>>(32-14) + d + + b += (((c ^ d) & a) ^ d) + X[(1+5*7)&15] + 3889429448 + b = b<<20 | b>>(32-20) + c + + a += (((b ^ c) & d) ^ c) + X[(1+5*8)&15] + 568446438 + a = a<<5 | a>>(32-5) + b + + d += (((a ^ b) & c) ^ b) + X[(1+5*9)&15] + 3275163606 + d = d<<9 | d>>(32-9) + a + + c += (((d ^ a) & b) ^ a) + X[(1+5*10)&15] + 4107603335 + c = c<<14 | c>>(32-14) + d + + b += (((c ^ d) & a) ^ d) + X[(1+5*11)&15] + 1163531501 + b = b<<20 | b>>(32-20) + c + + a += (((b ^ c) & d) ^ c) + X[(1+5*12)&15] + 2850285829 + a = a<<5 | a>>(32-5) + b + + d += (((a ^ b) & c) ^ b) + X[(1+5*13)&15] + 4243563512 + d = d<<9 | d>>(32-9) + a + + c += (((d ^ a) & b) ^ a) + X[(1+5*14)&15] + 1735328473 + c = c<<14 | c>>(32-14) + d + + b += (((c ^ d) & a) ^ d) + X[(1+5*15)&15] + 2368359562 + b = b<<20 | b>>(32-20) + c + + // Round 3. + + a += (b ^ c ^ d) + X[(5+3*0)&15] + 4294588738 + a = a<<4 | a>>(32-4) + b + + d += (a ^ b ^ c) + X[(5+3*1)&15] + 2272392833 + d = d<<11 | d>>(32-11) + a + + c += (d ^ a ^ b) + X[(5+3*2)&15] + 1839030562 + c = c<<16 | c>>(32-16) + d + + b += (c ^ d ^ a) + X[(5+3*3)&15] + 4259657740 + b = b<<23 | b>>(32-23) + c + + a += (b ^ c ^ d) + X[(5+3*4)&15] + 2763975236 + a = a<<4 | a>>(32-4) + b + + d += (a ^ b ^ c) + X[(5+3*5)&15] + 1272893353 + d = d<<11 | d>>(32-11) + a + + c += (d ^ a ^ b) + X[(5+3*6)&15] + 4139469664 + c = c<<16 | c>>(32-16) + d + + b += (c ^ d ^ a) + X[(5+3*7)&15] + 3200236656 + b = b<<23 | b>>(32-23) + c + + a += (b ^ c ^ d) + X[(5+3*8)&15] + 681279174 + a = a<<4 | a>>(32-4) + b + + d += (a ^ b ^ c) + X[(5+3*9)&15] + 3936430074 + d = d<<11 | d>>(32-11) + a + + c += (d ^ a ^ b) + X[(5+3*10)&15] + 3572445317 + c = c<<16 | c>>(32-16) + d + + b += (c ^ d ^ a) + X[(5+3*11)&15] + 76029189 + b = b<<23 | b>>(32-23) + c + + a += (b ^ c ^ d) + X[(5+3*12)&15] + 3654602809 + a = a<<4 | a>>(32-4) + b + + d += (a ^ b ^ c) + X[(5+3*13)&15] + 3873151461 + d = d<<11 | d>>(32-11) + a + + c += (d ^ a ^ b) + X[(5+3*14)&15] + 530742520 + c = c<<16 | c>>(32-16) + d + + b += (c ^ d ^ a) + X[(5+3*15)&15] + 3299628645 + b = b<<23 | b>>(32-23) + c + + // Round 4. + + a += (c ^ (b | ^d)) + X[(7*0)&15] + 4096336452 + a = a<<6 | a>>(32-6) + b + + d += (b ^ (a | ^c)) + X[(7*1)&15] + 1126891415 + d = d<<10 | d>>(32-10) + a + + c += (a ^ (d | ^b)) + X[(7*2)&15] + 2878612391 + c = c<<15 | c>>(32-15) + d + + b += (d ^ (c | ^a)) + X[(7*3)&15] + 4237533241 + b = b<<21 | b>>(32-21) + c + + a += (c ^ (b | ^d)) + X[(7*4)&15] + 1700485571 + a = a<<6 | a>>(32-6) + b + + d += (b ^ (a | ^c)) + X[(7*5)&15] + 2399980690 + d = d<<10 | d>>(32-10) + a + + c += (a ^ (d | ^b)) + X[(7*6)&15] + 4293915773 + c = c<<15 | c>>(32-15) + d + + b += (d ^ (c | ^a)) + X[(7*7)&15] + 2240044497 + b = b<<21 | b>>(32-21) + c + + a += (c ^ (b | ^d)) + X[(7*8)&15] + 1873313359 + a = a<<6 | a>>(32-6) + b + + d += (b ^ (a | ^c)) + X[(7*9)&15] + 4264355552 + d = d<<10 | d>>(32-10) + a + + c += (a ^ (d | ^b)) + X[(7*10)&15] + 2734768916 + c = c<<15 | c>>(32-15) + d + + b += (d ^ (c | ^a)) + X[(7*11)&15] + 1309151649 + b = b<<21 | b>>(32-21) + c + + a += (c ^ (b | ^d)) + X[(7*12)&15] + 4149444226 + a = a<<6 | a>>(32-6) + b + + d += (b ^ (a | ^c)) + X[(7*13)&15] + 3174756917 + d = d<<10 | d>>(32-10) + a + + c += (a ^ (d | ^b)) + X[(7*14)&15] + 718787259 + c = c<<15 | c>>(32-15) + d + + b += (d ^ (c | ^a)) + X[(7*15)&15] + 3951481745 + b = b<<21 | b>>(32-21) + c + + a += aa + b += bb + c += cc + d += dd + + p = p[chunk:] + } + + dig.s[0] = a + dig.s[1] = b + dig.s[2] = c + dig.s[3] = d +} diff --git a/src/crypto/md5/md5block_386.s b/src/crypto/md5/md5block_386.s new file mode 100644 index 0000000000000000000000000000000000000000..8e426d148fa069234da7bc93188b2f621aacb6f6 --- /dev/null +++ b/src/crypto/md5/md5block_386.s @@ -0,0 +1,182 @@ +// Original source: +// http://www.zorinaq.com/papers/md5-amd64.html +// http://www.zorinaq.com/papers/md5-amd64.tar.bz2 +// +// Translated from Perl generating GNU assembly into +// #defines generating 8a assembly, and adjusted for 386, +// by the Go Authors. + +#include "textflag.h" + +// MD5 optimized for AMD64. +// +// Author: Marc Bevand +// Licence: I hereby disclaim the copyright on this code and place it +// in the public domain. + +#define ROUND1(a, b, c, d, index, const, shift) \ + XORL c, BP; \ + LEAL const(a)(DI*1), a; \ + ANDL b, BP; \ + XORL d, BP; \ + MOVL (index*4)(SI), DI; \ + ADDL BP, a; \ + ROLL $shift, a; \ + MOVL c, BP; \ + ADDL b, a + +#define ROUND2(a, b, c, d, index, const, shift) \ + LEAL const(a)(DI*1),a; \ + MOVL d, DI; \ + ANDL b, DI; \ + MOVL d, BP; \ + NOTL BP; \ + ANDL c, BP; \ + ORL DI, BP; \ + MOVL (index*4)(SI),DI; \ + ADDL BP, a; \ + ROLL $shift, a; \ + ADDL b, a + +#define ROUND3(a, b, c, d, index, const, shift) \ + LEAL const(a)(DI*1),a; \ + MOVL (index*4)(SI),DI; \ + XORL d, BP; \ + XORL b, BP; \ + ADDL BP, a; \ + ROLL $shift, a; \ + MOVL b, BP; \ + ADDL b, a + +#define ROUND4(a, b, c, d, index, const, shift) \ + LEAL const(a)(DI*1),a; \ + ORL b, BP; \ + XORL c, BP; \ + ADDL BP, a; \ + MOVL (index*4)(SI),DI; \ + MOVL $0xffffffff, BP; \ + ROLL $shift, a; \ + XORL c, BP; \ + ADDL b, a + +TEXT ·block(SB),NOSPLIT,$24-16 + MOVL dig+0(FP), BP + MOVL p+4(FP), SI + MOVL p_len+8(FP), DX + SHRL $6, DX + SHLL $6, DX + + LEAL (SI)(DX*1), DI + MOVL (0*4)(BP), AX + MOVL (1*4)(BP), BX + MOVL (2*4)(BP), CX + MOVL (3*4)(BP), DX + + CMPL SI, DI + JEQ end + + MOVL DI, 16(SP) + +loop: + MOVL AX, 0(SP) + MOVL BX, 4(SP) + MOVL CX, 8(SP) + MOVL DX, 12(SP) + + MOVL (0*4)(SI), DI + MOVL DX, BP + + ROUND1(AX,BX,CX,DX, 1,0xd76aa478, 7); + ROUND1(DX,AX,BX,CX, 2,0xe8c7b756,12); + ROUND1(CX,DX,AX,BX, 3,0x242070db,17); + ROUND1(BX,CX,DX,AX, 4,0xc1bdceee,22); + ROUND1(AX,BX,CX,DX, 5,0xf57c0faf, 7); + ROUND1(DX,AX,BX,CX, 6,0x4787c62a,12); + ROUND1(CX,DX,AX,BX, 7,0xa8304613,17); + ROUND1(BX,CX,DX,AX, 8,0xfd469501,22); + ROUND1(AX,BX,CX,DX, 9,0x698098d8, 7); + ROUND1(DX,AX,BX,CX,10,0x8b44f7af,12); + ROUND1(CX,DX,AX,BX,11,0xffff5bb1,17); + ROUND1(BX,CX,DX,AX,12,0x895cd7be,22); + ROUND1(AX,BX,CX,DX,13,0x6b901122, 7); + ROUND1(DX,AX,BX,CX,14,0xfd987193,12); + ROUND1(CX,DX,AX,BX,15,0xa679438e,17); + ROUND1(BX,CX,DX,AX, 0,0x49b40821,22); + + MOVL (1*4)(SI), DI + MOVL DX, BP + + ROUND2(AX,BX,CX,DX, 6,0xf61e2562, 5); + ROUND2(DX,AX,BX,CX,11,0xc040b340, 9); + ROUND2(CX,DX,AX,BX, 0,0x265e5a51,14); + ROUND2(BX,CX,DX,AX, 5,0xe9b6c7aa,20); + ROUND2(AX,BX,CX,DX,10,0xd62f105d, 5); + ROUND2(DX,AX,BX,CX,15, 0x2441453, 9); + ROUND2(CX,DX,AX,BX, 4,0xd8a1e681,14); + ROUND2(BX,CX,DX,AX, 9,0xe7d3fbc8,20); + ROUND2(AX,BX,CX,DX,14,0x21e1cde6, 5); + ROUND2(DX,AX,BX,CX, 3,0xc33707d6, 9); + ROUND2(CX,DX,AX,BX, 8,0xf4d50d87,14); + ROUND2(BX,CX,DX,AX,13,0x455a14ed,20); + ROUND2(AX,BX,CX,DX, 2,0xa9e3e905, 5); + ROUND2(DX,AX,BX,CX, 7,0xfcefa3f8, 9); + ROUND2(CX,DX,AX,BX,12,0x676f02d9,14); + ROUND2(BX,CX,DX,AX, 0,0x8d2a4c8a,20); + + MOVL (5*4)(SI), DI + MOVL CX, BP + + ROUND3(AX,BX,CX,DX, 8,0xfffa3942, 4); + ROUND3(DX,AX,BX,CX,11,0x8771f681,11); + ROUND3(CX,DX,AX,BX,14,0x6d9d6122,16); + ROUND3(BX,CX,DX,AX, 1,0xfde5380c,23); + ROUND3(AX,BX,CX,DX, 4,0xa4beea44, 4); + ROUND3(DX,AX,BX,CX, 7,0x4bdecfa9,11); + ROUND3(CX,DX,AX,BX,10,0xf6bb4b60,16); + ROUND3(BX,CX,DX,AX,13,0xbebfbc70,23); + ROUND3(AX,BX,CX,DX, 0,0x289b7ec6, 4); + ROUND3(DX,AX,BX,CX, 3,0xeaa127fa,11); + ROUND3(CX,DX,AX,BX, 6,0xd4ef3085,16); + ROUND3(BX,CX,DX,AX, 9, 0x4881d05,23); + ROUND3(AX,BX,CX,DX,12,0xd9d4d039, 4); + ROUND3(DX,AX,BX,CX,15,0xe6db99e5,11); + ROUND3(CX,DX,AX,BX, 2,0x1fa27cf8,16); + ROUND3(BX,CX,DX,AX, 0,0xc4ac5665,23); + + MOVL (0*4)(SI), DI + MOVL $0xffffffff, BP + XORL DX, BP + + ROUND4(AX,BX,CX,DX, 7,0xf4292244, 6); + ROUND4(DX,AX,BX,CX,14,0x432aff97,10); + ROUND4(CX,DX,AX,BX, 5,0xab9423a7,15); + ROUND4(BX,CX,DX,AX,12,0xfc93a039,21); + ROUND4(AX,BX,CX,DX, 3,0x655b59c3, 6); + ROUND4(DX,AX,BX,CX,10,0x8f0ccc92,10); + ROUND4(CX,DX,AX,BX, 1,0xffeff47d,15); + ROUND4(BX,CX,DX,AX, 8,0x85845dd1,21); + ROUND4(AX,BX,CX,DX,15,0x6fa87e4f, 6); + ROUND4(DX,AX,BX,CX, 6,0xfe2ce6e0,10); + ROUND4(CX,DX,AX,BX,13,0xa3014314,15); + ROUND4(BX,CX,DX,AX, 4,0x4e0811a1,21); + ROUND4(AX,BX,CX,DX,11,0xf7537e82, 6); + ROUND4(DX,AX,BX,CX, 2,0xbd3af235,10); + ROUND4(CX,DX,AX,BX, 9,0x2ad7d2bb,15); + ROUND4(BX,CX,DX,AX, 0,0xeb86d391,21); + + ADDL 0(SP), AX + ADDL 4(SP), BX + ADDL 8(SP), CX + ADDL 12(SP), DX + + ADDL $64, SI + CMPL SI, 16(SP) + JB loop + +end: + MOVL dig+0(FP), BP + MOVL AX, (0*4)(BP) + MOVL BX, (1*4)(BP) + MOVL CX, (2*4)(BP) + MOVL DX, (3*4)(BP) + RET diff --git a/src/crypto/md5/md5block_amd64.s b/src/crypto/md5/md5block_amd64.s new file mode 100644 index 0000000000000000000000000000000000000000..a3ae7d97b23d8a69f91a53959c850f03f8e6da54 --- /dev/null +++ b/src/crypto/md5/md5block_amd64.s @@ -0,0 +1,179 @@ +// Original source: +// http://www.zorinaq.com/papers/md5-amd64.html +// http://www.zorinaq.com/papers/md5-amd64.tar.bz2 +// +// Translated from Perl generating GNU assembly into +// #defines generating 6a assembly by the Go Authors. + +#include "textflag.h" + +// MD5 optimized for AMD64. +// +// Author: Marc Bevand +// Licence: I hereby disclaim the copyright on this code and place it +// in the public domain. + +TEXT ·block(SB),NOSPLIT,$0-32 + MOVQ dig+0(FP), BP + MOVQ p+8(FP), SI + MOVQ p_len+16(FP), DX + SHRQ $6, DX + SHLQ $6, DX + + LEAQ (SI)(DX*1), DI + MOVL (0*4)(BP), AX + MOVL (1*4)(BP), BX + MOVL (2*4)(BP), CX + MOVL (3*4)(BP), DX + + CMPQ SI, DI + JEQ end + +loop: + MOVL AX, R12 + MOVL BX, R13 + MOVL CX, R14 + MOVL DX, R15 + + MOVL (0*4)(SI), R8 + MOVL DX, R9 + +#define ROUND1(a, b, c, d, index, const, shift) \ + XORL c, R9; \ + LEAL const(a)(R8*1), a; \ + ANDL b, R9; \ + XORL d, R9; \ + MOVL (index*4)(SI), R8; \ + ADDL R9, a; \ + ROLL $shift, a; \ + MOVL c, R9; \ + ADDL b, a + + ROUND1(AX,BX,CX,DX, 1,0xd76aa478, 7); + ROUND1(DX,AX,BX,CX, 2,0xe8c7b756,12); + ROUND1(CX,DX,AX,BX, 3,0x242070db,17); + ROUND1(BX,CX,DX,AX, 4,0xc1bdceee,22); + ROUND1(AX,BX,CX,DX, 5,0xf57c0faf, 7); + ROUND1(DX,AX,BX,CX, 6,0x4787c62a,12); + ROUND1(CX,DX,AX,BX, 7,0xa8304613,17); + ROUND1(BX,CX,DX,AX, 8,0xfd469501,22); + ROUND1(AX,BX,CX,DX, 9,0x698098d8, 7); + ROUND1(DX,AX,BX,CX,10,0x8b44f7af,12); + ROUND1(CX,DX,AX,BX,11,0xffff5bb1,17); + ROUND1(BX,CX,DX,AX,12,0x895cd7be,22); + ROUND1(AX,BX,CX,DX,13,0x6b901122, 7); + ROUND1(DX,AX,BX,CX,14,0xfd987193,12); + ROUND1(CX,DX,AX,BX,15,0xa679438e,17); + ROUND1(BX,CX,DX,AX, 0,0x49b40821,22); + + MOVL (1*4)(SI), R8 + MOVL DX, R9 + MOVL DX, R10 + +#define ROUND2(a, b, c, d, index, const, shift) \ + NOTL R9; \ + LEAL const(a)(R8*1),a; \ + ANDL b, R10; \ + ANDL c, R9; \ + MOVL (index*4)(SI),R8; \ + ORL R9, R10; \ + MOVL c, R9; \ + ADDL R10, a; \ + MOVL c, R10; \ + ROLL $shift, a; \ + ADDL b, a + + ROUND2(AX,BX,CX,DX, 6,0xf61e2562, 5); + ROUND2(DX,AX,BX,CX,11,0xc040b340, 9); + ROUND2(CX,DX,AX,BX, 0,0x265e5a51,14); + ROUND2(BX,CX,DX,AX, 5,0xe9b6c7aa,20); + ROUND2(AX,BX,CX,DX,10,0xd62f105d, 5); + ROUND2(DX,AX,BX,CX,15, 0x2441453, 9); + ROUND2(CX,DX,AX,BX, 4,0xd8a1e681,14); + ROUND2(BX,CX,DX,AX, 9,0xe7d3fbc8,20); + ROUND2(AX,BX,CX,DX,14,0x21e1cde6, 5); + ROUND2(DX,AX,BX,CX, 3,0xc33707d6, 9); + ROUND2(CX,DX,AX,BX, 8,0xf4d50d87,14); + ROUND2(BX,CX,DX,AX,13,0x455a14ed,20); + ROUND2(AX,BX,CX,DX, 2,0xa9e3e905, 5); + ROUND2(DX,AX,BX,CX, 7,0xfcefa3f8, 9); + ROUND2(CX,DX,AX,BX,12,0x676f02d9,14); + ROUND2(BX,CX,DX,AX, 0,0x8d2a4c8a,20); + + MOVL (5*4)(SI), R8 + MOVL CX, R9 + +#define ROUND3(a, b, c, d, index, const, shift) \ + LEAL const(a)(R8*1),a; \ + MOVL (index*4)(SI),R8; \ + XORL d, R9; \ + XORL b, R9; \ + ADDL R9, a; \ + ROLL $shift, a; \ + MOVL b, R9; \ + ADDL b, a + + ROUND3(AX,BX,CX,DX, 8,0xfffa3942, 4); + ROUND3(DX,AX,BX,CX,11,0x8771f681,11); + ROUND3(CX,DX,AX,BX,14,0x6d9d6122,16); + ROUND3(BX,CX,DX,AX, 1,0xfde5380c,23); + ROUND3(AX,BX,CX,DX, 4,0xa4beea44, 4); + ROUND3(DX,AX,BX,CX, 7,0x4bdecfa9,11); + ROUND3(CX,DX,AX,BX,10,0xf6bb4b60,16); + ROUND3(BX,CX,DX,AX,13,0xbebfbc70,23); + ROUND3(AX,BX,CX,DX, 0,0x289b7ec6, 4); + ROUND3(DX,AX,BX,CX, 3,0xeaa127fa,11); + ROUND3(CX,DX,AX,BX, 6,0xd4ef3085,16); + ROUND3(BX,CX,DX,AX, 9, 0x4881d05,23); + ROUND3(AX,BX,CX,DX,12,0xd9d4d039, 4); + ROUND3(DX,AX,BX,CX,15,0xe6db99e5,11); + ROUND3(CX,DX,AX,BX, 2,0x1fa27cf8,16); + ROUND3(BX,CX,DX,AX, 0,0xc4ac5665,23); + + MOVL (0*4)(SI), R8 + MOVL $0xffffffff, R9 + XORL DX, R9 + +#define ROUND4(a, b, c, d, index, const, shift) \ + LEAL const(a)(R8*1),a; \ + ORL b, R9; \ + XORL c, R9; \ + ADDL R9, a; \ + MOVL (index*4)(SI),R8; \ + MOVL $0xffffffff, R9; \ + ROLL $shift, a; \ + XORL c, R9; \ + ADDL b, a + + ROUND4(AX,BX,CX,DX, 7,0xf4292244, 6); + ROUND4(DX,AX,BX,CX,14,0x432aff97,10); + ROUND4(CX,DX,AX,BX, 5,0xab9423a7,15); + ROUND4(BX,CX,DX,AX,12,0xfc93a039,21); + ROUND4(AX,BX,CX,DX, 3,0x655b59c3, 6); + ROUND4(DX,AX,BX,CX,10,0x8f0ccc92,10); + ROUND4(CX,DX,AX,BX, 1,0xffeff47d,15); + ROUND4(BX,CX,DX,AX, 8,0x85845dd1,21); + ROUND4(AX,BX,CX,DX,15,0x6fa87e4f, 6); + ROUND4(DX,AX,BX,CX, 6,0xfe2ce6e0,10); + ROUND4(CX,DX,AX,BX,13,0xa3014314,15); + ROUND4(BX,CX,DX,AX, 4,0x4e0811a1,21); + ROUND4(AX,BX,CX,DX,11,0xf7537e82, 6); + ROUND4(DX,AX,BX,CX, 2,0xbd3af235,10); + ROUND4(CX,DX,AX,BX, 9,0x2ad7d2bb,15); + ROUND4(BX,CX,DX,AX, 0,0xeb86d391,21); + + ADDL R12, AX + ADDL R13, BX + ADDL R14, CX + ADDL R15, DX + + ADDQ $64, SI + CMPQ SI, DI + JB loop + +end: + MOVL AX, (0*4)(BP) + MOVL BX, (1*4)(BP) + MOVL CX, (2*4)(BP) + MOVL DX, (3*4)(BP) + RET diff --git a/src/crypto/md5/md5block_amd64p32.s b/src/crypto/md5/md5block_amd64p32.s new file mode 100644 index 0000000000000000000000000000000000000000..d918a67c51406ad91ecb3867a3d2e704a4eb2bf2 --- /dev/null +++ b/src/crypto/md5/md5block_amd64p32.s @@ -0,0 +1,184 @@ +// Original source: +// http://www.zorinaq.com/papers/md5-amd64.html +// http://www.zorinaq.com/papers/md5-amd64.tar.bz2 +// +// Translated from Perl generating GNU assembly into +// #defines generating 6a assembly by the Go Authors. +// +// Restrictions to make code safe for Native Client: +// replace BP with R11, reloaded before use at return. +// replace R15 with R11. + +#include "textflag.h" + +// MD5 optimized for AMD64. +// +// Author: Marc Bevand +// Licence: I hereby disclaim the copyright on this code and place it +// in the public domain. + +TEXT ·block(SB),NOSPLIT,$0-32 + MOVL dig+0(FP), R11 + MOVL p+4(FP), SI + MOVL p_len+8(FP), DX + SHRQ $6, DX + SHLQ $6, DX + + LEAQ (SI)(DX*1), DI + MOVL (0*4)(R11), AX + MOVL (1*4)(R11), BX + MOVL (2*4)(R11), CX + MOVL (3*4)(R11), DX + + CMPQ SI, DI + JEQ end + +loop: + MOVL AX, R12 + MOVL BX, R13 + MOVL CX, R14 + MOVL DX, R11 + + MOVL (0*4)(SI), R8 + MOVL DX, R9 + +#define ROUND1(a, b, c, d, index, const, shift) \ + XORL c, R9; \ + LEAL const(a)(R8*1), a; \ + ANDL b, R9; \ + XORL d, R9; \ + MOVL (index*4)(SI), R8; \ + ADDL R9, a; \ + ROLL $shift, a; \ + MOVL c, R9; \ + ADDL b, a + + ROUND1(AX,BX,CX,DX, 1,0xd76aa478, 7); + ROUND1(DX,AX,BX,CX, 2,0xe8c7b756,12); + ROUND1(CX,DX,AX,BX, 3,0x242070db,17); + ROUND1(BX,CX,DX,AX, 4,0xc1bdceee,22); + ROUND1(AX,BX,CX,DX, 5,0xf57c0faf, 7); + ROUND1(DX,AX,BX,CX, 6,0x4787c62a,12); + ROUND1(CX,DX,AX,BX, 7,0xa8304613,17); + ROUND1(BX,CX,DX,AX, 8,0xfd469501,22); + ROUND1(AX,BX,CX,DX, 9,0x698098d8, 7); + ROUND1(DX,AX,BX,CX,10,0x8b44f7af,12); + ROUND1(CX,DX,AX,BX,11,0xffff5bb1,17); + ROUND1(BX,CX,DX,AX,12,0x895cd7be,22); + ROUND1(AX,BX,CX,DX,13,0x6b901122, 7); + ROUND1(DX,AX,BX,CX,14,0xfd987193,12); + ROUND1(CX,DX,AX,BX,15,0xa679438e,17); + ROUND1(BX,CX,DX,AX, 0,0x49b40821,22); + + MOVL (1*4)(SI), R8 + MOVL DX, R9 + MOVL DX, R10 + +#define ROUND2(a, b, c, d, index, const, shift) \ + NOTL R9; \ + LEAL const(a)(R8*1),a; \ + ANDL b, R10; \ + ANDL c, R9; \ + MOVL (index*4)(SI),R8; \ + ORL R9, R10; \ + MOVL c, R9; \ + ADDL R10, a; \ + MOVL c, R10; \ + ROLL $shift, a; \ + ADDL b, a + + ROUND2(AX,BX,CX,DX, 6,0xf61e2562, 5); + ROUND2(DX,AX,BX,CX,11,0xc040b340, 9); + ROUND2(CX,DX,AX,BX, 0,0x265e5a51,14); + ROUND2(BX,CX,DX,AX, 5,0xe9b6c7aa,20); + ROUND2(AX,BX,CX,DX,10,0xd62f105d, 5); + ROUND2(DX,AX,BX,CX,15, 0x2441453, 9); + ROUND2(CX,DX,AX,BX, 4,0xd8a1e681,14); + ROUND2(BX,CX,DX,AX, 9,0xe7d3fbc8,20); + ROUND2(AX,BX,CX,DX,14,0x21e1cde6, 5); + ROUND2(DX,AX,BX,CX, 3,0xc33707d6, 9); + ROUND2(CX,DX,AX,BX, 8,0xf4d50d87,14); + ROUND2(BX,CX,DX,AX,13,0x455a14ed,20); + ROUND2(AX,BX,CX,DX, 2,0xa9e3e905, 5); + ROUND2(DX,AX,BX,CX, 7,0xfcefa3f8, 9); + ROUND2(CX,DX,AX,BX,12,0x676f02d9,14); + ROUND2(BX,CX,DX,AX, 0,0x8d2a4c8a,20); + + MOVL (5*4)(SI), R8 + MOVL CX, R9 + +#define ROUND3(a, b, c, d, index, const, shift) \ + LEAL const(a)(R8*1),a; \ + MOVL (index*4)(SI),R8; \ + XORL d, R9; \ + XORL b, R9; \ + ADDL R9, a; \ + ROLL $shift, a; \ + MOVL b, R9; \ + ADDL b, a + + ROUND3(AX,BX,CX,DX, 8,0xfffa3942, 4); + ROUND3(DX,AX,BX,CX,11,0x8771f681,11); + ROUND3(CX,DX,AX,BX,14,0x6d9d6122,16); + ROUND3(BX,CX,DX,AX, 1,0xfde5380c,23); + ROUND3(AX,BX,CX,DX, 4,0xa4beea44, 4); + ROUND3(DX,AX,BX,CX, 7,0x4bdecfa9,11); + ROUND3(CX,DX,AX,BX,10,0xf6bb4b60,16); + ROUND3(BX,CX,DX,AX,13,0xbebfbc70,23); + ROUND3(AX,BX,CX,DX, 0,0x289b7ec6, 4); + ROUND3(DX,AX,BX,CX, 3,0xeaa127fa,11); + ROUND3(CX,DX,AX,BX, 6,0xd4ef3085,16); + ROUND3(BX,CX,DX,AX, 9, 0x4881d05,23); + ROUND3(AX,BX,CX,DX,12,0xd9d4d039, 4); + ROUND3(DX,AX,BX,CX,15,0xe6db99e5,11); + ROUND3(CX,DX,AX,BX, 2,0x1fa27cf8,16); + ROUND3(BX,CX,DX,AX, 0,0xc4ac5665,23); + + MOVL (0*4)(SI), R8 + MOVL $0xffffffff, R9 + XORL DX, R9 + +#define ROUND4(a, b, c, d, index, const, shift) \ + LEAL const(a)(R8*1),a; \ + ORL b, R9; \ + XORL c, R9; \ + ADDL R9, a; \ + MOVL (index*4)(SI),R8; \ + MOVL $0xffffffff, R9; \ + ROLL $shift, a; \ + XORL c, R9; \ + ADDL b, a + + ROUND4(AX,BX,CX,DX, 7,0xf4292244, 6); + ROUND4(DX,AX,BX,CX,14,0x432aff97,10); + ROUND4(CX,DX,AX,BX, 5,0xab9423a7,15); + ROUND4(BX,CX,DX,AX,12,0xfc93a039,21); + ROUND4(AX,BX,CX,DX, 3,0x655b59c3, 6); + ROUND4(DX,AX,BX,CX,10,0x8f0ccc92,10); + ROUND4(CX,DX,AX,BX, 1,0xffeff47d,15); + ROUND4(BX,CX,DX,AX, 8,0x85845dd1,21); + ROUND4(AX,BX,CX,DX,15,0x6fa87e4f, 6); + ROUND4(DX,AX,BX,CX, 6,0xfe2ce6e0,10); + ROUND4(CX,DX,AX,BX,13,0xa3014314,15); + ROUND4(BX,CX,DX,AX, 4,0x4e0811a1,21); + ROUND4(AX,BX,CX,DX,11,0xf7537e82, 6); + ROUND4(DX,AX,BX,CX, 2,0xbd3af235,10); + ROUND4(CX,DX,AX,BX, 9,0x2ad7d2bb,15); + ROUND4(BX,CX,DX,AX, 0,0xeb86d391,21); + + ADDL R12, AX + ADDL R13, BX + ADDL R14, CX + ADDL R11, DX + + ADDQ $64, SI + CMPQ SI, DI + JB loop + +end: + MOVL dig+0(FP), R11 + MOVL AX, (0*4)(R11) + MOVL BX, (1*4)(R11) + MOVL CX, (2*4)(R11) + MOVL DX, (3*4)(R11) + RET diff --git a/src/crypto/md5/md5block_arm.s b/src/crypto/md5/md5block_arm.s new file mode 100644 index 0000000000000000000000000000000000000000..f1f0f67e5556aae843890eb4bcdd2ea85e6a9802 --- /dev/null +++ b/src/crypto/md5/md5block_arm.s @@ -0,0 +1,299 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. +// +// ARM version of md5block.go + +#include "textflag.h" + +// Register definitions +#define Rtable R0 // Pointer to MD5 constants table +#define Rdata R1 // Pointer to data to hash +#define Ra R2 // MD5 accumulator +#define Rb R3 // MD5 accumulator +#define Rc R4 // MD5 accumulator +#define Rd R5 // MD5 accumulator +#define Rc0 R6 // MD5 constant +#define Rc1 R7 // MD5 constant +#define Rc2 R8 // MD5 constant +// r9, r10 are forbidden +// r11 is OK provided you check the assembler that no synthetic instructions use it +#define Rc3 R11 // MD5 constant +#define Rt0 R12 // temporary +#define Rt1 R14 // temporary + +// func block(dig *digest, p []byte) +// 0(FP) is *digest +// 4(FP) is p.array (struct Slice) +// 8(FP) is p.len +//12(FP) is p.cap +// +// Stack frame +#define p_end end-4(SP) // pointer to the end of data +#define p_data data-8(SP) // current data pointer +#define buf buffer-(8+4*16)(SP) //16 words temporary buffer + // 3 words at 4..12(R13) for called routine parameters + +TEXT ·block(SB), NOSPLIT, $84-16 + MOVW p+4(FP), Rdata // pointer to the data + MOVW p_len+8(FP), Rt0 // number of bytes + ADD Rdata, Rt0 + MOVW Rt0, p_end // pointer to end of data + +loop: + MOVW Rdata, p_data // Save Rdata + AND.S $3, Rdata, Rt0 // TST $3, Rdata not working see issue 5921 + BEQ aligned // aligned detected - skip copy + + // Copy the unaligned source data into the aligned temporary buffer + // memove(to=4(R13), from=8(R13), n=12(R13)) - Corrupts all registers + MOVW $buf, Rtable // to + MOVW $64, Rc0 // n + MOVM.IB [Rtable,Rdata,Rc0], (R13) + BL runtime·memmove(SB) + + // Point to the local aligned copy of the data + MOVW $buf, Rdata + +aligned: + // Point to the table of constants + // A PC relative add would be cheaper than this + MOVW $·table(SB), Rtable + + // Load up initial MD5 accumulator + MOVW dig+0(FP), Rc0 + MOVM.IA (Rc0), [Ra,Rb,Rc,Rd] + +// a += (((c^d)&b)^d) + X[index] + const +// a = a<>(32-shift) + b +#define ROUND1(Ra, Rb, Rc, Rd, index, shift, Rconst) \ + EOR Rc, Rd, Rt0 ; \ + AND Rb, Rt0 ; \ + EOR Rd, Rt0 ; \ + MOVW (index<<2)(Rdata), Rt1 ; \ + ADD Rt1, Rt0 ; \ + ADD Rconst, Rt0 ; \ + ADD Rt0, Ra ; \ + ADD Ra@>(32-shift), Rb, Ra ; + + MOVM.IA.W (Rtable), [Rc0,Rc1,Rc2,Rc3] + ROUND1(Ra, Rb, Rc, Rd, 0, 7, Rc0) + ROUND1(Rd, Ra, Rb, Rc, 1, 12, Rc1) + ROUND1(Rc, Rd, Ra, Rb, 2, 17, Rc2) + ROUND1(Rb, Rc, Rd, Ra, 3, 22, Rc3) + + MOVM.IA.W (Rtable), [Rc0,Rc1,Rc2,Rc3] + ROUND1(Ra, Rb, Rc, Rd, 4, 7, Rc0) + ROUND1(Rd, Ra, Rb, Rc, 5, 12, Rc1) + ROUND1(Rc, Rd, Ra, Rb, 6, 17, Rc2) + ROUND1(Rb, Rc, Rd, Ra, 7, 22, Rc3) + + MOVM.IA.W (Rtable), [Rc0,Rc1,Rc2,Rc3] + ROUND1(Ra, Rb, Rc, Rd, 8, 7, Rc0) + ROUND1(Rd, Ra, Rb, Rc, 9, 12, Rc1) + ROUND1(Rc, Rd, Ra, Rb, 10, 17, Rc2) + ROUND1(Rb, Rc, Rd, Ra, 11, 22, Rc3) + + MOVM.IA.W (Rtable), [Rc0,Rc1,Rc2,Rc3] + ROUND1(Ra, Rb, Rc, Rd, 12, 7, Rc0) + ROUND1(Rd, Ra, Rb, Rc, 13, 12, Rc1) + ROUND1(Rc, Rd, Ra, Rb, 14, 17, Rc2) + ROUND1(Rb, Rc, Rd, Ra, 15, 22, Rc3) + +// a += (((b^c)&d)^c) + X[index] + const +// a = a<>(32-shift) + b +#define ROUND2(Ra, Rb, Rc, Rd, index, shift, Rconst) \ + EOR Rb, Rc, Rt0 ; \ + AND Rd, Rt0 ; \ + EOR Rc, Rt0 ; \ + MOVW (index<<2)(Rdata), Rt1 ; \ + ADD Rt1, Rt0 ; \ + ADD Rconst, Rt0 ; \ + ADD Rt0, Ra ; \ + ADD Ra@>(32-shift), Rb, Ra ; + + MOVM.IA.W (Rtable), [Rc0,Rc1,Rc2,Rc3] + ROUND2(Ra, Rb, Rc, Rd, 1, 5, Rc0) + ROUND2(Rd, Ra, Rb, Rc, 6, 9, Rc1) + ROUND2(Rc, Rd, Ra, Rb, 11, 14, Rc2) + ROUND2(Rb, Rc, Rd, Ra, 0, 20, Rc3) + + MOVM.IA.W (Rtable), [Rc0,Rc1,Rc2,Rc3] + ROUND2(Ra, Rb, Rc, Rd, 5, 5, Rc0) + ROUND2(Rd, Ra, Rb, Rc, 10, 9, Rc1) + ROUND2(Rc, Rd, Ra, Rb, 15, 14, Rc2) + ROUND2(Rb, Rc, Rd, Ra, 4, 20, Rc3) + + MOVM.IA.W (Rtable), [Rc0,Rc1,Rc2,Rc3] + ROUND2(Ra, Rb, Rc, Rd, 9, 5, Rc0) + ROUND2(Rd, Ra, Rb, Rc, 14, 9, Rc1) + ROUND2(Rc, Rd, Ra, Rb, 3, 14, Rc2) + ROUND2(Rb, Rc, Rd, Ra, 8, 20, Rc3) + + MOVM.IA.W (Rtable), [Rc0,Rc1,Rc2,Rc3] + ROUND2(Ra, Rb, Rc, Rd, 13, 5, Rc0) + ROUND2(Rd, Ra, Rb, Rc, 2, 9, Rc1) + ROUND2(Rc, Rd, Ra, Rb, 7, 14, Rc2) + ROUND2(Rb, Rc, Rd, Ra, 12, 20, Rc3) + +// a += (b^c^d) + X[index] + const +// a = a<>(32-shift) + b +#define ROUND3(Ra, Rb, Rc, Rd, index, shift, Rconst) \ + EOR Rb, Rc, Rt0 ; \ + EOR Rd, Rt0 ; \ + MOVW (index<<2)(Rdata), Rt1 ; \ + ADD Rt1, Rt0 ; \ + ADD Rconst, Rt0 ; \ + ADD Rt0, Ra ; \ + ADD Ra@>(32-shift), Rb, Ra ; + + MOVM.IA.W (Rtable), [Rc0,Rc1,Rc2,Rc3] + ROUND3(Ra, Rb, Rc, Rd, 5, 4, Rc0) + ROUND3(Rd, Ra, Rb, Rc, 8, 11, Rc1) + ROUND3(Rc, Rd, Ra, Rb, 11, 16, Rc2) + ROUND3(Rb, Rc, Rd, Ra, 14, 23, Rc3) + + MOVM.IA.W (Rtable), [Rc0,Rc1,Rc2,Rc3] + ROUND3(Ra, Rb, Rc, Rd, 1, 4, Rc0) + ROUND3(Rd, Ra, Rb, Rc, 4, 11, Rc1) + ROUND3(Rc, Rd, Ra, Rb, 7, 16, Rc2) + ROUND3(Rb, Rc, Rd, Ra, 10, 23, Rc3) + + MOVM.IA.W (Rtable), [Rc0,Rc1,Rc2,Rc3] + ROUND3(Ra, Rb, Rc, Rd, 13, 4, Rc0) + ROUND3(Rd, Ra, Rb, Rc, 0, 11, Rc1) + ROUND3(Rc, Rd, Ra, Rb, 3, 16, Rc2) + ROUND3(Rb, Rc, Rd, Ra, 6, 23, Rc3) + + MOVM.IA.W (Rtable), [Rc0,Rc1,Rc2,Rc3] + ROUND3(Ra, Rb, Rc, Rd, 9, 4, Rc0) + ROUND3(Rd, Ra, Rb, Rc, 12, 11, Rc1) + ROUND3(Rc, Rd, Ra, Rb, 15, 16, Rc2) + ROUND3(Rb, Rc, Rd, Ra, 2, 23, Rc3) + +// a += (c^(b|^d)) + X[index] + const +// a = a<>(32-shift) + b +#define ROUND4(Ra, Rb, Rc, Rd, index, shift, Rconst) \ + MVN Rd, Rt0 ; \ + ORR Rb, Rt0 ; \ + EOR Rc, Rt0 ; \ + MOVW (index<<2)(Rdata), Rt1 ; \ + ADD Rt1, Rt0 ; \ + ADD Rconst, Rt0 ; \ + ADD Rt0, Ra ; \ + ADD Ra@>(32-shift), Rb, Ra ; + + MOVM.IA.W (Rtable), [Rc0,Rc1,Rc2,Rc3] + ROUND4(Ra, Rb, Rc, Rd, 0, 6, Rc0) + ROUND4(Rd, Ra, Rb, Rc, 7, 10, Rc1) + ROUND4(Rc, Rd, Ra, Rb, 14, 15, Rc2) + ROUND4(Rb, Rc, Rd, Ra, 5, 21, Rc3) + + MOVM.IA.W (Rtable), [Rc0,Rc1,Rc2,Rc3] + ROUND4(Ra, Rb, Rc, Rd, 12, 6, Rc0) + ROUND4(Rd, Ra, Rb, Rc, 3, 10, Rc1) + ROUND4(Rc, Rd, Ra, Rb, 10, 15, Rc2) + ROUND4(Rb, Rc, Rd, Ra, 1, 21, Rc3) + + MOVM.IA.W (Rtable), [Rc0,Rc1,Rc2,Rc3] + ROUND4(Ra, Rb, Rc, Rd, 8, 6, Rc0) + ROUND4(Rd, Ra, Rb, Rc, 15, 10, Rc1) + ROUND4(Rc, Rd, Ra, Rb, 6, 15, Rc2) + ROUND4(Rb, Rc, Rd, Ra, 13, 21, Rc3) + + MOVM.IA.W (Rtable), [Rc0,Rc1,Rc2,Rc3] + ROUND4(Ra, Rb, Rc, Rd, 4, 6, Rc0) + ROUND4(Rd, Ra, Rb, Rc, 11, 10, Rc1) + ROUND4(Rc, Rd, Ra, Rb, 2, 15, Rc2) + ROUND4(Rb, Rc, Rd, Ra, 9, 21, Rc3) + + MOVW dig+0(FP), Rt0 + MOVM.IA (Rt0), [Rc0,Rc1,Rc2,Rc3] + + ADD Rc0, Ra + ADD Rc1, Rb + ADD Rc2, Rc + ADD Rc3, Rd + + MOVM.IA [Ra,Rb,Rc,Rd], (Rt0) + + MOVW p_data, Rdata + MOVW p_end, Rt0 + ADD $64, Rdata + CMP Rt0, Rdata + BLO loop + + RET + +// MD5 constants table + + // Round 1 + DATA ·table+0x00(SB)/4, $0xd76aa478 + DATA ·table+0x04(SB)/4, $0xe8c7b756 + DATA ·table+0x08(SB)/4, $0x242070db + DATA ·table+0x0c(SB)/4, $0xc1bdceee + DATA ·table+0x10(SB)/4, $0xf57c0faf + DATA ·table+0x14(SB)/4, $0x4787c62a + DATA ·table+0x18(SB)/4, $0xa8304613 + DATA ·table+0x1c(SB)/4, $0xfd469501 + DATA ·table+0x20(SB)/4, $0x698098d8 + DATA ·table+0x24(SB)/4, $0x8b44f7af + DATA ·table+0x28(SB)/4, $0xffff5bb1 + DATA ·table+0x2c(SB)/4, $0x895cd7be + DATA ·table+0x30(SB)/4, $0x6b901122 + DATA ·table+0x34(SB)/4, $0xfd987193 + DATA ·table+0x38(SB)/4, $0xa679438e + DATA ·table+0x3c(SB)/4, $0x49b40821 + // Round 2 + DATA ·table+0x40(SB)/4, $0xf61e2562 + DATA ·table+0x44(SB)/4, $0xc040b340 + DATA ·table+0x48(SB)/4, $0x265e5a51 + DATA ·table+0x4c(SB)/4, $0xe9b6c7aa + DATA ·table+0x50(SB)/4, $0xd62f105d + DATA ·table+0x54(SB)/4, $0x02441453 + DATA ·table+0x58(SB)/4, $0xd8a1e681 + DATA ·table+0x5c(SB)/4, $0xe7d3fbc8 + DATA ·table+0x60(SB)/4, $0x21e1cde6 + DATA ·table+0x64(SB)/4, $0xc33707d6 + DATA ·table+0x68(SB)/4, $0xf4d50d87 + DATA ·table+0x6c(SB)/4, $0x455a14ed + DATA ·table+0x70(SB)/4, $0xa9e3e905 + DATA ·table+0x74(SB)/4, $0xfcefa3f8 + DATA ·table+0x78(SB)/4, $0x676f02d9 + DATA ·table+0x7c(SB)/4, $0x8d2a4c8a + // Round 3 + DATA ·table+0x80(SB)/4, $0xfffa3942 + DATA ·table+0x84(SB)/4, $0x8771f681 + DATA ·table+0x88(SB)/4, $0x6d9d6122 + DATA ·table+0x8c(SB)/4, $0xfde5380c + DATA ·table+0x90(SB)/4, $0xa4beea44 + DATA ·table+0x94(SB)/4, $0x4bdecfa9 + DATA ·table+0x98(SB)/4, $0xf6bb4b60 + DATA ·table+0x9c(SB)/4, $0xbebfbc70 + DATA ·table+0xa0(SB)/4, $0x289b7ec6 + DATA ·table+0xa4(SB)/4, $0xeaa127fa + DATA ·table+0xa8(SB)/4, $0xd4ef3085 + DATA ·table+0xac(SB)/4, $0x04881d05 + DATA ·table+0xb0(SB)/4, $0xd9d4d039 + DATA ·table+0xb4(SB)/4, $0xe6db99e5 + DATA ·table+0xb8(SB)/4, $0x1fa27cf8 + DATA ·table+0xbc(SB)/4, $0xc4ac5665 + // Round 4 + DATA ·table+0xc0(SB)/4, $0xf4292244 + DATA ·table+0xc4(SB)/4, $0x432aff97 + DATA ·table+0xc8(SB)/4, $0xab9423a7 + DATA ·table+0xcc(SB)/4, $0xfc93a039 + DATA ·table+0xd0(SB)/4, $0x655b59c3 + DATA ·table+0xd4(SB)/4, $0x8f0ccc92 + DATA ·table+0xd8(SB)/4, $0xffeff47d + DATA ·table+0xdc(SB)/4, $0x85845dd1 + DATA ·table+0xe0(SB)/4, $0x6fa87e4f + DATA ·table+0xe4(SB)/4, $0xfe2ce6e0 + DATA ·table+0xe8(SB)/4, $0xa3014314 + DATA ·table+0xec(SB)/4, $0x4e0811a1 + DATA ·table+0xf0(SB)/4, $0xf7537e82 + DATA ·table+0xf4(SB)/4, $0xbd3af235 + DATA ·table+0xf8(SB)/4, $0x2ad7d2bb + DATA ·table+0xfc(SB)/4, $0xeb86d391 + // Global definition + GLOBL ·table(SB),8,$256 diff --git a/src/crypto/md5/md5block_decl.go b/src/crypto/md5/md5block_decl.go new file mode 100644 index 0000000000000000000000000000000000000000..d7956a6d203ee753bd3197650cc6a1aab9b0bde7 --- /dev/null +++ b/src/crypto/md5/md5block_decl.go @@ -0,0 +1,11 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build amd64 amd64p32 386 arm + +package md5 + +//go:noescape + +func block(dig *digest, p []byte) diff --git a/src/crypto/md5/md5block_generic.go b/src/crypto/md5/md5block_generic.go new file mode 100644 index 0000000000000000000000000000000000000000..263463e51cdc9cc538287e94e07474da5867ac82 --- /dev/null +++ b/src/crypto/md5/md5block_generic.go @@ -0,0 +1,9 @@ +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build !amd64,!amd64p32,!386,!arm + +package md5 + +var block = blockGeneric diff --git a/src/crypto/rand/eagain.go b/src/crypto/rand/eagain.go new file mode 100644 index 0000000000000000000000000000000000000000..2c853d0a13455ed70e497f92a2de09a7e45b3d14 --- /dev/null +++ b/src/crypto/rand/eagain.go @@ -0,0 +1,27 @@ +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build darwin dragonfly freebsd linux nacl netbsd openbsd solaris + +package rand + +import ( + "os" + "syscall" +) + +func init() { + isEAGAIN = unixIsEAGAIN +} + +// unixIsEAGAIN reports whether err is a syscall.EAGAIN wrapped in a PathError. +// See golang.org/issue/9205 +func unixIsEAGAIN(err error) bool { + if pe, ok := err.(*os.PathError); ok { + if errno, ok := pe.Err.(syscall.Errno); ok && errno == syscall.EAGAIN { + return true + } + } + return false +} diff --git a/src/crypto/rand/example_test.go b/src/crypto/rand/example_test.go new file mode 100644 index 0000000000000000000000000000000000000000..8a27173002dfe3bb6ec4a757f300bc5bacd10d47 --- /dev/null +++ b/src/crypto/rand/example_test.go @@ -0,0 +1,28 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package rand_test + +import ( + "bytes" + "crypto/rand" + "fmt" +) + +// This example reads 10 cryptographically secure pseudorandom numbers from +// rand.Reader and writes them to a byte slice. +func ExampleRead() { + c := 10 + b := make([]byte, c) + _, err := rand.Read(b) + if err != nil { + fmt.Println("error:", err) + return + } + // The slice should now contain random bytes instead of only zeroes. + fmt.Println(bytes.Equal(b, make([]byte, c))) + + // Output: + // false +} diff --git a/src/crypto/rand/rand.go b/src/crypto/rand/rand.go new file mode 100644 index 0000000000000000000000000000000000000000..ee32fa0bd67e52cffea909e36d7ba0eeeb1d2056 --- /dev/null +++ b/src/crypto/rand/rand.go @@ -0,0 +1,23 @@ +// Copyright 2010 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package rand implements a cryptographically secure +// pseudorandom number generator. +package rand + +import "io" + +// Reader is a global, shared instance of a cryptographically +// strong pseudo-random generator. +// +// On Unix-like systems, Reader reads from /dev/urandom. +// On Linux, Reader uses getrandom(2) if available, /dev/urandom otherwise. +// On Windows systems, Reader uses the CryptGenRandom API. +var Reader io.Reader + +// Read is a helper function that calls Reader.Read using io.ReadFull. +// On return, n == len(b) if and only if err == nil. +func Read(b []byte) (n int, err error) { + return io.ReadFull(Reader, b) +} diff --git a/src/crypto/rand/rand_linux.go b/src/crypto/rand/rand_linux.go new file mode 100644 index 0000000000000000000000000000000000000000..7d6d9e8a09405860f33bc9d3d207b6489252d238 --- /dev/null +++ b/src/crypto/rand/rand_linux.go @@ -0,0 +1,39 @@ +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package rand + +import ( + "internal/syscall/unix" + "sync" +) + +func init() { + altGetRandom = getRandomLinux +} + +var ( + once sync.Once + useSyscall bool +) + +func pickStrategy() { + // Test whether we should use the system call or /dev/urandom. + // We'll fall back to urandom if: + // - the kernel is too old (before 3.17) + // - the machine has no entropy available (early boot + no hardware + // entropy source?) and we want to avoid blocking later. + var buf [1]byte + n, err := unix.GetRandom(buf[:], unix.GRND_NONBLOCK) + useSyscall = n == 1 && err == nil +} + +func getRandomLinux(p []byte) (ok bool) { + once.Do(pickStrategy) + if !useSyscall { + return false + } + n, err := unix.GetRandom(p, 0) + return n == len(p) && err == nil +} diff --git a/src/crypto/rand/rand_test.go b/src/crypto/rand/rand_test.go new file mode 100644 index 0000000000000000000000000000000000000000..e46e61d374acb0ca2a4fdb79367752aa205ca900 --- /dev/null +++ b/src/crypto/rand/rand_test.go @@ -0,0 +1,43 @@ +// Copyright 2010 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package rand + +import ( + "bytes" + "compress/flate" + "io" + "testing" +) + +func TestRead(t *testing.T) { + var n int = 4e6 + if testing.Short() { + n = 1e5 + } + b := make([]byte, n) + n, err := io.ReadFull(Reader, b) + if n != len(b) || err != nil { + t.Fatalf("ReadFull(buf) = %d, %s", n, err) + } + + var z bytes.Buffer + f, _ := flate.NewWriter(&z, 5) + f.Write(b) + f.Close() + if z.Len() < len(b)*99/100 { + t.Fatalf("Compressed %d -> %d", len(b), z.Len()) + } +} + +func TestReadEmpty(t *testing.T) { + n, err := Reader.Read(make([]byte, 0)) + if n != 0 || err != nil { + t.Fatalf("Read(make([]byte, 0)) = %d, %v", n, err) + } + n, err = Reader.Read(nil) + if n != 0 || err != nil { + t.Fatalf("Read(nil) = %d, %v", n, err) + } +} diff --git a/src/crypto/rand/rand_unix.go b/src/crypto/rand/rand_unix.go new file mode 100644 index 0000000000000000000000000000000000000000..75c36e05b34020f92e057fd2966f073cf0e40c74 --- /dev/null +++ b/src/crypto/rand/rand_unix.go @@ -0,0 +1,163 @@ +// Copyright 2010 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build darwin dragonfly freebsd linux nacl netbsd openbsd plan9 solaris + +// Unix cryptographically secure pseudorandom number +// generator. + +package rand + +import ( + "bufio" + "crypto/aes" + "crypto/cipher" + "io" + "os" + "runtime" + "sync" + "time" +) + +const urandomDevice = "/dev/urandom" + +// Easy implementation: read from /dev/urandom. +// This is sufficient on Linux, OS X, and FreeBSD. + +func init() { + if runtime.GOOS == "plan9" { + Reader = newReader(nil) + } else { + Reader = &devReader{name: urandomDevice} + } +} + +// A devReader satisfies reads by reading the file named name. +type devReader struct { + name string + f io.Reader + mu sync.Mutex +} + +// altGetRandom if non-nil specifies an OS-specific function to get +// urandom-style randomness. +var altGetRandom func([]byte) (ok bool) + +func (r *devReader) Read(b []byte) (n int, err error) { + if altGetRandom != nil && r.name == urandomDevice && altGetRandom(b) { + return len(b), nil + } + r.mu.Lock() + defer r.mu.Unlock() + if r.f == nil { + f, err := os.Open(r.name) + if f == nil { + return 0, err + } + if runtime.GOOS == "plan9" { + r.f = f + } else { + r.f = bufio.NewReader(hideAgainReader{f}) + } + } + return r.f.Read(b) +} + +var isEAGAIN func(error) bool // set by eagain.go on unix systems + +// hideAgainReader masks EAGAIN reads from /dev/urandom. +// See golang.org/issue/9205 +type hideAgainReader struct { + r io.Reader +} + +func (hr hideAgainReader) Read(p []byte) (n int, err error) { + n, err = hr.r.Read(p) + if err != nil && isEAGAIN != nil && isEAGAIN(err) { + err = nil + } + return +} + +// Alternate pseudo-random implementation for use on +// systems without a reliable /dev/urandom. + +// newReader returns a new pseudorandom generator that +// seeds itself by reading from entropy. If entropy == nil, +// the generator seeds itself by reading from the system's +// random number generator, typically /dev/random. +// The Read method on the returned reader always returns +// the full amount asked for, or else it returns an error. +// +// The generator uses the X9.31 algorithm with AES-128, +// reseeding after every 1 MB of generated data. +func newReader(entropy io.Reader) io.Reader { + if entropy == nil { + entropy = &devReader{name: "/dev/random"} + } + return &reader{entropy: entropy} +} + +type reader struct { + mu sync.Mutex + budget int // number of bytes that can be generated + cipher cipher.Block + entropy io.Reader + time, seed, dst, key [aes.BlockSize]byte +} + +func (r *reader) Read(b []byte) (n int, err error) { + r.mu.Lock() + defer r.mu.Unlock() + n = len(b) + + for len(b) > 0 { + if r.budget == 0 { + _, err := io.ReadFull(r.entropy, r.seed[0:]) + if err != nil { + return n - len(b), err + } + _, err = io.ReadFull(r.entropy, r.key[0:]) + if err != nil { + return n - len(b), err + } + r.cipher, err = aes.NewCipher(r.key[0:]) + if err != nil { + return n - len(b), err + } + r.budget = 1 << 20 // reseed after generating 1MB + } + r.budget -= aes.BlockSize + + // ANSI X9.31 (== X9.17) algorithm, but using AES in place of 3DES. + // + // single block: + // t = encrypt(time) + // dst = encrypt(t^seed) + // seed = encrypt(t^dst) + ns := time.Now().UnixNano() + r.time[0] = byte(ns >> 56) + r.time[1] = byte(ns >> 48) + r.time[2] = byte(ns >> 40) + r.time[3] = byte(ns >> 32) + r.time[4] = byte(ns >> 24) + r.time[5] = byte(ns >> 16) + r.time[6] = byte(ns >> 8) + r.time[7] = byte(ns) + r.cipher.Encrypt(r.time[0:], r.time[0:]) + for i := 0; i < aes.BlockSize; i++ { + r.dst[i] = r.time[i] ^ r.seed[i] + } + r.cipher.Encrypt(r.dst[0:], r.dst[0:]) + for i := 0; i < aes.BlockSize; i++ { + r.seed[i] = r.time[i] ^ r.dst[i] + } + r.cipher.Encrypt(r.seed[0:], r.seed[0:]) + + m := copy(b, r.dst[0:]) + b = b[m:] + } + + return n, nil +} diff --git a/src/crypto/rand/rand_windows.go b/src/crypto/rand/rand_windows.go new file mode 100644 index 0000000000000000000000000000000000000000..82b39b64a3c352e5f26e4d2bdc6e034a7b823a16 --- /dev/null +++ b/src/crypto/rand/rand_windows.go @@ -0,0 +1,47 @@ +// Copyright 2010 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Windows cryptographically secure pseudorandom number +// generator. + +package rand + +import ( + "os" + "sync" + "syscall" +) + +// Implemented by using Windows CryptoAPI 2.0. + +func init() { Reader = &rngReader{} } + +// A rngReader satisfies reads by reading from the Windows CryptGenRandom API. +type rngReader struct { + prov syscall.Handle + mu sync.Mutex +} + +func (r *rngReader) Read(b []byte) (n int, err error) { + r.mu.Lock() + if r.prov == 0 { + const provType = syscall.PROV_RSA_FULL + const flags = syscall.CRYPT_VERIFYCONTEXT | syscall.CRYPT_SILENT + err := syscall.CryptAcquireContext(&r.prov, nil, nil, provType, flags) + if err != nil { + r.mu.Unlock() + return 0, os.NewSyscallError("CryptAcquireContext", err) + } + } + r.mu.Unlock() + + if len(b) == 0 { + return 0, nil + } + err = syscall.CryptGenRandom(r.prov, uint32(len(b)), &b[0]) + if err != nil { + return 0, os.NewSyscallError("CryptGenRandom", err) + } + return len(b), nil +} diff --git a/src/crypto/rand/util.go b/src/crypto/rand/util.go new file mode 100644 index 0000000000000000000000000000000000000000..5f74407850c55f161493c2f6f311090e5761d7e2 --- /dev/null +++ b/src/crypto/rand/util.go @@ -0,0 +1,136 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package rand + +import ( + "errors" + "io" + "math/big" +) + +// smallPrimes is a list of small, prime numbers that allows us to rapidly +// exclude some fraction of composite candidates when searching for a random +// prime. This list is truncated at the point where smallPrimesProduct exceeds +// a uint64. It does not include two because we ensure that the candidates are +// odd by construction. +var smallPrimes = []uint8{ + 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, +} + +// smallPrimesProduct is the product of the values in smallPrimes and allows us +// to reduce a candidate prime by this number and then determine whether it's +// coprime to all the elements of smallPrimes without further big.Int +// operations. +var smallPrimesProduct = new(big.Int).SetUint64(16294579238595022365) + +// Prime returns a number, p, of the given size, such that p is prime +// with high probability. +// Prime will return error for any error returned by rand.Read or if bits < 2. +func Prime(rand io.Reader, bits int) (p *big.Int, err error) { + if bits < 2 { + err = errors.New("crypto/rand: prime size must be at least 2-bit") + return + } + + b := uint(bits % 8) + if b == 0 { + b = 8 + } + + bytes := make([]byte, (bits+7)/8) + p = new(big.Int) + + bigMod := new(big.Int) + + for { + _, err = io.ReadFull(rand, bytes) + if err != nil { + return nil, err + } + + // Clear bits in the first byte to make sure the candidate has a size <= bits. + bytes[0] &= uint8(int(1<= 2 { + bytes[0] |= 3 << (b - 2) + } else { + // Here b==1, because b cannot be zero. + bytes[0] |= 1 + if len(bytes) > 1 { + bytes[1] |= 0x80 + } + } + // Make the value odd since an even number this large certainly isn't prime. + bytes[len(bytes)-1] |= 1 + + p.SetBytes(bytes) + + // Calculate the value mod the product of smallPrimes. If it's + // a multiple of any of these primes we add two until it isn't. + // The probability of overflowing is minimal and can be ignored + // because we still perform Miller-Rabin tests on the result. + bigMod.Mod(p, smallPrimesProduct) + mod := bigMod.Uint64() + + NextDelta: + for delta := uint64(0); delta < 1<<20; delta += 2 { + m := mod + delta + for _, prime := range smallPrimes { + if m%uint64(prime) == 0 && (bits > 6 || m != uint64(prime)) { + continue NextDelta + } + } + + if delta > 0 { + bigMod.SetUint64(delta) + p.Add(p, bigMod) + } + break + } + + // There is a tiny possibility that, by adding delta, we caused + // the number to be one bit too long. Thus we check BitLen + // here. + if p.ProbablyPrime(20) && p.BitLen() == bits { + return + } + } +} + +// Int returns a uniform random value in [0, max). It panics if max <= 0. +func Int(rand io.Reader, max *big.Int) (n *big.Int, err error) { + if max.Sign() <= 0 { + panic("crypto/rand: argument to Int is <= 0") + } + k := (max.BitLen() + 7) / 8 + + // b is the number of bits in the most significant byte of max. + b := uint(max.BitLen() % 8) + if b == 0 { + b = 8 + } + + bytes := make([]byte, k) + n = new(big.Int) + + for { + _, err = io.ReadFull(rand, bytes) + if err != nil { + return nil, err + } + + // Clear bits in the first byte to increase the probability + // that the candidate is < max. + bytes[0] &= uint8(int(1< 256 { + return nil, KeySizeError(k) + } + var c Cipher + for i := 0; i < 256; i++ { + c.s[i] = uint32(i) + } + var j uint8 = 0 + for i := 0; i < 256; i++ { + j += uint8(c.s[i]) + key[i%k] + c.s[i], c.s[j] = c.s[j], c.s[i] + } + return &c, nil +} + +// Reset zeros the key data so that it will no longer appear in the +// process's memory. +func (c *Cipher) Reset() { + for i := range c.s { + c.s[i] = 0 + } + c.i, c.j = 0, 0 +} + +// xorKeyStreamGeneric sets dst to the result of XORing src with the +// key stream. Dst and src may be the same slice but otherwise should +// not overlap. +// +// This is the pure Go version. rc4_{amd64,386,arm}* contain assembly +// implementations. This is here for tests and to prevent bitrot. +func (c *Cipher) xorKeyStreamGeneric(dst, src []byte) { + i, j := c.i, c.j + for k, v := range src { + i += 1 + j += uint8(c.s[i]) + c.s[i], c.s[j] = c.s[j], c.s[i] + dst[k] = v ^ uint8(c.s[uint8(c.s[i]+c.s[j])]) + } + c.i, c.j = i, j +} diff --git a/src/crypto/rc4/rc4_386.s b/src/crypto/rc4/rc4_386.s new file mode 100644 index 0000000000000000000000000000000000000000..54221036bac8102b9799e5183b4e66fb6d41015a --- /dev/null +++ b/src/crypto/rc4/rc4_386.s @@ -0,0 +1,53 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +#include "textflag.h" + +// func xorKeyStream(dst, src *byte, n int, state *[256]byte, i, j *uint8) +TEXT ·xorKeyStream(SB),NOSPLIT,$0 + MOVL dst+0(FP), DI + MOVL src+4(FP), SI + MOVL state+12(FP), BP + + MOVL i+16(FP), AX + MOVBLZX (AX), AX + MOVL j+20(FP), BX + MOVBLZX (BX), BX + CMPL n+8(FP), $0 + JEQ done + +loop: + // i += 1 + INCB AX + + // j += c.s[i] + MOVBLZX (BP)(AX*4), DX + ADDB DX, BX + MOVBLZX BX, BX + + // c.s[i], c.s[j] = c.s[j], c.s[i] + MOVBLZX (BP)(BX*4), CX + MOVB CX, (BP)(AX*4) + MOVB DX, (BP)(BX*4) + + // *dst = *src ^ c.s[c.s[i]+c.s[j]] + ADDB DX, CX + MOVBLZX CX, CX + MOVB (BP)(CX*4), CX + XORB (SI), CX + MOVBLZX CX, CX + MOVB CX, (DI) + + INCL SI + INCL DI + DECL n+8(FP) + JNE loop + +done: + MOVL i+16(FP), CX + MOVB AX, (CX) + MOVL j+20(FP), CX + MOVB BX, (CX) + + RET diff --git a/src/crypto/rc4/rc4_amd64.s b/src/crypto/rc4/rc4_amd64.s new file mode 100644 index 0000000000000000000000000000000000000000..57d941c8f3cc757c1db5adf6308d8cb73e3153e9 --- /dev/null +++ b/src/crypto/rc4/rc4_amd64.s @@ -0,0 +1,179 @@ +// Original source: +// http://www.zorinaq.com/papers/rc4-amd64.html +// http://www.zorinaq.com/papers/rc4-amd64.tar.bz2 + +#include "textflag.h" + +// Local modifications: +// +// Transliterated from GNU to 6a assembly syntax by the Go authors. +// The comments and spacing are from the original. +// +// The new EXTEND macros avoid a bad stall on some systems after 8-bit math. +// +// The original code accumulated 64 bits of key stream in an integer +// register and then XOR'ed the key stream into the data 8 bytes at a time. +// Modified to accumulate 128 bits of key stream into an XMM register +// and then XOR the key stream into the data 16 bytes at a time. +// Approximately doubles throughput. + +// NOTE: Changing EXTEND to a no-op makes the code run 1.2x faster on Core i5 +// but makes the code run 2.0x slower on Xeon. +#define EXTEND(r) MOVBLZX r, r + +/* +** RC4 implementation optimized for AMD64. +** +** Author: Marc Bevand +** Licence: I hereby disclaim the copyright on this code and place it +** in the public domain. +** +** The code has been designed to be easily integrated into openssl: +** the exported RC4() function can replace the actual implementations +** openssl already contains. Please note that when linking with openssl, +** it requires that sizeof(RC4_INT) == 8. So openssl must be compiled +** with -DRC4_INT='unsigned long'. +** +** The throughput achieved by this code is about 320 MBytes/sec, on +** a 1.8 GHz AMD Opteron (rev C0) processor. +*/ + +TEXT ·xorKeyStream(SB),NOSPLIT,$0 + MOVQ n+16(FP), BX // rbx = ARG(len) + MOVQ src+8(FP), SI // in = ARG(in) + MOVQ dst+0(FP), DI // out = ARG(out) + MOVQ state+24(FP), BP // d = ARG(data) + MOVQ i+32(FP), AX + MOVBQZX 0(AX), CX // x = *xp + MOVQ j+40(FP), AX + MOVBQZX 0(AX), DX // y = *yp + + LEAQ (SI)(BX*1), R9 // limit = in+len + +l1: CMPQ SI, R9 // cmp in with in+len + JGE finished // jump if (in >= in+len) + + INCB CX + EXTEND(CX) + TESTL $15, CX + JZ wordloop + + MOVBLZX (BP)(CX*4), AX + + ADDB AX, DX // y += tx + EXTEND(DX) + MOVBLZX (BP)(DX*4), BX // ty = d[y] + MOVB BX, (BP)(CX*4) // d[x] = ty + ADDB AX, BX // val = ty+tx + EXTEND(BX) + MOVB AX, (BP)(DX*4) // d[y] = tx + MOVBLZX (BP)(BX*4), R8 // val = d[val] + XORB (SI), R8 // xor 1 byte + MOVB R8, (DI) + INCQ SI // in++ + INCQ DI // out++ + JMP l1 + +wordloop: + SUBQ $16, R9 + CMPQ SI, R9 + JGT end + +start: + ADDQ $16, SI // increment in + ADDQ $16, DI // increment out + + // Each KEYROUND generates one byte of key and + // inserts it into an XMM register at the given 16-bit index. + // The key state array is uint32 words only using the bottom + // byte of each word, so the 16-bit OR only copies 8 useful bits. + // We accumulate alternating bytes into X0 and X1, and then at + // the end we OR X1<<8 into X0 to produce the actual key. + // + // At the beginning of the loop, CX%16 == 0, so the 16 loads + // at state[CX], state[CX+1], ..., state[CX+15] can precompute + // (state+CX) as R12 and then become R12[0], R12[1], ... R12[15], + // without fear of the byte computation CX+15 wrapping around. + // + // The first round needs R12[0], the second needs R12[1], and so on. + // We can avoid memory stalls by starting the load for round n+1 + // before the end of round n, using the LOAD macro. + LEAQ (BP)(CX*4), R12 + +#define KEYROUND(xmm, load, off, r1, r2, index) \ + MOVBLZX (BP)(DX*4), R8; \ + MOVB r1, (BP)(DX*4); \ + load((off+1), r2); \ + MOVB R8, (off*4)(R12); \ + ADDB r1, R8; \ + EXTEND(R8); \ + PINSRW $index, (BP)(R8*4), xmm + +#define LOAD(off, reg) \ + MOVBLZX (off*4)(R12), reg; \ + ADDB reg, DX; \ + EXTEND(DX) + +#define SKIP(off, reg) + + LOAD(0, AX) + KEYROUND(X0, LOAD, 0, AX, BX, 0) + KEYROUND(X1, LOAD, 1, BX, AX, 0) + KEYROUND(X0, LOAD, 2, AX, BX, 1) + KEYROUND(X1, LOAD, 3, BX, AX, 1) + KEYROUND(X0, LOAD, 4, AX, BX, 2) + KEYROUND(X1, LOAD, 5, BX, AX, 2) + KEYROUND(X0, LOAD, 6, AX, BX, 3) + KEYROUND(X1, LOAD, 7, BX, AX, 3) + KEYROUND(X0, LOAD, 8, AX, BX, 4) + KEYROUND(X1, LOAD, 9, BX, AX, 4) + KEYROUND(X0, LOAD, 10, AX, BX, 5) + KEYROUND(X1, LOAD, 11, BX, AX, 5) + KEYROUND(X0, LOAD, 12, AX, BX, 6) + KEYROUND(X1, LOAD, 13, BX, AX, 6) + KEYROUND(X0, LOAD, 14, AX, BX, 7) + KEYROUND(X1, SKIP, 15, BX, AX, 7) + + ADDB $16, CX + + PSLLQ $8, X1 + PXOR X1, X0 + MOVOU -16(SI), X2 + PXOR X0, X2 + MOVOU X2, -16(DI) + + CMPQ SI, R9 // cmp in with in+len-16 + JLE start // jump if (in <= in+len-16) + +end: + DECB CX + ADDQ $16, R9 // tmp = in+len + + // handle the last bytes, one by one +l2: CMPQ SI, R9 // cmp in with in+len + JGE finished // jump if (in >= in+len) + + INCB CX + EXTEND(CX) + MOVBLZX (BP)(CX*4), AX + + ADDB AX, DX // y += tx + EXTEND(DX) + MOVBLZX (BP)(DX*4), BX // ty = d[y] + MOVB BX, (BP)(CX*4) // d[x] = ty + ADDB AX, BX // val = ty+tx + EXTEND(BX) + MOVB AX, (BP)(DX*4) // d[y] = tx + MOVBLZX (BP)(BX*4), R8 // val = d[val] + XORB (SI), R8 // xor 1 byte + MOVB R8, (DI) + INCQ SI // in++ + INCQ DI // out++ + JMP l2 + +finished: + MOVQ j+40(FP), BX + MOVB DX, 0(BX) + MOVQ i+32(FP), AX + MOVB CX, 0(AX) + RET diff --git a/src/crypto/rc4/rc4_amd64p32.s b/src/crypto/rc4/rc4_amd64p32.s new file mode 100644 index 0000000000000000000000000000000000000000..970b34e08eff6f010615c06efe091e63cb0f3a29 --- /dev/null +++ b/src/crypto/rc4/rc4_amd64p32.s @@ -0,0 +1,192 @@ +// Original source: +// http://www.zorinaq.com/papers/rc4-amd64.html +// http://www.zorinaq.com/papers/rc4-amd64.tar.bz2 + +#include "textflag.h" + +// Local modifications: +// +// Transliterated from GNU to 6a assembly syntax by the Go authors. +// The comments and spacing are from the original. +// +// The new EXTEND macros avoid a bad stall on some systems after 8-bit math. +// +// The original code accumulated 64 bits of key stream in an integer +// register and then XOR'ed the key stream into the data 8 bytes at a time. +// Modified to accumulate 128 bits of key stream into an XMM register +// and then XOR the key stream into the data 16 bytes at a time. +// Approximately doubles throughput. +// +// Converted to amd64p32. +// +// To make safe for Native Client, avoid use of BP, R15, +// and two-register addressing modes. + +// NOTE: Changing EXTEND to a no-op makes the code run 1.2x faster on Core i5 +// but makes the code run 2.0x slower on Xeon. +#define EXTEND(r) MOVBLZX r, r + +/* +** RC4 implementation optimized for AMD64. +** +** Author: Marc Bevand +** Licence: I hereby disclaim the copyright on this code and place it +** in the public domain. +** +** The code has been designed to be easily integrated into openssl: +** the exported RC4() function can replace the actual implementations +** openssl already contains. Please note that when linking with openssl, +** it requires that sizeof(RC4_INT) == 8. So openssl must be compiled +** with -DRC4_INT='unsigned long'. +** +** The throughput achieved by this code is about 320 MBytes/sec, on +** a 1.8 GHz AMD Opteron (rev C0) processor. +*/ + +TEXT ·xorKeyStream(SB),NOSPLIT,$0 + MOVL n+8(FP), BX // rbx = ARG(len) + MOVL src+4(FP), SI // in = ARG(in) + MOVL dst+0(FP), DI // out = ARG(out) + MOVL state+12(FP), R10 // d = ARG(data) + MOVL i+16(FP), AX + MOVBQZX 0(AX), CX // x = *xp + MOVL j+20(FP), AX + MOVBQZX 0(AX), DX // y = *yp + + LEAQ (SI)(BX*1), R9 // limit = in+len + +l1: CMPQ SI, R9 // cmp in with in+len + JGE finished // jump if (in >= in+len) + + INCB CX + EXTEND(CX) + TESTL $15, CX + JZ wordloop + LEAL (R10)(CX*4), R12 + + MOVBLZX (R12), AX + + ADDB AX, DX // y += tx + EXTEND(DX) + LEAL (R10)(DX*4), R11 + MOVBLZX (R11), BX // ty = d[y] + MOVB BX, (R12) // d[x] = ty + ADDB AX, BX // val = ty+tx + EXTEND(BX) + LEAL (R10)(BX*4), R13 + MOVB AX, (R11) // d[y] = tx + MOVBLZX (R13), R8 // val = d[val] + XORB (SI), R8 // xor 1 byte + MOVB R8, (DI) + INCQ SI // in++ + INCQ DI // out++ + JMP l1 + +wordloop: + SUBQ $16, R9 + CMPQ SI, R9 + JGT end + +start: + ADDQ $16, SI // increment in + ADDQ $16, DI // increment out + + // Each KEYROUND generates one byte of key and + // inserts it into an XMM register at the given 16-bit index. + // The key state array is uint32 words only using the bottom + // byte of each word, so the 16-bit OR only copies 8 useful bits. + // We accumulate alternating bytes into X0 and X1, and then at + // the end we OR X1<<8 into X0 to produce the actual key. + // + // At the beginning of the loop, CX%16 == 0, so the 16 loads + // at state[CX], state[CX+1], ..., state[CX+15] can precompute + // (state+CX) as R12 and then become R12[0], R12[1], ... R12[15], + // without fear of the byte computation CX+15 wrapping around. + // + // The first round needs R12[0], the second needs R12[1], and so on. + // We can avoid memory stalls by starting the load for round n+1 + // before the end of round n, using the LOAD macro. + LEAQ (R10)(CX*4), R12 + +#define KEYROUND(xmm, load, off, r1, r2, index) \ + LEAL (R10)(DX*4), R11; \ + MOVBLZX (R11), R8; \ + MOVB r1, (R11); \ + load((off+1), r2); \ + MOVB R8, (off*4)(R12); \ + ADDB r1, R8; \ + EXTEND(R8); \ + LEAL (R10)(R8*4), R14; \ + PINSRW $index, (R14), xmm + +#define LOAD(off, reg) \ + MOVBLZX (off*4)(R12), reg; \ + ADDB reg, DX; \ + EXTEND(DX) + +#define SKIP(off, reg) + + LOAD(0, AX) + KEYROUND(X0, LOAD, 0, AX, BX, 0) + KEYROUND(X1, LOAD, 1, BX, AX, 0) + KEYROUND(X0, LOAD, 2, AX, BX, 1) + KEYROUND(X1, LOAD, 3, BX, AX, 1) + KEYROUND(X0, LOAD, 4, AX, BX, 2) + KEYROUND(X1, LOAD, 5, BX, AX, 2) + KEYROUND(X0, LOAD, 6, AX, BX, 3) + KEYROUND(X1, LOAD, 7, BX, AX, 3) + KEYROUND(X0, LOAD, 8, AX, BX, 4) + KEYROUND(X1, LOAD, 9, BX, AX, 4) + KEYROUND(X0, LOAD, 10, AX, BX, 5) + KEYROUND(X1, LOAD, 11, BX, AX, 5) + KEYROUND(X0, LOAD, 12, AX, BX, 6) + KEYROUND(X1, LOAD, 13, BX, AX, 6) + KEYROUND(X0, LOAD, 14, AX, BX, 7) + KEYROUND(X1, SKIP, 15, BX, AX, 7) + + ADDB $16, CX + + PSLLQ $8, X1 + PXOR X1, X0 + MOVOU -16(SI), X2 + PXOR X0, X2 + MOVOU X2, -16(DI) + + CMPQ SI, R9 // cmp in with in+len-16 + JLE start // jump if (in <= in+len-16) + +end: + DECB CX + ADDQ $16, R9 // tmp = in+len + + // handle the last bytes, one by one +l2: CMPQ SI, R9 // cmp in with in+len + JGE finished // jump if (in >= in+len) + + INCB CX + EXTEND(CX) + LEAL (R10)(CX*4), R12 + MOVBLZX (R12), AX + + ADDB AX, DX // y += tx + EXTEND(DX) + LEAL (R10)(DX*4), R11 + MOVBLZX (R11), BX // ty = d[y] + MOVB BX, (R12) // d[x] = ty + ADDB AX, BX // val = ty+tx + EXTEND(BX) + LEAL (R10)(BX*4), R13 + MOVB AX, (R11) // d[y] = tx + MOVBLZX (R13), R8 // val = d[val] + XORB (SI), R8 // xor 1 byte + MOVB R8, (DI) + INCQ SI // in++ + INCQ DI // out++ + JMP l2 + +finished: + MOVL j+20(FP), BX + MOVB DX, 0(BX) + MOVL i+16(FP), AX + MOVB CX, 0(AX) + RET diff --git a/src/crypto/rc4/rc4_arm.s b/src/crypto/rc4/rc4_arm.s new file mode 100644 index 0000000000000000000000000000000000000000..05e94cbcf2cbe2dd2d556e48ec52d50be81d3423 --- /dev/null +++ b/src/crypto/rc4/rc4_arm.s @@ -0,0 +1,62 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build !nacl + +#include "textflag.h" + +// Registers +#define Rdst R0 +#define Rsrc R1 +#define Rn R2 +#define Rstate R3 +#define Rpi R4 +#define Rpj R5 +#define Ri R6 +#define Rj R7 +#define Rk R8 +#define Rt R11 +#define Rt2 R12 + +// func xorKeyStream(dst, src *byte, n int, state *[256]byte, i, j *uint8) +TEXT ·xorKeyStream(SB),NOSPLIT,$0 + MOVW dst+0(FP), Rdst + MOVW src+4(FP), Rsrc + MOVW n+8(FP), Rn + MOVW state+12(FP), Rstate + MOVW pi+16(FP), Rpi + MOVW pj+20(FP), Rpj + MOVBU (Rpi), Ri + MOVBU (Rpj), Rj + MOVW $0, Rk + +loop: + // i += 1; j += state[i] + ADD $1, Ri + AND $0xff, Ri + MOVBU Ri<<2(Rstate), Rt + ADD Rt, Rj + AND $0xff, Rj + + // swap state[i] <-> state[j] + MOVBU Rj<<2(Rstate), Rt2 + MOVB Rt2, Ri<<2(Rstate) + MOVB Rt, Rj<<2(Rstate) + + // dst[k] = src[k] ^ state[state[i] + state[j]] + ADD Rt2, Rt + AND $0xff, Rt + MOVBU Rt<<2(Rstate), Rt + MOVBU Rk<<0(Rsrc), Rt2 + EOR Rt, Rt2 + MOVB Rt2, Rk<<0(Rdst) + + ADD $1, Rk + CMP Rk, Rn + BNE loop + +done: + MOVB Ri, (Rpi) + MOVB Rj, (Rpj) + RET diff --git a/src/crypto/rc4/rc4_asm.go b/src/crypto/rc4/rc4_asm.go new file mode 100644 index 0000000000000000000000000000000000000000..02e5b67d55385f604a26711d206ed1e105a818ae --- /dev/null +++ b/src/crypto/rc4/rc4_asm.go @@ -0,0 +1,18 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build amd64 amd64p32 arm,!nacl 386 + +package rc4 + +func xorKeyStream(dst, src *byte, n int, state *[256]uint32, i, j *uint8) + +// XORKeyStream sets dst to the result of XORing src with the key stream. +// Dst and src may be the same slice but otherwise should not overlap. +func (c *Cipher) XORKeyStream(dst, src []byte) { + if len(src) == 0 { + return + } + xorKeyStream(&dst[0], &src[0], len(src), &c.s, &c.i, &c.j) +} diff --git a/src/crypto/rc4/rc4_ref.go b/src/crypto/rc4/rc4_ref.go new file mode 100644 index 0000000000000000000000000000000000000000..e34bd34cf1df90d7719b20ded5ab87da1a92d3bc --- /dev/null +++ b/src/crypto/rc4/rc4_ref.go @@ -0,0 +1,13 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build !amd64,!amd64p32,!arm,!386 arm,nacl + +package rc4 + +// XORKeyStream sets dst to the result of XORing src with the key stream. +// Dst and src may be the same slice but otherwise should not overlap. +func (c *Cipher) XORKeyStream(dst, src []byte) { + c.xorKeyStreamGeneric(dst, src) +} diff --git a/src/crypto/rc4/rc4_test.go b/src/crypto/rc4/rc4_test.go new file mode 100644 index 0000000000000000000000000000000000000000..af7988246329d5c4018db2506ebcfcb19427e071 --- /dev/null +++ b/src/crypto/rc4/rc4_test.go @@ -0,0 +1,173 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package rc4 + +import ( + "bytes" + "fmt" + "testing" +) + +type rc4Test struct { + key, keystream []byte +} + +var golden = []rc4Test{ + // Test vectors from the original cypherpunk posting of ARC4: + // http://groups.google.com/group/sci.crypt/msg/10a300c9d21afca0?pli=1 + { + []byte{0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef}, + []byte{0x74, 0x94, 0xc2, 0xe7, 0x10, 0x4b, 0x08, 0x79}, + }, + { + []byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, + []byte{0xde, 0x18, 0x89, 0x41, 0xa3, 0x37, 0x5d, 0x3a}, + }, + { + []byte{0xef, 0x01, 0x23, 0x45}, + []byte{0xd6, 0xa1, 0x41, 0xa7, 0xec, 0x3c, 0x38, 0xdf, 0xbd, 0x61}, + }, + + // Test vectors from the Wikipedia page: http://en.wikipedia.org/wiki/RC4 + { + []byte{0x4b, 0x65, 0x79}, + []byte{0xeb, 0x9f, 0x77, 0x81, 0xb7, 0x34, 0xca, 0x72, 0xa7, 0x19}, + }, + { + []byte{0x57, 0x69, 0x6b, 0x69}, + []byte{0x60, 0x44, 0xdb, 0x6d, 0x41, 0xb7}, + }, + { + []byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, + []byte{ + 0xde, 0x18, 0x89, 0x41, 0xa3, 0x37, 0x5d, 0x3a, + 0x8a, 0x06, 0x1e, 0x67, 0x57, 0x6e, 0x92, 0x6d, + 0xc7, 0x1a, 0x7f, 0xa3, 0xf0, 0xcc, 0xeb, 0x97, + 0x45, 0x2b, 0x4d, 0x32, 0x27, 0x96, 0x5f, 0x9e, + 0xa8, 0xcc, 0x75, 0x07, 0x6d, 0x9f, 0xb9, 0xc5, + 0x41, 0x7a, 0xa5, 0xcb, 0x30, 0xfc, 0x22, 0x19, + 0x8b, 0x34, 0x98, 0x2d, 0xbb, 0x62, 0x9e, 0xc0, + 0x4b, 0x4f, 0x8b, 0x05, 0xa0, 0x71, 0x08, 0x50, + 0x92, 0xa0, 0xc3, 0x58, 0x4a, 0x48, 0xe4, 0xa3, + 0x0a, 0x39, 0x7b, 0x8a, 0xcd, 0x1d, 0x00, 0x9e, + 0xc8, 0x7d, 0x68, 0x11, 0xf2, 0x2c, 0xf4, 0x9c, + 0xa3, 0xe5, 0x93, 0x54, 0xb9, 0x45, 0x15, 0x35, + 0xa2, 0x18, 0x7a, 0x86, 0x42, 0x6c, 0xca, 0x7d, + 0x5e, 0x82, 0x3e, 0xba, 0x00, 0x44, 0x12, 0x67, + 0x12, 0x57, 0xb8, 0xd8, 0x60, 0xae, 0x4c, 0xbd, + 0x4c, 0x49, 0x06, 0xbb, 0xc5, 0x35, 0xef, 0xe1, + 0x58, 0x7f, 0x08, 0xdb, 0x33, 0x95, 0x5c, 0xdb, + 0xcb, 0xad, 0x9b, 0x10, 0xf5, 0x3f, 0xc4, 0xe5, + 0x2c, 0x59, 0x15, 0x65, 0x51, 0x84, 0x87, 0xfe, + 0x08, 0x4d, 0x0e, 0x3f, 0x03, 0xde, 0xbc, 0xc9, + 0xda, 0x1c, 0xe9, 0x0d, 0x08, 0x5c, 0x2d, 0x8a, + 0x19, 0xd8, 0x37, 0x30, 0x86, 0x16, 0x36, 0x92, + 0x14, 0x2b, 0xd8, 0xfc, 0x5d, 0x7a, 0x73, 0x49, + 0x6a, 0x8e, 0x59, 0xee, 0x7e, 0xcf, 0x6b, 0x94, + 0x06, 0x63, 0xf4, 0xa6, 0xbe, 0xe6, 0x5b, 0xd2, + 0xc8, 0x5c, 0x46, 0x98, 0x6c, 0x1b, 0xef, 0x34, + 0x90, 0xd3, 0x7b, 0x38, 0xda, 0x85, 0xd3, 0x2e, + 0x97, 0x39, 0xcb, 0x23, 0x4a, 0x2b, 0xe7, 0x40, + }, + }, +} + +func testEncrypt(t *testing.T, desc string, c *Cipher, src, expect []byte) { + dst := make([]byte, len(src)) + c.XORKeyStream(dst, src) + for i, v := range dst { + if v != expect[i] { + t.Fatalf("%s: mismatch at byte %d:\nhave %x\nwant %x", desc, i, dst, expect) + } + } +} + +func TestGolden(t *testing.T) { + for gi, g := range golden { + data := make([]byte, len(g.keystream)) + for i := range data { + data[i] = byte(i) + } + + expect := make([]byte, len(g.keystream)) + for i := range expect { + expect[i] = byte(i) ^ g.keystream[i] + } + + for size := 1; size <= len(g.keystream); size++ { + c, err := NewCipher(g.key) + if err != nil { + t.Fatalf("#%d: NewCipher: %v", gi, err) + } + + off := 0 + for off < len(g.keystream) { + n := len(g.keystream) - off + if n > size { + n = size + } + desc := fmt.Sprintf("#%d@[%d:%d]", gi, off, off+n) + testEncrypt(t, desc, c, data[off:off+n], expect[off:off+n]) + off += n + } + } + } +} + +func TestBlock(t *testing.T) { + testBlock(t, (*Cipher).XORKeyStream) +} + +// Test the pure Go version. +// Because we have assembly for amd64, 386, and arm, this prevents +// bitrot of the reference implementations. +func TestBlockGeneric(t *testing.T) { + testBlock(t, (*Cipher).xorKeyStreamGeneric) +} + +func testBlock(t *testing.T, xor func(c *Cipher, dst, src []byte)) { + c1a, _ := NewCipher(golden[0].key) + c1b, _ := NewCipher(golden[1].key) + data1 := make([]byte, 1<<20) + for i := range data1 { + xor(c1a, data1[i:i+1], data1[i:i+1]) + xor(c1b, data1[i:i+1], data1[i:i+1]) + } + + c2a, _ := NewCipher(golden[0].key) + c2b, _ := NewCipher(golden[1].key) + data2 := make([]byte, 1<<20) + xor(c2a, data2, data2) + xor(c2b, data2, data2) + + if !bytes.Equal(data1, data2) { + t.Fatalf("bad block") + } +} + +func benchmark(b *testing.B, size int64) { + buf := make([]byte, size) + c, err := NewCipher(golden[0].key) + if err != nil { + panic(err) + } + b.SetBytes(size) + + for i := 0; i < b.N; i++ { + c.XORKeyStream(buf, buf) + } +} + +func BenchmarkRC4_128(b *testing.B) { + benchmark(b, 128) +} + +func BenchmarkRC4_1K(b *testing.B) { + benchmark(b, 1024) +} + +func BenchmarkRC4_8K(b *testing.B) { + benchmark(b, 8096) +} diff --git a/src/crypto/rsa/pkcs1v15.go b/src/crypto/rsa/pkcs1v15.go new file mode 100644 index 0000000000000000000000000000000000000000..34037b0d674f72a8d3ec89bba1aa1a3d6c2594e7 --- /dev/null +++ b/src/crypto/rsa/pkcs1v15.go @@ -0,0 +1,302 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package rsa + +import ( + "crypto" + "crypto/subtle" + "errors" + "io" + "math/big" +) + +// This file implements encryption and decryption using PKCS#1 v1.5 padding. + +// PKCS1v15DecrypterOpts is for passing options to PKCS#1 v1.5 decryption using +// the crypto.Decrypter interface. +type PKCS1v15DecryptOptions struct { + // SessionKeyLen is the length of the session key that is being + // decrypted. If not zero, then a padding error during decryption will + // cause a random plaintext of this length to be returned rather than + // an error. These alternatives happen in constant time. + SessionKeyLen int +} + +// EncryptPKCS1v15 encrypts the given message with RSA and the padding scheme from PKCS#1 v1.5. +// The message must be no longer than the length of the public modulus minus 11 bytes. +// WARNING: use of this function to encrypt plaintexts other than session keys +// is dangerous. Use RSA OAEP in new protocols. +func EncryptPKCS1v15(rand io.Reader, pub *PublicKey, msg []byte) (out []byte, err error) { + if err := checkPub(pub); err != nil { + return nil, err + } + k := (pub.N.BitLen() + 7) / 8 + if len(msg) > k-11 { + err = ErrMessageTooLong + return + } + + // EM = 0x00 || 0x02 || PS || 0x00 || M + em := make([]byte, k) + em[1] = 2 + ps, mm := em[2:len(em)-len(msg)-1], em[len(em)-len(msg):] + err = nonZeroRandomBytes(ps, rand) + if err != nil { + return + } + em[len(em)-len(msg)-1] = 0 + copy(mm, msg) + + m := new(big.Int).SetBytes(em) + c := encrypt(new(big.Int), pub, m) + + copyWithLeftPad(em, c.Bytes()) + out = em + return +} + +// DecryptPKCS1v15 decrypts a plaintext using RSA and the padding scheme from PKCS#1 v1.5. +// If rand != nil, it uses RSA blinding to avoid timing side-channel attacks. +func DecryptPKCS1v15(rand io.Reader, priv *PrivateKey, ciphertext []byte) (out []byte, err error) { + if err := checkPub(&priv.PublicKey); err != nil { + return nil, err + } + valid, out, index, err := decryptPKCS1v15(rand, priv, ciphertext) + if err != nil { + return + } + if valid == 0 { + return nil, ErrDecryption + } + out = out[index:] + return +} + +// DecryptPKCS1v15SessionKey decrypts a session key using RSA and the padding scheme from PKCS#1 v1.5. +// If rand != nil, it uses RSA blinding to avoid timing side-channel attacks. +// It returns an error if the ciphertext is the wrong length or if the +// ciphertext is greater than the public modulus. Otherwise, no error is +// returned. If the padding is valid, the resulting plaintext message is copied +// into key. Otherwise, key is unchanged. These alternatives occur in constant +// time. It is intended that the user of this function generate a random +// session key beforehand and continue the protocol with the resulting value. +// This will remove any possibility that an attacker can learn any information +// about the plaintext. +// See ``Chosen Ciphertext Attacks Against Protocols Based on the RSA +// Encryption Standard PKCS #1'', Daniel Bleichenbacher, Advances in Cryptology +// (Crypto '98). +func DecryptPKCS1v15SessionKey(rand io.Reader, priv *PrivateKey, ciphertext []byte, key []byte) (err error) { + if err := checkPub(&priv.PublicKey); err != nil { + return err + } + k := (priv.N.BitLen() + 7) / 8 + if k-(len(key)+3+8) < 0 { + return ErrDecryption + } + + valid, em, index, err := decryptPKCS1v15(rand, priv, ciphertext) + if err != nil { + return + } + + if len(em) != k { + // This should be impossible because decryptPKCS1v15 always + // returns the full slice. + return ErrDecryption + } + + valid &= subtle.ConstantTimeEq(int32(len(em)-index), int32(len(key))) + subtle.ConstantTimeCopy(valid, key, em[len(em)-len(key):]) + return +} + +// decryptPKCS1v15 decrypts ciphertext using priv and blinds the operation if +// rand is not nil. It returns one or zero in valid that indicates whether the +// plaintext was correctly structured. In either case, the plaintext is +// returned in em so that it may be read independently of whether it was valid +// in order to maintain constant memory access patterns. If the plaintext was +// valid then index contains the index of the original message in em. +func decryptPKCS1v15(rand io.Reader, priv *PrivateKey, ciphertext []byte) (valid int, em []byte, index int, err error) { + k := (priv.N.BitLen() + 7) / 8 + if k < 11 { + err = ErrDecryption + return + } + + c := new(big.Int).SetBytes(ciphertext) + m, err := decrypt(rand, priv, c) + if err != nil { + return + } + + em = leftPad(m.Bytes(), k) + firstByteIsZero := subtle.ConstantTimeByteEq(em[0], 0) + secondByteIsTwo := subtle.ConstantTimeByteEq(em[1], 2) + + // The remainder of the plaintext must be a string of non-zero random + // octets, followed by a 0, followed by the message. + // lookingForIndex: 1 iff we are still looking for the zero. + // index: the offset of the first zero byte. + lookingForIndex := 1 + + for i := 2; i < len(em); i++ { + equals0 := subtle.ConstantTimeByteEq(em[i], 0) + index = subtle.ConstantTimeSelect(lookingForIndex&equals0, i, index) + lookingForIndex = subtle.ConstantTimeSelect(equals0, 0, lookingForIndex) + } + + // The PS padding must be at least 8 bytes long, and it starts two + // bytes into em. + validPS := subtle.ConstantTimeLessOrEq(2+8, index) + + valid = firstByteIsZero & secondByteIsTwo & (^lookingForIndex & 1) & validPS + index = subtle.ConstantTimeSelect(valid, index+1, 0) + return valid, em, index, nil +} + +// nonZeroRandomBytes fills the given slice with non-zero random octets. +func nonZeroRandomBytes(s []byte, rand io.Reader) (err error) { + _, err = io.ReadFull(rand, s) + if err != nil { + return + } + + for i := 0; i < len(s); i++ { + for s[i] == 0 { + _, err = io.ReadFull(rand, s[i:i+1]) + if err != nil { + return + } + // In tests, the PRNG may return all zeros so we do + // this to break the loop. + s[i] ^= 0x42 + } + } + + return +} + +// These are ASN1 DER structures: +// DigestInfo ::= SEQUENCE { +// digestAlgorithm AlgorithmIdentifier, +// digest OCTET STRING +// } +// For performance, we don't use the generic ASN1 encoder. Rather, we +// precompute a prefix of the digest value that makes a valid ASN1 DER string +// with the correct contents. +var hashPrefixes = map[crypto.Hash][]byte{ + crypto.MD5: {0x30, 0x20, 0x30, 0x0c, 0x06, 0x08, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x02, 0x05, 0x05, 0x00, 0x04, 0x10}, + crypto.SHA1: {0x30, 0x21, 0x30, 0x09, 0x06, 0x05, 0x2b, 0x0e, 0x03, 0x02, 0x1a, 0x05, 0x00, 0x04, 0x14}, + crypto.SHA224: {0x30, 0x2d, 0x30, 0x0d, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x04, 0x05, 0x00, 0x04, 0x1c}, + crypto.SHA256: {0x30, 0x31, 0x30, 0x0d, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x01, 0x05, 0x00, 0x04, 0x20}, + crypto.SHA384: {0x30, 0x41, 0x30, 0x0d, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x02, 0x05, 0x00, 0x04, 0x30}, + crypto.SHA512: {0x30, 0x51, 0x30, 0x0d, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x03, 0x05, 0x00, 0x04, 0x40}, + crypto.MD5SHA1: {}, // A special TLS case which doesn't use an ASN1 prefix. + crypto.RIPEMD160: {0x30, 0x20, 0x30, 0x08, 0x06, 0x06, 0x28, 0xcf, 0x06, 0x03, 0x00, 0x31, 0x04, 0x14}, +} + +// SignPKCS1v15 calculates the signature of hashed using RSASSA-PKCS1-V1_5-SIGN from RSA PKCS#1 v1.5. +// Note that hashed must be the result of hashing the input message using the +// given hash function. If hash is zero, hashed is signed directly. This isn't +// advisable except for interoperability. +func SignPKCS1v15(rand io.Reader, priv *PrivateKey, hash crypto.Hash, hashed []byte) (s []byte, err error) { + hashLen, prefix, err := pkcs1v15HashInfo(hash, len(hashed)) + if err != nil { + return + } + + tLen := len(prefix) + hashLen + k := (priv.N.BitLen() + 7) / 8 + if k < tLen+11 { + return nil, ErrMessageTooLong + } + + // EM = 0x00 || 0x01 || PS || 0x00 || T + em := make([]byte, k) + em[1] = 1 + for i := 2; i < k-tLen-1; i++ { + em[i] = 0xff + } + copy(em[k-tLen:k-hashLen], prefix) + copy(em[k-hashLen:k], hashed) + + m := new(big.Int).SetBytes(em) + c, err := decrypt(rand, priv, m) + if err != nil { + return + } + + copyWithLeftPad(em, c.Bytes()) + s = em + return +} + +// VerifyPKCS1v15 verifies an RSA PKCS#1 v1.5 signature. +// hashed is the result of hashing the input message using the given hash +// function and sig is the signature. A valid signature is indicated by +// returning a nil error. If hash is zero then hashed is used directly. This +// isn't advisable except for interoperability. +func VerifyPKCS1v15(pub *PublicKey, hash crypto.Hash, hashed []byte, sig []byte) (err error) { + hashLen, prefix, err := pkcs1v15HashInfo(hash, len(hashed)) + if err != nil { + return + } + + tLen := len(prefix) + hashLen + k := (pub.N.BitLen() + 7) / 8 + if k < tLen+11 { + err = ErrVerification + return + } + + c := new(big.Int).SetBytes(sig) + m := encrypt(new(big.Int), pub, c) + em := leftPad(m.Bytes(), k) + // EM = 0x00 || 0x01 || PS || 0x00 || T + + ok := subtle.ConstantTimeByteEq(em[0], 0) + ok &= subtle.ConstantTimeByteEq(em[1], 1) + ok &= subtle.ConstantTimeCompare(em[k-hashLen:k], hashed) + ok &= subtle.ConstantTimeCompare(em[k-tLen:k-hashLen], prefix) + ok &= subtle.ConstantTimeByteEq(em[k-tLen-1], 0) + + for i := 2; i < k-tLen-1; i++ { + ok &= subtle.ConstantTimeByteEq(em[i], 0xff) + } + + if ok != 1 { + return ErrVerification + } + + return nil +} + +func pkcs1v15HashInfo(hash crypto.Hash, inLen int) (hashLen int, prefix []byte, err error) { + // Special case: crypto.Hash(0) is used to indicate that the data is + // signed directly. + if hash == 0 { + return inLen, nil, nil + } + + hashLen = hash.Size() + if inLen != hashLen { + return 0, nil, errors.New("crypto/rsa: input must be hashed message") + } + prefix, ok := hashPrefixes[hash] + if !ok { + return 0, nil, errors.New("crypto/rsa: unsupported hash function") + } + return +} + +// copyWithLeftPad copies src to the end of dest, padding with zero bytes as +// needed. +func copyWithLeftPad(dest, src []byte) { + numPaddingBytes := len(dest) - len(src) + for i := 0; i < numPaddingBytes; i++ { + dest[i] = 0 + } + copy(dest[numPaddingBytes:], src) +} diff --git a/src/crypto/rsa/pkcs1v15_test.go b/src/crypto/rsa/pkcs1v15_test.go new file mode 100644 index 0000000000000000000000000000000000000000..89253751ec2696784ed4bf42d654a090a05d360f --- /dev/null +++ b/src/crypto/rsa/pkcs1v15_test.go @@ -0,0 +1,298 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package rsa + +import ( + "bytes" + "crypto" + "crypto/rand" + "crypto/sha1" + "encoding/base64" + "encoding/hex" + "io" + "math/big" + "testing" + "testing/quick" +) + +func decodeBase64(in string) []byte { + out := make([]byte, base64.StdEncoding.DecodedLen(len(in))) + n, err := base64.StdEncoding.Decode(out, []byte(in)) + if err != nil { + return nil + } + return out[0:n] +} + +type DecryptPKCS1v15Test struct { + in, out string +} + +// These test vectors were generated with `openssl rsautl -pkcs -encrypt` +var decryptPKCS1v15Tests = []DecryptPKCS1v15Test{ + { + "gIcUIoVkD6ATMBk/u/nlCZCCWRKdkfjCgFdo35VpRXLduiKXhNz1XupLLzTXAybEq15juc+EgY5o0DHv/nt3yg==", + "x", + }, + { + "Y7TOCSqofGhkRb+jaVRLzK8xw2cSo1IVES19utzv6hwvx+M8kFsoWQm5DzBeJCZTCVDPkTpavUuEbgp8hnUGDw==", + "testing.", + }, + { + "arReP9DJtEVyV2Dg3dDp4c/PSk1O6lxkoJ8HcFupoRorBZG+7+1fDAwT1olNddFnQMjmkb8vxwmNMoTAT/BFjQ==", + "testing.\n", + }, + { + "WtaBXIoGC54+vH0NH0CHHE+dRDOsMc/6BrfFu2lEqcKL9+uDuWaf+Xj9mrbQCjjZcpQuX733zyok/jsnqe/Ftw==", + "01234567890123456789012345678901234567890123456789012", + }, +} + +func TestDecryptPKCS1v15(t *testing.T) { + decryptionFuncs := []func([]byte) ([]byte, error){ + func(ciphertext []byte) (plaintext []byte, err error) { + return DecryptPKCS1v15(nil, rsaPrivateKey, ciphertext) + }, + func(ciphertext []byte) (plaintext []byte, err error) { + return rsaPrivateKey.Decrypt(nil, ciphertext, nil) + }, + } + + for _, decryptFunc := range decryptionFuncs { + for i, test := range decryptPKCS1v15Tests { + out, err := decryptFunc(decodeBase64(test.in)) + if err != nil { + t.Errorf("#%d error decrypting", i) + } + want := []byte(test.out) + if !bytes.Equal(out, want) { + t.Errorf("#%d got:%#v want:%#v", i, out, want) + } + } + } +} + +func TestEncryptPKCS1v15(t *testing.T) { + random := rand.Reader + k := (rsaPrivateKey.N.BitLen() + 7) / 8 + + tryEncryptDecrypt := func(in []byte, blind bool) bool { + if len(in) > k-11 { + in = in[0 : k-11] + } + + ciphertext, err := EncryptPKCS1v15(random, &rsaPrivateKey.PublicKey, in) + if err != nil { + t.Errorf("error encrypting: %s", err) + return false + } + + var rand io.Reader + if !blind { + rand = nil + } else { + rand = random + } + plaintext, err := DecryptPKCS1v15(rand, rsaPrivateKey, ciphertext) + if err != nil { + t.Errorf("error decrypting: %s", err) + return false + } + + if !bytes.Equal(plaintext, in) { + t.Errorf("output mismatch: %#v %#v", plaintext, in) + return false + } + return true + } + + config := new(quick.Config) + if testing.Short() { + config.MaxCount = 10 + } + quick.Check(tryEncryptDecrypt, config) +} + +// These test vectors were generated with `openssl rsautl -pkcs -encrypt` +var decryptPKCS1v15SessionKeyTests = []DecryptPKCS1v15Test{ + { + "e6ukkae6Gykq0fKzYwULpZehX+UPXYzMoB5mHQUDEiclRbOTqas4Y0E6nwns1BBpdvEJcilhl5zsox/6DtGsYg==", + "1234", + }, + { + "Dtis4uk/q/LQGGqGk97P59K03hkCIVFMEFZRgVWOAAhxgYpCRG0MX2adptt92l67IqMki6iVQyyt0TtX3IdtEw==", + "FAIL", + }, + { + "LIyFyCYCptPxrvTxpol8F3M7ZivlMsf53zs0vHRAv+rDIh2YsHS69ePMoPMe3TkOMZ3NupiL3takPxIs1sK+dw==", + "abcd", + }, + { + "bafnobel46bKy76JzqU/RIVOH0uAYvzUtauKmIidKgM0sMlvobYVAVQPeUQ/oTGjbIZ1v/6Gyi5AO4DtHruGdw==", + "FAIL", + }, +} + +func TestEncryptPKCS1v15SessionKey(t *testing.T) { + for i, test := range decryptPKCS1v15SessionKeyTests { + key := []byte("FAIL") + err := DecryptPKCS1v15SessionKey(nil, rsaPrivateKey, decodeBase64(test.in), key) + if err != nil { + t.Errorf("#%d error decrypting", i) + } + want := []byte(test.out) + if !bytes.Equal(key, want) { + t.Errorf("#%d got:%#v want:%#v", i, key, want) + } + } +} + +func TestEncryptPKCS1v15DecrypterSessionKey(t *testing.T) { + for i, test := range decryptPKCS1v15SessionKeyTests { + plaintext, err := rsaPrivateKey.Decrypt(rand.Reader, decodeBase64(test.in), &PKCS1v15DecryptOptions{SessionKeyLen: 4}) + if err != nil { + t.Fatalf("#%d: error decrypting: %s", i, err) + } + if len(plaintext) != 4 { + t.Fatalf("#%d: incorrect length plaintext: got %d, want 4", i, len(plaintext)) + } + + if test.out != "FAIL" && !bytes.Equal(plaintext, []byte(test.out)) { + t.Errorf("#%d: incorrect plaintext: got %x, want %x", plaintext, test.out) + } + } +} + +func TestNonZeroRandomBytes(t *testing.T) { + random := rand.Reader + + b := make([]byte, 512) + err := nonZeroRandomBytes(b, random) + if err != nil { + t.Errorf("returned error: %s", err) + } + for _, b := range b { + if b == 0 { + t.Errorf("Zero octet found") + return + } + } +} + +type signPKCS1v15Test struct { + in, out string +} + +// These vectors have been tested with +// `openssl rsautl -verify -inkey pk -in signature | hexdump -C` +var signPKCS1v15Tests = []signPKCS1v15Test{ + {"Test.\n", "a4f3fa6ea93bcdd0c57be020c1193ecbfd6f200a3d95c409769b029578fa0e336ad9a347600e40d3ae823b8c7e6bad88cc07c1d54c3a1523cbbb6d58efc362ae"}, +} + +func TestSignPKCS1v15(t *testing.T) { + for i, test := range signPKCS1v15Tests { + h := sha1.New() + h.Write([]byte(test.in)) + digest := h.Sum(nil) + + s, err := SignPKCS1v15(nil, rsaPrivateKey, crypto.SHA1, digest) + if err != nil { + t.Errorf("#%d %s", i, err) + } + + expected, _ := hex.DecodeString(test.out) + if !bytes.Equal(s, expected) { + t.Errorf("#%d got: %x want: %x", i, s, expected) + } + } +} + +func TestVerifyPKCS1v15(t *testing.T) { + for i, test := range signPKCS1v15Tests { + h := sha1.New() + h.Write([]byte(test.in)) + digest := h.Sum(nil) + + sig, _ := hex.DecodeString(test.out) + + err := VerifyPKCS1v15(&rsaPrivateKey.PublicKey, crypto.SHA1, digest, sig) + if err != nil { + t.Errorf("#%d %s", i, err) + } + } +} + +func TestOverlongMessagePKCS1v15(t *testing.T) { + ciphertext := decodeBase64("fjOVdirUzFoLlukv80dBllMLjXythIf22feqPrNo0YoIjzyzyoMFiLjAc/Y4krkeZ11XFThIrEvw\nkRiZcCq5ng==") + _, err := DecryptPKCS1v15(nil, rsaPrivateKey, ciphertext) + if err == nil { + t.Error("RSA decrypted a message that was too long.") + } +} + +func TestUnpaddedSignature(t *testing.T) { + msg := []byte("Thu Dec 19 18:06:16 EST 2013\n") + // This base64 value was generated with: + // % echo Thu Dec 19 18:06:16 EST 2013 > /tmp/msg + // % openssl rsautl -sign -inkey key -out /tmp/sig -in /tmp/msg + // + // Where "key" contains the RSA private key given at the bottom of this + // file. + expectedSig := decodeBase64("pX4DR8azytjdQ1rtUiC040FjkepuQut5q2ZFX1pTjBrOVKNjgsCDyiJDGZTCNoh9qpXYbhl7iEym30BWWwuiZg==") + + sig, err := SignPKCS1v15(nil, rsaPrivateKey, crypto.Hash(0), msg) + if err != nil { + t.Fatalf("SignPKCS1v15 failed: %s", err) + } + if !bytes.Equal(sig, expectedSig) { + t.Fatalf("signature is not expected value: got %x, want %x", sig, expectedSig) + } + if err := VerifyPKCS1v15(&rsaPrivateKey.PublicKey, crypto.Hash(0), msg, sig); err != nil { + t.Fatalf("signature failed to verify: %s", err) + } +} + +func TestShortSessionKey(t *testing.T) { + // This tests that attempting to decrypt a session key where the + // ciphertext is too small doesn't run outside the array bounds. + ciphertext, err := EncryptPKCS1v15(rand.Reader, &rsaPrivateKey.PublicKey, []byte{1}) + if err != nil { + t.Fatalf("Failed to encrypt short message: %s", err) + } + + var key [32]byte + if err := DecryptPKCS1v15SessionKey(nil, rsaPrivateKey, ciphertext, key[:]); err != nil { + t.Fatalf("Failed to decrypt short message: %s", err) + } + + for _, v := range key { + if v != 0 { + t.Fatal("key was modified when ciphertext was invalid") + } + } +} + +// In order to generate new test vectors you'll need the PEM form of this key: +// -----BEGIN RSA PRIVATE KEY----- +// MIIBOgIBAAJBALKZD0nEffqM1ACuak0bijtqE2QrI/KLADv7l3kK3ppMyCuLKoF0 +// fd7Ai2KW5ToIwzFofvJcS/STa6HA5gQenRUCAwEAAQJBAIq9amn00aS0h/CrjXqu +// /ThglAXJmZhOMPVn4eiu7/ROixi9sex436MaVeMqSNf7Ex9a8fRNfWss7Sqd9eWu +// RTUCIQDasvGASLqmjeffBNLTXV2A5g4t+kLVCpsEIZAycV5GswIhANEPLmax0ME/ +// EO+ZJ79TJKN5yiGBRsv5yvx5UiHxajEXAiAhAol5N4EUyq6I9w1rYdhPMGpLfk7A +// IU2snfRJ6Nq2CQIgFrPsWRCkV+gOYcajD17rEqmuLrdIRexpg8N1DOSXoJ8CIGlS +// tAboUGBxTDq3ZroNism3DaMIbKPyYrAqhKov1h5V +// -----END RSA PRIVATE KEY----- + +var rsaPrivateKey = &PrivateKey{ + PublicKey: PublicKey{ + N: fromBase10("9353930466774385905609975137998169297361893554149986716853295022578535724979677252958524466350471210367835187480748268864277464700638583474144061408845077"), + E: 65537, + }, + D: fromBase10("7266398431328116344057699379749222532279343923819063639497049039389899328538543087657733766554155839834519529439851673014800261285757759040931985506583861"), + Primes: []*big.Int{ + fromBase10("98920366548084643601728869055592650835572950932266967461790948584315647051443"), + fromBase10("94560208308847015747498523884063394671606671904944666360068158221458669711639"), + }, +} diff --git a/src/crypto/rsa/pss.go b/src/crypto/rsa/pss.go new file mode 100644 index 0000000000000000000000000000000000000000..0a41814a4b1e7c7a772f5ba3850068cefe88fbe9 --- /dev/null +++ b/src/crypto/rsa/pss.go @@ -0,0 +1,297 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package rsa + +// This file implements the PSS signature scheme [1]. +// +// [1] http://www.rsa.com/rsalabs/pkcs/files/h11300-wp-pkcs-1v2-2-rsa-cryptography-standard.pdf + +import ( + "bytes" + "crypto" + "errors" + "hash" + "io" + "math/big" +) + +func emsaPSSEncode(mHash []byte, emBits int, salt []byte, hash hash.Hash) ([]byte, error) { + // See [1], section 9.1.1 + hLen := hash.Size() + sLen := len(salt) + emLen := (emBits + 7) / 8 + + // 1. If the length of M is greater than the input limitation for the + // hash function (2^61 - 1 octets for SHA-1), output "message too + // long" and stop. + // + // 2. Let mHash = Hash(M), an octet string of length hLen. + + if len(mHash) != hLen { + return nil, errors.New("crypto/rsa: input must be hashed message") + } + + // 3. If emLen < hLen + sLen + 2, output "encoding error" and stop. + + if emLen < hLen+sLen+2 { + return nil, errors.New("crypto/rsa: encoding error") + } + + em := make([]byte, emLen) + db := em[:emLen-sLen-hLen-2+1+sLen] + h := em[emLen-sLen-hLen-2+1+sLen : emLen-1] + + // 4. Generate a random octet string salt of length sLen; if sLen = 0, + // then salt is the empty string. + // + // 5. Let + // M' = (0x)00 00 00 00 00 00 00 00 || mHash || salt; + // + // M' is an octet string of length 8 + hLen + sLen with eight + // initial zero octets. + // + // 6. Let H = Hash(M'), an octet string of length hLen. + + var prefix [8]byte + + hash.Write(prefix[:]) + hash.Write(mHash) + hash.Write(salt) + + h = hash.Sum(h[:0]) + hash.Reset() + + // 7. Generate an octet string PS consisting of emLen - sLen - hLen - 2 + // zero octets. The length of PS may be 0. + // + // 8. Let DB = PS || 0x01 || salt; DB is an octet string of length + // emLen - hLen - 1. + + db[emLen-sLen-hLen-2] = 0x01 + copy(db[emLen-sLen-hLen-1:], salt) + + // 9. Let dbMask = MGF(H, emLen - hLen - 1). + // + // 10. Let maskedDB = DB \xor dbMask. + + mgf1XOR(db, hash, h) + + // 11. Set the leftmost 8 * emLen - emBits bits of the leftmost octet in + // maskedDB to zero. + + db[0] &= (0xFF >> uint(8*emLen-emBits)) + + // 12. Let EM = maskedDB || H || 0xbc. + em[emLen-1] = 0xBC + + // 13. Output EM. + return em, nil +} + +func emsaPSSVerify(mHash, em []byte, emBits, sLen int, hash hash.Hash) error { + // 1. If the length of M is greater than the input limitation for the + // hash function (2^61 - 1 octets for SHA-1), output "inconsistent" + // and stop. + // + // 2. Let mHash = Hash(M), an octet string of length hLen. + hLen := hash.Size() + if hLen != len(mHash) { + return ErrVerification + } + + // 3. If emLen < hLen + sLen + 2, output "inconsistent" and stop. + emLen := (emBits + 7) / 8 + if emLen < hLen+sLen+2 { + return ErrVerification + } + + // 4. If the rightmost octet of EM does not have hexadecimal value + // 0xbc, output "inconsistent" and stop. + if em[len(em)-1] != 0xBC { + return ErrVerification + } + + // 5. Let maskedDB be the leftmost emLen - hLen - 1 octets of EM, and + // let H be the next hLen octets. + db := em[:emLen-hLen-1] + h := em[emLen-hLen-1 : len(em)-1] + + // 6. If the leftmost 8 * emLen - emBits bits of the leftmost octet in + // maskedDB are not all equal to zero, output "inconsistent" and + // stop. + if em[0]&(0xFF<> uint(8*emLen-emBits)) + + if sLen == PSSSaltLengthAuto { + FindSaltLength: + for sLen = emLen - (hLen + 2); sLen >= 0; sLen-- { + switch db[emLen-hLen-sLen-2] { + case 1: + break FindSaltLength + case 0: + continue + default: + return ErrVerification + } + } + if sLen < 0 { + return ErrVerification + } + } else { + // 10. If the emLen - hLen - sLen - 2 leftmost octets of DB are not zero + // or if the octet at position emLen - hLen - sLen - 1 (the leftmost + // position is "position 1") does not have hexadecimal value 0x01, + // output "inconsistent" and stop. + for _, e := range db[:emLen-hLen-sLen-2] { + if e != 0x00 { + return ErrVerification + } + } + if db[emLen-hLen-sLen-2] != 0x01 { + return ErrVerification + } + } + + // 11. Let salt be the last sLen octets of DB. + salt := db[len(db)-sLen:] + + // 12. Let + // M' = (0x)00 00 00 00 00 00 00 00 || mHash || salt ; + // M' is an octet string of length 8 + hLen + sLen with eight + // initial zero octets. + // + // 13. Let H' = Hash(M'), an octet string of length hLen. + var prefix [8]byte + hash.Write(prefix[:]) + hash.Write(mHash) + hash.Write(salt) + + h0 := hash.Sum(nil) + + // 14. If H = H', output "consistent." Otherwise, output "inconsistent." + if !bytes.Equal(h0, h) { + return ErrVerification + } + return nil +} + +// signPSSWithSalt calculates the signature of hashed using PSS [1] with specified salt. +// Note that hashed must be the result of hashing the input message using the +// given hash function. salt is a random sequence of bytes whose length will be +// later used to verify the signature. +func signPSSWithSalt(rand io.Reader, priv *PrivateKey, hash crypto.Hash, hashed, salt []byte) (s []byte, err error) { + nBits := priv.N.BitLen() + em, err := emsaPSSEncode(hashed, nBits-1, salt, hash.New()) + if err != nil { + return + } + m := new(big.Int).SetBytes(em) + c, err := decrypt(rand, priv, m) + if err != nil { + return + } + s = make([]byte, (nBits+7)/8) + copyWithLeftPad(s, c.Bytes()) + return +} + +const ( + // PSSSaltLengthAuto causes the salt in a PSS signature to be as large + // as possible when signing, and to be auto-detected when verifying. + PSSSaltLengthAuto = 0 + // PSSSaltLengthEqualsHash causes the salt length to equal the length + // of the hash used in the signature. + PSSSaltLengthEqualsHash = -1 +) + +// PSSOptions contains options for creating and verifying PSS signatures. +type PSSOptions struct { + // SaltLength controls the length of the salt used in the PSS + // signature. It can either be a number of bytes, or one of the special + // PSSSaltLength constants. + SaltLength int + + // Hash, if not zero, overrides the hash function passed to SignPSS. + // This is the only way to specify the hash function when using the + // crypto.Signer interface. + Hash crypto.Hash +} + +// HashFunc returns pssOpts.Hash so that PSSOptions implements +// crypto.SignerOpts. +func (pssOpts *PSSOptions) HashFunc() crypto.Hash { + return pssOpts.Hash +} + +func (opts *PSSOptions) saltLength() int { + if opts == nil { + return PSSSaltLengthAuto + } + return opts.SaltLength +} + +// SignPSS calculates the signature of hashed using RSASSA-PSS [1]. +// Note that hashed must be the result of hashing the input message using the +// given hash function. The opts argument may be nil, in which case sensible +// defaults are used. +func SignPSS(rand io.Reader, priv *PrivateKey, hash crypto.Hash, hashed []byte, opts *PSSOptions) (s []byte, err error) { + saltLength := opts.saltLength() + switch saltLength { + case PSSSaltLengthAuto: + saltLength = (priv.N.BitLen()+7)/8 - 2 - hash.Size() + case PSSSaltLengthEqualsHash: + saltLength = hash.Size() + } + + if opts != nil && opts.Hash != 0 { + hash = opts.Hash + } + + salt := make([]byte, saltLength) + if _, err = io.ReadFull(rand, salt); err != nil { + return + } + return signPSSWithSalt(rand, priv, hash, hashed, salt) +} + +// VerifyPSS verifies a PSS signature. +// hashed is the result of hashing the input message using the given hash +// function and sig is the signature. A valid signature is indicated by +// returning a nil error. The opts argument may be nil, in which case sensible +// defaults are used. +func VerifyPSS(pub *PublicKey, hash crypto.Hash, hashed []byte, sig []byte, opts *PSSOptions) error { + return verifyPSS(pub, hash, hashed, sig, opts.saltLength()) +} + +// verifyPSS verifies a PSS signature with the given salt length. +func verifyPSS(pub *PublicKey, hash crypto.Hash, hashed []byte, sig []byte, saltLen int) error { + nBits := pub.N.BitLen() + if len(sig) != (nBits+7)/8 { + return ErrVerification + } + s := new(big.Int).SetBytes(sig) + m := encrypt(new(big.Int), pub, s) + emBits := nBits - 1 + emLen := (emBits + 7) / 8 + if emLen < len(m.Bytes()) { + return ErrVerification + } + em := make([]byte, emLen) + copyWithLeftPad(em, m.Bytes()) + if saltLen == PSSSaltLengthEqualsHash { + saltLen = hash.Size() + } + return emsaPSSVerify(hashed, em, emBits, saltLen, hash.New()) +} diff --git a/src/crypto/rsa/pss_test.go b/src/crypto/rsa/pss_test.go new file mode 100644 index 0000000000000000000000000000000000000000..cae24e58c6794ce5db502932f6504934bf4115cc --- /dev/null +++ b/src/crypto/rsa/pss_test.go @@ -0,0 +1,258 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package rsa + +import ( + "bufio" + "bytes" + "compress/bzip2" + "crypto" + _ "crypto/md5" + "crypto/rand" + "crypto/sha1" + _ "crypto/sha256" + "encoding/hex" + "math/big" + "os" + "strconv" + "strings" + "testing" +) + +func TestEMSAPSS(t *testing.T) { + // Test vector in file pss-int.txt from: ftp://ftp.rsasecurity.com/pub/pkcs/pkcs-1/pkcs-1v2-1-vec.zip + msg := []byte{ + 0x85, 0x9e, 0xef, 0x2f, 0xd7, 0x8a, 0xca, 0x00, 0x30, 0x8b, + 0xdc, 0x47, 0x11, 0x93, 0xbf, 0x55, 0xbf, 0x9d, 0x78, 0xdb, + 0x8f, 0x8a, 0x67, 0x2b, 0x48, 0x46, 0x34, 0xf3, 0xc9, 0xc2, + 0x6e, 0x64, 0x78, 0xae, 0x10, 0x26, 0x0f, 0xe0, 0xdd, 0x8c, + 0x08, 0x2e, 0x53, 0xa5, 0x29, 0x3a, 0xf2, 0x17, 0x3c, 0xd5, + 0x0c, 0x6d, 0x5d, 0x35, 0x4f, 0xeb, 0xf7, 0x8b, 0x26, 0x02, + 0x1c, 0x25, 0xc0, 0x27, 0x12, 0xe7, 0x8c, 0xd4, 0x69, 0x4c, + 0x9f, 0x46, 0x97, 0x77, 0xe4, 0x51, 0xe7, 0xf8, 0xe9, 0xe0, + 0x4c, 0xd3, 0x73, 0x9c, 0x6b, 0xbf, 0xed, 0xae, 0x48, 0x7f, + 0xb5, 0x56, 0x44, 0xe9, 0xca, 0x74, 0xff, 0x77, 0xa5, 0x3c, + 0xb7, 0x29, 0x80, 0x2f, 0x6e, 0xd4, 0xa5, 0xff, 0xa8, 0xba, + 0x15, 0x98, 0x90, 0xfc, + } + salt := []byte{ + 0xe3, 0xb5, 0xd5, 0xd0, 0x02, 0xc1, 0xbc, 0xe5, 0x0c, 0x2b, + 0x65, 0xef, 0x88, 0xa1, 0x88, 0xd8, 0x3b, 0xce, 0x7e, 0x61, + } + expected := []byte{ + 0x66, 0xe4, 0x67, 0x2e, 0x83, 0x6a, 0xd1, 0x21, 0xba, 0x24, + 0x4b, 0xed, 0x65, 0x76, 0xb8, 0x67, 0xd9, 0xa4, 0x47, 0xc2, + 0x8a, 0x6e, 0x66, 0xa5, 0xb8, 0x7d, 0xee, 0x7f, 0xbc, 0x7e, + 0x65, 0xaf, 0x50, 0x57, 0xf8, 0x6f, 0xae, 0x89, 0x84, 0xd9, + 0xba, 0x7f, 0x96, 0x9a, 0xd6, 0xfe, 0x02, 0xa4, 0xd7, 0x5f, + 0x74, 0x45, 0xfe, 0xfd, 0xd8, 0x5b, 0x6d, 0x3a, 0x47, 0x7c, + 0x28, 0xd2, 0x4b, 0xa1, 0xe3, 0x75, 0x6f, 0x79, 0x2d, 0xd1, + 0xdc, 0xe8, 0xca, 0x94, 0x44, 0x0e, 0xcb, 0x52, 0x79, 0xec, + 0xd3, 0x18, 0x3a, 0x31, 0x1f, 0xc8, 0x96, 0xda, 0x1c, 0xb3, + 0x93, 0x11, 0xaf, 0x37, 0xea, 0x4a, 0x75, 0xe2, 0x4b, 0xdb, + 0xfd, 0x5c, 0x1d, 0xa0, 0xde, 0x7c, 0xec, 0xdf, 0x1a, 0x89, + 0x6f, 0x9d, 0x8b, 0xc8, 0x16, 0xd9, 0x7c, 0xd7, 0xa2, 0xc4, + 0x3b, 0xad, 0x54, 0x6f, 0xbe, 0x8c, 0xfe, 0xbc, + } + + hash := sha1.New() + hash.Write(msg) + hashed := hash.Sum(nil) + + encoded, err := emsaPSSEncode(hashed, 1023, salt, sha1.New()) + if err != nil { + t.Errorf("Error from emsaPSSEncode: %s\n", err) + } + if !bytes.Equal(encoded, expected) { + t.Errorf("Bad encoding. got %x, want %x", encoded, expected) + } + + if err = emsaPSSVerify(hashed, encoded, 1023, len(salt), sha1.New()); err != nil { + t.Errorf("Bad verification: %s", err) + } +} + +// TestPSSGolden tests all the test vectors in pss-vect.txt from +// ftp://ftp.rsasecurity.com/pub/pkcs/pkcs-1/pkcs-1v2-1-vec.zip +func TestPSSGolden(t *testing.T) { + inFile, err := os.Open("testdata/pss-vect.txt.bz2") + if err != nil { + t.Fatalf("Failed to open input file: %s", err) + } + defer inFile.Close() + + // The pss-vect.txt file contains RSA keys and then a series of + // signatures. A goroutine is used to preprocess the input by merging + // lines, removing spaces in hex values and identifying the start of + // new keys and signature blocks. + const newKeyMarker = "START NEW KEY" + const newSignatureMarker = "START NEW SIGNATURE" + + values := make(chan string) + + go func() { + defer close(values) + scanner := bufio.NewScanner(bzip2.NewReader(inFile)) + var partialValue string + lastWasValue := true + + for scanner.Scan() { + line := scanner.Text() + switch { + case len(line) == 0: + if len(partialValue) > 0 { + values <- strings.Replace(partialValue, " ", "", -1) + partialValue = "" + lastWasValue = true + } + continue + case strings.HasPrefix(line, "# ======") && lastWasValue: + values <- newKeyMarker + lastWasValue = false + case strings.HasPrefix(line, "# ------") && lastWasValue: + values <- newSignatureMarker + lastWasValue = false + case strings.HasPrefix(line, "#"): + continue + default: + partialValue += line + } + } + if err := scanner.Err(); err != nil { + panic(err) + } + }() + + var key *PublicKey + var hashed []byte + hash := crypto.SHA1 + h := hash.New() + opts := &PSSOptions{ + SaltLength: PSSSaltLengthEqualsHash, + } + + for marker := range values { + switch marker { + case newKeyMarker: + key = new(PublicKey) + nHex, ok := <-values + if !ok { + continue + } + key.N = bigFromHex(nHex) + key.E = intFromHex(<-values) + // We don't care for d, p, q, dP, dQ or qInv. + for i := 0; i < 6; i++ { + <-values + } + case newSignatureMarker: + msg := fromHex(<-values) + <-values // skip salt + sig := fromHex(<-values) + + h.Reset() + h.Write(msg) + hashed = h.Sum(hashed[:0]) + + if err := VerifyPSS(key, hash, hashed, sig, opts); err != nil { + t.Error(err) + } + default: + t.Fatalf("unknown marker: " + marker) + } + } +} + +// TestPSSOpenSSL ensures that we can verify a PSS signature from OpenSSL with +// the default options. OpenSSL sets the salt length to be maximal. +func TestPSSOpenSSL(t *testing.T) { + hash := crypto.SHA256 + h := hash.New() + h.Write([]byte("testing")) + hashed := h.Sum(nil) + + // Generated with `echo -n testing | openssl dgst -sign key.pem -sigopt rsa_padding_mode:pss -sha256 > sig` + sig := []byte{ + 0x95, 0x59, 0x6f, 0xd3, 0x10, 0xa2, 0xe7, 0xa2, 0x92, 0x9d, + 0x4a, 0x07, 0x2e, 0x2b, 0x27, 0xcc, 0x06, 0xc2, 0x87, 0x2c, + 0x52, 0xf0, 0x4a, 0xcc, 0x05, 0x94, 0xf2, 0xc3, 0x2e, 0x20, + 0xd7, 0x3e, 0x66, 0x62, 0xb5, 0x95, 0x2b, 0xa3, 0x93, 0x9a, + 0x66, 0x64, 0x25, 0xe0, 0x74, 0x66, 0x8c, 0x3e, 0x92, 0xeb, + 0xc6, 0xe6, 0xc0, 0x44, 0xf3, 0xb4, 0xb4, 0x2e, 0x8c, 0x66, + 0x0a, 0x37, 0x9c, 0x69, + } + + if err := VerifyPSS(&rsaPrivateKey.PublicKey, hash, hashed, sig, nil); err != nil { + t.Error(err) + } +} + +func TestPSSNilOpts(t *testing.T) { + hash := crypto.SHA256 + h := hash.New() + h.Write([]byte("testing")) + hashed := h.Sum(nil) + + SignPSS(rand.Reader, rsaPrivateKey, hash, hashed, nil) +} + +func TestPSSSigning(t *testing.T) { + var saltLengthCombinations = []struct { + signSaltLength, verifySaltLength int + good bool + }{ + {PSSSaltLengthAuto, PSSSaltLengthAuto, true}, + {PSSSaltLengthEqualsHash, PSSSaltLengthAuto, true}, + {PSSSaltLengthEqualsHash, PSSSaltLengthEqualsHash, true}, + {PSSSaltLengthEqualsHash, 8, false}, + {PSSSaltLengthAuto, PSSSaltLengthEqualsHash, false}, + {8, 8, true}, + } + + hash := crypto.MD5 + h := hash.New() + h.Write([]byte("testing")) + hashed := h.Sum(nil) + var opts PSSOptions + + for i, test := range saltLengthCombinations { + opts.SaltLength = test.signSaltLength + sig, err := SignPSS(rand.Reader, rsaPrivateKey, hash, hashed, &opts) + if err != nil { + t.Errorf("#%d: error while signing: %s", i, err) + continue + } + + opts.SaltLength = test.verifySaltLength + err = VerifyPSS(&rsaPrivateKey.PublicKey, hash, hashed, sig, &opts) + if (err == nil) != test.good { + t.Errorf("#%d: bad result, wanted: %t, got: %s", i, test.good, err) + } + } +} + +func bigFromHex(hex string) *big.Int { + n, ok := new(big.Int).SetString(hex, 16) + if !ok { + panic("bad hex: " + hex) + } + return n +} + +func intFromHex(hex string) int { + i, err := strconv.ParseInt(hex, 16, 32) + if err != nil { + panic(err) + } + return int(i) +} + +func fromHex(hexStr string) []byte { + s, err := hex.DecodeString(hexStr) + if err != nil { + panic(err) + } + return s +} diff --git a/src/crypto/rsa/rsa.go b/src/crypto/rsa/rsa.go new file mode 100644 index 0000000000000000000000000000000000000000..1293b783679b143440aabb2d5a9e04a391273f46 --- /dev/null +++ b/src/crypto/rsa/rsa.go @@ -0,0 +1,592 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package rsa implements RSA encryption as specified in PKCS#1. +package rsa + +import ( + "crypto" + "crypto/rand" + "crypto/subtle" + "errors" + "hash" + "io" + "math/big" +) + +var bigZero = big.NewInt(0) +var bigOne = big.NewInt(1) + +// A PublicKey represents the public part of an RSA key. +type PublicKey struct { + N *big.Int // modulus + E int // public exponent +} + +// OAEPOptions is an interface for passing options to OAEP decryption using the +// crypto.Decrypter interface. +type OAEPOptions struct { + // Hash is the hash function that will be used when generating the mask. + Hash crypto.Hash + // Label is an arbitrary byte string that must be equal to the value + // used when encrypting. + Label []byte +} + +var ( + errPublicModulus = errors.New("crypto/rsa: missing public modulus") + errPublicExponentSmall = errors.New("crypto/rsa: public exponent too small") + errPublicExponentLarge = errors.New("crypto/rsa: public exponent too large") +) + +// checkPub sanity checks the public key before we use it. +// We require pub.E to fit into a 32-bit integer so that we +// do not have different behavior depending on whether +// int is 32 or 64 bits. See also +// http://www.imperialviolet.org/2012/03/16/rsae.html. +func checkPub(pub *PublicKey) error { + if pub.N == nil { + return errPublicModulus + } + if pub.E < 2 { + return errPublicExponentSmall + } + if pub.E > 1<<31-1 { + return errPublicExponentLarge + } + return nil +} + +// A PrivateKey represents an RSA key +type PrivateKey struct { + PublicKey // public part. + D *big.Int // private exponent + Primes []*big.Int // prime factors of N, has >= 2 elements. + + // Precomputed contains precomputed values that speed up private + // operations, if available. + Precomputed PrecomputedValues +} + +// Public returns the public key corresponding to priv. +func (priv *PrivateKey) Public() crypto.PublicKey { + return &priv.PublicKey +} + +// Sign signs msg with priv, reading randomness from rand. If opts is a +// *PSSOptions then the PSS algorithm will be used, otherwise PKCS#1 v1.5 will +// be used. This method is intended to support keys where the private part is +// kept in, for example, a hardware module. Common uses should use the Sign* +// functions in this package. +func (priv *PrivateKey) Sign(rand io.Reader, msg []byte, opts crypto.SignerOpts) ([]byte, error) { + if pssOpts, ok := opts.(*PSSOptions); ok { + return SignPSS(rand, priv, pssOpts.Hash, msg, pssOpts) + } + + return SignPKCS1v15(rand, priv, opts.HashFunc(), msg) +} + +// Decrypt decrypts ciphertext with priv. If opts is nil or of type +// *PKCS1v15DecryptOptions then PKCS#1 v1.5 decryption is performed. Otherwise +// opts must have type *OAEPOptions and OAEP decryption is done. +func (priv *PrivateKey) Decrypt(rand io.Reader, ciphertext []byte, opts crypto.DecrypterOpts) (plaintext []byte, err error) { + if opts == nil { + return DecryptPKCS1v15(rand, priv, ciphertext) + } + + switch opts := opts.(type) { + case *OAEPOptions: + return DecryptOAEP(opts.Hash.New(), rand, priv, ciphertext, opts.Label) + + case *PKCS1v15DecryptOptions: + if l := opts.SessionKeyLen; l > 0 { + plaintext = make([]byte, l) + if _, err := io.ReadFull(rand, plaintext); err != nil { + return nil, err + } + if err := DecryptPKCS1v15SessionKey(rand, priv, ciphertext, plaintext); err != nil { + return nil, err + } + return plaintext, nil + } else { + return DecryptPKCS1v15(rand, priv, ciphertext) + } + + default: + return nil, errors.New("crypto/rsa: invalid options for Decrypt") + } +} + +type PrecomputedValues struct { + Dp, Dq *big.Int // D mod (P-1) (or mod Q-1) + Qinv *big.Int // Q^-1 mod P + + // CRTValues is used for the 3rd and subsequent primes. Due to a + // historical accident, the CRT for the first two primes is handled + // differently in PKCS#1 and interoperability is sufficiently + // important that we mirror this. + CRTValues []CRTValue +} + +// CRTValue contains the precomputed Chinese remainder theorem values. +type CRTValue struct { + Exp *big.Int // D mod (prime-1). + Coeff *big.Int // R·Coeff ≡ 1 mod Prime. + R *big.Int // product of primes prior to this (inc p and q). +} + +// Validate performs basic sanity checks on the key. +// It returns nil if the key is valid, or else an error describing a problem. +func (priv *PrivateKey) Validate() error { + if err := checkPub(&priv.PublicKey); err != nil { + return err + } + + // Check that Πprimes == n. + modulus := new(big.Int).Set(bigOne) + for _, prime := range priv.Primes { + // Any primes ≤ 1 will cause divide-by-zero panics later. + if prime.Cmp(bigOne) <= 0 { + return errors.New("crypto/rsa: invalid prime value") + } + modulus.Mul(modulus, prime) + } + if modulus.Cmp(priv.N) != 0 { + return errors.New("crypto/rsa: invalid modulus") + } + + // Check that de ≡ 1 mod p-1, for each prime. + // This implies that e is coprime to each p-1 as e has a multiplicative + // inverse. Therefore e is coprime to lcm(p-1,q-1,r-1,...) = + // exponent(ℤ/nℤ). It also implies that a^de ≡ a mod p as a^(p-1) ≡ 1 + // mod p. Thus a^de ≡ a mod n for all a coprime to n, as required. + congruence := new(big.Int) + de := new(big.Int).SetInt64(int64(priv.E)) + de.Mul(de, priv.D) + for _, prime := range priv.Primes { + pminus1 := new(big.Int).Sub(prime, bigOne) + congruence.Mod(de, pminus1) + if congruence.Cmp(bigOne) != 0 { + return errors.New("crypto/rsa: invalid exponents") + } + } + return nil +} + +// GenerateKey generates an RSA keypair of the given bit size using the +// random source random (for example, crypto/rand.Reader). +func GenerateKey(random io.Reader, bits int) (priv *PrivateKey, err error) { + return GenerateMultiPrimeKey(random, 2, bits) +} + +// GenerateMultiPrimeKey generates a multi-prime RSA keypair of the given bit +// size and the given random source, as suggested in [1]. Although the public +// keys are compatible (actually, indistinguishable) from the 2-prime case, +// the private keys are not. Thus it may not be possible to export multi-prime +// private keys in certain formats or to subsequently import them into other +// code. +// +// Table 1 in [2] suggests maximum numbers of primes for a given size. +// +// [1] US patent 4405829 (1972, expired) +// [2] http://www.cacr.math.uwaterloo.ca/techreports/2006/cacr2006-16.pdf +func GenerateMultiPrimeKey(random io.Reader, nprimes int, bits int) (priv *PrivateKey, err error) { + priv = new(PrivateKey) + priv.E = 65537 + + if nprimes < 2 { + return nil, errors.New("crypto/rsa: GenerateMultiPrimeKey: nprimes must be >= 2") + } + + primes := make([]*big.Int, nprimes) + +NextSetOfPrimes: + for { + todo := bits + // crypto/rand should set the top two bits in each prime. + // Thus each prime has the form + // p_i = 2^bitlen(p_i) × 0.11... (in base 2). + // And the product is: + // P = 2^todo × α + // where α is the product of nprimes numbers of the form 0.11... + // + // If α < 1/2 (which can happen for nprimes > 2), we need to + // shift todo to compensate for lost bits: the mean value of 0.11... + // is 7/8, so todo + shift - nprimes * log2(7/8) ~= bits - 1/2 + // will give good results. + if nprimes >= 7 { + todo += (nprimes - 2) / 5 + } + for i := 0; i < nprimes; i++ { + primes[i], err = rand.Prime(random, todo/(nprimes-i)) + if err != nil { + return nil, err + } + todo -= primes[i].BitLen() + } + + // Make sure that primes is pairwise unequal. + for i, prime := range primes { + for j := 0; j < i; j++ { + if prime.Cmp(primes[j]) == 0 { + continue NextSetOfPrimes + } + } + } + + n := new(big.Int).Set(bigOne) + totient := new(big.Int).Set(bigOne) + pminus1 := new(big.Int) + for _, prime := range primes { + n.Mul(n, prime) + pminus1.Sub(prime, bigOne) + totient.Mul(totient, pminus1) + } + if n.BitLen() != bits { + // This should never happen for nprimes == 2 because + // crypto/rand should set the top two bits in each prime. + // For nprimes > 2 we hope it does not happen often. + continue NextSetOfPrimes + } + + g := new(big.Int) + priv.D = new(big.Int) + y := new(big.Int) + e := big.NewInt(int64(priv.E)) + g.GCD(priv.D, y, e, totient) + + if g.Cmp(bigOne) == 0 { + if priv.D.Sign() < 0 { + priv.D.Add(priv.D, totient) + } + priv.Primes = primes + priv.N = n + + break + } + } + + priv.Precompute() + return +} + +// incCounter increments a four byte, big-endian counter. +func incCounter(c *[4]byte) { + if c[3]++; c[3] != 0 { + return + } + if c[2]++; c[2] != 0 { + return + } + if c[1]++; c[1] != 0 { + return + } + c[0]++ +} + +// mgf1XOR XORs the bytes in out with a mask generated using the MGF1 function +// specified in PKCS#1 v2.1. +func mgf1XOR(out []byte, hash hash.Hash, seed []byte) { + var counter [4]byte + var digest []byte + + done := 0 + for done < len(out) { + hash.Write(seed) + hash.Write(counter[0:4]) + digest = hash.Sum(digest[:0]) + hash.Reset() + + for i := 0; i < len(digest) && done < len(out); i++ { + out[done] ^= digest[i] + done++ + } + incCounter(&counter) + } +} + +// ErrMessageTooLong is returned when attempting to encrypt a message which is +// too large for the size of the public key. +var ErrMessageTooLong = errors.New("crypto/rsa: message too long for RSA public key size") + +func encrypt(c *big.Int, pub *PublicKey, m *big.Int) *big.Int { + e := big.NewInt(int64(pub.E)) + c.Exp(m, e, pub.N) + return c +} + +// EncryptOAEP encrypts the given message with RSA-OAEP. +// The message must be no longer than the length of the public modulus less +// twice the hash length plus 2. +func EncryptOAEP(hash hash.Hash, random io.Reader, pub *PublicKey, msg []byte, label []byte) (out []byte, err error) { + if err := checkPub(pub); err != nil { + return nil, err + } + hash.Reset() + k := (pub.N.BitLen() + 7) / 8 + if len(msg) > k-2*hash.Size()-2 { + err = ErrMessageTooLong + return + } + + hash.Write(label) + lHash := hash.Sum(nil) + hash.Reset() + + em := make([]byte, k) + seed := em[1 : 1+hash.Size()] + db := em[1+hash.Size():] + + copy(db[0:hash.Size()], lHash) + db[len(db)-len(msg)-1] = 1 + copy(db[len(db)-len(msg):], msg) + + _, err = io.ReadFull(random, seed) + if err != nil { + return + } + + mgf1XOR(db, hash, seed) + mgf1XOR(seed, hash, db) + + m := new(big.Int) + m.SetBytes(em) + c := encrypt(new(big.Int), pub, m) + out = c.Bytes() + + if len(out) < k { + // If the output is too small, we need to left-pad with zeros. + t := make([]byte, k) + copy(t[k-len(out):], out) + out = t + } + + return +} + +// ErrDecryption represents a failure to decrypt a message. +// It is deliberately vague to avoid adaptive attacks. +var ErrDecryption = errors.New("crypto/rsa: decryption error") + +// ErrVerification represents a failure to verify a signature. +// It is deliberately vague to avoid adaptive attacks. +var ErrVerification = errors.New("crypto/rsa: verification error") + +// modInverse returns ia, the inverse of a in the multiplicative group of prime +// order n. It requires that a be a member of the group (i.e. less than n). +func modInverse(a, n *big.Int) (ia *big.Int, ok bool) { + g := new(big.Int) + x := new(big.Int) + y := new(big.Int) + g.GCD(x, y, a, n) + if g.Cmp(bigOne) != 0 { + // In this case, a and n aren't coprime and we cannot calculate + // the inverse. This happens because the values of n are nearly + // prime (being the product of two primes) rather than truly + // prime. + return + } + + if x.Cmp(bigOne) < 0 { + // 0 is not the multiplicative inverse of any element so, if x + // < 1, then x is negative. + x.Add(x, n) + } + + return x, true +} + +// Precompute performs some calculations that speed up private key operations +// in the future. +func (priv *PrivateKey) Precompute() { + if priv.Precomputed.Dp != nil { + return + } + + priv.Precomputed.Dp = new(big.Int).Sub(priv.Primes[0], bigOne) + priv.Precomputed.Dp.Mod(priv.D, priv.Precomputed.Dp) + + priv.Precomputed.Dq = new(big.Int).Sub(priv.Primes[1], bigOne) + priv.Precomputed.Dq.Mod(priv.D, priv.Precomputed.Dq) + + priv.Precomputed.Qinv = new(big.Int).ModInverse(priv.Primes[1], priv.Primes[0]) + + r := new(big.Int).Mul(priv.Primes[0], priv.Primes[1]) + priv.Precomputed.CRTValues = make([]CRTValue, len(priv.Primes)-2) + for i := 2; i < len(priv.Primes); i++ { + prime := priv.Primes[i] + values := &priv.Precomputed.CRTValues[i-2] + + values.Exp = new(big.Int).Sub(prime, bigOne) + values.Exp.Mod(priv.D, values.Exp) + + values.R = new(big.Int).Set(r) + values.Coeff = new(big.Int).ModInverse(r, prime) + + r.Mul(r, prime) + } +} + +// decrypt performs an RSA decryption, resulting in a plaintext integer. If a +// random source is given, RSA blinding is used. +func decrypt(random io.Reader, priv *PrivateKey, c *big.Int) (m *big.Int, err error) { + // TODO(agl): can we get away with reusing blinds? + if c.Cmp(priv.N) > 0 { + err = ErrDecryption + return + } + + var ir *big.Int + if random != nil { + // Blinding enabled. Blinding involves multiplying c by r^e. + // Then the decryption operation performs (m^e * r^e)^d mod n + // which equals mr mod n. The factor of r can then be removed + // by multiplying by the multiplicative inverse of r. + + var r *big.Int + + for { + r, err = rand.Int(random, priv.N) + if err != nil { + return + } + if r.Cmp(bigZero) == 0 { + r = bigOne + } + var ok bool + ir, ok = modInverse(r, priv.N) + if ok { + break + } + } + bigE := big.NewInt(int64(priv.E)) + rpowe := new(big.Int).Exp(r, bigE, priv.N) + cCopy := new(big.Int).Set(c) + cCopy.Mul(cCopy, rpowe) + cCopy.Mod(cCopy, priv.N) + c = cCopy + } + + if priv.Precomputed.Dp == nil { + m = new(big.Int).Exp(c, priv.D, priv.N) + } else { + // We have the precalculated values needed for the CRT. + m = new(big.Int).Exp(c, priv.Precomputed.Dp, priv.Primes[0]) + m2 := new(big.Int).Exp(c, priv.Precomputed.Dq, priv.Primes[1]) + m.Sub(m, m2) + if m.Sign() < 0 { + m.Add(m, priv.Primes[0]) + } + m.Mul(m, priv.Precomputed.Qinv) + m.Mod(m, priv.Primes[0]) + m.Mul(m, priv.Primes[1]) + m.Add(m, m2) + + for i, values := range priv.Precomputed.CRTValues { + prime := priv.Primes[2+i] + m2.Exp(c, values.Exp, prime) + m2.Sub(m2, m) + m2.Mul(m2, values.Coeff) + m2.Mod(m2, prime) + if m2.Sign() < 0 { + m2.Add(m2, prime) + } + m2.Mul(m2, values.R) + m.Add(m, m2) + } + } + + if ir != nil { + // Unblind. + m.Mul(m, ir) + m.Mod(m, priv.N) + } + + return +} + +// DecryptOAEP decrypts ciphertext using RSA-OAEP. +// If random != nil, DecryptOAEP uses RSA blinding to avoid timing side-channel attacks. +func DecryptOAEP(hash hash.Hash, random io.Reader, priv *PrivateKey, ciphertext []byte, label []byte) (msg []byte, err error) { + if err := checkPub(&priv.PublicKey); err != nil { + return nil, err + } + k := (priv.N.BitLen() + 7) / 8 + if len(ciphertext) > k || + k < hash.Size()*2+2 { + err = ErrDecryption + return + } + + c := new(big.Int).SetBytes(ciphertext) + + m, err := decrypt(random, priv, c) + if err != nil { + return + } + + hash.Write(label) + lHash := hash.Sum(nil) + hash.Reset() + + // Converting the plaintext number to bytes will strip any + // leading zeros so we may have to left pad. We do this unconditionally + // to avoid leaking timing information. (Although we still probably + // leak the number of leading zeros. It's not clear that we can do + // anything about this.) + em := leftPad(m.Bytes(), k) + + firstByteIsZero := subtle.ConstantTimeByteEq(em[0], 0) + + seed := em[1 : hash.Size()+1] + db := em[hash.Size()+1:] + + mgf1XOR(seed, hash, db) + mgf1XOR(db, hash, seed) + + lHash2 := db[0:hash.Size()] + + // We have to validate the plaintext in constant time in order to avoid + // attacks like: J. Manger. A Chosen Ciphertext Attack on RSA Optimal + // Asymmetric Encryption Padding (OAEP) as Standardized in PKCS #1 + // v2.0. In J. Kilian, editor, Advances in Cryptology. + lHash2Good := subtle.ConstantTimeCompare(lHash, lHash2) + + // The remainder of the plaintext must be zero or more 0x00, followed + // by 0x01, followed by the message. + // lookingForIndex: 1 iff we are still looking for the 0x01 + // index: the offset of the first 0x01 byte + // invalid: 1 iff we saw a non-zero byte before the 0x01. + var lookingForIndex, index, invalid int + lookingForIndex = 1 + rest := db[hash.Size():] + + for i := 0; i < len(rest); i++ { + equals0 := subtle.ConstantTimeByteEq(rest[i], 0) + equals1 := subtle.ConstantTimeByteEq(rest[i], 1) + index = subtle.ConstantTimeSelect(lookingForIndex&equals1, i, index) + lookingForIndex = subtle.ConstantTimeSelect(equals1, 0, lookingForIndex) + invalid = subtle.ConstantTimeSelect(lookingForIndex&^equals0, 1, invalid) + } + + if firstByteIsZero&lHash2Good&^invalid&^lookingForIndex != 1 { + err = ErrDecryption + return + } + + msg = rest[index+1:] + return +} + +// leftPad returns a new slice of length size. The contents of input are right +// aligned in the new slice. +func leftPad(input []byte, size int) (out []byte) { + n := len(input) + if n > size { + n = size + } + out = make([]byte, size) + copy(out[len(out)-n:], input) + return +} diff --git a/src/crypto/rsa/rsa_test.go b/src/crypto/rsa/rsa_test.go new file mode 100644 index 0000000000000000000000000000000000000000..4ee1c3a8b2afc6e4be23c041f7b40629a61c1e1b --- /dev/null +++ b/src/crypto/rsa/rsa_test.go @@ -0,0 +1,392 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package rsa + +import ( + "bytes" + "crypto/rand" + "crypto/sha1" + "math/big" + "testing" +) + +func TestKeyGeneration(t *testing.T) { + size := 1024 + if testing.Short() { + size = 128 + } + priv, err := GenerateKey(rand.Reader, size) + if err != nil { + t.Errorf("failed to generate key") + } + if bits := priv.N.BitLen(); bits != size { + t.Errorf("key too short (%d vs %d)", bits, size) + } + testKeyBasics(t, priv) +} + +func Test3PrimeKeyGeneration(t *testing.T) { + size := 768 + if testing.Short() { + size = 256 + } + + priv, err := GenerateMultiPrimeKey(rand.Reader, 3, size) + if err != nil { + t.Errorf("failed to generate key") + } + testKeyBasics(t, priv) +} + +func Test4PrimeKeyGeneration(t *testing.T) { + size := 768 + if testing.Short() { + size = 256 + } + + priv, err := GenerateMultiPrimeKey(rand.Reader, 4, size) + if err != nil { + t.Errorf("failed to generate key") + } + testKeyBasics(t, priv) +} + +func TestNPrimeKeyGeneration(t *testing.T) { + primeSize := 64 + maxN := 24 + if testing.Short() { + primeSize = 16 + maxN = 16 + } + // Test that generation of N-prime keys works for N > 4. + for n := 5; n < maxN; n++ { + priv, err := GenerateMultiPrimeKey(rand.Reader, n, 64+n*primeSize) + if err == nil { + testKeyBasics(t, priv) + } else { + t.Errorf("failed to generate %d-prime key", n) + } + } +} + +func TestGnuTLSKey(t *testing.T) { + // This is a key generated by `certtool --generate-privkey --bits 128`. + // It's such that de ≢ 1 mod φ(n), but is congruent mod the order of + // the group. + priv := &PrivateKey{ + PublicKey: PublicKey{ + N: fromBase10("290684273230919398108010081414538931343"), + E: 65537, + }, + D: fromBase10("31877380284581499213530787347443987241"), + Primes: []*big.Int{ + fromBase10("16775196964030542637"), + fromBase10("17328218193455850539"), + }, + } + testKeyBasics(t, priv) +} + +func testKeyBasics(t *testing.T, priv *PrivateKey) { + if err := priv.Validate(); err != nil { + t.Errorf("Validate() failed: %s", err) + } + if priv.D.Cmp(priv.N) > 0 { + t.Errorf("private exponent too large") + } + + pub := &priv.PublicKey + m := big.NewInt(42) + c := encrypt(new(big.Int), pub, m) + + m2, err := decrypt(nil, priv, c) + if err != nil { + t.Errorf("error while decrypting: %s", err) + return + } + if m.Cmp(m2) != 0 { + t.Errorf("got:%v, want:%v (%+v)", m2, m, priv) + } + + m3, err := decrypt(rand.Reader, priv, c) + if err != nil { + t.Errorf("error while decrypting (blind): %s", err) + } + if m.Cmp(m3) != 0 { + t.Errorf("(blind) got:%v, want:%v (%#v)", m3, m, priv) + } +} + +func fromBase10(base10 string) *big.Int { + i, ok := new(big.Int).SetString(base10, 10) + if !ok { + panic("bad number: " + base10) + } + return i +} + +func BenchmarkRSA2048Decrypt(b *testing.B) { + b.StopTimer() + priv := &PrivateKey{ + PublicKey: PublicKey{ + N: fromBase10("14314132931241006650998084889274020608918049032671858325988396851334124245188214251956198731333464217832226406088020736932173064754214329009979944037640912127943488972644697423190955557435910767690712778463524983667852819010259499695177313115447116110358524558307947613422897787329221478860907963827160223559690523660574329011927531289655711860504630573766609239332569210831325633840174683944553667352219670930408593321661375473885147973879086994006440025257225431977751512374815915392249179976902953721486040787792801849818254465486633791826766873076617116727073077821584676715609985777563958286637185868165868520557"), + E: 3, + }, + D: fromBase10("9542755287494004433998723259516013739278699355114572217325597900889416163458809501304132487555642811888150937392013824621448709836142886006653296025093941418628992648429798282127303704957273845127141852309016655778568546006839666463451542076964744073572349705538631742281931858219480985907271975884773482372966847639853897890615456605598071088189838676728836833012254065983259638538107719766738032720239892094196108713378822882383694456030043492571063441943847195939549773271694647657549658603365629458610273821292232646334717612674519997533901052790334279661754176490593041941863932308687197618671528035670452762731"), + Primes: []*big.Int{ + fromBase10("130903255182996722426771613606077755295583329135067340152947172868415809027537376306193179624298874215608270802054347609836776473930072411958753044562214537013874103802006369634761074377213995983876788718033850153719421695468704276694983032644416930879093914927146648402139231293035971427838068945045019075433"), + fromBase10("109348945610485453577574767652527472924289229538286649661240938988020367005475727988253438647560958573506159449538793540472829815903949343191091817779240101054552748665267574271163617694640513549693841337820602726596756351006149518830932261246698766355347898158548465400674856021497190430791824869615170301029"), + }, + } + priv.Precompute() + + c := fromBase10("8472002792838218989464636159316973636630013835787202418124758118372358261975764365740026024610403138425986214991379012696600761514742817632790916315594342398720903716529235119816755589383377471752116975374952783629225022962092351886861518911824745188989071172097120352727368980275252089141512321893536744324822590480751098257559766328893767334861211872318961900897793874075248286439689249972315699410830094164386544311554704755110361048571142336148077772023880664786019636334369759624917224888206329520528064315309519262325023881707530002540634660750469137117568199824615333883758410040459705787022909848740188613313") + + b.StartTimer() + + for i := 0; i < b.N; i++ { + decrypt(nil, priv, c) + } +} + +func Benchmark3PrimeRSA2048Decrypt(b *testing.B) { + b.StopTimer() + priv := &PrivateKey{ + PublicKey: PublicKey{ + N: fromBase10("16346378922382193400538269749936049106320265317511766357599732575277382844051791096569333808598921852351577762718529818072849191122419410612033592401403764925096136759934497687765453905884149505175426053037420486697072448609022753683683718057795566811401938833367954642951433473337066311978821180526439641496973296037000052546108507805269279414789035461158073156772151892452251106173507240488993608650881929629163465099476849643165682709047462010581308719577053905787496296934240246311806555924593059995202856826239801816771116902778517096212527979497399966526283516447337775509777558018145573127308919204297111496233"), + E: 3, + }, + D: fromBase10("10897585948254795600358846499957366070880176878341177571733155050184921896034527397712889205732614568234385175145686545381899460748279607074689061600935843283397424506622998458510302603922766336783617368686090042765718290914099334449154829375179958369993407724946186243249568928237086215759259909861748642124071874879861299389874230489928271621259294894142840428407196932444474088857746123104978617098858619445675532587787023228852383149557470077802718705420275739737958953794088728369933811184572620857678792001136676902250566845618813972833750098806496641114644760255910789397593428910198080271317419213080834885003"), + Primes: []*big.Int{ + fromBase10("1025363189502892836833747188838978207017355117492483312747347695538428729137306368764177201532277413433182799108299960196606011786562992097313508180436744488171474690412562218914213688661311117337381958560443"), + fromBase10("3467903426626310123395340254094941045497208049900750380025518552334536945536837294961497712862519984786362199788654739924501424784631315081391467293694361474867825728031147665777546570788493758372218019373"), + fromBase10("4597024781409332673052708605078359346966325141767460991205742124888960305710298765592730135879076084498363772408626791576005136245060321874472727132746643162385746062759369754202494417496879741537284589047"), + }, + } + priv.Precompute() + + c := fromBase10("8472002792838218989464636159316973636630013835787202418124758118372358261975764365740026024610403138425986214991379012696600761514742817632790916315594342398720903716529235119816755589383377471752116975374952783629225022962092351886861518911824745188989071172097120352727368980275252089141512321893536744324822590480751098257559766328893767334861211872318961900897793874075248286439689249972315699410830094164386544311554704755110361048571142336148077772023880664786019636334369759624917224888206329520528064315309519262325023881707530002540634660750469137117568199824615333883758410040459705787022909848740188613313") + + b.StartTimer() + + for i := 0; i < b.N; i++ { + decrypt(nil, priv, c) + } +} + +type testEncryptOAEPMessage struct { + in []byte + seed []byte + out []byte +} + +type testEncryptOAEPStruct struct { + modulus string + e int + d string + msgs []testEncryptOAEPMessage +} + +func TestEncryptOAEP(t *testing.T) { + sha1 := sha1.New() + n := new(big.Int) + for i, test := range testEncryptOAEPData { + n.SetString(test.modulus, 16) + public := PublicKey{n, test.e} + + for j, message := range test.msgs { + randomSource := bytes.NewReader(message.seed) + out, err := EncryptOAEP(sha1, randomSource, &public, message.in, nil) + if err != nil { + t.Errorf("#%d,%d error: %s", i, j, err) + } + if !bytes.Equal(out, message.out) { + t.Errorf("#%d,%d bad result: %x (want %x)", i, j, out, message.out) + } + } + } +} + +func TestDecryptOAEP(t *testing.T) { + random := rand.Reader + + sha1 := sha1.New() + n := new(big.Int) + d := new(big.Int) + for i, test := range testEncryptOAEPData { + n.SetString(test.modulus, 16) + d.SetString(test.d, 16) + private := new(PrivateKey) + private.PublicKey = PublicKey{n, test.e} + private.D = d + + for j, message := range test.msgs { + out, err := DecryptOAEP(sha1, nil, private, message.out, nil) + if err != nil { + t.Errorf("#%d,%d error: %s", i, j, err) + } else if !bytes.Equal(out, message.in) { + t.Errorf("#%d,%d bad result: %#v (want %#v)", i, j, out, message.in) + } + + // Decrypt with blinding. + out, err = DecryptOAEP(sha1, random, private, message.out, nil) + if err != nil { + t.Errorf("#%d,%d (blind) error: %s", i, j, err) + } else if !bytes.Equal(out, message.in) { + t.Errorf("#%d,%d (blind) bad result: %#v (want %#v)", i, j, out, message.in) + } + } + if testing.Short() { + break + } + } +} + +// testEncryptOAEPData contains a subset of the vectors from RSA's "Test vectors for RSA-OAEP". +var testEncryptOAEPData = []testEncryptOAEPStruct{ + // Key 1 + {"a8b3b284af8eb50b387034a860f146c4919f318763cd6c5598c8ae4811a1e0abc4c7e0b082d693a5e7fced675cf4668512772c0cbc64a742c6c630f533c8cc72f62ae833c40bf25842e984bb78bdbf97c0107d55bdb662f5c4e0fab9845cb5148ef7392dd3aaff93ae1e6b667bb3d4247616d4f5ba10d4cfd226de88d39f16fb", + 65537, + "53339cfdb79fc8466a655c7316aca85c55fd8f6dd898fdaf119517ef4f52e8fd8e258df93fee180fa0e4ab29693cd83b152a553d4ac4d1812b8b9fa5af0e7f55fe7304df41570926f3311f15c4d65a732c483116ee3d3d2d0af3549ad9bf7cbfb78ad884f84d5beb04724dc7369b31def37d0cf539e9cfcdd3de653729ead5d1", + []testEncryptOAEPMessage{ + // Example 1.1 + { + []byte{0x66, 0x28, 0x19, 0x4e, 0x12, 0x07, 0x3d, 0xb0, + 0x3b, 0xa9, 0x4c, 0xda, 0x9e, 0xf9, 0x53, 0x23, 0x97, + 0xd5, 0x0d, 0xba, 0x79, 0xb9, 0x87, 0x00, 0x4a, 0xfe, + 0xfe, 0x34, + }, + []byte{0x18, 0xb7, 0x76, 0xea, 0x21, 0x06, 0x9d, 0x69, + 0x77, 0x6a, 0x33, 0xe9, 0x6b, 0xad, 0x48, 0xe1, 0xdd, + 0xa0, 0xa5, 0xef, + }, + []byte{0x35, 0x4f, 0xe6, 0x7b, 0x4a, 0x12, 0x6d, 0x5d, + 0x35, 0xfe, 0x36, 0xc7, 0x77, 0x79, 0x1a, 0x3f, 0x7b, + 0xa1, 0x3d, 0xef, 0x48, 0x4e, 0x2d, 0x39, 0x08, 0xaf, + 0xf7, 0x22, 0xfa, 0xd4, 0x68, 0xfb, 0x21, 0x69, 0x6d, + 0xe9, 0x5d, 0x0b, 0xe9, 0x11, 0xc2, 0xd3, 0x17, 0x4f, + 0x8a, 0xfc, 0xc2, 0x01, 0x03, 0x5f, 0x7b, 0x6d, 0x8e, + 0x69, 0x40, 0x2d, 0xe5, 0x45, 0x16, 0x18, 0xc2, 0x1a, + 0x53, 0x5f, 0xa9, 0xd7, 0xbf, 0xc5, 0xb8, 0xdd, 0x9f, + 0xc2, 0x43, 0xf8, 0xcf, 0x92, 0x7d, 0xb3, 0x13, 0x22, + 0xd6, 0xe8, 0x81, 0xea, 0xa9, 0x1a, 0x99, 0x61, 0x70, + 0xe6, 0x57, 0xa0, 0x5a, 0x26, 0x64, 0x26, 0xd9, 0x8c, + 0x88, 0x00, 0x3f, 0x84, 0x77, 0xc1, 0x22, 0x70, 0x94, + 0xa0, 0xd9, 0xfa, 0x1e, 0x8c, 0x40, 0x24, 0x30, 0x9c, + 0xe1, 0xec, 0xcc, 0xb5, 0x21, 0x00, 0x35, 0xd4, 0x7a, + 0xc7, 0x2e, 0x8a, + }, + }, + // Example 1.2 + { + []byte{0x75, 0x0c, 0x40, 0x47, 0xf5, 0x47, 0xe8, 0xe4, + 0x14, 0x11, 0x85, 0x65, 0x23, 0x29, 0x8a, 0xc9, 0xba, + 0xe2, 0x45, 0xef, 0xaf, 0x13, 0x97, 0xfb, 0xe5, 0x6f, + 0x9d, 0xd5, + }, + []byte{0x0c, 0xc7, 0x42, 0xce, 0x4a, 0x9b, 0x7f, 0x32, + 0xf9, 0x51, 0xbc, 0xb2, 0x51, 0xef, 0xd9, 0x25, 0xfe, + 0x4f, 0xe3, 0x5f, + }, + []byte{0x64, 0x0d, 0xb1, 0xac, 0xc5, 0x8e, 0x05, 0x68, + 0xfe, 0x54, 0x07, 0xe5, 0xf9, 0xb7, 0x01, 0xdf, 0xf8, + 0xc3, 0xc9, 0x1e, 0x71, 0x6c, 0x53, 0x6f, 0xc7, 0xfc, + 0xec, 0x6c, 0xb5, 0xb7, 0x1c, 0x11, 0x65, 0x98, 0x8d, + 0x4a, 0x27, 0x9e, 0x15, 0x77, 0xd7, 0x30, 0xfc, 0x7a, + 0x29, 0x93, 0x2e, 0x3f, 0x00, 0xc8, 0x15, 0x15, 0x23, + 0x6d, 0x8d, 0x8e, 0x31, 0x01, 0x7a, 0x7a, 0x09, 0xdf, + 0x43, 0x52, 0xd9, 0x04, 0xcd, 0xeb, 0x79, 0xaa, 0x58, + 0x3a, 0xdc, 0xc3, 0x1e, 0xa6, 0x98, 0xa4, 0xc0, 0x52, + 0x83, 0xda, 0xba, 0x90, 0x89, 0xbe, 0x54, 0x91, 0xf6, + 0x7c, 0x1a, 0x4e, 0xe4, 0x8d, 0xc7, 0x4b, 0xbb, 0xe6, + 0x64, 0x3a, 0xef, 0x84, 0x66, 0x79, 0xb4, 0xcb, 0x39, + 0x5a, 0x35, 0x2d, 0x5e, 0xd1, 0x15, 0x91, 0x2d, 0xf6, + 0x96, 0xff, 0xe0, 0x70, 0x29, 0x32, 0x94, 0x6d, 0x71, + 0x49, 0x2b, 0x44, + }, + }, + // Example 1.3 + { + []byte{0xd9, 0x4a, 0xe0, 0x83, 0x2e, 0x64, 0x45, 0xce, + 0x42, 0x33, 0x1c, 0xb0, 0x6d, 0x53, 0x1a, 0x82, 0xb1, + 0xdb, 0x4b, 0xaa, 0xd3, 0x0f, 0x74, 0x6d, 0xc9, 0x16, + 0xdf, 0x24, 0xd4, 0xe3, 0xc2, 0x45, 0x1f, 0xff, 0x59, + 0xa6, 0x42, 0x3e, 0xb0, 0xe1, 0xd0, 0x2d, 0x4f, 0xe6, + 0x46, 0xcf, 0x69, 0x9d, 0xfd, 0x81, 0x8c, 0x6e, 0x97, + 0xb0, 0x51, + }, + []byte{0x25, 0x14, 0xdf, 0x46, 0x95, 0x75, 0x5a, 0x67, + 0xb2, 0x88, 0xea, 0xf4, 0x90, 0x5c, 0x36, 0xee, 0xc6, + 0x6f, 0xd2, 0xfd, + }, + []byte{0x42, 0x37, 0x36, 0xed, 0x03, 0x5f, 0x60, 0x26, + 0xaf, 0x27, 0x6c, 0x35, 0xc0, 0xb3, 0x74, 0x1b, 0x36, + 0x5e, 0x5f, 0x76, 0xca, 0x09, 0x1b, 0x4e, 0x8c, 0x29, + 0xe2, 0xf0, 0xbe, 0xfe, 0xe6, 0x03, 0x59, 0x5a, 0xa8, + 0x32, 0x2d, 0x60, 0x2d, 0x2e, 0x62, 0x5e, 0x95, 0xeb, + 0x81, 0xb2, 0xf1, 0xc9, 0x72, 0x4e, 0x82, 0x2e, 0xca, + 0x76, 0xdb, 0x86, 0x18, 0xcf, 0x09, 0xc5, 0x34, 0x35, + 0x03, 0xa4, 0x36, 0x08, 0x35, 0xb5, 0x90, 0x3b, 0xc6, + 0x37, 0xe3, 0x87, 0x9f, 0xb0, 0x5e, 0x0e, 0xf3, 0x26, + 0x85, 0xd5, 0xae, 0xc5, 0x06, 0x7c, 0xd7, 0xcc, 0x96, + 0xfe, 0x4b, 0x26, 0x70, 0xb6, 0xea, 0xc3, 0x06, 0x6b, + 0x1f, 0xcf, 0x56, 0x86, 0xb6, 0x85, 0x89, 0xaa, 0xfb, + 0x7d, 0x62, 0x9b, 0x02, 0xd8, 0xf8, 0x62, 0x5c, 0xa3, + 0x83, 0x36, 0x24, 0xd4, 0x80, 0x0f, 0xb0, 0x81, 0xb1, + 0xcf, 0x94, 0xeb, + }, + }, + }, + }, + // Key 10 + {"ae45ed5601cec6b8cc05f803935c674ddbe0d75c4c09fd7951fc6b0caec313a8df39970c518bffba5ed68f3f0d7f22a4029d413f1ae07e4ebe9e4177ce23e7f5404b569e4ee1bdcf3c1fb03ef113802d4f855eb9b5134b5a7c8085adcae6fa2fa1417ec3763be171b0c62b760ede23c12ad92b980884c641f5a8fac26bdad4a03381a22fe1b754885094c82506d4019a535a286afeb271bb9ba592de18dcf600c2aeeae56e02f7cf79fc14cf3bdc7cd84febbbf950ca90304b2219a7aa063aefa2c3c1980e560cd64afe779585b6107657b957857efde6010988ab7de417fc88d8f384c4e6e72c3f943e0c31c0c4a5cc36f879d8a3ac9d7d59860eaada6b83bb", + 65537, + "056b04216fe5f354ac77250a4b6b0c8525a85c59b0bd80c56450a22d5f438e596a333aa875e291dd43f48cb88b9d5fc0d499f9fcd1c397f9afc070cd9e398c8d19e61db7c7410a6b2675dfbf5d345b804d201add502d5ce2dfcb091ce9997bbebe57306f383e4d588103f036f7e85d1934d152a323e4a8db451d6f4a5b1b0f102cc150e02feee2b88dea4ad4c1baccb24d84072d14e1d24a6771f7408ee30564fb86d4393a34bcf0b788501d193303f13a2284b001f0f649eaf79328d4ac5c430ab4414920a9460ed1b7bc40ec653e876d09abc509ae45b525190116a0c26101848298509c1c3bf3a483e7274054e15e97075036e989f60932807b5257751e79", + []testEncryptOAEPMessage{ + // Example 10.1 + { + []byte{0x8b, 0xba, 0x6b, 0xf8, 0x2a, 0x6c, 0x0f, 0x86, + 0xd5, 0xf1, 0x75, 0x6e, 0x97, 0x95, 0x68, 0x70, 0xb0, + 0x89, 0x53, 0xb0, 0x6b, 0x4e, 0xb2, 0x05, 0xbc, 0x16, + 0x94, 0xee, + }, + []byte{0x47, 0xe1, 0xab, 0x71, 0x19, 0xfe, 0xe5, 0x6c, + 0x95, 0xee, 0x5e, 0xaa, 0xd8, 0x6f, 0x40, 0xd0, 0xaa, + 0x63, 0xbd, 0x33, + }, + []byte{0x53, 0xea, 0x5d, 0xc0, 0x8c, 0xd2, 0x60, 0xfb, + 0x3b, 0x85, 0x85, 0x67, 0x28, 0x7f, 0xa9, 0x15, 0x52, + 0xc3, 0x0b, 0x2f, 0xeb, 0xfb, 0xa2, 0x13, 0xf0, 0xae, + 0x87, 0x70, 0x2d, 0x06, 0x8d, 0x19, 0xba, 0xb0, 0x7f, + 0xe5, 0x74, 0x52, 0x3d, 0xfb, 0x42, 0x13, 0x9d, 0x68, + 0xc3, 0xc5, 0xaf, 0xee, 0xe0, 0xbf, 0xe4, 0xcb, 0x79, + 0x69, 0xcb, 0xf3, 0x82, 0xb8, 0x04, 0xd6, 0xe6, 0x13, + 0x96, 0x14, 0x4e, 0x2d, 0x0e, 0x60, 0x74, 0x1f, 0x89, + 0x93, 0xc3, 0x01, 0x4b, 0x58, 0xb9, 0xb1, 0x95, 0x7a, + 0x8b, 0xab, 0xcd, 0x23, 0xaf, 0x85, 0x4f, 0x4c, 0x35, + 0x6f, 0xb1, 0x66, 0x2a, 0xa7, 0x2b, 0xfc, 0xc7, 0xe5, + 0x86, 0x55, 0x9d, 0xc4, 0x28, 0x0d, 0x16, 0x0c, 0x12, + 0x67, 0x85, 0xa7, 0x23, 0xeb, 0xee, 0xbe, 0xff, 0x71, + 0xf1, 0x15, 0x94, 0x44, 0x0a, 0xae, 0xf8, 0x7d, 0x10, + 0x79, 0x3a, 0x87, 0x74, 0xa2, 0x39, 0xd4, 0xa0, 0x4c, + 0x87, 0xfe, 0x14, 0x67, 0xb9, 0xda, 0xf8, 0x52, 0x08, + 0xec, 0x6c, 0x72, 0x55, 0x79, 0x4a, 0x96, 0xcc, 0x29, + 0x14, 0x2f, 0x9a, 0x8b, 0xd4, 0x18, 0xe3, 0xc1, 0xfd, + 0x67, 0x34, 0x4b, 0x0c, 0xd0, 0x82, 0x9d, 0xf3, 0xb2, + 0xbe, 0xc6, 0x02, 0x53, 0x19, 0x62, 0x93, 0xc6, 0xb3, + 0x4d, 0x3f, 0x75, 0xd3, 0x2f, 0x21, 0x3d, 0xd4, 0x5c, + 0x62, 0x73, 0xd5, 0x05, 0xad, 0xf4, 0xcc, 0xed, 0x10, + 0x57, 0xcb, 0x75, 0x8f, 0xc2, 0x6a, 0xee, 0xfa, 0x44, + 0x12, 0x55, 0xed, 0x4e, 0x64, 0xc1, 0x99, 0xee, 0x07, + 0x5e, 0x7f, 0x16, 0x64, 0x61, 0x82, 0xfd, 0xb4, 0x64, + 0x73, 0x9b, 0x68, 0xab, 0x5d, 0xaf, 0xf0, 0xe6, 0x3e, + 0x95, 0x52, 0x01, 0x68, 0x24, 0xf0, 0x54, 0xbf, 0x4d, + 0x3c, 0x8c, 0x90, 0xa9, 0x7b, 0xb6, 0xb6, 0x55, 0x32, + 0x84, 0xeb, 0x42, 0x9f, 0xcc, + }, + }, + }, + }, +} diff --git a/src/crypto/rsa/testdata/pss-vect.txt.bz2 b/src/crypto/rsa/testdata/pss-vect.txt.bz2 new file mode 100644 index 0000000000000000000000000000000000000000..ad3da1ac4ee62b68c166ea4e1fc1c540030e7e54 Binary files /dev/null and b/src/crypto/rsa/testdata/pss-vect.txt.bz2 differ diff --git a/src/crypto/sha1/example_test.go b/src/crypto/sha1/example_test.go new file mode 100644 index 0000000000000000000000000000000000000000..42aec8afa26e3f6d989c99558160d78607cf442d --- /dev/null +++ b/src/crypto/sha1/example_test.go @@ -0,0 +1,25 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package sha1_test + +import ( + "crypto/sha1" + "fmt" + "io" +) + +func ExampleNew() { + h := sha1.New() + io.WriteString(h, "His money is twice tainted:") + io.WriteString(h, " 'taint yours and 'taint mine.") + fmt.Printf("% x", h.Sum(nil)) + // Output: 59 7f 6a 54 00 10 f9 4c 15 d7 18 06 a9 9a 2c 87 10 e7 47 bd +} + +func ExampleSum() { + data := []byte("This page intentionally left blank.") + fmt.Printf("% x", sha1.Sum(data)) + // Output: af 06 49 23 bb f2 30 15 96 aa c4 c2 73 ba 32 17 8e bc 4a 96 +} diff --git a/src/crypto/sha1/sha1.go b/src/crypto/sha1/sha1.go new file mode 100644 index 0000000000000000000000000000000000000000..9f1a96e36492ab131ecb403b76318238c667c79e --- /dev/null +++ b/src/crypto/sha1/sha1.go @@ -0,0 +1,130 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package sha1 implements the SHA1 hash algorithm as defined in RFC 3174. +package sha1 + +import ( + "crypto" + "hash" +) + +func init() { + crypto.RegisterHash(crypto.SHA1, New) +} + +// The size of a SHA1 checksum in bytes. +const Size = 20 + +// The blocksize of SHA1 in bytes. +const BlockSize = 64 + +const ( + chunk = 64 + init0 = 0x67452301 + init1 = 0xEFCDAB89 + init2 = 0x98BADCFE + init3 = 0x10325476 + init4 = 0xC3D2E1F0 +) + +// digest represents the partial evaluation of a checksum. +type digest struct { + h [5]uint32 + x [chunk]byte + nx int + len uint64 +} + +func (d *digest) Reset() { + d.h[0] = init0 + d.h[1] = init1 + d.h[2] = init2 + d.h[3] = init3 + d.h[4] = init4 + d.nx = 0 + d.len = 0 +} + +// New returns a new hash.Hash computing the SHA1 checksum. +func New() hash.Hash { + d := new(digest) + d.Reset() + return d +} + +func (d *digest) Size() int { return Size } + +func (d *digest) BlockSize() int { return BlockSize } + +func (d *digest) Write(p []byte) (nn int, err error) { + nn = len(p) + d.len += uint64(nn) + if d.nx > 0 { + n := copy(d.x[d.nx:], p) + d.nx += n + if d.nx == chunk { + block(d, d.x[:]) + d.nx = 0 + } + p = p[n:] + } + if len(p) >= chunk { + n := len(p) &^ (chunk - 1) + block(d, p[:n]) + p = p[n:] + } + if len(p) > 0 { + d.nx = copy(d.x[:], p) + } + return +} + +func (d0 *digest) Sum(in []byte) []byte { + // Make a copy of d0 so that caller can keep writing and summing. + d := *d0 + hash := d.checkSum() + return append(in, hash[:]...) +} + +func (d *digest) checkSum() [Size]byte { + len := d.len + // Padding. Add a 1 bit and 0 bits until 56 bytes mod 64. + var tmp [64]byte + tmp[0] = 0x80 + if len%64 < 56 { + d.Write(tmp[0 : 56-len%64]) + } else { + d.Write(tmp[0 : 64+56-len%64]) + } + + // Length in bits. + len <<= 3 + for i := uint(0); i < 8; i++ { + tmp[i] = byte(len >> (56 - 8*i)) + } + d.Write(tmp[0:8]) + + if d.nx != 0 { + panic("d.nx != 0") + } + + var digest [Size]byte + for i, s := range d.h { + digest[i*4] = byte(s >> 24) + digest[i*4+1] = byte(s >> 16) + digest[i*4+2] = byte(s >> 8) + digest[i*4+3] = byte(s) + } + + return digest +} + +// Sum returns the SHA1 checksum of the data. +func Sum(data []byte) [Size]byte { + var d digest + d.Reset() + d.Write(data) + return d.checkSum() +} diff --git a/src/crypto/sha1/sha1_test.go b/src/crypto/sha1/sha1_test.go new file mode 100644 index 0000000000000000000000000000000000000000..4a629518b761eb3c64813c35c0305a6f227fcbe2 --- /dev/null +++ b/src/crypto/sha1/sha1_test.go @@ -0,0 +1,129 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// SHA1 hash algorithm. See RFC 3174. + +package sha1 + +import ( + "crypto/rand" + "fmt" + "io" + "testing" +) + +type sha1Test struct { + out string + in string +} + +var golden = []sha1Test{ + {"da39a3ee5e6b4b0d3255bfef95601890afd80709", ""}, + {"86f7e437faa5a7fce15d1ddcb9eaeaea377667b8", "a"}, + {"da23614e02469a0d7c7bd1bdab5c9c474b1904dc", "ab"}, + {"a9993e364706816aba3e25717850c26c9cd0d89d", "abc"}, + {"81fe8bfe87576c3ecb22426f8e57847382917acf", "abcd"}, + {"03de6c570bfe24bfc328ccd7ca46b76eadaf4334", "abcde"}, + {"1f8ac10f23c5b5bc1167bda84b833e5c057a77d2", "abcdef"}, + {"2fb5e13419fc89246865e7a324f476ec624e8740", "abcdefg"}, + {"425af12a0743502b322e93a015bcf868e324d56a", "abcdefgh"}, + {"c63b19f1e4c8b5f76b25c49b8b87f57d8e4872a1", "abcdefghi"}, + {"d68c19a0a345b7eab78d5e11e991c026ec60db63", "abcdefghij"}, + {"ebf81ddcbe5bf13aaabdc4d65354fdf2044f38a7", "Discard medicine more than two years old."}, + {"e5dea09392dd886ca63531aaa00571dc07554bb6", "He who has a shady past knows that nice guys finish last."}, + {"45988f7234467b94e3e9494434c96ee3609d8f8f", "I wouldn't marry him with a ten foot pole."}, + {"55dee037eb7460d5a692d1ce11330b260e40c988", "Free! Free!/A trip/to Mars/for 900/empty jars/Burma Shave"}, + {"b7bc5fb91080c7de6b582ea281f8a396d7c0aee8", "The days of the digital watch are numbered. -Tom Stoppard"}, + {"c3aed9358f7c77f523afe86135f06b95b3999797", "Nepal premier won't resign."}, + {"6e29d302bf6e3a5e4305ff318d983197d6906bb9", "For every action there is an equal and opposite government program."}, + {"597f6a540010f94c15d71806a99a2c8710e747bd", "His money is twice tainted: 'taint yours and 'taint mine."}, + {"6859733b2590a8a091cecf50086febc5ceef1e80", "There is no reason for any individual to have a computer in their home. -Ken Olsen, 1977"}, + {"514b2630ec089b8aee18795fc0cf1f4860cdacad", "It's a tiny change to the code and not completely disgusting. - Bob Manchek"}, + {"c5ca0d4a7b6676fc7aa72caa41cc3d5df567ed69", "size: a.out: bad magic"}, + {"74c51fa9a04eadc8c1bbeaa7fc442f834b90a00a", "The major problem is with sendmail. -Mark Horton"}, + {"0b4c4ce5f52c3ad2821852a8dc00217fa18b8b66", "Give me a rock, paper and scissors and I will move the world. CCFestoon"}, + {"3ae7937dd790315beb0f48330e8642237c61550a", "If the enemy is within range, then so are you."}, + {"410a2b296df92b9a47412b13281df8f830a9f44b", "It's well we cannot hear the screams/That we create in others' dreams."}, + {"841e7c85ca1adcddbdd0187f1289acb5c642f7f5", "You remind me of a TV show, but that's all right: I watch it anyway."}, + {"163173b825d03b952601376b25212df66763e1db", "C is as portable as Stonehedge!!"}, + {"32b0377f2687eb88e22106f133c586ab314d5279", "Even if I could be Shakespeare, I think I should still choose to be Faraday. - A. Huxley"}, + {"0885aaf99b569542fd165fa44e322718f4a984e0", "The fugacity of a constituent in a mixture of gases at a given temperature is proportional to its mole fraction. Lewis-Randall Rule"}, + {"6627d6904d71420b0bf3886ab629623538689f45", "How can you write a big system without C++? -Paul Glick"}, +} + +func TestGolden(t *testing.T) { + for i := 0; i < len(golden); i++ { + g := golden[i] + s := fmt.Sprintf("%x", Sum([]byte(g.in))) + if s != g.out { + t.Fatalf("Sum function: sha1(%s) = %s want %s", g.in, s, g.out) + } + c := New() + for j := 0; j < 3; j++ { + if j < 2 { + io.WriteString(c, g.in) + } else { + io.WriteString(c, g.in[0:len(g.in)/2]) + c.Sum(nil) + io.WriteString(c, g.in[len(g.in)/2:]) + } + s := fmt.Sprintf("%x", c.Sum(nil)) + if s != g.out { + t.Fatalf("sha1[%d](%s) = %s want %s", j, g.in, s, g.out) + } + c.Reset() + } + } +} + +func TestSize(t *testing.T) { + c := New() + if got := c.Size(); got != Size { + t.Errorf("Size = %d; want %d", got, Size) + } +} + +func TestBlockSize(t *testing.T) { + c := New() + if got := c.BlockSize(); got != BlockSize { + t.Errorf("BlockSize = %d; want %d", got, BlockSize) + } +} + +// Tests that blockGeneric (pure Go) and block (in assembly for amd64, 386, arm) match. +func TestBlockGeneric(t *testing.T) { + gen, asm := New().(*digest), New().(*digest) + buf := make([]byte, BlockSize*20) // arbitrary factor + rand.Read(buf) + blockGeneric(gen, buf) + block(asm, buf) + if *gen != *asm { + t.Error("block and blockGeneric resulted in different states") + } +} + +var bench = New() +var buf = make([]byte, 8192) + +func benchmarkSize(b *testing.B, size int) { + b.SetBytes(int64(size)) + sum := make([]byte, bench.Size()) + for i := 0; i < b.N; i++ { + bench.Reset() + bench.Write(buf[:size]) + bench.Sum(sum[:0]) + } +} + +func BenchmarkHash8Bytes(b *testing.B) { + benchmarkSize(b, 8) +} + +func BenchmarkHash1K(b *testing.B) { + benchmarkSize(b, 1024) +} + +func BenchmarkHash8K(b *testing.B) { + benchmarkSize(b, 8192) +} diff --git a/src/crypto/sha1/sha1block.go b/src/crypto/sha1/sha1block.go new file mode 100644 index 0000000000000000000000000000000000000000..fde3c981c083f46c24b620c63758200df8c238b0 --- /dev/null +++ b/src/crypto/sha1/sha1block.go @@ -0,0 +1,90 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package sha1 + +const ( + _K0 = 0x5A827999 + _K1 = 0x6ED9EBA1 + _K2 = 0x8F1BBCDC + _K3 = 0xCA62C1D6 +) + +// blockGeneric is a portable, pure Go version of the SHA1 block step. +// It's used by sha1block_generic.go and tests. +func blockGeneric(dig *digest, p []byte) { + var w [16]uint32 + + h0, h1, h2, h3, h4 := dig.h[0], dig.h[1], dig.h[2], dig.h[3], dig.h[4] + for len(p) >= chunk { + // Can interlace the computation of w with the + // rounds below if needed for speed. + for i := 0; i < 16; i++ { + j := i * 4 + w[i] = uint32(p[j])<<24 | uint32(p[j+1])<<16 | uint32(p[j+2])<<8 | uint32(p[j+3]) + } + + a, b, c, d, e := h0, h1, h2, h3, h4 + + // Each of the four 20-iteration rounds + // differs only in the computation of f and + // the choice of K (_K0, _K1, etc). + i := 0 + for ; i < 16; i++ { + f := b&c | (^b)&d + a5 := a<<5 | a>>(32-5) + b30 := b<<30 | b>>(32-30) + t := a5 + f + e + w[i&0xf] + _K0 + a, b, c, d, e = t, a, b30, c, d + } + for ; i < 20; i++ { + tmp := w[(i-3)&0xf] ^ w[(i-8)&0xf] ^ w[(i-14)&0xf] ^ w[(i)&0xf] + w[i&0xf] = tmp<<1 | tmp>>(32-1) + + f := b&c | (^b)&d + a5 := a<<5 | a>>(32-5) + b30 := b<<30 | b>>(32-30) + t := a5 + f + e + w[i&0xf] + _K0 + a, b, c, d, e = t, a, b30, c, d + } + for ; i < 40; i++ { + tmp := w[(i-3)&0xf] ^ w[(i-8)&0xf] ^ w[(i-14)&0xf] ^ w[(i)&0xf] + w[i&0xf] = tmp<<1 | tmp>>(32-1) + f := b ^ c ^ d + a5 := a<<5 | a>>(32-5) + b30 := b<<30 | b>>(32-30) + t := a5 + f + e + w[i&0xf] + _K1 + a, b, c, d, e = t, a, b30, c, d + } + for ; i < 60; i++ { + tmp := w[(i-3)&0xf] ^ w[(i-8)&0xf] ^ w[(i-14)&0xf] ^ w[(i)&0xf] + w[i&0xf] = tmp<<1 | tmp>>(32-1) + f := ((b | c) & d) | (b & c) + + a5 := a<<5 | a>>(32-5) + b30 := b<<30 | b>>(32-30) + t := a5 + f + e + w[i&0xf] + _K2 + a, b, c, d, e = t, a, b30, c, d + } + for ; i < 80; i++ { + tmp := w[(i-3)&0xf] ^ w[(i-8)&0xf] ^ w[(i-14)&0xf] ^ w[(i)&0xf] + w[i&0xf] = tmp<<1 | tmp>>(32-1) + f := b ^ c ^ d + a5 := a<<5 | a>>(32-5) + b30 := b<<30 | b>>(32-30) + t := a5 + f + e + w[i&0xf] + _K3 + a, b, c, d, e = t, a, b30, c, d + } + + h0 += a + h1 += b + h2 += c + h3 += d + h4 += e + + p = p[chunk:] + } + + dig.h[0], dig.h[1], dig.h[2], dig.h[3], dig.h[4] = h0, h1, h2, h3, h4 +} diff --git a/src/crypto/sha1/sha1block_386.s b/src/crypto/sha1/sha1block_386.s new file mode 100644 index 0000000000000000000000000000000000000000..a0adabc3c37302ba949c18fcec89fb909dbcc696 --- /dev/null +++ b/src/crypto/sha1/sha1block_386.s @@ -0,0 +1,233 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +#include "textflag.h" + +// SHA1 block routine. See sha1block.go for Go equivalent. +// +// There are 80 rounds of 4 types: +// - rounds 0-15 are type 1 and load data (ROUND1 macro). +// - rounds 16-19 are type 1 and do not load data (ROUND1x macro). +// - rounds 20-39 are type 2 and do not load data (ROUND2 macro). +// - rounds 40-59 are type 3 and do not load data (ROUND3 macro). +// - rounds 60-79 are type 4 and do not load data (ROUND4 macro). +// +// Each round loads or shuffles the data, then computes a per-round +// function of b, c, d, and then mixes the result into and rotates the +// five registers a, b, c, d, e holding the intermediate results. +// +// The register rotation is implemented by rotating the arguments to +// the round macros instead of by explicit move instructions. + +// Like sha1block_amd64.s, but we keep the data and limit pointers on the stack. +// To free up the word pointer (R10 on amd64, DI here), we add it to e during +// LOAD/SHUFFLE instead of during MIX. +// +// The stack holds the intermediate word array - 16 uint32s - at 0(SP) up to 64(SP). +// The saved a, b, c, d, e (R11 through R15 on amd64) are at 64(SP) up to 84(SP). +// The saved limit pointer (DI on amd64) is at 84(SP). +// The saved data pointer (SI on amd64) is at 88(SP). + +#define LOAD(index, e) \ + MOVL 88(SP), SI; \ + MOVL (index*4)(SI), DI; \ + BSWAPL DI; \ + MOVL DI, (index*4)(SP); \ + ADDL DI, e + +#define SHUFFLE(index, e) \ + MOVL (((index)&0xf)*4)(SP), DI; \ + XORL (((index-3)&0xf)*4)(SP), DI; \ + XORL (((index-8)&0xf)*4)(SP), DI; \ + XORL (((index-14)&0xf)*4)(SP), DI; \ + ROLL $1, DI; \ + MOVL DI, (((index)&0xf)*4)(SP); \ + ADDL DI, e + +#define FUNC1(a, b, c, d, e) \ + MOVL d, DI; \ + XORL c, DI; \ + ANDL b, DI; \ + XORL d, DI + +#define FUNC2(a, b, c, d, e) \ + MOVL b, DI; \ + XORL c, DI; \ + XORL d, DI + +#define FUNC3(a, b, c, d, e) \ + MOVL b, SI; \ + ORL c, SI; \ + ANDL d, SI; \ + MOVL b, DI; \ + ANDL c, DI; \ + ORL SI, DI + +#define FUNC4 FUNC2 + +#define MIX(a, b, c, d, e, const) \ + ROLL $30, b; \ + ADDL DI, e; \ + MOVL a, SI; \ + ROLL $5, SI; \ + LEAL const(e)(SI*1), e + +#define ROUND1(a, b, c, d, e, index) \ + LOAD(index, e); \ + FUNC1(a, b, c, d, e); \ + MIX(a, b, c, d, e, 0x5A827999) + +#define ROUND1x(a, b, c, d, e, index) \ + SHUFFLE(index, e); \ + FUNC1(a, b, c, d, e); \ + MIX(a, b, c, d, e, 0x5A827999) + +#define ROUND2(a, b, c, d, e, index) \ + SHUFFLE(index, e); \ + FUNC2(a, b, c, d, e); \ + MIX(a, b, c, d, e, 0x6ED9EBA1) + +#define ROUND3(a, b, c, d, e, index) \ + SHUFFLE(index, e); \ + FUNC3(a, b, c, d, e); \ + MIX(a, b, c, d, e, 0x8F1BBCDC) + +#define ROUND4(a, b, c, d, e, index) \ + SHUFFLE(index, e); \ + FUNC4(a, b, c, d, e); \ + MIX(a, b, c, d, e, 0xCA62C1D6) + +// func block(dig *digest, p []byte) +TEXT ·block(SB),NOSPLIT,$92-16 + MOVL dig+0(FP), BP + MOVL p+4(FP), SI + MOVL p_len+8(FP), DX + SHRL $6, DX + SHLL $6, DX + + LEAL (SI)(DX*1), DI + MOVL (0*4)(BP), AX + MOVL (1*4)(BP), BX + MOVL (2*4)(BP), CX + MOVL (3*4)(BP), DX + MOVL (4*4)(BP), BP + + CMPL SI, DI + JEQ end + + MOVL DI, 84(SP) + +loop: + MOVL SI, 88(SP) + + MOVL AX, 64(SP) + MOVL BX, 68(SP) + MOVL CX, 72(SP) + MOVL DX, 76(SP) + MOVL BP, 80(SP) + + ROUND1(AX, BX, CX, DX, BP, 0) + ROUND1(BP, AX, BX, CX, DX, 1) + ROUND1(DX, BP, AX, BX, CX, 2) + ROUND1(CX, DX, BP, AX, BX, 3) + ROUND1(BX, CX, DX, BP, AX, 4) + ROUND1(AX, BX, CX, DX, BP, 5) + ROUND1(BP, AX, BX, CX, DX, 6) + ROUND1(DX, BP, AX, BX, CX, 7) + ROUND1(CX, DX, BP, AX, BX, 8) + ROUND1(BX, CX, DX, BP, AX, 9) + ROUND1(AX, BX, CX, DX, BP, 10) + ROUND1(BP, AX, BX, CX, DX, 11) + ROUND1(DX, BP, AX, BX, CX, 12) + ROUND1(CX, DX, BP, AX, BX, 13) + ROUND1(BX, CX, DX, BP, AX, 14) + ROUND1(AX, BX, CX, DX, BP, 15) + + ROUND1x(BP, AX, BX, CX, DX, 16) + ROUND1x(DX, BP, AX, BX, CX, 17) + ROUND1x(CX, DX, BP, AX, BX, 18) + ROUND1x(BX, CX, DX, BP, AX, 19) + + ROUND2(AX, BX, CX, DX, BP, 20) + ROUND2(BP, AX, BX, CX, DX, 21) + ROUND2(DX, BP, AX, BX, CX, 22) + ROUND2(CX, DX, BP, AX, BX, 23) + ROUND2(BX, CX, DX, BP, AX, 24) + ROUND2(AX, BX, CX, DX, BP, 25) + ROUND2(BP, AX, BX, CX, DX, 26) + ROUND2(DX, BP, AX, BX, CX, 27) + ROUND2(CX, DX, BP, AX, BX, 28) + ROUND2(BX, CX, DX, BP, AX, 29) + ROUND2(AX, BX, CX, DX, BP, 30) + ROUND2(BP, AX, BX, CX, DX, 31) + ROUND2(DX, BP, AX, BX, CX, 32) + ROUND2(CX, DX, BP, AX, BX, 33) + ROUND2(BX, CX, DX, BP, AX, 34) + ROUND2(AX, BX, CX, DX, BP, 35) + ROUND2(BP, AX, BX, CX, DX, 36) + ROUND2(DX, BP, AX, BX, CX, 37) + ROUND2(CX, DX, BP, AX, BX, 38) + ROUND2(BX, CX, DX, BP, AX, 39) + + ROUND3(AX, BX, CX, DX, BP, 40) + ROUND3(BP, AX, BX, CX, DX, 41) + ROUND3(DX, BP, AX, BX, CX, 42) + ROUND3(CX, DX, BP, AX, BX, 43) + ROUND3(BX, CX, DX, BP, AX, 44) + ROUND3(AX, BX, CX, DX, BP, 45) + ROUND3(BP, AX, BX, CX, DX, 46) + ROUND3(DX, BP, AX, BX, CX, 47) + ROUND3(CX, DX, BP, AX, BX, 48) + ROUND3(BX, CX, DX, BP, AX, 49) + ROUND3(AX, BX, CX, DX, BP, 50) + ROUND3(BP, AX, BX, CX, DX, 51) + ROUND3(DX, BP, AX, BX, CX, 52) + ROUND3(CX, DX, BP, AX, BX, 53) + ROUND3(BX, CX, DX, BP, AX, 54) + ROUND3(AX, BX, CX, DX, BP, 55) + ROUND3(BP, AX, BX, CX, DX, 56) + ROUND3(DX, BP, AX, BX, CX, 57) + ROUND3(CX, DX, BP, AX, BX, 58) + ROUND3(BX, CX, DX, BP, AX, 59) + + ROUND4(AX, BX, CX, DX, BP, 60) + ROUND4(BP, AX, BX, CX, DX, 61) + ROUND4(DX, BP, AX, BX, CX, 62) + ROUND4(CX, DX, BP, AX, BX, 63) + ROUND4(BX, CX, DX, BP, AX, 64) + ROUND4(AX, BX, CX, DX, BP, 65) + ROUND4(BP, AX, BX, CX, DX, 66) + ROUND4(DX, BP, AX, BX, CX, 67) + ROUND4(CX, DX, BP, AX, BX, 68) + ROUND4(BX, CX, DX, BP, AX, 69) + ROUND4(AX, BX, CX, DX, BP, 70) + ROUND4(BP, AX, BX, CX, DX, 71) + ROUND4(DX, BP, AX, BX, CX, 72) + ROUND4(CX, DX, BP, AX, BX, 73) + ROUND4(BX, CX, DX, BP, AX, 74) + ROUND4(AX, BX, CX, DX, BP, 75) + ROUND4(BP, AX, BX, CX, DX, 76) + ROUND4(DX, BP, AX, BX, CX, 77) + ROUND4(CX, DX, BP, AX, BX, 78) + ROUND4(BX, CX, DX, BP, AX, 79) + + ADDL 64(SP), AX + ADDL 68(SP), BX + ADDL 72(SP), CX + ADDL 76(SP), DX + ADDL 80(SP), BP + + MOVL 88(SP), SI + ADDL $64, SI + CMPL SI, 84(SP) + JB loop + +end: + MOVL dig+0(FP), DI + MOVL AX, (0*4)(DI) + MOVL BX, (1*4)(DI) + MOVL CX, (2*4)(DI) + MOVL DX, (3*4)(DI) + MOVL BP, (4*4)(DI) + RET diff --git a/src/crypto/sha1/sha1block_amd64.s b/src/crypto/sha1/sha1block_amd64.s new file mode 100644 index 0000000000000000000000000000000000000000..4319df63e169b931f680fc9ddb94f886db08a598 --- /dev/null +++ b/src/crypto/sha1/sha1block_amd64.s @@ -0,0 +1,216 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +#include "textflag.h" + +// SHA1 block routine. See sha1block.go for Go equivalent. +// +// There are 80 rounds of 4 types: +// - rounds 0-15 are type 1 and load data (ROUND1 macro). +// - rounds 16-19 are type 1 and do not load data (ROUND1x macro). +// - rounds 20-39 are type 2 and do not load data (ROUND2 macro). +// - rounds 40-59 are type 3 and do not load data (ROUND3 macro). +// - rounds 60-79 are type 4 and do not load data (ROUND4 macro). +// +// Each round loads or shuffles the data, then computes a per-round +// function of b, c, d, and then mixes the result into and rotates the +// five registers a, b, c, d, e holding the intermediate results. +// +// The register rotation is implemented by rotating the arguments to +// the round macros instead of by explicit move instructions. + +#define LOAD(index) \ + MOVL (index*4)(SI), R10; \ + BSWAPL R10; \ + MOVL R10, (index*4)(SP) + +#define SHUFFLE(index) \ + MOVL (((index)&0xf)*4)(SP), R10; \ + XORL (((index-3)&0xf)*4)(SP), R10; \ + XORL (((index-8)&0xf)*4)(SP), R10; \ + XORL (((index-14)&0xf)*4)(SP), R10; \ + ROLL $1, R10; \ + MOVL R10, (((index)&0xf)*4)(SP) + +#define FUNC1(a, b, c, d, e) \ + MOVL d, R9; \ + XORL c, R9; \ + ANDL b, R9; \ + XORL d, R9 + +#define FUNC2(a, b, c, d, e) \ + MOVL b, R9; \ + XORL c, R9; \ + XORL d, R9 + +#define FUNC3(a, b, c, d, e) \ + MOVL b, R8; \ + ORL c, R8; \ + ANDL d, R8; \ + MOVL b, R9; \ + ANDL c, R9; \ + ORL R8, R9 + +#define FUNC4 FUNC2 + +#define MIX(a, b, c, d, e, const) \ + ROLL $30, b; \ + ADDL R9, e; \ + MOVL a, R8; \ + ROLL $5, R8; \ + LEAL const(e)(R10*1), e; \ + ADDL R8, e + +#define ROUND1(a, b, c, d, e, index) \ + LOAD(index); \ + FUNC1(a, b, c, d, e); \ + MIX(a, b, c, d, e, 0x5A827999) + +#define ROUND1x(a, b, c, d, e, index) \ + SHUFFLE(index); \ + FUNC1(a, b, c, d, e); \ + MIX(a, b, c, d, e, 0x5A827999) + +#define ROUND2(a, b, c, d, e, index) \ + SHUFFLE(index); \ + FUNC2(a, b, c, d, e); \ + MIX(a, b, c, d, e, 0x6ED9EBA1) + +#define ROUND3(a, b, c, d, e, index) \ + SHUFFLE(index); \ + FUNC3(a, b, c, d, e); \ + MIX(a, b, c, d, e, 0x8F1BBCDC) + +#define ROUND4(a, b, c, d, e, index) \ + SHUFFLE(index); \ + FUNC4(a, b, c, d, e); \ + MIX(a, b, c, d, e, 0xCA62C1D6) + +TEXT ·block(SB),NOSPLIT,$64-32 + MOVQ dig+0(FP), BP + MOVQ p_base+8(FP), SI + MOVQ p_len+16(FP), DX + SHRQ $6, DX + SHLQ $6, DX + + LEAQ (SI)(DX*1), DI + MOVL (0*4)(BP), AX + MOVL (1*4)(BP), BX + MOVL (2*4)(BP), CX + MOVL (3*4)(BP), DX + MOVL (4*4)(BP), BP + + CMPQ SI, DI + JEQ end + +loop: + MOVL AX, R11 + MOVL BX, R12 + MOVL CX, R13 + MOVL DX, R14 + MOVL BP, R15 + + ROUND1(AX, BX, CX, DX, BP, 0) + ROUND1(BP, AX, BX, CX, DX, 1) + ROUND1(DX, BP, AX, BX, CX, 2) + ROUND1(CX, DX, BP, AX, BX, 3) + ROUND1(BX, CX, DX, BP, AX, 4) + ROUND1(AX, BX, CX, DX, BP, 5) + ROUND1(BP, AX, BX, CX, DX, 6) + ROUND1(DX, BP, AX, BX, CX, 7) + ROUND1(CX, DX, BP, AX, BX, 8) + ROUND1(BX, CX, DX, BP, AX, 9) + ROUND1(AX, BX, CX, DX, BP, 10) + ROUND1(BP, AX, BX, CX, DX, 11) + ROUND1(DX, BP, AX, BX, CX, 12) + ROUND1(CX, DX, BP, AX, BX, 13) + ROUND1(BX, CX, DX, BP, AX, 14) + ROUND1(AX, BX, CX, DX, BP, 15) + + ROUND1x(BP, AX, BX, CX, DX, 16) + ROUND1x(DX, BP, AX, BX, CX, 17) + ROUND1x(CX, DX, BP, AX, BX, 18) + ROUND1x(BX, CX, DX, BP, AX, 19) + + ROUND2(AX, BX, CX, DX, BP, 20) + ROUND2(BP, AX, BX, CX, DX, 21) + ROUND2(DX, BP, AX, BX, CX, 22) + ROUND2(CX, DX, BP, AX, BX, 23) + ROUND2(BX, CX, DX, BP, AX, 24) + ROUND2(AX, BX, CX, DX, BP, 25) + ROUND2(BP, AX, BX, CX, DX, 26) + ROUND2(DX, BP, AX, BX, CX, 27) + ROUND2(CX, DX, BP, AX, BX, 28) + ROUND2(BX, CX, DX, BP, AX, 29) + ROUND2(AX, BX, CX, DX, BP, 30) + ROUND2(BP, AX, BX, CX, DX, 31) + ROUND2(DX, BP, AX, BX, CX, 32) + ROUND2(CX, DX, BP, AX, BX, 33) + ROUND2(BX, CX, DX, BP, AX, 34) + ROUND2(AX, BX, CX, DX, BP, 35) + ROUND2(BP, AX, BX, CX, DX, 36) + ROUND2(DX, BP, AX, BX, CX, 37) + ROUND2(CX, DX, BP, AX, BX, 38) + ROUND2(BX, CX, DX, BP, AX, 39) + + ROUND3(AX, BX, CX, DX, BP, 40) + ROUND3(BP, AX, BX, CX, DX, 41) + ROUND3(DX, BP, AX, BX, CX, 42) + ROUND3(CX, DX, BP, AX, BX, 43) + ROUND3(BX, CX, DX, BP, AX, 44) + ROUND3(AX, BX, CX, DX, BP, 45) + ROUND3(BP, AX, BX, CX, DX, 46) + ROUND3(DX, BP, AX, BX, CX, 47) + ROUND3(CX, DX, BP, AX, BX, 48) + ROUND3(BX, CX, DX, BP, AX, 49) + ROUND3(AX, BX, CX, DX, BP, 50) + ROUND3(BP, AX, BX, CX, DX, 51) + ROUND3(DX, BP, AX, BX, CX, 52) + ROUND3(CX, DX, BP, AX, BX, 53) + ROUND3(BX, CX, DX, BP, AX, 54) + ROUND3(AX, BX, CX, DX, BP, 55) + ROUND3(BP, AX, BX, CX, DX, 56) + ROUND3(DX, BP, AX, BX, CX, 57) + ROUND3(CX, DX, BP, AX, BX, 58) + ROUND3(BX, CX, DX, BP, AX, 59) + + ROUND4(AX, BX, CX, DX, BP, 60) + ROUND4(BP, AX, BX, CX, DX, 61) + ROUND4(DX, BP, AX, BX, CX, 62) + ROUND4(CX, DX, BP, AX, BX, 63) + ROUND4(BX, CX, DX, BP, AX, 64) + ROUND4(AX, BX, CX, DX, BP, 65) + ROUND4(BP, AX, BX, CX, DX, 66) + ROUND4(DX, BP, AX, BX, CX, 67) + ROUND4(CX, DX, BP, AX, BX, 68) + ROUND4(BX, CX, DX, BP, AX, 69) + ROUND4(AX, BX, CX, DX, BP, 70) + ROUND4(BP, AX, BX, CX, DX, 71) + ROUND4(DX, BP, AX, BX, CX, 72) + ROUND4(CX, DX, BP, AX, BX, 73) + ROUND4(BX, CX, DX, BP, AX, 74) + ROUND4(AX, BX, CX, DX, BP, 75) + ROUND4(BP, AX, BX, CX, DX, 76) + ROUND4(DX, BP, AX, BX, CX, 77) + ROUND4(CX, DX, BP, AX, BX, 78) + ROUND4(BX, CX, DX, BP, AX, 79) + + ADDL R11, AX + ADDL R12, BX + ADDL R13, CX + ADDL R14, DX + ADDL R15, BP + + ADDQ $64, SI + CMPQ SI, DI + JB loop + +end: + MOVQ dig+0(FP), DI + MOVL AX, (0*4)(DI) + MOVL BX, (1*4)(DI) + MOVL CX, (2*4)(DI) + MOVL DX, (3*4)(DI) + MOVL BP, (4*4)(DI) + RET diff --git a/src/crypto/sha1/sha1block_amd64p32.s b/src/crypto/sha1/sha1block_amd64p32.s new file mode 100644 index 0000000000000000000000000000000000000000..d93fbf1ed35d1766d277dcd2122f74bd8c3fbe91 --- /dev/null +++ b/src/crypto/sha1/sha1block_amd64p32.s @@ -0,0 +1,216 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +#include "textflag.h" + +// SHA1 block routine. See sha1block.go for Go equivalent. +// +// There are 80 rounds of 4 types: +// - rounds 0-15 are type 1 and load data (ROUND1 macro). +// - rounds 16-19 are type 1 and do not load data (ROUND1x macro). +// - rounds 20-39 are type 2 and do not load data (ROUND2 macro). +// - rounds 40-59 are type 3 and do not load data (ROUND3 macro). +// - rounds 60-79 are type 4 and do not load data (ROUND4 macro). +// +// Each round loads or shuffles the data, then computes a per-round +// function of b, c, d, and then mixes the result into and rotates the +// five registers a, b, c, d, e holding the intermediate results. +// +// The register rotation is implemented by rotating the arguments to +// the round macros instead of by explicit move instructions. +// +// amd64p32 version. +// To ensure safety for Native Client, avoids use of BP and R15 +// as well as two-register addressing modes. + +#define LOAD(index) \ + MOVL (index*4)(SI), R10; \ + BSWAPL R10; \ + MOVL R10, (index*4)(SP) + +#define SHUFFLE(index) \ + MOVL (((index)&0xf)*4)(SP), R10; \ + XORL (((index-3)&0xf)*4)(SP), R10; \ + XORL (((index-8)&0xf)*4)(SP), R10; \ + XORL (((index-14)&0xf)*4)(SP), R10; \ + ROLL $1, R10; \ + MOVL R10, (((index)&0xf)*4)(SP) + +#define FUNC1(a, b, c, d, e) \ + MOVL d, R9; \ + XORL c, R9; \ + ANDL b, R9; \ + XORL d, R9 + +#define FUNC2(a, b, c, d, e) \ + MOVL b, R9; \ + XORL c, R9; \ + XORL d, R9 + +#define FUNC3(a, b, c, d, e) \ + MOVL b, R8; \ + ORL c, R8; \ + ANDL d, R8; \ + MOVL b, R9; \ + ANDL c, R9; \ + ORL R8, R9 + +#define FUNC4 FUNC2 + +#define MIX(a, b, c, d, e, const) \ + ROLL $30, b; \ + ADDL R9, e; \ + MOVL a, R8; \ + ROLL $5, R8; \ + LEAL const(e)(R10*1), e; \ + ADDL R8, e + +#define ROUND1(a, b, c, d, e, index) \ + LOAD(index); \ + FUNC1(a, b, c, d, e); \ + MIX(a, b, c, d, e, 0x5A827999) + +#define ROUND1x(a, b, c, d, e, index) \ + SHUFFLE(index); \ + FUNC1(a, b, c, d, e); \ + MIX(a, b, c, d, e, 0x5A827999) + +#define ROUND2(a, b, c, d, e, index) \ + SHUFFLE(index); \ + FUNC2(a, b, c, d, e); \ + MIX(a, b, c, d, e, 0x6ED9EBA1) + +#define ROUND3(a, b, c, d, e, index) \ + SHUFFLE(index); \ + FUNC3(a, b, c, d, e); \ + MIX(a, b, c, d, e, 0x8F1BBCDC) + +#define ROUND4(a, b, c, d, e, index) \ + SHUFFLE(index); \ + FUNC4(a, b, c, d, e); \ + MIX(a, b, c, d, e, 0xCA62C1D6) + +TEXT ·block(SB),NOSPLIT,$64-32 + MOVL dig+0(FP), R14 + MOVL p_base+4(FP), SI + MOVL p_len+8(FP), DX + SHRQ $6, DX + SHLQ $6, DX + + LEAQ (SI)(DX*1), DI + MOVL (0*4)(R14), AX + MOVL (1*4)(R14), BX + MOVL (2*4)(R14), CX + MOVL (3*4)(R14), DX + MOVL (4*4)(R14), R13 + + CMPQ SI, DI + JEQ end + +loop: +#define BP R13 /* keep diff from sha1block_amd64.s small */ + ROUND1(AX, BX, CX, DX, BP, 0) + ROUND1(BP, AX, BX, CX, DX, 1) + ROUND1(DX, BP, AX, BX, CX, 2) + ROUND1(CX, DX, BP, AX, BX, 3) + ROUND1(BX, CX, DX, BP, AX, 4) + ROUND1(AX, BX, CX, DX, BP, 5) + ROUND1(BP, AX, BX, CX, DX, 6) + ROUND1(DX, BP, AX, BX, CX, 7) + ROUND1(CX, DX, BP, AX, BX, 8) + ROUND1(BX, CX, DX, BP, AX, 9) + ROUND1(AX, BX, CX, DX, BP, 10) + ROUND1(BP, AX, BX, CX, DX, 11) + ROUND1(DX, BP, AX, BX, CX, 12) + ROUND1(CX, DX, BP, AX, BX, 13) + ROUND1(BX, CX, DX, BP, AX, 14) + ROUND1(AX, BX, CX, DX, BP, 15) + + ROUND1x(BP, AX, BX, CX, DX, 16) + ROUND1x(DX, BP, AX, BX, CX, 17) + ROUND1x(CX, DX, BP, AX, BX, 18) + ROUND1x(BX, CX, DX, BP, AX, 19) + + ROUND2(AX, BX, CX, DX, BP, 20) + ROUND2(BP, AX, BX, CX, DX, 21) + ROUND2(DX, BP, AX, BX, CX, 22) + ROUND2(CX, DX, BP, AX, BX, 23) + ROUND2(BX, CX, DX, BP, AX, 24) + ROUND2(AX, BX, CX, DX, BP, 25) + ROUND2(BP, AX, BX, CX, DX, 26) + ROUND2(DX, BP, AX, BX, CX, 27) + ROUND2(CX, DX, BP, AX, BX, 28) + ROUND2(BX, CX, DX, BP, AX, 29) + ROUND2(AX, BX, CX, DX, BP, 30) + ROUND2(BP, AX, BX, CX, DX, 31) + ROUND2(DX, BP, AX, BX, CX, 32) + ROUND2(CX, DX, BP, AX, BX, 33) + ROUND2(BX, CX, DX, BP, AX, 34) + ROUND2(AX, BX, CX, DX, BP, 35) + ROUND2(BP, AX, BX, CX, DX, 36) + ROUND2(DX, BP, AX, BX, CX, 37) + ROUND2(CX, DX, BP, AX, BX, 38) + ROUND2(BX, CX, DX, BP, AX, 39) + + ROUND3(AX, BX, CX, DX, BP, 40) + ROUND3(BP, AX, BX, CX, DX, 41) + ROUND3(DX, BP, AX, BX, CX, 42) + ROUND3(CX, DX, BP, AX, BX, 43) + ROUND3(BX, CX, DX, BP, AX, 44) + ROUND3(AX, BX, CX, DX, BP, 45) + ROUND3(BP, AX, BX, CX, DX, 46) + ROUND3(DX, BP, AX, BX, CX, 47) + ROUND3(CX, DX, BP, AX, BX, 48) + ROUND3(BX, CX, DX, BP, AX, 49) + ROUND3(AX, BX, CX, DX, BP, 50) + ROUND3(BP, AX, BX, CX, DX, 51) + ROUND3(DX, BP, AX, BX, CX, 52) + ROUND3(CX, DX, BP, AX, BX, 53) + ROUND3(BX, CX, DX, BP, AX, 54) + ROUND3(AX, BX, CX, DX, BP, 55) + ROUND3(BP, AX, BX, CX, DX, 56) + ROUND3(DX, BP, AX, BX, CX, 57) + ROUND3(CX, DX, BP, AX, BX, 58) + ROUND3(BX, CX, DX, BP, AX, 59) + + ROUND4(AX, BX, CX, DX, BP, 60) + ROUND4(BP, AX, BX, CX, DX, 61) + ROUND4(DX, BP, AX, BX, CX, 62) + ROUND4(CX, DX, BP, AX, BX, 63) + ROUND4(BX, CX, DX, BP, AX, 64) + ROUND4(AX, BX, CX, DX, BP, 65) + ROUND4(BP, AX, BX, CX, DX, 66) + ROUND4(DX, BP, AX, BX, CX, 67) + ROUND4(CX, DX, BP, AX, BX, 68) + ROUND4(BX, CX, DX, BP, AX, 69) + ROUND4(AX, BX, CX, DX, BP, 70) + ROUND4(BP, AX, BX, CX, DX, 71) + ROUND4(DX, BP, AX, BX, CX, 72) + ROUND4(CX, DX, BP, AX, BX, 73) + ROUND4(BX, CX, DX, BP, AX, 74) + ROUND4(AX, BX, CX, DX, BP, 75) + ROUND4(BP, AX, BX, CX, DX, 76) + ROUND4(DX, BP, AX, BX, CX, 77) + ROUND4(CX, DX, BP, AX, BX, 78) + ROUND4(BX, CX, DX, BP, AX, 79) +#undef BP + + ADDL (0*4)(R14), AX + ADDL (1*4)(R14), BX + ADDL (2*4)(R14), CX + ADDL (3*4)(R14), DX + ADDL (4*4)(R14), R13 + + MOVL AX, (0*4)(R14) + MOVL BX, (1*4)(R14) + MOVL CX, (2*4)(R14) + MOVL DX, (3*4)(R14) + MOVL R13, (4*4)(R14) + + ADDQ $64, SI + CMPQ SI, DI + JB loop + +end: + RET diff --git a/src/crypto/sha1/sha1block_arm.s b/src/crypto/sha1/sha1block_arm.s new file mode 100644 index 0000000000000000000000000000000000000000..c06d4ba316fccbdcfc4c1f025f0e5bf6ddf84ebb --- /dev/null +++ b/src/crypto/sha1/sha1block_arm.s @@ -0,0 +1,217 @@ +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. +// +// ARM version of md5block.go + +#include "textflag.h" + +// SHA1 block routine. See sha1block.go for Go equivalent. +// +// There are 80 rounds of 4 types: +// - rounds 0-15 are type 1 and load data (ROUND1 macro). +// - rounds 16-19 are type 1 and do not load data (ROUND1x macro). +// - rounds 20-39 are type 2 and do not load data (ROUND2 macro). +// - rounds 40-59 are type 3 and do not load data (ROUND3 macro). +// - rounds 60-79 are type 4 and do not load data (ROUND4 macro). +// +// Each round loads or shuffles the data, then computes a per-round +// function of b, c, d, and then mixes the result into and rotates the +// five registers a, b, c, d, e holding the intermediate results. +// +// The register rotation is implemented by rotating the arguments to +// the round macros instead of by explicit move instructions. + +// Register definitions +#define Rdata R0 // Pointer to incoming data +#define Rconst R1 // Current constant for SHA round +#define Ra R2 // SHA1 accumulator +#define Rb R3 // SHA1 accumulator +#define Rc R4 // SHA1 accumulator +#define Rd R5 // SHA1 accumulator +#define Re R6 // SHA1 accumulator +#define Rt0 R7 // Temporary +#define Rt1 R8 // Temporary +// r9, r10 are forbidden +// r11 is OK provided you check the assembler that no synthetic instructions use it +#define Rt2 R11 // Temporary +#define Rctr R12 // loop counter +#define Rw R14 // point to w buffer + +// func block(dig *digest, p []byte) +// 0(FP) is *digest +// 4(FP) is p.array (struct Slice) +// 8(FP) is p.len +//12(FP) is p.cap +// +// Stack frame +#define p_end end-4(SP) // pointer to the end of data +#define p_data data-8(SP) // current data pointer (unused?) +#define w_buf buf-(8+4*80)(SP) //80 words temporary buffer w uint32[80] +#define saved abcde-(8+4*80+4*5)(SP) // saved sha1 registers a,b,c,d,e - these must be last (unused?) +// Total size +4 for saved LR is 352 + + // w[i] = p[j]<<24 | p[j+1]<<16 | p[j+2]<<8 | p[j+3] + // e += w[i] +#define LOAD(Re) \ + MOVBU 2(Rdata), Rt0 ; \ + MOVBU 3(Rdata), Rt1 ; \ + MOVBU 1(Rdata), Rt2 ; \ + ORR Rt0<<8, Rt1, Rt0 ; \ + MOVBU.P 4(Rdata), Rt1 ; \ + ORR Rt2<<16, Rt0, Rt0 ; \ + ORR Rt1<<24, Rt0, Rt0 ; \ + MOVW.P Rt0, 4(Rw) ; \ + ADD Rt0, Re, Re + + // tmp := w[(i-3)&0xf] ^ w[(i-8)&0xf] ^ w[(i-14)&0xf] ^ w[(i)&0xf] + // w[i&0xf] = tmp<<1 | tmp>>(32-1) + // e += w[i&0xf] +#define SHUFFLE(Re) \ + MOVW (-16*4)(Rw), Rt0 ; \ + MOVW (-14*4)(Rw), Rt1 ; \ + MOVW (-8*4)(Rw), Rt2 ; \ + EOR Rt0, Rt1, Rt0 ; \ + MOVW (-3*4)(Rw), Rt1 ; \ + EOR Rt2, Rt0, Rt0 ; \ + EOR Rt0, Rt1, Rt0 ; \ + MOVW Rt0@>(32-1), Rt0 ; \ + MOVW.P Rt0, 4(Rw) ; \ + ADD Rt0, Re, Re + + // t1 = (b & c) | ((~b) & d) +#define FUNC1(Ra, Rb, Rc, Rd, Re) \ + MVN Rb, Rt1 ; \ + AND Rb, Rc, Rt0 ; \ + AND Rd, Rt1, Rt1 ; \ + ORR Rt0, Rt1, Rt1 + + // t1 = b ^ c ^ d +#define FUNC2(Ra, Rb, Rc, Rd, Re) \ + EOR Rb, Rc, Rt1 ; \ + EOR Rd, Rt1, Rt1 + + // t1 = (b & c) | (b & d) | (c & d) = + // t1 = (b & c) | ((b | c) & d) +#define FUNC3(Ra, Rb, Rc, Rd, Re) \ + ORR Rb, Rc, Rt0 ; \ + AND Rb, Rc, Rt1 ; \ + AND Rd, Rt0, Rt0 ; \ + ORR Rt0, Rt1, Rt1 + +#define FUNC4 FUNC2 + + // a5 := a<<5 | a>>(32-5) + // b = b<<30 | b>>(32-30) + // e = a5 + t1 + e + const +#define MIX(Ra, Rb, Rc, Rd, Re) \ + ADD Rt1, Re, Re ; \ + MOVW Rb@>(32-30), Rb ; \ + ADD Ra@>(32-5), Re, Re ; \ + ADD Rconst, Re, Re + +#define ROUND1(Ra, Rb, Rc, Rd, Re) \ + LOAD(Re) ; \ + FUNC1(Ra, Rb, Rc, Rd, Re) ; \ + MIX(Ra, Rb, Rc, Rd, Re) + +#define ROUND1x(Ra, Rb, Rc, Rd, Re) \ + SHUFFLE(Re) ; \ + FUNC1(Ra, Rb, Rc, Rd, Re) ; \ + MIX(Ra, Rb, Rc, Rd, Re) + +#define ROUND2(Ra, Rb, Rc, Rd, Re) \ + SHUFFLE(Re) ; \ + FUNC2(Ra, Rb, Rc, Rd, Re) ; \ + MIX(Ra, Rb, Rc, Rd, Re) + +#define ROUND3(Ra, Rb, Rc, Rd, Re) \ + SHUFFLE(Re) ; \ + FUNC3(Ra, Rb, Rc, Rd, Re) ; \ + MIX(Ra, Rb, Rc, Rd, Re) + +#define ROUND4(Ra, Rb, Rc, Rd, Re) \ + SHUFFLE(Re) ; \ + FUNC4(Ra, Rb, Rc, Rd, Re) ; \ + MIX(Ra, Rb, Rc, Rd, Re) + + +// func block(dig *digest, p []byte) +TEXT ·block(SB), 0, $352-16 + MOVW p+4(FP), Rdata // pointer to the data + MOVW p_len+8(FP), Rt0 // number of bytes + ADD Rdata, Rt0 + MOVW Rt0, p_end // pointer to end of data + + // Load up initial SHA1 accumulator + MOVW dig+0(FP), Rt0 + MOVM.IA (Rt0), [Ra,Rb,Rc,Rd,Re] + +loop: + // Save registers at SP+4 onwards + MOVM.IB [Ra,Rb,Rc,Rd,Re], (R13) + + MOVW $w_buf, Rw + MOVW $0x5A827999, Rconst + MOVW $3, Rctr +loop1: ROUND1(Ra, Rb, Rc, Rd, Re) + ROUND1(Re, Ra, Rb, Rc, Rd) + ROUND1(Rd, Re, Ra, Rb, Rc) + ROUND1(Rc, Rd, Re, Ra, Rb) + ROUND1(Rb, Rc, Rd, Re, Ra) + SUB.S $1, Rctr + BNE loop1 + + ROUND1(Ra, Rb, Rc, Rd, Re) + ROUND1x(Re, Ra, Rb, Rc, Rd) + ROUND1x(Rd, Re, Ra, Rb, Rc) + ROUND1x(Rc, Rd, Re, Ra, Rb) + ROUND1x(Rb, Rc, Rd, Re, Ra) + + MOVW $0x6ED9EBA1, Rconst + MOVW $4, Rctr +loop2: ROUND2(Ra, Rb, Rc, Rd, Re) + ROUND2(Re, Ra, Rb, Rc, Rd) + ROUND2(Rd, Re, Ra, Rb, Rc) + ROUND2(Rc, Rd, Re, Ra, Rb) + ROUND2(Rb, Rc, Rd, Re, Ra) + SUB.S $1, Rctr + BNE loop2 + + MOVW $0x8F1BBCDC, Rconst + MOVW $4, Rctr +loop3: ROUND3(Ra, Rb, Rc, Rd, Re) + ROUND3(Re, Ra, Rb, Rc, Rd) + ROUND3(Rd, Re, Ra, Rb, Rc) + ROUND3(Rc, Rd, Re, Ra, Rb) + ROUND3(Rb, Rc, Rd, Re, Ra) + SUB.S $1, Rctr + BNE loop3 + + MOVW $0xCA62C1D6, Rconst + MOVW $4, Rctr +loop4: ROUND4(Ra, Rb, Rc, Rd, Re) + ROUND4(Re, Ra, Rb, Rc, Rd) + ROUND4(Rd, Re, Ra, Rb, Rc) + ROUND4(Rc, Rd, Re, Ra, Rb) + ROUND4(Rb, Rc, Rd, Re, Ra) + SUB.S $1, Rctr + BNE loop4 + + // Accumulate - restoring registers from SP+4 + MOVM.IB (R13), [Rt0,Rt1,Rt2,Rctr,Rw] + ADD Rt0, Ra + ADD Rt1, Rb + ADD Rt2, Rc + ADD Rctr, Rd + ADD Rw, Re + + MOVW p_end, Rt0 + CMP Rt0, Rdata + BLO loop + + // Save final SHA1 accumulator + MOVW dig+0(FP), Rt0 + MOVM.IA [Ra,Rb,Rc,Rd,Re], (Rt0) + + RET diff --git a/src/crypto/sha1/sha1block_decl.go b/src/crypto/sha1/sha1block_decl.go new file mode 100644 index 0000000000000000000000000000000000000000..24e521af1fcbcf0278be93a0226cd10a90dbf16f --- /dev/null +++ b/src/crypto/sha1/sha1block_decl.go @@ -0,0 +1,11 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build amd64 amd64p32 arm 386 + +package sha1 + +//go:noescape + +func block(dig *digest, p []byte) diff --git a/src/crypto/sha1/sha1block_generic.go b/src/crypto/sha1/sha1block_generic.go new file mode 100644 index 0000000000000000000000000000000000000000..696e26b6257fdfa411f7bc7fc8dd50cc1f10f604 --- /dev/null +++ b/src/crypto/sha1/sha1block_generic.go @@ -0,0 +1,9 @@ +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build !amd64,!amd64p32,!386,!arm + +package sha1 + +var block = blockGeneric diff --git a/src/crypto/sha256/sha256.go b/src/crypto/sha256/sha256.go new file mode 100644 index 0000000000000000000000000000000000000000..d84cebf2ff2c1734ee143ee0ac3bd50ede3e2932 --- /dev/null +++ b/src/crypto/sha256/sha256.go @@ -0,0 +1,193 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package sha256 implements the SHA224 and SHA256 hash algorithms as defined +// in FIPS 180-4. +package sha256 + +import ( + "crypto" + "hash" +) + +func init() { + crypto.RegisterHash(crypto.SHA224, New224) + crypto.RegisterHash(crypto.SHA256, New) +} + +// The size of a SHA256 checksum in bytes. +const Size = 32 + +// The size of a SHA224 checksum in bytes. +const Size224 = 28 + +// The blocksize of SHA256 and SHA224 in bytes. +const BlockSize = 64 + +const ( + chunk = 64 + init0 = 0x6A09E667 + init1 = 0xBB67AE85 + init2 = 0x3C6EF372 + init3 = 0xA54FF53A + init4 = 0x510E527F + init5 = 0x9B05688C + init6 = 0x1F83D9AB + init7 = 0x5BE0CD19 + init0_224 = 0xC1059ED8 + init1_224 = 0x367CD507 + init2_224 = 0x3070DD17 + init3_224 = 0xF70E5939 + init4_224 = 0xFFC00B31 + init5_224 = 0x68581511 + init6_224 = 0x64F98FA7 + init7_224 = 0xBEFA4FA4 +) + +// digest represents the partial evaluation of a checksum. +type digest struct { + h [8]uint32 + x [chunk]byte + nx int + len uint64 + is224 bool // mark if this digest is SHA-224 +} + +func (d *digest) Reset() { + if !d.is224 { + d.h[0] = init0 + d.h[1] = init1 + d.h[2] = init2 + d.h[3] = init3 + d.h[4] = init4 + d.h[5] = init5 + d.h[6] = init6 + d.h[7] = init7 + } else { + d.h[0] = init0_224 + d.h[1] = init1_224 + d.h[2] = init2_224 + d.h[3] = init3_224 + d.h[4] = init4_224 + d.h[5] = init5_224 + d.h[6] = init6_224 + d.h[7] = init7_224 + } + d.nx = 0 + d.len = 0 +} + +// New returns a new hash.Hash computing the SHA256 checksum. +func New() hash.Hash { + d := new(digest) + d.Reset() + return d +} + +// New224 returns a new hash.Hash computing the SHA224 checksum. +func New224() hash.Hash { + d := new(digest) + d.is224 = true + d.Reset() + return d +} + +func (d *digest) Size() int { + if !d.is224 { + return Size + } + return Size224 +} + +func (d *digest) BlockSize() int { return BlockSize } + +func (d *digest) Write(p []byte) (nn int, err error) { + nn = len(p) + d.len += uint64(nn) + if d.nx > 0 { + n := copy(d.x[d.nx:], p) + d.nx += n + if d.nx == chunk { + block(d, d.x[:]) + d.nx = 0 + } + p = p[n:] + } + if len(p) >= chunk { + n := len(p) &^ (chunk - 1) + block(d, p[:n]) + p = p[n:] + } + if len(p) > 0 { + d.nx = copy(d.x[:], p) + } + return +} + +func (d0 *digest) Sum(in []byte) []byte { + // Make a copy of d0 so that caller can keep writing and summing. + d := *d0 + hash := d.checkSum() + if d.is224 { + return append(in, hash[:Size224]...) + } + return append(in, hash[:]...) +} + +func (d *digest) checkSum() [Size]byte { + len := d.len + // Padding. Add a 1 bit and 0 bits until 56 bytes mod 64. + var tmp [64]byte + tmp[0] = 0x80 + if len%64 < 56 { + d.Write(tmp[0 : 56-len%64]) + } else { + d.Write(tmp[0 : 64+56-len%64]) + } + + // Length in bits. + len <<= 3 + for i := uint(0); i < 8; i++ { + tmp[i] = byte(len >> (56 - 8*i)) + } + d.Write(tmp[0:8]) + + if d.nx != 0 { + panic("d.nx != 0") + } + + h := d.h[:] + if d.is224 { + h = d.h[:7] + } + + var digest [Size]byte + for i, s := range h { + digest[i*4] = byte(s >> 24) + digest[i*4+1] = byte(s >> 16) + digest[i*4+2] = byte(s >> 8) + digest[i*4+3] = byte(s) + } + + return digest +} + +// Sum256 returns the SHA256 checksum of the data. +func Sum256(data []byte) [Size]byte { + var d digest + d.Reset() + d.Write(data) + return d.checkSum() +} + +// Sum224 returns the SHA224 checksum of the data. +func Sum224(data []byte) (sum224 [Size224]byte) { + var d digest + d.is224 = true + d.Reset() + d.Write(data) + sum := d.checkSum() + copy(sum224[:], sum[:Size224]) + return +} diff --git a/src/crypto/sha256/sha256_test.go b/src/crypto/sha256/sha256_test.go new file mode 100644 index 0000000000000000000000000000000000000000..1d883d39059577224fd98faa37c1f80c0f353221 --- /dev/null +++ b/src/crypto/sha256/sha256_test.go @@ -0,0 +1,176 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// SHA256 hash algorithm. See FIPS 180-2. + +package sha256 + +import ( + "fmt" + "io" + "testing" +) + +type sha256Test struct { + out string + in string +} + +var golden = []sha256Test{ + {"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", ""}, + {"ca978112ca1bbdcafac231b39a23dc4da786eff8147c4e72b9807785afee48bb", "a"}, + {"fb8e20fc2e4c3f248c60c39bd652f3c1347298bb977b8b4d5903b85055620603", "ab"}, + {"ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad", "abc"}, + {"88d4266fd4e6338d13b845fcf289579d209c897823b9217da3e161936f031589", "abcd"}, + {"36bbe50ed96841d10443bcb670d6554f0a34b761be67ec9c4a8ad2c0c44ca42c", "abcde"}, + {"bef57ec7f53a6d40beb640a780a639c83bc29ac8a9816f1fc6c5c6dcd93c4721", "abcdef"}, + {"7d1a54127b222502f5b79b5fb0803061152a44f92b37e23c6527baf665d4da9a", "abcdefg"}, + {"9c56cc51b374c3ba189210d5b6d4bf57790d351c96c47c02190ecf1e430635ab", "abcdefgh"}, + {"19cc02f26df43cc571bc9ed7b0c4d29224a3ec229529221725ef76d021c8326f", "abcdefghi"}, + {"72399361da6a7754fec986dca5b7cbaf1c810a28ded4abaf56b2106d06cb78b0", "abcdefghij"}, + {"a144061c271f152da4d151034508fed1c138b8c976339de229c3bb6d4bbb4fce", "Discard medicine more than two years old."}, + {"6dae5caa713a10ad04b46028bf6dad68837c581616a1589a265a11288d4bb5c4", "He who has a shady past knows that nice guys finish last."}, + {"ae7a702a9509039ddbf29f0765e70d0001177914b86459284dab8b348c2dce3f", "I wouldn't marry him with a ten foot pole."}, + {"6748450b01c568586715291dfa3ee018da07d36bb7ea6f180c1af6270215c64f", "Free! Free!/A trip/to Mars/for 900/empty jars/Burma Shave"}, + {"14b82014ad2b11f661b5ae6a99b75105c2ffac278cd071cd6c05832793635774", "The days of the digital watch are numbered. -Tom Stoppard"}, + {"7102cfd76e2e324889eece5d6c41921b1e142a4ac5a2692be78803097f6a48d8", "Nepal premier won't resign."}, + {"23b1018cd81db1d67983c5f7417c44da9deb582459e378d7a068552ea649dc9f", "For every action there is an equal and opposite government program."}, + {"8001f190dfb527261c4cfcab70c98e8097a7a1922129bc4096950e57c7999a5a", "His money is twice tainted: 'taint yours and 'taint mine."}, + {"8c87deb65505c3993eb24b7a150c4155e82eee6960cf0c3a8114ff736d69cad5", "There is no reason for any individual to have a computer in their home. -Ken Olsen, 1977"}, + {"bfb0a67a19cdec3646498b2e0f751bddc41bba4b7f30081b0b932aad214d16d7", "It's a tiny change to the code and not completely disgusting. - Bob Manchek"}, + {"7f9a0b9bf56332e19f5a0ec1ad9c1425a153da1c624868fda44561d6b74daf36", "size: a.out: bad magic"}, + {"b13f81b8aad9e3666879af19886140904f7f429ef083286195982a7588858cfc", "The major problem is with sendmail. -Mark Horton"}, + {"b26c38d61519e894480c70c8374ea35aa0ad05b2ae3d6674eec5f52a69305ed4", "Give me a rock, paper and scissors and I will move the world. CCFestoon"}, + {"049d5e26d4f10222cd841a119e38bd8d2e0d1129728688449575d4ff42b842c1", "If the enemy is within range, then so are you."}, + {"0e116838e3cc1c1a14cd045397e29b4d087aa11b0853fc69ec82e90330d60949", "It's well we cannot hear the screams/That we create in others' dreams."}, + {"4f7d8eb5bcf11de2a56b971021a444aa4eafd6ecd0f307b5109e4e776cd0fe46", "You remind me of a TV show, but that's all right: I watch it anyway."}, + {"61c0cc4c4bd8406d5120b3fb4ebc31ce87667c162f29468b3c779675a85aebce", "C is as portable as Stonehedge!!"}, + {"1fb2eb3688093c4a3f80cd87a5547e2ce940a4f923243a79a2a1e242220693ac", "Even if I could be Shakespeare, I think I should still choose to be Faraday. - A. Huxley"}, + {"395585ce30617b62c80b93e8208ce866d4edc811a177fdb4b82d3911d8696423", "The fugacity of a constituent in a mixture of gases at a given temperature is proportional to its mole fraction. Lewis-Randall Rule"}, + {"4f9b189a13d030838269dce846b16a1ce9ce81fe63e65de2f636863336a98fe6", "How can you write a big system without C++? -Paul Glick"}, +} + +var golden224 = []sha256Test{ + {"d14a028c2a3a2bc9476102bb288234c415a2b01f828ea62ac5b3e42f", ""}, + {"abd37534c7d9a2efb9465de931cd7055ffdb8879563ae98078d6d6d5", "a"}, + {"db3cda86d4429a1d39c148989566b38f7bda0156296bd364ba2f878b", "ab"}, + {"23097d223405d8228642a477bda255b32aadbce4bda0b3f7e36c9da7", "abc"}, + {"a76654d8e3550e9a2d67a0eeb6c67b220e5885eddd3fde135806e601", "abcd"}, + {"bdd03d560993e675516ba5a50638b6531ac2ac3d5847c61916cfced6", "abcde"}, + {"7043631cb415556a275a4ebecb802c74ee9f6153908e1792a90b6a98", "abcdef"}, + {"d1884e711701ad81abe0c77a3b0ea12e19ba9af64077286c72fc602d", "abcdefg"}, + {"17eb7d40f0356f8598e89eafad5f6c759b1f822975d9c9b737c8a517", "abcdefgh"}, + {"aeb35915346c584db820d2de7af3929ffafef9222a9bcb26516c7334", "abcdefghi"}, + {"d35e1e5af29ddb0d7e154357df4ad9842afee527c689ee547f753188", "abcdefghij"}, + {"19297f1cef7ddc8a7e947f5c5a341e10f7245045e425db67043988d7", "Discard medicine more than two years old."}, + {"0f10c2eb436251f777fbbd125e260d36aecf180411726c7c885f599a", "He who has a shady past knows that nice guys finish last."}, + {"4d1842104919f314cad8a3cd20b3cba7e8ed3e7abed62b57441358f6", "I wouldn't marry him with a ten foot pole."}, + {"a8ba85c6fe0c48fbffc72bbb2f03fcdbc87ae2dc7a56804d1590fb3b", "Free! Free!/A trip/to Mars/for 900/empty jars/Burma Shave"}, + {"5543fbab26e67e8885b1a852d567d1cb8b9bfe42e0899584c50449a9", "The days of the digital watch are numbered. -Tom Stoppard"}, + {"65ca107390f5da9efa05d28e57b221657edc7e43a9a18fb15b053ddb", "Nepal premier won't resign."}, + {"84953962be366305a9cc9b5cd16ed019edc37ac96c0deb3e12cca116", "For every action there is an equal and opposite government program."}, + {"35a189ce987151dfd00b3577583cc6a74b9869eecf894459cb52038d", "His money is twice tainted: 'taint yours and 'taint mine."}, + {"2fc333713983edfd4ef2c0da6fb6d6415afb94987c91e4069eb063e6", "There is no reason for any individual to have a computer in their home. -Ken Olsen, 1977"}, + {"cbe32d38d577a1b355960a4bc3c659c2dc4670859a19777a875842c4", "It's a tiny change to the code and not completely disgusting. - Bob Manchek"}, + {"a2dc118ce959e027576413a7b440c875cdc8d40df9141d6ef78a57e1", "size: a.out: bad magic"}, + {"d10787e24052bcff26dc484787a54ed819e4e4511c54890ee977bf81", "The major problem is with sendmail. -Mark Horton"}, + {"62efcf16ab8a893acdf2f348aaf06b63039ff1bf55508c830532c9fb", "Give me a rock, paper and scissors and I will move the world. CCFestoon"}, + {"3e9b7e4613c59f58665104c5fa86c272db5d3a2ff30df5bb194a5c99", "If the enemy is within range, then so are you."}, + {"5999c208b8bdf6d471bb7c359ac5b829e73a8211dff686143a4e7f18", "It's well we cannot hear the screams/That we create in others' dreams."}, + {"3b2d67ff54eabc4ef737b14edf87c64280ef582bcdf2a6d56908b405", "You remind me of a TV show, but that's all right: I watch it anyway."}, + {"d0733595d20e4d3d6b5c565a445814d1bbb2fd08b9a3b8ffb97930c6", "C is as portable as Stonehedge!!"}, + {"43fb8aeed8a833175c9295c1165415f98c866ef08a4922959d673507", "Even if I could be Shakespeare, I think I should still choose to be Faraday. - A. Huxley"}, + {"ec18e66e93afc4fb1604bc2baedbfd20b44c43d76e65c0996d7851c6", "The fugacity of a constituent in a mixture of gases at a given temperature is proportional to its mole fraction. Lewis-Randall Rule"}, + {"86ed2eaa9c75ba98396e5c9fb2f679ecf0ea2ed1e0ee9ceecb4a9332", "How can you write a big system without C++? -Paul Glick"}, +} + +func TestGolden(t *testing.T) { + for i := 0; i < len(golden); i++ { + g := golden[i] + s := fmt.Sprintf("%x", Sum256([]byte(g.in))) + if s != g.out { + t.Fatalf("Sum256 function: sha256(%s) = %s want %s", g.in, s, g.out) + } + c := New() + for j := 0; j < 3; j++ { + if j < 2 { + io.WriteString(c, g.in) + } else { + io.WriteString(c, g.in[0:len(g.in)/2]) + c.Sum(nil) + io.WriteString(c, g.in[len(g.in)/2:]) + } + s := fmt.Sprintf("%x", c.Sum(nil)) + if s != g.out { + t.Fatalf("sha256[%d](%s) = %s want %s", j, g.in, s, g.out) + } + c.Reset() + } + } + for i := 0; i < len(golden224); i++ { + g := golden224[i] + s := fmt.Sprintf("%x", Sum224([]byte(g.in))) + if s != g.out { + t.Fatalf("Sum224 function: sha224(%s) = %s want %s", g.in, s, g.out) + } + c := New224() + for j := 0; j < 3; j++ { + if j < 2 { + io.WriteString(c, g.in) + } else { + io.WriteString(c, g.in[0:len(g.in)/2]) + c.Sum(nil) + io.WriteString(c, g.in[len(g.in)/2:]) + } + s := fmt.Sprintf("%x", c.Sum(nil)) + if s != g.out { + t.Fatalf("sha224[%d](%s) = %s want %s", j, g.in, s, g.out) + } + c.Reset() + } + } +} + +func TestSize(t *testing.T) { + c := New() + if got := c.Size(); got != Size { + t.Errorf("Size = %d; want %d", got, Size) + } + c = New224() + if got := c.Size(); got != Size224 { + t.Errorf("New224.Size = %d; want %d", got, Size224) + } +} + +func TestBlockSize(t *testing.T) { + c := New() + if got := c.BlockSize(); got != BlockSize { + t.Errorf("BlockSize = %d want %d", got, BlockSize) + } +} + +var bench = New() +var buf = make([]byte, 8192) + +func benchmarkSize(b *testing.B, size int) { + b.SetBytes(int64(size)) + sum := make([]byte, bench.Size()) + for i := 0; i < b.N; i++ { + bench.Reset() + bench.Write(buf[:size]) + bench.Sum(sum[:0]) + } +} + +func BenchmarkHash8Bytes(b *testing.B) { + benchmarkSize(b, 8) +} + +func BenchmarkHash1K(b *testing.B) { + benchmarkSize(b, 1024) +} + +func BenchmarkHash8K(b *testing.B) { + benchmarkSize(b, 8192) +} diff --git a/src/crypto/sha256/sha256block.go b/src/crypto/sha256/sha256block.go new file mode 100644 index 0000000000000000000000000000000000000000..ca5efd156a9d99d2433b77246acf807647666fc2 --- /dev/null +++ b/src/crypto/sha256/sha256block.go @@ -0,0 +1,128 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build !386,!amd64 + +// SHA256 block step. +// In its own file so that a faster assembly or C version +// can be substituted easily. + +package sha256 + +var _K = []uint32{ + 0x428a2f98, + 0x71374491, + 0xb5c0fbcf, + 0xe9b5dba5, + 0x3956c25b, + 0x59f111f1, + 0x923f82a4, + 0xab1c5ed5, + 0xd807aa98, + 0x12835b01, + 0x243185be, + 0x550c7dc3, + 0x72be5d74, + 0x80deb1fe, + 0x9bdc06a7, + 0xc19bf174, + 0xe49b69c1, + 0xefbe4786, + 0x0fc19dc6, + 0x240ca1cc, + 0x2de92c6f, + 0x4a7484aa, + 0x5cb0a9dc, + 0x76f988da, + 0x983e5152, + 0xa831c66d, + 0xb00327c8, + 0xbf597fc7, + 0xc6e00bf3, + 0xd5a79147, + 0x06ca6351, + 0x14292967, + 0x27b70a85, + 0x2e1b2138, + 0x4d2c6dfc, + 0x53380d13, + 0x650a7354, + 0x766a0abb, + 0x81c2c92e, + 0x92722c85, + 0xa2bfe8a1, + 0xa81a664b, + 0xc24b8b70, + 0xc76c51a3, + 0xd192e819, + 0xd6990624, + 0xf40e3585, + 0x106aa070, + 0x19a4c116, + 0x1e376c08, + 0x2748774c, + 0x34b0bcb5, + 0x391c0cb3, + 0x4ed8aa4a, + 0x5b9cca4f, + 0x682e6ff3, + 0x748f82ee, + 0x78a5636f, + 0x84c87814, + 0x8cc70208, + 0x90befffa, + 0xa4506ceb, + 0xbef9a3f7, + 0xc67178f2, +} + +func block(dig *digest, p []byte) { + var w [64]uint32 + h0, h1, h2, h3, h4, h5, h6, h7 := dig.h[0], dig.h[1], dig.h[2], dig.h[3], dig.h[4], dig.h[5], dig.h[6], dig.h[7] + for len(p) >= chunk { + // Can interlace the computation of w with the + // rounds below if needed for speed. + for i := 0; i < 16; i++ { + j := i * 4 + w[i] = uint32(p[j])<<24 | uint32(p[j+1])<<16 | uint32(p[j+2])<<8 | uint32(p[j+3]) + } + for i := 16; i < 64; i++ { + v1 := w[i-2] + t1 := (v1>>17 | v1<<(32-17)) ^ (v1>>19 | v1<<(32-19)) ^ (v1 >> 10) + v2 := w[i-15] + t2 := (v2>>7 | v2<<(32-7)) ^ (v2>>18 | v2<<(32-18)) ^ (v2 >> 3) + w[i] = t1 + w[i-7] + t2 + w[i-16] + } + + a, b, c, d, e, f, g, h := h0, h1, h2, h3, h4, h5, h6, h7 + + for i := 0; i < 64; i++ { + t1 := h + ((e>>6 | e<<(32-6)) ^ (e>>11 | e<<(32-11)) ^ (e>>25 | e<<(32-25))) + ((e & f) ^ (^e & g)) + _K[i] + w[i] + + t2 := ((a>>2 | a<<(32-2)) ^ (a>>13 | a<<(32-13)) ^ (a>>22 | a<<(32-22))) + ((a & b) ^ (a & c) ^ (b & c)) + + h = g + g = f + f = e + e = d + t1 + d = c + c = b + b = a + a = t1 + t2 + } + + h0 += a + h1 += b + h2 += c + h3 += d + h4 += e + h5 += f + h6 += g + h7 += h + + p = p[chunk:] + } + + dig.h[0], dig.h[1], dig.h[2], dig.h[3], dig.h[4], dig.h[5], dig.h[6], dig.h[7] = h0, h1, h2, h3, h4, h5, h6, h7 +} diff --git a/src/crypto/sha256/sha256block_386.s b/src/crypto/sha256/sha256block_386.s new file mode 100644 index 0000000000000000000000000000000000000000..73ae2bf300eb1f7f60e3051d68af401905d4b949 --- /dev/null +++ b/src/crypto/sha256/sha256block_386.s @@ -0,0 +1,283 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// SHA256 block routine. See sha256block.go for Go equivalent. +// +// The algorithm is detailed in FIPS 180-4: +// +// http://csrc.nist.gov/publications/fips/fips180-4/fips-180-4.pdf +// +// Wt = Mt; for 0 <= t <= 15 +// Wt = SIGMA1(Wt-2) + SIGMA0(Wt-15) + Wt-16; for 16 <= t <= 63 +// +// a = H0 +// b = H1 +// c = H2 +// d = H3 +// e = H4 +// f = H5 +// g = H6 +// h = H7 +// +// for t = 0 to 63 { +// T1 = h + BIGSIGMA1(e) + Ch(e,f,g) + Kt + Wt +// T2 = BIGSIGMA0(a) + Maj(a,b,c) +// h = g +// g = f +// f = e +// e = d + T1 +// d = c +// c = b +// b = a +// a = T1 + T2 +// } +// +// H0 = a + H0 +// H1 = b + H1 +// H2 = c + H2 +// H3 = d + H3 +// H4 = e + H4 +// H5 = f + H5 +// H6 = g + H6 +// H7 = h + H7 + +// Wt = Mt; for 0 <= t <= 15 +#define MSGSCHEDULE0(index) \ + MOVL (index*4)(SI), AX; \ + BSWAPL AX; \ + MOVL AX, (index*4)(BP) + +// Wt = SIGMA1(Wt-2) + Wt-7 + SIGMA0(Wt-15) + Wt-16; for 16 <= t <= 63 +// SIGMA0(x) = ROTR(7,x) XOR ROTR(18,x) XOR SHR(3,x) +// SIGMA1(x) = ROTR(17,x) XOR ROTR(19,x) XOR SHR(10,x) +#define MSGSCHEDULE1(index) \ + MOVL ((index-2)*4)(BP), AX; \ + MOVL AX, CX; \ + RORL $17, AX; \ + MOVL CX, DX; \ + RORL $19, CX; \ + SHRL $10, DX; \ + MOVL ((index-15)*4)(BP), BX; \ + XORL CX, AX; \ + MOVL BX, CX; \ + XORL DX, AX; \ + RORL $7, BX; \ + MOVL CX, DX; \ + SHRL $3, DX; \ + RORL $18, CX; \ + ADDL ((index-7)*4)(BP), AX; \ + XORL CX, BX; \ + XORL DX, BX; \ + ADDL ((index-16)*4)(BP), BX; \ + ADDL BX, AX; \ + MOVL AX, ((index)*4)(BP) + +// Calculate T1 in AX - uses AX, BX, CX and DX registers. +// Wt is passed in AX. +// T1 = h + BIGSIGMA1(e) + Ch(e, f, g) + Kt + Wt +// BIGSIGMA1(x) = ROTR(6,x) XOR ROTR(11,x) XOR ROTR(25,x) +// Ch(x, y, z) = (x AND y) XOR (NOT x AND z) +#define SHA256T1(const, e, f, g, h) \ + MOVL (h*4)(DI), BX; \ + ADDL AX, BX; \ + MOVL (e*4)(DI), AX; \ + ADDL $const, BX; \ + MOVL (e*4)(DI), CX; \ + RORL $6, AX; \ + MOVL (e*4)(DI), DX; \ + RORL $11, CX; \ + XORL CX, AX; \ + MOVL (e*4)(DI), CX; \ + RORL $25, DX; \ + ANDL (f*4)(DI), CX; \ + XORL AX, DX; \ + MOVL (e*4)(DI), AX; \ + NOTL AX; \ + ADDL DX, BX; \ + ANDL (g*4)(DI), AX; \ + XORL CX, AX; \ + ADDL BX, AX + +// Calculate T2 in BX - uses AX, BX, CX and DX registers. +// T2 = BIGSIGMA0(a) + Maj(a, b, c) +// BIGSIGMA0(x) = ROTR(2,x) XOR ROTR(13,x) XOR ROTR(22,x) +// Maj(x, y, z) = (x AND y) XOR (x AND z) XOR (y AND z) +#define SHA256T2(a, b, c) \ + MOVL (a*4)(DI), AX; \ + MOVL (c*4)(DI), BX; \ + RORL $2, AX; \ + MOVL (a*4)(DI), DX; \ + ANDL (b*4)(DI), BX; \ + RORL $13, DX; \ + MOVL (a*4)(DI), CX; \ + ANDL (c*4)(DI), CX; \ + XORL DX, AX; \ + XORL CX, BX; \ + MOVL (a*4)(DI), DX; \ + MOVL (b*4)(DI), CX; \ + RORL $22, DX; \ + ANDL (a*4)(DI), CX; \ + XORL CX, BX; \ + XORL DX, AX; \ + ADDL AX, BX + +// Calculate T1 and T2, then e = d + T1 and a = T1 + T2. +// The values for e and a are stored in d and h, ready for rotation. +#define SHA256ROUND(index, const, a, b, c, d, e, f, g, h) \ + SHA256T1(const, e, f, g, h); \ + MOVL AX, 292(SP); \ + SHA256T2(a, b, c); \ + MOVL 292(SP), AX; \ + ADDL AX, BX; \ + ADDL AX, (d*4)(DI); \ + MOVL BX, (h*4)(DI) + +#define SHA256ROUND0(index, const, a, b, c, d, e, f, g, h) \ + MSGSCHEDULE0(index); \ + SHA256ROUND(index, const, a, b, c, d, e, f, g, h) + +#define SHA256ROUND1(index, const, a, b, c, d, e, f, g, h) \ + MSGSCHEDULE1(index); \ + SHA256ROUND(index, const, a, b, c, d, e, f, g, h) + +TEXT ·block(SB),0,$296-12 + MOVL p_base+4(FP), SI + MOVL p_len+8(FP), DX + SHRL $6, DX + SHLL $6, DX + + LEAL (SI)(DX*1), DI + MOVL DI, 288(SP) + CMPL SI, DI + JEQ end + + LEAL 256(SP), DI // variables + + MOVL dig+0(FP), BP + MOVL (0*4)(BP), AX // a = H0 + MOVL AX, (0*4)(DI) + MOVL (1*4)(BP), BX // b = H1 + MOVL BX, (1*4)(DI) + MOVL (2*4)(BP), CX // c = H2 + MOVL CX, (2*4)(DI) + MOVL (3*4)(BP), DX // d = H3 + MOVL DX, (3*4)(DI) + MOVL (4*4)(BP), AX // e = H4 + MOVL AX, (4*4)(DI) + MOVL (5*4)(BP), BX // f = H5 + MOVL BX, (5*4)(DI) + MOVL (6*4)(BP), CX // g = H6 + MOVL CX, (6*4)(DI) + MOVL (7*4)(BP), DX // h = H7 + MOVL DX, (7*4)(DI) + +loop: + MOVL SP, BP // message schedule + + SHA256ROUND0(0, 0x428a2f98, 0, 1, 2, 3, 4, 5, 6, 7) + SHA256ROUND0(1, 0x71374491, 7, 0, 1, 2, 3, 4, 5, 6) + SHA256ROUND0(2, 0xb5c0fbcf, 6, 7, 0, 1, 2, 3, 4, 5) + SHA256ROUND0(3, 0xe9b5dba5, 5, 6, 7, 0, 1, 2, 3, 4) + SHA256ROUND0(4, 0x3956c25b, 4, 5, 6, 7, 0, 1, 2, 3) + SHA256ROUND0(5, 0x59f111f1, 3, 4, 5, 6, 7, 0, 1, 2) + SHA256ROUND0(6, 0x923f82a4, 2, 3, 4, 5, 6, 7, 0, 1) + SHA256ROUND0(7, 0xab1c5ed5, 1, 2, 3, 4, 5, 6, 7, 0) + SHA256ROUND0(8, 0xd807aa98, 0, 1, 2, 3, 4, 5, 6, 7) + SHA256ROUND0(9, 0x12835b01, 7, 0, 1, 2, 3, 4, 5, 6) + SHA256ROUND0(10, 0x243185be, 6, 7, 0, 1, 2, 3, 4, 5) + SHA256ROUND0(11, 0x550c7dc3, 5, 6, 7, 0, 1, 2, 3, 4) + SHA256ROUND0(12, 0x72be5d74, 4, 5, 6, 7, 0, 1, 2, 3) + SHA256ROUND0(13, 0x80deb1fe, 3, 4, 5, 6, 7, 0, 1, 2) + SHA256ROUND0(14, 0x9bdc06a7, 2, 3, 4, 5, 6, 7, 0, 1) + SHA256ROUND0(15, 0xc19bf174, 1, 2, 3, 4, 5, 6, 7, 0) + + SHA256ROUND1(16, 0xe49b69c1, 0, 1, 2, 3, 4, 5, 6, 7) + SHA256ROUND1(17, 0xefbe4786, 7, 0, 1, 2, 3, 4, 5, 6) + SHA256ROUND1(18, 0x0fc19dc6, 6, 7, 0, 1, 2, 3, 4, 5) + SHA256ROUND1(19, 0x240ca1cc, 5, 6, 7, 0, 1, 2, 3, 4) + SHA256ROUND1(20, 0x2de92c6f, 4, 5, 6, 7, 0, 1, 2, 3) + SHA256ROUND1(21, 0x4a7484aa, 3, 4, 5, 6, 7, 0, 1, 2) + SHA256ROUND1(22, 0x5cb0a9dc, 2, 3, 4, 5, 6, 7, 0, 1) + SHA256ROUND1(23, 0x76f988da, 1, 2, 3, 4, 5, 6, 7, 0) + SHA256ROUND1(24, 0x983e5152, 0, 1, 2, 3, 4, 5, 6, 7) + SHA256ROUND1(25, 0xa831c66d, 7, 0, 1, 2, 3, 4, 5, 6) + SHA256ROUND1(26, 0xb00327c8, 6, 7, 0, 1, 2, 3, 4, 5) + SHA256ROUND1(27, 0xbf597fc7, 5, 6, 7, 0, 1, 2, 3, 4) + SHA256ROUND1(28, 0xc6e00bf3, 4, 5, 6, 7, 0, 1, 2, 3) + SHA256ROUND1(29, 0xd5a79147, 3, 4, 5, 6, 7, 0, 1, 2) + SHA256ROUND1(30, 0x06ca6351, 2, 3, 4, 5, 6, 7, 0, 1) + SHA256ROUND1(31, 0x14292967, 1, 2, 3, 4, 5, 6, 7, 0) + SHA256ROUND1(32, 0x27b70a85, 0, 1, 2, 3, 4, 5, 6, 7) + SHA256ROUND1(33, 0x2e1b2138, 7, 0, 1, 2, 3, 4, 5, 6) + SHA256ROUND1(34, 0x4d2c6dfc, 6, 7, 0, 1, 2, 3, 4, 5) + SHA256ROUND1(35, 0x53380d13, 5, 6, 7, 0, 1, 2, 3, 4) + SHA256ROUND1(36, 0x650a7354, 4, 5, 6, 7, 0, 1, 2, 3) + SHA256ROUND1(37, 0x766a0abb, 3, 4, 5, 6, 7, 0, 1, 2) + SHA256ROUND1(38, 0x81c2c92e, 2, 3, 4, 5, 6, 7, 0, 1) + SHA256ROUND1(39, 0x92722c85, 1, 2, 3, 4, 5, 6, 7, 0) + SHA256ROUND1(40, 0xa2bfe8a1, 0, 1, 2, 3, 4, 5, 6, 7) + SHA256ROUND1(41, 0xa81a664b, 7, 0, 1, 2, 3, 4, 5, 6) + SHA256ROUND1(42, 0xc24b8b70, 6, 7, 0, 1, 2, 3, 4, 5) + SHA256ROUND1(43, 0xc76c51a3, 5, 6, 7, 0, 1, 2, 3, 4) + SHA256ROUND1(44, 0xd192e819, 4, 5, 6, 7, 0, 1, 2, 3) + SHA256ROUND1(45, 0xd6990624, 3, 4, 5, 6, 7, 0, 1, 2) + SHA256ROUND1(46, 0xf40e3585, 2, 3, 4, 5, 6, 7, 0, 1) + SHA256ROUND1(47, 0x106aa070, 1, 2, 3, 4, 5, 6, 7, 0) + SHA256ROUND1(48, 0x19a4c116, 0, 1, 2, 3, 4, 5, 6, 7) + SHA256ROUND1(49, 0x1e376c08, 7, 0, 1, 2, 3, 4, 5, 6) + SHA256ROUND1(50, 0x2748774c, 6, 7, 0, 1, 2, 3, 4, 5) + SHA256ROUND1(51, 0x34b0bcb5, 5, 6, 7, 0, 1, 2, 3, 4) + SHA256ROUND1(52, 0x391c0cb3, 4, 5, 6, 7, 0, 1, 2, 3) + SHA256ROUND1(53, 0x4ed8aa4a, 3, 4, 5, 6, 7, 0, 1, 2) + SHA256ROUND1(54, 0x5b9cca4f, 2, 3, 4, 5, 6, 7, 0, 1) + SHA256ROUND1(55, 0x682e6ff3, 1, 2, 3, 4, 5, 6, 7, 0) + SHA256ROUND1(56, 0x748f82ee, 0, 1, 2, 3, 4, 5, 6, 7) + SHA256ROUND1(57, 0x78a5636f, 7, 0, 1, 2, 3, 4, 5, 6) + SHA256ROUND1(58, 0x84c87814, 6, 7, 0, 1, 2, 3, 4, 5) + SHA256ROUND1(59, 0x8cc70208, 5, 6, 7, 0, 1, 2, 3, 4) + SHA256ROUND1(60, 0x90befffa, 4, 5, 6, 7, 0, 1, 2, 3) + SHA256ROUND1(61, 0xa4506ceb, 3, 4, 5, 6, 7, 0, 1, 2) + SHA256ROUND1(62, 0xbef9a3f7, 2, 3, 4, 5, 6, 7, 0, 1) + SHA256ROUND1(63, 0xc67178f2, 1, 2, 3, 4, 5, 6, 7, 0) + + MOVL dig+0(FP), BP + MOVL (0*4)(BP), AX // H0 = a + H0 + ADDL (0*4)(DI), AX + MOVL AX, (0*4)(DI) + MOVL AX, (0*4)(BP) + MOVL (1*4)(BP), BX // H1 = b + H1 + ADDL (1*4)(DI), BX + MOVL BX, (1*4)(DI) + MOVL BX, (1*4)(BP) + MOVL (2*4)(BP), CX // H2 = c + H2 + ADDL (2*4)(DI), CX + MOVL CX, (2*4)(DI) + MOVL CX, (2*4)(BP) + MOVL (3*4)(BP), DX // H3 = d + H3 + ADDL (3*4)(DI), DX + MOVL DX, (3*4)(DI) + MOVL DX, (3*4)(BP) + MOVL (4*4)(BP), AX // H4 = e + H4 + ADDL (4*4)(DI), AX + MOVL AX, (4*4)(DI) + MOVL AX, (4*4)(BP) + MOVL (5*4)(BP), BX // H5 = f + H5 + ADDL (5*4)(DI), BX + MOVL BX, (5*4)(DI) + MOVL BX, (5*4)(BP) + MOVL (6*4)(BP), CX // H6 = g + H6 + ADDL (6*4)(DI), CX + MOVL CX, (6*4)(DI) + MOVL CX, (6*4)(BP) + MOVL (7*4)(BP), DX // H7 = h + H7 + ADDL (7*4)(DI), DX + MOVL DX, (7*4)(DI) + MOVL DX, (7*4)(BP) + + ADDL $64, SI + CMPL SI, 288(SP) + JB loop + +end: + RET diff --git a/src/crypto/sha256/sha256block_amd64.s b/src/crypto/sha256/sha256block_amd64.s new file mode 100644 index 0000000000000000000000000000000000000000..868eaed48965be4886ff6b8e3339881d3363422f --- /dev/null +++ b/src/crypto/sha256/sha256block_amd64.s @@ -0,0 +1,256 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +#include "textflag.h" + +// SHA256 block routine. See sha256block.go for Go equivalent. +// +// The algorithm is detailed in FIPS 180-4: +// +// http://csrc.nist.gov/publications/fips/fips180-4/fips-180-4.pdf +// +// Wt = Mt; for 0 <= t <= 15 +// Wt = SIGMA1(Wt-2) + SIGMA0(Wt-15) + Wt-16; for 16 <= t <= 63 +// +// a = H0 +// b = H1 +// c = H2 +// d = H3 +// e = H4 +// f = H5 +// g = H6 +// h = H7 +// +// for t = 0 to 63 { +// T1 = h + BIGSIGMA1(e) + Ch(e,f,g) + Kt + Wt +// T2 = BIGSIGMA0(a) + Maj(a,b,c) +// h = g +// g = f +// f = e +// e = d + T1 +// d = c +// c = b +// b = a +// a = T1 + T2 +// } +// +// H0 = a + H0 +// H1 = b + H1 +// H2 = c + H2 +// H3 = d + H3 +// H4 = e + H4 +// H5 = f + H5 +// H6 = g + H6 +// H7 = h + H7 + +// Wt = Mt; for 0 <= t <= 15 +#define MSGSCHEDULE0(index) \ + MOVL (index*4)(SI), AX; \ + BSWAPL AX; \ + MOVL AX, (index*4)(BP) + +// Wt = SIGMA1(Wt-2) + Wt-7 + SIGMA0(Wt-15) + Wt-16; for 16 <= t <= 63 +// SIGMA0(x) = ROTR(7,x) XOR ROTR(18,x) XOR SHR(3,x) +// SIGMA1(x) = ROTR(17,x) XOR ROTR(19,x) XOR SHR(10,x) +#define MSGSCHEDULE1(index) \ + MOVL ((index-2)*4)(BP), AX; \ + MOVL AX, CX; \ + RORL $17, AX; \ + MOVL CX, DX; \ + RORL $19, CX; \ + SHRL $10, DX; \ + MOVL ((index-15)*4)(BP), BX; \ + XORL CX, AX; \ + MOVL BX, CX; \ + XORL DX, AX; \ + RORL $7, BX; \ + MOVL CX, DX; \ + SHRL $3, DX; \ + RORL $18, CX; \ + ADDL ((index-7)*4)(BP), AX; \ + XORL CX, BX; \ + XORL DX, BX; \ + ADDL ((index-16)*4)(BP), BX; \ + ADDL BX, AX; \ + MOVL AX, ((index)*4)(BP) + +// Calculate T1 in AX - uses AX, CX and DX registers. +// h is also used as an accumulator. Wt is passed in AX. +// T1 = h + BIGSIGMA1(e) + Ch(e, f, g) + Kt + Wt +// BIGSIGMA1(x) = ROTR(6,x) XOR ROTR(11,x) XOR ROTR(25,x) +// Ch(x, y, z) = (x AND y) XOR (NOT x AND z) +#define SHA256T1(const, e, f, g, h) \ + ADDL AX, h; \ + MOVL e, AX; \ + ADDL $const, h; \ + MOVL e, CX; \ + RORL $6, AX; \ + MOVL e, DX; \ + RORL $11, CX; \ + XORL CX, AX; \ + MOVL e, CX; \ + RORL $25, DX; \ + ANDL f, CX; \ + XORL AX, DX; \ + MOVL e, AX; \ + NOTL AX; \ + ADDL DX, h; \ + ANDL g, AX; \ + XORL CX, AX; \ + ADDL h, AX + +// Calculate T2 in BX - uses BX, CX, DX and DI registers. +// T2 = BIGSIGMA0(a) + Maj(a, b, c) +// BIGSIGMA0(x) = ROTR(2,x) XOR ROTR(13,x) XOR ROTR(22,x) +// Maj(x, y, z) = (x AND y) XOR (x AND z) XOR (y AND z) +#define SHA256T2(a, b, c) \ + MOVL a, DI; \ + MOVL c, BX; \ + RORL $2, DI; \ + MOVL a, DX; \ + ANDL b, BX; \ + RORL $13, DX; \ + MOVL a, CX; \ + ANDL c, CX; \ + XORL DX, DI; \ + XORL CX, BX; \ + MOVL a, DX; \ + MOVL b, CX; \ + RORL $22, DX; \ + ANDL a, CX; \ + XORL CX, BX; \ + XORL DX, DI; \ + ADDL DI, BX + +// Calculate T1 and T2, then e = d + T1 and a = T1 + T2. +// The values for e and a are stored in d and h, ready for rotation. +#define SHA256ROUND(index, const, a, b, c, d, e, f, g, h) \ + SHA256T1(const, e, f, g, h); \ + SHA256T2(a, b, c); \ + MOVL BX, h; \ + ADDL AX, d; \ + ADDL AX, h + +#define SHA256ROUND0(index, const, a, b, c, d, e, f, g, h) \ + MSGSCHEDULE0(index); \ + SHA256ROUND(index, const, a, b, c, d, e, f, g, h) + +#define SHA256ROUND1(index, const, a, b, c, d, e, f, g, h) \ + MSGSCHEDULE1(index); \ + SHA256ROUND(index, const, a, b, c, d, e, f, g, h) + +TEXT ·block(SB),0,$264-32 + MOVQ p_base+8(FP), SI + MOVQ p_len+16(FP), DX + SHRQ $6, DX + SHLQ $6, DX + + LEAQ (SI)(DX*1), DI + MOVQ DI, 256(SP) + CMPQ SI, DI + JEQ end + + MOVQ dig+0(FP), BP + MOVL (0*4)(BP), R8 // a = H0 + MOVL (1*4)(BP), R9 // b = H1 + MOVL (2*4)(BP), R10 // c = H2 + MOVL (3*4)(BP), R11 // d = H3 + MOVL (4*4)(BP), R12 // e = H4 + MOVL (5*4)(BP), R13 // f = H5 + MOVL (6*4)(BP), R14 // g = H6 + MOVL (7*4)(BP), R15 // h = H7 + +loop: + MOVQ SP, BP // message schedule + + SHA256ROUND0(0, 0x428a2f98, R8, R9, R10, R11, R12, R13, R14, R15) + SHA256ROUND0(1, 0x71374491, R15, R8, R9, R10, R11, R12, R13, R14) + SHA256ROUND0(2, 0xb5c0fbcf, R14, R15, R8, R9, R10, R11, R12, R13) + SHA256ROUND0(3, 0xe9b5dba5, R13, R14, R15, R8, R9, R10, R11, R12) + SHA256ROUND0(4, 0x3956c25b, R12, R13, R14, R15, R8, R9, R10, R11) + SHA256ROUND0(5, 0x59f111f1, R11, R12, R13, R14, R15, R8, R9, R10) + SHA256ROUND0(6, 0x923f82a4, R10, R11, R12, R13, R14, R15, R8, R9) + SHA256ROUND0(7, 0xab1c5ed5, R9, R10, R11, R12, R13, R14, R15, R8) + SHA256ROUND0(8, 0xd807aa98, R8, R9, R10, R11, R12, R13, R14, R15) + SHA256ROUND0(9, 0x12835b01, R15, R8, R9, R10, R11, R12, R13, R14) + SHA256ROUND0(10, 0x243185be, R14, R15, R8, R9, R10, R11, R12, R13) + SHA256ROUND0(11, 0x550c7dc3, R13, R14, R15, R8, R9, R10, R11, R12) + SHA256ROUND0(12, 0x72be5d74, R12, R13, R14, R15, R8, R9, R10, R11) + SHA256ROUND0(13, 0x80deb1fe, R11, R12, R13, R14, R15, R8, R9, R10) + SHA256ROUND0(14, 0x9bdc06a7, R10, R11, R12, R13, R14, R15, R8, R9) + SHA256ROUND0(15, 0xc19bf174, R9, R10, R11, R12, R13, R14, R15, R8) + + SHA256ROUND1(16, 0xe49b69c1, R8, R9, R10, R11, R12, R13, R14, R15) + SHA256ROUND1(17, 0xefbe4786, R15, R8, R9, R10, R11, R12, R13, R14) + SHA256ROUND1(18, 0x0fc19dc6, R14, R15, R8, R9, R10, R11, R12, R13) + SHA256ROUND1(19, 0x240ca1cc, R13, R14, R15, R8, R9, R10, R11, R12) + SHA256ROUND1(20, 0x2de92c6f, R12, R13, R14, R15, R8, R9, R10, R11) + SHA256ROUND1(21, 0x4a7484aa, R11, R12, R13, R14, R15, R8, R9, R10) + SHA256ROUND1(22, 0x5cb0a9dc, R10, R11, R12, R13, R14, R15, R8, R9) + SHA256ROUND1(23, 0x76f988da, R9, R10, R11, R12, R13, R14, R15, R8) + SHA256ROUND1(24, 0x983e5152, R8, R9, R10, R11, R12, R13, R14, R15) + SHA256ROUND1(25, 0xa831c66d, R15, R8, R9, R10, R11, R12, R13, R14) + SHA256ROUND1(26, 0xb00327c8, R14, R15, R8, R9, R10, R11, R12, R13) + SHA256ROUND1(27, 0xbf597fc7, R13, R14, R15, R8, R9, R10, R11, R12) + SHA256ROUND1(28, 0xc6e00bf3, R12, R13, R14, R15, R8, R9, R10, R11) + SHA256ROUND1(29, 0xd5a79147, R11, R12, R13, R14, R15, R8, R9, R10) + SHA256ROUND1(30, 0x06ca6351, R10, R11, R12, R13, R14, R15, R8, R9) + SHA256ROUND1(31, 0x14292967, R9, R10, R11, R12, R13, R14, R15, R8) + SHA256ROUND1(32, 0x27b70a85, R8, R9, R10, R11, R12, R13, R14, R15) + SHA256ROUND1(33, 0x2e1b2138, R15, R8, R9, R10, R11, R12, R13, R14) + SHA256ROUND1(34, 0x4d2c6dfc, R14, R15, R8, R9, R10, R11, R12, R13) + SHA256ROUND1(35, 0x53380d13, R13, R14, R15, R8, R9, R10, R11, R12) + SHA256ROUND1(36, 0x650a7354, R12, R13, R14, R15, R8, R9, R10, R11) + SHA256ROUND1(37, 0x766a0abb, R11, R12, R13, R14, R15, R8, R9, R10) + SHA256ROUND1(38, 0x81c2c92e, R10, R11, R12, R13, R14, R15, R8, R9) + SHA256ROUND1(39, 0x92722c85, R9, R10, R11, R12, R13, R14, R15, R8) + SHA256ROUND1(40, 0xa2bfe8a1, R8, R9, R10, R11, R12, R13, R14, R15) + SHA256ROUND1(41, 0xa81a664b, R15, R8, R9, R10, R11, R12, R13, R14) + SHA256ROUND1(42, 0xc24b8b70, R14, R15, R8, R9, R10, R11, R12, R13) + SHA256ROUND1(43, 0xc76c51a3, R13, R14, R15, R8, R9, R10, R11, R12) + SHA256ROUND1(44, 0xd192e819, R12, R13, R14, R15, R8, R9, R10, R11) + SHA256ROUND1(45, 0xd6990624, R11, R12, R13, R14, R15, R8, R9, R10) + SHA256ROUND1(46, 0xf40e3585, R10, R11, R12, R13, R14, R15, R8, R9) + SHA256ROUND1(47, 0x106aa070, R9, R10, R11, R12, R13, R14, R15, R8) + SHA256ROUND1(48, 0x19a4c116, R8, R9, R10, R11, R12, R13, R14, R15) + SHA256ROUND1(49, 0x1e376c08, R15, R8, R9, R10, R11, R12, R13, R14) + SHA256ROUND1(50, 0x2748774c, R14, R15, R8, R9, R10, R11, R12, R13) + SHA256ROUND1(51, 0x34b0bcb5, R13, R14, R15, R8, R9, R10, R11, R12) + SHA256ROUND1(52, 0x391c0cb3, R12, R13, R14, R15, R8, R9, R10, R11) + SHA256ROUND1(53, 0x4ed8aa4a, R11, R12, R13, R14, R15, R8, R9, R10) + SHA256ROUND1(54, 0x5b9cca4f, R10, R11, R12, R13, R14, R15, R8, R9) + SHA256ROUND1(55, 0x682e6ff3, R9, R10, R11, R12, R13, R14, R15, R8) + SHA256ROUND1(56, 0x748f82ee, R8, R9, R10, R11, R12, R13, R14, R15) + SHA256ROUND1(57, 0x78a5636f, R15, R8, R9, R10, R11, R12, R13, R14) + SHA256ROUND1(58, 0x84c87814, R14, R15, R8, R9, R10, R11, R12, R13) + SHA256ROUND1(59, 0x8cc70208, R13, R14, R15, R8, R9, R10, R11, R12) + SHA256ROUND1(60, 0x90befffa, R12, R13, R14, R15, R8, R9, R10, R11) + SHA256ROUND1(61, 0xa4506ceb, R11, R12, R13, R14, R15, R8, R9, R10) + SHA256ROUND1(62, 0xbef9a3f7, R10, R11, R12, R13, R14, R15, R8, R9) + SHA256ROUND1(63, 0xc67178f2, R9, R10, R11, R12, R13, R14, R15, R8) + + MOVQ dig+0(FP), BP + ADDL (0*4)(BP), R8 // H0 = a + H0 + MOVL R8, (0*4)(BP) + ADDL (1*4)(BP), R9 // H1 = b + H1 + MOVL R9, (1*4)(BP) + ADDL (2*4)(BP), R10 // H2 = c + H2 + MOVL R10, (2*4)(BP) + ADDL (3*4)(BP), R11 // H3 = d + H3 + MOVL R11, (3*4)(BP) + ADDL (4*4)(BP), R12 // H4 = e + H4 + MOVL R12, (4*4)(BP) + ADDL (5*4)(BP), R13 // H5 = f + H5 + MOVL R13, (5*4)(BP) + ADDL (6*4)(BP), R14 // H6 = g + H6 + MOVL R14, (6*4)(BP) + ADDL (7*4)(BP), R15 // H7 = h + H7 + MOVL R15, (7*4)(BP) + + ADDQ $64, SI + CMPQ SI, 256(SP) + JB loop + +end: + RET diff --git a/src/crypto/sha256/sha256block_decl.go b/src/crypto/sha256/sha256block_decl.go new file mode 100644 index 0000000000000000000000000000000000000000..a50c9787108d3e0a2263a956ae46a9e392944eda --- /dev/null +++ b/src/crypto/sha256/sha256block_decl.go @@ -0,0 +1,11 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build 386 amd64 + +package sha256 + +//go:noescape + +func block(dig *digest, p []byte) diff --git a/src/crypto/sha512/sha512.go b/src/crypto/sha512/sha512.go new file mode 100644 index 0000000000000000000000000000000000000000..e7781fd2f41159ba8d03f770a6fe78653acf2cd0 --- /dev/null +++ b/src/crypto/sha512/sha512.go @@ -0,0 +1,288 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package sha512 implements the SHA-384, SHA-512, SHA-512/224, and SHA-512/256 +// hash algorithms as defined in FIPS 180-4. +package sha512 + +import ( + "crypto" + "hash" +) + +func init() { + crypto.RegisterHash(crypto.SHA384, New384) + crypto.RegisterHash(crypto.SHA512, New) + crypto.RegisterHash(crypto.SHA512_224, New512_224) + crypto.RegisterHash(crypto.SHA512_256, New512_256) +} + +const ( + // Size is the size, in bytes, of a SHA-512 checksum. + Size = 64 + + // Size224 is the size, in bytes, of a SHA-512/224 checksum. + Size224 = 28 + + // Size256 is the size, in bytes, of a SHA-512/256 checksum. + Size256 = 32 + + // Size384 is the size, in bytes, of a SHA-384 checksum. + Size384 = 48 + + // BlockSize is the block size, in bytes, of the SHA-512/224, + // SHA-512/256, SHA-384 and SHA-512 hash functions. + BlockSize = 128 +) + +const ( + chunk = 128 + init0 = 0x6a09e667f3bcc908 + init1 = 0xbb67ae8584caa73b + init2 = 0x3c6ef372fe94f82b + init3 = 0xa54ff53a5f1d36f1 + init4 = 0x510e527fade682d1 + init5 = 0x9b05688c2b3e6c1f + init6 = 0x1f83d9abfb41bd6b + init7 = 0x5be0cd19137e2179 + init0_224 = 0x8c3d37c819544da2 + init1_224 = 0x73e1996689dcd4d6 + init2_224 = 0x1dfab7ae32ff9c82 + init3_224 = 0x679dd514582f9fcf + init4_224 = 0x0f6d2b697bd44da8 + init5_224 = 0x77e36f7304c48942 + init6_224 = 0x3f9d85a86a1d36c8 + init7_224 = 0x1112e6ad91d692a1 + init0_256 = 0x22312194fc2bf72c + init1_256 = 0x9f555fa3c84c64c2 + init2_256 = 0x2393b86b6f53b151 + init3_256 = 0x963877195940eabd + init4_256 = 0x96283ee2a88effe3 + init5_256 = 0xbe5e1e2553863992 + init6_256 = 0x2b0199fc2c85b8aa + init7_256 = 0x0eb72ddc81c52ca2 + init0_384 = 0xcbbb9d5dc1059ed8 + init1_384 = 0x629a292a367cd507 + init2_384 = 0x9159015a3070dd17 + init3_384 = 0x152fecd8f70e5939 + init4_384 = 0x67332667ffc00b31 + init5_384 = 0x8eb44a8768581511 + init6_384 = 0xdb0c2e0d64f98fa7 + init7_384 = 0x47b5481dbefa4fa4 +) + +// digest represents the partial evaluation of a checksum. +type digest struct { + h [8]uint64 + x [chunk]byte + nx int + len uint64 + function crypto.Hash +} + +func (d *digest) Reset() { + switch d.function { + case crypto.SHA384: + d.h[0] = init0_384 + d.h[1] = init1_384 + d.h[2] = init2_384 + d.h[3] = init3_384 + d.h[4] = init4_384 + d.h[5] = init5_384 + d.h[6] = init6_384 + d.h[7] = init7_384 + case crypto.SHA512_224: + d.h[0] = init0_224 + d.h[1] = init1_224 + d.h[2] = init2_224 + d.h[3] = init3_224 + d.h[4] = init4_224 + d.h[5] = init5_224 + d.h[6] = init6_224 + d.h[7] = init7_224 + case crypto.SHA512_256: + d.h[0] = init0_256 + d.h[1] = init1_256 + d.h[2] = init2_256 + d.h[3] = init3_256 + d.h[4] = init4_256 + d.h[5] = init5_256 + d.h[6] = init6_256 + d.h[7] = init7_256 + default: + d.h[0] = init0 + d.h[1] = init1 + d.h[2] = init2 + d.h[3] = init3 + d.h[4] = init4 + d.h[5] = init5 + d.h[6] = init6 + d.h[7] = init7 + } + d.nx = 0 + d.len = 0 +} + +// New returns a new hash.Hash computing the SHA-512 checksum. +func New() hash.Hash { + d := &digest{function: crypto.SHA512} + d.Reset() + return d +} + +// New512_224 returns a new hash.Hash computing the SHA-512/224 checksum. +func New512_224() hash.Hash { + d := &digest{function: crypto.SHA512_224} + d.Reset() + return d +} + +// New512_256 returns a new hash.Hash computing the SHA-512/256 checksum. +func New512_256() hash.Hash { + d := &digest{function: crypto.SHA512_256} + d.Reset() + return d +} + +// New384 returns a new hash.Hash computing the SHA-384 checksum. +func New384() hash.Hash { + d := &digest{function: crypto.SHA384} + d.Reset() + return d +} + +func (d *digest) Size() int { + switch d.function { + case crypto.SHA512_224: + return Size224 + case crypto.SHA512_256: + return Size256 + case crypto.SHA384: + return Size384 + default: + return Size + } +} + +func (d *digest) BlockSize() int { return BlockSize } + +func (d *digest) Write(p []byte) (nn int, err error) { + nn = len(p) + d.len += uint64(nn) + if d.nx > 0 { + n := copy(d.x[d.nx:], p) + d.nx += n + if d.nx == chunk { + block(d, d.x[:]) + d.nx = 0 + } + p = p[n:] + } + if len(p) >= chunk { + n := len(p) &^ (chunk - 1) + block(d, p[:n]) + p = p[n:] + } + if len(p) > 0 { + d.nx = copy(d.x[:], p) + } + return +} + +func (d0 *digest) Sum(in []byte) []byte { + // Make a copy of d0 so that caller can keep writing and summing. + d := new(digest) + *d = *d0 + hash := d.checkSum() + switch d.function { + case crypto.SHA384: + return append(in, hash[:Size384]...) + case crypto.SHA512_224: + return append(in, hash[:Size224]...) + case crypto.SHA512_256: + return append(in, hash[:Size256]...) + default: + return append(in, hash[:]...) + } +} + +func (d *digest) checkSum() [Size]byte { + // Padding. Add a 1 bit and 0 bits until 112 bytes mod 128. + len := d.len + var tmp [128]byte + tmp[0] = 0x80 + if len%128 < 112 { + d.Write(tmp[0 : 112-len%128]) + } else { + d.Write(tmp[0 : 128+112-len%128]) + } + + // Length in bits. + len <<= 3 + for i := uint(0); i < 16; i++ { + tmp[i] = byte(len >> (120 - 8*i)) + } + d.Write(tmp[0:16]) + + if d.nx != 0 { + panic("d.nx != 0") + } + + h := d.h[:] + if d.function == crypto.SHA384 { + h = d.h[:6] + } + + var digest [Size]byte + for i, s := range h { + digest[i*8] = byte(s >> 56) + digest[i*8+1] = byte(s >> 48) + digest[i*8+2] = byte(s >> 40) + digest[i*8+3] = byte(s >> 32) + digest[i*8+4] = byte(s >> 24) + digest[i*8+5] = byte(s >> 16) + digest[i*8+6] = byte(s >> 8) + digest[i*8+7] = byte(s) + } + + return digest +} + +// Sum512 returns the SHA512 checksum of the data. +func Sum512(data []byte) [Size]byte { + d := digest{function: crypto.SHA512} + d.Reset() + d.Write(data) + return d.checkSum() +} + +// Sum384 returns the SHA384 checksum of the data. +func Sum384(data []byte) (sum384 [Size384]byte) { + d := digest{function: crypto.SHA384} + d.Reset() + d.Write(data) + sum := d.checkSum() + copy(sum384[:], sum[:Size384]) + return +} + +// Sum512_224 returns the Sum512/224 checksum of the data. +func Sum512_224(data []byte) (sum224 [Size224]byte) { + d := digest{function: crypto.SHA512_224} + d.Reset() + d.Write(data) + sum := d.checkSum() + copy(sum224[:], sum[:Size224]) + return +} + +// Sum512_256 returns the Sum512/256 checksum of the data. +func Sum512_256(data []byte) (sum256 [Size256]byte) { + d := digest{function: crypto.SHA512_256} + d.Reset() + d.Write(data) + sum := d.checkSum() + copy(sum256[:], sum[:Size256]) + return +} diff --git a/src/crypto/sha512/sha512_test.go b/src/crypto/sha512/sha512_test.go new file mode 100644 index 0000000000000000000000000000000000000000..04b3d4a3cc0ab12c0ac85a1a5ecdb05addbbb534 --- /dev/null +++ b/src/crypto/sha512/sha512_test.go @@ -0,0 +1,330 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// SHA512 hash algorithm. See FIPS 180-4. + +package sha512 + +import ( + "encoding/hex" + "hash" + "io" + "testing" +) + +type sha512Test struct { + in string + out224 string + out256 string + out384 string + out512 string +} + +var golden = []sha512Test{ + { + "", + "6ed0dd02806fa89e25de060c19d3ac86cabb87d6a0ddd05c333b84f4", + "c672b8d1ef56ed28ab87c3622c5114069bdd3ad7b8f9737498d0c01ecef0967a", + "38b060a751ac96384cd9327eb1b1e36a21fdb71114be07434c0cc7bf63f6e1da274edebfe76f65fbd51ad2f14898b95b", + "cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e", + }, + { + "a", + "d5cdb9ccc769a5121d4175f2bfdd13d6310e0d3d361ea75d82108327", + "455e518824bc0601f9fb858ff5c37d417d67c2f8e0df2babe4808858aea830f8", + "54a59b9f22b0b80880d8427e548b7c23abd873486e1f035dce9cd697e85175033caa88e6d57bc35efae0b5afd3145f31", + "1f40fc92da241694750979ee6cf582f2d5d7d28e18335de05abc54d0560e0f5302860c652bf08d560252aa5e74210546f369fbbbce8c12cfc7957b2652fe9a75", + }, + { + "ab", + "b35878d07bfedf39fc638af08547eb5d1072d8546319f247b442fbf5", + "22d4d37ec6370571af7109fb12eae79673d5f7c83e6e677083faa3cfac3b2c14", + "c7be03ba5bcaa384727076db0018e99248e1a6e8bd1b9ef58a9ec9dd4eeebb3f48b836201221175befa74ddc3d35afdd", + "2d408a0717ec188158278a796c689044361dc6fdde28d6f04973b80896e1823975cdbf12eb63f9e0591328ee235d80e9b5bf1aa6a44f4617ff3caf6400eb172d", + }, + { + "abc", + "4634270f707b6a54daae7530460842e20e37ed265ceee9a43e8924aa", + "53048e2681941ef99b2e29b76b4c7dabe4c2d0c634fc6d46e0e2f13107e7af23", + "cb00753f45a35e8bb5a03d699ac65007272c32ab0eded1631a8b605a43ff5bed8086072ba1e7cc2358baeca134c825a7", + "ddaf35a193617abacc417349ae20413112e6fa4e89a97ea20a9eeee64b55d39a2192992a274fc1a836ba3c23a3feebbd454d4423643ce80e2a9ac94fa54ca49f", + }, + { + "abcd", + "0c9f157ab030fb06e957c14e3938dc5908962e5dd7b66f04a36fc534", + "d2891c7978be0e24948f37caa415b87cb5cbe2b26b7bad9dc6391b8a6f6ddcc9", + "1165b3406ff0b52a3d24721f785462ca2276c9f454a116c2b2ba20171a7905ea5a026682eb659c4d5f115c363aa3c79b", + "d8022f2060ad6efd297ab73dcc5355c9b214054b0d1776a136a669d26a7d3b14f73aa0d0ebff19ee333368f0164b6419a96da49e3e481753e7e96b716bdccb6f", + }, + { + "abcde", + "880e79bb0a1d2c9b7528d851edb6b8342c58c831de98123b432a4515", + "de8322b46e78b67d4431997070703e9764e03a1237b896fd8b379ed4576e8363", + "4c525cbeac729eaf4b4665815bc5db0c84fe6300068a727cf74e2813521565abc0ec57a37ee4d8be89d097c0d2ad52f0", + "878ae65a92e86cac011a570d4c30a7eaec442b85ce8eca0c2952b5e3cc0628c2e79d889ad4d5c7c626986d452dd86374b6ffaa7cd8b67665bef2289a5c70b0a1", + }, + { + "abcdef", + "236c829cfea4fd6d4de61ad15fcf34dca62342adaf9f2001c16f29b8", + "e4fdcb11d1ac14e698743acd8805174cea5ddc0d312e3e47f6372032571bad84", + "c6a4c65b227e7387b9c3e839d44869c4cfca3ef583dea64117859b808c1e3d8ae689e1e314eeef52a6ffe22681aa11f5", + "e32ef19623e8ed9d267f657a81944b3d07adbb768518068e88435745564e8d4150a0a703be2a7d88b61e3d390c2bb97e2d4c311fdc69d6b1267f05f59aa920e7", + }, + { + "abcdefg", + "4767af672b3ed107f25018dc22d6fa4b07d156e13b720971e2c4f6bf", + "a8117f680bdceb5d1443617cbdae9255f6900075422326a972fdd2f65ba9bee3", + "9f11fc131123f844c1226f429b6a0a6af0525d9f40f056c7fc16cdf1b06bda08e302554417a59fa7dcf6247421959d22", + "d716a4188569b68ab1b6dfac178e570114cdf0ea3a1cc0e31486c3e41241bc6a76424e8c37ab26f096fc85ef9886c8cb634187f4fddff645fb099f1ff54c6b8c", + }, + { + "abcdefgh", + "792e25e0ae286d123a38950007e037d3122e76c4ee201668c385edab", + "a29b9645d2a02a8b582888d044199787220e316bf2e89d1422d3df26bf545bbe", + "9000cd7cada59d1d2eb82912f7f24e5e69cc5517f68283b005fa27c285b61e05edf1ad1a8a9bded6fd29eb87d75ad806", + "a3a8c81bc97c2560010d7389bc88aac974a104e0e2381220c6e084c4dccd1d2d17d4f86db31c2a851dc80e6681d74733c55dcd03dd96f6062cdda12a291ae6ce", + }, + { + "abcdefghi", + "56b275d36127dc070cda4019baf2ce2579a25d8c67fa2bc9be61b539", + "b955095330f9c8188d11884ec1679dc44c9c5b25ff9bda700416df9cdd39188f", + "ef54915b60cf062b8dd0c29ae3cad69abe6310de63ac081f46ef019c5c90897caefd79b796cfa81139788a260ded52df", + "f22d51d25292ca1d0f68f69aedc7897019308cc9db46efb75a03dd494fc7f126c010e8ade6a00a0c1a5f1b75d81e0ed5a93ce98dc9b833db7839247b1d9c24fe", + }, + { + "abcdefghij", + "f809423cbb25e81a2a64aecee2cd5fdc7d91d5db583901fbf1db3116", + "550762913d51eefbcd1a55068fcfc9b154fd11c1078b996df0d926ea59d2a68d", + "a12070030a02d86b0ddacd0d3a5b598344513d0a051e7355053e556a0055489c1555399b03342845c4adde2dc44ff66c", + "ef6b97321f34b1fea2169a7db9e1960b471aa13302a988087357c520be957ca119c3ba68e6b4982c019ec89de3865ccf6a3cda1fe11e59f98d99f1502c8b9745", + }, + { + "Discard medicine more than two years old.", + "4c46e10b5b72204e509c3c06072cea970bc020cd45a61a0acdfa97ac", + "690c8ad3916cefd3ad29226d9875965e3ee9ec0d4482eacc248f2ff4aa0d8e5b", + "86f58ec2d74d1b7f8eb0c2ff0967316699639e8d4eb129de54bdf34c96cdbabe200d052149f2dd787f43571ba74670d4", + "2210d99af9c8bdecda1b4beff822136753d8342505ddce37f1314e2cdbb488c6016bdaa9bd2ffa513dd5de2e4b50f031393d8ab61f773b0e0130d7381e0f8a1d", + }, + { + "He who has a shady past knows that nice guys finish last.", + "cb0cef13c1848d91a6d02637c7c520de1914ad4a7aea824671cc328e", + "25938ca49f7ef1178ce81620842b65e576245fcaed86026a36b516b80bb86b3b", + "ae4a2b639ca9bfa04b1855d5a05fe7f230994f790891c6979103e2605f660c4c1262a48142dcbeb57a1914ba5f7c3fa7", + "a687a8985b4d8d0a24f115fe272255c6afaf3909225838546159c1ed685c211a203796ae8ecc4c81a5b6315919b3a64f10713da07e341fcdbb08541bf03066ce", + }, + { + "I wouldn't marry him with a ten foot pole.", + "6c7bd0f3a6544ea698006c2ea583a85f80ea2913590a186db8bb2f1b", + "698e420c3a7038e53d8e73f4be2b02e03b93464ac1a61ebe69f557079921ef65", + "40ae213df6436eca952aa6841886fcdb82908ef1576a99c8f49bb9dd5023169f7c53035abdda0b54c302f4974e2105e7", + "8ddb0392e818b7d585ab22769a50df660d9f6d559cca3afc5691b8ca91b8451374e42bcdabd64589ed7c91d85f626596228a5c8572677eb98bc6b624befb7af8", + }, + { + "Free! Free!/A trip/to Mars/for 900/empty jars/Burma Shave", + "981323be3eca6ccfa598e58dd74ed8cb05d5f7f6653b7604b684f904", + "839b414d7e3900ee243aa3d1f9b6955720e64041f5ab9bedd3eb0a08da5a2ca8", + "e7cf8b873c9bc950f06259aa54309f349cefa72c00d597aebf903e6519a50011dfe355afff064a10701c705693848df9", + "26ed8f6ca7f8d44b6a8a54ae39640fa8ad5c673f70ee9ce074ba4ef0d483eea00bab2f61d8695d6b34df9c6c48ae36246362200ed820448bdc03a720366a87c6", + }, + { + "The days of the digital watch are numbered. -Tom Stoppard", + "e6fbf82df5138bf361e826903cadf0612cb2986649ba47a57e1bca99", + "5625ecb9d284e54c00b257b67a8cacb25a78db2845c60ef2d29e43c84f236e8e", + "c3d4f0f4047181c7d39d34703365f7bf70207183caf2c2f6145f04da895ef69124d9cdeb635da636c3a474e61024e29b", + "e5a14bf044be69615aade89afcf1ab0389d5fc302a884d403579d1386a2400c089b0dbb387ed0f463f9ee342f8244d5a38cfbc0e819da9529fbff78368c9a982", + }, + { + "Nepal premier won't resign.", + "6ec2cb2ecafc1a9bddaf4caf57344d853e6ded398927d5694fd7714f", + "9b81d06bca2f985e6ad3249096ff3c0f2a9ec5bb16ef530d738d19d81e7806f2", + "a097aab567e167d5cf93676ed73252a69f9687cb3179bb2d27c9878119e94bf7b7c4b58dc90582edfaf66e11388ed714", + "420a1faa48919e14651bed45725abe0f7a58e0f099424c4e5a49194946e38b46c1f8034b18ef169b2e31050d1648e0b982386595f7df47da4b6fd18e55333015", + }, + { + "For every action there is an equal and opposite government program.", + "7f62f36e716e0badaf4a4658da9d09bea26357a1bc6aeb8cf7c3ae35", + "08241df8d91edfcd68bb1a1dada6e0ae1475a5c6e7b8f12d8e24ca43a38240a9", + "5026ca45c41fc64712eb65065da92f6467541c78f8966d3fe2c8e3fb769a3ec14215f819654b47bd64f7f0eac17184f3", + "d926a863beadb20134db07683535c72007b0e695045876254f341ddcccde132a908c5af57baa6a6a9c63e6649bba0c213dc05fadcf9abccea09f23dcfb637fbe", + }, + { + "His money is twice tainted: 'taint yours and 'taint mine.", + "45adffcb86a05ee4d91263a6115dda011b805d442c60836963cb8378", + "4ff74d9213a8117745f5d37b5353a774ec81c5dfe65c4c8986a56fc01f2c551e", + "ac1cc0f5ac8d5f5514a7b738ac322b7fb52a161b449c3672e9b6a6ad1a5e4b26b001cf3bad24c56598676ca17d4b445a", + "9a98dd9bb67d0da7bf83da5313dff4fd60a4bac0094f1b05633690ffa7f6d61de9a1d4f8617937d560833a9aaa9ccafe3fd24db418d0e728833545cadd3ad92d", + }, + { + "There is no reason for any individual to have a computer in their home. -Ken Olsen, 1977", + "51cb518f1f68daa901a3075a0a5e1acc755b4e5c82cb47687537f880", + "b5baf747c307f98849ec881cf0d48605ae4edd386372aea9b26e71db517e650b", + "722d10c5de371ec0c8c4b5247ac8a5f1d240d68c73f8da13d8b25f0166d6f309bf9561979a111a0049405771d201941a", + "d7fde2d2351efade52f4211d3746a0780a26eec3df9b2ed575368a8a1c09ec452402293a8ea4eceb5a4f60064ea29b13cdd86918cd7a4faf366160b009804107", + }, + { + "It's a tiny change to the code and not completely disgusting. - Bob Manchek", + "3b59c5e64b0da7bfc18d7017bf458d90f2c83601ff1afc6263ac0993", + "7eef0538ebd7ecf18611d23b0e1cd26a74d65b929a2e374197dc66e755ca4944", + "dc2d3ea18bfa10549c63bf2b75b39b5167a80c12aff0e05443168ea87ff149fb0eda5e0bd234eb5d48c7d02ffc5807f1", + "b0f35ffa2697359c33a56f5c0cf715c7aeed96da9905ca2698acadb08fbc9e669bf566b6bd5d61a3e86dc22999bcc9f2224e33d1d4f32a228cf9d0349e2db518", + }, + { + "size: a.out: bad magic", + "6a9525c0fac0f91b489bc4f0f539b9ec4a156a4e98bc15b655c2c881", + "d05600964f83f55323104aadab434f32391c029718a7690d08ddb2d7e8708443", + "1d67c969e2a945ae5346d2139760261504d4ba164c522443afe19ef3e29b152a4c52445489cfc9d7215e5a450e8e1e4e", + "3d2e5f91778c9e66f7e061293aaa8a8fc742dd3b2e4f483772464b1144189b49273e610e5cccd7a81a19ca1fa70f16b10f1a100a4d8c1372336be8484c64b311", + }, + { + "The major problem is with sendmail. -Mark Horton", + "a1b2b2905b1527d682049c6a76e35c7d8c72551abfe7833ac1be595f", + "53ed5f9b5c0b674ac0f3425d9f9a5d462655b07cc90f5d0f692eec093884a607", + "5ff8e075e465646e7b73ef36d812c6e9f7d60fa6ea0e533e5569b4f73cde53cdd2cc787f33540af57cca3fe467d32fe0", + "b2f68ff58ac015efb1c94c908b0d8c2bf06f491e4de8e6302c49016f7f8a33eac3e959856c7fddbc464de618701338a4b46f76dbfaf9a1e5262b5f40639771c7", + }, + { + "Give me a rock, paper and scissors and I will move the world. CCFestoon", + "76cf045c76a5f2e3d64d56c3cdba6a25479334611bc375460526f8c1", + "5a0147685a44eea2435dbd582724efca7637acd9c428e5e1a05115bc3bc2a0e0", + "5bd0a997a67c9ae1979a894eb0cde403dde003c9b6f2c03cf21925c42ff4e1176e6df1ca005381612ef18457b9b7ec3b", + "d8c92db5fdf52cf8215e4df3b4909d29203ff4d00e9ad0b64a6a4e04dec5e74f62e7c35c7fb881bd5de95442123df8f57a489b0ae616bd326f84d10021121c57", + }, + { + "If the enemy is within range, then so are you.", + "4473671daeecfdb6f6c5bc06b26374aa5e497cc37119fe14144c430c", + "1152c9b27a99dbf4057d21438f4e63dd0cd0977d5ff12317c64d3b97fcac875a", + "1eee6da33e7e54fc5be52ae23b94b16ba4d2a947ae4505c6a3edfc7401151ea5205ac01b669b56f27d8ef7f175ed7762", + "19a9f8dc0a233e464e8566ad3ca9b91e459a7b8c4780985b015776e1bf239a19bc233d0556343e2b0a9bc220900b4ebf4f8bdf89ff8efeaf79602d6849e6f72e", + }, + { + "It's well we cannot hear the screams/That we create in others' dreams.", + "6accb6394758523fcd453d47d37ebd10868957a0a9e81c796736abf8", + "105e890f5d5cf1748d9a7b4cdaf58b69855779deebc2097747c2210a17b2cb51", + "76b06e9dea66bfbb1a96029426dc0dfd7830bd297eb447ff5358d94a87cd00c88b59df2493fef56ecbb5231073892ea9", + "00b4c41f307bde87301cdc5b5ab1ae9a592e8ecbb2021dd7bc4b34e2ace60741cc362560bec566ba35178595a91932b8d5357e2c9cec92d393b0fa7831852476", + }, + { + "You remind me of a TV show, but that's all right: I watch it anyway.", + "6f173f4b6eac7f2a73eaa0833c4563752df2c869dc00b7d30219e12e", + "74644ead770da1434365cd912656fe1aca2056d3039d39f10eb1151bddb32cf3", + "12acaf21452cff586143e3f5db0bfdf7802c057e1adf2a619031c4e1b0ccc4208cf6cef8fe722bbaa2fb46a30d9135d8", + "91eccc3d5375fd026e4d6787874b1dce201cecd8a27dbded5065728cb2d09c58a3d467bb1faf353bf7ba567e005245d5321b55bc344f7c07b91cb6f26c959be7", + }, + { + "C is as portable as Stonehedge!!", + "db05bf4d0f73325208755f4af96cfac6cb3db5dbfc323d675d68f938", + "50a234625de5587581883dad9ef399460928032a5ea6bd005d7dc7b68d8cc3d6", + "0fc23d7f4183efd186f0bc4fc5db867e026e2146b06cb3d52f4bdbd57d1740122caa853b41868b197b2ac759db39df88", + "fabbbe22180f1f137cfdc9556d2570e775d1ae02a597ded43a72a40f9b485d500043b7be128fb9fcd982b83159a0d99aa855a9e7cc4240c00dc01a9bdf8218d7", + }, + { + "Even if I could be Shakespeare, I think I should still choose to be Faraday. - A. Huxley", + "05ffa71bb02e855de1aaee1777b3bdbaf7507646f19c4c6aa29933d0", + "a7a3846005f8a9935a0a2d43e7fd56d95132a9a3609bf3296ef80b8218acffa0", + "bc805578a7f85d34a86a32976e1c34fe65cf815186fbef76f46ef99cda10723f971f3f1464d488243f5e29db7488598d", + "2ecdec235c1fa4fc2a154d8fba1dddb8a72a1ad73838b51d792331d143f8b96a9f6fcb0f34d7caa351fe6d88771c4f105040e0392f06e0621689d33b2f3ba92e", + }, + { + "The fugacity of a constituent in a mixture of gases at a given temperature is proportional to its mole fraction. Lewis-Randall Rule", + "3ad3c89e15b91e6273534c5d18adadbb528e7b840b288f64e81b8c6d", + "688ff03e367680757aa9906cb1e2ad218c51f4526dc0426ea229a5ba9d002c69", + "b23918399a12ebf4431559eec3813eaf7412e875fd7464f16d581e473330842d2e96c6be49a7ce3f9bb0b8bc0fcbe0fe", + "7ad681f6f96f82f7abfa7ecc0334e8fa16d3dc1cdc45b60b7af43fe4075d2357c0c1d60e98350f1afb1f2fe7a4d7cd2ad55b88e458e06b73c40b437331f5dab4", + }, + { + "How can you write a big system without C++? -Paul Glick", + "e3763669d1b760c1be7bfcb6625f92300a8430419d1dbad57ec9f53c", + "3fa46d52094b01021cff5af9a438982b887a5793f624c0a6644149b6b7c3f485", + "1764b700eb1ead52a2fc33cc28975c2180f1b8faa5038d94cffa8d78154aab16e91dd787e7b0303948ebed62561542c8", + "833f9248ab4a3b9e5131f745fda1ffd2dd435b30e965957e78291c7ab73605fd1912b0794e5c233ab0a12d205a39778d19b83515d6a47003f19cdee51d98c7e0", + }, +} + +func testHash(t *testing.T, name, in, outHex string, oneShotResult []byte, digestFunc hash.Hash) { + if calculated := hex.EncodeToString(oneShotResult); calculated != outHex { + t.Errorf("one-shot result for %s(%q) = %q, but expected %q", name, in, calculated, outHex) + return + } + + for pass := 0; pass < 3; pass++ { + if pass < 2 { + io.WriteString(digestFunc, in) + } else { + io.WriteString(digestFunc, in[:len(in)/2]) + digestFunc.Sum(nil) + io.WriteString(digestFunc, in[len(in)/2:]) + } + + if calculated := hex.EncodeToString(digestFunc.Sum(nil)); calculated != outHex { + t.Errorf("%s(%q) = %q (in pass #%d), but expected %q", name, in, calculated, pass, outHex) + } + digestFunc.Reset() + } +} + +func TestGolden(t *testing.T) { + for _, test := range golden { + in := []byte(test.in) + + sum224 := Sum512_224(in) + sum256 := Sum512_256(in) + sum384 := Sum384(in) + sum512 := Sum512(in) + testHash(t, "SHA512/224", test.in, test.out224, sum224[:], New512_224()) + testHash(t, "SHA512/256", test.in, test.out256, sum256[:], New512_256()) + testHash(t, "SHA384", test.in, test.out384, sum384[:], New384()) + testHash(t, "SHA512", test.in, test.out512, sum512[:], New()) + } +} + +func TestSize(t *testing.T) { + c := New() + if got := c.Size(); got != Size { + t.Errorf("Size = %d; want %d", got, Size) + } + c = New384() + if got := c.Size(); got != Size384 { + t.Errorf("New384.Size = %d; want %d", got, Size384) + } + c = New512_224() + if got := c.Size(); got != Size224 { + t.Errorf("New512224.Size = %d; want %d", got, Size224) + } + c = New512_256() + if got := c.Size(); got != Size256 { + t.Errorf("New512256.Size = %d; want %d", got, Size256) + } +} + +func TestBlockSize(t *testing.T) { + c := New() + if got := c.BlockSize(); got != BlockSize { + t.Errorf("BlockSize = %d; want %d", got, BlockSize) + } +} + +var bench = New() +var buf = make([]byte, 8192) + +func benchmarkSize(b *testing.B, size int) { + b.SetBytes(int64(size)) + sum := make([]byte, bench.Size()) + for i := 0; i < b.N; i++ { + bench.Reset() + bench.Write(buf[:size]) + bench.Sum(sum[:0]) + } +} + +func BenchmarkHash8Bytes(b *testing.B) { + benchmarkSize(b, 8) +} + +func BenchmarkHash1K(b *testing.B) { + benchmarkSize(b, 1024) +} + +func BenchmarkHash8K(b *testing.B) { + benchmarkSize(b, 8192) +} diff --git a/src/crypto/sha512/sha512block.go b/src/crypto/sha512/sha512block.go new file mode 100644 index 0000000000000000000000000000000000000000..648ae8f7e1f436de807b348f3a23e9ff3b86534d --- /dev/null +++ b/src/crypto/sha512/sha512block.go @@ -0,0 +1,144 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build !amd64 + +// SHA512 block step. +// In its own file so that a faster assembly or C version +// can be substituted easily. + +package sha512 + +var _K = []uint64{ + 0x428a2f98d728ae22, + 0x7137449123ef65cd, + 0xb5c0fbcfec4d3b2f, + 0xe9b5dba58189dbbc, + 0x3956c25bf348b538, + 0x59f111f1b605d019, + 0x923f82a4af194f9b, + 0xab1c5ed5da6d8118, + 0xd807aa98a3030242, + 0x12835b0145706fbe, + 0x243185be4ee4b28c, + 0x550c7dc3d5ffb4e2, + 0x72be5d74f27b896f, + 0x80deb1fe3b1696b1, + 0x9bdc06a725c71235, + 0xc19bf174cf692694, + 0xe49b69c19ef14ad2, + 0xefbe4786384f25e3, + 0x0fc19dc68b8cd5b5, + 0x240ca1cc77ac9c65, + 0x2de92c6f592b0275, + 0x4a7484aa6ea6e483, + 0x5cb0a9dcbd41fbd4, + 0x76f988da831153b5, + 0x983e5152ee66dfab, + 0xa831c66d2db43210, + 0xb00327c898fb213f, + 0xbf597fc7beef0ee4, + 0xc6e00bf33da88fc2, + 0xd5a79147930aa725, + 0x06ca6351e003826f, + 0x142929670a0e6e70, + 0x27b70a8546d22ffc, + 0x2e1b21385c26c926, + 0x4d2c6dfc5ac42aed, + 0x53380d139d95b3df, + 0x650a73548baf63de, + 0x766a0abb3c77b2a8, + 0x81c2c92e47edaee6, + 0x92722c851482353b, + 0xa2bfe8a14cf10364, + 0xa81a664bbc423001, + 0xc24b8b70d0f89791, + 0xc76c51a30654be30, + 0xd192e819d6ef5218, + 0xd69906245565a910, + 0xf40e35855771202a, + 0x106aa07032bbd1b8, + 0x19a4c116b8d2d0c8, + 0x1e376c085141ab53, + 0x2748774cdf8eeb99, + 0x34b0bcb5e19b48a8, + 0x391c0cb3c5c95a63, + 0x4ed8aa4ae3418acb, + 0x5b9cca4f7763e373, + 0x682e6ff3d6b2b8a3, + 0x748f82ee5defb2fc, + 0x78a5636f43172f60, + 0x84c87814a1f0ab72, + 0x8cc702081a6439ec, + 0x90befffa23631e28, + 0xa4506cebde82bde9, + 0xbef9a3f7b2c67915, + 0xc67178f2e372532b, + 0xca273eceea26619c, + 0xd186b8c721c0c207, + 0xeada7dd6cde0eb1e, + 0xf57d4f7fee6ed178, + 0x06f067aa72176fba, + 0x0a637dc5a2c898a6, + 0x113f9804bef90dae, + 0x1b710b35131c471b, + 0x28db77f523047d84, + 0x32caab7b40c72493, + 0x3c9ebe0a15c9bebc, + 0x431d67c49c100d4c, + 0x4cc5d4becb3e42b6, + 0x597f299cfc657e2a, + 0x5fcb6fab3ad6faec, + 0x6c44198c4a475817, +} + +func block(dig *digest, p []byte) { + var w [80]uint64 + h0, h1, h2, h3, h4, h5, h6, h7 := dig.h[0], dig.h[1], dig.h[2], dig.h[3], dig.h[4], dig.h[5], dig.h[6], dig.h[7] + for len(p) >= chunk { + for i := 0; i < 16; i++ { + j := i * 8 + w[i] = uint64(p[j])<<56 | uint64(p[j+1])<<48 | uint64(p[j+2])<<40 | uint64(p[j+3])<<32 | + uint64(p[j+4])<<24 | uint64(p[j+5])<<16 | uint64(p[j+6])<<8 | uint64(p[j+7]) + } + for i := 16; i < 80; i++ { + v1 := w[i-2] + t1 := (v1>>19 | v1<<(64-19)) ^ (v1>>61 | v1<<(64-61)) ^ (v1 >> 6) + v2 := w[i-15] + t2 := (v2>>1 | v2<<(64-1)) ^ (v2>>8 | v2<<(64-8)) ^ (v2 >> 7) + + w[i] = t1 + w[i-7] + t2 + w[i-16] + } + + a, b, c, d, e, f, g, h := h0, h1, h2, h3, h4, h5, h6, h7 + + for i := 0; i < 80; i++ { + t1 := h + ((e>>14 | e<<(64-14)) ^ (e>>18 | e<<(64-18)) ^ (e>>41 | e<<(64-41))) + ((e & f) ^ (^e & g)) + _K[i] + w[i] + + t2 := ((a>>28 | a<<(64-28)) ^ (a>>34 | a<<(64-34)) ^ (a>>39 | a<<(64-39))) + ((a & b) ^ (a & c) ^ (b & c)) + + h = g + g = f + f = e + e = d + t1 + d = c + c = b + b = a + a = t1 + t2 + } + + h0 += a + h1 += b + h2 += c + h3 += d + h4 += e + h5 += f + h6 += g + h7 += h + + p = p[chunk:] + } + + dig.h[0], dig.h[1], dig.h[2], dig.h[3], dig.h[4], dig.h[5], dig.h[6], dig.h[7] = h0, h1, h2, h3, h4, h5, h6, h7 +} diff --git a/src/crypto/sha512/sha512block_amd64.s b/src/crypto/sha512/sha512block_amd64.s new file mode 100644 index 0000000000000000000000000000000000000000..2e10233de1d088044213a4db135b26ab12ba0a55 --- /dev/null +++ b/src/crypto/sha512/sha512block_amd64.s @@ -0,0 +1,273 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +#include "textflag.h" + +// SHA512 block routine. See sha512block.go for Go equivalent. +// +// The algorithm is detailed in FIPS 180-4: +// +// http://csrc.nist.gov/publications/fips/fips180-4/fips-180-4.pdf +// +// Wt = Mt; for 0 <= t <= 15 +// Wt = SIGMA1(Wt-2) + SIGMA0(Wt-15) + Wt-16; for 16 <= t <= 79 +// +// a = H0 +// b = H1 +// c = H2 +// d = H3 +// e = H4 +// f = H5 +// g = H6 +// h = H7 +// +// for t = 0 to 79 { +// T1 = h + BIGSIGMA1(e) + Ch(e,f,g) + Kt + Wt +// T2 = BIGSIGMA0(a) + Maj(a,b,c) +// h = g +// g = f +// f = e +// e = d + T1 +// d = c +// c = b +// b = a +// a = T1 + T2 +// } +// +// H0 = a + H0 +// H1 = b + H1 +// H2 = c + H2 +// H3 = d + H3 +// H4 = e + H4 +// H5 = f + H5 +// H6 = g + H6 +// H7 = h + H7 + +// Wt = Mt; for 0 <= t <= 15 +#define MSGSCHEDULE0(index) \ + MOVQ (index*8)(SI), AX; \ + BSWAPQ AX; \ + MOVQ AX, (index*8)(BP) + +// Wt = SIGMA1(Wt-2) + Wt-7 + SIGMA0(Wt-15) + Wt-16; for 16 <= t <= 79 +// SIGMA0(x) = ROTR(1,x) XOR ROTR(8,x) XOR SHR(7,x) +// SIGMA1(x) = ROTR(19,x) XOR ROTR(61,x) XOR SHR(6,x) +#define MSGSCHEDULE1(index) \ + MOVQ ((index-2)*8)(BP), AX; \ + MOVQ AX, CX; \ + RORQ $19, AX; \ + MOVQ CX, DX; \ + RORQ $61, CX; \ + SHRQ $6, DX; \ + MOVQ ((index-15)*8)(BP), BX; \ + XORQ CX, AX; \ + MOVQ BX, CX; \ + XORQ DX, AX; \ + RORQ $1, BX; \ + MOVQ CX, DX; \ + SHRQ $7, DX; \ + RORQ $8, CX; \ + ADDQ ((index-7)*8)(BP), AX; \ + XORQ CX, BX; \ + XORQ DX, BX; \ + ADDQ ((index-16)*8)(BP), BX; \ + ADDQ BX, AX; \ + MOVQ AX, ((index)*8)(BP) + +// Calculate T1 in AX - uses AX, CX and DX registers. +// h is also used as an accumulator. Wt is passed in AX. +// T1 = h + BIGSIGMA1(e) + Ch(e, f, g) + Kt + Wt +// BIGSIGMA1(x) = ROTR(14,x) XOR ROTR(18,x) XOR ROTR(41,x) +// Ch(x, y, z) = (x AND y) XOR (NOT x AND z) +#define SHA512T1(const, e, f, g, h) \ + MOVQ $const, DX; \ + ADDQ AX, h; \ + MOVQ e, AX; \ + ADDQ DX, h; \ + MOVQ e, CX; \ + RORQ $14, AX; \ + MOVQ e, DX; \ + RORQ $18, CX; \ + XORQ CX, AX; \ + MOVQ e, CX; \ + RORQ $41, DX; \ + ANDQ f, CX; \ + XORQ AX, DX; \ + MOVQ e, AX; \ + NOTQ AX; \ + ADDQ DX, h; \ + ANDQ g, AX; \ + XORQ CX, AX; \ + ADDQ h, AX + +// Calculate T2 in BX - uses BX, CX, DX and DI registers. +// T2 = BIGSIGMA0(a) + Maj(a, b, c) +// BIGSIGMA0(x) = ROTR(28,x) XOR ROTR(34,x) XOR ROTR(39,x) +// Maj(x, y, z) = (x AND y) XOR (x AND z) XOR (y AND z) +#define SHA512T2(a, b, c) \ + MOVQ a, DI; \ + MOVQ c, BX; \ + RORQ $28, DI; \ + MOVQ a, DX; \ + ANDQ b, BX; \ + RORQ $34, DX; \ + MOVQ a, CX; \ + ANDQ c, CX; \ + XORQ DX, DI; \ + XORQ CX, BX; \ + MOVQ a, DX; \ + MOVQ b, CX; \ + RORQ $39, DX; \ + ANDQ a, CX; \ + XORQ CX, BX; \ + XORQ DX, DI; \ + ADDQ DI, BX + +// Calculate T1 and T2, then e = d + T1 and a = T1 + T2. +// The values for e and a are stored in d and h, ready for rotation. +#define SHA512ROUND(index, const, a, b, c, d, e, f, g, h) \ + SHA512T1(const, e, f, g, h); \ + SHA512T2(a, b, c); \ + MOVQ BX, h; \ + ADDQ AX, d; \ + ADDQ AX, h + +#define SHA512ROUND0(index, const, a, b, c, d, e, f, g, h) \ + MSGSCHEDULE0(index); \ + SHA512ROUND(index, const, a, b, c, d, e, f, g, h) + +#define SHA512ROUND1(index, const, a, b, c, d, e, f, g, h) \ + MSGSCHEDULE1(index); \ + SHA512ROUND(index, const, a, b, c, d, e, f, g, h) + +TEXT ·block(SB),0,$648-32 + MOVQ p_base+8(FP), SI + MOVQ p_len+16(FP), DX + SHRQ $7, DX + SHLQ $7, DX + + LEAQ (SI)(DX*1), DI + MOVQ DI, 640(SP) + CMPQ SI, DI + JEQ end + + MOVQ dig+0(FP), BP + MOVQ (0*8)(BP), R8 // a = H0 + MOVQ (1*8)(BP), R9 // b = H1 + MOVQ (2*8)(BP), R10 // c = H2 + MOVQ (3*8)(BP), R11 // d = H3 + MOVQ (4*8)(BP), R12 // e = H4 + MOVQ (5*8)(BP), R13 // f = H5 + MOVQ (6*8)(BP), R14 // g = H6 + MOVQ (7*8)(BP), R15 // h = H7 + +loop: + MOVQ SP, BP // message schedule + + SHA512ROUND0(0, 0x428a2f98d728ae22, R8, R9, R10, R11, R12, R13, R14, R15) + SHA512ROUND0(1, 0x7137449123ef65cd, R15, R8, R9, R10, R11, R12, R13, R14) + SHA512ROUND0(2, 0xb5c0fbcfec4d3b2f, R14, R15, R8, R9, R10, R11, R12, R13) + SHA512ROUND0(3, 0xe9b5dba58189dbbc, R13, R14, R15, R8, R9, R10, R11, R12) + SHA512ROUND0(4, 0x3956c25bf348b538, R12, R13, R14, R15, R8, R9, R10, R11) + SHA512ROUND0(5, 0x59f111f1b605d019, R11, R12, R13, R14, R15, R8, R9, R10) + SHA512ROUND0(6, 0x923f82a4af194f9b, R10, R11, R12, R13, R14, R15, R8, R9) + SHA512ROUND0(7, 0xab1c5ed5da6d8118, R9, R10, R11, R12, R13, R14, R15, R8) + SHA512ROUND0(8, 0xd807aa98a3030242, R8, R9, R10, R11, R12, R13, R14, R15) + SHA512ROUND0(9, 0x12835b0145706fbe, R15, R8, R9, R10, R11, R12, R13, R14) + SHA512ROUND0(10, 0x243185be4ee4b28c, R14, R15, R8, R9, R10, R11, R12, R13) + SHA512ROUND0(11, 0x550c7dc3d5ffb4e2, R13, R14, R15, R8, R9, R10, R11, R12) + SHA512ROUND0(12, 0x72be5d74f27b896f, R12, R13, R14, R15, R8, R9, R10, R11) + SHA512ROUND0(13, 0x80deb1fe3b1696b1, R11, R12, R13, R14, R15, R8, R9, R10) + SHA512ROUND0(14, 0x9bdc06a725c71235, R10, R11, R12, R13, R14, R15, R8, R9) + SHA512ROUND0(15, 0xc19bf174cf692694, R9, R10, R11, R12, R13, R14, R15, R8) + + SHA512ROUND1(16, 0xe49b69c19ef14ad2, R8, R9, R10, R11, R12, R13, R14, R15) + SHA512ROUND1(17, 0xefbe4786384f25e3, R15, R8, R9, R10, R11, R12, R13, R14) + SHA512ROUND1(18, 0x0fc19dc68b8cd5b5, R14, R15, R8, R9, R10, R11, R12, R13) + SHA512ROUND1(19, 0x240ca1cc77ac9c65, R13, R14, R15, R8, R9, R10, R11, R12) + SHA512ROUND1(20, 0x2de92c6f592b0275, R12, R13, R14, R15, R8, R9, R10, R11) + SHA512ROUND1(21, 0x4a7484aa6ea6e483, R11, R12, R13, R14, R15, R8, R9, R10) + SHA512ROUND1(22, 0x5cb0a9dcbd41fbd4, R10, R11, R12, R13, R14, R15, R8, R9) + SHA512ROUND1(23, 0x76f988da831153b5, R9, R10, R11, R12, R13, R14, R15, R8) + SHA512ROUND1(24, 0x983e5152ee66dfab, R8, R9, R10, R11, R12, R13, R14, R15) + SHA512ROUND1(25, 0xa831c66d2db43210, R15, R8, R9, R10, R11, R12, R13, R14) + SHA512ROUND1(26, 0xb00327c898fb213f, R14, R15, R8, R9, R10, R11, R12, R13) + SHA512ROUND1(27, 0xbf597fc7beef0ee4, R13, R14, R15, R8, R9, R10, R11, R12) + SHA512ROUND1(28, 0xc6e00bf33da88fc2, R12, R13, R14, R15, R8, R9, R10, R11) + SHA512ROUND1(29, 0xd5a79147930aa725, R11, R12, R13, R14, R15, R8, R9, R10) + SHA512ROUND1(30, 0x06ca6351e003826f, R10, R11, R12, R13, R14, R15, R8, R9) + SHA512ROUND1(31, 0x142929670a0e6e70, R9, R10, R11, R12, R13, R14, R15, R8) + SHA512ROUND1(32, 0x27b70a8546d22ffc, R8, R9, R10, R11, R12, R13, R14, R15) + SHA512ROUND1(33, 0x2e1b21385c26c926, R15, R8, R9, R10, R11, R12, R13, R14) + SHA512ROUND1(34, 0x4d2c6dfc5ac42aed, R14, R15, R8, R9, R10, R11, R12, R13) + SHA512ROUND1(35, 0x53380d139d95b3df, R13, R14, R15, R8, R9, R10, R11, R12) + SHA512ROUND1(36, 0x650a73548baf63de, R12, R13, R14, R15, R8, R9, R10, R11) + SHA512ROUND1(37, 0x766a0abb3c77b2a8, R11, R12, R13, R14, R15, R8, R9, R10) + SHA512ROUND1(38, 0x81c2c92e47edaee6, R10, R11, R12, R13, R14, R15, R8, R9) + SHA512ROUND1(39, 0x92722c851482353b, R9, R10, R11, R12, R13, R14, R15, R8) + SHA512ROUND1(40, 0xa2bfe8a14cf10364, R8, R9, R10, R11, R12, R13, R14, R15) + SHA512ROUND1(41, 0xa81a664bbc423001, R15, R8, R9, R10, R11, R12, R13, R14) + SHA512ROUND1(42, 0xc24b8b70d0f89791, R14, R15, R8, R9, R10, R11, R12, R13) + SHA512ROUND1(43, 0xc76c51a30654be30, R13, R14, R15, R8, R9, R10, R11, R12) + SHA512ROUND1(44, 0xd192e819d6ef5218, R12, R13, R14, R15, R8, R9, R10, R11) + SHA512ROUND1(45, 0xd69906245565a910, R11, R12, R13, R14, R15, R8, R9, R10) + SHA512ROUND1(46, 0xf40e35855771202a, R10, R11, R12, R13, R14, R15, R8, R9) + SHA512ROUND1(47, 0x106aa07032bbd1b8, R9, R10, R11, R12, R13, R14, R15, R8) + SHA512ROUND1(48, 0x19a4c116b8d2d0c8, R8, R9, R10, R11, R12, R13, R14, R15) + SHA512ROUND1(49, 0x1e376c085141ab53, R15, R8, R9, R10, R11, R12, R13, R14) + SHA512ROUND1(50, 0x2748774cdf8eeb99, R14, R15, R8, R9, R10, R11, R12, R13) + SHA512ROUND1(51, 0x34b0bcb5e19b48a8, R13, R14, R15, R8, R9, R10, R11, R12) + SHA512ROUND1(52, 0x391c0cb3c5c95a63, R12, R13, R14, R15, R8, R9, R10, R11) + SHA512ROUND1(53, 0x4ed8aa4ae3418acb, R11, R12, R13, R14, R15, R8, R9, R10) + SHA512ROUND1(54, 0x5b9cca4f7763e373, R10, R11, R12, R13, R14, R15, R8, R9) + SHA512ROUND1(55, 0x682e6ff3d6b2b8a3, R9, R10, R11, R12, R13, R14, R15, R8) + SHA512ROUND1(56, 0x748f82ee5defb2fc, R8, R9, R10, R11, R12, R13, R14, R15) + SHA512ROUND1(57, 0x78a5636f43172f60, R15, R8, R9, R10, R11, R12, R13, R14) + SHA512ROUND1(58, 0x84c87814a1f0ab72, R14, R15, R8, R9, R10, R11, R12, R13) + SHA512ROUND1(59, 0x8cc702081a6439ec, R13, R14, R15, R8, R9, R10, R11, R12) + SHA512ROUND1(60, 0x90befffa23631e28, R12, R13, R14, R15, R8, R9, R10, R11) + SHA512ROUND1(61, 0xa4506cebde82bde9, R11, R12, R13, R14, R15, R8, R9, R10) + SHA512ROUND1(62, 0xbef9a3f7b2c67915, R10, R11, R12, R13, R14, R15, R8, R9) + SHA512ROUND1(63, 0xc67178f2e372532b, R9, R10, R11, R12, R13, R14, R15, R8) + SHA512ROUND1(64, 0xca273eceea26619c, R8, R9, R10, R11, R12, R13, R14, R15) + SHA512ROUND1(65, 0xd186b8c721c0c207, R15, R8, R9, R10, R11, R12, R13, R14) + SHA512ROUND1(66, 0xeada7dd6cde0eb1e, R14, R15, R8, R9, R10, R11, R12, R13) + SHA512ROUND1(67, 0xf57d4f7fee6ed178, R13, R14, R15, R8, R9, R10, R11, R12) + SHA512ROUND1(68, 0x06f067aa72176fba, R12, R13, R14, R15, R8, R9, R10, R11) + SHA512ROUND1(69, 0x0a637dc5a2c898a6, R11, R12, R13, R14, R15, R8, R9, R10) + SHA512ROUND1(70, 0x113f9804bef90dae, R10, R11, R12, R13, R14, R15, R8, R9) + SHA512ROUND1(71, 0x1b710b35131c471b, R9, R10, R11, R12, R13, R14, R15, R8) + SHA512ROUND1(72, 0x28db77f523047d84, R8, R9, R10, R11, R12, R13, R14, R15) + SHA512ROUND1(73, 0x32caab7b40c72493, R15, R8, R9, R10, R11, R12, R13, R14) + SHA512ROUND1(74, 0x3c9ebe0a15c9bebc, R14, R15, R8, R9, R10, R11, R12, R13) + SHA512ROUND1(75, 0x431d67c49c100d4c, R13, R14, R15, R8, R9, R10, R11, R12) + SHA512ROUND1(76, 0x4cc5d4becb3e42b6, R12, R13, R14, R15, R8, R9, R10, R11) + SHA512ROUND1(77, 0x597f299cfc657e2a, R11, R12, R13, R14, R15, R8, R9, R10) + SHA512ROUND1(78, 0x5fcb6fab3ad6faec, R10, R11, R12, R13, R14, R15, R8, R9) + SHA512ROUND1(79, 0x6c44198c4a475817, R9, R10, R11, R12, R13, R14, R15, R8) + + MOVQ dig+0(FP), BP + ADDQ (0*8)(BP), R8 // H0 = a + H0 + MOVQ R8, (0*8)(BP) + ADDQ (1*8)(BP), R9 // H1 = b + H1 + MOVQ R9, (1*8)(BP) + ADDQ (2*8)(BP), R10 // H2 = c + H2 + MOVQ R10, (2*8)(BP) + ADDQ (3*8)(BP), R11 // H3 = d + H3 + MOVQ R11, (3*8)(BP) + ADDQ (4*8)(BP), R12 // H4 = e + H4 + MOVQ R12, (4*8)(BP) + ADDQ (5*8)(BP), R13 // H5 = f + H5 + MOVQ R13, (5*8)(BP) + ADDQ (6*8)(BP), R14 // H6 = g + H6 + MOVQ R14, (6*8)(BP) + ADDQ (7*8)(BP), R15 // H7 = h + H7 + MOVQ R15, (7*8)(BP) + + ADDQ $128, SI + CMPQ SI, 640(SP) + JB loop + +end: + RET diff --git a/src/crypto/sha512/sha512block_decl.go b/src/crypto/sha512/sha512block_decl.go new file mode 100644 index 0000000000000000000000000000000000000000..bef99de2e46148f85ce7f3b24c74a7f91ee72666 --- /dev/null +++ b/src/crypto/sha512/sha512block_decl.go @@ -0,0 +1,11 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build amd64 + +package sha512 + +//go:noescape + +func block(dig *digest, p []byte) diff --git a/src/crypto/subtle/constant_time.go b/src/crypto/subtle/constant_time.go new file mode 100644 index 0000000000000000000000000000000000000000..6f80e7c58dc3c8d551b05c8a171b3da9fed6b006 --- /dev/null +++ b/src/crypto/subtle/constant_time.go @@ -0,0 +1,73 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package subtle implements functions that are often useful in cryptographic +// code but require careful thought to use correctly. +package subtle + +// ConstantTimeCompare returns 1 iff the two slices, x +// and y, have equal contents. The time taken is a function of the length of +// the slices and is independent of the contents. +func ConstantTimeCompare(x, y []byte) int { + if len(x) != len(y) { + return 0 + } + + var v byte + + for i := 0; i < len(x); i++ { + v |= x[i] ^ y[i] + } + + return ConstantTimeByteEq(v, 0) +} + +// ConstantTimeSelect returns x if v is 1 and y if v is 0. +// Its behavior is undefined if v takes any other value. +func ConstantTimeSelect(v, x, y int) int { return ^(v-1)&x | (v-1)&y } + +// ConstantTimeByteEq returns 1 if x == y and 0 otherwise. +func ConstantTimeByteEq(x, y uint8) int { + z := ^(x ^ y) + z &= z >> 4 + z &= z >> 2 + z &= z >> 1 + + return int(z) +} + +// ConstantTimeEq returns 1 if x == y and 0 otherwise. +func ConstantTimeEq(x, y int32) int { + z := ^(x ^ y) + z &= z >> 16 + z &= z >> 8 + z &= z >> 4 + z &= z >> 2 + z &= z >> 1 + + return int(z & 1) +} + +// ConstantTimeCopy copies the contents of y into x (a slice of equal length) +// if v == 1. If v == 0, x is left unchanged. Its behavior is undefined if v +// takes any other value. +func ConstantTimeCopy(v int, x, y []byte) { + if len(x) != len(y) { + panic("subtle: slices have different lengths") + } + + xmask := byte(v - 1) + ymask := byte(^(v - 1)) + for i := 0; i < len(x); i++ { + x[i] = x[i]&xmask | y[i]&ymask + } +} + +// ConstantTimeLessOrEq returns 1 if x <= y and 0 otherwise. +// Its behavior is undefined if x or y are negative or > 2**31 - 1. +func ConstantTimeLessOrEq(x, y int) int { + x32 := int32(x) + y32 := int32(y) + return int(((x32 - y32 - 1) >> 31) & 1) +} diff --git a/src/crypto/subtle/constant_time_test.go b/src/crypto/subtle/constant_time_test.go new file mode 100644 index 0000000000000000000000000000000000000000..619a454441d9570d3e10a1a930dbbdb95c657676 --- /dev/null +++ b/src/crypto/subtle/constant_time_test.go @@ -0,0 +1,127 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package subtle + +import ( + "testing" + "testing/quick" +) + +type TestConstantTimeCompareStruct struct { + a, b []byte + out int +} + +var testConstantTimeCompareData = []TestConstantTimeCompareStruct{ + {[]byte{}, []byte{}, 1}, + {[]byte{0x11}, []byte{0x11}, 1}, + {[]byte{0x12}, []byte{0x11}, 0}, + {[]byte{0x11}, []byte{0x11, 0x12}, 0}, + {[]byte{0x11, 0x12}, []byte{0x11}, 0}, +} + +func TestConstantTimeCompare(t *testing.T) { + for i, test := range testConstantTimeCompareData { + if r := ConstantTimeCompare(test.a, test.b); r != test.out { + t.Errorf("#%d bad result (got %x, want %x)", i, r, test.out) + } + } +} + +type TestConstantTimeByteEqStruct struct { + a, b uint8 + out int +} + +var testConstandTimeByteEqData = []TestConstantTimeByteEqStruct{ + {0, 0, 1}, + {0, 1, 0}, + {1, 0, 0}, + {0xff, 0xff, 1}, + {0xff, 0xfe, 0}, +} + +func byteEq(a, b uint8) int { + if a == b { + return 1 + } + return 0 +} + +func TestConstantTimeByteEq(t *testing.T) { + for i, test := range testConstandTimeByteEqData { + if r := ConstantTimeByteEq(test.a, test.b); r != test.out { + t.Errorf("#%d bad result (got %x, want %x)", i, r, test.out) + } + } + err := quick.CheckEqual(ConstantTimeByteEq, byteEq, nil) + if err != nil { + t.Error(err) + } +} + +func eq(a, b int32) int { + if a == b { + return 1 + } + return 0 +} + +func TestConstantTimeEq(t *testing.T) { + err := quick.CheckEqual(ConstantTimeEq, eq, nil) + if err != nil { + t.Error(err) + } +} + +func makeCopy(v int, x, y []byte) []byte { + if len(x) > len(y) { + x = x[0:len(y)] + } else { + y = y[0:len(x)] + } + if v == 1 { + copy(x, y) + } + return x +} + +func constantTimeCopyWrapper(v int, x, y []byte) []byte { + if len(x) > len(y) { + x = x[0:len(y)] + } else { + y = y[0:len(x)] + } + v &= 1 + ConstantTimeCopy(v, x, y) + return x +} + +func TestConstantTimeCopy(t *testing.T) { + err := quick.CheckEqual(constantTimeCopyWrapper, makeCopy, nil) + if err != nil { + t.Error(err) + } +} + +var lessOrEqTests = []struct { + x, y, result int +}{ + {0, 0, 1}, + {1, 0, 0}, + {0, 1, 1}, + {10, 20, 1}, + {20, 10, 0}, + {10, 10, 1}, +} + +func TestConstantTimeLessOrEq(t *testing.T) { + for i, test := range lessOrEqTests { + result := ConstantTimeLessOrEq(test.x, test.y) + if result != test.result { + t.Errorf("#%d: %d <= %d gave %d, expected %d", i, test.x, test.y, result, test.result) + } + } +} diff --git a/src/crypto/tls/alert.go b/src/crypto/tls/alert.go new file mode 100644 index 0000000000000000000000000000000000000000..3de4834d3f5b83ec3165396788345bd6fe612c0b --- /dev/null +++ b/src/crypto/tls/alert.go @@ -0,0 +1,79 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package tls + +import "strconv" + +type alert uint8 + +const ( + // alert level + alertLevelWarning = 1 + alertLevelError = 2 +) + +const ( + alertCloseNotify alert = 0 + alertUnexpectedMessage alert = 10 + alertBadRecordMAC alert = 20 + alertDecryptionFailed alert = 21 + alertRecordOverflow alert = 22 + alertDecompressionFailure alert = 30 + alertHandshakeFailure alert = 40 + alertBadCertificate alert = 42 + alertUnsupportedCertificate alert = 43 + alertCertificateRevoked alert = 44 + alertCertificateExpired alert = 45 + alertCertificateUnknown alert = 46 + alertIllegalParameter alert = 47 + alertUnknownCA alert = 48 + alertAccessDenied alert = 49 + alertDecodeError alert = 50 + alertDecryptError alert = 51 + alertProtocolVersion alert = 70 + alertInsufficientSecurity alert = 71 + alertInternalError alert = 80 + alertInappropriateFallback alert = 86 + alertUserCanceled alert = 90 + alertNoRenegotiation alert = 100 +) + +var alertText = map[alert]string{ + alertCloseNotify: "close notify", + alertUnexpectedMessage: "unexpected message", + alertBadRecordMAC: "bad record MAC", + alertDecryptionFailed: "decryption failed", + alertRecordOverflow: "record overflow", + alertDecompressionFailure: "decompression failure", + alertHandshakeFailure: "handshake failure", + alertBadCertificate: "bad certificate", + alertUnsupportedCertificate: "unsupported certificate", + alertCertificateRevoked: "revoked certificate", + alertCertificateExpired: "expired certificate", + alertCertificateUnknown: "unknown certificate", + alertIllegalParameter: "illegal parameter", + alertUnknownCA: "unknown certificate authority", + alertAccessDenied: "access denied", + alertDecodeError: "error decoding message", + alertDecryptError: "error decrypting message", + alertProtocolVersion: "protocol version not supported", + alertInsufficientSecurity: "insufficient security level", + alertInternalError: "internal error", + alertInappropriateFallback: "inappropriate fallback", + alertUserCanceled: "user canceled", + alertNoRenegotiation: "no renegotiation", +} + +func (e alert) String() string { + s, ok := alertText[e] + if ok { + return s + } + return "alert(" + strconv.Itoa(int(e)) + ")" +} + +func (e alert) Error() string { + return e.String() +} diff --git a/src/crypto/tls/cipher_suites.go b/src/crypto/tls/cipher_suites.go new file mode 100644 index 0000000000000000000000000000000000000000..a5fed29375243eda07383e11dbb503328faf0bc5 --- /dev/null +++ b/src/crypto/tls/cipher_suites.go @@ -0,0 +1,285 @@ +// Copyright 2010 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package tls + +import ( + "crypto/aes" + "crypto/cipher" + "crypto/des" + "crypto/hmac" + "crypto/rc4" + "crypto/sha1" + "crypto/x509" + "hash" +) + +// a keyAgreement implements the client and server side of a TLS key agreement +// protocol by generating and processing key exchange messages. +type keyAgreement interface { + // On the server side, the first two methods are called in order. + + // In the case that the key agreement protocol doesn't use a + // ServerKeyExchange message, generateServerKeyExchange can return nil, + // nil. + generateServerKeyExchange(*Config, *Certificate, *clientHelloMsg, *serverHelloMsg) (*serverKeyExchangeMsg, error) + processClientKeyExchange(*Config, *Certificate, *clientKeyExchangeMsg, uint16) ([]byte, error) + + // On the client side, the next two methods are called in order. + + // This method may not be called if the server doesn't send a + // ServerKeyExchange message. + processServerKeyExchange(*Config, *clientHelloMsg, *serverHelloMsg, *x509.Certificate, *serverKeyExchangeMsg) error + generateClientKeyExchange(*Config, *clientHelloMsg, *x509.Certificate) ([]byte, *clientKeyExchangeMsg, error) +} + +const ( + // suiteECDH indicates that the cipher suite involves elliptic curve + // Diffie-Hellman. This means that it should only be selected when the + // client indicates that it supports ECC with a curve and point format + // that we're happy with. + suiteECDHE = 1 << iota + // suiteECDSA indicates that the cipher suite involves an ECDSA + // signature and therefore may only be selected when the server's + // certificate is ECDSA. If this is not set then the cipher suite is + // RSA based. + suiteECDSA + // suiteTLS12 indicates that the cipher suite should only be advertised + // and accepted when using TLS 1.2. + suiteTLS12 + // suiteSHA384 indicates that the cipher suite uses SHA384 as the + // handshake hash. + suiteSHA384 + // suiteDefaultOff indicates that this cipher suite is not included by + // default. + suiteDefaultOff +) + +// A cipherSuite is a specific combination of key agreement, cipher and MAC +// function. All cipher suites currently assume RSA key agreement. +type cipherSuite struct { + id uint16 + // the lengths, in bytes, of the key material needed for each component. + keyLen int + macLen int + ivLen int + ka func(version uint16) keyAgreement + // flags is a bitmask of the suite* values, above. + flags int + cipher func(key, iv []byte, isRead bool) interface{} + mac func(version uint16, macKey []byte) macFunction + aead func(key, fixedNonce []byte) cipher.AEAD +} + +var cipherSuites = []*cipherSuite{ + // Ciphersuite order is chosen so that ECDHE comes before plain RSA + // and RC4 comes before AES (because of the Lucky13 attack). + {TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, 16, 0, 4, ecdheRSAKA, suiteECDHE | suiteTLS12, nil, nil, aeadAESGCM}, + {TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, 16, 0, 4, ecdheECDSAKA, suiteECDHE | suiteECDSA | suiteTLS12, nil, nil, aeadAESGCM}, + {TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384, 32, 0, 4, ecdheRSAKA, suiteECDHE | suiteTLS12 | suiteSHA384, nil, nil, aeadAESGCM}, + {TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384, 32, 0, 4, ecdheECDSAKA, suiteECDHE | suiteECDSA | suiteTLS12 | suiteSHA384, nil, nil, aeadAESGCM}, + {TLS_ECDHE_RSA_WITH_RC4_128_SHA, 16, 20, 0, ecdheRSAKA, suiteECDHE | suiteDefaultOff, cipherRC4, macSHA1, nil}, + {TLS_ECDHE_ECDSA_WITH_RC4_128_SHA, 16, 20, 0, ecdheECDSAKA, suiteECDHE | suiteECDSA | suiteDefaultOff, cipherRC4, macSHA1, nil}, + {TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, 16, 20, 16, ecdheRSAKA, suiteECDHE, cipherAES, macSHA1, nil}, + {TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, 16, 20, 16, ecdheECDSAKA, suiteECDHE | suiteECDSA, cipherAES, macSHA1, nil}, + {TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, 32, 20, 16, ecdheRSAKA, suiteECDHE, cipherAES, macSHA1, nil}, + {TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, 32, 20, 16, ecdheECDSAKA, suiteECDHE | suiteECDSA, cipherAES, macSHA1, nil}, + {TLS_RSA_WITH_RC4_128_SHA, 16, 20, 0, rsaKA, suiteDefaultOff, cipherRC4, macSHA1, nil}, + {TLS_RSA_WITH_AES_128_CBC_SHA, 16, 20, 16, rsaKA, 0, cipherAES, macSHA1, nil}, + {TLS_RSA_WITH_AES_256_CBC_SHA, 32, 20, 16, rsaKA, 0, cipherAES, macSHA1, nil}, + {TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA, 24, 20, 8, ecdheRSAKA, suiteECDHE, cipher3DES, macSHA1, nil}, + {TLS_RSA_WITH_3DES_EDE_CBC_SHA, 24, 20, 8, rsaKA, 0, cipher3DES, macSHA1, nil}, +} + +func cipherRC4(key, iv []byte, isRead bool) interface{} { + cipher, _ := rc4.NewCipher(key) + return cipher +} + +func cipher3DES(key, iv []byte, isRead bool) interface{} { + block, _ := des.NewTripleDESCipher(key) + if isRead { + return cipher.NewCBCDecrypter(block, iv) + } + return cipher.NewCBCEncrypter(block, iv) +} + +func cipherAES(key, iv []byte, isRead bool) interface{} { + block, _ := aes.NewCipher(key) + if isRead { + return cipher.NewCBCDecrypter(block, iv) + } + return cipher.NewCBCEncrypter(block, iv) +} + +// macSHA1 returns a macFunction for the given protocol version. +func macSHA1(version uint16, key []byte) macFunction { + if version == VersionSSL30 { + mac := ssl30MAC{ + h: sha1.New(), + key: make([]byte, len(key)), + } + copy(mac.key, key) + return mac + } + return tls10MAC{hmac.New(sha1.New, key)} +} + +type macFunction interface { + Size() int + MAC(digestBuf, seq, header, data []byte) []byte +} + +// fixedNonceAEAD wraps an AEAD and prefixes a fixed portion of the nonce to +// each call. +type fixedNonceAEAD struct { + // sealNonce and openNonce are buffers where the larger nonce will be + // constructed. Since a seal and open operation may be running + // concurrently, there is a separate buffer for each. + sealNonce, openNonce []byte + aead cipher.AEAD +} + +func (f *fixedNonceAEAD) NonceSize() int { return 8 } +func (f *fixedNonceAEAD) Overhead() int { return f.aead.Overhead() } + +func (f *fixedNonceAEAD) Seal(out, nonce, plaintext, additionalData []byte) []byte { + copy(f.sealNonce[len(f.sealNonce)-8:], nonce) + return f.aead.Seal(out, f.sealNonce, plaintext, additionalData) +} + +func (f *fixedNonceAEAD) Open(out, nonce, plaintext, additionalData []byte) ([]byte, error) { + copy(f.openNonce[len(f.openNonce)-8:], nonce) + return f.aead.Open(out, f.openNonce, plaintext, additionalData) +} + +func aeadAESGCM(key, fixedNonce []byte) cipher.AEAD { + aes, err := aes.NewCipher(key) + if err != nil { + panic(err) + } + aead, err := cipher.NewGCM(aes) + if err != nil { + panic(err) + } + + nonce1, nonce2 := make([]byte, 12), make([]byte, 12) + copy(nonce1, fixedNonce) + copy(nonce2, fixedNonce) + + return &fixedNonceAEAD{nonce1, nonce2, aead} +} + +// ssl30MAC implements the SSLv3 MAC function, as defined in +// www.mozilla.org/projects/security/pki/nss/ssl/draft302.txt section 5.2.3.1 +type ssl30MAC struct { + h hash.Hash + key []byte +} + +func (s ssl30MAC) Size() int { + return s.h.Size() +} + +var ssl30Pad1 = [48]byte{0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36} + +var ssl30Pad2 = [48]byte{0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c} + +func (s ssl30MAC) MAC(digestBuf, seq, header, data []byte) []byte { + padLength := 48 + if s.h.Size() == 20 { + padLength = 40 + } + + s.h.Reset() + s.h.Write(s.key) + s.h.Write(ssl30Pad1[:padLength]) + s.h.Write(seq) + s.h.Write(header[:1]) + s.h.Write(header[3:5]) + s.h.Write(data) + digestBuf = s.h.Sum(digestBuf[:0]) + + s.h.Reset() + s.h.Write(s.key) + s.h.Write(ssl30Pad2[:padLength]) + s.h.Write(digestBuf) + return s.h.Sum(digestBuf[:0]) +} + +// tls10MAC implements the TLS 1.0 MAC function. RFC 2246, section 6.2.3. +type tls10MAC struct { + h hash.Hash +} + +func (s tls10MAC) Size() int { + return s.h.Size() +} + +func (s tls10MAC) MAC(digestBuf, seq, header, data []byte) []byte { + s.h.Reset() + s.h.Write(seq) + s.h.Write(header) + s.h.Write(data) + return s.h.Sum(digestBuf[:0]) +} + +func rsaKA(version uint16) keyAgreement { + return rsaKeyAgreement{} +} + +func ecdheECDSAKA(version uint16) keyAgreement { + return &ecdheKeyAgreement{ + sigType: signatureECDSA, + version: version, + } +} + +func ecdheRSAKA(version uint16) keyAgreement { + return &ecdheKeyAgreement{ + sigType: signatureRSA, + version: version, + } +} + +// mutualCipherSuite returns a cipherSuite given a list of supported +// ciphersuites and the id requested by the peer. +func mutualCipherSuite(have []uint16, want uint16) *cipherSuite { + for _, id := range have { + if id == want { + for _, suite := range cipherSuites { + if suite.id == want { + return suite + } + } + return nil + } + } + return nil +} + +// A list of the possible cipher suite ids. Taken from +// http://www.iana.org/assignments/tls-parameters/tls-parameters.xml +const ( + TLS_RSA_WITH_RC4_128_SHA uint16 = 0x0005 + TLS_RSA_WITH_3DES_EDE_CBC_SHA uint16 = 0x000a + TLS_RSA_WITH_AES_128_CBC_SHA uint16 = 0x002f + TLS_RSA_WITH_AES_256_CBC_SHA uint16 = 0x0035 + TLS_ECDHE_ECDSA_WITH_RC4_128_SHA uint16 = 0xc007 + TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA uint16 = 0xc009 + TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA uint16 = 0xc00a + TLS_ECDHE_RSA_WITH_RC4_128_SHA uint16 = 0xc011 + TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA uint16 = 0xc012 + TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA uint16 = 0xc013 + TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA uint16 = 0xc014 + TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 uint16 = 0xc02f + TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 uint16 = 0xc02b + TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 uint16 = 0xc030 + TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 uint16 = 0xc02c + + // TLS_FALLBACK_SCSV isn't a standard cipher suite but an indicator + // that the client is doing version fallback. See + // https://tools.ietf.org/html/draft-ietf-tls-downgrade-scsv-00. + TLS_FALLBACK_SCSV uint16 = 0x5600 +) diff --git a/src/crypto/tls/common.go b/src/crypto/tls/common.go new file mode 100644 index 0000000000000000000000000000000000000000..a3d75d69cbfadf33acc4a6726cd0f340c799f32f --- /dev/null +++ b/src/crypto/tls/common.go @@ -0,0 +1,712 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package tls + +import ( + "container/list" + "crypto" + "crypto/rand" + "crypto/sha512" + "crypto/x509" + "errors" + "fmt" + "io" + "math/big" + "strings" + "sync" + "time" +) + +const ( + VersionSSL30 = 0x0300 + VersionTLS10 = 0x0301 + VersionTLS11 = 0x0302 + VersionTLS12 = 0x0303 +) + +const ( + maxPlaintext = 16384 // maximum plaintext payload length + maxCiphertext = 16384 + 2048 // maximum ciphertext payload length + recordHeaderLen = 5 // record header length + maxHandshake = 65536 // maximum handshake we support (protocol max is 16 MB) + + minVersion = VersionTLS10 + maxVersion = VersionTLS12 +) + +// TLS record types. +type recordType uint8 + +const ( + recordTypeChangeCipherSpec recordType = 20 + recordTypeAlert recordType = 21 + recordTypeHandshake recordType = 22 + recordTypeApplicationData recordType = 23 +) + +// TLS handshake message types. +const ( + typeClientHello uint8 = 1 + typeServerHello uint8 = 2 + typeNewSessionTicket uint8 = 4 + typeCertificate uint8 = 11 + typeServerKeyExchange uint8 = 12 + typeCertificateRequest uint8 = 13 + typeServerHelloDone uint8 = 14 + typeCertificateVerify uint8 = 15 + typeClientKeyExchange uint8 = 16 + typeFinished uint8 = 20 + typeCertificateStatus uint8 = 22 + typeNextProtocol uint8 = 67 // Not IANA assigned +) + +// TLS compression types. +const ( + compressionNone uint8 = 0 +) + +// TLS extension numbers +const ( + extensionServerName uint16 = 0 + extensionStatusRequest uint16 = 5 + extensionSupportedCurves uint16 = 10 + extensionSupportedPoints uint16 = 11 + extensionSignatureAlgorithms uint16 = 13 + extensionALPN uint16 = 16 + extensionSCT uint16 = 18 // https://tools.ietf.org/html/rfc6962#section-6 + extensionSessionTicket uint16 = 35 + extensionNextProtoNeg uint16 = 13172 // not IANA assigned + extensionRenegotiationInfo uint16 = 0xff01 +) + +// TLS signaling cipher suite values +const ( + scsvRenegotiation uint16 = 0x00ff +) + +// CurveID is the type of a TLS identifier for an elliptic curve. See +// http://www.iana.org/assignments/tls-parameters/tls-parameters.xml#tls-parameters-8 +type CurveID uint16 + +const ( + CurveP256 CurveID = 23 + CurveP384 CurveID = 24 + CurveP521 CurveID = 25 +) + +// TLS Elliptic Curve Point Formats +// http://www.iana.org/assignments/tls-parameters/tls-parameters.xml#tls-parameters-9 +const ( + pointFormatUncompressed uint8 = 0 +) + +// TLS CertificateStatusType (RFC 3546) +const ( + statusTypeOCSP uint8 = 1 +) + +// Certificate types (for certificateRequestMsg) +const ( + certTypeRSASign = 1 // A certificate containing an RSA key + certTypeDSSSign = 2 // A certificate containing a DSA key + certTypeRSAFixedDH = 3 // A certificate containing a static DH key + certTypeDSSFixedDH = 4 // A certificate containing a static DH key + + // See RFC4492 sections 3 and 5.5. + certTypeECDSASign = 64 // A certificate containing an ECDSA-capable public key, signed with ECDSA. + certTypeRSAFixedECDH = 65 // A certificate containing an ECDH-capable public key, signed with RSA. + certTypeECDSAFixedECDH = 66 // A certificate containing an ECDH-capable public key, signed with ECDSA. + + // Rest of these are reserved by the TLS spec +) + +// Hash functions for TLS 1.2 (See RFC 5246, section A.4.1) +const ( + hashSHA1 uint8 = 2 + hashSHA256 uint8 = 4 + hashSHA384 uint8 = 5 +) + +// Signature algorithms for TLS 1.2 (See RFC 5246, section A.4.1) +const ( + signatureRSA uint8 = 1 + signatureECDSA uint8 = 3 +) + +// signatureAndHash mirrors the TLS 1.2, SignatureAndHashAlgorithm struct. See +// RFC 5246, section A.4.1. +type signatureAndHash struct { + hash, signature uint8 +} + +// supportedSignatureAlgorithms contains the signature and hash algorithms that +// the code advertises as supported in a TLS 1.2 ClientHello and in a TLS 1.2 +// CertificateRequest. +var supportedSignatureAlgorithms = []signatureAndHash{ + {hashSHA256, signatureRSA}, + {hashSHA256, signatureECDSA}, + {hashSHA384, signatureRSA}, + {hashSHA384, signatureECDSA}, + {hashSHA1, signatureRSA}, + {hashSHA1, signatureECDSA}, +} + +// ConnectionState records basic TLS details about the connection. +type ConnectionState struct { + Version uint16 // TLS version used by the connection (e.g. VersionTLS12) + HandshakeComplete bool // TLS handshake is complete + DidResume bool // connection resumes a previous TLS connection + CipherSuite uint16 // cipher suite in use (TLS_RSA_WITH_RC4_128_SHA, ...) + NegotiatedProtocol string // negotiated next protocol (from Config.NextProtos) + NegotiatedProtocolIsMutual bool // negotiated protocol was advertised by server + ServerName string // server name requested by client, if any (server side only) + PeerCertificates []*x509.Certificate // certificate chain presented by remote peer + VerifiedChains [][]*x509.Certificate // verified chains built from PeerCertificates + SignedCertificateTimestamps [][]byte // SCTs from the server, if any + OCSPResponse []byte // stapled OCSP response from server, if any + + // TLSUnique contains the "tls-unique" channel binding value (see RFC + // 5929, section 3). For resumed sessions this value will be nil + // because resumption does not include enough context (see + // https://secure-resumption.com/#channelbindings). This will change in + // future versions of Go once the TLS master-secret fix has been + // standardized and implemented. + TLSUnique []byte +} + +// ClientAuthType declares the policy the server will follow for +// TLS Client Authentication. +type ClientAuthType int + +const ( + NoClientCert ClientAuthType = iota + RequestClientCert + RequireAnyClientCert + VerifyClientCertIfGiven + RequireAndVerifyClientCert +) + +// ClientSessionState contains the state needed by clients to resume TLS +// sessions. +type ClientSessionState struct { + sessionTicket []uint8 // Encrypted ticket used for session resumption with server + vers uint16 // SSL/TLS version negotiated for the session + cipherSuite uint16 // Ciphersuite negotiated for the session + masterSecret []byte // MasterSecret generated by client on a full handshake + serverCertificates []*x509.Certificate // Certificate chain presented by the server + verifiedChains [][]*x509.Certificate // Certificate chains we built for verification +} + +// ClientSessionCache is a cache of ClientSessionState objects that can be used +// by a client to resume a TLS session with a given server. ClientSessionCache +// implementations should expect to be called concurrently from different +// goroutines. +type ClientSessionCache interface { + // Get searches for a ClientSessionState associated with the given key. + // On return, ok is true if one was found. + Get(sessionKey string) (session *ClientSessionState, ok bool) + + // Put adds the ClientSessionState to the cache with the given key. + Put(sessionKey string, cs *ClientSessionState) +} + +// ClientHelloInfo contains information from a ClientHello message in order to +// guide certificate selection in the GetCertificate callback. +type ClientHelloInfo struct { + // CipherSuites lists the CipherSuites supported by the client (e.g. + // TLS_RSA_WITH_RC4_128_SHA). + CipherSuites []uint16 + + // ServerName indicates the name of the server requested by the client + // in order to support virtual hosting. ServerName is only set if the + // client is using SNI (see + // http://tools.ietf.org/html/rfc4366#section-3.1). + ServerName string + + // SupportedCurves lists the elliptic curves supported by the client. + // SupportedCurves is set only if the Supported Elliptic Curves + // Extension is being used (see + // http://tools.ietf.org/html/rfc4492#section-5.1.1). + SupportedCurves []CurveID + + // SupportedPoints lists the point formats supported by the client. + // SupportedPoints is set only if the Supported Point Formats Extension + // is being used (see + // http://tools.ietf.org/html/rfc4492#section-5.1.2). + SupportedPoints []uint8 +} + +// A Config structure is used to configure a TLS client or server. +// After one has been passed to a TLS function it must not be +// modified. A Config may be reused; the tls package will also not +// modify it. +type Config struct { + // Rand provides the source of entropy for nonces and RSA blinding. + // If Rand is nil, TLS uses the cryptographic random reader in package + // crypto/rand. + // The Reader must be safe for use by multiple goroutines. + Rand io.Reader + + // Time returns the current time as the number of seconds since the epoch. + // If Time is nil, TLS uses time.Now. + Time func() time.Time + + // Certificates contains one or more certificate chains + // to present to the other side of the connection. + // Server configurations must include at least one certificate. + Certificates []Certificate + + // NameToCertificate maps from a certificate name to an element of + // Certificates. Note that a certificate name can be of the form + // '*.example.com' and so doesn't have to be a domain name as such. + // See Config.BuildNameToCertificate + // The nil value causes the first element of Certificates to be used + // for all connections. + NameToCertificate map[string]*Certificate + + // GetCertificate returns a Certificate based on the given + // ClientHelloInfo. It will only be called if the client supplies SNI + // information or if Certificates is empty. + // + // If GetCertificate is nil or returns nil, then the certificate is + // retrieved from NameToCertificate. If NameToCertificate is nil, the + // first element of Certificates will be used. + GetCertificate func(clientHello *ClientHelloInfo) (*Certificate, error) + + // RootCAs defines the set of root certificate authorities + // that clients use when verifying server certificates. + // If RootCAs is nil, TLS uses the host's root CA set. + RootCAs *x509.CertPool + + // NextProtos is a list of supported, application level protocols. + NextProtos []string + + // ServerName is used to verify the hostname on the returned + // certificates unless InsecureSkipVerify is given. It is also included + // in the client's handshake to support virtual hosting. + ServerName string + + // ClientAuth determines the server's policy for + // TLS Client Authentication. The default is NoClientCert. + ClientAuth ClientAuthType + + // ClientCAs defines the set of root certificate authorities + // that servers use if required to verify a client certificate + // by the policy in ClientAuth. + ClientCAs *x509.CertPool + + // InsecureSkipVerify controls whether a client verifies the + // server's certificate chain and host name. + // If InsecureSkipVerify is true, TLS accepts any certificate + // presented by the server and any host name in that certificate. + // In this mode, TLS is susceptible to man-in-the-middle attacks. + // This should be used only for testing. + InsecureSkipVerify bool + + // CipherSuites is a list of supported cipher suites. If CipherSuites + // is nil, TLS uses a list of suites supported by the implementation. + CipherSuites []uint16 + + // PreferServerCipherSuites controls whether the server selects the + // client's most preferred ciphersuite, or the server's most preferred + // ciphersuite. If true then the server's preference, as expressed in + // the order of elements in CipherSuites, is used. + PreferServerCipherSuites bool + + // SessionTicketsDisabled may be set to true to disable session ticket + // (resumption) support. + SessionTicketsDisabled bool + + // SessionTicketKey is used by TLS servers to provide session + // resumption. See RFC 5077. If zero, it will be filled with + // random data before the first server handshake. + // + // If multiple servers are terminating connections for the same host + // they should all have the same SessionTicketKey. If the + // SessionTicketKey leaks, previously recorded and future TLS + // connections using that key are compromised. + SessionTicketKey [32]byte + + // SessionCache is a cache of ClientSessionState entries for TLS session + // resumption. + ClientSessionCache ClientSessionCache + + // MinVersion contains the minimum SSL/TLS version that is acceptable. + // If zero, then TLS 1.0 is taken as the minimum. + MinVersion uint16 + + // MaxVersion contains the maximum SSL/TLS version that is acceptable. + // If zero, then the maximum version supported by this package is used, + // which is currently TLS 1.2. + MaxVersion uint16 + + // CurvePreferences contains the elliptic curves that will be used in + // an ECDHE handshake, in preference order. If empty, the default will + // be used. + CurvePreferences []CurveID + + serverInitOnce sync.Once // guards calling (*Config).serverInit + + // mutex protects sessionTicketKeys + mutex sync.RWMutex + // sessionTicketKeys contains zero or more ticket keys. If the length + // is zero, SessionTicketsDisabled must be true. The first key is used + // for new tickets and any subsequent keys can be used to decrypt old + // tickets. + sessionTicketKeys []ticketKey +} + +// ticketKeyNameLen is the number of bytes of identifier that is prepended to +// an encrypted session ticket in order to identify the key used to encrypt it. +const ticketKeyNameLen = 16 + +// ticketKey is the internal representation of a session ticket key. +type ticketKey struct { + // keyName is an opaque byte string that serves to identify the session + // ticket key. It's exposed as plaintext in every session ticket. + keyName [ticketKeyNameLen]byte + aesKey [16]byte + hmacKey [16]byte +} + +// ticketKeyFromBytes converts from the external representation of a session +// ticket key to a ticketKey. Externally, session ticket keys are 32 random +// bytes and this function expands that into sufficient name and key material. +func ticketKeyFromBytes(b [32]byte) (key ticketKey) { + hashed := sha512.Sum512(b[:]) + copy(key.keyName[:], hashed[:ticketKeyNameLen]) + copy(key.aesKey[:], hashed[ticketKeyNameLen:ticketKeyNameLen+16]) + copy(key.hmacKey[:], hashed[ticketKeyNameLen+16:ticketKeyNameLen+32]) + return key +} + +func (c *Config) serverInit() { + if c.SessionTicketsDisabled { + return + } + + alreadySet := false + for _, b := range c.SessionTicketKey { + if b != 0 { + alreadySet = true + break + } + } + + if !alreadySet { + if _, err := io.ReadFull(c.rand(), c.SessionTicketKey[:]); err != nil { + c.SessionTicketsDisabled = true + return + } + } + + c.sessionTicketKeys = []ticketKey{ticketKeyFromBytes(c.SessionTicketKey)} +} + +func (c *Config) ticketKeys() []ticketKey { + c.mutex.RLock() + // c.sessionTicketKeys is constant once created. SetSessionTicketKeys + // will only update it by replacing it with a new value. + ret := c.sessionTicketKeys + c.mutex.RUnlock() + return ret +} + +// SetSessionTicketKeys updates the session ticket keys for a server. The first +// key will be used when creating new tickets, while all keys can be used for +// decrypting tickets. It is safe to call this function while the server is +// running in order to rotate the session ticket keys. The function will panic +// if keys is empty. +func (c *Config) SetSessionTicketKeys(keys [][32]byte) { + if len(keys) == 0 { + panic("tls: keys must have at least one key") + } + + newKeys := make([]ticketKey, len(keys)) + for i, bytes := range keys { + newKeys[i] = ticketKeyFromBytes(bytes) + } + + c.mutex.Lock() + c.sessionTicketKeys = newKeys + c.mutex.Unlock() +} + +func (c *Config) rand() io.Reader { + r := c.Rand + if r == nil { + return rand.Reader + } + return r +} + +func (c *Config) time() time.Time { + t := c.Time + if t == nil { + t = time.Now + } + return t() +} + +func (c *Config) cipherSuites() []uint16 { + s := c.CipherSuites + if s == nil { + s = defaultCipherSuites() + } + return s +} + +func (c *Config) minVersion() uint16 { + if c == nil || c.MinVersion == 0 { + return minVersion + } + return c.MinVersion +} + +func (c *Config) maxVersion() uint16 { + if c == nil || c.MaxVersion == 0 { + return maxVersion + } + return c.MaxVersion +} + +var defaultCurvePreferences = []CurveID{CurveP256, CurveP384, CurveP521} + +func (c *Config) curvePreferences() []CurveID { + if c == nil || len(c.CurvePreferences) == 0 { + return defaultCurvePreferences + } + return c.CurvePreferences +} + +// mutualVersion returns the protocol version to use given the advertised +// version of the peer. +func (c *Config) mutualVersion(vers uint16) (uint16, bool) { + minVersion := c.minVersion() + maxVersion := c.maxVersion() + + if vers < minVersion { + return 0, false + } + if vers > maxVersion { + vers = maxVersion + } + return vers, true +} + +// getCertificate returns the best certificate for the given ClientHelloInfo, +// defaulting to the first element of c.Certificates. +func (c *Config) getCertificate(clientHello *ClientHelloInfo) (*Certificate, error) { + if c.GetCertificate != nil && + (len(c.Certificates) == 0 || len(clientHello.ServerName) > 0) { + cert, err := c.GetCertificate(clientHello) + if cert != nil || err != nil { + return cert, err + } + } + + if len(c.Certificates) == 0 { + return nil, errors.New("crypto/tls: no certificates configured") + } + + if len(c.Certificates) == 1 || c.NameToCertificate == nil { + // There's only one choice, so no point doing any work. + return &c.Certificates[0], nil + } + + name := strings.ToLower(clientHello.ServerName) + for len(name) > 0 && name[len(name)-1] == '.' { + name = name[:len(name)-1] + } + + if cert, ok := c.NameToCertificate[name]; ok { + return cert, nil + } + + // try replacing labels in the name with wildcards until we get a + // match. + labels := strings.Split(name, ".") + for i := range labels { + labels[i] = "*" + candidate := strings.Join(labels, ".") + if cert, ok := c.NameToCertificate[candidate]; ok { + return cert, nil + } + } + + // If nothing matches, return the first certificate. + return &c.Certificates[0], nil +} + +// BuildNameToCertificate parses c.Certificates and builds c.NameToCertificate +// from the CommonName and SubjectAlternateName fields of each of the leaf +// certificates. +func (c *Config) BuildNameToCertificate() { + c.NameToCertificate = make(map[string]*Certificate) + for i := range c.Certificates { + cert := &c.Certificates[i] + x509Cert, err := x509.ParseCertificate(cert.Certificate[0]) + if err != nil { + continue + } + if len(x509Cert.Subject.CommonName) > 0 { + c.NameToCertificate[x509Cert.Subject.CommonName] = cert + } + for _, san := range x509Cert.DNSNames { + c.NameToCertificate[san] = cert + } + } +} + +// A Certificate is a chain of one or more certificates, leaf first. +type Certificate struct { + Certificate [][]byte + // PrivateKey contains the private key corresponding to the public key + // in Leaf. For a server, this must implement crypto.Signer and/or + // crypto.Decrypter, with an RSA or ECDSA PublicKey. For a client + // (performing client authentication), this must be a crypto.Signer + // with an RSA or ECDSA PublicKey. + PrivateKey crypto.PrivateKey + // OCSPStaple contains an optional OCSP response which will be served + // to clients that request it. + OCSPStaple []byte + // SignedCertificateTimestamps contains an optional list of Signed + // Certificate Timestamps which will be served to clients that request it. + SignedCertificateTimestamps [][]byte + // Leaf is the parsed form of the leaf certificate, which may be + // initialized using x509.ParseCertificate to reduce per-handshake + // processing for TLS clients doing client authentication. If nil, the + // leaf certificate will be parsed as needed. + Leaf *x509.Certificate +} + +// A TLS record. +type record struct { + contentType recordType + major, minor uint8 + payload []byte +} + +type handshakeMessage interface { + marshal() []byte + unmarshal([]byte) bool +} + +// lruSessionCache is a ClientSessionCache implementation that uses an LRU +// caching strategy. +type lruSessionCache struct { + sync.Mutex + + m map[string]*list.Element + q *list.List + capacity int +} + +type lruSessionCacheEntry struct { + sessionKey string + state *ClientSessionState +} + +// NewLRUClientSessionCache returns a ClientSessionCache with the given +// capacity that uses an LRU strategy. If capacity is < 1, a default capacity +// is used instead. +func NewLRUClientSessionCache(capacity int) ClientSessionCache { + const defaultSessionCacheCapacity = 64 + + if capacity < 1 { + capacity = defaultSessionCacheCapacity + } + return &lruSessionCache{ + m: make(map[string]*list.Element), + q: list.New(), + capacity: capacity, + } +} + +// Put adds the provided (sessionKey, cs) pair to the cache. +func (c *lruSessionCache) Put(sessionKey string, cs *ClientSessionState) { + c.Lock() + defer c.Unlock() + + if elem, ok := c.m[sessionKey]; ok { + entry := elem.Value.(*lruSessionCacheEntry) + entry.state = cs + c.q.MoveToFront(elem) + return + } + + if c.q.Len() < c.capacity { + entry := &lruSessionCacheEntry{sessionKey, cs} + c.m[sessionKey] = c.q.PushFront(entry) + return + } + + elem := c.q.Back() + entry := elem.Value.(*lruSessionCacheEntry) + delete(c.m, entry.sessionKey) + entry.sessionKey = sessionKey + entry.state = cs + c.q.MoveToFront(elem) + c.m[sessionKey] = elem +} + +// Get returns the ClientSessionState value associated with a given key. It +// returns (nil, false) if no value is found. +func (c *lruSessionCache) Get(sessionKey string) (*ClientSessionState, bool) { + c.Lock() + defer c.Unlock() + + if elem, ok := c.m[sessionKey]; ok { + c.q.MoveToFront(elem) + return elem.Value.(*lruSessionCacheEntry).state, true + } + return nil, false +} + +// TODO(jsing): Make these available to both crypto/x509 and crypto/tls. +type dsaSignature struct { + R, S *big.Int +} + +type ecdsaSignature dsaSignature + +var emptyConfig Config + +func defaultConfig() *Config { + return &emptyConfig +} + +var ( + once sync.Once + varDefaultCipherSuites []uint16 +) + +func defaultCipherSuites() []uint16 { + once.Do(initDefaultCipherSuites) + return varDefaultCipherSuites +} + +func initDefaultCipherSuites() { + varDefaultCipherSuites = make([]uint16, 0, len(cipherSuites)) + for _, suite := range cipherSuites { + if suite.flags&suiteDefaultOff != 0 { + continue + } + varDefaultCipherSuites = append(varDefaultCipherSuites, suite.id) + } +} + +func unexpectedMessageError(wanted, got interface{}) error { + return fmt.Errorf("tls: received unexpected handshake message of type %T when waiting for %T", got, wanted) +} + +func isSupportedSignatureAndHash(sigHash signatureAndHash, sigHashes []signatureAndHash) bool { + for _, s := range sigHashes { + if s == sigHash { + return true + } + } + return false +} diff --git a/src/crypto/tls/conn.go b/src/crypto/tls/conn.go new file mode 100644 index 0000000000000000000000000000000000000000..e3dcf15400ce18a6c3985ba02239fb013910e78e --- /dev/null +++ b/src/crypto/tls/conn.go @@ -0,0 +1,1032 @@ +// Copyright 2010 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// TLS low level connection and record layer + +package tls + +import ( + "bytes" + "crypto/cipher" + "crypto/subtle" + "crypto/x509" + "errors" + "fmt" + "io" + "net" + "sync" + "time" +) + +// A Conn represents a secured connection. +// It implements the net.Conn interface. +type Conn struct { + // constant + conn net.Conn + isClient bool + + // constant after handshake; protected by handshakeMutex + handshakeMutex sync.Mutex // handshakeMutex < in.Mutex, out.Mutex, errMutex + handshakeErr error // error resulting from handshake + vers uint16 // TLS version + haveVers bool // version has been negotiated + config *Config // configuration passed to constructor + handshakeComplete bool + didResume bool // whether this connection was a session resumption + cipherSuite uint16 + ocspResponse []byte // stapled OCSP response + scts [][]byte // signed certificate timestamps from server + peerCertificates []*x509.Certificate + // verifiedChains contains the certificate chains that we built, as + // opposed to the ones presented by the server. + verifiedChains [][]*x509.Certificate + // serverName contains the server name indicated by the client, if any. + serverName string + // firstFinished contains the first Finished hash sent during the + // handshake. This is the "tls-unique" channel binding value. + firstFinished [12]byte + + clientProtocol string + clientProtocolFallback bool + + // input/output + in, out halfConn // in.Mutex < out.Mutex + rawInput *block // raw input, right off the wire + input *block // application data waiting to be read + hand bytes.Buffer // handshake data waiting to be read + + tmp [16]byte +} + +// Access to net.Conn methods. +// Cannot just embed net.Conn because that would +// export the struct field too. + +// LocalAddr returns the local network address. +func (c *Conn) LocalAddr() net.Addr { + return c.conn.LocalAddr() +} + +// RemoteAddr returns the remote network address. +func (c *Conn) RemoteAddr() net.Addr { + return c.conn.RemoteAddr() +} + +// SetDeadline sets the read and write deadlines associated with the connection. +// A zero value for t means Read and Write will not time out. +// After a Write has timed out, the TLS state is corrupt and all future writes will return the same error. +func (c *Conn) SetDeadline(t time.Time) error { + return c.conn.SetDeadline(t) +} + +// SetReadDeadline sets the read deadline on the underlying connection. +// A zero value for t means Read will not time out. +func (c *Conn) SetReadDeadline(t time.Time) error { + return c.conn.SetReadDeadline(t) +} + +// SetWriteDeadline sets the write deadline on the underlying connection. +// A zero value for t means Write will not time out. +// After a Write has timed out, the TLS state is corrupt and all future writes will return the same error. +func (c *Conn) SetWriteDeadline(t time.Time) error { + return c.conn.SetWriteDeadline(t) +} + +// A halfConn represents one direction of the record layer +// connection, either sending or receiving. +type halfConn struct { + sync.Mutex + + err error // first permanent error + version uint16 // protocol version + cipher interface{} // cipher algorithm + mac macFunction + seq [8]byte // 64-bit sequence number + bfree *block // list of free blocks + + nextCipher interface{} // next encryption state + nextMac macFunction // next MAC algorithm + + // used to save allocating a new buffer for each MAC. + inDigestBuf, outDigestBuf []byte +} + +func (hc *halfConn) setErrorLocked(err error) error { + hc.err = err + return err +} + +func (hc *halfConn) error() error { + hc.Lock() + err := hc.err + hc.Unlock() + return err +} + +// prepareCipherSpec sets the encryption and MAC states +// that a subsequent changeCipherSpec will use. +func (hc *halfConn) prepareCipherSpec(version uint16, cipher interface{}, mac macFunction) { + hc.version = version + hc.nextCipher = cipher + hc.nextMac = mac +} + +// changeCipherSpec changes the encryption and MAC states +// to the ones previously passed to prepareCipherSpec. +func (hc *halfConn) changeCipherSpec() error { + if hc.nextCipher == nil { + return alertInternalError + } + hc.cipher = hc.nextCipher + hc.mac = hc.nextMac + hc.nextCipher = nil + hc.nextMac = nil + for i := range hc.seq { + hc.seq[i] = 0 + } + return nil +} + +// incSeq increments the sequence number. +func (hc *halfConn) incSeq() { + for i := 7; i >= 0; i-- { + hc.seq[i]++ + if hc.seq[i] != 0 { + return + } + } + + // Not allowed to let sequence number wrap. + // Instead, must renegotiate before it does. + // Not likely enough to bother. + panic("TLS: sequence number wraparound") +} + +// resetSeq resets the sequence number to zero. +func (hc *halfConn) resetSeq() { + for i := range hc.seq { + hc.seq[i] = 0 + } +} + +// removePadding returns an unpadded slice, in constant time, which is a prefix +// of the input. It also returns a byte which is equal to 255 if the padding +// was valid and 0 otherwise. See RFC 2246, section 6.2.3.2 +func removePadding(payload []byte) ([]byte, byte) { + if len(payload) < 1 { + return payload, 0 + } + + paddingLen := payload[len(payload)-1] + t := uint(len(payload)-1) - uint(paddingLen) + // if len(payload) >= (paddingLen - 1) then the MSB of t is zero + good := byte(int32(^t) >> 31) + + toCheck := 255 // the maximum possible padding length + // The length of the padded data is public, so we can use an if here + if toCheck+1 > len(payload) { + toCheck = len(payload) - 1 + } + + for i := 0; i < toCheck; i++ { + t := uint(paddingLen) - uint(i) + // if i <= paddingLen then the MSB of t is zero + mask := byte(int32(^t) >> 31) + b := payload[len(payload)-1-i] + good &^= mask&paddingLen ^ mask&b + } + + // We AND together the bits of good and replicate the result across + // all the bits. + good &= good << 4 + good &= good << 2 + good &= good << 1 + good = uint8(int8(good) >> 7) + + toRemove := good&paddingLen + 1 + return payload[:len(payload)-int(toRemove)], good +} + +// removePaddingSSL30 is a replacement for removePadding in the case that the +// protocol version is SSLv3. In this version, the contents of the padding +// are random and cannot be checked. +func removePaddingSSL30(payload []byte) ([]byte, byte) { + if len(payload) < 1 { + return payload, 0 + } + + paddingLen := int(payload[len(payload)-1]) + 1 + if paddingLen > len(payload) { + return payload, 0 + } + + return payload[:len(payload)-paddingLen], 255 +} + +func roundUp(a, b int) int { + return a + (b-a%b)%b +} + +// cbcMode is an interface for block ciphers using cipher block chaining. +type cbcMode interface { + cipher.BlockMode + SetIV([]byte) +} + +// decrypt checks and strips the mac and decrypts the data in b. Returns a +// success boolean, the number of bytes to skip from the start of the record in +// order to get the application payload, and an optional alert value. +func (hc *halfConn) decrypt(b *block) (ok bool, prefixLen int, alertValue alert) { + // pull out payload + payload := b.data[recordHeaderLen:] + + macSize := 0 + if hc.mac != nil { + macSize = hc.mac.Size() + } + + paddingGood := byte(255) + explicitIVLen := 0 + + // decrypt + if hc.cipher != nil { + switch c := hc.cipher.(type) { + case cipher.Stream: + c.XORKeyStream(payload, payload) + case cipher.AEAD: + explicitIVLen = 8 + if len(payload) < explicitIVLen { + return false, 0, alertBadRecordMAC + } + nonce := payload[:8] + payload = payload[8:] + + var additionalData [13]byte + copy(additionalData[:], hc.seq[:]) + copy(additionalData[8:], b.data[:3]) + n := len(payload) - c.Overhead() + additionalData[11] = byte(n >> 8) + additionalData[12] = byte(n) + var err error + payload, err = c.Open(payload[:0], nonce, payload, additionalData[:]) + if err != nil { + return false, 0, alertBadRecordMAC + } + b.resize(recordHeaderLen + explicitIVLen + len(payload)) + case cbcMode: + blockSize := c.BlockSize() + if hc.version >= VersionTLS11 { + explicitIVLen = blockSize + } + + if len(payload)%blockSize != 0 || len(payload) < roundUp(explicitIVLen+macSize+1, blockSize) { + return false, 0, alertBadRecordMAC + } + + if explicitIVLen > 0 { + c.SetIV(payload[:explicitIVLen]) + payload = payload[explicitIVLen:] + } + c.CryptBlocks(payload, payload) + if hc.version == VersionSSL30 { + payload, paddingGood = removePaddingSSL30(payload) + } else { + payload, paddingGood = removePadding(payload) + } + b.resize(recordHeaderLen + explicitIVLen + len(payload)) + + // note that we still have a timing side-channel in the + // MAC check, below. An attacker can align the record + // so that a correct padding will cause one less hash + // block to be calculated. Then they can iteratively + // decrypt a record by breaking each byte. See + // "Password Interception in a SSL/TLS Channel", Brice + // Canvel et al. + // + // However, our behavior matches OpenSSL, so we leak + // only as much as they do. + default: + panic("unknown cipher type") + } + } + + // check, strip mac + if hc.mac != nil { + if len(payload) < macSize { + return false, 0, alertBadRecordMAC + } + + // strip mac off payload, b.data + n := len(payload) - macSize + b.data[3] = byte(n >> 8) + b.data[4] = byte(n) + b.resize(recordHeaderLen + explicitIVLen + n) + remoteMAC := payload[n:] + localMAC := hc.mac.MAC(hc.inDigestBuf, hc.seq[0:], b.data[:recordHeaderLen], payload[:n]) + + if subtle.ConstantTimeCompare(localMAC, remoteMAC) != 1 || paddingGood != 255 { + return false, 0, alertBadRecordMAC + } + hc.inDigestBuf = localMAC + } + hc.incSeq() + + return true, recordHeaderLen + explicitIVLen, 0 +} + +// padToBlockSize calculates the needed padding block, if any, for a payload. +// On exit, prefix aliases payload and extends to the end of the last full +// block of payload. finalBlock is a fresh slice which contains the contents of +// any suffix of payload as well as the needed padding to make finalBlock a +// full block. +func padToBlockSize(payload []byte, blockSize int) (prefix, finalBlock []byte) { + overrun := len(payload) % blockSize + paddingLen := blockSize - overrun + prefix = payload[:len(payload)-overrun] + finalBlock = make([]byte, blockSize) + copy(finalBlock, payload[len(payload)-overrun:]) + for i := overrun; i < blockSize; i++ { + finalBlock[i] = byte(paddingLen - 1) + } + return +} + +// encrypt encrypts and macs the data in b. +func (hc *halfConn) encrypt(b *block, explicitIVLen int) (bool, alert) { + // mac + if hc.mac != nil { + mac := hc.mac.MAC(hc.outDigestBuf, hc.seq[0:], b.data[:recordHeaderLen], b.data[recordHeaderLen+explicitIVLen:]) + + n := len(b.data) + b.resize(n + len(mac)) + copy(b.data[n:], mac) + hc.outDigestBuf = mac + } + + payload := b.data[recordHeaderLen:] + + // encrypt + if hc.cipher != nil { + switch c := hc.cipher.(type) { + case cipher.Stream: + c.XORKeyStream(payload, payload) + case cipher.AEAD: + payloadLen := len(b.data) - recordHeaderLen - explicitIVLen + b.resize(len(b.data) + c.Overhead()) + nonce := b.data[recordHeaderLen : recordHeaderLen+explicitIVLen] + payload := b.data[recordHeaderLen+explicitIVLen:] + payload = payload[:payloadLen] + + var additionalData [13]byte + copy(additionalData[:], hc.seq[:]) + copy(additionalData[8:], b.data[:3]) + additionalData[11] = byte(payloadLen >> 8) + additionalData[12] = byte(payloadLen) + + c.Seal(payload[:0], nonce, payload, additionalData[:]) + case cbcMode: + blockSize := c.BlockSize() + if explicitIVLen > 0 { + c.SetIV(payload[:explicitIVLen]) + payload = payload[explicitIVLen:] + } + prefix, finalBlock := padToBlockSize(payload, blockSize) + b.resize(recordHeaderLen + explicitIVLen + len(prefix) + len(finalBlock)) + c.CryptBlocks(b.data[recordHeaderLen+explicitIVLen:], prefix) + c.CryptBlocks(b.data[recordHeaderLen+explicitIVLen+len(prefix):], finalBlock) + default: + panic("unknown cipher type") + } + } + + // update length to include MAC and any block padding needed. + n := len(b.data) - recordHeaderLen + b.data[3] = byte(n >> 8) + b.data[4] = byte(n) + hc.incSeq() + + return true, 0 +} + +// A block is a simple data buffer. +type block struct { + data []byte + off int // index for Read + link *block +} + +// resize resizes block to be n bytes, growing if necessary. +func (b *block) resize(n int) { + if n > cap(b.data) { + b.reserve(n) + } + b.data = b.data[0:n] +} + +// reserve makes sure that block contains a capacity of at least n bytes. +func (b *block) reserve(n int) { + if cap(b.data) >= n { + return + } + m := cap(b.data) + if m == 0 { + m = 1024 + } + for m < n { + m *= 2 + } + data := make([]byte, len(b.data), m) + copy(data, b.data) + b.data = data +} + +// readFromUntil reads from r into b until b contains at least n bytes +// or else returns an error. +func (b *block) readFromUntil(r io.Reader, n int) error { + // quick case + if len(b.data) >= n { + return nil + } + + // read until have enough. + b.reserve(n) + for { + m, err := r.Read(b.data[len(b.data):cap(b.data)]) + b.data = b.data[0 : len(b.data)+m] + if len(b.data) >= n { + // TODO(bradfitz,agl): slightly suspicious + // that we're throwing away r.Read's err here. + break + } + if err != nil { + return err + } + } + return nil +} + +func (b *block) Read(p []byte) (n int, err error) { + n = copy(p, b.data[b.off:]) + b.off += n + return +} + +// newBlock allocates a new block, from hc's free list if possible. +func (hc *halfConn) newBlock() *block { + b := hc.bfree + if b == nil { + return new(block) + } + hc.bfree = b.link + b.link = nil + b.resize(0) + return b +} + +// freeBlock returns a block to hc's free list. +// The protocol is such that each side only has a block or two on +// its free list at a time, so there's no need to worry about +// trimming the list, etc. +func (hc *halfConn) freeBlock(b *block) { + b.link = hc.bfree + hc.bfree = b +} + +// splitBlock splits a block after the first n bytes, +// returning a block with those n bytes and a +// block with the remainder. the latter may be nil. +func (hc *halfConn) splitBlock(b *block, n int) (*block, *block) { + if len(b.data) <= n { + return b, nil + } + bb := hc.newBlock() + bb.resize(len(b.data) - n) + copy(bb.data, b.data[n:]) + b.data = b.data[0:n] + return b, bb +} + +// readRecord reads the next TLS record from the connection +// and updates the record layer state. +// c.in.Mutex <= L; c.input == nil. +func (c *Conn) readRecord(want recordType) error { + // Caller must be in sync with connection: + // handshake data if handshake not yet completed, + // else application data. (We don't support renegotiation.) + switch want { + default: + c.sendAlert(alertInternalError) + return c.in.setErrorLocked(errors.New("tls: unknown record type requested")) + case recordTypeHandshake, recordTypeChangeCipherSpec: + if c.handshakeComplete { + c.sendAlert(alertInternalError) + return c.in.setErrorLocked(errors.New("tls: handshake or ChangeCipherSpec requested after handshake complete")) + } + case recordTypeApplicationData: + if !c.handshakeComplete { + c.sendAlert(alertInternalError) + return c.in.setErrorLocked(errors.New("tls: application data record requested before handshake complete")) + } + } + +Again: + if c.rawInput == nil { + c.rawInput = c.in.newBlock() + } + b := c.rawInput + + // Read header, payload. + if err := b.readFromUntil(c.conn, recordHeaderLen); err != nil { + // RFC suggests that EOF without an alertCloseNotify is + // an error, but popular web sites seem to do this, + // so we can't make it an error. + // if err == io.EOF { + // err = io.ErrUnexpectedEOF + // } + if e, ok := err.(net.Error); !ok || !e.Temporary() { + c.in.setErrorLocked(err) + } + return err + } + typ := recordType(b.data[0]) + + // No valid TLS record has a type of 0x80, however SSLv2 handshakes + // start with a uint16 length where the MSB is set and the first record + // is always < 256 bytes long. Therefore typ == 0x80 strongly suggests + // an SSLv2 client. + if want == recordTypeHandshake && typ == 0x80 { + c.sendAlert(alertProtocolVersion) + return c.in.setErrorLocked(errors.New("tls: unsupported SSLv2 handshake received")) + } + + vers := uint16(b.data[1])<<8 | uint16(b.data[2]) + n := int(b.data[3])<<8 | int(b.data[4]) + if c.haveVers && vers != c.vers { + c.sendAlert(alertProtocolVersion) + return c.in.setErrorLocked(fmt.Errorf("tls: received record with version %x when expecting version %x", vers, c.vers)) + } + if n > maxCiphertext { + c.sendAlert(alertRecordOverflow) + return c.in.setErrorLocked(fmt.Errorf("tls: oversized record received with length %d", n)) + } + if !c.haveVers { + // First message, be extra suspicious: this might not be a TLS + // client. Bail out before reading a full 'body', if possible. + // The current max version is 3.3 so if the version is >= 16.0, + // it's probably not real. + if (typ != recordTypeAlert && typ != want) || vers >= 0x1000 { + c.sendAlert(alertUnexpectedMessage) + return c.in.setErrorLocked(fmt.Errorf("tls: first record does not look like a TLS handshake")) + } + } + if err := b.readFromUntil(c.conn, recordHeaderLen+n); err != nil { + if err == io.EOF { + err = io.ErrUnexpectedEOF + } + if e, ok := err.(net.Error); !ok || !e.Temporary() { + c.in.setErrorLocked(err) + } + return err + } + + // Process message. + b, c.rawInput = c.in.splitBlock(b, recordHeaderLen+n) + ok, off, err := c.in.decrypt(b) + if !ok { + c.in.setErrorLocked(c.sendAlert(err)) + } + b.off = off + data := b.data[b.off:] + if len(data) > maxPlaintext { + err := c.sendAlert(alertRecordOverflow) + c.in.freeBlock(b) + return c.in.setErrorLocked(err) + } + + switch typ { + default: + c.in.setErrorLocked(c.sendAlert(alertUnexpectedMessage)) + + case recordTypeAlert: + if len(data) != 2 { + c.in.setErrorLocked(c.sendAlert(alertUnexpectedMessage)) + break + } + if alert(data[1]) == alertCloseNotify { + c.in.setErrorLocked(io.EOF) + break + } + switch data[0] { + case alertLevelWarning: + // drop on the floor + c.in.freeBlock(b) + goto Again + case alertLevelError: + c.in.setErrorLocked(&net.OpError{Op: "remote error", Err: alert(data[1])}) + default: + c.in.setErrorLocked(c.sendAlert(alertUnexpectedMessage)) + } + + case recordTypeChangeCipherSpec: + if typ != want || len(data) != 1 || data[0] != 1 { + c.in.setErrorLocked(c.sendAlert(alertUnexpectedMessage)) + break + } + err := c.in.changeCipherSpec() + if err != nil { + c.in.setErrorLocked(c.sendAlert(err.(alert))) + } + + case recordTypeApplicationData: + if typ != want { + c.in.setErrorLocked(c.sendAlert(alertUnexpectedMessage)) + break + } + c.input = b + b = nil + + case recordTypeHandshake: + // TODO(rsc): Should at least pick off connection close. + if typ != want { + return c.in.setErrorLocked(c.sendAlert(alertNoRenegotiation)) + } + c.hand.Write(data) + } + + if b != nil { + c.in.freeBlock(b) + } + return c.in.err +} + +// sendAlert sends a TLS alert message. +// c.out.Mutex <= L. +func (c *Conn) sendAlertLocked(err alert) error { + switch err { + case alertNoRenegotiation, alertCloseNotify: + c.tmp[0] = alertLevelWarning + default: + c.tmp[0] = alertLevelError + } + c.tmp[1] = byte(err) + c.writeRecord(recordTypeAlert, c.tmp[0:2]) + // closeNotify is a special case in that it isn't an error: + if err != alertCloseNotify { + return c.out.setErrorLocked(&net.OpError{Op: "local error", Err: err}) + } + return nil +} + +// sendAlert sends a TLS alert message. +// L < c.out.Mutex. +func (c *Conn) sendAlert(err alert) error { + c.out.Lock() + defer c.out.Unlock() + return c.sendAlertLocked(err) +} + +// writeRecord writes a TLS record with the given type and payload +// to the connection and updates the record layer state. +// c.out.Mutex <= L. +func (c *Conn) writeRecord(typ recordType, data []byte) (n int, err error) { + b := c.out.newBlock() + for len(data) > 0 { + m := len(data) + if m > maxPlaintext { + m = maxPlaintext + } + explicitIVLen := 0 + explicitIVIsSeq := false + + var cbc cbcMode + if c.out.version >= VersionTLS11 { + var ok bool + if cbc, ok = c.out.cipher.(cbcMode); ok { + explicitIVLen = cbc.BlockSize() + } + } + if explicitIVLen == 0 { + if _, ok := c.out.cipher.(cipher.AEAD); ok { + explicitIVLen = 8 + // The AES-GCM construction in TLS has an + // explicit nonce so that the nonce can be + // random. However, the nonce is only 8 bytes + // which is too small for a secure, random + // nonce. Therefore we use the sequence number + // as the nonce. + explicitIVIsSeq = true + } + } + b.resize(recordHeaderLen + explicitIVLen + m) + b.data[0] = byte(typ) + vers := c.vers + if vers == 0 { + // Some TLS servers fail if the record version is + // greater than TLS 1.0 for the initial ClientHello. + vers = VersionTLS10 + } + b.data[1] = byte(vers >> 8) + b.data[2] = byte(vers) + b.data[3] = byte(m >> 8) + b.data[4] = byte(m) + if explicitIVLen > 0 { + explicitIV := b.data[recordHeaderLen : recordHeaderLen+explicitIVLen] + if explicitIVIsSeq { + copy(explicitIV, c.out.seq[:]) + } else { + if _, err = io.ReadFull(c.config.rand(), explicitIV); err != nil { + break + } + } + } + copy(b.data[recordHeaderLen+explicitIVLen:], data) + c.out.encrypt(b, explicitIVLen) + _, err = c.conn.Write(b.data) + if err != nil { + break + } + n += m + data = data[m:] + } + c.out.freeBlock(b) + + if typ == recordTypeChangeCipherSpec { + err = c.out.changeCipherSpec() + if err != nil { + // Cannot call sendAlert directly, + // because we already hold c.out.Mutex. + c.tmp[0] = alertLevelError + c.tmp[1] = byte(err.(alert)) + c.writeRecord(recordTypeAlert, c.tmp[0:2]) + return n, c.out.setErrorLocked(&net.OpError{Op: "local error", Err: err}) + } + } + return +} + +// readHandshake reads the next handshake message from +// the record layer. +// c.in.Mutex < L; c.out.Mutex < L. +func (c *Conn) readHandshake() (interface{}, error) { + for c.hand.Len() < 4 { + if err := c.in.err; err != nil { + return nil, err + } + if err := c.readRecord(recordTypeHandshake); err != nil { + return nil, err + } + } + + data := c.hand.Bytes() + n := int(data[1])<<16 | int(data[2])<<8 | int(data[3]) + if n > maxHandshake { + return nil, c.in.setErrorLocked(c.sendAlert(alertInternalError)) + } + for c.hand.Len() < 4+n { + if err := c.in.err; err != nil { + return nil, err + } + if err := c.readRecord(recordTypeHandshake); err != nil { + return nil, err + } + } + data = c.hand.Next(4 + n) + var m handshakeMessage + switch data[0] { + case typeClientHello: + m = new(clientHelloMsg) + case typeServerHello: + m = new(serverHelloMsg) + case typeNewSessionTicket: + m = new(newSessionTicketMsg) + case typeCertificate: + m = new(certificateMsg) + case typeCertificateRequest: + m = &certificateRequestMsg{ + hasSignatureAndHash: c.vers >= VersionTLS12, + } + case typeCertificateStatus: + m = new(certificateStatusMsg) + case typeServerKeyExchange: + m = new(serverKeyExchangeMsg) + case typeServerHelloDone: + m = new(serverHelloDoneMsg) + case typeClientKeyExchange: + m = new(clientKeyExchangeMsg) + case typeCertificateVerify: + m = &certificateVerifyMsg{ + hasSignatureAndHash: c.vers >= VersionTLS12, + } + case typeNextProtocol: + m = new(nextProtoMsg) + case typeFinished: + m = new(finishedMsg) + default: + return nil, c.in.setErrorLocked(c.sendAlert(alertUnexpectedMessage)) + } + + // The handshake message unmarshallers + // expect to be able to keep references to data, + // so pass in a fresh copy that won't be overwritten. + data = append([]byte(nil), data...) + + if !m.unmarshal(data) { + return nil, c.in.setErrorLocked(c.sendAlert(alertUnexpectedMessage)) + } + return m, nil +} + +// Write writes data to the connection. +func (c *Conn) Write(b []byte) (int, error) { + if err := c.Handshake(); err != nil { + return 0, err + } + + c.out.Lock() + defer c.out.Unlock() + + if err := c.out.err; err != nil { + return 0, err + } + + if !c.handshakeComplete { + return 0, alertInternalError + } + + // SSL 3.0 and TLS 1.0 are susceptible to a chosen-plaintext + // attack when using block mode ciphers due to predictable IVs. + // This can be prevented by splitting each Application Data + // record into two records, effectively randomizing the IV. + // + // http://www.openssl.org/~bodo/tls-cbc.txt + // https://bugzilla.mozilla.org/show_bug.cgi?id=665814 + // http://www.imperialviolet.org/2012/01/15/beastfollowup.html + + var m int + if len(b) > 1 && c.vers <= VersionTLS10 { + if _, ok := c.out.cipher.(cipher.BlockMode); ok { + n, err := c.writeRecord(recordTypeApplicationData, b[:1]) + if err != nil { + return n, c.out.setErrorLocked(err) + } + m, b = 1, b[1:] + } + } + + n, err := c.writeRecord(recordTypeApplicationData, b) + return n + m, c.out.setErrorLocked(err) +} + +// Read can be made to time out and return a net.Error with Timeout() == true +// after a fixed time limit; see SetDeadline and SetReadDeadline. +func (c *Conn) Read(b []byte) (n int, err error) { + if err = c.Handshake(); err != nil { + return + } + if len(b) == 0 { + // Put this after Handshake, in case people were calling + // Read(nil) for the side effect of the Handshake. + return + } + + c.in.Lock() + defer c.in.Unlock() + + // Some OpenSSL servers send empty records in order to randomize the + // CBC IV. So this loop ignores a limited number of empty records. + const maxConsecutiveEmptyRecords = 100 + for emptyRecordCount := 0; emptyRecordCount <= maxConsecutiveEmptyRecords; emptyRecordCount++ { + for c.input == nil && c.in.err == nil { + if err := c.readRecord(recordTypeApplicationData); err != nil { + // Soft error, like EAGAIN + return 0, err + } + } + if err := c.in.err; err != nil { + return 0, err + } + + n, err = c.input.Read(b) + if c.input.off >= len(c.input.data) { + c.in.freeBlock(c.input) + c.input = nil + } + + // If a close-notify alert is waiting, read it so that + // we can return (n, EOF) instead of (n, nil), to signal + // to the HTTP response reading goroutine that the + // connection is now closed. This eliminates a race + // where the HTTP response reading goroutine would + // otherwise not observe the EOF until its next read, + // by which time a client goroutine might have already + // tried to reuse the HTTP connection for a new + // request. + // See https://codereview.appspot.com/76400046 + // and https://golang.org/issue/3514 + if ri := c.rawInput; ri != nil && + n != 0 && err == nil && + c.input == nil && len(ri.data) > 0 && recordType(ri.data[0]) == recordTypeAlert { + if recErr := c.readRecord(recordTypeApplicationData); recErr != nil { + err = recErr // will be io.EOF on closeNotify + } + } + + if n != 0 || err != nil { + return n, err + } + } + + return 0, io.ErrNoProgress +} + +// Close closes the connection. +func (c *Conn) Close() error { + var alertErr error + + c.handshakeMutex.Lock() + defer c.handshakeMutex.Unlock() + if c.handshakeComplete { + alertErr = c.sendAlert(alertCloseNotify) + } + + if err := c.conn.Close(); err != nil { + return err + } + return alertErr +} + +// Handshake runs the client or server handshake +// protocol if it has not yet been run. +// Most uses of this package need not call Handshake +// explicitly: the first Read or Write will call it automatically. +func (c *Conn) Handshake() error { + c.handshakeMutex.Lock() + defer c.handshakeMutex.Unlock() + if err := c.handshakeErr; err != nil { + return err + } + if c.handshakeComplete { + return nil + } + + if c.isClient { + c.handshakeErr = c.clientHandshake() + } else { + c.handshakeErr = c.serverHandshake() + } + return c.handshakeErr +} + +// ConnectionState returns basic TLS details about the connection. +func (c *Conn) ConnectionState() ConnectionState { + c.handshakeMutex.Lock() + defer c.handshakeMutex.Unlock() + + var state ConnectionState + state.HandshakeComplete = c.handshakeComplete + if c.handshakeComplete { + state.Version = c.vers + state.NegotiatedProtocol = c.clientProtocol + state.DidResume = c.didResume + state.NegotiatedProtocolIsMutual = !c.clientProtocolFallback + state.CipherSuite = c.cipherSuite + state.PeerCertificates = c.peerCertificates + state.VerifiedChains = c.verifiedChains + state.ServerName = c.serverName + state.SignedCertificateTimestamps = c.scts + state.OCSPResponse = c.ocspResponse + if !c.didResume { + state.TLSUnique = c.firstFinished[:] + } + } + + return state +} + +// OCSPResponse returns the stapled OCSP response from the TLS server, if +// any. (Only valid for client connections.) +func (c *Conn) OCSPResponse() []byte { + c.handshakeMutex.Lock() + defer c.handshakeMutex.Unlock() + + return c.ocspResponse +} + +// VerifyHostname checks that the peer certificate chain is valid for +// connecting to host. If so, it returns nil; if not, it returns an error +// describing the problem. +func (c *Conn) VerifyHostname(host string) error { + c.handshakeMutex.Lock() + defer c.handshakeMutex.Unlock() + if !c.isClient { + return errors.New("tls: VerifyHostname called on TLS server connection") + } + if !c.handshakeComplete { + return errors.New("tls: handshake has not yet been performed") + } + if len(c.verifiedChains) == 0 { + return errors.New("tls: handshake did not verify certificate chain") + } + return c.peerCertificates[0].VerifyHostname(host) +} diff --git a/src/crypto/tls/conn_test.go b/src/crypto/tls/conn_test.go new file mode 100644 index 0000000000000000000000000000000000000000..ec802cad70fc74d599dbe0ad48a7eb8dbaaf116a --- /dev/null +++ b/src/crypto/tls/conn_test.go @@ -0,0 +1,118 @@ +// Copyright 2010 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package tls + +import ( + "testing" +) + +func TestRoundUp(t *testing.T) { + if roundUp(0, 16) != 0 || + roundUp(1, 16) != 16 || + roundUp(15, 16) != 16 || + roundUp(16, 16) != 16 || + roundUp(17, 16) != 32 { + t.Error("roundUp broken") + } +} + +var paddingTests = []struct { + in []byte + good bool + expectedLen int +}{ + {[]byte{1, 2, 3, 4, 0}, true, 4}, + {[]byte{1, 2, 3, 4, 0, 1}, false, 0}, + {[]byte{1, 2, 3, 4, 99, 99}, false, 0}, + {[]byte{1, 2, 3, 4, 1, 1}, true, 4}, + {[]byte{1, 2, 3, 2, 2, 2}, true, 3}, + {[]byte{1, 2, 3, 3, 3, 3}, true, 2}, + {[]byte{1, 2, 3, 4, 3, 3}, false, 0}, + {[]byte{1, 4, 4, 4, 4, 4}, true, 1}, + {[]byte{5, 5, 5, 5, 5, 5}, true, 0}, + {[]byte{6, 6, 6, 6, 6, 6}, false, 0}, +} + +func TestRemovePadding(t *testing.T) { + for i, test := range paddingTests { + payload, good := removePadding(test.in) + expectedGood := byte(255) + if !test.good { + expectedGood = 0 + } + if good != expectedGood { + t.Errorf("#%d: wrong validity, want:%d got:%d", i, expectedGood, good) + } + if good == 255 && len(payload) != test.expectedLen { + t.Errorf("#%d: got %d, want %d", i, len(payload), test.expectedLen) + } + } +} + +var certExampleCom = `308201403081eda003020102020101300b06092a864886f70d010105301e311c301a060355040a131354657374696e67204365727469666963617465301e170d3131313030313138353835325a170d3132303933303138353835325a301e311c301a060355040a131354657374696e67204365727469666963617465305a300b06092a864886f70d010101034b003048024100bced6e32368599eeddf18796bfd03958a154f87e5b084f96e85136a56b886733592f493f0fc68b0d6b3551781cb95e13c5de458b28d6fb60d20a9129313261410203010001a31a301830160603551d11040f300d820b6578616d706c652e636f6d300b06092a864886f70d0101050341001a0b419d2c74474c6450654e5f10b32bf426ffdf55cad1c52602e7a9151513a3424c70f5960dcd682db0c33769cc1daa3fcdd3db10809d2392ed4a1bf50ced18` + +var certWildcardExampleCom = `308201423081efa003020102020101300b06092a864886f70d010105301e311c301a060355040a131354657374696e67204365727469666963617465301e170d3131313030313139303034365a170d3132303933303139303034365a301e311c301a060355040a131354657374696e67204365727469666963617465305a300b06092a864886f70d010101034b003048024100bced6e32368599eeddf18796bfd03958a154f87e5b084f96e85136a56b886733592f493f0fc68b0d6b3551781cb95e13c5de458b28d6fb60d20a9129313261410203010001a31c301a30180603551d110411300f820d2a2e6578616d706c652e636f6d300b06092a864886f70d0101050341001676f0c9e7c33c1b656ed5a6476c4e2ee9ec8e62df7407accb1875272b2edd0a22096cb2c22598d11604104d604f810eb4b5987ca6bb319c7e6ce48725c54059` + +var certFooExampleCom = `308201443081f1a003020102020101300b06092a864886f70d010105301e311c301a060355040a131354657374696e67204365727469666963617465301e170d3131313030313139303131345a170d3132303933303139303131345a301e311c301a060355040a131354657374696e67204365727469666963617465305a300b06092a864886f70d010101034b003048024100bced6e32368599eeddf18796bfd03958a154f87e5b084f96e85136a56b886733592f493f0fc68b0d6b3551781cb95e13c5de458b28d6fb60d20a9129313261410203010001a31e301c301a0603551d1104133011820f666f6f2e6578616d706c652e636f6d300b06092a864886f70d010105034100646a2a51f2aa2477add854b462cf5207ba16d3213ffb5d3d0eed473fbf09935019192d1d5b8ca6a2407b424cf04d97c4cd9197c83ecf81f0eab9464a1109d09f` + +var certDoubleWildcardExampleCom = `308201443081f1a003020102020101300b06092a864886f70d010105301e311c301a060355040a131354657374696e67204365727469666963617465301e170d3131313030313139303134315a170d3132303933303139303134315a301e311c301a060355040a131354657374696e67204365727469666963617465305a300b06092a864886f70d010101034b003048024100bced6e32368599eeddf18796bfd03958a154f87e5b084f96e85136a56b886733592f493f0fc68b0d6b3551781cb95e13c5de458b28d6fb60d20a9129313261410203010001a31e301c301a0603551d1104133011820f2a2e2a2e6578616d706c652e636f6d300b06092a864886f70d0101050341001c3de267975f56ef57771c6218ef95ecc65102e57bd1defe6f7efea90d9b26cf40de5bd7ad75e46201c7f2a92aaa3e907451e9409f65e28ddb6db80d726290f6` + +func TestCertificateSelection(t *testing.T) { + config := Config{ + Certificates: []Certificate{ + { + Certificate: [][]byte{fromHex(certExampleCom)}, + }, + { + Certificate: [][]byte{fromHex(certWildcardExampleCom)}, + }, + { + Certificate: [][]byte{fromHex(certFooExampleCom)}, + }, + { + Certificate: [][]byte{fromHex(certDoubleWildcardExampleCom)}, + }, + }, + } + + config.BuildNameToCertificate() + + pointerToIndex := func(c *Certificate) int { + for i := range config.Certificates { + if c == &config.Certificates[i] { + return i + } + } + return -1 + } + + certificateForName := func(name string) *Certificate { + clientHello := &ClientHelloInfo{ + ServerName: name, + } + if cert, err := config.getCertificate(clientHello); err != nil { + t.Errorf("unable to get certificate for name '%s': %s", name, err) + return nil + } else { + return cert + } + } + + if n := pointerToIndex(certificateForName("example.com")); n != 0 { + t.Errorf("example.com returned certificate %d, not 0", n) + } + if n := pointerToIndex(certificateForName("bar.example.com")); n != 1 { + t.Errorf("bar.example.com returned certificate %d, not 1", n) + } + if n := pointerToIndex(certificateForName("foo.example.com")); n != 2 { + t.Errorf("foo.example.com returned certificate %d, not 2", n) + } + if n := pointerToIndex(certificateForName("foo.bar.example.com")); n != 3 { + t.Errorf("foo.bar.example.com returned certificate %d, not 3", n) + } + if n := pointerToIndex(certificateForName("foo.bar.baz.example.com")); n != 0 { + t.Errorf("foo.bar.baz.example.com returned certificate %d, not 0", n) + } +} diff --git a/src/crypto/tls/example_test.go b/src/crypto/tls/example_test.go new file mode 100644 index 0000000000000000000000000000000000000000..7628e431bf90a97f70b26a73527faab1e6f1c61a --- /dev/null +++ b/src/crypto/tls/example_test.go @@ -0,0 +1,57 @@ +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package tls_test + +import ( + "crypto/tls" + "crypto/x509" +) + +func ExampleDial() { + // Connecting with a custom root-certificate set. + + const rootPEM = ` +-----BEGIN CERTIFICATE----- +MIIEBDCCAuygAwIBAgIDAjppMA0GCSqGSIb3DQEBBQUAMEIxCzAJBgNVBAYTAlVT +MRYwFAYDVQQKEw1HZW9UcnVzdCBJbmMuMRswGQYDVQQDExJHZW9UcnVzdCBHbG9i +YWwgQ0EwHhcNMTMwNDA1MTUxNTU1WhcNMTUwNDA0MTUxNTU1WjBJMQswCQYDVQQG +EwJVUzETMBEGA1UEChMKR29vZ2xlIEluYzElMCMGA1UEAxMcR29vZ2xlIEludGVy +bmV0IEF1dGhvcml0eSBHMjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB +AJwqBHdc2FCROgajguDYUEi8iT/xGXAaiEZ+4I/F8YnOIe5a/mENtzJEiaB0C1NP +VaTOgmKV7utZX8bhBYASxF6UP7xbSDj0U/ck5vuR6RXEz/RTDfRK/J9U3n2+oGtv +h8DQUB8oMANA2ghzUWx//zo8pzcGjr1LEQTrfSTe5vn8MXH7lNVg8y5Kr0LSy+rE +ahqyzFPdFUuLH8gZYR/Nnag+YyuENWllhMgZxUYi+FOVvuOAShDGKuy6lyARxzmZ +EASg8GF6lSWMTlJ14rbtCMoU/M4iarNOz0YDl5cDfsCx3nuvRTPPuj5xt970JSXC +DTWJnZ37DhF5iR43xa+OcmkCAwEAAaOB+zCB+DAfBgNVHSMEGDAWgBTAephojYn7 +qwVkDBF9qn1luMrMTjAdBgNVHQ4EFgQUSt0GFhu89mi1dvWBtrtiGrpagS8wEgYD +VR0TAQH/BAgwBgEB/wIBADAOBgNVHQ8BAf8EBAMCAQYwOgYDVR0fBDMwMTAvoC2g +K4YpaHR0cDovL2NybC5nZW90cnVzdC5jb20vY3Jscy9ndGdsb2JhbC5jcmwwPQYI +KwYBBQUHAQEEMTAvMC0GCCsGAQUFBzABhiFodHRwOi8vZ3RnbG9iYWwtb2NzcC5n +ZW90cnVzdC5jb20wFwYDVR0gBBAwDjAMBgorBgEEAdZ5AgUBMA0GCSqGSIb3DQEB +BQUAA4IBAQA21waAESetKhSbOHezI6B1WLuxfoNCunLaHtiONgaX4PCVOzf9G0JY +/iLIa704XtE7JW4S615ndkZAkNoUyHgN7ZVm2o6Gb4ChulYylYbc3GrKBIxbf/a/ +zG+FA1jDaFETzf3I93k9mTXwVqO94FntT0QJo544evZG0R0SnU++0ED8Vf4GXjza +HFa9llF7b1cq26KqltyMdMKVvvBulRP/F/A8rLIQjcxz++iPAsbw+zOzlTvjwsto +WHPbqCRiOwY1nQ2pM714A5AuTHhdUDqB1O6gyHA43LL5Z/qHQF1hwFGPa4NrzQU6 +yuGnBXj8ytqU0CwIPX4WecigUCAkVDNx +-----END CERTIFICATE-----` + + // First, create the set of root certificates. For this example we only + // have one. It's also possible to omit this in order to use the + // default root set of the current operating system. + roots := x509.NewCertPool() + ok := roots.AppendCertsFromPEM([]byte(rootPEM)) + if !ok { + panic("failed to parse root certificate") + } + + conn, err := tls.Dial("tcp", "mail.google.com:443", &tls.Config{ + RootCAs: roots, + }) + if err != nil { + panic("failed to connect: " + err.Error()) + } + conn.Close() +} diff --git a/src/crypto/tls/generate_cert.go b/src/crypto/tls/generate_cert.go new file mode 100644 index 0000000000000000000000000000000000000000..83f9916ff9d937e1eefcd30e0de6d95a3d5a8c42 --- /dev/null +++ b/src/crypto/tls/generate_cert.go @@ -0,0 +1,161 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build ignore + +// Generate a self-signed X.509 certificate for a TLS server. Outputs to +// 'cert.pem' and 'key.pem' and will overwrite existing files. + +package main + +import ( + "crypto/ecdsa" + "crypto/elliptic" + "crypto/rand" + "crypto/rsa" + "crypto/x509" + "crypto/x509/pkix" + "encoding/pem" + "flag" + "fmt" + "log" + "math/big" + "net" + "os" + "strings" + "time" +) + +var ( + host = flag.String("host", "", "Comma-separated hostnames and IPs to generate a certificate for") + validFrom = flag.String("start-date", "", "Creation date formatted as Jan 1 15:04:05 2011") + validFor = flag.Duration("duration", 365*24*time.Hour, "Duration that certificate is valid for") + isCA = flag.Bool("ca", false, "whether this cert should be its own Certificate Authority") + rsaBits = flag.Int("rsa-bits", 2048, "Size of RSA key to generate. Ignored if --ecdsa-curve is set") + ecdsaCurve = flag.String("ecdsa-curve", "", "ECDSA curve to use to generate a key. Valid values are P224, P256, P384, P521") +) + +func publicKey(priv interface{}) interface{} { + switch k := priv.(type) { + case *rsa.PrivateKey: + return &k.PublicKey + case *ecdsa.PrivateKey: + return &k.PublicKey + default: + return nil + } +} + +func pemBlockForKey(priv interface{}) *pem.Block { + switch k := priv.(type) { + case *rsa.PrivateKey: + return &pem.Block{Type: "RSA PRIVATE KEY", Bytes: x509.MarshalPKCS1PrivateKey(k)} + case *ecdsa.PrivateKey: + b, err := x509.MarshalECPrivateKey(k) + if err != nil { + fmt.Fprintf(os.Stderr, "Unable to marshal ECDSA private key: %v", err) + os.Exit(2) + } + return &pem.Block{Type: "EC PRIVATE KEY", Bytes: b} + default: + return nil + } +} + +func main() { + flag.Parse() + + if len(*host) == 0 { + log.Fatalf("Missing required --host parameter") + } + + var priv interface{} + var err error + switch *ecdsaCurve { + case "": + priv, err = rsa.GenerateKey(rand.Reader, *rsaBits) + case "P224": + priv, err = ecdsa.GenerateKey(elliptic.P224(), rand.Reader) + case "P256": + priv, err = ecdsa.GenerateKey(elliptic.P256(), rand.Reader) + case "P384": + priv, err = ecdsa.GenerateKey(elliptic.P384(), rand.Reader) + case "P521": + priv, err = ecdsa.GenerateKey(elliptic.P521(), rand.Reader) + default: + fmt.Fprintf(os.Stderr, "Unrecognized elliptic curve: %q", *ecdsaCurve) + os.Exit(1) + } + if err != nil { + log.Fatalf("failed to generate private key: %s", err) + } + + var notBefore time.Time + if len(*validFrom) == 0 { + notBefore = time.Now() + } else { + notBefore, err = time.Parse("Jan 2 15:04:05 2006", *validFrom) + if err != nil { + fmt.Fprintf(os.Stderr, "Failed to parse creation date: %s\n", err) + os.Exit(1) + } + } + + notAfter := notBefore.Add(*validFor) + + serialNumberLimit := new(big.Int).Lsh(big.NewInt(1), 128) + serialNumber, err := rand.Int(rand.Reader, serialNumberLimit) + if err != nil { + log.Fatalf("failed to generate serial number: %s", err) + } + + template := x509.Certificate{ + SerialNumber: serialNumber, + Subject: pkix.Name{ + Organization: []string{"Acme Co"}, + }, + NotBefore: notBefore, + NotAfter: notAfter, + + KeyUsage: x509.KeyUsageKeyEncipherment | x509.KeyUsageDigitalSignature, + ExtKeyUsage: []x509.ExtKeyUsage{x509.ExtKeyUsageServerAuth}, + BasicConstraintsValid: true, + } + + hosts := strings.Split(*host, ",") + for _, h := range hosts { + if ip := net.ParseIP(h); ip != nil { + template.IPAddresses = append(template.IPAddresses, ip) + } else { + template.DNSNames = append(template.DNSNames, h) + } + } + + if *isCA { + template.IsCA = true + template.KeyUsage |= x509.KeyUsageCertSign + } + + derBytes, err := x509.CreateCertificate(rand.Reader, &template, &template, publicKey(priv), priv) + if err != nil { + log.Fatalf("Failed to create certificate: %s", err) + } + + certOut, err := os.Create("cert.pem") + if err != nil { + log.Fatalf("failed to open cert.pem for writing: %s", err) + } + pem.Encode(certOut, &pem.Block{Type: "CERTIFICATE", Bytes: derBytes}) + certOut.Close() + log.Print("written cert.pem\n") + + keyOut, err := os.OpenFile("key.pem", os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0600) + if err != nil { + log.Print("failed to open key.pem for writing:", err) + return + } + pem.Encode(keyOut, pemBlockForKey(priv)) + keyOut.Close() + log.Print("written key.pem\n") +} diff --git a/src/crypto/tls/handshake_client.go b/src/crypto/tls/handshake_client.go new file mode 100644 index 0000000000000000000000000000000000000000..0b591d7309c2592b9067b8ba796519806260e1fd --- /dev/null +++ b/src/crypto/tls/handshake_client.go @@ -0,0 +1,660 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package tls + +import ( + "bytes" + "crypto" + "crypto/ecdsa" + "crypto/rsa" + "crypto/subtle" + "crypto/x509" + "errors" + "fmt" + "io" + "net" + "strconv" +) + +type clientHandshakeState struct { + c *Conn + serverHello *serverHelloMsg + hello *clientHelloMsg + suite *cipherSuite + finishedHash finishedHash + masterSecret []byte + session *ClientSessionState +} + +func (c *Conn) clientHandshake() error { + if c.config == nil { + c.config = defaultConfig() + } + + if len(c.config.ServerName) == 0 && !c.config.InsecureSkipVerify { + return errors.New("tls: either ServerName or InsecureSkipVerify must be specified in the tls.Config") + } + + nextProtosLength := 0 + for _, proto := range c.config.NextProtos { + if l := len(proto); l == 0 || l > 255 { + return errors.New("tls: invalid NextProtos value") + } else { + nextProtosLength += 1 + l + } + } + if nextProtosLength > 0xffff { + return errors.New("tls: NextProtos values too large") + } + + hello := &clientHelloMsg{ + vers: c.config.maxVersion(), + compressionMethods: []uint8{compressionNone}, + random: make([]byte, 32), + ocspStapling: true, + scts: true, + serverName: c.config.ServerName, + supportedCurves: c.config.curvePreferences(), + supportedPoints: []uint8{pointFormatUncompressed}, + nextProtoNeg: len(c.config.NextProtos) > 0, + secureRenegotiation: true, + alpnProtocols: c.config.NextProtos, + } + + possibleCipherSuites := c.config.cipherSuites() + hello.cipherSuites = make([]uint16, 0, len(possibleCipherSuites)) + +NextCipherSuite: + for _, suiteId := range possibleCipherSuites { + for _, suite := range cipherSuites { + if suite.id != suiteId { + continue + } + // Don't advertise TLS 1.2-only cipher suites unless + // we're attempting TLS 1.2. + if hello.vers < VersionTLS12 && suite.flags&suiteTLS12 != 0 { + continue + } + hello.cipherSuites = append(hello.cipherSuites, suiteId) + continue NextCipherSuite + } + } + + _, err := io.ReadFull(c.config.rand(), hello.random) + if err != nil { + c.sendAlert(alertInternalError) + return errors.New("tls: short read from Rand: " + err.Error()) + } + + if hello.vers >= VersionTLS12 { + hello.signatureAndHashes = supportedSignatureAlgorithms + } + + var session *ClientSessionState + var cacheKey string + sessionCache := c.config.ClientSessionCache + if c.config.SessionTicketsDisabled { + sessionCache = nil + } + + if sessionCache != nil { + hello.ticketSupported = true + + // Try to resume a previously negotiated TLS session, if + // available. + cacheKey = clientSessionCacheKey(c.conn.RemoteAddr(), c.config) + candidateSession, ok := sessionCache.Get(cacheKey) + if ok { + // Check that the ciphersuite/version used for the + // previous session are still valid. + cipherSuiteOk := false + for _, id := range hello.cipherSuites { + if id == candidateSession.cipherSuite { + cipherSuiteOk = true + break + } + } + + versOk := candidateSession.vers >= c.config.minVersion() && + candidateSession.vers <= c.config.maxVersion() + if versOk && cipherSuiteOk { + session = candidateSession + } + } + } + + if session != nil { + hello.sessionTicket = session.sessionTicket + // A random session ID is used to detect when the + // server accepted the ticket and is resuming a session + // (see RFC 5077). + hello.sessionId = make([]byte, 16) + if _, err := io.ReadFull(c.config.rand(), hello.sessionId); err != nil { + c.sendAlert(alertInternalError) + return errors.New("tls: short read from Rand: " + err.Error()) + } + } + + c.writeRecord(recordTypeHandshake, hello.marshal()) + + msg, err := c.readHandshake() + if err != nil { + return err + } + serverHello, ok := msg.(*serverHelloMsg) + if !ok { + c.sendAlert(alertUnexpectedMessage) + return unexpectedMessageError(serverHello, msg) + } + + vers, ok := c.config.mutualVersion(serverHello.vers) + if !ok || vers < VersionTLS10 { + // TLS 1.0 is the minimum version supported as a client. + c.sendAlert(alertProtocolVersion) + return fmt.Errorf("tls: server selected unsupported protocol version %x", serverHello.vers) + } + c.vers = vers + c.haveVers = true + + suite := mutualCipherSuite(c.config.cipherSuites(), serverHello.cipherSuite) + if suite == nil { + c.sendAlert(alertHandshakeFailure) + return fmt.Errorf("tls: server selected an unsupported cipher suite") + } + + hs := &clientHandshakeState{ + c: c, + serverHello: serverHello, + hello: hello, + suite: suite, + finishedHash: newFinishedHash(c.vers, suite), + session: session, + } + + isResume, err := hs.processServerHello() + if err != nil { + return err + } + + // No signatures of the handshake are needed in a resumption. + // Otherwise, in a full handshake, if we don't have any certificates + // configured then we will never send a CertificateVerify message and + // thus no signatures are needed in that case either. + if isResume || len(c.config.Certificates) == 0 { + hs.finishedHash.discardHandshakeBuffer() + } + + hs.finishedHash.Write(hs.hello.marshal()) + hs.finishedHash.Write(hs.serverHello.marshal()) + + if isResume { + if err := hs.establishKeys(); err != nil { + return err + } + if err := hs.readSessionTicket(); err != nil { + return err + } + if err := hs.readFinished(c.firstFinished[:]); err != nil { + return err + } + if err := hs.sendFinished(nil); err != nil { + return err + } + } else { + if err := hs.doFullHandshake(); err != nil { + return err + } + if err := hs.establishKeys(); err != nil { + return err + } + if err := hs.sendFinished(c.firstFinished[:]); err != nil { + return err + } + if err := hs.readSessionTicket(); err != nil { + return err + } + if err := hs.readFinished(nil); err != nil { + return err + } + } + + if sessionCache != nil && hs.session != nil && session != hs.session { + sessionCache.Put(cacheKey, hs.session) + } + + c.didResume = isResume + c.handshakeComplete = true + c.cipherSuite = suite.id + return nil +} + +func (hs *clientHandshakeState) doFullHandshake() error { + c := hs.c + + msg, err := c.readHandshake() + if err != nil { + return err + } + certMsg, ok := msg.(*certificateMsg) + if !ok || len(certMsg.certificates) == 0 { + c.sendAlert(alertUnexpectedMessage) + return unexpectedMessageError(certMsg, msg) + } + hs.finishedHash.Write(certMsg.marshal()) + + certs := make([]*x509.Certificate, len(certMsg.certificates)) + for i, asn1Data := range certMsg.certificates { + cert, err := x509.ParseCertificate(asn1Data) + if err != nil { + c.sendAlert(alertBadCertificate) + return errors.New("tls: failed to parse certificate from server: " + err.Error()) + } + certs[i] = cert + } + + if !c.config.InsecureSkipVerify { + opts := x509.VerifyOptions{ + Roots: c.config.RootCAs, + CurrentTime: c.config.time(), + DNSName: c.config.ServerName, + Intermediates: x509.NewCertPool(), + } + + for i, cert := range certs { + if i == 0 { + continue + } + opts.Intermediates.AddCert(cert) + } + c.verifiedChains, err = certs[0].Verify(opts) + if err != nil { + c.sendAlert(alertBadCertificate) + return err + } + } + + switch certs[0].PublicKey.(type) { + case *rsa.PublicKey, *ecdsa.PublicKey: + break + default: + c.sendAlert(alertUnsupportedCertificate) + return fmt.Errorf("tls: server's certificate contains an unsupported type of public key: %T", certs[0].PublicKey) + } + + c.peerCertificates = certs + + if hs.serverHello.ocspStapling { + msg, err = c.readHandshake() + if err != nil { + return err + } + cs, ok := msg.(*certificateStatusMsg) + if !ok { + c.sendAlert(alertUnexpectedMessage) + return unexpectedMessageError(cs, msg) + } + hs.finishedHash.Write(cs.marshal()) + + if cs.statusType == statusTypeOCSP { + c.ocspResponse = cs.response + } + } + + msg, err = c.readHandshake() + if err != nil { + return err + } + + keyAgreement := hs.suite.ka(c.vers) + + skx, ok := msg.(*serverKeyExchangeMsg) + if ok { + hs.finishedHash.Write(skx.marshal()) + err = keyAgreement.processServerKeyExchange(c.config, hs.hello, hs.serverHello, certs[0], skx) + if err != nil { + c.sendAlert(alertUnexpectedMessage) + return err + } + + msg, err = c.readHandshake() + if err != nil { + return err + } + } + + var chainToSend *Certificate + var certRequested bool + certReq, ok := msg.(*certificateRequestMsg) + if ok { + certRequested = true + + // RFC 4346 on the certificateAuthorities field: + // A list of the distinguished names of acceptable certificate + // authorities. These distinguished names may specify a desired + // distinguished name for a root CA or for a subordinate CA; + // thus, this message can be used to describe both known roots + // and a desired authorization space. If the + // certificate_authorities list is empty then the client MAY + // send any certificate of the appropriate + // ClientCertificateType, unless there is some external + // arrangement to the contrary. + + hs.finishedHash.Write(certReq.marshal()) + + var rsaAvail, ecdsaAvail bool + for _, certType := range certReq.certificateTypes { + switch certType { + case certTypeRSASign: + rsaAvail = true + case certTypeECDSASign: + ecdsaAvail = true + } + } + + // We need to search our list of client certs for one + // where SignatureAlgorithm is acceptable to the server and the + // Issuer is in certReq.certificateAuthorities + findCert: + for i, chain := range c.config.Certificates { + if !rsaAvail && !ecdsaAvail { + continue + } + + for j, cert := range chain.Certificate { + x509Cert := chain.Leaf + // parse the certificate if this isn't the leaf + // node, or if chain.Leaf was nil + if j != 0 || x509Cert == nil { + if x509Cert, err = x509.ParseCertificate(cert); err != nil { + c.sendAlert(alertInternalError) + return errors.New("tls: failed to parse client certificate #" + strconv.Itoa(i) + ": " + err.Error()) + } + } + + switch { + case rsaAvail && x509Cert.PublicKeyAlgorithm == x509.RSA: + case ecdsaAvail && x509Cert.PublicKeyAlgorithm == x509.ECDSA: + default: + continue findCert + } + + if len(certReq.certificateAuthorities) == 0 { + // they gave us an empty list, so just take the + // first cert from c.config.Certificates + chainToSend = &chain + break findCert + } + + for _, ca := range certReq.certificateAuthorities { + if bytes.Equal(x509Cert.RawIssuer, ca) { + chainToSend = &chain + break findCert + } + } + } + } + + msg, err = c.readHandshake() + if err != nil { + return err + } + } + + shd, ok := msg.(*serverHelloDoneMsg) + if !ok { + c.sendAlert(alertUnexpectedMessage) + return unexpectedMessageError(shd, msg) + } + hs.finishedHash.Write(shd.marshal()) + + // If the server requested a certificate then we have to send a + // Certificate message, even if it's empty because we don't have a + // certificate to send. + if certRequested { + certMsg = new(certificateMsg) + if chainToSend != nil { + certMsg.certificates = chainToSend.Certificate + } + hs.finishedHash.Write(certMsg.marshal()) + c.writeRecord(recordTypeHandshake, certMsg.marshal()) + } + + preMasterSecret, ckx, err := keyAgreement.generateClientKeyExchange(c.config, hs.hello, certs[0]) + if err != nil { + c.sendAlert(alertInternalError) + return err + } + if ckx != nil { + hs.finishedHash.Write(ckx.marshal()) + c.writeRecord(recordTypeHandshake, ckx.marshal()) + } + + if chainToSend != nil { + certVerify := &certificateVerifyMsg{ + hasSignatureAndHash: c.vers >= VersionTLS12, + } + + key, ok := chainToSend.PrivateKey.(crypto.Signer) + if !ok { + c.sendAlert(alertInternalError) + return fmt.Errorf("tls: client certificate private key of type %T does not implement crypto.Signer", chainToSend.PrivateKey) + } + + var signatureType uint8 + switch key.Public().(type) { + case *ecdsa.PublicKey: + signatureType = signatureECDSA + case *rsa.PublicKey: + signatureType = signatureRSA + default: + c.sendAlert(alertInternalError) + return fmt.Errorf("tls: failed to sign handshake with client certificate: unknown client certificate key type: %T", key) + } + + certVerify.signatureAndHash, err = hs.finishedHash.selectClientCertSignatureAlgorithm(certReq.signatureAndHashes, signatureType) + if err != nil { + c.sendAlert(alertInternalError) + return err + } + digest, hashFunc, err := hs.finishedHash.hashForClientCertificate(certVerify.signatureAndHash, hs.masterSecret) + if err != nil { + c.sendAlert(alertInternalError) + return err + } + certVerify.signature, err = key.Sign(c.config.rand(), digest, hashFunc) + if err != nil { + c.sendAlert(alertInternalError) + return err + } + + hs.finishedHash.Write(certVerify.marshal()) + c.writeRecord(recordTypeHandshake, certVerify.marshal()) + } + + hs.masterSecret = masterFromPreMasterSecret(c.vers, hs.suite, preMasterSecret, hs.hello.random, hs.serverHello.random) + + hs.finishedHash.discardHandshakeBuffer() + + return nil +} + +func (hs *clientHandshakeState) establishKeys() error { + c := hs.c + + clientMAC, serverMAC, clientKey, serverKey, clientIV, serverIV := + keysFromMasterSecret(c.vers, hs.suite, hs.masterSecret, hs.hello.random, hs.serverHello.random, hs.suite.macLen, hs.suite.keyLen, hs.suite.ivLen) + var clientCipher, serverCipher interface{} + var clientHash, serverHash macFunction + if hs.suite.cipher != nil { + clientCipher = hs.suite.cipher(clientKey, clientIV, false /* not for reading */) + clientHash = hs.suite.mac(c.vers, clientMAC) + serverCipher = hs.suite.cipher(serverKey, serverIV, true /* for reading */) + serverHash = hs.suite.mac(c.vers, serverMAC) + } else { + clientCipher = hs.suite.aead(clientKey, clientIV) + serverCipher = hs.suite.aead(serverKey, serverIV) + } + + c.in.prepareCipherSpec(c.vers, serverCipher, serverHash) + c.out.prepareCipherSpec(c.vers, clientCipher, clientHash) + return nil +} + +func (hs *clientHandshakeState) serverResumedSession() bool { + // If the server responded with the same sessionId then it means the + // sessionTicket is being used to resume a TLS session. + return hs.session != nil && hs.hello.sessionId != nil && + bytes.Equal(hs.serverHello.sessionId, hs.hello.sessionId) +} + +func (hs *clientHandshakeState) processServerHello() (bool, error) { + c := hs.c + + if hs.serverHello.compressionMethod != compressionNone { + c.sendAlert(alertUnexpectedMessage) + return false, errors.New("tls: server selected unsupported compression format") + } + + clientDidNPN := hs.hello.nextProtoNeg + clientDidALPN := len(hs.hello.alpnProtocols) > 0 + serverHasNPN := hs.serverHello.nextProtoNeg + serverHasALPN := len(hs.serverHello.alpnProtocol) > 0 + + if !clientDidNPN && serverHasNPN { + c.sendAlert(alertHandshakeFailure) + return false, errors.New("server advertised unrequested NPN extension") + } + + if !clientDidALPN && serverHasALPN { + c.sendAlert(alertHandshakeFailure) + return false, errors.New("server advertised unrequested ALPN extension") + } + + if serverHasNPN && serverHasALPN { + c.sendAlert(alertHandshakeFailure) + return false, errors.New("server advertised both NPN and ALPN extensions") + } + + if serverHasALPN { + c.clientProtocol = hs.serverHello.alpnProtocol + c.clientProtocolFallback = false + } + c.scts = hs.serverHello.scts + + if hs.serverResumedSession() { + // Restore masterSecret and peerCerts from previous state + hs.masterSecret = hs.session.masterSecret + c.peerCertificates = hs.session.serverCertificates + c.verifiedChains = hs.session.verifiedChains + return true, nil + } + return false, nil +} + +func (hs *clientHandshakeState) readFinished(out []byte) error { + c := hs.c + + c.readRecord(recordTypeChangeCipherSpec) + if err := c.in.error(); err != nil { + return err + } + + msg, err := c.readHandshake() + if err != nil { + return err + } + serverFinished, ok := msg.(*finishedMsg) + if !ok { + c.sendAlert(alertUnexpectedMessage) + return unexpectedMessageError(serverFinished, msg) + } + + verify := hs.finishedHash.serverSum(hs.masterSecret) + if len(verify) != len(serverFinished.verifyData) || + subtle.ConstantTimeCompare(verify, serverFinished.verifyData) != 1 { + c.sendAlert(alertHandshakeFailure) + return errors.New("tls: server's Finished message was incorrect") + } + hs.finishedHash.Write(serverFinished.marshal()) + copy(out, verify) + return nil +} + +func (hs *clientHandshakeState) readSessionTicket() error { + if !hs.serverHello.ticketSupported { + return nil + } + + c := hs.c + msg, err := c.readHandshake() + if err != nil { + return err + } + sessionTicketMsg, ok := msg.(*newSessionTicketMsg) + if !ok { + c.sendAlert(alertUnexpectedMessage) + return unexpectedMessageError(sessionTicketMsg, msg) + } + hs.finishedHash.Write(sessionTicketMsg.marshal()) + + hs.session = &ClientSessionState{ + sessionTicket: sessionTicketMsg.ticket, + vers: c.vers, + cipherSuite: hs.suite.id, + masterSecret: hs.masterSecret, + serverCertificates: c.peerCertificates, + verifiedChains: c.verifiedChains, + } + + return nil +} + +func (hs *clientHandshakeState) sendFinished(out []byte) error { + c := hs.c + + c.writeRecord(recordTypeChangeCipherSpec, []byte{1}) + if hs.serverHello.nextProtoNeg { + nextProto := new(nextProtoMsg) + proto, fallback := mutualProtocol(c.config.NextProtos, hs.serverHello.nextProtos) + nextProto.proto = proto + c.clientProtocol = proto + c.clientProtocolFallback = fallback + + hs.finishedHash.Write(nextProto.marshal()) + c.writeRecord(recordTypeHandshake, nextProto.marshal()) + } + + finished := new(finishedMsg) + finished.verifyData = hs.finishedHash.clientSum(hs.masterSecret) + hs.finishedHash.Write(finished.marshal()) + c.writeRecord(recordTypeHandshake, finished.marshal()) + copy(out, finished.verifyData) + return nil +} + +// clientSessionCacheKey returns a key used to cache sessionTickets that could +// be used to resume previously negotiated TLS sessions with a server. +func clientSessionCacheKey(serverAddr net.Addr, config *Config) string { + if len(config.ServerName) > 0 { + return config.ServerName + } + return serverAddr.String() +} + +// mutualProtocol finds the mutual Next Protocol Negotiation or ALPN protocol +// given list of possible protocols and a list of the preference order. The +// first list must not be empty. It returns the resulting protocol and flag +// indicating if the fallback case was reached. +func mutualProtocol(protos, preferenceProtos []string) (string, bool) { + for _, s := range preferenceProtos { + for _, c := range protos { + if s == c { + return s, false + } + } + } + + return protos[0], true +} diff --git a/src/crypto/tls/handshake_client_test.go b/src/crypto/tls/handshake_client_test.go new file mode 100644 index 0000000000000000000000000000000000000000..664fe8de6a0c73b0439cffcc5621955f49c955fd --- /dev/null +++ b/src/crypto/tls/handshake_client_test.go @@ -0,0 +1,602 @@ +// Copyright 2010 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package tls + +import ( + "bytes" + "crypto/ecdsa" + "crypto/rsa" + "crypto/x509" + "encoding/base64" + "encoding/binary" + "encoding/pem" + "fmt" + "io" + "net" + "os" + "os/exec" + "path/filepath" + "strconv" + "testing" + "time" +) + +// Note: see comment in handshake_test.go for details of how the reference +// tests work. + +// blockingSource is an io.Reader that blocks a Read call until it's closed. +type blockingSource chan bool + +func (b blockingSource) Read([]byte) (n int, err error) { + <-b + return 0, io.EOF +} + +// clientTest represents a test of the TLS client handshake against a reference +// implementation. +type clientTest struct { + // name is a freeform string identifying the test and the file in which + // the expected results will be stored. + name string + // command, if not empty, contains a series of arguments for the + // command to run for the reference server. + command []string + // config, if not nil, contains a custom Config to use for this test. + config *Config + // cert, if not empty, contains a DER-encoded certificate for the + // reference server. + cert []byte + // key, if not nil, contains either a *rsa.PrivateKey or + // *ecdsa.PrivateKey which is the private key for the reference server. + key interface{} + // extensions, if not nil, contains a list of extension data to be returned + // from the ServerHello. The data should be in standard TLS format with + // a 2-byte uint16 type, 2-byte data length, followed by the extension data. + extensions [][]byte + // validate, if not nil, is a function that will be called with the + // ConnectionState of the resulting connection. It returns a non-nil + // error if the ConnectionState is unacceptable. + validate func(ConnectionState) error +} + +var defaultServerCommand = []string{"openssl", "s_server"} + +// connFromCommand starts the reference server process, connects to it and +// returns a recordingConn for the connection. The stdin return value is a +// blockingSource for the stdin of the child process. It must be closed before +// Waiting for child. +func (test *clientTest) connFromCommand() (conn *recordingConn, child *exec.Cmd, stdin blockingSource, err error) { + cert := testRSACertificate + if len(test.cert) > 0 { + cert = test.cert + } + certPath := tempFile(string(cert)) + defer os.Remove(certPath) + + var key interface{} = testRSAPrivateKey + if test.key != nil { + key = test.key + } + var pemType string + var derBytes []byte + switch key := key.(type) { + case *rsa.PrivateKey: + pemType = "RSA" + derBytes = x509.MarshalPKCS1PrivateKey(key) + case *ecdsa.PrivateKey: + pemType = "EC" + var err error + derBytes, err = x509.MarshalECPrivateKey(key) + if err != nil { + panic(err) + } + default: + panic("unknown key type") + } + + var pemOut bytes.Buffer + pem.Encode(&pemOut, &pem.Block{Type: pemType + " PRIVATE KEY", Bytes: derBytes}) + + keyPath := tempFile(string(pemOut.Bytes())) + defer os.Remove(keyPath) + + var command []string + if len(test.command) > 0 { + command = append(command, test.command...) + } else { + command = append(command, defaultServerCommand...) + } + command = append(command, "-cert", certPath, "-certform", "DER", "-key", keyPath) + // serverPort contains the port that OpenSSL will listen on. OpenSSL + // can't take "0" as an argument here so we have to pick a number and + // hope that it's not in use on the machine. Since this only occurs + // when -update is given and thus when there's a human watching the + // test, this isn't too bad. + const serverPort = 24323 + command = append(command, "-accept", strconv.Itoa(serverPort)) + + if len(test.extensions) > 0 { + var serverInfo bytes.Buffer + for _, ext := range test.extensions { + pem.Encode(&serverInfo, &pem.Block{ + Type: fmt.Sprintf("SERVERINFO FOR EXTENSION %d", binary.BigEndian.Uint16(ext)), + Bytes: ext, + }) + } + serverInfoPath := tempFile(serverInfo.String()) + defer os.Remove(serverInfoPath) + command = append(command, "-serverinfo", serverInfoPath) + } + + cmd := exec.Command(command[0], command[1:]...) + stdin = blockingSource(make(chan bool)) + cmd.Stdin = stdin + var out bytes.Buffer + cmd.Stdout = &out + cmd.Stderr = &out + if err := cmd.Start(); err != nil { + return nil, nil, nil, err + } + + // OpenSSL does print an "ACCEPT" banner, but it does so *before* + // opening the listening socket, so we can't use that to wait until it + // has started listening. Thus we are forced to poll until we get a + // connection. + var tcpConn net.Conn + for i := uint(0); i < 5; i++ { + tcpConn, err = net.DialTCP("tcp", nil, &net.TCPAddr{ + IP: net.IPv4(127, 0, 0, 1), + Port: serverPort, + }) + if err == nil { + break + } + time.Sleep((1 << i) * 5 * time.Millisecond) + } + if err != nil { + close(stdin) + out.WriteTo(os.Stdout) + cmd.Process.Kill() + return nil, nil, nil, cmd.Wait() + } + + record := &recordingConn{ + Conn: tcpConn, + } + + return record, cmd, stdin, nil +} + +func (test *clientTest) dataPath() string { + return filepath.Join("testdata", "Client-"+test.name) +} + +func (test *clientTest) loadData() (flows [][]byte, err error) { + in, err := os.Open(test.dataPath()) + if err != nil { + return nil, err + } + defer in.Close() + return parseTestData(in) +} + +func (test *clientTest) run(t *testing.T, write bool) { + var clientConn, serverConn net.Conn + var recordingConn *recordingConn + var childProcess *exec.Cmd + var stdin blockingSource + + if write { + var err error + recordingConn, childProcess, stdin, err = test.connFromCommand() + if err != nil { + t.Fatalf("Failed to start subcommand: %s", err) + } + clientConn = recordingConn + } else { + clientConn, serverConn = net.Pipe() + } + + config := test.config + if config == nil { + config = testConfig + } + client := Client(clientConn, config) + + doneChan := make(chan bool) + go func() { + if _, err := client.Write([]byte("hello\n")); err != nil { + t.Errorf("Client.Write failed: %s", err) + } + if test.validate != nil { + if err := test.validate(client.ConnectionState()); err != nil { + t.Errorf("validate callback returned error: %s", err) + } + } + client.Close() + clientConn.Close() + doneChan <- true + }() + + if !write { + flows, err := test.loadData() + if err != nil { + t.Fatalf("%s: failed to load data from %s: %v", test.name, test.dataPath(), err) + } + for i, b := range flows { + if i%2 == 1 { + serverConn.Write(b) + continue + } + bb := make([]byte, len(b)) + _, err := io.ReadFull(serverConn, bb) + if err != nil { + t.Fatalf("%s #%d: %s", test.name, i, err) + } + if !bytes.Equal(b, bb) { + t.Fatalf("%s #%d: mismatch on read: got:%x want:%x", test.name, i, bb, b) + } + } + serverConn.Close() + } + + <-doneChan + + if write { + path := test.dataPath() + out, err := os.OpenFile(path, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0644) + if err != nil { + t.Fatalf("Failed to create output file: %s", err) + } + defer out.Close() + recordingConn.Close() + close(stdin) + childProcess.Process.Kill() + childProcess.Wait() + if len(recordingConn.flows) < 3 { + childProcess.Stdout.(*bytes.Buffer).WriteTo(os.Stdout) + t.Fatalf("Client connection didn't work") + } + recordingConn.WriteTo(out) + fmt.Printf("Wrote %s\n", path) + } +} + +func runClientTestForVersion(t *testing.T, template *clientTest, prefix, option string) { + test := *template + test.name = prefix + test.name + if len(test.command) == 0 { + test.command = defaultClientCommand + } + test.command = append([]string(nil), test.command...) + test.command = append(test.command, option) + test.run(t, *update) +} + +func runClientTestTLS10(t *testing.T, template *clientTest) { + runClientTestForVersion(t, template, "TLSv10-", "-tls1") +} + +func runClientTestTLS11(t *testing.T, template *clientTest) { + runClientTestForVersion(t, template, "TLSv11-", "-tls1_1") +} + +func runClientTestTLS12(t *testing.T, template *clientTest) { + runClientTestForVersion(t, template, "TLSv12-", "-tls1_2") +} + +func TestHandshakeClientRSARC4(t *testing.T) { + test := &clientTest{ + name: "RSA-RC4", + command: []string{"openssl", "s_server", "-cipher", "RC4-SHA"}, + } + runClientTestTLS10(t, test) + runClientTestTLS11(t, test) + runClientTestTLS12(t, test) +} + +func TestHandshakeClientECDHERSAAES(t *testing.T) { + test := &clientTest{ + name: "ECDHE-RSA-AES", + command: []string{"openssl", "s_server", "-cipher", "ECDHE-RSA-AES128-SHA"}, + } + runClientTestTLS10(t, test) + runClientTestTLS11(t, test) + runClientTestTLS12(t, test) +} + +func TestHandshakeClientECDHEECDSAAES(t *testing.T) { + test := &clientTest{ + name: "ECDHE-ECDSA-AES", + command: []string{"openssl", "s_server", "-cipher", "ECDHE-ECDSA-AES128-SHA"}, + cert: testECDSACertificate, + key: testECDSAPrivateKey, + } + runClientTestTLS10(t, test) + runClientTestTLS11(t, test) + runClientTestTLS12(t, test) +} + +func TestHandshakeClientECDHEECDSAAESGCM(t *testing.T) { + test := &clientTest{ + name: "ECDHE-ECDSA-AES-GCM", + command: []string{"openssl", "s_server", "-cipher", "ECDHE-ECDSA-AES128-GCM-SHA256"}, + cert: testECDSACertificate, + key: testECDSAPrivateKey, + } + runClientTestTLS12(t, test) +} + +func TestHandshakeClientAES256GCMSHA384(t *testing.T) { + test := &clientTest{ + name: "ECDHE-ECDSA-AES256-GCM-SHA384", + command: []string{"openssl", "s_server", "-cipher", "ECDHE-ECDSA-AES256-GCM-SHA384"}, + cert: testECDSACertificate, + key: testECDSAPrivateKey, + } + runClientTestTLS12(t, test) +} + +func TestHandshakeClientCertRSA(t *testing.T) { + config := *testConfig + cert, _ := X509KeyPair([]byte(clientCertificatePEM), []byte(clientKeyPEM)) + config.Certificates = []Certificate{cert} + + test := &clientTest{ + name: "ClientCert-RSA-RSA", + command: []string{"openssl", "s_server", "-cipher", "RC4-SHA", "-verify", "1"}, + config: &config, + } + + runClientTestTLS10(t, test) + runClientTestTLS12(t, test) + + test = &clientTest{ + name: "ClientCert-RSA-ECDSA", + command: []string{"openssl", "s_server", "-cipher", "ECDHE-ECDSA-AES128-SHA", "-verify", "1"}, + config: &config, + cert: testECDSACertificate, + key: testECDSAPrivateKey, + } + + runClientTestTLS10(t, test) + runClientTestTLS12(t, test) + + test = &clientTest{ + name: "ClientCert-RSA-AES256-GCM-SHA384", + command: []string{"openssl", "s_server", "-cipher", "ECDHE-RSA-AES256-GCM-SHA384", "-verify", "1"}, + config: &config, + cert: testRSACertificate, + key: testRSAPrivateKey, + } + + runClientTestTLS12(t, test) +} + +func TestHandshakeClientCertECDSA(t *testing.T) { + config := *testConfig + cert, _ := X509KeyPair([]byte(clientECDSACertificatePEM), []byte(clientECDSAKeyPEM)) + config.Certificates = []Certificate{cert} + + test := &clientTest{ + name: "ClientCert-ECDSA-RSA", + command: []string{"openssl", "s_server", "-cipher", "RC4-SHA", "-verify", "1"}, + config: &config, + } + + runClientTestTLS10(t, test) + runClientTestTLS12(t, test) + + test = &clientTest{ + name: "ClientCert-ECDSA-ECDSA", + command: []string{"openssl", "s_server", "-cipher", "ECDHE-ECDSA-AES128-SHA", "-verify", "1"}, + config: &config, + cert: testECDSACertificate, + key: testECDSAPrivateKey, + } + + runClientTestTLS10(t, test) + runClientTestTLS12(t, test) +} + +func TestClientResumption(t *testing.T) { + serverConfig := &Config{ + CipherSuites: []uint16{TLS_RSA_WITH_RC4_128_SHA, TLS_ECDHE_RSA_WITH_RC4_128_SHA}, + Certificates: testConfig.Certificates, + } + + issuer, err := x509.ParseCertificate(testRSACertificateIssuer) + if err != nil { + panic(err) + } + + rootCAs := x509.NewCertPool() + rootCAs.AddCert(issuer) + + clientConfig := &Config{ + CipherSuites: []uint16{TLS_RSA_WITH_RC4_128_SHA}, + ClientSessionCache: NewLRUClientSessionCache(32), + RootCAs: rootCAs, + ServerName: "example.golang", + } + + testResumeState := func(test string, didResume bool) { + _, hs, err := testHandshake(clientConfig, serverConfig) + if err != nil { + t.Fatalf("%s: handshake failed: %s", test, err) + } + if hs.DidResume != didResume { + t.Fatalf("%s resumed: %v, expected: %v", test, hs.DidResume, didResume) + } + if didResume && (hs.PeerCertificates == nil || hs.VerifiedChains == nil) { + t.Fatalf("expected non-nil certificates after resumption. Got peerCertificates: %#v, verifedCertificates: %#v", hs.PeerCertificates, hs.VerifiedChains) + } + } + + getTicket := func() []byte { + return clientConfig.ClientSessionCache.(*lruSessionCache).q.Front().Value.(*lruSessionCacheEntry).state.sessionTicket + } + randomKey := func() [32]byte { + var k [32]byte + if _, err := io.ReadFull(serverConfig.rand(), k[:]); err != nil { + t.Fatalf("Failed to read new SessionTicketKey: %s", err) + } + return k + } + + testResumeState("Handshake", false) + ticket := getTicket() + testResumeState("Resume", true) + if !bytes.Equal(ticket, getTicket()) { + t.Fatal("first ticket doesn't match ticket after resumption") + } + + key2 := randomKey() + serverConfig.SetSessionTicketKeys([][32]byte{key2}) + + testResumeState("InvalidSessionTicketKey", false) + testResumeState("ResumeAfterInvalidSessionTicketKey", true) + + serverConfig.SetSessionTicketKeys([][32]byte{randomKey(), key2}) + ticket = getTicket() + testResumeState("KeyChange", true) + if bytes.Equal(ticket, getTicket()) { + t.Fatal("new ticket wasn't included while resuming") + } + testResumeState("KeyChangeFinish", true) + + clientConfig.CipherSuites = []uint16{TLS_ECDHE_RSA_WITH_RC4_128_SHA} + testResumeState("DifferentCipherSuite", false) + testResumeState("DifferentCipherSuiteRecovers", true) + + clientConfig.ClientSessionCache = nil + testResumeState("WithoutSessionCache", false) +} + +func TestLRUClientSessionCache(t *testing.T) { + // Initialize cache of capacity 4. + cache := NewLRUClientSessionCache(4) + cs := make([]ClientSessionState, 6) + keys := []string{"0", "1", "2", "3", "4", "5", "6"} + + // Add 4 entries to the cache and look them up. + for i := 0; i < 4; i++ { + cache.Put(keys[i], &cs[i]) + } + for i := 0; i < 4; i++ { + if s, ok := cache.Get(keys[i]); !ok || s != &cs[i] { + t.Fatalf("session cache failed lookup for added key: %s", keys[i]) + } + } + + // Add 2 more entries to the cache. First 2 should be evicted. + for i := 4; i < 6; i++ { + cache.Put(keys[i], &cs[i]) + } + for i := 0; i < 2; i++ { + if s, ok := cache.Get(keys[i]); ok || s != nil { + t.Fatalf("session cache should have evicted key: %s", keys[i]) + } + } + + // Touch entry 2. LRU should evict 3 next. + cache.Get(keys[2]) + cache.Put(keys[0], &cs[0]) + if s, ok := cache.Get(keys[3]); ok || s != nil { + t.Fatalf("session cache should have evicted key 3") + } + + // Update entry 0 in place. + cache.Put(keys[0], &cs[3]) + if s, ok := cache.Get(keys[0]); !ok || s != &cs[3] { + t.Fatalf("session cache failed update for key 0") + } + + // Adding a nil entry is valid. + cache.Put(keys[0], nil) + if s, ok := cache.Get(keys[0]); !ok || s != nil { + t.Fatalf("failed to add nil entry to cache") + } +} + +func TestHandshakeClientALPNMatch(t *testing.T) { + config := *testConfig + config.NextProtos = []string{"proto2", "proto1"} + + test := &clientTest{ + name: "ALPN", + // Note that this needs OpenSSL 1.0.2 because that is the first + // version that supports the -alpn flag. + command: []string{"openssl", "s_server", "-alpn", "proto1,proto2"}, + config: &config, + validate: func(state ConnectionState) error { + // The server's preferences should override the client. + if state.NegotiatedProtocol != "proto1" { + return fmt.Errorf("Got protocol %q, wanted proto1", state.NegotiatedProtocol) + } + return nil + }, + } + runClientTestTLS12(t, test) +} + +func TestHandshakeClientALPNNoMatch(t *testing.T) { + config := *testConfig + config.NextProtos = []string{"proto3"} + + test := &clientTest{ + name: "ALPN-NoMatch", + // Note that this needs OpenSSL 1.0.2 because that is the first + // version that supports the -alpn flag. + command: []string{"openssl", "s_server", "-alpn", "proto1,proto2"}, + config: &config, + validate: func(state ConnectionState) error { + // There's no overlap so OpenSSL will not select a protocol. + if state.NegotiatedProtocol != "" { + return fmt.Errorf("Got protocol %q, wanted ''", state.NegotiatedProtocol) + } + return nil + }, + } + runClientTestTLS12(t, test) +} + +// sctsBase64 contains data from `openssl s_client -serverinfo 18 -connect ritter.vg:443` +const sctsBase64 = "ABIBaQFnAHUApLkJkLQYWBSHuxOizGdwCjw1mAT5G9+443fNDsgN3BAAAAFHl5nuFgAABAMARjBEAiAcS4JdlW5nW9sElUv2zvQyPoZ6ejKrGGB03gjaBZFMLwIgc1Qbbn+hsH0RvObzhS+XZhr3iuQQJY8S9G85D9KeGPAAdgBo9pj4H2SCvjqM7rkoHUz8cVFdZ5PURNEKZ6y7T0/7xAAAAUeX4bVwAAAEAwBHMEUCIDIhFDgG2HIuADBkGuLobU5a4dlCHoJLliWJ1SYT05z6AiEAjxIoZFFPRNWMGGIjskOTMwXzQ1Wh2e7NxXE1kd1J0QsAdgDuS723dc5guuFCaR+r4Z5mow9+X7By2IMAxHuJeqj9ywAAAUhcZIqHAAAEAwBHMEUCICmJ1rBT09LpkbzxtUC+Hi7nXLR0J+2PmwLp+sJMuqK+AiEAr0NkUnEVKVhAkccIFpYDqHOlZaBsuEhWWrYpg2RtKp0=" + +func TestHandshakClientSCTs(t *testing.T) { + config := *testConfig + + scts, err := base64.StdEncoding.DecodeString(sctsBase64) + if err != nil { + t.Fatal(err) + } + + test := &clientTest{ + name: "SCT", + // Note that this needs OpenSSL 1.0.2 because that is the first + // version that supports the -serverinfo flag. + command: []string{"openssl", "s_server"}, + config: &config, + extensions: [][]byte{scts}, + validate: func(state ConnectionState) error { + expectedSCTs := [][]byte{ + scts[8:125], + scts[127:245], + scts[247:], + } + if n := len(state.SignedCertificateTimestamps); n != len(expectedSCTs) { + return fmt.Errorf("Got %d scts, wanted %d", n, len(expectedSCTs)) + } + for i, expected := range expectedSCTs { + if sct := state.SignedCertificateTimestamps[i]; !bytes.Equal(sct, expected) { + return fmt.Errorf("SCT #%d contained %x, expected %x", i, sct, expected) + } + } + return nil + }, + } + runClientTestTLS12(t, test) +} diff --git a/src/crypto/tls/handshake_messages.go b/src/crypto/tls/handshake_messages.go new file mode 100644 index 0000000000000000000000000000000000000000..799a776799aa1c158562f7e68a5712d0d68a6641 --- /dev/null +++ b/src/crypto/tls/handshake_messages.go @@ -0,0 +1,1524 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package tls + +import "bytes" + +type clientHelloMsg struct { + raw []byte + vers uint16 + random []byte + sessionId []byte + cipherSuites []uint16 + compressionMethods []uint8 + nextProtoNeg bool + serverName string + ocspStapling bool + scts bool + supportedCurves []CurveID + supportedPoints []uint8 + ticketSupported bool + sessionTicket []uint8 + signatureAndHashes []signatureAndHash + secureRenegotiation bool + alpnProtocols []string +} + +func (m *clientHelloMsg) equal(i interface{}) bool { + m1, ok := i.(*clientHelloMsg) + if !ok { + return false + } + + return bytes.Equal(m.raw, m1.raw) && + m.vers == m1.vers && + bytes.Equal(m.random, m1.random) && + bytes.Equal(m.sessionId, m1.sessionId) && + eqUint16s(m.cipherSuites, m1.cipherSuites) && + bytes.Equal(m.compressionMethods, m1.compressionMethods) && + m.nextProtoNeg == m1.nextProtoNeg && + m.serverName == m1.serverName && + m.ocspStapling == m1.ocspStapling && + m.scts == m1.scts && + eqCurveIDs(m.supportedCurves, m1.supportedCurves) && + bytes.Equal(m.supportedPoints, m1.supportedPoints) && + m.ticketSupported == m1.ticketSupported && + bytes.Equal(m.sessionTicket, m1.sessionTicket) && + eqSignatureAndHashes(m.signatureAndHashes, m1.signatureAndHashes) && + m.secureRenegotiation == m1.secureRenegotiation && + eqStrings(m.alpnProtocols, m1.alpnProtocols) +} + +func (m *clientHelloMsg) marshal() []byte { + if m.raw != nil { + return m.raw + } + + length := 2 + 32 + 1 + len(m.sessionId) + 2 + len(m.cipherSuites)*2 + 1 + len(m.compressionMethods) + numExtensions := 0 + extensionsLength := 0 + if m.nextProtoNeg { + numExtensions++ + } + if m.ocspStapling { + extensionsLength += 1 + 2 + 2 + numExtensions++ + } + if len(m.serverName) > 0 { + extensionsLength += 5 + len(m.serverName) + numExtensions++ + } + if len(m.supportedCurves) > 0 { + extensionsLength += 2 + 2*len(m.supportedCurves) + numExtensions++ + } + if len(m.supportedPoints) > 0 { + extensionsLength += 1 + len(m.supportedPoints) + numExtensions++ + } + if m.ticketSupported { + extensionsLength += len(m.sessionTicket) + numExtensions++ + } + if len(m.signatureAndHashes) > 0 { + extensionsLength += 2 + 2*len(m.signatureAndHashes) + numExtensions++ + } + if m.secureRenegotiation { + extensionsLength += 1 + numExtensions++ + } + if len(m.alpnProtocols) > 0 { + extensionsLength += 2 + for _, s := range m.alpnProtocols { + if l := len(s); l == 0 || l > 255 { + panic("invalid ALPN protocol") + } + extensionsLength++ + extensionsLength += len(s) + } + numExtensions++ + } + if m.scts { + numExtensions++ + } + if numExtensions > 0 { + extensionsLength += 4 * numExtensions + length += 2 + extensionsLength + } + + x := make([]byte, 4+length) + x[0] = typeClientHello + x[1] = uint8(length >> 16) + x[2] = uint8(length >> 8) + x[3] = uint8(length) + x[4] = uint8(m.vers >> 8) + x[5] = uint8(m.vers) + copy(x[6:38], m.random) + x[38] = uint8(len(m.sessionId)) + copy(x[39:39+len(m.sessionId)], m.sessionId) + y := x[39+len(m.sessionId):] + y[0] = uint8(len(m.cipherSuites) >> 7) + y[1] = uint8(len(m.cipherSuites) << 1) + for i, suite := range m.cipherSuites { + y[2+i*2] = uint8(suite >> 8) + y[3+i*2] = uint8(suite) + } + z := y[2+len(m.cipherSuites)*2:] + z[0] = uint8(len(m.compressionMethods)) + copy(z[1:], m.compressionMethods) + + z = z[1+len(m.compressionMethods):] + if numExtensions > 0 { + z[0] = byte(extensionsLength >> 8) + z[1] = byte(extensionsLength) + z = z[2:] + } + if m.nextProtoNeg { + z[0] = byte(extensionNextProtoNeg >> 8) + z[1] = byte(extensionNextProtoNeg & 0xff) + // The length is always 0 + z = z[4:] + } + if len(m.serverName) > 0 { + z[0] = byte(extensionServerName >> 8) + z[1] = byte(extensionServerName & 0xff) + l := len(m.serverName) + 5 + z[2] = byte(l >> 8) + z[3] = byte(l) + z = z[4:] + + // RFC 3546, section 3.1 + // + // struct { + // NameType name_type; + // select (name_type) { + // case host_name: HostName; + // } name; + // } ServerName; + // + // enum { + // host_name(0), (255) + // } NameType; + // + // opaque HostName<1..2^16-1>; + // + // struct { + // ServerName server_name_list<1..2^16-1> + // } ServerNameList; + + z[0] = byte((len(m.serverName) + 3) >> 8) + z[1] = byte(len(m.serverName) + 3) + z[3] = byte(len(m.serverName) >> 8) + z[4] = byte(len(m.serverName)) + copy(z[5:], []byte(m.serverName)) + z = z[l:] + } + if m.ocspStapling { + // RFC 4366, section 3.6 + z[0] = byte(extensionStatusRequest >> 8) + z[1] = byte(extensionStatusRequest) + z[2] = 0 + z[3] = 5 + z[4] = 1 // OCSP type + // Two zero valued uint16s for the two lengths. + z = z[9:] + } + if len(m.supportedCurves) > 0 { + // http://tools.ietf.org/html/rfc4492#section-5.5.1 + z[0] = byte(extensionSupportedCurves >> 8) + z[1] = byte(extensionSupportedCurves) + l := 2 + 2*len(m.supportedCurves) + z[2] = byte(l >> 8) + z[3] = byte(l) + l -= 2 + z[4] = byte(l >> 8) + z[5] = byte(l) + z = z[6:] + for _, curve := range m.supportedCurves { + z[0] = byte(curve >> 8) + z[1] = byte(curve) + z = z[2:] + } + } + if len(m.supportedPoints) > 0 { + // http://tools.ietf.org/html/rfc4492#section-5.5.2 + z[0] = byte(extensionSupportedPoints >> 8) + z[1] = byte(extensionSupportedPoints) + l := 1 + len(m.supportedPoints) + z[2] = byte(l >> 8) + z[3] = byte(l) + l-- + z[4] = byte(l) + z = z[5:] + for _, pointFormat := range m.supportedPoints { + z[0] = byte(pointFormat) + z = z[1:] + } + } + if m.ticketSupported { + // http://tools.ietf.org/html/rfc5077#section-3.2 + z[0] = byte(extensionSessionTicket >> 8) + z[1] = byte(extensionSessionTicket) + l := len(m.sessionTicket) + z[2] = byte(l >> 8) + z[3] = byte(l) + z = z[4:] + copy(z, m.sessionTicket) + z = z[len(m.sessionTicket):] + } + if len(m.signatureAndHashes) > 0 { + // https://tools.ietf.org/html/rfc5246#section-7.4.1.4.1 + z[0] = byte(extensionSignatureAlgorithms >> 8) + z[1] = byte(extensionSignatureAlgorithms) + l := 2 + 2*len(m.signatureAndHashes) + z[2] = byte(l >> 8) + z[3] = byte(l) + z = z[4:] + + l -= 2 + z[0] = byte(l >> 8) + z[1] = byte(l) + z = z[2:] + for _, sigAndHash := range m.signatureAndHashes { + z[0] = sigAndHash.hash + z[1] = sigAndHash.signature + z = z[2:] + } + } + if m.secureRenegotiation { + z[0] = byte(extensionRenegotiationInfo >> 8) + z[1] = byte(extensionRenegotiationInfo & 0xff) + z[2] = 0 + z[3] = 1 + z = z[5:] + } + if len(m.alpnProtocols) > 0 { + z[0] = byte(extensionALPN >> 8) + z[1] = byte(extensionALPN & 0xff) + lengths := z[2:] + z = z[6:] + + stringsLength := 0 + for _, s := range m.alpnProtocols { + l := len(s) + z[0] = byte(l) + copy(z[1:], s) + z = z[1+l:] + stringsLength += 1 + l + } + + lengths[2] = byte(stringsLength >> 8) + lengths[3] = byte(stringsLength) + stringsLength += 2 + lengths[0] = byte(stringsLength >> 8) + lengths[1] = byte(stringsLength) + } + if m.scts { + // https://tools.ietf.org/html/rfc6962#section-3.3.1 + z[0] = byte(extensionSCT >> 8) + z[1] = byte(extensionSCT) + // zero uint16 for the zero-length extension_data + z = z[4:] + } + + m.raw = x + + return x +} + +func (m *clientHelloMsg) unmarshal(data []byte) bool { + if len(data) < 42 { + return false + } + m.raw = data + m.vers = uint16(data[4])<<8 | uint16(data[5]) + m.random = data[6:38] + sessionIdLen := int(data[38]) + if sessionIdLen > 32 || len(data) < 39+sessionIdLen { + return false + } + m.sessionId = data[39 : 39+sessionIdLen] + data = data[39+sessionIdLen:] + if len(data) < 2 { + return false + } + // cipherSuiteLen is the number of bytes of cipher suite numbers. Since + // they are uint16s, the number must be even. + cipherSuiteLen := int(data[0])<<8 | int(data[1]) + if cipherSuiteLen%2 == 1 || len(data) < 2+cipherSuiteLen { + return false + } + numCipherSuites := cipherSuiteLen / 2 + m.cipherSuites = make([]uint16, numCipherSuites) + for i := 0; i < numCipherSuites; i++ { + m.cipherSuites[i] = uint16(data[2+2*i])<<8 | uint16(data[3+2*i]) + if m.cipherSuites[i] == scsvRenegotiation { + m.secureRenegotiation = true + } + } + data = data[2+cipherSuiteLen:] + if len(data) < 1 { + return false + } + compressionMethodsLen := int(data[0]) + if len(data) < 1+compressionMethodsLen { + return false + } + m.compressionMethods = data[1 : 1+compressionMethodsLen] + + data = data[1+compressionMethodsLen:] + + m.nextProtoNeg = false + m.serverName = "" + m.ocspStapling = false + m.ticketSupported = false + m.sessionTicket = nil + m.signatureAndHashes = nil + m.alpnProtocols = nil + m.scts = false + + if len(data) == 0 { + // ClientHello is optionally followed by extension data + return true + } + if len(data) < 2 { + return false + } + + extensionsLength := int(data[0])<<8 | int(data[1]) + data = data[2:] + if extensionsLength != len(data) { + return false + } + + for len(data) != 0 { + if len(data) < 4 { + return false + } + extension := uint16(data[0])<<8 | uint16(data[1]) + length := int(data[2])<<8 | int(data[3]) + data = data[4:] + if len(data) < length { + return false + } + + switch extension { + case extensionServerName: + d := data[:length] + if len(d) < 2 { + return false + } + namesLen := int(d[0])<<8 | int(d[1]) + d = d[2:] + if len(d) != namesLen { + return false + } + for len(d) > 0 { + if len(d) < 3 { + return false + } + nameType := d[0] + nameLen := int(d[1])<<8 | int(d[2]) + d = d[3:] + if len(d) < nameLen { + return false + } + if nameType == 0 { + m.serverName = string(d[:nameLen]) + break + } + d = d[nameLen:] + } + case extensionNextProtoNeg: + if length > 0 { + return false + } + m.nextProtoNeg = true + case extensionStatusRequest: + m.ocspStapling = length > 0 && data[0] == statusTypeOCSP + case extensionSupportedCurves: + // http://tools.ietf.org/html/rfc4492#section-5.5.1 + if length < 2 { + return false + } + l := int(data[0])<<8 | int(data[1]) + if l%2 == 1 || length != l+2 { + return false + } + numCurves := l / 2 + m.supportedCurves = make([]CurveID, numCurves) + d := data[2:] + for i := 0; i < numCurves; i++ { + m.supportedCurves[i] = CurveID(d[0])<<8 | CurveID(d[1]) + d = d[2:] + } + case extensionSupportedPoints: + // http://tools.ietf.org/html/rfc4492#section-5.5.2 + if length < 1 { + return false + } + l := int(data[0]) + if length != l+1 { + return false + } + m.supportedPoints = make([]uint8, l) + copy(m.supportedPoints, data[1:]) + case extensionSessionTicket: + // http://tools.ietf.org/html/rfc5077#section-3.2 + m.ticketSupported = true + m.sessionTicket = data[:length] + case extensionSignatureAlgorithms: + // https://tools.ietf.org/html/rfc5246#section-7.4.1.4.1 + if length < 2 || length&1 != 0 { + return false + } + l := int(data[0])<<8 | int(data[1]) + if l != length-2 { + return false + } + n := l / 2 + d := data[2:] + m.signatureAndHashes = make([]signatureAndHash, n) + for i := range m.signatureAndHashes { + m.signatureAndHashes[i].hash = d[0] + m.signatureAndHashes[i].signature = d[1] + d = d[2:] + } + case extensionRenegotiationInfo: + if length != 1 || data[0] != 0 { + return false + } + m.secureRenegotiation = true + case extensionALPN: + if length < 2 { + return false + } + l := int(data[0])<<8 | int(data[1]) + if l != length-2 { + return false + } + d := data[2:length] + for len(d) != 0 { + stringLen := int(d[0]) + d = d[1:] + if stringLen == 0 || stringLen > len(d) { + return false + } + m.alpnProtocols = append(m.alpnProtocols, string(d[:stringLen])) + d = d[stringLen:] + } + case extensionSCT: + m.scts = true + if length != 0 { + return false + } + } + data = data[length:] + } + + return true +} + +type serverHelloMsg struct { + raw []byte + vers uint16 + random []byte + sessionId []byte + cipherSuite uint16 + compressionMethod uint8 + nextProtoNeg bool + nextProtos []string + ocspStapling bool + scts [][]byte + ticketSupported bool + secureRenegotiation bool + alpnProtocol string +} + +func (m *serverHelloMsg) equal(i interface{}) bool { + m1, ok := i.(*serverHelloMsg) + if !ok { + return false + } + + if len(m.scts) != len(m1.scts) { + return false + } + for i, sct := range m.scts { + if !bytes.Equal(sct, m1.scts[i]) { + return false + } + } + + return bytes.Equal(m.raw, m1.raw) && + m.vers == m1.vers && + bytes.Equal(m.random, m1.random) && + bytes.Equal(m.sessionId, m1.sessionId) && + m.cipherSuite == m1.cipherSuite && + m.compressionMethod == m1.compressionMethod && + m.nextProtoNeg == m1.nextProtoNeg && + eqStrings(m.nextProtos, m1.nextProtos) && + m.ocspStapling == m1.ocspStapling && + m.ticketSupported == m1.ticketSupported && + m.secureRenegotiation == m1.secureRenegotiation && + m.alpnProtocol == m1.alpnProtocol +} + +func (m *serverHelloMsg) marshal() []byte { + if m.raw != nil { + return m.raw + } + + length := 38 + len(m.sessionId) + numExtensions := 0 + extensionsLength := 0 + + nextProtoLen := 0 + if m.nextProtoNeg { + numExtensions++ + for _, v := range m.nextProtos { + nextProtoLen += len(v) + } + nextProtoLen += len(m.nextProtos) + extensionsLength += nextProtoLen + } + if m.ocspStapling { + numExtensions++ + } + if m.ticketSupported { + numExtensions++ + } + if m.secureRenegotiation { + extensionsLength += 1 + numExtensions++ + } + if alpnLen := len(m.alpnProtocol); alpnLen > 0 { + if alpnLen >= 256 { + panic("invalid ALPN protocol") + } + extensionsLength += 2 + 1 + alpnLen + numExtensions++ + } + sctLen := 0 + if len(m.scts) > 0 { + for _, sct := range m.scts { + sctLen += len(sct) + 2 + } + extensionsLength += 2 + sctLen + numExtensions++ + } + + if numExtensions > 0 { + extensionsLength += 4 * numExtensions + length += 2 + extensionsLength + } + + x := make([]byte, 4+length) + x[0] = typeServerHello + x[1] = uint8(length >> 16) + x[2] = uint8(length >> 8) + x[3] = uint8(length) + x[4] = uint8(m.vers >> 8) + x[5] = uint8(m.vers) + copy(x[6:38], m.random) + x[38] = uint8(len(m.sessionId)) + copy(x[39:39+len(m.sessionId)], m.sessionId) + z := x[39+len(m.sessionId):] + z[0] = uint8(m.cipherSuite >> 8) + z[1] = uint8(m.cipherSuite) + z[2] = uint8(m.compressionMethod) + + z = z[3:] + if numExtensions > 0 { + z[0] = byte(extensionsLength >> 8) + z[1] = byte(extensionsLength) + z = z[2:] + } + if m.nextProtoNeg { + z[0] = byte(extensionNextProtoNeg >> 8) + z[1] = byte(extensionNextProtoNeg & 0xff) + z[2] = byte(nextProtoLen >> 8) + z[3] = byte(nextProtoLen) + z = z[4:] + + for _, v := range m.nextProtos { + l := len(v) + if l > 255 { + l = 255 + } + z[0] = byte(l) + copy(z[1:], []byte(v[0:l])) + z = z[1+l:] + } + } + if m.ocspStapling { + z[0] = byte(extensionStatusRequest >> 8) + z[1] = byte(extensionStatusRequest) + z = z[4:] + } + if m.ticketSupported { + z[0] = byte(extensionSessionTicket >> 8) + z[1] = byte(extensionSessionTicket) + z = z[4:] + } + if m.secureRenegotiation { + z[0] = byte(extensionRenegotiationInfo >> 8) + z[1] = byte(extensionRenegotiationInfo & 0xff) + z[2] = 0 + z[3] = 1 + z = z[5:] + } + if alpnLen := len(m.alpnProtocol); alpnLen > 0 { + z[0] = byte(extensionALPN >> 8) + z[1] = byte(extensionALPN & 0xff) + l := 2 + 1 + alpnLen + z[2] = byte(l >> 8) + z[3] = byte(l) + l -= 2 + z[4] = byte(l >> 8) + z[5] = byte(l) + l -= 1 + z[6] = byte(l) + copy(z[7:], []byte(m.alpnProtocol)) + z = z[7+alpnLen:] + } + if sctLen > 0 { + z[0] = byte(extensionSCT >> 8) + z[1] = byte(extensionSCT) + l := sctLen + 2 + z[2] = byte(l >> 8) + z[3] = byte(l) + z[4] = byte(sctLen >> 8) + z[5] = byte(sctLen) + + z = z[6:] + for _, sct := range m.scts { + z[0] = byte(len(sct) >> 8) + z[1] = byte(len(sct)) + copy(z[2:], sct) + z = z[len(sct)+2:] + } + } + + m.raw = x + + return x +} + +func (m *serverHelloMsg) unmarshal(data []byte) bool { + if len(data) < 42 { + return false + } + m.raw = data + m.vers = uint16(data[4])<<8 | uint16(data[5]) + m.random = data[6:38] + sessionIdLen := int(data[38]) + if sessionIdLen > 32 || len(data) < 39+sessionIdLen { + return false + } + m.sessionId = data[39 : 39+sessionIdLen] + data = data[39+sessionIdLen:] + if len(data) < 3 { + return false + } + m.cipherSuite = uint16(data[0])<<8 | uint16(data[1]) + m.compressionMethod = data[2] + data = data[3:] + + m.nextProtoNeg = false + m.nextProtos = nil + m.ocspStapling = false + m.scts = nil + m.ticketSupported = false + m.alpnProtocol = "" + + if len(data) == 0 { + // ServerHello is optionally followed by extension data + return true + } + if len(data) < 2 { + return false + } + + extensionsLength := int(data[0])<<8 | int(data[1]) + data = data[2:] + if len(data) != extensionsLength { + return false + } + + for len(data) != 0 { + if len(data) < 4 { + return false + } + extension := uint16(data[0])<<8 | uint16(data[1]) + length := int(data[2])<<8 | int(data[3]) + data = data[4:] + if len(data) < length { + return false + } + + switch extension { + case extensionNextProtoNeg: + m.nextProtoNeg = true + d := data[:length] + for len(d) > 0 { + l := int(d[0]) + d = d[1:] + if l == 0 || l > len(d) { + return false + } + m.nextProtos = append(m.nextProtos, string(d[:l])) + d = d[l:] + } + case extensionStatusRequest: + if length > 0 { + return false + } + m.ocspStapling = true + case extensionSessionTicket: + if length > 0 { + return false + } + m.ticketSupported = true + case extensionRenegotiationInfo: + if length != 1 || data[0] != 0 { + return false + } + m.secureRenegotiation = true + case extensionALPN: + d := data[:length] + if len(d) < 3 { + return false + } + l := int(d[0])<<8 | int(d[1]) + if l != len(d)-2 { + return false + } + d = d[2:] + l = int(d[0]) + if l != len(d)-1 { + return false + } + d = d[1:] + m.alpnProtocol = string(d) + case extensionSCT: + d := data[:length] + + if len(d) < 2 { + return false + } + l := int(d[0])<<8 | int(d[1]) + d = d[2:] + if len(d) != l { + return false + } + if l == 0 { + continue + } + + m.scts = make([][]byte, 0, 3) + for len(d) != 0 { + if len(d) < 2 { + return false + } + sctLen := int(d[0])<<8 | int(d[1]) + d = d[2:] + if len(d) < sctLen { + return false + } + m.scts = append(m.scts, d[:sctLen]) + d = d[sctLen:] + } + } + data = data[length:] + } + + return true +} + +type certificateMsg struct { + raw []byte + certificates [][]byte +} + +func (m *certificateMsg) equal(i interface{}) bool { + m1, ok := i.(*certificateMsg) + if !ok { + return false + } + + return bytes.Equal(m.raw, m1.raw) && + eqByteSlices(m.certificates, m1.certificates) +} + +func (m *certificateMsg) marshal() (x []byte) { + if m.raw != nil { + return m.raw + } + + var i int + for _, slice := range m.certificates { + i += len(slice) + } + + length := 3 + 3*len(m.certificates) + i + x = make([]byte, 4+length) + x[0] = typeCertificate + x[1] = uint8(length >> 16) + x[2] = uint8(length >> 8) + x[3] = uint8(length) + + certificateOctets := length - 3 + x[4] = uint8(certificateOctets >> 16) + x[5] = uint8(certificateOctets >> 8) + x[6] = uint8(certificateOctets) + + y := x[7:] + for _, slice := range m.certificates { + y[0] = uint8(len(slice) >> 16) + y[1] = uint8(len(slice) >> 8) + y[2] = uint8(len(slice)) + copy(y[3:], slice) + y = y[3+len(slice):] + } + + m.raw = x + return +} + +func (m *certificateMsg) unmarshal(data []byte) bool { + if len(data) < 7 { + return false + } + + m.raw = data + certsLen := uint32(data[4])<<16 | uint32(data[5])<<8 | uint32(data[6]) + if uint32(len(data)) != certsLen+7 { + return false + } + + numCerts := 0 + d := data[7:] + for certsLen > 0 { + if len(d) < 4 { + return false + } + certLen := uint32(d[0])<<16 | uint32(d[1])<<8 | uint32(d[2]) + if uint32(len(d)) < 3+certLen { + return false + } + d = d[3+certLen:] + certsLen -= 3 + certLen + numCerts++ + } + + m.certificates = make([][]byte, numCerts) + d = data[7:] + for i := 0; i < numCerts; i++ { + certLen := uint32(d[0])<<16 | uint32(d[1])<<8 | uint32(d[2]) + m.certificates[i] = d[3 : 3+certLen] + d = d[3+certLen:] + } + + return true +} + +type serverKeyExchangeMsg struct { + raw []byte + key []byte +} + +func (m *serverKeyExchangeMsg) equal(i interface{}) bool { + m1, ok := i.(*serverKeyExchangeMsg) + if !ok { + return false + } + + return bytes.Equal(m.raw, m1.raw) && + bytes.Equal(m.key, m1.key) +} + +func (m *serverKeyExchangeMsg) marshal() []byte { + if m.raw != nil { + return m.raw + } + length := len(m.key) + x := make([]byte, length+4) + x[0] = typeServerKeyExchange + x[1] = uint8(length >> 16) + x[2] = uint8(length >> 8) + x[3] = uint8(length) + copy(x[4:], m.key) + + m.raw = x + return x +} + +func (m *serverKeyExchangeMsg) unmarshal(data []byte) bool { + m.raw = data + if len(data) < 4 { + return false + } + m.key = data[4:] + return true +} + +type certificateStatusMsg struct { + raw []byte + statusType uint8 + response []byte +} + +func (m *certificateStatusMsg) equal(i interface{}) bool { + m1, ok := i.(*certificateStatusMsg) + if !ok { + return false + } + + return bytes.Equal(m.raw, m1.raw) && + m.statusType == m1.statusType && + bytes.Equal(m.response, m1.response) +} + +func (m *certificateStatusMsg) marshal() []byte { + if m.raw != nil { + return m.raw + } + + var x []byte + if m.statusType == statusTypeOCSP { + x = make([]byte, 4+4+len(m.response)) + x[0] = typeCertificateStatus + l := len(m.response) + 4 + x[1] = byte(l >> 16) + x[2] = byte(l >> 8) + x[3] = byte(l) + x[4] = statusTypeOCSP + + l -= 4 + x[5] = byte(l >> 16) + x[6] = byte(l >> 8) + x[7] = byte(l) + copy(x[8:], m.response) + } else { + x = []byte{typeCertificateStatus, 0, 0, 1, m.statusType} + } + + m.raw = x + return x +} + +func (m *certificateStatusMsg) unmarshal(data []byte) bool { + m.raw = data + if len(data) < 5 { + return false + } + m.statusType = data[4] + + m.response = nil + if m.statusType == statusTypeOCSP { + if len(data) < 8 { + return false + } + respLen := uint32(data[5])<<16 | uint32(data[6])<<8 | uint32(data[7]) + if uint32(len(data)) != 4+4+respLen { + return false + } + m.response = data[8:] + } + return true +} + +type serverHelloDoneMsg struct{} + +func (m *serverHelloDoneMsg) equal(i interface{}) bool { + _, ok := i.(*serverHelloDoneMsg) + return ok +} + +func (m *serverHelloDoneMsg) marshal() []byte { + x := make([]byte, 4) + x[0] = typeServerHelloDone + return x +} + +func (m *serverHelloDoneMsg) unmarshal(data []byte) bool { + return len(data) == 4 +} + +type clientKeyExchangeMsg struct { + raw []byte + ciphertext []byte +} + +func (m *clientKeyExchangeMsg) equal(i interface{}) bool { + m1, ok := i.(*clientKeyExchangeMsg) + if !ok { + return false + } + + return bytes.Equal(m.raw, m1.raw) && + bytes.Equal(m.ciphertext, m1.ciphertext) +} + +func (m *clientKeyExchangeMsg) marshal() []byte { + if m.raw != nil { + return m.raw + } + length := len(m.ciphertext) + x := make([]byte, length+4) + x[0] = typeClientKeyExchange + x[1] = uint8(length >> 16) + x[2] = uint8(length >> 8) + x[3] = uint8(length) + copy(x[4:], m.ciphertext) + + m.raw = x + return x +} + +func (m *clientKeyExchangeMsg) unmarshal(data []byte) bool { + m.raw = data + if len(data) < 4 { + return false + } + l := int(data[1])<<16 | int(data[2])<<8 | int(data[3]) + if l != len(data)-4 { + return false + } + m.ciphertext = data[4:] + return true +} + +type finishedMsg struct { + raw []byte + verifyData []byte +} + +func (m *finishedMsg) equal(i interface{}) bool { + m1, ok := i.(*finishedMsg) + if !ok { + return false + } + + return bytes.Equal(m.raw, m1.raw) && + bytes.Equal(m.verifyData, m1.verifyData) +} + +func (m *finishedMsg) marshal() (x []byte) { + if m.raw != nil { + return m.raw + } + + x = make([]byte, 4+len(m.verifyData)) + x[0] = typeFinished + x[3] = byte(len(m.verifyData)) + copy(x[4:], m.verifyData) + m.raw = x + return +} + +func (m *finishedMsg) unmarshal(data []byte) bool { + m.raw = data + if len(data) < 4 { + return false + } + m.verifyData = data[4:] + return true +} + +type nextProtoMsg struct { + raw []byte + proto string +} + +func (m *nextProtoMsg) equal(i interface{}) bool { + m1, ok := i.(*nextProtoMsg) + if !ok { + return false + } + + return bytes.Equal(m.raw, m1.raw) && + m.proto == m1.proto +} + +func (m *nextProtoMsg) marshal() []byte { + if m.raw != nil { + return m.raw + } + l := len(m.proto) + if l > 255 { + l = 255 + } + + padding := 32 - (l+2)%32 + length := l + padding + 2 + x := make([]byte, length+4) + x[0] = typeNextProtocol + x[1] = uint8(length >> 16) + x[2] = uint8(length >> 8) + x[3] = uint8(length) + + y := x[4:] + y[0] = byte(l) + copy(y[1:], []byte(m.proto[0:l])) + y = y[1+l:] + y[0] = byte(padding) + + m.raw = x + + return x +} + +func (m *nextProtoMsg) unmarshal(data []byte) bool { + m.raw = data + + if len(data) < 5 { + return false + } + data = data[4:] + protoLen := int(data[0]) + data = data[1:] + if len(data) < protoLen { + return false + } + m.proto = string(data[0:protoLen]) + data = data[protoLen:] + + if len(data) < 1 { + return false + } + paddingLen := int(data[0]) + data = data[1:] + if len(data) != paddingLen { + return false + } + + return true +} + +type certificateRequestMsg struct { + raw []byte + // hasSignatureAndHash indicates whether this message includes a list + // of signature and hash functions. This change was introduced with TLS + // 1.2. + hasSignatureAndHash bool + + certificateTypes []byte + signatureAndHashes []signatureAndHash + certificateAuthorities [][]byte +} + +func (m *certificateRequestMsg) equal(i interface{}) bool { + m1, ok := i.(*certificateRequestMsg) + if !ok { + return false + } + + return bytes.Equal(m.raw, m1.raw) && + bytes.Equal(m.certificateTypes, m1.certificateTypes) && + eqByteSlices(m.certificateAuthorities, m1.certificateAuthorities) && + eqSignatureAndHashes(m.signatureAndHashes, m1.signatureAndHashes) +} + +func (m *certificateRequestMsg) marshal() (x []byte) { + if m.raw != nil { + return m.raw + } + + // See http://tools.ietf.org/html/rfc4346#section-7.4.4 + length := 1 + len(m.certificateTypes) + 2 + casLength := 0 + for _, ca := range m.certificateAuthorities { + casLength += 2 + len(ca) + } + length += casLength + + if m.hasSignatureAndHash { + length += 2 + 2*len(m.signatureAndHashes) + } + + x = make([]byte, 4+length) + x[0] = typeCertificateRequest + x[1] = uint8(length >> 16) + x[2] = uint8(length >> 8) + x[3] = uint8(length) + + x[4] = uint8(len(m.certificateTypes)) + + copy(x[5:], m.certificateTypes) + y := x[5+len(m.certificateTypes):] + + if m.hasSignatureAndHash { + n := len(m.signatureAndHashes) * 2 + y[0] = uint8(n >> 8) + y[1] = uint8(n) + y = y[2:] + for _, sigAndHash := range m.signatureAndHashes { + y[0] = sigAndHash.hash + y[1] = sigAndHash.signature + y = y[2:] + } + } + + y[0] = uint8(casLength >> 8) + y[1] = uint8(casLength) + y = y[2:] + for _, ca := range m.certificateAuthorities { + y[0] = uint8(len(ca) >> 8) + y[1] = uint8(len(ca)) + y = y[2:] + copy(y, ca) + y = y[len(ca):] + } + + m.raw = x + return +} + +func (m *certificateRequestMsg) unmarshal(data []byte) bool { + m.raw = data + + if len(data) < 5 { + return false + } + + length := uint32(data[1])<<16 | uint32(data[2])<<8 | uint32(data[3]) + if uint32(len(data))-4 != length { + return false + } + + numCertTypes := int(data[4]) + data = data[5:] + if numCertTypes == 0 || len(data) <= numCertTypes { + return false + } + + m.certificateTypes = make([]byte, numCertTypes) + if copy(m.certificateTypes, data) != numCertTypes { + return false + } + + data = data[numCertTypes:] + + if m.hasSignatureAndHash { + if len(data) < 2 { + return false + } + sigAndHashLen := uint16(data[0])<<8 | uint16(data[1]) + data = data[2:] + if sigAndHashLen&1 != 0 { + return false + } + if len(data) < int(sigAndHashLen) { + return false + } + numSigAndHash := sigAndHashLen / 2 + m.signatureAndHashes = make([]signatureAndHash, numSigAndHash) + for i := range m.signatureAndHashes { + m.signatureAndHashes[i].hash = data[0] + m.signatureAndHashes[i].signature = data[1] + data = data[2:] + } + } + + if len(data) < 2 { + return false + } + casLength := uint16(data[0])<<8 | uint16(data[1]) + data = data[2:] + if len(data) < int(casLength) { + return false + } + cas := make([]byte, casLength) + copy(cas, data) + data = data[casLength:] + + m.certificateAuthorities = nil + for len(cas) > 0 { + if len(cas) < 2 { + return false + } + caLen := uint16(cas[0])<<8 | uint16(cas[1]) + cas = cas[2:] + + if len(cas) < int(caLen) { + return false + } + + m.certificateAuthorities = append(m.certificateAuthorities, cas[:caLen]) + cas = cas[caLen:] + } + if len(data) > 0 { + return false + } + + return true +} + +type certificateVerifyMsg struct { + raw []byte + hasSignatureAndHash bool + signatureAndHash signatureAndHash + signature []byte +} + +func (m *certificateVerifyMsg) equal(i interface{}) bool { + m1, ok := i.(*certificateVerifyMsg) + if !ok { + return false + } + + return bytes.Equal(m.raw, m1.raw) && + m.hasSignatureAndHash == m1.hasSignatureAndHash && + m.signatureAndHash.hash == m1.signatureAndHash.hash && + m.signatureAndHash.signature == m1.signatureAndHash.signature && + bytes.Equal(m.signature, m1.signature) +} + +func (m *certificateVerifyMsg) marshal() (x []byte) { + if m.raw != nil { + return m.raw + } + + // See http://tools.ietf.org/html/rfc4346#section-7.4.8 + siglength := len(m.signature) + length := 2 + siglength + if m.hasSignatureAndHash { + length += 2 + } + x = make([]byte, 4+length) + x[0] = typeCertificateVerify + x[1] = uint8(length >> 16) + x[2] = uint8(length >> 8) + x[3] = uint8(length) + y := x[4:] + if m.hasSignatureAndHash { + y[0] = m.signatureAndHash.hash + y[1] = m.signatureAndHash.signature + y = y[2:] + } + y[0] = uint8(siglength >> 8) + y[1] = uint8(siglength) + copy(y[2:], m.signature) + + m.raw = x + + return +} + +func (m *certificateVerifyMsg) unmarshal(data []byte) bool { + m.raw = data + + if len(data) < 6 { + return false + } + + length := uint32(data[1])<<16 | uint32(data[2])<<8 | uint32(data[3]) + if uint32(len(data))-4 != length { + return false + } + + data = data[4:] + if m.hasSignatureAndHash { + m.signatureAndHash.hash = data[0] + m.signatureAndHash.signature = data[1] + data = data[2:] + } + + if len(data) < 2 { + return false + } + siglength := int(data[0])<<8 + int(data[1]) + data = data[2:] + if len(data) != siglength { + return false + } + + m.signature = data + + return true +} + +type newSessionTicketMsg struct { + raw []byte + ticket []byte +} + +func (m *newSessionTicketMsg) equal(i interface{}) bool { + m1, ok := i.(*newSessionTicketMsg) + if !ok { + return false + } + + return bytes.Equal(m.raw, m1.raw) && + bytes.Equal(m.ticket, m1.ticket) +} + +func (m *newSessionTicketMsg) marshal() (x []byte) { + if m.raw != nil { + return m.raw + } + + // See http://tools.ietf.org/html/rfc5077#section-3.3 + ticketLen := len(m.ticket) + length := 2 + 4 + ticketLen + x = make([]byte, 4+length) + x[0] = typeNewSessionTicket + x[1] = uint8(length >> 16) + x[2] = uint8(length >> 8) + x[3] = uint8(length) + x[8] = uint8(ticketLen >> 8) + x[9] = uint8(ticketLen) + copy(x[10:], m.ticket) + + m.raw = x + + return +} + +func (m *newSessionTicketMsg) unmarshal(data []byte) bool { + m.raw = data + + if len(data) < 10 { + return false + } + + length := uint32(data[1])<<16 | uint32(data[2])<<8 | uint32(data[3]) + if uint32(len(data))-4 != length { + return false + } + + ticketLen := int(data[8])<<8 + int(data[9]) + if len(data)-10 != ticketLen { + return false + } + + m.ticket = data[10:] + + return true +} + +func eqUint16s(x, y []uint16) bool { + if len(x) != len(y) { + return false + } + for i, v := range x { + if y[i] != v { + return false + } + } + return true +} + +func eqCurveIDs(x, y []CurveID) bool { + if len(x) != len(y) { + return false + } + for i, v := range x { + if y[i] != v { + return false + } + } + return true +} + +func eqStrings(x, y []string) bool { + if len(x) != len(y) { + return false + } + for i, v := range x { + if y[i] != v { + return false + } + } + return true +} + +func eqByteSlices(x, y [][]byte) bool { + if len(x) != len(y) { + return false + } + for i, v := range x { + if !bytes.Equal(v, y[i]) { + return false + } + } + return true +} + +func eqSignatureAndHashes(x, y []signatureAndHash) bool { + if len(x) != len(y) { + return false + } + for i, v := range x { + v2 := y[i] + if v.hash != v2.hash || v.signature != v2.signature { + return false + } + } + return true +} diff --git a/src/crypto/tls/handshake_messages_test.go b/src/crypto/tls/handshake_messages_test.go new file mode 100644 index 0000000000000000000000000000000000000000..95d825bd17522a427ca8c1e16933828d8ca45526 --- /dev/null +++ b/src/crypto/tls/handshake_messages_test.go @@ -0,0 +1,262 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package tls + +import ( + "math/rand" + "reflect" + "testing" + "testing/quick" +) + +var tests = []interface{}{ + &clientHelloMsg{}, + &serverHelloMsg{}, + &finishedMsg{}, + + &certificateMsg{}, + &certificateRequestMsg{}, + &certificateVerifyMsg{}, + &certificateStatusMsg{}, + &clientKeyExchangeMsg{}, + &nextProtoMsg{}, + &newSessionTicketMsg{}, + &sessionState{}, +} + +type testMessage interface { + marshal() []byte + unmarshal([]byte) bool + equal(interface{}) bool +} + +func TestMarshalUnmarshal(t *testing.T) { + rand := rand.New(rand.NewSource(0)) + + for i, iface := range tests { + ty := reflect.ValueOf(iface).Type() + + n := 100 + if testing.Short() { + n = 5 + } + for j := 0; j < n; j++ { + v, ok := quick.Value(ty, rand) + if !ok { + t.Errorf("#%d: failed to create value", i) + break + } + + m1 := v.Interface().(testMessage) + marshaled := m1.marshal() + m2 := iface.(testMessage) + if !m2.unmarshal(marshaled) { + t.Errorf("#%d failed to unmarshal %#v %x", i, m1, marshaled) + break + } + m2.marshal() // to fill any marshal cache in the message + + if !m1.equal(m2) { + t.Errorf("#%d got:%#v want:%#v %x", i, m2, m1, marshaled) + break + } + + if i >= 3 { + // The first three message types (ClientHello, + // ServerHello and Finished) are allowed to + // have parsable prefixes because the extension + // data is optional and the length of the + // Finished varies across versions. + for j := 0; j < len(marshaled); j++ { + if m2.unmarshal(marshaled[0:j]) { + t.Errorf("#%d unmarshaled a prefix of length %d of %#v", i, j, m1) + break + } + } + } + } + } +} + +func TestFuzz(t *testing.T) { + rand := rand.New(rand.NewSource(0)) + for _, iface := range tests { + m := iface.(testMessage) + + for j := 0; j < 1000; j++ { + len := rand.Intn(100) + bytes := randomBytes(len, rand) + // This just looks for crashes due to bounds errors etc. + m.unmarshal(bytes) + } + } +} + +func randomBytes(n int, rand *rand.Rand) []byte { + r := make([]byte, n) + for i := 0; i < n; i++ { + r[i] = byte(rand.Int31()) + } + return r +} + +func randomString(n int, rand *rand.Rand) string { + b := randomBytes(n, rand) + return string(b) +} + +func (*clientHelloMsg) Generate(rand *rand.Rand, size int) reflect.Value { + m := &clientHelloMsg{} + m.vers = uint16(rand.Intn(65536)) + m.random = randomBytes(32, rand) + m.sessionId = randomBytes(rand.Intn(32), rand) + m.cipherSuites = make([]uint16, rand.Intn(63)+1) + for i := 0; i < len(m.cipherSuites); i++ { + m.cipherSuites[i] = uint16(rand.Int31()) + } + m.compressionMethods = randomBytes(rand.Intn(63)+1, rand) + if rand.Intn(10) > 5 { + m.nextProtoNeg = true + } + if rand.Intn(10) > 5 { + m.serverName = randomString(rand.Intn(255), rand) + } + m.ocspStapling = rand.Intn(10) > 5 + m.supportedPoints = randomBytes(rand.Intn(5)+1, rand) + m.supportedCurves = make([]CurveID, rand.Intn(5)+1) + for i := range m.supportedCurves { + m.supportedCurves[i] = CurveID(rand.Intn(30000)) + } + if rand.Intn(10) > 5 { + m.ticketSupported = true + if rand.Intn(10) > 5 { + m.sessionTicket = randomBytes(rand.Intn(300), rand) + } + } + if rand.Intn(10) > 5 { + m.signatureAndHashes = supportedSignatureAlgorithms + } + m.alpnProtocols = make([]string, rand.Intn(5)) + for i := range m.alpnProtocols { + m.alpnProtocols[i] = randomString(rand.Intn(20)+1, rand) + } + if rand.Intn(10) > 5 { + m.scts = true + } + + return reflect.ValueOf(m) +} + +func (*serverHelloMsg) Generate(rand *rand.Rand, size int) reflect.Value { + m := &serverHelloMsg{} + m.vers = uint16(rand.Intn(65536)) + m.random = randomBytes(32, rand) + m.sessionId = randomBytes(rand.Intn(32), rand) + m.cipherSuite = uint16(rand.Int31()) + m.compressionMethod = uint8(rand.Intn(256)) + + if rand.Intn(10) > 5 { + m.nextProtoNeg = true + + n := rand.Intn(10) + m.nextProtos = make([]string, n) + for i := 0; i < n; i++ { + m.nextProtos[i] = randomString(20, rand) + } + } + + if rand.Intn(10) > 5 { + m.ocspStapling = true + } + if rand.Intn(10) > 5 { + m.ticketSupported = true + } + m.alpnProtocol = randomString(rand.Intn(32)+1, rand) + + if rand.Intn(10) > 5 { + numSCTs := rand.Intn(4) + m.scts = make([][]byte, numSCTs) + for i := range m.scts { + m.scts[i] = randomBytes(rand.Intn(500), rand) + } + } + + return reflect.ValueOf(m) +} + +func (*certificateMsg) Generate(rand *rand.Rand, size int) reflect.Value { + m := &certificateMsg{} + numCerts := rand.Intn(20) + m.certificates = make([][]byte, numCerts) + for i := 0; i < numCerts; i++ { + m.certificates[i] = randomBytes(rand.Intn(10)+1, rand) + } + return reflect.ValueOf(m) +} + +func (*certificateRequestMsg) Generate(rand *rand.Rand, size int) reflect.Value { + m := &certificateRequestMsg{} + m.certificateTypes = randomBytes(rand.Intn(5)+1, rand) + numCAs := rand.Intn(100) + m.certificateAuthorities = make([][]byte, numCAs) + for i := 0; i < numCAs; i++ { + m.certificateAuthorities[i] = randomBytes(rand.Intn(15)+1, rand) + } + return reflect.ValueOf(m) +} + +func (*certificateVerifyMsg) Generate(rand *rand.Rand, size int) reflect.Value { + m := &certificateVerifyMsg{} + m.signature = randomBytes(rand.Intn(15)+1, rand) + return reflect.ValueOf(m) +} + +func (*certificateStatusMsg) Generate(rand *rand.Rand, size int) reflect.Value { + m := &certificateStatusMsg{} + if rand.Intn(10) > 5 { + m.statusType = statusTypeOCSP + m.response = randomBytes(rand.Intn(10)+1, rand) + } else { + m.statusType = 42 + } + return reflect.ValueOf(m) +} + +func (*clientKeyExchangeMsg) Generate(rand *rand.Rand, size int) reflect.Value { + m := &clientKeyExchangeMsg{} + m.ciphertext = randomBytes(rand.Intn(1000)+1, rand) + return reflect.ValueOf(m) +} + +func (*finishedMsg) Generate(rand *rand.Rand, size int) reflect.Value { + m := &finishedMsg{} + m.verifyData = randomBytes(12, rand) + return reflect.ValueOf(m) +} + +func (*nextProtoMsg) Generate(rand *rand.Rand, size int) reflect.Value { + m := &nextProtoMsg{} + m.proto = randomString(rand.Intn(255), rand) + return reflect.ValueOf(m) +} + +func (*newSessionTicketMsg) Generate(rand *rand.Rand, size int) reflect.Value { + m := &newSessionTicketMsg{} + m.ticket = randomBytes(rand.Intn(4), rand) + return reflect.ValueOf(m) +} + +func (*sessionState) Generate(rand *rand.Rand, size int) reflect.Value { + s := &sessionState{} + s.vers = uint16(rand.Intn(10000)) + s.cipherSuite = uint16(rand.Intn(10000)) + s.masterSecret = randomBytes(rand.Intn(100), rand) + numCerts := rand.Intn(20) + s.certificates = make([][]byte, numCerts) + for i := 0; i < numCerts; i++ { + s.certificates[i] = randomBytes(rand.Intn(10)+1, rand) + } + return reflect.ValueOf(s) +} diff --git a/src/crypto/tls/handshake_server.go b/src/crypto/tls/handshake_server.go new file mode 100644 index 0000000000000000000000000000000000000000..e16cddcbd81db53051c63f155e0a2a3efef7d8af --- /dev/null +++ b/src/crypto/tls/handshake_server.go @@ -0,0 +1,750 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package tls + +import ( + "crypto" + "crypto/ecdsa" + "crypto/rsa" + "crypto/subtle" + "crypto/x509" + "encoding/asn1" + "errors" + "fmt" + "io" +) + +// serverHandshakeState contains details of a server handshake in progress. +// It's discarded once the handshake has completed. +type serverHandshakeState struct { + c *Conn + clientHello *clientHelloMsg + hello *serverHelloMsg + suite *cipherSuite + ellipticOk bool + ecdsaOk bool + rsaDecryptOk bool + rsaSignOk bool + sessionState *sessionState + finishedHash finishedHash + masterSecret []byte + certsFromClient [][]byte + cert *Certificate +} + +// serverHandshake performs a TLS handshake as a server. +func (c *Conn) serverHandshake() error { + config := c.config + + // If this is the first server handshake, we generate a random key to + // encrypt the tickets with. + config.serverInitOnce.Do(config.serverInit) + + hs := serverHandshakeState{ + c: c, + } + isResume, err := hs.readClientHello() + if err != nil { + return err + } + + // For an overview of TLS handshaking, see https://tools.ietf.org/html/rfc5246#section-7.3 + if isResume { + // The client has included a session ticket and so we do an abbreviated handshake. + if err := hs.doResumeHandshake(); err != nil { + return err + } + if err := hs.establishKeys(); err != nil { + return err + } + // ticketSupported is set in a resumption handshake if the + // ticket from the client was encrypted with an old session + // ticket key and thus a refreshed ticket should be sent. + if hs.hello.ticketSupported { + if err := hs.sendSessionTicket(); err != nil { + return err + } + } + if err := hs.sendFinished(c.firstFinished[:]); err != nil { + return err + } + if err := hs.readFinished(nil); err != nil { + return err + } + c.didResume = true + } else { + // The client didn't include a session ticket, or it wasn't + // valid so we do a full handshake. + if err := hs.doFullHandshake(); err != nil { + return err + } + if err := hs.establishKeys(); err != nil { + return err + } + if err := hs.readFinished(c.firstFinished[:]); err != nil { + return err + } + if err := hs.sendSessionTicket(); err != nil { + return err + } + if err := hs.sendFinished(nil); err != nil { + return err + } + } + c.handshakeComplete = true + + return nil +} + +// readClientHello reads a ClientHello message from the client and decides +// whether we will perform session resumption. +func (hs *serverHandshakeState) readClientHello() (isResume bool, err error) { + config := hs.c.config + c := hs.c + + msg, err := c.readHandshake() + if err != nil { + return false, err + } + var ok bool + hs.clientHello, ok = msg.(*clientHelloMsg) + if !ok { + c.sendAlert(alertUnexpectedMessage) + return false, unexpectedMessageError(hs.clientHello, msg) + } + c.vers, ok = config.mutualVersion(hs.clientHello.vers) + if !ok { + c.sendAlert(alertProtocolVersion) + return false, fmt.Errorf("tls: client offered an unsupported, maximum protocol version of %x", hs.clientHello.vers) + } + c.haveVers = true + + hs.hello = new(serverHelloMsg) + + supportedCurve := false + preferredCurves := config.curvePreferences() +Curves: + for _, curve := range hs.clientHello.supportedCurves { + for _, supported := range preferredCurves { + if supported == curve { + supportedCurve = true + break Curves + } + } + } + + supportedPointFormat := false + for _, pointFormat := range hs.clientHello.supportedPoints { + if pointFormat == pointFormatUncompressed { + supportedPointFormat = true + break + } + } + hs.ellipticOk = supportedCurve && supportedPointFormat + + foundCompression := false + // We only support null compression, so check that the client offered it. + for _, compression := range hs.clientHello.compressionMethods { + if compression == compressionNone { + foundCompression = true + break + } + } + + if !foundCompression { + c.sendAlert(alertHandshakeFailure) + return false, errors.New("tls: client does not support uncompressed connections") + } + + hs.hello.vers = c.vers + hs.hello.random = make([]byte, 32) + _, err = io.ReadFull(config.rand(), hs.hello.random) + if err != nil { + c.sendAlert(alertInternalError) + return false, err + } + hs.hello.secureRenegotiation = hs.clientHello.secureRenegotiation + hs.hello.compressionMethod = compressionNone + if len(hs.clientHello.serverName) > 0 { + c.serverName = hs.clientHello.serverName + } + + if len(hs.clientHello.alpnProtocols) > 0 { + if selectedProto, fallback := mutualProtocol(hs.clientHello.alpnProtocols, c.config.NextProtos); !fallback { + hs.hello.alpnProtocol = selectedProto + c.clientProtocol = selectedProto + } + } else { + // Although sending an empty NPN extension is reasonable, Firefox has + // had a bug around this. Best to send nothing at all if + // config.NextProtos is empty. See + // https://golang.org/issue/5445. + if hs.clientHello.nextProtoNeg && len(config.NextProtos) > 0 { + hs.hello.nextProtoNeg = true + hs.hello.nextProtos = config.NextProtos + } + } + + if hs.cert, err = config.getCertificate(&ClientHelloInfo{ + CipherSuites: hs.clientHello.cipherSuites, + ServerName: hs.clientHello.serverName, + SupportedCurves: hs.clientHello.supportedCurves, + SupportedPoints: hs.clientHello.supportedPoints, + }); err != nil { + c.sendAlert(alertInternalError) + return false, err + } + if hs.clientHello.scts { + hs.hello.scts = hs.cert.SignedCertificateTimestamps + } + + if priv, ok := hs.cert.PrivateKey.(crypto.Signer); ok { + switch priv.Public().(type) { + case *ecdsa.PublicKey: + hs.ecdsaOk = true + case *rsa.PublicKey: + hs.rsaSignOk = true + default: + c.sendAlert(alertInternalError) + return false, fmt.Errorf("crypto/tls: unsupported signing key type (%T)", priv.Public()) + } + } + if priv, ok := hs.cert.PrivateKey.(crypto.Decrypter); ok { + switch priv.Public().(type) { + case *rsa.PublicKey: + hs.rsaDecryptOk = true + default: + c.sendAlert(alertInternalError) + return false, fmt.Errorf("crypto/tls: unsupported decryption key type (%T)", priv.Public()) + } + } + + if hs.checkForResumption() { + return true, nil + } + + var preferenceList, supportedList []uint16 + if c.config.PreferServerCipherSuites { + preferenceList = c.config.cipherSuites() + supportedList = hs.clientHello.cipherSuites + } else { + preferenceList = hs.clientHello.cipherSuites + supportedList = c.config.cipherSuites() + } + + for _, id := range preferenceList { + if hs.setCipherSuite(id, supportedList, c.vers) { + break + } + } + + if hs.suite == nil { + c.sendAlert(alertHandshakeFailure) + return false, errors.New("tls: no cipher suite supported by both client and server") + } + + // See https://tools.ietf.org/html/draft-ietf-tls-downgrade-scsv-00. + for _, id := range hs.clientHello.cipherSuites { + if id == TLS_FALLBACK_SCSV { + // The client is doing a fallback connection. + if hs.clientHello.vers < c.config.maxVersion() { + c.sendAlert(alertInappropriateFallback) + return false, errors.New("tls: client using inappropriate protocol fallback") + } + break + } + } + + return false, nil +} + +// checkForResumption reports whether we should perform resumption on this connection. +func (hs *serverHandshakeState) checkForResumption() bool { + c := hs.c + + if c.config.SessionTicketsDisabled { + return false + } + + var ok bool + var sessionTicket = append([]uint8{}, hs.clientHello.sessionTicket...) + if hs.sessionState, ok = c.decryptTicket(sessionTicket); !ok { + return false + } + + if hs.sessionState.vers > hs.clientHello.vers { + return false + } + if vers, ok := c.config.mutualVersion(hs.sessionState.vers); !ok || vers != hs.sessionState.vers { + return false + } + + cipherSuiteOk := false + // Check that the client is still offering the ciphersuite in the session. + for _, id := range hs.clientHello.cipherSuites { + if id == hs.sessionState.cipherSuite { + cipherSuiteOk = true + break + } + } + if !cipherSuiteOk { + return false + } + + // Check that we also support the ciphersuite from the session. + if !hs.setCipherSuite(hs.sessionState.cipherSuite, c.config.cipherSuites(), hs.sessionState.vers) { + return false + } + + sessionHasClientCerts := len(hs.sessionState.certificates) != 0 + needClientCerts := c.config.ClientAuth == RequireAnyClientCert || c.config.ClientAuth == RequireAndVerifyClientCert + if needClientCerts && !sessionHasClientCerts { + return false + } + if sessionHasClientCerts && c.config.ClientAuth == NoClientCert { + return false + } + + return true +} + +func (hs *serverHandshakeState) doResumeHandshake() error { + c := hs.c + + hs.hello.cipherSuite = hs.suite.id + // We echo the client's session ID in the ServerHello to let it know + // that we're doing a resumption. + hs.hello.sessionId = hs.clientHello.sessionId + hs.hello.ticketSupported = hs.sessionState.usedOldKey + hs.finishedHash = newFinishedHash(c.vers, hs.suite) + hs.finishedHash.discardHandshakeBuffer() + hs.finishedHash.Write(hs.clientHello.marshal()) + hs.finishedHash.Write(hs.hello.marshal()) + c.writeRecord(recordTypeHandshake, hs.hello.marshal()) + + if len(hs.sessionState.certificates) > 0 { + if _, err := hs.processCertsFromClient(hs.sessionState.certificates); err != nil { + return err + } + } + + hs.masterSecret = hs.sessionState.masterSecret + + return nil +} + +func (hs *serverHandshakeState) doFullHandshake() error { + config := hs.c.config + c := hs.c + + if hs.clientHello.ocspStapling && len(hs.cert.OCSPStaple) > 0 { + hs.hello.ocspStapling = true + } + + hs.hello.ticketSupported = hs.clientHello.ticketSupported && !config.SessionTicketsDisabled + hs.hello.cipherSuite = hs.suite.id + + hs.finishedHash = newFinishedHash(hs.c.vers, hs.suite) + if config.ClientAuth == NoClientCert { + // No need to keep a full record of the handshake if client + // certificates won't be used. + hs.finishedHash.discardHandshakeBuffer() + } + hs.finishedHash.Write(hs.clientHello.marshal()) + hs.finishedHash.Write(hs.hello.marshal()) + c.writeRecord(recordTypeHandshake, hs.hello.marshal()) + + certMsg := new(certificateMsg) + certMsg.certificates = hs.cert.Certificate + hs.finishedHash.Write(certMsg.marshal()) + c.writeRecord(recordTypeHandshake, certMsg.marshal()) + + if hs.hello.ocspStapling { + certStatus := new(certificateStatusMsg) + certStatus.statusType = statusTypeOCSP + certStatus.response = hs.cert.OCSPStaple + hs.finishedHash.Write(certStatus.marshal()) + c.writeRecord(recordTypeHandshake, certStatus.marshal()) + } + + keyAgreement := hs.suite.ka(c.vers) + skx, err := keyAgreement.generateServerKeyExchange(config, hs.cert, hs.clientHello, hs.hello) + if err != nil { + c.sendAlert(alertHandshakeFailure) + return err + } + if skx != nil { + hs.finishedHash.Write(skx.marshal()) + c.writeRecord(recordTypeHandshake, skx.marshal()) + } + + if config.ClientAuth >= RequestClientCert { + // Request a client certificate + certReq := new(certificateRequestMsg) + certReq.certificateTypes = []byte{ + byte(certTypeRSASign), + byte(certTypeECDSASign), + } + if c.vers >= VersionTLS12 { + certReq.hasSignatureAndHash = true + certReq.signatureAndHashes = supportedSignatureAlgorithms + } + + // An empty list of certificateAuthorities signals to + // the client that it may send any certificate in response + // to our request. When we know the CAs we trust, then + // we can send them down, so that the client can choose + // an appropriate certificate to give to us. + if config.ClientCAs != nil { + certReq.certificateAuthorities = config.ClientCAs.Subjects() + } + hs.finishedHash.Write(certReq.marshal()) + c.writeRecord(recordTypeHandshake, certReq.marshal()) + } + + helloDone := new(serverHelloDoneMsg) + hs.finishedHash.Write(helloDone.marshal()) + c.writeRecord(recordTypeHandshake, helloDone.marshal()) + + var pub crypto.PublicKey // public key for client auth, if any + + msg, err := c.readHandshake() + if err != nil { + return err + } + + var ok bool + // If we requested a client certificate, then the client must send a + // certificate message, even if it's empty. + if config.ClientAuth >= RequestClientCert { + if certMsg, ok = msg.(*certificateMsg); !ok { + c.sendAlert(alertUnexpectedMessage) + return unexpectedMessageError(certMsg, msg) + } + hs.finishedHash.Write(certMsg.marshal()) + + if len(certMsg.certificates) == 0 { + // The client didn't actually send a certificate + switch config.ClientAuth { + case RequireAnyClientCert, RequireAndVerifyClientCert: + c.sendAlert(alertBadCertificate) + return errors.New("tls: client didn't provide a certificate") + } + } + + pub, err = hs.processCertsFromClient(certMsg.certificates) + if err != nil { + return err + } + + msg, err = c.readHandshake() + if err != nil { + return err + } + } + + // Get client key exchange + ckx, ok := msg.(*clientKeyExchangeMsg) + if !ok { + c.sendAlert(alertUnexpectedMessage) + return unexpectedMessageError(ckx, msg) + } + hs.finishedHash.Write(ckx.marshal()) + + preMasterSecret, err := keyAgreement.processClientKeyExchange(config, hs.cert, ckx, c.vers) + if err != nil { + c.sendAlert(alertHandshakeFailure) + return err + } + hs.masterSecret = masterFromPreMasterSecret(c.vers, hs.suite, preMasterSecret, hs.clientHello.random, hs.hello.random) + + // If we received a client cert in response to our certificate request message, + // the client will send us a certificateVerifyMsg immediately after the + // clientKeyExchangeMsg. This message is a digest of all preceding + // handshake-layer messages that is signed using the private key corresponding + // to the client's certificate. This allows us to verify that the client is in + // possession of the private key of the certificate. + if len(c.peerCertificates) > 0 { + msg, err = c.readHandshake() + if err != nil { + return err + } + certVerify, ok := msg.(*certificateVerifyMsg) + if !ok { + c.sendAlert(alertUnexpectedMessage) + return unexpectedMessageError(certVerify, msg) + } + + // Determine the signature type. + var signatureAndHash signatureAndHash + if certVerify.hasSignatureAndHash { + signatureAndHash = certVerify.signatureAndHash + if !isSupportedSignatureAndHash(signatureAndHash, supportedSignatureAlgorithms) { + return errors.New("tls: unsupported hash function for client certificate") + } + } else { + // Before TLS 1.2 the signature algorithm was implicit + // from the key type, and only one hash per signature + // algorithm was possible. Leave the hash as zero. + switch pub.(type) { + case *ecdsa.PublicKey: + signatureAndHash.signature = signatureECDSA + case *rsa.PublicKey: + signatureAndHash.signature = signatureRSA + } + } + + switch key := pub.(type) { + case *ecdsa.PublicKey: + if signatureAndHash.signature != signatureECDSA { + err = errors.New("bad signature type for client's ECDSA certificate") + break + } + ecdsaSig := new(ecdsaSignature) + if _, err = asn1.Unmarshal(certVerify.signature, ecdsaSig); err != nil { + break + } + if ecdsaSig.R.Sign() <= 0 || ecdsaSig.S.Sign() <= 0 { + err = errors.New("ECDSA signature contained zero or negative values") + break + } + var digest []byte + if digest, _, err = hs.finishedHash.hashForClientCertificate(signatureAndHash, hs.masterSecret); err != nil { + break + } + if !ecdsa.Verify(key, digest, ecdsaSig.R, ecdsaSig.S) { + err = errors.New("ECDSA verification failure") + } + case *rsa.PublicKey: + if signatureAndHash.signature != signatureRSA { + err = errors.New("bad signature type for client's RSA certificate") + break + } + var digest []byte + var hashFunc crypto.Hash + if digest, hashFunc, err = hs.finishedHash.hashForClientCertificate(signatureAndHash, hs.masterSecret); err != nil { + break + } + err = rsa.VerifyPKCS1v15(key, hashFunc, digest, certVerify.signature) + } + if err != nil { + c.sendAlert(alertBadCertificate) + return errors.New("tls: could not validate signature of connection nonces: " + err.Error()) + } + + hs.finishedHash.Write(certVerify.marshal()) + } + + hs.finishedHash.discardHandshakeBuffer() + + return nil +} + +func (hs *serverHandshakeState) establishKeys() error { + c := hs.c + + clientMAC, serverMAC, clientKey, serverKey, clientIV, serverIV := + keysFromMasterSecret(c.vers, hs.suite, hs.masterSecret, hs.clientHello.random, hs.hello.random, hs.suite.macLen, hs.suite.keyLen, hs.suite.ivLen) + + var clientCipher, serverCipher interface{} + var clientHash, serverHash macFunction + + if hs.suite.aead == nil { + clientCipher = hs.suite.cipher(clientKey, clientIV, true /* for reading */) + clientHash = hs.suite.mac(c.vers, clientMAC) + serverCipher = hs.suite.cipher(serverKey, serverIV, false /* not for reading */) + serverHash = hs.suite.mac(c.vers, serverMAC) + } else { + clientCipher = hs.suite.aead(clientKey, clientIV) + serverCipher = hs.suite.aead(serverKey, serverIV) + } + + c.in.prepareCipherSpec(c.vers, clientCipher, clientHash) + c.out.prepareCipherSpec(c.vers, serverCipher, serverHash) + + return nil +} + +func (hs *serverHandshakeState) readFinished(out []byte) error { + c := hs.c + + c.readRecord(recordTypeChangeCipherSpec) + if err := c.in.error(); err != nil { + return err + } + + if hs.hello.nextProtoNeg { + msg, err := c.readHandshake() + if err != nil { + return err + } + nextProto, ok := msg.(*nextProtoMsg) + if !ok { + c.sendAlert(alertUnexpectedMessage) + return unexpectedMessageError(nextProto, msg) + } + hs.finishedHash.Write(nextProto.marshal()) + c.clientProtocol = nextProto.proto + } + + msg, err := c.readHandshake() + if err != nil { + return err + } + clientFinished, ok := msg.(*finishedMsg) + if !ok { + c.sendAlert(alertUnexpectedMessage) + return unexpectedMessageError(clientFinished, msg) + } + + verify := hs.finishedHash.clientSum(hs.masterSecret) + if len(verify) != len(clientFinished.verifyData) || + subtle.ConstantTimeCompare(verify, clientFinished.verifyData) != 1 { + c.sendAlert(alertHandshakeFailure) + return errors.New("tls: client's Finished message is incorrect") + } + + hs.finishedHash.Write(clientFinished.marshal()) + copy(out, verify) + return nil +} + +func (hs *serverHandshakeState) sendSessionTicket() error { + if !hs.hello.ticketSupported { + return nil + } + + c := hs.c + m := new(newSessionTicketMsg) + + var err error + state := sessionState{ + vers: c.vers, + cipherSuite: hs.suite.id, + masterSecret: hs.masterSecret, + certificates: hs.certsFromClient, + } + m.ticket, err = c.encryptTicket(&state) + if err != nil { + return err + } + + hs.finishedHash.Write(m.marshal()) + c.writeRecord(recordTypeHandshake, m.marshal()) + + return nil +} + +func (hs *serverHandshakeState) sendFinished(out []byte) error { + c := hs.c + + c.writeRecord(recordTypeChangeCipherSpec, []byte{1}) + + finished := new(finishedMsg) + finished.verifyData = hs.finishedHash.serverSum(hs.masterSecret) + hs.finishedHash.Write(finished.marshal()) + c.writeRecord(recordTypeHandshake, finished.marshal()) + + c.cipherSuite = hs.suite.id + copy(out, finished.verifyData) + + return nil +} + +// processCertsFromClient takes a chain of client certificates either from a +// Certificates message or from a sessionState and verifies them. It returns +// the public key of the leaf certificate. +func (hs *serverHandshakeState) processCertsFromClient(certificates [][]byte) (crypto.PublicKey, error) { + c := hs.c + + hs.certsFromClient = certificates + certs := make([]*x509.Certificate, len(certificates)) + var err error + for i, asn1Data := range certificates { + if certs[i], err = x509.ParseCertificate(asn1Data); err != nil { + c.sendAlert(alertBadCertificate) + return nil, errors.New("tls: failed to parse client certificate: " + err.Error()) + } + } + + if c.config.ClientAuth >= VerifyClientCertIfGiven && len(certs) > 0 { + opts := x509.VerifyOptions{ + Roots: c.config.ClientCAs, + CurrentTime: c.config.time(), + Intermediates: x509.NewCertPool(), + KeyUsages: []x509.ExtKeyUsage{x509.ExtKeyUsageClientAuth}, + } + + for _, cert := range certs[1:] { + opts.Intermediates.AddCert(cert) + } + + chains, err := certs[0].Verify(opts) + if err != nil { + c.sendAlert(alertBadCertificate) + return nil, errors.New("tls: failed to verify client's certificate: " + err.Error()) + } + + c.verifiedChains = chains + } + + if len(certs) > 0 { + var pub crypto.PublicKey + switch key := certs[0].PublicKey.(type) { + case *ecdsa.PublicKey, *rsa.PublicKey: + pub = key + default: + c.sendAlert(alertUnsupportedCertificate) + return nil, fmt.Errorf("tls: client's certificate contains an unsupported public key of type %T", certs[0].PublicKey) + } + c.peerCertificates = certs + return pub, nil + } + + return nil, nil +} + +// setCipherSuite sets a cipherSuite with the given id as the serverHandshakeState +// suite if that cipher suite is acceptable to use. +// It returns a bool indicating if the suite was set. +func (hs *serverHandshakeState) setCipherSuite(id uint16, supportedCipherSuites []uint16, version uint16) bool { + for _, supported := range supportedCipherSuites { + if id == supported { + var candidate *cipherSuite + + for _, s := range cipherSuites { + if s.id == id { + candidate = s + break + } + } + if candidate == nil { + continue + } + // Don't select a ciphersuite which we can't + // support for this client. + if candidate.flags&suiteECDHE != 0 { + if !hs.ellipticOk { + continue + } + if candidate.flags&suiteECDSA != 0 { + if !hs.ecdsaOk { + continue + } + } else if !hs.rsaSignOk { + continue + } + } else if !hs.rsaDecryptOk { + continue + } + if version < VersionTLS12 && candidate.flags&suiteTLS12 != 0 { + continue + } + hs.suite = candidate + return true + } + } + return false +} diff --git a/src/crypto/tls/handshake_server_test.go b/src/crypto/tls/handshake_server_test.go new file mode 100644 index 0000000000000000000000000000000000000000..20c2bd6d4d4fbbc9ae1f6bb27b28299805072821 --- /dev/null +++ b/src/crypto/tls/handshake_server_test.go @@ -0,0 +1,1059 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package tls + +import ( + "bytes" + "crypto/ecdsa" + "crypto/elliptic" + "crypto/rsa" + "encoding/hex" + "encoding/pem" + "errors" + "fmt" + "io" + "math/big" + "net" + "os" + "os/exec" + "path/filepath" + "strings" + "testing" + "time" +) + +// zeroSource is an io.Reader that returns an unlimited number of zero bytes. +type zeroSource struct{} + +func (zeroSource) Read(b []byte) (n int, err error) { + for i := range b { + b[i] = 0 + } + + return len(b), nil +} + +var testConfig *Config + +func allCipherSuites() []uint16 { + ids := make([]uint16, len(cipherSuites)) + for i, suite := range cipherSuites { + ids[i] = suite.id + } + + return ids +} + +func init() { + testConfig = &Config{ + Time: func() time.Time { return time.Unix(0, 0) }, + Rand: zeroSource{}, + Certificates: make([]Certificate, 2), + InsecureSkipVerify: true, + MinVersion: VersionSSL30, + MaxVersion: VersionTLS12, + CipherSuites: allCipherSuites(), + } + testConfig.Certificates[0].Certificate = [][]byte{testRSACertificate} + testConfig.Certificates[0].PrivateKey = testRSAPrivateKey + testConfig.Certificates[1].Certificate = [][]byte{testSNICertificate} + testConfig.Certificates[1].PrivateKey = testRSAPrivateKey + testConfig.BuildNameToCertificate() +} + +func testClientHello(t *testing.T, serverConfig *Config, m handshakeMessage) { + testClientHelloFailure(t, serverConfig, m, "") +} + +func testClientHelloFailure(t *testing.T, serverConfig *Config, m handshakeMessage, expectedSubStr string) { + // Create in-memory network connection, + // send message to server. Should return + // expected error. + c, s := net.Pipe() + go func() { + cli := Client(c, testConfig) + if ch, ok := m.(*clientHelloMsg); ok { + cli.vers = ch.vers + } + cli.writeRecord(recordTypeHandshake, m.marshal()) + c.Close() + }() + err := Server(s, serverConfig).Handshake() + s.Close() + if len(expectedSubStr) == 0 { + if err != nil && err != io.EOF { + t.Errorf("Got error: %s; expected to succeed", err, expectedSubStr) + } + } else if err == nil || !strings.Contains(err.Error(), expectedSubStr) { + t.Errorf("Got error: %s; expected to match substring '%s'", err, expectedSubStr) + } +} + +func TestSimpleError(t *testing.T) { + testClientHelloFailure(t, testConfig, &serverHelloDoneMsg{}, "unexpected handshake message") +} + +var badProtocolVersions = []uint16{0x0000, 0x0005, 0x0100, 0x0105, 0x0200, 0x0205} + +func TestRejectBadProtocolVersion(t *testing.T) { + for _, v := range badProtocolVersions { + testClientHelloFailure(t, testConfig, &clientHelloMsg{vers: v}, "unsupported, maximum protocol version") + } +} + +func TestNoSuiteOverlap(t *testing.T) { + clientHello := &clientHelloMsg{ + vers: 0x0301, + cipherSuites: []uint16{0xff00}, + compressionMethods: []uint8{0}, + } + testClientHelloFailure(t, testConfig, clientHello, "no cipher suite supported by both client and server") +} + +func TestNoCompressionOverlap(t *testing.T) { + clientHello := &clientHelloMsg{ + vers: 0x0301, + cipherSuites: []uint16{TLS_RSA_WITH_RC4_128_SHA}, + compressionMethods: []uint8{0xff}, + } + testClientHelloFailure(t, testConfig, clientHello, "client does not support uncompressed connections") +} + +func TestNoRC4ByDefault(t *testing.T) { + clientHello := &clientHelloMsg{ + vers: 0x0301, + cipherSuites: []uint16{TLS_RSA_WITH_RC4_128_SHA}, + compressionMethods: []uint8{0}, + } + serverConfig := *testConfig + // Reset the enabled cipher suites to nil in order to test the + // defaults. + serverConfig.CipherSuites = nil + testClientHelloFailure(t, &serverConfig, clientHello, "no cipher suite supported by both client and server") +} + +func TestDontSelectECDSAWithRSAKey(t *testing.T) { + // Test that, even when both sides support an ECDSA cipher suite, it + // won't be selected if the server's private key doesn't support it. + clientHello := &clientHelloMsg{ + vers: 0x0301, + cipherSuites: []uint16{TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA}, + compressionMethods: []uint8{0}, + supportedCurves: []CurveID{CurveP256}, + supportedPoints: []uint8{pointFormatUncompressed}, + } + serverConfig := *testConfig + serverConfig.CipherSuites = clientHello.cipherSuites + serverConfig.Certificates = make([]Certificate, 1) + serverConfig.Certificates[0].Certificate = [][]byte{testECDSACertificate} + serverConfig.Certificates[0].PrivateKey = testECDSAPrivateKey + serverConfig.BuildNameToCertificate() + // First test that it *does* work when the server's key is ECDSA. + testClientHello(t, &serverConfig, clientHello) + + // Now test that switching to an RSA key causes the expected error (and + // not an internal error about a signing failure). + serverConfig.Certificates = testConfig.Certificates + testClientHelloFailure(t, &serverConfig, clientHello, "no cipher suite supported by both client and server") +} + +func TestDontSelectRSAWithECDSAKey(t *testing.T) { + // Test that, even when both sides support an RSA cipher suite, it + // won't be selected if the server's private key doesn't support it. + clientHello := &clientHelloMsg{ + vers: 0x0301, + cipherSuites: []uint16{TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA}, + compressionMethods: []uint8{0}, + supportedCurves: []CurveID{CurveP256}, + supportedPoints: []uint8{pointFormatUncompressed}, + } + serverConfig := *testConfig + serverConfig.CipherSuites = clientHello.cipherSuites + // First test that it *does* work when the server's key is RSA. + testClientHello(t, &serverConfig, clientHello) + + // Now test that switching to an ECDSA key causes the expected error + // (and not an internal error about a signing failure). + serverConfig.Certificates = make([]Certificate, 1) + serverConfig.Certificates[0].Certificate = [][]byte{testECDSACertificate} + serverConfig.Certificates[0].PrivateKey = testECDSAPrivateKey + serverConfig.BuildNameToCertificate() + testClientHelloFailure(t, &serverConfig, clientHello, "no cipher suite supported by both client and server") +} + +func TestRenegotiationExtension(t *testing.T) { + clientHello := &clientHelloMsg{ + vers: VersionTLS12, + compressionMethods: []uint8{compressionNone}, + random: make([]byte, 32), + secureRenegotiation: true, + cipherSuites: []uint16{TLS_RSA_WITH_RC4_128_SHA}, + } + + var buf []byte + c, s := net.Pipe() + + go func() { + cli := Client(c, testConfig) + cli.vers = clientHello.vers + cli.writeRecord(recordTypeHandshake, clientHello.marshal()) + + buf = make([]byte, 1024) + n, err := c.Read(buf) + if err != nil { + t.Fatalf("Server read returned error: %s", err) + } + buf = buf[:n] + c.Close() + }() + + Server(s, testConfig).Handshake() + + if len(buf) < 5+4 { + t.Fatalf("Server returned short message of length %d", len(buf)) + } + // buf contains a TLS record, with a 5 byte record header and a 4 byte + // handshake header. The length of the ServerHello is taken from the + // handshake header. + serverHelloLen := int(buf[6])<<16 | int(buf[7])<<8 | int(buf[8]) + + var serverHello serverHelloMsg + // unmarshal expects to be given the handshake header, but + // serverHelloLen doesn't include it. + if !serverHello.unmarshal(buf[5 : 9+serverHelloLen]) { + t.Fatalf("Failed to parse ServerHello") + } + + if !serverHello.secureRenegotiation { + t.Errorf("Secure renegotiation extension was not echoed.") + } +} + +func TestTLS12OnlyCipherSuites(t *testing.T) { + // Test that a Server doesn't select a TLS 1.2-only cipher suite when + // the client negotiates TLS 1.1. + var zeros [32]byte + + clientHello := &clientHelloMsg{ + vers: VersionTLS11, + random: zeros[:], + cipherSuites: []uint16{ + // The Server, by default, will use the client's + // preference order. So the GCM cipher suite + // will be selected unless it's excluded because + // of the version in this ClientHello. + TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, + TLS_RSA_WITH_RC4_128_SHA, + }, + compressionMethods: []uint8{compressionNone}, + supportedCurves: []CurveID{CurveP256, CurveP384, CurveP521}, + supportedPoints: []uint8{pointFormatUncompressed}, + } + + c, s := net.Pipe() + var reply interface{} + var clientErr error + go func() { + cli := Client(c, testConfig) + cli.vers = clientHello.vers + cli.writeRecord(recordTypeHandshake, clientHello.marshal()) + reply, clientErr = cli.readHandshake() + c.Close() + }() + config := *testConfig + config.CipherSuites = clientHello.cipherSuites + Server(s, &config).Handshake() + s.Close() + if clientErr != nil { + t.Fatal(clientErr) + } + serverHello, ok := reply.(*serverHelloMsg) + if !ok { + t.Fatalf("didn't get ServerHello message in reply. Got %v\n", reply) + } + if s := serverHello.cipherSuite; s != TLS_RSA_WITH_RC4_128_SHA { + t.Fatalf("bad cipher suite from server: %x", s) + } +} + +func TestAlertForwarding(t *testing.T) { + c, s := net.Pipe() + go func() { + Client(c, testConfig).sendAlert(alertUnknownCA) + c.Close() + }() + + err := Server(s, testConfig).Handshake() + s.Close() + if e, ok := err.(*net.OpError); !ok || e.Err != error(alertUnknownCA) { + t.Errorf("Got error: %s; expected: %s", err, error(alertUnknownCA)) + } +} + +func TestClose(t *testing.T) { + c, s := net.Pipe() + go c.Close() + + err := Server(s, testConfig).Handshake() + s.Close() + if err != io.EOF { + t.Errorf("Got error: %s; expected: %s", err, io.EOF) + } +} + +func testHandshake(clientConfig, serverConfig *Config) (serverState, clientState ConnectionState, err error) { + c, s := net.Pipe() + done := make(chan bool) + go func() { + cli := Client(c, clientConfig) + cli.Handshake() + clientState = cli.ConnectionState() + c.Close() + done <- true + }() + server := Server(s, serverConfig) + err = server.Handshake() + if err == nil { + serverState = server.ConnectionState() + } + s.Close() + <-done + return +} + +func TestVersion(t *testing.T) { + serverConfig := &Config{ + Certificates: testConfig.Certificates, + MaxVersion: VersionTLS11, + } + clientConfig := &Config{ + InsecureSkipVerify: true, + } + state, _, err := testHandshake(clientConfig, serverConfig) + if err != nil { + t.Fatalf("handshake failed: %s", err) + } + if state.Version != VersionTLS11 { + t.Fatalf("Incorrect version %x, should be %x", state.Version, VersionTLS11) + } +} + +func TestCipherSuitePreference(t *testing.T) { + serverConfig := &Config{ + CipherSuites: []uint16{TLS_RSA_WITH_RC4_128_SHA, TLS_RSA_WITH_AES_128_CBC_SHA, TLS_ECDHE_RSA_WITH_RC4_128_SHA}, + Certificates: testConfig.Certificates, + MaxVersion: VersionTLS11, + } + clientConfig := &Config{ + CipherSuites: []uint16{TLS_RSA_WITH_AES_128_CBC_SHA, TLS_RSA_WITH_RC4_128_SHA}, + InsecureSkipVerify: true, + } + state, _, err := testHandshake(clientConfig, serverConfig) + if err != nil { + t.Fatalf("handshake failed: %s", err) + } + if state.CipherSuite != TLS_RSA_WITH_AES_128_CBC_SHA { + // By default the server should use the client's preference. + t.Fatalf("Client's preference was not used, got %x", state.CipherSuite) + } + + serverConfig.PreferServerCipherSuites = true + state, _, err = testHandshake(clientConfig, serverConfig) + if err != nil { + t.Fatalf("handshake failed: %s", err) + } + if state.CipherSuite != TLS_RSA_WITH_RC4_128_SHA { + t.Fatalf("Server's preference was not used, got %x", state.CipherSuite) + } +} + +func TestSCTHandshake(t *testing.T) { + expected := [][]byte{[]byte("certificate"), []byte("transparency")} + serverConfig := &Config{ + Certificates: []Certificate{{ + Certificate: [][]byte{testRSACertificate}, + PrivateKey: testRSAPrivateKey, + SignedCertificateTimestamps: expected, + }}, + } + clientConfig := &Config{ + InsecureSkipVerify: true, + } + _, state, err := testHandshake(clientConfig, serverConfig) + if err != nil { + t.Fatalf("handshake failed: %s", err) + } + actual := state.SignedCertificateTimestamps + if len(actual) != len(expected) { + t.Fatalf("got %d scts, want %d", len(actual), len(expected)) + } + for i, sct := range expected { + if !bytes.Equal(sct, actual[i]) { + t.Fatalf("SCT #%d was %x, but expected %x", i, actual[i], sct) + } + } +} + +// Note: see comment in handshake_test.go for details of how the reference +// tests work. + +// serverTest represents a test of the TLS server handshake against a reference +// implementation. +type serverTest struct { + // name is a freeform string identifying the test and the file in which + // the expected results will be stored. + name string + // command, if not empty, contains a series of arguments for the + // command to run for the reference server. + command []string + // expectedPeerCerts contains a list of PEM blocks of expected + // certificates from the client. + expectedPeerCerts []string + // config, if not nil, contains a custom Config to use for this test. + config *Config + // expectHandshakeErrorIncluding, when not empty, contains a string + // that must be a substring of the error resulting from the handshake. + expectHandshakeErrorIncluding string + // validate, if not nil, is a function that will be called with the + // ConnectionState of the resulting connection. It returns false if the + // ConnectionState is unacceptable. + validate func(ConnectionState) error +} + +var defaultClientCommand = []string{"openssl", "s_client", "-no_ticket"} + +// connFromCommand starts opens a listening socket and starts the reference +// client to connect to it. It returns a recordingConn that wraps the resulting +// connection. +func (test *serverTest) connFromCommand() (conn *recordingConn, child *exec.Cmd, err error) { + l, err := net.ListenTCP("tcp", &net.TCPAddr{ + IP: net.IPv4(127, 0, 0, 1), + Port: 0, + }) + if err != nil { + return nil, nil, err + } + defer l.Close() + + port := l.Addr().(*net.TCPAddr).Port + + var command []string + command = append(command, test.command...) + if len(command) == 0 { + command = defaultClientCommand + } + command = append(command, "-connect") + command = append(command, fmt.Sprintf("127.0.0.1:%d", port)) + cmd := exec.Command(command[0], command[1:]...) + cmd.Stdin = nil + var output bytes.Buffer + cmd.Stdout = &output + cmd.Stderr = &output + if err := cmd.Start(); err != nil { + return nil, nil, err + } + + connChan := make(chan interface{}) + go func() { + tcpConn, err := l.Accept() + if err != nil { + connChan <- err + } + connChan <- tcpConn + }() + + var tcpConn net.Conn + select { + case connOrError := <-connChan: + if err, ok := connOrError.(error); ok { + return nil, nil, err + } + tcpConn = connOrError.(net.Conn) + case <-time.After(2 * time.Second): + output.WriteTo(os.Stdout) + return nil, nil, errors.New("timed out waiting for connection from child process") + } + + record := &recordingConn{ + Conn: tcpConn, + } + + return record, cmd, nil +} + +func (test *serverTest) dataPath() string { + return filepath.Join("testdata", "Server-"+test.name) +} + +func (test *serverTest) loadData() (flows [][]byte, err error) { + in, err := os.Open(test.dataPath()) + if err != nil { + return nil, err + } + defer in.Close() + return parseTestData(in) +} + +func (test *serverTest) run(t *testing.T, write bool) { + var clientConn, serverConn net.Conn + var recordingConn *recordingConn + var childProcess *exec.Cmd + + if write { + var err error + recordingConn, childProcess, err = test.connFromCommand() + if err != nil { + t.Fatalf("Failed to start subcommand: %s", err) + } + serverConn = recordingConn + } else { + clientConn, serverConn = net.Pipe() + } + config := test.config + if config == nil { + config = testConfig + } + server := Server(serverConn, config) + connStateChan := make(chan ConnectionState, 1) + go func() { + var err error + if _, err = server.Write([]byte("hello, world\n")); err != nil { + t.Logf("Error from Server.Write: %s", err) + } + if len(test.expectHandshakeErrorIncluding) > 0 { + if err == nil { + t.Errorf("Error expected, but no error returned") + } else if s := err.Error(); !strings.Contains(s, test.expectHandshakeErrorIncluding) { + t.Errorf("Error expected containing '%s' but got '%s'", test.expectHandshakeErrorIncluding, s) + } + } + server.Close() + serverConn.Close() + connStateChan <- server.ConnectionState() + }() + + if !write { + flows, err := test.loadData() + if err != nil { + t.Fatalf("%s: failed to load data from %s", test.name, test.dataPath()) + } + for i, b := range flows { + if i%2 == 0 { + clientConn.Write(b) + continue + } + bb := make([]byte, len(b)) + n, err := io.ReadFull(clientConn, bb) + if err != nil { + t.Fatalf("%s #%d: %s\nRead %d, wanted %d, got %x, wanted %x\n", test.name, i+1, err, n, len(bb), bb[:n], b) + } + if !bytes.Equal(b, bb) { + t.Fatalf("%s #%d: mismatch on read: got:%x want:%x", test.name, i+1, bb, b) + } + } + clientConn.Close() + } + + connState := <-connStateChan + peerCerts := connState.PeerCertificates + if len(peerCerts) == len(test.expectedPeerCerts) { + for i, peerCert := range peerCerts { + block, _ := pem.Decode([]byte(test.expectedPeerCerts[i])) + if !bytes.Equal(block.Bytes, peerCert.Raw) { + t.Fatalf("%s: mismatch on peer cert %d", test.name, i+1) + } + } + } else { + t.Fatalf("%s: mismatch on peer list length: %d (wanted) != %d (got)", test.name, len(test.expectedPeerCerts), len(peerCerts)) + } + + if test.validate != nil { + if err := test.validate(connState); err != nil { + t.Fatalf("validate callback returned error: %s", err) + } + } + + if write { + path := test.dataPath() + out, err := os.OpenFile(path, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0644) + if err != nil { + t.Fatalf("Failed to create output file: %s", err) + } + defer out.Close() + recordingConn.Close() + if len(recordingConn.flows) < 3 { + childProcess.Stdout.(*bytes.Buffer).WriteTo(os.Stdout) + if len(test.expectHandshakeErrorIncluding) == 0 { + t.Fatalf("Handshake failed") + } + } + recordingConn.WriteTo(out) + fmt.Printf("Wrote %s\n", path) + childProcess.Wait() + } +} + +func runServerTestForVersion(t *testing.T, template *serverTest, prefix, option string) { + test := *template + test.name = prefix + test.name + if len(test.command) == 0 { + test.command = defaultClientCommand + } + test.command = append([]string(nil), test.command...) + test.command = append(test.command, option) + test.run(t, *update) +} + +func runServerTestSSLv3(t *testing.T, template *serverTest) { + runServerTestForVersion(t, template, "SSLv3-", "-ssl3") +} + +func runServerTestTLS10(t *testing.T, template *serverTest) { + runServerTestForVersion(t, template, "TLSv10-", "-tls1") +} + +func runServerTestTLS11(t *testing.T, template *serverTest) { + runServerTestForVersion(t, template, "TLSv11-", "-tls1_1") +} + +func runServerTestTLS12(t *testing.T, template *serverTest) { + runServerTestForVersion(t, template, "TLSv12-", "-tls1_2") +} + +func TestHandshakeServerRSARC4(t *testing.T) { + test := &serverTest{ + name: "RSA-RC4", + command: []string{"openssl", "s_client", "-no_ticket", "-cipher", "RC4-SHA"}, + } + runServerTestSSLv3(t, test) + runServerTestTLS10(t, test) + runServerTestTLS11(t, test) + runServerTestTLS12(t, test) +} + +func TestHandshakeServerRSA3DES(t *testing.T) { + test := &serverTest{ + name: "RSA-3DES", + command: []string{"openssl", "s_client", "-no_ticket", "-cipher", "DES-CBC3-SHA"}, + } + runServerTestSSLv3(t, test) + runServerTestTLS10(t, test) + runServerTestTLS12(t, test) +} + +func TestHandshakeServerRSAAES(t *testing.T) { + test := &serverTest{ + name: "RSA-AES", + command: []string{"openssl", "s_client", "-no_ticket", "-cipher", "AES128-SHA"}, + } + runServerTestSSLv3(t, test) + runServerTestTLS10(t, test) + runServerTestTLS12(t, test) +} + +func TestHandshakeServerAESGCM(t *testing.T) { + test := &serverTest{ + name: "RSA-AES-GCM", + command: []string{"openssl", "s_client", "-no_ticket", "-cipher", "ECDHE-RSA-AES128-GCM-SHA256"}, + } + runServerTestTLS12(t, test) +} + +func TestHandshakeServerAES256GCMSHA384(t *testing.T) { + test := &serverTest{ + name: "RSA-AES256-GCM-SHA384", + command: []string{"openssl", "s_client", "-no_ticket", "-cipher", "ECDHE-RSA-AES256-GCM-SHA384"}, + } + runServerTestTLS12(t, test) +} + +func TestHandshakeServerECDHEECDSAAES(t *testing.T) { + config := *testConfig + config.Certificates = make([]Certificate, 1) + config.Certificates[0].Certificate = [][]byte{testECDSACertificate} + config.Certificates[0].PrivateKey = testECDSAPrivateKey + config.BuildNameToCertificate() + + test := &serverTest{ + name: "ECDHE-ECDSA-AES", + command: []string{"openssl", "s_client", "-no_ticket", "-cipher", "ECDHE-ECDSA-AES256-SHA"}, + config: &config, + } + runServerTestTLS10(t, test) + runServerTestTLS12(t, test) +} + +func TestHandshakeServerALPN(t *testing.T) { + config := *testConfig + config.NextProtos = []string{"proto1", "proto2"} + + test := &serverTest{ + name: "ALPN", + // Note that this needs OpenSSL 1.0.2 because that is the first + // version that supports the -alpn flag. + command: []string{"openssl", "s_client", "-alpn", "proto2,proto1"}, + config: &config, + validate: func(state ConnectionState) error { + // The server's preferences should override the client. + if state.NegotiatedProtocol != "proto1" { + return fmt.Errorf("Got protocol %q, wanted proto1", state.NegotiatedProtocol) + } + return nil + }, + } + runServerTestTLS12(t, test) +} + +func TestHandshakeServerALPNNoMatch(t *testing.T) { + config := *testConfig + config.NextProtos = []string{"proto3"} + + test := &serverTest{ + name: "ALPN-NoMatch", + // Note that this needs OpenSSL 1.0.2 because that is the first + // version that supports the -alpn flag. + command: []string{"openssl", "s_client", "-alpn", "proto2,proto1"}, + config: &config, + validate: func(state ConnectionState) error { + // Rather than reject the connection, Go doesn't select + // a protocol when there is no overlap. + if state.NegotiatedProtocol != "" { + return fmt.Errorf("Got protocol %q, wanted ''", state.NegotiatedProtocol) + } + return nil + }, + } + runServerTestTLS12(t, test) +} + +// TestHandshakeServerSNI involves a client sending an SNI extension of +// "snitest.com", which happens to match the CN of testSNICertificate. The test +// verifies that the server correctly selects that certificate. +func TestHandshakeServerSNI(t *testing.T) { + test := &serverTest{ + name: "SNI", + command: []string{"openssl", "s_client", "-no_ticket", "-cipher", "AES128-SHA", "-servername", "snitest.com"}, + } + runServerTestTLS12(t, test) +} + +// TestHandshakeServerSNICertForName is similar to TestHandshakeServerSNI, but +// tests the dynamic GetCertificate method +func TestHandshakeServerSNIGetCertificate(t *testing.T) { + config := *testConfig + + // Replace the NameToCertificate map with a GetCertificate function + nameToCert := config.NameToCertificate + config.NameToCertificate = nil + config.GetCertificate = func(clientHello *ClientHelloInfo) (*Certificate, error) { + cert, _ := nameToCert[clientHello.ServerName] + return cert, nil + } + test := &serverTest{ + name: "SNI-GetCertificate", + command: []string{"openssl", "s_client", "-no_ticket", "-cipher", "AES128-SHA", "-servername", "snitest.com"}, + config: &config, + } + runServerTestTLS12(t, test) +} + +// TestHandshakeServerSNICertForNameNotFound is similar to +// TestHandshakeServerSNICertForName, but tests to make sure that when the +// GetCertificate method doesn't return a cert, we fall back to what's in +// the NameToCertificate map. +func TestHandshakeServerSNIGetCertificateNotFound(t *testing.T) { + config := *testConfig + + config.GetCertificate = func(clientHello *ClientHelloInfo) (*Certificate, error) { + return nil, nil + } + test := &serverTest{ + name: "SNI-GetCertificateNotFound", + command: []string{"openssl", "s_client", "-no_ticket", "-cipher", "AES128-SHA", "-servername", "snitest.com"}, + config: &config, + } + runServerTestTLS12(t, test) +} + +// TestHandshakeServerSNICertForNameError tests to make sure that errors in +// GetCertificate result in a tls alert. +func TestHandshakeServerSNIGetCertificateError(t *testing.T) { + const errMsg = "TestHandshakeServerSNIGetCertificateError error" + + serverConfig := *testConfig + serverConfig.GetCertificate = func(clientHello *ClientHelloInfo) (*Certificate, error) { + return nil, errors.New(errMsg) + } + + clientHello := &clientHelloMsg{ + vers: 0x0301, + cipherSuites: []uint16{TLS_RSA_WITH_RC4_128_SHA}, + compressionMethods: []uint8{0}, + serverName: "test", + } + testClientHelloFailure(t, &serverConfig, clientHello, errMsg) +} + +// TestHandshakeServerEmptyCertificates tests that GetCertificates is called in +// the case that Certificates is empty, even without SNI. +func TestHandshakeServerEmptyCertificates(t *testing.T) { + const errMsg = "TestHandshakeServerEmptyCertificates error" + + serverConfig := *testConfig + serverConfig.GetCertificate = func(clientHello *ClientHelloInfo) (*Certificate, error) { + return nil, errors.New(errMsg) + } + serverConfig.Certificates = nil + + clientHello := &clientHelloMsg{ + vers: 0x0301, + cipherSuites: []uint16{TLS_RSA_WITH_RC4_128_SHA}, + compressionMethods: []uint8{0}, + } + testClientHelloFailure(t, &serverConfig, clientHello, errMsg) + + // With an empty Certificates and a nil GetCertificate, the server + // should always return a “no certificates” error. + serverConfig.GetCertificate = nil + + clientHello = &clientHelloMsg{ + vers: 0x0301, + cipherSuites: []uint16{TLS_RSA_WITH_RC4_128_SHA}, + compressionMethods: []uint8{0}, + } + testClientHelloFailure(t, &serverConfig, clientHello, "no certificates") +} + +// TestCipherSuiteCertPreferance ensures that we select an RSA ciphersuite with +// an RSA certificate and an ECDSA ciphersuite with an ECDSA certificate. +func TestCipherSuiteCertPreferenceECDSA(t *testing.T) { + config := *testConfig + config.CipherSuites = []uint16{TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA} + config.PreferServerCipherSuites = true + + test := &serverTest{ + name: "CipherSuiteCertPreferenceRSA", + config: &config, + } + runServerTestTLS12(t, test) + + config = *testConfig + config.CipherSuites = []uint16{TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA} + config.Certificates = []Certificate{ + { + Certificate: [][]byte{testECDSACertificate}, + PrivateKey: testECDSAPrivateKey, + }, + } + config.BuildNameToCertificate() + config.PreferServerCipherSuites = true + + test = &serverTest{ + name: "CipherSuiteCertPreferenceECDSA", + config: &config, + } + runServerTestTLS12(t, test) +} + +func TestResumption(t *testing.T) { + sessionFilePath := tempFile("") + defer os.Remove(sessionFilePath) + + test := &serverTest{ + name: "IssueTicket", + command: []string{"openssl", "s_client", "-cipher", "RC4-SHA", "-sess_out", sessionFilePath}, + } + runServerTestTLS12(t, test) + + test = &serverTest{ + name: "Resume", + command: []string{"openssl", "s_client", "-cipher", "RC4-SHA", "-sess_in", sessionFilePath}, + } + runServerTestTLS12(t, test) +} + +func TestResumptionDisabled(t *testing.T) { + sessionFilePath := tempFile("") + defer os.Remove(sessionFilePath) + + config := *testConfig + + test := &serverTest{ + name: "IssueTicketPreDisable", + command: []string{"openssl", "s_client", "-cipher", "RC4-SHA", "-sess_out", sessionFilePath}, + config: &config, + } + runServerTestTLS12(t, test) + + config.SessionTicketsDisabled = true + + test = &serverTest{ + name: "ResumeDisabled", + command: []string{"openssl", "s_client", "-cipher", "RC4-SHA", "-sess_in", sessionFilePath}, + config: &config, + } + runServerTestTLS12(t, test) + + // One needs to manually confirm that the handshake in the golden data + // file for ResumeDisabled does not include a resumption handshake. +} + +func TestFallbackSCSV(t *testing.T) { + serverConfig := &Config{ + Certificates: testConfig.Certificates, + } + test := &serverTest{ + name: "FallbackSCSV", + config: serverConfig, + // OpenSSL 1.0.1j is needed for the -fallback_scsv option. + command: []string{"openssl", "s_client", "-fallback_scsv"}, + expectHandshakeErrorIncluding: "inappropriate protocol fallback", + } + runServerTestTLS11(t, test) +} + +// cert.pem and key.pem were generated with generate_cert.go +// Thus, they have no ExtKeyUsage fields and trigger an error +// when verification is turned on. + +const clientCertificatePEM = ` +-----BEGIN CERTIFICATE----- +MIIB7TCCAVigAwIBAgIBADALBgkqhkiG9w0BAQUwJjEQMA4GA1UEChMHQWNtZSBD +bzESMBAGA1UEAxMJMTI3LjAuMC4xMB4XDTExMTIwODA3NTUxMloXDTEyMTIwNzA4 +MDAxMlowJjEQMA4GA1UEChMHQWNtZSBDbzESMBAGA1UEAxMJMTI3LjAuMC4xMIGc +MAsGCSqGSIb3DQEBAQOBjAAwgYgCgYBO0Hsx44Jk2VnAwoekXh6LczPHY1PfZpIG +hPZk1Y/kNqcdK+izIDZFI7Xjla7t4PUgnI2V339aEu+H5Fto5OkOdOwEin/ekyfE +ARl6vfLcPRSr0FTKIQzQTW6HLlzF0rtNS0/Otiz3fojsfNcCkXSmHgwa2uNKWi7e +E5xMQIhZkwIDAQABozIwMDAOBgNVHQ8BAf8EBAMCAKAwDQYDVR0OBAYEBAECAwQw +DwYDVR0jBAgwBoAEAQIDBDALBgkqhkiG9w0BAQUDgYEANh+zegx1yW43RmEr1b3A +p0vMRpqBWHyFeSnIyMZn3TJWRSt1tukkqVCavh9a+hoV2cxVlXIWg7nCto/9iIw4 +hB2rXZIxE0/9gzvGnfERYraL7KtnvshksBFQRlgXa5kc0x38BvEO5ZaoDPl4ILdE +GFGNEH5PlGffo05wc46QkYU= +-----END CERTIFICATE-----` + +const clientKeyPEM = ` +-----BEGIN RSA PRIVATE KEY----- +MIICWgIBAAKBgE7QezHjgmTZWcDCh6ReHotzM8djU99mkgaE9mTVj+Q2px0r6LMg +NkUjteOVru3g9SCcjZXff1oS74fkW2jk6Q507ASKf96TJ8QBGXq98tw9FKvQVMoh +DNBNbocuXMXSu01LT862LPd+iOx81wKRdKYeDBra40paLt4TnExAiFmTAgMBAAEC +gYBxvXd8yNteFTns8A/2yomEMC4yeosJJSpp1CsN3BJ7g8/qTnrVPxBy+RU+qr63 +t2WquaOu/cr5P8iEsa6lk20tf8pjKLNXeX0b1RTzK8rJLbS7nGzP3tvOhL096VtQ +dAo4ROEaro0TzYpHmpciSvxVIeEIAAdFDObDJPKqcJAxyQJBAJizfYgK8Gzx9fsx +hxp+VteCbVPg2euASH5Yv3K5LukRdKoSzHE2grUVQgN/LafC0eZibRanxHegYSr7 +7qaswKUCQQCEIWor/X4XTMdVj3Oj+vpiw75y/S9gh682+myZL+d/02IEkwnB098P +RkKVpenBHyrGg0oeN5La7URILWKj7CPXAkBKo6F+d+phNjwIFoN1Xb/RA32w/D1I +saG9sF+UEhRt9AxUfW/U/tIQ9V0ZHHcSg1XaCM5Nvp934brdKdvTOKnJAkBD5h/3 +Rybatlvg/fzBEaJFyq09zhngkxlZOUtBVTqzl17RVvY2orgH02U4HbCHy4phxOn7 +qTdQRYlHRftgnWK1AkANibn9PRYJ7mJyJ9Dyj2QeNcSkSTzrt0tPvUMf4+meJymN +1Ntu5+S1DLLzfxlaljWG6ylW6DNxujCyuXIV2rvA +-----END RSA PRIVATE KEY-----` + +const clientECDSACertificatePEM = ` +-----BEGIN CERTIFICATE----- +MIIB/DCCAV4CCQCaMIRsJjXZFzAJBgcqhkjOPQQBMEUxCzAJBgNVBAYTAkFVMRMw +EQYDVQQIEwpTb21lLVN0YXRlMSEwHwYDVQQKExhJbnRlcm5ldCBXaWRnaXRzIFB0 +eSBMdGQwHhcNMTIxMTE0MTMyNTUzWhcNMjIxMTEyMTMyNTUzWjBBMQswCQYDVQQG +EwJBVTEMMAoGA1UECBMDTlNXMRAwDgYDVQQHEwdQeXJtb250MRIwEAYDVQQDEwlK +b2VsIFNpbmcwgZswEAYHKoZIzj0CAQYFK4EEACMDgYYABACVjJF1FMBexFe01MNv +ja5oHt1vzobhfm6ySD6B5U7ixohLZNz1MLvT/2XMW/TdtWo+PtAd3kfDdq0Z9kUs +jLzYHQFMH3CQRnZIi4+DzEpcj0B22uCJ7B0rxE4wdihBsmKo+1vx+U56jb0JuK7q +ixgnTy5w/hOWusPTQBbNZU6sER7m8TAJBgcqhkjOPQQBA4GMADCBiAJCAOAUxGBg +C3JosDJdYUoCdFzCgbkWqD8pyDbHgf9stlvZcPE4O1BIKJTLCRpS8V3ujfK58PDa +2RU6+b0DeoeiIzXsAkIBo9SKeDUcSpoj0gq+KxAxnZxfvuiRs9oa9V2jI/Umi0Vw +jWVim34BmT0Y9hCaOGGbLlfk+syxis7iI6CH8OFnUes= +-----END CERTIFICATE-----` + +const clientECDSAKeyPEM = ` +-----BEGIN EC PARAMETERS----- +BgUrgQQAIw== +-----END EC PARAMETERS----- +-----BEGIN EC PRIVATE KEY----- +MIHcAgEBBEIBkJN9X4IqZIguiEVKMqeBUP5xtRsEv4HJEtOpOGLELwO53SD78Ew8 +k+wLWoqizS3NpQyMtrU8JFdWfj+C57UNkOugBwYFK4EEACOhgYkDgYYABACVjJF1 +FMBexFe01MNvja5oHt1vzobhfm6ySD6B5U7ixohLZNz1MLvT/2XMW/TdtWo+PtAd +3kfDdq0Z9kUsjLzYHQFMH3CQRnZIi4+DzEpcj0B22uCJ7B0rxE4wdihBsmKo+1vx ++U56jb0JuK7qixgnTy5w/hOWusPTQBbNZU6sER7m8Q== +-----END EC PRIVATE KEY-----` + +func TestClientAuth(t *testing.T) { + var certPath, keyPath, ecdsaCertPath, ecdsaKeyPath string + + if *update { + certPath = tempFile(clientCertificatePEM) + defer os.Remove(certPath) + keyPath = tempFile(clientKeyPEM) + defer os.Remove(keyPath) + ecdsaCertPath = tempFile(clientECDSACertificatePEM) + defer os.Remove(ecdsaCertPath) + ecdsaKeyPath = tempFile(clientECDSAKeyPEM) + defer os.Remove(ecdsaKeyPath) + } + + config := *testConfig + config.ClientAuth = RequestClientCert + + test := &serverTest{ + name: "ClientAuthRequestedNotGiven", + command: []string{"openssl", "s_client", "-no_ticket", "-cipher", "RC4-SHA"}, + config: &config, + } + runServerTestTLS12(t, test) + + test = &serverTest{ + name: "ClientAuthRequestedAndGiven", + command: []string{"openssl", "s_client", "-no_ticket", "-cipher", "RC4-SHA", "-cert", certPath, "-key", keyPath}, + config: &config, + expectedPeerCerts: []string{clientCertificatePEM}, + } + runServerTestTLS12(t, test) + + test = &serverTest{ + name: "ClientAuthRequestedAndECDSAGiven", + command: []string{"openssl", "s_client", "-no_ticket", "-cipher", "RC4-SHA", "-cert", ecdsaCertPath, "-key", ecdsaKeyPath}, + config: &config, + expectedPeerCerts: []string{clientECDSACertificatePEM}, + } + runServerTestTLS12(t, test) +} + +func bigFromString(s string) *big.Int { + ret := new(big.Int) + ret.SetString(s, 10) + return ret +} + +func fromHex(s string) []byte { + b, _ := hex.DecodeString(s) + return b +} + +var testRSACertificate = fromHex("30820263308201cca003020102020900a273000c8100cbf3300d06092a864886f70d01010b0500302b31173015060355040a130e476f6f676c652054455354494e473110300e06035504031307476f20526f6f74301e170d3135303130313030303030305a170d3235303130313030303030305a302631173015060355040a130e476f6f676c652054455354494e47310b300906035504031302476f30819f300d06092a864886f70d010101050003818d0030818902818100af8788f6201b95656c14ab4405af3b4514e3b76dfd00634d957ffe6a623586c04af9187cf6aa255e7a64316600baf48e92afc76bd876d4f35f41cb6e5615971b97c13c123921663d2b16d1bcdb1cc0a7dab7caadbadacbd52150ecde8dabd16b814b8902f3c4bec16c89b14484bd21d1047d9d164df98215f6effad60947f2fb0203010001a38193308190300e0603551d0f0101ff0404030205a0301d0603551d250416301406082b0601050507030106082b06010505070302300c0603551d130101ff0402300030190603551d0e0412041012508d896f1bd1dc544d6ecb695e06f4301b0603551d23041430128010bf3db6a966f2b840cfeab40378481a4130190603551d1104123010820e6578616d706c652e676f6c616e67300d06092a864886f70d01010b050003818100927caf91551218965931a64840d52dd5eebb02a0f5c21e7c9bb3307d3cdc76da4f3dc0faae2d33246b037b1b67591121b511bc77b9d9e06ea82d2e35fa645f223e63106bbeff14866d0df01531a814381e3b84872ccb98ed5176b9b14fdddb9b84048640fa51ddbab48debe346de46b94f86c7f9a4c24134acccf6eab0ab3918") + +var testRSACertificateIssuer = fromHex("3082024d308201b6a003020102020827326bd913b7c43d300d06092a864886f70d01010b0500302b31173015060355040a130e476f6f676c652054455354494e473110300e06035504031307476f20526f6f74301e170d3135303130313030303030305a170d3235303130313030303030305a302b31173015060355040a130e476f6f676c652054455354494e473110300e06035504031307476f20526f6f7430819f300d06092a864886f70d010101050003818d0030818902818100f0429a7b9f66a222c8453800452db355b34c4409fee09af2510a6589bfa35bdb4d453200d1de24338d6d5e5a91cc8301628445d6eb4e675927b9c1ea5c0f676acfb0f708ce4f19827e321c1898bf86df9823d5f0b05df2b6779888eff8abbc7f41c6e7d2667386a579b8cbaad3f6fd597cd7c4b187911a425aed1b555c1965190203010001a37a3078300e0603551d0f0101ff040403020204301d0603551d250416301406082b0601050507030106082b06010505070302300f0603551d130101ff040530030101ff30190603551d0e04120410bf3db6a966f2b840cfeab40378481a41301b0603551d23041430128010bf3db6a966f2b840cfeab40378481a41300d06092a864886f70d01010b050003818100586e68c1219ed4f5782b7cfd53cf1a55750a98781b2023f8694bb831fff6d7d4aad1f0ac782b1ec787f00a8956bdd06b4a1063444fcafe955c07d679163a730802c568886a2cf8a3c2ab41176957131c4b9e077ebd7ffbb91fdad8b08b932e9aeefac04923ffdc0aa145563f7f061995317400203578f350e3e566deb29dec5e") + +var testECDSACertificate = fromHex("3082020030820162020900b8bf2d47a0d2ebf4300906072a8648ce3d04013045310b3009060355040613024155311330110603550408130a536f6d652d53746174653121301f060355040a1318496e7465726e6574205769646769747320507479204c7464301e170d3132313132323135303633325a170d3232313132303135303633325a3045310b3009060355040613024155311330110603550408130a536f6d652d53746174653121301f060355040a1318496e7465726e6574205769646769747320507479204c746430819b301006072a8648ce3d020106052b81040023038186000400c4a1edbe98f90b4873367ec316561122f23d53c33b4d213dcd6b75e6f6b0dc9adf26c1bcb287f072327cb3642f1c90bcea6823107efee325c0483a69e0286dd33700ef0462dd0da09c706283d881d36431aa9e9731bd96b068c09b23de76643f1a5c7fe9120e5858b65f70dd9bd8ead5d7f5d5ccb9b69f30665b669a20e227e5bffe3b300906072a8648ce3d040103818c0030818802420188a24febe245c5487d1bacf5ed989dae4770c05e1bb62fbdf1b64db76140d311a2ceee0b7e927eff769dc33b7ea53fcefa10e259ec472d7cacda4e970e15a06fd00242014dfcbe67139c2d050ebd3fa38c25c13313830d9406bbd4377af6ec7ac9862eddd711697f857c56defb31782be4c7780daecbbe9e4e3624317b6a0f399512078f2a") + +var testSNICertificate = fromHex("308201f23082015da003020102020100300b06092a864886f70d01010530283110300e060355040a130741636d6520436f311430120603550403130b736e69746573742e636f6d301e170d3132303431313137343033355a170d3133303431313137343533355a30283110300e060355040a130741636d6520436f311430120603550403130b736e69746573742e636f6d30819d300b06092a864886f70d01010103818d0030818902818100bb79d6f517b5e5bf4610d0dc69bee62b07435ad0032d8a7a4385b71452e7a5654c2c78b8238cb5b482e5de1f953b7e62a52ca533d6fe125c7a56fcf506bffa587b263fb5cd04d3d0c921964ac7f4549f5abfef427100fe1899077f7e887d7df10439c4a22edb51c97ce3c04c3b326601cfafb11db8719a1ddbdb896baeda2d790203010001a3323030300e0603551d0f0101ff0404030200a0300d0603551d0e0406040401020304300f0603551d2304083006800401020304300b06092a864886f70d0101050381810089c6455f1c1f5ef8eb1ab174ee2439059f5c4259bb1a8d86cdb1d056f56a717da40e95ab90f59e8deaf627c157995094db0802266eb34fc6842dea8a4b68d9c1389103ab84fb9e1f85d9b5d23ff2312c8670fbb540148245a4ebafe264d90c8a4cf4f85b0fac12ac2fc4a3154bad52462868af96c62c6525d652b6e31845bdcc") + +var testRSAPrivateKey = &rsa.PrivateKey{ + PublicKey: rsa.PublicKey{ + N: bigFromString("123260960069105588390096594560395120585636206567569540256061833976822892593755073841963170165000086278069699238754008398039246547214989242849418349143232951701395321381739566687846006911427966669790845430647688107009232778985142860108863460556510585049041936029324503323373417214453307648498561956908810892027L"), + E: 65537, + }, + D: bigFromString("73196363031103823625826315929954946106043759818067219550565550066527203472294428548476778865091068522665312037075674791871635825938217363523103946045078950060973913307430314113074463630778799389010335923241901501086246276485964417618981733827707048660375428006201525399194575538037883519254056917253456403553L"), + Primes: []*big.Int{ + bigFromString("11157426355495284553529769521954035649776033703833034489026848970480272318436419662860715175517581249375929775774910501512841707465207184924996975125010787L"), + bigFromString("11047436580963564307160117670964629323534448585520694947919342920137706075617545637058809770319843170934495909554506529982972972247390145716507031692656521L"), + }, +} + +var testECDSAPrivateKey = &ecdsa.PrivateKey{ + PublicKey: ecdsa.PublicKey{ + Curve: elliptic.P521(), + X: bigFromString("2636411247892461147287360222306590634450676461695221912739908880441342231985950069527906976759812296359387337367668045707086543273113073382714101597903639351"), + Y: bigFromString("3204695818431246682253994090650952614555094516658732116404513121125038617915183037601737180082382202488628239201196033284060130040574800684774115478859677243"), + }, + D: bigFromString("5477294338614160138026852784385529180817726002953041720191098180813046231640184669647735805135001309477695746518160084669446643325196003346204701381388769751"), +} diff --git a/src/crypto/tls/handshake_test.go b/src/crypto/tls/handshake_test.go new file mode 100644 index 0000000000000000000000000000000000000000..f95f274ab415909f4ce3f838eb779f1856b136a9 --- /dev/null +++ b/src/crypto/tls/handshake_test.go @@ -0,0 +1,167 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package tls + +import ( + "bufio" + "encoding/hex" + "errors" + "flag" + "fmt" + "io" + "io/ioutil" + "net" + "strconv" + "strings" + "sync" +) + +// TLS reference tests run a connection against a reference implementation +// (OpenSSL) of TLS and record the bytes of the resulting connection. The Go +// code, during a test, is configured with deterministic randomness and so the +// reference test can be reproduced exactly in the future. +// +// In order to save everyone who wishes to run the tests from needing the +// reference implementation installed, the reference connections are saved in +// files in the testdata directory. Thus running the tests involves nothing +// external, but creating and updating them requires the reference +// implementation. +// +// Tests can be updated by running them with the -update flag. This will cause +// the test files. Generally one should combine the -update flag with -test.run +// to updated a specific test. Since the reference implementation will always +// generate fresh random numbers, large parts of the reference connection will +// always change. + +var update = flag.Bool("update", false, "update golden files on disk") + +// recordingConn is a net.Conn that records the traffic that passes through it. +// WriteTo can be used to produce output that can be later be loaded with +// ParseTestData. +type recordingConn struct { + net.Conn + sync.Mutex + flows [][]byte + reading bool +} + +func (r *recordingConn) Read(b []byte) (n int, err error) { + if n, err = r.Conn.Read(b); n == 0 { + return + } + b = b[:n] + + r.Lock() + defer r.Unlock() + + if l := len(r.flows); l == 0 || !r.reading { + buf := make([]byte, len(b)) + copy(buf, b) + r.flows = append(r.flows, buf) + } else { + r.flows[l-1] = append(r.flows[l-1], b[:n]...) + } + r.reading = true + return +} + +func (r *recordingConn) Write(b []byte) (n int, err error) { + if n, err = r.Conn.Write(b); n == 0 { + return + } + b = b[:n] + + r.Lock() + defer r.Unlock() + + if l := len(r.flows); l == 0 || r.reading { + buf := make([]byte, len(b)) + copy(buf, b) + r.flows = append(r.flows, buf) + } else { + r.flows[l-1] = append(r.flows[l-1], b[:n]...) + } + r.reading = false + return +} + +// WriteTo writes Go source code to w that contains the recorded traffic. +func (r *recordingConn) WriteTo(w io.Writer) { + // TLS always starts with a client to server flow. + clientToServer := true + + for i, flow := range r.flows { + source, dest := "client", "server" + if !clientToServer { + source, dest = dest, source + } + fmt.Fprintf(w, ">>> Flow %d (%s to %s)\n", i+1, source, dest) + dumper := hex.Dumper(w) + dumper.Write(flow) + dumper.Close() + clientToServer = !clientToServer + } +} + +func parseTestData(r io.Reader) (flows [][]byte, err error) { + var currentFlow []byte + + scanner := bufio.NewScanner(r) + for scanner.Scan() { + line := scanner.Text() + // If the line starts with ">>> " then it marks the beginning + // of a new flow. + if strings.HasPrefix(line, ">>> ") { + if len(currentFlow) > 0 || len(flows) > 0 { + flows = append(flows, currentFlow) + currentFlow = nil + } + continue + } + + // Otherwise the line is a line of hex dump that looks like: + // 00000170 fc f5 06 bf (...) |.....X{&?......!| + // (Some bytes have been omitted from the middle section.) + + if i := strings.IndexByte(line, ' '); i >= 0 { + line = line[i:] + } else { + return nil, errors.New("invalid test data") + } + + if i := strings.IndexByte(line, '|'); i >= 0 { + line = line[:i] + } else { + return nil, errors.New("invalid test data") + } + + hexBytes := strings.Fields(line) + for _, hexByte := range hexBytes { + val, err := strconv.ParseUint(hexByte, 16, 8) + if err != nil { + return nil, errors.New("invalid hex byte in test data: " + err.Error()) + } + currentFlow = append(currentFlow, byte(val)) + } + } + + if len(currentFlow) > 0 { + flows = append(flows, currentFlow) + } + + return flows, nil +} + +// tempFile creates a temp file containing contents and returns its path. +func tempFile(contents string) string { + file, err := ioutil.TempFile("", "go-tls-test") + if err != nil { + panic("failed to create temp file: " + err.Error()) + } + path := file.Name() + file.WriteString(contents) + file.Close() + return path +} diff --git a/src/crypto/tls/key_agreement.go b/src/crypto/tls/key_agreement.go new file mode 100644 index 0000000000000000000000000000000000000000..0e6a7c2262404ae6bf499a914855b48bda897535 --- /dev/null +++ b/src/crypto/tls/key_agreement.go @@ -0,0 +1,405 @@ +// Copyright 2010 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package tls + +import ( + "crypto" + "crypto/ecdsa" + "crypto/elliptic" + "crypto/md5" + "crypto/rsa" + "crypto/sha1" + "crypto/x509" + "encoding/asn1" + "errors" + "io" + "math/big" +) + +var errClientKeyExchange = errors.New("tls: invalid ClientKeyExchange message") +var errServerKeyExchange = errors.New("tls: invalid ServerKeyExchange message") + +// rsaKeyAgreement implements the standard TLS key agreement where the client +// encrypts the pre-master secret to the server's public key. +type rsaKeyAgreement struct{} + +func (ka rsaKeyAgreement) generateServerKeyExchange(config *Config, cert *Certificate, clientHello *clientHelloMsg, hello *serverHelloMsg) (*serverKeyExchangeMsg, error) { + return nil, nil +} + +func (ka rsaKeyAgreement) processClientKeyExchange(config *Config, cert *Certificate, ckx *clientKeyExchangeMsg, version uint16) ([]byte, error) { + if len(ckx.ciphertext) < 2 { + return nil, errClientKeyExchange + } + + ciphertext := ckx.ciphertext + if version != VersionSSL30 { + ciphertextLen := int(ckx.ciphertext[0])<<8 | int(ckx.ciphertext[1]) + if ciphertextLen != len(ckx.ciphertext)-2 { + return nil, errClientKeyExchange + } + ciphertext = ckx.ciphertext[2:] + } + priv, ok := cert.PrivateKey.(crypto.Decrypter) + if !ok { + return nil, errors.New("tls: certificate private key does not implement crypto.Decrypter") + } + // Perform constant time RSA PKCS#1 v1.5 decryption + preMasterSecret, err := priv.Decrypt(config.rand(), ciphertext, &rsa.PKCS1v15DecryptOptions{SessionKeyLen: 48}) + if err != nil { + return nil, err + } + // We don't check the version number in the premaster secret. For one, + // by checking it, we would leak information about the validity of the + // encrypted pre-master secret. Secondly, it provides only a small + // benefit against a downgrade attack and some implementations send the + // wrong version anyway. See the discussion at the end of section + // 7.4.7.1 of RFC 4346. + return preMasterSecret, nil +} + +func (ka rsaKeyAgreement) processServerKeyExchange(config *Config, clientHello *clientHelloMsg, serverHello *serverHelloMsg, cert *x509.Certificate, skx *serverKeyExchangeMsg) error { + return errors.New("tls: unexpected ServerKeyExchange") +} + +func (ka rsaKeyAgreement) generateClientKeyExchange(config *Config, clientHello *clientHelloMsg, cert *x509.Certificate) ([]byte, *clientKeyExchangeMsg, error) { + preMasterSecret := make([]byte, 48) + preMasterSecret[0] = byte(clientHello.vers >> 8) + preMasterSecret[1] = byte(clientHello.vers) + _, err := io.ReadFull(config.rand(), preMasterSecret[2:]) + if err != nil { + return nil, nil, err + } + + encrypted, err := rsa.EncryptPKCS1v15(config.rand(), cert.PublicKey.(*rsa.PublicKey), preMasterSecret) + if err != nil { + return nil, nil, err + } + ckx := new(clientKeyExchangeMsg) + ckx.ciphertext = make([]byte, len(encrypted)+2) + ckx.ciphertext[0] = byte(len(encrypted) >> 8) + ckx.ciphertext[1] = byte(len(encrypted)) + copy(ckx.ciphertext[2:], encrypted) + return preMasterSecret, ckx, nil +} + +// sha1Hash calculates a SHA1 hash over the given byte slices. +func sha1Hash(slices [][]byte) []byte { + hsha1 := sha1.New() + for _, slice := range slices { + hsha1.Write(slice) + } + return hsha1.Sum(nil) +} + +// md5SHA1Hash implements TLS 1.0's hybrid hash function which consists of the +// concatenation of an MD5 and SHA1 hash. +func md5SHA1Hash(slices [][]byte) []byte { + md5sha1 := make([]byte, md5.Size+sha1.Size) + hmd5 := md5.New() + for _, slice := range slices { + hmd5.Write(slice) + } + copy(md5sha1, hmd5.Sum(nil)) + copy(md5sha1[md5.Size:], sha1Hash(slices)) + return md5sha1 +} + +// hashForServerKeyExchange hashes the given slices and returns their digest +// and the identifier of the hash function used. The sigAndHash argument is +// only used for >= TLS 1.2 and precisely identifies the hash function to use. +func hashForServerKeyExchange(sigAndHash signatureAndHash, version uint16, slices ...[]byte) ([]byte, crypto.Hash, error) { + if version >= VersionTLS12 { + if !isSupportedSignatureAndHash(sigAndHash, supportedSignatureAlgorithms) { + return nil, crypto.Hash(0), errors.New("tls: unsupported hash function used by peer") + } + hashFunc, err := lookupTLSHash(sigAndHash.hash) + if err != nil { + return nil, crypto.Hash(0), err + } + h := hashFunc.New() + for _, slice := range slices { + h.Write(slice) + } + digest := h.Sum(nil) + return digest, hashFunc, nil + } + if sigAndHash.signature == signatureECDSA { + return sha1Hash(slices), crypto.SHA1, nil + } + return md5SHA1Hash(slices), crypto.MD5SHA1, nil +} + +// pickTLS12HashForSignature returns a TLS 1.2 hash identifier for signing a +// ServerKeyExchange given the signature type being used and the client's +// advertised list of supported signature and hash combinations. +func pickTLS12HashForSignature(sigType uint8, clientList []signatureAndHash) (uint8, error) { + if len(clientList) == 0 { + // If the client didn't specify any signature_algorithms + // extension then we can assume that it supports SHA1. See + // http://tools.ietf.org/html/rfc5246#section-7.4.1.4.1 + return hashSHA1, nil + } + + for _, sigAndHash := range clientList { + if sigAndHash.signature != sigType { + continue + } + if isSupportedSignatureAndHash(sigAndHash, supportedSignatureAlgorithms) { + return sigAndHash.hash, nil + } + } + + return 0, errors.New("tls: client doesn't support any common hash functions") +} + +func curveForCurveID(id CurveID) (elliptic.Curve, bool) { + switch id { + case CurveP256: + return elliptic.P256(), true + case CurveP384: + return elliptic.P384(), true + case CurveP521: + return elliptic.P521(), true + default: + return nil, false + } + +} + +// ecdheRSAKeyAgreement implements a TLS key agreement where the server +// generates a ephemeral EC public/private key pair and signs it. The +// pre-master secret is then calculated using ECDH. The signature may +// either be ECDSA or RSA. +type ecdheKeyAgreement struct { + version uint16 + sigType uint8 + privateKey []byte + curve elliptic.Curve + x, y *big.Int +} + +func (ka *ecdheKeyAgreement) generateServerKeyExchange(config *Config, cert *Certificate, clientHello *clientHelloMsg, hello *serverHelloMsg) (*serverKeyExchangeMsg, error) { + var curveid CurveID + preferredCurves := config.curvePreferences() + +NextCandidate: + for _, candidate := range preferredCurves { + for _, c := range clientHello.supportedCurves { + if candidate == c { + curveid = c + break NextCandidate + } + } + } + + if curveid == 0 { + return nil, errors.New("tls: no supported elliptic curves offered") + } + + var ok bool + if ka.curve, ok = curveForCurveID(curveid); !ok { + return nil, errors.New("tls: preferredCurves includes unsupported curve") + } + + var x, y *big.Int + var err error + ka.privateKey, x, y, err = elliptic.GenerateKey(ka.curve, config.rand()) + if err != nil { + return nil, err + } + ecdhePublic := elliptic.Marshal(ka.curve, x, y) + + // http://tools.ietf.org/html/rfc4492#section-5.4 + serverECDHParams := make([]byte, 1+2+1+len(ecdhePublic)) + serverECDHParams[0] = 3 // named curve + serverECDHParams[1] = byte(curveid >> 8) + serverECDHParams[2] = byte(curveid) + serverECDHParams[3] = byte(len(ecdhePublic)) + copy(serverECDHParams[4:], ecdhePublic) + + sigAndHash := signatureAndHash{signature: ka.sigType} + + if ka.version >= VersionTLS12 { + if sigAndHash.hash, err = pickTLS12HashForSignature(ka.sigType, clientHello.signatureAndHashes); err != nil { + return nil, err + } + } + + digest, hashFunc, err := hashForServerKeyExchange(sigAndHash, ka.version, clientHello.random, hello.random, serverECDHParams) + if err != nil { + return nil, err + } + + priv, ok := cert.PrivateKey.(crypto.Signer) + if !ok { + return nil, errors.New("tls: certificate private key does not implement crypto.Signer") + } + var sig []byte + switch ka.sigType { + case signatureECDSA: + _, ok := priv.Public().(*ecdsa.PublicKey) + if !ok { + return nil, errors.New("ECDHE ECDSA requires an ECDSA server key") + } + case signatureRSA: + _, ok := priv.Public().(*rsa.PublicKey) + if !ok { + return nil, errors.New("ECDHE RSA requires a RSA server key") + } + default: + return nil, errors.New("unknown ECDHE signature algorithm") + } + sig, err = priv.Sign(config.rand(), digest, hashFunc) + if err != nil { + return nil, errors.New("failed to sign ECDHE parameters: " + err.Error()) + } + + skx := new(serverKeyExchangeMsg) + sigAndHashLen := 0 + if ka.version >= VersionTLS12 { + sigAndHashLen = 2 + } + skx.key = make([]byte, len(serverECDHParams)+sigAndHashLen+2+len(sig)) + copy(skx.key, serverECDHParams) + k := skx.key[len(serverECDHParams):] + if ka.version >= VersionTLS12 { + k[0] = sigAndHash.hash + k[1] = sigAndHash.signature + k = k[2:] + } + k[0] = byte(len(sig) >> 8) + k[1] = byte(len(sig)) + copy(k[2:], sig) + + return skx, nil +} + +func (ka *ecdheKeyAgreement) processClientKeyExchange(config *Config, cert *Certificate, ckx *clientKeyExchangeMsg, version uint16) ([]byte, error) { + if len(ckx.ciphertext) == 0 || int(ckx.ciphertext[0]) != len(ckx.ciphertext)-1 { + return nil, errClientKeyExchange + } + x, y := elliptic.Unmarshal(ka.curve, ckx.ciphertext[1:]) + if x == nil { + return nil, errClientKeyExchange + } + if !ka.curve.IsOnCurve(x, y) { + return nil, errClientKeyExchange + } + x, _ = ka.curve.ScalarMult(x, y, ka.privateKey) + preMasterSecret := make([]byte, (ka.curve.Params().BitSize+7)>>3) + xBytes := x.Bytes() + copy(preMasterSecret[len(preMasterSecret)-len(xBytes):], xBytes) + + return preMasterSecret, nil +} + +func (ka *ecdheKeyAgreement) processServerKeyExchange(config *Config, clientHello *clientHelloMsg, serverHello *serverHelloMsg, cert *x509.Certificate, skx *serverKeyExchangeMsg) error { + if len(skx.key) < 4 { + return errServerKeyExchange + } + if skx.key[0] != 3 { // named curve + return errors.New("tls: server selected unsupported curve") + } + curveid := CurveID(skx.key[1])<<8 | CurveID(skx.key[2]) + + var ok bool + if ka.curve, ok = curveForCurveID(curveid); !ok { + return errors.New("tls: server selected unsupported curve") + } + + publicLen := int(skx.key[3]) + if publicLen+4 > len(skx.key) { + return errServerKeyExchange + } + ka.x, ka.y = elliptic.Unmarshal(ka.curve, skx.key[4:4+publicLen]) + if ka.x == nil { + return errServerKeyExchange + } + if !ka.curve.IsOnCurve(ka.x, ka.y) { + return errServerKeyExchange + } + serverECDHParams := skx.key[:4+publicLen] + + sig := skx.key[4+publicLen:] + if len(sig) < 2 { + return errServerKeyExchange + } + + sigAndHash := signatureAndHash{signature: ka.sigType} + if ka.version >= VersionTLS12 { + // handle SignatureAndHashAlgorithm + sigAndHash = signatureAndHash{hash: sig[0], signature: sig[1]} + if sigAndHash.signature != ka.sigType { + return errServerKeyExchange + } + sig = sig[2:] + if len(sig) < 2 { + return errServerKeyExchange + } + } + sigLen := int(sig[0])<<8 | int(sig[1]) + if sigLen+2 != len(sig) { + return errServerKeyExchange + } + sig = sig[2:] + + digest, hashFunc, err := hashForServerKeyExchange(sigAndHash, ka.version, clientHello.random, serverHello.random, serverECDHParams) + if err != nil { + return err + } + switch ka.sigType { + case signatureECDSA: + pubKey, ok := cert.PublicKey.(*ecdsa.PublicKey) + if !ok { + return errors.New("ECDHE ECDSA requires a ECDSA server public key") + } + ecdsaSig := new(ecdsaSignature) + if _, err := asn1.Unmarshal(sig, ecdsaSig); err != nil { + return err + } + if ecdsaSig.R.Sign() <= 0 || ecdsaSig.S.Sign() <= 0 { + return errors.New("ECDSA signature contained zero or negative values") + } + if !ecdsa.Verify(pubKey, digest, ecdsaSig.R, ecdsaSig.S) { + return errors.New("ECDSA verification failure") + } + case signatureRSA: + pubKey, ok := cert.PublicKey.(*rsa.PublicKey) + if !ok { + return errors.New("ECDHE RSA requires a RSA server public key") + } + if err := rsa.VerifyPKCS1v15(pubKey, hashFunc, digest, sig); err != nil { + return err + } + default: + return errors.New("unknown ECDHE signature algorithm") + } + + return nil +} + +func (ka *ecdheKeyAgreement) generateClientKeyExchange(config *Config, clientHello *clientHelloMsg, cert *x509.Certificate) ([]byte, *clientKeyExchangeMsg, error) { + if ka.curve == nil { + return nil, nil, errors.New("missing ServerKeyExchange message") + } + priv, mx, my, err := elliptic.GenerateKey(ka.curve, config.rand()) + if err != nil { + return nil, nil, err + } + x, _ := ka.curve.ScalarMult(ka.x, ka.y, priv) + preMasterSecret := make([]byte, (ka.curve.Params().BitSize+7)>>3) + xBytes := x.Bytes() + copy(preMasterSecret[len(preMasterSecret)-len(xBytes):], xBytes) + + serialized := elliptic.Marshal(ka.curve, mx, my) + + ckx := new(clientKeyExchangeMsg) + ckx.ciphertext = make([]byte, 1+len(serialized)) + ckx.ciphertext[0] = byte(len(serialized)) + copy(ckx.ciphertext[1:], serialized) + + return preMasterSecret, ckx, nil +} diff --git a/src/crypto/tls/prf.go b/src/crypto/tls/prf.go new file mode 100644 index 0000000000000000000000000000000000000000..6127c1ccfe79facc2484f70977d926377bff993c --- /dev/null +++ b/src/crypto/tls/prf.go @@ -0,0 +1,367 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package tls + +import ( + "crypto" + "crypto/hmac" + "crypto/md5" + "crypto/sha1" + "crypto/sha256" + "crypto/sha512" + "errors" + "hash" +) + +// Split a premaster secret in two as specified in RFC 4346, section 5. +func splitPreMasterSecret(secret []byte) (s1, s2 []byte) { + s1 = secret[0 : (len(secret)+1)/2] + s2 = secret[len(secret)/2:] + return +} + +// pHash implements the P_hash function, as defined in RFC 4346, section 5. +func pHash(result, secret, seed []byte, hash func() hash.Hash) { + h := hmac.New(hash, secret) + h.Write(seed) + a := h.Sum(nil) + + j := 0 + for j < len(result) { + h.Reset() + h.Write(a) + h.Write(seed) + b := h.Sum(nil) + todo := len(b) + if j+todo > len(result) { + todo = len(result) - j + } + copy(result[j:j+todo], b) + j += todo + + h.Reset() + h.Write(a) + a = h.Sum(nil) + } +} + +// prf10 implements the TLS 1.0 pseudo-random function, as defined in RFC 2246, section 5. +func prf10(result, secret, label, seed []byte) { + hashSHA1 := sha1.New + hashMD5 := md5.New + + labelAndSeed := make([]byte, len(label)+len(seed)) + copy(labelAndSeed, label) + copy(labelAndSeed[len(label):], seed) + + s1, s2 := splitPreMasterSecret(secret) + pHash(result, s1, labelAndSeed, hashMD5) + result2 := make([]byte, len(result)) + pHash(result2, s2, labelAndSeed, hashSHA1) + + for i, b := range result2 { + result[i] ^= b + } +} + +// prf12 implements the TLS 1.2 pseudo-random function, as defined in RFC 5246, section 5. +func prf12(hashFunc func() hash.Hash) func(result, secret, label, seed []byte) { + return func(result, secret, label, seed []byte) { + labelAndSeed := make([]byte, len(label)+len(seed)) + copy(labelAndSeed, label) + copy(labelAndSeed[len(label):], seed) + + pHash(result, secret, labelAndSeed, hashFunc) + } +} + +// prf30 implements the SSL 3.0 pseudo-random function, as defined in +// www.mozilla.org/projects/security/pki/nss/ssl/draft302.txt section 6. +func prf30(result, secret, label, seed []byte) { + hashSHA1 := sha1.New() + hashMD5 := md5.New() + + done := 0 + i := 0 + // RFC5246 section 6.3 says that the largest PRF output needed is 128 + // bytes. Since no more ciphersuites will be added to SSLv3, this will + // remain true. Each iteration gives us 16 bytes so 10 iterations will + // be sufficient. + var b [11]byte + for done < len(result) { + for j := 0; j <= i; j++ { + b[j] = 'A' + byte(i) + } + + hashSHA1.Reset() + hashSHA1.Write(b[:i+1]) + hashSHA1.Write(secret) + hashSHA1.Write(seed) + digest := hashSHA1.Sum(nil) + + hashMD5.Reset() + hashMD5.Write(secret) + hashMD5.Write(digest) + + done += copy(result[done:], hashMD5.Sum(nil)) + i++ + } +} + +const ( + tlsRandomLength = 32 // Length of a random nonce in TLS 1.1. + masterSecretLength = 48 // Length of a master secret in TLS 1.1. + finishedVerifyLength = 12 // Length of verify_data in a Finished message. +) + +var masterSecretLabel = []byte("master secret") +var keyExpansionLabel = []byte("key expansion") +var clientFinishedLabel = []byte("client finished") +var serverFinishedLabel = []byte("server finished") + +func prfAndHashForVersion(version uint16, suite *cipherSuite) (func(result, secret, label, seed []byte), crypto.Hash) { + switch version { + case VersionSSL30: + return prf30, crypto.Hash(0) + case VersionTLS10, VersionTLS11: + return prf10, crypto.Hash(0) + case VersionTLS12: + if suite.flags&suiteSHA384 != 0 { + return prf12(sha512.New384), crypto.SHA384 + } + return prf12(sha256.New), crypto.SHA256 + default: + panic("unknown version") + } +} + +func prfForVersion(version uint16, suite *cipherSuite) func(result, secret, label, seed []byte) { + prf, _ := prfAndHashForVersion(version, suite) + return prf +} + +// masterFromPreMasterSecret generates the master secret from the pre-master +// secret. See http://tools.ietf.org/html/rfc5246#section-8.1 +func masterFromPreMasterSecret(version uint16, suite *cipherSuite, preMasterSecret, clientRandom, serverRandom []byte) []byte { + var seed [tlsRandomLength * 2]byte + copy(seed[0:len(clientRandom)], clientRandom) + copy(seed[len(clientRandom):], serverRandom) + masterSecret := make([]byte, masterSecretLength) + prfForVersion(version, suite)(masterSecret, preMasterSecret, masterSecretLabel, seed[0:]) + return masterSecret +} + +// keysFromMasterSecret generates the connection keys from the master +// secret, given the lengths of the MAC key, cipher key and IV, as defined in +// RFC 2246, section 6.3. +func keysFromMasterSecret(version uint16, suite *cipherSuite, masterSecret, clientRandom, serverRandom []byte, macLen, keyLen, ivLen int) (clientMAC, serverMAC, clientKey, serverKey, clientIV, serverIV []byte) { + var seed [tlsRandomLength * 2]byte + copy(seed[0:len(clientRandom)], serverRandom) + copy(seed[len(serverRandom):], clientRandom) + + n := 2*macLen + 2*keyLen + 2*ivLen + keyMaterial := make([]byte, n) + prfForVersion(version, suite)(keyMaterial, masterSecret, keyExpansionLabel, seed[0:]) + clientMAC = keyMaterial[:macLen] + keyMaterial = keyMaterial[macLen:] + serverMAC = keyMaterial[:macLen] + keyMaterial = keyMaterial[macLen:] + clientKey = keyMaterial[:keyLen] + keyMaterial = keyMaterial[keyLen:] + serverKey = keyMaterial[:keyLen] + keyMaterial = keyMaterial[keyLen:] + clientIV = keyMaterial[:ivLen] + keyMaterial = keyMaterial[ivLen:] + serverIV = keyMaterial[:ivLen] + return +} + +// lookupTLSHash looks up the corresponding crypto.Hash for a given +// TLS hash identifier. +func lookupTLSHash(hash uint8) (crypto.Hash, error) { + switch hash { + case hashSHA1: + return crypto.SHA1, nil + case hashSHA256: + return crypto.SHA256, nil + case hashSHA384: + return crypto.SHA384, nil + default: + return 0, errors.New("tls: unsupported hash algorithm") + } +} + +func newFinishedHash(version uint16, cipherSuite *cipherSuite) finishedHash { + var buffer []byte + if version == VersionSSL30 || version >= VersionTLS12 { + buffer = []byte{} + } + + prf, hash := prfAndHashForVersion(version, cipherSuite) + if hash != 0 { + return finishedHash{hash.New(), hash.New(), nil, nil, buffer, version, prf} + } + + return finishedHash{sha1.New(), sha1.New(), md5.New(), md5.New(), buffer, version, prf} +} + +// A finishedHash calculates the hash of a set of handshake messages suitable +// for including in a Finished message. +type finishedHash struct { + client hash.Hash + server hash.Hash + + // Prior to TLS 1.2, an additional MD5 hash is required. + clientMD5 hash.Hash + serverMD5 hash.Hash + + // In TLS 1.2, a full buffer is sadly required. + buffer []byte + + version uint16 + prf func(result, secret, label, seed []byte) +} + +func (h *finishedHash) Write(msg []byte) (n int, err error) { + h.client.Write(msg) + h.server.Write(msg) + + if h.version < VersionTLS12 { + h.clientMD5.Write(msg) + h.serverMD5.Write(msg) + } + + if h.buffer != nil { + h.buffer = append(h.buffer, msg...) + } + + return len(msg), nil +} + +func (h finishedHash) Sum() []byte { + if h.version >= VersionTLS12 { + return h.client.Sum(nil) + } + + out := make([]byte, 0, md5.Size+sha1.Size) + out = h.clientMD5.Sum(out) + return h.client.Sum(out) +} + +// finishedSum30 calculates the contents of the verify_data member of a SSLv3 +// Finished message given the MD5 and SHA1 hashes of a set of handshake +// messages. +func finishedSum30(md5, sha1 hash.Hash, masterSecret []byte, magic []byte) []byte { + md5.Write(magic) + md5.Write(masterSecret) + md5.Write(ssl30Pad1[:]) + md5Digest := md5.Sum(nil) + + md5.Reset() + md5.Write(masterSecret) + md5.Write(ssl30Pad2[:]) + md5.Write(md5Digest) + md5Digest = md5.Sum(nil) + + sha1.Write(magic) + sha1.Write(masterSecret) + sha1.Write(ssl30Pad1[:40]) + sha1Digest := sha1.Sum(nil) + + sha1.Reset() + sha1.Write(masterSecret) + sha1.Write(ssl30Pad2[:40]) + sha1.Write(sha1Digest) + sha1Digest = sha1.Sum(nil) + + ret := make([]byte, len(md5Digest)+len(sha1Digest)) + copy(ret, md5Digest) + copy(ret[len(md5Digest):], sha1Digest) + return ret +} + +var ssl3ClientFinishedMagic = [4]byte{0x43, 0x4c, 0x4e, 0x54} +var ssl3ServerFinishedMagic = [4]byte{0x53, 0x52, 0x56, 0x52} + +// clientSum returns the contents of the verify_data member of a client's +// Finished message. +func (h finishedHash) clientSum(masterSecret []byte) []byte { + if h.version == VersionSSL30 { + return finishedSum30(h.clientMD5, h.client, masterSecret, ssl3ClientFinishedMagic[:]) + } + + out := make([]byte, finishedVerifyLength) + h.prf(out, masterSecret, clientFinishedLabel, h.Sum()) + return out +} + +// serverSum returns the contents of the verify_data member of a server's +// Finished message. +func (h finishedHash) serverSum(masterSecret []byte) []byte { + if h.version == VersionSSL30 { + return finishedSum30(h.serverMD5, h.server, masterSecret, ssl3ServerFinishedMagic[:]) + } + + out := make([]byte, finishedVerifyLength) + h.prf(out, masterSecret, serverFinishedLabel, h.Sum()) + return out +} + +// selectClientCertSignatureAlgorithm returns a signatureAndHash to sign a +// client's CertificateVerify with, or an error if none can be found. +func (h finishedHash) selectClientCertSignatureAlgorithm(serverList []signatureAndHash, sigType uint8) (signatureAndHash, error) { + if h.version < VersionTLS12 { + // Nothing to negotiate before TLS 1.2. + return signatureAndHash{signature: sigType}, nil + } + + for _, v := range serverList { + if v.signature == sigType && isSupportedSignatureAndHash(v, supportedSignatureAlgorithms) { + return v, nil + } + } + return signatureAndHash{}, errors.New("tls: no supported signature algorithm found for signing client certificate") +} + +// hashForClientCertificate returns a digest, hash function, and TLS 1.2 hash +// id suitable for signing by a TLS client certificate. +func (h finishedHash) hashForClientCertificate(signatureAndHash signatureAndHash, masterSecret []byte) ([]byte, crypto.Hash, error) { + if (h.version == VersionSSL30 || h.version >= VersionTLS12) && h.buffer == nil { + panic("a handshake hash for a client-certificate was requested after discarding the handshake buffer") + } + + if h.version == VersionSSL30 { + if signatureAndHash.signature != signatureRSA { + return nil, 0, errors.New("tls: unsupported signature type for client certificate") + } + + md5Hash := md5.New() + md5Hash.Write(h.buffer) + sha1Hash := sha1.New() + sha1Hash.Write(h.buffer) + return finishedSum30(md5Hash, sha1Hash, masterSecret, nil), crypto.MD5SHA1, nil + } + if h.version >= VersionTLS12 { + hashAlg, err := lookupTLSHash(signatureAndHash.hash) + if err != nil { + return nil, 0, err + } + hash := hashAlg.New() + hash.Write(h.buffer) + return hash.Sum(nil), hashAlg, nil + } + + if signatureAndHash.signature == signatureECDSA { + return h.server.Sum(nil), crypto.SHA1, nil + } + + return h.Sum(), crypto.MD5SHA1, nil +} + +// discardHandshakeBuffer is called when there is no more need to +// buffer the entirety of the handshake messages. +func (h *finishedHash) discardHandshakeBuffer() { + h.buffer = nil +} diff --git a/src/crypto/tls/prf_test.go b/src/crypto/tls/prf_test.go new file mode 100644 index 0000000000000000000000000000000000000000..0a1b1bcbd1b90c77bc2979dd371a187f2b950087 --- /dev/null +++ b/src/crypto/tls/prf_test.go @@ -0,0 +1,140 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package tls + +import ( + "encoding/hex" + "testing" +) + +type testSplitPreMasterSecretTest struct { + in, out1, out2 string +} + +var testSplitPreMasterSecretTests = []testSplitPreMasterSecretTest{ + {"", "", ""}, + {"00", "00", "00"}, + {"0011", "00", "11"}, + {"001122", "0011", "1122"}, + {"00112233", "0011", "2233"}, +} + +func TestSplitPreMasterSecret(t *testing.T) { + for i, test := range testSplitPreMasterSecretTests { + in, _ := hex.DecodeString(test.in) + out1, out2 := splitPreMasterSecret(in) + s1 := hex.EncodeToString(out1) + s2 := hex.EncodeToString(out2) + if s1 != test.out1 || s2 != test.out2 { + t.Errorf("#%d: got: (%s, %s) want: (%s, %s)", i, s1, s2, test.out1, test.out2) + } + } +} + +type testKeysFromTest struct { + version uint16 + suite *cipherSuite + preMasterSecret string + clientRandom, serverRandom string + masterSecret string + clientMAC, serverMAC string + clientKey, serverKey string + macLen, keyLen int +} + +func TestKeysFromPreMasterSecret(t *testing.T) { + for i, test := range testKeysFromTests { + in, _ := hex.DecodeString(test.preMasterSecret) + clientRandom, _ := hex.DecodeString(test.clientRandom) + serverRandom, _ := hex.DecodeString(test.serverRandom) + + masterSecret := masterFromPreMasterSecret(test.version, test.suite, in, clientRandom, serverRandom) + if s := hex.EncodeToString(masterSecret); s != test.masterSecret { + t.Errorf("#%d: bad master secret %s, want %s", i, s, test.masterSecret) + continue + } + + clientMAC, serverMAC, clientKey, serverKey, _, _ := keysFromMasterSecret(test.version, test.suite, masterSecret, clientRandom, serverRandom, test.macLen, test.keyLen, 0) + clientMACString := hex.EncodeToString(clientMAC) + serverMACString := hex.EncodeToString(serverMAC) + clientKeyString := hex.EncodeToString(clientKey) + serverKeyString := hex.EncodeToString(serverKey) + if clientMACString != test.clientMAC || + serverMACString != test.serverMAC || + clientKeyString != test.clientKey || + serverKeyString != test.serverKey { + t.Errorf("#%d: got: (%s, %s, %s, %s) want: (%s, %s, %s, %s)", i, clientMACString, serverMACString, clientKeyString, serverKeyString, test.clientMAC, test.serverMAC, test.clientKey, test.serverKey) + } + } +} + +func cipherSuiteById(id uint16) *cipherSuite { + for _, cipherSuite := range cipherSuites { + if cipherSuite.id == id { + return cipherSuite + } + } + panic("ciphersuite not found") +} + +// These test vectors were generated from GnuTLS using `gnutls-cli --insecure -d 9 ` +var testKeysFromTests = []testKeysFromTest{ + { + VersionTLS10, + cipherSuiteById(TLS_RSA_WITH_RC4_128_SHA), + "0302cac83ad4b1db3b9ab49ad05957de2a504a634a386fc600889321e1a971f57479466830ac3e6f468e87f5385fa0c5", + "4ae66303755184a3917fcb44880605fcc53baa01912b22ed94473fc69cebd558", + "4ae663020ec16e6bb5130be918cfcafd4d765979a3136a5d50c593446e4e44db", + "3d851bab6e5556e959a16bc36d66cfae32f672bfa9ecdef6096cbb1b23472df1da63dbbd9827606413221d149ed08ceb", + "805aaa19b3d2c0a0759a4b6c9959890e08480119", + "2d22f9fe519c075c16448305ceee209fc24ad109", + "d50b5771244f850cd8117a9ccafe2cf1", + "e076e33206b30507a85c32855acd0919", + 20, + 16, + }, + { + VersionTLS10, + cipherSuiteById(TLS_RSA_WITH_RC4_128_SHA), + "03023f7527316bc12cbcd69e4b9e8275d62c028f27e65c745cfcddc7ce01bd3570a111378b63848127f1c36e5f9e4890", + "4ae66364b5ea56b20ce4e25555aed2d7e67f42788dd03f3fee4adae0459ab106", + "4ae66363ab815cbf6a248b87d6b556184e945e9b97fbdf247858b0bdafacfa1c", + "7d64be7c80c59b740200b4b9c26d0baaa1c5ae56705acbcf2307fe62beb4728c19392c83f20483801cce022c77645460", + "97742ed60a0554ca13f04f97ee193177b971e3b0", + "37068751700400e03a8477a5c7eec0813ab9e0dc", + "207cddbc600d2a200abac6502053ee5c", + "df3f94f6e1eacc753b815fe16055cd43", + 20, + 16, + }, + { + VersionTLS10, + cipherSuiteById(TLS_RSA_WITH_RC4_128_SHA), + "832d515f1d61eebb2be56ba0ef79879efb9b527504abb386fb4310ed5d0e3b1f220d3bb6b455033a2773e6d8bdf951d278a187482b400d45deb88a5d5a6bb7d6a7a1decc04eb9ef0642876cd4a82d374d3b6ff35f0351dc5d411104de431375355addc39bfb1f6329fb163b0bc298d658338930d07d313cd980a7e3d9196cac1", + "4ae663b2ee389c0de147c509d8f18f5052afc4aaf9699efe8cb05ece883d3a5e", + "4ae664d503fd4cff50cfc1fb8fc606580f87b0fcdac9554ba0e01d785bdf278e", + "1aff2e7a2c4279d0126f57a65a77a8d9d0087cf2733366699bec27eb53d5740705a8574bb1acc2abbe90e44f0dd28d6c", + "3c7647c93c1379a31a609542aa44e7f117a70085", + "0d73102994be74a575a3ead8532590ca32a526d4", + "ac7581b0b6c10d85bbd905ffbf36c65e", + "ff07edde49682b45466bd2e39464b306", + 20, + 16, + }, + { + VersionSSL30, + cipherSuiteById(TLS_RSA_WITH_RC4_128_SHA), + "832d515f1d61eebb2be56ba0ef79879efb9b527504abb386fb4310ed5d0e3b1f220d3bb6b455033a2773e6d8bdf951d278a187482b400d45deb88a5d5a6bb7d6a7a1decc04eb9ef0642876cd4a82d374d3b6ff35f0351dc5d411104de431375355addc39bfb1f6329fb163b0bc298d658338930d07d313cd980a7e3d9196cac1", + "4ae663b2ee389c0de147c509d8f18f5052afc4aaf9699efe8cb05ece883d3a5e", + "4ae664d503fd4cff50cfc1fb8fc606580f87b0fcdac9554ba0e01d785bdf278e", + "a614863e56299dcffeea2938f22c2ba023768dbe4b3f6877bc9c346c6ae529b51d9cb87ff9695ea4d01f2205584405b2", + "2c450d5b6f6e2013ac6bea6a0b32200d4e1ffb94", + "7a7a7438769536f2fb1ae49a61f0703b79b2dc53", + "f8f6b26c10f12855c9aafb1e0e839ccf", + "2b9d4b4a60cb7f396780ebff50650419", + 20, + 16, + }, +} diff --git a/src/crypto/tls/testdata/Client-TLSv10-ClientCert-ECDSA-ECDSA b/src/crypto/tls/testdata/Client-TLSv10-ClientCert-ECDSA-ECDSA new file mode 100644 index 0000000000000000000000000000000000000000..4bad7865df3f7bc411a17a54c9c02452e814c9ef --- /dev/null +++ b/src/crypto/tls/testdata/Client-TLSv10-ClientCert-ECDSA-ECDSA @@ -0,0 +1,130 @@ +>>> Flow 1 (client to server) +00000000 16 03 01 00 81 01 00 00 7d 03 03 00 00 00 00 00 |........}.......| +00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| +00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 1e c0 2f |.............../| +00000030 c0 2b c0 30 c0 2c c0 11 c0 07 c0 13 c0 09 c0 14 |.+.0.,..........| +00000040 c0 0a 00 05 00 2f 00 35 c0 12 00 0a 01 00 00 36 |...../.5.......6| +00000050 00 05 00 05 01 00 00 00 00 00 0a 00 08 00 06 00 |................| +00000060 17 00 18 00 19 00 0b 00 02 01 00 00 0d 00 0e 00 |................| +00000070 0c 04 01 04 03 05 01 05 03 02 01 02 03 ff 01 00 |................| +00000080 01 00 00 12 00 00 |......| +>>> Flow 2 (server to client) +00000000 16 03 01 00 59 02 00 00 55 03 01 c0 e1 5c 5b 45 |....Y...U....\[E| +00000010 70 fc a1 73 44 e7 69 b6 83 a1 71 bc 03 21 2e cc |p..sD.i...q..!..| +00000020 21 7a 28 20 82 6b 2f 77 7d 40 c7 20 0d e4 19 db |!z( .k/w}@. ....| +00000030 35 cd 75 a4 e7 e5 6c 3e c9 d5 fe 9d c5 88 78 7b |5.u...l>......x{| +00000040 c4 fc 04 9a c1 10 7a 15 d9 e9 4a 95 c0 09 00 00 |......z...J.....| +00000050 0d ff 01 00 01 00 00 0b 00 04 03 00 01 02 16 03 |................| +00000060 01 02 0e 0b 00 02 0a 00 02 07 00 02 04 30 82 02 |.............0..| +00000070 00 30 82 01 62 02 09 00 b8 bf 2d 47 a0 d2 eb f4 |.0..b.....-G....| +00000080 30 09 06 07 2a 86 48 ce 3d 04 01 30 45 31 0b 30 |0...*.H.=..0E1.0| +00000090 09 06 03 55 04 06 13 02 41 55 31 13 30 11 06 03 |...U....AU1.0...| +000000a0 55 04 08 13 0a 53 6f 6d 65 2d 53 74 61 74 65 31 |U....Some-State1| +000000b0 21 30 1f 06 03 55 04 0a 13 18 49 6e 74 65 72 6e |!0...U....Intern| +000000c0 65 74 20 57 69 64 67 69 74 73 20 50 74 79 20 4c |et Widgits Pty L| +000000d0 74 64 30 1e 17 0d 31 32 31 31 32 32 31 35 30 36 |td0...1211221506| +000000e0 33 32 5a 17 0d 32 32 31 31 32 30 31 35 30 36 33 |32Z..22112015063| +000000f0 32 5a 30 45 31 0b 30 09 06 03 55 04 06 13 02 41 |2Z0E1.0...U....A| +00000100 55 31 13 30 11 06 03 55 04 08 13 0a 53 6f 6d 65 |U1.0...U....Some| +00000110 2d 53 74 61 74 65 31 21 30 1f 06 03 55 04 0a 13 |-State1!0...U...| +00000120 18 49 6e 74 65 72 6e 65 74 20 57 69 64 67 69 74 |.Internet Widgit| +00000130 73 20 50 74 79 20 4c 74 64 30 81 9b 30 10 06 07 |s Pty Ltd0..0...| +00000140 2a 86 48 ce 3d 02 01 06 05 2b 81 04 00 23 03 81 |*.H.=....+...#..| +00000150 86 00 04 00 c4 a1 ed be 98 f9 0b 48 73 36 7e c3 |...........Hs6~.| +00000160 16 56 11 22 f2 3d 53 c3 3b 4d 21 3d cd 6b 75 e6 |.V.".=S.;M!=.ku.| +00000170 f6 b0 dc 9a df 26 c1 bc b2 87 f0 72 32 7c b3 64 |.....&.....r2|.d| +00000180 2f 1c 90 bc ea 68 23 10 7e fe e3 25 c0 48 3a 69 |/....h#.~..%.H:i| +00000190 e0 28 6d d3 37 00 ef 04 62 dd 0d a0 9c 70 62 83 |.(m.7...b....pb.| +000001a0 d8 81 d3 64 31 aa 9e 97 31 bd 96 b0 68 c0 9b 23 |...d1...1...h..#| +000001b0 de 76 64 3f 1a 5c 7f e9 12 0e 58 58 b6 5f 70 dd |.vd?.\....XX._p.| +000001c0 9b d8 ea d5 d7 f5 d5 cc b9 b6 9f 30 66 5b 66 9a |...........0f[f.| +000001d0 20 e2 27 e5 bf fe 3b 30 09 06 07 2a 86 48 ce 3d | .'...;0...*.H.=| +000001e0 04 01 03 81 8c 00 30 81 88 02 42 01 88 a2 4f eb |......0...B...O.| +000001f0 e2 45 c5 48 7d 1b ac f5 ed 98 9d ae 47 70 c0 5e |.E.H}.......Gp.^| +00000200 1b b6 2f bd f1 b6 4d b7 61 40 d3 11 a2 ce ee 0b |../...M.a@......| +00000210 7e 92 7e ff 76 9d c3 3b 7e a5 3f ce fa 10 e2 59 |~.~.v..;~.?....Y| +00000220 ec 47 2d 7c ac da 4e 97 0e 15 a0 6f d0 02 42 01 |.G-|..N....o..B.| +00000230 4d fc be 67 13 9c 2d 05 0e bd 3f a3 8c 25 c1 33 |M..g..-...?..%.3| +00000240 13 83 0d 94 06 bb d4 37 7a f6 ec 7a c9 86 2e dd |.......7z..z....| +00000250 d7 11 69 7f 85 7c 56 de fb 31 78 2b e4 c7 78 0d |..i..|V..1x+..x.| +00000260 ae cb be 9e 4e 36 24 31 7b 6a 0f 39 95 12 07 8f |....N6$1{j.9....| +00000270 2a 16 03 01 00 d6 0c 00 00 d2 03 00 17 41 04 01 |*............A..| +00000280 74 83 af 3a 65 7a ad 1a 63 1f 13 82 9d f4 de 06 |t..:ez..c.......| +00000290 4e 3a 03 81 61 72 ff f8 58 da 7b f5 81 6d 81 57 |N:..ar..X.{..m.W| +000002a0 d9 d1 b1 6d e3 97 db 86 72 17 15 18 16 d4 ec 04 |...m....r.......| +000002b0 32 7c 38 90 6b a4 3c e9 35 79 2d 4c 39 5e 2d 00 |2|8.k.<.5y-L9^-.| +000002c0 8b 30 81 88 02 42 01 44 78 e1 2a bb 95 f7 45 58 |.0...B.Dx.*...EX| +000002d0 d4 0d b6 e4 4e ff 48 b3 11 14 ee d5 6c bb 5f 0c |....N.H.....l._.| +000002e0 90 b6 ef bc 05 77 f6 05 42 b4 d8 a6 70 e6 8c 90 |.....w..B...p...| +000002f0 f0 4b 3b c9 d3 4e 0c 85 65 b4 e0 fe b5 10 09 9b |.K;..N..e.......| +00000300 e1 08 84 ea 93 96 8e a4 02 42 01 c7 15 ee 9d 98 |.........B......| +00000310 b7 25 eb 07 ff f6 94 7e e7 9d a5 17 9e 37 93 40 |.%.....~.....7.@| +00000320 4c 9f eb 6b a3 7a 57 d8 81 c6 d9 09 34 aa 96 8c |L..k.zW.....4...| +00000330 4d 28 2e 9f f7 0b 1c 09 e1 d1 d8 48 6e 8a 8e 9c |M(.........Hn...| +00000340 01 4c e7 2d 53 8f 8e 71 61 82 ff ff 16 03 01 00 |.L.-S..qa.......| +00000350 0e 0d 00 00 06 03 01 02 40 00 00 0e 00 00 00 |........@......| +>>> Flow 3 (client to server) +00000000 16 03 01 02 0a 0b 00 02 06 00 02 03 00 02 00 30 |...............0| +00000010 82 01 fc 30 82 01 5e 02 09 00 9a 30 84 6c 26 35 |...0..^....0.l&5| +00000020 d9 17 30 09 06 07 2a 86 48 ce 3d 04 01 30 45 31 |..0...*.H.=..0E1| +00000030 0b 30 09 06 03 55 04 06 13 02 41 55 31 13 30 11 |.0...U....AU1.0.| +00000040 06 03 55 04 08 13 0a 53 6f 6d 65 2d 53 74 61 74 |..U....Some-Stat| +00000050 65 31 21 30 1f 06 03 55 04 0a 13 18 49 6e 74 65 |e1!0...U....Inte| +00000060 72 6e 65 74 20 57 69 64 67 69 74 73 20 50 74 79 |rnet Widgits Pty| +00000070 20 4c 74 64 30 1e 17 0d 31 32 31 31 31 34 31 33 | Ltd0...12111413| +00000080 32 35 35 33 5a 17 0d 32 32 31 31 31 32 31 33 32 |2553Z..221112132| +00000090 35 35 33 5a 30 41 31 0b 30 09 06 03 55 04 06 13 |553Z0A1.0...U...| +000000a0 02 41 55 31 0c 30 0a 06 03 55 04 08 13 03 4e 53 |.AU1.0...U....NS| +000000b0 57 31 10 30 0e 06 03 55 04 07 13 07 50 79 72 6d |W1.0...U....Pyrm| +000000c0 6f 6e 74 31 12 30 10 06 03 55 04 03 13 09 4a 6f |ont1.0...U....Jo| +000000d0 65 6c 20 53 69 6e 67 30 81 9b 30 10 06 07 2a 86 |el Sing0..0...*.| +000000e0 48 ce 3d 02 01 06 05 2b 81 04 00 23 03 81 86 00 |H.=....+...#....| +000000f0 04 00 95 8c 91 75 14 c0 5e c4 57 b4 d4 c3 6f 8d |.....u..^.W...o.| +00000100 ae 68 1e dd 6f ce 86 e1 7e 6e b2 48 3e 81 e5 4e |.h..o...~n.H>..N| +00000110 e2 c6 88 4b 64 dc f5 30 bb d3 ff 65 cc 5b f4 dd |...Kd..0...e.[..| +00000120 b5 6a 3e 3e d0 1d de 47 c3 76 ad 19 f6 45 2c 8c |.j>>...G.v...E,.| +00000130 bc d8 1d 01 4c 1f 70 90 46 76 48 8b 8f 83 cc 4a |....L.p.FvH....J| +00000140 5c 8f 40 76 da e0 89 ec 1d 2b c4 4e 30 76 28 41 |\.@v.....+.N0v(A| +00000150 b2 62 a8 fb 5b f1 f9 4e 7a 8d bd 09 b8 ae ea 8b |.b..[..Nz.......| +00000160 18 27 4f 2e 70 fe 13 96 ba c3 d3 40 16 cd 65 4e |.'O.p......@..eN| +00000170 ac 11 1e e6 f1 30 09 06 07 2a 86 48 ce 3d 04 01 |.....0...*.H.=..| +00000180 03 81 8c 00 30 81 88 02 42 00 e0 14 c4 60 60 0b |....0...B....``.| +00000190 72 68 b0 32 5d 61 4a 02 74 5c c2 81 b9 16 a8 3f |rh.2]aJ.t\.....?| +000001a0 29 c8 36 c7 81 ff 6c b6 5b d9 70 f1 38 3b 50 48 |).6...l.[.p.8;PH| +000001b0 28 94 cb 09 1a 52 f1 5d ee 8d f2 b9 f0 f0 da d9 |(....R.]........| +000001c0 15 3a f9 bd 03 7a 87 a2 23 35 ec 02 42 01 a3 d4 |.:...z..#5..B...| +000001d0 8a 78 35 1c 4a 9a 23 d2 0a be 2b 10 31 9d 9c 5f |.x5.J.#...+.1.._| +000001e0 be e8 91 b3 da 1a f5 5d a3 23 f5 26 8b 45 70 8d |.......].#.&.Ep.| +000001f0 65 62 9b 7e 01 99 3d 18 f6 10 9a 38 61 9b 2e 57 |eb.~..=....8a..W| +00000200 e4 fa cc b1 8a ce e2 23 a0 87 f0 e1 67 51 eb 16 |.......#....gQ..| +00000210 03 01 00 46 10 00 00 42 41 04 1e 18 37 ef 0d 19 |...F...BA...7...| +00000220 51 88 35 75 71 b5 e5 54 5b 12 2e 8f 09 67 fd a7 |Q.5uq..T[....g..| +00000230 24 20 3e b2 56 1c ce 97 28 5e f8 2b 2d 4f 9e f1 |$ >.V...(^.+-O..| +00000240 07 9f 6c 4b 5b 83 56 e2 32 42 e9 58 b6 d7 49 a6 |..lK[.V.2B.X..I.| +00000250 b5 68 1a 41 03 56 6b dc 5a 89 16 03 01 00 91 0f |.h.A.Vk.Z.......| +00000260 00 00 8d 00 8b 30 81 88 02 42 01 91 2d e9 99 a4 |.....0...B..-...| +00000270 88 5c 03 9c ea 8b 64 07 f2 c9 e7 ad 5b a3 fb 27 |.\....d.....[..'| +00000280 fd 19 9b 78 bd 7b 9d 0a cc 8a 61 c5 83 33 02 29 |...x.{....a..3.)| +00000290 c3 66 24 9d 5f bc 03 d9 2a 49 aa 59 51 83 49 72 |.f$._...*I.YQ.Ir| +000002a0 13 be ea 82 5a 5c 09 2f da 23 bc 18 02 42 01 0d |....Z\./.#...B..| +000002b0 a1 15 4d fe 18 ec 90 d5 4e 9a 75 60 05 67 10 5e |..M.....N.u`.g.^| +000002c0 3c 34 00 e8 18 33 8f 90 26 2e d3 a9 81 6c 43 17 |<4...3..&....lC.| +000002d0 80 9e c5 bd 23 c9 24 96 a1 29 23 a4 13 3f ad d2 |....#.$..)#..?..| +000002e0 45 19 0b 56 56 4b c1 f1 cc 70 c8 af 44 ff 34 96 |E..VVK...p..D.4.| +000002f0 14 03 01 00 01 01 16 03 01 00 30 c4 0c 67 53 06 |..........0..gS.| +00000300 49 b3 c9 5c 2e 72 f6 54 ba ad ac a8 80 55 17 01 |I..\.r.T.....U..| +00000310 5c 44 71 7d ad 15 34 95 9a 7f 7b 95 0e 08 70 ce |\Dq}..4...{...p.| +00000320 5a 33 f4 3b 4e 80 06 43 70 93 17 |Z3.;N..Cp..| +>>> Flow 4 (server to client) +00000000 14 03 01 00 01 01 16 03 01 00 30 3b ba 6c 73 ec |..........0;.ls.| +00000010 11 5b 44 46 1d bb 31 1b 1b e8 d8 51 4f 95 b0 40 |.[DF..1....QO..@| +00000020 87 49 33 73 40 98 61 1c 94 02 48 9b 80 d3 6c af |.I3s@.a...H...l.| +00000030 e2 31 63 11 a7 c8 db ed 7a a4 4d |.1c.....z.M| +>>> Flow 5 (client to server) +00000000 17 03 01 00 20 2e f7 66 f0 ce 50 d7 38 7a d4 fd |.... ..f..P.8z..| +00000010 e3 66 b1 76 76 59 ad bc b0 0a 75 1d f0 92 6e e3 |.f.vvY....u...n.| +00000020 21 1d 13 dc ad 17 03 01 00 20 f1 b2 0f 3b 26 91 |!........ ...;&.| +00000030 ed ff 9f fc 41 04 7e 47 17 02 af 0c 2b e8 b7 31 |....A.~G....+..1| +00000040 ae 29 71 f9 a8 89 84 f3 e8 da 15 03 01 00 20 1f |.)q........... .| +00000050 26 64 cf 34 c1 48 6b 79 61 e2 77 57 9d 27 14 45 |&d.4.Hkya.wW.'.E| +00000060 46 24 ad 2d 35 57 db 2b 32 03 e2 68 b0 1a 5a |F$.-5W.+2..h..Z| diff --git a/src/crypto/tls/testdata/Client-TLSv10-ClientCert-ECDSA-RSA b/src/crypto/tls/testdata/Client-TLSv10-ClientCert-ECDSA-RSA new file mode 100644 index 0000000000000000000000000000000000000000..0e420a64804d14bf9c24683919ae981eeb4b1eb2 --- /dev/null +++ b/src/crypto/tls/testdata/Client-TLSv10-ClientCert-ECDSA-RSA @@ -0,0 +1,126 @@ +>>> Flow 1 (client to server) +00000000 16 03 01 00 81 01 00 00 7d 03 03 00 00 00 00 00 |........}.......| +00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| +00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 1e c0 2f |.............../| +00000030 c0 2b c0 30 c0 2c c0 11 c0 07 c0 13 c0 09 c0 14 |.+.0.,..........| +00000040 c0 0a 00 05 00 2f 00 35 c0 12 00 0a 01 00 00 36 |...../.5.......6| +00000050 00 05 00 05 01 00 00 00 00 00 0a 00 08 00 06 00 |................| +00000060 17 00 18 00 19 00 0b 00 02 01 00 00 0d 00 0e 00 |................| +00000070 0c 04 01 04 03 05 01 05 03 02 01 02 03 ff 01 00 |................| +00000080 01 00 00 12 00 00 |......| +>>> Flow 2 (server to client) +00000000 16 03 01 00 51 02 00 00 4d 03 01 b7 de 52 5a 07 |....Q...M....RZ.| +00000010 43 b8 72 1d d9 6f 5c a5 70 da ee 27 b7 a9 50 9d |C.r..o\.p..'..P.| +00000020 e7 75 ad 61 a5 2f 69 47 2a d8 2e 20 a8 b0 64 6b |.u.a./iG*.. ..dk| +00000030 4d 25 ec 50 2b 8e a7 9b 0c f9 f5 3c 62 96 a3 53 |M%.P+......>> Flow 3 (client to server) +00000000 16 03 01 02 0a 0b 00 02 06 00 02 03 00 02 00 30 |...............0| +00000010 82 01 fc 30 82 01 5e 02 09 00 9a 30 84 6c 26 35 |...0..^....0.l&5| +00000020 d9 17 30 09 06 07 2a 86 48 ce 3d 04 01 30 45 31 |..0...*.H.=..0E1| +00000030 0b 30 09 06 03 55 04 06 13 02 41 55 31 13 30 11 |.0...U....AU1.0.| +00000040 06 03 55 04 08 13 0a 53 6f 6d 65 2d 53 74 61 74 |..U....Some-Stat| +00000050 65 31 21 30 1f 06 03 55 04 0a 13 18 49 6e 74 65 |e1!0...U....Inte| +00000060 72 6e 65 74 20 57 69 64 67 69 74 73 20 50 74 79 |rnet Widgits Pty| +00000070 20 4c 74 64 30 1e 17 0d 31 32 31 31 31 34 31 33 | Ltd0...12111413| +00000080 32 35 35 33 5a 17 0d 32 32 31 31 31 32 31 33 32 |2553Z..221112132| +00000090 35 35 33 5a 30 41 31 0b 30 09 06 03 55 04 06 13 |553Z0A1.0...U...| +000000a0 02 41 55 31 0c 30 0a 06 03 55 04 08 13 03 4e 53 |.AU1.0...U....NS| +000000b0 57 31 10 30 0e 06 03 55 04 07 13 07 50 79 72 6d |W1.0...U....Pyrm| +000000c0 6f 6e 74 31 12 30 10 06 03 55 04 03 13 09 4a 6f |ont1.0...U....Jo| +000000d0 65 6c 20 53 69 6e 67 30 81 9b 30 10 06 07 2a 86 |el Sing0..0...*.| +000000e0 48 ce 3d 02 01 06 05 2b 81 04 00 23 03 81 86 00 |H.=....+...#....| +000000f0 04 00 95 8c 91 75 14 c0 5e c4 57 b4 d4 c3 6f 8d |.....u..^.W...o.| +00000100 ae 68 1e dd 6f ce 86 e1 7e 6e b2 48 3e 81 e5 4e |.h..o...~n.H>..N| +00000110 e2 c6 88 4b 64 dc f5 30 bb d3 ff 65 cc 5b f4 dd |...Kd..0...e.[..| +00000120 b5 6a 3e 3e d0 1d de 47 c3 76 ad 19 f6 45 2c 8c |.j>>...G.v...E,.| +00000130 bc d8 1d 01 4c 1f 70 90 46 76 48 8b 8f 83 cc 4a |....L.p.FvH....J| +00000140 5c 8f 40 76 da e0 89 ec 1d 2b c4 4e 30 76 28 41 |\.@v.....+.N0v(A| +00000150 b2 62 a8 fb 5b f1 f9 4e 7a 8d bd 09 b8 ae ea 8b |.b..[..Nz.......| +00000160 18 27 4f 2e 70 fe 13 96 ba c3 d3 40 16 cd 65 4e |.'O.p......@..eN| +00000170 ac 11 1e e6 f1 30 09 06 07 2a 86 48 ce 3d 04 01 |.....0...*.H.=..| +00000180 03 81 8c 00 30 81 88 02 42 00 e0 14 c4 60 60 0b |....0...B....``.| +00000190 72 68 b0 32 5d 61 4a 02 74 5c c2 81 b9 16 a8 3f |rh.2]aJ.t\.....?| +000001a0 29 c8 36 c7 81 ff 6c b6 5b d9 70 f1 38 3b 50 48 |).6...l.[.p.8;PH| +000001b0 28 94 cb 09 1a 52 f1 5d ee 8d f2 b9 f0 f0 da d9 |(....R.]........| +000001c0 15 3a f9 bd 03 7a 87 a2 23 35 ec 02 42 01 a3 d4 |.:...z..#5..B...| +000001d0 8a 78 35 1c 4a 9a 23 d2 0a be 2b 10 31 9d 9c 5f |.x5.J.#...+.1.._| +000001e0 be e8 91 b3 da 1a f5 5d a3 23 f5 26 8b 45 70 8d |.......].#.&.Ep.| +000001f0 65 62 9b 7e 01 99 3d 18 f6 10 9a 38 61 9b 2e 57 |eb.~..=....8a..W| +00000200 e4 fa cc b1 8a ce e2 23 a0 87 f0 e1 67 51 eb 16 |.......#....gQ..| +00000210 03 01 00 86 10 00 00 82 00 80 6d 51 f3 7f f9 3e |..........mQ...>| +00000220 fb 75 82 41 36 83 e8 6a ee 2a 2e 25 90 67 4c 8e |.u.A6..j.*.%.gL.| +00000230 62 2f 30 81 17 e0 85 09 0c 2b b7 23 d7 b0 e2 1d |b/0......+.#....| +00000240 f7 3b d7 f5 a1 27 b6 ee 24 b6 1b cc 5b ea 66 0d |.;...'..$...[.f.| +00000250 6a f4 e5 85 f9 da 43 b4 0e 86 85 e1 f5 aa be c8 |j.....C.........| +00000260 ce 39 4c 9c 86 00 08 c2 4b e2 c6 ec 2f f7 ce e6 |.9L.....K.../...| +00000270 bd 77 82 6f 23 b6 e0 bd a2 92 b7 3a ac e8 56 f1 |.w.o#......:..V.| +00000280 af 54 5e 46 87 e9 3b 33 e7 b8 28 b7 d6 c8 90 35 |.T^F..;3..(....5| +00000290 d4 1c 43 d1 30 6f 55 4e 0a 70 16 03 01 00 91 0f |..C.0oUN.p......| +000002a0 00 00 8d 00 8b 30 81 88 02 42 00 b5 1a 9d 48 90 |.....0...B....H.| +000002b0 2f d9 1a 04 66 f7 3b 4d d7 ae d9 1e dd 3c fa 24 |/...f.;M.....<.$| +000002c0 0f 24 97 b2 61 46 16 d9 a0 35 f9 f7 54 45 92 fd |.$..aF...5..TE..| +000002d0 10 56 ab 26 d7 b5 10 80 8b 88 95 ef c6 73 1c d2 |.V.&.........s..| +000002e0 ff e9 20 cd 18 a8 40 c4 4d 83 c2 e2 02 42 01 8c |.. ...@.M....B..| +000002f0 d2 13 4c cc e5 38 37 17 6c 83 d6 ad c1 dc af ec |..L..87.l.......| +00000300 8d 06 75 b8 08 ad 56 4a 8f b9 03 59 80 f8 81 d4 |..u...VJ...Y....| +00000310 f3 91 89 eb 9c 27 5d e1 dc 6d ef d6 20 da e7 9c |.....']..m.. ...| +00000320 71 75 cb 2a f9 e4 05 46 c8 85 ca 7b 9c 97 e8 6d |qu.*...F...{...m| +00000330 14 03 01 00 01 01 16 03 01 00 24 9f 67 4e 22 04 |..........$.gN".| +00000340 10 f4 28 55 3e 50 88 90 61 07 42 29 f5 9b f5 32 |..(U>P..a.B)...2| +00000350 16 3d ea c1 8f aa a1 4c b5 72 26 d8 32 cd 50 |.=.....L.r&.2.P| +>>> Flow 4 (server to client) +00000000 14 03 01 00 01 01 16 03 01 00 24 df 8d f1 07 6d |..........$....m| +00000010 63 39 fc ba b1 67 3b 68 85 b9 37 7d d3 67 19 76 |c9...g;h..7}.g.v| +00000020 34 a4 1b 86 31 bd fe 06 72 00 d8 2b f2 65 3d |4...1...r..+.e=| +>>> Flow 5 (client to server) +00000000 17 03 01 00 1a 60 cc 81 4f 8b 73 b3 7f 34 bf f1 |.....`..O.s..4..| +00000010 7c d8 32 0a ef 2a 26 f9 b8 69 84 83 48 21 ee 15 ||.2..*&..i..H!..| +00000020 03 01 00 16 23 7a 0c 65 3a 66 1a 75 03 e4 85 3f |....#z.e:f.u...?| +00000030 83 cd 55 70 99 f4 44 dc 67 ba |..Up..D.g.| diff --git a/src/crypto/tls/testdata/Client-TLSv10-ClientCert-RSA-ECDSA b/src/crypto/tls/testdata/Client-TLSv10-ClientCert-RSA-ECDSA new file mode 100644 index 0000000000000000000000000000000000000000..7e33edc18975e95cc699dc6d98156181d6c255a4 --- /dev/null +++ b/src/crypto/tls/testdata/Client-TLSv10-ClientCert-RSA-ECDSA @@ -0,0 +1,129 @@ +>>> Flow 1 (client to server) +00000000 16 03 01 00 81 01 00 00 7d 03 03 00 00 00 00 00 |........}.......| +00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| +00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 1e c0 2f |.............../| +00000030 c0 2b c0 30 c0 2c c0 11 c0 07 c0 13 c0 09 c0 14 |.+.0.,..........| +00000040 c0 0a 00 05 00 2f 00 35 c0 12 00 0a 01 00 00 36 |...../.5.......6| +00000050 00 05 00 05 01 00 00 00 00 00 0a 00 08 00 06 00 |................| +00000060 17 00 18 00 19 00 0b 00 02 01 00 00 0d 00 0e 00 |................| +00000070 0c 04 01 04 03 05 01 05 03 02 01 02 03 ff 01 00 |................| +00000080 01 00 00 12 00 00 |......| +>>> Flow 2 (server to client) +00000000 16 03 01 00 59 02 00 00 55 03 01 dc a9 22 c2 a2 |....Y...U...."..| +00000010 05 ba c4 66 9a 71 aa 0f 92 6a fc df b0 29 4d 36 |...f.q...j...)M6| +00000020 39 2e f8 39 ed 8e f6 7f 8f 17 13 20 f8 9c f3 3d |9..9....... ...=| +00000030 0a 41 8f 30 c7 5d cd 17 c5 ad 1c 52 45 a3 47 8c |.A.0.].....RE.G.| +00000040 07 4c 48 e1 00 2b 32 38 01 c8 79 b7 c0 09 00 00 |.LH..+28..y.....| +00000050 0d ff 01 00 01 00 00 0b 00 04 03 00 01 02 16 03 |................| +00000060 01 02 0e 0b 00 02 0a 00 02 07 00 02 04 30 82 02 |.............0..| +00000070 00 30 82 01 62 02 09 00 b8 bf 2d 47 a0 d2 eb f4 |.0..b.....-G....| +00000080 30 09 06 07 2a 86 48 ce 3d 04 01 30 45 31 0b 30 |0...*.H.=..0E1.0| +00000090 09 06 03 55 04 06 13 02 41 55 31 13 30 11 06 03 |...U....AU1.0...| +000000a0 55 04 08 13 0a 53 6f 6d 65 2d 53 74 61 74 65 31 |U....Some-State1| +000000b0 21 30 1f 06 03 55 04 0a 13 18 49 6e 74 65 72 6e |!0...U....Intern| +000000c0 65 74 20 57 69 64 67 69 74 73 20 50 74 79 20 4c |et Widgits Pty L| +000000d0 74 64 30 1e 17 0d 31 32 31 31 32 32 31 35 30 36 |td0...1211221506| +000000e0 33 32 5a 17 0d 32 32 31 31 32 30 31 35 30 36 33 |32Z..22112015063| +000000f0 32 5a 30 45 31 0b 30 09 06 03 55 04 06 13 02 41 |2Z0E1.0...U....A| +00000100 55 31 13 30 11 06 03 55 04 08 13 0a 53 6f 6d 65 |U1.0...U....Some| +00000110 2d 53 74 61 74 65 31 21 30 1f 06 03 55 04 0a 13 |-State1!0...U...| +00000120 18 49 6e 74 65 72 6e 65 74 20 57 69 64 67 69 74 |.Internet Widgit| +00000130 73 20 50 74 79 20 4c 74 64 30 81 9b 30 10 06 07 |s Pty Ltd0..0...| +00000140 2a 86 48 ce 3d 02 01 06 05 2b 81 04 00 23 03 81 |*.H.=....+...#..| +00000150 86 00 04 00 c4 a1 ed be 98 f9 0b 48 73 36 7e c3 |...........Hs6~.| +00000160 16 56 11 22 f2 3d 53 c3 3b 4d 21 3d cd 6b 75 e6 |.V.".=S.;M!=.ku.| +00000170 f6 b0 dc 9a df 26 c1 bc b2 87 f0 72 32 7c b3 64 |.....&.....r2|.d| +00000180 2f 1c 90 bc ea 68 23 10 7e fe e3 25 c0 48 3a 69 |/....h#.~..%.H:i| +00000190 e0 28 6d d3 37 00 ef 04 62 dd 0d a0 9c 70 62 83 |.(m.7...b....pb.| +000001a0 d8 81 d3 64 31 aa 9e 97 31 bd 96 b0 68 c0 9b 23 |...d1...1...h..#| +000001b0 de 76 64 3f 1a 5c 7f e9 12 0e 58 58 b6 5f 70 dd |.vd?.\....XX._p.| +000001c0 9b d8 ea d5 d7 f5 d5 cc b9 b6 9f 30 66 5b 66 9a |...........0f[f.| +000001d0 20 e2 27 e5 bf fe 3b 30 09 06 07 2a 86 48 ce 3d | .'...;0...*.H.=| +000001e0 04 01 03 81 8c 00 30 81 88 02 42 01 88 a2 4f eb |......0...B...O.| +000001f0 e2 45 c5 48 7d 1b ac f5 ed 98 9d ae 47 70 c0 5e |.E.H}.......Gp.^| +00000200 1b b6 2f bd f1 b6 4d b7 61 40 d3 11 a2 ce ee 0b |../...M.a@......| +00000210 7e 92 7e ff 76 9d c3 3b 7e a5 3f ce fa 10 e2 59 |~.~.v..;~.?....Y| +00000220 ec 47 2d 7c ac da 4e 97 0e 15 a0 6f d0 02 42 01 |.G-|..N....o..B.| +00000230 4d fc be 67 13 9c 2d 05 0e bd 3f a3 8c 25 c1 33 |M..g..-...?..%.3| +00000240 13 83 0d 94 06 bb d4 37 7a f6 ec 7a c9 86 2e dd |.......7z..z....| +00000250 d7 11 69 7f 85 7c 56 de fb 31 78 2b e4 c7 78 0d |..i..|V..1x+..x.| +00000260 ae cb be 9e 4e 36 24 31 7b 6a 0f 39 95 12 07 8f |....N6$1{j.9....| +00000270 2a 16 03 01 00 d5 0c 00 00 d1 03 00 17 41 04 89 |*............A..| +00000280 95 9a 90 82 59 ab 29 bf 10 06 8c 6c 0d 67 cf b1 |....Y.)....l.g..| +00000290 66 8b 5e 43 b8 46 56 3a 8d 30 92 35 28 82 f2 38 |f.^C.FV:.0.5(..8| +000002a0 6e 19 5d 37 f0 ab fc 78 15 6a 6a 73 ca dc a6 f2 |n.]7...x.jjs....| +000002b0 68 5d b3 ab 6d 68 44 3b 80 d2 d9 cd 78 0a ed 00 |h]..mhD;....x...| +000002c0 8a 30 81 87 02 42 01 80 63 4a 22 4c 8e 66 4e 25 |.0...B..cJ"L.fN%| +000002d0 e1 86 27 81 de eb b3 a0 c4 dc dc e2 a0 94 2a b6 |..'...........*.| +000002e0 b3 e9 e7 42 e1 1d 1a c0 43 8d a1 d6 8d 77 84 06 |...B....C....w..| +000002f0 ba 95 99 e3 54 80 59 4e 3c fb 0c f3 b7 d3 a8 d2 |....T.YN<.......| +00000300 ce 49 97 fb e2 79 91 93 02 41 2b 2c b7 9f 81 ea |.I...y...A+,....| +00000310 de 17 12 af 4d 20 bc a1 43 1d 60 a0 37 52 a2 7b |....M ..C.`.7R.{| +00000320 a8 4c de fd 1d fe 37 3b 00 23 61 ce d2 80 47 43 |.L....7;.#a...GC| +00000330 b0 3a f3 1f aa c7 07 b1 68 5b d8 f3 03 a9 56 5c |.:......h[....V\| +00000340 63 ef 83 1d 9c 9c 8d 29 81 e9 3b 16 03 01 00 0e |c......)..;.....| +00000350 0d 00 00 06 03 01 02 40 00 00 0e 00 00 00 |.......@......| +>>> Flow 3 (client to server) +00000000 16 03 01 01 fb 0b 00 01 f7 00 01 f4 00 01 f1 30 |...............0| +00000010 82 01 ed 30 82 01 58 a0 03 02 01 02 02 01 00 30 |...0..X........0| +00000020 0b 06 09 2a 86 48 86 f7 0d 01 01 05 30 26 31 10 |...*.H......0&1.| +00000030 30 0e 06 03 55 04 0a 13 07 41 63 6d 65 20 43 6f |0...U....Acme Co| +00000040 31 12 30 10 06 03 55 04 03 13 09 31 32 37 2e 30 |1.0...U....127.0| +00000050 2e 30 2e 31 30 1e 17 0d 31 31 31 32 30 38 30 37 |.0.10...11120807| +00000060 35 35 31 32 5a 17 0d 31 32 31 32 30 37 30 38 30 |5512Z..121207080| +00000070 30 31 32 5a 30 26 31 10 30 0e 06 03 55 04 0a 13 |012Z0&1.0...U...| +00000080 07 41 63 6d 65 20 43 6f 31 12 30 10 06 03 55 04 |.Acme Co1.0...U.| +00000090 03 13 09 31 32 37 2e 30 2e 30 2e 31 30 81 9c 30 |...127.0.0.10..0| +000000a0 0b 06 09 2a 86 48 86 f7 0d 01 01 01 03 81 8c 00 |...*.H..........| +000000b0 30 81 88 02 81 80 4e d0 7b 31 e3 82 64 d9 59 c0 |0.....N.{1..d.Y.| +000000c0 c2 87 a4 5e 1e 8b 73 33 c7 63 53 df 66 92 06 84 |...^..s3.cS.f...| +000000d0 f6 64 d5 8f e4 36 a7 1d 2b e8 b3 20 36 45 23 b5 |.d...6..+.. 6E#.| +000000e0 e3 95 ae ed e0 f5 20 9c 8d 95 df 7f 5a 12 ef 87 |...... .....Z...| +000000f0 e4 5b 68 e4 e9 0e 74 ec 04 8a 7f de 93 27 c4 01 |.[h...t......'..| +00000100 19 7a bd f2 dc 3d 14 ab d0 54 ca 21 0c d0 4d 6e |.z...=...T.!..Mn| +00000110 87 2e 5c c5 d2 bb 4d 4b 4f ce b6 2c f7 7e 88 ec |..\...MKO..,.~..| +00000120 7c d7 02 91 74 a6 1e 0c 1a da e3 4a 5a 2e de 13 ||...t......JZ...| +00000130 9c 4c 40 88 59 93 02 03 01 00 01 a3 32 30 30 30 |.L@.Y.......2000| +00000140 0e 06 03 55 1d 0f 01 01 ff 04 04 03 02 00 a0 30 |...U...........0| +00000150 0d 06 03 55 1d 0e 04 06 04 04 01 02 03 04 30 0f |...U..........0.| +00000160 06 03 55 1d 23 04 08 30 06 80 04 01 02 03 04 30 |..U.#..0.......0| +00000170 0b 06 09 2a 86 48 86 f7 0d 01 01 05 03 81 81 00 |...*.H..........| +00000180 36 1f b3 7a 0c 75 c9 6e 37 46 61 2b d5 bd c0 a7 |6..z.u.n7Fa+....| +00000190 4b cc 46 9a 81 58 7c 85 79 29 c8 c8 c6 67 dd 32 |K.F..X|.y)...g.2| +000001a0 56 45 2b 75 b6 e9 24 a9 50 9a be 1f 5a fa 1a 15 |VE+u..$.P...Z...| +000001b0 d9 cc 55 95 72 16 83 b9 c2 b6 8f fd 88 8c 38 84 |..U.r.........8.| +000001c0 1d ab 5d 92 31 13 4f fd 83 3b c6 9d f1 11 62 b6 |..].1.O..;....b.| +000001d0 8b ec ab 67 be c8 64 b0 11 50 46 58 17 6b 99 1c |...g..d..PFX.k..| +000001e0 d3 1d fc 06 f1 0e e5 96 a8 0c f9 78 20 b7 44 18 |...........x .D.| +000001f0 51 8d 10 7e 4f 94 67 df a3 4e 70 73 8e 90 91 85 |Q..~O.g..Nps....| +00000200 16 03 01 00 46 10 00 00 42 41 04 1e 18 37 ef 0d |....F...BA...7..| +00000210 19 51 88 35 75 71 b5 e5 54 5b 12 2e 8f 09 67 fd |.Q.5uq..T[....g.| +00000220 a7 24 20 3e b2 56 1c ce 97 28 5e f8 2b 2d 4f 9e |.$ >.V...(^.+-O.| +00000230 f1 07 9f 6c 4b 5b 83 56 e2 32 42 e9 58 b6 d7 49 |...lK[.V.2B.X..I| +00000240 a6 b5 68 1a 41 03 56 6b dc 5a 89 16 03 01 00 86 |..h.A.Vk.Z......| +00000250 0f 00 00 82 00 80 0e 80 9c 3a 6e 40 51 09 39 d4 |.........:n@Q.9.| +00000260 40 58 10 da 7f 32 12 08 9e f0 4d 9a d7 20 a2 9c |@X...2....M.. ..| +00000270 b0 95 3a 33 4e f8 b1 a3 74 62 ab 51 7d 23 d4 32 |..:3N...tb.Q}#.2| +00000280 a2 af b8 5a 3b b0 23 e4 7a f1 eb 4d b7 bb 23 d5 |...Z;.#.z..M..#.| +00000290 a9 0d b4 81 d2 b4 45 bd 15 52 ad 58 da 92 a2 c4 |......E..R.X....| +000002a0 30 66 87 f2 ae c5 e4 8c fa ba a0 40 76 b8 3f 72 |0f.........@v.?r| +000002b0 2a d9 95 2a 2d c6 05 3c 1e 2f 11 ef c5 3c 11 e4 |*..*-..<./...<..| +000002c0 be 5a de 37 43 7f 74 52 6e ee 3c 39 cc f1 14 05 |.Z.7C.tRn.<9....| +000002d0 2d 91 c2 3d c4 7c 14 03 01 00 01 01 16 03 01 00 |-..=.|..........| +000002e0 30 cd 3c 92 f8 b9 36 7a e7 8a fb 0f 2f b8 2c 7b |0.<...6z..../.,{| +000002f0 10 59 45 14 0a b0 6a 8c 31 b2 89 5b ac 19 dc 12 |.YE...j.1..[....| +00000300 73 8c 8c 10 49 5a bf 9f bc 58 82 32 11 ba c5 38 |s...IZ...X.2...8| +00000310 ff |.| +>>> Flow 4 (server to client) +00000000 14 03 01 00 01 01 16 03 01 00 30 da 45 99 fe 52 |..........0.E..R| +00000010 4f cd d0 e6 30 19 f4 bd 80 6d 5c 8a 72 03 d3 88 |O...0....m\.r...| +00000020 38 63 e9 c9 39 ee ab 3f 52 26 84 b0 4d cb 5c a4 |8c..9..?R&..M.\.| +00000030 0d 51 c7 47 48 43 3a bf 89 c7 13 |.Q.GHC:....| +>>> Flow 5 (client to server) +00000000 17 03 01 00 20 4d d9 1d 0d 3d 8b 73 91 b9 4e 5e |.... M...=.s..N^| +00000010 35 71 4f 67 79 d2 f7 39 35 ea 23 d0 6d 64 de a5 |5qOgy..95.#.md..| +00000020 59 fb 75 1f c9 17 03 01 00 20 ba bd 3c b4 d7 be |Y.u...... ..<...| +00000030 24 64 68 1e 8c b2 bf 6f 78 9f ad 7f fa dd 89 a6 |$dh....ox.......| +00000040 f9 e7 5e 70 db e9 db 3a 62 b2 15 03 01 00 20 2a |..^p...:b..... *| +00000050 82 f4 8b 45 fc 76 35 6c 54 48 62 2f 52 55 f2 d9 |...E.v5lTHb/RU..| +00000060 99 b2 b5 2d 5f a0 05 ab f1 93 58 75 4a 87 35 |...-_.....XuJ.5| diff --git a/src/crypto/tls/testdata/Client-TLSv10-ClientCert-RSA-RSA b/src/crypto/tls/testdata/Client-TLSv10-ClientCert-RSA-RSA new file mode 100644 index 0000000000000000000000000000000000000000..9b1a5533acf093c6147fb7ff08a8432e62d3e5a0 --- /dev/null +++ b/src/crypto/tls/testdata/Client-TLSv10-ClientCert-RSA-RSA @@ -0,0 +1,125 @@ +>>> Flow 1 (client to server) +00000000 16 03 01 00 81 01 00 00 7d 03 03 00 00 00 00 00 |........}.......| +00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| +00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 1e c0 2f |.............../| +00000030 c0 2b c0 30 c0 2c c0 11 c0 07 c0 13 c0 09 c0 14 |.+.0.,..........| +00000040 c0 0a 00 05 00 2f 00 35 c0 12 00 0a 01 00 00 36 |...../.5.......6| +00000050 00 05 00 05 01 00 00 00 00 00 0a 00 08 00 06 00 |................| +00000060 17 00 18 00 19 00 0b 00 02 01 00 00 0d 00 0e 00 |................| +00000070 0c 04 01 04 03 05 01 05 03 02 01 02 03 ff 01 00 |................| +00000080 01 00 00 12 00 00 |......| +>>> Flow 2 (server to client) +00000000 16 03 01 00 51 02 00 00 4d 03 01 90 e6 e1 c6 bd |....Q...M.......| +00000010 86 08 db 33 94 f3 bd 0b 2d fc e0 ba 89 a7 c5 66 |...3....-......f| +00000020 a5 19 78 33 2b b9 c4 22 d8 e0 63 20 2e 85 53 25 |..x3+.."..c ..S%| +00000030 f2 22 e3 ca 79 94 9e 50 00 13 da 9d 21 33 49 27 |."..y..P....!3I'| +00000040 9b 44 c5 10 bc e8 44 01 04 31 02 81 00 05 00 00 |.D....D..1......| +00000050 05 ff 01 00 01 00 16 03 01 02 be 0b 00 02 ba 00 |................| +00000060 02 b7 00 02 b4 30 82 02 b0 30 82 02 19 a0 03 02 |.....0...0......| +00000070 01 02 02 09 00 85 b0 bb a4 8a 7f b8 ca 30 0d 06 |.............0..| +00000080 09 2a 86 48 86 f7 0d 01 01 05 05 00 30 45 31 0b |.*.H........0E1.| +00000090 30 09 06 03 55 04 06 13 02 41 55 31 13 30 11 06 |0...U....AU1.0..| +000000a0 03 55 04 08 13 0a 53 6f 6d 65 2d 53 74 61 74 65 |.U....Some-State| +000000b0 31 21 30 1f 06 03 55 04 0a 13 18 49 6e 74 65 72 |1!0...U....Inter| +000000c0 6e 65 74 20 57 69 64 67 69 74 73 20 50 74 79 20 |net Widgits Pty | +000000d0 4c 74 64 30 1e 17 0d 31 30 30 34 32 34 30 39 30 |Ltd0...100424090| +000000e0 39 33 38 5a 17 0d 31 31 30 34 32 34 30 39 30 39 |938Z..1104240909| +000000f0 33 38 5a 30 45 31 0b 30 09 06 03 55 04 06 13 02 |38Z0E1.0...U....| +00000100 41 55 31 13 30 11 06 03 55 04 08 13 0a 53 6f 6d |AU1.0...U....Som| +00000110 65 2d 53 74 61 74 65 31 21 30 1f 06 03 55 04 0a |e-State1!0...U..| +00000120 13 18 49 6e 74 65 72 6e 65 74 20 57 69 64 67 69 |..Internet Widgi| +00000130 74 73 20 50 74 79 20 4c 74 64 30 81 9f 30 0d 06 |ts Pty Ltd0..0..| +00000140 09 2a 86 48 86 f7 0d 01 01 01 05 00 03 81 8d 00 |.*.H............| +00000150 30 81 89 02 81 81 00 bb 79 d6 f5 17 b5 e5 bf 46 |0.......y......F| +00000160 10 d0 dc 69 be e6 2b 07 43 5a d0 03 2d 8a 7a 43 |...i..+.CZ..-.zC| +00000170 85 b7 14 52 e7 a5 65 4c 2c 78 b8 23 8c b5 b4 82 |...R..eL,x.#....| +00000180 e5 de 1f 95 3b 7e 62 a5 2c a5 33 d6 fe 12 5c 7a |....;~b.,.3...\z| +00000190 56 fc f5 06 bf fa 58 7b 26 3f b5 cd 04 d3 d0 c9 |V.....X{&?......| +000001a0 21 96 4a c7 f4 54 9f 5a bf ef 42 71 00 fe 18 99 |!.J..T.Z..Bq....| +000001b0 07 7f 7e 88 7d 7d f1 04 39 c4 a2 2e db 51 c9 7c |..~.}}..9....Q.|| +000001c0 e3 c0 4c 3b 32 66 01 cf af b1 1d b8 71 9a 1d db |..L;2f......q...| +000001d0 db 89 6b ae da 2d 79 02 03 01 00 01 a3 81 a7 30 |..k..-y........0| +000001e0 81 a4 30 1d 06 03 55 1d 0e 04 16 04 14 b1 ad e2 |..0...U.........| +000001f0 85 5a cf cb 28 db 69 ce 23 69 de d3 26 8e 18 88 |.Z..(.i.#i..&...| +00000200 39 30 75 06 03 55 1d 23 04 6e 30 6c 80 14 b1 ad |90u..U.#.n0l....| +00000210 e2 85 5a cf cb 28 db 69 ce 23 69 de d3 26 8e 18 |..Z..(.i.#i..&..| +00000220 88 39 a1 49 a4 47 30 45 31 0b 30 09 06 03 55 04 |.9.I.G0E1.0...U.| +00000230 06 13 02 41 55 31 13 30 11 06 03 55 04 08 13 0a |...AU1.0...U....| +00000240 53 6f 6d 65 2d 53 74 61 74 65 31 21 30 1f 06 03 |Some-State1!0...| +00000250 55 04 0a 13 18 49 6e 74 65 72 6e 65 74 20 57 69 |U....Internet Wi| +00000260 64 67 69 74 73 20 50 74 79 20 4c 74 64 82 09 00 |dgits Pty Ltd...| +00000270 85 b0 bb a4 8a 7f b8 ca 30 0c 06 03 55 1d 13 04 |........0...U...| +00000280 05 30 03 01 01 ff 30 0d 06 09 2a 86 48 86 f7 0d |.0....0...*.H...| +00000290 01 01 05 05 00 03 81 81 00 08 6c 45 24 c7 6b b1 |..........lE$.k.| +000002a0 59 ab 0c 52 cc f2 b0 14 d7 87 9d 7a 64 75 b5 5a |Y..R.......zdu.Z| +000002b0 95 66 e4 c5 2b 8e ae 12 66 1f eb 4f 38 b3 6e 60 |.f..+...f..O8.n`| +000002c0 d3 92 fd f7 41 08 b5 25 13 b1 18 7a 24 fb 30 1d |....A..%...z$.0.| +000002d0 ba ed 98 b9 17 ec e7 d7 31 59 db 95 d3 1d 78 ea |........1Y....x.| +000002e0 50 56 5c d5 82 5a 2d 5a 5f 33 c4 b6 d8 c9 75 90 |PV\..Z-Z_3....u.| +000002f0 96 8c 0f 52 98 b5 cd 98 1f 89 20 5f f2 a0 1c a3 |...R...... _....| +00000300 1b 96 94 dd a9 fd 57 e9 70 e8 26 6d 71 99 9b 26 |......W.p.&mq..&| +00000310 6e 38 50 29 6c 90 a7 bd d9 16 03 01 00 0e 0d 00 |n8P)l...........| +00000320 00 06 03 01 02 40 00 00 0e 00 00 00 |.....@......| +>>> Flow 3 (client to server) +00000000 16 03 01 01 fb 0b 00 01 f7 00 01 f4 00 01 f1 30 |...............0| +00000010 82 01 ed 30 82 01 58 a0 03 02 01 02 02 01 00 30 |...0..X........0| +00000020 0b 06 09 2a 86 48 86 f7 0d 01 01 05 30 26 31 10 |...*.H......0&1.| +00000030 30 0e 06 03 55 04 0a 13 07 41 63 6d 65 20 43 6f |0...U....Acme Co| +00000040 31 12 30 10 06 03 55 04 03 13 09 31 32 37 2e 30 |1.0...U....127.0| +00000050 2e 30 2e 31 30 1e 17 0d 31 31 31 32 30 38 30 37 |.0.10...11120807| +00000060 35 35 31 32 5a 17 0d 31 32 31 32 30 37 30 38 30 |5512Z..121207080| +00000070 30 31 32 5a 30 26 31 10 30 0e 06 03 55 04 0a 13 |012Z0&1.0...U...| +00000080 07 41 63 6d 65 20 43 6f 31 12 30 10 06 03 55 04 |.Acme Co1.0...U.| +00000090 03 13 09 31 32 37 2e 30 2e 30 2e 31 30 81 9c 30 |...127.0.0.10..0| +000000a0 0b 06 09 2a 86 48 86 f7 0d 01 01 01 03 81 8c 00 |...*.H..........| +000000b0 30 81 88 02 81 80 4e d0 7b 31 e3 82 64 d9 59 c0 |0.....N.{1..d.Y.| +000000c0 c2 87 a4 5e 1e 8b 73 33 c7 63 53 df 66 92 06 84 |...^..s3.cS.f...| +000000d0 f6 64 d5 8f e4 36 a7 1d 2b e8 b3 20 36 45 23 b5 |.d...6..+.. 6E#.| +000000e0 e3 95 ae ed e0 f5 20 9c 8d 95 df 7f 5a 12 ef 87 |...... .....Z...| +000000f0 e4 5b 68 e4 e9 0e 74 ec 04 8a 7f de 93 27 c4 01 |.[h...t......'..| +00000100 19 7a bd f2 dc 3d 14 ab d0 54 ca 21 0c d0 4d 6e |.z...=...T.!..Mn| +00000110 87 2e 5c c5 d2 bb 4d 4b 4f ce b6 2c f7 7e 88 ec |..\...MKO..,.~..| +00000120 7c d7 02 91 74 a6 1e 0c 1a da e3 4a 5a 2e de 13 ||...t......JZ...| +00000130 9c 4c 40 88 59 93 02 03 01 00 01 a3 32 30 30 30 |.L@.Y.......2000| +00000140 0e 06 03 55 1d 0f 01 01 ff 04 04 03 02 00 a0 30 |...U...........0| +00000150 0d 06 03 55 1d 0e 04 06 04 04 01 02 03 04 30 0f |...U..........0.| +00000160 06 03 55 1d 23 04 08 30 06 80 04 01 02 03 04 30 |..U.#..0.......0| +00000170 0b 06 09 2a 86 48 86 f7 0d 01 01 05 03 81 81 00 |...*.H..........| +00000180 36 1f b3 7a 0c 75 c9 6e 37 46 61 2b d5 bd c0 a7 |6..z.u.n7Fa+....| +00000190 4b cc 46 9a 81 58 7c 85 79 29 c8 c8 c6 67 dd 32 |K.F..X|.y)...g.2| +000001a0 56 45 2b 75 b6 e9 24 a9 50 9a be 1f 5a fa 1a 15 |VE+u..$.P...Z...| +000001b0 d9 cc 55 95 72 16 83 b9 c2 b6 8f fd 88 8c 38 84 |..U.r.........8.| +000001c0 1d ab 5d 92 31 13 4f fd 83 3b c6 9d f1 11 62 b6 |..].1.O..;....b.| +000001d0 8b ec ab 67 be c8 64 b0 11 50 46 58 17 6b 99 1c |...g..d..PFX.k..| +000001e0 d3 1d fc 06 f1 0e e5 96 a8 0c f9 78 20 b7 44 18 |...........x .D.| +000001f0 51 8d 10 7e 4f 94 67 df a3 4e 70 73 8e 90 91 85 |Q..~O.g..Nps....| +00000200 16 03 01 00 86 10 00 00 82 00 80 6d 51 f3 7f f9 |...........mQ...| +00000210 3e fb 75 82 41 36 83 e8 6a ee 2a 2e 25 90 67 4c |>.u.A6..j.*.%.gL| +00000220 8e 62 2f 30 81 17 e0 85 09 0c 2b b7 23 d7 b0 e2 |.b/0......+.#...| +00000230 1d f7 3b d7 f5 a1 27 b6 ee 24 b6 1b cc 5b ea 66 |..;...'..$...[.f| +00000240 0d 6a f4 e5 85 f9 da 43 b4 0e 86 85 e1 f5 aa be |.j.....C........| +00000250 c8 ce 39 4c 9c 86 00 08 c2 4b e2 c6 ec 2f f7 ce |..9L.....K.../..| +00000260 e6 bd 77 82 6f 23 b6 e0 bd a2 92 b7 3a ac e8 56 |..w.o#......:..V| +00000270 f1 af 54 5e 46 87 e9 3b 33 e7 b8 28 b7 d6 c8 90 |..T^F..;3..(....| +00000280 35 d4 1c 43 d1 30 6f 55 4e 0a 70 16 03 01 00 86 |5..C.0oUN.p.....| +00000290 0f 00 00 82 00 80 10 19 57 14 c3 ee 2d da cb de |........W...-...| +000002a0 f3 70 c5 62 91 2f ad 62 dd 10 f1 65 20 a2 cf d5 |.p.b./.b...e ...| +000002b0 cd 6d 5f e4 b3 3e 38 e8 d0 1a f7 f0 e7 7e b6 5d |.m_..>8......~.]| +000002c0 c3 6c ad f6 0d 05 1e 41 35 2d 04 15 3c 36 96 00 |.l.....A5-..<6..| +000002d0 e8 02 b2 01 b8 9f 21 4b 34 85 ef 5e 4c 87 ef 49 |......!K4..^L..I| +000002e0 df d1 9a b6 b2 bd b8 90 fd 3f 31 93 0c dc c7 18 |.........?1.....| +000002f0 ff f6 76 bd 5b 74 76 b3 62 87 6a df ff 63 15 d5 |..v.[tv.b.j..c..| +00000300 94 d5 fe fd 4c 12 df f1 35 07 f1 8a f1 77 7a 35 |....L...5....wz5| +00000310 cd 99 1d 2a d7 9a 14 03 01 00 01 01 16 03 01 00 |...*............| +00000320 24 8d db 0c 87 b5 df fd 68 de fe 46 3e e4 41 b5 |$.......h..F>.A.| +00000330 19 64 68 3c c4 e2 2b 43 50 e4 ee 52 75 34 d3 c1 |.dh<..+CP..Ru4..| +00000340 51 18 c0 b2 5f |Q..._| +>>> Flow 4 (server to client) +00000000 14 03 01 00 01 01 16 03 01 00 24 0b a4 04 46 60 |..........$...F`| +00000010 15 fb 9a 9f 47 51 6d b4 4b c6 e7 2a 1b 98 b4 8a |....GQm.K..*....| +00000020 8a 1a 03 cf f4 16 7d 80 70 27 e5 e8 d5 9f ad |......}.p'.....| +>>> Flow 5 (client to server) +00000000 17 03 01 00 1a 6f 84 50 27 c7 f1 aa b0 04 7d 80 |.....o.P'.....}.| +00000010 6d a7 20 8a 73 cf d9 de 9a d6 f5 e9 36 13 7c 15 |m. .s.......6.|.| +00000020 03 01 00 16 e8 0b e0 a6 3b 1e 21 24 65 4e 49 b2 |........;.!$eNI.| +00000030 2d a3 41 2b 98 23 4e d5 4b fd |-.A+.#N.K.| diff --git a/src/crypto/tls/testdata/Client-TLSv10-ECDHE-ECDSA-AES b/src/crypto/tls/testdata/Client-TLSv10-ECDHE-ECDSA-AES new file mode 100644 index 0000000000000000000000000000000000000000..937c2909f904ab50f75b26fd24ec37905db769fe --- /dev/null +++ b/src/crypto/tls/testdata/Client-TLSv10-ECDHE-ECDSA-AES @@ -0,0 +1,88 @@ +>>> Flow 1 (client to server) +00000000 16 03 01 00 81 01 00 00 7d 03 03 00 00 00 00 00 |........}.......| +00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| +00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 1e c0 2f |.............../| +00000030 c0 2b c0 30 c0 2c c0 11 c0 07 c0 13 c0 09 c0 14 |.+.0.,..........| +00000040 c0 0a 00 05 00 2f 00 35 c0 12 00 0a 01 00 00 36 |...../.5.......6| +00000050 00 05 00 05 01 00 00 00 00 00 0a 00 08 00 06 00 |................| +00000060 17 00 18 00 19 00 0b 00 02 01 00 00 0d 00 0e 00 |................| +00000070 0c 04 01 04 03 05 01 05 03 02 01 02 03 ff 01 00 |................| +00000080 01 00 00 12 00 00 |......| +>>> Flow 2 (server to client) +00000000 16 03 01 00 59 02 00 00 55 03 01 f5 8f 8d 8e ca |....Y...U.......| +00000010 30 6b fe 63 c9 84 57 c0 f1 c8 a5 d8 10 56 14 62 |0k.c..W......V.b| +00000020 c8 02 b2 89 21 5c 09 67 86 d8 9b 20 dc 3f 55 54 |....!\.g... .?UT| +00000030 33 29 47 45 d3 e0 87 1a 4b 1b 75 30 89 e0 4d 01 |3)GE....K.u0..M.| +00000040 a1 6a 46 f7 8f 23 d6 74 fd 90 2f 53 c0 09 00 00 |.jF..#.t../S....| +00000050 0d ff 01 00 01 00 00 0b 00 04 03 00 01 02 16 03 |................| +00000060 01 02 0e 0b 00 02 0a 00 02 07 00 02 04 30 82 02 |.............0..| +00000070 00 30 82 01 62 02 09 00 b8 bf 2d 47 a0 d2 eb f4 |.0..b.....-G....| +00000080 30 09 06 07 2a 86 48 ce 3d 04 01 30 45 31 0b 30 |0...*.H.=..0E1.0| +00000090 09 06 03 55 04 06 13 02 41 55 31 13 30 11 06 03 |...U....AU1.0...| +000000a0 55 04 08 13 0a 53 6f 6d 65 2d 53 74 61 74 65 31 |U....Some-State1| +000000b0 21 30 1f 06 03 55 04 0a 13 18 49 6e 74 65 72 6e |!0...U....Intern| +000000c0 65 74 20 57 69 64 67 69 74 73 20 50 74 79 20 4c |et Widgits Pty L| +000000d0 74 64 30 1e 17 0d 31 32 31 31 32 32 31 35 30 36 |td0...1211221506| +000000e0 33 32 5a 17 0d 32 32 31 31 32 30 31 35 30 36 33 |32Z..22112015063| +000000f0 32 5a 30 45 31 0b 30 09 06 03 55 04 06 13 02 41 |2Z0E1.0...U....A| +00000100 55 31 13 30 11 06 03 55 04 08 13 0a 53 6f 6d 65 |U1.0...U....Some| +00000110 2d 53 74 61 74 65 31 21 30 1f 06 03 55 04 0a 13 |-State1!0...U...| +00000120 18 49 6e 74 65 72 6e 65 74 20 57 69 64 67 69 74 |.Internet Widgit| +00000130 73 20 50 74 79 20 4c 74 64 30 81 9b 30 10 06 07 |s Pty Ltd0..0...| +00000140 2a 86 48 ce 3d 02 01 06 05 2b 81 04 00 23 03 81 |*.H.=....+...#..| +00000150 86 00 04 00 c4 a1 ed be 98 f9 0b 48 73 36 7e c3 |...........Hs6~.| +00000160 16 56 11 22 f2 3d 53 c3 3b 4d 21 3d cd 6b 75 e6 |.V.".=S.;M!=.ku.| +00000170 f6 b0 dc 9a df 26 c1 bc b2 87 f0 72 32 7c b3 64 |.....&.....r2|.d| +00000180 2f 1c 90 bc ea 68 23 10 7e fe e3 25 c0 48 3a 69 |/....h#.~..%.H:i| +00000190 e0 28 6d d3 37 00 ef 04 62 dd 0d a0 9c 70 62 83 |.(m.7...b....pb.| +000001a0 d8 81 d3 64 31 aa 9e 97 31 bd 96 b0 68 c0 9b 23 |...d1...1...h..#| +000001b0 de 76 64 3f 1a 5c 7f e9 12 0e 58 58 b6 5f 70 dd |.vd?.\....XX._p.| +000001c0 9b d8 ea d5 d7 f5 d5 cc b9 b6 9f 30 66 5b 66 9a |...........0f[f.| +000001d0 20 e2 27 e5 bf fe 3b 30 09 06 07 2a 86 48 ce 3d | .'...;0...*.H.=| +000001e0 04 01 03 81 8c 00 30 81 88 02 42 01 88 a2 4f eb |......0...B...O.| +000001f0 e2 45 c5 48 7d 1b ac f5 ed 98 9d ae 47 70 c0 5e |.E.H}.......Gp.^| +00000200 1b b6 2f bd f1 b6 4d b7 61 40 d3 11 a2 ce ee 0b |../...M.a@......| +00000210 7e 92 7e ff 76 9d c3 3b 7e a5 3f ce fa 10 e2 59 |~.~.v..;~.?....Y| +00000220 ec 47 2d 7c ac da 4e 97 0e 15 a0 6f d0 02 42 01 |.G-|..N....o..B.| +00000230 4d fc be 67 13 9c 2d 05 0e bd 3f a3 8c 25 c1 33 |M..g..-...?..%.3| +00000240 13 83 0d 94 06 bb d4 37 7a f6 ec 7a c9 86 2e dd |.......7z..z....| +00000250 d7 11 69 7f 85 7c 56 de fb 31 78 2b e4 c7 78 0d |..i..|V..1x+..x.| +00000260 ae cb be 9e 4e 36 24 31 7b 6a 0f 39 95 12 07 8f |....N6$1{j.9....| +00000270 2a 16 03 01 00 d5 0c 00 00 d1 03 00 17 41 04 22 |*............A."| +00000280 8a 47 c6 d3 7a c4 30 a4 8e 41 11 ac b3 2d 2f 45 |.G..z.0..A...-/E| +00000290 61 54 9b 1f 2e 03 5d 50 eb fc 5b 44 a0 a7 48 78 |aT....]P..[D..Hx| +000002a0 ce 14 d5 39 a7 c4 ed f5 4d 8f da 9d 71 52 69 70 |...9....M...qRip| +000002b0 7e 52 29 ad 80 8a 19 ad 4c 5d 1c f1 22 7e 1a 00 |~R).....L].."~..| +000002c0 8a 30 81 87 02 42 00 97 8b 6d f7 87 c1 a9 a6 55 |.0...B...m.....U| +000002d0 0f 61 c2 f2 e1 05 26 a8 83 16 1c 0b 69 3b 95 57 |.a....&.....i;.W| +000002e0 76 5b eb 45 7a bd 6a f1 3e a0 93 49 fa 74 32 fd |v[.Ez.j.>..I.t2.| +000002f0 dc 20 3a bb e3 ee 6d b8 56 aa e9 d2 7d 6a ec b7 |. :...m.V...}j..| +00000300 0a bd aa dc d7 b0 69 65 02 41 4d 19 61 16 d8 5f |......ie.AM.a.._| +00000310 1d c1 32 25 15 26 eb 88 5b c1 dd 9a 12 40 fa f1 |..2%.&..[....@..| +00000320 81 5e 7d b8 2b 6e 60 63 1a 9e 86 cb d5 64 96 d4 |.^}.+n`c.....d..| +00000330 75 fc 02 33 e0 66 60 b2 40 47 cf e6 6d 25 9c 83 |u..3.f`.@G..m%..| +00000340 23 d3 4b e2 eb ac f1 56 44 f8 3f 16 03 01 00 04 |#.K....VD.?.....| +00000350 0e 00 00 00 |....| +>>> Flow 3 (client to server) +00000000 16 03 01 00 46 10 00 00 42 41 04 1e 18 37 ef 0d |....F...BA...7..| +00000010 19 51 88 35 75 71 b5 e5 54 5b 12 2e 8f 09 67 fd |.Q.5uq..T[....g.| +00000020 a7 24 20 3e b2 56 1c ce 97 28 5e f8 2b 2d 4f 9e |.$ >.V...(^.+-O.| +00000030 f1 07 9f 6c 4b 5b 83 56 e2 32 42 e9 58 b6 d7 49 |...lK[.V.2B.X..I| +00000040 a6 b5 68 1a 41 03 56 6b dc 5a 89 14 03 01 00 01 |..h.A.Vk.Z......| +00000050 01 16 03 01 00 30 cc 86 f1 7e 6e a8 c9 b5 02 5f |.....0...~n...._| +00000060 fb b2 3b ea 74 bf a8 da e4 6a 69 50 a2 5a 78 4f |..;.t....jiP.ZxO| +00000070 35 e1 cc 87 c3 fb 1f 5e f6 a4 5c 63 cc 59 12 3e |5......^..\c.Y.>| +00000080 07 c3 a8 d7 87 ba |......| +>>> Flow 4 (server to client) +00000000 14 03 01 00 01 01 16 03 01 00 30 e8 b6 20 b9 c1 |..........0.. ..| +00000010 07 38 38 bb 42 b2 b2 a1 c5 8d 92 62 db 67 ab fc |.88.B......b.g..| +00000020 f6 64 3f 71 83 1d a0 86 bb 2d e3 4f 65 d5 44 52 |.d?q.....-.Oe.DR| +00000030 4d f5 62 80 3c af 95 87 19 7c 20 |M.b.<....| | +>>> Flow 5 (client to server) +00000000 17 03 01 00 20 bd 65 61 28 e5 ea 1b 81 db 75 92 |.... .ea(.....u.| +00000010 ad a7 3b 01 a3 23 0e 3b 60 10 8a 1e 04 91 fb 9e |..;..#.;`.......| +00000020 7a cf 1f cf 9c 17 03 01 00 20 87 9c dc ed 0d 08 |z........ ......| +00000030 56 40 23 8b c5 2c d8 7e 42 82 3c 0a c9 f3 77 6d |V@#..,.~B.<...wm| +00000040 8d 9a 30 d1 9c c4 ae 04 fb b7 15 03 01 00 20 f7 |..0........... .| +00000050 f0 12 0d e5 03 c1 80 4e 7e 21 d7 75 55 1c 91 89 |.......N~!.uU...| +00000060 e7 e1 45 fc 7d d8 fc b1 d0 e7 dc e2 4c ba f4 |..E.}.......L..| diff --git a/src/crypto/tls/testdata/Client-TLSv10-ECDHE-RSA-AES b/src/crypto/tls/testdata/Client-TLSv10-ECDHE-RSA-AES new file mode 100644 index 0000000000000000000000000000000000000000..f8183f103539129755173db2aaa0eb1e4869bb62 --- /dev/null +++ b/src/crypto/tls/testdata/Client-TLSv10-ECDHE-RSA-AES @@ -0,0 +1,98 @@ +>>> Flow 1 (client to server) +00000000 16 03 01 00 81 01 00 00 7d 03 03 00 00 00 00 00 |........}.......| +00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| +00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 1e c0 2f |.............../| +00000030 c0 2b c0 30 c0 2c c0 11 c0 07 c0 13 c0 09 c0 14 |.+.0.,..........| +00000040 c0 0a 00 05 00 2f 00 35 c0 12 00 0a 01 00 00 36 |...../.5.......6| +00000050 00 05 00 05 01 00 00 00 00 00 0a 00 08 00 06 00 |................| +00000060 17 00 18 00 19 00 0b 00 02 01 00 00 0d 00 0e 00 |................| +00000070 0c 04 01 04 03 05 01 05 03 02 01 02 03 ff 01 00 |................| +00000080 01 00 00 12 00 00 |......| +>>> Flow 2 (server to client) +00000000 16 03 01 00 59 02 00 00 55 03 01 5c 69 d0 60 d6 |....Y...U..\i.`.| +00000010 b3 f4 23 19 5e 3e 26 d8 29 ea c3 94 e4 ed 51 f6 |..#.^>&.).....Q.| +00000020 58 a2 e3 9c 79 a1 0b 6d 29 90 32 20 23 5b 47 b1 |X...y..m).2 #[G.| +00000030 8f 22 bc 06 aa ee f7 c3 97 ca 93 df b1 90 7d b4 |."............}.| +00000040 8c c0 d9 54 35 ca 5b 11 98 37 84 ea c0 13 00 00 |...T5.[..7......| +00000050 0d ff 01 00 01 00 00 0b 00 04 03 00 01 02 16 03 |................| +00000060 01 02 be 0b 00 02 ba 00 02 b7 00 02 b4 30 82 02 |.............0..| +00000070 b0 30 82 02 19 a0 03 02 01 02 02 09 00 85 b0 bb |.0..............| +00000080 a4 8a 7f b8 ca 30 0d 06 09 2a 86 48 86 f7 0d 01 |.....0...*.H....| +00000090 01 05 05 00 30 45 31 0b 30 09 06 03 55 04 06 13 |....0E1.0...U...| +000000a0 02 41 55 31 13 30 11 06 03 55 04 08 13 0a 53 6f |.AU1.0...U....So| +000000b0 6d 65 2d 53 74 61 74 65 31 21 30 1f 06 03 55 04 |me-State1!0...U.| +000000c0 0a 13 18 49 6e 74 65 72 6e 65 74 20 57 69 64 67 |...Internet Widg| +000000d0 69 74 73 20 50 74 79 20 4c 74 64 30 1e 17 0d 31 |its Pty Ltd0...1| +000000e0 30 30 34 32 34 30 39 30 39 33 38 5a 17 0d 31 31 |00424090938Z..11| +000000f0 30 34 32 34 30 39 30 39 33 38 5a 30 45 31 0b 30 |0424090938Z0E1.0| +00000100 09 06 03 55 04 06 13 02 41 55 31 13 30 11 06 03 |...U....AU1.0...| +00000110 55 04 08 13 0a 53 6f 6d 65 2d 53 74 61 74 65 31 |U....Some-State1| +00000120 21 30 1f 06 03 55 04 0a 13 18 49 6e 74 65 72 6e |!0...U....Intern| +00000130 65 74 20 57 69 64 67 69 74 73 20 50 74 79 20 4c |et Widgits Pty L| +00000140 74 64 30 81 9f 30 0d 06 09 2a 86 48 86 f7 0d 01 |td0..0...*.H....| +00000150 01 01 05 00 03 81 8d 00 30 81 89 02 81 81 00 bb |........0.......| +00000160 79 d6 f5 17 b5 e5 bf 46 10 d0 dc 69 be e6 2b 07 |y......F...i..+.| +00000170 43 5a d0 03 2d 8a 7a 43 85 b7 14 52 e7 a5 65 4c |CZ..-.zC...R..eL| +00000180 2c 78 b8 23 8c b5 b4 82 e5 de 1f 95 3b 7e 62 a5 |,x.#........;~b.| +00000190 2c a5 33 d6 fe 12 5c 7a 56 fc f5 06 bf fa 58 7b |,.3...\zV.....X{| +000001a0 26 3f b5 cd 04 d3 d0 c9 21 96 4a c7 f4 54 9f 5a |&?......!.J..T.Z| +000001b0 bf ef 42 71 00 fe 18 99 07 7f 7e 88 7d 7d f1 04 |..Bq......~.}}..| +000001c0 39 c4 a2 2e db 51 c9 7c e3 c0 4c 3b 32 66 01 cf |9....Q.|..L;2f..| +000001d0 af b1 1d b8 71 9a 1d db db 89 6b ae da 2d 79 02 |....q.....k..-y.| +000001e0 03 01 00 01 a3 81 a7 30 81 a4 30 1d 06 03 55 1d |.......0..0...U.| +000001f0 0e 04 16 04 14 b1 ad e2 85 5a cf cb 28 db 69 ce |.........Z..(.i.| +00000200 23 69 de d3 26 8e 18 88 39 30 75 06 03 55 1d 23 |#i..&...90u..U.#| +00000210 04 6e 30 6c 80 14 b1 ad e2 85 5a cf cb 28 db 69 |.n0l......Z..(.i| +00000220 ce 23 69 de d3 26 8e 18 88 39 a1 49 a4 47 30 45 |.#i..&...9.I.G0E| +00000230 31 0b 30 09 06 03 55 04 06 13 02 41 55 31 13 30 |1.0...U....AU1.0| +00000240 11 06 03 55 04 08 13 0a 53 6f 6d 65 2d 53 74 61 |...U....Some-Sta| +00000250 74 65 31 21 30 1f 06 03 55 04 0a 13 18 49 6e 74 |te1!0...U....Int| +00000260 65 72 6e 65 74 20 57 69 64 67 69 74 73 20 50 74 |ernet Widgits Pt| +00000270 79 20 4c 74 64 82 09 00 85 b0 bb a4 8a 7f b8 ca |y Ltd...........| +00000280 30 0c 06 03 55 1d 13 04 05 30 03 01 01 ff 30 0d |0...U....0....0.| +00000290 06 09 2a 86 48 86 f7 0d 01 01 05 05 00 03 81 81 |..*.H...........| +000002a0 00 08 6c 45 24 c7 6b b1 59 ab 0c 52 cc f2 b0 14 |..lE$.k.Y..R....| +000002b0 d7 87 9d 7a 64 75 b5 5a 95 66 e4 c5 2b 8e ae 12 |...zdu.Z.f..+...| +000002c0 66 1f eb 4f 38 b3 6e 60 d3 92 fd f7 41 08 b5 25 |f..O8.n`....A..%| +000002d0 13 b1 18 7a 24 fb 30 1d ba ed 98 b9 17 ec e7 d7 |...z$.0.........| +000002e0 31 59 db 95 d3 1d 78 ea 50 56 5c d5 82 5a 2d 5a |1Y....x.PV\..Z-Z| +000002f0 5f 33 c4 b6 d8 c9 75 90 96 8c 0f 52 98 b5 cd 98 |_3....u....R....| +00000300 1f 89 20 5f f2 a0 1c a3 1b 96 94 dd a9 fd 57 e9 |.. _..........W.| +00000310 70 e8 26 6d 71 99 9b 26 6e 38 50 29 6c 90 a7 bd |p.&mq..&n8P)l...| +00000320 d9 16 03 01 00 cb 0c 00 00 c7 03 00 17 41 04 a6 |.............A..| +00000330 57 60 8d 63 4e 4d 3f 48 e0 5d ad 9a 9c f7 e6 8c |W`.cNM?H.]......| +00000340 00 18 9c eb 34 ea f0 5c d5 77 3f af 81 a9 50 d9 |....4..\.w?...P.| +00000350 05 cf b9 bf 88 5c 70 29 24 61 6f d8 77 11 21 57 |.....\p)$ao.w.!W| +00000360 a0 4d e1 4b 8e 55 06 50 7f a2 30 c1 c2 b9 c6 00 |.M.K.U.P..0.....| +00000370 80 68 7c e4 1a bc a4 1e 16 b9 3e 4a 59 39 a9 54 |.h|.......>JY9.T| +00000380 6f c7 17 b2 f5 af b5 73 5b db cc 71 f2 1b aa dc |o......s[..q....| +00000390 9d 64 3c 0f 82 e6 da 1a 6b 96 19 e2 f0 15 b0 df |.d<.....k.......| +000003a0 8a 2d 96 09 63 52 f6 53 ef 12 d4 3b 35 b7 0b 43 |.-..cR.S...;5..C| +000003b0 2c 6e 58 4c c8 2f b8 55 84 89 c9 39 81 7a 7a 7d |,nXL./.U...9.zz}| +000003c0 88 68 db eb d7 81 aa 2e b2 25 ba 98 6c 46 b7 85 |.h.......%..lF..| +000003d0 8a 21 17 b9 36 23 c0 84 94 af 3b 9b 04 5d ec 31 |.!..6#....;..].1| +000003e0 f5 75 84 d8 77 d7 80 37 ae c3 5c 26 41 f6 72 af |.u..w..7..\&A.r.| +000003f0 88 16 03 01 00 04 0e 00 00 00 |..........| +>>> Flow 3 (client to server) +00000000 16 03 01 00 46 10 00 00 42 41 04 1e 18 37 ef 0d |....F...BA...7..| +00000010 19 51 88 35 75 71 b5 e5 54 5b 12 2e 8f 09 67 fd |.Q.5uq..T[....g.| +00000020 a7 24 20 3e b2 56 1c ce 97 28 5e f8 2b 2d 4f 9e |.$ >.V...(^.+-O.| +00000030 f1 07 9f 6c 4b 5b 83 56 e2 32 42 e9 58 b6 d7 49 |...lK[.V.2B.X..I| +00000040 a6 b5 68 1a 41 03 56 6b dc 5a 89 14 03 01 00 01 |..h.A.Vk.Z......| +00000050 01 16 03 01 00 30 d2 5b 27 5a f5 64 49 31 d5 aa |.....0.['Z.dI1..| +00000060 a3 72 ae c9 af 0b aa 75 af ac f3 45 f4 e3 03 fa |.r.....u...E....| +00000070 e8 97 88 7b 51 a9 ae 61 40 c8 11 74 3e d8 9a b6 |...{Q..a@..t>...| +00000080 e7 6a 5e 71 84 7e |.j^q.~| +>>> Flow 4 (server to client) +00000000 14 03 01 00 01 01 16 03 01 00 30 8d 63 fc 58 2e |..........0.c.X.| +00000010 50 f7 60 2c 9f 5a 8e 58 29 6c a6 3a 8d 2b a7 2b |P.`,.Z.X)l.:.+.+| +00000020 1c 12 8a 53 3f d5 60 79 12 c3 78 e3 aa 50 15 45 |...S?.`y..x..P.E| +00000030 07 da 2d c7 a9 c3 45 07 48 00 78 |..-...E.H.x| +>>> Flow 5 (client to server) +00000000 17 03 01 00 20 40 91 8d e6 95 2f 97 c8 0c 94 5c |.... @..../....\| +00000010 46 a7 d3 31 82 3d dc 7e 86 5b dd df 3f 3b 5b 9c |F..1.=.~.[..?;[.| +00000020 d5 0d 52 5a 53 17 03 01 00 20 1d 18 da 6b e8 66 |..RZS.... ...k.f| +00000030 ce 58 18 81 4b 69 8c f6 db 1a ee d0 78 fb f5 68 |.X..Ki......x..h| +00000040 2c 99 48 47 65 15 2a ae ff 4e 15 03 01 00 20 68 |,.HGe.*..N.... h| +00000050 aa 7f 75 33 45 7a 1a 33 18 35 5a 5b 14 b0 f6 83 |..u3Ez.3.5Z[....| +00000060 97 85 3f b2 dc 78 68 eb 43 ef 92 7f 38 bd f8 |..?..xh.C...8..| diff --git a/src/crypto/tls/testdata/Client-TLSv10-RSA-RC4 b/src/crypto/tls/testdata/Client-TLSv10-RSA-RC4 new file mode 100644 index 0000000000000000000000000000000000000000..b5deaeb011a460f331fbfbb18430174577977a24 --- /dev/null +++ b/src/crypto/tls/testdata/Client-TLSv10-RSA-RC4 @@ -0,0 +1,84 @@ +>>> Flow 1 (client to server) +00000000 16 03 01 00 81 01 00 00 7d 03 03 00 00 00 00 00 |........}.......| +00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| +00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 1e c0 2f |.............../| +00000030 c0 2b c0 30 c0 2c c0 11 c0 07 c0 13 c0 09 c0 14 |.+.0.,..........| +00000040 c0 0a 00 05 00 2f 00 35 c0 12 00 0a 01 00 00 36 |...../.5.......6| +00000050 00 05 00 05 01 00 00 00 00 00 0a 00 08 00 06 00 |................| +00000060 17 00 18 00 19 00 0b 00 02 01 00 00 0d 00 0e 00 |................| +00000070 0c 04 01 04 03 05 01 05 03 02 01 02 03 ff 01 00 |................| +00000080 01 00 00 12 00 00 |......| +>>> Flow 2 (server to client) +00000000 16 03 01 00 51 02 00 00 4d 03 01 a9 b0 bf 24 3f |....Q...M.....$?| +00000010 98 c6 0f 83 23 2b b6 e4 3f d5 5b 10 9a 6f b8 63 |....#+..?.[..o.c| +00000020 4c 3c d6 4d 05 c0 08 85 f7 72 72 20 ab 85 8c ff |L<.M.....rr ....| +00000030 f7 bb 95 ab 69 37 3d b6 79 cb 46 ad 4e 22 e7 c6 |....i7=.y.F.N"..| +00000040 a5 9b 72 92 32 ff a5 f7 ed dc 30 41 00 05 00 00 |..r.2.....0A....| +00000050 05 ff 01 00 01 00 16 03 01 02 be 0b 00 02 ba 00 |................| +00000060 02 b7 00 02 b4 30 82 02 b0 30 82 02 19 a0 03 02 |.....0...0......| +00000070 01 02 02 09 00 85 b0 bb a4 8a 7f b8 ca 30 0d 06 |.............0..| +00000080 09 2a 86 48 86 f7 0d 01 01 05 05 00 30 45 31 0b |.*.H........0E1.| +00000090 30 09 06 03 55 04 06 13 02 41 55 31 13 30 11 06 |0...U....AU1.0..| +000000a0 03 55 04 08 13 0a 53 6f 6d 65 2d 53 74 61 74 65 |.U....Some-State| +000000b0 31 21 30 1f 06 03 55 04 0a 13 18 49 6e 74 65 72 |1!0...U....Inter| +000000c0 6e 65 74 20 57 69 64 67 69 74 73 20 50 74 79 20 |net Widgits Pty | +000000d0 4c 74 64 30 1e 17 0d 31 30 30 34 32 34 30 39 30 |Ltd0...100424090| +000000e0 39 33 38 5a 17 0d 31 31 30 34 32 34 30 39 30 39 |938Z..1104240909| +000000f0 33 38 5a 30 45 31 0b 30 09 06 03 55 04 06 13 02 |38Z0E1.0...U....| +00000100 41 55 31 13 30 11 06 03 55 04 08 13 0a 53 6f 6d |AU1.0...U....Som| +00000110 65 2d 53 74 61 74 65 31 21 30 1f 06 03 55 04 0a |e-State1!0...U..| +00000120 13 18 49 6e 74 65 72 6e 65 74 20 57 69 64 67 69 |..Internet Widgi| +00000130 74 73 20 50 74 79 20 4c 74 64 30 81 9f 30 0d 06 |ts Pty Ltd0..0..| +00000140 09 2a 86 48 86 f7 0d 01 01 01 05 00 03 81 8d 00 |.*.H............| +00000150 30 81 89 02 81 81 00 bb 79 d6 f5 17 b5 e5 bf 46 |0.......y......F| +00000160 10 d0 dc 69 be e6 2b 07 43 5a d0 03 2d 8a 7a 43 |...i..+.CZ..-.zC| +00000170 85 b7 14 52 e7 a5 65 4c 2c 78 b8 23 8c b5 b4 82 |...R..eL,x.#....| +00000180 e5 de 1f 95 3b 7e 62 a5 2c a5 33 d6 fe 12 5c 7a |....;~b.,.3...\z| +00000190 56 fc f5 06 bf fa 58 7b 26 3f b5 cd 04 d3 d0 c9 |V.....X{&?......| +000001a0 21 96 4a c7 f4 54 9f 5a bf ef 42 71 00 fe 18 99 |!.J..T.Z..Bq....| +000001b0 07 7f 7e 88 7d 7d f1 04 39 c4 a2 2e db 51 c9 7c |..~.}}..9....Q.|| +000001c0 e3 c0 4c 3b 32 66 01 cf af b1 1d b8 71 9a 1d db |..L;2f......q...| +000001d0 db 89 6b ae da 2d 79 02 03 01 00 01 a3 81 a7 30 |..k..-y........0| +000001e0 81 a4 30 1d 06 03 55 1d 0e 04 16 04 14 b1 ad e2 |..0...U.........| +000001f0 85 5a cf cb 28 db 69 ce 23 69 de d3 26 8e 18 88 |.Z..(.i.#i..&...| +00000200 39 30 75 06 03 55 1d 23 04 6e 30 6c 80 14 b1 ad |90u..U.#.n0l....| +00000210 e2 85 5a cf cb 28 db 69 ce 23 69 de d3 26 8e 18 |..Z..(.i.#i..&..| +00000220 88 39 a1 49 a4 47 30 45 31 0b 30 09 06 03 55 04 |.9.I.G0E1.0...U.| +00000230 06 13 02 41 55 31 13 30 11 06 03 55 04 08 13 0a |...AU1.0...U....| +00000240 53 6f 6d 65 2d 53 74 61 74 65 31 21 30 1f 06 03 |Some-State1!0...| +00000250 55 04 0a 13 18 49 6e 74 65 72 6e 65 74 20 57 69 |U....Internet Wi| +00000260 64 67 69 74 73 20 50 74 79 20 4c 74 64 82 09 00 |dgits Pty Ltd...| +00000270 85 b0 bb a4 8a 7f b8 ca 30 0c 06 03 55 1d 13 04 |........0...U...| +00000280 05 30 03 01 01 ff 30 0d 06 09 2a 86 48 86 f7 0d |.0....0...*.H...| +00000290 01 01 05 05 00 03 81 81 00 08 6c 45 24 c7 6b b1 |..........lE$.k.| +000002a0 59 ab 0c 52 cc f2 b0 14 d7 87 9d 7a 64 75 b5 5a |Y..R.......zdu.Z| +000002b0 95 66 e4 c5 2b 8e ae 12 66 1f eb 4f 38 b3 6e 60 |.f..+...f..O8.n`| +000002c0 d3 92 fd f7 41 08 b5 25 13 b1 18 7a 24 fb 30 1d |....A..%...z$.0.| +000002d0 ba ed 98 b9 17 ec e7 d7 31 59 db 95 d3 1d 78 ea |........1Y....x.| +000002e0 50 56 5c d5 82 5a 2d 5a 5f 33 c4 b6 d8 c9 75 90 |PV\..Z-Z_3....u.| +000002f0 96 8c 0f 52 98 b5 cd 98 1f 89 20 5f f2 a0 1c a3 |...R...... _....| +00000300 1b 96 94 dd a9 fd 57 e9 70 e8 26 6d 71 99 9b 26 |......W.p.&mq..&| +00000310 6e 38 50 29 6c 90 a7 bd d9 16 03 01 00 04 0e 00 |n8P)l...........| +00000320 00 00 |..| +>>> Flow 3 (client to server) +00000000 16 03 01 00 86 10 00 00 82 00 80 6d 51 f3 7f f9 |...........mQ...| +00000010 3e fb 75 82 41 36 83 e8 6a ee 2a 2e 25 90 67 4c |>.u.A6..j.*.%.gL| +00000020 8e 62 2f 30 81 17 e0 85 09 0c 2b b7 23 d7 b0 e2 |.b/0......+.#...| +00000030 1d f7 3b d7 f5 a1 27 b6 ee 24 b6 1b cc 5b ea 66 |..;...'..$...[.f| +00000040 0d 6a f4 e5 85 f9 da 43 b4 0e 86 85 e1 f5 aa be |.j.....C........| +00000050 c8 ce 39 4c 9c 86 00 08 c2 4b e2 c6 ec 2f f7 ce |..9L.....K.../..| +00000060 e6 bd 77 82 6f 23 b6 e0 bd a2 92 b7 3a ac e8 56 |..w.o#......:..V| +00000070 f1 af 54 5e 46 87 e9 3b 33 e7 b8 28 b7 d6 c8 90 |..T^F..;3..(....| +00000080 35 d4 1c 43 d1 30 6f 55 4e 0a 70 14 03 01 00 01 |5..C.0oUN.p.....| +00000090 01 16 03 01 00 24 4d 1d d7 8c d6 c7 65 a6 ce af |.....$M.....e...| +000000a0 e7 59 0d 7e dc d9 96 1c ed 9c 57 94 84 b8 3f b5 |.Y.~......W...?.| +000000b0 34 e1 61 a5 61 f3 5d 09 bc ff |4.a.a.]...| +>>> Flow 4 (server to client) +00000000 14 03 01 00 01 01 16 03 01 00 24 13 81 89 61 5c |..........$...a\| +00000010 fb 0a 9c a1 4b db 94 6b 8b 41 6e 63 d6 aa db 88 |....K..k.Anc....| +00000020 03 b7 b5 19 b8 12 cf 5e 17 54 79 2f 03 91 7e |.......^.Ty/..~| +>>> Flow 5 (client to server) +00000000 17 03 01 00 1a b3 2b da ce 45 ec b2 9d 3b 18 d9 |......+..E...;..| +00000010 7a cb 99 ea ff 4d 91 b5 48 df 6f 8b 2f 85 c7 15 |z....M..H.o./...| +00000020 03 01 00 16 19 1c 72 74 36 cf 22 0f a0 a7 18 96 |......rt6.".....| +00000030 3a 67 cb 22 16 f1 a8 7b 57 37 |:g."...{W7| diff --git a/src/crypto/tls/testdata/Client-TLSv11-ECDHE-ECDSA-AES b/src/crypto/tls/testdata/Client-TLSv11-ECDHE-ECDSA-AES new file mode 100644 index 0000000000000000000000000000000000000000..a4a29306cb7ccd3281f87b758ccbf1829fb2a5c1 --- /dev/null +++ b/src/crypto/tls/testdata/Client-TLSv11-ECDHE-ECDSA-AES @@ -0,0 +1,90 @@ +>>> Flow 1 (client to server) +00000000 16 03 01 00 81 01 00 00 7d 03 03 00 00 00 00 00 |........}.......| +00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| +00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 1e c0 2f |.............../| +00000030 c0 2b c0 30 c0 2c c0 11 c0 07 c0 13 c0 09 c0 14 |.+.0.,..........| +00000040 c0 0a 00 05 00 2f 00 35 c0 12 00 0a 01 00 00 36 |...../.5.......6| +00000050 00 05 00 05 01 00 00 00 00 00 0a 00 08 00 06 00 |................| +00000060 17 00 18 00 19 00 0b 00 02 01 00 00 0d 00 0e 00 |................| +00000070 0c 04 01 04 03 05 01 05 03 02 01 02 03 ff 01 00 |................| +00000080 01 00 00 12 00 00 |......| +>>> Flow 2 (server to client) +00000000 16 03 02 00 59 02 00 00 55 03 02 5a 52 92 23 05 |....Y...U..ZR.#.| +00000010 58 68 b2 1e 77 a2 a8 16 e9 88 85 ea 38 b3 63 c2 |Xh..w.......8.c.| +00000020 40 f8 de 37 3c d4 b9 51 11 2d d1 20 12 fd 95 b3 |@..7<..Q.-. ....| +00000030 2a 54 40 c0 23 3a 4e 4e f6 7b f8 77 04 6e e7 d7 |*T@.#:NN.{.w.n..| +00000040 3b 9a 45 32 e0 af df aa ff bf 78 8b c0 09 00 00 |;.E2......x.....| +00000050 0d ff 01 00 01 00 00 0b 00 04 03 00 01 02 16 03 |................| +00000060 02 02 0e 0b 00 02 0a 00 02 07 00 02 04 30 82 02 |.............0..| +00000070 00 30 82 01 62 02 09 00 b8 bf 2d 47 a0 d2 eb f4 |.0..b.....-G....| +00000080 30 09 06 07 2a 86 48 ce 3d 04 01 30 45 31 0b 30 |0...*.H.=..0E1.0| +00000090 09 06 03 55 04 06 13 02 41 55 31 13 30 11 06 03 |...U....AU1.0...| +000000a0 55 04 08 13 0a 53 6f 6d 65 2d 53 74 61 74 65 31 |U....Some-State1| +000000b0 21 30 1f 06 03 55 04 0a 13 18 49 6e 74 65 72 6e |!0...U....Intern| +000000c0 65 74 20 57 69 64 67 69 74 73 20 50 74 79 20 4c |et Widgits Pty L| +000000d0 74 64 30 1e 17 0d 31 32 31 31 32 32 31 35 30 36 |td0...1211221506| +000000e0 33 32 5a 17 0d 32 32 31 31 32 30 31 35 30 36 33 |32Z..22112015063| +000000f0 32 5a 30 45 31 0b 30 09 06 03 55 04 06 13 02 41 |2Z0E1.0...U....A| +00000100 55 31 13 30 11 06 03 55 04 08 13 0a 53 6f 6d 65 |U1.0...U....Some| +00000110 2d 53 74 61 74 65 31 21 30 1f 06 03 55 04 0a 13 |-State1!0...U...| +00000120 18 49 6e 74 65 72 6e 65 74 20 57 69 64 67 69 74 |.Internet Widgit| +00000130 73 20 50 74 79 20 4c 74 64 30 81 9b 30 10 06 07 |s Pty Ltd0..0...| +00000140 2a 86 48 ce 3d 02 01 06 05 2b 81 04 00 23 03 81 |*.H.=....+...#..| +00000150 86 00 04 00 c4 a1 ed be 98 f9 0b 48 73 36 7e c3 |...........Hs6~.| +00000160 16 56 11 22 f2 3d 53 c3 3b 4d 21 3d cd 6b 75 e6 |.V.".=S.;M!=.ku.| +00000170 f6 b0 dc 9a df 26 c1 bc b2 87 f0 72 32 7c b3 64 |.....&.....r2|.d| +00000180 2f 1c 90 bc ea 68 23 10 7e fe e3 25 c0 48 3a 69 |/....h#.~..%.H:i| +00000190 e0 28 6d d3 37 00 ef 04 62 dd 0d a0 9c 70 62 83 |.(m.7...b....pb.| +000001a0 d8 81 d3 64 31 aa 9e 97 31 bd 96 b0 68 c0 9b 23 |...d1...1...h..#| +000001b0 de 76 64 3f 1a 5c 7f e9 12 0e 58 58 b6 5f 70 dd |.vd?.\....XX._p.| +000001c0 9b d8 ea d5 d7 f5 d5 cc b9 b6 9f 30 66 5b 66 9a |...........0f[f.| +000001d0 20 e2 27 e5 bf fe 3b 30 09 06 07 2a 86 48 ce 3d | .'...;0...*.H.=| +000001e0 04 01 03 81 8c 00 30 81 88 02 42 01 88 a2 4f eb |......0...B...O.| +000001f0 e2 45 c5 48 7d 1b ac f5 ed 98 9d ae 47 70 c0 5e |.E.H}.......Gp.^| +00000200 1b b6 2f bd f1 b6 4d b7 61 40 d3 11 a2 ce ee 0b |../...M.a@......| +00000210 7e 92 7e ff 76 9d c3 3b 7e a5 3f ce fa 10 e2 59 |~.~.v..;~.?....Y| +00000220 ec 47 2d 7c ac da 4e 97 0e 15 a0 6f d0 02 42 01 |.G-|..N....o..B.| +00000230 4d fc be 67 13 9c 2d 05 0e bd 3f a3 8c 25 c1 33 |M..g..-...?..%.3| +00000240 13 83 0d 94 06 bb d4 37 7a f6 ec 7a c9 86 2e dd |.......7z..z....| +00000250 d7 11 69 7f 85 7c 56 de fb 31 78 2b e4 c7 78 0d |..i..|V..1x+..x.| +00000260 ae cb be 9e 4e 36 24 31 7b 6a 0f 39 95 12 07 8f |....N6$1{j.9....| +00000270 2a 16 03 02 00 d5 0c 00 00 d1 03 00 17 41 04 c3 |*............A..| +00000280 55 86 65 95 83 02 4b 69 6e 95 f4 52 46 83 21 86 |U.e...Kin..RF.!.| +00000290 9e 99 cf 81 d9 b8 20 7a 87 b3 07 48 14 04 20 d9 |...... z...H.. .| +000002a0 6c 2e 22 5a b5 b4 ef de 15 b3 08 ef 1e 18 ea 67 |l."Z...........g| +000002b0 eb 45 fd e1 27 43 ed 41 ea 05 7e f3 f9 ee 23 00 |.E..'C.A..~...#.| +000002c0 8a 30 81 87 02 42 00 b0 9c 06 85 83 b2 bf 42 22 |.0...B........B"| +000002d0 6e 57 7a 31 fe a9 d9 28 be 0a a9 80 49 a2 14 c1 |nWz1...(....I...| +000002e0 a9 99 76 b7 f9 76 d0 3c d3 0c c7 42 34 d7 94 a9 |..v..v.<...B4...| +000002f0 15 66 7e 6b 83 6e b2 b4 5b 22 c9 4e a0 96 db 2b |.f~k.n..[".N...+| +00000300 ad 77 33 1e 4a 5c 2f 2e 02 41 26 0c 1a 5a b4 07 |.w3.J\/..A&..Z..| +00000310 95 99 ec 0b 5b 2e bb db 0e d5 26 c4 b3 eb c2 30 |....[.....&....0| +00000320 b0 7b c1 07 97 a0 99 3f db 4e b0 c4 b8 bb 5e be |.{.....?.N....^.| +00000330 2a e4 b3 a4 5c ad d1 d7 7a 2d fb ae 73 ee 0c 1e |*...\...z-..s...| +00000340 3b 64 e1 74 14 bc c0 1e 8b f3 26 16 03 02 00 04 |;d.t......&.....| +00000350 0e 00 00 00 |....| +>>> Flow 3 (client to server) +00000000 16 03 02 00 46 10 00 00 42 41 04 1e 18 37 ef 0d |....F...BA...7..| +00000010 19 51 88 35 75 71 b5 e5 54 5b 12 2e 8f 09 67 fd |.Q.5uq..T[....g.| +00000020 a7 24 20 3e b2 56 1c ce 97 28 5e f8 2b 2d 4f 9e |.$ >.V...(^.+-O.| +00000030 f1 07 9f 6c 4b 5b 83 56 e2 32 42 e9 58 b6 d7 49 |...lK[.V.2B.X..I| +00000040 a6 b5 68 1a 41 03 56 6b dc 5a 89 14 03 02 00 01 |..h.A.Vk.Z......| +00000050 01 16 03 02 00 40 00 00 00 00 00 00 00 00 00 00 |.....@..........| +00000060 00 00 00 00 00 00 33 07 8a af e1 94 ef f9 08 3a |......3........:| +00000070 33 5f b3 e6 42 07 85 af 40 e2 8b 34 53 62 1a 10 |3_..B...@..4Sb..| +00000080 bb 08 7e 75 d4 21 12 2d 54 87 33 1c 4e 13 27 72 |..~u.!.-T.3.N.'r| +00000090 3f 9e 9f cc de 47 |?....G| +>>> Flow 4 (server to client) +00000000 14 03 02 00 01 01 16 03 02 00 40 4f 47 0d 43 54 |..........@OG.CT| +00000010 50 69 3a c8 21 a6 6e 28 78 cc 01 b4 5d eb f7 2b |Pi:.!.n(x...]..+| +00000020 8b 7e 26 6e cf 56 98 65 ad bf 0f a0 b4 67 13 70 |.~&n.V.e.....g.p| +00000030 de b5 b5 91 df d6 df 8c 53 c6 54 3d 5d 98 e4 25 |........S.T=]..%| +00000040 47 a0 0f 91 c7 08 96 17 48 bd 0f |G.......H..| +>>> Flow 5 (client to server) +00000000 17 03 02 00 30 00 00 00 00 00 00 00 00 00 00 00 |....0...........| +00000010 00 00 00 00 00 4e fe 12 d7 4b d7 3f 86 5a 2c f6 |.....N...K.?.Z,.| +00000020 86 03 2a bd 1a 98 d7 bb 9f 59 6c 6d 4d 57 b0 50 |..*......YlmMW.P| +00000030 d6 97 7e d4 b6 15 03 02 00 30 00 00 00 00 00 00 |..~......0......| +00000040 00 00 00 00 00 00 00 00 00 00 65 8b b5 ae 86 90 |..........e.....| +00000050 00 4e 1e 3f bc ac ed 49 f4 5e 73 49 e6 d8 37 83 |.N.?...I.^sI..7.| +00000060 cf 4f e5 7b 5e c9 1d c8 c9 dc |.O.{^.....| diff --git a/src/crypto/tls/testdata/Client-TLSv11-ECDHE-RSA-AES b/src/crypto/tls/testdata/Client-TLSv11-ECDHE-RSA-AES new file mode 100644 index 0000000000000000000000000000000000000000..103f1d8a11d1d3a3d8c42b3630d8caf3563e3ccf --- /dev/null +++ b/src/crypto/tls/testdata/Client-TLSv11-ECDHE-RSA-AES @@ -0,0 +1,100 @@ +>>> Flow 1 (client to server) +00000000 16 03 01 00 81 01 00 00 7d 03 03 00 00 00 00 00 |........}.......| +00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| +00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 1e c0 2f |.............../| +00000030 c0 2b c0 30 c0 2c c0 11 c0 07 c0 13 c0 09 c0 14 |.+.0.,..........| +00000040 c0 0a 00 05 00 2f 00 35 c0 12 00 0a 01 00 00 36 |...../.5.......6| +00000050 00 05 00 05 01 00 00 00 00 00 0a 00 08 00 06 00 |................| +00000060 17 00 18 00 19 00 0b 00 02 01 00 00 0d 00 0e 00 |................| +00000070 0c 04 01 04 03 05 01 05 03 02 01 02 03 ff 01 00 |................| +00000080 01 00 00 12 00 00 |......| +>>> Flow 2 (server to client) +00000000 16 03 02 00 59 02 00 00 55 03 02 e3 ed 49 27 a3 |....Y...U....I'.| +00000010 28 c5 8c 30 27 c2 ed 57 9b f7 37 a1 6d 2b 88 c2 |(..0'..W..7.m+..| +00000020 df a7 2d 01 01 00 9a 09 da c2 1f 20 ee 33 87 03 |..-........ .3..| +00000030 28 93 1c 16 99 5b b1 e0 bf 87 e8 77 4a 72 c9 92 |(....[.....wJr..| +00000040 8a bc b2 3e 24 e1 f6 e8 f4 3f a2 24 c0 13 00 00 |...>$....?.$....| +00000050 0d ff 01 00 01 00 00 0b 00 04 03 00 01 02 16 03 |................| +00000060 02 02 be 0b 00 02 ba 00 02 b7 00 02 b4 30 82 02 |.............0..| +00000070 b0 30 82 02 19 a0 03 02 01 02 02 09 00 85 b0 bb |.0..............| +00000080 a4 8a 7f b8 ca 30 0d 06 09 2a 86 48 86 f7 0d 01 |.....0...*.H....| +00000090 01 05 05 00 30 45 31 0b 30 09 06 03 55 04 06 13 |....0E1.0...U...| +000000a0 02 41 55 31 13 30 11 06 03 55 04 08 13 0a 53 6f |.AU1.0...U....So| +000000b0 6d 65 2d 53 74 61 74 65 31 21 30 1f 06 03 55 04 |me-State1!0...U.| +000000c0 0a 13 18 49 6e 74 65 72 6e 65 74 20 57 69 64 67 |...Internet Widg| +000000d0 69 74 73 20 50 74 79 20 4c 74 64 30 1e 17 0d 31 |its Pty Ltd0...1| +000000e0 30 30 34 32 34 30 39 30 39 33 38 5a 17 0d 31 31 |00424090938Z..11| +000000f0 30 34 32 34 30 39 30 39 33 38 5a 30 45 31 0b 30 |0424090938Z0E1.0| +00000100 09 06 03 55 04 06 13 02 41 55 31 13 30 11 06 03 |...U....AU1.0...| +00000110 55 04 08 13 0a 53 6f 6d 65 2d 53 74 61 74 65 31 |U....Some-State1| +00000120 21 30 1f 06 03 55 04 0a 13 18 49 6e 74 65 72 6e |!0...U....Intern| +00000130 65 74 20 57 69 64 67 69 74 73 20 50 74 79 20 4c |et Widgits Pty L| +00000140 74 64 30 81 9f 30 0d 06 09 2a 86 48 86 f7 0d 01 |td0..0...*.H....| +00000150 01 01 05 00 03 81 8d 00 30 81 89 02 81 81 00 bb |........0.......| +00000160 79 d6 f5 17 b5 e5 bf 46 10 d0 dc 69 be e6 2b 07 |y......F...i..+.| +00000170 43 5a d0 03 2d 8a 7a 43 85 b7 14 52 e7 a5 65 4c |CZ..-.zC...R..eL| +00000180 2c 78 b8 23 8c b5 b4 82 e5 de 1f 95 3b 7e 62 a5 |,x.#........;~b.| +00000190 2c a5 33 d6 fe 12 5c 7a 56 fc f5 06 bf fa 58 7b |,.3...\zV.....X{| +000001a0 26 3f b5 cd 04 d3 d0 c9 21 96 4a c7 f4 54 9f 5a |&?......!.J..T.Z| +000001b0 bf ef 42 71 00 fe 18 99 07 7f 7e 88 7d 7d f1 04 |..Bq......~.}}..| +000001c0 39 c4 a2 2e db 51 c9 7c e3 c0 4c 3b 32 66 01 cf |9....Q.|..L;2f..| +000001d0 af b1 1d b8 71 9a 1d db db 89 6b ae da 2d 79 02 |....q.....k..-y.| +000001e0 03 01 00 01 a3 81 a7 30 81 a4 30 1d 06 03 55 1d |.......0..0...U.| +000001f0 0e 04 16 04 14 b1 ad e2 85 5a cf cb 28 db 69 ce |.........Z..(.i.| +00000200 23 69 de d3 26 8e 18 88 39 30 75 06 03 55 1d 23 |#i..&...90u..U.#| +00000210 04 6e 30 6c 80 14 b1 ad e2 85 5a cf cb 28 db 69 |.n0l......Z..(.i| +00000220 ce 23 69 de d3 26 8e 18 88 39 a1 49 a4 47 30 45 |.#i..&...9.I.G0E| +00000230 31 0b 30 09 06 03 55 04 06 13 02 41 55 31 13 30 |1.0...U....AU1.0| +00000240 11 06 03 55 04 08 13 0a 53 6f 6d 65 2d 53 74 61 |...U....Some-Sta| +00000250 74 65 31 21 30 1f 06 03 55 04 0a 13 18 49 6e 74 |te1!0...U....Int| +00000260 65 72 6e 65 74 20 57 69 64 67 69 74 73 20 50 74 |ernet Widgits Pt| +00000270 79 20 4c 74 64 82 09 00 85 b0 bb a4 8a 7f b8 ca |y Ltd...........| +00000280 30 0c 06 03 55 1d 13 04 05 30 03 01 01 ff 30 0d |0...U....0....0.| +00000290 06 09 2a 86 48 86 f7 0d 01 01 05 05 00 03 81 81 |..*.H...........| +000002a0 00 08 6c 45 24 c7 6b b1 59 ab 0c 52 cc f2 b0 14 |..lE$.k.Y..R....| +000002b0 d7 87 9d 7a 64 75 b5 5a 95 66 e4 c5 2b 8e ae 12 |...zdu.Z.f..+...| +000002c0 66 1f eb 4f 38 b3 6e 60 d3 92 fd f7 41 08 b5 25 |f..O8.n`....A..%| +000002d0 13 b1 18 7a 24 fb 30 1d ba ed 98 b9 17 ec e7 d7 |...z$.0.........| +000002e0 31 59 db 95 d3 1d 78 ea 50 56 5c d5 82 5a 2d 5a |1Y....x.PV\..Z-Z| +000002f0 5f 33 c4 b6 d8 c9 75 90 96 8c 0f 52 98 b5 cd 98 |_3....u....R....| +00000300 1f 89 20 5f f2 a0 1c a3 1b 96 94 dd a9 fd 57 e9 |.. _..........W.| +00000310 70 e8 26 6d 71 99 9b 26 6e 38 50 29 6c 90 a7 bd |p.&mq..&n8P)l...| +00000320 d9 16 03 02 00 cb 0c 00 00 c7 03 00 17 41 04 f7 |.............A..| +00000330 75 c1 b9 58 a0 7d 50 48 e9 85 79 db 89 76 4c d7 |u..X.}PH..y..vL.| +00000340 84 5b 94 9a 15 d8 92 32 74 d2 3e ce 76 5a bd 0e |.[.....2t.>.vZ..| +00000350 24 e7 a6 d0 77 5d 8e 3d 9f 94 7a ea 15 46 3c 5c |$...w].=..z..F<\| +00000360 61 28 76 4a ff 81 97 2b 3a 0c b7 aa b4 0e cb 00 |a(vJ...+:.......| +00000370 80 19 00 a8 fe 0a ea 35 30 51 a3 77 37 08 68 10 |.......50Q.w7.h.| +00000380 5a e9 07 2d 83 67 77 4c 3a 25 14 1c 5b c1 2e 80 |Z..-.gwL:%..[...| +00000390 30 6d ba 26 c1 f9 c6 3e fc 55 34 8c d2 9f 2b a6 |0m.&...>.U4...+.| +000003a0 46 0c 9d 58 2c 9c 2b ce 6f 03 d7 49 4e df 21 ce |F..X,.+.o..IN.!.| +000003b0 3f 8b 19 fe 3e 71 23 51 c3 ec 30 c8 3e 3c 3c 50 |?...>q#Q..0.><>> Flow 3 (client to server) +00000000 16 03 02 00 46 10 00 00 42 41 04 1e 18 37 ef 0d |....F...BA...7..| +00000010 19 51 88 35 75 71 b5 e5 54 5b 12 2e 8f 09 67 fd |.Q.5uq..T[....g.| +00000020 a7 24 20 3e b2 56 1c ce 97 28 5e f8 2b 2d 4f 9e |.$ >.V...(^.+-O.| +00000030 f1 07 9f 6c 4b 5b 83 56 e2 32 42 e9 58 b6 d7 49 |...lK[.V.2B.X..I| +00000040 a6 b5 68 1a 41 03 56 6b dc 5a 89 14 03 02 00 01 |..h.A.Vk.Z......| +00000050 01 16 03 02 00 40 00 00 00 00 00 00 00 00 00 00 |.....@..........| +00000060 00 00 00 00 00 00 1e 0b cd 40 fa 0f ed fa 55 74 |.........@....Ut| +00000070 4e ad 10 d1 b5 e1 41 8c c0 93 81 38 f3 83 f1 37 |N.....A....8...7| +00000080 6a d4 6c ea ba 5b 9e 38 d3 c1 bb 41 45 fb f0 48 |j.l..[.8...AE..H| +00000090 c1 06 31 64 e0 65 |..1d.e| +>>> Flow 4 (server to client) +00000000 14 03 02 00 01 01 16 03 02 00 40 17 d1 79 f8 e0 |..........@..y..| +00000010 d4 40 15 85 df 4d a6 d5 60 90 1f d6 52 58 e7 ae |.@...M..`...RX..| +00000020 05 eb a2 ea ed c9 be ae b5 54 39 de 05 66 27 67 |.........T9..f'g| +00000030 59 07 03 e7 10 f9 3f da d8 85 8b 2f 7b 33 9f f5 |Y.....?..../{3..| +00000040 43 50 b9 9c 6e dd 01 ae d8 c9 1d |CP..n......| +>>> Flow 5 (client to server) +00000000 17 03 02 00 30 00 00 00 00 00 00 00 00 00 00 00 |....0...........| +00000010 00 00 00 00 00 65 81 63 71 55 1c 46 8a 60 46 d9 |.....e.cqU.F.`F.| +00000020 7d 71 a2 62 b8 a8 3b 06 3d a2 f4 53 a4 46 a8 9e |}q.b..;.=..S.F..| +00000030 b7 89 8a 42 ce 15 03 02 00 30 00 00 00 00 00 00 |...B.....0......| +00000040 00 00 00 00 00 00 00 00 00 00 7a 78 a4 e7 2f 40 |..........zx../@| +00000050 df 42 9b 76 7a 45 0a 86 40 af 3c 40 c6 69 ba e1 |.B.vzE..@.<@.i..| +00000060 23 82 fa 44 fd 73 fc 5b f7 b9 |#..D.s.[..| diff --git a/src/crypto/tls/testdata/Client-TLSv11-RSA-RC4 b/src/crypto/tls/testdata/Client-TLSv11-RSA-RC4 new file mode 100644 index 0000000000000000000000000000000000000000..729391f68ca4945720fa9e49d84b6ff4972ec85a --- /dev/null +++ b/src/crypto/tls/testdata/Client-TLSv11-RSA-RC4 @@ -0,0 +1,84 @@ +>>> Flow 1 (client to server) +00000000 16 03 01 00 81 01 00 00 7d 03 03 00 00 00 00 00 |........}.......| +00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| +00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 1e c0 2f |.............../| +00000030 c0 2b c0 30 c0 2c c0 11 c0 07 c0 13 c0 09 c0 14 |.+.0.,..........| +00000040 c0 0a 00 05 00 2f 00 35 c0 12 00 0a 01 00 00 36 |...../.5.......6| +00000050 00 05 00 05 01 00 00 00 00 00 0a 00 08 00 06 00 |................| +00000060 17 00 18 00 19 00 0b 00 02 01 00 00 0d 00 0e 00 |................| +00000070 0c 04 01 04 03 05 01 05 03 02 01 02 03 ff 01 00 |................| +00000080 01 00 00 12 00 00 |......| +>>> Flow 2 (server to client) +00000000 16 03 02 00 51 02 00 00 4d 03 02 7e 38 ae 3c 50 |....Q...M..~8.>> Flow 3 (client to server) +00000000 16 03 02 00 86 10 00 00 82 00 80 6d 51 f3 7f f9 |...........mQ...| +00000010 3e fb 75 82 41 36 83 e8 6a ee 2a 2e 25 90 67 4c |>.u.A6..j.*.%.gL| +00000020 8e 62 2f 30 81 17 e0 85 09 0c 2b b7 23 d7 b0 e2 |.b/0......+.#...| +00000030 1d f7 3b d7 f5 a1 27 b6 ee 24 b6 1b cc 5b ea 66 |..;...'..$...[.f| +00000040 0d 6a f4 e5 85 f9 da 43 b4 0e 86 85 e1 f5 aa be |.j.....C........| +00000050 c8 ce 39 4c 9c 86 00 08 c2 4b e2 c6 ec 2f f7 ce |..9L.....K.../..| +00000060 e6 bd 77 82 6f 23 b6 e0 bd a2 92 b7 3a ac e8 56 |..w.o#......:..V| +00000070 f1 af 54 5e 46 87 e9 3b 33 e7 b8 28 b7 d6 c8 90 |..T^F..;3..(....| +00000080 35 d4 1c 43 d1 30 6f 55 4e 0a 70 14 03 02 00 01 |5..C.0oUN.p.....| +00000090 01 16 03 02 00 24 b9 df 85 a1 6d a7 14 b5 bc f5 |.....$....m.....| +000000a0 c2 1d 40 fc 1e 19 f2 36 2d ec 6b 59 c5 6d ae c7 |..@....6-.kY.m..| +000000b0 1c ad 7e a3 5b 4d 12 e5 58 5a |..~.[M..XZ| +>>> Flow 4 (server to client) +00000000 14 03 02 00 01 01 16 03 02 00 24 a3 f3 22 a8 32 |..........$..".2| +00000010 63 c3 88 5c 0f fb 2d 47 21 0d 62 e2 db aa ed ae |c..\..-G!.b.....| +00000020 b6 5f e3 c8 98 fc 91 5e 04 83 cf c3 21 17 ce |._.....^....!..| +>>> Flow 5 (client to server) +00000000 17 03 02 00 1a f1 e4 46 c7 14 91 4b c6 25 fd aa |.......F...K.%..| +00000010 5d dd 3f 61 ac 9c 79 68 bc e6 0f a1 e4 f3 73 15 |].?a..yh......s.| +00000020 03 02 00 16 6b 8d 23 3c 99 b4 c2 23 3c 27 fd 41 |....k.#<...#<'.A| +00000030 cc 04 e5 fc e7 f9 d9 81 0a b8 |..........| diff --git a/src/crypto/tls/testdata/Client-TLSv12-ALPN b/src/crypto/tls/testdata/Client-TLSv12-ALPN new file mode 100644 index 0000000000000000000000000000000000000000..9ecb065f09218b7d53f832181b4a78954712e016 --- /dev/null +++ b/src/crypto/tls/testdata/Client-TLSv12-ALPN @@ -0,0 +1,97 @@ +>>> Flow 1 (client to server) +00000000 16 03 01 00 99 01 00 00 95 03 03 00 00 00 00 00 |................| +00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| +00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 1e c0 2f |.............../| +00000030 c0 2b c0 30 c0 2c c0 11 c0 07 c0 13 c0 09 c0 14 |.+.0.,..........| +00000040 c0 0a 00 05 00 2f 00 35 c0 12 00 0a 01 00 00 4e |...../.5.......N| +00000050 33 74 00 00 00 05 00 05 01 00 00 00 00 00 0a 00 |3t..............| +00000060 08 00 06 00 17 00 18 00 19 00 0b 00 02 01 00 00 |................| +00000070 0d 00 0e 00 0c 04 01 04 03 05 01 05 03 02 01 02 |................| +00000080 03 ff 01 00 01 00 00 10 00 10 00 0e 06 70 72 6f |.............pro| +00000090 74 6f 32 06 70 72 6f 74 6f 31 00 12 00 00 |to2.proto1....| +>>> Flow 2 (server to client) +00000000 16 03 03 00 66 02 00 00 62 03 03 56 83 34 0f 9e |....f...b..V.4..| +00000010 dd 02 1c 4f 4f 09 d0 2c df e6 c1 d2 4a c0 6a e7 |...OO..,....J.j.| +00000020 1e 65 51 c2 42 01 05 70 4a 6c 97 20 0f a8 fb d8 |.eQ.B..pJl. ....| +00000030 2f 0f 75 21 17 f8 dd 63 28 4a 18 f6 b1 e5 6f 7c |/.u!...c(J....o|| +00000040 1d 09 d4 13 bf 66 3a bd c5 48 14 fc c0 2f 00 00 |.....f:..H.../..| +00000050 1a ff 01 00 01 00 00 0b 00 04 03 00 01 02 00 10 |................| +00000060 00 09 00 07 06 70 72 6f 74 6f 31 16 03 03 02 be |.....proto1.....| +00000070 0b 00 02 ba 00 02 b7 00 02 b4 30 82 02 b0 30 82 |..........0...0.| +00000080 02 19 a0 03 02 01 02 02 09 00 85 b0 bb a4 8a 7f |................| +00000090 b8 ca 30 0d 06 09 2a 86 48 86 f7 0d 01 01 05 05 |..0...*.H.......| +000000a0 00 30 45 31 0b 30 09 06 03 55 04 06 13 02 41 55 |.0E1.0...U....AU| +000000b0 31 13 30 11 06 03 55 04 08 13 0a 53 6f 6d 65 2d |1.0...U....Some-| +000000c0 53 74 61 74 65 31 21 30 1f 06 03 55 04 0a 13 18 |State1!0...U....| +000000d0 49 6e 74 65 72 6e 65 74 20 57 69 64 67 69 74 73 |Internet Widgits| +000000e0 20 50 74 79 20 4c 74 64 30 1e 17 0d 31 30 30 34 | Pty Ltd0...1004| +000000f0 32 34 30 39 30 39 33 38 5a 17 0d 31 31 30 34 32 |24090938Z..11042| +00000100 34 30 39 30 39 33 38 5a 30 45 31 0b 30 09 06 03 |4090938Z0E1.0...| +00000110 55 04 06 13 02 41 55 31 13 30 11 06 03 55 04 08 |U....AU1.0...U..| +00000120 13 0a 53 6f 6d 65 2d 53 74 61 74 65 31 21 30 1f |..Some-State1!0.| +00000130 06 03 55 04 0a 13 18 49 6e 74 65 72 6e 65 74 20 |..U....Internet | +00000140 57 69 64 67 69 74 73 20 50 74 79 20 4c 74 64 30 |Widgits Pty Ltd0| +00000150 81 9f 30 0d 06 09 2a 86 48 86 f7 0d 01 01 01 05 |..0...*.H.......| +00000160 00 03 81 8d 00 30 81 89 02 81 81 00 bb 79 d6 f5 |.....0.......y..| +00000170 17 b5 e5 bf 46 10 d0 dc 69 be e6 2b 07 43 5a d0 |....F...i..+.CZ.| +00000180 03 2d 8a 7a 43 85 b7 14 52 e7 a5 65 4c 2c 78 b8 |.-.zC...R..eL,x.| +00000190 23 8c b5 b4 82 e5 de 1f 95 3b 7e 62 a5 2c a5 33 |#........;~b.,.3| +000001a0 d6 fe 12 5c 7a 56 fc f5 06 bf fa 58 7b 26 3f b5 |...\zV.....X{&?.| +000001b0 cd 04 d3 d0 c9 21 96 4a c7 f4 54 9f 5a bf ef 42 |.....!.J..T.Z..B| +000001c0 71 00 fe 18 99 07 7f 7e 88 7d 7d f1 04 39 c4 a2 |q......~.}}..9..| +000001d0 2e db 51 c9 7c e3 c0 4c 3b 32 66 01 cf af b1 1d |..Q.|..L;2f.....| +000001e0 b8 71 9a 1d db db 89 6b ae da 2d 79 02 03 01 00 |.q.....k..-y....| +000001f0 01 a3 81 a7 30 81 a4 30 1d 06 03 55 1d 0e 04 16 |....0..0...U....| +00000200 04 14 b1 ad e2 85 5a cf cb 28 db 69 ce 23 69 de |......Z..(.i.#i.| +00000210 d3 26 8e 18 88 39 30 75 06 03 55 1d 23 04 6e 30 |.&...90u..U.#.n0| +00000220 6c 80 14 b1 ad e2 85 5a cf cb 28 db 69 ce 23 69 |l......Z..(.i.#i| +00000230 de d3 26 8e 18 88 39 a1 49 a4 47 30 45 31 0b 30 |..&...9.I.G0E1.0| +00000240 09 06 03 55 04 06 13 02 41 55 31 13 30 11 06 03 |...U....AU1.0...| +00000250 55 04 08 13 0a 53 6f 6d 65 2d 53 74 61 74 65 31 |U....Some-State1| +00000260 21 30 1f 06 03 55 04 0a 13 18 49 6e 74 65 72 6e |!0...U....Intern| +00000270 65 74 20 57 69 64 67 69 74 73 20 50 74 79 20 4c |et Widgits Pty L| +00000280 74 64 82 09 00 85 b0 bb a4 8a 7f b8 ca 30 0c 06 |td...........0..| +00000290 03 55 1d 13 04 05 30 03 01 01 ff 30 0d 06 09 2a |.U....0....0...*| +000002a0 86 48 86 f7 0d 01 01 05 05 00 03 81 81 00 08 6c |.H.............l| +000002b0 45 24 c7 6b b1 59 ab 0c 52 cc f2 b0 14 d7 87 9d |E$.k.Y..R.......| +000002c0 7a 64 75 b5 5a 95 66 e4 c5 2b 8e ae 12 66 1f eb |zdu.Z.f..+...f..| +000002d0 4f 38 b3 6e 60 d3 92 fd f7 41 08 b5 25 13 b1 18 |O8.n`....A..%...| +000002e0 7a 24 fb 30 1d ba ed 98 b9 17 ec e7 d7 31 59 db |z$.0.........1Y.| +000002f0 95 d3 1d 78 ea 50 56 5c d5 82 5a 2d 5a 5f 33 c4 |...x.PV\..Z-Z_3.| +00000300 b6 d8 c9 75 90 96 8c 0f 52 98 b5 cd 98 1f 89 20 |...u....R...... | +00000310 5f f2 a0 1c a3 1b 96 94 dd a9 fd 57 e9 70 e8 26 |_..........W.p.&| +00000320 6d 71 99 9b 26 6e 38 50 29 6c 90 a7 bd d9 16 03 |mq..&n8P)l......| +00000330 03 00 cd 0c 00 00 c9 03 00 17 41 04 85 b7 f7 7c |..........A....|| +00000340 49 4e 97 14 07 51 bc 56 2d 3f cf 1d 29 08 ac 6a |IN...Q.V-?..)..j| +00000350 b4 e7 0d 62 d8 fd 4d 03 29 0d f8 6c 36 6f 4d 5f |...b..M.)..l6oM_| +00000360 b7 5a 8e 37 3e c2 d9 dc f4 15 52 e9 87 71 0f e5 |.Z.7>.....R..q..| +00000370 4e a6 88 0e 54 35 e0 8b 50 91 e1 c4 04 01 00 80 |N...T5..P.......| +00000380 51 eb f8 d6 52 ba f5 b5 0a 22 5f 91 fe f7 ee 43 |Q...R...."_....C| +00000390 f8 af 52 b6 27 2c fc 14 e2 fb 41 61 ff 7c b9 be |..R.',....Aa.|..| +000003a0 f9 78 be dc 18 32 8c 4d ef 46 c0 5a a7 91 6a 1b |.x...2.M.F.Z..j.| +000003b0 47 78 46 39 47 81 8a 2d b4 cb fd bb 44 3e a7 b7 |GxF9G..-....D>..| +000003c0 cc 4e df 17 7b 2b 38 49 fa 9d 9f 4e cd ed f2 16 |.N..{+8I...N....| +000003d0 03 d9 68 cf c9 5a 08 32 f8 ed 02 30 54 61 f6 c0 |..h..Z.2...0Ta..| +000003e0 f6 78 bc ad 04 9c 8e 90 7d 3d f5 35 86 aa 6e e9 |.x......}=.5..n.| +000003f0 a2 9a d3 86 27 9f 2d 6e ea 6e ad 82 0e aa ef 97 |....'.-n.n......| +00000400 16 03 03 00 04 0e 00 00 00 |.........| +>>> Flow 3 (client to server) +00000000 16 03 03 00 46 10 00 00 42 41 04 1e 18 37 ef 0d |....F...BA...7..| +00000010 19 51 88 35 75 71 b5 e5 54 5b 12 2e 8f 09 67 fd |.Q.5uq..T[....g.| +00000020 a7 24 20 3e b2 56 1c ce 97 28 5e f8 2b 2d 4f 9e |.$ >.V...(^.+-O.| +00000030 f1 07 9f 6c 4b 5b 83 56 e2 32 42 e9 58 b6 d7 49 |...lK[.V.2B.X..I| +00000040 a6 b5 68 1a 41 03 56 6b dc 5a 89 14 03 03 00 01 |..h.A.Vk.Z......| +00000050 01 16 03 03 00 28 00 00 00 00 00 00 00 00 47 18 |.....(........G.| +00000060 39 03 93 d9 5b 27 29 70 52 68 15 79 f2 60 e6 58 |9...[')pRh.y.`.X| +00000070 d9 98 cd ce a1 8f 4d ee 2c f0 34 9f fa 73 |......M.,.4..s| +>>> Flow 4 (server to client) +00000000 14 03 03 00 01 01 16 03 03 00 28 39 76 15 70 f1 |..........(9v.p.| +00000010 73 c9 9a 1e 76 40 bc de de 49 be 3e 10 4d 6a 42 |s...v@...I.>.MjB| +00000020 1b 9b bd 07 6b 19 ff f9 2c 19 3c c8 e7 06 fa c8 |....k...,.<.....| +00000030 3d 52 b4 |=R.| +>>> Flow 5 (client to server) +00000000 17 03 03 00 1e 00 00 00 00 00 00 00 01 14 96 ec |................| +00000010 f4 bb ae 45 81 0c 39 10 e2 3a 91 51 04 2c 01 a8 |...E..9..:.Q.,..| +00000020 8b a3 25 15 03 03 00 1a 00 00 00 00 00 00 00 02 |..%.............| +00000030 fe 1a 53 01 17 ad a1 30 0a 73 17 9f 39 b4 30 ac |..S....0.s..9.0.| +00000040 91 ee |..| diff --git a/src/crypto/tls/testdata/Client-TLSv12-ALPN-NoMatch b/src/crypto/tls/testdata/Client-TLSv12-ALPN-NoMatch new file mode 100644 index 0000000000000000000000000000000000000000..a22ffaeb499ab6c9d2774ac19420947c35f1d851 --- /dev/null +++ b/src/crypto/tls/testdata/Client-TLSv12-ALPN-NoMatch @@ -0,0 +1,96 @@ +>>> Flow 1 (client to server) +00000000 16 03 01 00 92 01 00 00 8e 03 03 00 00 00 00 00 |................| +00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| +00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 1e c0 2f |.............../| +00000030 c0 2b c0 30 c0 2c c0 11 c0 07 c0 13 c0 09 c0 14 |.+.0.,..........| +00000040 c0 0a 00 05 00 2f 00 35 c0 12 00 0a 01 00 00 47 |...../.5.......G| +00000050 33 74 00 00 00 05 00 05 01 00 00 00 00 00 0a 00 |3t..............| +00000060 08 00 06 00 17 00 18 00 19 00 0b 00 02 01 00 00 |................| +00000070 0d 00 0e 00 0c 04 01 04 03 05 01 05 03 02 01 02 |................| +00000080 03 ff 01 00 01 00 00 10 00 09 00 07 06 70 72 6f |.............pro| +00000090 74 6f 33 00 12 00 00 |to3....| +>>> Flow 2 (server to client) +00000000 16 03 03 00 59 02 00 00 55 03 03 94 d7 79 73 82 |....Y...U....ys.| +00000010 87 7c 85 6e 8a 1b 7d bf 69 c9 98 0c 44 bd f6 78 |.|.n..}.i...D..x| +00000020 d2 80 dc d8 7d 80 bb 91 4b d4 ed 20 fe 9f 2f 7b |....}...K.. ../{| +00000030 f2 1a 44 36 cd ce af f1 b5 01 8a ac 18 e4 2b 23 |..D6..........+#| +00000040 a8 ab 1a 32 23 8b 0b e2 81 a8 0a 40 c0 2f 00 00 |...2#......@./..| +00000050 0d ff 01 00 01 00 00 0b 00 04 03 00 01 02 16 03 |................| +00000060 03 02 be 0b 00 02 ba 00 02 b7 00 02 b4 30 82 02 |.............0..| +00000070 b0 30 82 02 19 a0 03 02 01 02 02 09 00 85 b0 bb |.0..............| +00000080 a4 8a 7f b8 ca 30 0d 06 09 2a 86 48 86 f7 0d 01 |.....0...*.H....| +00000090 01 05 05 00 30 45 31 0b 30 09 06 03 55 04 06 13 |....0E1.0...U...| +000000a0 02 41 55 31 13 30 11 06 03 55 04 08 13 0a 53 6f |.AU1.0...U....So| +000000b0 6d 65 2d 53 74 61 74 65 31 21 30 1f 06 03 55 04 |me-State1!0...U.| +000000c0 0a 13 18 49 6e 74 65 72 6e 65 74 20 57 69 64 67 |...Internet Widg| +000000d0 69 74 73 20 50 74 79 20 4c 74 64 30 1e 17 0d 31 |its Pty Ltd0...1| +000000e0 30 30 34 32 34 30 39 30 39 33 38 5a 17 0d 31 31 |00424090938Z..11| +000000f0 30 34 32 34 30 39 30 39 33 38 5a 30 45 31 0b 30 |0424090938Z0E1.0| +00000100 09 06 03 55 04 06 13 02 41 55 31 13 30 11 06 03 |...U....AU1.0...| +00000110 55 04 08 13 0a 53 6f 6d 65 2d 53 74 61 74 65 31 |U....Some-State1| +00000120 21 30 1f 06 03 55 04 0a 13 18 49 6e 74 65 72 6e |!0...U....Intern| +00000130 65 74 20 57 69 64 67 69 74 73 20 50 74 79 20 4c |et Widgits Pty L| +00000140 74 64 30 81 9f 30 0d 06 09 2a 86 48 86 f7 0d 01 |td0..0...*.H....| +00000150 01 01 05 00 03 81 8d 00 30 81 89 02 81 81 00 bb |........0.......| +00000160 79 d6 f5 17 b5 e5 bf 46 10 d0 dc 69 be e6 2b 07 |y......F...i..+.| +00000170 43 5a d0 03 2d 8a 7a 43 85 b7 14 52 e7 a5 65 4c |CZ..-.zC...R..eL| +00000180 2c 78 b8 23 8c b5 b4 82 e5 de 1f 95 3b 7e 62 a5 |,x.#........;~b.| +00000190 2c a5 33 d6 fe 12 5c 7a 56 fc f5 06 bf fa 58 7b |,.3...\zV.....X{| +000001a0 26 3f b5 cd 04 d3 d0 c9 21 96 4a c7 f4 54 9f 5a |&?......!.J..T.Z| +000001b0 bf ef 42 71 00 fe 18 99 07 7f 7e 88 7d 7d f1 04 |..Bq......~.}}..| +000001c0 39 c4 a2 2e db 51 c9 7c e3 c0 4c 3b 32 66 01 cf |9....Q.|..L;2f..| +000001d0 af b1 1d b8 71 9a 1d db db 89 6b ae da 2d 79 02 |....q.....k..-y.| +000001e0 03 01 00 01 a3 81 a7 30 81 a4 30 1d 06 03 55 1d |.......0..0...U.| +000001f0 0e 04 16 04 14 b1 ad e2 85 5a cf cb 28 db 69 ce |.........Z..(.i.| +00000200 23 69 de d3 26 8e 18 88 39 30 75 06 03 55 1d 23 |#i..&...90u..U.#| +00000210 04 6e 30 6c 80 14 b1 ad e2 85 5a cf cb 28 db 69 |.n0l......Z..(.i| +00000220 ce 23 69 de d3 26 8e 18 88 39 a1 49 a4 47 30 45 |.#i..&...9.I.G0E| +00000230 31 0b 30 09 06 03 55 04 06 13 02 41 55 31 13 30 |1.0...U....AU1.0| +00000240 11 06 03 55 04 08 13 0a 53 6f 6d 65 2d 53 74 61 |...U....Some-Sta| +00000250 74 65 31 21 30 1f 06 03 55 04 0a 13 18 49 6e 74 |te1!0...U....Int| +00000260 65 72 6e 65 74 20 57 69 64 67 69 74 73 20 50 74 |ernet Widgits Pt| +00000270 79 20 4c 74 64 82 09 00 85 b0 bb a4 8a 7f b8 ca |y Ltd...........| +00000280 30 0c 06 03 55 1d 13 04 05 30 03 01 01 ff 30 0d |0...U....0....0.| +00000290 06 09 2a 86 48 86 f7 0d 01 01 05 05 00 03 81 81 |..*.H...........| +000002a0 00 08 6c 45 24 c7 6b b1 59 ab 0c 52 cc f2 b0 14 |..lE$.k.Y..R....| +000002b0 d7 87 9d 7a 64 75 b5 5a 95 66 e4 c5 2b 8e ae 12 |...zdu.Z.f..+...| +000002c0 66 1f eb 4f 38 b3 6e 60 d3 92 fd f7 41 08 b5 25 |f..O8.n`....A..%| +000002d0 13 b1 18 7a 24 fb 30 1d ba ed 98 b9 17 ec e7 d7 |...z$.0.........| +000002e0 31 59 db 95 d3 1d 78 ea 50 56 5c d5 82 5a 2d 5a |1Y....x.PV\..Z-Z| +000002f0 5f 33 c4 b6 d8 c9 75 90 96 8c 0f 52 98 b5 cd 98 |_3....u....R....| +00000300 1f 89 20 5f f2 a0 1c a3 1b 96 94 dd a9 fd 57 e9 |.. _..........W.| +00000310 70 e8 26 6d 71 99 9b 26 6e 38 50 29 6c 90 a7 bd |p.&mq..&n8P)l...| +00000320 d9 16 03 03 00 cd 0c 00 00 c9 03 00 17 41 04 7d |.............A.}| +00000330 75 a5 53 0b a5 4d a6 81 e0 df c4 11 c9 b5 31 ba |u.S..M........1.| +00000340 9f 7b 51 04 57 c6 e0 b9 b0 bc 4f bc 71 74 8a 2e |.{Q.W.....O.qt..| +00000350 d1 f6 39 36 94 4e c7 d3 a7 1b 2c b5 55 04 71 01 |..96.N....,.U.q.| +00000360 9e 2b 42 1e 8b a4 40 b2 13 4f 03 1f 51 9e 5c 04 |.+B...@..O..Q.\.| +00000370 01 00 80 68 05 c7 4a ca df 00 85 2b 53 f7 4f c3 |...h..J....+S.O.| +00000380 b4 0f e8 f7 b8 30 b7 36 56 65 7b 03 6a 72 f1 aa |.....0.6Ve{.jr..| +00000390 54 30 90 9e c7 dc fc 03 96 15 70 67 13 12 a4 f4 |T0........pg....| +000003a0 42 f0 f9 a1 48 c0 44 44 77 0e ea fd cb b5 6e 19 |B...H.DDw.....n.| +000003b0 89 94 a7 12 67 87 47 19 c3 00 2d c4 9b d4 dc 66 |....g.G...-....f| +000003c0 fa ca d7 97 79 9b 28 7f 74 d4 37 c0 06 63 d4 9e |....y.(.t.7..c..| +000003d0 a1 53 16 5a 8e d7 a5 cc 90 4d 63 f9 0c 18 85 7f |.S.Z.....Mc.....| +000003e0 0e 35 3a 49 73 88 82 51 41 e5 2d 58 aa 38 3e bd |.5:Is..QA.-X.8>.| +000003f0 3d d8 da 16 03 03 00 04 0e 00 00 00 |=...........| +>>> Flow 3 (client to server) +00000000 16 03 03 00 46 10 00 00 42 41 04 1e 18 37 ef 0d |....F...BA...7..| +00000010 19 51 88 35 75 71 b5 e5 54 5b 12 2e 8f 09 67 fd |.Q.5uq..T[....g.| +00000020 a7 24 20 3e b2 56 1c ce 97 28 5e f8 2b 2d 4f 9e |.$ >.V...(^.+-O.| +00000030 f1 07 9f 6c 4b 5b 83 56 e2 32 42 e9 58 b6 d7 49 |...lK[.V.2B.X..I| +00000040 a6 b5 68 1a 41 03 56 6b dc 5a 89 14 03 03 00 01 |..h.A.Vk.Z......| +00000050 01 16 03 03 00 28 00 00 00 00 00 00 00 00 a8 da |.....(..........| +00000060 74 a6 d0 a5 26 86 f3 5f 89 a4 af ac 9c 1a 01 1f |t...&.._........| +00000070 89 8a 1c fc cf 68 3e a5 a3 20 1a b3 78 af |.....h>.. ..x.| +>>> Flow 4 (server to client) +00000000 14 03 03 00 01 01 16 03 03 00 28 1a f2 a9 e8 71 |..........(....q| +00000010 b2 a6 ca 36 4a ea 55 f6 20 03 fd f7 90 c3 af 30 |...6J.U. ......0| +00000020 d3 29 c3 d7 1b d6 4d 3e 61 55 94 0d 4e 3e 83 1a |.)....M>aU..N>..| +00000030 97 dd 19 |...| +>>> Flow 5 (client to server) +00000000 17 03 03 00 1e 00 00 00 00 00 00 00 01 94 5b 5e |..............[^| +00000010 51 a1 52 ee 19 78 78 ef 12 0d 9c 66 bf e2 48 cb |Q.R..xx....f..H.| +00000020 f6 00 1e 15 03 03 00 1a 00 00 00 00 00 00 00 02 |................| +00000030 cd 5d 31 58 d9 5a 12 65 5b c6 7e 4e e2 04 e7 1d |.]1X.Z.e[.~N....| +00000040 b1 4c |.L| diff --git a/src/crypto/tls/testdata/Client-TLSv12-ClientCert-ECDSA-ECDSA b/src/crypto/tls/testdata/Client-TLSv12-ClientCert-ECDSA-ECDSA new file mode 100644 index 0000000000000000000000000000000000000000..1470ba7a2500e189c64522c4a244b8ec96663434 --- /dev/null +++ b/src/crypto/tls/testdata/Client-TLSv12-ClientCert-ECDSA-ECDSA @@ -0,0 +1,134 @@ +>>> Flow 1 (client to server) +00000000 16 03 01 00 81 01 00 00 7d 03 03 00 00 00 00 00 |........}.......| +00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| +00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 1e c0 2f |.............../| +00000030 c0 2b c0 30 c0 2c c0 11 c0 07 c0 13 c0 09 c0 14 |.+.0.,..........| +00000040 c0 0a 00 05 00 2f 00 35 c0 12 00 0a 01 00 00 36 |...../.5.......6| +00000050 00 05 00 05 01 00 00 00 00 00 0a 00 08 00 06 00 |................| +00000060 17 00 18 00 19 00 0b 00 02 01 00 00 0d 00 0e 00 |................| +00000070 0c 04 01 04 03 05 01 05 03 02 01 02 03 ff 01 00 |................| +00000080 01 00 00 12 00 00 |......| +>>> Flow 2 (server to client) +00000000 16 03 03 00 59 02 00 00 55 03 03 a5 28 60 99 bf |....Y...U...(`..| +00000010 c7 54 04 87 60 ad c5 32 f6 bf ed 11 47 de 4d ff |.T..`..2....G.M.| +00000020 99 e1 8f 88 f6 af 10 6e 29 74 0a 20 1d 39 cb e0 |.......n)t. .9..| +00000030 a5 11 fe 8e 23 11 83 c7 a6 53 fc 97 03 9d ff 7c |....#....S.....|| +00000040 cf 51 ba 41 64 61 38 22 5c c6 4a 04 c0 09 00 00 |.Q.Ada8"\.J.....| +00000050 0d ff 01 00 01 00 00 0b 00 04 03 00 01 02 16 03 |................| +00000060 03 02 0e 0b 00 02 0a 00 02 07 00 02 04 30 82 02 |.............0..| +00000070 00 30 82 01 62 02 09 00 b8 bf 2d 47 a0 d2 eb f4 |.0..b.....-G....| +00000080 30 09 06 07 2a 86 48 ce 3d 04 01 30 45 31 0b 30 |0...*.H.=..0E1.0| +00000090 09 06 03 55 04 06 13 02 41 55 31 13 30 11 06 03 |...U....AU1.0...| +000000a0 55 04 08 13 0a 53 6f 6d 65 2d 53 74 61 74 65 31 |U....Some-State1| +000000b0 21 30 1f 06 03 55 04 0a 13 18 49 6e 74 65 72 6e |!0...U....Intern| +000000c0 65 74 20 57 69 64 67 69 74 73 20 50 74 79 20 4c |et Widgits Pty L| +000000d0 74 64 30 1e 17 0d 31 32 31 31 32 32 31 35 30 36 |td0...1211221506| +000000e0 33 32 5a 17 0d 32 32 31 31 32 30 31 35 30 36 33 |32Z..22112015063| +000000f0 32 5a 30 45 31 0b 30 09 06 03 55 04 06 13 02 41 |2Z0E1.0...U....A| +00000100 55 31 13 30 11 06 03 55 04 08 13 0a 53 6f 6d 65 |U1.0...U....Some| +00000110 2d 53 74 61 74 65 31 21 30 1f 06 03 55 04 0a 13 |-State1!0...U...| +00000120 18 49 6e 74 65 72 6e 65 74 20 57 69 64 67 69 74 |.Internet Widgit| +00000130 73 20 50 74 79 20 4c 74 64 30 81 9b 30 10 06 07 |s Pty Ltd0..0...| +00000140 2a 86 48 ce 3d 02 01 06 05 2b 81 04 00 23 03 81 |*.H.=....+...#..| +00000150 86 00 04 00 c4 a1 ed be 98 f9 0b 48 73 36 7e c3 |...........Hs6~.| +00000160 16 56 11 22 f2 3d 53 c3 3b 4d 21 3d cd 6b 75 e6 |.V.".=S.;M!=.ku.| +00000170 f6 b0 dc 9a df 26 c1 bc b2 87 f0 72 32 7c b3 64 |.....&.....r2|.d| +00000180 2f 1c 90 bc ea 68 23 10 7e fe e3 25 c0 48 3a 69 |/....h#.~..%.H:i| +00000190 e0 28 6d d3 37 00 ef 04 62 dd 0d a0 9c 70 62 83 |.(m.7...b....pb.| +000001a0 d8 81 d3 64 31 aa 9e 97 31 bd 96 b0 68 c0 9b 23 |...d1...1...h..#| +000001b0 de 76 64 3f 1a 5c 7f e9 12 0e 58 58 b6 5f 70 dd |.vd?.\....XX._p.| +000001c0 9b d8 ea d5 d7 f5 d5 cc b9 b6 9f 30 66 5b 66 9a |...........0f[f.| +000001d0 20 e2 27 e5 bf fe 3b 30 09 06 07 2a 86 48 ce 3d | .'...;0...*.H.=| +000001e0 04 01 03 81 8c 00 30 81 88 02 42 01 88 a2 4f eb |......0...B...O.| +000001f0 e2 45 c5 48 7d 1b ac f5 ed 98 9d ae 47 70 c0 5e |.E.H}.......Gp.^| +00000200 1b b6 2f bd f1 b6 4d b7 61 40 d3 11 a2 ce ee 0b |../...M.a@......| +00000210 7e 92 7e ff 76 9d c3 3b 7e a5 3f ce fa 10 e2 59 |~.~.v..;~.?....Y| +00000220 ec 47 2d 7c ac da 4e 97 0e 15 a0 6f d0 02 42 01 |.G-|..N....o..B.| +00000230 4d fc be 67 13 9c 2d 05 0e bd 3f a3 8c 25 c1 33 |M..g..-...?..%.3| +00000240 13 83 0d 94 06 bb d4 37 7a f6 ec 7a c9 86 2e dd |.......7z..z....| +00000250 d7 11 69 7f 85 7c 56 de fb 31 78 2b e4 c7 78 0d |..i..|V..1x+..x.| +00000260 ae cb be 9e 4e 36 24 31 7b 6a 0f 39 95 12 07 8f |....N6$1{j.9....| +00000270 2a 16 03 03 00 d7 0c 00 00 d3 03 00 17 41 04 c4 |*............A..| +00000280 0a 40 05 84 eb 90 3c 13 d0 90 af 69 fa 5c 20 75 |.@....<....i.\ u| +00000290 e1 9b f2 30 f7 df cc 75 2c 35 7e 38 16 99 7d 57 |...0...u,5~8..}W| +000002a0 6d d7 f0 93 2d 1d c8 03 89 6e 52 3b 20 e5 8a 5f |m...-....nR; .._| +000002b0 6d ca 6e 6a ca 51 f8 a4 dc 1d ec 3e 73 c9 72 04 |m.nj.Q.....>s.r.| +000002c0 03 00 8a 30 81 87 02 41 37 bf 0d 1d c1 9a 37 39 |...0...A7.....79| +000002d0 4d 4a f8 17 50 5d 4c 78 d4 25 99 9d 81 48 98 a8 |MJ..P]Lx.%...H..| +000002e0 ff 2d 3f 98 4b 9f d8 96 2b fa 37 cc e8 66 25 0e |.-?.K...+.7..f%.| +000002f0 d3 5e 53 c5 3b ad 17 3f 21 ce d2 45 d8 93 95 6c |.^S.;..?!..E...l| +00000300 25 f9 5a 10 9f 37 c8 14 a6 02 42 00 e6 bd 9a 89 |%.Z..7....B.....| +00000310 8e 73 40 f4 90 e6 d8 e2 98 51 10 23 fb 98 e5 47 |.s@......Q.#...G| +00000320 0c 2a 7a 2f 02 66 a8 20 e4 cb 4f ba 14 1d 9e 3a |.*z/.f. ..O....:| +00000330 2f 09 47 44 02 e0 9f 30 21 71 f0 99 09 de 23 d2 |/.GD...0!q....#.| +00000340 f5 f0 b2 93 70 a3 8f 79 b9 4f 88 0b 35 16 03 03 |....p..y.O..5...| +00000350 00 2e 0d 00 00 26 03 01 02 40 00 1e 06 01 06 02 |.....&...@......| +00000360 06 03 05 01 05 02 05 03 04 01 04 02 04 03 03 01 |................| +00000370 03 02 03 03 02 01 02 02 02 03 00 00 0e 00 00 00 |................| +>>> Flow 3 (client to server) +00000000 16 03 03 02 0a 0b 00 02 06 00 02 03 00 02 00 30 |...............0| +00000010 82 01 fc 30 82 01 5e 02 09 00 9a 30 84 6c 26 35 |...0..^....0.l&5| +00000020 d9 17 30 09 06 07 2a 86 48 ce 3d 04 01 30 45 31 |..0...*.H.=..0E1| +00000030 0b 30 09 06 03 55 04 06 13 02 41 55 31 13 30 11 |.0...U....AU1.0.| +00000040 06 03 55 04 08 13 0a 53 6f 6d 65 2d 53 74 61 74 |..U....Some-Stat| +00000050 65 31 21 30 1f 06 03 55 04 0a 13 18 49 6e 74 65 |e1!0...U....Inte| +00000060 72 6e 65 74 20 57 69 64 67 69 74 73 20 50 74 79 |rnet Widgits Pty| +00000070 20 4c 74 64 30 1e 17 0d 31 32 31 31 31 34 31 33 | Ltd0...12111413| +00000080 32 35 35 33 5a 17 0d 32 32 31 31 31 32 31 33 32 |2553Z..221112132| +00000090 35 35 33 5a 30 41 31 0b 30 09 06 03 55 04 06 13 |553Z0A1.0...U...| +000000a0 02 41 55 31 0c 30 0a 06 03 55 04 08 13 03 4e 53 |.AU1.0...U....NS| +000000b0 57 31 10 30 0e 06 03 55 04 07 13 07 50 79 72 6d |W1.0...U....Pyrm| +000000c0 6f 6e 74 31 12 30 10 06 03 55 04 03 13 09 4a 6f |ont1.0...U....Jo| +000000d0 65 6c 20 53 69 6e 67 30 81 9b 30 10 06 07 2a 86 |el Sing0..0...*.| +000000e0 48 ce 3d 02 01 06 05 2b 81 04 00 23 03 81 86 00 |H.=....+...#....| +000000f0 04 00 95 8c 91 75 14 c0 5e c4 57 b4 d4 c3 6f 8d |.....u..^.W...o.| +00000100 ae 68 1e dd 6f ce 86 e1 7e 6e b2 48 3e 81 e5 4e |.h..o...~n.H>..N| +00000110 e2 c6 88 4b 64 dc f5 30 bb d3 ff 65 cc 5b f4 dd |...Kd..0...e.[..| +00000120 b5 6a 3e 3e d0 1d de 47 c3 76 ad 19 f6 45 2c 8c |.j>>...G.v...E,.| +00000130 bc d8 1d 01 4c 1f 70 90 46 76 48 8b 8f 83 cc 4a |....L.p.FvH....J| +00000140 5c 8f 40 76 da e0 89 ec 1d 2b c4 4e 30 76 28 41 |\.@v.....+.N0v(A| +00000150 b2 62 a8 fb 5b f1 f9 4e 7a 8d bd 09 b8 ae ea 8b |.b..[..Nz.......| +00000160 18 27 4f 2e 70 fe 13 96 ba c3 d3 40 16 cd 65 4e |.'O.p......@..eN| +00000170 ac 11 1e e6 f1 30 09 06 07 2a 86 48 ce 3d 04 01 |.....0...*.H.=..| +00000180 03 81 8c 00 30 81 88 02 42 00 e0 14 c4 60 60 0b |....0...B....``.| +00000190 72 68 b0 32 5d 61 4a 02 74 5c c2 81 b9 16 a8 3f |rh.2]aJ.t\.....?| +000001a0 29 c8 36 c7 81 ff 6c b6 5b d9 70 f1 38 3b 50 48 |).6...l.[.p.8;PH| +000001b0 28 94 cb 09 1a 52 f1 5d ee 8d f2 b9 f0 f0 da d9 |(....R.]........| +000001c0 15 3a f9 bd 03 7a 87 a2 23 35 ec 02 42 01 a3 d4 |.:...z..#5..B...| +000001d0 8a 78 35 1c 4a 9a 23 d2 0a be 2b 10 31 9d 9c 5f |.x5.J.#...+.1.._| +000001e0 be e8 91 b3 da 1a f5 5d a3 23 f5 26 8b 45 70 8d |.......].#.&.Ep.| +000001f0 65 62 9b 7e 01 99 3d 18 f6 10 9a 38 61 9b 2e 57 |eb.~..=....8a..W| +00000200 e4 fa cc b1 8a ce e2 23 a0 87 f0 e1 67 51 eb 16 |.......#....gQ..| +00000210 03 03 00 46 10 00 00 42 41 04 1e 18 37 ef 0d 19 |...F...BA...7...| +00000220 51 88 35 75 71 b5 e5 54 5b 12 2e 8f 09 67 fd a7 |Q.5uq..T[....g..| +00000230 24 20 3e b2 56 1c ce 97 28 5e f8 2b 2d 4f 9e f1 |$ >.V...(^.+-O..| +00000240 07 9f 6c 4b 5b 83 56 e2 32 42 e9 58 b6 d7 49 a6 |..lK[.V.2B.X..I.| +00000250 b5 68 1a 41 03 56 6b dc 5a 89 16 03 03 00 92 0f |.h.A.Vk.Z.......| +00000260 00 00 8e 05 03 00 8a 30 81 87 02 42 00 cc a4 ad |.......0...B....| +00000270 0b ff 09 40 8f 2c a6 37 72 1d f7 d2 19 74 85 ad |...@.,.7r....t..| +00000280 ac 33 b0 b8 5b 56 39 cf b0 ef 46 68 94 39 4c d0 |.3..[V9...Fh.9L.| +00000290 f4 97 32 10 99 36 c5 95 c8 14 23 37 78 46 5c a9 |..2..6....#7xF\.| +000002a0 20 95 65 47 ff 54 02 f1 aa 1d d7 bc 39 2d 02 41 | .eG.T......9-.A| +000002b0 2e f9 d6 8c e8 c5 a9 6f 10 4f d6 5f 4e 88 e9 71 |.......o.O._N..q| +000002c0 23 5b 6f b8 ab 19 d3 dd ec f3 32 e3 3b fa 41 a2 |#[o.......2.;.A.| +000002d0 e8 ae dc 27 8d 4e 79 f4 47 ef c9 8f bf 0b 41 3b |...'.Ny.G.....A;| +000002e0 94 16 cb 8f 1e b5 f3 4e 6e 42 46 35 1a 0c ca 79 |.......NnBF5...y| +000002f0 4b 14 03 03 00 01 01 16 03 03 00 40 00 00 00 00 |K..........@....| +00000300 00 00 00 00 00 00 00 00 00 00 00 00 64 1c d9 9f |............d...| +00000310 34 ec c2 74 76 7a 9f cf 95 19 be 8d 6a 2f 25 96 |4..tvz......j/%.| +00000320 df de 18 ca 0e c9 d4 2f e4 b0 34 10 5b 72 7a 18 |......./..4.[rz.| +00000330 5c 64 d7 fc 2e 1b 28 10 ae a6 31 e9 |\d....(...1.| +>>> Flow 4 (server to client) +00000000 14 03 03 00 01 01 16 03 03 00 40 27 6f 24 a3 0c |..........@'o$..| +00000010 6d d7 68 4a fb 43 b0 97 02 6c 22 7e 2f a1 f1 7a |m.hJ.C...l"~/..z| +00000020 37 bf 38 82 dc a0 83 24 01 4b c0 4f 15 e1 7c 4c |7.8....$.K.O..|L| +00000030 d4 cd b8 e2 71 af f5 20 7d f9 4a 48 4b f0 a1 f3 |....q.. }.JHK...| +00000040 7b 02 29 18 c0 87 a5 dd c4 73 8e |{.)......s.| +>>> Flow 5 (client to server) +00000000 17 03 03 00 30 00 00 00 00 00 00 00 00 00 00 00 |....0...........| +00000010 00 00 00 00 00 bf 7a e1 23 0d d0 13 6e 96 81 6d |......z.#...n..m| +00000020 32 56 0f 75 7e 01 88 5f 6d e6 d6 ca ec 3c 17 e9 |2V.u~.._m....<..| +00000030 44 a9 c0 1c a4 15 03 03 00 30 00 00 00 00 00 00 |D........0......| +00000040 00 00 00 00 00 00 00 00 00 00 76 be 7a 77 29 01 |..........v.zw).| +00000050 8e 13 02 66 81 43 a0 55 03 35 22 09 de ea 52 bb |...f.C.U.5"...R.| +00000060 51 cc c1 09 0e 9b 4d bd 94 85 |Q.....M...| diff --git a/src/crypto/tls/testdata/Client-TLSv12-ClientCert-ECDSA-RSA b/src/crypto/tls/testdata/Client-TLSv12-ClientCert-ECDSA-RSA new file mode 100644 index 0000000000000000000000000000000000000000..95c5782ab0d88deda7c7bd5380c5665d021e75d3 --- /dev/null +++ b/src/crypto/tls/testdata/Client-TLSv12-ClientCert-ECDSA-RSA @@ -0,0 +1,128 @@ +>>> Flow 1 (client to server) +00000000 16 03 01 00 81 01 00 00 7d 03 03 00 00 00 00 00 |........}.......| +00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| +00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 1e c0 2f |.............../| +00000030 c0 2b c0 30 c0 2c c0 11 c0 07 c0 13 c0 09 c0 14 |.+.0.,..........| +00000040 c0 0a 00 05 00 2f 00 35 c0 12 00 0a 01 00 00 36 |...../.5.......6| +00000050 00 05 00 05 01 00 00 00 00 00 0a 00 08 00 06 00 |................| +00000060 17 00 18 00 19 00 0b 00 02 01 00 00 0d 00 0e 00 |................| +00000070 0c 04 01 04 03 05 01 05 03 02 01 02 03 ff 01 00 |................| +00000080 01 00 00 12 00 00 |......| +>>> Flow 2 (server to client) +00000000 16 03 03 00 51 02 00 00 4d 03 03 79 e8 35 e3 d2 |....Q...M..y.5..| +00000010 c0 5e 39 d1 46 da 9c 94 56 20 e2 06 d6 9b f6 dd |.^9.F...V ......| +00000020 4f 7a c1 e8 34 a1 9f 8b c2 e1 fb 20 66 9c 5a 9a |Oz..4...... f.Z.| +00000030 3d 22 ab 8e d8 81 03 94 68 a0 6c 72 d8 23 0b 4b |="......h.lr.#.K| +00000040 fe 9d c7 49 a7 7c bd fa b5 7a 5e 5b 00 05 00 00 |...I.|...z^[....| +00000050 05 ff 01 00 01 00 16 03 03 02 be 0b 00 02 ba 00 |................| +00000060 02 b7 00 02 b4 30 82 02 b0 30 82 02 19 a0 03 02 |.....0...0......| +00000070 01 02 02 09 00 85 b0 bb a4 8a 7f b8 ca 30 0d 06 |.............0..| +00000080 09 2a 86 48 86 f7 0d 01 01 05 05 00 30 45 31 0b |.*.H........0E1.| +00000090 30 09 06 03 55 04 06 13 02 41 55 31 13 30 11 06 |0...U....AU1.0..| +000000a0 03 55 04 08 13 0a 53 6f 6d 65 2d 53 74 61 74 65 |.U....Some-State| +000000b0 31 21 30 1f 06 03 55 04 0a 13 18 49 6e 74 65 72 |1!0...U....Inter| +000000c0 6e 65 74 20 57 69 64 67 69 74 73 20 50 74 79 20 |net Widgits Pty | +000000d0 4c 74 64 30 1e 17 0d 31 30 30 34 32 34 30 39 30 |Ltd0...100424090| +000000e0 39 33 38 5a 17 0d 31 31 30 34 32 34 30 39 30 39 |938Z..1104240909| +000000f0 33 38 5a 30 45 31 0b 30 09 06 03 55 04 06 13 02 |38Z0E1.0...U....| +00000100 41 55 31 13 30 11 06 03 55 04 08 13 0a 53 6f 6d |AU1.0...U....Som| +00000110 65 2d 53 74 61 74 65 31 21 30 1f 06 03 55 04 0a |e-State1!0...U..| +00000120 13 18 49 6e 74 65 72 6e 65 74 20 57 69 64 67 69 |..Internet Widgi| +00000130 74 73 20 50 74 79 20 4c 74 64 30 81 9f 30 0d 06 |ts Pty Ltd0..0..| +00000140 09 2a 86 48 86 f7 0d 01 01 01 05 00 03 81 8d 00 |.*.H............| +00000150 30 81 89 02 81 81 00 bb 79 d6 f5 17 b5 e5 bf 46 |0.......y......F| +00000160 10 d0 dc 69 be e6 2b 07 43 5a d0 03 2d 8a 7a 43 |...i..+.CZ..-.zC| +00000170 85 b7 14 52 e7 a5 65 4c 2c 78 b8 23 8c b5 b4 82 |...R..eL,x.#....| +00000180 e5 de 1f 95 3b 7e 62 a5 2c a5 33 d6 fe 12 5c 7a |....;~b.,.3...\z| +00000190 56 fc f5 06 bf fa 58 7b 26 3f b5 cd 04 d3 d0 c9 |V.....X{&?......| +000001a0 21 96 4a c7 f4 54 9f 5a bf ef 42 71 00 fe 18 99 |!.J..T.Z..Bq....| +000001b0 07 7f 7e 88 7d 7d f1 04 39 c4 a2 2e db 51 c9 7c |..~.}}..9....Q.|| +000001c0 e3 c0 4c 3b 32 66 01 cf af b1 1d b8 71 9a 1d db |..L;2f......q...| +000001d0 db 89 6b ae da 2d 79 02 03 01 00 01 a3 81 a7 30 |..k..-y........0| +000001e0 81 a4 30 1d 06 03 55 1d 0e 04 16 04 14 b1 ad e2 |..0...U.........| +000001f0 85 5a cf cb 28 db 69 ce 23 69 de d3 26 8e 18 88 |.Z..(.i.#i..&...| +00000200 39 30 75 06 03 55 1d 23 04 6e 30 6c 80 14 b1 ad |90u..U.#.n0l....| +00000210 e2 85 5a cf cb 28 db 69 ce 23 69 de d3 26 8e 18 |..Z..(.i.#i..&..| +00000220 88 39 a1 49 a4 47 30 45 31 0b 30 09 06 03 55 04 |.9.I.G0E1.0...U.| +00000230 06 13 02 41 55 31 13 30 11 06 03 55 04 08 13 0a |...AU1.0...U....| +00000240 53 6f 6d 65 2d 53 74 61 74 65 31 21 30 1f 06 03 |Some-State1!0...| +00000250 55 04 0a 13 18 49 6e 74 65 72 6e 65 74 20 57 69 |U....Internet Wi| +00000260 64 67 69 74 73 20 50 74 79 20 4c 74 64 82 09 00 |dgits Pty Ltd...| +00000270 85 b0 bb a4 8a 7f b8 ca 30 0c 06 03 55 1d 13 04 |........0...U...| +00000280 05 30 03 01 01 ff 30 0d 06 09 2a 86 48 86 f7 0d |.0....0...*.H...| +00000290 01 01 05 05 00 03 81 81 00 08 6c 45 24 c7 6b b1 |..........lE$.k.| +000002a0 59 ab 0c 52 cc f2 b0 14 d7 87 9d 7a 64 75 b5 5a |Y..R.......zdu.Z| +000002b0 95 66 e4 c5 2b 8e ae 12 66 1f eb 4f 38 b3 6e 60 |.f..+...f..O8.n`| +000002c0 d3 92 fd f7 41 08 b5 25 13 b1 18 7a 24 fb 30 1d |....A..%...z$.0.| +000002d0 ba ed 98 b9 17 ec e7 d7 31 59 db 95 d3 1d 78 ea |........1Y....x.| +000002e0 50 56 5c d5 82 5a 2d 5a 5f 33 c4 b6 d8 c9 75 90 |PV\..Z-Z_3....u.| +000002f0 96 8c 0f 52 98 b5 cd 98 1f 89 20 5f f2 a0 1c a3 |...R...... _....| +00000300 1b 96 94 dd a9 fd 57 e9 70 e8 26 6d 71 99 9b 26 |......W.p.&mq..&| +00000310 6e 38 50 29 6c 90 a7 bd d9 16 03 03 00 2e 0d 00 |n8P)l...........| +00000320 00 26 03 01 02 40 00 1e 06 01 06 02 06 03 05 01 |.&...@..........| +00000330 05 02 05 03 04 01 04 02 04 03 03 01 03 02 03 03 |................| +00000340 02 01 02 02 02 03 00 00 0e 00 00 00 |............| +>>> Flow 3 (client to server) +00000000 16 03 03 02 0a 0b 00 02 06 00 02 03 00 02 00 30 |...............0| +00000010 82 01 fc 30 82 01 5e 02 09 00 9a 30 84 6c 26 35 |...0..^....0.l&5| +00000020 d9 17 30 09 06 07 2a 86 48 ce 3d 04 01 30 45 31 |..0...*.H.=..0E1| +00000030 0b 30 09 06 03 55 04 06 13 02 41 55 31 13 30 11 |.0...U....AU1.0.| +00000040 06 03 55 04 08 13 0a 53 6f 6d 65 2d 53 74 61 74 |..U....Some-Stat| +00000050 65 31 21 30 1f 06 03 55 04 0a 13 18 49 6e 74 65 |e1!0...U....Inte| +00000060 72 6e 65 74 20 57 69 64 67 69 74 73 20 50 74 79 |rnet Widgits Pty| +00000070 20 4c 74 64 30 1e 17 0d 31 32 31 31 31 34 31 33 | Ltd0...12111413| +00000080 32 35 35 33 5a 17 0d 32 32 31 31 31 32 31 33 32 |2553Z..221112132| +00000090 35 35 33 5a 30 41 31 0b 30 09 06 03 55 04 06 13 |553Z0A1.0...U...| +000000a0 02 41 55 31 0c 30 0a 06 03 55 04 08 13 03 4e 53 |.AU1.0...U....NS| +000000b0 57 31 10 30 0e 06 03 55 04 07 13 07 50 79 72 6d |W1.0...U....Pyrm| +000000c0 6f 6e 74 31 12 30 10 06 03 55 04 03 13 09 4a 6f |ont1.0...U....Jo| +000000d0 65 6c 20 53 69 6e 67 30 81 9b 30 10 06 07 2a 86 |el Sing0..0...*.| +000000e0 48 ce 3d 02 01 06 05 2b 81 04 00 23 03 81 86 00 |H.=....+...#....| +000000f0 04 00 95 8c 91 75 14 c0 5e c4 57 b4 d4 c3 6f 8d |.....u..^.W...o.| +00000100 ae 68 1e dd 6f ce 86 e1 7e 6e b2 48 3e 81 e5 4e |.h..o...~n.H>..N| +00000110 e2 c6 88 4b 64 dc f5 30 bb d3 ff 65 cc 5b f4 dd |...Kd..0...e.[..| +00000120 b5 6a 3e 3e d0 1d de 47 c3 76 ad 19 f6 45 2c 8c |.j>>...G.v...E,.| +00000130 bc d8 1d 01 4c 1f 70 90 46 76 48 8b 8f 83 cc 4a |....L.p.FvH....J| +00000140 5c 8f 40 76 da e0 89 ec 1d 2b c4 4e 30 76 28 41 |\.@v.....+.N0v(A| +00000150 b2 62 a8 fb 5b f1 f9 4e 7a 8d bd 09 b8 ae ea 8b |.b..[..Nz.......| +00000160 18 27 4f 2e 70 fe 13 96 ba c3 d3 40 16 cd 65 4e |.'O.p......@..eN| +00000170 ac 11 1e e6 f1 30 09 06 07 2a 86 48 ce 3d 04 01 |.....0...*.H.=..| +00000180 03 81 8c 00 30 81 88 02 42 00 e0 14 c4 60 60 0b |....0...B....``.| +00000190 72 68 b0 32 5d 61 4a 02 74 5c c2 81 b9 16 a8 3f |rh.2]aJ.t\.....?| +000001a0 29 c8 36 c7 81 ff 6c b6 5b d9 70 f1 38 3b 50 48 |).6...l.[.p.8;PH| +000001b0 28 94 cb 09 1a 52 f1 5d ee 8d f2 b9 f0 f0 da d9 |(....R.]........| +000001c0 15 3a f9 bd 03 7a 87 a2 23 35 ec 02 42 01 a3 d4 |.:...z..#5..B...| +000001d0 8a 78 35 1c 4a 9a 23 d2 0a be 2b 10 31 9d 9c 5f |.x5.J.#...+.1.._| +000001e0 be e8 91 b3 da 1a f5 5d a3 23 f5 26 8b 45 70 8d |.......].#.&.Ep.| +000001f0 65 62 9b 7e 01 99 3d 18 f6 10 9a 38 61 9b 2e 57 |eb.~..=....8a..W| +00000200 e4 fa cc b1 8a ce e2 23 a0 87 f0 e1 67 51 eb 16 |.......#....gQ..| +00000210 03 03 00 86 10 00 00 82 00 80 6d 51 f3 7f f9 3e |..........mQ...>| +00000220 fb 75 82 41 36 83 e8 6a ee 2a 2e 25 90 67 4c 8e |.u.A6..j.*.%.gL.| +00000230 62 2f 30 81 17 e0 85 09 0c 2b b7 23 d7 b0 e2 1d |b/0......+.#....| +00000240 f7 3b d7 f5 a1 27 b6 ee 24 b6 1b cc 5b ea 66 0d |.;...'..$...[.f.| +00000250 6a f4 e5 85 f9 da 43 b4 0e 86 85 e1 f5 aa be c8 |j.....C.........| +00000260 ce 39 4c 9c 86 00 08 c2 4b e2 c6 ec 2f f7 ce e6 |.9L.....K.../...| +00000270 bd 77 82 6f 23 b6 e0 bd a2 92 b7 3a ac e8 56 f1 |.w.o#......:..V.| +00000280 af 54 5e 46 87 e9 3b 33 e7 b8 28 b7 d6 c8 90 35 |.T^F..;3..(....5| +00000290 d4 1c 43 d1 30 6f 55 4e 0a 70 16 03 03 00 92 0f |..C.0oUN.p......| +000002a0 00 00 8e 05 03 00 8a 30 81 87 02 41 19 c7 50 06 |.......0...A..P.| +000002b0 42 82 f9 e5 ec 0b f7 65 7e b1 19 53 5f 23 ab 19 |B......e~..S_#..| +000002c0 54 08 ec d2 a7 22 dd 83 7c 97 76 59 a5 6b f4 1d |T...."..|.vY.k..| +000002d0 92 86 34 2d ce 71 bb 01 d2 8a 67 0e a8 fb 51 e4 |..4-.q....g...Q.| +000002e0 69 9c 27 23 74 b9 fd 6f b6 5e 48 a0 cc 02 42 01 |i.'#t..o.^H...B.| +000002f0 50 97 b7 95 14 f4 a6 f2 95 63 17 38 59 a1 51 95 |P........c.8Y.Q.| +00000300 1e bc 99 fb fd 82 8b ab cb 4d 8e 17 a9 f8 e9 c2 |.........M......| +00000310 9b 93 15 02 50 e6 c2 05 54 e7 8a ec 6f 93 1f 79 |....P...T...o..y| +00000320 8d 67 e7 2d d6 65 ab 97 fd be 20 97 bd 6b c4 fc |.g.-.e.... ..k..| +00000330 02 14 03 03 00 01 01 16 03 03 00 24 24 df 52 6e |...........$$.Rn| +00000340 c1 35 48 fe 60 77 28 69 36 fe 96 a1 72 db a2 f5 |.5H.`w(i6...r...| +00000350 d0 b7 c3 d9 67 e5 ee f2 d9 18 bf f0 35 80 06 c2 |....g.......5...| +>>> Flow 4 (server to client) +00000000 14 03 03 00 01 01 16 03 03 00 24 40 5b dc 01 59 |..........$@[..Y| +00000010 33 6e 61 5a 6d fc c8 a5 f5 00 9b 55 77 c5 e6 f2 |3naZm......Uw...| +00000020 c6 5c b6 2f 94 3c 72 5b b5 0c 3e 78 88 e6 44 |.\./.x..D| +>>> Flow 5 (client to server) +00000000 17 03 03 00 1a cd 2f 11 b1 3a e4 1c 31 95 9b c4 |....../..:..1...| +00000010 37 20 9f 03 d3 45 a4 15 e1 09 1e 0c f6 5d d3 15 |7 ...E.......]..| +00000020 03 03 00 16 d7 f6 a1 d0 ad 41 69 73 c0 40 22 f2 |.........Ais.@".| +00000030 5f e8 c3 50 f9 35 fc 59 e0 3a |_..P.5.Y.:| diff --git a/src/crypto/tls/testdata/Client-TLSv12-ClientCert-RSA-AES256-GCM-SHA384 b/src/crypto/tls/testdata/Client-TLSv12-ClientCert-RSA-AES256-GCM-SHA384 new file mode 100644 index 0000000000000000000000000000000000000000..52e3befe615cd2c972848b84276ace73c97b5514 --- /dev/null +++ b/src/crypto/tls/testdata/Client-TLSv12-ClientCert-RSA-AES256-GCM-SHA384 @@ -0,0 +1,139 @@ +>>> Flow 1 (client to server) +00000000 16 03 01 00 81 01 00 00 7d 03 03 00 00 00 00 00 |........}.......| +00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| +00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 1e c0 2f |.............../| +00000030 c0 2b c0 30 c0 2c c0 11 c0 07 c0 13 c0 09 c0 14 |.+.0.,..........| +00000040 c0 0a 00 05 00 2f 00 35 c0 12 00 0a 01 00 00 36 |...../.5.......6| +00000050 00 05 00 05 01 00 00 00 00 00 0a 00 08 00 06 00 |................| +00000060 17 00 18 00 19 00 0b 00 02 01 00 00 0d 00 0e 00 |................| +00000070 0c 04 01 04 03 05 01 05 03 02 01 02 03 ff 01 00 |................| +00000080 01 00 00 12 00 00 |......| +>>> Flow 2 (server to client) +00000000 16 03 03 00 59 02 00 00 55 03 03 74 fe 19 af 4b |....Y...U..t...K| +00000010 f3 d8 92 62 5a df 90 2c cc 09 fd 79 45 26 cd 52 |...bZ..,...yE&.R| +00000020 9a e6 da 16 99 fe 1d 91 79 a7 a0 20 b3 13 e9 03 |........y.. ....| +00000030 52 23 5f f0 55 59 f1 9e 00 a7 77 97 90 ed 2b fb |R#_.UY....w...+.| +00000040 9c ab fe b1 db ea 16 95 95 68 b0 e9 c0 30 00 00 |.........h...0..| +00000050 0d ff 01 00 01 00 00 0b 00 04 03 00 01 02 16 03 |................| +00000060 03 02 be 0b 00 02 ba 00 02 b7 00 02 b4 30 82 02 |.............0..| +00000070 b0 30 82 02 19 a0 03 02 01 02 02 09 00 85 b0 bb |.0..............| +00000080 a4 8a 7f b8 ca 30 0d 06 09 2a 86 48 86 f7 0d 01 |.....0...*.H....| +00000090 01 05 05 00 30 45 31 0b 30 09 06 03 55 04 06 13 |....0E1.0...U...| +000000a0 02 41 55 31 13 30 11 06 03 55 04 08 13 0a 53 6f |.AU1.0...U....So| +000000b0 6d 65 2d 53 74 61 74 65 31 21 30 1f 06 03 55 04 |me-State1!0...U.| +000000c0 0a 13 18 49 6e 74 65 72 6e 65 74 20 57 69 64 67 |...Internet Widg| +000000d0 69 74 73 20 50 74 79 20 4c 74 64 30 1e 17 0d 31 |its Pty Ltd0...1| +000000e0 30 30 34 32 34 30 39 30 39 33 38 5a 17 0d 31 31 |00424090938Z..11| +000000f0 30 34 32 34 30 39 30 39 33 38 5a 30 45 31 0b 30 |0424090938Z0E1.0| +00000100 09 06 03 55 04 06 13 02 41 55 31 13 30 11 06 03 |...U....AU1.0...| +00000110 55 04 08 13 0a 53 6f 6d 65 2d 53 74 61 74 65 31 |U....Some-State1| +00000120 21 30 1f 06 03 55 04 0a 13 18 49 6e 74 65 72 6e |!0...U....Intern| +00000130 65 74 20 57 69 64 67 69 74 73 20 50 74 79 20 4c |et Widgits Pty L| +00000140 74 64 30 81 9f 30 0d 06 09 2a 86 48 86 f7 0d 01 |td0..0...*.H....| +00000150 01 01 05 00 03 81 8d 00 30 81 89 02 81 81 00 bb |........0.......| +00000160 79 d6 f5 17 b5 e5 bf 46 10 d0 dc 69 be e6 2b 07 |y......F...i..+.| +00000170 43 5a d0 03 2d 8a 7a 43 85 b7 14 52 e7 a5 65 4c |CZ..-.zC...R..eL| +00000180 2c 78 b8 23 8c b5 b4 82 e5 de 1f 95 3b 7e 62 a5 |,x.#........;~b.| +00000190 2c a5 33 d6 fe 12 5c 7a 56 fc f5 06 bf fa 58 7b |,.3...\zV.....X{| +000001a0 26 3f b5 cd 04 d3 d0 c9 21 96 4a c7 f4 54 9f 5a |&?......!.J..T.Z| +000001b0 bf ef 42 71 00 fe 18 99 07 7f 7e 88 7d 7d f1 04 |..Bq......~.}}..| +000001c0 39 c4 a2 2e db 51 c9 7c e3 c0 4c 3b 32 66 01 cf |9....Q.|..L;2f..| +000001d0 af b1 1d b8 71 9a 1d db db 89 6b ae da 2d 79 02 |....q.....k..-y.| +000001e0 03 01 00 01 a3 81 a7 30 81 a4 30 1d 06 03 55 1d |.......0..0...U.| +000001f0 0e 04 16 04 14 b1 ad e2 85 5a cf cb 28 db 69 ce |.........Z..(.i.| +00000200 23 69 de d3 26 8e 18 88 39 30 75 06 03 55 1d 23 |#i..&...90u..U.#| +00000210 04 6e 30 6c 80 14 b1 ad e2 85 5a cf cb 28 db 69 |.n0l......Z..(.i| +00000220 ce 23 69 de d3 26 8e 18 88 39 a1 49 a4 47 30 45 |.#i..&...9.I.G0E| +00000230 31 0b 30 09 06 03 55 04 06 13 02 41 55 31 13 30 |1.0...U....AU1.0| +00000240 11 06 03 55 04 08 13 0a 53 6f 6d 65 2d 53 74 61 |...U....Some-Sta| +00000250 74 65 31 21 30 1f 06 03 55 04 0a 13 18 49 6e 74 |te1!0...U....Int| +00000260 65 72 6e 65 74 20 57 69 64 67 69 74 73 20 50 74 |ernet Widgits Pt| +00000270 79 20 4c 74 64 82 09 00 85 b0 bb a4 8a 7f b8 ca |y Ltd...........| +00000280 30 0c 06 03 55 1d 13 04 05 30 03 01 01 ff 30 0d |0...U....0....0.| +00000290 06 09 2a 86 48 86 f7 0d 01 01 05 05 00 03 81 81 |..*.H...........| +000002a0 00 08 6c 45 24 c7 6b b1 59 ab 0c 52 cc f2 b0 14 |..lE$.k.Y..R....| +000002b0 d7 87 9d 7a 64 75 b5 5a 95 66 e4 c5 2b 8e ae 12 |...zdu.Z.f..+...| +000002c0 66 1f eb 4f 38 b3 6e 60 d3 92 fd f7 41 08 b5 25 |f..O8.n`....A..%| +000002d0 13 b1 18 7a 24 fb 30 1d ba ed 98 b9 17 ec e7 d7 |...z$.0.........| +000002e0 31 59 db 95 d3 1d 78 ea 50 56 5c d5 82 5a 2d 5a |1Y....x.PV\..Z-Z| +000002f0 5f 33 c4 b6 d8 c9 75 90 96 8c 0f 52 98 b5 cd 98 |_3....u....R....| +00000300 1f 89 20 5f f2 a0 1c a3 1b 96 94 dd a9 fd 57 e9 |.. _..........W.| +00000310 70 e8 26 6d 71 99 9b 26 6e 38 50 29 6c 90 a7 bd |p.&mq..&n8P)l...| +00000320 d9 16 03 03 00 cd 0c 00 00 c9 03 00 17 41 04 22 |.............A."| +00000330 84 e9 5e 6e 35 92 a3 83 73 0a d6 0d 1a c1 4d ab |..^n5...s.....M.| +00000340 1f ab c2 dc 3f 53 a5 7d 38 c0 92 a4 82 e1 3c c5 |....?S.}8.....<.| +00000350 24 60 20 a5 3b c5 65 ba 9c f1 b9 a5 b9 c2 70 73 |$` .;.e.......ps| +00000360 19 74 a6 d1 0f 75 b4 75 e0 e8 60 20 e9 23 fe 04 |.t...u.u..` .#..| +00000370 01 00 80 92 e0 56 3f 48 0d 10 23 48 b5 95 b6 91 |.....V?H..#H....| +00000380 3e 8a 2e c7 02 e2 85 0e 59 c8 03 24 d9 1a 1a 25 |>.......Y..$...%| +00000390 8e 12 bb 0b 83 ac 51 36 81 3f bc 0e be b9 3b 1d |......Q6.?....;.| +000003a0 67 56 21 4d 24 36 84 05 61 e7 70 60 d5 8e ae 97 |gV!M$6..a.p`....| +000003b0 b8 3a d3 b1 94 72 52 cd b0 0d dd 46 b1 15 3b 58 |.:...rR....F..;X| +000003c0 c1 a4 63 2c 4c 31 f9 c7 4f 27 c1 0f f0 24 36 72 |..c,L1..O'...$6r| +000003d0 e0 f8 51 12 86 c2 13 ed 6b 84 a8 15 c3 d0 39 55 |..Q.....k.....9U| +000003e0 a4 60 50 88 c9 1e 60 60 aa 8d a5 31 3e 35 c3 f8 |.`P...``...1>5..| +000003f0 2c 90 1c 16 03 03 00 2e 0d 00 00 26 03 01 02 40 |,..........&...@| +00000400 00 1e 06 01 06 02 06 03 05 01 05 02 05 03 04 01 |................| +00000410 04 02 04 03 03 01 03 02 03 03 02 01 02 02 02 03 |................| +00000420 00 00 0e 00 00 00 |......| +>>> Flow 3 (client to server) +00000000 16 03 03 01 fb 0b 00 01 f7 00 01 f4 00 01 f1 30 |...............0| +00000010 82 01 ed 30 82 01 58 a0 03 02 01 02 02 01 00 30 |...0..X........0| +00000020 0b 06 09 2a 86 48 86 f7 0d 01 01 05 30 26 31 10 |...*.H......0&1.| +00000030 30 0e 06 03 55 04 0a 13 07 41 63 6d 65 20 43 6f |0...U....Acme Co| +00000040 31 12 30 10 06 03 55 04 03 13 09 31 32 37 2e 30 |1.0...U....127.0| +00000050 2e 30 2e 31 30 1e 17 0d 31 31 31 32 30 38 30 37 |.0.10...11120807| +00000060 35 35 31 32 5a 17 0d 31 32 31 32 30 37 30 38 30 |5512Z..121207080| +00000070 30 31 32 5a 30 26 31 10 30 0e 06 03 55 04 0a 13 |012Z0&1.0...U...| +00000080 07 41 63 6d 65 20 43 6f 31 12 30 10 06 03 55 04 |.Acme Co1.0...U.| +00000090 03 13 09 31 32 37 2e 30 2e 30 2e 31 30 81 9c 30 |...127.0.0.10..0| +000000a0 0b 06 09 2a 86 48 86 f7 0d 01 01 01 03 81 8c 00 |...*.H..........| +000000b0 30 81 88 02 81 80 4e d0 7b 31 e3 82 64 d9 59 c0 |0.....N.{1..d.Y.| +000000c0 c2 87 a4 5e 1e 8b 73 33 c7 63 53 df 66 92 06 84 |...^..s3.cS.f...| +000000d0 f6 64 d5 8f e4 36 a7 1d 2b e8 b3 20 36 45 23 b5 |.d...6..+.. 6E#.| +000000e0 e3 95 ae ed e0 f5 20 9c 8d 95 df 7f 5a 12 ef 87 |...... .....Z...| +000000f0 e4 5b 68 e4 e9 0e 74 ec 04 8a 7f de 93 27 c4 01 |.[h...t......'..| +00000100 19 7a bd f2 dc 3d 14 ab d0 54 ca 21 0c d0 4d 6e |.z...=...T.!..Mn| +00000110 87 2e 5c c5 d2 bb 4d 4b 4f ce b6 2c f7 7e 88 ec |..\...MKO..,.~..| +00000120 7c d7 02 91 74 a6 1e 0c 1a da e3 4a 5a 2e de 13 ||...t......JZ...| +00000130 9c 4c 40 88 59 93 02 03 01 00 01 a3 32 30 30 30 |.L@.Y.......2000| +00000140 0e 06 03 55 1d 0f 01 01 ff 04 04 03 02 00 a0 30 |...U...........0| +00000150 0d 06 03 55 1d 0e 04 06 04 04 01 02 03 04 30 0f |...U..........0.| +00000160 06 03 55 1d 23 04 08 30 06 80 04 01 02 03 04 30 |..U.#..0.......0| +00000170 0b 06 09 2a 86 48 86 f7 0d 01 01 05 03 81 81 00 |...*.H..........| +00000180 36 1f b3 7a 0c 75 c9 6e 37 46 61 2b d5 bd c0 a7 |6..z.u.n7Fa+....| +00000190 4b cc 46 9a 81 58 7c 85 79 29 c8 c8 c6 67 dd 32 |K.F..X|.y)...g.2| +000001a0 56 45 2b 75 b6 e9 24 a9 50 9a be 1f 5a fa 1a 15 |VE+u..$.P...Z...| +000001b0 d9 cc 55 95 72 16 83 b9 c2 b6 8f fd 88 8c 38 84 |..U.r.........8.| +000001c0 1d ab 5d 92 31 13 4f fd 83 3b c6 9d f1 11 62 b6 |..].1.O..;....b.| +000001d0 8b ec ab 67 be c8 64 b0 11 50 46 58 17 6b 99 1c |...g..d..PFX.k..| +000001e0 d3 1d fc 06 f1 0e e5 96 a8 0c f9 78 20 b7 44 18 |...........x .D.| +000001f0 51 8d 10 7e 4f 94 67 df a3 4e 70 73 8e 90 91 85 |Q..~O.g..Nps....| +00000200 16 03 03 00 46 10 00 00 42 41 04 1e 18 37 ef 0d |....F...BA...7..| +00000210 19 51 88 35 75 71 b5 e5 54 5b 12 2e 8f 09 67 fd |.Q.5uq..T[....g.| +00000220 a7 24 20 3e b2 56 1c ce 97 28 5e f8 2b 2d 4f 9e |.$ >.V...(^.+-O.| +00000230 f1 07 9f 6c 4b 5b 83 56 e2 32 42 e9 58 b6 d7 49 |...lK[.V.2B.X..I| +00000240 a6 b5 68 1a 41 03 56 6b dc 5a 89 16 03 03 00 88 |..h.A.Vk.Z......| +00000250 0f 00 00 84 05 01 00 80 33 bb 8e 67 64 03 e7 7e |........3..gd..~| +00000260 be a5 b1 bc cf 7a 07 24 01 17 c3 3d 4b 72 dd c3 |.....z.$...=Kr..| +00000270 64 a7 36 e8 49 ab b6 87 ce d6 af 9e 07 22 76 e8 |d.6.I........"v.| +00000280 0d 44 a3 36 c9 eb a4 49 85 cf 72 67 e8 2a a7 5b |.D.6...I..rg.*.[| +00000290 d3 f2 46 af 53 48 c6 13 f7 0b 5b 9c c7 4d 3e 05 |..F.SH....[..M>.| +000002a0 3c 0f 69 a7 40 3a e8 70 04 01 1c 29 b2 42 0f 5f |<.i.@:.p...).B._| +000002b0 1c d5 b7 5c c2 17 07 7f bd a2 b3 9a 95 81 51 24 |...\..........Q$| +000002c0 54 5c 42 d6 a4 76 c0 d7 54 d2 11 54 bf fd dc a0 |T\B..v..T..T....| +000002d0 ee 95 26 64 59 a0 fc 51 14 03 03 00 01 01 16 03 |..&dY..Q........| +000002e0 03 00 28 00 00 00 00 00 00 00 00 af f4 8a be d9 |..(.............| +000002f0 ff f1 44 e4 41 ab 9b b3 d8 b0 3d 3f 6b c5 1d b6 |..D.A.....=?k...| +00000300 1d 9e 35 f5 20 f4 2a af e8 35 77 |..5. .*..5w| +>>> Flow 4 (server to client) +00000000 14 03 03 00 01 01 16 03 03 00 28 ff 0d 47 63 2b |..........(..Gc+| +00000010 bd 00 3a ad 82 e3 a7 b3 b0 84 4a 26 f4 30 78 20 |..:.......J&.0x | +00000020 80 f2 2b 15 98 61 1c cb 8b 17 67 8a 11 96 aa 93 |..+..a....g.....| +00000030 68 f7 fb |h..| +>>> Flow 5 (client to server) +00000000 17 03 03 00 1e 00 00 00 00 00 00 00 01 a6 8d 7b |...............{| +00000010 99 5e a2 e1 95 bb 5f e4 01 f4 0e 20 52 b4 64 4e |.^...._.... R.dN| +00000020 86 b1 3f 15 03 03 00 1a 00 00 00 00 00 00 00 02 |..?.............| +00000030 61 98 eb d0 7c ac bd 00 ac 7a e1 32 20 3e 81 b6 |a...|....z.2 >..| +00000040 9d d5 |..| diff --git a/src/crypto/tls/testdata/Client-TLSv12-ClientCert-RSA-ECDSA b/src/crypto/tls/testdata/Client-TLSv12-ClientCert-RSA-ECDSA new file mode 100644 index 0000000000000000000000000000000000000000..23bf29d776e1b441673c6e30c982dc627b94d4e3 --- /dev/null +++ b/src/crypto/tls/testdata/Client-TLSv12-ClientCert-RSA-ECDSA @@ -0,0 +1,133 @@ +>>> Flow 1 (client to server) +00000000 16 03 01 00 81 01 00 00 7d 03 03 00 00 00 00 00 |........}.......| +00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| +00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 1e c0 2f |.............../| +00000030 c0 2b c0 30 c0 2c c0 11 c0 07 c0 13 c0 09 c0 14 |.+.0.,..........| +00000040 c0 0a 00 05 00 2f 00 35 c0 12 00 0a 01 00 00 36 |...../.5.......6| +00000050 00 05 00 05 01 00 00 00 00 00 0a 00 08 00 06 00 |................| +00000060 17 00 18 00 19 00 0b 00 02 01 00 00 0d 00 0e 00 |................| +00000070 0c 04 01 04 03 05 01 05 03 02 01 02 03 ff 01 00 |................| +00000080 01 00 00 12 00 00 |......| +>>> Flow 2 (server to client) +00000000 16 03 03 00 59 02 00 00 55 03 03 b3 7f 4e e7 11 |....Y...U....N..| +00000010 6d bc 56 ec 9c a8 61 08 d6 5a 2a 42 7b f1 94 0a |m.V...a..Z*B{...| +00000020 29 35 8b 7e 23 a0 6c 59 23 cf 39 20 84 09 b6 5b |)5.~#.lY#.9 ...[| +00000030 2f 46 80 3b 26 92 fd 81 e9 24 8c e2 b8 64 a2 03 |/F.;&....$...d..| +00000040 3a 68 c3 7b 44 f8 28 41 e2 d3 6c 7c c0 09 00 00 |:h.{D.(A..l|....| +00000050 0d ff 01 00 01 00 00 0b 00 04 03 00 01 02 16 03 |................| +00000060 03 02 0e 0b 00 02 0a 00 02 07 00 02 04 30 82 02 |.............0..| +00000070 00 30 82 01 62 02 09 00 b8 bf 2d 47 a0 d2 eb f4 |.0..b.....-G....| +00000080 30 09 06 07 2a 86 48 ce 3d 04 01 30 45 31 0b 30 |0...*.H.=..0E1.0| +00000090 09 06 03 55 04 06 13 02 41 55 31 13 30 11 06 03 |...U....AU1.0...| +000000a0 55 04 08 13 0a 53 6f 6d 65 2d 53 74 61 74 65 31 |U....Some-State1| +000000b0 21 30 1f 06 03 55 04 0a 13 18 49 6e 74 65 72 6e |!0...U....Intern| +000000c0 65 74 20 57 69 64 67 69 74 73 20 50 74 79 20 4c |et Widgits Pty L| +000000d0 74 64 30 1e 17 0d 31 32 31 31 32 32 31 35 30 36 |td0...1211221506| +000000e0 33 32 5a 17 0d 32 32 31 31 32 30 31 35 30 36 33 |32Z..22112015063| +000000f0 32 5a 30 45 31 0b 30 09 06 03 55 04 06 13 02 41 |2Z0E1.0...U....A| +00000100 55 31 13 30 11 06 03 55 04 08 13 0a 53 6f 6d 65 |U1.0...U....Some| +00000110 2d 53 74 61 74 65 31 21 30 1f 06 03 55 04 0a 13 |-State1!0...U...| +00000120 18 49 6e 74 65 72 6e 65 74 20 57 69 64 67 69 74 |.Internet Widgit| +00000130 73 20 50 74 79 20 4c 74 64 30 81 9b 30 10 06 07 |s Pty Ltd0..0...| +00000140 2a 86 48 ce 3d 02 01 06 05 2b 81 04 00 23 03 81 |*.H.=....+...#..| +00000150 86 00 04 00 c4 a1 ed be 98 f9 0b 48 73 36 7e c3 |...........Hs6~.| +00000160 16 56 11 22 f2 3d 53 c3 3b 4d 21 3d cd 6b 75 e6 |.V.".=S.;M!=.ku.| +00000170 f6 b0 dc 9a df 26 c1 bc b2 87 f0 72 32 7c b3 64 |.....&.....r2|.d| +00000180 2f 1c 90 bc ea 68 23 10 7e fe e3 25 c0 48 3a 69 |/....h#.~..%.H:i| +00000190 e0 28 6d d3 37 00 ef 04 62 dd 0d a0 9c 70 62 83 |.(m.7...b....pb.| +000001a0 d8 81 d3 64 31 aa 9e 97 31 bd 96 b0 68 c0 9b 23 |...d1...1...h..#| +000001b0 de 76 64 3f 1a 5c 7f e9 12 0e 58 58 b6 5f 70 dd |.vd?.\....XX._p.| +000001c0 9b d8 ea d5 d7 f5 d5 cc b9 b6 9f 30 66 5b 66 9a |...........0f[f.| +000001d0 20 e2 27 e5 bf fe 3b 30 09 06 07 2a 86 48 ce 3d | .'...;0...*.H.=| +000001e0 04 01 03 81 8c 00 30 81 88 02 42 01 88 a2 4f eb |......0...B...O.| +000001f0 e2 45 c5 48 7d 1b ac f5 ed 98 9d ae 47 70 c0 5e |.E.H}.......Gp.^| +00000200 1b b6 2f bd f1 b6 4d b7 61 40 d3 11 a2 ce ee 0b |../...M.a@......| +00000210 7e 92 7e ff 76 9d c3 3b 7e a5 3f ce fa 10 e2 59 |~.~.v..;~.?....Y| +00000220 ec 47 2d 7c ac da 4e 97 0e 15 a0 6f d0 02 42 01 |.G-|..N....o..B.| +00000230 4d fc be 67 13 9c 2d 05 0e bd 3f a3 8c 25 c1 33 |M..g..-...?..%.3| +00000240 13 83 0d 94 06 bb d4 37 7a f6 ec 7a c9 86 2e dd |.......7z..z....| +00000250 d7 11 69 7f 85 7c 56 de fb 31 78 2b e4 c7 78 0d |..i..|V..1x+..x.| +00000260 ae cb be 9e 4e 36 24 31 7b 6a 0f 39 95 12 07 8f |....N6$1{j.9....| +00000270 2a 16 03 03 00 d7 0c 00 00 d3 03 00 17 41 04 0f |*............A..| +00000280 4d b0 41 d4 dc 6b 8a 85 52 eb eb 18 4a 8f a7 e6 |M.A..k..R...J...| +00000290 24 52 e5 86 be 57 d7 0a e7 23 84 a8 a9 6c 96 08 |$R...W...#...l..| +000002a0 4b f7 47 32 79 d9 df 81 f6 05 40 63 3b 14 67 3b |K.G2y.....@c;.g;| +000002b0 ea 01 a0 0d 43 1a 36 29 b3 51 7a e4 af 1b 67 04 |....C.6).Qz...g.| +000002c0 03 00 8a 30 81 87 02 42 01 8e 57 8a b8 b7 5b 2f |...0...B..W...[/| +000002d0 9c 31 74 d8 7d 68 d7 6e 83 73 5f fb d0 cd de 66 |.1t.}h.n.s_....f| +000002e0 60 fa 0a 0a 15 0b 30 3b 08 b6 f1 3e 4f 20 13 62 |`.....0;...>O .b| +000002f0 b5 ff 86 81 dc 42 a1 4c af c8 ff b3 24 81 d8 e1 |.....B.L....$...| +00000300 d1 09 0c 32 11 92 5e dd 3f 87 02 41 76 a7 29 48 |...2..^.?..Av.)H| +00000310 52 68 1c 72 4d d5 39 bf fa 61 ec b2 27 ce 10 4e |Rh.rM.9..a..'..N| +00000320 86 12 3d 1e 04 9c 11 b7 b4 0c cf 98 9d 01 c3 93 |..=.............| +00000330 cf 83 9e 92 9a ca fd 8f b1 9f 1b 20 c4 fb a4 46 |........... ...F| +00000340 60 fc fd d5 33 b0 8f b5 b5 c8 a4 70 c5 16 03 03 |`...3......p....| +00000350 00 2e 0d 00 00 26 03 01 02 40 00 1e 06 01 06 02 |.....&...@......| +00000360 06 03 05 01 05 02 05 03 04 01 04 02 04 03 03 01 |................| +00000370 03 02 03 03 02 01 02 02 02 03 00 00 0e 00 00 00 |................| +>>> Flow 3 (client to server) +00000000 16 03 03 01 fb 0b 00 01 f7 00 01 f4 00 01 f1 30 |...............0| +00000010 82 01 ed 30 82 01 58 a0 03 02 01 02 02 01 00 30 |...0..X........0| +00000020 0b 06 09 2a 86 48 86 f7 0d 01 01 05 30 26 31 10 |...*.H......0&1.| +00000030 30 0e 06 03 55 04 0a 13 07 41 63 6d 65 20 43 6f |0...U....Acme Co| +00000040 31 12 30 10 06 03 55 04 03 13 09 31 32 37 2e 30 |1.0...U....127.0| +00000050 2e 30 2e 31 30 1e 17 0d 31 31 31 32 30 38 30 37 |.0.10...11120807| +00000060 35 35 31 32 5a 17 0d 31 32 31 32 30 37 30 38 30 |5512Z..121207080| +00000070 30 31 32 5a 30 26 31 10 30 0e 06 03 55 04 0a 13 |012Z0&1.0...U...| +00000080 07 41 63 6d 65 20 43 6f 31 12 30 10 06 03 55 04 |.Acme Co1.0...U.| +00000090 03 13 09 31 32 37 2e 30 2e 30 2e 31 30 81 9c 30 |...127.0.0.10..0| +000000a0 0b 06 09 2a 86 48 86 f7 0d 01 01 01 03 81 8c 00 |...*.H..........| +000000b0 30 81 88 02 81 80 4e d0 7b 31 e3 82 64 d9 59 c0 |0.....N.{1..d.Y.| +000000c0 c2 87 a4 5e 1e 8b 73 33 c7 63 53 df 66 92 06 84 |...^..s3.cS.f...| +000000d0 f6 64 d5 8f e4 36 a7 1d 2b e8 b3 20 36 45 23 b5 |.d...6..+.. 6E#.| +000000e0 e3 95 ae ed e0 f5 20 9c 8d 95 df 7f 5a 12 ef 87 |...... .....Z...| +000000f0 e4 5b 68 e4 e9 0e 74 ec 04 8a 7f de 93 27 c4 01 |.[h...t......'..| +00000100 19 7a bd f2 dc 3d 14 ab d0 54 ca 21 0c d0 4d 6e |.z...=...T.!..Mn| +00000110 87 2e 5c c5 d2 bb 4d 4b 4f ce b6 2c f7 7e 88 ec |..\...MKO..,.~..| +00000120 7c d7 02 91 74 a6 1e 0c 1a da e3 4a 5a 2e de 13 ||...t......JZ...| +00000130 9c 4c 40 88 59 93 02 03 01 00 01 a3 32 30 30 30 |.L@.Y.......2000| +00000140 0e 06 03 55 1d 0f 01 01 ff 04 04 03 02 00 a0 30 |...U...........0| +00000150 0d 06 03 55 1d 0e 04 06 04 04 01 02 03 04 30 0f |...U..........0.| +00000160 06 03 55 1d 23 04 08 30 06 80 04 01 02 03 04 30 |..U.#..0.......0| +00000170 0b 06 09 2a 86 48 86 f7 0d 01 01 05 03 81 81 00 |...*.H..........| +00000180 36 1f b3 7a 0c 75 c9 6e 37 46 61 2b d5 bd c0 a7 |6..z.u.n7Fa+....| +00000190 4b cc 46 9a 81 58 7c 85 79 29 c8 c8 c6 67 dd 32 |K.F..X|.y)...g.2| +000001a0 56 45 2b 75 b6 e9 24 a9 50 9a be 1f 5a fa 1a 15 |VE+u..$.P...Z...| +000001b0 d9 cc 55 95 72 16 83 b9 c2 b6 8f fd 88 8c 38 84 |..U.r.........8.| +000001c0 1d ab 5d 92 31 13 4f fd 83 3b c6 9d f1 11 62 b6 |..].1.O..;....b.| +000001d0 8b ec ab 67 be c8 64 b0 11 50 46 58 17 6b 99 1c |...g..d..PFX.k..| +000001e0 d3 1d fc 06 f1 0e e5 96 a8 0c f9 78 20 b7 44 18 |...........x .D.| +000001f0 51 8d 10 7e 4f 94 67 df a3 4e 70 73 8e 90 91 85 |Q..~O.g..Nps....| +00000200 16 03 03 00 46 10 00 00 42 41 04 1e 18 37 ef 0d |....F...BA...7..| +00000210 19 51 88 35 75 71 b5 e5 54 5b 12 2e 8f 09 67 fd |.Q.5uq..T[....g.| +00000220 a7 24 20 3e b2 56 1c ce 97 28 5e f8 2b 2d 4f 9e |.$ >.V...(^.+-O.| +00000230 f1 07 9f 6c 4b 5b 83 56 e2 32 42 e9 58 b6 d7 49 |...lK[.V.2B.X..I| +00000240 a6 b5 68 1a 41 03 56 6b dc 5a 89 16 03 03 00 88 |..h.A.Vk.Z......| +00000250 0f 00 00 84 05 01 00 80 02 19 16 cc 97 ad 70 20 |..............p | +00000260 bd 64 63 dd b6 81 a0 16 b3 46 4b 42 ff 21 58 2c |.dc......FKB.!X,| +00000270 bb 2b 4c e1 4e d7 49 4d 5c 7c 63 32 3e ef e6 ad |.+L.N.IM\|c2>...| +00000280 85 3f ab b4 5c 2a 37 76 8b 28 56 08 4f 08 b9 51 |.?..\*7v.(V.O..Q| +00000290 71 14 07 27 47 45 11 a0 03 cf 72 7d 67 ef 31 8d |q..'GE....r}g.1.| +000002a0 e7 db 36 76 b1 b3 f4 bf aa 6c c4 56 94 35 71 e1 |..6v.....l.V.5q.| +000002b0 dd 88 6d 15 90 c8 70 ad d8 95 55 42 9b c1 45 19 |..m...p...UB..E.| +000002c0 36 ce 87 c6 fd 94 8a d4 98 6e ec 18 d5 da 59 54 |6........n....YT| +000002d0 80 a7 8c 90 ae 55 20 1c 14 03 03 00 01 01 16 03 |.....U .........| +000002e0 03 00 40 00 00 00 00 00 00 00 00 00 00 00 00 00 |..@.............| +000002f0 00 00 00 58 fe bc 5c ba b2 a9 96 77 2f 95 c9 10 |...X..\....w/...| +00000300 fd 6d fc 6a 88 8c df 82 c3 a4 3d cc 28 f4 bf 7d |.m.j......=.(..}| +00000310 4a f8 3d 97 36 e5 a0 76 92 94 da dd cc f5 e4 0e |J.=.6..v........| +00000320 7a c4 2c |z.,| +>>> Flow 4 (server to client) +00000000 14 03 03 00 01 01 16 03 03 00 40 81 ab 5a 66 a8 |..........@..Zf.| +00000010 0f a5 d3 07 00 66 45 1f 31 a9 ef f7 a0 d9 23 46 |.....fE.1.....#F| +00000020 f0 3e 50 18 99 e3 5a bd eb b7 1d 81 d5 95 d5 ee |.>P...Z.........| +00000030 21 31 41 4b 19 92 b5 95 36 da 21 c0 4a 2a a0 1c |!1AK....6.!.J*..| +00000040 a3 9f 8e a0 6f 9d 37 5e 12 11 03 |....o.7^...| +>>> Flow 5 (client to server) +00000000 17 03 03 00 30 00 00 00 00 00 00 00 00 00 00 00 |....0...........| +00000010 00 00 00 00 00 a9 51 94 19 72 ab 9f 3e 97 5e 99 |......Q..r..>.^.| +00000020 2c ec 13 48 3e 10 54 5f 8a 85 88 4d 1a a8 f5 ed |,..H>.T_...M....| +00000030 c3 4f a9 59 a3 15 03 03 00 30 00 00 00 00 00 00 |.O.Y.....0......| +00000040 00 00 00 00 00 00 00 00 00 00 25 00 6d 2f a0 f6 |..........%.m/..| +00000050 ce 8a 30 ba 53 da 97 c6 11 f3 d2 f3 9e 66 d6 dd |..0.S........f..| +00000060 19 f3 ee 07 03 d3 e6 f1 30 32 |........02| diff --git a/src/crypto/tls/testdata/Client-TLSv12-ClientCert-RSA-RSA b/src/crypto/tls/testdata/Client-TLSv12-ClientCert-RSA-RSA new file mode 100644 index 0000000000000000000000000000000000000000..ff79aa236c569cce02ef8a9fe8489f310211b449 --- /dev/null +++ b/src/crypto/tls/testdata/Client-TLSv12-ClientCert-RSA-RSA @@ -0,0 +1,127 @@ +>>> Flow 1 (client to server) +00000000 16 03 01 00 81 01 00 00 7d 03 03 00 00 00 00 00 |........}.......| +00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| +00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 1e c0 2f |.............../| +00000030 c0 2b c0 30 c0 2c c0 11 c0 07 c0 13 c0 09 c0 14 |.+.0.,..........| +00000040 c0 0a 00 05 00 2f 00 35 c0 12 00 0a 01 00 00 36 |...../.5.......6| +00000050 00 05 00 05 01 00 00 00 00 00 0a 00 08 00 06 00 |................| +00000060 17 00 18 00 19 00 0b 00 02 01 00 00 0d 00 0e 00 |................| +00000070 0c 04 01 04 03 05 01 05 03 02 01 02 03 ff 01 00 |................| +00000080 01 00 00 12 00 00 |......| +>>> Flow 2 (server to client) +00000000 16 03 03 00 51 02 00 00 4d 03 03 b3 b2 22 69 e4 |....Q...M...."i.| +00000010 1a a1 56 94 26 0c 43 b7 89 0c 34 ce dc 5a c8 ca |..V.&.C...4..Z..| +00000020 e2 42 92 5c 75 9a b3 22 22 64 38 20 6d 2c 26 0b |.B.\u..""d8 m,&.| +00000030 34 b6 b8 20 36 e2 58 e5 ee 1f e2 9f a0 75 f6 d9 |4.. 6.X......u..| +00000040 0c e4 39 ce 3c 8e 2e f8 e8 d1 a2 16 00 05 00 00 |..9.<...........| +00000050 05 ff 01 00 01 00 16 03 03 02 be 0b 00 02 ba 00 |................| +00000060 02 b7 00 02 b4 30 82 02 b0 30 82 02 19 a0 03 02 |.....0...0......| +00000070 01 02 02 09 00 85 b0 bb a4 8a 7f b8 ca 30 0d 06 |.............0..| +00000080 09 2a 86 48 86 f7 0d 01 01 05 05 00 30 45 31 0b |.*.H........0E1.| +00000090 30 09 06 03 55 04 06 13 02 41 55 31 13 30 11 06 |0...U....AU1.0..| +000000a0 03 55 04 08 13 0a 53 6f 6d 65 2d 53 74 61 74 65 |.U....Some-State| +000000b0 31 21 30 1f 06 03 55 04 0a 13 18 49 6e 74 65 72 |1!0...U....Inter| +000000c0 6e 65 74 20 57 69 64 67 69 74 73 20 50 74 79 20 |net Widgits Pty | +000000d0 4c 74 64 30 1e 17 0d 31 30 30 34 32 34 30 39 30 |Ltd0...100424090| +000000e0 39 33 38 5a 17 0d 31 31 30 34 32 34 30 39 30 39 |938Z..1104240909| +000000f0 33 38 5a 30 45 31 0b 30 09 06 03 55 04 06 13 02 |38Z0E1.0...U....| +00000100 41 55 31 13 30 11 06 03 55 04 08 13 0a 53 6f 6d |AU1.0...U....Som| +00000110 65 2d 53 74 61 74 65 31 21 30 1f 06 03 55 04 0a |e-State1!0...U..| +00000120 13 18 49 6e 74 65 72 6e 65 74 20 57 69 64 67 69 |..Internet Widgi| +00000130 74 73 20 50 74 79 20 4c 74 64 30 81 9f 30 0d 06 |ts Pty Ltd0..0..| +00000140 09 2a 86 48 86 f7 0d 01 01 01 05 00 03 81 8d 00 |.*.H............| +00000150 30 81 89 02 81 81 00 bb 79 d6 f5 17 b5 e5 bf 46 |0.......y......F| +00000160 10 d0 dc 69 be e6 2b 07 43 5a d0 03 2d 8a 7a 43 |...i..+.CZ..-.zC| +00000170 85 b7 14 52 e7 a5 65 4c 2c 78 b8 23 8c b5 b4 82 |...R..eL,x.#....| +00000180 e5 de 1f 95 3b 7e 62 a5 2c a5 33 d6 fe 12 5c 7a |....;~b.,.3...\z| +00000190 56 fc f5 06 bf fa 58 7b 26 3f b5 cd 04 d3 d0 c9 |V.....X{&?......| +000001a0 21 96 4a c7 f4 54 9f 5a bf ef 42 71 00 fe 18 99 |!.J..T.Z..Bq....| +000001b0 07 7f 7e 88 7d 7d f1 04 39 c4 a2 2e db 51 c9 7c |..~.}}..9....Q.|| +000001c0 e3 c0 4c 3b 32 66 01 cf af b1 1d b8 71 9a 1d db |..L;2f......q...| +000001d0 db 89 6b ae da 2d 79 02 03 01 00 01 a3 81 a7 30 |..k..-y........0| +000001e0 81 a4 30 1d 06 03 55 1d 0e 04 16 04 14 b1 ad e2 |..0...U.........| +000001f0 85 5a cf cb 28 db 69 ce 23 69 de d3 26 8e 18 88 |.Z..(.i.#i..&...| +00000200 39 30 75 06 03 55 1d 23 04 6e 30 6c 80 14 b1 ad |90u..U.#.n0l....| +00000210 e2 85 5a cf cb 28 db 69 ce 23 69 de d3 26 8e 18 |..Z..(.i.#i..&..| +00000220 88 39 a1 49 a4 47 30 45 31 0b 30 09 06 03 55 04 |.9.I.G0E1.0...U.| +00000230 06 13 02 41 55 31 13 30 11 06 03 55 04 08 13 0a |...AU1.0...U....| +00000240 53 6f 6d 65 2d 53 74 61 74 65 31 21 30 1f 06 03 |Some-State1!0...| +00000250 55 04 0a 13 18 49 6e 74 65 72 6e 65 74 20 57 69 |U....Internet Wi| +00000260 64 67 69 74 73 20 50 74 79 20 4c 74 64 82 09 00 |dgits Pty Ltd...| +00000270 85 b0 bb a4 8a 7f b8 ca 30 0c 06 03 55 1d 13 04 |........0...U...| +00000280 05 30 03 01 01 ff 30 0d 06 09 2a 86 48 86 f7 0d |.0....0...*.H...| +00000290 01 01 05 05 00 03 81 81 00 08 6c 45 24 c7 6b b1 |..........lE$.k.| +000002a0 59 ab 0c 52 cc f2 b0 14 d7 87 9d 7a 64 75 b5 5a |Y..R.......zdu.Z| +000002b0 95 66 e4 c5 2b 8e ae 12 66 1f eb 4f 38 b3 6e 60 |.f..+...f..O8.n`| +000002c0 d3 92 fd f7 41 08 b5 25 13 b1 18 7a 24 fb 30 1d |....A..%...z$.0.| +000002d0 ba ed 98 b9 17 ec e7 d7 31 59 db 95 d3 1d 78 ea |........1Y....x.| +000002e0 50 56 5c d5 82 5a 2d 5a 5f 33 c4 b6 d8 c9 75 90 |PV\..Z-Z_3....u.| +000002f0 96 8c 0f 52 98 b5 cd 98 1f 89 20 5f f2 a0 1c a3 |...R...... _....| +00000300 1b 96 94 dd a9 fd 57 e9 70 e8 26 6d 71 99 9b 26 |......W.p.&mq..&| +00000310 6e 38 50 29 6c 90 a7 bd d9 16 03 03 00 2e 0d 00 |n8P)l...........| +00000320 00 26 03 01 02 40 00 1e 06 01 06 02 06 03 05 01 |.&...@..........| +00000330 05 02 05 03 04 01 04 02 04 03 03 01 03 02 03 03 |................| +00000340 02 01 02 02 02 03 00 00 0e 00 00 00 |............| +>>> Flow 3 (client to server) +00000000 16 03 03 01 fb 0b 00 01 f7 00 01 f4 00 01 f1 30 |...............0| +00000010 82 01 ed 30 82 01 58 a0 03 02 01 02 02 01 00 30 |...0..X........0| +00000020 0b 06 09 2a 86 48 86 f7 0d 01 01 05 30 26 31 10 |...*.H......0&1.| +00000030 30 0e 06 03 55 04 0a 13 07 41 63 6d 65 20 43 6f |0...U....Acme Co| +00000040 31 12 30 10 06 03 55 04 03 13 09 31 32 37 2e 30 |1.0...U....127.0| +00000050 2e 30 2e 31 30 1e 17 0d 31 31 31 32 30 38 30 37 |.0.10...11120807| +00000060 35 35 31 32 5a 17 0d 31 32 31 32 30 37 30 38 30 |5512Z..121207080| +00000070 30 31 32 5a 30 26 31 10 30 0e 06 03 55 04 0a 13 |012Z0&1.0...U...| +00000080 07 41 63 6d 65 20 43 6f 31 12 30 10 06 03 55 04 |.Acme Co1.0...U.| +00000090 03 13 09 31 32 37 2e 30 2e 30 2e 31 30 81 9c 30 |...127.0.0.10..0| +000000a0 0b 06 09 2a 86 48 86 f7 0d 01 01 01 03 81 8c 00 |...*.H..........| +000000b0 30 81 88 02 81 80 4e d0 7b 31 e3 82 64 d9 59 c0 |0.....N.{1..d.Y.| +000000c0 c2 87 a4 5e 1e 8b 73 33 c7 63 53 df 66 92 06 84 |...^..s3.cS.f...| +000000d0 f6 64 d5 8f e4 36 a7 1d 2b e8 b3 20 36 45 23 b5 |.d...6..+.. 6E#.| +000000e0 e3 95 ae ed e0 f5 20 9c 8d 95 df 7f 5a 12 ef 87 |...... .....Z...| +000000f0 e4 5b 68 e4 e9 0e 74 ec 04 8a 7f de 93 27 c4 01 |.[h...t......'..| +00000100 19 7a bd f2 dc 3d 14 ab d0 54 ca 21 0c d0 4d 6e |.z...=...T.!..Mn| +00000110 87 2e 5c c5 d2 bb 4d 4b 4f ce b6 2c f7 7e 88 ec |..\...MKO..,.~..| +00000120 7c d7 02 91 74 a6 1e 0c 1a da e3 4a 5a 2e de 13 ||...t......JZ...| +00000130 9c 4c 40 88 59 93 02 03 01 00 01 a3 32 30 30 30 |.L@.Y.......2000| +00000140 0e 06 03 55 1d 0f 01 01 ff 04 04 03 02 00 a0 30 |...U...........0| +00000150 0d 06 03 55 1d 0e 04 06 04 04 01 02 03 04 30 0f |...U..........0.| +00000160 06 03 55 1d 23 04 08 30 06 80 04 01 02 03 04 30 |..U.#..0.......0| +00000170 0b 06 09 2a 86 48 86 f7 0d 01 01 05 03 81 81 00 |...*.H..........| +00000180 36 1f b3 7a 0c 75 c9 6e 37 46 61 2b d5 bd c0 a7 |6..z.u.n7Fa+....| +00000190 4b cc 46 9a 81 58 7c 85 79 29 c8 c8 c6 67 dd 32 |K.F..X|.y)...g.2| +000001a0 56 45 2b 75 b6 e9 24 a9 50 9a be 1f 5a fa 1a 15 |VE+u..$.P...Z...| +000001b0 d9 cc 55 95 72 16 83 b9 c2 b6 8f fd 88 8c 38 84 |..U.r.........8.| +000001c0 1d ab 5d 92 31 13 4f fd 83 3b c6 9d f1 11 62 b6 |..].1.O..;....b.| +000001d0 8b ec ab 67 be c8 64 b0 11 50 46 58 17 6b 99 1c |...g..d..PFX.k..| +000001e0 d3 1d fc 06 f1 0e e5 96 a8 0c f9 78 20 b7 44 18 |...........x .D.| +000001f0 51 8d 10 7e 4f 94 67 df a3 4e 70 73 8e 90 91 85 |Q..~O.g..Nps....| +00000200 16 03 03 00 86 10 00 00 82 00 80 6d 51 f3 7f f9 |...........mQ...| +00000210 3e fb 75 82 41 36 83 e8 6a ee 2a 2e 25 90 67 4c |>.u.A6..j.*.%.gL| +00000220 8e 62 2f 30 81 17 e0 85 09 0c 2b b7 23 d7 b0 e2 |.b/0......+.#...| +00000230 1d f7 3b d7 f5 a1 27 b6 ee 24 b6 1b cc 5b ea 66 |..;...'..$...[.f| +00000240 0d 6a f4 e5 85 f9 da 43 b4 0e 86 85 e1 f5 aa be |.j.....C........| +00000250 c8 ce 39 4c 9c 86 00 08 c2 4b e2 c6 ec 2f f7 ce |..9L.....K.../..| +00000260 e6 bd 77 82 6f 23 b6 e0 bd a2 92 b7 3a ac e8 56 |..w.o#......:..V| +00000270 f1 af 54 5e 46 87 e9 3b 33 e7 b8 28 b7 d6 c8 90 |..T^F..;3..(....| +00000280 35 d4 1c 43 d1 30 6f 55 4e 0a 70 16 03 03 00 88 |5..C.0oUN.p.....| +00000290 0f 00 00 84 05 01 00 80 01 24 8d bb 05 61 2d 29 |.........$...a-)| +000002a0 12 11 90 f5 57 21 be b7 29 76 55 63 94 8e 7b 4d |....W!..)vUc..{M| +000002b0 3b 3d 89 5b 1f b9 e1 8c 36 68 6f 31 21 50 af e4 |;=.[....6ho1!P..| +000002c0 9f ca a5 68 55 b9 eb 36 75 3a 0c be 11 30 28 c8 |...hU..6u:...0(.| +000002d0 8b 82 93 9a 71 37 4d 4e 4f d2 0c 2f 13 36 ad c3 |....q7MNO../.6..| +000002e0 df 8a 1b 59 b2 f9 8b a7 74 63 75 4a f4 9d e0 6b |...Y....tcuJ...k| +000002f0 42 02 5a a9 6e a4 a8 24 d3 23 f7 09 ee b0 dc c4 |B.Z.n..$.#......| +00000300 6f 87 58 72 e7 e3 87 b3 6b 15 ba 7f dd 9b 93 91 |o.Xr....k.......| +00000310 5b 21 a0 31 31 bd 15 b5 14 03 03 00 01 01 16 03 |[!.11...........| +00000320 03 00 24 fc 0e 7c e8 3e 8b b5 dc c9 3d 38 61 a1 |..$..|.>....=8a.| +00000330 24 d6 77 1f 06 1f 30 32 ba dd 05 68 45 f1 4f 0d |$.w...02...hE.O.| +00000340 2e 24 09 ad c1 e5 b7 |.$.....| +>>> Flow 4 (server to client) +00000000 14 03 03 00 01 01 16 03 03 00 24 d7 b6 b3 0a e6 |..........$.....| +00000010 86 9a 25 e4 38 de d0 57 ff 93 0b f4 de 76 3d 00 |..%.8..W.....v=.| +00000020 64 35 cf 70 f6 ea 74 2d b0 71 2d 92 e2 df eb |d5.p..t-.q-....| +>>> Flow 5 (client to server) +00000000 17 03 03 00 1a db bd 43 12 7c b5 83 b5 18 9d 6a |.......C.|.....j| +00000010 70 3f 5a eb cb d0 ba d4 03 3e a0 7b 25 f0 41 15 |p?Z......>.{%.A.| +00000020 03 03 00 16 f8 f2 a3 27 a5 c7 25 d9 6c 08 b1 96 |.......'..%.l...| +00000030 38 22 38 df 16 fb e2 9f 61 a3 |8"8.....a.| diff --git a/src/crypto/tls/testdata/Client-TLSv12-ECDHE-ECDSA-AES b/src/crypto/tls/testdata/Client-TLSv12-ECDHE-ECDSA-AES new file mode 100644 index 0000000000000000000000000000000000000000..e700e16352a692cca48ce48dc141b5d317fecde7 --- /dev/null +++ b/src/crypto/tls/testdata/Client-TLSv12-ECDHE-ECDSA-AES @@ -0,0 +1,90 @@ +>>> Flow 1 (client to server) +00000000 16 03 01 00 81 01 00 00 7d 03 03 00 00 00 00 00 |........}.......| +00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| +00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 1e c0 2f |.............../| +00000030 c0 2b c0 30 c0 2c c0 11 c0 07 c0 13 c0 09 c0 14 |.+.0.,..........| +00000040 c0 0a 00 05 00 2f 00 35 c0 12 00 0a 01 00 00 36 |...../.5.......6| +00000050 00 05 00 05 01 00 00 00 00 00 0a 00 08 00 06 00 |................| +00000060 17 00 18 00 19 00 0b 00 02 01 00 00 0d 00 0e 00 |................| +00000070 0c 04 01 04 03 05 01 05 03 02 01 02 03 ff 01 00 |................| +00000080 01 00 00 12 00 00 |......| +>>> Flow 2 (server to client) +00000000 16 03 03 00 59 02 00 00 55 03 03 21 9b eb 15 24 |....Y...U..!...$| +00000010 46 b6 c1 85 f5 be c5 0d e2 6b 60 bc ee 73 b1 fb |F........k`..s..| +00000020 34 6f f0 b8 f0 9e 1c 26 a4 4b 0f 20 cb 2b 84 a2 |4o.....&.K. .+..| +00000030 cb a5 48 70 fe 84 25 b0 16 20 14 a1 83 21 fc f9 |..Hp..%.. ...!..| +00000040 82 fc 9e 1a d1 3b 56 69 ab c5 0e 2c c0 09 00 00 |.....;Vi...,....| +00000050 0d ff 01 00 01 00 00 0b 00 04 03 00 01 02 16 03 |................| +00000060 03 02 0e 0b 00 02 0a 00 02 07 00 02 04 30 82 02 |.............0..| +00000070 00 30 82 01 62 02 09 00 b8 bf 2d 47 a0 d2 eb f4 |.0..b.....-G....| +00000080 30 09 06 07 2a 86 48 ce 3d 04 01 30 45 31 0b 30 |0...*.H.=..0E1.0| +00000090 09 06 03 55 04 06 13 02 41 55 31 13 30 11 06 03 |...U....AU1.0...| +000000a0 55 04 08 13 0a 53 6f 6d 65 2d 53 74 61 74 65 31 |U....Some-State1| +000000b0 21 30 1f 06 03 55 04 0a 13 18 49 6e 74 65 72 6e |!0...U....Intern| +000000c0 65 74 20 57 69 64 67 69 74 73 20 50 74 79 20 4c |et Widgits Pty L| +000000d0 74 64 30 1e 17 0d 31 32 31 31 32 32 31 35 30 36 |td0...1211221506| +000000e0 33 32 5a 17 0d 32 32 31 31 32 30 31 35 30 36 33 |32Z..22112015063| +000000f0 32 5a 30 45 31 0b 30 09 06 03 55 04 06 13 02 41 |2Z0E1.0...U....A| +00000100 55 31 13 30 11 06 03 55 04 08 13 0a 53 6f 6d 65 |U1.0...U....Some| +00000110 2d 53 74 61 74 65 31 21 30 1f 06 03 55 04 0a 13 |-State1!0...U...| +00000120 18 49 6e 74 65 72 6e 65 74 20 57 69 64 67 69 74 |.Internet Widgit| +00000130 73 20 50 74 79 20 4c 74 64 30 81 9b 30 10 06 07 |s Pty Ltd0..0...| +00000140 2a 86 48 ce 3d 02 01 06 05 2b 81 04 00 23 03 81 |*.H.=....+...#..| +00000150 86 00 04 00 c4 a1 ed be 98 f9 0b 48 73 36 7e c3 |...........Hs6~.| +00000160 16 56 11 22 f2 3d 53 c3 3b 4d 21 3d cd 6b 75 e6 |.V.".=S.;M!=.ku.| +00000170 f6 b0 dc 9a df 26 c1 bc b2 87 f0 72 32 7c b3 64 |.....&.....r2|.d| +00000180 2f 1c 90 bc ea 68 23 10 7e fe e3 25 c0 48 3a 69 |/....h#.~..%.H:i| +00000190 e0 28 6d d3 37 00 ef 04 62 dd 0d a0 9c 70 62 83 |.(m.7...b....pb.| +000001a0 d8 81 d3 64 31 aa 9e 97 31 bd 96 b0 68 c0 9b 23 |...d1...1...h..#| +000001b0 de 76 64 3f 1a 5c 7f e9 12 0e 58 58 b6 5f 70 dd |.vd?.\....XX._p.| +000001c0 9b d8 ea d5 d7 f5 d5 cc b9 b6 9f 30 66 5b 66 9a |...........0f[f.| +000001d0 20 e2 27 e5 bf fe 3b 30 09 06 07 2a 86 48 ce 3d | .'...;0...*.H.=| +000001e0 04 01 03 81 8c 00 30 81 88 02 42 01 88 a2 4f eb |......0...B...O.| +000001f0 e2 45 c5 48 7d 1b ac f5 ed 98 9d ae 47 70 c0 5e |.E.H}.......Gp.^| +00000200 1b b6 2f bd f1 b6 4d b7 61 40 d3 11 a2 ce ee 0b |../...M.a@......| +00000210 7e 92 7e ff 76 9d c3 3b 7e a5 3f ce fa 10 e2 59 |~.~.v..;~.?....Y| +00000220 ec 47 2d 7c ac da 4e 97 0e 15 a0 6f d0 02 42 01 |.G-|..N....o..B.| +00000230 4d fc be 67 13 9c 2d 05 0e bd 3f a3 8c 25 c1 33 |M..g..-...?..%.3| +00000240 13 83 0d 94 06 bb d4 37 7a f6 ec 7a c9 86 2e dd |.......7z..z....| +00000250 d7 11 69 7f 85 7c 56 de fb 31 78 2b e4 c7 78 0d |..i..|V..1x+..x.| +00000260 ae cb be 9e 4e 36 24 31 7b 6a 0f 39 95 12 07 8f |....N6$1{j.9....| +00000270 2a 16 03 03 00 d8 0c 00 00 d4 03 00 17 41 04 b6 |*............A..| +00000280 3f 37 33 68 cb 79 c0 86 f4 9d 12 ac c4 9d 8c 9b |?73h.y..........| +00000290 59 1c d4 a9 01 9f 2d cb 80 24 02 ec e0 ff d1 8c |Y.....-..$......| +000002a0 bd 82 67 3f 47 58 1a 2e 6b 61 f6 8e 4e 27 7f 49 |..g?GX..ka..N'.I| +000002b0 b5 45 f1 0b 9a 33 ff 53 ac 65 e2 82 7a 18 5c 04 |.E...3.S.e..z.\.| +000002c0 03 00 8b 30 81 88 02 42 00 e1 2d ff 5d e7 77 f1 |...0...B..-.].w.| +000002d0 12 d9 e4 c2 4d cd 9c b5 ee e4 fd 21 b2 d8 53 a9 |....M......!..S.| +000002e0 42 e7 c5 9b 51 c3 59 37 a5 08 d4 e6 29 12 c5 56 |B...Q.Y7....)..V| +000002f0 b8 fe f0 bb 77 87 a3 ee 09 b0 8c cd 1c 39 9e b5 |....w........9..| +00000300 d9 15 63 53 cb d7 f1 55 5b 48 02 42 01 19 10 8a |..cS...U[H.B....| +00000310 7a ee 95 b1 77 44 d4 a3 bf d1 f3 f1 b0 d8 c7 7e |z...wD.........~| +00000320 42 c0 83 04 f5 f7 9c c0 ce 6a 98 47 9d 21 29 84 |B........j.G.!).| +00000330 c8 be 6b 67 4e fc c6 26 ec 63 df 00 33 e6 d2 f7 |..kgN..&.c..3...| +00000340 34 93 85 9b 1b 0f e0 89 42 b6 0b 94 1b 80 16 03 |4.......B.......| +00000350 03 00 04 0e 00 00 00 |.......| +>>> Flow 3 (client to server) +00000000 16 03 03 00 46 10 00 00 42 41 04 1e 18 37 ef 0d |....F...BA...7..| +00000010 19 51 88 35 75 71 b5 e5 54 5b 12 2e 8f 09 67 fd |.Q.5uq..T[....g.| +00000020 a7 24 20 3e b2 56 1c ce 97 28 5e f8 2b 2d 4f 9e |.$ >.V...(^.+-O.| +00000030 f1 07 9f 6c 4b 5b 83 56 e2 32 42 e9 58 b6 d7 49 |...lK[.V.2B.X..I| +00000040 a6 b5 68 1a 41 03 56 6b dc 5a 89 14 03 03 00 01 |..h.A.Vk.Z......| +00000050 01 16 03 03 00 40 00 00 00 00 00 00 00 00 00 00 |.....@..........| +00000060 00 00 00 00 00 00 50 73 9c 9f a8 d7 78 ac 06 14 |......Ps....x...| +00000070 8f ae fc fb ef 7d 99 db b7 c9 91 dd f2 fe da 1b |.....}..........| +00000080 aa 9e 7d e4 5c 2f 5f dd 74 aa fe 03 51 e7 cd 98 |..}.\/_.t...Q...| +00000090 e9 21 19 c9 6f 59 |.!..oY| +>>> Flow 4 (server to client) +00000000 14 03 03 00 01 01 16 03 03 00 40 47 18 b5 1b 75 |..........@G...u| +00000010 b8 a3 63 ab 77 d3 47 cb 14 26 b4 88 fe 15 db 22 |..c.w.G..&....."| +00000020 76 3b 25 d3 68 8e f2 a7 d5 03 2b 82 7b b1 0f 10 |v;%.h.....+.{...| +00000030 49 6a 3d 95 d0 4b 55 0e 14 eb bb a7 34 bb 57 b3 |Ij=..KU.....4.W.| +00000040 5d fb 7e 15 80 5a fa f3 3a df 90 |].~..Z..:..| +>>> Flow 5 (client to server) +00000000 17 03 03 00 30 00 00 00 00 00 00 00 00 00 00 00 |....0...........| +00000010 00 00 00 00 00 70 74 e2 60 fc 3a 7a b7 5e 16 07 |.....pt.`.:z.^..| +00000020 22 92 07 fe 92 53 c4 43 1b 8f 94 07 84 48 2b 50 |"....S.C.....H+P| +00000030 ab 1d 6d 49 ed 15 03 03 00 30 00 00 00 00 00 00 |..mI.....0......| +00000040 00 00 00 00 00 00 00 00 00 00 ce a8 ba 91 0b e4 |................| +00000050 8c 38 23 9b 8b 2c 0a 0c 63 79 61 f4 b6 25 f7 41 |.8#..,..cya..%.A| +00000060 04 9f b0 8f e0 e5 24 44 2f e9 |......$D/.| diff --git a/src/crypto/tls/testdata/Client-TLSv12-ECDHE-ECDSA-AES-GCM b/src/crypto/tls/testdata/Client-TLSv12-ECDHE-ECDSA-AES-GCM new file mode 100644 index 0000000000000000000000000000000000000000..607ecdcb2407fac950a092a79597d79e9769445e --- /dev/null +++ b/src/crypto/tls/testdata/Client-TLSv12-ECDHE-ECDSA-AES-GCM @@ -0,0 +1,85 @@ +>>> Flow 1 (client to server) +00000000 16 03 01 00 81 01 00 00 7d 03 03 00 00 00 00 00 |........}.......| +00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| +00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 1e c0 2f |.............../| +00000030 c0 2b c0 30 c0 2c c0 11 c0 07 c0 13 c0 09 c0 14 |.+.0.,..........| +00000040 c0 0a 00 05 00 2f 00 35 c0 12 00 0a 01 00 00 36 |...../.5.......6| +00000050 00 05 00 05 01 00 00 00 00 00 0a 00 08 00 06 00 |................| +00000060 17 00 18 00 19 00 0b 00 02 01 00 00 0d 00 0e 00 |................| +00000070 0c 04 01 04 03 05 01 05 03 02 01 02 03 ff 01 00 |................| +00000080 01 00 00 12 00 00 |......| +>>> Flow 2 (server to client) +00000000 16 03 03 00 59 02 00 00 55 03 03 91 8a 4f 94 29 |....Y...U....O.)| +00000010 32 fa 66 7a 7f b8 a7 04 5c 34 b9 7e 12 83 35 1f |2.fz....\4.~..5.| +00000020 93 b0 af e0 9f 71 07 5e 2f d7 ca 20 52 dc 0d e7 |.....q.^/.. R...| +00000030 f8 16 db 90 9a 78 2f 03 0b f0 ae a7 2f c6 b4 4c |.....x/...../..L| +00000040 62 e7 de 32 d5 68 61 f3 07 e4 60 d2 c0 2b 00 00 |b..2.ha...`..+..| +00000050 0d ff 01 00 01 00 00 0b 00 04 03 00 01 02 16 03 |................| +00000060 03 02 0e 0b 00 02 0a 00 02 07 00 02 04 30 82 02 |.............0..| +00000070 00 30 82 01 62 02 09 00 b8 bf 2d 47 a0 d2 eb f4 |.0..b.....-G....| +00000080 30 09 06 07 2a 86 48 ce 3d 04 01 30 45 31 0b 30 |0...*.H.=..0E1.0| +00000090 09 06 03 55 04 06 13 02 41 55 31 13 30 11 06 03 |...U....AU1.0...| +000000a0 55 04 08 13 0a 53 6f 6d 65 2d 53 74 61 74 65 31 |U....Some-State1| +000000b0 21 30 1f 06 03 55 04 0a 13 18 49 6e 74 65 72 6e |!0...U....Intern| +000000c0 65 74 20 57 69 64 67 69 74 73 20 50 74 79 20 4c |et Widgits Pty L| +000000d0 74 64 30 1e 17 0d 31 32 31 31 32 32 31 35 30 36 |td0...1211221506| +000000e0 33 32 5a 17 0d 32 32 31 31 32 30 31 35 30 36 33 |32Z..22112015063| +000000f0 32 5a 30 45 31 0b 30 09 06 03 55 04 06 13 02 41 |2Z0E1.0...U....A| +00000100 55 31 13 30 11 06 03 55 04 08 13 0a 53 6f 6d 65 |U1.0...U....Some| +00000110 2d 53 74 61 74 65 31 21 30 1f 06 03 55 04 0a 13 |-State1!0...U...| +00000120 18 49 6e 74 65 72 6e 65 74 20 57 69 64 67 69 74 |.Internet Widgit| +00000130 73 20 50 74 79 20 4c 74 64 30 81 9b 30 10 06 07 |s Pty Ltd0..0...| +00000140 2a 86 48 ce 3d 02 01 06 05 2b 81 04 00 23 03 81 |*.H.=....+...#..| +00000150 86 00 04 00 c4 a1 ed be 98 f9 0b 48 73 36 7e c3 |...........Hs6~.| +00000160 16 56 11 22 f2 3d 53 c3 3b 4d 21 3d cd 6b 75 e6 |.V.".=S.;M!=.ku.| +00000170 f6 b0 dc 9a df 26 c1 bc b2 87 f0 72 32 7c b3 64 |.....&.....r2|.d| +00000180 2f 1c 90 bc ea 68 23 10 7e fe e3 25 c0 48 3a 69 |/....h#.~..%.H:i| +00000190 e0 28 6d d3 37 00 ef 04 62 dd 0d a0 9c 70 62 83 |.(m.7...b....pb.| +000001a0 d8 81 d3 64 31 aa 9e 97 31 bd 96 b0 68 c0 9b 23 |...d1...1...h..#| +000001b0 de 76 64 3f 1a 5c 7f e9 12 0e 58 58 b6 5f 70 dd |.vd?.\....XX._p.| +000001c0 9b d8 ea d5 d7 f5 d5 cc b9 b6 9f 30 66 5b 66 9a |...........0f[f.| +000001d0 20 e2 27 e5 bf fe 3b 30 09 06 07 2a 86 48 ce 3d | .'...;0...*.H.=| +000001e0 04 01 03 81 8c 00 30 81 88 02 42 01 88 a2 4f eb |......0...B...O.| +000001f0 e2 45 c5 48 7d 1b ac f5 ed 98 9d ae 47 70 c0 5e |.E.H}.......Gp.^| +00000200 1b b6 2f bd f1 b6 4d b7 61 40 d3 11 a2 ce ee 0b |../...M.a@......| +00000210 7e 92 7e ff 76 9d c3 3b 7e a5 3f ce fa 10 e2 59 |~.~.v..;~.?....Y| +00000220 ec 47 2d 7c ac da 4e 97 0e 15 a0 6f d0 02 42 01 |.G-|..N....o..B.| +00000230 4d fc be 67 13 9c 2d 05 0e bd 3f a3 8c 25 c1 33 |M..g..-...?..%.3| +00000240 13 83 0d 94 06 bb d4 37 7a f6 ec 7a c9 86 2e dd |.......7z..z....| +00000250 d7 11 69 7f 85 7c 56 de fb 31 78 2b e4 c7 78 0d |..i..|V..1x+..x.| +00000260 ae cb be 9e 4e 36 24 31 7b 6a 0f 39 95 12 07 8f |....N6$1{j.9....| +00000270 2a 16 03 03 00 d8 0c 00 00 d4 03 00 17 41 04 26 |*............A.&| +00000280 c1 67 14 4b 9e b0 45 8c 27 bf a3 a2 78 5b 56 ad |.g.K..E.'...x[V.| +00000290 d1 21 56 53 df 86 e9 91 de e3 f9 5d e6 f6 5d 79 |.!VS.......]..]y| +000002a0 11 8b 60 f9 c2 9a c6 3f 6b 72 cd 7c d7 0e 13 64 |..`....?kr.|...d| +000002b0 af e8 9f 40 35 e6 fb 04 0c 60 aa 19 61 dd 24 04 |...@5....`..a.$.| +000002c0 03 00 8b 30 81 88 02 42 00 9d e1 02 5d 8b b1 45 |...0...B....]..E| +000002d0 e5 c7 b6 94 27 df 36 31 fd 5e 47 fe c8 0f 5f 17 |....'.61.^G..._.| +000002e0 b1 92 56 76 29 45 3d 90 be 91 6e 2c a7 b2 e1 33 |..Vv)E=...n,...3| +000002f0 3b f9 3c bb 80 58 c2 d8 a8 59 82 16 dc 9e dd 60 |;.<..X...Y.....`| +00000300 ff 82 b9 0c 5a ca ff f3 02 2c 02 42 00 a4 c0 d3 |....Z....,.B....| +00000310 aa 1d 69 52 c0 06 fa 93 e8 50 da a4 2f 72 c9 4a |..iR.....P../r.J| +00000320 2c 43 7f 95 05 f7 7a f3 4a 2e 2d ce 13 be 80 40 |,C....z.J.-....@| +00000330 a4 3b b2 f0 73 8d f1 d4 7b a3 ff 01 e1 58 71 31 |.;..s...{....Xq1| +00000340 fc d8 2f b3 ef 62 2e b7 ac f5 c4 bc b8 68 16 03 |../..b.......h..| +00000350 03 00 04 0e 00 00 00 |.......| +>>> Flow 3 (client to server) +00000000 16 03 03 00 46 10 00 00 42 41 04 1e 18 37 ef 0d |....F...BA...7..| +00000010 19 51 88 35 75 71 b5 e5 54 5b 12 2e 8f 09 67 fd |.Q.5uq..T[....g.| +00000020 a7 24 20 3e b2 56 1c ce 97 28 5e f8 2b 2d 4f 9e |.$ >.V...(^.+-O.| +00000030 f1 07 9f 6c 4b 5b 83 56 e2 32 42 e9 58 b6 d7 49 |...lK[.V.2B.X..I| +00000040 a6 b5 68 1a 41 03 56 6b dc 5a 89 14 03 03 00 01 |..h.A.Vk.Z......| +00000050 01 16 03 03 00 28 00 00 00 00 00 00 00 00 83 cf |.....(..........| +00000060 ef 50 c2 e7 da b9 74 7f 1c e0 b8 fb dc 39 c9 98 |.P....t......9..| +00000070 0c a3 7d 8c c6 fa 6f f2 ee 44 a0 a0 03 18 |..}...o..D....| +>>> Flow 4 (server to client) +00000000 14 03 03 00 01 01 16 03 03 00 28 73 c4 48 24 3d |..........(s.H$=| +00000010 8f 5f f3 8c fc fd 63 be 64 39 d5 56 67 bd d7 c4 |._....c.d9.Vg...| +00000020 0d 57 88 1a 45 a6 f3 ad 11 b2 5a 41 58 33 f3 d3 |.W..E.....ZAX3..| +00000030 58 fa 21 |X.!| +>>> Flow 5 (client to server) +00000000 17 03 03 00 1e 00 00 00 00 00 00 00 01 65 5e 55 |.............e^U| +00000010 32 be 00 77 6e 1d 8e 8f 95 33 24 3d 7a c2 b0 3f |2..wn....3$=z..?| +00000020 ca aa 97 15 03 03 00 1a 00 00 00 00 00 00 00 02 |................| +00000030 b2 71 6e 42 6a 0d cf c9 ac 14 a4 b5 9c c9 71 60 |.qnBj.........q`| +00000040 d7 c2 |..| diff --git a/src/crypto/tls/testdata/Client-TLSv12-ECDHE-ECDSA-AES256-GCM-SHA384 b/src/crypto/tls/testdata/Client-TLSv12-ECDHE-ECDSA-AES256-GCM-SHA384 new file mode 100644 index 0000000000000000000000000000000000000000..df2f7376de8b8cdb6f9983367971960f041fe10a --- /dev/null +++ b/src/crypto/tls/testdata/Client-TLSv12-ECDHE-ECDSA-AES256-GCM-SHA384 @@ -0,0 +1,85 @@ +>>> Flow 1 (client to server) +00000000 16 03 01 00 81 01 00 00 7d 03 03 00 00 00 00 00 |........}.......| +00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| +00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 1e c0 2f |.............../| +00000030 c0 2b c0 30 c0 2c c0 11 c0 07 c0 13 c0 09 c0 14 |.+.0.,..........| +00000040 c0 0a 00 05 00 2f 00 35 c0 12 00 0a 01 00 00 36 |...../.5.......6| +00000050 00 05 00 05 01 00 00 00 00 00 0a 00 08 00 06 00 |................| +00000060 17 00 18 00 19 00 0b 00 02 01 00 00 0d 00 0e 00 |................| +00000070 0c 04 01 04 03 05 01 05 03 02 01 02 03 ff 01 00 |................| +00000080 01 00 00 12 00 00 |......| +>>> Flow 2 (server to client) +00000000 16 03 03 00 59 02 00 00 55 03 03 11 50 81 a7 ef |....Y...U...P...| +00000010 3f bd a5 a9 41 11 e6 86 b2 a3 d8 bf 29 c3 d4 f4 |?...A.......)...| +00000020 b6 20 2d cb 94 1b 0e dd 99 d1 0b 20 78 92 23 31 |. -........ x.#1| +00000030 e3 fc 99 67 1f fd f3 2a fc 9c 4c 74 6e 32 e4 f8 |...g...*..Ltn2..| +00000040 ed 6d 2e 6d ad a9 a9 bf 63 27 7e 44 c0 2c 00 00 |.m.m....c'~D.,..| +00000050 0d ff 01 00 01 00 00 0b 00 04 03 00 01 02 16 03 |................| +00000060 03 02 0e 0b 00 02 0a 00 02 07 00 02 04 30 82 02 |.............0..| +00000070 00 30 82 01 62 02 09 00 b8 bf 2d 47 a0 d2 eb f4 |.0..b.....-G....| +00000080 30 09 06 07 2a 86 48 ce 3d 04 01 30 45 31 0b 30 |0...*.H.=..0E1.0| +00000090 09 06 03 55 04 06 13 02 41 55 31 13 30 11 06 03 |...U....AU1.0...| +000000a0 55 04 08 13 0a 53 6f 6d 65 2d 53 74 61 74 65 31 |U....Some-State1| +000000b0 21 30 1f 06 03 55 04 0a 13 18 49 6e 74 65 72 6e |!0...U....Intern| +000000c0 65 74 20 57 69 64 67 69 74 73 20 50 74 79 20 4c |et Widgits Pty L| +000000d0 74 64 30 1e 17 0d 31 32 31 31 32 32 31 35 30 36 |td0...1211221506| +000000e0 33 32 5a 17 0d 32 32 31 31 32 30 31 35 30 36 33 |32Z..22112015063| +000000f0 32 5a 30 45 31 0b 30 09 06 03 55 04 06 13 02 41 |2Z0E1.0...U....A| +00000100 55 31 13 30 11 06 03 55 04 08 13 0a 53 6f 6d 65 |U1.0...U....Some| +00000110 2d 53 74 61 74 65 31 21 30 1f 06 03 55 04 0a 13 |-State1!0...U...| +00000120 18 49 6e 74 65 72 6e 65 74 20 57 69 64 67 69 74 |.Internet Widgit| +00000130 73 20 50 74 79 20 4c 74 64 30 81 9b 30 10 06 07 |s Pty Ltd0..0...| +00000140 2a 86 48 ce 3d 02 01 06 05 2b 81 04 00 23 03 81 |*.H.=....+...#..| +00000150 86 00 04 00 c4 a1 ed be 98 f9 0b 48 73 36 7e c3 |...........Hs6~.| +00000160 16 56 11 22 f2 3d 53 c3 3b 4d 21 3d cd 6b 75 e6 |.V.".=S.;M!=.ku.| +00000170 f6 b0 dc 9a df 26 c1 bc b2 87 f0 72 32 7c b3 64 |.....&.....r2|.d| +00000180 2f 1c 90 bc ea 68 23 10 7e fe e3 25 c0 48 3a 69 |/....h#.~..%.H:i| +00000190 e0 28 6d d3 37 00 ef 04 62 dd 0d a0 9c 70 62 83 |.(m.7...b....pb.| +000001a0 d8 81 d3 64 31 aa 9e 97 31 bd 96 b0 68 c0 9b 23 |...d1...1...h..#| +000001b0 de 76 64 3f 1a 5c 7f e9 12 0e 58 58 b6 5f 70 dd |.vd?.\....XX._p.| +000001c0 9b d8 ea d5 d7 f5 d5 cc b9 b6 9f 30 66 5b 66 9a |...........0f[f.| +000001d0 20 e2 27 e5 bf fe 3b 30 09 06 07 2a 86 48 ce 3d | .'...;0...*.H.=| +000001e0 04 01 03 81 8c 00 30 81 88 02 42 01 88 a2 4f eb |......0...B...O.| +000001f0 e2 45 c5 48 7d 1b ac f5 ed 98 9d ae 47 70 c0 5e |.E.H}.......Gp.^| +00000200 1b b6 2f bd f1 b6 4d b7 61 40 d3 11 a2 ce ee 0b |../...M.a@......| +00000210 7e 92 7e ff 76 9d c3 3b 7e a5 3f ce fa 10 e2 59 |~.~.v..;~.?....Y| +00000220 ec 47 2d 7c ac da 4e 97 0e 15 a0 6f d0 02 42 01 |.G-|..N....o..B.| +00000230 4d fc be 67 13 9c 2d 05 0e bd 3f a3 8c 25 c1 33 |M..g..-...?..%.3| +00000240 13 83 0d 94 06 bb d4 37 7a f6 ec 7a c9 86 2e dd |.......7z..z....| +00000250 d7 11 69 7f 85 7c 56 de fb 31 78 2b e4 c7 78 0d |..i..|V..1x+..x.| +00000260 ae cb be 9e 4e 36 24 31 7b 6a 0f 39 95 12 07 8f |....N6$1{j.9....| +00000270 2a 16 03 03 00 d7 0c 00 00 d3 03 00 17 41 04 fc |*............A..| +00000280 e6 25 27 3c 76 10 a8 9e d3 a4 a8 68 31 06 85 fc |.%'>> Flow 3 (client to server) +00000000 16 03 03 00 46 10 00 00 42 41 04 1e 18 37 ef 0d |....F...BA...7..| +00000010 19 51 88 35 75 71 b5 e5 54 5b 12 2e 8f 09 67 fd |.Q.5uq..T[....g.| +00000020 a7 24 20 3e b2 56 1c ce 97 28 5e f8 2b 2d 4f 9e |.$ >.V...(^.+-O.| +00000030 f1 07 9f 6c 4b 5b 83 56 e2 32 42 e9 58 b6 d7 49 |...lK[.V.2B.X..I| +00000040 a6 b5 68 1a 41 03 56 6b dc 5a 89 14 03 03 00 01 |..h.A.Vk.Z......| +00000050 01 16 03 03 00 28 00 00 00 00 00 00 00 00 a3 3f |.....(.........?| +00000060 be 65 91 cd fe 37 43 e0 ea 6f 15 9d c2 aa 6a 02 |.e...7C..o....j.| +00000070 20 b8 bc b5 c8 9a 1c d4 c4 e5 9b 2e 39 e7 | ...........9.| +>>> Flow 4 (server to client) +00000000 14 03 03 00 01 01 16 03 03 00 28 7c b7 1f 13 9e |..........(|....| +00000010 21 d2 eb db 32 fc 36 d0 53 e1 11 04 ce d0 61 33 |!...2.6.S.....a3| +00000020 1e 30 3d 91 c3 6a 0d 98 55 f5 e0 5c ca 77 fa 72 |.0=..j..U..\.w.r| +00000030 63 6a be |cj.| +>>> Flow 5 (client to server) +00000000 17 03 03 00 1e 00 00 00 00 00 00 00 01 d9 db db |................| +00000010 4b 3a ae 5c a4 dc 96 33 ed b5 a0 70 64 1f 96 2f |K:.\...3...pd../| +00000020 b6 cd 1e 15 03 03 00 1a 00 00 00 00 00 00 00 02 |................| +00000030 18 a0 d1 98 a6 71 c9 56 36 bd 1a 46 4b 5b 45 29 |.....q.V6..FK[E)| +00000040 1f dd |..| diff --git a/src/crypto/tls/testdata/Client-TLSv12-ECDHE-RSA-AES b/src/crypto/tls/testdata/Client-TLSv12-ECDHE-RSA-AES new file mode 100644 index 0000000000000000000000000000000000000000..994ebb1e37f94b4eb4b5c06f77dedfbf1cf823a6 --- /dev/null +++ b/src/crypto/tls/testdata/Client-TLSv12-ECDHE-RSA-AES @@ -0,0 +1,100 @@ +>>> Flow 1 (client to server) +00000000 16 03 01 00 81 01 00 00 7d 03 03 00 00 00 00 00 |........}.......| +00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| +00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 1e c0 2f |.............../| +00000030 c0 2b c0 30 c0 2c c0 11 c0 07 c0 13 c0 09 c0 14 |.+.0.,..........| +00000040 c0 0a 00 05 00 2f 00 35 c0 12 00 0a 01 00 00 36 |...../.5.......6| +00000050 00 05 00 05 01 00 00 00 00 00 0a 00 08 00 06 00 |................| +00000060 17 00 18 00 19 00 0b 00 02 01 00 00 0d 00 0e 00 |................| +00000070 0c 04 01 04 03 05 01 05 03 02 01 02 03 ff 01 00 |................| +00000080 01 00 00 12 00 00 |......| +>>> Flow 2 (server to client) +00000000 16 03 03 00 59 02 00 00 55 03 03 e6 ae 89 0d 22 |....Y...U......"| +00000010 e5 e0 cd 57 a3 ca 71 4f 17 2f 64 77 f8 30 89 ef |...W..qO./dw.0..| +00000020 e8 19 70 ac dd 2c c5 9f 84 7d 1d 20 1c 59 3c fe |..p..,...}. .Y<.| +00000030 a9 ec 10 dd 38 3b 43 fe 6b 09 e5 e4 83 d9 7a 78 |....8;C.k.....zx| +00000040 86 08 33 da 9b e1 09 d8 c9 07 34 19 c0 13 00 00 |..3.......4.....| +00000050 0d ff 01 00 01 00 00 0b 00 04 03 00 01 02 16 03 |................| +00000060 03 02 be 0b 00 02 ba 00 02 b7 00 02 b4 30 82 02 |.............0..| +00000070 b0 30 82 02 19 a0 03 02 01 02 02 09 00 85 b0 bb |.0..............| +00000080 a4 8a 7f b8 ca 30 0d 06 09 2a 86 48 86 f7 0d 01 |.....0...*.H....| +00000090 01 05 05 00 30 45 31 0b 30 09 06 03 55 04 06 13 |....0E1.0...U...| +000000a0 02 41 55 31 13 30 11 06 03 55 04 08 13 0a 53 6f |.AU1.0...U....So| +000000b0 6d 65 2d 53 74 61 74 65 31 21 30 1f 06 03 55 04 |me-State1!0...U.| +000000c0 0a 13 18 49 6e 74 65 72 6e 65 74 20 57 69 64 67 |...Internet Widg| +000000d0 69 74 73 20 50 74 79 20 4c 74 64 30 1e 17 0d 31 |its Pty Ltd0...1| +000000e0 30 30 34 32 34 30 39 30 39 33 38 5a 17 0d 31 31 |00424090938Z..11| +000000f0 30 34 32 34 30 39 30 39 33 38 5a 30 45 31 0b 30 |0424090938Z0E1.0| +00000100 09 06 03 55 04 06 13 02 41 55 31 13 30 11 06 03 |...U....AU1.0...| +00000110 55 04 08 13 0a 53 6f 6d 65 2d 53 74 61 74 65 31 |U....Some-State1| +00000120 21 30 1f 06 03 55 04 0a 13 18 49 6e 74 65 72 6e |!0...U....Intern| +00000130 65 74 20 57 69 64 67 69 74 73 20 50 74 79 20 4c |et Widgits Pty L| +00000140 74 64 30 81 9f 30 0d 06 09 2a 86 48 86 f7 0d 01 |td0..0...*.H....| +00000150 01 01 05 00 03 81 8d 00 30 81 89 02 81 81 00 bb |........0.......| +00000160 79 d6 f5 17 b5 e5 bf 46 10 d0 dc 69 be e6 2b 07 |y......F...i..+.| +00000170 43 5a d0 03 2d 8a 7a 43 85 b7 14 52 e7 a5 65 4c |CZ..-.zC...R..eL| +00000180 2c 78 b8 23 8c b5 b4 82 e5 de 1f 95 3b 7e 62 a5 |,x.#........;~b.| +00000190 2c a5 33 d6 fe 12 5c 7a 56 fc f5 06 bf fa 58 7b |,.3...\zV.....X{| +000001a0 26 3f b5 cd 04 d3 d0 c9 21 96 4a c7 f4 54 9f 5a |&?......!.J..T.Z| +000001b0 bf ef 42 71 00 fe 18 99 07 7f 7e 88 7d 7d f1 04 |..Bq......~.}}..| +000001c0 39 c4 a2 2e db 51 c9 7c e3 c0 4c 3b 32 66 01 cf |9....Q.|..L;2f..| +000001d0 af b1 1d b8 71 9a 1d db db 89 6b ae da 2d 79 02 |....q.....k..-y.| +000001e0 03 01 00 01 a3 81 a7 30 81 a4 30 1d 06 03 55 1d |.......0..0...U.| +000001f0 0e 04 16 04 14 b1 ad e2 85 5a cf cb 28 db 69 ce |.........Z..(.i.| +00000200 23 69 de d3 26 8e 18 88 39 30 75 06 03 55 1d 23 |#i..&...90u..U.#| +00000210 04 6e 30 6c 80 14 b1 ad e2 85 5a cf cb 28 db 69 |.n0l......Z..(.i| +00000220 ce 23 69 de d3 26 8e 18 88 39 a1 49 a4 47 30 45 |.#i..&...9.I.G0E| +00000230 31 0b 30 09 06 03 55 04 06 13 02 41 55 31 13 30 |1.0...U....AU1.0| +00000240 11 06 03 55 04 08 13 0a 53 6f 6d 65 2d 53 74 61 |...U....Some-Sta| +00000250 74 65 31 21 30 1f 06 03 55 04 0a 13 18 49 6e 74 |te1!0...U....Int| +00000260 65 72 6e 65 74 20 57 69 64 67 69 74 73 20 50 74 |ernet Widgits Pt| +00000270 79 20 4c 74 64 82 09 00 85 b0 bb a4 8a 7f b8 ca |y Ltd...........| +00000280 30 0c 06 03 55 1d 13 04 05 30 03 01 01 ff 30 0d |0...U....0....0.| +00000290 06 09 2a 86 48 86 f7 0d 01 01 05 05 00 03 81 81 |..*.H...........| +000002a0 00 08 6c 45 24 c7 6b b1 59 ab 0c 52 cc f2 b0 14 |..lE$.k.Y..R....| +000002b0 d7 87 9d 7a 64 75 b5 5a 95 66 e4 c5 2b 8e ae 12 |...zdu.Z.f..+...| +000002c0 66 1f eb 4f 38 b3 6e 60 d3 92 fd f7 41 08 b5 25 |f..O8.n`....A..%| +000002d0 13 b1 18 7a 24 fb 30 1d ba ed 98 b9 17 ec e7 d7 |...z$.0.........| +000002e0 31 59 db 95 d3 1d 78 ea 50 56 5c d5 82 5a 2d 5a |1Y....x.PV\..Z-Z| +000002f0 5f 33 c4 b6 d8 c9 75 90 96 8c 0f 52 98 b5 cd 98 |_3....u....R....| +00000300 1f 89 20 5f f2 a0 1c a3 1b 96 94 dd a9 fd 57 e9 |.. _..........W.| +00000310 70 e8 26 6d 71 99 9b 26 6e 38 50 29 6c 90 a7 bd |p.&mq..&n8P)l...| +00000320 d9 16 03 03 00 cd 0c 00 00 c9 03 00 17 41 04 77 |.............A.w| +00000330 87 a7 ad f6 f8 34 82 05 ef bb 14 6d c7 8b 7b 2a |.....4.....m..{*| +00000340 4d ca 41 65 58 3c 83 fa 4d ce 0c 74 46 85 fe 38 |M.AeX<..M..tF..8| +00000350 95 80 ee 7c c2 bf f2 be a3 c6 bf f3 aa 07 23 40 |...|..........#@| +00000360 7e cc 74 4a 4e 2e 69 af 6b e0 42 8a fc 41 be 04 |~.tJN.i.k.B..A..| +00000370 01 00 80 99 ed a8 3a ef 93 1b 4c 17 80 9e cc eb |......:...L.....| +00000380 da 39 fb c8 9a 73 e1 96 20 3e 41 fa 8b 1a b1 68 |.9...s.. >A....h| +00000390 cd 47 bc 4b 7b 0c 14 da 87 d3 36 09 5e 37 33 88 |.G.K{.....6.^73.| +000003a0 7f 88 07 87 46 ec e5 72 a8 59 92 07 fa 4d 02 dc |....F..r.Y...M..| +000003b0 bf 3a f5 e4 77 0b a6 85 ce 43 ee 1b 90 30 7f ec |.:..w....C...0..| +000003c0 88 79 f8 88 59 af 6b 7f 2d 88 de 92 cd c8 36 cf |.y..Y.k.-.....6.| +000003d0 ba b9 08 6a c4 3d d7 9a 48 50 e1 67 d0 62 a5 b3 |...j.=..HP.g.b..| +000003e0 b0 5f 2e 16 ee 4d 7d a2 cf d9 93 19 89 b7 64 0f |._...M}.......d.| +000003f0 0f 8e 3d 16 03 03 00 04 0e 00 00 00 |..=.........| +>>> Flow 3 (client to server) +00000000 16 03 03 00 46 10 00 00 42 41 04 1e 18 37 ef 0d |....F...BA...7..| +00000010 19 51 88 35 75 71 b5 e5 54 5b 12 2e 8f 09 67 fd |.Q.5uq..T[....g.| +00000020 a7 24 20 3e b2 56 1c ce 97 28 5e f8 2b 2d 4f 9e |.$ >.V...(^.+-O.| +00000030 f1 07 9f 6c 4b 5b 83 56 e2 32 42 e9 58 b6 d7 49 |...lK[.V.2B.X..I| +00000040 a6 b5 68 1a 41 03 56 6b dc 5a 89 14 03 03 00 01 |..h.A.Vk.Z......| +00000050 01 16 03 03 00 40 00 00 00 00 00 00 00 00 00 00 |.....@..........| +00000060 00 00 00 00 00 00 f2 20 58 ec f1 88 a6 26 79 9d |....... X....&y.| +00000070 2e 9b 02 b5 5e da e2 c1 c5 8d c8 93 6f 6d 07 4e |....^.......om.N| +00000080 fa dd ee cb b1 ae c7 3b 09 b2 cc 64 7a cd 98 91 |.......;...dz...| +00000090 cb f8 3c 34 3b ed |..<4;.| +>>> Flow 4 (server to client) +00000000 14 03 03 00 01 01 16 03 03 00 40 4c a1 8d bd 49 |..........@L...I| +00000010 33 d3 72 fb 2f 23 7e 11 29 fc d2 ff 9b 67 30 c8 |3.r./#~.)....g0.| +00000020 be c1 bc 51 6e 92 a5 f4 9d e3 b3 f9 d2 d4 c4 a5 |...Qn...........| +00000030 83 23 90 b3 17 00 35 18 c5 ef 8b 18 a3 cf ed 9d |.#....5.........| +00000040 a9 52 c9 11 0a c9 55 c2 76 df 78 |.R....U.v.x| +>>> Flow 5 (client to server) +00000000 17 03 03 00 30 00 00 00 00 00 00 00 00 00 00 00 |....0...........| +00000010 00 00 00 00 00 60 40 d0 bf 8f ef 05 2b 89 d7 bb |.....`@.....+...| +00000020 27 d0 1f b2 cf c3 ff 8e be 69 16 a9 b3 03 e8 3c |'........i.....<| +00000030 30 1d 58 39 4a 15 03 03 00 30 00 00 00 00 00 00 |0.X9J....0......| +00000040 00 00 00 00 00 00 00 00 00 00 de 61 51 a1 3c fc |...........aQ.<.| +00000050 1c 7b e6 f2 7d e0 aa 80 2d 9c e9 22 09 5c dd 8a |.{..}...-..".\..| +00000060 55 cc c4 77 34 97 05 88 98 d3 |U..w4.....| diff --git a/src/crypto/tls/testdata/Client-TLSv12-RSA-RC4 b/src/crypto/tls/testdata/Client-TLSv12-RSA-RC4 new file mode 100644 index 0000000000000000000000000000000000000000..73e34c0ce354b4006b36c3251adbfa07a688694d --- /dev/null +++ b/src/crypto/tls/testdata/Client-TLSv12-RSA-RC4 @@ -0,0 +1,84 @@ +>>> Flow 1 (client to server) +00000000 16 03 01 00 81 01 00 00 7d 03 03 00 00 00 00 00 |........}.......| +00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| +00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 1e c0 2f |.............../| +00000030 c0 2b c0 30 c0 2c c0 11 c0 07 c0 13 c0 09 c0 14 |.+.0.,..........| +00000040 c0 0a 00 05 00 2f 00 35 c0 12 00 0a 01 00 00 36 |...../.5.......6| +00000050 00 05 00 05 01 00 00 00 00 00 0a 00 08 00 06 00 |................| +00000060 17 00 18 00 19 00 0b 00 02 01 00 00 0d 00 0e 00 |................| +00000070 0c 04 01 04 03 05 01 05 03 02 01 02 03 ff 01 00 |................| +00000080 01 00 00 12 00 00 |......| +>>> Flow 2 (server to client) +00000000 16 03 03 00 51 02 00 00 4d 03 03 e8 ae 4c 97 41 |....Q...M....L.A| +00000010 78 0f 08 84 d4 4a 80 6d a2 e1 d0 67 40 8f 01 8b |x....J.m...g@...| +00000020 20 54 cb 28 16 52 04 fd 3c c2 84 20 30 96 f0 51 | T.(.R..<.. 0..Q| +00000030 72 86 6a d8 47 b9 47 e3 a4 ad 97 77 a9 77 1a f9 |r.j.G.G....w.w..| +00000040 ba 63 33 32 4f 43 09 1c e1 bd 1b 3b 00 05 00 00 |.c32OC.....;....| +00000050 05 ff 01 00 01 00 16 03 03 02 be 0b 00 02 ba 00 |................| +00000060 02 b7 00 02 b4 30 82 02 b0 30 82 02 19 a0 03 02 |.....0...0......| +00000070 01 02 02 09 00 85 b0 bb a4 8a 7f b8 ca 30 0d 06 |.............0..| +00000080 09 2a 86 48 86 f7 0d 01 01 05 05 00 30 45 31 0b |.*.H........0E1.| +00000090 30 09 06 03 55 04 06 13 02 41 55 31 13 30 11 06 |0...U....AU1.0..| +000000a0 03 55 04 08 13 0a 53 6f 6d 65 2d 53 74 61 74 65 |.U....Some-State| +000000b0 31 21 30 1f 06 03 55 04 0a 13 18 49 6e 74 65 72 |1!0...U....Inter| +000000c0 6e 65 74 20 57 69 64 67 69 74 73 20 50 74 79 20 |net Widgits Pty | +000000d0 4c 74 64 30 1e 17 0d 31 30 30 34 32 34 30 39 30 |Ltd0...100424090| +000000e0 39 33 38 5a 17 0d 31 31 30 34 32 34 30 39 30 39 |938Z..1104240909| +000000f0 33 38 5a 30 45 31 0b 30 09 06 03 55 04 06 13 02 |38Z0E1.0...U....| +00000100 41 55 31 13 30 11 06 03 55 04 08 13 0a 53 6f 6d |AU1.0...U....Som| +00000110 65 2d 53 74 61 74 65 31 21 30 1f 06 03 55 04 0a |e-State1!0...U..| +00000120 13 18 49 6e 74 65 72 6e 65 74 20 57 69 64 67 69 |..Internet Widgi| +00000130 74 73 20 50 74 79 20 4c 74 64 30 81 9f 30 0d 06 |ts Pty Ltd0..0..| +00000140 09 2a 86 48 86 f7 0d 01 01 01 05 00 03 81 8d 00 |.*.H............| +00000150 30 81 89 02 81 81 00 bb 79 d6 f5 17 b5 e5 bf 46 |0.......y......F| +00000160 10 d0 dc 69 be e6 2b 07 43 5a d0 03 2d 8a 7a 43 |...i..+.CZ..-.zC| +00000170 85 b7 14 52 e7 a5 65 4c 2c 78 b8 23 8c b5 b4 82 |...R..eL,x.#....| +00000180 e5 de 1f 95 3b 7e 62 a5 2c a5 33 d6 fe 12 5c 7a |....;~b.,.3...\z| +00000190 56 fc f5 06 bf fa 58 7b 26 3f b5 cd 04 d3 d0 c9 |V.....X{&?......| +000001a0 21 96 4a c7 f4 54 9f 5a bf ef 42 71 00 fe 18 99 |!.J..T.Z..Bq....| +000001b0 07 7f 7e 88 7d 7d f1 04 39 c4 a2 2e db 51 c9 7c |..~.}}..9....Q.|| +000001c0 e3 c0 4c 3b 32 66 01 cf af b1 1d b8 71 9a 1d db |..L;2f......q...| +000001d0 db 89 6b ae da 2d 79 02 03 01 00 01 a3 81 a7 30 |..k..-y........0| +000001e0 81 a4 30 1d 06 03 55 1d 0e 04 16 04 14 b1 ad e2 |..0...U.........| +000001f0 85 5a cf cb 28 db 69 ce 23 69 de d3 26 8e 18 88 |.Z..(.i.#i..&...| +00000200 39 30 75 06 03 55 1d 23 04 6e 30 6c 80 14 b1 ad |90u..U.#.n0l....| +00000210 e2 85 5a cf cb 28 db 69 ce 23 69 de d3 26 8e 18 |..Z..(.i.#i..&..| +00000220 88 39 a1 49 a4 47 30 45 31 0b 30 09 06 03 55 04 |.9.I.G0E1.0...U.| +00000230 06 13 02 41 55 31 13 30 11 06 03 55 04 08 13 0a |...AU1.0...U....| +00000240 53 6f 6d 65 2d 53 74 61 74 65 31 21 30 1f 06 03 |Some-State1!0...| +00000250 55 04 0a 13 18 49 6e 74 65 72 6e 65 74 20 57 69 |U....Internet Wi| +00000260 64 67 69 74 73 20 50 74 79 20 4c 74 64 82 09 00 |dgits Pty Ltd...| +00000270 85 b0 bb a4 8a 7f b8 ca 30 0c 06 03 55 1d 13 04 |........0...U...| +00000280 05 30 03 01 01 ff 30 0d 06 09 2a 86 48 86 f7 0d |.0....0...*.H...| +00000290 01 01 05 05 00 03 81 81 00 08 6c 45 24 c7 6b b1 |..........lE$.k.| +000002a0 59 ab 0c 52 cc f2 b0 14 d7 87 9d 7a 64 75 b5 5a |Y..R.......zdu.Z| +000002b0 95 66 e4 c5 2b 8e ae 12 66 1f eb 4f 38 b3 6e 60 |.f..+...f..O8.n`| +000002c0 d3 92 fd f7 41 08 b5 25 13 b1 18 7a 24 fb 30 1d |....A..%...z$.0.| +000002d0 ba ed 98 b9 17 ec e7 d7 31 59 db 95 d3 1d 78 ea |........1Y....x.| +000002e0 50 56 5c d5 82 5a 2d 5a 5f 33 c4 b6 d8 c9 75 90 |PV\..Z-Z_3....u.| +000002f0 96 8c 0f 52 98 b5 cd 98 1f 89 20 5f f2 a0 1c a3 |...R...... _....| +00000300 1b 96 94 dd a9 fd 57 e9 70 e8 26 6d 71 99 9b 26 |......W.p.&mq..&| +00000310 6e 38 50 29 6c 90 a7 bd d9 16 03 03 00 04 0e 00 |n8P)l...........| +00000320 00 00 |..| +>>> Flow 3 (client to server) +00000000 16 03 03 00 86 10 00 00 82 00 80 6d 51 f3 7f f9 |...........mQ...| +00000010 3e fb 75 82 41 36 83 e8 6a ee 2a 2e 25 90 67 4c |>.u.A6..j.*.%.gL| +00000020 8e 62 2f 30 81 17 e0 85 09 0c 2b b7 23 d7 b0 e2 |.b/0......+.#...| +00000030 1d f7 3b d7 f5 a1 27 b6 ee 24 b6 1b cc 5b ea 66 |..;...'..$...[.f| +00000040 0d 6a f4 e5 85 f9 da 43 b4 0e 86 85 e1 f5 aa be |.j.....C........| +00000050 c8 ce 39 4c 9c 86 00 08 c2 4b e2 c6 ec 2f f7 ce |..9L.....K.../..| +00000060 e6 bd 77 82 6f 23 b6 e0 bd a2 92 b7 3a ac e8 56 |..w.o#......:..V| +00000070 f1 af 54 5e 46 87 e9 3b 33 e7 b8 28 b7 d6 c8 90 |..T^F..;3..(....| +00000080 35 d4 1c 43 d1 30 6f 55 4e 0a 70 14 03 03 00 01 |5..C.0oUN.p.....| +00000090 01 16 03 03 00 24 54 8c 7f 71 03 7c 98 e5 97 65 |.....$T..q.|...e| +000000a0 51 13 b2 9d 4a b8 c9 c1 e6 11 1b 50 c8 1b c0 46 |Q...J......P...F| +000000b0 a7 cb 13 97 92 a0 51 d4 a9 e5 |......Q...| +>>> Flow 4 (server to client) +00000000 14 03 03 00 01 01 16 03 03 00 24 37 ca ae 55 79 |..........$7..Uy| +00000010 e7 0a 70 55 1e d1 76 61 57 46 d2 c0 d0 ed 3d 70 |..pU..vaWF....=p| +00000020 1f 02 f2 06 5b 3e 50 ec 13 4b 67 e2 7c bd 45 |....[>P..Kg.|.E| +>>> Flow 5 (client to server) +00000000 17 03 03 00 1a c4 13 68 ec e0 38 a1 07 35 da d7 |.......h..8..5..| +00000010 c4 6b f9 5c ed a7 8a cb 96 7a 22 7c ca a5 30 15 |.k.\.....z"|..0.| +00000020 03 03 00 16 f7 a7 8d 41 b0 c1 4b 61 60 b0 b2 ed |.......A..Ka`...| +00000030 4a ab c3 54 d5 20 eb 67 b7 8f |J..T. .g..| diff --git a/src/crypto/tls/testdata/Client-TLSv12-SCT b/src/crypto/tls/testdata/Client-TLSv12-SCT new file mode 100644 index 0000000000000000000000000000000000000000..826c9f0a579cdacfc83b3923bba61b4fb658dd02 --- /dev/null +++ b/src/crypto/tls/testdata/Client-TLSv12-SCT @@ -0,0 +1,118 @@ +>>> Flow 1 (client to server) +00000000 16 03 01 00 81 01 00 00 7d 03 03 00 00 00 00 00 |........}.......| +00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| +00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 1e c0 2f |.............../| +00000030 c0 2b c0 30 c0 2c c0 11 c0 07 c0 13 c0 09 c0 14 |.+.0.,..........| +00000040 c0 0a 00 05 00 2f 00 35 c0 12 00 0a 01 00 00 36 |...../.5.......6| +00000050 00 05 00 05 01 00 00 00 00 00 0a 00 08 00 06 00 |................| +00000060 17 00 18 00 19 00 0b 00 02 01 00 00 0d 00 0e 00 |................| +00000070 0c 04 01 04 03 05 01 05 03 02 01 02 03 ff 01 00 |................| +00000080 01 00 00 12 00 00 |......| +>>> Flow 2 (server to client) +00000000 16 03 03 01 c6 02 00 01 c2 03 03 1b f6 69 c1 c2 |.............i..| +00000010 36 77 72 32 69 95 c9 e7 db 9b 5d bd 59 ba 08 02 |6wr2i.....].Y...| +00000020 1e 76 11 c4 8e 49 08 22 8e 8a 5a 20 44 ec d9 13 |.v...I."..Z D...| +00000030 23 ad 05 45 48 29 00 c6 11 3d 5a 5c a1 ee 34 2b |#..EH)...=Z\..4+| +00000040 58 ef 34 5b 7e 42 08 84 23 66 56 ee c0 2f 00 01 |X.4[~B..#fV../..| +00000050 7a ff 01 00 01 00 00 0b 00 04 03 00 01 02 00 12 |z...............| +00000060 01 69 01 67 00 75 00 a4 b9 09 90 b4 18 58 14 87 |.i.g.u.......X..| +00000070 bb 13 a2 cc 67 70 0a 3c 35 98 04 f9 1b df b8 e3 |....gp.<5.......| +00000080 77 cd 0e c8 0d dc 10 00 00 01 47 97 99 ee 16 00 |w.........G.....| +00000090 00 04 03 00 46 30 44 02 20 1c 4b 82 5d 95 6e 67 |....F0D. .K.].ng| +000000a0 5b db 04 95 4b f6 ce f4 32 3e 86 7a 7a 32 ab 18 |[...K...2>.zz2..| +000000b0 60 74 de 08 da 05 91 4c 2f 02 20 73 54 1b 6e 7f |`t.....L/. sT.n.| +000000c0 a1 b0 7d 11 bc e6 f3 85 2f 97 66 1a f7 8a e4 10 |..}...../.f.....| +000000d0 25 8f 12 f4 6f 39 0f d2 9e 18 f0 00 76 00 68 f6 |%...o9......v.h.| +000000e0 98 f8 1f 64 82 be 3a 8c ee b9 28 1d 4c fc 71 51 |...d..:...(.L.qQ| +000000f0 5d 67 93 d4 44 d1 0a 67 ac bb 4f 4f fb c4 00 00 |]g..D..g..OO....| +00000100 01 47 97 e1 b5 70 00 00 04 03 00 47 30 45 02 20 |.G...p.....G0E. | +00000110 32 21 14 38 06 d8 72 2e 00 30 64 1a e2 e8 6d 4e |2!.8..r..0d...mN| +00000120 5a e1 d9 42 1e 82 4b 96 25 89 d5 26 13 d3 9c fa |Z..B..K.%..&....| +00000130 02 21 00 8f 12 28 64 51 4f 44 d5 8c 18 62 23 b2 |.!...(dQOD...b#.| +00000140 43 93 33 05 f3 43 55 a1 d9 ee cd c5 71 35 91 dd |C.3..CU.....q5..| +00000150 49 d1 0b 00 76 00 ee 4b bd b7 75 ce 60 ba e1 42 |I...v..K..u.`..B| +00000160 69 1f ab e1 9e 66 a3 0f 7e 5f b0 72 d8 83 00 c4 |i....f..~_.r....| +00000170 7b 89 7a a8 fd cb 00 00 01 48 5c 64 8a 87 00 00 |{.z......H\d....| +00000180 04 03 00 47 30 45 02 20 29 89 d6 b0 53 d3 d2 e9 |...G0E. )...S...| +00000190 91 bc f1 b5 40 be 1e 2e e7 5c b4 74 27 ed 8f 9b |....@....\.t'...| +000001a0 02 e9 fa c2 4c ba a2 be 02 21 00 af 43 64 52 71 |....L....!..CdRq| +000001b0 15 29 58 40 91 c7 08 16 96 03 a8 73 a5 65 a0 6c |.)X@.......s.e.l| +000001c0 b8 48 56 5a b6 29 83 64 6d 2a 9d 16 03 03 02 be |.HVZ.).dm*......| +000001d0 0b 00 02 ba 00 02 b7 00 02 b4 30 82 02 b0 30 82 |..........0...0.| +000001e0 02 19 a0 03 02 01 02 02 09 00 85 b0 bb a4 8a 7f |................| +000001f0 b8 ca 30 0d 06 09 2a 86 48 86 f7 0d 01 01 05 05 |..0...*.H.......| +00000200 00 30 45 31 0b 30 09 06 03 55 04 06 13 02 41 55 |.0E1.0...U....AU| +00000210 31 13 30 11 06 03 55 04 08 13 0a 53 6f 6d 65 2d |1.0...U....Some-| +00000220 53 74 61 74 65 31 21 30 1f 06 03 55 04 0a 13 18 |State1!0...U....| +00000230 49 6e 74 65 72 6e 65 74 20 57 69 64 67 69 74 73 |Internet Widgits| +00000240 20 50 74 79 20 4c 74 64 30 1e 17 0d 31 30 30 34 | Pty Ltd0...1004| +00000250 32 34 30 39 30 39 33 38 5a 17 0d 31 31 30 34 32 |24090938Z..11042| +00000260 34 30 39 30 39 33 38 5a 30 45 31 0b 30 09 06 03 |4090938Z0E1.0...| +00000270 55 04 06 13 02 41 55 31 13 30 11 06 03 55 04 08 |U....AU1.0...U..| +00000280 13 0a 53 6f 6d 65 2d 53 74 61 74 65 31 21 30 1f |..Some-State1!0.| +00000290 06 03 55 04 0a 13 18 49 6e 74 65 72 6e 65 74 20 |..U....Internet | +000002a0 57 69 64 67 69 74 73 20 50 74 79 20 4c 74 64 30 |Widgits Pty Ltd0| +000002b0 81 9f 30 0d 06 09 2a 86 48 86 f7 0d 01 01 01 05 |..0...*.H.......| +000002c0 00 03 81 8d 00 30 81 89 02 81 81 00 bb 79 d6 f5 |.....0.......y..| +000002d0 17 b5 e5 bf 46 10 d0 dc 69 be e6 2b 07 43 5a d0 |....F...i..+.CZ.| +000002e0 03 2d 8a 7a 43 85 b7 14 52 e7 a5 65 4c 2c 78 b8 |.-.zC...R..eL,x.| +000002f0 23 8c b5 b4 82 e5 de 1f 95 3b 7e 62 a5 2c a5 33 |#........;~b.,.3| +00000300 d6 fe 12 5c 7a 56 fc f5 06 bf fa 58 7b 26 3f b5 |...\zV.....X{&?.| +00000310 cd 04 d3 d0 c9 21 96 4a c7 f4 54 9f 5a bf ef 42 |.....!.J..T.Z..B| +00000320 71 00 fe 18 99 07 7f 7e 88 7d 7d f1 04 39 c4 a2 |q......~.}}..9..| +00000330 2e db 51 c9 7c e3 c0 4c 3b 32 66 01 cf af b1 1d |..Q.|..L;2f.....| +00000340 b8 71 9a 1d db db 89 6b ae da 2d 79 02 03 01 00 |.q.....k..-y....| +00000350 01 a3 81 a7 30 81 a4 30 1d 06 03 55 1d 0e 04 16 |....0..0...U....| +00000360 04 14 b1 ad e2 85 5a cf cb 28 db 69 ce 23 69 de |......Z..(.i.#i.| +00000370 d3 26 8e 18 88 39 30 75 06 03 55 1d 23 04 6e 30 |.&...90u..U.#.n0| +00000380 6c 80 14 b1 ad e2 85 5a cf cb 28 db 69 ce 23 69 |l......Z..(.i.#i| +00000390 de d3 26 8e 18 88 39 a1 49 a4 47 30 45 31 0b 30 |..&...9.I.G0E1.0| +000003a0 09 06 03 55 04 06 13 02 41 55 31 13 30 11 06 03 |...U....AU1.0...| +000003b0 55 04 08 13 0a 53 6f 6d 65 2d 53 74 61 74 65 31 |U....Some-State1| +000003c0 21 30 1f 06 03 55 04 0a 13 18 49 6e 74 65 72 6e |!0...U....Intern| +000003d0 65 74 20 57 69 64 67 69 74 73 20 50 74 79 20 4c |et Widgits Pty L| +000003e0 74 64 82 09 00 85 b0 bb a4 8a 7f b8 ca 30 0c 06 |td...........0..| +000003f0 03 55 1d 13 04 05 30 03 01 01 ff 30 0d 06 09 2a |.U....0....0...*| +00000400 86 48 86 f7 0d 01 01 05 05 00 03 81 81 00 08 6c |.H.............l| +00000410 45 24 c7 6b b1 59 ab 0c 52 cc f2 b0 14 d7 87 9d |E$.k.Y..R.......| +00000420 7a 64 75 b5 5a 95 66 e4 c5 2b 8e ae 12 66 1f eb |zdu.Z.f..+...f..| +00000430 4f 38 b3 6e 60 d3 92 fd f7 41 08 b5 25 13 b1 18 |O8.n`....A..%...| +00000440 7a 24 fb 30 1d ba ed 98 b9 17 ec e7 d7 31 59 db |z$.0.........1Y.| +00000450 95 d3 1d 78 ea 50 56 5c d5 82 5a 2d 5a 5f 33 c4 |...x.PV\..Z-Z_3.| +00000460 b6 d8 c9 75 90 96 8c 0f 52 98 b5 cd 98 1f 89 20 |...u....R...... | +00000470 5f f2 a0 1c a3 1b 96 94 dd a9 fd 57 e9 70 e8 26 |_..........W.p.&| +00000480 6d 71 99 9b 26 6e 38 50 29 6c 90 a7 bd d9 16 03 |mq..&n8P)l......| +00000490 03 00 cd 0c 00 00 c9 03 00 17 41 04 d7 61 5b 05 |..........A..a[.| +000004a0 de 22 d3 3d 00 72 a5 be 0a c1 76 94 a1 34 41 6e |.".=.r....v..4An| +000004b0 55 f2 74 91 d2 6f 5c 47 87 c8 4b eb ab ab 10 b9 |U.t..o\G..K.....| +000004c0 f9 0a bc 63 03 5f 90 5b e3 6f e1 44 97 cc bf d2 |...c._.[.o.D....| +000004d0 e8 0d f5 9c 2e 9d 07 2c b2 00 90 0b 04 01 00 80 |.......,........| +000004e0 67 3d c7 73 42 b9 b2 fd 4b dd 02 57 87 95 20 75 |g=.sB...K..W.. u| +000004f0 da c1 e7 d3 33 09 01 5d e9 32 d7 20 7f 92 a9 dd |....3..].2. ....| +00000500 bb 17 c5 ee f2 07 b2 04 1d 5e 1f c2 41 66 3f 14 |.........^..Af?.| +00000510 90 cd 84 ac 49 46 04 3e ce 89 7d 79 42 2a 8c 56 |....IF.>..}yB*.V| +00000520 93 d3 9c 3b 57 38 9e 91 af 62 ad 86 40 29 3d 46 |...;W8...b..@)=F| +00000530 c7 cc f4 3f a1 7d ee 53 3d 94 1c 85 b9 1d a9 5f |...?.}.S=......_| +00000540 10 8e ee 38 5e 98 5d 39 31 79 83 cd f9 02 a8 a9 |...8^.]91y......| +00000550 b8 82 21 33 40 ed 27 54 a3 6e 64 cb e9 ce dd e1 |..!3@.'T.nd.....| +00000560 16 03 03 00 04 0e 00 00 00 |.........| +>>> Flow 3 (client to server) +00000000 16 03 03 00 46 10 00 00 42 41 04 1e 18 37 ef 0d |....F...BA...7..| +00000010 19 51 88 35 75 71 b5 e5 54 5b 12 2e 8f 09 67 fd |.Q.5uq..T[....g.| +00000020 a7 24 20 3e b2 56 1c ce 97 28 5e f8 2b 2d 4f 9e |.$ >.V...(^.+-O.| +00000030 f1 07 9f 6c 4b 5b 83 56 e2 32 42 e9 58 b6 d7 49 |...lK[.V.2B.X..I| +00000040 a6 b5 68 1a 41 03 56 6b dc 5a 89 14 03 03 00 01 |..h.A.Vk.Z......| +00000050 01 16 03 03 00 28 00 00 00 00 00 00 00 00 60 0e |.....(........`.| +00000060 49 99 7a 9f 28 6e 46 03 a8 fd 0e b7 ed bb 9c ba |I.z.(nF.........| +00000070 07 9c 4d cc 26 2b c2 70 a0 26 38 a0 f2 a0 |..M.&+.p.&8...| +>>> Flow 4 (server to client) +00000000 14 03 03 00 01 01 16 03 03 00 28 d2 ef 8f f4 7b |..........(....{| +00000010 7a 9b c8 98 a4 36 f2 be 61 46 0e af f4 6f 63 71 |z....6..aF...ocq| +00000020 6e bd 87 ea 1b f2 95 ad 36 7d a3 52 7f b2 b6 45 |n.......6}.R...E| +00000030 3f 0b 62 |?.b| +>>> Flow 5 (client to server) +00000000 17 03 03 00 1e 00 00 00 00 00 00 00 01 53 a1 85 |.............S..| +00000010 ce 3c c1 64 39 80 fb db 67 ec 48 20 7f e9 82 f4 |.<.d9...g.H ....| +00000020 2d 69 0a 15 03 03 00 1a 00 00 00 00 00 00 00 02 |-i..............| +00000030 ab 78 11 1b 80 55 23 db 07 c5 7f c3 5e 19 d8 b3 |.x...U#.....^...| +00000040 f8 c6 |..| diff --git a/src/crypto/tls/testdata/Server-SSLv3-RSA-3DES b/src/crypto/tls/testdata/Server-SSLv3-RSA-3DES new file mode 100644 index 0000000000000000000000000000000000000000..20520f542d4923ecafe64f137fc53def751dbea0 --- /dev/null +++ b/src/crypto/tls/testdata/Server-SSLv3-RSA-3DES @@ -0,0 +1,78 @@ +>>> Flow 1 (client to server) +00000000 16 03 00 00 2f 01 00 00 2b 03 00 10 71 68 59 99 |..../...+...qhY.| +00000010 9c a6 e7 36 8b 0d 03 be f5 42 ab 7c d0 3b 76 3e |...6.....B.|.;v>| +00000020 46 7c 6c a3 94 09 b7 1b 0e 42 27 00 00 04 00 0a |F|l......B'.....| +00000030 00 ff 01 00 |....| +>>> Flow 2 (server to client) +00000000 16 03 00 00 31 02 00 00 2d 03 00 00 00 00 00 00 |....1...-.......| +00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| +00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 0a 00 00 |................| +00000030 05 ff 01 00 01 00 16 03 00 02 71 0b 00 02 6d 00 |..........q...m.| +00000040 02 6a 00 02 67 30 82 02 63 30 82 01 cc a0 03 02 |.j..g0..c0......| +00000050 01 02 02 09 00 a2 73 00 0c 81 00 cb f3 30 0d 06 |......s......0..| +00000060 09 2a 86 48 86 f7 0d 01 01 0b 05 00 30 2b 31 17 |.*.H........0+1.| +00000070 30 15 06 03 55 04 0a 13 0e 47 6f 6f 67 6c 65 20 |0...U....Google | +00000080 54 45 53 54 49 4e 47 31 10 30 0e 06 03 55 04 03 |TESTING1.0...U..| +00000090 13 07 47 6f 20 52 6f 6f 74 30 1e 17 0d 31 35 30 |..Go Root0...150| +000000a0 31 30 31 30 30 30 30 30 30 5a 17 0d 32 35 30 31 |101000000Z..2501| +000000b0 30 31 30 30 30 30 30 30 5a 30 26 31 17 30 15 06 |01000000Z0&1.0..| +000000c0 03 55 04 0a 13 0e 47 6f 6f 67 6c 65 20 54 45 53 |.U....Google TES| +000000d0 54 49 4e 47 31 0b 30 09 06 03 55 04 03 13 02 47 |TING1.0...U....G| +000000e0 6f 30 81 9f 30 0d 06 09 2a 86 48 86 f7 0d 01 01 |o0..0...*.H.....| +000000f0 01 05 00 03 81 8d 00 30 81 89 02 81 81 00 af 87 |.......0........| +00000100 88 f6 20 1b 95 65 6c 14 ab 44 05 af 3b 45 14 e3 |.. ..el..D..;E..| +00000110 b7 6d fd 00 63 4d 95 7f fe 6a 62 35 86 c0 4a f9 |.m..cM...jb5..J.| +00000120 18 7c f6 aa 25 5e 7a 64 31 66 00 ba f4 8e 92 af |.|..%^zd1f......| +00000130 c7 6b d8 76 d4 f3 5f 41 cb 6e 56 15 97 1b 97 c1 |.k.v.._A.nV.....| +00000140 3c 12 39 21 66 3d 2b 16 d1 bc db 1c c0 a7 da b7 |<.9!f=+.........| +00000150 ca ad ba da cb d5 21 50 ec de 8d ab d1 6b 81 4b |......!P.....k.K| +00000160 89 02 f3 c4 be c1 6c 89 b1 44 84 bd 21 d1 04 7d |......l..D..!..}| +00000170 9d 16 4d f9 82 15 f6 ef fa d6 09 47 f2 fb 02 03 |..M........G....| +00000180 01 00 01 a3 81 93 30 81 90 30 0e 06 03 55 1d 0f |......0..0...U..| +00000190 01 01 ff 04 04 03 02 05 a0 30 1d 06 03 55 1d 25 |.........0...U.%| +000001a0 04 16 30 14 06 08 2b 06 01 05 05 07 03 01 06 08 |..0...+.........| +000001b0 2b 06 01 05 05 07 03 02 30 0c 06 03 55 1d 13 01 |+.......0...U...| +000001c0 01 ff 04 02 30 00 30 19 06 03 55 1d 0e 04 12 04 |....0.0...U.....| +000001d0 10 12 50 8d 89 6f 1b d1 dc 54 4d 6e cb 69 5e 06 |..P..o...TMn.i^.| +000001e0 f4 30 1b 06 03 55 1d 23 04 14 30 12 80 10 bf 3d |.0...U.#..0....=| +000001f0 b6 a9 66 f2 b8 40 cf ea b4 03 78 48 1a 41 30 19 |..f..@....xH.A0.| +00000200 06 03 55 1d 11 04 12 30 10 82 0e 65 78 61 6d 70 |..U....0...examp| +00000210 6c 65 2e 67 6f 6c 61 6e 67 30 0d 06 09 2a 86 48 |le.golang0...*.H| +00000220 86 f7 0d 01 01 0b 05 00 03 81 81 00 92 7c af 91 |.............|..| +00000230 55 12 18 96 59 31 a6 48 40 d5 2d d5 ee bb 02 a0 |U...Y1.H@.-.....| +00000240 f5 c2 1e 7c 9b b3 30 7d 3c dc 76 da 4f 3d c0 fa |...|..0}<.v.O=..| +00000250 ae 2d 33 24 6b 03 7b 1b 67 59 11 21 b5 11 bc 77 |.-3$k.{.gY.!...w| +00000260 b9 d9 e0 6e a8 2d 2e 35 fa 64 5f 22 3e 63 10 6b |...n.-.5.d_">c.k| +00000270 be ff 14 86 6d 0d f0 15 31 a8 14 38 1e 3b 84 87 |....m...1..8.;..| +00000280 2c cb 98 ed 51 76 b9 b1 4f dd db 9b 84 04 86 40 |,...Qv..O......@| +00000290 fa 51 dd ba b4 8d eb e3 46 de 46 b9 4f 86 c7 f9 |.Q......F.F.O...| +000002a0 a4 c2 41 34 ac cc f6 ea b0 ab 39 18 16 03 00 00 |..A4......9.....| +000002b0 04 0e 00 00 00 |.....| +>>> Flow 3 (client to server) +00000000 16 03 00 00 84 10 00 00 80 1b 62 18 c8 60 0b f7 |..........b..`..| +00000010 4a b8 ec 98 56 eb aa 4b d9 05 c0 f1 be b9 a5 28 |J...V..K.......(| +00000020 62 e8 3e 25 08 9f 28 dd 08 1f 04 80 5f 10 81 cf |b.>%..(....._...| +00000030 aa 2f 55 cd f1 0f ec 5b 90 0a 1f 49 bc a3 96 38 |./U....[...I...8| +00000040 c7 32 b6 0a da b3 a5 7a 76 28 82 19 30 f4 6b ae |.2.....zv(..0.k.| +00000050 fb 81 cc b4 ad 92 f8 c6 20 da 27 89 45 f4 43 c2 |........ .'.E.C.| +00000060 16 7e de 29 03 dc 90 dd 3a 23 58 4c 35 be 11 a5 |.~.)....:#XL5...| +00000070 52 18 79 13 e6 b3 2d e6 8e f5 76 60 0c c1 92 bb |R.y...-...v`....| +00000080 07 67 c5 24 12 1b aa d6 53 14 03 00 00 01 01 16 |.g.$....S.......| +00000090 03 00 00 40 5f 64 da b6 24 19 07 44 32 85 f3 c0 |...@_d..$..D2...| +000000a0 9b c6 2c ad b1 d1 0f 4b 52 20 2f ea 6f 15 80 44 |..,....KR /.o..D| +000000b0 78 34 44 02 67 e0 2e b4 b8 df 7b 3f 21 dd 66 9b |x4D.g.....{?!.f.| +000000c0 e7 5f 71 ff 5f 30 fb 5b 5a 19 f0 24 f8 21 bc 7c |._q._0.[Z..$.!.|| +000000d0 00 e1 1f e8 |....| +>>> Flow 4 (server to client) +00000000 14 03 00 00 01 01 16 03 00 00 40 48 01 fc 08 a0 |..........@H....| +00000010 fa 0e 63 58 25 18 06 3c 54 5c 60 ce 35 f6 ec b8 |..cX%...| +000000b0 b3 fa |..| diff --git a/src/crypto/tls/testdata/Server-SSLv3-RSA-AES b/src/crypto/tls/testdata/Server-SSLv3-RSA-AES new file mode 100644 index 0000000000000000000000000000000000000000..e0fe95658dac3653b0a02707289e1b05436cb507 --- /dev/null +++ b/src/crypto/tls/testdata/Server-SSLv3-RSA-AES @@ -0,0 +1,79 @@ +>>> Flow 1 (client to server) +00000000 16 03 00 00 2f 01 00 00 2b 03 00 37 cd 49 a6 9f |..../...+..7.I..| +00000010 e9 19 6a 39 cd 75 ce 6c f1 1b 96 d3 d4 f0 33 0c |..j9.u.l......3.| +00000020 8f 53 b2 06 c4 0e 39 86 e3 98 7e 00 00 04 00 2f |.S....9...~..../| +00000030 00 ff 01 00 |....| +>>> Flow 2 (server to client) +00000000 16 03 00 00 31 02 00 00 2d 03 00 00 00 00 00 00 |....1...-.......| +00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| +00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 2f 00 00 |............./..| +00000030 05 ff 01 00 01 00 16 03 00 02 71 0b 00 02 6d 00 |..........q...m.| +00000040 02 6a 00 02 67 30 82 02 63 30 82 01 cc a0 03 02 |.j..g0..c0......| +00000050 01 02 02 09 00 a2 73 00 0c 81 00 cb f3 30 0d 06 |......s......0..| +00000060 09 2a 86 48 86 f7 0d 01 01 0b 05 00 30 2b 31 17 |.*.H........0+1.| +00000070 30 15 06 03 55 04 0a 13 0e 47 6f 6f 67 6c 65 20 |0...U....Google | +00000080 54 45 53 54 49 4e 47 31 10 30 0e 06 03 55 04 03 |TESTING1.0...U..| +00000090 13 07 47 6f 20 52 6f 6f 74 30 1e 17 0d 31 35 30 |..Go Root0...150| +000000a0 31 30 31 30 30 30 30 30 30 5a 17 0d 32 35 30 31 |101000000Z..2501| +000000b0 30 31 30 30 30 30 30 30 5a 30 26 31 17 30 15 06 |01000000Z0&1.0..| +000000c0 03 55 04 0a 13 0e 47 6f 6f 67 6c 65 20 54 45 53 |.U....Google TES| +000000d0 54 49 4e 47 31 0b 30 09 06 03 55 04 03 13 02 47 |TING1.0...U....G| +000000e0 6f 30 81 9f 30 0d 06 09 2a 86 48 86 f7 0d 01 01 |o0..0...*.H.....| +000000f0 01 05 00 03 81 8d 00 30 81 89 02 81 81 00 af 87 |.......0........| +00000100 88 f6 20 1b 95 65 6c 14 ab 44 05 af 3b 45 14 e3 |.. ..el..D..;E..| +00000110 b7 6d fd 00 63 4d 95 7f fe 6a 62 35 86 c0 4a f9 |.m..cM...jb5..J.| +00000120 18 7c f6 aa 25 5e 7a 64 31 66 00 ba f4 8e 92 af |.|..%^zd1f......| +00000130 c7 6b d8 76 d4 f3 5f 41 cb 6e 56 15 97 1b 97 c1 |.k.v.._A.nV.....| +00000140 3c 12 39 21 66 3d 2b 16 d1 bc db 1c c0 a7 da b7 |<.9!f=+.........| +00000150 ca ad ba da cb d5 21 50 ec de 8d ab d1 6b 81 4b |......!P.....k.K| +00000160 89 02 f3 c4 be c1 6c 89 b1 44 84 bd 21 d1 04 7d |......l..D..!..}| +00000170 9d 16 4d f9 82 15 f6 ef fa d6 09 47 f2 fb 02 03 |..M........G....| +00000180 01 00 01 a3 81 93 30 81 90 30 0e 06 03 55 1d 0f |......0..0...U..| +00000190 01 01 ff 04 04 03 02 05 a0 30 1d 06 03 55 1d 25 |.........0...U.%| +000001a0 04 16 30 14 06 08 2b 06 01 05 05 07 03 01 06 08 |..0...+.........| +000001b0 2b 06 01 05 05 07 03 02 30 0c 06 03 55 1d 13 01 |+.......0...U...| +000001c0 01 ff 04 02 30 00 30 19 06 03 55 1d 0e 04 12 04 |....0.0...U.....| +000001d0 10 12 50 8d 89 6f 1b d1 dc 54 4d 6e cb 69 5e 06 |..P..o...TMn.i^.| +000001e0 f4 30 1b 06 03 55 1d 23 04 14 30 12 80 10 bf 3d |.0...U.#..0....=| +000001f0 b6 a9 66 f2 b8 40 cf ea b4 03 78 48 1a 41 30 19 |..f..@....xH.A0.| +00000200 06 03 55 1d 11 04 12 30 10 82 0e 65 78 61 6d 70 |..U....0...examp| +00000210 6c 65 2e 67 6f 6c 61 6e 67 30 0d 06 09 2a 86 48 |le.golang0...*.H| +00000220 86 f7 0d 01 01 0b 05 00 03 81 81 00 92 7c af 91 |.............|..| +00000230 55 12 18 96 59 31 a6 48 40 d5 2d d5 ee bb 02 a0 |U...Y1.H@.-.....| +00000240 f5 c2 1e 7c 9b b3 30 7d 3c dc 76 da 4f 3d c0 fa |...|..0}<.v.O=..| +00000250 ae 2d 33 24 6b 03 7b 1b 67 59 11 21 b5 11 bc 77 |.-3$k.{.gY.!...w| +00000260 b9 d9 e0 6e a8 2d 2e 35 fa 64 5f 22 3e 63 10 6b |...n.-.5.d_">c.k| +00000270 be ff 14 86 6d 0d f0 15 31 a8 14 38 1e 3b 84 87 |....m...1..8.;..| +00000280 2c cb 98 ed 51 76 b9 b1 4f dd db 9b 84 04 86 40 |,...Qv..O......@| +00000290 fa 51 dd ba b4 8d eb e3 46 de 46 b9 4f 86 c7 f9 |.Q......F.F.O...| +000002a0 a4 c2 41 34 ac cc f6 ea b0 ab 39 18 16 03 00 00 |..A4......9.....| +000002b0 04 0e 00 00 00 |.....| +>>> Flow 3 (client to server) +00000000 16 03 00 00 84 10 00 00 80 4d 3f 93 aa 84 d8 ad |.........M?.....| +00000010 93 2c 63 02 66 2f 96 88 b8 5c 09 1e 63 e2 e5 96 |.,c.f/...\..c...| +00000020 26 d8 07 14 86 26 62 f4 0c 04 68 1c bf bb b1 53 |&....&b...h....S| +00000030 97 96 43 59 4a 57 65 12 88 45 34 2b 86 2b 05 aa |..CYJWe..E4+.+..| +00000040 9b 2b b9 aa 13 30 5c 91 c0 9f 03 8a 96 61 dd 87 |.+...0\......a..| +00000050 ae e3 ad 6a 7b 8a 18 23 67 c9 df ad f2 47 eb 8b |...j{..#g....G..| +00000060 7d 24 95 47 f1 4e b5 c6 15 b4 12 2a 42 df b3 99 |}$.G.N.....*B...| +00000070 d1 b8 60 ce 6a cf 98 c1 13 a1 68 e6 92 ee 92 a2 |..`.j.....h.....| +00000080 1d 2f 63 66 f3 b9 1b fc 33 14 03 00 00 01 01 16 |./cf....3.......| +00000090 03 00 00 40 75 48 68 7d 8f f5 5a c0 cb 90 a5 9e |...@uHh}..Z.....| +000000a0 94 bb eb 61 b5 36 aa ce 09 7a 11 ba 22 56 2a d7 |...a.6...z.."V*.| +000000b0 91 a3 99 73 5b c5 b2 b7 b9 92 56 c6 cb fe 13 73 |...s[.....V....s| +000000c0 28 30 03 26 62 63 7e 8a d2 58 c8 e7 52 03 26 67 |(0.&bc~..X..R.&g| +000000d0 48 21 4f 21 |H!O!| +>>> Flow 4 (server to client) +00000000 14 03 00 00 01 01 16 03 00 00 40 84 8f 6e 80 35 |..........@..n.5| +00000010 57 73 64 ef 29 bb 25 ff 5d 9d c7 55 38 b7 18 b3 |Wsd.).%.]..U8...| +00000020 13 d1 ac 20 e0 1e f8 48 47 7a 40 2d bc a7 f2 af |... ...HGz@-....| +00000030 ed a6 26 48 f4 51 b4 b6 56 60 9b c3 d9 43 00 95 |..&H.Q..V`...C..| +00000040 86 be 6c 4e 49 6b f9 10 99 51 22 17 03 00 00 20 |..lNIk...Q".... | +00000050 d4 7e dc 50 7b c2 26 ee 79 09 84 9f d7 e0 52 b1 |.~.P{.&.y.....R.| +00000060 e8 9c 92 30 b7 34 06 c6 e5 86 57 a1 fb 8d 06 d6 |...0.4....W.....| +00000070 17 03 00 00 30 93 0a 3d 64 26 3d a2 74 bc 8f d1 |....0..=d&=.t...| +00000080 16 38 d0 6b 62 eb 82 b0 9a 50 68 aa 7e f7 45 32 |.8.kb....Ph.~.E2| +00000090 43 cb 84 2d 95 39 6c bc c8 a0 2d aa ea fe f5 84 |C..-.9l...-.....| +000000a0 c8 e4 8b 93 a1 15 03 00 00 20 03 7b 3e 43 1d 0a |......... .{>C..| +000000b0 9b 9b e3 17 0f de be 75 e5 6e 2f 5b e8 8d a8 68 |.......u.n/[...h| +000000c0 4e f0 82 49 00 dd b6 95 b4 22 |N..I....."| diff --git a/src/crypto/tls/testdata/Server-SSLv3-RSA-RC4 b/src/crypto/tls/testdata/Server-SSLv3-RSA-RC4 new file mode 100644 index 0000000000000000000000000000000000000000..39124c67ef17599532481192643d242c9fd89a5e --- /dev/null +++ b/src/crypto/tls/testdata/Server-SSLv3-RSA-RC4 @@ -0,0 +1,74 @@ +>>> Flow 1 (client to server) +00000000 16 03 00 00 2f 01 00 00 2b 03 00 a7 1d 3d ed 0f |..../...+....=..| +00000010 2c 7b 1f f1 c8 1c a9 17 ce 69 e2 73 a2 07 d2 91 |,{.......i.s....| +00000020 e9 27 fa 70 11 6f 18 6d 2a 25 f1 00 00 04 00 05 |.'.p.o.m*%......| +00000030 00 ff 01 00 |....| +>>> Flow 2 (server to client) +00000000 16 03 00 00 31 02 00 00 2d 03 00 00 00 00 00 00 |....1...-.......| +00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| +00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 05 00 00 |................| +00000030 05 ff 01 00 01 00 16 03 00 02 71 0b 00 02 6d 00 |..........q...m.| +00000040 02 6a 00 02 67 30 82 02 63 30 82 01 cc a0 03 02 |.j..g0..c0......| +00000050 01 02 02 09 00 a2 73 00 0c 81 00 cb f3 30 0d 06 |......s......0..| +00000060 09 2a 86 48 86 f7 0d 01 01 0b 05 00 30 2b 31 17 |.*.H........0+1.| +00000070 30 15 06 03 55 04 0a 13 0e 47 6f 6f 67 6c 65 20 |0...U....Google | +00000080 54 45 53 54 49 4e 47 31 10 30 0e 06 03 55 04 03 |TESTING1.0...U..| +00000090 13 07 47 6f 20 52 6f 6f 74 30 1e 17 0d 31 35 30 |..Go Root0...150| +000000a0 31 30 31 30 30 30 30 30 30 5a 17 0d 32 35 30 31 |101000000Z..2501| +000000b0 30 31 30 30 30 30 30 30 5a 30 26 31 17 30 15 06 |01000000Z0&1.0..| +000000c0 03 55 04 0a 13 0e 47 6f 6f 67 6c 65 20 54 45 53 |.U....Google TES| +000000d0 54 49 4e 47 31 0b 30 09 06 03 55 04 03 13 02 47 |TING1.0...U....G| +000000e0 6f 30 81 9f 30 0d 06 09 2a 86 48 86 f7 0d 01 01 |o0..0...*.H.....| +000000f0 01 05 00 03 81 8d 00 30 81 89 02 81 81 00 af 87 |.......0........| +00000100 88 f6 20 1b 95 65 6c 14 ab 44 05 af 3b 45 14 e3 |.. ..el..D..;E..| +00000110 b7 6d fd 00 63 4d 95 7f fe 6a 62 35 86 c0 4a f9 |.m..cM...jb5..J.| +00000120 18 7c f6 aa 25 5e 7a 64 31 66 00 ba f4 8e 92 af |.|..%^zd1f......| +00000130 c7 6b d8 76 d4 f3 5f 41 cb 6e 56 15 97 1b 97 c1 |.k.v.._A.nV.....| +00000140 3c 12 39 21 66 3d 2b 16 d1 bc db 1c c0 a7 da b7 |<.9!f=+.........| +00000150 ca ad ba da cb d5 21 50 ec de 8d ab d1 6b 81 4b |......!P.....k.K| +00000160 89 02 f3 c4 be c1 6c 89 b1 44 84 bd 21 d1 04 7d |......l..D..!..}| +00000170 9d 16 4d f9 82 15 f6 ef fa d6 09 47 f2 fb 02 03 |..M........G....| +00000180 01 00 01 a3 81 93 30 81 90 30 0e 06 03 55 1d 0f |......0..0...U..| +00000190 01 01 ff 04 04 03 02 05 a0 30 1d 06 03 55 1d 25 |.........0...U.%| +000001a0 04 16 30 14 06 08 2b 06 01 05 05 07 03 01 06 08 |..0...+.........| +000001b0 2b 06 01 05 05 07 03 02 30 0c 06 03 55 1d 13 01 |+.......0...U...| +000001c0 01 ff 04 02 30 00 30 19 06 03 55 1d 0e 04 12 04 |....0.0...U.....| +000001d0 10 12 50 8d 89 6f 1b d1 dc 54 4d 6e cb 69 5e 06 |..P..o...TMn.i^.| +000001e0 f4 30 1b 06 03 55 1d 23 04 14 30 12 80 10 bf 3d |.0...U.#..0....=| +000001f0 b6 a9 66 f2 b8 40 cf ea b4 03 78 48 1a 41 30 19 |..f..@....xH.A0.| +00000200 06 03 55 1d 11 04 12 30 10 82 0e 65 78 61 6d 70 |..U....0...examp| +00000210 6c 65 2e 67 6f 6c 61 6e 67 30 0d 06 09 2a 86 48 |le.golang0...*.H| +00000220 86 f7 0d 01 01 0b 05 00 03 81 81 00 92 7c af 91 |.............|..| +00000230 55 12 18 96 59 31 a6 48 40 d5 2d d5 ee bb 02 a0 |U...Y1.H@.-.....| +00000240 f5 c2 1e 7c 9b b3 30 7d 3c dc 76 da 4f 3d c0 fa |...|..0}<.v.O=..| +00000250 ae 2d 33 24 6b 03 7b 1b 67 59 11 21 b5 11 bc 77 |.-3$k.{.gY.!...w| +00000260 b9 d9 e0 6e a8 2d 2e 35 fa 64 5f 22 3e 63 10 6b |...n.-.5.d_">c.k| +00000270 be ff 14 86 6d 0d f0 15 31 a8 14 38 1e 3b 84 87 |....m...1..8.;..| +00000280 2c cb 98 ed 51 76 b9 b1 4f dd db 9b 84 04 86 40 |,...Qv..O......@| +00000290 fa 51 dd ba b4 8d eb e3 46 de 46 b9 4f 86 c7 f9 |.Q......F.F.O...| +000002a0 a4 c2 41 34 ac cc f6 ea b0 ab 39 18 16 03 00 00 |..A4......9.....| +000002b0 04 0e 00 00 00 |.....| +>>> Flow 3 (client to server) +00000000 16 03 00 00 84 10 00 00 80 25 85 a3 22 29 e4 fb |.........%..")..| +00000010 53 b9 a3 6b ed 70 2b 35 7f db 08 35 b8 4c 95 cd |S..k.p+5...5.L..| +00000020 00 ec 5e a1 2e ba e9 ac a6 d4 ef ca 74 a0 12 1b |..^.........t...| +00000030 a7 ec 76 22 2c 63 71 1a 3a 50 94 ce 96 c4 d7 76 |..v",cq.:P.....v| +00000040 1f 47 58 c7 57 98 af ea 7e 57 05 68 d3 f9 87 02 |.GX.W...~W.h....| +00000050 35 72 35 66 08 b4 cf 48 24 15 92 d5 ba 46 8d 60 |5r5f...H$....F.`| +00000060 5a 53 0b e4 9b 53 44 55 dc 77 d1 e4 e0 25 51 f6 |ZS...SDU.w...%Q.| +00000070 f1 7c 96 0b 32 d4 8c 04 d3 3d e6 70 c7 d6 60 a7 |.|..2....=.p..`.| +00000080 ae 69 22 69 41 1a 8d 12 67 14 03 00 00 01 01 16 |.i"iA...g.......| +00000090 03 00 00 3c 32 dd 86 fd 5b 53 74 ea 01 45 5b 9e |...<2...[St..E[.| +000000a0 32 d0 9d 27 e8 ce 4c d5 a1 c2 d3 2e 0a e9 e5 d2 |2..'..L.........| +000000b0 04 8c 77 a3 ff e9 8b 02 14 16 af 54 db ec c4 98 |..w........T....| +000000c0 72 50 f7 65 fa eb ac 11 07 81 d7 fa 4e 18 34 bc |rP.e........N.4.| +>>> Flow 4 (server to client) +00000000 14 03 00 00 01 01 16 03 00 00 3c 29 af 2c 96 3a |..........<).,.:| +00000010 be a0 91 a8 e4 66 6b 30 ba e2 80 fc a2 8a 09 b4 |.....fk0........| +00000020 28 14 3b 36 c2 3b 3e 88 e2 10 da 93 af 71 9a 06 |(.;6.;>......q..| +00000030 1c 8d 97 04 05 ec e2 69 cf 28 20 0f ec 4c a7 f3 |.......i.( ..L..| +00000040 18 4e 6b 5b 88 9c a9 17 03 00 00 21 5e 0b b4 2d |.Nk[.......!^..-| +00000050 a6 b5 0b 3a 86 de 8a e7 87 f3 4c f6 74 7e 0d 16 |...:......L.t~..| +00000060 9b fc 0c 42 6b f4 9e 15 8b 6a c5 97 88 15 03 00 |...Bk....j......| +00000070 00 16 f0 a4 e2 16 bf 81 05 ad 1d f5 1c 89 d9 ab |................| +00000080 48 23 ab 96 ea 92 aa cd |H#......| diff --git a/src/crypto/tls/testdata/Server-TLSv10-ECDHE-ECDSA-AES b/src/crypto/tls/testdata/Server-TLSv10-ECDHE-ECDSA-AES new file mode 100644 index 0000000000000000000000000000000000000000..f81ffc28c0e585f3c3e4882139ac4f2c079ee4ce --- /dev/null +++ b/src/crypto/tls/testdata/Server-TLSv10-ECDHE-ECDSA-AES @@ -0,0 +1,85 @@ +>>> Flow 1 (client to server) +00000000 16 03 01 00 7d 01 00 00 79 03 01 65 14 3f 40 e4 |....}...y..e.?@.| +00000010 2f 74 65 7e d0 c8 87 03 59 61 9d c3 84 5e c9 62 |/te~....Ya...^.b| +00000020 e6 46 b8 0c 4a 5e 3f 33 43 a5 dd 00 00 04 c0 0a |.F..J^?3C.......| +00000030 00 ff 02 01 00 00 4b 00 0b 00 04 03 00 01 02 00 |......K.........| +00000040 0a 00 3a 00 38 00 0e 00 0d 00 19 00 1c 00 0b 00 |..:.8...........| +00000050 0c 00 1b 00 18 00 09 00 0a 00 1a 00 16 00 17 00 |................| +00000060 08 00 06 00 07 00 14 00 15 00 04 00 05 00 12 00 |................| +00000070 13 00 01 00 02 00 03 00 0f 00 10 00 11 00 0f 00 |................| +00000080 01 01 |..| +>>> Flow 2 (server to client) +00000000 16 03 01 00 31 02 00 00 2d 03 01 00 00 00 00 00 |....1...-.......| +00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| +00000020 00 00 00 00 00 00 00 00 00 00 00 00 c0 0a 00 00 |................| +00000030 05 ff 01 00 01 00 16 03 01 02 0e 0b 00 02 0a 00 |................| +00000040 02 07 00 02 04 30 82 02 00 30 82 01 62 02 09 00 |.....0...0..b...| +00000050 b8 bf 2d 47 a0 d2 eb f4 30 09 06 07 2a 86 48 ce |..-G....0...*.H.| +00000060 3d 04 01 30 45 31 0b 30 09 06 03 55 04 06 13 02 |=..0E1.0...U....| +00000070 41 55 31 13 30 11 06 03 55 04 08 13 0a 53 6f 6d |AU1.0...U....Som| +00000080 65 2d 53 74 61 74 65 31 21 30 1f 06 03 55 04 0a |e-State1!0...U..| +00000090 13 18 49 6e 74 65 72 6e 65 74 20 57 69 64 67 69 |..Internet Widgi| +000000a0 74 73 20 50 74 79 20 4c 74 64 30 1e 17 0d 31 32 |ts Pty Ltd0...12| +000000b0 31 31 32 32 31 35 30 36 33 32 5a 17 0d 32 32 31 |1122150632Z..221| +000000c0 31 32 30 31 35 30 36 33 32 5a 30 45 31 0b 30 09 |120150632Z0E1.0.| +000000d0 06 03 55 04 06 13 02 41 55 31 13 30 11 06 03 55 |..U....AU1.0...U| +000000e0 04 08 13 0a 53 6f 6d 65 2d 53 74 61 74 65 31 21 |....Some-State1!| +000000f0 30 1f 06 03 55 04 0a 13 18 49 6e 74 65 72 6e 65 |0...U....Interne| +00000100 74 20 57 69 64 67 69 74 73 20 50 74 79 20 4c 74 |t Widgits Pty Lt| +00000110 64 30 81 9b 30 10 06 07 2a 86 48 ce 3d 02 01 06 |d0..0...*.H.=...| +00000120 05 2b 81 04 00 23 03 81 86 00 04 00 c4 a1 ed be |.+...#..........| +00000130 98 f9 0b 48 73 36 7e c3 16 56 11 22 f2 3d 53 c3 |...Hs6~..V.".=S.| +00000140 3b 4d 21 3d cd 6b 75 e6 f6 b0 dc 9a df 26 c1 bc |;M!=.ku......&..| +00000150 b2 87 f0 72 32 7c b3 64 2f 1c 90 bc ea 68 23 10 |...r2|.d/....h#.| +00000160 7e fe e3 25 c0 48 3a 69 e0 28 6d d3 37 00 ef 04 |~..%.H:i.(m.7...| +00000170 62 dd 0d a0 9c 70 62 83 d8 81 d3 64 31 aa 9e 97 |b....pb....d1...| +00000180 31 bd 96 b0 68 c0 9b 23 de 76 64 3f 1a 5c 7f e9 |1...h..#.vd?.\..| +00000190 12 0e 58 58 b6 5f 70 dd 9b d8 ea d5 d7 f5 d5 cc |..XX._p.........| +000001a0 b9 b6 9f 30 66 5b 66 9a 20 e2 27 e5 bf fe 3b 30 |...0f[f. .'...;0| +000001b0 09 06 07 2a 86 48 ce 3d 04 01 03 81 8c 00 30 81 |...*.H.=......0.| +000001c0 88 02 42 01 88 a2 4f eb e2 45 c5 48 7d 1b ac f5 |..B...O..E.H}...| +000001d0 ed 98 9d ae 47 70 c0 5e 1b b6 2f bd f1 b6 4d b7 |....Gp.^../...M.| +000001e0 61 40 d3 11 a2 ce ee 0b 7e 92 7e ff 76 9d c3 3b |a@......~.~.v..;| +000001f0 7e a5 3f ce fa 10 e2 59 ec 47 2d 7c ac da 4e 97 |~.?....Y.G-|..N.| +00000200 0e 15 a0 6f d0 02 42 01 4d fc be 67 13 9c 2d 05 |...o..B.M..g..-.| +00000210 0e bd 3f a3 8c 25 c1 33 13 83 0d 94 06 bb d4 37 |..?..%.3.......7| +00000220 7a f6 ec 7a c9 86 2e dd d7 11 69 7f 85 7c 56 de |z..z......i..|V.| +00000230 fb 31 78 2b e4 c7 78 0d ae cb be 9e 4e 36 24 31 |.1x+..x.....N6$1| +00000240 7b 6a 0f 39 95 12 07 8f 2a 16 03 01 00 d6 0c 00 |{j.9....*.......| +00000250 00 d2 03 00 17 41 04 1e 18 37 ef 0d 19 51 88 35 |.....A...7...Q.5| +00000260 75 71 b5 e5 54 5b 12 2e 8f 09 67 fd a7 24 20 3e |uq..T[....g..$ >| +00000270 b2 56 1c ce 97 28 5e f8 2b 2d 4f 9e f1 07 9f 6c |.V...(^.+-O....l| +00000280 4b 5b 83 56 e2 32 42 e9 58 b6 d7 49 a6 b5 68 1a |K[.V.2B.X..I..h.| +00000290 41 03 56 6b dc 5a 89 00 8b 30 81 88 02 42 01 3e |A.Vk.Z...0...B.>| +000002a0 79 81 6e 89 cd 3e 3f ec e4 b5 75 17 28 ee fb 09 |y.n..>?...u.(...| +000002b0 21 19 6f 3c e6 ca 1e f2 18 b6 47 f8 37 05 1c 85 |!.o<......G.7...| +000002c0 0f a4 b8 6b 40 04 50 77 e3 05 9b 24 b8 93 e8 4d |...k@.Pw...$...M| +000002d0 ef 30 cd 51 90 58 a2 49 71 b3 3f b9 46 ab a9 72 |.0.Q.X.Iq.?.F..r| +000002e0 02 42 01 58 ef 20 c1 0a 33 f8 fd 50 9e 65 f5 ef |.B.X. ..3..P.e..| +000002f0 f4 91 49 2d d2 de 66 2b 97 69 7d b1 d0 ef d6 91 |..I-..f+.i}.....| +00000300 0f fc 57 2b 73 b9 49 01 33 d2 1b 5b 9a 2c 51 35 |..W+s.I.3..[.,Q5| +00000310 0e eb 38 53 fa 20 07 84 52 b3 43 24 09 5a 32 c0 |..8S. ..R.C$.Z2.| +00000320 32 17 34 6c 16 03 01 00 04 0e 00 00 00 |2.4l.........| +>>> Flow 3 (client to server) +00000000 16 03 01 00 46 10 00 00 42 41 04 31 74 f8 f6 18 |....F...BA.1t...| +00000010 55 6a 9b 3b 78 0a 0e f0 c9 91 aa 8e 77 39 0a 88 |Uj.;x.......w9..| +00000020 a4 d4 f6 04 9d de 89 18 b6 50 12 72 26 9c 8f e1 |.........P.r&...| +00000030 f0 b2 e6 df ce 3b 46 be e9 2a 9a e3 7f d1 d5 92 |.....;F..*......| +00000040 ff e3 ae 0a 2d a1 3b 07 f6 04 59 14 03 01 00 01 |....-.;...Y.....| +00000050 01 16 03 01 00 30 02 4f df 41 30 97 6f f7 18 ca |.....0.O.A0.o...| +00000060 05 35 17 a1 a2 a5 71 61 b1 d8 dd 9a c6 f3 54 53 |.5....qa......TS| +00000070 84 f6 fb 93 1e 0e 9d e7 fe 35 85 9e 73 d0 2e a1 |.........5..s...| +00000080 a7 63 d9 40 c6 ac |.c.@..| +>>> Flow 4 (server to client) +00000000 14 03 01 00 01 01 16 03 01 00 30 07 7e 4e 9c 19 |..........0.~N..| +00000010 f0 35 cd 02 b7 a6 0a 1a b1 a8 11 a3 f9 b1 35 7b |.5............5{| +00000020 96 7f e6 e1 00 c6 6d 9e e6 8a bb a2 b8 bd a3 9d |......m.........| +00000030 05 22 1b f1 f5 28 4a 00 6e f1 71 17 03 01 00 20 |."...(J.n.q.... | +00000040 ad c7 4c dc f4 81 1a 39 3d 86 5e 8e f5 0d a3 33 |..L....9=.^....3| +00000050 88 32 e7 be 8b 6a 8d 44 29 7b 47 fd e5 33 01 1e |.2...j.D){G..3..| +00000060 17 03 01 00 30 61 47 ee ae 89 25 ac 85 3b 8a 84 |....0aG...%..;..| +00000070 47 61 ea 3e 4c 70 57 07 d6 f1 1c 21 cb 44 7e de |Ga.>LpW....!.D~.| +00000080 b5 01 9e fb fe ad bc be 74 c0 65 a0 6b c1 0c 8c |........t.e.k...| +00000090 2b 00 24 c6 b7 15 03 01 00 20 b7 8b 6b e5 77 ab |+.$...... ..k.w.| +000000a0 f6 50 9e 88 4d 56 a8 25 8d 02 db cb 68 8b 3f 62 |.P..MV.%....h.?b| +000000b0 be aa 02 24 75 b1 e5 4b 18 c9 |...$u..K..| diff --git a/src/crypto/tls/testdata/Server-TLSv10-RSA-3DES b/src/crypto/tls/testdata/Server-TLSv10-RSA-3DES new file mode 100644 index 0000000000000000000000000000000000000000..55cb487d12a9835b91c8b76eb9d05d2118b36847 --- /dev/null +++ b/src/crypto/tls/testdata/Server-TLSv10-RSA-3DES @@ -0,0 +1,74 @@ +>>> Flow 1 (client to server) +00000000 16 03 01 00 36 01 00 00 32 03 01 35 4a e8 32 84 |....6...2..5J.2.| +00000010 51 68 04 7e d0 0f 43 94 c7 5d 44 d2 95 a3 12 63 |Qh.~..C..]D....c| +00000020 77 c5 ce 78 5a 25 a3 81 df c4 6b 00 00 04 00 0a |w..xZ%....k.....| +00000030 00 ff 01 00 00 05 00 0f 00 01 01 |...........| +>>> Flow 2 (server to client) +00000000 16 03 01 00 31 02 00 00 2d 03 01 00 00 00 00 00 |....1...-.......| +00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| +00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 0a 00 00 |................| +00000030 05 ff 01 00 01 00 16 03 01 02 71 0b 00 02 6d 00 |..........q...m.| +00000040 02 6a 00 02 67 30 82 02 63 30 82 01 cc a0 03 02 |.j..g0..c0......| +00000050 01 02 02 09 00 a2 73 00 0c 81 00 cb f3 30 0d 06 |......s......0..| +00000060 09 2a 86 48 86 f7 0d 01 01 0b 05 00 30 2b 31 17 |.*.H........0+1.| +00000070 30 15 06 03 55 04 0a 13 0e 47 6f 6f 67 6c 65 20 |0...U....Google | +00000080 54 45 53 54 49 4e 47 31 10 30 0e 06 03 55 04 03 |TESTING1.0...U..| +00000090 13 07 47 6f 20 52 6f 6f 74 30 1e 17 0d 31 35 30 |..Go Root0...150| +000000a0 31 30 31 30 30 30 30 30 30 5a 17 0d 32 35 30 31 |101000000Z..2501| +000000b0 30 31 30 30 30 30 30 30 5a 30 26 31 17 30 15 06 |01000000Z0&1.0..| +000000c0 03 55 04 0a 13 0e 47 6f 6f 67 6c 65 20 54 45 53 |.U....Google TES| +000000d0 54 49 4e 47 31 0b 30 09 06 03 55 04 03 13 02 47 |TING1.0...U....G| +000000e0 6f 30 81 9f 30 0d 06 09 2a 86 48 86 f7 0d 01 01 |o0..0...*.H.....| +000000f0 01 05 00 03 81 8d 00 30 81 89 02 81 81 00 af 87 |.......0........| +00000100 88 f6 20 1b 95 65 6c 14 ab 44 05 af 3b 45 14 e3 |.. ..el..D..;E..| +00000110 b7 6d fd 00 63 4d 95 7f fe 6a 62 35 86 c0 4a f9 |.m..cM...jb5..J.| +00000120 18 7c f6 aa 25 5e 7a 64 31 66 00 ba f4 8e 92 af |.|..%^zd1f......| +00000130 c7 6b d8 76 d4 f3 5f 41 cb 6e 56 15 97 1b 97 c1 |.k.v.._A.nV.....| +00000140 3c 12 39 21 66 3d 2b 16 d1 bc db 1c c0 a7 da b7 |<.9!f=+.........| +00000150 ca ad ba da cb d5 21 50 ec de 8d ab d1 6b 81 4b |......!P.....k.K| +00000160 89 02 f3 c4 be c1 6c 89 b1 44 84 bd 21 d1 04 7d |......l..D..!..}| +00000170 9d 16 4d f9 82 15 f6 ef fa d6 09 47 f2 fb 02 03 |..M........G....| +00000180 01 00 01 a3 81 93 30 81 90 30 0e 06 03 55 1d 0f |......0..0...U..| +00000190 01 01 ff 04 04 03 02 05 a0 30 1d 06 03 55 1d 25 |.........0...U.%| +000001a0 04 16 30 14 06 08 2b 06 01 05 05 07 03 01 06 08 |..0...+.........| +000001b0 2b 06 01 05 05 07 03 02 30 0c 06 03 55 1d 13 01 |+.......0...U...| +000001c0 01 ff 04 02 30 00 30 19 06 03 55 1d 0e 04 12 04 |....0.0...U.....| +000001d0 10 12 50 8d 89 6f 1b d1 dc 54 4d 6e cb 69 5e 06 |..P..o...TMn.i^.| +000001e0 f4 30 1b 06 03 55 1d 23 04 14 30 12 80 10 bf 3d |.0...U.#..0....=| +000001f0 b6 a9 66 f2 b8 40 cf ea b4 03 78 48 1a 41 30 19 |..f..@....xH.A0.| +00000200 06 03 55 1d 11 04 12 30 10 82 0e 65 78 61 6d 70 |..U....0...examp| +00000210 6c 65 2e 67 6f 6c 61 6e 67 30 0d 06 09 2a 86 48 |le.golang0...*.H| +00000220 86 f7 0d 01 01 0b 05 00 03 81 81 00 92 7c af 91 |.............|..| +00000230 55 12 18 96 59 31 a6 48 40 d5 2d d5 ee bb 02 a0 |U...Y1.H@.-.....| +00000240 f5 c2 1e 7c 9b b3 30 7d 3c dc 76 da 4f 3d c0 fa |...|..0}<.v.O=..| +00000250 ae 2d 33 24 6b 03 7b 1b 67 59 11 21 b5 11 bc 77 |.-3$k.{.gY.!...w| +00000260 b9 d9 e0 6e a8 2d 2e 35 fa 64 5f 22 3e 63 10 6b |...n.-.5.d_">c.k| +00000270 be ff 14 86 6d 0d f0 15 31 a8 14 38 1e 3b 84 87 |....m...1..8.;..| +00000280 2c cb 98 ed 51 76 b9 b1 4f dd db 9b 84 04 86 40 |,...Qv..O......@| +00000290 fa 51 dd ba b4 8d eb e3 46 de 46 b9 4f 86 c7 f9 |.Q......F.F.O...| +000002a0 a4 c2 41 34 ac cc f6 ea b0 ab 39 18 16 03 01 00 |..A4......9.....| +000002b0 04 0e 00 00 00 |.....| +>>> Flow 3 (client to server) +00000000 16 03 01 00 86 10 00 00 82 00 80 1f 4d 12 64 f2 |............M.d.| +00000010 72 22 86 4a 16 05 3f d2 1b e5 ed a7 f1 19 c4 6d |r".J..?........m| +00000020 1d 3a 5c f6 46 8f b9 4d 9e c4 d4 19 95 0a 63 9f |.:\.F..M......c.| +00000030 8a 41 1f fc d5 98 45 ca 69 33 37 64 d5 c8 0e 5a |.A....E.i37d...Z| +00000040 12 9f 06 54 8a 61 8b 13 f0 d8 fb b9 97 fb cd 1d |...T.a..........| +00000050 bd 6c 88 cc 98 57 c3 66 3a 86 04 c9 b9 21 c6 f2 |.l...W.f:....!..| +00000060 f3 43 7d 4e bf 28 d5 a2 d7 39 e0 78 cb eb b4 af |.C}N.(...9.x....| +00000070 21 0e ae 4c 16 9b b3 49 5f 81 02 55 59 97 d9 d2 |!..L...I_..UY...| +00000080 c4 e2 4c be 0a a6 41 62 48 1d 66 14 03 01 00 01 |..L...AbH.f.....| +00000090 01 16 03 01 00 28 9d e0 c3 31 82 c2 48 5d fb 47 |.....(...1..H].G| +000000a0 85 60 d4 17 d2 4f 4d 3c 64 db e4 49 1f a9 66 93 |.`...OM>> Flow 4 (server to client) +00000000 14 03 01 00 01 01 16 03 01 00 28 94 66 8f ad 8f |..........(.f...| +00000010 9f 00 72 f6 af 51 47 67 63 df 3f dd 17 09 0a c5 |..r..QGgc.?.....| +00000020 bf f8 4d 66 39 f9 b5 47 01 f8 e8 6d ed b4 17 39 |..Mf9..G...m...9| +00000030 ff 0a ca 17 03 01 00 18 68 93 94 51 12 b9 17 0b |........h..Q....| +00000040 d1 a0 22 fc cc c4 76 1a 1e 02 c6 20 5e 74 83 4c |.."...v.... ^t.L| +00000050 17 03 01 00 28 08 bd 86 07 84 90 78 bd 1d 90 ce |....(......x....| +00000060 09 80 bb d8 de fd 39 82 4b c4 0d 06 f3 65 f5 5b |......9.K....e.[| +00000070 3d c3 fd 69 80 1f 51 ce 1d 98 f1 05 fa 15 03 01 |=..i..Q.........| +00000080 00 18 ed 48 04 21 85 77 d7 b6 29 e3 25 af ea ec |...H.!.w..).%...| +00000090 3e 41 82 a0 ca 7d 44 79 8a 0b |>A...}Dy..| diff --git a/src/crypto/tls/testdata/Server-TLSv10-RSA-AES b/src/crypto/tls/testdata/Server-TLSv10-RSA-AES new file mode 100644 index 0000000000000000000000000000000000000000..46713022890f527cb1031bddcc51d97376a6d7c4 --- /dev/null +++ b/src/crypto/tls/testdata/Server-TLSv10-RSA-AES @@ -0,0 +1,77 @@ +>>> Flow 1 (client to server) +00000000 16 03 01 00 36 01 00 00 32 03 01 8c 5a 87 31 6a |....6...2...Z.1j| +00000010 8c 7a d5 26 4b 94 17 27 fc a2 c0 5f b5 bc 3f 10 |.z.&K..'..._..?.| +00000020 80 0e e0 1e 36 80 4b 91 61 77 d4 00 00 04 00 2f |....6.K.aw...../| +00000030 00 ff 01 00 00 05 00 0f 00 01 01 |...........| +>>> Flow 2 (server to client) +00000000 16 03 01 00 31 02 00 00 2d 03 01 00 00 00 00 00 |....1...-.......| +00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| +00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 2f 00 00 |............./..| +00000030 05 ff 01 00 01 00 16 03 01 02 71 0b 00 02 6d 00 |..........q...m.| +00000040 02 6a 00 02 67 30 82 02 63 30 82 01 cc a0 03 02 |.j..g0..c0......| +00000050 01 02 02 09 00 a2 73 00 0c 81 00 cb f3 30 0d 06 |......s......0..| +00000060 09 2a 86 48 86 f7 0d 01 01 0b 05 00 30 2b 31 17 |.*.H........0+1.| +00000070 30 15 06 03 55 04 0a 13 0e 47 6f 6f 67 6c 65 20 |0...U....Google | +00000080 54 45 53 54 49 4e 47 31 10 30 0e 06 03 55 04 03 |TESTING1.0...U..| +00000090 13 07 47 6f 20 52 6f 6f 74 30 1e 17 0d 31 35 30 |..Go Root0...150| +000000a0 31 30 31 30 30 30 30 30 30 5a 17 0d 32 35 30 31 |101000000Z..2501| +000000b0 30 31 30 30 30 30 30 30 5a 30 26 31 17 30 15 06 |01000000Z0&1.0..| +000000c0 03 55 04 0a 13 0e 47 6f 6f 67 6c 65 20 54 45 53 |.U....Google TES| +000000d0 54 49 4e 47 31 0b 30 09 06 03 55 04 03 13 02 47 |TING1.0...U....G| +000000e0 6f 30 81 9f 30 0d 06 09 2a 86 48 86 f7 0d 01 01 |o0..0...*.H.....| +000000f0 01 05 00 03 81 8d 00 30 81 89 02 81 81 00 af 87 |.......0........| +00000100 88 f6 20 1b 95 65 6c 14 ab 44 05 af 3b 45 14 e3 |.. ..el..D..;E..| +00000110 b7 6d fd 00 63 4d 95 7f fe 6a 62 35 86 c0 4a f9 |.m..cM...jb5..J.| +00000120 18 7c f6 aa 25 5e 7a 64 31 66 00 ba f4 8e 92 af |.|..%^zd1f......| +00000130 c7 6b d8 76 d4 f3 5f 41 cb 6e 56 15 97 1b 97 c1 |.k.v.._A.nV.....| +00000140 3c 12 39 21 66 3d 2b 16 d1 bc db 1c c0 a7 da b7 |<.9!f=+.........| +00000150 ca ad ba da cb d5 21 50 ec de 8d ab d1 6b 81 4b |......!P.....k.K| +00000160 89 02 f3 c4 be c1 6c 89 b1 44 84 bd 21 d1 04 7d |......l..D..!..}| +00000170 9d 16 4d f9 82 15 f6 ef fa d6 09 47 f2 fb 02 03 |..M........G....| +00000180 01 00 01 a3 81 93 30 81 90 30 0e 06 03 55 1d 0f |......0..0...U..| +00000190 01 01 ff 04 04 03 02 05 a0 30 1d 06 03 55 1d 25 |.........0...U.%| +000001a0 04 16 30 14 06 08 2b 06 01 05 05 07 03 01 06 08 |..0...+.........| +000001b0 2b 06 01 05 05 07 03 02 30 0c 06 03 55 1d 13 01 |+.......0...U...| +000001c0 01 ff 04 02 30 00 30 19 06 03 55 1d 0e 04 12 04 |....0.0...U.....| +000001d0 10 12 50 8d 89 6f 1b d1 dc 54 4d 6e cb 69 5e 06 |..P..o...TMn.i^.| +000001e0 f4 30 1b 06 03 55 1d 23 04 14 30 12 80 10 bf 3d |.0...U.#..0....=| +000001f0 b6 a9 66 f2 b8 40 cf ea b4 03 78 48 1a 41 30 19 |..f..@....xH.A0.| +00000200 06 03 55 1d 11 04 12 30 10 82 0e 65 78 61 6d 70 |..U....0...examp| +00000210 6c 65 2e 67 6f 6c 61 6e 67 30 0d 06 09 2a 86 48 |le.golang0...*.H| +00000220 86 f7 0d 01 01 0b 05 00 03 81 81 00 92 7c af 91 |.............|..| +00000230 55 12 18 96 59 31 a6 48 40 d5 2d d5 ee bb 02 a0 |U...Y1.H@.-.....| +00000240 f5 c2 1e 7c 9b b3 30 7d 3c dc 76 da 4f 3d c0 fa |...|..0}<.v.O=..| +00000250 ae 2d 33 24 6b 03 7b 1b 67 59 11 21 b5 11 bc 77 |.-3$k.{.gY.!...w| +00000260 b9 d9 e0 6e a8 2d 2e 35 fa 64 5f 22 3e 63 10 6b |...n.-.5.d_">c.k| +00000270 be ff 14 86 6d 0d f0 15 31 a8 14 38 1e 3b 84 87 |....m...1..8.;..| +00000280 2c cb 98 ed 51 76 b9 b1 4f dd db 9b 84 04 86 40 |,...Qv..O......@| +00000290 fa 51 dd ba b4 8d eb e3 46 de 46 b9 4f 86 c7 f9 |.Q......F.F.O...| +000002a0 a4 c2 41 34 ac cc f6 ea b0 ab 39 18 16 03 01 00 |..A4......9.....| +000002b0 04 0e 00 00 00 |.....| +>>> Flow 3 (client to server) +00000000 16 03 01 00 86 10 00 00 82 00 80 31 f5 2e e4 c7 |...........1....| +00000010 f5 76 d6 f7 2d 1b 8d 4d a9 2a 43 84 b2 0b 08 d6 |.v..-..M.*C.....| +00000020 4d d9 9a eb 4b 01 49 6e 11 45 43 0d 31 a7 c3 66 |M...K.In.EC.1..f| +00000030 da 1c 92 68 fb 3d 36 27 94 2f 67 ae 3d 31 a3 8f |...h.=6'./g.=1..| +00000040 01 5a d9 17 92 bc 20 7c cb ae b4 ca 4c ce d4 a9 |.Z.... |....L...| +00000050 2c 1d fe fc 3c a9 14 31 1d 65 08 d8 6e 8d ac 9d |,...<..1.e..n...| +00000060 21 ee 63 4a e2 da 3c 0e b1 34 8f 6e 20 dd d4 d4 |!.cJ..<..4.n ...| +00000070 d8 16 27 5d 02 54 e6 ec 5f 43 84 5b 21 24 ef 5d |..'].T.._C.[!$.]| +00000080 45 c4 2b 2c 98 7d 50 dc 0b fc 76 14 03 01 00 01 |E.+,.}P...v.....| +00000090 01 16 03 01 00 30 ef 50 ea 3c e3 b7 a8 5b 9a d2 |.....0.P.<...[..| +000000a0 11 69 0f d0 5e 79 c8 cb 68 4a ac 16 ef b4 de 1f |.i..^y..hJ......| +000000b0 21 0b 8e 91 cb 70 3f 02 bd 45 c1 34 02 e0 66 8a |!....p?..E.4..f.| +000000c0 00 ea 6c 5a 96 41 |..lZ.A| +>>> Flow 4 (server to client) +00000000 14 03 01 00 01 01 16 03 01 00 30 99 2c 65 32 5f |..........0.,e2_| +00000010 53 37 d8 c2 98 87 f4 68 b6 d7 52 6a 14 c7 df 6e |S7.....h..Rj...n| +00000020 bb ce ae 31 d4 04 24 4d e9 c2 39 7b 68 a7 fa 90 |...1..$M..9{h...| +00000030 c1 30 14 a2 20 c0 8d e1 2a dc 22 17 03 01 00 20 |.0.. ...*.".... | +00000040 41 c5 03 05 20 53 e9 fa 0a 26 38 ab 84 6a 5e 36 |A... S...&8..j^6| +00000050 1b 03 80 2f c3 5c 0b 2c bd 7f 79 68 bb ab 4d 70 |.../.\.,..yh..Mp| +00000060 17 03 01 00 30 a1 04 3e f4 a2 54 7a e7 09 0f 20 |....0..>..Tz... | +00000070 38 f8 9e bb 1b 61 28 bf 46 e8 75 56 b4 c3 93 b9 |8....a(.F.uV....| +00000080 8c 18 3e 8e af 9f 59 1a 96 be db 61 80 56 c6 09 |..>...Y....a.V..| +00000090 3c 21 02 37 d2 15 03 01 00 20 13 d1 81 7d ca 04 |>> Flow 1 (client to server) +00000000 16 03 01 00 36 01 00 00 32 03 01 c5 fc 32 c0 09 |....6...2....2..| +00000010 47 0b a9 f3 72 c9 6c 3a e0 94 33 48 35 ac b9 3b |G...r.l:..3H5..;| +00000020 da 5f 8b 6e 0c 54 c3 16 f0 39 bd 00 00 04 00 05 |._.n.T...9......| +00000030 00 ff 01 00 00 05 00 0f 00 01 01 |...........| +>>> Flow 2 (server to client) +00000000 16 03 01 00 31 02 00 00 2d 03 01 00 00 00 00 00 |....1...-.......| +00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| +00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 05 00 00 |................| +00000030 05 ff 01 00 01 00 16 03 01 02 71 0b 00 02 6d 00 |..........q...m.| +00000040 02 6a 00 02 67 30 82 02 63 30 82 01 cc a0 03 02 |.j..g0..c0......| +00000050 01 02 02 09 00 a2 73 00 0c 81 00 cb f3 30 0d 06 |......s......0..| +00000060 09 2a 86 48 86 f7 0d 01 01 0b 05 00 30 2b 31 17 |.*.H........0+1.| +00000070 30 15 06 03 55 04 0a 13 0e 47 6f 6f 67 6c 65 20 |0...U....Google | +00000080 54 45 53 54 49 4e 47 31 10 30 0e 06 03 55 04 03 |TESTING1.0...U..| +00000090 13 07 47 6f 20 52 6f 6f 74 30 1e 17 0d 31 35 30 |..Go Root0...150| +000000a0 31 30 31 30 30 30 30 30 30 5a 17 0d 32 35 30 31 |101000000Z..2501| +000000b0 30 31 30 30 30 30 30 30 5a 30 26 31 17 30 15 06 |01000000Z0&1.0..| +000000c0 03 55 04 0a 13 0e 47 6f 6f 67 6c 65 20 54 45 53 |.U....Google TES| +000000d0 54 49 4e 47 31 0b 30 09 06 03 55 04 03 13 02 47 |TING1.0...U....G| +000000e0 6f 30 81 9f 30 0d 06 09 2a 86 48 86 f7 0d 01 01 |o0..0...*.H.....| +000000f0 01 05 00 03 81 8d 00 30 81 89 02 81 81 00 af 87 |.......0........| +00000100 88 f6 20 1b 95 65 6c 14 ab 44 05 af 3b 45 14 e3 |.. ..el..D..;E..| +00000110 b7 6d fd 00 63 4d 95 7f fe 6a 62 35 86 c0 4a f9 |.m..cM...jb5..J.| +00000120 18 7c f6 aa 25 5e 7a 64 31 66 00 ba f4 8e 92 af |.|..%^zd1f......| +00000130 c7 6b d8 76 d4 f3 5f 41 cb 6e 56 15 97 1b 97 c1 |.k.v.._A.nV.....| +00000140 3c 12 39 21 66 3d 2b 16 d1 bc db 1c c0 a7 da b7 |<.9!f=+.........| +00000150 ca ad ba da cb d5 21 50 ec de 8d ab d1 6b 81 4b |......!P.....k.K| +00000160 89 02 f3 c4 be c1 6c 89 b1 44 84 bd 21 d1 04 7d |......l..D..!..}| +00000170 9d 16 4d f9 82 15 f6 ef fa d6 09 47 f2 fb 02 03 |..M........G....| +00000180 01 00 01 a3 81 93 30 81 90 30 0e 06 03 55 1d 0f |......0..0...U..| +00000190 01 01 ff 04 04 03 02 05 a0 30 1d 06 03 55 1d 25 |.........0...U.%| +000001a0 04 16 30 14 06 08 2b 06 01 05 05 07 03 01 06 08 |..0...+.........| +000001b0 2b 06 01 05 05 07 03 02 30 0c 06 03 55 1d 13 01 |+.......0...U...| +000001c0 01 ff 04 02 30 00 30 19 06 03 55 1d 0e 04 12 04 |....0.0...U.....| +000001d0 10 12 50 8d 89 6f 1b d1 dc 54 4d 6e cb 69 5e 06 |..P..o...TMn.i^.| +000001e0 f4 30 1b 06 03 55 1d 23 04 14 30 12 80 10 bf 3d |.0...U.#..0....=| +000001f0 b6 a9 66 f2 b8 40 cf ea b4 03 78 48 1a 41 30 19 |..f..@....xH.A0.| +00000200 06 03 55 1d 11 04 12 30 10 82 0e 65 78 61 6d 70 |..U....0...examp| +00000210 6c 65 2e 67 6f 6c 61 6e 67 30 0d 06 09 2a 86 48 |le.golang0...*.H| +00000220 86 f7 0d 01 01 0b 05 00 03 81 81 00 92 7c af 91 |.............|..| +00000230 55 12 18 96 59 31 a6 48 40 d5 2d d5 ee bb 02 a0 |U...Y1.H@.-.....| +00000240 f5 c2 1e 7c 9b b3 30 7d 3c dc 76 da 4f 3d c0 fa |...|..0}<.v.O=..| +00000250 ae 2d 33 24 6b 03 7b 1b 67 59 11 21 b5 11 bc 77 |.-3$k.{.gY.!...w| +00000260 b9 d9 e0 6e a8 2d 2e 35 fa 64 5f 22 3e 63 10 6b |...n.-.5.d_">c.k| +00000270 be ff 14 86 6d 0d f0 15 31 a8 14 38 1e 3b 84 87 |....m...1..8.;..| +00000280 2c cb 98 ed 51 76 b9 b1 4f dd db 9b 84 04 86 40 |,...Qv..O......@| +00000290 fa 51 dd ba b4 8d eb e3 46 de 46 b9 4f 86 c7 f9 |.Q......F.F.O...| +000002a0 a4 c2 41 34 ac cc f6 ea b0 ab 39 18 16 03 01 00 |..A4......9.....| +000002b0 04 0e 00 00 00 |.....| +>>> Flow 3 (client to server) +00000000 16 03 01 00 86 10 00 00 82 00 80 6a ad 7f e3 26 |...........j...&| +00000010 71 da 48 af 11 63 de 2e e8 50 f9 6a be 04 3d 17 |q.H..c...P.j..=.| +00000020 d1 29 fe 2c 7f b6 26 c1 7e 0b 18 1c 41 62 5c 91 |.).,..&.~...Ab\.| +00000030 ee 26 9c 92 f5 d1 e9 29 e1 ca a7 01 6a 41 b9 00 |.&.....)....jA..| +00000040 34 1d 5b c6 28 0e 1a 8f 32 c5 03 e7 a1 8f 89 1b |4.[.(...2.......| +00000050 af 13 22 2b 5b e8 76 2d 00 ac da 27 75 95 75 e7 |.."+[.v-...'u.u.| +00000060 00 00 39 2c bf f2 01 57 e6 29 e3 26 b1 6b ae c5 |..9,...W.).&.k..| +00000070 8d ce d2 36 b2 94 1f 9c 30 5e b2 16 3d 20 cf 4d |...6....0^..= .M| +00000080 88 f5 ac 4c 27 e3 f5 86 ef 9e dc 14 03 01 00 01 |...L'...........| +00000090 01 16 03 01 00 24 48 d8 80 c4 37 22 31 99 53 30 |.....$H...7"1.S0| +000000a0 5b 00 07 7e 87 2e 59 9a d9 0c 42 9e dd ed da 89 |[..~..Y...B.....| +000000b0 1a 1f cb ab 55 0c ba d9 a9 c0 |....U.....| +>>> Flow 4 (server to client) +00000000 14 03 01 00 01 01 16 03 01 00 24 ae 00 c8 14 67 |..........$....g| +00000010 4b b5 21 96 98 91 d6 27 40 9b 5e a5 86 53 56 f3 |K.!....'@.^..SV.| +00000020 f6 dc 7e b2 49 78 4b 4d 57 7c 62 a5 f2 16 8f 17 |..~.IxKMW|b.....| +00000030 03 01 00 21 34 e3 48 58 1c 67 fb 3a 46 28 5d a1 |...!4.HX.g.:F(].| +00000040 19 66 58 b1 bb fb e7 17 71 07 3f 0a d0 7c c9 24 |.fX.....q.?..|.$| +00000050 c7 ef 41 af 62 15 03 01 00 16 dd dc 16 dc 16 cc |..A.b...........| +00000060 0d f3 2c 29 00 c0 4f 01 68 05 92 a0 f7 ad e2 63 |..,)..O.h......c| diff --git a/src/crypto/tls/testdata/Server-TLSv11-FallbackSCSV b/src/crypto/tls/testdata/Server-TLSv11-FallbackSCSV new file mode 100644 index 0000000000000000000000000000000000000000..2d8dfbc3b491e1bdbfd4f1c5ec332679dfa7a010 --- /dev/null +++ b/src/crypto/tls/testdata/Server-TLSv11-FallbackSCSV @@ -0,0 +1,17 @@ +>>> Flow 1 (client to server) +00000000 16 03 01 00 d4 01 00 00 d0 03 02 74 2d da 6d 98 |...........t-.m.| +00000010 ad 3e a5 ec 90 ea d1 5b f0 e0 a7 45 33 d9 5e 8d |.>.....[...E3.^.| +00000020 0f 1d 01 16 6d 00 31 65 ed 50 88 00 00 5e c0 14 |....m.1e.P...^..| +00000030 c0 0a 00 39 00 38 00 88 00 87 c0 0f c0 05 00 35 |...9.8.........5| +00000040 00 84 c0 13 c0 09 00 33 00 32 00 9a 00 99 00 45 |.......3.2.....E| +00000050 00 44 c0 0e c0 04 00 2f 00 96 00 41 00 07 c0 11 |.D...../...A....| +00000060 c0 07 c0 0c c0 02 00 05 00 04 c0 12 c0 08 00 16 |................| +00000070 00 13 c0 0d c0 03 00 0a 00 15 00 12 00 09 00 14 |................| +00000080 00 11 00 08 00 06 00 03 00 ff 56 00 01 00 00 49 |..........V....I| +00000090 00 0b 00 04 03 00 01 02 00 0a 00 34 00 32 00 0e |...........4.2..| +000000a0 00 0d 00 19 00 0b 00 0c 00 18 00 09 00 0a 00 16 |................| +000000b0 00 17 00 08 00 06 00 07 00 14 00 15 00 04 00 05 |................| +000000c0 00 12 00 13 00 01 00 02 00 03 00 0f 00 10 00 11 |................| +000000d0 00 23 00 00 00 0f 00 01 01 |.#.......| +>>> Flow 2 (server to client) +00000000 15 03 02 00 02 02 56 |......V| diff --git a/src/crypto/tls/testdata/Server-TLSv11-RSA-RC4 b/src/crypto/tls/testdata/Server-TLSv11-RSA-RC4 new file mode 100644 index 0000000000000000000000000000000000000000..dc5e765e5438ae0f1823d8098811be05f93c9eaa --- /dev/null +++ b/src/crypto/tls/testdata/Server-TLSv11-RSA-RC4 @@ -0,0 +1,71 @@ +>>> Flow 1 (client to server) +00000000 16 03 01 00 36 01 00 00 32 03 02 ff e1 a1 04 0b |....6...2.......| +00000010 c2 dc fb 7d 07 61 44 9b 00 67 fe 38 73 f5 fc 4e |...}.aD..g.8s..N| +00000020 35 94 0a d5 c1 d0 e7 54 dc 44 1f 00 00 04 00 05 |5......T.D......| +00000030 00 ff 01 00 00 05 00 0f 00 01 01 |...........| +>>> Flow 2 (server to client) +00000000 16 03 02 00 31 02 00 00 2d 03 02 00 00 00 00 00 |....1...-.......| +00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| +00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 05 00 00 |................| +00000030 05 ff 01 00 01 00 16 03 02 02 71 0b 00 02 6d 00 |..........q...m.| +00000040 02 6a 00 02 67 30 82 02 63 30 82 01 cc a0 03 02 |.j..g0..c0......| +00000050 01 02 02 09 00 a2 73 00 0c 81 00 cb f3 30 0d 06 |......s......0..| +00000060 09 2a 86 48 86 f7 0d 01 01 0b 05 00 30 2b 31 17 |.*.H........0+1.| +00000070 30 15 06 03 55 04 0a 13 0e 47 6f 6f 67 6c 65 20 |0...U....Google | +00000080 54 45 53 54 49 4e 47 31 10 30 0e 06 03 55 04 03 |TESTING1.0...U..| +00000090 13 07 47 6f 20 52 6f 6f 74 30 1e 17 0d 31 35 30 |..Go Root0...150| +000000a0 31 30 31 30 30 30 30 30 30 5a 17 0d 32 35 30 31 |101000000Z..2501| +000000b0 30 31 30 30 30 30 30 30 5a 30 26 31 17 30 15 06 |01000000Z0&1.0..| +000000c0 03 55 04 0a 13 0e 47 6f 6f 67 6c 65 20 54 45 53 |.U....Google TES| +000000d0 54 49 4e 47 31 0b 30 09 06 03 55 04 03 13 02 47 |TING1.0...U....G| +000000e0 6f 30 81 9f 30 0d 06 09 2a 86 48 86 f7 0d 01 01 |o0..0...*.H.....| +000000f0 01 05 00 03 81 8d 00 30 81 89 02 81 81 00 af 87 |.......0........| +00000100 88 f6 20 1b 95 65 6c 14 ab 44 05 af 3b 45 14 e3 |.. ..el..D..;E..| +00000110 b7 6d fd 00 63 4d 95 7f fe 6a 62 35 86 c0 4a f9 |.m..cM...jb5..J.| +00000120 18 7c f6 aa 25 5e 7a 64 31 66 00 ba f4 8e 92 af |.|..%^zd1f......| +00000130 c7 6b d8 76 d4 f3 5f 41 cb 6e 56 15 97 1b 97 c1 |.k.v.._A.nV.....| +00000140 3c 12 39 21 66 3d 2b 16 d1 bc db 1c c0 a7 da b7 |<.9!f=+.........| +00000150 ca ad ba da cb d5 21 50 ec de 8d ab d1 6b 81 4b |......!P.....k.K| +00000160 89 02 f3 c4 be c1 6c 89 b1 44 84 bd 21 d1 04 7d |......l..D..!..}| +00000170 9d 16 4d f9 82 15 f6 ef fa d6 09 47 f2 fb 02 03 |..M........G....| +00000180 01 00 01 a3 81 93 30 81 90 30 0e 06 03 55 1d 0f |......0..0...U..| +00000190 01 01 ff 04 04 03 02 05 a0 30 1d 06 03 55 1d 25 |.........0...U.%| +000001a0 04 16 30 14 06 08 2b 06 01 05 05 07 03 01 06 08 |..0...+.........| +000001b0 2b 06 01 05 05 07 03 02 30 0c 06 03 55 1d 13 01 |+.......0...U...| +000001c0 01 ff 04 02 30 00 30 19 06 03 55 1d 0e 04 12 04 |....0.0...U.....| +000001d0 10 12 50 8d 89 6f 1b d1 dc 54 4d 6e cb 69 5e 06 |..P..o...TMn.i^.| +000001e0 f4 30 1b 06 03 55 1d 23 04 14 30 12 80 10 bf 3d |.0...U.#..0....=| +000001f0 b6 a9 66 f2 b8 40 cf ea b4 03 78 48 1a 41 30 19 |..f..@....xH.A0.| +00000200 06 03 55 1d 11 04 12 30 10 82 0e 65 78 61 6d 70 |..U....0...examp| +00000210 6c 65 2e 67 6f 6c 61 6e 67 30 0d 06 09 2a 86 48 |le.golang0...*.H| +00000220 86 f7 0d 01 01 0b 05 00 03 81 81 00 92 7c af 91 |.............|..| +00000230 55 12 18 96 59 31 a6 48 40 d5 2d d5 ee bb 02 a0 |U...Y1.H@.-.....| +00000240 f5 c2 1e 7c 9b b3 30 7d 3c dc 76 da 4f 3d c0 fa |...|..0}<.v.O=..| +00000250 ae 2d 33 24 6b 03 7b 1b 67 59 11 21 b5 11 bc 77 |.-3$k.{.gY.!...w| +00000260 b9 d9 e0 6e a8 2d 2e 35 fa 64 5f 22 3e 63 10 6b |...n.-.5.d_">c.k| +00000270 be ff 14 86 6d 0d f0 15 31 a8 14 38 1e 3b 84 87 |....m...1..8.;..| +00000280 2c cb 98 ed 51 76 b9 b1 4f dd db 9b 84 04 86 40 |,...Qv..O......@| +00000290 fa 51 dd ba b4 8d eb e3 46 de 46 b9 4f 86 c7 f9 |.Q......F.F.O...| +000002a0 a4 c2 41 34 ac cc f6 ea b0 ab 39 18 16 03 02 00 |..A4......9.....| +000002b0 04 0e 00 00 00 |.....| +>>> Flow 3 (client to server) +00000000 16 03 02 00 86 10 00 00 82 00 80 4c e0 4d 6a 19 |...........L.Mj.| +00000010 a2 72 2a 3d 41 14 a7 b3 0a 25 11 bf c9 9f cf 8c |.r*=A....%......| +00000020 3c 0b 01 49 aa f1 59 4b 60 ac e5 72 9b ec 20 41 |<..I..YK`..r.. A| +00000030 2f 7e ef bf e0 fe 13 c0 1d fd 51 c5 08 c6 9a 9e |/~........Q.....| +00000040 74 88 c7 e3 36 99 73 fd 00 2d a2 6a bd 25 f2 d7 |t...6.s..-.j.%..| +00000050 24 fd fd ab 0c e0 18 38 ba 7b f0 c9 c0 58 a6 d0 |$......8.{...X..| +00000060 4e e2 59 70 aa f4 52 34 12 a0 ec a4 53 1e 8b ee |N.Yp..R4....S...| +00000070 3e bf a4 87 da 02 4c 95 bd 10 af e8 88 c9 ce 87 |>.....L.........| +00000080 3c 9e 91 70 91 a0 85 18 84 e4 e0 14 03 02 00 01 |<..p............| +00000090 01 16 03 02 00 24 c5 c0 27 71 49 ad ed 37 e6 5d |.....$..'qI..7.]| +000000a0 1b 78 3e 74 15 b7 61 e5 f3 af 1e d0 a2 85 b3 13 |.x>t..a.........| +000000b0 6e 5e 9a c7 3d 47 32 4d 1b 8d |n^..=G2M..| +>>> Flow 4 (server to client) +00000000 14 03 02 00 01 01 16 03 02 00 24 31 22 76 4d 43 |..........$1"vMC| +00000010 7a 8a 58 2c 7d 1c 41 39 bf 08 7e 82 17 55 52 b3 |z.X,}.A9..~..UR.| +00000020 81 bd 7a f8 3c bf 9c 2b f0 9b 3f 65 f5 42 15 17 |..z.<..+..?e.B..| +00000030 03 02 00 21 b1 cc e5 56 16 70 58 0b 91 3c 8c 46 |...!...V.pX..<.F| +00000040 0e 3b b6 fe 32 5d 2e b0 8c 6a 1c a0 82 c9 43 81 |.;..2]...j....C.| +00000050 cf 07 25 47 c9 15 03 02 00 16 53 91 04 70 ba 03 |..%G......S..p..| +00000060 53 69 57 86 3b 2f 8b 97 37 7c b8 85 46 b6 72 42 |SiW.;/..7|..F.rB| diff --git a/src/crypto/tls/testdata/Server-TLSv12-ALPN b/src/crypto/tls/testdata/Server-TLSv12-ALPN new file mode 100644 index 0000000000000000000000000000000000000000..cbfeb42eb06deaf96867e6c378fa4be379e267f8 --- /dev/null +++ b/src/crypto/tls/testdata/Server-TLSv12-ALPN @@ -0,0 +1,109 @@ +>>> Flow 1 (client to server) +00000000 16 03 01 01 4c 01 00 01 48 03 03 44 3b 24 ee 2f |....L...H..D;$./| +00000010 63 3d ca bd 3e c5 bf a2 24 f1 59 c3 54 dc f0 43 |c=..>...$.Y.T..C| +00000020 15 c4 51 f2 29 ea 1b ce 2c fe af 00 00 b6 c0 30 |..Q.)...,......0| +00000030 c0 2c c0 28 c0 24 c0 14 c0 0a 00 a5 00 a3 00 a1 |.,.(.$..........| +00000040 00 9f 00 6b 00 6a 00 69 00 68 00 39 00 38 00 37 |...k.j.i.h.9.8.7| +00000050 00 36 00 88 00 87 00 86 00 85 c0 32 c0 2e c0 2a |.6.........2...*| +00000060 c0 26 c0 0f c0 05 00 9d 00 3d 00 35 00 84 c0 2f |.&.......=.5.../| +00000070 c0 2b c0 27 c0 23 c0 13 c0 09 00 a4 00 a2 00 a0 |.+.'.#..........| +00000080 00 9e 00 67 00 40 00 3f 00 3e 00 33 00 32 00 31 |...g.@.?.>.3.2.1| +00000090 00 30 00 9a 00 99 00 98 00 97 00 45 00 44 00 43 |.0.........E.D.C| +000000a0 00 42 c0 31 c0 2d c0 29 c0 25 c0 0e c0 04 00 9c |.B.1.-.).%......| +000000b0 00 3c 00 2f 00 96 00 41 00 07 c0 11 c0 07 c0 0c |.<./...A........| +000000c0 c0 02 00 05 00 04 c0 12 c0 08 00 16 00 13 00 10 |................| +000000d0 00 0d c0 0d c0 03 00 0a 00 15 00 12 00 0f 00 0c |................| +000000e0 00 09 00 ff 01 00 00 69 00 0b 00 04 03 00 01 02 |.......i........| +000000f0 00 0a 00 1c 00 1a 00 17 00 19 00 1c 00 1b 00 18 |................| +00000100 00 1a 00 16 00 0e 00 0d 00 0b 00 0c 00 09 00 0a |................| +00000110 00 23 00 00 00 0d 00 20 00 1e 06 01 06 02 06 03 |.#..... ........| +00000120 05 01 05 02 05 03 04 01 04 02 04 03 03 01 03 02 |................| +00000130 03 03 02 01 02 02 02 03 00 0f 00 01 01 00 10 00 |................| +00000140 10 00 0e 06 70 72 6f 74 6f 32 06 70 72 6f 74 6f |....proto2.proto| +00000150 31 |1| +>>> Flow 2 (server to client) +00000000 16 03 03 00 42 02 00 00 3e 03 03 00 00 00 00 00 |....B...>.......| +00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| +00000020 00 00 00 00 00 00 00 00 00 00 00 00 c0 30 00 00 |.............0..| +00000030 16 00 23 00 00 ff 01 00 01 00 00 10 00 09 00 07 |..#.............| +00000040 06 70 72 6f 74 6f 31 16 03 03 02 71 0b 00 02 6d |.proto1....q...m| +00000050 00 02 6a 00 02 67 30 82 02 63 30 82 01 cc a0 03 |..j..g0..c0.....| +00000060 02 01 02 02 09 00 a2 73 00 0c 81 00 cb f3 30 0d |.......s......0.| +00000070 06 09 2a 86 48 86 f7 0d 01 01 0b 05 00 30 2b 31 |..*.H........0+1| +00000080 17 30 15 06 03 55 04 0a 13 0e 47 6f 6f 67 6c 65 |.0...U....Google| +00000090 20 54 45 53 54 49 4e 47 31 10 30 0e 06 03 55 04 | TESTING1.0...U.| +000000a0 03 13 07 47 6f 20 52 6f 6f 74 30 1e 17 0d 31 35 |...Go Root0...15| +000000b0 30 31 30 31 30 30 30 30 30 30 5a 17 0d 32 35 30 |0101000000Z..250| +000000c0 31 30 31 30 30 30 30 30 30 5a 30 26 31 17 30 15 |101000000Z0&1.0.| +000000d0 06 03 55 04 0a 13 0e 47 6f 6f 67 6c 65 20 54 45 |..U....Google TE| +000000e0 53 54 49 4e 47 31 0b 30 09 06 03 55 04 03 13 02 |STING1.0...U....| +000000f0 47 6f 30 81 9f 30 0d 06 09 2a 86 48 86 f7 0d 01 |Go0..0...*.H....| +00000100 01 01 05 00 03 81 8d 00 30 81 89 02 81 81 00 af |........0.......| +00000110 87 88 f6 20 1b 95 65 6c 14 ab 44 05 af 3b 45 14 |... ..el..D..;E.| +00000120 e3 b7 6d fd 00 63 4d 95 7f fe 6a 62 35 86 c0 4a |..m..cM...jb5..J| +00000130 f9 18 7c f6 aa 25 5e 7a 64 31 66 00 ba f4 8e 92 |..|..%^zd1f.....| +00000140 af c7 6b d8 76 d4 f3 5f 41 cb 6e 56 15 97 1b 97 |..k.v.._A.nV....| +00000150 c1 3c 12 39 21 66 3d 2b 16 d1 bc db 1c c0 a7 da |.<.9!f=+........| +00000160 b7 ca ad ba da cb d5 21 50 ec de 8d ab d1 6b 81 |.......!P.....k.| +00000170 4b 89 02 f3 c4 be c1 6c 89 b1 44 84 bd 21 d1 04 |K......l..D..!..| +00000180 7d 9d 16 4d f9 82 15 f6 ef fa d6 09 47 f2 fb 02 |}..M........G...| +00000190 03 01 00 01 a3 81 93 30 81 90 30 0e 06 03 55 1d |.......0..0...U.| +000001a0 0f 01 01 ff 04 04 03 02 05 a0 30 1d 06 03 55 1d |..........0...U.| +000001b0 25 04 16 30 14 06 08 2b 06 01 05 05 07 03 01 06 |%..0...+........| +000001c0 08 2b 06 01 05 05 07 03 02 30 0c 06 03 55 1d 13 |.+.......0...U..| +000001d0 01 01 ff 04 02 30 00 30 19 06 03 55 1d 0e 04 12 |.....0.0...U....| +000001e0 04 10 12 50 8d 89 6f 1b d1 dc 54 4d 6e cb 69 5e |...P..o...TMn.i^| +000001f0 06 f4 30 1b 06 03 55 1d 23 04 14 30 12 80 10 bf |..0...U.#..0....| +00000200 3d b6 a9 66 f2 b8 40 cf ea b4 03 78 48 1a 41 30 |=..f..@....xH.A0| +00000210 19 06 03 55 1d 11 04 12 30 10 82 0e 65 78 61 6d |...U....0...exam| +00000220 70 6c 65 2e 67 6f 6c 61 6e 67 30 0d 06 09 2a 86 |ple.golang0...*.| +00000230 48 86 f7 0d 01 01 0b 05 00 03 81 81 00 92 7c af |H.............|.| +00000240 91 55 12 18 96 59 31 a6 48 40 d5 2d d5 ee bb 02 |.U...Y1.H@.-....| +00000250 a0 f5 c2 1e 7c 9b b3 30 7d 3c dc 76 da 4f 3d c0 |....|..0}<.v.O=.| +00000260 fa ae 2d 33 24 6b 03 7b 1b 67 59 11 21 b5 11 bc |..-3$k.{.gY.!...| +00000270 77 b9 d9 e0 6e a8 2d 2e 35 fa 64 5f 22 3e 63 10 |w...n.-.5.d_">c.| +00000280 6b be ff 14 86 6d 0d f0 15 31 a8 14 38 1e 3b 84 |k....m...1..8.;.| +00000290 87 2c cb 98 ed 51 76 b9 b1 4f dd db 9b 84 04 86 |.,...Qv..O......| +000002a0 40 fa 51 dd ba b4 8d eb e3 46 de 46 b9 4f 86 c7 |@.Q......F.F.O..| +000002b0 f9 a4 c2 41 34 ac cc f6 ea b0 ab 39 18 16 03 03 |...A4......9....| +000002c0 00 cd 0c 00 00 c9 03 00 17 41 04 1e 18 37 ef 0d |.........A...7..| +000002d0 19 51 88 35 75 71 b5 e5 54 5b 12 2e 8f 09 67 fd |.Q.5uq..T[....g.| +000002e0 a7 24 20 3e b2 56 1c ce 97 28 5e f8 2b 2d 4f 9e |.$ >.V...(^.+-O.| +000002f0 f1 07 9f 6c 4b 5b 83 56 e2 32 42 e9 58 b6 d7 49 |...lK[.V.2B.X..I| +00000300 a6 b5 68 1a 41 03 56 6b dc 5a 89 05 01 00 80 40 |..h.A.Vk.Z.....@| +00000310 93 b2 1f 79 3d 56 c0 ae 94 87 c0 a7 28 ef 1d 15 |...y=V......(...| +00000320 be 4b fb 66 e0 60 2c a3 57 ee 56 7d d6 89 b8 8e |.K.f.`,.W.V}....| +00000330 8f 0f 3f 1b c6 9f a4 1d 34 60 b6 9c e9 9b a9 27 |..?.....4`.....'| +00000340 d0 45 7b 04 71 2d db 9c 67 1b d5 d4 fe 19 69 59 |.E{.q-..g.....iY| +00000350 71 8a 35 75 33 a8 c9 f2 4d c4 8f 40 17 a7 25 53 |q.5u3...M..@..%S| +00000360 57 c5 cd ee df a9 3b a3 61 ab e2 a2 ca de 5c 08 |W.....;.a.....\.| +00000370 3d 5b a2 ef cd c8 bc 16 1f 1d 0f 83 9e b7 20 f5 |=[............ .| +00000380 89 3f 09 ba 2e da 12 34 81 e5 2f 8d 3c 90 89 16 |.?.....4../.<...| +00000390 03 03 00 04 0e 00 00 00 |........| +>>> Flow 3 (client to server) +00000000 16 03 03 00 46 10 00 00 42 41 04 8b a2 de a6 1e |....F...BA......| +00000010 d9 22 3c 03 4a be 49 2f 40 e3 1e e0 b4 76 7f 78 |."<.J.I/@....v.x| +00000020 96 22 8d 8d c9 45 3b d8 7a ce e3 16 3d 37 ec 80 |."...E;.z...=7..| +00000030 aa 3f d5 19 de c1 2c 7b 7f eb 3c fc 5d c3 52 3b |.?....,{..<.].R;| +00000040 d4 22 25 1c c7 1f 39 c5 23 bd 73 14 03 03 00 01 |."%...9.#.s.....| +00000050 01 16 03 03 00 28 c8 53 0a ad c2 f6 7e 18 08 a3 |.....(.S....~...| +00000060 29 27 20 1c 6c 1d 6c d8 8f 05 31 de e6 ab 7f 22 |)' .l.l...1...."| +00000070 93 6a fb ef b0 f8 43 a9 d3 4f 9d 04 b5 9a |.j....C..O....| +>>> Flow 4 (server to client) +00000000 16 03 03 00 82 04 00 00 7e 00 00 00 00 00 78 50 |........~.....xP| +00000010 46 ad c1 db a8 38 86 7b 2b bb fd d0 c3 42 3e 00 |F....8.{+....B>.| +00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 94 |................| +00000030 6f ec 80 83 61 8e d9 64 ac a2 ee 3b 69 31 79 e1 |o...a..d...;i1y.| +00000040 53 0a 92 1d aa 23 09 c2 49 02 2d 0d 1d c1 63 d6 |S....#..I.-...c.| +00000050 21 56 c7 24 02 28 d5 f1 11 b0 e7 1b 4a 7c 55 af |!V.$.(......J|U.| +00000060 1b c8 32 4c 5b 33 94 b0 ed b0 2f 52 c4 52 81 ee |..2L[3..../R.R..| +00000070 60 6f 66 fb f5 db dd f9 1e 30 11 d4 ca 75 0e 2b |`of......0...u.+| +00000080 ff d0 e5 f2 68 a4 e7 14 03 03 00 01 01 16 03 03 |....h...........| +00000090 00 28 00 00 00 00 00 00 00 00 67 3b 4a ba f3 27 |.(........g;J..'| +000000a0 c8 45 94 68 36 5a 40 e1 dc 67 9b d4 45 58 e9 24 |.E.h6Z@..g..EX.$| +000000b0 31 85 3a f8 5d cb 84 8e 64 05 17 03 03 00 25 00 |1.:.]...d.....%.| +000000c0 00 00 00 00 00 00 01 35 d9 ba 0a e2 3e fd a2 80 |.......5....>...| +000000d0 10 0e 38 7b ad 85 85 48 6a 2a ab 2a 46 c3 59 96 |..8{...Hj*.*F.Y.| +000000e0 fd 75 11 5d 15 03 03 00 1a 00 00 00 00 00 00 00 |.u.]............| +000000f0 02 0b 4d a5 89 4d 86 47 14 60 27 f8 09 bc c9 4d |..M..M.G.`'....M| +00000100 00 31 cb |.1.| diff --git a/src/crypto/tls/testdata/Server-TLSv12-ALPN-NoMatch b/src/crypto/tls/testdata/Server-TLSv12-ALPN-NoMatch new file mode 100644 index 0000000000000000000000000000000000000000..af75445dc5559e9d32b5dc74acb9b5c2583a55be --- /dev/null +++ b/src/crypto/tls/testdata/Server-TLSv12-ALPN-NoMatch @@ -0,0 +1,108 @@ +>>> Flow 1 (client to server) +00000000 16 03 01 01 4c 01 00 01 48 03 03 1d 1a f7 e5 ad |....L...H.......| +00000010 a4 5c fd 61 b4 c2 25 33 c7 b9 fc fb 2b a5 4b fe |.\.a..%3....+.K.| +00000020 16 84 55 4b 9f 68 73 61 b8 92 4d 00 00 b6 c0 30 |..UK.hsa..M....0| +00000030 c0 2c c0 28 c0 24 c0 14 c0 0a 00 a5 00 a3 00 a1 |.,.(.$..........| +00000040 00 9f 00 6b 00 6a 00 69 00 68 00 39 00 38 00 37 |...k.j.i.h.9.8.7| +00000050 00 36 00 88 00 87 00 86 00 85 c0 32 c0 2e c0 2a |.6.........2...*| +00000060 c0 26 c0 0f c0 05 00 9d 00 3d 00 35 00 84 c0 2f |.&.......=.5.../| +00000070 c0 2b c0 27 c0 23 c0 13 c0 09 00 a4 00 a2 00 a0 |.+.'.#..........| +00000080 00 9e 00 67 00 40 00 3f 00 3e 00 33 00 32 00 31 |...g.@.?.>.3.2.1| +00000090 00 30 00 9a 00 99 00 98 00 97 00 45 00 44 00 43 |.0.........E.D.C| +000000a0 00 42 c0 31 c0 2d c0 29 c0 25 c0 0e c0 04 00 9c |.B.1.-.).%......| +000000b0 00 3c 00 2f 00 96 00 41 00 07 c0 11 c0 07 c0 0c |.<./...A........| +000000c0 c0 02 00 05 00 04 c0 12 c0 08 00 16 00 13 00 10 |................| +000000d0 00 0d c0 0d c0 03 00 0a 00 15 00 12 00 0f 00 0c |................| +000000e0 00 09 00 ff 01 00 00 69 00 0b 00 04 03 00 01 02 |.......i........| +000000f0 00 0a 00 1c 00 1a 00 17 00 19 00 1c 00 1b 00 18 |................| +00000100 00 1a 00 16 00 0e 00 0d 00 0b 00 0c 00 09 00 0a |................| +00000110 00 23 00 00 00 0d 00 20 00 1e 06 01 06 02 06 03 |.#..... ........| +00000120 05 01 05 02 05 03 04 01 04 02 04 03 03 01 03 02 |................| +00000130 03 03 02 01 02 02 02 03 00 0f 00 01 01 00 10 00 |................| +00000140 10 00 0e 06 70 72 6f 74 6f 32 06 70 72 6f 74 6f |....proto2.proto| +00000150 31 |1| +>>> Flow 2 (server to client) +00000000 16 03 03 00 35 02 00 00 31 03 03 00 00 00 00 00 |....5...1.......| +00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| +00000020 00 00 00 00 00 00 00 00 00 00 00 00 c0 30 00 00 |.............0..| +00000030 09 00 23 00 00 ff 01 00 01 00 16 03 03 02 71 0b |..#...........q.| +00000040 00 02 6d 00 02 6a 00 02 67 30 82 02 63 30 82 01 |..m..j..g0..c0..| +00000050 cc a0 03 02 01 02 02 09 00 a2 73 00 0c 81 00 cb |..........s.....| +00000060 f3 30 0d 06 09 2a 86 48 86 f7 0d 01 01 0b 05 00 |.0...*.H........| +00000070 30 2b 31 17 30 15 06 03 55 04 0a 13 0e 47 6f 6f |0+1.0...U....Goo| +00000080 67 6c 65 20 54 45 53 54 49 4e 47 31 10 30 0e 06 |gle TESTING1.0..| +00000090 03 55 04 03 13 07 47 6f 20 52 6f 6f 74 30 1e 17 |.U....Go Root0..| +000000a0 0d 31 35 30 31 30 31 30 30 30 30 30 30 5a 17 0d |.150101000000Z..| +000000b0 32 35 30 31 30 31 30 30 30 30 30 30 5a 30 26 31 |250101000000Z0&1| +000000c0 17 30 15 06 03 55 04 0a 13 0e 47 6f 6f 67 6c 65 |.0...U....Google| +000000d0 20 54 45 53 54 49 4e 47 31 0b 30 09 06 03 55 04 | TESTING1.0...U.| +000000e0 03 13 02 47 6f 30 81 9f 30 0d 06 09 2a 86 48 86 |...Go0..0...*.H.| +000000f0 f7 0d 01 01 01 05 00 03 81 8d 00 30 81 89 02 81 |...........0....| +00000100 81 00 af 87 88 f6 20 1b 95 65 6c 14 ab 44 05 af |...... ..el..D..| +00000110 3b 45 14 e3 b7 6d fd 00 63 4d 95 7f fe 6a 62 35 |;E...m..cM...jb5| +00000120 86 c0 4a f9 18 7c f6 aa 25 5e 7a 64 31 66 00 ba |..J..|..%^zd1f..| +00000130 f4 8e 92 af c7 6b d8 76 d4 f3 5f 41 cb 6e 56 15 |.....k.v.._A.nV.| +00000140 97 1b 97 c1 3c 12 39 21 66 3d 2b 16 d1 bc db 1c |....<.9!f=+.....| +00000150 c0 a7 da b7 ca ad ba da cb d5 21 50 ec de 8d ab |..........!P....| +00000160 d1 6b 81 4b 89 02 f3 c4 be c1 6c 89 b1 44 84 bd |.k.K......l..D..| +00000170 21 d1 04 7d 9d 16 4d f9 82 15 f6 ef fa d6 09 47 |!..}..M........G| +00000180 f2 fb 02 03 01 00 01 a3 81 93 30 81 90 30 0e 06 |..........0..0..| +00000190 03 55 1d 0f 01 01 ff 04 04 03 02 05 a0 30 1d 06 |.U...........0..| +000001a0 03 55 1d 25 04 16 30 14 06 08 2b 06 01 05 05 07 |.U.%..0...+.....| +000001b0 03 01 06 08 2b 06 01 05 05 07 03 02 30 0c 06 03 |....+.......0...| +000001c0 55 1d 13 01 01 ff 04 02 30 00 30 19 06 03 55 1d |U.......0.0...U.| +000001d0 0e 04 12 04 10 12 50 8d 89 6f 1b d1 dc 54 4d 6e |......P..o...TMn| +000001e0 cb 69 5e 06 f4 30 1b 06 03 55 1d 23 04 14 30 12 |.i^..0...U.#..0.| +000001f0 80 10 bf 3d b6 a9 66 f2 b8 40 cf ea b4 03 78 48 |...=..f..@....xH| +00000200 1a 41 30 19 06 03 55 1d 11 04 12 30 10 82 0e 65 |.A0...U....0...e| +00000210 78 61 6d 70 6c 65 2e 67 6f 6c 61 6e 67 30 0d 06 |xample.golang0..| +00000220 09 2a 86 48 86 f7 0d 01 01 0b 05 00 03 81 81 00 |.*.H............| +00000230 92 7c af 91 55 12 18 96 59 31 a6 48 40 d5 2d d5 |.|..U...Y1.H@.-.| +00000240 ee bb 02 a0 f5 c2 1e 7c 9b b3 30 7d 3c dc 76 da |.......|..0}<.v.| +00000250 4f 3d c0 fa ae 2d 33 24 6b 03 7b 1b 67 59 11 21 |O=...-3$k.{.gY.!| +00000260 b5 11 bc 77 b9 d9 e0 6e a8 2d 2e 35 fa 64 5f 22 |...w...n.-.5.d_"| +00000270 3e 63 10 6b be ff 14 86 6d 0d f0 15 31 a8 14 38 |>c.k....m...1..8| +00000280 1e 3b 84 87 2c cb 98 ed 51 76 b9 b1 4f dd db 9b |.;..,...Qv..O...| +00000290 84 04 86 40 fa 51 dd ba b4 8d eb e3 46 de 46 b9 |...@.Q......F.F.| +000002a0 4f 86 c7 f9 a4 c2 41 34 ac cc f6 ea b0 ab 39 18 |O.....A4......9.| +000002b0 16 03 03 00 cd 0c 00 00 c9 03 00 17 41 04 1e 18 |............A...| +000002c0 37 ef 0d 19 51 88 35 75 71 b5 e5 54 5b 12 2e 8f |7...Q.5uq..T[...| +000002d0 09 67 fd a7 24 20 3e b2 56 1c ce 97 28 5e f8 2b |.g..$ >.V...(^.+| +000002e0 2d 4f 9e f1 07 9f 6c 4b 5b 83 56 e2 32 42 e9 58 |-O....lK[.V.2B.X| +000002f0 b6 d7 49 a6 b5 68 1a 41 03 56 6b dc 5a 89 05 01 |..I..h.A.Vk.Z...| +00000300 00 80 36 d2 96 c8 27 66 d8 bd 6c 28 29 30 b3 be |..6...'f..l()0..| +00000310 0a bb b2 fe 9d c3 59 47 34 cf de fe f4 ab 5d 79 |......YG4.....]y| +00000320 24 a9 9d c9 b5 e9 50 6a 3b 96 e3 29 cb d7 37 06 |$.....Pj;..)..7.| +00000330 19 08 88 15 29 c2 55 03 62 75 1d 35 c2 8e 25 a2 |....).U.bu.5..%.| +00000340 86 20 bf 18 46 15 81 f2 74 4b bb dd 3d e3 a5 f6 |. ..F...tK..=...| +00000350 28 18 41 89 c8 39 13 f9 c0 88 fd cc f0 6e 9e 3d |(.A..9.......n.=| +00000360 cb 29 ad 26 5b d1 e6 11 5c 64 7d b6 df d7 39 87 |.).&[...\d}...9.| +00000370 24 df 9f 62 17 ef f2 b3 3a b3 88 a4 f0 91 ea f2 |$..b....:.......| +00000380 5d c9 16 03 03 00 04 0e 00 00 00 |]..........| +>>> Flow 3 (client to server) +00000000 16 03 03 00 46 10 00 00 42 41 04 b0 22 15 73 fc |....F...BA..".s.| +00000010 1c fd 24 4a 36 69 8a be ac bd 72 30 bb 6b e1 9b |..$J6i....r0.k..| +00000020 42 e8 56 7a 86 b1 8d cb 9c 3e 2d 63 13 57 a8 13 |B.Vz.....>-c.W..| +00000030 71 3b a2 01 86 af f8 76 40 0b 44 4f 0a 0f 5a da |q;.....v@.DO..Z.| +00000040 31 36 3b 13 c0 10 6c 96 64 a7 24 14 03 03 00 01 |16;...l.d.$.....| +00000050 01 16 03 03 00 28 10 2d 45 93 5c 37 34 d9 2a a0 |.....(.-E.\74.*.| +00000060 b6 37 13 bc a6 1f 0c ce 2e 55 c1 ad 36 b8 60 72 |.7.......U..6.`r| +00000070 81 cb 1a 7a 5b 26 49 ad 77 ef 62 e8 fc 00 |...z[&I.w.b...| +>>> Flow 4 (server to client) +00000000 16 03 03 00 82 04 00 00 7e 00 00 00 00 00 78 50 |........~.....xP| +00000010 46 ad c1 db a8 38 86 7b 2b bb fd d0 c3 42 3e 00 |F....8.{+....B>.| +00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 94 |................| +00000030 6f ec 80 83 61 05 33 d2 9d 95 89 7b 28 54 50 50 |o...a.3....{(TPP| +00000040 b3 3c 99 5c 82 ab cf 88 24 e8 48 81 db 4a 22 79 |.<.\....$.H..J"y| +00000050 0b fa 33 50 ed 82 a1 7c 33 0e f2 ff 6d a7 d6 88 |..3P...|3...m...| +00000060 29 65 74 e3 27 33 94 97 66 0c 86 ce fc ca 0e 2a |)et.'3..f......*| +00000070 96 fa fe 19 a3 01 64 d9 4d 8e 58 95 5b 74 a6 aa |......d.M.X.[t..| +00000080 f4 9f c1 34 97 2d e5 14 03 03 00 01 01 16 03 03 |...4.-..........| +00000090 00 28 00 00 00 00 00 00 00 00 4d 56 6d d5 6f cc |.(........MVm.o.| +000000a0 3d d4 85 32 3c 07 ea 3c 52 61 88 8e dd d5 d3 d0 |=..2<..D.{n6| +00000100 ae 66 87 |.f.| diff --git a/src/crypto/tls/testdata/Server-TLSv12-CipherSuiteCertPreferenceECDSA b/src/crypto/tls/testdata/Server-TLSv12-CipherSuiteCertPreferenceECDSA new file mode 100644 index 0000000000000000000000000000000000000000..344d9737b253cc83cbc7800b76799f843f9f26f6 --- /dev/null +++ b/src/crypto/tls/testdata/Server-TLSv12-CipherSuiteCertPreferenceECDSA @@ -0,0 +1,98 @@ +>>> Flow 1 (client to server) +00000000 16 03 01 01 34 01 00 01 30 03 03 78 08 b2 d4 18 |....4...0..x....| +00000010 8e b1 6b a2 d2 e0 c6 41 02 c5 93 f1 b9 60 94 e8 |..k....A.....`..| +00000020 f2 64 6c 97 50 2d 24 a3 cd c0 36 00 00 b6 c0 30 |.dl.P-$...6....0| +00000030 c0 2c c0 28 c0 24 c0 14 c0 0a 00 a5 00 a3 00 a1 |.,.(.$..........| +00000040 00 9f 00 6b 00 6a 00 69 00 68 00 39 00 38 00 37 |...k.j.i.h.9.8.7| +00000050 00 36 00 88 00 87 00 86 00 85 c0 32 c0 2e c0 2a |.6.........2...*| +00000060 c0 26 c0 0f c0 05 00 9d 00 3d 00 35 00 84 c0 2f |.&.......=.5.../| +00000070 c0 2b c0 27 c0 23 c0 13 c0 09 00 a4 00 a2 00 a0 |.+.'.#..........| +00000080 00 9e 00 67 00 40 00 3f 00 3e 00 33 00 32 00 31 |...g.@.?.>.3.2.1| +00000090 00 30 00 9a 00 99 00 98 00 97 00 45 00 44 00 43 |.0.........E.D.C| +000000a0 00 42 c0 31 c0 2d c0 29 c0 25 c0 0e c0 04 00 9c |.B.1.-.).%......| +000000b0 00 3c 00 2f 00 96 00 41 00 07 c0 11 c0 07 c0 0c |.<./...A........| +000000c0 c0 02 00 05 00 04 c0 12 c0 08 00 16 00 13 00 10 |................| +000000d0 00 0d c0 0d c0 03 00 0a 00 15 00 12 00 0f 00 0c |................| +000000e0 00 09 00 ff 01 00 00 51 00 0b 00 04 03 00 01 02 |.......Q........| +000000f0 00 0a 00 1c 00 1a 00 17 00 19 00 1c 00 1b 00 18 |................| +00000100 00 1a 00 16 00 0e 00 0d 00 0b 00 0c 00 09 00 0a |................| +00000110 00 0d 00 20 00 1e 06 01 06 02 06 03 05 01 05 02 |... ............| +00000120 05 03 04 01 04 02 04 03 03 01 03 02 03 03 02 01 |................| +00000130 02 02 02 03 00 0f 00 01 01 |.........| +>>> Flow 2 (server to client) +00000000 16 03 03 00 31 02 00 00 2d 03 03 00 00 00 00 00 |....1...-.......| +00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| +00000020 00 00 00 00 00 00 00 00 00 00 00 00 c0 0a 00 00 |................| +00000030 05 ff 01 00 01 00 16 03 03 02 0e 0b 00 02 0a 00 |................| +00000040 02 07 00 02 04 30 82 02 00 30 82 01 62 02 09 00 |.....0...0..b...| +00000050 b8 bf 2d 47 a0 d2 eb f4 30 09 06 07 2a 86 48 ce |..-G....0...*.H.| +00000060 3d 04 01 30 45 31 0b 30 09 06 03 55 04 06 13 02 |=..0E1.0...U....| +00000070 41 55 31 13 30 11 06 03 55 04 08 13 0a 53 6f 6d |AU1.0...U....Som| +00000080 65 2d 53 74 61 74 65 31 21 30 1f 06 03 55 04 0a |e-State1!0...U..| +00000090 13 18 49 6e 74 65 72 6e 65 74 20 57 69 64 67 69 |..Internet Widgi| +000000a0 74 73 20 50 74 79 20 4c 74 64 30 1e 17 0d 31 32 |ts Pty Ltd0...12| +000000b0 31 31 32 32 31 35 30 36 33 32 5a 17 0d 32 32 31 |1122150632Z..221| +000000c0 31 32 30 31 35 30 36 33 32 5a 30 45 31 0b 30 09 |120150632Z0E1.0.| +000000d0 06 03 55 04 06 13 02 41 55 31 13 30 11 06 03 55 |..U....AU1.0...U| +000000e0 04 08 13 0a 53 6f 6d 65 2d 53 74 61 74 65 31 21 |....Some-State1!| +000000f0 30 1f 06 03 55 04 0a 13 18 49 6e 74 65 72 6e 65 |0...U....Interne| +00000100 74 20 57 69 64 67 69 74 73 20 50 74 79 20 4c 74 |t Widgits Pty Lt| +00000110 64 30 81 9b 30 10 06 07 2a 86 48 ce 3d 02 01 06 |d0..0...*.H.=...| +00000120 05 2b 81 04 00 23 03 81 86 00 04 00 c4 a1 ed be |.+...#..........| +00000130 98 f9 0b 48 73 36 7e c3 16 56 11 22 f2 3d 53 c3 |...Hs6~..V.".=S.| +00000140 3b 4d 21 3d cd 6b 75 e6 f6 b0 dc 9a df 26 c1 bc |;M!=.ku......&..| +00000150 b2 87 f0 72 32 7c b3 64 2f 1c 90 bc ea 68 23 10 |...r2|.d/....h#.| +00000160 7e fe e3 25 c0 48 3a 69 e0 28 6d d3 37 00 ef 04 |~..%.H:i.(m.7...| +00000170 62 dd 0d a0 9c 70 62 83 d8 81 d3 64 31 aa 9e 97 |b....pb....d1...| +00000180 31 bd 96 b0 68 c0 9b 23 de 76 64 3f 1a 5c 7f e9 |1...h..#.vd?.\..| +00000190 12 0e 58 58 b6 5f 70 dd 9b d8 ea d5 d7 f5 d5 cc |..XX._p.........| +000001a0 b9 b6 9f 30 66 5b 66 9a 20 e2 27 e5 bf fe 3b 30 |...0f[f. .'...;0| +000001b0 09 06 07 2a 86 48 ce 3d 04 01 03 81 8c 00 30 81 |...*.H.=......0.| +000001c0 88 02 42 01 88 a2 4f eb e2 45 c5 48 7d 1b ac f5 |..B...O..E.H}...| +000001d0 ed 98 9d ae 47 70 c0 5e 1b b6 2f bd f1 b6 4d b7 |....Gp.^../...M.| +000001e0 61 40 d3 11 a2 ce ee 0b 7e 92 7e ff 76 9d c3 3b |a@......~.~.v..;| +000001f0 7e a5 3f ce fa 10 e2 59 ec 47 2d 7c ac da 4e 97 |~.?....Y.G-|..N.| +00000200 0e 15 a0 6f d0 02 42 01 4d fc be 67 13 9c 2d 05 |...o..B.M..g..-.| +00000210 0e bd 3f a3 8c 25 c1 33 13 83 0d 94 06 bb d4 37 |..?..%.3.......7| +00000220 7a f6 ec 7a c9 86 2e dd d7 11 69 7f 85 7c 56 de |z..z......i..|V.| +00000230 fb 31 78 2b e4 c7 78 0d ae cb be 9e 4e 36 24 31 |.1x+..x.....N6$1| +00000240 7b 6a 0f 39 95 12 07 8f 2a 16 03 03 00 d8 0c 00 |{j.9....*.......| +00000250 00 d4 03 00 17 41 04 1e 18 37 ef 0d 19 51 88 35 |.....A...7...Q.5| +00000260 75 71 b5 e5 54 5b 12 2e 8f 09 67 fd a7 24 20 3e |uq..T[....g..$ >| +00000270 b2 56 1c ce 97 28 5e f8 2b 2d 4f 9e f1 07 9f 6c |.V...(^.+-O....l| +00000280 4b 5b 83 56 e2 32 42 e9 58 b6 d7 49 a6 b5 68 1a |K[.V.2B.X..I..h.| +00000290 41 03 56 6b dc 5a 89 05 03 00 8b 30 81 88 02 42 |A.Vk.Z.....0...B| +000002a0 00 91 b4 4a f2 9d 13 a1 6d 3b ee 46 2f 3b 97 50 |...J....m;.F/;.P| +000002b0 b9 3e 28 7a 51 7a 8b 3b a6 16 03 d6 1f 92 0a ec |.>(zQz.;........| +000002c0 5b 9b b5 48 98 ce d8 22 bd 7d eb cb 14 7b 14 73 |[..H...".}...{.s| +000002d0 2d 5f 01 8c dc 5a 63 34 92 4e 59 4a 90 f9 b1 c9 |-_...Zc4.NYJ....| +000002e0 d8 18 02 42 01 89 e4 e4 39 d0 52 d1 70 19 fe d7 |...B....9.R.p...| +000002f0 c6 70 10 36 94 1e 45 fd b4 03 37 79 c7 db cf 6d |.p.6..E...7y...m| +00000300 33 5d 80 fe 04 de d1 78 bf c4 dd cf 91 82 57 14 |3].....x......W.| +00000310 14 09 e3 2d dd d2 78 9c 53 cc 1f f7 40 6c 4a 59 |...-..x.S...@lJY| +00000320 49 a8 a1 06 24 18 16 03 03 00 04 0e 00 00 00 |I...$..........| +>>> Flow 3 (client to server) +00000000 16 03 03 00 46 10 00 00 42 41 04 66 37 3a ce 68 |....F...BA.f7:.h| +00000010 23 0f b2 d0 cb 20 24 26 37 d5 84 46 4a 2e 59 80 |#.... $&7..FJ.Y.| +00000020 87 b3 10 7e 36 fd af 7c 99 07 99 dd 18 af 6d 7c |...~6..|......m|| +00000030 b5 b2 b7 93 45 95 d9 98 1a 13 5b a2 12 e8 b7 95 |....E.....[.....| +00000040 ed a1 3a 6d aa 8f fc b6 b5 b4 41 14 03 03 00 01 |..:m......A.....| +00000050 01 16 03 03 00 40 b0 12 69 00 a4 3a 6d bd 56 40 |.....@..i..:m.V@| +00000060 6e 9d 5e a8 1b 0f 59 c5 09 48 b2 07 d8 bc 7b 02 |n.^...Y..H....{.| +00000070 70 61 f6 1b a9 27 55 8c 16 4d 69 4c ca 31 30 9f |pa...'U..MiL.10.| +00000080 d3 62 ba d4 1b 11 ee 0a a0 f3 61 be c6 64 c3 dc |.b........a..d..| +00000090 97 50 47 27 ed 09 |.PG'..| +>>> Flow 4 (server to client) +00000000 14 03 03 00 01 01 16 03 03 00 40 00 00 00 00 00 |..........@.....| +00000010 00 00 00 00 00 00 00 00 00 00 00 09 34 9a eb 7c |............4..|| +00000020 6a 6d 6a 02 7b 50 14 b8 f7 b0 93 30 ea 0b 61 4a |jmj.{P.....0..aJ| +00000030 0b 75 10 39 41 78 46 9d ba 8e d3 e9 e4 ab dc 1f |.u.9AxF.........| +00000040 c9 43 95 e8 f9 d6 3a d3 5d 7d 09 17 03 03 00 40 |.C....:.]}.....@| +00000050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| +00000060 b4 64 88 d5 53 f9 1e 47 d4 d8 c4 fa 0e c2 76 a6 |.d..S..G......v.| +00000070 ed 5c 17 ba ea 76 72 cb c5 73 a3 c5 44 21 3c 40 |.\...vr..s..D!<@| +00000080 33 27 09 37 73 3b 0e a3 7b 95 72 10 8d 74 85 19 |3'.7s;..{.r..t..| +00000090 15 03 03 00 30 00 00 00 00 00 00 00 00 00 00 00 |....0...........| +000000a0 00 00 00 00 00 b3 c0 05 e9 ec 05 06 52 ef 09 b7 |............R...| +000000b0 52 29 04 88 ed 11 bb bd 36 a3 0f ce 2c 55 a2 87 |R)......6...,U..| +000000c0 7e 2b 0c aa 83 |~+...| diff --git a/src/crypto/tls/testdata/Server-TLSv12-CipherSuiteCertPreferenceRSA b/src/crypto/tls/testdata/Server-TLSv12-CipherSuiteCertPreferenceRSA new file mode 100644 index 0000000000000000000000000000000000000000..10624c02591a528cb9b81757a098ad1b9c0bc6bf --- /dev/null +++ b/src/crypto/tls/testdata/Server-TLSv12-CipherSuiteCertPreferenceRSA @@ -0,0 +1,104 @@ +>>> Flow 1 (client to server) +00000000 16 03 01 01 34 01 00 01 30 03 03 10 5e c8 3f c6 |....4...0...^.?.| +00000010 fe 44 c4 f0 13 c5 bd ad 06 21 65 e5 a8 40 b5 1d |.D.......!e..@..| +00000020 21 07 99 34 5b ef 70 85 29 92 7d 00 00 b6 c0 30 |!..4[.p.).}....0| +00000030 c0 2c c0 28 c0 24 c0 14 c0 0a 00 a5 00 a3 00 a1 |.,.(.$..........| +00000040 00 9f 00 6b 00 6a 00 69 00 68 00 39 00 38 00 37 |...k.j.i.h.9.8.7| +00000050 00 36 00 88 00 87 00 86 00 85 c0 32 c0 2e c0 2a |.6.........2...*| +00000060 c0 26 c0 0f c0 05 00 9d 00 3d 00 35 00 84 c0 2f |.&.......=.5.../| +00000070 c0 2b c0 27 c0 23 c0 13 c0 09 00 a4 00 a2 00 a0 |.+.'.#..........| +00000080 00 9e 00 67 00 40 00 3f 00 3e 00 33 00 32 00 31 |...g.@.?.>.3.2.1| +00000090 00 30 00 9a 00 99 00 98 00 97 00 45 00 44 00 43 |.0.........E.D.C| +000000a0 00 42 c0 31 c0 2d c0 29 c0 25 c0 0e c0 04 00 9c |.B.1.-.).%......| +000000b0 00 3c 00 2f 00 96 00 41 00 07 c0 11 c0 07 c0 0c |.<./...A........| +000000c0 c0 02 00 05 00 04 c0 12 c0 08 00 16 00 13 00 10 |................| +000000d0 00 0d c0 0d c0 03 00 0a 00 15 00 12 00 0f 00 0c |................| +000000e0 00 09 00 ff 01 00 00 51 00 0b 00 04 03 00 01 02 |.......Q........| +000000f0 00 0a 00 1c 00 1a 00 17 00 19 00 1c 00 1b 00 18 |................| +00000100 00 1a 00 16 00 0e 00 0d 00 0b 00 0c 00 09 00 0a |................| +00000110 00 0d 00 20 00 1e 06 01 06 02 06 03 05 01 05 02 |... ............| +00000120 05 03 04 01 04 02 04 03 03 01 03 02 03 03 02 01 |................| +00000130 02 02 02 03 00 0f 00 01 01 |.........| +>>> Flow 2 (server to client) +00000000 16 03 03 00 31 02 00 00 2d 03 03 00 00 00 00 00 |....1...-.......| +00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| +00000020 00 00 00 00 00 00 00 00 00 00 00 00 c0 14 00 00 |................| +00000030 05 ff 01 00 01 00 16 03 03 02 71 0b 00 02 6d 00 |..........q...m.| +00000040 02 6a 00 02 67 30 82 02 63 30 82 01 cc a0 03 02 |.j..g0..c0......| +00000050 01 02 02 09 00 a2 73 00 0c 81 00 cb f3 30 0d 06 |......s......0..| +00000060 09 2a 86 48 86 f7 0d 01 01 0b 05 00 30 2b 31 17 |.*.H........0+1.| +00000070 30 15 06 03 55 04 0a 13 0e 47 6f 6f 67 6c 65 20 |0...U....Google | +00000080 54 45 53 54 49 4e 47 31 10 30 0e 06 03 55 04 03 |TESTING1.0...U..| +00000090 13 07 47 6f 20 52 6f 6f 74 30 1e 17 0d 31 35 30 |..Go Root0...150| +000000a0 31 30 31 30 30 30 30 30 30 5a 17 0d 32 35 30 31 |101000000Z..2501| +000000b0 30 31 30 30 30 30 30 30 5a 30 26 31 17 30 15 06 |01000000Z0&1.0..| +000000c0 03 55 04 0a 13 0e 47 6f 6f 67 6c 65 20 54 45 53 |.U....Google TES| +000000d0 54 49 4e 47 31 0b 30 09 06 03 55 04 03 13 02 47 |TING1.0...U....G| +000000e0 6f 30 81 9f 30 0d 06 09 2a 86 48 86 f7 0d 01 01 |o0..0...*.H.....| +000000f0 01 05 00 03 81 8d 00 30 81 89 02 81 81 00 af 87 |.......0........| +00000100 88 f6 20 1b 95 65 6c 14 ab 44 05 af 3b 45 14 e3 |.. ..el..D..;E..| +00000110 b7 6d fd 00 63 4d 95 7f fe 6a 62 35 86 c0 4a f9 |.m..cM...jb5..J.| +00000120 18 7c f6 aa 25 5e 7a 64 31 66 00 ba f4 8e 92 af |.|..%^zd1f......| +00000130 c7 6b d8 76 d4 f3 5f 41 cb 6e 56 15 97 1b 97 c1 |.k.v.._A.nV.....| +00000140 3c 12 39 21 66 3d 2b 16 d1 bc db 1c c0 a7 da b7 |<.9!f=+.........| +00000150 ca ad ba da cb d5 21 50 ec de 8d ab d1 6b 81 4b |......!P.....k.K| +00000160 89 02 f3 c4 be c1 6c 89 b1 44 84 bd 21 d1 04 7d |......l..D..!..}| +00000170 9d 16 4d f9 82 15 f6 ef fa d6 09 47 f2 fb 02 03 |..M........G....| +00000180 01 00 01 a3 81 93 30 81 90 30 0e 06 03 55 1d 0f |......0..0...U..| +00000190 01 01 ff 04 04 03 02 05 a0 30 1d 06 03 55 1d 25 |.........0...U.%| +000001a0 04 16 30 14 06 08 2b 06 01 05 05 07 03 01 06 08 |..0...+.........| +000001b0 2b 06 01 05 05 07 03 02 30 0c 06 03 55 1d 13 01 |+.......0...U...| +000001c0 01 ff 04 02 30 00 30 19 06 03 55 1d 0e 04 12 04 |....0.0...U.....| +000001d0 10 12 50 8d 89 6f 1b d1 dc 54 4d 6e cb 69 5e 06 |..P..o...TMn.i^.| +000001e0 f4 30 1b 06 03 55 1d 23 04 14 30 12 80 10 bf 3d |.0...U.#..0....=| +000001f0 b6 a9 66 f2 b8 40 cf ea b4 03 78 48 1a 41 30 19 |..f..@....xH.A0.| +00000200 06 03 55 1d 11 04 12 30 10 82 0e 65 78 61 6d 70 |..U....0...examp| +00000210 6c 65 2e 67 6f 6c 61 6e 67 30 0d 06 09 2a 86 48 |le.golang0...*.H| +00000220 86 f7 0d 01 01 0b 05 00 03 81 81 00 92 7c af 91 |.............|..| +00000230 55 12 18 96 59 31 a6 48 40 d5 2d d5 ee bb 02 a0 |U...Y1.H@.-.....| +00000240 f5 c2 1e 7c 9b b3 30 7d 3c dc 76 da 4f 3d c0 fa |...|..0}<.v.O=..| +00000250 ae 2d 33 24 6b 03 7b 1b 67 59 11 21 b5 11 bc 77 |.-3$k.{.gY.!...w| +00000260 b9 d9 e0 6e a8 2d 2e 35 fa 64 5f 22 3e 63 10 6b |...n.-.5.d_">c.k| +00000270 be ff 14 86 6d 0d f0 15 31 a8 14 38 1e 3b 84 87 |....m...1..8.;..| +00000280 2c cb 98 ed 51 76 b9 b1 4f dd db 9b 84 04 86 40 |,...Qv..O......@| +00000290 fa 51 dd ba b4 8d eb e3 46 de 46 b9 4f 86 c7 f9 |.Q......F.F.O...| +000002a0 a4 c2 41 34 ac cc f6 ea b0 ab 39 18 16 03 03 00 |..A4......9.....| +000002b0 cd 0c 00 00 c9 03 00 17 41 04 1e 18 37 ef 0d 19 |........A...7...| +000002c0 51 88 35 75 71 b5 e5 54 5b 12 2e 8f 09 67 fd a7 |Q.5uq..T[....g..| +000002d0 24 20 3e b2 56 1c ce 97 28 5e f8 2b 2d 4f 9e f1 |$ >.V...(^.+-O..| +000002e0 07 9f 6c 4b 5b 83 56 e2 32 42 e9 58 b6 d7 49 a6 |..lK[.V.2B.X..I.| +000002f0 b5 68 1a 41 03 56 6b dc 5a 89 05 01 00 80 6a 4b |.h.A.Vk.Z.....jK| +00000300 b1 7d 23 cd 0e cb 26 02 d4 ee 90 f2 e0 4a 47 3d |.}#...&......JG=| +00000310 b3 36 90 8d 01 42 98 92 ad 75 87 71 02 70 02 a8 |.6...B...u.q.p..| +00000320 0c b0 06 ee bd 6a 1f 3f 6c 4b 4b 6b 75 41 23 b4 |.....j.?lKKkuA#.| +00000330 f9 c2 a6 60 e2 de 55 b6 d4 85 62 e9 8f 20 70 ed |...`..U...b.. p.| +00000340 9a b8 bb dd 1f 19 87 e9 ad b3 30 3f 7c 63 51 f1 |..........0?|cQ.| +00000350 59 ab d1 a0 a1 80 22 56 ca 68 52 f8 0f 80 c6 a6 |Y....."V.hR.....| +00000360 9e 12 51 ed 29 d0 6d c2 1a e5 37 dc 76 e3 f3 53 |..Q.).m...7.v..S| +00000370 1b 07 0b ea a6 11 af dc 54 d3 ee 25 cc 27 16 03 |........T..%.'..| +00000380 03 00 04 0e 00 00 00 |.......| +>>> Flow 3 (client to server) +00000000 16 03 03 00 46 10 00 00 42 41 04 2d 4b 0c 6b 65 |....F...BA.-K.ke| +00000010 82 32 95 8b 77 ec f0 f2 b2 ba d1 38 74 ed 82 49 |.2..w......8t..I| +00000020 fb ce 8f 66 97 9d b6 97 d8 ae f5 19 af ad 47 b9 |...f..........G.| +00000030 db 7b d2 c9 4e 10 68 14 ed 23 a5 98 94 f9 2a 00 |.{..N.h..#....*.| +00000040 b6 44 b3 44 01 29 6c 56 da bb a8 14 03 03 00 01 |.D.D.)lV........| +00000050 01 16 03 03 00 40 f4 fd de d6 20 2e 18 80 4e 73 |.....@.... ...Ns| +00000060 af dd 97 42 08 3b 51 80 e9 26 00 48 6b 8b 21 99 |...B.;Q..&.Hk.!.| +00000070 a8 60 1f 64 51 d0 5a 90 8b b0 69 b8 6b 29 59 21 |.`.dQ.Z...i.k)Y!| +00000080 b1 13 19 13 07 01 e1 2c c3 6b 17 2d 01 a5 be d6 |.......,.k.-....| +00000090 b0 0d 3d 6a 8c fe |..=j..| +>>> Flow 4 (server to client) +00000000 14 03 03 00 01 01 16 03 03 00 40 00 00 00 00 00 |..........@.....| +00000010 00 00 00 00 00 00 00 00 00 00 00 84 e2 7f e3 b4 |................| +00000020 53 d7 d0 30 c4 e5 ea 09 df ba 33 b0 02 34 eb 2e |S..0......3..4..| +00000030 b2 ec 47 0d e7 20 76 12 fa 53 3b 44 86 e1 e1 63 |..G.. v..S;D...c| +00000040 06 29 57 98 ce 87 18 ad 02 17 01 17 03 03 00 40 |.)W............@| +00000050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| +00000060 b0 3a f5 90 90 30 9c b3 39 5b b4 56 f6 b9 30 7e |.:...0..9[.V..0~| +00000070 8e a8 2d 60 47 b6 57 8a 20 61 02 f2 8e 43 c2 01 |..-`G.W. a...C..| +00000080 ee f0 be 5a 93 52 2f ea 03 2a 4f 01 ea 9e 1c a2 |...Z.R/..*O.....| +00000090 15 03 03 00 30 00 00 00 00 00 00 00 00 00 00 00 |....0...........| +000000a0 00 00 00 00 00 c0 7e 61 51 a1 76 15 8a 7e 20 5f |......~aQ.v..~ _| +000000b0 d4 a4 c6 3e 6c 50 18 c6 63 88 d0 ac 4c fa 31 b3 |...>lP..c...L.1.| +000000c0 e7 c9 77 11 7a |..w.z| diff --git a/src/crypto/tls/testdata/Server-TLSv12-ClientAuthRequestedAndECDSAGiven b/src/crypto/tls/testdata/Server-TLSv12-ClientAuthRequestedAndECDSAGiven new file mode 100644 index 0000000000000000000000000000000000000000..56c3c822e352124fafd8a0f47e53f75d6e01ab3d --- /dev/null +++ b/src/crypto/tls/testdata/Server-TLSv12-ClientAuthRequestedAndECDSAGiven @@ -0,0 +1,117 @@ +>>> Flow 1 (client to server) +00000000 16 03 01 00 5a 01 00 00 56 03 03 80 13 c8 83 43 |....Z...V......C| +00000010 94 79 15 01 6e 0a 9f c5 0f e7 f6 d8 b1 94 de b4 |.y..n...........| +00000020 57 8c 4f a8 08 48 ee 9b b4 d2 43 00 00 04 00 05 |W.O..H....C.....| +00000030 00 ff 01 00 00 29 00 0d 00 20 00 1e 06 01 06 02 |.....)... ......| +00000040 06 03 05 01 05 02 05 03 04 01 04 02 04 03 03 01 |................| +00000050 03 02 03 03 02 01 02 02 02 03 00 0f 00 01 01 |...............| +>>> Flow 2 (server to client) +00000000 16 03 03 00 31 02 00 00 2d 03 03 00 00 00 00 00 |....1...-.......| +00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| +00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 05 00 00 |................| +00000030 05 ff 01 00 01 00 16 03 03 02 71 0b 00 02 6d 00 |..........q...m.| +00000040 02 6a 00 02 67 30 82 02 63 30 82 01 cc a0 03 02 |.j..g0..c0......| +00000050 01 02 02 09 00 a2 73 00 0c 81 00 cb f3 30 0d 06 |......s......0..| +00000060 09 2a 86 48 86 f7 0d 01 01 0b 05 00 30 2b 31 17 |.*.H........0+1.| +00000070 30 15 06 03 55 04 0a 13 0e 47 6f 6f 67 6c 65 20 |0...U....Google | +00000080 54 45 53 54 49 4e 47 31 10 30 0e 06 03 55 04 03 |TESTING1.0...U..| +00000090 13 07 47 6f 20 52 6f 6f 74 30 1e 17 0d 31 35 30 |..Go Root0...150| +000000a0 31 30 31 30 30 30 30 30 30 5a 17 0d 32 35 30 31 |101000000Z..2501| +000000b0 30 31 30 30 30 30 30 30 5a 30 26 31 17 30 15 06 |01000000Z0&1.0..| +000000c0 03 55 04 0a 13 0e 47 6f 6f 67 6c 65 20 54 45 53 |.U....Google TES| +000000d0 54 49 4e 47 31 0b 30 09 06 03 55 04 03 13 02 47 |TING1.0...U....G| +000000e0 6f 30 81 9f 30 0d 06 09 2a 86 48 86 f7 0d 01 01 |o0..0...*.H.....| +000000f0 01 05 00 03 81 8d 00 30 81 89 02 81 81 00 af 87 |.......0........| +00000100 88 f6 20 1b 95 65 6c 14 ab 44 05 af 3b 45 14 e3 |.. ..el..D..;E..| +00000110 b7 6d fd 00 63 4d 95 7f fe 6a 62 35 86 c0 4a f9 |.m..cM...jb5..J.| +00000120 18 7c f6 aa 25 5e 7a 64 31 66 00 ba f4 8e 92 af |.|..%^zd1f......| +00000130 c7 6b d8 76 d4 f3 5f 41 cb 6e 56 15 97 1b 97 c1 |.k.v.._A.nV.....| +00000140 3c 12 39 21 66 3d 2b 16 d1 bc db 1c c0 a7 da b7 |<.9!f=+.........| +00000150 ca ad ba da cb d5 21 50 ec de 8d ab d1 6b 81 4b |......!P.....k.K| +00000160 89 02 f3 c4 be c1 6c 89 b1 44 84 bd 21 d1 04 7d |......l..D..!..}| +00000170 9d 16 4d f9 82 15 f6 ef fa d6 09 47 f2 fb 02 03 |..M........G....| +00000180 01 00 01 a3 81 93 30 81 90 30 0e 06 03 55 1d 0f |......0..0...U..| +00000190 01 01 ff 04 04 03 02 05 a0 30 1d 06 03 55 1d 25 |.........0...U.%| +000001a0 04 16 30 14 06 08 2b 06 01 05 05 07 03 01 06 08 |..0...+.........| +000001b0 2b 06 01 05 05 07 03 02 30 0c 06 03 55 1d 13 01 |+.......0...U...| +000001c0 01 ff 04 02 30 00 30 19 06 03 55 1d 0e 04 12 04 |....0.0...U.....| +000001d0 10 12 50 8d 89 6f 1b d1 dc 54 4d 6e cb 69 5e 06 |..P..o...TMn.i^.| +000001e0 f4 30 1b 06 03 55 1d 23 04 14 30 12 80 10 bf 3d |.0...U.#..0....=| +000001f0 b6 a9 66 f2 b8 40 cf ea b4 03 78 48 1a 41 30 19 |..f..@....xH.A0.| +00000200 06 03 55 1d 11 04 12 30 10 82 0e 65 78 61 6d 70 |..U....0...examp| +00000210 6c 65 2e 67 6f 6c 61 6e 67 30 0d 06 09 2a 86 48 |le.golang0...*.H| +00000220 86 f7 0d 01 01 0b 05 00 03 81 81 00 92 7c af 91 |.............|..| +00000230 55 12 18 96 59 31 a6 48 40 d5 2d d5 ee bb 02 a0 |U...Y1.H@.-.....| +00000240 f5 c2 1e 7c 9b b3 30 7d 3c dc 76 da 4f 3d c0 fa |...|..0}<.v.O=..| +00000250 ae 2d 33 24 6b 03 7b 1b 67 59 11 21 b5 11 bc 77 |.-3$k.{.gY.!...w| +00000260 b9 d9 e0 6e a8 2d 2e 35 fa 64 5f 22 3e 63 10 6b |...n.-.5.d_">c.k| +00000270 be ff 14 86 6d 0d f0 15 31 a8 14 38 1e 3b 84 87 |....m...1..8.;..| +00000280 2c cb 98 ed 51 76 b9 b1 4f dd db 9b 84 04 86 40 |,...Qv..O......@| +00000290 fa 51 dd ba b4 8d eb e3 46 de 46 b9 4f 86 c7 f9 |.Q......F.F.O...| +000002a0 a4 c2 41 34 ac cc f6 ea b0 ab 39 18 16 03 03 00 |..A4......9.....| +000002b0 17 0d 00 00 13 02 01 40 00 0c 04 01 04 03 05 01 |.......@........| +000002c0 05 03 02 01 02 03 00 00 16 03 03 00 04 0e 00 00 |................| +000002d0 00 |.| +>>> Flow 3 (client to server) +00000000 16 03 03 02 0a 0b 00 02 06 00 02 03 00 02 00 30 |...............0| +00000010 82 01 fc 30 82 01 5e 02 09 00 9a 30 84 6c 26 35 |...0..^....0.l&5| +00000020 d9 17 30 09 06 07 2a 86 48 ce 3d 04 01 30 45 31 |..0...*.H.=..0E1| +00000030 0b 30 09 06 03 55 04 06 13 02 41 55 31 13 30 11 |.0...U....AU1.0.| +00000040 06 03 55 04 08 13 0a 53 6f 6d 65 2d 53 74 61 74 |..U....Some-Stat| +00000050 65 31 21 30 1f 06 03 55 04 0a 13 18 49 6e 74 65 |e1!0...U....Inte| +00000060 72 6e 65 74 20 57 69 64 67 69 74 73 20 50 74 79 |rnet Widgits Pty| +00000070 20 4c 74 64 30 1e 17 0d 31 32 31 31 31 34 31 33 | Ltd0...12111413| +00000080 32 35 35 33 5a 17 0d 32 32 31 31 31 32 31 33 32 |2553Z..221112132| +00000090 35 35 33 5a 30 41 31 0b 30 09 06 03 55 04 06 13 |553Z0A1.0...U...| +000000a0 02 41 55 31 0c 30 0a 06 03 55 04 08 13 03 4e 53 |.AU1.0...U....NS| +000000b0 57 31 10 30 0e 06 03 55 04 07 13 07 50 79 72 6d |W1.0...U....Pyrm| +000000c0 6f 6e 74 31 12 30 10 06 03 55 04 03 13 09 4a 6f |ont1.0...U....Jo| +000000d0 65 6c 20 53 69 6e 67 30 81 9b 30 10 06 07 2a 86 |el Sing0..0...*.| +000000e0 48 ce 3d 02 01 06 05 2b 81 04 00 23 03 81 86 00 |H.=....+...#....| +000000f0 04 00 95 8c 91 75 14 c0 5e c4 57 b4 d4 c3 6f 8d |.....u..^.W...o.| +00000100 ae 68 1e dd 6f ce 86 e1 7e 6e b2 48 3e 81 e5 4e |.h..o...~n.H>..N| +00000110 e2 c6 88 4b 64 dc f5 30 bb d3 ff 65 cc 5b f4 dd |...Kd..0...e.[..| +00000120 b5 6a 3e 3e d0 1d de 47 c3 76 ad 19 f6 45 2c 8c |.j>>...G.v...E,.| +00000130 bc d8 1d 01 4c 1f 70 90 46 76 48 8b 8f 83 cc 4a |....L.p.FvH....J| +00000140 5c 8f 40 76 da e0 89 ec 1d 2b c4 4e 30 76 28 41 |\.@v.....+.N0v(A| +00000150 b2 62 a8 fb 5b f1 f9 4e 7a 8d bd 09 b8 ae ea 8b |.b..[..Nz.......| +00000160 18 27 4f 2e 70 fe 13 96 ba c3 d3 40 16 cd 65 4e |.'O.p......@..eN| +00000170 ac 11 1e e6 f1 30 09 06 07 2a 86 48 ce 3d 04 01 |.....0...*.H.=..| +00000180 03 81 8c 00 30 81 88 02 42 00 e0 14 c4 60 60 0b |....0...B....``.| +00000190 72 68 b0 32 5d 61 4a 02 74 5c c2 81 b9 16 a8 3f |rh.2]aJ.t\.....?| +000001a0 29 c8 36 c7 81 ff 6c b6 5b d9 70 f1 38 3b 50 48 |).6...l.[.p.8;PH| +000001b0 28 94 cb 09 1a 52 f1 5d ee 8d f2 b9 f0 f0 da d9 |(....R.]........| +000001c0 15 3a f9 bd 03 7a 87 a2 23 35 ec 02 42 01 a3 d4 |.:...z..#5..B...| +000001d0 8a 78 35 1c 4a 9a 23 d2 0a be 2b 10 31 9d 9c 5f |.x5.J.#...+.1.._| +000001e0 be e8 91 b3 da 1a f5 5d a3 23 f5 26 8b 45 70 8d |.......].#.&.Ep.| +000001f0 65 62 9b 7e 01 99 3d 18 f6 10 9a 38 61 9b 2e 57 |eb.~..=....8a..W| +00000200 e4 fa cc b1 8a ce e2 23 a0 87 f0 e1 67 51 eb 16 |.......#....gQ..| +00000210 03 03 00 86 10 00 00 82 00 80 88 00 24 23 a5 c7 |............$#..| +00000220 03 2d 86 37 91 f1 71 a9 5f fb 97 49 88 04 9b 0e |.-.7..q._..I....| +00000230 89 da 65 d0 56 71 e7 76 22 ef 8e 11 0e 6b 50 3d |..e.Vq.v"....kP=| +00000240 64 3f f7 9b e4 45 01 d9 12 cb da fe 10 da 4e b5 |d?...E........N.| +00000250 b8 6a b5 bc 74 19 d3 4f a9 bb ee 54 37 e4 70 d0 |.j..t..O...T7.p.| +00000260 b6 e7 35 96 70 fe a5 2b 14 ac fb c6 1a fa 7d 12 |..5.p..+......}.| +00000270 87 1b 63 9d 72 30 4d 2c 1a c9 29 32 72 b6 13 53 |..c.r0M,..)2r..S| +00000280 96 05 de 78 bc f0 1a 74 e2 31 b9 ea db 62 62 6e |...x...t.1...bbn| +00000290 a0 a6 b2 c0 3e 2a 94 0d 6a f7 16 03 03 00 92 0f |....>*..j.......| +000002a0 00 00 8e 04 03 00 8a 30 81 87 02 42 01 71 5b 3b |.......0...B.q[;| +000002b0 a3 35 58 c0 b6 08 09 4f ac af 89 e0 b3 d5 3d 45 |.5X....O......=E| +000002c0 1f 49 7f 4a c9 bc 9d 0e 50 3a f5 79 bc 54 5d a9 |.I.J....P:.y.T].| +000002d0 62 ed 85 c5 f3 47 36 03 cc f1 cd 33 c3 70 2a a6 |b....G6....3.p*.| +000002e0 7c d9 6e 0c db 0d 1b 4f 6a 39 ba 77 bd ea 02 41 ||.n....Oj9.w...A| +000002f0 00 f2 b7 06 df 2f 81 7e 98 24 46 06 59 4e 86 6a |...../.~.$F.YN.j| +00000300 b7 4f b6 4b 95 40 88 f0 8f f8 bd 16 f5 d5 82 7e |.O.K.@.........~| +00000310 82 51 6f 05 49 43 59 cd 1d 40 69 67 ff 65 a8 68 |.Qo.ICY..@ig.e.h| +00000320 39 2f a1 ad a7 6a ef 5c d5 69 5e 16 50 bb 2a b2 |9/...j.\.i^.P.*.| +00000330 2f 14 03 03 00 01 01 16 03 03 00 24 55 f6 74 21 |/..........$U.t!| +00000340 b4 08 a0 7f a2 dc 86 44 e3 f8 e3 0d e1 d6 5c 1c |.......D......\.| +00000350 22 1e 41 2b 30 cc 34 0f a4 a1 7c a0 27 21 01 e0 |".A+0.4...|.'!..| +>>> Flow 4 (server to client) +00000000 14 03 03 00 01 01 16 03 03 00 24 6f 6b e7 fb f7 |..........$ok...| +00000010 52 83 b3 6f ba 1b d7 e8 cb 0a 05 ee 90 04 2b c7 |R..o..........+.| +00000020 c2 bd 0d 8e ee 42 88 40 ae 01 4a d0 07 4b f4 17 |.....B.@..J..K..| +00000030 03 03 00 21 e0 8b bd 80 04 18 9c be 12 07 d4 4d |...!...........M| +00000040 58 d9 ec c3 f0 67 b5 b3 d1 78 25 e7 2e dd a0 0a |X....g...x%.....| +00000050 ac 0f a1 90 59 15 03 03 00 16 76 30 22 0b 00 83 |....Y.....v0"...| +00000060 c4 31 29 1c ca 44 cb 9f 0e 48 17 21 43 f6 af 47 |.1)..D...H.!C..G| diff --git a/src/crypto/tls/testdata/Server-TLSv12-ClientAuthRequestedAndGiven b/src/crypto/tls/testdata/Server-TLSv12-ClientAuthRequestedAndGiven new file mode 100644 index 0000000000000000000000000000000000000000..862e0be09eef947abc0d13095bd128d71bce7a30 --- /dev/null +++ b/src/crypto/tls/testdata/Server-TLSv12-ClientAuthRequestedAndGiven @@ -0,0 +1,116 @@ +>>> Flow 1 (client to server) +00000000 16 03 01 00 5a 01 00 00 56 03 03 b0 80 f6 7c 13 |....Z...V.....|.| +00000010 30 5d 57 f0 11 3b 30 4b 0e 01 50 9a 44 0b 89 6f |0]W..;0K..P.D..o| +00000020 b6 f1 a3 34 b4 f1 b9 bf fe 66 a5 00 00 04 00 05 |...4.....f......| +00000030 00 ff 01 00 00 29 00 0d 00 20 00 1e 06 01 06 02 |.....)... ......| +00000040 06 03 05 01 05 02 05 03 04 01 04 02 04 03 03 01 |................| +00000050 03 02 03 03 02 01 02 02 02 03 00 0f 00 01 01 |...............| +>>> Flow 2 (server to client) +00000000 16 03 03 00 31 02 00 00 2d 03 03 00 00 00 00 00 |....1...-.......| +00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| +00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 05 00 00 |................| +00000030 05 ff 01 00 01 00 16 03 03 02 71 0b 00 02 6d 00 |..........q...m.| +00000040 02 6a 00 02 67 30 82 02 63 30 82 01 cc a0 03 02 |.j..g0..c0......| +00000050 01 02 02 09 00 a2 73 00 0c 81 00 cb f3 30 0d 06 |......s......0..| +00000060 09 2a 86 48 86 f7 0d 01 01 0b 05 00 30 2b 31 17 |.*.H........0+1.| +00000070 30 15 06 03 55 04 0a 13 0e 47 6f 6f 67 6c 65 20 |0...U....Google | +00000080 54 45 53 54 49 4e 47 31 10 30 0e 06 03 55 04 03 |TESTING1.0...U..| +00000090 13 07 47 6f 20 52 6f 6f 74 30 1e 17 0d 31 35 30 |..Go Root0...150| +000000a0 31 30 31 30 30 30 30 30 30 5a 17 0d 32 35 30 31 |101000000Z..2501| +000000b0 30 31 30 30 30 30 30 30 5a 30 26 31 17 30 15 06 |01000000Z0&1.0..| +000000c0 03 55 04 0a 13 0e 47 6f 6f 67 6c 65 20 54 45 53 |.U....Google TES| +000000d0 54 49 4e 47 31 0b 30 09 06 03 55 04 03 13 02 47 |TING1.0...U....G| +000000e0 6f 30 81 9f 30 0d 06 09 2a 86 48 86 f7 0d 01 01 |o0..0...*.H.....| +000000f0 01 05 00 03 81 8d 00 30 81 89 02 81 81 00 af 87 |.......0........| +00000100 88 f6 20 1b 95 65 6c 14 ab 44 05 af 3b 45 14 e3 |.. ..el..D..;E..| +00000110 b7 6d fd 00 63 4d 95 7f fe 6a 62 35 86 c0 4a f9 |.m..cM...jb5..J.| +00000120 18 7c f6 aa 25 5e 7a 64 31 66 00 ba f4 8e 92 af |.|..%^zd1f......| +00000130 c7 6b d8 76 d4 f3 5f 41 cb 6e 56 15 97 1b 97 c1 |.k.v.._A.nV.....| +00000140 3c 12 39 21 66 3d 2b 16 d1 bc db 1c c0 a7 da b7 |<.9!f=+.........| +00000150 ca ad ba da cb d5 21 50 ec de 8d ab d1 6b 81 4b |......!P.....k.K| +00000160 89 02 f3 c4 be c1 6c 89 b1 44 84 bd 21 d1 04 7d |......l..D..!..}| +00000170 9d 16 4d f9 82 15 f6 ef fa d6 09 47 f2 fb 02 03 |..M........G....| +00000180 01 00 01 a3 81 93 30 81 90 30 0e 06 03 55 1d 0f |......0..0...U..| +00000190 01 01 ff 04 04 03 02 05 a0 30 1d 06 03 55 1d 25 |.........0...U.%| +000001a0 04 16 30 14 06 08 2b 06 01 05 05 07 03 01 06 08 |..0...+.........| +000001b0 2b 06 01 05 05 07 03 02 30 0c 06 03 55 1d 13 01 |+.......0...U...| +000001c0 01 ff 04 02 30 00 30 19 06 03 55 1d 0e 04 12 04 |....0.0...U.....| +000001d0 10 12 50 8d 89 6f 1b d1 dc 54 4d 6e cb 69 5e 06 |..P..o...TMn.i^.| +000001e0 f4 30 1b 06 03 55 1d 23 04 14 30 12 80 10 bf 3d |.0...U.#..0....=| +000001f0 b6 a9 66 f2 b8 40 cf ea b4 03 78 48 1a 41 30 19 |..f..@....xH.A0.| +00000200 06 03 55 1d 11 04 12 30 10 82 0e 65 78 61 6d 70 |..U....0...examp| +00000210 6c 65 2e 67 6f 6c 61 6e 67 30 0d 06 09 2a 86 48 |le.golang0...*.H| +00000220 86 f7 0d 01 01 0b 05 00 03 81 81 00 92 7c af 91 |.............|..| +00000230 55 12 18 96 59 31 a6 48 40 d5 2d d5 ee bb 02 a0 |U...Y1.H@.-.....| +00000240 f5 c2 1e 7c 9b b3 30 7d 3c dc 76 da 4f 3d c0 fa |...|..0}<.v.O=..| +00000250 ae 2d 33 24 6b 03 7b 1b 67 59 11 21 b5 11 bc 77 |.-3$k.{.gY.!...w| +00000260 b9 d9 e0 6e a8 2d 2e 35 fa 64 5f 22 3e 63 10 6b |...n.-.5.d_">c.k| +00000270 be ff 14 86 6d 0d f0 15 31 a8 14 38 1e 3b 84 87 |....m...1..8.;..| +00000280 2c cb 98 ed 51 76 b9 b1 4f dd db 9b 84 04 86 40 |,...Qv..O......@| +00000290 fa 51 dd ba b4 8d eb e3 46 de 46 b9 4f 86 c7 f9 |.Q......F.F.O...| +000002a0 a4 c2 41 34 ac cc f6 ea b0 ab 39 18 16 03 03 00 |..A4......9.....| +000002b0 17 0d 00 00 13 02 01 40 00 0c 04 01 04 03 05 01 |.......@........| +000002c0 05 03 02 01 02 03 00 00 16 03 03 00 04 0e 00 00 |................| +000002d0 00 |.| +>>> Flow 3 (client to server) +00000000 16 03 03 01 fb 0b 00 01 f7 00 01 f4 00 01 f1 30 |...............0| +00000010 82 01 ed 30 82 01 58 a0 03 02 01 02 02 01 00 30 |...0..X........0| +00000020 0b 06 09 2a 86 48 86 f7 0d 01 01 05 30 26 31 10 |...*.H......0&1.| +00000030 30 0e 06 03 55 04 0a 13 07 41 63 6d 65 20 43 6f |0...U....Acme Co| +00000040 31 12 30 10 06 03 55 04 03 13 09 31 32 37 2e 30 |1.0...U....127.0| +00000050 2e 30 2e 31 30 1e 17 0d 31 31 31 32 30 38 30 37 |.0.10...11120807| +00000060 35 35 31 32 5a 17 0d 31 32 31 32 30 37 30 38 30 |5512Z..121207080| +00000070 30 31 32 5a 30 26 31 10 30 0e 06 03 55 04 0a 13 |012Z0&1.0...U...| +00000080 07 41 63 6d 65 20 43 6f 31 12 30 10 06 03 55 04 |.Acme Co1.0...U.| +00000090 03 13 09 31 32 37 2e 30 2e 30 2e 31 30 81 9c 30 |...127.0.0.10..0| +000000a0 0b 06 09 2a 86 48 86 f7 0d 01 01 01 03 81 8c 00 |...*.H..........| +000000b0 30 81 88 02 81 80 4e d0 7b 31 e3 82 64 d9 59 c0 |0.....N.{1..d.Y.| +000000c0 c2 87 a4 5e 1e 8b 73 33 c7 63 53 df 66 92 06 84 |...^..s3.cS.f...| +000000d0 f6 64 d5 8f e4 36 a7 1d 2b e8 b3 20 36 45 23 b5 |.d...6..+.. 6E#.| +000000e0 e3 95 ae ed e0 f5 20 9c 8d 95 df 7f 5a 12 ef 87 |...... .....Z...| +000000f0 e4 5b 68 e4 e9 0e 74 ec 04 8a 7f de 93 27 c4 01 |.[h...t......'..| +00000100 19 7a bd f2 dc 3d 14 ab d0 54 ca 21 0c d0 4d 6e |.z...=...T.!..Mn| +00000110 87 2e 5c c5 d2 bb 4d 4b 4f ce b6 2c f7 7e 88 ec |..\...MKO..,.~..| +00000120 7c d7 02 91 74 a6 1e 0c 1a da e3 4a 5a 2e de 13 ||...t......JZ...| +00000130 9c 4c 40 88 59 93 02 03 01 00 01 a3 32 30 30 30 |.L@.Y.......2000| +00000140 0e 06 03 55 1d 0f 01 01 ff 04 04 03 02 00 a0 30 |...U...........0| +00000150 0d 06 03 55 1d 0e 04 06 04 04 01 02 03 04 30 0f |...U..........0.| +00000160 06 03 55 1d 23 04 08 30 06 80 04 01 02 03 04 30 |..U.#..0.......0| +00000170 0b 06 09 2a 86 48 86 f7 0d 01 01 05 03 81 81 00 |...*.H..........| +00000180 36 1f b3 7a 0c 75 c9 6e 37 46 61 2b d5 bd c0 a7 |6..z.u.n7Fa+....| +00000190 4b cc 46 9a 81 58 7c 85 79 29 c8 c8 c6 67 dd 32 |K.F..X|.y)...g.2| +000001a0 56 45 2b 75 b6 e9 24 a9 50 9a be 1f 5a fa 1a 15 |VE+u..$.P...Z...| +000001b0 d9 cc 55 95 72 16 83 b9 c2 b6 8f fd 88 8c 38 84 |..U.r.........8.| +000001c0 1d ab 5d 92 31 13 4f fd 83 3b c6 9d f1 11 62 b6 |..].1.O..;....b.| +000001d0 8b ec ab 67 be c8 64 b0 11 50 46 58 17 6b 99 1c |...g..d..PFX.k..| +000001e0 d3 1d fc 06 f1 0e e5 96 a8 0c f9 78 20 b7 44 18 |...........x .D.| +000001f0 51 8d 10 7e 4f 94 67 df a3 4e 70 73 8e 90 91 85 |Q..~O.g..Nps....| +00000200 16 03 03 00 86 10 00 00 82 00 80 98 61 16 34 c4 |............a.4.| +00000210 c6 0a 47 c1 de 87 b1 b7 70 1b 24 8d 7e 35 90 35 |..G.....p.$.~5.5| +00000220 f7 a5 6f c7 c9 91 ad 46 4c 50 e5 7e 61 7c 49 66 |..o....FLP.~a|If| +00000230 e9 fe 1e 2c 30 fa 22 03 36 8f 44 27 a7 d2 14 84 |...,0.".6.D'....| +00000240 d0 1f 21 ca 40 35 d1 7d 31 3f e1 73 de 69 bc da |..!.@5.}1?.s.i..| +00000250 a5 96 8a b5 50 2b 4b 87 5a b3 fb e1 11 0a 29 59 |....P+K.Z.....)Y| +00000260 13 2e e3 c2 05 d3 23 e8 09 0c 42 f6 8e 26 67 89 |......#...B..&g.| +00000270 24 0f 08 2f 3d 24 2b 0c a2 98 38 02 5c 95 9f ce |$../=$+...8.\...| +00000280 e3 75 ba 05 b5 f8 f0 07 e9 a1 44 16 03 03 00 88 |.u........D.....| +00000290 0f 00 00 84 04 01 00 80 04 c0 bc 4b 23 59 ed 26 |...........K#Y.&| +000002a0 8d 90 35 da 5b 55 88 e7 12 10 7b d7 1c 27 d1 c4 |..5.[U....{..'..| +000002b0 d8 1b e2 e7 54 ad a4 be 00 6b 5b 61 2d ec 97 0c |....T....k[a-...| +000002c0 a5 9b ae ab 13 fa 94 53 1c 65 28 21 7d b5 c5 be |.......S.e(!}...| +000002d0 22 62 91 78 fc e3 de 84 5c 4e 0d f5 73 5e 20 49 |"b.x....\N..s^ I| +000002e0 5a e2 f9 d3 2f 36 23 91 31 5b ee c7 0b 6f b3 35 |Z.../6#.1[...o.5| +000002f0 2f 8a 51 84 3c fe 78 34 1f 8c 68 d3 fc 4f c6 5e |/.Q.<.x4..h..O.^| +00000300 7b fe b2 81 79 91 37 ee 7f f1 9b a4 88 5f 1b 44 |{...y.7......_.D| +00000310 dc e9 36 bb d1 45 bb 1f 14 03 03 00 01 01 16 03 |..6..E..........| +00000320 03 00 24 12 e7 8a 31 36 26 9f fe 45 95 cf 41 56 |..$...16&..E..AV| +00000330 b4 69 ef e4 22 14 5a 4d c8 79 a7 18 7b 68 a8 02 |.i..".ZM.y..{h..| +00000340 75 ea 42 fe c4 a1 32 |u.B...2| +>>> Flow 4 (server to client) +00000000 14 03 03 00 01 01 16 03 03 00 24 ae 6d 7b ac b6 |..........$.m{..| +00000010 62 5c 40 65 6b 0e 5c 12 68 61 14 90 54 3e 24 78 |b\@ek.\.ha..T>$x| +00000020 be 85 17 a0 9b de a0 00 e9 80 1b a9 0f e4 d7 17 |................| +00000030 03 03 00 21 86 06 17 6b 62 02 a7 a0 71 fe c0 e4 |...!...kb...q...| +00000040 44 00 54 dd cc a9 70 cf bc 92 0d 40 07 62 f5 39 |D.T...p....@.b.9| +00000050 2a 30 ab 7f cd 15 03 03 00 16 6f 8d c9 d4 62 02 |*0........o...b.| +00000060 da 64 4c 89 32 86 9f 29 24 05 ed cc 77 9d e5 55 |.dL.2..)$...w..U| diff --git a/src/crypto/tls/testdata/Server-TLSv12-ClientAuthRequestedNotGiven b/src/crypto/tls/testdata/Server-TLSv12-ClientAuthRequestedNotGiven new file mode 100644 index 0000000000000000000000000000000000000000..5de6dd82ec0b27325f879dfcb8c0e4b34056e765 --- /dev/null +++ b/src/crypto/tls/testdata/Server-TLSv12-ClientAuthRequestedNotGiven @@ -0,0 +1,76 @@ +>>> Flow 1 (client to server) +00000000 16 03 01 00 5a 01 00 00 56 03 03 52 b6 c5 b4 e3 |....Z...V..R....| +00000010 35 ce 4e b2 9c e0 38 09 e7 fe 00 a2 1a 0a 43 eb |5.N...8.......C.| +00000020 df 98 6a 34 71 f9 d0 f8 5d e7 5e 00 00 04 00 05 |..j4q...].^.....| +00000030 00 ff 01 00 00 29 00 0d 00 20 00 1e 06 01 06 02 |.....)... ......| +00000040 06 03 05 01 05 02 05 03 04 01 04 02 04 03 03 01 |................| +00000050 03 02 03 03 02 01 02 02 02 03 00 0f 00 01 01 |...............| +>>> Flow 2 (server to client) +00000000 16 03 03 00 31 02 00 00 2d 03 03 00 00 00 00 00 |....1...-.......| +00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| +00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 05 00 00 |................| +00000030 05 ff 01 00 01 00 16 03 03 02 71 0b 00 02 6d 00 |..........q...m.| +00000040 02 6a 00 02 67 30 82 02 63 30 82 01 cc a0 03 02 |.j..g0..c0......| +00000050 01 02 02 09 00 a2 73 00 0c 81 00 cb f3 30 0d 06 |......s......0..| +00000060 09 2a 86 48 86 f7 0d 01 01 0b 05 00 30 2b 31 17 |.*.H........0+1.| +00000070 30 15 06 03 55 04 0a 13 0e 47 6f 6f 67 6c 65 20 |0...U....Google | +00000080 54 45 53 54 49 4e 47 31 10 30 0e 06 03 55 04 03 |TESTING1.0...U..| +00000090 13 07 47 6f 20 52 6f 6f 74 30 1e 17 0d 31 35 30 |..Go Root0...150| +000000a0 31 30 31 30 30 30 30 30 30 5a 17 0d 32 35 30 31 |101000000Z..2501| +000000b0 30 31 30 30 30 30 30 30 5a 30 26 31 17 30 15 06 |01000000Z0&1.0..| +000000c0 03 55 04 0a 13 0e 47 6f 6f 67 6c 65 20 54 45 53 |.U....Google TES| +000000d0 54 49 4e 47 31 0b 30 09 06 03 55 04 03 13 02 47 |TING1.0...U....G| +000000e0 6f 30 81 9f 30 0d 06 09 2a 86 48 86 f7 0d 01 01 |o0..0...*.H.....| +000000f0 01 05 00 03 81 8d 00 30 81 89 02 81 81 00 af 87 |.......0........| +00000100 88 f6 20 1b 95 65 6c 14 ab 44 05 af 3b 45 14 e3 |.. ..el..D..;E..| +00000110 b7 6d fd 00 63 4d 95 7f fe 6a 62 35 86 c0 4a f9 |.m..cM...jb5..J.| +00000120 18 7c f6 aa 25 5e 7a 64 31 66 00 ba f4 8e 92 af |.|..%^zd1f......| +00000130 c7 6b d8 76 d4 f3 5f 41 cb 6e 56 15 97 1b 97 c1 |.k.v.._A.nV.....| +00000140 3c 12 39 21 66 3d 2b 16 d1 bc db 1c c0 a7 da b7 |<.9!f=+.........| +00000150 ca ad ba da cb d5 21 50 ec de 8d ab d1 6b 81 4b |......!P.....k.K| +00000160 89 02 f3 c4 be c1 6c 89 b1 44 84 bd 21 d1 04 7d |......l..D..!..}| +00000170 9d 16 4d f9 82 15 f6 ef fa d6 09 47 f2 fb 02 03 |..M........G....| +00000180 01 00 01 a3 81 93 30 81 90 30 0e 06 03 55 1d 0f |......0..0...U..| +00000190 01 01 ff 04 04 03 02 05 a0 30 1d 06 03 55 1d 25 |.........0...U.%| +000001a0 04 16 30 14 06 08 2b 06 01 05 05 07 03 01 06 08 |..0...+.........| +000001b0 2b 06 01 05 05 07 03 02 30 0c 06 03 55 1d 13 01 |+.......0...U...| +000001c0 01 ff 04 02 30 00 30 19 06 03 55 1d 0e 04 12 04 |....0.0...U.....| +000001d0 10 12 50 8d 89 6f 1b d1 dc 54 4d 6e cb 69 5e 06 |..P..o...TMn.i^.| +000001e0 f4 30 1b 06 03 55 1d 23 04 14 30 12 80 10 bf 3d |.0...U.#..0....=| +000001f0 b6 a9 66 f2 b8 40 cf ea b4 03 78 48 1a 41 30 19 |..f..@....xH.A0.| +00000200 06 03 55 1d 11 04 12 30 10 82 0e 65 78 61 6d 70 |..U....0...examp| +00000210 6c 65 2e 67 6f 6c 61 6e 67 30 0d 06 09 2a 86 48 |le.golang0...*.H| +00000220 86 f7 0d 01 01 0b 05 00 03 81 81 00 92 7c af 91 |.............|..| +00000230 55 12 18 96 59 31 a6 48 40 d5 2d d5 ee bb 02 a0 |U...Y1.H@.-.....| +00000240 f5 c2 1e 7c 9b b3 30 7d 3c dc 76 da 4f 3d c0 fa |...|..0}<.v.O=..| +00000250 ae 2d 33 24 6b 03 7b 1b 67 59 11 21 b5 11 bc 77 |.-3$k.{.gY.!...w| +00000260 b9 d9 e0 6e a8 2d 2e 35 fa 64 5f 22 3e 63 10 6b |...n.-.5.d_">c.k| +00000270 be ff 14 86 6d 0d f0 15 31 a8 14 38 1e 3b 84 87 |....m...1..8.;..| +00000280 2c cb 98 ed 51 76 b9 b1 4f dd db 9b 84 04 86 40 |,...Qv..O......@| +00000290 fa 51 dd ba b4 8d eb e3 46 de 46 b9 4f 86 c7 f9 |.Q......F.F.O...| +000002a0 a4 c2 41 34 ac cc f6 ea b0 ab 39 18 16 03 03 00 |..A4......9.....| +000002b0 17 0d 00 00 13 02 01 40 00 0c 04 01 04 03 05 01 |.......@........| +000002c0 05 03 02 01 02 03 00 00 16 03 03 00 04 0e 00 00 |................| +000002d0 00 |.| +>>> Flow 3 (client to server) +00000000 16 03 03 00 07 0b 00 00 03 00 00 00 16 03 03 00 |................| +00000010 86 10 00 00 82 00 80 2e 8e cb 6c f5 db 45 5b f0 |..........l..E[.| +00000020 67 7d b1 ac 87 c2 d6 e9 ea 37 40 15 2a ea a1 af |g}.......7@.*...| +00000030 ed 71 68 18 9c 6c 84 20 52 3e 38 94 8e d9 cd b3 |.qh..l. R>8.....| +00000040 15 73 8b db d7 ff 1d 8a ed a6 f4 00 7d d0 0a 1e |.s..........}...| +00000050 9a 1b 5c 59 f6 a0 29 62 03 a1 c6 bf 8a 57 14 06 |..\Y..)b.....W..| +00000060 9a e8 03 72 bc cd cd 6f 6d e2 ce a8 41 7a f0 65 |...r...om...Az.e| +00000070 42 0c 7b dd 93 d7 ab 37 f8 2a b3 c4 72 95 61 e1 |B.{....7.*..r.a.| +00000080 75 98 f5 99 69 ef 0a d0 00 41 0f 05 87 13 d3 7d |u...i....A.....}| +00000090 ba 74 34 43 9a 6c d0 14 03 03 00 01 01 16 03 03 |.t4C.l..........| +000000a0 00 24 87 7e 7d 48 ca 17 9c ad 30 b8 6a 05 2f d3 |.$.~}H....0.j./.| +000000b0 fc 18 2e df fd f5 0e 38 c3 06 57 4c 27 66 02 af |.......8..WL'f..| +000000c0 6d 78 4d 2e b6 dc |mxM...| +>>> Flow 4 (server to client) +00000000 14 03 03 00 01 01 16 03 03 00 24 cf ee f6 28 ea |..........$...(.| +00000010 df e2 7e 9a 75 e0 f9 b4 c4 c2 57 3a 54 26 db 7f |..~.u.....W:T&..| +00000020 c4 19 6d b6 d6 c7 b1 05 7f 92 21 9e 51 1a 0a 17 |..m.......!.Q...| +00000030 03 03 00 21 87 48 77 c4 eb 7c 5d 13 3b f4 8d 08 |...!.Hw..|].;...| +00000040 f9 35 c3 d2 e5 c0 8c ea 15 c9 2d c5 e0 70 fd 7c |.5........-..p.|| +00000050 de 93 4f 8c 8d 15 03 03 00 16 d4 8a d5 6a fc db |..O..........j..| +00000060 c7 1d 1f 76 64 b9 31 68 72 cc 58 de 9f 2a a6 45 |...vd.1hr.X..*.E| diff --git a/src/crypto/tls/testdata/Server-TLSv12-ECDHE-ECDSA-AES b/src/crypto/tls/testdata/Server-TLSv12-ECDHE-ECDSA-AES new file mode 100644 index 0000000000000000000000000000000000000000..3b7238ad29970af507f86fe6c2b0d0ce0c63f5bb --- /dev/null +++ b/src/crypto/tls/testdata/Server-TLSv12-ECDHE-ECDSA-AES @@ -0,0 +1,89 @@ +>>> Flow 1 (client to server) +00000000 16 03 01 00 a1 01 00 00 9d 03 03 0f b7 07 5f c7 |.............._.| +00000010 18 b8 39 6d 92 b3 90 ed bf 5c 48 7c 6a 56 ee e9 |..9m.....\H|jV..| +00000020 7a 5b 5f 71 a4 f0 7f 47 57 73 78 00 00 04 c0 0a |z[_q...GWsx.....| +00000030 00 ff 02 01 00 00 6f 00 0b 00 04 03 00 01 02 00 |......o.........| +00000040 0a 00 3a 00 38 00 0e 00 0d 00 19 00 1c 00 0b 00 |..:.8...........| +00000050 0c 00 1b 00 18 00 09 00 0a 00 1a 00 16 00 17 00 |................| +00000060 08 00 06 00 07 00 14 00 15 00 04 00 05 00 12 00 |................| +00000070 13 00 01 00 02 00 03 00 0f 00 10 00 11 00 0d 00 |................| +00000080 20 00 1e 06 01 06 02 06 03 05 01 05 02 05 03 04 | ...............| +00000090 01 04 02 04 03 03 01 03 02 03 03 02 01 02 02 02 |................| +000000a0 03 00 0f 00 01 01 |......| +>>> Flow 2 (server to client) +00000000 16 03 03 00 31 02 00 00 2d 03 03 00 00 00 00 00 |....1...-.......| +00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| +00000020 00 00 00 00 00 00 00 00 00 00 00 00 c0 0a 00 00 |................| +00000030 05 ff 01 00 01 00 16 03 03 02 0e 0b 00 02 0a 00 |................| +00000040 02 07 00 02 04 30 82 02 00 30 82 01 62 02 09 00 |.....0...0..b...| +00000050 b8 bf 2d 47 a0 d2 eb f4 30 09 06 07 2a 86 48 ce |..-G....0...*.H.| +00000060 3d 04 01 30 45 31 0b 30 09 06 03 55 04 06 13 02 |=..0E1.0...U....| +00000070 41 55 31 13 30 11 06 03 55 04 08 13 0a 53 6f 6d |AU1.0...U....Som| +00000080 65 2d 53 74 61 74 65 31 21 30 1f 06 03 55 04 0a |e-State1!0...U..| +00000090 13 18 49 6e 74 65 72 6e 65 74 20 57 69 64 67 69 |..Internet Widgi| +000000a0 74 73 20 50 74 79 20 4c 74 64 30 1e 17 0d 31 32 |ts Pty Ltd0...12| +000000b0 31 31 32 32 31 35 30 36 33 32 5a 17 0d 32 32 31 |1122150632Z..221| +000000c0 31 32 30 31 35 30 36 33 32 5a 30 45 31 0b 30 09 |120150632Z0E1.0.| +000000d0 06 03 55 04 06 13 02 41 55 31 13 30 11 06 03 55 |..U....AU1.0...U| +000000e0 04 08 13 0a 53 6f 6d 65 2d 53 74 61 74 65 31 21 |....Some-State1!| +000000f0 30 1f 06 03 55 04 0a 13 18 49 6e 74 65 72 6e 65 |0...U....Interne| +00000100 74 20 57 69 64 67 69 74 73 20 50 74 79 20 4c 74 |t Widgits Pty Lt| +00000110 64 30 81 9b 30 10 06 07 2a 86 48 ce 3d 02 01 06 |d0..0...*.H.=...| +00000120 05 2b 81 04 00 23 03 81 86 00 04 00 c4 a1 ed be |.+...#..........| +00000130 98 f9 0b 48 73 36 7e c3 16 56 11 22 f2 3d 53 c3 |...Hs6~..V.".=S.| +00000140 3b 4d 21 3d cd 6b 75 e6 f6 b0 dc 9a df 26 c1 bc |;M!=.ku......&..| +00000150 b2 87 f0 72 32 7c b3 64 2f 1c 90 bc ea 68 23 10 |...r2|.d/....h#.| +00000160 7e fe e3 25 c0 48 3a 69 e0 28 6d d3 37 00 ef 04 |~..%.H:i.(m.7...| +00000170 62 dd 0d a0 9c 70 62 83 d8 81 d3 64 31 aa 9e 97 |b....pb....d1...| +00000180 31 bd 96 b0 68 c0 9b 23 de 76 64 3f 1a 5c 7f e9 |1...h..#.vd?.\..| +00000190 12 0e 58 58 b6 5f 70 dd 9b d8 ea d5 d7 f5 d5 cc |..XX._p.........| +000001a0 b9 b6 9f 30 66 5b 66 9a 20 e2 27 e5 bf fe 3b 30 |...0f[f. .'...;0| +000001b0 09 06 07 2a 86 48 ce 3d 04 01 03 81 8c 00 30 81 |...*.H.=......0.| +000001c0 88 02 42 01 88 a2 4f eb e2 45 c5 48 7d 1b ac f5 |..B...O..E.H}...| +000001d0 ed 98 9d ae 47 70 c0 5e 1b b6 2f bd f1 b6 4d b7 |....Gp.^../...M.| +000001e0 61 40 d3 11 a2 ce ee 0b 7e 92 7e ff 76 9d c3 3b |a@......~.~.v..;| +000001f0 7e a5 3f ce fa 10 e2 59 ec 47 2d 7c ac da 4e 97 |~.?....Y.G-|..N.| +00000200 0e 15 a0 6f d0 02 42 01 4d fc be 67 13 9c 2d 05 |...o..B.M..g..-.| +00000210 0e bd 3f a3 8c 25 c1 33 13 83 0d 94 06 bb d4 37 |..?..%.3.......7| +00000220 7a f6 ec 7a c9 86 2e dd d7 11 69 7f 85 7c 56 de |z..z......i..|V.| +00000230 fb 31 78 2b e4 c7 78 0d ae cb be 9e 4e 36 24 31 |.1x+..x.....N6$1| +00000240 7b 6a 0f 39 95 12 07 8f 2a 16 03 03 00 d8 0c 00 |{j.9....*.......| +00000250 00 d4 03 00 17 41 04 1e 18 37 ef 0d 19 51 88 35 |.....A...7...Q.5| +00000260 75 71 b5 e5 54 5b 12 2e 8f 09 67 fd a7 24 20 3e |uq..T[....g..$ >| +00000270 b2 56 1c ce 97 28 5e f8 2b 2d 4f 9e f1 07 9f 6c |.V...(^.+-O....l| +00000280 4b 5b 83 56 e2 32 42 e9 58 b6 d7 49 a6 b5 68 1a |K[.V.2B.X..I..h.| +00000290 41 03 56 6b dc 5a 89 05 03 00 8b 30 81 88 02 42 |A.Vk.Z.....0...B| +000002a0 00 d3 cf 21 cd 3c 2e 11 f5 f8 1d c8 c1 57 4b f8 |...!.<.......WK.| +000002b0 1a c0 2b 1d 47 0f 2d a5 ac a1 c8 83 5d 76 87 05 |..+.G.-.....]v..| +000002c0 2b 0d 36 d5 57 9f b9 8a a0 a2 94 67 6a cd 29 db |+.6.W......gj.).| +000002d0 04 b0 6b 06 d9 f7 17 9f 1c 60 92 e7 4e 50 48 7f |..k......`..NPH.| +000002e0 dc d0 02 42 01 56 fd 38 bd 05 a5 16 6d 91 d1 ce |...B.V.8....m...| +000002f0 bb 8c 45 b2 76 2f 92 9c 8b 94 57 7d de 53 8b 7b |..E.v/....W}.S.{| +00000300 80 26 6c 4a 43 4b a6 c9 46 49 08 ab c7 57 f3 d9 |.&lJCK..FI...W..| +00000310 fa 1d 55 fe 91 de 8a 0d 8b d1 44 96 87 85 cb 02 |..U.......D.....| +00000320 76 9c 00 ad 5f b8 16 03 03 00 04 0e 00 00 00 |v..._..........| +>>> Flow 3 (client to server) +00000000 16 03 03 00 46 10 00 00 42 41 04 0b dc ea 22 05 |....F...BA....".| +00000010 44 c2 09 47 65 31 3b 0b e1 05 1a 87 8c 2d 3b 56 |D..Ge1;......-;V| +00000020 49 34 27 3e d6 3b 93 e2 12 7f 5d 7b dc 85 c8 96 |I4'>.;....]{....| +00000030 4c 8c f9 18 6f 15 cf db 6e 2c 14 6a c9 dd 1c 70 |L...o...n,.j...p| +00000040 7e 05 c4 17 71 76 df 10 ee 8c b1 14 03 03 00 01 |~...qv..........| +00000050 01 16 03 03 00 40 ff 12 88 36 3c 00 17 d1 b9 41 |.....@...6<....A| +00000060 7a 12 25 94 4c 90 65 62 d8 09 ab f9 b4 ee c3 de |z.%.L.eb........| +00000070 46 2f cb ee 18 76 4f 76 8e dd 89 fc 7a 21 3b 5f |F/...vOv....z!;_| +00000080 ff ac 1c 03 aa be 96 82 82 ea 2e 22 2a 80 b3 86 |..........."*...| +00000090 38 e4 4d 90 91 46 |8.M..F| +>>> Flow 4 (server to client) +00000000 14 03 03 00 01 01 16 03 03 00 40 00 00 00 00 00 |..........@.....| +00000010 00 00 00 00 00 00 00 00 00 00 00 e5 c1 f0 6a db |..............j.| +00000020 05 98 ed 33 94 73 7f 13 7f 78 17 7f d1 9e c5 a7 |...3.s...x......| +00000030 62 7f 85 14 2c 7d b2 8e ef 75 a9 df 92 cc 22 20 |b...,}...u...." | +00000040 66 08 85 22 d3 ea 5c 4c 4c c8 d7 17 03 03 00 40 |f.."..\LL......@| +00000050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| +00000060 f2 20 07 d2 13 ca ed 01 c9 7b 91 14 01 2c 08 f5 |. .......{...,..| +00000070 8a 69 94 bc 19 9a d9 65 6b 15 04 b4 45 17 ec 6f |.i.....ek...E..o| +00000080 85 de 31 dc a2 de 8b 4d 53 57 66 4a 29 21 5a 20 |..1....MSWfJ)!Z | +00000090 15 03 03 00 30 00 00 00 00 00 00 00 00 00 00 00 |....0...........| +000000a0 00 00 00 00 00 55 15 f7 89 8d 75 57 7e 92 db ec |.....U....uW~...| +000000b0 32 ec 07 5c 83 32 36 59 61 f1 9d a6 7a eb 76 c1 |2..\.26Ya...z.v.| +000000c0 c7 96 3f 4d 0a |..?M.| diff --git a/src/crypto/tls/testdata/Server-TLSv12-IssueTicket b/src/crypto/tls/testdata/Server-TLSv12-IssueTicket new file mode 100644 index 0000000000000000000000000000000000000000..20a0731091a6b0b679cacf92de0602b5f92917c9 --- /dev/null +++ b/src/crypto/tls/testdata/Server-TLSv12-IssueTicket @@ -0,0 +1,83 @@ +>>> Flow 1 (client to server) +00000000 16 03 01 00 5e 01 00 00 5a 03 03 f0 0a 06 d0 65 |....^...Z......e| +00000010 1c c3 90 ac dc 61 42 e5 b8 a9 17 fb e7 c3 1e bd |.....aB.........| +00000020 d9 09 5a 63 71 e2 f9 58 db 26 6e 00 00 04 00 05 |..Zcq..X.&n.....| +00000030 00 ff 01 00 00 2d 00 23 00 00 00 0d 00 20 00 1e |.....-.#..... ..| +00000040 06 01 06 02 06 03 05 01 05 02 05 03 04 01 04 02 |................| +00000050 04 03 03 01 03 02 03 03 02 01 02 02 02 03 00 0f |................| +00000060 00 01 01 |...| +>>> Flow 2 (server to client) +00000000 16 03 03 00 35 02 00 00 31 03 03 00 00 00 00 00 |....5...1.......| +00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| +00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 05 00 00 |................| +00000030 09 00 23 00 00 ff 01 00 01 00 16 03 03 02 71 0b |..#...........q.| +00000040 00 02 6d 00 02 6a 00 02 67 30 82 02 63 30 82 01 |..m..j..g0..c0..| +00000050 cc a0 03 02 01 02 02 09 00 a2 73 00 0c 81 00 cb |..........s.....| +00000060 f3 30 0d 06 09 2a 86 48 86 f7 0d 01 01 0b 05 00 |.0...*.H........| +00000070 30 2b 31 17 30 15 06 03 55 04 0a 13 0e 47 6f 6f |0+1.0...U....Goo| +00000080 67 6c 65 20 54 45 53 54 49 4e 47 31 10 30 0e 06 |gle TESTING1.0..| +00000090 03 55 04 03 13 07 47 6f 20 52 6f 6f 74 30 1e 17 |.U....Go Root0..| +000000a0 0d 31 35 30 31 30 31 30 30 30 30 30 30 5a 17 0d |.150101000000Z..| +000000b0 32 35 30 31 30 31 30 30 30 30 30 30 5a 30 26 31 |250101000000Z0&1| +000000c0 17 30 15 06 03 55 04 0a 13 0e 47 6f 6f 67 6c 65 |.0...U....Google| +000000d0 20 54 45 53 54 49 4e 47 31 0b 30 09 06 03 55 04 | TESTING1.0...U.| +000000e0 03 13 02 47 6f 30 81 9f 30 0d 06 09 2a 86 48 86 |...Go0..0...*.H.| +000000f0 f7 0d 01 01 01 05 00 03 81 8d 00 30 81 89 02 81 |...........0....| +00000100 81 00 af 87 88 f6 20 1b 95 65 6c 14 ab 44 05 af |...... ..el..D..| +00000110 3b 45 14 e3 b7 6d fd 00 63 4d 95 7f fe 6a 62 35 |;E...m..cM...jb5| +00000120 86 c0 4a f9 18 7c f6 aa 25 5e 7a 64 31 66 00 ba |..J..|..%^zd1f..| +00000130 f4 8e 92 af c7 6b d8 76 d4 f3 5f 41 cb 6e 56 15 |.....k.v.._A.nV.| +00000140 97 1b 97 c1 3c 12 39 21 66 3d 2b 16 d1 bc db 1c |....<.9!f=+.....| +00000150 c0 a7 da b7 ca ad ba da cb d5 21 50 ec de 8d ab |..........!P....| +00000160 d1 6b 81 4b 89 02 f3 c4 be c1 6c 89 b1 44 84 bd |.k.K......l..D..| +00000170 21 d1 04 7d 9d 16 4d f9 82 15 f6 ef fa d6 09 47 |!..}..M........G| +00000180 f2 fb 02 03 01 00 01 a3 81 93 30 81 90 30 0e 06 |..........0..0..| +00000190 03 55 1d 0f 01 01 ff 04 04 03 02 05 a0 30 1d 06 |.U...........0..| +000001a0 03 55 1d 25 04 16 30 14 06 08 2b 06 01 05 05 07 |.U.%..0...+.....| +000001b0 03 01 06 08 2b 06 01 05 05 07 03 02 30 0c 06 03 |....+.......0...| +000001c0 55 1d 13 01 01 ff 04 02 30 00 30 19 06 03 55 1d |U.......0.0...U.| +000001d0 0e 04 12 04 10 12 50 8d 89 6f 1b d1 dc 54 4d 6e |......P..o...TMn| +000001e0 cb 69 5e 06 f4 30 1b 06 03 55 1d 23 04 14 30 12 |.i^..0...U.#..0.| +000001f0 80 10 bf 3d b6 a9 66 f2 b8 40 cf ea b4 03 78 48 |...=..f..@....xH| +00000200 1a 41 30 19 06 03 55 1d 11 04 12 30 10 82 0e 65 |.A0...U....0...e| +00000210 78 61 6d 70 6c 65 2e 67 6f 6c 61 6e 67 30 0d 06 |xample.golang0..| +00000220 09 2a 86 48 86 f7 0d 01 01 0b 05 00 03 81 81 00 |.*.H............| +00000230 92 7c af 91 55 12 18 96 59 31 a6 48 40 d5 2d d5 |.|..U...Y1.H@.-.| +00000240 ee bb 02 a0 f5 c2 1e 7c 9b b3 30 7d 3c dc 76 da |.......|..0}<.v.| +00000250 4f 3d c0 fa ae 2d 33 24 6b 03 7b 1b 67 59 11 21 |O=...-3$k.{.gY.!| +00000260 b5 11 bc 77 b9 d9 e0 6e a8 2d 2e 35 fa 64 5f 22 |...w...n.-.5.d_"| +00000270 3e 63 10 6b be ff 14 86 6d 0d f0 15 31 a8 14 38 |>c.k....m...1..8| +00000280 1e 3b 84 87 2c cb 98 ed 51 76 b9 b1 4f dd db 9b |.;..,...Qv..O...| +00000290 84 04 86 40 fa 51 dd ba b4 8d eb e3 46 de 46 b9 |...@.Q......F.F.| +000002a0 4f 86 c7 f9 a4 c2 41 34 ac cc f6 ea b0 ab 39 18 |O.....A4......9.| +000002b0 16 03 03 00 04 0e 00 00 00 |.........| +>>> Flow 3 (client to server) +00000000 16 03 03 00 86 10 00 00 82 00 80 87 06 ba d7 1f |................| +00000010 68 0c f2 a6 51 b4 ae af 8c c5 5d d4 bd f1 82 6d |h...Q.....]....m| +00000020 1d dd ce 69 be 07 62 13 af 06 71 3a 47 a9 bd f7 |...i..b...q:G...| +00000030 bb 27 f0 38 df 88 01 40 29 c9 bb 7b 5d 6d 28 bd |.'.8...@)..{]m(.| +00000040 c8 28 e6 6d ff 5c c9 d3 c6 f5 06 17 e5 e5 1c 5b |.(.m.\.........[| +00000050 a1 18 7a 34 92 0a 39 20 5a 22 44 6c cc 5c 8c 83 |..z4..9 Z"Dl.\..| +00000060 d0 19 4c bb 4e dc e2 64 ec b2 b8 3f 18 3f 9d 65 |..L.N..d...?.?.e| +00000070 5b 89 26 ae f6 fd 54 71 c4 45 e9 56 6a 28 42 a9 |[.&...Tq.E.Vj(B.| +00000080 5b 9f 12 69 a4 08 83 53 95 04 18 14 03 03 00 01 |[..i...S........| +00000090 01 16 03 03 00 24 55 80 0f 43 c3 08 45 99 c9 1b |.....$U..C..E...| +000000a0 fd fe dd e8 48 f2 89 99 86 ef f7 fd 5f 2a 4b 0b |....H......._*K.| +000000b0 33 0e 5f 17 bb b7 a2 3c 9d 30 |3._....<.0| +>>> Flow 4 (server to client) +00000000 16 03 03 00 82 04 00 00 7e 00 00 00 00 00 78 50 |........~.....xP| +00000010 46 ad c1 db a8 38 86 7b 2b bb fd d0 c3 42 3e 00 |F....8.{+....B>.| +00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 94 |................| +00000030 6f 2c b5 83 61 c4 74 90 94 e5 6c fd 70 64 57 3a |o,..a.t...l.pdW:| +00000040 25 78 bf 9f a0 7c 51 bc 2a 69 1e b3 fd 71 34 b7 |%x...|Q.*i...q4.| +00000050 9a ef cb 49 37 f8 5d 5e 7c cf 6d fc 13 c1 52 79 |...I7.]^|.m...Ry| +00000060 8e ed c3 84 01 33 94 10 65 34 64 5e b4 9c 07 46 |.....3..e4d^...F| +00000070 5b 9e d7 5e 55 df fd c0 e9 d2 e8 d3 c6 42 18 ef |[..^U........B..| +00000080 a5 6c be e8 d2 49 c6 14 03 03 00 01 01 16 03 03 |.l...I..........| +00000090 00 24 66 94 4b b5 3f 5d 59 db 36 c1 dd 55 8c ee |.$f.K.?]Y.6..U..| +000000a0 de a4 bc d0 12 44 31 3e e4 e7 4a 51 e3 62 69 ab |.....D1>..JQ.bi.| +000000b0 14 78 85 49 a3 97 17 03 03 00 21 dd 96 5d 21 e0 |.x.I......!..]!.| +000000c0 2e 3d 33 dd 6c df bb 41 d7 bd 50 c7 1c 6f 97 34 |.=3.l..A..P..o.4| +000000d0 6a 6e d6 1d 27 81 2d f7 fb 32 85 02 15 03 03 00 |jn..'.-..2......| +000000e0 16 5e 4e 62 15 97 a7 a3 9b 1b 50 44 85 fb 28 66 |.^Nb......PD..(f| +000000f0 aa 66 54 45 c9 dc 61 |.fTE..a| diff --git a/src/crypto/tls/testdata/Server-TLSv12-IssueTicketPreDisable b/src/crypto/tls/testdata/Server-TLSv12-IssueTicketPreDisable new file mode 100644 index 0000000000000000000000000000000000000000..a8f7edfa2c011a6cafc4aa631128980832118014 --- /dev/null +++ b/src/crypto/tls/testdata/Server-TLSv12-IssueTicketPreDisable @@ -0,0 +1,83 @@ +>>> Flow 1 (client to server) +00000000 16 03 01 00 5e 01 00 00 5a 03 03 62 f6 20 66 23 |....^...Z..b. f#| +00000010 d5 71 0a c0 57 92 2e 80 b6 06 0c 54 5b 1c 77 a0 |.q..W......T[.w.| +00000020 ce 0b b2 52 4a b9 f2 c6 97 33 42 00 00 04 00 05 |...RJ....3B.....| +00000030 00 ff 01 00 00 2d 00 23 00 00 00 0d 00 20 00 1e |.....-.#..... ..| +00000040 06 01 06 02 06 03 05 01 05 02 05 03 04 01 04 02 |................| +00000050 04 03 03 01 03 02 03 03 02 01 02 02 02 03 00 0f |................| +00000060 00 01 01 |...| +>>> Flow 2 (server to client) +00000000 16 03 03 00 35 02 00 00 31 03 03 00 00 00 00 00 |....5...1.......| +00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| +00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 05 00 00 |................| +00000030 09 00 23 00 00 ff 01 00 01 00 16 03 03 02 71 0b |..#...........q.| +00000040 00 02 6d 00 02 6a 00 02 67 30 82 02 63 30 82 01 |..m..j..g0..c0..| +00000050 cc a0 03 02 01 02 02 09 00 a2 73 00 0c 81 00 cb |..........s.....| +00000060 f3 30 0d 06 09 2a 86 48 86 f7 0d 01 01 0b 05 00 |.0...*.H........| +00000070 30 2b 31 17 30 15 06 03 55 04 0a 13 0e 47 6f 6f |0+1.0...U....Goo| +00000080 67 6c 65 20 54 45 53 54 49 4e 47 31 10 30 0e 06 |gle TESTING1.0..| +00000090 03 55 04 03 13 07 47 6f 20 52 6f 6f 74 30 1e 17 |.U....Go Root0..| +000000a0 0d 31 35 30 31 30 31 30 30 30 30 30 30 5a 17 0d |.150101000000Z..| +000000b0 32 35 30 31 30 31 30 30 30 30 30 30 5a 30 26 31 |250101000000Z0&1| +000000c0 17 30 15 06 03 55 04 0a 13 0e 47 6f 6f 67 6c 65 |.0...U....Google| +000000d0 20 54 45 53 54 49 4e 47 31 0b 30 09 06 03 55 04 | TESTING1.0...U.| +000000e0 03 13 02 47 6f 30 81 9f 30 0d 06 09 2a 86 48 86 |...Go0..0...*.H.| +000000f0 f7 0d 01 01 01 05 00 03 81 8d 00 30 81 89 02 81 |...........0....| +00000100 81 00 af 87 88 f6 20 1b 95 65 6c 14 ab 44 05 af |...... ..el..D..| +00000110 3b 45 14 e3 b7 6d fd 00 63 4d 95 7f fe 6a 62 35 |;E...m..cM...jb5| +00000120 86 c0 4a f9 18 7c f6 aa 25 5e 7a 64 31 66 00 ba |..J..|..%^zd1f..| +00000130 f4 8e 92 af c7 6b d8 76 d4 f3 5f 41 cb 6e 56 15 |.....k.v.._A.nV.| +00000140 97 1b 97 c1 3c 12 39 21 66 3d 2b 16 d1 bc db 1c |....<.9!f=+.....| +00000150 c0 a7 da b7 ca ad ba da cb d5 21 50 ec de 8d ab |..........!P....| +00000160 d1 6b 81 4b 89 02 f3 c4 be c1 6c 89 b1 44 84 bd |.k.K......l..D..| +00000170 21 d1 04 7d 9d 16 4d f9 82 15 f6 ef fa d6 09 47 |!..}..M........G| +00000180 f2 fb 02 03 01 00 01 a3 81 93 30 81 90 30 0e 06 |..........0..0..| +00000190 03 55 1d 0f 01 01 ff 04 04 03 02 05 a0 30 1d 06 |.U...........0..| +000001a0 03 55 1d 25 04 16 30 14 06 08 2b 06 01 05 05 07 |.U.%..0...+.....| +000001b0 03 01 06 08 2b 06 01 05 05 07 03 02 30 0c 06 03 |....+.......0...| +000001c0 55 1d 13 01 01 ff 04 02 30 00 30 19 06 03 55 1d |U.......0.0...U.| +000001d0 0e 04 12 04 10 12 50 8d 89 6f 1b d1 dc 54 4d 6e |......P..o...TMn| +000001e0 cb 69 5e 06 f4 30 1b 06 03 55 1d 23 04 14 30 12 |.i^..0...U.#..0.| +000001f0 80 10 bf 3d b6 a9 66 f2 b8 40 cf ea b4 03 78 48 |...=..f..@....xH| +00000200 1a 41 30 19 06 03 55 1d 11 04 12 30 10 82 0e 65 |.A0...U....0...e| +00000210 78 61 6d 70 6c 65 2e 67 6f 6c 61 6e 67 30 0d 06 |xample.golang0..| +00000220 09 2a 86 48 86 f7 0d 01 01 0b 05 00 03 81 81 00 |.*.H............| +00000230 92 7c af 91 55 12 18 96 59 31 a6 48 40 d5 2d d5 |.|..U...Y1.H@.-.| +00000240 ee bb 02 a0 f5 c2 1e 7c 9b b3 30 7d 3c dc 76 da |.......|..0}<.v.| +00000250 4f 3d c0 fa ae 2d 33 24 6b 03 7b 1b 67 59 11 21 |O=...-3$k.{.gY.!| +00000260 b5 11 bc 77 b9 d9 e0 6e a8 2d 2e 35 fa 64 5f 22 |...w...n.-.5.d_"| +00000270 3e 63 10 6b be ff 14 86 6d 0d f0 15 31 a8 14 38 |>c.k....m...1..8| +00000280 1e 3b 84 87 2c cb 98 ed 51 76 b9 b1 4f dd db 9b |.;..,...Qv..O...| +00000290 84 04 86 40 fa 51 dd ba b4 8d eb e3 46 de 46 b9 |...@.Q......F.F.| +000002a0 4f 86 c7 f9 a4 c2 41 34 ac cc f6 ea b0 ab 39 18 |O.....A4......9.| +000002b0 16 03 03 00 04 0e 00 00 00 |.........| +>>> Flow 3 (client to server) +00000000 16 03 03 00 86 10 00 00 82 00 80 5b 43 6f db 52 |...........[Co.R| +00000010 56 e3 d9 4b 1e c8 95 8b 78 a6 19 00 44 9c 44 b4 |V..K....x...D.D.| +00000020 f7 fe d4 3f 69 ea 9c 67 d3 48 b8 c5 93 bc 22 f1 |...?i..g.H....".| +00000030 a9 0e 81 82 d0 cf dc 0b ea f0 02 67 92 8d 72 40 |...........g..r@| +00000040 25 bb f3 88 53 c0 2f ba 38 ef da d1 7c 73 84 ec |%...S./.8...|s..| +00000050 61 96 b9 d4 93 06 4a 06 7b 6d 40 e7 bb 15 59 6e |a.....J.{m@...Yn| +00000060 ad 31 71 eb cf 84 57 3b 0c ad aa 70 02 63 24 a9 |.1q...W;...p.c$.| +00000070 7c a1 9a 6d b7 e0 4c d5 67 4c ce 53 9d b6 31 de ||..m..L.gL.S..1.| +00000080 69 b9 f5 ca a8 e3 ea d6 f5 a3 f3 14 03 03 00 01 |i...............| +00000090 01 16 03 03 00 24 66 ae 13 67 70 20 f5 f5 76 03 |.....$f..gp ..v.| +000000a0 11 6e 32 a6 73 a2 70 42 ab 4f 16 93 d2 fa a1 ac |.n2.s.pB.O......| +000000b0 4e b2 08 4a a9 b5 20 aa 80 b6 |N..J.. ...| +>>> Flow 4 (server to client) +00000000 16 03 03 00 82 04 00 00 7e 00 00 00 00 00 78 50 |........~.....xP| +00000010 46 ad c1 db a8 38 86 7b 2b bb fd d0 c3 42 3e 00 |F....8.{+....B>.| +00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 94 |................| +00000030 6f 2c b5 83 61 bd 50 da 49 7f 8b 8f 58 57 00 a1 |o,..a.P.I...XW..| +00000040 11 0d 4a 9d 8a 39 dd 85 23 c0 eb 9d 1a 45 93 92 |..J..9..#....E..| +00000050 e7 af 15 a3 a4 48 da f9 a4 d8 8e cb 6c 3d 44 77 |.....H......l=Dw| +00000060 f9 c4 83 89 85 33 94 c1 c6 20 9a 73 44 83 89 5e |.....3... .sD..^| +00000070 59 ee 05 c6 7e 8d e9 7d 7b f8 84 46 b6 7d 43 ec |Y...~..}{..F.}C.| +00000080 f1 af 1f 0f 35 b4 1c 14 03 03 00 01 01 16 03 03 |....5...........| +00000090 00 24 8c 0d bd bc 34 93 ed ad 80 21 6d 08 e4 0e |.$....4....!m...| +000000a0 67 4f 99 8d df 2a 2d 4f 13 39 82 be a1 d2 1f 75 |gO...*-O.9.....u| +000000b0 73 c8 b2 ce 41 0c 17 03 03 00 21 d8 c2 50 d6 11 |s...A.....!..P..| +000000c0 bc 86 58 68 0e 60 4a 47 a5 d0 12 7e a3 b5 be 64 |..Xh.`JG...~...d| +000000d0 e6 b1 bc 62 70 85 d4 7c cd fe 67 cf 15 03 03 00 |...bp..|..g.....| +000000e0 16 e4 1c d5 f4 f7 d0 f5 b2 b3 2b 3d b0 7d c0 23 |..........+=.}.#| +000000f0 e2 5c a5 c7 a4 23 fa |.\...#.| diff --git a/src/crypto/tls/testdata/Server-TLSv12-RSA-3DES b/src/crypto/tls/testdata/Server-TLSv12-RSA-3DES new file mode 100644 index 0000000000000000000000000000000000000000..74576264d856b786f17f7ff09a0d86cec6365197 --- /dev/null +++ b/src/crypto/tls/testdata/Server-TLSv12-RSA-3DES @@ -0,0 +1,77 @@ +>>> Flow 1 (client to server) +00000000 16 03 01 00 5a 01 00 00 56 03 03 ac 1d 0b 6e f3 |....Z...V.....n.| +00000010 25 04 00 97 a0 79 39 c5 ef 95 8b e3 c1 87 0d 1c |%....y9.........| +00000020 0b c3 39 3e ff 23 0e 3c 28 8f 75 00 00 04 00 0a |..9>.#.<(.u.....| +00000030 00 ff 01 00 00 29 00 0d 00 20 00 1e 06 01 06 02 |.....)... ......| +00000040 06 03 05 01 05 02 05 03 04 01 04 02 04 03 03 01 |................| +00000050 03 02 03 03 02 01 02 02 02 03 00 0f 00 01 01 |...............| +>>> Flow 2 (server to client) +00000000 16 03 03 00 31 02 00 00 2d 03 03 00 00 00 00 00 |....1...-.......| +00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| +00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 0a 00 00 |................| +00000030 05 ff 01 00 01 00 16 03 03 02 71 0b 00 02 6d 00 |..........q...m.| +00000040 02 6a 00 02 67 30 82 02 63 30 82 01 cc a0 03 02 |.j..g0..c0......| +00000050 01 02 02 09 00 a2 73 00 0c 81 00 cb f3 30 0d 06 |......s......0..| +00000060 09 2a 86 48 86 f7 0d 01 01 0b 05 00 30 2b 31 17 |.*.H........0+1.| +00000070 30 15 06 03 55 04 0a 13 0e 47 6f 6f 67 6c 65 20 |0...U....Google | +00000080 54 45 53 54 49 4e 47 31 10 30 0e 06 03 55 04 03 |TESTING1.0...U..| +00000090 13 07 47 6f 20 52 6f 6f 74 30 1e 17 0d 31 35 30 |..Go Root0...150| +000000a0 31 30 31 30 30 30 30 30 30 5a 17 0d 32 35 30 31 |101000000Z..2501| +000000b0 30 31 30 30 30 30 30 30 5a 30 26 31 17 30 15 06 |01000000Z0&1.0..| +000000c0 03 55 04 0a 13 0e 47 6f 6f 67 6c 65 20 54 45 53 |.U....Google TES| +000000d0 54 49 4e 47 31 0b 30 09 06 03 55 04 03 13 02 47 |TING1.0...U....G| +000000e0 6f 30 81 9f 30 0d 06 09 2a 86 48 86 f7 0d 01 01 |o0..0...*.H.....| +000000f0 01 05 00 03 81 8d 00 30 81 89 02 81 81 00 af 87 |.......0........| +00000100 88 f6 20 1b 95 65 6c 14 ab 44 05 af 3b 45 14 e3 |.. ..el..D..;E..| +00000110 b7 6d fd 00 63 4d 95 7f fe 6a 62 35 86 c0 4a f9 |.m..cM...jb5..J.| +00000120 18 7c f6 aa 25 5e 7a 64 31 66 00 ba f4 8e 92 af |.|..%^zd1f......| +00000130 c7 6b d8 76 d4 f3 5f 41 cb 6e 56 15 97 1b 97 c1 |.k.v.._A.nV.....| +00000140 3c 12 39 21 66 3d 2b 16 d1 bc db 1c c0 a7 da b7 |<.9!f=+.........| +00000150 ca ad ba da cb d5 21 50 ec de 8d ab d1 6b 81 4b |......!P.....k.K| +00000160 89 02 f3 c4 be c1 6c 89 b1 44 84 bd 21 d1 04 7d |......l..D..!..}| +00000170 9d 16 4d f9 82 15 f6 ef fa d6 09 47 f2 fb 02 03 |..M........G....| +00000180 01 00 01 a3 81 93 30 81 90 30 0e 06 03 55 1d 0f |......0..0...U..| +00000190 01 01 ff 04 04 03 02 05 a0 30 1d 06 03 55 1d 25 |.........0...U.%| +000001a0 04 16 30 14 06 08 2b 06 01 05 05 07 03 01 06 08 |..0...+.........| +000001b0 2b 06 01 05 05 07 03 02 30 0c 06 03 55 1d 13 01 |+.......0...U...| +000001c0 01 ff 04 02 30 00 30 19 06 03 55 1d 0e 04 12 04 |....0.0...U.....| +000001d0 10 12 50 8d 89 6f 1b d1 dc 54 4d 6e cb 69 5e 06 |..P..o...TMn.i^.| +000001e0 f4 30 1b 06 03 55 1d 23 04 14 30 12 80 10 bf 3d |.0...U.#..0....=| +000001f0 b6 a9 66 f2 b8 40 cf ea b4 03 78 48 1a 41 30 19 |..f..@....xH.A0.| +00000200 06 03 55 1d 11 04 12 30 10 82 0e 65 78 61 6d 70 |..U....0...examp| +00000210 6c 65 2e 67 6f 6c 61 6e 67 30 0d 06 09 2a 86 48 |le.golang0...*.H| +00000220 86 f7 0d 01 01 0b 05 00 03 81 81 00 92 7c af 91 |.............|..| +00000230 55 12 18 96 59 31 a6 48 40 d5 2d d5 ee bb 02 a0 |U...Y1.H@.-.....| +00000240 f5 c2 1e 7c 9b b3 30 7d 3c dc 76 da 4f 3d c0 fa |...|..0}<.v.O=..| +00000250 ae 2d 33 24 6b 03 7b 1b 67 59 11 21 b5 11 bc 77 |.-3$k.{.gY.!...w| +00000260 b9 d9 e0 6e a8 2d 2e 35 fa 64 5f 22 3e 63 10 6b |...n.-.5.d_">c.k| +00000270 be ff 14 86 6d 0d f0 15 31 a8 14 38 1e 3b 84 87 |....m...1..8.;..| +00000280 2c cb 98 ed 51 76 b9 b1 4f dd db 9b 84 04 86 40 |,...Qv..O......@| +00000290 fa 51 dd ba b4 8d eb e3 46 de 46 b9 4f 86 c7 f9 |.Q......F.F.O...| +000002a0 a4 c2 41 34 ac cc f6 ea b0 ab 39 18 16 03 03 00 |..A4......9.....| +000002b0 04 0e 00 00 00 |.....| +>>> Flow 3 (client to server) +00000000 16 03 03 00 86 10 00 00 82 00 80 15 75 c5 63 e0 |............u.c.| +00000010 c3 a5 89 dd b3 bf 03 1d bd 62 86 2e 10 98 79 cb |.........b....y.| +00000020 40 3d 9b 36 7e 55 65 d7 80 0a c5 24 ff ad 98 d5 |@=.6~Ue....$....| +00000030 d4 d9 4e 1b ed 50 0a fa 8a 3e f3 01 c4 e3 47 f7 |..N..P...>....G.| +00000040 bd 81 fc 33 0b 61 6b b5 3f 38 9b 24 cd 7d 46 66 |...3.ak.?8.$.}Ff| +00000050 18 87 ea 67 04 b7 ad 23 ac 64 4e 21 cd 29 9f 60 |...g...#.dN!.).`| +00000060 0e c1 ca 3d 25 d6 d5 2b e2 60 dc b5 57 be c0 b8 |...=%..+.`..W...| +00000070 b6 35 25 96 5b 36 55 53 86 b7 90 ef 6c bf 45 2a |.5%.[6US....l.E*| +00000080 3d a0 af 08 f0 8a 9c d0 d8 6b 88 14 03 03 00 01 |=........k......| +00000090 01 16 03 03 00 30 c5 0f b8 12 c6 5a 42 6a d8 3f |.....0.....ZBj.?| +000000a0 f5 49 e4 9a 5d b7 93 90 e7 09 1f 68 40 9d 33 a9 |.I..]......h@.3.| +000000b0 21 fa 9c 12 c7 7c d4 bf 91 c2 f8 ac 27 b9 8b b6 |!....|......'...| +000000c0 34 6e f3 c0 fb 83 |4n....| +>>> Flow 4 (server to client) +00000000 14 03 03 00 01 01 16 03 03 00 30 00 00 00 00 00 |..........0.....| +00000010 00 00 00 c1 a2 65 c1 36 63 85 cd ca 5a eb 50 ab |.....e.6c...Z.P.| +00000020 bb ec 43 30 37 8f 71 b9 b7 2d 1b bb a2 88 fa d5 |..C07.q..-......| +00000030 b4 a5 c5 4b 19 71 53 46 7d bb d0 17 03 03 00 30 |...K.qSF}......0| +00000040 00 00 00 00 00 00 00 00 6a a1 3d c6 35 a0 58 c4 |........j.=.5.X.| +00000050 ef 12 f2 59 1e 02 42 33 42 5f fe 87 a2 1a ce b7 |...Y..B3B_......| +00000060 0d d2 36 7c 7f 1a 4c 79 1f 38 34 58 b3 05 fb 96 |..6|..Ly.84X....| +00000070 15 03 03 00 20 00 00 00 00 00 00 00 00 a1 89 42 |.... ..........B| +00000080 bc 58 1f 2f 9b c4 d7 e2 d1 ce 1c c9 e0 a5 47 be |.X./..........G.| +00000090 63 0c a4 bf 26 |c...&| diff --git a/src/crypto/tls/testdata/Server-TLSv12-RSA-AES b/src/crypto/tls/testdata/Server-TLSv12-RSA-AES new file mode 100644 index 0000000000000000000000000000000000000000..4ca860d2c262724979c330d23f05088258611fa2 --- /dev/null +++ b/src/crypto/tls/testdata/Server-TLSv12-RSA-AES @@ -0,0 +1,81 @@ +>>> Flow 1 (client to server) +00000000 16 03 01 00 5a 01 00 00 56 03 03 be 9a 2f 46 66 |....Z...V..../Ff| +00000010 a3 b3 10 62 63 b6 32 cb de 1e eb 76 13 50 60 d0 |...bc.2....v.P`.| +00000020 ee 40 a9 cd 50 ae d8 86 10 37 8b 00 00 04 00 2f |.@..P....7...../| +00000030 00 ff 01 00 00 29 00 0d 00 20 00 1e 06 01 06 02 |.....)... ......| +00000040 06 03 05 01 05 02 05 03 04 01 04 02 04 03 03 01 |................| +00000050 03 02 03 03 02 01 02 02 02 03 00 0f 00 01 01 |...............| +>>> Flow 2 (server to client) +00000000 16 03 03 00 31 02 00 00 2d 03 03 00 00 00 00 00 |....1...-.......| +00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| +00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 2f 00 00 |............./..| +00000030 05 ff 01 00 01 00 16 03 03 02 71 0b 00 02 6d 00 |..........q...m.| +00000040 02 6a 00 02 67 30 82 02 63 30 82 01 cc a0 03 02 |.j..g0..c0......| +00000050 01 02 02 09 00 a2 73 00 0c 81 00 cb f3 30 0d 06 |......s......0..| +00000060 09 2a 86 48 86 f7 0d 01 01 0b 05 00 30 2b 31 17 |.*.H........0+1.| +00000070 30 15 06 03 55 04 0a 13 0e 47 6f 6f 67 6c 65 20 |0...U....Google | +00000080 54 45 53 54 49 4e 47 31 10 30 0e 06 03 55 04 03 |TESTING1.0...U..| +00000090 13 07 47 6f 20 52 6f 6f 74 30 1e 17 0d 31 35 30 |..Go Root0...150| +000000a0 31 30 31 30 30 30 30 30 30 5a 17 0d 32 35 30 31 |101000000Z..2501| +000000b0 30 31 30 30 30 30 30 30 5a 30 26 31 17 30 15 06 |01000000Z0&1.0..| +000000c0 03 55 04 0a 13 0e 47 6f 6f 67 6c 65 20 54 45 53 |.U....Google TES| +000000d0 54 49 4e 47 31 0b 30 09 06 03 55 04 03 13 02 47 |TING1.0...U....G| +000000e0 6f 30 81 9f 30 0d 06 09 2a 86 48 86 f7 0d 01 01 |o0..0...*.H.....| +000000f0 01 05 00 03 81 8d 00 30 81 89 02 81 81 00 af 87 |.......0........| +00000100 88 f6 20 1b 95 65 6c 14 ab 44 05 af 3b 45 14 e3 |.. ..el..D..;E..| +00000110 b7 6d fd 00 63 4d 95 7f fe 6a 62 35 86 c0 4a f9 |.m..cM...jb5..J.| +00000120 18 7c f6 aa 25 5e 7a 64 31 66 00 ba f4 8e 92 af |.|..%^zd1f......| +00000130 c7 6b d8 76 d4 f3 5f 41 cb 6e 56 15 97 1b 97 c1 |.k.v.._A.nV.....| +00000140 3c 12 39 21 66 3d 2b 16 d1 bc db 1c c0 a7 da b7 |<.9!f=+.........| +00000150 ca ad ba da cb d5 21 50 ec de 8d ab d1 6b 81 4b |......!P.....k.K| +00000160 89 02 f3 c4 be c1 6c 89 b1 44 84 bd 21 d1 04 7d |......l..D..!..}| +00000170 9d 16 4d f9 82 15 f6 ef fa d6 09 47 f2 fb 02 03 |..M........G....| +00000180 01 00 01 a3 81 93 30 81 90 30 0e 06 03 55 1d 0f |......0..0...U..| +00000190 01 01 ff 04 04 03 02 05 a0 30 1d 06 03 55 1d 25 |.........0...U.%| +000001a0 04 16 30 14 06 08 2b 06 01 05 05 07 03 01 06 08 |..0...+.........| +000001b0 2b 06 01 05 05 07 03 02 30 0c 06 03 55 1d 13 01 |+.......0...U...| +000001c0 01 ff 04 02 30 00 30 19 06 03 55 1d 0e 04 12 04 |....0.0...U.....| +000001d0 10 12 50 8d 89 6f 1b d1 dc 54 4d 6e cb 69 5e 06 |..P..o...TMn.i^.| +000001e0 f4 30 1b 06 03 55 1d 23 04 14 30 12 80 10 bf 3d |.0...U.#..0....=| +000001f0 b6 a9 66 f2 b8 40 cf ea b4 03 78 48 1a 41 30 19 |..f..@....xH.A0.| +00000200 06 03 55 1d 11 04 12 30 10 82 0e 65 78 61 6d 70 |..U....0...examp| +00000210 6c 65 2e 67 6f 6c 61 6e 67 30 0d 06 09 2a 86 48 |le.golang0...*.H| +00000220 86 f7 0d 01 01 0b 05 00 03 81 81 00 92 7c af 91 |.............|..| +00000230 55 12 18 96 59 31 a6 48 40 d5 2d d5 ee bb 02 a0 |U...Y1.H@.-.....| +00000240 f5 c2 1e 7c 9b b3 30 7d 3c dc 76 da 4f 3d c0 fa |...|..0}<.v.O=..| +00000250 ae 2d 33 24 6b 03 7b 1b 67 59 11 21 b5 11 bc 77 |.-3$k.{.gY.!...w| +00000260 b9 d9 e0 6e a8 2d 2e 35 fa 64 5f 22 3e 63 10 6b |...n.-.5.d_">c.k| +00000270 be ff 14 86 6d 0d f0 15 31 a8 14 38 1e 3b 84 87 |....m...1..8.;..| +00000280 2c cb 98 ed 51 76 b9 b1 4f dd db 9b 84 04 86 40 |,...Qv..O......@| +00000290 fa 51 dd ba b4 8d eb e3 46 de 46 b9 4f 86 c7 f9 |.Q......F.F.O...| +000002a0 a4 c2 41 34 ac cc f6 ea b0 ab 39 18 16 03 03 00 |..A4......9.....| +000002b0 04 0e 00 00 00 |.....| +>>> Flow 3 (client to server) +00000000 16 03 03 00 86 10 00 00 82 00 80 61 b4 31 93 2b |...........a.1.+| +00000010 d5 e8 06 74 b1 f6 d6 5f a3 92 78 b6 cf bf 7f ea |...t..._..x.....| +00000020 a2 07 1e 90 94 68 5b 19 ae d4 e3 11 78 96 58 fd |.....h[.....x.X.| +00000030 96 18 f2 09 58 dc 39 a1 d9 9e 83 f0 24 45 6e 6b |....X.9.....$Enk| +00000040 e6 5e e7 cb 94 42 00 10 64 d5 d2 bc 80 23 bd fe |.^...B..d....#..| +00000050 5c 3e 3a 80 ff 38 b8 dc ff 25 ba b0 0a cc ef 94 |\>:..8...%......| +00000060 a1 31 bd 04 93 91 86 6e 8b fd a1 9d 01 ee 91 a6 |.1.....n........| +00000070 44 8b 21 55 52 67 3e b1 e4 6e bd 1f 07 85 e1 97 |D.!URg>..n......| +00000080 7f 55 70 00 5f f4 4b e6 50 45 f7 14 03 03 00 01 |.Up._.K.PE......| +00000090 01 16 03 03 00 40 71 ff ab 6d 79 3c da dc 5b 34 |.....@q..my<..[4| +000000a0 48 39 48 08 e3 29 cb 53 21 fd 67 93 0b f8 81 47 |H9H..).S!.g....G| +000000b0 40 7f 23 50 5f 94 db 2b 7b 7e 9f 0b bf 38 59 d9 |@.#P_..+{~...8Y.| +000000c0 6b 57 8f 1e 83 eb 93 2c 62 12 31 c6 f5 21 f2 22 |kW.....,b.1..!."| +000000d0 7a 82 e9 e6 ec 38 |z....8| +>>> Flow 4 (server to client) +00000000 14 03 03 00 01 01 16 03 03 00 40 00 00 00 00 00 |..........@.....| +00000010 00 00 00 00 00 00 00 00 00 00 00 45 87 33 41 c1 |...........E.3A.| +00000020 b8 e7 4c 11 1c 1b 7b 55 51 85 06 01 c1 b6 87 6b |..L...{UQ......k| +00000030 01 b3 56 c4 5a 37 ea b6 3a c4 b0 da 1b 5c 15 d4 |..V.Z7..:....\..| +00000040 03 5a 57 e9 9a 56 16 a5 fa 77 1c 17 03 03 00 40 |.ZW..V...w.....@| +00000050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| +00000060 6f 2e 7c ba 3d 85 4c 7b 1f 13 a5 d6 97 e6 67 f4 |o.|.=.L{......g.| +00000070 24 d5 a8 d4 26 41 64 0a fd b3 2e a0 a2 7a 2b 54 |$...&Ad......z+T| +00000080 a4 1d 6e fe 4c c4 73 e3 76 d0 3a 60 52 df b0 53 |..n.L.s.v.:`R..S| +00000090 15 03 03 00 30 00 00 00 00 00 00 00 00 00 00 00 |....0...........| +000000a0 00 00 00 00 00 8b 0a 6d 14 3b 84 bc 7d c6 8d 9d |.......m.;..}...| +000000b0 d5 27 32 84 4b 14 75 42 0f aa 5e 88 ba fa a2 c7 |.'2.K.uB..^.....| +000000c0 16 93 8a c4 fd |.....| diff --git a/src/crypto/tls/testdata/Server-TLSv12-RSA-AES-GCM b/src/crypto/tls/testdata/Server-TLSv12-RSA-AES-GCM new file mode 100644 index 0000000000000000000000000000000000000000..7a26ebd82a76a932e791f5080e03528826d5595e --- /dev/null +++ b/src/crypto/tls/testdata/Server-TLSv12-RSA-AES-GCM @@ -0,0 +1,87 @@ +>>> Flow 1 (client to server) +00000000 16 03 01 00 9a 01 00 00 96 03 03 16 dc f8 f5 3a |...............:| +00000010 13 32 e6 1f bd f6 3c 66 b7 4c 67 17 ee b2 2a ba |.2....>> Flow 2 (server to client) +00000000 16 03 03 00 31 02 00 00 2d 03 03 00 00 00 00 00 |....1...-.......| +00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| +00000020 00 00 00 00 00 00 00 00 00 00 00 00 c0 2f 00 00 |............./..| +00000030 05 ff 01 00 01 00 16 03 03 02 71 0b 00 02 6d 00 |..........q...m.| +00000040 02 6a 00 02 67 30 82 02 63 30 82 01 cc a0 03 02 |.j..g0..c0......| +00000050 01 02 02 09 00 a2 73 00 0c 81 00 cb f3 30 0d 06 |......s......0..| +00000060 09 2a 86 48 86 f7 0d 01 01 0b 05 00 30 2b 31 17 |.*.H........0+1.| +00000070 30 15 06 03 55 04 0a 13 0e 47 6f 6f 67 6c 65 20 |0...U....Google | +00000080 54 45 53 54 49 4e 47 31 10 30 0e 06 03 55 04 03 |TESTING1.0...U..| +00000090 13 07 47 6f 20 52 6f 6f 74 30 1e 17 0d 31 35 30 |..Go Root0...150| +000000a0 31 30 31 30 30 30 30 30 30 5a 17 0d 32 35 30 31 |101000000Z..2501| +000000b0 30 31 30 30 30 30 30 30 5a 30 26 31 17 30 15 06 |01000000Z0&1.0..| +000000c0 03 55 04 0a 13 0e 47 6f 6f 67 6c 65 20 54 45 53 |.U....Google TES| +000000d0 54 49 4e 47 31 0b 30 09 06 03 55 04 03 13 02 47 |TING1.0...U....G| +000000e0 6f 30 81 9f 30 0d 06 09 2a 86 48 86 f7 0d 01 01 |o0..0...*.H.....| +000000f0 01 05 00 03 81 8d 00 30 81 89 02 81 81 00 af 87 |.......0........| +00000100 88 f6 20 1b 95 65 6c 14 ab 44 05 af 3b 45 14 e3 |.. ..el..D..;E..| +00000110 b7 6d fd 00 63 4d 95 7f fe 6a 62 35 86 c0 4a f9 |.m..cM...jb5..J.| +00000120 18 7c f6 aa 25 5e 7a 64 31 66 00 ba f4 8e 92 af |.|..%^zd1f......| +00000130 c7 6b d8 76 d4 f3 5f 41 cb 6e 56 15 97 1b 97 c1 |.k.v.._A.nV.....| +00000140 3c 12 39 21 66 3d 2b 16 d1 bc db 1c c0 a7 da b7 |<.9!f=+.........| +00000150 ca ad ba da cb d5 21 50 ec de 8d ab d1 6b 81 4b |......!P.....k.K| +00000160 89 02 f3 c4 be c1 6c 89 b1 44 84 bd 21 d1 04 7d |......l..D..!..}| +00000170 9d 16 4d f9 82 15 f6 ef fa d6 09 47 f2 fb 02 03 |..M........G....| +00000180 01 00 01 a3 81 93 30 81 90 30 0e 06 03 55 1d 0f |......0..0...U..| +00000190 01 01 ff 04 04 03 02 05 a0 30 1d 06 03 55 1d 25 |.........0...U.%| +000001a0 04 16 30 14 06 08 2b 06 01 05 05 07 03 01 06 08 |..0...+.........| +000001b0 2b 06 01 05 05 07 03 02 30 0c 06 03 55 1d 13 01 |+.......0...U...| +000001c0 01 ff 04 02 30 00 30 19 06 03 55 1d 0e 04 12 04 |....0.0...U.....| +000001d0 10 12 50 8d 89 6f 1b d1 dc 54 4d 6e cb 69 5e 06 |..P..o...TMn.i^.| +000001e0 f4 30 1b 06 03 55 1d 23 04 14 30 12 80 10 bf 3d |.0...U.#..0....=| +000001f0 b6 a9 66 f2 b8 40 cf ea b4 03 78 48 1a 41 30 19 |..f..@....xH.A0.| +00000200 06 03 55 1d 11 04 12 30 10 82 0e 65 78 61 6d 70 |..U....0...examp| +00000210 6c 65 2e 67 6f 6c 61 6e 67 30 0d 06 09 2a 86 48 |le.golang0...*.H| +00000220 86 f7 0d 01 01 0b 05 00 03 81 81 00 92 7c af 91 |.............|..| +00000230 55 12 18 96 59 31 a6 48 40 d5 2d d5 ee bb 02 a0 |U...Y1.H@.-.....| +00000240 f5 c2 1e 7c 9b b3 30 7d 3c dc 76 da 4f 3d c0 fa |...|..0}<.v.O=..| +00000250 ae 2d 33 24 6b 03 7b 1b 67 59 11 21 b5 11 bc 77 |.-3$k.{.gY.!...w| +00000260 b9 d9 e0 6e a8 2d 2e 35 fa 64 5f 22 3e 63 10 6b |...n.-.5.d_">c.k| +00000270 be ff 14 86 6d 0d f0 15 31 a8 14 38 1e 3b 84 87 |....m...1..8.;..| +00000280 2c cb 98 ed 51 76 b9 b1 4f dd db 9b 84 04 86 40 |,...Qv..O......@| +00000290 fa 51 dd ba b4 8d eb e3 46 de 46 b9 4f 86 c7 f9 |.Q......F.F.O...| +000002a0 a4 c2 41 34 ac cc f6 ea b0 ab 39 18 16 03 03 00 |..A4......9.....| +000002b0 cd 0c 00 00 c9 03 00 17 41 04 1e 18 37 ef 0d 19 |........A...7...| +000002c0 51 88 35 75 71 b5 e5 54 5b 12 2e 8f 09 67 fd a7 |Q.5uq..T[....g..| +000002d0 24 20 3e b2 56 1c ce 97 28 5e f8 2b 2d 4f 9e f1 |$ >.V...(^.+-O..| +000002e0 07 9f 6c 4b 5b 83 56 e2 32 42 e9 58 b6 d7 49 a6 |..lK[.V.2B.X..I.| +000002f0 b5 68 1a 41 03 56 6b dc 5a 89 05 01 00 80 40 b3 |.h.A.Vk.Z.....@.| +00000300 66 ee 53 3c 80 f4 da d1 de e6 fe 50 c8 89 60 d5 |f.S<.......P..`.| +00000310 e4 80 73 39 91 79 6c cf 89 bb a5 da e4 c7 e5 0d |..s9.yl.........| +00000320 13 a6 76 24 65 1a a2 b8 cb 95 c2 c6 9d 66 74 57 |..v$e........ftW| +00000330 9e 90 4f 48 77 88 3a b4 f3 fa 88 ab 61 22 d3 40 |..OHw.:.....a".@| +00000340 08 c4 0a 69 19 ed c3 ea d8 15 79 12 d5 ac 8d af |...i......y.....| +00000350 41 7d 87 4b a9 ff f8 cb 24 55 88 38 34 11 a5 bd |A}.K....$U.84...| +00000360 c1 d6 e5 86 d5 64 b5 f2 df c8 03 f2 a2 6b ff f4 |.....d.......k..| +00000370 a8 38 e0 18 04 d4 cd bd e0 cc 63 fc 3f 8b 16 03 |.8........c.?...| +00000380 03 00 04 0e 00 00 00 |.......| +>>> Flow 3 (client to server) +00000000 16 03 03 00 46 10 00 00 42 41 04 de de ff 8c df |....F...BA......| +00000010 d8 4c 72 af 29 3c 4d e0 ed 0f 34 cc fd 2d 52 63 |.Lr.)>> Flow 4 (server to client) +00000000 14 03 03 00 01 01 16 03 03 00 28 00 00 00 00 00 |..........(.....| +00000010 00 00 00 92 90 01 f0 70 fa 57 2e 40 d3 4c ef 6a |.......p.W.@.L.j| +00000020 03 0c 56 65 f7 c0 3b d0 8a db 48 c9 ae 58 3e 7c |..Ve..;...H..X>|| +00000030 d1 48 67 17 03 03 00 25 00 00 00 00 00 00 00 01 |.Hg....%........| +00000040 9e 35 a0 13 73 da 3f 26 ff 1d 90 08 e9 cc 40 7e |.5..s.?&......@~| +00000050 82 f3 5e 6e b4 8e 5a 39 7f a4 09 60 b2 15 03 03 |..^n..Z9...`....| +00000060 00 1a 00 00 00 00 00 00 00 02 04 95 9b 2d 17 1c |.............-..| +00000070 6a bc 26 f7 6c 8e f1 c0 0e 82 4a 44 |j.&.l.....JD| diff --git a/src/crypto/tls/testdata/Server-TLSv12-RSA-AES256-GCM-SHA384 b/src/crypto/tls/testdata/Server-TLSv12-RSA-AES256-GCM-SHA384 new file mode 100644 index 0000000000000000000000000000000000000000..d59645c52dbab83daf276ca6a8937e3d725bb814 --- /dev/null +++ b/src/crypto/tls/testdata/Server-TLSv12-RSA-AES256-GCM-SHA384 @@ -0,0 +1,87 @@ +>>> Flow 1 (client to server) +00000000 16 03 01 00 9a 01 00 00 96 03 03 5d 6b 2a ff 74 |...........]k*.t| +00000010 88 f1 68 8d 1b eb c3 84 34 b5 19 0a 7d f1 9a 0f |..h.....4...}...| +00000020 4d c3 0a d7 98 b8 72 e0 73 e4 38 00 00 04 c0 30 |M.....r.s.8....0| +00000030 00 ff 01 00 00 69 00 0b 00 04 03 00 01 02 00 0a |.....i..........| +00000040 00 34 00 32 00 0e 00 0d 00 19 00 0b 00 0c 00 18 |.4.2............| +00000050 00 09 00 0a 00 16 00 17 00 08 00 06 00 07 00 14 |................| +00000060 00 15 00 04 00 05 00 12 00 13 00 01 00 02 00 03 |................| +00000070 00 0f 00 10 00 11 00 0d 00 20 00 1e 06 01 06 02 |......... ......| +00000080 06 03 05 01 05 02 05 03 04 01 04 02 04 03 03 01 |................| +00000090 03 02 03 03 02 01 02 02 02 03 00 0f 00 01 01 |...............| +>>> Flow 2 (server to client) +00000000 16 03 03 00 31 02 00 00 2d 03 03 00 00 00 00 00 |....1...-.......| +00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| +00000020 00 00 00 00 00 00 00 00 00 00 00 00 c0 30 00 00 |.............0..| +00000030 05 ff 01 00 01 00 16 03 03 02 71 0b 00 02 6d 00 |..........q...m.| +00000040 02 6a 00 02 67 30 82 02 63 30 82 01 cc a0 03 02 |.j..g0..c0......| +00000050 01 02 02 09 00 a2 73 00 0c 81 00 cb f3 30 0d 06 |......s......0..| +00000060 09 2a 86 48 86 f7 0d 01 01 0b 05 00 30 2b 31 17 |.*.H........0+1.| +00000070 30 15 06 03 55 04 0a 13 0e 47 6f 6f 67 6c 65 20 |0...U....Google | +00000080 54 45 53 54 49 4e 47 31 10 30 0e 06 03 55 04 03 |TESTING1.0...U..| +00000090 13 07 47 6f 20 52 6f 6f 74 30 1e 17 0d 31 35 30 |..Go Root0...150| +000000a0 31 30 31 30 30 30 30 30 30 5a 17 0d 32 35 30 31 |101000000Z..2501| +000000b0 30 31 30 30 30 30 30 30 5a 30 26 31 17 30 15 06 |01000000Z0&1.0..| +000000c0 03 55 04 0a 13 0e 47 6f 6f 67 6c 65 20 54 45 53 |.U....Google TES| +000000d0 54 49 4e 47 31 0b 30 09 06 03 55 04 03 13 02 47 |TING1.0...U....G| +000000e0 6f 30 81 9f 30 0d 06 09 2a 86 48 86 f7 0d 01 01 |o0..0...*.H.....| +000000f0 01 05 00 03 81 8d 00 30 81 89 02 81 81 00 af 87 |.......0........| +00000100 88 f6 20 1b 95 65 6c 14 ab 44 05 af 3b 45 14 e3 |.. ..el..D..;E..| +00000110 b7 6d fd 00 63 4d 95 7f fe 6a 62 35 86 c0 4a f9 |.m..cM...jb5..J.| +00000120 18 7c f6 aa 25 5e 7a 64 31 66 00 ba f4 8e 92 af |.|..%^zd1f......| +00000130 c7 6b d8 76 d4 f3 5f 41 cb 6e 56 15 97 1b 97 c1 |.k.v.._A.nV.....| +00000140 3c 12 39 21 66 3d 2b 16 d1 bc db 1c c0 a7 da b7 |<.9!f=+.........| +00000150 ca ad ba da cb d5 21 50 ec de 8d ab d1 6b 81 4b |......!P.....k.K| +00000160 89 02 f3 c4 be c1 6c 89 b1 44 84 bd 21 d1 04 7d |......l..D..!..}| +00000170 9d 16 4d f9 82 15 f6 ef fa d6 09 47 f2 fb 02 03 |..M........G....| +00000180 01 00 01 a3 81 93 30 81 90 30 0e 06 03 55 1d 0f |......0..0...U..| +00000190 01 01 ff 04 04 03 02 05 a0 30 1d 06 03 55 1d 25 |.........0...U.%| +000001a0 04 16 30 14 06 08 2b 06 01 05 05 07 03 01 06 08 |..0...+.........| +000001b0 2b 06 01 05 05 07 03 02 30 0c 06 03 55 1d 13 01 |+.......0...U...| +000001c0 01 ff 04 02 30 00 30 19 06 03 55 1d 0e 04 12 04 |....0.0...U.....| +000001d0 10 12 50 8d 89 6f 1b d1 dc 54 4d 6e cb 69 5e 06 |..P..o...TMn.i^.| +000001e0 f4 30 1b 06 03 55 1d 23 04 14 30 12 80 10 bf 3d |.0...U.#..0....=| +000001f0 b6 a9 66 f2 b8 40 cf ea b4 03 78 48 1a 41 30 19 |..f..@....xH.A0.| +00000200 06 03 55 1d 11 04 12 30 10 82 0e 65 78 61 6d 70 |..U....0...examp| +00000210 6c 65 2e 67 6f 6c 61 6e 67 30 0d 06 09 2a 86 48 |le.golang0...*.H| +00000220 86 f7 0d 01 01 0b 05 00 03 81 81 00 92 7c af 91 |.............|..| +00000230 55 12 18 96 59 31 a6 48 40 d5 2d d5 ee bb 02 a0 |U...Y1.H@.-.....| +00000240 f5 c2 1e 7c 9b b3 30 7d 3c dc 76 da 4f 3d c0 fa |...|..0}<.v.O=..| +00000250 ae 2d 33 24 6b 03 7b 1b 67 59 11 21 b5 11 bc 77 |.-3$k.{.gY.!...w| +00000260 b9 d9 e0 6e a8 2d 2e 35 fa 64 5f 22 3e 63 10 6b |...n.-.5.d_">c.k| +00000270 be ff 14 86 6d 0d f0 15 31 a8 14 38 1e 3b 84 87 |....m...1..8.;..| +00000280 2c cb 98 ed 51 76 b9 b1 4f dd db 9b 84 04 86 40 |,...Qv..O......@| +00000290 fa 51 dd ba b4 8d eb e3 46 de 46 b9 4f 86 c7 f9 |.Q......F.F.O...| +000002a0 a4 c2 41 34 ac cc f6 ea b0 ab 39 18 16 03 03 00 |..A4......9.....| +000002b0 cd 0c 00 00 c9 03 00 17 41 04 1e 18 37 ef 0d 19 |........A...7...| +000002c0 51 88 35 75 71 b5 e5 54 5b 12 2e 8f 09 67 fd a7 |Q.5uq..T[....g..| +000002d0 24 20 3e b2 56 1c ce 97 28 5e f8 2b 2d 4f 9e f1 |$ >.V...(^.+-O..| +000002e0 07 9f 6c 4b 5b 83 56 e2 32 42 e9 58 b6 d7 49 a6 |..lK[.V.2B.X..I.| +000002f0 b5 68 1a 41 03 56 6b dc 5a 89 05 01 00 80 22 6b |.h.A.Vk.Z....."k| +00000300 87 4b f8 ba f2 09 91 ee ce 81 67 d4 fd d8 b5 07 |.K........g.....| +00000310 fe c3 88 96 ca e3 3a f0 87 cc ae 44 94 8e 8f 70 |......:....D...p| +00000320 79 cd de a2 26 4e 17 45 d7 ea 0f 95 a6 c9 7b 17 |y...&N.E......{.| +00000330 68 7c f5 e8 6c d5 87 6d 5a 7e 53 af 95 0c 42 91 |h|..l..mZ~S...B.| +00000340 c0 07 18 75 fd 74 1c ad ef df f8 41 b1 ad fc 36 |...u.t.....A...6| +00000350 19 31 cf c8 3f 36 55 dd 54 ac 44 a9 3a d1 ae 23 |.1..?6U.T.D.:..#| +00000360 0a 18 bf b7 6f c7 bc a6 70 50 5e 50 dd da ff 5b |....o...pP^P...[| +00000370 67 7d 0a f5 70 a0 8c 88 d9 38 d4 bf a9 c3 16 03 |g}..p....8......| +00000380 03 00 04 0e 00 00 00 |.......| +>>> Flow 3 (client to server) +00000000 16 03 03 00 46 10 00 00 42 41 04 d0 f7 11 ae 9f |....F...BA......| +00000010 ec 2e ac 8e 97 6c 58 0e 57 32 8e ac fa 3e af 36 |.....lX.W2...>.6| +00000020 22 e1 41 2b d3 d1 9c c2 1d 51 c0 e4 20 b3 4c 85 |".A+.....Q.. .L.| +00000030 b8 bd f2 d1 c6 2f 7d 83 c7 43 d9 31 36 1a 83 ca |...../}..C.16...| +00000040 c6 89 f8 ba 8c d1 7e 99 04 6e 92 14 03 03 00 01 |......~..n......| +00000050 01 16 03 03 00 28 32 67 c1 6e 5e 1e 4b 51 1b 70 |.....(2g.n^.KQ.p| +00000060 54 b9 1d 69 79 38 bd fa 7c 6b 58 71 af 72 08 2d |T..iy8..|kXq.r.-| +00000070 55 df 24 be 5b 41 0a ef 0e 90 cf d9 62 81 |U.$.[A......b.| +>>> Flow 4 (server to client) +00000000 14 03 03 00 01 01 16 03 03 00 28 00 00 00 00 00 |..........(.....| +00000010 00 00 00 87 2a 3e 09 54 54 c3 58 c0 5b 7b 91 00 |....*>.TT.X.[{..| +00000020 c4 07 98 9e de 1f f8 04 bb d7 42 04 55 7d 18 a4 |..........B.U}..| +00000030 41 7c a6 17 03 03 00 25 00 00 00 00 00 00 00 01 |A|.....%........| +00000040 ab 23 05 51 b4 60 a2 77 01 58 be a6 9f 89 2b b5 |.#.Q.`.w.X....+.| +00000050 77 6b 19 23 67 f7 89 f1 ef d6 1b f5 e7 15 03 03 |wk.#g...........| +00000060 00 1a 00 00 00 00 00 00 00 02 8a bf f0 fb 9f 56 |...............V| +00000070 36 f1 92 49 a9 e5 40 87 f9 87 9e 4d |6..I..@....M| diff --git a/src/crypto/tls/testdata/Server-TLSv12-RSA-RC4 b/src/crypto/tls/testdata/Server-TLSv12-RSA-RC4 new file mode 100644 index 0000000000000000000000000000000000000000..13163d68f6876ec0e7d6a36c53b684c58c192094 --- /dev/null +++ b/src/crypto/tls/testdata/Server-TLSv12-RSA-RC4 @@ -0,0 +1,73 @@ +>>> Flow 1 (client to server) +00000000 16 03 01 00 5a 01 00 00 56 03 03 8a fe f5 09 70 |....Z...V......p| +00000010 8e 6b e3 2b 12 ff d1 b2 ae 15 bf 47 0e ca 5c b5 |.k.+.......G..\.| +00000020 bb 0e ad af e5 a6 7e 36 c5 a4 c3 00 00 04 00 05 |......~6........| +00000030 00 ff 01 00 00 29 00 0d 00 20 00 1e 06 01 06 02 |.....)... ......| +00000040 06 03 05 01 05 02 05 03 04 01 04 02 04 03 03 01 |................| +00000050 03 02 03 03 02 01 02 02 02 03 00 0f 00 01 01 |...............| +>>> Flow 2 (server to client) +00000000 16 03 03 00 31 02 00 00 2d 03 03 00 00 00 00 00 |....1...-.......| +00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| +00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 05 00 00 |................| +00000030 05 ff 01 00 01 00 16 03 03 02 71 0b 00 02 6d 00 |..........q...m.| +00000040 02 6a 00 02 67 30 82 02 63 30 82 01 cc a0 03 02 |.j..g0..c0......| +00000050 01 02 02 09 00 a2 73 00 0c 81 00 cb f3 30 0d 06 |......s......0..| +00000060 09 2a 86 48 86 f7 0d 01 01 0b 05 00 30 2b 31 17 |.*.H........0+1.| +00000070 30 15 06 03 55 04 0a 13 0e 47 6f 6f 67 6c 65 20 |0...U....Google | +00000080 54 45 53 54 49 4e 47 31 10 30 0e 06 03 55 04 03 |TESTING1.0...U..| +00000090 13 07 47 6f 20 52 6f 6f 74 30 1e 17 0d 31 35 30 |..Go Root0...150| +000000a0 31 30 31 30 30 30 30 30 30 5a 17 0d 32 35 30 31 |101000000Z..2501| +000000b0 30 31 30 30 30 30 30 30 5a 30 26 31 17 30 15 06 |01000000Z0&1.0..| +000000c0 03 55 04 0a 13 0e 47 6f 6f 67 6c 65 20 54 45 53 |.U....Google TES| +000000d0 54 49 4e 47 31 0b 30 09 06 03 55 04 03 13 02 47 |TING1.0...U....G| +000000e0 6f 30 81 9f 30 0d 06 09 2a 86 48 86 f7 0d 01 01 |o0..0...*.H.....| +000000f0 01 05 00 03 81 8d 00 30 81 89 02 81 81 00 af 87 |.......0........| +00000100 88 f6 20 1b 95 65 6c 14 ab 44 05 af 3b 45 14 e3 |.. ..el..D..;E..| +00000110 b7 6d fd 00 63 4d 95 7f fe 6a 62 35 86 c0 4a f9 |.m..cM...jb5..J.| +00000120 18 7c f6 aa 25 5e 7a 64 31 66 00 ba f4 8e 92 af |.|..%^zd1f......| +00000130 c7 6b d8 76 d4 f3 5f 41 cb 6e 56 15 97 1b 97 c1 |.k.v.._A.nV.....| +00000140 3c 12 39 21 66 3d 2b 16 d1 bc db 1c c0 a7 da b7 |<.9!f=+.........| +00000150 ca ad ba da cb d5 21 50 ec de 8d ab d1 6b 81 4b |......!P.....k.K| +00000160 89 02 f3 c4 be c1 6c 89 b1 44 84 bd 21 d1 04 7d |......l..D..!..}| +00000170 9d 16 4d f9 82 15 f6 ef fa d6 09 47 f2 fb 02 03 |..M........G....| +00000180 01 00 01 a3 81 93 30 81 90 30 0e 06 03 55 1d 0f |......0..0...U..| +00000190 01 01 ff 04 04 03 02 05 a0 30 1d 06 03 55 1d 25 |.........0...U.%| +000001a0 04 16 30 14 06 08 2b 06 01 05 05 07 03 01 06 08 |..0...+.........| +000001b0 2b 06 01 05 05 07 03 02 30 0c 06 03 55 1d 13 01 |+.......0...U...| +000001c0 01 ff 04 02 30 00 30 19 06 03 55 1d 0e 04 12 04 |....0.0...U.....| +000001d0 10 12 50 8d 89 6f 1b d1 dc 54 4d 6e cb 69 5e 06 |..P..o...TMn.i^.| +000001e0 f4 30 1b 06 03 55 1d 23 04 14 30 12 80 10 bf 3d |.0...U.#..0....=| +000001f0 b6 a9 66 f2 b8 40 cf ea b4 03 78 48 1a 41 30 19 |..f..@....xH.A0.| +00000200 06 03 55 1d 11 04 12 30 10 82 0e 65 78 61 6d 70 |..U....0...examp| +00000210 6c 65 2e 67 6f 6c 61 6e 67 30 0d 06 09 2a 86 48 |le.golang0...*.H| +00000220 86 f7 0d 01 01 0b 05 00 03 81 81 00 92 7c af 91 |.............|..| +00000230 55 12 18 96 59 31 a6 48 40 d5 2d d5 ee bb 02 a0 |U...Y1.H@.-.....| +00000240 f5 c2 1e 7c 9b b3 30 7d 3c dc 76 da 4f 3d c0 fa |...|..0}<.v.O=..| +00000250 ae 2d 33 24 6b 03 7b 1b 67 59 11 21 b5 11 bc 77 |.-3$k.{.gY.!...w| +00000260 b9 d9 e0 6e a8 2d 2e 35 fa 64 5f 22 3e 63 10 6b |...n.-.5.d_">c.k| +00000270 be ff 14 86 6d 0d f0 15 31 a8 14 38 1e 3b 84 87 |....m...1..8.;..| +00000280 2c cb 98 ed 51 76 b9 b1 4f dd db 9b 84 04 86 40 |,...Qv..O......@| +00000290 fa 51 dd ba b4 8d eb e3 46 de 46 b9 4f 86 c7 f9 |.Q......F.F.O...| +000002a0 a4 c2 41 34 ac cc f6 ea b0 ab 39 18 16 03 03 00 |..A4......9.....| +000002b0 04 0e 00 00 00 |.....| +>>> Flow 3 (client to server) +00000000 16 03 03 00 86 10 00 00 82 00 80 1c f7 2c 18 38 |.............,.8| +00000010 d9 41 b5 ab b7 35 2b 75 2d 66 ba c8 70 c2 19 1c |.A...5+u-f..p...| +00000020 f2 6d d9 a9 a8 40 8e b5 2c 75 99 06 a5 25 be 0d |.m...@..,u...%..| +00000030 b4 b0 9b aa fc 6b 12 a5 b3 e7 02 60 aa 25 e9 7f |.....k.....`.%..| +00000040 6b f5 c4 7a 1d 16 a5 d1 76 cc d5 a1 18 68 91 c3 |k..z....v....h..| +00000050 57 b8 10 f2 b8 81 f3 1b 74 ef 6c 37 3e 81 41 09 |W.......t.l7>.A.| +00000060 2a c5 15 e6 cc bb 74 4c 01 7a b9 82 5c e2 7f b7 |*.....tL.z..\...| +00000070 ac 2d 76 30 18 30 c2 19 8c 5f f2 80 41 89 bb 47 |.-v0.0..._..A..G| +00000080 28 3d 61 cc 3c 06 a8 76 93 57 71 14 03 03 00 01 |(=a.<..v.Wq.....| +00000090 01 16 03 03 00 24 46 34 1f cc eb 53 c7 d2 04 28 |.....$F4...S...(| +000000a0 b6 3d 3f 39 06 70 56 b7 db eb 53 9c 66 c3 45 9f |.=?9.pV...S.f.E.| +000000b0 69 ca 58 8f e7 ba a7 e6 5a 97 |i.X.....Z.| +>>> Flow 4 (server to client) +00000000 14 03 03 00 01 01 16 03 03 00 24 78 c3 02 89 60 |..........$x...`| +00000010 e7 72 9f 51 87 14 ca 2e 0d 79 98 eb 1e 39 62 f9 |.r.Q.....y...9b.| +00000020 fc a5 c9 2c f8 0c 04 16 60 70 90 b7 31 f8 30 17 |...,....`p..1.0.| +00000030 03 03 00 21 6a b7 24 73 a7 0d 17 04 d7 54 a8 ea |...!j.$s.....T..| +00000040 28 4e f2 0a ef 87 d5 a9 b8 84 81 46 8e 97 d1 ae |(N.........F....| +00000050 3c cc b1 6b 72 15 03 03 00 16 1a bb 2f df ae 3e |<..kr......./..>| +00000060 a7 89 69 3e 35 f2 f6 cd 35 60 29 3a 6f be 32 0d |..i>5...5`):o.2.| diff --git a/src/crypto/tls/testdata/Server-TLSv12-Resume b/src/crypto/tls/testdata/Server-TLSv12-Resume new file mode 100644 index 0000000000000000000000000000000000000000..8cacd2184087fed16428c58035e8fc5cf1f0d871 --- /dev/null +++ b/src/crypto/tls/testdata/Server-TLSv12-Resume @@ -0,0 +1,37 @@ +>>> Flow 1 (client to server) +00000000 16 03 01 00 f6 01 00 00 f2 03 03 53 1e 13 2e bd |...........S....| +00000010 ad 66 fd 77 1a ad 5f 4d cb bd 2e ca b5 c2 45 1d |.f.w.._M......E.| +00000020 7c 83 9d 62 3e 39 9c ce 78 99 e7 20 b4 06 b0 ec ||..b>9..x.. ....| +00000030 cf b7 52 6e 38 10 31 37 b2 e6 58 0f fa e3 b0 cb |..Rn8.17..X.....| +00000040 20 a4 d2 4b f3 7d 92 e6 7e 13 37 08 00 04 00 05 | ..K.}..~.7.....| +00000050 00 ff 01 00 00 a5 00 23 00 78 50 46 ad c1 db a8 |.......#.xPF....| +00000060 38 86 7b 2b bb fd d0 c3 42 3e 00 00 00 00 00 00 |8.{+....B>......| +00000070 00 00 00 00 00 00 00 00 00 00 94 6f 2c b5 83 61 |...........o,..a| +00000080 c4 74 90 94 e5 6c fd 70 64 57 3a 25 78 bf 9f a0 |.t...l.pdW:%x...| +00000090 7c 51 bc 2a 69 1e b3 fd 71 34 b7 9a ef cb 49 37 ||Q.*i...q4....I7| +000000a0 f8 5d 5e 7c cf 6d fc 13 c1 52 79 8e ed c3 84 01 |.]^|.m...Ry.....| +000000b0 33 94 10 65 34 64 5e b4 9c 07 46 5b 9e d7 5e 55 |3..e4d^...F[..^U| +000000c0 df fd c0 e9 d2 e8 d3 c6 42 18 ef a5 6c be e8 d2 |........B...l...| +000000d0 49 c6 00 0d 00 20 00 1e 06 01 06 02 06 03 05 01 |I.... ..........| +000000e0 05 02 05 03 04 01 04 02 04 03 03 01 03 02 03 03 |................| +000000f0 02 01 02 02 02 03 00 0f 00 01 01 |...........| +>>> Flow 2 (server to client) +00000000 16 03 03 00 51 02 00 00 4d 03 03 00 00 00 00 00 |....Q...M.......| +00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| +00000020 00 00 00 00 00 00 00 00 00 00 00 20 b4 06 b0 ec |........... ....| +00000030 cf b7 52 6e 38 10 31 37 b2 e6 58 0f fa e3 b0 cb |..Rn8.17..X.....| +00000040 20 a4 d2 4b f3 7d 92 e6 7e 13 37 08 00 05 00 00 | ..K.}..~.7.....| +00000050 05 ff 01 00 01 00 14 03 03 00 01 01 16 03 03 00 |................| +00000060 24 24 31 13 8c 45 4f 8a fc 71 50 94 b0 6f 02 5e |$$1..EO..qP..o.^| +00000070 da d3 a3 13 8b c8 53 fb 54 8d ef 90 f7 55 b1 be |......S.T....U..| +00000080 37 30 05 e5 5d |70..]| +>>> Flow 3 (client to server) +00000000 14 03 03 00 01 01 16 03 03 00 24 ed dd e4 a5 09 |..........$.....| +00000010 0d 7c cb e4 90 9c a1 1c 21 f4 13 bd 45 8f f4 d8 |.|......!...E...| +00000020 7e e2 89 7a 0d f4 75 99 66 8c 05 a3 1a e2 2b |~..z..u.f.....+| +>>> Flow 4 (server to client) +00000000 17 03 03 00 21 69 fa 9e 98 fb 7a 95 b1 8e e5 74 |....!i....z....t| +00000010 03 02 d7 3d 69 c4 b8 c9 5b 49 e3 30 32 e3 c5 6a |...=i...[I.02..j| +00000020 fa 20 98 bd 01 ed 15 03 03 00 16 c9 b1 20 1f 30 |. ........... .0| +00000030 c1 2f 15 75 cd 82 45 de 1a 81 cd dc 10 05 1c 45 |./.u..E........E| +00000040 dc |.| diff --git a/src/crypto/tls/testdata/Server-TLSv12-ResumeDisabled b/src/crypto/tls/testdata/Server-TLSv12-ResumeDisabled new file mode 100644 index 0000000000000000000000000000000000000000..912c1787a1e1c96cb8e898ef6a928501f378645a --- /dev/null +++ b/src/crypto/tls/testdata/Server-TLSv12-ResumeDisabled @@ -0,0 +1,83 @@ +>>> Flow 1 (client to server) +00000000 16 03 01 00 f6 01 00 00 f2 03 03 aa 0c c2 75 42 |..............uB| +00000010 62 2a 1d 14 a0 cc a1 e4 a7 19 77 50 80 2b f8 05 |b*........wP.+..| +00000020 0b fa 60 3a a7 a7 84 d3 e1 68 26 20 68 97 0c ae |..`:.....h& h...| +00000030 7b 1d bc 13 14 a8 f6 c1 e1 96 1f 54 18 2c cb 99 |{..........T.,..| +00000040 17 7d be 45 6a 39 53 c6 50 c7 8c 75 00 04 00 05 |.}.Ej9S.P..u....| +00000050 00 ff 01 00 00 a5 00 23 00 78 50 46 ad c1 db a8 |.......#.xPF....| +00000060 38 86 7b 2b bb fd d0 c3 42 3e 00 00 00 00 00 00 |8.{+....B>......| +00000070 00 00 00 00 00 00 00 00 00 00 94 6f 2c b5 83 61 |...........o,..a| +00000080 bd 50 da 49 7f 8b 8f 58 57 00 a1 11 0d 4a 9d 8a |.P.I...XW....J..| +00000090 39 dd 85 23 c0 eb 9d 1a 45 93 92 e7 af 15 a3 a4 |9..#....E.......| +000000a0 48 da f9 a4 d8 8e cb 6c 3d 44 77 f9 c4 83 89 85 |H......l=Dw.....| +000000b0 33 94 c1 c6 20 9a 73 44 83 89 5e 59 ee 05 c6 7e |3... .sD..^Y...~| +000000c0 8d e9 7d 7b f8 84 46 b6 7d 43 ec f1 af 1f 0f 35 |..}{..F.}C.....5| +000000d0 b4 1c 00 0d 00 20 00 1e 06 01 06 02 06 03 05 01 |..... ..........| +000000e0 05 02 05 03 04 01 04 02 04 03 03 01 03 02 03 03 |................| +000000f0 02 01 02 02 02 03 00 0f 00 01 01 |...........| +>>> Flow 2 (server to client) +00000000 16 03 03 00 31 02 00 00 2d 03 03 00 00 00 00 00 |....1...-.......| +00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| +00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 05 00 00 |................| +00000030 05 ff 01 00 01 00 16 03 03 02 71 0b 00 02 6d 00 |..........q...m.| +00000040 02 6a 00 02 67 30 82 02 63 30 82 01 cc a0 03 02 |.j..g0..c0......| +00000050 01 02 02 09 00 a2 73 00 0c 81 00 cb f3 30 0d 06 |......s......0..| +00000060 09 2a 86 48 86 f7 0d 01 01 0b 05 00 30 2b 31 17 |.*.H........0+1.| +00000070 30 15 06 03 55 04 0a 13 0e 47 6f 6f 67 6c 65 20 |0...U....Google | +00000080 54 45 53 54 49 4e 47 31 10 30 0e 06 03 55 04 03 |TESTING1.0...U..| +00000090 13 07 47 6f 20 52 6f 6f 74 30 1e 17 0d 31 35 30 |..Go Root0...150| +000000a0 31 30 31 30 30 30 30 30 30 5a 17 0d 32 35 30 31 |101000000Z..2501| +000000b0 30 31 30 30 30 30 30 30 5a 30 26 31 17 30 15 06 |01000000Z0&1.0..| +000000c0 03 55 04 0a 13 0e 47 6f 6f 67 6c 65 20 54 45 53 |.U....Google TES| +000000d0 54 49 4e 47 31 0b 30 09 06 03 55 04 03 13 02 47 |TING1.0...U....G| +000000e0 6f 30 81 9f 30 0d 06 09 2a 86 48 86 f7 0d 01 01 |o0..0...*.H.....| +000000f0 01 05 00 03 81 8d 00 30 81 89 02 81 81 00 af 87 |.......0........| +00000100 88 f6 20 1b 95 65 6c 14 ab 44 05 af 3b 45 14 e3 |.. ..el..D..;E..| +00000110 b7 6d fd 00 63 4d 95 7f fe 6a 62 35 86 c0 4a f9 |.m..cM...jb5..J.| +00000120 18 7c f6 aa 25 5e 7a 64 31 66 00 ba f4 8e 92 af |.|..%^zd1f......| +00000130 c7 6b d8 76 d4 f3 5f 41 cb 6e 56 15 97 1b 97 c1 |.k.v.._A.nV.....| +00000140 3c 12 39 21 66 3d 2b 16 d1 bc db 1c c0 a7 da b7 |<.9!f=+.........| +00000150 ca ad ba da cb d5 21 50 ec de 8d ab d1 6b 81 4b |......!P.....k.K| +00000160 89 02 f3 c4 be c1 6c 89 b1 44 84 bd 21 d1 04 7d |......l..D..!..}| +00000170 9d 16 4d f9 82 15 f6 ef fa d6 09 47 f2 fb 02 03 |..M........G....| +00000180 01 00 01 a3 81 93 30 81 90 30 0e 06 03 55 1d 0f |......0..0...U..| +00000190 01 01 ff 04 04 03 02 05 a0 30 1d 06 03 55 1d 25 |.........0...U.%| +000001a0 04 16 30 14 06 08 2b 06 01 05 05 07 03 01 06 08 |..0...+.........| +000001b0 2b 06 01 05 05 07 03 02 30 0c 06 03 55 1d 13 01 |+.......0...U...| +000001c0 01 ff 04 02 30 00 30 19 06 03 55 1d 0e 04 12 04 |....0.0...U.....| +000001d0 10 12 50 8d 89 6f 1b d1 dc 54 4d 6e cb 69 5e 06 |..P..o...TMn.i^.| +000001e0 f4 30 1b 06 03 55 1d 23 04 14 30 12 80 10 bf 3d |.0...U.#..0....=| +000001f0 b6 a9 66 f2 b8 40 cf ea b4 03 78 48 1a 41 30 19 |..f..@....xH.A0.| +00000200 06 03 55 1d 11 04 12 30 10 82 0e 65 78 61 6d 70 |..U....0...examp| +00000210 6c 65 2e 67 6f 6c 61 6e 67 30 0d 06 09 2a 86 48 |le.golang0...*.H| +00000220 86 f7 0d 01 01 0b 05 00 03 81 81 00 92 7c af 91 |.............|..| +00000230 55 12 18 96 59 31 a6 48 40 d5 2d d5 ee bb 02 a0 |U...Y1.H@.-.....| +00000240 f5 c2 1e 7c 9b b3 30 7d 3c dc 76 da 4f 3d c0 fa |...|..0}<.v.O=..| +00000250 ae 2d 33 24 6b 03 7b 1b 67 59 11 21 b5 11 bc 77 |.-3$k.{.gY.!...w| +00000260 b9 d9 e0 6e a8 2d 2e 35 fa 64 5f 22 3e 63 10 6b |...n.-.5.d_">c.k| +00000270 be ff 14 86 6d 0d f0 15 31 a8 14 38 1e 3b 84 87 |....m...1..8.;..| +00000280 2c cb 98 ed 51 76 b9 b1 4f dd db 9b 84 04 86 40 |,...Qv..O......@| +00000290 fa 51 dd ba b4 8d eb e3 46 de 46 b9 4f 86 c7 f9 |.Q......F.F.O...| +000002a0 a4 c2 41 34 ac cc f6 ea b0 ab 39 18 16 03 03 00 |..A4......9.....| +000002b0 04 0e 00 00 00 |.....| +>>> Flow 3 (client to server) +00000000 16 03 03 00 86 10 00 00 82 00 80 ac 10 32 61 b0 |.............2a.| +00000010 03 e3 1e 2f 89 91 5f d6 4c e0 82 a7 82 41 67 d3 |.../.._.L....Ag.| +00000020 5f b3 68 2d c0 d1 6f 03 7b 79 94 cc bb 35 6c 8a |_.h-..o.{y...5l.| +00000030 bf 1c 83 ff 88 91 5c 04 64 cc a0 df 0b 08 8c 0f |......\.d.......| +00000040 72 13 17 9f 27 14 8d 9a af 17 70 41 44 9f 89 8c |r...'.....pAD...| +00000050 fa e4 66 33 4d bd 2f 93 2a 1e 85 a1 af 9e 27 12 |..f3M./.*.....'.| +00000060 59 a4 13 67 56 85 c2 86 47 f8 c5 49 8f a4 c2 6e |Y..gV...G..I...n| +00000070 04 78 0f 11 2b fb 7e 34 b8 eb 25 93 71 ab 9f f5 |.x..+.~4..%.q...| +00000080 93 df 2b c3 1e 9e 6a 9e e3 57 aa 14 03 03 00 01 |..+...j..W......| +00000090 01 16 03 03 00 24 e0 13 15 10 4c db f3 b6 de d2 |.....$....L.....| +000000a0 68 02 f5 ea 1f 8e 58 70 4a 5a 78 d9 66 c5 74 77 |h.....XpJZx.f.tw| +000000b0 a0 3a ec d8 b7 42 e3 a5 d4 62 |.:...B...b| +>>> Flow 4 (server to client) +00000000 14 03 03 00 01 01 16 03 03 00 24 e9 c1 1f 5b e6 |..........$...[.| +00000010 c1 d5 8a 14 eb c6 41 c1 77 6d 59 83 b6 95 34 f9 |......A.wmY...4.| +00000020 7b a1 c9 9d 58 a5 b2 1b 33 6e 04 ab e0 03 61 17 |{...X...3n....a.| +00000030 03 03 00 21 67 8b 55 43 d7 a7 05 c9 1f a0 d3 65 |...!g.UC.......e| +00000040 30 36 07 8f d8 52 7e 40 79 31 2e 1c 1a c2 a6 fe |06...R~@y1......| +00000050 e0 39 4d a0 5d 15 03 03 00 16 b8 94 fb 17 e5 1d |.9M.]...........| +00000060 2e 28 95 cf 02 85 8e 11 2e 16 b1 53 72 aa a4 94 |.(.........Sr...| diff --git a/src/crypto/tls/testdata/Server-TLSv12-SNI b/src/crypto/tls/testdata/Server-TLSv12-SNI new file mode 100644 index 0000000000000000000000000000000000000000..aee57421a23447cf85db50dfd831001e06028f68 --- /dev/null +++ b/src/crypto/tls/testdata/Server-TLSv12-SNI @@ -0,0 +1,64 @@ +>>> Flow 1 (client to server) +00000000 16 03 01 00 6e 01 00 00 6a 03 03 be 99 22 5c d2 |....n...j...."\.| +00000010 02 c7 a6 be f3 33 7a d4 76 1f cf 1e 39 0b 25 7c |.....3z.v...9.%|| +00000020 32 70 e4 8c 49 a6 87 b9 c1 2f 6d 00 00 04 00 2f |2p..I..../m..../| +00000030 00 ff 01 00 00 3d 00 00 00 10 00 0e 00 00 0b 73 |.....=.........s| +00000040 6e 69 74 65 73 74 2e 63 6f 6d 00 0d 00 20 00 1e |nitest.com... ..| +00000050 06 01 06 02 06 03 05 01 05 02 05 03 04 01 04 02 |................| +00000060 04 03 03 01 03 02 03 03 02 01 02 02 02 03 00 0f |................| +00000070 00 01 01 |...| +>>> Flow 2 (server to client) +00000000 16 03 03 00 31 02 00 00 2d 03 03 00 00 00 00 00 |....1...-.......| +00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| +00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 2f 00 00 |............./..| +00000030 05 ff 01 00 01 00 16 03 03 02 00 0b 00 01 fc 00 |................| +00000040 01 f9 00 01 f6 30 82 01 f2 30 82 01 5d a0 03 02 |.....0...0..]...| +00000050 01 02 02 01 00 30 0b 06 09 2a 86 48 86 f7 0d 01 |.....0...*.H....| +00000060 01 05 30 28 31 10 30 0e 06 03 55 04 0a 13 07 41 |..0(1.0...U....A| +00000070 63 6d 65 20 43 6f 31 14 30 12 06 03 55 04 03 13 |cme Co1.0...U...| +00000080 0b 73 6e 69 74 65 73 74 2e 63 6f 6d 30 1e 17 0d |.snitest.com0...| +00000090 31 32 30 34 31 31 31 37 34 30 33 35 5a 17 0d 31 |120411174035Z..1| +000000a0 33 30 34 31 31 31 37 34 35 33 35 5a 30 28 31 10 |30411174535Z0(1.| +000000b0 30 0e 06 03 55 04 0a 13 07 41 63 6d 65 20 43 6f |0...U....Acme Co| +000000c0 31 14 30 12 06 03 55 04 03 13 0b 73 6e 69 74 65 |1.0...U....snite| +000000d0 73 74 2e 63 6f 6d 30 81 9d 30 0b 06 09 2a 86 48 |st.com0..0...*.H| +000000e0 86 f7 0d 01 01 01 03 81 8d 00 30 81 89 02 81 81 |..........0.....| +000000f0 00 bb 79 d6 f5 17 b5 e5 bf 46 10 d0 dc 69 be e6 |..y......F...i..| +00000100 2b 07 43 5a d0 03 2d 8a 7a 43 85 b7 14 52 e7 a5 |+.CZ..-.zC...R..| +00000110 65 4c 2c 78 b8 23 8c b5 b4 82 e5 de 1f 95 3b 7e |eL,x.#........;~| +00000120 62 a5 2c a5 33 d6 fe 12 5c 7a 56 fc f5 06 bf fa |b.,.3...\zV.....| +00000130 58 7b 26 3f b5 cd 04 d3 d0 c9 21 96 4a c7 f4 54 |X{&?......!.J..T| +00000140 9f 5a bf ef 42 71 00 fe 18 99 07 7f 7e 88 7d 7d |.Z..Bq......~.}}| +00000150 f1 04 39 c4 a2 2e db 51 c9 7c e3 c0 4c 3b 32 66 |..9....Q.|..L;2f| +00000160 01 cf af b1 1d b8 71 9a 1d db db 89 6b ae da 2d |......q.....k..-| +00000170 79 02 03 01 00 01 a3 32 30 30 30 0e 06 03 55 1d |y......2000...U.| +00000180 0f 01 01 ff 04 04 03 02 00 a0 30 0d 06 03 55 1d |..........0...U.| +00000190 0e 04 06 04 04 01 02 03 04 30 0f 06 03 55 1d 23 |.........0...U.#| +000001a0 04 08 30 06 80 04 01 02 03 04 30 0b 06 09 2a 86 |..0.......0...*.| +000001b0 48 86 f7 0d 01 01 05 03 81 81 00 89 c6 45 5f 1c |H............E_.| +000001c0 1f 5e f8 eb 1a b1 74 ee 24 39 05 9f 5c 42 59 bb |.^....t.$9..\BY.| +000001d0 1a 8d 86 cd b1 d0 56 f5 6a 71 7d a4 0e 95 ab 90 |......V.jq}.....| +000001e0 f5 9e 8d ea f6 27 c1 57 99 50 94 db 08 02 26 6e |.....'.W.P....&n| +000001f0 b3 4f c6 84 2d ea 8a 4b 68 d9 c1 38 91 03 ab 84 |.O..-..Kh..8....| +00000200 fb 9e 1f 85 d9 b5 d2 3f f2 31 2c 86 70 fb b5 40 |.......?.1,.p..@| +00000210 14 82 45 a4 eb af e2 64 d9 0c 8a 4c f4 f8 5b 0f |..E....d...L..[.| +00000220 ac 12 ac 2f c4 a3 15 4b ad 52 46 28 68 af 96 c6 |.../...K.RF(h...| +00000230 2c 65 25 d6 52 b6 e3 18 45 bd cc 16 03 03 00 04 |,e%.R...E.......| +00000240 0e 00 00 00 |....| +>>> Flow 3 (client to server) +00000000 16 03 03 00 86 10 00 00 82 00 80 6b 03 31 ca a0 |...........k.1..| +00000010 62 a2 53 11 ce 13 d9 f6 e7 d4 ec 2e c3 0a 38 56 |b.S...........8V| +00000020 23 22 67 23 c8 8d 16 b4 3c 0b 26 9f 1c 2d 65 13 |#"g#....<.&..-e.| +00000030 c3 cb 65 69 b0 47 ff 87 e8 02 56 c4 77 8a 40 29 |..ei.G....V.w.@)| +00000040 82 62 8b 06 61 0a 1c b3 c7 29 b6 aa c9 96 37 18 |.b..a....)....7.| +00000050 d0 60 66 63 9b 62 4b 30 cc 03 9c 37 05 c6 32 98 |.`fc.bK0...7..2.| +00000060 cb a0 e2 e4 38 60 d4 93 99 9a fc 03 66 fb b6 ef |....8`......f...| +00000070 8a 1e bb ca 13 c5 d9 7a 7c 3b 50 dc d0 ad 00 b5 |.......z|;P.....| +00000080 2c dc 1a ef c4 5c af d3 4e cd e6 14 03 03 00 01 |,....\..N.......| +00000090 01 16 03 03 00 40 42 31 83 8a 2c 86 22 c5 df e5 |.....@B1..,."...| +000000a0 f2 0b f8 0c 2f 1e 82 f4 69 fe 1d bd 4c db f1 80 |..../...i...L...| +000000b0 68 30 b7 e3 60 76 b3 f1 52 ae d6 e7 b3 cb 4a e0 |h0..`v..R.....J.| +000000c0 27 0a c1 1a 72 ed 71 ab 0a fc 10 d9 5e 4d fd 10 |'...r.q.....^M..| +000000d0 04 92 39 78 be 23 |..9x.#| +>>> Flow 4 (server to client) +00000000 15 03 03 00 02 02 14 |.......| diff --git a/src/crypto/tls/testdata/Server-TLSv12-SNI-GetCertificate b/src/crypto/tls/testdata/Server-TLSv12-SNI-GetCertificate new file mode 100644 index 0000000000000000000000000000000000000000..40d3714a86db625f08b51f63c4f9116674f67c7e --- /dev/null +++ b/src/crypto/tls/testdata/Server-TLSv12-SNI-GetCertificate @@ -0,0 +1,64 @@ +>>> Flow 1 (client to server) +00000000 16 03 01 00 6e 01 00 00 6a 03 03 23 de 75 da 8e |....n...j..#.u..| +00000010 0a 4b 7b e4 cb 34 14 83 be d1 6a 95 25 86 f8 91 |.K{..4....j.%...| +00000020 d8 bb ac 82 9e 19 d6 9f 52 26 f6 00 00 04 00 2f |........R&...../| +00000030 00 ff 01 00 00 3d 00 00 00 10 00 0e 00 00 0b 73 |.....=.........s| +00000040 6e 69 74 65 73 74 2e 63 6f 6d 00 0d 00 20 00 1e |nitest.com... ..| +00000050 06 01 06 02 06 03 05 01 05 02 05 03 04 01 04 02 |................| +00000060 04 03 03 01 03 02 03 03 02 01 02 02 02 03 00 0f |................| +00000070 00 01 01 |...| +>>> Flow 2 (server to client) +00000000 16 03 03 00 31 02 00 00 2d 03 03 00 00 00 00 00 |....1...-.......| +00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| +00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 2f 00 00 |............./..| +00000030 05 ff 01 00 01 00 16 03 03 02 00 0b 00 01 fc 00 |................| +00000040 01 f9 00 01 f6 30 82 01 f2 30 82 01 5d a0 03 02 |.....0...0..]...| +00000050 01 02 02 01 00 30 0b 06 09 2a 86 48 86 f7 0d 01 |.....0...*.H....| +00000060 01 05 30 28 31 10 30 0e 06 03 55 04 0a 13 07 41 |..0(1.0...U....A| +00000070 63 6d 65 20 43 6f 31 14 30 12 06 03 55 04 03 13 |cme Co1.0...U...| +00000080 0b 73 6e 69 74 65 73 74 2e 63 6f 6d 30 1e 17 0d |.snitest.com0...| +00000090 31 32 30 34 31 31 31 37 34 30 33 35 5a 17 0d 31 |120411174035Z..1| +000000a0 33 30 34 31 31 31 37 34 35 33 35 5a 30 28 31 10 |30411174535Z0(1.| +000000b0 30 0e 06 03 55 04 0a 13 07 41 63 6d 65 20 43 6f |0...U....Acme Co| +000000c0 31 14 30 12 06 03 55 04 03 13 0b 73 6e 69 74 65 |1.0...U....snite| +000000d0 73 74 2e 63 6f 6d 30 81 9d 30 0b 06 09 2a 86 48 |st.com0..0...*.H| +000000e0 86 f7 0d 01 01 01 03 81 8d 00 30 81 89 02 81 81 |..........0.....| +000000f0 00 bb 79 d6 f5 17 b5 e5 bf 46 10 d0 dc 69 be e6 |..y......F...i..| +00000100 2b 07 43 5a d0 03 2d 8a 7a 43 85 b7 14 52 e7 a5 |+.CZ..-.zC...R..| +00000110 65 4c 2c 78 b8 23 8c b5 b4 82 e5 de 1f 95 3b 7e |eL,x.#........;~| +00000120 62 a5 2c a5 33 d6 fe 12 5c 7a 56 fc f5 06 bf fa |b.,.3...\zV.....| +00000130 58 7b 26 3f b5 cd 04 d3 d0 c9 21 96 4a c7 f4 54 |X{&?......!.J..T| +00000140 9f 5a bf ef 42 71 00 fe 18 99 07 7f 7e 88 7d 7d |.Z..Bq......~.}}| +00000150 f1 04 39 c4 a2 2e db 51 c9 7c e3 c0 4c 3b 32 66 |..9....Q.|..L;2f| +00000160 01 cf af b1 1d b8 71 9a 1d db db 89 6b ae da 2d |......q.....k..-| +00000170 79 02 03 01 00 01 a3 32 30 30 30 0e 06 03 55 1d |y......2000...U.| +00000180 0f 01 01 ff 04 04 03 02 00 a0 30 0d 06 03 55 1d |..........0...U.| +00000190 0e 04 06 04 04 01 02 03 04 30 0f 06 03 55 1d 23 |.........0...U.#| +000001a0 04 08 30 06 80 04 01 02 03 04 30 0b 06 09 2a 86 |..0.......0...*.| +000001b0 48 86 f7 0d 01 01 05 03 81 81 00 89 c6 45 5f 1c |H............E_.| +000001c0 1f 5e f8 eb 1a b1 74 ee 24 39 05 9f 5c 42 59 bb |.^....t.$9..\BY.| +000001d0 1a 8d 86 cd b1 d0 56 f5 6a 71 7d a4 0e 95 ab 90 |......V.jq}.....| +000001e0 f5 9e 8d ea f6 27 c1 57 99 50 94 db 08 02 26 6e |.....'.W.P....&n| +000001f0 b3 4f c6 84 2d ea 8a 4b 68 d9 c1 38 91 03 ab 84 |.O..-..Kh..8....| +00000200 fb 9e 1f 85 d9 b5 d2 3f f2 31 2c 86 70 fb b5 40 |.......?.1,.p..@| +00000210 14 82 45 a4 eb af e2 64 d9 0c 8a 4c f4 f8 5b 0f |..E....d...L..[.| +00000220 ac 12 ac 2f c4 a3 15 4b ad 52 46 28 68 af 96 c6 |.../...K.RF(h...| +00000230 2c 65 25 d6 52 b6 e3 18 45 bd cc 16 03 03 00 04 |,e%.R...E.......| +00000240 0e 00 00 00 |....| +>>> Flow 3 (client to server) +00000000 16 03 03 00 86 10 00 00 82 00 80 a2 99 61 c5 90 |.............a..| +00000010 47 1a e7 47 56 51 59 e4 6e ab 82 01 18 78 ee 95 |G..GVQY.n....x..| +00000020 b8 e2 c7 c7 f9 64 98 dd 84 8d 96 d9 2d 08 62 1e |.....d......-.b.| +00000030 4f 29 83 b6 93 68 77 7a 14 1b f0 b3 1a 67 7b 7a |O)...hwz.....g{z| +00000040 f9 54 f3 7e 6d eb b6 7a c9 37 70 6a 83 68 f2 15 |.T.~m..z.7pj.h..| +00000050 81 07 30 6e b8 fa 19 0e 46 dc d6 9a 4a 8e 8d f1 |..0n....F...J...| +00000060 05 78 60 75 d4 00 d9 1e 11 5f 16 f7 bc 9f e8 8a |.x`u....._......| +00000070 c4 3e bd d9 1a b8 67 50 00 be 5f 43 ee 07 ad be |.>....gP.._C....| +00000080 f5 85 67 fc 8f c6 87 47 6d 6e b2 14 03 03 00 01 |..g....Gmn......| +00000090 01 16 03 03 00 40 91 7d 7b 05 99 48 05 70 a9 67 |.....@.}{..H.p.g| +000000a0 e9 7a 0a c3 6b bf b0 ad 68 65 17 fb 18 bf 8d bd |.z..k...he......| +000000b0 e1 4b 12 bf ea 82 9d a6 1e 3a c8 77 65 32 bd 5e |.K.......:.we2.^| +000000c0 c4 46 da e7 e1 ac 09 fe 4a ac bc 57 6a 17 7d dc |.F......J..Wj.}.| +000000d0 fe 9c d0 d0 6e fc |....n.| +>>> Flow 4 (server to client) +00000000 15 03 03 00 02 02 14 |.......| diff --git a/src/crypto/tls/testdata/Server-TLSv12-SNI-GetCertificateNotFound b/src/crypto/tls/testdata/Server-TLSv12-SNI-GetCertificateNotFound new file mode 100644 index 0000000000000000000000000000000000000000..904f69ecacb5f43ce5c61e29a26b8c5a161c64e4 --- /dev/null +++ b/src/crypto/tls/testdata/Server-TLSv12-SNI-GetCertificateNotFound @@ -0,0 +1,64 @@ +>>> Flow 1 (client to server) +00000000 16 03 01 00 6e 01 00 00 6a 03 03 27 db e3 e8 f4 |....n...j..'....| +00000010 48 1d 45 d5 20 64 97 b2 20 a6 67 94 7a 1e 87 12 |H.E. d.. .g.z...| +00000020 25 b1 53 94 27 78 ed ae 58 2f 1b 00 00 04 00 2f |%.S.'x..X/...../| +00000030 00 ff 01 00 00 3d 00 00 00 10 00 0e 00 00 0b 73 |.....=.........s| +00000040 6e 69 74 65 73 74 2e 63 6f 6d 00 0d 00 20 00 1e |nitest.com... ..| +00000050 06 01 06 02 06 03 05 01 05 02 05 03 04 01 04 02 |................| +00000060 04 03 03 01 03 02 03 03 02 01 02 02 02 03 00 0f |................| +00000070 00 01 01 |...| +>>> Flow 2 (server to client) +00000000 16 03 03 00 31 02 00 00 2d 03 03 00 00 00 00 00 |....1...-.......| +00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| +00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 2f 00 00 |............./..| +00000030 05 ff 01 00 01 00 16 03 03 02 00 0b 00 01 fc 00 |................| +00000040 01 f9 00 01 f6 30 82 01 f2 30 82 01 5d a0 03 02 |.....0...0..]...| +00000050 01 02 02 01 00 30 0b 06 09 2a 86 48 86 f7 0d 01 |.....0...*.H....| +00000060 01 05 30 28 31 10 30 0e 06 03 55 04 0a 13 07 41 |..0(1.0...U....A| +00000070 63 6d 65 20 43 6f 31 14 30 12 06 03 55 04 03 13 |cme Co1.0...U...| +00000080 0b 73 6e 69 74 65 73 74 2e 63 6f 6d 30 1e 17 0d |.snitest.com0...| +00000090 31 32 30 34 31 31 31 37 34 30 33 35 5a 17 0d 31 |120411174035Z..1| +000000a0 33 30 34 31 31 31 37 34 35 33 35 5a 30 28 31 10 |30411174535Z0(1.| +000000b0 30 0e 06 03 55 04 0a 13 07 41 63 6d 65 20 43 6f |0...U....Acme Co| +000000c0 31 14 30 12 06 03 55 04 03 13 0b 73 6e 69 74 65 |1.0...U....snite| +000000d0 73 74 2e 63 6f 6d 30 81 9d 30 0b 06 09 2a 86 48 |st.com0..0...*.H| +000000e0 86 f7 0d 01 01 01 03 81 8d 00 30 81 89 02 81 81 |..........0.....| +000000f0 00 bb 79 d6 f5 17 b5 e5 bf 46 10 d0 dc 69 be e6 |..y......F...i..| +00000100 2b 07 43 5a d0 03 2d 8a 7a 43 85 b7 14 52 e7 a5 |+.CZ..-.zC...R..| +00000110 65 4c 2c 78 b8 23 8c b5 b4 82 e5 de 1f 95 3b 7e |eL,x.#........;~| +00000120 62 a5 2c a5 33 d6 fe 12 5c 7a 56 fc f5 06 bf fa |b.,.3...\zV.....| +00000130 58 7b 26 3f b5 cd 04 d3 d0 c9 21 96 4a c7 f4 54 |X{&?......!.J..T| +00000140 9f 5a bf ef 42 71 00 fe 18 99 07 7f 7e 88 7d 7d |.Z..Bq......~.}}| +00000150 f1 04 39 c4 a2 2e db 51 c9 7c e3 c0 4c 3b 32 66 |..9....Q.|..L;2f| +00000160 01 cf af b1 1d b8 71 9a 1d db db 89 6b ae da 2d |......q.....k..-| +00000170 79 02 03 01 00 01 a3 32 30 30 30 0e 06 03 55 1d |y......2000...U.| +00000180 0f 01 01 ff 04 04 03 02 00 a0 30 0d 06 03 55 1d |..........0...U.| +00000190 0e 04 06 04 04 01 02 03 04 30 0f 06 03 55 1d 23 |.........0...U.#| +000001a0 04 08 30 06 80 04 01 02 03 04 30 0b 06 09 2a 86 |..0.......0...*.| +000001b0 48 86 f7 0d 01 01 05 03 81 81 00 89 c6 45 5f 1c |H............E_.| +000001c0 1f 5e f8 eb 1a b1 74 ee 24 39 05 9f 5c 42 59 bb |.^....t.$9..\BY.| +000001d0 1a 8d 86 cd b1 d0 56 f5 6a 71 7d a4 0e 95 ab 90 |......V.jq}.....| +000001e0 f5 9e 8d ea f6 27 c1 57 99 50 94 db 08 02 26 6e |.....'.W.P....&n| +000001f0 b3 4f c6 84 2d ea 8a 4b 68 d9 c1 38 91 03 ab 84 |.O..-..Kh..8....| +00000200 fb 9e 1f 85 d9 b5 d2 3f f2 31 2c 86 70 fb b5 40 |.......?.1,.p..@| +00000210 14 82 45 a4 eb af e2 64 d9 0c 8a 4c f4 f8 5b 0f |..E....d...L..[.| +00000220 ac 12 ac 2f c4 a3 15 4b ad 52 46 28 68 af 96 c6 |.../...K.RF(h...| +00000230 2c 65 25 d6 52 b6 e3 18 45 bd cc 16 03 03 00 04 |,e%.R...E.......| +00000240 0e 00 00 00 |....| +>>> Flow 3 (client to server) +00000000 16 03 03 00 86 10 00 00 82 00 80 72 23 e9 89 70 |...........r#..p| +00000010 97 02 08 58 0d 28 96 5b 19 73 dd 4f 6e 4c 11 dd |...X.(.[.s.OnL..| +00000020 cb 56 14 f4 8f c8 e5 84 03 f5 7e f0 a4 08 44 8c |.V........~...D.| +00000030 22 74 01 5c e4 9d e0 38 53 90 66 e3 df bb 09 a8 |"t.\...8S.f.....| +00000040 11 97 0a 44 01 d2 70 85 14 a1 9a 2f 02 34 40 6d |...D..p..../.4@m| +00000050 66 80 72 9a 97 98 5c 91 0e dc 42 ac c2 90 2f 30 |f.r...\...B.../0| +00000060 ca 39 25 94 da 6e b6 5f 94 a9 94 66 7f 32 6a bb |.9%..n._...f.2j.| +00000070 5d 43 20 c3 74 f7 52 29 1f d5 62 6b a4 a1 8c 25 |]C .t.R)..bk...%| +00000080 46 69 22 a5 68 54 f4 68 30 e2 52 14 03 03 00 01 |Fi".hT.h0.R.....| +00000090 01 16 03 03 00 40 51 d2 78 64 e3 59 ee b7 5f 95 |.....@Q.xd.Y.._.| +000000a0 4c 49 7f 0d 49 3f 55 71 8c 3b 24 e3 81 22 4a d1 |LI..I?Uq.;$.."J.| +000000b0 ab 84 4e df 02 9d 56 ea 2a 14 71 e1 dc 1d 5c 1d |..N...V.*.q...\.| +000000c0 54 ce cb 58 f6 4d e7 73 44 0d 99 95 a5 2d 7c 2f |T..X.M.sD....-|/| +000000d0 15 f5 8f fd 97 40 |.....@| +>>> Flow 4 (server to client) +00000000 15 03 03 00 02 02 14 |.......| diff --git a/src/crypto/tls/ticket.go b/src/crypto/tls/ticket.go new file mode 100644 index 0000000000000000000000000000000000000000..7be50ce68c959f07554e10eb6b92cb7b1b530aac --- /dev/null +++ b/src/crypto/tls/ticket.go @@ -0,0 +1,204 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package tls + +import ( + "bytes" + "crypto/aes" + "crypto/cipher" + "crypto/hmac" + "crypto/sha256" + "crypto/subtle" + "errors" + "io" +) + +// sessionState contains the information that is serialized into a session +// ticket in order to later resume a connection. +type sessionState struct { + vers uint16 + cipherSuite uint16 + masterSecret []byte + certificates [][]byte + // usedOldKey is true if the ticket from which this session came from + // was encrypted with an older key and thus should be refreshed. + usedOldKey bool +} + +func (s *sessionState) equal(i interface{}) bool { + s1, ok := i.(*sessionState) + if !ok { + return false + } + + if s.vers != s1.vers || + s.cipherSuite != s1.cipherSuite || + !bytes.Equal(s.masterSecret, s1.masterSecret) { + return false + } + + if len(s.certificates) != len(s1.certificates) { + return false + } + + for i := range s.certificates { + if !bytes.Equal(s.certificates[i], s1.certificates[i]) { + return false + } + } + + return true +} + +func (s *sessionState) marshal() []byte { + length := 2 + 2 + 2 + len(s.masterSecret) + 2 + for _, cert := range s.certificates { + length += 4 + len(cert) + } + + ret := make([]byte, length) + x := ret + x[0] = byte(s.vers >> 8) + x[1] = byte(s.vers) + x[2] = byte(s.cipherSuite >> 8) + x[3] = byte(s.cipherSuite) + x[4] = byte(len(s.masterSecret) >> 8) + x[5] = byte(len(s.masterSecret)) + x = x[6:] + copy(x, s.masterSecret) + x = x[len(s.masterSecret):] + + x[0] = byte(len(s.certificates) >> 8) + x[1] = byte(len(s.certificates)) + x = x[2:] + + for _, cert := range s.certificates { + x[0] = byte(len(cert) >> 24) + x[1] = byte(len(cert) >> 16) + x[2] = byte(len(cert) >> 8) + x[3] = byte(len(cert)) + copy(x[4:], cert) + x = x[4+len(cert):] + } + + return ret +} + +func (s *sessionState) unmarshal(data []byte) bool { + if len(data) < 8 { + return false + } + + s.vers = uint16(data[0])<<8 | uint16(data[1]) + s.cipherSuite = uint16(data[2])<<8 | uint16(data[3]) + masterSecretLen := int(data[4])<<8 | int(data[5]) + data = data[6:] + if len(data) < masterSecretLen { + return false + } + + s.masterSecret = data[:masterSecretLen] + data = data[masterSecretLen:] + + if len(data) < 2 { + return false + } + + numCerts := int(data[0])<<8 | int(data[1]) + data = data[2:] + + s.certificates = make([][]byte, numCerts) + for i := range s.certificates { + if len(data) < 4 { + return false + } + certLen := int(data[0])<<24 | int(data[1])<<16 | int(data[2])<<8 | int(data[3]) + data = data[4:] + if certLen < 0 { + return false + } + if len(data) < certLen { + return false + } + s.certificates[i] = data[:certLen] + data = data[certLen:] + } + + if len(data) > 0 { + return false + } + + return true +} + +func (c *Conn) encryptTicket(state *sessionState) ([]byte, error) { + serialized := state.marshal() + encrypted := make([]byte, ticketKeyNameLen+aes.BlockSize+len(serialized)+sha256.Size) + keyName := encrypted[:ticketKeyNameLen] + iv := encrypted[ticketKeyNameLen : ticketKeyNameLen+aes.BlockSize] + macBytes := encrypted[len(encrypted)-sha256.Size:] + + if _, err := io.ReadFull(c.config.rand(), iv); err != nil { + return nil, err + } + key := c.config.ticketKeys()[0] + copy(keyName, key.keyName[:]) + block, err := aes.NewCipher(key.aesKey[:]) + if err != nil { + return nil, errors.New("tls: failed to create cipher while encrypting ticket: " + err.Error()) + } + cipher.NewCTR(block, iv).XORKeyStream(encrypted[ticketKeyNameLen+aes.BlockSize:], serialized) + + mac := hmac.New(sha256.New, key.hmacKey[:]) + mac.Write(encrypted[:len(encrypted)-sha256.Size]) + mac.Sum(macBytes[:0]) + + return encrypted, nil +} + +func (c *Conn) decryptTicket(encrypted []byte) (*sessionState, bool) { + if c.config.SessionTicketsDisabled || + len(encrypted) < ticketKeyNameLen+aes.BlockSize+sha256.Size { + return nil, false + } + + keyName := encrypted[:ticketKeyNameLen] + iv := encrypted[ticketKeyNameLen : ticketKeyNameLen+aes.BlockSize] + macBytes := encrypted[len(encrypted)-sha256.Size:] + + keys := c.config.ticketKeys() + keyIndex := -1 + for i, candidateKey := range keys { + if bytes.Equal(keyName, candidateKey.keyName[:]) { + keyIndex = i + break + } + } + + if keyIndex == -1 { + return nil, false + } + key := &keys[keyIndex] + + mac := hmac.New(sha256.New, key.hmacKey[:]) + mac.Write(encrypted[:len(encrypted)-sha256.Size]) + expected := mac.Sum(nil) + + if subtle.ConstantTimeCompare(macBytes, expected) != 1 { + return nil, false + } + + block, err := aes.NewCipher(key.aesKey[:]) + if err != nil { + return nil, false + } + ciphertext := encrypted[ticketKeyNameLen+aes.BlockSize : len(encrypted)-sha256.Size] + plaintext := ciphertext + cipher.NewCTR(block, iv).XORKeyStream(plaintext, ciphertext) + + state := &sessionState{usedOldKey: keyIndex > 0} + ok := state.unmarshal(plaintext) + return state, ok +} diff --git a/src/crypto/tls/tls.go b/src/crypto/tls/tls.go new file mode 100644 index 0000000000000000000000000000000000000000..0b1c3778ad41ec4950b708f6005cfd6dd568b9c5 --- /dev/null +++ b/src/crypto/tls/tls.go @@ -0,0 +1,271 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package tls partially implements TLS 1.2, as specified in RFC 5246. +package tls + +import ( + "crypto" + "crypto/ecdsa" + "crypto/rsa" + "crypto/x509" + "encoding/pem" + "errors" + "io/ioutil" + "net" + "strings" + "time" +) + +// Server returns a new TLS server side connection +// using conn as the underlying transport. +// The configuration config must be non-nil and must have +// at least one certificate. +func Server(conn net.Conn, config *Config) *Conn { + return &Conn{conn: conn, config: config} +} + +// Client returns a new TLS client side connection +// using conn as the underlying transport. +// The config cannot be nil: users must set either ServerName or +// InsecureSkipVerify in the config. +func Client(conn net.Conn, config *Config) *Conn { + return &Conn{conn: conn, config: config, isClient: true} +} + +// A listener implements a network listener (net.Listener) for TLS connections. +type listener struct { + net.Listener + config *Config +} + +// Accept waits for and returns the next incoming TLS connection. +// The returned connection c is a *tls.Conn. +func (l *listener) Accept() (c net.Conn, err error) { + c, err = l.Listener.Accept() + if err != nil { + return + } + c = Server(c, l.config) + return +} + +// NewListener creates a Listener which accepts connections from an inner +// Listener and wraps each connection with Server. +// The configuration config must be non-nil and must have +// at least one certificate. +func NewListener(inner net.Listener, config *Config) net.Listener { + l := new(listener) + l.Listener = inner + l.config = config + return l +} + +// Listen creates a TLS listener accepting connections on the +// given network address using net.Listen. +// The configuration config must be non-nil and must have +// at least one certificate. +func Listen(network, laddr string, config *Config) (net.Listener, error) { + if config == nil || len(config.Certificates) == 0 { + return nil, errors.New("tls.Listen: no certificates in configuration") + } + l, err := net.Listen(network, laddr) + if err != nil { + return nil, err + } + return NewListener(l, config), nil +} + +type timeoutError struct{} + +func (timeoutError) Error() string { return "tls: DialWithDialer timed out" } +func (timeoutError) Timeout() bool { return true } +func (timeoutError) Temporary() bool { return true } + +// DialWithDialer connects to the given network address using dialer.Dial and +// then initiates a TLS handshake, returning the resulting TLS connection. Any +// timeout or deadline given in the dialer apply to connection and TLS +// handshake as a whole. +// +// DialWithDialer interprets a nil configuration as equivalent to the zero +// configuration; see the documentation of Config for the defaults. +func DialWithDialer(dialer *net.Dialer, network, addr string, config *Config) (*Conn, error) { + // We want the Timeout and Deadline values from dialer to cover the + // whole process: TCP connection and TLS handshake. This means that we + // also need to start our own timers now. + timeout := dialer.Timeout + + if !dialer.Deadline.IsZero() { + deadlineTimeout := dialer.Deadline.Sub(time.Now()) + if timeout == 0 || deadlineTimeout < timeout { + timeout = deadlineTimeout + } + } + + var errChannel chan error + + if timeout != 0 { + errChannel = make(chan error, 2) + time.AfterFunc(timeout, func() { + errChannel <- timeoutError{} + }) + } + + rawConn, err := dialer.Dial(network, addr) + if err != nil { + return nil, err + } + + colonPos := strings.LastIndex(addr, ":") + if colonPos == -1 { + colonPos = len(addr) + } + hostname := addr[:colonPos] + + if config == nil { + config = defaultConfig() + } + // If no ServerName is set, infer the ServerName + // from the hostname we're connecting to. + if config.ServerName == "" { + // Make a copy to avoid polluting argument or default. + c := *config + c.ServerName = hostname + config = &c + } + + conn := Client(rawConn, config) + + if timeout == 0 { + err = conn.Handshake() + } else { + go func() { + errChannel <- conn.Handshake() + }() + + err = <-errChannel + } + + if err != nil { + rawConn.Close() + return nil, err + } + + return conn, nil +} + +// Dial connects to the given network address using net.Dial +// and then initiates a TLS handshake, returning the resulting +// TLS connection. +// Dial interprets a nil configuration as equivalent to +// the zero configuration; see the documentation of Config +// for the defaults. +func Dial(network, addr string, config *Config) (*Conn, error) { + return DialWithDialer(new(net.Dialer), network, addr, config) +} + +// LoadX509KeyPair reads and parses a public/private key pair from a pair of +// files. The files must contain PEM encoded data. +func LoadX509KeyPair(certFile, keyFile string) (Certificate, error) { + certPEMBlock, err := ioutil.ReadFile(certFile) + if err != nil { + return Certificate{}, err + } + keyPEMBlock, err := ioutil.ReadFile(keyFile) + if err != nil { + return Certificate{}, err + } + return X509KeyPair(certPEMBlock, keyPEMBlock) +} + +// X509KeyPair parses a public/private key pair from a pair of +// PEM encoded data. +func X509KeyPair(certPEMBlock, keyPEMBlock []byte) (Certificate, error) { + var cert Certificate + var certDERBlock *pem.Block + fail := func(err error) (Certificate, error) { return Certificate{}, err } + for { + certDERBlock, certPEMBlock = pem.Decode(certPEMBlock) + if certDERBlock == nil { + break + } + if certDERBlock.Type == "CERTIFICATE" { + cert.Certificate = append(cert.Certificate, certDERBlock.Bytes) + } + } + + if len(cert.Certificate) == 0 { + return fail(errors.New("crypto/tls: failed to parse certificate PEM data")) + } + + var keyDERBlock *pem.Block + for { + keyDERBlock, keyPEMBlock = pem.Decode(keyPEMBlock) + if keyDERBlock == nil { + return fail(errors.New("crypto/tls: failed to parse key PEM data")) + } + if keyDERBlock.Type == "PRIVATE KEY" || strings.HasSuffix(keyDERBlock.Type, " PRIVATE KEY") { + break + } + } + + var err error + cert.PrivateKey, err = parsePrivateKey(keyDERBlock.Bytes) + if err != nil { + return fail(err) + } + + // We don't need to parse the public key for TLS, but we so do anyway + // to check that it looks sane and matches the private key. + x509Cert, err := x509.ParseCertificate(cert.Certificate[0]) + if err != nil { + return fail(err) + } + + switch pub := x509Cert.PublicKey.(type) { + case *rsa.PublicKey: + priv, ok := cert.PrivateKey.(*rsa.PrivateKey) + if !ok { + return fail(errors.New("crypto/tls: private key type does not match public key type")) + } + if pub.N.Cmp(priv.N) != 0 { + return fail(errors.New("crypto/tls: private key does not match public key")) + } + case *ecdsa.PublicKey: + priv, ok := cert.PrivateKey.(*ecdsa.PrivateKey) + if !ok { + return fail(errors.New("crypto/tls: private key type does not match public key type")) + + } + if pub.X.Cmp(priv.X) != 0 || pub.Y.Cmp(priv.Y) != 0 { + return fail(errors.New("crypto/tls: private key does not match public key")) + } + default: + return fail(errors.New("crypto/tls: unknown public key algorithm")) + } + + return cert, nil +} + +// Attempt to parse the given private key DER block. OpenSSL 0.9.8 generates +// PKCS#1 private keys by default, while OpenSSL 1.0.0 generates PKCS#8 keys. +// OpenSSL ecparam generates SEC1 EC private keys for ECDSA. We try all three. +func parsePrivateKey(der []byte) (crypto.PrivateKey, error) { + if key, err := x509.ParsePKCS1PrivateKey(der); err == nil { + return key, nil + } + if key, err := x509.ParsePKCS8PrivateKey(der); err == nil { + switch key := key.(type) { + case *rsa.PrivateKey, *ecdsa.PrivateKey: + return key, nil + default: + return nil, errors.New("crypto/tls: found unknown private key type in PKCS#8 wrapping") + } + } + if key, err := x509.ParseECPrivateKey(der); err == nil { + return key, nil + } + + return nil, errors.New("crypto/tls: failed to parse private key") +} diff --git a/src/crypto/tls/tls_test.go b/src/crypto/tls/tls_test.go new file mode 100644 index 0000000000000000000000000000000000000000..c45c10378d76344ed34e1795fbec10391a628ebe --- /dev/null +++ b/src/crypto/tls/tls_test.go @@ -0,0 +1,334 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package tls + +import ( + "bytes" + "fmt" + "internal/testenv" + "io" + "net" + "strings" + "testing" + "time" +) + +var rsaCertPEM = `-----BEGIN CERTIFICATE----- +MIIB0zCCAX2gAwIBAgIJAI/M7BYjwB+uMA0GCSqGSIb3DQEBBQUAMEUxCzAJBgNV +BAYTAkFVMRMwEQYDVQQIDApTb21lLVN0YXRlMSEwHwYDVQQKDBhJbnRlcm5ldCBX +aWRnaXRzIFB0eSBMdGQwHhcNMTIwOTEyMjE1MjAyWhcNMTUwOTEyMjE1MjAyWjBF +MQswCQYDVQQGEwJBVTETMBEGA1UECAwKU29tZS1TdGF0ZTEhMB8GA1UECgwYSW50 +ZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBANLJ +hPHhITqQbPklG3ibCVxwGMRfp/v4XqhfdQHdcVfHap6NQ5Wok/4xIA+ui35/MmNa +rtNuC+BdZ1tMuVCPFZcCAwEAAaNQME4wHQYDVR0OBBYEFJvKs8RfJaXTH08W+SGv +zQyKn0H8MB8GA1UdIwQYMBaAFJvKs8RfJaXTH08W+SGvzQyKn0H8MAwGA1UdEwQF +MAMBAf8wDQYJKoZIhvcNAQEFBQADQQBJlffJHybjDGxRMqaRmDhX0+6v02TUKZsW +r5QuVbpQhH6u+0UgcW0jp9QwpxoPTLTWGXEWBBBurxFwiCBhkQ+V +-----END CERTIFICATE----- +` + +var rsaKeyPEM = `-----BEGIN RSA PRIVATE KEY----- +MIIBOwIBAAJBANLJhPHhITqQbPklG3ibCVxwGMRfp/v4XqhfdQHdcVfHap6NQ5Wo +k/4xIA+ui35/MmNartNuC+BdZ1tMuVCPFZcCAwEAAQJAEJ2N+zsR0Xn8/Q6twa4G +6OB1M1WO+k+ztnX/1SvNeWu8D6GImtupLTYgjZcHufykj09jiHmjHx8u8ZZB/o1N +MQIhAPW+eyZo7ay3lMz1V01WVjNKK9QSn1MJlb06h/LuYv9FAiEA25WPedKgVyCW +SmUwbPw8fnTcpqDWE3yTO3vKcebqMSsCIBF3UmVue8YU3jybC3NxuXq3wNm34R8T +xVLHwDXh/6NJAiEAl2oHGGLz64BuAfjKrqwz7qMYr9HCLIe/YsoWq/olzScCIQDi +D2lWusoe2/nEqfDVVWGWlyJ7yOmqaVm/iNUN9B2N2g== +-----END RSA PRIVATE KEY----- +` + +// keyPEM is the same as rsaKeyPEM, but declares itself as just +// "PRIVATE KEY", not "RSA PRIVATE KEY". https://golang.org/issue/4477 +var keyPEM = `-----BEGIN PRIVATE KEY----- +MIIBOwIBAAJBANLJhPHhITqQbPklG3ibCVxwGMRfp/v4XqhfdQHdcVfHap6NQ5Wo +k/4xIA+ui35/MmNartNuC+BdZ1tMuVCPFZcCAwEAAQJAEJ2N+zsR0Xn8/Q6twa4G +6OB1M1WO+k+ztnX/1SvNeWu8D6GImtupLTYgjZcHufykj09jiHmjHx8u8ZZB/o1N +MQIhAPW+eyZo7ay3lMz1V01WVjNKK9QSn1MJlb06h/LuYv9FAiEA25WPedKgVyCW +SmUwbPw8fnTcpqDWE3yTO3vKcebqMSsCIBF3UmVue8YU3jybC3NxuXq3wNm34R8T +xVLHwDXh/6NJAiEAl2oHGGLz64BuAfjKrqwz7qMYr9HCLIe/YsoWq/olzScCIQDi +D2lWusoe2/nEqfDVVWGWlyJ7yOmqaVm/iNUN9B2N2g== +-----END PRIVATE KEY----- +` + +var ecdsaCertPEM = `-----BEGIN CERTIFICATE----- +MIIB/jCCAWICCQDscdUxw16XFDAJBgcqhkjOPQQBMEUxCzAJBgNVBAYTAkFVMRMw +EQYDVQQIEwpTb21lLVN0YXRlMSEwHwYDVQQKExhJbnRlcm5ldCBXaWRnaXRzIFB0 +eSBMdGQwHhcNMTIxMTE0MTI0MDQ4WhcNMTUxMTE0MTI0MDQ4WjBFMQswCQYDVQQG +EwJBVTETMBEGA1UECBMKU29tZS1TdGF0ZTEhMB8GA1UEChMYSW50ZXJuZXQgV2lk +Z2l0cyBQdHkgTHRkMIGbMBAGByqGSM49AgEGBSuBBAAjA4GGAAQBY9+my9OoeSUR +lDQdV/x8LsOuLilthhiS1Tz4aGDHIPwC1mlvnf7fg5lecYpMCrLLhauAc1UJXcgl +01xoLuzgtAEAgv2P/jgytzRSpUYvgLBt1UA0leLYBy6mQQbrNEuqT3INapKIcUv8 +XxYP0xMEUksLPq6Ca+CRSqTtrd/23uTnapkwCQYHKoZIzj0EAQOBigAwgYYCQXJo +A7Sl2nLVf+4Iu/tAX/IF4MavARKC4PPHK3zfuGfPR3oCCcsAoz3kAzOeijvd0iXb +H5jBImIxPL4WxQNiBTexAkF8D1EtpYuWdlVQ80/h/f4pBcGiXPqX5h2PQSQY7hP1 ++jwM1FGS4fREIOvlBYr/SzzQRtwrvrzGYxDEDbsC0ZGRnA== +-----END CERTIFICATE----- +` + +var ecdsaKeyPEM = `-----BEGIN EC PARAMETERS----- +BgUrgQQAIw== +-----END EC PARAMETERS----- +-----BEGIN EC PRIVATE KEY----- +MIHcAgEBBEIBrsoKp0oqcv6/JovJJDoDVSGWdirrkgCWxrprGlzB9o0X8fV675X0 +NwuBenXFfeZvVcwluO7/Q9wkYoPd/t3jGImgBwYFK4EEACOhgYkDgYYABAFj36bL +06h5JRGUNB1X/Hwuw64uKW2GGJLVPPhoYMcg/ALWaW+d/t+DmV5xikwKssuFq4Bz +VQldyCXTXGgu7OC0AQCC/Y/+ODK3NFKlRi+AsG3VQDSV4tgHLqZBBus0S6pPcg1q +kohxS/xfFg/TEwRSSws+roJr4JFKpO2t3/be5OdqmQ== +-----END EC PRIVATE KEY----- +` + +var keyPairTests = []struct { + algo string + cert string + key string +}{ + {"ECDSA", ecdsaCertPEM, ecdsaKeyPEM}, + {"RSA", rsaCertPEM, rsaKeyPEM}, + {"RSA-untyped", rsaCertPEM, keyPEM}, // golang.org/issue/4477 +} + +func TestX509KeyPair(t *testing.T) { + var pem []byte + for _, test := range keyPairTests { + pem = []byte(test.cert + test.key) + if _, err := X509KeyPair(pem, pem); err != nil { + t.Errorf("Failed to load %s cert followed by %s key: %s", test.algo, test.algo, err) + } + pem = []byte(test.key + test.cert) + if _, err := X509KeyPair(pem, pem); err != nil { + t.Errorf("Failed to load %s key followed by %s cert: %s", test.algo, test.algo, err) + } + } +} + +func TestX509MixedKeyPair(t *testing.T) { + if _, err := X509KeyPair([]byte(rsaCertPEM), []byte(ecdsaKeyPEM)); err == nil { + t.Error("Load of RSA certificate succeeded with ECDSA private key") + } + if _, err := X509KeyPair([]byte(ecdsaCertPEM), []byte(rsaKeyPEM)); err == nil { + t.Error("Load of ECDSA certificate succeeded with RSA private key") + } +} + +func newLocalListener(t *testing.T) net.Listener { + ln, err := net.Listen("tcp", "127.0.0.1:0") + if err != nil { + ln, err = net.Listen("tcp6", "[::1]:0") + } + if err != nil { + t.Fatal(err) + } + return ln +} + +func TestDialTimeout(t *testing.T) { + if testing.Short() { + t.Skip("skipping in short mode") + } + listener := newLocalListener(t) + + addr := listener.Addr().String() + defer listener.Close() + + complete := make(chan bool) + defer close(complete) + + go func() { + conn, err := listener.Accept() + if err != nil { + t.Error(err) + return + } + <-complete + conn.Close() + }() + + dialer := &net.Dialer{ + Timeout: 10 * time.Millisecond, + } + + var err error + if _, err = DialWithDialer(dialer, "tcp", addr, nil); err == nil { + t.Fatal("DialWithTimeout completed successfully") + } + + if !strings.Contains(err.Error(), "timed out") { + t.Errorf("resulting error not a timeout: %s", err) + } +} + +// tests that Conn.Read returns (non-zero, io.EOF) instead of +// (non-zero, nil) when a Close (alertCloseNotify) is sitting right +// behind the application data in the buffer. +func TestConnReadNonzeroAndEOF(t *testing.T) { + // This test is racy: it assumes that after a write to a + // localhost TCP connection, the peer TCP connection can + // immediately read it. Because it's racy, we skip this test + // in short mode, and then retry it several times with an + // increasing sleep in between our final write (via srv.Close + // below) and the following read. + if testing.Short() { + t.Skip("skipping in short mode") + } + var err error + for delay := time.Millisecond; delay <= 64*time.Millisecond; delay *= 2 { + if err = testConnReadNonzeroAndEOF(t, delay); err == nil { + return + } + } + t.Error(err) +} + +func testConnReadNonzeroAndEOF(t *testing.T, delay time.Duration) error { + ln := newLocalListener(t) + defer ln.Close() + + srvCh := make(chan *Conn, 1) + var serr error + go func() { + sconn, err := ln.Accept() + if err != nil { + serr = err + srvCh <- nil + return + } + serverConfig := *testConfig + srv := Server(sconn, &serverConfig) + if err := srv.Handshake(); err != nil { + serr = fmt.Errorf("handshake: %v", err) + srvCh <- nil + return + } + srvCh <- srv + }() + + clientConfig := *testConfig + conn, err := Dial("tcp", ln.Addr().String(), &clientConfig) + if err != nil { + t.Fatal(err) + } + defer conn.Close() + + srv := <-srvCh + if srv == nil { + return serr + } + + buf := make([]byte, 6) + + srv.Write([]byte("foobar")) + n, err := conn.Read(buf) + if n != 6 || err != nil || string(buf) != "foobar" { + return fmt.Errorf("Read = %d, %v, data %q; want 6, nil, foobar", n, err, buf) + } + + srv.Write([]byte("abcdef")) + srv.Close() + time.Sleep(delay) + n, err = conn.Read(buf) + if n != 6 || string(buf) != "abcdef" { + return fmt.Errorf("Read = %d, buf= %q; want 6, abcdef", n, buf) + } + if err != io.EOF { + return fmt.Errorf("Second Read error = %v; want io.EOF", err) + } + return nil +} + +func TestTLSUniqueMatches(t *testing.T) { + ln := newLocalListener(t) + defer ln.Close() + + serverTLSUniques := make(chan []byte) + go func() { + for i := 0; i < 2; i++ { + sconn, err := ln.Accept() + if err != nil { + t.Fatal(err) + } + serverConfig := *testConfig + srv := Server(sconn, &serverConfig) + if err := srv.Handshake(); err != nil { + t.Fatal(err) + } + serverTLSUniques <- srv.ConnectionState().TLSUnique + } + }() + + clientConfig := *testConfig + clientConfig.ClientSessionCache = NewLRUClientSessionCache(1) + conn, err := Dial("tcp", ln.Addr().String(), &clientConfig) + if err != nil { + t.Fatal(err) + } + if !bytes.Equal(conn.ConnectionState().TLSUnique, <-serverTLSUniques) { + t.Error("client and server channel bindings differ") + } + conn.Close() + + conn, err = Dial("tcp", ln.Addr().String(), &clientConfig) + if err != nil { + t.Fatal(err) + } + defer conn.Close() + if !conn.ConnectionState().DidResume { + t.Error("second session did not use resumption") + } + if !bytes.Equal(conn.ConnectionState().TLSUnique, <-serverTLSUniques) { + t.Error("client and server channel bindings differ when session resumption is used") + } +} + +func TestVerifyHostname(t *testing.T) { + testenv.MustHaveExternalNetwork(t) + + c, err := Dial("tcp", "www.google.com:https", nil) + if err != nil { + t.Fatal(err) + } + if err := c.VerifyHostname("www.google.com"); err != nil { + t.Fatalf("verify www.google.com: %v", err) + } + if err := c.VerifyHostname("www.yahoo.com"); err == nil { + t.Fatalf("verify www.yahoo.com succeeded") + } + + c, err = Dial("tcp", "www.google.com:https", &Config{InsecureSkipVerify: true}) + if err != nil { + t.Fatal(err) + } + if err := c.VerifyHostname("www.google.com"); err == nil { + t.Fatalf("verify www.google.com succeeded with InsecureSkipVerify=true") + } + if err := c.VerifyHostname("www.yahoo.com"); err == nil { + t.Fatalf("verify www.google.com succeeded with InsecureSkipVerify=true") + } +} + +func TestVerifyHostnameResumed(t *testing.T) { + testenv.MustHaveExternalNetwork(t) + + config := &Config{ + ClientSessionCache: NewLRUClientSessionCache(32), + } + for i := 0; i < 2; i++ { + c, err := Dial("tcp", "www.google.com:https", config) + if err != nil { + t.Fatalf("Dial #%d: %v", i, err) + } + cs := c.ConnectionState() + if i > 0 && !cs.DidResume { + t.Fatalf("Subsequent connection unexpectedly didn't resume") + } + if cs.VerifiedChains == nil { + t.Fatalf("Dial #%d: cs.VerifiedChains == nil", i) + } + if err := c.VerifyHostname("www.google.com"); err != nil { + t.Fatalf("verify www.google.com #%d: %v", i, err) + } + c.Close() + } +} diff --git a/src/crypto/x509/cert_pool.go b/src/crypto/x509/cert_pool.go new file mode 100644 index 0000000000000000000000000000000000000000..2362e84688d140179f5e77a0ef111056a13dc328 --- /dev/null +++ b/src/crypto/x509/cert_pool.go @@ -0,0 +1,116 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package x509 + +import ( + "encoding/pem" +) + +// CertPool is a set of certificates. +type CertPool struct { + bySubjectKeyId map[string][]int + byName map[string][]int + certs []*Certificate +} + +// NewCertPool returns a new, empty CertPool. +func NewCertPool() *CertPool { + return &CertPool{ + make(map[string][]int), + make(map[string][]int), + nil, + } +} + +// findVerifiedParents attempts to find certificates in s which have signed the +// given certificate. If any candidates were rejected then errCert will be set +// to one of them, arbitrarily, and err will contain the reason that it was +// rejected. +func (s *CertPool) findVerifiedParents(cert *Certificate) (parents []int, errCert *Certificate, err error) { + if s == nil { + return + } + var candidates []int + + if len(cert.AuthorityKeyId) > 0 { + candidates = s.bySubjectKeyId[string(cert.AuthorityKeyId)] + } + if len(candidates) == 0 { + candidates = s.byName[string(cert.RawIssuer)] + } + + for _, c := range candidates { + if err = cert.CheckSignatureFrom(s.certs[c]); err == nil { + parents = append(parents, c) + } else { + errCert = s.certs[c] + } + } + + return +} + +// AddCert adds a certificate to a pool. +func (s *CertPool) AddCert(cert *Certificate) { + if cert == nil { + panic("adding nil Certificate to CertPool") + } + + // Check that the certificate isn't being added twice. + for _, c := range s.certs { + if c.Equal(cert) { + return + } + } + + n := len(s.certs) + s.certs = append(s.certs, cert) + + if len(cert.SubjectKeyId) > 0 { + keyId := string(cert.SubjectKeyId) + s.bySubjectKeyId[keyId] = append(s.bySubjectKeyId[keyId], n) + } + name := string(cert.RawSubject) + s.byName[name] = append(s.byName[name], n) +} + +// AppendCertsFromPEM attempts to parse a series of PEM encoded certificates. +// It appends any certificates found to s and reports whether any certificates +// were successfully parsed. +// +// On many Linux systems, /etc/ssl/cert.pem will contain the system wide set +// of root CAs in a format suitable for this function. +func (s *CertPool) AppendCertsFromPEM(pemCerts []byte) (ok bool) { + for len(pemCerts) > 0 { + var block *pem.Block + block, pemCerts = pem.Decode(pemCerts) + if block == nil { + break + } + if block.Type != "CERTIFICATE" || len(block.Headers) != 0 { + continue + } + + cert, err := ParseCertificate(block.Bytes) + if err != nil { + continue + } + + s.AddCert(cert) + ok = true + } + + return +} + +// Subjects returns a list of the DER-encoded subjects of +// all of the certificates in the pool. +func (s *CertPool) Subjects() (res [][]byte) { + res = make([][]byte, len(s.certs)) + for i, c := range s.certs { + res[i] = c.RawSubject + } + return +} diff --git a/src/crypto/x509/example_test.go b/src/crypto/x509/example_test.go new file mode 100644 index 0000000000000000000000000000000000000000..29e7c21397516119614bffc6eedd30fec344c967 --- /dev/null +++ b/src/crypto/x509/example_test.go @@ -0,0 +1,91 @@ +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package x509_test + +import ( + "crypto/x509" + "encoding/pem" +) + +func ExampleCertificate_Verify() { + // Verifying with a custom list of root certificates. + + const rootPEM = ` +-----BEGIN CERTIFICATE----- +MIIEBDCCAuygAwIBAgIDAjppMA0GCSqGSIb3DQEBBQUAMEIxCzAJBgNVBAYTAlVT +MRYwFAYDVQQKEw1HZW9UcnVzdCBJbmMuMRswGQYDVQQDExJHZW9UcnVzdCBHbG9i +YWwgQ0EwHhcNMTMwNDA1MTUxNTU1WhcNMTUwNDA0MTUxNTU1WjBJMQswCQYDVQQG +EwJVUzETMBEGA1UEChMKR29vZ2xlIEluYzElMCMGA1UEAxMcR29vZ2xlIEludGVy +bmV0IEF1dGhvcml0eSBHMjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB +AJwqBHdc2FCROgajguDYUEi8iT/xGXAaiEZ+4I/F8YnOIe5a/mENtzJEiaB0C1NP +VaTOgmKV7utZX8bhBYASxF6UP7xbSDj0U/ck5vuR6RXEz/RTDfRK/J9U3n2+oGtv +h8DQUB8oMANA2ghzUWx//zo8pzcGjr1LEQTrfSTe5vn8MXH7lNVg8y5Kr0LSy+rE +ahqyzFPdFUuLH8gZYR/Nnag+YyuENWllhMgZxUYi+FOVvuOAShDGKuy6lyARxzmZ +EASg8GF6lSWMTlJ14rbtCMoU/M4iarNOz0YDl5cDfsCx3nuvRTPPuj5xt970JSXC +DTWJnZ37DhF5iR43xa+OcmkCAwEAAaOB+zCB+DAfBgNVHSMEGDAWgBTAephojYn7 +qwVkDBF9qn1luMrMTjAdBgNVHQ4EFgQUSt0GFhu89mi1dvWBtrtiGrpagS8wEgYD +VR0TAQH/BAgwBgEB/wIBADAOBgNVHQ8BAf8EBAMCAQYwOgYDVR0fBDMwMTAvoC2g +K4YpaHR0cDovL2NybC5nZW90cnVzdC5jb20vY3Jscy9ndGdsb2JhbC5jcmwwPQYI +KwYBBQUHAQEEMTAvMC0GCCsGAQUFBzABhiFodHRwOi8vZ3RnbG9iYWwtb2NzcC5n +ZW90cnVzdC5jb20wFwYDVR0gBBAwDjAMBgorBgEEAdZ5AgUBMA0GCSqGSIb3DQEB +BQUAA4IBAQA21waAESetKhSbOHezI6B1WLuxfoNCunLaHtiONgaX4PCVOzf9G0JY +/iLIa704XtE7JW4S615ndkZAkNoUyHgN7ZVm2o6Gb4ChulYylYbc3GrKBIxbf/a/ +zG+FA1jDaFETzf3I93k9mTXwVqO94FntT0QJo544evZG0R0SnU++0ED8Vf4GXjza +HFa9llF7b1cq26KqltyMdMKVvvBulRP/F/A8rLIQjcxz++iPAsbw+zOzlTvjwsto +WHPbqCRiOwY1nQ2pM714A5AuTHhdUDqB1O6gyHA43LL5Z/qHQF1hwFGPa4NrzQU6 +yuGnBXj8ytqU0CwIPX4WecigUCAkVDNx +-----END CERTIFICATE-----` + + const certPEM = ` +-----BEGIN CERTIFICATE----- +MIIDujCCAqKgAwIBAgIIE31FZVaPXTUwDQYJKoZIhvcNAQEFBQAwSTELMAkGA1UE +BhMCVVMxEzARBgNVBAoTCkdvb2dsZSBJbmMxJTAjBgNVBAMTHEdvb2dsZSBJbnRl +cm5ldCBBdXRob3JpdHkgRzIwHhcNMTQwMTI5MTMyNzQzWhcNMTQwNTI5MDAwMDAw +WjBpMQswCQYDVQQGEwJVUzETMBEGA1UECAwKQ2FsaWZvcm5pYTEWMBQGA1UEBwwN +TW91bnRhaW4gVmlldzETMBEGA1UECgwKR29vZ2xlIEluYzEYMBYGA1UEAwwPbWFp +bC5nb29nbGUuY29tMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEfRrObuSW5T7q +5CnSEqefEmtH4CCv6+5EckuriNr1CjfVvqzwfAhopXkLrq45EQm8vkmf7W96XJhC +7ZM0dYi1/qOCAU8wggFLMB0GA1UdJQQWMBQGCCsGAQUFBwMBBggrBgEFBQcDAjAa +BgNVHREEEzARgg9tYWlsLmdvb2dsZS5jb20wCwYDVR0PBAQDAgeAMGgGCCsGAQUF +BwEBBFwwWjArBggrBgEFBQcwAoYfaHR0cDovL3BraS5nb29nbGUuY29tL0dJQUcy +LmNydDArBggrBgEFBQcwAYYfaHR0cDovL2NsaWVudHMxLmdvb2dsZS5jb20vb2Nz +cDAdBgNVHQ4EFgQUiJxtimAuTfwb+aUtBn5UYKreKvMwDAYDVR0TAQH/BAIwADAf +BgNVHSMEGDAWgBRK3QYWG7z2aLV29YG2u2IaulqBLzAXBgNVHSAEEDAOMAwGCisG +AQQB1nkCBQEwMAYDVR0fBCkwJzAloCOgIYYfaHR0cDovL3BraS5nb29nbGUuY29t +L0dJQUcyLmNybDANBgkqhkiG9w0BAQUFAAOCAQEAH6RYHxHdcGpMpFE3oxDoFnP+ +gtuBCHan2yE2GRbJ2Cw8Lw0MmuKqHlf9RSeYfd3BXeKkj1qO6TVKwCh+0HdZk283 +TZZyzmEOyclm3UGFYe82P/iDFt+CeQ3NpmBg+GoaVCuWAARJN/KfglbLyyYygcQq +0SgeDh8dRKUiaW3HQSoYvTvdTuqzwK4CXsr3b5/dAOY8uMuG/IAR3FgwTbZ1dtoW +RvOTa8hYiU6A475WuZKyEHcwnGYe57u2I2KbMgcKjPniocj4QzgYsVAVKW3IwaOh +yE+vPxsiUkvQHdO2fojCkY8jg70jxM+gu59tPDNbw3Uh/2Ij310FgTHsnGQMyA== +-----END CERTIFICATE-----` + + // First, create the set of root certificates. For this example we only + // have one. It's also possible to omit this in order to use the + // default root set of the current operating system. + roots := x509.NewCertPool() + ok := roots.AppendCertsFromPEM([]byte(rootPEM)) + if !ok { + panic("failed to parse root certificate") + } + + block, _ := pem.Decode([]byte(certPEM)) + if block == nil { + panic("failed to parse certificate PEM") + } + cert, err := x509.ParseCertificate(block.Bytes) + if err != nil { + panic("failed to parse certificate: " + err.Error()) + } + + opts := x509.VerifyOptions{ + DNSName: "mail.google.com", + Roots: roots, + } + + if _, err := cert.Verify(opts); err != nil { + panic("failed to verify certificate: " + err.Error()) + } +} diff --git a/src/crypto/x509/pem_decrypt.go b/src/crypto/x509/pem_decrypt.go new file mode 100644 index 0000000000000000000000000000000000000000..49ceadb4366fc6666b406d8bbd64deb7ccfce4e5 --- /dev/null +++ b/src/crypto/x509/pem_decrypt.go @@ -0,0 +1,240 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package x509 + +// RFC 1423 describes the encryption of PEM blocks. The algorithm used to +// generate a key from the password was derived by looking at the OpenSSL +// implementation. + +import ( + "crypto/aes" + "crypto/cipher" + "crypto/des" + "crypto/md5" + "encoding/hex" + "encoding/pem" + "errors" + "io" + "strings" +) + +type PEMCipher int + +// Possible values for the EncryptPEMBlock encryption algorithm. +const ( + _ PEMCipher = iota + PEMCipherDES + PEMCipher3DES + PEMCipherAES128 + PEMCipherAES192 + PEMCipherAES256 +) + +// rfc1423Algo holds a method for enciphering a PEM block. +type rfc1423Algo struct { + cipher PEMCipher + name string + cipherFunc func(key []byte) (cipher.Block, error) + keySize int + blockSize int +} + +// rfc1423Algos holds a slice of the possible ways to encrypt a PEM +// block. The ivSize numbers were taken from the OpenSSL source. +var rfc1423Algos = []rfc1423Algo{{ + cipher: PEMCipherDES, + name: "DES-CBC", + cipherFunc: des.NewCipher, + keySize: 8, + blockSize: des.BlockSize, +}, { + cipher: PEMCipher3DES, + name: "DES-EDE3-CBC", + cipherFunc: des.NewTripleDESCipher, + keySize: 24, + blockSize: des.BlockSize, +}, { + cipher: PEMCipherAES128, + name: "AES-128-CBC", + cipherFunc: aes.NewCipher, + keySize: 16, + blockSize: aes.BlockSize, +}, { + cipher: PEMCipherAES192, + name: "AES-192-CBC", + cipherFunc: aes.NewCipher, + keySize: 24, + blockSize: aes.BlockSize, +}, { + cipher: PEMCipherAES256, + name: "AES-256-CBC", + cipherFunc: aes.NewCipher, + keySize: 32, + blockSize: aes.BlockSize, +}, +} + +// deriveKey uses a key derivation function to stretch the password into a key +// with the number of bits our cipher requires. This algorithm was derived from +// the OpenSSL source. +func (c rfc1423Algo) deriveKey(password, salt []byte) []byte { + hash := md5.New() + out := make([]byte, c.keySize) + var digest []byte + + for i := 0; i < len(out); i += len(digest) { + hash.Reset() + hash.Write(digest) + hash.Write(password) + hash.Write(salt) + digest = hash.Sum(digest[:0]) + copy(out[i:], digest) + } + return out +} + +// IsEncryptedPEMBlock returns if the PEM block is password encrypted. +func IsEncryptedPEMBlock(b *pem.Block) bool { + _, ok := b.Headers["DEK-Info"] + return ok +} + +// IncorrectPasswordError is returned when an incorrect password is detected. +var IncorrectPasswordError = errors.New("x509: decryption password incorrect") + +// DecryptPEMBlock takes a password encrypted PEM block and the password used to +// encrypt it and returns a slice of decrypted DER encoded bytes. It inspects +// the DEK-Info header to determine the algorithm used for decryption. If no +// DEK-Info header is present, an error is returned. If an incorrect password +// is detected an IncorrectPasswordError is returned. Because of deficiencies +// in the encrypted-PEM format, it's not always possible to detect an incorrect +// password. In these cases no error will be returned but the decrypted DER +// bytes will be random noise. +func DecryptPEMBlock(b *pem.Block, password []byte) ([]byte, error) { + dek, ok := b.Headers["DEK-Info"] + if !ok { + return nil, errors.New("x509: no DEK-Info header in block") + } + + idx := strings.Index(dek, ",") + if idx == -1 { + return nil, errors.New("x509: malformed DEK-Info header") + } + + mode, hexIV := dek[:idx], dek[idx+1:] + ciph := cipherByName(mode) + if ciph == nil { + return nil, errors.New("x509: unknown encryption mode") + } + iv, err := hex.DecodeString(hexIV) + if err != nil { + return nil, err + } + if len(iv) != ciph.blockSize { + return nil, errors.New("x509: incorrect IV size") + } + + // Based on the OpenSSL implementation. The salt is the first 8 bytes + // of the initialization vector. + key := ciph.deriveKey(password, iv[:8]) + block, err := ciph.cipherFunc(key) + if err != nil { + return nil, err + } + + if len(b.Bytes)%block.BlockSize() != 0 { + return nil, errors.New("x509: encrypted PEM data is not a multiple of the block size") + } + + data := make([]byte, len(b.Bytes)) + dec := cipher.NewCBCDecrypter(block, iv) + dec.CryptBlocks(data, b.Bytes) + + // Blocks are padded using a scheme where the last n bytes of padding are all + // equal to n. It can pad from 1 to blocksize bytes inclusive. See RFC 1423. + // For example: + // [x y z 2 2] + // [x y 7 7 7 7 7 7 7] + // If we detect a bad padding, we assume it is an invalid password. + dlen := len(data) + if dlen == 0 || dlen%ciph.blockSize != 0 { + return nil, errors.New("x509: invalid padding") + } + last := int(data[dlen-1]) + if dlen < last { + return nil, IncorrectPasswordError + } + if last == 0 || last > ciph.blockSize { + return nil, IncorrectPasswordError + } + for _, val := range data[dlen-last:] { + if int(val) != last { + return nil, IncorrectPasswordError + } + } + return data[:dlen-last], nil +} + +// EncryptPEMBlock returns a PEM block of the specified type holding the +// given DER-encoded data encrypted with the specified algorithm and +// password. +func EncryptPEMBlock(rand io.Reader, blockType string, data, password []byte, alg PEMCipher) (*pem.Block, error) { + ciph := cipherByKey(alg) + if ciph == nil { + return nil, errors.New("x509: unknown encryption mode") + } + iv := make([]byte, ciph.blockSize) + if _, err := io.ReadFull(rand, iv); err != nil { + return nil, errors.New("x509: cannot generate IV: " + err.Error()) + } + // The salt is the first 8 bytes of the initialization vector, + // matching the key derivation in DecryptPEMBlock. + key := ciph.deriveKey(password, iv[:8]) + block, err := ciph.cipherFunc(key) + if err != nil { + return nil, err + } + enc := cipher.NewCBCEncrypter(block, iv) + pad := ciph.blockSize - len(data)%ciph.blockSize + encrypted := make([]byte, len(data), len(data)+pad) + // We could save this copy by encrypting all the whole blocks in + // the data separately, but it doesn't seem worth the additional + // code. + copy(encrypted, data) + // See RFC 1423, section 1.1 + for i := 0; i < pad; i++ { + encrypted = append(encrypted, byte(pad)) + } + enc.CryptBlocks(encrypted, encrypted) + + return &pem.Block{ + Type: blockType, + Headers: map[string]string{ + "Proc-Type": "4,ENCRYPTED", + "DEK-Info": ciph.name + "," + hex.EncodeToString(iv), + }, + Bytes: encrypted, + }, nil +} + +func cipherByName(name string) *rfc1423Algo { + for i := range rfc1423Algos { + alg := &rfc1423Algos[i] + if alg.name == name { + return alg + } + } + return nil +} + +func cipherByKey(key PEMCipher) *rfc1423Algo { + for i := range rfc1423Algos { + alg := &rfc1423Algos[i] + if alg.cipher == key { + return alg + } + } + return nil +} diff --git a/src/crypto/x509/pem_decrypt_test.go b/src/crypto/x509/pem_decrypt_test.go new file mode 100644 index 0000000000000000000000000000000000000000..685d5ee15697cb00d4efdb7b60a2d39cdda754a2 --- /dev/null +++ b/src/crypto/x509/pem_decrypt_test.go @@ -0,0 +1,247 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package x509 + +import ( + "bytes" + "crypto/rand" + "encoding/base64" + "encoding/pem" + "strings" + "testing" +) + +func TestDecrypt(t *testing.T) { + for i, data := range testData { + t.Logf("test %v. %v", i, data.kind) + block, rest := pem.Decode(data.pemData) + if len(rest) > 0 { + t.Error("extra data") + } + der, err := DecryptPEMBlock(block, data.password) + if err != nil { + t.Error("decrypt failed: ", err) + continue + } + if _, err := ParsePKCS1PrivateKey(der); err != nil { + t.Error("invalid private key: ", err) + } + plainDER, err := base64.StdEncoding.DecodeString(data.plainDER) + if err != nil { + t.Fatal("cannot decode test DER data: ", err) + } + if !bytes.Equal(der, plainDER) { + t.Error("data mismatch") + } + } +} + +func TestEncrypt(t *testing.T) { + for i, data := range testData { + t.Logf("test %v. %v", i, data.kind) + plainDER, err := base64.StdEncoding.DecodeString(data.plainDER) + if err != nil { + t.Fatal("cannot decode test DER data: ", err) + } + password := []byte("kremvax1") + block, err := EncryptPEMBlock(rand.Reader, "RSA PRIVATE KEY", plainDER, password, data.kind) + if err != nil { + t.Error("encrypt: ", err) + continue + } + if !IsEncryptedPEMBlock(block) { + t.Error("PEM block does not appear to be encrypted") + } + if block.Type != "RSA PRIVATE KEY" { + t.Errorf("unexpected block type; got %q want %q", block.Type, "RSA PRIVATE KEY") + } + if block.Headers["Proc-Type"] != "4,ENCRYPTED" { + t.Errorf("block does not have correct Proc-Type header") + } + der, err := DecryptPEMBlock(block, password) + if err != nil { + t.Error("decrypt: ", err) + continue + } + if !bytes.Equal(der, plainDER) { + t.Errorf("data mismatch") + } + } +} + +var testData = []struct { + kind PEMCipher + password []byte + pemData []byte + plainDER string +}{ + { + kind: PEMCipherDES, + password: []byte("asdf"), + pemData: []byte(` +-----BEGIN RSA PRIVATE KEY----- +Proc-Type: 4,ENCRYPTED +DEK-Info: DES-CBC,34F09A4FC8DE22B5 + +WXxy8kbZdiZvANtKvhmPBLV7eVFj2A5z6oAxvI9KGyhG0ZK0skfnt00C24vfU7m5 +ICXeoqP67lzJ18xCzQfHjDaBNs53DSDT+Iz4e8QUep1xQ30+8QKX2NA2coee3nwc +6oM1cuvhNUDemBH2i3dKgMVkfaga0zQiiOq6HJyGSncCMSruQ7F9iWEfRbFcxFCx +qtHb1kirfGKEtgWTF+ynyco6+2gMXNu70L7nJcnxnV/RLFkHt7AUU1yrclxz7eZz +XOH9VfTjb52q/I8Suozq9coVQwg4tXfIoYUdT//O+mB7zJb9HI9Ps77b9TxDE6Gm +4C9brwZ3zg2vqXcwwV6QRZMtyll9rOpxkbw6NPlpfBqkc3xS51bbxivbO/Nve4KD +r12ymjFNF4stXCfJnNqKoZ50BHmEEUDu5Wb0fpVn82XrGw7CYc4iug== +-----END RSA PRIVATE KEY-----`), + plainDER: ` +MIIBPAIBAAJBAPASZe+tCPU6p80AjHhDkVsLYa51D35e/YGa8QcZyooeZM8EHozo +KD0fNiKI+53bHdy07N+81VQ8/ejPcRoXPlsCAwEAAQJBAMTxIuSq27VpR+zZ7WJf +c6fvv1OBvpMZ0/d1pxL/KnOAgq2rD5hDtk9b0LGhTPgQAmrrMTKuSeGoIuYE+gKQ +QvkCIQD+GC1m+/do+QRurr0uo46Kx1LzLeSCrjBk34wiOp2+dwIhAPHfTLRXS2fv +7rljm0bYa4+eDZpz+E8RcXEgzhhvcQQ9AiAI5eHZJGOyml3MXnQjiPi55WcDOw0w +glcRgT6QCEtz2wIhANSyqaFtosIkHKqrDUGfz/bb5tqMYTAnBruVPaf/WEOBAiEA +9xORWeRG1tRpso4+dYy4KdDkuLPIO01KY6neYGm3BCM=`, + }, + { + kind: PEMCipher3DES, + password: []byte("asdf"), + pemData: []byte(` +-----BEGIN RSA PRIVATE KEY----- +Proc-Type: 4,ENCRYPTED +DEK-Info: DES-EDE3-CBC,C1F4A6A03682C2C7 + +0JqVdBEH6iqM7drTkj+e2W/bE3LqakaiWhb9WUVonFkhyu8ca/QzebY3b5gCvAZQ +YwBvDcT/GHospKqPx+cxDHJNsUASDZws6bz8ZXWJGwZGExKzr0+Qx5fgXn44Ms3x +8g1ENFuTXtxo+KoNK0zuAMAqp66Llcds3Fjl4XR18QaD0CrVNAfOdgATWZm5GJxk +Fgx5f84nT+/ovvreG+xeOzWgvtKo0UUZVrhGOgfKLpa57adumcJ6SkUuBtEFpZFB +ldw5w7WC7d13x2LsRkwo8ZrDKgIV+Y9GNvhuCCkTzNP0V3gNeJpd201HZHR+9n3w +3z0VjR/MGqsfcy1ziEWMNOO53At3zlG6zP05aHMnMcZoVXadEK6L1gz++inSSDCq +gI0UJP4e3JVB7AkgYymYAwiYALAkoEIuanxoc50njJk= +-----END RSA PRIVATE KEY-----`), + plainDER: ` +MIIBOwIBAAJBANOCXKdoNS/iP/MAbl9cf1/SF3P+Ns7ZeNL27CfmDh0O6Zduaax5 +NBiumd2PmjkaCu7lQ5JOibHfWn+xJsc3kw0CAwEAAQJANX/W8d1Q/sCqzkuAn4xl +B5a7qfJWaLHndu1QRLNTRJPn0Ee7OKJ4H0QKOhQM6vpjRrz+P2u9thn6wUxoPsef +QQIhAP/jCkfejFcy4v15beqKzwz08/tslVjF+Yq41eJGejmxAiEA05pMoqfkyjcx +fyvGhpoOyoCp71vSGUfR2I9CR65oKh0CIC1Msjs66LlfJtQctRq6bCEtFCxEcsP+ +eEjYo/Sk6WphAiEAxpgWPMJeU/shFT28gS+tmhjPZLpEoT1qkVlC14u0b3ECIQDX +tZZZxCtPAm7shftEib0VU77Lk8MsXJcx2C4voRsjEw==`, + }, + { + kind: PEMCipherAES128, + password: []byte("asdf"), + pemData: []byte(` +-----BEGIN RSA PRIVATE KEY----- +Proc-Type: 4,ENCRYPTED +DEK-Info: AES-128-CBC,D4492E793FC835CC038A728ED174F78A + +EyfQSzXSjv6BaNH+NHdXRlkHdimpF9izWlugVJAPApgXrq5YldPe2aGIOFXyJ+QE +ZIG20DYqaPzJRjTEbPNZ6Es0S2JJ5yCpKxwJuDkgJZKtF39Q2i36JeGbSZQIuWJE +GZbBpf1jDH/pr0iGonuAdl2PCCZUiy+8eLsD2tyviHUkFLOB+ykYoJ5t8ngZ/B6D +33U43LLb7+9zD4y3Q9OVHqBFGyHcxCY9+9Qh4ZnFp7DTf6RY5TNEvE3s4g6aDpBs +3NbvRVvYTgs8K9EPk4K+5R+P2kD8J8KvEIGxVa1vz8QoCJ/jr7Ka2rvNgPCex5/E +080LzLHPCrXKdlr/f50yhNWq08ZxMWQFkui+FDHPDUaEELKAXV8/5PDxw80Rtybo +AVYoCVIbZXZCuCO81op8UcOgEpTtyU5Lgh3Mw5scQL0= +-----END RSA PRIVATE KEY-----`), + plainDER: ` +MIIBOgIBAAJBAMBlj5FxYtqbcy8wY89d/S7n0+r5MzD9F63BA/Lpl78vQKtdJ5dT +cDGh/rBt1ufRrNp0WihcmZi7Mpl/3jHjiWECAwEAAQJABNOHYnKhtDIqFYj1OAJ3 +k3GlU0OlERmIOoeY/cL2V4lgwllPBEs7r134AY4wMmZSBUj8UR/O4SNO668ElKPE +cQIhAOuqY7/115x5KCdGDMWi+jNaMxIvI4ETGwV40ykGzqlzAiEA0P9oEC3m9tHB +kbpjSTxaNkrXxDgdEOZz8X0uOUUwHNsCIAwzcSCiGLyYJTULUmP1ESERfW1mlV78 +XzzESaJpIM/zAiBQkSTcl9VhcJreQqvjn5BnPZLP4ZHS4gPwJAGdsj5J4QIhAOVR +B3WlRNTXR2WsJ5JdByezg9xzdXzULqmga0OE339a`, + }, + { + kind: PEMCipherAES192, + password: []byte("asdf"), + pemData: []byte(` +-----BEGIN RSA PRIVATE KEY----- +Proc-Type: 4,ENCRYPTED +DEK-Info: AES-192-CBC,E2C9FB02BCA23ADE1829F8D8BC5F5369 + +cqVslvHqDDM6qwU6YjezCRifXmKsrgEev7ng6Qs7UmDJOpHDgJQZI9fwMFUhIyn5 +FbCu1SHkLMW52Ld3CuEqMnzWMlhPrW8tFvUOrMWPYSisv7nNq88HobZEJcUNL2MM +Y15XmHW6IJwPqhKyLHpWXyOCVEh4ODND2nV15PCoi18oTa475baxSk7+1qH7GuIs +Rb7tshNTMqHbCpyo9Rn3UxeFIf9efdl8YLiMoIqc7J8E5e9VlbeQSdLMQOgDAQJG +ReUtTw8exmKsY4gsSjhkg5uiw7/ZB1Ihto0qnfQJgjGc680qGkT1d6JfvOfeYAk6 +xn5RqS/h8rYAYm64KnepfC9vIujo4NqpaREDmaLdX5MJPQ+SlytITQvgUsUq3q/t +Ss85xjQEZH3hzwjQqdJvmA4hYP6SUjxYpBM+02xZ1Xw= +-----END RSA PRIVATE KEY-----`), + plainDER: ` +MIIBOwIBAAJBAMGcRrZiNNmtF20zyS6MQ7pdGx17aFDl+lTl+qnLuJRUCMUG05xs +OmxmL/O1Qlf+bnqR8Bgg65SfKg21SYuLhiMCAwEAAQJBAL94uuHyO4wux2VC+qpj +IzPykjdU7XRcDHbbvksf4xokSeUFjjD3PB0Qa83M94y89ZfdILIqS9x5EgSB4/lX +qNkCIQD6cCIqLfzq/lYbZbQgAAjpBXeQVYsbvVtJrPrXJAlVVQIhAMXpDKMeFPMn +J0g2rbx1gngx0qOa5r5iMU5w/noN4W2XAiBjf+WzCG5yFvazD+dOx3TC0A8+4x3P +uZ3pWbaXf5PNuQIgAcdXarvhelH2w2piY1g3BPeFqhzBSCK/yLGxR82KIh8CIQDD ++qGKsd09NhQ/G27y/DARzOYtml1NvdmCQAgsDIIOLA==`, + }, + { + kind: PEMCipherAES256, + password: []byte("asdf"), + pemData: []byte(` +-----BEGIN RSA PRIVATE KEY----- +Proc-Type: 4,ENCRYPTED +DEK-Info: AES-256-CBC,8E7ED5CD731902CE938957A886A5FFBD + +4Mxr+KIzRVwoOP0wwq6caSkvW0iS+GE2h2Ov/u+n9ZTMwL83PRnmjfjzBgfRZLVf +JFPXxUK26kMNpIdssNnqGOds+DhB+oSrsNKoxgxSl5OBoYv9eJTVYm7qOyAFIsjr +DRKAcjYCmzfesr7PVTowwy0RtHmYwyXMGDlAzzZrEvaiySFFmMyKKvtoavwaFoc7 +Pz3RZScwIuubzTGJ1x8EzdffYOsdCa9Mtgpp3L136+23dOd6L/qK2EG2fzrJSHs/ +2XugkleBFSMKzEp9mxXKRfa++uidQvMZTFLDK9w5YjrRvMBo/l2BoZIsq0jAIE1N +sv5Z/KwlX+3MDEpPQpUwGPlGGdLnjI3UZ+cjgqBcoMiNc6HfgbBgYJSU6aDSHuCk +clCwByxWkBNgJ2GrkwNrF26v+bGJJJNR4SKouY1jQf0= +-----END RSA PRIVATE KEY-----`), + plainDER: ` +MIIBOgIBAAJBAKy3GFkstoCHIEeUU/qO8207m8WSrjksR+p9B4tf1w5k+2O1V/GY +AQ5WFCApItcOkQe/I0yZZJk/PmCqMzSxrc8CAwEAAQJAOCAz0F7AW9oNelVQSP8F +Sfzx7O1yom+qWyAQQJF/gFR11gpf9xpVnnyu1WxIRnDUh1LZwUsjwlDYb7MB74id +oQIhANPcOiLwOPT4sIUpRM5HG6BF1BI7L77VpyGVk8xNP7X/AiEA0LMHZtk4I+lJ +nClgYp4Yh2JZ1Znbu7IoQMCEJCjwKDECIGd8Dzm5tViTkUW6Hs3Tlf73nNs65duF +aRnSglss8I3pAiEAonEnKruawgD8RavDFR+fUgmQiPz4FnGGeVgfwpGG1JECIBYq +PXHYtPqxQIbD2pScR5qum7iGUh11lEUPkmt+2uqS`, + }, + { + // generated with: + // openssl genrsa -aes128 -passout pass:asdf -out server.orig.key 128 + kind: PEMCipherAES128, + password: []byte("asdf"), + pemData: []byte(` +-----BEGIN RSA PRIVATE KEY----- +Proc-Type: 4,ENCRYPTED +DEK-Info: AES-128-CBC,74611ABC2571AF11B1BF9B69E62C89E7 + +6ei/MlytjE0FFgZOGQ+jrwomKfpl8kdefeE0NSt/DMRrw8OacHAzBNi3pPEa0eX3 +eND9l7C9meCirWovjj9QWVHrXyugFuDIqgdhQ8iHTgCfF3lrmcttVrbIfMDw+smD +hTP8O1mS/MHl92NE0nhv0w== +-----END RSA PRIVATE KEY-----`), + plainDER: ` +MGMCAQACEQC6ssxmYuauuHGOCDAI54RdAgMBAAECEQCWIn6Yv2O+kBcDF7STctKB +AgkA8SEfu/2i3g0CCQDGNlXbBHX7kQIIK3Ww5o0cYbECCQDCimPb0dYGsQIIeQ7A +jryIst8=`, + }, +} + +const incompleteBlockPEM = ` +-----BEGIN RSA PRIVATE KEY----- +Proc-Type: 4,ENCRYPTED +DEK-Info: AES-128-CBC,74611ABC2571AF11B1BF9B69E62C89E7 + +6L8yXK2MTQUWBk4ZD6OvCiYp+mXyR1594TQ1K38MxGvDw5pwcDME2Lek8RrR5fd40P2XsL2Z4KKt +ai+OP1BZUetfK6AW4MiqB2FDyIdOAJ8XeWuZy21Wtsh8wPD6yYOFM/w7WZL8weX3Y0TSeG/T +-----END RSA PRIVATE KEY-----` + +func TestIncompleteBlock(t *testing.T) { + // incompleteBlockPEM contains ciphertext that is not a multiple of the + // block size. This previously panicked. See #11215. + block, _ := pem.Decode([]byte(incompleteBlockPEM)) + _, err := DecryptPEMBlock(block, []byte("foo")) + if err == nil { + t.Fatal("Bad PEM data decrypted successfully") + } + const expectedSubstr = "block size" + if e := err.Error(); !strings.Contains(e, expectedSubstr) { + t.Fatalf("Expected error containing %q but got: %q", expectedSubstr, e) + } +} diff --git a/src/crypto/x509/pkcs1.go b/src/crypto/x509/pkcs1.go new file mode 100644 index 0000000000000000000000000000000000000000..acebe3513981aaad060a1d8816c8f2ad93262f03 --- /dev/null +++ b/src/crypto/x509/pkcs1.go @@ -0,0 +1,122 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package x509 + +import ( + "crypto/rsa" + "encoding/asn1" + "errors" + "math/big" +) + +// pkcs1PrivateKey is a structure which mirrors the PKCS#1 ASN.1 for an RSA private key. +type pkcs1PrivateKey struct { + Version int + N *big.Int + E int + D *big.Int + P *big.Int + Q *big.Int + // We ignore these values, if present, because rsa will calculate them. + Dp *big.Int `asn1:"optional"` + Dq *big.Int `asn1:"optional"` + Qinv *big.Int `asn1:"optional"` + + AdditionalPrimes []pkcs1AdditionalRSAPrime `asn1:"optional,omitempty"` +} + +type pkcs1AdditionalRSAPrime struct { + Prime *big.Int + + // We ignore these values because rsa will calculate them. + Exp *big.Int + Coeff *big.Int +} + +// ParsePKCS1PrivateKey returns an RSA private key from its ASN.1 PKCS#1 DER encoded form. +func ParsePKCS1PrivateKey(der []byte) (key *rsa.PrivateKey, err error) { + var priv pkcs1PrivateKey + rest, err := asn1.Unmarshal(der, &priv) + if len(rest) > 0 { + err = asn1.SyntaxError{Msg: "trailing data"} + return + } + if err != nil { + return + } + + if priv.Version > 1 { + return nil, errors.New("x509: unsupported private key version") + } + + if priv.N.Sign() <= 0 || priv.D.Sign() <= 0 || priv.P.Sign() <= 0 || priv.Q.Sign() <= 0 { + return nil, errors.New("x509: private key contains zero or negative value") + } + + key = new(rsa.PrivateKey) + key.PublicKey = rsa.PublicKey{ + E: priv.E, + N: priv.N, + } + + key.D = priv.D + key.Primes = make([]*big.Int, 2+len(priv.AdditionalPrimes)) + key.Primes[0] = priv.P + key.Primes[1] = priv.Q + for i, a := range priv.AdditionalPrimes { + if a.Prime.Sign() <= 0 { + return nil, errors.New("x509: private key contains zero or negative prime") + } + key.Primes[i+2] = a.Prime + // We ignore the other two values because rsa will calculate + // them as needed. + } + + err = key.Validate() + if err != nil { + return nil, err + } + key.Precompute() + + return +} + +// MarshalPKCS1PrivateKey converts a private key to ASN.1 DER encoded form. +func MarshalPKCS1PrivateKey(key *rsa.PrivateKey) []byte { + key.Precompute() + + version := 0 + if len(key.Primes) > 2 { + version = 1 + } + + priv := pkcs1PrivateKey{ + Version: version, + N: key.N, + E: key.PublicKey.E, + D: key.D, + P: key.Primes[0], + Q: key.Primes[1], + Dp: key.Precomputed.Dp, + Dq: key.Precomputed.Dq, + Qinv: key.Precomputed.Qinv, + } + + priv.AdditionalPrimes = make([]pkcs1AdditionalRSAPrime, len(key.Precomputed.CRTValues)) + for i, values := range key.Precomputed.CRTValues { + priv.AdditionalPrimes[i].Prime = key.Primes[2+i] + priv.AdditionalPrimes[i].Exp = values.Exp + priv.AdditionalPrimes[i].Coeff = values.Coeff + } + + b, _ := asn1.Marshal(priv) + return b +} + +// rsaPublicKey reflects the ASN.1 structure of a PKCS#1 public key. +type rsaPublicKey struct { + N *big.Int + E int +} diff --git a/src/crypto/x509/pkcs8.go b/src/crypto/x509/pkcs8.go new file mode 100644 index 0000000000000000000000000000000000000000..ba19989cba1311bf9efac6b6f259efcf41181d04 --- /dev/null +++ b/src/crypto/x509/pkcs8.go @@ -0,0 +1,54 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package x509 + +import ( + "crypto/x509/pkix" + "encoding/asn1" + "errors" + "fmt" +) + +// pkcs8 reflects an ASN.1, PKCS#8 PrivateKey. See +// ftp://ftp.rsasecurity.com/pub/pkcs/pkcs-8/pkcs-8v1_2.asn +// and RFC5208. +type pkcs8 struct { + Version int + Algo pkix.AlgorithmIdentifier + PrivateKey []byte + // optional attributes omitted. +} + +// ParsePKCS8PrivateKey parses an unencrypted, PKCS#8 private key. See +// http://www.rsa.com/rsalabs/node.asp?id=2130 and RFC5208. +func ParsePKCS8PrivateKey(der []byte) (key interface{}, err error) { + var privKey pkcs8 + if _, err := asn1.Unmarshal(der, &privKey); err != nil { + return nil, err + } + switch { + case privKey.Algo.Algorithm.Equal(oidPublicKeyRSA): + key, err = ParsePKCS1PrivateKey(privKey.PrivateKey) + if err != nil { + return nil, errors.New("x509: failed to parse RSA private key embedded in PKCS#8: " + err.Error()) + } + return key, nil + + case privKey.Algo.Algorithm.Equal(oidPublicKeyECDSA): + bytes := privKey.Algo.Parameters.FullBytes + namedCurveOID := new(asn1.ObjectIdentifier) + if _, err := asn1.Unmarshal(bytes, namedCurveOID); err != nil { + namedCurveOID = nil + } + key, err = parseECPrivateKey(namedCurveOID, privKey.PrivateKey) + if err != nil { + return nil, errors.New("x509: failed to parse EC private key embedded in PKCS#8: " + err.Error()) + } + return key, nil + + default: + return nil, fmt.Errorf("x509: PKCS#8 wrapping contained private key with unknown algorithm: %v", privKey.Algo.Algorithm) + } +} diff --git a/src/crypto/x509/pkcs8_test.go b/src/crypto/x509/pkcs8_test.go new file mode 100644 index 0000000000000000000000000000000000000000..4114efd0e0d1ad24c5d3aa736a37b92c3009d18c --- /dev/null +++ b/src/crypto/x509/pkcs8_test.go @@ -0,0 +1,28 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package x509 + +import ( + "encoding/hex" + "testing" +) + +var pkcs8RSAPrivateKeyHex = `30820278020100300d06092a864886f70d0101010500048202623082025e02010002818100cfb1b5bf9685ffa97b4f99df4ff122b70e59ac9b992f3bc2b3dde17d53c1a34928719b02e8fd17839499bfbd515bd6ef99c7a1c47a239718fe36bfd824c0d96060084b5f67f0273443007a24dfaf5634f7772c9346e10eb294c2306671a5a5e719ae24b4de467291bc571014b0e02dec04534d66a9bb171d644b66b091780e8d020301000102818100b595778383c4afdbab95d2bfed12b3f93bb0a73a7ad952f44d7185fd9ec6c34de8f03a48770f2009c8580bcd275e9632714e9a5e3f32f29dc55474b2329ff0ebc08b3ffcb35bc96e6516b483df80a4a59cceb71918cbabf91564e64a39d7e35dce21cb3031824fdbc845dba6458852ec16af5dddf51a8397a8797ae0337b1439024100ea0eb1b914158c70db39031dd8904d6f18f408c85fbbc592d7d20dee7986969efbda081fdf8bc40e1b1336d6b638110c836bfdc3f314560d2e49cd4fbde1e20b024100e32a4e793b574c9c4a94c8803db5152141e72d03de64e54ef2c8ed104988ca780cd11397bc359630d01b97ebd87067c5451ba777cf045ca23f5912f1031308c702406dfcdbbd5a57c9f85abc4edf9e9e29153507b07ce0a7ef6f52e60dcfebe1b8341babd8b789a837485da6c8d55b29bbb142ace3c24a1f5b54b454d01b51e2ad03024100bd6a2b60dee01e1b3bfcef6a2f09ed027c273cdbbaf6ba55a80f6dcc64e4509ee560f84b4f3e076bd03b11e42fe71a3fdd2dffe7e0902c8584f8cad877cdc945024100aa512fa4ada69881f1d8bb8ad6614f192b83200aef5edf4811313d5ef30a86cbd0a90f7b025c71ea06ec6b34db6306c86b1040670fd8654ad7291d066d06d031` + +// Generated using: +// openssl ecparam -genkey -name secp521r1 | openssl pkcs8 -topk8 -nocrypt +var pkcs8ECPrivateKeyHex = `3081ed020100301006072a8648ce3d020106052b810400230481d53081d20201010441850d81618c5da1aec74c2eed608ba816038506975e6427237c2def150c96a3b13efbfa1f89f1be15cdf4d0ac26422e680e65a0ddd4ad3541ad76165fbf54d6e34ba18189038186000400da97bcedba1eb6d30aeb93c9f9a1454598fa47278df27d6f60ea73eb672d8dc528a9b67885b5b5dcef93c9824f7449ab512ee6a27e76142f56b94b474cfd697e810046c8ca70419365245c1d7d44d0db82c334073835d002232714548abbae6e5700f5ef315ee08b929d8581383dcf2d1c98c2f8a9fccbf79c9579f7b2fd8a90115ac2` + +func TestPKCS8(t *testing.T) { + derBytes, _ := hex.DecodeString(pkcs8RSAPrivateKeyHex) + if _, err := ParsePKCS8PrivateKey(derBytes); err != nil { + t.Errorf("failed to decode PKCS8 with RSA private key: %s", err) + } + + derBytes, _ = hex.DecodeString(pkcs8ECPrivateKeyHex) + if _, err := ParsePKCS8PrivateKey(derBytes); err != nil { + t.Errorf("failed to decode PKCS8 with EC private key: %s", err) + } +} diff --git a/src/crypto/x509/pkix/pkix.go b/src/crypto/x509/pkix/pkix.go new file mode 100644 index 0000000000000000000000000000000000000000..5add4e5d3e0d0d5aab1a6be905fd2f6a68383bf6 --- /dev/null +++ b/src/crypto/x509/pkix/pkix.go @@ -0,0 +1,195 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package pkix contains shared, low level structures used for ASN.1 parsing +// and serialization of X.509 certificates, CRL and OCSP. +package pkix + +import ( + "encoding/asn1" + "math/big" + "time" +) + +// AlgorithmIdentifier represents the ASN.1 structure of the same name. See RFC +// 5280, section 4.1.1.2. +type AlgorithmIdentifier struct { + Algorithm asn1.ObjectIdentifier + Parameters asn1.RawValue `asn1:"optional"` +} + +type RDNSequence []RelativeDistinguishedNameSET + +type RelativeDistinguishedNameSET []AttributeTypeAndValue + +// AttributeTypeAndValue mirrors the ASN.1 structure of the same name in +// http://tools.ietf.org/html/rfc5280#section-4.1.2.4 +type AttributeTypeAndValue struct { + Type asn1.ObjectIdentifier + Value interface{} +} + +// AttributeTypeAndValueSET represents a set of ASN.1 sequences of +// AttributeTypeAndValue sequences from RFC 2986 (PKCS #10). +type AttributeTypeAndValueSET struct { + Type asn1.ObjectIdentifier + Value [][]AttributeTypeAndValue `asn1:"set"` +} + +// Extension represents the ASN.1 structure of the same name. See RFC +// 5280, section 4.2. +type Extension struct { + Id asn1.ObjectIdentifier + Critical bool `asn1:"optional"` + Value []byte +} + +// Name represents an X.509 distinguished name. This only includes the common +// elements of a DN. When parsing, all elements are stored in Names and +// non-standard elements can be extracted from there. When marshaling, elements +// in ExtraNames are appended and override other values with the same OID. +type Name struct { + Country, Organization, OrganizationalUnit []string + Locality, Province []string + StreetAddress, PostalCode []string + SerialNumber, CommonName string + + Names []AttributeTypeAndValue + ExtraNames []AttributeTypeAndValue +} + +func (n *Name) FillFromRDNSequence(rdns *RDNSequence) { + for _, rdn := range *rdns { + if len(rdn) == 0 { + continue + } + atv := rdn[0] + n.Names = append(n.Names, atv) + value, ok := atv.Value.(string) + if !ok { + continue + } + + t := atv.Type + if len(t) == 4 && t[0] == 2 && t[1] == 5 && t[2] == 4 { + switch t[3] { + case 3: + n.CommonName = value + case 5: + n.SerialNumber = value + case 6: + n.Country = append(n.Country, value) + case 7: + n.Locality = append(n.Locality, value) + case 8: + n.Province = append(n.Province, value) + case 9: + n.StreetAddress = append(n.StreetAddress, value) + case 10: + n.Organization = append(n.Organization, value) + case 11: + n.OrganizationalUnit = append(n.OrganizationalUnit, value) + case 17: + n.PostalCode = append(n.PostalCode, value) + } + } + } +} + +var ( + oidCountry = []int{2, 5, 4, 6} + oidOrganization = []int{2, 5, 4, 10} + oidOrganizationalUnit = []int{2, 5, 4, 11} + oidCommonName = []int{2, 5, 4, 3} + oidSerialNumber = []int{2, 5, 4, 5} + oidLocality = []int{2, 5, 4, 7} + oidProvince = []int{2, 5, 4, 8} + oidStreetAddress = []int{2, 5, 4, 9} + oidPostalCode = []int{2, 5, 4, 17} +) + +// appendRDNs appends a relativeDistinguishedNameSET to the given RDNSequence +// and returns the new value. The relativeDistinguishedNameSET contains an +// attributeTypeAndValue for each of the given values. See RFC 5280, A.1, and +// search for AttributeTypeAndValue. +func (n Name) appendRDNs(in RDNSequence, values []string, oid asn1.ObjectIdentifier) RDNSequence { + if len(values) == 0 || oidInAttributeTypeAndValue(oid, n.ExtraNames) { + return in + } + + s := make([]AttributeTypeAndValue, len(values)) + for i, value := range values { + s[i].Type = oid + s[i].Value = value + } + + return append(in, s) +} + +func (n Name) ToRDNSequence() (ret RDNSequence) { + ret = n.appendRDNs(ret, n.Country, oidCountry) + ret = n.appendRDNs(ret, n.Organization, oidOrganization) + ret = n.appendRDNs(ret, n.OrganizationalUnit, oidOrganizationalUnit) + ret = n.appendRDNs(ret, n.Locality, oidLocality) + ret = n.appendRDNs(ret, n.Province, oidProvince) + ret = n.appendRDNs(ret, n.StreetAddress, oidStreetAddress) + ret = n.appendRDNs(ret, n.PostalCode, oidPostalCode) + if len(n.CommonName) > 0 { + ret = n.appendRDNs(ret, []string{n.CommonName}, oidCommonName) + } + if len(n.SerialNumber) > 0 { + ret = n.appendRDNs(ret, []string{n.SerialNumber}, oidSerialNumber) + } + for _, atv := range n.ExtraNames { + ret = append(ret, []AttributeTypeAndValue{atv}) + } + + return ret +} + +// oidInAttributeTypeAndValue returns whether a type with the given OID exists +// in atv. +func oidInAttributeTypeAndValue(oid asn1.ObjectIdentifier, atv []AttributeTypeAndValue) bool { + for _, a := range atv { + if a.Type.Equal(oid) { + return true + } + } + return false +} + +// CertificateList represents the ASN.1 structure of the same name. See RFC +// 5280, section 5.1. Use Certificate.CheckCRLSignature to verify the +// signature. +type CertificateList struct { + TBSCertList TBSCertificateList + SignatureAlgorithm AlgorithmIdentifier + SignatureValue asn1.BitString +} + +// HasExpired reports whether now is past the expiry time of certList. +func (certList *CertificateList) HasExpired(now time.Time) bool { + return now.After(certList.TBSCertList.NextUpdate) +} + +// TBSCertificateList represents the ASN.1 structure of the same name. See RFC +// 5280, section 5.1. +type TBSCertificateList struct { + Raw asn1.RawContent + Version int `asn1:"optional,default:1"` + Signature AlgorithmIdentifier + Issuer RDNSequence + ThisUpdate time.Time + NextUpdate time.Time `asn1:"optional"` + RevokedCertificates []RevokedCertificate `asn1:"optional"` + Extensions []Extension `asn1:"tag:0,optional,explicit"` +} + +// RevokedCertificate represents the ASN.1 structure of the same name. See RFC +// 5280, section 5.1. +type RevokedCertificate struct { + SerialNumber *big.Int + RevocationTime time.Time + Extensions []Extension `asn1:"optional"` +} diff --git a/src/crypto/x509/root.go b/src/crypto/x509/root.go new file mode 100644 index 0000000000000000000000000000000000000000..8aae14e09ee72626b64895c8ffd282938c62faeb --- /dev/null +++ b/src/crypto/x509/root.go @@ -0,0 +1,17 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package x509 + +import "sync" + +var ( + once sync.Once + systemRoots *CertPool +) + +func systemRootsPool() *CertPool { + once.Do(initSystemRoots) + return systemRoots +} diff --git a/src/crypto/x509/root_bsd.go b/src/crypto/x509/root_bsd.go new file mode 100644 index 0000000000000000000000000000000000000000..93172837368935ef444f7e9765e3ded5abaebe69 --- /dev/null +++ b/src/crypto/x509/root_bsd.go @@ -0,0 +1,14 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build dragonfly freebsd netbsd openbsd + +package x509 + +// Possible certificate files; stop after finding one. +var certFiles = []string{ + "/usr/local/share/certs/ca-root-nss.crt", // FreeBSD/DragonFly + "/etc/ssl/cert.pem", // OpenBSD + "/etc/openssl/certs/ca-certificates.crt", // NetBSD +} diff --git a/src/crypto/x509/root_cgo_darwin.go b/src/crypto/x509/root_cgo_darwin.go new file mode 100644 index 0000000000000000000000000000000000000000..bf4a5cdfeeef2fcf15475e300fa332c74ba9bb8c --- /dev/null +++ b/src/crypto/x509/root_cgo_darwin.go @@ -0,0 +1,79 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build cgo,!arm,!arm64,!ios + +package x509 + +/* +#cgo CFLAGS: -mmacosx-version-min=10.6 -D__MAC_OS_X_VERSION_MAX_ALLOWED=1060 +#cgo LDFLAGS: -framework CoreFoundation -framework Security + +#include +#include + +// FetchPEMRoots fetches the system's list of trusted X.509 root certificates. +// +// On success it returns 0 and fills pemRoots with a CFDataRef that contains the extracted root +// certificates of the system. On failure, the function returns -1. +// +// Note: The CFDataRef returned in pemRoots must be released (using CFRelease) after +// we've consumed its content. +int FetchPEMRoots(CFDataRef *pemRoots) { + if (pemRoots == NULL) { + return -1; + } + + CFArrayRef certs = NULL; + OSStatus err = SecTrustCopyAnchorCertificates(&certs); + if (err != noErr) { + return -1; + } + + CFMutableDataRef combinedData = CFDataCreateMutable(kCFAllocatorDefault, 0); + int i, ncerts = CFArrayGetCount(certs); + for (i = 0; i < ncerts; i++) { + CFDataRef data = NULL; + SecCertificateRef cert = (SecCertificateRef)CFArrayGetValueAtIndex(certs, i); + if (cert == NULL) { + continue; + } + + // Note: SecKeychainItemExport is deprecated as of 10.7 in favor of SecItemExport. + // Once we support weak imports via cgo we should prefer that, and fall back to this + // for older systems. + err = SecKeychainItemExport(cert, kSecFormatX509Cert, kSecItemPemArmour, NULL, &data); + if (err != noErr) { + continue; + } + + if (data != NULL) { + CFDataAppendBytes(combinedData, CFDataGetBytePtr(data), CFDataGetLength(data)); + CFRelease(data); + } + } + + CFRelease(certs); + + *pemRoots = combinedData; + return 0; +} +*/ +import "C" +import "unsafe" + +func initSystemRoots() { + roots := NewCertPool() + + var data C.CFDataRef = nil + err := C.FetchPEMRoots(&data) + if err == -1 { + return + } + + defer C.CFRelease(C.CFTypeRef(data)) + buf := C.GoBytes(unsafe.Pointer(C.CFDataGetBytePtr(data)), C.int(C.CFDataGetLength(data))) + roots.AppendCertsFromPEM(buf) + systemRoots = roots +} diff --git a/src/crypto/x509/root_darwin.go b/src/crypto/x509/root_darwin.go new file mode 100644 index 0000000000000000000000000000000000000000..78de56c221531491f117f034757809df70af23b5 --- /dev/null +++ b/src/crypto/x509/root_darwin.go @@ -0,0 +1,25 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:generate go run root_darwin_arm_gen.go -output root_darwin_armx.go + +package x509 + +import "os/exec" + +func (c *Certificate) systemVerify(opts *VerifyOptions) (chains [][]*Certificate, err error) { + return nil, nil +} + +func execSecurityRoots() (*CertPool, error) { + cmd := exec.Command("/usr/bin/security", "find-certificate", "-a", "-p", "/System/Library/Keychains/SystemRootCertificates.keychain") + data, err := cmd.Output() + if err != nil { + return nil, err + } + + roots := NewCertPool() + roots.AppendCertsFromPEM(data) + return roots, nil +} diff --git a/src/crypto/x509/root_darwin_arm_gen.go b/src/crypto/x509/root_darwin_arm_gen.go new file mode 100644 index 0000000000000000000000000000000000000000..5817158c33b6e90b9c040cddb6d4542d7f76ccb4 --- /dev/null +++ b/src/crypto/x509/root_darwin_arm_gen.go @@ -0,0 +1,191 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build ignore + +// Generates root_darwin_armx.go. +// +// As of iOS 8, there is no API for querying the system trusted X.509 root +// certificates. We could use SecTrustEvaluate to verify that a trust chain +// exists for a certificate, but the x509 API requires returning the entire +// chain. +// +// Apple publishes the list of trusted root certificates for iOS on +// support.apple.com. So we parse the list and extract the certificates from +// an OS X machine and embed them into the x509 package. +package main + +import ( + "bytes" + "crypto/x509" + "encoding/pem" + "flag" + "fmt" + "go/format" + "io/ioutil" + "log" + "math/big" + "net/http" + "os/exec" + "strings" +) + +var output = flag.String("output", "root_darwin_armx.go", "file name to write") + +func main() { + certs, err := selectCerts() + if err != nil { + log.Fatal(err) + } + + buf := new(bytes.Buffer) + + fmt.Fprintf(buf, "// Created by root_darwin_arm_gen --output %s; DO NOT EDIT\n", *output) + fmt.Fprintf(buf, "%s", header) + + fmt.Fprintf(buf, "const systemRootsPEM = `\n") + for _, cert := range certs { + b := &pem.Block{ + Type: "CERTIFICATE", + Bytes: cert.Raw, + } + if err := pem.Encode(buf, b); err != nil { + log.Fatal(err) + } + } + fmt.Fprintf(buf, "`") + + source, err := format.Source(buf.Bytes()) + if err != nil { + log.Fatal("source format error:", err) + } + if err := ioutil.WriteFile(*output, source, 0644); err != nil { + log.Fatal(err) + } +} + +func selectCerts() ([]*x509.Certificate, error) { + ids, err := fetchCertIDs() + if err != nil { + return nil, err + } + + scerts, err := sysCerts() + if err != nil { + return nil, err + } + + var certs []*x509.Certificate + for _, id := range ids { + sn, ok := big.NewInt(0).SetString(id.serialNumber, 0) // 0x prefix selects hex + if !ok { + return nil, fmt.Errorf("invalid serial number: %q", id.serialNumber) + } + ski, ok := big.NewInt(0).SetString(id.subjectKeyID, 0) + if !ok { + return nil, fmt.Errorf("invalid Subject Key ID: %q", id.subjectKeyID) + } + + for _, cert := range scerts { + if sn.Cmp(cert.SerialNumber) != 0 { + continue + } + cski := big.NewInt(0).SetBytes(cert.SubjectKeyId) + if ski.Cmp(cski) != 0 { + continue + } + certs = append(certs, cert) + break + } + } + return certs, nil +} + +func sysCerts() (certs []*x509.Certificate, err error) { + cmd := exec.Command("/usr/bin/security", "find-certificate", "-a", "-p", "/System/Library/Keychains/SystemRootCertificates.keychain") + data, err := cmd.Output() + if err != nil { + return nil, err + } + for len(data) > 0 { + var block *pem.Block + block, data = pem.Decode(data) + if block == nil { + break + } + if block.Type != "CERTIFICATE" || len(block.Headers) != 0 { + continue + } + + cert, err := x509.ParseCertificate(block.Bytes) + if err != nil { + continue + } + certs = append(certs, cert) + } + return certs, nil +} + +type certID struct { + serialNumber string + subjectKeyID string +} + +// fetchCertIDs fetches IDs of iOS X509 certificates from apple.com. +func fetchCertIDs() ([]certID, error) { + resp, err := http.Get("https://support.apple.com/en-us/HT204132") + if err != nil { + return nil, err + } + defer resp.Body.Close() + body, err := ioutil.ReadAll(resp.Body) + if err != nil { + return nil, err + } + text := string(body) + text = text[strings.Index(text, "
")] + + lines := strings.Split(text, "\n") + var ids []certID + var id certID + for i, ln := range lines { + if i == len(lines)-1 { + break + } + const sn = "Serial Number:" + if ln == sn { + id.serialNumber = "0x" + strings.Replace(strings.TrimSpace(lines[i+1]), ":", "", -1) + continue + } + if strings.HasPrefix(ln, sn) { + // extract hex value from parentheses. + id.serialNumber = ln[strings.Index(ln, "(")+1 : len(ln)-1] + continue + } + if strings.TrimSpace(ln) == "X509v3 Subject Key Identifier:" { + id.subjectKeyID = "0x" + strings.Replace(strings.TrimSpace(lines[i+1]), ":", "", -1) + ids = append(ids, id) + id = certID{} + } + } + return ids, nil +} + +const header = ` +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build cgo +// +build darwin +// +build arm arm64 + +package x509 + +func initSystemRoots() { + systemRoots = NewCertPool() + systemRoots.AppendCertsFromPEM([]byte(systemRootsPEM)) +} +` diff --git a/src/crypto/x509/root_darwin_armx.go b/src/crypto/x509/root_darwin_armx.go new file mode 100644 index 0000000000000000000000000000000000000000..37675b48a39035ac2e2036a2fe4f9d7b9171bb53 --- /dev/null +++ b/src/crypto/x509/root_darwin_armx.go @@ -0,0 +1,4907 @@ +// Created by root_darwin_arm_gen --output root_darwin_armx.go; DO NOT EDIT + +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build cgo +// +build darwin +// +build arm arm64 ios + +package x509 + +func initSystemRoots() { + systemRoots = NewCertPool() + systemRoots.AppendCertsFromPEM([]byte(systemRootsPEM)) +} + +const systemRootsPEM = ` +-----BEGIN CERTIFICATE----- +MIIF8DCCA9igAwIBAgIPBuhGJy8fCo/RhFzjafbVMA0GCSqGSIb3DQEBBQUAMDgx +CzAJBgNVBAYTAkVTMRQwEgYDVQQKDAtJWkVOUEUgUy5BLjETMBEGA1UEAwwKSXpl +bnBlLmNvbTAeFw0wNzEyMTMxMzA4MjdaFw0zNzEyMTMwODI3MjVaMDgxCzAJBgNV +BAYTAkVTMRQwEgYDVQQKDAtJWkVOUEUgUy5BLjETMBEGA1UEAwwKSXplbnBlLmNv +bTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAMnTesoPHqynhugWZWqx +whtFMnGV2f4QW8yv56V5AY+Jw8ryVXH3d753lPNypCxE2J6SmxQ6oeckkAoKVo7F +2CaU4dlI4S0+2gpy3aOZFdqBoof0e24md4lYrdbrDLJBenNubdt6eEHpCIgSfocu +ZhFjbFT7PJ1ywLwu/8K33Q124zrX97RovqL144FuwUZvXY3gTcZUVYkaMzEKsVe5 +o4qYw+w7NMWVQWl+dcI8IMVhulFHoCCQk6GQS/NOfIVFVJrRBSZBsLVNHTO+xAPI +JXzBcNs79AktVCdIrC/hxKw+yMuSTFM5NyPs0wH54AlETU1kwOENWocivK0bo/4m +tRXzp/yEGensoYi0RGmEg/OJ0XQGqcwL1sLeJ4VQJsoXuMl6h1YsGgEebL4TrRCs +tST1OJGh1kva8bvS3ke18byB9llrzxlT6Y0Vy0rLqW9E5RtBz+GGp8rQap+8TI0G +M1qiheWQNaBiXBZO8OOi+gMatCxxs1gs3nsL2xoP694hHwZ3BgOwye+Z/MC5TwuG +KP7Suerj2qXDR2kS4Nvw9hmL7Xtw1wLW7YcYKCwEJEx35EiKGsY7mtQPyvp10gFA +Wo15v4vPS8+qFsGV5K1Mij4XkdSxYuWC5YAEpAN+jb/af6IPl08M0w3719Hlcn4c +yHf/W5oPt64FRuXxqBbsR6QXAgMBAAGjgfYwgfMwgbAGA1UdEQSBqDCBpYEPaW5m +b0BpemVucGUuY29tpIGRMIGOMUcwRQYDVQQKDD5JWkVOUEUgUy5BLiAtIENJRiBB +MDEzMzcyNjAtUk1lcmMuVml0b3JpYS1HYXN0ZWl6IFQxMDU1IEY2MiBTODFDMEEG +A1UECQw6QXZkYSBkZWwgTWVkaXRlcnJhbmVvIEV0b3JiaWRlYSAxNCAtIDAxMDEw +IFZpdG9yaWEtR2FzdGVpejAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIB +BjAdBgNVHQ4EFgQUHRxlDqjyJXu0kc/ksbHmvVV0bAUwDQYJKoZIhvcNAQEFBQAD +ggIBAMeBRm8hGE+gBe/n1bqXUKJg7aWSFBpSm/nxiEqg3Hh10dUflU7F57dp5iL0 ++CmoKom+z892j+Mxc50m0xwbRxYpB2iEitL7sRskPtKYGCwkjq/2e+pEFhsqxPqg +l+nqbFik73WrAGLRne0TNtsiC7bw0fRue0aHwp28vb5CO7dz0JoqPLRbEhYArxk5 +ja2DUBzIgU+9Ag89njWW7u/kwgN8KRwCfr00J16vU9adF79XbOnQgxCvv11N75B7 +XSus7Op9ACYXzAJcY9cZGKfsK8eKPlgOiofmg59OsjQerFQJTx0CCzl+gQgVuaBp +E8gyK+OtbBPWg50jLbJtooiGfqgNASYJQNntKE6MkyQP2/EeTXp6WuKlWPHcj1+Z +ggwuz7LdmMySlD/5CbOlliVbN/UShUHiGUzGigjB3Bh6Dx4/glmimj4/+eAJn/3B +kUtdyXvWton83x18hqrNA/ILUpLxYm9/h+qrdslsUMIZgq+qHfUgKGgu1fxkN0/P +pUTEvnK0jHS0bKf68r10OEMr3q/53NjgnZ/cPcqlY0S/kqJPTIAcuxrDmkoEVU3K +7iYLHL8CxWTTnn7S05EcS6L1HOUXHA0MUqORH5zwIe0ClG+poEnK6EOMxPQ02nwi +o8ZmPrgbBYhdurz3vOXcFD2nhqi2WVIhA16L4wTtSyoeo09Q +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIEKjCCAxKgAwIBAgIEOGPe+DANBgkqhkiG9w0BAQUFADCBtDEUMBIGA1UEChML +RW50cnVzdC5uZXQxQDA+BgNVBAsUN3d3dy5lbnRydXN0Lm5ldC9DUFNfMjA0OCBp +bmNvcnAuIGJ5IHJlZi4gKGxpbWl0cyBsaWFiLikxJTAjBgNVBAsTHChjKSAxOTk5 +IEVudHJ1c3QubmV0IExpbWl0ZWQxMzAxBgNVBAMTKkVudHJ1c3QubmV0IENlcnRp +ZmljYXRpb24gQXV0aG9yaXR5ICgyMDQ4KTAeFw05OTEyMjQxNzUwNTFaFw0yOTA3 +MjQxNDE1MTJaMIG0MRQwEgYDVQQKEwtFbnRydXN0Lm5ldDFAMD4GA1UECxQ3d3d3 +LmVudHJ1c3QubmV0L0NQU18yMDQ4IGluY29ycC4gYnkgcmVmLiAobGltaXRzIGxp +YWIuKTElMCMGA1UECxMcKGMpIDE5OTkgRW50cnVzdC5uZXQgTGltaXRlZDEzMDEG +A1UEAxMqRW50cnVzdC5uZXQgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgKDIwNDgp +MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArU1LqRKGsuqjIAcVFmQq +K0vRvwtKTY7tgHalZ7d4QMBzQshowNtTK91euHaYNZOLGp18EzoOH1u3Hs/lJBQe +sYGpjX24zGtLA/ECDNyrpUAkAH90lKGdCCmziAv1h3edVc3kw37XamSrhRSGlVuX +MlBvPci6Zgzj/L24ScF2iUkZ/cCovYmjZy/Gn7xxGWC4LeksyZB2ZnuU4q941mVT +XTzWnLLPKQP5L6RQstRIzgUyVYr9smRMDuSYB3Xbf9+5CFVghTAp+XtIpGmG4zU/ +HoZdenoVve8AjhUiVBcAkCaTvA5JaJG/+EfTnZVCwQ5N328mz8MYIWJmQ3DW1cAH +4QIDAQABo0IwQDAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNV +HQ4EFgQUVeSB0RGAvtiJuQijMfmhJAkWuXAwDQYJKoZIhvcNAQEFBQADggEBADub +j1abMOdTmXx6eadNl9cZlZD7Bh/KM3xGY4+WZiT6QBshJ8rmcnPyT/4xmf3IDExo +U8aAghOY+rat2l098c5u9hURlIIM7j+VrxGrD9cv3h8Dj1csHsm7mhpElesYT6Yf +zX1XEC+bBAlahLVu2B064dae0Wx5XnkcFMXj0EyTO2U87d89vqbllRrDtRnDvV5b +u/8j72gZyxKTJ1wDLW8w0B62GqzeWvfRqqgnpv55gcR5mTNXuhKwqeBCbJPKVt7+ +bYQLCIt+jerXmCHG8+c8eS9enNFMFY3h7CI3zJpDC5fcgJCNs2ebb0gIFVbPv/Er +fF6adulZkMV8gzURZVE= +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIFwTCCA6mgAwIBAgIITrIAZwwDXU8wDQYJKoZIhvcNAQEFBQAwSTELMAkGA1UE +BhMCQ0gxFTATBgNVBAoTDFN3aXNzU2lnbiBBRzEjMCEGA1UEAxMaU3dpc3NTaWdu +IFBsYXRpbnVtIENBIC0gRzIwHhcNMDYxMDI1MDgzNjAwWhcNMzYxMDI1MDgzNjAw +WjBJMQswCQYDVQQGEwJDSDEVMBMGA1UEChMMU3dpc3NTaWduIEFHMSMwIQYDVQQD +ExpTd2lzc1NpZ24gUGxhdGludW0gQ0EgLSBHMjCCAiIwDQYJKoZIhvcNAQEBBQAD +ggIPADCCAgoCggIBAMrfogLi2vj8Bxax3mCq3pZcZB/HL37PZ/pEQtZ2Y5Wu669y +IIpFR4ZieIbWIDkm9K6j/SPnpZy1IiEZtzeTIsBQnIJ71NUERFzLtMKfkr4k2Htn +IuJpX+UFeNSH2XFwMyVTtIc7KZAoNppVRDBopIOXfw0enHb/FZ1glwCNioUD7IC+ +6ixuEFGSzH7VozPY1kneWCqv9hbrS3uQMpe5up1Y8fhXSQQeol0GcN1x2/ndi5ob +jM89o03Oy3z2u5yg+gnOI2Ky6Q0f4nIoj5+saCB9bzuohTEJfwvH6GXp43gOCWcw +izSC+13gzJ2BbWLuCB4ELE6b7P6pT1/9aXjvCR+htL/68++QHkwFix7qepF6w9fl ++zC8bBsQWJj3Gl/QKTIDE0ZNYWqFTFJ0LwYfexHihJfGmfNtf9dng34TaNhxKFrY +zt3oEBSa/m0jh26OWnA81Y0JAKeqvLAxN23IhBQeW71FYyBrS3SMvds6DsHPWhaP +pZjydomyExI7C3d3rLvlPClKknLKYRorXkzig3R3+jVIeoVNjZpTxN94ypeRSCtF +KwH3HBqi7Ri6Cr2D+m+8jVeTO9TUps4e8aCxzqv9KyiaTxvXw3LbpMS/XUz13XuW +ae5ogObnmLo2t/5u7Su9IPhlGdpVCX4l3P5hYnL5fhgC72O00Puv5TtjjGePAgMB +AAGjgawwgakwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0O +BBYEFFCvzAeHFUdvOMW0ZdHelarp35zMMB8GA1UdIwQYMBaAFFCvzAeHFUdvOMW0 +ZdHelarp35zMMEYGA1UdIAQ/MD0wOwYJYIV0AVkBAQEBMC4wLAYIKwYBBQUHAgEW +IGh0dHA6Ly9yZXBvc2l0b3J5LnN3aXNzc2lnbi5jb20vMA0GCSqGSIb3DQEBBQUA +A4ICAQAIhab1Fgz8RBrBY+D5VUYI/HAcQiiWjrfFwUF1TglxeeVtlspLpYhg0DB0 +uMoI3LQwnkAHFmtllXcBrqS3NQuB2nEVqXQXOHtYyvkv+8Bldo1bAbl93oI9ZLi+ +FHSjClTTLJUYFzX1UWs/j6KWYTl4a0vlpqD4U99REJNi54Av4tHgvI42Rncz7Lj7 +jposiU0xEQ8mngS7twSNC/K5/FqdOxa3L8iYq/6KUFkuozv8KV2LwUvJ4ooTHbG/ +u0IdUt1O2BReEMYxB+9xJ/cbOQncguqLs5WGXv312l0xpuAxtpTmREl0xRbl9x8D +YSjFyMsSoEJL+WuICI20MhjzdZ/EfwBPBZWcoxcCw7NTm6ogOSkrZvqdr16zktK1 +puEa+S1BaYEUtLS17Yk9zvupnTVCRLEcFHOBzyoBNZox1S2PbYTfgE1X4z/FhHXa +icYwu+uPyyIIoK6q8QNsOktNCaUOcsZWayFCTiMlFGiudgp8DAdwZPmaL/YFOSbG +DI8Zf0NebvRbFS/bYV3mZy8/CJT5YLSYMdp08YSTcU1f+2BY0fvEwW2JorsgH51x +kcsymxM9Pn2SUjWskpSi0xjCfMfqr3YFFt1nJ8J+HAciIfNAChs0B0QTwoRqjt8Z +Wr9/6x3iGjjRXK9HkmuAtTClyY3YqzGBH9/CZjfTk6mFhnll0g== +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIFuzCCA6OgAwIBAgIIVwoRl0LE48wwDQYJKoZIhvcNAQELBQAwazELMAkGA1UE +BhMCSVQxDjAMBgNVBAcMBU1pbGFuMSMwIQYDVQQKDBpBY3RhbGlzIFMucC5BLi8w +MzM1ODUyMDk2NzEnMCUGA1UEAwweQWN0YWxpcyBBdXRoZW50aWNhdGlvbiBSb290 +IENBMB4XDTExMDkyMjExMjIwMloXDTMwMDkyMjExMjIwMlowazELMAkGA1UEBhMC +SVQxDjAMBgNVBAcMBU1pbGFuMSMwIQYDVQQKDBpBY3RhbGlzIFMucC5BLi8wMzM1 +ODUyMDk2NzEnMCUGA1UEAwweQWN0YWxpcyBBdXRoZW50aWNhdGlvbiBSb290IENB +MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAp8bEpSmkLO/lGMWwUKNv +UTufClrJwkg4CsIcoBh/kbWHuUA/3R1oHwiD1S0eiKD4j1aPbZkCkpAW1V8IbInX +4ay8IMKx4INRimlNAJZaby/ARH6jDuSRzVju3PvHHkVH3Se5CAGfpiEd9UEtL0z9 +KK3giq0itFZljoZUj5NDKd45RnijMCO6zfB9E1fAXdKDa0hMxKufgFpbOr3JpyI/ +gCczWw63igxdBzcIy2zSekciRDXFzMwujt0q7bd9Zg1fYVEiVRvjRuPjPdA1Yprb +rxTIW6HMiRvhMCb8oJsfgadHHwTrozmSBp+Z07/T6k9QnBn+locePGX2oxgkg4YQ +51Q+qDp2JE+BIcXjDwL4k5RHILv+1A7TaLndxHqEguNTVHnd25zS8gebLra8Pu2F +be8lEfKXGkJh90qX6IuxEAf6ZYGyojnP9zz/GPvG8VqLWeICrHuS0E4UT1lF9gxe +KF+w6D9Fz8+vm2/7hNN3WpVvrJSEnu68wEqPSpP4RCHiMUVhUE4Q2OM1fEwZtN4F +v6MGn8i1zeQf1xcGDXqVdFUNaBr8EBtiZJ1t4JWgw5QHVw0U5r0F+7if5t+L4sbn +fpb2U8WANFAoWPASUHEXMLrmeGO89LKtmyuy/uE5jF66CyCU3nuDuP/jVo23Eek7 +jPKxwV2dpAtMK9myGPW1n0sCAwEAAaNjMGEwHQYDVR0OBBYEFFLYiDrIn3hm7Ynz +ezhwlMkCAjbQMA8GA1UdEwEB/wQFMAMBAf8wHwYDVR0jBBgwFoAUUtiIOsifeGbt +ifN7OHCUyQICNtAwDgYDVR0PAQH/BAQDAgEGMA0GCSqGSIb3DQEBCwUAA4ICAQAL +e3KHwGCmSUyIWOYdiPcUZEim2FgKDk8TNd81HdTtBjHIgT5q1d07GjLukD0R0i70 +jsNjLiNmsGe+b7bAEzlgqqI0JZN1Ut6nna0Oh4lScWoWPBkdg/iaKWW+9D+a2fDz +WochcYBNy+A4mz+7+uAwTc+G02UQGRjRlwKxK3JCaKygvU5a2hi/a5iB0P2avl4V +SM0RFbnAKVy06Ij3Pjaut2L9HmLecHgQHEhb2rykOLpn7VU+Xlff1ANATIGk0k9j +pwlCCRT8AKnCgHNPLsBA2RF7SOp6AsDT6ygBJlh0wcBzIm2Tlf05fbsq4/aC4yyX +X04fkZT6/iyj2HYauE2yOE+b+h1IYHkm4vP9qdCa6HCPSXrW5b0KDtst842/6+Ok +fcvHlXHo2qN8xcL4dJIEG4aspCJTQLas/kx2z/uUMsA1n3Y/buWQbqCmJqK4LL7R +K4X9p2jIugErsWx0Hbhzlefut8cl8ABMALJ+tguLHPPAUJ4lueAI3jZm/zel0btU +ZCzJJ7VLkn5l/9Mt4blOvH+kQSGQQXemOR/qnuOf0GZvBeyqdn6/axag67XH/JJU +LysRJyU3eExRarDzzFhdFPFqSBX/wge2sY0PjlxQRrM9vwGYT7JZVEc+NHt4bVaT +LnPqZih4zR0Uv6CPLy64Lo7yFIrM6bV8+2ydDKXhlg== +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIDTDCCAjSgAwIBAgIIfE8EORzUmS0wDQYJKoZIhvcNAQEFBQAwRDELMAkGA1UE +BhMCVVMxFDASBgNVBAoMC0FmZmlybVRydXN0MR8wHQYDVQQDDBZBZmZpcm1UcnVz +dCBOZXR3b3JraW5nMB4XDTEwMDEyOTE0MDgyNFoXDTMwMTIzMTE0MDgyNFowRDEL +MAkGA1UEBhMCVVMxFDASBgNVBAoMC0FmZmlybVRydXN0MR8wHQYDVQQDDBZBZmZp +cm1UcnVzdCBOZXR3b3JraW5nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKC +AQEAtITMMxcua5Rsa2FSoOujz3mUTOWUgJnLVWREZY9nZOIG41w3SfYvm4SEHi3y +YJ0wTsyEheIszx6e/jarM3c1RNg1lho9Nuh6DtjVR6FqaYvZ/Ls6rnla1fTWcbua +kCNrmreIdIcMHl+5ni36q1Mr3Lt2PpNMCAiMHqIjHNRqrSK6mQEubWXLviRmVSRL +QESxG9fhwoXA3hA/Pe24/PHxI1Pcv2WXb9n5QHGNfb2V1M6+oF4nI979ptAmDgAp +6zxG8D1gvz9Q0twmQVGeFDdCBKNwV6gbh+0t+nvujArjqWaJGctB+d1ENmHP4ndG +yH329JKBNv3bNPFyfvMMFr20FQIDAQABo0IwQDAdBgNVHQ4EFgQUBx/S55zawm6i +QLSwelAQUHTEyL0wDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwDQYJ +KoZIhvcNAQEFBQADggEBAIlXshZ6qML91tmbmzTCnLQyFE2npN/svqe++EPbkTfO +tDIuUFUaNU52Q3Eg75N3ThVwLofDwR1t3Mu1J9QsVtFSUzpE0nPIxBsFZVpikpzu +QY0x2+c06lkh1QF612S4ZDnNye2v7UsDSKegmQGA3GWjNq5lWUhPgkvIZfFXHeVZ +Lgo/bNjR9eUJtGxUAArgFU2HdW23WJZa3W3SAKD0m0i+wzekujbgfIeFlxoVot4u +olu9rxj5kFDNcFn4J2dHy8egBzp90SxdbBk6ZrV9/ZFvgrG+CJPbFEfxojfHRZ48 +x3evZKiT3/Zpg4Jg8klCNO1aAFSFHBY2kgxc+qatv9s= +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIEvTCCA6WgAwIBAgIBADANBgkqhkiG9w0BAQUFADB/MQswCQYDVQQGEwJFVTEn +MCUGA1UEChMeQUMgQ2FtZXJmaXJtYSBTQSBDSUYgQTgyNzQzMjg3MSMwIQYDVQQL +ExpodHRwOi8vd3d3LmNoYW1iZXJzaWduLm9yZzEiMCAGA1UEAxMZQ2hhbWJlcnMg +b2YgQ29tbWVyY2UgUm9vdDAeFw0wMzA5MzAxNjEzNDNaFw0zNzA5MzAxNjEzNDRa +MH8xCzAJBgNVBAYTAkVVMScwJQYDVQQKEx5BQyBDYW1lcmZpcm1hIFNBIENJRiBB +ODI3NDMyODcxIzAhBgNVBAsTGmh0dHA6Ly93d3cuY2hhbWJlcnNpZ24ub3JnMSIw +IAYDVQQDExlDaGFtYmVycyBvZiBDb21tZXJjZSBSb290MIIBIDANBgkqhkiG9w0B +AQEFAAOCAQ0AMIIBCAKCAQEAtzZV5aVdGDDg2olUkfzIx1L4L1DZ77F1c2VHfRtb +unXF/KGIJPov7coISjlUxFF6tdpg6jg8gbLL8bvZkSM/SAFwdakFKq0fcfPJVD0d +BmpAPrMMhe5cG3nCYsS4No41XQEMIwRHNaqbYE6gZj3LJgqcQKH0XZi/caulAGgq +7YN6D6IUtdQis4CwPAxaUWktWBiP7Zme8a7ileb2R6jWDA+wWFjbw2Y3npuRVDM3 +0pQcakjJyfKl2qUMI/cjDpwyVV5xnIQFUZot/eZOKjRa3spAN2cMVCFVd9oKDMyX +roDclDZK9D7ONhMeU+SsTjoF7Nuucpw4i9A5O4kKPnf+dQIBA6OCAUQwggFAMBIG +A1UdEwEB/wQIMAYBAf8CAQwwPAYDVR0fBDUwMzAxoC+gLYYraHR0cDovL2NybC5j +aGFtYmVyc2lnbi5vcmcvY2hhbWJlcnNyb290LmNybDAdBgNVHQ4EFgQU45T1sU3p +26EpW1eLTXYGduHRooowDgYDVR0PAQH/BAQDAgEGMBEGCWCGSAGG+EIBAQQEAwIA +BzAnBgNVHREEIDAegRxjaGFtYmVyc3Jvb3RAY2hhbWJlcnNpZ24ub3JnMCcGA1Ud +EgQgMB6BHGNoYW1iZXJzcm9vdEBjaGFtYmVyc2lnbi5vcmcwWAYDVR0gBFEwTzBN +BgsrBgEEAYGHLgoDATA+MDwGCCsGAQUFBwIBFjBodHRwOi8vY3BzLmNoYW1iZXJz +aWduLm9yZy9jcHMvY2hhbWJlcnNyb290Lmh0bWwwDQYJKoZIhvcNAQEFBQADggEB +AAxBl8IahsAifJ/7kPMa0QOx7xP5IV8EnNrJpY0nbJaHkb5BkAFyk+cefV/2icZd +p0AJPaxJRUXcLo0waLIJuvvDL8y6C98/d3tGfToSJI6WjzwFCm/SlCgdbQzALogi +1djPHRPH8EjX1wWnz8dHnjs8NMiAT9QUu/wNUPf6s+xCX6ndbcj0dc97wXImsQEc +XCz9ek60AcUFV7nnPKoF2YjpB0ZBzu9Bga5Y34OirsrXdx/nADydb47kMgkdTXg0 +eDQ8lJsm7U9xxhl6vSAiSFr+S30Dt+dYvsYyTnQeaN2oaFuzPu5ifdmA6Ap1erfu +tGWaIZDgqtCYvDi1czyL+Nw= +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIEMjCCAxqgAwIBAgIBATANBgkqhkiG9w0BAQUFADB7MQswCQYDVQQGEwJHQjEb +MBkGA1UECAwSR3JlYXRlciBNYW5jaGVzdGVyMRAwDgYDVQQHDAdTYWxmb3JkMRow +GAYDVQQKDBFDb21vZG8gQ0EgTGltaXRlZDEhMB8GA1UEAwwYQUFBIENlcnRpZmlj +YXRlIFNlcnZpY2VzMB4XDTA0MDEwMTAwMDAwMFoXDTI4MTIzMTIzNTk1OVowezEL +MAkGA1UEBhMCR0IxGzAZBgNVBAgMEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UE +BwwHU2FsZm9yZDEaMBgGA1UECgwRQ29tb2RvIENBIExpbWl0ZWQxITAfBgNVBAMM +GEFBQSBDZXJ0aWZpY2F0ZSBTZXJ2aWNlczCCASIwDQYJKoZIhvcNAQEBBQADggEP +ADCCAQoCggEBAL5AnfRu4ep2hxxNRUSOvkbIgwadwSr+GB+O5AL686tdUIoWMQua +BtDFcCLNSS1UY8y2bmhGC1Pqy0wkwLxyTurxFa70VJoSCsN6sjNg4tqJVfMiWPPe +3M/vg4aijJRPn2jymJBGhCfHdr/jzDUsi14HZGWCwEiwqJH5YZ92IFCokcdmtet4 +YgNW8IoaE+oxox6gmf049vYnMlhvB/VruPsUK6+3qszWY19zjNoFmag4qMsXeDZR +rOme9Hg6jc8P2ULimAyrL58OAd7vn5lJ8S3frHRNG5i1R8XlKdH5kBjHYpy+g8cm +ez6KJcfA3Z3mNWgQIJ2P2N7Sw4ScDV7oL8kCAwEAAaOBwDCBvTAdBgNVHQ4EFgQU +oBEKIz6W8Qfs4q8p74Klf9AwpLQwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQF +MAMBAf8wewYDVR0fBHQwcjA4oDagNIYyaHR0cDovL2NybC5jb21vZG9jYS5jb20v +QUFBQ2VydGlmaWNhdGVTZXJ2aWNlcy5jcmwwNqA0oDKGMGh0dHA6Ly9jcmwuY29t +b2RvLm5ldC9BQUFDZXJ0aWZpY2F0ZVNlcnZpY2VzLmNybDANBgkqhkiG9w0BAQUF +AAOCAQEACFb8AvCb6P+k+tZ7xkSAzk/ExfYAWMymtrwUSWgEdujm7l3sAg9g1o1Q +GE8mTgHj5rCl7r+8dFRBv/38ErjHT1r0iWAFf2C3BUrz9vHCv8S5dIa2LX1rzNLz +Rt0vxuBqw8M0Ayx9lt1awg6nCpnBBYurDC/zXDrPbDdVCYfeU0BsWO/8tqtlbgT2 +G9w84FoVxp7Z8VlIMCFlA2zs6SFz7JsDoeA3raAVGI/6ugLOpyypEBMs1OUIJqsi +l2D4kF501KKaU73yqWjgom7C12yxow+ev+to51byrvLjKzg6CYG1a4XXvi3tPxq3 +smPi9WIsgtRqAEFQ8TmDn5XpNpaYbg== +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIEHTCCAwWgAwIBAgIQToEtioJl4AsC7j41AkblPTANBgkqhkiG9w0BAQUFADCB +gTELMAkGA1UEBhMCR0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4G +A1UEBxMHU2FsZm9yZDEaMBgGA1UEChMRQ09NT0RPIENBIExpbWl0ZWQxJzAlBgNV +BAMTHkNPTU9ETyBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0wNjEyMDEwMDAw +MDBaFw0yOTEyMzEyMzU5NTlaMIGBMQswCQYDVQQGEwJHQjEbMBkGA1UECBMSR3Jl +YXRlciBNYW5jaGVzdGVyMRAwDgYDVQQHEwdTYWxmb3JkMRowGAYDVQQKExFDT01P +RE8gQ0EgTGltaXRlZDEnMCUGA1UEAxMeQ09NT0RPIENlcnRpZmljYXRpb24gQXV0 +aG9yaXR5MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA0ECLi3LjkRv3 +UcEbVASY06m/weaKXTuH+7uIzg3jLz8GlvCiKVCZrts7oVewdFFxze1CkU1B/qnI +2GqGd0S7WWaXUF601CxwRM/aN5VCaTwwxHGzUvAhTaHYujl8HJ6jJJ3ygxaYqhZ8 +Q5sVW7euNJH+1GImGEaaP+vB+fGQV+useg2L23IwambV4EajcNxo2f8ESIl33rXp ++2dtQem8Ob0y2WIC8bGoPW43nOIv4tOiJovGuFVDiOEjPqXSJDlqR6sA1KGzqSX+ +DT+nHbrTUcELpNqsOO9VUCQFZUaTNE8tja3G1CEZ0o7KBWFxB3NH5YoZEr0ETc5O +nKVIrLsm9wIDAQABo4GOMIGLMB0GA1UdDgQWBBQLWOWLxkwVN6RAqTCpIb5HNlpW +/zAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zBJBgNVHR8EQjBAMD6g +PKA6hjhodHRwOi8vY3JsLmNvbW9kb2NhLmNvbS9DT01PRE9DZXJ0aWZpY2F0aW9u +QXV0aG9yaXR5LmNybDANBgkqhkiG9w0BAQUFAAOCAQEAPpiem/Yb6dc5t3iuHXIY +SdOH5EOC6z/JqvWote9VfCFSZfnVDeFs9D6Mk3ORLgLETgdxb8CPOGEIqB6BCsAv +IC9Bi5HcSEW88cbeunZrM8gALTFGTO3nnc+IlP8zwFboJIYmuNg4ON8qa90SzMc/ +RxdMosIGlgnW2/4/PEZB31jiVg88O8EckzXZOFKs7sjsLjBOlDW0JB9LeGna8gI4 +zJVSk/BwJVmcIGfE7vmLV2H0knZ9P4SNVbfo5azV8fUZVqZa+5Acr5Pr5RzUZ5dd +BA6+C4OmF4O5MBKgxTMVBbkN+8cFduPYSo38NBejxiEovjBFMR7HeL5YYTisO+IB +ZQ== +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIDcDCCAligAwIBAgIBBTANBgkqhkiG9w0BAQUFADBbMQswCQYDVQQGEwJVUzEY +MBYGA1UEChMPVS5TLiBHb3Zlcm5tZW50MQwwCgYDVQQLEwNEb0QxDDAKBgNVBAsT +A1BLSTEWMBQGA1UEAxMNRG9EIFJvb3QgQ0EgMjAeFw0wNDEyMTMxNTAwMTBaFw0y +OTEyMDUxNTAwMTBaMFsxCzAJBgNVBAYTAlVTMRgwFgYDVQQKEw9VLlMuIEdvdmVy +bm1lbnQxDDAKBgNVBAsTA0RvRDEMMAoGA1UECxMDUEtJMRYwFAYDVQQDEw1Eb0Qg +Um9vdCBDQSAyMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAwCzB9o07 +rP8/PNZxvrh0IgfscEEV/KtA4weqwcPYn/7aTDq/P8jYKHtLNgHArEUlw9IOCo+F +GGQQPRoTcCpvjtfcjZOzQQ84Ic2tq8I9KgXTVxE3Dc2MUfmT48xGSSGOFLTNyxQ+ +OM1yMe6rEvJl6jQuVl3/7mN1y226kTT8nvP0LRy+UMRC31mI/2qz+qhsPctWcXEF +lrufgOWARVlnQbDrw61gpIB1BhecDvRD4JkOG/t/9bPMsoGCsf0ywbi+QaRktWA6 +WlEwjM7eQSwZR1xJEGS5dKmHQa99brrBuKG/ZTE6BGf5tbuOkooAY7ix5ow4X4P/ +UNU7ol1rshDMYwIDAQABoz8wPTAdBgNVHQ4EFgQUSXS7DF66ev4CVO97oMaVxgmA +cJYwCwYDVR0PBAQDAgGGMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEFBQAD +ggEBAJiRjT+JyLv1wGlzKTs1rLqzCHY9cAmS6YREIQF9FHYb7lFsHY0VNy17MWn0 +mkS4r0bMNPojywMnGdKDIXUr5+AbmSbchECV6KjSzPZYXGbvP0qXEIIdugqi3VsG +K52nZE7rLgE1pLQ/E61V5NVzqGmbEfGY8jEeb0DU+HifjpGgb3AEkGaqBivO4XqS +tX3h4NGW56E6LcyxnR8FRO2HmdNNGnA5wQQM5X7Z8a/XIA7xInolpHOZzD+kByeW +qKKV7YK5FtOeC4fCwfKI9WLfaN/HvGlR7bFc3FRUKQ8JOZqsA8HbDE2ubwp6Fknx +v5HSOJTT9pUst2zJQraNypCNhdk= +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIDkjCCAnqgAwIBAgIRAIW9S/PY2uNp9pTXX8OlRCMwDQYJKoZIhvcNAQEFBQAw +PTELMAkGA1UEBhMCRlIxETAPBgNVBAoTCENlcnRwbHVzMRswGQYDVQQDExJDbGFz +cyAyIFByaW1hcnkgQ0EwHhcNOTkwNzA3MTcwNTAwWhcNMTkwNzA2MjM1OTU5WjA9 +MQswCQYDVQQGEwJGUjERMA8GA1UEChMIQ2VydHBsdXMxGzAZBgNVBAMTEkNsYXNz +IDIgUHJpbWFyeSBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBANxQ +ltAS+DXSCHh6tlJw/W/uz7kRy1134ezpfgSN1sxvc0NXYKwzCkTsA18cgCSR5aiR +VhKC9+Ar9NuuYS6JEI1rbLqzAr3VNsVINyPi8Fo3UjMXEuLRYE2+L0ER4/YXJQyL +kcAbmXuZVg2v7tK8R1fjeUl7NIknJITesezpWE7+Tt9avkGtrAjFGA7v0lPubNCd +EgETjdyAYveVqUSISnFOYFWe2yMZeVYHDD9jC1yw4r5+FfyUM1hBOHTE4Y+L3yas +H7WLO7dDWWuwJKZtkIvEcupdM5i3y95ee++U8Rs+yskhwcWYAqqi9lt3m/V+llU0 +HGdpwPFC40es/CgcZlUCAwEAAaOBjDCBiTAPBgNVHRMECDAGAQH/AgEKMAsGA1Ud +DwQEAwIBBjAdBgNVHQ4EFgQU43Mt38sOKAze3bOkynm4jrvoMIkwEQYJYIZIAYb4 +QgEBBAQDAgEGMDcGA1UdHwQwMC4wLKAqoCiGJmh0dHA6Ly93d3cuY2VydHBsdXMu +Y29tL0NSTC9jbGFzczIuY3JsMA0GCSqGSIb3DQEBBQUAA4IBAQCnVM+IRBnL39R/ +AN9WM2K191EBkOvDP9GIROkkXe/nFL0gt5o8AP5tn9uQ3Nf0YtaLcF3n5QRIqWh8 +yfFC82x/xXp8HVGIutIKPidd3i1RTtMTZGnkLuPT55sJmabglZvOGtd/vjzOUrMR +FcEPF80Du5wlFbqidon8BvEY0JNLDnyCt6X09l/+7UCmnYR0ObncHoUW2ikbhiMA +ybuJfm6AiB4vFLQDJKgybwOaRywwvlbGp0ICcBvqQNi6BQNwB6SW//1IMwrh3KWB +kJtN3X3n57LNXMhqlfil9o3EXXgIvnsG1knPGTZQIy4I5p4FTUcY1Rbpsda2ENW7 +l7+ijrRU +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIEPjCCAyagAwIBAgIESlOMKDANBgkqhkiG9w0BAQsFADCBvjELMAkGA1UEBhMC +VVMxFjAUBgNVBAoTDUVudHJ1c3QsIEluYy4xKDAmBgNVBAsTH1NlZSB3d3cuZW50 +cnVzdC5uZXQvbGVnYWwtdGVybXMxOTA3BgNVBAsTMChjKSAyMDA5IEVudHJ1c3Qs +IEluYy4gLSBmb3IgYXV0aG9yaXplZCB1c2Ugb25seTEyMDAGA1UEAxMpRW50cnVz +dCBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5IC0gRzIwHhcNMDkwNzA3MTcy +NTU0WhcNMzAxMjA3MTc1NTU0WjCBvjELMAkGA1UEBhMCVVMxFjAUBgNVBAoTDUVu +dHJ1c3QsIEluYy4xKDAmBgNVBAsTH1NlZSB3d3cuZW50cnVzdC5uZXQvbGVnYWwt +dGVybXMxOTA3BgNVBAsTMChjKSAyMDA5IEVudHJ1c3QsIEluYy4gLSBmb3IgYXV0 +aG9yaXplZCB1c2Ugb25seTEyMDAGA1UEAxMpRW50cnVzdCBSb290IENlcnRpZmlj +YXRpb24gQXV0aG9yaXR5IC0gRzIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEK +AoIBAQC6hLZy254Ma+KZ6TABp3bqMriVQRrJ2mFOWHLP/vaCeb9zYQYKpSfYs1/T +RU4cctZOMvJyig/3gxnQaoCAAEUesMfnmr8SVycco2gvCoe9amsOXmXzHHfV1IWN +cCG0szLni6LVhjkCsbjSR87kyUnEO6fe+1R9V77w6G7CebI6C1XiUJgWMhNcL3hW +wcKUs/Ja5CeanyTXxuzQmyWC48zCxEXFjJd6BmsqEZ+pCm5IO2/b1BEZQvePB7/1 +U1+cPvQXLOZprE4yTGJ36rfo5bs0vBmLrpxR57d+tVOxMyLlbc9wPBr64ptntoP0 +jaWvYkxN4FisZDQSA/i2jZRjJKRxAgMBAAGjQjBAMA4GA1UdDwEB/wQEAwIBBjAP +BgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBRqciZ60B7vfec7aVHUbI2fkBJmqzAN +BgkqhkiG9w0BAQsFAAOCAQEAeZ8dlsa2eT8ijYfThwMEYGprmi5ZiXMRrEPR9RP/ +jTkrwPK9T3CMqS/qF8QLVJ7UG5aYMzyorWKiAHarWWluBh1+xLlEjZivEtRh2woZ +Rkfz6/djwUAFQKXSt/S1mja/qYh2iARVBCuch38aNzx+LaUa2NSJXsq9rD1s2G2v +1fN2D807iDginWyTmsQ9v4IbZT+mD12q/OWyFcq1rca8PdCE6OoGcrBNOTJ4vz4R +nAuknZoh8/CbCzB428Hch0P+vGOaysXCHMnHjf87ElgI5rY97HosTvuDls4MPGmH +VHOkc8KT/1EQrBVUAdj8BbGJoX90g5pJ19xOe4pIb4tF9g== +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIID9jCCAt6gAwIBAgIQZIKe/DcedF38l/+XyLH/QTANBgkqhkiG9w0BAQsFADCB +lDELMAkGA1UEBhMCVVMxHTAbBgNVBAoTFFN5bWFudGVjIENvcnBvcmF0aW9uMR8w +HQYDVQQLExZTeW1hbnRlYyBUcnVzdCBOZXR3b3JrMUUwQwYDVQQDEzxTeW1hbnRl +YyBDbGFzcyAyIFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5 +IC0gRzYwHhcNMTExMDE4MDAwMDAwWhcNMzcxMjAxMjM1OTU5WjCBlDELMAkGA1UE +BhMCVVMxHTAbBgNVBAoTFFN5bWFudGVjIENvcnBvcmF0aW9uMR8wHQYDVQQLExZT +eW1hbnRlYyBUcnVzdCBOZXR3b3JrMUUwQwYDVQQDEzxTeW1hbnRlYyBDbGFzcyAy +IFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5IC0gRzYwggEi +MA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDNzOkFyGOFyz9AYxe9GPo15gRn +V2WYKaRPyVyPDzTS+NqoE2KquB5QZ3iwFkygOakVeq7t0qLA8JA3KRgmXOgNPLZs +ST/B4NzZS7YUGQum05bh1gnjGSYc+R9lS/kaQxwAg9bQqkmi1NvmYji6UBRDbfkx ++FYW2TgCkc/rbN27OU6Z4TBnRfHU8I3D3/7yOAchfQBeVkSz5GC9kSucq1sEcg+y +KNlyqwUgQiWpWwNqIBDMMfAr2jUs0Pual07wgksr2F82owstr2MNHSV/oW5cYqGN +KD6h/Bwg+AEvulWaEbAZ0shQeWsOagXXqgQ2sqPy4V93p3ec5R7c6d9qwWVdAgMB +AAGjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQW +BBSHjCCVyJhK0daABkqQNETfHE2/sDANBgkqhkiG9w0BAQsFAAOCAQEAgY6ypWaW +tyGltu9vI1pf24HFQqV4wWn99DzX+VxrcHIa/FqXTQCAiIiCisNxDY7FiZss7Y0L +0nJU9X3UXENX6fOupQIR9nYrgVfdfdp0MP1UR/bgFm6mtApI5ud1Bw8pGTnOefS2 +bMVfmdUfS/rfbSw8DVSAcPCIC4DPxmiiuB1w2XaM/O6lyc+tHc+ZJVdaYkXLFmu9 +Sc2lo4xpeSWuuExsi0BmSxY/zwIa3eFsawdhanYVKZl/G92IgMG/tY9zxaaWI4Sm +KIYkM2oBLldzJbZev4/mHWGoQClnHYebHX+bn5nNMdZUvmK7OaxoEkiRIKXLsd3+ +b/xa5IJVWa8xqQ== +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIEdDCCA1ygAwIBAgIQRL4Mi1AAJLQR0zYq/mUK/TANBgkqhkiG9w0BAQUFADCB +lzELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAlVUMRcwFQYDVQQHEw5TYWx0IExha2Ug +Q2l0eTEeMBwGA1UEChMVVGhlIFVTRVJUUlVTVCBOZXR3b3JrMSEwHwYDVQQLExho +dHRwOi8vd3d3LnVzZXJ0cnVzdC5jb20xHzAdBgNVBAMTFlVUTi1VU0VSRmlyc3Qt +SGFyZHdhcmUwHhcNOTkwNzA5MTgxMDQyWhcNMTkwNzA5MTgxOTIyWjCBlzELMAkG +A1UEBhMCVVMxCzAJBgNVBAgTAlVUMRcwFQYDVQQHEw5TYWx0IExha2UgQ2l0eTEe +MBwGA1UEChMVVGhlIFVTRVJUUlVTVCBOZXR3b3JrMSEwHwYDVQQLExhodHRwOi8v +d3d3LnVzZXJ0cnVzdC5jb20xHzAdBgNVBAMTFlVUTi1VU0VSRmlyc3QtSGFyZHdh +cmUwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCx98M4P7Sof885glFn +0G2f0v9Y8+efK+wNiVSZuTiZFvfgIXlIwrthdBKWHTxqctU8EGc6Oe0rE81m65UJ +M6Rsl7HoxuzBdXmcRl6Nq9Bq/bkqVRcQVLMZ8Jr28bFdtqdt++BxF2uiiPsA3/4a +MXcMmgF6sTLjKwEHOG7DpV4jvEWbe1DByTCP2+UretNb+zNAHqDVmBe8i4fDidNd +oI6yqqr2jmmIBsX6iSHzCJ1pLgkzmykNRg+MzEk0sGlRvfkGzWitZky8PqxhvQqI +DsjfPe58BEydCl5rkdbux+0ojatNh4lz0G6k0B4WixThdkQDf2Os5M1JnMWS9Ksy +oUhbAgMBAAGjgbkwgbYwCwYDVR0PBAQDAgHGMA8GA1UdEwEB/wQFMAMBAf8wHQYD +VR0OBBYEFKFyXyYbKJhDlV0HN9WFlp1L0sNFMEQGA1UdHwQ9MDswOaA3oDWGM2h0 +dHA6Ly9jcmwudXNlcnRydXN0LmNvbS9VVE4tVVNFUkZpcnN0LUhhcmR3YXJlLmNy +bDAxBgNVHSUEKjAoBggrBgEFBQcDAQYIKwYBBQUHAwUGCCsGAQUFBwMGBggrBgEF +BQcDBzANBgkqhkiG9w0BAQUFAAOCAQEARxkP3nTGmZev/K0oXnWO6y1n7k57K9cM +//bey1WiCuFMVGWTYGufEpytXoMs61quwOQt9ABjHbjAbPLPSbtNk28Gpgoiskli +CE7/yMgUsogWXecB5BKV5UU0s4tpvc+0hY91UZ59Ojg6FEgSxvunOxqNDYJAB+gE +CJChicsZUN/KHAG8HQQZexB2lzvukJDKxA4fFm517zP4029bHpbj4HR3dHuKom4t +3XbWOTCC8KucUvIqx69JXn7HaOWCgchqJ/kniCrVWFCVH/A7HFe7fRQ5YiuayZSS +KqMiDP+JJn1fIytH1xUdqWqeUQ0qUZ6B+dQ7XnASfxAynB67nfhmqA== +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIDojCCAoqgAwIBAgIQE4Y1TR0/BvLB+WUF1ZAcYjANBgkqhkiG9w0BAQUFADBr +MQswCQYDVQQGEwJVUzENMAsGA1UEChMEVklTQTEvMC0GA1UECxMmVmlzYSBJbnRl +cm5hdGlvbmFsIFNlcnZpY2UgQXNzb2NpYXRpb24xHDAaBgNVBAMTE1Zpc2EgZUNv +bW1lcmNlIFJvb3QwHhcNMDIwNjI2MDIxODM2WhcNMjIwNjI0MDAxNjEyWjBrMQsw +CQYDVQQGEwJVUzENMAsGA1UEChMEVklTQTEvMC0GA1UECxMmVmlzYSBJbnRlcm5h +dGlvbmFsIFNlcnZpY2UgQXNzb2NpYXRpb24xHDAaBgNVBAMTE1Zpc2EgZUNvbW1l +cmNlIFJvb3QwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCvV95WHm6h +2mCxlCfLF9sHP4CFT8icttD0b0/Pmdjh28JIXDqsOTPHH2qLJj0rNfVIsZHBAk4E +lpF7sDPwsRROEW+1QK8bRaVK7362rPKgH1g/EkZgPI2h4H3PVz4zHvtH8aoVlwdV +ZqW1LS7YgFmypw23RuwhY/81q6UCzyr0TP579ZRdhE2o8mCP2w4lPJ9zcc+U30rq +299yOIzzlr3xF7zSujtFWsan9sYXiwGd/BmoKoMWuDpI/k4+oKsGGelT84ATB+0t +vz8KPFUgOSwsAGl0lUq8ILKpeeUYiZGo3BxN77t+Nwtd/jmliFKMAGzsGHxBvfaL +dXe6YJ2E5/4tAgMBAAGjQjBAMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQD +AgEGMB0GA1UdDgQWBBQVOIMPPyw/cDMezUb+B4wg4NfDtzANBgkqhkiG9w0BAQUF +AAOCAQEAX/FBfXxcCLkr4NWSR/pnXKUTwwMhmytMiUbPWU3J/qVAtmPN3XEolWcR +zCSs00Rsca4BIGsDoo8Ytyk6feUWYFN4PMCvFYP3j1IzJL1kk5fui/fbGKhtcbP3 +LBfQdCVp9/5rPJS+TUtBjE7ic9DjkCJzQ83z7+pzzkWKsKZJ/0x9nXGIxHYdkFsd +7v3M9+79YKWxehZx0RbQfBI8bGmX265fOZpwLwU8GUYEmSA20GBuYQa7FkKMcPcw +++DbZqMAAb3mLNqRX6BGi01qnD093QVG/na/oAo85ADmJ7f/hC3euiInlhBx6yLt +398znM/jra6O1I7mT1GvFpLgXPYHDw== +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIFpDCCA4ygAwIBAgIBATANBgkqhkiG9w0BAQUFADBjMQswCQYDVQQGEwJVUzEc +MBoGA1UEChMTQW1lcmljYSBPbmxpbmUgSW5jLjE2MDQGA1UEAxMtQW1lcmljYSBP +bmxpbmUgUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAyMB4XDTAyMDUyODA2 +MDAwMFoXDTM3MDkyOTE0MDgwMFowYzELMAkGA1UEBhMCVVMxHDAaBgNVBAoTE0Ft +ZXJpY2EgT25saW5lIEluYy4xNjA0BgNVBAMTLUFtZXJpY2EgT25saW5lIFJvb3Qg +Q2VydGlmaWNhdGlvbiBBdXRob3JpdHkgMjCCAiIwDQYJKoZIhvcNAQEBBQADggIP +ADCCAgoCggIBAMxBRR3pPU0Q9oyxQcngXssNt79Hc9PwVU3dxgz6sWYFas14tNwC +206B89enfHG8dWOgXeMHDEjsJcQDIPT/DjsS/5uN4cbVG7RtIuOx238hZK+GvFci +KtZHgVdEglZTvYYUAQv8f3SkWq7xuhG1m1hagLQ3eAkzfDJHA1zEpYNI9FdWboE2 +JxhP7JsowtS013wMPgwr38oE18aO6lhOqKSlGBxsRZijQdEt0sdtjRnxrXm3gT+9 +BoInLRBYBbV4Bbkv2wxrkJB+FFk4u5QkE+XRnRTf04JNRvCAOVIyD+OEsnpD8l7e +Xz8d3eOyG6ChKiMDbi4BFYdcpnV1x5dhvt6G3NRI270qv0pV2uh9UPu0gBe4lL8B +PeraunzgWGcXuVjgiIZGZ2ydEEdYMtA1fHkqkKJaEBEjNa0vzORKW6fIJ/KD3l67 +Xnfn6KVuY8INXWHQjNJsWiEOyiijzirplcdIz5ZvHZIlyMbGwcEMBawmxNJ10uEq +Z8A9W6Wa6897GqidFEXlD6CaZd4vKL3Ob5Rmg0gp2OpljK+T2WSfVVcmv2/LNzGZ +o2C7HK2JNDJiuEMhBnIMoVxtRsX6Kc8w3onccVvdtjc+31D1uAclJuW8tf48ArO3 ++L5DwYcRlJ4jbBeKuIonDFRH8KmzwICMoCfrHRnjB453cMor9H124HhnAgMBAAGj +YzBhMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFE1FwWg4u3OpaaEg5+31IqEj +FNeeMB8GA1UdIwQYMBaAFE1FwWg4u3OpaaEg5+31IqEjFNeeMA4GA1UdDwEB/wQE +AwIBhjANBgkqhkiG9w0BAQUFAAOCAgEAZ2sGuV9FOypLM7PmG2tZTiLMubekJcmn +xPBUlgtk87FYT15R/LKXeydlwuXK5w0MJXti4/qftIe3RUavg6WXSIylvfEWK5t2 +LHo1YGwRgJfMqZJS5ivmae2p+DYtLHe/YUjRYwu5W1LtGLBDQiKmsXeu3mnFzccc +obGlHBD7GL4acN3Bkku+KVqdPzW+5X1R+FXgJXUjhx5c3LqdsKyzadsXg8n33gy8 +CNyRnqjQ1xU3c6U1uPx+xURABsPr+CKAXEfOAuMRn0T//ZoyzH1kUQ7rVyZ2OuMe +IjzCpjbdGe+n/BLzJsBZMYVMnNjP36TMzCmT/5RtdlwTCJfy7aULTd3oyWgOZtMA +DjMSW7yV5TKQqLPGbIOtd+6Lfn6xqavT4fG2wLHqiMDn05DpKJKUe2h7lyoKZy2F +AjgQ5ANh1NolNscIWC2hp1GvMApJ9aZphwctREZ2jirlmjvXGKL8nDgQzMY70rUX +Om/9riW99XJZZLF0KjhfGEzfz3EEWjbUvy+ZnOjZurGV5gJLIaFb1cFPj65pbVPb +AZO1XB4Y3WRayhgoPmMEEf0cjQAPuDffZ4qdZqkCapH/E8ovXYO8h5Ns3CRRFgQl +Zvqz2cK6Kb6aSDiCmfS/O0oxGfm/jiEzFMpPVF/7zvuPcX/9XhmgD0uRuMRUvAaw +RY8mkaKO/qk= +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIECjCCAvKgAwIBAgIJAMJ+QwRORz8ZMA0GCSqGSIb3DQEBCwUAMIGCMQswCQYD +VQQGEwJIVTERMA8GA1UEBwwIQnVkYXBlc3QxFjAUBgNVBAoMDU1pY3Jvc2VjIEx0 +ZC4xJzAlBgNVBAMMHk1pY3Jvc2VjIGUtU3ppZ25vIFJvb3QgQ0EgMjAwOTEfMB0G +CSqGSIb3DQEJARYQaW5mb0BlLXN6aWduby5odTAeFw0wOTA2MTYxMTMwMThaFw0y +OTEyMzAxMTMwMThaMIGCMQswCQYDVQQGEwJIVTERMA8GA1UEBwwIQnVkYXBlc3Qx +FjAUBgNVBAoMDU1pY3Jvc2VjIEx0ZC4xJzAlBgNVBAMMHk1pY3Jvc2VjIGUtU3pp +Z25vIFJvb3QgQ0EgMjAwOTEfMB0GCSqGSIb3DQEJARYQaW5mb0BlLXN6aWduby5o +dTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAOn4j/NjrdqG2KfgQvvP +kd6mJviZpWNwrZuuyjNAfW2WbqEORO7hE52UQlKavXWFdCyoDh2Tthi3jCyoz/tc +cbna7P7ofo/kLx2yqHWH2Leh5TvPmUpG0IMZfcChEhyVbUr02MelTTMuhTlAdX4U +fIASmFDHQWe4oIBhVKZsTh/gnQ4H6cm6M+f+wFUoLAKApxn1ntxVUwOXewdI/5n7 +N4okxFnMUBBjjqqpGrCEGob5X7uxUG6k0QrM1XF+H6cbfPVTbiJfyyvm1HxdrtbC +xkzlBQHZ7Vf8wSN5/PrIJIOV87VqUQHQd9bpEqH5GoP7ghu5sJf0dgYzQ0mg/wu1 ++rUCAwEAAaOBgDB+MA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0G +A1UdDgQWBBTLD8bfQkPMPcu1SCOhGnqmKrs0aDAfBgNVHSMEGDAWgBTLD8bfQkPM +Pcu1SCOhGnqmKrs0aDAbBgNVHREEFDASgRBpbmZvQGUtc3ppZ25vLmh1MA0GCSqG +SIb3DQEBCwUAA4IBAQDJ0Q5eLtXMs3w+y/w9/w0olZMEyL/azXm4Q5DwpL7v8u8h +mLzU1F0G9u5C7DBsoKqpyvGvivo/C3NqPuouQH4frlRheesuCDfXI/OMn74dseGk +ddug4lQUsbocKaQY9hK6ohQU4zE1yED/t+AFdlfBHFny+L/k7SViXITwfn4fs775 +tyERzAMBVnCnEJIeGzSBHq2cGsMEPO0CYdYeBvNfOofyK/FFh+U9rNHHV4S9a67c +2Pm2G2JwCz02yULyMtd6YebS2z3PyKnJm9zbWETXbzivf3jTo60adbocwTZ8jx5t +HMN1Rq41Bab2XD0h7lbwyYIiLXpUq3DDfSJlgnCW +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIHqTCCBZGgAwIBAgIQYwaGp8U3ZaVDkKhqWMzUMjANBgkqhkiG9w0BAQUFADCB +jzELMAkGA1UEBhMCTFYxNTAzBgNVBAoTLFZBUyBMYXR2aWphcyBQYXN0cyAtIFZp +ZW4ucmVnLk5yLjQwMDAzMDUyNzkwMSMwIQYDVQQLExpTZXJ0aWZpa2FjaWphcyBw +YWthbHBvanVtaTEkMCIGA1UEAxMbVkFTIExhdHZpamFzIFBhc3RzIFNTSShSQ0Ep +MB4XDTA2MDkxMzA5MjIxMFoXDTI0MDkxMzA5Mjc1N1owgY8xCzAJBgNVBAYTAkxW +MTUwMwYDVQQKEyxWQVMgTGF0dmlqYXMgUGFzdHMgLSBWaWVuLnJlZy5Oci40MDAw +MzA1Mjc5MDEjMCEGA1UECxMaU2VydGlmaWthY2lqYXMgcGFrYWxwb2p1bWkxJDAi +BgNVBAMTG1ZBUyBMYXR2aWphcyBQYXN0cyBTU0koUkNBKTCCAiIwDQYJKoZIhvcN +AQEBBQADggIPADCCAgoCggIBAJu4+f1hVS9PpKUUtS6OuSSPrPuxVD9A/0/F5YZo +e1OT+zWCNahQLpRSoNuDPnXaFXCsCc/ugkmtNkm5tHGLtAChQgbKCApjl7YI/O60 +3Jh4GYLJ+H9kPqrJ/rGN67Bk9bzzxD46kOpOjj8bGbxqg8ORPGxV+wpSwOjhXXeF +M8VJ3+xqv79sN/6OSaIVGM6LjmseOKMwb4iBfnJWRBrEejkP9sSPltSy6wBOXN67 +5zu35iQFk2tN5pFEv+6YG8eFGxFBeyI2p74+6Ho33BjekJ2PzbLXmj/iF39bDOHv +P2Y9biTksM7DDIhslNo4JXxSOeNzFLMARWOaDEJAXgTG93JkzsluM7Pk020klTeT +fvIAXRmLH/NDc6ifRdIGqey0Qrv67gzHTz9RH9Gv0KwYf4eBIv6p3QeWbXz4TtlN +OlBp1UF+xdp02I5z5X6D4cMZgbe9v0COvi6aogyqTgIuuyrhCF0xA8msJ7Cv3NXI +FH1AnVWJIfmQzNTJYEFzq+jN2DpVOQqCmf6b9fU8HJHLwPpGVK4h/CqsXHveepdx +/WxrzUiapNuBfBg3L5B9YZS9F8lctlQWd8oJSqrpvE+UdQFaVryS0o+515feVnQB +9xZxSbH1GEaZQe5i4bMsZXVpKXJDA/ibH/o49J7sQBCOrJfVsDO+nxjcLfdBeFRK +YkTnAgMBAAGjggH9MIIB+TAOBgNVHQ8BAf8EBAMCAQYwGAYIKwYBBQUHAQMEDDAK +MAgGBgQAjkYBATAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBTMw/Vm/3OsOFqW +GyGJuIFMH8teJTAQBgkrBgEEAYI3FQEEAwIBADCCAYkGA1UdIASCAYAwggF8MIIB +eAYLKwYBBAGBxFkBAQIwggFnMIIBOAYIKwYBBQUHAgIwggEqHoIBJgBTAGkAcwAg +AGkAcgAgAHMAZQByAHQAaQBmAGkAawBhAHQAcwAsACAAawBvACAAaQB6AGQAZQB2 +AGkAcwAgAFYAQQBTACAATABhAHQAdgBpAGoAYQBzACAAUABhAHMAdABzACwAIABu +AG8AZAByAG8AcwBpAG4AbwB0ACAAYQB0AGIAaQBsAHMAdABpAGIAdQAgAEUAbABl +AGsAdAByAG8AbgBpAHMAawBvACAAZABvAGsAdQBtAGUAbgB0AHUAIABsAGkAawB1 +AG0AYQBtACAAdQBuACAARQBpAHIAbwBwAGEAcwAgAFAAYQByAGwAYQBtAGUAbgB0 +AGEAIABkAGkAcgBlAGsAdABpAHYAYQBpACAAMQA5ADkAOQAvADkAMwAvAEUASzAp +BggrBgEFBQcCARYdaHR0cDovL3d3dy5lLW1lLmx2L3JlcG9zaXRvcnkwDQYJKoZI +hvcNAQEFBQADggIBAB8oSjWQIWNoCi94r6MegiaXoz8nGdJLo0J6BhNlW8EEy+t9 +fO+U8vGJ9bffUgIhadLqljTloM+XuJxVDhCFoxReLAX4tTp28/l6uN62DCdp8suU +kQsdudWOb5kvzfIZVjk6SFbwAf+Cdbay/dHU9fJjV0xNoX7MELoEae/0FPyzlx9F +7m9KKH/Rxie8x6Opa3vtghNvq94P+3HrXBEaqSzQMJ/8NjdW75XpurcTtq6fAmGt +nuxrBG82nw+Z98LJyEwouSjUIdeeVNXAzvSO5FWUe48kxjj8q3qkVnc9qEXvZJKk +0Ep+u3OL9A1Sc7g6SF5DgNOpcHdi/8coHHMeQ+YnJFtJueY2pI79xS0veqV5EnrX +IbIlbcgPosNhS+VI4le6n/KKId3bZPDaGd/OwJuAOcJ3d2MVU3KE+qSPBzeGIX1Q ++j1qN9uRDjez/c4Lynth0Jx0nH04aG3pex3W8Sq07ztgUncF5gLCX4xbvPB9t3PH +kWuyKrNjozTVq60lcUf/Gj56to2VdsPups0DCWzuRWeYz5lIdsHOinSaaFIBNCLI +7eIUC4S9bhCMsXKbvugI11fVf+q0AT1O5OLoZ+eMfunnQhHvlUbIkda+JxeAGTSY +58bfHvwhX56GPbx+8Jy9cp70R4JbcWfz+txUTKhc2FnH0AcOEzMnvPRp8Gsh +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIEDzCCAvegAwIBAgIBATANBgkqhkiG9w0BAQUFADBKMQswCQYDVQQGEwJTSzET +MBEGA1UEBxMKQnJhdGlzbGF2YTETMBEGA1UEChMKRGlzaWcgYS5zLjERMA8GA1UE +AxMIQ0EgRGlzaWcwHhcNMDYwMzIyMDEzOTM0WhcNMTYwMzIyMDEzOTM0WjBKMQsw +CQYDVQQGEwJTSzETMBEGA1UEBxMKQnJhdGlzbGF2YTETMBEGA1UEChMKRGlzaWcg +YS5zLjERMA8GA1UEAxMIQ0EgRGlzaWcwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAw +ggEKAoIBAQCS9jHBfYj9mQGp2HvycXXxMcbzdWb6UShGhJd4NLxs/LxFWYgmGErE +Nx+hSkS943EE9UQX4j/8SFhvXJ56CbpRNyIjZkMhsDxkovhqFQ4/61HhVKndBpnX +mjxUizkDPw/Fzsbrg3ICqB9x8y34dQjbYkzo+s7552oftms1grrijxaSfQUMbEYD +XcDtab86wYqg6I7ZuUUohwjstMoVvoLdtUSLLa2GDGhibYVW8qwUYzrG0ZmsNHhW +S8+2rT+MitcE5eN4TPWGqvWP+j1scaMtymfraHtuM6kMgiioTGohQBUgDCZbg8Kp +FhXAJIJdKxatymP2dACw30PEEGBWZ2NFAgMBAAGjgf8wgfwwDwYDVR0TAQH/BAUw +AwEB/zAdBgNVHQ4EFgQUjbJJaJ1yCCW5wCf1UJNWSEZx+Y8wDgYDVR0PAQH/BAQD +AgEGMDYGA1UdEQQvMC2BE2Nhb3BlcmF0b3JAZGlzaWcuc2uGFmh0dHA6Ly93d3cu +ZGlzaWcuc2svY2EwZgYDVR0fBF8wXTAtoCugKYYnaHR0cDovL3d3dy5kaXNpZy5z +ay9jYS9jcmwvY2FfZGlzaWcuY3JsMCygKqAohiZodHRwOi8vY2EuZGlzaWcuc2sv +Y2EvY3JsL2NhX2Rpc2lnLmNybDAaBgNVHSAEEzARMA8GDSuBHpGT5goAAAABAQEw +DQYJKoZIhvcNAQEFBQADggEBAF00dGFMrzvY/59tWDYcPQuBDRIrRhCA/ec8J9B6 +yKm2fnQwM6M6int0wHl5QpNt/7EpFIKrIYwvF/k/Ji/1WcbvgAa3mkkp7M5+cTxq +EEHA9tOasnxakZzArFvITV734VP/Q3f8nktnbNfzg9Gg4H8l37iYC5oyOGwwoPP/ +CBUz91BKez6jPiCp3C9WgArtQVCwyfTssuMmRAAOb54GvCKWU3BlxFAKRmukLyeB +EicTXxChds6KezfqwzlhA5WYOudsiCUI/HloDYd9Yvi0X/vF2Ey9WLw/Q1vUHgFN +PGO+I++MzVpQuGhU+QqZMxEA4Z7CRneC9VkGjCFMhwnN5ag= +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIDXTCCAkWgAwIBAgIDAOJCMA0GCSqGSIb3DQEBBQUAMFUxCzAJBgNVBAYTAkFU +MRAwDgYDVQQKEwdBLVRydXN0MRkwFwYDVQQLExBBLVRydXN0LW5RdWFsLTAxMRkw +FwYDVQQDExBBLVRydXN0LW5RdWFsLTAxMB4XDTA0MTEzMDIzMDAwMFoXDTE0MTEz +MDIzMDAwMFowVTELMAkGA1UEBhMCQVQxEDAOBgNVBAoTB0EtVHJ1c3QxGTAXBgNV +BAsTEEEtVHJ1c3QtblF1YWwtMDExGTAXBgNVBAMTEEEtVHJ1c3QtblF1YWwtMDEw +ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQD/9RyAEZ6eHmhYzNJ328f0 +jmdSUFi6EqRqOxb3jHNPTIpK82CR6z5lmSnZQNUuCPD+htbNZffd2DKVB06NOyZ1 +2zcOMCgj4GtkZoqE0zPpPT3bpoE55nkZZe/qWEX/64wz/L/4EdkvKDSKG/UsP75M +tmCVY5m2Eg73RVFRz4ccBIMpHel4lzEqSkdDtZOY5fnkrE333hx67nxq21vY8Eyf +8O4fPQ5RtN8eohQCcPQ1z6ypU1R7N9jPRpnI+yzMOiwd3+QcKhHi1miCzo0pkOaB +1CwmfsTyNl8qU0NJUL9Ta6cea7WThwTiWol2yD88cd2cy388xpbNkfrCPmZNGLoV +AgMBAAGjNjA0MA8GA1UdEwEB/wQFMAMBAf8wEQYDVR0OBAoECE5ZzscCMocwMA4G +A1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQUFAAOCAQEA69I9R1hU9Gbl9vV7W7AH +QpUJAlFAvv2It/eY8p2ouQUPVaSZikaKtAYrCD/arzfXB43Qet+dM6CpHsn8ikYR +vQKePjXv3Evf+C1bxwJAimcnZV6W+bNOTpdo8lXljxkmfN+Z5S+XzvK2ttUtP4Et +YOVaxHw2mPMNbvDeY+foJkiBn3KYjGabMaR8moZqof5ofj4iS/WyamTZti6v/fKx +n1vII+/uWkcxV5DT5+r9HLon0NYF0Vg317Wh+gWDV59VZo+dcwJDb+keYqMFYoqp +77SGkZGu41S8NGYkQY3X9rNHRkDbLfpKYDmy6NanpOE1EHW1/sNSFAs43qZZKJEQ +xg== +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIEojCCA4qgAwIBAgIQRL4Mi1AAJLQR0zYlJWfJiTANBgkqhkiG9w0BAQUFADCB +rjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAlVUMRcwFQYDVQQHEw5TYWx0IExha2Ug +Q2l0eTEeMBwGA1UEChMVVGhlIFVTRVJUUlVTVCBOZXR3b3JrMSEwHwYDVQQLExho +dHRwOi8vd3d3LnVzZXJ0cnVzdC5jb20xNjA0BgNVBAMTLVVUTi1VU0VSRmlyc3Qt +Q2xpZW50IEF1dGhlbnRpY2F0aW9uIGFuZCBFbWFpbDAeFw05OTA3MDkxNzI4NTBa +Fw0xOTA3MDkxNzM2NThaMIGuMQswCQYDVQQGEwJVUzELMAkGA1UECBMCVVQxFzAV +BgNVBAcTDlNhbHQgTGFrZSBDaXR5MR4wHAYDVQQKExVUaGUgVVNFUlRSVVNUIE5l +dHdvcmsxITAfBgNVBAsTGGh0dHA6Ly93d3cudXNlcnRydXN0LmNvbTE2MDQGA1UE +AxMtVVROLVVTRVJGaXJzdC1DbGllbnQgQXV0aGVudGljYXRpb24gYW5kIEVtYWls +MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsjmFpPJ9q0E7YkY3rs3B +YHW8OWX5ShpHornMSMxqmNVNNRm5pELlzkniii8efNIxB8dOtINknS4p1aJkxIW9 +hVE1eaROaJB7HHqkkqgX8pgV8pPMyaQylbsMTzC9mKALi+VuG6JG+ni8om+rWV6l +L8/K2m2qL+usobNqqrcuZzWLeeEeaYji5kbNoKXqvgvOdjp6Dpvq/NonWz1zHyLm +SGHGTPNpsaguG7bUMSAsvIKKjqQOpdeJQ/wWWq8dcdcRWdq6hw2v+vPhwvCkxWeM +1tZUOt4KpLoDd7NlyP0e03RiqhjKaJMeoYV+9Udly/hNVyh00jT/MLbu9mIwFIws +6wIDAQABo4G5MIG2MAsGA1UdDwQEAwIBxjAPBgNVHRMBAf8EBTADAQH/MB0GA1Ud +DgQWBBSJgmd9xJ0mcABLtFBIfN49rgRufTBYBgNVHR8EUTBPME2gS6BJhkdodHRw +Oi8vY3JsLnVzZXJ0cnVzdC5jb20vVVROLVVTRVJGaXJzdC1DbGllbnRBdXRoZW50 +aWNhdGlvbmFuZEVtYWlsLmNybDAdBgNVHSUEFjAUBggrBgEFBQcDAgYIKwYBBQUH +AwQwDQYJKoZIhvcNAQEFBQADggEBALFtYV2mGn98q0rkMPxTbyUkxsrt4jFcKw7u +7mFVbwQ+zznexRtJlOTrIEy05p5QLnLZjfWqo7NK2lYcYJeA3IKirUq9iiv/Cwm0 +xtcgBEXkzYABurorbs6q15L+5K/r9CYdFip/bDCVNy8zEqx/3cfREYxRmLLQo5HQ +rfafnoOTHh1CuEava2bwm3/q4wMC5QJRwarVNZ1yQAOJujEdxRBoUp7fooXFXAim +eOZTT7Hot9MUnpOmw2TjrH5xzbyf6QMbzPvprDHBr3wVdAKZw7JHpsIyYdfHb0gk +USeh1YdV8nuPmD0Wnu51tvjQjvLzxq4oW6fw8zYX/MMF08oDSlQ= +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIFRjCCAy6gAwIBAgIIbYwURrGmCu4wDQYJKoZIhvcNAQEMBQAwQTELMAkGA1UE +BhMCVVMxFDASBgNVBAoMC0FmZmlybVRydXN0MRwwGgYDVQQDDBNBZmZpcm1UcnVz +dCBQcmVtaXVtMB4XDTEwMDEyOTE0MTAzNloXDTQwMTIzMTE0MTAzNlowQTELMAkG +A1UEBhMCVVMxFDASBgNVBAoMC0FmZmlybVRydXN0MRwwGgYDVQQDDBNBZmZpcm1U +cnVzdCBQcmVtaXVtMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAxBLf +qV/+Qd3d9Z+K4/as4Tx4mrzY8H96oDMq3I0gW64tb+eT2TZwamjPjlGjhVtnBKAQ +JG9dKILBl1fYSCkTtuG+kU3fhQxTGJoeJKJPj/CihQvL9Cl/0qRY7iZNyaqoe5rZ ++jjeRFcV5fiMyNlI4g0WJx0eyIOFJbe6qlVBzAMiSy2RjYvmia9mx+n/K+k8rNrS +s8PhaJyJ+HoAVt70VZVs+7pk3WKL3wt3MutizCaam7uqYoNMtAZ6MMgpv+0GTZe5 +HMQxK9VfvFMSF5yZVylmd2EhMQcuJUmdGPLu8ytxjLW6OQdJd/zvLpKQBY0tL3d7 +70O/Nbua2Plzpyzy0FfuKE4mX4+QaAkvuPjcBukumj5Rp9EixAqnOEhss/n/fauG +V+O61oV4d7pD6kh/9ti+I20ev9E2bFhc8e6kGVQa9QPSdubhjL08s9NIS+LI+H+S +qHZGnEJlPqQewQcDWkYtuJfzt9WyVSHvutxMAJf7FJUnM7/oQ0dG0giZFmA7mn7S +5u046uwBHjxIVkkJx0w3AJ6IDsBz4W9m6XJHMD4Q5QsDyZpCAGzFlH5hxIrff4Ia +C1nEWTJ3s7xgaVY5/bQGeyzWZDbZvUjthB9+pSKPKrhC9IK31FOQeE4tGv2Bb0TX +OwF0lkLgAOIua+rF7nKsu7/+6qqo+Nz2snmKtmcCAwEAAaNCMEAwHQYDVR0OBBYE +FJ3AZ6YMItkm9UWrpmVSESfYRaxjMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/ +BAQDAgEGMA0GCSqGSIb3DQEBDAUAA4ICAQCzV00QYk465KzquByvMiPIs0laUZx2 +KI15qldGF9X1Uva3ROgIRL8YhNILgM3FEv0AVQVhh0HctSSePMTYyPtwni94loMg +Nt58D2kTiKV1NpgIpsbfrM7jWNa3Pt668+s0QNiigfV4Py/VpfzZotReBA4Xrf5B +8OWycvpEgjNC6C1Y91aMYj+6QrCcDFx+LmUmXFNPALJ4fqENmS2NuB2OosSw/WDQ +MKSOyARiqcTtNd56l+0OOF6SL5Nwpamcb6d9Ex1+xghIsV5n61EIJenmJWtSKZGc +0jlzCFfemQa0W50QBuHCAKi4HEoCChTQwUHK+4w1IX2COPKpVJEZNZOUbWo6xbLQ +u4mGk+ibyQ86p3q4ofB4Rvr8Ny/lioTz3/4E2aFooC8k4gmVBtWVyuEklut89pMF +u+1z6S3RdTnX5yTb2E5fQ4+e0BQ5v1VwSJlXMbSc7kqYA5YwH2AG7hsj/oFgIxpH +YoWlzBk0gG+zrBrjn/B7SK3VAdlntqlyk+otZrWyuOQ9PLLvTIzq6we/qzWaVYa8 +GKa1qF60g2xraUDTn9zxw2lrueFtCfTxqlB2Cnp9ehehVZZCmTEJ3WARjQUwfuaO +RtGdFNrHF+QFlozEJLUbzxQHskD4o55BhrwE0GuWyCqANP2/7waj3VjFhT0+j/6e +KeC2uAloGRwYQw== +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIEFTCCAv2gAwIBAgIBATANBgkqhkiG9w0BAQUFADBkMQswCQYDVQQGEwJTRTEU +MBIGA1UEChMLQWRkVHJ1c3QgQUIxHTAbBgNVBAsTFEFkZFRydXN0IFRUUCBOZXR3 +b3JrMSAwHgYDVQQDExdBZGRUcnVzdCBQdWJsaWMgQ0EgUm9vdDAeFw0wMDA1MzAx +MDQxNTBaFw0yMDA1MzAxMDQxNTBaMGQxCzAJBgNVBAYTAlNFMRQwEgYDVQQKEwtB +ZGRUcnVzdCBBQjEdMBsGA1UECxMUQWRkVHJ1c3QgVFRQIE5ldHdvcmsxIDAeBgNV +BAMTF0FkZFRydXN0IFB1YmxpYyBDQSBSb290MIIBIjANBgkqhkiG9w0BAQEFAAOC +AQ8AMIIBCgKCAQEA6Rowj4OIFMEg2Dybjxt+A3S72mnTRqX4jsIMEZBRpS9mVEBV +6tsfSlbunyNu9DnLoblv8n75XYcmYZ4c+OLspoH4IcUkzBEMP9smcnrHAZcHF/nX +GCwwfQ56HmIexkvA/X1id9NEHif2P0tEs7c42TkfYNVRknMDtABp4/MUTu7R3AnP +dzRGULD4EfL+OHn3Bzn+UZKXC1sIXzSGAa2Il+tmzV7R/9x98oTaunet3IAIx6eH +1lWfl2royBFkuucZKT8Rs3iQhCBSWxHveNCD9tVIkNAwHM+A+WD+eeSI8t0A65RF +62WUaUC6wNW0uLp9BBGo6zEFlpROWCGOn9Bg/QIDAQABo4HRMIHOMB0GA1UdDgQW +BBSBPjfYkrAfd59ctKtzquf2NGAv+jALBgNVHQ8EBAMCAQYwDwYDVR0TAQH/BAUw +AwEB/zCBjgYDVR0jBIGGMIGDgBSBPjfYkrAfd59ctKtzquf2NGAv+qFopGYwZDEL +MAkGA1UEBhMCU0UxFDASBgNVBAoTC0FkZFRydXN0IEFCMR0wGwYDVQQLExRBZGRU +cnVzdCBUVFAgTmV0d29yazEgMB4GA1UEAxMXQWRkVHJ1c3QgUHVibGljIENBIFJv +b3SCAQEwDQYJKoZIhvcNAQEFBQADggEBAAP3FUr4JNojVhaTdt02KLmuG7jD8WS6 +IBh4lSknVwW8fCr0uVFV2ocC3g8WFzH4qnkuCRO7r7IgGRLlk/lL+YPoRNWyQSW/ +iHVv/xD8SlTQX/D67zZzfRs2RcYhbbQVuE7PnFylPVoAjgbjPGsye/Kf8Lb93/Ao +GEjwxrzQvzSAlsJKsW2Ox5BF3i9nrEUEo3rcVZLJR2bYGozH7ZxOmuASu7VqTITh +4SINhwBk/ox9Yjllpu9CtoAlEmEBqCQTcAARJl/6NVDFSMwGR+gn2HCNX2TmoUQm +XiLsks3/QppEIW1cxeMiHV9HEufOX1362KqxMy3ZdvJOOjMMK7MtkAY= +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIEajCCA1KgAwIBAgIBATANBgkqhkiG9w0BAQUFADBaMQswCQYDVQQGEwJKUDEN +MAsGA1UECgwESlBLSTEpMCcGA1UECwwgUHJlZmVjdHVyYWwgQXNzb2NpYXRpb24g +Rm9yIEpQS0kxETAPBgNVBAsMCEJyaWRnZUNBMB4XDTAzMTIyNzA1MDgxNVoXDTEz +MTIyNjE0NTk1OVowWjELMAkGA1UEBhMCSlAxDTALBgNVBAoMBEpQS0kxKTAnBgNV +BAsMIFByZWZlY3R1cmFsIEFzc29jaWF0aW9uIEZvciBKUEtJMREwDwYDVQQLDAhC +cmlkZ2VDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBANTnUmg7K3m8 +52vd77kwkq156euwoWm5no8E8kmaTSc7x2RABPpqNTlMKdZ6ttsyYrqREeDkcvPL +yF7yf/I8+innasNtsytcTAy8xY8Avsbd4JkCGW9dyPjk9pzzc3yLQ64Rx2fujRn2 +agcEVdPCr/XpJygX8FD5bbhkZ0CVoiASBmlHOcC3YpFlfbT1QcpOSOb7o+VdKVEi +MMfbBuU2IlYIaSr/R1nO7RPNtkqkFWJ1/nKjKHyzZje7j70qSxb+BTGcNgTHa1YA +UrogKB+UpBftmb4ds+XlkEJ1dvwokiSbCDaWFKD+YD4B2s0bvjCbw8xuZFYGhNyR +/2D5XfN1s2MCAwEAAaOCATkwggE1MA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8E +BTADAQH/MG0GA1UdHwRmMGQwYqBgoF6kXDBaMQswCQYDVQQGEwJKUDENMAsGA1UE +CgwESlBLSTEpMCcGA1UECwwgUHJlZmVjdHVyYWwgQXNzb2NpYXRpb24gRm9yIEpQ +S0kxETAPBgNVBAsMCEJyaWRnZUNBMIGDBgNVHREEfDB6pHgwdjELMAkGA1UEBhMC +SlAxJzAlBgNVBAoMHuWFrOeahOWAi+S6uuiqjeiovOOCteODvOODk+OCuTEeMBwG +A1UECwwV6YO96YGT5bqc55yM5Y2U6K2w5LyaMR4wHAYDVQQLDBXjg5bjg6rjg4Pj +grjoqo3oqLzlsYAwHQYDVR0OBBYEFNQXMiCqQNkR2OaZmQgLtf8mR8p8MA0GCSqG +SIb3DQEBBQUAA4IBAQATjJo4reTNPC5CsvAKu1RYT8PyXFVYHbKsEpGt4GR8pDCg +HEGAiAhHSNrGh9CagZMXADvlG0gmMOnXowriQQixrtpkmx0TB8tNAlZptZWkZC+R +8TnjOkHrk2nFAEC3ezbdK0R7MR4tJLDQCnhEWbg50rf0wZ/aF8uAaVeEtHXa6W0M +Xq3dSe0XAcrLbX4zZHQTaWvdpLAIjl6DZ3SCieRMyoWUL+LXaLFdTP5WBCd+No58 +IounD9X4xxze2aeRVaiV/WnQ0OSPNS7n7YXy6xQdnaOU4KRW/Lne1EDf5IfWC/ih +bVAmhZMbcrkWWcsR6aCPG+2mV3zTD6AUzuKPal8Y +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIDdTCCAl2gAwIBAgILBAAAAAABFUtaw5QwDQYJKoZIhvcNAQEFBQAwVzELMAkG +A1UEBhMCQkUxGTAXBgNVBAoTEEdsb2JhbFNpZ24gbnYtc2ExEDAOBgNVBAsTB1Jv +b3QgQ0ExGzAZBgNVBAMTEkdsb2JhbFNpZ24gUm9vdCBDQTAeFw05ODA5MDExMjAw +MDBaFw0yODAxMjgxMjAwMDBaMFcxCzAJBgNVBAYTAkJFMRkwFwYDVQQKExBHbG9i +YWxTaWduIG52LXNhMRAwDgYDVQQLEwdSb290IENBMRswGQYDVQQDExJHbG9iYWxT +aWduIFJvb3QgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDaDuaZ +jc6j40+Kfvvxi4Mla+pIH/EqsLmVEQS98GPR4mdmzxzdzxtIK+6NiY6arymAZavp +xy0Sy6scTHAHoT0KMM0VjU/43dSMUBUc71DuxC73/OlS8pF94G3VNTCOXkNz8kHp +1Wrjsok6Vjk4bwY8iGlbKk3Fp1S4bInMm/k8yuX9ifUSPJJ4ltbcdG6TRGHRjcdG +snUOhugZitVtbNV4FpWi6cgKOOvyJBNPc1STE4U6G7weNLWLBYy5d4ux2x8gkasJ +U26Qzns3dLlwR5EiUWMWea6xrkEmCMgZK9FGqkjWZCrXgzT/LCrBbBlDSgeF59N8 +9iFo7+ryUp9/k5DPAgMBAAGjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8E +BTADAQH/MB0GA1UdDgQWBBRge2YaRQ2XyolQL30EzTSo//z9SzANBgkqhkiG9w0B +AQUFAAOCAQEA1nPnfE920I2/7LqivjTFKDK1fPxsnCwrvQmeU79rXqoRSLblCKOz +yj1hTdNGCbM+w6DjY1Ub8rrvrTnhQ7k4o+YviiY776BQVvnGCv04zcQLcFGUl5gE +38NflNUVyRRBnMRddWQVDf9VMOyGj/8N7yy5Y0b2qvzfvGn9LhJIZJrglfCm7ymP +AbEVtQwdpf5pLGkkeB6zpxxxYu7KyJesF12KwvhHhm4qxFYxldBniYUr+WymXUad +DKqC5JlR3XC321Y9YeRq4VzW9v493kHMB65jUr9TU/Qr6cf9tveCX4XSQRjbgbME +HMUfpIBvFSDJ3gyICh3WZlXi/EjJKSZp4A== +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIDdTCCAl2gAwIBAgILAgAAAAAA1ni3lAUwDQYJKoZIhvcNAQEEBQAwVzELMAkG +A1UEBhMCQkUxGTAXBgNVBAoTEEdsb2JhbFNpZ24gbnYtc2ExEDAOBgNVBAsTB1Jv +b3QgQ0ExGzAZBgNVBAMTEkdsb2JhbFNpZ24gUm9vdCBDQTAeFw05ODA5MDExMjAw +MDBaFw0xNDAxMjgxMjAwMDBaMFcxCzAJBgNVBAYTAkJFMRkwFwYDVQQKExBHbG9i +YWxTaWduIG52LXNhMRAwDgYDVQQLEwdSb290IENBMRswGQYDVQQDExJHbG9iYWxT +aWduIFJvb3QgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDaDuaZ +jc6j40+Kfvvxi4Mla+pIH/EqsLmVEQS98GPR4mdmzxzdzxtIK+6NiY6arymAZavp +xy0Sy6scTHAHoT0KMM0VjU/43dSMUBUc71DuxC73/OlS8pF94G3VNTCOXkNz8kHp +1Wrjsok6Vjk4bwY8iGlbKk3Fp1S4bInMm/k8yuX9ifUSPJJ4ltbcdG6TRGHRjcdG +snUOhugZitVtbNV4FpWi6cgKOOvyJBNPc1STE4U6G7weNLWLBYy5d4ux2x8gkasJ +U26Qzns3dLlwR5EiUWMWea6xrkEmCMgZK9FGqkjWZCrXgzT/LCrBbBlDSgeF59N8 +9iFo7+ryUp9/k5DPAgMBAAGjQjBAMA4GA1UdDwEB/wQEAwIABjAdBgNVHQ4EFgQU +YHtmGkUNl8qJUC99BM00qP/8/UswDwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG9w0B +AQQFAAOCAQEArqqf/LfSyx9fOSkoGJ40yWxPbxrwZKJwSk8ThptgKJ7ogUmYfQq7 +5bCdPTbbjwVR/wkxKh/diXeeDy5slQTthsu0AD+EAk2AaioteAuubyuig0SDH81Q +gkwkr733pbTIWg/050deSY43lv6aiAU62cDbKYfmGZZHpzqmjIs8d/5GY6dT2iHR +rH5Jokvmw2dZL7OKDrssvamqQnw1wdh/1acxOk5jQzmvCLBhNIzTmKlDNPYPhyk7 +ncJWWJh3w/cbrPad+D6qp1RF8PX51TFl/mtYnHGzHtdS6jIX/EBgHcl5JLL2bP2o +Zg6C3ZjL2sJETy6ge/L3ayx2EYRGinij4w== +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIEKzCCAxOgAwIBAgIEOsylTDANBgkqhkiG9w0BAQUFADBDMQswCQYDVQQGEwJE +SzEVMBMGA1UEChMMVERDIEludGVybmV0MR0wGwYDVQQLExRUREMgSW50ZXJuZXQg +Um9vdCBDQTAeFw0wMTA0MDUxNjMzMTdaFw0yMTA0MDUxNzAzMTdaMEMxCzAJBgNV +BAYTAkRLMRUwEwYDVQQKEwxUREMgSW50ZXJuZXQxHTAbBgNVBAsTFFREQyBJbnRl +cm5ldCBSb290IENBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxLhA +vJHVYx/XmaCLDEAedLdInUaMArLgJF/wGROnN4NrXceO+YQwzho7+vvOi20jxsNu +Zp+Jpd/gQlBn+h9sHvTQBda/ytZO5GhgbEaqHF1j4QeGDmUApy6mcca8uYGoOn0a +0vnRrEvLznWv3Hv6gXPU/Lq9QYjUdLP5Xjg6PEOo0pVOd20TDJ2PeAG3WiAfAzc1 +4izbSysseLlJ28TQx5yc5IogCSEWVmb/Bexb4/DPqyQkXsN/cHoSxNK1EKC2IeGN +eGlVRGn1ypYcNIUXJXfi9i8nmHj9eQY6otZaQ8H/7AQ77hPv01ha/5Lr7K7a8jcD +R0G2l8ktCkEiu7vmpwIDAQABo4IBJTCCASEwEQYJYIZIAYb4QgEBBAQDAgAHMGUG +A1UdHwReMFwwWqBYoFakVDBSMQswCQYDVQQGEwJESzEVMBMGA1UEChMMVERDIElu +dGVybmV0MR0wGwYDVQQLExRUREMgSW50ZXJuZXQgUm9vdCBDQTENMAsGA1UEAxME +Q1JMMTArBgNVHRAEJDAigA8yMDAxMDQwNTE2MzMxN1qBDzIwMjEwNDA1MTcwMzE3 +WjALBgNVHQ8EBAMCAQYwHwYDVR0jBBgwFoAUbGQBx/2FbazI2p5QCIUItTxWqFAw +HQYDVR0OBBYEFGxkAcf9hW2syNqeUAiFCLU8VqhQMAwGA1UdEwQFMAMBAf8wHQYJ +KoZIhvZ9B0EABBAwDhsIVjUuMDo0LjADAgSQMA0GCSqGSIb3DQEBBQUAA4IBAQBO +Q8zR3R0QGwZ/t6T609lN+yOfI1Rb5osvBCiLtSdtiaHsmGnc540mgwV5dOy0uaOX +wTUA/RXaOYE6lTGQ3pfphqiZdwzlWqCE/xIWrG64jcN7ksKsLtB9KOy282A4aW8+ +2ARVPp7MVdK6/rtHBNcK2RYKNCn1WBPVT8+PVkuzHu7TmHnaCB4Mb7j4Fifvwm89 +9qNLPg7kbWzbO0ESm70NRyN/PErQr8Cv9u8btRXE64PECV90i9kR+8JWsTz4cMo0 +jUNAE4z9mQNUecYu6oah9jrUCbz0vGbMPVjQV0kK7iXiQe4T+Zs4NNEA9X7nlB38 +aQNiuJkFBT1reBK9sG9l +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIB4TCCAYegAwIBAgIRKjikHJYKBN5CsiilC+g0mAIwCgYIKoZIzj0EAwIwUDEk +MCIGA1UECxMbR2xvYmFsU2lnbiBFQ0MgUm9vdCBDQSAtIFI0MRMwEQYDVQQKEwpH +bG9iYWxTaWduMRMwEQYDVQQDEwpHbG9iYWxTaWduMB4XDTEyMTExMzAwMDAwMFoX +DTM4MDExOTAzMTQwN1owUDEkMCIGA1UECxMbR2xvYmFsU2lnbiBFQ0MgUm9vdCBD +QSAtIFI0MRMwEQYDVQQKEwpHbG9iYWxTaWduMRMwEQYDVQQDEwpHbG9iYWxTaWdu +MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEuMZ5049sJQ6fLjkZHAOkrprlOQcJ +FspjsbmG+IpXwVfOQvpzofdlQv8ewQCybnMO/8ch5RikqtlxP6jUuc6MHaNCMEAw +DgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFFSwe61F +uOJAf/sKbvu+M8k8o4TVMAoGCCqGSM49BAMCA0gAMEUCIQDckqGgE6bPA7DmxCGX +kPoUVy0D7O48027KqGx2vKLeuwIgJ6iFJzWbVsaj8kfSt24bAgAXqmemFZHe+pTs +ewv4n4Q= +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIF0DCCBLigAwIBAgIEOrZQizANBgkqhkiG9w0BAQUFADB/MQswCQYDVQQGEwJC +TTEZMBcGA1UEChMQUXVvVmFkaXMgTGltaXRlZDElMCMGA1UECxMcUm9vdCBDZXJ0 +aWZpY2F0aW9uIEF1dGhvcml0eTEuMCwGA1UEAxMlUXVvVmFkaXMgUm9vdCBDZXJ0 +aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0wMTAzMTkxODMzMzNaFw0yMTAzMTcxODMz +MzNaMH8xCzAJBgNVBAYTAkJNMRkwFwYDVQQKExBRdW9WYWRpcyBMaW1pdGVkMSUw +IwYDVQQLExxSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MS4wLAYDVQQDEyVR +dW9WYWRpcyBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIIBIjANBgkqhkiG +9w0BAQEFAAOCAQ8AMIIBCgKCAQEAv2G1lVO6V/z68mcLOhrfEYBklbTRvM16z/Yp +li4kVEAkOPcahdxYTMukJ0KX0J+DisPkBgNbAKVRHnAEdOLB1Dqr1607BxgFjv2D +rOpm2RgbaIr1VxqYuvXtdj182d6UajtLF8HVj71lODqV0D1VNk7feVcxKh7YWWVJ +WCCYfqtffp/p1k3sg3Spx2zY7ilKhSoGFPlU5tPaZQeLYzcS19Dsw3sgQUSj7cug +F+FxZc4dZjH3dgEZyH0DWLaVSR2mEiboxgx24ONmy+pdpibu5cxfvWenAScOospU +xbF6lR1xHkopigPcakXBpBlebzbNw6Kwt/5cOOJSvPhEQ+aQuwIDAQABo4ICUjCC +Ak4wPQYIKwYBBQUHAQEEMTAvMC0GCCsGAQUFBzABhiFodHRwczovL29jc3AucXVv +dmFkaXNvZmZzaG9yZS5jb20wDwYDVR0TAQH/BAUwAwEB/zCCARoGA1UdIASCAREw +ggENMIIBCQYJKwYBBAG+WAABMIH7MIHUBggrBgEFBQcCAjCBxxqBxFJlbGlhbmNl +IG9uIHRoZSBRdW9WYWRpcyBSb290IENlcnRpZmljYXRlIGJ5IGFueSBwYXJ0eSBh +c3N1bWVzIGFjY2VwdGFuY2Ugb2YgdGhlIHRoZW4gYXBwbGljYWJsZSBzdGFuZGFy +ZCB0ZXJtcyBhbmQgY29uZGl0aW9ucyBvZiB1c2UsIGNlcnRpZmljYXRpb24gcHJh +Y3RpY2VzLCBhbmQgdGhlIFF1b1ZhZGlzIENlcnRpZmljYXRlIFBvbGljeS4wIgYI +KwYBBQUHAgEWFmh0dHA6Ly93d3cucXVvdmFkaXMuYm0wHQYDVR0OBBYEFItLbe3T +KbkGGew5Oanwl4Rqy+/fMIGuBgNVHSMEgaYwgaOAFItLbe3TKbkGGew5Oanwl4Rq +y+/foYGEpIGBMH8xCzAJBgNVBAYTAkJNMRkwFwYDVQQKExBRdW9WYWRpcyBMaW1p +dGVkMSUwIwYDVQQLExxSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MS4wLAYD +VQQDEyVRdW9WYWRpcyBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5ggQ6tlCL +MA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQUFAAOCAQEAitQUtf70mpKnGdSk +fnIYj9lofFIk3WdvOXrEql494liwTXCYhGHoG+NpGA7O+0dQoE7/8CQfvbLO9Sf8 +7C9TqnN7Az10buYWnuulLsS/VidQK2K6vkscPFVcQR0kvoIgR13VRH56FmjffU1R +cHhXHTMe/QKZnAzNCgVPx7uOpHX6Sm2xgI4JVrmcGmD+XcHXetwReNDWXcG31a0y +mQM6isxUJTkxgXsTIlG6Rmyhu576BGxJJnSP0nPrzDCi5upZIof4l/UO/erMkqQW +xFIY6iHOsfHmhIHluqmGKPJDWl0Snawe2ajlCmqnf6CHKc/yiU3U7MXi5nrQNiOK +SnQ2+Q== +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIDwzCCAqugAwIBAgIBATANBgkqhkiG9w0BAQsFADCBgjELMAkGA1UEBhMCREUx +KzApBgNVBAoMIlQtU3lzdGVtcyBFbnRlcnByaXNlIFNlcnZpY2VzIEdtYkgxHzAd +BgNVBAsMFlQtU3lzdGVtcyBUcnVzdCBDZW50ZXIxJTAjBgNVBAMMHFQtVGVsZVNl +YyBHbG9iYWxSb290IENsYXNzIDIwHhcNMDgxMDAxMTA0MDE0WhcNMzMxMDAxMjM1 +OTU5WjCBgjELMAkGA1UEBhMCREUxKzApBgNVBAoMIlQtU3lzdGVtcyBFbnRlcnBy +aXNlIFNlcnZpY2VzIEdtYkgxHzAdBgNVBAsMFlQtU3lzdGVtcyBUcnVzdCBDZW50 +ZXIxJTAjBgNVBAMMHFQtVGVsZVNlYyBHbG9iYWxSb290IENsYXNzIDIwggEiMA0G +CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCqX9obX+hzkeXaXPSi5kfl82hVYAUd +AqSzm1nzHoqvNK38DcLZSBnuaY/JIPwhqgcZ7bBcrGXHX+0CfHt8LRvWurmAwhiC +FoT6ZrAIxlQjgeTNuUk/9k9uN0goOA/FvudocP05l03Sx5iRUKrERLMjfTlH6VJi +1hKTXrcxlkIF+3anHqP1wvzpesVsqXFP6st4vGCvx9702cu+fjOlbpSD8DT6Iavq +jnKgP6TeMFvvhk1qlVtDRKgQFRzlAVfFmPHmBiiRqiDFt1MmUUOyCxGVWOHAD3bZ +wI18gfNycJ5v/hqO2V81xrJvNHy+SE/iWjnX2J14np+GPgNeGYtEotXHAgMBAAGj +QjBAMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBS/ +WSA2AHmgoCJrjNXyYdK4LMuCSjANBgkqhkiG9w0BAQsFAAOCAQEAMQOiYQsfdOhy +NsZt+U2e+iKo4YFWz827n+qrkRk4r6p8FU3ztqONpfSO9kSpp+ghla0+AGIWiPAC +uvxhI+YzmzB6azZie60EI4RYZeLbK4rnJVM3YlNfvNoBYimipidx5joifsFvHZVw +IEoHNN/q/xWA5brXethbdXwFeilHfkCoMRN3zUA7tFFHei4R40cR3p1m0IvVVGb6 +g1XqfMIpiRvpb7PO4gWEyS8+eIVibslfwXhjdFjASBgMmTnrpMwatXlajRWc2BQN +9noHV8cigwUtPJslJj0Ys6lDfMjIq2SPDqO/nBudMNva0Bkuqjzx+zOAduTNrRlP +BSeOE6Fuwg== +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIFODCCAyCgAwIBAgIRAJW+FqD3LkbxezmCcvqLzZYwDQYJKoZIhvcNAQEFBQAw +NzEUMBIGA1UECgwLVGVsaWFTb25lcmExHzAdBgNVBAMMFlRlbGlhU29uZXJhIFJv +b3QgQ0EgdjEwHhcNMDcxMDE4MTIwMDUwWhcNMzIxMDE4MTIwMDUwWjA3MRQwEgYD +VQQKDAtUZWxpYVNvbmVyYTEfMB0GA1UEAwwWVGVsaWFTb25lcmEgUm9vdCBDQSB2 +MTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAMK+6yfwIaPzaSZVfp3F +VRaRXP3vIb9TgHot0pGMYzHw7CTww6XScnwQbfQ3t+XmfHnqjLWCi65ItqwA3GV1 +7CpNX8GH9SBlK4GoRz6JI5UwFpB/6FcHSOcZrr9FZ7E3GwYq/t75rH2D+1665I+X +Z75Ljo1kB1c4VWk0Nj0TSO9P4tNmHqTPGrdeNjPUtAa9GAH9d4RQAEX1jF3oI7x+ +/jXh7VB7qTCNGdMJjmhnXb88lxhTuylixcpecsHHltTbLaC0H2kD7OriUPEMPPCs +81Mt8Bz17Ww5OXOAFshSsCPN4D7c3TxHoLs1iuKYaIu+5b9y7tL6pe0S7fyYGKkm +dtwoSxAgHNN/Fnct7W+A90m7UwW7XWjH1Mh1Fj+JWov3F0fUTPHSiXk+TT2YqGHe +Oh7S+F4D4MHJHIzTjU3TlTazN19jY5szFPAtJmtTfImMMsJu7D0hADnJoWjiUIMu +sDor8zagrC/kb2HCUQk5PotTubtn2txTuXZZNp1D5SDgPTJghSJRt8czu90VL6R4 +pgd7gUY2BIbdeTXHlSw7sKMXNeVzH7RcWe/a6hBle3rQf5+ztCo3O3CLm1u5K7fs +slESl1MpWtTwEhDcTwK7EpIvYtQ/aUN8Ddb8WHUBiJ1YFkveupD/RwGJBmr2X7KQ +arMCpgKIv7NHfirZ1fpoeDVNAgMBAAGjPzA9MA8GA1UdEwEB/wQFMAMBAf8wCwYD +VR0PBAQDAgEGMB0GA1UdDgQWBBTwj1k4ALP1j5qWDNXr+nuqF+gTEjANBgkqhkiG +9w0BAQUFAAOCAgEAvuRcYk4k9AwI//DTDGjkk0kiP0Qnb7tt3oNmzqjMDfz1mgbl +dxSR651Be5kqhOX//CHBXfDkH1e3damhXwIm/9fH907eT/j3HEbAek9ALCI18Bmx +0GtnLLCo4MBANzX2hFxc469CeP6nyQ1Q6g2EdvZR74NTxnr/DlZJLo961gzmJ1Tj +TQpgcmLNkQfWpb/ImWvtxBnmq0wROMVvMeJuScg/doAmAyYp4Db29iBT4xdwNBed +Y2gea+zDTYa4EzAvXUYNR0PVG6pZDrlcjQZIrXSHX8f8MVRBE+LHIQ6e4B4N4cB7 +Q4WQxYpYxmUKeFfyxiMPAdkgS94P+5KFdSpcc41teyWRyu5FrgZLAMzTsVlQ2jqI +OylDRl6XK1TOU2+NSueW+r9xDkKLfP0ooNBIytrEgUy7onOTJsjrDNYmiLbAJM+7 +vVvrdX3pCI6GMyx5dwlppYn8s3CQh3aP0yK7Qs69cwsgJirQmz1wHiRszYd2qReW +t88NkvuOGKmYSdGe/mBEciG5Ge3C9THxOUiIkCR1VBatzvT4aRRkOfujuLpwQMcn +HL/EVlP6Y2XQ8xwOFvVrhlhNGNTkDY6lnVuR3HYkUD/GKvvZt5y11ubQ2egZixVx +SK236thZiNSQvxaz2emsWWFUyBy6ysHK4bkgTI86k4mloMy/0/Z1pHWWbVY= +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIEIDCCAwigAwIBAgIQNE7VVyDV7exJ9C/ON9srbTANBgkqhkiG9w0BAQUFADCB +qTELMAkGA1UEBhMCVVMxFTATBgNVBAoTDHRoYXd0ZSwgSW5jLjEoMCYGA1UECxMf +Q2VydGlmaWNhdGlvbiBTZXJ2aWNlcyBEaXZpc2lvbjE4MDYGA1UECxMvKGMpIDIw +MDYgdGhhd3RlLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxHzAdBgNV +BAMTFnRoYXd0ZSBQcmltYXJ5IFJvb3QgQ0EwHhcNMDYxMTE3MDAwMDAwWhcNMzYw +NzE2MjM1OTU5WjCBqTELMAkGA1UEBhMCVVMxFTATBgNVBAoTDHRoYXd0ZSwgSW5j +LjEoMCYGA1UECxMfQ2VydGlmaWNhdGlvbiBTZXJ2aWNlcyBEaXZpc2lvbjE4MDYG +A1UECxMvKGMpIDIwMDYgdGhhd3RlLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNl +IG9ubHkxHzAdBgNVBAMTFnRoYXd0ZSBQcmltYXJ5IFJvb3QgQ0EwggEiMA0GCSqG +SIb3DQEBAQUAA4IBDwAwggEKAoIBAQCsoPD7gFnUnMekz52hWXMJEEUMDSxuaPFs +W0hoSVk3/AszGcJ3f8wQLZU0HObrTQmnHNK4yZc2AreJ1CRfBsDMRJSUjQJib+ta +3RGNKJpchJAQeg29dGYvajig4tVUROsdB58Hum/u6f1OCyn1PoSgAfGcq/gcfomk +6KHYcWUNo1F77rzSImANuVud37r8UVsLr5iy6S7pBOhih94ryNdOwUxkHt3Ph1i6 +Sk/KaAcdHJ1KxtUvkcx8cXIcxcBn6zL9yZJclNqFwJu/U30rCfSMnZEfl2pSy94J +NqR32HuHUETVPm4pafs5SSYeCaWAe0At6+gnhcn+Yf1+5nyXHdWdAgMBAAGjQjBA +MA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBR7W0XP +r87Lev0xkhpqtvNG61dIUDANBgkqhkiG9w0BAQUFAAOCAQEAeRHAS7ORtvzw6WfU +DW5FvlXok9LOAz/t2iWwHVfLHjp2oEzsUHboZHIMpKnxuIvW1oeEuzLlQRHAd9mz +YJ3rG9XRbkREqaYB7FViHXe4XI5ISXycO1cRrK1zN44veFyQaEfZYGDm/Ac9IiAX +xPcW6cTYcvnIc3zfFi8VqT79aie2oetaupgf1eNNZAqdE8hhuvU5HIe6uL17In/2 +/qxAeeWsEG89jxt5dovEN7MhGITlNgDrYyCZuen+MwS7QcjBAvlEYyCegc5C09Y/ +LHbTY5xZ3Y+m4Q6gLkH3LpVHz7z9M/P2C2F+fpErgUfCJzDupxBdN49cOSvkBPB7 +jVaMaA== +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIDhDCCAmygAwIBAgIBCTANBgkqhkiG9w0BAQUFADAzMQswCQYDVQQGEwJDTjER +MA8GA1UEChMIVW5pVHJ1c3QxETAPBgNVBAMTCFVDQSBSb290MB4XDTA0MDEwMTAw +MDAwMFoXDTI5MTIzMTAwMDAwMFowMzELMAkGA1UEBhMCQ04xETAPBgNVBAoTCFVu +aVRydXN0MREwDwYDVQQDEwhVQ0EgUm9vdDCCASIwDQYJKoZIhvcNAQEBBQADggEP +ADCCAQoCggEBALNdB8qGJn1r4vs4CQ7MgsJqGgCiFV/W6dQBt1YDAVmP9ThpJHbC +XivF9iu/r/tB/Q9a/KvXg3BNMJjRnrJ2u5LWu+kQKGkoNkTo8SzXWHwk1n8COvCB +a2FgP/Qz3m3l6ihST/ypHWN8C7rqrsRoRuTej8GnsrZYWm0dLNmMOreIy4XU9+gD +Xv2yTVDo1h//rgI/i0+WITyb1yXJHT/7mLFZ5PCpO6+zzYUs4mBGzG+OoOvwNMXx +QhhgrhLtRnUc5dipllq+3lrWeGeWW5N3UPJuG96WUUqm1ktDdSFmjXfsAoR2XEQQ +th1hbOSjIH23jboPkXXHjd+8AmCoKai9PUMCAwEAAaOBojCBnzALBgNVHQ8EBAMC +AQYwDAYDVR0TBAUwAwEB/zBjBgNVHSUEXDBaBggrBgEFBQcDAQYIKwYBBQUHAwIG +CCsGAQUFBwMDBggrBgEFBQcDBAYIKwYBBQUHAwUGCCsGAQUFBwMGBggrBgEFBQcD +BwYIKwYBBQUHAwgGCCsGAQUFBwMJMB0GA1UdDgQWBBTbHzXza0z/QjFkm827Wh4d +SBC37jANBgkqhkiG9w0BAQUFAAOCAQEAOGy3iPGt+lg3dNHocN6cJ1nL5BXXoMNg +14iABMUwTD3UGusGXllH5rxmy+AI/Og17GJ9ysDawXiv5UZv+4mCI4/211NmVaDe +JRI7cTYWVRJ2+z34VFsxugAG+H1V5ad2g6pcSpemKijfvcZsCyOVjjN/Hl5AHxNU +LJzltQ7dFyiuawHTUin1Ih+QOfTcYmjwPIZH7LgFRbu3DJaUxmfLI3HQjnQi1kHr +A6i26r7EARK1s11AdgYg1GS4KUYGis4fk5oQ7vuqWrTcL9Ury/bXBYSYBZELhPc9 ++tb5evosFeo2gkO3t7jj83EB7UNDogVFwygFBzXjAaU4HoDU18PZ3g== +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIID8TCCAtmgAwIBAgIQQT1yx/RrH4FDffHSKFTfmjANBgkqhkiG9w0BAQUFADCB +ijELMAkGA1UEBhMCQ0gxEDAOBgNVBAoTB1dJU2VLZXkxGzAZBgNVBAsTEkNvcHly +aWdodCAoYykgMjAwNTEiMCAGA1UECxMZT0lTVEUgRm91bmRhdGlvbiBFbmRvcnNl +ZDEoMCYGA1UEAxMfT0lTVEUgV0lTZUtleSBHbG9iYWwgUm9vdCBHQSBDQTAeFw0w +NTEyMTExNjAzNDRaFw0zNzEyMTExNjA5NTFaMIGKMQswCQYDVQQGEwJDSDEQMA4G +A1UEChMHV0lTZUtleTEbMBkGA1UECxMSQ29weXJpZ2h0IChjKSAyMDA1MSIwIAYD +VQQLExlPSVNURSBGb3VuZGF0aW9uIEVuZG9yc2VkMSgwJgYDVQQDEx9PSVNURSBX +SVNlS2V5IEdsb2JhbCBSb290IEdBIENBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A +MIIBCgKCAQEAy0+zAJs9Nt350UlqaxBJH+zYK7LG+DKBKUOVTJoZIyEVRd7jyBxR +VVuuk+g3/ytr6dTqvirdqFEr12bDYVxgAsj1znJ7O7jyTmUIms2kahnBAbtzptf2 +w93NvKSLtZlhuAGio9RN1AU9ka34tAhxZK9w8RxrfvbDd50kc3vkDIzh2TbhmYsF +mQvtRTEJysIA2/dyoJaqlYfQjse2YXMNdmaM3Bu0Y6Kff5MTMPGhJ9vZ/yxViJGg +4E8HsChWjBgbl0SOid3gF27nKu+POQoxhILYQBRJLnpB5Kf+42TMwVlxSywhp1t9 +4B3RLoGbw9ho972WG6xwsRYUC9tguSYBBQIDAQABo1EwTzALBgNVHQ8EBAMCAYYw +DwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUswN+rja8sHnR3JQmthG+IbJphpQw +EAYJKwYBBAGCNxUBBAMCAQAwDQYJKoZIhvcNAQEFBQADggEBAEuh/wuHbrP5wUOx +SPMowB0uyQlB+pQAHKSkq0lPjz0e701vvbyk9vImMMkQyh2I+3QZH4VFvbBsUfk2 +ftv1TDI6QU9bR8/oCy22xBmddMVHxjtqD6wU2zz0c5ypBd8A3HR4+vg1YFkCExh8 +vPtNsCBtQ7tgMHpnM1zFmdH4LTlSc/uMqpclXHLZCB6rTjzjgTGfA6b7wP4piFXa +hNVQA7bihKOmNqoROgHhGEvWRGizPflTdISzRpFGlgC3gCy24eMQ4tui5yiPAZZi +Fj4A4xylNoEYokxSdsARo27mHbrjWr42U8U+dY+GaSlYU7Wcu2+fXMUY7N0v4ZjJ +/L7fCg0= +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIDlDCCAnygAwIBAgIQWAsFbFMk27JQVxhf+eWmUDANBgkqhkiG9w0BAQUFADAn +MQswCQYDVQQGEwJCRTEYMBYGA1UEAxMPQmVsZ2l1bSBSb290IENBMB4XDTAzMDEy +NjIzMDAwMFoXDTE0MDEyNjIzMDAwMFowJzELMAkGA1UEBhMCQkUxGDAWBgNVBAMT +D0JlbGdpdW0gUm9vdCBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB +AMihcekcRkJ5eHFvna6pqKsot03HIOswkVp19eLSz8hMFJhCWK3HEcVAQGpa+XQS +J4fpnOVxTiIs0RIYqjBeoiG52bv/9nTrMQHnO35YD5EWTXaJqAFPrSJmcPpLHZXB +MFjqvNll2Jq0iOtJRlLf0lMVdssUXRlJsW9q09P9vMIt7EU/CT9YvvzU7wCMgTVy +v/cY6pZifSsofxVsY9LKyn0FrMhtB20yvmi4BUCuVJhWPmbxMOjvxKuTXgfeMo8S +dKpbNCNUwOpszv42kqgJF+qhLc9s44Qd3ocuMws8dOIhUDiVLlzg5cYx+dtA+mqh +pIqTm6chBocdJ9PEoclMsG8CAwEAAaOBuzCBuDAOBgNVHQ8BAf8EBAMCAQYwDwYD +VR0TAQH/BAUwAwEB/zBCBgNVHSAEOzA5MDcGBWA4AQEBMC4wLAYIKwYBBQUHAgEW +IGh0dHA6Ly9yZXBvc2l0b3J5LmVpZC5iZWxnaXVtLmJlMB0GA1UdDgQWBBQQ8AxW +m2HqVzq2NZdtn925FI7b5jARBglghkgBhvhCAQEEBAMCAAcwHwYDVR0jBBgwFoAU +EPAMVpth6lc6tjWXbZ/duRSO2+YwDQYJKoZIhvcNAQEFBQADggEBAMhtIlGKYfgP +lm7VILKB+MbcoxYA2s1q52sq+llIp0xJN9dzoWoBZV4yveeX09AuPHPTjHuD79ZC +wT+oqV0PN7p20kC9zC0/00RBSZz9Wyn0AiMiW3Ebv1jZKE4tRfTa57VjRUQRDSp/ +M382SbTObqkCMa5c/ciJv0J71/Fg8teH9lcuen5qE4Ad3OPQYx49cTGxYNSeCMqr +8JTHSHVUgfMbrXec6LKP24OsjzRr6L/D2fVDw2RV6xq9NoY2uiGMlxoh1OotO6y6 +7Kcdq765Sps1LxxcHVGnH1TtEpf/8m6HfUbJdNbv6z195lluBpQE5KJVhzgoaiJe +4r50ErAEQyo= +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIDTDCCAjSgAwIBAgIId3cGJyapsXwwDQYJKoZIhvcNAQELBQAwRDELMAkGA1UE +BhMCVVMxFDASBgNVBAoMC0FmZmlybVRydXN0MR8wHQYDVQQDDBZBZmZpcm1UcnVz +dCBDb21tZXJjaWFsMB4XDTEwMDEyOTE0MDYwNloXDTMwMTIzMTE0MDYwNlowRDEL +MAkGA1UEBhMCVVMxFDASBgNVBAoMC0FmZmlybVRydXN0MR8wHQYDVQQDDBZBZmZp +cm1UcnVzdCBDb21tZXJjaWFsMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKC +AQEA9htPZwcroRX1BiLLHwGy43NFBkRJLLtJJRTWzsO3qyxPxkEylFf6EqdbDuKP +Hx6GGaeqtS25Xw2Kwq+FNXkyLbscYjfysVtKPcrNcV/pQr6U6Mje+SJIZMblq8Yr +ba0F8PrVC8+a5fBQpIs7R6UjW3p6+DM/uO+Zl+MgwdYoic+U+7lF7eNAFxHUdPAL +MeIrJmqbTFeurCA+ukV6BfO9m2kVrn1OIGPENXY6BwLJN/3HR+7o8XYdcxXyl6S1 +yHp52UKqK39c/s4mT6NmgTWvRLpUHhwwMmWd5jyTXlBOeuM61G7MGvv50jeuJCqr +VwMiKA1JdX+3KNp1v47j3A55MQIDAQABo0IwQDAdBgNVHQ4EFgQUnZPGU4teyq8/ +nx4P5ZmVvCT2lI8wDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwDQYJ +KoZIhvcNAQELBQADggEBAFis9AQOzcAN/wr91LoWXym9e2iZWEnStB03TX8nfUYG +XUPGhi4+c7ImfU+TqbbEKpqrIZcUsd6M06uJFdhrJNTxFq7YpFzUf1GO7RgBsZNj +vbz4YYCanrHOQnDiqX0GJX0nof5v7LMeJNrjS1UaADs1tDvZ110w/YETifLCBivt +Z8SOyUOyXGsViQK8YvxO8rUzqrJv0wqiUOP2O+guRMLbZjipM1ZI8W0bM40NjD9g +N53Tym1+NH4Nn3J2ixufcv1SNUFFApYvHLKac0khsUlHRUe072o0EclNmsxZt9YC +nlpOZbWUrhvfKbAW8b8Angc6F2S1BLUjIZkKlTuXfO8= +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIEQzCCAyugAwIBAgIDCYP0MA0GCSqGSIb3DQEBCwUAMFAxCzAJBgNVBAYTAkRF +MRUwEwYDVQQKDAxELVRydXN0IEdtYkgxKjAoBgNVBAMMIUQtVFJVU1QgUm9vdCBD +bGFzcyAzIENBIDIgRVYgMjAwOTAeFw0wOTExMDUwODUwNDZaFw0yOTExMDUwODUw +NDZaMFAxCzAJBgNVBAYTAkRFMRUwEwYDVQQKDAxELVRydXN0IEdtYkgxKjAoBgNV +BAMMIUQtVFJVU1QgUm9vdCBDbGFzcyAzIENBIDIgRVYgMjAwOTCCASIwDQYJKoZI +hvcNAQEBBQADggEPADCCAQoCggEBAJnxhDRwui+3MKCOvXwEz75ivJn9gpfSegpn +ljgJ9hBOlSJzmY3aFS3nBfwZcyK3jpgAvDw9rKFs+9Z5JUut8Mxk2og+KbgPCdM0 +3TP1YtHhzRnp7hhPTFiu4h7WDFsVWtg6uMQYZB7jM7K1iXdODL/ZlGsTl28So/6Z +qQTMFexgaDbtCHu39b+T7WYxg4zGcTSHThfqr4uRjRxWQa4iN1438h3Z0S0NL2lR +p75mpoo6Kr3HGrHhFPC+Oh25z1uxav60sUYgovseO3Dvk5h9jHOW8sXvhXCtKSb8 +HgQ+HKDYD8tSg2J87otTlZCpV6LqYQXY+U3EJ/pure3511H3a6UCAwEAAaOCASQw +ggEgMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFNOUikxiEyoZLsyvcop9Ntea +HNxnMA4GA1UdDwEB/wQEAwIBBjCB3QYDVR0fBIHVMIHSMIGHoIGEoIGBhn9sZGFw +Oi8vZGlyZWN0b3J5LmQtdHJ1c3QubmV0L0NOPUQtVFJVU1QlMjBSb290JTIwQ2xh +c3MlMjAzJTIwQ0ElMjAyJTIwRVYlMjAyMDA5LE89RC1UcnVzdCUyMEdtYkgsQz1E +RT9jZXJ0aWZpY2F0ZXJldm9jYXRpb25saXN0MEagRKBChkBodHRwOi8vd3d3LmQt +dHJ1c3QubmV0L2NybC9kLXRydXN0X3Jvb3RfY2xhc3NfM19jYV8yX2V2XzIwMDku +Y3JsMA0GCSqGSIb3DQEBCwUAA4IBAQA07XtaPKSUiO8aEXUHL7P+PPoeUSbrh/Yp +3uDx1MYkCenBz1UbtDDZzhr+BlGmFaQt77JLvyAoJUnRpjZ3NOhk31KxEcdzes05 +nsKtjHEh8lprr988TlWvsoRlFIm5d8sqMb7Po23Pb0iUMkZv53GMoKaEGTcH8gNF +CSuGdXzfX2lXANtu2KZyIktQ1HWYVt+3GP9DQ1CuekR78HlR10M9p9OB0/DJT7na +xpeG0ILD5EJt/rDiZE4OJudANCa1CInXCGNjOCd1HjPqbqjdn5lPdE2BiYBL3ZqX +KVwvvoFBuYz/6n1gBp7N1z3TLqMVvKjmJuVvw9y4AyHqnxbxLFS1 +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIF2TCCA8GgAwIBAgIQHp4o6Ejy5e/DfEoeWhhntjANBgkqhkiG9w0BAQsFADBk +MQswCQYDVQQGEwJjaDERMA8GA1UEChMIU3dpc3Njb20xJTAjBgNVBAsTHERpZ2l0 +YWwgQ2VydGlmaWNhdGUgU2VydmljZXMxGzAZBgNVBAMTElN3aXNzY29tIFJvb3Qg +Q0EgMjAeFw0xMTA2MjQwODM4MTRaFw0zMTA2MjUwNzM4MTRaMGQxCzAJBgNVBAYT +AmNoMREwDwYDVQQKEwhTd2lzc2NvbTElMCMGA1UECxMcRGlnaXRhbCBDZXJ0aWZp +Y2F0ZSBTZXJ2aWNlczEbMBkGA1UEAxMSU3dpc3Njb20gUm9vdCBDQSAyMIICIjAN +BgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAlUJOhJ1R5tMJ6HJaI2nbeHCOFvEr +jw0DzpPMLgAIe6szjPTpQOYXTKueuEcUMncy3SgM3hhLX3af+Dk7/E6J2HzFZ++r +0rk0X2s682Q2zsKwzxNoysjL67XiPS4h3+os1OD5cJZM/2pYmLcX5BtS5X4HAB1f +2uY+lQS3aYg5oUFgJWFLlTloYhyxCwWJwDaCFCE/rtuh/bxvHGCGtlOUSbkrRsVP +ACu/obvLP+DHVxxX6NZp+MEkUp2IVd3Chy50I9AU/SpHWrumnf2U5NGKpV+GY3aF +y6//SSj8gO1MedK75MDvAe5QQQg1I3ArqRa0jG6F6bYRzzHdUyYb3y1aSgJA/MTA +tukxGggo5WDDH8SQjhBiYEQN7Aq+VRhxLKX0srwVYv8c474d2h5Xszx+zYIdkeNL +6yxSNLCK/RJOlrDrcH+eOfdmQrGrrFLadkBXeyq96G4DsguAhYidDMfCd7Camlf0 +uPoTXGiTOmekl9AbmbeGMktg2M7v0Ax/lZ9vh0+Hio5fCHyqW/xavqGRn1V9TrAL +acywlKinh/LTSlDcX3KwFnUey7QYYpqwpzmqm59m2I2mbJYV4+by+PGDYmy7Velh +k6M99bFXi08jsJvllGov34zflVEpYKELKeRcVVi3qPyZ7iVNTA6z00yPhOgpD/0Q +VAKFyPnlw4vP5w8CAwEAAaOBhjCBgzAOBgNVHQ8BAf8EBAMCAYYwHQYDVR0hBBYw +FDASBgdghXQBUwIBBgdghXQBUwIBMBIGA1UdEwEB/wQIMAYBAf8CAQcwHQYDVR0O +BBYEFE0mICKJS9PVpAqhb97iEoHF8TwuMB8GA1UdIwQYMBaAFE0mICKJS9PVpAqh +b97iEoHF8TwuMA0GCSqGSIb3DQEBCwUAA4ICAQAyCrKkG8t9voJXiblqf/P0wS4R +fbgZPnm3qKhyN2abGu2sEzsOv2LwnN+ee6FTSA5BesogpxcbtnjsQJHzQq0Qw1zv +/2BZf82Fo4s9SBwlAjxnffUy6S8w5X2lejjQ82YqZh6NM4OKb3xuqFp1mrjX2lhI +REeoTPpMSQpKwhI3qEAMw8jh0FcNlzKVxzqfl9NX+Ave5XLzo9v/tdhZsnPdTSpx +srpJ9csc1fV5yJmz/MFMdOO0vSk3FQQoHt5FRnDsr7p4DooqzgB53MBfGWcsa0vv +aGgLQ+OswWIJ76bdZWGgr4RVSJFSHMYlkSrQwSIjYVmvRRGFHQEkNI/Ps/8XciAT +woCqISxxOQ7Qj1zB09GOInJGTB2Wrk9xseEFKZZZ9LuedT3PDTcNYtsmjGOpI99n +Bjx8Oto0QuFmtEYE3saWmA9LSHokMnWRn6z3aOkquVVlzl1h0ydw2Df+n7mvoC5W +t6NlUe07qxS/TFED6F+KBZvuim6c779o+sjaC+NCydAXFJy3SuCvkychVSa1ZC+N +8f+mQAWFBVzKBxlcCxMoTFh/wqXvRdpg065lYZ1Tg3TCrvJcwhbtkj6EPnNgiLx2 +9CzP0H1907he0ZESEOnN3col49XtmS++dYFLJPlFRpTJKSFTnCZFqhMX5OfNeOI5 +wSsSnqaeG8XmDtkx2Q== +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIEZjCCA06gAwIBAgIQRL4Mi1AAJLQR0zYt4LNfGzANBgkqhkiG9w0BAQUFADCB +lTELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAlVUMRcwFQYDVQQHEw5TYWx0IExha2Ug +Q2l0eTEeMBwGA1UEChMVVGhlIFVTRVJUUlVTVCBOZXR3b3JrMSEwHwYDVQQLExho +dHRwOi8vd3d3LnVzZXJ0cnVzdC5jb20xHTAbBgNVBAMTFFVUTi1VU0VSRmlyc3Qt +T2JqZWN0MB4XDTk5MDcwOTE4MzEyMFoXDTE5MDcwOTE4NDAzNlowgZUxCzAJBgNV +BAYTAlVTMQswCQYDVQQIEwJVVDEXMBUGA1UEBxMOU2FsdCBMYWtlIENpdHkxHjAc +BgNVBAoTFVRoZSBVU0VSVFJVU1QgTmV0d29yazEhMB8GA1UECxMYaHR0cDovL3d3 +dy51c2VydHJ1c3QuY29tMR0wGwYDVQQDExRVVE4tVVNFUkZpcnN0LU9iamVjdDCC +ASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAM6qgT+jo2F4qjEAVZURnicP +HxzfOpuCaDDASmEd8S8O+r5596Uj71VRloTN2+O5bj4x2AogZ8f02b+U60cEPgLO +KqJdhwQJ9jCdGIqXsqoc/EHSoTbL+z2RuufZcDX65OeQw5ujm9M89RKZd7G3CeBo +5hy485RjiGpq/gt2yb70IuRnuasaXnfBhQfdDWy/7gbHd2pBnqcP1/vulBe3/IW+ +pKvEHDHd17bR5PDv3xaPslKT16HUiaEHLr/hARJCHhrh2JU022R5KP+6LhHC5ehb +kkj7RwvCbNqtMoNB86XlQXD9ZZBt+vpRxPm9lisZBCzTbafc8H9vg2XiaquHhnUC +AwEAAaOBrzCBrDALBgNVHQ8EBAMCAcYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4E +FgQU2u1kdBScFDyr3ZmpvVsoTYs8ydgwQgYDVR0fBDswOTA3oDWgM4YxaHR0cDov +L2NybC51c2VydHJ1c3QuY29tL1VUTi1VU0VSRmlyc3QtT2JqZWN0LmNybDApBgNV +HSUEIjAgBggrBgEFBQcDAwYIKwYBBQUHAwgGCisGAQQBgjcKAwQwDQYJKoZIhvcN +AQEFBQADggEBAAgfUrE3RHjb/c652pWWmKpVZIC1WkDdIaXFwfNfLEzIR1pp6ujw +NTX00CXzyKakh0q9G7FzCL3Uw8q2NbtZhncxzaeAFK4T7/yxSPlrJSUtUbYsbUXB +mMiKVl0+7kNOPmsnjtA6S4ULX9Ptaqd1y9Fahy85dRNacrACgZ++8A+EVCBibGnU +4U3GDZlDAQ0Slox4nb9QorFEqmrPF3rPbw/U+CRVX/A0FklmPlBGyWNxODFiuGK5 +81OtbLUrohKqGU8J2l7nk8aOFAj+8DCAGKCGhU3IfdeLA/5u1fedFqySLKAj5ZyR +Uh+U3xeUc8OzwcFxBSAAeL0TUh2oPs0AH8g= +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIDjjCCAnagAwIBAgIIKv++n6Lw6YcwDQYJKoZIhvcNAQEFBQAwKDELMAkGA1UE +BhMCQkUxGTAXBgNVBAMTEEJlbGdpdW0gUm9vdCBDQTIwHhcNMDcxMDA0MTAwMDAw +WhcNMjExMjE1MDgwMDAwWjAoMQswCQYDVQQGEwJCRTEZMBcGA1UEAxMQQmVsZ2l1 +bSBSb290IENBMjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMZzQh6S +/3UPi790hqc/7bIYLS2X+an7mEoj39WN4IzGMhwWLQdC1i22bi+n9fzGhYJdld61 +IgDMqFNAn68KNaJ6x+HK92AQZw6nUHMXU5WfIp8MXW+2QbyM69odRr2nlL/zGsvU ++40OHjPIltfsjFPekx40HopQcSZYtF3CiInaYNKJIT/e1wEYNm7hLHADBGXvmAYr +XR5i3FVr/mZkIV/4L+HXmymvb82fqgxG0YjFnaKVn6w/Fa7yYd/vw2uaItgscf1Y +HewApDgglVrH1Tdjuk+bqv5WRi5j2Qsj1Yr6tSPwiRuhFA0m2kHwOI8w7QUmecFL +TqG4flVSOmlGhHUCAwEAAaOBuzCBuDAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/ +BAUwAwEB/zBCBgNVHSAEOzA5MDcGBWA4CQEBMC4wLAYIKwYBBQUHAgEWIGh0dHA6 +Ly9yZXBvc2l0b3J5LmVpZC5iZWxnaXVtLmJlMB0GA1UdDgQWBBSFiuv0xbu+DlkD +lN7WgAEV4xCcOTARBglghkgBhvhCAQEEBAMCAAcwHwYDVR0jBBgwFoAUhYrr9MW7 +vg5ZA5Te1oABFeMQnDkwDQYJKoZIhvcNAQEFBQADggEBAFHYhd27V2/MoGy1oyCc +UwnzSgEMdL8rs5qauhjyC4isHLMzr87lEwEnkoRYmhC598wUkmt0FoqW6FHvv/pK +JaeJtmMrXZRY0c8RcrYeuTlBFk0pvDVTC9rejg7NqZV3JcqUWumyaa7YwBO+mPyW +nIR/VRPmPIfjvCCkpDZoa01gZhz5v6yAlGYuuUGK02XThIAC71AdXkbc98m6tTR8 +KvPG2F9fVJ3bTc0R5/0UAoNmXsimABKgX77OFP67H6dh96tK8QYUn8pJQsKpvO2F +sauBQeYNxUJpU4c5nUwfAA4+Bw11V0SoU7Q2dmSZ3G7rPUZuFF1eR1ONeE3gJ7uO +hXY= +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIFyjCCA7KgAwIBAgIEAJiWjDANBgkqhkiG9w0BAQsFADBaMQswCQYDVQQGEwJO +TDEeMBwGA1UECgwVU3RhYXQgZGVyIE5lZGVybGFuZGVuMSswKQYDVQQDDCJTdGFh +dCBkZXIgTmVkZXJsYW5kZW4gUm9vdCBDQSAtIEcyMB4XDTA4MDMyNjExMTgxN1oX +DTIwMDMyNTExMDMxMFowWjELMAkGA1UEBhMCTkwxHjAcBgNVBAoMFVN0YWF0IGRl +ciBOZWRlcmxhbmRlbjErMCkGA1UEAwwiU3RhYXQgZGVyIE5lZGVybGFuZGVuIFJv +b3QgQ0EgLSBHMjCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAMVZ5291 +qj5LnLW4rJ4L5PnZyqtdj7U5EILXr1HgO+EASGrP2uEGQxGZqhQlEq0i6ABtQ8Sp +uOUfiUtnvWFI7/3S4GCI5bkYYCjDdyutsDeqN95kWSpGV+RLufg3fNU254DBtvPU +Z5uW6M7XxgpT0GtJlvOjCwV3SPcl5XCsMBQgJeN/dVrlSPhOewMHBPqCYYdu8DvE +pMfQ9XQ+pV0aCPKbJdL2rAQmPlU6Yiile7Iwr/g3wtG61jj99O9JMDeZJiFIhQGp +5Rbn3JBV3w/oOM2ZNyFPXfUib2rFEhZgF1XyZWampzCROME4HYYEhLoaJXhena/M +UGDWE4dS7WMfbWV9whUYdMrhfmQpjHLYFhN9C0lK8SgbIHRrxT3dsKpICT0ugpTN +GmXZK4iambwYfp/ufWZ8Pr2UuIHOzZgweMFvZ9C+X+Bo7d7iscksWXiSqt8rYGPy +5V6548r6f1CGPqI0GAwJaCgRHOThuVw+R7oyPxjMW4T182t0xHJ04eOLoEq9jWYv +6q012iDTiIJh8BIitrzQ1aTsr1SIJSQ8p22xcik/Plemf1WvbibG/ufMQFxRRIEK +eN5KzlW/HdXZt1bv8Hb/C3m1r737qWmRRpdogBQ2HbN/uymYNqUg+oJgYjOk7Na6 +B6duxc8UpufWkjTYgfX8HV2qXB72o007uPc5AgMBAAGjgZcwgZQwDwYDVR0TAQH/ +BAUwAwEB/zBSBgNVHSAESzBJMEcGBFUdIAAwPzA9BggrBgEFBQcCARYxaHR0cDov +L3d3dy5wa2lvdmVyaGVpZC5ubC9wb2xpY2llcy9yb290LXBvbGljeS1HMjAOBgNV +HQ8BAf8EBAMCAQYwHQYDVR0OBBYEFJFoMocVHYnitfGsNig0jQt8YojrMA0GCSqG +SIb3DQEBCwUAA4ICAQCoQUpnKpKBglBu4dfYszk78wIVCVBR7y29JHuIhjv5tLyS +CZa59sCrI2AGeYwRTlHSeYAz+51IvuxBQ4EffkdAHOV6CMqqi3WtFMTC6GY8ggen +5ieCWxjmD27ZUD6KQhgpxrRW/FYQoAUXvQwjf/ST7ZwaUb7dRUG/kSS0H4zpX897 +IZmflZ85OkYcbPnNe5yQzSipx6lVu6xiNGI1E0sUOlWDuYaNkqbG9AclVMwWVxJK +gnjIFNkXgiYtXSAfea7+1HAWFpWD2DU5/1JddRwWxRNVz0fMdWVSSt7wsKfkCpYL ++63C4iWEst3kvX5ZbJvw8NjnyvLplzh+ib7M+zkXYT9y2zqR2GUBGR2tUKRXCnxL +vJxxcypFURmFzI79R6d0lR2o0a9OF7FpJsKqeFdbxU2n5Z4FF5TKsl+gSRiNNOkm +bEgeqmiSBeGCc1qb3AdbCG19ndeNIdn8FCCqwkXfP+cAslHkwvgFuXkajDTznlvk +N1trSt8sV4pAWja63XVECDdCcAz+3F4hoKOKwJCcaNpQ5kUQR3i2TtJlycM33+FC +Y7BXN0Ute4qcvwXqZVUz9zkQxSgqIXobisQk+T8VyJoVIPVVYpbtbZNQvOSqeK3Z +ywplh6ZmwcSBo3c6WB4L7oOLnR7SUqTMHW+wmG2UMbX4cQrcufx9MmDm66+KAQ== +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIICHjCCAaSgAwIBAgIRYFlJ4CYuu1X5CneKcflK2GwwCgYIKoZIzj0EAwMwUDEk +MCIGA1UECxMbR2xvYmFsU2lnbiBFQ0MgUm9vdCBDQSAtIFI1MRMwEQYDVQQKEwpH +bG9iYWxTaWduMRMwEQYDVQQDEwpHbG9iYWxTaWduMB4XDTEyMTExMzAwMDAwMFoX +DTM4MDExOTAzMTQwN1owUDEkMCIGA1UECxMbR2xvYmFsU2lnbiBFQ0MgUm9vdCBD +QSAtIFI1MRMwEQYDVQQKEwpHbG9iYWxTaWduMRMwEQYDVQQDEwpHbG9iYWxTaWdu +MHYwEAYHKoZIzj0CAQYFK4EEACIDYgAER0UOlvt9Xb/pOdEh+J8LttV7HpI6SFkc +8GIxLcB6KP4ap1yztsyX50XUWPrRd21DosCHZTQKH3rd6zwzocWdTaRvQZU4f8ke +hOvRnkmSh5SHDDqFSmafnVmTTZdhBoZKo0IwQDAOBgNVHQ8BAf8EBAMCAQYwDwYD +VR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUPeYpSJvqB8ohREom3m7e0oPQn1kwCgYI +KoZIzj0EAwMDaAAwZQIxAOVpEslu28YxuglB4Zf4+/2a4n0Sye18ZNPLBSWLVtmg +515dTguDnFt2KaAJJiFqYgIwcdK1j1zqO+F4CYWodZI7yFz9SO8NdCKoCOJuxUnO +xwy8p2Fp8fc74SrL+SvzZpA3 +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIHSTCCBTGgAwIBAgIJAMnN0+nVfSPOMA0GCSqGSIb3DQEBBQUAMIGsMQswCQYD +VQQGEwJFVTFDMEEGA1UEBxM6TWFkcmlkIChzZWUgY3VycmVudCBhZGRyZXNzIGF0 +IHd3dy5jYW1lcmZpcm1hLmNvbS9hZGRyZXNzKTESMBAGA1UEBRMJQTgyNzQzMjg3 +MRswGQYDVQQKExJBQyBDYW1lcmZpcm1hIFMuQS4xJzAlBgNVBAMTHkdsb2JhbCBD +aGFtYmVyc2lnbiBSb290IC0gMjAwODAeFw0wODA4MDExMjMxNDBaFw0zODA3MzEx +MjMxNDBaMIGsMQswCQYDVQQGEwJFVTFDMEEGA1UEBxM6TWFkcmlkIChzZWUgY3Vy +cmVudCBhZGRyZXNzIGF0IHd3dy5jYW1lcmZpcm1hLmNvbS9hZGRyZXNzKTESMBAG +A1UEBRMJQTgyNzQzMjg3MRswGQYDVQQKExJBQyBDYW1lcmZpcm1hIFMuQS4xJzAl +BgNVBAMTHkdsb2JhbCBDaGFtYmVyc2lnbiBSb290IC0gMjAwODCCAiIwDQYJKoZI +hvcNAQEBBQADggIPADCCAgoCggIBAMDfVtPkOpt2RbQT2//BthmLN0EYlVJH6xed +KYiONWwGMi5HYvNJBL99RDaxccy9Wglz1dmFRP+RVyXfXjaOcNFccUMd2drvXNL7 +G706tcuto8xEpw2uIRU/uXpbknXYpBI4iRmKt4DS4jJvVpyR1ogQC7N0ZJJ0YPP2 +zxhPYLIj0Mc7zmFLmY/CDNBAspjcDahOo7kKrmCgrUVSY7pmvWjg+b4aqIG7HkF4 +ddPB/gBVsIdU6CeQNR1MM62X/JcumIS/LMmjv9GYERTtY/jKmIhYF5ntRQOXfjyG +HoiMvvKRhI9lNNgATH23MRdaKXoKGCQwoze1eqkBfSbW+Q6OWfH9GzO1KTsXO0G2 +Id3UwD2ln58fQ1DJu7xsepeY7s2MH/ucUa6LcL0nn3HAa6x9kGbo1106DbDVwo3V +yJ2dwW3Q0L9R5OP4wzg2rtandeavhENdk5IMagfeOx2YItaswTXbo6Al/3K1dh3e +beksZixShNBFks4c5eUzHdwHU1SjqoI7mjcv3N2gZOnm3b2u/GSFHTynyQbehP9r +6GsaPMWis0L7iwk+XwhSx2LE1AVxv8Rk5Pihg+g+EpuoHtQ2TS9x9o0o9oOpE9Jh +wZG7SMA0j0GMS0zbaRL/UJScIINZc+18ofLx/d33SdNDWKBWY8o9PeU1VlnpDsog +zCtLkykPAgMBAAGjggFqMIIBZjASBgNVHRMBAf8ECDAGAQH/AgEMMB0GA1UdDgQW +BBS5CcqcHtvTbDprru1U8VuTBjUuXjCB4QYDVR0jBIHZMIHWgBS5CcqcHtvTbDpr +ru1U8VuTBjUuXqGBsqSBrzCBrDELMAkGA1UEBhMCRVUxQzBBBgNVBAcTOk1hZHJp +ZCAoc2VlIGN1cnJlbnQgYWRkcmVzcyBhdCB3d3cuY2FtZXJmaXJtYS5jb20vYWRk +cmVzcykxEjAQBgNVBAUTCUE4Mjc0MzI4NzEbMBkGA1UEChMSQUMgQ2FtZXJmaXJt +YSBTLkEuMScwJQYDVQQDEx5HbG9iYWwgQ2hhbWJlcnNpZ24gUm9vdCAtIDIwMDiC +CQDJzdPp1X0jzjAOBgNVHQ8BAf8EBAMCAQYwPQYDVR0gBDYwNDAyBgRVHSAAMCow +KAYIKwYBBQUHAgEWHGh0dHA6Ly9wb2xpY3kuY2FtZXJmaXJtYS5jb20wDQYJKoZI +hvcNAQEFBQADggIBAICIf3DekijZBZRG/5BXqfEv3xoNa/p8DhxJJHkn2EaqbylZ +UohwEurdPfWbU1Rv4WCiqAm57OtZfMY18dwY6fFn5a+6ReAJ3spED8IXDneRRXoz +X1+WLGiLwUePmJs9wOzL9dWCkoQ10b42OFZyMVtHLaoXpGNR6woBrX/sdZ7LoR/x +fxKxueRkf2fWIyr0uDldmOghp+G9PUIadJpwr2hsUF1Jz//7Dl3mLEfXgTpZALVz +a2Mg9jFFCDkO9HB+QHBaP9BrQql0PSgvAm11cpUJjUhjxsYjV5KTXjXBjfkK9yyd +Yhz2rXzdpjEetrHHfoUm+qRqtdpjMNHvkzeyZi99Bffnt0uYlDXA2TopwZ2yUDMd +SqlapskD7+3056huirRXhOukP9DuqqqHW2Pok+JrqNS4cnhrG+055F3Lm6qH1U9O +AP7Zap88MQ8oAgF9mOinsKJknnn4SPIVqczmyETrP3iZ8ntxPjzxmKfFGBI/5rso +M0LpRQp8bfKGeS/Fghl9CYl8slR2iK7ewfPM4W7bMdaTrpmg7yVqc5iJWzouE4ge +v8CSlDQb4ye3ix5vQv/n6TebUB0tovkC7stYWDpxvGjjqsGvHCgfotwjZT+B6q6Z +09gwzxMNTxXJhLynSC34MCN32EZLeW32jO06f2ARePTpm67VVMB0gNELQp/B +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIF3zCCA8egAwIBAgIOGTMAAQACKBqaBLzyVUUwDQYJKoZIhvcNAQEFBQAwejEL +MAkGA1UEBhMCREUxHDAaBgNVBAoTE1RDIFRydXN0Q2VudGVyIEdtYkgxJDAiBgNV +BAsTG1RDIFRydXN0Q2VudGVyIFVuaXZlcnNhbCBDQTEnMCUGA1UEAxMeVEMgVHJ1 +c3RDZW50ZXIgVW5pdmVyc2FsIENBIElJMB4XDTA2MDMyMjE1NTgzNFoXDTMwMTIz +MTIyNTk1OVowejELMAkGA1UEBhMCREUxHDAaBgNVBAoTE1RDIFRydXN0Q2VudGVy +IEdtYkgxJDAiBgNVBAsTG1RDIFRydXN0Q2VudGVyIFVuaXZlcnNhbCBDQTEnMCUG +A1UEAxMeVEMgVHJ1c3RDZW50ZXIgVW5pdmVyc2FsIENBIElJMIICIjANBgkqhkiG +9w0BAQEFAAOCAg8AMIICCgKCAgEAi9R3azRs5TbYalxeOO781R15Azt7g2JEgk6I +7d6D/+7MUGIFBZWZdpj2ufJf2AaRksL2LWYXH/1TA+iojWOpbuHWG4y8mLOLO9Tk +Lsp9hUkmW3m4GotAnn+7yT9jLM/RWny6KCJBElpN+Rd3/IX9wkngKhh/6aAsnPlE +/AxoOUL1JwW+jhV6YJ3wO8c85j4WvK923mq3ouGrRkXrjGV90ZfzlxElq1nroCLZ +gt2Y7X7i+qBhCkoy3iwX921E6oFHWZdXNwM53V6CItQzuPomCba8OYgvURVOm8M7 +3xOCiN1LNPIz1pDp81PcNXzAw9l8eLPNcD+NauCjgUjkKa1juPD8KGQ7mbN9/pqd +iPaZIgiRRxaJNXhdd6HPv0nh/SSUK2k2e+gc5iqQilvVOzRZQtxtz7sPQRxVzfUN +Wy4WIibvYR6X/OJTyM9bo8ep8boOhhLLE8oVx+zkNo3aXBM9ZdIOXXB03L+PemrB +Lg/Txl4PK1lszGFs/sBhTtnmT0ayWuIZFHCE+CAA7QGnl37DvRJckiMXoKUdRRcV +I5qSCLUiiI3cKyTr4LEXaNOvYb3ZhXj2jbp4yjeNY77nrB/fpUcJucglMVRGURFV +DYlcjdrSGC1z8rjVJ/VIIjfRYvd7Dcg4i6FKsPzQ8eu3hmPn4A5zf/1yUbXpfeJV +BWR4Z38CAwEAAaNjMGEwHwYDVR0jBBgwFoAUzdeQoW6jv9sw1toyJZAM5jkegGUw +DwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAYYwHQYDVR0OBBYEFM3XkKFu +o7/bMNbaMiWQDOY5HoBlMA0GCSqGSIb3DQEBBQUAA4ICAQB+FojoEw42zG4qhQc4 +xlaJeuNHIWZMUAgxWlHQ/KZeFHXeTDvs8e3MfhEHSmHu6rOOOqQzxu2KQmZP8Tx7 +yaUFQZmx7Cxb7tyW0ohTS3g0uW7muw/FeqZ8Dhjfbw90TNGp8aHp2FRkzF6WeKJW +GsFzshXGVwXf2vdIJIqOf2qp+U3pPmrOYCx9LZAI9mOPFdAtnIz/8f38DBZQVhT7 +upeG7rRJA1TuG1l/MDoCgoYhrv7wFfLfToPmmcW6NfcgkIw47XXP4S73BDD7Ua2O +giRAyn0pXdXZ92Vk/KqfdLh9kl3ShCngE+qK99CrxK7vFcXCifJ7tjtJmGHzTnKR +N4xJkunI7Cqg90lufA0kxmts8jgvynAF5X/fxisrgIDV2m/LQLvYG/AkyRDIRAJ+ +LtOYqqIN8SvQ2vqOHP9U6OFKbt2o1ni1N6WsZNUUI8cOpevhCTjXwHxgpV2Yj4wC +1dxWqPNNWKkL1HxkdAEy8t8PSoqpAqKiHYR3wvHMl700GXRd4nQ+dSf3r7/ufA5t +VIimVuImrTESPB5BeW0X6hNeH/Vcn0lZo7Ivo0LD+qh+v6WfSMlgYmIK371F3uNC +tVGW/cT1Gpm4UqJEzS1hjBWPgdVdotSQPYxuQGHDWV3Y2eH2dEcieXR92sqjbzcV +NvAsGnE8EXbfXRo+VGN4a2V+Hw== +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIF2TCCA8GgAwIBAgIQXAuFXAvnWUHfV8w/f52oNjANBgkqhkiG9w0BAQUFADBk +MQswCQYDVQQGEwJjaDERMA8GA1UEChMIU3dpc3Njb20xJTAjBgNVBAsTHERpZ2l0 +YWwgQ2VydGlmaWNhdGUgU2VydmljZXMxGzAZBgNVBAMTElN3aXNzY29tIFJvb3Qg +Q0EgMTAeFw0wNTA4MTgxMjA2MjBaFw0yNTA4MTgyMjA2MjBaMGQxCzAJBgNVBAYT +AmNoMREwDwYDVQQKEwhTd2lzc2NvbTElMCMGA1UECxMcRGlnaXRhbCBDZXJ0aWZp +Y2F0ZSBTZXJ2aWNlczEbMBkGA1UEAxMSU3dpc3Njb20gUm9vdCBDQSAxMIICIjAN +BgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA0LmwqAzZuz8h+BvVM5OAFmUgdbI9 +m2BtRsiMMW8Xw/qabFbtPMWRV8PNq5ZJkCoZSx6jbVfd8StiKHVFXqrWW/oLJdih +FvkcxC7mlSpnzNApbjyFNDhhSbEAn9Y6cV9Nbc5fuankiX9qUvrKm/LcqfmdmUc/ +TilftKaNXXsLmREDA/7n29uj/x2lzZAeAR81sH8A25Bvxn570e56eqeqDFdvpG3F +EzuwpdntMhy0XmeLVNxzh+XTF3xmUHJd1BpYwdnP2IkCb6dJtDZd0KTeByy2dbco +kdaXvij1mB7qWybJvbCXc9qukSbraMH5ORXWZ0sKbU/Lz7DkQnGMU3nn7uHbHaBu +HYwadzVcFh4rUx80i9Fs/PJnB3r1re3WmquhsUvhzDdf/X/NTa64H5xD+SpYVUNF +vJbNcA78yeNmuk6NO4HLFWR7uZToXTNShXEuT46iBhFRyePLoW4xCGQMwtI89Tbo +19AOeCMgkckkKmUpWyL3Ic6DXqTz3kvTaI9GdVyDCW4pa8RwjPWd1yAv/0bSKzjC +L3UcPX7ape8eYIVpQtPM+GP+HkM5haa2Y0EQs3MevNP6yn0WR+Kn1dCjigoIlmJW +bjTb2QK5MHXjBNLnj8KwEUAKrNVxAmKLMb7dxiNYMUJDLXT5xp6mig/p/r+D5kNX +JLrvRjSq1xIBOO0CAwEAAaOBhjCBgzAOBgNVHQ8BAf8EBAMCAYYwHQYDVR0hBBYw +FDASBgdghXQBUwABBgdghXQBUwABMBIGA1UdEwEB/wQIMAYBAf8CAQcwHwYDVR0j +BBgwFoAUAyUv3m+CATpcLNwroWm1Z9SM0/0wHQYDVR0OBBYEFAMlL95vggE6XCzc +K6FptWfUjNP9MA0GCSqGSIb3DQEBBQUAA4ICAQA1EMvspgQNDQ/NwNurqPKIlwzf +ky9NfEBWMXrrpA9gzXrzvsMnjgM+pN0S734edAY8PzHyHHuRMSG08NBsl9Tpl7Ik +Vh5WwzW9iAUPWxAaZOHHgjD5Mq2eUCzneAXQMbFamIp1TpBcahQq4FJHgmDmHtqB +sfsUC1rxn9KVuj7QG9YVHaO+htXbD8BJZLsuUBlL0iT43R4HVtA4oJVwIHaM190e +3p9xxCPvgxNcoyQVTSlAPGrEqdi3pkSlDfTgnXceQHAm/NrZNuR55LU/vJtlvrsR +ls/bxig5OgjOR1tTWsWZ/l2p3e9M1MalrQLmjAcSHm8D0W+go/MpvRLHUKKwf4ip +mXeascClOS5cfGniLLDqN2qk4Vrh9VDlg++luyqI54zb/W1elxmofmZ1a3Hqv7HH +b6D0jqTsNFFbjCYDcKF31QESVwA12yPeDooomf2xEG9L/zgtYE4snOtnta1J7ksf +rK/7DZBaZmBwXarNeNQk7shBoJMBkpxqnvy5JMWzFYJ+vq6VK+uxwNrjAWALXmms +hFZhvnEX/h0TD/7Gh0Xp/jKgGg0TpJRVcaUWi7rKibCyx/yP2FS1k2Kdzs9Z+z0Y +zirLNRWCXf9UIltxUvu3yf5gmwBBZPCqKuy2QkPOiWaByIufOVQDJdMWNY6E0F/6 +MBr1mmz0DlP5OlvRHA== +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIEXjCCA0agAwIBAgIQRL4Mi1AAIbQR0ypoBqmtaTANBgkqhkiG9w0BAQUFADCB +kzELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAlVUMRcwFQYDVQQHEw5TYWx0IExha2Ug +Q2l0eTEeMBwGA1UEChMVVGhlIFVTRVJUUlVTVCBOZXR3b3JrMSEwHwYDVQQLExho +dHRwOi8vd3d3LnVzZXJ0cnVzdC5jb20xGzAZBgNVBAMTElVUTiAtIERBVEFDb3Jw +IFNHQzAeFw05OTA2MjQxODU3MjFaFw0xOTA2MjQxOTA2MzBaMIGTMQswCQYDVQQG +EwJVUzELMAkGA1UECBMCVVQxFzAVBgNVBAcTDlNhbHQgTGFrZSBDaXR5MR4wHAYD +VQQKExVUaGUgVVNFUlRSVVNUIE5ldHdvcmsxITAfBgNVBAsTGGh0dHA6Ly93d3cu +dXNlcnRydXN0LmNvbTEbMBkGA1UEAxMSVVROIC0gREFUQUNvcnAgU0dDMIIBIjAN +BgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA3+5YEKIrblXEjr8uRgnn4AgPLit6 +E5Qbvfa2gI5lBZMAHryv4g+OGQ0SR+ysraP6LnD43m77VkIVni5c7yPeIbkFdicZ +D0/Ww5y0vpQZY/KmEQrrU0icvvIpOxboGqBMpsn0GFlowHDyUwDAXlCCpVZvNvlK +4ESGoE1O1kduSUrLZ9emxAW5jh70/P/N5zbgnAVssjMiFdC04MwXwLLA9P4yPykq +lXvY8qdOD1R8oQ2AswkDwf9c3V6aPryuvEeKaq5xyh+xKrhfQgUL7EYw0XILyulW +bfXv33i+Ybqypa4ETLyorGkVl73v67SMvzX41MPRKA5cOp9wGDMgd8SirwIDAQAB +o4GrMIGoMAsGA1UdDwQEAwIBxjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBRT +MtGzz3/64PGgXYVOktKeRR20TzA9BgNVHR8ENjA0MDKgMKAuhixodHRwOi8vY3Js +LnVzZXJ0cnVzdC5jb20vVVROLURBVEFDb3JwU0dDLmNybDAqBgNVHSUEIzAhBggr +BgEFBQcDAQYKKwYBBAGCNwoDAwYJYIZIAYb4QgQBMA0GCSqGSIb3DQEBBQUAA4IB +AQAnNZcAiosovcYzMB4p/OL31ZjUQLtgyr+rFywJNn9Q+kHcrpY6CiM+iVnJowft +Gzet/Hy+UUla3joKVAgWRcKZsYfNjGjgaQPpxE6YsjuMFrMOoAyYUJuTqXAJyCyj +j98C5OBxOvG0I3KgqgHf35g+FFCgMSa9KOlaMCZ1+XtgHI3zzVAmbQQnmt/VDUVH +KWss5nbZqSl9Mt3JNjy9rjXxEZ4du5A/EkdOjtd+D2JzHVImOBwYSf0wdJrE5SIv +2MCN7ZF6TACPcn9d2t0bi0Vr591pl6jFVkwPDPafepE39peC4N1xaf92P2BNPM/3 +mfnGV/TJVTl4uix5yaaIK/QI +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIEBDCCAuygAwIBAgIIGHqpqMKWIQwwDQYJKoZIhvcNAQELBQAwYjELMAkGA1UE +BhMCVVMxEzARBgNVBAoTCkFwcGxlIEluYy4xJjAkBgNVBAsTHUFwcGxlIENlcnRp +ZmljYXRpb24gQXV0aG9yaXR5MRYwFAYDVQQDEw1BcHBsZSBSb290IENBMB4XDTEy +MDIwMTIyMTIxNVoXDTI3MDIwMTIyMTIxNVoweTEtMCsGA1UEAwwkRGV2ZWxvcGVy +IElEIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MSYwJAYDVQQLDB1BcHBsZSBDZXJ0 +aWZpY2F0aW9uIEF1dGhvcml0eTETMBEGA1UECgwKQXBwbGUgSW5jLjELMAkGA1UE +BhMCVVMwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCJdk8GW5pB7qUj +KwKjX9dzP8A1sIuECj8GJH+nlT/rTw6Tr7QO0Mg+5W0Ysx/oiUe/1wkI5P9WmCkV +55SduTWjCs20wOHiYPTK7Cl4RWlpYGtfipL8niPmOsIiszFPHLrytjRZQu6wqQID +GJEEtrN4LjMfgEUNRW+7Dlpbfzrn2AjXCw4ybfuGNuRsq8QRinCEJqqfRNHxuMZ7 +lBebSPcLWBa6I8WfFTl+yl3DMl8P4FJ/QOq+rAhklVvJGpzlgMofakQcbD7EsCYf +Hex7r16gaj1HqVgSMT8gdihtHRywwk4RaSaLy9bQEYLJTg/xVnTQ2QhLZniiq6yn +4tJMh1nJAgMBAAGjgaYwgaMwHQYDVR0OBBYEFFcX7aLP3HyYoRDg/L6HLSzy4xdU +MA8GA1UdEwEB/wQFMAMBAf8wHwYDVR0jBBgwFoAUK9BpR5R2Cf70a40uQKb3R01/ +CF4wLgYDVR0fBCcwJTAjoCGgH4YdaHR0cDovL2NybC5hcHBsZS5jb20vcm9vdC5j +cmwwDgYDVR0PAQH/BAQDAgGGMBAGCiqGSIb3Y2QGAgYEAgUAMA0GCSqGSIb3DQEB +CwUAA4IBAQBCOXRrodzGpI83KoyzHQpEvJUsf7xZuKxh+weQkjK51L87wVA5akR0 +ouxbH3Dlqt1LbBwjcS1f0cWTvu6binBlgp0W4xoQF4ktqM39DHhYSQwofzPuAHob +tHastrW7T9+oG53IGZdKC1ZnL8I+trPEgzrwd210xC4jUe6apQNvYPSlSKcGwrta +4h8fRkV+5Jf1JxC3ICJyb3LaxlB1xT0lj12jAOmfNoxIOY+zO+qQgC6VmmD0eM70 +DgpTPqL6T9geroSVjTK8Vk2J6XgY4KyaQrp6RhuEoonOFOiI0ViL9q5WxCwFKkWv +C9lLqQIPNKyIx2FViUTJJ3MH7oLlTvVw +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIEvTCCA6WgAwIBAgIBATANBgkqhkiG9w0BAQUFADCBhTELMAkGA1UEBhMCVVMx +IDAeBgNVBAoMF1dlbGxzIEZhcmdvIFdlbGxzU2VjdXJlMRwwGgYDVQQLDBNXZWxs +cyBGYXJnbyBCYW5rIE5BMTYwNAYDVQQDDC1XZWxsc1NlY3VyZSBQdWJsaWMgUm9v +dCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwHhcNMDcxMjEzMTcwNzU0WhcNMjIxMjE0 +MDAwNzU0WjCBhTELMAkGA1UEBhMCVVMxIDAeBgNVBAoMF1dlbGxzIEZhcmdvIFdl +bGxzU2VjdXJlMRwwGgYDVQQLDBNXZWxscyBGYXJnbyBCYW5rIE5BMTYwNAYDVQQD +DC1XZWxsc1NlY3VyZSBQdWJsaWMgUm9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkw +ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDub7S9eeKPCCGeOARBJe+r +WxxTkqxtnt3CxC5FlAM1iGd0V+PfjLindo8796jE2yljDpFoNoqXjopxaAkH5OjU +Dk/41itMpBb570OYj7OeUt9tkTmPOL13i0Nj67eT/DBMHAGTthP796EfvyXhdDcs +HqRePGj4S78NuR4uNuip5Kf4D8uCdXw1LSLWwr8L87T8bJVhHlfXBIEyg1J55oNj +z7fLY4sR4r1e6/aN7ZVyKLSsEmLpSjPmgzKuBXWVvYSV2ypcm44uDLiBK0HmOFaf +SZtsdvqKXfcBeYF8wYNABf5x/Qw/zE5gCQ5lRxAvAcAFP4/4s0HvWkJ+We/Slwxl +AgMBAAGjggE0MIIBMDAPBgNVHRMBAf8EBTADAQH/MDkGA1UdHwQyMDAwLqAsoCqG +KGh0dHA6Ly9jcmwucGtpLndlbGxzZmFyZ28uY29tL3dzcHJjYS5jcmwwDgYDVR0P +AQH/BAQDAgHGMB0GA1UdDgQWBBQmlRkQ2eihl5H/3BnZtQQ+0nMKajCBsgYDVR0j +BIGqMIGngBQmlRkQ2eihl5H/3BnZtQQ+0nMKaqGBi6SBiDCBhTELMAkGA1UEBhMC +VVMxIDAeBgNVBAoMF1dlbGxzIEZhcmdvIFdlbGxzU2VjdXJlMRwwGgYDVQQLDBNX +ZWxscyBGYXJnbyBCYW5rIE5BMTYwNAYDVQQDDC1XZWxsc1NlY3VyZSBQdWJsaWMg +Um9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHmCAQEwDQYJKoZIhvcNAQEFBQADggEB +ALkVsUSRzCPIK0134/iaeycNzXK7mQDKfGYZUMbVmO2rvwNa5U3lHshPcZeG1eMd +/ZDJPHV3V3p9+N701NX3leZ0bh08rnyd2wIDBSxxSyU+B+NemvVmFymIGjifz6pB +A4SXa5M4esowRBskRDPQ5NHcKDj0E0M1NSljqHyita04pO2t/caaH/+Xc/77szWn +k4bGdpEA5qxRFsQnMlzbc9qlk1eOPm01JghZ1edE13YgY+esE2fDbbFwRnzVlhE9 +iW9dqKHrjQrawx0zbKPqZxmamX9LPYNRKh3KL4YMon4QLSvUFpULB6ouFJJJtylv +2G0xffX8oRAHh84vWdw+WNs= +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIICqDCCAi2gAwIBAgIQIW4zpcvTiKRvKQe0JzzE2DAKBggqhkjOPQQDAzCBlDEL +MAkGA1UEBhMCVVMxHTAbBgNVBAoTFFN5bWFudGVjIENvcnBvcmF0aW9uMR8wHQYD +VQQLExZTeW1hbnRlYyBUcnVzdCBOZXR3b3JrMUUwQwYDVQQDEzxTeW1hbnRlYyBD +bGFzcyAxIFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5IC0g +RzQwHhcNMTExMDA1MDAwMDAwWhcNMzgwMTE4MjM1OTU5WjCBlDELMAkGA1UEBhMC +VVMxHTAbBgNVBAoTFFN5bWFudGVjIENvcnBvcmF0aW9uMR8wHQYDVQQLExZTeW1h +bnRlYyBUcnVzdCBOZXR3b3JrMUUwQwYDVQQDEzxTeW1hbnRlYyBDbGFzcyAxIFB1 +YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5IC0gRzQwdjAQBgcq +hkjOPQIBBgUrgQQAIgNiAATXZrUb266zYO5G6ohjdTsqlG3zXxL24w+etgoUU0hS +yNw6s8tIICYSTvqJhNTfkeQpfSgB2dsYQ2mhH7XThhbcx39nI9/fMTGDAzVwsUu3 +yBe7UcvclBfb6gk7dhLeqrWjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8E +BTADAQH/MB0GA1UdDgQWBBRlwI0l9Qy6l3eQP54u4Fr1ztXh5DAKBggqhkjOPQQD +AwNpADBmAjEApa7jRlP4mDbjIvouKEkN7jB+M/PsP3FezFWJeJmssv3cHFwzjim5 +axfIEWi13IMHAjEAnMhE2mnCNsNUGRCFAtqdR+9B52wmnQk9922Q0QVEL7C8g5No +8gxFSTm/mQQc0xCg +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIID3TCCAsWgAwIBAgIOHaIAAQAC7LdggHiNtgYwDQYJKoZIhvcNAQEFBQAweTEL +MAkGA1UEBhMCREUxHDAaBgNVBAoTE1RDIFRydXN0Q2VudGVyIEdtYkgxJDAiBgNV +BAsTG1RDIFRydXN0Q2VudGVyIFVuaXZlcnNhbCBDQTEmMCQGA1UEAxMdVEMgVHJ1 +c3RDZW50ZXIgVW5pdmVyc2FsIENBIEkwHhcNMDYwMzIyMTU1NDI4WhcNMjUxMjMx +MjI1OTU5WjB5MQswCQYDVQQGEwJERTEcMBoGA1UEChMTVEMgVHJ1c3RDZW50ZXIg +R21iSDEkMCIGA1UECxMbVEMgVHJ1c3RDZW50ZXIgVW5pdmVyc2FsIENBMSYwJAYD +VQQDEx1UQyBUcnVzdENlbnRlciBVbml2ZXJzYWwgQ0EgSTCCASIwDQYJKoZIhvcN +AQEBBQADggEPADCCAQoCggEBAKR3I5ZEr5D0MacQ9CaHnPM42Q9e3s9B6DGtxnSR +JJZ4Hgmgm5qVSkr1YnwCqMqs+1oEdjneX/H5s7/zA1hV0qq34wQi0fiU2iIIAI3T +fCZdzHd55yx4Oagmcw6iXSVphU9VDprvxrlE4Vc93x9UIuVvZaozhDrzznq+VZeu +jRIPFDPiUHDDSYcTvFHe15gSWu86gzOSBnWLknwSaHtwag+1m7Z3W0hZneTvWq3z +wZ7U10VOylY0Ibw+F1tvdwxIAUMpsN0/lm7mlaoMwCC2/T42J5zjXM9OgdwZu5GQ +fezmlwQek8wiSdeXhrYTCjxDI3d+8NzmzSQfO4ObNDqDNOMCAwEAAaNjMGEwHwYD +VR0jBBgwFoAUkqR1LKSevoFE63n8isWVpesQdXMwDwYDVR0TAQH/BAUwAwEB/zAO +BgNVHQ8BAf8EBAMCAYYwHQYDVR0OBBYEFJKkdSyknr6BROt5/IrFlaXrEHVzMA0G +CSqGSIb3DQEBBQUAA4IBAQAo0uCG1eb4e/CX3CJrO5UUVg8RMKWaTzqwOuAGy2X1 +7caXJ/4l8lfmXpWMPmRgFVp/Lw0BxbFg/UU1z/CyvwbZ71q+s2IhtNerNXxTPqYn +8aEt2hojnczd7Dwtnic0XQ/CNnm8yUpiLe1r2X1BQ3y2qsrtYbE3ghUJGooWMNjs +ydZHcnhLEEYUjl8Or+zHL6sQ17bxbuyGssLoDZJz3KL0Dzq/YSMQiZxIQG5wALPT +ujdEWBF6AmqI8Dc08BnprNRlc/ZpjGSUOnmFKbAWKwyCPwacx/0QK54PLLae4xW/ +2TYcuiUaUj0a7CIMHOCkoj3w6DnPgcB77V0fb8XQC9eY +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIDtjCCAp6gAwIBAgIOBcAAAQACQdAGCk3OdRAwDQYJKoZIhvcNAQEFBQAwdjEL +MAkGA1UEBhMCREUxHDAaBgNVBAoTE1RDIFRydXN0Q2VudGVyIEdtYkgxIjAgBgNV +BAsTGVRDIFRydXN0Q2VudGVyIENsYXNzIDQgQ0ExJTAjBgNVBAMTHFRDIFRydXN0 +Q2VudGVyIENsYXNzIDQgQ0EgSUkwHhcNMDYwMzIzMTQxMDIzWhcNMjUxMjMxMjI1 +OTU5WjB2MQswCQYDVQQGEwJERTEcMBoGA1UEChMTVEMgVHJ1c3RDZW50ZXIgR21i +SDEiMCAGA1UECxMZVEMgVHJ1c3RDZW50ZXIgQ2xhc3MgNCBDQTElMCMGA1UEAxMc +VEMgVHJ1c3RDZW50ZXIgQ2xhc3MgNCBDQSBJSTCCASIwDQYJKoZIhvcNAQEBBQAD +ggEPADCCAQoCggEBALXNTJytrlG7fEjFDSmGehSt2VA9CXIgDRS2Y8b+WJ7gIV7z +jyIZ3E6RIM1viCmis8GsKnK6i1S4QF/yqvhDhsIwXMynXX/GCEnkDjkvjhjWkd0j +FnmA22xIHbzB3ygQY9GB493fL3l1oht48pQB5hBiecugfQLANIJ7x8CtHUzXapZ2 +W78mhEj9h/aECqqSB5lIPGG8ToVYx5ct/YFKocabEvVCUNFkPologiJw3fX64yhC +L04y87OjNopq1mJcrPoBbbTgci6VaLTxkwzGioLSHVPqfOA/QrcSWrjN2qUGZ8uh +d32llvCSHmcOHUJG5vnt+0dTf1cERh9GX8eu4I8CAwEAAaNCMEAwDwYDVR0TAQH/ +BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAYYwHQYDVR0OBBYEFB/quz4lGwa9pd1iBX7G +TFq/6A9DMA0GCSqGSIb3DQEBBQUAA4IBAQBYpCubTPfkpJKknGWYGWIi/HIy6QRd +xMRwLVpG3kxHiiW5ot3u6hKvSI3vK2fbO8w0mCr3CEf/Iq978fTr4jgCMxh1KBue +dmWsiANy8jhHHYz1nwqIUxAUu4DlDLNdjRfuHhkcho0UZ3iMksseIUn3f9MYv5x5 ++F0IebWqak2SNmy8eesOPXmK2PajVnBd3ttPedJ60pVchidlvqDTB4FAVd0Qy+BL +iILAkH0457+W4Ze6mqtCD9Of2J4VMxHL94J59bXAQVaS4d9VA61Iz9PyLrHHLVZM +ZHQqMc7cdalUR6SnQnIJ5+ECpkeyBM1CE+FhDOB4OiIgohxgQoaH96Xm +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIEGDCCAwCgAwIBAgIBATANBgkqhkiG9w0BAQUFADBlMQswCQYDVQQGEwJTRTEU +MBIGA1UEChMLQWRkVHJ1c3QgQUIxHTAbBgNVBAsTFEFkZFRydXN0IFRUUCBOZXR3 +b3JrMSEwHwYDVQQDExhBZGRUcnVzdCBDbGFzcyAxIENBIFJvb3QwHhcNMDAwNTMw +MTAzODMxWhcNMjAwNTMwMTAzODMxWjBlMQswCQYDVQQGEwJTRTEUMBIGA1UEChML +QWRkVHJ1c3QgQUIxHTAbBgNVBAsTFEFkZFRydXN0IFRUUCBOZXR3b3JrMSEwHwYD +VQQDExhBZGRUcnVzdCBDbGFzcyAxIENBIFJvb3QwggEiMA0GCSqGSIb3DQEBAQUA +A4IBDwAwggEKAoIBAQCWltQhSWDia+hBBwzexODcEyPNwTXH+9ZOEQpnXvUGW2ul +CDtbKRY654eyNAbFvAWlA3yCyykQruGIgb3WntP+LVbBFc7jJp0VLhD7Bo8wBN6n +tGO0/7Gcrjyvd7ZWxbWroulpOj0OM3kyP3CCkplhbY0wCI9xP6ZIVxn4JdxLZlyl +dI+Yrsj5wAYi56xz36Uu+1LcsRVlIPo1Zmne3yzxbrww2ywkEtvrNTVokMsAsJch +PXQhI2U0K7t4WaPW4XY5mqRJjox0r26kmqPZm9I4XJuiGMx1I4S+6+JNM3GOGvDC ++Mcdoq0Dlyz4zyXG9rgkMbFjXZJ/Y/AlyVMuH79NAgMBAAGjgdIwgc8wHQYDVR0O +BBYEFJWxtPCUtr3H2tERCSG+wa9J/RB7MAsGA1UdDwQEAwIBBjAPBgNVHRMBAf8E +BTADAQH/MIGPBgNVHSMEgYcwgYSAFJWxtPCUtr3H2tERCSG+wa9J/RB7oWmkZzBl +MQswCQYDVQQGEwJTRTEUMBIGA1UEChMLQWRkVHJ1c3QgQUIxHTAbBgNVBAsTFEFk +ZFRydXN0IFRUUCBOZXR3b3JrMSEwHwYDVQQDExhBZGRUcnVzdCBDbGFzcyAxIENB +IFJvb3SCAQEwDQYJKoZIhvcNAQEFBQADggEBACxtZBsfzQ3duQH6lmM0MkhHma6X +7f1yFqZzR1r0693p9db7RcwpiURdv0Y5PejuvE1Uhh4dbOMXJ0PhiVYrqW9yTkkz +43J8KiOavD7/KCrto/8cI7pDVwlnTUtiBi34/2ydYB7YHEt9tTEv2dB8Xfjea4MY +eDdXL+gzB2ffHsdrKpV2ro9Xo/D0UrSpUwjP4E/TelOL/bscVjby/rK25Xa71SJl +pz/+0WatC7xrmYbvP33zGDLKe8bjq2RGlfgmadlVg3sslgf/WSxEo8bl6ancoWOA +WiFeIc9TVPC6b4nbqKqVz4vjccweGyBECMB6tkD9xOQ14R0WHNC8K47Wcdk= +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIDpDCCAoygAwIBAgIBATANBgkqhkiG9w0BAQUFADBjMQswCQYDVQQGEwJVUzEc +MBoGA1UEChMTQW1lcmljYSBPbmxpbmUgSW5jLjE2MDQGA1UEAxMtQW1lcmljYSBP +bmxpbmUgUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAxMB4XDTAyMDUyODA2 +MDAwMFoXDTM3MTExOTIwNDMwMFowYzELMAkGA1UEBhMCVVMxHDAaBgNVBAoTE0Ft +ZXJpY2EgT25saW5lIEluYy4xNjA0BgNVBAMTLUFtZXJpY2EgT25saW5lIFJvb3Qg +Q2VydGlmaWNhdGlvbiBBdXRob3JpdHkgMTCCASIwDQYJKoZIhvcNAQEBBQADggEP +ADCCAQoCggEBAKgv6KRpBgNHw+kqmP8ZonCaxlCyfqXfaE0bfA+2l2h9LaaLl+lk +hsmj76CGv2BlnEtUiMJIxUo5vxTjWVXlGbR0yLQFOVwWpeKVBeASrlmLojNoWBym +1BW32J/X3HGrfpq/m44zDyL9Hy7nBzbvYjnF3cu6JRQj3gzGPTzOggjmZj7aUTsW +OqMFf6Dch9Wc/HKpoH145LcxVR5lu9RhsCFg7RAycsWSJR74kEoYeEfffjA3PlAb +2xzTa5qGUwew76wGePiEmf4hjUyAtgyC9mZweRrTT6PP8c9GsEsPPt2IYriMqQko +O3rHl+Ee5fSfwMCuJKDIodkP1nsmgmkyPacCAwEAAaNjMGEwDwYDVR0TAQH/BAUw +AwEB/zAdBgNVHQ4EFgQUAK3Zo/Z59m50qX8zPYEX10zPM94wHwYDVR0jBBgwFoAU +AK3Zo/Z59m50qX8zPYEX10zPM94wDgYDVR0PAQH/BAQDAgGGMA0GCSqGSIb3DQEB +BQUAA4IBAQB8itEfGDeC4Liwo+1WlchiYZwFos3CYiZhzRAW18y0ZTTQEYqtqKkF +Zu90821fnZmv9ov761KyBZiibyrFVL0lvV+uyIbqRizBs73B6UlwGBaXCBOMIOAb +LjpHyx7kADCVW/RFo8AasAFOq73AI25jP4BKxQft3OJvx8Fi8eNy1gTIdGcL+oir +oQHIb/AUr9KZzVGTfu0uOMe9zkZQPXLjeSWdm4grECDdpbgyn43gKd8hdIaC2y+C +MMbHNYaz+ZZfRtsMRf3zUMNvxsNIrUam4SdHCh0Om7bCd39j8uB9Gr784N/Xx6ds +sPmuujz9dLQR6FgNgLzTqIA6me11zEZ7 +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIFkDCCA3igAwIBAgIQBZsbV56OITLiOQe9p3d1XDANBgkqhkiG9w0BAQwFADBi +MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3 +d3cuZGlnaWNlcnQuY29tMSEwHwYDVQQDExhEaWdpQ2VydCBUcnVzdGVkIFJvb3Qg +RzQwHhcNMTMwODAxMTIwMDAwWhcNMzgwMTE1MTIwMDAwWjBiMQswCQYDVQQGEwJV +UzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQu +Y29tMSEwHwYDVQQDExhEaWdpQ2VydCBUcnVzdGVkIFJvb3QgRzQwggIiMA0GCSqG +SIb3DQEBAQUAA4ICDwAwggIKAoICAQC/5pBzaN675F1KPDAiMGkz7MKnJS7JIT3y +ithZwuEppz1Yq3aaza57G4QNxDAf8xukOBbrVsaXbR2rsnnyyhHS5F/WBTxSD1If +xp4VpX6+n6lXFllVcq9ok3DCsrp1mWpzMpTREEQQLt+C8weE5nQ7bXHiLQwb7iDV +ySAdYyktzuxeTsiT+CFhmzTrBcZe7FsavOvJz82sNEBfsXpm7nfISKhmV1efVFiO +DCu3T6cw2Vbuyntd463JT17lNecxy9qTXtyOj4DatpGYQJB5w3jHtrHEtWoYOAMQ +jdjUN6QuBX2I9YI+EJFwq1WCQTLX2wRzKm6RAXwhTNS8rhsDdV14Ztk6MUSaM0C/ +CNdaSaTC5qmgZ92kJ7yhTzm1EVgX9yRcRo9k98FpiHaYdj1ZXUJ2h4mXaXpI8OCi +EhtmmnTK3kse5w5jrubU75KSOp493ADkRSWJtppEGSt+wJS00mFt6zPZxd9LBADM +fRyVw4/3IbKyEbe7f/LVjHAsQWCqsWMYRJUadmJ+9oCw++hkpjPRiQfhvbfmQ6QY +uKZ3AeEPlAwhHbJUKSWJbOUOUlFHdL4mrLZBdd56rF+NP8m800ERElvlEFDrMcXK +chYiCd98THU/Y+whX8QgUWtvsauGi0/C1kVfnSD8oR7FwI+isX4KJpn15GkvmB0t +9dmpsh3lGwIDAQABo0IwQDAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIB +hjAdBgNVHQ4EFgQU7NfjgtJxXWRM3y5nP+e6mK4cD08wDQYJKoZIhvcNAQEMBQAD +ggIBALth2X2pbL4XxJEbw6GiAI3jZGgPVs93rnD5/ZpKmbnJeFwMDF/k5hQpVgs2 +SV1EY+CtnJYYZhsjDT156W1r1lT40jzBQ0CuHVD1UvyQO7uYmWlrx8GnqGikJ9yd ++SeuMIW59mdNOj6PWTkiU0TryF0Dyu1Qen1iIQqAyHNm0aAFYF/opbSnr6j3bTWc +fFqK1qI4mfN4i/RN0iAL3gTujJtHgXINwBQy7zBZLq7gcfJW5GqXb5JQbZaNaHqa +sjYUegbyJLkJEVDXCLG4iXqEI2FCKeWjzaIgQdfRnGTZ6iahixTXTBmyUEFxPT9N +cCOGDErcgdLMMpSEDQgJlxxPwO5rIHQw0uA5NBCFIRUBCOhVMt5xSdkoF1BN5r5N +0XWs0Mr7QbhDparTwwVETyw2m+L64kW4I1NsBm9nVX9GtUw/bihaeSbSpKhil9Ie +4u1Ki7wb/UdKDd9nZn6yW0HQO+T0O/QEY+nvwlQAUaCKKsnOeMzV6ocEGLPOr0mI +r/OSmbaz5mEP0oUA51Aa5BuVnRmhuZyxm7EAHu/QD09CbMkKvO5D+jpxpchNJqU1 +/YldvIViHTLSoCtU7ZpXwdv6EM8Zt4tKG48BtieVU+i2iW1bvGjUI+iLUaJW+fCm +gKDWHrO8Dw9TdSmq6hN35N6MgSGtBxBHEa2HPQfRdbzP82Z+ +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIEuzCCA6OgAwIBAgIBAjANBgkqhkiG9w0BAQUFADBiMQswCQYDVQQGEwJVUzET +MBEGA1UEChMKQXBwbGUgSW5jLjEmMCQGA1UECxMdQXBwbGUgQ2VydGlmaWNhdGlv +biBBdXRob3JpdHkxFjAUBgNVBAMTDUFwcGxlIFJvb3QgQ0EwHhcNMDYwNDI1MjE0 +MDM2WhcNMzUwMjA5MjE0MDM2WjBiMQswCQYDVQQGEwJVUzETMBEGA1UEChMKQXBw +bGUgSW5jLjEmMCQGA1UECxMdQXBwbGUgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkx +FjAUBgNVBAMTDUFwcGxlIFJvb3QgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAw +ggEKAoIBAQDkkakJH5HbHkdQ6wXtXnmELes2oldMVeyLGYne+Uts9QerIjAC6Bg+ ++FAJ039BqJj50cpmnCRrEdCju+QbKsMflZ56DKRHi1vUFjczy8QPTc4UadHJGXL1 +XQ7Vf1+b8iUDulWPTV0N8WQ1IxVLFVkds5T39pyez1C6wVhQZ48ItCD3y6wsIG9w +tj8BMIy3Q88PnT3zK0koGsj+zrW5DtleHNbLPbU6rfQPDgCSC7EhFi501TwN22IW +q6NxkkdTVcGvL0Gz+PvjcM3mo0xFfh9Ma1CWQYnEdGILEINBhzOKgbEwWOxaBDKM +aLOPHd5lc/9nXmW8Sdh2nzMUZaF3lMktAgMBAAGjggF6MIIBdjAOBgNVHQ8BAf8E +BAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUK9BpR5R2Cf70a40uQKb3 +R01/CF4wHwYDVR0jBBgwFoAUK9BpR5R2Cf70a40uQKb3R01/CF4wggERBgNVHSAE +ggEIMIIBBDCCAQAGCSqGSIb3Y2QFATCB8jAqBggrBgEFBQcCARYeaHR0cHM6Ly93 +d3cuYXBwbGUuY29tL2FwcGxlY2EvMIHDBggrBgEFBQcCAjCBthqBs1JlbGlhbmNl +IG9uIHRoaXMgY2VydGlmaWNhdGUgYnkgYW55IHBhcnR5IGFzc3VtZXMgYWNjZXB0 +YW5jZSBvZiB0aGUgdGhlbiBhcHBsaWNhYmxlIHN0YW5kYXJkIHRlcm1zIGFuZCBj +b25kaXRpb25zIG9mIHVzZSwgY2VydGlmaWNhdGUgcG9saWN5IGFuZCBjZXJ0aWZp +Y2F0aW9uIHByYWN0aWNlIHN0YXRlbWVudHMuMA0GCSqGSIb3DQEBBQUAA4IBAQBc +NplMLXi37Yyb3PN3m/J20ncwT8EfhYOFG5k9RzfyqZtAjizUsZAS2L70c5vu0mQP +y3lPNNiiPvl4/2vIB+x9OYOLUyDTOMSxv5pPCmv/K/xZpwUJfBdAVhEedNO3iyM7 +R6PVbyTi69G3cN8PReEnyvFteO3ntRcXqNx+IjXKJdXZD9Zr1KIkIxH3oayPc4Fg +xhtbCS+SsvhESPBgOJ4V9T0mZyCKM2r3DYLP3uujL/lTaltkwGMzd/c6ByxW69oP +IQ7aunMZT7XZNn/Bh1XZp5m5MkL72NVxnn6hUrcbvZNCJBIqxw8dtk2cXmPIS4AX +UKqK1drk/NAJBzewdXUh +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIID9zCCAt+gAwIBAgIESJ8AATANBgkqhkiG9w0BAQUFADCBijELMAkGA1UEBhMC +Q04xMjAwBgNVBAoMKUNoaW5hIEludGVybmV0IE5ldHdvcmsgSW5mb3JtYXRpb24g +Q2VudGVyMUcwRQYDVQQDDD5DaGluYSBJbnRlcm5ldCBOZXR3b3JrIEluZm9ybWF0 +aW9uIENlbnRlciBFViBDZXJ0aWZpY2F0ZXMgUm9vdDAeFw0xMDA4MzEwNzExMjVa +Fw0zMDA4MzEwNzExMjVaMIGKMQswCQYDVQQGEwJDTjEyMDAGA1UECgwpQ2hpbmEg +SW50ZXJuZXQgTmV0d29yayBJbmZvcm1hdGlvbiBDZW50ZXIxRzBFBgNVBAMMPkNo +aW5hIEludGVybmV0IE5ldHdvcmsgSW5mb3JtYXRpb24gQ2VudGVyIEVWIENlcnRp +ZmljYXRlcyBSb290MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAm35z +7r07eKpkQ0H1UN+U8i6yjUqORlTSIRLIOTJCBumD1Z9S7eVnAztUwYyZmczpwA// +DdmEEbK40ctb3B75aDFk4Zv6dOtouSCV98YPjUesWgbdYavi7NifFy2cyjw1l1Vx +zUOFsUcW9SxTgHbP0wBkvUCZ3czY28Sf1hNfQYOL+Q2HklY0bBoQCxfVWhyXWIQ8 +hBouXJE0bhlffxdpxWXvayHG1VA6v2G5BY3vbzQ6sm8UY78WO5upKv23KzhmBsUs +4qpnHkWnjQRmQvaPK++IIGmPMowUc9orhpFjIpryp9vOiYurXccUwVswah+xt54u +gQEC7c+WXmPbqOY4twIDAQABo2MwYTAfBgNVHSMEGDAWgBR8cks5x8DbYqVPm6oY +NJKiyoOCWTAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4E +FgQUfHJLOcfA22KlT5uqGDSSosqDglkwDQYJKoZIhvcNAQEFBQADggEBACrDx0M3 +j92tpLIM7twUbY8opJhJywyA6vPtI2Z1fcXTIWd50XPFtQO3WKwMVC/GVhMPMdoG +52U7HW8228gd+f2ABsqjPWYWqJ1MFn3AlUa1UeTiH9fqBk1jjZaM7+czV0I664zB +echNdn3e9rG3geCg+aF4RhcaVpjwTj2rHO3sOdwHSPdj/gauwqRcalsyiMXHM4Ws +ZkJHwlgkmeHlPuV1LI5D1l08eB6olYIpUNHRFrrvwb562bTYzB5MRuF3sTGrvSrI +zo9uoV1/A3U05K2JRVRevq4opbs/eHnrc7MKDf2+yfdWrPa37S+bISnHOLaVxATy +wy39FCqQmbkHzJ8= +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIFtzCCA5+gAwIBAgICBQkwDQYJKoZIhvcNAQEFBQAwRTELMAkGA1UEBhMCQk0x +GTAXBgNVBAoTEFF1b1ZhZGlzIExpbWl0ZWQxGzAZBgNVBAMTElF1b1ZhZGlzIFJv +b3QgQ0EgMjAeFw0wNjExMjQxODI3MDBaFw0zMTExMjQxODIzMzNaMEUxCzAJBgNV +BAYTAkJNMRkwFwYDVQQKExBRdW9WYWRpcyBMaW1pdGVkMRswGQYDVQQDExJRdW9W +YWRpcyBSb290IENBIDIwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCa +GMpLlA0ALa8DKYrwD4HIrkwZhR0In6spRIXzL4GtMh6QRr+jhiYaHv5+HBg6XJxg +Fyo6dIMzMH1hVBHL7avg5tKifvVrbxi3Cgst/ek+7wrGsxDp3MJGF/hd/aTa/55J +WpzmM+Yklvc/ulsrHHo1wtZn/qtmUIttKGAr79dgw8eTvI02kfN/+NsRE8Scd3bB +rrcCaoF6qUWD4gXmuVbBlDePSHFjIuwXZQeVikvfj8ZaCuWw419eaxGrDPmF60Tp ++ARz8un+XJiM9XOva7R+zdRcAitMOeGylZUtQofX1bOQQ7dsE/He3fbE+Ik/0XX1 +ksOR1YqI0JDs3G3eicJlcZaLDQP9nL9bFqyS2+r+eXyt66/3FsvbzSUr5R/7mp/i +Ucw6UwxI5g69ybR2BlLmEROFcmMDBOAENisgGQLodKcftslWZvB1JdxnwQ5hYIiz +PtGo/KPaHbDRsSNU30R2be1B2MGyIrZTHN81Hdyhdyox5C315eXbyOD/5YDXC2Og +/zOhD7osFRXql7PSorW+8oyWHhqPHWykYTe5hnMz15eWniN9gqRMgeKh0bpnX5UH +oycR7hYQe7xFSkyyBNKr79X9DFHOUGoIMfmR2gyPZFwDwzqLID9ujWc9Otb+fVuI +yV77zGHcizN300QyNQliBJIWENieJ0f7OyHj+OsdWwIDAQABo4GwMIGtMA8GA1Ud +EwEB/wQFMAMBAf8wCwYDVR0PBAQDAgEGMB0GA1UdDgQWBBQahGK8SEwzJQTU7tD2 +A8QZRtGUazBuBgNVHSMEZzBlgBQahGK8SEwzJQTU7tD2A8QZRtGUa6FJpEcwRTEL +MAkGA1UEBhMCQk0xGTAXBgNVBAoTEFF1b1ZhZGlzIExpbWl0ZWQxGzAZBgNVBAMT +ElF1b1ZhZGlzIFJvb3QgQ0EgMoICBQkwDQYJKoZIhvcNAQEFBQADggIBAD4KFk2f +BluornFdLwUvZ+YTRYPENvbzwCYMDbVHZF34tHLJRqUDGCdViXh9duqWNIAXINzn +g/iN/Ae42l9NLmeyhP3ZRPx3UIHmfLTJDQtyU/h2BwdBR5YM++CCJpNVjP4iH2Bl +fF/nJrP3MpCYUNQ3cVX2kiF495V5+vgtJodmVjB3pjd4M1IQWK4/YY7yarHvGH5K +WWPKjaJW1acvvFYfzznB4vsKqBUsfU16Y8Zsl0Q80m/DShcK+JDSV6IZUaUtl0Ha +B0+pUNqQjZRG4T7wlP0QADj1O+hA4bRuVhogzG9Yje0uRY/W6ZM/57Es3zrWIozc +hLsib9D45MY56QSIPMO661V6bYCZJPVsAfv4l7CUW+v90m/xd2gNNWQjrLhVoQPR +TUIZ3Ph1WVaj+ahJefivDrkRoHy3au000LYmYjgahwz46P0u05B/B5EqHdZ+XIWD +mbA4CD/pXvk1B+TJYm5Xf6dQlfe6yJvmjqIBxdZmv3lh8zwc4bmCXF2gw+nYSL0Z +ohEUGW6yhhtoPkg3Goi3XZZenMfvJ2II4pEZXNLxId26F0KCl3GBUzGpn/Z9Yr9y +4aOTHcyKJloJONDO1w2AFrR4pTqHTI2KpdVGl/IsELm8VCLAAVBpQ570su9t+Oza +8eOx79+Rj1QqCyXBJhnEUhAFZdWCEOrCMc0u +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIE5jCCA86gAwIBAgIEO45L/DANBgkqhkiG9w0BAQUFADBdMRgwFgYJKoZIhvcN +AQkBFglwa2lAc2suZWUxCzAJBgNVBAYTAkVFMSIwIAYDVQQKExlBUyBTZXJ0aWZp +dHNlZXJpbWlza2Vza3VzMRAwDgYDVQQDEwdKdXVyLVNLMB4XDTAxMDgzMDE0MjMw +MVoXDTE2MDgyNjE0MjMwMVowXTEYMBYGCSqGSIb3DQEJARYJcGtpQHNrLmVlMQsw +CQYDVQQGEwJFRTEiMCAGA1UEChMZQVMgU2VydGlmaXRzZWVyaW1pc2tlc2t1czEQ +MA4GA1UEAxMHSnV1ci1TSzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB +AIFxNj4zB9bjMI0TfncyRsvPGbJgMUaXhvSYRqTCZUXP00B841oiqBB4M8yIsdOB +SvZiF3tfTQou0M+LI+5PAk676w7KvRhj6IAcjeEcjT3g/1tf6mTll+g/mX8MCgkz +ABpTpyHhOEvWgxutr2TC+Rx6jGZITWYfGAriPrsfB2WThbkasLnE+w0R9vXW+RvH +LCu3GFH+4Hv2qEivbDtPL+/40UceJlfwUR0zlv/vWT3aTdEVNMfqPxZIe5EcgEMP +PbgFPtGzlc3Yyg/CQ2fbt5PgIoIuvvVoKIO5wTtpeyDaTpxt4brNj3pssAki14sL +2xzVWiZbDcDq5WDQn/413z8CAwEAAaOCAawwggGoMA8GA1UdEwEB/wQFMAMBAf8w +ggEWBgNVHSAEggENMIIBCTCCAQUGCisGAQQBzh8BAQEwgfYwgdAGCCsGAQUFBwIC +MIHDHoHAAFMAZQBlACAAcwBlAHIAdABpAGYAaQBrAGEAYQB0ACAAbwBuACAAdgDk +AGwAagBhAHMAdABhAHQAdQBkACAAQQBTAC0AaQBzACAAUwBlAHIAdABpAGYAaQB0 +AHMAZQBlAHIAaQBtAGkAcwBrAGUAcwBrAHUAcwAgAGEAbABhAG0ALQBTAEsAIABz +AGUAcgB0AGkAZgBpAGsAYQBhAHQAaQBkAGUAIABrAGkAbgBuAGkAdABhAG0AaQBz +AGUAawBzMCEGCCsGAQUFBwIBFhVodHRwOi8vd3d3LnNrLmVlL2Nwcy8wKwYDVR0f +BCQwIjAgoB6gHIYaaHR0cDovL3d3dy5zay5lZS9qdXVyL2NybC8wHQYDVR0OBBYE +FASqekej5ImvGs8KQKcYP2/v6X2+MB8GA1UdIwQYMBaAFASqekej5ImvGs8KQKcY +P2/v6X2+MA4GA1UdDwEB/wQEAwIB5jANBgkqhkiG9w0BAQUFAAOCAQEAe8EYlFOi +CfP+JmeaUOTDBS8rNXiRTHyoERF5TElZrMj3hWVcRrs7EKACr81Ptcw2Kuxd/u+g +kcm2k298gFTsxwhwDY77guwqYHhpNjbRxZyLabVAyJRld/JXIWY7zoVAtjNjGr95 +HvxcHdMdkxuLDF2FvZkwMhgJkVLpfKG6/2SSmuz+Ne6ML678IIbsSt4beDI3poHS +na9aEhbKmVv8b20OxaAehsmR0FyYgl9jDIpaq9iVpszLita/ZEuOyoqysOkhMp6q +qIWYNIE5ITuoOlIyPfZrN4YGWhWY3PARZv40ILcD9EEQfTmEeZZyY7aWAuVrua0Z +TbvGRNs2yyqcjg== +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIICQzCCAcmgAwIBAgIILcX8iNLFS5UwCgYIKoZIzj0EAwMwZzEbMBkGA1UEAwwS +QXBwbGUgUm9vdCBDQSAtIEczMSYwJAYDVQQLDB1BcHBsZSBDZXJ0aWZpY2F0aW9u +IEF1dGhvcml0eTETMBEGA1UECgwKQXBwbGUgSW5jLjELMAkGA1UEBhMCVVMwHhcN +MTQwNDMwMTgxOTA2WhcNMzkwNDMwMTgxOTA2WjBnMRswGQYDVQQDDBJBcHBsZSBS +b290IENBIC0gRzMxJjAkBgNVBAsMHUFwcGxlIENlcnRpZmljYXRpb24gQXV0aG9y +aXR5MRMwEQYDVQQKDApBcHBsZSBJbmMuMQswCQYDVQQGEwJVUzB2MBAGByqGSM49 +AgEGBSuBBAAiA2IABJjpLz1AcqTtkyJygRMc3RCV8cWjTnHcFBbZDuWmBSp3ZHtf +TjjTuxxEtX/1H7YyYl3J6YRbTzBPEVoA/VhYDKX1DyxNB0cTddqXl5dvMVztK517 +IDvYuVTZXpmkOlEKMaNCMEAwHQYDVR0OBBYEFLuw3qFYM4iapIqZ3r6966/ayySr +MA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMAoGCCqGSM49BAMDA2gA +MGUCMQCD6cHEFl4aXTQY2e3v9GwOAEZLuN+yRhHFD/3meoyhpmvOwgPUnPWTxnS4 +at+qIxUCMG1mihDK1A3UT82NQz60imOlM27jbdoXt2QfyFMm+YhidDkLF1vLUagM +6BgD56KyKA== +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIExTCCA62gAwIBAgIBADANBgkqhkiG9w0BAQUFADB9MQswCQYDVQQGEwJFVTEn +MCUGA1UEChMeQUMgQ2FtZXJmaXJtYSBTQSBDSUYgQTgyNzQzMjg3MSMwIQYDVQQL +ExpodHRwOi8vd3d3LmNoYW1iZXJzaWduLm9yZzEgMB4GA1UEAxMXR2xvYmFsIENo +YW1iZXJzaWduIFJvb3QwHhcNMDMwOTMwMTYxNDE4WhcNMzcwOTMwMTYxNDE4WjB9 +MQswCQYDVQQGEwJFVTEnMCUGA1UEChMeQUMgQ2FtZXJmaXJtYSBTQSBDSUYgQTgy +NzQzMjg3MSMwIQYDVQQLExpodHRwOi8vd3d3LmNoYW1iZXJzaWduLm9yZzEgMB4G +A1UEAxMXR2xvYmFsIENoYW1iZXJzaWduIFJvb3QwggEgMA0GCSqGSIb3DQEBAQUA +A4IBDQAwggEIAoIBAQCicKLQn0KuWxfH2H3PFIP8T8mhtxOviteePgQKkotgVvq0 +Mi+ITaFgCPS3CU6gSS9J1tPfnZdan5QEcOw/Wdm3zGaLmFIoCQLfxS+EjXqXd7/s +QJ0lcqu1PzKY+7e3/HKE5TWH+VX6ox8Oby4o3Wmg2UIQxvi1RMLQQ3/bvOSiPGpV +eAp3qdjqGTK3L/5cPxvusZjsyq16aUXjlg9V9ubtdepl6DJWk0aJqCWKZQbua795 +B9Dxt6/tLE2Su8CoX6dnfQTyFQhwrJLWfQTSM/tMtgsL+xrJxI0DqX5c8lCrEqWh +z0hQpe/SyBoT+rB/sYIcd2oPX9wLlY/vQ37mRQklAgEDo4IBUDCCAUwwEgYDVR0T +AQH/BAgwBgEB/wIBDDA/BgNVHR8EODA2MDSgMqAwhi5odHRwOi8vY3JsLmNoYW1i +ZXJzaWduLm9yZy9jaGFtYmVyc2lnbnJvb3QuY3JsMB0GA1UdDgQWBBRDnDafsJ4w +TcbOX60Qq+UDpfqpFDAOBgNVHQ8BAf8EBAMCAQYwEQYJYIZIAYb4QgEBBAQDAgAH +MCoGA1UdEQQjMCGBH2NoYW1iZXJzaWducm9vdEBjaGFtYmVyc2lnbi5vcmcwKgYD +VR0SBCMwIYEfY2hhbWJlcnNpZ25yb290QGNoYW1iZXJzaWduLm9yZzBbBgNVHSAE +VDBSMFAGCysGAQQBgYcuCgEBMEEwPwYIKwYBBQUHAgEWM2h0dHA6Ly9jcHMuY2hh +bWJlcnNpZ24ub3JnL2Nwcy9jaGFtYmVyc2lnbnJvb3QuaHRtbDANBgkqhkiG9w0B +AQUFAAOCAQEAPDtwkfkEVCeR4e3t/mh/YV3lQWVPMvEYBZRqHN4fcNs+ezICNLUM +bKGKfKX0j//U2K0X1S0E0T9YgOKBWYi+wONGkyT+kL0mojAt6JcmVzWJdJYY9hXi +ryQZVgICsroPFOrGimbBhkVVi76SvpykBMdJPJ7oKXqJ1/6v/2j1pReQvayZzKWG +VwlnRtvWFsJG8eSpUPWP0ZIV018+xgBJOm5YstHRJw0lyDL4IBHNfTIzSJRUTN3c +ecQwn+uOuFW114hcxWokPbLTBQNRxgfvzBRydD1ucs4YKIxKoHflCStFREest2d/ +AYoFWpO+ocH/+OcOZ6RHSXZddZAa9SaP8A== +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIEMzCCAxugAwIBAgIDCYPzMA0GCSqGSIb3DQEBCwUAME0xCzAJBgNVBAYTAkRF +MRUwEwYDVQQKDAxELVRydXN0IEdtYkgxJzAlBgNVBAMMHkQtVFJVU1QgUm9vdCBD +bGFzcyAzIENBIDIgMjAwOTAeFw0wOTExMDUwODM1NThaFw0yOTExMDUwODM1NTha +ME0xCzAJBgNVBAYTAkRFMRUwEwYDVQQKDAxELVRydXN0IEdtYkgxJzAlBgNVBAMM +HkQtVFJVU1QgUm9vdCBDbGFzcyAzIENBIDIgMjAwOTCCASIwDQYJKoZIhvcNAQEB +BQADggEPADCCAQoCggEBANOySs96R+91myP6Oi/WUEWJNTrGa9v+2wBoqOADER03 +UAifTUpolDWzU9GUY6cgVq/eUXjsKj3zSEhQPgrfRlWLJ23DEE0NkVJD2IfgXU42 +tSHKXzlABF9bfsyjxiupQB7ZNoTWSPOSHjRGICTBpFGOShrvUD9pXRl/RcPHAY9R +ySPocq60vFYJfxLLHLGvKZAKyVXMD9O0Gu1HNVpK7ZxzBCHQqr0ME7UAyiZsxGsM +lFqVlNpQmvH/pStmMaTJOKDfHR+4CS7zp+hnUquVH+BGPtikw8paxTGA6Eian5Rp +/hnd2HN8gcqW3o7tszIFZYQ05ub9VxC1X3a/L7AQDcUCAwEAAaOCARowggEWMA8G +A1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFP3aFMSfMN4hvR5COfyrYyNJ4PGEMA4G +A1UdDwEB/wQEAwIBBjCB0wYDVR0fBIHLMIHIMIGAoH6gfIZ6bGRhcDovL2RpcmVj +dG9yeS5kLXRydXN0Lm5ldC9DTj1ELVRSVVNUJTIwUm9vdCUyMENsYXNzJTIwMyUy +MENBJTIwMiUyMDIwMDksTz1ELVRydXN0JTIwR21iSCxDPURFP2NlcnRpZmljYXRl +cmV2b2NhdGlvbmxpc3QwQ6BBoD+GPWh0dHA6Ly93d3cuZC10cnVzdC5uZXQvY3Js +L2QtdHJ1c3Rfcm9vdF9jbGFzc18zX2NhXzJfMjAwOS5jcmwwDQYJKoZIhvcNAQEL +BQADggEBAH+X2zDI36ScfSF6gHDOFBJpiBSVYEQBrLLpME+bUMJm2H6NMLVwMeni +acfzcNsgFYbQDfC+rAF1hM5+n02/t2A7nPPKHeJeaNijnZflQGDSNiH+0LS4F9p0 +o3/U37CYAqxva2ssJSRyoWXuJVrl5jLn8t+rSfrzkGkj2wTZ51xY/GXUl77M/C4K +zCUqNQT4YJEVdT1B/yMfGchs64JTBKbkTCJNjYy6zltz7GRUUG3RnFX7acM2w4y8 +PIWmawomDeCTmGCufsYkl4phX5GOZpIJhzbNi5stPvZR1FDUWSi9g/LMKHtThm3Y +Johw1+qRzT65ysCQblrGXnRl11z+o+I= +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIDuDCCAqCgAwIBAgIQDPCOXAgWpa1Cf/DrJxhZ0DANBgkqhkiG9w0BAQUFADBI +MQswCQYDVQQGEwJVUzEgMB4GA1UEChMXU2VjdXJlVHJ1c3QgQ29ycG9yYXRpb24x +FzAVBgNVBAMTDlNlY3VyZVRydXN0IENBMB4XDTA2MTEwNzE5MzExOFoXDTI5MTIz +MTE5NDA1NVowSDELMAkGA1UEBhMCVVMxIDAeBgNVBAoTF1NlY3VyZVRydXN0IENv +cnBvcmF0aW9uMRcwFQYDVQQDEw5TZWN1cmVUcnVzdCBDQTCCASIwDQYJKoZIhvcN +AQEBBQADggEPADCCAQoCggEBAKukgeWVzfX2FI7CT8rU4niVWJxB4Q2ZQCQXOZEz +Zum+4YOvYlyJ0fwkW2Gz4BERQRwdbvC4u/jep4G6pkjGnx29vo6pQT64lO0pGtSO +0gMdA+9tDWccV9cGrcrI9f4Or2YlSASWC12juhbDCE/RRvgUXPLIXgGZbf2IzIao +wW8xQmxSPmjL8xk037uHGFaAJsTQ3MBv396gwpEWoGQRS0S8Hvbn+mPeZqx2pHGj +7DaUaHp3pLHnDi+BeuK1cobvomuL8A/b01k/unK8RCSc43Oz969XL0Imnal0ugBS +8kvNU3xHCzaFDmapCJcWNFfBZveA4+1wVMeT4C4oFVmHursCAwEAAaOBnTCBmjAT +BgkrBgEEAYI3FAIEBh4EAEMAQTALBgNVHQ8EBAMCAYYwDwYDVR0TAQH/BAUwAwEB +/zAdBgNVHQ4EFgQUQjK2FvoE/f5dS3rD/fdMQB1aQ68wNAYDVR0fBC0wKzApoCeg +JYYjaHR0cDovL2NybC5zZWN1cmV0cnVzdC5jb20vU1RDQS5jcmwwEAYJKwYBBAGC +NxUBBAMCAQAwDQYJKoZIhvcNAQEFBQADggEBADDtT0rhWDpSclu1pqNlGKa7UTt3 +6Z3q059c4EVlew3KW+JwULKUBRSuSceNQQcSc5R+DCMh/bwQf2AQWnL1mA6s7Ll/ +3XpvXdMc9P+IBWlCqQVxyLesJugutIxq/3HcuLHfmbx8IVQr5Fiiu1cprp6poxkm +D5kuCLDv/WnPmRoJjeOnnyvJNjR7JLN4TJUXpAYmHrZkUjZfYGfZnMUFdAvnZyPS +CPyI6a6Lf+Ew9Dd+/cYy2i2eRDAwbO4H3tI0/NL/QPZL9GZGBlSm8jIKYyYwa5vR +3ItHuuG51WLQoqD0ZwV4KWMabwTW+MZMo5qxN7SN5ShLHZ4swrhovO0C7jE= +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIDczCCAlugAwIBAgIBBDANBgkqhkiG9w0BAQUFADBkMQswCQYDVQQGEwJLUjEN +MAsGA1UECgwES0lTQTEuMCwGA1UECwwlS29yZWEgQ2VydGlmaWNhdGlvbiBBdXRo +b3JpdHkgQ2VudHJhbDEWMBQGA1UEAwwNS0lTQSBSb290Q0EgMTAeFw0wNTA4MjQw +ODA1NDZaFw0yNTA4MjQwODA1NDZaMGQxCzAJBgNVBAYTAktSMQ0wCwYDVQQKDARL +SVNBMS4wLAYDVQQLDCVLb3JlYSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSBDZW50 +cmFsMRYwFAYDVQQDDA1LSVNBIFJvb3RDQSAxMIIBIDANBgkqhkiG9w0BAQEFAAOC +AQ0AMIIBCAKCAQEAvATk+hM58DSWIGtsaLv623f/J/es7C/n/fB/bW+MKs0lCVsk +9KFo/CjsySXirO3eyDOE9bClCTqnsUdIxcxPjHmc+QZXfd3uOPbPFLKc6tPAXXdi +8EcNuRpAU1xkcK8IWsD3z3X5bI1kKB4g/rcbGdNaZoNy4rCbvdMlFQ0yb2Q3lIVG +yHK+d9VuHygvx2nt54OJM1jT3qC/QOhDUO7cTWu8peqmyGGO9cNkrwYV3CmLP3WM +vHFE2/yttRcdbYmDz8Yzvb9Fov4Kn6MRXw+5H5wawkbMnChmn3AmPC7fqoD+jMUE +CSVPzZNHPDfqAmeS/vwiJFys0izgXAEzisEZ2wIBA6MyMDAwHQYDVR0OBBYEFL+2 +J9gDWnZlTGEBQVYx5Yt7OtnMMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEF +BQADggEBABOvUQveimpb5poKyLGQSk6hAp3MiNKrZr097LuxQpVqslxa/6FjZJap +aBV/JV6K+KRzwYCKhQoOUugy50X4TmWAkZl0Q+VFnUkq8JSV3enhMNITbslOsXfl +BM+tWh6UCVrXPAgcrnrpFDLBRa3SJkhyrKhB2vAhhzle3/xk/2F0KpzZm4tfwjeT +2KM3LzuTa7IbB6d/CVDv0zq+IWuKkDsnSlFOa56ch534eJAx7REnxqhZvvwYC/uO +fi5C4e3nCSG9uRPFVmf0JqZCQ5BEVLRxm3bkGhKsGigA35vB1fjbXKP4krG9tNT5 +UNkAAk/bg9ART6RCVmE6fhMy04Qfybo= +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIEMTCCAxmgAwIBAgIBADANBgkqhkiG9w0BAQUFADCBlTELMAkGA1UEBhMCR1Ix +RDBCBgNVBAoTO0hlbGxlbmljIEFjYWRlbWljIGFuZCBSZXNlYXJjaCBJbnN0aXR1 +dGlvbnMgQ2VydC4gQXV0aG9yaXR5MUAwPgYDVQQDEzdIZWxsZW5pYyBBY2FkZW1p +YyBhbmQgUmVzZWFyY2ggSW5zdGl0dXRpb25zIFJvb3RDQSAyMDExMB4XDTExMTIw +NjEzNDk1MloXDTMxMTIwMTEzNDk1MlowgZUxCzAJBgNVBAYTAkdSMUQwQgYDVQQK +EztIZWxsZW5pYyBBY2FkZW1pYyBhbmQgUmVzZWFyY2ggSW5zdGl0dXRpb25zIENl +cnQuIEF1dGhvcml0eTFAMD4GA1UEAxM3SGVsbGVuaWMgQWNhZGVtaWMgYW5kIFJl +c2VhcmNoIEluc3RpdHV0aW9ucyBSb290Q0EgMjAxMTCCASIwDQYJKoZIhvcNAQEB +BQADggEPADCCAQoCggEBAKlTAOMupvaO+mDYLZU++CwqVE7NuYRhlFhPjz2L5EPz +dYmNUeTDN9KKiE15HrcS3UN4SoqS5tdI1Q+kOilENbgH9mgdVc04UfCMJDGFr4PJ +fel3r+0ae50X+bOdOFAPplp5kYCvN66m0zH7tSYJnTxa71HFK9+WXesyHgLacEns +bgzImjeN9/E2YEsmLIKe0HjzDQ9jpFEw4fkrJxIH2Oq9GGKYsFk3fb7u8yBRQlqD +75O6aRXxYp2fmTmCobd0LovUxQt7L/DICto9eQqakxylKHJzkUOap9FNhYS5qXSP +FEDH3N6sQWRstBmbAmNtJGSPRLIl6s5ddAxjMlyNh+UCAwEAAaOBiTCBhjAPBgNV +HRMBAf8EBTADAQH/MAsGA1UdDwQEAwIBBjAdBgNVHQ4EFgQUppFC/RNhSiOeCKQp +5dgTBCPuQSUwRwYDVR0eBEAwPqA8MAWCAy5ncjAFggMuZXUwBoIELmVkdTAGggQu +b3JnMAWBAy5ncjAFgQMuZXUwBoEELmVkdTAGgQQub3JnMA0GCSqGSIb3DQEBBQUA +A4IBAQAf73lB4XtuP7KMhjdCSk4cNx6NZrokgclPEg8hwAOXhiVtXdMiKahsog2p +6z0GW5k6x8zDmjR/qw7IThzh+uTczQ2+vyT+bOdrwg3IBp5OjWEopmr95fZi6hg8 +TqBTnbI6nOulnJEWtk2C4AwFSKls9cz4y51JtPACpf1wA+2KIaWuE4ZJwzNzvoc7 +dIsXRSZMFpGD/md9zU1jZ/rzAxKWeAaNsWftjj++n08C9bMJL/NMh98qy5V8Acys +Nnq/onN694/BtZqhFLKPM58N7yLcZnuEvUUXBj08yrl3NI/K6s8/MT7jiOOASSXI +l7WdmplNsDz4SgCbZN2fOUvRJ9e4 +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIEFTCCAv2gAwIBAgIGSUEs5AAQMA0GCSqGSIb3DQEBCwUAMIGnMQswCQYDVQQG +EwJIVTERMA8GA1UEBwwIQnVkYXBlc3QxFTATBgNVBAoMDE5ldExvY2sgS2Z0LjE3 +MDUGA1UECwwuVGFuw7pzw610dsOhbnlraWFkw7NrIChDZXJ0aWZpY2F0aW9uIFNl +cnZpY2VzKTE1MDMGA1UEAwwsTmV0TG9jayBBcmFueSAoQ2xhc3MgR29sZCkgRsWR +dGFuw7pzw610dsOhbnkwHhcNMDgxMjExMTUwODIxWhcNMjgxMjA2MTUwODIxWjCB +pzELMAkGA1UEBhMCSFUxETAPBgNVBAcMCEJ1ZGFwZXN0MRUwEwYDVQQKDAxOZXRM +b2NrIEtmdC4xNzA1BgNVBAsMLlRhbsO6c8OtdHbDoW55a2lhZMOzayAoQ2VydGlm +aWNhdGlvbiBTZXJ2aWNlcykxNTAzBgNVBAMMLE5ldExvY2sgQXJhbnkgKENsYXNz +IEdvbGQpIEbFkXRhbsO6c8OtdHbDoW55MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A +MIIBCgKCAQEAxCRec75LbRTDofTjl5Bu0jBFHjzuZ9lk4BqKf8owyoPjIMHj9DrT +lF8afFttvzBPhCf2nx9JvMaZCpDyD/V/Q4Q3Y1GLeqVw/HpYzY6b7cNGbIRwXdrz +AZAj/E4wqX7hJ2Pn7WQ8oLjJM2P+FpD/sLj916jAwJRDC7bVWaaeVtAkH3B5r9s5 +VA1lddkVQZQBr17s9o3x/61k/iCa11zr/qYfCGSji3ZVrR47KGAuhyXoqq8fxmRG +ILdwfzzeSNuWU7c5d+Qa4scWhHaXWy+7GRWF+GmF9ZmnqfI0p6m2pgP8b4Y9VHx2 +BJtr+UBdADTHLpl1neWIA6pN+APSQnbAGwIDAKiLo0UwQzASBgNVHRMBAf8ECDAG +AQH/AgEEMA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQUzPpnk/C2uNClwB7zU/2M +U9+D15YwDQYJKoZIhvcNAQELBQADggEBAKt/7hwWqZw8UQCgwBEIBaeZ5m8BiFRh +bvG5GK1Krf6BQCOUL/t1fC8oS2IkgYIL9WHxHG64YTjrgfpioTtaYtOUZcTh5m2C ++C8lcLIhJsFyUR+MLMOEkMNaj7rP9KdlpeuY0fsFskZ1FSNqb4VjMIDw1Z4fKRzC +bLBQWV2QWzuoDTDPv31/zvGdg73JRm4gpvlhUbohL3u+pRVjodSVh/GeufOJ8z2F +uLjbvrW5KfnaNwUASZQDhETnv0Mxz3WLJdH0pmT1kvarBes96aULNmLazAZfNou2 +XjG4Kvte9nHfRCaexOYNkbQudZWAUWpLMKawYqGT8ZvYzsRjdT9ZR7E= +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIEPzCCAyegAwIBAgIBATANBgkqhkiG9w0BAQUFADB+MQswCQYDVQQGEwJHQjEb +MBkGA1UECAwSR3JlYXRlciBNYW5jaGVzdGVyMRAwDgYDVQQHDAdTYWxmb3JkMRow +GAYDVQQKDBFDb21vZG8gQ0EgTGltaXRlZDEkMCIGA1UEAwwbU2VjdXJlIENlcnRp +ZmljYXRlIFNlcnZpY2VzMB4XDTA0MDEwMTAwMDAwMFoXDTI4MTIzMTIzNTk1OVow +fjELMAkGA1UEBhMCR0IxGzAZBgNVBAgMEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4G +A1UEBwwHU2FsZm9yZDEaMBgGA1UECgwRQ29tb2RvIENBIExpbWl0ZWQxJDAiBgNV +BAMMG1NlY3VyZSBDZXJ0aWZpY2F0ZSBTZXJ2aWNlczCCASIwDQYJKoZIhvcNAQEB +BQADggEPADCCAQoCggEBAMBxM4KK0HDrc4eCQNUd5MvJDkKQ+d40uaG6EfQlhfPM +cm3ye5drswfxdySRXyWP9nQ95IDC+DwN879A6vfIUtFyb+/Iq0G4bi4XKpVpDM3S +HpR7LZQdqnXXs5jLrLxkU0C8j6ysNstcrbvd4JQX7NFc0L/vpZXJkMWwrPsbQ996 +CF23uPJAGysnnlDOXmWCiIxe004MeuoIkbY2qitC++rCoznl2yY4rYsK7hljxxwk +3wN42ubqwUcaCwtGCd0C/N7Lh1/XMGNooa7cMqG6vv5Eq2i2pRcV/b3Vp6ea5EQz +6YiO/O1R65NxTq0B50SOqy3LqP4BSUjwwN3HaNiS/j0CAwEAAaOBxzCBxDAdBgNV +HQ4EFgQUPNiTiMLAggnMAZkGkyDpnnAJY08wDgYDVR0PAQH/BAQDAgEGMA8GA1Ud +EwEB/wQFMAMBAf8wgYEGA1UdHwR6MHgwO6A5oDeGNWh0dHA6Ly9jcmwuY29tb2Rv +Y2EuY29tL1NlY3VyZUNlcnRpZmljYXRlU2VydmljZXMuY3JsMDmgN6A1hjNodHRw +Oi8vY3JsLmNvbW9kby5uZXQvU2VjdXJlQ2VydGlmaWNhdGVTZXJ2aWNlcy5jcmww +DQYJKoZIhvcNAQEFBQADggEBAIcBbSMdflsXfcFhMs+P5/OKlFlm4J4oqF7Tt/Q0 +5qo5spcWxYJvMqTpjOev/e/C6LlLqqP05tqNZSH7uoDrJiiFGv45jN5bBAS0VPmj +Z55B+glSzAVIqMk/IQQezkhr/IXownuvf7fM+F86/TXGDe+X3EyrEeFryzHRbPtI +gKvcnDe4IRRLDXE97IMzbtFuMhbsmMcWi1mmNKsFVy2T96oTy9IT4rcuO81rUBcJ +aD61JlfutuC23bkpgHl9j6PwpCikFcSF9CfUa7/lXORlAnZUtOM3ZiTTGWHIUhDl +izeauan5Hb/qmZJhlv8BzaFfDbxxvA6sCx1HRR3B7Hzs/Sk= +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIF0zCCA7ugAwIBAgIVALhZFHE/V9+PMcAzPdLWGXojF7TrMA0GCSqGSIb3DQEB +DQUAMIGAMQswCQYDVQQGEwJQTDEiMCAGA1UEChMZVW5pemV0byBUZWNobm9sb2dp +ZXMgUy5BLjEnMCUGA1UECxMeQ2VydHVtIENlcnRpZmljYXRpb24gQXV0aG9yaXR5 +MSQwIgYDVQQDExtDZXJ0dW0gVHJ1c3RlZCBOZXR3b3JrIENBIDIwHhcNMTExMDA2 +MDgzOTU2WhcNNDYxMDA2MDgzOTU2WjCBgDELMAkGA1UEBhMCUEwxIjAgBgNVBAoT +GVVuaXpldG8gVGVjaG5vbG9naWVzIFMuQS4xJzAlBgNVBAsTHkNlcnR1bSBDZXJ0 +aWZpY2F0aW9uIEF1dGhvcml0eTEkMCIGA1UEAxMbQ2VydHVtIFRydXN0ZWQgTmV0 +d29yayBDQSAyMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAvfl4+ObV +gAxknYYblmRnPyI6HnUBfe/7XGeMycxca6mR5rlC5SBLm9qbe7mZXdmbgEvXhEAr +J9PoujC7Pgkap0mV7ytAJMKXx6fumyXvqAoAl4Vaqp3cKcniNQfrcE1K1sGzVrih +QTib0fsxf4/gX+GxPw+OFklg1waNGPmqJhCrKtPQ0WeNG0a+RzDVLnLRxWPa52N5 +RH5LYySJhi40PylMUosqp8DikSiJucBb+R3Z5yet/5oCl8HGUJKbAiy9qbk0WQq/ +hEr/3/6zn+vZnuCYI+yma3cWKtvMrTscpIfcRnNeGWJoRVfkkIJCu0LW8GHgwaM9 +ZqNd9BjuiMmNF0UpmTJ1AjHuKSbIawLmtWJFfzcVWiNoidQ+3k4nsPBADLxNF8tN +orMe0AZa3faTz1d1mfX6hhpneLO/lv403L3nUlbls+V1e9dBkQXcXWnjlQ1DufyD +ljmVe2yAWk8TcsbXfSl6RLpSpCrVQUYJIP4ioLZbMI28iQzV13D4h1L92u+sUS4H +s07+0AnacO+Y+lbmbdu1V0vc5SwlFcieLnhO+NqcnoYsylfzGuXIkosagpZ6w7xQ +EmnYDlpGizrrJvojybawgb5CAKT41v4wLsfSRvbljnX98sy50IdbzAYQYLuDNbde +Z95H7JlI8aShFf6tjGKOOVVPORa5sWOd/7cCAwEAAaNCMEAwDwYDVR0TAQH/BAUw +AwEB/zAdBgNVHQ4EFgQUtqFUOQLDoD+Oirz61PgcptE6Dv0wDgYDVR0PAQH/BAQD +AgEGMA0GCSqGSIb3DQEBDQUAA4ICAQCdU8KBJdw1LK4K3VqbRjBWu9S0bEuG5gql +0pKKmo3cj7TudvQDy+ubAXirKmu1uiNOMXy1LN0taWczbmNdORgS+KAoU0SHq2rE +kpYfKqIcup3dJ/tSTbCPWujtjcNo45KgJgyHkLAD6mplKAjERnjgW7oO8DPcJ7Z+ +iD29kqSWfkGogAh71jYSvBAVmyS8q619EYkvMe340s9Tjuu0U6fnBMovpiLEEdzr +mMkiXUFq3ApSBFu8LqB9x7aSuySg8zfRK0OozPFoeBp+b2OQe590yGvZC1X2eQM9 +g8dBQJL7dgs3JRc8rz76PFwbhvlKDD+KxF4OmPGt7s/g/SE1xzNhzKI3GEN8M+mu +doKCB0VIO8lnbq2jheiWVs+8u/qry7dXJ40aL5nzIzM0jspTY9NXNFBPz0nBBbrF +qId744aP+0OiEumsUewEdkzw+o+5MRPpCLckCfmgtwc2WFfPxLt+SWaVNQS2dzW4 +qVMpX5KF+FLEWk79BmE5+33QdkeSzOwrvYRu5ptFwX1isVMtnnWg58koUNflvKiq +B3hquXS0YPOEjQPcrpHadEQNe0Kpd9YrfKHGbBNTIqkSmqX5TyhFNbCXT0ZlhcX0 +/WKiomr8NDAGft8M4HOBlslEKt4fguxscletKWSk8cYpjjVgU85r2QK+OTB14Pdc +Y2rwQMEsjQ== +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIDQzCCAiugAwIBAgIQX/h7KCtU3I1CoxW1aMmt/zANBgkqhkiG9w0BAQUFADA1 +MRYwFAYDVQQKEw1DaXNjbyBTeXN0ZW1zMRswGQYDVQQDExJDaXNjbyBSb290IENB +IDIwNDgwHhcNMDQwNTE0MjAxNzEyWhcNMjkwNTE0MjAyNTQyWjA1MRYwFAYDVQQK +Ew1DaXNjbyBTeXN0ZW1zMRswGQYDVQQDExJDaXNjbyBSb290IENBIDIwNDgwggEg +MA0GCSqGSIb3DQEBAQUAA4IBDQAwggEIAoIBAQCwmrmrp68Kd6ficba0ZmKUeIhH +xmJVhEAyv8CrLqUccda8bnuoqrpu0hWISEWdovyD0My5jOAmaHBKeN8hF570YQXJ +FcjPFto1YYmUQ6iEqDGYeJu5Tm8sUxJszR2tKyS7McQr/4NEb7Y9JHcJ6r8qqB9q +VvYgDxFUl4F1pyXOWWqCZe+36ufijXWLbvLdT6ZeYpzPEApk0E5tzivMW/VgpSdH +jWn0f84bcN5wGyDWbs2mAag8EtKpP6BrXruOIIt6keO1aO6g58QBdKhTCytKmg9l +Eg6CTY5j/e/rmxrbU6YTYK/CfdfHbBcl1HP7R2RQgYCUTOG/rksc35LtLgXfAgED +o1EwTzALBgNVHQ8EBAMCAYYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUJ/PI +FR5umgIJFq0roIlgX9p7L6owEAYJKwYBBAGCNxUBBAMCAQAwDQYJKoZIhvcNAQEF +BQADggEBAJ2dhISjQal8dwy3U8pORFBi71R803UXHOjgxkhLtv5MOhmBVrBW7hmW +Yqpao2TB9k5UM8Z3/sUcuuVdJcr18JOagxEu5sv4dEX+5wW4q+ffy0vhN4TauYuX +cB7w4ovXsNgOnbFp1iqRe6lJT37mjpXYgyc81WhJDtSd9i7rp77rMKSsH0T8lasz +Bvt9YAretIpjsJyp8qS5UwGH0GikJ3+r/+n6yUA4iGe0OcaEb1fJU9u6ju7AQ7L4 +CYNu/2bPPu8Xs1gYJQk0XuPL1hS27PKSb3TkL4Eq1ZKR4OCXPDJoBYVL0fdX4lId +kxpUnwVwwEpxYB5DC2Ae/qPOgRnhCzU= +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIID3TCCAsWgAwIBAgIBADANBgkqhkiG9w0BAQsFADCBjzELMAkGA1UEBhMCVVMx +EDAOBgNVBAgTB0FyaXpvbmExEzARBgNVBAcTClNjb3R0c2RhbGUxJTAjBgNVBAoT +HFN0YXJmaWVsZCBUZWNobm9sb2dpZXMsIEluYy4xMjAwBgNVBAMTKVN0YXJmaWVs +ZCBSb290IENlcnRpZmljYXRlIEF1dGhvcml0eSAtIEcyMB4XDTA5MDkwMTAwMDAw +MFoXDTM3MTIzMTIzNTk1OVowgY8xCzAJBgNVBAYTAlVTMRAwDgYDVQQIEwdBcml6 +b25hMRMwEQYDVQQHEwpTY290dHNkYWxlMSUwIwYDVQQKExxTdGFyZmllbGQgVGVj +aG5vbG9naWVzLCBJbmMuMTIwMAYDVQQDEylTdGFyZmllbGQgUm9vdCBDZXJ0aWZp +Y2F0ZSBBdXRob3JpdHkgLSBHMjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC +ggEBAL3twQP89o/8ArFvW59I2Z154qK3A2FWGMNHttfKPTUuiUP3oWmb3ooa/RMg +nLRJdzIpVv257IzdIvpy3Cdhl+72WoTsbhm5iSzchFvVdPtrX8WJpRBSiUZV9Lh1 +HOZ/5FSuS/hVclcCGfgXcVnrHigHdMWdSL5stPSksPNkN3mSwOxGXn/hbVNMYq/N +Hwtjuzqd+/x5AJhhdM8mgkBj87JyahkNmcrUDnXMN/uLicFZ8WJ/X7NfZTD4p7dN +dloedl40wOiWVpmKs/B/pM293DIxfJHP4F8R+GuqSVzRmZTRouNjWwl2tVZi4Ut0 +HZbUJtQIBFnQmA4O5t78w+wfkPECAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAO +BgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFHwMMh+n2TB/xH1oo2Kooc6rB1snMA0G +CSqGSIb3DQEBCwUAA4IBAQARWfolTwNvlJk7mh+ChTnUdgWUXuEok21iXQnCoKjU +sHU48TRqneSfioYmUeYs0cYtbpUgSpIB7LiKZ3sx4mcujJUDJi5DnUox9g61DLu3 +4jd/IroAow57UvtruzvE03lRTs2Q9GcHGcg8RnoNAX3FWOdt5oUwF5okxBDgBPfg +8n/Uqgr/Qh037ZTlZFkSIHc40zI+OIF1lnP6aI+xy84fxez6nH7PfrHxBy22/L/K +pL/QlwVKvOoYKAKQvVR4CSFx09F9HdkWsKlhPdAKACL8x3vLCWRFCztAgfd9fDL1 +mMpYjn0q7pBZc2T5NnReJaH1ZgUufzkVqSr7UIuOhWn0 +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIDzzCCAregAwIBAgIDAWweMA0GCSqGSIb3DQEBBQUAMIGNMQswCQYDVQQGEwJB +VDFIMEYGA1UECgw/QS1UcnVzdCBHZXMuIGYuIFNpY2hlcmhlaXRzc3lzdGVtZSBp +bSBlbGVrdHIuIERhdGVudmVya2VociBHbWJIMRkwFwYDVQQLDBBBLVRydXN0LW5R +dWFsLTAzMRkwFwYDVQQDDBBBLVRydXN0LW5RdWFsLTAzMB4XDTA1MDgxNzIyMDAw +MFoXDTE1MDgxNzIyMDAwMFowgY0xCzAJBgNVBAYTAkFUMUgwRgYDVQQKDD9BLVRy +dXN0IEdlcy4gZi4gU2ljaGVyaGVpdHNzeXN0ZW1lIGltIGVsZWt0ci4gRGF0ZW52 +ZXJrZWhyIEdtYkgxGTAXBgNVBAsMEEEtVHJ1c3QtblF1YWwtMDMxGTAXBgNVBAMM +EEEtVHJ1c3QtblF1YWwtMDMwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB +AQCtPWFuA/OQO8BBC4SAzewqo51ru27CQoT3URThoKgtUaNR8t4j8DRE/5TrzAUj +lUC5B3ilJfYKvUWG6Nm9wASOhURh73+nyfrBJcyFLGM/BWBzSQXgYHiVEEvc+RFZ +znF/QJuKqiTfC0Li21a8StKlDJu3Qz7dg9MmEALP6iPESU7l0+m0iKsMrmKS1GWH +2WrX9IWf5DMiJaXlyDO6w8dB3F/GaswADm0yqLaHNgBid5seHzTLkDx4iHQF63n1 +k3Flyp3HaxgtPVxO59X4PzF9j4fsCiIvI+n+u33J4PTs63zEsMMtYrWacdaxaujs +2e3Vcuy+VwHOBVWf3tFgiBCzAgMBAAGjNjA0MA8GA1UdEwEB/wQFMAMBAf8wEQYD +VR0OBAoECERqlWdVeRFPMA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQUFAAOC +AQEAVdRU0VlIXLOThaq/Yy/kgM40ozRiPvbY7meIMQQDbwvUB/tOdQ/TLtPAF8fG +KOwGDREkDg6lXb+MshOWcdzUzg4NCmgybLlBMRmrsQd7TZjTXLDR8KdCoLXEjq/+ +8T/0709GAHbrAvv5ndJAlseIOrifEXnzgGWovR/TeIGgUUw3tKZdJXDRZslo+S4R +FGjxVJgIrCaSD96JntT6s3kr0qN51OyLrIdTaEJMUVF0HhsnLuP1Hyl0Te2v9+GS +mYHovjrHF1D2t8b8m7CKa9aIA5GPBnc6hQLdmNVDeD/GMBWsm2vLV7eJUYs66MmE +DNuxUCAKGkq6ahq97BvIxYSazQ== +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIEKjCCAxKgAwIBAgIQYAGXt0an6rS0mtZLL/eQ+zANBgkqhkiG9w0BAQsFADCB +rjELMAkGA1UEBhMCVVMxFTATBgNVBAoTDHRoYXd0ZSwgSW5jLjEoMCYGA1UECxMf +Q2VydGlmaWNhdGlvbiBTZXJ2aWNlcyBEaXZpc2lvbjE4MDYGA1UECxMvKGMpIDIw +MDggdGhhd3RlLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxJDAiBgNV +BAMTG3RoYXd0ZSBQcmltYXJ5IFJvb3QgQ0EgLSBHMzAeFw0wODA0MDIwMDAwMDBa +Fw0zNzEyMDEyMzU5NTlaMIGuMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMdGhhd3Rl +LCBJbmMuMSgwJgYDVQQLEx9DZXJ0aWZpY2F0aW9uIFNlcnZpY2VzIERpdmlzaW9u +MTgwNgYDVQQLEy8oYykgMjAwOCB0aGF3dGUsIEluYy4gLSBGb3IgYXV0aG9yaXpl +ZCB1c2Ugb25seTEkMCIGA1UEAxMbdGhhd3RlIFByaW1hcnkgUm9vdCBDQSAtIEcz +MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsr8nLPvb2FvdeHsbnndm +gcs+vHyu86YnmjSjaDFxODNi5PNxZnmxqWWjpYvVj2AtP0LMqmsywCPLLEHd5N/8 +YZzic7IilRFDGF/Eth9XbAoFWCLINkw6fKXRz4aviKdEAhN0cXMKQlkC+BsUa0Lf +b1+6a4KinVvnSr0eAXLbS3ToO39/fR8EtCab4LRarEc9VbjXsCZSKAExQGbY2SS9 +9irY7CFJXJv2eul/VTV+lmuNk5Mny5K76qxAwJ/C+IDPXfRa3M50hqY+bAtTyr2S +zhkGcuYMXDhpxwTWvGzOW/b3aJzcJRVIiKHpqfiYnODz1TEoYRFsZ5aNOZnLwkUk +OQIDAQABo0IwQDAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNV +HQ4EFgQUrWyqlGCc7eT/+j4KdCtjA/e2Wb8wDQYJKoZIhvcNAQELBQADggEBABpA +2JVlrAmSicY59BDlqQ5mU1143vokkbvnRFHfxhY0Cu9qRFHqKweKA3rD6z8KLFIW +oCtDuSWQP3CpMyVtRRooOyfPqsMpQhvfO0zAMzRbQYi/aytlryjvsvXDqmbOe1bu +t8jLZ8HJnBoYuMTDSQPxYA5QzUbF83d597YV4Djbxy8ooAw/dyZ02SUS2jHaGh7c +KUGRIjxpp7sC8rZcJwOJ9Abqm+RyguOhCcHpABnTPtRwa7pxpqpYrvS76Wy274fM +m7v/OeZWYdMKp8RcTGB7BXcmer/YB1IsYvdwY9k5vG8cwnncdimvzsUsZAReiDZu +MdRAGmI0Nj81Aa6sY6A= +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIFHjCCBAagAwIBAgIEAKA3oDANBgkqhkiG9w0BAQsFADCBtzELMAkGA1UEBhMC +Q1oxOjA4BgNVBAMMMUkuQ0EgLSBRdWFsaWZpZWQgQ2VydGlmaWNhdGlvbiBBdXRo +b3JpdHksIDA5LzIwMDkxLTArBgNVBAoMJFBydm7DrSBjZXJ0aWZpa2HEjW7DrSBh +dXRvcml0YSwgYS5zLjE9MDsGA1UECww0SS5DQSAtIEFjY3JlZGl0ZWQgUHJvdmlk +ZXIgb2YgQ2VydGlmaWNhdGlvbiBTZXJ2aWNlczAeFw0wOTA5MDEwMDAwMDBaFw0x +OTA5MDEwMDAwMDBaMIG3MQswCQYDVQQGEwJDWjE6MDgGA1UEAwwxSS5DQSAtIFF1 +YWxpZmllZCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSwgMDkvMjAwOTEtMCsGA1UE +CgwkUHJ2bsOtIGNlcnRpZmlrYcSNbsOtIGF1dG9yaXRhLCBhLnMuMT0wOwYDVQQL +DDRJLkNBIC0gQWNjcmVkaXRlZCBQcm92aWRlciBvZiBDZXJ0aWZpY2F0aW9uIFNl +cnZpY2VzMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAtTaEy0KC8M9l +4lSaWHMs4+sVV1LwzyJYiIQNeCrv1HHm/YpGIdY/Z640ceankjQvIX7m23BK4OSC +6KO8kZYA3zopOz6GFCOKV2PvLukbc+c2imF6kLHEv6qNA8WxhPbR3xKwlHDwB2yh +Wzo7V3QVgDRG83sugqQntKYC3LnlTGbJpNP+Az72gpO9AHUn/IBhFk4ksc8lYS2L +9GCy9CsmdKSBP78p9w8Lx7vDLqkDgt1/zBrcUWmSSb7AE/BPEeMryQV1IdI6nlGn +BhWkXOYf6GSdayJw86btuxC7viDKNrbp44HjQRaSxnp6O3eto1x4DfiYdw/YbJFe +7EjkxSQBywIDAQABo4IBLjCCASowDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8E +BAMCAQYwgecGA1UdIASB3zCB3DCB2QYEVR0gADCB0DCBzQYIKwYBBQUHAgIwgcAa +gb1UZW50byBjZXJ0aWZpa2F0IGplIHZ5ZGFuIGpha28ga3ZhbGlmaWtvdmFueSBz +eXN0ZW1vdnkgY2VydGlmaWthdCBwb2RsZSB6YWtvbmEgYy4gMjI3LzIwMDAgU2Iu +IHYgcGxhdG5lbSB6bmVuaS9UaGlzIGlzIHF1YWxpZmllZCBzeXN0ZW0gY2VydGlm +aWNhdGUgYWNjb3JkaW5nIHRvIEN6ZWNoIEFjdCBOby4gMjI3LzIwMDAgQ29sbC4w +HQYDVR0OBBYEFHnL0CPpOmdwkXRP01Hi4CD94Sj7MA0GCSqGSIb3DQEBCwUAA4IB +AQB9laU214hYaBHPZftbDS/2dIGLWdmdSbj1OZbJ8LIPBMxYjPoEMqzAR74tw96T +i6aWRa5WdOWaS6I/qibEKFZhJAVXX5mkx2ewGFLJ+0Go+eTxnjLOnhVF2V2s+57b +m8c8j6/bS6Ij6DspcHEYpfjjh64hE2r0aSpZDjGzKFM6YpqsCJN8qYe2X1qmGMLQ +wvNdjG+nPzCJOOuUEypIWt555ZDLXqS5F7ZjBjlfyDZjEfS2Es9Idok8alf563Mi +9/o+Ba46wMYOkk3P1IlU0RqCajdbliioACKDztAqubONU1guZVzV8tuMASVzbJeL +/GAB7ECTwe1RuKrLYtglMKI9 +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIHyTCCBbGgAwIBAgIBATANBgkqhkiG9w0BAQUFADB9MQswCQYDVQQGEwJJTDEW +MBQGA1UEChMNU3RhcnRDb20gTHRkLjErMCkGA1UECxMiU2VjdXJlIERpZ2l0YWwg +Q2VydGlmaWNhdGUgU2lnbmluZzEpMCcGA1UEAxMgU3RhcnRDb20gQ2VydGlmaWNh +dGlvbiBBdXRob3JpdHkwHhcNMDYwOTE3MTk0NjM2WhcNMzYwOTE3MTk0NjM2WjB9 +MQswCQYDVQQGEwJJTDEWMBQGA1UEChMNU3RhcnRDb20gTHRkLjErMCkGA1UECxMi +U2VjdXJlIERpZ2l0YWwgQ2VydGlmaWNhdGUgU2lnbmluZzEpMCcGA1UEAxMgU3Rh +cnRDb20gQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwggIiMA0GCSqGSIb3DQEBAQUA +A4ICDwAwggIKAoICAQDBiNsJvGxGfHiflXu1M5DycmLWwTYgIiRezul38kMKogZk +pMyONvg45iPwbm2xPN1yo4UcodM9tDMr0y+v/uqwQVlntsQGfQqedIXWeUyAN3rf +OQVSWff0G0ZDpNKFhdLDcfN1YjS6LIp/Ho/u7TTQEceWzVI9ujPW3U3eCztKS5/C +Ji/6tRYccjV3yjxd5srhJosaNnZcAdt0FCX+7bWgiA/deMotHweXMAEtcnn6RtYT +Kqi5pquDSR3l8u/d5AGOGAqPY1MWhWKpDhk6zLVmpsJrdAfkK+F2PrRt2PZE4XNi +HzvEvqBTViVsUQn3qqvKv3b9bZvzndu/PWa8DFaqr5hIlTpL36dYUNk4dalb6kMM +Av+Z6+hsTXBbKWWc3apdzK8BMewM69KN6Oqce+Zu9ydmDBpI125C4z/eIT574Q1w ++2OqqGwaVLRcJXrJosmLFqa7LH4XXgVNWG4SHQHuEhANxjJ/GP/89PrNbpHoNkm+ +Gkhpi8KWTRoSsmkXwQqQ1vp5Iki/untp+HDH+no32NgN0nZPV/+Qt+OR0t3vwmC3 +Zzrd/qqc8NSLf3Iizsafl7b4r4qgEKjZ+xjGtrVcUjyJthkqcwEKDwOzEmDyei+B +26Nu/yYwl/WL3YlXtq09s68rxbd2AvCl1iuahhQqcvbjM4xdCUsT37uMdBNSSwID +AQABo4ICUjCCAk4wDAYDVR0TBAUwAwEB/zALBgNVHQ8EBAMCAa4wHQYDVR0OBBYE +FE4L7xqkQFulF2mHMMo0aEPQQa7yMGQGA1UdHwRdMFswLKAqoCiGJmh0dHA6Ly9j +ZXJ0LnN0YXJ0Y29tLm9yZy9zZnNjYS1jcmwuY3JsMCugKaAnhiVodHRwOi8vY3Js +LnN0YXJ0Y29tLm9yZy9zZnNjYS1jcmwuY3JsMIIBXQYDVR0gBIIBVDCCAVAwggFM +BgsrBgEEAYG1NwEBATCCATswLwYIKwYBBQUHAgEWI2h0dHA6Ly9jZXJ0LnN0YXJ0 +Y29tLm9yZy9wb2xpY3kucGRmMDUGCCsGAQUFBwIBFilodHRwOi8vY2VydC5zdGFy +dGNvbS5vcmcvaW50ZXJtZWRpYXRlLnBkZjCB0AYIKwYBBQUHAgIwgcMwJxYgU3Rh +cnQgQ29tbWVyY2lhbCAoU3RhcnRDb20pIEx0ZC4wAwIBARqBl0xpbWl0ZWQgTGlh +YmlsaXR5LCByZWFkIHRoZSBzZWN0aW9uICpMZWdhbCBMaW1pdGF0aW9ucyogb2Yg +dGhlIFN0YXJ0Q29tIENlcnRpZmljYXRpb24gQXV0aG9yaXR5IFBvbGljeSBhdmFp +bGFibGUgYXQgaHR0cDovL2NlcnQuc3RhcnRjb20ub3JnL3BvbGljeS5wZGYwEQYJ +YIZIAYb4QgEBBAQDAgAHMDgGCWCGSAGG+EIBDQQrFilTdGFydENvbSBGcmVlIFNT +TCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTANBgkqhkiG9w0BAQUFAAOCAgEAFmyZ +9GYMNPXQhV59CuzaEE44HF7fpiUFS5Eyweg78T3dRAlbB0mKKctmArexmvclmAk8 +jhvh3TaHK0u7aNM5Zj2gJsfyOZEdUauCe37Vzlrk4gNXcGmXCPleWKYK34wGmkUW +FjgKXlf2Ysd6AgXmvB618p70qSmD+LIU424oh0TDkBreOKk8rENNZEXO3SipXPJz +ewT4F+irsfMuXGRuczE6Eri8sxHkfY+BUZo7jYn0TZNmezwD7dOaHZrzZVD1oNB1 +ny+v8OqCQ5j4aZyJecRDjkZy42Q2Eq/3JR44iZB3fsNrarnDy0RLrHiQi+fHLB5L +EUTINFInzQpdn4XBidUaePKVEFMy3YCEZnXZtWgo+2EuvoSoOMCZEoalHmdkrQYu +L6lwhceWD3yJZfWOQ1QOq92lgDmUYMA0yZZwLKMS9R9Ie70cfmu3nZD0Ijuu+Pwq +yvqCUqDvr0tVk+vBtfAii6w0TiYiBKGHLHVKt+V9E9e4DGTANtLJL4YSjCMJwRuC +O3NJo2pXh5Tl1njFmUNj403gdy3hZZlyaQQaRwnmDwFWJPsfvw55qVguucQJAX6V +um0ABj6y6koQOdjQK/W/7HW/lwLFCRsI3FU34oH7N4RDYiDK51ZLZer+bMEkkySh +NOsF/5oirpt9P/FlUQqmMGqz9IgcgA38corog14= +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIHhzCCBW+gAwIBAgIBLTANBgkqhkiG9w0BAQsFADB9MQswCQYDVQQGEwJJTDEW +MBQGA1UEChMNU3RhcnRDb20gTHRkLjErMCkGA1UECxMiU2VjdXJlIERpZ2l0YWwg +Q2VydGlmaWNhdGUgU2lnbmluZzEpMCcGA1UEAxMgU3RhcnRDb20gQ2VydGlmaWNh +dGlvbiBBdXRob3JpdHkwHhcNMDYwOTE3MTk0NjM3WhcNMzYwOTE3MTk0NjM2WjB9 +MQswCQYDVQQGEwJJTDEWMBQGA1UEChMNU3RhcnRDb20gTHRkLjErMCkGA1UECxMi +U2VjdXJlIERpZ2l0YWwgQ2VydGlmaWNhdGUgU2lnbmluZzEpMCcGA1UEAxMgU3Rh +cnRDb20gQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwggIiMA0GCSqGSIb3DQEBAQUA +A4ICDwAwggIKAoICAQDBiNsJvGxGfHiflXu1M5DycmLWwTYgIiRezul38kMKogZk +pMyONvg45iPwbm2xPN1yo4UcodM9tDMr0y+v/uqwQVlntsQGfQqedIXWeUyAN3rf +OQVSWff0G0ZDpNKFhdLDcfN1YjS6LIp/Ho/u7TTQEceWzVI9ujPW3U3eCztKS5/C +Ji/6tRYccjV3yjxd5srhJosaNnZcAdt0FCX+7bWgiA/deMotHweXMAEtcnn6RtYT +Kqi5pquDSR3l8u/d5AGOGAqPY1MWhWKpDhk6zLVmpsJrdAfkK+F2PrRt2PZE4XNi +HzvEvqBTViVsUQn3qqvKv3b9bZvzndu/PWa8DFaqr5hIlTpL36dYUNk4dalb6kMM +Av+Z6+hsTXBbKWWc3apdzK8BMewM69KN6Oqce+Zu9ydmDBpI125C4z/eIT574Q1w ++2OqqGwaVLRcJXrJosmLFqa7LH4XXgVNWG4SHQHuEhANxjJ/GP/89PrNbpHoNkm+ +Gkhpi8KWTRoSsmkXwQqQ1vp5Iki/untp+HDH+no32NgN0nZPV/+Qt+OR0t3vwmC3 +Zzrd/qqc8NSLf3Iizsafl7b4r4qgEKjZ+xjGtrVcUjyJthkqcwEKDwOzEmDyei+B +26Nu/yYwl/WL3YlXtq09s68rxbd2AvCl1iuahhQqcvbjM4xdCUsT37uMdBNSSwID +AQABo4ICEDCCAgwwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYD +VR0OBBYEFE4L7xqkQFulF2mHMMo0aEPQQa7yMB8GA1UdIwQYMBaAFE4L7xqkQFul +F2mHMMo0aEPQQa7yMIIBWgYDVR0gBIIBUTCCAU0wggFJBgsrBgEEAYG1NwEBATCC +ATgwLgYIKwYBBQUHAgEWImh0dHA6Ly93d3cuc3RhcnRzc2wuY29tL3BvbGljeS5w +ZGYwNAYIKwYBBQUHAgEWKGh0dHA6Ly93d3cuc3RhcnRzc2wuY29tL2ludGVybWVk +aWF0ZS5wZGYwgc8GCCsGAQUFBwICMIHCMCcWIFN0YXJ0IENvbW1lcmNpYWwgKFN0 +YXJ0Q29tKSBMdGQuMAMCAQEagZZMaW1pdGVkIExpYWJpbGl0eSwgcmVhZCB0aGUg +c2VjdGlvbiAqTGVnYWwgTGltaXRhdGlvbnMqIG9mIHRoZSBTdGFydENvbSBDZXJ0 +aWZpY2F0aW9uIEF1dGhvcml0eSBQb2xpY3kgYXZhaWxhYmxlIGF0IGh0dHA6Ly93 +d3cuc3RhcnRzc2wuY29tL3BvbGljeS5wZGYwEQYJYIZIAYb4QgEBBAQDAgAHMDgG +CWCGSAGG+EIBDQQrFilTdGFydENvbSBGcmVlIFNTTCBDZXJ0aWZpY2F0aW9uIEF1 +dGhvcml0eTANBgkqhkiG9w0BAQsFAAOCAgEAjo/n3JR5fPGFf59Jb2vKXfuM/gTF +wWLRfUKKvFO3lANmMD+x5wqnUCBVJX92ehQN6wQOQOY+2IirByeDqXWmN3PH/UvS +Ta0XQMhGvjt/UfzDtgUx3M2FIk5xt/JxXrAaxrqTi3iSSoX4eA+D/i+tLPfkpLst +0OcNOrg+zvZ49q5HJMqjNTbOx8aHmNrs++myziebiMMEofYLWWivydsQD032ZGNc +pRJvkrKTlMeIFw6Ttn5ii5B/q06f/ON1FE8qMt9bDeD1e5MNq6HPh+GlBEXoPBKl +CcWw0bdT82AUuoVpaiF8H3VhFyAXe2w7QSlc4axa0c2Mm+tgHRns9+Ww2vl5GKVF +P0lDV9LdJNUso/2RjSe15esUBppMeyG7Oq0wBhjA2MFrLH9ZXF2RsXAiV+uKa0hK +1Q8p7MZAwC+ITGgBF3f0JBlPvfrhsiAhS90a2Cl9qrjeVOwhVYBsHvUwyKMQ5bLm +KhQxw4UtjJixhlpPiVktucf3HMiKf8CdBUrmQk9io20ppB+Fq9vlgcitKj1MXVuE +JnHEhV5xJMqlG2zYYdMa4FTbzrqpMrUi9nNBCV24F10OD5mQ1kfabwo6YigUZ4LZ +8dCAWZvLMdibD4x3TrVoivJs9iQOLWxwxXPR3hTQcY+203sC9uO41Alua551hDnm +fyWl8kgAwKQB2j8= +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIDrzCCApegAwIBAgIQCDvgVpBCRrGhdWrJWZHHSjANBgkqhkiG9w0BAQUFADBh +MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3 +d3cuZGlnaWNlcnQuY29tMSAwHgYDVQQDExdEaWdpQ2VydCBHbG9iYWwgUm9vdCBD +QTAeFw0wNjExMTAwMDAwMDBaFw0zMTExMTAwMDAwMDBaMGExCzAJBgNVBAYTAlVT +MRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5j +b20xIDAeBgNVBAMTF0RpZ2lDZXJ0IEdsb2JhbCBSb290IENBMIIBIjANBgkqhkiG +9w0BAQEFAAOCAQ8AMIIBCgKCAQEA4jvhEXLeqKTTo1eqUKKPC3eQyaKl7hLOllsB +CSDMAZOnTjC3U/dDxGkAV53ijSLdhwZAAIEJzs4bg7/fzTtxRuLWZscFs3YnFo97 +nh6Vfe63SKMI2tavegw5BmV/Sl0fvBf4q77uKNd0f3p4mVmFaG5cIzJLv07A6Fpt +43C/dxC//AH2hdmoRBBYMql1GNXRor5H4idq9Joz+EkIYIvUX7Q6hL+hqkpMfT7P +T19sdl6gSzeRntwi5m3OFBqOasv+zbMUZBfHWymeMr/y7vrTC0LUq7dBMtoM1O/4 +gdW7jVg/tRvoSSiicNoxBN33shbyTApOB6jtSj1etX+jkMOvJwIDAQABo2MwYTAO +BgNVHQ8BAf8EBAMCAYYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUA95QNVbR +TLtm8KPiGxvDl7I90VUwHwYDVR0jBBgwFoAUA95QNVbRTLtm8KPiGxvDl7I90VUw +DQYJKoZIhvcNAQEFBQADggEBAMucN6pIExIK+t1EnE9SsPTfrgT1eXkIoyQY/Esr +hMAtudXH/vTBH1jLuG2cenTnmCmrEbXjcKChzUyImZOMkXDiqw8cvpOp/2PV5Adg +06O/nVsJ8dWO41P0jmP6P6fbtGbfYmbW0W5BjfIttep3Sp+dWOIrWcBAI+0tKIJF +PnlUkiaY4IBIqDfv8NZ5YBberOgOzW6sRBc4L0na4UU+Krk2U886UAb3LujEV0ls +YSEY1QSteDwsOoBrp+uvFRTp2InBuThs4pFsiv9kuXclVzDAGySj4dzp30d8tbQk +CAUw7C29C79Fv1C5qfPrmAESrciIxpg0X40KPMbp1ZWVbd4= +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIDkzCCAnugAwIBAgIQFBOWgxRVjOp7Y+X8NId3RDANBgkqhkiG9w0BAQUFADA0 +MRMwEQYDVQQDEwpDb21TaWduIENBMRAwDgYDVQQKEwdDb21TaWduMQswCQYDVQQG +EwJJTDAeFw0wNDAzMjQxMTMyMThaFw0yOTAzMTkxNTAyMThaMDQxEzARBgNVBAMT +CkNvbVNpZ24gQ0ExEDAOBgNVBAoTB0NvbVNpZ24xCzAJBgNVBAYTAklMMIIBIjAN +BgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA8ORUaSvTx49qROR+WCf4C9DklBKK +8Rs4OC8fMZwG1Cyn3gsqrhqg455qv588x26i+YtkbDqthVVRVKU4VbirgwTyP2Q2 +98CNQ0NqZtH3FyrV7zb6MBBC11PN+fozc0yz6YQgitZBJzXkOPqUm7h65HkfM/sb +2CEJKHxNGGleZIp6GZPKfuzzcuc3B1hZKKxC+cX/zT/npfo4sdAMx9lSGlPWgcxC +ejVb7Us6eva1jsz/D3zkYDaHL63woSV9/9JLEYhwVKZBqGdTUkJe5DSe5L6j7Kpi +Xd3DTKaCQeQzC6zJMw9kglcq/QytNuEMrkvF7zuZ2SOzW120V+x0cAwqTwIDAQAB +o4GgMIGdMAwGA1UdEwQFMAMBAf8wPQYDVR0fBDYwNDAyoDCgLoYsaHR0cDovL2Zl +ZGlyLmNvbXNpZ24uY28uaWwvY3JsL0NvbVNpZ25DQS5jcmwwDgYDVR0PAQH/BAQD +AgGGMB8GA1UdIwQYMBaAFEsBmz5WGmU2dst7l6qSBe4y5ygxMB0GA1UdDgQWBBRL +AZs+VhplNnbLe5eqkgXuMucoMTANBgkqhkiG9w0BAQUFAAOCAQEA0Nmlfv4pYEWd +foPPbrxHbvUanlR2QnG0PFg/LUAlQvaBnPGJEMgOqnhPOAlXsDzACPw1jvFIUY0M +cXS6hMTXcpuEfDhOZAYnKuGntewImbQKDdSFc8gS4TXt8QUxHXOZDOuWyt3T5oWq +8Ir7dcHyCTxlZWTzTNity4hp8+SDtwy9F1qWF8pb/627HOkthIDYIb6FUtnUdLlp +hbpN7Sgy6/lhSuTENh4Z3G+EER+V9YMoGKgzkkMn3V0TBEVPh9VGzT2ouvDzuFYk +Res3x+F2T3I5GN9+dHLHcy056mDmrRGiVod7w2ia/viMcKjfZTL0pECMocJEAw6U +AGegcQCCSA== +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIEZDCCA0ygAwIBAgIQRL4Mi1AAJLQR0zYwS8AzdzANBgkqhkiG9w0BAQUFADCB +ozELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAlVUMRcwFQYDVQQHEw5TYWx0IExha2Ug +Q2l0eTEeMBwGA1UEChMVVGhlIFVTRVJUUlVTVCBOZXR3b3JrMSEwHwYDVQQLExho +dHRwOi8vd3d3LnVzZXJ0cnVzdC5jb20xKzApBgNVBAMTIlVUTi1VU0VSRmlyc3Qt +TmV0d29yayBBcHBsaWNhdGlvbnMwHhcNOTkwNzA5MTg0ODM5WhcNMTkwNzA5MTg1 +NzQ5WjCBozELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAlVUMRcwFQYDVQQHEw5TYWx0 +IExha2UgQ2l0eTEeMBwGA1UEChMVVGhlIFVTRVJUUlVTVCBOZXR3b3JrMSEwHwYD +VQQLExhodHRwOi8vd3d3LnVzZXJ0cnVzdC5jb20xKzApBgNVBAMTIlVUTi1VU0VS +Rmlyc3QtTmV0d29yayBBcHBsaWNhdGlvbnMwggEiMA0GCSqGSIb3DQEBAQUAA4IB +DwAwggEKAoIBAQCz+5Gh5DZVhawGNFugmliy+LUPBXeDrjKxdpJo7CNKyXY/45y2 +N3kDuatpjQclthln5LAbGHNhSuh+zdMvZOOmfAz6F4CjDUeJT1FxL+78P/m4FoCH +iZMlIJpDgmkkdihZNaEdwH+DBmQWICzTSaSFtMBhf1EI+GgVkYDLpdXuOzr0hARe +YFmnjDRy7rh4xdE7EkpvfmUnuaRVxblvQ6TFHSyZwFKkeEwVs0CYCGtDxgGwenv1 +axwiP8vv/6jQOkt2FZ7S0cYu49tXGzKiuG/ohqY/cKvlcJKrRB5AUPuco2LkbG6g +yN7igEL66S/ozjIEj3yNtxyjNTwV3Z7DrpelAgMBAAGjgZEwgY4wCwYDVR0PBAQD +AgHGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFPqGydvguul49Uuo1hXf8NPh +ahQ8ME8GA1UdHwRIMEYwRKBCoECGPmh0dHA6Ly9jcmwudXNlcnRydXN0LmNvbS9V +VE4tVVNFUkZpcnN0LU5ldHdvcmtBcHBsaWNhdGlvbnMuY3JsMA0GCSqGSIb3DQEB +BQUAA4IBAQCk8yXM0dSRgyLQzDKrm5ZONJFUICU0YV8qAhXhi6r/fWRRzwr/vH3Y +IWp4yy9Rb/hCHTO967V7lMPDqaAt39EpHx3+jz+7qEUqf9FuVSTiuwL7MT++6Lzs +QCv4AdRWOOTKRIK1YSAhZ2X28AvnNPilwpyjXEAfhZOVBt5P1CeptqX8Fs1zMT+4 +ZSfP1FMa8Kxun08FDAOBp4QpxFq9ZFdyrTvPNximmMatBrTcCKME1SmklpoSZ0qM +YEWd8SOasACcaLWYUNPvji6SZbFIPiG+FTAqDbUMo2s/rn9X9R+WfN9v3YIwLGUb +QErNaLly7HF27FSOH4UMAWr6pjisH8SE +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIDtzCCAp+gAwIBAgIQDOfg5RfYRv6P5WD8G/AwOTANBgkqhkiG9w0BAQUFADBl +MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3 +d3cuZGlnaWNlcnQuY29tMSQwIgYDVQQDExtEaWdpQ2VydCBBc3N1cmVkIElEIFJv +b3QgQ0EwHhcNMDYxMTEwMDAwMDAwWhcNMzExMTEwMDAwMDAwWjBlMQswCQYDVQQG +EwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNl +cnQuY29tMSQwIgYDVQQDExtEaWdpQ2VydCBBc3N1cmVkIElEIFJvb3QgQ0EwggEi +MA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCtDhXO5EOAXLGH87dg+XESpa7c +JpSIqvTO9SA5KFhgDPiA2qkVlTJhPLWxKISKityfCgyDF3qPkKyK53lTXDGEKvYP +mDI2dsze3Tyoou9q+yHyUmHfnyDXH+Kx2f4YZNISW1/5WBg1vEfNoTb5a3/UsDg+ +wRvDjDPZ2C8Y/igPs6eD1sNuRMBhNZYW/lmci3Zt1/GiSw0r/wty2p5g0I6QNcZ4 +VYcgoc/lbQrISXwxmDNsIumH0DJaoroTghHtORedmTpyoeb6pNnVFzF1roV9Iq4/ +AUaG9ih5yLHa5FcXxH4cDrC0kqZWs72yl+2qp/C3xag/lRbQ/6GW6whfGHdPAgMB +AAGjYzBhMA4GA1UdDwEB/wQEAwIBhjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQW +BBRF66Kv9JLLgjEtUYunpyGd823IDzAfBgNVHSMEGDAWgBRF66Kv9JLLgjEtUYun +pyGd823IDzANBgkqhkiG9w0BAQUFAAOCAQEAog683+Lt8ONyc3pklL/3cmbYMuRC +dWKuh+vy1dneVrOfzM4UKLkNl2BcEkxY5NM9g0lFWJc1aRqoR+pWxnmrEthngYTf +fwk8lOa4JiwgvT2zKIn3X/8i4peEH+ll74fg38FnSbNd67IJKusm7Xi+fT8r87cm +NW1fiQG2SVufAQWbqz0lwcy2f8Lxb4bG+mRo64EtlOtCt/qMHt1i8b5QZ7dsvfPx +H2sMNgcWfzd8qVttevESRmCD1ycEvkvOl77DZypoEd+A5wwzZr8TDRRu838fYxAe ++o0bJW1sj6W3YQGx0qMmoRBxna3iw/nDmVG3KwcIzi7mULKn+gpFL6Lw8g== +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIICiDCCAg2gAwIBAgIQNfwmXNmET8k9Jj1Xm67XVjAKBggqhkjOPQQDAzCBhDEL +MAkGA1UEBhMCVVMxFTATBgNVBAoTDHRoYXd0ZSwgSW5jLjE4MDYGA1UECxMvKGMp +IDIwMDcgdGhhd3RlLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxJDAi +BgNVBAMTG3RoYXd0ZSBQcmltYXJ5IFJvb3QgQ0EgLSBHMjAeFw0wNzExMDUwMDAw +MDBaFw0zODAxMTgyMzU5NTlaMIGEMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMdGhh +d3RlLCBJbmMuMTgwNgYDVQQLEy8oYykgMjAwNyB0aGF3dGUsIEluYy4gLSBGb3Ig +YXV0aG9yaXplZCB1c2Ugb25seTEkMCIGA1UEAxMbdGhhd3RlIFByaW1hcnkgUm9v +dCBDQSAtIEcyMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEotWcgnuVnfFSeIf+iha/ +BebfowJPDQfGAFG6DAJSLSKkQjnE/o/qycG+1E3/n3qe4rF8mq2nhglzh9HnmuN6 +papu+7qzcMBniKI11KOasf2twu8x+qi58/sIxpHR+ymVo0IwQDAPBgNVHRMBAf8E +BTADAQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQUmtgAMADna3+FGO6Lts6K +DPgR4bswCgYIKoZIzj0EAwMDaQAwZgIxAN344FdHW6fmCsO99YCKlzUNG4k8VIZ3 +KMqh9HneteY4sPBlcIx/AlTCv//YoT7ZzwIxAMSNlPzcU9LcnXgWHxUzI1NS41ox +XZ3Krr0TKUQNJ1uo52icEvdYPy5yAlejj6EULg== +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIETTCCAzWgAwIBAgIBATANBgkqhkiG9w0BAQUFADBtMQswCQYDVQQGEwJDSDEO +MAwGA1UEChMFYWRtaW4xETAPBgNVBAsTCFNlcnZpY2VzMSIwIAYDVQQLExlDZXJ0 +aWZpY2F0aW9uIEF1dGhvcml0aWVzMRcwFQYDVQQDEw5BZG1pbkNBLUNELVQwMTAe +Fw0wNjAxMjUxMzM2MTlaFw0xNjAxMjUxMjM2MTlaMG0xCzAJBgNVBAYTAkNIMQ4w +DAYDVQQKEwVhZG1pbjERMA8GA1UECxMIU2VydmljZXMxIjAgBgNVBAsTGUNlcnRp +ZmljYXRpb24gQXV0aG9yaXRpZXMxFzAVBgNVBAMTDkFkbWluQ0EtQ0QtVDAxMIIB +IjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA0jQlMZmpLDhV+GNR9TAoSNle +JgQB4xAXJELQf5/ySMfoFA4MmjKqYXQkB6MGPuQKwR9XRRSPf61vqb8YPsdjRmgp +byHBcUd5t0N8RX6wRZUnPMW+bCCo2VqAU4XFbnlc2gHKaam0wdTtbBTXEkv0ieIH +fxCfFxXqSsSr60IkF/2/xbrAgV/QD5yHk6Ie8feAVWwi5UtaFqtu4LiFEh2QMyxs +Oyz1OcvKzkM2g873tyiE7jzMgZP+Ww3tibk2F9+e6ZeiB37TLOmVtvgpmrws4fiI +rFNXEYSWBVrUTbn81U47yWzOgf5fEHP07bRV5QOCzCm99qNimsbL6CG7nT78CQID +AQABo4H3MIH0MBIGA1UdEwEB/wQIMAYBAf8CAQAwga4GA1UdIASBpjCBozCBoAYI +YIV0AREDFQEwgZMwSAYIKwYBBQUHAgIwPBo6VGhpcyBpcyB0aGUgQWRtaW5DQS1D +RC1UMDEgQ2VydGlmaWNhdGUgUHJhY3RpY2UgU3RhdGVtZW50LjBHBggrBgEFBQcC +ARY7aHR0cDovL3d3dy5wa2kuYWRtaW4uY2gvcG9saWN5L0NQU18yXzE2Xzc1Nl8x +XzE3XzNfMjFfMS5wZGYwDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBQqxGkKocZV +xgNucM6GgbOkD6oZ2zANBgkqhkiG9w0BAQUFAAOCAQEAn356bbusjI5glGXRQ1DR +v21qQf0S4s3GHyZm7cqdOkFleM70ArBT+kOP5Nm7rlSAFyVgEkmBdOg7s9tlXClU +yeZFnp6UEYRUcijPN8D1VaNRK6PIUObpDBQT0C+kAfxG9z4v29T0SxT4sgAdC/xQ +Fyv58Fp9bPn7owuKwKcyCH1XSyi/Bp4XFELlLOaigBZO/w+dPBz4FcJSdZjU+BaJ +0E3nKAjHlShO5ouBSZnaJz3p+nkw2Wyo36s6GxCK0XbkSP45iniIG4FmwwZkonYF +ypQntHbx2oL7tUQQY0PDo8bGBMcPy/G2j+dciqZRlsnfgMy10SCzQ9MUx92xUG2V +eg== +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIFVTCCBD2gAwIBAgIEO/OB0DANBgkqhkiG9w0BAQUFADBsMQswCQYDVQQGEwJj +aDEOMAwGA1UEChMFYWRtaW4xETAPBgNVBAsTCFNlcnZpY2VzMSIwIAYDVQQLExlD +ZXJ0aWZpY2F0aW9uIEF1dGhvcml0aWVzMRYwFAYDVQQDEw1BZG1pbi1Sb290LUNB +MB4XDTAxMTExNTA4NTEwN1oXDTIxMTExMDA3NTEwN1owbDELMAkGA1UEBhMCY2gx +DjAMBgNVBAoTBWFkbWluMREwDwYDVQQLEwhTZXJ2aWNlczEiMCAGA1UECxMZQ2Vy +dGlmaWNhdGlvbiBBdXRob3JpdGllczEWMBQGA1UEAxMNQWRtaW4tUm9vdC1DQTCC +ASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMvgr0QUIv5qF0nyXZ3PXAJi +C4C5Wr+oVTN7oxIkXkxvO0GJToM9n7OVJjSmzBL0zJ2HXj0MDRcvhSY+KiZZc6Go +vDvr5Ua481l7ILFeQAFtumeza+vvxeL5Nd0Maga2miiacLNAKXbAcUYRa0Ov5VZB +++YcOYNNt/aisWbJqA2y8He+NsEgJzK5zNdayvYXQTZN+7tVgWOck16Da3+4FXdy +fH1NCWtZlebtMKtERtkVAaVbiWW24CjZKAiVfggjsiLo3yVMPGj3budLx5D9hEEm +vlyDOtcjebca+AcZglppWMX/iHIrx7740y0zd6cWEqiLIcZCrnpkr/KzwO135GkC +AwEAAaOCAf0wggH5MA8GA1UdEwEB/wQFMAMBAf8wgZkGA1UdIASBkTCBjjCBiwYI +YIV0AREDAQAwfzArBggrBgEFBQcCAjAfGh1UaGlzIGlzIHRoZSBBZG1pbi1Sb290 +LUNBIENQUzBQBggrBgEFBQcCARZEaHR0cDovL3d3dy5pbmZvcm1hdGlrLmFkbWlu +LmNoL1BLSS9saW5rcy9DUFNfMl8xNl83NTZfMV8xN18zXzFfMC5wZGYwfwYDVR0f +BHgwdjB0oHKgcKRuMGwxFjAUBgNVBAMTDUFkbWluLVJvb3QtQ0ExIjAgBgNVBAsT +GUNlcnRpZmljYXRpb24gQXV0aG9yaXRpZXMxETAPBgNVBAsTCFNlcnZpY2VzMQ4w +DAYDVQQKEwVhZG1pbjELMAkGA1UEBhMCY2gwHQYDVR0OBBYEFIKf+iNzIPGXi7JM +Tb5CxX9mzWToMIGZBgNVHSMEgZEwgY6AFIKf+iNzIPGXi7JMTb5CxX9mzWTooXCk +bjBsMQswCQYDVQQGEwJjaDEOMAwGA1UEChMFYWRtaW4xETAPBgNVBAsTCFNlcnZp +Y2VzMSIwIAYDVQQLExlDZXJ0aWZpY2F0aW9uIEF1dGhvcml0aWVzMRYwFAYDVQQD +Ew1BZG1pbi1Sb290LUNBggQ784HQMA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0B +AQUFAAOCAQEAeE96XCYRpy6umkPKXDWCRn7INo96ZrWpMggcDORuofHIwdTkgOeM +vWOxDN/yuT7CC3FAaUajbPRbDw0hRMcqKz0aC8CgwcyIyhw/rFK29mfNTG3EviP9 +QSsEbnelFnjpm1wjz4EaBiFjatwpUbI6+Zv3XbEt9QQXBn+c6DeFLe4xvC4B+MTr +a440xTk59pSYux8OHhEvqIwHCkiijGqZhTS3KmGFeBopaR+dJVBRBMoXwzk4B3Hn +0Zib1dEYFZa84vPJZyvxCbLOnPRDJgH6V2uQqbG+6DXVaf/wORVOvF/wzzv0viM/ +RWbEtJZdvo8N3sdtCULzifnxP/V0T9+4ZQ== +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIG0TCCBbmgAwIBAgIBezANBgkqhkiG9w0BAQUFADCByTELMAkGA1UEBhMCSFUx +ETAPBgNVBAcTCEJ1ZGFwZXN0MScwJQYDVQQKEx5OZXRMb2NrIEhhbG96YXRiaXp0 +b25zYWdpIEtmdC4xGjAYBgNVBAsTEVRhbnVzaXR2YW55a2lhZG9rMUIwQAYDVQQD +EzlOZXRMb2NrIE1pbm9zaXRldHQgS296amVneXpvaSAoQ2xhc3MgUUEpIFRhbnVz +aXR2YW55a2lhZG8xHjAcBgkqhkiG9w0BCQEWD2luZm9AbmV0bG9jay5odTAeFw0w +MzAzMzAwMTQ3MTFaFw0yMjEyMTUwMTQ3MTFaMIHJMQswCQYDVQQGEwJIVTERMA8G +A1UEBxMIQnVkYXBlc3QxJzAlBgNVBAoTHk5ldExvY2sgSGFsb3phdGJpenRvbnNh +Z2kgS2Z0LjEaMBgGA1UECxMRVGFudXNpdHZhbnlraWFkb2sxQjBABgNVBAMTOU5l +dExvY2sgTWlub3NpdGV0dCBLb3pqZWd5em9pIChDbGFzcyBRQSkgVGFudXNpdHZh +bnlraWFkbzEeMBwGCSqGSIb3DQEJARYPaW5mb0BuZXRsb2NrLmh1MIIBIjANBgkq +hkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAx1Ilstg91IRVCacbvWy5FPSKAtt2/Goq +eKvld/Bu4IwjZ9ulZJm53QE+b+8tmjwi8F3JV6BVQX/yQ15YglMxZc4e8ia6AFQe +r7C8HORSjKAyr7c3sVNnaHRnUPYtLmTeriZ539+Zhqurf4XsoPuAzPS4DB6TRWO5 +3Lhbm+1bOdRfYrCnjnxmOCyqsQhjF2d9zL2z8cM/z1A57dEZgxXbhxInlrfa6uWd +vLrqOU+L73Sa58XQ0uqGURzk/mQIKAR5BevKxXEOC++r6uwSEaEYBTJp0QwsGj0l +mT+1fMptsK6ZmfoIYOcZwvK9UdPM0wKswREMgM6r3JSda6M5UzrWhQIDAMV9o4IC +wDCCArwwEgYDVR0TAQH/BAgwBgEB/wIBBDAOBgNVHQ8BAf8EBAMCAQYwggJ1Bglg +hkgBhvhCAQ0EggJmFoICYkZJR1lFTEVNISBFemVuIHRhbnVzaXR2YW55IGEgTmV0 +TG9jayBLZnQuIE1pbm9zaXRldHQgU3pvbGdhbHRhdGFzaSBTemFiYWx5emF0YWJh +biBsZWlydCBlbGphcmFzb2sgYWxhcGphbiBrZXN6dWx0LiBBIG1pbm9zaXRldHQg +ZWxla3Ryb25pa3VzIGFsYWlyYXMgam9naGF0YXMgZXJ2ZW55ZXN1bGVzZW5laywg +dmFsYW1pbnQgZWxmb2dhZGFzYW5hayBmZWx0ZXRlbGUgYSBNaW5vc2l0ZXR0IFN6 +b2xnYWx0YXRhc2kgU3phYmFseXphdGJhbiwgYXogQWx0YWxhbm9zIFN6ZXJ6b2Rl +c2kgRmVsdGV0ZWxla2JlbiBlbG9pcnQgZWxsZW5vcnplc2kgZWxqYXJhcyBtZWd0 +ZXRlbGUuIEEgZG9rdW1lbnR1bW9rIG1lZ3RhbGFsaGF0b2sgYSBodHRwczovL3d3 +dy5uZXRsb2NrLmh1L2RvY3MvIGNpbWVuIHZhZ3kga2VyaGV0b2sgYXogaW5mb0Bu +ZXRsb2NrLm5ldCBlLW1haWwgY2ltZW4uIFdBUk5JTkchIFRoZSBpc3N1YW5jZSBh +bmQgdGhlIHVzZSBvZiB0aGlzIGNlcnRpZmljYXRlIGFyZSBzdWJqZWN0IHRvIHRo +ZSBOZXRMb2NrIFF1YWxpZmllZCBDUFMgYXZhaWxhYmxlIGF0IGh0dHBzOi8vd3d3 +Lm5ldGxvY2suaHUvZG9jcy8gb3IgYnkgZS1tYWlsIGF0IGluZm9AbmV0bG9jay5u +ZXQwHQYDVR0OBBYEFAlqYhaSsFq7VQ7LdTI6MuWyIckoMA0GCSqGSIb3DQEBBQUA +A4IBAQCRalCc23iBmz+LQuM7/KbD7kPgz/PigDVJRXYC4uMvBcXxKufAQTPGtpvQ +MznNwNuhrWw3AkxYQTvyl5LGSKjN5Yo5iWH5Upfpvfb5lHTocQ68d4bDBsxafEp+ +NFAwLvt/MpqNPfMgW/hqyobzMUwsWYACff44yTB1HLdV47yfuqhthCgFdbOLDcCR +VCHnpgu0mfVRQdzNo0ci2ccBgcTcR08m6h/t280NmPSjnLRzMkqWmf68f8glWPhY +83ZmiVSkpj7EUFy6iRiCdUgh0k8T6GB+B3bbELVR5qq5aKrN9p2QdRLqOBrKROi3 +macqaJVmlaut74nLYKkGEsaUR+ko +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIICPzCCAcWgAwIBAgIQBVVWvPJepDU1w6QP1atFcjAKBggqhkjOPQQDAzBhMQsw +CQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cu +ZGlnaWNlcnQuY29tMSAwHgYDVQQDExdEaWdpQ2VydCBHbG9iYWwgUm9vdCBHMzAe +Fw0xMzA4MDExMjAwMDBaFw0zODAxMTUxMjAwMDBaMGExCzAJBgNVBAYTAlVTMRUw +EwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5jb20x +IDAeBgNVBAMTF0RpZ2lDZXJ0IEdsb2JhbCBSb290IEczMHYwEAYHKoZIzj0CAQYF +K4EEACIDYgAE3afZu4q4C/sLfyHS8L6+c/MzXRq8NOrexpu80JX28MzQC7phW1FG +fp4tn+6OYwwX7Adw9c+ELkCDnOg/QW07rdOkFFk2eJ0DQ+4QE2xy3q6Ip6FrtUPO +Z9wj/wMco+I+o0IwQDAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBhjAd +BgNVHQ4EFgQUs9tIpPmhxdiuNkHMEWNpYim8S8YwCgYIKoZIzj0EAwMDaAAwZQIx +AK288mw/EkrRLTnDCgmXc/SINoyIJ7vmiI1Qhadj+Z4y3maTD/HMsQmP3Wyr+mt/ +oAIwOWZbwmSNuJ5Q3KjVSaLtx9zRSX8XAbjIho9OjIgrqJqpisXRAL34VOKa5Vt8 +sycX +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIFkjCCA3qgAwIBAgIBCDANBgkqhkiG9w0BAQUFADA6MQswCQYDVQQGEwJDTjER +MA8GA1UEChMIVW5pVHJ1c3QxGDAWBgNVBAMTD1VDQSBHbG9iYWwgUm9vdDAeFw0w +ODAxMDEwMDAwMDBaFw0zNzEyMzEwMDAwMDBaMDoxCzAJBgNVBAYTAkNOMREwDwYD +VQQKEwhVbmlUcnVzdDEYMBYGA1UEAxMPVUNBIEdsb2JhbCBSb290MIICIjANBgkq +hkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA2rPlBlA/9nP3xDK/RqUlYjOHsGj+p9+I +A2N9Apb964fJ7uIIu527u+RBj8cwiQ9tJMAEbBSUgU2gDXRm8/CFr/hkGd656YGT +0CiFmUdCSiw8OCdKzP/5bBnXtfPvm65bNAbXj6ITBpyKhELVs6OQaG2BkO5NhOxM +cE4t3iQ5zhkAQ5N4+QiGHUPR9HK8BcBn+sBR0smFBySuOR56zUHSNqth6iur8CBV +mTxtLRwuLnWW2HKX4AzKaXPudSsVCeCObbvaE/9GqOgADKwHLx25urnRoPeZnnRc +GQVmMc8+KlL+b5/zub35wYH1N9ouTIElXfbZlJrTNYsgKDdfUet9Ysepk9H50DTL +qScmLCiQkjtVY7cXDlRzq6987DqrcDOsIfsiJrOGrCOp139tywgg8q9A9f9ER3Hd +J90TKKHqdjn5EKCgTUCkJ7JZFStsLSS3JGN490MYeg9NEePorIdCjedYcaSrbqLA +l3y74xNLytu7awj5abQEctXDRrl36v+6++nwOgw19o8PrgaEFt2UVdTvyie3AzzF +HCYq9TyopZWbhvGKiWf4xwxmse1Bv4KmAGg6IjTuHuvlb4l0T2qqaqhXZ1LUIGHB +zlPL/SR/XybfoQhplqCe/klD4tPq2sTxiDEhbhzhzfN1DiBEFsx9c3Q1RSw7gdQg +7LYJjD5IskkCAwEAAaOBojCBnzALBgNVHQ8EBAMCAQYwDAYDVR0TBAUwAwEB/zBj +BgNVHSUEXDBaBggrBgEFBQcDAQYIKwYBBQUHAwIGCCsGAQUFBwMDBggrBgEFBQcD +BAYIKwYBBQUHAwUGCCsGAQUFBwMGBggrBgEFBQcDBwYIKwYBBQUHAwgGCCsGAQUF +BwMJMB0GA1UdDgQWBBTZw9P4gJJnzF3SOqLXcaK0xDiALTANBgkqhkiG9w0BAQUF +AAOCAgEA0Ih5ygiq9ws0oE4Jwul+NUiJcIQjL1HDKy9e21NrW3UIKlS6Mg7VxnGF +sZdJgPaE0PC6t3GUyHlrpsVE6EKirSUtVy/m1jEp+hmJVCl+t35HNmktbjK81HXa +QnO4TuWDQHOyXd/URHOmYgvbqm4FjMh/Rk85hZCdvBtUKayl1/7lWFZXbSyZoUkh +1WHGjGHhdSTBAd0tGzbDLxLMC9Z4i3WA6UG5iLHKPKkWxk4V43I29tSgQYWvimVw +TbVEEFDs7d9t5tnGwBLxSzovc+k8qe4bqi81pZufTcU0hF8mFGmzI7GJchT46U1R +IgP/SobEHOh7eQrbRyWBfvw0hKxZuFhD5D1DCVR0wtD92e9uWfdyYJl2b/Unp7uD +pEqB7CmB9HdL4UISVdSGKhK28FWbAS7d9qjjGcPORy/AeGEYWsdl/J1GW1fcfA67 +loMQfFUYCQSu0feLKj6g5lDWMDbX54s4U+xJRODPpN/xU3uLWrb2EZBL1nXz/gLz +Ka/wI3J9FO2pXd96gZ6bkiL8HvgBRUGXx2sBYb4zaPKgZYRmvOAqpGjTcezHCN6j +w8k2SjTxF+KAryAhk5Qe5hXTVGLxtTgv48y5ZwSpuuXu+RBuyy5+E6+SFP7zJ3N7 +OPxzbbm5iPZujAv1/P8JDrMtXnt145Ik4ubhWD5LKAN1axibRww= +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIDdjCCAl6gAwIBAgIEOhsEBTANBgkqhkiG9w0BAQUFADBRMQswCQYDVQQGEwJE +SzEMMAoGA1UEChMDS01EMQ8wDQYDVQQLEwZLTUQtQ0ExIzAhBgNVBAMTGktNRC1D +QSBLdmFsaWZpY2VyZXQgUGVyc29uMB4XDTAwMTEyMTIzMjQ1OVoXDTE1MTEyMjIz +MjQ1OVowUTELMAkGA1UEBhMCREsxDDAKBgNVBAoTA0tNRDEPMA0GA1UECxMGS01E +LUNBMSMwIQYDVQQDExpLTUQtQ0EgS3ZhbGlmaWNlcmV0IFBlcnNvbjCCASIwDQYJ +KoZIhvcNAQEBBQADggEPADCCAQoCggEBANriF4Xd6yD7ZlBE317UBDObn+vRMVc6 +p3wNQODdEDJe2z1ncCz9NJvhoLGdOJhyg7VVPh0P2c+KZ9WI9mWOKZI2bp2WkLju +jCcxbhTrurY3Wfc6gwLBqqFV8wWgaZKmvVWizjw9Kyi25f3yX4fOho6Qq2lvVbub +tvVFXAd51GJ+/2Yed+a4Or2bz2RcqHS81B3pywsD4mgJR5xREv5jqPfwNP+V7bkc +X+pfO4kVhZ/V+8MSPdQHgcV/iB3wP2mwgWyIBNc1reBidGTiz8unnWu55hcNfsvt +LJbTs9OHhsR7naRuy+S402nDnD5vnONOFEsiHn46w+T0rtu7h6j4OvkCAwEAAaNW +MFQwEgYDVR0TAQH/BAgwBgEB/wIBADAdBgNVHQ4EFgQUeWLqmhI42Jxj7DifDsW+ +DlQhKD0wHwYDVR0jBBgwFoAUeWLqmhI42Jxj7DifDsW+DlQhKD0wDQYJKoZIhvcN +AQEFBQADggEBANML/P42OuJ9aUV/0fItuIyc1JhqWvSqn5bXj+9eyEegcp8bHLHY +42D1O+z0lNipdjYPSdMJ0wZOEUhr+150SdDQ1P/zQL8AUaLEBkRt7ZdzXPVH3PER +qnf9IrpYBknZKfCAoVchA6Rr9WU3Sd8bMoRfMLKg8c0M8G6EPwCTcOFriSkbtvNG +zd8r8I+WfUYIN/p8DI9JT9qfjVODnYPRMUm6KPvq27TsrGruKrqyaV94kWc8co8A +v3zFLeCtghvUiRBdx+8Q7m5t4CkuSr0WINrqjIPFW2QrM1r82y09Fd16RkqL4LOg +Lh6vB5KnTApv62rWdw7zWwYnjY6/vXYY1Aw= +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIF4DCCA8igAwIBAgIRAPL6ZOJ0Y9ON/RAdBB92ylgwDQYJKoZIhvcNAQELBQAw +ZzELMAkGA1UEBhMCY2gxETAPBgNVBAoTCFN3aXNzY29tMSUwIwYDVQQLExxEaWdp +dGFsIENlcnRpZmljYXRlIFNlcnZpY2VzMR4wHAYDVQQDExVTd2lzc2NvbSBSb290 +IEVWIENBIDIwHhcNMTEwNjI0MDk0NTA4WhcNMzEwNjI1MDg0NTA4WjBnMQswCQYD +VQQGEwJjaDERMA8GA1UEChMIU3dpc3Njb20xJTAjBgNVBAsTHERpZ2l0YWwgQ2Vy +dGlmaWNhdGUgU2VydmljZXMxHjAcBgNVBAMTFVN3aXNzY29tIFJvb3QgRVYgQ0Eg +MjCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAMT3HS9X6lds93BdY7Bx +UglgRCgzo3pOCvrY6myLURYaVa5UJsTMRQdBTxB5f3HSek4/OE6zAMaVylvNwSqD +1ycfMQ4jFrclyxy0uYAyXhqdk/HoPGAsp15XGVhRXrwsVgu42O+LgrQ8uMIkqBPH +oCE2G3pXKSinLr9xJZDzRINpUKTk4RtiGZQJo/PDvO/0vezbE53PnUgJUmfANykR +HvvSEaeFGHR55E+FFOtSN+KxRdjMDUN/rhPSays/p8LiqG12W0OfvrSdsyaGOx9/ +5fLoZigWJdBLlzin5M8J0TbDC77aO0RYjb7xnglrPvMyxyuHxuxenPaHZa0zKcQv +idm5y8kDnftslFGXEBuGCxobP/YCfnvUxVFkKJ3106yDgYjTdLRZncHrYTNaRdHL +OdAGalNgHa/2+2m8atwBz735j9m9W8E6X47aD0upm50qKGsaCnw8qyIL5XctcfaC +NYGu+HuB5ur+rPQam3Rc6I8k9l2dRsQs0h4rIWqDJ2dVSqTjyDKXZpBy2uPUZC5f +46Fq9mDU5zXNysRojddxyNMkM3OxbPlq4SjbX8Y96L5V5jcb7STZDxmPX2MYWFCB +UWVv8p9+agTnNCRxunZLWB4ZvRVgRaoMEkABnRDixzgHcgplwLa7JSnaFp6LNYth +7eVxV4O1PHGf40+/fh6Bn0GXAgMBAAGjgYYwgYMwDgYDVR0PAQH/BAQDAgGGMB0G +A1UdIQQWMBQwEgYHYIV0AVMCAgYHYIV0AVMCAjASBgNVHRMBAf8ECDAGAQH/AgED +MB0GA1UdDgQWBBRF2aWBbj2ITY1x0kbBbkUe88SAnTAfBgNVHSMEGDAWgBRF2aWB +bj2ITY1x0kbBbkUe88SAnTANBgkqhkiG9w0BAQsFAAOCAgEAlDpzBp9SSzBc1P6x +XCX5145v9Ydkn+0UjrgEjihLj6p7jjm02Vj2e6E1CqGdivdj5eu9OYLU43otb98T +PLr+flaYC/NUn81ETm484T4VvwYmneTwkLbUwp4wLh/vx3rEUMfqe9pQy3omywC0 +Wqu1kx+AiYQElY2NfwmTv9SoqORjbdlk5LgpWgi/UOGED1V7XwgiG/W9mR4U9s70 +WBCCswo9GcG/W6uqmdjyMb3lOGbcWAXH7WMaLgqXfIeTK7KK4/HsGOV1timH59yL +Gn602MnTihdsfSlEvoqq9X46Lmgxk7lq2prg2+kupYTNHAq4Sgj5nPFhJpiTt3tm +7JFe3VE/23MPrQRYCd0EApUKPtN236YQHoA96M2kZNEzx5LH4k5E4wnJTsJdhw4S +nr8PyQUQ3nqjsTzyP6WqJ3mtMX0f/fwZacXduT98zca0wjAefm6S139hdlqP65VN +vBFuIXxZN5nQBrz5Bm0yFqXZaajh3DyAHmBR3NdUIR7KYndP+tiPsys6DXhyyWhB +WkdKwqPrGtcKqzwyVcgKEZzfdNbwQBUdyLmPtTbFr/giuMod89a2GQ+fYWVq6nTI +fI/DT11lgh/ZDYnadXL77/FHZxOzyNEZiCcmmpl5fx7kLD977vHeTYuWl8PVP3wb +I+2ksx0WckNLIOFZfsLorSa/ovc= +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIF8TCCA9mgAwIBAgIQALC3WhZIX7/hy/WL1xnmfTANBgkqhkiG9w0BAQsFADA4 +MQswCQYDVQQGEwJFUzEUMBIGA1UECgwLSVpFTlBFIFMuQS4xEzARBgNVBAMMCkl6 +ZW5wZS5jb20wHhcNMDcxMjEzMTMwODI4WhcNMzcxMjEzMDgyNzI1WjA4MQswCQYD +VQQGEwJFUzEUMBIGA1UECgwLSVpFTlBFIFMuQS4xEzARBgNVBAMMCkl6ZW5wZS5j +b20wggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDJ03rKDx6sp4boFmVq +scIbRTJxldn+EFvMr+eleQGPicPK8lVx93e+d5TzcqQsRNiekpsUOqHnJJAKClaO +xdgmlOHZSOEtPtoKct2jmRXagaKH9HtuJneJWK3W6wyyQXpzbm3benhB6QiIEn6H +LmYRY2xU+zydcsC8Lv/Ct90NduM61/e0aL6i9eOBbsFGb12N4E3GVFWJGjMxCrFX +uaOKmMPsOzTFlUFpfnXCPCDFYbpRR6AgkJOhkEvzTnyFRVSa0QUmQbC1TR0zvsQD +yCV8wXDbO/QJLVQnSKwv4cSsPsjLkkxTOTcj7NMB+eAJRE1NZMDhDVqHIrytG6P+ +JrUV86f8hBnp7KGItERphIPzidF0BqnMC9bC3ieFUCbKF7jJeodWLBoBHmy+E60Q +rLUk9TiRodZL2vG70t5HtfG8gfZZa88ZU+mNFctKy6lvROUbQc/hhqfK0GqfvEyN +BjNaooXlkDWgYlwWTvDjovoDGrQscbNYLN57C9saD+veIR8GdwYDsMnvmfzAuU8L +hij+0rnq49qlw0dpEuDb8PYZi+17cNcC1u2HGCgsBCRMd+RIihrGO5rUD8r6ddIB +QFqNeb+Lz0vPqhbBleStTIo+F5HUsWLlguWABKQDfo2/2n+iD5dPDNMN+9fR5XJ+ +HMh3/1uaD7euBUbl8agW7EekFwIDAQABo4H2MIHzMIGwBgNVHREEgagwgaWBD2lu +Zm9AaXplbnBlLmNvbaSBkTCBjjFHMEUGA1UECgw+SVpFTlBFIFMuQS4gLSBDSUYg +QTAxMzM3MjYwLVJNZXJjLlZpdG9yaWEtR2FzdGVpeiBUMTA1NSBGNjIgUzgxQzBB +BgNVBAkMOkF2ZGEgZGVsIE1lZGl0ZXJyYW5lbyBFdG9yYmlkZWEgMTQgLSAwMTAx +MCBWaXRvcmlhLUdhc3RlaXowDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMC +AQYwHQYDVR0OBBYEFB0cZQ6o8iV7tJHP5LGx5r1VdGwFMA0GCSqGSIb3DQEBCwUA +A4ICAQB4pgwWSp9MiDrAyw6lFn2fuUhfGI8NYjb2zRlrrKvV9pF9rnHzP7MOeIWb +laQnIUdCSnxIOvVFfLMMjlF4rJUT3sb9fbgakEyrkgPH7UIBzg/YsfqikuFgba56 +awmqxinuaElnMIAkejEWOVt+8Rwu3WwJrfIxwYJOubv5vr8qhT/AQKM6WfxZSzwo +JNu0FXWuDYi6LnPAvViH5ULy617uHjAimcs30cQhbIHsvm0m5hzkQiCeR7Csg1lw +LDXWrzY0tM07+DKo7+N4ifuNRSzanLh+QBxh5z6ikixL8s36mLYp//Pye6kfLqCT +VyvehQP5aTfLnnhqBbTFMXiJ7HqnheG5ezzevh55hM6fcA5ZwjUukCox2eRFekGk +LhObNA5me0mrZJfQRsN5nXJQY6aYWwa9SG3YOYNw6DXwBdGqvOPbyALqfP2C2sJb +UjWumDqtujWTI6cfSN01RpiyEGjkpTHCClguGYEQyVB1/OpaFs4R1+7vUIgtYf8/ +QnMFlEPVjjxOAToZpR9GTnfQXeWBIiGH/pR9hNiTrdZoQ0iy2+tzJOeRf1SktoA+ +naM8THLCV8Sg1Mw4J87VBp6iSNnpn86CcDaTmjvfliHjWbcM2pE38P1ZWrOZyGls +QyYBNWNgVYkDOnXYukrZVP/u3oDYLdE41V4tC5h9Pmzb/CaIxw== +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIDczCCAlugAwIBAgIQMDAwMDk3Mzc1NzM4NjAwMDANBgkqhkiG9w0BAQUFADBV +MQswCQYDVQQGEwJGUjETMBEGA1UEChMKQ2VydGlOb21pczEcMBoGA1UECxMTQUMg +UmFjaW5lIC0gUm9vdCBDQTETMBEGA1UEAxMKQ2VydGlOb21pczAeFw0wMDExMDkw +MDAwMDBaFw0xMjExMDkwMDAwMDBaMFUxCzAJBgNVBAYTAkZSMRMwEQYDVQQKEwpD +ZXJ0aU5vbWlzMRwwGgYDVQQLExNBQyBSYWNpbmUgLSBSb290IENBMRMwEQYDVQQD +EwpDZXJ0aU5vbWlzMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA8SWb +4mS5RXB3ENSIcfrEzCj/TRUQuT1tMCU0YUfXFSgcPdWglIzCv3kvh07QoB+8xMl+ +fQHvSSduAxnNewz0GBY9rApCPKlP6CcnJr74OSVZIiWt9wLfl4wwhNhZOiikIpZp +EdOXWqRc84P5cUlN3Lwmr1sjCWmHfTSS4cAKxfDbFLfE61etosyoFZUTQbIhb1Bf +JL5xRXAUZudQiU42n/yAoSUrN4FLUfPQNlOe1AB81pIgX8g2ojwxDjfgqSs1JmBF +uLKJ45uVLEenQBPmQCGjL3maV86IRmR3a9UGlgvKAk0NBdh8mrQyQvcUlLBIQBCm +l7wppt6maQHUNEPQSwIDAQABoz8wPTALBgNVHQ8EBAMCAYYwDwYDVR0TAQH/BAUw +AwEB/zAdBgNVHQ4EFgQU+F4ho6ijFeb4tRG7/kIEXU2OgnowDQYJKoZIhvcNAQEF +BQADggEBACe9FJayK6bXkJQrilBFMh75QPdFOks9PJuo86OMUlBDZGYFTCh9Arex +N3KYCnAEzazYIALwr7eASJJDIQMu1Q+pkx/7ACde4kP47F27M2rm+v5HnGooCLz2 +s7Fe/WUycTQqgwF5lNp03m1ce/TvovgkEZeVN5wM/7+SsZLJGDigXGeq48j2g2hn +8OckX9Ciyo0U3/1IVeigNBisiaOlsHSZOEPBZQRiZULob+NVbXVPo8nM1OyP3aHI +LQex1yYcCr9m93nOiZyKkur3Uedf1yMTBe+fflnPFKGYnVqvTGXCKVdHzQBfpILA +AuaC+5ykZhSiSMf8nmL2oPMcLO7YQw4= +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIDwzCCAqugAwIBAgIBATANBgkqhkiG9w0BAQsFADCBgjELMAkGA1UEBhMCREUx +KzApBgNVBAoMIlQtU3lzdGVtcyBFbnRlcnByaXNlIFNlcnZpY2VzIEdtYkgxHzAd +BgNVBAsMFlQtU3lzdGVtcyBUcnVzdCBDZW50ZXIxJTAjBgNVBAMMHFQtVGVsZVNl +YyBHbG9iYWxSb290IENsYXNzIDMwHhcNMDgxMDAxMTAyOTU2WhcNMzMxMDAxMjM1 +OTU5WjCBgjELMAkGA1UEBhMCREUxKzApBgNVBAoMIlQtU3lzdGVtcyBFbnRlcnBy +aXNlIFNlcnZpY2VzIEdtYkgxHzAdBgNVBAsMFlQtU3lzdGVtcyBUcnVzdCBDZW50 +ZXIxJTAjBgNVBAMMHFQtVGVsZVNlYyBHbG9iYWxSb290IENsYXNzIDMwggEiMA0G +CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC9dZPwYiJvJK7genasfb3ZJNW4t/zN +8ELg63iIVl6bmlQdTQyK9tPPcPRStdiTBONGhnFBSivwKixVA9ZIw+A5OO3yXDw/ +RLyTPWGrTs0NvvAgJ1gORH8EGoel15YUNpDQSXuhdfsaa3Ox+M6pCSzyU9XDFES4 +hqX2iys52qMzVNn6chr3IhUciJFrf2blw2qAsCTz34ZFiP0Zf3WHHx+xGwpzJFu5 +ZeAsVMhg02YXP+HMVDNzkQI6pn97djmiH5a2OK61yJN0HZ65tOVgnS9W0eDrXltM +EnAMbEQgqxHY9Bn20pxSN+f6tsIxO0rUFJmtxxr1XV/6B7h8DR/Wgx6zAgMBAAGj +QjBAMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBS1 +A/d2O2GCahKqGFPrAyGUv/7OyjANBgkqhkiG9w0BAQsFAAOCAQEAVj3vlNW92nOy +WL6ukK2YJ5f+AbGwUgC4TeQbIXQbfsDuXmkqJa9c1h3a0nnJ85cp4IaH3gRZD/FZ +1GSFS5mvJQQeyUapl96Cshtwn5z2r3Ex3XsFpSzTucpH9sry9uetuUg/vBa3wW30 +6gmv7PO15wWeph6KU1HWk4HMdJP2udqmJQV0eVp+QD6CSyYRMG7hP0HHRwA11fXT +91Q+gT3aSWqas+8QPebrb9HIIkfLzM8BMZLZGOMivgkeGj5asuRrDFR6fUNOuIml +e9eiPZaGzPImNC1qkp2aGtAw4l1OBLBfiyB+d8E9lYLRRpo7PHi4b6HQDWSieB4p +TpPDpFQUWw== +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIDujCCAqKgAwIBAgILBAAAAAABD4Ym5g0wDQYJKoZIhvcNAQEFBQAwTDEgMB4G +A1UECxMXR2xvYmFsU2lnbiBSb290IENBIC0gUjIxEzARBgNVBAoTCkdsb2JhbFNp +Z24xEzARBgNVBAMTCkdsb2JhbFNpZ24wHhcNMDYxMjE1MDgwMDAwWhcNMjExMjE1 +MDgwMDAwWjBMMSAwHgYDVQQLExdHbG9iYWxTaWduIFJvb3QgQ0EgLSBSMjETMBEG +A1UEChMKR2xvYmFsU2lnbjETMBEGA1UEAxMKR2xvYmFsU2lnbjCCASIwDQYJKoZI +hvcNAQEBBQADggEPADCCAQoCggEBAKbPJA6+Lm8omUVCxKs+IVSbC9N/hHD6ErPL +v4dfxn+G07IwXNb9rfF73OX4YJYJkhD10FPe+3t+c4isUoh7SqbKSaZeqKeMWhG8 +eoLrvozps6yWJQeXSpkqBy+0Hne/ig+1AnwblrjFuTosvNYSuetZfeLQBoZfXklq +tTleiDTsvHgMCJiEbKjNS7SgfQx5TfC4LcshytVsW33hoCmEofnTlEnLJGKRILzd +C9XZzPnqJworc5HGnRusyMvo4KD0L5CLTfuwNhv2GXqF4G3yYROIXJ/gkwpRl4pa +zq+r1feqCapgvdzZX99yqWATXgAByUr6P6TqBwMhAo6CygPCm48CAwEAAaOBnDCB +mTAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUm+IH +V2ccHsBqBt5ZtJot39wZhi4wNgYDVR0fBC8wLTAroCmgJ4YlaHR0cDovL2NybC5n +bG9iYWxzaWduLm5ldC9yb290LXIyLmNybDAfBgNVHSMEGDAWgBSb4gdXZxwewGoG +3lm0mi3f3BmGLjANBgkqhkiG9w0BAQUFAAOCAQEAmYFThxxol4aR7OBKuEQLq4Gs +J0/WwbgcQ3izDJr86iw8bmEbTUsp9Z8FHSbBuOmDAGJFtqkIk7mpM0sYmsL4h4hO +291xNBrBVNpGP+DTKqttVCL1OmLNIG+6KYnX3ZHu01yiPqFbQfXf5WRDLenVOavS +ot+3i9DAgBkcRcAtjOj4LaR0VknFBbVPFd5uRHg5h6h+u/N5GJG79G+dwfCMNYxd +AfvDbbnvRG15RjF+Cv6pgsH/76tuIMRQyV+dTZsXjAzlAcmgQWpzU/qlULRuJQ/7 +TBj0/VLZjmmx6BEP3ojY+x1J96relc8geMJgEtslQIxq/H5COEBkEveegeGTLg== +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIDoTCCAomgAwIBAgIQKTZHquOKrIZKI1byyrdhrzANBgkqhkiG9w0BAQUFADBO +MQswCQYDVQQGEwJ1czEYMBYGA1UEChMPVS5TLiBHb3Zlcm5tZW50MQ0wCwYDVQQL +EwRGQkNBMRYwFAYDVQQDEw1Db21tb24gUG9saWN5MB4XDTA3MTAxNTE1NTgwMFoX +DTI3MTAxNTE2MDgwMFowTjELMAkGA1UEBhMCdXMxGDAWBgNVBAoTD1UuUy4gR292 +ZXJubWVudDENMAsGA1UECxMERkJDQTEWMBQGA1UEAxMNQ29tbW9uIFBvbGljeTCC +ASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAJeNvTMn5K1b+3i9L0dHbsd4 +6ZOcpN7JHP0vGzk4rEcXwH53KQA7Ax9oD81Npe53uCxiazH2+nIJfTApBnznfKM9 +hBiKHa4skqgf6F5PjY7rPxr4nApnnbBnTfAu0DDew5SwoM8uCjR/VAnTNr2kSVdS +c+md/uRIeUYbW40y5KVIZPMiDZKdCBW/YDyD90ciJSKtKXG3d+8XyaK2lF7IMJCk +FEhcVlcLQUwF1CpMP64Sm1kRdXAHImktLNMxzJJ+zM2kfpRHqpwJCPZLr1LoakCR +xVW9QLHIbVeGlRfmH3O+Ry4+i0wXubklHKVSFzYIWcBCvgortFZRPBtVyYyQd+sC +AwEAAaN7MHkwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0O +BBYEFC9Yl9ipBZilVh/72at17wI8NjTHMBIGCSsGAQQBgjcVAQQFAgMBAAEwIwYJ +KwYBBAGCNxUCBBYEFHa3YJbdFFYprHWF03BjwbxHhhyLMA0GCSqGSIb3DQEBBQUA +A4IBAQBgrvNIFkBypgiIybxHLCRLXaCRc+1leJDwZ5B6pb8KrbYq+Zln34PFdx80 +CTj5fp5B4Ehg/uKqXYeI6oj9XEWyyWrafaStsU+/HA2fHprA1RRzOCuKeEBuMPdi +4c2Z/FFpZ2wR3bgQo2jeJqVW/TZsN5hs++58PGxrcD/3SDcJjwtCga1GRrgLgwb0 +Gzigf0/NC++DiYeXHIowZ9z9VKEDfgHLhUyxCynDvux84T8PCVI8L6eaSP436REG +WOE2QYrEtr+O3c5Ks7wawM36GpnScZv6z7zyxFSjiDV2zBssRm8MtNHDYXaSdBHq +S4CNHIkRi+xb/xfJSPzn4AYR4oRe +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIFYzCCA0ugAwIBAgIBOzANBgkqhkiG9w0BAQsFADBTMQswCQYDVQQGEwJJTDEW +MBQGA1UEChMNU3RhcnRDb20gTHRkLjEsMCoGA1UEAxMjU3RhcnRDb20gQ2VydGlm +aWNhdGlvbiBBdXRob3JpdHkgRzIwHhcNMTAwMTAxMDEwMDAxWhcNMzkxMjMxMjM1 +OTAxWjBTMQswCQYDVQQGEwJJTDEWMBQGA1UEChMNU3RhcnRDb20gTHRkLjEsMCoG +A1UEAxMjU3RhcnRDb20gQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgRzIwggIiMA0G +CSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQC2iTZbB7cgNr2Cu+EWIAOVeq8Oo1XJ +JZlKxdBWQYeQTSFgpBSHO839sj60ZwNq7eEPS8CRhXBF4EKe3ikj1AENoBB5uNsD +vfOpL9HG4A/LnooUCri99lZi8cVytjIl2bLzvWXFDSxu1ZJvGIsAQRSCb0AgJnoo +D/Uefyf3lLE3PbfHkffiAez9lInhzG7TNtYKGXmu1zSCZf98Qru23QumNK9LYP5/ +Q0kGi4xDuFby2X8hQxfqp0iVAXV16iulQ5XqFYSdCI0mblWbq9zSOdIxHWDirMxW +RST1HFSr7obdljKF+ExP6JV2tgXdNiNnvP8V4so75qbsO+wmETRIjfaAKxojAuuK +HDp2KntWFhxyKrOq42ClAJ8Em+JvHhRYW6Vsi1g8w7pOOlz34ZYrPu8HvKTlXcxN +nw3h3Kq74W4a7I/htkxNeXJdFzULHdfBR9qWJODQcqhaX2YtENwvKhOuJv4KHBnM +0D4LnMgJLvlblnpHnOl68wVQdJVznjAJ85eCXuaPOQgeWeU1FEIT/wCc976qUM/i +UUjXuG+v+E5+M5iSFGI6dWPPe/regjupuznixL0sAA7IF6wT700ljtizkC+p2il9 +Ha90OrInwMEePnWjFqmveiJdnxMaz6eg6+OGCtP95paV1yPIN93EfKo2rJgaErHg +TuixO/XWb/Ew1wIDAQABo0IwQDAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQE +AwIBBjAdBgNVHQ4EFgQUS8W0QGutHLOlHGVuRjaJhwUMDrYwDQYJKoZIhvcNAQEL +BQADggIBAHNXPyzVlTJ+N9uWkusZXn5T50HsEbZH77Xe7XRcxfGOSeD8bpkTzZ+K +2s06Ctg6Wgk/XzTQLwPSZh0avZyQN8gMjgdalEVGKua+etqhqaRpEpKwfTbURIfX +UfEpY9Z1zRbkJ4kd+MIySP3bmdCPX1R0zKxnNBFi2QwKN4fRoxdIjtIXHfbX/dtl +6/2o1PXWT6RbdejF0mCy2wl+JYt7ulKSnj7oxXehPOBKc2thz4bcQ///If4jXSRK +9dNtD2IEBVeC2m6kMyV5Sy5UGYvMLD0w6dEG/+gyRr61M3Z3qAFdlsHB1b6uJcDJ +HgoJIIihDsnzb02CVAAgp9KP5DlUFy6NHrgbuxu9mk47EDTcnIhT76IxW1hPkWLI +wpqazRVdOKnWvvgTtZ8SafJQYqz7Fzf07rh1Z2AQ+4NQ+US1dZxAF7L+/XldblhY +XzD8AK6vM8EOTmy6p6ahfzLbOOCxchcKK5HsamMm7YnUeMx0HgX4a/6ManY5Ka5l +IxKVCCIcl85bBu4M4ru8H0ST9tg4RQUh7eStqxK2A6RCLi3ECToDZ2mEmuFZkIoo +hdVddLHRDiBYmxOlsGOm7XtH/UVVMKTumtTm4ofvmMkyghEpIrwACjFeLQ/Ajulr +so8uBtjRkcfGEvRM/TAXw8HaOFvjqermobp573PYtlNXLfbQ4ddI +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIDIDCCAgigAwIBAgIBHTANBgkqhkiG9w0BAQUFADA5MQswCQYDVQQGEwJGSTEP +MA0GA1UEChMGU29uZXJhMRkwFwYDVQQDExBTb25lcmEgQ2xhc3MyIENBMB4XDTAx +MDQwNjA3Mjk0MFoXDTIxMDQwNjA3Mjk0MFowOTELMAkGA1UEBhMCRkkxDzANBgNV +BAoTBlNvbmVyYTEZMBcGA1UEAxMQU29uZXJhIENsYXNzMiBDQTCCASIwDQYJKoZI +hvcNAQEBBQADggEPADCCAQoCggEBAJAXSjWdyvANlsdE+hY3/Ei9vX+ALTU74W+o +Z6m/AxxNjG8yR9VBaKQTBME1DJqEQ/xcHf+Js+gXGM2RX/uJ4+q/Tl18GybTdXnt +5oTjV+WtKcT0OijnpXuENmmz/V52vaMtmdOQTiMofRhj8VQ7Jp12W5dCsv+u8E7s +3TmVToMGf+dJQMjFAbJUWmYdPfz56TwKnoG4cPABi+QjVHzIrviQHgCWctRUz2Ej +vOr7nQKV0ba5cTppCD8PtOFCx4j1P5iop7oc4HFx71hXgVB6XGt0Rg6DA5jDjqhu +8nYybieDwnPz3BjotJPqdURrBGAgcVeHnfO+oJAjPYok4doh28MCAwEAAaMzMDEw +DwYDVR0TAQH/BAUwAwEB/zARBgNVHQ4ECgQISqCqWITTXjwwCwYDVR0PBAQDAgEG +MA0GCSqGSIb3DQEBBQUAA4IBAQBazof5FnIVV0sd2ZvnoiYw7JNn39Yt0jSv9zil +zqsWuasvfDXLrNAPtEwr/IDva4yRXzZ299uzGxnq9LIR/WFxRL8oszodv7ND6J+/ +3DEIcbCdjdY0RzKQxmUk96BKfARzjzlvF4xytb1LyHr4e4PDKE6cCepnP7JnBBvD +FNr450kkkdAdavphOe9r5yF1BgfYErQhIHBCcYHaPJo2vqZbDWpsmh+Re/n570K6 +Tk6ezAyNlNzZRZxe7EJQY670XcSxEtzKO6gunRRaBXW37Ndj4ro1tgQIkejanZz2 +ZrUYrAqmVCY0M9IbwdR/GjqOC6oybtv8TyWf2TLHllpwrN9M +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIDoDCCAoigAwIBAgIBMTANBgkqhkiG9w0BAQUFADA5MQswCQYDVQQGEwJKUDEO +MAwGA1UEChMFTEdQS0kxGjAYBgNVBAsTEUFwcGxpY2F0aW9uIENBIEcyMB4XDTA2 +MDMzMTE1MDAwMFoXDTE2MDMzMTE0NTk1OVowOTELMAkGA1UEBhMCSlAxDjAMBgNV +BAoTBUxHUEtJMRowGAYDVQQLExFBcHBsaWNhdGlvbiBDQSBHMjCCASIwDQYJKoZI +hvcNAQEBBQADggEPADCCAQoCggEBALk1xhD422jbB8RATLAdHjbcw0H2z1UVbQh/ +XMZoVeXnV/GWUebhTXgPbkAVcDtl/hHf59PWWDU74Z8C/JRSRi6znmCbAp7JgtL2 +464JT4REtmKbAFFouDqt7GTRMkvplESDtA7OIYlrsDbAmMZLnMI+W2AqCTErLatM +3rGg/VhWwoMdILzEhAmHe6iVl8YljoPgPpMN0cd9c6mo/BkAQC4iuHozQfV4/Vpx +54LZSIhc7KiFhy1tgIlnGmm+EMBaju2IfT5vLDhrN85H2KIxMN5+U2Vsi4ZTQSBs +vUilfq8AWlYSWIHR3IlZ+bXu+E2a2EQpi3mn9yKq6nxctBaIIA0CAwEAAaOBsjCB +rzAdBgNVHQ4EFgQUf7hdjsQYa8Z9zC7prs405xdd4KEwDgYDVR0PAQH/BAQDAgEG +MEwGA1UdHwRFMEMwQaA/oD2kOzA5MQswCQYDVQQGEwJKUDEOMAwGA1UEChMFTEdQ +S0kxGjAYBgNVBAsTEUFwcGxpY2F0aW9uIENBIEcyMA8GA1UdEwEB/wQFMAMBAf8w +HwYDVR0jBBgwFoAUf7hdjsQYa8Z9zC7prs405xdd4KEwDQYJKoZIhvcNAQEFBQAD +ggEBADzYczZABkhKVBn1J0g5JaVuQue2zRvLOTS3m+xPKr535MqE/B3rmyJA1fT7 +aIdy/Eddag5SSuO1XUjGIpbmM21tq/bN18skWoyoRZ4+YYJ9lNUF8Bo1X3EvLlS1 +QQXvhg1S75yYG/EsTDrR84bTjD56L4ZFjoMyJlu/U8oOUVbcmsJaMBkNp57Vqpsg +OWl4IfSXbdEOEUwu0xtasPmXeFwqj1Jl7kxCJcI3MA5tKzWUgwbor0U7BGanMLv5 +4CE7Y259RF06alPvERck/VSyWmxzViHJbC2XpEKzJ2EFIWNt6ii8TxpvQtyYq1XT +HhvAkj+bweY7F1bixJhDJe62ywA= +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIICZzCCAdCgAwIBAgIBBDANBgkqhkiG9w0BAQUFADBhMQswCQYDVQQGEwJVUzEY +MBYGA1UEChMPVS5TLiBHb3Zlcm5tZW50MQwwCgYDVQQLEwNEb0QxDDAKBgNVBAsT +A1BLSTEcMBoGA1UEAxMTRG9EIENMQVNTIDMgUm9vdCBDQTAeFw0wMDA1MTkxMzEz +MDBaFw0yMDA1MTQxMzEzMDBaMGExCzAJBgNVBAYTAlVTMRgwFgYDVQQKEw9VLlMu +IEdvdmVybm1lbnQxDDAKBgNVBAsTA0RvRDEMMAoGA1UECxMDUEtJMRwwGgYDVQQD +ExNEb0QgQ0xBU1MgMyBSb290IENBMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKB +gQC1MP5kvurMbe2BLPd/6Rm6DmlqKOGpqcuVWB/x5pppU+CIP5HFUbljl6jmIYwT +XjY8qFf6+HAsTGrLvzCnTBbkMlz4ErBR+BZXjS+0TfouqJToKmHUVw1Hzm4sL36Y +Z8wACKu2lhY1woWR5VugCsdmUmLzYXWVF668KlYppeArUwIDAQABoy8wLTAdBgNV +HQ4EFgQUbJyl8FyPbUGNxBc7kFfCD6PNbf4wDAYDVR0TBAUwAwEB/zANBgkqhkiG +9w0BAQUFAAOBgQCvcUT5lyPMaGmMQwdBuoggsyIAQciYoFUczT9usZNcrfoYmrsc +c2/9JEKPh59Rz76Gn+nXikhPCNlplKw/5g8tlw8ok3ZPYt//oM1h+KaGDDE0INx/ +L6j7Ob6V7jhZAmLB3mwVT+DfnbvkeXMk/WNklfdKqJkfSGWVx3u/eDLneg== +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIFUjCCBDqgAwIBAgIBAjANBgkqhkiG9w0BAQUFADBkMQswCQYDVQQGEwJLUjEN +MAsGA1UEChMES0lTQTEuMCwGA1UECxMlS29yZWEgQ2VydGlmaWNhdGlvbiBBdXRo +b3JpdHkgQ2VudHJhbDEWMBQGA1UEAxMNS0lTQSBSb290Q0EgMzAeFw0wNDExMTkw +NjM5NTFaFw0xNDExMTkwNjM5NTFaMGQxCzAJBgNVBAYTAktSMQ0wCwYDVQQKEwRL +SVNBMS4wLAYDVQQLEyVLb3JlYSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSBDZW50 +cmFsMRYwFAYDVQQDEw1LSVNBIFJvb3RDQSAzMIIBIDANBgkqhkiG9w0BAQEFAAOC +AQ0AMIIBCAKCAQEA3rrtF2Wu0b1KPazbgHLMWOHn4ZPazDB6z+8Lri2nQ6u/p0LP +CFYIpEcdffqG79gwlyY0YTyADvjU65/8IjAboW0+40zSVU4WQDfC9gdu2we1pYyW +geKbXH6UYcjOhDyx+gDmctMJhXfp3F4hT7TkTvTiF6tQrxz/oTlYdVsSspa5jfBw +YkhbVigqpYeRNrkeJPW5unu2UlFbF1pgBWycwubGjD756t08jP+J3kNwrB248XXN +OMpTDUdoasY8GMq94bS+DvTQ49IT+rBRERHUQavo9DmO4TSETwuTqmo4/OXGeEeu +dhf6oYA3BgAVCP1rI476cg2V1ktisWjC3TSbXQIBA6OCAg8wggILMB8GA1UdIwQY +MBaAFI+B8NqmzXQ8vmb0FWtGpP4GKMyqMB0GA1UdDgQWBBSPgfDaps10PL5m9BVr +RqT+BijMqjAOBgNVHQ8BAf8EBAMCAQYwggEuBgNVHSAEggElMIIBITCCAR0GBFUd +IAAwggETMDAGCCsGAQUFBwIBFiRodHRwOi8vd3d3LnJvb3RjYS5vci5rci9yY2Ev +Y3BzLmh0bWwwgd4GCCsGAQUFBwICMIHRHoHOx3QAIMd4yZ3BHLKUACCs9cd4x3jJ +ncEcx4WyyLLkACgAVABoAGkAcwAgAGMAZQByAHQAaQBmAGkAYwBhAHQAZQAgAGkA +cwAgAGEAYwBjAHIAZQBkAGkAdABlAGQAIAB1AG4AZABlAHIAIABFAGwAZQBjAHQA +cgBvAG4AaQBjACAAUwBpAGcAbgBhAHQAdQByAGUAIABBAGMAdAAgAG8AZgAgAHQA +aABlACAAUgBlAHAAdQBiAGwAaQBjACAAbwBmACAASwBvAHIAZQBhACkwMwYDVR0R +BCwwKqQoMCYxJDAiBgNVBAMMG+2VnOq1reygleuztOuztO2YuOynhO2dpeybkDAz +BgNVHRIELDAqpCgwJjEkMCIGA1UEAwwb7ZWc6rWt7KCV67O067O07Zi47KeE7Z2l +7JuQMA8GA1UdEwEB/wQFMAMBAf8wDAYDVR0kBAUwA4ABADANBgkqhkiG9w0BAQUF +AAOCAQEAz9b3Dv2wjG4FFY6oXCuyWtEeV6ZeGKqCEQj8mbdbp+PI0qLT+SQ09+Pk +rolUR9NpScmAwRHr4inH9gaLX7riXs+rw87P7pIl3J85Hg4D9N6QW6FwmVzHc07J +pHVJeyWhn4KSjU3sYcUMMqfHODiAVToqgx2cZHm5Dac1Smjvj/8F2LpOVmHY+Epw +mAiWk9hgxzrsX58dKzVPSBShmrtv7tIDhlPxEMcHVGJeNo7iHCsdF03m9VrvirqC +6HfZKBF+N4dKlArJQOk1pTr7ZD7yXxZ683bXzu4/RB1Fql8RqlMcOh9SUWJUD6OQ +Nc9Nb7rHviwJ8TX4Absk3TC8SA/u2Q== +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIDXzCCAkegAwIBAgILBAAAAAABIVhTCKIwDQYJKoZIhvcNAQELBQAwTDEgMB4G +A1UECxMXR2xvYmFsU2lnbiBSb290IENBIC0gUjMxEzARBgNVBAoTCkdsb2JhbFNp +Z24xEzARBgNVBAMTCkdsb2JhbFNpZ24wHhcNMDkwMzE4MTAwMDAwWhcNMjkwMzE4 +MTAwMDAwWjBMMSAwHgYDVQQLExdHbG9iYWxTaWduIFJvb3QgQ0EgLSBSMzETMBEG +A1UEChMKR2xvYmFsU2lnbjETMBEGA1UEAxMKR2xvYmFsU2lnbjCCASIwDQYJKoZI +hvcNAQEBBQADggEPADCCAQoCggEBAMwldpB5BngiFvXAg7aEyiie/QV2EcWtiHL8 +RgJDx7KKnQRfJMsuS+FggkbhUqsMgUdwbN1k0ev1LKMPgj0MK66X17YUhhB5uzsT +gHeMCOFJ0mpiLx9e+pZo34knlTifBtc+ycsmWQ1z3rDI6SYOgxXG71uL0gRgykmm +KPZpO/bLyCiR5Z2KYVc3rHQU3HTgOu5yLy6c+9C7v/U9AOEGM+iCK65TpjoWc4zd +QQ4gOsC0p6Hpsk+QLjJg6VfLuQSSaGjlOCZgdbKfd/+RFO+uIEn8rUAVSNECMWEZ +XriX7613t2Saer9fwRPvm2L7DWzgVGkWqQPabumDk3F2xmmFghcCAwEAAaNCMEAw +DgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFI/wS3+o +LkUkrk1Q+mOai97i3Ru8MA0GCSqGSIb3DQEBCwUAA4IBAQBLQNvAUKr+yAzv95ZU +RUm7lgAJQayzE4aGKAczymvmdLm6AC2upArT9fHxD4q/c2dKg8dEe3jgr25sbwMp +jjM5RcOO5LlXbKr8EpbsU8Yt5CRsuZRj+9xTaGdWPoO4zzUhw8lo/s7awlOqzJCK +6fBdRoyV3XpYKBovHd7NADdBj+1EbddTKJd+82cEHhXXipa0095MJ6RMG3NzdvQX +mcIfeg7jLQitChws/zyrVQ4PkX4268NXSb7hLi18YIvDQVETI53O9zJrlAGomecs +Mx86OyXShkDOOyyGeMlhLxS67ttVb9+E7gUJTb0o2HLO02JQZR7rkpeDMdmztcpH +WD9f +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIC+TCCAoCgAwIBAgINAKaLeSkAAAAAUNCR+TAKBggqhkjOPQQDAzCBvzELMAkG +A1UEBhMCVVMxFjAUBgNVBAoTDUVudHJ1c3QsIEluYy4xKDAmBgNVBAsTH1NlZSB3 +d3cuZW50cnVzdC5uZXQvbGVnYWwtdGVybXMxOTA3BgNVBAsTMChjKSAyMDEyIEVu +dHJ1c3QsIEluYy4gLSBmb3IgYXV0aG9yaXplZCB1c2Ugb25seTEzMDEGA1UEAxMq +RW50cnVzdCBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5IC0gRUMxMB4XDTEy +MTIxODE1MjUzNloXDTM3MTIxODE1NTUzNlowgb8xCzAJBgNVBAYTAlVTMRYwFAYD +VQQKEw1FbnRydXN0LCBJbmMuMSgwJgYDVQQLEx9TZWUgd3d3LmVudHJ1c3QubmV0 +L2xlZ2FsLXRlcm1zMTkwNwYDVQQLEzAoYykgMjAxMiBFbnRydXN0LCBJbmMuIC0g +Zm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxMzAxBgNVBAMTKkVudHJ1c3QgUm9vdCBD +ZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEVDMTB2MBAGByqGSM49AgEGBSuBBAAi +A2IABIQTydC6bUF74mzQ61VfZgIaJPRbiWlH47jCffHyAsWfoPZb1YsGGYZPUxBt +ByQnoaD41UcZYUx9ypMn6nQM72+WCf5j7HBdNq1nd67JnXxVRDqiY1Ef9eNi1KlH +Bz7MIKNCMEAwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0O +BBYEFLdj5xrdjekIplWDpOBqUEFlEUJJMAoGCCqGSM49BAMDA2cAMGQCMGF52OVC +R98crlOZF7ZvHH3hvxGU0QOIdeSNiaSKd0bebWHvAvX7td/M/k7//qnmpwIwW5nX +hTcGtXsI/esni0qU+eH6p44mCOh8kmhtc9hvJqwhAriZtyZBWyVgrtBIGu4G +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIHTzCCBTegAwIBAgIJAKPaQn6ksa7aMA0GCSqGSIb3DQEBBQUAMIGuMQswCQYD +VQQGEwJFVTFDMEEGA1UEBxM6TWFkcmlkIChzZWUgY3VycmVudCBhZGRyZXNzIGF0 +IHd3dy5jYW1lcmZpcm1hLmNvbS9hZGRyZXNzKTESMBAGA1UEBRMJQTgyNzQzMjg3 +MRswGQYDVQQKExJBQyBDYW1lcmZpcm1hIFMuQS4xKTAnBgNVBAMTIENoYW1iZXJz +IG9mIENvbW1lcmNlIFJvb3QgLSAyMDA4MB4XDTA4MDgwMTEyMjk1MFoXDTM4MDcz +MTEyMjk1MFowga4xCzAJBgNVBAYTAkVVMUMwQQYDVQQHEzpNYWRyaWQgKHNlZSBj +dXJyZW50IGFkZHJlc3MgYXQgd3d3LmNhbWVyZmlybWEuY29tL2FkZHJlc3MpMRIw +EAYDVQQFEwlBODI3NDMyODcxGzAZBgNVBAoTEkFDIENhbWVyZmlybWEgUy5BLjEp +MCcGA1UEAxMgQ2hhbWJlcnMgb2YgQ29tbWVyY2UgUm9vdCAtIDIwMDgwggIiMA0G +CSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCvAMtwNyuAWko6bHiUfaN/Gh/2NdW9 +28sNRHI+JrKQUrpjOyhYb6WzbZSm891kDFX29ufyIiKAXuFixrYp4YFs8r/lfTJq +VKAyGVn+H4vXPWCGhSRv4xGzdz4gljUha7MI2XAuZPeEklPWDrCQiorjh40G072Q +DuKZoRuGDtqaCrsLYVAGUvGef3bsyw/QHg3PmTA9HMRFEFis1tPo1+XqxQEHd9ZR +5gN/ikilTWh1uem8nk4ZcfUyS5xtYBkL+8ydddy/Js2Pk3g5eXNeJQ7KXOt3EgfL +ZEFHcpOrUMPrCXZkNNI5t3YRCQ12RcSprj1qr7V9ZS+UWBDsXHyvfuK2GNnQm05a +Sd+pZgvMPMZ4fKecHePOjlO+Bd5gD2vlGts/4+EhySnB8esHnFIbAURRPHsl18Tl +UlRdJQfKFiC4reRB7noI/plvg6aRArBsNlVq5331lubKgdaX8ZSD6e2wsWsSaR6s ++12pxZjptFtYer49okQ6Y1nUCyXeG0+95QGezdIp1Z8XGQpvvwyQ0wlf2eOKNcx5 +Wk0ZN5K3xMGtr/R5JJqyAQuxr1yW84Ay+1w9mPGgP0revq+ULtlVmhduYJ1jbLhj +ya6BXBg14JC7vjxPNyK5fuvPnnchpj04gftI2jE9K+OJ9dC1vX7gUMQSibMjmhAx +hduub+84Mxh2EQIDAQABo4IBbDCCAWgwEgYDVR0TAQH/BAgwBgEB/wIBDDAdBgNV +HQ4EFgQU+SSsD7K1+HnA+mCIG8TZTQKeFxkwgeMGA1UdIwSB2zCB2IAU+SSsD7K1 ++HnA+mCIG8TZTQKeFxmhgbSkgbEwga4xCzAJBgNVBAYTAkVVMUMwQQYDVQQHEzpN +YWRyaWQgKHNlZSBjdXJyZW50IGFkZHJlc3MgYXQgd3d3LmNhbWVyZmlybWEuY29t +L2FkZHJlc3MpMRIwEAYDVQQFEwlBODI3NDMyODcxGzAZBgNVBAoTEkFDIENhbWVy +ZmlybWEgUy5BLjEpMCcGA1UEAxMgQ2hhbWJlcnMgb2YgQ29tbWVyY2UgUm9vdCAt +IDIwMDiCCQCj2kJ+pLGu2jAOBgNVHQ8BAf8EBAMCAQYwPQYDVR0gBDYwNDAyBgRV +HSAAMCowKAYIKwYBBQUHAgEWHGh0dHA6Ly9wb2xpY3kuY2FtZXJmaXJtYS5jb20w +DQYJKoZIhvcNAQEFBQADggIBAJASryI1wqM58C7e6bXpeHxIvj99RZJe6dqxGfwW +PJ+0W2aeaufDuV2I6A+tzyMP3iU6XsxPpcG1Lawk0lgH3qLPaYRgM+gQDROpI9CF +5Y57pp49chNyM/WqfcZjHwj0/gF/JM8rLFQJ3uIrbZLGOU8W6jx+ekbURWpGqOt1 +glanq6B8aBMz9p0w8G8nOSQjKpD9kCk18pPfNKXG9/jvjA9iSnyu0/VU+I22mlaH +FoI6M6taIgj3grrqLuBHmrS1RaMFO9ncLkVAO+rcf+g769HsJtg1pDDFOqxXnrN2 +pSB7+R5KBWIBpih1YJeSDW4+TTdDDZIVnBgizVGZoCkaPF+KMjNbMMeJL0eYD6MD +xvbxrN8y8NmBGuScvfaAFPDRLLmF9dijscilIeUcE5fuDr3fKanvNFNb0+RqE4QG +tjICxFKuItLcsiFCGtpA8CnJ7AoMXOLQusxI0zcKzBIKinmwPQN/aUv0NCB9szTq +jktk9T79syNnFQ0EuPAtwQlRPLJsFfClI9eDdOTlLsn+mCdCxqvGnrDQWzilm1De +fhiYtUU79nm06PcaewaD+9CL2rvHvRirCG88gGtAPxkZumWK5r7VXNM21+9AUiRg +OGcEMeyP84LG3rlV8zsxkVrctQgVrXYlCg17LofiDKYGvCYQbTed7N14jHyAxfDZ +d0jQ +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIFujCCA6KgAwIBAgIJALtAHEP1Xk+wMA0GCSqGSIb3DQEBBQUAMEUxCzAJBgNV +BAYTAkNIMRUwEwYDVQQKEwxTd2lzc1NpZ24gQUcxHzAdBgNVBAMTFlN3aXNzU2ln +biBHb2xkIENBIC0gRzIwHhcNMDYxMDI1MDgzMDM1WhcNMzYxMDI1MDgzMDM1WjBF +MQswCQYDVQQGEwJDSDEVMBMGA1UEChMMU3dpc3NTaWduIEFHMR8wHQYDVQQDExZT +d2lzc1NpZ24gR29sZCBDQSAtIEcyMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIIC +CgKCAgEAr+TufoskDhJuqVAtFkQ7kpJcyrhdhJJCEyq8ZVeCQD5XJM1QiyUqt2/8 +76LQwB8CJEoTlo8jE+YoWACjR8cGp4QjK7u9lit/VcyLwVcfDmJlD909Vopz2q5+ +bbqBHH5CjCA12UNNhPqE21Is8w4ndwtrvxEvcnifLtg+5hg3Wipy+dpikJKVyh+c +6bM8K8vzARO/Ws/BtQpgvd21mWRTuKCWs2/iJneRjOBiEAKfNA+k1ZIzUd6+jbqE +emA8atufK+ze3gE/bk3lUIbLtK/tREDFylqM2tIrfKjuvqblCqoOpd8FUrdVxyJd +MmqXl2MT28nbeTZ7hTpKxVKJ+STnnXepgv9VHKVxaSvRAiTysybUa9oEVeXBCsdt +MDeQKuSeFDNeFhdVxVu1yzSJkvGdJo+hB9TGsnhQ2wwMC3wLjEHXuendjIj3o02y +MszYF9rNt85mndT9Xv+9lz4pded+p2JYryU0pUHHPbwNUMoDAw8IWh+Vc3hiv69y +FGkOpeUDDniOJihC8AcLYiAQZzlG+qkDzAQ4embvIIO1jEpWjpEA/I5cgt6IoMPi +aG59je883WX0XaxR7ySArqpWl2/5rX3aYT+YdzylkbYcjCbaZaIJbcHiVOO5ykxM +gI93e2CaHt+28kgeDrpOVG2Y4OGiGqJ3UM/EY5LsRxmd6+ZrzsECAwEAAaOBrDCB +qTAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUWyV7 +lqRlUX64OfPAeGZe6Drn8O4wHwYDVR0jBBgwFoAUWyV7lqRlUX64OfPAeGZe6Drn +8O4wRgYDVR0gBD8wPTA7BglghXQBWQECAQEwLjAsBggrBgEFBQcCARYgaHR0cDov +L3JlcG9zaXRvcnkuc3dpc3NzaWduLmNvbS8wDQYJKoZIhvcNAQEFBQADggIBACe6 +45R88a7A3hfm5djV9VSwg/S7zV4Fe0+fdWavPOhWfvxyeDgD2StiGwC5+OlgzczO +UYrHUDFu4Up+GC9pWbY9ZIEr44OE5iKHjn3g7gKZYbge9LgriBIWhMIxkziWMaa5 +O1M/wySTVltpkuzFwbs4AOPsF6m43Md8AYOfMke6UiI0HTJ6CVanfCU2qT1L2sCC +bwq7EsiHSycR+R4tx5M/nttfJmtS2S6K8RTGRI0Vqbe/vd6mGu6uLftIdxf+u+yv +GPUqUfA5hJeVbG4bwyvEdGB5JbAKJ9/fXtI5z0V9QkvfsywexcZdylU6oJxpmo/a +77KwPJ+HbBIrZXAVUjEaJM9vMSNQH4xPjyPDdEFjHFWoFN0+4FFQz/EbMFYOkrCC +hdiDyyJkvC24JdVUorgG6q2SpCSgwYa1ShNqR88uC1aVVMvOmttqtKay20EIhid3 +92qgQmwLOM7XdVAyksLfKzAiSNDVQTglXaTpXZ/GlHXQRf0wl0OPkKsKx4ZzYEpp +Ld6leNcG2mqeSz53OiATIgHQv2ieY2BrNU0LbbqhPcCT4H8js1WtciVORvnSFu+w +ZMEBnunKoGqYDs/YYPIvSbjkQuE4NRb0yG5P94FW6LqjviOvrv1vA+ACOzB2+htt +Qc8Bsem4yWb02ybzOqR08kkkW8mw0FfB+j564ZfJ +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIDqDCCApCgAwIBAgIJAP7c4wEPyUj/MA0GCSqGSIb3DQEBBQUAMDQxCzAJBgNV +BAYTAkZSMRIwEAYDVQQKDAlEaGlteW90aXMxETAPBgNVBAMMCENlcnRpZ25hMB4X +DTA3MDYyOTE1MTMwNVoXDTI3MDYyOTE1MTMwNVowNDELMAkGA1UEBhMCRlIxEjAQ +BgNVBAoMCURoaW15b3RpczERMA8GA1UEAwwIQ2VydGlnbmEwggEiMA0GCSqGSIb3 +DQEBAQUAA4IBDwAwggEKAoIBAQDIaPHJ1tazNHUmgh7stL7qXOEm7RFHYeGifBZ4 +QCHkYJ5ayGPhxLGWkv8YbWkj4Sti993iNi+RB7lIzw7sebYs5zRLcAglozyHGxny +gQcPOJAZ0xH+hrTy0V4eHpbNgGzOOzGTtvKg0KmVEn2lmsxryIRWijOp5yIVUxbw +zBfsV1/pogqYCd7jX5xv3EjjhQsVWqa6n6xI4wmy9/Qy3l40vhx4XUJbzg4ij02Q +130yGLMLLGq/jj8UEYkgDncUtT2UCIf3JR7VsmAA7G8qKCVuKj4YYxclPz5EIBb2 +JsglrgVKtOdjLPOMFlN+XPsRGgjBRmKfIrjxwo1p3Po6WAbfAgMBAAGjgbwwgbkw +DwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUGu3+QTmQtCRZvgHyUtVF9lo53BEw +ZAYDVR0jBF0wW4AUGu3+QTmQtCRZvgHyUtVF9lo53BGhOKQ2MDQxCzAJBgNVBAYT +AkZSMRIwEAYDVQQKDAlEaGlteW90aXMxETAPBgNVBAMMCENlcnRpZ25hggkA/tzj +AQ/JSP8wDgYDVR0PAQH/BAQDAgEGMBEGCWCGSAGG+EIBAQQEAwIABzANBgkqhkiG +9w0BAQUFAAOCAQEAhQMeknH2Qq/ho2Ge6/PAD/Kl1NqV5ta+aDY9fm4fTIrv0Q8h +bV6lUmPOEvjvKtpv6zf+EwLHyzs+ImvaYS5/1HI93TDhHkxAGYwP15zRgzB7mFnc +fca5DClMoTOi62c6ZYTTluLtdkVwj7Ur3vkj1kluPBS1xp81HlDQwY9qcEQCYsuu +HWhBp6pX6FOqB9IG9tUUBguRA3UsbHK1YZWaDYu5Def131TN3ubY1gkIl2PlwS6w +t0QmwCbAr1UwnjvVNioZBPRcHv/PLLf/0P2HQBHVESO7SMAhqaQoLf0V+LBOK/Qw +WyH8EZE0vkHve52Xdf+XlcCWWC/qu0bXu+TZLg== +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIDUzCCAjugAwIBAgIBAjANBgkqhkiG9w0BAQUFADBLMQswCQYDVQQGEwJOTzEd +MBsGA1UECgwUQnV5cGFzcyBBUy05ODMxNjMzMjcxHTAbBgNVBAMMFEJ1eXBhc3Mg +Q2xhc3MgMyBDQSAxMB4XDTA1MDUwOTE0MTMwM1oXDTE1MDUwOTE0MTMwM1owSzEL +MAkGA1UEBhMCTk8xHTAbBgNVBAoMFEJ1eXBhc3MgQVMtOTgzMTYzMzI3MR0wGwYD +VQQDDBRCdXlwYXNzIENsYXNzIDMgQ0EgMTCCASIwDQYJKoZIhvcNAQEBBQADggEP +ADCCAQoCggEBAKSO13TZKWTeXx+HgJHqTjnmGcZEC4DVC69TB4sSveZn8AKxifZg +isRbsELRwCGoy+Gb72RRtqfPFfV0gGgEkKBYouZ0plNTVUhjP5JW3SROjvi6K//z +NIqeKNc0n6wv1g/xpC+9UrJJhW05NfBEMJNGJPO251P7vGGvqaMU+8IXF4Rs4HyI ++MkcVyzwPX6UvCWThOiaAJpFBUJXgPROztmuOfbIUxAMZTpHe2DC1vqRycZxbL2R +hzyRhkmr8w+gbCZ2Xhysm3HljbybIR6c1jh+JIAVMYKWsUnTYjdbiAwKYjT+p0h+ +mbEwi5A3lRyoH6UsjfRVyNvdWQrCrXig9IsCAwEAAaNCMEAwDwYDVR0TAQH/BAUw +AwEB/zAdBgNVHQ4EFgQUOBTmyPCppAP0Tj4io1vy1uCtQHQwDgYDVR0PAQH/BAQD +AgEGMA0GCSqGSIb3DQEBBQUAA4IBAQABZ6OMySU9E2NdFm/soT4JXJEVKirZgCFP +Bdy7pYmrEzMqnji3jG8CcmPHc3ceCQa6Oyh7pEfJYWsICCD8igWKH7y6xsL+z27s +EzNxZy5p+qksP2bAEllNC1QCkoS72xLvg3BweMhT+t/Gxv/ciC8HwEmdMldg0/L2 +mSlf56oBzKwzqBwKu5HEA6BvtjT5htOzdlSY9EqBs1OdTUDs5XcTRa9bqh/YL0yC +e/4qxFi7T/ye/QNlGioOw6UgFpRreaaiErS7GqQjel/wroQk5PMr+4okoyeYZdow +dXb8GZHo2+ubPzK/QJcHJrrM85SFSnonk8+QQtS4Wxam58tAA915 +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIDqzCCApOgAwIBAgIRAMcoRwmzuGxFjB36JPU2TukwDQYJKoZIhvcNAQEFBQAw +PDEbMBkGA1UEAxMSQ29tU2lnbiBTZWN1cmVkIENBMRAwDgYDVQQKEwdDb21TaWdu +MQswCQYDVQQGEwJJTDAeFw0wNDAzMjQxMTM3MjBaFw0yOTAzMTYxNTA0NTZaMDwx +GzAZBgNVBAMTEkNvbVNpZ24gU2VjdXJlZCBDQTEQMA4GA1UEChMHQ29tU2lnbjEL +MAkGA1UEBhMCSUwwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDGtWhf +HZQVw6QIVS3joFd67+l0Kru5fFdJGhFeTymHDEjWaueP1H5XJLkGieQcPOqs49oh +gHMhCu95mGwfCP+hUH3ymBvJVG8+pSjsIQQPRbsHPaHA+iqYHU4Gk/v1iDurX8sW +v+bznkqH7Rnqwp9D5PGBpX8QTz7RSmKtUxvLg/8HZaWSLWapW7ha9B20IZFKF3ue +Mv5WJDmyVIRD9YTC2LxBkMyd1mja6YJQqTtoz7VdApRgFrFD2UNd3V2Hbuq7s8lr +9gOUCXDeFhF6K+h2j0kQmHe5Y1yLM5d19guMsqtb3nQgJT/j8xH5h2iGNXHDHYwt +6+UarA9z1YJZQIDTAgMBAAGjgacwgaQwDAYDVR0TBAUwAwEB/zBEBgNVHR8EPTA7 +MDmgN6A1hjNodHRwOi8vZmVkaXIuY29tc2lnbi5jby5pbC9jcmwvQ29tU2lnblNl +Y3VyZWRDQS5jcmwwDgYDVR0PAQH/BAQDAgGGMB8GA1UdIwQYMBaAFMFL7XC29z58 +ADsAj8c+DkWfHl3sMB0GA1UdDgQWBBTBS+1wtvc+fAA7AI/HPg5Fnx5d7DANBgkq +hkiG9w0BAQUFAAOCAQEAFs/ukhNQq3sUnjO2QiBq1BW9Cav8cujvR3qQrFHBZE7p +iL1DRYHjZiM/EoZNGeQFsOY3wo3aBijJD4mkU6l1P7CW+6tMM1X5eCZGbxs2mPtC +dsGCuY7e+0X5YxtiOzkGynd6qDwJz2w2PQ8KRUtpFhpFfTMDZflScZAmlaxMDPWL +kz/MdXSFmLr/YnpNH4n+rr2UAJm/EaXc4HnFFgt9AmEd6oX5AhVP51qJThRv4zdL +hfXBPGHg/QVBspJ/wx2g0K5SZGBrGMYmnNj1ZOQ2GmKfig8+/21OGVZOIJFsnzQz +OjRXUDpvgV4GxvU+fE6OK85lBi5d0ipTdF7Tbieejw== +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIID/jCCAuagAwIBAgIQFaxulBmyeUtB9iepwxgPHzANBgkqhkiG9w0BAQsFADCB +mDELMAkGA1UEBhMCVVMxFjAUBgNVBAoTDUdlb1RydXN0IEluYy4xOTA3BgNVBAsT +MChjKSAyMDA4IEdlb1RydXN0IEluYy4gLSBGb3IgYXV0aG9yaXplZCB1c2Ugb25s +eTE2MDQGA1UEAxMtR2VvVHJ1c3QgUHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhv +cml0eSAtIEczMB4XDTA4MDQwMjAwMDAwMFoXDTM3MTIwMTIzNTk1OVowgZgxCzAJ +BgNVBAYTAlVTMRYwFAYDVQQKEw1HZW9UcnVzdCBJbmMuMTkwNwYDVQQLEzAoYykg +MjAwOCBHZW9UcnVzdCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxNjA0 +BgNVBAMTLUdlb1RydXN0IFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkg +LSBHMzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBANziXmJYHTNXOTIz ++uvLh4yn1ErdBojqZI4xmKU4kB6Yzy5jK/BGvESyiaHAKAxJcCGVn2TAppMSAmUm +hsalifD614SgcK9PGpc/BkTVyetyEH3kMSj7HGHmKAdEc5IiaacDiGydY8hS2pgn +5whMcD60yRLBxWeDXTPzAxHsatBT4tG6NmCUgLthY2xbF37fQJQeqw3CIShwiP/W +JmxsYAQlTlV+fe+/lEjetx3dcI0FX4ilm/LC7urRQEFtYjgdVgbFA0dRIBn8exAL +DmKudlW/X3e+PkkBUz2YJQN2JFodtNuJ6nnltrM7P7pMKEF/BqxqjsHQ9gUdfeZC +huOl1UcCAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYw +HQYDVR0OBBYEFMR5yo6hTgMdHNxr2zFblD4/MH8tMA0GCSqGSIb3DQEBCwUAA4IB +AQAtxRPPVoB7eni9n64smefv2t+UXglpp+duaIy9cr5HqQ6XErhK8WTTOd8lNNTB +zU6B8A8ExCSzNJbGpqow32hhc9f5joWJ7w5elShKKiePEI4ufIbEAp7aDHdlDkQN +kv39sxY2+hENHYwOB4lqKVb3cvTdFZx3NWZXqxNT2I7BQMXXExZacse3aQHEerGD +AWh9jUGhlBjBJVz88P6DAod8DQ3PLghcSkANPuyBYeYk28rgDi0Hsj5W3I31QYUH +SJsMC8tJP33st/3LjWeJGqvtux6jAAgIFyqCXDFdRootD4abdNlF+9RAsXqqaC2G +spki4cErx5z481+oghLrGREt +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIFsDCCA5igAwIBAgIQFci9ZUdcr7iXAF7kBtK8nTANBgkqhkiG9w0BAQUFADBe +MQswCQYDVQQGEwJUVzEjMCEGA1UECgwaQ2h1bmdod2EgVGVsZWNvbSBDby4sIEx0 +ZC4xKjAoBgNVBAsMIWVQS0kgUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAe +Fw0wNDEyMjAwMjMxMjdaFw0zNDEyMjAwMjMxMjdaMF4xCzAJBgNVBAYTAlRXMSMw +IQYDVQQKDBpDaHVuZ2h3YSBUZWxlY29tIENvLiwgTHRkLjEqMCgGA1UECwwhZVBL +SSBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIICIjANBgkqhkiG9w0BAQEF +AAOCAg8AMIICCgKCAgEA4SUP7o3biDN1Z82tH306Tm2d0y8U82N0ywEhajfqhFAH +SyZbCUNsIZ5qyNUD9WBpj8zwIuQf5/dqIjG3LBXy4P4AakP/h2XGtRrBp0xtInAh +ijHyl3SJCRImHJ7K2RKilTza6We/CKBk49ZCt0Xvl/T29de1ShUCWH2YWEtgvM3X +DZoTM1PRYfl61dd4s5oz9wCGzh1NlDivqOx4UXCKXBCDUSH3ET00hl7lSM2XgYI1 +TBnsZfZrxQWh7kcT1rMhJ5QQCtkkO7q+RBNGMD+XPNjX12ruOzjjK9SXDrkb5wdJ +fzcq+Xd4z1TtW0ado4AOkUPB1ltfFLqfpo0kR0BZv3I4sjZsN/+Z0V0OWQqraffA +sgRFelQArr5T9rXn4fg8ozHSqf4hUmTFpmfwdQcGlBSBVcYn5AGPF8Fqcde+S/uU +WH1+ETOxQvdibBjWzwloPn9s9h6PYq2lY9sJpx8iQkEeb5mKPtf5P0B6ebClAZLS +nT0IFaUQAS2zMnaolQ2zepr7BxB4EW/hj8e6DyUadCrlHJhBmd8hh+iVBmoKs2pH +dmX2Os+PYhcZewoozRrSgx4hxyy/vv9haLdnG7t4TY3OZ+XkwY63I2binZB1NJip +NiuKmpS5nezMirH4JYlcWrYvjB9teSSnUmjDhDXiZo1jDiVN1Rmy5nk3pyKdVDEC +AwEAAaNqMGgwHQYDVR0OBBYEFB4M97Zn8uGSJglFwFU5Lnc/QkqiMAwGA1UdEwQF +MAMBAf8wOQYEZyoHAAQxMC8wLQIBADAJBgUrDgMCGgUAMAcGBWcqAwAABBRFsMLH +ClZ87lt4DJX5GFPBphzYEDANBgkqhkiG9w0BAQUFAAOCAgEACbODU1kBPpVJufGB +uvl2ICO1J2B01GqZNF5sAFPZn/KmsSQHRGoqxqWOeBLoR9lYGxMqXnmbnwoqZ6Yl +PwZpVnPDimZI+ymBV3QGypzqKOg4ZyYr8dW1P2WT+DZdjo2NQCCHGervJ8A9tDkP +JXtoUHRVnAxZfVo9QZQlUgjgRywVMRnVvwdVxrsStZf0X4OFunHB2WyBEXYKCrC/ +gpf36j36+uwtqSiUO1bd0lEursC9CBWMd1I0ltabrNMdjmEPNXubrjlpC2JgQCA2 +j6/7Nu4tCEoduL+bXPjqpRugc6bY+G7gMwRfaKonh+3ZwZCc7b3jajWvY9+rGNm6 +5ulK6lCKD2GTHuItGeIwlDWSXQ62B68ZgI9HkFFLLk3dheLSClIKF5r8GrBQAuUB +o2M3IUxExJtRmREOc5wGj1QupyheRDmHVi03vYVElOEMSyycw5KFNGHLD7ibSkNS +/jQ6fbjpKdx2qcgw+BRxgMYeNkh0IkFch4LoGHGLQYlE535YW6i4jRPpp2zDR+2z +Gp1iro2C6pSe3VkQw63d4k3jMdXH7OjysP6SHhYKGvzZ8/gntsm+HbRsZJB/9OTE +W9c3rkIO3aQab3yIVMUWbuF6aC74Or8NpDyJO3inTmODBCEIZ43ygknQW/2xzQ+D +hNQ+IIX3Sj0rnP0qCglN6oH4EZw= +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIEXzCCA0egAwIBAgIBATANBgkqhkiG9w0BAQUFADCB0DELMAkGA1UEBhMCRVMx +SDBGBgNVBAoTP0laRU5QRSBTLkEuIC0gQ0lGIEEtMDEzMzcyNjAtUk1lcmMuVml0 +b3JpYS1HYXN0ZWl6IFQxMDU1IEY2MiBTODFCMEAGA1UEBxM5QXZkYSBkZWwgTWVk +aXRlcnJhbmVvIEV0b3JiaWRlYSAzIC0gMDEwMTAgVml0b3JpYS1HYXN0ZWl6MRMw +EQYDVQQDEwpJemVucGUuY29tMR4wHAYJKoZIhvcNAQkBFg9JbmZvQGl6ZW5wZS5j +b20wHhcNMDMwMTMwMjMwMDAwWhcNMTgwMTMwMjMwMDAwWjCB0DELMAkGA1UEBhMC +RVMxSDBGBgNVBAoTP0laRU5QRSBTLkEuIC0gQ0lGIEEtMDEzMzcyNjAtUk1lcmMu +Vml0b3JpYS1HYXN0ZWl6IFQxMDU1IEY2MiBTODFCMEAGA1UEBxM5QXZkYSBkZWwg +TWVkaXRlcnJhbmVvIEV0b3JiaWRlYSAzIC0gMDEwMTAgVml0b3JpYS1HYXN0ZWl6 +MRMwEQYDVQQDEwpJemVucGUuY29tMR4wHAYJKoZIhvcNAQkBFg9JbmZvQGl6ZW5w +ZS5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC1btoCXXhp3xIW +D+Bxl8nUCxkyiazWfpt0e68t+Qt9+lZjKZSdEw2Omj4qvr+ovRmDXO3iWpWVOWDl +3JHJjAzFCe8ZEBNDH+QNYwZHmPBaMYFOYFdbAFVHWvys152C308hcFJ6xWWGmjvl +2eMiEl9P2nR2LWue368DCu+ak7j3gjAXaCOdP1a7Bfr+RW3X2SC5R4Xyp8iHlL5J +PHJD/WBkLrezwzQPdACw8m9EG7q9kUwlNpL32mROujS3ZkT6mQTzJieLiE3X04s0 +uIUqVkk5MhjcHFf7al0N5CzjtTcnXYJKN2Z9EDVskk4olAdGi46eSoZXbjUOP5gk +Ej6wVZAXAgMBAAGjQjBAMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEG +MB0GA1UdDgQWBBTqVk/sPIOhFIh4gbIrBSLAB0FbQjANBgkqhkiG9w0BAQUFAAOC +AQEAYp7mEzzhw6o5Hf5+T5kcI+t4BJyiIWy7vHlLs/G8dLYXO81aN/Mzg928eMTR +TxxYZL8dd9uwsJ50TVfX6L0R4Dyw6wikh3fHRrat9ufXi63j5K91Ysr7aXqnF38d +iAgHYkrwC3kuxHBb9C0KBz6h8Q45/KCyN7d37wWAq38yyhPDlaOvyoE6bdUuK5hT +m5EYA5JmPyrhQ1moDOyueWBAjxzMEMj+OAY1H90cLv6wszsqerxRrdTOHBdv7MjB +EIpvEEQkXUxVXAzFuuT6m2t91Lfnwfl/IvljHaVC7DlyyhRYHD6D4Rx+4QKp4tWL +vpw6LkI+gKNJ/YdMCsRZQzEEFA== +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIID5jCCAs6gAwIBAgIQV8szb8JcFuZHFhfjkDFo4DANBgkqhkiG9w0BAQUFADBi +MQswCQYDVQQGEwJVUzEhMB8GA1UEChMYTmV0d29yayBTb2x1dGlvbnMgTC5MLkMu +MTAwLgYDVQQDEydOZXR3b3JrIFNvbHV0aW9ucyBDZXJ0aWZpY2F0ZSBBdXRob3Jp +dHkwHhcNMDYxMjAxMDAwMDAwWhcNMjkxMjMxMjM1OTU5WjBiMQswCQYDVQQGEwJV +UzEhMB8GA1UEChMYTmV0d29yayBTb2x1dGlvbnMgTC5MLkMuMTAwLgYDVQQDEydO +ZXR3b3JrIFNvbHV0aW9ucyBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwggEiMA0GCSqG +SIb3DQEBAQUAA4IBDwAwggEKAoIBAQDkvH6SMG3G2I4rC7xGzuAnlt7e+foS0zwz +c7MEL7xxjOWftiJgPl9dzgn/ggwbmlFQGiaJ3dVhXRncEg8tCqJDXRfQNJIg6nPP +OCwGJgl6cvf6UDL4wpPTaaIjzkGxzOTVHzbRijr4jGPiFFlp7Q3Tf2vouAPlT2rl +mGNpSAW+Lv8ztumXWWn4Zxmuk2GWRBXTcrA/vGp97Eh/jcOrqnErU2lBUzS1sLnF +BgrEsEX1QV1uiUV7PTsmjHTC5dLRfbIR1PtYMiKagMnc/Qzpf14Dl847ABSHJ3A4 +qY5usyd2mFHgBeMhqxrVhSI8KbWaFsWAqPS7azCPL0YCorEMIuDTAgMBAAGjgZcw +gZQwHQYDVR0OBBYEFCEwyfsA106Y2oeqKtCnLrFAMadMMA4GA1UdDwEB/wQEAwIB +BjAPBgNVHRMBAf8EBTADAQH/MFIGA1UdHwRLMEkwR6BFoEOGQWh0dHA6Ly9jcmwu +bmV0c29sc3NsLmNvbS9OZXR3b3JrU29sdXRpb25zQ2VydGlmaWNhdGVBdXRob3Jp +dHkuY3JsMA0GCSqGSIb3DQEBBQUAA4IBAQC7rkvnt1frf6ott3NHhWrB5KUd5Oc8 +6fRZZXe1eltajSU24HqXLjjAV2CDmAaDn7l2em5Q4LqILPxFzBiwmZVRDuwduIj/ +h1AcgsLj4DKAv6ALR8jDMe+ZZzKATxcheQxpXN5eNK4CtSbqUN9/GGUsyfJj4akH +/nxxH2szJGoeBfcFaMBqEssuXmHLrijTfsK0ZpEmXzwuJF/LWA/rKOyvEZbz3Htv +wKeI8lN3s2Berq4o2jUsbzRF0ybh3uxbTydrFny9RAQYgrOJeRcQcT16ohZO9QHN +pGxlaKFJdlxDydi8NmdspZS11My5vWo1ViHe2MPr+8ukYEywVaCge1ey +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIEuTCCA6GgAwIBAgIQQBrEZCGzEyEDDrvkEhrFHTANBgkqhkiG9w0BAQsFADCB +vTELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQL +ExZWZXJpU2lnbiBUcnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwOCBWZXJp +U2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MTgwNgYDVQQDEy9W +ZXJpU2lnbiBVbml2ZXJzYWwgUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAe +Fw0wODA0MDIwMDAwMDBaFw0zNzEyMDEyMzU5NTlaMIG9MQswCQYDVQQGEwJVUzEX +MBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRydXN0 +IE5ldHdvcmsxOjA4BgNVBAsTMShjKSAyMDA4IFZlcmlTaWduLCBJbmMuIC0gRm9y +IGF1dGhvcml6ZWQgdXNlIG9ubHkxODA2BgNVBAMTL1ZlcmlTaWduIFVuaXZlcnNh +bCBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIIBIjANBgkqhkiG9w0BAQEF +AAOCAQ8AMIIBCgKCAQEAx2E3XrEBNNti1xWb/1hajCMj1mCOkdeQmIN65lgZOIzF +9uVkhbSicfvtvbnazU0AtMgtc6XHaXGVHzk8skQHnOgO+k1KxCHfKWGPMiJhgsWH +H26MfF8WIFFE0XBPV+rjHOPMee5Y2A7Cs0WTwCznmhcrewA3ekEzeOEz4vMQGn+H +LL729fdC4uW/h2KJXwBL38Xd5HVEMkE6HnFuacsLdUYI0crSK5XQz/u5QGtkjFdN +/BMReYTtXlT2NJ8IAfMQJQYXStrxHXpma5hgZqTZ79IugvHw7wnqRMkVauIDbjPT +rJ9VAMf2CGqUuV/c4DPxhGD5WycRtPwW8rtWaoAljQIDAQABo4GyMIGvMA8GA1Ud +EwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMG0GCCsGAQUFBwEMBGEwX6FdoFsw +WTBXMFUWCWltYWdlL2dpZjAhMB8wBwYFKw4DAhoEFI/l0xqGrI2Oa8PPgGrUSBgs +exkuMCUWI2h0dHA6Ly9sb2dvLnZlcmlzaWduLmNvbS92c2xvZ28uZ2lmMB0GA1Ud +DgQWBBS2d/ppSEefUxLVwuoHMnYH0ZcHGTANBgkqhkiG9w0BAQsFAAOCAQEASvj4 +sAPmLGd75JR3Y8xuTPl9Dg3cyLk1uXBPY/ok+myDjEedO2Pzmvl2MpWRsXe8rJq+ +seQxIcaBlVZaDrHC1LGmWazxY8u4TB1ZkErvkBYoH1quEPuBUDgMbMzxPcP1Y+Oz +4yHJJDnp/RVmRvQbEdBNc6N9Rvk97ahfYtTxP/jgdFcrGJ2BtMQo2pSXpXDrrB2+ +BxHw1dvd5Yzw1TKwg+ZX4o+/vqGqvz0dtdQ46tewXDpPaj+PwGZsY6rp2aQW9IHR +lRQOfc2VNNnSj3BzgXucfr2YYdhFh5iQxeuGMMY1v/D/w1WIg0vvBZIGcfK4mJO3 +7M2CYfE45k+XmCpajQ== +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIECTCCAvGgAwIBAgIQDV6ZCtadt3js2AdWO4YV2TANBgkqhkiG9w0BAQUFADBb +MQswCQYDVQQGEwJVUzEgMB4GA1UEChMXRGlnaXRhbCBTaWduYXR1cmUgVHJ1c3Qx +ETAPBgNVBAsTCERTVCBBQ0VTMRcwFQYDVQQDEw5EU1QgQUNFUyBDQSBYNjAeFw0w +MzExMjAyMTE5NThaFw0xNzExMjAyMTE5NThaMFsxCzAJBgNVBAYTAlVTMSAwHgYD +VQQKExdEaWdpdGFsIFNpZ25hdHVyZSBUcnVzdDERMA8GA1UECxMIRFNUIEFDRVMx +FzAVBgNVBAMTDkRTVCBBQ0VTIENBIFg2MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A +MIIBCgKCAQEAuT31LMmU3HWKlV1j6IR3dma5WZFcRt2SPp/5DgO0PWGSvSMmtWPu +ktKe1jzIDZBfZIGxqAgNTNj50wUoUrQBJcWVHAx+PhCEdc/BGZFjz+iokYi5Q1K7 +gLFViYsx+tC3dr5BPTCapCIlF3PoHuLTrCq9Wzgh1SpL11V94zpVvddtawJXa+ZH +fAjIgrrep4c9oW24MFbCswKBXy314powGCi4ZtPLAZZv6opFVdbgnf9nKxcCpk4a +ahELfrd755jWjHZvwTvbUJN+5dCOHze4vbrGn2zpfDPyMjwmR/onJALJfh1biEIT +ajV8fTXpLmaRcpPVMibEdPVTo7NdmvYJywIDAQABo4HIMIHFMA8GA1UdEwEB/wQF +MAMBAf8wDgYDVR0PAQH/BAQDAgHGMB8GA1UdEQQYMBaBFHBraS1vcHNAdHJ1c3Rk +c3QuY29tMGIGA1UdIARbMFkwVwYKYIZIAWUDAgEBATBJMEcGCCsGAQUFBwIBFjto +dHRwOi8vd3d3LnRydXN0ZHN0LmNvbS9jZXJ0aWZpY2F0ZXMvcG9saWN5L0FDRVMt +aW5kZXguaHRtbDAdBgNVHQ4EFgQUCXIGThhDD+XWzMNqizF7eI+og7gwDQYJKoZI +hvcNAQEFBQADggEBAKPYjtay284F5zLNAdMEA+V25FYrnJmQ6AgwbN99Pe7lv7Uk +QIRJ4dEorsTCOlMwiPH1d25Ryvr/ma8kXxug/fKshMrfqfBfBC6tFr8hlxCBPeP/ +h40y3JTlR4peahPJlJU90u7INJXQgNStMgiAVDzgvVJT11J8smk/f3rPanTK+gQq +nExaBqXpIK1FZg9p8d2/6eMyi/rgwYZNcjwu2JN4Cir42NInPRmJX1p7ijvMDNpR +rscL9yuwNwXsvFcj4jjSm2jzVhKIT0J8uDHEtdvkyCE06UgRNe76x5JXxZ805Mf2 +9w4LTJxoeHtxMcfrHuBnQfO3oKfN5XozNmr6mis= +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIDljCCAn6gAwIBAgIQC5McOtY5Z+pnI7/Dr5r0SzANBgkqhkiG9w0BAQsFADBl +MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3 +d3cuZGlnaWNlcnQuY29tMSQwIgYDVQQDExtEaWdpQ2VydCBBc3N1cmVkIElEIFJv +b3QgRzIwHhcNMTMwODAxMTIwMDAwWhcNMzgwMTE1MTIwMDAwWjBlMQswCQYDVQQG +EwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNl +cnQuY29tMSQwIgYDVQQDExtEaWdpQ2VydCBBc3N1cmVkIElEIFJvb3QgRzIwggEi +MA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDZ5ygvUj82ckmIkzTz+GoeMVSA +n61UQbVH35ao1K+ALbkKz3X9iaV9JPrjIgwrvJUXCzO/GU1BBpAAvQxNEP4Htecc +biJVMWWXvdMX0h5i89vqbFCMP4QMls+3ywPgym2hFEwbid3tALBSfK+RbLE4E9Hp +EgjAALAcKxHad3A2m67OeYfcgnDmCXRwVWmvo2ifv922ebPynXApVfSr/5Vh88lA +bx3RvpO704gqu52/clpWcTs/1PPRCv4o76Pu2ZmvA9OPYLfykqGxvYmJHzDNw6Yu +YjOuFgJ3RFrngQo8p0Quebg/BLxcoIfhG69Rjs3sLPr4/m3wOnyqi+RnlTGNAgMB +AAGjQjBAMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgGGMB0GA1UdDgQW +BBTOw0q5mVXyuNtgv6l+vVa1lzan1jANBgkqhkiG9w0BAQsFAAOCAQEAyqVVjOPI +QW5pJ6d1Ee88hjZv0p3GeDgdaZaikmkuOGybfQTUiaWxMTeKySHMq2zNixya1r9I +0jJmwYrA8y8678Dj1JGG0VDjA9tzd29KOVPt3ibHtX2vK0LRdWLjSisCx1BL4Gni +lmwORGYQRI+tBev4eaymG+g3NJ1TyWGqolKvSnAWhsI6yLETcDbYz+70CjTVW0z9 +B5yiutkBclzzTcHdDrEcDcRjvq30FPuJ7KJBDkzMyFdA0G4Dqs0MjomZmWzwPDCv +ON9vvKO+KSAnq3T/EyJ43pdSVR6DtVQgA+6uwE9W3jfMw3+qBCe703e4YtsXfJwo +IhNzbM8m9Yop5w== +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIDezCCAmOgAwIBAgIBATANBgkqhkiG9w0BAQUFADBfMQswCQYDVQQGEwJUVzES +MBAGA1UECgwJVEFJV0FOLUNBMRAwDgYDVQQLDAdSb290IENBMSowKAYDVQQDDCFU +V0NBIFJvb3QgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMDgwODI4MDcyNDMz +WhcNMzAxMjMxMTU1OTU5WjBfMQswCQYDVQQGEwJUVzESMBAGA1UECgwJVEFJV0FO +LUNBMRAwDgYDVQQLDAdSb290IENBMSowKAYDVQQDDCFUV0NBIFJvb3QgQ2VydGlm +aWNhdGlvbiBBdXRob3JpdHkwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB +AQCwfnK4pAOU5qfeCTiRShFAh6d8WWQUe7UREN3+v9XAu1bihSX0NXIP+FPQQeFE +AcK0HMMxQhZHhTMidrIKbw/lJVBPhYa+v5guEGcevhEFhgWQxFnQfHgQsIBct+HH +K3XLfJ+utdGdIzdjp9xCoi2SBBtQwXu4PhvJVgSLL1KbralW6cH/ralYhzC2gfeX +RfwZVzsrb+RH9JlF/h3x+JejiB03HFyP4HYlmlD4oFT/RJB2I9IyxsOrBr/8+7/z +rX2SYgJbKdM1o5OaQ2RgXbL6Mv87BK9NQGr5x+PvI/1ry+UPizgN7gr8/g+YnzAx +3WxSZfmLgb4i4RxYA7qRG4kHAgMBAAGjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNV +HRMBAf8EBTADAQH/MB0GA1UdDgQWBBRqOFsmjd6LWvJPelSDGRjjCDWmujANBgkq +hkiG9w0BAQUFAAOCAQEAPNV3PdrfibqHDAhUaiBQkr6wQT25JmSDCi/oQMCXKCeC +MErJk/9q56YAf4lCmtYR5VPOL8zy2gXE/uJQxDqGfczafhAJO5I1KlOy/usrBdls +XebQ79NqZp4VKIV66IIArB6nCWlWQtNoURi+VJq/REG6Sb4gumlc7rh3zc5sH62D +lhh9DrUUOYTxKOkto557HnpyWoOzeW/vtPzQCqVYT0bf+215WfKEIlKuD8z7fDvn +aspHYcN6+NOSBB+4IIThNlQWx0DeO4pz3N/GCUzf7Nr/1FNCocnyYh0igzyXxfkZ +YiesZSLX0zzG5Y6yU8xJzrww/nsOM5D77dIUkR8Hrw== +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIE5zCCA8+gAwIBAgIBADANBgkqhkiG9w0BAQUFADCBjTELMAkGA1UEBhMCQ0Ex +EDAOBgNVBAgTB09udGFyaW8xEDAOBgNVBAcTB1Rvcm9udG8xHTAbBgNVBAoTFEVj +aG93b3J4IENvcnBvcmF0aW9uMR8wHQYDVQQLExZDZXJ0aWZpY2F0aW9uIFNlcnZp +Y2VzMRowGAYDVQQDExFFY2hvd29yeCBSb290IENBMjAeFw0wNTEwMDYxMDQ5MTNa +Fw0zMDEwMDcxMDQ5MTNaMIGNMQswCQYDVQQGEwJDQTEQMA4GA1UECBMHT250YXJp +bzEQMA4GA1UEBxMHVG9yb250bzEdMBsGA1UEChMURWNob3dvcnggQ29ycG9yYXRp +b24xHzAdBgNVBAsTFkNlcnRpZmljYXRpb24gU2VydmljZXMxGjAYBgNVBAMTEUVj +aG93b3J4IFJvb3QgQ0EyMIIBIDANBgkqhkiG9w0BAQEFAAOCAQ0AMIIBCAKCAQEA +utU/5BkV15UBf+s+JQruKQxr77s3rjp/RpOtmhHILIiO5gsEWP8MMrfrVEiidjI6 +Qh6ans0KAWc2Dw0/j4qKAQzOSyAZgjcdypNTBZ7muv212DA2Pu41rXqwMrlBrVi/ +KTghfdLlNRu6JrC5y8HarrnRFSKF1Thbzz921kLDRoCi+FVs5eVuK5LvIfkhNAqA +byrTgO3T9zfZgk8upmEkANPDL1+8y7dGPB/d6lk0I5mv8PESKX02TlvwgRSIiTHR +k8++iOPLBWlGp7ZfqTEXkPUZhgrQQvxcrwCUo6mk8TqgxCDP5FgPoHFiPLef5szP +ZLBJDWp7GLyE1PmkQI6WiwIBA6OCAVAwggFMMA8GA1UdEwEB/wQFMAMBAf8wCwYD +VR0PBAQDAgEGMB0GA1UdDgQWBBQ74YEboKs/OyGC1eISrq5QqxSlEzCBugYDVR0j +BIGyMIGvgBQ74YEboKs/OyGC1eISrq5QqxSlE6GBk6SBkDCBjTELMAkGA1UEBhMC +Q0ExEDAOBgNVBAgTB09udGFyaW8xEDAOBgNVBAcTB1Rvcm9udG8xHTAbBgNVBAoT +FEVjaG93b3J4IENvcnBvcmF0aW9uMR8wHQYDVQQLExZDZXJ0aWZpY2F0aW9uIFNl +cnZpY2VzMRowGAYDVQQDExFFY2hvd29yeCBSb290IENBMoIBADBQBgNVHSAESTBH +MEUGCysGAQQB+REKAQMBMDYwNAYIKwYBBQUHAgEWKGh0dHA6Ly93d3cuZWNob3dv +cnguY29tL2NhL3Jvb3QyL2Nwcy5wZGYwDQYJKoZIhvcNAQEFBQADggEBAG+nrPi/ +0RpfEzrj02C6JGPUar4nbjIhcY6N7DWNeqBoUulBSIH/PYGNHYx7/lnJefiixPGE +7TQ5xPgElxb9bK8zoAApO7U33OubqZ7M7DlHnFeCoOoIAZnG1kuwKwD5CXKB2a74 +HzcqNnFW0IsBFCYqrVh/rQgJOzDA8POGbH0DeD0xjwBBooAolkKT+7ZItJF1Pb56 +QpDL9G+16F7GkmnKlAIYT3QTS3yFGYChnJcd+6txUPhKi9sSOOmAIaKHnkH9Scz+ +A2cSi4A3wUYXVatuVNHpRb2lygfH3SuCX9MU8Ure3zBlSU1LALtMqI4JmcQmQpIq +zIzvO2jHyu9PQqo= +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIEqjCCA5KgAwIBAgIOLmoAAQACH9dSISwRXDswDQYJKoZIhvcNAQEFBQAwdjEL +MAkGA1UEBhMCREUxHDAaBgNVBAoTE1RDIFRydXN0Q2VudGVyIEdtYkgxIjAgBgNV +BAsTGVRDIFRydXN0Q2VudGVyIENsYXNzIDIgQ0ExJTAjBgNVBAMTHFRDIFRydXN0 +Q2VudGVyIENsYXNzIDIgQ0EgSUkwHhcNMDYwMTEyMTQzODQzWhcNMjUxMjMxMjI1 +OTU5WjB2MQswCQYDVQQGEwJERTEcMBoGA1UEChMTVEMgVHJ1c3RDZW50ZXIgR21i +SDEiMCAGA1UECxMZVEMgVHJ1c3RDZW50ZXIgQ2xhc3MgMiBDQTElMCMGA1UEAxMc +VEMgVHJ1c3RDZW50ZXIgQ2xhc3MgMiBDQSBJSTCCASIwDQYJKoZIhvcNAQEBBQAD +ggEPADCCAQoCggEBAKuAh5uO8MN8h9foJIIRszzdQ2Lu+MNF2ujhoF/RKrLqk2jf +tMjWQ+nEdVl//OEd+DFwIxuInie5e/060smp6RQvkL4DUsFJzfb95AhmC1eKokKg +uNV/aVyQMrKXDcpK3EY+AlWJU+MaWss2xgdW94zPEfRMuzBwBJWl9jmM/XOBCH2J +XjIeIqkiRUuwZi4wzJ9l/fzLganx4Duvo4bRierERXlQXa7pIXSSTYtZgo+U4+lK +8edJsBTj9WLL1XK9H7nSn6DNqPoByNkN39r8R52zyFTfSUrxIan+GE7uSNQZu+99 +5OKdy1u2bv/jzVrndIIFuoAlOMvkaZ6vQaoahPUCAwEAAaOCATQwggEwMA8GA1Ud +EwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBTjq1RMgKHbVkO3 +kUrL84J6E1wIqzCB7QYDVR0fBIHlMIHiMIHfoIHcoIHZhjVodHRwOi8vd3d3LnRy +dXN0Y2VudGVyLmRlL2NybC92Mi90Y19jbGFzc18yX2NhX0lJLmNybIaBn2xkYXA6 +Ly93d3cudHJ1c3RjZW50ZXIuZGUvQ049VEMlMjBUcnVzdENlbnRlciUyMENsYXNz +JTIwMiUyMENBJTIwSUksTz1UQyUyMFRydXN0Q2VudGVyJTIwR21iSCxPVT1yb290 +Y2VydHMsREM9dHJ1c3RjZW50ZXIsREM9ZGU/Y2VydGlmaWNhdGVSZXZvY2F0aW9u +TGlzdD9iYXNlPzANBgkqhkiG9w0BAQUFAAOCAQEAjNfffu4bgBCzg/XbEeprS6iS +GNn3Bzn1LL4GdXpoUxUc6krtXvwjshOg0wn/9vYua0Fxec3ibf2uWWuFHbhOIprt +ZjluS5TmVfwLG4t3wVMTZonZKNaL80VKY7f9ewthXbhtvsPcW3nS7Yblok2+XnR8 +au0WOB9/WIFaGusyiC2y8zl3gK9etmF1KdsjTYjKUCjLhdLTEKJZbtOTVAB6okaV +hgWcqRmY5TFyDADiZ9lA4CQze28suVyrZZ0srHbqNZn1l7kPJOzHdiEoZa5X6AeI +dUpWoNIFOqTmjZKILPPy4cHGYdtBxceb9w4aUUXCYWvcZCcXjFq32nQozZfkvQ== +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIEMDCCAxigAwIBAgIQUJRs7Bjq1ZxN1ZfvdY+grTANBgkqhkiG9w0BAQUFADCB +gjELMAkGA1UEBhMCVVMxHjAcBgNVBAsTFXd3dy54cmFtcHNlY3VyaXR5LmNvbTEk +MCIGA1UEChMbWFJhbXAgU2VjdXJpdHkgU2VydmljZXMgSW5jMS0wKwYDVQQDEyRY +UmFtcCBHbG9iYWwgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMDQxMTAxMTcx +NDA0WhcNMzUwMTAxMDUzNzE5WjCBgjELMAkGA1UEBhMCVVMxHjAcBgNVBAsTFXd3 +dy54cmFtcHNlY3VyaXR5LmNvbTEkMCIGA1UEChMbWFJhbXAgU2VjdXJpdHkgU2Vy +dmljZXMgSW5jMS0wKwYDVQQDEyRYUmFtcCBHbG9iYWwgQ2VydGlmaWNhdGlvbiBB +dXRob3JpdHkwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCYJB69FbS6 +38eMpSe2OAtp87ZOqCwuIR1cRN8hXX4jdP5efrRKt6atH67gBhbim1vZZ3RrXYCP +KZ2GG9mcDZhtdhAoWORlsH9KmHmf4MMxfoArtYzAQDsRhtDLooY2YKTVMIJt2W7Q +DxIEM5dfT2Fa8OT5kavnHTu86M/0ay00fOJIYRyO82FEzG+gSqmUsE3a56k0enI4 +qEHMPJQRfevIpoy3hsvKMzvZPTeL+3o+hiznc9cKV6xkmxnr9A8ECIqsAxcZZPRa +JSKNNCyy9mgdEm3Tih4U2sSPpuIjhdV6Db1q4Ons7Be7QhtnqiXtRYMh/MHJfNVi +PvryxS3T/dRlAgMBAAGjgZ8wgZwwEwYJKwYBBAGCNxQCBAYeBABDAEEwCwYDVR0P +BAQDAgGGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFMZPoj0GY4QJnM5i5ASs +jVy16bYbMDYGA1UdHwQvMC0wK6ApoCeGJWh0dHA6Ly9jcmwueHJhbXBzZWN1cml0 +eS5jb20vWEdDQS5jcmwwEAYJKwYBBAGCNxUBBAMCAQEwDQYJKoZIhvcNAQEFBQAD +ggEBAJEVOQMBG2f7Shz5CmBbodpNl2L5JFMn14JkTpAuw0kbK5rc/Kh4ZzXxHfAR +vbdI4xD2Dd8/0sm2qlWkSLoC295ZLhVbO50WfUfXN+pfTXYSNrsf16GBBEYgoyxt +qZ4Bfj8pzgCT3/3JknOJiWSe5yvkHJEs0rnOfc5vMZnT5r7SHpDwCRR5XCOrTdLa +IR9NmXmd4c8nnxCbHIgNsIpkQTG4DmyQJKSbXHGPurt+HBvbaoAPIbzp26a3QPSy +i6mx5O+aGtA9aZnuqCij4Tyz8LIRnM98QObd50N9otg6tamN8jSZxNQQ4Qb9CYQQ +O+7ETPTsJ3xCwnR8gooJybQDJbw= +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIDOzCCAiOgAwIBAgIRANAeRlAAACmMAAAAAgAAAAIwDQYJKoZIhvcNAQEFBQAw +PzEkMCIGA1UEChMbRGlnaXRhbCBTaWduYXR1cmUgVHJ1c3QgQ28uMRcwFQYDVQQD +Ew5EU1QgUm9vdCBDQSBYNDAeFw0wMDA5MTMwNjIyNTBaFw0yMDA5MTMwNjIyNTBa +MD8xJDAiBgNVBAoTG0RpZ2l0YWwgU2lnbmF0dXJlIFRydXN0IENvLjEXMBUGA1UE +AxMORFNUIFJvb3QgQ0EgWDQwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB +AQCthX3OFEYY8gSeIYur0O4ypOT68HnDrjLfIutL5PZHRwQGjzCPb9PFo/ihboJ8 +RvfGhBAqpQCo47zwYEhpWm1jB+L/OE/dBBiyn98krfU2NiBKSom2J58RBeAwHGEy +cO+lewyjVvbDDLUy4CheY059vfMjPAftCRXjqSZIolQb9FdPcAoa90mFwB7rKniE +J7vppdrUScSS0+eBrHSUPLdvwyn4RGp+lSwbWYcbg5EpSpE0GRJdchic0YDjvIoC +YHpe7Rkj93PYRTQyU4bhC88ck8tMqbvRYqMRqR+vobbkrj5LLCOQCHV5WEoxWh+0 +E2SpIFe7RkV++MmpIAc0h1tZAgMBAAGjMjAwMA8GA1UdEwEB/wQFMAMBAf8wHQYD +VR0OBBYEFPCD6nPIP1ubWzdf9UyPWvf0hki9MA0GCSqGSIb3DQEBBQUAA4IBAQCE +G85wl5eEWd7adH6XW/ikGN5salvpq/Fix6yVTzE6CrhlP5LBdkf6kx1bSPL18M45 +g0rw2zA/MWOhJ3+S6U+BE0zPGCuu8YQaZibR7snm3HiHUaZNMu5c8D0x0bcMxDjY +AVVcHCoNiL53Q4PLW27nbY6wwG0ffFKmgV3blxrYWfuUDgGpyPwHwkfVFvz9qjaV +mf12VJffL6W8omBPtgteb6UaT/k1oJ7YI0ldGf+ngpVbRhD+LC3cUtT6GO/BEPZu +8YTV/hbiDH5v3khVqMIeKT6o8IuXGG7F6a6vKwP1F1FwTXf4UC/ivhme7vdUH7B/ +Vv4AEbT8dNfEeFxrkDbh +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIEQzCCAyugAwIBAgIBATANBgkqhkiG9w0BAQUFADB/MQswCQYDVQQGEwJHQjEb +MBkGA1UECAwSR3JlYXRlciBNYW5jaGVzdGVyMRAwDgYDVQQHDAdTYWxmb3JkMRow +GAYDVQQKDBFDb21vZG8gQ0EgTGltaXRlZDElMCMGA1UEAwwcVHJ1c3RlZCBDZXJ0 +aWZpY2F0ZSBTZXJ2aWNlczAeFw0wNDAxMDEwMDAwMDBaFw0yODEyMzEyMzU5NTla +MH8xCzAJBgNVBAYTAkdCMRswGQYDVQQIDBJHcmVhdGVyIE1hbmNoZXN0ZXIxEDAO +BgNVBAcMB1NhbGZvcmQxGjAYBgNVBAoMEUNvbW9kbyBDQSBMaW1pdGVkMSUwIwYD +VQQDDBxUcnVzdGVkIENlcnRpZmljYXRlIFNlcnZpY2VzMIIBIjANBgkqhkiG9w0B +AQEFAAOCAQ8AMIIBCgKCAQEA33FvNlhTWvI2VFeAxHQIIO0Yfyod5jWaHiWsnOWW +fnJSoBVC21ndZHoa0Lh73TkVvFVIxO06AOoxEbrycXQaZ7jPM8yoMa+j49d/vzMt +TGo87IvDktJTdyR0nAducPy9C1t2ul/y/9c3S0pgePfw+spwtOpZqqPOSC+pw7IL +fhdyFgymBwwbOM/JYrc/oJOlh0Hyt3BAd9i+FHzjqMB6juljatEPmsbS9Is6FARW +1O24zG71++IsWL1/T2sr92AkWCTOJu80kTrV44HQsvAEAtdbtz6SrGsSivnkBbA7 +kUlcsutT6vifR4buv5XAwAaf0lteERv0xwQ1KdJVXOTt6wIDAQABo4HJMIHGMB0G +A1UdDgQWBBTFe1i97doladL3WRaoszLAeydb9DAOBgNVHQ8BAf8EBAMCAQYwDwYD +VR0TAQH/BAUwAwEB/zCBgwYDVR0fBHwwejA8oDqgOIY2aHR0cDovL2NybC5jb21v +ZG9jYS5jb20vVHJ1c3RlZENlcnRpZmljYXRlU2VydmljZXMuY3JsMDqgOKA2hjRo +dHRwOi8vY3JsLmNvbW9kby5uZXQvVHJ1c3RlZENlcnRpZmljYXRlU2VydmljZXMu +Y3JsMA0GCSqGSIb3DQEBBQUAA4IBAQDIk4E7ibSvuIQSTI3S8NtwuleGFTQQuS9/ +HrCoiWChisJ3DFBKmwCL2Iv0QeLQg4pKHBQGsKNoBXAxMKdTmw7pSqBYaWcOrp32 +pSxBvzwGa+RZzG0Q8ZZvH9/0BAKkn0U+yNj6NkZEUD+Cl5EfKNsYEYwq5GWDVxIS +jBc/lDb+XbDABHcTuPQV1T84zJQ6VdCsmPW6AF/ghhmBeC8owH7TzEIK9a5QoNE+ +xqFx7D+gIIxmOom0jtTYsU0lR+4viMi14QVFwL4Ucd56/Y57fU0IlqUSc/Atyjcn +dBInTMu2l+nZrghtWjlA3QVHdWpaIbOjGM9O9y5Xt5hwXsjEeLBi +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIDvDCCAqSgAwIBAgIQB1YipOjUiolN9BPI8PjqpTANBgkqhkiG9w0BAQUFADBK +MQswCQYDVQQGEwJVUzEgMB4GA1UEChMXU2VjdXJlVHJ1c3QgQ29ycG9yYXRpb24x +GTAXBgNVBAMTEFNlY3VyZSBHbG9iYWwgQ0EwHhcNMDYxMTA3MTk0MjI4WhcNMjkx +MjMxMTk1MjA2WjBKMQswCQYDVQQGEwJVUzEgMB4GA1UEChMXU2VjdXJlVHJ1c3Qg +Q29ycG9yYXRpb24xGTAXBgNVBAMTEFNlY3VyZSBHbG9iYWwgQ0EwggEiMA0GCSqG +SIb3DQEBAQUAA4IBDwAwggEKAoIBAQCvNS7YrGxVaQZx5RNoJLNP2MwhR/jxYDiJ +iQPpvepeRlMJ3Fz1Wuj3RSoC6zFh1ykzTM7HfAo3fg+6MpjhHZevj8fcyTiW89sa +/FHtaMbQbqR8JNGuQsiWUGMu4P51/pinX0kuleM5M2SOHqRfkNJnPLLZ/kG5VacJ +jnIFHovdRIWCQtBJwB1g8NEXLJXr9qXBkqPFwqcIYA1gBBCWeZ4WNOaptvolRTnI +HmX5k/Wq8VLcmZg9pYYaDDUz+kulBAYVHDGA76oYa8J719rO+TMg1fW9ajMtgQT7 +sFzUnKPiXB3jqUJ1XnvUd+85VLrJChgbEplJL4hL/VBi0XPnj3pDAgMBAAGjgZ0w +gZowEwYJKwYBBAGCNxQCBAYeBABDAEEwCwYDVR0PBAQDAgGGMA8GA1UdEwEB/wQF +MAMBAf8wHQYDVR0OBBYEFK9EBMJBfkiD2045AuzshHrmzsmkMDQGA1UdHwQtMCsw +KaAnoCWGI2h0dHA6Ly9jcmwuc2VjdXJldHJ1c3QuY29tL1NHQ0EuY3JsMBAGCSsG +AQQBgjcVAQQDAgEAMA0GCSqGSIb3DQEBBQUAA4IBAQBjGghAfaReUw132HquHw0L +URYD7xh8yOOvaliTFGCRsoTciE6+OYo68+aCiV0BN7OrJKQVDpI1WkpEXk5X+nXO +H0jOZvQ8QCaSmGwb7iRGDBezUqXbpZGRzzfTb+cnCDpOGR86p1hcF895P4vkp9Mm +I50mD1hp/Ed+stCNi5O/KU9DaXR2Z0vPB4zmAve14bRDtUstFJ/53CYNv6ZHdAbY +iNE6KTCEztI5gGIbqMdXSbxqVVFnFUq+NQfk1XWYN3kwFNspnWzFacxHVaIw98xc +f8LDmBxrThaA63p4ZUWiABqvDA1VZDRIuJK58bRQKfJPIx/abKwfROHdI3hRW8cW +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIID+TCCAuGgAwIBAgIQW1fXqEywr9nTb0ugMbTW4jANBgkqhkiG9w0BAQUFADB5 +MQswCQYDVQQGEwJVUzENMAsGA1UEChMEVklTQTEvMC0GA1UECxMmVmlzYSBJbnRl +cm5hdGlvbmFsIFNlcnZpY2UgQXNzb2NpYXRpb24xKjAoBgNVBAMTIVZpc2EgSW5m +b3JtYXRpb24gRGVsaXZlcnkgUm9vdCBDQTAeFw0wNTA2MjcxNzQyNDJaFw0yNTA2 +MjkxNzQyNDJaMHkxCzAJBgNVBAYTAlVTMQ0wCwYDVQQKEwRWSVNBMS8wLQYDVQQL +EyZWaXNhIEludGVybmF0aW9uYWwgU2VydmljZSBBc3NvY2lhdGlvbjEqMCgGA1UE +AxMhVmlzYSBJbmZvcm1hdGlvbiBEZWxpdmVyeSBSb290IENBMIIBIjANBgkqhkiG +9w0BAQEFAAOCAQ8AMIIBCgKCAQEAyREA4R/QkkfpLx0cYjga/EhIPZpchH0MZsRZ +FfP6C2ITtf/Wc+MtgD4yTK0yoiXvni3d+aCtEgK3GDvkdgYrgF76ROJFZwUQjQ9l +x42gRT05DbXvWFoy7dTglCZ9z/Tt2Cnktv9oxKgmkeHY/CyfpCBg1S8xth2JlGMR +0ug/GMO5zANuegZOv438p5Lt5So+du2Gl+RMFQqEPwqN5uJSqAe0VtmB4gWdQ8on +Bj2ZAM2R73QW7UW0Igt2vA4JaSiNtaAG/Y/58VXWHGgbq7rDtNK1R30X0kJV0rGA +ib3RSwB3LpG7bOjbIucV5mQgJoVjoA1e05w6g1x/KmNTmOGRVwIDAQABo30wezAP +BgNVHRMBAf8EBTADAQH/MDkGA1UdIAQyMDAwLgYFZ4EDAgEwJTAVBggrBgEFBQcC +ARYJMS4yLjMuNC41MAwGCCsGAQUFBwICMAAwDgYDVR0PAQH/BAQDAgEGMB0GA1Ud +DgQWBBRPitp2/2d3I5qmgH1924h1hfeBejANBgkqhkiG9w0BAQUFAAOCAQEACUW1 +QdUHdDJydgDPmYt+telnG/Su+DPaf1cregzlN43bJaJosMP7NwjoJY/H2He4XLWb +5rXEkl+xH1UyUwF7mtaUoxbGxEvt8hPZSTB4da2mzXgwKvXuHyzF5Qjy1hOB0/pS +WaF9ARpVKJJ7TOJQdGKBsF2Ty4fSCLqZLgfxbqwMsd9sysXI3rDXjIhekqvbgeLz +PqZr+pfgFhwCCLSMQWl5Ll3u7Qk9wR094DZ6jj6+JCVCRUS3HyabH4OlM0Vc2K+j +INsF/64Or7GNtRf9HYEJvrPxHINxl3JVwhYj4ASeaO4KwhVbwtw94Tc/XrGcexDo +c5lC3rAi4/UZqweYCw== +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIID7zCCAtegAwIBAgIBADANBgkqhkiG9w0BAQsFADCBmDELMAkGA1UEBhMCVVMx +EDAOBgNVBAgTB0FyaXpvbmExEzARBgNVBAcTClNjb3R0c2RhbGUxJTAjBgNVBAoT +HFN0YXJmaWVsZCBUZWNobm9sb2dpZXMsIEluYy4xOzA5BgNVBAMTMlN0YXJmaWVs +ZCBTZXJ2aWNlcyBSb290IENlcnRpZmljYXRlIEF1dGhvcml0eSAtIEcyMB4XDTA5 +MDkwMTAwMDAwMFoXDTM3MTIzMTIzNTk1OVowgZgxCzAJBgNVBAYTAlVTMRAwDgYD +VQQIEwdBcml6b25hMRMwEQYDVQQHEwpTY290dHNkYWxlMSUwIwYDVQQKExxTdGFy +ZmllbGQgVGVjaG5vbG9naWVzLCBJbmMuMTswOQYDVQQDEzJTdGFyZmllbGQgU2Vy +dmljZXMgUm9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkgLSBHMjCCASIwDQYJKoZI +hvcNAQEBBQADggEPADCCAQoCggEBANUMOsQq+U7i9b4Zl1+OiFOxHz/Lz58gE20p +OsgPfTz3a3Y4Y9k2YKibXlwAgLIvWX/2h/klQ4bnaRtSmpDhcePYLQ1Ob/bISdm2 +8xpWriu2dBTrz/sm4xq6HZYuajtYlIlHVv8loJNwU4PahHQUw2eeBGg6345AWh1K +Ts9DkTvnVtYAcMtS7nt9rjrnvDH5RfbCYM8TWQIrgMw0R9+53pBlbQLPLJGmpufe +hRhJfGZOozptqbXuNC66DQO4M99H67FrjSXZm86B0UVGMpZwh94CDklDhbZsc7tk +6mFBrMnUVN+HL8cisibMn1lUaJ/8viovxFUcdUBgF4UCVTmLfwUCAwEAAaNCMEAw +DwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFJxfAN+q +AdcwKziIorhtSpzyEZGDMA0GCSqGSIb3DQEBCwUAA4IBAQBLNqaEd2ndOxmfZyMI +bw5hyf2E3F/YNoHN2BtBLZ9g3ccaaNnRbobhiCPPE95Dz+I0swSdHynVv/heyNXB +ve6SbzJ08pGCL72CQnqtKrcgfU28elUSwhXqvfdqlS5sdJ/PHLTyxQGjhdByPq1z +qwubdQxtRbeOlKyWN7Wg0I8VRw7j6IPdj/3vQQF3zCepYoUz8jcI73HPdwbeyBkd +iEDPfUYd/x7H4c7/I9vG+o1VTqkC50cRRj70/b17KSa7qWFiNyi2LSr2EIZkyXCn +0q23KXB56jzaYyWf/Wi3MOxw+3WKt21gZ7IeyLnp2KhvAotnDU0mV3HaIPzBSlCN +sSi6 +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIEDzCCAvegAwIBAgIBADANBgkqhkiG9w0BAQUFADBoMQswCQYDVQQGEwJVUzEl +MCMGA1UEChMcU3RhcmZpZWxkIFRlY2hub2xvZ2llcywgSW5jLjEyMDAGA1UECxMp +U3RhcmZpZWxkIENsYXNzIDIgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMDQw +NjI5MTczOTE2WhcNMzQwNjI5MTczOTE2WjBoMQswCQYDVQQGEwJVUzElMCMGA1UE +ChMcU3RhcmZpZWxkIFRlY2hub2xvZ2llcywgSW5jLjEyMDAGA1UECxMpU3RhcmZp +ZWxkIENsYXNzIDIgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwggEgMA0GCSqGSIb3 +DQEBAQUAA4IBDQAwggEIAoIBAQC3Msj+6XGmBIWtDBFk385N78gDGIc/oav7PKaf +8MOh2tTYbitTkPskpD6E8J7oX+zlJ0T1KKY/e97gKvDIr1MvnsoFAZMej2YcOadN ++lq2cwQlZut3f+dZxkqZJRRU6ybH838Z1TBwj6+wRir/resp7defqgSHo9T5iaU0 +X9tDkYI22WY8sbi5gv2cOj4QyDvvBmVmepsZGD3/cVE8MC5fvj13c7JdBmzDI1aa +K4UmkhynArPkPw2vCHmCuDY96pzTNbO8acr1zJ3o/WSNF4Azbl5KXZnJHoe0nRrA +1W4TNSNe35tfPe/W93bC6j67eA0cQmdrBNj41tpvi/JEoAGrAgEDo4HFMIHCMB0G +A1UdDgQWBBS/X7fRzt0fhvRbVazc1xDCDqmI5zCBkgYDVR0jBIGKMIGHgBS/X7fR +zt0fhvRbVazc1xDCDqmI56FspGowaDELMAkGA1UEBhMCVVMxJTAjBgNVBAoTHFN0 +YXJmaWVsZCBUZWNobm9sb2dpZXMsIEluYy4xMjAwBgNVBAsTKVN0YXJmaWVsZCBD +bGFzcyAyIENlcnRpZmljYXRpb24gQXV0aG9yaXR5ggEAMAwGA1UdEwQFMAMBAf8w +DQYJKoZIhvcNAQEFBQADggEBAAWdP4id0ckaVaGsafPzWdqbAYcaT1epoXkJKtv3 +L7IezMdeatiDh6GX70k1PncGQVhiv45YuApnP+yz3SFmH8lU+nLMPUxA2IGvd56D +eruix/U0F47ZEUD0/CwqTRV/p2JdLiXTAAsgGh1o+Re49L2L7ShZ3U0WixeDyLJl +xy16paq8U4Zt3VekyvggQQto8PT7dL5WXXp59fkdheMtlb71cZBDzI0fmgAKhynp +VSJYACPq4xJDKVtHCN2MQWplBqjlIapBtJUhlbl90TSrE9atvNziPTnNvT51cKEY +WQPJIrSPnNVeKtelttQKbfi3QBFGmh95DmK/D5fs4C8fF5Q= +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIEqjCCA5KgAwIBAgIOSkcAAQAC5aBd1j8AUb8wDQYJKoZIhvcNAQEFBQAwdjEL +MAkGA1UEBhMCREUxHDAaBgNVBAoTE1RDIFRydXN0Q2VudGVyIEdtYkgxIjAgBgNV +BAsTGVRDIFRydXN0Q2VudGVyIENsYXNzIDMgQ0ExJTAjBgNVBAMTHFRDIFRydXN0 +Q2VudGVyIENsYXNzIDMgQ0EgSUkwHhcNMDYwMTEyMTQ0MTU3WhcNMjUxMjMxMjI1 +OTU5WjB2MQswCQYDVQQGEwJERTEcMBoGA1UEChMTVEMgVHJ1c3RDZW50ZXIgR21i +SDEiMCAGA1UECxMZVEMgVHJ1c3RDZW50ZXIgQ2xhc3MgMyBDQTElMCMGA1UEAxMc +VEMgVHJ1c3RDZW50ZXIgQ2xhc3MgMyBDQSBJSTCCASIwDQYJKoZIhvcNAQEBBQAD +ggEPADCCAQoCggEBALTgu1G7OVyLBMVMeRwjhjEQY0NVJz/GRcekPewJDRoeIMJW +Ht4bNwcwIi9v8Qbxq63WyKthoy9DxLCyLfzDlml7forkzMA5EpBCYMnMNWju2l+Q +Vl/NHE1bWEnrDgFPZPosPIlY2C8u4rBo6SI7dYnWRBpl8huXJh0obazovVkdKyT2 +1oQDZogkAHhg8fir/gKya/si+zXmFtGt9i4S5Po1auUZuV3bOx4a+9P/FRQI2Alq +ukWdFHlgfa9Aigdzs5OW03Q0jTo3Kd5c7PXuLjHCINy+8U9/I1LZW+Jk2ZyqBwi1 +Rb3R0DHBq1SfqdLDYmAD8bs5SpJKPQq5ncWg/jcCAwEAAaOCATQwggEwMA8GA1Ud +EwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBTUovyfs8PYA9NX +XAek0CSnwPIA1DCB7QYDVR0fBIHlMIHiMIHfoIHcoIHZhjVodHRwOi8vd3d3LnRy +dXN0Y2VudGVyLmRlL2NybC92Mi90Y19jbGFzc18zX2NhX0lJLmNybIaBn2xkYXA6 +Ly93d3cudHJ1c3RjZW50ZXIuZGUvQ049VEMlMjBUcnVzdENlbnRlciUyMENsYXNz +JTIwMyUyMENBJTIwSUksTz1UQyUyMFRydXN0Q2VudGVyJTIwR21iSCxPVT1yb290 +Y2VydHMsREM9dHJ1c3RjZW50ZXIsREM9ZGU/Y2VydGlmaWNhdGVSZXZvY2F0aW9u +TGlzdD9iYXNlPzANBgkqhkiG9w0BAQUFAAOCAQEANmDkcPcGIEPZIxpC8vijsrlN +irTzwppVMXzEO2eatN9NDoqTSheLG43KieHPOh6sHfGcMrSOWXaiQYUlN6AT0PV8 +TtXqluJucsG7Kv5sbviRmEb8yRtXW+rIGjs/sFGYPAfaLFkB2otE6OF0/ado3VS6 +g0bsyEa1+K+XwDsJHI/OcpY9M1ZwvJbL2NV9IJqDnxrcOfHFcqMRA/07QlIp2+gB +95tejNaNhk4Z+rwcvsUhpYeeeC422wlxo3I0+GzjBgnyXlal092Y+tTmBvTwtiBj +S+opvaqCZh77gaqnN60TGOaSw4HBM7uIHqHn4rS9MWwOUT1v+5ZWgOI2F9Hc5A== +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIDfDCCAmSgAwIBAgIQGKy1av1pthU6Y2yv2vrEoTANBgkqhkiG9w0BAQUFADBY +MQswCQYDVQQGEwJVUzEWMBQGA1UEChMNR2VvVHJ1c3QgSW5jLjExMC8GA1UEAxMo +R2VvVHJ1c3QgUHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0wNjEx +MjcwMDAwMDBaFw0zNjA3MTYyMzU5NTlaMFgxCzAJBgNVBAYTAlVTMRYwFAYDVQQK +Ew1HZW9UcnVzdCBJbmMuMTEwLwYDVQQDEyhHZW9UcnVzdCBQcmltYXJ5IENlcnRp +ZmljYXRpb24gQXV0aG9yaXR5MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKC +AQEAvrgVe//UfH1nrYNke8hCUy3f9oQIIGHWAVlqnEQRr+92/ZV+zmEwu3qDXwK9 +AWbK7hWNb6EwnL2hhZ6UOvNWiAAxz9juapYC2e0DjPt1befquFUWBRaa9OBesYjA +ZIVcFU2Ix7e64HXprQU9nceJSOC7KMgD4TCTZF5SwFlwIjVXiIrxlQqD17wxcwE0 +7e9GceBrAqg1cmuXm2bgyxx5X9gaBGgeRwLmnWDiNpcB3841kt++Z8dtd1k7j53W +kBWUvEI0EME5+bEnPn7WinXFsq+W06Lem+SYvn3h6YGttm/81w7a4DSwDRp35+MI +mO9Y+pyEtzavwt+s0vQQBnBxNQIDAQABo0IwQDAPBgNVHRMBAf8EBTADAQH/MA4G +A1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQULNVQQZcVi/CPNmFbSvtr2ZnJM5IwDQYJ +KoZIhvcNAQEFBQADggEBAFpwfyzdtzRP9YZRqSa+S7iq8XEN3GHHoOo0Hnp3DwQ1 +6CePbJC/kRYkRj5KTs4rFtULUh38H2eiAkUxT87z+gOneZ1TatnaYzr4gNfTmeGl +4b7UVXGYNTq+k+qurUKykG/g/CFNNWMziUnWm07Kx+dOCQD32sfvmWKZd7aVIl6K +oKv0uHiYyjgZmclynnjNS6yvGaBzEi38wkG6gZHaFloxt/m0cYASSJlyc1pZU8Fj +UjPtp8nSOQJw+uCxQmYpqptR7TBUIhRf2asdweSU8Pj1K/fqynhG1riR/aYNKxoU +AT6A8EKglQdebc3MS6RFjasS6LPeWuWgfOgPIh1a6Vk= +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIFvTCCA6WgAwIBAgIITxvUL1S7L0swDQYJKoZIhvcNAQEFBQAwRzELMAkGA1UE +BhMCQ0gxFTATBgNVBAoTDFN3aXNzU2lnbiBBRzEhMB8GA1UEAxMYU3dpc3NTaWdu +IFNpbHZlciBDQSAtIEcyMB4XDTA2MTAyNTA4MzI0NloXDTM2MTAyNTA4MzI0Nlow +RzELMAkGA1UEBhMCQ0gxFTATBgNVBAoTDFN3aXNzU2lnbiBBRzEhMB8GA1UEAxMY +U3dpc3NTaWduIFNpbHZlciBDQSAtIEcyMIICIjANBgkqhkiG9w0BAQEFAAOCAg8A +MIICCgKCAgEAxPGHf9N4Mfc4yfjDmUO8x/e8N+dOcbpLj6VzHVxumK4DV644N0Mv +Fz0fyM5oEMF4rhkDKxD6LHmD9ui5aLlV8gREpzn5/ASLHvGiTSf5YXu6t+WiE7br +YT7QbNHm+/pe7R20nqA1W6GSy/BJkv6FCgU+5tkL4k+73JU3/JHpMjUi0R86TieF +nbAVlDLaYQ1HTWBCrpJH6INaUFjpiou5XaHc3ZlKHzZnu0jkg7Y360g6rw9njxcH +6ATK72oxh9TAtvmUcXtnZLi2kUpCe2UuMGoM9ZDulebyzYLs2aFK7PayS+VFheZt +eJMELpyCbTapxDFkH4aDCyr0NQp4yVXPQbBH6TCfmb5hqAaEuSh6XzjZG6k4sIN/ +c8HDO0gqgg8hm7jMqDXDhBuDsz6+pJVpATqJAHgE2cn0mRmrVn5bi4Y5FZGkECwJ +MoBgs5PAKrYYC51+jUnyEEp/+dVGLxmSo5mnJqy7jDzmDrxHB9xzUfFwZC8I+bRH +HTBsROopN4WSaGa8gzj+ezku01DwH/teYLappvonQfGbGHLy9YR0SslnxFSuSGTf +jNFusB3hB48IHpmccelM2KX3RxIfdNFRnobzwqIjQAtz20um53MGjMGg6cFZrEb6 +5i/4z3GcRm25xBWNOHkDRUjvxF3XCO6HOSKGsg0PWEP3calILv3q1h8CAwEAAaOB +rDCBqTAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQU +F6DNweRBtjpbO8tFnb0cwpj6hlgwHwYDVR0jBBgwFoAUF6DNweRBtjpbO8tFnb0c +wpj6hlgwRgYDVR0gBD8wPTA7BglghXQBWQEDAQEwLjAsBggrBgEFBQcCARYgaHR0 +cDovL3JlcG9zaXRvcnkuc3dpc3NzaWduLmNvbS8wDQYJKoZIhvcNAQEFBQADggIB +AHPGgeAn0i0P4JUw4ppBf1AsX19iYamGamkYDHRJ1l2E6kFSGG9YrVBWIGrGvShp +WJHckRE1qTodvBqlYJ7YH39FkWnZfrt4csEGDyrOj4VwYaygzQu4OSlWhDJOhrs9 +xCrZ1x9y7v5RoSJBsXECYxqCsGKrXlcSH9/L3XWgwF15kIwb4FDm3jH+mHtwX6WQ +2K34ArZv02DdQEsixT2tOnqfGhpHkXkzuoLcMmkDlm4fS/Bx/uNncqCxv1yL5PqZ +IseEuRuNI5c/7SXgz2W79WEE790eslpBIlqhn10s6FvJbakMDHiqYMZWjwFaDGi8 +aRl5xB9+lwW/xekkUV7U1UtT7dkjWjYDZaPBA61BMPNGG4WQr2W11bHkFlt4dR2X +em1ZqSqPe97Dh4kQmUlzeMg9vVE1dCrV8X5pGyq7O70luJpaPXJhkGaH7gzWTdQR +dAtq/gsD/KNVV4n+SsuuWxcFyPKNIzFTONItaj+CuY0IavdeQXRuwxF+B6wpYJE/ +OMpXEA29MC/HpeZBoNquBYeaoKRlbEwJDIm6uNO5wJOKMPqN5ZprFQFOZ6raYlY+ +hAhm0sQ2fac+EPyI4NSA5QC9qvNOBqN6avlicuMJT+ubDgEj8Z+7fNzcbBGXJbLy +tGMU0gYqZ4yD9c7qB9iaah7s5Aq7KkzrCWA5zspi2C5u +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIEAzCCAuugAwIBAgIQVID5oHPtPwBMyonY43HmSjANBgkqhkiG9w0BAQUFADB1 +MQswCQYDVQQGEwJFRTEiMCAGA1UECgwZQVMgU2VydGlmaXRzZWVyaW1pc2tlc2t1 +czEoMCYGA1UEAwwfRUUgQ2VydGlmaWNhdGlvbiBDZW50cmUgUm9vdCBDQTEYMBYG +CSqGSIb3DQEJARYJcGtpQHNrLmVlMCIYDzIwMTAxMDMwMTAxMDMwWhgPMjAzMDEy +MTcyMzU5NTlaMHUxCzAJBgNVBAYTAkVFMSIwIAYDVQQKDBlBUyBTZXJ0aWZpdHNl +ZXJpbWlza2Vza3VzMSgwJgYDVQQDDB9FRSBDZXJ0aWZpY2F0aW9uIENlbnRyZSBS +b290IENBMRgwFgYJKoZIhvcNAQkBFglwa2lAc2suZWUwggEiMA0GCSqGSIb3DQEB +AQUAA4IBDwAwggEKAoIBAQDIIMDs4MVLqwd4lfNE7vsLDP90jmG7sWLqI9iroWUy +euuOF0+W2Ap7kaJjbMeMTC55v6kF/GlclY1i+blw7cNRfdCT5mzrMEvhvH2/UpvO +bntl8jixwKIy72KyaOBhU8E2lf/slLo2rpwcpzIP5Xy0xm90/XsY6KxX7QYgSzIw +WFv9zajmofxwvI6Sc9uXp3whrj3B9UiHbCe9nyV0gVWw93X2PaRka9ZP585ArQ/d +MtO8ihJTmMmJ+xAdTX7Nfh9WDSFwhfYggx/2uh8Ej+p3iDXE/+pOoYtNP2MbRMNE +1CV2yreN1x5KZmTNXMWcg+HCCIia7E6j8T4cLNlsHaFLAgMBAAGjgYowgYcwDwYD +VR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFBLyWj7qVhy/ +zQas8fElyalL1BSZMEUGA1UdJQQ+MDwGCCsGAQUFBwMCBggrBgEFBQcDAQYIKwYB +BQUHAwMGCCsGAQUFBwMEBggrBgEFBQcDCAYIKwYBBQUHAwkwDQYJKoZIhvcNAQEF +BQADggEBAHv25MANqhlHt01Xo/6tu7Fq1Q+e2+RjxY6hUFaTlrg4wCQiZrxTFGGV +v9DHKpY5P30osxBAIWrEr7BSdxjhlthWXePdNl4dp1BUoMUq5KqMlIpPnTX/dqQG +E5Gion0ARD9V04I8GtVbvFZMIi5GQ4okQC3zErg7cBqklrkar4dBGmoYDQZPxz5u +uSlNDUmJEYcyW+ZLBMjkXOZ0c5RdFpgTlf7727FE5TpwrDdr5rMzcijJs1eg9gIW +iAYLtqZLICjU3j2LrTcFU3T+bsy8QxdxXvnFzBqpYe73dgzzcvRyrc9yAjYHR8/v +GVCJYMzpJJUPwssd8m92kMfMdcGWxZ0= +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIE0zCCA7ugAwIBAgIQGNrRniZ96LtKIVjNzGs7SjANBgkqhkiG9w0BAQUFADCB +yjELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQL +ExZWZXJpU2lnbiBUcnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNiBWZXJp +U2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MUUwQwYDVQQDEzxW +ZXJpU2lnbiBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0 +aG9yaXR5IC0gRzUwHhcNMDYxMTA4MDAwMDAwWhcNMzYwNzE2MjM1OTU5WjCByjEL +MAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZW +ZXJpU2lnbiBUcnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNiBWZXJpU2ln +biwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MUUwQwYDVQQDEzxWZXJp +U2lnbiBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9y +aXR5IC0gRzUwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCvJAgIKXo1 +nmAMqudLO07cfLw8RRy7K+D+KQL5VwijZIUVJ/XxrcgxiV0i6CqqpkKzj/i5Vbex +t0uz/o9+B1fs70PbZmIVYc9gDaTY3vjgw2IIPVQT60nKWVSFJuUrjxuf6/WhkcIz +SdhDY2pSS9KP6HBRTdGJaXvHcPaz3BJ023tdS1bTlr8Vd6Gw9KIl8q8ckmcY5fQG +BO+QueQA5N06tRn/Arr0PO7gi+s3i+z016zy9vA9r911kTMZHRxAy3QkGSGT2RT+ +rCpSx4/VBEnkjWNHiDxpg8v+R70rfk/Fla4OndTRQ8Bnc+MUCH7lP59zuDMKz10/ +NIeWiu5T6CUVAgMBAAGjgbIwga8wDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8E +BAMCAQYwbQYIKwYBBQUHAQwEYTBfoV2gWzBZMFcwVRYJaW1hZ2UvZ2lmMCEwHzAH +BgUrDgMCGgQUj+XTGoasjY5rw8+AatRIGCx7GS4wJRYjaHR0cDovL2xvZ28udmVy +aXNpZ24uY29tL3ZzbG9nby5naWYwHQYDVR0OBBYEFH/TZafC3ey78DAJ80M5+gKv +MzEzMA0GCSqGSIb3DQEBBQUAA4IBAQCTJEowX2LP2BqYLz3q3JktvXf2pXkiOOzE +p6B4Eq1iDkVwZMXnl2YtmAl+X6/WzChl8gGqCBpH3vn5fJJaCGkgDdk+bW48DW7Y +5gaRQBi5+MHt39tBquCWIMnNZBU4gcmU7qKEKQsTb47bDN0lAtukixlE0kF6BWlK +WE9gyn6CagsCqiUXObXbf+eEZSqVir2G3l6BFoMtEMze/aiCKm0oHw0LxOXnGiYZ +4fQRbxC1lfznQgUy286dUV4otp6F01vvpX1FQHKOtw5rDgb7MzVIcbidJ4vEZV8N +hnacRHr2lVz2XTIIM6RUthg/aFzyQkqFOFSDX9HoLPKsEdao7WNq +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIDoDCCAoigAwIBAgIBMTANBgkqhkiG9w0BAQUFADBDMQswCQYDVQQGEwJKUDEc +MBoGA1UEChMTSmFwYW5lc2UgR292ZXJubWVudDEWMBQGA1UECxMNQXBwbGljYXRp +b25DQTAeFw0wNzEyMTIxNTAwMDBaFw0xNzEyMTIxNTAwMDBaMEMxCzAJBgNVBAYT +AkpQMRwwGgYDVQQKExNKYXBhbmVzZSBHb3Zlcm5tZW50MRYwFAYDVQQLEw1BcHBs +aWNhdGlvbkNBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAp23gdE6H +j6UG3mii24aZS2QNcfAKBZuOquHMLtJqO8F6tJdhjYq+xpqcBrSGUeQ3DnR4fl+K +f5Sk10cI/VBaVuRorChzoHvpfxiSQE8tnfWuREhzNgaeZCw7NCPbXCbkcXmP1G55 +IrmTwcrNwVbtiGrXoDkhBFcsovW8R0FPXjQilbUfKW1eSvNNcr5BViCH/OlQR9cw +FO5cjFW6WY2H/CPek9AEjP3vbb3QesmlOmpyM8ZKDQUXKi17safY1vC+9D/qDiht +QWEjdnjDuGWk81quzMKq2edY3rZ+nYVunyoKb58DKTCXKB28t89UKU5RMfkntigm +/qJj5kEW8DOYRwIDAQABo4GeMIGbMB0GA1UdDgQWBBRUWssmP3HMlEYNllPqa0jQ +k/5CdTAOBgNVHQ8BAf8EBAMCAQYwWQYDVR0RBFIwUKROMEwxCzAJBgNVBAYTAkpQ +MRgwFgYDVQQKDA/ml6XmnKzlm73mlL/lupwxIzAhBgNVBAsMGuOCouODl+ODquOC +seODvOOCt+ODp+ODs0NBMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEFBQAD +ggEBADlqRHZ3ODrso2dGD/mLBqj7apAxzn7s2tGJfHrrLgy9mTLnsCTWw//1sogJ +hyzjVOGjprIIC8CFqMjSnHH2HZ9g/DgzE+Ge3Atf2hZQKXsvcJEPmbo0NI2VdMV+ +eKlmXb3KIXdCEKxmJj3ekav9FfBv7WxfEPjzFvYDio+nEhEMy/0/ecGc/WLuo89U +DNErXxc+4z6/wCs+CZv+iKZ+tJIX/COUgb1up8WMwusRRdv4QcmWdupwX3kSa+Sj +B1oF7ydJzyGfikwJcGapJsErEU4z0g781mzSDjJkaP+tBXhfAx2o45CsJOAPQKdL +rosot4LKGAfmt1t06SAZf7IbiVQ= +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIDIDCCAgigAwIBAgIBJDANBgkqhkiG9w0BAQUFADA5MQswCQYDVQQGEwJGSTEP +MA0GA1UEChMGU29uZXJhMRkwFwYDVQQDExBTb25lcmEgQ2xhc3MxIENBMB4XDTAx +MDQwNjEwNDkxM1oXDTIxMDQwNjEwNDkxM1owOTELMAkGA1UEBhMCRkkxDzANBgNV +BAoTBlNvbmVyYTEZMBcGA1UEAxMQU29uZXJhIENsYXNzMSBDQTCCASIwDQYJKoZI +hvcNAQEBBQADggEPADCCAQoCggEBALWJHytPZwp5/8Ue+H887dF+2rDNbS82rDTG +29lkFwhjMDMiikzujrsPDUJVyZ0upe/3p4zDq7mXy47vPxVnqIJyY1MPQYx9EJUk +oVqlBvqSV536pQHydekfvFYmUk54GWVYVQNYwBSujHxVX3BbdyMGNpfzJLWaRpXk +3w0LBUXl0fIdgrvGE+D+qnr9aTCU89JFhfzyMlsy3uhsXR/LpCJ0sICOXZT3BgBL +qdReLjVQCfOAl/QMF6452F/NM8EcyonCIvdFEu1eEpOdY6uCLrnrQkFEy0oaAIIN +nvmLVz5MxxftLItyM19yejhW1ebZrgUaHXVFsculJRwSVzb9IjcCAwEAAaMzMDEw +DwYDVR0TAQH/BAUwAwEB/zARBgNVHQ4ECgQIR+IMi/ZTiFIwCwYDVR0PBAQDAgEG +MA0GCSqGSIb3DQEBBQUAA4IBAQCLGrLJXWG04bkruVPRsoWdd44W7hE928Jj2VuX +ZfsSZ9gqXLar5V7DtxYvyOirHYr9qxp81V9jz9yw3Xe5qObSIjiHBxTZ/75Wtf0H +DjxVyhbMp6Z3N/vbXB9OWQaHowND9Rart4S9Tu+fMTfwRvFAttEMpWT4Y14h21VO +TzF2nBBhjrZTOqMRvq9tfB69ri3iDGnHhVNoomG6xT60eVR4ngrHAr5i0RGCS2Uv +kVrCqIexVmiUefkl98HVrhq4uz2PqYo4Ffdz0Fpg0YCw8NzVUM1O7pJIae2yIx4w +zMiUyLb1O4Z/P6Yun/Y+LLWSlj7fLJOK/4GMDw9ZIRlXvVWa +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIDSjCCAjKgAwIBAgIQRK+wgNajJ7qJMDmGLvhAazANBgkqhkiG9w0BAQUFADA/ +MSQwIgYDVQQKExtEaWdpdGFsIFNpZ25hdHVyZSBUcnVzdCBDby4xFzAVBgNVBAMT +DkRTVCBSb290IENBIFgzMB4XDTAwMDkzMDIxMTIxOVoXDTIxMDkzMDE0MDExNVow +PzEkMCIGA1UEChMbRGlnaXRhbCBTaWduYXR1cmUgVHJ1c3QgQ28uMRcwFQYDVQQD +Ew5EU1QgUm9vdCBDQSBYMzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB +AN+v6ZdQCINXtMxiZfaQguzH0yxrMMpb7NnDfcdAwRgUi+DoM3ZJKuM/IUmTrE4O +rz5Iy2Xu/NMhD2XSKtkyj4zl93ewEnu1lcCJo6m67XMuegwGMoOifooUMM0RoOEq +OLl5CjH9UL2AZd+3UWODyOKIYepLYYHsUmu5ouJLGiifSKOeDNoJjj4XLh7dIN9b +xiqKqy69cK3FCxolkHRyxXtqqzTWMIn/5WgTe1QLyNau7Fqckh49ZLOMxt+/yUFw +7BZy1SbsOFU5Q9D8/RhcQPGX69Wam40dutolucbY38EVAjqr2m7xPi71XAicPNaD +aeQQmxkqtilX4+U9m5/wAl0CAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNV +HQ8BAf8EBAMCAQYwHQYDVR0OBBYEFMSnsaR7LHH62+FLkHX/xBVghYkQMA0GCSqG +SIb3DQEBBQUAA4IBAQCjGiybFwBcqR7uKGY3Or+Dxz9LwwmglSBd49lZRNI+DT69 +ikugdB/OEIKcdBodfpga3csTS7MgROSR6cz8faXbauX+5v3gTt23ADq1cEmv8uXr +AvHRAosZy5Q6XkjEGB5YGV8eAlrwDPGxrancWYaLbumR9YbK+rlmM6pZW87ipxZz +R8srzJmwN0jP41ZL9c8PDHIyh8bwRLtTcm1D9SZImlJnt1ir/md2cXjbDaJWFBM5 +JDGFoqgCWjBH4d1QB7wCCZAA62RjYJsWvIjJEubSfZGL+T0yjWW06XyxV3bqxbYo +Ob8VZRzI9neWagqNdwvYkQsEjgfbKbYK7p2CNTUQ +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIFGTCCBAGgAwIBAgIEPki9xDANBgkqhkiG9w0BAQUFADAxMQswCQYDVQQGEwJE +SzEMMAoGA1UEChMDVERDMRQwEgYDVQQDEwtUREMgT0NFUyBDQTAeFw0wMzAyMTEw +ODM5MzBaFw0zNzAyMTEwOTA5MzBaMDExCzAJBgNVBAYTAkRLMQwwCgYDVQQKEwNU +REMxFDASBgNVBAMTC1REQyBPQ0VTIENBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A +MIIBCgKCAQEArGL2YSCyz8DGhdfjeebM7fI5kqSXLmSjhFuHnEz9pPPEXyG9VhDr +2y5h7JNp46PMvZnDBfwGuMo2HP6QjklMxFaaL1a8z3sM8W9Hpg1DTeLpHTk0zY0s +2RKY+ePhwUp8hjjEqcRhiNJerxomTdXkoCJHhNlktxmW/OwZ5LKXJk5KTMuPJItU +GBxIYXvViGjaXbXqzRowwYCDdlCqT9HU3Tjw7xb04QxQBr/q+3pJoSgrHPb8FTKj +dGqPqcNiKXEx5TukYBdedObaE+3pHx8b0bJoc8YQNHVGEBDjkAB2QMuLt0MJIf+r +TpPGWOmlgtt3xDqZsXKVSQTwtyv6e1mO3QIDAQABo4ICNzCCAjMwDwYDVR0TAQH/ +BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwgewGA1UdIASB5DCB4TCB3gYIKoFQgSkB +AQEwgdEwLwYIKwYBBQUHAgEWI2h0dHA6Ly93d3cuY2VydGlmaWthdC5kay9yZXBv +c2l0b3J5MIGdBggrBgEFBQcCAjCBkDAKFgNUREMwAwIBARqBgUNlcnRpZmlrYXRl +ciBmcmEgZGVubmUgQ0EgdWRzdGVkZXMgdW5kZXIgT0lEIDEuMi4yMDguMTY5LjEu +MS4xLiBDZXJ0aWZpY2F0ZXMgZnJvbSB0aGlzIENBIGFyZSBpc3N1ZWQgdW5kZXIg +T0lEIDEuMi4yMDguMTY5LjEuMS4xLjARBglghkgBhvhCAQEEBAMCAAcwgYEGA1Ud +HwR6MHgwSKBGoESkQjBAMQswCQYDVQQGEwJESzEMMAoGA1UEChMDVERDMRQwEgYD +VQQDEwtUREMgT0NFUyBDQTENMAsGA1UEAxMEQ1JMMTAsoCqgKIYmaHR0cDovL2Ny +bC5vY2VzLmNlcnRpZmlrYXQuZGsvb2Nlcy5jcmwwKwYDVR0QBCQwIoAPMjAwMzAy +MTEwODM5MzBagQ8yMDM3MDIxMTA5MDkzMFowHwYDVR0jBBgwFoAUYLWF7FZkfhIZ +J2cdUBVLc647+RIwHQYDVR0OBBYEFGC1hexWZH4SGSdnHVAVS3OuO/kSMB0GCSqG +SIb2fQdBAAQQMA4bCFY2LjA6NC4wAwIEkDANBgkqhkiG9w0BAQUFAAOCAQEACrom +JkbTc6gJ82sLMJn9iuFXehHTuJTXCRBuo7E4A9G28kNBKWKnctj7fAXmMXAnVBhO +inxO5dHKjHiIzxvTkIvmI/gLDjNDfZziChmPyQE+dF10yYscA+UYyAFMP8uXBV2Y +caaYb7Z8vTd/vuGTJW1v8AqtFxjhA7wHKcitJuj4YfD9IQl+mo6paH1IYnK9AOoB +mbgGglGBTvH1tJFUuSN6AJqfXY3gPGS5GhKSKseCRHI53OI8xthV9RVOyAUO28bQ +YqbsFbS1AoLbrIyigfCbmTH1ICCoiGEKB5+U/NDXG8wuF/MEJ3Zn61SD/aSQfgY9 +BKNDLdr8C2LqL19iUw== +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIDYTCCAkmgAwIBAgIQCgEBAQAAAnwAAAAKAAAAAjANBgkqhkiG9w0BAQUFADA6 +MRkwFwYDVQQKExBSU0EgU2VjdXJpdHkgSW5jMR0wGwYDVQQLExRSU0EgU2VjdXJp +dHkgMjA0OCBWMzAeFw0wMTAyMjIyMDM5MjNaFw0yNjAyMjIyMDM5MjNaMDoxGTAX +BgNVBAoTEFJTQSBTZWN1cml0eSBJbmMxHTAbBgNVBAsTFFJTQSBTZWN1cml0eSAy +MDQ4IFYzMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAt49VcdKA3Xtp +eafwGFAyPGJn9gqVB93mG/Oe2dJBVGutn3y+Gc37RqtBaB4Y6lXIL5F4iSj7Jylg +/9+PjDvJSZu1pJTOAeo+tWN7fyb9Gd3AIb2E0S1PRsNO3Ng3OTsor8udGuorryGl +wSMiuLgbWhOHV4PR8CDn6E8jQrAApX2J6elhc5SYcSa8LWrg903w8bYqODGBDSnh +AMFRD0xS+ARaqn1y07iHKrtjEAMqs6FPDVpeRrc9DvV07Jmf+T0kgYim3WBU6JU2 +PcYJk5qjEoAAVZkZR73QpXzDuvsf9/UP+Ky5tfQ3mBMY3oVbtwyCO4dvlTlYMNpu +AWgXIszACwIDAQABo2MwYTAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIB +BjAfBgNVHSMEGDAWgBQHw1EwpKrpRa41JPr/JCwz0LGdjDAdBgNVHQ4EFgQUB8NR +MKSq6UWuNST6/yQsM9CxnYwwDQYJKoZIhvcNAQEFBQADggEBAF8+hnZuuDU8TjYc +HnmYv/3VEhF5Ug7uMYm83X/50cYVIeiKAVQNOvtUudZj1LGqlk2iQk3UUx+LEN5/ +Zb5gEydxiKRz44Rj0aRV4VCT5hsOedBnvEbIvz8XDZXmxpBp3ue0L96VfdASPz0+ +f00/FGj1EVDVwfSQpQgdMWD/YIwjVAqv/qFuxdF6Kmh4zx6CCiC0H63lhbJqaHVO +rSU3lIW+vaHU6rcMSzyd6BIA8F+sDeGscGNz9395nzIlQnQFgCi/vcEkllgVsRch +6YlL2weIZ/QVrXA+L02FO8K32/6YaCOJ4XQP3vTFhGMpG8zLB8kApKnXwiJPZ9d3 +7CAFYd4= +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIGFDCCA/ygAwIBAgIIU+w77vuySF8wDQYJKoZIhvcNAQEFBQAwUTELMAkGA1UE +BhMCRVMxQjBABgNVBAMMOUF1dG9yaWRhZCBkZSBDZXJ0aWZpY2FjaW9uIEZpcm1h +cHJvZmVzaW9uYWwgQ0lGIEE2MjYzNDA2ODAeFw0wOTA1MjAwODM4MTVaFw0zMDEy +MzEwODM4MTVaMFExCzAJBgNVBAYTAkVTMUIwQAYDVQQDDDlBdXRvcmlkYWQgZGUg +Q2VydGlmaWNhY2lvbiBGaXJtYXByb2Zlc2lvbmFsIENJRiBBNjI2MzQwNjgwggIi +MA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDKlmuO6vj78aI14H9M2uDDUtd9 +thDIAl6zQyrET2qyyhxdKJp4ERppWVevtSBC5IsP5t9bpgOSL/UR5GLXMnE42QQM +cas9UX4PB99jBVzpv5RvwSmCwLTaUbDBPLutN0pcyvFLNg4kq7/DhHf9qFD0sefG +L9ItWY16Ck6WaVICqjaY7Pz6FIMMNx/Jkjd/14Et5cS54D40/mf0PmbR0/RAz15i +NA9wBj4gGFrO93IbJWyTdBSTo3OxDqqHECNZXyAFGUftaI6SEspd/NYrspI8IM/h +X68gvqB2f3bl7BqGYTM+53u0P6APjqK5am+5hyZvQWyIplD9amML9ZMWGxmPsu2b +m8mQ9QEM3xk9Dz44I8kvjwzRAv4bVdZO0I08r0+k8/6vKtMFnXkIoctXMbScyJCy +Z/QYFpM6/EfY0XiWMR+6KwxfXZmtY4laJCB22N/9q06mIqqdXuYnin1oKaPnirja +EbsXLZmdEyRG98Xi2J+Of8ePdG1asuhy9azuJBCtLxTa/y2aRnFHvkLfuwHb9H/T +KI8xWVvTyQKmtFLKbpf7Q8UIJm+K9Lv9nyiqDdVF8xM6HdjAeI9BZzwelGSuewvF +6NkBiDkal4ZkQdU7hwxu+g/GvUgUvzlN1J5Bto+WHWOWk9mVBngxaJ43BjuAiUVh +OSPHG0SjFeUc+JIwuwIDAQABo4HvMIHsMBIGA1UdEwEB/wQIMAYBAf8CAQEwDgYD +VR0PAQH/BAQDAgEGMB0GA1UdDgQWBBRlzeurNR4APn7VdMActHNHDhpkLzCBpgYD +VR0gBIGeMIGbMIGYBgRVHSAAMIGPMC8GCCsGAQUFBwIBFiNodHRwOi8vd3d3LmZp +cm1hcHJvZmVzaW9uYWwuY29tL2NwczBcBggrBgEFBQcCAjBQHk4AUABhAHMAZQBv +ACAAZABlACAAbABhACAAQgBvAG4AYQBuAG8AdgBhACAANAA3ACAAQgBhAHIAYwBl +AGwAbwBuAGEAIAAwADgAMAAxADcwDQYJKoZIhvcNAQEFBQADggIBABd9oPm03cXF +661LJLWhAqvdpYhKsg9VSytXjDvlMd3+xDLx51tkljYyGOylMnfX40S2wBEqgLk9 +am58m9Ot/MPWo+ZkKXzR4Tgegiv/J2Wv+xYVxC5xhOW1//qkR71kMrv2JYSiJ0L1 +ILDCExARzRAVukKQKtJE4ZYm6zFIEv0q2skGz3QeqUvVhyj5eTSSPi5E6PaPT481 +PyWzOdxjKpBrIF/EUhJOlywqrJ2X3kjyo2bbwtKDlaZmp54lD+kLM5FlClrD2VQS +3a/DTg4fJl4N3LON7NWBcN7STyQF82xO9UxJZo3R/9ILJUFI/lGExkKvgATP0H5k +SeTy36LssUzAKh3ntLFlosS88Zj0qnAHY7S42jtM+kAiMFsRpvAFDsYCA0irhpuF +3dvd6qJ2gHN99ZwExEWN57kci57q13XRcrHedUTnQn3iV2t93Jm8PYMo6oCTjcVM +ZcFwgbg4/EMxsvYDNEeyrPsiBsse3RdHHF9mudMaotoRsaS8I8nkvof/uZS2+F0g +StRf571oe2XyFR7SOqkt6dhrJKyXWERHrVkY8SFlcN7ONGCoQPHzPKTDKCOM/icz +Q0CgFzzr6juwcqajuUpLXhZI9LK8yIySxZ2frHI2vDSANGupi5LAuBft7HZT9SQB +jLMi6Et8Vcad+qMUu2WFbm5PEn4KPJ2V +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIENjCCAx6gAwIBAgIBATANBgkqhkiG9w0BAQUFADBvMQswCQYDVQQGEwJTRTEU +MBIGA1UEChMLQWRkVHJ1c3QgQUIxJjAkBgNVBAsTHUFkZFRydXN0IEV4dGVybmFs +IFRUUCBOZXR3b3JrMSIwIAYDVQQDExlBZGRUcnVzdCBFeHRlcm5hbCBDQSBSb290 +MB4XDTAwMDUzMDEwNDgzOFoXDTIwMDUzMDEwNDgzOFowbzELMAkGA1UEBhMCU0Ux +FDASBgNVBAoTC0FkZFRydXN0IEFCMSYwJAYDVQQLEx1BZGRUcnVzdCBFeHRlcm5h +bCBUVFAgTmV0d29yazEiMCAGA1UEAxMZQWRkVHJ1c3QgRXh0ZXJuYWwgQ0EgUm9v +dDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALf3GjPm8gAELTngTlvt +H7xsD821+iO2zt6bETOXpClMfZOfvUq8k+0DGuOPz+VtUFrWlymUWoCwSXrbLpX9 +uMq/NzgtHj6RQa1wVsfwTz/oMp50ysiQVOnGXw94nZpAPA6sYapeFI+eh6FqUNzX +mk6vBbOmcZSccbNQYArHE504B4YCqOmoaSYYkKtMsE8jqzpPhNjfzp/haW+710LX +a0Tkx63ubUFfclpxCDezeWWkWaCUN/cALw3CknLa0Dhy2xSoRcRdKn23tNbE7qzN +E0S3ySvdQwAl+mG5aWpYIxG3pzOPVnVZ9c0p10a3CitlttNCbxWyuHv77+ldU9U0 +WicCAwEAAaOB3DCB2TAdBgNVHQ4EFgQUrb2YejS0Jvf6xCZU7wO94CTLVBowCwYD +VR0PBAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wgZkGA1UdIwSBkTCBjoAUrb2YejS0 +Jvf6xCZU7wO94CTLVBqhc6RxMG8xCzAJBgNVBAYTAlNFMRQwEgYDVQQKEwtBZGRU +cnVzdCBBQjEmMCQGA1UECxMdQWRkVHJ1c3QgRXh0ZXJuYWwgVFRQIE5ldHdvcmsx +IjAgBgNVBAMTGUFkZFRydXN0IEV4dGVybmFsIENBIFJvb3SCAQEwDQYJKoZIhvcN +AQEFBQADggEBALCb4IUlwtYj4g+WBpKdQZic2YR5gdkeWxQHIzZlj7DYd7usQWxH +YINRsPkyPef89iYTx4AWpb9a/IfPeHmJIZriTAcKhjW88t5RxNKWt9x+Tu5w/Rw5 +6wwCURQtjr0W4MHfRnXnJK3s9EK0hZNwEGe6nQY1ShjTK3rMUUKhemPR5ruhxSvC +Nr4TDea9Y355e6cJDUCrat2PisP29owaQgVR1EX1n6diIWgVIEM8med8vSTYqZEX +c4g/VhsxOBi0cQ+azcgOno4uG+GMmIPLHzHxREzGBHNJdmAPx/i9F4BrLunMTA5a +mnkPIAou1Z5jJh5VkpTYghdae9C8x49OhgQ= +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIICgjCCAeugAwIBAgIBBDANBgkqhkiG9w0BAQQFADBTMQswCQYDVQQGEwJVUzEc +MBoGA1UEChMTRXF1aWZheCBTZWN1cmUgSW5jLjEmMCQGA1UEAxMdRXF1aWZheCBT +ZWN1cmUgZUJ1c2luZXNzIENBLTEwHhcNOTkwNjIxMDQwMDAwWhcNMjAwNjIxMDQw +MDAwWjBTMQswCQYDVQQGEwJVUzEcMBoGA1UEChMTRXF1aWZheCBTZWN1cmUgSW5j +LjEmMCQGA1UEAxMdRXF1aWZheCBTZWN1cmUgZUJ1c2luZXNzIENBLTEwgZ8wDQYJ +KoZIhvcNAQEBBQADgY0AMIGJAoGBAM4vGbwXt3fek6lfWg0XTzQaDJj0ItlZ1MRo +RvC0NcWFAyDGr0WlIVFFQesWWDYyb+JQYmT5/VGcqiTZ9J2DKocKIdMSODRsjQBu +WqDZQu4aIZX5UkxVWsUPOE9G+m34LjXWHXzr4vCwdYDIqROsvojvOm6rXyo4YgKw +Env+j6YDAgMBAAGjZjBkMBEGCWCGSAGG+EIBAQQEAwIABzAPBgNVHRMBAf8EBTAD +AQH/MB8GA1UdIwQYMBaAFEp4MlIR21kWNl7fwRQ2QGpHfEyhMB0GA1UdDgQWBBRK +eDJSEdtZFjZe38EUNkBqR3xMoTANBgkqhkiG9w0BAQQFAAOBgQB1W6ibAxHm6VZM +zfmpTMANmvPMZWnmJXbMWbfWVMMdzZmsGd20hdXgPfxiIKeES1hl8eL5lSE/9dR+ +WB5Hh1Q+WKG1tfgq73HnvMP2sUlG4tega+VWeponmHxGYhTnyfxuAxJ5gDgdSIKN +/Bf+KpYrtWKmpj29f5JZzVoqgrI3eQ== +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIDuzCCAqOgAwIBAgIDBETAMA0GCSqGSIb3DQEBBQUAMH4xCzAJBgNVBAYTAlBM +MSIwIAYDVQQKExlVbml6ZXRvIFRlY2hub2xvZ2llcyBTLkEuMScwJQYDVQQLEx5D +ZXJ0dW0gQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkxIjAgBgNVBAMTGUNlcnR1bSBU +cnVzdGVkIE5ldHdvcmsgQ0EwHhcNMDgxMDIyMTIwNzM3WhcNMjkxMjMxMTIwNzM3 +WjB+MQswCQYDVQQGEwJQTDEiMCAGA1UEChMZVW5pemV0byBUZWNobm9sb2dpZXMg +Uy5BLjEnMCUGA1UECxMeQ2VydHVtIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MSIw +IAYDVQQDExlDZXJ0dW0gVHJ1c3RlZCBOZXR3b3JrIENBMIIBIjANBgkqhkiG9w0B +AQEFAAOCAQ8AMIIBCgKCAQEA4/t9o3K6wvDJFIf1awFO4W5AB7ptJ11/91sts1rH +UV+rpDKmYYe2bg+G0jACl/jXaVehGDldamR5xgFZrDwxSjh80gTSSyjoIF87B6LM +TXPb865Px1bVWqeWifrzq2jUI4ZZJ88JJ7ysbnKDHDBy3+Ci6dLhdHUZvSqeexVU +BBvXQzmtVSjF4hq79MDkrjhJM8x2hZ85RdKknvISjFH4fOQtf/WsX+sWn7Et0brM +kUJ3TCXJkDhv2/DM+44el1k+1WBO5gUo7Ul5E0u6SNsv+XLTOcr+H9g0cvW0QM8x +AcPs3hEtF10fuFDRXhmnad4HMyjKUJX5p1TLVIZQRan5SQIDAQABo0IwQDAPBgNV +HRMBAf8EBTADAQH/MB0GA1UdDgQWBBQIds3LB/8k9sXN7buQvOKEN0Z19zAOBgNV +HQ8BAf8EBAMCAQYwDQYJKoZIhvcNAQEFBQADggEBAKaorSLOAT2mo/9i0Eidi15y +sHhE49wcrwn9I0j6vSrEuVUEtRCjjSfeC4Jj0O7eDDd5QVsisrCaQVymcODU0HfL +I9MA4GxWL+FpDQ3Zqr8hgVDZBqWo/5U30Kr+4rP1mS1FhIrlQgnXdAIv94nYmem8 +J9RHjboNRhx3zxSkHLmkMcScKHQDNP8zGSal6Q10tz6XxnboJ5ajZt3hrvJBW8qY +VoNzcOSGGtIxQbovvi0TWnZvTuhOgQ4/WwMioBK+ZlgRSssDxLQqKi2WF+A5VLxI +03YnnZotBqbJ7DnSq9ufmgsnAjUpsUCV5/nonFWIGUbWtzT1fs45mtk48VH3Tyw= +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIDxTCCAq2gAwIBAgIBADANBgkqhkiG9w0BAQsFADCBgzELMAkGA1UEBhMCVVMx +EDAOBgNVBAgTB0FyaXpvbmExEzARBgNVBAcTClNjb3R0c2RhbGUxGjAYBgNVBAoT +EUdvRGFkZHkuY29tLCBJbmMuMTEwLwYDVQQDEyhHbyBEYWRkeSBSb290IENlcnRp +ZmljYXRlIEF1dGhvcml0eSAtIEcyMB4XDTA5MDkwMTAwMDAwMFoXDTM3MTIzMTIz +NTk1OVowgYMxCzAJBgNVBAYTAlVTMRAwDgYDVQQIEwdBcml6b25hMRMwEQYDVQQH +EwpTY290dHNkYWxlMRowGAYDVQQKExFHb0RhZGR5LmNvbSwgSW5jLjExMC8GA1UE +AxMoR28gRGFkZHkgUm9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkgLSBHMjCCASIw +DQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAL9xYgjx+lk09xvJGKP3gElY6SKD +E6bFIEMBO4Tx5oVJnyfq9oQbTqC023CYxzIBsQU+B07u9PpPL1kwIuerGVZr4oAH +/PMWdYA5UXvl+TW2dE6pjYIT5LY/qQOD+qK+ihVqf94Lw7YZFAXK6sOoBJQ7Rnwy +DfMAZiLIjWltNowRGLfTshxgtDj6AozO091GB94KPutdfMh8+7ArU6SSYmlRJQVh +GkSBjCypQ5Yj36w6gZoOKcUcqeldHraenjAKOc7xiID7S13MMuyFYkMlNAJWJwGR +tDtwKj9useiciAF9n9T521NtYJ2/LOdYq7hfRvzOxBsDPAnrSTFcaUaz4EcCAwEA +AaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYE +FDqahQcQZyi27/a9BUFuIMGU2g/eMA0GCSqGSIb3DQEBCwUAA4IBAQCZ21151fmX +WWcDYfF+OwYxdS2hII5PZYe096acvNjpL9DbWu7PdIxztDhC2gV7+AJ1uP2lsdeu +9tfeE8tTEH6KRtGX+rcuKxGrkLAngPnon1rpN5+r5N9ss4UXnT3ZJE95kTXWXwTr +gIOrmgIttRD02JDHBHNA7XIloKmf7J6raBKZV8aPEjoJpL1E/QYVN8Gb5DKj7Tjo +2GTzLH4U/ALqn83/B2gX2yKQOC16jdFU8WnjXzPKej17CuPKf1855eJ1usV2GDPO +LPAvTK33sefOT6jEm0pUBsV/fdUID+Ic/n4XuKxe9tQWskMJDE32p2u0mYRlynqI +4uJEvlz36hz1 +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIFkjCCA3qgAwIBAgIBATANBgkqhkiG9w0BAQsFADBaMQswCQYDVQQGEwJGUjET +MBEGA1UEChMKQ2VydGlub21pczEXMBUGA1UECxMOMDAwMiA0MzM5OTg5MDMxHTAb +BgNVBAMTFENlcnRpbm9taXMgLSBSb290IENBMB4XDTEzMTAyMTA5MTcxOFoXDTMz +MTAyMTA5MTcxOFowWjELMAkGA1UEBhMCRlIxEzARBgNVBAoTCkNlcnRpbm9taXMx +FzAVBgNVBAsTDjAwMDIgNDMzOTk4OTAzMR0wGwYDVQQDExRDZXJ0aW5vbWlzIC0g +Um9vdCBDQTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBANTMCQosP5L2 +fxSeC5yaah1AMGT9qt8OHgZbn1CF6s2Nq0Nn3rD6foCWnoR4kkjW4znuzuRZWJfl +LieY6pOod5tK8O90gC3rMB+12ceAnGInkYjwSond3IjmFPnVAy//ldu9n+ws+hQV +WZUKxkd8aRi5pwP5ynapz8dvtF4F/u7BUrJ1Mofs7SlmO/NKFoL21prbcpjp3vDF +TKWrteoB4owuZH9kb/2jJZOLyKIOSY008B/sWEUuNKqEUL3nskoTuLAPrjhdsKkb +5nPJWqHZZkCqqU2mNAKthH6yI8H7KsZn9DS2sJVqM09xRLWtwHkziOC/7aOgFLSc +CbAK42C++PhmiM1b8XcF4LVzbsF9Ri6OSyemzTUK/eVNfaoqoynHWmgE6OXWk6Ri +wsXm9E/G+Z8ajYJJGYrKWUM66A0ywfRMEwNvbqY/kXPLynNvEiCL7sCCeN5LLsJJ +wx3tFvYk9CcbXFcx3FXuqB5vbKziRcxXV4p1VxngtViZSTYxPDMBbRZKzbgqg4SG +m/lg0h9tkQPTYKbVPZrdd5A9NaSfD171UkRpucC63M9933zZxKyGIjK8e2uR73r4 +F2iw4lNVYC2vPsKD2NkJK/DAZNuHi5HMkesE/Xa0lZrmFAYb1TQdvtj/dBxThZng +WVJKYe2InmtJiUZ+IFrZ50rlau7SZRFDAgMBAAGjYzBhMA4GA1UdDwEB/wQEAwIB +BjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBTvkUz1pcMw6C8I6tNxIqSSaHh0 +2TAfBgNVHSMEGDAWgBTvkUz1pcMw6C8I6tNxIqSSaHh02TANBgkqhkiG9w0BAQsF +AAOCAgEAfj1U2iJdGlg+O1QnurrMyOMaauo++RLrVl89UM7g6kgmJs95Vn6RHJk/ +0KGRHCwPT5iVWVO90CLYiF2cN/z7ZMF4jIuaYAnq1fohX9B0ZedQxb8uuQsLrbWw +F6YSjNRieOpWauwK0kDDPAUwPk2Ut59KA9N9J0u2/kTO+hkzGm2kQtHdzMjI1xZS +g081lLMSVX3l4kLr5JyTCcBMWwerx20RoFAXlCOotQqSD7J6wWAsOMwaplv/8gzj +qh8c3LigkyfeY+N/IZ865Z764BNqdeuWXGKRlI5nU7aJ+BIJy29SWwNyhlCVCNSN +h4YVH5Uk2KRvms6knZtt0rJ2BobGVgjF6wnaNsIbW0G+YSrjcOa4pvi2WsS9Iff/ +ql+hbHY5ZtbqTFXhADObE5hjyW/QASAJN1LnDE8+zbz1X5YnpyACleAu6AdBBR8V +btaw5BngDwKTACdyxYvRVB9dSsNAl35VpnzBMwQUAR1JIGkLGZOdblgi90AMRgwj +Y/M50n92Uaf0yKHxDHYiI0ZSKS3io0EHVmmY0gUJvGnHWmHNj4FgFU2A3ZDifcRQ +8ow7bkrHxuaAKzyBvBGAFhAn1/DNP3nMcyrDflOR1m749fPH0FFNjkulW+YZFzvW +gQncItzujrnEj1PhZ7szuIgVRs/taTX/dQ1G885x4cVrhkIGuUE= +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIFujCCBKKgAwIBAgIBATANBgkqhkiG9w0BAQUFADCBhjELMAkGA1UEBhMCVVMx +HTAbBgNVBAoTFEFwcGxlIENvbXB1dGVyLCBJbmMuMS0wKwYDVQQLEyRBcHBsZSBD +b21wdXRlciBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkxKTAnBgNVBAMTIEFwcGxlIFJv +b3QgQ2VydGlmaWNhdGUgQXV0aG9yaXR5MB4XDTA1MDIxMDAwMTgxNFoXDTI1MDIx +MDAwMTgxNFowgYYxCzAJBgNVBAYTAlVTMR0wGwYDVQQKExRBcHBsZSBDb21wdXRl +ciwgSW5jLjEtMCsGA1UECxMkQXBwbGUgQ29tcHV0ZXIgQ2VydGlmaWNhdGUgQXV0 +aG9yaXR5MSkwJwYDVQQDEyBBcHBsZSBSb290IENlcnRpZmljYXRlIEF1dGhvcml0 +eTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAOSRqQkfkdseR1DrBe1e +eYQt6zaiV0xV7IsZid75S2z1B6siMALoGD74UAnTf0GomPnRymacJGsR0KO75Bsq +wx+VnnoMpEeLW9QWNzPLxA9NzhRp0ckZcvVdDtV/X5vyJQO6VY9NXQ3xZDUjFUsV +WR2zlPf2nJ7PULrBWFBnjwi0IPfLrCwgb3C2PwEwjLdDzw+dPfMrSSgayP7OtbkO +2V4c1ss9tTqt9A8OAJILsSEWLnTVPA3bYharo3GSR1NVwa8vQbP4++NwzeajTEV+ +H0xrUJZBicR0YgsQg0GHM4qBsTBY7FoEMoxos48d3mVz/2deZbxJ2HafMxRloXeU +yS0CAwEAAaOCAi8wggIrMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8EBTADAQH/ +MB0GA1UdDgQWBBQr0GlHlHYJ/vRrjS5ApvdHTX8IXjAfBgNVHSMEGDAWgBQr0GlH +lHYJ/vRrjS5ApvdHTX8IXjCCASkGA1UdIASCASAwggEcMIIBGAYJKoZIhvdjZAUB +MIIBCTBBBggrBgEFBQcCARY1aHR0cHM6Ly93d3cuYXBwbGUuY29tL2NlcnRpZmlj +YXRlYXV0aG9yaXR5L3Rlcm1zLmh0bWwwgcMGCCsGAQUFBwICMIG2GoGzUmVsaWFu +Y2Ugb24gdGhpcyBjZXJ0aWZpY2F0ZSBieSBhbnkgcGFydHkgYXNzdW1lcyBhY2Nl +cHRhbmNlIG9mIHRoZSB0aGVuIGFwcGxpY2FibGUgc3RhbmRhcmQgdGVybXMgYW5k +IGNvbmRpdGlvbnMgb2YgdXNlLCBjZXJ0aWZpY2F0ZSBwb2xpY3kgYW5kIGNlcnRp +ZmljYXRpb24gcHJhY3RpY2Ugc3RhdGVtZW50cy4wRAYDVR0fBD0wOzA5oDegNYYz +aHR0cHM6Ly93d3cuYXBwbGUuY29tL2NlcnRpZmljYXRlYXV0aG9yaXR5L3Jvb3Qu +Y3JsMFUGCCsGAQUFBwEBBEkwRzBFBggrBgEFBQcwAoY5aHR0cHM6Ly93d3cuYXBw +bGUuY29tL2NlcnRpZmljYXRlYXV0aG9yaXR5L2Nhc2lnbmVycy5odG1sMA0GCSqG +SIb3DQEBBQUAA4IBAQCd2i0oWC99dgS5BNM+zrdmY06PL9T+S61yvaM5xlJNBZhS +9YlRASR5vhoy9+VEi0tEBzmC1lrKtCBe2a4VXR2MHTK/ODFiSF3H4ZCx+CRA+F9Y +m1FdV53B5f88zHIhbsTp6aF31ywXJsM/65roCwO66bNKcuszCVut5mIxauivL9Wv +Hld2j383LS4CXN1jyfJxuCZA3xWNdUQ/eb3mHZnhQyw+rW++uaT+DjUZUWOxw961 +kj5ReAFziqQjyqSI8R5cH0EWLX6VCqrpiUGYGxrdyyC/R14MJsVVNU3GMIuZZxTH +CR+6R8faAQmHJEKVvRNgGQrv6n8Obs3BREM6StXj +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIGZjCCBE6gAwIBAgIPB35Sk3vgFeNX8GmMy+wMMA0GCSqGSIb3DQEBBQUAMHsx +CzAJBgNVBAYTAkNPMUcwRQYDVQQKDD5Tb2NpZWRhZCBDYW1lcmFsIGRlIENlcnRp +ZmljYWNpw7NuIERpZ2l0YWwgLSBDZXJ0aWPDoW1hcmEgUy5BLjEjMCEGA1UEAwwa +QUMgUmHDrXogQ2VydGljw6FtYXJhIFMuQS4wHhcNMDYxMTI3MjA0NjI5WhcNMzAw +NDAyMjE0MjAyWjB7MQswCQYDVQQGEwJDTzFHMEUGA1UECgw+U29jaWVkYWQgQ2Ft +ZXJhbCBkZSBDZXJ0aWZpY2FjacOzbiBEaWdpdGFsIC0gQ2VydGljw6FtYXJhIFMu +QS4xIzAhBgNVBAMMGkFDIFJhw616IENlcnRpY8OhbWFyYSBTLkEuMIICIjANBgkq +hkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAq2uJo1PMSCMI+8PPUZYILrgIem08kBeG +qentLhM0R7LQcNzJPNCNyu5LF6vQhbCnIwTLqKL85XXbQMpiiY9QngE9JlsYhBzL +fDe3fezTf3MZsGqy2IiKLUV0qPezuMDU2s0iiXRNWhU5cxh0T7XrmafBHoi0wpOQ +Y5fzp6cSsgkiBzPZkc0OnB8OIMfuuzONj8LSWKdf/WU34ojC2I+GdV75LaeHM/J4 +Ny+LvB2GNzmxlPLYvEqcgxhaBvzz1NS6jBUJJfD5to0EfhcSM2tXSExP2yYe68yQ +54v5aHxwD6Mq0Do43zeX4lvegGHTgNiRg0JaTASJaBE8rF9ogEHMYELODVoqDA+b +MMCm8Ibbq0nXl21Ii/kDwFJnmxL3wvIumGVC2daa49AZMQyth9VXAnow6IYm+48j +ilSH5L887uvDdUhfHjlvgWJsxS3EF1QZtzeNnDeRyPYL1epjb4OsOMLzP96a++Ej +YfDIJss2yKHzMI+ko6Kh3VOz3vCaMh+DkXkwwakfU5tTohVTP92dsxA7SH2JD/zt +A/X7JWR1DhcZDY8AFmd5ekD8LVkH2ZD6mq093ICK5lw1omdMEWux+IBkAC1vImHF +rEsm5VoQgpukg3s0956JkSCXjrdCx2bD0Omk1vUgjcTDlaxECp1bczwmPS9KvqfJ +pxAe+59QafMCAwEAAaOB5jCB4zAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQE +AwIBBjAdBgNVHQ4EFgQU0QnQ6dfOeXRU+Tows/RtLAMDG2gwgaAGA1UdIASBmDCB +lTCBkgYEVR0gADCBiTArBggrBgEFBQcCARYfaHR0cDovL3d3dy5jZXJ0aWNhbWFy +YS5jb20vZHBjLzBaBggrBgEFBQcCAjBOGkxMaW1pdGFjaW9uZXMgZGUgZ2FyYW50 +7WFzIGRlIGVzdGUgY2VydGlmaWNhZG8gc2UgcHVlZGVuIGVuY29udHJhciBlbiBs +YSBEUEMuMA0GCSqGSIb3DQEBBQUAA4ICAQBclLW4RZFNjmEfAygPU3zmpFmps4p6 +xbD/CHwso3EcIRNnoZUSQDWDg4902zNc8El2CoFS3UnUmjIz75uny3XlesuXEpBc +unvFm9+7OSPI/5jOCk0iAUgHforA1SBClETvv3eiiWdIG0ADBaGJ7M9i4z0ldma/ +Jre7Ir5v/zlXdLp6yQGVwZVR6Kss+LGGIOk/yzVb0hfpKv6DExdA7ohiZVvVO2Dp +ezy4ydV/NgIlqmjCMRW3MGXrfx1IebHPOeJCgBbT9ZMj/EyXyVo3bHwi2ErN0o42 +gzmRkBDI8ck1fj+404HGIGQatlDCIaR43NAvO2STdPCWkPHv+wlaNECW8DYSwaN0 +jJN+Qd53i+yG2dIPPy3RzECiiWZIHiCznCNZc6lEc7wkeZBWN7PGKX6jD/EpOe9+ +XCgycDWs2rjIdWb8m0w5R44bb5tNAlQiM+9hup4phO9OSzNHdpdqy35f/RWmnkJD +W2ZaiogN9xa5P1FlK2Zqi9E4UqLWRhH6/JocdJ6PlwsCT2TG9WjTSy3/pDceiz+/ +RL5hRqGEPQgnTIEgd4kI6mdAXmwIUV80WoyWaM3X94nCHNMyAK9Sy9NgWyo6R35r +MDOhYil/SrnhLecUIw4OGEfhefwVVdCx/CVxY3UzHCMrr1zZ7Ud3YA47Dx7SwNxk +BYn8eNZcLCZDqQ== +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIDUzCCAjugAwIBAgIBATANBgkqhkiG9w0BAQUFADBLMQswCQYDVQQGEwJOTzEd +MBsGA1UECgwUQnV5cGFzcyBBUy05ODMxNjMzMjcxHTAbBgNVBAMMFEJ1eXBhc3Mg +Q2xhc3MgMiBDQSAxMB4XDTA2MTAxMzEwMjUwOVoXDTE2MTAxMzEwMjUwOVowSzEL +MAkGA1UEBhMCTk8xHTAbBgNVBAoMFEJ1eXBhc3MgQVMtOTgzMTYzMzI3MR0wGwYD +VQQDDBRCdXlwYXNzIENsYXNzIDIgQ0EgMTCCASIwDQYJKoZIhvcNAQEBBQADggEP +ADCCAQoCggEBAIs8B0XY9t/mx8q6jUPFR42wWsE425KEHK8T1A9vNkYgxC7McXA0 +ojTTNy7Y3Tp3L8DrKehc0rWpkTSHIln+zNvnma+WwajHQN2lFYxuyHyXA8vmIPLX +l18xoS830r7uvqmtqEyeIWZDO6i88wmjONVZJMHCR3axiFyCO7srpgTXjAePzdVB +HfCuuCkslFJgNJQ72uA40Z0zPhX0kzLFANq1KWYOOngPIVJfAuWSeyXTkh4vFZ2B +5J2O6O+JzhRMVB0cgRJNcKi+EAUXfh/RuFdV7c27UsKwHnjCTTZoy1YmwVLBvXb3 +WNVyfh9EdrsAiR0WnVE1703CVu9r4Iw7DekCAwEAAaNCMEAwDwYDVR0TAQH/BAUw +AwEB/zAdBgNVHQ4EFgQUP42aWYv8e3uco684sDntkHGA1sgwDgYDVR0PAQH/BAQD +AgEGMA0GCSqGSIb3DQEBBQUAA4IBAQAVGn4TirnoB6NLJzKyQJHyIdFkhb5jatLP +gcIV1Xp+DCmsNx4cfHZSldq1fyOhKXdlyTKdqC5Wq2B2zha0jX94wNWZUYN/Xtm+ +DKhQ7SLHrQVMdvvt7h5HZPb3J31cKA9FxVxiXqaakZG3Uxcu3K1gnZZkOb1naLKu +BctN518fV4bVIJwo+28TOPX2EZL2fZleHwzoq0QkKXJAPTZSr4xYkHPB7GEseaHs +h7U/2k3ZIQAw3pDaDtMaSKk+hQsUi4y8QZ5q9w5wwDX3OaJdZtB7WZ+oRxKaJyOk +LY4ng5IgodcVf/EuGO70SH8vf/GhGLWhC5SgYiAynB321O+/TIho +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIFnDCCA4SgAwIBAgIBATANBgkqhkiG9w0BAQUFADBjMQswCQYDVQQGEwJGUjET +MBEGA1UEChMKQ2VydGlub21pczEXMBUGA1UECxMOMDAwMiA0MzM5OTg5MDMxJjAk +BgNVBAMMHUNlcnRpbm9taXMgLSBBdXRvcml0w6kgUmFjaW5lMB4XDTA4MDkxNzA4 +Mjg1OVoXDTI4MDkxNzA4Mjg1OVowYzELMAkGA1UEBhMCRlIxEzARBgNVBAoTCkNl +cnRpbm9taXMxFzAVBgNVBAsTDjAwMDIgNDMzOTk4OTAzMSYwJAYDVQQDDB1DZXJ0 +aW5vbWlzIC0gQXV0b3JpdMOpIFJhY2luZTCCAiIwDQYJKoZIhvcNAQEBBQADggIP +ADCCAgoCggIBAJ2Fn4bT46/HsmtuM+Cet0I0VZ35gb5j2CN2DpdUzZlMGvE5x4jY +F1AMnmHawE5V3udauHpOd4cN5bjr+p5eex7Ezyh0x5P1FMYiKAT5kcOrJ3NqDi5N +8y4oH3DfVS9O7cdxbwlyLu3VMpfQ8Vh30WC8Tl7bmoT2R2FFK/ZQpn9qcSdIhDWe +rP5pqZ56XjUl+rSnSTV3lqc2W+HN3yNw2F1MpQiD8aYkOBOo7C+ooWfHpi2GR+6K +/OybDnT0K0kCe5B1jPyZOQE51kqJ5Z52qz6WKDgmi92NjMD2AR5vpTESOH2VwnHu +7XSu5DaiQ3XV8QCb4uTXzEIDS3h65X27uK4uIJPT5GHfceF2Z5c/tt9qc1pkIuVC +28+BA5PY9OMQ4HL2AHCs8MF6DwV/zzRpRbWT5BnbUhYjBYkOjUjkJW+zeL9i9Qf6 +lSTClrLooyPCXQP8w9PlfMl1I9f09bze5N/NgL+RiH2nE7Q5uiy6vdFrzPOlKO1E +nn1So2+WLhl+HPNbxxaOu2B9d2ZHVIIAEWBsMsGoOBvrbpgT1u449fCfDu/+MYHB +0iSVL1N6aaLwD4ZFjliCK0wi1F6g530mJ0jfJUaNSih8hp75mxpZuWW/Bd22Ql09 +5gBIgl4g9xGC3srYn+Y3RyYe63j3YcNBZFgCQfna4NH4+ej9Uji29YnfAgMBAAGj +WzBZMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBQN +jLZh2kS40RR9w759XkjwzspqsDAXBgNVHSAEEDAOMAwGCiqBegFWAgIAAQEwDQYJ +KoZIhvcNAQEFBQADggIBACQ+YAZ+He86PtvqrxyaLAEL9MW12Ukx9F1BjYkMTv9s +ov3/4gbIOZ/xWqndIlgVqIrTseYyCYIDbNc/CMf4uboAbbnW/FIyXaR/pDGUu7ZM +OH8oMDX/nyNTt7buFHAAQCvaR6s0fl6nVjBhK4tDrP22iCj1a7Y+YEq6QpA0Z43q +619FVDsXrIvkxmUP7tCMXWY5zjKn2BCXwH40nJ+U8/aGH88bc62UeYdocMMzpXDn +2NU4lG9jeeu/Cg4I58UvD0KgKxRA/yHgBcUn4YQRE7rWhh1BCxMjidPJC+iKunqj +o3M3NYB9Ergzd0A4wPpeMNLytqOx1qKVl4GbUu1pTP+A5FPbVFsDbVRfsbjvJL1v +nxHDx2TCDyhihWZeGnuyt++uNckZM6i4J9szVb9o4XVIRFb7zdNIu0eJOqxp9YDG +5ERQL1TEqkPFMTFYvZbF6nVsmnWxTfj3l/+WFvKXTej28xH5On2KOG4Ey+HTRRWq +pdEdnV1j6CTmNhTih60bWfVEm/vXd3wfAXBioSAaosUaKPQhA+4u2cGA6rnZgtZb +dsLLO7XSAPCjDuGtbkD326C00EauFddEwk01+dIL8hf2rGbVJLJP0RyZwG71fet0 +BLj5TXcJ17TPBzAJ8bgAVtkXFhYKK4bfjwEZGuW7gmP/vgt2Fl43N+bYdJeimUV5 +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIDODCCAiCgAwIBAgIGIAYFFnACMA0GCSqGSIb3DQEBBQUAMDsxCzAJBgNVBAYT +AlJPMREwDwYDVQQKEwhjZXJ0U0lHTjEZMBcGA1UECxMQY2VydFNJR04gUk9PVCBD +QTAeFw0wNjA3MDQxNzIwMDRaFw0zMTA3MDQxNzIwMDRaMDsxCzAJBgNVBAYTAlJP +MREwDwYDVQQKEwhjZXJ0U0lHTjEZMBcGA1UECxMQY2VydFNJR04gUk9PVCBDQTCC +ASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALczuX7IJUqOtdu0KBuqV5Do +0SLTZLrTk+jUrIZhQGpgV2hUhE28alQCBf/fm5oqrl0Hj0rDKH/v+yv6efHHrfAQ +UySQi2bJqIirr1qjAOm+ukbuW3N7LBeCgV5iLKECZbO9xSsAfsT8AzNXDe3i+s5d +RdY4zTW2ssHQnIFKquSyAVwdj1+ZxLGt24gh65AIgoDzMKND5pCCrlUoSe1b16kQ +OA7+j0xbm0bqQfWwCHTD0IgztnzXdN/chNFDDnU5oSVAKOp4yw4sLjmdjItuFhwv +JoIQ4uNllAoEwF73XVv4EOLQunpL+943AAAaWyjj0pxzPjKHmKHJUS/X3qwzs08C +AwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAcYwHQYDVR0O +BBYEFOCMm9slSbPxfIbWskKHC9BroNnkMA0GCSqGSIb3DQEBBQUAA4IBAQA+0hyJ +LjX8+HXd5n9liPRyTMks1zJO890ZeUe9jjtbkw9QSSQTaxQGcu8J06Gh40CEyecY +MnQ8SG4Pn0vU9x7Tk4ZkVJdjclDVVc/6IJMCopvDI5NOFlV2oHB5bc0hH88vLbwZ +44gx+FkagQnIl6Z0x2DEW8xXjrJ1/RsCCdtZb3KTafcxQdaIOL+Hsr0Wefmq5L6I +Jd1hJyMctTEHBDa0GpC9oHRxUIltvBTjD4au8as+x6AJzKNI0eDbZOeStc+vckNw +i/nDhDwTqn6Sm1dTk/pwwpEOMfmbZ13pljheX7NzTogVZ96edhBiIL5VaZVDADlN +9u6wWk5JRFRYX0KD +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIGnTCCBIWgAwIBAgICBcYwDQYJKoZIhvcNAQEFBQAwRTELMAkGA1UEBhMCQk0x +GTAXBgNVBAoTEFF1b1ZhZGlzIExpbWl0ZWQxGzAZBgNVBAMTElF1b1ZhZGlzIFJv +b3QgQ0EgMzAeFw0wNjExMjQxOTExMjNaFw0zMTExMjQxOTA2NDRaMEUxCzAJBgNV +BAYTAkJNMRkwFwYDVQQKExBRdW9WYWRpcyBMaW1pdGVkMRswGQYDVQQDExJRdW9W +YWRpcyBSb290IENBIDMwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDM +V0IWVJzmmNPTTe7+7cefQzlKZbPoFog02w1ZkXTPkrgEQK0CSzGrvI2RaNggDhoB +4hp7Thdd4oq3P5kazethq8Jlph+3t723j/z9cI8LoGe+AaJZz3HmDyl2/7FWeUUr +H556VOijKTVopAFPD6QuN+8bv+OPEKhyq1hX51SGyMnzW9os2l2ObjyjPtr7guXd +8lyyBTNvijbO0BNO/79KDDRMpsMhvVAEVeuxu537RR5kFd5VAYwCdrXLoT9Cabwv +vWhDFlaJKjdhkf2mrk7AyxRllDdLkgbvBNDInIjbC3uBr7E9KsRlOni27tyAsdLT +mZw67mtaa7ONt9XOnMK+pUsvFrGeaDsGb659n/je7Mwpp5ijJUMv7/FfJuGITfhe +btfZFG4ZM2mnO4SJk8RTVROhUXhA+LjJou57ulJCg54U7QVSWllWp5f8nT8KKdjc +T5EOE7zelaTfi5m+rJsziO+1ga8bxiJTyPbH7pcUsMV8eFLI8M5ud2CEpukqdiDt +WAEXMJPpGovgc2PZapKUSU60rUqFxKMiMPwJ7Wgic6aIDFUhWMXhOp8q3crhkODZ +c6tsgLjoC2SToJyMGf+z0gzskSaHirOi4XCPLArlzW1oUevaPwV/izLmE1xr/l9A +4iLItLRkT9a6fUg+qGkM17uGcclzuD87nSVL2v9A6wIDAQABo4IBlTCCAZEwDwYD +VR0TAQH/BAUwAwEB/zCB4QYDVR0gBIHZMIHWMIHTBgkrBgEEAb5YAAMwgcUwgZMG +CCsGAQUFBwICMIGGGoGDQW55IHVzZSBvZiB0aGlzIENlcnRpZmljYXRlIGNvbnN0 +aXR1dGVzIGFjY2VwdGFuY2Ugb2YgdGhlIFF1b1ZhZGlzIFJvb3QgQ0EgMyBDZXJ0 +aWZpY2F0ZSBQb2xpY3kgLyBDZXJ0aWZpY2F0aW9uIFByYWN0aWNlIFN0YXRlbWVu +dC4wLQYIKwYBBQUHAgEWIWh0dHA6Ly93d3cucXVvdmFkaXNnbG9iYWwuY29tL2Nw +czALBgNVHQ8EBAMCAQYwHQYDVR0OBBYEFPLAE+CCQz777i9nMpY1XNu4ywLQMG4G +A1UdIwRnMGWAFPLAE+CCQz777i9nMpY1XNu4ywLQoUmkRzBFMQswCQYDVQQGEwJC +TTEZMBcGA1UEChMQUXVvVmFkaXMgTGltaXRlZDEbMBkGA1UEAxMSUXVvVmFkaXMg +Um9vdCBDQSAzggIFxjANBgkqhkiG9w0BAQUFAAOCAgEAT62gLEz6wPJv92ZVqyM0 +7ucp2sNbtrCD2dDQ4iH782CnO11gUyeim/YIIirnv6By5ZwkajGxkHon24QRiSem +d1o417+shvzuXYO8BsbRd2sPbSQvS3pspweWyuOEn62Iix2rFo1bZhfZFvSLgNLd ++LJ2w/w4E6oM3kJpK27zPOuAJ9v1pkQNn1pVWQvVDVJIxa6f8i+AxeoyUDUSly7B +4f/xI4hROJ/yZlZ25w9Rl6VSDE1JUZU2Pb+iSwwQHYaZTKrzchGT5Or2m9qoXadN +t54CrnMAyNojA+j56hl0YgCUyyIgvpSnWbWCar6ZeXqp8kokUvd0/bpO5qgdAm6x +DYBEwa7TIzdfu4V8K5Iu6H6li92Z4b8nby1dqnuH/grdS/yO9SbkbnBCbjPsMZ57 +k8HkyWkaPcBrTiJt7qtYTcbQQcEr6k8Sh17rRdhs9ZgC06DYVYoGmRmioHfRMJ6s +zHXug/WwYjnPbFfiTNKRCw51KBuav/0aQ/HKd/s7j2G4aSgWQgRecCocIdiP4b0j +Wy10QJLZYxkNc91pvGJHvOB0K7Lrfb5BG7XARsWhIstfTsEokt4YutUqKLsRixeT +mJlglFwjz1onl14LBQaTNx47aTbrqZ5hHY8y2o4M1nQ+ewkk2gF3R8Q7zTSMmfXK +4SVhM7JZG+Ju1zdXtg2pEto= +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIDVTCCAj2gAwIBAgIESTMAATANBgkqhkiG9w0BAQUFADAyMQswCQYDVQQGEwJD +TjEOMAwGA1UEChMFQ05OSUMxEzARBgNVBAMTCkNOTklDIFJPT1QwHhcNMDcwNDE2 +MDcwOTE0WhcNMjcwNDE2MDcwOTE0WjAyMQswCQYDVQQGEwJDTjEOMAwGA1UEChMF +Q05OSUMxEzARBgNVBAMTCkNOTklDIFJPT1QwggEiMA0GCSqGSIb3DQEBAQUAA4IB +DwAwggEKAoIBAQDTNfc/c3et6FtzF8LRb+1VvG7q6KR5smzDo+/hn7E7SIX1mlwh +IhAsxYLO2uOabjfhhyzcuQxauohV3/2q2x8x6gHx3zkBwRP9SFIhxFXf2tizVHa6 +dLG3fdfA6PZZxU3Iva0fFNrfWEQlMhkqx35+jq44sDB7R3IJMfAw28Mbdim7aXZO +V/kbZKKTVrdvmW7bCgScEeOAH8tjlBAKqeFkgjH5jCftppkA9nCTGPihNIaj3XrC +GHn2emU1z5DrvTOTn1OrczvmmzQgLx3vqR1jGqCA2wMv+SYahtKNu6m+UjqHZ0gN +v7Sg2Ca+I19zN38m5pIEo3/PIKe38zrKy5nLAgMBAAGjczBxMBEGCWCGSAGG+EIB +AQQEAwIABzAfBgNVHSMEGDAWgBRl8jGtKvf33VKWCscCwQ7vptU7ETAPBgNVHRMB +Af8EBTADAQH/MAsGA1UdDwQEAwIB/jAdBgNVHQ4EFgQUZfIxrSr3991SlgrHAsEO +76bVOxEwDQYJKoZIhvcNAQEFBQADggEBAEs17szkrr/Dbq2flTtLP1se31cpolnK +OOK5Gv+e5m4y3R6u6jW39ZORTtpC4cMXYFDy0VwmuYK36m3knITnA3kXr5g9lNvH +ugDnuL8BV8F3RTIMO/G0HAiw/VGgod2aHRM2mm23xzy54cXZF/qD1T0VoDy7Hgvi +yJA/qIYM/PmLXoXLT1tLYhFHxUV8BS9BsZ4QaRuZluBVeftOhpm4lNqGOGqTo+fL +buXf6iFViZx9fX+Y9QCJ7uOEwFyWtcVG6kbghVW2G8kS1sHNzYDzAgE8yGnLRUhj +2JTQ7IUOO04RZfSCjKY9ri4ilAnIXOo8gV0WKgOXFlUJ24pBgp5mmxE= +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIDVDCCAjygAwIBAgIDAjRWMA0GCSqGSIb3DQEBBQUAMEIxCzAJBgNVBAYTAlVT +MRYwFAYDVQQKEw1HZW9UcnVzdCBJbmMuMRswGQYDVQQDExJHZW9UcnVzdCBHbG9i +YWwgQ0EwHhcNMDIwNTIxMDQwMDAwWhcNMjIwNTIxMDQwMDAwWjBCMQswCQYDVQQG +EwJVUzEWMBQGA1UEChMNR2VvVHJ1c3QgSW5jLjEbMBkGA1UEAxMSR2VvVHJ1c3Qg +R2xvYmFsIENBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA2swYYzD9 +9BcjGlZ+W988bDjkcbd4kdS8odhM+KhDtgPpTSEHCIjaWC9mOSm9BXiLnTjoBbdq +fnGk5sRgprDvgOSJKA+eJdbtg/OtppHHmMlCGDUUna2YRpIuT8rxh0PBFpVXLVDv +iS2Aelet8u5fa9IAjbkU+BQVNdnARqN7csiRv8lVK83Qlz6cJmTM386DGXHKTubU +1XupGc1V3sjs0l44U+VcT4wt/lAjNvxm5suOpDkZALeVAjmRCw7+OC7RHQWa9k0+ +bw8HHa8sHo9gOeL6NlMTOdReJivbPagUvTLrGAMoUgRx5aszPeE4uwc2hGKceeoW +MPRfwCvocWvk+QIDAQABo1MwUTAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBTA +ephojYn7qwVkDBF9qn1luMrMTjAfBgNVHSMEGDAWgBTAephojYn7qwVkDBF9qn1l +uMrMTjANBgkqhkiG9w0BAQUFAAOCAQEANeMpauUvXVSOKVCUn5kaFOSPeCpilKIn +Z57QzxpeR+nBsqTP3UEaBU6bS+5Kb1VSsyShNwrrZHYqLizz/Tt1kL/6cdjHPTfS +tQWVYrmm3ok9Nns4d0iXrKYgjy6myQzCsplFAMfOEVEiIuCl6rYVSAlk6l5PdPcF +PseKUgzbFbS9bZvlxrFUaKnjaZC2mqUPuLk/IH2uSrW4nOQdtqvmlKXBx4Ot2/Un +hw4EbNX/3aBd7YdStysVAq45pmp06drE57xNNB6pXE0zX5IJL4hmXXeXxx12E6nV +5fEWCRE11azbJHFwLJhWC9kXtNHjUStedejV0NxPNO3CBWaAocvmMw== +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIDyzCCArOgAwIBAgIDAOJIMA0GCSqGSIb3DQEBBQUAMIGLMQswCQYDVQQGEwJB +VDFIMEYGA1UECgw/QS1UcnVzdCBHZXMuIGYuIFNpY2hlcmhlaXRzc3lzdGVtZSBp +bSBlbGVrdHIuIERhdGVudmVya2VociBHbWJIMRgwFgYDVQQLDA9BLVRydXN0LVF1 +YWwtMDIxGDAWBgNVBAMMD0EtVHJ1c3QtUXVhbC0wMjAeFw0wNDEyMDIyMzAwMDBa +Fw0xNDEyMDIyMzAwMDBaMIGLMQswCQYDVQQGEwJBVDFIMEYGA1UECgw/QS1UcnVz +dCBHZXMuIGYuIFNpY2hlcmhlaXRzc3lzdGVtZSBpbSBlbGVrdHIuIERhdGVudmVy +a2VociBHbWJIMRgwFgYDVQQLDA9BLVRydXN0LVF1YWwtMDIxGDAWBgNVBAMMD0Et +VHJ1c3QtUXVhbC0wMjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAJaR +q9eOsFm4Ab20Hq2Z/aH86gyWa48uSUjY6eQkguHYuszr3gdcSMYZggFHQgnhfLmf +ro/27l5rqKhWiDhWs+b+yZ1PNDhRPJy+86ycHMg9XJqErveULBSyZDdgjhSwOyrN +ibUir/fkf+4sKzP5jjytTKJXD/uCxY4fAd9TjMEVpN3umpIS0ijpYhclYDHvzzGU +833z5Dwhq5D8bc9jp8YSAHFJ1xzIoO1jmn3jjyjdYPnY5harJtHQL73nDQnfbtTs +5ThT9GQLulrMgLU4WeyAWWWEMWpfVZFMJOUkmoOEer6A8e5fIAeqdxdsC+JVqpZ4 +CAKel/Arrlj1gFA//jsCAwEAAaM2MDQwDwYDVR0TAQH/BAUwAwEB/zARBgNVHQ4E +CgQIQj0rJKbBRc4wDgYDVR0PAQH/BAQDAgEGMA0GCSqGSIb3DQEBBQUAA4IBAQBG +yxFjUA2bPkXUSC2SfJ29tmrbiLKal+g6a9M8Xwd+Ejo+oYkNP6F4GfeDtAXpm7xb +9Ly8lhdbHcpRhzCUQHJ1tBCiGdLgmhSx7TXjhhanKOdDgkdsC1T+++piuuYL72TD +gUy2Sb1GHlJ1Nc6rvB4fpxSDAOHqGpUq9LWsc3tFkXqRqmQVtqtR77npKIFBioc6 +2jTBwDMPX3hDJDR1DSPc6BnZliaNw2IHdiMQ0mBoYeRnFdq+TyDKsjmJOOQPLzzL +/saaw6F891+gBjLFEFquDyR73lAPJS279R3csi8WWk4ZYUC/1V8H3Ktip/J6ac8e +qhLCbmJ81Lo92JGHz/ot +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIDdzCCAl+gAwIBAgIEAgAAuTANBgkqhkiG9w0BAQUFADBaMQswCQYDVQQGEwJJ +RTESMBAGA1UEChMJQmFsdGltb3JlMRMwEQYDVQQLEwpDeWJlclRydXN0MSIwIAYD +VQQDExlCYWx0aW1vcmUgQ3liZXJUcnVzdCBSb290MB4XDTAwMDUxMjE4NDYwMFoX +DTI1MDUxMjIzNTkwMFowWjELMAkGA1UEBhMCSUUxEjAQBgNVBAoTCUJhbHRpbW9y +ZTETMBEGA1UECxMKQ3liZXJUcnVzdDEiMCAGA1UEAxMZQmFsdGltb3JlIEN5YmVy +VHJ1c3QgUm9vdDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKMEuyKr +mD1X6CZymrV51Cni4eiVgLGw41uOKymaZN+hXe2wCQVt2yguzmKiYv60iNoS6zjr +IZ3AQSsBUnuId9Mcj8e6uYi1agnnc+gRQKfRzMpijS3ljwumUNKoUMMo6vWrJYeK +mpYcqWe4PwzV9/lSEy/CG9VwcPCPwBLKBsua4dnKM3p31vjsufFoREJIE9LAwqSu +XmD+tqYF/LTdB1kC1FkYmGP1pWPgkAx9XbIGevOF6uvUA65ehD5f/xXtabz5OTZy +dc93Uk3zyZAsuT3lySNTPx8kmCFcB5kpvcY67Oduhjprl3RjM71oGDHweI12v/ye +jl0qhqdNkNwnGjkCAwEAAaNFMEMwHQYDVR0OBBYEFOWdWTCCR1jMrPoIVDaGezq1 +BE3wMBIGA1UdEwEB/wQIMAYBAf8CAQMwDgYDVR0PAQH/BAQDAgEGMA0GCSqGSIb3 +DQEBBQUAA4IBAQCFDF2O5G9RaEIFoN27TyclhAO992T9Ldcw46QQF+vaKSm2eT92 +9hkTI7gQCvlYpNRhcL0EYWoSihfVCr3FvDB81ukMJY2GQE/szKN+OMY3EU/t3Wgx +jkzSswF07r51XgdIGn9w/xZchMB5hbgF/X++ZRGjD8ACtPhSNzkE1akxehi/oCr0 +Epn3o0WC4zxe9Z2etciefC7IpJ5OCBRLbf1wbWsaY71k5h+3zvDyny67G7fyUIhz +ksLi4xaNmjICq44Y3ekQEe5+NauQrz4wlHrQMz2nZQ/1/I6eYs9HRCwBXbsdtTLS +R9I4LtD+gdwyah617jzV/OeBHRnDJELqYzmp +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIEkTCCA3mgAwIBAgIERWtQVDANBgkqhkiG9w0BAQUFADCBsDELMAkGA1UEBhMC +VVMxFjAUBgNVBAoTDUVudHJ1c3QsIEluYy4xOTA3BgNVBAsTMHd3dy5lbnRydXN0 +Lm5ldC9DUFMgaXMgaW5jb3Jwb3JhdGVkIGJ5IHJlZmVyZW5jZTEfMB0GA1UECxMW +KGMpIDIwMDYgRW50cnVzdCwgSW5jLjEtMCsGA1UEAxMkRW50cnVzdCBSb290IENl +cnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTA2MTEyNzIwMjM0MloXDTI2MTEyNzIw +NTM0MlowgbAxCzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1FbnRydXN0LCBJbmMuMTkw +NwYDVQQLEzB3d3cuZW50cnVzdC5uZXQvQ1BTIGlzIGluY29ycG9yYXRlZCBieSBy +ZWZlcmVuY2UxHzAdBgNVBAsTFihjKSAyMDA2IEVudHJ1c3QsIEluYy4xLTArBgNV +BAMTJEVudHJ1c3QgUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTCCASIwDQYJ +KoZIhvcNAQEBBQADggEPADCCAQoCggEBALaVtkNC+sZtKm9I35RMOVcF7sN5EUFo +Nu3s/poBj6E4KPz3EEZmLk0eGrEaTsbRwJWIsMn/MYszA9u3g3s+IIRe7bJWKKf4 +4LlAcTfFy0cOlypowCKVYhXbR9n10Cv/gkvJrT7eTNuQgFA/CYqEAOwwCj0Yzfv9 +KlmaI5UXLEWeH25DeW0MXJj+SKfFI0dcXv1u5x609mhF0YaDW6KKjbHjKYD+JXGI +rb68j6xSlkuqUY3kEzEZ6E5Nn9uss2rVvDlUccp6en+Q3X0dgNmBu1kmwhH+5pPi +94DkZfs0Nw4pgHBNrziGLp5/V6+eF67rHMsoIV+2HNjnogQi+dPa2MsCAwEAAaOB +sDCBrTAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zArBgNVHRAEJDAi +gA8yMDA2MTEyNzIwMjM0MlqBDzIwMjYxMTI3MjA1MzQyWjAfBgNVHSMEGDAWgBRo +kORnpKZTgMeGZqTx90tD+4S9bTAdBgNVHQ4EFgQUaJDkZ6SmU4DHhmak8fdLQ/uE +vW0wHQYJKoZIhvZ9B0EABBAwDhsIVjcuMTo0LjADAgSQMA0GCSqGSIb3DQEBBQUA +A4IBAQCT1DCw1wMgKtD5Y+iRDAUgqV8ZyntyTtSx29CW+1RaGSwMCPeyvIWonX9t +O1KzKtvn1ISMY/YPyyYBkVBs9F8U4pN0wBOeMDpQ47RgxRzwIkSNcUesyBrJ6Zua +AGAT/3B+XxFNSRuzFVJ7yVTav52Vr2ua2J7p8eRDjeIRRDq/r72DQnNSi6q7pynP +9WQcCk3RvKqsnyrQ/39/2n3qse0wJcGE2jTSW3iDVuycNsMm4hH2Z0kdkquM++v/ +eu6FSqdQgPCnXEqULl8FmTxSQeDNtGPPAUO6nIPcj2A781q0tHuu2guQOHXvgR1m +0vdXcDazv/wor3ElhVsT/h5/WrQ8 +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIICpzCCAi2gAwIBAgIQTHm1miicdjFk9YlE0JEC3jAKBggqhkjOPQQDAzCBlDEL +MAkGA1UEBhMCVVMxHTAbBgNVBAoTFFN5bWFudGVjIENvcnBvcmF0aW9uMR8wHQYD +VQQLExZTeW1hbnRlYyBUcnVzdCBOZXR3b3JrMUUwQwYDVQQDEzxTeW1hbnRlYyBD +bGFzcyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5IC0g +RzQwHhcNMTIxMDE4MDAwMDAwWhcNMzcxMjAxMjM1OTU5WjCBlDELMAkGA1UEBhMC +VVMxHTAbBgNVBAoTFFN5bWFudGVjIENvcnBvcmF0aW9uMR8wHQYDVQQLExZTeW1h +bnRlYyBUcnVzdCBOZXR3b3JrMUUwQwYDVQQDEzxTeW1hbnRlYyBDbGFzcyAzIFB1 +YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5IC0gRzQwdjAQBgcq +hkjOPQIBBgUrgQQAIgNiAARXz+qzOU0/oSHgbi84csaHl/OFC0fnD1HI0fSZm8pZ +Zf9M+eoLtyXV0vbsMS0yYhLXdoan+jjJZdT+c+KEOfhMSWIT3brViKBfPchPsD+P +oVAR5JNGrcNfy/GkapVW6MCjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8E +BTADAQH/MB0GA1UdDgQWBBQknbzScfcdwiW+IvGJpSwVOzQeXjAKBggqhkjOPQQD +AwNoADBlAjEAuWZoZdsF0Dh9DvPIdWG40CjEsUozUVj78jwQyK5HeHbKZiQXhj5Q +Vm6lLZmIuL0kAjAD6qfnqDzqnWLGX1TamPR3vU+PGJyRXEdrQE0QHbPhicoLIsga +xcX+i93B3294n5E= +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIDxTCCAq2gAwIBAgIQAqxcJmoLQJuPC3nyrkYldzANBgkqhkiG9w0BAQUFADBs +MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3 +d3cuZGlnaWNlcnQuY29tMSswKQYDVQQDEyJEaWdpQ2VydCBIaWdoIEFzc3VyYW5j +ZSBFViBSb290IENBMB4XDTA2MTExMDAwMDAwMFoXDTMxMTExMDAwMDAwMFowbDEL +MAkGA1UEBhMCVVMxFTATBgNVBAoTDERpZ2lDZXJ0IEluYzEZMBcGA1UECxMQd3d3 +LmRpZ2ljZXJ0LmNvbTErMCkGA1UEAxMiRGlnaUNlcnQgSGlnaCBBc3N1cmFuY2Ug +RVYgUm9vdCBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMbM5XPm ++9S75S0tMqbf5YE/yc0lSbZxKsPVlDRnogocsF9ppkCxxLeyj9CYpKlBWTrT3JTW +PNt0OKRKzE0lgvdKpVMSOO7zSW1xkX5jtqumX8OkhPhPYlG++MXs2ziS4wblCJEM +xChBVfvLWokVfnHoNb9Ncgk9vjo4UFt3MRuNs8ckRZqnrG0AFFoEt7oT61EKmEFB +Ik5lYYeBQVCmeVyJ3hlKV9Uu5l0cUyx+mM0aBhakaHPQNAQTXKFx01p8VdteZOE3 +hzBWBOURtCmAEvF5OYiiAhF8J2a3iLd48soKqDirCmTCv2ZdlYTBoSUeh10aUAsg +EsxBu24LUTi4S8sCAwEAAaNjMGEwDgYDVR0PAQH/BAQDAgGGMA8GA1UdEwEB/wQF +MAMBAf8wHQYDVR0OBBYEFLE+w2kD+L9HAdSYJhoIAu9jZCvDMB8GA1UdIwQYMBaA +FLE+w2kD+L9HAdSYJhoIAu9jZCvDMA0GCSqGSIb3DQEBBQUAA4IBAQAcGgaX3Nec +nzyIZgYIVyHbIUf4KmeqvxgydkAQV8GK83rZEWWONfqe/EW1ntlMMUu4kehDLI6z +eM7b41N5cdblIZQB2lWHmiRk9opmzN6cN82oNLFpmyPInngiK3BD41VHMWEZ71jF +hS9OMPagMRYjyOfiZRYzy78aG6A9+MpeizGLYAiJLQwGXFK3xPkKmNEVX58Svnw2 +Yzi9RKR/5CYrCsSXaQ3pjOLAEFe4yHYSkVXySGnYvCoCWw9E1CAx2/S6cCZdkGCe +vEsXCS+0yx5DaMkHJ8HSXPfqIbloEpw8nL+e/IBcm2PN7EeqJSdnoDfzAIJ9VNep ++OkuE6N36B9K +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIGHDCCBASgAwIBAgIES45gAzANBgkqhkiG9w0BAQsFADBFMQswCQYDVQQGEwJE +SzESMBAGA1UEChMJVFJVU1QyNDA4MSIwIAYDVQQDExlUUlVTVDI0MDggT0NFUyBQ +cmltYXJ5IENBMB4XDTEwMDMwMzEyNDEzNFoXDTM3MTIwMzEzMTEzNFowRTELMAkG +A1UEBhMCREsxEjAQBgNVBAoTCVRSVVNUMjQwODEiMCAGA1UEAxMZVFJVU1QyNDA4 +IE9DRVMgUHJpbWFyeSBDQTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIB +AJlJodr3U1Fa+v8HnyACHV81/wLevLS0KUk58VIABl6Wfs3LLNoj5soVAZv4LBi5 +gs7E8CZ9w0F2CopW8vzM8i5HLKE4eedPdnaFqHiBZ0q5aaaQArW+qKJx1rT/AaXt +alMB63/yvJcYlXS2lpexk5H/zDBUXeEQyvfmK+slAySWT6wKxIPDwVapauFY9QaG ++VBhCa5jBstWS7A5gQfEvYqn6csZ3jW472kW6OFNz6ftBcTwufomGJBMkonf4ZLr +6t0AdRi9jflBPz3MNNRGxyjIuAmFqGocYFA/OODBRjvSHB2DygqQ8k+9tlpvzMRr +kU7jq3RKL+83G1dJ3/LTjCLz4ryEMIC/OJ/gNZfE0qXddpPtzflIPtUFVffXdbFV +1t6XZFhJ+wBHQCpJobq/BjqLWUA86upsDbfwnePtmIPRCemeXkY0qabC+2Qmd2Fe +xyZphwTyMnbqy6FG1tB65dYf3mOqStmLa3RcHn9+2dwNfUkh0tjO2FXD7drWcU0O +I9DW8oAypiPhm/QCjMU6j6t+0pzqJ/S0tdAo+BeiXK5hwk6aR+sRb608QfBbRAs3 +U/q8jSPByenggac2BtTN6cl+AA1Mfcgl8iXWNFVGegzd/VS9vINClJCe3FNVoUnR +YCKkj+x0fqxvBLopOkJkmuZw/yhgMxljUi2qYYGn90OzAgMBAAGjggESMIIBDjAP +BgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBBjARBgNVHSAECjAIMAYGBFUd +IAAwgZcGA1UdHwSBjzCBjDAsoCqgKIYmaHR0cDovL2NybC5vY2VzLnRydXN0MjQw +OC5jb20vb2Nlcy5jcmwwXKBaoFikVjBUMQswCQYDVQQGEwJESzESMBAGA1UEChMJ +VFJVU1QyNDA4MSIwIAYDVQQDExlUUlVTVDI0MDggT0NFUyBQcmltYXJ5IENBMQ0w +CwYDVQQDEwRDUkwxMB8GA1UdIwQYMBaAFPZt+LFIs0FDAduGROUYBbdezAY3MB0G +A1UdDgQWBBT2bfixSLNBQwHbhkTlGAW3XswGNzANBgkqhkiG9w0BAQsFAAOCAgEA +VPAQGrT7dIjD3/sIbQW86f9CBPu0c7JKN6oUoRUtKqgJ2KCdcB5ANhCoyznHpu3m +/dUfVUI5hc31CaPgZyY37hch1q4/c9INcELGZVE/FWfehkH+acpdNr7j8UoRZlkN +15b/0UUBfGeiiJG/ugo4llfoPrp8bUmXEGggK3wyqIPcJatPtHwlb6ympfC2b/Ld +v/0IdIOzIOm+A89Q0utx+1cOBq72OHy8gpGb6MfncVFMoL2fjP652Ypgtr8qN9Ka +/XOazktiIf+2Pzp7hLi92hRc9QMYexrV/nnFSQoWdU8TqULFUoZ3zTEC3F/g2yj+ +FhbrgXHGo5/A4O74X+lpbY2XV47aSuw+DzcPt/EhMj2of7SA55WSgbjPMbmNX0rb +oenSIte2HRFW5Tr2W+qqkc/StixgkKdyzGLoFx/xeTWdJkZKwyjqge2wJqws2upY +EiThhC497+/mTiSuXd69eVUwKyqYp9SD2rTtNmF6TCghRM/dNsJOl+osxDVGcwvt +WIVFF/Onlu5fu1NHXdqNEfzldKDUvCfii3L2iATTZyHwU9CALE+2eIA+PIaLgnM1 +1oCfUnYBkQurTrihvzz9PryCVkLxiqRmBVvUz+D4N5G/wvvKDS6t6cPCS+hqM482 +cbBsn0R9fFLO4El62S9eH1tqOzO20OAOK65yJIsOpSE= +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIDWjCCAkKgAwIBAgIBADANBgkqhkiG9w0BAQUFADBQMQswCQYDVQQGEwJKUDEY +MBYGA1UEChMPU0VDT00gVHJ1c3QubmV0MScwJQYDVQQLEx5TZWN1cml0eSBDb21t +dW5pY2F0aW9uIFJvb3RDQTEwHhcNMDMwOTMwMDQyMDQ5WhcNMjMwOTMwMDQyMDQ5 +WjBQMQswCQYDVQQGEwJKUDEYMBYGA1UEChMPU0VDT00gVHJ1c3QubmV0MScwJQYD +VQQLEx5TZWN1cml0eSBDb21tdW5pY2F0aW9uIFJvb3RDQTEwggEiMA0GCSqGSIb3 +DQEBAQUAA4IBDwAwggEKAoIBAQCzs/5/022x7xZ8V6UMbXaKL0u/ZPtM7orw8yl8 +9f/uKuDp6bpbZCKamm8sOiZpUQWZJtzVHGpxxpp9Hp3dfGzGjGdnSj74cbAZJ6kJ +DKaVv0uMDPpVmDvY6CKhS3E4eayXkmmziX7qIWgGmBSWh9JhNrxtJ1aeV+7AwFb9 +Ms+k2Y7CI9eNqPPYJayX5HA49LY6tJ07lyZDo6G8SVlyTCMwhwFY9k6+HGhWZq/N +QV3Is00qVUarH9oe4kA92819uZKAnDfdDJZkndwi92SL32HeFZRSFaB9UslLqCHJ +xrHty8OVYNEP8Ktw+N/LTX7s1vqr2b1/VPKl6Xn62dZ2JChzAgMBAAGjPzA9MB0G +A1UdDgQWBBSgc0mZaNyFW2XjmygvV5+9M7wHSDALBgNVHQ8EBAMCAQYwDwYDVR0T +AQH/BAUwAwEB/zANBgkqhkiG9w0BAQUFAAOCAQEAaECpqLvkT115swW1F7NgE+vG +kl3g0dNq/vu+m22/xwVtWSDEHPC32oRYAmP6SBbvT6UL90qY8j+eG61Ha2POCEfr +Uj94nK9NrvjVT8+amCoQQTlSxN3Zmw7vkwGusi7KaEIkQmywszo+zenaSMQVy+n5 +Bw+SUEmK3TGXX8npN6o7WWWXlDLJs58+OmJYxUmtYg5xpTKqL8aJdkNAExNnPaJU +JRDL8Try2frbSVa7pv6nQTXD4IhhyYjH3zYQIphZ6rBK+1YWc26sTfcioU+tHXot +RSflMMFe8toTyyVCUZVHA4xsIcx0Qu1T/zOLjw9XARYvz6buyXAiFL39vmwLAw== +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIICkDCCAfmgAwIBAgIBATANBgkqhkiG9w0BAQQFADBaMQswCQYDVQQGEwJVUzEc +MBoGA1UEChMTRXF1aWZheCBTZWN1cmUgSW5jLjEtMCsGA1UEAxMkRXF1aWZheCBT +ZWN1cmUgR2xvYmFsIGVCdXNpbmVzcyBDQS0xMB4XDTk5MDYyMTA0MDAwMFoXDTIw +MDYyMTA0MDAwMFowWjELMAkGA1UEBhMCVVMxHDAaBgNVBAoTE0VxdWlmYXggU2Vj +dXJlIEluYy4xLTArBgNVBAMTJEVxdWlmYXggU2VjdXJlIEdsb2JhbCBlQnVzaW5l +c3MgQ0EtMTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAuucXkAJlsTRVPEnC +UdXfp9E3j9HngXNBUmCbnaEXJnitx7HoJpQytd4zjTov2/KaelpzmKNc6fuKcxtc +58O/gGzNqfTWK8D3+ZmqY6KxRwIP1ORROhI8bIpaVIRw28HFkM9yRcuoWcDNM50/ +o5brhTMhHD4ePmBudpxnhcXIw2ECAwEAAaNmMGQwEQYJYIZIAYb4QgEBBAQDAgAH +MA8GA1UdEwEB/wQFMAMBAf8wHwYDVR0jBBgwFoAUvqigdHJQa0S3ySPY+6j/s1dr +aGwwHQYDVR0OBBYEFL6ooHRyUGtEt8kj2Puo/7NXa2hsMA0GCSqGSIb3DQEBBAUA +A4GBADDiAVGqx+pf2rnQZQ8w1j7aDRRJbpGTJxQx78T3LUX47Me/okENI7SS+RkA +Z70Br83gcfxaz2TE4JaY0KNA4gGK7ycH8WUBikQtBmV1UsCGECAhX2xrD2yuCRyv +8qIYNMR1pHMc8Y3c7635s3a0kr/clRAevsvIO1qEYBlWlKlV +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIF5zCCA8+gAwIBAgIITK9zQhyOdAIwDQYJKoZIhvcNAQEFBQAwgYAxODA2BgNV +BAMML0VCRyBFbGVrdHJvbmlrIFNlcnRpZmlrYSBIaXptZXQgU2HEn2xhecSxY8Sx +c8SxMTcwNQYDVQQKDC5FQkcgQmlsacWfaW0gVGVrbm9sb2ppbGVyaSB2ZSBIaXpt +ZXRsZXJpIEEuxZ4uMQswCQYDVQQGEwJUUjAeFw0wNjA4MTcwMDIxMDlaFw0xNjA4 +MTQwMDMxMDlaMIGAMTgwNgYDVQQDDC9FQkcgRWxla3Ryb25payBTZXJ0aWZpa2Eg +SGl6bWV0IFNhxJ9sYXnEsWPEsXPEsTE3MDUGA1UECgwuRUJHIEJpbGnFn2ltIFRl +a25vbG9qaWxlcmkgdmUgSGl6bWV0bGVyaSBBLsWeLjELMAkGA1UEBhMCVFIwggIi +MA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDuoIRh0DpqZhAy2DE4f6en5f2h +4fuXd7hxlugTlkaDT7byX3JWbhNgpQGR4lvFzVcfd2NR/y8927k/qqk153nQ9dAk +tiHq6yOU/im/+4mRDGSaBUorzAzu8T2bgmmkTPiab+ci2hC6X5L8GCcKqKpE+i4s +tPtGmggDg3KriORqcsnlZR9uKg+ds+g75AxuetpX/dfreYteIAbTdgtsApWjluTL +dlHRKJ2hGvxEok3MenaoDT2/F08iiFD9rrbskFBKW5+VQarKD7JK/oCZTqNGFav4 +c0JqwmZ2sQomFd2TkuzbqV9UIlKRcF0T6kjsbgNs2d1s/OsNA/+mgxKb8amTD8Um +TDGyY5lhcucqZJnSuOl14nypqZoaqsNW2xCaPINStnuWt6yHd6i58mcLlEOzrz5z ++kI2sSXFCjEmN1ZnuqMLfdb3ic1nobc6HmZP9qBVFCVMLDMNpkGMvQQxahByCp0O +Lna9XvNRiYuoP1Vzv9s6xiQFlpJIqkuNKgPlV5EQ9GooFW5Hd4RcUXSfGenmHmMW +OeMRFeNYGkS9y8RsZteEBt8w9DeiQyJ50hBs37vmExH8nYQKE3vwO9D8owrXieqW +fo1IhR5kX9tUoqzVegJ5a9KK8GfaZXINFHDk6Y54jzJ0fFfy1tb0Nokb+Clsi7n2 +l9GkLqq+CxnCRelwXQIDAJ3Zo2MwYTAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB +/wQEAwIBBjAdBgNVHQ4EFgQU587GT/wWZ5b6SqMHwQSny2re2kcwHwYDVR0jBBgw +FoAU587GT/wWZ5b6SqMHwQSny2re2kcwDQYJKoZIhvcNAQEFBQADggIBAJuYml2+ +8ygjdsZs93/mQJ7ANtyVDR2tFcU22NU57/IeIl6zgrRdu0waypIN30ckHrMk2pGI +6YNw3ZPX6bqz3xZaPt7gyPvT/Wwp+BVGoGgmzJNSroIBk5DKd8pNSe/iWtkqvTDO +TLKBtjDOWU/aWR1qeqRFsIImgYZ29fUQALjuswnoT4cCB64kXPBfrAowzIpAoHME +wfuJJPaaHFy3PApnNgUIMbOv2AFoKuB4j3TeuFGkjGwgPaL7s9QJ/XvCgKqTbCmY +Iai7FvOpEl90tYeY8pUm3zTvilORiF0alKM/fCL414i6poyWqD1SNGKfAB5UVUJn +xk1Gj7sURT0KlhaOEKGXmdXTMIXM3rRyt7yKPBgpaP3ccQfuJDlq+u2lrDgv+R4Q +DgZxGhBM/nV+/x5XOULK1+EVoVZVWRvRo68R2E7DpSvvkL/A7IITW43WciyTTo9q +Kd+FPNMN4KIYEsxVL0e3p5sC/kH2iExt2qkBR4NkJ2IQgtYSe14DHzSpyZH+r11t +hie3I6p1GMog57AP14kOpmciY/SDQSsGS7tY1dHXt7kQY9iJSrSq3RZj9W6+YKH4 +7ejWkE8axsWgKdOnIaj1Wjz3x0miIZpKlVIglnKaZsv30oZDfCK+lvm9AahH3eU7 +QPl1K5srRmSGjR70j/sHd9DqSaIcjVIUpgqT +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIFFzCCA/+gAwIBAgIBETANBgkqhkiG9w0BAQUFADCCASsxCzAJBgNVBAYTAlRS +MRgwFgYDVQQHDA9HZWJ6ZSAtIEtvY2FlbGkxRzBFBgNVBAoMPlTDvHJraXllIEJp +bGltc2VsIHZlIFRla25vbG9qaWsgQXJhxZ90xLFybWEgS3VydW11IC0gVMOcQsSw +VEFLMUgwRgYDVQQLDD9VbHVzYWwgRWxla3Ryb25payB2ZSBLcmlwdG9sb2ppIEFy +YcWfdMSxcm1hIEVuc3RpdMO8c8O8IC0gVUVLQUUxIzAhBgNVBAsMGkthbXUgU2Vy +dGlmaWthc3lvbiBNZXJrZXppMUowSAYDVQQDDEFUw5xCxLBUQUsgVUVLQUUgS8O2 +ayBTZXJ0aWZpa2EgSGl6bWV0IFNhxJ9sYXnEsWPEsXPEsSAtIFPDvHLDvG0gMzAe +Fw0wNzA4MjQxMTM3MDdaFw0xNzA4MjExMTM3MDdaMIIBKzELMAkGA1UEBhMCVFIx +GDAWBgNVBAcMD0dlYnplIC0gS29jYWVsaTFHMEUGA1UECgw+VMO8cmtpeWUgQmls +aW1zZWwgdmUgVGVrbm9sb2ppayBBcmHFn3TEsXJtYSBLdXJ1bXUgLSBUw5xCxLBU +QUsxSDBGBgNVBAsMP1VsdXNhbCBFbGVrdHJvbmlrIHZlIEtyaXB0b2xvamkgQXJh +xZ90xLFybWEgRW5zdGl0w7xzw7wgLSBVRUtBRTEjMCEGA1UECwwaS2FtdSBTZXJ0 +aWZpa2FzeW9uIE1lcmtlemkxSjBIBgNVBAMMQVTDnELEsFRBSyBVRUtBRSBLw7Zr +IFNlcnRpZmlrYSBIaXptZXQgU2HEn2xhecSxY8Sxc8SxIC0gU8O8csO8bSAzMIIB +IjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAim1L/xCIOsP2fpTo6iBkcK4h +gb46ezzb8R1Sf1n68yJMlaCQvEhOEav7t7WNeoMojCZG2E6VQIdhn8WebYGHV2yK +O7Rm6sxA/OOqbLLLAdsyv9Lrhc+hDVXDWzhXcLh1xnnRFDDtG1hba+818qEhTsXO +fJlfbLm4IpNQp81McGq+agV/E5wrHur+R84EpW+sky58K5+eeROR6Oqeyjh1jmKw +lZMq5d/pXpduIF9fhHpEORlAHLpVK/swsoHvhOPc7Jg4OQOFCKlUAwUp8MmPi+oL +hmUZEdPpCSPeaJMDyTYcIW7OjGbxmTDY17PDHfiBLqi9ggtm/oLL4eAagsNAgQID +AQABo0IwQDAdBgNVHQ4EFgQUvYiHyY/2pAoLquvF/pEjnatKijIwDgYDVR0PAQH/ +BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEFBQADggEBAB18+kmP +NOm3JpIWmgV050vQbTlswyb2zrgxvMTfvCr4N5EY3ATIZJkrGG2AA1nJrvhY0D7t +wyOfaTyGOBye79oneNGEN3GKPEs5z35FBtYt2IpNeBLWrcLTy9LQQfMmNkqblWwM +7uXRQydmwYj3erMgbOqwaSvHIOgMA8RBBZniP+Rr+KCGgceExh/VS4ESshYhLBOh +gLJeDEoTniDYYkCrkOpkSi+sDQESeUWoL4cZaMjihccwsnX5OD+ywJO0a+IDRM5n +oN+J1q2MdqMTw5RhK2vZbMEHCiIHhWyFJEapvj+LeISCfiQMnf2BN+MlqO02TpUs +yZyQ2uypQjyttgI= +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIEPTCCAyWgAwIBAgIBATANBgkqhkiG9w0BAQUFADCBvzE/MD0GA1UEAww2VMOc +UktUUlVTVCBFbGVrdHJvbmlrIFNlcnRpZmlrYSBIaXptZXQgU2HEn2xhecSxY8Sx +c8SxMQswCQYDVQQGEwJUUjEPMA0GA1UEBwwGQW5rYXJhMV4wXAYDVQQKDFVUw5xS +S1RSVVNUIEJpbGdpIMSwbGV0acWfaW0gdmUgQmlsacWfaW0gR8O8dmVubGnEn2kg +SGl6bWV0bGVyaSBBLsWeLiAoYykgQXJhbMSxayAyMDA3MB4XDTA3MTIyNTE4Mzcx +OVoXDTE3MTIyMjE4MzcxOVowgb8xPzA9BgNVBAMMNlTDnFJLVFJVU1QgRWxla3Ry +b25payBTZXJ0aWZpa2EgSGl6bWV0IFNhxJ9sYXnEsWPEsXPEsTELMAkGA1UEBhMC +VFIxDzANBgNVBAcMBkFua2FyYTFeMFwGA1UECgxVVMOcUktUUlVTVCBCaWxnaSDE +sGxldGnFn2ltIHZlIEJpbGnFn2ltIEfDvHZlbmxpxJ9pIEhpem1ldGxlcmkgQS7F +ni4gKGMpIEFyYWzEsWsgMjAwNzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC +ggEBAKu3PgqMyKVYFeaK7yc9SrToJdPNM8Ig3BnuiD9NYvDdE3ePYakqtdTyuTFY +KTsvP2qcb3N2Je40IIDu6rfwxArNK4aUyeNgsURSsloptJGXg9i3phQvKUmi8wUG ++7RP2qFsmmaf8EMJyupyj+sA1zU511YXRxcw9L6/P8JorzZAwan0qafoEGsIiveG +HtyaKhUG9qPw9ODHFNRRf8+0222vR5YXm3dx2KdxnSQM9pQ/hTEST7ruToK4uT6P +IzdezKKqdfcYbwnTrqdUKDT74eA7YH2gvnmJhsifLfkKS8RQouf9eRbHegsYz85M +733WB2+Y8a+xwXrXgTW4qhe04MsCAwEAAaNCMEAwHQYDVR0OBBYEFCnFkKslrxHk +Yb+j/4hhkeYO/pyBMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8EBTADAQH/MA0G +CSqGSIb3DQEBBQUAA4IBAQAQDdr4Ouwo0RSVgrESLFF6QSU2TJ/sPx+EnWVUXKgW +AkD6bho3hO9ynYYKVZ1WKKxmLNA6VpM0ByWtCLCPyA8JWcqdmBzlVPi5RX9ql2+I +aE1KBiY3iAIOtsbWcpnOa3faYjGkVh+uX4132l32iPwa2Z61gfAyuOOI0JzzaqC5 +mxRZNTZPz/OOXl0XrRWV2N2y1RVuAE6zS89mlOTgzbUF2mNXi+WzqtvALhyQRNsa +XRik7r4EW5nVcV9VZWRi1aKbBFmGyGJ353yCRWo9F7/snXUMrqNvWtMvmDb08PUZ +qxFdyKbjKlhqQgnDvZImZjINXQhVdP+MmNAKpoRq0Tl9 +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIEYDCCA0igAwIBAgICATAwDQYJKoZIhvcNAQELBQAwWTELMAkGA1UEBhMCVVMx +GDAWBgNVBAoTD1UuUy4gR292ZXJubWVudDENMAsGA1UECxMERlBLSTEhMB8GA1UE +AxMYRmVkZXJhbCBDb21tb24gUG9saWN5IENBMB4XDTEwMTIwMTE2NDUyN1oXDTMw +MTIwMTE2NDUyN1owWTELMAkGA1UEBhMCVVMxGDAWBgNVBAoTD1UuUy4gR292ZXJu +bWVudDENMAsGA1UECxMERlBLSTEhMB8GA1UEAxMYRmVkZXJhbCBDb21tb24gUG9s +aWN5IENBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA2HX7NRY0WkG/ +Wq9cMAQUHK14RLXqJup1YcfNNnn4fNi9KVFmWSHjeavUeL6wLbCh1bI1FiPQzB6+ +Duir3MPJ1hLXp3JoGDG4FyKyPn66CG3G/dFYLGmgA/Aqo/Y/ISU937cyxY4nsyOl +4FKzXZbpsLjFxZ+7xaBugkC7xScFNknWJidpDDSPzyd6KgqjQV+NHQOGgxXgVcHF +mCye7Bpy3EjBPvmE0oSCwRvDdDa3ucc2Mnr4MrbQNq4iGDGMUHMhnv6DOzCIJOPp +wX7e7ZjHH5IQip9bYi+dpLzVhW86/clTpyBLqtsgqyFOHQ1O5piF5asRR12dP8Qj +wOMUBm7+nQIDAQABo4IBMDCCASwwDwYDVR0TAQH/BAUwAwEB/zCB6QYIKwYBBQUH +AQsEgdwwgdkwPwYIKwYBBQUHMAWGM2h0dHA6Ly9odHRwLmZwa2kuZ292L2ZjcGNh +L2NhQ2VydHNJc3N1ZWRCeWZjcGNhLnA3YzCBlQYIKwYBBQUHMAWGgYhsZGFwOi8v +bGRhcC5mcGtpLmdvdi9jbj1GZWRlcmFsJTIwQ29tbW9uJTIwUG9saWN5JTIwQ0Es +b3U9RlBLSSxvPVUuUy4lMjBHb3Zlcm5tZW50LGM9VVM/Y0FDZXJ0aWZpY2F0ZTti +aW5hcnksY3Jvc3NDZXJ0aWZpY2F0ZVBhaXI7YmluYXJ5MA4GA1UdDwEB/wQEAwIB +BjAdBgNVHQ4EFgQUrQx6dVzl85jEeZgOrCj9l/TnAvwwDQYJKoZIhvcNAQELBQAD +ggEBAI9z2uF/gLGH9uwsz9GEYx728Yi3mvIRte9UrYpuGDco71wb5O9Qt2wmGCMi +TR0mRyDpCZzicGJxqxHPkYnos/UqoEfAFMtOQsHdDA4b8Idb7OV316rgVNdF9IU+ +7LQd3nyKf1tNnJaK0KIyn9psMQz4pO9+c+iR3Ah6cFqgr2KBWfgAdKLI3VTKQVZH +venAT+0g3eOlCd+uKML80cgX2BLHb94u6b2akfI8WpQukSKAiaGMWMyDeiYZdQKl +Dn0KJnNR6obLB6jI/WNaNZvSr79PMUjBhHDbNXuaGQ/lj/RqDG8z2esccKIN47lQ +A2EC/0rskqTcLe4qNJMHtyznGI8= +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIDhDCCAwqgAwIBAgIQL4D+I4wOIg9IZxIokYesszAKBggqhkjOPQQDAzCByjEL +MAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZW +ZXJpU2lnbiBUcnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNyBWZXJpU2ln +biwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MUUwQwYDVQQDEzxWZXJp +U2lnbiBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9y +aXR5IC0gRzQwHhcNMDcxMTA1MDAwMDAwWhcNMzgwMTE4MjM1OTU5WjCByjELMAkG +A1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJp +U2lnbiBUcnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNyBWZXJpU2lnbiwg +SW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MUUwQwYDVQQDEzxWZXJpU2ln +biBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5 +IC0gRzQwdjAQBgcqhkjOPQIBBgUrgQQAIgNiAASnVnp8Utpkmw4tXNherJI9/gHm +GUo9FANL+mAnINmDiWn6VMaaGF5VKmTeBvaNSjutEDxlPZCIBIngMGGzrl0Bp3ve +fLK+ymVhAIau2o970ImtTR1ZmkGxvEeA3J5iw/mjgbIwga8wDwYDVR0TAQH/BAUw +AwEB/zAOBgNVHQ8BAf8EBAMCAQYwbQYIKwYBBQUHAQwEYTBfoV2gWzBZMFcwVRYJ +aW1hZ2UvZ2lmMCEwHzAHBgUrDgMCGgQUj+XTGoasjY5rw8+AatRIGCx7GS4wJRYj +aHR0cDovL2xvZ28udmVyaXNpZ24uY29tL3ZzbG9nby5naWYwHQYDVR0OBBYEFLMW +kf3upm7ktS5Jj4d4gYDs5bG1MAoGCCqGSM49BAMDA2gAMGUCMGYhDBgmYFo4e1ZC +4Kf8NoRRkSAsdk1DPcQdhCPQrNZ8NQbOzWm9kA3bbEhCHQ6qQgIxAJw9SDkjOVga +FRJZap7v1VmyHVIsmXHNxynfGyphe3HR3vPA5Q06Sqotp9iGKt0uEA== +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIID4TCCAsmgAwIBAgIOYyUAAQACFI0zFQLkbPQwDQYJKoZIhvcNAQEFBQAwezEL +MAkGA1UEBhMCREUxHDAaBgNVBAoTE1RDIFRydXN0Q2VudGVyIEdtYkgxJDAiBgNV +BAsTG1RDIFRydXN0Q2VudGVyIFVuaXZlcnNhbCBDQTEoMCYGA1UEAxMfVEMgVHJ1 +c3RDZW50ZXIgVW5pdmVyc2FsIENBIElJSTAeFw0wOTA5MDkwODE1MjdaFw0yOTEy +MzEyMzU5NTlaMHsxCzAJBgNVBAYTAkRFMRwwGgYDVQQKExNUQyBUcnVzdENlbnRl +ciBHbWJIMSQwIgYDVQQLExtUQyBUcnVzdENlbnRlciBVbml2ZXJzYWwgQ0ExKDAm +BgNVBAMTH1RDIFRydXN0Q2VudGVyIFVuaXZlcnNhbCBDQSBJSUkwggEiMA0GCSqG +SIb3DQEBAQUAA4IBDwAwggEKAoIBAQDC2pxisLlxErALyBpXsq6DFJmzNEubkKLF +5+cvAqBNLaT6hdqbJYUtQCggbergvbFIgyIpRJ9Og+41URNzdNW88jBmlFPAQDYv +DIRlzg9uwliT6CwLOunBjvvya8o84pxOjuT5fdMnnxvVZ3iHLX8LR7PH6MlIfK8v +zArZQe+f/prhsq75U7Xl6UafYOPfjdN/+5Z+s7Vy+EutCHnNaYlAJ/Uqwa1D7KRT +yGG299J5KmcYdkhtWyUB0SbFt1dpIxVbYYqt8Bst2a9c8SaQaanVDED1M4BDj5yj +dipFtK+/fz6HP3bFzSreIMUWWMv5G/UPyw0RUmS40nZid4PxWJ//AgMBAAGjYzBh +MB8GA1UdIwQYMBaAFFbn4VslQ4Dg9ozhcbyO5YAvxEjiMA8GA1UdEwEB/wQFMAMB +Af8wDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBRW5+FbJUOA4PaM4XG8juWAL8RI +4jANBgkqhkiG9w0BAQUFAAOCAQEAg8ev6n9NCjw5sWi+e22JLumzCecYV42Fmhfz +dkJQEw/HkG8zrcVJYCtsSVgZ1OK+t7+rSbyUyKu+KGwWaODIl0YgoGhnYIg5IFHY +aAERzqf2EQf27OysGh+yZm5WZ2B6dF7AbZc2rrUNXWZzwCUyRdhKBgePxLcHsU0G +DeGl6/R1yrqc0L2z0zIkTO5+4nYES0lT2PLpVDP85XEfPRRclkvxOvIAu2y0+pZV +CIgJwcyRGSmwIC3/yzikQOEXvnlhgP8HA4ZMTnsGnxGGjYnuJ8Tb4rwZjgvDwxPH +LQNjO9Po5KIqwoIIlBZU8O8fJ5AluA0OKBtHd0e9HKgl8ZS0Zg== +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIDcTCCAlmgAwIBAgIVAOYJ/nrqAGiM4CS07SAbH+9StETRMA0GCSqGSIb3DQEB +BQUAMFAxCzAJBgNVBAYTAlBMMSgwJgYDVQQKDB9LcmFqb3dhIEl6YmEgUm96bGlj +emVuaW93YSBTLkEuMRcwFQYDVQQDDA5TWkFGSVIgUk9PVCBDQTAeFw0xMTEyMDYx +MTEwNTdaFw0zMTEyMDYxMTEwNTdaMFAxCzAJBgNVBAYTAlBMMSgwJgYDVQQKDB9L +cmFqb3dhIEl6YmEgUm96bGljemVuaW93YSBTLkEuMRcwFQYDVQQDDA5TWkFGSVIg +Uk9PVCBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKxHL49ZMTml +6g3wpYwrvQKkvc0Kc6oJ5sxfgmp1qZfluwbv88BdocHSiXlY8NzrVYzuWBp7J/9K +ULMAoWoTIzOQ6C9TNm4YbA9A1jdX1wYNL5Akylf8W5L/I4BXhT9KnlI6x+a7BVAm +nr/Ttl+utT/Asms2fRfEsF2vZPMxH4UFqOAhFjxTkmJWf2Cu4nvRQJHcttB+cEAo +ag/hERt/+tzo4URz6x6r19toYmxx4FjjBkUhWQw1X21re//Hof2+0YgiwYT84zLb +eqDqCOMOXxvH480yGDkh/QoazWX3U75HQExT/iJlwnu7I1V6HXztKIwCBjsxffbH +3jOshCJtywcCAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMC +AQYwHQYDVR0OBBYEFFOSo33/gnbwM9TrkmdHYTMbaDsqMA0GCSqGSIb3DQEBBQUA +A4IBAQA5UFWd5EL/pBviIMm1zD2JLUCpp0mJG7JkwznIOzawhGmFFaxGoxAhQBEg +haP+E0KR66oAwVC6xe32QUVSHfWqWndzbODzLB8yj7WAR0cDM45ZngSBPBuFE3Wu +GLJX9g100ETfIX+4YBR/4NR/uvTnpnd9ete7Whl0ZfY94yuu4xQqB5QFv+P7IXXV +lTOjkjuGXEcyQAjQzbFaT9vIABSbeCXWBbjvOXukJy6WgAiclzGNSYprre8Ryydd +fmjW9HIGwsIO03EldivvqEYL1Hv1w/Pur+6FUEOaL68PEIUovfgwIB2BAw+vZDuw +cH0mX548PojGyg434cDjkSXa3mHF +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIEPDCCAySgAwIBAgIBATANBgkqhkiG9w0BAQUFADCBvjE/MD0GA1UEAww2VMOc +UktUUlVTVCBFbGVrdHJvbmlrIFNlcnRpZmlrYSBIaXptZXQgU2HEn2xhecSxY8Sx +c8SxMQswCQYDVQQGEwJUUjEPMA0GA1UEBwwGQW5rYXJhMV0wWwYDVQQKDFRUw5xS +S1RSVVNUIEJpbGdpIMSwbGV0acWfaW0gdmUgQmlsacWfaW0gR8O8dmVubGnEn2kg +SGl6bWV0bGVyaSBBLsWeLiAoYykgS2FzxLFtIDIwMDUwHhcNMDUxMTA3MTAwNzU3 +WhcNMTUwOTE2MTAwNzU3WjCBvjE/MD0GA1UEAww2VMOcUktUUlVTVCBFbGVrdHJv +bmlrIFNlcnRpZmlrYSBIaXptZXQgU2HEn2xhecSxY8Sxc8SxMQswCQYDVQQGEwJU +UjEPMA0GA1UEBwwGQW5rYXJhMV0wWwYDVQQKDFRUw5xSS1RSVVNUIEJpbGdpIMSw +bGV0acWfaW0gdmUgQmlsacWfaW0gR8O8dmVubGnEn2kgSGl6bWV0bGVyaSBBLsWe +LiAoYykgS2FzxLFtIDIwMDUwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB +AQCpNn7DkUNMwxmYCMjHWHtPFoylzkkBH3MOrHUTpvqeLCDe2JAOCtFp0if7qnef +J1Il4std2NiDUBd9irWCPwSOtNXwSadktx4uXyCcUHVPr+G1QRT0mJKIx+XlZEdh +R3n9wFHxwZnn3M5q+6+1ATDcRhzviuyV79z/rxAc653YsKpqhRgNF8k+v/Gb0AmJ +Qv2gQrSdiVFVKc8bcLyEVK3BEx+Y9C52YItdP5qtygy/p1Zbj3e41Z55SZI/4PGX +JHpsmxcPbe9TmJEr5A++WXkHeLuXlfSfadRYhwqp48y2WBmfJiGxxFmNskF1wK1p +zpwACPI2/z7woQ8arBT9pmAPAgMBAAGjQzBBMB0GA1UdDgQWBBTZN7NOBf3Zz58S +Fq62iS/rJTqIHDAPBgNVHQ8BAf8EBQMDBwYAMA8GA1UdEwEB/wQFMAMBAf8wDQYJ +KoZIhvcNAQEFBQADggEBAHJglrfJ3NgpXiOFX7KzLXb7iNcX/nttRbj2hWyfIvwq +ECLsqrkw9qtY1jkQMZkpAL2JZkH7dN6RwRgLn7Vhy506vvWolKMiVW4XSf/SKfE4 +Jl3vpao6+XF75tpYHdN0wgH6PmlYX63LaL4ULptswLbcoCb6dxriJNoaN+BnrdFz +gw2lGh1uEpJ+hGIAF728JRhX8tepb1mIvDS3LoV4nZbcFMMsilKbloxSZj2GFotH +uFEJjOp9zYhys2AzsfAKRO8P9Qk3iCQOLGsgOqL6EfJANZxEaGM7rDNvY7wsu/LS +y3Z9fYjYHcgFHW68lKlmjHdxx/qR+i9Rnuk5UrbnBEI= +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIDfTCCAmWgAwIBAgIBADANBgkqhkiG9w0BAQUFADBgMQswCQYDVQQGEwJKUDEl +MCMGA1UEChMcU0VDT00gVHJ1c3QgU3lzdGVtcyBDTy4sTFRELjEqMCgGA1UECxMh +U2VjdXJpdHkgQ29tbXVuaWNhdGlvbiBFViBSb290Q0ExMB4XDTA3MDYwNjAyMTIz +MloXDTM3MDYwNjAyMTIzMlowYDELMAkGA1UEBhMCSlAxJTAjBgNVBAoTHFNFQ09N +IFRydXN0IFN5c3RlbXMgQ08uLExURC4xKjAoBgNVBAsTIVNlY3VyaXR5IENvbW11 +bmljYXRpb24gRVYgUm9vdENBMTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC +ggEBALx/7FebJOD+nLpCeamIivqA4PUHKUPqjgo0No0c+qe1OXj/l3X3L+SqawSE +RMqm4miO/VVQYg+kcQ7OBzgtQoVQrTyWb4vVog7P3kmJPdZkLjjlHmy1V4qe70gO +zXppFodEtZDkBp2uoQSXWHnvIEqCa4wiv+wfD+mEce3xDuS4GBPMVjZd0ZoeUWs5 +bmB2iDQL87PRsJ3KYeJkHcFGB7hj3R4zZbOOCVVSPbW9/wfrrWFVGCypaZhKqkDF +MxRldAD5kd6vA0jFQFTcD4SQaCDFkpbcLuUCRarAX1T4bepJz11sS6/vmsJWXMY1 +VkJqMF/Cq/biPT+zyRGPMUzXn0kCAwEAAaNCMEAwHQYDVR0OBBYEFDVK9U2vP9eC +OKyrcWUXdYydVZPmMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8EBTADAQH/MA0G +CSqGSIb3DQEBBQUAA4IBAQCoh+ns+EBnXcPBZsdAS5f8hxOQWsTvoMpfi7ent/HW +tWS3irO4G8za+6xmiEHO6Pzk2x6Ipu0nUBsCMCRGef4Eh3CXQHPRwMFXGZpppSeZ +q51ihPZRwSzJIxXYKLerJRO1RuGGAv8mjMSIkh1W/hln8lXkgKNrnKt34VFxDSDb +EJrbvXZ5B3eZKK2aXtqxT0QsNY6llsf9g/BYxnnWmHyojf6GPgcWkuF75x3sM3Z+ +Qi5KhfmRiWiEA4Glm5q+4zfFVKtWOxgtQaQM+ELbmaDgcm+7XeEWT1MKZPlO9L9O +VL14bIjqv5wTJMJwaaJ/D8g8rQjJsJhAoyrniIPtd490 +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIICqDCCAi2gAwIBAgIQNBdlEkA7t1aALYDLeVWmHjAKBggqhkjOPQQDAzCBlDEL +MAkGA1UEBhMCVVMxHTAbBgNVBAoTFFN5bWFudGVjIENvcnBvcmF0aW9uMR8wHQYD +VQQLExZTeW1hbnRlYyBUcnVzdCBOZXR3b3JrMUUwQwYDVQQDEzxTeW1hbnRlYyBD +bGFzcyAyIFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5IC0g +RzQwHhcNMTExMDA1MDAwMDAwWhcNMzgwMTE4MjM1OTU5WjCBlDELMAkGA1UEBhMC +VVMxHTAbBgNVBAoTFFN5bWFudGVjIENvcnBvcmF0aW9uMR8wHQYDVQQLExZTeW1h +bnRlYyBUcnVzdCBOZXR3b3JrMUUwQwYDVQQDEzxTeW1hbnRlYyBDbGFzcyAyIFB1 +YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5IC0gRzQwdjAQBgcq +hkjOPQIBBgUrgQQAIgNiAATR2UqOTA2ESlG6fO/TzPo6mrWnYxM9AeBJPvrBR8mS +szrX/m+c95o6D/UOCgrDP8jnEhSO1dVtmCyzcTIK6yq99tdqIAtnRZzSsr9TImYJ +XdsR8/EFM1ij4rjPfM2Cm72jQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8E +BTADAQH/MB0GA1UdDgQWBBQ9MvM6qQyQhPmijGkGYVQvh3L+BTAKBggqhkjOPQQD +AwNpADBmAjEAyKapr0F/tckRQhZoaUxcuCcYtpjxwH+QbYfTjEYX8D5P/OqwCMR6 +S7wIL8fip29lAjEA1lnehs5fDspU1cbQFQ78i5Ry1I4AWFPPfrFLDeVQhuuea9// +KabYR9mglhjb8kWz +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIFWTCCA0GgAwIBAgIBAjANBgkqhkiG9w0BAQsFADBOMQswCQYDVQQGEwJOTzEd +MBsGA1UECgwUQnV5cGFzcyBBUy05ODMxNjMzMjcxIDAeBgNVBAMMF0J1eXBhc3Mg +Q2xhc3MgMyBSb290IENBMB4XDTEwMTAyNjA4Mjg1OFoXDTQwMTAyNjA4Mjg1OFow +TjELMAkGA1UEBhMCTk8xHTAbBgNVBAoMFEJ1eXBhc3MgQVMtOTgzMTYzMzI3MSAw +HgYDVQQDDBdCdXlwYXNzIENsYXNzIDMgUm9vdCBDQTCCAiIwDQYJKoZIhvcNAQEB +BQADggIPADCCAgoCggIBAKXaCpUWUOOV8l6ddjEGMnqb8RB2uACatVI2zSRHsJ8Y +ZLya9vrVediQYkwiL944PdbgqOkcLNt4EemOaFEVcsfzM4fkoF0LXOBXByow9c3E +N3coTRiR5r/VUv1xLXA+58bEiuPwKAv0dpihi4dVsjoT/Lc+JzeOIuOoTyrvYLs9 +tznDDgFHmV0ST9tD+leh7fmdvhFHJlsTmKtdFoqwNxxXnUX/iJY2v7vKB3tvh2PX +0DJq1l1sDPGzbjniazEuOQAnFN44wOwZZoYS6J1yFhNkUsepNxz9gjDthBgd9K5c +/3ATAOux9TN6S9ZV+AWNS2mw9bMoNlwUxFFzTWsL8TQH2xc519woe2v1n/MuwU8X +KhDzzMro6/1rqy6any2CbgTUUgGTLT2G/H783+9CHaZr77kgxve9oKeV/afmiSTY +zIw0bOIjL9kSGiG5VZFvC5F5GQytQIgLcOJ60g7YaEi7ghM5EFjp2CoHxhLbWNvS +O1UQRwUVZ2J+GGOmRj8JDlQyXr8NYnon74Do29lLBlo3WiXQCBJ31G8JUJc9yB3D +34xFMFbG02SrZvPAXpacw8Tvw3xrizp5f7NJzz3iiZ+gMEuFuZyUJHmPfWupRWgP +K9Dx2hzLabjKSWJtyNBjYt1gD1iqj6G8BaVmos8bdrKEZLFMOVLAMLrwjEsCsLa3 +AgMBAAGjQjBAMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFEe4zf/lb+74suwv +Tg75JbCOPGvDMA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQsFAAOCAgEAACAj +QTUEkMJAYmDv4jVM1z+s4jSQuKFvdvoWFqRINyzpkMLyPPgKn9iB5btb2iUspKdV +cSQy9sgL8rxq+JOssgfCX5/bzMiKqr5qb+FJEMwx14C7u8jYog5kV+qi9cKpMRXS +IGrs/CIBKM+GuIAeqcwRpTzyFrNHnfzSgCHEy9BHcEGhyoMZCCxt8l13nIoUE9Q2 +HJLw5QY33KbmkJs4j1xrG0aGQ0JfPgEHU1RdZX33inOhmlRaHylDFCfChQ+1iHsa +O5S3HWCntZznKWlXWpuTekMwGwPXYshApqr8ZORK15FTAaggiG6cX0S5y2CBNOxv +033aSF/rtJC8LakcC6wc1aJoIIAE1vyxjy+7SjENSoYc6+I2KSb12tjE8nVhz36u +dmNKekBlk4f4HoCMhuWG1o8O/FMsYOgWYRqiPkN7zTlgVGr18okmAWiDSKIz6MkE +kbIRNBE+6tBDGR8Dk5AM/1E9V/RBbuHLoL7ryWPNbczk+DaqaJ3tvV2XcEQNtg41 +3OEMXbugUZTLfhbrES+jkkXITHHZvMmZUldGL1DPvTVp9D0VzgalLA8+9oG6lLvD +u79leNKGef9JOxqDDPDeeOzI8k1MGt6CKfjBWtrt7uYnXuhF0J0cUahoq0Tj0Itq +4/g7u9xN12TyUb7mqqta6THuBrxzvxNiCp/HuZc= +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIF9jCCA96gAwIBAgIQZWNxhdNvRcaPfzH5CYeSgjANBgkqhkiG9w0BAQwFADCB +lDELMAkGA1UEBhMCVVMxHTAbBgNVBAoTFFN5bWFudGVjIENvcnBvcmF0aW9uMR8w +HQYDVQQLExZTeW1hbnRlYyBUcnVzdCBOZXR3b3JrMUUwQwYDVQQDEzxTeW1hbnRl +YyBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5 +IC0gRzYwHhcNMTIxMDE4MDAwMDAwWhcNMzcxMjAxMjM1OTU5WjCBlDELMAkGA1UE +BhMCVVMxHTAbBgNVBAoTFFN5bWFudGVjIENvcnBvcmF0aW9uMR8wHQYDVQQLExZT +eW1hbnRlYyBUcnVzdCBOZXR3b3JrMUUwQwYDVQQDEzxTeW1hbnRlYyBDbGFzcyAz +IFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5IC0gRzYwggIi +MA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQC3DrL6TbyachX7d1vb/UMPywv3 +YC6zK34Mu1PyzE5l8xm7/zUd99Opu0Attd141Kb5N+qFBXttt+YTSwZ8+3ZjjyAd +LTgrBIXy6LDRX01KIclq2JTqHgJQpqqQB6BHIepm+QSg5oPwxPVeluInTWHDs8GM +IrZmoQDRVin77cF/JMo9+lqUsITDx7pDHP1kDvEo+0dZ8ibhMblE+avd+76+LDfj +rAsY0/wBovGkCjWCR0yrvYpe3xOF/CDMSFmvr0FvyyPNypOn3dVfyGQ7/wEDoApP +LW49hL6vyDKyUymQFfewBZoKPPa5BpDJpeFdoDuw/qi2v/WJKFckOiGGceTciotB +VeweMCRZ0cBZuHivqlp03iWAMJjtMERvIXAc2xJTDtamKGaTLB/MTzwbgcW59nhv +0DI6CHLbaw5GF4WU87zvvPekXo7p6bVk5bdLRRIsTDe3YEMKTXEGAJQmNXQfu3o5 +XE475rgD4seTi4QsJUlF3X8jlGAfy+nN9quX92Hn+39igcjcCjBcGHzmzu/Hbh6H +fLPpysh7avRo/IOlDFa0urKNSgrHl5fFiDAVPRAIVBVycmczM/R8t84AJ1NlziTx +WmTnNi/yLgLCl99y6AIeoPc9tftoYAP6M6nmEm0G4amoXU48/tnnAGWsthlNe4N/ +NEfq4RhtsYsceavnnQIDAQABo0IwQDAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/ +BAUwAwEB/zAdBgNVHQ4EFgQUOXEIAD7eyIbnkP/k/SEPziQZFvYwDQYJKoZIhvcN +AQEMBQADggIBAFBriE1gSM5a4yLOZ3yEp80c/ekMA4w2rwqHDmquV64B0Da78v25 +c8FftaiuTKL6ScsHRhY2vePIVzh+OOS/JTNgxtw3nGO7XpgeGrKC8K6mdxGAREeh +KcXwszrOmPC47NMOgAZ3IzBM/3lkYyJbd5NDS3Wz2ztuO0rd8ciutTeKlYg6EGhw +OLlbcH7VQ8n8X0/l5ns27vAg7UdXEyYQXhQGDXt2B8LGLRb0rqdsD7yID08sAraj +1yLmmUc12I2lT4ESOhF9s8wLdfMecKMbA+r6mujmLjY5zJnOOj8Mt674Q5mwk25v +qtkPajGRu5zTtCj7g0x6c4JQZ9IOrO1gxbJdNZjPh34eWR0kvFa62qRa2MzmvB4Q +jxuMjvPB27e+1LBbZY8WaPNWxSoZFk0PuGWHbSSDuGLc4EdhGoh7zk5//dzGDVqa +pPO1TPbdMaboHREhMzAEYX0c4D5PjT+1ixIAWn2poQDUg+twuxj4pNIcgS23CBHI +Jnu21OUPA0Zy1CVAHr5JXW2T8VyyO3VUaTqg7kwiuqya4gitRWMFSlI1dsQ09V4H +Mq3cfCbRW4+t5OaqG3Wf61206MCpFXxOSgdy30bJ1JGSdVaw4e43NmUoxRXIK3bM +bW8Zg/T92hXiQeczeUaDV/nxpbZt07zXU+fucW14qZen7iCcGRVyFT0E +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIICRjCCAc2gAwIBAgIQC6Fa+h3foLVJRK/NJKBs7DAKBggqhkjOPQQDAzBlMQsw +CQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cu +ZGlnaWNlcnQuY29tMSQwIgYDVQQDExtEaWdpQ2VydCBBc3N1cmVkIElEIFJvb3Qg +RzMwHhcNMTMwODAxMTIwMDAwWhcNMzgwMTE1MTIwMDAwWjBlMQswCQYDVQQGEwJV +UzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQu +Y29tMSQwIgYDVQQDExtEaWdpQ2VydCBBc3N1cmVkIElEIFJvb3QgRzMwdjAQBgcq +hkjOPQIBBgUrgQQAIgNiAAQZ57ysRGXtzbg/WPuNsVepRC0FFfLvC/8QdJ+1YlJf +Zn4f5dwbRXkLzMZTCp2NXQLZqVneAlr2lSoOjThKiknGvMYDOAdfVdp+CW7if17Q +RSAPWXYQ1qAk8C3eNvJsKTmjQjBAMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/ +BAQDAgGGMB0GA1UdDgQWBBTL0L2p4ZgFUaFNN6KDec6NHSrkhDAKBggqhkjOPQQD +AwNnADBkAjAlpIFFAmsSS3V0T8gj43DydXLefInwz5FyYZ5eEJJZVrmDxxDnOOlY +JjZ91eQ0hjkCMHw2U/Aw5WJjOpnitqM7mzT6HtoQknFekROn3aRukswy1vUhZscv +6pZjamVFkpUBtA== +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIEUzCCAzugAwIBAgIDAOJDMA0GCSqGSIb3DQEBBQUAMIHPMQswCQYDVQQGEwJB +VDGBizCBiAYDVQQKHoGAAEEALQBUAHIAdQBzAHQAIABHAGUAcwAuACAAZgD8AHIA +IABTAGkAYwBoAGUAcgBoAGUAaQB0AHMAcwB5AHMAdABlAG0AZQAgAGkAbQAgAGUA +bABlAGsAdAByAC4AIABEAGEAdABlAG4AdgBlAHIAawBlAGgAcgAgAEcAbQBiAEgx +GDAWBgNVBAsTD0EtVHJ1c3QtUXVhbC0wMTEYMBYGA1UEAxMPQS1UcnVzdC1RdWFs +LTAxMB4XDTA0MTEzMDIzMDAwMFoXDTE0MTEzMDIzMDAwMFowgc8xCzAJBgNVBAYT +AkFUMYGLMIGIBgNVBAoegYAAQQAtAFQAcgB1AHMAdAAgAEcAZQBzAC4AIABmAPwA +cgAgAFMAaQBjAGgAZQByAGgAZQBpAHQAcwBzAHkAcwB0AGUAbQBlACAAaQBtACAA +ZQBsAGUAawB0AHIALgAgAEQAYQB0AGUAbgB2AGUAcgBrAGUAaAByACAARwBtAGIA +SDEYMBYGA1UECxMPQS1UcnVzdC1RdWFsLTAxMRgwFgYDVQQDEw9BLVRydXN0LVF1 +YWwtMDEwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCmhgdxIbxTGEOH +fXGiewI3NFldAWKFWfLofO+5I1UbvA5avt7IgsGXz/tI/f5HGUbascI0i7xG0tqV +lA5ctQgLRqxgxHtgTkMcqsAEYdsz3LZsCdXO1QrvEBGLTSABdxiL/gSWJ6z77CSw +x7Xg02HwxPV82cjGkSF3ENGJntuIAAnRDWn/ORHjFatNRymoMbHaOEZXSGhf7Y5F +rrHEqGyi9E6sv784De/T1aTvskn8cWeUmDzv//omiG/a/V9KQex/61XN8OthUQVn +X+u/liL2NKx74I2C/GgHX5B0WkPNqsSOgmlvJ/cKuT0PveUgVFDAA0oYBgcE1KDM +lBbN0kmPAgMBAAGjNjA0MA8GA1UdEwEB/wQFMAMBAf8wEQYDVR0OBAoECEs8jB2F +6W+tMA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQUFAAOCAQEAIUusmJzMJRiQ +8TAHrJAOelfuWoTGcqdIv7Tys/fNl2yF2fjvHT8J01aKialFVpbVeQ2XKb1O2bHO +QYAKgsdZ2jZ/sdL2UVFRTHmidLu6PdgWCBRhJYQELQophO9QVvfhAA0TwbESYqTz ++nlI5Gr7CZe8f6HEmhJmCtUQsdQCufGglRh4T+tIGiNGcnyVEHZ93mSVepFr1VA2 +9CTRPteuGjA81jeAz9peYiFE1CXvxK9cJiv0BcALFLWmADCoRLzIRZhA+sAwYUmw +M1rqVCPA3kBQvIC95tyQvNy2dG0Vs+O6PwLaNX/suSlElQ06X2l1VwMaYb4vZKFq +N0bOhBXEVg== +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIJmzCCB4OgAwIBAgIBATANBgkqhkiG9w0BAQwFADCCAR4xPjA8BgNVBAMTNUF1 +dG9yaWRhZCBkZSBDZXJ0aWZpY2FjaW9uIFJhaXogZGVsIEVzdGFkbyBWZW5lem9s +YW5vMQswCQYDVQQGEwJWRTEQMA4GA1UEBxMHQ2FyYWNhczEZMBcGA1UECBMQRGlz +dHJpdG8gQ2FwaXRhbDE2MDQGA1UEChMtU2lzdGVtYSBOYWNpb25hbCBkZSBDZXJ0 +aWZpY2FjaW9uIEVsZWN0cm9uaWNhMUMwQQYDVQQLEzpTdXBlcmludGVuZGVuY2lh +IGRlIFNlcnZpY2lvcyBkZSBDZXJ0aWZpY2FjaW9uIEVsZWN0cm9uaWNhMSUwIwYJ +KoZIhvcNAQkBFhZhY3JhaXpAc3VzY2VydGUuZ29iLnZlMB4XDTEwMTIyMjE4MDgy +MVoXDTMwMTIxNzIzNTk1OVowggEeMT4wPAYDVQQDEzVBdXRvcmlkYWQgZGUgQ2Vy +dGlmaWNhY2lvbiBSYWl6IGRlbCBFc3RhZG8gVmVuZXpvbGFubzELMAkGA1UEBhMC +VkUxEDAOBgNVBAcTB0NhcmFjYXMxGTAXBgNVBAgTEERpc3RyaXRvIENhcGl0YWwx +NjA0BgNVBAoTLVNpc3RlbWEgTmFjaW9uYWwgZGUgQ2VydGlmaWNhY2lvbiBFbGVj +dHJvbmljYTFDMEEGA1UECxM6U3VwZXJpbnRlbmRlbmNpYSBkZSBTZXJ2aWNpb3Mg +ZGUgQ2VydGlmaWNhY2lvbiBFbGVjdHJvbmljYTElMCMGCSqGSIb3DQEJARYWYWNy +YWl6QHN1c2NlcnRlLmdvYi52ZTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoC +ggIBAME77xNS8ZlW47RsBeEaaRZhJoZ4rw785UAFCuPZOAVMqNS1wMYqzy95q6Gk +UO81ER/ugiQX/KMcq/4HBn83fwdYWxPZfwBfK7BP2p/JsFgzYeFP0BXOLmvoJIzl +Jb6FW+1MPwGBjuaZGFImWZsSmGUclb51mRYMZETh9/J5CLThR1exStxHQptwSzra +zNFpkQY/zmj7+YZNA9yDoroVFv6sybYOZ7OxNDo7zkSLo45I7gMwtxqWZ8VkJZkC +8+p0dX6mkhUT0QAV64Zc9HsZiH/oLhEkXjhrgZ28cF73MXIqLx1fyM4kPH1yOJi/ +R72nMwL7D+Sd6mZgI035TxuHXc2/uOwXfKrrTjaJDz8Jp6DdessOkxIgkKXRjP+F +K3ze3n4NUIRGhGRtyvEjK95/2g02t6PeYiYVGur6ruS49n0RAaSS0/LJb6XzaAAe +0mmO2evnEqxIKwy2mZRNPfAVW1l3wCnWiUwryBU6OsbFcFFrQm+00wOicXvOTHBM +aiCVAVZTb9RSLyi+LJ1llzJZO3pq3IRiiBj38Nooo+2ZNbMEciSgmig7YXaUcmud +SVQvLSL+Yw+SqawyezwZuASbp7d/0rutQ59d81zlbMt3J7yB567rT2IqIydQ8qBW +k+fmXzghX+/FidYsh/aK+zZ7Wy68kKHuzEw1Vqkat5DGs+VzAgMBAAGjggLeMIIC +2jASBgNVHRMBAf8ECDAGAQH/AgECMDcGA1UdEgQwMC6CD3N1c2NlcnRlLmdvYi52 +ZaAbBgVghl4CAqASDBBSSUYtRy0yMDAwNDAzNi0wMB0GA1UdDgQWBBStuyIdxuDS +Aaj9dlBSk+2YwU2u0zCCAVAGA1UdIwSCAUcwggFDgBStuyIdxuDSAaj9dlBSk+2Y +wU2u06GCASakggEiMIIBHjE+MDwGA1UEAxM1QXV0b3JpZGFkIGRlIENlcnRpZmlj +YWNpb24gUmFpeiBkZWwgRXN0YWRvIFZlbmV6b2xhbm8xCzAJBgNVBAYTAlZFMRAw +DgYDVQQHEwdDYXJhY2FzMRkwFwYDVQQIExBEaXN0cml0byBDYXBpdGFsMTYwNAYD +VQQKEy1TaXN0ZW1hIE5hY2lvbmFsIGRlIENlcnRpZmljYWNpb24gRWxlY3Ryb25p +Y2ExQzBBBgNVBAsTOlN1cGVyaW50ZW5kZW5jaWEgZGUgU2VydmljaW9zIGRlIENl +cnRpZmljYWNpb24gRWxlY3Ryb25pY2ExJTAjBgkqhkiG9w0BCQEWFmFjcmFpekBz +dXNjZXJ0ZS5nb2IudmWCAQEwDgYDVR0PAQH/BAQDAgEGMDcGA1UdEQQwMC6CD3N1 +c2NlcnRlLmdvYi52ZaAbBgVghl4CAqASDBBSSUYtRy0yMDAwNDAzNi0wMFQGA1Ud +HwRNMEswJKAioCCGHmhodHA6Ly93d3cuc3VzY2VydGUuZ29iLnZlL2xjcjAjoCGg +H4YdbGRhcDovL2FjcmFpei5zdXNjZXJ0ZS5nb2IudmUwNwYIKwYBBQUHAQEEKzAp +MCcGCCsGAQUFBzABhhtoaHRwOi8vb2NzcC5zdXNjZXJ0ZS5nb2IudmUwQAYDVR0g +BDkwNzA1BgVghl4BAjAsMCoGCCsGAQUFBwIBFh5odHRwOi8vd3d3LnN1c2NlcnRl +LmdvYi52ZS9kcGMwDQYJKoZIhvcNAQEMBQADggIBAK4qy/zmZ9zBwfW3yOYtLcBT +Oy4szJyPz7/RhNH3bPVH7HbDTGpi6JZ4YXdXMBeJE5qBF4a590Kgj8Rlnltt+Rbo +OFQOU1UDqKuTdBsA//Zry5899fmn8jBUkg4nh09jhHHbLlaUScdz704Zz2+UVg7i +s/r3Legxap60KzmdrmTAE9VKte1TQRgavQwVX5/2mO/J+SCas//UngI+h8SyOucq +mjudYEgBrZaodUsagUfn/+AzFNrGLy+al+5nZeHb8JnCfLHWS0M9ZyhgoeO/czyn +99+5G93VWNv4zfc4KiavHZKrkn8F9pg0ycIZh+OwPT/RE2zq4gTazBMlP3ACIe/p +olkNaOEa8KvgzW96sjBZpMW49zFmyINYkcj+uaNCJrVGsXgdBmkuRGJNWFZ9r0cG +woIaxViFBypsz045r1ESfYPlfDOavBhZ/giR/Xocm9CHkPRY2BApMMR0DUCyGETg +Ql+L3kfdTKzuDjUp2DM9FqysQmaM81YDZufWkMhlZPfHwC7KbNougoLroa5Umeos +bqAXWmk46SwIdWRPLLqbUpDTKooynZKpSYIkkotdgJoVZUUCY+RCO8jsVPEU6ece +SxztNUm5UOta1OJPMwSAKRHOo3ilVb9c6lAixDdvV8MeNbqe6asM1mpCHWbJ/0rg +5Ls9Cxx8hracyp0ev7b0 +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIGATCCA+mgAwIBAgIRAI9hcRW6eVgXjH0ROqzW264wDQYJKoZIhvcNAQELBQAw +RTEfMB0GA1UEAxMWQ29tU2lnbiBHbG9iYWwgUm9vdCBDQTEVMBMGA1UEChMMQ29t +U2lnbiBMdGQuMQswCQYDVQQGEwJJTDAeFw0xMTA3MTgxMDI0NTRaFw0zNjA3MTYx +MDI0NTVaMEUxHzAdBgNVBAMTFkNvbVNpZ24gR2xvYmFsIFJvb3QgQ0ExFTATBgNV +BAoTDENvbVNpZ24gTHRkLjELMAkGA1UEBhMCSUwwggIiMA0GCSqGSIb3DQEBAQUA +A4ICDwAwggIKAoICAQCyKClzKh3rm6n1nvigmV/VU1D4hSwYW2ro3VqpzpPo0Ph3 +3LguqjXd5juDwN4mpxTpD99d7Xu5X6KGTlMVtfN+bTbA4t3x7DU0Zqn0BE5XuOgs +3GLH41Vmr5wox1bShVpM+IsjcN4E/hMnDtt/Bkb5s33xCG+ohz5dlq0gA9qfr/g4 +O9lkHZXTCeYrmVzd/il4x79CqNvGkdL3um+OKYl8rg1dPtD8UsytMaDgBAopKR+W +igc16QJzCbvcinlETlrzP/Ny76BWPnAQgaYBULax/Q5thVU+N3sEOKp6uviTdD+X +O6i96gARU4H0xxPFI75PK/YdHrHjfjQevXl4J37FJfPMSHAbgPBhHC+qn/014DOx +46fEGXcdw2BFeIIIwbj2GH70VyJWmuk/xLMCHHpJ/nIF8w25BQtkPpkwESL6esaU +b1CyB4Vgjyf16/0nRiCAKAyC/DY/Yh+rDWtXK8c6QkXD2XamrVJo43DVNFqGZzbf +5bsUXqiVDOz71AxqqK+p4ek9374xPNMJ2rB5MLPAPycwI0bUuLHhLy6nAIFHLhut +TNI+6Y/soYpi5JSaEjcY7pxI8WIkUAzr2r+6UoT0vAdyOt7nt1y8844a7szo/aKf +woziHl2O1w6ZXUC30K+ptXVaOiW79pBDcbLZ9ZdbONhS7Ea3iH4HJNwktrBJLQID +AQABo4HrMIHoMA8GA1UdEwEB/wQFMAMBAf8wgYQGA1UdHwR9MHswPKA6oDiGNmh0 +dHA6Ly9mZWRpci5jb21zaWduLmNvLmlsL2NybC9jb21zaWduZ2xvYmFscm9vdGNh +LmNybDA7oDmgN4Y1aHR0cDovL2NybDEuY29tc2lnbi5jby5pbC9jcmwvY29tc2ln +bmdsb2JhbHJvb3RjYS5jcmwwDgYDVR0PAQH/BAQDAgGGMB0GA1UdDgQWBBQCRZPY +DUhirGm6rgZbPvuqJpFQsTAfBgNVHSMEGDAWgBQCRZPYDUhirGm6rgZbPvuqJpFQ +sTANBgkqhkiG9w0BAQsFAAOCAgEAk1V5V9701xsfy4mfX+tP9Ln5e9h3N+QMwUfj +kr+k3e8iXOqADjTpUHeBkEee5tJq09ZLp/43F5tZ2eHdYq2ZEX7iWHCnOQet6Yw9 +SU1TahsrGDA6JJD9sdPFnNZooGsU1520e0zNB0dNWwxrWAmu4RsBxvEpWCJbvzQL +dOfyX85RWwli81OiVMBc5XvJ1mxsIIqli45oRynKtsWP7E+b0ISJ1n+XFLdQo/Nm +WA/5sDfT0F5YPzWdZymudMbXitimxC+n4oQE4mbQ4Zm718Iwg3pP9gMMcSc7Qc1J +kJHPH9O7gVubkKHuSYj9T3Ym6c6egL1pb4pz/uT7cT26Fiopc/jdqbe2EAfoJZkv +hlp/zdzOoXTWjiKNA5zmgWnZn943FuE9KMRyKtyi/ezJXCh8ypnqLIKxeFfZl69C +BwJsPXUTuqj8Fic0s3aZmmr7C4jXycP+Q8V+akMEIoHAxcd960b4wVWKqOcI/kZS +Q0cYqWOY1LNjznRt9lweWEfwDBL3FhrHOmD4++1N3FkkM4W+Q1b2WOL24clDMj+i +2n9Iw0lc1llHMSMvA5D0vpsXZpOgcCVahfXczQKi9wQ3oZyonJeWx4/rXdMtagAB +VBYGFuMEUEQtybI+eIbnp5peO2WAAblQI4eTy/jMVowe5tfMEXovV3sz9ULgmGb3 +DscLP1I= +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIICmDCCAgGgAwIBAgIBDjANBgkqhkiG9w0BAQUFADBLMQswCQYDVQQGEwJVUzEY +MBYGA1UEChMPVS5TLiBHb3Zlcm5tZW50MQwwCgYDVQQLEwNFQ0ExFDASBgNVBAMT +C0VDQSBSb290IENBMB4XDTA0MDYxNDEwMjAwOVoXDTQwMDYxNDEwMjAwOVowSzEL +MAkGA1UEBhMCVVMxGDAWBgNVBAoTD1UuUy4gR292ZXJubWVudDEMMAoGA1UECxMD +RUNBMRQwEgYDVQQDEwtFQ0EgUm9vdCBDQTCBnzANBgkqhkiG9w0BAQEFAAOBjQAw +gYkCgYEArkr2eXIS6oAKIpDkOlcQZdMGdncoygCEIU+ktqY3of5SVVXU7/it7kJ1 +EUzR4ii2vthQtbww9aAnpQxcEmXZk8eEyiGEPy+cCQMllBY+efOtKgjbQNDZ3lB9 +19qzUJwBl2BMxslU1XsJQw9SK10lPbQm4asa8E8e5zTUknZBWnECAwEAAaOBizCB +iDAfBgNVHSMEGDAWgBT2uAQnDlYW2blj2f2hVGVBoAhILzAdBgNVHQ4EFgQU9rgE +Jw5WFtm5Y9n9oVRlQaAISC8wDgYDVR0PAQH/BAQDAgGGMA8GA1UdEwEB/wQFMAMB +Af8wJQYDVR0gBB4wHDAMBgpghkgBZQMCAQwBMAwGCmCGSAFlAwIBDAIwDQYJKoZI +hvcNAQEFBQADgYEAHh0EQY2cZ209aBb5q0wW1ER0dc4OGzsLyqjHfaQ4TEaMmUwL +AJRta/c4KVWLiwbODsvgJk+CaWmSL03gRW/ciVb/qDV7qh9Pyd1cOlanZTAnPog2 +i82yL3i2fK9DCC84uoxEQbgqK2jx9bIjFTwlAqITk9fGAm5mdT84IEwq1Gw= +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIDjjCCAnagAwIBAgIQAzrx5qcRqaC7KGSxHQn65TANBgkqhkiG9w0BAQsFADBh +MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3 +d3cuZGlnaWNlcnQuY29tMSAwHgYDVQQDExdEaWdpQ2VydCBHbG9iYWwgUm9vdCBH +MjAeFw0xMzA4MDExMjAwMDBaFw0zODAxMTUxMjAwMDBaMGExCzAJBgNVBAYTAlVT +MRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5j +b20xIDAeBgNVBAMTF0RpZ2lDZXJ0IEdsb2JhbCBSb290IEcyMIIBIjANBgkqhkiG +9w0BAQEFAAOCAQ8AMIIBCgKCAQEAuzfNNNx7a8myaJCtSnX/RrohCgiN9RlUyfuI +2/Ou8jqJkTx65qsGGmvPrC3oXgkkRLpimn7Wo6h+4FR1IAWsULecYxpsMNzaHxmx +1x7e/dfgy5SDN67sH0NO3Xss0r0upS/kqbitOtSZpLYl6ZtrAGCSYP9PIUkY92eQ +q2EGnI/yuum06ZIya7XzV+hdG82MHauVBJVJ8zUtluNJbd134/tJS7SsVQepj5Wz +tCO7TG1F8PapspUwtP1MVYwnSlcUfIKdzXOS0xZKBgyMUNGPHgm+F6HmIcr9g+UQ +vIOlCsRnKPZzFBQ9RnbDhxSJITRNrw9FDKZJobq7nMWxM4MphQIDAQABo0IwQDAP +BgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBhjAdBgNVHQ4EFgQUTiJUIBiV +5uNu5g/6+rkS7QYXjzkwDQYJKoZIhvcNAQELBQADggEBAGBnKJRvDkhj6zHd6mcY +1Yl9PMWLSn/pvtsrF9+wX3N3KjITOYFnQoQj8kVnNeyIv/iPsGEMNKSuIEyExtv4 +NeF22d+mQrvHRAiGfzZ0JFrabA0UWTW98kndth/Jsw1HKj2ZL7tcu7XUIOGZX1NG +Fdtom/DzMNU+MeKNhJ7jitralj41E6Vf8PlwUHBHQRFXGU7Aj64GxJUTFy8bJZ91 +8rGOmaFvE7FBcf6IKshPECBV1/MUReXgRPTqh5Uykw7+U0b6LJ3/iyK5S9kJRaTe +pLiaWN0bfVKfjllDiIGknibVb63dDcY3fe0Dkhvld1927jyNxF1WW6LZZm6zNTfl +MrY= +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIFSzCCAzOgAwIBAgIRALZLiAfiI+7IXBKtpg4GofIwDQYJKoZIhvcNAQELBQAw +PzELMAkGA1UEBhMCVFcxMDAuBgNVBAoMJ0dvdmVybm1lbnQgUm9vdCBDZXJ0aWZp +Y2F0aW9uIEF1dGhvcml0eTAeFw0xMjA5MjgwODU4NTFaFw0zNzEyMzExNTU5NTla +MD8xCzAJBgNVBAYTAlRXMTAwLgYDVQQKDCdHb3Zlcm5tZW50IFJvb3QgQ2VydGlm +aWNhdGlvbiBBdXRob3JpdHkwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoIC +AQC2/5c8gb4BWCQnr44BK9ZykjAyG1+bfNTUf+ihYHMwVxAA+lCWJP5Q5ow6ldFX +eYTVZ1MMKoI+GFy4MCYa1l7GLbIEUQ7v3wxjR+vEEghRK5lxXtVpe+FdyXcdIOxW +juVhYC386RyA3/pqg7sFtR4jEpyCygrzFB0g5AaPQySZn7YKk1pzGxY5vgW28Yyl +ZJKPBeRcdvc5w88tvQ7Yy6gOMZvJRg9nU0MEj8iyyIOAX7ryD6uBNaIgIZfOD4k0 +eA/PH07p+4woPN405+2f0mb1xcoxeNLOUNFggmOd4Ez3B66DNJ1JSUPUfr0t4urH +cWWACOQ2nnlwCjyHKenkkpTqBpIpJ3jmrdc96QoLXvTg1oadLXLLi2RW5vSueKWg +OTNYPNyoj420ai39iHPplVBzBN8RiD5C1gJ0+yzEb7xs1uCAb9GGpTJXA9ZN9E4K +mSJ2fkpAgvjJ5E7LUy3Hsbbi08J1J265DnGyNPy/HE7CPfg26QrMWJqhGIZO4uGq +s3NZbl6dtMIIr69c/aQCb/+4DbvVq9dunxpPkUDwH0ZVbaCSw4nNt7H/HLPLo5wK +4/7NqrwB7N1UypHdTxOHpPaY7/1J1lcqPKZc9mA3v9g+fk5oKiMyOr5u5CI9ByTP +isubXVGzMNJxbc5Gim18SjNE2hIvNkvy6fFRCW3bapcOFwIDAQABo0IwQDAPBgNV +HRMBAf8EBTADAQH/MB0GA1UdDgQWBBTVZx3gnHosnMvFmOcdByYqhux0zTAOBgNV +HQ8BAf8EBAMCAQYwDQYJKoZIhvcNAQELBQADggIBAJA75cJTQijq9TFOjj2Rnk0J +89ixUuZPrAwxIbvx6pnMg/y2KOTshAcOD06Xu29oRo8OURWV+Do7H1+CDgxxDryR +T64zLiNB9CZrTxOH+nj2LsIPkQWXqmrBap+8hJ4IKifd2ocXhuGzyl3tOKkpboTe +Rmv8JxlQpRJ6jH1i/NrnzLyfSa8GuCcn8on3Fj0Y5r3e9YwSkZ/jBI3+BxQaWqw5 +ghvxOBnhY+OvbLamURfr+kvriyL2l/4QOl+UoEtTcT9a4RD4co+WgN2NApgAYT2N +vC2xR8zaXeEgp4wxXPHj2rkKhkfIoT0Hozymc26Uke1uJDr5yTDRB6iBfSZ9fYTf +hsmL5a4NHr6JSFEVg5iWL0rrczTXdM3Jb9DCuiv2mv6Z3WAUjhv5nDk8f0OJU+jl +wqu+Iq0nOJt3KLejY2OngeepaUXrjnhWzAWEx/uttjB8YwWfLYwkf0uLkvw4Hp+g +pVezbp3YZLhwmmBScMip0P/GnO0QYV7Ngw5u6E0CQUridgR51lQ/ipgyFKDdLZzn +uoJxo4ZVKZnSKdt1OvfbQ/+2W/u3fjWAjg1srnm3Ni2XUqGwB5wH5Ss2zQOXlL0t +DjQG/MAWifw3VOTWzz0TBPKR2ck2Lj7FWtClTILD/y58Jnb38/1FoqVuVa4uzM8s +iTTa9g3nkagQ6hed8vbs +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIB/jCCAYWgAwIBAgIIdJclisc/elQwCgYIKoZIzj0EAwMwRTELMAkGA1UEBhMC +VVMxFDASBgNVBAoMC0FmZmlybVRydXN0MSAwHgYDVQQDDBdBZmZpcm1UcnVzdCBQ +cmVtaXVtIEVDQzAeFw0xMDAxMjkxNDIwMjRaFw00MDEyMzExNDIwMjRaMEUxCzAJ +BgNVBAYTAlVTMRQwEgYDVQQKDAtBZmZpcm1UcnVzdDEgMB4GA1UEAwwXQWZmaXJt +VHJ1c3QgUHJlbWl1bSBFQ0MwdjAQBgcqhkjOPQIBBgUrgQQAIgNiAAQNMF4bFZ0D +0KF5Nbc6PJJ6yhUczWLznCZcBz3lVPqj1swS6vQUX+iOGasvLkjmrBhDeKzQN8O9 +ss0s5kfiGuZjuD0uL3jET9v0D6RoTFVya5UdThhClXjMNzyR4ptlKymjQjBAMB0G +A1UdDgQWBBSaryl6wBE1NSZRMADDav5A1a7WPDAPBgNVHRMBAf8EBTADAQH/MA4G +A1UdDwEB/wQEAwIBBjAKBggqhkjOPQQDAwNnADBkAjAXCfOHiFBar8jAQr9HX/Vs +aobgxCd05DhT1wV/GzTjxi+zygk8N53X57hG8f2h4nECMEJZh0PUUd+60wkyWs6I +flc9nF9Ca/UHLbXwgpP5WW+uZPpY5Yse42O+tYHNbwKMeQ== +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIFWTCCA0GgAwIBAgIBAjANBgkqhkiG9w0BAQsFADBOMQswCQYDVQQGEwJOTzEd +MBsGA1UECgwUQnV5cGFzcyBBUy05ODMxNjMzMjcxIDAeBgNVBAMMF0J1eXBhc3Mg +Q2xhc3MgMiBSb290IENBMB4XDTEwMTAyNjA4MzgwM1oXDTQwMTAyNjA4MzgwM1ow +TjELMAkGA1UEBhMCTk8xHTAbBgNVBAoMFEJ1eXBhc3MgQVMtOTgzMTYzMzI3MSAw +HgYDVQQDDBdCdXlwYXNzIENsYXNzIDIgUm9vdCBDQTCCAiIwDQYJKoZIhvcNAQEB +BQADggIPADCCAgoCggIBANfHXvfBB9R3+0Mh9PT1aeTuMgHbo4Yf5FkNuud1g1Lr +6hxhFUi7HQfKjK6w3Jad6sNgkoaCKHOcVgb/S2TwDCo3SbXlzwx87vFKu3MwZfPV +L4O2fuPn9Z6rYPnT8Z2SdIrkHJasW4DptfQxh6NR/Md+oW+OU3fUl8FVM5I+GC91 +1K2GScuVr1QGbNgGE41b/+EmGVnAJLqBcXmQRFBoJJRfuLMR8SlBYaNByyM21cHx +MlAQTn/0hpPshNOOvEu/XAFOBz3cFIqUCqTqc/sLUegTBxj6DvEr0VQVfTzh97QZ +QmdiXnfgolXsttlpF9U6r0TtSsWe5HonfOV116rLJeffawrbD02TTqigzXsu8lkB +arcNuAeBfos4GzjmCleZPe4h6KP1DBbdi+w0jpwqHAAVF41og9JwnxgIzRFo1clr +Us3ERo/ctfPYV3Me6ZQ5BL/T3jjetFPsaRyifsSP5BtwrfKi+fv3FmRmaZ9JUaLi +FRhnBkp/1Wy1TbMz4GHrXb7pmA8y1x1LPC5aAVKRCfLf6o3YBkBjqhHk/sM3nhRS +P/TizPJhk9H9Z2vXUq6/aKtAQ6BXNVN48FP4YUIHZMbXb5tMOA1jrGKvNouicwoN +9SG9dKpN6nIDSdvHXx1iY8f93ZHsM+71bbRuMGjeyNYmsHVee7QHIJihdjK4TWxP +AgMBAAGjQjBAMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFMmAd+BikoL1Rpzz +uvdMw964o605MA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQsFAAOCAgEAU18h +9bqwOlI5LJKwbADJ784g7wbylp7ppHR/ehb8t/W2+xUbP6umwHJdELFx7rxP462s +A20ucS6vxOOto70MEae0/0qyexAQH6dXQbLArvQsWdZHEIjzIVEpMMpghq9Gqx3t +OluwlN5E40EIosHsHdb9T7bWR9AUC8rmyrV7d35BH16Dx7aMOZawP5aBQW9gkOLo ++fsicdl9sz1Gv7SEr5AcD48Saq/v7h56rgJKihcrdv6sVIkkLE8/trKnToyokZf7 +KcZ7XC25y2a2t6hbElGFtQl+Ynhw/qlqYLYdDnkM/crqJIByw5c/8nerQyIKx+u2 +DISCLIBrQYoIwOula9+ZEsuK1V6ADJHgJgg2SMX6OBE1/yWDLfJ6v9r9jv6ly0Us +H8SIU653DtmadsWOLB2jutXsMq7Aqqz30XpN69QH4kj3Io6wpJ9qzo6ysmD0oyLQ +I+uUWnpp3Q+/QFesa1lQ2aOZ4W7+jQF5JyMV3pKdewlNWudLSDBaGOYKbeaP4NK7 +5t98biGCwWg5TbSYWGZizEqQXsP6JwSxeRV0mcy+rSDeJmAc61ZRpqPq5KM/p/9h +3PFaTWwyI0PurKju7koSCTxdccK+efrCh2gdC/1cacwG0Jp9VJkqyTkaGa9LKkPz +Y11aWOIv4x3kqdbQCtCev9eBCfHJxyYNrJgWVqA= +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIFaTCCA1GgAwIBAgIJAMMDmu5QkG4oMA0GCSqGSIb3DQEBBQUAMFIxCzAJBgNV +BAYTAlNLMRMwEQYDVQQHEwpCcmF0aXNsYXZhMRMwEQYDVQQKEwpEaXNpZyBhLnMu +MRkwFwYDVQQDExBDQSBEaXNpZyBSb290IFIxMB4XDTEyMDcxOTA5MDY1NloXDTQy +MDcxOTA5MDY1NlowUjELMAkGA1UEBhMCU0sxEzARBgNVBAcTCkJyYXRpc2xhdmEx +EzARBgNVBAoTCkRpc2lnIGEucy4xGTAXBgNVBAMTEENBIERpc2lnIFJvb3QgUjEw +ggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCqw3j33Jijp1pedxiy3QRk +D2P9m5YJgNXoqqXinCaUOuiZc4yd39ffg/N4T0Dhf9Kn0uXKE5Pn7cZ3Xza1lK/o +OI7bm+V8u8yN63Vz4STN5qctGS7Y1oprFOsIYgrY3LMATcMjfF9DCCMyEtztDK3A +fQ+lekLZWnDZv6fXARz2m6uOt0qGeKAeVjGu74IKgEH3G8muqzIm1Cxr7X1r5OJe +IgpFy4QxTaz+29FHuvlglzmxZcfe+5nkCiKxLU3lSCZpq+Kq8/v8kiky6bM+TR8n +oc2OuRf7JT7JbvN32g0S9l3HuzYQ1VTW8+DiR0jm3hTaYVKvJrT1cU/J19IG32PK +/yHoWQbgCNWEFVP3Q+V8xaCJmGtzxmjOZd69fwX3se72V6FglcXM6pM6vpmumwKj +rckWtc7dXpl4fho5frLABaTAgqWjR56M6ly2vGfb5ipN0gTco65F97yLnByn1tUD +3AjLLhbKXEAz6GfDLuemROoRRRw1ZS0eRWEkG4IupZ0zXWX4Qfkuy5Q/H6MMMSRE +7cderVC6xkGbrPAXZcD4XW9boAo0PO7X6oifmPmvTiT6l7Jkdtqr9O3jw2Dv1fkC +yC2fg69naQanMVXVz0tv/wQFx1isXxYb5dKj6zHbHzMVTdDypVP1y+E9Tmgt2BLd +qvLmTZtJ5cUoobqwWsagtQIDAQABo0IwQDAPBgNVHRMBAf8EBTADAQH/MA4GA1Ud +DwEB/wQEAwIBBjAdBgNVHQ4EFgQUiQq0OJMa5qvum5EY+fU8PjXQ04IwDQYJKoZI +hvcNAQEFBQADggIBADKL9p1Kyb4U5YysOMo6CdQbzoaz3evUuii+Eq5FLAR0rBNR +xVgYZk2C2tXck8An4b58n1KeElb21Zyp9HWc+jcSjxyT7Ff+Bw+r1RL3D65hXlaA +SfX8MPWbTx9BLxyE04nH4toCdu0Jz2zBuByDHBb6lM19oMgY0sidbvW9adRtPTXo +HqJPYNcHKfyyo6SdbhWSVhlMCrDpfNIZTUJG7L399ldb3Zh+pE3McgODWF3vkzpB +emOqfDqo9ayk0d2iLbYq/J8BjuIQscTK5GfbVSUZP/3oNn6z4eGBrxEWi1CXYBmC +AMBrTXO40RMHPuq2MU/wQppt4hF05ZSsjYSVPCGvxdpHyN85YmLLW1AL14FABZyb +7bq2ix4Eb5YgOe2kfSnbSM6C3NQCjR0EMVrHS/BsYVLXtFHCgWzN4funodKSds+x +DzdYpPJScWc/DIh4gInByLUfkmO+p3qKViwaqKactV2zY9ATIKHrkWzQjX2v3wvk +F7mGnjixlAxYjOBVqjtjbZqJYLhkKpLGN/R+Q0O3c+gB53+XD9fyexn9GtePyfqF +a3qdnom2piiZk4hA9z7NUaPK6u95RyG1/jLix8NRb76AdPCkwzryT+lf3xkK8jsT +Q6wxpLPn6/wY1gGp8yqPNg7rtLG8t0zJa7+h89n07eLw4+1knj0vllJPgFOL +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIID9jCCAt6gAwIBAgIQJDJ18h0v0gkz97RqytDzmDANBgkqhkiG9w0BAQsFADCB +lDELMAkGA1UEBhMCVVMxHTAbBgNVBAoTFFN5bWFudGVjIENvcnBvcmF0aW9uMR8w +HQYDVQQLExZTeW1hbnRlYyBUcnVzdCBOZXR3b3JrMUUwQwYDVQQDEzxTeW1hbnRl +YyBDbGFzcyAxIFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5 +IC0gRzYwHhcNMTExMDE4MDAwMDAwWhcNMzcxMjAxMjM1OTU5WjCBlDELMAkGA1UE +BhMCVVMxHTAbBgNVBAoTFFN5bWFudGVjIENvcnBvcmF0aW9uMR8wHQYDVQQLExZT +eW1hbnRlYyBUcnVzdCBOZXR3b3JrMUUwQwYDVQQDEzxTeW1hbnRlYyBDbGFzcyAx +IFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5IC0gRzYwggEi +MA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDHOddJZKmZgiJM6kXZBxbje/SD +6Jlz+muxNuCad6BAwoGNAcfMjL2Pffd543pMA03Z+/2HOCgs3ZqLVAjbZ/sbjP4o +ki++t7JIp4Gh2F6Iw8w5QEFa0dzl2hCfL9oBTf0uRnz5LicKaTfukaMbasxEvxvH +w9QRslBglwm9LiL1QYRmn81ApqkAgMEflZKf3vNI79sdd2H8f9/ulqRy0LY+/3gn +r8uSFWkI22MQ4uaXrG7crPaizh5HmbmJtxLmodTNWRFnw2+F2EJOKL5ZVVkElauP +N4C/DfD8HzpkMViBeNfiNfYgPym4jxZuPkjctUwH4fIa6n4KedaovetdhitNAgMB +AAGjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQW +BBQzQejIORIVk0jyljIuWvXalF9TYDANBgkqhkiG9w0BAQsFAAOCAQEAFeNzV7EX +tl9JaUSm9l56Z6zS3nVJq/4lVcc6yUQVEG6/MWvL2QeTfxyFYwDjMhLgzMv7OWyP +4lPiPEAz2aSMR+atWPuJr+PehilWNCxFuBL6RIluLRQlKCQBZdbqUqwFblYSCT3Q +dPTXvQbKqDqNVkL6jXI+dPEDct+HG14OelWWLDi3mIXNTTNEyZSPWjEwN0ujOhKz +5zbRIWhLLTjmU64cJVYIVgNnhJ3Gw84kYsdMNs+wBkS39V8C3dlU6S+QTnrIToNA +DJqXPDe/v+z28LSFdyjBC8hnghAXOKK3Buqbvzr46SMHv3TgmDgVVXjucgBcGaP0 +0jPg/73RVDkpDw== +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIFaTCCA1GgAwIBAgIJAJK4iNuwisFjMA0GCSqGSIb3DQEBCwUAMFIxCzAJBgNV +BAYTAlNLMRMwEQYDVQQHEwpCcmF0aXNsYXZhMRMwEQYDVQQKEwpEaXNpZyBhLnMu +MRkwFwYDVQQDExBDQSBEaXNpZyBSb290IFIyMB4XDTEyMDcxOTA5MTUzMFoXDTQy +MDcxOTA5MTUzMFowUjELMAkGA1UEBhMCU0sxEzARBgNVBAcTCkJyYXRpc2xhdmEx +EzARBgNVBAoTCkRpc2lnIGEucy4xGTAXBgNVBAMTEENBIERpc2lnIFJvb3QgUjIw +ggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCio8QACdaFXS1tFPbCw3Oe +NcJxVX6B+6tGUODBfEl45qt5WDza/3wcn9iXAng+a0EE6UG9vgMsRfYvZNSrXaNH +PWSb6WiaxswbP7q+sos0Ai6YVRn8jG+qX9pMzk0DIaPY0jSTVpbLTAwAFjxfGs3I +x2ymrdMxp7zo5eFm1tL7A7RBZckQrg4FY8aAamkw/dLukO8NJ9+flXP04SXabBbe +QTg06ov80egEFGEtQX6sx3dOy1FU+16SGBsEWmjGycT6txOgmLcRK7fWV8x8nhfR +yyX+hk4kLlYMeE2eARKmK6cBZW58Yh2EhN/qwGu1pSqVg8NTEQxzHQuyRpDRQjrO +QG6Vrf/GlK1ul4SOfW+eioANSW1z4nuSHsPzwfPrLgVv2RvPN3YEyLRa5Beny912 +H9AZdugsBbPWnDTYltxhh5EF5EQIM8HauQhl1K6yNg3ruji6DOWbnuuNZt2Zz9aJ +QfYEkoopKW1rOhzndX0CcQ7zwOe9yxndnWCywmZgtrEE7snmhrmaZkCo5xHtgUUD +i/ZnWejBBhG93c+AAk9lQHhcR1DIm+YfgXvkRKhbhZri3lrVx/k6RGZL5DJUfORs +nLMOPReisjQS1n6yqEm70XooQL6iFh/f5DcfEXP7kAplQ6INfPgGAVUzfbANuPT1 +rqVCV3w2EYx7XsQDnYx5nQIDAQABo0IwQDAPBgNVHRMBAf8EBTADAQH/MA4GA1Ud +DwEB/wQEAwIBBjAdBgNVHQ4EFgQUtZn4r7CU9eMg1gqtzk5WpC5uQu0wDQYJKoZI +hvcNAQELBQADggIBACYGXnDnZTPIgm7ZnBc6G3pmsgH2eDtpXi/q/075KMOYKmFM +tCQSin1tERT3nLXK5ryeJ45MGcipvXrA1zYObYVybqjGom32+nNjf7xueQgcnYqf +GopTpti72TVVsRHFqQOzVju5hJMiXn7B9hJSi+osZ7z+Nkz1uM/Rs0mSO9MpDpkb +lvdhuDvEK7Z4bLQjb/D907JedR+Zlais9trhxTF7+9FGs9K8Z7RiVLoJ92Owk6Ka ++elSLotgEqv89WBW7xBci8QaQtyDW2QOy7W81k/BfDxujRNt+3vrMNDcTa/F1bal +TFtxyegxvug4BkihGuLq0t4SOVga/4AOgnXmt8kHbA7v/zjxmHHEt38OFdAlab0i +nSvtBfZGR6ztwPDUO+Ls7pZbkBNOHlY667DvlruWIxG68kOGdGSVyCh13x01utI3 +gzhTODY7z2zp+WsO0PsE6E9312UBeIYMej4hYvF/Y3EMyZ9E26gnonW+boE+18Dr +G5gPcFw0sorMwIUY6256s/daoQe/qUKS82Ail+QUoQebTnbAjn39pCXHR+3/H3Os +zMOl6W8KjptlwlCFtaOgUxLMVYdh84GuEEZhvUQhuMI9dM9+JDX6HAcOmz0iyu8x +L4ysEr3vQCj8KWefshNPZiTEUxnpHikV7+ZtsH8tZ/3zbBt1RqPlShfppNcL +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIEADCCAuigAwIBAgIBADANBgkqhkiG9w0BAQUFADBjMQswCQYDVQQGEwJVUzEh +MB8GA1UEChMYVGhlIEdvIERhZGR5IEdyb3VwLCBJbmMuMTEwLwYDVQQLEyhHbyBE +YWRkeSBDbGFzcyAyIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTA0MDYyOTE3 +MDYyMFoXDTM0MDYyOTE3MDYyMFowYzELMAkGA1UEBhMCVVMxITAfBgNVBAoTGFRo +ZSBHbyBEYWRkeSBHcm91cCwgSW5jLjExMC8GA1UECxMoR28gRGFkZHkgQ2xhc3Mg +MiBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTCCASAwDQYJKoZIhvcNAQEBBQADggEN +ADCCAQgCggEBAN6d1+pXGEmhW+vXX0iG6r7d/+TvZxz0ZWizV3GgXne77ZtJ6XCA +PVYYYwhv2vLM0D9/AlQiVBDYsoHUwHU9S3/Hd8M+eKsaA7Ugay9qK7HFiH7Eux6w +wdhFJ2+qN1j3hybX2C32qRe3H3I2TqYXP2WYktsqbl2i/ojgC95/5Y0V4evLOtXi +EqITLdiOr18SPaAIBQi2XKVlOARFmR6jYGB0xUGlcmIbYsUfb18aQr4CUWWoriMY +avx4A6lNf4DD+qta/KFApMoZFv6yyO9ecw3ud72a9nmYvLEHZ6IVDd2gWMZEewo+ +YihfukEHU1jPEX44dMX4/7VpkI+EdOqXG68CAQOjgcAwgb0wHQYDVR0OBBYEFNLE +sNKR1EwRcbNhyz2h/t2oatTjMIGNBgNVHSMEgYUwgYKAFNLEsNKR1EwRcbNhyz2h +/t2oatTjoWekZTBjMQswCQYDVQQGEwJVUzEhMB8GA1UEChMYVGhlIEdvIERhZGR5 +IEdyb3VwLCBJbmMuMTEwLwYDVQQLEyhHbyBEYWRkeSBDbGFzcyAyIENlcnRpZmlj +YXRpb24gQXV0aG9yaXR5ggEAMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEFBQAD +ggEBADJL87LKPpH8EsahB4yOd6AzBhRckB4Y9wimPQoZ+YeAEW5p5JYXMP80kWNy +OO7MHAGjHZQopDH2esRU1/blMVgDoszOYtuURXO1v0XJJLXVggKtI3lpjbi2Tc7P +TMozI+gciKqdi0FuFskg5YmezTvacPd+mSYgFFQlq25zheabIZ0KbIIOqPjCDPoQ +HmyW74cNxA9hi63ugyuV+I6ShHI56yDqg+2DzZduCLzrTia2cyvk0/ZM/iZx4mER +dEr/VxqHD3VILs9RaRegAhJhldXRQLIQTO7ErBBDpqWeCtWVYpoNz4iCxTIM5Cuf +ReYNnyicsbkqWletNw+vHX/bvZ8= +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIEGjCCAwKgAwIBAgIDAYagMA0GCSqGSIb3DQEBBQUAMIGjMQswCQYDVQQGEwJG +STEQMA4GA1UECBMHRmlubGFuZDEhMB8GA1UEChMYVmFlc3RvcmVraXN0ZXJpa2Vz +a3VzIENBMSkwJwYDVQQLEyBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSBTZXJ2aWNl +czEZMBcGA1UECxMQVmFybWVubmVwYWx2ZWx1dDEZMBcGA1UEAxMQVlJLIEdvdi4g +Um9vdCBDQTAeFw0wMjEyMTgxMzUzMDBaFw0yMzEyMTgxMzUxMDhaMIGjMQswCQYD +VQQGEwJGSTEQMA4GA1UECBMHRmlubGFuZDEhMB8GA1UEChMYVmFlc3RvcmVraXN0 +ZXJpa2Vza3VzIENBMSkwJwYDVQQLEyBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSBT +ZXJ2aWNlczEZMBcGA1UECxMQVmFybWVubmVwYWx2ZWx1dDEZMBcGA1UEAxMQVlJL +IEdvdi4gUm9vdCBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALCF +FdrIAzfQo0Y3bBseljDCWoUSZyPyu5/nioFgJ/gTqTy894aqqvTzJSm0/nWuHoGG +igWyHWWyOOi0zCia+xc28ZPVec7Bg4shT8MNrUHfeJ1I4x9CRPw8bSEga60ihCRC +jxdNwlAfZM0tOSJWiP2yY51U2kJpwMhP1xjiPshphJQ9LIDGfM6911Mf64i5psu7 +hVfvV3ZdDIvTXhJBnyHAOfQmbQj6OLOhd7HuFtjQaNq0mKWgZUZKa41+qk1guPjI +DfxxPu45h4G02fhukO4/DmHXHSto5i7hQkQmeCxY8n0Wf2HASSQqiYe2XS8pGfim +545SnkFLWg6quMJmQlMCAwEAAaNVMFMwDwYDVR0TAQH/BAUwAwEB/zARBglghkgB +hvhCAQEEBAMCAAcwDgYDVR0PAQH/BAQDAgHGMB0GA1UdDgQWBBTb6eGb0tEkC/yr +46Bn6q6cS3f0sDANBgkqhkiG9w0BAQUFAAOCAQEArX1ID1QRnljurw2bEi8hpM2b +uoRH5sklVSPj3xhYKizbXvfNVPVRJHtiZ+GxH0mvNNDrsczZog1Sf0JLiGCXzyVy +t08pLWKfT6HAVVdWDsRol5EfnGTCKTIB6dTI2riBmCguGMcs/OubUpbf9MiQGS0j +8/G7cdqehSO9Gu8u5Hp5t8OdhkktY7ktdM9lDzJmid87Ie4pbzlj2RXBbvbfgD5Q +eBmK3QOjFKU3p7UsfLYRh+cF8ry23tT/l4EohP7+bEaFEEGfTXWMB9SZZ291im/k +UJL2mdUQuMSpe/cXjUu/15WfCdxEDx4yw8DP03kN5Mc7h/CQNIghYkmSBAQfvA== +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIDujCCAqKgAwIBAgIEAJiWijANBgkqhkiG9w0BAQUFADBVMQswCQYDVQQGEwJO +TDEeMBwGA1UEChMVU3RhYXQgZGVyIE5lZGVybGFuZGVuMSYwJAYDVQQDEx1TdGFh +dCBkZXIgTmVkZXJsYW5kZW4gUm9vdCBDQTAeFw0wMjEyMTcwOTIzNDlaFw0xNTEy +MTYwOTE1MzhaMFUxCzAJBgNVBAYTAk5MMR4wHAYDVQQKExVTdGFhdCBkZXIgTmVk +ZXJsYW5kZW4xJjAkBgNVBAMTHVN0YWF0IGRlciBOZWRlcmxhbmRlbiBSb290IENB +MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAmNK1URF6gaYUmHFtvszn +ExvWJw56s2oYHLZhWtVhCb/ekBPHZ+7d89rFDBKeNVU+LCeIQGv33N0iYfXCxw71 +9tV2U02PjLwYdjeFnejKScfST5gTCaI+Ioicf9byEGW07l8Y1Rfj+MX94p2i71MO +hXeiD+EwR+4A5zN9RGcaC1Hoi6CeUJhoNFIfLm0B8mBF8jHrqTFoKbt6QZ7GGX+U +tFE5A3+y3qcym7RHjm+0Sq7lr7HcsBthvJly3uSJt3omXdozSVtSnA71iq3DuD3o +BmrC1SoLbHuEvVYFy4ZlkuxEK7COudxwC0barbxjiDn622r+I/q85Ej0ZytqERAh +SQIDAQABo4GRMIGOMAwGA1UdEwQFMAMBAf8wTwYDVR0gBEgwRjBEBgRVHSAAMDww +OgYIKwYBBQUHAgEWLmh0dHA6Ly93d3cucGtpb3ZlcmhlaWQubmwvcG9saWNpZXMv +cm9vdC1wb2xpY3kwDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBSofeu8Y6R0E3QA +7Jbg0zTBLL9s+DANBgkqhkiG9w0BAQUFAAOCAQEABYSHVXQ2YcG70dTGFagTtJ+k +/rvuFbQvBgwp8qiSpGEN/KtcCFtREytNwiphyPgJWPwtArI5fZlmgb9uXJVFIGzm +eafR2Bwp/MIgJ1HI8XxdNGdphREwxgDS1/PTfLbwMVcoEoJz6TMvplW0C5GUR5z6 +u3pCMuiufi3IvKwUv9kP2Vv8wfl6leF9fpb8cbDCTMjfRTTJzg3ynGQI0DvDKcWy +7ZAEwbEpkcUwb8GpcjPM/l0WFywRaed+/sWDCN+83CI6LiBpIzlWYGeQiy52OfsR +iJf2fL1LuCAWZwWN4jvBcj+UlTfHXbme2JOhF4//DGYVwSR8MnwDHTuhWEUykw== +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIDdzCCAl+gAwIBAgIBADANBgkqhkiG9w0BAQsFADBdMQswCQYDVQQGEwJKUDEl +MCMGA1UEChMcU0VDT00gVHJ1c3QgU3lzdGVtcyBDTy4sTFRELjEnMCUGA1UECxMe +U2VjdXJpdHkgQ29tbXVuaWNhdGlvbiBSb290Q0EyMB4XDTA5MDUyOTA1MDAzOVoX +DTI5MDUyOTA1MDAzOVowXTELMAkGA1UEBhMCSlAxJTAjBgNVBAoTHFNFQ09NIFRy +dXN0IFN5c3RlbXMgQ08uLExURC4xJzAlBgNVBAsTHlNlY3VyaXR5IENvbW11bmlj +YXRpb24gUm9vdENBMjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBANAV +OVKxUrO6xVmCxF1SrjpDZYBLx/KWvNs2l9amZIyoXvDjChz335c9S672XewhtUGr +zbl+dp+++T42NKA7wfYxEUV0kz1XgMX5iZnK5atq1LXaQZAQwdbWQonCv/Q4EpVM +VAX3NuRFg3sUZdbcDE3R3n4MqzvEFb46VqZab3ZpUql6ucjrappdUtAtCms1FgkQ +hNBqyjoGADdH5H5XTz+L62e4iKrFvlNVspHEfbmwhRkGeC7bYRr6hfVKkaHnFtWO +ojnflLhwHyg/i/xAXmODPIMqGplrz95Zajv8bxbXH/1KEOtOghY6rCcMU/Gt1SSw +awNQwS08Ft1ENCcadfsCAwEAAaNCMEAwHQYDVR0OBBYEFAqFqXdlBZh8QIH4D5cs +OPEK7DzPMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8EBTADAQH/MA0GCSqGSIb3 +DQEBCwUAA4IBAQBMOqNErLlFsceTfsgLCkLfZOoc7llsCLqJX2rKSpWeeo8HxdpF +coJxDjrSzG+ntKEju/Ykn8sX/oymzsLS28yN/HH8AynBbF0zX2S2ZTuJbxh2ePXc +okgfGT+Ok+vx+hfuzU7jBBJV1uXk3fs+BXziHV7Gp7yXT2g69ekuCkO2r1dcYmh8 +t/2jioSgrGK+KwmHNPBqAbubKVY8/gA3zyNs8U6qtnRGEmyR7jTV7JqR50S+kDFy +1UkC9gLl9B/rfNmWVan/7Ir5mUf/NVoCqgTLiluHcSmRvaS0eg29mvVXIwAHIRc/ +SjnRBUkLp7Y3gaVdjKozXoEofKd9J+sAro03 +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIEHjCCAwagAwIBAgIBATANBgkqhkiG9w0BAQUFADBnMQswCQYDVQQGEwJTRTEU +MBIGA1UEChMLQWRkVHJ1c3QgQUIxHTAbBgNVBAsTFEFkZFRydXN0IFRUUCBOZXR3 +b3JrMSMwIQYDVQQDExpBZGRUcnVzdCBRdWFsaWZpZWQgQ0EgUm9vdDAeFw0wMDA1 +MzAxMDQ0NTBaFw0yMDA1MzAxMDQ0NTBaMGcxCzAJBgNVBAYTAlNFMRQwEgYDVQQK +EwtBZGRUcnVzdCBBQjEdMBsGA1UECxMUQWRkVHJ1c3QgVFRQIE5ldHdvcmsxIzAh +BgNVBAMTGkFkZFRydXN0IFF1YWxpZmllZCBDQSBSb290MIIBIjANBgkqhkiG9w0B +AQEFAAOCAQ8AMIIBCgKCAQEA5B6a/twJWoekn0e+EV+vhDTbYjx5eLfpMLXsDBwq +xBb/4Oxx64r1EW7tTw2R0hIYLUkVAcKkIhPHEWT/IhKauY5cLwjPcWqzZwFZ8V1G +87B4pfYOQnrjfxvM0PC3KP0q6p6zsLkEqv32x7SxuCqg+1jxGaBvcCV+PmlKfw8i +2O+tCBGaKZnhqkRFmhJePp1tUvznoD1oL/BLcHwTOK28FSXx1s6rosAx1i+f4P8U +WfyEk9mHfExUE+uf0S0R+Bg6Ot4l2ffTQO2kBhLEO+GRwVY18BTcZTYJbqukB8c1 +0cIDMzZbdSZtQvESa0NvS3GU+jQd7RNuyoB/mC9suWXY6QIDAQABo4HUMIHRMB0G +A1UdDgQWBBQ5lYtii1zJ1IC6WA+XPxUIQ8yYpzALBgNVHQ8EBAMCAQYwDwYDVR0T +AQH/BAUwAwEB/zCBkQYDVR0jBIGJMIGGgBQ5lYtii1zJ1IC6WA+XPxUIQ8yYp6Fr +pGkwZzELMAkGA1UEBhMCU0UxFDASBgNVBAoTC0FkZFRydXN0IEFCMR0wGwYDVQQL +ExRBZGRUcnVzdCBUVFAgTmV0d29yazEjMCEGA1UEAxMaQWRkVHJ1c3QgUXVhbGlm +aWVkIENBIFJvb3SCAQEwDQYJKoZIhvcNAQEFBQADggEBABmrder4i2VhlRO6aQTv +hsoToMeqT2QbPxj2qC0sVY8FtzDqQmodwCVRLae/DLPt7wh/bDxGGuoYQ992zPlm +hpwsaPXpF/gxsxjE1kh9I0xowX67ARRvxdlu3rsEQmr49lx95dr6h+sNNVJn0J6X +dgWTP5XHAeZpVTh/EGGZyeNfpso+gmNIquIISD6q8rKFYqa0p9m9N5xotS1WfbC3 +P6CxB9bpT9zeRXEwMn8bLgn5v1Kh7sKAPgZcLlVAwRv1cEWw3F369nJad9Jjzc9Y +iQBCYz95OdBEsIJuQRno3eDBiFrRHnGTHyQwdOUeqN48Jzd/g66ed8/wMLH/S5no +xqE= +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIEXDCCA0SgAwIBAgIEOGO5ZjANBgkqhkiG9w0BAQUFADCBtDEUMBIGA1UEChML +RW50cnVzdC5uZXQxQDA+BgNVBAsUN3d3dy5lbnRydXN0Lm5ldC9DUFNfMjA0OCBp +bmNvcnAuIGJ5IHJlZi4gKGxpbWl0cyBsaWFiLikxJTAjBgNVBAsTHChjKSAxOTk5 +IEVudHJ1c3QubmV0IExpbWl0ZWQxMzAxBgNVBAMTKkVudHJ1c3QubmV0IENlcnRp +ZmljYXRpb24gQXV0aG9yaXR5ICgyMDQ4KTAeFw05OTEyMjQxNzUwNTFaFw0xOTEy +MjQxODIwNTFaMIG0MRQwEgYDVQQKEwtFbnRydXN0Lm5ldDFAMD4GA1UECxQ3d3d3 +LmVudHJ1c3QubmV0L0NQU18yMDQ4IGluY29ycC4gYnkgcmVmLiAobGltaXRzIGxp +YWIuKTElMCMGA1UECxMcKGMpIDE5OTkgRW50cnVzdC5uZXQgTGltaXRlZDEzMDEG +A1UEAxMqRW50cnVzdC5uZXQgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgKDIwNDgp +MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArU1LqRKGsuqjIAcVFmQq +K0vRvwtKTY7tgHalZ7d4QMBzQshowNtTK91euHaYNZOLGp18EzoOH1u3Hs/lJBQe +sYGpjX24zGtLA/ECDNyrpUAkAH90lKGdCCmziAv1h3edVc3kw37XamSrhRSGlVuX +MlBvPci6Zgzj/L24ScF2iUkZ/cCovYmjZy/Gn7xxGWC4LeksyZB2ZnuU4q941mVT +XTzWnLLPKQP5L6RQstRIzgUyVYr9smRMDuSYB3Xbf9+5CFVghTAp+XtIpGmG4zU/ +HoZdenoVve8AjhUiVBcAkCaTvA5JaJG/+EfTnZVCwQ5N328mz8MYIWJmQ3DW1cAH +4QIDAQABo3QwcjARBglghkgBhvhCAQEEBAMCAAcwHwYDVR0jBBgwFoAUVeSB0RGA +vtiJuQijMfmhJAkWuXAwHQYDVR0OBBYEFFXkgdERgL7YibkIozH5oSQJFrlwMB0G +CSqGSIb2fQdBAAQQMA4bCFY1LjA6NC4wAwIEkDANBgkqhkiG9w0BAQUFAAOCAQEA +WUesIYSKF8mciVMeuoCFGsY8Tj6xnLZ8xpJdGGQC49MGCBFhfGPjK50xA3B20qMo +oPS7mmNz7W3lKtvtFKkrxjYR0CvrB4ul2p5cGZ1WEvVUKcgF7bISKo30Axv/55IQ +h7A6tcOdBTcSo8f0FbnVpDkWm1M6I5HxqIKiaohowXkCIryqptau37AUX7iH0N18 +f3v/rxzP5tsHrV7bhZ3QKw0z2wTR5klAEyt2+z7pnIkPFc4YsIV4IU9rTw76NmfN +B/L/CNDi3tm/Kq+4h4YhPATKt5Rof8886ZjXOP/swNlQ8C5LWK5Gb9Auw2DaclVy +vUxFnmG6v4SBkgPR0ml8xQ== +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIFkjCCA3qgAwIBAgIIAeDltYNno+AwDQYJKoZIhvcNAQEMBQAwZzEbMBkGA1UE +AwwSQXBwbGUgUm9vdCBDQSAtIEcyMSYwJAYDVQQLDB1BcHBsZSBDZXJ0aWZpY2F0 +aW9uIEF1dGhvcml0eTETMBEGA1UECgwKQXBwbGUgSW5jLjELMAkGA1UEBhMCVVMw +HhcNMTQwNDMwMTgxMDA5WhcNMzkwNDMwMTgxMDA5WjBnMRswGQYDVQQDDBJBcHBs +ZSBSb290IENBIC0gRzIxJjAkBgNVBAsMHUFwcGxlIENlcnRpZmljYXRpb24gQXV0 +aG9yaXR5MRMwEQYDVQQKDApBcHBsZSBJbmMuMQswCQYDVQQGEwJVUzCCAiIwDQYJ +KoZIhvcNAQEBBQADggIPADCCAgoCggIBANgREkhI2imKScUcx+xuM23+TfvgHN6s +XuI2pyT5f1BrTM65MFQn5bPW7SXmMLYFN14UIhHF6Kob0vuy0gmVOKTvKkmMXT5x +ZgM4+xb1hYjkWpIMBDLyyED7Ul+f9sDx47pFoFDVEovy3d6RhiPw9bZyLgHaC/Yu +OQhfGaFjQQscp5TBhsRTL3b2CtcM0YM/GlMZ81fVJ3/8E7j4ko380yhDPLVoACVd +J2LT3VXdRCCQgzWTxb+4Gftr49wIQuavbfqeQMpOhYV4SbHXw8EwOTKrfl+q04tv +ny0aIWhwZ7Oj8ZhBbZF8+NfbqOdfIRqMM78xdLe40fTgIvS/cjTf94FNcX1RoeKz +8NMoFnNvzcytN31O661A4T+B/fc9Cj6i8b0xlilZ3MIZgIxbdMYs0xBTJh0UT8TU +gWY8h2czJxQI6bR3hDRSj4n4aJgXv8O7qhOTH11UL6jHfPsNFL4VPSQ08prcdUFm +IrQB1guvkJ4M6mL4m1k8COKWNORj3rw31OsMiANDC1CvoDTdUE0V+1ok2Az6DGOe +HwOx4e7hqkP0ZmUoNwIx7wHHHtHMn23KVDpA287PT0aLSmWaasZobNfMmRtHsHLD +d4/E92GcdB/O/WuhwpyUgquUoue9G7q5cDmVF8Up8zlYNPXEpMZ7YLlmQ1A/bmH8 +DvmGqmAMQ0uVAgMBAAGjQjBAMB0GA1UdDgQWBBTEmRNsGAPCe8CjoA1/coB6HHcm +jTAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQwF +AAOCAgEAUabz4vS4PZO/Lc4Pu1vhVRROTtHlznldgX/+tvCHM/jvlOV+3Gp5pxy+ +8JS3ptEwnMgNCnWefZKVfhidfsJxaXwU6s+DDuQUQp50DhDNqxq6EWGBeNjxtUVA +eKuowM77fWM3aPbn+6/Gw0vsHzYmE1SGlHKy6gLti23kDKaQwFd1z4xCfVzmMX3z +ybKSaUYOiPjjLUKyOKimGY3xn83uamW8GrAlvacp/fQ+onVJv57byfenHmOZ4VxG +/5IFjPoeIPmGlFYl5bRXOJ3riGQUIUkhOb9iZqmxospvPyFgxYnURTbImHy99v6Z +SYA7LNKmp4gDBDEZt7Y6YUX6yfIjyGNzv1aJMbDZfGKnexWoiIqrOEDCzBL/FePw +N983csvMmOa/orz6JopxVtfnJBtIRD6e/J/JzBrsQzwBvDR4yGn1xuZW7AYJNpDr +FEobXsmII9oDMJELuDY++ee1KG++P+w8j2Ud5cAeh6Squpj9kuNsJnfdBrRkBof0 +Tta6SqoWqPQFZ2aWuuJVecMsXUmPgEkrihLHdoBR37q9ZV0+N0djMenl9MU/S60E +inpxLK8JQzcPqOMyT/RFtm2XNuyE9QoB6he7hY1Ck3DDUOUUi78/w0EP3SIEIwiK +um1xRKtzCTrJ+VKACd+66eYWyi4uTLLT3OUEVLLUNIAytbwPF+E= +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIDtDCCApygAwIBAgIBADANBgkqhkiG9w0BAQUFADBjMQswCQYDVQQGEwJKUDEc +MBoGA1UEChMTSmFwYW5lc2UgR292ZXJubWVudDEOMAwGA1UECxMFTVBIUFQxJjAk +BgNVBAsTHU1QSFBUIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTAyMDMxNDA3 +NTAyNloXDTEyMDMxMzE0NTk1OVowYzELMAkGA1UEBhMCSlAxHDAaBgNVBAoTE0ph +cGFuZXNlIEdvdmVybm1lbnQxDjAMBgNVBAsTBU1QSFBUMSYwJAYDVQQLEx1NUEhQ +VCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTCCASIwDQYJKoZIhvcNAQEBBQADggEP +ADCCAQoCggEBAI3GUWlK9G9FVm8DhpKu5t37oxZbj6lZcFvEZY07YrYojWO657ub +z56WE7q/PI/6Sm7i7qYE+Vp80r6thJvfmn7SS3BENrRqiapSenhooYD12jIe3iZQ +2SXqx7WgYwyBGdQwGaYTijzbRFpgc0K8o4a99fIoHhz9J8AKqXasddMCqfJRaH30 +YJ7HnOvRYGL6HBrGhJ7X4Rzijyk9a9+3VOBsYcnIlx9iODoiYhA6r0ojuIu8/JA1 +oTTZrS0MyU/SLdFdJze2O1wnqTULXQybzJz3ad6oC/F5a69c0m92akYd9nGBrPxj +EhucaQynC/QoCLs3aciLgioAnEJqy7i3EgUCAwEAAaNzMHEwHwYDVR0jBBgwFoAU +YML3pLoA0h93Yngl8Gb/UgAh73owHQYDVR0OBBYEFGDC96S6ANIfd2J4JfBm/1IA +Ie96MAwGA1UdEwQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMBEGCWCGSAGG+EIBAQQE +AwIABTANBgkqhkiG9w0BAQUFAAOCAQEANPR8DN66iWZBs/lSm1vOzhqRkXDLT6xL +LvJtjPLqmE469szGyFSKzsof6y+/8YgZlOoeX1inF4ox/SH1ATnwdIIsPbXuRLjt +axboXvBh5y2ffC3hmzJVvJ87tb6mVWQeL9VFUhNhAI0ib+9OIZVEYI/64MFkDk4e +iWG5ts6oqIJH1V7dVZg6pQ1Tc0Ckhn6N1m1hD30S0/zoPn/20Wq6OCF3he8VJrRG +dcW9BD/Bkesko1HKhMBDjHVrJ8cFwbnDSoo+Ki47eJWaz/cOzaSsaMVUsR5POava +/abhhgHn/eOJdXiVslyK0DYscjsdB3aBUfwZlomxYOzG6CgjQPhJdw== +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIID9zCCAt+gAwIBAgILMTI1MzcyODI4MjgwDQYJKoZIhvcNAQELBQAwWDELMAkG +A1UEBhMCSlAxHDAaBgNVBAoTE0phcGFuZXNlIEdvdmVybm1lbnQxDTALBgNVBAsT +BEdQS0kxHDAaBgNVBAMTE0FwcGxpY2F0aW9uQ0EyIFJvb3QwHhcNMTMwMzEyMTUw +MDAwWhcNMzMwMzEyMTUwMDAwWjBYMQswCQYDVQQGEwJKUDEcMBoGA1UEChMTSmFw +YW5lc2UgR292ZXJubWVudDENMAsGA1UECxMER1BLSTEcMBoGA1UEAxMTQXBwbGlj +YXRpb25DQTIgUm9vdDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKaq +rSVl1gAR1uh6dqr05rRL88zDUrSNrKZPtZJxb0a11a2LEiIXJc5F6BR6hZrkIxCo ++rFnUOVtR+BqiRPjrq418fRCxQX3TZd+PCj8sCaRHoweOBqW3FhEl2LjMsjRFUFN +dZh4vqtoqV7tR76kuo6hApfek3SZbWe0BSXulMjtqqS6MmxCEeu+yxcGkOGThchk +KM4fR8fAXWDudjbcMztR63vPctgPeKgZggiQPhqYjY60zxU2pm7dt+JNQCBT2XYq +0HisifBPizJtROouurCp64ndt295D6uBbrjmiykLWa+2SQ1RLKn9nShjZrhwlXOa +2Po7M7xCQhsyrLEy+z0CAwEAAaOBwTCBvjAdBgNVHQ4EFgQUVqesqgIdsqw9kA6g +by5Bxnbne9owDgYDVR0PAQH/BAQDAgEGMHwGA1UdEQR1MHOkcTBvMQswCQYDVQQG +EwJKUDEYMBYGA1UECgwP5pel5pys5Zu95pS/5bqcMRswGQYDVQQLDBLmlL/lupzo +qo3oqLzln7rnm6QxKTAnBgNVBAMMIOOCouODl+ODquOCseODvOOCt+ODp+ODs0NB +MiBSb290MA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQELBQADggEBAH+aCXWs +B9FydC53VzDCBJzUgKaD56WgG5/+q/OAvdVKo6GPtkxgEefK4WCB10jBIFmlYTKL +nZ6X02aD2mUuWD7b5S+lzYxzplG+WCigeVxpL0PfY7KJR8q73rk0EWOgDiUX5Yf0 +HbCwpc9BqHTG6FPVQvSCLVMJEWgmcZR1E02qdog8dLHW40xPYsNJTE5t8XB+w3+m +Bcx4m+mB26jIx1ye/JKSLaaX8ji1bnOVDMA/zqaUMLX6BbfeniCq/BNkyYq6ZO/i +Y+TYmK5rtT6mVbgzPixy+ywRAPtbFi+E0hOe+gXFwctyTiLdhMpLvNIthhoEdlkf +SUJiOxMfFui61/0= +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIDIDCCAomgAwIBAgIENd70zzANBgkqhkiG9w0BAQUFADBOMQswCQYDVQQGEwJV +UzEQMA4GA1UEChMHRXF1aWZheDEtMCsGA1UECxMkRXF1aWZheCBTZWN1cmUgQ2Vy +dGlmaWNhdGUgQXV0aG9yaXR5MB4XDTk4MDgyMjE2NDE1MVoXDTE4MDgyMjE2NDE1 +MVowTjELMAkGA1UEBhMCVVMxEDAOBgNVBAoTB0VxdWlmYXgxLTArBgNVBAsTJEVx +dWlmYXggU2VjdXJlIENlcnRpZmljYXRlIEF1dGhvcml0eTCBnzANBgkqhkiG9w0B +AQEFAAOBjQAwgYkCgYEAwV2xWGcIYu6gmi0fCG2RFGiYCh7+2gRvE4RiIcPRfM6f +BeC4AfBONOziipUEZKzxa1NfBbPLZ4C/QgKO/t0BCezhABRP/PvwDN1Dulsr4R+A +cJkVV5MW8Q+XarfCaCMczE1ZMKxRHjuvK9buY0V7xdlfUNLjUA86iOe/FP3gx7kC +AwEAAaOCAQkwggEFMHAGA1UdHwRpMGcwZaBjoGGkXzBdMQswCQYDVQQGEwJVUzEQ +MA4GA1UEChMHRXF1aWZheDEtMCsGA1UECxMkRXF1aWZheCBTZWN1cmUgQ2VydGlm +aWNhdGUgQXV0aG9yaXR5MQ0wCwYDVQQDEwRDUkwxMBoGA1UdEAQTMBGBDzIwMTgw +ODIyMTY0MTUxWjALBgNVHQ8EBAMCAQYwHwYDVR0jBBgwFoAUSOZo+SvSspXXR9gj +IBBPM5iQn9QwHQYDVR0OBBYEFEjmaPkr0rKV10fYIyAQTzOYkJ/UMAwGA1UdEwQF +MAMBAf8wGgYJKoZIhvZ9B0EABA0wCxsFVjMuMGMDAgbAMA0GCSqGSIb3DQEBBQUA +A4GBAFjOKer89961zgK5F7WF0bnj4JXMJTENAKaSbn+2kmOeUJXRmm/kEd5jhW6Y +7qj/WsjTVbJmcVfewCHrPSqnI0kBBIZCe/zuf6IWUrVnZ9NA2zsmWLIodz2uFHdh +1voqZiegDfqnc1zqcPGUIWVEX/r87yloqaKHee9570+sB3c4 +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIICrjCCAjWgAwIBAgIQPLL0SAoA4v7rJDteYD7DazAKBggqhkjOPQQDAzCBmDEL +MAkGA1UEBhMCVVMxFjAUBgNVBAoTDUdlb1RydXN0IEluYy4xOTA3BgNVBAsTMChj +KSAyMDA3IEdlb1RydXN0IEluYy4gLSBGb3IgYXV0aG9yaXplZCB1c2Ugb25seTE2 +MDQGA1UEAxMtR2VvVHJ1c3QgUHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0 +eSAtIEcyMB4XDTA3MTEwNTAwMDAwMFoXDTM4MDExODIzNTk1OVowgZgxCzAJBgNV +BAYTAlVTMRYwFAYDVQQKEw1HZW9UcnVzdCBJbmMuMTkwNwYDVQQLEzAoYykgMjAw +NyBHZW9UcnVzdCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxNjA0BgNV +BAMTLUdlb1RydXN0IFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgLSBH +MjB2MBAGByqGSM49AgEGBSuBBAAiA2IABBWx6P0DFUPlrOuHNxFi79KDNlJ9RVcL +So17VDs6bl8VAsBQps8lL33KSLjHUGMcKiEIfJo22Av+0SbFWDEwKCXzXV2juLal +tJLtbCyf691DiaI8S0iRHVDsJt/WYC69IaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAO +BgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFBVfNVdRVfslsq0DafwBo/q+EVXVMAoG +CCqGSM49BAMDA2cAMGQCMGSWWaboCd6LuvpaiIjwH5HTRqjySkwCY/tsXzjbLkGT +qQ7mndwxHLKgpxgceeHHNgIwOlavmnRs9vuD4DPTCF+hnMJbn0bWtsuRBmOiBucz +rD6ogRLQy7rQkgu2npaqBA+K +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIFcDCCA1igAwIBAgIEAJiWjTANBgkqhkiG9w0BAQsFADBYMQswCQYDVQQGEwJO +TDEeMBwGA1UECgwVU3RhYXQgZGVyIE5lZGVybGFuZGVuMSkwJwYDVQQDDCBTdGFh +dCBkZXIgTmVkZXJsYW5kZW4gRVYgUm9vdCBDQTAeFw0xMDEyMDgxMTE5MjlaFw0y +MjEyMDgxMTEwMjhaMFgxCzAJBgNVBAYTAk5MMR4wHAYDVQQKDBVTdGFhdCBkZXIg +TmVkZXJsYW5kZW4xKTAnBgNVBAMMIFN0YWF0IGRlciBOZWRlcmxhbmRlbiBFViBS +b290IENBMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA48d+ifkkSzrS +M4M1LGns3Amk41GoJSt5uAg94JG6hIXGhaTK5skuU6TJJB79VWZxXSzFYGgEt9nC +UiY4iKTWO0Cmws0/zZiTs1QUWJZV1VD+hq2kY39ch/aO5ieSZxeSAgMs3NZmdO3d +Z//BYY1jTw+bbRcwJu+r0h8QoPnFfxZpgQNH7R5ojXKhTbImxrpsX23Wr9GxE46p +rfNeaXUmGD5BKyF/7otdBwadQ8QpCiv8Kj6GyzyDOvnJDdrFmeK8eEEzduG/L13l +pJhQDBXd4Pqcfzho0LKmeqfRMb1+ilgnQ7O6M5HTp5gVXJrm0w912fxBmJc+qiXb +j5IusHsMX/FjqTf5m3VpTCgmJdrV8hJwRVXj33NeN/UhbJCONVrJ0yPr08C+eKxC +KFhmpUZtcALXEPlLVPxdhkqHz3/KRawRWrUgUY0viEeXOcDPusBCAUCZSCELa6fS +/ZbV0b5GnUngC6agIk440ME8MLxwjyx1zNDFjFE7PZQIZCZhfbnDZY8UnCHQqv0X +cgOPvZuM5l5Tnrmd74K74bzickFbIZTTRTeU0d8JOV3nI6qaHcptqAqGhYqCvkIH +1vI4gnPah1vlPNOePqc7nvQDs/nxfRN0Av+7oeX6AHkcpmZBiFxgV6YuCcS6/ZrP +px9Aw7vMWgpVSzs4dlG4Y4uElBbmVvMCAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB +/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFP6rAJCYniT8qcwaivsnuL8wbqg7 +MA0GCSqGSIb3DQEBCwUAA4ICAQDPdyxuVr5Os7aEAJSrR8kN0nbHhp8dB9O2tLsI +eK9p0gtJ3jPFrK3CiAJ9Brc1AsFgyb/E6JTe1NOpEyVa/m6irn0F3H3zbPB+po3u +2dfOWBfoqSmuc0iH55vKbimhZF8ZE/euBhD/UcabTVUlT5OZEAFTdfETzsemQUHS +v4ilf0X8rLiltTMMgsT7B/Zq5SWEXwbKwYY5EdtYzXc7LMJMD16a4/CrPmEbUCTC +wPTxGfARKbalGAKb12NMcIxHowNDXLldRqANb/9Zjr7dn3LDWyvfjFvO5QxGbJKy +CqNMVEIYFRIYvdr8unRu/8G2oGTYqV9Vrp9canaW2HNnh/tNf1zuacpzEPuKqf2e +vTY4SUmH9A4U8OmHuD+nT3pajnnUk+S7aFKErGzp85hwVXIy+TSrK0m1zSBi5Dp6 +Z2Orltxtrpfs/J92VoguZs9btsmksNcFuuEnL5O7Jiqik7Ab846+HUCjuTaPPoIa +Gl6I6lD4WeKDRikL40Rc4ZW2aZCaFG+XroHPaO+Zmr615+F/+PoTRxZMzG0IQOeL +eG9QgkRQP2YGiqtDhFZKDyAthg710tvSeopLzaXoTvFeJiUBWSOgftL2fiFX1ye8 +FVdMpEbB4IMeDExNH08GGeL5qPQ6gqGyeUN51q1veieQA6TqJIc/2b3Z6fJfUEkc +7uzXLg== +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIDnzCCAoegAwIBAgIBJjANBgkqhkiG9w0BAQUFADBxMQswCQYDVQQGEwJERTEc +MBoGA1UEChMTRGV1dHNjaGUgVGVsZWtvbSBBRzEfMB0GA1UECxMWVC1UZWxlU2Vj +IFRydXN0IENlbnRlcjEjMCEGA1UEAxMaRGV1dHNjaGUgVGVsZWtvbSBSb290IENB +IDIwHhcNOTkwNzA5MTIxMTAwWhcNMTkwNzA5MjM1OTAwWjBxMQswCQYDVQQGEwJE +RTEcMBoGA1UEChMTRGV1dHNjaGUgVGVsZWtvbSBBRzEfMB0GA1UECxMWVC1UZWxl +U2VjIFRydXN0IENlbnRlcjEjMCEGA1UEAxMaRGV1dHNjaGUgVGVsZWtvbSBSb290 +IENBIDIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCrC6M14IspFLEU +ha88EOQ5bzVdSq7d6mGNlUn0b2SjGmBmpKlAIoTZ1KXleJMOaAGtuU1cOs7TuKhC +QN/Po7qCWWqSG6wcmtoIKyUn+WkjR/Hg6yx6m/UTAtB+NHzCnjwAWav12gz1Mjwr +rFDa1sPeg5TKqAyZMg4ISFZbavva4VhYAUlfckE8FQYBjl2tqriTtM2e66foai1S +NNs671x1Udrb8zH57nGYMsRUFUQM+ZtV7a3fGAigo4aKSe5TBY8ZTNXeWHmb0moc +QqvF1afPaA+W5OFhmHZhyJF81j4A4pFQh+GdCuatl9Idxjp9y7zaAzTVjlsB9WoH +txa2bkp/AgMBAAGjQjBAMB0GA1UdDgQWBBQxw3kbuvVT1xfgiXotF2wKsyudMzAP +BgNVHRMECDAGAQH/AgEFMA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQUFAAOC +AQEAlGRZrTlk5ynrE/5aw4sTV8gEJPB0d8Bg42f76Ymmg7+Wgnxu1MM9756Abrsp +tJh6sTtU6zkXR34ajgv8HzFZMQSyzhfzLMdiNlXiItiJVbSYSKpk+tYcNthEeFpa +IzpXl/V6ME+un2pMSyuOoAPjPuCp1NJ70rOo4nI8rZ7/gFnkm0W09juwzTkZmDLl +6iFhkOQxIY40sfcvNUqFENrnijchvllj4PKFiDFT1FQUhXB59C4Gdyd1Lx+4ivn+ +xbrYNuSD7Odlt79jWvNGr4GUN9RBjNYj1h7P9WgbRGOiWrqnNVmh5XAFmw4jV5mU +Cm26OWMohpLzGITY+9HPBVZkVw== +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIGSzCCBDOgAwIBAgIIamg+nFGby1MwDQYJKoZIhvcNAQELBQAwgbIxCzAJBgNV +BAYTAlRSMQ8wDQYDVQQHDAZBbmthcmExQDA+BgNVBAoMN0UtVHXEn3JhIEVCRyBC +aWxpxZ9pbSBUZWtub2xvamlsZXJpIHZlIEhpem1ldGxlcmkgQS7Fni4xJjAkBgNV +BAsMHUUtVHVncmEgU2VydGlmaWthc3lvbiBNZXJrZXppMSgwJgYDVQQDDB9FLVR1 +Z3JhIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTEzMDMwNTEyMDk0OFoXDTIz +MDMwMzEyMDk0OFowgbIxCzAJBgNVBAYTAlRSMQ8wDQYDVQQHDAZBbmthcmExQDA+ +BgNVBAoMN0UtVHXEn3JhIEVCRyBCaWxpxZ9pbSBUZWtub2xvamlsZXJpIHZlIEhp +em1ldGxlcmkgQS7Fni4xJjAkBgNVBAsMHUUtVHVncmEgU2VydGlmaWthc3lvbiBN +ZXJrZXppMSgwJgYDVQQDDB9FLVR1Z3JhIENlcnRpZmljYXRpb24gQXV0aG9yaXR5 +MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA4vU/kwVRHoViVF56C/UY +B4Oufq9899SKa6VjQzm5S/fDxmSJPZQuVIBSOTkHS0vdhQd2h8y/L5VMzH2nPbxH +D5hw+IyFHnSOkm0bQNGZDbt1bsipa5rAhDGvykPL6ys06I+XawGb1Q5KCKpbknSF +Q9OArqGIW66z6l7LFpp3RMih9lRozt6Plyu6W0ACDGQXwLWTzeHxE2bODHnv0ZEo +q1+gElIwcxmOj+GMB6LDu0rw6h8VqO4lzKRG+Bsi77MOQ7osJLjFLFzUHPhdZL3D +k14opz8n8Y4e0ypQBaNV2cvnOVPAmJ6MVGKLJrD3fY185MaeZkJVgkfnsliNZvcH +fC425lAcP9tDJMW/hkd5s3kc91r0E+xs+D/iWR+V7kI+ua2oMoVJl0b+SzGPWsut +dEcf6ZG33ygEIqDUD13ieU/qbIWGvaimzuT6w+Gzrt48Ue7LE3wBf4QOXVGUnhMM +ti6lTPk5cDZvlsouDERVxcr6XQKj39ZkjFqzAQqptQpHF//vkUAqjqFGOjGY5RH8 +zLtJVor8udBhmm9lbObDyz51Sf6Pp+KJxWfXnUYTTjF2OySznhFlhqt/7x3U+Lzn +rFpct1pHXFXOVbQicVtbC/DP3KBhZOqp12gKY6fgDT+gr9Oq0n7vUaDmUStVkhUX +U8u3Zg5mTPj5dUyQ5xJwx0UCAwEAAaNjMGEwHQYDVR0OBBYEFC7j27JJ0JxUeVz6 +Jyr+zE7S6E5UMA8GA1UdEwEB/wQFMAMBAf8wHwYDVR0jBBgwFoAULuPbsknQnFR5 +XPonKv7MTtLoTlQwDgYDVR0PAQH/BAQDAgEGMA0GCSqGSIb3DQEBCwUAA4ICAQAF +Nzr0TbdF4kV1JI+2d1LoHNgQk2Xz8lkGpD4eKexd0dCrfOAKkEh47U6YA5n+KGCR +HTAduGN8qOY1tfrTYXbm1gdLymmasoR6d5NFFxWfJNCYExL/u6Au/U5Mh/jOXKqY +GwXgAEZKgoClM4so3O0409/lPun++1ndYYRP0lSWE2ETPo+Aab6TR7U1Q9Jauz1c +77NCR807VRMGsAnb/WP2OogKmW9+4c4bU2pEZiNRCHu8W1Ki/QY3OEBhj0qWuJA3 ++GbHeJAAFS6LrVE1Uweoa2iu+U48BybNCAVwzDk/dr2l02cmAYamU9JgO3xDf1WK +vJUawSg5TB9D0pH0clmKuVb8P7Sd2nCcdlqMQ1DujjByTd//SffGqWfZbawCEeI6 +FiWnWAjLb1NBnEg4R2gz0dfHj9R0IdTDBZB6/86WiLEVKV0jq9BgoRJP3vQXzTLl +yb/IQ639Lo7xr+L0mPoSHyDYwKcMhcWQ9DstliaxLL5Mq+ux0orJ23gTDx4JnW2P +AJ8C2sH6H3p6CcRK5ogql5+Ji/03X186zjhZhkuvcQu02PJwT58yE+Owp1fl2tpD +y4Q08ijE6m30Ku/Ba3ba+367hTzSU8JNvnHhRdH9I2cNE3X7z2VnIp2usAnRCf8d +NL/+I5c30jn6PQ0GC7TbO6Orb1wdtn7os4I07QZcJA== +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIDtTCCAp2gAwIBAgIIBhDCeat3PfIwDQYJKoZIhvcNAQEFBQAwdjELMAkGA1UE +BhMCQ0gxEjAQBgNVBAoTCVN3aXNzU2lnbjEyMDAGA1UEAxMpU3dpc3NTaWduIENB +IChSU0EgSUsgTWF5IDYgMTk5OSAxODowMDo1OCkxHzAdBgkqhkiG9w0BCQEWEGNh +QFN3aXNzU2lnbi5jb20wHhcNMDAxMTI2MjMyNzQxWhcNMzExMTI2MjMyNzQxWjB2 +MQswCQYDVQQGEwJDSDESMBAGA1UEChMJU3dpc3NTaWduMTIwMAYDVQQDEylTd2lz +c1NpZ24gQ0EgKFJTQSBJSyBNYXkgNiAxOTk5IDE4OjAwOjU4KTEfMB0GCSqGSIb3 +DQEJARYQY2FAU3dpc3NTaWduLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC +AQoCggEBAKw5fjnmNneLQlUCQG8jQLwwfbrOZoUwNX8cbNqhxK03/xUloFVgAt+S +Te2RxNXaCAXLBPn5ZST35TLV57aLmbHCtifv3YZqaaQGvjedltIBMJihJhZ+h3LY +SKsUb+xEJ3x5ZUf8jP+Q1g57y1s8SnBFWN/ni5NkF1Y1y31VwOi9wiOf/VISL+uu +SC4i1CP1Kbz3BDs6Hht1GpRYCbJ/K0bc9oJSpWpT5PGONsGIawqMbJuyoDghsXQ1 +pbn2e8K64BSscGZVZTNooSGgNiHmACNJBYXiWVWrwXPF4l6SddmC3Rj0aKXjgECc +FkHLDQcsM5JsK2ZLryTDUsQFbxVP2ikCAwEAAaNHMEUwCwYDVR0PBAQDAgEGMAwG +A1UdEwQFMAMBAf8wHQYDVR0OBBYEFJbXcc05KtT8iLGKq1N4ae+PR34WMAkGA1Ud +IwQCMAAwDQYJKoZIhvcNAQEFBQADggEBAKMy6W8HvZdS1fBpEUzl6Lvw50bgE1Xc +HU1JypSBG9mhdcXZo5AlPB4sCvx9Dmfwhyrdsshc0TP2V3Vh6eQqnEF5qB4lVziT +Bko9mW6Ot+pPnwsy4SHpx3rw6jCYnOqfUcZjWqqqRrq/3P1waz+Mn4cLMVEg3Xaz +qYov/khvSqS0JniwjRlo2H6f/1oVUKZvP+dUhpQepfZrOqMAWZW4otp6FolyQyeU +NN6UCRNiUKl5vTijbKwUUwfER/1Vci3M1/O1QCfttQ4vRN4Buc0xqYtGL3cd5WiO +vWzyhlTzAI6VUdNkQhhHJSAyTpj6dmXDRzrryoFGa2PjgESxz7XBaSI= +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIDZzCCAk+gAwIBAgIQGx+ttiD5JNM2a/fH8YygWTANBgkqhkiG9w0BAQUFADBF +MQswCQYDVQQGEwJHQjEYMBYGA1UEChMPVHJ1c3RpcyBMaW1pdGVkMRwwGgYDVQQL +ExNUcnVzdGlzIEZQUyBSb290IENBMB4XDTAzMTIyMzEyMTQwNloXDTI0MDEyMTEx +MzY1NFowRTELMAkGA1UEBhMCR0IxGDAWBgNVBAoTD1RydXN0aXMgTGltaXRlZDEc +MBoGA1UECxMTVHJ1c3RpcyBGUFMgUm9vdCBDQTCCASIwDQYJKoZIhvcNAQEBBQAD +ggEPADCCAQoCggEBAMVQe547NdDfxIzNjpvto8A2mfRC6qc+gIMPpqdZh8mQRUN+ +AOqGeSoDvT03mYlmt+WKVoaTnGhLaASMk5MCPjDSNzoiYYkchU59j9WvezX2fihH +iTHcDnlkH5nSW7r+f2C/revnPDgpai/lkQtV/+xvWNUtyd5MZnGPDNcE2gfmHhjj +vSkCqPoc4Vu5g6hBSLwacY3nYuUtsuvffM/bq1rKMfFMIvMFE/eC+XN5DL7XSxzA +0RU8k0Fk0ea+IxciAIleH2ulrG6nS4zto3Lmr2NNL4XSFDWaLk6M6jKYKIahkQlB +OrTh4/L68MkKokHdqeMDx4gVOxzUGpTXn2RZEm0CAwEAAaNTMFEwDwYDVR0TAQH/ +BAUwAwEB/zAfBgNVHSMEGDAWgBS6+nEleYtXQSUhhgtx67JkDoshZzAdBgNVHQ4E +FgQUuvpxJXmLV0ElIYYLceuyZA6LIWcwDQYJKoZIhvcNAQEFBQADggEBAH5Y//01 +GX2cGE+esCu8jowU/yyg2kdbw++BLa8F6nRIW/M+TgfHbcWzk88iNVy2P3UnXwmW +zaD+vkAMXBJV+JOCyinpXj9WV4s4NvdFGkwozZ5BuO1WTISkQMi4sKUraXAEasP4 +1BIy+Q7DsdwyhEQsb8tGD+pmQQ9P8Vilpg0ND2HepZ5dfWWhPBfnqFVO76DH7cZE +f1T1o+CP8HxVIo8ptoGj4W1OLBuAZ+ytIJ8MYmHVl/9D7S3B2l0pKoU/rGXuhg8F +jZBf3+6f9L/uHfuY5H+QK4R4EA5sSVPvFVtlRkpdr7r7OnIdzfYliB6XzCGcKQEN +ZetX2fNXlrtIzYE= +-----END CERTIFICATE----- +` diff --git a/src/crypto/x509/root_darwin_test.go b/src/crypto/x509/root_darwin_test.go new file mode 100644 index 0000000000000000000000000000000000000000..cc6d23c505583913c0e0c2d4f7d7ccad36151981 --- /dev/null +++ b/src/crypto/x509/root_darwin_test.go @@ -0,0 +1,62 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package x509 + +import ( + "runtime" + "testing" +) + +func TestSystemRoots(t *testing.T) { + switch runtime.GOARCH { + case "arm", "arm64": + t.Skipf("skipping on %s/%s, no system root", runtime.GOOS, runtime.GOARCH) + } + + sysRoots := systemRootsPool() // actual system roots + execRoots, err := execSecurityRoots() // non-cgo roots + + if err != nil { + t.Fatalf("failed to read system roots: %v", err) + } + + for _, tt := range []*CertPool{sysRoots, execRoots} { + if tt == nil { + t.Fatal("no system roots") + } + // On Mavericks, there are 212 bundled certs; require only + // 150 here, since this is just a sanity check, and the + // exact number will vary over time. + if want, have := 150, len(tt.certs); have < want { + t.Fatalf("want at least %d system roots, have %d", want, have) + } + } + + // Check that the two cert pools are roughly the same; + // |A∩B| > max(|A|, |B|) / 2 should be a reasonably robust check. + + isect := make(map[string]bool, len(sysRoots.certs)) + for _, c := range sysRoots.certs { + isect[string(c.Raw)] = true + } + + have := 0 + for _, c := range execRoots.certs { + if isect[string(c.Raw)] { + have++ + } + } + + var want int + if nsys, nexec := len(sysRoots.certs), len(execRoots.certs); nsys > nexec { + want = nsys / 2 + } else { + want = nexec / 2 + } + + if have < want { + t.Errorf("insufficent overlap between cgo and non-cgo roots; want at least %d, have %d", want, have) + } +} diff --git a/src/crypto/x509/root_linux.go b/src/crypto/x509/root_linux.go new file mode 100644 index 0000000000000000000000000000000000000000..cfeca6958ca0c31865b70c36f6ee93f6d3898271 --- /dev/null +++ b/src/crypto/x509/root_linux.go @@ -0,0 +1,13 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package x509 + +// Possible certificate files; stop after finding one. +var certFiles = []string{ + "/etc/ssl/certs/ca-certificates.crt", // Debian/Ubuntu/Gentoo etc. + "/etc/pki/tls/certs/ca-bundle.crt", // Fedora/RHEL + "/etc/ssl/ca-bundle.pem", // OpenSUSE + "/etc/pki/tls/cacert.pem", // OpenELEC +} diff --git a/src/crypto/x509/root_nacl.go b/src/crypto/x509/root_nacl.go new file mode 100644 index 0000000000000000000000000000000000000000..4413f64738a7f6f6add0ff2888d710e74365a4f9 --- /dev/null +++ b/src/crypto/x509/root_nacl.go @@ -0,0 +1,8 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package x509 + +// Possible certificate files; stop after finding one. +var certFiles = []string{} diff --git a/src/crypto/x509/root_nocgo_darwin.go b/src/crypto/x509/root_nocgo_darwin.go new file mode 100644 index 0000000000000000000000000000000000000000..d00e2576624ad5c67cd325846e07171090579b0e --- /dev/null +++ b/src/crypto/x509/root_nocgo_darwin.go @@ -0,0 +1,11 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build !cgo + +package x509 + +func initSystemRoots() { + systemRoots, _ = execSecurityRoots() +} diff --git a/src/crypto/x509/root_plan9.go b/src/crypto/x509/root_plan9.go new file mode 100644 index 0000000000000000000000000000000000000000..9965caadee3a887dd744f30051deacb51692cb57 --- /dev/null +++ b/src/crypto/x509/root_plan9.go @@ -0,0 +1,33 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build plan9 + +package x509 + +import "io/ioutil" + +// Possible certificate files; stop after finding one. +var certFiles = []string{ + "/sys/lib/tls/ca.pem", +} + +func (c *Certificate) systemVerify(opts *VerifyOptions) (chains [][]*Certificate, err error) { + return nil, nil +} + +func initSystemRoots() { + roots := NewCertPool() + for _, file := range certFiles { + data, err := ioutil.ReadFile(file) + if err == nil { + roots.AppendCertsFromPEM(data) + systemRoots = roots + return + } + } + + // All of the files failed to load. systemRoots will be nil which will + // trigger a specific error at verification time. +} diff --git a/src/crypto/x509/root_solaris.go b/src/crypto/x509/root_solaris.go new file mode 100644 index 0000000000000000000000000000000000000000..e6d4e613994754d2e7e303dcd09c22fde836f255 --- /dev/null +++ b/src/crypto/x509/root_solaris.go @@ -0,0 +1,12 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package x509 + +// Possible certificate files; stop after finding one. +var certFiles = []string{ + "/etc/certs/ca-certificates.crt", // Solaris 11.2+ + "/etc/ssl/certs/ca-certificates.crt", // Joyent SmartOS + "/etc/ssl/cacert.pem", // OmniOS +} diff --git a/src/crypto/x509/root_unix.go b/src/crypto/x509/root_unix.go new file mode 100644 index 0000000000000000000000000000000000000000..8d3b2fbb23395dc7bbd455fa457a419f27aa830c --- /dev/null +++ b/src/crypto/x509/root_unix.go @@ -0,0 +1,52 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build dragonfly freebsd linux nacl netbsd openbsd solaris + +package x509 + +import "io/ioutil" + +// Possible directories with certificate files; stop after successfully +// reading at least one file from a directory. +var certDirectories = []string{ + "/system/etc/security/cacerts", // Android +} + +func (c *Certificate) systemVerify(opts *VerifyOptions) (chains [][]*Certificate, err error) { + return nil, nil +} + +func initSystemRoots() { + roots := NewCertPool() + for _, file := range certFiles { + data, err := ioutil.ReadFile(file) + if err == nil { + roots.AppendCertsFromPEM(data) + systemRoots = roots + return + } + } + + for _, directory := range certDirectories { + fis, err := ioutil.ReadDir(directory) + if err != nil { + continue + } + rootsAdded := false + for _, fi := range fis { + data, err := ioutil.ReadFile(directory + "/" + fi.Name()) + if err == nil && roots.AppendCertsFromPEM(data) { + rootsAdded = true + } + } + if rootsAdded { + systemRoots = roots + return + } + } + + // All of the files failed to load. systemRoots will be nil which will + // trigger a specific error at verification time. +} diff --git a/src/crypto/x509/root_windows.go b/src/crypto/x509/root_windows.go new file mode 100644 index 0000000000000000000000000000000000000000..81018b78fe66fabda6475e07d5cc256cf79486ed --- /dev/null +++ b/src/crypto/x509/root_windows.go @@ -0,0 +1,229 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package x509 + +import ( + "errors" + "syscall" + "unsafe" +) + +// Creates a new *syscall.CertContext representing the leaf certificate in an in-memory +// certificate store containing itself and all of the intermediate certificates specified +// in the opts.Intermediates CertPool. +// +// A pointer to the in-memory store is available in the returned CertContext's Store field. +// The store is automatically freed when the CertContext is freed using +// syscall.CertFreeCertificateContext. +func createStoreContext(leaf *Certificate, opts *VerifyOptions) (*syscall.CertContext, error) { + var storeCtx *syscall.CertContext + + leafCtx, err := syscall.CertCreateCertificateContext(syscall.X509_ASN_ENCODING|syscall.PKCS_7_ASN_ENCODING, &leaf.Raw[0], uint32(len(leaf.Raw))) + if err != nil { + return nil, err + } + defer syscall.CertFreeCertificateContext(leafCtx) + + handle, err := syscall.CertOpenStore(syscall.CERT_STORE_PROV_MEMORY, 0, 0, syscall.CERT_STORE_DEFER_CLOSE_UNTIL_LAST_FREE_FLAG, 0) + if err != nil { + return nil, err + } + defer syscall.CertCloseStore(handle, 0) + + err = syscall.CertAddCertificateContextToStore(handle, leafCtx, syscall.CERT_STORE_ADD_ALWAYS, &storeCtx) + if err != nil { + return nil, err + } + + if opts.Intermediates != nil { + for _, intermediate := range opts.Intermediates.certs { + ctx, err := syscall.CertCreateCertificateContext(syscall.X509_ASN_ENCODING|syscall.PKCS_7_ASN_ENCODING, &intermediate.Raw[0], uint32(len(intermediate.Raw))) + if err != nil { + return nil, err + } + + err = syscall.CertAddCertificateContextToStore(handle, ctx, syscall.CERT_STORE_ADD_ALWAYS, nil) + syscall.CertFreeCertificateContext(ctx) + if err != nil { + return nil, err + } + } + } + + return storeCtx, nil +} + +// extractSimpleChain extracts the final certificate chain from a CertSimpleChain. +func extractSimpleChain(simpleChain **syscall.CertSimpleChain, count int) (chain []*Certificate, err error) { + if simpleChain == nil || count == 0 { + return nil, errors.New("x509: invalid simple chain") + } + + simpleChains := (*[1 << 20]*syscall.CertSimpleChain)(unsafe.Pointer(simpleChain))[:] + lastChain := simpleChains[count-1] + elements := (*[1 << 20]*syscall.CertChainElement)(unsafe.Pointer(lastChain.Elements))[:] + for i := 0; i < int(lastChain.NumElements); i++ { + // Copy the buf, since ParseCertificate does not create its own copy. + cert := elements[i].CertContext + encodedCert := (*[1 << 20]byte)(unsafe.Pointer(cert.EncodedCert))[:] + buf := make([]byte, cert.Length) + copy(buf, encodedCert[:]) + parsedCert, err := ParseCertificate(buf) + if err != nil { + return nil, err + } + chain = append(chain, parsedCert) + } + + return chain, nil +} + +// checkChainTrustStatus checks the trust status of the certificate chain, translating +// any errors it finds into Go errors in the process. +func checkChainTrustStatus(c *Certificate, chainCtx *syscall.CertChainContext) error { + if chainCtx.TrustStatus.ErrorStatus != syscall.CERT_TRUST_NO_ERROR { + status := chainCtx.TrustStatus.ErrorStatus + switch status { + case syscall.CERT_TRUST_IS_NOT_TIME_VALID: + return CertificateInvalidError{c, Expired} + default: + return UnknownAuthorityError{c, nil, nil} + } + } + return nil +} + +// checkChainSSLServerPolicy checks that the certificate chain in chainCtx is valid for +// use as a certificate chain for a SSL/TLS server. +func checkChainSSLServerPolicy(c *Certificate, chainCtx *syscall.CertChainContext, opts *VerifyOptions) error { + servernamep, err := syscall.UTF16PtrFromString(opts.DNSName) + if err != nil { + return err + } + sslPara := &syscall.SSLExtraCertChainPolicyPara{ + AuthType: syscall.AUTHTYPE_SERVER, + ServerName: servernamep, + } + sslPara.Size = uint32(unsafe.Sizeof(*sslPara)) + + para := &syscall.CertChainPolicyPara{ + ExtraPolicyPara: uintptr(unsafe.Pointer(sslPara)), + } + para.Size = uint32(unsafe.Sizeof(*para)) + + status := syscall.CertChainPolicyStatus{} + err = syscall.CertVerifyCertificateChainPolicy(syscall.CERT_CHAIN_POLICY_SSL, chainCtx, para, &status) + if err != nil { + return err + } + + // TODO(mkrautz): use the lChainIndex and lElementIndex fields + // of the CertChainPolicyStatus to provide proper context, instead + // using c. + if status.Error != 0 { + switch status.Error { + case syscall.CERT_E_EXPIRED: + return CertificateInvalidError{c, Expired} + case syscall.CERT_E_CN_NO_MATCH: + return HostnameError{c, opts.DNSName} + case syscall.CERT_E_UNTRUSTEDROOT: + return UnknownAuthorityError{c, nil, nil} + default: + return UnknownAuthorityError{c, nil, nil} + } + } + + return nil +} + +// systemVerify is like Verify, except that it uses CryptoAPI calls +// to build certificate chains and verify them. +func (c *Certificate) systemVerify(opts *VerifyOptions) (chains [][]*Certificate, err error) { + hasDNSName := opts != nil && len(opts.DNSName) > 0 + + storeCtx, err := createStoreContext(c, opts) + if err != nil { + return nil, err + } + defer syscall.CertFreeCertificateContext(storeCtx) + + para := new(syscall.CertChainPara) + para.Size = uint32(unsafe.Sizeof(*para)) + + // If there's a DNSName set in opts, assume we're verifying + // a certificate from a TLS server. + if hasDNSName { + oids := []*byte{ + &syscall.OID_PKIX_KP_SERVER_AUTH[0], + // Both IE and Chrome allow certificates with + // Server Gated Crypto as well. Some certificates + // in the wild require them. + &syscall.OID_SERVER_GATED_CRYPTO[0], + &syscall.OID_SGC_NETSCAPE[0], + } + para.RequestedUsage.Type = syscall.USAGE_MATCH_TYPE_OR + para.RequestedUsage.Usage.Length = uint32(len(oids)) + para.RequestedUsage.Usage.UsageIdentifiers = &oids[0] + } else { + para.RequestedUsage.Type = syscall.USAGE_MATCH_TYPE_AND + para.RequestedUsage.Usage.Length = 0 + para.RequestedUsage.Usage.UsageIdentifiers = nil + } + + var verifyTime *syscall.Filetime + if opts != nil && !opts.CurrentTime.IsZero() { + ft := syscall.NsecToFiletime(opts.CurrentTime.UnixNano()) + verifyTime = &ft + } + + // CertGetCertificateChain will traverse Windows's root stores + // in an attempt to build a verified certificate chain. Once + // it has found a verified chain, it stops. MSDN docs on + // CERT_CHAIN_CONTEXT: + // + // When a CERT_CHAIN_CONTEXT is built, the first simple chain + // begins with an end certificate and ends with a self-signed + // certificate. If that self-signed certificate is not a root + // or otherwise trusted certificate, an attempt is made to + // build a new chain. CTLs are used to create the new chain + // beginning with the self-signed certificate from the original + // chain as the end certificate of the new chain. This process + // continues building additional simple chains until the first + // self-signed certificate is a trusted certificate or until + // an additional simple chain cannot be built. + // + // The result is that we'll only get a single trusted chain to + // return to our caller. + var chainCtx *syscall.CertChainContext + err = syscall.CertGetCertificateChain(syscall.Handle(0), storeCtx, verifyTime, storeCtx.Store, para, 0, 0, &chainCtx) + if err != nil { + return nil, err + } + defer syscall.CertFreeCertificateChain(chainCtx) + + err = checkChainTrustStatus(c, chainCtx) + if err != nil { + return nil, err + } + + if hasDNSName { + err = checkChainSSLServerPolicy(c, chainCtx, opts) + if err != nil { + return nil, err + } + } + + chain, err := extractSimpleChain(chainCtx.Chains, int(chainCtx.ChainCount)) + if err != nil { + return nil, err + } + + chains = append(chains, chain) + + return chains, nil +} + +func initSystemRoots() { +} diff --git a/src/crypto/x509/sec1.go b/src/crypto/x509/sec1.go new file mode 100644 index 0000000000000000000000000000000000000000..c4d7ab68f7dbbb9d7cb8d8f5217f74c3e34caf83 --- /dev/null +++ b/src/crypto/x509/sec1.go @@ -0,0 +1,83 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package x509 + +import ( + "crypto/ecdsa" + "crypto/elliptic" + "encoding/asn1" + "errors" + "fmt" + "math/big" +) + +const ecPrivKeyVersion = 1 + +// ecPrivateKey reflects an ASN.1 Elliptic Curve Private Key Structure. +// References: +// RFC5915 +// SEC1 - http://www.secg.org/sec1-v2.pdf +// Per RFC5915 the NamedCurveOID is marked as ASN.1 OPTIONAL, however in +// most cases it is not. +type ecPrivateKey struct { + Version int + PrivateKey []byte + NamedCurveOID asn1.ObjectIdentifier `asn1:"optional,explicit,tag:0"` + PublicKey asn1.BitString `asn1:"optional,explicit,tag:1"` +} + +// ParseECPrivateKey parses an ASN.1 Elliptic Curve Private Key Structure. +func ParseECPrivateKey(der []byte) (key *ecdsa.PrivateKey, err error) { + return parseECPrivateKey(nil, der) +} + +// MarshalECPrivateKey marshals an EC private key into ASN.1, DER format. +func MarshalECPrivateKey(key *ecdsa.PrivateKey) ([]byte, error) { + oid, ok := oidFromNamedCurve(key.Curve) + if !ok { + return nil, errors.New("x509: unknown elliptic curve") + } + return asn1.Marshal(ecPrivateKey{ + Version: 1, + PrivateKey: key.D.Bytes(), + NamedCurveOID: oid, + PublicKey: asn1.BitString{Bytes: elliptic.Marshal(key.Curve, key.X, key.Y)}, + }) +} + +// parseECPrivateKey parses an ASN.1 Elliptic Curve Private Key Structure. +// The OID for the named curve may be provided from another source (such as +// the PKCS8 container) - if it is provided then use this instead of the OID +// that may exist in the EC private key structure. +func parseECPrivateKey(namedCurveOID *asn1.ObjectIdentifier, der []byte) (key *ecdsa.PrivateKey, err error) { + var privKey ecPrivateKey + if _, err := asn1.Unmarshal(der, &privKey); err != nil { + return nil, errors.New("x509: failed to parse EC private key: " + err.Error()) + } + if privKey.Version != ecPrivKeyVersion { + return nil, fmt.Errorf("x509: unknown EC private key version %d", privKey.Version) + } + + var curve elliptic.Curve + if namedCurveOID != nil { + curve = namedCurveFromOID(*namedCurveOID) + } else { + curve = namedCurveFromOID(privKey.NamedCurveOID) + } + if curve == nil { + return nil, errors.New("x509: unknown elliptic curve") + } + + k := new(big.Int).SetBytes(privKey.PrivateKey) + if k.Cmp(curve.Params().N) >= 0 { + return nil, errors.New("x509: invalid elliptic curve private key value") + } + priv := new(ecdsa.PrivateKey) + priv.Curve = curve + priv.D = k + priv.X, priv.Y = curve.ScalarBaseMult(privKey.PrivateKey) + + return priv, nil +} diff --git a/src/crypto/x509/sec1_test.go b/src/crypto/x509/sec1_test.go new file mode 100644 index 0000000000000000000000000000000000000000..95f18e77de0e4d58aaa10e98d42b8c3657029c28 --- /dev/null +++ b/src/crypto/x509/sec1_test.go @@ -0,0 +1,30 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package x509 + +import ( + "bytes" + "encoding/hex" + "testing" +) + +// Generated using: +// openssl ecparam -genkey -name secp384r1 -outform PEM +var ecPrivateKeyHex = `3081a40201010430bdb9839c08ee793d1157886a7a758a3c8b2a17a4df48f17ace57c72c56b4723cf21dcda21d4e1ad57ff034f19fcfd98ea00706052b81040022a16403620004feea808b5ee2429cfcce13c32160e1c960990bd050bb0fdf7222f3decd0a55008e32a6aa3c9062051c4cba92a7a3b178b24567412d43cdd2f882fa5addddd726fe3e208d2c26d733a773a597abb749714df7256ead5105fa6e7b3650de236b50` + +func TestParseECPrivateKey(t *testing.T) { + derBytes, _ := hex.DecodeString(ecPrivateKeyHex) + key, err := ParseECPrivateKey(derBytes) + if err != nil { + t.Errorf("failed to decode EC private key: %s", err) + } + serialized, err := MarshalECPrivateKey(key) + if err != nil { + t.Fatalf("failed to encode EC private key: %s", err) + } + if !bytes.Equal(serialized, derBytes) { + t.Fatalf("serialized key differs: got %x, want %x", serialized, derBytes) + } +} diff --git a/src/crypto/x509/sha2_windows_test.go b/src/crypto/x509/sha2_windows_test.go new file mode 100644 index 0000000000000000000000000000000000000000..79dc685c5b55bec4404b303dc7c6b40c2f4975b3 --- /dev/null +++ b/src/crypto/x509/sha2_windows_test.go @@ -0,0 +1,19 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package x509 + +import "syscall" + +func init() { + v, err := syscall.GetVersion() + if err != nil { + return + } + if major := byte(v); major < 6 { + // Windows XP SP2 and Windows 2003 do not support SHA2. + // http://blogs.technet.com/b/pki/archive/2010/09/30/sha2-and-windows.aspx + supportSHA2 = false + } +} diff --git a/src/crypto/x509/verify.go b/src/crypto/x509/verify.go new file mode 100644 index 0000000000000000000000000000000000000000..21b870c1712cc712ed3c2dc89baa37af9ccce1c8 --- /dev/null +++ b/src/crypto/x509/verify.go @@ -0,0 +1,483 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package x509 + +import ( + "fmt" + "net" + "runtime" + "strings" + "time" + "unicode/utf8" +) + +type InvalidReason int + +const ( + // NotAuthorizedToSign results when a certificate is signed by another + // which isn't marked as a CA certificate. + NotAuthorizedToSign InvalidReason = iota + // Expired results when a certificate has expired, based on the time + // given in the VerifyOptions. + Expired + // CANotAuthorizedForThisName results when an intermediate or root + // certificate has a name constraint which doesn't include the name + // being checked. + CANotAuthorizedForThisName + // TooManyIntermediates results when a path length constraint is + // violated. + TooManyIntermediates + // IncompatibleUsage results when the certificate's key usage indicates + // that it may only be used for a different purpose. + IncompatibleUsage +) + +// CertificateInvalidError results when an odd error occurs. Users of this +// library probably want to handle all these errors uniformly. +type CertificateInvalidError struct { + Cert *Certificate + Reason InvalidReason +} + +func (e CertificateInvalidError) Error() string { + switch e.Reason { + case NotAuthorizedToSign: + return "x509: certificate is not authorized to sign other certificates" + case Expired: + return "x509: certificate has expired or is not yet valid" + case CANotAuthorizedForThisName: + return "x509: a root or intermediate certificate is not authorized to sign in this domain" + case TooManyIntermediates: + return "x509: too many intermediates for path length constraint" + case IncompatibleUsage: + return "x509: certificate specifies an incompatible key usage" + } + return "x509: unknown error" +} + +// HostnameError results when the set of authorized names doesn't match the +// requested name. +type HostnameError struct { + Certificate *Certificate + Host string +} + +func (h HostnameError) Error() string { + c := h.Certificate + + var valid string + if ip := net.ParseIP(h.Host); ip != nil { + // Trying to validate an IP + if len(c.IPAddresses) == 0 { + return "x509: cannot validate certificate for " + h.Host + " because it doesn't contain any IP SANs" + } + for _, san := range c.IPAddresses { + if len(valid) > 0 { + valid += ", " + } + valid += san.String() + } + } else { + if len(c.DNSNames) > 0 { + valid = strings.Join(c.DNSNames, ", ") + } else { + valid = c.Subject.CommonName + } + } + return "x509: certificate is valid for " + valid + ", not " + h.Host +} + +// UnknownAuthorityError results when the certificate issuer is unknown +type UnknownAuthorityError struct { + cert *Certificate + // hintErr contains an error that may be helpful in determining why an + // authority wasn't found. + hintErr error + // hintCert contains a possible authority certificate that was rejected + // because of the error in hintErr. + hintCert *Certificate +} + +func (e UnknownAuthorityError) Error() string { + s := "x509: certificate signed by unknown authority" + if e.hintErr != nil { + certName := e.hintCert.Subject.CommonName + if len(certName) == 0 { + if len(e.hintCert.Subject.Organization) > 0 { + certName = e.hintCert.Subject.Organization[0] + } + certName = "serial:" + e.hintCert.SerialNumber.String() + } + s += fmt.Sprintf(" (possibly because of %q while trying to verify candidate authority certificate %q)", e.hintErr, certName) + } + return s +} + +// SystemRootsError results when we fail to load the system root certificates. +type SystemRootsError struct{} + +func (SystemRootsError) Error() string { + return "x509: failed to load system roots and no roots provided" +} + +// VerifyOptions contains parameters for Certificate.Verify. It's a structure +// because other PKIX verification APIs have ended up needing many options. +type VerifyOptions struct { + DNSName string + Intermediates *CertPool + Roots *CertPool // if nil, the system roots are used + CurrentTime time.Time // if zero, the current time is used + // KeyUsage specifies which Extended Key Usage values are acceptable. + // An empty list means ExtKeyUsageServerAuth. Key usage is considered a + // constraint down the chain which mirrors Windows CryptoAPI behaviour, + // but not the spec. To accept any key usage, include ExtKeyUsageAny. + KeyUsages []ExtKeyUsage +} + +const ( + leafCertificate = iota + intermediateCertificate + rootCertificate +) + +// isValid performs validity checks on the c. +func (c *Certificate) isValid(certType int, currentChain []*Certificate, opts *VerifyOptions) error { + now := opts.CurrentTime + if now.IsZero() { + now = time.Now() + } + if now.Before(c.NotBefore) || now.After(c.NotAfter) { + return CertificateInvalidError{c, Expired} + } + + if len(c.PermittedDNSDomains) > 0 { + ok := false + for _, domain := range c.PermittedDNSDomains { + if opts.DNSName == domain || + (strings.HasSuffix(opts.DNSName, domain) && + len(opts.DNSName) >= 1+len(domain) && + opts.DNSName[len(opts.DNSName)-len(domain)-1] == '.') { + ok = true + break + } + } + + if !ok { + return CertificateInvalidError{c, CANotAuthorizedForThisName} + } + } + + // KeyUsage status flags are ignored. From Engineering Security, Peter + // Gutmann: A European government CA marked its signing certificates as + // being valid for encryption only, but no-one noticed. Another + // European CA marked its signature keys as not being valid for + // signatures. A different CA marked its own trusted root certificate + // as being invalid for certificate signing. Another national CA + // distributed a certificate to be used to encrypt data for the + // country’s tax authority that was marked as only being usable for + // digital signatures but not for encryption. Yet another CA reversed + // the order of the bit flags in the keyUsage due to confusion over + // encoding endianness, essentially setting a random keyUsage in + // certificates that it issued. Another CA created a self-invalidating + // certificate by adding a certificate policy statement stipulating + // that the certificate had to be used strictly as specified in the + // keyUsage, and a keyUsage containing a flag indicating that the RSA + // encryption key could only be used for Diffie-Hellman key agreement. + + if certType == intermediateCertificate && (!c.BasicConstraintsValid || !c.IsCA) { + return CertificateInvalidError{c, NotAuthorizedToSign} + } + + if c.BasicConstraintsValid && c.MaxPathLen >= 0 { + numIntermediates := len(currentChain) - 1 + if numIntermediates > c.MaxPathLen { + return CertificateInvalidError{c, TooManyIntermediates} + } + } + + return nil +} + +// Verify attempts to verify c by building one or more chains from c to a +// certificate in opts.Roots, using certificates in opts.Intermediates if +// needed. If successful, it returns one or more chains where the first +// element of the chain is c and the last element is from opts.Roots. +// +// If opts.Roots is nil and system roots are unavailable the returned error +// will be of type SystemRootsError. +// +// WARNING: this doesn't do any revocation checking. +func (c *Certificate) Verify(opts VerifyOptions) (chains [][]*Certificate, err error) { + // Use Windows's own verification and chain building. + if opts.Roots == nil && runtime.GOOS == "windows" { + return c.systemVerify(&opts) + } + + if len(c.UnhandledCriticalExtensions) > 0 { + return nil, UnhandledCriticalExtension{} + } + + if opts.Roots == nil { + opts.Roots = systemRootsPool() + if opts.Roots == nil { + return nil, SystemRootsError{} + } + } + + err = c.isValid(leafCertificate, nil, &opts) + if err != nil { + return + } + + if len(opts.DNSName) > 0 { + err = c.VerifyHostname(opts.DNSName) + if err != nil { + return + } + } + + candidateChains, err := c.buildChains(make(map[int][][]*Certificate), []*Certificate{c}, &opts) + if err != nil { + return + } + + keyUsages := opts.KeyUsages + if len(keyUsages) == 0 { + keyUsages = []ExtKeyUsage{ExtKeyUsageServerAuth} + } + + // If any key usage is acceptable then we're done. + for _, usage := range keyUsages { + if usage == ExtKeyUsageAny { + chains = candidateChains + return + } + } + + for _, candidate := range candidateChains { + if checkChainForKeyUsage(candidate, keyUsages) { + chains = append(chains, candidate) + } + } + + if len(chains) == 0 { + err = CertificateInvalidError{c, IncompatibleUsage} + } + + return +} + +func appendToFreshChain(chain []*Certificate, cert *Certificate) []*Certificate { + n := make([]*Certificate, len(chain)+1) + copy(n, chain) + n[len(chain)] = cert + return n +} + +func (c *Certificate) buildChains(cache map[int][][]*Certificate, currentChain []*Certificate, opts *VerifyOptions) (chains [][]*Certificate, err error) { + possibleRoots, failedRoot, rootErr := opts.Roots.findVerifiedParents(c) + for _, rootNum := range possibleRoots { + root := opts.Roots.certs[rootNum] + err = root.isValid(rootCertificate, currentChain, opts) + if err != nil { + continue + } + chains = append(chains, appendToFreshChain(currentChain, root)) + } + + possibleIntermediates, failedIntermediate, intermediateErr := opts.Intermediates.findVerifiedParents(c) +nextIntermediate: + for _, intermediateNum := range possibleIntermediates { + intermediate := opts.Intermediates.certs[intermediateNum] + for _, cert := range currentChain { + if cert == intermediate { + continue nextIntermediate + } + } + err = intermediate.isValid(intermediateCertificate, currentChain, opts) + if err != nil { + continue + } + var childChains [][]*Certificate + childChains, ok := cache[intermediateNum] + if !ok { + childChains, err = intermediate.buildChains(cache, appendToFreshChain(currentChain, intermediate), opts) + cache[intermediateNum] = childChains + } + chains = append(chains, childChains...) + } + + if len(chains) > 0 { + err = nil + } + + if len(chains) == 0 && err == nil { + hintErr := rootErr + hintCert := failedRoot + if hintErr == nil { + hintErr = intermediateErr + hintCert = failedIntermediate + } + err = UnknownAuthorityError{c, hintErr, hintCert} + } + + return +} + +func matchHostnames(pattern, host string) bool { + host = strings.TrimSuffix(host, ".") + pattern = strings.TrimSuffix(pattern, ".") + + if len(pattern) == 0 || len(host) == 0 { + return false + } + + patternParts := strings.Split(pattern, ".") + hostParts := strings.Split(host, ".") + + if len(patternParts) != len(hostParts) { + return false + } + + for i, patternPart := range patternParts { + if i == 0 && patternPart == "*" { + continue + } + if patternPart != hostParts[i] { + return false + } + } + + return true +} + +// toLowerCaseASCII returns a lower-case version of in. See RFC 6125 6.4.1. We use +// an explicitly ASCII function to avoid any sharp corners resulting from +// performing Unicode operations on DNS labels. +func toLowerCaseASCII(in string) string { + // If the string is already lower-case then there's nothing to do. + isAlreadyLowerCase := true + for _, c := range in { + if c == utf8.RuneError { + // If we get a UTF-8 error then there might be + // upper-case ASCII bytes in the invalid sequence. + isAlreadyLowerCase = false + break + } + if 'A' <= c && c <= 'Z' { + isAlreadyLowerCase = false + break + } + } + + if isAlreadyLowerCase { + return in + } + + out := []byte(in) + for i, c := range out { + if 'A' <= c && c <= 'Z' { + out[i] += 'a' - 'A' + } + } + return string(out) +} + +// VerifyHostname returns nil if c is a valid certificate for the named host. +// Otherwise it returns an error describing the mismatch. +func (c *Certificate) VerifyHostname(h string) error { + // IP addresses may be written in [ ]. + candidateIP := h + if len(h) >= 3 && h[0] == '[' && h[len(h)-1] == ']' { + candidateIP = h[1 : len(h)-1] + } + if ip := net.ParseIP(candidateIP); ip != nil { + // We only match IP addresses against IP SANs. + // https://tools.ietf.org/html/rfc6125#appendix-B.2 + for _, candidate := range c.IPAddresses { + if ip.Equal(candidate) { + return nil + } + } + return HostnameError{c, candidateIP} + } + + lowered := toLowerCaseASCII(h) + + if len(c.DNSNames) > 0 { + for _, match := range c.DNSNames { + if matchHostnames(toLowerCaseASCII(match), lowered) { + return nil + } + } + // If Subject Alt Name is given, we ignore the common name. + } else if matchHostnames(toLowerCaseASCII(c.Subject.CommonName), lowered) { + return nil + } + + return HostnameError{c, h} +} + +func checkChainForKeyUsage(chain []*Certificate, keyUsages []ExtKeyUsage) bool { + usages := make([]ExtKeyUsage, len(keyUsages)) + copy(usages, keyUsages) + + if len(chain) == 0 { + return false + } + + usagesRemaining := len(usages) + + // We walk down the list and cross out any usages that aren't supported + // by each certificate. If we cross out all the usages, then the chain + // is unacceptable. + +NextCert: + for i := len(chain) - 1; i >= 0; i-- { + cert := chain[i] + if len(cert.ExtKeyUsage) == 0 && len(cert.UnknownExtKeyUsage) == 0 { + // The certificate doesn't have any extended key usage specified. + continue + } + + for _, usage := range cert.ExtKeyUsage { + if usage == ExtKeyUsageAny { + // The certificate is explicitly good for any usage. + continue NextCert + } + } + + const invalidUsage ExtKeyUsage = -1 + + NextRequestedUsage: + for i, requestedUsage := range usages { + if requestedUsage == invalidUsage { + continue + } + + for _, usage := range cert.ExtKeyUsage { + if requestedUsage == usage { + continue NextRequestedUsage + } else if requestedUsage == ExtKeyUsageServerAuth && + (usage == ExtKeyUsageNetscapeServerGatedCrypto || + usage == ExtKeyUsageMicrosoftServerGatedCrypto) { + // In order to support COMODO + // certificate chains, we have to + // accept Netscape or Microsoft SGC + // usages as equal to ServerAuth. + continue NextRequestedUsage + } + } + + usages[i] = invalidUsage + usagesRemaining-- + if usagesRemaining == 0 { + return false + } + } + } + + return true +} diff --git a/src/crypto/x509/verify_test.go b/src/crypto/x509/verify_test.go new file mode 100644 index 0000000000000000000000000000000000000000..694c14023b8ab12f9685134ce11e576cb6e6b86d --- /dev/null +++ b/src/crypto/x509/verify_test.go @@ -0,0 +1,1134 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package x509 + +import ( + "crypto/x509/pkix" + "encoding/pem" + "errors" + "runtime" + "strings" + "testing" + "time" +) + +var supportSHA2 = true + +type verifyTest struct { + leaf string + intermediates []string + roots []string + currentTime int64 + dnsName string + systemSkip bool + keyUsages []ExtKeyUsage + testSystemRootsError bool + sha2 bool + + errorCallback func(*testing.T, int, error) bool + expectedChains [][]string +} + +var verifyTests = []verifyTest{ + { + leaf: googleLeaf, + intermediates: []string{giag2Intermediate}, + currentTime: 1395785200, + dnsName: "www.google.com", + testSystemRootsError: true, + + // Without any roots specified we should get a system roots + // error. + errorCallback: expectSystemRootsError, + }, + { + leaf: googleLeaf, + intermediates: []string{giag2Intermediate}, + roots: []string{geoTrustRoot}, + currentTime: 1395785200, + dnsName: "www.google.com", + + expectedChains: [][]string{ + {"Google", "Google Internet Authority", "GeoTrust"}, + }, + }, + { + leaf: googleLeaf, + intermediates: []string{giag2Intermediate}, + roots: []string{geoTrustRoot}, + currentTime: 1395785200, + dnsName: "WwW.GooGLE.coM", + + expectedChains: [][]string{ + {"Google", "Google Internet Authority", "GeoTrust"}, + }, + }, + { + leaf: googleLeaf, + intermediates: []string{giag2Intermediate}, + roots: []string{geoTrustRoot}, + currentTime: 1395785200, + dnsName: "www.example.com", + + errorCallback: expectHostnameError, + }, + { + leaf: googleLeaf, + intermediates: []string{giag2Intermediate}, + roots: []string{geoTrustRoot}, + currentTime: 1, + dnsName: "www.example.com", + + errorCallback: expectExpired, + }, + { + leaf: googleLeaf, + roots: []string{geoTrustRoot}, + currentTime: 1395785200, + dnsName: "www.google.com", + + // Skip when using systemVerify, since Windows + // *will* find the missing intermediate cert. + systemSkip: true, + errorCallback: expectAuthorityUnknown, + }, + { + leaf: googleLeaf, + intermediates: []string{geoTrustRoot, giag2Intermediate}, + roots: []string{geoTrustRoot}, + currentTime: 1395785200, + dnsName: "www.google.com", + + expectedChains: [][]string{ + {"Google", "Google Internet Authority", "GeoTrust"}, + // TODO(agl): this is ok, but it would be nice if the + // chain building didn't visit the same SPKI + // twice. + {"Google", "Google Internet Authority", "GeoTrust", "GeoTrust"}, + }, + // CAPI doesn't build the chain with the duplicated GeoTrust + // entry so the results don't match. Thus we skip this test + // until that's fixed. + systemSkip: true, + }, + { + leaf: dnssecExpLeaf, + intermediates: []string{startComIntermediate}, + roots: []string{startComRoot}, + currentTime: 1302726541, + + expectedChains: [][]string{ + {"dnssec-exp", "StartCom Class 1", "StartCom Certification Authority"}, + }, + }, + { + leaf: dnssecExpLeaf, + intermediates: []string{startComIntermediate, startComRoot}, + roots: []string{startComRoot}, + currentTime: 1302726541, + + // Skip when using systemVerify, since Windows + // can only return a single chain to us (for now). + systemSkip: true, + expectedChains: [][]string{ + {"dnssec-exp", "StartCom Class 1", "StartCom Certification Authority"}, + {"dnssec-exp", "StartCom Class 1", "StartCom Certification Authority", "StartCom Certification Authority"}, + }, + }, + { + leaf: googleLeafWithInvalidHash, + intermediates: []string{giag2Intermediate}, + roots: []string{geoTrustRoot}, + currentTime: 1395785200, + dnsName: "www.google.com", + + // The specific error message may not occur when using system + // verification. + systemSkip: true, + errorCallback: expectHashError, + }, + { + // The default configuration should reject an S/MIME chain. + leaf: smimeLeaf, + roots: []string{smimeIntermediate}, + currentTime: 1339436154, + + // Key usage not implemented for Windows yet. + systemSkip: true, + errorCallback: expectUsageError, + }, + { + leaf: smimeLeaf, + roots: []string{smimeIntermediate}, + currentTime: 1339436154, + keyUsages: []ExtKeyUsage{ExtKeyUsageServerAuth}, + + // Key usage not implemented for Windows yet. + systemSkip: true, + errorCallback: expectUsageError, + }, + { + leaf: smimeLeaf, + roots: []string{smimeIntermediate}, + currentTime: 1339436154, + keyUsages: []ExtKeyUsage{ExtKeyUsageEmailProtection}, + + // Key usage not implemented for Windows yet. + systemSkip: true, + expectedChains: [][]string{ + {"Ryan Hurst", "GlobalSign PersonalSign 2 CA - G2"}, + }, + }, + { + leaf: megaLeaf, + intermediates: []string{comodoIntermediate1}, + roots: []string{comodoRoot}, + currentTime: 1360431182, + + // CryptoAPI can find alternative validation paths so we don't + // perform this test with system validation. + systemSkip: true, + expectedChains: [][]string{ + {"mega.co.nz", "EssentialSSL CA", "COMODO Certification Authority"}, + }, + }, + { + // Check that a name constrained intermediate works even when + // it lists multiple constraints. + leaf: nameConstraintsLeaf, + intermediates: []string{nameConstraintsIntermediate1, nameConstraintsIntermediate2}, + roots: []string{globalSignRoot}, + currentTime: 1382387896, + dnsName: "secure.iddl.vt.edu", + + expectedChains: [][]string{ + { + "Technology-enhanced Learning and Online Strategies", + "Virginia Tech Global Qualified Server CA", + "Trusted Root CA G2", + "GlobalSign Root CA", + }, + }, + }, + { + // Check that SHA-384 intermediates (which are popping up) + // work. + leaf: moipLeafCert, + intermediates: []string{comodoIntermediateSHA384, comodoRSAAuthority}, + roots: []string{addTrustRoot}, + currentTime: 1397502195, + dnsName: "api.moip.com.br", + + // CryptoAPI can find alternative validation paths so we don't + // perform this test with system validation. + systemSkip: true, + + sha2: true, + expectedChains: [][]string{ + { + "api.moip.com.br", + "COMODO RSA Extended Validation Secure Server CA", + "COMODO RSA Certification Authority", + "AddTrust External CA Root", + }, + }, + }, +} + +func expectHostnameError(t *testing.T, i int, err error) (ok bool) { + if _, ok := err.(HostnameError); !ok { + t.Errorf("#%d: error was not a HostnameError: %s", i, err) + return false + } + return true +} + +func expectExpired(t *testing.T, i int, err error) (ok bool) { + if inval, ok := err.(CertificateInvalidError); !ok || inval.Reason != Expired { + t.Errorf("#%d: error was not Expired: %s", i, err) + return false + } + return true +} + +func expectUsageError(t *testing.T, i int, err error) (ok bool) { + if inval, ok := err.(CertificateInvalidError); !ok || inval.Reason != IncompatibleUsage { + t.Errorf("#%d: error was not IncompatibleUsage: %s", i, err) + return false + } + return true +} + +func expectAuthorityUnknown(t *testing.T, i int, err error) (ok bool) { + if _, ok := err.(UnknownAuthorityError); !ok { + t.Errorf("#%d: error was not UnknownAuthorityError: %s", i, err) + return false + } + return true +} + +func expectSystemRootsError(t *testing.T, i int, err error) bool { + if _, ok := err.(SystemRootsError); !ok { + t.Errorf("#%d: error was not SystemRootsError: %s", i, err) + return false + } + return true +} + +func expectHashError(t *testing.T, i int, err error) bool { + if err == nil { + t.Errorf("#%d: no error resulted from invalid hash", i) + return false + } + if expected := "algorithm unimplemented"; !strings.Contains(err.Error(), expected) { + t.Errorf("#%d: error resulting from invalid hash didn't contain '%s', rather it was: %s", i, expected, err) + return false + } + return true +} + +func certificateFromPEM(pemBytes string) (*Certificate, error) { + block, _ := pem.Decode([]byte(pemBytes)) + if block == nil { + return nil, errors.New("failed to decode PEM") + } + return ParseCertificate(block.Bytes) +} + +func testVerify(t *testing.T, useSystemRoots bool) { + for i, test := range verifyTests { + if useSystemRoots && test.systemSkip { + continue + } + if runtime.GOOS == "windows" && test.testSystemRootsError { + continue + } + if useSystemRoots && !supportSHA2 && test.sha2 { + continue + } + + opts := VerifyOptions{ + Intermediates: NewCertPool(), + DNSName: test.dnsName, + CurrentTime: time.Unix(test.currentTime, 0), + KeyUsages: test.keyUsages, + } + + if !useSystemRoots { + opts.Roots = NewCertPool() + for j, root := range test.roots { + ok := opts.Roots.AppendCertsFromPEM([]byte(root)) + if !ok { + t.Errorf("#%d: failed to parse root #%d", i, j) + return + } + } + } + + for j, intermediate := range test.intermediates { + ok := opts.Intermediates.AppendCertsFromPEM([]byte(intermediate)) + if !ok { + t.Errorf("#%d: failed to parse intermediate #%d", i, j) + return + } + } + + leaf, err := certificateFromPEM(test.leaf) + if err != nil { + t.Errorf("#%d: failed to parse leaf: %s", i, err) + return + } + + var oldSystemRoots *CertPool + if test.testSystemRootsError { + oldSystemRoots = systemRootsPool() + systemRoots = nil + opts.Roots = nil + } + + chains, err := leaf.Verify(opts) + + if test.testSystemRootsError { + systemRoots = oldSystemRoots + } + + if test.errorCallback == nil && err != nil { + t.Errorf("#%d: unexpected error: %s", i, err) + } + if test.errorCallback != nil { + if !test.errorCallback(t, i, err) { + return + } + } + + if len(chains) != len(test.expectedChains) { + t.Errorf("#%d: wanted %d chains, got %d", i, len(test.expectedChains), len(chains)) + } + + // We check that each returned chain matches a chain from + // expectedChains but an entry in expectedChains can't match + // two chains. + seenChains := make([]bool, len(chains)) + NextOutputChain: + for _, chain := range chains { + TryNextExpected: + for j, expectedChain := range test.expectedChains { + if seenChains[j] { + continue + } + if len(chain) != len(expectedChain) { + continue + } + for k, cert := range chain { + if strings.Index(nameToKey(&cert.Subject), expectedChain[k]) == -1 { + continue TryNextExpected + } + } + // we matched + seenChains[j] = true + continue NextOutputChain + } + t.Errorf("#%d: No expected chain matched %s", i, chainToDebugString(chain)) + } + } +} + +func TestGoVerify(t *testing.T) { + testVerify(t, false) +} + +func TestSystemVerify(t *testing.T) { + if runtime.GOOS != "windows" { + t.Skipf("skipping verify test using system APIs on %q", runtime.GOOS) + } + + testVerify(t, true) +} + +func chainToDebugString(chain []*Certificate) string { + var chainStr string + for _, cert := range chain { + if len(chainStr) > 0 { + chainStr += " -> " + } + chainStr += nameToKey(&cert.Subject) + } + return chainStr +} + +func nameToKey(name *pkix.Name) string { + return strings.Join(name.Country, ",") + "/" + strings.Join(name.Organization, ",") + "/" + strings.Join(name.OrganizationalUnit, ",") + "/" + name.CommonName +} + +const geoTrustRoot = `-----BEGIN CERTIFICATE----- +MIIDVDCCAjygAwIBAgIDAjRWMA0GCSqGSIb3DQEBBQUAMEIxCzAJBgNVBAYTAlVT +MRYwFAYDVQQKEw1HZW9UcnVzdCBJbmMuMRswGQYDVQQDExJHZW9UcnVzdCBHbG9i +YWwgQ0EwHhcNMDIwNTIxMDQwMDAwWhcNMjIwNTIxMDQwMDAwWjBCMQswCQYDVQQG +EwJVUzEWMBQGA1UEChMNR2VvVHJ1c3QgSW5jLjEbMBkGA1UEAxMSR2VvVHJ1c3Qg +R2xvYmFsIENBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA2swYYzD9 +9BcjGlZ+W988bDjkcbd4kdS8odhM+KhDtgPpTSEHCIjaWC9mOSm9BXiLnTjoBbdq +fnGk5sRgprDvgOSJKA+eJdbtg/OtppHHmMlCGDUUna2YRpIuT8rxh0PBFpVXLVDv +iS2Aelet8u5fa9IAjbkU+BQVNdnARqN7csiRv8lVK83Qlz6cJmTM386DGXHKTubU +1XupGc1V3sjs0l44U+VcT4wt/lAjNvxm5suOpDkZALeVAjmRCw7+OC7RHQWa9k0+ +bw8HHa8sHo9gOeL6NlMTOdReJivbPagUvTLrGAMoUgRx5aszPeE4uwc2hGKceeoW +MPRfwCvocWvk+QIDAQABo1MwUTAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBTA +ephojYn7qwVkDBF9qn1luMrMTjAfBgNVHSMEGDAWgBTAephojYn7qwVkDBF9qn1l +uMrMTjANBgkqhkiG9w0BAQUFAAOCAQEANeMpauUvXVSOKVCUn5kaFOSPeCpilKIn +Z57QzxpeR+nBsqTP3UEaBU6bS+5Kb1VSsyShNwrrZHYqLizz/Tt1kL/6cdjHPTfS +tQWVYrmm3ok9Nns4d0iXrKYgjy6myQzCsplFAMfOEVEiIuCl6rYVSAlk6l5PdPcF +PseKUgzbFbS9bZvlxrFUaKnjaZC2mqUPuLk/IH2uSrW4nOQdtqvmlKXBx4Ot2/Un +hw4EbNX/3aBd7YdStysVAq45pmp06drE57xNNB6pXE0zX5IJL4hmXXeXxx12E6nV +5fEWCRE11azbJHFwLJhWC9kXtNHjUStedejV0NxPNO3CBWaAocvmMw== +-----END CERTIFICATE----- +` + +const giag2Intermediate = `-----BEGIN CERTIFICATE----- +MIIEBDCCAuygAwIBAgIDAjppMA0GCSqGSIb3DQEBBQUAMEIxCzAJBgNVBAYTAlVT +MRYwFAYDVQQKEw1HZW9UcnVzdCBJbmMuMRswGQYDVQQDExJHZW9UcnVzdCBHbG9i +YWwgQ0EwHhcNMTMwNDA1MTUxNTU1WhcNMTUwNDA0MTUxNTU1WjBJMQswCQYDVQQG +EwJVUzETMBEGA1UEChMKR29vZ2xlIEluYzElMCMGA1UEAxMcR29vZ2xlIEludGVy +bmV0IEF1dGhvcml0eSBHMjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB +AJwqBHdc2FCROgajguDYUEi8iT/xGXAaiEZ+4I/F8YnOIe5a/mENtzJEiaB0C1NP +VaTOgmKV7utZX8bhBYASxF6UP7xbSDj0U/ck5vuR6RXEz/RTDfRK/J9U3n2+oGtv +h8DQUB8oMANA2ghzUWx//zo8pzcGjr1LEQTrfSTe5vn8MXH7lNVg8y5Kr0LSy+rE +ahqyzFPdFUuLH8gZYR/Nnag+YyuENWllhMgZxUYi+FOVvuOAShDGKuy6lyARxzmZ +EASg8GF6lSWMTlJ14rbtCMoU/M4iarNOz0YDl5cDfsCx3nuvRTPPuj5xt970JSXC +DTWJnZ37DhF5iR43xa+OcmkCAwEAAaOB+zCB+DAfBgNVHSMEGDAWgBTAephojYn7 +qwVkDBF9qn1luMrMTjAdBgNVHQ4EFgQUSt0GFhu89mi1dvWBtrtiGrpagS8wEgYD +VR0TAQH/BAgwBgEB/wIBADAOBgNVHQ8BAf8EBAMCAQYwOgYDVR0fBDMwMTAvoC2g +K4YpaHR0cDovL2NybC5nZW90cnVzdC5jb20vY3Jscy9ndGdsb2JhbC5jcmwwPQYI +KwYBBQUHAQEEMTAvMC0GCCsGAQUFBzABhiFodHRwOi8vZ3RnbG9iYWwtb2NzcC5n +ZW90cnVzdC5jb20wFwYDVR0gBBAwDjAMBgorBgEEAdZ5AgUBMA0GCSqGSIb3DQEB +BQUAA4IBAQA21waAESetKhSbOHezI6B1WLuxfoNCunLaHtiONgaX4PCVOzf9G0JY +/iLIa704XtE7JW4S615ndkZAkNoUyHgN7ZVm2o6Gb4ChulYylYbc3GrKBIxbf/a/ +zG+FA1jDaFETzf3I93k9mTXwVqO94FntT0QJo544evZG0R0SnU++0ED8Vf4GXjza +HFa9llF7b1cq26KqltyMdMKVvvBulRP/F/A8rLIQjcxz++iPAsbw+zOzlTvjwsto +WHPbqCRiOwY1nQ2pM714A5AuTHhdUDqB1O6gyHA43LL5Z/qHQF1hwFGPa4NrzQU6 +yuGnBXj8ytqU0CwIPX4WecigUCAkVDNx +-----END CERTIFICATE----- +` + +const googleLeaf = `-----BEGIN CERTIFICATE----- +MIIEdjCCA16gAwIBAgIIcR5k4dkoe04wDQYJKoZIhvcNAQEFBQAwSTELMAkGA1UE +BhMCVVMxEzARBgNVBAoTCkdvb2dsZSBJbmMxJTAjBgNVBAMTHEdvb2dsZSBJbnRl +cm5ldCBBdXRob3JpdHkgRzIwHhcNMTQwMzEyMDkzODMwWhcNMTQwNjEwMDAwMDAw +WjBoMQswCQYDVQQGEwJVUzETMBEGA1UECAwKQ2FsaWZvcm5pYTEWMBQGA1UEBwwN +TW91bnRhaW4gVmlldzETMBEGA1UECgwKR29vZ2xlIEluYzEXMBUGA1UEAwwOd3d3 +Lmdvb2dsZS5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC4zYCe +m0oUBhwE0EwBr65eBOcgcQO2PaSIAB2dEP/c1EMX2tOy0ov8rk83ePhJ+MWdT1z6 +jge9X4zQQI8ZyA9qIiwrKBZOi8DNUvrqNZC7fJAVRrb9aX/99uYOJCypIbpmWG1q +fhbHjJewhwf8xYPj71eU4rLG80a+DapWmphtfq3h52lDQIBzLVf1yYbyrTaELaz4 +NXF7HXb5YkId/gxIsSzM0aFUVu2o8sJcLYAsJqwfFKBKOMxUcn545nlspf0mTcWZ +0APlbwsKznNs4/xCDwIxxWjjqgHrYAFl6y07i1gzbAOqdNEyR24p+3JWI8WZBlBI +dk2KGj0W1fIfsvyxAgMBAAGjggFBMIIBPTAdBgNVHSUEFjAUBggrBgEFBQcDAQYI +KwYBBQUHAwIwGQYDVR0RBBIwEIIOd3d3Lmdvb2dsZS5jb20waAYIKwYBBQUHAQEE +XDBaMCsGCCsGAQUFBzAChh9odHRwOi8vcGtpLmdvb2dsZS5jb20vR0lBRzIuY3J0 +MCsGCCsGAQUFBzABhh9odHRwOi8vY2xpZW50czEuZ29vZ2xlLmNvbS9vY3NwMB0G +A1UdDgQWBBTXD5Bx6iqT+dmEhbFL4OUoHyZn8zAMBgNVHRMBAf8EAjAAMB8GA1Ud +IwQYMBaAFErdBhYbvPZotXb1gba7Yhq6WoEvMBcGA1UdIAQQMA4wDAYKKwYBBAHW +eQIFATAwBgNVHR8EKTAnMCWgI6Ahhh9odHRwOi8vcGtpLmdvb2dsZS5jb20vR0lB +RzIuY3JsMA0GCSqGSIb3DQEBBQUAA4IBAQCR3RJtHzgDh33b/MI1ugiki+nl8Ikj +5larbJRE/rcA5oite+QJyAr6SU1gJJ/rRrK3ItVEHr9L621BCM7GSdoNMjB9MMcf +tJAW0kYGJ+wqKm53wG/JaOADTnnq2Mt/j6F2uvjgN/ouns1nRHufIvd370N0LeH+ +orKqTuAPzXK7imQk6+OycYABbqCtC/9qmwRd8wwn7sF97DtYfK8WuNHtFalCAwyi +8LxJJYJCLWoMhZ+V8GZm+FOex5qkQAjnZrtNlbQJ8ro4r+rpKXtmMFFhfa+7L+PA +Kom08eUK8skxAzfDDijZPh10VtJ66uBoiDPdT+uCBehcBIcmSTrKjFGX +-----END CERTIFICATE----- +` + +// googleLeafWithInvalidHash is the same as googleLeaf, but the signature +// algorithm in the certificate contains a nonsense OID. +const googleLeafWithInvalidHash = `-----BEGIN CERTIFICATE----- +MIIEdjCCA16gAwIBAgIIcR5k4dkoe04wDQYJKoZIhvcNAWAFBQAwSTELMAkGA1UE +BhMCVVMxEzARBgNVBAoTCkdvb2dsZSBJbmMxJTAjBgNVBAMTHEdvb2dsZSBJbnRl +cm5ldCBBdXRob3JpdHkgRzIwHhcNMTQwMzEyMDkzODMwWhcNMTQwNjEwMDAwMDAw +WjBoMQswCQYDVQQGEwJVUzETMBEGA1UECAwKQ2FsaWZvcm5pYTEWMBQGA1UEBwwN +TW91bnRhaW4gVmlldzETMBEGA1UECgwKR29vZ2xlIEluYzEXMBUGA1UEAwwOd3d3 +Lmdvb2dsZS5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC4zYCe +m0oUBhwE0EwBr65eBOcgcQO2PaSIAB2dEP/c1EMX2tOy0ov8rk83ePhJ+MWdT1z6 +jge9X4zQQI8ZyA9qIiwrKBZOi8DNUvrqNZC7fJAVRrb9aX/99uYOJCypIbpmWG1q +fhbHjJewhwf8xYPj71eU4rLG80a+DapWmphtfq3h52lDQIBzLVf1yYbyrTaELaz4 +NXF7HXb5YkId/gxIsSzM0aFUVu2o8sJcLYAsJqwfFKBKOMxUcn545nlspf0mTcWZ +0APlbwsKznNs4/xCDwIxxWjjqgHrYAFl6y07i1gzbAOqdNEyR24p+3JWI8WZBlBI +dk2KGj0W1fIfsvyxAgMBAAGjggFBMIIBPTAdBgNVHSUEFjAUBggrBgEFBQcDAQYI +KwYBBQUHAwIwGQYDVR0RBBIwEIIOd3d3Lmdvb2dsZS5jb20waAYIKwYBBQUHAQEE +XDBaMCsGCCsGAQUFBzAChh9odHRwOi8vcGtpLmdvb2dsZS5jb20vR0lBRzIuY3J0 +MCsGCCsGAQUFBzABhh9odHRwOi8vY2xpZW50czEuZ29vZ2xlLmNvbS9vY3NwMB0G +A1UdDgQWBBTXD5Bx6iqT+dmEhbFL4OUoHyZn8zAMBgNVHRMBAf8EAjAAMB8GA1Ud +IwQYMBaAFErdBhYbvPZotXb1gba7Yhq6WoEvMBcGA1UdIAQQMA4wDAYKKwYBBAHW +eQIFATAwBgNVHR8EKTAnMCWgI6Ahhh9odHRwOi8vcGtpLmdvb2dsZS5jb20vR0lB +RzIuY3JsMA0GCSqGSIb3DQFgBQUAA4IBAQCR3RJtHzgDh33b/MI1ugiki+nl8Ikj +5larbJRE/rcA5oite+QJyAr6SU1gJJ/rRrK3ItVEHr9L621BCM7GSdoNMjB9MMcf +tJAW0kYGJ+wqKm53wG/JaOADTnnq2Mt/j6F2uvjgN/ouns1nRHufIvd370N0LeH+ +orKqTuAPzXK7imQk6+OycYABbqCtC/9qmwRd8wwn7sF97DtYfK8WuNHtFalCAwyi +8LxJJYJCLWoMhZ+V8GZm+FOex5qkQAjnZrtNlbQJ8ro4r+rpKXtmMFFhfa+7L+PA +Kom08eUK8skxAzfDDijZPh10VtJ66uBoiDPdT+uCBehcBIcmSTrKjFGX +-----END CERTIFICATE----- +` + +const dnssecExpLeaf = `-----BEGIN CERTIFICATE----- +MIIGzTCCBbWgAwIBAgIDAdD6MA0GCSqGSIb3DQEBBQUAMIGMMQswCQYDVQQGEwJJ +TDEWMBQGA1UEChMNU3RhcnRDb20gTHRkLjErMCkGA1UECxMiU2VjdXJlIERpZ2l0 +YWwgQ2VydGlmaWNhdGUgU2lnbmluZzE4MDYGA1UEAxMvU3RhcnRDb20gQ2xhc3Mg +MSBQcmltYXJ5IEludGVybWVkaWF0ZSBTZXJ2ZXIgQ0EwHhcNMTAwNzA0MTQ1MjQ1 +WhcNMTEwNzA1MTA1NzA0WjCBwTEgMB4GA1UEDRMXMjIxMTM3LWxpOWE5dHhJRzZM +NnNyVFMxCzAJBgNVBAYTAlVTMR4wHAYDVQQKExVQZXJzb25hIE5vdCBWYWxpZGF0 +ZWQxKTAnBgNVBAsTIFN0YXJ0Q29tIEZyZWUgQ2VydGlmaWNhdGUgTWVtYmVyMRsw +GQYDVQQDExJ3d3cuZG5zc2VjLWV4cC5vcmcxKDAmBgkqhkiG9w0BCQEWGWhvc3Rt +YXN0ZXJAZG5zc2VjLWV4cC5vcmcwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEK +AoIBAQDEdF/22vaxrPbqpgVYMWi+alfpzBctpbfLBdPGuqOazJdCT0NbWcK8/+B4 +X6OlSOURNIlwLzhkmwVsWdVv6dVSaN7d4yI/fJkvgfDB9+au+iBJb6Pcz8ULBfe6 +D8HVvqKdORp6INzHz71z0sghxrQ0EAEkoWAZLh+kcn2ZHdcmZaBNUfjmGbyU6PRt +RjdqoP+owIaC1aktBN7zl4uO7cRjlYFdusINrh2kPP02KAx2W84xjxX1uyj6oS6e +7eBfvcwe8czW/N1rbE0CoR7h9+HnIrjnVG9RhBiZEiw3mUmF++Up26+4KTdRKbu3 ++BL4yMpfd66z0+zzqu+HkvyLpFn5AgMBAAGjggL/MIIC+zAJBgNVHRMEAjAAMAsG +A1UdDwQEAwIDqDATBgNVHSUEDDAKBggrBgEFBQcDATAdBgNVHQ4EFgQUy04I5guM +drzfh2JQaXhgV86+4jUwHwYDVR0jBBgwFoAU60I00Jiwq5/0G2sI98xkLu8OLEUw +LQYDVR0RBCYwJIISd3d3LmRuc3NlYy1leHAub3Jngg5kbnNzZWMtZXhwLm9yZzCC +AUIGA1UdIASCATkwggE1MIIBMQYLKwYBBAGBtTcBAgIwggEgMC4GCCsGAQUFBwIB +FiJodHRwOi8vd3d3LnN0YXJ0c3NsLmNvbS9wb2xpY3kucGRmMDQGCCsGAQUFBwIB +FihodHRwOi8vd3d3LnN0YXJ0c3NsLmNvbS9pbnRlcm1lZGlhdGUucGRmMIG3Bggr +BgEFBQcCAjCBqjAUFg1TdGFydENvbSBMdGQuMAMCAQEagZFMaW1pdGVkIExpYWJp +bGl0eSwgc2VlIHNlY3Rpb24gKkxlZ2FsIExpbWl0YXRpb25zKiBvZiB0aGUgU3Rh +cnRDb20gQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgUG9saWN5IGF2YWlsYWJsZSBh +dCBodHRwOi8vd3d3LnN0YXJ0c3NsLmNvbS9wb2xpY3kucGRmMGEGA1UdHwRaMFgw +KqAooCaGJGh0dHA6Ly93d3cuc3RhcnRzc2wuY29tL2NydDEtY3JsLmNybDAqoCig +JoYkaHR0cDovL2NybC5zdGFydHNzbC5jb20vY3J0MS1jcmwuY3JsMIGOBggrBgEF +BQcBAQSBgTB/MDkGCCsGAQUFBzABhi1odHRwOi8vb2NzcC5zdGFydHNzbC5jb20v +c3ViL2NsYXNzMS9zZXJ2ZXIvY2EwQgYIKwYBBQUHMAKGNmh0dHA6Ly93d3cuc3Rh +cnRzc2wuY29tL2NlcnRzL3N1Yi5jbGFzczEuc2VydmVyLmNhLmNydDAjBgNVHRIE +HDAahhhodHRwOi8vd3d3LnN0YXJ0c3NsLmNvbS8wDQYJKoZIhvcNAQEFBQADggEB +ACXj6SB59KRJPenn6gUdGEqcta97U769SATyiQ87i9er64qLwvIGLMa3o2Rcgl2Y +kghUeyLdN/EXyFBYA8L8uvZREPoc7EZukpT/ZDLXy9i2S0jkOxvF2fD/XLbcjGjM +iEYG1/6ASw0ri9C0k4oDDoJLCoeH9++yqF7SFCCMcDkJqiAGXNb4euDpa8vCCtEQ +CSS+ObZbfkreRt3cNCf5LfCXe9OsTnCfc8Cuq81c0oLaG+SmaLUQNBuToq8e9/Zm ++b+/a3RVjxmkV5OCcGVBxsXNDn54Q6wsdw0TBMcjwoEndzpLS7yWgFbbkq5ZiGpw +Qibb2+CfKuQ+WFV1GkVQmVA= +-----END CERTIFICATE-----` + +const startComIntermediate = `-----BEGIN CERTIFICATE----- +MIIGNDCCBBygAwIBAgIBGDANBgkqhkiG9w0BAQUFADB9MQswCQYDVQQGEwJJTDEW +MBQGA1UEChMNU3RhcnRDb20gTHRkLjErMCkGA1UECxMiU2VjdXJlIERpZ2l0YWwg +Q2VydGlmaWNhdGUgU2lnbmluZzEpMCcGA1UEAxMgU3RhcnRDb20gQ2VydGlmaWNh +dGlvbiBBdXRob3JpdHkwHhcNMDcxMDI0MjA1NDE3WhcNMTcxMDI0MjA1NDE3WjCB +jDELMAkGA1UEBhMCSUwxFjAUBgNVBAoTDVN0YXJ0Q29tIEx0ZC4xKzApBgNVBAsT +IlNlY3VyZSBEaWdpdGFsIENlcnRpZmljYXRlIFNpZ25pbmcxODA2BgNVBAMTL1N0 +YXJ0Q29tIENsYXNzIDEgUHJpbWFyeSBJbnRlcm1lZGlhdGUgU2VydmVyIENBMIIB +IjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAtonGrO8JUngHrJJj0PREGBiE +gFYfka7hh/oyULTTRwbw5gdfcA4Q9x3AzhA2NIVaD5Ksg8asWFI/ujjo/OenJOJA +pgh2wJJuniptTT9uYSAK21ne0n1jsz5G/vohURjXzTCm7QduO3CHtPn66+6CPAVv +kvek3AowHpNz/gfK11+AnSJYUq4G2ouHI2mw5CrY6oPSvfNx23BaKA+vWjhwRRI/ +ME3NO68X5Q/LoKldSKqxYVDLNM08XMML6BDAjJvwAwNi/rJsPnIO7hxDKslIDlc5 +xDEhyBDBLIf+VJVSH1I8MRKbf+fAoKVZ1eKPPvDVqOHXcDGpxLPPr21TLwb0pwID +AQABo4IBrTCCAakwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYD +VR0OBBYEFOtCNNCYsKuf9BtrCPfMZC7vDixFMB8GA1UdIwQYMBaAFE4L7xqkQFul +F2mHMMo0aEPQQa7yMGYGCCsGAQUFBwEBBFowWDAnBggrBgEFBQcwAYYbaHR0cDov +L29jc3Auc3RhcnRzc2wuY29tL2NhMC0GCCsGAQUFBzAChiFodHRwOi8vd3d3LnN0 +YXJ0c3NsLmNvbS9zZnNjYS5jcnQwWwYDVR0fBFQwUjAnoCWgI4YhaHR0cDovL3d3 +dy5zdGFydHNzbC5jb20vc2ZzY2EuY3JsMCegJaAjhiFodHRwOi8vY3JsLnN0YXJ0 +c3NsLmNvbS9zZnNjYS5jcmwwgYAGA1UdIAR5MHcwdQYLKwYBBAGBtTcBAgEwZjAu +BggrBgEFBQcCARYiaHR0cDovL3d3dy5zdGFydHNzbC5jb20vcG9saWN5LnBkZjA0 +BggrBgEFBQcCARYoaHR0cDovL3d3dy5zdGFydHNzbC5jb20vaW50ZXJtZWRpYXRl +LnBkZjANBgkqhkiG9w0BAQUFAAOCAgEAIQlJPqWIbuALi0jaMU2P91ZXouHTYlfp +tVbzhUV1O+VQHwSL5qBaPucAroXQ+/8gA2TLrQLhxpFy+KNN1t7ozD+hiqLjfDen +xk+PNdb01m4Ge90h2c9W/8swIkn+iQTzheWq8ecf6HWQTd35RvdCNPdFWAwRDYSw +xtpdPvkBnufh2lWVvnQce/xNFE+sflVHfXv0pQ1JHpXo9xLBzP92piVH0PN1Nb6X +t1gW66pceG/sUzCv6gRNzKkC4/C2BBL2MLERPZBOVmTX3DxDX3M570uvh+v2/miI +RHLq0gfGabDBoYvvF0nXYbFFSF87ICHpW7LM9NfpMfULFWE7epTj69m8f5SuauNi +YpaoZHy4h/OZMn6SolK+u/hlz8nyMPyLwcKmltdfieFcNID1j0cHL7SRv7Gifl9L +WtBbnySGBVFaaQNlQ0lxxeBvlDRr9hvYqbBMflPrj0jfyjO1SPo2ShpTpjMM0InN +SRXNiTE8kMBy12VLUjWKRhFEuT2OKGWmPnmeXAhEKa2wNREuIU640ucQPl2Eg7PD +wuTSxv0JS3QJ3fGz0xk+gA2iCxnwOOfFwq/iI9th4p1cbiCJSS4jarJiwUW0n6+L +p/EiO/h94pDQehn7Skzj0n1fSoMD7SfWI55rjbRZotnvbIIp3XUZPD9MEI3vu3Un +0q6Dp6jOW6c= +-----END CERTIFICATE-----` + +const startComRoot = `-----BEGIN CERTIFICATE----- +MIIHyTCCBbGgAwIBAgIBATANBgkqhkiG9w0BAQUFADB9MQswCQYDVQQGEwJJTDEW +MBQGA1UEChMNU3RhcnRDb20gTHRkLjErMCkGA1UECxMiU2VjdXJlIERpZ2l0YWwg +Q2VydGlmaWNhdGUgU2lnbmluZzEpMCcGA1UEAxMgU3RhcnRDb20gQ2VydGlmaWNh +dGlvbiBBdXRob3JpdHkwHhcNMDYwOTE3MTk0NjM2WhcNMzYwOTE3MTk0NjM2WjB9 +MQswCQYDVQQGEwJJTDEWMBQGA1UEChMNU3RhcnRDb20gTHRkLjErMCkGA1UECxMi +U2VjdXJlIERpZ2l0YWwgQ2VydGlmaWNhdGUgU2lnbmluZzEpMCcGA1UEAxMgU3Rh +cnRDb20gQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwggIiMA0GCSqGSIb3DQEBAQUA +A4ICDwAwggIKAoICAQDBiNsJvGxGfHiflXu1M5DycmLWwTYgIiRezul38kMKogZk +pMyONvg45iPwbm2xPN1yo4UcodM9tDMr0y+v/uqwQVlntsQGfQqedIXWeUyAN3rf +OQVSWff0G0ZDpNKFhdLDcfN1YjS6LIp/Ho/u7TTQEceWzVI9ujPW3U3eCztKS5/C +Ji/6tRYccjV3yjxd5srhJosaNnZcAdt0FCX+7bWgiA/deMotHweXMAEtcnn6RtYT +Kqi5pquDSR3l8u/d5AGOGAqPY1MWhWKpDhk6zLVmpsJrdAfkK+F2PrRt2PZE4XNi +HzvEvqBTViVsUQn3qqvKv3b9bZvzndu/PWa8DFaqr5hIlTpL36dYUNk4dalb6kMM +Av+Z6+hsTXBbKWWc3apdzK8BMewM69KN6Oqce+Zu9ydmDBpI125C4z/eIT574Q1w ++2OqqGwaVLRcJXrJosmLFqa7LH4XXgVNWG4SHQHuEhANxjJ/GP/89PrNbpHoNkm+ +Gkhpi8KWTRoSsmkXwQqQ1vp5Iki/untp+HDH+no32NgN0nZPV/+Qt+OR0t3vwmC3 +Zzrd/qqc8NSLf3Iizsafl7b4r4qgEKjZ+xjGtrVcUjyJthkqcwEKDwOzEmDyei+B +26Nu/yYwl/WL3YlXtq09s68rxbd2AvCl1iuahhQqcvbjM4xdCUsT37uMdBNSSwID +AQABo4ICUjCCAk4wDAYDVR0TBAUwAwEB/zALBgNVHQ8EBAMCAa4wHQYDVR0OBBYE +FE4L7xqkQFulF2mHMMo0aEPQQa7yMGQGA1UdHwRdMFswLKAqoCiGJmh0dHA6Ly9j +ZXJ0LnN0YXJ0Y29tLm9yZy9zZnNjYS1jcmwuY3JsMCugKaAnhiVodHRwOi8vY3Js +LnN0YXJ0Y29tLm9yZy9zZnNjYS1jcmwuY3JsMIIBXQYDVR0gBIIBVDCCAVAwggFM +BgsrBgEEAYG1NwEBATCCATswLwYIKwYBBQUHAgEWI2h0dHA6Ly9jZXJ0LnN0YXJ0 +Y29tLm9yZy9wb2xpY3kucGRmMDUGCCsGAQUFBwIBFilodHRwOi8vY2VydC5zdGFy +dGNvbS5vcmcvaW50ZXJtZWRpYXRlLnBkZjCB0AYIKwYBBQUHAgIwgcMwJxYgU3Rh +cnQgQ29tbWVyY2lhbCAoU3RhcnRDb20pIEx0ZC4wAwIBARqBl0xpbWl0ZWQgTGlh +YmlsaXR5LCByZWFkIHRoZSBzZWN0aW9uICpMZWdhbCBMaW1pdGF0aW9ucyogb2Yg +dGhlIFN0YXJ0Q29tIENlcnRpZmljYXRpb24gQXV0aG9yaXR5IFBvbGljeSBhdmFp +bGFibGUgYXQgaHR0cDovL2NlcnQuc3RhcnRjb20ub3JnL3BvbGljeS5wZGYwEQYJ +YIZIAYb4QgEBBAQDAgAHMDgGCWCGSAGG+EIBDQQrFilTdGFydENvbSBGcmVlIFNT +TCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTANBgkqhkiG9w0BAQUFAAOCAgEAFmyZ +9GYMNPXQhV59CuzaEE44HF7fpiUFS5Eyweg78T3dRAlbB0mKKctmArexmvclmAk8 +jhvh3TaHK0u7aNM5Zj2gJsfyOZEdUauCe37Vzlrk4gNXcGmXCPleWKYK34wGmkUW +FjgKXlf2Ysd6AgXmvB618p70qSmD+LIU424oh0TDkBreOKk8rENNZEXO3SipXPJz +ewT4F+irsfMuXGRuczE6Eri8sxHkfY+BUZo7jYn0TZNmezwD7dOaHZrzZVD1oNB1 +ny+v8OqCQ5j4aZyJecRDjkZy42Q2Eq/3JR44iZB3fsNrarnDy0RLrHiQi+fHLB5L +EUTINFInzQpdn4XBidUaePKVEFMy3YCEZnXZtWgo+2EuvoSoOMCZEoalHmdkrQYu +L6lwhceWD3yJZfWOQ1QOq92lgDmUYMA0yZZwLKMS9R9Ie70cfmu3nZD0Ijuu+Pwq +yvqCUqDvr0tVk+vBtfAii6w0TiYiBKGHLHVKt+V9E9e4DGTANtLJL4YSjCMJwRuC +O3NJo2pXh5Tl1njFmUNj403gdy3hZZlyaQQaRwnmDwFWJPsfvw55qVguucQJAX6V +um0ABj6y6koQOdjQK/W/7HW/lwLFCRsI3FU34oH7N4RDYiDK51ZLZer+bMEkkySh +NOsF/5oirpt9P/FlUQqmMGqz9IgcgA38corog14= +-----END CERTIFICATE-----` + +const startComRootSHA256 = `-----BEGIN CERTIFICATE----- +MIIHhzCCBW+gAwIBAgIBLTANBgkqhkiG9w0BAQsFADB9MQswCQYDVQQGEwJJTDEW +MBQGA1UEChMNU3RhcnRDb20gTHRkLjErMCkGA1UECxMiU2VjdXJlIERpZ2l0YWwg +Q2VydGlmaWNhdGUgU2lnbmluZzEpMCcGA1UEAxMgU3RhcnRDb20gQ2VydGlmaWNh +dGlvbiBBdXRob3JpdHkwHhcNMDYwOTE3MTk0NjM3WhcNMzYwOTE3MTk0NjM2WjB9 +MQswCQYDVQQGEwJJTDEWMBQGA1UEChMNU3RhcnRDb20gTHRkLjErMCkGA1UECxMi +U2VjdXJlIERpZ2l0YWwgQ2VydGlmaWNhdGUgU2lnbmluZzEpMCcGA1UEAxMgU3Rh +cnRDb20gQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwggIiMA0GCSqGSIb3DQEBAQUA +A4ICDwAwggIKAoICAQDBiNsJvGxGfHiflXu1M5DycmLWwTYgIiRezul38kMKogZk +pMyONvg45iPwbm2xPN1yo4UcodM9tDMr0y+v/uqwQVlntsQGfQqedIXWeUyAN3rf +OQVSWff0G0ZDpNKFhdLDcfN1YjS6LIp/Ho/u7TTQEceWzVI9ujPW3U3eCztKS5/C +Ji/6tRYccjV3yjxd5srhJosaNnZcAdt0FCX+7bWgiA/deMotHweXMAEtcnn6RtYT +Kqi5pquDSR3l8u/d5AGOGAqPY1MWhWKpDhk6zLVmpsJrdAfkK+F2PrRt2PZE4XNi +HzvEvqBTViVsUQn3qqvKv3b9bZvzndu/PWa8DFaqr5hIlTpL36dYUNk4dalb6kMM +Av+Z6+hsTXBbKWWc3apdzK8BMewM69KN6Oqce+Zu9ydmDBpI125C4z/eIT574Q1w ++2OqqGwaVLRcJXrJosmLFqa7LH4XXgVNWG4SHQHuEhANxjJ/GP/89PrNbpHoNkm+ +Gkhpi8KWTRoSsmkXwQqQ1vp5Iki/untp+HDH+no32NgN0nZPV/+Qt+OR0t3vwmC3 +Zzrd/qqc8NSLf3Iizsafl7b4r4qgEKjZ+xjGtrVcUjyJthkqcwEKDwOzEmDyei+B +26Nu/yYwl/WL3YlXtq09s68rxbd2AvCl1iuahhQqcvbjM4xdCUsT37uMdBNSSwID +AQABo4ICEDCCAgwwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYD +VR0OBBYEFE4L7xqkQFulF2mHMMo0aEPQQa7yMB8GA1UdIwQYMBaAFE4L7xqkQFul +F2mHMMo0aEPQQa7yMIIBWgYDVR0gBIIBUTCCAU0wggFJBgsrBgEEAYG1NwEBATCC +ATgwLgYIKwYBBQUHAgEWImh0dHA6Ly93d3cuc3RhcnRzc2wuY29tL3BvbGljeS5w +ZGYwNAYIKwYBBQUHAgEWKGh0dHA6Ly93d3cuc3RhcnRzc2wuY29tL2ludGVybWVk +aWF0ZS5wZGYwgc8GCCsGAQUFBwICMIHCMCcWIFN0YXJ0IENvbW1lcmNpYWwgKFN0 +YXJ0Q29tKSBMdGQuMAMCAQEagZZMaW1pdGVkIExpYWJpbGl0eSwgcmVhZCB0aGUg +c2VjdGlvbiAqTGVnYWwgTGltaXRhdGlvbnMqIG9mIHRoZSBTdGFydENvbSBDZXJ0 +aWZpY2F0aW9uIEF1dGhvcml0eSBQb2xpY3kgYXZhaWxhYmxlIGF0IGh0dHA6Ly93 +d3cuc3RhcnRzc2wuY29tL3BvbGljeS5wZGYwEQYJYIZIAYb4QgEBBAQDAgAHMDgG +CWCGSAGG+EIBDQQrFilTdGFydENvbSBGcmVlIFNTTCBDZXJ0aWZpY2F0aW9uIEF1 +dGhvcml0eTANBgkqhkiG9w0BAQsFAAOCAgEAjo/n3JR5fPGFf59Jb2vKXfuM/gTF +wWLRfUKKvFO3lANmMD+x5wqnUCBVJX92ehQN6wQOQOY+2IirByeDqXWmN3PH/UvS +Ta0XQMhGvjt/UfzDtgUx3M2FIk5xt/JxXrAaxrqTi3iSSoX4eA+D/i+tLPfkpLst +0OcNOrg+zvZ49q5HJMqjNTbOx8aHmNrs++myziebiMMEofYLWWivydsQD032ZGNc +pRJvkrKTlMeIFw6Ttn5ii5B/q06f/ON1FE8qMt9bDeD1e5MNq6HPh+GlBEXoPBKl +CcWw0bdT82AUuoVpaiF8H3VhFyAXe2w7QSlc4axa0c2Mm+tgHRns9+Ww2vl5GKVF +P0lDV9LdJNUso/2RjSe15esUBppMeyG7Oq0wBhjA2MFrLH9ZXF2RsXAiV+uKa0hK +1Q8p7MZAwC+ITGgBF3f0JBlPvfrhsiAhS90a2Cl9qrjeVOwhVYBsHvUwyKMQ5bLm +KhQxw4UtjJixhlpPiVktucf3HMiKf8CdBUrmQk9io20ppB+Fq9vlgcitKj1MXVuE +JnHEhV5xJMqlG2zYYdMa4FTbzrqpMrUi9nNBCV24F10OD5mQ1kfabwo6YigUZ4LZ +8dCAWZvLMdibD4x3TrVoivJs9iQOLWxwxXPR3hTQcY+203sC9uO41Alua551hDnm +fyWl8kgAwKQB2j8= +-----END CERTIFICATE-----` + +const smimeLeaf = `-----BEGIN CERTIFICATE----- +MIIFBjCCA+6gAwIBAgISESFvrjT8XcJTEe6rBlPptILlMA0GCSqGSIb3DQEBBQUA +MFQxCzAJBgNVBAYTAkJFMRkwFwYDVQQKExBHbG9iYWxTaWduIG52LXNhMSowKAYD +VQQDEyFHbG9iYWxTaWduIFBlcnNvbmFsU2lnbiAyIENBIC0gRzIwHhcNMTIwMTIz +MTYzNjU5WhcNMTUwMTIzMTYzNjU5WjCBlDELMAkGA1UEBhMCVVMxFjAUBgNVBAgT +DU5ldyBIYW1zcGhpcmUxEzARBgNVBAcTClBvcnRzbW91dGgxGTAXBgNVBAoTEEds +b2JhbFNpZ24sIEluYy4xEzARBgNVBAMTClJ5YW4gSHVyc3QxKDAmBgkqhkiG9w0B +CQEWGXJ5YW4uaHVyc3RAZ2xvYmFsc2lnbi5jb20wggEiMA0GCSqGSIb3DQEBAQUA +A4IBDwAwggEKAoIBAQC4ASSTvavmsFQAob60ukSSwOAL9nT/s99ltNUCAf5fPH5j +NceMKxaQse2miOmRRIXaykcq1p/TbI70Ztce38r2mbOwqDHHPVi13GxJEyUXWgaR +BteDMu5OGyWNG1kchVsGWpbstT0Z4v0md5m1BYFnxB20ebJyOR2lXDxsFK28nnKV ++5eMj76U8BpPQ4SCH7yTMG6y0XXsB3cCrBKr2o3TOYgEKv+oNnbaoMt3UxMt9nSf +9jyIshjqfnT5Aew3CUNMatO55g5FXXdIukAweg1YSb1ls05qW3sW00T3d7dQs9/7 +NuxCg/A2elmVJSoy8+MLR8JSFEf/aMgjO/TyLg/jAgMBAAGjggGPMIIBizAOBgNV +HQ8BAf8EBAMCBaAwTQYDVR0gBEYwRDBCBgorBgEEAaAyASgKMDQwMgYIKwYBBQUH +AgEWJmh0dHBzOi8vd3d3Lmdsb2JhbHNpZ24uY29tL3JlcG9zaXRvcnkvMCQGA1Ud +EQQdMBuBGXJ5YW4uaHVyc3RAZ2xvYmFsc2lnbi5jb20wCQYDVR0TBAIwADAdBgNV +HSUEFjAUBggrBgEFBQcDAgYIKwYBBQUHAwQwQwYDVR0fBDwwOjA4oDagNIYyaHR0 +cDovL2NybC5nbG9iYWxzaWduLmNvbS9ncy9nc3BlcnNvbmFsc2lnbjJnMi5jcmww +VQYIKwYBBQUHAQEESTBHMEUGCCsGAQUFBzAChjlodHRwOi8vc2VjdXJlLmdsb2Jh +bHNpZ24uY29tL2NhY2VydC9nc3BlcnNvbmFsc2lnbjJnMi5jcnQwHQYDVR0OBBYE +FFWiECe0/L72eVYqcWYnLV6SSjzhMB8GA1UdIwQYMBaAFD8V0m18L+cxnkMKBqiU +bCw7xe5lMA0GCSqGSIb3DQEBBQUAA4IBAQAhQi6hLPeudmf3IBF4IDzCvRI0FaYd +BKfprSk/H0PDea4vpsLbWpA0t0SaijiJYtxKjlM4bPd+2chb7ejatDdyrZIzmDVy +q4c30/xMninGKokpYA11/Ve+i2dvjulu65qasrtQRGybAuuZ67lrp/K3OMFgjV5N +C3AHYLzvNU4Dwc4QQ1BaMOg6KzYSrKbABRZajfrpC9uiePsv7mDIXLx/toBPxWNl +a5vJm5DrZdn7uHdvBCE6kMykbOLN5pmEK0UIlwKh6Qi5XD0pzlVkEZliFkBMJgub +d/eF7xeg7TKPWC5xyOFp9SdMolJM7LTC3wnSO3frBAev+q/nGs9Xxyvs +-----END CERTIFICATE-----` + +const smimeIntermediate = `-----BEGIN CERTIFICATE----- +MIIEFjCCAv6gAwIBAgILBAAAAAABL07hL1IwDQYJKoZIhvcNAQEFBQAwVzELMAkG +A1UEBhMCQkUxGTAXBgNVBAoTEEdsb2JhbFNpZ24gbnYtc2ExEDAOBgNVBAsTB1Jv +b3QgQ0ExGzAZBgNVBAMTEkdsb2JhbFNpZ24gUm9vdCBDQTAeFw0xMTA0MTMxMDAw +MDBaFw0xOTA0MTMxMDAwMDBaMFQxCzAJBgNVBAYTAkJFMRkwFwYDVQQKExBHbG9i +YWxTaWduIG52LXNhMSowKAYDVQQDEyFHbG9iYWxTaWduIFBlcnNvbmFsU2lnbiAy +IENBIC0gRzIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDBa0H5Nez4 +En3dIlFpX7e5E0YndxQ74xOBbz7kdBd+DLX0LOQMjVPU3DAgKL9ujhH+ZhHkURbH +3X/94TQSUL/z2JjsaQvS0NqyZXHhM5eeuquzOJRzEQ8+odETzHg2G0Erv7yjSeww +gkwDWDJnYUDlOjYTDUEG6+i+8Mn425reo4I0E277wD542kmVWeW7+oHv5dZo9e1Q +yWwiKTEP6BEQVVSBgThXMG4traSSDRUt3T1eQTZx5EObpiBEBO4OTqiBTJfg4vEI +YgkXzKLpnfszTB6YMDpR9/QS6p3ANB3kfAb+t6udSO3WCst0DGrwHDLBFGDR4UeY +T5KGGnI7cWL7AgMBAAGjgeUwgeIwDgYDVR0PAQH/BAQDAgEGMBIGA1UdEwEB/wQI +MAYBAf8CAQAwHQYDVR0OBBYEFD8V0m18L+cxnkMKBqiUbCw7xe5lMEcGA1UdIARA +MD4wPAYEVR0gADA0MDIGCCsGAQUFBwIBFiZodHRwczovL3d3dy5nbG9iYWxzaWdu +LmNvbS9yZXBvc2l0b3J5LzAzBgNVHR8ELDAqMCigJqAkhiJodHRwOi8vY3JsLmds +b2JhbHNpZ24ubmV0L3Jvb3QuY3JsMB8GA1UdIwQYMBaAFGB7ZhpFDZfKiVAvfQTN +NKj//P1LMA0GCSqGSIb3DQEBBQUAA4IBAQBDc3nMpMxJMQMcYUCB3+C73UpvwDE8 +eCOr7t2F/uaQKKcyqqstqLZc6vPwI/rcE9oDHugY5QEjQzIBIEaTnN6P0vege2IX +eCOr7t2F/uaQKKcyqqstqLZc6vPwI/rcE9oDHugY5QEjQzIBIEaTnN6P0vege2IX +YEvTWbWwGdPytDFPYIl3/6OqNSXSnZ7DxPcdLJq2uyiga8PB/TTIIHYkdM2+1DE0 +7y3rH/7TjwDVD7SLu5/SdOfKskuMPTjOEvz3K161mymW06klVhubCIWOro/Gx1Q2 +2FQOZ7/2k4uYoOdBTSlb8kTAuzZNgIE0rB2BIYCTz/P6zZIKW0ogbRSH +-----END CERTIFICATE-----` + +var megaLeaf = `-----BEGIN CERTIFICATE----- +MIIFOjCCBCKgAwIBAgIQWYE8Dup170kZ+k11Lg51OjANBgkqhkiG9w0BAQUFADBy +MQswCQYDVQQGEwJHQjEbMBkGA1UECBMSR3JlYXRlciBNYW5jaGVzdGVyMRAwDgYD +VQQHEwdTYWxmb3JkMRowGAYDVQQKExFDT01PRE8gQ0EgTGltaXRlZDEYMBYGA1UE +AxMPRXNzZW50aWFsU1NMIENBMB4XDTEyMTIxNDAwMDAwMFoXDTE0MTIxNDIzNTk1 +OVowfzEhMB8GA1UECxMYRG9tYWluIENvbnRyb2wgVmFsaWRhdGVkMS4wLAYDVQQL +EyVIb3N0ZWQgYnkgSW5zdHJhIENvcnBvcmF0aW9uIFB0eS4gTFREMRUwEwYDVQQL +EwxFc3NlbnRpYWxTU0wxEzARBgNVBAMTCm1lZ2EuY28ubnowggEiMA0GCSqGSIb3 +DQEBAQUAA4IBDwAwggEKAoIBAQDcxMCClae8BQIaJHBUIVttlLvhbK4XhXPk3RQ3 +G5XA6tLZMBQ33l3F9knYJ0YErXtr8IdfYoulRQFmKFMJl9GtWyg4cGQi2Rcr5VN5 +S5dA1vu4oyJBxE9fPELcK6Yz1vqaf+n6za+mYTiQYKggVdS8/s8hmNuXP9Zk1pIn ++q0pGsf8NAcSHMJgLqPQrTDw+zae4V03DvcYfNKjuno88d2226ld7MAmQZ7uRNsI +/CnkdelVs+akZsXf0szefSqMJlf08SY32t2jj4Ra7RApVYxOftD9nij/aLfuqOU6 +ow6IgIcIG2ZvXLZwK87c5fxL7UAsTTV+M1sVv8jA33V2oKLhAgMBAAGjggG9MIIB +uTAfBgNVHSMEGDAWgBTay+qtWwhdzP/8JlTOSeVVxjj0+DAdBgNVHQ4EFgQUmP9l +6zhyrZ06Qj4zogt+6LKFk4AwDgYDVR0PAQH/BAQDAgWgMAwGA1UdEwEB/wQCMAAw +NAYDVR0lBC0wKwYIKwYBBQUHAwEGCCsGAQUFBwMCBgorBgEEAYI3CgMDBglghkgB +hvhCBAEwTwYDVR0gBEgwRjA6BgsrBgEEAbIxAQICBzArMCkGCCsGAQUFBwIBFh1o +dHRwczovL3NlY3VyZS5jb21vZG8uY29tL0NQUzAIBgZngQwBAgEwOwYDVR0fBDQw +MjAwoC6gLIYqaHR0cDovL2NybC5jb21vZG9jYS5jb20vRXNzZW50aWFsU1NMQ0Eu +Y3JsMG4GCCsGAQUFBwEBBGIwYDA4BggrBgEFBQcwAoYsaHR0cDovL2NydC5jb21v +ZG9jYS5jb20vRXNzZW50aWFsU1NMQ0FfMi5jcnQwJAYIKwYBBQUHMAGGGGh0dHA6 +Ly9vY3NwLmNvbW9kb2NhLmNvbTAlBgNVHREEHjAcggptZWdhLmNvLm56gg53d3cu +bWVnYS5jby5uejANBgkqhkiG9w0BAQUFAAOCAQEAcYhrsPSvDuwihMOh0ZmRpbOE +Gw6LqKgLNTmaYUPQhzi2cyIjhUhNvugXQQlP5f0lp5j8cixmArafg1dTn4kQGgD3 +ivtuhBTgKO1VYB/VRoAt6Lmswg3YqyiS7JiLDZxjoV7KoS5xdiaINfHDUaBBY4ZH +j2BUlPniNBjCqXe/HndUTVUewlxbVps9FyCmH+C4o9DWzdGBzDpCkcmo5nM+cp7q +ZhTIFTvZfo3zGuBoyu8BzuopCJcFRm3cRiXkpI7iOMUIixO1szkJS6WpL1sKdT73 +UXp08U0LBqoqG130FbzEJBBV3ixbvY6BWMHoCWuaoF12KJnC5kHt2RoWAAgMXA== +-----END CERTIFICATE-----` + +var comodoIntermediate1 = `-----BEGIN CERTIFICATE----- +MIIFAzCCA+ugAwIBAgIQGLLLuqME8aAPwfLzJkYqSjANBgkqhkiG9w0BAQUFADCB +gTELMAkGA1UEBhMCR0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4G +A1UEBxMHU2FsZm9yZDEaMBgGA1UEChMRQ09NT0RPIENBIExpbWl0ZWQxJzAlBgNV +BAMTHkNPTU9ETyBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0wNjEyMDEwMDAw +MDBaFw0xOTEyMzEyMzU5NTlaMHIxCzAJBgNVBAYTAkdCMRswGQYDVQQIExJHcmVh +dGVyIE1hbmNoZXN0ZXIxEDAOBgNVBAcTB1NhbGZvcmQxGjAYBgNVBAoTEUNPTU9E +TyBDQSBMaW1pdGVkMRgwFgYDVQQDEw9Fc3NlbnRpYWxTU0wgQ0EwggEiMA0GCSqG +SIb3DQEBAQUAA4IBDwAwggEKAoIBAQCt8AiwcsargxIxF3CJhakgEtSYau2A1NHf +5I5ZLdOWIY120j8YC0YZYwvHIPPlC92AGvFaoL0dds23Izp0XmEbdaqb1IX04XiR +0y3hr/yYLgbSeT1awB8hLRyuIVPGOqchfr7tZ291HRqfalsGs2rjsQuqag7nbWzD +ypWMN84hHzWQfdvaGlyoiBSyD8gSIF/F03/o4Tjg27z5H6Gq1huQByH6RSRQXScq +oChBRVt9vKCiL6qbfltTxfEFFld+Edc7tNkBdtzffRDPUanlOPJ7FAB1WfnwWdsX +Pvev5gItpHnBXaIcw5rIp6gLSApqLn8tl2X2xQScRMiZln5+pN0vAgMBAAGjggGD +MIIBfzAfBgNVHSMEGDAWgBQLWOWLxkwVN6RAqTCpIb5HNlpW/zAdBgNVHQ4EFgQU +2svqrVsIXcz//CZUzknlVcY49PgwDgYDVR0PAQH/BAQDAgEGMBIGA1UdEwEB/wQI +MAYBAf8CAQAwIAYDVR0lBBkwFwYKKwYBBAGCNwoDAwYJYIZIAYb4QgQBMD4GA1Ud +IAQ3MDUwMwYEVR0gADArMCkGCCsGAQUFBwIBFh1odHRwczovL3NlY3VyZS5jb21v +ZG8uY29tL0NQUzBJBgNVHR8EQjBAMD6gPKA6hjhodHRwOi8vY3JsLmNvbW9kb2Nh +LmNvbS9DT01PRE9DZXJ0aWZpY2F0aW9uQXV0aG9yaXR5LmNybDBsBggrBgEFBQcB +AQRgMF4wNgYIKwYBBQUHMAKGKmh0dHA6Ly9jcnQuY29tb2RvY2EuY29tL0NvbW9k +b1VUTlNHQ0NBLmNydDAkBggrBgEFBQcwAYYYaHR0cDovL29jc3AuY29tb2RvY2Eu +Y29tMA0GCSqGSIb3DQEBBQUAA4IBAQAtlzR6QDLqcJcvgTtLeRJ3rvuq1xqo2l/z +odueTZbLN3qo6u6bldudu+Ennv1F7Q5Slqz0J790qpL0pcRDAB8OtXj5isWMcL2a +ejGjKdBZa0wztSz4iw+SY1dWrCRnilsvKcKxudokxeRiDn55w/65g+onO7wdQ7Vu +F6r7yJiIatnyfKH2cboZT7g440LX8NqxwCPf3dfxp+0Jj1agq8MLy6SSgIGSH6lv ++Wwz3D5XxqfyH8wqfOQsTEZf6/Nh9yvENZ+NWPU6g0QO2JOsTGvMd/QDzczc4BxL +XSXaPV7Od4rhPsbXlM1wSTz/Dr0ISKvlUhQVnQ6cGodWaK2cCQBk +-----END CERTIFICATE-----` + +var comodoRoot = `-----BEGIN CERTIFICATE----- +MIIEHTCCAwWgAwIBAgIQToEtioJl4AsC7j41AkblPTANBgkqhkiG9w0BAQUFADCB +gTELMAkGA1UEBhMCR0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4G +A1UEBxMHU2FsZm9yZDEaMBgGA1UEChMRQ09NT0RPIENBIExpbWl0ZWQxJzAlBgNV +BAMTHkNPTU9ETyBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0wNjEyMDEwMDAw +MDBaFw0yOTEyMzEyMzU5NTlaMIGBMQswCQYDVQQGEwJHQjEbMBkGA1UECBMSR3Jl +YXRlciBNYW5jaGVzdGVyMRAwDgYDVQQHEwdTYWxmb3JkMRowGAYDVQQKExFDT01P +RE8gQ0EgTGltaXRlZDEnMCUGA1UEAxMeQ09NT0RPIENlcnRpZmljYXRpb24gQXV0 +aG9yaXR5MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA0ECLi3LjkRv3 +UcEbVASY06m/weaKXTuH+7uIzg3jLz8GlvCiKVCZrts7oVewdFFxze1CkU1B/qnI +2GqGd0S7WWaXUF601CxwRM/aN5VCaTwwxHGzUvAhTaHYujl8HJ6jJJ3ygxaYqhZ8 +Q5sVW7euNJH+1GImGEaaP+vB+fGQV+useg2L23IwambV4EajcNxo2f8ESIl33rXp ++2dtQem8Ob0y2WIC8bGoPW43nOIv4tOiJovGuFVDiOEjPqXSJDlqR6sA1KGzqSX+ +DT+nHbrTUcELpNqsOO9VUCQFZUaTNE8tja3G1CEZ0o7KBWFxB3NH5YoZEr0ETc5O +nKVIrLsm9wIDAQABo4GOMIGLMB0GA1UdDgQWBBQLWOWLxkwVN6RAqTCpIb5HNlpW +/zAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zBJBgNVHR8EQjBAMD6g +PKA6hjhodHRwOi8vY3JsLmNvbW9kb2NhLmNvbS9DT01PRE9DZXJ0aWZpY2F0aW9u +QXV0aG9yaXR5LmNybDANBgkqhkiG9w0BAQUFAAOCAQEAPpiem/Yb6dc5t3iuHXIY +SdOH5EOC6z/JqvWote9VfCFSZfnVDeFs9D6Mk3ORLgLETgdxb8CPOGEIqB6BCsAv +IC9Bi5HcSEW88cbeunZrM8gALTFGTO3nnc+IlP8zwFboJIYmuNg4ON8qa90SzMc/ +RxdMosIGlgnW2/4/PEZB31jiVg88O8EckzXZOFKs7sjsLjBOlDW0JB9LeGna8gI4 +zJVSk/BwJVmcIGfE7vmLV2H0knZ9P4SNVbfo5azV8fUZVqZa+5Acr5Pr5RzUZ5dd +BA6+C4OmF4O5MBKgxTMVBbkN+8cFduPYSo38NBejxiEovjBFMR7HeL5YYTisO+IB +ZQ== +-----END CERTIFICATE-----` + +var nameConstraintsLeaf = `-----BEGIN CERTIFICATE----- +MIIHMTCCBRmgAwIBAgIIIZaV/3ezOJkwDQYJKoZIhvcNAQEFBQAwgcsxCzAJBgNV +BAYTAlVTMREwDwYDVQQIEwhWaXJnaW5pYTETMBEGA1UEBxMKQmxhY2tzYnVyZzEj +MCEGA1UECxMaR2xvYmFsIFF1YWxpZmllZCBTZXJ2ZXIgQ0ExPDA6BgNVBAoTM1Zp +cmdpbmlhIFBvbHl0ZWNobmljIEluc3RpdHV0ZSBhbmQgU3RhdGUgVW5pdmVyc2l0 +eTExMC8GA1UEAxMoVmlyZ2luaWEgVGVjaCBHbG9iYWwgUXVhbGlmaWVkIFNlcnZl +ciBDQTAeFw0xMzA5MTkxNDM2NTVaFw0xNTA5MTkxNDM2NTVaMIHNMQswCQYDVQQG +EwJVUzERMA8GA1UECAwIVmlyZ2luaWExEzARBgNVBAcMCkJsYWNrc2J1cmcxPDA6 +BgNVBAoMM1ZpcmdpbmlhIFBvbHl0ZWNobmljIEluc3RpdHV0ZSBhbmQgU3RhdGUg +VW5pdmVyc2l0eTE7MDkGA1UECwwyVGVjaG5vbG9neS1lbmhhbmNlZCBMZWFybmlu +ZyBhbmQgT25saW5lIFN0cmF0ZWdpZXMxGzAZBgNVBAMMEnNlY3VyZS5pZGRsLnZ0 +LmVkdTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKkOyPpsOK/6IuPG +WnIBlVwlHzeYf+cUlggqkLq0b0+vZbiTXgio9/VCuNQ8opSoss7J7o3ygV9to+9Y +YwJKVC5WDT/y5JWpQey0CWILymViJnpNSwnxBc8A+Q8w5NUGDd/UhtPx/U8/hqbd +WPDYj2hbOqyq8UlRhfS5pwtnv6BbCTaY11I6FhCLK7zttISyTuWCf9p9o/ggiipP +ii/5oh4dkl+r5SfuSp5GPNHlYO8lWqys5NAPoDD4fc/kuflcK7Exx7XJ+Oqu0W0/ +psjEY/tES1ZgDWU/ParcxxFpFmKHbD5DXsfPOObzkVWXIY6tGMutSlE1Froy/Nn0 +OZsAOrcCAwEAAaOCAhMwggIPMIG4BggrBgEFBQcBAQSBqzCBqDBYBggrBgEFBQcw +AoZMaHR0cDovL3d3dy5wa2kudnQuZWR1L2dsb2JhbHF1YWxpZmllZHNlcnZlci9j +YWNlcnQvZ2xvYmFscXVhbGlmaWVkc2VydmVyLmNydDBMBggrBgEFBQcwAYZAaHR0 +cDovL3Z0Y2EtcC5lcHJvdi5zZXRpLnZ0LmVkdTo4MDgwL2VqYmNhL3B1YmxpY3dl +Yi9zdGF0dXMvb2NzcDAdBgNVHQ4EFgQUp7xbO6iHkvtZbPE4jmndmnAbSEcwDAYD +VR0TAQH/BAIwADAfBgNVHSMEGDAWgBS8YmAn1eM1SBfpS6tFatDIqHdxjDBqBgNV +HSAEYzBhMA4GDCsGAQQBtGgFAgICATAOBgwrBgEEAbRoBQICAQEwPwYMKwYBBAG0 +aAUCAgMBMC8wLQYIKwYBBQUHAgEWIWh0dHA6Ly93d3cucGtpLnZ0LmVkdS9nbG9i +YWwvY3BzLzBKBgNVHR8EQzBBMD+gPaA7hjlodHRwOi8vd3d3LnBraS52dC5lZHUv +Z2xvYmFscXVhbGlmaWVkc2VydmVyL2NybC9jYWNybC5jcmwwDgYDVR0PAQH/BAQD +AgTwMB0GA1UdJQQWMBQGCCsGAQUFBwMBBggrBgEFBQcDAjAdBgNVHREEFjAUghJz +ZWN1cmUuaWRkbC52dC5lZHUwDQYJKoZIhvcNAQEFBQADggIBAEgoYo4aUtatY3gI +OyyKp7QlIOaLbTJZywESHqy+L5EGDdJW2DJV+mcE0LDGvqa2/1Lo+AR1ntsZwfOi +Y718JwgVVaX/RCd5+QKP25c5/x72xI8hb/L1bgS0ED9b0YAhd7Qm1K1ot82+6mqX +DW6WiGeDr8Z07MQ3143qQe2rBlq+QI69DYzm2GOqAIAnUIWv7tCyLUm31b4DwmrJ +TeudVreTKUbBNB1TWRFHEPkWhjjXKZnNGRO11wHXcyBu6YekIvVZ+vmx8ePee4jJ +3GFOi7lMuWOeq57jTVL7KOKaKLVXBb6gqo5aq+Wwt8RUD5MakrCAEeQZj7DKaFmZ +oQCO0Pxrsl3InCGvxnGzT+bFVO9nJ/BAMj7hknFdm9Jr6Bg5q33Z+gnf909AD9QF +ESqUSykaHu2LVdJx2MaCH1CyKnRgMw5tEwE15EXpUjCm24m8FMOYC+rNtf18pgrz +5D8Jhh+oxK9PjcBYqXNtnioIxiMCYcV0q5d4w4BYFEh71tk7/bYB0R55CsBUVPmp +timWNOdRd57Tfpk3USaVsumWZAf9MP3wPiC7gb4d5tYEEAG5BuDT8ruFw838wU8G +1VvAVutSiYBg7k3NYO7AUqZ+Ax4klQX3aM9lgonmJ78Qt94UPtbptrfZ4/lSqEf8 +GBUwDrQNTb+gsXsDkjd5lcYxNx6l +-----END CERTIFICATE-----` + +var nameConstraintsIntermediate1 = `-----BEGIN CERTIFICATE----- +MIINLjCCDBagAwIBAgIRIqpyf/YoGgvHc8HiDAxAI8owDQYJKoZIhvcNAQEFBQAw +XDELMAkGA1UEBhMCQkUxFTATBgNVBAsTDFRydXN0ZWQgUm9vdDEZMBcGA1UEChMQ +R2xvYmFsU2lnbiBudi1zYTEbMBkGA1UEAxMSVHJ1c3RlZCBSb290IENBIEcyMB4X +DTEyMTIxMzAwMDAwMFoXDTE3MTIxMzAwMDAwMFowgcsxCzAJBgNVBAYTAlVTMREw +DwYDVQQIEwhWaXJnaW5pYTETMBEGA1UEBxMKQmxhY2tzYnVyZzEjMCEGA1UECxMa +R2xvYmFsIFF1YWxpZmllZCBTZXJ2ZXIgQ0ExPDA6BgNVBAoTM1ZpcmdpbmlhIFBv +bHl0ZWNobmljIEluc3RpdHV0ZSBhbmQgU3RhdGUgVW5pdmVyc2l0eTExMC8GA1UE +AxMoVmlyZ2luaWEgVGVjaCBHbG9iYWwgUXVhbGlmaWVkIFNlcnZlciBDQTCCAiIw +DQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBALgIZhEaptBWADBqdJ45ueFGzMXa +GHnzNxoxR1fQIaaRQNdCg4cw3A4dWKMeEgYLtsp65ai3Xfw62Qaus0+KJ3RhgV+r +ihqK81NUzkls78fJlADVDI4fCTlothsrE1CTOMiy97jKHai5mVTiWxmcxpmjv7fm +5Nhc+uHgh2hIz6npryq495mD51ZrUTIaqAQN6Pw/VHfAmR524vgriTOjtp1t4lA9 +pXGWjF/vkhAKFFheOQSQ00rngo2wHgCqMla64UTN0oz70AsCYNZ3jDLx0kOP0YmM +R3Ih91VA63kLqPXA0R6yxmmhhxLZ5bcyAy1SLjr1N302MIxLM/pSy6aquEnbELhz +qyp9yGgRyGJay96QH7c4RJY6gtcoPDbldDcHI9nXngdAL4DrZkJ9OkDkJLyqG66W +ZTF5q4EIs6yMdrywz0x7QP+OXPJrjYpbeFs6tGZCFnWPFfmHCRJF8/unofYrheq+ +9J7Jx3U55S/k57NXbAM1RAJOuMTlfn9Etf9Dpoac9poI4Liav6rBoUQk3N3JWqnV +HNx/NdCyJ1/6UbKMJUZsStAVglsi6lVPo289HHOE4f7iwl3SyekizVOp01wUin3y +cnbZB/rXmZbwapSxTTSBf0EIOr9i4EGfnnhCAVA9U5uLrI5OEB69IY8PNX0071s3 +Z2a2fio5c8m3JkdrAgMBAAGjggh5MIIIdTAOBgNVHQ8BAf8EBAMCAQYwTAYDVR0g +BEUwQzBBBgkrBgEEAaAyATwwNDAyBggrBgEFBQcCARYmaHR0cHM6Ly93d3cuZ2xv +YmFsc2lnbi5jb20vcmVwb3NpdG9yeS8wEgYDVR0TAQH/BAgwBgEB/wIBADCCBtAG +A1UdHgSCBscwggbDoIIGvzASghAzZGJsYWNrc2J1cmcub3JnMBiCFmFjY2VsZXJh +dGV2aXJnaW5pYS5jb20wGIIWYWNjZWxlcmF0ZXZpcmdpbmlhLm9yZzALgglhY3Zj +cC5vcmcwCYIHYmV2Lm5ldDAJggdiZXYub3JnMAuCCWNsaWdzLm9yZzAMggpjbWl3 +ZWIub3JnMBeCFWVhc3Rlcm5icm9va3Ryb3V0Lm5ldDAXghVlYXN0ZXJuYnJvb2t0 +cm91dC5vcmcwEYIPZWNvcnJpZG9ycy5pbmZvMBOCEWVkZ2FycmVzZWFyY2gub3Jn +MBKCEGdldC1lZHVjYXRlZC5jb20wE4IRZ2V0LWVkdWNhdGVkLmluZm8wEYIPZ2V0 +ZWR1Y2F0ZWQubmV0MBKCEGdldC1lZHVjYXRlZC5uZXQwEYIPZ2V0ZWR1Y2F0ZWQu +b3JnMBKCEGdldC1lZHVjYXRlZC5vcmcwD4INaG9raWVjbHViLmNvbTAQgg5ob2tp +ZXBob3RvLmNvbTAPgg1ob2tpZXNob3AuY29tMBGCD2hva2llc3BvcnRzLmNvbTAS +ghBob2tpZXRpY2tldHMuY29tMBKCEGhvdGVscm9hbm9rZS5jb20wE4IRaHVtYW53 +aWxkbGlmZS5vcmcwF4IVaW5uYXR2aXJnaW5pYXRlY2guY29tMA+CDWlzY2hwMjAx +MS5vcmcwD4INbGFuZHJlaGFiLm9yZzAggh5uYXRpb25hbHRpcmVyZXNlYXJjaGNl +bnRlci5jb20wFYITbmV0d29ya3ZpcmdpbmlhLm5ldDAMggpwZHJjdnQuY29tMBiC +FnBldGVkeWVyaXZlcmNvdXJzZS5jb20wDYILcmFkaW9pcS5vcmcwFYITcml2ZXJj +b3Vyc2Vnb2xmLmNvbTALgglzZGltaS5vcmcwEIIOc292YW1vdGlvbi5jb20wHoIc +c3VzdGFpbmFibGUtYmlvbWF0ZXJpYWxzLmNvbTAeghxzdXN0YWluYWJsZS1iaW9t +YXRlcmlhbHMub3JnMBWCE3RoaXNpc3RoZWZ1dHVyZS5jb20wGIIWdGhpcy1pcy10 +aGUtZnV0dXJlLmNvbTAVghN0aGlzaXN0aGVmdXR1cmUubmV0MBiCFnRoaXMtaXMt +dGhlLWZ1dHVyZS5uZXQwCoIIdmFkcy5vcmcwDIIKdmFsZWFmLm9yZzANggt2YXRl +Y2guaW5mbzANggt2YXRlY2gubW9iaTAcghp2YXRlY2hsaWZlbG9uZ2xlYXJuaW5n +LmNvbTAcghp2YXRlY2hsaWZlbG9uZ2xlYXJuaW5nLm5ldDAcghp2YXRlY2hsaWZl +bG9uZ2xlYXJuaW5nLm9yZzAKggh2Y29tLmVkdTASghB2aXJnaW5pYXZpZXcubmV0 +MDSCMnZpcmdpbmlhcG9seXRlY2huaWNpbnN0aXR1dGVhbmRzdGF0ZXVuaXZlcnNp +dHkuY29tMDWCM3ZpcmdpbmlhcG9seXRlY2huaWNpbnN0aXR1dGVhbmRzdGF0ZXVu +aXZlcnNpdHkuaW5mbzA0gjJ2aXJnaW5pYXBvbHl0ZWNobmljaW5zdGl0dXRlYW5k +c3RhdGV1bml2ZXJzaXR5Lm5ldDA0gjJ2aXJnaW5pYXBvbHl0ZWNobmljaW5zdGl0 +dXRlYW5kc3RhdGV1bml2ZXJzaXR5Lm9yZzAZghd2aXJnaW5pYXB1YmxpY3JhZGlv +Lm9yZzASghB2aXJnaW5pYXRlY2guZWR1MBOCEXZpcmdpbmlhdGVjaC5tb2JpMByC +GnZpcmdpbmlhdGVjaGZvdW5kYXRpb24ub3JnMAiCBnZ0LmVkdTALggl2dGFyYy5v +cmcwDIIKdnQtYXJjLm9yZzALggl2dGNyYy5jb20wCoIIdnRpcC5vcmcwDIIKdnRs +ZWFuLm9yZzAWghR2dGtub3dsZWRnZXdvcmtzLmNvbTAYghZ2dGxpZmVsb25nbGVh +cm5pbmcuY29tMBiCFnZ0bGlmZWxvbmdsZWFybmluZy5uZXQwGIIWdnRsaWZlbG9u +Z2xlYXJuaW5nLm9yZzATghF2dHNwb3J0c21lZGlhLmNvbTALggl2dHdlaS5jb20w +D4INd2l3YXR3ZXJjLmNvbTAKggh3dnRmLm9yZzAIgQZ2dC5lZHUwd6R1MHMxCzAJ +BgNVBAYTAlVTMREwDwYDVQQIEwhWaXJnaW5pYTETMBEGA1UEBxMKQmxhY2tzYnVy +ZzE8MDoGA1UEChMzVmlyZ2luaWEgUG9seXRlY2huaWMgSW5zdGl0dXRlIGFuZCBT +dGF0ZSBVbml2ZXJzaXR5MCcGA1UdJQQgMB4GCCsGAQUFBwMCBggrBgEFBQcDAQYI +KwYBBQUHAwkwPQYDVR0fBDYwNDAyoDCgLoYsaHR0cDovL2NybC5nbG9iYWxzaWdu +LmNvbS9ncy90cnVzdHJvb3RnMi5jcmwwgYQGCCsGAQUFBwEBBHgwdjAzBggrBgEF +BQcwAYYnaHR0cDovL29jc3AyLmdsb2JhbHNpZ24uY29tL3RydXN0cm9vdGcyMD8G +CCsGAQUFBzAChjNodHRwOi8vc2VjdXJlLmdsb2JhbHNpZ24uY29tL2NhY2VydC90 +cnVzdHJvb3RnMi5jcnQwHQYDVR0OBBYEFLxiYCfV4zVIF+lLq0Vq0Miod3GMMB8G +A1UdIwQYMBaAFBT25YsxtkWASkxt/MKHico2w5BiMA0GCSqGSIb3DQEBBQUAA4IB +AQAyJm/lOB2Er4tHXhc/+fSufSzgjohJgYfMkvG4LknkvnZ1BjliefR8tTXX49d2 +SCDFWfGjqyJZwavavkl/4p3oXPG/nAMDMvxh4YAT+CfEK9HH+6ICV087kD4BLegi ++aFJMj8MMdReWCzn5sLnSR1rdse2mo2arX3Uod14SW+PGrbUmTuWNyvRbz3fVmxp +UdbGmj3laknO9YPsBGgHfv73pVVsTJkW4ZfY/7KdD/yaVv6ophpOB3coXfjl2+kd +Z4ypn2zK+cx9IL/LSewqd/7W9cD55PCUy4X9OTbEmAccwiz3LB66mQoUGfdHdkoB +jUY+v9vLQXmaVwI0AYL7g9LN +-----END CERTIFICATE-----` + +var nameConstraintsIntermediate2 = `-----BEGIN CERTIFICATE----- +MIIEXTCCA0WgAwIBAgILBAAAAAABNuk6OrMwDQYJKoZIhvcNAQEFBQAwVzELMAkG +A1UEBhMCQkUxGTAXBgNVBAoTEEdsb2JhbFNpZ24gbnYtc2ExEDAOBgNVBAsTB1Jv +b3QgQ0ExGzAZBgNVBAMTEkdsb2JhbFNpZ24gUm9vdCBDQTAeFw0xMjA0MjUxMTAw +MDBaFw0yNzA0MjUxMTAwMDBaMFwxCzAJBgNVBAYTAkJFMRUwEwYDVQQLEwxUcnVz +dGVkIFJvb3QxGTAXBgNVBAoTEEdsb2JhbFNpZ24gbnYtc2ExGzAZBgNVBAMTElRy +dXN0ZWQgUm9vdCBDQSBHMjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB +AKyuvqrtcMr7g7EuNbu4sKwxM127UsCmx1RxbxxgcArGS7rjiefpBH/w4LYrymjf +vcw1ueyMNoqLo9nJMz/ORXupb35NNfE667prQYHa+tTjl1IiKpB7QUwt3wXPuTMF +Ja1tXtjKzkqJyuJlNuPKT76HcjgNqgV1s9qG44MD5I2JvI12du8zI1bgdQ+l/KsX +kTfbGjUvhOLOlVNWVQDpL+YMIrGqgBYxy5TUNgrAcRtwpNdS2KkF5otSmMweVb5k +hoUVv3u8UxQH/WWbNhHq1RrIlg/0rBUfi/ziShYFSB7U+aLx5DxPphTFBiDquQGp +tB+FC4JvnukDStFihZCZ1R8CAwEAAaOCASMwggEfMA4GA1UdDwEB/wQEAwIBBjAP +BgNVHRMBAf8EBTADAQH/MEcGA1UdIARAMD4wPAYEVR0gADA0MDIGCCsGAQUFBwIB +FiZodHRwczovL3d3dy5nbG9iYWxzaWduLmNvbS9yZXBvc2l0b3J5LzAdBgNVHQ4E +FgQUFPblizG2RYBKTG38woeJyjbDkGIwMwYDVR0fBCwwKjAooCagJIYiaHR0cDov +L2NybC5nbG9iYWxzaWduLm5ldC9yb290LmNybDA+BggrBgEFBQcBAQQyMDAwLgYI +KwYBBQUHMAGGImh0dHA6Ly9vY3NwMi5nbG9iYWxzaWduLmNvbS9yb290cjEwHwYD +VR0jBBgwFoAUYHtmGkUNl8qJUC99BM00qP/8/UswDQYJKoZIhvcNAQEFBQADggEB +AL7IG0l+k4LkcpI+a/kvZsSRwSM4uA6zGX34e78A2oytr8RG8bJwVb8+AHMUD+Xe +2kYdh/Uj/waQXfqR0OgxQXL9Ct4ZM+JlR1avsNKXWL5AwYXAXCOB3J5PW2XOck7H +Zw0vRbGQhjWjQx+B4KOUFg1b3ov/z6Xkr3yaCfRQhXh7KC0Bc0RXPPG5Nv5lCW+z +tbbg0zMm3kyfQITRusMSg6IBsDJqOnjaiaKQRcXiD0Sk43ZXb2bUKMxC7+Td3QL4 +RyHcWJbQ7YylLTS/x+jxWIcOQ0oO5/54t5PTQ14neYhOz9x4gUk2AYAW6d1vePwb +hcC8roQwkHT7HvfYBoc74FM= +-----END CERTIFICATE-----` + +var globalSignRoot = `-----BEGIN CERTIFICATE----- +MIIDdTCCAl2gAwIBAgILBAAAAAABFUtaw5QwDQYJKoZIhvcNAQEFBQAwVzELMAkG +A1UEBhMCQkUxGTAXBgNVBAoTEEdsb2JhbFNpZ24gbnYtc2ExEDAOBgNVBAsTB1Jv +b3QgQ0ExGzAZBgNVBAMTEkdsb2JhbFNpZ24gUm9vdCBDQTAeFw05ODA5MDExMjAw +MDBaFw0yODAxMjgxMjAwMDBaMFcxCzAJBgNVBAYTAkJFMRkwFwYDVQQKExBHbG9i +YWxTaWduIG52LXNhMRAwDgYDVQQLEwdSb290IENBMRswGQYDVQQDExJHbG9iYWxT +aWduIFJvb3QgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDaDuaZ +jc6j40+Kfvvxi4Mla+pIH/EqsLmVEQS98GPR4mdmzxzdzxtIK+6NiY6arymAZavp +xy0Sy6scTHAHoT0KMM0VjU/43dSMUBUc71DuxC73/OlS8pF94G3VNTCOXkNz8kHp +1Wrjsok6Vjk4bwY8iGlbKk3Fp1S4bInMm/k8yuX9ifUSPJJ4ltbcdG6TRGHRjcdG +snUOhugZitVtbNV4FpWi6cgKOOvyJBNPc1STE4U6G7weNLWLBYy5d4ux2x8gkasJ +U26Qzns3dLlwR5EiUWMWea6xrkEmCMgZK9FGqkjWZCrXgzT/LCrBbBlDSgeF59N8 +9iFo7+ryUp9/k5DPAgMBAAGjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8E +BTADAQH/MB0GA1UdDgQWBBRge2YaRQ2XyolQL30EzTSo//z9SzANBgkqhkiG9w0B +AQUFAAOCAQEA1nPnfE920I2/7LqivjTFKDK1fPxsnCwrvQmeU79rXqoRSLblCKOz +yj1hTdNGCbM+w6DjY1Ub8rrvrTnhQ7k4o+YviiY776BQVvnGCv04zcQLcFGUl5gE +38NflNUVyRRBnMRddWQVDf9VMOyGj/8N7yy5Y0b2qvzfvGn9LhJIZJrglfCm7ymP +AbEVtQwdpf5pLGkkeB6zpxxxYu7KyJesF12KwvhHhm4qxFYxldBniYUr+WymXUad +DKqC5JlR3XC321Y9YeRq4VzW9v493kHMB65jUr9TU/Qr6cf9tveCX4XSQRjbgbME +HMUfpIBvFSDJ3gyICh3WZlXi/EjJKSZp4A== +-----END CERTIFICATE-----` + +var moipLeafCert = `-----BEGIN CERTIFICATE----- +MIIGQDCCBSigAwIBAgIRAPe/cwh7CUWizo8mYSDavLIwDQYJKoZIhvcNAQELBQAw +gZIxCzAJBgNVBAYTAkdCMRswGQYDVQQIExJHcmVhdGVyIE1hbmNoZXN0ZXIxEDAO +BgNVBAcTB1NhbGZvcmQxGjAYBgNVBAoTEUNPTU9ETyBDQSBMaW1pdGVkMTgwNgYD +VQQDEy9DT01PRE8gUlNBIEV4dGVuZGVkIFZhbGlkYXRpb24gU2VjdXJlIFNlcnZl +ciBDQTAeFw0xMzA4MTUwMDAwMDBaFw0xNDA4MTUyMzU5NTlaMIIBQjEXMBUGA1UE +BRMOMDg3MTg0MzEwMDAxMDgxEzARBgsrBgEEAYI3PAIBAxMCQlIxGjAYBgsrBgEE +AYI3PAIBAhMJU2FvIFBhdWxvMR0wGwYDVQQPExRQcml2YXRlIE9yZ2FuaXphdGlv +bjELMAkGA1UEBhMCQlIxETAPBgNVBBETCDAxNDUyMDAwMRIwEAYDVQQIEwlTYW8g +UGF1bG8xEjAQBgNVBAcTCVNhbyBQYXVsbzEtMCsGA1UECRMkQXZlbmlkYSBCcmln +YWRlaXJvIEZhcmlhIExpbWEgLCAyOTI3MR0wGwYDVQQKExRNb2lwIFBhZ2FtZW50 +b3MgUy5BLjENMAsGA1UECxMETU9JUDEYMBYGA1UECxMPU1NMIEJsaW5kYWRvIEVW +MRgwFgYDVQQDEw9hcGkubW9pcC5jb20uYnIwggEiMA0GCSqGSIb3DQEBAQUAA4IB +DwAwggEKAoIBAQDN0b9x6TrXXA9hPCF8/NjqGJ++2D4LO4ZiMFTjs0VwpXy2Y1Oe +s74/HuiLGnAHxTmAtV7IpZMibiOcTxcnDYp9oEWkf+gR+hZvwFZwyOBC7wyb3SR3 +UvV0N1ZbEVRYpN9kuX/3vjDghjDmzzBwu8a/T+y5JTym5uiJlngVAWyh/RjtIvYi ++NVkQMbyVlPGkoCe6c30pH8DKYuUCZU6DHjUsPTX3jAskqbhDSAnclX9iX0p2bmw +KVBc+5Vh/2geyzDuquF0w+mNIYdU5h7uXvlmJnf3d2Cext5dxdL8/jezD3U0dAqI +pYSKERbyxSkJWxdvRlhdpM9YXMJcpc88xNp1AgMBAAGjggHcMIIB2DAfBgNVHSME +GDAWgBQ52v/KKBSKqHQTCLnkDqnS+n6daTAdBgNVHQ4EFgQU/lXuOa7DMExzZjRj +LQWcMWGZY7swDgYDVR0PAQH/BAQDAgWgMAwGA1UdEwEB/wQCMAAwHQYDVR0lBBYw +FAYIKwYBBQUHAwEGCCsGAQUFBwMCMEYGA1UdIAQ/MD0wOwYMKwYBBAGyMQECAQUB +MCswKQYIKwYBBQUHAgEWHWh0dHBzOi8vc2VjdXJlLmNvbW9kby5jb20vQ1BTMFYG +A1UdHwRPME0wS6BJoEeGRWh0dHA6Ly9jcmwuY29tb2RvY2EuY29tL0NPTU9ET1JT +QUV4dGVuZGVkVmFsaWRhdGlvblNlY3VyZVNlcnZlckNBLmNybDCBhwYIKwYBBQUH +AQEEezB5MFEGCCsGAQUFBzAChkVodHRwOi8vY3J0LmNvbW9kb2NhLmNvbS9DT01P +RE9SU0FFeHRlbmRlZFZhbGlkYXRpb25TZWN1cmVTZXJ2ZXJDQS5jcnQwJAYIKwYB +BQUHMAGGGGh0dHA6Ly9vY3NwLmNvbW9kb2NhLmNvbTAvBgNVHREEKDAmgg9hcGku +bW9pcC5jb20uYnKCE3d3dy5hcGkubW9pcC5jb20uYnIwDQYJKoZIhvcNAQELBQAD +ggEBAFoTmPlaDcf+nudhjXHwud8g7/LRyA8ucb+3/vfmgbn7FUc1eprF5sJS1mA+ +pbiTyXw4IxcJq2KUj0Nw3IPOe9k84mzh+XMmdCKH+QK3NWkE9Udz+VpBOBc0dlqC +1RH5umStYDmuZg/8/r652eeQ5kUDcJyADfpKWBgDPYaGtwzKVT4h3Aok9SLXRHx6 +z/gOaMjEDMarMCMw4VUIG1pvNraZrG5oTaALPaIXXpd8VqbQYPudYJ6fR5eY3FeW +H/ofbYFdRcuD26MfBFWE9VGGral9Fgo8sEHffho+UWhgApuQV4/l5fMzxB5YBXyQ +jhuy8PqqZS9OuLilTeLu4a8z2JI= +-----END CERTIFICATE-----` + +var comodoIntermediateSHA384 = `-----BEGIN CERTIFICATE----- +MIIGDjCCA/agAwIBAgIQBqdDgNTr/tQ1taP34Wq92DANBgkqhkiG9w0BAQwFADCB +hTELMAkGA1UEBhMCR0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4G +A1UEBxMHU2FsZm9yZDEaMBgGA1UEChMRQ09NT0RPIENBIExpbWl0ZWQxKzApBgNV +BAMTIkNPTU9ETyBSU0EgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMTIwMjEy +MDAwMDAwWhcNMjcwMjExMjM1OTU5WjCBkjELMAkGA1UEBhMCR0IxGzAZBgNVBAgT +EkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UEBxMHU2FsZm9yZDEaMBgGA1UEChMR +Q09NT0RPIENBIExpbWl0ZWQxODA2BgNVBAMTL0NPTU9ETyBSU0EgRXh0ZW5kZWQg +VmFsaWRhdGlvbiBTZWN1cmUgU2VydmVyIENBMIIBIjANBgkqhkiG9w0BAQEFAAOC +AQ8AMIIBCgKCAQEAlVbeVLTf1QJJe9FbXKKyHo+cK2JMK40SKPMalaPGEP0p3uGf +CzhAk9HvbpUQ/OGQF3cs7nU+e2PsYZJuTzurgElr3wDqAwB/L3XVKC/sVmePgIOj +vdwDmZOLlJFWW6G4ajo/Br0OksxgnP214J9mMF/b5pTwlWqvyIqvgNnmiDkBfBzA +xSr3e5Wg8narbZtyOTDr0VdVAZ1YEZ18bYSPSeidCfw8/QpKdhQhXBZzQCMZdMO6 +WAqmli7eNuWf0MLw4eDBYuPCGEUZUaoXHugjddTI0JYT/8ck0YwLJ66eetw6YWNg +iJctXQUL5Tvrrs46R3N2qPos3cCHF+msMJn4HwIDAQABo4IBaTCCAWUwHwYDVR0j +BBgwFoAUu69+Aj36pvE8hI6t7jiY7NkyMtQwHQYDVR0OBBYEFDna/8ooFIqodBMI +ueQOqdL6fp1pMA4GA1UdDwEB/wQEAwIBBjASBgNVHRMBAf8ECDAGAQH/AgEAMD4G +A1UdIAQ3MDUwMwYEVR0gADArMCkGCCsGAQUFBwIBFh1odHRwczovL3NlY3VyZS5j +b21vZG8uY29tL0NQUzBMBgNVHR8ERTBDMEGgP6A9hjtodHRwOi8vY3JsLmNvbW9k +b2NhLmNvbS9DT01PRE9SU0FDZXJ0aWZpY2F0aW9uQXV0aG9yaXR5LmNybDBxBggr +BgEFBQcBAQRlMGMwOwYIKwYBBQUHMAKGL2h0dHA6Ly9jcnQuY29tb2RvY2EuY29t +L0NPTU9ET1JTQUFkZFRydXN0Q0EuY3J0MCQGCCsGAQUFBzABhhhodHRwOi8vb2Nz +cC5jb21vZG9jYS5jb20wDQYJKoZIhvcNAQEMBQADggIBAERCnUFRK0iIXZebeV4R +AUpSGXtBLMeJPNBy3IX6WK/VJeQT+FhlZ58N/1eLqYVeyqZLsKeyLeCMIs37/3mk +jCuN/gI9JN6pXV/kD0fQ22YlPodHDK4ixVAihNftSlka9pOlk7DgG4HyVsTIEFPk +1Hax0VtpS3ey4E/EhOfUoFDuPPpE/NBXueEoU/1Tzdy5H3pAvTA/2GzS8+cHnx8i +teoiccsq8FZ8/qyo0QYPFBRSTP5kKwxpKrgNUG4+BAe/eiCL+O5lCeHHSQgyPQ0o +fkkdt0rvAucNgBfIXOBhYsvss2B5JdoaZXOcOBCgJjqwyBZ9kzEi7nQLiMBciUEA +KKlHMd99SUWa9eanRRrSjhMQ34Ovmw2tfn6dNVA0BM7pINae253UqNpktNEvWS5e +ojZh1CSggjMziqHRbO9haKPl0latxf1eYusVqHQSTC8xjOnB3xBLAer2VBvNfzu9 +XJ/B288ByvK6YBIhMe2pZLiySVgXbVrXzYxtvp5/4gJYp9vDLVj2dAZqmvZh+fYA +tmnYOosxWd2R5nwnI4fdAw+PKowegwFOAWEMUnNt/AiiuSpm5HZNMaBWm9lTjaK2 +jwLI5jqmBNFI+8NKAnb9L9K8E7bobTQk+p0pisehKxTxlgBzuRPpwLk6R1YCcYAn +pLwltum95OmYdBbxN4SBB7SC +-----END CERTIFICATE-----` + +const comodoRSAAuthority = `-----BEGIN CERTIFICATE----- +MIIFdDCCBFygAwIBAgIQJ2buVutJ846r13Ci/ITeIjANBgkqhkiG9w0BAQwFADBv +MQswCQYDVQQGEwJTRTEUMBIGA1UEChMLQWRkVHJ1c3QgQUIxJjAkBgNVBAsTHUFk +ZFRydXN0IEV4dGVybmFsIFRUUCBOZXR3b3JrMSIwIAYDVQQDExlBZGRUcnVzdCBF +eHRlcm5hbCBDQSBSb290MB4XDTAwMDUzMDEwNDgzOFoXDTIwMDUzMDEwNDgzOFow +gYUxCzAJBgNVBAYTAkdCMRswGQYDVQQIExJHcmVhdGVyIE1hbmNoZXN0ZXIxEDAO +BgNVBAcTB1NhbGZvcmQxGjAYBgNVBAoTEUNPTU9ETyBDQSBMaW1pdGVkMSswKQYD +VQQDEyJDT01PRE8gUlNBIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIICIjANBgkq +hkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAkehUktIKVrGsDSTdxc9EZ3SZKzejfSNw +AHG8U9/E+ioSj0t/EFa9n3Byt2F/yUsPF6c947AEYe7/EZfH9IY+Cvo+XPmT5jR6 +2RRr55yzhaCCenavcZDX7P0N+pxs+t+wgvQUfvm+xKYvT3+Zf7X8Z0NyvQwA1onr +ayzT7Y+YHBSrfuXjbvzYqOSSJNpDa2K4Vf3qwbxstovzDo2a5JtsaZn4eEgwRdWt +4Q08RWD8MpZRJ7xnw8outmvqRsfHIKCxH2XeSAi6pE6p8oNGN4Tr6MyBSENnTnIq +m1y9TBsoilwie7SrmNnu4FGDwwlGTm0+mfqVF9p8M1dBPI1R7Qu2XK8sYxrfV8g/ +vOldxJuvRZnio1oktLqpVj3Pb6r/SVi+8Kj/9Lit6Tf7urj0Czr56ENCHonYhMsT +8dm74YlguIwoVqwUHZwK53Hrzw7dPamWoUi9PPevtQ0iTMARgexWO/bTouJbt7IE +IlKVgJNp6I5MZfGRAy1wdALqi2cVKWlSArvX31BqVUa/oKMoYX9w0MOiqiwhqkfO +KJwGRXa/ghgntNWutMtQ5mv0TIZxMOmm3xaG4Nj/QN370EKIf6MzOi5cHkERgWPO +GHFrK+ymircxXDpqR+DDeVnWIBqv8mqYqnK8V0rSS527EPywTEHl7R09XiidnMy/ +s1Hap0flhFMCAwEAAaOB9DCB8TAfBgNVHSMEGDAWgBStvZh6NLQm9/rEJlTvA73g +JMtUGjAdBgNVHQ4EFgQUu69+Aj36pvE8hI6t7jiY7NkyMtQwDgYDVR0PAQH/BAQD +AgGGMA8GA1UdEwEB/wQFMAMBAf8wEQYDVR0gBAowCDAGBgRVHSAAMEQGA1UdHwQ9 +MDswOaA3oDWGM2h0dHA6Ly9jcmwudXNlcnRydXN0LmNvbS9BZGRUcnVzdEV4dGVy +bmFsQ0FSb290LmNybDA1BggrBgEFBQcBAQQpMCcwJQYIKwYBBQUHMAGGGWh0dHA6 +Ly9vY3NwLnVzZXJ0cnVzdC5jb20wDQYJKoZIhvcNAQEMBQADggEBAGS/g/FfmoXQ +zbihKVcN6Fr30ek+8nYEbvFScLsePP9NDXRqzIGCJdPDoCpdTPW6i6FtxFQJdcfj +Jw5dhHk3QBN39bSsHNA7qxcS1u80GH4r6XnTq1dFDK8o+tDb5VCViLvfhVdpfZLY +Uspzgb8c8+a4bmYRBbMelC1/kZWSWfFMzqORcUx8Rww7Cxn2obFshj5cqsQugsv5 +B5a6SE2Q8pTIqXOi6wZ7I53eovNNVZ96YUWYGGjHXkBrI/V5eu+MtWuLt29G9Hvx +PUsE2JOAWVrgQSQdso8VYFhH2+9uRv0V9dlfmrPb2LjkQLPNlzmuhbsdjrzch5vR +pu/xO28QOG8= +-----END CERTIFICATE-----` + +const addTrustRoot = `-----BEGIN CERTIFICATE----- +MIIENjCCAx6gAwIBAgIBATANBgkqhkiG9w0BAQUFADBvMQswCQYDVQQGEwJTRTEU +MBIGA1UEChMLQWRkVHJ1c3QgQUIxJjAkBgNVBAsTHUFkZFRydXN0IEV4dGVybmFs +IFRUUCBOZXR3b3JrMSIwIAYDVQQDExlBZGRUcnVzdCBFeHRlcm5hbCBDQSBSb290 +MB4XDTAwMDUzMDEwNDgzOFoXDTIwMDUzMDEwNDgzOFowbzELMAkGA1UEBhMCU0Ux +FDASBgNVBAoTC0FkZFRydXN0IEFCMSYwJAYDVQQLEx1BZGRUcnVzdCBFeHRlcm5h +bCBUVFAgTmV0d29yazEiMCAGA1UEAxMZQWRkVHJ1c3QgRXh0ZXJuYWwgQ0EgUm9v +dDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALf3GjPm8gAELTngTlvt +H7xsD821+iO2zt6bETOXpClMfZOfvUq8k+0DGuOPz+VtUFrWlymUWoCwSXrbLpX9 +uMq/NzgtHj6RQa1wVsfwTz/oMp50ysiQVOnGXw94nZpAPA6sYapeFI+eh6FqUNzX +mk6vBbOmcZSccbNQYArHE504B4YCqOmoaSYYkKtMsE8jqzpPhNjfzp/haW+710LX +a0Tkx63ubUFfclpxCDezeWWkWaCUN/cALw3CknLa0Dhy2xSoRcRdKn23tNbE7qzN +E0S3ySvdQwAl+mG5aWpYIxG3pzOPVnVZ9c0p10a3CitlttNCbxWyuHv77+ldU9U0 +WicCAwEAAaOB3DCB2TAdBgNVHQ4EFgQUrb2YejS0Jvf6xCZU7wO94CTLVBowCwYD +VR0PBAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wgZkGA1UdIwSBkTCBjoAUrb2YejS0 +Jvf6xCZU7wO94CTLVBqhc6RxMG8xCzAJBgNVBAYTAlNFMRQwEgYDVQQKEwtBZGRU +cnVzdCBBQjEmMCQGA1UECxMdQWRkVHJ1c3QgRXh0ZXJuYWwgVFRQIE5ldHdvcmsx +IjAgBgNVBAMTGUFkZFRydXN0IEV4dGVybmFsIENBIFJvb3SCAQEwDQYJKoZIhvcN +AQEFBQADggEBALCb4IUlwtYj4g+WBpKdQZic2YR5gdkeWxQHIzZlj7DYd7usQWxH +YINRsPkyPef89iYTx4AWpb9a/IfPeHmJIZriTAcKhjW88t5RxNKWt9x+Tu5w/Rw5 +6wwCURQtjr0W4MHfRnXnJK3s9EK0hZNwEGe6nQY1ShjTK3rMUUKhemPR5ruhxSvC +Nr4TDea9Y355e6cJDUCrat2PisP29owaQgVR1EX1n6diIWgVIEM8med8vSTYqZEX +c4g/VhsxOBi0cQ+azcgOno4uG+GMmIPLHzHxREzGBHNJdmAPx/i9F4BrLunMTA5a +mnkPIAou1Z5jJh5VkpTYghdae9C8x49OhgQ= +-----END CERTIFICATE-----` diff --git a/src/crypto/x509/x509.go b/src/crypto/x509/x509.go new file mode 100644 index 0000000000000000000000000000000000000000..be6c013464b40eae1a8e881b4aa51ccf7d71dd41 --- /dev/null +++ b/src/crypto/x509/x509.go @@ -0,0 +1,2028 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package x509 parses X.509-encoded keys and certificates. +package x509 + +import ( + "bytes" + "crypto" + "crypto/dsa" + "crypto/ecdsa" + "crypto/elliptic" + "crypto/rsa" + _ "crypto/sha1" + _ "crypto/sha256" + _ "crypto/sha512" + "crypto/x509/pkix" + "encoding/asn1" + "encoding/pem" + "errors" + "io" + "math/big" + "net" + "strconv" + "time" +) + +// pkixPublicKey reflects a PKIX public key structure. See SubjectPublicKeyInfo +// in RFC 3280. +type pkixPublicKey struct { + Algo pkix.AlgorithmIdentifier + BitString asn1.BitString +} + +// ParsePKIXPublicKey parses a DER encoded public key. These values are +// typically found in PEM blocks with "BEGIN PUBLIC KEY". +func ParsePKIXPublicKey(derBytes []byte) (pub interface{}, err error) { + var pki publicKeyInfo + if rest, err := asn1.Unmarshal(derBytes, &pki); err != nil { + return nil, err + } else if len(rest) != 0 { + return nil, errors.New("x509: trailing data after ASN.1 of public-key") + } + algo := getPublicKeyAlgorithmFromOID(pki.Algorithm.Algorithm) + if algo == UnknownPublicKeyAlgorithm { + return nil, errors.New("x509: unknown public key algorithm") + } + return parsePublicKey(algo, &pki) +} + +func marshalPublicKey(pub interface{}) (publicKeyBytes []byte, publicKeyAlgorithm pkix.AlgorithmIdentifier, err error) { + switch pub := pub.(type) { + case *rsa.PublicKey: + publicKeyBytes, err = asn1.Marshal(rsaPublicKey{ + N: pub.N, + E: pub.E, + }) + publicKeyAlgorithm.Algorithm = oidPublicKeyRSA + // This is a NULL parameters value which is technically + // superfluous, but most other code includes it and, by + // doing this, we match their public key hashes. + publicKeyAlgorithm.Parameters = asn1.RawValue{ + Tag: 5, + } + case *ecdsa.PublicKey: + publicKeyBytes = elliptic.Marshal(pub.Curve, pub.X, pub.Y) + oid, ok := oidFromNamedCurve(pub.Curve) + if !ok { + return nil, pkix.AlgorithmIdentifier{}, errors.New("x509: unsupported elliptic curve") + } + publicKeyAlgorithm.Algorithm = oidPublicKeyECDSA + var paramBytes []byte + paramBytes, err = asn1.Marshal(oid) + if err != nil { + return + } + publicKeyAlgorithm.Parameters.FullBytes = paramBytes + default: + return nil, pkix.AlgorithmIdentifier{}, errors.New("x509: only RSA and ECDSA public keys supported") + } + + return publicKeyBytes, publicKeyAlgorithm, nil +} + +// MarshalPKIXPublicKey serialises a public key to DER-encoded PKIX format. +func MarshalPKIXPublicKey(pub interface{}) ([]byte, error) { + var publicKeyBytes []byte + var publicKeyAlgorithm pkix.AlgorithmIdentifier + var err error + + if publicKeyBytes, publicKeyAlgorithm, err = marshalPublicKey(pub); err != nil { + return nil, err + } + + pkix := pkixPublicKey{ + Algo: publicKeyAlgorithm, + BitString: asn1.BitString{ + Bytes: publicKeyBytes, + BitLength: 8 * len(publicKeyBytes), + }, + } + + ret, _ := asn1.Marshal(pkix) + return ret, nil +} + +// These structures reflect the ASN.1 structure of X.509 certificates.: + +type certificate struct { + Raw asn1.RawContent + TBSCertificate tbsCertificate + SignatureAlgorithm pkix.AlgorithmIdentifier + SignatureValue asn1.BitString +} + +type tbsCertificate struct { + Raw asn1.RawContent + Version int `asn1:"optional,explicit,default:1,tag:0"` + SerialNumber *big.Int + SignatureAlgorithm pkix.AlgorithmIdentifier + Issuer asn1.RawValue + Validity validity + Subject asn1.RawValue + PublicKey publicKeyInfo + UniqueId asn1.BitString `asn1:"optional,tag:1"` + SubjectUniqueId asn1.BitString `asn1:"optional,tag:2"` + Extensions []pkix.Extension `asn1:"optional,explicit,tag:3"` +} + +type dsaAlgorithmParameters struct { + P, Q, G *big.Int +} + +type dsaSignature struct { + R, S *big.Int +} + +type ecdsaSignature dsaSignature + +type validity struct { + NotBefore, NotAfter time.Time +} + +type publicKeyInfo struct { + Raw asn1.RawContent + Algorithm pkix.AlgorithmIdentifier + PublicKey asn1.BitString +} + +// RFC 5280, 4.2.1.1 +type authKeyId struct { + Id []byte `asn1:"optional,tag:0"` +} + +type SignatureAlgorithm int + +const ( + UnknownSignatureAlgorithm SignatureAlgorithm = iota + MD2WithRSA + MD5WithRSA + SHA1WithRSA + SHA256WithRSA + SHA384WithRSA + SHA512WithRSA + DSAWithSHA1 + DSAWithSHA256 + ECDSAWithSHA1 + ECDSAWithSHA256 + ECDSAWithSHA384 + ECDSAWithSHA512 +) + +type PublicKeyAlgorithm int + +const ( + UnknownPublicKeyAlgorithm PublicKeyAlgorithm = iota + RSA + DSA + ECDSA +) + +// OIDs for signature algorithms +// +// pkcs-1 OBJECT IDENTIFIER ::= { +// iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) 1 } +// +// +// RFC 3279 2.2.1 RSA Signature Algorithms +// +// md2WithRSAEncryption OBJECT IDENTIFIER ::= { pkcs-1 2 } +// +// md5WithRSAEncryption OBJECT IDENTIFIER ::= { pkcs-1 4 } +// +// sha-1WithRSAEncryption OBJECT IDENTIFIER ::= { pkcs-1 5 } +// +// dsaWithSha1 OBJECT IDENTIFIER ::= { +// iso(1) member-body(2) us(840) x9-57(10040) x9cm(4) 3 } +// +// RFC 3279 2.2.3 ECDSA Signature Algorithm +// +// ecdsa-with-SHA1 OBJECT IDENTIFIER ::= { +// iso(1) member-body(2) us(840) ansi-x962(10045) +// signatures(4) ecdsa-with-SHA1(1)} +// +// +// RFC 4055 5 PKCS #1 Version 1.5 +// +// sha256WithRSAEncryption OBJECT IDENTIFIER ::= { pkcs-1 11 } +// +// sha384WithRSAEncryption OBJECT IDENTIFIER ::= { pkcs-1 12 } +// +// sha512WithRSAEncryption OBJECT IDENTIFIER ::= { pkcs-1 13 } +// +// +// RFC 5758 3.1 DSA Signature Algorithms +// +// dsaWithSha256 OBJECT IDENTIFIER ::= { +// joint-iso-ccitt(2) country(16) us(840) organization(1) gov(101) +// csor(3) algorithms(4) id-dsa-with-sha2(3) 2} +// +// RFC 5758 3.2 ECDSA Signature Algorithm +// +// ecdsa-with-SHA256 OBJECT IDENTIFIER ::= { iso(1) member-body(2) +// us(840) ansi-X9-62(10045) signatures(4) ecdsa-with-SHA2(3) 2 } +// +// ecdsa-with-SHA384 OBJECT IDENTIFIER ::= { iso(1) member-body(2) +// us(840) ansi-X9-62(10045) signatures(4) ecdsa-with-SHA2(3) 3 } +// +// ecdsa-with-SHA512 OBJECT IDENTIFIER ::= { iso(1) member-body(2) +// us(840) ansi-X9-62(10045) signatures(4) ecdsa-with-SHA2(3) 4 } + +var ( + oidSignatureMD2WithRSA = asn1.ObjectIdentifier{1, 2, 840, 113549, 1, 1, 2} + oidSignatureMD5WithRSA = asn1.ObjectIdentifier{1, 2, 840, 113549, 1, 1, 4} + oidSignatureSHA1WithRSA = asn1.ObjectIdentifier{1, 2, 840, 113549, 1, 1, 5} + oidSignatureSHA256WithRSA = asn1.ObjectIdentifier{1, 2, 840, 113549, 1, 1, 11} + oidSignatureSHA384WithRSA = asn1.ObjectIdentifier{1, 2, 840, 113549, 1, 1, 12} + oidSignatureSHA512WithRSA = asn1.ObjectIdentifier{1, 2, 840, 113549, 1, 1, 13} + oidSignatureDSAWithSHA1 = asn1.ObjectIdentifier{1, 2, 840, 10040, 4, 3} + oidSignatureDSAWithSHA256 = asn1.ObjectIdentifier{2, 16, 840, 1, 101, 4, 3, 2} + oidSignatureECDSAWithSHA1 = asn1.ObjectIdentifier{1, 2, 840, 10045, 4, 1} + oidSignatureECDSAWithSHA256 = asn1.ObjectIdentifier{1, 2, 840, 10045, 4, 3, 2} + oidSignatureECDSAWithSHA384 = asn1.ObjectIdentifier{1, 2, 840, 10045, 4, 3, 3} + oidSignatureECDSAWithSHA512 = asn1.ObjectIdentifier{1, 2, 840, 10045, 4, 3, 4} +) + +var signatureAlgorithmDetails = []struct { + algo SignatureAlgorithm + oid asn1.ObjectIdentifier + pubKeyAlgo PublicKeyAlgorithm + hash crypto.Hash +}{ + {MD2WithRSA, oidSignatureMD2WithRSA, RSA, crypto.Hash(0) /* no value for MD2 */}, + {MD5WithRSA, oidSignatureMD5WithRSA, RSA, crypto.MD5}, + {SHA1WithRSA, oidSignatureSHA1WithRSA, RSA, crypto.SHA1}, + {SHA256WithRSA, oidSignatureSHA256WithRSA, RSA, crypto.SHA256}, + {SHA384WithRSA, oidSignatureSHA384WithRSA, RSA, crypto.SHA384}, + {SHA512WithRSA, oidSignatureSHA512WithRSA, RSA, crypto.SHA512}, + {DSAWithSHA1, oidSignatureDSAWithSHA1, DSA, crypto.SHA1}, + {DSAWithSHA256, oidSignatureDSAWithSHA256, DSA, crypto.SHA256}, + {ECDSAWithSHA1, oidSignatureECDSAWithSHA1, ECDSA, crypto.SHA1}, + {ECDSAWithSHA256, oidSignatureECDSAWithSHA256, ECDSA, crypto.SHA256}, + {ECDSAWithSHA384, oidSignatureECDSAWithSHA384, ECDSA, crypto.SHA384}, + {ECDSAWithSHA512, oidSignatureECDSAWithSHA512, ECDSA, crypto.SHA512}, +} + +func getSignatureAlgorithmFromOID(oid asn1.ObjectIdentifier) SignatureAlgorithm { + for _, details := range signatureAlgorithmDetails { + if oid.Equal(details.oid) { + return details.algo + } + } + return UnknownSignatureAlgorithm +} + +// RFC 3279, 2.3 Public Key Algorithms +// +// pkcs-1 OBJECT IDENTIFIER ::== { iso(1) member-body(2) us(840) +// rsadsi(113549) pkcs(1) 1 } +// +// rsaEncryption OBJECT IDENTIFIER ::== { pkcs1-1 1 } +// +// id-dsa OBJECT IDENTIFIER ::== { iso(1) member-body(2) us(840) +// x9-57(10040) x9cm(4) 1 } +// +// RFC 5480, 2.1.1 Unrestricted Algorithm Identifier and Parameters +// +// id-ecPublicKey OBJECT IDENTIFIER ::= { +// iso(1) member-body(2) us(840) ansi-X9-62(10045) keyType(2) 1 } +var ( + oidPublicKeyRSA = asn1.ObjectIdentifier{1, 2, 840, 113549, 1, 1, 1} + oidPublicKeyDSA = asn1.ObjectIdentifier{1, 2, 840, 10040, 4, 1} + oidPublicKeyECDSA = asn1.ObjectIdentifier{1, 2, 840, 10045, 2, 1} +) + +func getPublicKeyAlgorithmFromOID(oid asn1.ObjectIdentifier) PublicKeyAlgorithm { + switch { + case oid.Equal(oidPublicKeyRSA): + return RSA + case oid.Equal(oidPublicKeyDSA): + return DSA + case oid.Equal(oidPublicKeyECDSA): + return ECDSA + } + return UnknownPublicKeyAlgorithm +} + +// RFC 5480, 2.1.1.1. Named Curve +// +// secp224r1 OBJECT IDENTIFIER ::= { +// iso(1) identified-organization(3) certicom(132) curve(0) 33 } +// +// secp256r1 OBJECT IDENTIFIER ::= { +// iso(1) member-body(2) us(840) ansi-X9-62(10045) curves(3) +// prime(1) 7 } +// +// secp384r1 OBJECT IDENTIFIER ::= { +// iso(1) identified-organization(3) certicom(132) curve(0) 34 } +// +// secp521r1 OBJECT IDENTIFIER ::= { +// iso(1) identified-organization(3) certicom(132) curve(0) 35 } +// +// NB: secp256r1 is equivalent to prime256v1 +var ( + oidNamedCurveP224 = asn1.ObjectIdentifier{1, 3, 132, 0, 33} + oidNamedCurveP256 = asn1.ObjectIdentifier{1, 2, 840, 10045, 3, 1, 7} + oidNamedCurveP384 = asn1.ObjectIdentifier{1, 3, 132, 0, 34} + oidNamedCurveP521 = asn1.ObjectIdentifier{1, 3, 132, 0, 35} +) + +func namedCurveFromOID(oid asn1.ObjectIdentifier) elliptic.Curve { + switch { + case oid.Equal(oidNamedCurveP224): + return elliptic.P224() + case oid.Equal(oidNamedCurveP256): + return elliptic.P256() + case oid.Equal(oidNamedCurveP384): + return elliptic.P384() + case oid.Equal(oidNamedCurveP521): + return elliptic.P521() + } + return nil +} + +func oidFromNamedCurve(curve elliptic.Curve) (asn1.ObjectIdentifier, bool) { + switch curve { + case elliptic.P224(): + return oidNamedCurveP224, true + case elliptic.P256(): + return oidNamedCurveP256, true + case elliptic.P384(): + return oidNamedCurveP384, true + case elliptic.P521(): + return oidNamedCurveP521, true + } + + return nil, false +} + +// KeyUsage represents the set of actions that are valid for a given key. It's +// a bitmap of the KeyUsage* constants. +type KeyUsage int + +const ( + KeyUsageDigitalSignature KeyUsage = 1 << iota + KeyUsageContentCommitment + KeyUsageKeyEncipherment + KeyUsageDataEncipherment + KeyUsageKeyAgreement + KeyUsageCertSign + KeyUsageCRLSign + KeyUsageEncipherOnly + KeyUsageDecipherOnly +) + +// RFC 5280, 4.2.1.12 Extended Key Usage +// +// anyExtendedKeyUsage OBJECT IDENTIFIER ::= { id-ce-extKeyUsage 0 } +// +// id-kp OBJECT IDENTIFIER ::= { id-pkix 3 } +// +// id-kp-serverAuth OBJECT IDENTIFIER ::= { id-kp 1 } +// id-kp-clientAuth OBJECT IDENTIFIER ::= { id-kp 2 } +// id-kp-codeSigning OBJECT IDENTIFIER ::= { id-kp 3 } +// id-kp-emailProtection OBJECT IDENTIFIER ::= { id-kp 4 } +// id-kp-timeStamping OBJECT IDENTIFIER ::= { id-kp 8 } +// id-kp-OCSPSigning OBJECT IDENTIFIER ::= { id-kp 9 } +var ( + oidExtKeyUsageAny = asn1.ObjectIdentifier{2, 5, 29, 37, 0} + oidExtKeyUsageServerAuth = asn1.ObjectIdentifier{1, 3, 6, 1, 5, 5, 7, 3, 1} + oidExtKeyUsageClientAuth = asn1.ObjectIdentifier{1, 3, 6, 1, 5, 5, 7, 3, 2} + oidExtKeyUsageCodeSigning = asn1.ObjectIdentifier{1, 3, 6, 1, 5, 5, 7, 3, 3} + oidExtKeyUsageEmailProtection = asn1.ObjectIdentifier{1, 3, 6, 1, 5, 5, 7, 3, 4} + oidExtKeyUsageIPSECEndSystem = asn1.ObjectIdentifier{1, 3, 6, 1, 5, 5, 7, 3, 5} + oidExtKeyUsageIPSECTunnel = asn1.ObjectIdentifier{1, 3, 6, 1, 5, 5, 7, 3, 6} + oidExtKeyUsageIPSECUser = asn1.ObjectIdentifier{1, 3, 6, 1, 5, 5, 7, 3, 7} + oidExtKeyUsageTimeStamping = asn1.ObjectIdentifier{1, 3, 6, 1, 5, 5, 7, 3, 8} + oidExtKeyUsageOCSPSigning = asn1.ObjectIdentifier{1, 3, 6, 1, 5, 5, 7, 3, 9} + oidExtKeyUsageMicrosoftServerGatedCrypto = asn1.ObjectIdentifier{1, 3, 6, 1, 4, 1, 311, 10, 3, 3} + oidExtKeyUsageNetscapeServerGatedCrypto = asn1.ObjectIdentifier{2, 16, 840, 1, 113730, 4, 1} +) + +// ExtKeyUsage represents an extended set of actions that are valid for a given key. +// Each of the ExtKeyUsage* constants define a unique action. +type ExtKeyUsage int + +const ( + ExtKeyUsageAny ExtKeyUsage = iota + ExtKeyUsageServerAuth + ExtKeyUsageClientAuth + ExtKeyUsageCodeSigning + ExtKeyUsageEmailProtection + ExtKeyUsageIPSECEndSystem + ExtKeyUsageIPSECTunnel + ExtKeyUsageIPSECUser + ExtKeyUsageTimeStamping + ExtKeyUsageOCSPSigning + ExtKeyUsageMicrosoftServerGatedCrypto + ExtKeyUsageNetscapeServerGatedCrypto +) + +// extKeyUsageOIDs contains the mapping between an ExtKeyUsage and its OID. +var extKeyUsageOIDs = []struct { + extKeyUsage ExtKeyUsage + oid asn1.ObjectIdentifier +}{ + {ExtKeyUsageAny, oidExtKeyUsageAny}, + {ExtKeyUsageServerAuth, oidExtKeyUsageServerAuth}, + {ExtKeyUsageClientAuth, oidExtKeyUsageClientAuth}, + {ExtKeyUsageCodeSigning, oidExtKeyUsageCodeSigning}, + {ExtKeyUsageEmailProtection, oidExtKeyUsageEmailProtection}, + {ExtKeyUsageIPSECEndSystem, oidExtKeyUsageIPSECEndSystem}, + {ExtKeyUsageIPSECTunnel, oidExtKeyUsageIPSECTunnel}, + {ExtKeyUsageIPSECUser, oidExtKeyUsageIPSECUser}, + {ExtKeyUsageTimeStamping, oidExtKeyUsageTimeStamping}, + {ExtKeyUsageOCSPSigning, oidExtKeyUsageOCSPSigning}, + {ExtKeyUsageMicrosoftServerGatedCrypto, oidExtKeyUsageMicrosoftServerGatedCrypto}, + {ExtKeyUsageNetscapeServerGatedCrypto, oidExtKeyUsageNetscapeServerGatedCrypto}, +} + +func extKeyUsageFromOID(oid asn1.ObjectIdentifier) (eku ExtKeyUsage, ok bool) { + for _, pair := range extKeyUsageOIDs { + if oid.Equal(pair.oid) { + return pair.extKeyUsage, true + } + } + return +} + +func oidFromExtKeyUsage(eku ExtKeyUsage) (oid asn1.ObjectIdentifier, ok bool) { + for _, pair := range extKeyUsageOIDs { + if eku == pair.extKeyUsage { + return pair.oid, true + } + } + return +} + +// A Certificate represents an X.509 certificate. +type Certificate struct { + Raw []byte // Complete ASN.1 DER content (certificate, signature algorithm and signature). + RawTBSCertificate []byte // Certificate part of raw ASN.1 DER content. + RawSubjectPublicKeyInfo []byte // DER encoded SubjectPublicKeyInfo. + RawSubject []byte // DER encoded Subject + RawIssuer []byte // DER encoded Issuer + + Signature []byte + SignatureAlgorithm SignatureAlgorithm + + PublicKeyAlgorithm PublicKeyAlgorithm + PublicKey interface{} + + Version int + SerialNumber *big.Int + Issuer pkix.Name + Subject pkix.Name + NotBefore, NotAfter time.Time // Validity bounds. + KeyUsage KeyUsage + + // Extensions contains raw X.509 extensions. When parsing certificates, + // this can be used to extract non-critical extensions that are not + // parsed by this package. When marshaling certificates, the Extensions + // field is ignored, see ExtraExtensions. + Extensions []pkix.Extension + + // ExtraExtensions contains extensions to be copied, raw, into any + // marshaled certificates. Values override any extensions that would + // otherwise be produced based on the other fields. The ExtraExtensions + // field is not populated when parsing certificates, see Extensions. + ExtraExtensions []pkix.Extension + + // UnhandledCriticalExtensions contains a list of extension IDs that + // were not (fully) processed when parsing. Verify will fail if this + // slice is non-empty, unless verification is delegated to an OS + // library which understands all the critical extensions. + // + // Users can access these extensions using Extensions and can remove + // elements from this slice if they believe that they have been + // handled. + UnhandledCriticalExtensions []asn1.ObjectIdentifier + + ExtKeyUsage []ExtKeyUsage // Sequence of extended key usages. + UnknownExtKeyUsage []asn1.ObjectIdentifier // Encountered extended key usages unknown to this package. + + BasicConstraintsValid bool // if true then the next two fields are valid. + IsCA bool + MaxPathLen int + // MaxPathLenZero indicates that BasicConstraintsValid==true and + // MaxPathLen==0 should be interpreted as an actual maximum path length + // of zero. Otherwise, that combination is interpreted as MaxPathLen + // not being set. + MaxPathLenZero bool + + SubjectKeyId []byte + AuthorityKeyId []byte + + // RFC 5280, 4.2.2.1 (Authority Information Access) + OCSPServer []string + IssuingCertificateURL []string + + // Subject Alternate Name values + DNSNames []string + EmailAddresses []string + IPAddresses []net.IP + + // Name constraints + PermittedDNSDomainsCritical bool // if true then the name constraints are marked critical. + PermittedDNSDomains []string + + // CRL Distribution Points + CRLDistributionPoints []string + + PolicyIdentifiers []asn1.ObjectIdentifier +} + +// ErrUnsupportedAlgorithm results from attempting to perform an operation that +// involves algorithms that are not currently implemented. +var ErrUnsupportedAlgorithm = errors.New("x509: cannot verify signature: algorithm unimplemented") + +// ConstraintViolationError results when a requested usage is not permitted by +// a certificate. For example: checking a signature when the public key isn't a +// certificate signing key. +type ConstraintViolationError struct{} + +func (ConstraintViolationError) Error() string { + return "x509: invalid signature: parent certificate cannot sign this kind of certificate" +} + +func (c *Certificate) Equal(other *Certificate) bool { + return bytes.Equal(c.Raw, other.Raw) +} + +// Entrust have a broken root certificate (CN=Entrust.net Certification +// Authority (2048)) which isn't marked as a CA certificate and is thus invalid +// according to PKIX. +// We recognise this certificate by its SubjectPublicKeyInfo and exempt it +// from the Basic Constraints requirement. +// See http://www.entrust.net/knowledge-base/technote.cfm?tn=7869 +// +// TODO(agl): remove this hack once their reissued root is sufficiently +// widespread. +var entrustBrokenSPKI = []byte{ + 0x30, 0x82, 0x01, 0x22, 0x30, 0x0d, 0x06, 0x09, + 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, + 0x01, 0x05, 0x00, 0x03, 0x82, 0x01, 0x0f, 0x00, + 0x30, 0x82, 0x01, 0x0a, 0x02, 0x82, 0x01, 0x01, + 0x00, 0x97, 0xa3, 0x2d, 0x3c, 0x9e, 0xde, 0x05, + 0xda, 0x13, 0xc2, 0x11, 0x8d, 0x9d, 0x8e, 0xe3, + 0x7f, 0xc7, 0x4b, 0x7e, 0x5a, 0x9f, 0xb3, 0xff, + 0x62, 0xab, 0x73, 0xc8, 0x28, 0x6b, 0xba, 0x10, + 0x64, 0x82, 0x87, 0x13, 0xcd, 0x57, 0x18, 0xff, + 0x28, 0xce, 0xc0, 0xe6, 0x0e, 0x06, 0x91, 0x50, + 0x29, 0x83, 0xd1, 0xf2, 0xc3, 0x2a, 0xdb, 0xd8, + 0xdb, 0x4e, 0x04, 0xcc, 0x00, 0xeb, 0x8b, 0xb6, + 0x96, 0xdc, 0xbc, 0xaa, 0xfa, 0x52, 0x77, 0x04, + 0xc1, 0xdb, 0x19, 0xe4, 0xae, 0x9c, 0xfd, 0x3c, + 0x8b, 0x03, 0xef, 0x4d, 0xbc, 0x1a, 0x03, 0x65, + 0xf9, 0xc1, 0xb1, 0x3f, 0x72, 0x86, 0xf2, 0x38, + 0xaa, 0x19, 0xae, 0x10, 0x88, 0x78, 0x28, 0xda, + 0x75, 0xc3, 0x3d, 0x02, 0x82, 0x02, 0x9c, 0xb9, + 0xc1, 0x65, 0x77, 0x76, 0x24, 0x4c, 0x98, 0xf7, + 0x6d, 0x31, 0x38, 0xfb, 0xdb, 0xfe, 0xdb, 0x37, + 0x02, 0x76, 0xa1, 0x18, 0x97, 0xa6, 0xcc, 0xde, + 0x20, 0x09, 0x49, 0x36, 0x24, 0x69, 0x42, 0xf6, + 0xe4, 0x37, 0x62, 0xf1, 0x59, 0x6d, 0xa9, 0x3c, + 0xed, 0x34, 0x9c, 0xa3, 0x8e, 0xdb, 0xdc, 0x3a, + 0xd7, 0xf7, 0x0a, 0x6f, 0xef, 0x2e, 0xd8, 0xd5, + 0x93, 0x5a, 0x7a, 0xed, 0x08, 0x49, 0x68, 0xe2, + 0x41, 0xe3, 0x5a, 0x90, 0xc1, 0x86, 0x55, 0xfc, + 0x51, 0x43, 0x9d, 0xe0, 0xb2, 0xc4, 0x67, 0xb4, + 0xcb, 0x32, 0x31, 0x25, 0xf0, 0x54, 0x9f, 0x4b, + 0xd1, 0x6f, 0xdb, 0xd4, 0xdd, 0xfc, 0xaf, 0x5e, + 0x6c, 0x78, 0x90, 0x95, 0xde, 0xca, 0x3a, 0x48, + 0xb9, 0x79, 0x3c, 0x9b, 0x19, 0xd6, 0x75, 0x05, + 0xa0, 0xf9, 0x88, 0xd7, 0xc1, 0xe8, 0xa5, 0x09, + 0xe4, 0x1a, 0x15, 0xdc, 0x87, 0x23, 0xaa, 0xb2, + 0x75, 0x8c, 0x63, 0x25, 0x87, 0xd8, 0xf8, 0x3d, + 0xa6, 0xc2, 0xcc, 0x66, 0xff, 0xa5, 0x66, 0x68, + 0x55, 0x02, 0x03, 0x01, 0x00, 0x01, +} + +// CheckSignatureFrom verifies that the signature on c is a valid signature +// from parent. +func (c *Certificate) CheckSignatureFrom(parent *Certificate) (err error) { + // RFC 5280, 4.2.1.9: + // "If the basic constraints extension is not present in a version 3 + // certificate, or the extension is present but the cA boolean is not + // asserted, then the certified public key MUST NOT be used to verify + // certificate signatures." + // (except for Entrust, see comment above entrustBrokenSPKI) + if (parent.Version == 3 && !parent.BasicConstraintsValid || + parent.BasicConstraintsValid && !parent.IsCA) && + !bytes.Equal(c.RawSubjectPublicKeyInfo, entrustBrokenSPKI) { + return ConstraintViolationError{} + } + + if parent.KeyUsage != 0 && parent.KeyUsage&KeyUsageCertSign == 0 { + return ConstraintViolationError{} + } + + if parent.PublicKeyAlgorithm == UnknownPublicKeyAlgorithm { + return ErrUnsupportedAlgorithm + } + + // TODO(agl): don't ignore the path length constraint. + + return parent.CheckSignature(c.SignatureAlgorithm, c.RawTBSCertificate, c.Signature) +} + +// CheckSignature verifies that signature is a valid signature over signed from +// c's public key. +func (c *Certificate) CheckSignature(algo SignatureAlgorithm, signed, signature []byte) (err error) { + return checkSignature(algo, signed, signature, c.PublicKey) +} + +// CheckSignature verifies that signature is a valid signature over signed from +// a crypto.PublicKey. +func checkSignature(algo SignatureAlgorithm, signed, signature []byte, publicKey crypto.PublicKey) (err error) { + var hashType crypto.Hash + + switch algo { + case SHA1WithRSA, DSAWithSHA1, ECDSAWithSHA1: + hashType = crypto.SHA1 + case SHA256WithRSA, DSAWithSHA256, ECDSAWithSHA256: + hashType = crypto.SHA256 + case SHA384WithRSA, ECDSAWithSHA384: + hashType = crypto.SHA384 + case SHA512WithRSA, ECDSAWithSHA512: + hashType = crypto.SHA512 + default: + return ErrUnsupportedAlgorithm + } + + if !hashType.Available() { + return ErrUnsupportedAlgorithm + } + h := hashType.New() + + h.Write(signed) + digest := h.Sum(nil) + + switch pub := publicKey.(type) { + case *rsa.PublicKey: + return rsa.VerifyPKCS1v15(pub, hashType, digest, signature) + case *dsa.PublicKey: + dsaSig := new(dsaSignature) + if rest, err := asn1.Unmarshal(signature, dsaSig); err != nil { + return err + } else if len(rest) != 0 { + return errors.New("x509: trailing data after DSA signature") + } + if dsaSig.R.Sign() <= 0 || dsaSig.S.Sign() <= 0 { + return errors.New("x509: DSA signature contained zero or negative values") + } + if !dsa.Verify(pub, digest, dsaSig.R, dsaSig.S) { + return errors.New("x509: DSA verification failure") + } + return + case *ecdsa.PublicKey: + ecdsaSig := new(ecdsaSignature) + if rest, err := asn1.Unmarshal(signature, ecdsaSig); err != nil { + return err + } else if len(rest) != 0 { + return errors.New("x509: trailing data after ECDSA signature") + } + if ecdsaSig.R.Sign() <= 0 || ecdsaSig.S.Sign() <= 0 { + return errors.New("x509: ECDSA signature contained zero or negative values") + } + if !ecdsa.Verify(pub, digest, ecdsaSig.R, ecdsaSig.S) { + return errors.New("x509: ECDSA verification failure") + } + return + } + return ErrUnsupportedAlgorithm +} + +// CheckCRLSignature checks that the signature in crl is from c. +func (c *Certificate) CheckCRLSignature(crl *pkix.CertificateList) (err error) { + algo := getSignatureAlgorithmFromOID(crl.SignatureAlgorithm.Algorithm) + return c.CheckSignature(algo, crl.TBSCertList.Raw, crl.SignatureValue.RightAlign()) +} + +type UnhandledCriticalExtension struct{} + +func (h UnhandledCriticalExtension) Error() string { + return "x509: unhandled critical extension" +} + +type basicConstraints struct { + IsCA bool `asn1:"optional"` + MaxPathLen int `asn1:"optional,default:-1"` +} + +// RFC 5280 4.2.1.4 +type policyInformation struct { + Policy asn1.ObjectIdentifier + // policyQualifiers omitted +} + +// RFC 5280, 4.2.1.10 +type nameConstraints struct { + Permitted []generalSubtree `asn1:"optional,tag:0"` + Excluded []generalSubtree `asn1:"optional,tag:1"` +} + +type generalSubtree struct { + Name string `asn1:"tag:2,optional,ia5"` +} + +// RFC 5280, 4.2.2.1 +type authorityInfoAccess struct { + Method asn1.ObjectIdentifier + Location asn1.RawValue +} + +// RFC 5280, 4.2.1.14 +type distributionPoint struct { + DistributionPoint distributionPointName `asn1:"optional,tag:0"` + Reason asn1.BitString `asn1:"optional,tag:1"` + CRLIssuer asn1.RawValue `asn1:"optional,tag:2"` +} + +type distributionPointName struct { + FullName asn1.RawValue `asn1:"optional,tag:0"` + RelativeName pkix.RDNSequence `asn1:"optional,tag:1"` +} + +func parsePublicKey(algo PublicKeyAlgorithm, keyData *publicKeyInfo) (interface{}, error) { + asn1Data := keyData.PublicKey.RightAlign() + switch algo { + case RSA: + p := new(rsaPublicKey) + rest, err := asn1.Unmarshal(asn1Data, p) + if err != nil { + return nil, err + } + if len(rest) != 0 { + return nil, errors.New("x509: trailing data after RSA public key") + } + + if p.N.Sign() <= 0 { + return nil, errors.New("x509: RSA modulus is not a positive number") + } + if p.E <= 0 { + return nil, errors.New("x509: RSA public exponent is not a positive number") + } + + pub := &rsa.PublicKey{ + E: p.E, + N: p.N, + } + return pub, nil + case DSA: + var p *big.Int + rest, err := asn1.Unmarshal(asn1Data, &p) + if err != nil { + return nil, err + } + if len(rest) != 0 { + return nil, errors.New("x509: trailing data after DSA public key") + } + paramsData := keyData.Algorithm.Parameters.FullBytes + params := new(dsaAlgorithmParameters) + rest, err = asn1.Unmarshal(paramsData, params) + if err != nil { + return nil, err + } + if len(rest) != 0 { + return nil, errors.New("x509: trailing data after DSA parameters") + } + if p.Sign() <= 0 || params.P.Sign() <= 0 || params.Q.Sign() <= 0 || params.G.Sign() <= 0 { + return nil, errors.New("x509: zero or negative DSA parameter") + } + pub := &dsa.PublicKey{ + Parameters: dsa.Parameters{ + P: params.P, + Q: params.Q, + G: params.G, + }, + Y: p, + } + return pub, nil + case ECDSA: + paramsData := keyData.Algorithm.Parameters.FullBytes + namedCurveOID := new(asn1.ObjectIdentifier) + rest, err := asn1.Unmarshal(paramsData, namedCurveOID) + if err != nil { + return nil, err + } + if len(rest) != 0 { + return nil, errors.New("x509: trailing data after ECDSA parameters") + } + namedCurve := namedCurveFromOID(*namedCurveOID) + if namedCurve == nil { + return nil, errors.New("x509: unsupported elliptic curve") + } + x, y := elliptic.Unmarshal(namedCurve, asn1Data) + if x == nil { + return nil, errors.New("x509: failed to unmarshal elliptic curve point") + } + pub := &ecdsa.PublicKey{ + Curve: namedCurve, + X: x, + Y: y, + } + return pub, nil + default: + return nil, nil + } +} + +func parseSANExtension(value []byte) (dnsNames, emailAddresses []string, ipAddresses []net.IP, err error) { + // RFC 5280, 4.2.1.6 + + // SubjectAltName ::= GeneralNames + // + // GeneralNames ::= SEQUENCE SIZE (1..MAX) OF GeneralName + // + // GeneralName ::= CHOICE { + // otherName [0] OtherName, + // rfc822Name [1] IA5String, + // dNSName [2] IA5String, + // x400Address [3] ORAddress, + // directoryName [4] Name, + // ediPartyName [5] EDIPartyName, + // uniformResourceIdentifier [6] IA5String, + // iPAddress [7] OCTET STRING, + // registeredID [8] OBJECT IDENTIFIER } + var seq asn1.RawValue + var rest []byte + if rest, err = asn1.Unmarshal(value, &seq); err != nil { + return + } else if len(rest) != 0 { + err = errors.New("x509: trailing data after X.509 extension") + return + } + if !seq.IsCompound || seq.Tag != 16 || seq.Class != 0 { + err = asn1.StructuralError{Msg: "bad SAN sequence"} + return + } + + rest = seq.Bytes + for len(rest) > 0 { + var v asn1.RawValue + rest, err = asn1.Unmarshal(rest, &v) + if err != nil { + return + } + switch v.Tag { + case 1: + emailAddresses = append(emailAddresses, string(v.Bytes)) + case 2: + dnsNames = append(dnsNames, string(v.Bytes)) + case 7: + switch len(v.Bytes) { + case net.IPv4len, net.IPv6len: + ipAddresses = append(ipAddresses, v.Bytes) + default: + err = errors.New("x509: certificate contained IP address of length " + strconv.Itoa(len(v.Bytes))) + return + } + } + } + + return +} + +func parseCertificate(in *certificate) (*Certificate, error) { + out := new(Certificate) + out.Raw = in.Raw + out.RawTBSCertificate = in.TBSCertificate.Raw + out.RawSubjectPublicKeyInfo = in.TBSCertificate.PublicKey.Raw + out.RawSubject = in.TBSCertificate.Subject.FullBytes + out.RawIssuer = in.TBSCertificate.Issuer.FullBytes + + out.Signature = in.SignatureValue.RightAlign() + out.SignatureAlgorithm = + getSignatureAlgorithmFromOID(in.TBSCertificate.SignatureAlgorithm.Algorithm) + + out.PublicKeyAlgorithm = + getPublicKeyAlgorithmFromOID(in.TBSCertificate.PublicKey.Algorithm.Algorithm) + var err error + out.PublicKey, err = parsePublicKey(out.PublicKeyAlgorithm, &in.TBSCertificate.PublicKey) + if err != nil { + return nil, err + } + + if in.TBSCertificate.SerialNumber.Sign() < 0 { + return nil, errors.New("x509: negative serial number") + } + + out.Version = in.TBSCertificate.Version + 1 + out.SerialNumber = in.TBSCertificate.SerialNumber + + var issuer, subject pkix.RDNSequence + if rest, err := asn1.Unmarshal(in.TBSCertificate.Subject.FullBytes, &subject); err != nil { + return nil, err + } else if len(rest) != 0 { + return nil, errors.New("x509: trailing data after X.509 subject") + } + if rest, err := asn1.Unmarshal(in.TBSCertificate.Issuer.FullBytes, &issuer); err != nil { + return nil, err + } else if len(rest) != 0 { + return nil, errors.New("x509: trailing data after X.509 subject") + } + + out.Issuer.FillFromRDNSequence(&issuer) + out.Subject.FillFromRDNSequence(&subject) + + out.NotBefore = in.TBSCertificate.Validity.NotBefore + out.NotAfter = in.TBSCertificate.Validity.NotAfter + + for _, e := range in.TBSCertificate.Extensions { + out.Extensions = append(out.Extensions, e) + unhandled := false + + if len(e.Id) == 4 && e.Id[0] == 2 && e.Id[1] == 5 && e.Id[2] == 29 { + switch e.Id[3] { + case 15: + // RFC 5280, 4.2.1.3 + var usageBits asn1.BitString + if rest, err := asn1.Unmarshal(e.Value, &usageBits); err != nil { + return nil, err + } else if len(rest) != 0 { + return nil, errors.New("x509: trailing data after X.509 KeyUsage") + } + + var usage int + for i := 0; i < 9; i++ { + if usageBits.At(i) != 0 { + usage |= 1 << uint(i) + } + } + out.KeyUsage = KeyUsage(usage) + + case 19: + // RFC 5280, 4.2.1.9 + var constraints basicConstraints + if rest, err := asn1.Unmarshal(e.Value, &constraints); err != nil { + return nil, err + } else if len(rest) != 0 { + return nil, errors.New("x509: trailing data after X.509 BasicConstraints") + } + + out.BasicConstraintsValid = true + out.IsCA = constraints.IsCA + out.MaxPathLen = constraints.MaxPathLen + out.MaxPathLenZero = out.MaxPathLen == 0 + + case 17: + out.DNSNames, out.EmailAddresses, out.IPAddresses, err = parseSANExtension(e.Value) + if err != nil { + return nil, err + } + + if len(out.DNSNames) == 0 && len(out.EmailAddresses) == 0 && len(out.IPAddresses) == 0 { + // If we didn't parse anything then we do the critical check, below. + unhandled = true + } + + case 30: + // RFC 5280, 4.2.1.10 + + // NameConstraints ::= SEQUENCE { + // permittedSubtrees [0] GeneralSubtrees OPTIONAL, + // excludedSubtrees [1] GeneralSubtrees OPTIONAL } + // + // GeneralSubtrees ::= SEQUENCE SIZE (1..MAX) OF GeneralSubtree + // + // GeneralSubtree ::= SEQUENCE { + // base GeneralName, + // minimum [0] BaseDistance DEFAULT 0, + // maximum [1] BaseDistance OPTIONAL } + // + // BaseDistance ::= INTEGER (0..MAX) + + var constraints nameConstraints + if rest, err := asn1.Unmarshal(e.Value, &constraints); err != nil { + return nil, err + } else if len(rest) != 0 { + return nil, errors.New("x509: trailing data after X.509 NameConstraints") + } + + if len(constraints.Excluded) > 0 && e.Critical { + return out, UnhandledCriticalExtension{} + } + + for _, subtree := range constraints.Permitted { + if len(subtree.Name) == 0 { + if e.Critical { + return out, UnhandledCriticalExtension{} + } + continue + } + out.PermittedDNSDomains = append(out.PermittedDNSDomains, subtree.Name) + } + + case 31: + // RFC 5280, 4.2.1.14 + + // CRLDistributionPoints ::= SEQUENCE SIZE (1..MAX) OF DistributionPoint + // + // DistributionPoint ::= SEQUENCE { + // distributionPoint [0] DistributionPointName OPTIONAL, + // reasons [1] ReasonFlags OPTIONAL, + // cRLIssuer [2] GeneralNames OPTIONAL } + // + // DistributionPointName ::= CHOICE { + // fullName [0] GeneralNames, + // nameRelativeToCRLIssuer [1] RelativeDistinguishedName } + + var cdp []distributionPoint + if rest, err := asn1.Unmarshal(e.Value, &cdp); err != nil { + return nil, err + } else if len(rest) != 0 { + return nil, errors.New("x509: trailing data after X.509 CRL distribution point") + } + + for _, dp := range cdp { + var n asn1.RawValue + if _, err := asn1.Unmarshal(dp.DistributionPoint.FullName.Bytes, &n); err != nil { + return nil, err + } + // Trailing data after the fullName is + // allowed because other elements of + // the SEQUENCE can appear. + + if n.Tag == 6 { + out.CRLDistributionPoints = append(out.CRLDistributionPoints, string(n.Bytes)) + } + } + + case 35: + // RFC 5280, 4.2.1.1 + var a authKeyId + if rest, err := asn1.Unmarshal(e.Value, &a); err != nil { + return nil, err + } else if len(rest) != 0 { + return nil, errors.New("x509: trailing data after X.509 authority key-id") + } + out.AuthorityKeyId = a.Id + + case 37: + // RFC 5280, 4.2.1.12. Extended Key Usage + + // id-ce-extKeyUsage OBJECT IDENTIFIER ::= { id-ce 37 } + // + // ExtKeyUsageSyntax ::= SEQUENCE SIZE (1..MAX) OF KeyPurposeId + // + // KeyPurposeId ::= OBJECT IDENTIFIER + + var keyUsage []asn1.ObjectIdentifier + if rest, err := asn1.Unmarshal(e.Value, &keyUsage); err != nil { + return nil, err + } else if len(rest) != 0 { + return nil, errors.New("x509: trailing data after X.509 ExtendedKeyUsage") + } + + for _, u := range keyUsage { + if extKeyUsage, ok := extKeyUsageFromOID(u); ok { + out.ExtKeyUsage = append(out.ExtKeyUsage, extKeyUsage) + } else { + out.UnknownExtKeyUsage = append(out.UnknownExtKeyUsage, u) + } + } + + case 14: + // RFC 5280, 4.2.1.2 + var keyid []byte + if rest, err := asn1.Unmarshal(e.Value, &keyid); err != nil { + return nil, err + } else if len(rest) != 0 { + return nil, errors.New("x509: trailing data after X.509 authority key-id") + } + out.SubjectKeyId = keyid + + case 32: + // RFC 5280 4.2.1.4: Certificate Policies + var policies []policyInformation + if rest, err := asn1.Unmarshal(e.Value, &policies); err != nil { + return nil, err + } else if len(rest) != 0 { + return nil, errors.New("x509: trailing data after X.509 certificate policies") + } + out.PolicyIdentifiers = make([]asn1.ObjectIdentifier, len(policies)) + for i, policy := range policies { + out.PolicyIdentifiers[i] = policy.Policy + } + + default: + // Unknown extensions are recorded if critical. + unhandled = true + } + } else if e.Id.Equal(oidExtensionAuthorityInfoAccess) { + // RFC 5280 4.2.2.1: Authority Information Access + var aia []authorityInfoAccess + if rest, err := asn1.Unmarshal(e.Value, &aia); err != nil { + return nil, err + } else if len(rest) != 0 { + return nil, errors.New("x509: trailing data after X.509 authority information") + } + + for _, v := range aia { + // GeneralName: uniformResourceIdentifier [6] IA5String + if v.Location.Tag != 6 { + continue + } + if v.Method.Equal(oidAuthorityInfoAccessOcsp) { + out.OCSPServer = append(out.OCSPServer, string(v.Location.Bytes)) + } else if v.Method.Equal(oidAuthorityInfoAccessIssuers) { + out.IssuingCertificateURL = append(out.IssuingCertificateURL, string(v.Location.Bytes)) + } + } + } else { + // Unknown extensions are recorded if critical. + unhandled = true + } + + if e.Critical && unhandled { + out.UnhandledCriticalExtensions = append(out.UnhandledCriticalExtensions, e.Id) + } + } + + return out, nil +} + +// ParseCertificate parses a single certificate from the given ASN.1 DER data. +func ParseCertificate(asn1Data []byte) (*Certificate, error) { + var cert certificate + rest, err := asn1.Unmarshal(asn1Data, &cert) + if err != nil { + return nil, err + } + if len(rest) > 0 { + return nil, asn1.SyntaxError{Msg: "trailing data"} + } + + return parseCertificate(&cert) +} + +// ParseCertificates parses one or more certificates from the given ASN.1 DER +// data. The certificates must be concatenated with no intermediate padding. +func ParseCertificates(asn1Data []byte) ([]*Certificate, error) { + var v []*certificate + + for len(asn1Data) > 0 { + cert := new(certificate) + var err error + asn1Data, err = asn1.Unmarshal(asn1Data, cert) + if err != nil { + return nil, err + } + v = append(v, cert) + } + + ret := make([]*Certificate, len(v)) + for i, ci := range v { + cert, err := parseCertificate(ci) + if err != nil { + return nil, err + } + ret[i] = cert + } + + return ret, nil +} + +func reverseBitsInAByte(in byte) byte { + b1 := in>>4 | in<<4 + b2 := b1>>2&0x33 | b1<<2&0xcc + b3 := b2>>1&0x55 | b2<<1&0xaa + return b3 +} + +// asn1BitLength returns the bit-length of bitString by considering the +// most-significant bit in a byte to be the "first" bit. This convention +// matches ASN.1, but differs from almost everything else. +func asn1BitLength(bitString []byte) int { + bitLen := len(bitString) * 8 + + for i := range bitString { + b := bitString[len(bitString)-i-1] + + for bit := uint(0); bit < 8; bit++ { + if (b>>bit)&1 == 1 { + return bitLen + } + bitLen-- + } + } + + return 0 +} + +var ( + oidExtensionSubjectKeyId = []int{2, 5, 29, 14} + oidExtensionKeyUsage = []int{2, 5, 29, 15} + oidExtensionExtendedKeyUsage = []int{2, 5, 29, 37} + oidExtensionAuthorityKeyId = []int{2, 5, 29, 35} + oidExtensionBasicConstraints = []int{2, 5, 29, 19} + oidExtensionSubjectAltName = []int{2, 5, 29, 17} + oidExtensionCertificatePolicies = []int{2, 5, 29, 32} + oidExtensionNameConstraints = []int{2, 5, 29, 30} + oidExtensionCRLDistributionPoints = []int{2, 5, 29, 31} + oidExtensionAuthorityInfoAccess = []int{1, 3, 6, 1, 5, 5, 7, 1, 1} +) + +var ( + oidAuthorityInfoAccessOcsp = asn1.ObjectIdentifier{1, 3, 6, 1, 5, 5, 7, 48, 1} + oidAuthorityInfoAccessIssuers = asn1.ObjectIdentifier{1, 3, 6, 1, 5, 5, 7, 48, 2} +) + +// oidNotInExtensions returns whether an extension with the given oid exists in +// extensions. +func oidInExtensions(oid asn1.ObjectIdentifier, extensions []pkix.Extension) bool { + for _, e := range extensions { + if e.Id.Equal(oid) { + return true + } + } + return false +} + +// marshalSANs marshals a list of addresses into a the contents of an X.509 +// SubjectAlternativeName extension. +func marshalSANs(dnsNames, emailAddresses []string, ipAddresses []net.IP) (derBytes []byte, err error) { + var rawValues []asn1.RawValue + for _, name := range dnsNames { + rawValues = append(rawValues, asn1.RawValue{Tag: 2, Class: 2, Bytes: []byte(name)}) + } + for _, email := range emailAddresses { + rawValues = append(rawValues, asn1.RawValue{Tag: 1, Class: 2, Bytes: []byte(email)}) + } + for _, rawIP := range ipAddresses { + // If possible, we always want to encode IPv4 addresses in 4 bytes. + ip := rawIP.To4() + if ip == nil { + ip = rawIP + } + rawValues = append(rawValues, asn1.RawValue{Tag: 7, Class: 2, Bytes: ip}) + } + return asn1.Marshal(rawValues) +} + +func buildExtensions(template *Certificate) (ret []pkix.Extension, err error) { + ret = make([]pkix.Extension, 10 /* maximum number of elements. */) + n := 0 + + if template.KeyUsage != 0 && + !oidInExtensions(oidExtensionKeyUsage, template.ExtraExtensions) { + ret[n].Id = oidExtensionKeyUsage + ret[n].Critical = true + + var a [2]byte + a[0] = reverseBitsInAByte(byte(template.KeyUsage)) + a[1] = reverseBitsInAByte(byte(template.KeyUsage >> 8)) + + l := 1 + if a[1] != 0 { + l = 2 + } + + bitString := a[:l] + ret[n].Value, err = asn1.Marshal(asn1.BitString{Bytes: bitString, BitLength: asn1BitLength(bitString)}) + if err != nil { + return + } + n++ + } + + if (len(template.ExtKeyUsage) > 0 || len(template.UnknownExtKeyUsage) > 0) && + !oidInExtensions(oidExtensionExtendedKeyUsage, template.ExtraExtensions) { + ret[n].Id = oidExtensionExtendedKeyUsage + + var oids []asn1.ObjectIdentifier + for _, u := range template.ExtKeyUsage { + if oid, ok := oidFromExtKeyUsage(u); ok { + oids = append(oids, oid) + } else { + panic("internal error") + } + } + + oids = append(oids, template.UnknownExtKeyUsage...) + + ret[n].Value, err = asn1.Marshal(oids) + if err != nil { + return + } + n++ + } + + if template.BasicConstraintsValid && !oidInExtensions(oidExtensionBasicConstraints, template.ExtraExtensions) { + // Leaving MaxPathLen as zero indicates that no maximum path + // length is desired, unless MaxPathLenZero is set. A value of + // -1 causes encoding/asn1 to omit the value as desired. + maxPathLen := template.MaxPathLen + if maxPathLen == 0 && !template.MaxPathLenZero { + maxPathLen = -1 + } + ret[n].Id = oidExtensionBasicConstraints + ret[n].Value, err = asn1.Marshal(basicConstraints{template.IsCA, maxPathLen}) + ret[n].Critical = true + if err != nil { + return + } + n++ + } + + if len(template.SubjectKeyId) > 0 && !oidInExtensions(oidExtensionSubjectKeyId, template.ExtraExtensions) { + ret[n].Id = oidExtensionSubjectKeyId + ret[n].Value, err = asn1.Marshal(template.SubjectKeyId) + if err != nil { + return + } + n++ + } + + if len(template.AuthorityKeyId) > 0 && !oidInExtensions(oidExtensionAuthorityKeyId, template.ExtraExtensions) { + ret[n].Id = oidExtensionAuthorityKeyId + ret[n].Value, err = asn1.Marshal(authKeyId{template.AuthorityKeyId}) + if err != nil { + return + } + n++ + } + + if (len(template.OCSPServer) > 0 || len(template.IssuingCertificateURL) > 0) && + !oidInExtensions(oidExtensionAuthorityInfoAccess, template.ExtraExtensions) { + ret[n].Id = oidExtensionAuthorityInfoAccess + var aiaValues []authorityInfoAccess + for _, name := range template.OCSPServer { + aiaValues = append(aiaValues, authorityInfoAccess{ + Method: oidAuthorityInfoAccessOcsp, + Location: asn1.RawValue{Tag: 6, Class: 2, Bytes: []byte(name)}, + }) + } + for _, name := range template.IssuingCertificateURL { + aiaValues = append(aiaValues, authorityInfoAccess{ + Method: oidAuthorityInfoAccessIssuers, + Location: asn1.RawValue{Tag: 6, Class: 2, Bytes: []byte(name)}, + }) + } + ret[n].Value, err = asn1.Marshal(aiaValues) + if err != nil { + return + } + n++ + } + + if (len(template.DNSNames) > 0 || len(template.EmailAddresses) > 0 || len(template.IPAddresses) > 0) && + !oidInExtensions(oidExtensionSubjectAltName, template.ExtraExtensions) { + ret[n].Id = oidExtensionSubjectAltName + ret[n].Value, err = marshalSANs(template.DNSNames, template.EmailAddresses, template.IPAddresses) + if err != nil { + return + } + n++ + } + + if len(template.PolicyIdentifiers) > 0 && + !oidInExtensions(oidExtensionCertificatePolicies, template.ExtraExtensions) { + ret[n].Id = oidExtensionCertificatePolicies + policies := make([]policyInformation, len(template.PolicyIdentifiers)) + for i, policy := range template.PolicyIdentifiers { + policies[i].Policy = policy + } + ret[n].Value, err = asn1.Marshal(policies) + if err != nil { + return + } + n++ + } + + if len(template.PermittedDNSDomains) > 0 && + !oidInExtensions(oidExtensionNameConstraints, template.ExtraExtensions) { + ret[n].Id = oidExtensionNameConstraints + ret[n].Critical = template.PermittedDNSDomainsCritical + + var out nameConstraints + out.Permitted = make([]generalSubtree, len(template.PermittedDNSDomains)) + for i, permitted := range template.PermittedDNSDomains { + out.Permitted[i] = generalSubtree{Name: permitted} + } + ret[n].Value, err = asn1.Marshal(out) + if err != nil { + return + } + n++ + } + + if len(template.CRLDistributionPoints) > 0 && + !oidInExtensions(oidExtensionCRLDistributionPoints, template.ExtraExtensions) { + ret[n].Id = oidExtensionCRLDistributionPoints + + var crlDp []distributionPoint + for _, name := range template.CRLDistributionPoints { + rawFullName, _ := asn1.Marshal(asn1.RawValue{Tag: 6, Class: 2, Bytes: []byte(name)}) + + dp := distributionPoint{ + DistributionPoint: distributionPointName{ + FullName: asn1.RawValue{Tag: 0, Class: 2, IsCompound: true, Bytes: rawFullName}, + }, + } + crlDp = append(crlDp, dp) + } + + ret[n].Value, err = asn1.Marshal(crlDp) + if err != nil { + return + } + n++ + } + + // Adding another extension here? Remember to update the maximum number + // of elements in the make() at the top of the function. + + return append(ret[:n], template.ExtraExtensions...), nil +} + +func subjectBytes(cert *Certificate) ([]byte, error) { + if len(cert.RawSubject) > 0 { + return cert.RawSubject, nil + } + + return asn1.Marshal(cert.Subject.ToRDNSequence()) +} + +// signingParamsForPublicKey returns the parameters to use for signing with +// priv. If requestedSigAlgo is not zero then it overrides the default +// signature algorithm. +func signingParamsForPublicKey(pub interface{}, requestedSigAlgo SignatureAlgorithm) (hashFunc crypto.Hash, sigAlgo pkix.AlgorithmIdentifier, err error) { + var pubType PublicKeyAlgorithm + + switch pub := pub.(type) { + case *rsa.PublicKey: + pubType = RSA + hashFunc = crypto.SHA256 + sigAlgo.Algorithm = oidSignatureSHA256WithRSA + sigAlgo.Parameters = asn1.RawValue{ + Tag: 5, + } + + case *ecdsa.PublicKey: + pubType = ECDSA + + switch pub.Curve { + case elliptic.P224(), elliptic.P256(): + hashFunc = crypto.SHA256 + sigAlgo.Algorithm = oidSignatureECDSAWithSHA256 + case elliptic.P384(): + hashFunc = crypto.SHA384 + sigAlgo.Algorithm = oidSignatureECDSAWithSHA384 + case elliptic.P521(): + hashFunc = crypto.SHA512 + sigAlgo.Algorithm = oidSignatureECDSAWithSHA512 + default: + err = errors.New("x509: unknown elliptic curve") + } + + default: + err = errors.New("x509: only RSA and ECDSA keys supported") + } + + if err != nil { + return + } + + if requestedSigAlgo == 0 { + return + } + + found := false + for _, details := range signatureAlgorithmDetails { + if details.algo == requestedSigAlgo { + if details.pubKeyAlgo != pubType { + err = errors.New("x509: requested SignatureAlgorithm does not match private key type") + return + } + sigAlgo.Algorithm, hashFunc = details.oid, details.hash + if hashFunc == 0 { + err = errors.New("x509: cannot sign with hash function requested") + return + } + found = true + break + } + } + + if !found { + err = errors.New("x509: unknown SignatureAlgorithm") + } + + return +} + +// CreateCertificate creates a new certificate based on a template. The +// following members of template are used: SerialNumber, Subject, NotBefore, +// NotAfter, KeyUsage, ExtKeyUsage, UnknownExtKeyUsage, BasicConstraintsValid, +// IsCA, MaxPathLen, SubjectKeyId, DNSNames, PermittedDNSDomainsCritical, +// PermittedDNSDomains, SignatureAlgorithm. +// +// The certificate is signed by parent. If parent is equal to template then the +// certificate is self-signed. The parameter pub is the public key of the +// signee and priv is the private key of the signer. +// +// The returned slice is the certificate in DER encoding. +// +// All keys types that are implemented via crypto.Signer are supported (This +// includes *rsa.PublicKey and *ecdsa.PublicKey.) +func CreateCertificate(rand io.Reader, template, parent *Certificate, pub, priv interface{}) (cert []byte, err error) { + key, ok := priv.(crypto.Signer) + if !ok { + return nil, errors.New("x509: certificate private key does not implement crypto.Signer") + } + + hashFunc, signatureAlgorithm, err := signingParamsForPublicKey(key.Public(), template.SignatureAlgorithm) + if err != nil { + return nil, err + } + + publicKeyBytes, publicKeyAlgorithm, err := marshalPublicKey(pub) + if err != nil { + return nil, err + } + + if len(parent.SubjectKeyId) > 0 { + template.AuthorityKeyId = parent.SubjectKeyId + } + + extensions, err := buildExtensions(template) + if err != nil { + return + } + + asn1Issuer, err := subjectBytes(parent) + if err != nil { + return + } + + asn1Subject, err := subjectBytes(template) + if err != nil { + return + } + + encodedPublicKey := asn1.BitString{BitLength: len(publicKeyBytes) * 8, Bytes: publicKeyBytes} + c := tbsCertificate{ + Version: 2, + SerialNumber: template.SerialNumber, + SignatureAlgorithm: signatureAlgorithm, + Issuer: asn1.RawValue{FullBytes: asn1Issuer}, + Validity: validity{template.NotBefore.UTC(), template.NotAfter.UTC()}, + Subject: asn1.RawValue{FullBytes: asn1Subject}, + PublicKey: publicKeyInfo{nil, publicKeyAlgorithm, encodedPublicKey}, + Extensions: extensions, + } + + tbsCertContents, err := asn1.Marshal(c) + if err != nil { + return + } + + c.Raw = tbsCertContents + + h := hashFunc.New() + h.Write(tbsCertContents) + digest := h.Sum(nil) + + var signature []byte + signature, err = key.Sign(rand, digest, hashFunc) + if err != nil { + return + } + + return asn1.Marshal(certificate{ + nil, + c, + signatureAlgorithm, + asn1.BitString{Bytes: signature, BitLength: len(signature) * 8}, + }) +} + +// pemCRLPrefix is the magic string that indicates that we have a PEM encoded +// CRL. +var pemCRLPrefix = []byte("-----BEGIN X509 CRL") + +// pemType is the type of a PEM encoded CRL. +var pemType = "X509 CRL" + +// ParseCRL parses a CRL from the given bytes. It's often the case that PEM +// encoded CRLs will appear where they should be DER encoded, so this function +// will transparently handle PEM encoding as long as there isn't any leading +// garbage. +func ParseCRL(crlBytes []byte) (certList *pkix.CertificateList, err error) { + if bytes.HasPrefix(crlBytes, pemCRLPrefix) { + block, _ := pem.Decode(crlBytes) + if block != nil && block.Type == pemType { + crlBytes = block.Bytes + } + } + return ParseDERCRL(crlBytes) +} + +// ParseDERCRL parses a DER encoded CRL from the given bytes. +func ParseDERCRL(derBytes []byte) (certList *pkix.CertificateList, err error) { + certList = new(pkix.CertificateList) + if rest, err := asn1.Unmarshal(derBytes, certList); err != nil { + return nil, err + } else if len(rest) != 0 { + return nil, errors.New("x509: trailing data after CRL") + } + return certList, nil +} + +// CreateCRL returns a DER encoded CRL, signed by this Certificate, that +// contains the given list of revoked certificates. +func (c *Certificate) CreateCRL(rand io.Reader, priv interface{}, revokedCerts []pkix.RevokedCertificate, now, expiry time.Time) (crlBytes []byte, err error) { + key, ok := priv.(crypto.Signer) + if !ok { + return nil, errors.New("x509: certificate private key does not implement crypto.Signer") + } + + hashFunc, signatureAlgorithm, err := signingParamsForPublicKey(key.Public(), 0) + if err != nil { + return nil, err + } + + tbsCertList := pkix.TBSCertificateList{ + Version: 1, + Signature: signatureAlgorithm, + Issuer: c.Subject.ToRDNSequence(), + ThisUpdate: now.UTC(), + NextUpdate: expiry.UTC(), + RevokedCertificates: revokedCerts, + } + + // Authority Key Id + if len(c.SubjectKeyId) > 0 { + var aki pkix.Extension + aki.Id = oidExtensionAuthorityKeyId + aki.Value, err = asn1.Marshal(authKeyId{Id: c.SubjectKeyId}) + if err != nil { + return + } + tbsCertList.Extensions = append(tbsCertList.Extensions, aki) + } + + tbsCertListContents, err := asn1.Marshal(tbsCertList) + if err != nil { + return + } + + h := hashFunc.New() + h.Write(tbsCertListContents) + digest := h.Sum(nil) + + var signature []byte + signature, err = key.Sign(rand, digest, hashFunc) + if err != nil { + return + } + + return asn1.Marshal(pkix.CertificateList{ + TBSCertList: tbsCertList, + SignatureAlgorithm: signatureAlgorithm, + SignatureValue: asn1.BitString{Bytes: signature, BitLength: len(signature) * 8}, + }) +} + +// CertificateRequest represents a PKCS #10, certificate signature request. +type CertificateRequest struct { + Raw []byte // Complete ASN.1 DER content (CSR, signature algorithm and signature). + RawTBSCertificateRequest []byte // Certificate request info part of raw ASN.1 DER content. + RawSubjectPublicKeyInfo []byte // DER encoded SubjectPublicKeyInfo. + RawSubject []byte // DER encoded Subject. + + Version int + Signature []byte + SignatureAlgorithm SignatureAlgorithm + + PublicKeyAlgorithm PublicKeyAlgorithm + PublicKey interface{} + + Subject pkix.Name + + // Attributes is a collection of attributes providing + // additional information about the subject of the certificate. + // See RFC 2986 section 4.1. + Attributes []pkix.AttributeTypeAndValueSET + + // Extensions contains raw X.509 extensions. When parsing CSRs, this + // can be used to extract extensions that are not parsed by this + // package. + Extensions []pkix.Extension + + // ExtraExtensions contains extensions to be copied, raw, into any + // marshaled CSR. Values override any extensions that would otherwise + // be produced based on the other fields but are overridden by any + // extensions specified in Attributes. + // + // The ExtraExtensions field is not populated when parsing CSRs, see + // Extensions. + ExtraExtensions []pkix.Extension + + // Subject Alternate Name values. + DNSNames []string + EmailAddresses []string + IPAddresses []net.IP +} + +// These structures reflect the ASN.1 structure of X.509 certificate +// signature requests (see RFC 2986): + +type tbsCertificateRequest struct { + Raw asn1.RawContent + Version int + Subject asn1.RawValue + PublicKey publicKeyInfo + RawAttributes []asn1.RawValue `asn1:"tag:0"` +} + +type certificateRequest struct { + Raw asn1.RawContent + TBSCSR tbsCertificateRequest + SignatureAlgorithm pkix.AlgorithmIdentifier + SignatureValue asn1.BitString +} + +// oidExtensionRequest is a PKCS#9 OBJECT IDENTIFIER that indicates requested +// extensions in a CSR. +var oidExtensionRequest = asn1.ObjectIdentifier{1, 2, 840, 113549, 1, 9, 14} + +// newRawAttributes converts AttributeTypeAndValueSETs from a template +// CertificateRequest's Attributes into tbsCertificateRequest RawAttributes. +func newRawAttributes(attributes []pkix.AttributeTypeAndValueSET) ([]asn1.RawValue, error) { + var rawAttributes []asn1.RawValue + b, err := asn1.Marshal(attributes) + rest, err := asn1.Unmarshal(b, &rawAttributes) + if err != nil { + return nil, err + } + if len(rest) != 0 { + return nil, errors.New("x509: failed to unmarshall raw CSR Attributes") + } + return rawAttributes, nil +} + +// parseRawAttributes Unmarshals RawAttributes intos AttributeTypeAndValueSETs. +func parseRawAttributes(rawAttributes []asn1.RawValue) []pkix.AttributeTypeAndValueSET { + var attributes []pkix.AttributeTypeAndValueSET + for _, rawAttr := range rawAttributes { + var attr pkix.AttributeTypeAndValueSET + rest, err := asn1.Unmarshal(rawAttr.FullBytes, &attr) + // Ignore attributes that don't parse into pkix.AttributeTypeAndValueSET + // (i.e.: challengePassword or unstructuredName). + if err == nil && len(rest) == 0 { + attributes = append(attributes, attr) + } + } + return attributes +} + +// CreateCertificateRequest creates a new certificate based on a template. The +// following members of template are used: Subject, Attributes, +// SignatureAlgorithm, Extensions, DNSNames, EmailAddresses, and IPAddresses. +// The private key is the private key of the signer. +// +// The returned slice is the certificate request in DER encoding. +// +// All keys types that are implemented via crypto.Signer are supported (This +// includes *rsa.PublicKey and *ecdsa.PublicKey.) +func CreateCertificateRequest(rand io.Reader, template *CertificateRequest, priv interface{}) (csr []byte, err error) { + key, ok := priv.(crypto.Signer) + if !ok { + return nil, errors.New("x509: certificate private key does not implement crypto.Signer") + } + + var hashFunc crypto.Hash + var sigAlgo pkix.AlgorithmIdentifier + hashFunc, sigAlgo, err = signingParamsForPublicKey(key.Public(), template.SignatureAlgorithm) + if err != nil { + return nil, err + } + + var publicKeyBytes []byte + var publicKeyAlgorithm pkix.AlgorithmIdentifier + publicKeyBytes, publicKeyAlgorithm, err = marshalPublicKey(key.Public()) + if err != nil { + return nil, err + } + + var extensions []pkix.Extension + + if (len(template.DNSNames) > 0 || len(template.EmailAddresses) > 0 || len(template.IPAddresses) > 0) && + !oidInExtensions(oidExtensionSubjectAltName, template.ExtraExtensions) { + sanBytes, err := marshalSANs(template.DNSNames, template.EmailAddresses, template.IPAddresses) + if err != nil { + return nil, err + } + + extensions = append(extensions, pkix.Extension{ + Id: oidExtensionSubjectAltName, + Value: sanBytes, + }) + } + + extensions = append(extensions, template.ExtraExtensions...) + + var attributes []pkix.AttributeTypeAndValueSET + attributes = append(attributes, template.Attributes...) + + if len(extensions) > 0 { + // specifiedExtensions contains all the extensions that we + // found specified via template.Attributes. + specifiedExtensions := make(map[string]bool) + + for _, atvSet := range template.Attributes { + if !atvSet.Type.Equal(oidExtensionRequest) { + continue + } + + for _, atvs := range atvSet.Value { + for _, atv := range atvs { + specifiedExtensions[atv.Type.String()] = true + } + } + } + + atvs := make([]pkix.AttributeTypeAndValue, 0, len(extensions)) + for _, e := range extensions { + if specifiedExtensions[e.Id.String()] { + // Attributes already contained a value for + // this extension and it takes priority. + continue + } + + atvs = append(atvs, pkix.AttributeTypeAndValue{ + // There is no place for the critical flag in a CSR. + Type: e.Id, + Value: e.Value, + }) + } + + // Append the extensions to an existing attribute if possible. + appended := false + for _, atvSet := range attributes { + if !atvSet.Type.Equal(oidExtensionRequest) || len(atvSet.Value) == 0 { + continue + } + + atvSet.Value[0] = append(atvSet.Value[0], atvs...) + appended = true + break + } + + // Otherwise, add a new attribute for the extensions. + if !appended { + attributes = append(attributes, pkix.AttributeTypeAndValueSET{ + Type: oidExtensionRequest, + Value: [][]pkix.AttributeTypeAndValue{ + atvs, + }, + }) + } + } + + asn1Subject := template.RawSubject + if len(asn1Subject) == 0 { + asn1Subject, err = asn1.Marshal(template.Subject.ToRDNSequence()) + if err != nil { + return + } + } + + rawAttributes, err := newRawAttributes(attributes) + if err != nil { + return + } + + tbsCSR := tbsCertificateRequest{ + Version: 0, // PKCS #10, RFC 2986 + Subject: asn1.RawValue{FullBytes: asn1Subject}, + PublicKey: publicKeyInfo{ + Algorithm: publicKeyAlgorithm, + PublicKey: asn1.BitString{ + Bytes: publicKeyBytes, + BitLength: len(publicKeyBytes) * 8, + }, + }, + RawAttributes: rawAttributes, + } + + tbsCSRContents, err := asn1.Marshal(tbsCSR) + if err != nil { + return + } + tbsCSR.Raw = tbsCSRContents + + h := hashFunc.New() + h.Write(tbsCSRContents) + digest := h.Sum(nil) + + var signature []byte + signature, err = key.Sign(rand, digest, hashFunc) + if err != nil { + return + } + + return asn1.Marshal(certificateRequest{ + TBSCSR: tbsCSR, + SignatureAlgorithm: sigAlgo, + SignatureValue: asn1.BitString{ + Bytes: signature, + BitLength: len(signature) * 8, + }, + }) +} + +// ParseCertificateRequest parses a single certificate request from the +// given ASN.1 DER data. +func ParseCertificateRequest(asn1Data []byte) (*CertificateRequest, error) { + var csr certificateRequest + + rest, err := asn1.Unmarshal(asn1Data, &csr) + if err != nil { + return nil, err + } else if len(rest) != 0 { + return nil, asn1.SyntaxError{Msg: "trailing data"} + } + + return parseCertificateRequest(&csr) +} + +func parseCertificateRequest(in *certificateRequest) (*CertificateRequest, error) { + out := &CertificateRequest{ + Raw: in.Raw, + RawTBSCertificateRequest: in.TBSCSR.Raw, + RawSubjectPublicKeyInfo: in.TBSCSR.PublicKey.Raw, + RawSubject: in.TBSCSR.Subject.FullBytes, + + Signature: in.SignatureValue.RightAlign(), + SignatureAlgorithm: getSignatureAlgorithmFromOID(in.SignatureAlgorithm.Algorithm), + + PublicKeyAlgorithm: getPublicKeyAlgorithmFromOID(in.TBSCSR.PublicKey.Algorithm.Algorithm), + + Version: in.TBSCSR.Version, + Attributes: parseRawAttributes(in.TBSCSR.RawAttributes), + } + + var err error + out.PublicKey, err = parsePublicKey(out.PublicKeyAlgorithm, &in.TBSCSR.PublicKey) + if err != nil { + return nil, err + } + + var subject pkix.RDNSequence + if rest, err := asn1.Unmarshal(in.TBSCSR.Subject.FullBytes, &subject); err != nil { + return nil, err + } else if len(rest) != 0 { + return nil, errors.New("x509: trailing data after X.509 Subject") + } + + out.Subject.FillFromRDNSequence(&subject) + + var extensions []pkix.AttributeTypeAndValue + + for _, atvSet := range out.Attributes { + if !atvSet.Type.Equal(oidExtensionRequest) { + continue + } + + for _, atvs := range atvSet.Value { + extensions = append(extensions, atvs...) + } + } + + out.Extensions = make([]pkix.Extension, 0, len(extensions)) + + for _, e := range extensions { + value, ok := e.Value.([]byte) + if !ok { + return nil, errors.New("x509: extension attribute contained non-OCTET STRING data") + } + + out.Extensions = append(out.Extensions, pkix.Extension{ + Id: e.Type, + Value: value, + }) + + if len(e.Type) == 4 && e.Type[0] == 2 && e.Type[1] == 5 && e.Type[2] == 29 { + switch e.Type[3] { + case 17: + out.DNSNames, out.EmailAddresses, out.IPAddresses, err = parseSANExtension(value) + if err != nil { + return nil, err + } + } + } + } + + return out, nil +} + +// CheckSignature verifies that the signature on c is a valid signature +func (c *CertificateRequest) CheckSignature() (err error) { + return checkSignature(c.SignatureAlgorithm, c.RawTBSCertificateRequest, c.Signature, c.PublicKey) +} diff --git a/src/crypto/x509/x509_test.go b/src/crypto/x509/x509_test.go new file mode 100644 index 0000000000000000000000000000000000000000..f4f9fa2f7f9e39e322281679a2687181d7459927 --- /dev/null +++ b/src/crypto/x509/x509_test.go @@ -0,0 +1,1178 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package x509 + +import ( + "bytes" + "crypto/dsa" + "crypto/ecdsa" + "crypto/elliptic" + "crypto/rand" + "crypto/rsa" + _ "crypto/sha256" + _ "crypto/sha512" + "crypto/x509/pkix" + "encoding/asn1" + "encoding/base64" + "encoding/hex" + "encoding/pem" + "internal/testenv" + "math/big" + "net" + "os/exec" + "reflect" + "testing" + "time" +) + +func TestParsePKCS1PrivateKey(t *testing.T) { + block, _ := pem.Decode([]byte(pemPrivateKey)) + priv, err := ParsePKCS1PrivateKey(block.Bytes) + if err != nil { + t.Errorf("Failed to parse private key: %s", err) + return + } + if priv.PublicKey.N.Cmp(rsaPrivateKey.PublicKey.N) != 0 || + priv.PublicKey.E != rsaPrivateKey.PublicKey.E || + priv.D.Cmp(rsaPrivateKey.D) != 0 || + priv.Primes[0].Cmp(rsaPrivateKey.Primes[0]) != 0 || + priv.Primes[1].Cmp(rsaPrivateKey.Primes[1]) != 0 { + t.Errorf("got:%+v want:%+v", priv, rsaPrivateKey) + } + + // This private key includes an invalid prime that + // rsa.PrivateKey.Validate should reject. + data := []byte("0\x16\x02\x00\x02\x02\u007f\x00\x02\x0200\x02\x0200\x02\x02\x00\x01\x02\x02\u007f\x00") + if _, err := ParsePKCS1PrivateKey(data); err == nil { + t.Errorf("parsing invalid private key did not result in an error") + } +} + +func TestParsePKIXPublicKey(t *testing.T) { + block, _ := pem.Decode([]byte(pemPublicKey)) + pub, err := ParsePKIXPublicKey(block.Bytes) + if err != nil { + t.Errorf("Failed to parse RSA public key: %s", err) + return + } + rsaPub, ok := pub.(*rsa.PublicKey) + if !ok { + t.Errorf("Value returned from ParsePKIXPublicKey was not an RSA public key") + return + } + + pubBytes2, err := MarshalPKIXPublicKey(rsaPub) + if err != nil { + t.Errorf("Failed to marshal RSA public key for the second time: %s", err) + return + } + if !bytes.Equal(pubBytes2, block.Bytes) { + t.Errorf("Reserialization of public key didn't match. got %x, want %x", pubBytes2, block.Bytes) + } +} + +var pemPublicKey = `-----BEGIN PUBLIC KEY----- +MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA3VoPN9PKUjKFLMwOge6+ +wnDi8sbETGIx2FKXGgqtAKpzmem53kRGEQg8WeqRmp12wgp74TGpkEXsGae7RS1k +enJCnma4fii+noGH7R0qKgHvPrI2Bwa9hzsH8tHxpyM3qrXslOmD45EH9SxIDUBJ +FehNdaPbLP1gFyahKMsdfxFJLUvbUycuZSJ2ZnIgeVxwm4qbSvZInL9Iu4FzuPtg +fINKcbbovy1qq4KvPIrXzhbY3PWDc6btxCf3SE0JdE1MCPThntB62/bLMSQ7xdDR +FF53oIpvxe/SCOymfWq/LW849Ytv3Xwod0+wzAP8STXG4HSELS4UedPYeHJJJYcZ ++QIDAQAB +-----END PUBLIC KEY----- +` + +var pemPrivateKey = `-----BEGIN RSA PRIVATE KEY----- +MIIBOgIBAAJBALKZD0nEffqM1ACuak0bijtqE2QrI/KLADv7l3kK3ppMyCuLKoF0 +fd7Ai2KW5ToIwzFofvJcS/STa6HA5gQenRUCAwEAAQJBAIq9amn00aS0h/CrjXqu +/ThglAXJmZhOMPVn4eiu7/ROixi9sex436MaVeMqSNf7Ex9a8fRNfWss7Sqd9eWu +RTUCIQDasvGASLqmjeffBNLTXV2A5g4t+kLVCpsEIZAycV5GswIhANEPLmax0ME/ +EO+ZJ79TJKN5yiGBRsv5yvx5UiHxajEXAiAhAol5N4EUyq6I9w1rYdhPMGpLfk7A +IU2snfRJ6Nq2CQIgFrPsWRCkV+gOYcajD17rEqmuLrdIRexpg8N1DOSXoJ8CIGlS +tAboUGBxTDq3ZroNism3DaMIbKPyYrAqhKov1h5V +-----END RSA PRIVATE KEY----- +` + +func bigFromString(s string) *big.Int { + ret := new(big.Int) + ret.SetString(s, 10) + return ret +} + +func fromBase10(base10 string) *big.Int { + i := new(big.Int) + i.SetString(base10, 10) + return i +} + +func bigFromHexString(s string) *big.Int { + ret := new(big.Int) + ret.SetString(s, 16) + return ret +} + +var rsaPrivateKey = &rsa.PrivateKey{ + PublicKey: rsa.PublicKey{ + N: bigFromString("9353930466774385905609975137998169297361893554149986716853295022578535724979677252958524466350471210367835187480748268864277464700638583474144061408845077"), + E: 65537, + }, + D: bigFromString("7266398431328116344057699379749222532279343923819063639497049039389899328538543087657733766554155839834519529439851673014800261285757759040931985506583861"), + Primes: []*big.Int{ + bigFromString("98920366548084643601728869055592650835572950932266967461790948584315647051443"), + bigFromString("94560208308847015747498523884063394671606671904944666360068158221458669711639"), + }, +} + +func TestMarshalRSAPrivateKey(t *testing.T) { + priv := &rsa.PrivateKey{ + PublicKey: rsa.PublicKey{ + N: fromBase10("16346378922382193400538269749936049106320265317511766357599732575277382844051791096569333808598921852351577762718529818072849191122419410612033592401403764925096136759934497687765453905884149505175426053037420486697072448609022753683683718057795566811401938833367954642951433473337066311978821180526439641496973296037000052546108507805269279414789035461158073156772151892452251106173507240488993608650881929629163465099476849643165682709047462010581308719577053905787496296934240246311806555924593059995202856826239801816771116902778517096212527979497399966526283516447337775509777558018145573127308919204297111496233"), + E: 3, + }, + D: fromBase10("10897585948254795600358846499957366070880176878341177571733155050184921896034527397712889205732614568234385175145686545381899460748279607074689061600935843283397424506622998458510302603922766336783617368686090042765718290914099334449154829375179958369993407724946186243249568928237086215759259909861748642124071874879861299389874230489928271621259294894142840428407196932444474088857746123104978617098858619445675532587787023228852383149557470077802718705420275739737958953794088728369933811184572620857678792001136676902250566845618813972833750098806496641114644760255910789397593428910198080271317419213080834885003"), + Primes: []*big.Int{ + fromBase10("1025363189502892836833747188838978207017355117492483312747347695538428729137306368764177201532277413433182799108299960196606011786562992097313508180436744488171474690412562218914213688661311117337381958560443"), + fromBase10("3467903426626310123395340254094941045497208049900750380025518552334536945536837294961497712862519984786362199788654739924501424784631315081391467293694361474867825728031147665777546570788493758372218019373"), + fromBase10("4597024781409332673052708605078359346966325141767460991205742124888960305710298765592730135879076084498363772408626791576005136245060321874472727132746643162385746062759369754202494417496879741537284589047"), + }, + } + + derBytes := MarshalPKCS1PrivateKey(priv) + + priv2, err := ParsePKCS1PrivateKey(derBytes) + if err != nil { + t.Errorf("error parsing serialized key: %s", err) + return + } + if priv.PublicKey.N.Cmp(priv2.PublicKey.N) != 0 || + priv.PublicKey.E != priv2.PublicKey.E || + priv.D.Cmp(priv2.D) != 0 || + len(priv2.Primes) != 3 || + priv.Primes[0].Cmp(priv2.Primes[0]) != 0 || + priv.Primes[1].Cmp(priv2.Primes[1]) != 0 || + priv.Primes[2].Cmp(priv2.Primes[2]) != 0 { + t.Errorf("got:%+v want:%+v", priv, priv2) + } +} + +type matchHostnamesTest struct { + pattern, host string + ok bool +} + +var matchHostnamesTests = []matchHostnamesTest{ + {"a.b.c", "a.b.c", true}, + {"a.b.c", "b.b.c", false}, + {"", "b.b.c", false}, + {"a.b.c", "", false}, + {"example.com", "example.com", true}, + {"example.com", "www.example.com", false}, + {"*.example.com", "example.com", false}, + {"*.example.com", "www.example.com", true}, + {"*.example.com", "www.example.com.", true}, + {"*.example.com", "xyz.www.example.com", false}, + {"*.*.example.com", "xyz.www.example.com", false}, + {"*.www.*.com", "xyz.www.example.com", false}, + {"*bar.example.com", "foobar.example.com", false}, + {"f*.example.com", "foobar.example.com", false}, + {"", ".", false}, + {".", "", false}, + {".", ".", false}, + {"example.com", "example.com.", true}, + {"example.com.", "example.com", true}, + {"example.com.", "example.com.", true}, + {"*.com.", "example.com.", true}, + {"*.com.", "example.com", true}, + {"*.com", "example.com", true}, + {"*.com", "example.com.", true}, +} + +func TestMatchHostnames(t *testing.T) { + for i, test := range matchHostnamesTests { + r := matchHostnames(test.pattern, test.host) + if r != test.ok { + t.Errorf("#%d mismatch got: %t want: %t when matching '%s' against '%s'", i, r, test.ok, test.host, test.pattern) + } + } +} + +func TestMatchIP(t *testing.T) { + // Check that pattern matching is working. + c := &Certificate{ + DNSNames: []string{"*.foo.bar.baz"}, + Subject: pkix.Name{ + CommonName: "*.foo.bar.baz", + }, + } + err := c.VerifyHostname("quux.foo.bar.baz") + if err != nil { + t.Fatalf("VerifyHostname(quux.foo.bar.baz): %v", err) + } + + // But check that if we change it to be matching against an IP address, + // it is rejected. + c = &Certificate{ + DNSNames: []string{"*.2.3.4"}, + Subject: pkix.Name{ + CommonName: "*.2.3.4", + }, + } + err = c.VerifyHostname("1.2.3.4") + if err == nil { + t.Fatalf("VerifyHostname(1.2.3.4) should have failed, did not") + } + + c = &Certificate{ + IPAddresses: []net.IP{net.ParseIP("127.0.0.1"), net.ParseIP("::1")}, + } + err = c.VerifyHostname("127.0.0.1") + if err != nil { + t.Fatalf("VerifyHostname(127.0.0.1): %v", err) + } + err = c.VerifyHostname("::1") + if err != nil { + t.Fatalf("VerifyHostname(::1): %v", err) + } + err = c.VerifyHostname("[::1]") + if err != nil { + t.Fatalf("VerifyHostname([::1]): %v", err) + } +} + +func TestCertificateParse(t *testing.T) { + s, _ := hex.DecodeString(certBytes) + certs, err := ParseCertificates(s) + if err != nil { + t.Error(err) + } + if len(certs) != 2 { + t.Errorf("Wrong number of certs: got %d want 2", len(certs)) + return + } + + err = certs[0].CheckSignatureFrom(certs[1]) + if err != nil { + t.Error(err) + } + + if err := certs[0].VerifyHostname("mail.google.com"); err != nil { + t.Error(err) + } + + const expectedExtensions = 4 + if n := len(certs[0].Extensions); n != expectedExtensions { + t.Errorf("want %d extensions, got %d", expectedExtensions, n) + } +} + +var certBytes = "308203223082028ba00302010202106edf0d9499fd4533dd1297fc42a93be1300d06092a864886" + + "f70d0101050500304c310b3009060355040613025a4131253023060355040a131c546861777465" + + "20436f6e73756c74696e67202850747929204c74642e311630140603550403130d546861777465" + + "20534743204341301e170d3039303332353136343932395a170d3130303332353136343932395a" + + "3069310b3009060355040613025553311330110603550408130a43616c69666f726e6961311630" + + "140603550407130d4d6f756e7461696e205669657731133011060355040a130a476f6f676c6520" + + "496e63311830160603550403130f6d61696c2e676f6f676c652e636f6d30819f300d06092a8648" + + "86f70d010101050003818d0030818902818100c5d6f892fccaf5614b064149e80a2c9581a218ef" + + "41ec35bd7a58125ae76f9ea54ddc893abbeb029f6b73616bf0ffd868791fba7af9c4aebf3706ba" + + "3eeaeed27435b4ddcfb157c05f351d66aa87fee0de072d66d773affbd36ab78bef090e0cc861a9" + + "03ac90dd98b51c9c41566c017f0beec3bff391051ffba0f5cc6850ad2a590203010001a381e730" + + "81e430280603551d250421301f06082b0601050507030106082b06010505070302060960864801" + + "86f842040130360603551d1f042f302d302ba029a0278625687474703a2f2f63726c2e74686177" + + "74652e636f6d2f54686177746553474343412e63726c307206082b060105050701010466306430" + + "2206082b060105050730018616687474703a2f2f6f6373702e7468617774652e636f6d303e0608" + + "2b060105050730028632687474703a2f2f7777772e7468617774652e636f6d2f7265706f736974" + + "6f72792f5468617774655f5347435f43412e637274300c0603551d130101ff04023000300d0609" + + "2a864886f70d01010505000381810062f1f3050ebc105e497c7aedf87e24d2f4a986bb3b837bd1" + + "9b91ebcad98b065992f6bd2b49b7d6d3cb2e427a99d606c7b1d46352527fac39e6a8b6726de5bf" + + "70212a52cba07634a5e332011bd1868e78eb5e3c93cf03072276786f207494feaa0ed9d53b2110" + + "a76571f90209cdae884385c882587030ee15f33d761e2e45a6bc308203233082028ca003020102" + + "020430000002300d06092a864886f70d0101050500305f310b3009060355040613025553311730" + + "15060355040a130e566572695369676e2c20496e632e31373035060355040b132e436c61737320" + + "33205075626c6963205072696d6172792043657274696669636174696f6e20417574686f726974" + + "79301e170d3034303531333030303030305a170d3134303531323233353935395a304c310b3009" + + "060355040613025a4131253023060355040a131c54686177746520436f6e73756c74696e672028" + + "50747929204c74642e311630140603550403130d5468617774652053474320434130819f300d06" + + "092a864886f70d010101050003818d0030818902818100d4d367d08d157faecd31fe7d1d91a13f" + + "0b713cacccc864fb63fc324b0794bd6f80ba2fe10493c033fc093323e90b742b71c403c6d2cde2" + + "2ff50963cdff48a500bfe0e7f388b72d32de9836e60aad007bc4644a3b847503f270927d0e62f5" + + "21ab693684317590f8bfc76c881b06957cc9e5a8de75a12c7a68dfd5ca1c875860190203010001" + + "a381fe3081fb30120603551d130101ff040830060101ff020100300b0603551d0f040403020106" + + "301106096086480186f842010104040302010630280603551d110421301fa41d301b3119301706" + + "035504031310507269766174654c6162656c332d313530310603551d1f042a30283026a024a022" + + "8620687474703a2f2f63726c2e766572697369676e2e636f6d2f706361332e63726c303206082b" + + "0601050507010104263024302206082b060105050730018616687474703a2f2f6f6373702e7468" + + "617774652e636f6d30340603551d25042d302b06082b0601050507030106082b06010505070302" + + "06096086480186f8420401060a6086480186f845010801300d06092a864886f70d010105050003" + + "81810055ac63eadea1ddd2905f9f0bce76be13518f93d9052bc81b774bad6950a1eededcfddb07" + + "e9e83994dcab72792f06bfab8170c4a8edea5334edef1e53d906c7562bd15cf4d18a8eb42bb137" + + "9048084225c53e8acb7feb6f04d16dc574a2f7a27c7b603c77cd0ece48027f012fb69b37e02a2a" + + "36dcd585d6ace53f546f961e05af" + +func TestCreateSelfSignedCertificate(t *testing.T) { + random := rand.Reader + + block, _ := pem.Decode([]byte(pemPrivateKey)) + rsaPriv, err := ParsePKCS1PrivateKey(block.Bytes) + if err != nil { + t.Fatalf("Failed to parse private key: %s", err) + } + + ecdsaPriv, err := ecdsa.GenerateKey(elliptic.P256(), rand.Reader) + if err != nil { + t.Fatalf("Failed to generate ECDSA key: %s", err) + } + + tests := []struct { + name string + pub, priv interface{} + checkSig bool + sigAlgo SignatureAlgorithm + }{ + {"RSA/RSA", &rsaPriv.PublicKey, rsaPriv, true, SHA1WithRSA}, + {"RSA/ECDSA", &rsaPriv.PublicKey, ecdsaPriv, false, ECDSAWithSHA384}, + {"ECDSA/RSA", &ecdsaPriv.PublicKey, rsaPriv, false, SHA256WithRSA}, + {"ECDSA/ECDSA", &ecdsaPriv.PublicKey, ecdsaPriv, true, ECDSAWithSHA1}, + } + + testExtKeyUsage := []ExtKeyUsage{ExtKeyUsageClientAuth, ExtKeyUsageServerAuth} + testUnknownExtKeyUsage := []asn1.ObjectIdentifier{[]int{1, 2, 3}, []int{2, 59, 1}} + extraExtensionData := []byte("extra extension") + + for _, test := range tests { + commonName := "test.example.com" + template := Certificate{ + SerialNumber: big.NewInt(1), + Subject: pkix.Name{ + CommonName: commonName, + Organization: []string{"Σ Acme Co"}, + Country: []string{"US"}, + ExtraNames: []pkix.AttributeTypeAndValue{ + { + Type: []int{2, 5, 4, 42}, + Value: "Gopher", + }, + // This should override the Country, above. + { + Type: []int{2, 5, 4, 6}, + Value: "NL", + }, + }, + }, + NotBefore: time.Unix(1000, 0), + NotAfter: time.Unix(100000, 0), + + SignatureAlgorithm: test.sigAlgo, + + SubjectKeyId: []byte{1, 2, 3, 4}, + KeyUsage: KeyUsageCertSign, + + ExtKeyUsage: testExtKeyUsage, + UnknownExtKeyUsage: testUnknownExtKeyUsage, + + BasicConstraintsValid: true, + IsCA: true, + + OCSPServer: []string{"http://ocsp.example.com"}, + IssuingCertificateURL: []string{"http://crt.example.com/ca1.crt"}, + + DNSNames: []string{"test.example.com"}, + EmailAddresses: []string{"gopher@golang.org"}, + IPAddresses: []net.IP{net.IPv4(127, 0, 0, 1).To4(), net.ParseIP("2001:4860:0:2001::68")}, + + PolicyIdentifiers: []asn1.ObjectIdentifier{[]int{1, 2, 3}}, + PermittedDNSDomains: []string{".example.com", "example.com"}, + + CRLDistributionPoints: []string{"http://crl1.example.com/ca1.crl", "http://crl2.example.com/ca1.crl"}, + + ExtraExtensions: []pkix.Extension{ + { + Id: []int{1, 2, 3, 4}, + Value: extraExtensionData, + }, + // This extension should override the SubjectKeyId, above. + { + Id: oidExtensionSubjectKeyId, + Critical: false, + Value: []byte{0x04, 0x04, 4, 3, 2, 1}, + }, + }, + } + + derBytes, err := CreateCertificate(random, &template, &template, test.pub, test.priv) + if err != nil { + t.Errorf("%s: failed to create certificate: %s", test.name, err) + continue + } + + cert, err := ParseCertificate(derBytes) + if err != nil { + t.Errorf("%s: failed to parse certificate: %s", test.name, err) + continue + } + + if len(cert.PolicyIdentifiers) != 1 || !cert.PolicyIdentifiers[0].Equal(template.PolicyIdentifiers[0]) { + t.Errorf("%s: failed to parse policy identifiers: got:%#v want:%#v", test.name, cert.PolicyIdentifiers, template.PolicyIdentifiers) + } + + if len(cert.PermittedDNSDomains) != 2 || cert.PermittedDNSDomains[0] != ".example.com" || cert.PermittedDNSDomains[1] != "example.com" { + t.Errorf("%s: failed to parse name constraints: %#v", test.name, cert.PermittedDNSDomains) + } + + if cert.Subject.CommonName != commonName { + t.Errorf("%s: subject wasn't correctly copied from the template. Got %s, want %s", test.name, cert.Subject.CommonName, commonName) + } + + if len(cert.Subject.Country) != 1 || cert.Subject.Country[0] != "NL" { + t.Errorf("%s: ExtraNames didn't override Country", test.name) + } + + found := false + for _, atv := range cert.Subject.Names { + if atv.Type.Equal([]int{2, 5, 4, 42}) { + found = true + break + } + } + if !found { + t.Errorf("%s: Names didn't contain oid 2.5.4.42 from ExtraNames", test.name) + } + + if cert.Issuer.CommonName != commonName { + t.Errorf("%s: issuer wasn't correctly copied from the template. Got %s, want %s", test.name, cert.Issuer.CommonName, commonName) + } + + if cert.SignatureAlgorithm != test.sigAlgo { + t.Errorf("%s: SignatureAlgorithm wasn't copied from template. Got %v, want %v", test.name, cert.SignatureAlgorithm, test.sigAlgo) + } + + if !reflect.DeepEqual(cert.ExtKeyUsage, testExtKeyUsage) { + t.Errorf("%s: extkeyusage wasn't correctly copied from the template. Got %v, want %v", test.name, cert.ExtKeyUsage, testExtKeyUsage) + } + + if !reflect.DeepEqual(cert.UnknownExtKeyUsage, testUnknownExtKeyUsage) { + t.Errorf("%s: unknown extkeyusage wasn't correctly copied from the template. Got %v, want %v", test.name, cert.UnknownExtKeyUsage, testUnknownExtKeyUsage) + } + + if !reflect.DeepEqual(cert.OCSPServer, template.OCSPServer) { + t.Errorf("%s: OCSP servers differ from template. Got %v, want %v", test.name, cert.OCSPServer, template.OCSPServer) + } + + if !reflect.DeepEqual(cert.IssuingCertificateURL, template.IssuingCertificateURL) { + t.Errorf("%s: Issuing certificate URLs differ from template. Got %v, want %v", test.name, cert.IssuingCertificateURL, template.IssuingCertificateURL) + } + + if !reflect.DeepEqual(cert.DNSNames, template.DNSNames) { + t.Errorf("%s: SAN DNS names differ from template. Got %v, want %v", test.name, cert.DNSNames, template.DNSNames) + } + + if !reflect.DeepEqual(cert.EmailAddresses, template.EmailAddresses) { + t.Errorf("%s: SAN emails differ from template. Got %v, want %v", test.name, cert.EmailAddresses, template.EmailAddresses) + } + + if !reflect.DeepEqual(cert.IPAddresses, template.IPAddresses) { + t.Errorf("%s: SAN IPs differ from template. Got %v, want %v", test.name, cert.IPAddresses, template.IPAddresses) + } + + if !reflect.DeepEqual(cert.CRLDistributionPoints, template.CRLDistributionPoints) { + t.Errorf("%s: CRL distribution points differ from template. Got %v, want %v", test.name, cert.CRLDistributionPoints, template.CRLDistributionPoints) + } + + if !bytes.Equal(cert.SubjectKeyId, []byte{4, 3, 2, 1}) { + t.Errorf("%s: ExtraExtensions didn't override SubjectKeyId", test.name) + } + + if bytes.Index(derBytes, extraExtensionData) == -1 { + t.Errorf("%s: didn't find extra extension in DER output", test.name) + } + + if test.checkSig { + err = cert.CheckSignatureFrom(cert) + if err != nil { + t.Errorf("%s: signature verification failed: %s", test.name, err) + } + } + } +} + +func TestUnknownCriticalExtension(t *testing.T) { + priv, err := ecdsa.GenerateKey(elliptic.P256(), rand.Reader) + if err != nil { + t.Fatalf("Failed to generate ECDSA key: %s", err) + } + + oids := []asn1.ObjectIdentifier{ + // This OID is in the PKIX arc, but unknown. + asn1.ObjectIdentifier{2, 5, 29, 999999}, + // This is a nonsense, unassigned OID. + asn1.ObjectIdentifier{1, 2, 3, 4}, + } + + for _, oid := range oids { + template := Certificate{ + SerialNumber: big.NewInt(1), + Subject: pkix.Name{ + CommonName: "foo", + }, + NotBefore: time.Unix(1000, 0), + NotAfter: time.Now().AddDate(1, 0, 0), + + BasicConstraintsValid: true, + IsCA: true, + + KeyUsage: KeyUsageCertSign, + ExtKeyUsage: []ExtKeyUsage{ExtKeyUsageServerAuth}, + + ExtraExtensions: []pkix.Extension{ + { + Id: oid, + Critical: true, + Value: nil, + }, + }, + } + + derBytes, err := CreateCertificate(rand.Reader, &template, &template, &priv.PublicKey, priv) + if err != nil { + t.Fatalf("failed to create certificate: %s", err) + } + + cert, err := ParseCertificate(derBytes) + if err != nil { + t.Fatalf("Certificate with unknown critical extension was not parsed: %s", err) + } + + roots := NewCertPool() + roots.AddCert(cert) + + // Setting Roots ensures that Verify won't delegate to the OS + // library and thus the correct error should always be + // returned. + _, err = cert.Verify(VerifyOptions{Roots: roots}) + if err == nil { + t.Fatal("Certificate with unknown critical extension was verified without error") + } + if _, ok := err.(UnhandledCriticalExtension); !ok { + t.Fatalf("Error was %#v, but wanted one of type UnhandledCriticalExtension", err) + } + + cert.UnhandledCriticalExtensions = nil + if _, err = cert.Verify(VerifyOptions{Roots: roots}); err != nil { + t.Errorf("Certificate failed to verify after unhandled critical extensions were cleared: %s", err) + } + } +} + +// Self-signed certificate using ECDSA with SHA1 & secp256r1 +var ecdsaSHA1CertPem = ` +-----BEGIN CERTIFICATE----- +MIICDjCCAbUCCQDF6SfN0nsnrjAJBgcqhkjOPQQBMIGPMQswCQYDVQQGEwJVUzET +MBEGA1UECAwKQ2FsaWZvcm5pYTEWMBQGA1UEBwwNTW91bnRhaW4gVmlldzEVMBMG +A1UECgwMR29vZ2xlLCBJbmMuMRcwFQYDVQQDDA53d3cuZ29vZ2xlLmNvbTEjMCEG +CSqGSIb3DQEJARYUZ29sYW5nLWRldkBnbWFpbC5jb20wHhcNMTIwNTIwMjAyMDUw +WhcNMjIwNTE4MjAyMDUwWjCBjzELMAkGA1UEBhMCVVMxEzARBgNVBAgMCkNhbGlm +b3JuaWExFjAUBgNVBAcMDU1vdW50YWluIFZpZXcxFTATBgNVBAoMDEdvb2dsZSwg +SW5jLjEXMBUGA1UEAwwOd3d3Lmdvb2dsZS5jb20xIzAhBgkqhkiG9w0BCQEWFGdv +bGFuZy1kZXZAZ21haWwuY29tMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE/Wgn +WQDo5+bz71T0327ERgd5SDDXFbXLpzIZDXTkjpe8QTEbsF+ezsQfrekrpDPC4Cd3 +P9LY0tG+aI8IyVKdUjAJBgcqhkjOPQQBA0gAMEUCIGlsqMcRqWVIWTD6wXwe6Jk2 +DKxL46r/FLgJYnzBEH99AiEA3fBouObsvV1R3oVkb4BQYnD4/4LeId6lAT43YvyV +a/A= +-----END CERTIFICATE----- +` + +// Self-signed certificate using ECDSA with SHA256 & secp256r1 +var ecdsaSHA256p256CertPem = ` +-----BEGIN CERTIFICATE----- +MIICDzCCAbYCCQDlsuMWvgQzhTAKBggqhkjOPQQDAjCBjzELMAkGA1UEBhMCVVMx +EzARBgNVBAgMCkNhbGlmb3JuaWExFjAUBgNVBAcMDU1vdW50YWluIFZpZXcxFTAT +BgNVBAoMDEdvb2dsZSwgSW5jLjEXMBUGA1UEAwwOd3d3Lmdvb2dsZS5jb20xIzAh +BgkqhkiG9w0BCQEWFGdvbGFuZy1kZXZAZ21haWwuY29tMB4XDTEyMDUyMTAwMTkx +NloXDTIyMDUxOTAwMTkxNlowgY8xCzAJBgNVBAYTAlVTMRMwEQYDVQQIDApDYWxp +Zm9ybmlhMRYwFAYDVQQHDA1Nb3VudGFpbiBWaWV3MRUwEwYDVQQKDAxHb29nbGUs +IEluYy4xFzAVBgNVBAMMDnd3dy5nb29nbGUuY29tMSMwIQYJKoZIhvcNAQkBFhRn +b2xhbmctZGV2QGdtYWlsLmNvbTBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABPMt +2ErhxAty5EJRu9yM+MTy+hUXm3pdW1ensAv382KoGExSXAFWP7pjJnNtHO+XSwVm +YNtqjcAGFKpweoN//kQwCgYIKoZIzj0EAwIDRwAwRAIgIYSaUA/IB81gjbIw/hUV +70twxJr5EcgOo0hLp3Jm+EYCIFDO3NNcgmURbJ1kfoS3N/0O+irUtoPw38YoNkqJ +h5wi +-----END CERTIFICATE----- +` + +// Self-signed certificate using ECDSA with SHA256 & secp384r1 +var ecdsaSHA256p384CertPem = ` +-----BEGIN CERTIFICATE----- +MIICSjCCAdECCQDje/no7mXkVzAKBggqhkjOPQQDAjCBjjELMAkGA1UEBhMCVVMx +EzARBgNVBAgMCkNhbGlmb3JuaWExFjAUBgNVBAcMDU1vdW50YWluIFZpZXcxFDAS +BgNVBAoMC0dvb2dsZSwgSW5jMRcwFQYDVQQDDA53d3cuZ29vZ2xlLmNvbTEjMCEG +CSqGSIb3DQEJARYUZ29sYW5nLWRldkBnbWFpbC5jb20wHhcNMTIwNTIxMDYxMDM0 +WhcNMjIwNTE5MDYxMDM0WjCBjjELMAkGA1UEBhMCVVMxEzARBgNVBAgMCkNhbGlm +b3JuaWExFjAUBgNVBAcMDU1vdW50YWluIFZpZXcxFDASBgNVBAoMC0dvb2dsZSwg +SW5jMRcwFQYDVQQDDA53d3cuZ29vZ2xlLmNvbTEjMCEGCSqGSIb3DQEJARYUZ29s +YW5nLWRldkBnbWFpbC5jb20wdjAQBgcqhkjOPQIBBgUrgQQAIgNiAARRuzRNIKRK +jIktEmXanNmrTR/q/FaHXLhWRZ6nHWe26Fw7Rsrbk+VjGy4vfWtNn7xSFKrOu5ze +qxKnmE0h5E480MNgrUiRkaGO2GMJJVmxx20aqkXOk59U8yGA4CghE6MwCgYIKoZI +zj0EAwIDZwAwZAIwBZEN8gvmRmfeP/9C1PRLzODIY4JqWub2PLRT4mv9GU+yw3Gr +PU9A3CHMdEcdw/MEAjBBO1lId8KOCh9UZunsSMfqXiVurpzmhWd6VYZ/32G+M+Mh +3yILeYQzllt/g0rKVRk= +-----END CERTIFICATE----- +` + +// Self-signed certificate using ECDSA with SHA384 & secp521r1 +var ecdsaSHA384p521CertPem = ` +-----BEGIN CERTIFICATE----- +MIICljCCAfcCCQDhp1AFD/ahKjAKBggqhkjOPQQDAzCBjjELMAkGA1UEBhMCVVMx +EzARBgNVBAgMCkNhbGlmb3JuaWExFjAUBgNVBAcMDU1vdW50YWluIFZpZXcxFDAS +BgNVBAoMC0dvb2dsZSwgSW5jMRcwFQYDVQQDDA53d3cuZ29vZ2xlLmNvbTEjMCEG +CSqGSIb3DQEJARYUZ29sYW5nLWRldkBnbWFpbC5jb20wHhcNMTIwNTIxMTUwNDI5 +WhcNMjIwNTE5MTUwNDI5WjCBjjELMAkGA1UEBhMCVVMxEzARBgNVBAgMCkNhbGlm +b3JuaWExFjAUBgNVBAcMDU1vdW50YWluIFZpZXcxFDASBgNVBAoMC0dvb2dsZSwg +SW5jMRcwFQYDVQQDDA53d3cuZ29vZ2xlLmNvbTEjMCEGCSqGSIb3DQEJARYUZ29s +YW5nLWRldkBnbWFpbC5jb20wgZswEAYHKoZIzj0CAQYFK4EEACMDgYYABACqx9Rv +IssRs1LWYcNN+WffwlHw4Tv3y8/LIAA9MF1ZScIonU9nRMxt4a2uGJVCPDw6JHpz +PaYc0E9puLoE9AfKpwFr59Jkot7dBg55SKPEFkddoip/rvmN7NPAWjMBirOwjOkm +8FPthvPhGPqsu9AvgVuHu3PosWiHGNrhh379pva8MzAKBggqhkjOPQQDAwOBjAAw +gYgCQgEHNmswkUdPpHqrVxp9PvLVl+xxPuHBkT+75z9JizyxtqykHQo9Uh6SWCYH +BF9KLolo01wMt8DjoYP5Fb3j5MH7xwJCAbWZzTOp4l4DPkIvAh4LeC4VWbwPPyqh +kBg71w/iEcSY3wUKgHGcJJrObZw7wys91I5kENljqw/Samdr3ka+jBJa +-----END CERTIFICATE----- +` + +var ecdsaTests = []struct { + sigAlgo SignatureAlgorithm + pemCert string +}{ + {ECDSAWithSHA1, ecdsaSHA1CertPem}, + {ECDSAWithSHA256, ecdsaSHA256p256CertPem}, + {ECDSAWithSHA256, ecdsaSHA256p384CertPem}, + {ECDSAWithSHA384, ecdsaSHA384p521CertPem}, +} + +func TestECDSA(t *testing.T) { + for i, test := range ecdsaTests { + pemBlock, _ := pem.Decode([]byte(test.pemCert)) + cert, err := ParseCertificate(pemBlock.Bytes) + if err != nil { + t.Errorf("%d: failed to parse certificate: %s", i, err) + continue + } + if sa := cert.SignatureAlgorithm; sa != test.sigAlgo { + t.Errorf("%d: signature algorithm is %v, want %v", i, sa, test.sigAlgo) + } + if parsedKey, ok := cert.PublicKey.(*ecdsa.PublicKey); !ok { + t.Errorf("%d: wanted an ECDSA public key but found: %#v", i, parsedKey) + } + if pka := cert.PublicKeyAlgorithm; pka != ECDSA { + t.Errorf("%d: public key algorithm is %v, want ECDSA", i, pka) + } + if err = cert.CheckSignatureFrom(cert); err != nil { + t.Errorf("%d: certificate verification failed: %s", i, err) + } + } +} + +// Self-signed certificate using DSA with SHA1 +var dsaCertPem = `-----BEGIN CERTIFICATE----- +MIIEDTCCA82gAwIBAgIJALHPghaoxeDhMAkGByqGSM44BAMweTELMAkGA1UEBhMC +VVMxCzAJBgNVBAgTAk5DMQ8wDQYDVQQHEwZOZXd0b24xFDASBgNVBAoTC0dvb2ds +ZSwgSW5jMRIwEAYDVQQDEwlKb24gQWxsaWUxIjAgBgkqhkiG9w0BCQEWE2pvbmFs +bGllQGdvb2dsZS5jb20wHhcNMTEwNTE0MDMwMTQ1WhcNMTEwNjEzMDMwMTQ1WjB5 +MQswCQYDVQQGEwJVUzELMAkGA1UECBMCTkMxDzANBgNVBAcTBk5ld3RvbjEUMBIG +A1UEChMLR29vZ2xlLCBJbmMxEjAQBgNVBAMTCUpvbiBBbGxpZTEiMCAGCSqGSIb3 +DQEJARYTam9uYWxsaWVAZ29vZ2xlLmNvbTCCAbcwggEsBgcqhkjOOAQBMIIBHwKB +gQC8hLUnQ7FpFYu4WXTj6DKvXvz8QrJkNJCVMTpKAT7uBpobk32S5RrPKXocd4gN +8lyGB9ggS03EVlEwXvSmO0DH2MQtke2jl9j1HLydClMf4sbx5V6TV9IFw505U1iW +jL7awRMgxge+FsudtJK254FjMFo03ZnOQ8ZJJ9E6AEDrlwIVAJpnBn9moyP11Ox5 +Asc/5dnjb6dPAoGBAJFHd4KVv1iTVCvEG6gGiYop5DJh28hUQcN9kul+2A0yPUSC +X93oN00P8Vh3eYgSaCWZsha7zDG53MrVJ0Zf6v/X/CoZNhLldeNOepivTRAzn+Rz +kKUYy5l1sxYLHQKF0UGNCXfFKZT0PCmgU+PWhYNBBMn6/cIh44vp85ideo5CA4GE +AAKBgFmifCafzeRaohYKXJgMGSEaggCVCRq5xdyDCat+wbOkjC4mfG01/um3G8u5 +LxasjlWRKTR/tcAL7t0QuokVyQaYdVypZXNaMtx1db7YBuHjj3aP+8JOQRI9xz8c +bp5NDJ5pISiFOv4p3GZfqZPcqckDt78AtkQrmnal2txhhjF6o4HeMIHbMB0GA1Ud +DgQWBBQVyyr7hO11ZFFpWX50298Sa3V+rzCBqwYDVR0jBIGjMIGggBQVyyr7hO11 +ZFFpWX50298Sa3V+r6F9pHsweTELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAk5DMQ8w +DQYDVQQHEwZOZXd0b24xFDASBgNVBAoTC0dvb2dsZSwgSW5jMRIwEAYDVQQDEwlK +b24gQWxsaWUxIjAgBgkqhkiG9w0BCQEWE2pvbmFsbGllQGdvb2dsZS5jb22CCQCx +z4IWqMXg4TAMBgNVHRMEBTADAQH/MAkGByqGSM44BAMDLwAwLAIUPtn/5j8Q1jJI +7ggOIsgrhgUdjGQCFCsmDq1H11q9+9Wp9IMeGrTSKHIM +-----END CERTIFICATE----- +` + +func TestParseCertificateWithDsaPublicKey(t *testing.T) { + expectedKey := &dsa.PublicKey{ + Parameters: dsa.Parameters{ + P: bigFromHexString("00BC84B52743B169158BB85974E3E832AF5EFCFC42B264349095313A4A013EEE069A1B937D92E51ACF297A1C77880DF25C8607D8204B4DC45651305EF4A63B40C7D8C42D91EDA397D8F51CBC9D0A531FE2C6F1E55E9357D205C39D395358968CBEDAC11320C607BE16CB9DB492B6E78163305A34DD99CE43C64927D13A0040EB97"), + Q: bigFromHexString("009A67067F66A323F5D4EC7902C73FE5D9E36FA74F"), + G: bigFromHexString("009147778295BF5893542BC41BA806898A29E43261DBC85441C37D92E97ED80D323D44825FDDE8374D0FF15877798812682599B216BBCC31B9DCCAD527465FEAFFD7FC2A193612E575E34E7A98AF4D10339FE47390A518CB9975B3160B1D0285D1418D0977C52994F43C29A053E3D685834104C9FAFDC221E38BE9F3989D7A8E42"), + }, + Y: bigFromHexString("59A27C269FCDE45AA2160A5C980C19211A820095091AB9C5DC8309AB7EC1B3A48C2E267C6D35FEE9B71BCBB92F16AC8E559129347FB5C00BEEDD10BA8915C90698755CA965735A32DC7575BED806E1E38F768FFBC24E41123DC73F1C6E9E4D0C9E692128853AFE29DC665FA993DCA9C903B7BF00B6442B9A76A5DADC6186317A"), + } + pemBlock, _ := pem.Decode([]byte(dsaCertPem)) + cert, err := ParseCertificate(pemBlock.Bytes) + if err != nil { + t.Fatalf("Failed to parse certificate: %s", err) + } + if cert.PublicKeyAlgorithm != DSA { + t.Errorf("Parsed key algorithm was not DSA") + } + parsedKey, ok := cert.PublicKey.(*dsa.PublicKey) + if !ok { + t.Fatalf("Parsed key was not a DSA key: %s", err) + } + if expectedKey.Y.Cmp(parsedKey.Y) != 0 || + expectedKey.P.Cmp(parsedKey.P) != 0 || + expectedKey.Q.Cmp(parsedKey.Q) != 0 || + expectedKey.G.Cmp(parsedKey.G) != 0 { + t.Fatal("Parsed key differs from expected key") + } +} + +func TestParseCertificateWithDSASignatureAlgorithm(t *testing.T) { + pemBlock, _ := pem.Decode([]byte(dsaCertPem)) + cert, err := ParseCertificate(pemBlock.Bytes) + if err != nil { + t.Fatalf("Failed to parse certificate: %s", err) + } + if cert.SignatureAlgorithm != DSAWithSHA1 { + t.Errorf("Parsed signature algorithm was not DSAWithSHA1") + } +} + +func TestVerifyCertificateWithDSASignature(t *testing.T) { + pemBlock, _ := pem.Decode([]byte(dsaCertPem)) + cert, err := ParseCertificate(pemBlock.Bytes) + if err != nil { + t.Fatalf("Failed to parse certificate: %s", err) + } + // test cert is self-signed + if err = cert.CheckSignatureFrom(cert); err != nil { + t.Fatalf("DSA Certificate verification failed: %s", err) + } +} + +const pemCertificate = `-----BEGIN CERTIFICATE----- +MIIB5DCCAZCgAwIBAgIBATALBgkqhkiG9w0BAQUwLTEQMA4GA1UEChMHQWNtZSBDbzEZMBcGA1UE +AxMQdGVzdC5leGFtcGxlLmNvbTAeFw03MDAxMDEwMDE2NDBaFw03MDAxMDIwMzQ2NDBaMC0xEDAO +BgNVBAoTB0FjbWUgQ28xGTAXBgNVBAMTEHRlc3QuZXhhbXBsZS5jb20wWjALBgkqhkiG9w0BAQED +SwAwSAJBALKZD0nEffqM1ACuak0bijtqE2QrI/KLADv7l3kK3ppMyCuLKoF0fd7Ai2KW5ToIwzFo +fvJcS/STa6HA5gQenRUCAwEAAaOBnjCBmzAOBgNVHQ8BAf8EBAMCAAQwDwYDVR0TAQH/BAUwAwEB +/zANBgNVHQ4EBgQEAQIDBDAPBgNVHSMECDAGgAQBAgMEMBsGA1UdEQQUMBKCEHRlc3QuZXhhbXBs +ZS5jb20wDwYDVR0gBAgwBjAEBgIqAzAqBgNVHR4EIzAhoB8wDoIMLmV4YW1wbGUuY29tMA2CC2V4 +YW1wbGUuY29tMAsGCSqGSIb3DQEBBQNBAHKZKoS1wEQOGhgklx4+/yFYQlnqwKXvar/ZecQvJwui +0seMQnwBhwdBkHfVIU2Fu5VUMRyxlf0ZNaDXcpU581k= +-----END CERTIFICATE-----` + +func TestCRLCreation(t *testing.T) { + block, _ := pem.Decode([]byte(pemPrivateKey)) + priv, _ := ParsePKCS1PrivateKey(block.Bytes) + block, _ = pem.Decode([]byte(pemCertificate)) + cert, _ := ParseCertificate(block.Bytes) + + now := time.Unix(1000, 0) + expiry := time.Unix(10000, 0) + + revokedCerts := []pkix.RevokedCertificate{ + { + SerialNumber: big.NewInt(1), + RevocationTime: now, + }, + { + SerialNumber: big.NewInt(42), + RevocationTime: now, + }, + } + + crlBytes, err := cert.CreateCRL(rand.Reader, priv, revokedCerts, now, expiry) + if err != nil { + t.Errorf("error creating CRL: %s", err) + } + + _, err = ParseDERCRL(crlBytes) + if err != nil { + t.Errorf("error reparsing CRL: %s", err) + } +} + +func fromBase64(in string) []byte { + out := make([]byte, base64.StdEncoding.DecodedLen(len(in))) + n, err := base64.StdEncoding.Decode(out, []byte(in)) + if err != nil { + panic("failed to base64 decode") + } + return out[:n] +} + +func TestParseDERCRL(t *testing.T) { + derBytes := fromBase64(derCRLBase64) + certList, err := ParseDERCRL(derBytes) + if err != nil { + t.Errorf("error parsing: %s", err) + return + } + numCerts := len(certList.TBSCertList.RevokedCertificates) + expected := 88 + if numCerts != expected { + t.Errorf("bad number of revoked certificates. got: %d want: %d", numCerts, expected) + } + + if certList.HasExpired(time.Unix(1302517272, 0)) { + t.Errorf("CRL has expired (but shouldn't have)") + } + + // Can't check the signature here without a package cycle. +} + +func TestCRLWithoutExpiry(t *testing.T) { + derBytes := fromBase64("MIHYMIGZMAkGByqGSM44BAMwEjEQMA4GA1UEAxMHQ2FybERTUxcNOTkwODI3MDcwMDAwWjBpMBMCAgDIFw05OTA4MjIwNzAwMDBaMBMCAgDJFw05OTA4MjIwNzAwMDBaMBMCAgDTFw05OTA4MjIwNzAwMDBaMBMCAgDSFw05OTA4MjIwNzAwMDBaMBMCAgDUFw05OTA4MjQwNzAwMDBaMAkGByqGSM44BAMDLwAwLAIUfmVSdjP+NHMX0feW+aDU2G1cfT0CFAJ6W7fVWxjBz4fvftok8yqDnDWh") + certList, err := ParseDERCRL(derBytes) + if err != nil { + t.Fatal(err) + } + if !certList.TBSCertList.NextUpdate.IsZero() { + t.Errorf("NextUpdate is not the zero value") + } +} + +func TestParsePEMCRL(t *testing.T) { + pemBytes := fromBase64(pemCRLBase64) + certList, err := ParseCRL(pemBytes) + if err != nil { + t.Errorf("error parsing: %s", err) + return + } + numCerts := len(certList.TBSCertList.RevokedCertificates) + expected := 2 + if numCerts != expected { + t.Errorf("bad number of revoked certificates. got: %d want: %d", numCerts, expected) + } + + if certList.HasExpired(time.Unix(1302517272, 0)) { + t.Errorf("CRL has expired (but shouldn't have)") + } + + // Can't check the signature here without a package cycle. +} + +func TestImports(t *testing.T) { + testenv.MustHaveGoRun(t) + + if err := exec.Command("go", "run", "x509_test_import.go").Run(); err != nil { + t.Errorf("failed to run x509_test_import.go: %s", err) + } +} + +const derCRLBase64 = "MIINqzCCDJMCAQEwDQYJKoZIhvcNAQEFBQAwVjEZMBcGA1UEAxMQUEtJIEZJTk1FQ0NBTklDQTEVMBMGA1UEChMMRklOTUVDQ0FOSUNBMRUwEwYDVQQLEwxGSU5NRUNDQU5JQ0ExCzAJBgNVBAYTAklUFw0xMTA1MDQxNjU3NDJaFw0xMTA1MDQyMDU3NDJaMIIMBzAhAg4Ze1od49Lt1qIXBydAzhcNMDkwNzE2MDg0MzIyWjAAMCECDl0HSL9bcZ1Ci/UHJ0DPFw0wOTA3MTYwODQzMTNaMAAwIQIOESB9tVAmX3cY7QcnQNAXDTA5MDcxNjA4NDUyMlowADAhAg4S1tGAQ3mHt8uVBydA1RcNMDkwODA0MTUyNTIyWjAAMCECDlQ249Y7vtC25ScHJ0DWFw0wOTA4MDQxNTI1MzdaMAAwIQIOISMop3NkA4PfYwcnQNkXDTA5MDgwNDExMDAzNFowADAhAg56/BMoS29KEShTBydA2hcNMDkwODA0MTEwMTAzWjAAMCECDnBp/22HPH5CSWoHJ0DbFw0wOTA4MDQxMDU0NDlaMAAwIQIOV9IP+8CD8bK+XAcnQNwXDTA5MDgwNDEwNTcxN1owADAhAg4v5aRz0IxWqYiXBydA3RcNMDkwODA0MTA1NzQ1WjAAMCECDlOU34VzvZAybQwHJ0DeFw0wOTA4MDQxMDU4MjFaMAAwIAINO4CD9lluIxcwBydBAxcNMDkwNzIyMTUzMTU5WjAAMCECDgOllfO8Y1QA7/wHJ0ExFw0wOTA3MjQxMTQxNDNaMAAwIQIOJBX7jbiCdRdyjgcnQUQXDTA5MDkxNjA5MzAwOFowADAhAg5iYSAgmDrlH/RZBydBRRcNMDkwOTE2MDkzMDE3WjAAMCECDmu6k6srP3jcMaQHJ0FRFw0wOTA4MDQxMDU2NDBaMAAwIQIOX8aHlO0V+WVH4QcnQVMXDTA5MDgwNDEwNTcyOVowADAhAg5flK2rg3NnsRgDBydBzhcNMTEwMjAxMTUzMzQ2WjAAMCECDg35yJDL1jOPTgoHJ0HPFw0xMTAyMDExNTM0MjZaMAAwIQIOMyFJ6+e9iiGVBQcnQdAXDTA5MDkxODEzMjAwNVowADAhAg5Emb/Oykucmn8fBydB1xcNMDkwOTIxMTAxMDQ3WjAAMCECDjQKCncV+MnUavMHJ0HaFw0wOTA5MjIwODE1MjZaMAAwIQIOaxiFUt3dpd+tPwcnQfQXDTEwMDYxODA4NDI1MVowADAhAg5G7P8nO0tkrMt7BydB9RcNMTAwNjE4MDg0MjMwWjAAMCECDmTCC3SXhmDRst4HJ0H2Fw0wOTA5MjgxMjA3MjBaMAAwIQIOHoGhUr/pRwzTKgcnQfcXDTA5MDkyODEyMDcyNFowADAhAg50wrcrCiw8mQmPBydCBBcNMTAwMjE2MTMwMTA2WjAAMCECDifWmkvwyhEqwEcHJ0IFFw0xMDAyMTYxMzAxMjBaMAAwIQIOfgPmlW9fg+osNgcnQhwXDTEwMDQxMzA5NTIwMFowADAhAg4YHAGuA6LgCk7tBydCHRcNMTAwNDEzMDk1MTM4WjAAMCECDi1zH1bxkNJhokAHJ0IsFw0xMDA0MTMwOTU5MzBaMAAwIQIOMipNccsb/wo2fwcnQi0XDTEwMDQxMzA5NTkwMFowADAhAg46lCmvPl4GpP6ABydCShcNMTAwMTE5MDk1MjE3WjAAMCECDjaTcaj+wBpcGAsHJ0JLFw0xMDAxMTkwOTUyMzRaMAAwIQIOOMC13EOrBuxIOQcnQloXDTEwMDIwMTA5NDcwNVowADAhAg5KmZl+krz4RsmrBydCWxcNMTAwMjAxMDk0NjQwWjAAMCECDmLG3zQJ/fzdSsUHJ0JiFw0xMDAzMDEwOTUxNDBaMAAwIQIOP39ksgHdojf4owcnQmMXDTEwMDMwMTA5NTExN1owADAhAg4LDQzvWNRlD6v9BydCZBcNMTAwMzAxMDk0NjIyWjAAMCECDkmNfeclaFhIaaUHJ0JlFw0xMDAzMDEwOTQ2MDVaMAAwIQIOT/qWWfpH/m8NTwcnQpQXDTEwMDUxMTA5MTgyMVowADAhAg5m/ksYxvCEgJSvBydClRcNMTAwNTExMDkxODAxWjAAMCECDgvf3Ohq6JOPU9AHJ0KWFw0xMDA1MTEwOTIxMjNaMAAwIQIOKSPas10z4jNVIQcnQpcXDTEwMDUxMTA5MjEwMlowADAhAg4mCWmhoZ3lyKCDBydCohcNMTEwNDI4MTEwMjI1WjAAMCECDkeiyRsBMK0Gvr4HJ0KjFw0xMTA0MjgxMTAyMDdaMAAwIQIOa09b/nH2+55SSwcnQq4XDTExMDQwMTA4Mjk0NlowADAhAg5O7M7iq7gGplr1BydCrxcNMTEwNDAxMDgzMDE3WjAAMCECDjlT6mJxUjTvyogHJ0K1Fw0xMTAxMjcxNTQ4NTJaMAAwIQIODS/l4UUFLe21NAcnQrYXDTExMDEyNzE1NDgyOFowADAhAg5lPRA0XdOUF6lSBydDHhcNMTEwMTI4MTQzNTA1WjAAMCECDixKX4fFGGpENwgHJ0MfFw0xMTAxMjgxNDM1MzBaMAAwIQIORNBkqsPnpKTtbAcnQ08XDTEwMDkwOTA4NDg0MlowADAhAg5QL+EMM3lohedEBydDUBcNMTAwOTA5MDg0ODE5WjAAMCECDlhDnHK+HiTRAXcHJ0NUFw0xMDEwMTkxNjIxNDBaMAAwIQIOdBFqAzq/INz53gcnQ1UXDTEwMTAxOTE2MjA0NFowADAhAg4OjR7s8MgKles1BydDWhcNMTEwMTI3MTY1MzM2WjAAMCECDmfR/elHee+d0SoHJ0NbFw0xMTAxMjcxNjUzNTZaMAAwIQIOBTKv2ui+KFMI+wcnQ5YXDTEwMDkxNTEwMjE1N1owADAhAg49F3c/GSah+oRUBydDmxcNMTEwMTI3MTczMjMzWjAAMCECDggv4I61WwpKFMMHJ0OcFw0xMTAxMjcxNzMyNTVaMAAwIQIOXx/Y8sEvwS10LAcnQ6UXDTExMDEyODExMjkzN1owADAhAg5LSLbnVrSKaw/9BydDphcNMTEwMTI4MTEyOTIwWjAAMCECDmFFoCuhKUeACQQHJ0PfFw0xMTAxMTExMDE3MzdaMAAwIQIOQTDdFh2fSPF6AAcnQ+AXDTExMDExMTEwMTcxMFowADAhAg5B8AOXX61FpvbbBydD5RcNMTAxMDA2MTAxNDM2WjAAMCECDh41P2Gmi7PkwI4HJ0PmFw0xMDEwMDYxMDE2MjVaMAAwIQIOWUHGLQCd+Ale9gcnQ/0XDTExMDUwMjA3NTYxMFowADAhAg5Z2c9AYkikmgWOBydD/hcNMTEwNTAyMDc1NjM0WjAAMCECDmf/UD+/h8nf+74HJ0QVFw0xMTA0MTUwNzI4MzNaMAAwIQIOICvj4epy3MrqfwcnRBYXDTExMDQxNTA3Mjg1NlowADAhAg4bouRMfOYqgv4xBydEHxcNMTEwMzA4MTYyNDI1WjAAMCECDhebWHGoKiTp7pEHJ0QgFw0xMTAzMDgxNjI0NDhaMAAwIQIOX+qnxxAqJ8LtawcnRDcXDTExMDEzMTE1MTIyOFowADAhAg4j0fICqZ+wkOdqBydEOBcNMTEwMTMxMTUxMTQxWjAAMCECDhmXjsV4SUpWtAMHJ0RLFw0xMTAxMjgxMTI0MTJaMAAwIQIODno/w+zG43kkTwcnREwXDTExMDEyODExMjM1MlowADAhAg4b1gc88767Fr+LBydETxcNMTEwMTI4MTEwMjA4WjAAMCECDn+M3Pa1w2nyFeUHJ0RQFw0xMTAxMjgxMDU4NDVaMAAwIQIOaduoyIH61tqybAcnRJUXDTEwMTIxNTA5NDMyMlowADAhAg4nLqQPkyi3ESAKBydElhcNMTAxMjE1MDk0MzM2WjAAMCECDi504NIMH8578gQHJ0SbFw0xMTAyMTQxNDA1NDFaMAAwIQIOGuaM8PDaC5u1egcnRJwXDTExMDIxNDE0MDYwNFowADAhAg4ehYq/BXGnB5PWBydEnxcNMTEwMjA0MDgwOTUxWjAAMCECDkSD4eS4FxW5H20HJ0SgFw0xMTAyMDQwODA5MjVaMAAwIQIOOCcb6ilYObt1egcnRKEXDTExMDEyNjEwNDEyOVowADAhAg58tISWCCwFnKGnBydEohcNMTEwMjA0MDgxMzQyWjAAMCECDn5rjtabY/L/WL0HJ0TJFw0xMTAyMDQxMTAzNDFaMAAwDQYJKoZIhvcNAQEFBQADggEBAGnF2Gs0+LNiYCW1Ipm83OXQYP/bd5tFFRzyz3iepFqNfYs4D68/QihjFoRHQoXEB0OEe1tvaVnnPGnEOpi6krwekquMxo4H88B5SlyiFIqemCOIss0SxlCFs69LmfRYvPPvPEhoXtQ3ZThe0UvKG83GOklhvGl6OaiRf4Mt+m8zOT4Wox/j6aOBK6cw6qKCdmD+Yj1rrNqFGg1CnSWMoD6S6mwNgkzwdBUJZ22BwrzAAo4RHa2Uy3ef1FjwD0XtU5N3uDSxGGBEDvOe5z82rps3E22FpAA8eYl8kaXtmWqyvYU0epp4brGuTxCuBMCAsxt/OjIjeNNQbBGkwxgfYA0=" + +const pemCRLBase64 = "LS0tLS1CRUdJTiBYNTA5IENSTC0tLS0tDQpNSUlCOWpDQ0FWOENBUUV3RFFZSktvWklodmNOQVFFRkJRQXdiREVhTUJnR0ExVUVDaE1SVWxOQklGTmxZM1Z5DQphWFI1SUVsdVl5NHhIakFjQmdOVkJBTVRGVkpUUVNCUWRXSnNhV01nVW05dmRDQkRRU0IyTVRFdU1Dd0dDU3FHDQpTSWIzRFFFSkFSWWZjbk5oYTJWdmJuSnZiM1J6YVdkdVFISnpZWE5sWTNWeWFYUjVMbU52YlJjTk1URXdNakl6DQpNVGt5T0RNd1doY05NVEV3T0RJeU1Ua3lPRE13V2pDQmpEQktBaEVBckRxb2g5RkhKSFhUN09QZ3V1bjQrQmNODQpNRGt4TVRBeU1UUXlOekE1V2pBbU1Bb0dBMVVkRlFRRENnRUpNQmdHQTFVZEdBUVJHQTh5TURBNU1URXdNakUwDQpNalExTlZvd1BnSVJBTEd6blowOTVQQjVhQU9MUGc1N2ZNTVhEVEF5TVRBeU16RTBOVEF4TkZvd0dqQVlCZ05WDQpIUmdFRVJnUE1qQXdNakV3TWpNeE5EVXdNVFJhb0RBd0xqQWZCZ05WSFNNRUdEQVdnQlQxVERGNlVRTS9MTmVMDQpsNWx2cUhHUXEzZzltekFMQmdOVkhSUUVCQUlDQUlRd0RRWUpLb1pJaHZjTkFRRUZCUUFEZ1lFQUZVNUFzNk16DQpxNVBSc2lmYW9iUVBHaDFhSkx5QytNczVBZ2MwYld5QTNHQWR4dXI1U3BQWmVSV0NCamlQL01FSEJXSkNsQkhQDQpHUmNxNXlJZDNFakRrYUV5eFJhK2k2N0x6dmhJNmMyOUVlNks5cFNZd2ppLzdSVWhtbW5Qclh0VHhsTDBsckxyDQptUVFKNnhoRFJhNUczUUE0Q21VZHNITnZicnpnbUNZcHZWRT0NCi0tLS0tRU5EIFg1MDkgQ1JMLS0tLS0NCg0K" + +func TestCreateCertificateRequest(t *testing.T) { + random := rand.Reader + + block, _ := pem.Decode([]byte(pemPrivateKey)) + rsaPriv, err := ParsePKCS1PrivateKey(block.Bytes) + if err != nil { + t.Fatalf("Failed to parse private key: %s", err) + } + + ecdsa256Priv, err := ecdsa.GenerateKey(elliptic.P256(), rand.Reader) + if err != nil { + t.Fatalf("Failed to generate ECDSA key: %s", err) + } + + ecdsa384Priv, err := ecdsa.GenerateKey(elliptic.P384(), rand.Reader) + if err != nil { + t.Fatalf("Failed to generate ECDSA key: %s", err) + } + + ecdsa521Priv, err := ecdsa.GenerateKey(elliptic.P521(), rand.Reader) + if err != nil { + t.Fatalf("Failed to generate ECDSA key: %s", err) + } + + tests := []struct { + name string + priv interface{} + sigAlgo SignatureAlgorithm + }{ + {"RSA", rsaPriv, SHA1WithRSA}, + {"ECDSA-256", ecdsa256Priv, ECDSAWithSHA1}, + {"ECDSA-384", ecdsa384Priv, ECDSAWithSHA1}, + {"ECDSA-521", ecdsa521Priv, ECDSAWithSHA1}, + } + + for _, test := range tests { + template := CertificateRequest{ + Subject: pkix.Name{ + CommonName: "test.example.com", + Organization: []string{"Σ Acme Co"}, + }, + SignatureAlgorithm: test.sigAlgo, + DNSNames: []string{"test.example.com"}, + EmailAddresses: []string{"gopher@golang.org"}, + IPAddresses: []net.IP{net.IPv4(127, 0, 0, 1).To4(), net.ParseIP("2001:4860:0:2001::68")}, + } + + derBytes, err := CreateCertificateRequest(random, &template, test.priv) + if err != nil { + t.Errorf("%s: failed to create certificate request: %s", test.name, err) + continue + } + + out, err := ParseCertificateRequest(derBytes) + if err != nil { + t.Errorf("%s: failed to create certificate request: %s", test.name, err) + continue + } + + err = out.CheckSignature() + if err != nil { + t.Errorf("%s: failed to check certificate request signature: %s", test.name, err) + continue + } + + if out.Subject.CommonName != template.Subject.CommonName { + t.Errorf("%s: output subject common name and template subject common name don't match", test.name) + } else if len(out.Subject.Organization) != len(template.Subject.Organization) { + t.Errorf("%s: output subject organisation and template subject organisation don't match", test.name) + } else if len(out.DNSNames) != len(template.DNSNames) { + t.Errorf("%s: output DNS names and template DNS names don't match", test.name) + } else if len(out.EmailAddresses) != len(template.EmailAddresses) { + t.Errorf("%s: output email addresses and template email addresses don't match", test.name) + } else if len(out.IPAddresses) != len(template.IPAddresses) { + t.Errorf("%s: output IP addresses and template IP addresses names don't match", test.name) + } + } +} + +func marshalAndParseCSR(t *testing.T, template *CertificateRequest) *CertificateRequest { + block, _ := pem.Decode([]byte(pemPrivateKey)) + rsaPriv, err := ParsePKCS1PrivateKey(block.Bytes) + if err != nil { + t.Fatal(err) + } + + derBytes, err := CreateCertificateRequest(rand.Reader, template, rsaPriv) + if err != nil { + t.Fatal(err) + } + + csr, err := ParseCertificateRequest(derBytes) + if err != nil { + t.Fatal(err) + } + + return csr +} + +func TestCertificateRequestOverrides(t *testing.T) { + sanContents, err := marshalSANs([]string{"foo.example.com"}, nil, nil) + if err != nil { + t.Fatal(err) + } + + template := CertificateRequest{ + Subject: pkix.Name{ + CommonName: "test.example.com", + Organization: []string{"Σ Acme Co"}, + }, + DNSNames: []string{"test.example.com"}, + + // An explicit extension should override the DNSNames from the + // template. + ExtraExtensions: []pkix.Extension{ + { + Id: oidExtensionSubjectAltName, + Value: sanContents, + }, + }, + } + + csr := marshalAndParseCSR(t, &template) + + if len(csr.DNSNames) != 1 || csr.DNSNames[0] != "foo.example.com" { + t.Errorf("Extension did not override template. Got %v\n", csr.DNSNames) + } + + // If there is already an attribute with X.509 extensions then the + // extra extensions should be added to it rather than creating a CSR + // with two extension attributes. + + template.Attributes = []pkix.AttributeTypeAndValueSET{ + { + Type: oidExtensionRequest, + Value: [][]pkix.AttributeTypeAndValue{ + { + { + Type: oidExtensionAuthorityInfoAccess, + Value: []byte("foo"), + }, + }, + }, + }, + } + + csr = marshalAndParseCSR(t, &template) + if l := len(csr.Attributes); l != 1 { + t.Errorf("incorrect number of attributes: %d\n", l) + } + + if !csr.Attributes[0].Type.Equal(oidExtensionRequest) || + len(csr.Attributes[0].Value) != 1 || + len(csr.Attributes[0].Value[0]) != 2 { + t.Errorf("bad attributes: %#v\n", csr.Attributes) + } + + sanContents2, err := marshalSANs([]string{"foo2.example.com"}, nil, nil) + if err != nil { + t.Fatal(err) + } + + // Extensions in Attributes should override those in ExtraExtensions. + template.Attributes[0].Value[0] = append(template.Attributes[0].Value[0], pkix.AttributeTypeAndValue{ + Type: oidExtensionSubjectAltName, + Value: sanContents2, + }) + + csr = marshalAndParseCSR(t, &template) + + if len(csr.DNSNames) != 1 || csr.DNSNames[0] != "foo2.example.com" { + t.Errorf("Attributes did not override ExtraExtensions. Got %v\n", csr.DNSNames) + } +} + +func TestParseCertificateRequest(t *testing.T) { + for _, csrBase64 := range csrBase64Array { + csrBytes := fromBase64(csrBase64) + csr, err := ParseCertificateRequest(csrBytes) + if err != nil { + t.Fatalf("failed to parse CSR: %s", err) + } + + if len(csr.EmailAddresses) != 1 || csr.EmailAddresses[0] != "gopher@golang.org" { + t.Errorf("incorrect email addresses found: %v", csr.EmailAddresses) + } + + if len(csr.DNSNames) != 1 || csr.DNSNames[0] != "test.example.com" { + t.Errorf("incorrect DNS names found: %v", csr.DNSNames) + } + + if len(csr.Subject.Country) != 1 || csr.Subject.Country[0] != "AU" { + t.Errorf("incorrect Subject name: %v", csr.Subject) + } + + found := false + for _, e := range csr.Extensions { + if e.Id.Equal(oidExtensionBasicConstraints) { + found = true + break + } + } + if !found { + t.Errorf("basic constraints extension not found in CSR") + } + } +} + +func TestMaxPathLen(t *testing.T) { + block, _ := pem.Decode([]byte(pemPrivateKey)) + rsaPriv, err := ParsePKCS1PrivateKey(block.Bytes) + if err != nil { + t.Fatalf("Failed to parse private key: %s", err) + } + + template := &Certificate{ + SerialNumber: big.NewInt(1), + Subject: pkix.Name{ + CommonName: "Σ Acme Co", + }, + NotBefore: time.Unix(1000, 0), + NotAfter: time.Unix(100000, 0), + + BasicConstraintsValid: true, + IsCA: true, + } + + serialiseAndParse := func(template *Certificate) *Certificate { + derBytes, err := CreateCertificate(rand.Reader, template, template, &rsaPriv.PublicKey, rsaPriv) + if err != nil { + t.Fatalf("failed to create certificate: %s", err) + return nil + } + + cert, err := ParseCertificate(derBytes) + if err != nil { + t.Fatalf("failed to parse certificate: %s", err) + return nil + } + + return cert + } + + cert1 := serialiseAndParse(template) + if m := cert1.MaxPathLen; m != -1 { + t.Errorf("Omitting MaxPathLen didn't turn into -1, got %d", m) + } + if cert1.MaxPathLenZero { + t.Errorf("Omitting MaxPathLen resulted in MaxPathLenZero") + } + + template.MaxPathLen = 1 + cert2 := serialiseAndParse(template) + if m := cert2.MaxPathLen; m != 1 { + t.Errorf("Setting MaxPathLen didn't work. Got %d but set 1", m) + } + if cert2.MaxPathLenZero { + t.Errorf("Setting MaxPathLen resulted in MaxPathLenZero") + } + + template.MaxPathLen = 0 + template.MaxPathLenZero = true + cert3 := serialiseAndParse(template) + if m := cert3.MaxPathLen; m != 0 { + t.Errorf("Setting MaxPathLenZero didn't work, got %d", m) + } + if !cert3.MaxPathLenZero { + t.Errorf("Setting MaxPathLen to zero didn't result in MaxPathLenZero") + } +} + +func TestASN1BitLength(t *testing.T) { + tests := []struct { + bytes []byte + bitLen int + }{ + {nil, 0}, + {[]byte{0x00}, 0}, + {[]byte{0x00, 0x00}, 0}, + {[]byte{0xf0}, 4}, + {[]byte{0x88}, 5}, + {[]byte{0xff}, 8}, + {[]byte{0xff, 0x80}, 9}, + {[]byte{0xff, 0x81}, 16}, + } + + for i, test := range tests { + if got := asn1BitLength(test.bytes); got != test.bitLen { + t.Errorf("#%d: calculated bit-length of %d for %x, wanted %d", i, got, test.bytes, test.bitLen) + } + } +} + +// These CSR was generated with OpenSSL: +// openssl req -out CSR.csr -new -sha256 -nodes -keyout privateKey.key -config openssl.cnf +// +// With openssl.cnf containing the following sections: +// [ v3_req ] +// basicConstraints = CA:FALSE +// keyUsage = nonRepudiation, digitalSignature, keyEncipherment +// subjectAltName = email:gopher@golang.org,DNS:test.example.com +// [ req_attributes ] +// challengePassword = ignored challenge +// unstructuredName = ignored unstructured name +var csrBase64Array = [...]string{ + // Just [ v3_req ] + "MIIDHDCCAgQCAQAwfjELMAkGA1UEBhMCQVUxEzARBgNVBAgMClNvbWUtU3RhdGUxITAfBgNVBAoMGEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZDEUMBIGA1UEAwwLQ29tbW9uIE5hbWUxITAfBgkqhkiG9w0BCQEWEnRlc3RAZW1haWwuYWRkcmVzczCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAK1GY4YFx2ujlZEOJxQVYmsjUnLsd5nFVnNpLE4cV+77sgv9NPNlB8uhn3MXt5leD34rm/2BisCHOifPucYlSrszo2beuKhvwn4+2FxDmWtBEMu/QA16L5IvoOfYZm/gJTsPwKDqvaR0tTU67a9OtxwNTBMI56YKtmwd/o8d3hYv9cg+9ZGAZ/gKONcg/OWYx/XRh6bd0g8DMbCikpWgXKDsvvK1Nk+VtkDO1JxuBaj4Lz/p/MifTfnHoqHxWOWl4EaTs4Ychxsv34/rSj1KD1tJqorIv5Xv2aqv4sjxfbrYzX4kvS5SC1goIovLnhj5UjmQ3Qy8u65eow/LLWw+YFcCAwEAAaBZMFcGCSqGSIb3DQEJDjFKMEgwCQYDVR0TBAIwADALBgNVHQ8EBAMCBeAwLgYDVR0RBCcwJYERZ29waGVyQGdvbGFuZy5vcmeCEHRlc3QuZXhhbXBsZS5jb20wDQYJKoZIhvcNAQELBQADggEBAB6VPMRrchvNW61Tokyq3ZvO6/NoGIbuwUn54q6l5VZW0Ep5Nq8juhegSSnaJ0jrovmUgKDN9vEo2KxuAtwG6udS6Ami3zP+hRd4k9Q8djJPb78nrjzWiindLK5Fps9U5mMoi1ER8ViveyAOTfnZt/jsKUaRsscY2FzE9t9/o5moE6LTcHUS4Ap1eheR+J72WOnQYn3cifYaemsA9MJuLko+kQ6xseqttbh9zjqd9fiCSh/LNkzos9c+mg2yMADitaZinAh+HZi50ooEbjaT3erNq9O6RqwJlgD00g6MQdoz9bTAryCUhCQfkIaepmQ7BxS0pqWNW3MMwfDwx/Snz6g=", + // Both [ v3_req ] and [ req_attributes ] + "MIIDaTCCAlECAQAwfjELMAkGA1UEBhMCQVUxEzARBgNVBAgMClNvbWUtU3RhdGUxITAfBgNVBAoMGEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZDEUMBIGA1UEAwwLQ29tbW9uIE5hbWUxITAfBgkqhkiG9w0BCQEWEnRlc3RAZW1haWwuYWRkcmVzczCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAK1GY4YFx2ujlZEOJxQVYmsjUnLsd5nFVnNpLE4cV+77sgv9NPNlB8uhn3MXt5leD34rm/2BisCHOifPucYlSrszo2beuKhvwn4+2FxDmWtBEMu/QA16L5IvoOfYZm/gJTsPwKDqvaR0tTU67a9OtxwNTBMI56YKtmwd/o8d3hYv9cg+9ZGAZ/gKONcg/OWYx/XRh6bd0g8DMbCikpWgXKDsvvK1Nk+VtkDO1JxuBaj4Lz/p/MifTfnHoqHxWOWl4EaTs4Ychxsv34/rSj1KD1tJqorIv5Xv2aqv4sjxfbrYzX4kvS5SC1goIovLnhj5UjmQ3Qy8u65eow/LLWw+YFcCAwEAAaCBpTAgBgkqhkiG9w0BCQcxEwwRaWdub3JlZCBjaGFsbGVuZ2UwKAYJKoZIhvcNAQkCMRsMGWlnbm9yZWQgdW5zdHJ1Y3R1cmVkIG5hbWUwVwYJKoZIhvcNAQkOMUowSDAJBgNVHRMEAjAAMAsGA1UdDwQEAwIF4DAuBgNVHREEJzAlgRFnb3BoZXJAZ29sYW5nLm9yZ4IQdGVzdC5leGFtcGxlLmNvbTANBgkqhkiG9w0BAQsFAAOCAQEAgxe2N5O48EMsYE7o0rZBB0wi3Ov5/yYfnmmVI22Y3sP6VXbLDW0+UWIeSccOhzUCcZ/G4qcrfhhx6gTZTeA01nP7TdTJURvWAH5iFqj9sQ0qnLq6nEcVHij3sG6M5+BxAIVClQBk6lTCzgphc835Fjj6qSLuJ20XHdL5UfUbiJxx299CHgyBRL+hBUIPfz8p+ZgamyAuDLfnj54zzcRVyLlrmMLNPZNll1Q70RxoU6uWvLH8wB8vQe3Q/guSGubLyLRTUQVPh+dw1L4t8MKFWfX/48jwRM4gIRHFHPeAAE9D9YAoqdIvj/iFm/eQ++7DP8MDwOZWsXeB6jjwHuLmkQ==", +} diff --git a/src/crypto/x509/x509_test_import.go b/src/crypto/x509/x509_test_import.go new file mode 100644 index 0000000000000000000000000000000000000000..3fda7da188c0da0050f09f491fb260c0d9e7d128 --- /dev/null +++ b/src/crypto/x509/x509_test_import.go @@ -0,0 +1,53 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build ignore + +// This file is run by the x509 tests to ensure that a program with minimal +// imports can sign certificates without errors resulting from missing hash +// functions. +package main + +import ( + "crypto/rand" + "crypto/x509" + "crypto/x509/pkix" + "encoding/pem" + "math/big" + "time" +) + +func main() { + block, _ := pem.Decode([]byte(pemPrivateKey)) + rsaPriv, err := x509.ParsePKCS1PrivateKey(block.Bytes) + if err != nil { + panic("Failed to parse private key: " + err.Error()) + } + + template := x509.Certificate{ + SerialNumber: big.NewInt(1), + Subject: pkix.Name{ + CommonName: "test", + Organization: []string{"Σ Acme Co"}, + }, + NotBefore: time.Unix(1000, 0), + NotAfter: time.Unix(100000, 0), + KeyUsage: x509.KeyUsageCertSign, + } + + if _, err = x509.CreateCertificate(rand.Reader, &template, &template, &rsaPriv.PublicKey, rsaPriv); err != nil { + panic("failed to create certificate with basic imports: " + err.Error()) + } +} + +var pemPrivateKey = `-----BEGIN RSA PRIVATE KEY----- +MIIBOgIBAAJBALKZD0nEffqM1ACuak0bijtqE2QrI/KLADv7l3kK3ppMyCuLKoF0 +fd7Ai2KW5ToIwzFofvJcS/STa6HA5gQenRUCAwEAAQJBAIq9amn00aS0h/CrjXqu +/ThglAXJmZhOMPVn4eiu7/ROixi9sex436MaVeMqSNf7Ex9a8fRNfWss7Sqd9eWu +RTUCIQDasvGASLqmjeffBNLTXV2A5g4t+kLVCpsEIZAycV5GswIhANEPLmax0ME/ +EO+ZJ79TJKN5yiGBRsv5yvx5UiHxajEXAiAhAol5N4EUyq6I9w1rYdhPMGpLfk7A +IU2snfRJ6Nq2CQIgFrPsWRCkV+gOYcajD17rEqmuLrdIRexpg8N1DOSXoJ8CIGlS +tAboUGBxTDq3ZroNism3DaMIbKPyYrAqhKov1h5V +-----END RSA PRIVATE KEY----- +` diff --git a/src/database/sql/convert.go b/src/database/sql/convert.go new file mode 100644 index 0000000000000000000000000000000000000000..c0b38a24940fcade4452df0b5cdae6369420d3df --- /dev/null +++ b/src/database/sql/convert.go @@ -0,0 +1,299 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Type conversions for Scan. + +package sql + +import ( + "database/sql/driver" + "errors" + "fmt" + "reflect" + "strconv" +) + +var errNilPtr = errors.New("destination pointer is nil") // embedded in descriptive error + +// driverArgs converts arguments from callers of Stmt.Exec and +// Stmt.Query into driver Values. +// +// The statement ds may be nil, if no statement is available. +func driverArgs(ds *driverStmt, args []interface{}) ([]driver.Value, error) { + dargs := make([]driver.Value, len(args)) + var si driver.Stmt + if ds != nil { + si = ds.si + } + cc, ok := si.(driver.ColumnConverter) + + // Normal path, for a driver.Stmt that is not a ColumnConverter. + if !ok { + for n, arg := range args { + var err error + dargs[n], err = driver.DefaultParameterConverter.ConvertValue(arg) + if err != nil { + return nil, fmt.Errorf("sql: converting Exec argument #%d's type: %v", n, err) + } + } + return dargs, nil + } + + // Let the Stmt convert its own arguments. + for n, arg := range args { + // First, see if the value itself knows how to convert + // itself to a driver type. For example, a NullString + // struct changing into a string or nil. + if svi, ok := arg.(driver.Valuer); ok { + sv, err := svi.Value() + if err != nil { + return nil, fmt.Errorf("sql: argument index %d from Value: %v", n, err) + } + if !driver.IsValue(sv) { + return nil, fmt.Errorf("sql: argument index %d: non-subset type %T returned from Value", n, sv) + } + arg = sv + } + + // Second, ask the column to sanity check itself. For + // example, drivers might use this to make sure that + // an int64 values being inserted into a 16-bit + // integer field is in range (before getting + // truncated), or that a nil can't go into a NOT NULL + // column before going across the network to get the + // same error. + var err error + ds.Lock() + dargs[n], err = cc.ColumnConverter(n).ConvertValue(arg) + ds.Unlock() + if err != nil { + return nil, fmt.Errorf("sql: converting argument #%d's type: %v", n, err) + } + if !driver.IsValue(dargs[n]) { + return nil, fmt.Errorf("sql: driver ColumnConverter error converted %T to unsupported type %T", + arg, dargs[n]) + } + } + + return dargs, nil +} + +// convertAssign copies to dest the value in src, converting it if possible. +// An error is returned if the copy would result in loss of information. +// dest should be a pointer type. +func convertAssign(dest, src interface{}) error { + // Common cases, without reflect. + switch s := src.(type) { + case string: + switch d := dest.(type) { + case *string: + if d == nil { + return errNilPtr + } + *d = s + return nil + case *[]byte: + if d == nil { + return errNilPtr + } + *d = []byte(s) + return nil + } + case []byte: + switch d := dest.(type) { + case *string: + if d == nil { + return errNilPtr + } + *d = string(s) + return nil + case *interface{}: + if d == nil { + return errNilPtr + } + *d = cloneBytes(s) + return nil + case *[]byte: + if d == nil { + return errNilPtr + } + *d = cloneBytes(s) + return nil + case *RawBytes: + if d == nil { + return errNilPtr + } + *d = s + return nil + } + case nil: + switch d := dest.(type) { + case *interface{}: + if d == nil { + return errNilPtr + } + *d = nil + return nil + case *[]byte: + if d == nil { + return errNilPtr + } + *d = nil + return nil + case *RawBytes: + if d == nil { + return errNilPtr + } + *d = nil + return nil + } + } + + var sv reflect.Value + + switch d := dest.(type) { + case *string: + sv = reflect.ValueOf(src) + switch sv.Kind() { + case reflect.Bool, + reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, + reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, + reflect.Float32, reflect.Float64: + *d = asString(src) + return nil + } + case *[]byte: + sv = reflect.ValueOf(src) + if b, ok := asBytes(nil, sv); ok { + *d = b + return nil + } + case *RawBytes: + sv = reflect.ValueOf(src) + if b, ok := asBytes([]byte(*d)[:0], sv); ok { + *d = RawBytes(b) + return nil + } + case *bool: + bv, err := driver.Bool.ConvertValue(src) + if err == nil { + *d = bv.(bool) + } + return err + case *interface{}: + *d = src + return nil + } + + if scanner, ok := dest.(Scanner); ok { + return scanner.Scan(src) + } + + dpv := reflect.ValueOf(dest) + if dpv.Kind() != reflect.Ptr { + return errors.New("destination not a pointer") + } + if dpv.IsNil() { + return errNilPtr + } + + if !sv.IsValid() { + sv = reflect.ValueOf(src) + } + + dv := reflect.Indirect(dpv) + if dv.Kind() == sv.Kind() { + dv.Set(sv) + return nil + } + + switch dv.Kind() { + case reflect.Ptr: + if src == nil { + dv.Set(reflect.Zero(dv.Type())) + return nil + } else { + dv.Set(reflect.New(dv.Type().Elem())) + return convertAssign(dv.Interface(), src) + } + case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: + s := asString(src) + i64, err := strconv.ParseInt(s, 10, dv.Type().Bits()) + if err != nil { + return fmt.Errorf("converting string %q to a %s: %v", s, dv.Kind(), err) + } + dv.SetInt(i64) + return nil + case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64: + s := asString(src) + u64, err := strconv.ParseUint(s, 10, dv.Type().Bits()) + if err != nil { + return fmt.Errorf("converting string %q to a %s: %v", s, dv.Kind(), err) + } + dv.SetUint(u64) + return nil + case reflect.Float32, reflect.Float64: + s := asString(src) + f64, err := strconv.ParseFloat(s, dv.Type().Bits()) + if err != nil { + return fmt.Errorf("converting string %q to a %s: %v", s, dv.Kind(), err) + } + dv.SetFloat(f64) + return nil + } + + return fmt.Errorf("unsupported driver -> Scan pair: %T -> %T", src, dest) +} + +func cloneBytes(b []byte) []byte { + if b == nil { + return nil + } else { + c := make([]byte, len(b)) + copy(c, b) + return c + } +} + +func asString(src interface{}) string { + switch v := src.(type) { + case string: + return v + case []byte: + return string(v) + } + rv := reflect.ValueOf(src) + switch rv.Kind() { + case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: + return strconv.FormatInt(rv.Int(), 10) + case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64: + return strconv.FormatUint(rv.Uint(), 10) + case reflect.Float64: + return strconv.FormatFloat(rv.Float(), 'g', -1, 64) + case reflect.Float32: + return strconv.FormatFloat(rv.Float(), 'g', -1, 32) + case reflect.Bool: + return strconv.FormatBool(rv.Bool()) + } + return fmt.Sprintf("%v", src) +} + +func asBytes(buf []byte, rv reflect.Value) (b []byte, ok bool) { + switch rv.Kind() { + case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: + return strconv.AppendInt(buf, rv.Int(), 10), true + case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64: + return strconv.AppendUint(buf, rv.Uint(), 10), true + case reflect.Float32: + return strconv.AppendFloat(buf, rv.Float(), 'g', -1, 32), true + case reflect.Float64: + return strconv.AppendFloat(buf, rv.Float(), 'g', -1, 64), true + case reflect.Bool: + return strconv.AppendBool(buf, rv.Bool()), true + case reflect.String: + s := rv.String() + return append(buf, s...), true + } + return +} diff --git a/src/database/sql/convert_test.go b/src/database/sql/convert_test.go new file mode 100644 index 0000000000000000000000000000000000000000..98af9fb64c58ba39dcadfe9ae2b1e7e6eeb37ea1 --- /dev/null +++ b/src/database/sql/convert_test.go @@ -0,0 +1,348 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package sql + +import ( + "database/sql/driver" + "fmt" + "reflect" + "runtime" + "testing" + "time" +) + +var someTime = time.Unix(123, 0) +var answer int64 = 42 + +type conversionTest struct { + s, d interface{} // source and destination + + // following are used if they're non-zero + wantint int64 + wantuint uint64 + wantstr string + wantbytes []byte + wantraw RawBytes + wantf32 float32 + wantf64 float64 + wanttime time.Time + wantbool bool // used if d is of type *bool + wanterr string + wantiface interface{} + wantptr *int64 // if non-nil, *d's pointed value must be equal to *wantptr + wantnil bool // if true, *d must be *int64(nil) +} + +// Target variables for scanning into. +var ( + scanstr string + scanbytes []byte + scanraw RawBytes + scanint int + scanint8 int8 + scanint16 int16 + scanint32 int32 + scanuint8 uint8 + scanuint16 uint16 + scanbool bool + scanf32 float32 + scanf64 float64 + scantime time.Time + scanptr *int64 + scaniface interface{} +) + +var conversionTests = []conversionTest{ + // Exact conversions (destination pointer type matches source type) + {s: "foo", d: &scanstr, wantstr: "foo"}, + {s: 123, d: &scanint, wantint: 123}, + {s: someTime, d: &scantime, wanttime: someTime}, + + // To strings + {s: "string", d: &scanstr, wantstr: "string"}, + {s: []byte("byteslice"), d: &scanstr, wantstr: "byteslice"}, + {s: 123, d: &scanstr, wantstr: "123"}, + {s: int8(123), d: &scanstr, wantstr: "123"}, + {s: int64(123), d: &scanstr, wantstr: "123"}, + {s: uint8(123), d: &scanstr, wantstr: "123"}, + {s: uint16(123), d: &scanstr, wantstr: "123"}, + {s: uint32(123), d: &scanstr, wantstr: "123"}, + {s: uint64(123), d: &scanstr, wantstr: "123"}, + {s: 1.5, d: &scanstr, wantstr: "1.5"}, + + // To []byte + {s: nil, d: &scanbytes, wantbytes: nil}, + {s: "string", d: &scanbytes, wantbytes: []byte("string")}, + {s: []byte("byteslice"), d: &scanbytes, wantbytes: []byte("byteslice")}, + {s: 123, d: &scanbytes, wantbytes: []byte("123")}, + {s: int8(123), d: &scanbytes, wantbytes: []byte("123")}, + {s: int64(123), d: &scanbytes, wantbytes: []byte("123")}, + {s: uint8(123), d: &scanbytes, wantbytes: []byte("123")}, + {s: uint16(123), d: &scanbytes, wantbytes: []byte("123")}, + {s: uint32(123), d: &scanbytes, wantbytes: []byte("123")}, + {s: uint64(123), d: &scanbytes, wantbytes: []byte("123")}, + {s: 1.5, d: &scanbytes, wantbytes: []byte("1.5")}, + + // To RawBytes + {s: nil, d: &scanraw, wantraw: nil}, + {s: []byte("byteslice"), d: &scanraw, wantraw: RawBytes("byteslice")}, + {s: 123, d: &scanraw, wantraw: RawBytes("123")}, + {s: int8(123), d: &scanraw, wantraw: RawBytes("123")}, + {s: int64(123), d: &scanraw, wantraw: RawBytes("123")}, + {s: uint8(123), d: &scanraw, wantraw: RawBytes("123")}, + {s: uint16(123), d: &scanraw, wantraw: RawBytes("123")}, + {s: uint32(123), d: &scanraw, wantraw: RawBytes("123")}, + {s: uint64(123), d: &scanraw, wantraw: RawBytes("123")}, + {s: 1.5, d: &scanraw, wantraw: RawBytes("1.5")}, + + // Strings to integers + {s: "255", d: &scanuint8, wantuint: 255}, + {s: "256", d: &scanuint8, wanterr: `converting string "256" to a uint8: strconv.ParseUint: parsing "256": value out of range`}, + {s: "256", d: &scanuint16, wantuint: 256}, + {s: "-1", d: &scanint, wantint: -1}, + {s: "foo", d: &scanint, wanterr: `converting string "foo" to a int: strconv.ParseInt: parsing "foo": invalid syntax`}, + + // True bools + {s: true, d: &scanbool, wantbool: true}, + {s: "True", d: &scanbool, wantbool: true}, + {s: "TRUE", d: &scanbool, wantbool: true}, + {s: "1", d: &scanbool, wantbool: true}, + {s: 1, d: &scanbool, wantbool: true}, + {s: int64(1), d: &scanbool, wantbool: true}, + {s: uint16(1), d: &scanbool, wantbool: true}, + + // False bools + {s: false, d: &scanbool, wantbool: false}, + {s: "false", d: &scanbool, wantbool: false}, + {s: "FALSE", d: &scanbool, wantbool: false}, + {s: "0", d: &scanbool, wantbool: false}, + {s: 0, d: &scanbool, wantbool: false}, + {s: int64(0), d: &scanbool, wantbool: false}, + {s: uint16(0), d: &scanbool, wantbool: false}, + + // Not bools + {s: "yup", d: &scanbool, wanterr: `sql/driver: couldn't convert "yup" into type bool`}, + {s: 2, d: &scanbool, wanterr: `sql/driver: couldn't convert 2 into type bool`}, + + // Floats + {s: float64(1.5), d: &scanf64, wantf64: float64(1.5)}, + {s: int64(1), d: &scanf64, wantf64: float64(1)}, + {s: float64(1.5), d: &scanf32, wantf32: float32(1.5)}, + {s: "1.5", d: &scanf32, wantf32: float32(1.5)}, + {s: "1.5", d: &scanf64, wantf64: float64(1.5)}, + + // Pointers + {s: interface{}(nil), d: &scanptr, wantnil: true}, + {s: int64(42), d: &scanptr, wantptr: &answer}, + + // To interface{} + {s: float64(1.5), d: &scaniface, wantiface: float64(1.5)}, + {s: int64(1), d: &scaniface, wantiface: int64(1)}, + {s: "str", d: &scaniface, wantiface: "str"}, + {s: []byte("byteslice"), d: &scaniface, wantiface: []byte("byteslice")}, + {s: true, d: &scaniface, wantiface: true}, + {s: nil, d: &scaniface}, + {s: []byte(nil), d: &scaniface, wantiface: []byte(nil)}, +} + +func intPtrValue(intptr interface{}) interface{} { + return reflect.Indirect(reflect.Indirect(reflect.ValueOf(intptr))).Int() +} + +func intValue(intptr interface{}) int64 { + return reflect.Indirect(reflect.ValueOf(intptr)).Int() +} + +func uintValue(intptr interface{}) uint64 { + return reflect.Indirect(reflect.ValueOf(intptr)).Uint() +} + +func float64Value(ptr interface{}) float64 { + return *(ptr.(*float64)) +} + +func float32Value(ptr interface{}) float32 { + return *(ptr.(*float32)) +} + +func timeValue(ptr interface{}) time.Time { + return *(ptr.(*time.Time)) +} + +func TestConversions(t *testing.T) { + for n, ct := range conversionTests { + err := convertAssign(ct.d, ct.s) + errstr := "" + if err != nil { + errstr = err.Error() + } + errf := func(format string, args ...interface{}) { + base := fmt.Sprintf("convertAssign #%d: for %v (%T) -> %T, ", n, ct.s, ct.s, ct.d) + t.Errorf(base+format, args...) + } + if errstr != ct.wanterr { + errf("got error %q, want error %q", errstr, ct.wanterr) + } + if ct.wantstr != "" && ct.wantstr != scanstr { + errf("want string %q, got %q", ct.wantstr, scanstr) + } + if ct.wantint != 0 && ct.wantint != intValue(ct.d) { + errf("want int %d, got %d", ct.wantint, intValue(ct.d)) + } + if ct.wantuint != 0 && ct.wantuint != uintValue(ct.d) { + errf("want uint %d, got %d", ct.wantuint, uintValue(ct.d)) + } + if ct.wantf32 != 0 && ct.wantf32 != float32Value(ct.d) { + errf("want float32 %v, got %v", ct.wantf32, float32Value(ct.d)) + } + if ct.wantf64 != 0 && ct.wantf64 != float64Value(ct.d) { + errf("want float32 %v, got %v", ct.wantf64, float64Value(ct.d)) + } + if bp, boolTest := ct.d.(*bool); boolTest && *bp != ct.wantbool && ct.wanterr == "" { + errf("want bool %v, got %v", ct.wantbool, *bp) + } + if !ct.wanttime.IsZero() && !ct.wanttime.Equal(timeValue(ct.d)) { + errf("want time %v, got %v", ct.wanttime, timeValue(ct.d)) + } + if ct.wantnil && *ct.d.(**int64) != nil { + errf("want nil, got %v", intPtrValue(ct.d)) + } + if ct.wantptr != nil { + if *ct.d.(**int64) == nil { + errf("want pointer to %v, got nil", *ct.wantptr) + } else if *ct.wantptr != intPtrValue(ct.d) { + errf("want pointer to %v, got %v", *ct.wantptr, intPtrValue(ct.d)) + } + } + if ifptr, ok := ct.d.(*interface{}); ok { + if !reflect.DeepEqual(ct.wantiface, scaniface) { + errf("want interface %#v, got %#v", ct.wantiface, scaniface) + continue + } + if srcBytes, ok := ct.s.([]byte); ok { + dstBytes := (*ifptr).([]byte) + if len(srcBytes) > 0 && &dstBytes[0] == &srcBytes[0] { + errf("copy into interface{} didn't copy []byte data") + } + } + } + } +} + +func TestNullString(t *testing.T) { + var ns NullString + convertAssign(&ns, []byte("foo")) + if !ns.Valid { + t.Errorf("expecting not null") + } + if ns.String != "foo" { + t.Errorf("expecting foo; got %q", ns.String) + } + convertAssign(&ns, nil) + if ns.Valid { + t.Errorf("expecting null on nil") + } + if ns.String != "" { + t.Errorf("expecting blank on nil; got %q", ns.String) + } +} + +type valueConverterTest struct { + c driver.ValueConverter + in, out interface{} + err string +} + +var valueConverterTests = []valueConverterTest{ + {driver.DefaultParameterConverter, NullString{"hi", true}, "hi", ""}, + {driver.DefaultParameterConverter, NullString{"", false}, nil, ""}, +} + +func TestValueConverters(t *testing.T) { + for i, tt := range valueConverterTests { + out, err := tt.c.ConvertValue(tt.in) + goterr := "" + if err != nil { + goterr = err.Error() + } + if goterr != tt.err { + t.Errorf("test %d: %T(%T(%v)) error = %q; want error = %q", + i, tt.c, tt.in, tt.in, goterr, tt.err) + } + if tt.err != "" { + continue + } + if !reflect.DeepEqual(out, tt.out) { + t.Errorf("test %d: %T(%T(%v)) = %v (%T); want %v (%T)", + i, tt.c, tt.in, tt.in, out, out, tt.out, tt.out) + } + } +} + +// Tests that assigning to RawBytes doesn't allocate (and also works). +func TestRawBytesAllocs(t *testing.T) { + var tests = []struct { + name string + in interface{} + want string + }{ + {"uint64", uint64(12345678), "12345678"}, + {"uint32", uint32(1234), "1234"}, + {"uint16", uint16(12), "12"}, + {"uint8", uint8(1), "1"}, + {"uint", uint(123), "123"}, + {"int", int(123), "123"}, + {"int8", int8(1), "1"}, + {"int16", int16(12), "12"}, + {"int32", int32(1234), "1234"}, + {"int64", int64(12345678), "12345678"}, + {"float32", float32(1.5), "1.5"}, + {"float64", float64(64), "64"}, + {"bool", false, "false"}, + } + + buf := make(RawBytes, 10) + test := func(name string, in interface{}, want string) { + if err := convertAssign(&buf, in); err != nil { + t.Fatalf("%s: convertAssign = %v", name, err) + } + match := len(buf) == len(want) + if match { + for i, b := range buf { + if want[i] != b { + match = false + break + } + } + } + if !match { + t.Fatalf("%s: got %q (len %d); want %q (len %d)", name, buf, len(buf), want, len(want)) + } + } + + n := testing.AllocsPerRun(100, func() { + for _, tt := range tests { + test(tt.name, tt.in, tt.want) + } + }) + + // The numbers below are only valid for 64-bit interface word sizes, + // and gc. With 32-bit words there are more convT2E allocs, and + // with gccgo, only pointers currently go in interface data. + // So only care on amd64 gc for now. + measureAllocs := runtime.GOARCH == "amd64" && runtime.Compiler == "gc" + + if n > 0.5 && measureAllocs { + t.Fatalf("allocs = %v; want 0", n) + } + + // This one involves a convT2E allocation, string -> interface{} + n = testing.AllocsPerRun(100, func() { + test("string", "foo", "foo") + }) + if n > 1.5 && measureAllocs { + t.Fatalf("allocs = %v; want max 1", n) + } +} diff --git a/src/database/sql/doc.txt b/src/database/sql/doc.txt new file mode 100644 index 0000000000000000000000000000000000000000..405c5ed2a6136ad32507fd9951ead0ed0ffd2f5e --- /dev/null +++ b/src/database/sql/doc.txt @@ -0,0 +1,46 @@ +Goals of the sql and sql/driver packages: + +* Provide a generic database API for a variety of SQL or SQL-like + databases. There currently exist Go libraries for SQLite, MySQL, + and Postgres, but all with a very different feel, and often + a non-Go-like feel. + +* Feel like Go. + +* Care mostly about the common cases. Common SQL should be portable. + SQL edge cases or db-specific extensions can be detected and + conditionally used by the application. It is a non-goal to care + about every particular db's extension or quirk. + +* Separate out the basic implementation of a database driver + (implementing the sql/driver interfaces) vs the implementation + of all the user-level types and convenience methods. + In a nutshell: + + User Code ---> sql package (concrete types) ---> sql/driver (interfaces) + Database Driver -> sql (to register) + sql/driver (implement interfaces) + +* Make type casting/conversions consistent between all drivers. To + achieve this, most of the conversions are done in the sql package, + not in each driver. The drivers then only have to deal with a + smaller set of types. + +* Be flexible with type conversions, but be paranoid about silent + truncation or other loss of precision. + +* Handle concurrency well. Users shouldn't need to care about the + database's per-connection thread safety issues (or lack thereof), + and shouldn't have to maintain their own free pools of connections. + The 'db' package should deal with that bookkeeping as needed. Given + an *sql.DB, it should be possible to share that instance between + multiple goroutines, without any extra synchronization. + +* Push complexity, where necessary, down into the sql+driver packages, + rather than exposing it to users. Said otherwise, the sql package + should expose an ideal database that's not finnicky about how it's + accessed, even if that's not true. + +* Provide optional interfaces in sql/driver for drivers to implement + for special cases or fastpaths. But the only party that knows about + those is the sql package. To user code, some stuff just might start + working or start working slightly faster. diff --git a/src/database/sql/driver/driver.go b/src/database/sql/driver/driver.go new file mode 100644 index 0000000000000000000000000000000000000000..eca25f29a0aa125dbdd5537b4d7708b0b16f6d63 --- /dev/null +++ b/src/database/sql/driver/driver.go @@ -0,0 +1,211 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package driver defines interfaces to be implemented by database +// drivers as used by package sql. +// +// Most code should use package sql. +package driver + +import "errors" + +// Value is a value that drivers must be able to handle. +// It is either nil or an instance of one of these types: +// +// int64 +// float64 +// bool +// []byte +// string [*] everywhere except from Rows.Next. +// time.Time +type Value interface{} + +// Driver is the interface that must be implemented by a database +// driver. +type Driver interface { + // Open returns a new connection to the database. + // The name is a string in a driver-specific format. + // + // Open may return a cached connection (one previously + // closed), but doing so is unnecessary; the sql package + // maintains a pool of idle connections for efficient re-use. + // + // The returned connection is only used by one goroutine at a + // time. + Open(name string) (Conn, error) +} + +// ErrSkip may be returned by some optional interfaces' methods to +// indicate at runtime that the fast path is unavailable and the sql +// package should continue as if the optional interface was not +// implemented. ErrSkip is only supported where explicitly +// documented. +var ErrSkip = errors.New("driver: skip fast-path; continue as if unimplemented") + +// ErrBadConn should be returned by a driver to signal to the sql +// package that a driver.Conn is in a bad state (such as the server +// having earlier closed the connection) and the sql package should +// retry on a new connection. +// +// To prevent duplicate operations, ErrBadConn should NOT be returned +// if there's a possibility that the database server might have +// performed the operation. Even if the server sends back an error, +// you shouldn't return ErrBadConn. +var ErrBadConn = errors.New("driver: bad connection") + +// Execer is an optional interface that may be implemented by a Conn. +// +// If a Conn does not implement Execer, the sql package's DB.Exec will +// first prepare a query, execute the statement, and then close the +// statement. +// +// Exec may return ErrSkip. +type Execer interface { + Exec(query string, args []Value) (Result, error) +} + +// Queryer is an optional interface that may be implemented by a Conn. +// +// If a Conn does not implement Queryer, the sql package's DB.Query will +// first prepare a query, execute the statement, and then close the +// statement. +// +// Query may return ErrSkip. +type Queryer interface { + Query(query string, args []Value) (Rows, error) +} + +// Conn is a connection to a database. It is not used concurrently +// by multiple goroutines. +// +// Conn is assumed to be stateful. +type Conn interface { + // Prepare returns a prepared statement, bound to this connection. + Prepare(query string) (Stmt, error) + + // Close invalidates and potentially stops any current + // prepared statements and transactions, marking this + // connection as no longer in use. + // + // Because the sql package maintains a free pool of + // connections and only calls Close when there's a surplus of + // idle connections, it shouldn't be necessary for drivers to + // do their own connection caching. + Close() error + + // Begin starts and returns a new transaction. + Begin() (Tx, error) +} + +// Result is the result of a query execution. +type Result interface { + // LastInsertId returns the database's auto-generated ID + // after, for example, an INSERT into a table with primary + // key. + LastInsertId() (int64, error) + + // RowsAffected returns the number of rows affected by the + // query. + RowsAffected() (int64, error) +} + +// Stmt is a prepared statement. It is bound to a Conn and not +// used by multiple goroutines concurrently. +type Stmt interface { + // Close closes the statement. + // + // As of Go 1.1, a Stmt will not be closed if it's in use + // by any queries. + Close() error + + // NumInput returns the number of placeholder parameters. + // + // If NumInput returns >= 0, the sql package will sanity check + // argument counts from callers and return errors to the caller + // before the statement's Exec or Query methods are called. + // + // NumInput may also return -1, if the driver doesn't know + // its number of placeholders. In that case, the sql package + // will not sanity check Exec or Query argument counts. + NumInput() int + + // Exec executes a query that doesn't return rows, such + // as an INSERT or UPDATE. + Exec(args []Value) (Result, error) + + // Query executes a query that may return rows, such as a + // SELECT. + Query(args []Value) (Rows, error) +} + +// ColumnConverter may be optionally implemented by Stmt if the +// statement is aware of its own columns' types and can convert from +// any type to a driver Value. +type ColumnConverter interface { + // ColumnConverter returns a ValueConverter for the provided + // column index. If the type of a specific column isn't known + // or shouldn't be handled specially, DefaultValueConverter + // can be returned. + ColumnConverter(idx int) ValueConverter +} + +// Rows is an iterator over an executed query's results. +type Rows interface { + // Columns returns the names of the columns. The number of + // columns of the result is inferred from the length of the + // slice. If a particular column name isn't known, an empty + // string should be returned for that entry. + Columns() []string + + // Close closes the rows iterator. + Close() error + + // Next is called to populate the next row of data into + // the provided slice. The provided slice will be the same + // size as the Columns() are wide. + // + // The dest slice may be populated only with + // a driver Value type, but excluding string. + // All string values must be converted to []byte. + // + // Next should return io.EOF when there are no more rows. + Next(dest []Value) error +} + +// Tx is a transaction. +type Tx interface { + Commit() error + Rollback() error +} + +// RowsAffected implements Result for an INSERT or UPDATE operation +// which mutates a number of rows. +type RowsAffected int64 + +var _ Result = RowsAffected(0) + +func (RowsAffected) LastInsertId() (int64, error) { + return 0, errors.New("no LastInsertId available") +} + +func (v RowsAffected) RowsAffected() (int64, error) { + return int64(v), nil +} + +// ResultNoRows is a pre-defined Result for drivers to return when a DDL +// command (such as a CREATE TABLE) succeeds. It returns an error for both +// LastInsertId and RowsAffected. +var ResultNoRows noRows + +type noRows struct{} + +var _ Result = noRows{} + +func (noRows) LastInsertId() (int64, error) { + return 0, errors.New("no LastInsertId available after DDL statement") +} + +func (noRows) RowsAffected() (int64, error) { + return 0, errors.New("no RowsAffected available after DDL statement") +} diff --git a/src/database/sql/driver/types.go b/src/database/sql/driver/types.go new file mode 100644 index 0000000000000000000000000000000000000000..3305354dfd0d66183d96545bbae100d8c3d52450 --- /dev/null +++ b/src/database/sql/driver/types.go @@ -0,0 +1,252 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package driver + +import ( + "fmt" + "reflect" + "strconv" + "time" +) + +// ValueConverter is the interface providing the ConvertValue method. +// +// Various implementations of ValueConverter are provided by the +// driver package to provide consistent implementations of conversions +// between drivers. The ValueConverters have several uses: +// +// * converting from the Value types as provided by the sql package +// into a database table's specific column type and making sure it +// fits, such as making sure a particular int64 fits in a +// table's uint16 column. +// +// * converting a value as given from the database into one of the +// driver Value types. +// +// * by the sql package, for converting from a driver's Value type +// to a user's type in a scan. +type ValueConverter interface { + // ConvertValue converts a value to a driver Value. + ConvertValue(v interface{}) (Value, error) +} + +// Valuer is the interface providing the Value method. +// +// Types implementing Valuer interface are able to convert +// themselves to a driver Value. +type Valuer interface { + // Value returns a driver Value. + Value() (Value, error) +} + +// Bool is a ValueConverter that converts input values to bools. +// +// The conversion rules are: +// - booleans are returned unchanged +// - for integer types, +// 1 is true +// 0 is false, +// other integers are an error +// - for strings and []byte, same rules as strconv.ParseBool +// - all other types are an error +var Bool boolType + +type boolType struct{} + +var _ ValueConverter = boolType{} + +func (boolType) String() string { return "Bool" } + +func (boolType) ConvertValue(src interface{}) (Value, error) { + switch s := src.(type) { + case bool: + return s, nil + case string: + b, err := strconv.ParseBool(s) + if err != nil { + return nil, fmt.Errorf("sql/driver: couldn't convert %q into type bool", s) + } + return b, nil + case []byte: + b, err := strconv.ParseBool(string(s)) + if err != nil { + return nil, fmt.Errorf("sql/driver: couldn't convert %q into type bool", s) + } + return b, nil + } + + sv := reflect.ValueOf(src) + switch sv.Kind() { + case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: + iv := sv.Int() + if iv == 1 || iv == 0 { + return iv == 1, nil + } + return nil, fmt.Errorf("sql/driver: couldn't convert %d into type bool", iv) + case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64: + uv := sv.Uint() + if uv == 1 || uv == 0 { + return uv == 1, nil + } + return nil, fmt.Errorf("sql/driver: couldn't convert %d into type bool", uv) + } + + return nil, fmt.Errorf("sql/driver: couldn't convert %v (%T) into type bool", src, src) +} + +// Int32 is a ValueConverter that converts input values to int64, +// respecting the limits of an int32 value. +var Int32 int32Type + +type int32Type struct{} + +var _ ValueConverter = int32Type{} + +func (int32Type) ConvertValue(v interface{}) (Value, error) { + rv := reflect.ValueOf(v) + switch rv.Kind() { + case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: + i64 := rv.Int() + if i64 > (1<<31)-1 || i64 < -(1<<31) { + return nil, fmt.Errorf("sql/driver: value %d overflows int32", v) + } + return i64, nil + case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64: + u64 := rv.Uint() + if u64 > (1<<31)-1 { + return nil, fmt.Errorf("sql/driver: value %d overflows int32", v) + } + return int64(u64), nil + case reflect.String: + i, err := strconv.Atoi(rv.String()) + if err != nil { + return nil, fmt.Errorf("sql/driver: value %q can't be converted to int32", v) + } + return int64(i), nil + } + return nil, fmt.Errorf("sql/driver: unsupported value %v (type %T) converting to int32", v, v) +} + +// String is a ValueConverter that converts its input to a string. +// If the value is already a string or []byte, it's unchanged. +// If the value is of another type, conversion to string is done +// with fmt.Sprintf("%v", v). +var String stringType + +type stringType struct{} + +func (stringType) ConvertValue(v interface{}) (Value, error) { + switch v.(type) { + case string, []byte: + return v, nil + } + return fmt.Sprintf("%v", v), nil +} + +// Null is a type that implements ValueConverter by allowing nil +// values but otherwise delegating to another ValueConverter. +type Null struct { + Converter ValueConverter +} + +func (n Null) ConvertValue(v interface{}) (Value, error) { + if v == nil { + return nil, nil + } + return n.Converter.ConvertValue(v) +} + +// NotNull is a type that implements ValueConverter by disallowing nil +// values but otherwise delegating to another ValueConverter. +type NotNull struct { + Converter ValueConverter +} + +func (n NotNull) ConvertValue(v interface{}) (Value, error) { + if v == nil { + return nil, fmt.Errorf("nil value not allowed") + } + return n.Converter.ConvertValue(v) +} + +// IsValue reports whether v is a valid Value parameter type. +// Unlike IsScanValue, IsValue permits the string type. +func IsValue(v interface{}) bool { + if IsScanValue(v) { + return true + } + if _, ok := v.(string); ok { + return true + } + return false +} + +// IsScanValue reports whether v is a valid Value scan type. +// Unlike IsValue, IsScanValue does not permit the string type. +func IsScanValue(v interface{}) bool { + if v == nil { + return true + } + switch v.(type) { + case int64, float64, []byte, bool, time.Time: + return true + } + return false +} + +// DefaultParameterConverter is the default implementation of +// ValueConverter that's used when a Stmt doesn't implement +// ColumnConverter. +// +// DefaultParameterConverter returns the given value directly if +// IsValue(value). Otherwise integer type are converted to +// int64, floats to float64, and strings to []byte. Other types are +// an error. +var DefaultParameterConverter defaultConverter + +type defaultConverter struct{} + +var _ ValueConverter = defaultConverter{} + +func (defaultConverter) ConvertValue(v interface{}) (Value, error) { + if IsValue(v) { + return v, nil + } + + if svi, ok := v.(Valuer); ok { + sv, err := svi.Value() + if err != nil { + return nil, err + } + if !IsValue(sv) { + return nil, fmt.Errorf("non-Value type %T returned from Value", sv) + } + return sv, nil + } + + rv := reflect.ValueOf(v) + switch rv.Kind() { + case reflect.Ptr: + // indirect pointers + if rv.IsNil() { + return nil, nil + } else { + return defaultConverter{}.ConvertValue(rv.Elem().Interface()) + } + case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: + return rv.Int(), nil + case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32: + return int64(rv.Uint()), nil + case reflect.Uint64: + u64 := rv.Uint() + if u64 >= 1<<63 { + return nil, fmt.Errorf("uint64 values with high bit set are not supported") + } + return int64(u64), nil + case reflect.Float32, reflect.Float64: + return rv.Float(), nil + } + return nil, fmt.Errorf("unsupported type %T, a %s", v, rv.Kind()) +} diff --git a/src/database/sql/driver/types_test.go b/src/database/sql/driver/types_test.go new file mode 100644 index 0000000000000000000000000000000000000000..1ce0ff06541844a5d4155f6d9d779eb252674fe7 --- /dev/null +++ b/src/database/sql/driver/types_test.go @@ -0,0 +1,65 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package driver + +import ( + "reflect" + "testing" + "time" +) + +type valueConverterTest struct { + c ValueConverter + in interface{} + out interface{} + err string +} + +var now = time.Now() +var answer int64 = 42 + +var valueConverterTests = []valueConverterTest{ + {Bool, "true", true, ""}, + {Bool, "True", true, ""}, + {Bool, []byte("t"), true, ""}, + {Bool, true, true, ""}, + {Bool, "1", true, ""}, + {Bool, 1, true, ""}, + {Bool, int64(1), true, ""}, + {Bool, uint16(1), true, ""}, + {Bool, "false", false, ""}, + {Bool, false, false, ""}, + {Bool, "0", false, ""}, + {Bool, 0, false, ""}, + {Bool, int64(0), false, ""}, + {Bool, uint16(0), false, ""}, + {c: Bool, in: "foo", err: "sql/driver: couldn't convert \"foo\" into type bool"}, + {c: Bool, in: 2, err: "sql/driver: couldn't convert 2 into type bool"}, + {DefaultParameterConverter, now, now, ""}, + {DefaultParameterConverter, (*int64)(nil), nil, ""}, + {DefaultParameterConverter, &answer, answer, ""}, + {DefaultParameterConverter, &now, now, ""}, +} + +func TestValueConverters(t *testing.T) { + for i, tt := range valueConverterTests { + out, err := tt.c.ConvertValue(tt.in) + goterr := "" + if err != nil { + goterr = err.Error() + } + if goterr != tt.err { + t.Errorf("test %d: %T(%T(%v)) error = %q; want error = %q", + i, tt.c, tt.in, tt.in, goterr, tt.err) + } + if tt.err != "" { + continue + } + if !reflect.DeepEqual(out, tt.out) { + t.Errorf("test %d: %T(%T(%v)) = %v (%T); want %v (%T)", + i, tt.c, tt.in, tt.in, out, out, tt.out, tt.out) + } + } +} diff --git a/src/database/sql/example_test.go b/src/database/sql/example_test.go new file mode 100644 index 0000000000000000000000000000000000000000..dcb74e06998d9f8184c39ca1a6aa6f78b6432a31 --- /dev/null +++ b/src/database/sql/example_test.go @@ -0,0 +1,46 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package sql_test + +import ( + "database/sql" + "fmt" + "log" +) + +var db *sql.DB + +func ExampleDB_Query() { + age := 27 + rows, err := db.Query("SELECT name FROM users WHERE age=?", age) + if err != nil { + log.Fatal(err) + } + defer rows.Close() + for rows.Next() { + var name string + if err := rows.Scan(&name); err != nil { + log.Fatal(err) + } + fmt.Printf("%s is %d\n", name, age) + } + if err := rows.Err(); err != nil { + log.Fatal(err) + } +} + +func ExampleDB_QueryRow() { + id := 123 + var username string + err := db.QueryRow("SELECT username FROM users WHERE id=?", id).Scan(&username) + switch { + case err == sql.ErrNoRows: + log.Printf("No user with that ID.") + case err != nil: + log.Fatal(err) + default: + fmt.Printf("Username is %s\n", username) + } +} diff --git a/src/database/sql/fakedb_test.go b/src/database/sql/fakedb_test.go new file mode 100644 index 0000000000000000000000000000000000000000..8cbbb29a7c24e025019ec7e055f4ada0b0d12ac9 --- /dev/null +++ b/src/database/sql/fakedb_test.go @@ -0,0 +1,834 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package sql + +import ( + "database/sql/driver" + "errors" + "fmt" + "io" + "log" + "sort" + "strconv" + "strings" + "sync" + "testing" + "time" +) + +var _ = log.Printf + +// fakeDriver is a fake database that implements Go's driver.Driver +// interface, just for testing. +// +// It speaks a query language that's semantically similar to but +// syntactically different and simpler than SQL. The syntax is as +// follows: +// +// WIPE +// CREATE||=,=,... +// where types are: "string", [u]int{8,16,32,64}, "bool" +// INSERT||col=val,col2=val2,col3=? +// SELECT||projectcol1,projectcol2|filtercol=?,filtercol2=? +// +// When opening a fakeDriver's database, it starts empty with no +// tables. All tables and data are stored in memory only. +type fakeDriver struct { + mu sync.Mutex // guards 3 following fields + openCount int // conn opens + closeCount int // conn closes + waitCh chan struct{} + waitingCh chan struct{} + dbs map[string]*fakeDB +} + +type fakeDB struct { + name string + + mu sync.Mutex + free []*fakeConn + tables map[string]*table + badConn bool +} + +type table struct { + mu sync.Mutex + colname []string + coltype []string + rows []*row +} + +func (t *table) columnIndex(name string) int { + for n, nname := range t.colname { + if name == nname { + return n + } + } + return -1 +} + +type row struct { + cols []interface{} // must be same size as its table colname + coltype +} + +func (r *row) clone() *row { + nrow := &row{cols: make([]interface{}, len(r.cols))} + copy(nrow.cols, r.cols) + return nrow +} + +type fakeConn struct { + db *fakeDB // where to return ourselves to + + currTx *fakeTx + + // Stats for tests: + mu sync.Mutex + stmtsMade int + stmtsClosed int + numPrepare int + + // bad connection tests; see isBad() + bad bool + stickyBad bool +} + +func (c *fakeConn) incrStat(v *int) { + c.mu.Lock() + *v++ + c.mu.Unlock() +} + +type fakeTx struct { + c *fakeConn +} + +type fakeStmt struct { + c *fakeConn + q string // just for debugging + + cmd string + table string + + closed bool + + colName []string // used by CREATE, INSERT, SELECT (selected columns) + colType []string // used by CREATE + colValue []interface{} // used by INSERT (mix of strings and "?" for bound params) + placeholders int // used by INSERT/SELECT: number of ? params + + whereCol []string // used by SELECT (all placeholders) + + placeholderConverter []driver.ValueConverter // used by INSERT +} + +var fdriver driver.Driver = &fakeDriver{} + +func init() { + Register("test", fdriver) +} + +func contains(list []string, y string) bool { + for _, x := range list { + if x == y { + return true + } + } + return false +} + +type Dummy struct { + driver.Driver +} + +func TestDrivers(t *testing.T) { + unregisterAllDrivers() + Register("test", fdriver) + Register("invalid", Dummy{}) + all := Drivers() + if len(all) < 2 || !sort.StringsAreSorted(all) || !contains(all, "test") || !contains(all, "invalid") { + t.Fatalf("Drivers = %v, want sorted list with at least [invalid, test]", all) + } +} + +// Supports dsn forms: +// +// ; (only currently supported option is `badConn`, +// which causes driver.ErrBadConn to be returned on +// every other conn.Begin()) +func (d *fakeDriver) Open(dsn string) (driver.Conn, error) { + parts := strings.Split(dsn, ";") + if len(parts) < 1 { + return nil, errors.New("fakedb: no database name") + } + name := parts[0] + + db := d.getDB(name) + + d.mu.Lock() + d.openCount++ + d.mu.Unlock() + conn := &fakeConn{db: db} + + if len(parts) >= 2 && parts[1] == "badConn" { + conn.bad = true + } + if d.waitCh != nil { + d.waitingCh <- struct{}{} + <-d.waitCh + d.waitCh = nil + d.waitingCh = nil + } + return conn, nil +} + +func (d *fakeDriver) getDB(name string) *fakeDB { + d.mu.Lock() + defer d.mu.Unlock() + if d.dbs == nil { + d.dbs = make(map[string]*fakeDB) + } + db, ok := d.dbs[name] + if !ok { + db = &fakeDB{name: name} + d.dbs[name] = db + } + return db +} + +func (db *fakeDB) wipe() { + db.mu.Lock() + defer db.mu.Unlock() + db.tables = nil +} + +func (db *fakeDB) createTable(name string, columnNames, columnTypes []string) error { + db.mu.Lock() + defer db.mu.Unlock() + if db.tables == nil { + db.tables = make(map[string]*table) + } + if _, exist := db.tables[name]; exist { + return fmt.Errorf("table %q already exists", name) + } + if len(columnNames) != len(columnTypes) { + return fmt.Errorf("create table of %q len(names) != len(types): %d vs %d", + name, len(columnNames), len(columnTypes)) + } + db.tables[name] = &table{colname: columnNames, coltype: columnTypes} + return nil +} + +// must be called with db.mu lock held +func (db *fakeDB) table(table string) (*table, bool) { + if db.tables == nil { + return nil, false + } + t, ok := db.tables[table] + return t, ok +} + +func (db *fakeDB) columnType(table, column string) (typ string, ok bool) { + db.mu.Lock() + defer db.mu.Unlock() + t, ok := db.table(table) + if !ok { + return + } + for n, cname := range t.colname { + if cname == column { + return t.coltype[n], true + } + } + return "", false +} + +func (c *fakeConn) isBad() bool { + if c.stickyBad { + return true + } else if c.bad { + // alternate between bad conn and not bad conn + c.db.badConn = !c.db.badConn + return c.db.badConn + } else { + return false + } +} + +func (c *fakeConn) Begin() (driver.Tx, error) { + if c.isBad() { + return nil, driver.ErrBadConn + } + if c.currTx != nil { + return nil, errors.New("already in a transaction") + } + c.currTx = &fakeTx{c: c} + return c.currTx, nil +} + +var hookPostCloseConn struct { + sync.Mutex + fn func(*fakeConn, error) +} + +func setHookpostCloseConn(fn func(*fakeConn, error)) { + hookPostCloseConn.Lock() + defer hookPostCloseConn.Unlock() + hookPostCloseConn.fn = fn +} + +var testStrictClose *testing.T + +// setStrictFakeConnClose sets the t to Errorf on when fakeConn.Close +// fails to close. If nil, the check is disabled. +func setStrictFakeConnClose(t *testing.T) { + testStrictClose = t +} + +func (c *fakeConn) Close() (err error) { + drv := fdriver.(*fakeDriver) + defer func() { + if err != nil && testStrictClose != nil { + testStrictClose.Errorf("failed to close a test fakeConn: %v", err) + } + hookPostCloseConn.Lock() + fn := hookPostCloseConn.fn + hookPostCloseConn.Unlock() + if fn != nil { + fn(c, err) + } + if err == nil { + drv.mu.Lock() + drv.closeCount++ + drv.mu.Unlock() + } + }() + if c.currTx != nil { + return errors.New("can't close fakeConn; in a Transaction") + } + if c.db == nil { + return errors.New("can't close fakeConn; already closed") + } + if c.stmtsMade > c.stmtsClosed { + return errors.New("can't close; dangling statement(s)") + } + c.db = nil + return nil +} + +func checkSubsetTypes(args []driver.Value) error { + for n, arg := range args { + switch arg.(type) { + case int64, float64, bool, nil, []byte, string, time.Time: + default: + return fmt.Errorf("fakedb_test: invalid argument #%d: %v, type %T", n+1, arg, arg) + } + } + return nil +} + +func (c *fakeConn) Exec(query string, args []driver.Value) (driver.Result, error) { + // This is an optional interface, but it's implemented here + // just to check that all the args are of the proper types. + // ErrSkip is returned so the caller acts as if we didn't + // implement this at all. + err := checkSubsetTypes(args) + if err != nil { + return nil, err + } + return nil, driver.ErrSkip +} + +func (c *fakeConn) Query(query string, args []driver.Value) (driver.Rows, error) { + // This is an optional interface, but it's implemented here + // just to check that all the args are of the proper types. + // ErrSkip is returned so the caller acts as if we didn't + // implement this at all. + err := checkSubsetTypes(args) + if err != nil { + return nil, err + } + return nil, driver.ErrSkip +} + +func errf(msg string, args ...interface{}) error { + return errors.New("fakedb: " + fmt.Sprintf(msg, args...)) +} + +// parts are table|selectCol1,selectCol2|whereCol=?,whereCol2=? +// (note that where columns must always contain ? marks, +// just a limitation for fakedb) +func (c *fakeConn) prepareSelect(stmt *fakeStmt, parts []string) (driver.Stmt, error) { + if len(parts) != 3 { + stmt.Close() + return nil, errf("invalid SELECT syntax with %d parts; want 3", len(parts)) + } + stmt.table = parts[0] + stmt.colName = strings.Split(parts[1], ",") + for n, colspec := range strings.Split(parts[2], ",") { + if colspec == "" { + continue + } + nameVal := strings.Split(colspec, "=") + if len(nameVal) != 2 { + stmt.Close() + return nil, errf("SELECT on table %q has invalid column spec of %q (index %d)", stmt.table, colspec, n) + } + column, value := nameVal[0], nameVal[1] + _, ok := c.db.columnType(stmt.table, column) + if !ok { + stmt.Close() + return nil, errf("SELECT on table %q references non-existent column %q", stmt.table, column) + } + if value != "?" { + stmt.Close() + return nil, errf("SELECT on table %q has pre-bound value for where column %q; need a question mark", + stmt.table, column) + } + stmt.whereCol = append(stmt.whereCol, column) + stmt.placeholders++ + } + return stmt, nil +} + +// parts are table|col=type,col2=type2 +func (c *fakeConn) prepareCreate(stmt *fakeStmt, parts []string) (driver.Stmt, error) { + if len(parts) != 2 { + stmt.Close() + return nil, errf("invalid CREATE syntax with %d parts; want 2", len(parts)) + } + stmt.table = parts[0] + for n, colspec := range strings.Split(parts[1], ",") { + nameType := strings.Split(colspec, "=") + if len(nameType) != 2 { + stmt.Close() + return nil, errf("CREATE table %q has invalid column spec of %q (index %d)", stmt.table, colspec, n) + } + stmt.colName = append(stmt.colName, nameType[0]) + stmt.colType = append(stmt.colType, nameType[1]) + } + return stmt, nil +} + +// parts are table|col=?,col2=val +func (c *fakeConn) prepareInsert(stmt *fakeStmt, parts []string) (driver.Stmt, error) { + if len(parts) != 2 { + stmt.Close() + return nil, errf("invalid INSERT syntax with %d parts; want 2", len(parts)) + } + stmt.table = parts[0] + for n, colspec := range strings.Split(parts[1], ",") { + nameVal := strings.Split(colspec, "=") + if len(nameVal) != 2 { + stmt.Close() + return nil, errf("INSERT table %q has invalid column spec of %q (index %d)", stmt.table, colspec, n) + } + column, value := nameVal[0], nameVal[1] + ctype, ok := c.db.columnType(stmt.table, column) + if !ok { + stmt.Close() + return nil, errf("INSERT table %q references non-existent column %q", stmt.table, column) + } + stmt.colName = append(stmt.colName, column) + + if value != "?" { + var subsetVal interface{} + // Convert to driver subset type + switch ctype { + case "string": + subsetVal = []byte(value) + case "blob": + subsetVal = []byte(value) + case "int32": + i, err := strconv.Atoi(value) + if err != nil { + stmt.Close() + return nil, errf("invalid conversion to int32 from %q", value) + } + subsetVal = int64(i) // int64 is a subset type, but not int32 + default: + stmt.Close() + return nil, errf("unsupported conversion for pre-bound parameter %q to type %q", value, ctype) + } + stmt.colValue = append(stmt.colValue, subsetVal) + } else { + stmt.placeholders++ + stmt.placeholderConverter = append(stmt.placeholderConverter, converterForType(ctype)) + stmt.colValue = append(stmt.colValue, "?") + } + } + return stmt, nil +} + +// hook to simulate broken connections +var hookPrepareBadConn func() bool + +func (c *fakeConn) Prepare(query string) (driver.Stmt, error) { + c.numPrepare++ + if c.db == nil { + panic("nil c.db; conn = " + fmt.Sprintf("%#v", c)) + } + + if c.stickyBad || (hookPrepareBadConn != nil && hookPrepareBadConn()) { + return nil, driver.ErrBadConn + } + + parts := strings.Split(query, "|") + if len(parts) < 1 { + return nil, errf("empty query") + } + cmd := parts[0] + parts = parts[1:] + stmt := &fakeStmt{q: query, c: c, cmd: cmd} + c.incrStat(&c.stmtsMade) + switch cmd { + case "WIPE": + // Nothing + case "SELECT": + return c.prepareSelect(stmt, parts) + case "CREATE": + return c.prepareCreate(stmt, parts) + case "INSERT": + return c.prepareInsert(stmt, parts) + case "NOSERT": + // Do all the prep-work like for an INSERT but don't actually insert the row. + // Used for some of the concurrent tests. + return c.prepareInsert(stmt, parts) + default: + stmt.Close() + return nil, errf("unsupported command type %q", cmd) + } + return stmt, nil +} + +func (s *fakeStmt) ColumnConverter(idx int) driver.ValueConverter { + if len(s.placeholderConverter) == 0 { + return driver.DefaultParameterConverter + } + return s.placeholderConverter[idx] +} + +func (s *fakeStmt) Close() error { + if s.c == nil { + panic("nil conn in fakeStmt.Close") + } + if s.c.db == nil { + panic("in fakeStmt.Close, conn's db is nil (already closed)") + } + if !s.closed { + s.c.incrStat(&s.c.stmtsClosed) + s.closed = true + } + return nil +} + +var errClosed = errors.New("fakedb: statement has been closed") + +// hook to simulate broken connections +var hookExecBadConn func() bool + +func (s *fakeStmt) Exec(args []driver.Value) (driver.Result, error) { + if s.closed { + return nil, errClosed + } + + if s.c.stickyBad || (hookExecBadConn != nil && hookExecBadConn()) { + return nil, driver.ErrBadConn + } + + err := checkSubsetTypes(args) + if err != nil { + return nil, err + } + + db := s.c.db + switch s.cmd { + case "WIPE": + db.wipe() + return driver.ResultNoRows, nil + case "CREATE": + if err := db.createTable(s.table, s.colName, s.colType); err != nil { + return nil, err + } + return driver.ResultNoRows, nil + case "INSERT": + return s.execInsert(args, true) + case "NOSERT": + // Do all the prep-work like for an INSERT but don't actually insert the row. + // Used for some of the concurrent tests. + return s.execInsert(args, false) + } + fmt.Printf("EXEC statement, cmd=%q: %#v\n", s.cmd, s) + return nil, fmt.Errorf("unimplemented statement Exec command type of %q", s.cmd) +} + +// When doInsert is true, add the row to the table. +// When doInsert is false do prep-work and error checking, but don't +// actually add the row to the table. +func (s *fakeStmt) execInsert(args []driver.Value, doInsert bool) (driver.Result, error) { + db := s.c.db + if len(args) != s.placeholders { + panic("error in pkg db; should only get here if size is correct") + } + db.mu.Lock() + t, ok := db.table(s.table) + db.mu.Unlock() + if !ok { + return nil, fmt.Errorf("fakedb: table %q doesn't exist", s.table) + } + + t.mu.Lock() + defer t.mu.Unlock() + + var cols []interface{} + if doInsert { + cols = make([]interface{}, len(t.colname)) + } + argPos := 0 + for n, colname := range s.colName { + colidx := t.columnIndex(colname) + if colidx == -1 { + return nil, fmt.Errorf("fakedb: column %q doesn't exist or dropped since prepared statement was created", colname) + } + var val interface{} + if strvalue, ok := s.colValue[n].(string); ok && strvalue == "?" { + val = args[argPos] + argPos++ + } else { + val = s.colValue[n] + } + if doInsert { + cols[colidx] = val + } + } + + if doInsert { + t.rows = append(t.rows, &row{cols: cols}) + } + return driver.RowsAffected(1), nil +} + +// hook to simulate broken connections +var hookQueryBadConn func() bool + +func (s *fakeStmt) Query(args []driver.Value) (driver.Rows, error) { + if s.closed { + return nil, errClosed + } + + if s.c.stickyBad || (hookQueryBadConn != nil && hookQueryBadConn()) { + return nil, driver.ErrBadConn + } + + err := checkSubsetTypes(args) + if err != nil { + return nil, err + } + + db := s.c.db + if len(args) != s.placeholders { + panic("error in pkg db; should only get here if size is correct") + } + + db.mu.Lock() + t, ok := db.table(s.table) + db.mu.Unlock() + if !ok { + return nil, fmt.Errorf("fakedb: table %q doesn't exist", s.table) + } + + if s.table == "magicquery" { + if len(s.whereCol) == 2 && s.whereCol[0] == "op" && s.whereCol[1] == "millis" { + if args[0] == "sleep" { + time.Sleep(time.Duration(args[1].(int64)) * time.Millisecond) + } + } + } + + t.mu.Lock() + defer t.mu.Unlock() + + colIdx := make(map[string]int) // select column name -> column index in table + for _, name := range s.colName { + idx := t.columnIndex(name) + if idx == -1 { + return nil, fmt.Errorf("fakedb: unknown column name %q", name) + } + colIdx[name] = idx + } + + mrows := []*row{} +rows: + for _, trow := range t.rows { + // Process the where clause, skipping non-match rows. This is lazy + // and just uses fmt.Sprintf("%v") to test equality. Good enough + // for test code. + for widx, wcol := range s.whereCol { + idx := t.columnIndex(wcol) + if idx == -1 { + return nil, fmt.Errorf("db: invalid where clause column %q", wcol) + } + tcol := trow.cols[idx] + if bs, ok := tcol.([]byte); ok { + // lazy hack to avoid sprintf %v on a []byte + tcol = string(bs) + } + if fmt.Sprintf("%v", tcol) != fmt.Sprintf("%v", args[widx]) { + continue rows + } + } + mrow := &row{cols: make([]interface{}, len(s.colName))} + for seli, name := range s.colName { + mrow.cols[seli] = trow.cols[colIdx[name]] + } + mrows = append(mrows, mrow) + } + + cursor := &rowsCursor{ + pos: -1, + rows: mrows, + cols: s.colName, + errPos: -1, + } + return cursor, nil +} + +func (s *fakeStmt) NumInput() int { + return s.placeholders +} + +func (tx *fakeTx) Commit() error { + tx.c.currTx = nil + return nil +} + +func (tx *fakeTx) Rollback() error { + tx.c.currTx = nil + return nil +} + +type rowsCursor struct { + cols []string + pos int + rows []*row + closed bool + + // errPos and err are for making Next return early with error. + errPos int + err error + + // a clone of slices to give out to clients, indexed by the + // the original slice's first byte address. we clone them + // just so we're able to corrupt them on close. + bytesClone map[*byte][]byte +} + +func (rc *rowsCursor) Close() error { + if !rc.closed { + for _, bs := range rc.bytesClone { + bs[0] = 255 // first byte corrupted + } + } + rc.closed = true + return nil +} + +func (rc *rowsCursor) Columns() []string { + return rc.cols +} + +var rowsCursorNextHook func(dest []driver.Value) error + +func (rc *rowsCursor) Next(dest []driver.Value) error { + if rowsCursorNextHook != nil { + return rowsCursorNextHook(dest) + } + + if rc.closed { + return errors.New("fakedb: cursor is closed") + } + rc.pos++ + if rc.pos == rc.errPos { + return rc.err + } + if rc.pos >= len(rc.rows) { + return io.EOF // per interface spec + } + for i, v := range rc.rows[rc.pos].cols { + // TODO(bradfitz): convert to subset types? naah, I + // think the subset types should only be input to + // driver, but the sql package should be able to handle + // a wider range of types coming out of drivers. all + // for ease of drivers, and to prevent drivers from + // messing up conversions or doing them differently. + dest[i] = v + + if bs, ok := v.([]byte); ok { + if rc.bytesClone == nil { + rc.bytesClone = make(map[*byte][]byte) + } + clone, ok := rc.bytesClone[&bs[0]] + if !ok { + clone = make([]byte, len(bs)) + copy(clone, bs) + rc.bytesClone[&bs[0]] = clone + } + dest[i] = clone + } + } + return nil +} + +// fakeDriverString is like driver.String, but indirects pointers like +// DefaultValueConverter. +// +// This could be surprising behavior to retroactively apply to +// driver.String now that Go1 is out, but this is convenient for +// our TestPointerParamsAndScans. +// +type fakeDriverString struct{} + +func (fakeDriverString) ConvertValue(v interface{}) (driver.Value, error) { + switch c := v.(type) { + case string, []byte: + return v, nil + case *string: + if c == nil { + return nil, nil + } + return *c, nil + } + return fmt.Sprintf("%v", v), nil +} + +func converterForType(typ string) driver.ValueConverter { + switch typ { + case "bool": + return driver.Bool + case "nullbool": + return driver.Null{Converter: driver.Bool} + case "int32": + return driver.Int32 + case "string": + return driver.NotNull{Converter: fakeDriverString{}} + case "nullstring": + return driver.Null{Converter: fakeDriverString{}} + case "int64": + // TODO(coopernurse): add type-specific converter + return driver.NotNull{Converter: driver.DefaultParameterConverter} + case "nullint64": + // TODO(coopernurse): add type-specific converter + return driver.Null{Converter: driver.DefaultParameterConverter} + case "float64": + // TODO(coopernurse): add type-specific converter + return driver.NotNull{Converter: driver.DefaultParameterConverter} + case "nullfloat64": + // TODO(coopernurse): add type-specific converter + return driver.Null{Converter: driver.DefaultParameterConverter} + case "datetime": + return driver.DefaultParameterConverter + } + panic("invalid fakedb column type of " + typ) +} diff --git a/src/database/sql/sql.go b/src/database/sql/sql.go new file mode 100644 index 0000000000000000000000000000000000000000..aaa4ea28be4527d956e58c08a9d103c2ac7ac42a --- /dev/null +++ b/src/database/sql/sql.go @@ -0,0 +1,1817 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package sql provides a generic interface around SQL (or SQL-like) +// databases. +// +// The sql package must be used in conjunction with a database driver. +// See https://golang.org/s/sqldrivers for a list of drivers. +// +// For more usage examples, see the wiki page at +// https://golang.org/s/sqlwiki. +package sql + +import ( + "database/sql/driver" + "errors" + "fmt" + "io" + "runtime" + "sort" + "sync" + "sync/atomic" +) + +var ( + driversMu sync.Mutex + drivers = make(map[string]driver.Driver) +) + +// Register makes a database driver available by the provided name. +// If Register is called twice with the same name or if driver is nil, +// it panics. +func Register(name string, driver driver.Driver) { + driversMu.Lock() + defer driversMu.Unlock() + if driver == nil { + panic("sql: Register driver is nil") + } + if _, dup := drivers[name]; dup { + panic("sql: Register called twice for driver " + name) + } + drivers[name] = driver +} + +func unregisterAllDrivers() { + driversMu.Lock() + defer driversMu.Unlock() + // For tests. + drivers = make(map[string]driver.Driver) +} + +// Drivers returns a sorted list of the names of the registered drivers. +func Drivers() []string { + driversMu.Lock() + defer driversMu.Unlock() + var list []string + for name := range drivers { + list = append(list, name) + } + sort.Strings(list) + return list +} + +// RawBytes is a byte slice that holds a reference to memory owned by +// the database itself. After a Scan into a RawBytes, the slice is only +// valid until the next call to Next, Scan, or Close. +type RawBytes []byte + +// NullString represents a string that may be null. +// NullString implements the Scanner interface so +// it can be used as a scan destination: +// +// var s NullString +// err := db.QueryRow("SELECT name FROM foo WHERE id=?", id).Scan(&s) +// ... +// if s.Valid { +// // use s.String +// } else { +// // NULL value +// } +// +type NullString struct { + String string + Valid bool // Valid is true if String is not NULL +} + +// Scan implements the Scanner interface. +func (ns *NullString) Scan(value interface{}) error { + if value == nil { + ns.String, ns.Valid = "", false + return nil + } + ns.Valid = true + return convertAssign(&ns.String, value) +} + +// Value implements the driver Valuer interface. +func (ns NullString) Value() (driver.Value, error) { + if !ns.Valid { + return nil, nil + } + return ns.String, nil +} + +// NullInt64 represents an int64 that may be null. +// NullInt64 implements the Scanner interface so +// it can be used as a scan destination, similar to NullString. +type NullInt64 struct { + Int64 int64 + Valid bool // Valid is true if Int64 is not NULL +} + +// Scan implements the Scanner interface. +func (n *NullInt64) Scan(value interface{}) error { + if value == nil { + n.Int64, n.Valid = 0, false + return nil + } + n.Valid = true + return convertAssign(&n.Int64, value) +} + +// Value implements the driver Valuer interface. +func (n NullInt64) Value() (driver.Value, error) { + if !n.Valid { + return nil, nil + } + return n.Int64, nil +} + +// NullFloat64 represents a float64 that may be null. +// NullFloat64 implements the Scanner interface so +// it can be used as a scan destination, similar to NullString. +type NullFloat64 struct { + Float64 float64 + Valid bool // Valid is true if Float64 is not NULL +} + +// Scan implements the Scanner interface. +func (n *NullFloat64) Scan(value interface{}) error { + if value == nil { + n.Float64, n.Valid = 0, false + return nil + } + n.Valid = true + return convertAssign(&n.Float64, value) +} + +// Value implements the driver Valuer interface. +func (n NullFloat64) Value() (driver.Value, error) { + if !n.Valid { + return nil, nil + } + return n.Float64, nil +} + +// NullBool represents a bool that may be null. +// NullBool implements the Scanner interface so +// it can be used as a scan destination, similar to NullString. +type NullBool struct { + Bool bool + Valid bool // Valid is true if Bool is not NULL +} + +// Scan implements the Scanner interface. +func (n *NullBool) Scan(value interface{}) error { + if value == nil { + n.Bool, n.Valid = false, false + return nil + } + n.Valid = true + return convertAssign(&n.Bool, value) +} + +// Value implements the driver Valuer interface. +func (n NullBool) Value() (driver.Value, error) { + if !n.Valid { + return nil, nil + } + return n.Bool, nil +} + +// Scanner is an interface used by Scan. +type Scanner interface { + // Scan assigns a value from a database driver. + // + // The src value will be of one of the following restricted + // set of types: + // + // int64 + // float64 + // bool + // []byte + // string + // time.Time + // nil - for NULL values + // + // An error should be returned if the value can not be stored + // without loss of information. + Scan(src interface{}) error +} + +// ErrNoRows is returned by Scan when QueryRow doesn't return a +// row. In such a case, QueryRow returns a placeholder *Row value that +// defers this error until a Scan. +var ErrNoRows = errors.New("sql: no rows in result set") + +// DB is a database handle representing a pool of zero or more +// underlying connections. It's safe for concurrent use by multiple +// goroutines. +// +// The sql package creates and frees connections automatically; it +// also maintains a free pool of idle connections. If the database has +// a concept of per-connection state, such state can only be reliably +// observed within a transaction. Once DB.Begin is called, the +// returned Tx is bound to a single connection. Once Commit or +// Rollback is called on the transaction, that transaction's +// connection is returned to DB's idle connection pool. The pool size +// can be controlled with SetMaxIdleConns. +type DB struct { + driver driver.Driver + dsn string + // numClosed is an atomic counter which represents a total number of + // closed connections. Stmt.openStmt checks it before cleaning closed + // connections in Stmt.css. + numClosed uint64 + + mu sync.Mutex // protects following fields + freeConn []*driverConn + connRequests []chan connRequest + numOpen int + pendingOpens int + // Used to signal the need for new connections + // a goroutine running connectionOpener() reads on this chan and + // maybeOpenNewConnections sends on the chan (one send per needed connection) + // It is closed during db.Close(). The close tells the connectionOpener + // goroutine to exit. + openerCh chan struct{} + closed bool + dep map[finalCloser]depSet + lastPut map[*driverConn]string // stacktrace of last conn's put; debug only + maxIdle int // zero means defaultMaxIdleConns; negative means 0 + maxOpen int // <= 0 means unlimited +} + +// connReuseStrategy determines how (*DB).conn returns database connections. +type connReuseStrategy uint8 + +const ( + // alwaysNewConn forces a new connection to the database. + alwaysNewConn connReuseStrategy = iota + // cachedOrNewConn returns a cached connection, if available, else waits + // for one to become available (if MaxOpenConns has been reached) or + // creates a new database connection. + cachedOrNewConn +) + +// driverConn wraps a driver.Conn with a mutex, to +// be held during all calls into the Conn. (including any calls onto +// interfaces returned via that Conn, such as calls on Tx, Stmt, +// Result, Rows) +type driverConn struct { + db *DB + + sync.Mutex // guards following + ci driver.Conn + closed bool + finalClosed bool // ci.Close has been called + openStmt map[driver.Stmt]bool + + // guarded by db.mu + inUse bool + onPut []func() // code (with db.mu held) run when conn is next returned + dbmuClosed bool // same as closed, but guarded by db.mu, for removeClosedStmtLocked +} + +func (dc *driverConn) releaseConn(err error) { + dc.db.putConn(dc, err) +} + +func (dc *driverConn) removeOpenStmt(si driver.Stmt) { + dc.Lock() + defer dc.Unlock() + delete(dc.openStmt, si) +} + +func (dc *driverConn) prepareLocked(query string) (driver.Stmt, error) { + si, err := dc.ci.Prepare(query) + if err == nil { + // Track each driverConn's open statements, so we can close them + // before closing the conn. + // + // TODO(bradfitz): let drivers opt out of caring about + // stmt closes if the conn is about to close anyway? For now + // do the safe thing, in case stmts need to be closed. + // + // TODO(bradfitz): after Go 1.2, closing driver.Stmts + // should be moved to driverStmt, using unique + // *driverStmts everywhere (including from + // *Stmt.connStmt, instead of returning a + // driver.Stmt), using driverStmt as a pointer + // everywhere, and making it a finalCloser. + if dc.openStmt == nil { + dc.openStmt = make(map[driver.Stmt]bool) + } + dc.openStmt[si] = true + } + return si, err +} + +// the dc.db's Mutex is held. +func (dc *driverConn) closeDBLocked() func() error { + dc.Lock() + defer dc.Unlock() + if dc.closed { + return func() error { return errors.New("sql: duplicate driverConn close") } + } + dc.closed = true + return dc.db.removeDepLocked(dc, dc) +} + +func (dc *driverConn) Close() error { + dc.Lock() + if dc.closed { + dc.Unlock() + return errors.New("sql: duplicate driverConn close") + } + dc.closed = true + dc.Unlock() // not defer; removeDep finalClose calls may need to lock + + // And now updates that require holding dc.mu.Lock. + dc.db.mu.Lock() + dc.dbmuClosed = true + fn := dc.db.removeDepLocked(dc, dc) + dc.db.mu.Unlock() + return fn() +} + +func (dc *driverConn) finalClose() error { + dc.Lock() + + for si := range dc.openStmt { + si.Close() + } + dc.openStmt = nil + + err := dc.ci.Close() + dc.ci = nil + dc.finalClosed = true + dc.Unlock() + + dc.db.mu.Lock() + dc.db.numOpen-- + dc.db.maybeOpenNewConnections() + dc.db.mu.Unlock() + + atomic.AddUint64(&dc.db.numClosed, 1) + return err +} + +// driverStmt associates a driver.Stmt with the +// *driverConn from which it came, so the driverConn's lock can be +// held during calls. +type driverStmt struct { + sync.Locker // the *driverConn + si driver.Stmt +} + +func (ds *driverStmt) Close() error { + ds.Lock() + defer ds.Unlock() + return ds.si.Close() +} + +// depSet is a finalCloser's outstanding dependencies +type depSet map[interface{}]bool // set of true bools + +// The finalCloser interface is used by (*DB).addDep and related +// dependency reference counting. +type finalCloser interface { + // finalClose is called when the reference count of an object + // goes to zero. (*DB).mu is not held while calling it. + finalClose() error +} + +// addDep notes that x now depends on dep, and x's finalClose won't be +// called until all of x's dependencies are removed with removeDep. +func (db *DB) addDep(x finalCloser, dep interface{}) { + //println(fmt.Sprintf("addDep(%T %p, %T %p)", x, x, dep, dep)) + db.mu.Lock() + defer db.mu.Unlock() + db.addDepLocked(x, dep) +} + +func (db *DB) addDepLocked(x finalCloser, dep interface{}) { + if db.dep == nil { + db.dep = make(map[finalCloser]depSet) + } + xdep := db.dep[x] + if xdep == nil { + xdep = make(depSet) + db.dep[x] = xdep + } + xdep[dep] = true +} + +// removeDep notes that x no longer depends on dep. +// If x still has dependencies, nil is returned. +// If x no longer has any dependencies, its finalClose method will be +// called and its error value will be returned. +func (db *DB) removeDep(x finalCloser, dep interface{}) error { + db.mu.Lock() + fn := db.removeDepLocked(x, dep) + db.mu.Unlock() + return fn() +} + +func (db *DB) removeDepLocked(x finalCloser, dep interface{}) func() error { + //println(fmt.Sprintf("removeDep(%T %p, %T %p)", x, x, dep, dep)) + + xdep, ok := db.dep[x] + if !ok { + panic(fmt.Sprintf("unpaired removeDep: no deps for %T", x)) + } + + l0 := len(xdep) + delete(xdep, dep) + + switch len(xdep) { + case l0: + // Nothing removed. Shouldn't happen. + panic(fmt.Sprintf("unpaired removeDep: no %T dep on %T", dep, x)) + case 0: + // No more dependencies. + delete(db.dep, x) + return x.finalClose + default: + // Dependencies remain. + return func() error { return nil } + } +} + +// This is the size of the connectionOpener request chan (dn.openerCh). +// This value should be larger than the maximum typical value +// used for db.maxOpen. If maxOpen is significantly larger than +// connectionRequestQueueSize then it is possible for ALL calls into the *DB +// to block until the connectionOpener can satisfy the backlog of requests. +var connectionRequestQueueSize = 1000000 + +// Open opens a database specified by its database driver name and a +// driver-specific data source name, usually consisting of at least a +// database name and connection information. +// +// Most users will open a database via a driver-specific connection +// helper function that returns a *DB. No database drivers are included +// in the Go standard library. See https://golang.org/s/sqldrivers for +// a list of third-party drivers. +// +// Open may just validate its arguments without creating a connection +// to the database. To verify that the data source name is valid, call +// Ping. +// +// The returned DB is safe for concurrent use by multiple goroutines +// and maintains its own pool of idle connections. Thus, the Open +// function should be called just once. It is rarely necessary to +// close a DB. +func Open(driverName, dataSourceName string) (*DB, error) { + driversMu.Lock() + driveri, ok := drivers[driverName] + driversMu.Unlock() + if !ok { + return nil, fmt.Errorf("sql: unknown driver %q (forgotten import?)", driverName) + } + db := &DB{ + driver: driveri, + dsn: dataSourceName, + openerCh: make(chan struct{}, connectionRequestQueueSize), + lastPut: make(map[*driverConn]string), + } + go db.connectionOpener() + return db, nil +} + +// Ping verifies a connection to the database is still alive, +// establishing a connection if necessary. +func (db *DB) Ping() error { + // TODO(bradfitz): give drivers an optional hook to implement + // this in a more efficient or more reliable way, if they + // have one. + dc, err := db.conn(cachedOrNewConn) + if err != nil { + return err + } + db.putConn(dc, nil) + return nil +} + +// Close closes the database, releasing any open resources. +// +// It is rare to Close a DB, as the DB handle is meant to be +// long-lived and shared between many goroutines. +func (db *DB) Close() error { + db.mu.Lock() + if db.closed { // Make DB.Close idempotent + db.mu.Unlock() + return nil + } + close(db.openerCh) + var err error + fns := make([]func() error, 0, len(db.freeConn)) + for _, dc := range db.freeConn { + fns = append(fns, dc.closeDBLocked()) + } + db.freeConn = nil + db.closed = true + for _, req := range db.connRequests { + close(req) + } + db.mu.Unlock() + for _, fn := range fns { + err1 := fn() + if err1 != nil { + err = err1 + } + } + return err +} + +const defaultMaxIdleConns = 2 + +func (db *DB) maxIdleConnsLocked() int { + n := db.maxIdle + switch { + case n == 0: + // TODO(bradfitz): ask driver, if supported, for its default preference + return defaultMaxIdleConns + case n < 0: + return 0 + default: + return n + } +} + +// SetMaxIdleConns sets the maximum number of connections in the idle +// connection pool. +// +// If MaxOpenConns is greater than 0 but less than the new MaxIdleConns +// then the new MaxIdleConns will be reduced to match the MaxOpenConns limit +// +// If n <= 0, no idle connections are retained. +func (db *DB) SetMaxIdleConns(n int) { + db.mu.Lock() + if n > 0 { + db.maxIdle = n + } else { + // No idle connections. + db.maxIdle = -1 + } + // Make sure maxIdle doesn't exceed maxOpen + if db.maxOpen > 0 && db.maxIdleConnsLocked() > db.maxOpen { + db.maxIdle = db.maxOpen + } + var closing []*driverConn + idleCount := len(db.freeConn) + maxIdle := db.maxIdleConnsLocked() + if idleCount > maxIdle { + closing = db.freeConn[maxIdle:] + db.freeConn = db.freeConn[:maxIdle] + } + db.mu.Unlock() + for _, c := range closing { + c.Close() + } +} + +// SetMaxOpenConns sets the maximum number of open connections to the database. +// +// If MaxIdleConns is greater than 0 and the new MaxOpenConns is less than +// MaxIdleConns, then MaxIdleConns will be reduced to match the new +// MaxOpenConns limit +// +// If n <= 0, then there is no limit on the number of open connections. +// The default is 0 (unlimited). +func (db *DB) SetMaxOpenConns(n int) { + db.mu.Lock() + db.maxOpen = n + if n < 0 { + db.maxOpen = 0 + } + syncMaxIdle := db.maxOpen > 0 && db.maxIdleConnsLocked() > db.maxOpen + db.mu.Unlock() + if syncMaxIdle { + db.SetMaxIdleConns(n) + } +} + +// DBStats contains database statistics. +type DBStats struct { + // OpenConnections is the number of open connections to the database. + OpenConnections int +} + +// Stats returns database statistics. +func (db *DB) Stats() DBStats { + db.mu.Lock() + stats := DBStats{ + OpenConnections: db.numOpen, + } + db.mu.Unlock() + return stats +} + +// Assumes db.mu is locked. +// If there are connRequests and the connection limit hasn't been reached, +// then tell the connectionOpener to open new connections. +func (db *DB) maybeOpenNewConnections() { + numRequests := len(db.connRequests) - db.pendingOpens + if db.maxOpen > 0 { + numCanOpen := db.maxOpen - (db.numOpen + db.pendingOpens) + if numRequests > numCanOpen { + numRequests = numCanOpen + } + } + for numRequests > 0 { + db.pendingOpens++ + numRequests-- + db.openerCh <- struct{}{} + } +} + +// Runs in a separate goroutine, opens new connections when requested. +func (db *DB) connectionOpener() { + for range db.openerCh { + db.openNewConnection() + } +} + +// Open one new connection +func (db *DB) openNewConnection() { + ci, err := db.driver.Open(db.dsn) + db.mu.Lock() + defer db.mu.Unlock() + if db.closed { + if err == nil { + ci.Close() + } + return + } + db.pendingOpens-- + if err != nil { + db.putConnDBLocked(nil, err) + return + } + dc := &driverConn{ + db: db, + ci: ci, + } + if db.putConnDBLocked(dc, err) { + db.addDepLocked(dc, dc) + db.numOpen++ + } else { + ci.Close() + } +} + +// connRequest represents one request for a new connection +// When there are no idle connections available, DB.conn will create +// a new connRequest and put it on the db.connRequests list. +type connRequest struct { + conn *driverConn + err error +} + +var errDBClosed = errors.New("sql: database is closed") + +// conn returns a newly-opened or cached *driverConn. +func (db *DB) conn(strategy connReuseStrategy) (*driverConn, error) { + db.mu.Lock() + if db.closed { + db.mu.Unlock() + return nil, errDBClosed + } + + // Prefer a free connection, if possible. + numFree := len(db.freeConn) + if strategy == cachedOrNewConn && numFree > 0 { + conn := db.freeConn[0] + copy(db.freeConn, db.freeConn[1:]) + db.freeConn = db.freeConn[:numFree-1] + conn.inUse = true + db.mu.Unlock() + return conn, nil + } + + // Out of free connections or we were asked not to use one. If we're not + // allowed to open any more connections, make a request and wait. + if db.maxOpen > 0 && db.numOpen >= db.maxOpen { + // Make the connRequest channel. It's buffered so that the + // connectionOpener doesn't block while waiting for the req to be read. + req := make(chan connRequest, 1) + db.connRequests = append(db.connRequests, req) + db.mu.Unlock() + ret := <-req + return ret.conn, ret.err + } + + db.numOpen++ // optimistically + db.mu.Unlock() + ci, err := db.driver.Open(db.dsn) + if err != nil { + db.mu.Lock() + db.numOpen-- // correct for earlier optimism + db.mu.Unlock() + return nil, err + } + db.mu.Lock() + dc := &driverConn{ + db: db, + ci: ci, + } + db.addDepLocked(dc, dc) + dc.inUse = true + db.mu.Unlock() + return dc, nil +} + +var ( + errConnClosed = errors.New("database/sql: internal sentinel error: conn is closed") + errConnBusy = errors.New("database/sql: internal sentinel error: conn is busy") +) + +// putConnHook is a hook for testing. +var putConnHook func(*DB, *driverConn) + +// noteUnusedDriverStatement notes that si is no longer used and should +// be closed whenever possible (when c is next not in use), unless c is +// already closed. +func (db *DB) noteUnusedDriverStatement(c *driverConn, si driver.Stmt) { + db.mu.Lock() + defer db.mu.Unlock() + if c.inUse { + c.onPut = append(c.onPut, func() { + si.Close() + }) + } else { + c.Lock() + defer c.Unlock() + if !c.finalClosed { + si.Close() + } + } +} + +// debugGetPut determines whether getConn & putConn calls' stack traces +// are returned for more verbose crashes. +const debugGetPut = false + +// putConn adds a connection to the db's free pool. +// err is optionally the last error that occurred on this connection. +func (db *DB) putConn(dc *driverConn, err error) { + db.mu.Lock() + if !dc.inUse { + if debugGetPut { + fmt.Printf("putConn(%v) DUPLICATE was: %s\n\nPREVIOUS was: %s", dc, stack(), db.lastPut[dc]) + } + panic("sql: connection returned that was never out") + } + if debugGetPut { + db.lastPut[dc] = stack() + } + dc.inUse = false + + for _, fn := range dc.onPut { + fn() + } + dc.onPut = nil + + if err == driver.ErrBadConn { + // Don't reuse bad connections. + // Since the conn is considered bad and is being discarded, treat it + // as closed. Don't decrement the open count here, finalClose will + // take care of that. + db.maybeOpenNewConnections() + db.mu.Unlock() + dc.Close() + return + } + if putConnHook != nil { + putConnHook(db, dc) + } + added := db.putConnDBLocked(dc, nil) + db.mu.Unlock() + + if !added { + dc.Close() + } +} + +// Satisfy a connRequest or put the driverConn in the idle pool and return true +// or return false. +// putConnDBLocked will satisfy a connRequest if there is one, or it will +// return the *driverConn to the freeConn list if err == nil and the idle +// connection limit will not be exceeded. +// If err != nil, the value of dc is ignored. +// If err == nil, then dc must not equal nil. +// If a connRequest was fulfilled or the *driverConn was placed in the +// freeConn list, then true is returned, otherwise false is returned. +func (db *DB) putConnDBLocked(dc *driverConn, err error) bool { + if db.maxOpen > 0 && db.numOpen > db.maxOpen { + return false + } + if c := len(db.connRequests); c > 0 { + req := db.connRequests[0] + // This copy is O(n) but in practice faster than a linked list. + // TODO: consider compacting it down less often and + // moving the base instead? + copy(db.connRequests, db.connRequests[1:]) + db.connRequests = db.connRequests[:c-1] + if err == nil { + dc.inUse = true + } + req <- connRequest{ + conn: dc, + err: err, + } + return true + } else if err == nil && !db.closed && db.maxIdleConnsLocked() > len(db.freeConn) { + db.freeConn = append(db.freeConn, dc) + return true + } + return false +} + +// maxBadConnRetries is the number of maximum retries if the driver returns +// driver.ErrBadConn to signal a broken connection before forcing a new +// connection to be opened. +const maxBadConnRetries = 2 + +// Prepare creates a prepared statement for later queries or executions. +// Multiple queries or executions may be run concurrently from the +// returned statement. +// The caller must call the statement's Close method +// when the statement is no longer needed. +func (db *DB) Prepare(query string) (*Stmt, error) { + var stmt *Stmt + var err error + for i := 0; i < maxBadConnRetries; i++ { + stmt, err = db.prepare(query, cachedOrNewConn) + if err != driver.ErrBadConn { + break + } + } + if err == driver.ErrBadConn { + return db.prepare(query, alwaysNewConn) + } + return stmt, err +} + +func (db *DB) prepare(query string, strategy connReuseStrategy) (*Stmt, error) { + // TODO: check if db.driver supports an optional + // driver.Preparer interface and call that instead, if so, + // otherwise we make a prepared statement that's bound + // to a connection, and to execute this prepared statement + // we either need to use this connection (if it's free), else + // get a new connection + re-prepare + execute on that one. + dc, err := db.conn(strategy) + if err != nil { + return nil, err + } + dc.Lock() + si, err := dc.prepareLocked(query) + dc.Unlock() + if err != nil { + db.putConn(dc, err) + return nil, err + } + stmt := &Stmt{ + db: db, + query: query, + css: []connStmt{{dc, si}}, + lastNumClosed: atomic.LoadUint64(&db.numClosed), + } + db.addDep(stmt, stmt) + db.putConn(dc, nil) + return stmt, nil +} + +// Exec executes a query without returning any rows. +// The args are for any placeholder parameters in the query. +func (db *DB) Exec(query string, args ...interface{}) (Result, error) { + var res Result + var err error + for i := 0; i < maxBadConnRetries; i++ { + res, err = db.exec(query, args, cachedOrNewConn) + if err != driver.ErrBadConn { + break + } + } + if err == driver.ErrBadConn { + return db.exec(query, args, alwaysNewConn) + } + return res, err +} + +func (db *DB) exec(query string, args []interface{}, strategy connReuseStrategy) (res Result, err error) { + dc, err := db.conn(strategy) + if err != nil { + return nil, err + } + defer func() { + db.putConn(dc, err) + }() + + if execer, ok := dc.ci.(driver.Execer); ok { + dargs, err := driverArgs(nil, args) + if err != nil { + return nil, err + } + dc.Lock() + resi, err := execer.Exec(query, dargs) + dc.Unlock() + if err != driver.ErrSkip { + if err != nil { + return nil, err + } + return driverResult{dc, resi}, nil + } + } + + dc.Lock() + si, err := dc.ci.Prepare(query) + dc.Unlock() + if err != nil { + return nil, err + } + defer withLock(dc, func() { si.Close() }) + return resultFromStatement(driverStmt{dc, si}, args...) +} + +// Query executes a query that returns rows, typically a SELECT. +// The args are for any placeholder parameters in the query. +func (db *DB) Query(query string, args ...interface{}) (*Rows, error) { + var rows *Rows + var err error + for i := 0; i < maxBadConnRetries; i++ { + rows, err = db.query(query, args, cachedOrNewConn) + if err != driver.ErrBadConn { + break + } + } + if err == driver.ErrBadConn { + return db.query(query, args, alwaysNewConn) + } + return rows, err +} + +func (db *DB) query(query string, args []interface{}, strategy connReuseStrategy) (*Rows, error) { + ci, err := db.conn(strategy) + if err != nil { + return nil, err + } + + return db.queryConn(ci, ci.releaseConn, query, args) +} + +// queryConn executes a query on the given connection. +// The connection gets released by the releaseConn function. +func (db *DB) queryConn(dc *driverConn, releaseConn func(error), query string, args []interface{}) (*Rows, error) { + if queryer, ok := dc.ci.(driver.Queryer); ok { + dargs, err := driverArgs(nil, args) + if err != nil { + releaseConn(err) + return nil, err + } + dc.Lock() + rowsi, err := queryer.Query(query, dargs) + dc.Unlock() + if err != driver.ErrSkip { + if err != nil { + releaseConn(err) + return nil, err + } + // Note: ownership of dc passes to the *Rows, to be freed + // with releaseConn. + rows := &Rows{ + dc: dc, + releaseConn: releaseConn, + rowsi: rowsi, + } + return rows, nil + } + } + + dc.Lock() + si, err := dc.ci.Prepare(query) + dc.Unlock() + if err != nil { + releaseConn(err) + return nil, err + } + + ds := driverStmt{dc, si} + rowsi, err := rowsiFromStatement(ds, args...) + if err != nil { + dc.Lock() + si.Close() + dc.Unlock() + releaseConn(err) + return nil, err + } + + // Note: ownership of ci passes to the *Rows, to be freed + // with releaseConn. + rows := &Rows{ + dc: dc, + releaseConn: releaseConn, + rowsi: rowsi, + closeStmt: si, + } + return rows, nil +} + +// QueryRow executes a query that is expected to return at most one row. +// QueryRow always return a non-nil value. Errors are deferred until +// Row's Scan method is called. +func (db *DB) QueryRow(query string, args ...interface{}) *Row { + rows, err := db.Query(query, args...) + return &Row{rows: rows, err: err} +} + +// Begin starts a transaction. The isolation level is dependent on +// the driver. +func (db *DB) Begin() (*Tx, error) { + var tx *Tx + var err error + for i := 0; i < maxBadConnRetries; i++ { + tx, err = db.begin(cachedOrNewConn) + if err != driver.ErrBadConn { + break + } + } + if err == driver.ErrBadConn { + return db.begin(alwaysNewConn) + } + return tx, err +} + +func (db *DB) begin(strategy connReuseStrategy) (tx *Tx, err error) { + dc, err := db.conn(strategy) + if err != nil { + return nil, err + } + dc.Lock() + txi, err := dc.ci.Begin() + dc.Unlock() + if err != nil { + db.putConn(dc, err) + return nil, err + } + return &Tx{ + db: db, + dc: dc, + txi: txi, + }, nil +} + +// Driver returns the database's underlying driver. +func (db *DB) Driver() driver.Driver { + return db.driver +} + +// Tx is an in-progress database transaction. +// +// A transaction must end with a call to Commit or Rollback. +// +// After a call to Commit or Rollback, all operations on the +// transaction fail with ErrTxDone. +// +// The statements prepared for a transaction by calling +// the transaction's Prepare or Stmt methods are closed +// by the call to Commit or Rollback. +type Tx struct { + db *DB + + // dc is owned exclusively until Commit or Rollback, at which point + // it's returned with putConn. + dc *driverConn + txi driver.Tx + + // done transitions from false to true exactly once, on Commit + // or Rollback. once done, all operations fail with + // ErrTxDone. + done bool + + // All Stmts prepared for this transaction. These will be closed after the + // transaction has been committed or rolled back. + stmts struct { + sync.Mutex + v []*Stmt + } +} + +var ErrTxDone = errors.New("sql: Transaction has already been committed or rolled back") + +func (tx *Tx) close() { + if tx.done { + panic("double close") // internal error + } + tx.done = true + tx.db.putConn(tx.dc, nil) + tx.dc = nil + tx.txi = nil +} + +func (tx *Tx) grabConn() (*driverConn, error) { + if tx.done { + return nil, ErrTxDone + } + return tx.dc, nil +} + +// Closes all Stmts prepared for this transaction. +func (tx *Tx) closePrepared() { + tx.stmts.Lock() + for _, stmt := range tx.stmts.v { + stmt.Close() + } + tx.stmts.Unlock() +} + +// Commit commits the transaction. +func (tx *Tx) Commit() error { + if tx.done { + return ErrTxDone + } + defer tx.close() + tx.dc.Lock() + err := tx.txi.Commit() + tx.dc.Unlock() + if err != driver.ErrBadConn { + tx.closePrepared() + } + return err +} + +// Rollback aborts the transaction. +func (tx *Tx) Rollback() error { + if tx.done { + return ErrTxDone + } + defer tx.close() + tx.dc.Lock() + err := tx.txi.Rollback() + tx.dc.Unlock() + if err != driver.ErrBadConn { + tx.closePrepared() + } + return err +} + +// Prepare creates a prepared statement for use within a transaction. +// +// The returned statement operates within the transaction and can no longer +// be used once the transaction has been committed or rolled back. +// +// To use an existing prepared statement on this transaction, see Tx.Stmt. +func (tx *Tx) Prepare(query string) (*Stmt, error) { + // TODO(bradfitz): We could be more efficient here and either + // provide a method to take an existing Stmt (created on + // perhaps a different Conn), and re-create it on this Conn if + // necessary. Or, better: keep a map in DB of query string to + // Stmts, and have Stmt.Execute do the right thing and + // re-prepare if the Conn in use doesn't have that prepared + // statement. But we'll want to avoid caching the statement + // in the case where we only call conn.Prepare implicitly + // (such as in db.Exec or tx.Exec), but the caller package + // can't be holding a reference to the returned statement. + // Perhaps just looking at the reference count (by noting + // Stmt.Close) would be enough. We might also want a finalizer + // on Stmt to drop the reference count. + dc, err := tx.grabConn() + if err != nil { + return nil, err + } + + dc.Lock() + si, err := dc.ci.Prepare(query) + dc.Unlock() + if err != nil { + return nil, err + } + + stmt := &Stmt{ + db: tx.db, + tx: tx, + txsi: &driverStmt{ + Locker: dc, + si: si, + }, + query: query, + } + tx.stmts.Lock() + tx.stmts.v = append(tx.stmts.v, stmt) + tx.stmts.Unlock() + return stmt, nil +} + +// Stmt returns a transaction-specific prepared statement from +// an existing statement. +// +// Example: +// updateMoney, err := db.Prepare("UPDATE balance SET money=money+? WHERE id=?") +// ... +// tx, err := db.Begin() +// ... +// res, err := tx.Stmt(updateMoney).Exec(123.45, 98293203) +// +// The returned statement operates within the transaction and can no longer +// be used once the transaction has been committed or rolled back. +func (tx *Tx) Stmt(stmt *Stmt) *Stmt { + // TODO(bradfitz): optimize this. Currently this re-prepares + // each time. This is fine for now to illustrate the API but + // we should really cache already-prepared statements + // per-Conn. See also the big comment in Tx.Prepare. + + if tx.db != stmt.db { + return &Stmt{stickyErr: errors.New("sql: Tx.Stmt: statement from different database used")} + } + dc, err := tx.grabConn() + if err != nil { + return &Stmt{stickyErr: err} + } + dc.Lock() + si, err := dc.ci.Prepare(stmt.query) + dc.Unlock() + txs := &Stmt{ + db: tx.db, + tx: tx, + txsi: &driverStmt{ + Locker: dc, + si: si, + }, + query: stmt.query, + stickyErr: err, + } + tx.stmts.Lock() + tx.stmts.v = append(tx.stmts.v, txs) + tx.stmts.Unlock() + return txs +} + +// Exec executes a query that doesn't return rows. +// For example: an INSERT and UPDATE. +func (tx *Tx) Exec(query string, args ...interface{}) (Result, error) { + dc, err := tx.grabConn() + if err != nil { + return nil, err + } + + if execer, ok := dc.ci.(driver.Execer); ok { + dargs, err := driverArgs(nil, args) + if err != nil { + return nil, err + } + dc.Lock() + resi, err := execer.Exec(query, dargs) + dc.Unlock() + if err == nil { + return driverResult{dc, resi}, nil + } + if err != driver.ErrSkip { + return nil, err + } + } + + dc.Lock() + si, err := dc.ci.Prepare(query) + dc.Unlock() + if err != nil { + return nil, err + } + defer withLock(dc, func() { si.Close() }) + + return resultFromStatement(driverStmt{dc, si}, args...) +} + +// Query executes a query that returns rows, typically a SELECT. +func (tx *Tx) Query(query string, args ...interface{}) (*Rows, error) { + dc, err := tx.grabConn() + if err != nil { + return nil, err + } + releaseConn := func(error) {} + return tx.db.queryConn(dc, releaseConn, query, args) +} + +// QueryRow executes a query that is expected to return at most one row. +// QueryRow always return a non-nil value. Errors are deferred until +// Row's Scan method is called. +func (tx *Tx) QueryRow(query string, args ...interface{}) *Row { + rows, err := tx.Query(query, args...) + return &Row{rows: rows, err: err} +} + +// connStmt is a prepared statement on a particular connection. +type connStmt struct { + dc *driverConn + si driver.Stmt +} + +// Stmt is a prepared statement. +// A Stmt is safe for concurrent use by multiple goroutines. +type Stmt struct { + // Immutable: + db *DB // where we came from + query string // that created the Stmt + stickyErr error // if non-nil, this error is returned for all operations + + closemu sync.RWMutex // held exclusively during close, for read otherwise. + + // If in a transaction, else both nil: + tx *Tx + txsi *driverStmt + + mu sync.Mutex // protects the rest of the fields + closed bool + + // css is a list of underlying driver statement interfaces + // that are valid on particular connections. This is only + // used if tx == nil and one is found that has idle + // connections. If tx != nil, txsi is always used. + css []connStmt + + // lastNumClosed is copied from db.numClosed when Stmt is created + // without tx and closed connections in css are removed. + lastNumClosed uint64 +} + +// Exec executes a prepared statement with the given arguments and +// returns a Result summarizing the effect of the statement. +func (s *Stmt) Exec(args ...interface{}) (Result, error) { + s.closemu.RLock() + defer s.closemu.RUnlock() + + var res Result + for i := 0; i < maxBadConnRetries; i++ { + dc, releaseConn, si, err := s.connStmt() + if err != nil { + if err == driver.ErrBadConn { + continue + } + return nil, err + } + + res, err = resultFromStatement(driverStmt{dc, si}, args...) + releaseConn(err) + if err != driver.ErrBadConn { + return res, err + } + } + return nil, driver.ErrBadConn +} + +func resultFromStatement(ds driverStmt, args ...interface{}) (Result, error) { + ds.Lock() + want := ds.si.NumInput() + ds.Unlock() + + // -1 means the driver doesn't know how to count the number of + // placeholders, so we won't sanity check input here and instead let the + // driver deal with errors. + if want != -1 && len(args) != want { + return nil, fmt.Errorf("sql: expected %d arguments, got %d", want, len(args)) + } + + dargs, err := driverArgs(&ds, args) + if err != nil { + return nil, err + } + + ds.Lock() + resi, err := ds.si.Exec(dargs) + ds.Unlock() + if err != nil { + return nil, err + } + return driverResult{ds.Locker, resi}, nil +} + +// removeClosedStmtLocked removes closed conns in s.css. +// +// To avoid lock contention on DB.mu, we do it only when +// s.db.numClosed - s.lastNum is large enough. +func (s *Stmt) removeClosedStmtLocked() { + t := len(s.css)/2 + 1 + if t > 10 { + t = 10 + } + dbClosed := atomic.LoadUint64(&s.db.numClosed) + if dbClosed-s.lastNumClosed < uint64(t) { + return + } + + s.db.mu.Lock() + for i := 0; i < len(s.css); i++ { + if s.css[i].dc.dbmuClosed { + s.css[i] = s.css[len(s.css)-1] + s.css = s.css[:len(s.css)-1] + i-- + } + } + s.db.mu.Unlock() + s.lastNumClosed = dbClosed +} + +// connStmt returns a free driver connection on which to execute the +// statement, a function to call to release the connection, and a +// statement bound to that connection. +func (s *Stmt) connStmt() (ci *driverConn, releaseConn func(error), si driver.Stmt, err error) { + if err = s.stickyErr; err != nil { + return + } + s.mu.Lock() + if s.closed { + s.mu.Unlock() + err = errors.New("sql: statement is closed") + return + } + + // In a transaction, we always use the connection that the + // transaction was created on. + if s.tx != nil { + s.mu.Unlock() + ci, err = s.tx.grabConn() // blocks, waiting for the connection. + if err != nil { + return + } + releaseConn = func(error) {} + return ci, releaseConn, s.txsi.si, nil + } + + s.removeClosedStmtLocked() + s.mu.Unlock() + + // TODO(bradfitz): or always wait for one? make configurable later? + dc, err := s.db.conn(cachedOrNewConn) + if err != nil { + return nil, nil, nil, err + } + + s.mu.Lock() + for _, v := range s.css { + if v.dc == dc { + s.mu.Unlock() + return dc, dc.releaseConn, v.si, nil + } + } + s.mu.Unlock() + + // No luck; we need to prepare the statement on this connection + dc.Lock() + si, err = dc.prepareLocked(s.query) + dc.Unlock() + if err != nil { + s.db.putConn(dc, err) + return nil, nil, nil, err + } + s.mu.Lock() + cs := connStmt{dc, si} + s.css = append(s.css, cs) + s.mu.Unlock() + + return dc, dc.releaseConn, si, nil +} + +// Query executes a prepared query statement with the given arguments +// and returns the query results as a *Rows. +func (s *Stmt) Query(args ...interface{}) (*Rows, error) { + s.closemu.RLock() + defer s.closemu.RUnlock() + + var rowsi driver.Rows + for i := 0; i < maxBadConnRetries; i++ { + dc, releaseConn, si, err := s.connStmt() + if err != nil { + if err == driver.ErrBadConn { + continue + } + return nil, err + } + + rowsi, err = rowsiFromStatement(driverStmt{dc, si}, args...) + if err == nil { + // Note: ownership of ci passes to the *Rows, to be freed + // with releaseConn. + rows := &Rows{ + dc: dc, + rowsi: rowsi, + // releaseConn set below + } + s.db.addDep(s, rows) + rows.releaseConn = func(err error) { + releaseConn(err) + s.db.removeDep(s, rows) + } + return rows, nil + } + + releaseConn(err) + if err != driver.ErrBadConn { + return nil, err + } + } + return nil, driver.ErrBadConn +} + +func rowsiFromStatement(ds driverStmt, args ...interface{}) (driver.Rows, error) { + ds.Lock() + want := ds.si.NumInput() + ds.Unlock() + + // -1 means the driver doesn't know how to count the number of + // placeholders, so we won't sanity check input here and instead let the + // driver deal with errors. + if want != -1 && len(args) != want { + return nil, fmt.Errorf("sql: statement expects %d inputs; got %d", want, len(args)) + } + + dargs, err := driverArgs(&ds, args) + if err != nil { + return nil, err + } + + ds.Lock() + rowsi, err := ds.si.Query(dargs) + ds.Unlock() + if err != nil { + return nil, err + } + return rowsi, nil +} + +// QueryRow executes a prepared query statement with the given arguments. +// If an error occurs during the execution of the statement, that error will +// be returned by a call to Scan on the returned *Row, which is always non-nil. +// If the query selects no rows, the *Row's Scan will return ErrNoRows. +// Otherwise, the *Row's Scan scans the first selected row and discards +// the rest. +// +// Example usage: +// +// var name string +// err := nameByUseridStmt.QueryRow(id).Scan(&name) +func (s *Stmt) QueryRow(args ...interface{}) *Row { + rows, err := s.Query(args...) + if err != nil { + return &Row{err: err} + } + return &Row{rows: rows} +} + +// Close closes the statement. +func (s *Stmt) Close() error { + s.closemu.Lock() + defer s.closemu.Unlock() + + if s.stickyErr != nil { + return s.stickyErr + } + s.mu.Lock() + if s.closed { + s.mu.Unlock() + return nil + } + s.closed = true + + if s.tx != nil { + s.txsi.Close() + s.mu.Unlock() + return nil + } + s.mu.Unlock() + + return s.db.removeDep(s, s) +} + +func (s *Stmt) finalClose() error { + s.mu.Lock() + defer s.mu.Unlock() + if s.css != nil { + for _, v := range s.css { + s.db.noteUnusedDriverStatement(v.dc, v.si) + v.dc.removeOpenStmt(v.si) + } + s.css = nil + } + return nil +} + +// Rows is the result of a query. Its cursor starts before the first row +// of the result set. Use Next to advance through the rows: +// +// rows, err := db.Query("SELECT ...") +// ... +// defer rows.Close() +// for rows.Next() { +// var id int +// var name string +// err = rows.Scan(&id, &name) +// ... +// } +// err = rows.Err() // get any error encountered during iteration +// ... +type Rows struct { + dc *driverConn // owned; must call releaseConn when closed to release + releaseConn func(error) + rowsi driver.Rows + + closed bool + lastcols []driver.Value + lasterr error // non-nil only if closed is true + closeStmt driver.Stmt // if non-nil, statement to Close on close +} + +// Next prepares the next result row for reading with the Scan method. It +// returns true on success, or false if there is no next result row or an error +// happened while preparing it. Err should be consulted to distinguish between +// the two cases. +// +// Every call to Scan, even the first one, must be preceded by a call to Next. +func (rs *Rows) Next() bool { + if rs.closed { + return false + } + if rs.lastcols == nil { + rs.lastcols = make([]driver.Value, len(rs.rowsi.Columns())) + } + rs.lasterr = rs.rowsi.Next(rs.lastcols) + if rs.lasterr != nil { + rs.Close() + return false + } + return true +} + +// Err returns the error, if any, that was encountered during iteration. +// Err may be called after an explicit or implicit Close. +func (rs *Rows) Err() error { + if rs.lasterr == io.EOF { + return nil + } + return rs.lasterr +} + +// Columns returns the column names. +// Columns returns an error if the rows are closed, or if the rows +// are from QueryRow and there was a deferred error. +func (rs *Rows) Columns() ([]string, error) { + if rs.closed { + return nil, errors.New("sql: Rows are closed") + } + if rs.rowsi == nil { + return nil, errors.New("sql: no Rows available") + } + return rs.rowsi.Columns(), nil +} + +// Scan copies the columns in the current row into the values pointed +// at by dest. +// +// If an argument has type *[]byte, Scan saves in that argument a copy +// of the corresponding data. The copy is owned by the caller and can +// be modified and held indefinitely. The copy can be avoided by using +// an argument of type *RawBytes instead; see the documentation for +// RawBytes for restrictions on its use. +// +// If an argument has type *interface{}, Scan copies the value +// provided by the underlying driver without conversion. If the value +// is of type []byte, a copy is made and the caller owns the result. +func (rs *Rows) Scan(dest ...interface{}) error { + if rs.closed { + return errors.New("sql: Rows are closed") + } + if rs.lastcols == nil { + return errors.New("sql: Scan called without calling Next") + } + if len(dest) != len(rs.lastcols) { + return fmt.Errorf("sql: expected %d destination arguments in Scan, not %d", len(rs.lastcols), len(dest)) + } + for i, sv := range rs.lastcols { + err := convertAssign(dest[i], sv) + if err != nil { + return fmt.Errorf("sql: Scan error on column index %d: %v", i, err) + } + } + return nil +} + +var rowsCloseHook func(*Rows, *error) + +// Close closes the Rows, preventing further enumeration. If Next returns +// false, the Rows are closed automatically and it will suffice to check the +// result of Err. Close is idempotent and does not affect the result of Err. +func (rs *Rows) Close() error { + if rs.closed { + return nil + } + rs.closed = true + err := rs.rowsi.Close() + if fn := rowsCloseHook; fn != nil { + fn(rs, &err) + } + if rs.closeStmt != nil { + rs.closeStmt.Close() + } + rs.releaseConn(err) + return err +} + +// Row is the result of calling QueryRow to select a single row. +type Row struct { + // One of these two will be non-nil: + err error // deferred error for easy chaining + rows *Rows +} + +// Scan copies the columns from the matched row into the values +// pointed at by dest. If more than one row matches the query, +// Scan uses the first row and discards the rest. If no row matches +// the query, Scan returns ErrNoRows. +func (r *Row) Scan(dest ...interface{}) error { + if r.err != nil { + return r.err + } + + // TODO(bradfitz): for now we need to defensively clone all + // []byte that the driver returned (not permitting + // *RawBytes in Rows.Scan), since we're about to close + // the Rows in our defer, when we return from this function. + // the contract with the driver.Next(...) interface is that it + // can return slices into read-only temporary memory that's + // only valid until the next Scan/Close. But the TODO is that + // for a lot of drivers, this copy will be unnecessary. We + // should provide an optional interface for drivers to + // implement to say, "don't worry, the []bytes that I return + // from Next will not be modified again." (for instance, if + // they were obtained from the network anyway) But for now we + // don't care. + defer r.rows.Close() + for _, dp := range dest { + if _, ok := dp.(*RawBytes); ok { + return errors.New("sql: RawBytes isn't allowed on Row.Scan") + } + } + + if !r.rows.Next() { + if err := r.rows.Err(); err != nil { + return err + } + return ErrNoRows + } + err := r.rows.Scan(dest...) + if err != nil { + return err + } + // Make sure the query can be processed to completion with no errors. + if err := r.rows.Close(); err != nil { + return err + } + + return nil +} + +// A Result summarizes an executed SQL command. +type Result interface { + // LastInsertId returns the integer generated by the database + // in response to a command. Typically this will be from an + // "auto increment" column when inserting a new row. Not all + // databases support this feature, and the syntax of such + // statements varies. + LastInsertId() (int64, error) + + // RowsAffected returns the number of rows affected by an + // update, insert, or delete. Not every database or database + // driver may support this. + RowsAffected() (int64, error) +} + +type driverResult struct { + sync.Locker // the *driverConn + resi driver.Result +} + +func (dr driverResult) LastInsertId() (int64, error) { + dr.Lock() + defer dr.Unlock() + return dr.resi.LastInsertId() +} + +func (dr driverResult) RowsAffected() (int64, error) { + dr.Lock() + defer dr.Unlock() + return dr.resi.RowsAffected() +} + +func stack() string { + var buf [2 << 10]byte + return string(buf[:runtime.Stack(buf[:], false)]) +} + +// withLock runs while holding lk. +func withLock(lk sync.Locker, fn func()) { + lk.Lock() + fn() + lk.Unlock() +} diff --git a/src/database/sql/sql_test.go b/src/database/sql/sql_test.go new file mode 100644 index 0000000000000000000000000000000000000000..432a641b85549632dba855b4500a7bf32a209ae4 --- /dev/null +++ b/src/database/sql/sql_test.go @@ -0,0 +1,2109 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package sql + +import ( + "database/sql/driver" + "errors" + "fmt" + "math/rand" + "reflect" + "runtime" + "strings" + "sync" + "testing" + "time" +) + +func init() { + type dbConn struct { + db *DB + c *driverConn + } + freedFrom := make(map[dbConn]string) + putConnHook = func(db *DB, c *driverConn) { + idx := -1 + for i, v := range db.freeConn { + if v == c { + idx = i + break + } + } + if idx >= 0 { + // print before panic, as panic may get lost due to conflicting panic + // (all goroutines asleep) elsewhere, since we might not unlock + // the mutex in freeConn here. + println("double free of conn. conflicts are:\nA) " + freedFrom[dbConn{db, c}] + "\n\nand\nB) " + stack()) + panic("double free of conn.") + } + freedFrom[dbConn{db, c}] = stack() + } +} + +const fakeDBName = "foo" + +var chrisBirthday = time.Unix(123456789, 0) + +func newTestDB(t testing.TB, name string) *DB { + db, err := Open("test", fakeDBName) + if err != nil { + t.Fatalf("Open: %v", err) + } + if _, err := db.Exec("WIPE"); err != nil { + t.Fatalf("exec wipe: %v", err) + } + if name == "people" { + exec(t, db, "CREATE|people|name=string,age=int32,photo=blob,dead=bool,bdate=datetime") + exec(t, db, "INSERT|people|name=Alice,age=?,photo=APHOTO", 1) + exec(t, db, "INSERT|people|name=Bob,age=?,photo=BPHOTO", 2) + exec(t, db, "INSERT|people|name=Chris,age=?,photo=CPHOTO,bdate=?", 3, chrisBirthday) + } + if name == "magicquery" { + // Magic table name and column, known by fakedb_test.go. + exec(t, db, "CREATE|magicquery|op=string,millis=int32") + exec(t, db, "INSERT|magicquery|op=sleep,millis=10") + } + return db +} + +func exec(t testing.TB, db *DB, query string, args ...interface{}) { + _, err := db.Exec(query, args...) + if err != nil { + t.Fatalf("Exec of %q: %v", query, err) + } +} + +func closeDB(t testing.TB, db *DB) { + if e := recover(); e != nil { + fmt.Printf("Panic: %v\n", e) + panic(e) + } + defer setHookpostCloseConn(nil) + setHookpostCloseConn(func(_ *fakeConn, err error) { + if err != nil { + t.Errorf("Error closing fakeConn: %v", err) + } + }) + for i, dc := range db.freeConn { + if n := len(dc.openStmt); n > 0 { + // Just a sanity check. This is legal in + // general, but if we make the tests clean up + // their statements first, then we can safely + // verify this is always zero here, and any + // other value is a leak. + t.Errorf("while closing db, freeConn %d/%d had %d open stmts; want 0", i, len(db.freeConn), n) + } + } + err := db.Close() + if err != nil { + t.Fatalf("error closing DB: %v", err) + } + db.mu.Lock() + count := db.numOpen + db.mu.Unlock() + if count != 0 { + t.Fatalf("%d connections still open after closing DB", db.numOpen) + } +} + +// numPrepares assumes that db has exactly 1 idle conn and returns +// its count of calls to Prepare +func numPrepares(t *testing.T, db *DB) int { + if n := len(db.freeConn); n != 1 { + t.Fatalf("free conns = %d; want 1", n) + } + return db.freeConn[0].ci.(*fakeConn).numPrepare +} + +func (db *DB) numDeps() int { + db.mu.Lock() + defer db.mu.Unlock() + return len(db.dep) +} + +// Dependencies are closed via a goroutine, so this polls waiting for +// numDeps to fall to want, waiting up to d. +func (db *DB) numDepsPollUntil(want int, d time.Duration) int { + deadline := time.Now().Add(d) + for { + n := db.numDeps() + if n <= want || time.Now().After(deadline) { + return n + } + time.Sleep(50 * time.Millisecond) + } +} + +func (db *DB) numFreeConns() int { + db.mu.Lock() + defer db.mu.Unlock() + return len(db.freeConn) +} + +func (db *DB) dumpDeps(t *testing.T) { + for fc := range db.dep { + db.dumpDep(t, 0, fc, map[finalCloser]bool{}) + } +} + +func (db *DB) dumpDep(t *testing.T, depth int, dep finalCloser, seen map[finalCloser]bool) { + seen[dep] = true + indent := strings.Repeat(" ", depth) + ds := db.dep[dep] + for k := range ds { + t.Logf("%s%T (%p) waiting for -> %T (%p)", indent, dep, dep, k, k) + if fc, ok := k.(finalCloser); ok { + if !seen[fc] { + db.dumpDep(t, depth+1, fc, seen) + } + } + } +} + +func TestQuery(t *testing.T) { + db := newTestDB(t, "people") + defer closeDB(t, db) + prepares0 := numPrepares(t, db) + rows, err := db.Query("SELECT|people|age,name|") + if err != nil { + t.Fatalf("Query: %v", err) + } + type row struct { + age int + name string + } + got := []row{} + for rows.Next() { + var r row + err = rows.Scan(&r.age, &r.name) + if err != nil { + t.Fatalf("Scan: %v", err) + } + got = append(got, r) + } + err = rows.Err() + if err != nil { + t.Fatalf("Err: %v", err) + } + want := []row{ + {age: 1, name: "Alice"}, + {age: 2, name: "Bob"}, + {age: 3, name: "Chris"}, + } + if !reflect.DeepEqual(got, want) { + t.Errorf("mismatch.\n got: %#v\nwant: %#v", got, want) + } + + // And verify that the final rows.Next() call, which hit EOF, + // also closed the rows connection. + if n := db.numFreeConns(); n != 1 { + t.Fatalf("free conns after query hitting EOF = %d; want 1", n) + } + if prepares := numPrepares(t, db) - prepares0; prepares != 1 { + t.Errorf("executed %d Prepare statements; want 1", prepares) + } +} + +func TestByteOwnership(t *testing.T) { + db := newTestDB(t, "people") + defer closeDB(t, db) + rows, err := db.Query("SELECT|people|name,photo|") + if err != nil { + t.Fatalf("Query: %v", err) + } + type row struct { + name []byte + photo RawBytes + } + got := []row{} + for rows.Next() { + var r row + err = rows.Scan(&r.name, &r.photo) + if err != nil { + t.Fatalf("Scan: %v", err) + } + got = append(got, r) + } + corruptMemory := []byte("\xffPHOTO") + want := []row{ + {name: []byte("Alice"), photo: corruptMemory}, + {name: []byte("Bob"), photo: corruptMemory}, + {name: []byte("Chris"), photo: corruptMemory}, + } + if !reflect.DeepEqual(got, want) { + t.Errorf("mismatch.\n got: %#v\nwant: %#v", got, want) + } + + var photo RawBytes + err = db.QueryRow("SELECT|people|photo|name=?", "Alice").Scan(&photo) + if err == nil { + t.Error("want error scanning into RawBytes from QueryRow") + } +} + +func TestRowsColumns(t *testing.T) { + db := newTestDB(t, "people") + defer closeDB(t, db) + rows, err := db.Query("SELECT|people|age,name|") + if err != nil { + t.Fatalf("Query: %v", err) + } + cols, err := rows.Columns() + if err != nil { + t.Fatalf("Columns: %v", err) + } + want := []string{"age", "name"} + if !reflect.DeepEqual(cols, want) { + t.Errorf("got %#v; want %#v", cols, want) + } + if err := rows.Close(); err != nil { + t.Errorf("error closing rows: %s", err) + } +} + +func TestQueryRow(t *testing.T) { + db := newTestDB(t, "people") + defer closeDB(t, db) + var name string + var age int + var birthday time.Time + + err := db.QueryRow("SELECT|people|age,name|age=?", 3).Scan(&age) + if err == nil || !strings.Contains(err.Error(), "expected 2 destination arguments") { + t.Errorf("expected error from wrong number of arguments; actually got: %v", err) + } + + err = db.QueryRow("SELECT|people|bdate|age=?", 3).Scan(&birthday) + if err != nil || !birthday.Equal(chrisBirthday) { + t.Errorf("chris birthday = %v, err = %v; want %v", birthday, err, chrisBirthday) + } + + err = db.QueryRow("SELECT|people|age,name|age=?", 2).Scan(&age, &name) + if err != nil { + t.Fatalf("age QueryRow+Scan: %v", err) + } + if name != "Bob" { + t.Errorf("expected name Bob, got %q", name) + } + if age != 2 { + t.Errorf("expected age 2, got %d", age) + } + + err = db.QueryRow("SELECT|people|age,name|name=?", "Alice").Scan(&age, &name) + if err != nil { + t.Fatalf("name QueryRow+Scan: %v", err) + } + if name != "Alice" { + t.Errorf("expected name Alice, got %q", name) + } + if age != 1 { + t.Errorf("expected age 1, got %d", age) + } + + var photo []byte + err = db.QueryRow("SELECT|people|photo|name=?", "Alice").Scan(&photo) + if err != nil { + t.Fatalf("photo QueryRow+Scan: %v", err) + } + want := []byte("APHOTO") + if !reflect.DeepEqual(photo, want) { + t.Errorf("photo = %q; want %q", photo, want) + } +} + +func TestStatementErrorAfterClose(t *testing.T) { + db := newTestDB(t, "people") + defer closeDB(t, db) + stmt, err := db.Prepare("SELECT|people|age|name=?") + if err != nil { + t.Fatalf("Prepare: %v", err) + } + err = stmt.Close() + if err != nil { + t.Fatalf("Close: %v", err) + } + var name string + err = stmt.QueryRow("foo").Scan(&name) + if err == nil { + t.Errorf("expected error from QueryRow.Scan after Stmt.Close") + } +} + +func TestStatementQueryRow(t *testing.T) { + db := newTestDB(t, "people") + defer closeDB(t, db) + stmt, err := db.Prepare("SELECT|people|age|name=?") + if err != nil { + t.Fatalf("Prepare: %v", err) + } + defer stmt.Close() + var age int + for n, tt := range []struct { + name string + want int + }{ + {"Alice", 1}, + {"Bob", 2}, + {"Chris", 3}, + } { + if err := stmt.QueryRow(tt.name).Scan(&age); err != nil { + t.Errorf("%d: on %q, QueryRow/Scan: %v", n, tt.name, err) + } else if age != tt.want { + t.Errorf("%d: age=%d, want %d", n, age, tt.want) + } + } +} + +// golang.org/issue/3734 +func TestStatementQueryRowConcurrent(t *testing.T) { + db := newTestDB(t, "people") + defer closeDB(t, db) + stmt, err := db.Prepare("SELECT|people|age|name=?") + if err != nil { + t.Fatalf("Prepare: %v", err) + } + defer stmt.Close() + + const n = 10 + ch := make(chan error, n) + for i := 0; i < n; i++ { + go func() { + var age int + err := stmt.QueryRow("Alice").Scan(&age) + if err == nil && age != 1 { + err = fmt.Errorf("unexpected age %d", age) + } + ch <- err + }() + } + for i := 0; i < n; i++ { + if err := <-ch; err != nil { + t.Error(err) + } + } +} + +// just a test of fakedb itself +func TestBogusPreboundParameters(t *testing.T) { + db := newTestDB(t, "foo") + defer closeDB(t, db) + exec(t, db, "CREATE|t1|name=string,age=int32,dead=bool") + _, err := db.Prepare("INSERT|t1|name=?,age=bogusconversion") + if err == nil { + t.Fatalf("expected error") + } + if err.Error() != `fakedb: invalid conversion to int32 from "bogusconversion"` { + t.Errorf("unexpected error: %v", err) + } +} + +func TestExec(t *testing.T) { + db := newTestDB(t, "foo") + defer closeDB(t, db) + exec(t, db, "CREATE|t1|name=string,age=int32,dead=bool") + stmt, err := db.Prepare("INSERT|t1|name=?,age=?") + if err != nil { + t.Errorf("Stmt, err = %v, %v", stmt, err) + } + defer stmt.Close() + + type execTest struct { + args []interface{} + wantErr string + } + execTests := []execTest{ + // Okay: + {[]interface{}{"Brad", 31}, ""}, + {[]interface{}{"Brad", int64(31)}, ""}, + {[]interface{}{"Bob", "32"}, ""}, + {[]interface{}{7, 9}, ""}, + + // Invalid conversions: + {[]interface{}{"Brad", int64(0xFFFFFFFF)}, "sql: converting argument #1's type: sql/driver: value 4294967295 overflows int32"}, + {[]interface{}{"Brad", "strconv fail"}, "sql: converting argument #1's type: sql/driver: value \"strconv fail\" can't be converted to int32"}, + + // Wrong number of args: + {[]interface{}{}, "sql: expected 2 arguments, got 0"}, + {[]interface{}{1, 2, 3}, "sql: expected 2 arguments, got 3"}, + } + for n, et := range execTests { + _, err := stmt.Exec(et.args...) + errStr := "" + if err != nil { + errStr = err.Error() + } + if errStr != et.wantErr { + t.Errorf("stmt.Execute #%d: for %v, got error %q, want error %q", + n, et.args, errStr, et.wantErr) + } + } +} + +func TestTxPrepare(t *testing.T) { + db := newTestDB(t, "") + defer closeDB(t, db) + exec(t, db, "CREATE|t1|name=string,age=int32,dead=bool") + tx, err := db.Begin() + if err != nil { + t.Fatalf("Begin = %v", err) + } + stmt, err := tx.Prepare("INSERT|t1|name=?,age=?") + if err != nil { + t.Fatalf("Stmt, err = %v, %v", stmt, err) + } + defer stmt.Close() + _, err = stmt.Exec("Bobby", 7) + if err != nil { + t.Fatalf("Exec = %v", err) + } + err = tx.Commit() + if err != nil { + t.Fatalf("Commit = %v", err) + } + // Commit() should have closed the statement + if !stmt.closed { + t.Fatal("Stmt not closed after Commit") + } +} + +func TestTxStmt(t *testing.T) { + db := newTestDB(t, "") + defer closeDB(t, db) + exec(t, db, "CREATE|t1|name=string,age=int32,dead=bool") + stmt, err := db.Prepare("INSERT|t1|name=?,age=?") + if err != nil { + t.Fatalf("Stmt, err = %v, %v", stmt, err) + } + defer stmt.Close() + tx, err := db.Begin() + if err != nil { + t.Fatalf("Begin = %v", err) + } + txs := tx.Stmt(stmt) + defer txs.Close() + _, err = txs.Exec("Bobby", 7) + if err != nil { + t.Fatalf("Exec = %v", err) + } + err = tx.Commit() + if err != nil { + t.Fatalf("Commit = %v", err) + } + // Commit() should have closed the statement + if !txs.closed { + t.Fatal("Stmt not closed after Commit") + } +} + +// Issue: https://golang.org/issue/2784 +// This test didn't fail before because we got lucky with the fakedb driver. +// It was failing, and now not, in github.com/bradfitz/go-sql-test +func TestTxQuery(t *testing.T) { + db := newTestDB(t, "") + defer closeDB(t, db) + exec(t, db, "CREATE|t1|name=string,age=int32,dead=bool") + exec(t, db, "INSERT|t1|name=Alice") + + tx, err := db.Begin() + if err != nil { + t.Fatal(err) + } + defer tx.Rollback() + + r, err := tx.Query("SELECT|t1|name|") + if err != nil { + t.Fatal(err) + } + defer r.Close() + + if !r.Next() { + if r.Err() != nil { + t.Fatal(r.Err()) + } + t.Fatal("expected one row") + } + + var x string + err = r.Scan(&x) + if err != nil { + t.Fatal(err) + } +} + +func TestTxQueryInvalid(t *testing.T) { + db := newTestDB(t, "") + defer closeDB(t, db) + + tx, err := db.Begin() + if err != nil { + t.Fatal(err) + } + defer tx.Rollback() + + _, err = tx.Query("SELECT|t1|name|") + if err == nil { + t.Fatal("Error expected") + } +} + +// Tests fix for issue 4433, that retries in Begin happen when +// conn.Begin() returns ErrBadConn +func TestTxErrBadConn(t *testing.T) { + db, err := Open("test", fakeDBName+";badConn") + if err != nil { + t.Fatalf("Open: %v", err) + } + if _, err := db.Exec("WIPE"); err != nil { + t.Fatalf("exec wipe: %v", err) + } + defer closeDB(t, db) + exec(t, db, "CREATE|t1|name=string,age=int32,dead=bool") + stmt, err := db.Prepare("INSERT|t1|name=?,age=?") + if err != nil { + t.Fatalf("Stmt, err = %v, %v", stmt, err) + } + defer stmt.Close() + tx, err := db.Begin() + if err != nil { + t.Fatalf("Begin = %v", err) + } + txs := tx.Stmt(stmt) + defer txs.Close() + _, err = txs.Exec("Bobby", 7) + if err != nil { + t.Fatalf("Exec = %v", err) + } + err = tx.Commit() + if err != nil { + t.Fatalf("Commit = %v", err) + } +} + +// Tests fix for issue 2542, that we release a lock when querying on +// a closed connection. +func TestIssue2542Deadlock(t *testing.T) { + db := newTestDB(t, "people") + closeDB(t, db) + for i := 0; i < 2; i++ { + _, err := db.Query("SELECT|people|age,name|") + if err == nil { + t.Fatalf("expected error") + } + } +} + +// From golang.org/issue/3865 +func TestCloseStmtBeforeRows(t *testing.T) { + db := newTestDB(t, "people") + defer closeDB(t, db) + + s, err := db.Prepare("SELECT|people|name|") + if err != nil { + t.Fatal(err) + } + + r, err := s.Query() + if err != nil { + s.Close() + t.Fatal(err) + } + + err = s.Close() + if err != nil { + t.Fatal(err) + } + + r.Close() +} + +// Tests fix for issue 2788, that we bind nil to a []byte if the +// value in the column is sql null +func TestNullByteSlice(t *testing.T) { + db := newTestDB(t, "") + defer closeDB(t, db) + exec(t, db, "CREATE|t|id=int32,name=nullstring") + exec(t, db, "INSERT|t|id=10,name=?", nil) + + var name []byte + + err := db.QueryRow("SELECT|t|name|id=?", 10).Scan(&name) + if err != nil { + t.Fatal(err) + } + if name != nil { + t.Fatalf("name []byte should be nil for null column value, got: %#v", name) + } + + exec(t, db, "INSERT|t|id=11,name=?", "bob") + err = db.QueryRow("SELECT|t|name|id=?", 11).Scan(&name) + if err != nil { + t.Fatal(err) + } + if string(name) != "bob" { + t.Fatalf("name []byte should be bob, got: %q", string(name)) + } +} + +func TestPointerParamsAndScans(t *testing.T) { + db := newTestDB(t, "") + defer closeDB(t, db) + exec(t, db, "CREATE|t|id=int32,name=nullstring") + + bob := "bob" + var name *string + + name = &bob + exec(t, db, "INSERT|t|id=10,name=?", name) + name = nil + exec(t, db, "INSERT|t|id=20,name=?", name) + + err := db.QueryRow("SELECT|t|name|id=?", 10).Scan(&name) + if err != nil { + t.Fatalf("querying id 10: %v", err) + } + if name == nil { + t.Errorf("id 10's name = nil; want bob") + } else if *name != "bob" { + t.Errorf("id 10's name = %q; want bob", *name) + } + + err = db.QueryRow("SELECT|t|name|id=?", 20).Scan(&name) + if err != nil { + t.Fatalf("querying id 20: %v", err) + } + if name != nil { + t.Errorf("id 20 = %q; want nil", *name) + } +} + +func TestQueryRowClosingStmt(t *testing.T) { + db := newTestDB(t, "people") + defer closeDB(t, db) + var name string + var age int + err := db.QueryRow("SELECT|people|age,name|age=?", 3).Scan(&age, &name) + if err != nil { + t.Fatal(err) + } + if len(db.freeConn) != 1 { + t.Fatalf("expected 1 free conn") + } + fakeConn := db.freeConn[0].ci.(*fakeConn) + if made, closed := fakeConn.stmtsMade, fakeConn.stmtsClosed; made != closed { + t.Errorf("statement close mismatch: made %d, closed %d", made, closed) + } +} + +// Test issue 6651 +func TestIssue6651(t *testing.T) { + db := newTestDB(t, "people") + defer closeDB(t, db) + + var v string + + want := "error in rows.Next" + rowsCursorNextHook = func(dest []driver.Value) error { + return fmt.Errorf(want) + } + defer func() { rowsCursorNextHook = nil }() + err := db.QueryRow("SELECT|people|name|").Scan(&v) + if err == nil || err.Error() != want { + t.Errorf("error = %q; want %q", err, want) + } + rowsCursorNextHook = nil + + want = "error in rows.Close" + rowsCloseHook = func(rows *Rows, err *error) { + *err = fmt.Errorf(want) + } + defer func() { rowsCloseHook = nil }() + err = db.QueryRow("SELECT|people|name|").Scan(&v) + if err == nil || err.Error() != want { + t.Errorf("error = %q; want %q", err, want) + } +} + +type nullTestRow struct { + nullParam interface{} + notNullParam interface{} + scanNullVal interface{} +} + +type nullTestSpec struct { + nullType string + notNullType string + rows [6]nullTestRow +} + +func TestNullStringParam(t *testing.T) { + spec := nullTestSpec{"nullstring", "string", [6]nullTestRow{ + {NullString{"aqua", true}, "", NullString{"aqua", true}}, + {NullString{"brown", false}, "", NullString{"", false}}, + {"chartreuse", "", NullString{"chartreuse", true}}, + {NullString{"darkred", true}, "", NullString{"darkred", true}}, + {NullString{"eel", false}, "", NullString{"", false}}, + {"foo", NullString{"black", false}, nil}, + }} + nullTestRun(t, spec) +} + +func TestNullInt64Param(t *testing.T) { + spec := nullTestSpec{"nullint64", "int64", [6]nullTestRow{ + {NullInt64{31, true}, 1, NullInt64{31, true}}, + {NullInt64{-22, false}, 1, NullInt64{0, false}}, + {22, 1, NullInt64{22, true}}, + {NullInt64{33, true}, 1, NullInt64{33, true}}, + {NullInt64{222, false}, 1, NullInt64{0, false}}, + {0, NullInt64{31, false}, nil}, + }} + nullTestRun(t, spec) +} + +func TestNullFloat64Param(t *testing.T) { + spec := nullTestSpec{"nullfloat64", "float64", [6]nullTestRow{ + {NullFloat64{31.2, true}, 1, NullFloat64{31.2, true}}, + {NullFloat64{13.1, false}, 1, NullFloat64{0, false}}, + {-22.9, 1, NullFloat64{-22.9, true}}, + {NullFloat64{33.81, true}, 1, NullFloat64{33.81, true}}, + {NullFloat64{222, false}, 1, NullFloat64{0, false}}, + {10, NullFloat64{31.2, false}, nil}, + }} + nullTestRun(t, spec) +} + +func TestNullBoolParam(t *testing.T) { + spec := nullTestSpec{"nullbool", "bool", [6]nullTestRow{ + {NullBool{false, true}, true, NullBool{false, true}}, + {NullBool{true, false}, false, NullBool{false, false}}, + {true, true, NullBool{true, true}}, + {NullBool{true, true}, false, NullBool{true, true}}, + {NullBool{true, false}, true, NullBool{false, false}}, + {true, NullBool{true, false}, nil}, + }} + nullTestRun(t, spec) +} + +func nullTestRun(t *testing.T, spec nullTestSpec) { + db := newTestDB(t, "") + defer closeDB(t, db) + exec(t, db, fmt.Sprintf("CREATE|t|id=int32,name=string,nullf=%s,notnullf=%s", spec.nullType, spec.notNullType)) + + // Inserts with db.Exec: + exec(t, db, "INSERT|t|id=?,name=?,nullf=?,notnullf=?", 1, "alice", spec.rows[0].nullParam, spec.rows[0].notNullParam) + exec(t, db, "INSERT|t|id=?,name=?,nullf=?,notnullf=?", 2, "bob", spec.rows[1].nullParam, spec.rows[1].notNullParam) + + // Inserts with a prepared statement: + stmt, err := db.Prepare("INSERT|t|id=?,name=?,nullf=?,notnullf=?") + if err != nil { + t.Fatalf("prepare: %v", err) + } + defer stmt.Close() + if _, err := stmt.Exec(3, "chris", spec.rows[2].nullParam, spec.rows[2].notNullParam); err != nil { + t.Errorf("exec insert chris: %v", err) + } + if _, err := stmt.Exec(4, "dave", spec.rows[3].nullParam, spec.rows[3].notNullParam); err != nil { + t.Errorf("exec insert dave: %v", err) + } + if _, err := stmt.Exec(5, "eleanor", spec.rows[4].nullParam, spec.rows[4].notNullParam); err != nil { + t.Errorf("exec insert eleanor: %v", err) + } + + // Can't put null val into non-null col + if _, err := stmt.Exec(6, "bob", spec.rows[5].nullParam, spec.rows[5].notNullParam); err == nil { + t.Errorf("expected error inserting nil val with prepared statement Exec") + } + + _, err = db.Exec("INSERT|t|id=?,name=?,nullf=?", 999, nil, nil) + if err == nil { + // TODO: this test fails, but it's just because + // fakeConn implements the optional Execer interface, + // so arguably this is the correct behavior. But + // maybe I should flesh out the fakeConn.Exec + // implementation so this properly fails. + // t.Errorf("expected error inserting nil name with Exec") + } + + paramtype := reflect.TypeOf(spec.rows[0].nullParam) + bindVal := reflect.New(paramtype).Interface() + + for i := 0; i < 5; i++ { + id := i + 1 + if err := db.QueryRow("SELECT|t|nullf|id=?", id).Scan(bindVal); err != nil { + t.Errorf("id=%d Scan: %v", id, err) + } + bindValDeref := reflect.ValueOf(bindVal).Elem().Interface() + if !reflect.DeepEqual(bindValDeref, spec.rows[i].scanNullVal) { + t.Errorf("id=%d got %#v, want %#v", id, bindValDeref, spec.rows[i].scanNullVal) + } + } +} + +// golang.org/issue/4859 +func TestQueryRowNilScanDest(t *testing.T) { + db := newTestDB(t, "people") + defer closeDB(t, db) + var name *string // nil pointer + err := db.QueryRow("SELECT|people|name|").Scan(name) + want := "sql: Scan error on column index 0: destination pointer is nil" + if err == nil || err.Error() != want { + t.Errorf("error = %q; want %q", err.Error(), want) + } +} + +func TestIssue4902(t *testing.T) { + db := newTestDB(t, "people") + defer closeDB(t, db) + + driver := db.driver.(*fakeDriver) + opens0 := driver.openCount + + var stmt *Stmt + var err error + for i := 0; i < 10; i++ { + stmt, err = db.Prepare("SELECT|people|name|") + if err != nil { + t.Fatal(err) + } + err = stmt.Close() + if err != nil { + t.Fatal(err) + } + } + + opens := driver.openCount - opens0 + if opens > 1 { + t.Errorf("opens = %d; want <= 1", opens) + t.Logf("db = %#v", db) + t.Logf("driver = %#v", driver) + t.Logf("stmt = %#v", stmt) + } +} + +// Issue 3857 +// This used to deadlock. +func TestSimultaneousQueries(t *testing.T) { + db := newTestDB(t, "people") + defer closeDB(t, db) + + tx, err := db.Begin() + if err != nil { + t.Fatal(err) + } + defer tx.Rollback() + + r1, err := tx.Query("SELECT|people|name|") + if err != nil { + t.Fatal(err) + } + defer r1.Close() + + r2, err := tx.Query("SELECT|people|name|") + if err != nil { + t.Fatal(err) + } + defer r2.Close() +} + +func TestMaxIdleConns(t *testing.T) { + db := newTestDB(t, "people") + defer closeDB(t, db) + + tx, err := db.Begin() + if err != nil { + t.Fatal(err) + } + tx.Commit() + if got := len(db.freeConn); got != 1 { + t.Errorf("freeConns = %d; want 1", got) + } + + db.SetMaxIdleConns(0) + + if got := len(db.freeConn); got != 0 { + t.Errorf("freeConns after set to zero = %d; want 0", got) + } + + tx, err = db.Begin() + if err != nil { + t.Fatal(err) + } + tx.Commit() + if got := len(db.freeConn); got != 0 { + t.Errorf("freeConns = %d; want 0", got) + } +} + +func TestMaxOpenConns(t *testing.T) { + if testing.Short() { + t.Skip("skipping in short mode") + } + defer setHookpostCloseConn(nil) + setHookpostCloseConn(func(_ *fakeConn, err error) { + if err != nil { + t.Errorf("Error closing fakeConn: %v", err) + } + }) + + db := newTestDB(t, "magicquery") + defer closeDB(t, db) + + driver := db.driver.(*fakeDriver) + + // Force the number of open connections to 0 so we can get an accurate + // count for the test + db.SetMaxIdleConns(0) + + if g, w := db.numFreeConns(), 0; g != w { + t.Errorf("free conns = %d; want %d", g, w) + } + + if n := db.numDepsPollUntil(0, time.Second); n > 0 { + t.Errorf("number of dependencies = %d; expected 0", n) + db.dumpDeps(t) + } + + driver.mu.Lock() + opens0 := driver.openCount + closes0 := driver.closeCount + driver.mu.Unlock() + + db.SetMaxIdleConns(10) + db.SetMaxOpenConns(10) + + stmt, err := db.Prepare("SELECT|magicquery|op|op=?,millis=?") + if err != nil { + t.Fatal(err) + } + + // Start 50 parallel slow queries. + const ( + nquery = 50 + sleepMillis = 25 + nbatch = 2 + ) + var wg sync.WaitGroup + for batch := 0; batch < nbatch; batch++ { + for i := 0; i < nquery; i++ { + wg.Add(1) + go func() { + defer wg.Done() + var op string + if err := stmt.QueryRow("sleep", sleepMillis).Scan(&op); err != nil && err != ErrNoRows { + t.Error(err) + } + }() + } + // Sleep for twice the expected length of time for the + // batch of 50 queries above to finish before starting + // the next round. + time.Sleep(2 * sleepMillis * time.Millisecond) + } + wg.Wait() + + if g, w := db.numFreeConns(), 10; g != w { + t.Errorf("free conns = %d; want %d", g, w) + } + + if n := db.numDepsPollUntil(20, time.Second); n > 20 { + t.Errorf("number of dependencies = %d; expected <= 20", n) + db.dumpDeps(t) + } + + driver.mu.Lock() + opens := driver.openCount - opens0 + closes := driver.closeCount - closes0 + driver.mu.Unlock() + + if opens > 10 { + t.Logf("open calls = %d", opens) + t.Logf("close calls = %d", closes) + t.Errorf("db connections opened = %d; want <= 10", opens) + db.dumpDeps(t) + } + + if err := stmt.Close(); err != nil { + t.Fatal(err) + } + + if g, w := db.numFreeConns(), 10; g != w { + t.Errorf("free conns = %d; want %d", g, w) + } + + if n := db.numDepsPollUntil(10, time.Second); n > 10 { + t.Errorf("number of dependencies = %d; expected <= 10", n) + db.dumpDeps(t) + } + + db.SetMaxOpenConns(5) + + if g, w := db.numFreeConns(), 5; g != w { + t.Errorf("free conns = %d; want %d", g, w) + } + + if n := db.numDepsPollUntil(5, time.Second); n > 5 { + t.Errorf("number of dependencies = %d; expected 0", n) + db.dumpDeps(t) + } + + db.SetMaxOpenConns(0) + + if g, w := db.numFreeConns(), 5; g != w { + t.Errorf("free conns = %d; want %d", g, w) + } + + if n := db.numDepsPollUntil(5, time.Second); n > 5 { + t.Errorf("number of dependencies = %d; expected 0", n) + db.dumpDeps(t) + } + + db.SetMaxIdleConns(0) + + if g, w := db.numFreeConns(), 0; g != w { + t.Errorf("free conns = %d; want %d", g, w) + } + + if n := db.numDepsPollUntil(0, time.Second); n > 0 { + t.Errorf("number of dependencies = %d; expected 0", n) + db.dumpDeps(t) + } +} + +// Issue 9453: tests that SetMaxOpenConns can be lowered at runtime +// and affects the subsequent release of connections. +func TestMaxOpenConnsOnBusy(t *testing.T) { + defer setHookpostCloseConn(nil) + setHookpostCloseConn(func(_ *fakeConn, err error) { + if err != nil { + t.Errorf("Error closing fakeConn: %v", err) + } + }) + + db := newTestDB(t, "magicquery") + defer closeDB(t, db) + + db.SetMaxOpenConns(3) + + conn0, err := db.conn(cachedOrNewConn) + if err != nil { + t.Fatalf("db open conn fail: %v", err) + } + + conn1, err := db.conn(cachedOrNewConn) + if err != nil { + t.Fatalf("db open conn fail: %v", err) + } + + conn2, err := db.conn(cachedOrNewConn) + if err != nil { + t.Fatalf("db open conn fail: %v", err) + } + + if g, w := db.numOpen, 3; g != w { + t.Errorf("free conns = %d; want %d", g, w) + } + + db.SetMaxOpenConns(2) + if g, w := db.numOpen, 3; g != w { + t.Errorf("free conns = %d; want %d", g, w) + } + + conn0.releaseConn(nil) + conn1.releaseConn(nil) + if g, w := db.numOpen, 2; g != w { + t.Errorf("free conns = %d; want %d", g, w) + } + + conn2.releaseConn(nil) + if g, w := db.numOpen, 2; g != w { + t.Errorf("free conns = %d; want %d", g, w) + } +} + +func TestSingleOpenConn(t *testing.T) { + db := newTestDB(t, "people") + defer closeDB(t, db) + + db.SetMaxOpenConns(1) + + rows, err := db.Query("SELECT|people|name|") + if err != nil { + t.Fatal(err) + } + if err = rows.Close(); err != nil { + t.Fatal(err) + } + // shouldn't deadlock + rows, err = db.Query("SELECT|people|name|") + if err != nil { + t.Fatal(err) + } + if err = rows.Close(); err != nil { + t.Fatal(err) + } +} + +func TestStats(t *testing.T) { + db := newTestDB(t, "people") + stats := db.Stats() + if got := stats.OpenConnections; got != 1 { + t.Errorf("stats.OpenConnections = %d; want 1", got) + } + + tx, err := db.Begin() + if err != nil { + t.Fatal(err) + } + tx.Commit() + + closeDB(t, db) + stats = db.Stats() + if got := stats.OpenConnections; got != 0 { + t.Errorf("stats.OpenConnections = %d; want 0", got) + } +} + +// golang.org/issue/5323 +func TestStmtCloseDeps(t *testing.T) { + if testing.Short() { + t.Skip("skipping in short mode") + } + defer setHookpostCloseConn(nil) + setHookpostCloseConn(func(_ *fakeConn, err error) { + if err != nil { + t.Errorf("Error closing fakeConn: %v", err) + } + }) + + db := newTestDB(t, "magicquery") + defer closeDB(t, db) + + driver := db.driver.(*fakeDriver) + + driver.mu.Lock() + opens0 := driver.openCount + closes0 := driver.closeCount + driver.mu.Unlock() + openDelta0 := opens0 - closes0 + + stmt, err := db.Prepare("SELECT|magicquery|op|op=?,millis=?") + if err != nil { + t.Fatal(err) + } + + // Start 50 parallel slow queries. + const ( + nquery = 50 + sleepMillis = 25 + nbatch = 2 + ) + var wg sync.WaitGroup + for batch := 0; batch < nbatch; batch++ { + for i := 0; i < nquery; i++ { + wg.Add(1) + go func() { + defer wg.Done() + var op string + if err := stmt.QueryRow("sleep", sleepMillis).Scan(&op); err != nil && err != ErrNoRows { + t.Error(err) + } + }() + } + // Sleep for twice the expected length of time for the + // batch of 50 queries above to finish before starting + // the next round. + time.Sleep(2 * sleepMillis * time.Millisecond) + } + wg.Wait() + + if g, w := db.numFreeConns(), 2; g != w { + t.Errorf("free conns = %d; want %d", g, w) + } + + if n := db.numDepsPollUntil(4, time.Second); n > 4 { + t.Errorf("number of dependencies = %d; expected <= 4", n) + db.dumpDeps(t) + } + + driver.mu.Lock() + opens := driver.openCount - opens0 + closes := driver.closeCount - closes0 + openDelta := (driver.openCount - driver.closeCount) - openDelta0 + driver.mu.Unlock() + + if openDelta > 2 { + t.Logf("open calls = %d", opens) + t.Logf("close calls = %d", closes) + t.Logf("open delta = %d", openDelta) + t.Errorf("db connections opened = %d; want <= 2", openDelta) + db.dumpDeps(t) + } + + if len(stmt.css) > nquery { + t.Errorf("len(stmt.css) = %d; want <= %d", len(stmt.css), nquery) + } + + if err := stmt.Close(); err != nil { + t.Fatal(err) + } + + if g, w := db.numFreeConns(), 2; g != w { + t.Errorf("free conns = %d; want %d", g, w) + } + + if n := db.numDepsPollUntil(2, time.Second); n > 2 { + t.Errorf("number of dependencies = %d; expected <= 2", n) + db.dumpDeps(t) + } + + db.SetMaxIdleConns(0) + + if g, w := db.numFreeConns(), 0; g != w { + t.Errorf("free conns = %d; want %d", g, w) + } + + if n := db.numDepsPollUntil(0, time.Second); n > 0 { + t.Errorf("number of dependencies = %d; expected 0", n) + db.dumpDeps(t) + } +} + +// golang.org/issue/5046 +func TestCloseConnBeforeStmts(t *testing.T) { + db := newTestDB(t, "people") + defer closeDB(t, db) + + defer setHookpostCloseConn(nil) + setHookpostCloseConn(func(_ *fakeConn, err error) { + if err != nil { + t.Errorf("Error closing fakeConn: %v; from %s", err, stack()) + db.dumpDeps(t) + t.Errorf("DB = %#v", db) + } + }) + + stmt, err := db.Prepare("SELECT|people|name|") + if err != nil { + t.Fatal(err) + } + + if len(db.freeConn) != 1 { + t.Fatalf("expected 1 freeConn; got %d", len(db.freeConn)) + } + dc := db.freeConn[0] + if dc.closed { + t.Errorf("conn shouldn't be closed") + } + + if n := len(dc.openStmt); n != 1 { + t.Errorf("driverConn num openStmt = %d; want 1", n) + } + err = db.Close() + if err != nil { + t.Errorf("db Close = %v", err) + } + if !dc.closed { + t.Errorf("after db.Close, driverConn should be closed") + } + if n := len(dc.openStmt); n != 0 { + t.Errorf("driverConn num openStmt = %d; want 0", n) + } + + err = stmt.Close() + if err != nil { + t.Errorf("Stmt close = %v", err) + } + + if !dc.closed { + t.Errorf("conn should be closed") + } + if dc.ci != nil { + t.Errorf("after Stmt Close, driverConn's Conn interface should be nil") + } +} + +// golang.org/issue/5283: don't release the Rows' connection in Close +// before calling Stmt.Close. +func TestRowsCloseOrder(t *testing.T) { + db := newTestDB(t, "people") + defer closeDB(t, db) + + db.SetMaxIdleConns(0) + setStrictFakeConnClose(t) + defer setStrictFakeConnClose(nil) + + rows, err := db.Query("SELECT|people|age,name|") + if err != nil { + t.Fatal(err) + } + err = rows.Close() + if err != nil { + t.Fatal(err) + } +} + +func TestRowsImplicitClose(t *testing.T) { + db := newTestDB(t, "people") + defer closeDB(t, db) + + rows, err := db.Query("SELECT|people|age,name|") + if err != nil { + t.Fatal(err) + } + + want, fail := 2, errors.New("fail") + r := rows.rowsi.(*rowsCursor) + r.errPos, r.err = want, fail + + got := 0 + for rows.Next() { + got++ + } + if got != want { + t.Errorf("got %d rows, want %d", got, want) + } + if err := rows.Err(); err != fail { + t.Errorf("got error %v, want %v", err, fail) + } + if !r.closed { + t.Errorf("r.closed is false, want true") + } +} + +func TestStmtCloseOrder(t *testing.T) { + db := newTestDB(t, "people") + defer closeDB(t, db) + + db.SetMaxIdleConns(0) + setStrictFakeConnClose(t) + defer setStrictFakeConnClose(nil) + + _, err := db.Query("SELECT|non_existent|name|") + if err == nil { + t.Fatal("Quering non-existent table should fail") + } +} + +// Test cases where there's more than maxBadConnRetries bad connections in the +// pool (issue 8834) +func TestManyErrBadConn(t *testing.T) { + manyErrBadConnSetup := func() *DB { + db := newTestDB(t, "people") + + nconn := maxBadConnRetries + 1 + db.SetMaxIdleConns(nconn) + db.SetMaxOpenConns(nconn) + // open enough connections + func() { + for i := 0; i < nconn; i++ { + rows, err := db.Query("SELECT|people|age,name|") + if err != nil { + t.Fatal(err) + } + defer rows.Close() + } + }() + + if db.numOpen != nconn { + t.Fatalf("unexpected numOpen %d (was expecting %d)", db.numOpen, nconn) + } else if len(db.freeConn) != nconn { + t.Fatalf("unexpected len(db.freeConn) %d (was expecting %d)", len(db.freeConn), nconn) + } + for _, conn := range db.freeConn { + conn.ci.(*fakeConn).stickyBad = true + } + return db + } + + // Query + db := manyErrBadConnSetup() + defer closeDB(t, db) + rows, err := db.Query("SELECT|people|age,name|") + if err != nil { + t.Fatal(err) + } + if err = rows.Close(); err != nil { + t.Fatal(err) + } + + // Exec + db = manyErrBadConnSetup() + defer closeDB(t, db) + _, err = db.Exec("INSERT|people|name=Julia,age=19") + if err != nil { + t.Fatal(err) + } + + // Begin + db = manyErrBadConnSetup() + defer closeDB(t, db) + tx, err := db.Begin() + if err != nil { + t.Fatal(err) + } + if err = tx.Rollback(); err != nil { + t.Fatal(err) + } + + // Prepare + db = manyErrBadConnSetup() + defer closeDB(t, db) + stmt, err := db.Prepare("SELECT|people|age,name|") + if err != nil { + t.Fatal(err) + } + if err = stmt.Close(); err != nil { + t.Fatal(err) + } +} + +// golang.org/issue/5718 +func TestErrBadConnReconnect(t *testing.T) { + db := newTestDB(t, "foo") + defer closeDB(t, db) + exec(t, db, "CREATE|t1|name=string,age=int32,dead=bool") + + simulateBadConn := func(name string, hook *func() bool, op func() error) { + broken, retried := false, false + numOpen := db.numOpen + + // simulate a broken connection on the first try + *hook = func() bool { + if !broken { + broken = true + return true + } + retried = true + return false + } + + if err := op(); err != nil { + t.Errorf(name+": %v", err) + return + } + + if !broken || !retried { + t.Error(name + ": Failed to simulate broken connection") + } + *hook = nil + + if numOpen != db.numOpen { + t.Errorf(name+": leaked %d connection(s)!", db.numOpen-numOpen) + numOpen = db.numOpen + } + } + + // db.Exec + dbExec := func() error { + _, err := db.Exec("INSERT|t1|name=?,age=?,dead=?", "Gordon", 3, true) + return err + } + simulateBadConn("db.Exec prepare", &hookPrepareBadConn, dbExec) + simulateBadConn("db.Exec exec", &hookExecBadConn, dbExec) + + // db.Query + dbQuery := func() error { + rows, err := db.Query("SELECT|t1|age,name|") + if err == nil { + err = rows.Close() + } + return err + } + simulateBadConn("db.Query prepare", &hookPrepareBadConn, dbQuery) + simulateBadConn("db.Query query", &hookQueryBadConn, dbQuery) + + // db.Prepare + simulateBadConn("db.Prepare", &hookPrepareBadConn, func() error { + stmt, err := db.Prepare("INSERT|t1|name=?,age=?,dead=?") + if err != nil { + return err + } + stmt.Close() + return nil + }) + + // Provide a way to force a re-prepare of a statement on next execution + forcePrepare := func(stmt *Stmt) { + stmt.css = nil + } + + // stmt.Exec + stmt1, err := db.Prepare("INSERT|t1|name=?,age=?,dead=?") + if err != nil { + t.Fatalf("prepare: %v", err) + } + defer stmt1.Close() + // make sure we must prepare the stmt first + forcePrepare(stmt1) + + stmtExec := func() error { + _, err := stmt1.Exec("Gopher", 3, false) + return err + } + simulateBadConn("stmt.Exec prepare", &hookPrepareBadConn, stmtExec) + simulateBadConn("stmt.Exec exec", &hookExecBadConn, stmtExec) + + // stmt.Query + stmt2, err := db.Prepare("SELECT|t1|age,name|") + if err != nil { + t.Fatalf("prepare: %v", err) + } + defer stmt2.Close() + // make sure we must prepare the stmt first + forcePrepare(stmt2) + + stmtQuery := func() error { + rows, err := stmt2.Query() + if err == nil { + err = rows.Close() + } + return err + } + simulateBadConn("stmt.Query prepare", &hookPrepareBadConn, stmtQuery) + simulateBadConn("stmt.Query exec", &hookQueryBadConn, stmtQuery) +} + +type concurrentTest interface { + init(t testing.TB, db *DB) + finish(t testing.TB) + test(t testing.TB) error +} + +type concurrentDBQueryTest struct { + db *DB +} + +func (c *concurrentDBQueryTest) init(t testing.TB, db *DB) { + c.db = db +} + +func (c *concurrentDBQueryTest) finish(t testing.TB) { + c.db = nil +} + +func (c *concurrentDBQueryTest) test(t testing.TB) error { + rows, err := c.db.Query("SELECT|people|name|") + if err != nil { + t.Error(err) + return err + } + var name string + for rows.Next() { + rows.Scan(&name) + } + rows.Close() + return nil +} + +type concurrentDBExecTest struct { + db *DB +} + +func (c *concurrentDBExecTest) init(t testing.TB, db *DB) { + c.db = db +} + +func (c *concurrentDBExecTest) finish(t testing.TB) { + c.db = nil +} + +func (c *concurrentDBExecTest) test(t testing.TB) error { + _, err := c.db.Exec("NOSERT|people|name=Chris,age=?,photo=CPHOTO,bdate=?", 3, chrisBirthday) + if err != nil { + t.Error(err) + return err + } + return nil +} + +type concurrentStmtQueryTest struct { + db *DB + stmt *Stmt +} + +func (c *concurrentStmtQueryTest) init(t testing.TB, db *DB) { + c.db = db + var err error + c.stmt, err = db.Prepare("SELECT|people|name|") + if err != nil { + t.Fatal(err) + } +} + +func (c *concurrentStmtQueryTest) finish(t testing.TB) { + if c.stmt != nil { + c.stmt.Close() + c.stmt = nil + } + c.db = nil +} + +func (c *concurrentStmtQueryTest) test(t testing.TB) error { + rows, err := c.stmt.Query() + if err != nil { + t.Errorf("error on query: %v", err) + return err + } + + var name string + for rows.Next() { + rows.Scan(&name) + } + rows.Close() + return nil +} + +type concurrentStmtExecTest struct { + db *DB + stmt *Stmt +} + +func (c *concurrentStmtExecTest) init(t testing.TB, db *DB) { + c.db = db + var err error + c.stmt, err = db.Prepare("NOSERT|people|name=Chris,age=?,photo=CPHOTO,bdate=?") + if err != nil { + t.Fatal(err) + } +} + +func (c *concurrentStmtExecTest) finish(t testing.TB) { + if c.stmt != nil { + c.stmt.Close() + c.stmt = nil + } + c.db = nil +} + +func (c *concurrentStmtExecTest) test(t testing.TB) error { + _, err := c.stmt.Exec(3, chrisBirthday) + if err != nil { + t.Errorf("error on exec: %v", err) + return err + } + return nil +} + +type concurrentTxQueryTest struct { + db *DB + tx *Tx +} + +func (c *concurrentTxQueryTest) init(t testing.TB, db *DB) { + c.db = db + var err error + c.tx, err = c.db.Begin() + if err != nil { + t.Fatal(err) + } +} + +func (c *concurrentTxQueryTest) finish(t testing.TB) { + if c.tx != nil { + c.tx.Rollback() + c.tx = nil + } + c.db = nil +} + +func (c *concurrentTxQueryTest) test(t testing.TB) error { + rows, err := c.db.Query("SELECT|people|name|") + if err != nil { + t.Error(err) + return err + } + var name string + for rows.Next() { + rows.Scan(&name) + } + rows.Close() + return nil +} + +type concurrentTxExecTest struct { + db *DB + tx *Tx +} + +func (c *concurrentTxExecTest) init(t testing.TB, db *DB) { + c.db = db + var err error + c.tx, err = c.db.Begin() + if err != nil { + t.Fatal(err) + } +} + +func (c *concurrentTxExecTest) finish(t testing.TB) { + if c.tx != nil { + c.tx.Rollback() + c.tx = nil + } + c.db = nil +} + +func (c *concurrentTxExecTest) test(t testing.TB) error { + _, err := c.tx.Exec("NOSERT|people|name=Chris,age=?,photo=CPHOTO,bdate=?", 3, chrisBirthday) + if err != nil { + t.Error(err) + return err + } + return nil +} + +type concurrentTxStmtQueryTest struct { + db *DB + tx *Tx + stmt *Stmt +} + +func (c *concurrentTxStmtQueryTest) init(t testing.TB, db *DB) { + c.db = db + var err error + c.tx, err = c.db.Begin() + if err != nil { + t.Fatal(err) + } + c.stmt, err = c.tx.Prepare("SELECT|people|name|") + if err != nil { + t.Fatal(err) + } +} + +func (c *concurrentTxStmtQueryTest) finish(t testing.TB) { + if c.stmt != nil { + c.stmt.Close() + c.stmt = nil + } + if c.tx != nil { + c.tx.Rollback() + c.tx = nil + } + c.db = nil +} + +func (c *concurrentTxStmtQueryTest) test(t testing.TB) error { + rows, err := c.stmt.Query() + if err != nil { + t.Errorf("error on query: %v", err) + return err + } + + var name string + for rows.Next() { + rows.Scan(&name) + } + rows.Close() + return nil +} + +type concurrentTxStmtExecTest struct { + db *DB + tx *Tx + stmt *Stmt +} + +func (c *concurrentTxStmtExecTest) init(t testing.TB, db *DB) { + c.db = db + var err error + c.tx, err = c.db.Begin() + if err != nil { + t.Fatal(err) + } + c.stmt, err = c.tx.Prepare("NOSERT|people|name=Chris,age=?,photo=CPHOTO,bdate=?") + if err != nil { + t.Fatal(err) + } +} + +func (c *concurrentTxStmtExecTest) finish(t testing.TB) { + if c.stmt != nil { + c.stmt.Close() + c.stmt = nil + } + if c.tx != nil { + c.tx.Rollback() + c.tx = nil + } + c.db = nil +} + +func (c *concurrentTxStmtExecTest) test(t testing.TB) error { + _, err := c.stmt.Exec(3, chrisBirthday) + if err != nil { + t.Errorf("error on exec: %v", err) + return err + } + return nil +} + +type concurrentRandomTest struct { + tests []concurrentTest +} + +func (c *concurrentRandomTest) init(t testing.TB, db *DB) { + c.tests = []concurrentTest{ + new(concurrentDBQueryTest), + new(concurrentDBExecTest), + new(concurrentStmtQueryTest), + new(concurrentStmtExecTest), + new(concurrentTxQueryTest), + new(concurrentTxExecTest), + new(concurrentTxStmtQueryTest), + new(concurrentTxStmtExecTest), + } + for _, ct := range c.tests { + ct.init(t, db) + } +} + +func (c *concurrentRandomTest) finish(t testing.TB) { + for _, ct := range c.tests { + ct.finish(t) + } +} + +func (c *concurrentRandomTest) test(t testing.TB) error { + ct := c.tests[rand.Intn(len(c.tests))] + return ct.test(t) +} + +func doConcurrentTest(t testing.TB, ct concurrentTest) { + maxProcs, numReqs := 1, 500 + if testing.Short() { + maxProcs, numReqs = 4, 50 + } + defer runtime.GOMAXPROCS(runtime.GOMAXPROCS(maxProcs)) + + db := newTestDB(t, "people") + defer closeDB(t, db) + + ct.init(t, db) + defer ct.finish(t) + + var wg sync.WaitGroup + wg.Add(numReqs) + + reqs := make(chan bool) + defer close(reqs) + + for i := 0; i < maxProcs*2; i++ { + go func() { + for range reqs { + err := ct.test(t) + if err != nil { + wg.Done() + continue + } + wg.Done() + } + }() + } + + for i := 0; i < numReqs; i++ { + reqs <- true + } + + wg.Wait() +} + +func TestIssue6081(t *testing.T) { + db := newTestDB(t, "people") + defer closeDB(t, db) + + drv := db.driver.(*fakeDriver) + drv.mu.Lock() + opens0 := drv.openCount + closes0 := drv.closeCount + drv.mu.Unlock() + + stmt, err := db.Prepare("SELECT|people|name|") + if err != nil { + t.Fatal(err) + } + rowsCloseHook = func(rows *Rows, err *error) { + *err = driver.ErrBadConn + } + defer func() { rowsCloseHook = nil }() + for i := 0; i < 10; i++ { + rows, err := stmt.Query() + if err != nil { + t.Fatal(err) + } + rows.Close() + } + if n := len(stmt.css); n > 1 { + t.Errorf("len(css slice) = %d; want <= 1", n) + } + stmt.Close() + if n := len(stmt.css); n != 0 { + t.Errorf("len(css slice) after Close = %d; want 0", n) + } + + drv.mu.Lock() + opens := drv.openCount - opens0 + closes := drv.closeCount - closes0 + drv.mu.Unlock() + if opens < 9 { + t.Errorf("opens = %d; want >= 9", opens) + } + if closes < 9 { + t.Errorf("closes = %d; want >= 9", closes) + } +} + +func TestConcurrency(t *testing.T) { + doConcurrentTest(t, new(concurrentDBQueryTest)) + doConcurrentTest(t, new(concurrentDBExecTest)) + doConcurrentTest(t, new(concurrentStmtQueryTest)) + doConcurrentTest(t, new(concurrentStmtExecTest)) + doConcurrentTest(t, new(concurrentTxQueryTest)) + doConcurrentTest(t, new(concurrentTxExecTest)) + doConcurrentTest(t, new(concurrentTxStmtQueryTest)) + doConcurrentTest(t, new(concurrentTxStmtExecTest)) + doConcurrentTest(t, new(concurrentRandomTest)) +} + +func TestConnectionLeak(t *testing.T) { + db := newTestDB(t, "people") + defer closeDB(t, db) + // Start by opening defaultMaxIdleConns + rows := make([]*Rows, defaultMaxIdleConns) + // We need to SetMaxOpenConns > MaxIdleConns, so the DB can open + // a new connection and we can fill the idle queue with the released + // connections. + db.SetMaxOpenConns(len(rows) + 1) + for ii := range rows { + r, err := db.Query("SELECT|people|name|") + if err != nil { + t.Fatal(err) + } + r.Next() + if err := r.Err(); err != nil { + t.Fatal(err) + } + rows[ii] = r + } + // Now we have defaultMaxIdleConns busy connections. Open + // a new one, but wait until the busy connections are released + // before returning control to DB. + drv := db.driver.(*fakeDriver) + drv.waitCh = make(chan struct{}, 1) + drv.waitingCh = make(chan struct{}, 1) + var wg sync.WaitGroup + wg.Add(1) + go func() { + r, err := db.Query("SELECT|people|name|") + if err != nil { + t.Fatal(err) + } + r.Close() + wg.Done() + }() + // Wait until the goroutine we've just created has started waiting. + <-drv.waitingCh + // Now close the busy connections. This provides a connection for + // the blocked goroutine and then fills up the idle queue. + for _, v := range rows { + v.Close() + } + // At this point we give the new connection to DB. This connection is + // now useless, since the idle queue is full and there are no pending + // requests. DB should deal with this situation without leaking the + // connection. + drv.waitCh <- struct{}{} + wg.Wait() +} + +func BenchmarkConcurrentDBExec(b *testing.B) { + b.ReportAllocs() + ct := new(concurrentDBExecTest) + for i := 0; i < b.N; i++ { + doConcurrentTest(b, ct) + } +} + +func BenchmarkConcurrentStmtQuery(b *testing.B) { + b.ReportAllocs() + ct := new(concurrentStmtQueryTest) + for i := 0; i < b.N; i++ { + doConcurrentTest(b, ct) + } +} + +func BenchmarkConcurrentStmtExec(b *testing.B) { + b.ReportAllocs() + ct := new(concurrentStmtExecTest) + for i := 0; i < b.N; i++ { + doConcurrentTest(b, ct) + } +} + +func BenchmarkConcurrentTxQuery(b *testing.B) { + b.ReportAllocs() + ct := new(concurrentTxQueryTest) + for i := 0; i < b.N; i++ { + doConcurrentTest(b, ct) + } +} + +func BenchmarkConcurrentTxExec(b *testing.B) { + b.ReportAllocs() + ct := new(concurrentTxExecTest) + for i := 0; i < b.N; i++ { + doConcurrentTest(b, ct) + } +} + +func BenchmarkConcurrentTxStmtQuery(b *testing.B) { + b.ReportAllocs() + ct := new(concurrentTxStmtQueryTest) + for i := 0; i < b.N; i++ { + doConcurrentTest(b, ct) + } +} + +func BenchmarkConcurrentTxStmtExec(b *testing.B) { + b.ReportAllocs() + ct := new(concurrentTxStmtExecTest) + for i := 0; i < b.N; i++ { + doConcurrentTest(b, ct) + } +} + +func BenchmarkConcurrentRandom(b *testing.B) { + b.ReportAllocs() + ct := new(concurrentRandomTest) + for i := 0; i < b.N; i++ { + doConcurrentTest(b, ct) + } +} + +func BenchmarkManyConcurrentQueries(b *testing.B) { + b.ReportAllocs() + // To see lock contention in Go 1.4, 16~ cores and 128~ goroutines are required. + const parallelism = 16 + + db := newTestDB(b, "magicquery") + defer closeDB(b, db) + db.SetMaxIdleConns(runtime.GOMAXPROCS(0) * parallelism) + + stmt, err := db.Prepare("SELECT|magicquery|op|op=?,millis=?") + if err != nil { + b.Fatal(err) + } + defer stmt.Close() + + b.SetParallelism(parallelism) + b.RunParallel(func(pb *testing.PB) { + for pb.Next() { + rows, err := stmt.Query("sleep", 1) + if err != nil { + b.Error(err) + return + } + rows.Close() + } + }) +} diff --git a/src/debug/dwarf/buf.go b/src/debug/dwarf/buf.go new file mode 100644 index 0000000000000000000000000000000000000000..2ade0bd76ad6eabef752953016a6445205e3762a --- /dev/null +++ b/src/debug/dwarf/buf.go @@ -0,0 +1,192 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Buffered reading and decoding of DWARF data streams. + +package dwarf + +import ( + "encoding/binary" + "strconv" +) + +// Data buffer being decoded. +type buf struct { + dwarf *Data + order binary.ByteOrder + format dataFormat + name string + off Offset + data []byte + err error +} + +// Data format, other than byte order. This affects the handling of +// certain field formats. +type dataFormat interface { + // DWARF version number. Zero means unknown. + version() int + + // 64-bit DWARF format? + dwarf64() (dwarf64 bool, isKnown bool) + + // Size of an address, in bytes. Zero means unknown. + addrsize() int +} + +// Some parts of DWARF have no data format, e.g., abbrevs. +type unknownFormat struct{} + +func (u unknownFormat) version() int { + return 0 +} + +func (u unknownFormat) dwarf64() (bool, bool) { + return false, false +} + +func (u unknownFormat) addrsize() int { + return 0 +} + +func makeBuf(d *Data, format dataFormat, name string, off Offset, data []byte) buf { + return buf{d, d.order, format, name, off, data, nil} +} + +func (b *buf) uint8() uint8 { + if len(b.data) < 1 { + b.error("underflow") + return 0 + } + val := b.data[0] + b.data = b.data[1:] + b.off++ + return val +} + +func (b *buf) bytes(n int) []byte { + if len(b.data) < n { + b.error("underflow") + return nil + } + data := b.data[0:n] + b.data = b.data[n:] + b.off += Offset(n) + return data +} + +func (b *buf) skip(n int) { b.bytes(n) } + +func (b *buf) string() string { + for i := 0; i < len(b.data); i++ { + if b.data[i] == 0 { + s := string(b.data[0:i]) + b.data = b.data[i+1:] + b.off += Offset(i + 1) + return s + } + } + b.error("underflow") + return "" +} + +func (b *buf) uint16() uint16 { + a := b.bytes(2) + if a == nil { + return 0 + } + return b.order.Uint16(a) +} + +func (b *buf) uint32() uint32 { + a := b.bytes(4) + if a == nil { + return 0 + } + return b.order.Uint32(a) +} + +func (b *buf) uint64() uint64 { + a := b.bytes(8) + if a == nil { + return 0 + } + return b.order.Uint64(a) +} + +// Read a varint, which is 7 bits per byte, little endian. +// the 0x80 bit means read another byte. +func (b *buf) varint() (c uint64, bits uint) { + for i := 0; i < len(b.data); i++ { + byte := b.data[i] + c |= uint64(byte&0x7F) << bits + bits += 7 + if byte&0x80 == 0 { + b.off += Offset(i + 1) + b.data = b.data[i+1:] + return c, bits + } + } + return 0, 0 +} + +// Unsigned int is just a varint. +func (b *buf) uint() uint64 { + x, _ := b.varint() + return x +} + +// Signed int is a sign-extended varint. +func (b *buf) int() int64 { + ux, bits := b.varint() + x := int64(ux) + if x&(1<<(bits-1)) != 0 { + x |= -1 << bits + } + return x +} + +// Address-sized uint. +func (b *buf) addr() uint64 { + switch b.format.addrsize() { + case 1: + return uint64(b.uint8()) + case 2: + return uint64(b.uint16()) + case 4: + return uint64(b.uint32()) + case 8: + return uint64(b.uint64()) + } + b.error("unknown address size") + return 0 +} + +func (b *buf) unitLength() (length Offset, dwarf64 bool) { + length = Offset(b.uint32()) + if length == 0xffffffff { + dwarf64 = true + length = Offset(b.uint64()) + } else if length >= 0xfffffff0 { + b.error("unit length has reserved value") + } + return +} + +func (b *buf) error(s string) { + if b.err == nil { + b.data = nil + b.err = DecodeError{b.name, b.off, s} + } +} + +type DecodeError struct { + Name string + Offset Offset + Err string +} + +func (e DecodeError) Error() string { + return "decoding dwarf section " + e.Name + " at offset 0x" + strconv.FormatInt(int64(e.Offset), 16) + ": " + e.Err +} diff --git a/src/debug/dwarf/class_string.go b/src/debug/dwarf/class_string.go new file mode 100644 index 0000000000000000000000000000000000000000..0b1206b9f3daf08388f77fbd433d08a07b3e5a6c --- /dev/null +++ b/src/debug/dwarf/class_string.go @@ -0,0 +1,17 @@ +// generated by stringer -type=Class; DO NOT EDIT + +package dwarf + +import "fmt" + +const _Class_name = "ClassAddressClassBlockClassConstantClassExprLocClassFlagClassLinePtrClassLocListPtrClassMacPtrClassRangeListPtrClassReferenceClassReferenceSigClassStringClassReferenceAltClassStringAlt" + +var _Class_index = [...]uint8{0, 12, 22, 35, 47, 56, 68, 83, 94, 111, 125, 142, 153, 170, 184} + +func (i Class) String() string { + i -= 1 + if i < 0 || i+1 >= Class(len(_Class_index)) { + return fmt.Sprintf("Class(%d)", i+1) + } + return _Class_name[_Class_index[i]:_Class_index[i+1]] +} diff --git a/src/debug/dwarf/const.go b/src/debug/dwarf/const.go new file mode 100644 index 0000000000000000000000000000000000000000..2170db1e32dc7a53cfb7972a3bac10c5f77d7400 --- /dev/null +++ b/src/debug/dwarf/const.go @@ -0,0 +1,482 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Constants + +package dwarf + +import "strconv" + +// An Attr identifies the attribute type in a DWARF Entry's Field. +type Attr uint32 + +const ( + AttrSibling Attr = 0x01 + AttrLocation Attr = 0x02 + AttrName Attr = 0x03 + AttrOrdering Attr = 0x09 + AttrByteSize Attr = 0x0B + AttrBitOffset Attr = 0x0C + AttrBitSize Attr = 0x0D + AttrStmtList Attr = 0x10 + AttrLowpc Attr = 0x11 + AttrHighpc Attr = 0x12 + AttrLanguage Attr = 0x13 + AttrDiscr Attr = 0x15 + AttrDiscrValue Attr = 0x16 + AttrVisibility Attr = 0x17 + AttrImport Attr = 0x18 + AttrStringLength Attr = 0x19 + AttrCommonRef Attr = 0x1A + AttrCompDir Attr = 0x1B + AttrConstValue Attr = 0x1C + AttrContainingType Attr = 0x1D + AttrDefaultValue Attr = 0x1E + AttrInline Attr = 0x20 + AttrIsOptional Attr = 0x21 + AttrLowerBound Attr = 0x22 + AttrProducer Attr = 0x25 + AttrPrototyped Attr = 0x27 + AttrReturnAddr Attr = 0x2A + AttrStartScope Attr = 0x2C + AttrStrideSize Attr = 0x2E + AttrUpperBound Attr = 0x2F + AttrAbstractOrigin Attr = 0x31 + AttrAccessibility Attr = 0x32 + AttrAddrClass Attr = 0x33 + AttrArtificial Attr = 0x34 + AttrBaseTypes Attr = 0x35 + AttrCalling Attr = 0x36 + AttrCount Attr = 0x37 + AttrDataMemberLoc Attr = 0x38 + AttrDeclColumn Attr = 0x39 + AttrDeclFile Attr = 0x3A + AttrDeclLine Attr = 0x3B + AttrDeclaration Attr = 0x3C + AttrDiscrList Attr = 0x3D + AttrEncoding Attr = 0x3E + AttrExternal Attr = 0x3F + AttrFrameBase Attr = 0x40 + AttrFriend Attr = 0x41 + AttrIdentifierCase Attr = 0x42 + AttrMacroInfo Attr = 0x43 + AttrNamelistItem Attr = 0x44 + AttrPriority Attr = 0x45 + AttrSegment Attr = 0x46 + AttrSpecification Attr = 0x47 + AttrStaticLink Attr = 0x48 + AttrType Attr = 0x49 + AttrUseLocation Attr = 0x4A + AttrVarParam Attr = 0x4B + AttrVirtuality Attr = 0x4C + AttrVtableElemLoc Attr = 0x4D + AttrAllocated Attr = 0x4E + AttrAssociated Attr = 0x4F + AttrDataLocation Attr = 0x50 + AttrStride Attr = 0x51 + AttrEntrypc Attr = 0x52 + AttrUseUTF8 Attr = 0x53 + AttrExtension Attr = 0x54 + AttrRanges Attr = 0x55 + AttrTrampoline Attr = 0x56 + AttrCallColumn Attr = 0x57 + AttrCallFile Attr = 0x58 + AttrCallLine Attr = 0x59 + AttrDescription Attr = 0x5A +) + +var attrNames = [...]string{ + AttrSibling: "Sibling", + AttrLocation: "Location", + AttrName: "Name", + AttrOrdering: "Ordering", + AttrByteSize: "ByteSize", + AttrBitOffset: "BitOffset", + AttrBitSize: "BitSize", + AttrStmtList: "StmtList", + AttrLowpc: "Lowpc", + AttrHighpc: "Highpc", + AttrLanguage: "Language", + AttrDiscr: "Discr", + AttrDiscrValue: "DiscrValue", + AttrVisibility: "Visibility", + AttrImport: "Import", + AttrStringLength: "StringLength", + AttrCommonRef: "CommonRef", + AttrCompDir: "CompDir", + AttrConstValue: "ConstValue", + AttrContainingType: "ContainingType", + AttrDefaultValue: "DefaultValue", + AttrInline: "Inline", + AttrIsOptional: "IsOptional", + AttrLowerBound: "LowerBound", + AttrProducer: "Producer", + AttrPrototyped: "Prototyped", + AttrReturnAddr: "ReturnAddr", + AttrStartScope: "StartScope", + AttrStrideSize: "StrideSize", + AttrUpperBound: "UpperBound", + AttrAbstractOrigin: "AbstractOrigin", + AttrAccessibility: "Accessibility", + AttrAddrClass: "AddrClass", + AttrArtificial: "Artificial", + AttrBaseTypes: "BaseTypes", + AttrCalling: "Calling", + AttrCount: "Count", + AttrDataMemberLoc: "DataMemberLoc", + AttrDeclColumn: "DeclColumn", + AttrDeclFile: "DeclFile", + AttrDeclLine: "DeclLine", + AttrDeclaration: "Declaration", + AttrDiscrList: "DiscrList", + AttrEncoding: "Encoding", + AttrExternal: "External", + AttrFrameBase: "FrameBase", + AttrFriend: "Friend", + AttrIdentifierCase: "IdentifierCase", + AttrMacroInfo: "MacroInfo", + AttrNamelistItem: "NamelistItem", + AttrPriority: "Priority", + AttrSegment: "Segment", + AttrSpecification: "Specification", + AttrStaticLink: "StaticLink", + AttrType: "Type", + AttrUseLocation: "UseLocation", + AttrVarParam: "VarParam", + AttrVirtuality: "Virtuality", + AttrVtableElemLoc: "VtableElemLoc", + AttrAllocated: "Allocated", + AttrAssociated: "Associated", + AttrDataLocation: "DataLocation", + AttrStride: "Stride", + AttrEntrypc: "Entrypc", + AttrUseUTF8: "UseUTF8", + AttrExtension: "Extension", + AttrRanges: "Ranges", + AttrTrampoline: "Trampoline", + AttrCallColumn: "CallColumn", + AttrCallFile: "CallFile", + AttrCallLine: "CallLine", + AttrDescription: "Description", +} + +func (a Attr) String() string { + if int(a) < len(attrNames) { + s := attrNames[a] + if s != "" { + return s + } + } + return strconv.Itoa(int(a)) +} + +func (a Attr) GoString() string { + if int(a) < len(attrNames) { + s := attrNames[a] + if s != "" { + return "dwarf.Attr" + s + } + } + return "dwarf.Attr(" + strconv.FormatInt(int64(a), 10) + ")" +} + +// A format is a DWARF data encoding format. +type format uint32 + +const ( + // value formats + formAddr format = 0x01 + formDwarfBlock2 format = 0x03 + formDwarfBlock4 format = 0x04 + formData2 format = 0x05 + formData4 format = 0x06 + formData8 format = 0x07 + formString format = 0x08 + formDwarfBlock format = 0x09 + formDwarfBlock1 format = 0x0A + formData1 format = 0x0B + formFlag format = 0x0C + formSdata format = 0x0D + formStrp format = 0x0E + formUdata format = 0x0F + formRefAddr format = 0x10 + formRef1 format = 0x11 + formRef2 format = 0x12 + formRef4 format = 0x13 + formRef8 format = 0x14 + formRefUdata format = 0x15 + formIndirect format = 0x16 + // The following are new in DWARF 4. + formSecOffset format = 0x17 + formExprloc format = 0x18 + formFlagPresent format = 0x19 + formRefSig8 format = 0x20 + // Extensions for multi-file compression (.dwz) + // http://www.dwarfstd.org/ShowIssue.php?issue=120604.1 + formGnuRefAlt format = 0x1f20 + formGnuStrpAlt format = 0x1f21 +) + +// A Tag is the classification (the type) of an Entry. +type Tag uint32 + +const ( + TagArrayType Tag = 0x01 + TagClassType Tag = 0x02 + TagEntryPoint Tag = 0x03 + TagEnumerationType Tag = 0x04 + TagFormalParameter Tag = 0x05 + TagImportedDeclaration Tag = 0x08 + TagLabel Tag = 0x0A + TagLexDwarfBlock Tag = 0x0B + TagMember Tag = 0x0D + TagPointerType Tag = 0x0F + TagReferenceType Tag = 0x10 + TagCompileUnit Tag = 0x11 + TagStringType Tag = 0x12 + TagStructType Tag = 0x13 + TagSubroutineType Tag = 0x15 + TagTypedef Tag = 0x16 + TagUnionType Tag = 0x17 + TagUnspecifiedParameters Tag = 0x18 + TagVariant Tag = 0x19 + TagCommonDwarfBlock Tag = 0x1A + TagCommonInclusion Tag = 0x1B + TagInheritance Tag = 0x1C + TagInlinedSubroutine Tag = 0x1D + TagModule Tag = 0x1E + TagPtrToMemberType Tag = 0x1F + TagSetType Tag = 0x20 + TagSubrangeType Tag = 0x21 + TagWithStmt Tag = 0x22 + TagAccessDeclaration Tag = 0x23 + TagBaseType Tag = 0x24 + TagCatchDwarfBlock Tag = 0x25 + TagConstType Tag = 0x26 + TagConstant Tag = 0x27 + TagEnumerator Tag = 0x28 + TagFileType Tag = 0x29 + TagFriend Tag = 0x2A + TagNamelist Tag = 0x2B + TagNamelistItem Tag = 0x2C + TagPackedType Tag = 0x2D + TagSubprogram Tag = 0x2E + TagTemplateTypeParameter Tag = 0x2F + TagTemplateValueParameter Tag = 0x30 + TagThrownType Tag = 0x31 + TagTryDwarfBlock Tag = 0x32 + TagVariantPart Tag = 0x33 + TagVariable Tag = 0x34 + TagVolatileType Tag = 0x35 + // The following are new in DWARF 3. + TagDwarfProcedure Tag = 0x36 + TagRestrictType Tag = 0x37 + TagInterfaceType Tag = 0x38 + TagNamespace Tag = 0x39 + TagImportedModule Tag = 0x3A + TagUnspecifiedType Tag = 0x3B + TagPartialUnit Tag = 0x3C + TagImportedUnit Tag = 0x3D + TagMutableType Tag = 0x3E // Later removed from DWARF. + TagCondition Tag = 0x3F + TagSharedType Tag = 0x40 + // The following are new in DWARF 4. + TagTypeUnit Tag = 0x41 + TagRvalueReferenceType Tag = 0x42 + TagTemplateAlias Tag = 0x43 +) + +var tagNames = [...]string{ + TagArrayType: "ArrayType", + TagClassType: "ClassType", + TagEntryPoint: "EntryPoint", + TagEnumerationType: "EnumerationType", + TagFormalParameter: "FormalParameter", + TagImportedDeclaration: "ImportedDeclaration", + TagLabel: "Label", + TagLexDwarfBlock: "LexDwarfBlock", + TagMember: "Member", + TagPointerType: "PointerType", + TagReferenceType: "ReferenceType", + TagCompileUnit: "CompileUnit", + TagStringType: "StringType", + TagStructType: "StructType", + TagSubroutineType: "SubroutineType", + TagTypedef: "Typedef", + TagUnionType: "UnionType", + TagUnspecifiedParameters: "UnspecifiedParameters", + TagVariant: "Variant", + TagCommonDwarfBlock: "CommonDwarfBlock", + TagCommonInclusion: "CommonInclusion", + TagInheritance: "Inheritance", + TagInlinedSubroutine: "InlinedSubroutine", + TagModule: "Module", + TagPtrToMemberType: "PtrToMemberType", + TagSetType: "SetType", + TagSubrangeType: "SubrangeType", + TagWithStmt: "WithStmt", + TagAccessDeclaration: "AccessDeclaration", + TagBaseType: "BaseType", + TagCatchDwarfBlock: "CatchDwarfBlock", + TagConstType: "ConstType", + TagConstant: "Constant", + TagEnumerator: "Enumerator", + TagFileType: "FileType", + TagFriend: "Friend", + TagNamelist: "Namelist", + TagNamelistItem: "NamelistItem", + TagPackedType: "PackedType", + TagSubprogram: "Subprogram", + TagTemplateTypeParameter: "TemplateTypeParameter", + TagTemplateValueParameter: "TemplateValueParameter", + TagThrownType: "ThrownType", + TagTryDwarfBlock: "TryDwarfBlock", + TagVariantPart: "VariantPart", + TagVariable: "Variable", + TagVolatileType: "VolatileType", + TagDwarfProcedure: "DwarfProcedure", + TagRestrictType: "RestrictType", + TagInterfaceType: "InterfaceType", + TagNamespace: "Namespace", + TagImportedModule: "ImportedModule", + TagUnspecifiedType: "UnspecifiedType", + TagPartialUnit: "PartialUnit", + TagImportedUnit: "ImportedUnit", + TagMutableType: "MutableType", + TagCondition: "Condition", + TagSharedType: "SharedType", + TagTypeUnit: "TypeUnit", + TagRvalueReferenceType: "RvalueReferenceType", + TagTemplateAlias: "TemplateAlias", +} + +func (t Tag) String() string { + if int(t) < len(tagNames) { + s := tagNames[t] + if s != "" { + return s + } + } + return strconv.Itoa(int(t)) +} + +func (t Tag) GoString() string { + if int(t) < len(tagNames) { + s := tagNames[t] + if s != "" { + return "dwarf.Tag" + s + } + } + return "dwarf.Tag(" + strconv.FormatInt(int64(t), 10) + ")" +} + +// Location expression operators. +// The debug info encodes value locations like 8(R3) +// as a sequence of these op codes. +// This package does not implement full expressions; +// the opPlusUconst operator is expected by the type parser. +const ( + opAddr = 0x03 /* 1 op, const addr */ + opDeref = 0x06 + opConst1u = 0x08 /* 1 op, 1 byte const */ + opConst1s = 0x09 /* " signed */ + opConst2u = 0x0A /* 1 op, 2 byte const */ + opConst2s = 0x0B /* " signed */ + opConst4u = 0x0C /* 1 op, 4 byte const */ + opConst4s = 0x0D /* " signed */ + opConst8u = 0x0E /* 1 op, 8 byte const */ + opConst8s = 0x0F /* " signed */ + opConstu = 0x10 /* 1 op, LEB128 const */ + opConsts = 0x11 /* " signed */ + opDup = 0x12 + opDrop = 0x13 + opOver = 0x14 + opPick = 0x15 /* 1 op, 1 byte stack index */ + opSwap = 0x16 + opRot = 0x17 + opXderef = 0x18 + opAbs = 0x19 + opAnd = 0x1A + opDiv = 0x1B + opMinus = 0x1C + opMod = 0x1D + opMul = 0x1E + opNeg = 0x1F + opNot = 0x20 + opOr = 0x21 + opPlus = 0x22 + opPlusUconst = 0x23 /* 1 op, ULEB128 addend */ + opShl = 0x24 + opShr = 0x25 + opShra = 0x26 + opXor = 0x27 + opSkip = 0x2F /* 1 op, signed 2-byte constant */ + opBra = 0x28 /* 1 op, signed 2-byte constant */ + opEq = 0x29 + opGe = 0x2A + opGt = 0x2B + opLe = 0x2C + opLt = 0x2D + opNe = 0x2E + opLit0 = 0x30 + /* OpLitN = OpLit0 + N for N = 0..31 */ + opReg0 = 0x50 + /* OpRegN = OpReg0 + N for N = 0..31 */ + opBreg0 = 0x70 /* 1 op, signed LEB128 constant */ + /* OpBregN = OpBreg0 + N for N = 0..31 */ + opRegx = 0x90 /* 1 op, ULEB128 register */ + opFbreg = 0x91 /* 1 op, SLEB128 offset */ + opBregx = 0x92 /* 2 op, ULEB128 reg; SLEB128 off */ + opPiece = 0x93 /* 1 op, ULEB128 size of piece */ + opDerefSize = 0x94 /* 1-byte size of data retrieved */ + opXderefSize = 0x95 /* 1-byte size of data retrieved */ + opNop = 0x96 + /* next four new in Dwarf v3 */ + opPushObjAddr = 0x97 + opCall2 = 0x98 /* 2-byte offset of DIE */ + opCall4 = 0x99 /* 4-byte offset of DIE */ + opCallRef = 0x9A /* 4- or 8- byte offset of DIE */ + /* 0xE0-0xFF reserved for user-specific */ +) + +// Basic type encodings -- the value for AttrEncoding in a TagBaseType Entry. +const ( + encAddress = 0x01 + encBoolean = 0x02 + encComplexFloat = 0x03 + encFloat = 0x04 + encSigned = 0x05 + encSignedChar = 0x06 + encUnsigned = 0x07 + encUnsignedChar = 0x08 + encImaginaryFloat = 0x09 +) + +// Statement program standard opcode encodings. +const ( + lnsCopy = 1 + lnsAdvancePC = 2 + lnsAdvanceLine = 3 + lnsSetFile = 4 + lnsSetColumn = 5 + lnsNegateStmt = 6 + lnsSetBasicBlock = 7 + lnsConstAddPC = 8 + lnsFixedAdvancePC = 9 + + // DWARF 3 + lnsSetPrologueEnd = 10 + lnsSetEpilogueBegin = 11 + lnsSetISA = 12 +) + +// Statement program extended opcode encodings. +const ( + lneEndSequence = 1 + lneSetAddress = 2 + lneDefineFile = 3 + + // DWARF 4 + lneSetDiscriminator = 4 +) diff --git a/src/debug/dwarf/entry.go b/src/debug/dwarf/entry.go new file mode 100644 index 0000000000000000000000000000000000000000..d607e5b4a38e498d04cb1d1208ee4a04d74baffd --- /dev/null +++ b/src/debug/dwarf/entry.go @@ -0,0 +1,633 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// DWARF debug information entry parser. +// An entry is a sequence of data items of a given format. +// The first word in the entry is an index into what DWARF +// calls the ``abbreviation table.'' An abbreviation is really +// just a type descriptor: it's an array of attribute tag/value format pairs. + +package dwarf + +import ( + "errors" + "strconv" +) + +// a single entry's description: a sequence of attributes +type abbrev struct { + tag Tag + children bool + field []afield +} + +type afield struct { + attr Attr + fmt format + class Class +} + +// a map from entry format ids to their descriptions +type abbrevTable map[uint32]abbrev + +// ParseAbbrev returns the abbreviation table that starts at byte off +// in the .debug_abbrev section. +func (d *Data) parseAbbrev(off uint32, vers int) (abbrevTable, error) { + if m, ok := d.abbrevCache[off]; ok { + return m, nil + } + + data := d.abbrev + if off > uint32(len(data)) { + data = nil + } else { + data = data[off:] + } + b := makeBuf(d, unknownFormat{}, "abbrev", 0, data) + + // Error handling is simplified by the buf getters + // returning an endless stream of 0s after an error. + m := make(abbrevTable) + for { + // Table ends with id == 0. + id := uint32(b.uint()) + if id == 0 { + break + } + + // Walk over attributes, counting. + n := 0 + b1 := b // Read from copy of b. + b1.uint() + b1.uint8() + for { + tag := b1.uint() + fmt := b1.uint() + if tag == 0 && fmt == 0 { + break + } + n++ + } + if b1.err != nil { + return nil, b1.err + } + + // Walk over attributes again, this time writing them down. + var a abbrev + a.tag = Tag(b.uint()) + a.children = b.uint8() != 0 + a.field = make([]afield, n) + for i := range a.field { + a.field[i].attr = Attr(b.uint()) + a.field[i].fmt = format(b.uint()) + a.field[i].class = formToClass(a.field[i].fmt, a.field[i].attr, vers, &b) + } + b.uint() + b.uint() + + m[id] = a + } + if b.err != nil { + return nil, b.err + } + d.abbrevCache[off] = m + return m, nil +} + +// attrIsExprloc indicates attributes that allow exprloc values that +// are encoded as block values in DWARF 2 and 3. See DWARF 4, Figure +// 20. +var attrIsExprloc = map[Attr]bool{ + AttrLocation: true, + AttrByteSize: true, + AttrBitOffset: true, + AttrBitSize: true, + AttrStringLength: true, + AttrLowerBound: true, + AttrReturnAddr: true, + AttrStrideSize: true, + AttrUpperBound: true, + AttrCount: true, + AttrDataMemberLoc: true, + AttrFrameBase: true, + AttrSegment: true, + AttrStaticLink: true, + AttrUseLocation: true, + AttrVtableElemLoc: true, + AttrAllocated: true, + AttrAssociated: true, + AttrDataLocation: true, + AttrStride: true, +} + +// attrPtrClass indicates the *ptr class of attributes that have +// encoding formSecOffset in DWARF 4 or formData* in DWARF 2 and 3. +var attrPtrClass = map[Attr]Class{ + AttrLocation: ClassLocListPtr, + AttrStmtList: ClassLinePtr, + AttrStringLength: ClassLocListPtr, + AttrReturnAddr: ClassLocListPtr, + AttrStartScope: ClassRangeListPtr, + AttrDataMemberLoc: ClassLocListPtr, + AttrFrameBase: ClassLocListPtr, + AttrMacroInfo: ClassMacPtr, + AttrSegment: ClassLocListPtr, + AttrStaticLink: ClassLocListPtr, + AttrUseLocation: ClassLocListPtr, + AttrVtableElemLoc: ClassLocListPtr, + AttrRanges: ClassRangeListPtr, +} + +// formToClass returns the DWARF 4 Class for the given form. If the +// DWARF version is less then 4, it will disambiguate some forms +// depending on the attribute. +func formToClass(form format, attr Attr, vers int, b *buf) Class { + switch form { + default: + b.error("cannot determine class of unknown attribute form") + return 0 + + case formAddr: + return ClassAddress + + case formDwarfBlock1, formDwarfBlock2, formDwarfBlock4, formDwarfBlock: + // In DWARF 2 and 3, ClassExprLoc was encoded as a + // block. DWARF 4 distinguishes ClassBlock and + // ClassExprLoc, but there are no attributes that can + // be both, so we also promote ClassBlock values in + // DWARF 4 that should be ClassExprLoc in case + // producers get this wrong. + if attrIsExprloc[attr] { + return ClassExprLoc + } + return ClassBlock + + case formData1, formData2, formData4, formData8, formSdata, formUdata: + // In DWARF 2 and 3, ClassPtr was encoded as a + // constant. Unlike ClassExprLoc/ClassBlock, some + // DWARF 4 attributes need to distinguish Class*Ptr + // from ClassConstant, so we only do this promotion + // for versions 2 and 3. + if class, ok := attrPtrClass[attr]; vers < 4 && ok { + return class + } + return ClassConstant + + case formFlag, formFlagPresent: + return ClassFlag + + case formRefAddr, formRef1, formRef2, formRef4, formRef8, formRefUdata: + return ClassReference + + case formRefSig8: + return ClassReferenceSig + + case formString, formStrp: + return ClassString + + case formSecOffset: + // DWARF 4 defines four *ptr classes, but doesn't + // distinguish them in the encoding. Disambiguate + // these classes using the attribute. + if class, ok := attrPtrClass[attr]; ok { + return class + } + b.error("cannot determine class of unknown attribute with formSecOffset") + return 0 + + case formExprloc: + return ClassExprLoc + + case formGnuRefAlt: + return ClassReferenceAlt + + case formGnuStrpAlt: + return ClassStringAlt + } +} + +// An entry is a sequence of attribute/value pairs. +type Entry struct { + Offset Offset // offset of Entry in DWARF info + Tag Tag // tag (kind of Entry) + Children bool // whether Entry is followed by children + Field []Field +} + +// A Field is a single attribute/value pair in an Entry. +// +// A value can be one of several "attribute classes" defined by DWARF. +// The Go types corresponding to each class are: +// +// DWARF class Go type Class +// ----------- ------- ----- +// address uint64 ClassAddress +// block []byte ClassBlock +// constant int64 ClassConstant +// flag bool ClassFlag +// reference +// to info dwarf.Offset ClassReference +// to type unit uint64 ClassReferenceSig +// string string ClassString +// exprloc []byte ClassExprLoc +// lineptr int64 ClassLinePtr +// loclistptr int64 ClassLocListPtr +// macptr int64 ClassMacPtr +// rangelistptr int64 ClassRangeListPtr +type Field struct { + Attr Attr + Val interface{} + Class Class +} + +// A Class is the DWARF 4 class of an attibute value. +// +// In general, a given attribute's value may take on one of several +// possible classes defined by DWARF, each of which leads to a +// slightly different interpretation of the attribute. +// +// DWARF version 4 distinguishes attribute value classes more finely +// than previous versions of DWARF. The reader will disambiguate +// coarser classes from earlier versions of DWARF into the appropriate +// DWARF 4 class. For example, DWARF 2 uses "constant" for constants +// as well as all types of section offsets, but the reader will +// canonicalize attributes in DWARF 2 files that refer to section +// offsets to one of the Class*Ptr classes, even though these classes +// were only defined in DWARF 3. +type Class int + +const ( + // ClassAddress represents values of type uint64 that are + // addresses on the target machine. + ClassAddress Class = 1 + iota + + // ClassBlock represents values of type []byte whose + // interpretation depends on the attribute. + ClassBlock + + // ClassConstant represents values of type int64 that are + // constants. The interpretation of this constant depends on + // the attribute. + ClassConstant + + // ClassExprLoc represents values of type []byte that contain + // an encoded DWARF expression or location description. + ClassExprLoc + + // ClassFlag represents values of type bool. + ClassFlag + + // ClassLinePtr represents values that are an int64 offset + // into the "line" section. + ClassLinePtr + + // ClassLocListPtr represents values that are an int64 offset + // into the "loclist" section. + ClassLocListPtr + + // ClassMacPtr represents values that are an int64 offset into + // the "mac" section. + ClassMacPtr + + // ClassMacPtr represents values that are an int64 offset into + // the "rangelist" section. + ClassRangeListPtr + + // ClassReference represents values that are an Offset offset + // of an Entry in the info section (for use with Reader.Seek). + // The DWARF specification combines ClassReference and + // ClassReferenceSig into class "reference". + ClassReference + + // ClassReferenceSig represents values that are a uint64 type + // signature referencing a type Entry. + ClassReferenceSig + + // ClassString represents values that are strings. If the + // compilation unit specifies the AttrUseUTF8 flag (strongly + // recommended), the string value will be encoded in UTF-8. + // Otherwise, the encoding is unspecified. + ClassString + + // ClassReferenceAlt represents values of type int64 that are + // an offset into the DWARF "info" section of an alternate + // object file. + ClassReferenceAlt + + // ClassStringAlt represents values of type int64 that are an + // offset into the DWARF string section of an alternate object + // file. + ClassStringAlt +) + +//go:generate stringer -type=Class + +func (i Class) GoString() string { + return "dwarf." + i.String() +} + +// Val returns the value associated with attribute Attr in Entry, +// or nil if there is no such attribute. +// +// A common idiom is to merge the check for nil return with +// the check that the value has the expected dynamic type, as in: +// v, ok := e.Val(AttrSibling).(int64) +// +func (e *Entry) Val(a Attr) interface{} { + if f := e.AttrField(a); f != nil { + return f.Val + } + return nil +} + +// AttrField returns the Field associated with attribute Attr in +// Entry, or nil if there is no such attribute. +func (e *Entry) AttrField(a Attr) *Field { + for i, f := range e.Field { + if f.Attr == a { + return &e.Field[i] + } + } + return nil +} + +// An Offset represents the location of an Entry within the DWARF info. +// (See Reader.Seek.) +type Offset uint32 + +// Entry reads a single entry from buf, decoding +// according to the given abbreviation table. +func (b *buf) entry(atab abbrevTable, ubase Offset) *Entry { + off := b.off + id := uint32(b.uint()) + if id == 0 { + return &Entry{} + } + a, ok := atab[id] + if !ok { + b.error("unknown abbreviation table index") + return nil + } + e := &Entry{ + Offset: off, + Tag: a.tag, + Children: a.children, + Field: make([]Field, len(a.field)), + } + for i := range e.Field { + e.Field[i].Attr = a.field[i].attr + e.Field[i].Class = a.field[i].class + fmt := a.field[i].fmt + if fmt == formIndirect { + fmt = format(b.uint()) + } + var val interface{} + switch fmt { + default: + b.error("unknown entry attr format 0x" + strconv.FormatInt(int64(fmt), 16)) + + // address + case formAddr: + val = b.addr() + + // block + case formDwarfBlock1: + val = b.bytes(int(b.uint8())) + case formDwarfBlock2: + val = b.bytes(int(b.uint16())) + case formDwarfBlock4: + val = b.bytes(int(b.uint32())) + case formDwarfBlock: + val = b.bytes(int(b.uint())) + + // constant + case formData1: + val = int64(b.uint8()) + case formData2: + val = int64(b.uint16()) + case formData4: + val = int64(b.uint32()) + case formData8: + val = int64(b.uint64()) + case formSdata: + val = int64(b.int()) + case formUdata: + val = int64(b.uint()) + + // flag + case formFlag: + val = b.uint8() == 1 + // New in DWARF 4. + case formFlagPresent: + // The attribute is implicitly indicated as present, and no value is + // encoded in the debugging information entry itself. + val = true + + // reference to other entry + case formRefAddr: + vers := b.format.version() + if vers == 0 { + b.error("unknown version for DW_FORM_ref_addr") + } else if vers == 2 { + val = Offset(b.addr()) + } else { + is64, known := b.format.dwarf64() + if !known { + b.error("unknown size for DW_FORM_ref_addr") + } else if is64 { + val = Offset(b.uint64()) + } else { + val = Offset(b.uint32()) + } + } + case formRef1: + val = Offset(b.uint8()) + ubase + case formRef2: + val = Offset(b.uint16()) + ubase + case formRef4: + val = Offset(b.uint32()) + ubase + case formRef8: + val = Offset(b.uint64()) + ubase + case formRefUdata: + val = Offset(b.uint()) + ubase + + // string + case formString: + val = b.string() + case formStrp: + off := b.uint32() // offset into .debug_str + if b.err != nil { + return nil + } + b1 := makeBuf(b.dwarf, unknownFormat{}, "str", 0, b.dwarf.str) + b1.skip(int(off)) + val = b1.string() + if b1.err != nil { + b.err = b1.err + return nil + } + + // lineptr, loclistptr, macptr, rangelistptr + // New in DWARF 4, but clang can generate them with -gdwarf-2. + // Section reference, replacing use of formData4 and formData8. + case formSecOffset, formGnuRefAlt, formGnuStrpAlt: + is64, known := b.format.dwarf64() + if !known { + b.error("unknown size for form 0x" + strconv.FormatInt(int64(fmt), 16)) + } else if is64 { + val = int64(b.uint64()) + } else { + val = int64(b.uint32()) + } + + // exprloc + // New in DWARF 4. + case formExprloc: + val = b.bytes(int(b.uint())) + + // reference + // New in DWARF 4. + case formRefSig8: + // 64-bit type signature. + val = b.uint64() + } + e.Field[i].Val = val + } + if b.err != nil { + return nil + } + return e +} + +// A Reader allows reading Entry structures from a DWARF ``info'' section. +// The Entry structures are arranged in a tree. The Reader's Next function +// return successive entries from a pre-order traversal of the tree. +// If an entry has children, its Children field will be true, and the children +// follow, terminated by an Entry with Tag 0. +type Reader struct { + b buf + d *Data + err error + unit int + lastChildren bool // .Children of last entry returned by Next + lastSibling Offset // .Val(AttrSibling) of last entry returned by Next +} + +// Reader returns a new Reader for Data. +// The reader is positioned at byte offset 0 in the DWARF ``info'' section. +func (d *Data) Reader() *Reader { + r := &Reader{d: d} + r.Seek(0) + return r +} + +// AddressSize returns the size in bytes of addresses in the current compilation +// unit. +func (r *Reader) AddressSize() int { + return r.d.unit[r.unit].asize +} + +// Seek positions the Reader at offset off in the encoded entry stream. +// Offset 0 can be used to denote the first entry. +func (r *Reader) Seek(off Offset) { + d := r.d + r.err = nil + r.lastChildren = false + if off == 0 { + if len(d.unit) == 0 { + return + } + u := &d.unit[0] + r.unit = 0 + r.b = makeBuf(r.d, u, "info", u.off, u.data) + return + } + + i := d.offsetToUnit(off) + if i == -1 { + r.err = errors.New("offset out of range") + return + } + u := &d.unit[i] + r.unit = i + r.b = makeBuf(r.d, u, "info", off, u.data[off-u.off:]) +} + +// maybeNextUnit advances to the next unit if this one is finished. +func (r *Reader) maybeNextUnit() { + for len(r.b.data) == 0 && r.unit+1 < len(r.d.unit) { + r.unit++ + u := &r.d.unit[r.unit] + r.b = makeBuf(r.d, u, "info", u.off, u.data) + } +} + +// Next reads the next entry from the encoded entry stream. +// It returns nil, nil when it reaches the end of the section. +// It returns an error if the current offset is invalid or the data at the +// offset cannot be decoded as a valid Entry. +func (r *Reader) Next() (*Entry, error) { + if r.err != nil { + return nil, r.err + } + r.maybeNextUnit() + if len(r.b.data) == 0 { + return nil, nil + } + u := &r.d.unit[r.unit] + e := r.b.entry(u.atable, u.base) + if r.b.err != nil { + r.err = r.b.err + return nil, r.err + } + if e != nil { + r.lastChildren = e.Children + if r.lastChildren { + r.lastSibling, _ = e.Val(AttrSibling).(Offset) + } + } else { + r.lastChildren = false + } + return e, nil +} + +// SkipChildren skips over the child entries associated with +// the last Entry returned by Next. If that Entry did not have +// children or Next has not been called, SkipChildren is a no-op. +func (r *Reader) SkipChildren() { + if r.err != nil || !r.lastChildren { + return + } + + // If the last entry had a sibling attribute, + // that attribute gives the offset of the next + // sibling, so we can avoid decoding the + // child subtrees. + if r.lastSibling >= r.b.off { + r.Seek(r.lastSibling) + return + } + + for { + e, err := r.Next() + if err != nil || e == nil || e.Tag == 0 { + break + } + if e.Children { + r.SkipChildren() + } + } +} + +// clone returns a copy of the reader. This is used by the typeReader +// interface. +func (r *Reader) clone() typeReader { + return r.d.Reader() +} + +// offset returns the current buffer offset. This is used by the +// typeReader interface. +func (r *Reader) offset() Offset { + return r.b.off +} diff --git a/src/debug/dwarf/line.go b/src/debug/dwarf/line.go new file mode 100644 index 0000000000000000000000000000000000000000..ca64bbd7f3b310778058a3a404d699f5a84e0907 --- /dev/null +++ b/src/debug/dwarf/line.go @@ -0,0 +1,590 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package dwarf + +import ( + "errors" + "fmt" + "io" + "path" +) + +// A LineReader reads a sequence of LineEntry structures from a DWARF +// "line" section for a single compilation unit. LineEntries occur in +// order of increasing PC and each LineEntry gives metadata for the +// instructions from that LineEntry's PC to just before the next +// LineEntry's PC. The last entry will have its EndSequence field set. +type LineReader struct { + buf buf + + // Original .debug_line section data. Used by Seek. + section []byte + + // Header information + version uint16 + minInstructionLength int + maxOpsPerInstruction int + defaultIsStmt bool + lineBase int + lineRange int + opcodeBase int + opcodeLengths []int + directories []string + fileEntries []*LineFile + + programOffset Offset // section offset of line number program + endOffset Offset // section offset of byte following program + + initialFileEntries int // initial length of fileEntries + + // Current line number program state machine registers + state LineEntry // public state + fileIndex int // private state +} + +// A LineEntry is a row in a DWARF line table. +type LineEntry struct { + // Address is the program-counter value of a machine + // instruction generated by the compiler. This LineEntry + // applies to each instruction from Address to just before the + // Address of the next LineEntry. + Address uint64 + + // OpIndex is the index of an operation within a VLIW + // instruction. The index of the first operation is 0. For + // non-VLIW architectures, it will always be 0. Address and + // OpIndex together form an operation pointer that can + // reference any individual operation within the instruction + // stream. + OpIndex int + + // File is the source file corresponding to these + // instructions. + File *LineFile + + // Line is the source code line number corresponding to these + // instructions. Lines are numbered beginning at 1. It may be + // 0 if these instructions cannot be attributed to any source + // line. + Line int + + // Column is the column number within the source line of these + // instructions. Columns are numbered beginning at 1. It may + // be 0 to indicate the "left edge" of the line. + Column int + + // IsStmt indicates that Address is a recommended breakpoint + // location, such as the beginning of a line, statement, or a + // distinct subpart of a statement. + IsStmt bool + + // BasicBlock indicates that Address is the beginning of a + // basic block. + BasicBlock bool + + // PrologueEnd indicates that Address is one (of possibly + // many) PCs where execution should be suspended for a + // breakpoint on entry to the containing function. + // + // Added in DWARF 3. + PrologueEnd bool + + // EpilogueBegin indicates that Address is one (of possibly + // many) PCs where execution should be suspended for a + // breakpoint on exit from this function. + // + // Added in DWARF 3. + EpilogueBegin bool + + // ISA is the instruction set architecture for these + // instructions. Possible ISA values should be defined by the + // applicable ABI specification. + // + // Added in DWARF 3. + ISA int + + // Discriminator is an arbitrary integer indicating the block + // to which these instructions belong. It serves to + // distinguish among multiple blocks that may all have with + // the same source file, line, and column. Where only one + // block exists for a given source position, it should be 0. + // + // Added in DWARF 3. + Discriminator int + + // EndSequence indicates that Address is the first byte after + // the end of a sequence of target machine instructions. If it + // is set, only this and the Address field are meaningful. A + // line number table may contain information for multiple + // potentially disjoint instruction sequences. The last entry + // in a line table should always have EndSequence set. + EndSequence bool +} + +// A LineFile is a source file referenced by a DWARF line table entry. +type LineFile struct { + Name string + Mtime uint64 // Implementation defined modification time, or 0 if unknown + Length int // File length, or 0 if unknown +} + +// LineReader returns a new reader for the line table of compilation +// unit cu, which must be an Entry with tag TagCompileUnit. +// +// If this compilation unit has no line table, it returns nil, nil. +func (d *Data) LineReader(cu *Entry) (*LineReader, error) { + if d.line == nil { + // No line tables available. + return nil, nil + } + + // Get line table information from cu. + off, ok := cu.Val(AttrStmtList).(int64) + if !ok { + // cu has no line table. + return nil, nil + } + if off > int64(len(d.line)) { + return nil, errors.New("AttrStmtList value out of range") + } + // AttrCompDir is optional if all file names are absolute. Use + // the empty string if it's not present. + compDir, _ := cu.Val(AttrCompDir).(string) + + // Create the LineReader. + u := &d.unit[d.offsetToUnit(cu.Offset)] + buf := makeBuf(d, u, "line", Offset(off), d.line[off:]) + // The compilation directory is implicitly directories[0]. + r := LineReader{buf: buf, section: d.line, directories: []string{compDir}} + + // Read the header. + if err := r.readHeader(); err != nil { + return nil, err + } + + // Initialize line reader state. + r.Reset() + + return &r, nil +} + +// readHeader reads the line number program header from r.buf and sets +// all of the header fields in r. +func (r *LineReader) readHeader() error { + buf := &r.buf + + // Read basic header fields [DWARF2 6.2.4]. + hdrOffset := buf.off + unitLength, dwarf64 := buf.unitLength() + r.endOffset = buf.off + unitLength + if r.endOffset > buf.off+Offset(len(buf.data)) { + return DecodeError{"line", hdrOffset, fmt.Sprintf("line table end %d exceeds section size %d", r.endOffset, buf.off+Offset(len(buf.data)))} + } + r.version = buf.uint16() + if buf.err == nil && (r.version < 2 || r.version > 4) { + // DWARF goes to all this effort to make new opcodes + // backward-compatible, and then adds fields right in + // the middle of the header in new versions, so we're + // picky about only supporting known line table + // versions. + return DecodeError{"line", hdrOffset, fmt.Sprintf("unknown line table version %d", r.version)} + } + var headerLength Offset + if dwarf64 { + headerLength = Offset(buf.uint64()) + } else { + headerLength = Offset(buf.uint32()) + } + r.programOffset = buf.off + headerLength + r.minInstructionLength = int(buf.uint8()) + if r.version >= 4 { + // [DWARF4 6.2.4] + r.maxOpsPerInstruction = int(buf.uint8()) + } else { + r.maxOpsPerInstruction = 1 + } + r.defaultIsStmt = buf.uint8() != 0 + r.lineBase = int(int8(buf.uint8())) + r.lineRange = int(buf.uint8()) + + // Validate header. + if buf.err != nil { + return buf.err + } + if r.maxOpsPerInstruction == 0 { + return DecodeError{"line", hdrOffset, "invalid maximum operations per instruction: 0"} + } + if r.lineRange == 0 { + return DecodeError{"line", hdrOffset, "invalid line range: 0"} + } + + // Read standard opcode length table. This table starts with opcode 1. + r.opcodeBase = int(buf.uint8()) + r.opcodeLengths = make([]int, r.opcodeBase) + for i := 1; i < r.opcodeBase; i++ { + r.opcodeLengths[i] = int(buf.uint8()) + } + + // Validate opcode lengths. + if buf.err != nil { + return buf.err + } + for i, length := range r.opcodeLengths { + if known, ok := knownOpcodeLengths[i]; ok && known != length { + return DecodeError{"line", hdrOffset, fmt.Sprintf("opcode %d expected to have length %d, but has length %d", i, known, length)} + } + } + + // Read include directories table. The caller already set + // directories[0] to the compilation directory. + for { + directory := buf.string() + if buf.err != nil { + return buf.err + } + if len(directory) == 0 { + break + } + if !path.IsAbs(directory) { + // Relative paths are implicitly relative to + // the compilation directory. + directory = path.Join(r.directories[0], directory) + } + r.directories = append(r.directories, directory) + } + + // Read file name list. File numbering starts with 1, so leave + // the first entry nil. + r.fileEntries = make([]*LineFile, 1) + for { + if done, err := r.readFileEntry(); err != nil { + return err + } else if done { + break + } + } + r.initialFileEntries = len(r.fileEntries) + + return buf.err +} + +// readFileEntry reads a file entry from either the header or a +// DW_LNE_define_file extended opcode and adds it to r.fileEntries. A +// true return value indicates that there are no more entries to read. +func (r *LineReader) readFileEntry() (bool, error) { + name := r.buf.string() + if r.buf.err != nil { + return false, r.buf.err + } + if len(name) == 0 { + return true, nil + } + off := r.buf.off + dirIndex := int(r.buf.uint()) + if !path.IsAbs(name) { + if dirIndex >= len(r.directories) { + return false, DecodeError{"line", off, "directory index too large"} + } + name = path.Join(r.directories[dirIndex], name) + } + mtime := r.buf.uint() + length := int(r.buf.uint()) + + r.fileEntries = append(r.fileEntries, &LineFile{name, mtime, length}) + return false, nil +} + +// updateFile updates r.state.File after r.fileIndex has +// changed or r.fileEntries has changed. +func (r *LineReader) updateFile() { + if r.fileIndex < len(r.fileEntries) { + r.state.File = r.fileEntries[r.fileIndex] + } else { + r.state.File = nil + } +} + +// Next sets *entry to the next row in this line table and moves to +// the next row. If there are no more entries and the line table is +// properly terminated, it returns io.EOF. +// +// Rows are always in order of increasing entry.Address, but +// entry.Line may go forward or backward. +func (r *LineReader) Next(entry *LineEntry) error { + if r.buf.err != nil { + return r.buf.err + } + + // Execute opcodes until we reach an opcode that emits a line + // table entry. + for { + if len(r.buf.data) == 0 { + return io.EOF + } + emit := r.step(entry) + if r.buf.err != nil { + return r.buf.err + } + if emit { + return nil + } + } +} + +// knownOpcodeLengths gives the opcode lengths (in varint arguments) +// of known standard opcodes. +var knownOpcodeLengths = map[int]int{ + lnsCopy: 0, + lnsAdvancePC: 1, + lnsAdvanceLine: 1, + lnsSetFile: 1, + lnsNegateStmt: 0, + lnsSetBasicBlock: 0, + lnsConstAddPC: 0, + lnsSetPrologueEnd: 0, + lnsSetEpilogueBegin: 0, + lnsSetISA: 1, + // lnsFixedAdvancePC takes a uint8 rather than a varint; it's + // unclear what length the header is supposed to claim, so + // ignore it. +} + +// step processes the next opcode and updates r.state. If the opcode +// emits a row in the line table, this updates *entry and returns +// true. +func (r *LineReader) step(entry *LineEntry) bool { + opcode := int(r.buf.uint8()) + + if opcode >= r.opcodeBase { + // Special opcode [DWARF2 6.2.5.1, DWARF4 6.2.5.1] + adjustedOpcode := opcode - r.opcodeBase + r.advancePC(adjustedOpcode / r.lineRange) + lineDelta := r.lineBase + int(adjustedOpcode)%r.lineRange + r.state.Line += lineDelta + goto emit + } + + switch opcode { + case 0: + // Extended opcode [DWARF2 6.2.5.3] + length := Offset(r.buf.uint()) + startOff := r.buf.off + opcode := r.buf.uint8() + + switch opcode { + case lneEndSequence: + r.state.EndSequence = true + *entry = r.state + r.resetState() + + case lneSetAddress: + r.state.Address = r.buf.addr() + + case lneDefineFile: + if done, err := r.readFileEntry(); err != nil { + r.buf.err = err + return false + } else if done { + r.buf.err = DecodeError{"line", startOff, "malformed DW_LNE_define_file operation"} + return false + } + r.updateFile() + + case lneSetDiscriminator: + // [DWARF4 6.2.5.3] + r.state.Discriminator = int(r.buf.uint()) + } + + r.buf.skip(int(startOff + length - r.buf.off)) + + if opcode == lneEndSequence { + return true + } + + // Standard opcodes [DWARF2 6.2.5.2] + case lnsCopy: + goto emit + + case lnsAdvancePC: + r.advancePC(int(r.buf.uint())) + + case lnsAdvanceLine: + r.state.Line += int(r.buf.int()) + + case lnsSetFile: + r.fileIndex = int(r.buf.uint()) + r.updateFile() + + case lnsSetColumn: + r.state.Column = int(r.buf.uint()) + + case lnsNegateStmt: + r.state.IsStmt = !r.state.IsStmt + + case lnsSetBasicBlock: + r.state.BasicBlock = true + + case lnsConstAddPC: + r.advancePC((255 - r.opcodeBase) / r.lineRange) + + case lnsFixedAdvancePC: + r.state.Address += uint64(r.buf.uint16()) + + // DWARF3 standard opcodes [DWARF3 6.2.5.2] + case lnsSetPrologueEnd: + r.state.PrologueEnd = true + + case lnsSetEpilogueBegin: + r.state.EpilogueBegin = true + + case lnsSetISA: + r.state.ISA = int(r.buf.uint()) + + default: + // Unhandled standard opcode. Skip the number of + // arguments that the prologue says this opcode has. + for i := 0; i < r.opcodeLengths[opcode]; i++ { + r.buf.uint() + } + } + return false + +emit: + *entry = r.state + r.state.BasicBlock = false + r.state.PrologueEnd = false + r.state.EpilogueBegin = false + r.state.Discriminator = 0 + return true +} + +// advancePC advances "operation pointer" (the combination of Address +// and OpIndex) in r.state by opAdvance steps. +func (r *LineReader) advancePC(opAdvance int) { + opIndex := r.state.OpIndex + opAdvance + r.state.Address += uint64(r.minInstructionLength * (opIndex / r.maxOpsPerInstruction)) + r.state.OpIndex = opIndex % r.maxOpsPerInstruction +} + +// A LineReaderPos represents a position in a line table. +type LineReaderPos struct { + // off is the current offset in the DWARF line section. + off Offset + // numFileEntries is the length of fileEntries. + numFileEntries int + // state and fileIndex are the statement machine state at + // offset off. + state LineEntry + fileIndex int +} + +// Tell returns the current position in the line table. +func (r *LineReader) Tell() LineReaderPos { + return LineReaderPos{r.buf.off, len(r.fileEntries), r.state, r.fileIndex} +} + +// Seek restores the line table reader to a position returned by Tell. +// +// The argument pos must have been returned by a call to Tell on this +// line table. +func (r *LineReader) Seek(pos LineReaderPos) { + r.buf.off = pos.off + r.buf.data = r.section[r.buf.off:r.endOffset] + r.fileEntries = r.fileEntries[:pos.numFileEntries] + r.state = pos.state + r.fileIndex = pos.fileIndex +} + +// Reset repositions the line table reader at the beginning of the +// line table. +func (r *LineReader) Reset() { + // Reset buffer to the line number program offset. + r.buf.off = r.programOffset + r.buf.data = r.section[r.buf.off:r.endOffset] + + // Reset file entries list. + r.fileEntries = r.fileEntries[:r.initialFileEntries] + + // Reset line number program state. + r.resetState() +} + +// resetState resets r.state to its default values +func (r *LineReader) resetState() { + // Reset the state machine registers to the defaults given in + // [DWARF4 6.2.2]. + r.state = LineEntry{ + Address: 0, + OpIndex: 0, + File: nil, + Line: 1, + Column: 0, + IsStmt: r.defaultIsStmt, + BasicBlock: false, + PrologueEnd: false, + EpilogueBegin: false, + ISA: 0, + Discriminator: 0, + } + r.fileIndex = 1 + r.updateFile() +} + +// ErrUnknownPC is the error returned by LineReader.ScanPC when the +// seek PC is not covered by any entry in the line table. +var ErrUnknownPC = errors.New("ErrUnknownPC") + +// SeekPC sets *entry to the LineEntry that includes pc and positions +// the reader on the next entry in the line table. If necessary, this +// will seek backwards to find pc. +// +// If pc is not covered by any entry in this line table, SeekPC +// returns ErrUnknownPC. In this case, *entry and the final seek +// position are unspecified. +// +// Note that DWARF line tables only permit sequential, forward scans. +// Hence, in the worst case, this takes time linear in the size of the +// line table. If the caller wishes to do repeated fast PC lookups, it +// should build an appropriate index of the line table. +func (r *LineReader) SeekPC(pc uint64, entry *LineEntry) error { + if err := r.Next(entry); err != nil { + return err + } + if entry.Address > pc { + // We're too far. Start at the beginning of the table. + r.Reset() + if err := r.Next(entry); err != nil { + return err + } + if entry.Address > pc { + // The whole table starts after pc. + r.Reset() + return ErrUnknownPC + } + } + + // Scan until we pass pc, then back up one. + for { + var next LineEntry + pos := r.Tell() + if err := r.Next(&next); err != nil { + if err == io.EOF { + return ErrUnknownPC + } + return err + } + if next.Address > pc { + if entry.EndSequence { + // pc is in a hole in the table. + return ErrUnknownPC + } + // entry is the desired entry. Back up the + // cursor to "next" and return success. + r.Seek(pos) + return nil + } + *entry = next + } +} diff --git a/src/debug/dwarf/line_test.go b/src/debug/dwarf/line_test.go new file mode 100644 index 0000000000000000000000000000000000000000..4104b5d49b80b7399f9fe6f211cab40e79ee6107 --- /dev/null +++ b/src/debug/dwarf/line_test.go @@ -0,0 +1,229 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package dwarf_test + +import ( + . "debug/dwarf" + "io" + "testing" +) + +var ( + file1C = &LineFile{Name: "/home/austin/go.dev/src/debug/dwarf/testdata/line1.c"} + file1H = &LineFile{Name: "/home/austin/go.dev/src/debug/dwarf/testdata/line1.h"} + file2C = &LineFile{Name: "/home/austin/go.dev/src/debug/dwarf/testdata/line2.c"} +) + +func TestLineELFGCC(t *testing.T) { + // Generated by: + // # gcc --version | head -n1 + // gcc (Ubuntu 4.8.2-19ubuntu1) 4.8.2 + // # gcc -g -o line-gcc.elf line*.c + + // Line table based on readelf --debug-dump=rawline,decodedline + want := []LineEntry{ + {Address: 0x40059d, File: file1H, Line: 2, IsStmt: true}, + {Address: 0x4005a5, File: file1H, Line: 2, IsStmt: true}, + {Address: 0x4005b4, File: file1H, Line: 5, IsStmt: true}, + {Address: 0x4005bd, File: file1H, Line: 6, IsStmt: true, Discriminator: 2}, + {Address: 0x4005c7, File: file1H, Line: 5, IsStmt: true, Discriminator: 2}, + {Address: 0x4005cb, File: file1H, Line: 5, IsStmt: false, Discriminator: 1}, + {Address: 0x4005d1, File: file1H, Line: 7, IsStmt: true}, + {Address: 0x4005e7, File: file1C, Line: 6, IsStmt: true}, + {Address: 0x4005eb, File: file1C, Line: 7, IsStmt: true}, + {Address: 0x4005f5, File: file1C, Line: 8, IsStmt: true}, + {Address: 0x4005ff, File: file1C, Line: 9, IsStmt: true}, + {Address: 0x400601, EndSequence: true}, + + {Address: 0x400601, File: file2C, Line: 4, IsStmt: true}, + {Address: 0x400605, File: file2C, Line: 5, IsStmt: true}, + {Address: 0x40060f, File: file2C, Line: 6, IsStmt: true}, + {Address: 0x400611, EndSequence: true}, + } + + testLineTable(t, want, elfData(t, "testdata/line-gcc.elf")) +} + +func TestLineELFClang(t *testing.T) { + // Generated by: + // # clang --version | head -n1 + // Ubuntu clang version 3.4-1ubuntu3 (tags/RELEASE_34/final) (based on LLVM 3.4) + // # clang -g -o line-clang.elf line*. + + want := []LineEntry{ + {Address: 0x400530, File: file1C, Line: 6, IsStmt: true}, + {Address: 0x400534, File: file1C, Line: 7, IsStmt: true, PrologueEnd: true}, + {Address: 0x400539, File: file1C, Line: 8, IsStmt: true}, + {Address: 0x400545, File: file1C, Line: 9, IsStmt: true}, + {Address: 0x400550, File: file1H, Line: 2, IsStmt: true}, + {Address: 0x400554, File: file1H, Line: 5, IsStmt: true, PrologueEnd: true}, + {Address: 0x400568, File: file1H, Line: 6, IsStmt: true}, + {Address: 0x400571, File: file1H, Line: 5, IsStmt: true}, + {Address: 0x400581, File: file1H, Line: 7, IsStmt: true}, + {Address: 0x400583, EndSequence: true}, + + {Address: 0x400590, File: file2C, Line: 4, IsStmt: true}, + {Address: 0x4005a0, File: file2C, Line: 5, IsStmt: true, PrologueEnd: true}, + {Address: 0x4005a7, File: file2C, Line: 6, IsStmt: true}, + {Address: 0x4005b0, EndSequence: true}, + } + + testLineTable(t, want, elfData(t, "testdata/line-clang.elf")) +} + +func TestLineSeek(t *testing.T) { + d := elfData(t, "testdata/line-gcc.elf") + + // Get the line table for the first CU. + cu, err := d.Reader().Next() + if err != nil { + t.Fatal("d.Reader().Next:", err) + } + lr, err := d.LineReader(cu) + if err != nil { + t.Fatal("d.LineReader:", err) + } + + // Read entries forward. + var line LineEntry + var posTable []LineReaderPos + var table []LineEntry + for { + posTable = append(posTable, lr.Tell()) + + err := lr.Next(&line) + if err != nil { + if err == io.EOF { + break + } + t.Fatal("lr.Next:", err) + } + table = append(table, line) + } + + // Test that Reset returns to the first line. + lr.Reset() + if err := lr.Next(&line); err != nil { + t.Fatal("lr.Next after Reset failed:", err) + } else if line != table[0] { + t.Fatal("lr.Next after Reset returned", line, "instead of", table[0]) + } + + // Check that entries match when seeking backward. + for i := len(posTable) - 1; i >= 0; i-- { + lr.Seek(posTable[i]) + err := lr.Next(&line) + if i == len(posTable)-1 { + if err != io.EOF { + t.Fatal("expected io.EOF after seek to end, got", err) + } + } else if err != nil { + t.Fatal("lr.Next after seek to", posTable[i], "failed:", err) + } else if line != table[i] { + t.Fatal("lr.Next after seek to", posTable[i], "returned", line, "instead of", table[i]) + } + } + + // Check that seeking to a PC returns the right line. + if err := lr.SeekPC(table[0].Address-1, &line); err != ErrUnknownPC { + t.Fatalf("lr.SeekPC to %#x returned %v instead of ErrUnknownPC", table[0].Address-1, err) + } + for i, testLine := range table { + if testLine.EndSequence { + if err := lr.SeekPC(testLine.Address, &line); err != ErrUnknownPC { + t.Fatalf("lr.SeekPC to %#x returned %v instead of ErrUnknownPC", testLine.Address, err) + } + continue + } + + nextPC := table[i+1].Address + for pc := testLine.Address; pc < nextPC; pc++ { + if err := lr.SeekPC(pc, &line); err != nil { + t.Fatalf("lr.SeekPC to %#x failed: %v", pc, err) + } else if line != testLine { + t.Fatalf("lr.SeekPC to %#x returned %v instead of %v", pc, line, testLine) + } + } + } +} + +func testLineTable(t *testing.T, want []LineEntry, d *Data) { + // Get line table from d. + var got []LineEntry + dr := d.Reader() + for { + ent, err := dr.Next() + if err != nil { + t.Fatal("dr.Next:", err) + } else if ent == nil { + break + } + + if ent.Tag != TagCompileUnit { + dr.SkipChildren() + continue + } + + // Decode CU's line table. + lr, err := d.LineReader(ent) + if err != nil { + t.Fatal("d.LineReader:", err) + } else if lr == nil { + continue + } + + for { + var line LineEntry + err := lr.Next(&line) + if err != nil { + if err == io.EOF { + break + } + t.Fatal("lr.Next:", err) + } + got = append(got, line) + } + } + + // Compare line tables. + if !compareLines(got, want) { + t.Log("Line tables do not match. Got:") + dumpLines(t, got) + t.Log("Want:") + dumpLines(t, want) + t.FailNow() + } +} + +func compareLines(a, b []LineEntry) bool { + if len(a) != len(b) { + return false + } + + for i := range a { + al, bl := a[i], b[i] + // If both are EndSequence, then the only other valid + // field is Address. Otherwise, test equality of all + // fields. + if al.EndSequence && bl.EndSequence && al.Address == bl.Address { + continue + } + if al.File.Name != bl.File.Name { + return false + } + al.File = nil + bl.File = nil + if al != bl { + return false + } + } + return true +} + +func dumpLines(t *testing.T, lines []LineEntry) { + for _, l := range lines { + t.Logf(" %+v File:%+v", l, l.File) + } +} diff --git a/src/debug/dwarf/open.go b/src/debug/dwarf/open.go new file mode 100644 index 0000000000000000000000000000000000000000..c1b3f37aca9618ebbf5aa1f07eb691abeba9cfaa --- /dev/null +++ b/src/debug/dwarf/open.go @@ -0,0 +1,87 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package dwarf provides access to DWARF debugging information loaded from +// executable files, as defined in the DWARF 2.0 Standard at +// http://dwarfstd.org/doc/dwarf-2.0.0.pdf +package dwarf + +import "encoding/binary" + +// Data represents the DWARF debugging information +// loaded from an executable file (for example, an ELF or Mach-O executable). +type Data struct { + // raw data + abbrev []byte + aranges []byte + frame []byte + info []byte + line []byte + pubnames []byte + ranges []byte + str []byte + + // parsed data + abbrevCache map[uint32]abbrevTable + order binary.ByteOrder + typeCache map[Offset]Type + typeSigs map[uint64]*typeUnit + unit []unit +} + +// New returns a new Data object initialized from the given parameters. +// Rather than calling this function directly, clients should typically use +// the DWARF method of the File type of the appropriate package debug/elf, +// debug/macho, or debug/pe. +// +// The []byte arguments are the data from the corresponding debug section +// in the object file; for example, for an ELF object, abbrev is the contents of +// the ".debug_abbrev" section. +func New(abbrev, aranges, frame, info, line, pubnames, ranges, str []byte) (*Data, error) { + d := &Data{ + abbrev: abbrev, + aranges: aranges, + frame: frame, + info: info, + line: line, + pubnames: pubnames, + ranges: ranges, + str: str, + abbrevCache: make(map[uint32]abbrevTable), + typeCache: make(map[Offset]Type), + typeSigs: make(map[uint64]*typeUnit), + } + + // Sniff .debug_info to figure out byte order. + // bytes 4:6 are the version, a tiny 16-bit number (1, 2, 3). + if len(d.info) < 6 { + return nil, DecodeError{"info", Offset(len(d.info)), "too short"} + } + x, y := d.info[4], d.info[5] + switch { + case x == 0 && y == 0: + return nil, DecodeError{"info", 4, "unsupported version 0"} + case x == 0: + d.order = binary.BigEndian + case y == 0: + d.order = binary.LittleEndian + default: + return nil, DecodeError{"info", 4, "cannot determine byte order"} + } + + u, err := d.parseUnits() + if err != nil { + return nil, err + } + d.unit = u + return d, nil +} + +// AddTypes will add one .debug_types section to the DWARF data. A +// typical object with DWARF version 4 debug info will have multiple +// .debug_types sections. The name is used for error reporting only, +// and serves to distinguish one .debug_types section from another. +func (d *Data) AddTypes(name string, types []byte) error { + return d.parseTypes(name, types) +} diff --git a/src/debug/dwarf/testdata/line-clang.elf b/src/debug/dwarf/testdata/line-clang.elf new file mode 100755 index 0000000000000000000000000000000000000000..b63cc781c410a53840c001af944e6292935ce3ff Binary files /dev/null and b/src/debug/dwarf/testdata/line-clang.elf differ diff --git a/src/debug/dwarf/testdata/line-gcc.elf b/src/debug/dwarf/testdata/line-gcc.elf new file mode 100755 index 0000000000000000000000000000000000000000..50500a8eecd95ee18ac78e130e12eef10c4aaf55 Binary files /dev/null and b/src/debug/dwarf/testdata/line-gcc.elf differ diff --git a/src/debug/dwarf/testdata/line1.c b/src/debug/dwarf/testdata/line1.c new file mode 100644 index 0000000000000000000000000000000000000000..f35864776caf0bbf7b971b69f72cfef08dba91ee --- /dev/null +++ b/src/debug/dwarf/testdata/line1.c @@ -0,0 +1,9 @@ +#include "line1.h" + +void f2(); + +int main() +{ + f1(); + f2(); +} diff --git a/src/debug/dwarf/testdata/line1.h b/src/debug/dwarf/testdata/line1.h new file mode 100644 index 0000000000000000000000000000000000000000..974d4c881778482a760d68b2f197c7a91b565126 --- /dev/null +++ b/src/debug/dwarf/testdata/line1.h @@ -0,0 +1,7 @@ +static void f1() +{ + char buf[10]; + int i; + for(i = 0; i < 10; i++) + buf[i] = 1; +} diff --git a/src/debug/dwarf/testdata/line2.c b/src/debug/dwarf/testdata/line2.c new file mode 100644 index 0000000000000000000000000000000000000000..38d89983cbb2433f398e26b09aae09b24961988b --- /dev/null +++ b/src/debug/dwarf/testdata/line2.c @@ -0,0 +1,6 @@ +#include + +void f2() +{ + printf("hello\n"); +} diff --git a/src/debug/dwarf/testdata/typedef.c b/src/debug/dwarf/testdata/typedef.c new file mode 100644 index 0000000000000000000000000000000000000000..f05f01564ff8c5f090b8c1bad1ce638bf2f475ef --- /dev/null +++ b/src/debug/dwarf/testdata/typedef.c @@ -0,0 +1,85 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +/* +Linux ELF: +gcc -gdwarf-2 -m64 -c typedef.c && gcc -gdwarf-2 -m64 -o typedef.elf typedef.o + +OS X Mach-O: +gcc -gdwarf-2 -m64 -c typedef.c -o typedef.macho +*/ +#include + +typedef volatile int* t_ptr_volatile_int; +typedef const char *t_ptr_const_char; +typedef long t_long; +typedef unsigned short t_ushort; +typedef int t_func_int_of_float_double(float, double); +typedef int (*t_ptr_func_int_of_float_double)(float, double); +typedef int (*t_ptr_func_int_of_float_complex)(float complex); +typedef int (*t_ptr_func_int_of_double_complex)(double complex); +typedef int (*t_ptr_func_int_of_long_double_complex)(long double complex); +typedef int *t_func_ptr_int_of_char_schar_uchar(char, signed char, unsigned char); +typedef void t_func_void_of_char(char); +typedef void t_func_void_of_void(void); +typedef void t_func_void_of_ptr_char_dots(char*, ...); +typedef struct my_struct { + volatile int vi; + char x : 1; + int y : 4; + int z[0]; + long long array[40]; + int zz[0]; +} t_my_struct; +typedef struct my_struct1 { + int zz [1]; +} t_my_struct1; +typedef union my_union { + volatile int vi; + char x : 1; + int y : 4; + long long array[40]; +} t_my_union; +typedef enum my_enum { + e1 = 1, + e2 = 2, + e3 = -5, + e4 = 1000000000000000LL, +} t_my_enum; + +typedef struct list t_my_list; +struct list { + short val; + t_my_list *next; +}; + +typedef struct tree { + struct tree *left, *right; + unsigned long long val; +} t_my_tree; + +t_ptr_volatile_int *a2; +t_ptr_const_char **a3a; +t_long *a4; +t_ushort *a5; +t_func_int_of_float_double *a6; +t_ptr_func_int_of_float_double *a7; +t_func_ptr_int_of_char_schar_uchar *a8; +t_func_void_of_char *a9; +t_func_void_of_void *a10; +t_func_void_of_ptr_char_dots *a11; +t_my_struct *a12; +t_my_struct1 *a12a; +t_my_union *a12b; +t_my_enum *a13; +t_my_list *a14; +t_my_tree *a15; +t_ptr_func_int_of_float_complex *a16; +t_ptr_func_int_of_double_complex *a17; +t_ptr_func_int_of_long_double_complex *a18; + +int main() +{ + return 0; +} diff --git a/src/debug/dwarf/testdata/typedef.elf b/src/debug/dwarf/testdata/typedef.elf new file mode 100755 index 0000000000000000000000000000000000000000..b2062d2c4bb828dcb229f12869f77fd5d9522278 Binary files /dev/null and b/src/debug/dwarf/testdata/typedef.elf differ diff --git a/src/debug/dwarf/testdata/typedef.elf4 b/src/debug/dwarf/testdata/typedef.elf4 new file mode 100644 index 0000000000000000000000000000000000000000..3d5a5a1b1620badce20ec4ea8c630f3bfd58c4d2 Binary files /dev/null and b/src/debug/dwarf/testdata/typedef.elf4 differ diff --git a/src/debug/dwarf/testdata/typedef.macho b/src/debug/dwarf/testdata/typedef.macho new file mode 100644 index 0000000000000000000000000000000000000000..f75afcccbfc852d284a33c01a49eb1035b6dae9c Binary files /dev/null and b/src/debug/dwarf/testdata/typedef.macho differ diff --git a/src/debug/dwarf/type.go b/src/debug/dwarf/type.go new file mode 100644 index 0000000000000000000000000000000000000000..a5daa1d0bb18e6e48b640ef5c4e87568a5f1709c --- /dev/null +++ b/src/debug/dwarf/type.go @@ -0,0 +1,706 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// DWARF type information structures. +// The format is heavily biased toward C, but for simplicity +// the String methods use a pseudo-Go syntax. + +package dwarf + +import "strconv" + +// A Type conventionally represents a pointer to any of the +// specific Type structures (CharType, StructType, etc.). +type Type interface { + Common() *CommonType + String() string + Size() int64 +} + +// A CommonType holds fields common to multiple types. +// If a field is not known or not applicable for a given type, +// the zero value is used. +type CommonType struct { + ByteSize int64 // size of value of this type, in bytes + Name string // name that can be used to refer to type +} + +func (c *CommonType) Common() *CommonType { return c } + +func (c *CommonType) Size() int64 { return c.ByteSize } + +// Basic types + +// A BasicType holds fields common to all basic types. +type BasicType struct { + CommonType + BitSize int64 + BitOffset int64 +} + +func (b *BasicType) Basic() *BasicType { return b } + +func (t *BasicType) String() string { + if t.Name != "" { + return t.Name + } + return "?" +} + +// A CharType represents a signed character type. +type CharType struct { + BasicType +} + +// A UcharType represents an unsigned character type. +type UcharType struct { + BasicType +} + +// An IntType represents a signed integer type. +type IntType struct { + BasicType +} + +// A UintType represents an unsigned integer type. +type UintType struct { + BasicType +} + +// A FloatType represents a floating point type. +type FloatType struct { + BasicType +} + +// A ComplexType represents a complex floating point type. +type ComplexType struct { + BasicType +} + +// A BoolType represents a boolean type. +type BoolType struct { + BasicType +} + +// An AddrType represents a machine address type. +type AddrType struct { + BasicType +} + +// An UnspecifiedType represents an implicit, unknown, ambiguous or nonexistent type. +type UnspecifiedType struct { + BasicType +} + +// qualifiers + +// A QualType represents a type that has the C/C++ "const", "restrict", or "volatile" qualifier. +type QualType struct { + CommonType + Qual string + Type Type +} + +func (t *QualType) String() string { return t.Qual + " " + t.Type.String() } + +func (t *QualType) Size() int64 { return t.Type.Size() } + +// An ArrayType represents a fixed size array type. +type ArrayType struct { + CommonType + Type Type + StrideBitSize int64 // if > 0, number of bits to hold each element + Count int64 // if == -1, an incomplete array, like char x[]. +} + +func (t *ArrayType) String() string { + return "[" + strconv.FormatInt(t.Count, 10) + "]" + t.Type.String() +} + +func (t *ArrayType) Size() int64 { + if t.Count == -1 { + return 0 + } + return t.Count * t.Type.Size() +} + +// A VoidType represents the C void type. +type VoidType struct { + CommonType +} + +func (t *VoidType) String() string { return "void" } + +// A PtrType represents a pointer type. +type PtrType struct { + CommonType + Type Type +} + +func (t *PtrType) String() string { return "*" + t.Type.String() } + +// A StructType represents a struct, union, or C++ class type. +type StructType struct { + CommonType + StructName string + Kind string // "struct", "union", or "class". + Field []*StructField + Incomplete bool // if true, struct, union, class is declared but not defined +} + +// A StructField represents a field in a struct, union, or C++ class type. +type StructField struct { + Name string + Type Type + ByteOffset int64 + ByteSize int64 + BitOffset int64 // within the ByteSize bytes at ByteOffset + BitSize int64 // zero if not a bit field +} + +func (t *StructType) String() string { + if t.StructName != "" { + return t.Kind + " " + t.StructName + } + return t.Defn() +} + +func (t *StructType) Defn() string { + s := t.Kind + if t.StructName != "" { + s += " " + t.StructName + } + if t.Incomplete { + s += " /*incomplete*/" + return s + } + s += " {" + for i, f := range t.Field { + if i > 0 { + s += "; " + } + s += f.Name + " " + f.Type.String() + s += "@" + strconv.FormatInt(f.ByteOffset, 10) + if f.BitSize > 0 { + s += " : " + strconv.FormatInt(f.BitSize, 10) + s += "@" + strconv.FormatInt(f.BitOffset, 10) + } + } + s += "}" + return s +} + +// An EnumType represents an enumerated type. +// The only indication of its native integer type is its ByteSize +// (inside CommonType). +type EnumType struct { + CommonType + EnumName string + Val []*EnumValue +} + +// An EnumValue represents a single enumeration value. +type EnumValue struct { + Name string + Val int64 +} + +func (t *EnumType) String() string { + s := "enum" + if t.EnumName != "" { + s += " " + t.EnumName + } + s += " {" + for i, v := range t.Val { + if i > 0 { + s += "; " + } + s += v.Name + "=" + strconv.FormatInt(v.Val, 10) + } + s += "}" + return s +} + +// A FuncType represents a function type. +type FuncType struct { + CommonType + ReturnType Type + ParamType []Type +} + +func (t *FuncType) String() string { + s := "func(" + for i, t := range t.ParamType { + if i > 0 { + s += ", " + } + s += t.String() + } + s += ")" + if t.ReturnType != nil { + s += " " + t.ReturnType.String() + } + return s +} + +// A DotDotDotType represents the variadic ... function parameter. +type DotDotDotType struct { + CommonType +} + +func (t *DotDotDotType) String() string { return "..." } + +// A TypedefType represents a named type. +type TypedefType struct { + CommonType + Type Type +} + +func (t *TypedefType) String() string { return t.Name } + +func (t *TypedefType) Size() int64 { return t.Type.Size() } + +// typeReader is used to read from either the info section or the +// types section. +type typeReader interface { + Seek(Offset) + Next() (*Entry, error) + clone() typeReader + offset() Offset + // AddressSize returns the size in bytes of addresses in the current + // compilation unit. + AddressSize() int +} + +// Type reads the type at off in the DWARF ``info'' section. +func (d *Data) Type(off Offset) (Type, error) { + return d.readType("info", d.Reader(), off, d.typeCache) +} + +// readType reads a type from r at off of name using and updating a +// type cache. +func (d *Data) readType(name string, r typeReader, off Offset, typeCache map[Offset]Type) (Type, error) { + if t, ok := typeCache[off]; ok { + return t, nil + } + r.Seek(off) + e, err := r.Next() + if err != nil { + return nil, err + } + addressSize := r.AddressSize() + if e == nil || e.Offset != off { + return nil, DecodeError{name, off, "no type at offset"} + } + + // Parse type from Entry. + // Must always set typeCache[off] before calling + // d.Type recursively, to handle circular types correctly. + var typ Type + + nextDepth := 0 + + // Get next child; set err if error happens. + next := func() *Entry { + if !e.Children { + return nil + } + // Only return direct children. + // Skip over composite entries that happen to be nested + // inside this one. Most DWARF generators wouldn't generate + // such a thing, but clang does. + // See golang.org/issue/6472. + for { + kid, err1 := r.Next() + if err1 != nil { + err = err1 + return nil + } + if kid == nil { + err = DecodeError{name, r.offset(), "unexpected end of DWARF entries"} + return nil + } + if kid.Tag == 0 { + if nextDepth > 0 { + nextDepth-- + continue + } + return nil + } + if kid.Children { + nextDepth++ + } + if nextDepth > 0 { + continue + } + return kid + } + } + + // Get Type referred to by Entry's AttrType field. + // Set err if error happens. Not having a type is an error. + typeOf := func(e *Entry) Type { + tval := e.Val(AttrType) + var t Type + switch toff := tval.(type) { + case Offset: + if t, err = d.readType(name, r.clone(), toff, typeCache); err != nil { + return nil + } + case uint64: + if t, err = d.sigToType(toff); err != nil { + return nil + } + default: + // It appears that no Type means "void". + return new(VoidType) + } + return t + } + + switch e.Tag { + case TagArrayType: + // Multi-dimensional array. (DWARF v2 §5.4) + // Attributes: + // AttrType:subtype [required] + // AttrStrideSize: size in bits of each element of the array + // AttrByteSize: size of entire array + // Children: + // TagSubrangeType or TagEnumerationType giving one dimension. + // dimensions are in left to right order. + t := new(ArrayType) + typ = t + typeCache[off] = t + if t.Type = typeOf(e); err != nil { + goto Error + } + t.StrideBitSize, _ = e.Val(AttrStrideSize).(int64) + + // Accumulate dimensions, + var dims []int64 + for kid := next(); kid != nil; kid = next() { + // TODO(rsc): Can also be TagEnumerationType + // but haven't seen that in the wild yet. + switch kid.Tag { + case TagSubrangeType: + count, ok := kid.Val(AttrCount).(int64) + if !ok { + // Old binaries may have an upper bound instead. + count, ok = kid.Val(AttrUpperBound).(int64) + if ok { + count++ // Length is one more than upper bound. + } else if len(dims) == 0 { + count = -1 // As in x[]. + } + } + dims = append(dims, count) + case TagEnumerationType: + err = DecodeError{name, kid.Offset, "cannot handle enumeration type as array bound"} + goto Error + } + } + if len(dims) == 0 { + // LLVM generates this for x[]. + dims = []int64{-1} + } + + t.Count = dims[0] + for i := len(dims) - 1; i >= 1; i-- { + t.Type = &ArrayType{Type: t.Type, Count: dims[i]} + } + + case TagBaseType: + // Basic type. (DWARF v2 §5.1) + // Attributes: + // AttrName: name of base type in programming language of the compilation unit [required] + // AttrEncoding: encoding value for type (encFloat etc) [required] + // AttrByteSize: size of type in bytes [required] + // AttrBitOffset: for sub-byte types, size in bits + // AttrBitSize: for sub-byte types, bit offset of high order bit in the AttrByteSize bytes + name, _ := e.Val(AttrName).(string) + enc, ok := e.Val(AttrEncoding).(int64) + if !ok { + err = DecodeError{name, e.Offset, "missing encoding attribute for " + name} + goto Error + } + switch enc { + default: + err = DecodeError{name, e.Offset, "unrecognized encoding attribute value"} + goto Error + + case encAddress: + typ = new(AddrType) + case encBoolean: + typ = new(BoolType) + case encComplexFloat: + typ = new(ComplexType) + if name == "complex" { + // clang writes out 'complex' instead of 'complex float' or 'complex double'. + // clang also writes out a byte size that we can use to distinguish. + // See issue 8694. + switch byteSize, _ := e.Val(AttrByteSize).(int64); byteSize { + case 8: + name = "complex float" + case 16: + name = "complex double" + } + } + case encFloat: + typ = new(FloatType) + case encSigned: + typ = new(IntType) + case encUnsigned: + typ = new(UintType) + case encSignedChar: + typ = new(CharType) + case encUnsignedChar: + typ = new(UcharType) + } + typeCache[off] = typ + t := typ.(interface { + Basic() *BasicType + }).Basic() + t.Name = name + t.BitSize, _ = e.Val(AttrBitSize).(int64) + t.BitOffset, _ = e.Val(AttrBitOffset).(int64) + + case TagClassType, TagStructType, TagUnionType: + // Structure, union, or class type. (DWARF v2 §5.5) + // Attributes: + // AttrName: name of struct, union, or class + // AttrByteSize: byte size [required] + // AttrDeclaration: if true, struct/union/class is incomplete + // Children: + // TagMember to describe one member. + // AttrName: name of member [required] + // AttrType: type of member [required] + // AttrByteSize: size in bytes + // AttrBitOffset: bit offset within bytes for bit fields + // AttrBitSize: bit size for bit fields + // AttrDataMemberLoc: location within struct [required for struct, class] + // There is much more to handle C++, all ignored for now. + t := new(StructType) + typ = t + typeCache[off] = t + switch e.Tag { + case TagClassType: + t.Kind = "class" + case TagStructType: + t.Kind = "struct" + case TagUnionType: + t.Kind = "union" + } + t.StructName, _ = e.Val(AttrName).(string) + t.Incomplete = e.Val(AttrDeclaration) != nil + t.Field = make([]*StructField, 0, 8) + var lastFieldType *Type + var lastFieldBitOffset int64 + for kid := next(); kid != nil; kid = next() { + if kid.Tag == TagMember { + f := new(StructField) + if f.Type = typeOf(kid); err != nil { + goto Error + } + switch loc := kid.Val(AttrDataMemberLoc).(type) { + case []byte: + // TODO: Should have original compilation + // unit here, not unknownFormat. + b := makeBuf(d, unknownFormat{}, "location", 0, loc) + if b.uint8() != opPlusUconst { + err = DecodeError{name, kid.Offset, "unexpected opcode"} + goto Error + } + f.ByteOffset = int64(b.uint()) + if b.err != nil { + err = b.err + goto Error + } + case int64: + f.ByteOffset = loc + } + + haveBitOffset := false + f.Name, _ = kid.Val(AttrName).(string) + f.ByteSize, _ = kid.Val(AttrByteSize).(int64) + f.BitOffset, haveBitOffset = kid.Val(AttrBitOffset).(int64) + f.BitSize, _ = kid.Val(AttrBitSize).(int64) + t.Field = append(t.Field, f) + + bito := f.BitOffset + if !haveBitOffset { + bito = f.ByteOffset * 8 + } + if bito == lastFieldBitOffset && t.Kind != "union" { + // Last field was zero width. Fix array length. + // (DWARF writes out 0-length arrays as if they were 1-length arrays.) + zeroArray(lastFieldType) + } + lastFieldType = &f.Type + lastFieldBitOffset = bito + } + } + if t.Kind != "union" { + b, ok := e.Val(AttrByteSize).(int64) + if ok && b*8 == lastFieldBitOffset { + // Final field must be zero width. Fix array length. + zeroArray(lastFieldType) + } + } + + case TagConstType, TagVolatileType, TagRestrictType: + // Type modifier (DWARF v2 §5.2) + // Attributes: + // AttrType: subtype + t := new(QualType) + typ = t + typeCache[off] = t + if t.Type = typeOf(e); err != nil { + goto Error + } + switch e.Tag { + case TagConstType: + t.Qual = "const" + case TagRestrictType: + t.Qual = "restrict" + case TagVolatileType: + t.Qual = "volatile" + } + + case TagEnumerationType: + // Enumeration type (DWARF v2 §5.6) + // Attributes: + // AttrName: enum name if any + // AttrByteSize: bytes required to represent largest value + // Children: + // TagEnumerator: + // AttrName: name of constant + // AttrConstValue: value of constant + t := new(EnumType) + typ = t + typeCache[off] = t + t.EnumName, _ = e.Val(AttrName).(string) + t.Val = make([]*EnumValue, 0, 8) + for kid := next(); kid != nil; kid = next() { + if kid.Tag == TagEnumerator { + f := new(EnumValue) + f.Name, _ = kid.Val(AttrName).(string) + f.Val, _ = kid.Val(AttrConstValue).(int64) + n := len(t.Val) + if n >= cap(t.Val) { + val := make([]*EnumValue, n, n*2) + copy(val, t.Val) + t.Val = val + } + t.Val = t.Val[0 : n+1] + t.Val[n] = f + } + } + + case TagPointerType: + // Type modifier (DWARF v2 §5.2) + // Attributes: + // AttrType: subtype [not required! void* has no AttrType] + // AttrAddrClass: address class [ignored] + t := new(PtrType) + typ = t + typeCache[off] = t + if e.Val(AttrType) == nil { + t.Type = &VoidType{} + break + } + t.Type = typeOf(e) + + case TagSubroutineType: + // Subroutine type. (DWARF v2 §5.7) + // Attributes: + // AttrType: type of return value if any + // AttrName: possible name of type [ignored] + // AttrPrototyped: whether used ANSI C prototype [ignored] + // Children: + // TagFormalParameter: typed parameter + // AttrType: type of parameter + // TagUnspecifiedParameter: final ... + t := new(FuncType) + typ = t + typeCache[off] = t + if t.ReturnType = typeOf(e); err != nil { + goto Error + } + t.ParamType = make([]Type, 0, 8) + for kid := next(); kid != nil; kid = next() { + var tkid Type + switch kid.Tag { + default: + continue + case TagFormalParameter: + if tkid = typeOf(kid); err != nil { + goto Error + } + case TagUnspecifiedParameters: + tkid = &DotDotDotType{} + } + t.ParamType = append(t.ParamType, tkid) + } + + case TagTypedef: + // Typedef (DWARF v2 §5.3) + // Attributes: + // AttrName: name [required] + // AttrType: type definition [required] + t := new(TypedefType) + typ = t + typeCache[off] = t + t.Name, _ = e.Val(AttrName).(string) + t.Type = typeOf(e) + + case TagUnspecifiedType: + // Unspecified type (DWARF v3 §5.2) + // Attributes: + // AttrName: name + t := new(UnspecifiedType) + typ = t + typeCache[off] = t + t.Name, _ = e.Val(AttrName).(string) + } + + if err != nil { + goto Error + } + + { + b, ok := e.Val(AttrByteSize).(int64) + if !ok { + b = -1 + switch t := typ.(type) { + case *TypedefType: + b = t.Type.Size() + case *PtrType: + b = int64(addressSize) + } + } + typ.Common().ByteSize = b + } + return typ, nil + +Error: + // If the parse fails, take the type out of the cache + // so that the next call with this offset doesn't hit + // the cache and return success. + delete(typeCache, off) + return nil, err +} + +func zeroArray(t *Type) { + if t == nil { + return + } + at, ok := (*t).(*ArrayType) + if !ok || at.Type.Size() == 0 { + return + } + // Make a copy to avoid invalidating typeCache. + tt := *at + tt.Count = 0 + *t = &tt +} diff --git a/src/debug/dwarf/type_test.go b/src/debug/dwarf/type_test.go new file mode 100644 index 0000000000000000000000000000000000000000..2cb85e74bb23a76a81817f6bdafd0b327a838c43 --- /dev/null +++ b/src/debug/dwarf/type_test.go @@ -0,0 +1,122 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package dwarf_test + +import ( + . "debug/dwarf" + "debug/elf" + "debug/macho" + "testing" +) + +var typedefTests = map[string]string{ + "t_ptr_volatile_int": "*volatile int", + "t_ptr_const_char": "*const char", + "t_long": "long int", + "t_ushort": "short unsigned int", + "t_func_int_of_float_double": "func(float, double) int", + "t_ptr_func_int_of_float_double": "*func(float, double) int", + "t_ptr_func_int_of_float_complex": "*func(complex float) int", + "t_ptr_func_int_of_double_complex": "*func(complex double) int", + "t_ptr_func_int_of_long_double_complex": "*func(complex long double) int", + "t_func_ptr_int_of_char_schar_uchar": "func(char, signed char, unsigned char) *int", + "t_func_void_of_char": "func(char) void", + "t_func_void_of_void": "func() void", + "t_func_void_of_ptr_char_dots": "func(*char, ...) void", + "t_my_struct": "struct my_struct {vi volatile int@0; x char@4 : 1@7; y int@4 : 4@27; z [0]int@8; array [40]long long int@8; zz [0]int@328}", + "t_my_struct1": "struct my_struct1 {zz [1]int@0}", + "t_my_union": "union my_union {vi volatile int@0; x char@0 : 1@7; y int@0 : 4@28; array [40]long long int@0}", + "t_my_enum": "enum my_enum {e1=1; e2=2; e3=-5; e4=1000000000000000}", + "t_my_list": "struct list {val short int@0; next *t_my_list@8}", + "t_my_tree": "struct tree {left *struct tree@0; right *struct tree@8; val long long unsigned int@16}", +} + +// As Apple converts gcc to a clang-based front end +// they keep breaking the DWARF output. This map lists the +// conversion from real answer to Apple answer. +var machoBug = map[string]string{ + "func(*char, ...) void": "func(*char) void", + "enum my_enum {e1=1; e2=2; e3=-5; e4=1000000000000000}": "enum my_enum {e1=1; e2=2; e3=-5; e4=-1530494976}", +} + +func elfData(t *testing.T, name string) *Data { + f, err := elf.Open(name) + if err != nil { + t.Fatal(err) + } + + d, err := f.DWARF() + if err != nil { + t.Fatal(err) + } + return d +} + +func machoData(t *testing.T, name string) *Data { + f, err := macho.Open(name) + if err != nil { + t.Fatal(err) + } + + d, err := f.DWARF() + if err != nil { + t.Fatal(err) + } + return d +} + +func TestTypedefsELF(t *testing.T) { testTypedefs(t, elfData(t, "testdata/typedef.elf"), "elf") } + +func TestTypedefsMachO(t *testing.T) { + testTypedefs(t, machoData(t, "testdata/typedef.macho"), "macho") +} + +func TestTypedefsELFDwarf4(t *testing.T) { testTypedefs(t, elfData(t, "testdata/typedef.elf4"), "elf") } + +func testTypedefs(t *testing.T, d *Data, kind string) { + r := d.Reader() + seen := make(map[string]bool) + for { + e, err := r.Next() + if err != nil { + t.Fatal("r.Next:", err) + } + if e == nil { + break + } + if e.Tag == TagTypedef { + typ, err := d.Type(e.Offset) + if err != nil { + t.Fatal("d.Type:", err) + } + t1 := typ.(*TypedefType) + var typstr string + if ts, ok := t1.Type.(*StructType); ok { + typstr = ts.Defn() + } else { + typstr = t1.Type.String() + } + + if want, ok := typedefTests[t1.Name]; ok { + if seen[t1.Name] { + t.Errorf("multiple definitions for %s", t1.Name) + } + seen[t1.Name] = true + if typstr != want && (kind != "macho" || typstr != machoBug[want]) { + t.Errorf("%s:\n\thave %s\n\twant %s", t1.Name, typstr, want) + } + } + } + if e.Tag != TagCompileUnit { + r.SkipChildren() + } + } + + for k := range typedefTests { + if !seen[k] { + t.Errorf("missing %s", k) + } + } +} diff --git a/src/debug/dwarf/typeunit.go b/src/debug/dwarf/typeunit.go new file mode 100644 index 0000000000000000000000000000000000000000..9cfb4a8b256d312da316f6132d4684d3ca849e35 --- /dev/null +++ b/src/debug/dwarf/typeunit.go @@ -0,0 +1,165 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package dwarf + +import ( + "fmt" + "strconv" +) + +// Parse the type units stored in a DWARF4 .debug_types section. Each +// type unit defines a single primary type and an 8-byte signature. +// Other sections may then use formRefSig8 to refer to the type. + +// The typeUnit format is a single type with a signature. It holds +// the same data as a compilation unit. +type typeUnit struct { + unit + toff Offset // Offset to signature type within data. + name string // Name of .debug_type section. + cache Type // Cache the type, nil to start. +} + +// Parse a .debug_types section. +func (d *Data) parseTypes(name string, types []byte) error { + b := makeBuf(d, unknownFormat{}, name, 0, types) + for len(b.data) > 0 { + base := b.off + n, dwarf64 := b.unitLength() + if n != Offset(uint32(n)) { + b.error("type unit length overflow") + return b.err + } + hdroff := b.off + vers := int(b.uint16()) + if vers != 4 { + b.error("unsupported DWARF version " + strconv.Itoa(vers)) + return b.err + } + var ao uint32 + if !dwarf64 { + ao = b.uint32() + } else { + ao64 := b.uint64() + if ao64 != uint64(uint32(ao64)) { + b.error("type unit abbrev offset overflow") + return b.err + } + ao = uint32(ao64) + } + atable, err := d.parseAbbrev(ao, vers) + if err != nil { + return err + } + asize := b.uint8() + sig := b.uint64() + + var toff uint32 + if !dwarf64 { + toff = b.uint32() + } else { + to64 := b.uint64() + if to64 != uint64(uint32(to64)) { + b.error("type unit type offset overflow") + return b.err + } + toff = uint32(to64) + } + + boff := b.off + d.typeSigs[sig] = &typeUnit{ + unit: unit{ + base: base, + off: boff, + data: b.bytes(int(n - (b.off - hdroff))), + atable: atable, + asize: int(asize), + vers: int(vers), + is64: dwarf64, + }, + toff: Offset(toff), + name: name, + } + if b.err != nil { + return b.err + } + } + return nil +} + +// Return the type for a type signature. +func (d *Data) sigToType(sig uint64) (Type, error) { + tu := d.typeSigs[sig] + if tu == nil { + return nil, fmt.Errorf("no type unit with signature %v", sig) + } + if tu.cache != nil { + return tu.cache, nil + } + + b := makeBuf(d, tu, tu.name, tu.off, tu.data) + r := &typeUnitReader{d: d, tu: tu, b: b} + t, err := d.readType(tu.name, r, Offset(tu.toff), make(map[Offset]Type)) + if err != nil { + return nil, err + } + + tu.cache = t + return t, nil +} + +// typeUnitReader is a typeReader for a tagTypeUnit. +type typeUnitReader struct { + d *Data + tu *typeUnit + b buf + err error +} + +// Seek to a new position in the type unit. +func (tur *typeUnitReader) Seek(off Offset) { + tur.err = nil + doff := off - tur.tu.off + if doff < 0 || doff >= Offset(len(tur.tu.data)) { + tur.err = fmt.Errorf("%s: offset %d out of range; max %d", tur.tu.name, doff, len(tur.tu.data)) + return + } + tur.b = makeBuf(tur.d, tur.tu, tur.tu.name, off, tur.tu.data[doff:]) +} + +// AddressSize returns the size in bytes of addresses in the current type unit. +func (tur *typeUnitReader) AddressSize() int { + return tur.tu.unit.asize +} + +// Next reads the next Entry from the type unit. +func (tur *typeUnitReader) Next() (*Entry, error) { + if tur.err != nil { + return nil, tur.err + } + if len(tur.tu.data) == 0 { + return nil, nil + } + e := tur.b.entry(tur.tu.atable, tur.tu.base) + if tur.b.err != nil { + tur.err = tur.b.err + return nil, tur.err + } + return e, nil +} + +// clone returns a new reader for the type unit. +func (tur *typeUnitReader) clone() typeReader { + return &typeUnitReader{ + d: tur.d, + tu: tur.tu, + b: makeBuf(tur.d, tur.tu, tur.tu.name, tur.tu.off, tur.tu.data), + } +} + +// offset returns the current offset. +func (tur *typeUnitReader) offset() Offset { + return tur.b.off +} diff --git a/src/debug/dwarf/unit.go b/src/debug/dwarf/unit.go new file mode 100644 index 0000000000000000000000000000000000000000..ceb6cdbff321933cd10f06c5c174070fc7344fd3 --- /dev/null +++ b/src/debug/dwarf/unit.go @@ -0,0 +1,103 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package dwarf + +import ( + "sort" + "strconv" +) + +// DWARF debug info is split into a sequence of compilation units. +// Each unit has its own abbreviation table and address size. + +type unit struct { + base Offset // byte offset of header within the aggregate info + off Offset // byte offset of data within the aggregate info + data []byte + atable abbrevTable + asize int + vers int + is64 bool // True for 64-bit DWARF format +} + +// Implement the dataFormat interface. + +func (u *unit) version() int { + return u.vers +} + +func (u *unit) dwarf64() (bool, bool) { + return u.is64, true +} + +func (u *unit) addrsize() int { + return u.asize +} + +func (d *Data) parseUnits() ([]unit, error) { + // Count units. + nunit := 0 + b := makeBuf(d, unknownFormat{}, "info", 0, d.info) + for len(b.data) > 0 { + len, _ := b.unitLength() + if len != Offset(uint32(len)) { + b.error("unit length overflow") + break + } + b.skip(int(len)) + nunit++ + } + if b.err != nil { + return nil, b.err + } + + // Again, this time writing them down. + b = makeBuf(d, unknownFormat{}, "info", 0, d.info) + units := make([]unit, nunit) + for i := range units { + u := &units[i] + u.base = b.off + var n Offset + n, u.is64 = b.unitLength() + vers := b.uint16() + if vers != 2 && vers != 3 && vers != 4 { + b.error("unsupported DWARF version " + strconv.Itoa(int(vers))) + break + } + u.vers = int(vers) + atable, err := d.parseAbbrev(b.uint32(), u.vers) + if err != nil { + if b.err == nil { + b.err = err + } + break + } + u.atable = atable + u.asize = int(b.uint8()) + u.off = b.off + u.data = b.bytes(int(n - (2 + 4 + 1))) + } + if b.err != nil { + return nil, b.err + } + return units, nil +} + +// offsetToUnit returns the index of the unit containing offset off. +// It returns -1 if no unit contains this offset. +func (d *Data) offsetToUnit(off Offset) int { + // Find the unit after off + next := sort.Search(len(d.unit), func(i int) bool { + return d.unit[i].off > off + }) + if next == 0 { + return -1 + } + u := &d.unit[next-1] + if u.off <= off && off < u.off+Offset(len(u.data)) { + return next - 1 + } + return -1 +} diff --git a/src/debug/elf/elf.go b/src/debug/elf/elf.go new file mode 100644 index 0000000000000000000000000000000000000000..70daeecd6d7a18655d45ce76a18901830a3e9cd7 --- /dev/null +++ b/src/debug/elf/elf.go @@ -0,0 +1,1951 @@ +/* + * ELF constants and data structures + * + * Derived from: + * $FreeBSD: src/sys/sys/elf32.h,v 1.8.14.1 2005/12/30 22:13:58 marcel Exp $ + * $FreeBSD: src/sys/sys/elf64.h,v 1.10.14.1 2005/12/30 22:13:58 marcel Exp $ + * $FreeBSD: src/sys/sys/elf_common.h,v 1.15.8.1 2005/12/30 22:13:58 marcel Exp $ + * $FreeBSD: src/sys/alpha/include/elf.h,v 1.14 2003/09/25 01:10:22 peter Exp $ + * $FreeBSD: src/sys/amd64/include/elf.h,v 1.18 2004/08/03 08:21:48 dfr Exp $ + * $FreeBSD: src/sys/arm/include/elf.h,v 1.5.2.1 2006/06/30 21:42:52 cognet Exp $ + * $FreeBSD: src/sys/i386/include/elf.h,v 1.16 2004/08/02 19:12:17 dfr Exp $ + * $FreeBSD: src/sys/powerpc/include/elf.h,v 1.7 2004/11/02 09:47:01 ssouhlal Exp $ + * $FreeBSD: src/sys/sparc64/include/elf.h,v 1.12 2003/09/25 01:10:26 peter Exp $ + * "ELF for the ARM® 64-bit Architecture (AArch64)" (ARM IHI 0056B) + * + * Copyright (c) 1996-1998 John D. Polstra. All rights reserved. + * Copyright (c) 2001 David E. O'Brien + * Portions Copyright 2009 The Go Authors. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +package elf + +import "strconv" + +/* + * Constants + */ + +// Indexes into the Header.Ident array. +const ( + EI_CLASS = 4 /* Class of machine. */ + EI_DATA = 5 /* Data format. */ + EI_VERSION = 6 /* ELF format version. */ + EI_OSABI = 7 /* Operating system / ABI identification */ + EI_ABIVERSION = 8 /* ABI version */ + EI_PAD = 9 /* Start of padding (per SVR4 ABI). */ + EI_NIDENT = 16 /* Size of e_ident array. */ +) + +// Initial magic number for ELF files. +const ELFMAG = "\177ELF" + +// Version is found in Header.Ident[EI_VERSION] and Header.Version. +type Version byte + +const ( + EV_NONE Version = 0 + EV_CURRENT Version = 1 +) + +var versionStrings = []intName{ + {0, "EV_NONE"}, + {1, "EV_CURRENT"}, +} + +func (i Version) String() string { return stringName(uint32(i), versionStrings, false) } +func (i Version) GoString() string { return stringName(uint32(i), versionStrings, true) } + +// Class is found in Header.Ident[EI_CLASS] and Header.Class. +type Class byte + +const ( + ELFCLASSNONE Class = 0 /* Unknown class. */ + ELFCLASS32 Class = 1 /* 32-bit architecture. */ + ELFCLASS64 Class = 2 /* 64-bit architecture. */ +) + +var classStrings = []intName{ + {0, "ELFCLASSNONE"}, + {1, "ELFCLASS32"}, + {2, "ELFCLASS64"}, +} + +func (i Class) String() string { return stringName(uint32(i), classStrings, false) } +func (i Class) GoString() string { return stringName(uint32(i), classStrings, true) } + +// Data is found in Header.Ident[EI_DATA] and Header.Data. +type Data byte + +const ( + ELFDATANONE Data = 0 /* Unknown data format. */ + ELFDATA2LSB Data = 1 /* 2's complement little-endian. */ + ELFDATA2MSB Data = 2 /* 2's complement big-endian. */ +) + +var dataStrings = []intName{ + {0, "ELFDATANONE"}, + {1, "ELFDATA2LSB"}, + {2, "ELFDATA2MSB"}, +} + +func (i Data) String() string { return stringName(uint32(i), dataStrings, false) } +func (i Data) GoString() string { return stringName(uint32(i), dataStrings, true) } + +// OSABI is found in Header.Ident[EI_OSABI] and Header.OSABI. +type OSABI byte + +const ( + ELFOSABI_NONE OSABI = 0 /* UNIX System V ABI */ + ELFOSABI_HPUX OSABI = 1 /* HP-UX operating system */ + ELFOSABI_NETBSD OSABI = 2 /* NetBSD */ + ELFOSABI_LINUX OSABI = 3 /* GNU/Linux */ + ELFOSABI_HURD OSABI = 4 /* GNU/Hurd */ + ELFOSABI_86OPEN OSABI = 5 /* 86Open common IA32 ABI */ + ELFOSABI_SOLARIS OSABI = 6 /* Solaris */ + ELFOSABI_AIX OSABI = 7 /* AIX */ + ELFOSABI_IRIX OSABI = 8 /* IRIX */ + ELFOSABI_FREEBSD OSABI = 9 /* FreeBSD */ + ELFOSABI_TRU64 OSABI = 10 /* TRU64 UNIX */ + ELFOSABI_MODESTO OSABI = 11 /* Novell Modesto */ + ELFOSABI_OPENBSD OSABI = 12 /* OpenBSD */ + ELFOSABI_OPENVMS OSABI = 13 /* Open VMS */ + ELFOSABI_NSK OSABI = 14 /* HP Non-Stop Kernel */ + ELFOSABI_ARM OSABI = 97 /* ARM */ + ELFOSABI_STANDALONE OSABI = 255 /* Standalone (embedded) application */ +) + +var osabiStrings = []intName{ + {0, "ELFOSABI_NONE"}, + {1, "ELFOSABI_HPUX"}, + {2, "ELFOSABI_NETBSD"}, + {3, "ELFOSABI_LINUX"}, + {4, "ELFOSABI_HURD"}, + {5, "ELFOSABI_86OPEN"}, + {6, "ELFOSABI_SOLARIS"}, + {7, "ELFOSABI_AIX"}, + {8, "ELFOSABI_IRIX"}, + {9, "ELFOSABI_FREEBSD"}, + {10, "ELFOSABI_TRU64"}, + {11, "ELFOSABI_MODESTO"}, + {12, "ELFOSABI_OPENBSD"}, + {13, "ELFOSABI_OPENVMS"}, + {14, "ELFOSABI_NSK"}, + {97, "ELFOSABI_ARM"}, + {255, "ELFOSABI_STANDALONE"}, +} + +func (i OSABI) String() string { return stringName(uint32(i), osabiStrings, false) } +func (i OSABI) GoString() string { return stringName(uint32(i), osabiStrings, true) } + +// Type is found in Header.Type. +type Type uint16 + +const ( + ET_NONE Type = 0 /* Unknown type. */ + ET_REL Type = 1 /* Relocatable. */ + ET_EXEC Type = 2 /* Executable. */ + ET_DYN Type = 3 /* Shared object. */ + ET_CORE Type = 4 /* Core file. */ + ET_LOOS Type = 0xfe00 /* First operating system specific. */ + ET_HIOS Type = 0xfeff /* Last operating system-specific. */ + ET_LOPROC Type = 0xff00 /* First processor-specific. */ + ET_HIPROC Type = 0xffff /* Last processor-specific. */ +) + +var typeStrings = []intName{ + {0, "ET_NONE"}, + {1, "ET_REL"}, + {2, "ET_EXEC"}, + {3, "ET_DYN"}, + {4, "ET_CORE"}, + {0xfe00, "ET_LOOS"}, + {0xfeff, "ET_HIOS"}, + {0xff00, "ET_LOPROC"}, + {0xffff, "ET_HIPROC"}, +} + +func (i Type) String() string { return stringName(uint32(i), typeStrings, false) } +func (i Type) GoString() string { return stringName(uint32(i), typeStrings, true) } + +// Machine is found in Header.Machine. +type Machine uint16 + +const ( + EM_NONE Machine = 0 /* Unknown machine. */ + EM_M32 Machine = 1 /* AT&T WE32100. */ + EM_SPARC Machine = 2 /* Sun SPARC. */ + EM_386 Machine = 3 /* Intel i386. */ + EM_68K Machine = 4 /* Motorola 68000. */ + EM_88K Machine = 5 /* Motorola 88000. */ + EM_860 Machine = 7 /* Intel i860. */ + EM_MIPS Machine = 8 /* MIPS R3000 Big-Endian only. */ + EM_S370 Machine = 9 /* IBM System/370. */ + EM_MIPS_RS3_LE Machine = 10 /* MIPS R3000 Little-Endian. */ + EM_PARISC Machine = 15 /* HP PA-RISC. */ + EM_VPP500 Machine = 17 /* Fujitsu VPP500. */ + EM_SPARC32PLUS Machine = 18 /* SPARC v8plus. */ + EM_960 Machine = 19 /* Intel 80960. */ + EM_PPC Machine = 20 /* PowerPC 32-bit. */ + EM_PPC64 Machine = 21 /* PowerPC 64-bit. */ + EM_S390 Machine = 22 /* IBM System/390. */ + EM_V800 Machine = 36 /* NEC V800. */ + EM_FR20 Machine = 37 /* Fujitsu FR20. */ + EM_RH32 Machine = 38 /* TRW RH-32. */ + EM_RCE Machine = 39 /* Motorola RCE. */ + EM_ARM Machine = 40 /* ARM. */ + EM_SH Machine = 42 /* Hitachi SH. */ + EM_SPARCV9 Machine = 43 /* SPARC v9 64-bit. */ + EM_TRICORE Machine = 44 /* Siemens TriCore embedded processor. */ + EM_ARC Machine = 45 /* Argonaut RISC Core. */ + EM_H8_300 Machine = 46 /* Hitachi H8/300. */ + EM_H8_300H Machine = 47 /* Hitachi H8/300H. */ + EM_H8S Machine = 48 /* Hitachi H8S. */ + EM_H8_500 Machine = 49 /* Hitachi H8/500. */ + EM_IA_64 Machine = 50 /* Intel IA-64 Processor. */ + EM_MIPS_X Machine = 51 /* Stanford MIPS-X. */ + EM_COLDFIRE Machine = 52 /* Motorola ColdFire. */ + EM_68HC12 Machine = 53 /* Motorola M68HC12. */ + EM_MMA Machine = 54 /* Fujitsu MMA. */ + EM_PCP Machine = 55 /* Siemens PCP. */ + EM_NCPU Machine = 56 /* Sony nCPU. */ + EM_NDR1 Machine = 57 /* Denso NDR1 microprocessor. */ + EM_STARCORE Machine = 58 /* Motorola Star*Core processor. */ + EM_ME16 Machine = 59 /* Toyota ME16 processor. */ + EM_ST100 Machine = 60 /* STMicroelectronics ST100 processor. */ + EM_TINYJ Machine = 61 /* Advanced Logic Corp. TinyJ processor. */ + EM_X86_64 Machine = 62 /* Advanced Micro Devices x86-64 */ + EM_AARCH64 Machine = 183 /* ARM 64-bit Architecture (AArch64) */ + + /* Non-standard or deprecated. */ + EM_486 Machine = 6 /* Intel i486. */ + EM_MIPS_RS4_BE Machine = 10 /* MIPS R4000 Big-Endian */ + EM_ALPHA_STD Machine = 41 /* Digital Alpha (standard value). */ + EM_ALPHA Machine = 0x9026 /* Alpha (written in the absence of an ABI) */ +) + +var machineStrings = []intName{ + {0, "EM_NONE"}, + {1, "EM_M32"}, + {2, "EM_SPARC"}, + {3, "EM_386"}, + {4, "EM_68K"}, + {5, "EM_88K"}, + {7, "EM_860"}, + {8, "EM_MIPS"}, + {9, "EM_S370"}, + {10, "EM_MIPS_RS3_LE"}, + {15, "EM_PARISC"}, + {17, "EM_VPP500"}, + {18, "EM_SPARC32PLUS"}, + {19, "EM_960"}, + {20, "EM_PPC"}, + {21, "EM_PPC64"}, + {22, "EM_S390"}, + {36, "EM_V800"}, + {37, "EM_FR20"}, + {38, "EM_RH32"}, + {39, "EM_RCE"}, + {40, "EM_ARM"}, + {42, "EM_SH"}, + {43, "EM_SPARCV9"}, + {44, "EM_TRICORE"}, + {45, "EM_ARC"}, + {46, "EM_H8_300"}, + {47, "EM_H8_300H"}, + {48, "EM_H8S"}, + {49, "EM_H8_500"}, + {50, "EM_IA_64"}, + {51, "EM_MIPS_X"}, + {52, "EM_COLDFIRE"}, + {53, "EM_68HC12"}, + {54, "EM_MMA"}, + {55, "EM_PCP"}, + {56, "EM_NCPU"}, + {57, "EM_NDR1"}, + {58, "EM_STARCORE"}, + {59, "EM_ME16"}, + {60, "EM_ST100"}, + {61, "EM_TINYJ"}, + {62, "EM_X86_64"}, + + /* Non-standard or deprecated. */ + {6, "EM_486"}, + {10, "EM_MIPS_RS4_BE"}, + {41, "EM_ALPHA_STD"}, + {0x9026, "EM_ALPHA"}, +} + +func (i Machine) String() string { return stringName(uint32(i), machineStrings, false) } +func (i Machine) GoString() string { return stringName(uint32(i), machineStrings, true) } + +// Special section indices. +type SectionIndex int + +const ( + SHN_UNDEF SectionIndex = 0 /* Undefined, missing, irrelevant. */ + SHN_LORESERVE SectionIndex = 0xff00 /* First of reserved range. */ + SHN_LOPROC SectionIndex = 0xff00 /* First processor-specific. */ + SHN_HIPROC SectionIndex = 0xff1f /* Last processor-specific. */ + SHN_LOOS SectionIndex = 0xff20 /* First operating system-specific. */ + SHN_HIOS SectionIndex = 0xff3f /* Last operating system-specific. */ + SHN_ABS SectionIndex = 0xfff1 /* Absolute values. */ + SHN_COMMON SectionIndex = 0xfff2 /* Common data. */ + SHN_XINDEX SectionIndex = 0xffff /* Escape; index stored elsewhere. */ + SHN_HIRESERVE SectionIndex = 0xffff /* Last of reserved range. */ +) + +var shnStrings = []intName{ + {0, "SHN_UNDEF"}, + {0xff00, "SHN_LOPROC"}, + {0xff20, "SHN_LOOS"}, + {0xfff1, "SHN_ABS"}, + {0xfff2, "SHN_COMMON"}, + {0xffff, "SHN_XINDEX"}, +} + +func (i SectionIndex) String() string { return stringName(uint32(i), shnStrings, false) } +func (i SectionIndex) GoString() string { return stringName(uint32(i), shnStrings, true) } + +// Section type. +type SectionType uint32 + +const ( + SHT_NULL SectionType = 0 /* inactive */ + SHT_PROGBITS SectionType = 1 /* program defined information */ + SHT_SYMTAB SectionType = 2 /* symbol table section */ + SHT_STRTAB SectionType = 3 /* string table section */ + SHT_RELA SectionType = 4 /* relocation section with addends */ + SHT_HASH SectionType = 5 /* symbol hash table section */ + SHT_DYNAMIC SectionType = 6 /* dynamic section */ + SHT_NOTE SectionType = 7 /* note section */ + SHT_NOBITS SectionType = 8 /* no space section */ + SHT_REL SectionType = 9 /* relocation section - no addends */ + SHT_SHLIB SectionType = 10 /* reserved - purpose unknown */ + SHT_DYNSYM SectionType = 11 /* dynamic symbol table section */ + SHT_INIT_ARRAY SectionType = 14 /* Initialization function pointers. */ + SHT_FINI_ARRAY SectionType = 15 /* Termination function pointers. */ + SHT_PREINIT_ARRAY SectionType = 16 /* Pre-initialization function ptrs. */ + SHT_GROUP SectionType = 17 /* Section group. */ + SHT_SYMTAB_SHNDX SectionType = 18 /* Section indexes (see SHN_XINDEX). */ + SHT_LOOS SectionType = 0x60000000 /* First of OS specific semantics */ + SHT_GNU_ATTRIBUTES SectionType = 0x6ffffff5 /* GNU object attributes */ + SHT_GNU_HASH SectionType = 0x6ffffff6 /* GNU hash table */ + SHT_GNU_LIBLIST SectionType = 0x6ffffff7 /* GNU prelink library list */ + SHT_GNU_VERDEF SectionType = 0x6ffffffd /* GNU version definition section */ + SHT_GNU_VERNEED SectionType = 0x6ffffffe /* GNU version needs section */ + SHT_GNU_VERSYM SectionType = 0x6fffffff /* GNU version symbol table */ + SHT_HIOS SectionType = 0x6fffffff /* Last of OS specific semantics */ + SHT_LOPROC SectionType = 0x70000000 /* reserved range for processor */ + SHT_HIPROC SectionType = 0x7fffffff /* specific section header types */ + SHT_LOUSER SectionType = 0x80000000 /* reserved range for application */ + SHT_HIUSER SectionType = 0xffffffff /* specific indexes */ +) + +var shtStrings = []intName{ + {0, "SHT_NULL"}, + {1, "SHT_PROGBITS"}, + {2, "SHT_SYMTAB"}, + {3, "SHT_STRTAB"}, + {4, "SHT_RELA"}, + {5, "SHT_HASH"}, + {6, "SHT_DYNAMIC"}, + {7, "SHT_NOTE"}, + {8, "SHT_NOBITS"}, + {9, "SHT_REL"}, + {10, "SHT_SHLIB"}, + {11, "SHT_DYNSYM"}, + {14, "SHT_INIT_ARRAY"}, + {15, "SHT_FINI_ARRAY"}, + {16, "SHT_PREINIT_ARRAY"}, + {17, "SHT_GROUP"}, + {18, "SHT_SYMTAB_SHNDX"}, + {0x60000000, "SHT_LOOS"}, + {0x6ffffff5, "SHT_GNU_ATTRIBUTES"}, + {0x6ffffff6, "SHT_GNU_HASH"}, + {0x6ffffff7, "SHT_GNU_LIBLIST"}, + {0x6ffffffd, "SHT_GNU_VERDEF"}, + {0x6ffffffe, "SHT_GNU_VERNEED"}, + {0x6fffffff, "SHT_GNU_VERSYM"}, + {0x70000000, "SHT_LOPROC"}, + {0x7fffffff, "SHT_HIPROC"}, + {0x80000000, "SHT_LOUSER"}, + {0xffffffff, "SHT_HIUSER"}, +} + +func (i SectionType) String() string { return stringName(uint32(i), shtStrings, false) } +func (i SectionType) GoString() string { return stringName(uint32(i), shtStrings, true) } + +// Section flags. +type SectionFlag uint32 + +const ( + SHF_WRITE SectionFlag = 0x1 /* Section contains writable data. */ + SHF_ALLOC SectionFlag = 0x2 /* Section occupies memory. */ + SHF_EXECINSTR SectionFlag = 0x4 /* Section contains instructions. */ + SHF_MERGE SectionFlag = 0x10 /* Section may be merged. */ + SHF_STRINGS SectionFlag = 0x20 /* Section contains strings. */ + SHF_INFO_LINK SectionFlag = 0x40 /* sh_info holds section index. */ + SHF_LINK_ORDER SectionFlag = 0x80 /* Special ordering requirements. */ + SHF_OS_NONCONFORMING SectionFlag = 0x100 /* OS-specific processing required. */ + SHF_GROUP SectionFlag = 0x200 /* Member of section group. */ + SHF_TLS SectionFlag = 0x400 /* Section contains TLS data. */ + SHF_MASKOS SectionFlag = 0x0ff00000 /* OS-specific semantics. */ + SHF_MASKPROC SectionFlag = 0xf0000000 /* Processor-specific semantics. */ +) + +var shfStrings = []intName{ + {0x1, "SHF_WRITE"}, + {0x2, "SHF_ALLOC"}, + {0x4, "SHF_EXECINSTR"}, + {0x10, "SHF_MERGE"}, + {0x20, "SHF_STRINGS"}, + {0x40, "SHF_INFO_LINK"}, + {0x80, "SHF_LINK_ORDER"}, + {0x100, "SHF_OS_NONCONFORMING"}, + {0x200, "SHF_GROUP"}, + {0x400, "SHF_TLS"}, +} + +func (i SectionFlag) String() string { return flagName(uint32(i), shfStrings, false) } +func (i SectionFlag) GoString() string { return flagName(uint32(i), shfStrings, true) } + +// Prog.Type +type ProgType int + +const ( + PT_NULL ProgType = 0 /* Unused entry. */ + PT_LOAD ProgType = 1 /* Loadable segment. */ + PT_DYNAMIC ProgType = 2 /* Dynamic linking information segment. */ + PT_INTERP ProgType = 3 /* Pathname of interpreter. */ + PT_NOTE ProgType = 4 /* Auxiliary information. */ + PT_SHLIB ProgType = 5 /* Reserved (not used). */ + PT_PHDR ProgType = 6 /* Location of program header itself. */ + PT_TLS ProgType = 7 /* Thread local storage segment */ + PT_LOOS ProgType = 0x60000000 /* First OS-specific. */ + PT_HIOS ProgType = 0x6fffffff /* Last OS-specific. */ + PT_LOPROC ProgType = 0x70000000 /* First processor-specific type. */ + PT_HIPROC ProgType = 0x7fffffff /* Last processor-specific type. */ +) + +var ptStrings = []intName{ + {0, "PT_NULL"}, + {1, "PT_LOAD"}, + {2, "PT_DYNAMIC"}, + {3, "PT_INTERP"}, + {4, "PT_NOTE"}, + {5, "PT_SHLIB"}, + {6, "PT_PHDR"}, + {7, "PT_TLS"}, + {0x60000000, "PT_LOOS"}, + {0x6fffffff, "PT_HIOS"}, + {0x70000000, "PT_LOPROC"}, + {0x7fffffff, "PT_HIPROC"}, +} + +func (i ProgType) String() string { return stringName(uint32(i), ptStrings, false) } +func (i ProgType) GoString() string { return stringName(uint32(i), ptStrings, true) } + +// Prog.Flag +type ProgFlag uint32 + +const ( + PF_X ProgFlag = 0x1 /* Executable. */ + PF_W ProgFlag = 0x2 /* Writable. */ + PF_R ProgFlag = 0x4 /* Readable. */ + PF_MASKOS ProgFlag = 0x0ff00000 /* Operating system-specific. */ + PF_MASKPROC ProgFlag = 0xf0000000 /* Processor-specific. */ +) + +var pfStrings = []intName{ + {0x1, "PF_X"}, + {0x2, "PF_W"}, + {0x4, "PF_R"}, +} + +func (i ProgFlag) String() string { return flagName(uint32(i), pfStrings, false) } +func (i ProgFlag) GoString() string { return flagName(uint32(i), pfStrings, true) } + +// Dyn.Tag +type DynTag int + +const ( + DT_NULL DynTag = 0 /* Terminating entry. */ + DT_NEEDED DynTag = 1 /* String table offset of a needed shared library. */ + DT_PLTRELSZ DynTag = 2 /* Total size in bytes of PLT relocations. */ + DT_PLTGOT DynTag = 3 /* Processor-dependent address. */ + DT_HASH DynTag = 4 /* Address of symbol hash table. */ + DT_STRTAB DynTag = 5 /* Address of string table. */ + DT_SYMTAB DynTag = 6 /* Address of symbol table. */ + DT_RELA DynTag = 7 /* Address of ElfNN_Rela relocations. */ + DT_RELASZ DynTag = 8 /* Total size of ElfNN_Rela relocations. */ + DT_RELAENT DynTag = 9 /* Size of each ElfNN_Rela relocation entry. */ + DT_STRSZ DynTag = 10 /* Size of string table. */ + DT_SYMENT DynTag = 11 /* Size of each symbol table entry. */ + DT_INIT DynTag = 12 /* Address of initialization function. */ + DT_FINI DynTag = 13 /* Address of finalization function. */ + DT_SONAME DynTag = 14 /* String table offset of shared object name. */ + DT_RPATH DynTag = 15 /* String table offset of library path. [sup] */ + DT_SYMBOLIC DynTag = 16 /* Indicates "symbolic" linking. [sup] */ + DT_REL DynTag = 17 /* Address of ElfNN_Rel relocations. */ + DT_RELSZ DynTag = 18 /* Total size of ElfNN_Rel relocations. */ + DT_RELENT DynTag = 19 /* Size of each ElfNN_Rel relocation. */ + DT_PLTREL DynTag = 20 /* Type of relocation used for PLT. */ + DT_DEBUG DynTag = 21 /* Reserved (not used). */ + DT_TEXTREL DynTag = 22 /* Indicates there may be relocations in non-writable segments. [sup] */ + DT_JMPREL DynTag = 23 /* Address of PLT relocations. */ + DT_BIND_NOW DynTag = 24 /* [sup] */ + DT_INIT_ARRAY DynTag = 25 /* Address of the array of pointers to initialization functions */ + DT_FINI_ARRAY DynTag = 26 /* Address of the array of pointers to termination functions */ + DT_INIT_ARRAYSZ DynTag = 27 /* Size in bytes of the array of initialization functions. */ + DT_FINI_ARRAYSZ DynTag = 28 /* Size in bytes of the array of termination functions. */ + DT_RUNPATH DynTag = 29 /* String table offset of a null-terminated library search path string. */ + DT_FLAGS DynTag = 30 /* Object specific flag values. */ + DT_ENCODING DynTag = 32 /* Values greater than or equal to DT_ENCODING + and less than DT_LOOS follow the rules for + the interpretation of the d_un union + as follows: even == 'd_ptr', even == 'd_val' + or none */ + DT_PREINIT_ARRAY DynTag = 32 /* Address of the array of pointers to pre-initialization functions. */ + DT_PREINIT_ARRAYSZ DynTag = 33 /* Size in bytes of the array of pre-initialization functions. */ + DT_LOOS DynTag = 0x6000000d /* First OS-specific */ + DT_HIOS DynTag = 0x6ffff000 /* Last OS-specific */ + DT_VERSYM DynTag = 0x6ffffff0 + DT_VERNEED DynTag = 0x6ffffffe + DT_VERNEEDNUM DynTag = 0x6fffffff + DT_LOPROC DynTag = 0x70000000 /* First processor-specific type. */ + DT_HIPROC DynTag = 0x7fffffff /* Last processor-specific type. */ +) + +var dtStrings = []intName{ + {0, "DT_NULL"}, + {1, "DT_NEEDED"}, + {2, "DT_PLTRELSZ"}, + {3, "DT_PLTGOT"}, + {4, "DT_HASH"}, + {5, "DT_STRTAB"}, + {6, "DT_SYMTAB"}, + {7, "DT_RELA"}, + {8, "DT_RELASZ"}, + {9, "DT_RELAENT"}, + {10, "DT_STRSZ"}, + {11, "DT_SYMENT"}, + {12, "DT_INIT"}, + {13, "DT_FINI"}, + {14, "DT_SONAME"}, + {15, "DT_RPATH"}, + {16, "DT_SYMBOLIC"}, + {17, "DT_REL"}, + {18, "DT_RELSZ"}, + {19, "DT_RELENT"}, + {20, "DT_PLTREL"}, + {21, "DT_DEBUG"}, + {22, "DT_TEXTREL"}, + {23, "DT_JMPREL"}, + {24, "DT_BIND_NOW"}, + {25, "DT_INIT_ARRAY"}, + {26, "DT_FINI_ARRAY"}, + {27, "DT_INIT_ARRAYSZ"}, + {28, "DT_FINI_ARRAYSZ"}, + {29, "DT_RUNPATH"}, + {30, "DT_FLAGS"}, + {32, "DT_ENCODING"}, + {32, "DT_PREINIT_ARRAY"}, + {33, "DT_PREINIT_ARRAYSZ"}, + {0x6000000d, "DT_LOOS"}, + {0x6ffff000, "DT_HIOS"}, + {0x6ffffff0, "DT_VERSYM"}, + {0x6ffffffe, "DT_VERNEED"}, + {0x6fffffff, "DT_VERNEEDNUM"}, + {0x70000000, "DT_LOPROC"}, + {0x7fffffff, "DT_HIPROC"}, +} + +func (i DynTag) String() string { return stringName(uint32(i), dtStrings, false) } +func (i DynTag) GoString() string { return stringName(uint32(i), dtStrings, true) } + +// DT_FLAGS values. +type DynFlag int + +const ( + DF_ORIGIN DynFlag = 0x0001 /* Indicates that the object being loaded may + make reference to the + $ORIGIN substitution string */ + DF_SYMBOLIC DynFlag = 0x0002 /* Indicates "symbolic" linking. */ + DF_TEXTREL DynFlag = 0x0004 /* Indicates there may be relocations in non-writable segments. */ + DF_BIND_NOW DynFlag = 0x0008 /* Indicates that the dynamic linker should + process all relocations for the object + containing this entry before transferring + control to the program. */ + DF_STATIC_TLS DynFlag = 0x0010 /* Indicates that the shared object or + executable contains code using a static + thread-local storage scheme. */ +) + +var dflagStrings = []intName{ + {0x0001, "DF_ORIGIN"}, + {0x0002, "DF_SYMBOLIC"}, + {0x0004, "DF_TEXTREL"}, + {0x0008, "DF_BIND_NOW"}, + {0x0010, "DF_STATIC_TLS"}, +} + +func (i DynFlag) String() string { return flagName(uint32(i), dflagStrings, false) } +func (i DynFlag) GoString() string { return flagName(uint32(i), dflagStrings, true) } + +// NType values; used in core files. +type NType int + +const ( + NT_PRSTATUS NType = 1 /* Process status. */ + NT_FPREGSET NType = 2 /* Floating point registers. */ + NT_PRPSINFO NType = 3 /* Process state info. */ +) + +var ntypeStrings = []intName{ + {1, "NT_PRSTATUS"}, + {2, "NT_FPREGSET"}, + {3, "NT_PRPSINFO"}, +} + +func (i NType) String() string { return stringName(uint32(i), ntypeStrings, false) } +func (i NType) GoString() string { return stringName(uint32(i), ntypeStrings, true) } + +/* Symbol Binding - ELFNN_ST_BIND - st_info */ +type SymBind int + +const ( + STB_LOCAL SymBind = 0 /* Local symbol */ + STB_GLOBAL SymBind = 1 /* Global symbol */ + STB_WEAK SymBind = 2 /* like global - lower precedence */ + STB_LOOS SymBind = 10 /* Reserved range for operating system */ + STB_HIOS SymBind = 12 /* specific semantics. */ + STB_LOPROC SymBind = 13 /* reserved range for processor */ + STB_HIPROC SymBind = 15 /* specific semantics. */ +) + +var stbStrings = []intName{ + {0, "STB_LOCAL"}, + {1, "STB_GLOBAL"}, + {2, "STB_WEAK"}, + {10, "STB_LOOS"}, + {12, "STB_HIOS"}, + {13, "STB_LOPROC"}, + {15, "STB_HIPROC"}, +} + +func (i SymBind) String() string { return stringName(uint32(i), stbStrings, false) } +func (i SymBind) GoString() string { return stringName(uint32(i), stbStrings, true) } + +/* Symbol type - ELFNN_ST_TYPE - st_info */ +type SymType int + +const ( + STT_NOTYPE SymType = 0 /* Unspecified type. */ + STT_OBJECT SymType = 1 /* Data object. */ + STT_FUNC SymType = 2 /* Function. */ + STT_SECTION SymType = 3 /* Section. */ + STT_FILE SymType = 4 /* Source file. */ + STT_COMMON SymType = 5 /* Uninitialized common block. */ + STT_TLS SymType = 6 /* TLS object. */ + STT_LOOS SymType = 10 /* Reserved range for operating system */ + STT_HIOS SymType = 12 /* specific semantics. */ + STT_LOPROC SymType = 13 /* reserved range for processor */ + STT_HIPROC SymType = 15 /* specific semantics. */ +) + +var sttStrings = []intName{ + {0, "STT_NOTYPE"}, + {1, "STT_OBJECT"}, + {2, "STT_FUNC"}, + {3, "STT_SECTION"}, + {4, "STT_FILE"}, + {5, "STT_COMMON"}, + {6, "STT_TLS"}, + {10, "STT_LOOS"}, + {12, "STT_HIOS"}, + {13, "STT_LOPROC"}, + {15, "STT_HIPROC"}, +} + +func (i SymType) String() string { return stringName(uint32(i), sttStrings, false) } +func (i SymType) GoString() string { return stringName(uint32(i), sttStrings, true) } + +/* Symbol visibility - ELFNN_ST_VISIBILITY - st_other */ +type SymVis int + +const ( + STV_DEFAULT SymVis = 0x0 /* Default visibility (see binding). */ + STV_INTERNAL SymVis = 0x1 /* Special meaning in relocatable objects. */ + STV_HIDDEN SymVis = 0x2 /* Not visible. */ + STV_PROTECTED SymVis = 0x3 /* Visible but not preemptible. */ +) + +var stvStrings = []intName{ + {0x0, "STV_DEFAULT"}, + {0x1, "STV_INTERNAL"}, + {0x2, "STV_HIDDEN"}, + {0x3, "STV_PROTECTED"}, +} + +func (i SymVis) String() string { return stringName(uint32(i), stvStrings, false) } +func (i SymVis) GoString() string { return stringName(uint32(i), stvStrings, true) } + +/* + * Relocation types. + */ + +// Relocation types for x86-64. +type R_X86_64 int + +const ( + R_X86_64_NONE R_X86_64 = 0 /* No relocation. */ + R_X86_64_64 R_X86_64 = 1 /* Add 64 bit symbol value. */ + R_X86_64_PC32 R_X86_64 = 2 /* PC-relative 32 bit signed sym value. */ + R_X86_64_GOT32 R_X86_64 = 3 /* PC-relative 32 bit GOT offset. */ + R_X86_64_PLT32 R_X86_64 = 4 /* PC-relative 32 bit PLT offset. */ + R_X86_64_COPY R_X86_64 = 5 /* Copy data from shared object. */ + R_X86_64_GLOB_DAT R_X86_64 = 6 /* Set GOT entry to data address. */ + R_X86_64_JMP_SLOT R_X86_64 = 7 /* Set GOT entry to code address. */ + R_X86_64_RELATIVE R_X86_64 = 8 /* Add load address of shared object. */ + R_X86_64_GOTPCREL R_X86_64 = 9 /* Add 32 bit signed pcrel offset to GOT. */ + R_X86_64_32 R_X86_64 = 10 /* Add 32 bit zero extended symbol value */ + R_X86_64_32S R_X86_64 = 11 /* Add 32 bit sign extended symbol value */ + R_X86_64_16 R_X86_64 = 12 /* Add 16 bit zero extended symbol value */ + R_X86_64_PC16 R_X86_64 = 13 /* Add 16 bit signed extended pc relative symbol value */ + R_X86_64_8 R_X86_64 = 14 /* Add 8 bit zero extended symbol value */ + R_X86_64_PC8 R_X86_64 = 15 /* Add 8 bit signed extended pc relative symbol value */ + R_X86_64_DTPMOD64 R_X86_64 = 16 /* ID of module containing symbol */ + R_X86_64_DTPOFF64 R_X86_64 = 17 /* Offset in TLS block */ + R_X86_64_TPOFF64 R_X86_64 = 18 /* Offset in static TLS block */ + R_X86_64_TLSGD R_X86_64 = 19 /* PC relative offset to GD GOT entry */ + R_X86_64_TLSLD R_X86_64 = 20 /* PC relative offset to LD GOT entry */ + R_X86_64_DTPOFF32 R_X86_64 = 21 /* Offset in TLS block */ + R_X86_64_GOTTPOFF R_X86_64 = 22 /* PC relative offset to IE GOT entry */ + R_X86_64_TPOFF32 R_X86_64 = 23 /* Offset in static TLS block */ +) + +var rx86_64Strings = []intName{ + {0, "R_X86_64_NONE"}, + {1, "R_X86_64_64"}, + {2, "R_X86_64_PC32"}, + {3, "R_X86_64_GOT32"}, + {4, "R_X86_64_PLT32"}, + {5, "R_X86_64_COPY"}, + {6, "R_X86_64_GLOB_DAT"}, + {7, "R_X86_64_JMP_SLOT"}, + {8, "R_X86_64_RELATIVE"}, + {9, "R_X86_64_GOTPCREL"}, + {10, "R_X86_64_32"}, + {11, "R_X86_64_32S"}, + {12, "R_X86_64_16"}, + {13, "R_X86_64_PC16"}, + {14, "R_X86_64_8"}, + {15, "R_X86_64_PC8"}, + {16, "R_X86_64_DTPMOD64"}, + {17, "R_X86_64_DTPOFF64"}, + {18, "R_X86_64_TPOFF64"}, + {19, "R_X86_64_TLSGD"}, + {20, "R_X86_64_TLSLD"}, + {21, "R_X86_64_DTPOFF32"}, + {22, "R_X86_64_GOTTPOFF"}, + {23, "R_X86_64_TPOFF32"}, +} + +func (i R_X86_64) String() string { return stringName(uint32(i), rx86_64Strings, false) } +func (i R_X86_64) GoString() string { return stringName(uint32(i), rx86_64Strings, true) } + +// Relocation types for AArch64 (aka arm64) +type R_AARCH64 int + +const ( + R_AARCH64_NONE R_AARCH64 = 0 + R_AARCH64_P32_ABS32 R_AARCH64 = 1 + R_AARCH64_P32_ABS16 R_AARCH64 = 2 + R_AARCH64_P32_PREL32 R_AARCH64 = 3 + R_AARCH64_P32_PREL16 R_AARCH64 = 4 + R_AARCH64_P32_MOVW_UABS_G0 R_AARCH64 = 5 + R_AARCH64_P32_MOVW_UABS_G0_NC R_AARCH64 = 6 + R_AARCH64_P32_MOVW_UABS_G1 R_AARCH64 = 7 + R_AARCH64_P32_MOVW_SABS_G0 R_AARCH64 = 8 + R_AARCH64_P32_LD_PREL_LO19 R_AARCH64 = 9 + R_AARCH64_P32_ADR_PREL_LO21 R_AARCH64 = 10 + R_AARCH64_P32_ADR_PREL_PG_HI21 R_AARCH64 = 11 + R_AARCH64_P32_ADD_ABS_LO12_NC R_AARCH64 = 12 + R_AARCH64_P32_LDST8_ABS_LO12_NC R_AARCH64 = 13 + R_AARCH64_P32_LDST16_ABS_LO12_NC R_AARCH64 = 14 + R_AARCH64_P32_LDST32_ABS_LO12_NC R_AARCH64 = 15 + R_AARCH64_P32_LDST64_ABS_LO12_NC R_AARCH64 = 16 + R_AARCH64_P32_LDST128_ABS_LO12_NC R_AARCH64 = 17 + R_AARCH64_P32_TSTBR14 R_AARCH64 = 18 + R_AARCH64_P32_CONDBR19 R_AARCH64 = 19 + R_AARCH64_P32_JUMP26 R_AARCH64 = 20 + R_AARCH64_P32_CALL26 R_AARCH64 = 21 + R_AARCH64_P32_GOT_LD_PREL19 R_AARCH64 = 25 + R_AARCH64_P32_ADR_GOT_PAGE R_AARCH64 = 26 + R_AARCH64_P32_LD32_GOT_LO12_NC R_AARCH64 = 27 + R_AARCH64_P32_TLSGD_ADR_PAGE21 R_AARCH64 = 81 + R_AARCH64_P32_TLSGD_ADD_LO12_NC R_AARCH64 = 82 + R_AARCH64_P32_TLSIE_ADR_GOTTPREL_PAGE21 R_AARCH64 = 103 + R_AARCH64_P32_TLSIE_LD32_GOTTPREL_LO12_NC R_AARCH64 = 104 + R_AARCH64_P32_TLSIE_LD_GOTTPREL_PREL19 R_AARCH64 = 105 + R_AARCH64_P32_TLSLE_MOVW_TPREL_G1 R_AARCH64 = 106 + R_AARCH64_P32_TLSLE_MOVW_TPREL_G0 R_AARCH64 = 107 + R_AARCH64_P32_TLSLE_MOVW_TPREL_G0_NC R_AARCH64 = 108 + R_AARCH64_P32_TLSLE_ADD_TPREL_HI12 R_AARCH64 = 109 + R_AARCH64_P32_TLSLE_ADD_TPREL_LO12 R_AARCH64 = 110 + R_AARCH64_P32_TLSLE_ADD_TPREL_LO12_NC R_AARCH64 = 111 + R_AARCH64_P32_TLSDESC_LD_PREL19 R_AARCH64 = 122 + R_AARCH64_P32_TLSDESC_ADR_PREL21 R_AARCH64 = 123 + R_AARCH64_P32_TLSDESC_ADR_PAGE21 R_AARCH64 = 124 + R_AARCH64_P32_TLSDESC_LD32_LO12_NC R_AARCH64 = 125 + R_AARCH64_P32_TLSDESC_ADD_LO12_NC R_AARCH64 = 126 + R_AARCH64_P32_TLSDESC_CALL R_AARCH64 = 127 + R_AARCH64_P32_COPY R_AARCH64 = 180 + R_AARCH64_P32_GLOB_DAT R_AARCH64 = 181 + R_AARCH64_P32_JUMP_SLOT R_AARCH64 = 182 + R_AARCH64_P32_RELATIVE R_AARCH64 = 183 + R_AARCH64_P32_TLS_DTPMOD R_AARCH64 = 184 + R_AARCH64_P32_TLS_DTPREL R_AARCH64 = 185 + R_AARCH64_P32_TLS_TPREL R_AARCH64 = 186 + R_AARCH64_P32_TLSDESC R_AARCH64 = 187 + R_AARCH64_P32_IRELATIVE R_AARCH64 = 188 + R_AARCH64_NULL R_AARCH64 = 256 + R_AARCH64_ABS64 R_AARCH64 = 257 + R_AARCH64_ABS32 R_AARCH64 = 258 + R_AARCH64_ABS16 R_AARCH64 = 259 + R_AARCH64_PREL64 R_AARCH64 = 260 + R_AARCH64_PREL32 R_AARCH64 = 261 + R_AARCH64_PREL16 R_AARCH64 = 262 + R_AARCH64_MOVW_UABS_G0 R_AARCH64 = 263 + R_AARCH64_MOVW_UABS_G0_NC R_AARCH64 = 264 + R_AARCH64_MOVW_UABS_G1 R_AARCH64 = 265 + R_AARCH64_MOVW_UABS_G1_NC R_AARCH64 = 266 + R_AARCH64_MOVW_UABS_G2 R_AARCH64 = 267 + R_AARCH64_MOVW_UABS_G2_NC R_AARCH64 = 268 + R_AARCH64_MOVW_UABS_G3 R_AARCH64 = 269 + R_AARCH64_MOVW_SABS_G0 R_AARCH64 = 270 + R_AARCH64_MOVW_SABS_G1 R_AARCH64 = 271 + R_AARCH64_MOVW_SABS_G2 R_AARCH64 = 272 + R_AARCH64_LD_PREL_LO19 R_AARCH64 = 273 + R_AARCH64_ADR_PREL_LO21 R_AARCH64 = 274 + R_AARCH64_ADR_PREL_PG_HI21 R_AARCH64 = 275 + R_AARCH64_ADR_PREL_PG_HI21_NC R_AARCH64 = 276 + R_AARCH64_ADD_ABS_LO12_NC R_AARCH64 = 277 + R_AARCH64_LDST8_ABS_LO12_NC R_AARCH64 = 278 + R_AARCH64_TSTBR14 R_AARCH64 = 279 + R_AARCH64_CONDBR19 R_AARCH64 = 280 + R_AARCH64_JUMP26 R_AARCH64 = 282 + R_AARCH64_CALL26 R_AARCH64 = 283 + R_AARCH64_LDST16_ABS_LO12_NC R_AARCH64 = 284 + R_AARCH64_LDST32_ABS_LO12_NC R_AARCH64 = 285 + R_AARCH64_LDST64_ABS_LO12_NC R_AARCH64 = 286 + R_AARCH64_LDST128_ABS_LO12_NC R_AARCH64 = 299 + R_AARCH64_GOT_LD_PREL19 R_AARCH64 = 309 + R_AARCH64_ADR_GOT_PAGE R_AARCH64 = 311 + R_AARCH64_LD64_GOT_LO12_NC R_AARCH64 = 312 + R_AARCH64_TLSGD_ADR_PAGE21 R_AARCH64 = 513 + R_AARCH64_TLSGD_ADD_LO12_NC R_AARCH64 = 514 + R_AARCH64_TLSIE_MOVW_GOTTPREL_G1 R_AARCH64 = 539 + R_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC R_AARCH64 = 540 + R_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21 R_AARCH64 = 541 + R_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC R_AARCH64 = 542 + R_AARCH64_TLSIE_LD_GOTTPREL_PREL19 R_AARCH64 = 543 + R_AARCH64_TLSLE_MOVW_TPREL_G2 R_AARCH64 = 544 + R_AARCH64_TLSLE_MOVW_TPREL_G1 R_AARCH64 = 545 + R_AARCH64_TLSLE_MOVW_TPREL_G1_NC R_AARCH64 = 546 + R_AARCH64_TLSLE_MOVW_TPREL_G0 R_AARCH64 = 547 + R_AARCH64_TLSLE_MOVW_TPREL_G0_NC R_AARCH64 = 548 + R_AARCH64_TLSLE_ADD_TPREL_HI12 R_AARCH64 = 549 + R_AARCH64_TLSLE_ADD_TPREL_LO12 R_AARCH64 = 550 + R_AARCH64_TLSLE_ADD_TPREL_LO12_NC R_AARCH64 = 551 + R_AARCH64_TLSDESC_LD_PREL19 R_AARCH64 = 560 + R_AARCH64_TLSDESC_ADR_PREL21 R_AARCH64 = 561 + R_AARCH64_TLSDESC_ADR_PAGE21 R_AARCH64 = 562 + R_AARCH64_TLSDESC_LD64_LO12_NC R_AARCH64 = 563 + R_AARCH64_TLSDESC_ADD_LO12_NC R_AARCH64 = 564 + R_AARCH64_TLSDESC_OFF_G1 R_AARCH64 = 565 + R_AARCH64_TLSDESC_OFF_G0_NC R_AARCH64 = 566 + R_AARCH64_TLSDESC_LDR R_AARCH64 = 567 + R_AARCH64_TLSDESC_ADD R_AARCH64 = 568 + R_AARCH64_TLSDESC_CALL R_AARCH64 = 569 + R_AARCH64_COPY R_AARCH64 = 1024 + R_AARCH64_GLOB_DAT R_AARCH64 = 1025 + R_AARCH64_JUMP_SLOT R_AARCH64 = 1026 + R_AARCH64_RELATIVE R_AARCH64 = 1027 + R_AARCH64_TLS_DTPMOD64 R_AARCH64 = 1028 + R_AARCH64_TLS_DTPREL64 R_AARCH64 = 1029 + R_AARCH64_TLS_TPREL64 R_AARCH64 = 1030 + R_AARCH64_TLSDESC R_AARCH64 = 1031 + R_AARCH64_IRELATIVE R_AARCH64 = 1032 +) + +var raarch64Strings = []intName{ + {0, "R_AARCH64_NONE"}, + {1, "R_AARCH64_P32_ABS32"}, + {2, "R_AARCH64_P32_ABS16"}, + {3, "R_AARCH64_P32_PREL32"}, + {4, "R_AARCH64_P32_PREL16"}, + {5, "R_AARCH64_P32_MOVW_UABS_G0"}, + {6, "R_AARCH64_P32_MOVW_UABS_G0_NC"}, + {7, "R_AARCH64_P32_MOVW_UABS_G1"}, + {8, "R_AARCH64_P32_MOVW_SABS_G0"}, + {9, "R_AARCH64_P32_LD_PREL_LO19"}, + {10, "R_AARCH64_P32_ADR_PREL_LO21"}, + {11, "R_AARCH64_P32_ADR_PREL_PG_HI21"}, + {12, "R_AARCH64_P32_ADD_ABS_LO12_NC"}, + {13, "R_AARCH64_P32_LDST8_ABS_LO12_NC"}, + {14, "R_AARCH64_P32_LDST16_ABS_LO12_NC"}, + {15, "R_AARCH64_P32_LDST32_ABS_LO12_NC"}, + {16, "R_AARCH64_P32_LDST64_ABS_LO12_NC"}, + {17, "R_AARCH64_P32_LDST128_ABS_LO12_NC"}, + {18, "R_AARCH64_P32_TSTBR14"}, + {19, "R_AARCH64_P32_CONDBR19"}, + {20, "R_AARCH64_P32_JUMP26"}, + {21, "R_AARCH64_P32_CALL26"}, + {25, "R_AARCH64_P32_GOT_LD_PREL19"}, + {26, "R_AARCH64_P32_ADR_GOT_PAGE"}, + {27, "R_AARCH64_P32_LD32_GOT_LO12_NC"}, + {81, "R_AARCH64_P32_TLSGD_ADR_PAGE21"}, + {82, "R_AARCH64_P32_TLSGD_ADD_LO12_NC"}, + {103, "R_AARCH64_P32_TLSIE_ADR_GOTTPREL_PAGE21"}, + {104, "R_AARCH64_P32_TLSIE_LD32_GOTTPREL_LO12_NC"}, + {105, "R_AARCH64_P32_TLSIE_LD_GOTTPREL_PREL19"}, + {106, "R_AARCH64_P32_TLSLE_MOVW_TPREL_G1"}, + {107, "R_AARCH64_P32_TLSLE_MOVW_TPREL_G0"}, + {108, "R_AARCH64_P32_TLSLE_MOVW_TPREL_G0_NC"}, + {109, "R_AARCH64_P32_TLSLE_ADD_TPREL_HI12"}, + {110, "R_AARCH64_P32_TLSLE_ADD_TPREL_LO12"}, + {111, "R_AARCH64_P32_TLSLE_ADD_TPREL_LO12_NC"}, + {122, "R_AARCH64_P32_TLSDESC_LD_PREL19"}, + {123, "R_AARCH64_P32_TLSDESC_ADR_PREL21"}, + {124, "R_AARCH64_P32_TLSDESC_ADR_PAGE21"}, + {125, "R_AARCH64_P32_TLSDESC_LD32_LO12_NC"}, + {126, "R_AARCH64_P32_TLSDESC_ADD_LO12_NC"}, + {127, "R_AARCH64_P32_TLSDESC_CALL"}, + {180, "R_AARCH64_P32_COPY"}, + {181, "R_AARCH64_P32_GLOB_DAT"}, + {182, "R_AARCH64_P32_JUMP_SLOT"}, + {183, "R_AARCH64_P32_RELATIVE"}, + {184, "R_AARCH64_P32_TLS_DTPMOD"}, + {185, "R_AARCH64_P32_TLS_DTPREL"}, + {186, "R_AARCH64_P32_TLS_TPREL"}, + {187, "R_AARCH64_P32_TLSDESC"}, + {188, "R_AARCH64_P32_IRELATIVE"}, + {256, "R_AARCH64_NULL"}, + {257, "R_AARCH64_ABS64"}, + {258, "R_AARCH64_ABS32"}, + {259, "R_AARCH64_ABS16"}, + {260, "R_AARCH64_PREL64"}, + {261, "R_AARCH64_PREL32"}, + {262, "R_AARCH64_PREL16"}, + {263, "R_AARCH64_MOVW_UABS_G0"}, + {264, "R_AARCH64_MOVW_UABS_G0_NC"}, + {265, "R_AARCH64_MOVW_UABS_G1"}, + {266, "R_AARCH64_MOVW_UABS_G1_NC"}, + {267, "R_AARCH64_MOVW_UABS_G2"}, + {268, "R_AARCH64_MOVW_UABS_G2_NC"}, + {269, "R_AARCH64_MOVW_UABS_G3"}, + {270, "R_AARCH64_MOVW_SABS_G0"}, + {271, "R_AARCH64_MOVW_SABS_G1"}, + {272, "R_AARCH64_MOVW_SABS_G2"}, + {273, "R_AARCH64_LD_PREL_LO19"}, + {274, "R_AARCH64_ADR_PREL_LO21"}, + {275, "R_AARCH64_ADR_PREL_PG_HI21"}, + {276, "R_AARCH64_ADR_PREL_PG_HI21_NC"}, + {277, "R_AARCH64_ADD_ABS_LO12_NC"}, + {278, "R_AARCH64_LDST8_ABS_LO12_NC"}, + {279, "R_AARCH64_TSTBR14"}, + {280, "R_AARCH64_CONDBR19"}, + {282, "R_AARCH64_JUMP26"}, + {283, "R_AARCH64_CALL26"}, + {284, "R_AARCH64_LDST16_ABS_LO12_NC"}, + {285, "R_AARCH64_LDST32_ABS_LO12_NC"}, + {286, "R_AARCH64_LDST64_ABS_LO12_NC"}, + {299, "R_AARCH64_LDST128_ABS_LO12_NC"}, + {309, "R_AARCH64_GOT_LD_PREL19"}, + {311, "R_AARCH64_ADR_GOT_PAGE"}, + {312, "R_AARCH64_LD64_GOT_LO12_NC"}, + {513, "R_AARCH64_TLSGD_ADR_PAGE21"}, + {514, "R_AARCH64_TLSGD_ADD_LO12_NC"}, + {539, "R_AARCH64_TLSIE_MOVW_GOTTPREL_G1"}, + {540, "R_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC"}, + {541, "R_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21"}, + {542, "R_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC"}, + {543, "R_AARCH64_TLSIE_LD_GOTTPREL_PREL19"}, + {544, "R_AARCH64_TLSLE_MOVW_TPREL_G2"}, + {545, "R_AARCH64_TLSLE_MOVW_TPREL_G1"}, + {546, "R_AARCH64_TLSLE_MOVW_TPREL_G1_NC"}, + {547, "R_AARCH64_TLSLE_MOVW_TPREL_G0"}, + {548, "R_AARCH64_TLSLE_MOVW_TPREL_G0_NC"}, + {549, "R_AARCH64_TLSLE_ADD_TPREL_HI12"}, + {550, "R_AARCH64_TLSLE_ADD_TPREL_LO12"}, + {551, "R_AARCH64_TLSLE_ADD_TPREL_LO12_NC"}, + {560, "R_AARCH64_TLSDESC_LD_PREL19"}, + {561, "R_AARCH64_TLSDESC_ADR_PREL21"}, + {562, "R_AARCH64_TLSDESC_ADR_PAGE21"}, + {563, "R_AARCH64_TLSDESC_LD64_LO12_NC"}, + {564, "R_AARCH64_TLSDESC_ADD_LO12_NC"}, + {565, "R_AARCH64_TLSDESC_OFF_G1"}, + {566, "R_AARCH64_TLSDESC_OFF_G0_NC"}, + {567, "R_AARCH64_TLSDESC_LDR"}, + {568, "R_AARCH64_TLSDESC_ADD"}, + {569, "R_AARCH64_TLSDESC_CALL"}, + {1024, "R_AARCH64_COPY"}, + {1025, "R_AARCH64_GLOB_DAT"}, + {1026, "R_AARCH64_JUMP_SLOT"}, + {1027, "R_AARCH64_RELATIVE"}, + {1028, "R_AARCH64_TLS_DTPMOD64"}, + {1029, "R_AARCH64_TLS_DTPREL64"}, + {1030, "R_AARCH64_TLS_TPREL64"}, + {1031, "R_AARCH64_TLSDESC"}, + {1032, "R_AARCH64_IRELATIVE"}, +} + +func (i R_AARCH64) String() string { return stringName(uint32(i), raarch64Strings, false) } +func (i R_AARCH64) GoString() string { return stringName(uint32(i), raarch64Strings, true) } + +// Relocation types for Alpha. +type R_ALPHA int + +const ( + R_ALPHA_NONE R_ALPHA = 0 /* No reloc */ + R_ALPHA_REFLONG R_ALPHA = 1 /* Direct 32 bit */ + R_ALPHA_REFQUAD R_ALPHA = 2 /* Direct 64 bit */ + R_ALPHA_GPREL32 R_ALPHA = 3 /* GP relative 32 bit */ + R_ALPHA_LITERAL R_ALPHA = 4 /* GP relative 16 bit w/optimization */ + R_ALPHA_LITUSE R_ALPHA = 5 /* Optimization hint for LITERAL */ + R_ALPHA_GPDISP R_ALPHA = 6 /* Add displacement to GP */ + R_ALPHA_BRADDR R_ALPHA = 7 /* PC+4 relative 23 bit shifted */ + R_ALPHA_HINT R_ALPHA = 8 /* PC+4 relative 16 bit shifted */ + R_ALPHA_SREL16 R_ALPHA = 9 /* PC relative 16 bit */ + R_ALPHA_SREL32 R_ALPHA = 10 /* PC relative 32 bit */ + R_ALPHA_SREL64 R_ALPHA = 11 /* PC relative 64 bit */ + R_ALPHA_OP_PUSH R_ALPHA = 12 /* OP stack push */ + R_ALPHA_OP_STORE R_ALPHA = 13 /* OP stack pop and store */ + R_ALPHA_OP_PSUB R_ALPHA = 14 /* OP stack subtract */ + R_ALPHA_OP_PRSHIFT R_ALPHA = 15 /* OP stack right shift */ + R_ALPHA_GPVALUE R_ALPHA = 16 + R_ALPHA_GPRELHIGH R_ALPHA = 17 + R_ALPHA_GPRELLOW R_ALPHA = 18 + R_ALPHA_IMMED_GP_16 R_ALPHA = 19 + R_ALPHA_IMMED_GP_HI32 R_ALPHA = 20 + R_ALPHA_IMMED_SCN_HI32 R_ALPHA = 21 + R_ALPHA_IMMED_BR_HI32 R_ALPHA = 22 + R_ALPHA_IMMED_LO32 R_ALPHA = 23 + R_ALPHA_COPY R_ALPHA = 24 /* Copy symbol at runtime */ + R_ALPHA_GLOB_DAT R_ALPHA = 25 /* Create GOT entry */ + R_ALPHA_JMP_SLOT R_ALPHA = 26 /* Create PLT entry */ + R_ALPHA_RELATIVE R_ALPHA = 27 /* Adjust by program base */ +) + +var ralphaStrings = []intName{ + {0, "R_ALPHA_NONE"}, + {1, "R_ALPHA_REFLONG"}, + {2, "R_ALPHA_REFQUAD"}, + {3, "R_ALPHA_GPREL32"}, + {4, "R_ALPHA_LITERAL"}, + {5, "R_ALPHA_LITUSE"}, + {6, "R_ALPHA_GPDISP"}, + {7, "R_ALPHA_BRADDR"}, + {8, "R_ALPHA_HINT"}, + {9, "R_ALPHA_SREL16"}, + {10, "R_ALPHA_SREL32"}, + {11, "R_ALPHA_SREL64"}, + {12, "R_ALPHA_OP_PUSH"}, + {13, "R_ALPHA_OP_STORE"}, + {14, "R_ALPHA_OP_PSUB"}, + {15, "R_ALPHA_OP_PRSHIFT"}, + {16, "R_ALPHA_GPVALUE"}, + {17, "R_ALPHA_GPRELHIGH"}, + {18, "R_ALPHA_GPRELLOW"}, + {19, "R_ALPHA_IMMED_GP_16"}, + {20, "R_ALPHA_IMMED_GP_HI32"}, + {21, "R_ALPHA_IMMED_SCN_HI32"}, + {22, "R_ALPHA_IMMED_BR_HI32"}, + {23, "R_ALPHA_IMMED_LO32"}, + {24, "R_ALPHA_COPY"}, + {25, "R_ALPHA_GLOB_DAT"}, + {26, "R_ALPHA_JMP_SLOT"}, + {27, "R_ALPHA_RELATIVE"}, +} + +func (i R_ALPHA) String() string { return stringName(uint32(i), ralphaStrings, false) } +func (i R_ALPHA) GoString() string { return stringName(uint32(i), ralphaStrings, true) } + +// Relocation types for ARM. +type R_ARM int + +const ( + R_ARM_NONE R_ARM = 0 /* No relocation. */ + R_ARM_PC24 R_ARM = 1 + R_ARM_ABS32 R_ARM = 2 + R_ARM_REL32 R_ARM = 3 + R_ARM_PC13 R_ARM = 4 + R_ARM_ABS16 R_ARM = 5 + R_ARM_ABS12 R_ARM = 6 + R_ARM_THM_ABS5 R_ARM = 7 + R_ARM_ABS8 R_ARM = 8 + R_ARM_SBREL32 R_ARM = 9 + R_ARM_THM_PC22 R_ARM = 10 + R_ARM_THM_PC8 R_ARM = 11 + R_ARM_AMP_VCALL9 R_ARM = 12 + R_ARM_SWI24 R_ARM = 13 + R_ARM_THM_SWI8 R_ARM = 14 + R_ARM_XPC25 R_ARM = 15 + R_ARM_THM_XPC22 R_ARM = 16 + R_ARM_COPY R_ARM = 20 /* Copy data from shared object. */ + R_ARM_GLOB_DAT R_ARM = 21 /* Set GOT entry to data address. */ + R_ARM_JUMP_SLOT R_ARM = 22 /* Set GOT entry to code address. */ + R_ARM_RELATIVE R_ARM = 23 /* Add load address of shared object. */ + R_ARM_GOTOFF R_ARM = 24 /* Add GOT-relative symbol address. */ + R_ARM_GOTPC R_ARM = 25 /* Add PC-relative GOT table address. */ + R_ARM_GOT32 R_ARM = 26 /* Add PC-relative GOT offset. */ + R_ARM_PLT32 R_ARM = 27 /* Add PC-relative PLT offset. */ + R_ARM_GNU_VTENTRY R_ARM = 100 + R_ARM_GNU_VTINHERIT R_ARM = 101 + R_ARM_RSBREL32 R_ARM = 250 + R_ARM_THM_RPC22 R_ARM = 251 + R_ARM_RREL32 R_ARM = 252 + R_ARM_RABS32 R_ARM = 253 + R_ARM_RPC24 R_ARM = 254 + R_ARM_RBASE R_ARM = 255 +) + +var rarmStrings = []intName{ + {0, "R_ARM_NONE"}, + {1, "R_ARM_PC24"}, + {2, "R_ARM_ABS32"}, + {3, "R_ARM_REL32"}, + {4, "R_ARM_PC13"}, + {5, "R_ARM_ABS16"}, + {6, "R_ARM_ABS12"}, + {7, "R_ARM_THM_ABS5"}, + {8, "R_ARM_ABS8"}, + {9, "R_ARM_SBREL32"}, + {10, "R_ARM_THM_PC22"}, + {11, "R_ARM_THM_PC8"}, + {12, "R_ARM_AMP_VCALL9"}, + {13, "R_ARM_SWI24"}, + {14, "R_ARM_THM_SWI8"}, + {15, "R_ARM_XPC25"}, + {16, "R_ARM_THM_XPC22"}, + {20, "R_ARM_COPY"}, + {21, "R_ARM_GLOB_DAT"}, + {22, "R_ARM_JUMP_SLOT"}, + {23, "R_ARM_RELATIVE"}, + {24, "R_ARM_GOTOFF"}, + {25, "R_ARM_GOTPC"}, + {26, "R_ARM_GOT32"}, + {27, "R_ARM_PLT32"}, + {100, "R_ARM_GNU_VTENTRY"}, + {101, "R_ARM_GNU_VTINHERIT"}, + {250, "R_ARM_RSBREL32"}, + {251, "R_ARM_THM_RPC22"}, + {252, "R_ARM_RREL32"}, + {253, "R_ARM_RABS32"}, + {254, "R_ARM_RPC24"}, + {255, "R_ARM_RBASE"}, +} + +func (i R_ARM) String() string { return stringName(uint32(i), rarmStrings, false) } +func (i R_ARM) GoString() string { return stringName(uint32(i), rarmStrings, true) } + +// Relocation types for 386. +type R_386 int + +const ( + R_386_NONE R_386 = 0 /* No relocation. */ + R_386_32 R_386 = 1 /* Add symbol value. */ + R_386_PC32 R_386 = 2 /* Add PC-relative symbol value. */ + R_386_GOT32 R_386 = 3 /* Add PC-relative GOT offset. */ + R_386_PLT32 R_386 = 4 /* Add PC-relative PLT offset. */ + R_386_COPY R_386 = 5 /* Copy data from shared object. */ + R_386_GLOB_DAT R_386 = 6 /* Set GOT entry to data address. */ + R_386_JMP_SLOT R_386 = 7 /* Set GOT entry to code address. */ + R_386_RELATIVE R_386 = 8 /* Add load address of shared object. */ + R_386_GOTOFF R_386 = 9 /* Add GOT-relative symbol address. */ + R_386_GOTPC R_386 = 10 /* Add PC-relative GOT table address. */ + R_386_TLS_TPOFF R_386 = 14 /* Negative offset in static TLS block */ + R_386_TLS_IE R_386 = 15 /* Absolute address of GOT for -ve static TLS */ + R_386_TLS_GOTIE R_386 = 16 /* GOT entry for negative static TLS block */ + R_386_TLS_LE R_386 = 17 /* Negative offset relative to static TLS */ + R_386_TLS_GD R_386 = 18 /* 32 bit offset to GOT (index,off) pair */ + R_386_TLS_LDM R_386 = 19 /* 32 bit offset to GOT (index,zero) pair */ + R_386_TLS_GD_32 R_386 = 24 /* 32 bit offset to GOT (index,off) pair */ + R_386_TLS_GD_PUSH R_386 = 25 /* pushl instruction for Sun ABI GD sequence */ + R_386_TLS_GD_CALL R_386 = 26 /* call instruction for Sun ABI GD sequence */ + R_386_TLS_GD_POP R_386 = 27 /* popl instruction for Sun ABI GD sequence */ + R_386_TLS_LDM_32 R_386 = 28 /* 32 bit offset to GOT (index,zero) pair */ + R_386_TLS_LDM_PUSH R_386 = 29 /* pushl instruction for Sun ABI LD sequence */ + R_386_TLS_LDM_CALL R_386 = 30 /* call instruction for Sun ABI LD sequence */ + R_386_TLS_LDM_POP R_386 = 31 /* popl instruction for Sun ABI LD sequence */ + R_386_TLS_LDO_32 R_386 = 32 /* 32 bit offset from start of TLS block */ + R_386_TLS_IE_32 R_386 = 33 /* 32 bit offset to GOT static TLS offset entry */ + R_386_TLS_LE_32 R_386 = 34 /* 32 bit offset within static TLS block */ + R_386_TLS_DTPMOD32 R_386 = 35 /* GOT entry containing TLS index */ + R_386_TLS_DTPOFF32 R_386 = 36 /* GOT entry containing TLS offset */ + R_386_TLS_TPOFF32 R_386 = 37 /* GOT entry of -ve static TLS offset */ +) + +var r386Strings = []intName{ + {0, "R_386_NONE"}, + {1, "R_386_32"}, + {2, "R_386_PC32"}, + {3, "R_386_GOT32"}, + {4, "R_386_PLT32"}, + {5, "R_386_COPY"}, + {6, "R_386_GLOB_DAT"}, + {7, "R_386_JMP_SLOT"}, + {8, "R_386_RELATIVE"}, + {9, "R_386_GOTOFF"}, + {10, "R_386_GOTPC"}, + {14, "R_386_TLS_TPOFF"}, + {15, "R_386_TLS_IE"}, + {16, "R_386_TLS_GOTIE"}, + {17, "R_386_TLS_LE"}, + {18, "R_386_TLS_GD"}, + {19, "R_386_TLS_LDM"}, + {24, "R_386_TLS_GD_32"}, + {25, "R_386_TLS_GD_PUSH"}, + {26, "R_386_TLS_GD_CALL"}, + {27, "R_386_TLS_GD_POP"}, + {28, "R_386_TLS_LDM_32"}, + {29, "R_386_TLS_LDM_PUSH"}, + {30, "R_386_TLS_LDM_CALL"}, + {31, "R_386_TLS_LDM_POP"}, + {32, "R_386_TLS_LDO_32"}, + {33, "R_386_TLS_IE_32"}, + {34, "R_386_TLS_LE_32"}, + {35, "R_386_TLS_DTPMOD32"}, + {36, "R_386_TLS_DTPOFF32"}, + {37, "R_386_TLS_TPOFF32"}, +} + +func (i R_386) String() string { return stringName(uint32(i), r386Strings, false) } +func (i R_386) GoString() string { return stringName(uint32(i), r386Strings, true) } + +// Relocation types for PowerPC. +type R_PPC int + +const ( + R_PPC_NONE R_PPC = 0 /* No relocation. */ + R_PPC_ADDR32 R_PPC = 1 + R_PPC_ADDR24 R_PPC = 2 + R_PPC_ADDR16 R_PPC = 3 + R_PPC_ADDR16_LO R_PPC = 4 + R_PPC_ADDR16_HI R_PPC = 5 + R_PPC_ADDR16_HA R_PPC = 6 + R_PPC_ADDR14 R_PPC = 7 + R_PPC_ADDR14_BRTAKEN R_PPC = 8 + R_PPC_ADDR14_BRNTAKEN R_PPC = 9 + R_PPC_REL24 R_PPC = 10 + R_PPC_REL14 R_PPC = 11 + R_PPC_REL14_BRTAKEN R_PPC = 12 + R_PPC_REL14_BRNTAKEN R_PPC = 13 + R_PPC_GOT16 R_PPC = 14 + R_PPC_GOT16_LO R_PPC = 15 + R_PPC_GOT16_HI R_PPC = 16 + R_PPC_GOT16_HA R_PPC = 17 + R_PPC_PLTREL24 R_PPC = 18 + R_PPC_COPY R_PPC = 19 + R_PPC_GLOB_DAT R_PPC = 20 + R_PPC_JMP_SLOT R_PPC = 21 + R_PPC_RELATIVE R_PPC = 22 + R_PPC_LOCAL24PC R_PPC = 23 + R_PPC_UADDR32 R_PPC = 24 + R_PPC_UADDR16 R_PPC = 25 + R_PPC_REL32 R_PPC = 26 + R_PPC_PLT32 R_PPC = 27 + R_PPC_PLTREL32 R_PPC = 28 + R_PPC_PLT16_LO R_PPC = 29 + R_PPC_PLT16_HI R_PPC = 30 + R_PPC_PLT16_HA R_PPC = 31 + R_PPC_SDAREL16 R_PPC = 32 + R_PPC_SECTOFF R_PPC = 33 + R_PPC_SECTOFF_LO R_PPC = 34 + R_PPC_SECTOFF_HI R_PPC = 35 + R_PPC_SECTOFF_HA R_PPC = 36 + R_PPC_TLS R_PPC = 67 + R_PPC_DTPMOD32 R_PPC = 68 + R_PPC_TPREL16 R_PPC = 69 + R_PPC_TPREL16_LO R_PPC = 70 + R_PPC_TPREL16_HI R_PPC = 71 + R_PPC_TPREL16_HA R_PPC = 72 + R_PPC_TPREL32 R_PPC = 73 + R_PPC_DTPREL16 R_PPC = 74 + R_PPC_DTPREL16_LO R_PPC = 75 + R_PPC_DTPREL16_HI R_PPC = 76 + R_PPC_DTPREL16_HA R_PPC = 77 + R_PPC_DTPREL32 R_PPC = 78 + R_PPC_GOT_TLSGD16 R_PPC = 79 + R_PPC_GOT_TLSGD16_LO R_PPC = 80 + R_PPC_GOT_TLSGD16_HI R_PPC = 81 + R_PPC_GOT_TLSGD16_HA R_PPC = 82 + R_PPC_GOT_TLSLD16 R_PPC = 83 + R_PPC_GOT_TLSLD16_LO R_PPC = 84 + R_PPC_GOT_TLSLD16_HI R_PPC = 85 + R_PPC_GOT_TLSLD16_HA R_PPC = 86 + R_PPC_GOT_TPREL16 R_PPC = 87 + R_PPC_GOT_TPREL16_LO R_PPC = 88 + R_PPC_GOT_TPREL16_HI R_PPC = 89 + R_PPC_GOT_TPREL16_HA R_PPC = 90 + R_PPC_EMB_NADDR32 R_PPC = 101 + R_PPC_EMB_NADDR16 R_PPC = 102 + R_PPC_EMB_NADDR16_LO R_PPC = 103 + R_PPC_EMB_NADDR16_HI R_PPC = 104 + R_PPC_EMB_NADDR16_HA R_PPC = 105 + R_PPC_EMB_SDAI16 R_PPC = 106 + R_PPC_EMB_SDA2I16 R_PPC = 107 + R_PPC_EMB_SDA2REL R_PPC = 108 + R_PPC_EMB_SDA21 R_PPC = 109 + R_PPC_EMB_MRKREF R_PPC = 110 + R_PPC_EMB_RELSEC16 R_PPC = 111 + R_PPC_EMB_RELST_LO R_PPC = 112 + R_PPC_EMB_RELST_HI R_PPC = 113 + R_PPC_EMB_RELST_HA R_PPC = 114 + R_PPC_EMB_BIT_FLD R_PPC = 115 + R_PPC_EMB_RELSDA R_PPC = 116 +) + +var rppcStrings = []intName{ + {0, "R_PPC_NONE"}, + {1, "R_PPC_ADDR32"}, + {2, "R_PPC_ADDR24"}, + {3, "R_PPC_ADDR16"}, + {4, "R_PPC_ADDR16_LO"}, + {5, "R_PPC_ADDR16_HI"}, + {6, "R_PPC_ADDR16_HA"}, + {7, "R_PPC_ADDR14"}, + {8, "R_PPC_ADDR14_BRTAKEN"}, + {9, "R_PPC_ADDR14_BRNTAKEN"}, + {10, "R_PPC_REL24"}, + {11, "R_PPC_REL14"}, + {12, "R_PPC_REL14_BRTAKEN"}, + {13, "R_PPC_REL14_BRNTAKEN"}, + {14, "R_PPC_GOT16"}, + {15, "R_PPC_GOT16_LO"}, + {16, "R_PPC_GOT16_HI"}, + {17, "R_PPC_GOT16_HA"}, + {18, "R_PPC_PLTREL24"}, + {19, "R_PPC_COPY"}, + {20, "R_PPC_GLOB_DAT"}, + {21, "R_PPC_JMP_SLOT"}, + {22, "R_PPC_RELATIVE"}, + {23, "R_PPC_LOCAL24PC"}, + {24, "R_PPC_UADDR32"}, + {25, "R_PPC_UADDR16"}, + {26, "R_PPC_REL32"}, + {27, "R_PPC_PLT32"}, + {28, "R_PPC_PLTREL32"}, + {29, "R_PPC_PLT16_LO"}, + {30, "R_PPC_PLT16_HI"}, + {31, "R_PPC_PLT16_HA"}, + {32, "R_PPC_SDAREL16"}, + {33, "R_PPC_SECTOFF"}, + {34, "R_PPC_SECTOFF_LO"}, + {35, "R_PPC_SECTOFF_HI"}, + {36, "R_PPC_SECTOFF_HA"}, + + {67, "R_PPC_TLS"}, + {68, "R_PPC_DTPMOD32"}, + {69, "R_PPC_TPREL16"}, + {70, "R_PPC_TPREL16_LO"}, + {71, "R_PPC_TPREL16_HI"}, + {72, "R_PPC_TPREL16_HA"}, + {73, "R_PPC_TPREL32"}, + {74, "R_PPC_DTPREL16"}, + {75, "R_PPC_DTPREL16_LO"}, + {76, "R_PPC_DTPREL16_HI"}, + {77, "R_PPC_DTPREL16_HA"}, + {78, "R_PPC_DTPREL32"}, + {79, "R_PPC_GOT_TLSGD16"}, + {80, "R_PPC_GOT_TLSGD16_LO"}, + {81, "R_PPC_GOT_TLSGD16_HI"}, + {82, "R_PPC_GOT_TLSGD16_HA"}, + {83, "R_PPC_GOT_TLSLD16"}, + {84, "R_PPC_GOT_TLSLD16_LO"}, + {85, "R_PPC_GOT_TLSLD16_HI"}, + {86, "R_PPC_GOT_TLSLD16_HA"}, + {87, "R_PPC_GOT_TPREL16"}, + {88, "R_PPC_GOT_TPREL16_LO"}, + {89, "R_PPC_GOT_TPREL16_HI"}, + {90, "R_PPC_GOT_TPREL16_HA"}, + + {101, "R_PPC_EMB_NADDR32"}, + {102, "R_PPC_EMB_NADDR16"}, + {103, "R_PPC_EMB_NADDR16_LO"}, + {104, "R_PPC_EMB_NADDR16_HI"}, + {105, "R_PPC_EMB_NADDR16_HA"}, + {106, "R_PPC_EMB_SDAI16"}, + {107, "R_PPC_EMB_SDA2I16"}, + {108, "R_PPC_EMB_SDA2REL"}, + {109, "R_PPC_EMB_SDA21"}, + {110, "R_PPC_EMB_MRKREF"}, + {111, "R_PPC_EMB_RELSEC16"}, + {112, "R_PPC_EMB_RELST_LO"}, + {113, "R_PPC_EMB_RELST_HI"}, + {114, "R_PPC_EMB_RELST_HA"}, + {115, "R_PPC_EMB_BIT_FLD"}, + {116, "R_PPC_EMB_RELSDA"}, +} + +func (i R_PPC) String() string { return stringName(uint32(i), rppcStrings, false) } +func (i R_PPC) GoString() string { return stringName(uint32(i), rppcStrings, true) } + +// Relocation types for 64-bit PowerPC or Power Architecture processors. +type R_PPC64 int + +const ( + R_PPC64_NONE R_PPC64 = 0 + R_PPC64_ADDR32 R_PPC64 = 1 + R_PPC64_ADDR24 R_PPC64 = 2 + R_PPC64_ADDR16 R_PPC64 = 3 + R_PPC64_ADDR16_LO R_PPC64 = 4 + R_PPC64_ADDR16_HI R_PPC64 = 5 + R_PPC64_ADDR16_HA R_PPC64 = 6 + R_PPC64_ADDR14 R_PPC64 = 7 + R_PPC64_ADDR14_BRTAKEN R_PPC64 = 8 + R_PPC64_ADDR14_BRNTAKEN R_PPC64 = 9 + R_PPC64_REL24 R_PPC64 = 10 + R_PPC64_REL14 R_PPC64 = 11 + R_PPC64_REL14_BRTAKEN R_PPC64 = 12 + R_PPC64_REL14_BRNTAKEN R_PPC64 = 13 + R_PPC64_GOT16 R_PPC64 = 14 + R_PPC64_GOT16_LO R_PPC64 = 15 + R_PPC64_GOT16_HI R_PPC64 = 16 + R_PPC64_GOT16_HA R_PPC64 = 17 + R_PPC64_JMP_SLOT R_PPC64 = 21 + R_PPC64_REL32 R_PPC64 = 26 + R_PPC64_ADDR64 R_PPC64 = 38 + R_PPC64_ADDR16_HIGHER R_PPC64 = 39 + R_PPC64_ADDR16_HIGHERA R_PPC64 = 40 + R_PPC64_ADDR16_HIGHEST R_PPC64 = 41 + R_PPC64_ADDR16_HIGHESTA R_PPC64 = 42 + R_PPC64_REL64 R_PPC64 = 44 + R_PPC64_TOC16 R_PPC64 = 47 + R_PPC64_TOC16_LO R_PPC64 = 48 + R_PPC64_TOC16_HI R_PPC64 = 49 + R_PPC64_TOC16_HA R_PPC64 = 50 + R_PPC64_TOC R_PPC64 = 51 + R_PPC64_ADDR16_DS R_PPC64 = 56 + R_PPC64_ADDR16_LO_DS R_PPC64 = 57 + R_PPC64_GOT16_DS R_PPC64 = 58 + R_PPC64_GOT16_LO_DS R_PPC64 = 59 + R_PPC64_TOC16_DS R_PPC64 = 63 + R_PPC64_TOC16_LO_DS R_PPC64 = 64 + R_PPC64_TLS R_PPC64 = 67 + R_PPC64_DTPMOD64 R_PPC64 = 68 + R_PPC64_TPREL16 R_PPC64 = 69 + R_PPC64_TPREL16_LO R_PPC64 = 70 + R_PPC64_TPREL16_HI R_PPC64 = 71 + R_PPC64_TPREL16_HA R_PPC64 = 72 + R_PPC64_TPREL64 R_PPC64 = 73 + R_PPC64_DTPREL16 R_PPC64 = 74 + R_PPC64_DTPREL16_LO R_PPC64 = 75 + R_PPC64_DTPREL16_HI R_PPC64 = 76 + R_PPC64_DTPREL16_HA R_PPC64 = 77 + R_PPC64_DTPREL64 R_PPC64 = 78 + R_PPC64_GOT_TLSGD16 R_PPC64 = 79 + R_PPC64_GOT_TLSGD16_LO R_PPC64 = 80 + R_PPC64_GOT_TLSGD16_HI R_PPC64 = 81 + R_PPC64_GOT_TLSGD16_HA R_PPC64 = 82 + R_PPC64_GOT_TLSLD16 R_PPC64 = 83 + R_PPC64_GOT_TLSLD16_LO R_PPC64 = 84 + R_PPC64_GOT_TLSLD16_HI R_PPC64 = 85 + R_PPC64_GOT_TLSLD16_HA R_PPC64 = 86 + R_PPC64_GOT_TPREL16_DS R_PPC64 = 87 + R_PPC64_GOT_TPREL16_LO_DS R_PPC64 = 88 + R_PPC64_GOT_TPREL16_HI R_PPC64 = 89 + R_PPC64_GOT_TPREL16_HA R_PPC64 = 90 + R_PPC64_GOT_DTPREL16_DS R_PPC64 = 91 + R_PPC64_GOT_DTPREL16_LO_DS R_PPC64 = 92 + R_PPC64_GOT_DTPREL16_HI R_PPC64 = 93 + R_PPC64_GOT_DTPREL16_HA R_PPC64 = 94 + R_PPC64_TPREL16_DS R_PPC64 = 95 + R_PPC64_TPREL16_LO_DS R_PPC64 = 96 + R_PPC64_TPREL16_HIGHER R_PPC64 = 97 + R_PPC64_TPREL16_HIGHERA R_PPC64 = 98 + R_PPC64_TPREL16_HIGHEST R_PPC64 = 99 + R_PPC64_TPREL16_HIGHESTA R_PPC64 = 100 + R_PPC64_DTPREL16_DS R_PPC64 = 101 + R_PPC64_DTPREL16_LO_DS R_PPC64 = 102 + R_PPC64_DTPREL16_HIGHER R_PPC64 = 103 + R_PPC64_DTPREL16_HIGHERA R_PPC64 = 104 + R_PPC64_DTPREL16_HIGHEST R_PPC64 = 105 + R_PPC64_DTPREL16_HIGHESTA R_PPC64 = 106 + R_PPC64_TLSGD R_PPC64 = 107 + R_PPC64_TLSLD R_PPC64 = 108 + R_PPC64_REL16 R_PPC64 = 249 + R_PPC64_REL16_LO R_PPC64 = 250 + R_PPC64_REL16_HI R_PPC64 = 251 + R_PPC64_REL16_HA R_PPC64 = 252 +) + +var rppc64Strings = []intName{ + {0, "R_PPC64_NONE"}, + {1, "R_PPC64_ADDR32"}, + {2, "R_PPC64_ADDR24"}, + {3, "R_PPC64_ADDR16"}, + {4, "R_PPC64_ADDR16_LO"}, + {5, "R_PPC64_ADDR16_HI"}, + {6, "R_PPC64_ADDR16_HA"}, + {7, "R_PPC64_ADDR14"}, + {8, "R_PPC64_ADDR14_BRTAKEN"}, + {9, "R_PPC64_ADDR14_BRNTAKEN"}, + {10, "R_PPC64_REL24"}, + {11, "R_PPC64_REL14"}, + {12, "R_PPC64_REL14_BRTAKEN"}, + {13, "R_PPC64_REL14_BRNTAKEN"}, + {14, "R_PPC64_GOT16"}, + {15, "R_PPC64_GOT16_LO"}, + {16, "R_PPC64_GOT16_HI"}, + {17, "R_PPC64_GOT16_HA"}, + {21, "R_PPC64_JMP_SLOT"}, + {26, "R_PPC64_REL32"}, + {38, "R_PPC64_ADDR64"}, + {39, "R_PPC64_ADDR16_HIGHER"}, + {40, "R_PPC64_ADDR16_HIGHERA"}, + {41, "R_PPC64_ADDR16_HIGHEST"}, + {42, "R_PPC64_ADDR16_HIGHESTA"}, + {44, "R_PPC64_REL64"}, + {47, "R_PPC64_TOC16"}, + {48, "R_PPC64_TOC16_LO"}, + {49, "R_PPC64_TOC16_HI"}, + {50, "R_PPC64_TOC16_HA"}, + {51, "R_PPC64_TOC"}, + {56, "R_PPC64_ADDR16_DS"}, + {57, "R_PPC64_ADDR16_LO_DS"}, + {58, "R_PPC64_GOT16_DS"}, + {59, "R_PPC64_GOT16_LO_DS"}, + {63, "R_PPC64_TOC16_DS"}, + {64, "R_PPC64_TOC16_LO_DS"}, + {67, "R_PPC64_TLS"}, + {68, "R_PPC64_DTPMOD64"}, + {69, "R_PPC64_TPREL16"}, + {70, "R_PPC64_TPREL16_LO"}, + {71, "R_PPC64_TPREL16_HI"}, + {72, "R_PPC64_TPREL16_HA"}, + {73, "R_PPC64_TPREL64"}, + {74, "R_PPC64_DTPREL16"}, + {75, "R_PPC64_DTPREL16_LO"}, + {76, "R_PPC64_DTPREL16_HI"}, + {77, "R_PPC64_DTPREL16_HA"}, + {78, "R_PPC64_DTPREL64"}, + {79, "R_PPC64_GOT_TLSGD16"}, + {80, "R_PPC64_GOT_TLSGD16_LO"}, + {81, "R_PPC64_GOT_TLSGD16_HI"}, + {82, "R_PPC64_GOT_TLSGD16_HA"}, + {83, "R_PPC64_GOT_TLSLD16"}, + {84, "R_PPC64_GOT_TLSLD16_LO"}, + {85, "R_PPC64_GOT_TLSLD16_HI"}, + {86, "R_PPC64_GOT_TLSLD16_HA"}, + {87, "R_PPC64_GOT_TPREL16_DS"}, + {88, "R_PPC64_GOT_TPREL16_LO_DS"}, + {89, "R_PPC64_GOT_TPREL16_HI"}, + {90, "R_PPC64_GOT_TPREL16_HA"}, + {91, "R_PPC64_GOT_DTPREL16_DS"}, + {92, "R_PPC64_GOT_DTPREL16_LO_DS"}, + {93, "R_PPC64_GOT_DTPREL16_HI"}, + {94, "R_PPC64_GOT_DTPREL16_HA"}, + {95, "R_PPC64_TPREL16_DS"}, + {96, "R_PPC64_TPREL16_LO_DS"}, + {97, "R_PPC64_TPREL16_HIGHER"}, + {98, "R_PPC64_TPREL16_HIGHERA"}, + {99, "R_PPC64_TPREL16_HIGHEST"}, + {100, "R_PPC64_TPREL16_HIGHESTA"}, + {101, "R_PPC64_DTPREL16_DS"}, + {102, "R_PPC64_DTPREL16_LO_DS"}, + {103, "R_PPC64_DTPREL16_HIGHER"}, + {104, "R_PPC64_DTPREL16_HIGHERA"}, + {105, "R_PPC64_DTPREL16_HIGHEST"}, + {106, "R_PPC64_DTPREL16_HIGHESTA"}, + {107, "R_PPC64_TLSGD"}, + {108, "R_PPC64_TLSLD"}, + {249, "R_PPC64_REL16"}, + {250, "R_PPC64_REL16_LO"}, + {251, "R_PPC64_REL16_HI"}, + {252, "R_PPC64_REL16_HA"}, +} + +func (i R_PPC64) String() string { return stringName(uint32(i), rppc64Strings, false) } +func (i R_PPC64) GoString() string { return stringName(uint32(i), rppc64Strings, true) } + +// Relocation types for SPARC. +type R_SPARC int + +const ( + R_SPARC_NONE R_SPARC = 0 + R_SPARC_8 R_SPARC = 1 + R_SPARC_16 R_SPARC = 2 + R_SPARC_32 R_SPARC = 3 + R_SPARC_DISP8 R_SPARC = 4 + R_SPARC_DISP16 R_SPARC = 5 + R_SPARC_DISP32 R_SPARC = 6 + R_SPARC_WDISP30 R_SPARC = 7 + R_SPARC_WDISP22 R_SPARC = 8 + R_SPARC_HI22 R_SPARC = 9 + R_SPARC_22 R_SPARC = 10 + R_SPARC_13 R_SPARC = 11 + R_SPARC_LO10 R_SPARC = 12 + R_SPARC_GOT10 R_SPARC = 13 + R_SPARC_GOT13 R_SPARC = 14 + R_SPARC_GOT22 R_SPARC = 15 + R_SPARC_PC10 R_SPARC = 16 + R_SPARC_PC22 R_SPARC = 17 + R_SPARC_WPLT30 R_SPARC = 18 + R_SPARC_COPY R_SPARC = 19 + R_SPARC_GLOB_DAT R_SPARC = 20 + R_SPARC_JMP_SLOT R_SPARC = 21 + R_SPARC_RELATIVE R_SPARC = 22 + R_SPARC_UA32 R_SPARC = 23 + R_SPARC_PLT32 R_SPARC = 24 + R_SPARC_HIPLT22 R_SPARC = 25 + R_SPARC_LOPLT10 R_SPARC = 26 + R_SPARC_PCPLT32 R_SPARC = 27 + R_SPARC_PCPLT22 R_SPARC = 28 + R_SPARC_PCPLT10 R_SPARC = 29 + R_SPARC_10 R_SPARC = 30 + R_SPARC_11 R_SPARC = 31 + R_SPARC_64 R_SPARC = 32 + R_SPARC_OLO10 R_SPARC = 33 + R_SPARC_HH22 R_SPARC = 34 + R_SPARC_HM10 R_SPARC = 35 + R_SPARC_LM22 R_SPARC = 36 + R_SPARC_PC_HH22 R_SPARC = 37 + R_SPARC_PC_HM10 R_SPARC = 38 + R_SPARC_PC_LM22 R_SPARC = 39 + R_SPARC_WDISP16 R_SPARC = 40 + R_SPARC_WDISP19 R_SPARC = 41 + R_SPARC_GLOB_JMP R_SPARC = 42 + R_SPARC_7 R_SPARC = 43 + R_SPARC_5 R_SPARC = 44 + R_SPARC_6 R_SPARC = 45 + R_SPARC_DISP64 R_SPARC = 46 + R_SPARC_PLT64 R_SPARC = 47 + R_SPARC_HIX22 R_SPARC = 48 + R_SPARC_LOX10 R_SPARC = 49 + R_SPARC_H44 R_SPARC = 50 + R_SPARC_M44 R_SPARC = 51 + R_SPARC_L44 R_SPARC = 52 + R_SPARC_REGISTER R_SPARC = 53 + R_SPARC_UA64 R_SPARC = 54 + R_SPARC_UA16 R_SPARC = 55 +) + +var rsparcStrings = []intName{ + {0, "R_SPARC_NONE"}, + {1, "R_SPARC_8"}, + {2, "R_SPARC_16"}, + {3, "R_SPARC_32"}, + {4, "R_SPARC_DISP8"}, + {5, "R_SPARC_DISP16"}, + {6, "R_SPARC_DISP32"}, + {7, "R_SPARC_WDISP30"}, + {8, "R_SPARC_WDISP22"}, + {9, "R_SPARC_HI22"}, + {10, "R_SPARC_22"}, + {11, "R_SPARC_13"}, + {12, "R_SPARC_LO10"}, + {13, "R_SPARC_GOT10"}, + {14, "R_SPARC_GOT13"}, + {15, "R_SPARC_GOT22"}, + {16, "R_SPARC_PC10"}, + {17, "R_SPARC_PC22"}, + {18, "R_SPARC_WPLT30"}, + {19, "R_SPARC_COPY"}, + {20, "R_SPARC_GLOB_DAT"}, + {21, "R_SPARC_JMP_SLOT"}, + {22, "R_SPARC_RELATIVE"}, + {23, "R_SPARC_UA32"}, + {24, "R_SPARC_PLT32"}, + {25, "R_SPARC_HIPLT22"}, + {26, "R_SPARC_LOPLT10"}, + {27, "R_SPARC_PCPLT32"}, + {28, "R_SPARC_PCPLT22"}, + {29, "R_SPARC_PCPLT10"}, + {30, "R_SPARC_10"}, + {31, "R_SPARC_11"}, + {32, "R_SPARC_64"}, + {33, "R_SPARC_OLO10"}, + {34, "R_SPARC_HH22"}, + {35, "R_SPARC_HM10"}, + {36, "R_SPARC_LM22"}, + {37, "R_SPARC_PC_HH22"}, + {38, "R_SPARC_PC_HM10"}, + {39, "R_SPARC_PC_LM22"}, + {40, "R_SPARC_WDISP16"}, + {41, "R_SPARC_WDISP19"}, + {42, "R_SPARC_GLOB_JMP"}, + {43, "R_SPARC_7"}, + {44, "R_SPARC_5"}, + {45, "R_SPARC_6"}, + {46, "R_SPARC_DISP64"}, + {47, "R_SPARC_PLT64"}, + {48, "R_SPARC_HIX22"}, + {49, "R_SPARC_LOX10"}, + {50, "R_SPARC_H44"}, + {51, "R_SPARC_M44"}, + {52, "R_SPARC_L44"}, + {53, "R_SPARC_REGISTER"}, + {54, "R_SPARC_UA64"}, + {55, "R_SPARC_UA16"}, +} + +func (i R_SPARC) String() string { return stringName(uint32(i), rsparcStrings, false) } +func (i R_SPARC) GoString() string { return stringName(uint32(i), rsparcStrings, true) } + +// Magic number for the elf trampoline, chosen wisely to be an immediate value. +const ARM_MAGIC_TRAMP_NUMBER = 0x5c000003 + +// ELF32 File header. +type Header32 struct { + Ident [EI_NIDENT]byte /* File identification. */ + Type uint16 /* File type. */ + Machine uint16 /* Machine architecture. */ + Version uint32 /* ELF format version. */ + Entry uint32 /* Entry point. */ + Phoff uint32 /* Program header file offset. */ + Shoff uint32 /* Section header file offset. */ + Flags uint32 /* Architecture-specific flags. */ + Ehsize uint16 /* Size of ELF header in bytes. */ + Phentsize uint16 /* Size of program header entry. */ + Phnum uint16 /* Number of program header entries. */ + Shentsize uint16 /* Size of section header entry. */ + Shnum uint16 /* Number of section header entries. */ + Shstrndx uint16 /* Section name strings section. */ +} + +// ELF32 Section header. +type Section32 struct { + Name uint32 /* Section name (index into the section header string table). */ + Type uint32 /* Section type. */ + Flags uint32 /* Section flags. */ + Addr uint32 /* Address in memory image. */ + Off uint32 /* Offset in file. */ + Size uint32 /* Size in bytes. */ + Link uint32 /* Index of a related section. */ + Info uint32 /* Depends on section type. */ + Addralign uint32 /* Alignment in bytes. */ + Entsize uint32 /* Size of each entry in section. */ +} + +// ELF32 Program header. +type Prog32 struct { + Type uint32 /* Entry type. */ + Off uint32 /* File offset of contents. */ + Vaddr uint32 /* Virtual address in memory image. */ + Paddr uint32 /* Physical address (not used). */ + Filesz uint32 /* Size of contents in file. */ + Memsz uint32 /* Size of contents in memory. */ + Flags uint32 /* Access permission flags. */ + Align uint32 /* Alignment in memory and file. */ +} + +// ELF32 Dynamic structure. The ".dynamic" section contains an array of them. +type Dyn32 struct { + Tag int32 /* Entry type. */ + Val uint32 /* Integer/Address value. */ +} + +/* + * Relocation entries. + */ + +// ELF32 Relocations that don't need an addend field. +type Rel32 struct { + Off uint32 /* Location to be relocated. */ + Info uint32 /* Relocation type and symbol index. */ +} + +// ELF32 Relocations that need an addend field. +type Rela32 struct { + Off uint32 /* Location to be relocated. */ + Info uint32 /* Relocation type and symbol index. */ + Addend int32 /* Addend. */ +} + +func R_SYM32(info uint32) uint32 { return uint32(info >> 8) } +func R_TYPE32(info uint32) uint32 { return uint32(info & 0xff) } +func R_INFO32(sym, typ uint32) uint32 { return sym<<8 | typ } + +// ELF32 Symbol. +type Sym32 struct { + Name uint32 + Value uint32 + Size uint32 + Info uint8 + Other uint8 + Shndx uint16 +} + +const Sym32Size = 16 + +func ST_BIND(info uint8) SymBind { return SymBind(info >> 4) } +func ST_TYPE(info uint8) SymType { return SymType(info & 0xF) } +func ST_INFO(bind SymBind, typ SymType) uint8 { + return uint8(bind)<<4 | uint8(typ)&0xf +} +func ST_VISIBILITY(other uint8) SymVis { return SymVis(other & 3) } + +/* + * ELF64 + */ + +// ELF64 file header. +type Header64 struct { + Ident [EI_NIDENT]byte /* File identification. */ + Type uint16 /* File type. */ + Machine uint16 /* Machine architecture. */ + Version uint32 /* ELF format version. */ + Entry uint64 /* Entry point. */ + Phoff uint64 /* Program header file offset. */ + Shoff uint64 /* Section header file offset. */ + Flags uint32 /* Architecture-specific flags. */ + Ehsize uint16 /* Size of ELF header in bytes. */ + Phentsize uint16 /* Size of program header entry. */ + Phnum uint16 /* Number of program header entries. */ + Shentsize uint16 /* Size of section header entry. */ + Shnum uint16 /* Number of section header entries. */ + Shstrndx uint16 /* Section name strings section. */ +} + +// ELF64 Section header. +type Section64 struct { + Name uint32 /* Section name (index into the section header string table). */ + Type uint32 /* Section type. */ + Flags uint64 /* Section flags. */ + Addr uint64 /* Address in memory image. */ + Off uint64 /* Offset in file. */ + Size uint64 /* Size in bytes. */ + Link uint32 /* Index of a related section. */ + Info uint32 /* Depends on section type. */ + Addralign uint64 /* Alignment in bytes. */ + Entsize uint64 /* Size of each entry in section. */ +} + +// ELF64 Program header. +type Prog64 struct { + Type uint32 /* Entry type. */ + Flags uint32 /* Access permission flags. */ + Off uint64 /* File offset of contents. */ + Vaddr uint64 /* Virtual address in memory image. */ + Paddr uint64 /* Physical address (not used). */ + Filesz uint64 /* Size of contents in file. */ + Memsz uint64 /* Size of contents in memory. */ + Align uint64 /* Alignment in memory and file. */ +} + +// ELF64 Dynamic structure. The ".dynamic" section contains an array of them. +type Dyn64 struct { + Tag int64 /* Entry type. */ + Val uint64 /* Integer/address value */ +} + +/* + * Relocation entries. + */ + +/* ELF64 relocations that don't need an addend field. */ +type Rel64 struct { + Off uint64 /* Location to be relocated. */ + Info uint64 /* Relocation type and symbol index. */ +} + +/* ELF64 relocations that need an addend field. */ +type Rela64 struct { + Off uint64 /* Location to be relocated. */ + Info uint64 /* Relocation type and symbol index. */ + Addend int64 /* Addend. */ +} + +func R_SYM64(info uint64) uint32 { return uint32(info >> 32) } +func R_TYPE64(info uint64) uint32 { return uint32(info) } +func R_INFO(sym, typ uint32) uint64 { return uint64(sym)<<32 | uint64(typ) } + +// ELF64 symbol table entries. +type Sym64 struct { + Name uint32 /* String table index of name. */ + Info uint8 /* Type and binding information. */ + Other uint8 /* Reserved (not used). */ + Shndx uint16 /* Section index of symbol. */ + Value uint64 /* Symbol value. */ + Size uint64 /* Size of associated object. */ +} + +const Sym64Size = 24 + +type intName struct { + i uint32 + s string +} + +func stringName(i uint32, names []intName, goSyntax bool) string { + for _, n := range names { + if n.i == i { + if goSyntax { + return "elf." + n.s + } + return n.s + } + } + + // second pass - look for smaller to add with. + // assume sorted already + for j := len(names) - 1; j >= 0; j-- { + n := names[j] + if n.i < i { + s := n.s + if goSyntax { + s = "elf." + s + } + return s + "+" + strconv.FormatUint(uint64(i-n.i), 10) + } + } + + return strconv.FormatUint(uint64(i), 10) +} + +func flagName(i uint32, names []intName, goSyntax bool) string { + s := "" + for _, n := range names { + if n.i&i == n.i { + if len(s) > 0 { + s += "+" + } + if goSyntax { + s += "elf." + } + s += n.s + i -= n.i + } + } + if len(s) == 0 { + return "0x" + strconv.FormatUint(uint64(i), 16) + } + if i != 0 { + s += "+0x" + strconv.FormatUint(uint64(i), 16) + } + return s +} diff --git a/src/debug/elf/elf_test.go b/src/debug/elf/elf_test.go new file mode 100644 index 0000000000000000000000000000000000000000..e3c51bb717b20661cc69e7b77fc1f7892e79b980 --- /dev/null +++ b/src/debug/elf/elf_test.go @@ -0,0 +1,49 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package elf + +import ( + "fmt" + "testing" +) + +type nameTest struct { + val interface{} + str string +} + +var nameTests = []nameTest{ + {ELFOSABI_LINUX, "ELFOSABI_LINUX"}, + {ET_EXEC, "ET_EXEC"}, + {EM_860, "EM_860"}, + {SHN_LOPROC, "SHN_LOPROC"}, + {SHT_PROGBITS, "SHT_PROGBITS"}, + {SHF_MERGE + SHF_TLS, "SHF_MERGE+SHF_TLS"}, + {PT_LOAD, "PT_LOAD"}, + {PF_W + PF_R + 0x50, "PF_W+PF_R+0x50"}, + {DT_SYMBOLIC, "DT_SYMBOLIC"}, + {DF_BIND_NOW, "DF_BIND_NOW"}, + {NT_FPREGSET, "NT_FPREGSET"}, + {STB_GLOBAL, "STB_GLOBAL"}, + {STT_COMMON, "STT_COMMON"}, + {STV_HIDDEN, "STV_HIDDEN"}, + {R_X86_64_PC32, "R_X86_64_PC32"}, + {R_ALPHA_OP_PUSH, "R_ALPHA_OP_PUSH"}, + {R_ARM_THM_ABS5, "R_ARM_THM_ABS5"}, + {R_386_GOT32, "R_386_GOT32"}, + {R_PPC_GOT16_HI, "R_PPC_GOT16_HI"}, + {R_SPARC_GOT22, "R_SPARC_GOT22"}, + {ET_LOOS + 5, "ET_LOOS+5"}, + {ProgFlag(0x50), "0x50"}, +} + +func TestNames(t *testing.T) { + for i, tt := range nameTests { + s := fmt.Sprint(tt.val) + if s != tt.str { + t.Errorf("#%d: Sprint(%d) = %q, want %q", i, tt.val, s, tt.str) + } + } +} diff --git a/src/debug/elf/file.go b/src/debug/elf/file.go new file mode 100644 index 0000000000000000000000000000000000000000..40625435fdcefe571ee18041931b4e59dc2f3f5c --- /dev/null +++ b/src/debug/elf/file.go @@ -0,0 +1,1064 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package elf implements access to ELF object files. +package elf + +import ( + "bytes" + "debug/dwarf" + "encoding/binary" + "errors" + "fmt" + "io" + "os" + "strings" +) + +// TODO: error reporting detail + +/* + * Internal ELF representation + */ + +// A FileHeader represents an ELF file header. +type FileHeader struct { + Class Class + Data Data + Version Version + OSABI OSABI + ABIVersion uint8 + ByteOrder binary.ByteOrder + Type Type + Machine Machine + Entry uint64 +} + +// A File represents an open ELF file. +type File struct { + FileHeader + Sections []*Section + Progs []*Prog + closer io.Closer + gnuNeed []verneed + gnuVersym []byte +} + +// A SectionHeader represents a single ELF section header. +type SectionHeader struct { + Name string + Type SectionType + Flags SectionFlag + Addr uint64 + Offset uint64 + Size uint64 + Link uint32 + Info uint32 + Addralign uint64 + Entsize uint64 +} + +// A Section represents a single section in an ELF file. +type Section struct { + SectionHeader + + // Embed ReaderAt for ReadAt method. + // Do not embed SectionReader directly + // to avoid having Read and Seek. + // If a client wants Read and Seek it must use + // Open() to avoid fighting over the seek offset + // with other clients. + io.ReaderAt + sr *io.SectionReader +} + +// Data reads and returns the contents of the ELF section. +func (s *Section) Data() ([]byte, error) { + dat := make([]byte, s.sr.Size()) + n, err := s.sr.ReadAt(dat, 0) + if n == len(dat) { + err = nil + } + return dat[0:n], err +} + +// stringTable reads and returns the string table given by the +// specified link value. +func (f *File) stringTable(link uint32) ([]byte, error) { + if link <= 0 || link >= uint32(len(f.Sections)) { + return nil, errors.New("section has invalid string table link") + } + return f.Sections[link].Data() +} + +// Open returns a new ReadSeeker reading the ELF section. +func (s *Section) Open() io.ReadSeeker { return io.NewSectionReader(s.sr, 0, 1<<63-1) } + +// A ProgHeader represents a single ELF program header. +type ProgHeader struct { + Type ProgType + Flags ProgFlag + Off uint64 + Vaddr uint64 + Paddr uint64 + Filesz uint64 + Memsz uint64 + Align uint64 +} + +// A Prog represents a single ELF program header in an ELF binary. +type Prog struct { + ProgHeader + + // Embed ReaderAt for ReadAt method. + // Do not embed SectionReader directly + // to avoid having Read and Seek. + // If a client wants Read and Seek it must use + // Open() to avoid fighting over the seek offset + // with other clients. + io.ReaderAt + sr *io.SectionReader +} + +// Open returns a new ReadSeeker reading the ELF program body. +func (p *Prog) Open() io.ReadSeeker { return io.NewSectionReader(p.sr, 0, 1<<63-1) } + +// A Symbol represents an entry in an ELF symbol table section. +type Symbol struct { + Name string + Info, Other byte + Section SectionIndex + Value, Size uint64 +} + +/* + * ELF reader + */ + +type FormatError struct { + off int64 + msg string + val interface{} +} + +func (e *FormatError) Error() string { + msg := e.msg + if e.val != nil { + msg += fmt.Sprintf(" '%v' ", e.val) + } + msg += fmt.Sprintf("in record at byte %#x", e.off) + return msg +} + +// Open opens the named file using os.Open and prepares it for use as an ELF binary. +func Open(name string) (*File, error) { + f, err := os.Open(name) + if err != nil { + return nil, err + } + ff, err := NewFile(f) + if err != nil { + f.Close() + return nil, err + } + ff.closer = f + return ff, nil +} + +// Close closes the File. +// If the File was created using NewFile directly instead of Open, +// Close has no effect. +func (f *File) Close() error { + var err error + if f.closer != nil { + err = f.closer.Close() + f.closer = nil + } + return err +} + +// SectionByType returns the first section in f with the +// given type, or nil if there is no such section. +func (f *File) SectionByType(typ SectionType) *Section { + for _, s := range f.Sections { + if s.Type == typ { + return s + } + } + return nil +} + +// NewFile creates a new File for accessing an ELF binary in an underlying reader. +// The ELF binary is expected to start at position 0 in the ReaderAt. +func NewFile(r io.ReaderAt) (*File, error) { + sr := io.NewSectionReader(r, 0, 1<<63-1) + // Read and decode ELF identifier + var ident [16]uint8 + if _, err := r.ReadAt(ident[0:], 0); err != nil { + return nil, err + } + if ident[0] != '\x7f' || ident[1] != 'E' || ident[2] != 'L' || ident[3] != 'F' { + return nil, &FormatError{0, "bad magic number", ident[0:4]} + } + + f := new(File) + f.Class = Class(ident[EI_CLASS]) + switch f.Class { + case ELFCLASS32: + case ELFCLASS64: + // ok + default: + return nil, &FormatError{0, "unknown ELF class", f.Class} + } + + f.Data = Data(ident[EI_DATA]) + switch f.Data { + case ELFDATA2LSB: + f.ByteOrder = binary.LittleEndian + case ELFDATA2MSB: + f.ByteOrder = binary.BigEndian + default: + return nil, &FormatError{0, "unknown ELF data encoding", f.Data} + } + + f.Version = Version(ident[EI_VERSION]) + if f.Version != EV_CURRENT { + return nil, &FormatError{0, "unknown ELF version", f.Version} + } + + f.OSABI = OSABI(ident[EI_OSABI]) + f.ABIVersion = ident[EI_ABIVERSION] + + // Read ELF file header + var phoff int64 + var phentsize, phnum int + var shoff int64 + var shentsize, shnum, shstrndx int + shstrndx = -1 + switch f.Class { + case ELFCLASS32: + hdr := new(Header32) + sr.Seek(0, os.SEEK_SET) + if err := binary.Read(sr, f.ByteOrder, hdr); err != nil { + return nil, err + } + f.Type = Type(hdr.Type) + f.Machine = Machine(hdr.Machine) + f.Entry = uint64(hdr.Entry) + if v := Version(hdr.Version); v != f.Version { + return nil, &FormatError{0, "mismatched ELF version", v} + } + phoff = int64(hdr.Phoff) + phentsize = int(hdr.Phentsize) + phnum = int(hdr.Phnum) + shoff = int64(hdr.Shoff) + shentsize = int(hdr.Shentsize) + shnum = int(hdr.Shnum) + shstrndx = int(hdr.Shstrndx) + case ELFCLASS64: + hdr := new(Header64) + sr.Seek(0, os.SEEK_SET) + if err := binary.Read(sr, f.ByteOrder, hdr); err != nil { + return nil, err + } + f.Type = Type(hdr.Type) + f.Machine = Machine(hdr.Machine) + f.Entry = uint64(hdr.Entry) + if v := Version(hdr.Version); v != f.Version { + return nil, &FormatError{0, "mismatched ELF version", v} + } + phoff = int64(hdr.Phoff) + phentsize = int(hdr.Phentsize) + phnum = int(hdr.Phnum) + shoff = int64(hdr.Shoff) + shentsize = int(hdr.Shentsize) + shnum = int(hdr.Shnum) + shstrndx = int(hdr.Shstrndx) + } + + if shnum > 0 && shoff > 0 && (shstrndx < 0 || shstrndx >= shnum) { + return nil, &FormatError{0, "invalid ELF shstrndx", shstrndx} + } + + // Read program headers + f.Progs = make([]*Prog, phnum) + for i := 0; i < phnum; i++ { + off := phoff + int64(i)*int64(phentsize) + sr.Seek(off, os.SEEK_SET) + p := new(Prog) + switch f.Class { + case ELFCLASS32: + ph := new(Prog32) + if err := binary.Read(sr, f.ByteOrder, ph); err != nil { + return nil, err + } + p.ProgHeader = ProgHeader{ + Type: ProgType(ph.Type), + Flags: ProgFlag(ph.Flags), + Off: uint64(ph.Off), + Vaddr: uint64(ph.Vaddr), + Paddr: uint64(ph.Paddr), + Filesz: uint64(ph.Filesz), + Memsz: uint64(ph.Memsz), + Align: uint64(ph.Align), + } + case ELFCLASS64: + ph := new(Prog64) + if err := binary.Read(sr, f.ByteOrder, ph); err != nil { + return nil, err + } + p.ProgHeader = ProgHeader{ + Type: ProgType(ph.Type), + Flags: ProgFlag(ph.Flags), + Off: uint64(ph.Off), + Vaddr: uint64(ph.Vaddr), + Paddr: uint64(ph.Paddr), + Filesz: uint64(ph.Filesz), + Memsz: uint64(ph.Memsz), + Align: uint64(ph.Align), + } + } + p.sr = io.NewSectionReader(r, int64(p.Off), int64(p.Filesz)) + p.ReaderAt = p.sr + f.Progs[i] = p + } + + // Read section headers + f.Sections = make([]*Section, shnum) + names := make([]uint32, shnum) + for i := 0; i < shnum; i++ { + off := shoff + int64(i)*int64(shentsize) + sr.Seek(off, os.SEEK_SET) + s := new(Section) + switch f.Class { + case ELFCLASS32: + sh := new(Section32) + if err := binary.Read(sr, f.ByteOrder, sh); err != nil { + return nil, err + } + names[i] = sh.Name + s.SectionHeader = SectionHeader{ + Type: SectionType(sh.Type), + Flags: SectionFlag(sh.Flags), + Addr: uint64(sh.Addr), + Offset: uint64(sh.Off), + Size: uint64(sh.Size), + Link: uint32(sh.Link), + Info: uint32(sh.Info), + Addralign: uint64(sh.Addralign), + Entsize: uint64(sh.Entsize), + } + case ELFCLASS64: + sh := new(Section64) + if err := binary.Read(sr, f.ByteOrder, sh); err != nil { + return nil, err + } + names[i] = sh.Name + s.SectionHeader = SectionHeader{ + Type: SectionType(sh.Type), + Flags: SectionFlag(sh.Flags), + Offset: uint64(sh.Off), + Size: uint64(sh.Size), + Addr: uint64(sh.Addr), + Link: uint32(sh.Link), + Info: uint32(sh.Info), + Addralign: uint64(sh.Addralign), + Entsize: uint64(sh.Entsize), + } + } + s.sr = io.NewSectionReader(r, int64(s.Offset), int64(s.Size)) + s.ReaderAt = s.sr + f.Sections[i] = s + } + + if len(f.Sections) == 0 { + return f, nil + } + + // Load section header string table. + shstrtab, err := f.Sections[shstrndx].Data() + if err != nil { + return nil, err + } + for i, s := range f.Sections { + var ok bool + s.Name, ok = getString(shstrtab, int(names[i])) + if !ok { + return nil, &FormatError{shoff + int64(i*shentsize), "bad section name index", names[i]} + } + } + + return f, nil +} + +// getSymbols returns a slice of Symbols from parsing the symbol table +// with the given type, along with the associated string table. +func (f *File) getSymbols(typ SectionType) ([]Symbol, []byte, error) { + switch f.Class { + case ELFCLASS64: + return f.getSymbols64(typ) + + case ELFCLASS32: + return f.getSymbols32(typ) + } + + return nil, nil, errors.New("not implemented") +} + +// ErrNoSymbols is returned by File.Symbols and File.DynamicSymbols +// if there is no such section in the File. +var ErrNoSymbols = errors.New("no symbol section") + +func (f *File) getSymbols32(typ SectionType) ([]Symbol, []byte, error) { + symtabSection := f.SectionByType(typ) + if symtabSection == nil { + return nil, nil, ErrNoSymbols + } + + data, err := symtabSection.Data() + if err != nil { + return nil, nil, errors.New("cannot load symbol section") + } + symtab := bytes.NewReader(data) + if symtab.Len()%Sym32Size != 0 { + return nil, nil, errors.New("length of symbol section is not a multiple of SymSize") + } + + strdata, err := f.stringTable(symtabSection.Link) + if err != nil { + return nil, nil, errors.New("cannot load string table section") + } + + // The first entry is all zeros. + var skip [Sym32Size]byte + symtab.Read(skip[:]) + + symbols := make([]Symbol, symtab.Len()/Sym32Size) + + i := 0 + var sym Sym32 + for symtab.Len() > 0 { + binary.Read(symtab, f.ByteOrder, &sym) + str, _ := getString(strdata, int(sym.Name)) + symbols[i].Name = str + symbols[i].Info = sym.Info + symbols[i].Other = sym.Other + symbols[i].Section = SectionIndex(sym.Shndx) + symbols[i].Value = uint64(sym.Value) + symbols[i].Size = uint64(sym.Size) + i++ + } + + return symbols, strdata, nil +} + +func (f *File) getSymbols64(typ SectionType) ([]Symbol, []byte, error) { + symtabSection := f.SectionByType(typ) + if symtabSection == nil { + return nil, nil, ErrNoSymbols + } + + data, err := symtabSection.Data() + if err != nil { + return nil, nil, errors.New("cannot load symbol section") + } + symtab := bytes.NewReader(data) + if symtab.Len()%Sym64Size != 0 { + return nil, nil, errors.New("length of symbol section is not a multiple of Sym64Size") + } + + strdata, err := f.stringTable(symtabSection.Link) + if err != nil { + return nil, nil, errors.New("cannot load string table section") + } + + // The first entry is all zeros. + var skip [Sym64Size]byte + symtab.Read(skip[:]) + + symbols := make([]Symbol, symtab.Len()/Sym64Size) + + i := 0 + var sym Sym64 + for symtab.Len() > 0 { + binary.Read(symtab, f.ByteOrder, &sym) + str, _ := getString(strdata, int(sym.Name)) + symbols[i].Name = str + symbols[i].Info = sym.Info + symbols[i].Other = sym.Other + symbols[i].Section = SectionIndex(sym.Shndx) + symbols[i].Value = sym.Value + symbols[i].Size = sym.Size + i++ + } + + return symbols, strdata, nil +} + +// getString extracts a string from an ELF string table. +func getString(section []byte, start int) (string, bool) { + if start < 0 || start >= len(section) { + return "", false + } + + for end := start; end < len(section); end++ { + if section[end] == 0 { + return string(section[start:end]), true + } + } + return "", false +} + +// Section returns a section with the given name, or nil if no such +// section exists. +func (f *File) Section(name string) *Section { + for _, s := range f.Sections { + if s.Name == name { + return s + } + } + return nil +} + +// applyRelocations applies relocations to dst. rels is a relocations section +// in RELA format. +func (f *File) applyRelocations(dst []byte, rels []byte) error { + switch { + case f.Class == ELFCLASS64 && f.Machine == EM_X86_64: + return f.applyRelocationsAMD64(dst, rels) + case f.Class == ELFCLASS32 && f.Machine == EM_386: + return f.applyRelocations386(dst, rels) + case f.Class == ELFCLASS32 && f.Machine == EM_ARM: + return f.applyRelocationsARM(dst, rels) + case f.Class == ELFCLASS64 && f.Machine == EM_AARCH64: + return f.applyRelocationsARM64(dst, rels) + case f.Class == ELFCLASS32 && f.Machine == EM_PPC: + return f.applyRelocationsPPC(dst, rels) + case f.Class == ELFCLASS64 && f.Machine == EM_PPC64: + return f.applyRelocationsPPC64(dst, rels) + default: + return errors.New("applyRelocations: not implemented") + } +} + +func (f *File) applyRelocationsAMD64(dst []byte, rels []byte) error { + // 24 is the size of Rela64. + if len(rels)%24 != 0 { + return errors.New("length of relocation section is not a multiple of 24") + } + + symbols, _, err := f.getSymbols(SHT_SYMTAB) + if err != nil { + return err + } + + b := bytes.NewReader(rels) + var rela Rela64 + + for b.Len() > 0 { + binary.Read(b, f.ByteOrder, &rela) + symNo := rela.Info >> 32 + t := R_X86_64(rela.Info & 0xffff) + + if symNo == 0 || symNo > uint64(len(symbols)) { + continue + } + sym := &symbols[symNo-1] + if SymType(sym.Info&0xf) != STT_SECTION { + // We don't handle non-section relocations for now. + continue + } + + // There are relocations, so this must be a normal + // object file, and we only look at section symbols, + // so we assume that the symbol value is 0. + + switch t { + case R_X86_64_64: + if rela.Off+8 >= uint64(len(dst)) || rela.Addend < 0 { + continue + } + f.ByteOrder.PutUint64(dst[rela.Off:rela.Off+8], uint64(rela.Addend)) + case R_X86_64_32: + if rela.Off+4 >= uint64(len(dst)) || rela.Addend < 0 { + continue + } + f.ByteOrder.PutUint32(dst[rela.Off:rela.Off+4], uint32(rela.Addend)) + } + } + + return nil +} + +func (f *File) applyRelocations386(dst []byte, rels []byte) error { + // 8 is the size of Rel32. + if len(rels)%8 != 0 { + return errors.New("length of relocation section is not a multiple of 8") + } + + symbols, _, err := f.getSymbols(SHT_SYMTAB) + if err != nil { + return err + } + + b := bytes.NewReader(rels) + var rel Rel32 + + for b.Len() > 0 { + binary.Read(b, f.ByteOrder, &rel) + symNo := rel.Info >> 8 + t := R_386(rel.Info & 0xff) + + if symNo == 0 || symNo > uint32(len(symbols)) { + continue + } + sym := &symbols[symNo-1] + + if t == R_386_32 { + if rel.Off+4 >= uint32(len(dst)) { + continue + } + val := f.ByteOrder.Uint32(dst[rel.Off : rel.Off+4]) + val += uint32(sym.Value) + f.ByteOrder.PutUint32(dst[rel.Off:rel.Off+4], val) + } + } + + return nil +} + +func (f *File) applyRelocationsARM(dst []byte, rels []byte) error { + // 8 is the size of Rel32. + if len(rels)%8 != 0 { + return errors.New("length of relocation section is not a multiple of 8") + } + + symbols, _, err := f.getSymbols(SHT_SYMTAB) + if err != nil { + return err + } + + b := bytes.NewReader(rels) + var rel Rel32 + + for b.Len() > 0 { + binary.Read(b, f.ByteOrder, &rel) + symNo := rel.Info >> 8 + t := R_ARM(rel.Info & 0xff) + + if symNo == 0 || symNo > uint32(len(symbols)) { + continue + } + sym := &symbols[symNo-1] + + switch t { + case R_ARM_ABS32: + if rel.Off+4 >= uint32(len(dst)) { + continue + } + val := f.ByteOrder.Uint32(dst[rel.Off : rel.Off+4]) + val += uint32(sym.Value) + f.ByteOrder.PutUint32(dst[rel.Off:rel.Off+4], val) + } + } + + return nil +} + +func (f *File) applyRelocationsARM64(dst []byte, rels []byte) error { + // 24 is the size of Rela64. + if len(rels)%24 != 0 { + return errors.New("length of relocation section is not a multiple of 24") + } + + symbols, _, err := f.getSymbols(SHT_SYMTAB) + if err != nil { + return err + } + + b := bytes.NewReader(rels) + var rela Rela64 + + for b.Len() > 0 { + binary.Read(b, f.ByteOrder, &rela) + symNo := rela.Info >> 32 + t := R_AARCH64(rela.Info & 0xffff) + + if symNo == 0 || symNo > uint64(len(symbols)) { + continue + } + sym := &symbols[symNo-1] + if SymType(sym.Info&0xf) != STT_SECTION { + // We don't handle non-section relocations for now. + continue + } + + // There are relocations, so this must be a normal + // object file, and we only look at section symbols, + // so we assume that the symbol value is 0. + + switch t { + case R_AARCH64_ABS64: + if rela.Off+8 >= uint64(len(dst)) || rela.Addend < 0 { + continue + } + f.ByteOrder.PutUint64(dst[rela.Off:rela.Off+8], uint64(rela.Addend)) + case R_AARCH64_ABS32: + if rela.Off+4 >= uint64(len(dst)) || rela.Addend < 0 { + continue + } + f.ByteOrder.PutUint32(dst[rela.Off:rela.Off+4], uint32(rela.Addend)) + } + } + + return nil +} + +func (f *File) applyRelocationsPPC(dst []byte, rels []byte) error { + // 12 is the size of Rela32. + if len(rels)%12 != 0 { + return errors.New("length of relocation section is not a multiple of 12") + } + + symbols, _, err := f.getSymbols(SHT_SYMTAB) + if err != nil { + return err + } + + b := bytes.NewReader(rels) + var rela Rela32 + + for b.Len() > 0 { + binary.Read(b, f.ByteOrder, &rela) + symNo := rela.Info >> 8 + t := R_PPC(rela.Info & 0xff) + + if symNo == 0 || symNo > uint32(len(symbols)) { + continue + } + sym := &symbols[symNo-1] + if SymType(sym.Info&0xf) != STT_SECTION { + // We don't handle non-section relocations for now. + continue + } + + switch t { + case R_PPC_ADDR32: + if rela.Off+4 >= uint32(len(dst)) || rela.Addend < 0 { + continue + } + f.ByteOrder.PutUint32(dst[rela.Off:rela.Off+4], uint32(rela.Addend)) + } + } + + return nil +} + +func (f *File) applyRelocationsPPC64(dst []byte, rels []byte) error { + // 24 is the size of Rela64. + if len(rels)%24 != 0 { + return errors.New("length of relocation section is not a multiple of 24") + } + + symbols, _, err := f.getSymbols(SHT_SYMTAB) + if err != nil { + return err + } + + b := bytes.NewReader(rels) + var rela Rela64 + + for b.Len() > 0 { + binary.Read(b, f.ByteOrder, &rela) + symNo := rela.Info >> 32 + t := R_PPC64(rela.Info & 0xffff) + + if symNo == 0 || symNo > uint64(len(symbols)) { + continue + } + sym := &symbols[symNo-1] + if SymType(sym.Info&0xf) != STT_SECTION { + // We don't handle non-section relocations for now. + continue + } + + switch t { + case R_PPC64_ADDR64: + if rela.Off+8 >= uint64(len(dst)) || rela.Addend < 0 { + continue + } + f.ByteOrder.PutUint64(dst[rela.Off:rela.Off+8], uint64(rela.Addend)) + case R_PPC64_ADDR32: + if rela.Off+4 >= uint64(len(dst)) || rela.Addend < 0 { + continue + } + f.ByteOrder.PutUint32(dst[rela.Off:rela.Off+4], uint32(rela.Addend)) + } + } + + return nil +} + +func (f *File) DWARF() (*dwarf.Data, error) { + // sectionData gets the data for s, checks its size, and + // applies any applicable relations. + sectionData := func(i int, s *Section) ([]byte, error) { + b, err := s.Data() + if err != nil && uint64(len(b)) < s.Size { + return nil, err + } + + for _, r := range f.Sections { + if r.Type != SHT_RELA && r.Type != SHT_REL { + continue + } + if int(r.Info) != i { + continue + } + rd, err := r.Data() + if err != nil { + return nil, err + } + err = f.applyRelocations(b, rd) + if err != nil { + return nil, err + } + } + return b, nil + } + + // There are many other DWARF sections, but these + // are the ones the debug/dwarf package uses. + // Don't bother loading others. + var dat = map[string][]byte{"abbrev": nil, "info": nil, "str": nil, "line": nil} + for i, s := range f.Sections { + if !strings.HasPrefix(s.Name, ".debug_") { + continue + } + if _, ok := dat[s.Name[7:]]; !ok { + continue + } + b, err := sectionData(i, s) + if err != nil { + return nil, err + } + dat[s.Name[7:]] = b + } + + d, err := dwarf.New(dat["abbrev"], nil, nil, dat["info"], dat["line"], nil, nil, dat["str"]) + if err != nil { + return nil, err + } + + // Look for DWARF4 .debug_types sections. + for i, s := range f.Sections { + if s.Name == ".debug_types" { + b, err := sectionData(i, s) + if err != nil { + return nil, err + } + + err = d.AddTypes(fmt.Sprintf("types-%d", i), b) + if err != nil { + return nil, err + } + } + } + + return d, nil +} + +// Symbols returns the symbol table for f. The symbols will be listed in the order +// they appear in f. +// +// For compatibility with Go 1.0, Symbols omits the null symbol at index 0. +// After retrieving the symbols as symtab, an externally supplied index x +// corresponds to symtab[x-1], not symtab[x]. +func (f *File) Symbols() ([]Symbol, error) { + sym, _, err := f.getSymbols(SHT_SYMTAB) + return sym, err +} + +// DynamicSymbols returns the dynamic symbol table for f. The symbols +// will be listed in the order they appear in f. +// +// For compatibility with Symbols, DynamicSymbols omits the null symbol at index 0. +// After retrieving the symbols as symtab, an externally supplied index x +// corresponds to symtab[x-1], not symtab[x]. +func (f *File) DynamicSymbols() ([]Symbol, error) { + sym, _, err := f.getSymbols(SHT_DYNSYM) + return sym, err +} + +type ImportedSymbol struct { + Name string + Version string + Library string +} + +// ImportedSymbols returns the names of all symbols +// referred to by the binary f that are expected to be +// satisfied by other libraries at dynamic load time. +// It does not return weak symbols. +func (f *File) ImportedSymbols() ([]ImportedSymbol, error) { + sym, str, err := f.getSymbols(SHT_DYNSYM) + if err != nil { + return nil, err + } + f.gnuVersionInit(str) + var all []ImportedSymbol + for i, s := range sym { + if ST_BIND(s.Info) == STB_GLOBAL && s.Section == SHN_UNDEF { + all = append(all, ImportedSymbol{Name: s.Name}) + f.gnuVersion(i, &all[len(all)-1]) + } + } + return all, nil +} + +type verneed struct { + File string + Name string +} + +// gnuVersionInit parses the GNU version tables +// for use by calls to gnuVersion. +func (f *File) gnuVersionInit(str []byte) { + // Accumulate verneed information. + vn := f.SectionByType(SHT_GNU_VERNEED) + if vn == nil { + return + } + d, _ := vn.Data() + + var need []verneed + i := 0 + for { + if i+16 > len(d) { + break + } + vers := f.ByteOrder.Uint16(d[i : i+2]) + if vers != 1 { + break + } + cnt := f.ByteOrder.Uint16(d[i+2 : i+4]) + fileoff := f.ByteOrder.Uint32(d[i+4 : i+8]) + aux := f.ByteOrder.Uint32(d[i+8 : i+12]) + next := f.ByteOrder.Uint32(d[i+12 : i+16]) + file, _ := getString(str, int(fileoff)) + + var name string + j := i + int(aux) + for c := 0; c < int(cnt); c++ { + if j+16 > len(d) { + break + } + // hash := f.ByteOrder.Uint32(d[j:j+4]) + // flags := f.ByteOrder.Uint16(d[j+4:j+6]) + other := f.ByteOrder.Uint16(d[j+6 : j+8]) + nameoff := f.ByteOrder.Uint32(d[j+8 : j+12]) + next := f.ByteOrder.Uint32(d[j+12 : j+16]) + name, _ = getString(str, int(nameoff)) + ndx := int(other) + if ndx >= len(need) { + a := make([]verneed, 2*(ndx+1)) + copy(a, need) + need = a + } + + need[ndx] = verneed{file, name} + if next == 0 { + break + } + j += int(next) + } + + if next == 0 { + break + } + i += int(next) + } + + // Versym parallels symbol table, indexing into verneed. + vs := f.SectionByType(SHT_GNU_VERSYM) + if vs == nil { + return + } + d, _ = vs.Data() + + f.gnuNeed = need + f.gnuVersym = d +} + +// gnuVersion adds Library and Version information to sym, +// which came from offset i of the symbol table. +func (f *File) gnuVersion(i int, sym *ImportedSymbol) { + // Each entry is two bytes. + i = (i + 1) * 2 + if i >= len(f.gnuVersym) { + return + } + j := int(f.ByteOrder.Uint16(f.gnuVersym[i:])) + if j < 2 || j >= len(f.gnuNeed) { + return + } + n := &f.gnuNeed[j] + sym.Library = n.File + sym.Version = n.Name +} + +// ImportedLibraries returns the names of all libraries +// referred to by the binary f that are expected to be +// linked with the binary at dynamic link time. +func (f *File) ImportedLibraries() ([]string, error) { + return f.DynString(DT_NEEDED) +} + +// DynString returns the strings listed for the given tag in the file's dynamic +// section. +// +// The tag must be one that takes string values: DT_NEEDED, DT_SONAME, DT_RPATH, or +// DT_RUNPATH. +func (f *File) DynString(tag DynTag) ([]string, error) { + switch tag { + case DT_NEEDED, DT_SONAME, DT_RPATH, DT_RUNPATH: + default: + return nil, fmt.Errorf("non-string-valued tag %v", tag) + } + ds := f.SectionByType(SHT_DYNAMIC) + if ds == nil { + // not dynamic, so no libraries + return nil, nil + } + d, err := ds.Data() + if err != nil { + return nil, err + } + str, err := f.stringTable(ds.Link) + if err != nil { + return nil, err + } + var all []string + for len(d) > 0 { + var t DynTag + var v uint64 + switch f.Class { + case ELFCLASS32: + t = DynTag(f.ByteOrder.Uint32(d[0:4])) + v = uint64(f.ByteOrder.Uint32(d[4:8])) + d = d[8:] + case ELFCLASS64: + t = DynTag(f.ByteOrder.Uint64(d[0:8])) + v = f.ByteOrder.Uint64(d[8:16]) + d = d[16:] + } + if t == tag { + s, ok := getString(str, int(v)) + if ok { + all = append(all, s) + } + } + } + return all, nil +} diff --git a/src/debug/elf/file_test.go b/src/debug/elf/file_test.go new file mode 100644 index 0000000000000000000000000000000000000000..1ad43146ac8b31858504d0c10e83d6d545b2437d --- /dev/null +++ b/src/debug/elf/file_test.go @@ -0,0 +1,369 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package elf + +import ( + "bytes" + "compress/gzip" + "debug/dwarf" + "encoding/binary" + "io" + "net" + "os" + "path" + "reflect" + "runtime" + "testing" +) + +type fileTest struct { + file string + hdr FileHeader + sections []SectionHeader + progs []ProgHeader + needed []string +} + +var fileTests = []fileTest{ + { + "testdata/gcc-386-freebsd-exec", + FileHeader{ELFCLASS32, ELFDATA2LSB, EV_CURRENT, ELFOSABI_FREEBSD, 0, binary.LittleEndian, ET_EXEC, EM_386, 0x80483cc}, + []SectionHeader{ + {"", SHT_NULL, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, + {".interp", SHT_PROGBITS, SHF_ALLOC, 0x80480d4, 0xd4, 0x15, 0x0, 0x0, 0x1, 0x0}, + {".hash", SHT_HASH, SHF_ALLOC, 0x80480ec, 0xec, 0x90, 0x3, 0x0, 0x4, 0x4}, + {".dynsym", SHT_DYNSYM, SHF_ALLOC, 0x804817c, 0x17c, 0x110, 0x4, 0x1, 0x4, 0x10}, + {".dynstr", SHT_STRTAB, SHF_ALLOC, 0x804828c, 0x28c, 0xbb, 0x0, 0x0, 0x1, 0x0}, + {".rel.plt", SHT_REL, SHF_ALLOC, 0x8048348, 0x348, 0x20, 0x3, 0x7, 0x4, 0x8}, + {".init", SHT_PROGBITS, SHF_ALLOC + SHF_EXECINSTR, 0x8048368, 0x368, 0x11, 0x0, 0x0, 0x4, 0x0}, + {".plt", SHT_PROGBITS, SHF_ALLOC + SHF_EXECINSTR, 0x804837c, 0x37c, 0x50, 0x0, 0x0, 0x4, 0x4}, + {".text", SHT_PROGBITS, SHF_ALLOC + SHF_EXECINSTR, 0x80483cc, 0x3cc, 0x180, 0x0, 0x0, 0x4, 0x0}, + {".fini", SHT_PROGBITS, SHF_ALLOC + SHF_EXECINSTR, 0x804854c, 0x54c, 0xc, 0x0, 0x0, 0x4, 0x0}, + {".rodata", SHT_PROGBITS, SHF_ALLOC, 0x8048558, 0x558, 0xa3, 0x0, 0x0, 0x1, 0x0}, + {".data", SHT_PROGBITS, SHF_WRITE + SHF_ALLOC, 0x80495fc, 0x5fc, 0xc, 0x0, 0x0, 0x4, 0x0}, + {".eh_frame", SHT_PROGBITS, SHF_ALLOC, 0x8049608, 0x608, 0x4, 0x0, 0x0, 0x4, 0x0}, + {".dynamic", SHT_DYNAMIC, SHF_WRITE + SHF_ALLOC, 0x804960c, 0x60c, 0x98, 0x4, 0x0, 0x4, 0x8}, + {".ctors", SHT_PROGBITS, SHF_WRITE + SHF_ALLOC, 0x80496a4, 0x6a4, 0x8, 0x0, 0x0, 0x4, 0x0}, + {".dtors", SHT_PROGBITS, SHF_WRITE + SHF_ALLOC, 0x80496ac, 0x6ac, 0x8, 0x0, 0x0, 0x4, 0x0}, + {".jcr", SHT_PROGBITS, SHF_WRITE + SHF_ALLOC, 0x80496b4, 0x6b4, 0x4, 0x0, 0x0, 0x4, 0x0}, + {".got", SHT_PROGBITS, SHF_WRITE + SHF_ALLOC, 0x80496b8, 0x6b8, 0x1c, 0x0, 0x0, 0x4, 0x4}, + {".bss", SHT_NOBITS, SHF_WRITE + SHF_ALLOC, 0x80496d4, 0x6d4, 0x20, 0x0, 0x0, 0x4, 0x0}, + {".comment", SHT_PROGBITS, 0x0, 0x0, 0x6d4, 0x12d, 0x0, 0x0, 0x1, 0x0}, + {".debug_aranges", SHT_PROGBITS, 0x0, 0x0, 0x801, 0x20, 0x0, 0x0, 0x1, 0x0}, + {".debug_pubnames", SHT_PROGBITS, 0x0, 0x0, 0x821, 0x1b, 0x0, 0x0, 0x1, 0x0}, + {".debug_info", SHT_PROGBITS, 0x0, 0x0, 0x83c, 0x11d, 0x0, 0x0, 0x1, 0x0}, + {".debug_abbrev", SHT_PROGBITS, 0x0, 0x0, 0x959, 0x41, 0x0, 0x0, 0x1, 0x0}, + {".debug_line", SHT_PROGBITS, 0x0, 0x0, 0x99a, 0x35, 0x0, 0x0, 0x1, 0x0}, + {".debug_frame", SHT_PROGBITS, 0x0, 0x0, 0x9d0, 0x30, 0x0, 0x0, 0x4, 0x0}, + {".debug_str", SHT_PROGBITS, 0x0, 0x0, 0xa00, 0xd, 0x0, 0x0, 0x1, 0x0}, + {".shstrtab", SHT_STRTAB, 0x0, 0x0, 0xa0d, 0xf8, 0x0, 0x0, 0x1, 0x0}, + {".symtab", SHT_SYMTAB, 0x0, 0x0, 0xfb8, 0x4b0, 0x1d, 0x38, 0x4, 0x10}, + {".strtab", SHT_STRTAB, 0x0, 0x0, 0x1468, 0x206, 0x0, 0x0, 0x1, 0x0}, + }, + []ProgHeader{ + {PT_PHDR, PF_R + PF_X, 0x34, 0x8048034, 0x8048034, 0xa0, 0xa0, 0x4}, + {PT_INTERP, PF_R, 0xd4, 0x80480d4, 0x80480d4, 0x15, 0x15, 0x1}, + {PT_LOAD, PF_R + PF_X, 0x0, 0x8048000, 0x8048000, 0x5fb, 0x5fb, 0x1000}, + {PT_LOAD, PF_R + PF_W, 0x5fc, 0x80495fc, 0x80495fc, 0xd8, 0xf8, 0x1000}, + {PT_DYNAMIC, PF_R + PF_W, 0x60c, 0x804960c, 0x804960c, 0x98, 0x98, 0x4}, + }, + []string{"libc.so.6"}, + }, + { + "testdata/gcc-amd64-linux-exec", + FileHeader{ELFCLASS64, ELFDATA2LSB, EV_CURRENT, ELFOSABI_NONE, 0, binary.LittleEndian, ET_EXEC, EM_X86_64, 0x4003e0}, + []SectionHeader{ + {"", SHT_NULL, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, + {".interp", SHT_PROGBITS, SHF_ALLOC, 0x400200, 0x200, 0x1c, 0x0, 0x0, 0x1, 0x0}, + {".note.ABI-tag", SHT_NOTE, SHF_ALLOC, 0x40021c, 0x21c, 0x20, 0x0, 0x0, 0x4, 0x0}, + {".hash", SHT_HASH, SHF_ALLOC, 0x400240, 0x240, 0x24, 0x5, 0x0, 0x8, 0x4}, + {".gnu.hash", SHT_LOOS + 268435446, SHF_ALLOC, 0x400268, 0x268, 0x1c, 0x5, 0x0, 0x8, 0x0}, + {".dynsym", SHT_DYNSYM, SHF_ALLOC, 0x400288, 0x288, 0x60, 0x6, 0x1, 0x8, 0x18}, + {".dynstr", SHT_STRTAB, SHF_ALLOC, 0x4002e8, 0x2e8, 0x3d, 0x0, 0x0, 0x1, 0x0}, + {".gnu.version", SHT_HIOS, SHF_ALLOC, 0x400326, 0x326, 0x8, 0x5, 0x0, 0x2, 0x2}, + {".gnu.version_r", SHT_LOOS + 268435454, SHF_ALLOC, 0x400330, 0x330, 0x20, 0x6, 0x1, 0x8, 0x0}, + {".rela.dyn", SHT_RELA, SHF_ALLOC, 0x400350, 0x350, 0x18, 0x5, 0x0, 0x8, 0x18}, + {".rela.plt", SHT_RELA, SHF_ALLOC, 0x400368, 0x368, 0x30, 0x5, 0xc, 0x8, 0x18}, + {".init", SHT_PROGBITS, SHF_ALLOC + SHF_EXECINSTR, 0x400398, 0x398, 0x18, 0x0, 0x0, 0x4, 0x0}, + {".plt", SHT_PROGBITS, SHF_ALLOC + SHF_EXECINSTR, 0x4003b0, 0x3b0, 0x30, 0x0, 0x0, 0x4, 0x10}, + {".text", SHT_PROGBITS, SHF_ALLOC + SHF_EXECINSTR, 0x4003e0, 0x3e0, 0x1b4, 0x0, 0x0, 0x10, 0x0}, + {".fini", SHT_PROGBITS, SHF_ALLOC + SHF_EXECINSTR, 0x400594, 0x594, 0xe, 0x0, 0x0, 0x4, 0x0}, + {".rodata", SHT_PROGBITS, SHF_ALLOC, 0x4005a4, 0x5a4, 0x11, 0x0, 0x0, 0x4, 0x0}, + {".eh_frame_hdr", SHT_PROGBITS, SHF_ALLOC, 0x4005b8, 0x5b8, 0x24, 0x0, 0x0, 0x4, 0x0}, + {".eh_frame", SHT_PROGBITS, SHF_ALLOC, 0x4005e0, 0x5e0, 0xa4, 0x0, 0x0, 0x8, 0x0}, + {".ctors", SHT_PROGBITS, SHF_WRITE + SHF_ALLOC, 0x600688, 0x688, 0x10, 0x0, 0x0, 0x8, 0x0}, + {".dtors", SHT_PROGBITS, SHF_WRITE + SHF_ALLOC, 0x600698, 0x698, 0x10, 0x0, 0x0, 0x8, 0x0}, + {".jcr", SHT_PROGBITS, SHF_WRITE + SHF_ALLOC, 0x6006a8, 0x6a8, 0x8, 0x0, 0x0, 0x8, 0x0}, + {".dynamic", SHT_DYNAMIC, SHF_WRITE + SHF_ALLOC, 0x6006b0, 0x6b0, 0x1a0, 0x6, 0x0, 0x8, 0x10}, + {".got", SHT_PROGBITS, SHF_WRITE + SHF_ALLOC, 0x600850, 0x850, 0x8, 0x0, 0x0, 0x8, 0x8}, + {".got.plt", SHT_PROGBITS, SHF_WRITE + SHF_ALLOC, 0x600858, 0x858, 0x28, 0x0, 0x0, 0x8, 0x8}, + {".data", SHT_PROGBITS, SHF_WRITE + SHF_ALLOC, 0x600880, 0x880, 0x18, 0x0, 0x0, 0x8, 0x0}, + {".bss", SHT_NOBITS, SHF_WRITE + SHF_ALLOC, 0x600898, 0x898, 0x8, 0x0, 0x0, 0x4, 0x0}, + {".comment", SHT_PROGBITS, 0x0, 0x0, 0x898, 0x126, 0x0, 0x0, 0x1, 0x0}, + {".debug_aranges", SHT_PROGBITS, 0x0, 0x0, 0x9c0, 0x90, 0x0, 0x0, 0x10, 0x0}, + {".debug_pubnames", SHT_PROGBITS, 0x0, 0x0, 0xa50, 0x25, 0x0, 0x0, 0x1, 0x0}, + {".debug_info", SHT_PROGBITS, 0x0, 0x0, 0xa75, 0x1a7, 0x0, 0x0, 0x1, 0x0}, + {".debug_abbrev", SHT_PROGBITS, 0x0, 0x0, 0xc1c, 0x6f, 0x0, 0x0, 0x1, 0x0}, + {".debug_line", SHT_PROGBITS, 0x0, 0x0, 0xc8b, 0x13f, 0x0, 0x0, 0x1, 0x0}, + {".debug_str", SHT_PROGBITS, SHF_MERGE + SHF_STRINGS, 0x0, 0xdca, 0xb1, 0x0, 0x0, 0x1, 0x1}, + {".debug_ranges", SHT_PROGBITS, 0x0, 0x0, 0xe80, 0x90, 0x0, 0x0, 0x10, 0x0}, + {".shstrtab", SHT_STRTAB, 0x0, 0x0, 0xf10, 0x149, 0x0, 0x0, 0x1, 0x0}, + {".symtab", SHT_SYMTAB, 0x0, 0x0, 0x19a0, 0x6f0, 0x24, 0x39, 0x8, 0x18}, + {".strtab", SHT_STRTAB, 0x0, 0x0, 0x2090, 0x1fc, 0x0, 0x0, 0x1, 0x0}, + }, + []ProgHeader{ + {PT_PHDR, PF_R + PF_X, 0x40, 0x400040, 0x400040, 0x1c0, 0x1c0, 0x8}, + {PT_INTERP, PF_R, 0x200, 0x400200, 0x400200, 0x1c, 0x1c, 1}, + {PT_LOAD, PF_R + PF_X, 0x0, 0x400000, 0x400000, 0x684, 0x684, 0x200000}, + {PT_LOAD, PF_R + PF_W, 0x688, 0x600688, 0x600688, 0x210, 0x218, 0x200000}, + {PT_DYNAMIC, PF_R + PF_W, 0x6b0, 0x6006b0, 0x6006b0, 0x1a0, 0x1a0, 0x8}, + {PT_NOTE, PF_R, 0x21c, 0x40021c, 0x40021c, 0x20, 0x20, 0x4}, + {PT_LOOS + 0x474E550, PF_R, 0x5b8, 0x4005b8, 0x4005b8, 0x24, 0x24, 0x4}, + {PT_LOOS + 0x474E551, PF_R + PF_W, 0x0, 0x0, 0x0, 0x0, 0x0, 0x8}, + }, + []string{"libc.so.6"}, + }, + { + "testdata/hello-world-core.gz", + FileHeader{ELFCLASS64, ELFDATA2LSB, EV_CURRENT, ELFOSABI_NONE, 0x0, binary.LittleEndian, ET_CORE, EM_X86_64, 0x0}, + []SectionHeader{}, + []ProgHeader{ + {Type: PT_NOTE, Flags: 0x0, Off: 0x3f8, Vaddr: 0x0, Paddr: 0x0, Filesz: 0x8ac, Memsz: 0x0, Align: 0x0}, + {Type: PT_LOAD, Flags: PF_X + PF_R, Off: 0x1000, Vaddr: 0x400000, Paddr: 0x0, Filesz: 0x0, Memsz: 0x1000, Align: 0x1000}, + {Type: PT_LOAD, Flags: PF_R, Off: 0x1000, Vaddr: 0x401000, Paddr: 0x0, Filesz: 0x1000, Memsz: 0x1000, Align: 0x1000}, + {Type: PT_LOAD, Flags: PF_W + PF_R, Off: 0x2000, Vaddr: 0x402000, Paddr: 0x0, Filesz: 0x1000, Memsz: 0x1000, Align: 0x1000}, + {Type: PT_LOAD, Flags: PF_X + PF_R, Off: 0x3000, Vaddr: 0x7f54078b8000, Paddr: 0x0, Filesz: 0x0, Memsz: 0x1b5000, Align: 0x1000}, + {Type: PT_LOAD, Flags: 0x0, Off: 0x3000, Vaddr: 0x7f5407a6d000, Paddr: 0x0, Filesz: 0x0, Memsz: 0x1ff000, Align: 0x1000}, + {Type: PT_LOAD, Flags: PF_R, Off: 0x3000, Vaddr: 0x7f5407c6c000, Paddr: 0x0, Filesz: 0x4000, Memsz: 0x4000, Align: 0x1000}, + {Type: PT_LOAD, Flags: PF_W + PF_R, Off: 0x7000, Vaddr: 0x7f5407c70000, Paddr: 0x0, Filesz: 0x2000, Memsz: 0x2000, Align: 0x1000}, + {Type: PT_LOAD, Flags: PF_W + PF_R, Off: 0x9000, Vaddr: 0x7f5407c72000, Paddr: 0x0, Filesz: 0x5000, Memsz: 0x5000, Align: 0x1000}, + {Type: PT_LOAD, Flags: PF_X + PF_R, Off: 0xe000, Vaddr: 0x7f5407c77000, Paddr: 0x0, Filesz: 0x0, Memsz: 0x22000, Align: 0x1000}, + {Type: PT_LOAD, Flags: PF_W + PF_R, Off: 0xe000, Vaddr: 0x7f5407e81000, Paddr: 0x0, Filesz: 0x3000, Memsz: 0x3000, Align: 0x1000}, + {Type: PT_LOAD, Flags: PF_W + PF_R, Off: 0x11000, Vaddr: 0x7f5407e96000, Paddr: 0x0, Filesz: 0x3000, Memsz: 0x3000, Align: 0x1000}, + {Type: PT_LOAD, Flags: PF_R, Off: 0x14000, Vaddr: 0x7f5407e99000, Paddr: 0x0, Filesz: 0x1000, Memsz: 0x1000, Align: 0x1000}, + {Type: PT_LOAD, Flags: PF_W + PF_R, Off: 0x15000, Vaddr: 0x7f5407e9a000, Paddr: 0x0, Filesz: 0x2000, Memsz: 0x2000, Align: 0x1000}, + {Type: PT_LOAD, Flags: PF_W + PF_R, Off: 0x17000, Vaddr: 0x7fff79972000, Paddr: 0x0, Filesz: 0x23000, Memsz: 0x23000, Align: 0x1000}, + {Type: PT_LOAD, Flags: PF_X + PF_R, Off: 0x3a000, Vaddr: 0x7fff799f8000, Paddr: 0x0, Filesz: 0x1000, Memsz: 0x1000, Align: 0x1000}, + {Type: PT_LOAD, Flags: PF_X + PF_R, Off: 0x3b000, Vaddr: 0xffffffffff600000, Paddr: 0x0, Filesz: 0x1000, Memsz: 0x1000, Align: 0x1000}, + }, + nil, + }, +} + +func TestOpen(t *testing.T) { + for i := range fileTests { + tt := &fileTests[i] + + var f *File + var err error + if path.Ext(tt.file) == ".gz" { + var r io.ReaderAt + if r, err = decompress(tt.file); err == nil { + f, err = NewFile(r) + } + } else { + f, err = Open(tt.file) + } + if err != nil { + t.Errorf("cannot open file %s: %v", tt.file, err) + continue + } + defer f.Close() + if !reflect.DeepEqual(f.FileHeader, tt.hdr) { + t.Errorf("open %s:\n\thave %#v\n\twant %#v\n", tt.file, f.FileHeader, tt.hdr) + continue + } + for i, s := range f.Sections { + if i >= len(tt.sections) { + break + } + sh := &tt.sections[i] + if !reflect.DeepEqual(&s.SectionHeader, sh) { + t.Errorf("open %s, section %d:\n\thave %#v\n\twant %#v\n", tt.file, i, &s.SectionHeader, sh) + } + } + for i, p := range f.Progs { + if i >= len(tt.progs) { + break + } + ph := &tt.progs[i] + if !reflect.DeepEqual(&p.ProgHeader, ph) { + t.Errorf("open %s, program %d:\n\thave %#v\n\twant %#v\n", tt.file, i, &p.ProgHeader, ph) + } + } + tn := len(tt.sections) + fn := len(f.Sections) + if tn != fn { + t.Errorf("open %s: len(Sections) = %d, want %d", tt.file, fn, tn) + } + tn = len(tt.progs) + fn = len(f.Progs) + if tn != fn { + t.Errorf("open %s: len(Progs) = %d, want %d", tt.file, fn, tn) + } + tl := tt.needed + fl, err := f.ImportedLibraries() + if err != nil { + t.Error(err) + } + if !reflect.DeepEqual(tl, fl) { + t.Errorf("open %s: DT_NEEDED = %v, want %v", tt.file, tl, fl) + } + } +} + +// elf.NewFile requires io.ReaderAt, which compress/gzip cannot +// provide. Decompress the file to a bytes.Reader. +func decompress(gz string) (io.ReaderAt, error) { + in, err := os.Open(gz) + if err != nil { + return nil, err + } + defer in.Close() + r, err := gzip.NewReader(in) + if err != nil { + return nil, err + } + var out bytes.Buffer + _, err = io.Copy(&out, r) + return bytes.NewReader(out.Bytes()), err +} + +type relocationTestEntry struct { + entryNumber int + entry *dwarf.Entry +} + +type relocationTest struct { + file string + entries []relocationTestEntry +} + +var relocationTests = []relocationTest{ + { + "testdata/go-relocation-test-gcc441-x86-64.obj", + []relocationTestEntry{ + {0, &dwarf.Entry{Offset: 0xb, Tag: dwarf.TagCompileUnit, Children: true, Field: []dwarf.Field{{Attr: dwarf.AttrProducer, Val: "GNU C 4.4.1", Class: dwarf.ClassString}, {Attr: dwarf.AttrLanguage, Val: int64(1), Class: dwarf.ClassConstant}, {Attr: dwarf.AttrName, Val: "go-relocation-test.c", Class: dwarf.ClassString}, {Attr: dwarf.AttrCompDir, Val: "/tmp", Class: dwarf.ClassString}, {Attr: dwarf.AttrLowpc, Val: uint64(0x0), Class: dwarf.ClassAddress}, {Attr: dwarf.AttrHighpc, Val: uint64(0x6), Class: dwarf.ClassAddress}, {Attr: dwarf.AttrStmtList, Val: int64(0), Class: dwarf.ClassLinePtr}}}}, + }, + }, + { + "testdata/go-relocation-test-gcc441-x86.obj", + []relocationTestEntry{ + {0, &dwarf.Entry{Offset: 0xb, Tag: dwarf.TagCompileUnit, Children: true, Field: []dwarf.Field{{Attr: dwarf.AttrProducer, Val: "GNU C 4.4.1", Class: dwarf.ClassString}, {Attr: dwarf.AttrLanguage, Val: int64(1), Class: dwarf.ClassConstant}, {Attr: dwarf.AttrName, Val: "t.c", Class: dwarf.ClassString}, {Attr: dwarf.AttrCompDir, Val: "/tmp", Class: dwarf.ClassString}, {Attr: dwarf.AttrLowpc, Val: uint64(0x0), Class: dwarf.ClassAddress}, {Attr: dwarf.AttrHighpc, Val: uint64(0x5), Class: dwarf.ClassAddress}, {Attr: dwarf.AttrStmtList, Val: int64(0), Class: dwarf.ClassLinePtr}}}}, + }, + }, + { + "testdata/go-relocation-test-gcc424-x86-64.obj", + []relocationTestEntry{ + {0, &dwarf.Entry{Offset: 0xb, Tag: dwarf.TagCompileUnit, Children: true, Field: []dwarf.Field{{Attr: dwarf.AttrProducer, Val: "GNU C 4.2.4 (Ubuntu 4.2.4-1ubuntu4)", Class: dwarf.ClassString}, {Attr: dwarf.AttrLanguage, Val: int64(1), Class: dwarf.ClassConstant}, {Attr: dwarf.AttrName, Val: "go-relocation-test-gcc424.c", Class: dwarf.ClassString}, {Attr: dwarf.AttrCompDir, Val: "/tmp", Class: dwarf.ClassString}, {Attr: dwarf.AttrLowpc, Val: uint64(0x0), Class: dwarf.ClassAddress}, {Attr: dwarf.AttrHighpc, Val: uint64(0x6), Class: dwarf.ClassAddress}, {Attr: dwarf.AttrStmtList, Val: int64(0), Class: dwarf.ClassLinePtr}}}}, + }, + }, + { + "testdata/go-relocation-test-gcc482-aarch64.obj", + []relocationTestEntry{ + {0, &dwarf.Entry{Offset: 0xb, Tag: dwarf.TagCompileUnit, Children: true, Field: []dwarf.Field{{Attr: dwarf.AttrProducer, Val: "GNU C 4.8.2 -g -fstack-protector", Class: dwarf.ClassString}, {Attr: dwarf.AttrLanguage, Val: int64(1), Class: dwarf.ClassConstant}, {Attr: dwarf.AttrName, Val: "go-relocation-test-gcc482.c", Class: dwarf.ClassString}, {Attr: dwarf.AttrCompDir, Val: "/tmp", Class: dwarf.ClassString}, {Attr: dwarf.AttrLowpc, Val: uint64(0x0), Class: dwarf.ClassAddress}, {Attr: dwarf.AttrHighpc, Val: int64(0x24), Class: dwarf.ClassConstant}, {Attr: dwarf.AttrStmtList, Val: int64(0), Class: dwarf.ClassLinePtr}}}}, + }, + }, + { + "testdata/go-relocation-test-gcc492-arm.obj", + []relocationTestEntry{ + {0, &dwarf.Entry{Offset: 0xb, Tag: dwarf.TagCompileUnit, Children: true, Field: []dwarf.Field{{Attr: dwarf.AttrProducer, Val: "GNU C 4.9.2 20141224 (prerelease) -march=armv7-a -mfloat-abi=hard -mfpu=vfpv3-d16 -mtls-dialect=gnu -g", Class: dwarf.ClassString}, {Attr: dwarf.AttrLanguage, Val: int64(1), Class: dwarf.ClassConstant}, {Attr: dwarf.AttrName, Val: "go-relocation-test-gcc492.c", Class: dwarf.ClassString}, {Attr: dwarf.AttrCompDir, Val: "/root/go/src/debug/elf/testdata", Class: dwarf.ClassString}, {Attr: dwarf.AttrLowpc, Val: uint64(0x0), Class: dwarf.ClassAddress}, {Attr: dwarf.AttrHighpc, Val: int64(0x28), Class: dwarf.ClassConstant}, {Attr: dwarf.AttrStmtList, Val: int64(0), Class: dwarf.ClassLinePtr}}}}, + }, + }, + { + "testdata/go-relocation-test-clang-arm.obj", + []relocationTestEntry{ + {0, &dwarf.Entry{Offset: 0xb, Tag: dwarf.TagCompileUnit, Children: true, Field: []dwarf.Field{dwarf.Field{Attr: dwarf.AttrProducer, Val: "Debian clang version 3.5.0-10 (tags/RELEASE_350/final) (based on LLVM 3.5.0)", Class: dwarf.ClassString}, dwarf.Field{Attr: dwarf.AttrLanguage, Val: int64(12), Class: dwarf.ClassConstant}, dwarf.Field{Attr: dwarf.AttrName, Val: "hello.c", Class: dwarf.ClassString}, dwarf.Field{Attr: dwarf.AttrStmtList, Val: int64(0x0), Class: dwarf.ClassLinePtr}, dwarf.Field{Attr: dwarf.AttrCompDir, Val: "/tmp", Class: dwarf.ClassString}, dwarf.Field{Attr: dwarf.AttrLowpc, Val: uint64(0x0), Class: dwarf.ClassAddress}, dwarf.Field{Attr: dwarf.AttrHighpc, Val: int64(48), Class: dwarf.ClassConstant}}}}, + }, + }, + { + "testdata/go-relocation-test-gcc5-ppc.obj", + []relocationTestEntry{ + {0, &dwarf.Entry{Offset: 0xb, Tag: dwarf.TagCompileUnit, Children: true, Field: []dwarf.Field{dwarf.Field{Attr: dwarf.AttrProducer, Val: "GNU C11 5.0.0 20150116 (experimental) -Asystem=linux -Asystem=unix -Asystem=posix -g", Class: dwarf.ClassString}, dwarf.Field{Attr: dwarf.AttrLanguage, Val: int64(12), Class: dwarf.ClassConstant}, dwarf.Field{Attr: dwarf.AttrName, Val: "go-relocation-test-gcc5-ppc.c", Class: dwarf.ClassString}, dwarf.Field{Attr: dwarf.AttrCompDir, Val: "/tmp", Class: dwarf.ClassString}, dwarf.Field{Attr: dwarf.AttrLowpc, Val: uint64(0x0), Class: dwarf.ClassAddress}, dwarf.Field{Attr: dwarf.AttrHighpc, Val: int64(0x44), Class: dwarf.ClassConstant}, dwarf.Field{Attr: dwarf.AttrStmtList, Val: int64(0), Class: dwarf.ClassLinePtr}}}}, + }, + }, + { + "testdata/go-relocation-test-gcc482-ppc64le.obj", + []relocationTestEntry{ + {0, &dwarf.Entry{Offset: 0xb, Tag: dwarf.TagCompileUnit, Children: true, Field: []dwarf.Field{dwarf.Field{Attr: dwarf.AttrProducer, Val: "GNU C 4.8.2 -Asystem=linux -Asystem=unix -Asystem=posix -msecure-plt -mtune=power8 -mcpu=power7 -gdwarf-2 -fstack-protector", Class: dwarf.ClassString}, dwarf.Field{Attr: dwarf.AttrLanguage, Val: int64(1), Class: dwarf.ClassConstant}, dwarf.Field{Attr: dwarf.AttrName, Val: "go-relocation-test-gcc482-ppc64le.c", Class: dwarf.ClassString}, dwarf.Field{Attr: dwarf.AttrCompDir, Val: "/tmp", Class: dwarf.ClassString}, dwarf.Field{Attr: dwarf.AttrLowpc, Val: uint64(0x0), Class: dwarf.ClassAddress}, dwarf.Field{Attr: dwarf.AttrHighpc, Val: uint64(0x24), Class: dwarf.ClassAddress}, dwarf.Field{Attr: dwarf.AttrStmtList, Val: int64(0), Class: dwarf.ClassLinePtr}}}}, + }, + }, + { + "testdata/go-relocation-test-clang-x86.obj", + []relocationTestEntry{ + {0, &dwarf.Entry{Offset: 0xb, Tag: dwarf.TagCompileUnit, Children: true, Field: []dwarf.Field{{Attr: dwarf.AttrProducer, Val: "clang version google3-trunk (trunk r209387)", Class: dwarf.ClassString}, {Attr: dwarf.AttrLanguage, Val: int64(12), Class: dwarf.ClassConstant}, {Attr: dwarf.AttrName, Val: "go-relocation-test-clang.c", Class: dwarf.ClassString}, {Attr: dwarf.AttrStmtList, Val: int64(0), Class: dwarf.ClassLinePtr}, {Attr: dwarf.AttrCompDir, Val: "/tmp", Class: dwarf.ClassString}}}}, + }, + }, + { + "testdata/gcc-amd64-openbsd-debug-with-rela.obj", + []relocationTestEntry{ + {203, &dwarf.Entry{Offset: 0xc62, Tag: dwarf.TagMember, Children: false, Field: []dwarf.Field{{Attr: dwarf.AttrName, Val: "it_interval", Class: dwarf.ClassString}, {Attr: dwarf.AttrDeclFile, Val: int64(7), Class: dwarf.ClassConstant}, {Attr: dwarf.AttrDeclLine, Val: int64(236), Class: dwarf.ClassConstant}, {Attr: dwarf.AttrType, Val: dwarf.Offset(0xb7f), Class: dwarf.ClassReference}, {Attr: dwarf.AttrDataMemberLoc, Val: []byte{0x23, 0x0}, Class: dwarf.ClassExprLoc}}}}, + {204, &dwarf.Entry{Offset: 0xc70, Tag: dwarf.TagMember, Children: false, Field: []dwarf.Field{{Attr: dwarf.AttrName, Val: "it_value", Class: dwarf.ClassString}, {Attr: dwarf.AttrDeclFile, Val: int64(7), Class: dwarf.ClassConstant}, {Attr: dwarf.AttrDeclLine, Val: int64(237), Class: dwarf.ClassConstant}, {Attr: dwarf.AttrType, Val: dwarf.Offset(0xb7f), Class: dwarf.ClassReference}, {Attr: dwarf.AttrDataMemberLoc, Val: []byte{0x23, 0x10}, Class: dwarf.ClassExprLoc}}}}, + }, + }, +} + +func TestDWARFRelocations(t *testing.T) { + for i, test := range relocationTests { + f, err := Open(test.file) + if err != nil { + t.Error(err) + continue + } + dwarf, err := f.DWARF() + if err != nil { + t.Error(err) + continue + } + for _, testEntry := range test.entries { + reader := dwarf.Reader() + for j := 0; j < testEntry.entryNumber; j++ { + entry, err := reader.Next() + if entry == nil || err != nil { + t.Errorf("Failed to skip to entry %d: %v", testEntry.entryNumber, err) + continue + } + } + entry, err := reader.Next() + if err != nil { + t.Error(err) + continue + } + if !reflect.DeepEqual(testEntry.entry, entry) { + t.Errorf("#%d/%d: mismatch: got:%#v want:%#v", i, testEntry.entryNumber, entry, testEntry.entry) + continue + } + } + } +} + +func TestNoSectionOverlaps(t *testing.T) { + // Ensure 6l outputs sections without overlaps. + if runtime.GOOS != "linux" && runtime.GOOS != "freebsd" { + return // not ELF + } + _ = net.ResolveIPAddr // force dynamic linkage + f, err := Open(os.Args[0]) + if err != nil { + t.Error(err) + return + } + for i, si := range f.Sections { + sih := si.SectionHeader + if sih.Type == SHT_NOBITS { + continue + } + for j, sj := range f.Sections { + sjh := sj.SectionHeader + if i == j || sjh.Type == SHT_NOBITS || sih.Offset == sjh.Offset && sih.Size == 0 { + continue + } + if sih.Offset >= sjh.Offset && sih.Offset < sjh.Offset+sjh.Size { + t.Errorf("ld produced ELF with section %s within %s: 0x%x <= 0x%x..0x%x < 0x%x", + sih.Name, sjh.Name, sjh.Offset, sih.Offset, sih.Offset+sih.Size, sjh.Offset+sjh.Size) + } + } + } +} diff --git a/src/debug/elf/symbols_test.go b/src/debug/elf/symbols_test.go new file mode 100644 index 0000000000000000000000000000000000000000..1b79520e3ccb56c39bc61ebb3b8a575293a0498d --- /dev/null +++ b/src/debug/elf/symbols_test.go @@ -0,0 +1,834 @@ +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package elf + +import ( + "io" + "path" + "reflect" + "testing" +) + +// TODO: remove duplicate code +func TestSymbols(t *testing.T) { + do := func(file string, ts []Symbol, getfunc func(*File) ([]Symbol, error)) { + var f *File + var err error + if path.Ext(file) == ".gz" { + var r io.ReaderAt + if r, err = decompress(file); err == nil { + f, err = NewFile(r) + } + } else { + f, err = Open(file) + } + if err != nil { + t.Errorf("TestSymbols: cannot open file %s: %v", file, err) + return + } + defer f.Close() + fs, err := getfunc(f) + if err != nil && err != ErrNoSymbols { + t.Error(err) + return + } else if err == ErrNoSymbols { + fs = []Symbol{} + } + if !reflect.DeepEqual(ts, fs) { + t.Errorf("%s: Symbols = %v, want %v", file, ts, fs) + } + } + for file, ts := range symbolsGolden { + do(file, ts, (*File).Symbols) + } + for file, ts := range dynamicSymbolsGolden { + do(file, ts, (*File).DynamicSymbols) + } +} + +// golden symbol table data generated by testdata/getgoldsym.c + +var symbolsGolden = map[string][]Symbol{ + "testdata/gcc-amd64-linux-exec": { + Symbol{ + Name: "", + Info: 0x3, + Other: 0x0, + Section: 0x1, + Value: 0x400200, + Size: 0x0, + }, + Symbol{ + Name: "", + Info: 0x3, + Other: 0x0, + Section: 0x2, + Value: 0x40021C, + Size: 0x0, + }, + Symbol{ + Name: "", + Info: 0x3, + Other: 0x0, + Section: 0x3, + Value: 0x400240, + Size: 0x0, + }, + Symbol{ + Name: "", + Info: 0x3, + Other: 0x0, + Section: 0x4, + Value: 0x400268, + Size: 0x0, + }, + Symbol{ + Name: "", + Info: 0x3, + Other: 0x0, + Section: 0x5, + Value: 0x400288, + Size: 0x0, + }, + Symbol{ + Name: "", + Info: 0x3, + Other: 0x0, + Section: 0x6, + Value: 0x4002E8, + Size: 0x0, + }, + Symbol{ + Name: "", + Info: 0x3, + Other: 0x0, + Section: 0x7, + Value: 0x400326, + Size: 0x0, + }, + Symbol{ + Name: "", + Info: 0x3, + Other: 0x0, + Section: 0x8, + Value: 0x400330, + Size: 0x0, + }, + Symbol{ + Name: "", + Info: 0x3, + Other: 0x0, + Section: 0x9, + Value: 0x400350, + Size: 0x0, + }, + Symbol{ + Name: "", + Info: 0x3, + Other: 0x0, + Section: 0xA, + Value: 0x400368, + Size: 0x0, + }, + Symbol{ + Name: "", + Info: 0x3, + Other: 0x0, + Section: 0xB, + Value: 0x400398, + Size: 0x0, + }, + Symbol{ + Name: "", + Info: 0x3, + Other: 0x0, + Section: 0xC, + Value: 0x4003B0, + Size: 0x0, + }, + Symbol{ + Name: "", + Info: 0x3, + Other: 0x0, + Section: 0xD, + Value: 0x4003E0, + Size: 0x0, + }, + Symbol{ + Name: "", + Info: 0x3, + Other: 0x0, + Section: 0xE, + Value: 0x400594, + Size: 0x0, + }, + Symbol{ + Name: "", + Info: 0x3, + Other: 0x0, + Section: 0xF, + Value: 0x4005A4, + Size: 0x0, + }, + Symbol{ + Name: "", + Info: 0x3, + Other: 0x0, + Section: 0x10, + Value: 0x4005B8, + Size: 0x0, + }, + Symbol{ + Name: "", + Info: 0x3, + Other: 0x0, + Section: 0x11, + Value: 0x4005E0, + Size: 0x0, + }, + Symbol{ + Name: "", + Info: 0x3, + Other: 0x0, + Section: 0x12, + Value: 0x600688, + Size: 0x0, + }, + Symbol{ + Name: "", + Info: 0x3, + Other: 0x0, + Section: 0x13, + Value: 0x600698, + Size: 0x0, + }, + Symbol{ + Name: "", + Info: 0x3, + Other: 0x0, + Section: 0x14, + Value: 0x6006A8, + Size: 0x0, + }, + Symbol{ + Name: "", + Info: 0x3, + Other: 0x0, + Section: 0x15, + Value: 0x6006B0, + Size: 0x0, + }, + Symbol{ + Name: "", + Info: 0x3, + Other: 0x0, + Section: 0x16, + Value: 0x600850, + Size: 0x0, + }, + Symbol{ + Name: "", + Info: 0x3, + Other: 0x0, + Section: 0x17, + Value: 0x600858, + Size: 0x0, + }, + Symbol{ + Name: "", + Info: 0x3, + Other: 0x0, + Section: 0x18, + Value: 0x600880, + Size: 0x0, + }, + Symbol{ + Name: "", + Info: 0x3, + Other: 0x0, + Section: 0x19, + Value: 0x600898, + Size: 0x0, + }, + Symbol{ + Name: "", + Info: 0x3, + Other: 0x0, + Section: 0x1A, + Value: 0x0, + Size: 0x0, + }, + Symbol{ + Name: "", + Info: 0x3, + Other: 0x0, + Section: 0x1B, + Value: 0x0, + Size: 0x0, + }, + Symbol{ + Name: "", + Info: 0x3, + Other: 0x0, + Section: 0x1C, + Value: 0x0, + Size: 0x0, + }, + Symbol{ + Name: "", + Info: 0x3, + Other: 0x0, + Section: 0x1D, + Value: 0x0, + Size: 0x0, + }, + Symbol{ + Name: "", + Info: 0x3, + Other: 0x0, + Section: 0x1E, + Value: 0x0, + Size: 0x0, + }, + Symbol{ + Name: "", + Info: 0x3, + Other: 0x0, + Section: 0x1F, + Value: 0x0, + Size: 0x0, + }, + Symbol{ + Name: "", + Info: 0x3, + Other: 0x0, + Section: 0x20, + Value: 0x0, + Size: 0x0, + }, + Symbol{ + Name: "", + Info: 0x3, + Other: 0x0, + Section: 0x21, + Value: 0x0, + Size: 0x0, + }, + Symbol{ + Name: "init.c", + Info: 0x4, + Other: 0x0, + Section: 0xFFF1, + Value: 0x0, + Size: 0x0, + }, + Symbol{ + Name: "initfini.c", + Info: 0x4, + Other: 0x0, + Section: 0xFFF1, + Value: 0x0, + Size: 0x0, + }, + Symbol{ + Name: "call_gmon_start", + Info: 0x2, + Other: 0x0, + Section: 0xD, + Value: 0x40040C, + Size: 0x0, + }, + Symbol{ + Name: "crtstuff.c", + Info: 0x4, + Other: 0x0, + Section: 0xFFF1, + Value: 0x0, + Size: 0x0, + }, + Symbol{ + Name: "__CTOR_LIST__", + Info: 0x1, + Other: 0x0, + Section: 0x12, + Value: 0x600688, + Size: 0x0, + }, + Symbol{ + Name: "__DTOR_LIST__", + Info: 0x1, + Other: 0x0, + Section: 0x13, + Value: 0x600698, + Size: 0x0, + }, + Symbol{ + Name: "__JCR_LIST__", + Info: 0x1, + Other: 0x0, + Section: 0x14, + Value: 0x6006A8, + Size: 0x0, + }, + Symbol{ + Name: "__do_global_dtors_aux", + Info: 0x2, + Other: 0x0, + Section: 0xD, + Value: 0x400430, + Size: 0x0, + }, + Symbol{ + Name: "completed.6183", + Info: 0x1, + Other: 0x0, + Section: 0x19, + Value: 0x600898, + Size: 0x1, + }, + Symbol{ + Name: "p.6181", + Info: 0x1, + Other: 0x0, + Section: 0x18, + Value: 0x600890, + Size: 0x0, + }, + Symbol{ + Name: "frame_dummy", + Info: 0x2, + Other: 0x0, + Section: 0xD, + Value: 0x400470, + Size: 0x0, + }, + Symbol{ + Name: "crtstuff.c", + Info: 0x4, + Other: 0x0, + Section: 0xFFF1, + Value: 0x0, + Size: 0x0, + }, + Symbol{ + Name: "__CTOR_END__", + Info: 0x1, + Other: 0x0, + Section: 0x12, + Value: 0x600690, + Size: 0x0, + }, + Symbol{ + Name: "__DTOR_END__", + Info: 0x1, + Other: 0x0, + Section: 0x13, + Value: 0x6006A0, + Size: 0x0, + }, + Symbol{ + Name: "__FRAME_END__", + Info: 0x1, + Other: 0x0, + Section: 0x11, + Value: 0x400680, + Size: 0x0, + }, + Symbol{ + Name: "__JCR_END__", + Info: 0x1, + Other: 0x0, + Section: 0x14, + Value: 0x6006A8, + Size: 0x0, + }, + Symbol{ + Name: "__do_global_ctors_aux", + Info: 0x2, + Other: 0x0, + Section: 0xD, + Value: 0x400560, + Size: 0x0, + }, + Symbol{ + Name: "initfini.c", + Info: 0x4, + Other: 0x0, + Section: 0xFFF1, + Value: 0x0, + Size: 0x0, + }, + Symbol{ + Name: "hello.c", + Info: 0x4, + Other: 0x0, + Section: 0xFFF1, + Value: 0x0, + Size: 0x0, + }, + Symbol{ + Name: "_GLOBAL_OFFSET_TABLE_", + Info: 0x1, + Other: 0x2, + Section: 0x17, + Value: 0x600858, + Size: 0x0, + }, + Symbol{ + Name: "__init_array_end", + Info: 0x0, + Other: 0x2, + Section: 0x12, + Value: 0x600684, + Size: 0x0, + }, + Symbol{ + Name: "__init_array_start", + Info: 0x0, + Other: 0x2, + Section: 0x12, + Value: 0x600684, + Size: 0x0, + }, + Symbol{ + Name: "_DYNAMIC", + Info: 0x1, + Other: 0x2, + Section: 0x15, + Value: 0x6006B0, + Size: 0x0, + }, + Symbol{ + Name: "data_start", + Info: 0x20, + Other: 0x0, + Section: 0x18, + Value: 0x600880, + Size: 0x0, + }, + Symbol{ + Name: "__libc_csu_fini", + Info: 0x12, + Other: 0x0, + Section: 0xD, + Value: 0x4004C0, + Size: 0x2, + }, + Symbol{ + Name: "_start", + Info: 0x12, + Other: 0x0, + Section: 0xD, + Value: 0x4003E0, + Size: 0x0, + }, + Symbol{ + Name: "__gmon_start__", + Info: 0x20, + Other: 0x0, + Section: 0x0, + Value: 0x0, + Size: 0x0, + }, + Symbol{ + Name: "_Jv_RegisterClasses", + Info: 0x20, + Other: 0x0, + Section: 0x0, + Value: 0x0, + Size: 0x0, + }, + Symbol{ + Name: "puts@@GLIBC_2.2.5", + Info: 0x12, + Other: 0x0, + Section: 0x0, + Value: 0x0, + Size: 0x18C, + }, + Symbol{ + Name: "_fini", + Info: 0x12, + Other: 0x0, + Section: 0xE, + Value: 0x400594, + Size: 0x0, + }, + Symbol{ + Name: "__libc_start_main@@GLIBC_2.2.5", + Info: 0x12, + Other: 0x0, + Section: 0x0, + Value: 0x0, + Size: 0x1C2, + }, + Symbol{ + Name: "_IO_stdin_used", + Info: 0x11, + Other: 0x0, + Section: 0xF, + Value: 0x4005A4, + Size: 0x4, + }, + Symbol{ + Name: "__data_start", + Info: 0x10, + Other: 0x0, + Section: 0x18, + Value: 0x600880, + Size: 0x0, + }, + Symbol{ + Name: "__dso_handle", + Info: 0x11, + Other: 0x2, + Section: 0x18, + Value: 0x600888, + Size: 0x0, + }, + Symbol{ + Name: "__libc_csu_init", + Info: 0x12, + Other: 0x0, + Section: 0xD, + Value: 0x4004D0, + Size: 0x89, + }, + Symbol{ + Name: "__bss_start", + Info: 0x10, + Other: 0x0, + Section: 0xFFF1, + Value: 0x600898, + Size: 0x0, + }, + Symbol{ + Name: "_end", + Info: 0x10, + Other: 0x0, + Section: 0xFFF1, + Value: 0x6008A0, + Size: 0x0, + }, + Symbol{ + Name: "_edata", + Info: 0x10, + Other: 0x0, + Section: 0xFFF1, + Value: 0x600898, + Size: 0x0, + }, + Symbol{ + Name: "main", + Info: 0x12, + Other: 0x0, + Section: 0xD, + Value: 0x400498, + Size: 0x1B, + }, + Symbol{ + Name: "_init", + Info: 0x12, + Other: 0x0, + Section: 0xB, + Value: 0x400398, + Size: 0x0, + }, + }, + "testdata/go-relocation-test-clang-x86.obj": { + Symbol{ + Name: "go-relocation-test-clang.c", + Info: 0x4, + Other: 0x0, + Section: 0xFFF1, + Value: 0x0, + Size: 0x0, + }, + Symbol{ + Name: ".Linfo_string0", + Info: 0x0, + Other: 0x0, + Section: 0xC, + Value: 0x0, + Size: 0x0, + }, + Symbol{ + Name: ".Linfo_string1", + Info: 0x0, + Other: 0x0, + Section: 0xC, + Value: 0x2C, + Size: 0x0, + }, + Symbol{ + Name: ".Linfo_string2", + Info: 0x0, + Other: 0x0, + Section: 0xC, + Value: 0x47, + Size: 0x0, + }, + Symbol{ + Name: ".Linfo_string3", + Info: 0x0, + Other: 0x0, + Section: 0xC, + Value: 0x4C, + Size: 0x0, + }, + Symbol{ + Name: ".Linfo_string4", + Info: 0x0, + Other: 0x0, + Section: 0xC, + Value: 0x4E, + Size: 0x0, + }, + Symbol{ + Name: "", + Info: 0x3, + Other: 0x0, + Section: 0x1, + Value: 0x0, + Size: 0x0, + }, + Symbol{ + Name: "", + Info: 0x3, + Other: 0x0, + Section: 0x2, + Value: 0x0, + Size: 0x0, + }, + Symbol{ + Name: "", + Info: 0x3, + Other: 0x0, + Section: 0x3, + Value: 0x0, + Size: 0x0, + }, + Symbol{ + Name: "", + Info: 0x3, + Other: 0x0, + Section: 0x4, + Value: 0x0, + Size: 0x0, + }, + Symbol{ + Name: "", + Info: 0x3, + Other: 0x0, + Section: 0x6, + Value: 0x0, + Size: 0x0, + }, + Symbol{ + Name: "", + Info: 0x3, + Other: 0x0, + Section: 0x7, + Value: 0x0, + Size: 0x0, + }, + Symbol{ + Name: "", + Info: 0x3, + Other: 0x0, + Section: 0x8, + Value: 0x0, + Size: 0x0, + }, + Symbol{ + Name: "", + Info: 0x3, + Other: 0x0, + Section: 0xA, + Value: 0x0, + Size: 0x0, + }, + Symbol{ + Name: "", + Info: 0x3, + Other: 0x0, + Section: 0xC, + Value: 0x0, + Size: 0x0, + }, + Symbol{ + Name: "", + Info: 0x3, + Other: 0x0, + Section: 0xD, + Value: 0x0, + Size: 0x0, + }, + Symbol{ + Name: "", + Info: 0x3, + Other: 0x0, + Section: 0xE, + Value: 0x0, + Size: 0x0, + }, + Symbol{ + Name: "", + Info: 0x3, + Other: 0x0, + Section: 0xF, + Value: 0x0, + Size: 0x0, + }, + Symbol{ + Name: "", + Info: 0x3, + Other: 0x0, + Section: 0x10, + Value: 0x0, + Size: 0x0, + }, + Symbol{ + Name: "v", + Info: 0x11, + Other: 0x0, + Section: 0xFFF2, + Value: 0x4, + Size: 0x4, + }, + }, + "testdata/hello-world-core.gz": {}, +} + +var dynamicSymbolsGolden = map[string][]Symbol{ + "testdata/gcc-amd64-linux-exec": { + Symbol{ + Name: "__gmon_start__", + Info: 0x20, + Other: 0x0, + Section: 0x0, + Value: 0x0, + Size: 0x0, + }, + Symbol{ + Name: "puts", + Info: 0x12, + Other: 0x0, + Section: 0x0, + Value: 0x0, + Size: 0x18C, + }, + Symbol{ + Name: "__libc_start_main", + Info: 0x12, + Other: 0x0, + Section: 0x0, + Value: 0x0, + Size: 0x1C2, + }, + }, + "testdata/go-relocation-test-clang-x86.obj": {}, + "testdata/hello-world-core.gz": {}, +} diff --git a/src/debug/elf/testdata/gcc-386-freebsd-exec b/src/debug/elf/testdata/gcc-386-freebsd-exec new file mode 100755 index 0000000000000000000000000000000000000000..7af9c58ca73945561c470a5e7ad29f39d0405a6e Binary files /dev/null and b/src/debug/elf/testdata/gcc-386-freebsd-exec differ diff --git a/src/debug/elf/testdata/gcc-amd64-linux-exec b/src/debug/elf/testdata/gcc-amd64-linux-exec new file mode 100755 index 0000000000000000000000000000000000000000..c6cb1de28c77175897ee862d91c87454a42118f2 Binary files /dev/null and b/src/debug/elf/testdata/gcc-amd64-linux-exec differ diff --git a/src/debug/elf/testdata/gcc-amd64-openbsd-debug-with-rela.obj b/src/debug/elf/testdata/gcc-amd64-openbsd-debug-with-rela.obj new file mode 100644 index 0000000000000000000000000000000000000000..f62b1ea1cada83530e45320cc58394933753dddb Binary files /dev/null and b/src/debug/elf/testdata/gcc-amd64-openbsd-debug-with-rela.obj differ diff --git a/src/debug/elf/testdata/go-relocation-test-clang-arm.obj b/src/debug/elf/testdata/go-relocation-test-clang-arm.obj new file mode 100644 index 0000000000000000000000000000000000000000..1cc7e4b11143698a3abc3f72b88411e41f3d4989 Binary files /dev/null and b/src/debug/elf/testdata/go-relocation-test-clang-arm.obj differ diff --git a/src/debug/elf/testdata/go-relocation-test-clang-x86.obj b/src/debug/elf/testdata/go-relocation-test-clang-x86.obj new file mode 100644 index 0000000000000000000000000000000000000000..e909cf4e6e19a63276f497b70a170492ade64156 Binary files /dev/null and b/src/debug/elf/testdata/go-relocation-test-clang-x86.obj differ diff --git a/src/debug/elf/testdata/go-relocation-test-gcc424-x86-64.obj b/src/debug/elf/testdata/go-relocation-test-gcc424-x86-64.obj new file mode 100644 index 0000000000000000000000000000000000000000..a7c6d6e562c1c70342d9d1cf41194b7ef3fdedf6 Binary files /dev/null and b/src/debug/elf/testdata/go-relocation-test-gcc424-x86-64.obj differ diff --git a/src/debug/elf/testdata/go-relocation-test-gcc441-x86-64.obj b/src/debug/elf/testdata/go-relocation-test-gcc441-x86-64.obj new file mode 100644 index 0000000000000000000000000000000000000000..2d37ab6e6e12cfb6625cdda41dc7ecf775ade4e8 Binary files /dev/null and b/src/debug/elf/testdata/go-relocation-test-gcc441-x86-64.obj differ diff --git a/src/debug/elf/testdata/go-relocation-test-gcc441-x86.obj b/src/debug/elf/testdata/go-relocation-test-gcc441-x86.obj new file mode 100644 index 0000000000000000000000000000000000000000..0d59fe303b6dad25698a1e7c0644d285460797a9 Binary files /dev/null and b/src/debug/elf/testdata/go-relocation-test-gcc441-x86.obj differ diff --git a/src/debug/elf/testdata/go-relocation-test-gcc482-aarch64.obj b/src/debug/elf/testdata/go-relocation-test-gcc482-aarch64.obj new file mode 100644 index 0000000000000000000000000000000000000000..849e2644ec79263a958fcabda5b9e731e3cb1842 Binary files /dev/null and b/src/debug/elf/testdata/go-relocation-test-gcc482-aarch64.obj differ diff --git a/src/debug/elf/testdata/go-relocation-test-gcc482-ppc64le.obj b/src/debug/elf/testdata/go-relocation-test-gcc482-ppc64le.obj new file mode 100644 index 0000000000000000000000000000000000000000..dad7445486e8897ad351ec2c8fad09f0d8ee494d Binary files /dev/null and b/src/debug/elf/testdata/go-relocation-test-gcc482-ppc64le.obj differ diff --git a/src/debug/elf/testdata/go-relocation-test-gcc492-arm.obj b/src/debug/elf/testdata/go-relocation-test-gcc492-arm.obj new file mode 100644 index 0000000000000000000000000000000000000000..ed45be2c55fda61466e4860e42fab07cc9228978 Binary files /dev/null and b/src/debug/elf/testdata/go-relocation-test-gcc492-arm.obj differ diff --git a/src/debug/elf/testdata/go-relocation-test-gcc5-ppc.obj b/src/debug/elf/testdata/go-relocation-test-gcc5-ppc.obj new file mode 100644 index 0000000000000000000000000000000000000000..f4165af0982d3b87761a4a540900e687b39e980f Binary files /dev/null and b/src/debug/elf/testdata/go-relocation-test-gcc5-ppc.obj differ diff --git a/src/debug/elf/testdata/hello-world-core.gz b/src/debug/elf/testdata/hello-world-core.gz new file mode 100644 index 0000000000000000000000000000000000000000..806af6edbc23bd0db45a9b1adfae9418ca6a969a Binary files /dev/null and b/src/debug/elf/testdata/hello-world-core.gz differ diff --git a/src/debug/elf/testdata/hello.c b/src/debug/elf/testdata/hello.c new file mode 100644 index 0000000000000000000000000000000000000000..34d9ee79234ef29ea03feeb69d220b0796295636 --- /dev/null +++ b/src/debug/elf/testdata/hello.c @@ -0,0 +1,7 @@ +#include + +void +main(int argc, char *argv[]) +{ + printf("hello, world\n"); +} diff --git a/src/debug/gosym/pclinetest.asm b/src/debug/gosym/pclinetest.asm new file mode 100644 index 0000000000000000000000000000000000000000..b9ee9c0a50413f60bfa0aad8e758a09449d7ad71 --- /dev/null +++ b/src/debug/gosym/pclinetest.asm @@ -0,0 +1,58 @@ +TEXT linefrompc(SB),4,$0 // Each byte stores its line delta +BYTE $2; +BYTE $1; +BYTE $1; BYTE $0; +BYTE $1; BYTE $0; BYTE $0; +BYTE $1; BYTE $0; BYTE $0; BYTE $0; BYTE $0; +BYTE $1; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; +BYTE $1; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; +BYTE $1; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; +BYTE $1; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; +BYTE $1; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; +BYTE $1; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; +BYTE $1; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; +BYTE $1; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; +BYTE $1; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; +BYTE $1; +BYTE $1; +BYTE $1; BYTE $0; +BYTE $1; BYTE $0; BYTE $0; +BYTE $1; BYTE $0; BYTE $0; BYTE $0; BYTE $0; +BYTE $1; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; +BYTE $1; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; +BYTE $1; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; +BYTE $1; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; +#include "pclinetest.h" +BYTE $2; +#include "pclinetest.h" +BYTE $2; +BYTE $255; + +TEXT pcfromline(SB),4,$0 // Each record stores its line delta, then n, then n more bytes +BYTE $32; BYTE $0; +BYTE $1; BYTE $1; BYTE $0; +BYTE $1; BYTE $0; + +BYTE $2; BYTE $4; BYTE $0; BYTE $0; BYTE $0; BYTE $0; + + +#include "pclinetest.h" +BYTE $4; BYTE $0; + + +BYTE $3; BYTE $3; BYTE $0; BYTE $0; BYTE $0; +#include "pclinetest.h" + + +BYTE $4; BYTE $3; BYTE $0; BYTE $0; BYTE $0; +BYTE $255; + +// Keep the linker happy +TEXT main·main(SB),4,$0 + RET + +TEXT main·init(SB),4,$0 + // Prevent GC of our test symbols + CALL linefrompc(SB) + CALL pcfromline(SB) + RET diff --git a/src/debug/gosym/pclinetest.h b/src/debug/gosym/pclinetest.h new file mode 100644 index 0000000000000000000000000000000000000000..156c0b87b00a0f6ccb9271424bb75957b6d0c8c0 --- /dev/null +++ b/src/debug/gosym/pclinetest.h @@ -0,0 +1,9 @@ +// +build ignore + +// Empty include file to generate z symbols + + + + + +// EOF diff --git a/src/debug/gosym/pclntab.go b/src/debug/gosym/pclntab.go new file mode 100644 index 0000000000000000000000000000000000000000..6620aefb053ceab0bb20b4a8cd5900adab4e091c --- /dev/null +++ b/src/debug/gosym/pclntab.go @@ -0,0 +1,453 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +/* + * Line tables + */ + +package gosym + +import ( + "encoding/binary" + "sync" +) + +// A LineTable is a data structure mapping program counters to line numbers. +// +// In Go 1.1 and earlier, each function (represented by a Func) had its own LineTable, +// and the line number corresponded to a numbering of all source lines in the +// program, across all files. That absolute line number would then have to be +// converted separately to a file name and line number within the file. +// +// In Go 1.2, the format of the data changed so that there is a single LineTable +// for the entire program, shared by all Funcs, and there are no absolute line +// numbers, just line numbers within specific files. +// +// For the most part, LineTable's methods should be treated as an internal +// detail of the package; callers should use the methods on Table instead. +type LineTable struct { + Data []byte + PC uint64 + Line int + + // Go 1.2 state + mu sync.Mutex + go12 int // is this in Go 1.2 format? -1 no, 0 unknown, 1 yes + binary binary.ByteOrder + quantum uint32 + ptrsize uint32 + functab []byte + nfunctab uint32 + filetab []byte + nfiletab uint32 + fileMap map[string]uint32 +} + +// NOTE(rsc): This is wrong for GOARCH=arm, which uses a quantum of 4, +// but we have no idea whether we're using arm or not. This only +// matters in the old (pre-Go 1.2) symbol table format, so it's not worth +// fixing. +const oldQuantum = 1 + +func (t *LineTable) parse(targetPC uint64, targetLine int) (b []byte, pc uint64, line int) { + // The PC/line table can be thought of as a sequence of + // * + // batches. Each update batch results in a (pc, line) pair, + // where line applies to every PC from pc up to but not + // including the pc of the next pair. + // + // Here we process each update individually, which simplifies + // the code, but makes the corner cases more confusing. + b, pc, line = t.Data, t.PC, t.Line + for pc <= targetPC && line != targetLine && len(b) > 0 { + code := b[0] + b = b[1:] + switch { + case code == 0: + if len(b) < 4 { + b = b[0:0] + break + } + val := binary.BigEndian.Uint32(b) + b = b[4:] + line += int(val) + case code <= 64: + line += int(code) + case code <= 128: + line -= int(code - 64) + default: + pc += oldQuantum * uint64(code-128) + continue + } + pc += oldQuantum + } + return b, pc, line +} + +func (t *LineTable) slice(pc uint64) *LineTable { + data, pc, line := t.parse(pc, -1) + return &LineTable{Data: data, PC: pc, Line: line} +} + +// PCToLine returns the line number for the given program counter. +// Callers should use Table's PCToLine method instead. +func (t *LineTable) PCToLine(pc uint64) int { + if t.isGo12() { + return t.go12PCToLine(pc) + } + _, _, line := t.parse(pc, -1) + return line +} + +// LineToPC returns the program counter for the given line number, +// considering only program counters before maxpc. +// Callers should use Table's LineToPC method instead. +func (t *LineTable) LineToPC(line int, maxpc uint64) uint64 { + if t.isGo12() { + return 0 + } + _, pc, line1 := t.parse(maxpc, line) + if line1 != line { + return 0 + } + // Subtract quantum from PC to account for post-line increment + return pc - oldQuantum +} + +// NewLineTable returns a new PC/line table +// corresponding to the encoded data. +// Text must be the start address of the +// corresponding text segment. +func NewLineTable(data []byte, text uint64) *LineTable { + return &LineTable{Data: data, PC: text, Line: 0} +} + +// Go 1.2 symbol table format. +// See golang.org/s/go12symtab. +// +// A general note about the methods here: rather than try to avoid +// index out of bounds errors, we trust Go to detect them, and then +// we recover from the panics and treat them as indicative of a malformed +// or incomplete table. +// +// The methods called by symtab.go, which begin with "go12" prefixes, +// are expected to have that recovery logic. + +// isGo12 reports whether this is a Go 1.2 (or later) symbol table. +func (t *LineTable) isGo12() bool { + t.go12Init() + return t.go12 == 1 +} + +const go12magic = 0xfffffffb + +// uintptr returns the pointer-sized value encoded at b. +// The pointer size is dictated by the table being read. +func (t *LineTable) uintptr(b []byte) uint64 { + if t.ptrsize == 4 { + return uint64(t.binary.Uint32(b)) + } + return t.binary.Uint64(b) +} + +// go12init initializes the Go 1.2 metadata if t is a Go 1.2 symbol table. +func (t *LineTable) go12Init() { + t.mu.Lock() + defer t.mu.Unlock() + if t.go12 != 0 { + return + } + + defer func() { + // If we panic parsing, assume it's not a Go 1.2 symbol table. + recover() + }() + + // Check header: 4-byte magic, two zeros, pc quantum, pointer size. + t.go12 = -1 // not Go 1.2 until proven otherwise + if len(t.Data) < 16 || t.Data[4] != 0 || t.Data[5] != 0 || + (t.Data[6] != 1 && t.Data[6] != 4) || // pc quantum + (t.Data[7] != 4 && t.Data[7] != 8) { // pointer size + return + } + + switch uint32(go12magic) { + case binary.LittleEndian.Uint32(t.Data): + t.binary = binary.LittleEndian + case binary.BigEndian.Uint32(t.Data): + t.binary = binary.BigEndian + default: + return + } + + t.quantum = uint32(t.Data[6]) + t.ptrsize = uint32(t.Data[7]) + + t.nfunctab = uint32(t.uintptr(t.Data[8:])) + t.functab = t.Data[8+t.ptrsize:] + functabsize := t.nfunctab*2*t.ptrsize + t.ptrsize + fileoff := t.binary.Uint32(t.functab[functabsize:]) + t.functab = t.functab[:functabsize] + t.filetab = t.Data[fileoff:] + t.nfiletab = t.binary.Uint32(t.filetab) + t.filetab = t.filetab[:t.nfiletab*4] + + t.go12 = 1 // so far so good +} + +// go12Funcs returns a slice of Funcs derived from the Go 1.2 pcln table. +func (t *LineTable) go12Funcs() []Func { + // Assume it is malformed and return nil on error. + defer func() { + recover() + }() + + n := len(t.functab) / int(t.ptrsize) / 2 + funcs := make([]Func, n) + for i := range funcs { + f := &funcs[i] + f.Entry = uint64(t.uintptr(t.functab[2*i*int(t.ptrsize):])) + f.End = uint64(t.uintptr(t.functab[(2*i+2)*int(t.ptrsize):])) + info := t.Data[t.uintptr(t.functab[(2*i+1)*int(t.ptrsize):]):] + f.LineTable = t + f.FrameSize = int(t.binary.Uint32(info[t.ptrsize+2*4:])) + f.Sym = &Sym{ + Value: f.Entry, + Type: 'T', + Name: t.string(t.binary.Uint32(info[t.ptrsize:])), + GoType: 0, + Func: f, + } + } + return funcs +} + +// findFunc returns the func corresponding to the given program counter. +func (t *LineTable) findFunc(pc uint64) []byte { + if pc < t.uintptr(t.functab) || pc >= t.uintptr(t.functab[len(t.functab)-int(t.ptrsize):]) { + return nil + } + + // The function table is a list of 2*nfunctab+1 uintptrs, + // alternating program counters and offsets to func structures. + f := t.functab + nf := t.nfunctab + for nf > 0 { + m := nf / 2 + fm := f[2*t.ptrsize*m:] + if t.uintptr(fm) <= pc && pc < t.uintptr(fm[2*t.ptrsize:]) { + return t.Data[t.uintptr(fm[t.ptrsize:]):] + } else if pc < t.uintptr(fm) { + nf = m + } else { + f = f[(m+1)*2*t.ptrsize:] + nf -= m + 1 + } + } + return nil +} + +// readvarint reads, removes, and returns a varint from *pp. +func (t *LineTable) readvarint(pp *[]byte) uint32 { + var v, shift uint32 + p := *pp + for shift = 0; ; shift += 7 { + b := p[0] + p = p[1:] + v |= (uint32(b) & 0x7F) << shift + if b&0x80 == 0 { + break + } + } + *pp = p + return v +} + +// string returns a Go string found at off. +func (t *LineTable) string(off uint32) string { + for i := off; ; i++ { + if t.Data[i] == 0 { + return string(t.Data[off:i]) + } + } +} + +// step advances to the next pc, value pair in the encoded table. +func (t *LineTable) step(p *[]byte, pc *uint64, val *int32, first bool) bool { + uvdelta := t.readvarint(p) + if uvdelta == 0 && !first { + return false + } + if uvdelta&1 != 0 { + uvdelta = ^(uvdelta >> 1) + } else { + uvdelta >>= 1 + } + vdelta := int32(uvdelta) + pcdelta := t.readvarint(p) * t.quantum + *pc += uint64(pcdelta) + *val += vdelta + return true +} + +// pcvalue reports the value associated with the target pc. +// off is the offset to the beginning of the pc-value table, +// and entry is the start PC for the corresponding function. +func (t *LineTable) pcvalue(off uint32, entry, targetpc uint64) int32 { + if off == 0 { + return -1 + } + p := t.Data[off:] + + val := int32(-1) + pc := entry + for t.step(&p, &pc, &val, pc == entry) { + if targetpc < pc { + return val + } + } + return -1 +} + +// findFileLine scans one function in the binary looking for a +// program counter in the given file on the given line. +// It does so by running the pc-value tables mapping program counter +// to file number. Since most functions come from a single file, these +// are usually short and quick to scan. If a file match is found, then the +// code goes to the expense of looking for a simultaneous line number match. +func (t *LineTable) findFileLine(entry uint64, filetab, linetab uint32, filenum, line int32) uint64 { + if filetab == 0 || linetab == 0 { + return 0 + } + + fp := t.Data[filetab:] + fl := t.Data[linetab:] + fileVal := int32(-1) + filePC := entry + lineVal := int32(-1) + linePC := entry + fileStartPC := filePC + for t.step(&fp, &filePC, &fileVal, filePC == entry) { + if fileVal == filenum && fileStartPC < filePC { + // fileVal is in effect starting at fileStartPC up to + // but not including filePC, and it's the file we want. + // Run the PC table looking for a matching line number + // or until we reach filePC. + lineStartPC := linePC + for linePC < filePC && t.step(&fl, &linePC, &lineVal, linePC == entry) { + // lineVal is in effect until linePC, and lineStartPC < filePC. + if lineVal == line { + if fileStartPC <= lineStartPC { + return lineStartPC + } + if fileStartPC < linePC { + return fileStartPC + } + } + lineStartPC = linePC + } + } + fileStartPC = filePC + } + return 0 +} + +// go12PCToLine maps program counter to line number for the Go 1.2 pcln table. +func (t *LineTable) go12PCToLine(pc uint64) (line int) { + defer func() { + if recover() != nil { + line = -1 + } + }() + + f := t.findFunc(pc) + if f == nil { + return -1 + } + entry := t.uintptr(f) + linetab := t.binary.Uint32(f[t.ptrsize+5*4:]) + return int(t.pcvalue(linetab, entry, pc)) +} + +// go12PCToFile maps program counter to file name for the Go 1.2 pcln table. +func (t *LineTable) go12PCToFile(pc uint64) (file string) { + defer func() { + if recover() != nil { + file = "" + } + }() + + f := t.findFunc(pc) + if f == nil { + return "" + } + entry := t.uintptr(f) + filetab := t.binary.Uint32(f[t.ptrsize+4*4:]) + fno := t.pcvalue(filetab, entry, pc) + if fno <= 0 { + return "" + } + return t.string(t.binary.Uint32(t.filetab[4*fno:])) +} + +// go12LineToPC maps a (file, line) pair to a program counter for the Go 1.2 pcln table. +func (t *LineTable) go12LineToPC(file string, line int) (pc uint64) { + defer func() { + if recover() != nil { + pc = 0 + } + }() + + t.initFileMap() + filenum := t.fileMap[file] + if filenum == 0 { + return 0 + } + + // Scan all functions. + // If this turns out to be a bottleneck, we could build a map[int32][]int32 + // mapping file number to a list of functions with code from that file. + for i := uint32(0); i < t.nfunctab; i++ { + f := t.Data[t.uintptr(t.functab[2*t.ptrsize*i+t.ptrsize:]):] + entry := t.uintptr(f) + filetab := t.binary.Uint32(f[t.ptrsize+4*4:]) + linetab := t.binary.Uint32(f[t.ptrsize+5*4:]) + pc := t.findFileLine(entry, filetab, linetab, int32(filenum), int32(line)) + if pc != 0 { + return pc + } + } + return 0 +} + +// initFileMap initializes the map from file name to file number. +func (t *LineTable) initFileMap() { + t.mu.Lock() + defer t.mu.Unlock() + + if t.fileMap != nil { + return + } + m := make(map[string]uint32) + + for i := uint32(1); i < t.nfiletab; i++ { + s := t.string(t.binary.Uint32(t.filetab[4*i:])) + m[s] = i + } + t.fileMap = m +} + +// go12MapFiles adds to m a key for every file in the Go 1.2 LineTable. +// Every key maps to obj. That's not a very interesting map, but it provides +// a way for callers to obtain the list of files in the program. +func (t *LineTable) go12MapFiles(m map[string]*Obj, obj *Obj) { + defer func() { + recover() + }() + + t.initFileMap() + for file := range t.fileMap { + m[file] = obj + } +} diff --git a/src/debug/gosym/pclntab_test.go b/src/debug/gosym/pclntab_test.go new file mode 100644 index 0000000000000000000000000000000000000000..53f3e952d62bdbf7f2d12c535aa701ecedc45da5 --- /dev/null +++ b/src/debug/gosym/pclntab_test.go @@ -0,0 +1,278 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package gosym + +import ( + "debug/elf" + "io/ioutil" + "os" + "os/exec" + "path/filepath" + "runtime" + "strings" + "testing" +) + +var ( + pclineTempDir string + pclinetestBinary string +) + +func dotest(self bool) bool { + // For now, only works on amd64 platforms. + if runtime.GOARCH != "amd64" { + return false + } + // Self test reads test binary; only works on Linux. + if self && runtime.GOOS != "linux" { + return false + } + if pclinetestBinary != "" { + return true + } + var err error + pclineTempDir, err = ioutil.TempDir("", "pclinetest") + if err != nil { + panic(err) + } + if strings.Contains(pclineTempDir, " ") { + panic("unexpected space in tempdir") + } + // This command builds pclinetest from pclinetest.asm; + // the resulting binary looks like it was built from pclinetest.s, + // but we have renamed it to keep it away from the go tool. + pclinetestBinary = filepath.Join(pclineTempDir, "pclinetest") + cmd := exec.Command("go", "tool", "asm", "-o", pclinetestBinary+".o", "pclinetest.asm") + cmd.Stdout = os.Stdout + cmd.Stderr = os.Stderr + if err := cmd.Run(); err != nil { + panic(err) + } + cmd = exec.Command("go", "tool", "link", "-H", "linux", "-E", "main", + "-o", pclinetestBinary, pclinetestBinary+".o") + cmd.Stdout = os.Stdout + cmd.Stderr = os.Stderr + if err := cmd.Run(); err != nil { + panic(err) + } + return true +} + +func endtest() { + if pclineTempDir != "" { + os.RemoveAll(pclineTempDir) + pclineTempDir = "" + pclinetestBinary = "" + } +} + +func getTable(t *testing.T) *Table { + f, tab := crack(os.Args[0], t) + f.Close() + return tab +} + +func crack(file string, t *testing.T) (*elf.File, *Table) { + // Open self + f, err := elf.Open(file) + if err != nil { + t.Fatal(err) + } + return parse(file, f, t) +} + +func parse(file string, f *elf.File, t *testing.T) (*elf.File, *Table) { + s := f.Section(".gosymtab") + if s == nil { + t.Skip("no .gosymtab section") + } + symdat, err := s.Data() + if err != nil { + f.Close() + t.Fatalf("reading %s gosymtab: %v", file, err) + } + pclndat, err := f.Section(".gopclntab").Data() + if err != nil { + f.Close() + t.Fatalf("reading %s gopclntab: %v", file, err) + } + + pcln := NewLineTable(pclndat, f.Section(".text").Addr) + tab, err := NewTable(symdat, pcln) + if err != nil { + f.Close() + t.Fatalf("parsing %s gosymtab: %v", file, err) + } + + return f, tab +} + +var goarch = os.Getenv("O") + +func TestLineFromAline(t *testing.T) { + if !dotest(true) { + return + } + defer endtest() + + tab := getTable(t) + if tab.go12line != nil { + // aline's don't exist in the Go 1.2 table. + t.Skip("not relevant to Go 1.2 symbol table") + } + + // Find the sym package + pkg := tab.LookupFunc("debug/gosym.TestLineFromAline").Obj + if pkg == nil { + t.Fatalf("nil pkg") + } + + // Walk every absolute line and ensure that we hit every + // source line monotonically + lastline := make(map[string]int) + final := -1 + for i := 0; i < 10000; i++ { + path, line := pkg.lineFromAline(i) + // Check for end of object + if path == "" { + if final == -1 { + final = i - 1 + } + continue + } else if final != -1 { + t.Fatalf("reached end of package at absolute line %d, but absolute line %d mapped to %s:%d", final, i, path, line) + } + // It's okay to see files multiple times (e.g., sys.a) + if line == 1 { + lastline[path] = 1 + continue + } + // Check that the is the next line in path + ll, ok := lastline[path] + if !ok { + t.Errorf("file %s starts on line %d", path, line) + } else if line != ll+1 { + t.Fatalf("expected next line of file %s to be %d, got %d", path, ll+1, line) + } + lastline[path] = line + } + if final == -1 { + t.Errorf("never reached end of object") + } +} + +func TestLineAline(t *testing.T) { + if !dotest(true) { + return + } + defer endtest() + + tab := getTable(t) + if tab.go12line != nil { + // aline's don't exist in the Go 1.2 table. + t.Skip("not relevant to Go 1.2 symbol table") + } + + for _, o := range tab.Files { + // A source file can appear multiple times in a + // object. alineFromLine will always return alines in + // the first file, so track which lines we've seen. + found := make(map[string]int) + for i := 0; i < 1000; i++ { + path, line := o.lineFromAline(i) + if path == "" { + break + } + + // cgo files are full of 'Z' symbols, which we don't handle + if len(path) > 4 && path[len(path)-4:] == ".cgo" { + continue + } + + if minline, ok := found[path]; path != "" && ok { + if minline >= line { + // We've already covered this file + continue + } + } + found[path] = line + + a, err := o.alineFromLine(path, line) + if err != nil { + t.Errorf("absolute line %d in object %s maps to %s:%d, but mapping that back gives error %s", i, o.Paths[0].Name, path, line, err) + } else if a != i { + t.Errorf("absolute line %d in object %s maps to %s:%d, which maps back to absolute line %d\n", i, o.Paths[0].Name, path, line, a) + } + } + } +} + +func TestPCLine(t *testing.T) { + if !dotest(false) { + return + } + defer endtest() + + f, tab := crack(pclinetestBinary, t) + text := f.Section(".text") + textdat, err := text.Data() + if err != nil { + t.Fatalf("reading .text: %v", err) + } + + // Test PCToLine + sym := tab.LookupFunc("linefrompc") + wantLine := 0 + for pc := sym.Entry; pc < sym.End; pc++ { + off := pc - text.Addr // TODO(rsc): should not need off; bug in 8g + if textdat[off] == 255 { + break + } + wantLine += int(textdat[off]) + t.Logf("off is %d %#x (max %d)", off, textdat[off], sym.End-pc) + file, line, fn := tab.PCToLine(pc) + if fn == nil { + t.Errorf("failed to get line of PC %#x", pc) + } else if !strings.HasSuffix(file, "pclinetest.asm") || line != wantLine || fn != sym { + t.Errorf("PCToLine(%#x) = %s:%d (%s), want %s:%d (%s)", pc, file, line, fn.Name, "pclinetest.asm", wantLine, sym.Name) + } + } + + // Test LineToPC + sym = tab.LookupFunc("pcfromline") + lookupline := -1 + wantLine = 0 + off := uint64(0) // TODO(rsc): should not need off; bug in 8g + for pc := sym.Value; pc < sym.End; pc += 2 + uint64(textdat[off]) { + file, line, fn := tab.PCToLine(pc) + off = pc - text.Addr + if textdat[off] == 255 { + break + } + wantLine += int(textdat[off]) + if line != wantLine { + t.Errorf("expected line %d at PC %#x in pcfromline, got %d", wantLine, pc, line) + off = pc + 1 - text.Addr + continue + } + if lookupline == -1 { + lookupline = line + } + for ; lookupline <= line; lookupline++ { + pc2, fn2, err := tab.LineToPC(file, lookupline) + if lookupline != line { + // Should be nothing on this line + if err == nil { + t.Errorf("expected no PC at line %d, got %#x (%s)", lookupline, pc2, fn2.Name) + } + } else if err != nil { + t.Errorf("failed to get PC of line %d: %s", lookupline, err) + } else if pc != pc2 { + t.Errorf("expected PC %#x (%s) at line %d, got PC %#x (%s)", pc, fn.Name, line, pc2, fn2.Name) + } + } + off = pc + 1 - text.Addr + } +} diff --git a/src/debug/gosym/symtab.go b/src/debug/gosym/symtab.go new file mode 100644 index 0000000000000000000000000000000000000000..46f07833442b28c7e111ee3caa96b7f6e6654780 --- /dev/null +++ b/src/debug/gosym/symtab.go @@ -0,0 +1,710 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package gosym implements access to the Go symbol +// and line number tables embedded in Go binaries generated +// by the gc compilers. +package gosym + +// The table format is a variant of the format used in Plan 9's a.out +// format, documented at http://plan9.bell-labs.com/magic/man2html/6/a.out. +// The best reference for the differences between the Plan 9 format +// and the Go format is the runtime source, specifically ../../runtime/symtab.c. + +import ( + "bytes" + "encoding/binary" + "fmt" + "strconv" + "strings" +) + +/* + * Symbols + */ + +// A Sym represents a single symbol table entry. +type Sym struct { + Value uint64 + Type byte + Name string + GoType uint64 + // If this symbol is a function symbol, the corresponding Func + Func *Func +} + +// Static reports whether this symbol is static (not visible outside its file). +func (s *Sym) Static() bool { return s.Type >= 'a' } + +// PackageName returns the package part of the symbol name, +// or the empty string if there is none. +func (s *Sym) PackageName() string { + if i := strings.Index(s.Name, "."); i != -1 { + return s.Name[0:i] + } + return "" +} + +// ReceiverName returns the receiver type name of this symbol, +// or the empty string if there is none. +func (s *Sym) ReceiverName() string { + l := strings.Index(s.Name, ".") + r := strings.LastIndex(s.Name, ".") + if l == -1 || r == -1 || l == r { + return "" + } + return s.Name[l+1 : r] +} + +// BaseName returns the symbol name without the package or receiver name. +func (s *Sym) BaseName() string { + if i := strings.LastIndex(s.Name, "."); i != -1 { + return s.Name[i+1:] + } + return s.Name +} + +// A Func collects information about a single function. +type Func struct { + Entry uint64 + *Sym + End uint64 + Params []*Sym + Locals []*Sym + FrameSize int + LineTable *LineTable + Obj *Obj +} + +// An Obj represents a collection of functions in a symbol table. +// +// The exact method of division of a binary into separate Objs is an internal detail +// of the symbol table format. +// +// In early versions of Go each source file became a different Obj. +// +// In Go 1 and Go 1.1, each package produced one Obj for all Go sources +// and one Obj per C source file. +// +// In Go 1.2, there is a single Obj for the entire program. +type Obj struct { + // Funcs is a list of functions in the Obj. + Funcs []Func + + // In Go 1.1 and earlier, Paths is a list of symbols corresponding + // to the source file names that produced the Obj. + // In Go 1.2, Paths is nil. + // Use the keys of Table.Files to obtain a list of source files. + Paths []Sym // meta +} + +/* + * Symbol tables + */ + +// Table represents a Go symbol table. It stores all of the +// symbols decoded from the program and provides methods to translate +// between symbols, names, and addresses. +type Table struct { + Syms []Sym + Funcs []Func + Files map[string]*Obj // nil for Go 1.2 and later binaries + Objs []Obj // nil for Go 1.2 and later binaries + + go12line *LineTable // Go 1.2 line number table +} + +type sym struct { + value uint64 + gotype uint64 + typ byte + name []byte +} + +var ( + littleEndianSymtab = []byte{0xFD, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00} + bigEndianSymtab = []byte{0xFF, 0xFF, 0xFF, 0xFD, 0x00, 0x00, 0x00} + oldLittleEndianSymtab = []byte{0xFE, 0xFF, 0xFF, 0xFF, 0x00, 0x00} +) + +func walksymtab(data []byte, fn func(sym) error) error { + if len(data) == 0 { // missing symtab is okay + return nil + } + var order binary.ByteOrder = binary.BigEndian + newTable := false + switch { + case bytes.HasPrefix(data, oldLittleEndianSymtab): + // Same as Go 1.0, but little endian. + // Format was used during interim development between Go 1.0 and Go 1.1. + // Should not be widespread, but easy to support. + data = data[6:] + order = binary.LittleEndian + case bytes.HasPrefix(data, bigEndianSymtab): + newTable = true + case bytes.HasPrefix(data, littleEndianSymtab): + newTable = true + order = binary.LittleEndian + } + var ptrsz int + if newTable { + if len(data) < 8 { + return &DecodingError{len(data), "unexpected EOF", nil} + } + ptrsz = int(data[7]) + if ptrsz != 4 && ptrsz != 8 { + return &DecodingError{7, "invalid pointer size", ptrsz} + } + data = data[8:] + } + var s sym + p := data + for len(p) >= 4 { + var typ byte + if newTable { + // Symbol type, value, Go type. + typ = p[0] & 0x3F + wideValue := p[0]&0x40 != 0 + goType := p[0]&0x80 != 0 + if typ < 26 { + typ += 'A' + } else { + typ += 'a' - 26 + } + s.typ = typ + p = p[1:] + if wideValue { + if len(p) < ptrsz { + return &DecodingError{len(data), "unexpected EOF", nil} + } + // fixed-width value + if ptrsz == 8 { + s.value = order.Uint64(p[0:8]) + p = p[8:] + } else { + s.value = uint64(order.Uint32(p[0:4])) + p = p[4:] + } + } else { + // varint value + s.value = 0 + shift := uint(0) + for len(p) > 0 && p[0]&0x80 != 0 { + s.value |= uint64(p[0]&0x7F) << shift + shift += 7 + p = p[1:] + } + if len(p) == 0 { + return &DecodingError{len(data), "unexpected EOF", nil} + } + s.value |= uint64(p[0]) << shift + p = p[1:] + } + if goType { + if len(p) < ptrsz { + return &DecodingError{len(data), "unexpected EOF", nil} + } + // fixed-width go type + if ptrsz == 8 { + s.gotype = order.Uint64(p[0:8]) + p = p[8:] + } else { + s.gotype = uint64(order.Uint32(p[0:4])) + p = p[4:] + } + } + } else { + // Value, symbol type. + s.value = uint64(order.Uint32(p[0:4])) + if len(p) < 5 { + return &DecodingError{len(data), "unexpected EOF", nil} + } + typ = p[4] + if typ&0x80 == 0 { + return &DecodingError{len(data) - len(p) + 4, "bad symbol type", typ} + } + typ &^= 0x80 + s.typ = typ + p = p[5:] + } + + // Name. + var i int + var nnul int + for i = 0; i < len(p); i++ { + if p[i] == 0 { + nnul = 1 + break + } + } + switch typ { + case 'z', 'Z': + p = p[i+nnul:] + for i = 0; i+2 <= len(p); i += 2 { + if p[i] == 0 && p[i+1] == 0 { + nnul = 2 + break + } + } + } + if len(p) < i+nnul { + return &DecodingError{len(data), "unexpected EOF", nil} + } + s.name = p[0:i] + i += nnul + p = p[i:] + + if !newTable { + if len(p) < 4 { + return &DecodingError{len(data), "unexpected EOF", nil} + } + // Go type. + s.gotype = uint64(order.Uint32(p[:4])) + p = p[4:] + } + fn(s) + } + return nil +} + +// NewTable decodes the Go symbol table in data, +// returning an in-memory representation. +func NewTable(symtab []byte, pcln *LineTable) (*Table, error) { + var n int + err := walksymtab(symtab, func(s sym) error { + n++ + return nil + }) + if err != nil { + return nil, err + } + + var t Table + if pcln.isGo12() { + t.go12line = pcln + } + fname := make(map[uint16]string) + t.Syms = make([]Sym, 0, n) + nf := 0 + nz := 0 + lasttyp := uint8(0) + err = walksymtab(symtab, func(s sym) error { + n := len(t.Syms) + t.Syms = t.Syms[0 : n+1] + ts := &t.Syms[n] + ts.Type = s.typ + ts.Value = uint64(s.value) + ts.GoType = uint64(s.gotype) + switch s.typ { + default: + // rewrite name to use . instead of · (c2 b7) + w := 0 + b := s.name + for i := 0; i < len(b); i++ { + if b[i] == 0xc2 && i+1 < len(b) && b[i+1] == 0xb7 { + i++ + b[i] = '.' + } + b[w] = b[i] + w++ + } + ts.Name = string(s.name[0:w]) + case 'z', 'Z': + if lasttyp != 'z' && lasttyp != 'Z' { + nz++ + } + for i := 0; i < len(s.name); i += 2 { + eltIdx := binary.BigEndian.Uint16(s.name[i : i+2]) + elt, ok := fname[eltIdx] + if !ok { + return &DecodingError{-1, "bad filename code", eltIdx} + } + if n := len(ts.Name); n > 0 && ts.Name[n-1] != '/' { + ts.Name += "/" + } + ts.Name += elt + } + } + switch s.typ { + case 'T', 't', 'L', 'l': + nf++ + case 'f': + fname[uint16(s.value)] = ts.Name + } + lasttyp = s.typ + return nil + }) + if err != nil { + return nil, err + } + + t.Funcs = make([]Func, 0, nf) + t.Files = make(map[string]*Obj) + + var obj *Obj + if t.go12line != nil { + // Put all functions into one Obj. + t.Objs = make([]Obj, 1) + obj = &t.Objs[0] + t.go12line.go12MapFiles(t.Files, obj) + } else { + t.Objs = make([]Obj, 0, nz) + } + + // Count text symbols and attach frame sizes, parameters, and + // locals to them. Also, find object file boundaries. + lastf := 0 + for i := 0; i < len(t.Syms); i++ { + sym := &t.Syms[i] + switch sym.Type { + case 'Z', 'z': // path symbol + if t.go12line != nil { + // Go 1.2 binaries have the file information elsewhere. Ignore. + break + } + // Finish the current object + if obj != nil { + obj.Funcs = t.Funcs[lastf:] + } + lastf = len(t.Funcs) + + // Start new object + n := len(t.Objs) + t.Objs = t.Objs[0 : n+1] + obj = &t.Objs[n] + + // Count & copy path symbols + var end int + for end = i + 1; end < len(t.Syms); end++ { + if c := t.Syms[end].Type; c != 'Z' && c != 'z' { + break + } + } + obj.Paths = t.Syms[i:end] + i = end - 1 // loop will i++ + + // Record file names + depth := 0 + for j := range obj.Paths { + s := &obj.Paths[j] + if s.Name == "" { + depth-- + } else { + if depth == 0 { + t.Files[s.Name] = obj + } + depth++ + } + } + + case 'T', 't', 'L', 'l': // text symbol + if n := len(t.Funcs); n > 0 { + t.Funcs[n-1].End = sym.Value + } + if sym.Name == "runtime.etext" || sym.Name == "etext" { + continue + } + + // Count parameter and local (auto) syms + var np, na int + var end int + countloop: + for end = i + 1; end < len(t.Syms); end++ { + switch t.Syms[end].Type { + case 'T', 't', 'L', 'l', 'Z', 'z': + break countloop + case 'p': + np++ + case 'a': + na++ + } + } + + // Fill in the function symbol + n := len(t.Funcs) + t.Funcs = t.Funcs[0 : n+1] + fn := &t.Funcs[n] + sym.Func = fn + fn.Params = make([]*Sym, 0, np) + fn.Locals = make([]*Sym, 0, na) + fn.Sym = sym + fn.Entry = sym.Value + fn.Obj = obj + if t.go12line != nil { + // All functions share the same line table. + // It knows how to narrow down to a specific + // function quickly. + fn.LineTable = t.go12line + } else if pcln != nil { + fn.LineTable = pcln.slice(fn.Entry) + pcln = fn.LineTable + } + for j := i; j < end; j++ { + s := &t.Syms[j] + switch s.Type { + case 'm': + fn.FrameSize = int(s.Value) + case 'p': + n := len(fn.Params) + fn.Params = fn.Params[0 : n+1] + fn.Params[n] = s + case 'a': + n := len(fn.Locals) + fn.Locals = fn.Locals[0 : n+1] + fn.Locals[n] = s + } + } + i = end - 1 // loop will i++ + } + } + + if t.go12line != nil && nf == 0 { + t.Funcs = t.go12line.go12Funcs() + } + if obj != nil { + obj.Funcs = t.Funcs[lastf:] + } + return &t, nil +} + +// PCToFunc returns the function containing the program counter pc, +// or nil if there is no such function. +func (t *Table) PCToFunc(pc uint64) *Func { + funcs := t.Funcs + for len(funcs) > 0 { + m := len(funcs) / 2 + fn := &funcs[m] + switch { + case pc < fn.Entry: + funcs = funcs[0:m] + case fn.Entry <= pc && pc < fn.End: + return fn + default: + funcs = funcs[m+1:] + } + } + return nil +} + +// PCToLine looks up line number information for a program counter. +// If there is no information, it returns fn == nil. +func (t *Table) PCToLine(pc uint64) (file string, line int, fn *Func) { + if fn = t.PCToFunc(pc); fn == nil { + return + } + if t.go12line != nil { + file = t.go12line.go12PCToFile(pc) + line = t.go12line.go12PCToLine(pc) + } else { + file, line = fn.Obj.lineFromAline(fn.LineTable.PCToLine(pc)) + } + return +} + +// LineToPC looks up the first program counter on the given line in +// the named file. It returns UnknownPathError or UnknownLineError if +// there is an error looking up this line. +func (t *Table) LineToPC(file string, line int) (pc uint64, fn *Func, err error) { + obj, ok := t.Files[file] + if !ok { + return 0, nil, UnknownFileError(file) + } + + if t.go12line != nil { + pc := t.go12line.go12LineToPC(file, line) + if pc == 0 { + return 0, nil, &UnknownLineError{file, line} + } + return pc, t.PCToFunc(pc), nil + } + + abs, err := obj.alineFromLine(file, line) + if err != nil { + return + } + for i := range obj.Funcs { + f := &obj.Funcs[i] + pc := f.LineTable.LineToPC(abs, f.End) + if pc != 0 { + return pc, f, nil + } + } + return 0, nil, &UnknownLineError{file, line} +} + +// LookupSym returns the text, data, or bss symbol with the given name, +// or nil if no such symbol is found. +func (t *Table) LookupSym(name string) *Sym { + // TODO(austin) Maybe make a map + for i := range t.Syms { + s := &t.Syms[i] + switch s.Type { + case 'T', 't', 'L', 'l', 'D', 'd', 'B', 'b': + if s.Name == name { + return s + } + } + } + return nil +} + +// LookupFunc returns the text, data, or bss symbol with the given name, +// or nil if no such symbol is found. +func (t *Table) LookupFunc(name string) *Func { + for i := range t.Funcs { + f := &t.Funcs[i] + if f.Sym.Name == name { + return f + } + } + return nil +} + +// SymByAddr returns the text, data, or bss symbol starting at the given address. +func (t *Table) SymByAddr(addr uint64) *Sym { + for i := range t.Syms { + s := &t.Syms[i] + switch s.Type { + case 'T', 't', 'L', 'l', 'D', 'd', 'B', 'b': + if s.Value == addr { + return s + } + } + } + return nil +} + +/* + * Object files + */ + +// This is legacy code for Go 1.1 and earlier, which used the +// Plan 9 format for pc-line tables. This code was never quite +// correct. It's probably very close, and it's usually correct, but +// we never quite found all the corner cases. +// +// Go 1.2 and later use a simpler format, documented at golang.org/s/go12symtab. + +func (o *Obj) lineFromAline(aline int) (string, int) { + type stackEnt struct { + path string + start int + offset int + prev *stackEnt + } + + noPath := &stackEnt{"", 0, 0, nil} + tos := noPath + +pathloop: + for _, s := range o.Paths { + val := int(s.Value) + switch { + case val > aline: + break pathloop + + case val == 1: + // Start a new stack + tos = &stackEnt{s.Name, val, 0, noPath} + + case s.Name == "": + // Pop + if tos == noPath { + return "", 0 + } + tos.prev.offset += val - tos.start + tos = tos.prev + + default: + // Push + tos = &stackEnt{s.Name, val, 0, tos} + } + } + + if tos == noPath { + return "", 0 + } + return tos.path, aline - tos.start - tos.offset + 1 +} + +func (o *Obj) alineFromLine(path string, line int) (int, error) { + if line < 1 { + return 0, &UnknownLineError{path, line} + } + + for i, s := range o.Paths { + // Find this path + if s.Name != path { + continue + } + + // Find this line at this stack level + depth := 0 + var incstart int + line += int(s.Value) + pathloop: + for _, s := range o.Paths[i:] { + val := int(s.Value) + switch { + case depth == 1 && val >= line: + return line - 1, nil + + case s.Name == "": + depth-- + if depth == 0 { + break pathloop + } else if depth == 1 { + line += val - incstart + } + + default: + if depth == 1 { + incstart = val + } + depth++ + } + } + return 0, &UnknownLineError{path, line} + } + return 0, UnknownFileError(path) +} + +/* + * Errors + */ + +// UnknownFileError represents a failure to find the specific file in +// the symbol table. +type UnknownFileError string + +func (e UnknownFileError) Error() string { return "unknown file: " + string(e) } + +// UnknownLineError represents a failure to map a line to a program +// counter, either because the line is beyond the bounds of the file +// or because there is no code on the given line. +type UnknownLineError struct { + File string + Line int +} + +func (e *UnknownLineError) Error() string { + return "no code at " + e.File + ":" + strconv.Itoa(e.Line) +} + +// DecodingError represents an error during the decoding of +// the symbol table. +type DecodingError struct { + off int + msg string + val interface{} +} + +func (e *DecodingError) Error() string { + msg := e.msg + if e.val != nil { + msg += fmt.Sprintf(" '%v'", e.val) + } + msg += fmt.Sprintf(" at byte %#x", e.off) + return msg +} diff --git a/src/debug/macho/fat.go b/src/debug/macho/fat.go new file mode 100644 index 0000000000000000000000000000000000000000..93b8315263cc9217365e5beefdb46cf10bf348ed --- /dev/null +++ b/src/debug/macho/fat.go @@ -0,0 +1,146 @@ +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package macho + +import ( + "encoding/binary" + "fmt" + "io" + "os" +) + +// A FatFile is a Mach-O universal binary that contains at least one architecture. +type FatFile struct { + Magic uint32 + Arches []FatArch + closer io.Closer +} + +// A FatArchHeader represents a fat header for a specific image architecture. +type FatArchHeader struct { + Cpu Cpu + SubCpu uint32 + Offset uint32 + Size uint32 + Align uint32 +} + +const fatArchHeaderSize = 5 * 4 + +// A FatArch is a Mach-O File inside a FatFile. +type FatArch struct { + FatArchHeader + *File +} + +// ErrNotFat is returned from NewFatFile or OpenFat when the file is not a +// universal binary but may be a thin binary, based on its magic number. +var ErrNotFat = &FormatError{0, "not a fat Mach-O file", nil} + +// NewFatFile creates a new FatFile for accessing all the Mach-O images in a +// universal binary. The Mach-O binary is expected to start at position 0 in +// the ReaderAt. +func NewFatFile(r io.ReaderAt) (*FatFile, error) { + var ff FatFile + sr := io.NewSectionReader(r, 0, 1<<63-1) + + // Read the fat_header struct, which is always in big endian. + // Start with the magic number. + err := binary.Read(sr, binary.BigEndian, &ff.Magic) + if err != nil { + return nil, &FormatError{0, "error reading magic number", nil} + } else if ff.Magic != MagicFat { + // See if this is a Mach-O file via its magic number. The magic + // must be converted to little endian first though. + var buf [4]byte + binary.BigEndian.PutUint32(buf[:], ff.Magic) + leMagic := binary.LittleEndian.Uint32(buf[:]) + if leMagic == Magic32 || leMagic == Magic64 { + return nil, ErrNotFat + } else { + return nil, &FormatError{0, "invalid magic number", nil} + } + } + offset := int64(4) + + // Read the number of FatArchHeaders that come after the fat_header. + var narch uint32 + err = binary.Read(sr, binary.BigEndian, &narch) + if err != nil { + return nil, &FormatError{offset, "invalid fat_header", nil} + } + offset += 4 + + if narch < 1 { + return nil, &FormatError{offset, "file contains no images", nil} + } + + // Combine the Cpu and SubCpu (both uint32) into a uint64 to make sure + // there are not duplicate architectures. + seenArches := make(map[uint64]bool, narch) + // Make sure that all images are for the same MH_ type. + var machoType Type + + // Following the fat_header comes narch fat_arch structs that index + // Mach-O images further in the file. + ff.Arches = make([]FatArch, narch) + for i := uint32(0); i < narch; i++ { + fa := &ff.Arches[i] + err = binary.Read(sr, binary.BigEndian, &fa.FatArchHeader) + if err != nil { + return nil, &FormatError{offset, "invalid fat_arch header", nil} + } + offset += fatArchHeaderSize + + fr := io.NewSectionReader(r, int64(fa.Offset), int64(fa.Size)) + fa.File, err = NewFile(fr) + if err != nil { + return nil, err + } + + // Make sure the architecture for this image is not duplicate. + seenArch := (uint64(fa.Cpu) << 32) | uint64(fa.SubCpu) + if o, k := seenArches[seenArch]; o || k { + return nil, &FormatError{offset, fmt.Sprintf("duplicate architecture cpu=%v, subcpu=%#x", fa.Cpu, fa.SubCpu), nil} + } + seenArches[seenArch] = true + + // Make sure the Mach-O type matches that of the first image. + if i == 0 { + machoType = fa.Type + } else { + if fa.Type != machoType { + return nil, &FormatError{offset, fmt.Sprintf("Mach-O type for architecture #%d (type=%#x) does not match first (type=%#x)", i, fa.Type, machoType), nil} + } + } + } + + return &ff, nil +} + +// OpenFat opens the named file using os.Open and prepares it for use as a Mach-O +// universal binary. +func OpenFat(name string) (ff *FatFile, err error) { + f, err := os.Open(name) + if err != nil { + return nil, err + } + ff, err = NewFatFile(f) + if err != nil { + f.Close() + return nil, err + } + ff.closer = f + return +} + +func (ff *FatFile) Close() error { + var err error + if ff.closer != nil { + err = ff.closer.Close() + ff.closer = nil + } + return err +} diff --git a/src/debug/macho/file.go b/src/debug/macho/file.go new file mode 100644 index 0000000000000000000000000000000000000000..a7599aa5b2b13922956259a62ecaab5e28207387 --- /dev/null +++ b/src/debug/macho/file.go @@ -0,0 +1,524 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package macho implements access to Mach-O object files. +package macho + +// High level access to low level data structures. + +import ( + "bytes" + "debug/dwarf" + "encoding/binary" + "fmt" + "io" + "os" +) + +// A File represents an open Mach-O file. +type File struct { + FileHeader + ByteOrder binary.ByteOrder + Loads []Load + Sections []*Section + + Symtab *Symtab + Dysymtab *Dysymtab + + closer io.Closer +} + +// A Load represents any Mach-O load command. +type Load interface { + Raw() []byte +} + +// A LoadBytes is the uninterpreted bytes of a Mach-O load command. +type LoadBytes []byte + +func (b LoadBytes) Raw() []byte { return b } + +// A SegmentHeader is the header for a Mach-O 32-bit or 64-bit load segment command. +type SegmentHeader struct { + Cmd LoadCmd + Len uint32 + Name string + Addr uint64 + Memsz uint64 + Offset uint64 + Filesz uint64 + Maxprot uint32 + Prot uint32 + Nsect uint32 + Flag uint32 +} + +// A Segment represents a Mach-O 32-bit or 64-bit load segment command. +type Segment struct { + LoadBytes + SegmentHeader + + // Embed ReaderAt for ReadAt method. + // Do not embed SectionReader directly + // to avoid having Read and Seek. + // If a client wants Read and Seek it must use + // Open() to avoid fighting over the seek offset + // with other clients. + io.ReaderAt + sr *io.SectionReader +} + +// Data reads and returns the contents of the segment. +func (s *Segment) Data() ([]byte, error) { + dat := make([]byte, s.sr.Size()) + n, err := s.sr.ReadAt(dat, 0) + if n == len(dat) { + err = nil + } + return dat[0:n], err +} + +// Open returns a new ReadSeeker reading the segment. +func (s *Segment) Open() io.ReadSeeker { return io.NewSectionReader(s.sr, 0, 1<<63-1) } + +type SectionHeader struct { + Name string + Seg string + Addr uint64 + Size uint64 + Offset uint32 + Align uint32 + Reloff uint32 + Nreloc uint32 + Flags uint32 +} + +type Section struct { + SectionHeader + + // Embed ReaderAt for ReadAt method. + // Do not embed SectionReader directly + // to avoid having Read and Seek. + // If a client wants Read and Seek it must use + // Open() to avoid fighting over the seek offset + // with other clients. + io.ReaderAt + sr *io.SectionReader +} + +// Data reads and returns the contents of the Mach-O section. +func (s *Section) Data() ([]byte, error) { + dat := make([]byte, s.sr.Size()) + n, err := s.sr.ReadAt(dat, 0) + if n == len(dat) { + err = nil + } + return dat[0:n], err +} + +// Open returns a new ReadSeeker reading the Mach-O section. +func (s *Section) Open() io.ReadSeeker { return io.NewSectionReader(s.sr, 0, 1<<63-1) } + +// A Dylib represents a Mach-O load dynamic library command. +type Dylib struct { + LoadBytes + Name string + Time uint32 + CurrentVersion uint32 + CompatVersion uint32 +} + +// A Symtab represents a Mach-O symbol table command. +type Symtab struct { + LoadBytes + SymtabCmd + Syms []Symbol +} + +// A Dysymtab represents a Mach-O dynamic symbol table command. +type Dysymtab struct { + LoadBytes + DysymtabCmd + IndirectSyms []uint32 // indices into Symtab.Syms +} + +/* + * Mach-O reader + */ + +// FormatError is returned by some operations if the data does +// not have the correct format for an object file. +type FormatError struct { + off int64 + msg string + val interface{} +} + +func (e *FormatError) Error() string { + msg := e.msg + if e.val != nil { + msg += fmt.Sprintf(" '%v'", e.val) + } + msg += fmt.Sprintf(" in record at byte %#x", e.off) + return msg +} + +// Open opens the named file using os.Open and prepares it for use as a Mach-O binary. +func Open(name string) (*File, error) { + f, err := os.Open(name) + if err != nil { + return nil, err + } + ff, err := NewFile(f) + if err != nil { + f.Close() + return nil, err + } + ff.closer = f + return ff, nil +} + +// Close closes the File. +// If the File was created using NewFile directly instead of Open, +// Close has no effect. +func (f *File) Close() error { + var err error + if f.closer != nil { + err = f.closer.Close() + f.closer = nil + } + return err +} + +// NewFile creates a new File for accessing a Mach-O binary in an underlying reader. +// The Mach-O binary is expected to start at position 0 in the ReaderAt. +func NewFile(r io.ReaderAt) (*File, error) { + f := new(File) + sr := io.NewSectionReader(r, 0, 1<<63-1) + + // Read and decode Mach magic to determine byte order, size. + // Magic32 and Magic64 differ only in the bottom bit. + var ident [4]byte + if _, err := r.ReadAt(ident[0:], 0); err != nil { + return nil, err + } + be := binary.BigEndian.Uint32(ident[0:]) + le := binary.LittleEndian.Uint32(ident[0:]) + switch Magic32 &^ 1 { + case be &^ 1: + f.ByteOrder = binary.BigEndian + f.Magic = be + case le &^ 1: + f.ByteOrder = binary.LittleEndian + f.Magic = le + default: + return nil, &FormatError{0, "invalid magic number", nil} + } + + // Read entire file header. + if err := binary.Read(sr, f.ByteOrder, &f.FileHeader); err != nil { + return nil, err + } + + // Then load commands. + offset := int64(fileHeaderSize32) + if f.Magic == Magic64 { + offset = fileHeaderSize64 + } + dat := make([]byte, f.Cmdsz) + if _, err := r.ReadAt(dat, offset); err != nil { + return nil, err + } + f.Loads = make([]Load, f.Ncmd) + bo := f.ByteOrder + for i := range f.Loads { + // Each load command begins with uint32 command and length. + if len(dat) < 8 { + return nil, &FormatError{offset, "command block too small", nil} + } + cmd, siz := LoadCmd(bo.Uint32(dat[0:4])), bo.Uint32(dat[4:8]) + if siz < 8 || siz > uint32(len(dat)) { + return nil, &FormatError{offset, "invalid command block size", nil} + } + var cmddat []byte + cmddat, dat = dat[0:siz], dat[siz:] + offset += int64(siz) + var s *Segment + switch cmd { + default: + f.Loads[i] = LoadBytes(cmddat) + + case LoadCmdDylib: + var hdr DylibCmd + b := bytes.NewReader(cmddat) + if err := binary.Read(b, bo, &hdr); err != nil { + return nil, err + } + l := new(Dylib) + if hdr.Name >= uint32(len(cmddat)) { + return nil, &FormatError{offset, "invalid name in dynamic library command", hdr.Name} + } + l.Name = cstring(cmddat[hdr.Name:]) + l.Time = hdr.Time + l.CurrentVersion = hdr.CurrentVersion + l.CompatVersion = hdr.CompatVersion + l.LoadBytes = LoadBytes(cmddat) + f.Loads[i] = l + + case LoadCmdSymtab: + var hdr SymtabCmd + b := bytes.NewReader(cmddat) + if err := binary.Read(b, bo, &hdr); err != nil { + return nil, err + } + strtab := make([]byte, hdr.Strsize) + if _, err := r.ReadAt(strtab, int64(hdr.Stroff)); err != nil { + return nil, err + } + var symsz int + if f.Magic == Magic64 { + symsz = 16 + } else { + symsz = 12 + } + symdat := make([]byte, int(hdr.Nsyms)*symsz) + if _, err := r.ReadAt(symdat, int64(hdr.Symoff)); err != nil { + return nil, err + } + st, err := f.parseSymtab(symdat, strtab, cmddat, &hdr, offset) + if err != nil { + return nil, err + } + f.Loads[i] = st + f.Symtab = st + + case LoadCmdDysymtab: + var hdr DysymtabCmd + b := bytes.NewReader(cmddat) + if err := binary.Read(b, bo, &hdr); err != nil { + return nil, err + } + dat := make([]byte, hdr.Nindirectsyms*4) + if _, err := r.ReadAt(dat, int64(hdr.Indirectsymoff)); err != nil { + return nil, err + } + x := make([]uint32, hdr.Nindirectsyms) + if err := binary.Read(bytes.NewReader(dat), bo, x); err != nil { + return nil, err + } + st := new(Dysymtab) + st.LoadBytes = LoadBytes(cmddat) + st.DysymtabCmd = hdr + st.IndirectSyms = x + f.Loads[i] = st + f.Dysymtab = st + + case LoadCmdSegment: + var seg32 Segment32 + b := bytes.NewReader(cmddat) + if err := binary.Read(b, bo, &seg32); err != nil { + return nil, err + } + s = new(Segment) + s.LoadBytes = cmddat + s.Cmd = cmd + s.Len = siz + s.Name = cstring(seg32.Name[0:]) + s.Addr = uint64(seg32.Addr) + s.Memsz = uint64(seg32.Memsz) + s.Offset = uint64(seg32.Offset) + s.Filesz = uint64(seg32.Filesz) + s.Maxprot = seg32.Maxprot + s.Prot = seg32.Prot + s.Nsect = seg32.Nsect + s.Flag = seg32.Flag + f.Loads[i] = s + for i := 0; i < int(s.Nsect); i++ { + var sh32 Section32 + if err := binary.Read(b, bo, &sh32); err != nil { + return nil, err + } + sh := new(Section) + sh.Name = cstring(sh32.Name[0:]) + sh.Seg = cstring(sh32.Seg[0:]) + sh.Addr = uint64(sh32.Addr) + sh.Size = uint64(sh32.Size) + sh.Offset = sh32.Offset + sh.Align = sh32.Align + sh.Reloff = sh32.Reloff + sh.Nreloc = sh32.Nreloc + sh.Flags = sh32.Flags + f.pushSection(sh, r) + } + + case LoadCmdSegment64: + var seg64 Segment64 + b := bytes.NewReader(cmddat) + if err := binary.Read(b, bo, &seg64); err != nil { + return nil, err + } + s = new(Segment) + s.LoadBytes = cmddat + s.Cmd = cmd + s.Len = siz + s.Name = cstring(seg64.Name[0:]) + s.Addr = seg64.Addr + s.Memsz = seg64.Memsz + s.Offset = seg64.Offset + s.Filesz = seg64.Filesz + s.Maxprot = seg64.Maxprot + s.Prot = seg64.Prot + s.Nsect = seg64.Nsect + s.Flag = seg64.Flag + f.Loads[i] = s + for i := 0; i < int(s.Nsect); i++ { + var sh64 Section64 + if err := binary.Read(b, bo, &sh64); err != nil { + return nil, err + } + sh := new(Section) + sh.Name = cstring(sh64.Name[0:]) + sh.Seg = cstring(sh64.Seg[0:]) + sh.Addr = sh64.Addr + sh.Size = sh64.Size + sh.Offset = sh64.Offset + sh.Align = sh64.Align + sh.Reloff = sh64.Reloff + sh.Nreloc = sh64.Nreloc + sh.Flags = sh64.Flags + f.pushSection(sh, r) + } + } + if s != nil { + s.sr = io.NewSectionReader(r, int64(s.Offset), int64(s.Filesz)) + s.ReaderAt = s.sr + } + } + return f, nil +} + +func (f *File) parseSymtab(symdat, strtab, cmddat []byte, hdr *SymtabCmd, offset int64) (*Symtab, error) { + bo := f.ByteOrder + symtab := make([]Symbol, hdr.Nsyms) + b := bytes.NewReader(symdat) + for i := range symtab { + var n Nlist64 + if f.Magic == Magic64 { + if err := binary.Read(b, bo, &n); err != nil { + return nil, err + } + } else { + var n32 Nlist32 + if err := binary.Read(b, bo, &n32); err != nil { + return nil, err + } + n.Name = n32.Name + n.Type = n32.Type + n.Sect = n32.Sect + n.Desc = n32.Desc + n.Value = uint64(n32.Value) + } + sym := &symtab[i] + if n.Name >= uint32(len(strtab)) { + return nil, &FormatError{offset, "invalid name in symbol table", n.Name} + } + sym.Name = cstring(strtab[n.Name:]) + sym.Type = n.Type + sym.Sect = n.Sect + sym.Desc = n.Desc + sym.Value = n.Value + } + st := new(Symtab) + st.LoadBytes = LoadBytes(cmddat) + st.Syms = symtab + return st, nil +} + +func (f *File) pushSection(sh *Section, r io.ReaderAt) { + f.Sections = append(f.Sections, sh) + sh.sr = io.NewSectionReader(r, int64(sh.Offset), int64(sh.Size)) + sh.ReaderAt = sh.sr +} + +func cstring(b []byte) string { + var i int + for i = 0; i < len(b) && b[i] != 0; i++ { + } + return string(b[0:i]) +} + +// Segment returns the first Segment with the given name, or nil if no such segment exists. +func (f *File) Segment(name string) *Segment { + for _, l := range f.Loads { + if s, ok := l.(*Segment); ok && s.Name == name { + return s + } + } + return nil +} + +// Section returns the first section with the given name, or nil if no such +// section exists. +func (f *File) Section(name string) *Section { + for _, s := range f.Sections { + if s.Name == name { + return s + } + } + return nil +} + +// DWARF returns the DWARF debug information for the Mach-O file. +func (f *File) DWARF() (*dwarf.Data, error) { + // There are many other DWARF sections, but these + // are the ones the debug/dwarf package uses. + // Don't bother loading others. + var names = [...]string{"abbrev", "info", "line", "str"} + var dat [len(names)][]byte + for i, name := range names { + name = "__debug_" + name + s := f.Section(name) + if s == nil { + continue + } + b, err := s.Data() + if err != nil && uint64(len(b)) < s.Size { + return nil, err + } + dat[i] = b + } + + abbrev, info, line, str := dat[0], dat[1], dat[2], dat[3] + return dwarf.New(abbrev, nil, nil, info, line, nil, nil, str) +} + +// ImportedSymbols returns the names of all symbols +// referred to by the binary f that are expected to be +// satisfied by other libraries at dynamic load time. +func (f *File) ImportedSymbols() ([]string, error) { + if f.Dysymtab == nil || f.Symtab == nil { + return nil, &FormatError{0, "missing symbol table", nil} + } + + st := f.Symtab + dt := f.Dysymtab + var all []string + for _, s := range st.Syms[dt.Iundefsym : dt.Iundefsym+dt.Nundefsym] { + all = append(all, s.Name) + } + return all, nil +} + +// ImportedLibraries returns the paths of all libraries +// referred to by the binary f that are expected to be +// linked with the binary at dynamic link time. +func (f *File) ImportedLibraries() ([]string, error) { + var all []string + for _, l := range f.Loads { + if lib, ok := l.(*Dylib); ok { + all = append(all, lib.Name) + } + } + return all, nil +} diff --git a/src/debug/macho/file_test.go b/src/debug/macho/file_test.go new file mode 100644 index 0000000000000000000000000000000000000000..4797780ce77918173d954c1c57ad4f8f59ba2f52 --- /dev/null +++ b/src/debug/macho/file_test.go @@ -0,0 +1,210 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package macho + +import ( + "reflect" + "testing" +) + +type fileTest struct { + file string + hdr FileHeader + segments []*SegmentHeader + sections []*SectionHeader +} + +var fileTests = []fileTest{ + { + "testdata/gcc-386-darwin-exec", + FileHeader{0xfeedface, Cpu386, 0x3, 0x2, 0xc, 0x3c0, 0x85}, + []*SegmentHeader{ + {LoadCmdSegment, 0x38, "__PAGEZERO", 0x0, 0x1000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, + {LoadCmdSegment, 0xc0, "__TEXT", 0x1000, 0x1000, 0x0, 0x1000, 0x7, 0x5, 0x2, 0x0}, + {LoadCmdSegment, 0xc0, "__DATA", 0x2000, 0x1000, 0x1000, 0x1000, 0x7, 0x3, 0x2, 0x0}, + {LoadCmdSegment, 0x7c, "__IMPORT", 0x3000, 0x1000, 0x2000, 0x1000, 0x7, 0x7, 0x1, 0x0}, + {LoadCmdSegment, 0x38, "__LINKEDIT", 0x4000, 0x1000, 0x3000, 0x12c, 0x7, 0x1, 0x0, 0x0}, + nil, + nil, + nil, + nil, + nil, + nil, + nil, + }, + []*SectionHeader{ + {"__text", "__TEXT", 0x1f68, 0x88, 0xf68, 0x2, 0x0, 0x0, 0x80000400}, + {"__cstring", "__TEXT", 0x1ff0, 0xd, 0xff0, 0x0, 0x0, 0x0, 0x2}, + {"__data", "__DATA", 0x2000, 0x14, 0x1000, 0x2, 0x0, 0x0, 0x0}, + {"__dyld", "__DATA", 0x2014, 0x1c, 0x1014, 0x2, 0x0, 0x0, 0x0}, + {"__jump_table", "__IMPORT", 0x3000, 0xa, 0x2000, 0x6, 0x0, 0x0, 0x4000008}, + }, + }, + { + "testdata/gcc-amd64-darwin-exec", + FileHeader{0xfeedfacf, CpuAmd64, 0x80000003, 0x2, 0xb, 0x568, 0x85}, + []*SegmentHeader{ + {LoadCmdSegment64, 0x48, "__PAGEZERO", 0x0, 0x100000000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, + {LoadCmdSegment64, 0x1d8, "__TEXT", 0x100000000, 0x1000, 0x0, 0x1000, 0x7, 0x5, 0x5, 0x0}, + {LoadCmdSegment64, 0x138, "__DATA", 0x100001000, 0x1000, 0x1000, 0x1000, 0x7, 0x3, 0x3, 0x0}, + {LoadCmdSegment64, 0x48, "__LINKEDIT", 0x100002000, 0x1000, 0x2000, 0x140, 0x7, 0x1, 0x0, 0x0}, + nil, + nil, + nil, + nil, + nil, + nil, + nil, + }, + []*SectionHeader{ + {"__text", "__TEXT", 0x100000f14, 0x6d, 0xf14, 0x2, 0x0, 0x0, 0x80000400}, + {"__symbol_stub1", "__TEXT", 0x100000f81, 0xc, 0xf81, 0x0, 0x0, 0x0, 0x80000408}, + {"__stub_helper", "__TEXT", 0x100000f90, 0x18, 0xf90, 0x2, 0x0, 0x0, 0x0}, + {"__cstring", "__TEXT", 0x100000fa8, 0xd, 0xfa8, 0x0, 0x0, 0x0, 0x2}, + {"__eh_frame", "__TEXT", 0x100000fb8, 0x48, 0xfb8, 0x3, 0x0, 0x0, 0x6000000b}, + {"__data", "__DATA", 0x100001000, 0x1c, 0x1000, 0x3, 0x0, 0x0, 0x0}, + {"__dyld", "__DATA", 0x100001020, 0x38, 0x1020, 0x3, 0x0, 0x0, 0x0}, + {"__la_symbol_ptr", "__DATA", 0x100001058, 0x10, 0x1058, 0x2, 0x0, 0x0, 0x7}, + }, + }, + { + "testdata/gcc-amd64-darwin-exec-debug", + FileHeader{0xfeedfacf, CpuAmd64, 0x80000003, 0xa, 0x4, 0x5a0, 0}, + []*SegmentHeader{ + nil, + {LoadCmdSegment64, 0x1d8, "__TEXT", 0x100000000, 0x1000, 0x0, 0x0, 0x7, 0x5, 0x5, 0x0}, + {LoadCmdSegment64, 0x138, "__DATA", 0x100001000, 0x1000, 0x0, 0x0, 0x7, 0x3, 0x3, 0x0}, + {LoadCmdSegment64, 0x278, "__DWARF", 0x100002000, 0x1000, 0x1000, 0x1bc, 0x7, 0x3, 0x7, 0x0}, + }, + []*SectionHeader{ + {"__text", "__TEXT", 0x100000f14, 0x0, 0x0, 0x2, 0x0, 0x0, 0x80000400}, + {"__symbol_stub1", "__TEXT", 0x100000f81, 0x0, 0x0, 0x0, 0x0, 0x0, 0x80000408}, + {"__stub_helper", "__TEXT", 0x100000f90, 0x0, 0x0, 0x2, 0x0, 0x0, 0x0}, + {"__cstring", "__TEXT", 0x100000fa8, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2}, + {"__eh_frame", "__TEXT", 0x100000fb8, 0x0, 0x0, 0x3, 0x0, 0x0, 0x6000000b}, + {"__data", "__DATA", 0x100001000, 0x0, 0x0, 0x3, 0x0, 0x0, 0x0}, + {"__dyld", "__DATA", 0x100001020, 0x0, 0x0, 0x3, 0x0, 0x0, 0x0}, + {"__la_symbol_ptr", "__DATA", 0x100001058, 0x0, 0x0, 0x2, 0x0, 0x0, 0x7}, + {"__debug_abbrev", "__DWARF", 0x100002000, 0x36, 0x1000, 0x0, 0x0, 0x0, 0x0}, + {"__debug_aranges", "__DWARF", 0x100002036, 0x30, 0x1036, 0x0, 0x0, 0x0, 0x0}, + {"__debug_frame", "__DWARF", 0x100002066, 0x40, 0x1066, 0x0, 0x0, 0x0, 0x0}, + {"__debug_info", "__DWARF", 0x1000020a6, 0x54, 0x10a6, 0x0, 0x0, 0x0, 0x0}, + {"__debug_line", "__DWARF", 0x1000020fa, 0x47, 0x10fa, 0x0, 0x0, 0x0, 0x0}, + {"__debug_pubnames", "__DWARF", 0x100002141, 0x1b, 0x1141, 0x0, 0x0, 0x0, 0x0}, + {"__debug_str", "__DWARF", 0x10000215c, 0x60, 0x115c, 0x0, 0x0, 0x0, 0x0}, + }, + }, +} + +func TestOpen(t *testing.T) { + for i := range fileTests { + tt := &fileTests[i] + + f, err := Open(tt.file) + if err != nil { + t.Error(err) + continue + } + if !reflect.DeepEqual(f.FileHeader, tt.hdr) { + t.Errorf("open %s:\n\thave %#v\n\twant %#v\n", tt.file, f.FileHeader, tt.hdr) + continue + } + for i, l := range f.Loads { + if i >= len(tt.segments) { + break + } + sh := tt.segments[i] + s, ok := l.(*Segment) + if sh == nil { + if ok { + t.Errorf("open %s, section %d: skipping %#v\n", tt.file, i, &s.SegmentHeader) + } + continue + } + if !ok { + t.Errorf("open %s, section %d: not *Segment\n", tt.file, i) + continue + } + have := &s.SegmentHeader + want := sh + if !reflect.DeepEqual(have, want) { + t.Errorf("open %s, segment %d:\n\thave %#v\n\twant %#v\n", tt.file, i, have, want) + } + } + tn := len(tt.segments) + fn := len(f.Loads) + if tn != fn { + t.Errorf("open %s: len(Loads) = %d, want %d", tt.file, fn, tn) + } + + for i, sh := range f.Sections { + if i >= len(tt.sections) { + break + } + have := &sh.SectionHeader + want := tt.sections[i] + if !reflect.DeepEqual(have, want) { + t.Errorf("open %s, section %d:\n\thave %#v\n\twant %#v\n", tt.file, i, have, want) + } + } + tn = len(tt.sections) + fn = len(f.Sections) + if tn != fn { + t.Errorf("open %s: len(Sections) = %d, want %d", tt.file, fn, tn) + } + + } +} + +func TestOpenFailure(t *testing.T) { + filename := "file.go" // not a Mach-O file + _, err := Open(filename) // don't crash + if err == nil { + t.Errorf("open %s: succeeded unexpectedly", filename) + } +} + +func TestOpenFat(t *testing.T) { + ff, err := OpenFat("testdata/fat-gcc-386-amd64-darwin-exec") + if err != nil { + t.Fatal(err) + } + + if ff.Magic != MagicFat { + t.Errorf("OpenFat: got magic number %#x, want %#x", ff.Magic, MagicFat) + } + if len(ff.Arches) != 2 { + t.Errorf("OpenFat: got %d architectures, want 2", len(ff.Arches)) + } + + for i := range ff.Arches { + arch := &ff.Arches[i] + ftArch := &fileTests[i] + + if arch.Cpu != ftArch.hdr.Cpu || arch.SubCpu != ftArch.hdr.SubCpu { + t.Errorf("OpenFat: architecture #%d got cpu=%#x subtype=%#x, expected cpu=%#x, subtype=%#x", i, arch.Cpu, arch.SubCpu, ftArch.hdr.Cpu, ftArch.hdr.SubCpu) + } + + if !reflect.DeepEqual(arch.FileHeader, ftArch.hdr) { + t.Errorf("OpenFat header:\n\tgot %#v\n\twant %#v\n", arch.FileHeader, ftArch.hdr) + } + } +} + +func TestOpenFatFailure(t *testing.T) { + filename := "file.go" // not a Mach-O file + if _, err := OpenFat(filename); err == nil { + t.Errorf("OpenFat %s: succeeded unexpectedly", filename) + } + + filename = "testdata/gcc-386-darwin-exec" // not a fat Mach-O + ff, err := OpenFat(filename) + if err != ErrNotFat { + t.Errorf("OpenFat %s: got %v, want ErrNotFat", filename, err) + } + if ff != nil { + t.Errorf("OpenFat %s: got %v, want nil", filename, ff) + } +} diff --git a/src/debug/macho/macho.go b/src/debug/macho/macho.go new file mode 100644 index 0000000000000000000000000000000000000000..d9678c8eda40887342c1aaa48043b36da597a45b --- /dev/null +++ b/src/debug/macho/macho.go @@ -0,0 +1,316 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Mach-O header data structures +// http://developer.apple.com/mac/library/documentation/DeveloperTools/Conceptual/MachORuntime/Reference/reference.html + +package macho + +import "strconv" + +// A FileHeader represents a Mach-O file header. +type FileHeader struct { + Magic uint32 + Cpu Cpu + SubCpu uint32 + Type Type + Ncmd uint32 + Cmdsz uint32 + Flags uint32 +} + +const ( + fileHeaderSize32 = 7 * 4 + fileHeaderSize64 = 8 * 4 +) + +const ( + Magic32 uint32 = 0xfeedface + Magic64 uint32 = 0xfeedfacf + MagicFat uint32 = 0xcafebabe +) + +// A Type is the Mach-O file type, e.g. an object file, executable, or dynamic library. +type Type uint32 + +const ( + TypeObj Type = 1 + TypeExec Type = 2 + TypeDylib Type = 6 + TypeBundle Type = 8 +) + +// A Cpu is a Mach-O cpu type. +type Cpu uint32 + +const cpuArch64 = 0x01000000 + +const ( + Cpu386 Cpu = 7 + CpuAmd64 Cpu = Cpu386 | cpuArch64 + CpuArm Cpu = 12 + CpuPpc Cpu = 18 + CpuPpc64 Cpu = CpuPpc | cpuArch64 +) + +var cpuStrings = []intName{ + {uint32(Cpu386), "Cpu386"}, + {uint32(CpuAmd64), "CpuAmd64"}, + {uint32(CpuArm), "CpuArm"}, + {uint32(CpuPpc), "CpuPpc"}, + {uint32(CpuPpc64), "CpuPpc64"}, +} + +func (i Cpu) String() string { return stringName(uint32(i), cpuStrings, false) } +func (i Cpu) GoString() string { return stringName(uint32(i), cpuStrings, true) } + +// A LoadCmd is a Mach-O load command. +type LoadCmd uint32 + +const ( + LoadCmdSegment LoadCmd = 1 + LoadCmdSymtab LoadCmd = 2 + LoadCmdThread LoadCmd = 4 + LoadCmdUnixThread LoadCmd = 5 // thread+stack + LoadCmdDysymtab LoadCmd = 11 + LoadCmdDylib LoadCmd = 12 + LoadCmdDylinker LoadCmd = 15 + LoadCmdSegment64 LoadCmd = 25 +) + +var cmdStrings = []intName{ + {uint32(LoadCmdSegment), "LoadCmdSegment"}, + {uint32(LoadCmdThread), "LoadCmdThread"}, + {uint32(LoadCmdUnixThread), "LoadCmdUnixThread"}, + {uint32(LoadCmdDylib), "LoadCmdDylib"}, + {uint32(LoadCmdSegment64), "LoadCmdSegment64"}, +} + +func (i LoadCmd) String() string { return stringName(uint32(i), cmdStrings, false) } +func (i LoadCmd) GoString() string { return stringName(uint32(i), cmdStrings, true) } + +// A Segment64 is a 64-bit Mach-O segment load command. +type Segment64 struct { + Cmd LoadCmd + Len uint32 + Name [16]byte + Addr uint64 + Memsz uint64 + Offset uint64 + Filesz uint64 + Maxprot uint32 + Prot uint32 + Nsect uint32 + Flag uint32 +} + +// A Segment32 is a 32-bit Mach-O segment load command. +type Segment32 struct { + Cmd LoadCmd + Len uint32 + Name [16]byte + Addr uint32 + Memsz uint32 + Offset uint32 + Filesz uint32 + Maxprot uint32 + Prot uint32 + Nsect uint32 + Flag uint32 +} + +// A DylibCmd is a Mach-O load dynamic library command. +type DylibCmd struct { + Cmd LoadCmd + Len uint32 + Name uint32 + Time uint32 + CurrentVersion uint32 + CompatVersion uint32 +} + +// A Section32 is a 32-bit Mach-O section header. +type Section32 struct { + Name [16]byte + Seg [16]byte + Addr uint32 + Size uint32 + Offset uint32 + Align uint32 + Reloff uint32 + Nreloc uint32 + Flags uint32 + Reserve1 uint32 + Reserve2 uint32 +} + +// A Section32 is a 64-bit Mach-O section header. +type Section64 struct { + Name [16]byte + Seg [16]byte + Addr uint64 + Size uint64 + Offset uint32 + Align uint32 + Reloff uint32 + Nreloc uint32 + Flags uint32 + Reserve1 uint32 + Reserve2 uint32 + Reserve3 uint32 +} + +// A SymtabCmd is a Mach-O symbol table command. +type SymtabCmd struct { + Cmd LoadCmd + Len uint32 + Symoff uint32 + Nsyms uint32 + Stroff uint32 + Strsize uint32 +} + +// A DysymtabCmd is a Mach-O dynamic symbol table command. +type DysymtabCmd struct { + Cmd LoadCmd + Len uint32 + Ilocalsym uint32 + Nlocalsym uint32 + Iextdefsym uint32 + Nextdefsym uint32 + Iundefsym uint32 + Nundefsym uint32 + Tocoffset uint32 + Ntoc uint32 + Modtaboff uint32 + Nmodtab uint32 + Extrefsymoff uint32 + Nextrefsyms uint32 + Indirectsymoff uint32 + Nindirectsyms uint32 + Extreloff uint32 + Nextrel uint32 + Locreloff uint32 + Nlocrel uint32 +} + +// An Nlist32 is a Mach-O 32-bit symbol table entry. +type Nlist32 struct { + Name uint32 + Type uint8 + Sect uint8 + Desc uint16 + Value uint32 +} + +// An Nlist64 is a Mach-O 64-bit symbol table entry. +type Nlist64 struct { + Name uint32 + Type uint8 + Sect uint8 + Desc uint16 + Value uint64 +} + +// A Symbol is a Mach-O 32-bit or 64-bit symbol table entry. +type Symbol struct { + Name string + Type uint8 + Sect uint8 + Desc uint16 + Value uint64 +} + +// A Thread is a Mach-O thread state command. +type Thread struct { + Cmd LoadCmd + Len uint32 + Type uint32 + Data []uint32 +} + +// Regs386 is the Mach-O 386 register structure. +type Regs386 struct { + AX uint32 + BX uint32 + CX uint32 + DX uint32 + DI uint32 + SI uint32 + BP uint32 + SP uint32 + SS uint32 + FLAGS uint32 + IP uint32 + CS uint32 + DS uint32 + ES uint32 + FS uint32 + GS uint32 +} + +// RegsAMD64 is the Mach-O AMD64 register structure. +type RegsAMD64 struct { + AX uint64 + BX uint64 + CX uint64 + DX uint64 + DI uint64 + SI uint64 + BP uint64 + SP uint64 + R8 uint64 + R9 uint64 + R10 uint64 + R11 uint64 + R12 uint64 + R13 uint64 + R14 uint64 + R15 uint64 + IP uint64 + FLAGS uint64 + CS uint64 + FS uint64 + GS uint64 +} + +type intName struct { + i uint32 + s string +} + +func stringName(i uint32, names []intName, goSyntax bool) string { + for _, n := range names { + if n.i == i { + if goSyntax { + return "macho." + n.s + } + return n.s + } + } + return strconv.FormatUint(uint64(i), 10) +} + +func flagName(i uint32, names []intName, goSyntax bool) string { + s := "" + for _, n := range names { + if n.i&i == n.i { + if len(s) > 0 { + s += "+" + } + if goSyntax { + s += "macho." + } + s += n.s + i -= n.i + } + } + if len(s) == 0 { + return "0x" + strconv.FormatUint(uint64(i), 16) + } + if i != 0 { + s += "+0x" + strconv.FormatUint(uint64(i), 16) + } + return s +} diff --git a/src/debug/macho/testdata/fat-gcc-386-amd64-darwin-exec b/src/debug/macho/testdata/fat-gcc-386-amd64-darwin-exec new file mode 100644 index 0000000000000000000000000000000000000000..7efd19300b2899328664e0e0314fac011722724b Binary files /dev/null and b/src/debug/macho/testdata/fat-gcc-386-amd64-darwin-exec differ diff --git a/src/debug/macho/testdata/gcc-386-darwin-exec b/src/debug/macho/testdata/gcc-386-darwin-exec new file mode 100755 index 0000000000000000000000000000000000000000..03ba1bafac0a6cba92b72239e51b2a9618668032 Binary files /dev/null and b/src/debug/macho/testdata/gcc-386-darwin-exec differ diff --git a/src/debug/macho/testdata/gcc-amd64-darwin-exec b/src/debug/macho/testdata/gcc-amd64-darwin-exec new file mode 100755 index 0000000000000000000000000000000000000000..5155a5a26f6a7c0d9cf8720e03630f171713f859 Binary files /dev/null and b/src/debug/macho/testdata/gcc-amd64-darwin-exec differ diff --git a/src/debug/macho/testdata/gcc-amd64-darwin-exec-debug b/src/debug/macho/testdata/gcc-amd64-darwin-exec-debug new file mode 100644 index 0000000000000000000000000000000000000000..a47d3aef782a3d69b8d5d3fd4d475ec54cecf006 Binary files /dev/null and b/src/debug/macho/testdata/gcc-amd64-darwin-exec-debug differ diff --git a/src/debug/macho/testdata/hello.c b/src/debug/macho/testdata/hello.c new file mode 100644 index 0000000000000000000000000000000000000000..a689d3644e1e95d9d9cb1f013be6430d90dab71c --- /dev/null +++ b/src/debug/macho/testdata/hello.c @@ -0,0 +1,8 @@ +#include + +int +main(void) +{ + printf("hello, world\n"); + return 0; +} diff --git a/src/debug/pe/file.go b/src/debug/pe/file.go new file mode 100644 index 0000000000000000000000000000000000000000..3df4ae73681e0f56fce796b4fb27640576b8b00e --- /dev/null +++ b/src/debug/pe/file.go @@ -0,0 +1,397 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package pe implements access to PE (Microsoft Windows Portable Executable) files. +package pe + +import ( + "debug/dwarf" + "encoding/binary" + "errors" + "fmt" + "io" + "os" + "strconv" +) + +// A File represents an open PE file. +type File struct { + FileHeader + OptionalHeader interface{} // of type *OptionalHeader32 or *OptionalHeader64 + Sections []*Section + Symbols []*Symbol + + closer io.Closer +} + +type SectionHeader struct { + Name string + VirtualSize uint32 + VirtualAddress uint32 + Size uint32 + Offset uint32 + PointerToRelocations uint32 + PointerToLineNumbers uint32 + NumberOfRelocations uint16 + NumberOfLineNumbers uint16 + Characteristics uint32 +} + +type Section struct { + SectionHeader + + // Embed ReaderAt for ReadAt method. + // Do not embed SectionReader directly + // to avoid having Read and Seek. + // If a client wants Read and Seek it must use + // Open() to avoid fighting over the seek offset + // with other clients. + io.ReaderAt + sr *io.SectionReader +} + +type Symbol struct { + Name string + Value uint32 + SectionNumber int16 + Type uint16 + StorageClass uint8 +} + +type ImportDirectory struct { + OriginalFirstThunk uint32 + TimeDateStamp uint32 + ForwarderChain uint32 + Name uint32 + FirstThunk uint32 + + dll string +} + +// Data reads and returns the contents of the PE section. +func (s *Section) Data() ([]byte, error) { + dat := make([]byte, s.sr.Size()) + n, err := s.sr.ReadAt(dat, 0) + if n == len(dat) { + err = nil + } + return dat[0:n], err +} + +// Open returns a new ReadSeeker reading the PE section. +func (s *Section) Open() io.ReadSeeker { return io.NewSectionReader(s.sr, 0, 1<<63-1) } + +type FormatError struct { + off int64 + msg string + val interface{} +} + +func (e *FormatError) Error() string { + msg := e.msg + if e.val != nil { + msg += fmt.Sprintf(" '%v'", e.val) + } + msg += fmt.Sprintf(" in record at byte %#x", e.off) + return msg +} + +// Open opens the named file using os.Open and prepares it for use as a PE binary. +func Open(name string) (*File, error) { + f, err := os.Open(name) + if err != nil { + return nil, err + } + ff, err := NewFile(f) + if err != nil { + f.Close() + return nil, err + } + ff.closer = f + return ff, nil +} + +// Close closes the File. +// If the File was created using NewFile directly instead of Open, +// Close has no effect. +func (f *File) Close() error { + var err error + if f.closer != nil { + err = f.closer.Close() + f.closer = nil + } + return err +} + +var ( + sizeofOptionalHeader32 = uint16(binary.Size(OptionalHeader32{})) + sizeofOptionalHeader64 = uint16(binary.Size(OptionalHeader64{})) +) + +// NewFile creates a new File for accessing a PE binary in an underlying reader. +func NewFile(r io.ReaderAt) (*File, error) { + f := new(File) + sr := io.NewSectionReader(r, 0, 1<<63-1) + + var dosheader [96]byte + if _, err := r.ReadAt(dosheader[0:], 0); err != nil { + return nil, err + } + var base int64 + if dosheader[0] == 'M' && dosheader[1] == 'Z' { + signoff := int64(binary.LittleEndian.Uint32(dosheader[0x3c:])) + var sign [4]byte + r.ReadAt(sign[:], signoff) + if !(sign[0] == 'P' && sign[1] == 'E' && sign[2] == 0 && sign[3] == 0) { + return nil, errors.New("Invalid PE File Format.") + } + base = signoff + 4 + } else { + base = int64(0) + } + sr.Seek(base, os.SEEK_SET) + if err := binary.Read(sr, binary.LittleEndian, &f.FileHeader); err != nil { + return nil, err + } + if f.FileHeader.Machine != IMAGE_FILE_MACHINE_UNKNOWN && f.FileHeader.Machine != IMAGE_FILE_MACHINE_AMD64 && f.FileHeader.Machine != IMAGE_FILE_MACHINE_I386 { + return nil, errors.New("Invalid PE File Format.") + } + + var ss []byte + if f.FileHeader.NumberOfSymbols > 0 { + // Get COFF string table, which is located at the end of the COFF symbol table. + sr.Seek(int64(f.FileHeader.PointerToSymbolTable+COFFSymbolSize*f.FileHeader.NumberOfSymbols), os.SEEK_SET) + var l uint32 + if err := binary.Read(sr, binary.LittleEndian, &l); err != nil { + return nil, err + } + ss = make([]byte, l) + if _, err := r.ReadAt(ss, int64(f.FileHeader.PointerToSymbolTable+COFFSymbolSize*f.FileHeader.NumberOfSymbols)); err != nil { + return nil, err + } + + // Process COFF symbol table. + sr.Seek(int64(f.FileHeader.PointerToSymbolTable), os.SEEK_SET) + aux := uint8(0) + for i := 0; i < int(f.FileHeader.NumberOfSymbols); i++ { + cs := new(COFFSymbol) + if err := binary.Read(sr, binary.LittleEndian, cs); err != nil { + return nil, err + } + if aux > 0 { + aux-- + continue + } + var name string + if cs.Name[0] == 0 && cs.Name[1] == 0 && cs.Name[2] == 0 && cs.Name[3] == 0 { + si := int(binary.LittleEndian.Uint32(cs.Name[4:])) + name, _ = getString(ss, si) + } else { + name = cstring(cs.Name[:]) + } + aux = cs.NumberOfAuxSymbols + s := &Symbol{ + Name: name, + Value: cs.Value, + SectionNumber: cs.SectionNumber, + Type: cs.Type, + StorageClass: cs.StorageClass, + } + f.Symbols = append(f.Symbols, s) + } + } + + // Read optional header. + sr.Seek(base, os.SEEK_SET) + if err := binary.Read(sr, binary.LittleEndian, &f.FileHeader); err != nil { + return nil, err + } + var oh32 OptionalHeader32 + var oh64 OptionalHeader64 + switch f.FileHeader.SizeOfOptionalHeader { + case sizeofOptionalHeader32: + if err := binary.Read(sr, binary.LittleEndian, &oh32); err != nil { + return nil, err + } + if oh32.Magic != 0x10b { // PE32 + return nil, fmt.Errorf("pe32 optional header has unexpected Magic of 0x%x", oh32.Magic) + } + f.OptionalHeader = &oh32 + case sizeofOptionalHeader64: + if err := binary.Read(sr, binary.LittleEndian, &oh64); err != nil { + return nil, err + } + if oh64.Magic != 0x20b { // PE32+ + return nil, fmt.Errorf("pe32+ optional header has unexpected Magic of 0x%x", oh64.Magic) + } + f.OptionalHeader = &oh64 + } + + // Process sections. + f.Sections = make([]*Section, f.FileHeader.NumberOfSections) + for i := 0; i < int(f.FileHeader.NumberOfSections); i++ { + sh := new(SectionHeader32) + if err := binary.Read(sr, binary.LittleEndian, sh); err != nil { + return nil, err + } + var name string + if sh.Name[0] == '\x2F' { + si, _ := strconv.Atoi(cstring(sh.Name[1:])) + name, _ = getString(ss, si) + } else { + name = cstring(sh.Name[0:]) + } + s := new(Section) + s.SectionHeader = SectionHeader{ + Name: name, + VirtualSize: sh.VirtualSize, + VirtualAddress: sh.VirtualAddress, + Size: sh.SizeOfRawData, + Offset: sh.PointerToRawData, + PointerToRelocations: sh.PointerToRelocations, + PointerToLineNumbers: sh.PointerToLineNumbers, + NumberOfRelocations: sh.NumberOfRelocations, + NumberOfLineNumbers: sh.NumberOfLineNumbers, + Characteristics: sh.Characteristics, + } + s.sr = io.NewSectionReader(r, int64(s.SectionHeader.Offset), int64(s.SectionHeader.Size)) + s.ReaderAt = s.sr + f.Sections[i] = s + } + return f, nil +} + +func cstring(b []byte) string { + var i int + for i = 0; i < len(b) && b[i] != 0; i++ { + } + return string(b[0:i]) +} + +// getString extracts a string from symbol string table. +func getString(section []byte, start int) (string, bool) { + if start < 0 || start >= len(section) { + return "", false + } + + for end := start; end < len(section); end++ { + if section[end] == 0 { + return string(section[start:end]), true + } + } + return "", false +} + +// Section returns the first section with the given name, or nil if no such +// section exists. +func (f *File) Section(name string) *Section { + for _, s := range f.Sections { + if s.Name == name { + return s + } + } + return nil +} + +func (f *File) DWARF() (*dwarf.Data, error) { + // There are many other DWARF sections, but these + // are the ones the debug/dwarf package uses. + // Don't bother loading others. + var names = [...]string{"abbrev", "info", "line", "str"} + var dat [len(names)][]byte + for i, name := range names { + name = ".debug_" + name + s := f.Section(name) + if s == nil { + continue + } + b, err := s.Data() + if err != nil && uint32(len(b)) < s.Size { + return nil, err + } + if 0 < s.VirtualSize && s.VirtualSize < s.Size { + b = b[:s.VirtualSize] + } + dat[i] = b + } + + abbrev, info, line, str := dat[0], dat[1], dat[2], dat[3] + return dwarf.New(abbrev, nil, nil, info, line, nil, nil, str) +} + +// ImportedSymbols returns the names of all symbols +// referred to by the binary f that are expected to be +// satisfied by other libraries at dynamic load time. +// It does not return weak symbols. +func (f *File) ImportedSymbols() ([]string, error) { + pe64 := f.Machine == IMAGE_FILE_MACHINE_AMD64 + ds := f.Section(".idata") + if ds == nil { + // not dynamic, so no libraries + return nil, nil + } + d, err := ds.Data() + if err != nil { + return nil, err + } + var ida []ImportDirectory + for len(d) > 0 { + var dt ImportDirectory + dt.OriginalFirstThunk = binary.LittleEndian.Uint32(d[0:4]) + dt.Name = binary.LittleEndian.Uint32(d[12:16]) + dt.FirstThunk = binary.LittleEndian.Uint32(d[16:20]) + d = d[20:] + if dt.OriginalFirstThunk == 0 { + break + } + ida = append(ida, dt) + } + names, _ := ds.Data() + var all []string + for _, dt := range ida { + dt.dll, _ = getString(names, int(dt.Name-ds.VirtualAddress)) + d, _ = ds.Data() + // seek to OriginalFirstThunk + d = d[dt.OriginalFirstThunk-ds.VirtualAddress:] + for len(d) > 0 { + if pe64 { // 64bit + va := binary.LittleEndian.Uint64(d[0:8]) + d = d[8:] + if va == 0 { + break + } + if va&0x8000000000000000 > 0 { // is Ordinal + // TODO add dynimport ordinal support. + } else { + fn, _ := getString(names, int(uint32(va)-ds.VirtualAddress+2)) + all = append(all, fn+":"+dt.dll) + } + } else { // 32bit + va := binary.LittleEndian.Uint32(d[0:4]) + d = d[4:] + if va == 0 { + break + } + if va&0x80000000 > 0 { // is Ordinal + // TODO add dynimport ordinal support. + //ord := va&0x0000FFFF + } else { + fn, _ := getString(names, int(va-ds.VirtualAddress+2)) + all = append(all, fn+":"+dt.dll) + } + } + } + } + + return all, nil +} + +// ImportedLibraries returns the names of all libraries +// referred to by the binary f that are expected to be +// linked with the binary at dynamic link time. +func (f *File) ImportedLibraries() ([]string, error) { + // TODO + // cgo -dynimport don't use this for windows PE, so just return. + return nil, nil +} diff --git a/src/debug/pe/file_test.go b/src/debug/pe/file_test.go new file mode 100644 index 0000000000000000000000000000000000000000..316a569ede97dd5e2a84235f5fcb886453413c17 --- /dev/null +++ b/src/debug/pe/file_test.go @@ -0,0 +1,309 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package pe + +import ( + "debug/dwarf" + "io/ioutil" + "os" + "os/exec" + "path/filepath" + "reflect" + "runtime" + "testing" +) + +type fileTest struct { + file string + hdr FileHeader + opthdr interface{} + sections []*SectionHeader + symbols []*Symbol + hasNoDwarfInfo bool +} + +var fileTests = []fileTest{ + { + file: "testdata/gcc-386-mingw-obj", + hdr: FileHeader{0x014c, 0x000c, 0x0, 0x64a, 0x1e, 0x0, 0x104}, + sections: []*SectionHeader{ + {".text", 0, 0, 36, 500, 1440, 0, 3, 0, 0x60300020}, + {".data", 0, 0, 0, 0, 0, 0, 0, 0, 3224371264}, + {".bss", 0, 0, 0, 0, 0, 0, 0, 0, 3224371328}, + {".debug_abbrev", 0, 0, 137, 536, 0, 0, 0, 0, 0x42100000}, + {".debug_info", 0, 0, 418, 673, 1470, 0, 7, 0, 1108344832}, + {".debug_line", 0, 0, 128, 1091, 1540, 0, 1, 0, 1108344832}, + {".rdata", 0, 0, 16, 1219, 0, 0, 0, 0, 1076887616}, + {".debug_frame", 0, 0, 52, 1235, 1550, 0, 2, 0, 1110441984}, + {".debug_loc", 0, 0, 56, 1287, 0, 0, 0, 0, 1108344832}, + {".debug_pubnames", 0, 0, 27, 1343, 1570, 0, 1, 0, 1108344832}, + {".debug_pubtypes", 0, 0, 38, 1370, 1580, 0, 1, 0, 1108344832}, + {".debug_aranges", 0, 0, 32, 1408, 1590, 0, 2, 0, 1108344832}, + }, + symbols: []*Symbol{ + {".file", 0x0, -2, 0x0, 0x67}, + {"_main", 0x0, 1, 0x20, 0x2}, + {".text", 0x0, 1, 0x0, 0x3}, + {".data", 0x0, 2, 0x0, 0x3}, + {".bss", 0x0, 3, 0x0, 0x3}, + {".debug_abbrev", 0x0, 4, 0x0, 0x3}, + {".debug_info", 0x0, 5, 0x0, 0x3}, + {".debug_line", 0x0, 6, 0x0, 0x3}, + {".rdata", 0x0, 7, 0x0, 0x3}, + {".debug_frame", 0x0, 8, 0x0, 0x3}, + {".debug_loc", 0x0, 9, 0x0, 0x3}, + {".debug_pubnames", 0x0, 10, 0x0, 0x3}, + {".debug_pubtypes", 0x0, 11, 0x0, 0x3}, + {".debug_aranges", 0x0, 12, 0x0, 0x3}, + {"___main", 0x0, 0, 0x20, 0x2}, + {"_puts", 0x0, 0, 0x20, 0x2}, + }, + }, + { + file: "testdata/gcc-386-mingw-exec", + hdr: FileHeader{0x014c, 0x000f, 0x4c6a1b60, 0x3c00, 0x282, 0xe0, 0x107}, + opthdr: &OptionalHeader32{ + 0x10b, 0x2, 0x38, 0xe00, 0x1a00, 0x200, 0x1160, 0x1000, 0x2000, 0x400000, 0x1000, 0x200, 0x4, 0x0, 0x1, 0x0, 0x4, 0x0, 0x0, 0x10000, 0x400, 0x14abb, 0x3, 0x0, 0x200000, 0x1000, 0x100000, 0x1000, 0x0, 0x10, + [16]DataDirectory{ + {0x0, 0x0}, + {0x5000, 0x3c8}, + {0x0, 0x0}, + {0x0, 0x0}, + {0x0, 0x0}, + {0x0, 0x0}, + {0x0, 0x0}, + {0x0, 0x0}, + {0x0, 0x0}, + {0x7000, 0x18}, + {0x0, 0x0}, + {0x0, 0x0}, + {0x0, 0x0}, + {0x0, 0x0}, + {0x0, 0x0}, + {0x0, 0x0}, + }, + }, + sections: []*SectionHeader{ + {".text", 0xcd8, 0x1000, 0xe00, 0x400, 0x0, 0x0, 0x0, 0x0, 0x60500060}, + {".data", 0x10, 0x2000, 0x200, 0x1200, 0x0, 0x0, 0x0, 0x0, 0xc0300040}, + {".rdata", 0x120, 0x3000, 0x200, 0x1400, 0x0, 0x0, 0x0, 0x0, 0x40300040}, + {".bss", 0xdc, 0x4000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xc0400080}, + {".idata", 0x3c8, 0x5000, 0x400, 0x1600, 0x0, 0x0, 0x0, 0x0, 0xc0300040}, + {".CRT", 0x18, 0x6000, 0x200, 0x1a00, 0x0, 0x0, 0x0, 0x0, 0xc0300040}, + {".tls", 0x20, 0x7000, 0x200, 0x1c00, 0x0, 0x0, 0x0, 0x0, 0xc0300040}, + {".debug_aranges", 0x20, 0x8000, 0x200, 0x1e00, 0x0, 0x0, 0x0, 0x0, 0x42100000}, + {".debug_pubnames", 0x51, 0x9000, 0x200, 0x2000, 0x0, 0x0, 0x0, 0x0, 0x42100000}, + {".debug_pubtypes", 0x91, 0xa000, 0x200, 0x2200, 0x0, 0x0, 0x0, 0x0, 0x42100000}, + {".debug_info", 0xe22, 0xb000, 0x1000, 0x2400, 0x0, 0x0, 0x0, 0x0, 0x42100000}, + {".debug_abbrev", 0x157, 0xc000, 0x200, 0x3400, 0x0, 0x0, 0x0, 0x0, 0x42100000}, + {".debug_line", 0x144, 0xd000, 0x200, 0x3600, 0x0, 0x0, 0x0, 0x0, 0x42100000}, + {".debug_frame", 0x34, 0xe000, 0x200, 0x3800, 0x0, 0x0, 0x0, 0x0, 0x42300000}, + {".debug_loc", 0x38, 0xf000, 0x200, 0x3a00, 0x0, 0x0, 0x0, 0x0, 0x42100000}, + }, + }, + { + file: "testdata/gcc-amd64-mingw-obj", + hdr: FileHeader{0x8664, 0x6, 0x0, 0x198, 0x12, 0x0, 0x4}, + sections: []*SectionHeader{ + {".text", 0x0, 0x0, 0x30, 0x104, 0x15c, 0x0, 0x3, 0x0, 0x60500020}, + {".data", 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xc0500040}, + {".bss", 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xc0500080}, + {".rdata", 0x0, 0x0, 0x10, 0x134, 0x0, 0x0, 0x0, 0x0, 0x40500040}, + {".xdata", 0x0, 0x0, 0xc, 0x144, 0x0, 0x0, 0x0, 0x0, 0x40300040}, + {".pdata", 0x0, 0x0, 0xc, 0x150, 0x17a, 0x0, 0x3, 0x0, 0x40300040}, + }, + symbols: []*Symbol{ + {".file", 0x0, -2, 0x0, 0x67}, + {"main", 0x0, 1, 0x20, 0x2}, + {".text", 0x0, 1, 0x0, 0x3}, + {".data", 0x0, 2, 0x0, 0x3}, + {".bss", 0x0, 3, 0x0, 0x3}, + {".rdata", 0x0, 4, 0x0, 0x3}, + {".xdata", 0x0, 5, 0x0, 0x3}, + {".pdata", 0x0, 6, 0x0, 0x3}, + {"__main", 0x0, 0, 0x20, 0x2}, + {"puts", 0x0, 0, 0x20, 0x2}, + }, + hasNoDwarfInfo: true, + }, + { + file: "testdata/gcc-amd64-mingw-exec", + hdr: FileHeader{0x8664, 0x11, 0x53e4364f, 0x39600, 0x6fc, 0xf0, 0x27}, + opthdr: &OptionalHeader64{ + 0x20b, 0x2, 0x16, 0x6a00, 0x2400, 0x1600, 0x14e0, 0x1000, 0x400000, 0x1000, 0x200, 0x4, 0x0, 0x0, 0x0, 0x5, 0x2, 0x0, 0x45000, 0x600, 0x46f19, 0x3, 0x0, 0x200000, 0x1000, 0x100000, 0x1000, 0x0, 0x10, + [16]DataDirectory{ + {0x0, 0x0}, + {0xe000, 0x990}, + {0x0, 0x0}, + {0xa000, 0x498}, + {0x0, 0x0}, + {0x0, 0x0}, + {0x0, 0x0}, + {0x0, 0x0}, + {0x0, 0x0}, + {0x10000, 0x28}, + {0x0, 0x0}, + {0x0, 0x0}, + {0xe254, 0x218}, + {0x0, 0x0}, + {0x0, 0x0}, + {0x0, 0x0}, + }}, + sections: []*SectionHeader{ + {".text", 0x6860, 0x1000, 0x6a00, 0x600, 0x0, 0x0, 0x0, 0x0, 0x60500020}, + {".data", 0xe0, 0x8000, 0x200, 0x7000, 0x0, 0x0, 0x0, 0x0, 0xc0500040}, + {".rdata", 0x6b0, 0x9000, 0x800, 0x7200, 0x0, 0x0, 0x0, 0x0, 0x40600040}, + {".pdata", 0x498, 0xa000, 0x600, 0x7a00, 0x0, 0x0, 0x0, 0x0, 0x40300040}, + {".xdata", 0x488, 0xb000, 0x600, 0x8000, 0x0, 0x0, 0x0, 0x0, 0x40300040}, + {".bss", 0x1410, 0xc000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xc0600080}, + {".idata", 0x990, 0xe000, 0xa00, 0x8600, 0x0, 0x0, 0x0, 0x0, 0xc0300040}, + {".CRT", 0x68, 0xf000, 0x200, 0x9000, 0x0, 0x0, 0x0, 0x0, 0xc0400040}, + {".tls", 0x48, 0x10000, 0x200, 0x9200, 0x0, 0x0, 0x0, 0x0, 0xc0600040}, + {".debug_aranges", 0x600, 0x11000, 0x600, 0x9400, 0x0, 0x0, 0x0, 0x0, 0x42500040}, + {".debug_info", 0x1316e, 0x12000, 0x13200, 0x9a00, 0x0, 0x0, 0x0, 0x0, 0x42100040}, + {".debug_abbrev", 0x2ccb, 0x26000, 0x2e00, 0x1cc00, 0x0, 0x0, 0x0, 0x0, 0x42100040}, + {".debug_line", 0x3c4d, 0x29000, 0x3e00, 0x1fa00, 0x0, 0x0, 0x0, 0x0, 0x42100040}, + {".debug_frame", 0x18b8, 0x2d000, 0x1a00, 0x23800, 0x0, 0x0, 0x0, 0x0, 0x42400040}, + {".debug_str", 0x396, 0x2f000, 0x400, 0x25200, 0x0, 0x0, 0x0, 0x0, 0x42100040}, + {".debug_loc", 0x13240, 0x30000, 0x13400, 0x25600, 0x0, 0x0, 0x0, 0x0, 0x42100040}, + {".debug_ranges", 0xa70, 0x44000, 0xc00, 0x38a00, 0x0, 0x0, 0x0, 0x0, 0x42100040}, + }, + }, +} + +func isOptHdrEq(a, b interface{}) bool { + switch va := a.(type) { + case *OptionalHeader32: + vb, ok := b.(*OptionalHeader32) + if !ok { + return false + } + return *vb == *va + case *OptionalHeader64: + vb, ok := b.(*OptionalHeader64) + if !ok { + return false + } + return *vb == *va + case nil: + return b == nil + } + return false +} + +func TestOpen(t *testing.T) { + for i := range fileTests { + tt := &fileTests[i] + + f, err := Open(tt.file) + if err != nil { + t.Error(err) + continue + } + if !reflect.DeepEqual(f.FileHeader, tt.hdr) { + t.Errorf("open %s:\n\thave %#v\n\twant %#v\n", tt.file, f.FileHeader, tt.hdr) + continue + } + if !isOptHdrEq(tt.opthdr, f.OptionalHeader) { + t.Errorf("open %s:\n\thave %#v\n\twant %#v\n", tt.file, f.OptionalHeader, tt.opthdr) + continue + } + + for i, sh := range f.Sections { + if i >= len(tt.sections) { + break + } + have := &sh.SectionHeader + want := tt.sections[i] + if !reflect.DeepEqual(have, want) { + t.Errorf("open %s, section %d:\n\thave %#v\n\twant %#v\n", tt.file, i, have, want) + } + } + tn := len(tt.sections) + fn := len(f.Sections) + if tn != fn { + t.Errorf("open %s: len(Sections) = %d, want %d", tt.file, fn, tn) + } + for i, have := range f.Symbols { + if i >= len(tt.symbols) { + break + } + want := tt.symbols[i] + if !reflect.DeepEqual(have, want) { + t.Errorf("open %s, symbol %d:\n\thave %#v\n\twant %#v\n", tt.file, i, have, want) + } + } + if !tt.hasNoDwarfInfo { + _, err = f.DWARF() + if err != nil { + t.Errorf("fetching %s dwarf details failed: %v", tt.file, err) + } + } + } +} + +func TestOpenFailure(t *testing.T) { + filename := "file.go" // not a PE file + _, err := Open(filename) // don't crash + if err == nil { + t.Errorf("open %s: succeeded unexpectedly", filename) + } +} + +func TestDWARF(t *testing.T) { + if runtime.GOOS != "windows" { + t.Skip("skipping windows only test") + } + + tmpdir, err := ioutil.TempDir("", "TestDWARF") + if err != nil { + t.Fatal("TempDir failed: ", err) + } + defer os.RemoveAll(tmpdir) + + prog := ` +package main +func main() { +} +` + src := filepath.Join(tmpdir, "a.go") + exe := filepath.Join(tmpdir, "a.exe") + err = ioutil.WriteFile(src, []byte(prog), 0644) + output, err := exec.Command("go", "build", "-o", exe, src).CombinedOutput() + if err != nil { + t.Fatalf("building test executable failed: %s %s", err, output) + } + + f, err := Open(exe) + if err != nil { + t.Fatal(err) + } + defer f.Close() + + d, err := f.DWARF() + if err != nil { + t.Fatal(err) + } + + // look for main.main + r := d.Reader() + for { + e, err := r.Next() + if err != nil { + t.Fatal("r.Next:", err) + } + if e == nil { + break + } + if e.Tag == dwarf.TagSubprogram { + for _, f := range e.Field { + if f.Attr == dwarf.AttrName && e.Val(dwarf.AttrName) == "main.main" { + return + } + } + } + } + t.Fatal("main.main not found") +} diff --git a/src/debug/pe/pe.go b/src/debug/pe/pe.go new file mode 100644 index 0000000000000000000000000000000000000000..8e90b1b513acb1b687eae99099fbdcb041e9b442 --- /dev/null +++ b/src/debug/pe/pe.go @@ -0,0 +1,134 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package pe + +type FileHeader struct { + Machine uint16 + NumberOfSections uint16 + TimeDateStamp uint32 + PointerToSymbolTable uint32 + NumberOfSymbols uint32 + SizeOfOptionalHeader uint16 + Characteristics uint16 +} + +type DataDirectory struct { + VirtualAddress uint32 + Size uint32 +} + +type OptionalHeader32 struct { + Magic uint16 + MajorLinkerVersion uint8 + MinorLinkerVersion uint8 + SizeOfCode uint32 + SizeOfInitializedData uint32 + SizeOfUninitializedData uint32 + AddressOfEntryPoint uint32 + BaseOfCode uint32 + BaseOfData uint32 + ImageBase uint32 + SectionAlignment uint32 + FileAlignment uint32 + MajorOperatingSystemVersion uint16 + MinorOperatingSystemVersion uint16 + MajorImageVersion uint16 + MinorImageVersion uint16 + MajorSubsystemVersion uint16 + MinorSubsystemVersion uint16 + Win32VersionValue uint32 + SizeOfImage uint32 + SizeOfHeaders uint32 + CheckSum uint32 + Subsystem uint16 + DllCharacteristics uint16 + SizeOfStackReserve uint32 + SizeOfStackCommit uint32 + SizeOfHeapReserve uint32 + SizeOfHeapCommit uint32 + LoaderFlags uint32 + NumberOfRvaAndSizes uint32 + DataDirectory [16]DataDirectory +} + +type OptionalHeader64 struct { + Magic uint16 + MajorLinkerVersion uint8 + MinorLinkerVersion uint8 + SizeOfCode uint32 + SizeOfInitializedData uint32 + SizeOfUninitializedData uint32 + AddressOfEntryPoint uint32 + BaseOfCode uint32 + ImageBase uint64 + SectionAlignment uint32 + FileAlignment uint32 + MajorOperatingSystemVersion uint16 + MinorOperatingSystemVersion uint16 + MajorImageVersion uint16 + MinorImageVersion uint16 + MajorSubsystemVersion uint16 + MinorSubsystemVersion uint16 + Win32VersionValue uint32 + SizeOfImage uint32 + SizeOfHeaders uint32 + CheckSum uint32 + Subsystem uint16 + DllCharacteristics uint16 + SizeOfStackReserve uint64 + SizeOfStackCommit uint64 + SizeOfHeapReserve uint64 + SizeOfHeapCommit uint64 + LoaderFlags uint32 + NumberOfRvaAndSizes uint32 + DataDirectory [16]DataDirectory +} + +type SectionHeader32 struct { + Name [8]uint8 + VirtualSize uint32 + VirtualAddress uint32 + SizeOfRawData uint32 + PointerToRawData uint32 + PointerToRelocations uint32 + PointerToLineNumbers uint32 + NumberOfRelocations uint16 + NumberOfLineNumbers uint16 + Characteristics uint32 +} + +const COFFSymbolSize = 18 + +type COFFSymbol struct { + Name [8]uint8 + Value uint32 + SectionNumber int16 + Type uint16 + StorageClass uint8 + NumberOfAuxSymbols uint8 +} + +const ( + IMAGE_FILE_MACHINE_UNKNOWN = 0x0 + IMAGE_FILE_MACHINE_AM33 = 0x1d3 + IMAGE_FILE_MACHINE_AMD64 = 0x8664 + IMAGE_FILE_MACHINE_ARM = 0x1c0 + IMAGE_FILE_MACHINE_EBC = 0xebc + IMAGE_FILE_MACHINE_I386 = 0x14c + IMAGE_FILE_MACHINE_IA64 = 0x200 + IMAGE_FILE_MACHINE_M32R = 0x9041 + IMAGE_FILE_MACHINE_MIPS16 = 0x266 + IMAGE_FILE_MACHINE_MIPSFPU = 0x366 + IMAGE_FILE_MACHINE_MIPSFPU16 = 0x466 + IMAGE_FILE_MACHINE_POWERPC = 0x1f0 + IMAGE_FILE_MACHINE_POWERPCFP = 0x1f1 + IMAGE_FILE_MACHINE_R4000 = 0x166 + IMAGE_FILE_MACHINE_SH3 = 0x1a2 + IMAGE_FILE_MACHINE_SH3DSP = 0x1a3 + IMAGE_FILE_MACHINE_SH4 = 0x1a6 + IMAGE_FILE_MACHINE_SH5 = 0x1a8 + IMAGE_FILE_MACHINE_THUMB = 0x1c2 + IMAGE_FILE_MACHINE_WCEMIPSV2 = 0x169 +) diff --git a/src/debug/pe/testdata/gcc-386-mingw-exec b/src/debug/pe/testdata/gcc-386-mingw-exec new file mode 100644 index 0000000000000000000000000000000000000000..4b808d043200a8cc10fb5038fe51b70ad6630765 Binary files /dev/null and b/src/debug/pe/testdata/gcc-386-mingw-exec differ diff --git a/src/debug/pe/testdata/gcc-386-mingw-obj b/src/debug/pe/testdata/gcc-386-mingw-obj new file mode 100644 index 0000000000000000000000000000000000000000..0c84d898d5eee045c703a500883f97d0bdee113c Binary files /dev/null and b/src/debug/pe/testdata/gcc-386-mingw-obj differ diff --git a/src/debug/pe/testdata/gcc-amd64-mingw-exec b/src/debug/pe/testdata/gcc-amd64-mingw-exec new file mode 100644 index 0000000000000000000000000000000000000000..ce6feb6b7b6a4ca1fc5da067254d8acfd49f3377 Binary files /dev/null and b/src/debug/pe/testdata/gcc-amd64-mingw-exec differ diff --git a/src/debug/pe/testdata/gcc-amd64-mingw-obj b/src/debug/pe/testdata/gcc-amd64-mingw-obj new file mode 100644 index 0000000000000000000000000000000000000000..48ae7921f33e4ace83da05688ca7f0c09d8df1f8 Binary files /dev/null and b/src/debug/pe/testdata/gcc-amd64-mingw-obj differ diff --git a/src/debug/pe/testdata/hello.c b/src/debug/pe/testdata/hello.c new file mode 100644 index 0000000000000000000000000000000000000000..a689d3644e1e95d9d9cb1f013be6430d90dab71c --- /dev/null +++ b/src/debug/pe/testdata/hello.c @@ -0,0 +1,8 @@ +#include + +int +main(void) +{ + printf("hello, world\n"); + return 0; +} diff --git a/src/debug/plan9obj/file.go b/src/debug/plan9obj/file.go new file mode 100644 index 0000000000000000000000000000000000000000..b11ed86f185dedffe46f24bf572da838e8d2cf72 --- /dev/null +++ b/src/debug/plan9obj/file.go @@ -0,0 +1,328 @@ +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package plan9obj implements access to Plan 9 a.out object files. +package plan9obj + +import ( + "encoding/binary" + "errors" + "fmt" + "io" + "os" +) + +// A FileHeader represents a Plan 9 a.out file header. +type FileHeader struct { + Magic uint32 + Bss uint32 + Entry uint64 + PtrSize int + LoadAddress uint64 + HdrSize uint64 +} + +// A File represents an open Plan 9 a.out file. +type File struct { + FileHeader + Sections []*Section + closer io.Closer +} + +// A SectionHeader represents a single Plan 9 a.out section header. +// This structure doesn't exist on-disk, but eases navigation +// through the object file. +type SectionHeader struct { + Name string + Size uint32 + Offset uint32 +} + +// A Section represents a single section in a Plan 9 a.out file. +type Section struct { + SectionHeader + + // Embed ReaderAt for ReadAt method. + // Do not embed SectionReader directly + // to avoid having Read and Seek. + // If a client wants Read and Seek it must use + // Open() to avoid fighting over the seek offset + // with other clients. + io.ReaderAt + sr *io.SectionReader +} + +// Data reads and returns the contents of the Plan 9 a.out section. +func (s *Section) Data() ([]byte, error) { + dat := make([]byte, s.sr.Size()) + n, err := s.sr.ReadAt(dat, 0) + if n == len(dat) { + err = nil + } + return dat[0:n], err +} + +// Open returns a new ReadSeeker reading the Plan 9 a.out section. +func (s *Section) Open() io.ReadSeeker { return io.NewSectionReader(s.sr, 0, 1<<63-1) } + +// A Symbol represents an entry in a Plan 9 a.out symbol table section. +type Sym struct { + Value uint64 + Type rune + Name string +} + +/* + * Plan 9 a.out reader + */ + +// formatError is returned by some operations if the data does +// not have the correct format for an object file. +type formatError struct { + off int + msg string + val interface{} +} + +func (e *formatError) Error() string { + msg := e.msg + if e.val != nil { + msg += fmt.Sprintf(" '%v'", e.val) + } + msg += fmt.Sprintf(" in record at byte %#x", e.off) + return msg +} + +// Open opens the named file using os.Open and prepares it for use as a Plan 9 a.out binary. +func Open(name string) (*File, error) { + f, err := os.Open(name) + if err != nil { + return nil, err + } + ff, err := NewFile(f) + if err != nil { + f.Close() + return nil, err + } + ff.closer = f + return ff, nil +} + +// Close closes the File. +// If the File was created using NewFile directly instead of Open, +// Close has no effect. +func (f *File) Close() error { + var err error + if f.closer != nil { + err = f.closer.Close() + f.closer = nil + } + return err +} + +func parseMagic(magic []byte) (uint32, error) { + m := binary.BigEndian.Uint32(magic) + switch m { + case Magic386, MagicAMD64, MagicARM: + return m, nil + } + return 0, &formatError{0, "bad magic number", magic} +} + +// NewFile creates a new File for accessing a Plan 9 binary in an underlying reader. +// The Plan 9 binary is expected to start at position 0 in the ReaderAt. +func NewFile(r io.ReaderAt) (*File, error) { + sr := io.NewSectionReader(r, 0, 1<<63-1) + // Read and decode Plan 9 magic + var magic [4]byte + if _, err := r.ReadAt(magic[:], 0); err != nil { + return nil, err + } + _, err := parseMagic(magic[:]) + if err != nil { + return nil, err + } + + ph := new(prog) + if err := binary.Read(sr, binary.BigEndian, ph); err != nil { + return nil, err + } + + f := &File{FileHeader: FileHeader{ + Magic: ph.Magic, + Bss: ph.Bss, + Entry: uint64(ph.Entry), + PtrSize: 4, + LoadAddress: 0x1000, + HdrSize: 4 * 8, + }} + + if ph.Magic&Magic64 != 0 { + if err := binary.Read(sr, binary.BigEndian, &f.Entry); err != nil { + return nil, err + } + f.PtrSize = 8 + f.LoadAddress = 0x200000 + f.HdrSize += 8 + } + + var sects = []struct { + name string + size uint32 + }{ + {"text", ph.Text}, + {"data", ph.Data}, + {"syms", ph.Syms}, + {"spsz", ph.Spsz}, + {"pcsz", ph.Pcsz}, + } + + f.Sections = make([]*Section, 5) + + off := uint32(f.HdrSize) + + for i, sect := range sects { + s := new(Section) + s.SectionHeader = SectionHeader{ + Name: sect.name, + Size: sect.size, + Offset: off, + } + off += sect.size + s.sr = io.NewSectionReader(r, int64(s.Offset), int64(s.Size)) + s.ReaderAt = s.sr + f.Sections[i] = s + } + + return f, nil +} + +func walksymtab(data []byte, ptrsz int, fn func(sym) error) error { + var order binary.ByteOrder = binary.BigEndian + var s sym + p := data + for len(p) >= 4 { + // Symbol type, value. + if len(p) < ptrsz { + return &formatError{len(data), "unexpected EOF", nil} + } + // fixed-width value + if ptrsz == 8 { + s.value = order.Uint64(p[0:8]) + p = p[8:] + } else { + s.value = uint64(order.Uint32(p[0:4])) + p = p[4:] + } + + var typ byte + typ = p[0] & 0x7F + s.typ = typ + p = p[1:] + + // Name. + var i int + var nnul int + for i = 0; i < len(p); i++ { + if p[i] == 0 { + nnul = 1 + break + } + } + switch typ { + case 'z', 'Z': + p = p[i+nnul:] + for i = 0; i+2 <= len(p); i += 2 { + if p[i] == 0 && p[i+1] == 0 { + nnul = 2 + break + } + } + } + if len(p) < i+nnul { + return &formatError{len(data), "unexpected EOF", nil} + } + s.name = p[0:i] + i += nnul + p = p[i:] + + fn(s) + } + return nil +} + +// NewTable decodes the Go symbol table in data, +// returning an in-memory representation. +func newTable(symtab []byte, ptrsz int) ([]Sym, error) { + var n int + err := walksymtab(symtab, ptrsz, func(s sym) error { + n++ + return nil + }) + if err != nil { + return nil, err + } + + fname := make(map[uint16]string) + syms := make([]Sym, 0, n) + err = walksymtab(symtab, ptrsz, func(s sym) error { + n := len(syms) + syms = syms[0 : n+1] + ts := &syms[n] + ts.Type = rune(s.typ) + ts.Value = s.value + switch s.typ { + default: + ts.Name = string(s.name[:]) + case 'z', 'Z': + for i := 0; i < len(s.name); i += 2 { + eltIdx := binary.BigEndian.Uint16(s.name[i : i+2]) + elt, ok := fname[eltIdx] + if !ok { + return &formatError{-1, "bad filename code", eltIdx} + } + if n := len(ts.Name); n > 0 && ts.Name[n-1] != '/' { + ts.Name += "/" + } + ts.Name += elt + } + } + switch s.typ { + case 'f': + fname[uint16(s.value)] = ts.Name + } + return nil + }) + if err != nil { + return nil, err + } + + return syms, nil +} + +// Symbols returns the symbol table for f. +func (f *File) Symbols() ([]Sym, error) { + symtabSection := f.Section("syms") + if symtabSection == nil { + return nil, errors.New("no symbol section") + } + + symtab, err := symtabSection.Data() + if err != nil { + return nil, errors.New("cannot load symbol section") + } + + return newTable(symtab, f.PtrSize) +} + +// Section returns a section with the given name, or nil if no such +// section exists. +func (f *File) Section(name string) *Section { + for _, s := range f.Sections { + if s.Name == name { + return s + } + } + return nil +} diff --git a/src/debug/plan9obj/file_test.go b/src/debug/plan9obj/file_test.go new file mode 100644 index 0000000000000000000000000000000000000000..cfd7a61d1cdff79d8752665ebc84af0c55be4530 --- /dev/null +++ b/src/debug/plan9obj/file_test.go @@ -0,0 +1,81 @@ +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package plan9obj + +import ( + "reflect" + "testing" +) + +type fileTest struct { + file string + hdr FileHeader + sections []*SectionHeader +} + +var fileTests = []fileTest{ + { + "testdata/386-plan9-exec", + FileHeader{Magic386, 0x324, 0x14, 4, 0x1000, 32}, + []*SectionHeader{ + {"text", 0x4c5f, 0x20}, + {"data", 0x94c, 0x4c7f}, + {"syms", 0x2c2b, 0x55cb}, + {"spsz", 0x0, 0x81f6}, + {"pcsz", 0xf7a, 0x81f6}, + }, + }, + { + "testdata/amd64-plan9-exec", + FileHeader{MagicAMD64, 0x618, 0x13, 8, 0x200000, 40}, + []*SectionHeader{ + {"text", 0x4213, 0x28}, + {"data", 0xa80, 0x423b}, + {"syms", 0x2c8c, 0x4cbb}, + {"spsz", 0x0, 0x7947}, + {"pcsz", 0xca0, 0x7947}, + }, + }, +} + +func TestOpen(t *testing.T) { + for i := range fileTests { + tt := &fileTests[i] + + f, err := Open(tt.file) + if err != nil { + t.Error(err) + continue + } + if !reflect.DeepEqual(f.FileHeader, tt.hdr) { + t.Errorf("open %s:\n\thave %#v\n\twant %#v\n", tt.file, f.FileHeader, tt.hdr) + continue + } + + for i, sh := range f.Sections { + if i >= len(tt.sections) { + break + } + have := &sh.SectionHeader + want := tt.sections[i] + if !reflect.DeepEqual(have, want) { + t.Errorf("open %s, section %d:\n\thave %#v\n\twant %#v\n", tt.file, i, have, want) + } + } + tn := len(tt.sections) + fn := len(f.Sections) + if tn != fn { + t.Errorf("open %s: len(Sections) = %d, want %d", tt.file, fn, tn) + } + } +} + +func TestOpenFailure(t *testing.T) { + filename := "file.go" // not a Plan 9 a.out file + _, err := Open(filename) // don't crash + if err == nil { + t.Errorf("open %s: succeeded unexpectedly", filename) + } +} diff --git a/src/debug/plan9obj/plan9obj.go b/src/debug/plan9obj/plan9obj.go new file mode 100644 index 0000000000000000000000000000000000000000..af9858562f9e2b6d4ad51e9f3e0497bea2ff5aa7 --- /dev/null +++ b/src/debug/plan9obj/plan9obj.go @@ -0,0 +1,36 @@ +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +/* + * Plan 9 a.out constants and data structures + */ + +package plan9obj + +// Plan 9 Program header. +type prog struct { + Magic uint32 /* magic number */ + Text uint32 /* size of text segment */ + Data uint32 /* size of initialized data */ + Bss uint32 /* size of uninitialized data */ + Syms uint32 /* size of symbol table */ + Entry uint32 /* entry point */ + Spsz uint32 /* size of pc/sp offset table */ + Pcsz uint32 /* size of pc/line number table */ +} + +// Plan 9 symbol table entries. +type sym struct { + value uint64 + typ byte + name []byte +} + +const ( + Magic64 = 0x8000 // 64-bit expanded header + + Magic386 = (4*11+0)*11 + 7 + MagicAMD64 = (4*26+0)*26 + 7 + Magic64 + MagicARM = (4*20+0)*20 + 7 +) diff --git a/src/debug/plan9obj/testdata/386-plan9-exec b/src/debug/plan9obj/testdata/386-plan9-exec new file mode 100755 index 0000000000000000000000000000000000000000..748e83f8e6acc310edc5081a27d989c63f0eb2de Binary files /dev/null and b/src/debug/plan9obj/testdata/386-plan9-exec differ diff --git a/src/debug/plan9obj/testdata/amd64-plan9-exec b/src/debug/plan9obj/testdata/amd64-plan9-exec new file mode 100755 index 0000000000000000000000000000000000000000..3e257dd8ffc00ca4a19d9552a10d782134387e8b Binary files /dev/null and b/src/debug/plan9obj/testdata/amd64-plan9-exec differ diff --git a/src/debug/plan9obj/testdata/hello.c b/src/debug/plan9obj/testdata/hello.c new file mode 100644 index 0000000000000000000000000000000000000000..c0d633e29f0b18b13d966f28fd9ed37718a2148f --- /dev/null +++ b/src/debug/plan9obj/testdata/hello.c @@ -0,0 +1,8 @@ +#include +#include + +void +main(void) +{ + print("hello, world\n"); +} diff --git a/src/encoding/ascii85/ascii85.go b/src/encoding/ascii85/ascii85.go new file mode 100644 index 0000000000000000000000000000000000000000..4d7193873a2410fc67f9163ed6ea5e9e3e39f7b2 --- /dev/null +++ b/src/encoding/ascii85/ascii85.go @@ -0,0 +1,310 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package ascii85 implements the ascii85 data encoding +// as used in the btoa tool and Adobe's PostScript and PDF document formats. +package ascii85 + +import ( + "io" + "strconv" +) + +/* + * Encoder + */ + +// Encode encodes src into at most MaxEncodedLen(len(src)) +// bytes of dst, returning the actual number of bytes written. +// +// The encoding handles 4-byte chunks, using a special encoding +// for the last fragment, so Encode is not appropriate for use on +// individual blocks of a large data stream. Use NewEncoder() instead. +// +// Often, ascii85-encoded data is wrapped in <~ and ~> symbols. +// Encode does not add these. +func Encode(dst, src []byte) int { + if len(src) == 0 { + return 0 + } + + n := 0 + for len(src) > 0 { + dst[0] = 0 + dst[1] = 0 + dst[2] = 0 + dst[3] = 0 + dst[4] = 0 + + // Unpack 4 bytes into uint32 to repack into base 85 5-byte. + var v uint32 + switch len(src) { + default: + v |= uint32(src[3]) + fallthrough + case 3: + v |= uint32(src[2]) << 8 + fallthrough + case 2: + v |= uint32(src[1]) << 16 + fallthrough + case 1: + v |= uint32(src[0]) << 24 + } + + // Special case: zero (!!!!!) shortens to z. + if v == 0 && len(src) >= 4 { + dst[0] = 'z' + dst = dst[1:] + src = src[4:] + n++ + continue + } + + // Otherwise, 5 base 85 digits starting at !. + for i := 4; i >= 0; i-- { + dst[i] = '!' + byte(v%85) + v /= 85 + } + + // If src was short, discard the low destination bytes. + m := 5 + if len(src) < 4 { + m -= 4 - len(src) + src = nil + } else { + src = src[4:] + } + dst = dst[m:] + n += m + } + return n +} + +// MaxEncodedLen returns the maximum length of an encoding of n source bytes. +func MaxEncodedLen(n int) int { return (n + 3) / 4 * 5 } + +// NewEncoder returns a new ascii85 stream encoder. Data written to +// the returned writer will be encoded and then written to w. +// Ascii85 encodings operate in 32-bit blocks; when finished +// writing, the caller must Close the returned encoder to flush any +// trailing partial block. +func NewEncoder(w io.Writer) io.WriteCloser { return &encoder{w: w} } + +type encoder struct { + err error + w io.Writer + buf [4]byte // buffered data waiting to be encoded + nbuf int // number of bytes in buf + out [1024]byte // output buffer +} + +func (e *encoder) Write(p []byte) (n int, err error) { + if e.err != nil { + return 0, e.err + } + + // Leading fringe. + if e.nbuf > 0 { + var i int + for i = 0; i < len(p) && e.nbuf < 4; i++ { + e.buf[e.nbuf] = p[i] + e.nbuf++ + } + n += i + p = p[i:] + if e.nbuf < 4 { + return + } + nout := Encode(e.out[0:], e.buf[0:]) + if _, e.err = e.w.Write(e.out[0:nout]); e.err != nil { + return n, e.err + } + e.nbuf = 0 + } + + // Large interior chunks. + for len(p) >= 4 { + nn := len(e.out) / 5 * 4 + if nn > len(p) { + nn = len(p) + } + nn -= nn % 4 + if nn > 0 { + nout := Encode(e.out[0:], p[0:nn]) + if _, e.err = e.w.Write(e.out[0:nout]); e.err != nil { + return n, e.err + } + } + n += nn + p = p[nn:] + } + + // Trailing fringe. + for i := 0; i < len(p); i++ { + e.buf[i] = p[i] + } + e.nbuf = len(p) + n += len(p) + return +} + +// Close flushes any pending output from the encoder. +// It is an error to call Write after calling Close. +func (e *encoder) Close() error { + // If there's anything left in the buffer, flush it out + if e.err == nil && e.nbuf > 0 { + nout := Encode(e.out[0:], e.buf[0:e.nbuf]) + e.nbuf = 0 + _, e.err = e.w.Write(e.out[0:nout]) + } + return e.err +} + +/* + * Decoder + */ + +type CorruptInputError int64 + +func (e CorruptInputError) Error() string { + return "illegal ascii85 data at input byte " + strconv.FormatInt(int64(e), 10) +} + +// Decode decodes src into dst, returning both the number +// of bytes written to dst and the number consumed from src. +// If src contains invalid ascii85 data, Decode will return the +// number of bytes successfully written and a CorruptInputError. +// Decode ignores space and control characters in src. +// Often, ascii85-encoded data is wrapped in <~ and ~> symbols. +// Decode expects these to have been stripped by the caller. +// +// If flush is true, Decode assumes that src represents the +// end of the input stream and processes it completely rather +// than wait for the completion of another 32-bit block. +// +// NewDecoder wraps an io.Reader interface around Decode. +// +func Decode(dst, src []byte, flush bool) (ndst, nsrc int, err error) { + var v uint32 + var nb int + for i, b := range src { + if len(dst)-ndst < 4 { + return + } + switch { + case b <= ' ': + continue + case b == 'z' && nb == 0: + nb = 5 + v = 0 + case '!' <= b && b <= 'u': + v = v*85 + uint32(b-'!') + nb++ + default: + return 0, 0, CorruptInputError(i) + } + if nb == 5 { + nsrc = i + 1 + dst[ndst] = byte(v >> 24) + dst[ndst+1] = byte(v >> 16) + dst[ndst+2] = byte(v >> 8) + dst[ndst+3] = byte(v) + ndst += 4 + nb = 0 + v = 0 + } + } + if flush { + nsrc = len(src) + if nb > 0 { + // The number of output bytes in the last fragment + // is the number of leftover input bytes - 1: + // the extra byte provides enough bits to cover + // the inefficiency of the encoding for the block. + if nb == 1 { + return 0, 0, CorruptInputError(len(src)) + } + for i := nb; i < 5; i++ { + // The short encoding truncated the output value. + // We have to assume the worst case values (digit 84) + // in order to ensure that the top bits are correct. + v = v*85 + 84 + } + for i := 0; i < nb-1; i++ { + dst[ndst] = byte(v >> 24) + v <<= 8 + ndst++ + } + } + } + return +} + +// NewDecoder constructs a new ascii85 stream decoder. +func NewDecoder(r io.Reader) io.Reader { return &decoder{r: r} } + +type decoder struct { + err error + readErr error + r io.Reader + buf [1024]byte // leftover input + nbuf int + out []byte // leftover decoded output + outbuf [1024]byte +} + +func (d *decoder) Read(p []byte) (n int, err error) { + if len(p) == 0 { + return 0, nil + } + if d.err != nil { + return 0, d.err + } + + for { + // Copy leftover output from last decode. + if len(d.out) > 0 { + n = copy(p, d.out) + d.out = d.out[n:] + return + } + + // Decode leftover input from last read. + var nn, nsrc, ndst int + if d.nbuf > 0 { + ndst, nsrc, d.err = Decode(d.outbuf[0:], d.buf[0:d.nbuf], d.readErr != nil) + if ndst > 0 { + d.out = d.outbuf[0:ndst] + d.nbuf = copy(d.buf[0:], d.buf[nsrc:d.nbuf]) + continue // copy out and return + } + if ndst == 0 && d.err == nil { + // Special case: input buffer is mostly filled with non-data bytes. + // Filter out such bytes to make room for more input. + off := 0 + for i := 0; i < d.nbuf; i++ { + if d.buf[i] > ' ' { + d.buf[off] = d.buf[i] + off++ + } + } + d.nbuf = off + } + } + + // Out of input, out of decoded output. Check errors. + if d.err != nil { + return 0, d.err + } + if d.readErr != nil { + d.err = d.readErr + return 0, d.err + } + + // Read more data. + nn, d.readErr = d.r.Read(d.buf[d.nbuf:]) + d.nbuf += nn + } +} diff --git a/src/encoding/ascii85/ascii85_test.go b/src/encoding/ascii85/ascii85_test.go new file mode 100644 index 0000000000000000000000000000000000000000..aad199b4fad56be2fe05d8f089a5e0dfb002ac54 --- /dev/null +++ b/src/encoding/ascii85/ascii85_test.go @@ -0,0 +1,210 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package ascii85 + +import ( + "bytes" + "io" + "io/ioutil" + "strings" + "testing" +) + +type testpair struct { + decoded, encoded string +} + +var pairs = []testpair{ + // Encode returns 0 when len(src) is 0 + { + "", + "", + }, + // Wikipedia example + { + "Man is distinguished, not only by his reason, but by this singular passion from " + + "other animals, which is a lust of the mind, that by a perseverance of delight in " + + "the continued and indefatigable generation of knowledge, exceeds the short " + + "vehemence of any carnal pleasure.", + "9jqo^BlbD-BleB1DJ+*+F(f,q/0JhKFCj@.4Gp$d7F!,L7@<6@)/0JDEF@3BB/F*&OCAfu2/AKY\n" + + "i(DIb:@FD,*)+C]U=@3BN#EcYf8ATD3s@q?d$AftVqCh[NqF-FD5W8ARlolDIa\n" + + "l(DIduD.RTpAKYo'+CT/5+Cei#DII?(E,9)oF*2M7/c\n", + }, + // Special case when shortening !!!!! to z. + { + "\000\000\000\000", + "z", + }, +} + +var bigtest = pairs[len(pairs)-1] + +func testEqual(t *testing.T, msg string, args ...interface{}) bool { + if args[len(args)-2] != args[len(args)-1] { + t.Errorf(msg, args...) + return false + } + return true +} + +func strip85(s string) string { + t := make([]byte, len(s)) + w := 0 + for r := 0; r < len(s); r++ { + c := s[r] + if c > ' ' { + t[w] = c + w++ + } + } + return string(t[0:w]) +} + +func TestEncode(t *testing.T) { + for _, p := range pairs { + buf := make([]byte, MaxEncodedLen(len(p.decoded))) + n := Encode(buf, []byte(p.decoded)) + buf = buf[0:n] + testEqual(t, "Encode(%q) = %q, want %q", p.decoded, strip85(string(buf)), strip85(p.encoded)) + } +} + +func TestEncoder(t *testing.T) { + for _, p := range pairs { + bb := &bytes.Buffer{} + encoder := NewEncoder(bb) + encoder.Write([]byte(p.decoded)) + encoder.Close() + testEqual(t, "Encode(%q) = %q, want %q", p.decoded, strip85(bb.String()), strip85(p.encoded)) + } +} + +func TestEncoderBuffering(t *testing.T) { + input := []byte(bigtest.decoded) + for bs := 1; bs <= 12; bs++ { + bb := &bytes.Buffer{} + encoder := NewEncoder(bb) + for pos := 0; pos < len(input); pos += bs { + end := pos + bs + if end > len(input) { + end = len(input) + } + n, err := encoder.Write(input[pos:end]) + testEqual(t, "Write(%q) gave error %v, want %v", input[pos:end], err, error(nil)) + testEqual(t, "Write(%q) gave length %v, want %v", input[pos:end], n, end-pos) + } + err := encoder.Close() + testEqual(t, "Close gave error %v, want %v", err, error(nil)) + testEqual(t, "Encoding/%d of %q = %q, want %q", bs, bigtest.decoded, strip85(bb.String()), strip85(bigtest.encoded)) + } +} + +func TestDecode(t *testing.T) { + for _, p := range pairs { + dbuf := make([]byte, 4*len(p.encoded)) + ndst, nsrc, err := Decode(dbuf, []byte(p.encoded), true) + testEqual(t, "Decode(%q) = error %v, want %v", p.encoded, err, error(nil)) + testEqual(t, "Decode(%q) = nsrc %v, want %v", p.encoded, nsrc, len(p.encoded)) + testEqual(t, "Decode(%q) = ndst %v, want %v", p.encoded, ndst, len(p.decoded)) + testEqual(t, "Decode(%q) = %q, want %q", p.encoded, string(dbuf[0:ndst]), p.decoded) + } +} + +func TestDecoder(t *testing.T) { + for _, p := range pairs { + decoder := NewDecoder(strings.NewReader(p.encoded)) + dbuf, err := ioutil.ReadAll(decoder) + if err != nil { + t.Fatal("Read failed", err) + } + testEqual(t, "Read from %q = length %v, want %v", p.encoded, len(dbuf), len(p.decoded)) + testEqual(t, "Decoding of %q = %q, want %q", p.encoded, string(dbuf), p.decoded) + if err != nil { + testEqual(t, "Read from %q = %v, want %v", p.encoded, err, io.EOF) + } + } +} + +func TestDecoderBuffering(t *testing.T) { + for bs := 1; bs <= 12; bs++ { + decoder := NewDecoder(strings.NewReader(bigtest.encoded)) + buf := make([]byte, len(bigtest.decoded)+12) + var total int + for total = 0; total < len(bigtest.decoded); { + n, err := decoder.Read(buf[total : total+bs]) + testEqual(t, "Read from %q at pos %d = %d, %v, want _, %v", bigtest.encoded, total, n, err, error(nil)) + total += n + } + testEqual(t, "Decoding/%d of %q = %q, want %q", bs, bigtest.encoded, string(buf[0:total]), bigtest.decoded) + } +} + +func TestDecodeCorrupt(t *testing.T) { + type corrupt struct { + e string + p int + } + examples := []corrupt{ + {"v", 0}, + {"!z!!!!!!!!!", 1}, + } + + for _, e := range examples { + dbuf := make([]byte, 4*len(e.e)) + _, _, err := Decode(dbuf, []byte(e.e), true) + switch err := err.(type) { + case CorruptInputError: + testEqual(t, "Corruption in %q at offset %v, want %v", e.e, int(err), e.p) + default: + t.Error("Decoder failed to detect corruption in", e) + } + } +} + +func TestBig(t *testing.T) { + n := 3*1000 + 1 + raw := make([]byte, n) + const alpha = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" + for i := 0; i < n; i++ { + raw[i] = alpha[i%len(alpha)] + } + encoded := new(bytes.Buffer) + w := NewEncoder(encoded) + nn, err := w.Write(raw) + if nn != n || err != nil { + t.Fatalf("Encoder.Write(raw) = %d, %v want %d, nil", nn, err, n) + } + err = w.Close() + if err != nil { + t.Fatalf("Encoder.Close() = %v want nil", err) + } + decoded, err := ioutil.ReadAll(NewDecoder(encoded)) + if err != nil { + t.Fatalf("io.ReadAll(NewDecoder(...)): %v", err) + } + + if !bytes.Equal(raw, decoded) { + var i int + for i = 0; i < len(decoded) && i < len(raw); i++ { + if decoded[i] != raw[i] { + break + } + } + t.Errorf("Decode(Encode(%d-byte string)) failed at offset %d", n, i) + } +} + +func TestDecoderInternalWhitespace(t *testing.T) { + s := strings.Repeat(" ", 2048) + "z" + decoded, err := ioutil.ReadAll(NewDecoder(strings.NewReader(s))) + if err != nil { + t.Errorf("Decode gave error %v", err) + } + if want := []byte("\000\000\000\000"); !bytes.Equal(want, decoded) { + t.Errorf("Decode failed: got %v, want %v", decoded, want) + } +} diff --git a/src/encoding/asn1/asn1.go b/src/encoding/asn1/asn1.go new file mode 100644 index 0000000000000000000000000000000000000000..2ac411af8820b7c2c8f22f5f442307a3810ec27d --- /dev/null +++ b/src/encoding/asn1/asn1.go @@ -0,0 +1,962 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package asn1 implements parsing of DER-encoded ASN.1 data structures, +// as defined in ITU-T Rec X.690. +// +// See also ``A Layman's Guide to a Subset of ASN.1, BER, and DER,'' +// http://luca.ntop.org/Teaching/Appunti/asn1.html. +package asn1 + +// ASN.1 is a syntax for specifying abstract objects and BER, DER, PER, XER etc +// are different encoding formats for those objects. Here, we'll be dealing +// with DER, the Distinguished Encoding Rules. DER is used in X.509 because +// it's fast to parse and, unlike BER, has a unique encoding for every object. +// When calculating hashes over objects, it's important that the resulting +// bytes be the same at both ends and DER removes this margin of error. +// +// ASN.1 is very complex and this package doesn't attempt to implement +// everything by any means. + +import ( + "errors" + "fmt" + "math/big" + "reflect" + "strconv" + "time" + "unicode/utf8" +) + +// A StructuralError suggests that the ASN.1 data is valid, but the Go type +// which is receiving it doesn't match. +type StructuralError struct { + Msg string +} + +func (e StructuralError) Error() string { return "asn1: structure error: " + e.Msg } + +// A SyntaxError suggests that the ASN.1 data is invalid. +type SyntaxError struct { + Msg string +} + +func (e SyntaxError) Error() string { return "asn1: syntax error: " + e.Msg } + +// We start by dealing with each of the primitive types in turn. + +// BOOLEAN + +func parseBool(bytes []byte) (ret bool, err error) { + if len(bytes) != 1 { + err = SyntaxError{"invalid boolean"} + return + } + + // DER demands that "If the encoding represents the boolean value TRUE, + // its single contents octet shall have all eight bits set to one." + // Thus only 0 and 255 are valid encoded values. + switch bytes[0] { + case 0: + ret = false + case 0xff: + ret = true + default: + err = SyntaxError{"invalid boolean"} + } + + return +} + +// INTEGER + +// parseInt64 treats the given bytes as a big-endian, signed integer and +// returns the result. +func parseInt64(bytes []byte) (ret int64, err error) { + if len(bytes) > 8 { + // We'll overflow an int64 in this case. + err = StructuralError{"integer too large"} + return + } + for bytesRead := 0; bytesRead < len(bytes); bytesRead++ { + ret <<= 8 + ret |= int64(bytes[bytesRead]) + } + + // Shift up and down in order to sign extend the result. + ret <<= 64 - uint8(len(bytes))*8 + ret >>= 64 - uint8(len(bytes))*8 + return +} + +// parseInt treats the given bytes as a big-endian, signed integer and returns +// the result. +func parseInt32(bytes []byte) (int32, error) { + ret64, err := parseInt64(bytes) + if err != nil { + return 0, err + } + if ret64 != int64(int32(ret64)) { + return 0, StructuralError{"integer too large"} + } + return int32(ret64), nil +} + +var bigOne = big.NewInt(1) + +// parseBigInt treats the given bytes as a big-endian, signed integer and returns +// the result. +func parseBigInt(bytes []byte) *big.Int { + ret := new(big.Int) + if len(bytes) > 0 && bytes[0]&0x80 == 0x80 { + // This is a negative number. + notBytes := make([]byte, len(bytes)) + for i := range notBytes { + notBytes[i] = ^bytes[i] + } + ret.SetBytes(notBytes) + ret.Add(ret, bigOne) + ret.Neg(ret) + return ret + } + ret.SetBytes(bytes) + return ret +} + +// BIT STRING + +// BitString is the structure to use when you want an ASN.1 BIT STRING type. A +// bit string is padded up to the nearest byte in memory and the number of +// valid bits is recorded. Padding bits will be zero. +type BitString struct { + Bytes []byte // bits packed into bytes. + BitLength int // length in bits. +} + +// At returns the bit at the given index. If the index is out of range it +// returns false. +func (b BitString) At(i int) int { + if i < 0 || i >= b.BitLength { + return 0 + } + x := i / 8 + y := 7 - uint(i%8) + return int(b.Bytes[x]>>y) & 1 +} + +// RightAlign returns a slice where the padding bits are at the beginning. The +// slice may share memory with the BitString. +func (b BitString) RightAlign() []byte { + shift := uint(8 - (b.BitLength % 8)) + if shift == 8 || len(b.Bytes) == 0 { + return b.Bytes + } + + a := make([]byte, len(b.Bytes)) + a[0] = b.Bytes[0] >> shift + for i := 1; i < len(b.Bytes); i++ { + a[i] = b.Bytes[i-1] << (8 - shift) + a[i] |= b.Bytes[i] >> shift + } + + return a +} + +// parseBitString parses an ASN.1 bit string from the given byte slice and returns it. +func parseBitString(bytes []byte) (ret BitString, err error) { + if len(bytes) == 0 { + err = SyntaxError{"zero length BIT STRING"} + return + } + paddingBits := int(bytes[0]) + if paddingBits > 7 || + len(bytes) == 1 && paddingBits > 0 || + bytes[len(bytes)-1]&((1< 0 { + s += "." + } + s += strconv.Itoa(v) + } + + return s +} + +// parseObjectIdentifier parses an OBJECT IDENTIFIER from the given bytes and +// returns it. An object identifier is a sequence of variable length integers +// that are assigned in a hierarchy. +func parseObjectIdentifier(bytes []byte) (s []int, err error) { + if len(bytes) == 0 { + err = SyntaxError{"zero length OBJECT IDENTIFIER"} + return + } + + // In the worst case, we get two elements from the first byte (which is + // encoded differently) and then every varint is a single byte long. + s = make([]int, len(bytes)+1) + + // The first varint is 40*value1 + value2: + // According to this packing, value1 can take the values 0, 1 and 2 only. + // When value1 = 0 or value1 = 1, then value2 is <= 39. When value1 = 2, + // then there are no restrictions on value2. + v, offset, err := parseBase128Int(bytes, 0) + if err != nil { + return + } + if v < 80 { + s[0] = v / 40 + s[1] = v % 40 + } else { + s[0] = 2 + s[1] = v - 80 + } + + i := 2 + for ; offset < len(bytes); i++ { + v, offset, err = parseBase128Int(bytes, offset) + if err != nil { + return + } + s[i] = v + } + s = s[0:i] + return +} + +// ENUMERATED + +// An Enumerated is represented as a plain int. +type Enumerated int + +// FLAG + +// A Flag accepts any data and is set to true if present. +type Flag bool + +// parseBase128Int parses a base-128 encoded int from the given offset in the +// given byte slice. It returns the value and the new offset. +func parseBase128Int(bytes []byte, initOffset int) (ret, offset int, err error) { + offset = initOffset + for shifted := 0; offset < len(bytes); shifted++ { + if shifted > 4 { + err = StructuralError{"base 128 integer too large"} + return + } + ret <<= 7 + b := bytes[offset] + ret |= int(b & 0x7f) + offset++ + if b&0x80 == 0 { + return + } + } + err = SyntaxError{"truncated base 128 integer"} + return +} + +// UTCTime + +func parseUTCTime(bytes []byte) (ret time.Time, err error) { + s := string(bytes) + + formatStr := "0601021504Z0700" + ret, err = time.Parse(formatStr, s) + if err != nil { + formatStr = "060102150405Z0700" + ret, err = time.Parse(formatStr, s) + } + if err != nil { + return + } + + if serialized := ret.Format(formatStr); serialized != s { + err = fmt.Errorf("asn1: time did not serialize back to the original value and may be invalid: given %q, but serialized as %q", s, serialized) + return + } + + if ret.Year() >= 2050 { + // UTCTime only encodes times prior to 2050. See https://tools.ietf.org/html/rfc5280#section-4.1.2.5.1 + ret = ret.AddDate(-100, 0, 0) + } + + return +} + +// parseGeneralizedTime parses the GeneralizedTime from the given byte slice +// and returns the resulting time. +func parseGeneralizedTime(bytes []byte) (ret time.Time, err error) { + const formatStr = "20060102150405Z0700" + s := string(bytes) + + if ret, err = time.Parse(formatStr, s); err != nil { + return + } + + if serialized := ret.Format(formatStr); serialized != s { + err = fmt.Errorf("asn1: time did not serialize back to the original value and may be invalid: given %q, but serialized as %q", s, serialized) + } + + return +} + +// PrintableString + +// parsePrintableString parses a ASN.1 PrintableString from the given byte +// array and returns it. +func parsePrintableString(bytes []byte) (ret string, err error) { + for _, b := range bytes { + if !isPrintable(b) { + err = SyntaxError{"PrintableString contains invalid character"} + return + } + } + ret = string(bytes) + return +} + +// isPrintable reports whether the given b is in the ASN.1 PrintableString set. +func isPrintable(b byte) bool { + return 'a' <= b && b <= 'z' || + 'A' <= b && b <= 'Z' || + '0' <= b && b <= '9' || + '\'' <= b && b <= ')' || + '+' <= b && b <= '/' || + b == ' ' || + b == ':' || + b == '=' || + b == '?' || + // This is technically not allowed in a PrintableString. + // However, x509 certificates with wildcard strings don't + // always use the correct string type so we permit it. + b == '*' +} + +// IA5String + +// parseIA5String parses a ASN.1 IA5String (ASCII string) from the given +// byte slice and returns it. +func parseIA5String(bytes []byte) (ret string, err error) { + for _, b := range bytes { + if b >= 0x80 { + err = SyntaxError{"IA5String contains invalid character"} + return + } + } + ret = string(bytes) + return +} + +// T61String + +// parseT61String parses a ASN.1 T61String (8-bit clean string) from the given +// byte slice and returns it. +func parseT61String(bytes []byte) (ret string, err error) { + return string(bytes), nil +} + +// UTF8String + +// parseUTF8String parses a ASN.1 UTF8String (raw UTF-8) from the given byte +// array and returns it. +func parseUTF8String(bytes []byte) (ret string, err error) { + if !utf8.Valid(bytes) { + return "", errors.New("asn1: invalid UTF-8 string") + } + return string(bytes), nil +} + +// A RawValue represents an undecoded ASN.1 object. +type RawValue struct { + Class, Tag int + IsCompound bool + Bytes []byte + FullBytes []byte // includes the tag and length +} + +// RawContent is used to signal that the undecoded, DER data needs to be +// preserved for a struct. To use it, the first field of the struct must have +// this type. It's an error for any of the other fields to have this type. +type RawContent []byte + +// Tagging + +// parseTagAndLength parses an ASN.1 tag and length pair from the given offset +// into a byte slice. It returns the parsed data and the new offset. SET and +// SET OF (tag 17) are mapped to SEQUENCE and SEQUENCE OF (tag 16) since we +// don't distinguish between ordered and unordered objects in this code. +func parseTagAndLength(bytes []byte, initOffset int) (ret tagAndLength, offset int, err error) { + offset = initOffset + // parseTagAndLength should not be called without at least a single + // byte to read. Thus this check is for robustness: + if offset >= len(bytes) { + err = errors.New("asn1: internal error in parseTagAndLength") + return + } + b := bytes[offset] + offset++ + ret.class = int(b >> 6) + ret.isCompound = b&0x20 == 0x20 + ret.tag = int(b & 0x1f) + + // If the bottom five bits are set, then the tag number is actually base 128 + // encoded afterwards + if ret.tag == 0x1f { + ret.tag, offset, err = parseBase128Int(bytes, offset) + if err != nil { + return + } + } + if offset >= len(bytes) { + err = SyntaxError{"truncated tag or length"} + return + } + b = bytes[offset] + offset++ + if b&0x80 == 0 { + // The length is encoded in the bottom 7 bits. + ret.length = int(b & 0x7f) + } else { + // Bottom 7 bits give the number of length bytes to follow. + numBytes := int(b & 0x7f) + if numBytes == 0 { + err = SyntaxError{"indefinite length found (not DER)"} + return + } + ret.length = 0 + for i := 0; i < numBytes; i++ { + if offset >= len(bytes) { + err = SyntaxError{"truncated tag or length"} + return + } + b = bytes[offset] + offset++ + if ret.length >= 1<<23 { + // We can't shift ret.length up without + // overflowing. + err = StructuralError{"length too large"} + return + } + ret.length <<= 8 + ret.length |= int(b) + if ret.length == 0 { + // DER requires that lengths be minimal. + err = StructuralError{"superfluous leading zeros in length"} + return + } + } + } + + return +} + +// parseSequenceOf is used for SEQUENCE OF and SET OF values. It tries to parse +// a number of ASN.1 values from the given byte slice and returns them as a +// slice of Go values of the given type. +func parseSequenceOf(bytes []byte, sliceType reflect.Type, elemType reflect.Type) (ret reflect.Value, err error) { + expectedTag, compoundType, ok := getUniversalType(elemType) + if !ok { + err = StructuralError{"unknown Go type for slice"} + return + } + + // First we iterate over the input and count the number of elements, + // checking that the types are correct in each case. + numElements := 0 + for offset := 0; offset < len(bytes); { + var t tagAndLength + t, offset, err = parseTagAndLength(bytes, offset) + if err != nil { + return + } + switch t.tag { + case tagIA5String, tagGeneralString, tagT61String, tagUTF8String: + // We pretend that various other string types are + // PRINTABLE STRINGs so that a sequence of them can be + // parsed into a []string. + t.tag = tagPrintableString + case tagGeneralizedTime, tagUTCTime: + // Likewise, both time types are treated the same. + t.tag = tagUTCTime + } + + if t.class != classUniversal || t.isCompound != compoundType || t.tag != expectedTag { + err = StructuralError{"sequence tag mismatch"} + return + } + if invalidLength(offset, t.length, len(bytes)) { + err = SyntaxError{"truncated sequence"} + return + } + offset += t.length + numElements++ + } + ret = reflect.MakeSlice(sliceType, numElements, numElements) + params := fieldParameters{} + offset := 0 + for i := 0; i < numElements; i++ { + offset, err = parseField(ret.Index(i), bytes, offset, params) + if err != nil { + return + } + } + return +} + +var ( + bitStringType = reflect.TypeOf(BitString{}) + objectIdentifierType = reflect.TypeOf(ObjectIdentifier{}) + enumeratedType = reflect.TypeOf(Enumerated(0)) + flagType = reflect.TypeOf(Flag(false)) + timeType = reflect.TypeOf(time.Time{}) + rawValueType = reflect.TypeOf(RawValue{}) + rawContentsType = reflect.TypeOf(RawContent(nil)) + bigIntType = reflect.TypeOf(new(big.Int)) +) + +// invalidLength returns true iff offset + length > sliceLength, or if the +// addition would overflow. +func invalidLength(offset, length, sliceLength int) bool { + return offset+length < offset || offset+length > sliceLength +} + +// parseField is the main parsing function. Given a byte slice and an offset +// into the array, it will try to parse a suitable ASN.1 value out and store it +// in the given Value. +func parseField(v reflect.Value, bytes []byte, initOffset int, params fieldParameters) (offset int, err error) { + offset = initOffset + fieldType := v.Type() + + // If we have run out of data, it may be that there are optional elements at the end. + if offset == len(bytes) { + if !setDefaultValue(v, params) { + err = SyntaxError{"sequence truncated"} + } + return + } + + // Deal with raw values. + if fieldType == rawValueType { + var t tagAndLength + t, offset, err = parseTagAndLength(bytes, offset) + if err != nil { + return + } + if invalidLength(offset, t.length, len(bytes)) { + err = SyntaxError{"data truncated"} + return + } + result := RawValue{t.class, t.tag, t.isCompound, bytes[offset : offset+t.length], bytes[initOffset : offset+t.length]} + offset += t.length + v.Set(reflect.ValueOf(result)) + return + } + + // Deal with the ANY type. + if ifaceType := fieldType; ifaceType.Kind() == reflect.Interface && ifaceType.NumMethod() == 0 { + var t tagAndLength + t, offset, err = parseTagAndLength(bytes, offset) + if err != nil { + return + } + if invalidLength(offset, t.length, len(bytes)) { + err = SyntaxError{"data truncated"} + return + } + var result interface{} + if !t.isCompound && t.class == classUniversal { + innerBytes := bytes[offset : offset+t.length] + switch t.tag { + case tagPrintableString: + result, err = parsePrintableString(innerBytes) + case tagIA5String: + result, err = parseIA5String(innerBytes) + case tagT61String: + result, err = parseT61String(innerBytes) + case tagUTF8String: + result, err = parseUTF8String(innerBytes) + case tagInteger: + result, err = parseInt64(innerBytes) + case tagBitString: + result, err = parseBitString(innerBytes) + case tagOID: + result, err = parseObjectIdentifier(innerBytes) + case tagUTCTime: + result, err = parseUTCTime(innerBytes) + case tagGeneralizedTime: + result, err = parseGeneralizedTime(innerBytes) + case tagOctetString: + result = innerBytes + default: + // If we don't know how to handle the type, we just leave Value as nil. + } + } + offset += t.length + if err != nil { + return + } + if result != nil { + v.Set(reflect.ValueOf(result)) + } + return + } + universalTag, compoundType, ok1 := getUniversalType(fieldType) + if !ok1 { + err = StructuralError{fmt.Sprintf("unknown Go type: %v", fieldType)} + return + } + + t, offset, err := parseTagAndLength(bytes, offset) + if err != nil { + return + } + if params.explicit { + expectedClass := classContextSpecific + if params.application { + expectedClass = classApplication + } + if offset == len(bytes) { + err = StructuralError{"explicit tag has no child"} + return + } + if t.class == expectedClass && t.tag == *params.tag && (t.length == 0 || t.isCompound) { + if t.length > 0 { + t, offset, err = parseTagAndLength(bytes, offset) + if err != nil { + return + } + } else { + if fieldType != flagType { + err = StructuralError{"zero length explicit tag was not an asn1.Flag"} + return + } + v.SetBool(true) + return + } + } else { + // The tags didn't match, it might be an optional element. + ok := setDefaultValue(v, params) + if ok { + offset = initOffset + } else { + err = StructuralError{"explicitly tagged member didn't match"} + } + return + } + } + + // Special case for strings: all the ASN.1 string types map to the Go + // type string. getUniversalType returns the tag for PrintableString + // when it sees a string, so if we see a different string type on the + // wire, we change the universal type to match. + if universalTag == tagPrintableString { + if t.class == classUniversal { + switch t.tag { + case tagIA5String, tagGeneralString, tagT61String, tagUTF8String: + universalTag = t.tag + } + } else if params.stringType != 0 { + universalTag = params.stringType + } + } + + // Special case for time: UTCTime and GeneralizedTime both map to the + // Go type time.Time. + if universalTag == tagUTCTime && t.tag == tagGeneralizedTime && t.class == classUniversal { + universalTag = tagGeneralizedTime + } + + if params.set { + universalTag = tagSet + } + + expectedClass := classUniversal + expectedTag := universalTag + + if !params.explicit && params.tag != nil { + expectedClass = classContextSpecific + expectedTag = *params.tag + } + + if !params.explicit && params.application && params.tag != nil { + expectedClass = classApplication + expectedTag = *params.tag + } + + // We have unwrapped any explicit tagging at this point. + if t.class != expectedClass || t.tag != expectedTag || t.isCompound != compoundType { + // Tags don't match. Again, it could be an optional element. + ok := setDefaultValue(v, params) + if ok { + offset = initOffset + } else { + err = StructuralError{fmt.Sprintf("tags don't match (%d vs %+v) %+v %s @%d", expectedTag, t, params, fieldType.Name(), offset)} + } + return + } + if invalidLength(offset, t.length, len(bytes)) { + err = SyntaxError{"data truncated"} + return + } + innerBytes := bytes[offset : offset+t.length] + offset += t.length + + // We deal with the structures defined in this package first. + switch fieldType { + case objectIdentifierType: + newSlice, err1 := parseObjectIdentifier(innerBytes) + v.Set(reflect.MakeSlice(v.Type(), len(newSlice), len(newSlice))) + if err1 == nil { + reflect.Copy(v, reflect.ValueOf(newSlice)) + } + err = err1 + return + case bitStringType: + bs, err1 := parseBitString(innerBytes) + if err1 == nil { + v.Set(reflect.ValueOf(bs)) + } + err = err1 + return + case timeType: + var time time.Time + var err1 error + if universalTag == tagUTCTime { + time, err1 = parseUTCTime(innerBytes) + } else { + time, err1 = parseGeneralizedTime(innerBytes) + } + if err1 == nil { + v.Set(reflect.ValueOf(time)) + } + err = err1 + return + case enumeratedType: + parsedInt, err1 := parseInt32(innerBytes) + if err1 == nil { + v.SetInt(int64(parsedInt)) + } + err = err1 + return + case flagType: + v.SetBool(true) + return + case bigIntType: + parsedInt := parseBigInt(innerBytes) + v.Set(reflect.ValueOf(parsedInt)) + return + } + switch val := v; val.Kind() { + case reflect.Bool: + parsedBool, err1 := parseBool(innerBytes) + if err1 == nil { + val.SetBool(parsedBool) + } + err = err1 + return + case reflect.Int, reflect.Int32, reflect.Int64: + if val.Type().Size() == 4 { + parsedInt, err1 := parseInt32(innerBytes) + if err1 == nil { + val.SetInt(int64(parsedInt)) + } + err = err1 + } else { + parsedInt, err1 := parseInt64(innerBytes) + if err1 == nil { + val.SetInt(parsedInt) + } + err = err1 + } + return + // TODO(dfc) Add support for the remaining integer types + case reflect.Struct: + structType := fieldType + + if structType.NumField() > 0 && + structType.Field(0).Type == rawContentsType { + bytes := bytes[initOffset:offset] + val.Field(0).Set(reflect.ValueOf(RawContent(bytes))) + } + + innerOffset := 0 + for i := 0; i < structType.NumField(); i++ { + field := structType.Field(i) + if i == 0 && field.Type == rawContentsType { + continue + } + innerOffset, err = parseField(val.Field(i), innerBytes, innerOffset, parseFieldParameters(field.Tag.Get("asn1"))) + if err != nil { + return + } + } + // We allow extra bytes at the end of the SEQUENCE because + // adding elements to the end has been used in X.509 as the + // version numbers have increased. + return + case reflect.Slice: + sliceType := fieldType + if sliceType.Elem().Kind() == reflect.Uint8 { + val.Set(reflect.MakeSlice(sliceType, len(innerBytes), len(innerBytes))) + reflect.Copy(val, reflect.ValueOf(innerBytes)) + return + } + newSlice, err1 := parseSequenceOf(innerBytes, sliceType, sliceType.Elem()) + if err1 == nil { + val.Set(newSlice) + } + err = err1 + return + case reflect.String: + var v string + switch universalTag { + case tagPrintableString: + v, err = parsePrintableString(innerBytes) + case tagIA5String: + v, err = parseIA5String(innerBytes) + case tagT61String: + v, err = parseT61String(innerBytes) + case tagUTF8String: + v, err = parseUTF8String(innerBytes) + case tagGeneralString: + // GeneralString is specified in ISO-2022/ECMA-35, + // A brief review suggests that it includes structures + // that allow the encoding to change midstring and + // such. We give up and pass it as an 8-bit string. + v, err = parseT61String(innerBytes) + default: + err = SyntaxError{fmt.Sprintf("internal error: unknown string type %d", universalTag)} + } + if err == nil { + val.SetString(v) + } + return + } + err = StructuralError{"unsupported: " + v.Type().String()} + return +} + +// canHaveDefaultValue reports whether k is a Kind that we will set a default +// value for. (A signed integer, essentially.) +func canHaveDefaultValue(k reflect.Kind) bool { + switch k { + case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: + return true + } + + return false +} + +// setDefaultValue is used to install a default value, from a tag string, into +// a Value. It is successful if the field was optional, even if a default value +// wasn't provided or it failed to install it into the Value. +func setDefaultValue(v reflect.Value, params fieldParameters) (ok bool) { + if !params.optional { + return + } + ok = true + if params.defaultValue == nil { + return + } + if canHaveDefaultValue(v.Kind()) { + v.SetInt(*params.defaultValue) + } + return +} + +// Unmarshal parses the DER-encoded ASN.1 data structure b +// and uses the reflect package to fill in an arbitrary value pointed at by val. +// Because Unmarshal uses the reflect package, the structs +// being written to must use upper case field names. +// +// An ASN.1 INTEGER can be written to an int, int32, int64, +// or *big.Int (from the math/big package). +// If the encoded value does not fit in the Go type, +// Unmarshal returns a parse error. +// +// An ASN.1 BIT STRING can be written to a BitString. +// +// An ASN.1 OCTET STRING can be written to a []byte. +// +// An ASN.1 OBJECT IDENTIFIER can be written to an +// ObjectIdentifier. +// +// An ASN.1 ENUMERATED can be written to an Enumerated. +// +// An ASN.1 UTCTIME or GENERALIZEDTIME can be written to a time.Time. +// +// An ASN.1 PrintableString or IA5String can be written to a string. +// +// Any of the above ASN.1 values can be written to an interface{}. +// The value stored in the interface has the corresponding Go type. +// For integers, that type is int64. +// +// An ASN.1 SEQUENCE OF x or SET OF x can be written +// to a slice if an x can be written to the slice's element type. +// +// An ASN.1 SEQUENCE or SET can be written to a struct +// if each of the elements in the sequence can be +// written to the corresponding element in the struct. +// +// The following tags on struct fields have special meaning to Unmarshal: +// +// application specifies that a APPLICATION tag is used +// default:x sets the default value for optional integer fields +// explicit specifies that an additional, explicit tag wraps the implicit one +// optional marks the field as ASN.1 OPTIONAL +// set causes a SET, rather than a SEQUENCE type to be expected +// tag:x specifies the ASN.1 tag number; implies ASN.1 CONTEXT SPECIFIC +// +// If the type of the first field of a structure is RawContent then the raw +// ASN1 contents of the struct will be stored in it. +// +// If the type name of a slice element ends with "SET" then it's treated as if +// the "set" tag was set on it. This can be used with nested slices where a +// struct tag cannot be given. +// +// Other ASN.1 types are not supported; if it encounters them, +// Unmarshal returns a parse error. +func Unmarshal(b []byte, val interface{}) (rest []byte, err error) { + return UnmarshalWithParams(b, val, "") +} + +// UnmarshalWithParams allows field parameters to be specified for the +// top-level element. The form of the params is the same as the field tags. +func UnmarshalWithParams(b []byte, val interface{}, params string) (rest []byte, err error) { + v := reflect.ValueOf(val).Elem() + offset, err := parseField(v, b, 0, parseFieldParameters(params)) + if err != nil { + return nil, err + } + return b[offset:], nil +} diff --git a/src/encoding/asn1/asn1_test.go b/src/encoding/asn1/asn1_test.go new file mode 100644 index 0000000000000000000000000000000000000000..893d0801b00308ffd935d6d26426631fe3e9efc6 --- /dev/null +++ b/src/encoding/asn1/asn1_test.go @@ -0,0 +1,942 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package asn1 + +import ( + "bytes" + "fmt" + "math/big" + "reflect" + "strings" + "testing" + "time" +) + +type boolTest struct { + in []byte + ok bool + out bool +} + +var boolTestData = []boolTest{ + {[]byte{0x00}, true, false}, + {[]byte{0xff}, true, true}, + {[]byte{0x00, 0x00}, false, false}, + {[]byte{0xff, 0xff}, false, false}, + {[]byte{0x01}, false, false}, +} + +func TestParseBool(t *testing.T) { + for i, test := range boolTestData { + ret, err := parseBool(test.in) + if (err == nil) != test.ok { + t.Errorf("#%d: Incorrect error result (did fail? %v, expected: %v)", i, err == nil, test.ok) + } + if test.ok && ret != test.out { + t.Errorf("#%d: Bad result: %v (expected %v)", i, ret, test.out) + } + } +} + +type int64Test struct { + in []byte + ok bool + out int64 +} + +var int64TestData = []int64Test{ + {[]byte{0x00}, true, 0}, + {[]byte{0x7f}, true, 127}, + {[]byte{0x00, 0x80}, true, 128}, + {[]byte{0x01, 0x00}, true, 256}, + {[]byte{0x80}, true, -128}, + {[]byte{0xff, 0x7f}, true, -129}, + {[]byte{0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff}, true, -1}, + {[]byte{0xff}, true, -1}, + {[]byte{0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, true, -9223372036854775808}, + {[]byte{0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, false, 0}, +} + +func TestParseInt64(t *testing.T) { + for i, test := range int64TestData { + ret, err := parseInt64(test.in) + if (err == nil) != test.ok { + t.Errorf("#%d: Incorrect error result (did fail? %v, expected: %v)", i, err == nil, test.ok) + } + if test.ok && ret != test.out { + t.Errorf("#%d: Bad result: %v (expected %v)", i, ret, test.out) + } + } +} + +type int32Test struct { + in []byte + ok bool + out int32 +} + +var int32TestData = []int32Test{ + {[]byte{0x00}, true, 0}, + {[]byte{0x7f}, true, 127}, + {[]byte{0x00, 0x80}, true, 128}, + {[]byte{0x01, 0x00}, true, 256}, + {[]byte{0x80}, true, -128}, + {[]byte{0xff, 0x7f}, true, -129}, + {[]byte{0xff, 0xff, 0xff, 0xff}, true, -1}, + {[]byte{0xff}, true, -1}, + {[]byte{0x80, 0x00, 0x00, 0x00}, true, -2147483648}, + {[]byte{0x80, 0x00, 0x00, 0x00, 0x00}, false, 0}, +} + +func TestParseInt32(t *testing.T) { + for i, test := range int32TestData { + ret, err := parseInt32(test.in) + if (err == nil) != test.ok { + t.Errorf("#%d: Incorrect error result (did fail? %v, expected: %v)", i, err == nil, test.ok) + } + if test.ok && int32(ret) != test.out { + t.Errorf("#%d: Bad result: %v (expected %v)", i, ret, test.out) + } + } +} + +var bigIntTests = []struct { + in []byte + base10 string +}{ + {[]byte{0xff}, "-1"}, + {[]byte{0x00}, "0"}, + {[]byte{0x01}, "1"}, + {[]byte{0x00, 0xff}, "255"}, + {[]byte{0xff, 0x00}, "-256"}, + {[]byte{0x01, 0x00}, "256"}, +} + +func TestParseBigInt(t *testing.T) { + for i, test := range bigIntTests { + ret := parseBigInt(test.in) + if ret.String() != test.base10 { + t.Errorf("#%d: bad result from %x, got %s want %s", i, test.in, ret.String(), test.base10) + } + fw := newForkableWriter() + marshalBigInt(fw, ret) + result := fw.Bytes() + if !bytes.Equal(result, test.in) { + t.Errorf("#%d: got %x from marshaling %s, want %x", i, result, ret, test.in) + } + } +} + +type bitStringTest struct { + in []byte + ok bool + out []byte + bitLength int +} + +var bitStringTestData = []bitStringTest{ + {[]byte{}, false, []byte{}, 0}, + {[]byte{0x00}, true, []byte{}, 0}, + {[]byte{0x07, 0x00}, true, []byte{0x00}, 1}, + {[]byte{0x07, 0x01}, false, []byte{}, 0}, + {[]byte{0x07, 0x40}, false, []byte{}, 0}, + {[]byte{0x08, 0x00}, false, []byte{}, 0}, +} + +func TestBitString(t *testing.T) { + for i, test := range bitStringTestData { + ret, err := parseBitString(test.in) + if (err == nil) != test.ok { + t.Errorf("#%d: Incorrect error result (did fail? %v, expected: %v)", i, err == nil, test.ok) + } + if err == nil { + if test.bitLength != ret.BitLength || !bytes.Equal(ret.Bytes, test.out) { + t.Errorf("#%d: Bad result: %v (expected %v %v)", i, ret, test.out, test.bitLength) + } + } + } +} + +func TestBitStringAt(t *testing.T) { + bs := BitString{[]byte{0x82, 0x40}, 16} + if bs.At(0) != 1 { + t.Error("#1: Failed") + } + if bs.At(1) != 0 { + t.Error("#2: Failed") + } + if bs.At(6) != 1 { + t.Error("#3: Failed") + } + if bs.At(9) != 1 { + t.Error("#4: Failed") + } + if bs.At(-1) != 0 { + t.Error("#5: Failed") + } + if bs.At(17) != 0 { + t.Error("#6: Failed") + } +} + +type bitStringRightAlignTest struct { + in []byte + inlen int + out []byte +} + +var bitStringRightAlignTests = []bitStringRightAlignTest{ + {[]byte{0x80}, 1, []byte{0x01}}, + {[]byte{0x80, 0x80}, 9, []byte{0x01, 0x01}}, + {[]byte{}, 0, []byte{}}, + {[]byte{0xce}, 8, []byte{0xce}}, + {[]byte{0xce, 0x47}, 16, []byte{0xce, 0x47}}, + {[]byte{0x34, 0x50}, 12, []byte{0x03, 0x45}}, +} + +func TestBitStringRightAlign(t *testing.T) { + for i, test := range bitStringRightAlignTests { + bs := BitString{test.in, test.inlen} + out := bs.RightAlign() + if !bytes.Equal(out, test.out) { + t.Errorf("#%d got: %x want: %x", i, out, test.out) + } + } +} + +type objectIdentifierTest struct { + in []byte + ok bool + out []int +} + +var objectIdentifierTestData = []objectIdentifierTest{ + {[]byte{}, false, []int{}}, + {[]byte{85}, true, []int{2, 5}}, + {[]byte{85, 0x02}, true, []int{2, 5, 2}}, + {[]byte{85, 0x02, 0xc0, 0x00}, true, []int{2, 5, 2, 0x2000}}, + {[]byte{0x81, 0x34, 0x03}, true, []int{2, 100, 3}}, + {[]byte{85, 0x02, 0xc0, 0x80, 0x80, 0x80, 0x80}, false, []int{}}, +} + +func TestObjectIdentifier(t *testing.T) { + for i, test := range objectIdentifierTestData { + ret, err := parseObjectIdentifier(test.in) + if (err == nil) != test.ok { + t.Errorf("#%d: Incorrect error result (did fail? %v, expected: %v)", i, err == nil, test.ok) + } + if err == nil { + if !reflect.DeepEqual(test.out, ret) { + t.Errorf("#%d: Bad result: %v (expected %v)", i, ret, test.out) + } + } + } + + if s := ObjectIdentifier([]int{1, 2, 3, 4}).String(); s != "1.2.3.4" { + t.Errorf("bad ObjectIdentifier.String(). Got %s, want 1.2.3.4", s) + } +} + +type timeTest struct { + in string + ok bool + out time.Time +} + +var utcTestData = []timeTest{ + {"910506164540-0700", true, time.Date(1991, 05, 06, 16, 45, 40, 0, time.FixedZone("", -7*60*60))}, + {"910506164540+0730", true, time.Date(1991, 05, 06, 16, 45, 40, 0, time.FixedZone("", 7*60*60+30*60))}, + {"910506234540Z", true, time.Date(1991, 05, 06, 23, 45, 40, 0, time.UTC)}, + {"9105062345Z", true, time.Date(1991, 05, 06, 23, 45, 0, 0, time.UTC)}, + {"5105062345Z", true, time.Date(1951, 05, 06, 23, 45, 0, 0, time.UTC)}, + {"a10506234540Z", false, time.Time{}}, + {"91a506234540Z", false, time.Time{}}, + {"9105a6234540Z", false, time.Time{}}, + {"910506a34540Z", false, time.Time{}}, + {"910506334a40Z", false, time.Time{}}, + {"91050633444aZ", false, time.Time{}}, + {"910506334461Z", false, time.Time{}}, + {"910506334400Za", false, time.Time{}}, + /* These are invalid times. However, the time package normalises times + * and they were accepted in some versions. See #11134. */ + {"000100000000Z", false, time.Time{}}, + {"101302030405Z", false, time.Time{}}, + {"100002030405Z", false, time.Time{}}, + {"100100030405Z", false, time.Time{}}, + {"100132030405Z", false, time.Time{}}, + {"100231030405Z", false, time.Time{}}, + {"100102240405Z", false, time.Time{}}, + {"100102036005Z", false, time.Time{}}, + {"100102030460Z", false, time.Time{}}, + {"-100102030410Z", false, time.Time{}}, + {"10-0102030410Z", false, time.Time{}}, + {"10-0002030410Z", false, time.Time{}}, + {"1001-02030410Z", false, time.Time{}}, + {"100102-030410Z", false, time.Time{}}, + {"10010203-0410Z", false, time.Time{}}, + {"1001020304-10Z", false, time.Time{}}, +} + +func TestUTCTime(t *testing.T) { + for i, test := range utcTestData { + ret, err := parseUTCTime([]byte(test.in)) + if err != nil { + if test.ok { + t.Errorf("#%d: parseUTCTime(%q) = error %v", i, test.in, err) + } + continue + } + if !test.ok { + t.Errorf("#%d: parseUTCTime(%q) succeeded, should have failed", i, test.in) + continue + } + const format = "Jan _2 15:04:05 -0700 2006" // ignore zone name, just offset + have := ret.Format(format) + want := test.out.Format(format) + if have != want { + t.Errorf("#%d: parseUTCTime(%q) = %s, want %s", i, test.in, have, want) + } + } +} + +var generalizedTimeTestData = []timeTest{ + {"20100102030405Z", true, time.Date(2010, 01, 02, 03, 04, 05, 0, time.UTC)}, + {"20100102030405", false, time.Time{}}, + {"20100102030405+0607", true, time.Date(2010, 01, 02, 03, 04, 05, 0, time.FixedZone("", 6*60*60+7*60))}, + {"20100102030405-0607", true, time.Date(2010, 01, 02, 03, 04, 05, 0, time.FixedZone("", -6*60*60-7*60))}, + /* These are invalid times. However, the time package normalises times + * and they were accepted in some versions. See #11134. */ + {"00000100000000Z", false, time.Time{}}, + {"20101302030405Z", false, time.Time{}}, + {"20100002030405Z", false, time.Time{}}, + {"20100100030405Z", false, time.Time{}}, + {"20100132030405Z", false, time.Time{}}, + {"20100231030405Z", false, time.Time{}}, + {"20100102240405Z", false, time.Time{}}, + {"20100102036005Z", false, time.Time{}}, + {"20100102030460Z", false, time.Time{}}, + {"-20100102030410Z", false, time.Time{}}, + {"2010-0102030410Z", false, time.Time{}}, + {"2010-0002030410Z", false, time.Time{}}, + {"201001-02030410Z", false, time.Time{}}, + {"20100102-030410Z", false, time.Time{}}, + {"2010010203-0410Z", false, time.Time{}}, + {"201001020304-10Z", false, time.Time{}}, +} + +func TestGeneralizedTime(t *testing.T) { + for i, test := range generalizedTimeTestData { + ret, err := parseGeneralizedTime([]byte(test.in)) + if (err == nil) != test.ok { + t.Errorf("#%d: Incorrect error result (did fail? %v, expected: %v)", i, err == nil, test.ok) + } + if err == nil { + if !reflect.DeepEqual(test.out, ret) { + t.Errorf("#%d: Bad result: %q → %v (expected %v)", i, test.in, ret, test.out) + } + } + } +} + +type tagAndLengthTest struct { + in []byte + ok bool + out tagAndLength +} + +var tagAndLengthData = []tagAndLengthTest{ + {[]byte{0x80, 0x01}, true, tagAndLength{2, 0, 1, false}}, + {[]byte{0xa0, 0x01}, true, tagAndLength{2, 0, 1, true}}, + {[]byte{0x02, 0x00}, true, tagAndLength{0, 2, 0, false}}, + {[]byte{0xfe, 0x00}, true, tagAndLength{3, 30, 0, true}}, + {[]byte{0x1f, 0x01, 0x00}, true, tagAndLength{0, 1, 0, false}}, + {[]byte{0x1f, 0x81, 0x00, 0x00}, true, tagAndLength{0, 128, 0, false}}, + {[]byte{0x1f, 0x81, 0x80, 0x01, 0x00}, true, tagAndLength{0, 0x4001, 0, false}}, + {[]byte{0x00, 0x81, 0x01}, true, tagAndLength{0, 0, 1, false}}, + {[]byte{0x00, 0x82, 0x01, 0x00}, true, tagAndLength{0, 0, 256, false}}, + {[]byte{0x00, 0x83, 0x01, 0x00}, false, tagAndLength{}}, + {[]byte{0x1f, 0x85}, false, tagAndLength{}}, + {[]byte{0x30, 0x80}, false, tagAndLength{}}, + // Superfluous zeros in the length should be an error. + {[]byte{0xa0, 0x82, 0x00, 0x01}, false, tagAndLength{}}, + // Lengths up to the maximum size of an int should work. + {[]byte{0xa0, 0x84, 0x7f, 0xff, 0xff, 0xff}, true, tagAndLength{2, 0, 0x7fffffff, true}}, + // Lengths that would overflow an int should be rejected. + {[]byte{0xa0, 0x84, 0x80, 0x00, 0x00, 0x00}, false, tagAndLength{}}, +} + +func TestParseTagAndLength(t *testing.T) { + for i, test := range tagAndLengthData { + tagAndLength, _, err := parseTagAndLength(test.in, 0) + if (err == nil) != test.ok { + t.Errorf("#%d: Incorrect error result (did pass? %v, expected: %v)", i, err == nil, test.ok) + } + if err == nil && !reflect.DeepEqual(test.out, tagAndLength) { + t.Errorf("#%d: Bad result: %v (expected %v)", i, tagAndLength, test.out) + } + } +} + +type parseFieldParametersTest struct { + in string + out fieldParameters +} + +func newInt(n int) *int { return &n } + +func newInt64(n int64) *int64 { return &n } + +func newString(s string) *string { return &s } + +func newBool(b bool) *bool { return &b } + +var parseFieldParametersTestData []parseFieldParametersTest = []parseFieldParametersTest{ + {"", fieldParameters{}}, + {"ia5", fieldParameters{stringType: tagIA5String}}, + {"generalized", fieldParameters{timeType: tagGeneralizedTime}}, + {"utc", fieldParameters{timeType: tagUTCTime}}, + {"printable", fieldParameters{stringType: tagPrintableString}}, + {"optional", fieldParameters{optional: true}}, + {"explicit", fieldParameters{explicit: true, tag: new(int)}}, + {"application", fieldParameters{application: true, tag: new(int)}}, + {"optional,explicit", fieldParameters{optional: true, explicit: true, tag: new(int)}}, + {"default:42", fieldParameters{defaultValue: newInt64(42)}}, + {"tag:17", fieldParameters{tag: newInt(17)}}, + {"optional,explicit,default:42,tag:17", fieldParameters{optional: true, explicit: true, defaultValue: newInt64(42), tag: newInt(17)}}, + {"optional,explicit,default:42,tag:17,rubbish1", fieldParameters{true, true, false, newInt64(42), newInt(17), 0, 0, false, false}}, + {"set", fieldParameters{set: true}}, +} + +func TestParseFieldParameters(t *testing.T) { + for i, test := range parseFieldParametersTestData { + f := parseFieldParameters(test.in) + if !reflect.DeepEqual(f, test.out) { + t.Errorf("#%d: Bad result: %v (expected %v)", i, f, test.out) + } + } +} + +type TestObjectIdentifierStruct struct { + OID ObjectIdentifier +} + +type TestContextSpecificTags struct { + A int `asn1:"tag:1"` +} + +type TestContextSpecificTags2 struct { + A int `asn1:"explicit,tag:1"` + B int +} + +type TestContextSpecificTags3 struct { + S string `asn1:"tag:1,utf8"` +} + +type TestElementsAfterString struct { + S string + A, B int +} + +type TestBigInt struct { + X *big.Int +} + +type TestSet struct { + Ints []int `asn1:"set"` +} + +var unmarshalTestData = []struct { + in []byte + out interface{} +}{ + {[]byte{0x02, 0x01, 0x42}, newInt(0x42)}, + {[]byte{0x30, 0x08, 0x06, 0x06, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d}, &TestObjectIdentifierStruct{[]int{1, 2, 840, 113549}}}, + {[]byte{0x03, 0x04, 0x06, 0x6e, 0x5d, 0xc0}, &BitString{[]byte{110, 93, 192}, 18}}, + {[]byte{0x30, 0x09, 0x02, 0x01, 0x01, 0x02, 0x01, 0x02, 0x02, 0x01, 0x03}, &[]int{1, 2, 3}}, + {[]byte{0x02, 0x01, 0x10}, newInt(16)}, + {[]byte{0x13, 0x04, 't', 'e', 's', 't'}, newString("test")}, + {[]byte{0x16, 0x04, 't', 'e', 's', 't'}, newString("test")}, + {[]byte{0x16, 0x04, 't', 'e', 's', 't'}, &RawValue{0, 22, false, []byte("test"), []byte("\x16\x04test")}}, + {[]byte{0x04, 0x04, 1, 2, 3, 4}, &RawValue{0, 4, false, []byte{1, 2, 3, 4}, []byte{4, 4, 1, 2, 3, 4}}}, + {[]byte{0x30, 0x03, 0x81, 0x01, 0x01}, &TestContextSpecificTags{1}}, + {[]byte{0x30, 0x08, 0xa1, 0x03, 0x02, 0x01, 0x01, 0x02, 0x01, 0x02}, &TestContextSpecificTags2{1, 2}}, + {[]byte{0x30, 0x03, 0x81, 0x01, '@'}, &TestContextSpecificTags3{"@"}}, + {[]byte{0x01, 0x01, 0x00}, newBool(false)}, + {[]byte{0x01, 0x01, 0xff}, newBool(true)}, + {[]byte{0x30, 0x0b, 0x13, 0x03, 0x66, 0x6f, 0x6f, 0x02, 0x01, 0x22, 0x02, 0x01, 0x33}, &TestElementsAfterString{"foo", 0x22, 0x33}}, + {[]byte{0x30, 0x05, 0x02, 0x03, 0x12, 0x34, 0x56}, &TestBigInt{big.NewInt(0x123456)}}, + {[]byte{0x30, 0x0b, 0x31, 0x09, 0x02, 0x01, 0x01, 0x02, 0x01, 0x02, 0x02, 0x01, 0x03}, &TestSet{Ints: []int{1, 2, 3}}}, +} + +func TestUnmarshal(t *testing.T) { + for i, test := range unmarshalTestData { + pv := reflect.New(reflect.TypeOf(test.out).Elem()) + val := pv.Interface() + _, err := Unmarshal(test.in, val) + if err != nil { + t.Errorf("Unmarshal failed at index %d %v", i, err) + } + if !reflect.DeepEqual(val, test.out) { + t.Errorf("#%d:\nhave %#v\nwant %#v", i, val, test.out) + } + } +} + +type Certificate struct { + TBSCertificate TBSCertificate + SignatureAlgorithm AlgorithmIdentifier + SignatureValue BitString +} + +type TBSCertificate struct { + Version int `asn1:"optional,explicit,default:0,tag:0"` + SerialNumber RawValue + SignatureAlgorithm AlgorithmIdentifier + Issuer RDNSequence + Validity Validity + Subject RDNSequence + PublicKey PublicKeyInfo +} + +type AlgorithmIdentifier struct { + Algorithm ObjectIdentifier +} + +type RDNSequence []RelativeDistinguishedNameSET + +type RelativeDistinguishedNameSET []AttributeTypeAndValue + +type AttributeTypeAndValue struct { + Type ObjectIdentifier + Value interface{} +} + +type Validity struct { + NotBefore, NotAfter time.Time +} + +type PublicKeyInfo struct { + Algorithm AlgorithmIdentifier + PublicKey BitString +} + +func TestCertificate(t *testing.T) { + // This is a minimal, self-signed certificate that should parse correctly. + var cert Certificate + if _, err := Unmarshal(derEncodedSelfSignedCertBytes, &cert); err != nil { + t.Errorf("Unmarshal failed: %v", err) + } + if !reflect.DeepEqual(cert, derEncodedSelfSignedCert) { + t.Errorf("Bad result:\ngot: %+v\nwant: %+v", cert, derEncodedSelfSignedCert) + } +} + +func TestCertificateWithNUL(t *testing.T) { + // This is the paypal NUL-hack certificate. It should fail to parse because + // NUL isn't a permitted character in a PrintableString. + + var cert Certificate + if _, err := Unmarshal(derEncodedPaypalNULCertBytes, &cert); err == nil { + t.Error("Unmarshal succeeded, should not have") + } +} + +type rawStructTest struct { + Raw RawContent + A int +} + +func TestRawStructs(t *testing.T) { + var s rawStructTest + input := []byte{0x30, 0x03, 0x02, 0x01, 0x50} + + rest, err := Unmarshal(input, &s) + if len(rest) != 0 { + t.Errorf("incomplete parse: %x", rest) + return + } + if err != nil { + t.Error(err) + return + } + if s.A != 0x50 { + t.Errorf("bad value for A: got %d want %d", s.A, 0x50) + } + if !bytes.Equal([]byte(s.Raw), input) { + t.Errorf("bad value for Raw: got %x want %x", s.Raw, input) + } +} + +type oiEqualTest struct { + first ObjectIdentifier + second ObjectIdentifier + same bool +} + +var oiEqualTests = []oiEqualTest{ + { + ObjectIdentifier{1, 2, 3}, + ObjectIdentifier{1, 2, 3}, + true, + }, + { + ObjectIdentifier{1}, + ObjectIdentifier{1, 2, 3}, + false, + }, + { + ObjectIdentifier{1, 2, 3}, + ObjectIdentifier{10, 11, 12}, + false, + }, +} + +func TestObjectIdentifierEqual(t *testing.T) { + for _, o := range oiEqualTests { + if s := o.first.Equal(o.second); s != o.same { + t.Errorf("ObjectIdentifier.Equal: got: %t want: %t", s, o.same) + } + } +} + +var derEncodedSelfSignedCert = Certificate{ + TBSCertificate: TBSCertificate{ + Version: 0, + SerialNumber: RawValue{Class: 0, Tag: 2, IsCompound: false, Bytes: []uint8{0x0, 0x8c, 0xc3, 0x37, 0x92, 0x10, 0xec, 0x2c, 0x98}, FullBytes: []byte{2, 9, 0x0, 0x8c, 0xc3, 0x37, 0x92, 0x10, 0xec, 0x2c, 0x98}}, + SignatureAlgorithm: AlgorithmIdentifier{Algorithm: ObjectIdentifier{1, 2, 840, 113549, 1, 1, 5}}, + Issuer: RDNSequence{ + RelativeDistinguishedNameSET{AttributeTypeAndValue{Type: ObjectIdentifier{2, 5, 4, 6}, Value: "XX"}}, + RelativeDistinguishedNameSET{AttributeTypeAndValue{Type: ObjectIdentifier{2, 5, 4, 8}, Value: "Some-State"}}, + RelativeDistinguishedNameSET{AttributeTypeAndValue{Type: ObjectIdentifier{2, 5, 4, 7}, Value: "City"}}, + RelativeDistinguishedNameSET{AttributeTypeAndValue{Type: ObjectIdentifier{2, 5, 4, 10}, Value: "Internet Widgits Pty Ltd"}}, + RelativeDistinguishedNameSET{AttributeTypeAndValue{Type: ObjectIdentifier{2, 5, 4, 3}, Value: "false.example.com"}}, + RelativeDistinguishedNameSET{AttributeTypeAndValue{Type: ObjectIdentifier{1, 2, 840, 113549, 1, 9, 1}, Value: "false@example.com"}}, + }, + Validity: Validity{ + NotBefore: time.Date(2009, 10, 8, 00, 25, 53, 0, time.UTC), + NotAfter: time.Date(2010, 10, 8, 00, 25, 53, 0, time.UTC), + }, + Subject: RDNSequence{ + RelativeDistinguishedNameSET{AttributeTypeAndValue{Type: ObjectIdentifier{2, 5, 4, 6}, Value: "XX"}}, + RelativeDistinguishedNameSET{AttributeTypeAndValue{Type: ObjectIdentifier{2, 5, 4, 8}, Value: "Some-State"}}, + RelativeDistinguishedNameSET{AttributeTypeAndValue{Type: ObjectIdentifier{2, 5, 4, 7}, Value: "City"}}, + RelativeDistinguishedNameSET{AttributeTypeAndValue{Type: ObjectIdentifier{2, 5, 4, 10}, Value: "Internet Widgits Pty Ltd"}}, + RelativeDistinguishedNameSET{AttributeTypeAndValue{Type: ObjectIdentifier{2, 5, 4, 3}, Value: "false.example.com"}}, + RelativeDistinguishedNameSET{AttributeTypeAndValue{Type: ObjectIdentifier{1, 2, 840, 113549, 1, 9, 1}, Value: "false@example.com"}}, + }, + PublicKey: PublicKeyInfo{ + Algorithm: AlgorithmIdentifier{Algorithm: ObjectIdentifier{1, 2, 840, 113549, 1, 1, 1}}, + PublicKey: BitString{ + Bytes: []uint8{ + 0x30, 0x48, 0x2, 0x41, 0x0, 0xcd, 0xb7, + 0x63, 0x9c, 0x32, 0x78, 0xf0, 0x6, 0xaa, 0x27, 0x7f, 0x6e, 0xaf, 0x42, + 0x90, 0x2b, 0x59, 0x2d, 0x8c, 0xbc, 0xbe, 0x38, 0xa1, 0xc9, 0x2b, 0xa4, + 0x69, 0x5a, 0x33, 0x1b, 0x1d, 0xea, 0xde, 0xad, 0xd8, 0xe9, 0xa5, 0xc2, + 0x7e, 0x8c, 0x4c, 0x2f, 0xd0, 0xa8, 0x88, 0x96, 0x57, 0x72, 0x2a, 0x4f, + 0x2a, 0xf7, 0x58, 0x9c, 0xf2, 0xc7, 0x70, 0x45, 0xdc, 0x8f, 0xde, 0xec, + 0x35, 0x7d, 0x2, 0x3, 0x1, 0x0, 0x1, + }, + BitLength: 592, + }, + }, + }, + SignatureAlgorithm: AlgorithmIdentifier{Algorithm: ObjectIdentifier{1, 2, 840, 113549, 1, 1, 5}}, + SignatureValue: BitString{ + Bytes: []uint8{ + 0xa6, 0x7b, 0x6, 0xec, 0x5e, 0xce, + 0x92, 0x77, 0x2c, 0xa4, 0x13, 0xcb, 0xa3, 0xca, 0x12, 0x56, 0x8f, 0xdc, 0x6c, + 0x7b, 0x45, 0x11, 0xcd, 0x40, 0xa7, 0xf6, 0x59, 0x98, 0x4, 0x2, 0xdf, 0x2b, + 0x99, 0x8b, 0xb9, 0xa4, 0xa8, 0xcb, 0xeb, 0x34, 0xc0, 0xf0, 0xa7, 0x8c, 0xf8, + 0xd9, 0x1e, 0xde, 0x14, 0xa5, 0xed, 0x76, 0xbf, 0x11, 0x6f, 0xe3, 0x60, 0xaa, + 0xfa, 0x88, 0x21, 0x49, 0x4, 0x35, + }, + BitLength: 512, + }, +} + +var derEncodedSelfSignedCertBytes = []byte{ + 0x30, 0x82, 0x02, 0x18, 0x30, + 0x82, 0x01, 0xc2, 0x02, 0x09, 0x00, 0x8c, 0xc3, 0x37, 0x92, 0x10, 0xec, 0x2c, + 0x98, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, + 0x05, 0x05, 0x00, 0x30, 0x81, 0x92, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, + 0x04, 0x06, 0x13, 0x02, 0x58, 0x58, 0x31, 0x13, 0x30, 0x11, 0x06, 0x03, 0x55, + 0x04, 0x08, 0x13, 0x0a, 0x53, 0x6f, 0x6d, 0x65, 0x2d, 0x53, 0x74, 0x61, 0x74, + 0x65, 0x31, 0x0d, 0x30, 0x0b, 0x06, 0x03, 0x55, 0x04, 0x07, 0x13, 0x04, 0x43, + 0x69, 0x74, 0x79, 0x31, 0x21, 0x30, 0x1f, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x13, + 0x18, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x20, 0x57, 0x69, 0x64, + 0x67, 0x69, 0x74, 0x73, 0x20, 0x50, 0x74, 0x79, 0x20, 0x4c, 0x74, 0x64, 0x31, + 0x1a, 0x30, 0x18, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, 0x11, 0x66, 0x61, 0x6c, + 0x73, 0x65, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x63, 0x6f, + 0x6d, 0x31, 0x20, 0x30, 0x1e, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, + 0x01, 0x09, 0x01, 0x16, 0x11, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x40, 0x65, 0x78, + 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x30, 0x1e, 0x17, 0x0d, + 0x30, 0x39, 0x31, 0x30, 0x30, 0x38, 0x30, 0x30, 0x32, 0x35, 0x35, 0x33, 0x5a, + 0x17, 0x0d, 0x31, 0x30, 0x31, 0x30, 0x30, 0x38, 0x30, 0x30, 0x32, 0x35, 0x35, + 0x33, 0x5a, 0x30, 0x81, 0x92, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, + 0x06, 0x13, 0x02, 0x58, 0x58, 0x31, 0x13, 0x30, 0x11, 0x06, 0x03, 0x55, 0x04, + 0x08, 0x13, 0x0a, 0x53, 0x6f, 0x6d, 0x65, 0x2d, 0x53, 0x74, 0x61, 0x74, 0x65, + 0x31, 0x0d, 0x30, 0x0b, 0x06, 0x03, 0x55, 0x04, 0x07, 0x13, 0x04, 0x43, 0x69, + 0x74, 0x79, 0x31, 0x21, 0x30, 0x1f, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x13, 0x18, + 0x49, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x20, 0x57, 0x69, 0x64, 0x67, + 0x69, 0x74, 0x73, 0x20, 0x50, 0x74, 0x79, 0x20, 0x4c, 0x74, 0x64, 0x31, 0x1a, + 0x30, 0x18, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, 0x11, 0x66, 0x61, 0x6c, 0x73, + 0x65, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x63, 0x6f, 0x6d, + 0x31, 0x20, 0x30, 0x1e, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, + 0x09, 0x01, 0x16, 0x11, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x40, 0x65, 0x78, 0x61, + 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x30, 0x5c, 0x30, 0x0d, 0x06, + 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x01, 0x05, 0x00, 0x03, + 0x4b, 0x00, 0x30, 0x48, 0x02, 0x41, 0x00, 0xcd, 0xb7, 0x63, 0x9c, 0x32, 0x78, + 0xf0, 0x06, 0xaa, 0x27, 0x7f, 0x6e, 0xaf, 0x42, 0x90, 0x2b, 0x59, 0x2d, 0x8c, + 0xbc, 0xbe, 0x38, 0xa1, 0xc9, 0x2b, 0xa4, 0x69, 0x5a, 0x33, 0x1b, 0x1d, 0xea, + 0xde, 0xad, 0xd8, 0xe9, 0xa5, 0xc2, 0x7e, 0x8c, 0x4c, 0x2f, 0xd0, 0xa8, 0x88, + 0x96, 0x57, 0x72, 0x2a, 0x4f, 0x2a, 0xf7, 0x58, 0x9c, 0xf2, 0xc7, 0x70, 0x45, + 0xdc, 0x8f, 0xde, 0xec, 0x35, 0x7d, 0x02, 0x03, 0x01, 0x00, 0x01, 0x30, 0x0d, + 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x05, 0x05, 0x00, + 0x03, 0x41, 0x00, 0xa6, 0x7b, 0x06, 0xec, 0x5e, 0xce, 0x92, 0x77, 0x2c, 0xa4, + 0x13, 0xcb, 0xa3, 0xca, 0x12, 0x56, 0x8f, 0xdc, 0x6c, 0x7b, 0x45, 0x11, 0xcd, + 0x40, 0xa7, 0xf6, 0x59, 0x98, 0x04, 0x02, 0xdf, 0x2b, 0x99, 0x8b, 0xb9, 0xa4, + 0xa8, 0xcb, 0xeb, 0x34, 0xc0, 0xf0, 0xa7, 0x8c, 0xf8, 0xd9, 0x1e, 0xde, 0x14, + 0xa5, 0xed, 0x76, 0xbf, 0x11, 0x6f, 0xe3, 0x60, 0xaa, 0xfa, 0x88, 0x21, 0x49, + 0x04, 0x35, +} + +var derEncodedPaypalNULCertBytes = []byte{ + 0x30, 0x82, 0x06, 0x44, 0x30, + 0x82, 0x05, 0xad, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x03, 0x00, 0xf0, 0x9b, + 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x05, + 0x05, 0x00, 0x30, 0x82, 0x01, 0x12, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, + 0x04, 0x06, 0x13, 0x02, 0x45, 0x53, 0x31, 0x12, 0x30, 0x10, 0x06, 0x03, 0x55, + 0x04, 0x08, 0x13, 0x09, 0x42, 0x61, 0x72, 0x63, 0x65, 0x6c, 0x6f, 0x6e, 0x61, + 0x31, 0x12, 0x30, 0x10, 0x06, 0x03, 0x55, 0x04, 0x07, 0x13, 0x09, 0x42, 0x61, + 0x72, 0x63, 0x65, 0x6c, 0x6f, 0x6e, 0x61, 0x31, 0x29, 0x30, 0x27, 0x06, 0x03, + 0x55, 0x04, 0x0a, 0x13, 0x20, 0x49, 0x50, 0x53, 0x20, 0x43, 0x65, 0x72, 0x74, + 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x41, 0x75, 0x74, + 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x20, 0x73, 0x2e, 0x6c, 0x2e, 0x31, 0x2e, + 0x30, 0x2c, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x14, 0x25, 0x67, 0x65, 0x6e, 0x65, + 0x72, 0x61, 0x6c, 0x40, 0x69, 0x70, 0x73, 0x63, 0x61, 0x2e, 0x63, 0x6f, 0x6d, + 0x20, 0x43, 0x2e, 0x49, 0x2e, 0x46, 0x2e, 0x20, 0x20, 0x42, 0x2d, 0x42, 0x36, + 0x32, 0x32, 0x31, 0x30, 0x36, 0x39, 0x35, 0x31, 0x2e, 0x30, 0x2c, 0x06, 0x03, + 0x55, 0x04, 0x0b, 0x13, 0x25, 0x69, 0x70, 0x73, 0x43, 0x41, 0x20, 0x43, 0x4c, + 0x41, 0x53, 0x45, 0x41, 0x31, 0x20, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, + 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, + 0x69, 0x74, 0x79, 0x31, 0x2e, 0x30, 0x2c, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, + 0x25, 0x69, 0x70, 0x73, 0x43, 0x41, 0x20, 0x43, 0x4c, 0x41, 0x53, 0x45, 0x41, + 0x31, 0x20, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x20, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x31, + 0x20, 0x30, 0x1e, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, + 0x01, 0x16, 0x11, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x6c, 0x40, 0x69, 0x70, + 0x73, 0x63, 0x61, 0x2e, 0x63, 0x6f, 0x6d, 0x30, 0x1e, 0x17, 0x0d, 0x30, 0x39, + 0x30, 0x32, 0x32, 0x34, 0x32, 0x33, 0x30, 0x34, 0x31, 0x37, 0x5a, 0x17, 0x0d, + 0x31, 0x31, 0x30, 0x32, 0x32, 0x34, 0x32, 0x33, 0x30, 0x34, 0x31, 0x37, 0x5a, + 0x30, 0x81, 0x94, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, + 0x02, 0x55, 0x53, 0x31, 0x13, 0x30, 0x11, 0x06, 0x03, 0x55, 0x04, 0x08, 0x13, + 0x0a, 0x43, 0x61, 0x6c, 0x69, 0x66, 0x6f, 0x72, 0x6e, 0x69, 0x61, 0x31, 0x16, + 0x30, 0x14, 0x06, 0x03, 0x55, 0x04, 0x07, 0x13, 0x0d, 0x53, 0x61, 0x6e, 0x20, + 0x46, 0x72, 0x61, 0x6e, 0x63, 0x69, 0x73, 0x63, 0x6f, 0x31, 0x11, 0x30, 0x0f, + 0x06, 0x03, 0x55, 0x04, 0x0a, 0x13, 0x08, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, + 0x74, 0x79, 0x31, 0x14, 0x30, 0x12, 0x06, 0x03, 0x55, 0x04, 0x0b, 0x13, 0x0b, + 0x53, 0x65, 0x63, 0x75, 0x72, 0x65, 0x20, 0x55, 0x6e, 0x69, 0x74, 0x31, 0x2f, + 0x30, 0x2d, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, 0x26, 0x77, 0x77, 0x77, 0x2e, + 0x70, 0x61, 0x79, 0x70, 0x61, 0x6c, 0x2e, 0x63, 0x6f, 0x6d, 0x00, 0x73, 0x73, + 0x6c, 0x2e, 0x73, 0x65, 0x63, 0x75, 0x72, 0x65, 0x63, 0x6f, 0x6e, 0x6e, 0x65, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x63, 0x63, 0x30, 0x81, 0x9f, 0x30, 0x0d, + 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x01, 0x05, 0x00, + 0x03, 0x81, 0x8d, 0x00, 0x30, 0x81, 0x89, 0x02, 0x81, 0x81, 0x00, 0xd2, 0x69, + 0xfa, 0x6f, 0x3a, 0x00, 0xb4, 0x21, 0x1b, 0xc8, 0xb1, 0x02, 0xd7, 0x3f, 0x19, + 0xb2, 0xc4, 0x6d, 0xb4, 0x54, 0xf8, 0x8b, 0x8a, 0xcc, 0xdb, 0x72, 0xc2, 0x9e, + 0x3c, 0x60, 0xb9, 0xc6, 0x91, 0x3d, 0x82, 0xb7, 0x7d, 0x99, 0xff, 0xd1, 0x29, + 0x84, 0xc1, 0x73, 0x53, 0x9c, 0x82, 0xdd, 0xfc, 0x24, 0x8c, 0x77, 0xd5, 0x41, + 0xf3, 0xe8, 0x1e, 0x42, 0xa1, 0xad, 0x2d, 0x9e, 0xff, 0x5b, 0x10, 0x26, 0xce, + 0x9d, 0x57, 0x17, 0x73, 0x16, 0x23, 0x38, 0xc8, 0xd6, 0xf1, 0xba, 0xa3, 0x96, + 0x5b, 0x16, 0x67, 0x4a, 0x4f, 0x73, 0x97, 0x3a, 0x4d, 0x14, 0xa4, 0xf4, 0xe2, + 0x3f, 0x8b, 0x05, 0x83, 0x42, 0xd1, 0xd0, 0xdc, 0x2f, 0x7a, 0xe5, 0xb6, 0x10, + 0xb2, 0x11, 0xc0, 0xdc, 0x21, 0x2a, 0x90, 0xff, 0xae, 0x97, 0x71, 0x5a, 0x49, + 0x81, 0xac, 0x40, 0xf3, 0x3b, 0xb8, 0x59, 0xb2, 0x4f, 0x02, 0x03, 0x01, 0x00, + 0x01, 0xa3, 0x82, 0x03, 0x21, 0x30, 0x82, 0x03, 0x1d, 0x30, 0x09, 0x06, 0x03, + 0x55, 0x1d, 0x13, 0x04, 0x02, 0x30, 0x00, 0x30, 0x11, 0x06, 0x09, 0x60, 0x86, + 0x48, 0x01, 0x86, 0xf8, 0x42, 0x01, 0x01, 0x04, 0x04, 0x03, 0x02, 0x06, 0x40, + 0x30, 0x0b, 0x06, 0x03, 0x55, 0x1d, 0x0f, 0x04, 0x04, 0x03, 0x02, 0x03, 0xf8, + 0x30, 0x13, 0x06, 0x03, 0x55, 0x1d, 0x25, 0x04, 0x0c, 0x30, 0x0a, 0x06, 0x08, + 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x01, 0x30, 0x1d, 0x06, 0x03, 0x55, + 0x1d, 0x0e, 0x04, 0x16, 0x04, 0x14, 0x61, 0x8f, 0x61, 0x34, 0x43, 0x55, 0x14, + 0x7f, 0x27, 0x09, 0xce, 0x4c, 0x8b, 0xea, 0x9b, 0x7b, 0x19, 0x25, 0xbc, 0x6e, + 0x30, 0x1f, 0x06, 0x03, 0x55, 0x1d, 0x23, 0x04, 0x18, 0x30, 0x16, 0x80, 0x14, + 0x0e, 0x07, 0x60, 0xd4, 0x39, 0xc9, 0x1b, 0x5b, 0x5d, 0x90, 0x7b, 0x23, 0xc8, + 0xd2, 0x34, 0x9d, 0x4a, 0x9a, 0x46, 0x39, 0x30, 0x09, 0x06, 0x03, 0x55, 0x1d, + 0x11, 0x04, 0x02, 0x30, 0x00, 0x30, 0x1c, 0x06, 0x03, 0x55, 0x1d, 0x12, 0x04, + 0x15, 0x30, 0x13, 0x81, 0x11, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x6c, 0x40, + 0x69, 0x70, 0x73, 0x63, 0x61, 0x2e, 0x63, 0x6f, 0x6d, 0x30, 0x72, 0x06, 0x09, + 0x60, 0x86, 0x48, 0x01, 0x86, 0xf8, 0x42, 0x01, 0x0d, 0x04, 0x65, 0x16, 0x63, + 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, + 0x49, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x4e, + 0x4f, 0x54, 0x20, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x41, 0x54, 0x45, 0x44, 0x2e, + 0x20, 0x43, 0x4c, 0x41, 0x53, 0x45, 0x41, 0x31, 0x20, 0x53, 0x65, 0x72, 0x76, + 0x65, 0x72, 0x20, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, + 0x65, 0x20, 0x69, 0x73, 0x73, 0x75, 0x65, 0x64, 0x20, 0x62, 0x79, 0x20, 0x68, + 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x69, 0x70, + 0x73, 0x63, 0x61, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x30, 0x2f, 0x06, 0x09, 0x60, + 0x86, 0x48, 0x01, 0x86, 0xf8, 0x42, 0x01, 0x02, 0x04, 0x22, 0x16, 0x20, 0x68, + 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x69, 0x70, + 0x73, 0x63, 0x61, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x69, 0x70, 0x73, 0x63, 0x61, + 0x32, 0x30, 0x30, 0x32, 0x2f, 0x30, 0x43, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, + 0x86, 0xf8, 0x42, 0x01, 0x04, 0x04, 0x36, 0x16, 0x34, 0x68, 0x74, 0x74, 0x70, + 0x73, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x69, 0x70, 0x73, 0x63, 0x61, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x69, 0x70, 0x73, 0x63, 0x61, 0x32, 0x30, 0x30, + 0x32, 0x2f, 0x69, 0x70, 0x73, 0x63, 0x61, 0x32, 0x30, 0x30, 0x32, 0x43, 0x4c, + 0x41, 0x53, 0x45, 0x41, 0x31, 0x2e, 0x63, 0x72, 0x6c, 0x30, 0x46, 0x06, 0x09, + 0x60, 0x86, 0x48, 0x01, 0x86, 0xf8, 0x42, 0x01, 0x03, 0x04, 0x39, 0x16, 0x37, + 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x69, + 0x70, 0x73, 0x63, 0x61, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x69, 0x70, 0x73, 0x63, + 0x61, 0x32, 0x30, 0x30, 0x32, 0x2f, 0x72, 0x65, 0x76, 0x6f, 0x63, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x43, 0x4c, 0x41, 0x53, 0x45, 0x41, 0x31, 0x2e, 0x68, 0x74, + 0x6d, 0x6c, 0x3f, 0x30, 0x43, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x86, 0xf8, + 0x42, 0x01, 0x07, 0x04, 0x36, 0x16, 0x34, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, + 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x69, 0x70, 0x73, 0x63, 0x61, 0x2e, 0x63, + 0x6f, 0x6d, 0x2f, 0x69, 0x70, 0x73, 0x63, 0x61, 0x32, 0x30, 0x30, 0x32, 0x2f, + 0x72, 0x65, 0x6e, 0x65, 0x77, 0x61, 0x6c, 0x43, 0x4c, 0x41, 0x53, 0x45, 0x41, + 0x31, 0x2e, 0x68, 0x74, 0x6d, 0x6c, 0x3f, 0x30, 0x41, 0x06, 0x09, 0x60, 0x86, + 0x48, 0x01, 0x86, 0xf8, 0x42, 0x01, 0x08, 0x04, 0x34, 0x16, 0x32, 0x68, 0x74, + 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x69, 0x70, 0x73, + 0x63, 0x61, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x69, 0x70, 0x73, 0x63, 0x61, 0x32, + 0x30, 0x30, 0x32, 0x2f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x43, 0x4c, 0x41, + 0x53, 0x45, 0x41, 0x31, 0x2e, 0x68, 0x74, 0x6d, 0x6c, 0x30, 0x81, 0x83, 0x06, + 0x03, 0x55, 0x1d, 0x1f, 0x04, 0x7c, 0x30, 0x7a, 0x30, 0x39, 0xa0, 0x37, 0xa0, + 0x35, 0x86, 0x33, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, + 0x2e, 0x69, 0x70, 0x73, 0x63, 0x61, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x69, 0x70, + 0x73, 0x63, 0x61, 0x32, 0x30, 0x30, 0x32, 0x2f, 0x69, 0x70, 0x73, 0x63, 0x61, + 0x32, 0x30, 0x30, 0x32, 0x43, 0x4c, 0x41, 0x53, 0x45, 0x41, 0x31, 0x2e, 0x63, + 0x72, 0x6c, 0x30, 0x3d, 0xa0, 0x3b, 0xa0, 0x39, 0x86, 0x37, 0x68, 0x74, 0x74, + 0x70, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x62, 0x61, 0x63, 0x6b, 0x2e, 0x69, + 0x70, 0x73, 0x63, 0x61, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x69, 0x70, 0x73, 0x63, + 0x61, 0x32, 0x30, 0x30, 0x32, 0x2f, 0x69, 0x70, 0x73, 0x63, 0x61, 0x32, 0x30, + 0x30, 0x32, 0x43, 0x4c, 0x41, 0x53, 0x45, 0x41, 0x31, 0x2e, 0x63, 0x72, 0x6c, + 0x30, 0x32, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x01, 0x01, 0x04, + 0x26, 0x30, 0x24, 0x30, 0x22, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, + 0x30, 0x01, 0x86, 0x16, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x6f, 0x63, + 0x73, 0x70, 0x2e, 0x69, 0x70, 0x73, 0x63, 0x61, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, + 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x05, + 0x05, 0x00, 0x03, 0x81, 0x81, 0x00, 0x68, 0xee, 0x79, 0x97, 0x97, 0xdd, 0x3b, + 0xef, 0x16, 0x6a, 0x06, 0xf2, 0x14, 0x9a, 0x6e, 0xcd, 0x9e, 0x12, 0xf7, 0xaa, + 0x83, 0x10, 0xbd, 0xd1, 0x7c, 0x98, 0xfa, 0xc7, 0xae, 0xd4, 0x0e, 0x2c, 0x9e, + 0x38, 0x05, 0x9d, 0x52, 0x60, 0xa9, 0x99, 0x0a, 0x81, 0xb4, 0x98, 0x90, 0x1d, + 0xae, 0xbb, 0x4a, 0xd7, 0xb9, 0xdc, 0x88, 0x9e, 0x37, 0x78, 0x41, 0x5b, 0xf7, + 0x82, 0xa5, 0xf2, 0xba, 0x41, 0x25, 0x5a, 0x90, 0x1a, 0x1e, 0x45, 0x38, 0xa1, + 0x52, 0x58, 0x75, 0x94, 0x26, 0x44, 0xfb, 0x20, 0x07, 0xba, 0x44, 0xcc, 0xe5, + 0x4a, 0x2d, 0x72, 0x3f, 0x98, 0x47, 0xf6, 0x26, 0xdc, 0x05, 0x46, 0x05, 0x07, + 0x63, 0x21, 0xab, 0x46, 0x9b, 0x9c, 0x78, 0xd5, 0x54, 0x5b, 0x3d, 0x0c, 0x1e, + 0xc8, 0x64, 0x8c, 0xb5, 0x50, 0x23, 0x82, 0x6f, 0xdb, 0xb8, 0x22, 0x1c, 0x43, + 0x96, 0x07, 0xa8, 0xbb, +} + +var stringSliceTestData = [][]string{ + {"foo", "bar"}, + {"foo", "\\bar"}, + {"foo", "\"bar\""}, + {"foo", "åäö"}, +} + +func TestStringSlice(t *testing.T) { + for _, test := range stringSliceTestData { + bs, err := Marshal(test) + if err != nil { + t.Error(err) + } + + var res []string + _, err = Unmarshal(bs, &res) + if err != nil { + t.Error(err) + } + + if fmt.Sprintf("%v", res) != fmt.Sprintf("%v", test) { + t.Errorf("incorrect marshal/unmarshal; %v != %v", res, test) + } + } +} + +type explicitTaggedTimeTest struct { + Time time.Time `asn1:"explicit,tag:0"` +} + +var explicitTaggedTimeTestData = []struct { + in []byte + out explicitTaggedTimeTest +}{ + {[]byte{0x30, 0x11, 0xa0, 0xf, 0x17, 0xd, '9', '1', '0', '5', '0', '6', '1', '6', '4', '5', '4', '0', 'Z'}, + explicitTaggedTimeTest{time.Date(1991, 05, 06, 16, 45, 40, 0, time.UTC)}}, + {[]byte{0x30, 0x17, 0xa0, 0xf, 0x18, 0x13, '2', '0', '1', '0', '0', '1', '0', '2', '0', '3', '0', '4', '0', '5', '+', '0', '6', '0', '7'}, + explicitTaggedTimeTest{time.Date(2010, 01, 02, 03, 04, 05, 0, time.FixedZone("", 6*60*60+7*60))}}, +} + +func TestExplicitTaggedTime(t *testing.T) { + // Test that a time.Time will match either tagUTCTime or + // tagGeneralizedTime. + for i, test := range explicitTaggedTimeTestData { + var got explicitTaggedTimeTest + _, err := Unmarshal(test.in, &got) + if err != nil { + t.Errorf("Unmarshal failed at index %d %v", i, err) + } + if !got.Time.Equal(test.out.Time) { + t.Errorf("#%d: got %v, want %v", i, got.Time, test.out.Time) + } + } +} + +type implicitTaggedTimeTest struct { + Time time.Time `asn1:"tag:24"` +} + +func TestImplicitTaggedTime(t *testing.T) { + // An implicitly tagged time value, that happens to have an implicit + // tag equal to a GENERALIZEDTIME, should still be parsed as a UTCTime. + // (There's no "timeType" in fieldParameters to determine what type of + // time should be expected when implicitly tagged.) + der := []byte{0x30, 0x0f, 0x80 | 24, 0xd, '9', '1', '0', '5', '0', '6', '1', '6', '4', '5', '4', '0', 'Z'} + var result implicitTaggedTimeTest + if _, err := Unmarshal(der, &result); err != nil { + t.Fatalf("Error while parsing: %s", err) + } + if expected := time.Date(1991, 05, 06, 16, 45, 40, 0, time.UTC); !result.Time.Equal(expected) { + t.Errorf("Wrong result. Got %v, want %v", result.Time, expected) + } +} + +type truncatedExplicitTagTest struct { + Test int `asn1:"explicit,tag:0"` +} + +func TestTruncatedExplicitTag(t *testing.T) { + // This crashed Unmarshal in the past. See #11154. + der := []byte{ + 0x30, // SEQUENCE + 0x02, // two bytes long + 0xa0, // context-specific, tag 0 + 0x30, // 48 bytes long + } + + var result truncatedExplicitTagTest + if _, err := Unmarshal(der, &result); err == nil { + t.Error("Unmarshal returned without error") + } +} + +type invalidUTF8Test struct { + Str string `asn1:"utf8"` +} + +func TestUnmarshalInvalidUTF8(t *testing.T) { + data := []byte("0\x05\f\x03a\xc9c") + var result invalidUTF8Test + _, err := Unmarshal(data, &result) + + const expectedSubstring = "UTF" + if err == nil { + t.Fatal("Successfully unmarshaled invalid UTF-8 data") + } else if !strings.Contains(err.Error(), expectedSubstring) { + t.Fatalf("Expected error to mention %q but error was %q", expectedSubstring, err.Error()) + } +} diff --git a/src/encoding/asn1/common.go b/src/encoding/asn1/common.go new file mode 100644 index 0000000000000000000000000000000000000000..ab85e0496ff85171ee05f531eb4559c3694be7c7 --- /dev/null +++ b/src/encoding/asn1/common.go @@ -0,0 +1,168 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package asn1 + +import ( + "reflect" + "strconv" + "strings" +) + +// ASN.1 objects have metadata preceding them: +// the tag: the type of the object +// a flag denoting if this object is compound or not +// the class type: the namespace of the tag +// the length of the object, in bytes + +// Here are some standard tags and classes + +const ( + tagBoolean = 1 + tagInteger = 2 + tagBitString = 3 + tagOctetString = 4 + tagOID = 6 + tagEnum = 10 + tagUTF8String = 12 + tagSequence = 16 + tagSet = 17 + tagPrintableString = 19 + tagT61String = 20 + tagIA5String = 22 + tagUTCTime = 23 + tagGeneralizedTime = 24 + tagGeneralString = 27 +) + +const ( + classUniversal = 0 + classApplication = 1 + classContextSpecific = 2 + classPrivate = 3 +) + +type tagAndLength struct { + class, tag, length int + isCompound bool +} + +// ASN.1 has IMPLICIT and EXPLICIT tags, which can be translated as "instead +// of" and "in addition to". When not specified, every primitive type has a +// default tag in the UNIVERSAL class. +// +// For example: a BIT STRING is tagged [UNIVERSAL 3] by default (although ASN.1 +// doesn't actually have a UNIVERSAL keyword). However, by saying [IMPLICIT +// CONTEXT-SPECIFIC 42], that means that the tag is replaced by another. +// +// On the other hand, if it said [EXPLICIT CONTEXT-SPECIFIC 10], then an +// /additional/ tag would wrap the default tag. This explicit tag will have the +// compound flag set. +// +// (This is used in order to remove ambiguity with optional elements.) +// +// You can layer EXPLICIT and IMPLICIT tags to an arbitrary depth, however we +// don't support that here. We support a single layer of EXPLICIT or IMPLICIT +// tagging with tag strings on the fields of a structure. + +// fieldParameters is the parsed representation of tag string from a structure field. +type fieldParameters struct { + optional bool // true iff the field is OPTIONAL + explicit bool // true iff an EXPLICIT tag is in use. + application bool // true iff an APPLICATION tag is in use. + defaultValue *int64 // a default value for INTEGER typed fields (maybe nil). + tag *int // the EXPLICIT or IMPLICIT tag (maybe nil). + stringType int // the string tag to use when marshaling. + timeType int // the time tag to use when marshaling. + set bool // true iff this should be encoded as a SET + omitEmpty bool // true iff this should be omitted if empty when marshaling. + + // Invariants: + // if explicit is set, tag is non-nil. +} + +// Given a tag string with the format specified in the package comment, +// parseFieldParameters will parse it into a fieldParameters structure, +// ignoring unknown parts of the string. +func parseFieldParameters(str string) (ret fieldParameters) { + for _, part := range strings.Split(str, ",") { + switch { + case part == "optional": + ret.optional = true + case part == "explicit": + ret.explicit = true + if ret.tag == nil { + ret.tag = new(int) + } + case part == "generalized": + ret.timeType = tagGeneralizedTime + case part == "utc": + ret.timeType = tagUTCTime + case part == "ia5": + ret.stringType = tagIA5String + case part == "printable": + ret.stringType = tagPrintableString + case part == "utf8": + ret.stringType = tagUTF8String + case strings.HasPrefix(part, "default:"): + i, err := strconv.ParseInt(part[8:], 10, 64) + if err == nil { + ret.defaultValue = new(int64) + *ret.defaultValue = i + } + case strings.HasPrefix(part, "tag:"): + i, err := strconv.Atoi(part[4:]) + if err == nil { + ret.tag = new(int) + *ret.tag = i + } + case part == "set": + ret.set = true + case part == "application": + ret.application = true + if ret.tag == nil { + ret.tag = new(int) + } + case part == "omitempty": + ret.omitEmpty = true + } + } + return +} + +// Given a reflected Go type, getUniversalType returns the default tag number +// and expected compound flag. +func getUniversalType(t reflect.Type) (tagNumber int, isCompound, ok bool) { + switch t { + case objectIdentifierType: + return tagOID, false, true + case bitStringType: + return tagBitString, false, true + case timeType: + return tagUTCTime, false, true + case enumeratedType: + return tagEnum, false, true + case bigIntType: + return tagInteger, false, true + } + switch t.Kind() { + case reflect.Bool: + return tagBoolean, false, true + case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: + return tagInteger, false, true + case reflect.Struct: + return tagSequence, true, true + case reflect.Slice: + if t.Elem().Kind() == reflect.Uint8 { + return tagOctetString, false, true + } + if strings.HasSuffix(t.Name(), "SET") { + return tagSet, true, true + } + return tagSequence, true, true + case reflect.String: + return tagPrintableString, false, true + } + return 0, false, false +} diff --git a/src/encoding/asn1/marshal.go b/src/encoding/asn1/marshal.go new file mode 100644 index 0000000000000000000000000000000000000000..67a019db2d40677d68517e2d44330419f12e743b --- /dev/null +++ b/src/encoding/asn1/marshal.go @@ -0,0 +1,652 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package asn1 + +import ( + "bytes" + "errors" + "fmt" + "io" + "math/big" + "reflect" + "time" + "unicode/utf8" +) + +// A forkableWriter is an in-memory buffer that can be +// 'forked' to create new forkableWriters that bracket the +// original. After +// pre, post := w.fork() +// the overall sequence of bytes represented is logically w+pre+post. +type forkableWriter struct { + *bytes.Buffer + pre, post *forkableWriter +} + +func newForkableWriter() *forkableWriter { + return &forkableWriter{new(bytes.Buffer), nil, nil} +} + +func (f *forkableWriter) fork() (pre, post *forkableWriter) { + if f.pre != nil || f.post != nil { + panic("have already forked") + } + f.pre = newForkableWriter() + f.post = newForkableWriter() + return f.pre, f.post +} + +func (f *forkableWriter) Len() (l int) { + l += f.Buffer.Len() + if f.pre != nil { + l += f.pre.Len() + } + if f.post != nil { + l += f.post.Len() + } + return +} + +func (f *forkableWriter) writeTo(out io.Writer) (n int, err error) { + n, err = out.Write(f.Bytes()) + if err != nil { + return + } + + var nn int + + if f.pre != nil { + nn, err = f.pre.writeTo(out) + n += nn + if err != nil { + return + } + } + + if f.post != nil { + nn, err = f.post.writeTo(out) + n += nn + } + return +} + +func marshalBase128Int(out *forkableWriter, n int64) (err error) { + if n == 0 { + err = out.WriteByte(0) + return + } + + l := 0 + for i := n; i > 0; i >>= 7 { + l++ + } + + for i := l - 1; i >= 0; i-- { + o := byte(n >> uint(i*7)) + o &= 0x7f + if i != 0 { + o |= 0x80 + } + err = out.WriteByte(o) + if err != nil { + return + } + } + + return nil +} + +func marshalInt64(out *forkableWriter, i int64) (err error) { + n := int64Length(i) + + for ; n > 0; n-- { + err = out.WriteByte(byte(i >> uint((n-1)*8))) + if err != nil { + return + } + } + + return nil +} + +func int64Length(i int64) (numBytes int) { + numBytes = 1 + + for i > 127 { + numBytes++ + i >>= 8 + } + + for i < -128 { + numBytes++ + i >>= 8 + } + + return +} + +func marshalBigInt(out *forkableWriter, n *big.Int) (err error) { + if n.Sign() < 0 { + // A negative number has to be converted to two's-complement + // form. So we'll subtract 1 and invert. If the + // most-significant-bit isn't set then we'll need to pad the + // beginning with 0xff in order to keep the number negative. + nMinus1 := new(big.Int).Neg(n) + nMinus1.Sub(nMinus1, bigOne) + bytes := nMinus1.Bytes() + for i := range bytes { + bytes[i] ^= 0xff + } + if len(bytes) == 0 || bytes[0]&0x80 == 0 { + err = out.WriteByte(0xff) + if err != nil { + return + } + } + _, err = out.Write(bytes) + } else if n.Sign() == 0 { + // Zero is written as a single 0 zero rather than no bytes. + err = out.WriteByte(0x00) + } else { + bytes := n.Bytes() + if len(bytes) > 0 && bytes[0]&0x80 != 0 { + // We'll have to pad this with 0x00 in order to stop it + // looking like a negative number. + err = out.WriteByte(0) + if err != nil { + return + } + } + _, err = out.Write(bytes) + } + return +} + +func marshalLength(out *forkableWriter, i int) (err error) { + n := lengthLength(i) + + for ; n > 0; n-- { + err = out.WriteByte(byte(i >> uint((n-1)*8))) + if err != nil { + return + } + } + + return nil +} + +func lengthLength(i int) (numBytes int) { + numBytes = 1 + for i > 255 { + numBytes++ + i >>= 8 + } + return +} + +func marshalTagAndLength(out *forkableWriter, t tagAndLength) (err error) { + b := uint8(t.class) << 6 + if t.isCompound { + b |= 0x20 + } + if t.tag >= 31 { + b |= 0x1f + err = out.WriteByte(b) + if err != nil { + return + } + err = marshalBase128Int(out, int64(t.tag)) + if err != nil { + return + } + } else { + b |= uint8(t.tag) + err = out.WriteByte(b) + if err != nil { + return + } + } + + if t.length >= 128 { + l := lengthLength(t.length) + err = out.WriteByte(0x80 | byte(l)) + if err != nil { + return + } + err = marshalLength(out, t.length) + if err != nil { + return + } + } else { + err = out.WriteByte(byte(t.length)) + if err != nil { + return + } + } + + return nil +} + +func marshalBitString(out *forkableWriter, b BitString) (err error) { + paddingBits := byte((8 - b.BitLength%8) % 8) + err = out.WriteByte(paddingBits) + if err != nil { + return + } + _, err = out.Write(b.Bytes) + return +} + +func marshalObjectIdentifier(out *forkableWriter, oid []int) (err error) { + if len(oid) < 2 || oid[0] > 2 || (oid[0] < 2 && oid[1] >= 40) { + return StructuralError{"invalid object identifier"} + } + + err = marshalBase128Int(out, int64(oid[0]*40+oid[1])) + if err != nil { + return + } + for i := 2; i < len(oid); i++ { + err = marshalBase128Int(out, int64(oid[i])) + if err != nil { + return + } + } + + return +} + +func marshalPrintableString(out *forkableWriter, s string) (err error) { + b := []byte(s) + for _, c := range b { + if !isPrintable(c) { + return StructuralError{"PrintableString contains invalid character"} + } + } + + _, err = out.Write(b) + return +} + +func marshalIA5String(out *forkableWriter, s string) (err error) { + b := []byte(s) + for _, c := range b { + if c > 127 { + return StructuralError{"IA5String contains invalid character"} + } + } + + _, err = out.Write(b) + return +} + +func marshalUTF8String(out *forkableWriter, s string) (err error) { + _, err = out.Write([]byte(s)) + return +} + +func marshalTwoDigits(out *forkableWriter, v int) (err error) { + err = out.WriteByte(byte('0' + (v/10)%10)) + if err != nil { + return + } + return out.WriteByte(byte('0' + v%10)) +} + +func marshalFourDigits(out *forkableWriter, v int) (err error) { + var bytes [4]byte + for i := range bytes { + bytes[3-i] = '0' + byte(v%10) + v /= 10 + } + _, err = out.Write(bytes[:]) + return +} + +func outsideUTCRange(t time.Time) bool { + year := t.Year() + return year < 1950 || year >= 2050 +} + +func marshalUTCTime(out *forkableWriter, t time.Time) (err error) { + year := t.Year() + + switch { + case 1950 <= year && year < 2000: + err = marshalTwoDigits(out, int(year-1900)) + case 2000 <= year && year < 2050: + err = marshalTwoDigits(out, int(year-2000)) + default: + return StructuralError{"cannot represent time as UTCTime"} + } + if err != nil { + return + } + + return marshalTimeCommon(out, t) +} + +func marshalGeneralizedTime(out *forkableWriter, t time.Time) (err error) { + year := t.Year() + if year < 0 || year > 9999 { + return StructuralError{"cannot represent time as GeneralizedTime"} + } + if err = marshalFourDigits(out, year); err != nil { + return + } + + return marshalTimeCommon(out, t) +} + +func marshalTimeCommon(out *forkableWriter, t time.Time) (err error) { + _, month, day := t.Date() + + err = marshalTwoDigits(out, int(month)) + if err != nil { + return + } + + err = marshalTwoDigits(out, day) + if err != nil { + return + } + + hour, min, sec := t.Clock() + + err = marshalTwoDigits(out, hour) + if err != nil { + return + } + + err = marshalTwoDigits(out, min) + if err != nil { + return + } + + err = marshalTwoDigits(out, sec) + if err != nil { + return + } + + _, offset := t.Zone() + + switch { + case offset/60 == 0: + err = out.WriteByte('Z') + return + case offset > 0: + err = out.WriteByte('+') + case offset < 0: + err = out.WriteByte('-') + } + + if err != nil { + return + } + + offsetMinutes := offset / 60 + if offsetMinutes < 0 { + offsetMinutes = -offsetMinutes + } + + err = marshalTwoDigits(out, offsetMinutes/60) + if err != nil { + return + } + + err = marshalTwoDigits(out, offsetMinutes%60) + return +} + +func stripTagAndLength(in []byte) []byte { + _, offset, err := parseTagAndLength(in, 0) + if err != nil { + return in + } + return in[offset:] +} + +func marshalBody(out *forkableWriter, value reflect.Value, params fieldParameters) (err error) { + switch value.Type() { + case flagType: + return nil + case timeType: + t := value.Interface().(time.Time) + if params.timeType == tagGeneralizedTime || outsideUTCRange(t) { + return marshalGeneralizedTime(out, t) + } else { + return marshalUTCTime(out, t) + } + case bitStringType: + return marshalBitString(out, value.Interface().(BitString)) + case objectIdentifierType: + return marshalObjectIdentifier(out, value.Interface().(ObjectIdentifier)) + case bigIntType: + return marshalBigInt(out, value.Interface().(*big.Int)) + } + + switch v := value; v.Kind() { + case reflect.Bool: + if v.Bool() { + return out.WriteByte(255) + } else { + return out.WriteByte(0) + } + case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: + return marshalInt64(out, int64(v.Int())) + case reflect.Struct: + t := v.Type() + + startingField := 0 + + // If the first element of the structure is a non-empty + // RawContents, then we don't bother serializing the rest. + if t.NumField() > 0 && t.Field(0).Type == rawContentsType { + s := v.Field(0) + if s.Len() > 0 { + bytes := make([]byte, s.Len()) + for i := 0; i < s.Len(); i++ { + bytes[i] = uint8(s.Index(i).Uint()) + } + /* The RawContents will contain the tag and + * length fields but we'll also be writing + * those ourselves, so we strip them out of + * bytes */ + _, err = out.Write(stripTagAndLength(bytes)) + return + } else { + startingField = 1 + } + } + + for i := startingField; i < t.NumField(); i++ { + var pre *forkableWriter + pre, out = out.fork() + err = marshalField(pre, v.Field(i), parseFieldParameters(t.Field(i).Tag.Get("asn1"))) + if err != nil { + return + } + } + return + case reflect.Slice: + sliceType := v.Type() + if sliceType.Elem().Kind() == reflect.Uint8 { + bytes := make([]byte, v.Len()) + for i := 0; i < v.Len(); i++ { + bytes[i] = uint8(v.Index(i).Uint()) + } + _, err = out.Write(bytes) + return + } + + var fp fieldParameters + for i := 0; i < v.Len(); i++ { + var pre *forkableWriter + pre, out = out.fork() + err = marshalField(pre, v.Index(i), fp) + if err != nil { + return + } + } + return + case reflect.String: + switch params.stringType { + case tagIA5String: + return marshalIA5String(out, v.String()) + case tagPrintableString: + return marshalPrintableString(out, v.String()) + default: + return marshalUTF8String(out, v.String()) + } + } + + return StructuralError{"unknown Go type"} +} + +func marshalField(out *forkableWriter, v reflect.Value, params fieldParameters) (err error) { + // If the field is an interface{} then recurse into it. + if v.Kind() == reflect.Interface && v.Type().NumMethod() == 0 { + return marshalField(out, v.Elem(), params) + } + + if v.Kind() == reflect.Slice && v.Len() == 0 && params.omitEmpty { + return + } + + if params.optional && params.defaultValue != nil && canHaveDefaultValue(v.Kind()) { + defaultValue := reflect.New(v.Type()).Elem() + defaultValue.SetInt(*params.defaultValue) + + if reflect.DeepEqual(v.Interface(), defaultValue.Interface()) { + return + } + } + + // If no default value is given then the zero value for the type is + // assumed to be the default value. This isn't obviously the correct + // behaviour, but it's what Go has traditionally done. + if params.optional && params.defaultValue == nil { + if reflect.DeepEqual(v.Interface(), reflect.Zero(v.Type()).Interface()) { + return + } + } + + if v.Type() == rawValueType { + rv := v.Interface().(RawValue) + if len(rv.FullBytes) != 0 { + _, err = out.Write(rv.FullBytes) + } else { + err = marshalTagAndLength(out, tagAndLength{rv.Class, rv.Tag, len(rv.Bytes), rv.IsCompound}) + if err != nil { + return + } + _, err = out.Write(rv.Bytes) + } + return + } + + tag, isCompound, ok := getUniversalType(v.Type()) + if !ok { + err = StructuralError{fmt.Sprintf("unknown Go type: %v", v.Type())} + return + } + class := classUniversal + + if params.timeType != 0 && tag != tagUTCTime { + return StructuralError{"explicit time type given to non-time member"} + } + + if params.stringType != 0 && tag != tagPrintableString { + return StructuralError{"explicit string type given to non-string member"} + } + + switch tag { + case tagPrintableString: + if params.stringType == 0 { + // This is a string without an explicit string type. We'll use + // a PrintableString if the character set in the string is + // sufficiently limited, otherwise we'll use a UTF8String. + for _, r := range v.String() { + if r >= utf8.RuneSelf || !isPrintable(byte(r)) { + if !utf8.ValidString(v.String()) { + return errors.New("asn1: string not valid UTF-8") + } + tag = tagUTF8String + break + } + } + } else { + tag = params.stringType + } + case tagUTCTime: + if params.timeType == tagGeneralizedTime || outsideUTCRange(v.Interface().(time.Time)) { + tag = tagGeneralizedTime + } + } + + if params.set { + if tag != tagSequence { + return StructuralError{"non sequence tagged as set"} + } + tag = tagSet + } + + tags, body := out.fork() + + err = marshalBody(body, v, params) + if err != nil { + return + } + + bodyLen := body.Len() + + var explicitTag *forkableWriter + if params.explicit { + explicitTag, tags = tags.fork() + } + + if !params.explicit && params.tag != nil { + // implicit tag. + tag = *params.tag + class = classContextSpecific + } + + err = marshalTagAndLength(tags, tagAndLength{class, tag, bodyLen, isCompound}) + if err != nil { + return + } + + if params.explicit { + err = marshalTagAndLength(explicitTag, tagAndLength{ + class: classContextSpecific, + tag: *params.tag, + length: bodyLen + tags.Len(), + isCompound: true, + }) + } + + return nil +} + +// Marshal returns the ASN.1 encoding of val. +// +// In addition to the struct tags recognised by Unmarshal, the following can be +// used: +// +// ia5: causes strings to be marshaled as ASN.1, IA5 strings +// omitempty: causes empty slices to be skipped +// printable: causes strings to be marshaled as ASN.1, PrintableString strings. +// utf8: causes strings to be marshaled as ASN.1, UTF8 strings +func Marshal(val interface{}) ([]byte, error) { + var out bytes.Buffer + v := reflect.ValueOf(val) + f := newForkableWriter() + err := marshalField(f, v, fieldParameters{}) + if err != nil { + return nil, err + } + _, err = f.writeTo(&out) + return out.Bytes(), nil +} diff --git a/src/encoding/asn1/marshal_test.go b/src/encoding/asn1/marshal_test.go new file mode 100644 index 0000000000000000000000000000000000000000..cdca8aa33638d8eba823a0a730ced38a239c85f3 --- /dev/null +++ b/src/encoding/asn1/marshal_test.go @@ -0,0 +1,175 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package asn1 + +import ( + "bytes" + "encoding/hex" + "math/big" + "testing" + "time" +) + +type intStruct struct { + A int +} + +type twoIntStruct struct { + A int + B int +} + +type bigIntStruct struct { + A *big.Int +} + +type nestedStruct struct { + A intStruct +} + +type rawContentsStruct struct { + Raw RawContent + A int +} + +type implicitTagTest struct { + A int `asn1:"implicit,tag:5"` +} + +type explicitTagTest struct { + A int `asn1:"explicit,tag:5"` +} + +type flagTest struct { + A Flag `asn1:"tag:0,optional"` +} + +type generalizedTimeTest struct { + A time.Time `asn1:"generalized"` +} + +type ia5StringTest struct { + A string `asn1:"ia5"` +} + +type printableStringTest struct { + A string `asn1:"printable"` +} + +type optionalRawValueTest struct { + A RawValue `asn1:"optional"` +} + +type omitEmptyTest struct { + A []string `asn1:"omitempty"` +} + +type defaultTest struct { + A int `asn1:"optional,default:1"` +} + +type testSET []int + +var PST = time.FixedZone("PST", -8*60*60) + +type marshalTest struct { + in interface{} + out string // hex encoded +} + +func farFuture() time.Time { + t, err := time.Parse(time.RFC3339, "2100-04-05T12:01:01Z") + if err != nil { + panic(err) + } + return t +} + +var marshalTests = []marshalTest{ + {10, "02010a"}, + {127, "02017f"}, + {128, "02020080"}, + {-128, "020180"}, + {-129, "0202ff7f"}, + {intStruct{64}, "3003020140"}, + {bigIntStruct{big.NewInt(0x123456)}, "30050203123456"}, + {twoIntStruct{64, 65}, "3006020140020141"}, + {nestedStruct{intStruct{127}}, "3005300302017f"}, + {[]byte{1, 2, 3}, "0403010203"}, + {implicitTagTest{64}, "3003850140"}, + {explicitTagTest{64}, "3005a503020140"}, + {flagTest{true}, "30028000"}, + {flagTest{false}, "3000"}, + {time.Unix(0, 0).UTC(), "170d3730303130313030303030305a"}, + {time.Unix(1258325776, 0).UTC(), "170d3039313131353232353631365a"}, + {time.Unix(1258325776, 0).In(PST), "17113039313131353134353631362d30383030"}, + {farFuture(), "180f32313030303430353132303130315a"}, + {generalizedTimeTest{time.Unix(1258325776, 0).UTC()}, "3011180f32303039313131353232353631365a"}, + {BitString{[]byte{0x80}, 1}, "03020780"}, + {BitString{[]byte{0x81, 0xf0}, 12}, "03030481f0"}, + {ObjectIdentifier([]int{1, 2, 3, 4}), "06032a0304"}, + {ObjectIdentifier([]int{1, 2, 840, 133549, 1, 1, 5}), "06092a864888932d010105"}, + {ObjectIdentifier([]int{2, 100, 3}), "0603813403"}, + {"test", "130474657374"}, + { + "" + + "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + + "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + + "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + + "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", // This is 127 times 'x' + "137f" + + "7878787878787878787878787878787878787878787878787878787878787878" + + "7878787878787878787878787878787878787878787878787878787878787878" + + "7878787878787878787878787878787878787878787878787878787878787878" + + "78787878787878787878787878787878787878787878787878787878787878", + }, + { + "" + + "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + + "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + + "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + + "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", // This is 128 times 'x' + "138180" + + "7878787878787878787878787878787878787878787878787878787878787878" + + "7878787878787878787878787878787878787878787878787878787878787878" + + "7878787878787878787878787878787878787878787878787878787878787878" + + "7878787878787878787878787878787878787878787878787878787878787878", + }, + {ia5StringTest{"test"}, "3006160474657374"}, + {optionalRawValueTest{}, "3000"}, + {printableStringTest{"test"}, "3006130474657374"}, + {printableStringTest{"test*"}, "30071305746573742a"}, + {rawContentsStruct{nil, 64}, "3003020140"}, + {rawContentsStruct{[]byte{0x30, 3, 1, 2, 3}, 64}, "3003010203"}, + {RawValue{Tag: 1, Class: 2, IsCompound: false, Bytes: []byte{1, 2, 3}}, "8103010203"}, + {testSET([]int{10}), "310302010a"}, + {omitEmptyTest{[]string{}}, "3000"}, + {omitEmptyTest{[]string{"1"}}, "30053003130131"}, + {"Σ", "0c02cea3"}, + {defaultTest{0}, "3003020100"}, + {defaultTest{1}, "3000"}, + {defaultTest{2}, "3003020102"}, +} + +func TestMarshal(t *testing.T) { + for i, test := range marshalTests { + data, err := Marshal(test.in) + if err != nil { + t.Errorf("#%d failed: %s", i, err) + } + out, _ := hex.DecodeString(test.out) + if !bytes.Equal(out, data) { + t.Errorf("#%d got: %x want %x\n\t%q\n\t%q", i, data, out, data, out) + + } + } +} + +func TestInvalidUTF8(t *testing.T) { + _, err := Marshal(string([]byte{0xff, 0xff})) + if err == nil { + t.Errorf("invalid UTF8 string was accepted") + } +} diff --git a/src/encoding/base32/base32.go b/src/encoding/base32/base32.go new file mode 100644 index 0000000000000000000000000000000000000000..5a9e86919d80035a69febd7cc94eeabbf98db037 --- /dev/null +++ b/src/encoding/base32/base32.go @@ -0,0 +1,426 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package base32 implements base32 encoding as specified by RFC 4648. +package base32 + +import ( + "bytes" + "io" + "strconv" + "strings" +) + +/* + * Encodings + */ + +// An Encoding is a radix 32 encoding/decoding scheme, defined by a +// 32-character alphabet. The most common is the "base32" encoding +// introduced for SASL GSSAPI and standardized in RFC 4648. +// The alternate "base32hex" encoding is used in DNSSEC. +type Encoding struct { + encode string + decodeMap [256]byte +} + +const encodeStd = "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567" +const encodeHex = "0123456789ABCDEFGHIJKLMNOPQRSTUV" + +// NewEncoding returns a new Encoding defined by the given alphabet, +// which must be a 32-byte string. +func NewEncoding(encoder string) *Encoding { + e := new(Encoding) + e.encode = encoder + for i := 0; i < len(e.decodeMap); i++ { + e.decodeMap[i] = 0xFF + } + for i := 0; i < len(encoder); i++ { + e.decodeMap[encoder[i]] = byte(i) + } + return e +} + +// StdEncoding is the standard base32 encoding, as defined in +// RFC 4648. +var StdEncoding = NewEncoding(encodeStd) + +// HexEncoding is the ``Extended Hex Alphabet'' defined in RFC 4648. +// It is typically used in DNS. +var HexEncoding = NewEncoding(encodeHex) + +var removeNewlinesMapper = func(r rune) rune { + if r == '\r' || r == '\n' { + return -1 + } + return r +} + +/* + * Encoder + */ + +// Encode encodes src using the encoding enc, writing +// EncodedLen(len(src)) bytes to dst. +// +// The encoding pads the output to a multiple of 8 bytes, +// so Encode is not appropriate for use on individual blocks +// of a large data stream. Use NewEncoder() instead. +func (enc *Encoding) Encode(dst, src []byte) { + if len(src) == 0 { + return + } + + for len(src) > 0 { + var b0, b1, b2, b3, b4, b5, b6, b7 byte + + // Unpack 8x 5-bit source blocks into a 5 byte + // destination quantum + switch len(src) { + default: + b7 = src[4] & 0x1F + b6 = src[4] >> 5 + fallthrough + case 4: + b6 |= (src[3] << 3) & 0x1F + b5 = (src[3] >> 2) & 0x1F + b4 = src[3] >> 7 + fallthrough + case 3: + b4 |= (src[2] << 1) & 0x1F + b3 = (src[2] >> 4) & 0x1F + fallthrough + case 2: + b3 |= (src[1] << 4) & 0x1F + b2 = (src[1] >> 1) & 0x1F + b1 = (src[1] >> 6) & 0x1F + fallthrough + case 1: + b1 |= (src[0] << 2) & 0x1F + b0 = src[0] >> 3 + } + + // Encode 5-bit blocks using the base32 alphabet + dst[0] = enc.encode[b0] + dst[1] = enc.encode[b1] + dst[2] = enc.encode[b2] + dst[3] = enc.encode[b3] + dst[4] = enc.encode[b4] + dst[5] = enc.encode[b5] + dst[6] = enc.encode[b6] + dst[7] = enc.encode[b7] + + // Pad the final quantum + if len(src) < 5 { + dst[7] = '=' + if len(src) < 4 { + dst[6] = '=' + dst[5] = '=' + if len(src) < 3 { + dst[4] = '=' + if len(src) < 2 { + dst[3] = '=' + dst[2] = '=' + } + } + } + break + } + src = src[5:] + dst = dst[8:] + } +} + +// EncodeToString returns the base32 encoding of src. +func (enc *Encoding) EncodeToString(src []byte) string { + buf := make([]byte, enc.EncodedLen(len(src))) + enc.Encode(buf, src) + return string(buf) +} + +type encoder struct { + err error + enc *Encoding + w io.Writer + buf [5]byte // buffered data waiting to be encoded + nbuf int // number of bytes in buf + out [1024]byte // output buffer +} + +func (e *encoder) Write(p []byte) (n int, err error) { + if e.err != nil { + return 0, e.err + } + + // Leading fringe. + if e.nbuf > 0 { + var i int + for i = 0; i < len(p) && e.nbuf < 5; i++ { + e.buf[e.nbuf] = p[i] + e.nbuf++ + } + n += i + p = p[i:] + if e.nbuf < 5 { + return + } + e.enc.Encode(e.out[0:], e.buf[0:]) + if _, e.err = e.w.Write(e.out[0:8]); e.err != nil { + return n, e.err + } + e.nbuf = 0 + } + + // Large interior chunks. + for len(p) >= 5 { + nn := len(e.out) / 8 * 5 + if nn > len(p) { + nn = len(p) + nn -= nn % 5 + } + e.enc.Encode(e.out[0:], p[0:nn]) + if _, e.err = e.w.Write(e.out[0 : nn/5*8]); e.err != nil { + return n, e.err + } + n += nn + p = p[nn:] + } + + // Trailing fringe. + for i := 0; i < len(p); i++ { + e.buf[i] = p[i] + } + e.nbuf = len(p) + n += len(p) + return +} + +// Close flushes any pending output from the encoder. +// It is an error to call Write after calling Close. +func (e *encoder) Close() error { + // If there's anything left in the buffer, flush it out + if e.err == nil && e.nbuf > 0 { + e.enc.Encode(e.out[0:], e.buf[0:e.nbuf]) + e.nbuf = 0 + _, e.err = e.w.Write(e.out[0:8]) + } + return e.err +} + +// NewEncoder returns a new base32 stream encoder. Data written to +// the returned writer will be encoded using enc and then written to w. +// Base32 encodings operate in 5-byte blocks; when finished +// writing, the caller must Close the returned encoder to flush any +// partially written blocks. +func NewEncoder(enc *Encoding, w io.Writer) io.WriteCloser { + return &encoder{enc: enc, w: w} +} + +// EncodedLen returns the length in bytes of the base32 encoding +// of an input buffer of length n. +func (enc *Encoding) EncodedLen(n int) int { return (n + 4) / 5 * 8 } + +/* + * Decoder + */ + +type CorruptInputError int64 + +func (e CorruptInputError) Error() string { + return "illegal base32 data at input byte " + strconv.FormatInt(int64(e), 10) +} + +// decode is like Decode but returns an additional 'end' value, which +// indicates if end-of-message padding was encountered and thus any +// additional data is an error. This method assumes that src has been +// stripped of all supported whitespace ('\r' and '\n'). +func (enc *Encoding) decode(dst, src []byte) (n int, end bool, err error) { + olen := len(src) + for len(src) > 0 && !end { + // Decode quantum using the base32 alphabet + var dbuf [8]byte + dlen := 8 + + for j := 0; j < 8; { + if len(src) == 0 { + return n, false, CorruptInputError(olen - len(src) - j) + } + in := src[0] + src = src[1:] + if in == '=' && j >= 2 && len(src) < 8 { + // We've reached the end and there's padding + if len(src)+j < 8-1 { + // not enough padding + return n, false, CorruptInputError(olen) + } + for k := 0; k < 8-1-j; k++ { + if len(src) > k && src[k] != '=' { + // incorrect padding + return n, false, CorruptInputError(olen - len(src) + k - 1) + } + } + dlen, end = j, true + // 7, 5 and 2 are not valid padding lengths, and so 1, 3 and 6 are not + // valid dlen values. See RFC 4648 Section 6 "Base 32 Encoding" listing + // the five valid padding lengths, and Section 9 "Illustrations and + // Examples" for an illustration for how the 1st, 3rd and 6th base32 + // src bytes do not yield enough information to decode a dst byte. + if dlen == 1 || dlen == 3 || dlen == 6 { + return n, false, CorruptInputError(olen - len(src) - 1) + } + break + } + dbuf[j] = enc.decodeMap[in] + if dbuf[j] == 0xFF { + return n, false, CorruptInputError(olen - len(src) - 1) + } + j++ + } + + // Pack 8x 5-bit source blocks into 5 byte destination + // quantum + switch dlen { + case 8: + dst[4] = dbuf[6]<<5 | dbuf[7] + fallthrough + case 7: + dst[3] = dbuf[4]<<7 | dbuf[5]<<2 | dbuf[6]>>3 + fallthrough + case 5: + dst[2] = dbuf[3]<<4 | dbuf[4]>>1 + fallthrough + case 4: + dst[1] = dbuf[1]<<6 | dbuf[2]<<1 | dbuf[3]>>4 + fallthrough + case 2: + dst[0] = dbuf[0]<<3 | dbuf[1]>>2 + } + dst = dst[5:] + switch dlen { + case 2: + n += 1 + case 4: + n += 2 + case 5: + n += 3 + case 7: + n += 4 + case 8: + n += 5 + } + } + return n, end, nil +} + +// Decode decodes src using the encoding enc. It writes at most +// DecodedLen(len(src)) bytes to dst and returns the number of bytes +// written. If src contains invalid base32 data, it will return the +// number of bytes successfully written and CorruptInputError. +// New line characters (\r and \n) are ignored. +func (enc *Encoding) Decode(dst, src []byte) (n int, err error) { + src = bytes.Map(removeNewlinesMapper, src) + n, _, err = enc.decode(dst, src) + return +} + +// DecodeString returns the bytes represented by the base32 string s. +func (enc *Encoding) DecodeString(s string) ([]byte, error) { + s = strings.Map(removeNewlinesMapper, s) + dbuf := make([]byte, enc.DecodedLen(len(s))) + n, _, err := enc.decode(dbuf, []byte(s)) + return dbuf[:n], err +} + +type decoder struct { + err error + enc *Encoding + r io.Reader + end bool // saw end of message + buf [1024]byte // leftover input + nbuf int + out []byte // leftover decoded output + outbuf [1024 / 8 * 5]byte +} + +func (d *decoder) Read(p []byte) (n int, err error) { + if d.err != nil { + return 0, d.err + } + + // Use leftover decoded output from last read. + if len(d.out) > 0 { + n = copy(p, d.out) + d.out = d.out[n:] + return n, nil + } + + // Read a chunk. + nn := len(p) / 5 * 8 + if nn < 8 { + nn = 8 + } + if nn > len(d.buf) { + nn = len(d.buf) + } + nn, d.err = io.ReadAtLeast(d.r, d.buf[d.nbuf:nn], 8-d.nbuf) + d.nbuf += nn + if d.nbuf < 8 { + return 0, d.err + } + + // Decode chunk into p, or d.out and then p if p is too small. + nr := d.nbuf / 8 * 8 + nw := d.nbuf / 8 * 5 + if nw > len(p) { + nw, d.end, d.err = d.enc.decode(d.outbuf[0:], d.buf[0:nr]) + d.out = d.outbuf[0:nw] + n = copy(p, d.out) + d.out = d.out[n:] + } else { + n, d.end, d.err = d.enc.decode(p, d.buf[0:nr]) + } + d.nbuf -= nr + for i := 0; i < d.nbuf; i++ { + d.buf[i] = d.buf[i+nr] + } + + if d.err == nil { + d.err = err + } + return n, d.err +} + +type newlineFilteringReader struct { + wrapped io.Reader +} + +func (r *newlineFilteringReader) Read(p []byte) (int, error) { + n, err := r.wrapped.Read(p) + for n > 0 { + offset := 0 + for i, b := range p[0:n] { + if b != '\r' && b != '\n' { + if i != offset { + p[offset] = b + } + offset++ + } + } + if offset > 0 { + return offset, err + } + // Previous buffer entirely whitespace, read again + n, err = r.wrapped.Read(p) + } + return n, err +} + +// NewDecoder constructs a new base32 stream decoder. +func NewDecoder(enc *Encoding, r io.Reader) io.Reader { + return &decoder{enc: enc, r: &newlineFilteringReader{r}} +} + +// DecodedLen returns the maximum length in bytes of the decoded data +// corresponding to n bytes of base32-encoded data. +func (enc *Encoding) DecodedLen(n int) int { return n / 8 * 5 } diff --git a/src/encoding/base32/base32_test.go b/src/encoding/base32/base32_test.go new file mode 100644 index 0000000000000000000000000000000000000000..5a68f06e1c94bc12e86fb2f91035fe3c1b3d4435 --- /dev/null +++ b/src/encoding/base32/base32_test.go @@ -0,0 +1,302 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package base32 + +import ( + "bytes" + "io" + "io/ioutil" + "strings" + "testing" +) + +type testpair struct { + decoded, encoded string +} + +var pairs = []testpair{ + // RFC 4648 examples + {"", ""}, + {"f", "MY======"}, + {"fo", "MZXQ===="}, + {"foo", "MZXW6==="}, + {"foob", "MZXW6YQ="}, + {"fooba", "MZXW6YTB"}, + {"foobar", "MZXW6YTBOI======"}, + + // Wikipedia examples, converted to base32 + {"sure.", "ON2XEZJO"}, + {"sure", "ON2XEZI="}, + {"sur", "ON2XE==="}, + {"su", "ON2Q===="}, + {"leasure.", "NRSWC43VOJSS4==="}, + {"easure.", "MVQXG5LSMUXA===="}, + {"asure.", "MFZXK4TFFY======"}, + {"sure.", "ON2XEZJO"}, +} + +var bigtest = testpair{ + "Twas brillig, and the slithy toves", + "KR3WC4ZAMJZGS3DMNFTSYIDBNZSCA5DIMUQHG3DJORUHSIDUN53GK4Y=", +} + +func testEqual(t *testing.T, msg string, args ...interface{}) bool { + if args[len(args)-2] != args[len(args)-1] { + t.Errorf(msg, args...) + return false + } + return true +} + +func TestEncode(t *testing.T) { + for _, p := range pairs { + got := StdEncoding.EncodeToString([]byte(p.decoded)) + testEqual(t, "Encode(%q) = %q, want %q", p.decoded, got, p.encoded) + } +} + +func TestEncoder(t *testing.T) { + for _, p := range pairs { + bb := &bytes.Buffer{} + encoder := NewEncoder(StdEncoding, bb) + encoder.Write([]byte(p.decoded)) + encoder.Close() + testEqual(t, "Encode(%q) = %q, want %q", p.decoded, bb.String(), p.encoded) + } +} + +func TestEncoderBuffering(t *testing.T) { + input := []byte(bigtest.decoded) + for bs := 1; bs <= 12; bs++ { + bb := &bytes.Buffer{} + encoder := NewEncoder(StdEncoding, bb) + for pos := 0; pos < len(input); pos += bs { + end := pos + bs + if end > len(input) { + end = len(input) + } + n, err := encoder.Write(input[pos:end]) + testEqual(t, "Write(%q) gave error %v, want %v", input[pos:end], err, error(nil)) + testEqual(t, "Write(%q) gave length %v, want %v", input[pos:end], n, end-pos) + } + err := encoder.Close() + testEqual(t, "Close gave error %v, want %v", err, error(nil)) + testEqual(t, "Encoding/%d of %q = %q, want %q", bs, bigtest.decoded, bb.String(), bigtest.encoded) + } +} + +func TestDecode(t *testing.T) { + for _, p := range pairs { + dbuf := make([]byte, StdEncoding.DecodedLen(len(p.encoded))) + count, end, err := StdEncoding.decode(dbuf, []byte(p.encoded)) + testEqual(t, "Decode(%q) = error %v, want %v", p.encoded, err, error(nil)) + testEqual(t, "Decode(%q) = length %v, want %v", p.encoded, count, len(p.decoded)) + if len(p.encoded) > 0 { + testEqual(t, "Decode(%q) = end %v, want %v", p.encoded, end, (p.encoded[len(p.encoded)-1] == '=')) + } + testEqual(t, "Decode(%q) = %q, want %q", p.encoded, + string(dbuf[0:count]), + p.decoded) + + dbuf, err = StdEncoding.DecodeString(p.encoded) + testEqual(t, "DecodeString(%q) = error %v, want %v", p.encoded, err, error(nil)) + testEqual(t, "DecodeString(%q) = %q, want %q", p.encoded, string(dbuf), p.decoded) + } +} + +func TestDecoder(t *testing.T) { + for _, p := range pairs { + decoder := NewDecoder(StdEncoding, strings.NewReader(p.encoded)) + dbuf := make([]byte, StdEncoding.DecodedLen(len(p.encoded))) + count, err := decoder.Read(dbuf) + if err != nil && err != io.EOF { + t.Fatal("Read failed", err) + } + testEqual(t, "Read from %q = length %v, want %v", p.encoded, count, len(p.decoded)) + testEqual(t, "Decoding of %q = %q, want %q", p.encoded, string(dbuf[0:count]), p.decoded) + if err != io.EOF { + count, err = decoder.Read(dbuf) + } + testEqual(t, "Read from %q = %v, want %v", p.encoded, err, io.EOF) + } +} + +func TestDecoderBuffering(t *testing.T) { + for bs := 1; bs <= 12; bs++ { + decoder := NewDecoder(StdEncoding, strings.NewReader(bigtest.encoded)) + buf := make([]byte, len(bigtest.decoded)+12) + var total int + for total = 0; total < len(bigtest.decoded); { + n, err := decoder.Read(buf[total : total+bs]) + testEqual(t, "Read from %q at pos %d = %d, %v, want _, %v", bigtest.encoded, total, n, err, error(nil)) + total += n + } + testEqual(t, "Decoding/%d of %q = %q, want %q", bs, bigtest.encoded, string(buf[0:total]), bigtest.decoded) + } +} + +func TestDecodeCorrupt(t *testing.T) { + testCases := []struct { + input string + offset int // -1 means no corruption. + }{ + {"", -1}, + {"!!!!", 0}, + {"x===", 0}, + {"AA=A====", 2}, + {"AAA=AAAA", 3}, + {"MMMMMMMMM", 8}, + {"MMMMMM", 0}, + {"A=", 1}, + {"AA=", 3}, + {"AA==", 4}, + {"AA===", 5}, + {"AAAA=", 5}, + {"AAAA==", 6}, + {"AAAAA=", 6}, + {"AAAAA==", 7}, + {"A=======", 1}, + {"AA======", -1}, + {"AAA=====", 3}, + {"AAAA====", -1}, + {"AAAAA===", -1}, + {"AAAAAA==", 6}, + {"AAAAAAA=", -1}, + {"AAAAAAAA", -1}, + } + for _, tc := range testCases { + dbuf := make([]byte, StdEncoding.DecodedLen(len(tc.input))) + _, err := StdEncoding.Decode(dbuf, []byte(tc.input)) + if tc.offset == -1 { + if err != nil { + t.Error("Decoder wrongly detected coruption in", tc.input) + } + continue + } + switch err := err.(type) { + case CorruptInputError: + testEqual(t, "Corruption in %q at offset %v, want %v", tc.input, int(err), tc.offset) + default: + t.Error("Decoder failed to detect corruption in", tc) + } + } +} + +func TestBig(t *testing.T) { + n := 3*1000 + 1 + raw := make([]byte, n) + const alpha = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" + for i := 0; i < n; i++ { + raw[i] = alpha[i%len(alpha)] + } + encoded := new(bytes.Buffer) + w := NewEncoder(StdEncoding, encoded) + nn, err := w.Write(raw) + if nn != n || err != nil { + t.Fatalf("Encoder.Write(raw) = %d, %v want %d, nil", nn, err, n) + } + err = w.Close() + if err != nil { + t.Fatalf("Encoder.Close() = %v want nil", err) + } + decoded, err := ioutil.ReadAll(NewDecoder(StdEncoding, encoded)) + if err != nil { + t.Fatalf("ioutil.ReadAll(NewDecoder(...)): %v", err) + } + + if !bytes.Equal(raw, decoded) { + var i int + for i = 0; i < len(decoded) && i < len(raw); i++ { + if decoded[i] != raw[i] { + break + } + } + t.Errorf("Decode(Encode(%d-byte string)) failed at offset %d", n, i) + } +} + +func testStringEncoding(t *testing.T, expected string, examples []string) { + for _, e := range examples { + buf, err := StdEncoding.DecodeString(e) + if err != nil { + t.Errorf("Decode(%q) failed: %v", e, err) + continue + } + if s := string(buf); s != expected { + t.Errorf("Decode(%q) = %q, want %q", e, s, expected) + } + } +} + +func TestNewLineCharacters(t *testing.T) { + // Each of these should decode to the string "sure", without errors. + examples := []string{ + "ON2XEZI=", + "ON2XEZI=\r", + "ON2XEZI=\n", + "ON2XEZI=\r\n", + "ON2XEZ\r\nI=", + "ON2X\rEZ\nI=", + "ON2X\nEZ\rI=", + "ON2XEZ\nI=", + "ON2XEZI\n=", + } + testStringEncoding(t, "sure", examples) + + // Each of these should decode to the string "foobar", without errors. + examples = []string{ + "MZXW6YTBOI======", + "MZXW6YTBOI=\r\n=====", + } + testStringEncoding(t, "foobar", examples) +} + +func TestDecoderIssue4779(t *testing.T) { + encoded := `JRXXEZLNEBUXA43VNUQGI33MN5ZCA43JOQQGC3LFOQWCAY3PNZZWKY3UMV2HK4 +RAMFSGS4DJONUWG2LOM4QGK3DJOQWCA43FMQQGI3YKMVUXK43NN5SCA5DFNVYG64RANFXGG2LENFSH +K3TUEB2XIIDMMFRG64TFEBSXIIDEN5WG64TFEBWWCZ3OMEQGC3DJOF2WCLRAKV2CAZLONFWQUYLEEB +WWS3TJNUQHMZLONFQW2LBAOF2WS4ZANZXXG5DSOVSCAZLYMVZGG2LUMF2GS33OEB2WY3DBNVRW6IDM +MFRG64TJOMQG42LTNEQHK5AKMFWGS4LVNFYCAZLYEBSWCIDDN5WW233EN4QGG33OONSXC5LBOQXCAR +DVNFZSAYLVORSSA2LSOVZGKIDEN5WG64RANFXAU4TFOBZGK2DFNZSGK4TJOQQGS3RAOZXWY5LQORQX +IZJAOZSWY2LUEBSXG43FEBRWS3DMOVWSAZDPNRXXEZJAMV2SAZTVM5UWC5BANZ2WY3DBBJYGC4TJMF +2HK4ROEBCXQY3FOB2GK5LSEBZWS3TUEBXWGY3BMVRWC5BAMN2XA2LEMF2GC5BANZXW4IDQOJXWSZDF +NZ2CYIDTOVXHIIDJNYFGG5LMOBQSA4LVNEQG6ZTGNFRWSYJAMRSXGZLSOVXHIIDNN5WGY2LUEBQW42 +LNEBUWIIDFON2CA3DBMJXXE5LNFY== +====` + encodedShort := strings.Replace(encoded, "\n", "", -1) + + dec := NewDecoder(StdEncoding, strings.NewReader(encoded)) + res1, err := ioutil.ReadAll(dec) + if err != nil { + t.Errorf("ReadAll failed: %v", err) + } + + dec = NewDecoder(StdEncoding, strings.NewReader(encodedShort)) + var res2 []byte + res2, err = ioutil.ReadAll(dec) + if err != nil { + t.Errorf("ReadAll failed: %v", err) + } + + if !bytes.Equal(res1, res2) { + t.Error("Decoded results not equal") + } +} + +func BenchmarkEncodeToString(b *testing.B) { + data := make([]byte, 8192) + b.SetBytes(int64(len(data))) + for i := 0; i < b.N; i++ { + StdEncoding.EncodeToString(data) + } +} + +func BenchmarkDecodeString(b *testing.B) { + data := StdEncoding.EncodeToString(make([]byte, 8192)) + b.SetBytes(int64(len(data))) + for i := 0; i < b.N; i++ { + StdEncoding.DecodeString(data) + } +} diff --git a/src/encoding/base32/example_test.go b/src/encoding/base32/example_test.go new file mode 100644 index 0000000000000000000000000000000000000000..f6128d90035066fc66adbbe0fb757dc6a46ce6f3 --- /dev/null +++ b/src/encoding/base32/example_test.go @@ -0,0 +1,45 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Keep in sync with ../base64/example_test.go. + +package base32_test + +import ( + "encoding/base32" + "fmt" + "os" +) + +func ExampleEncoding_EncodeToString() { + data := []byte("any + old & data") + str := base32.StdEncoding.EncodeToString(data) + fmt.Println(str) + // Output: + // MFXHSIBLEBXWYZBAEYQGIYLUME====== +} + +func ExampleEncoding_DecodeString() { + str := "ONXW2ZJAMRQXIYJAO5UXI2BAAAQGC3TEEDX3XPY=" + data, err := base32.StdEncoding.DecodeString(str) + if err != nil { + fmt.Println("error:", err) + return + } + fmt.Printf("%q\n", data) + // Output: + // "some data with \x00 and \ufeff" +} + +func ExampleNewEncoder() { + input := []byte("foo\x00bar") + encoder := base32.NewEncoder(base32.StdEncoding, os.Stdout) + encoder.Write(input) + // Must close the encoder when finished to flush any partial blocks. + // If you comment out the following line, the last partial block "r" + // won't be encoded. + encoder.Close() + // Output: + // MZXW6ADCMFZA==== +} diff --git a/src/encoding/base64/base64.go b/src/encoding/base64/base64.go new file mode 100644 index 0000000000000000000000000000000000000000..3302fb4a7426924d2f9b6f529184193f5bb19df9 --- /dev/null +++ b/src/encoding/base64/base64.go @@ -0,0 +1,448 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package base64 implements base64 encoding as specified by RFC 4648. +package base64 + +import ( + "io" + "strconv" +) + +/* + * Encodings + */ + +// An Encoding is a radix 64 encoding/decoding scheme, defined by a +// 64-character alphabet. The most common encoding is the "base64" +// encoding defined in RFC 4648 and used in MIME (RFC 2045) and PEM +// (RFC 1421). RFC 4648 also defines an alternate encoding, which is +// the standard encoding with - and _ substituted for + and /. +type Encoding struct { + encode [64]byte + decodeMap [256]byte + padChar rune +} + +const ( + StdPadding rune = '=' // Standard padding character + NoPadding rune = -1 // No padding +) + +const encodeStd = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/" +const encodeURL = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_" + +// NewEncoding returns a new padded Encoding defined by the given alphabet, +// which must be a 64-byte string. +// The resulting Encoding uses the default padding character ('='), +// which may be changed or disabled via WithPadding. +func NewEncoding(encoder string) *Encoding { + if len(encoder) != 64 { + panic("encoding alphabet is not 64-bytes long") + } + + e := new(Encoding) + e.padChar = StdPadding + copy(e.encode[:], encoder) + + for i := 0; i < len(e.decodeMap); i++ { + e.decodeMap[i] = 0xFF + } + for i := 0; i < len(encoder); i++ { + e.decodeMap[encoder[i]] = byte(i) + } + return e +} + +// WithPadding creates a new encoding identical to enc except +// with a specified padding character, or NoPadding to disable padding. +func (enc Encoding) WithPadding(padding rune) *Encoding { + enc.padChar = padding + return &enc +} + +// StdEncoding is the standard base64 encoding, as defined in +// RFC 4648. +var StdEncoding = NewEncoding(encodeStd) + +// URLEncoding is the alternate base64 encoding defined in RFC 4648. +// It is typically used in URLs and file names. +var URLEncoding = NewEncoding(encodeURL) + +// RawStdEncoding is the standard raw, unpadded base64 encoding, +// as defined in RFC 4648 section 3.2. +// This is the same as StdEncoding but omits padding characters. +var RawStdEncoding = StdEncoding.WithPadding(NoPadding) + +// URLEncoding is the unpadded alternate base64 encoding defined in RFC 4648. +// It is typically used in URLs and file names. +// This is the same as URLEncoding but omits padding characters. +var RawURLEncoding = URLEncoding.WithPadding(NoPadding) + +/* + * Encoder + */ + +// Encode encodes src using the encoding enc, writing +// EncodedLen(len(src)) bytes to dst. +// +// The encoding pads the output to a multiple of 4 bytes, +// so Encode is not appropriate for use on individual blocks +// of a large data stream. Use NewEncoder() instead. +func (enc *Encoding) Encode(dst, src []byte) { + if len(src) == 0 { + return + } + + di, si := 0, 0 + n := (len(src) / 3) * 3 + for si < n { + // Convert 3x 8bit source bytes into 4 bytes + val := uint(src[si+0])<<16 | uint(src[si+1])<<8 | uint(src[si+2]) + + dst[di+0] = enc.encode[val>>18&0x3F] + dst[di+1] = enc.encode[val>>12&0x3F] + dst[di+2] = enc.encode[val>>6&0x3F] + dst[di+3] = enc.encode[val&0x3F] + + si += 3 + di += 4 + } + + remain := len(src) - si + if remain == 0 { + return + } + // Add the remaining small block + val := uint(src[si+0]) << 16 + if remain == 2 { + val |= uint(src[si+1]) << 8 + } + + dst[di+0] = enc.encode[val>>18&0x3F] + dst[di+1] = enc.encode[val>>12&0x3F] + + switch remain { + case 2: + dst[di+2] = enc.encode[val>>6&0x3F] + if enc.padChar != NoPadding { + dst[di+3] = byte(enc.padChar) + } + case 1: + if enc.padChar != NoPadding { + dst[di+2] = byte(enc.padChar) + dst[di+3] = byte(enc.padChar) + } + } +} + +// EncodeToString returns the base64 encoding of src. +func (enc *Encoding) EncodeToString(src []byte) string { + buf := make([]byte, enc.EncodedLen(len(src))) + enc.Encode(buf, src) + return string(buf) +} + +type encoder struct { + err error + enc *Encoding + w io.Writer + buf [3]byte // buffered data waiting to be encoded + nbuf int // number of bytes in buf + out [1024]byte // output buffer +} + +func (e *encoder) Write(p []byte) (n int, err error) { + if e.err != nil { + return 0, e.err + } + + // Leading fringe. + if e.nbuf > 0 { + var i int + for i = 0; i < len(p) && e.nbuf < 3; i++ { + e.buf[e.nbuf] = p[i] + e.nbuf++ + } + n += i + p = p[i:] + if e.nbuf < 3 { + return + } + e.enc.Encode(e.out[:], e.buf[:]) + if _, e.err = e.w.Write(e.out[:4]); e.err != nil { + return n, e.err + } + e.nbuf = 0 + } + + // Large interior chunks. + for len(p) >= 3 { + nn := len(e.out) / 4 * 3 + if nn > len(p) { + nn = len(p) + nn -= nn % 3 + } + e.enc.Encode(e.out[:], p[:nn]) + if _, e.err = e.w.Write(e.out[0 : nn/3*4]); e.err != nil { + return n, e.err + } + n += nn + p = p[nn:] + } + + // Trailing fringe. + for i := 0; i < len(p); i++ { + e.buf[i] = p[i] + } + e.nbuf = len(p) + n += len(p) + return +} + +// Close flushes any pending output from the encoder. +// It is an error to call Write after calling Close. +func (e *encoder) Close() error { + // If there's anything left in the buffer, flush it out + if e.err == nil && e.nbuf > 0 { + e.enc.Encode(e.out[:], e.buf[:e.nbuf]) + _, e.err = e.w.Write(e.out[:e.enc.EncodedLen(e.nbuf)]) + e.nbuf = 0 + } + return e.err +} + +// NewEncoder returns a new base64 stream encoder. Data written to +// the returned writer will be encoded using enc and then written to w. +// Base64 encodings operate in 4-byte blocks; when finished +// writing, the caller must Close the returned encoder to flush any +// partially written blocks. +func NewEncoder(enc *Encoding, w io.Writer) io.WriteCloser { + return &encoder{enc: enc, w: w} +} + +// EncodedLen returns the length in bytes of the base64 encoding +// of an input buffer of length n. +func (enc *Encoding) EncodedLen(n int) int { + if enc.padChar == NoPadding { + return (n*8 + 5) / 6 // minimum # chars at 6 bits per char + } + return (n + 2) / 3 * 4 // minimum # 4-char quanta, 3 bytes each +} + +/* + * Decoder + */ + +type CorruptInputError int64 + +func (e CorruptInputError) Error() string { + return "illegal base64 data at input byte " + strconv.FormatInt(int64(e), 10) +} + +// decode is like Decode but returns an additional 'end' value, which +// indicates if end-of-message padding or a partial quantum was encountered +// and thus any additional data is an error. +func (enc *Encoding) decode(dst, src []byte) (n int, end bool, err error) { + si := 0 + + // skip over newlines + for si < len(src) && (src[si] == '\n' || src[si] == '\r') { + si++ + } + + for si < len(src) && !end { + // Decode quantum using the base64 alphabet + var dbuf [4]byte + dinc, dlen := 3, 4 + + for j := range dbuf { + if len(src) == si { + if enc.padChar != NoPadding || j < 2 { + return n, false, CorruptInputError(si - j) + } + dinc, dlen, end = j-1, j, true + break + } + in := src[si] + + si++ + // skip over newlines + for si < len(src) && (src[si] == '\n' || src[si] == '\r') { + si++ + } + + if rune(in) == enc.padChar { + // We've reached the end and there's padding + switch j { + case 0, 1: + // incorrect padding + return n, false, CorruptInputError(si - 1) + case 2: + // "==" is expected, the first "=" is already consumed. + if si == len(src) { + // not enough padding + return n, false, CorruptInputError(len(src)) + } + if rune(src[si]) != enc.padChar { + // incorrect padding + return n, false, CorruptInputError(si - 1) + } + + si++ + // skip over newlines + for si < len(src) && (src[si] == '\n' || src[si] == '\r') { + si++ + } + } + if si < len(src) { + // trailing garbage + err = CorruptInputError(si) + } + dinc, dlen, end = 3, j, true + break + } + dbuf[j] = enc.decodeMap[in] + if dbuf[j] == 0xFF { + return n, false, CorruptInputError(si - 1) + } + } + + // Convert 4x 6bit source bytes into 3 bytes + val := uint(dbuf[0])<<18 | uint(dbuf[1])<<12 | uint(dbuf[2])<<6 | uint(dbuf[3]) + switch dlen { + case 4: + dst[2] = byte(val >> 0) + fallthrough + case 3: + dst[1] = byte(val >> 8) + fallthrough + case 2: + dst[0] = byte(val >> 16) + } + dst = dst[dinc:] + n += dlen - 1 + } + + return n, end, err +} + +// Decode decodes src using the encoding enc. It writes at most +// DecodedLen(len(src)) bytes to dst and returns the number of bytes +// written. If src contains invalid base64 data, it will return the +// number of bytes successfully written and CorruptInputError. +// New line characters (\r and \n) are ignored. +func (enc *Encoding) Decode(dst, src []byte) (n int, err error) { + n, _, err = enc.decode(dst, src) + return +} + +// DecodeString returns the bytes represented by the base64 string s. +func (enc *Encoding) DecodeString(s string) ([]byte, error) { + dbuf := make([]byte, enc.DecodedLen(len(s))) + n, _, err := enc.decode(dbuf, []byte(s)) + return dbuf[:n], err +} + +type decoder struct { + err error + enc *Encoding + r io.Reader + end bool // saw end of message + buf [1024]byte // leftover input + nbuf int + out []byte // leftover decoded output + outbuf [1024 / 4 * 3]byte +} + +func (d *decoder) Read(p []byte) (n int, err error) { + if d.err != nil { + return 0, d.err + } + + // Use leftover decoded output from last read. + if len(d.out) > 0 { + n = copy(p, d.out) + d.out = d.out[n:] + return n, nil + } + + // This code assumes that d.r strips supported whitespace ('\r' and '\n'). + + // Read a chunk. + nn := len(p) / 3 * 4 + if nn < 4 { + nn = 4 + } + if nn > len(d.buf) { + nn = len(d.buf) + } + nn, d.err = io.ReadAtLeast(d.r, d.buf[d.nbuf:nn], 4-d.nbuf) + d.nbuf += nn + if d.err != nil || d.nbuf < 4 { + return 0, d.err + } + + // Decode chunk into p, or d.out and then p if p is too small. + nr := d.nbuf / 4 * 4 + nw := d.nbuf / 4 * 3 + if nw > len(p) { + nw, d.end, d.err = d.enc.decode(d.outbuf[:], d.buf[:nr]) + d.out = d.outbuf[:nw] + n = copy(p, d.out) + d.out = d.out[n:] + } else { + n, d.end, d.err = d.enc.decode(p, d.buf[:nr]) + } + d.nbuf -= nr + for i := 0; i < d.nbuf; i++ { + d.buf[i] = d.buf[i+nr] + } + + if d.err == nil { + d.err = err + } + return n, d.err +} + +type newlineFilteringReader struct { + wrapped io.Reader +} + +func (r *newlineFilteringReader) Read(p []byte) (int, error) { + n, err := r.wrapped.Read(p) + for n > 0 { + offset := 0 + for i, b := range p[:n] { + if b != '\r' && b != '\n' { + if i != offset { + p[offset] = b + } + offset++ + } + } + if offset > 0 { + return offset, err + } + // Previous buffer entirely whitespace, read again + n, err = r.wrapped.Read(p) + } + return n, err +} + +// NewDecoder constructs a new base64 stream decoder. +func NewDecoder(enc *Encoding, r io.Reader) io.Reader { + return &decoder{enc: enc, r: &newlineFilteringReader{r}} +} + +// DecodedLen returns the maximum length in bytes of the decoded data +// corresponding to n bytes of base64-encoded data. +func (enc *Encoding) DecodedLen(n int) int { + if enc.padChar == NoPadding { + // Unpadded data may end with partial block of 2-3 characters. + return (n*6 + 7) / 8 + } + // Padded base64 should always be a multiple of 4 characters in length. + return n / 4 * 3 +} diff --git a/src/encoding/base64/base64_test.go b/src/encoding/base64/base64_test.go new file mode 100644 index 0000000000000000000000000000000000000000..d144b96821f9bf614e5f1e3ec2a9a0ddc9d144be --- /dev/null +++ b/src/encoding/base64/base64_test.go @@ -0,0 +1,408 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package base64 + +import ( + "bytes" + "errors" + "io" + "io/ioutil" + "reflect" + "strings" + "testing" + "time" +) + +type testpair struct { + decoded, encoded string +} + +var pairs = []testpair{ + // RFC 3548 examples + {"\x14\xfb\x9c\x03\xd9\x7e", "FPucA9l+"}, + {"\x14\xfb\x9c\x03\xd9", "FPucA9k="}, + {"\x14\xfb\x9c\x03", "FPucAw=="}, + + // RFC 4648 examples + {"", ""}, + {"f", "Zg=="}, + {"fo", "Zm8="}, + {"foo", "Zm9v"}, + {"foob", "Zm9vYg=="}, + {"fooba", "Zm9vYmE="}, + {"foobar", "Zm9vYmFy"}, + + // Wikipedia examples + {"sure.", "c3VyZS4="}, + {"sure", "c3VyZQ=="}, + {"sur", "c3Vy"}, + {"su", "c3U="}, + {"leasure.", "bGVhc3VyZS4="}, + {"easure.", "ZWFzdXJlLg=="}, + {"asure.", "YXN1cmUu"}, + {"sure.", "c3VyZS4="}, +} + +// Do nothing to a reference base64 string (leave in standard format) +func stdRef(ref string) string { + return ref +} + +// Convert a reference string to URL-encoding +func urlRef(ref string) string { + ref = strings.Replace(ref, "+", "-", -1) + ref = strings.Replace(ref, "/", "_", -1) + return ref +} + +// Convert a reference string to raw, unpadded format +func rawRef(ref string) string { + return strings.TrimRight(ref, "=") +} + +// Both URL and unpadding conversions +func rawUrlRef(ref string) string { + return rawRef(urlRef(ref)) +} + +// A nonstandard encoding with a funny padding character, for testing +var funnyEncoding = NewEncoding(encodeStd).WithPadding(rune('@')) + +func funnyRef(ref string) string { + return strings.Replace(ref, "=", "@", -1) +} + +type encodingTest struct { + enc *Encoding // Encoding to test + conv func(string) string // Reference string converter +} + +var encodingTests = []encodingTest{ + encodingTest{StdEncoding, stdRef}, + encodingTest{URLEncoding, urlRef}, + encodingTest{RawStdEncoding, rawRef}, + encodingTest{RawURLEncoding, rawUrlRef}, + encodingTest{funnyEncoding, funnyRef}, +} + +var bigtest = testpair{ + "Twas brillig, and the slithy toves", + "VHdhcyBicmlsbGlnLCBhbmQgdGhlIHNsaXRoeSB0b3Zlcw==", +} + +func testEqual(t *testing.T, msg string, args ...interface{}) bool { + if args[len(args)-2] != args[len(args)-1] { + t.Errorf(msg, args...) + return false + } + return true +} + +func TestEncode(t *testing.T) { + for _, p := range pairs { + for _, tt := range encodingTests { + got := tt.enc.EncodeToString([]byte(p.decoded)) + testEqual(t, "Encode(%q) = %q, want %q", p.decoded, + got, tt.conv(p.encoded)) + } + } +} + +func TestEncoder(t *testing.T) { + for _, p := range pairs { + bb := &bytes.Buffer{} + encoder := NewEncoder(StdEncoding, bb) + encoder.Write([]byte(p.decoded)) + encoder.Close() + testEqual(t, "Encode(%q) = %q, want %q", p.decoded, bb.String(), p.encoded) + } +} + +func TestEncoderBuffering(t *testing.T) { + input := []byte(bigtest.decoded) + for bs := 1; bs <= 12; bs++ { + bb := &bytes.Buffer{} + encoder := NewEncoder(StdEncoding, bb) + for pos := 0; pos < len(input); pos += bs { + end := pos + bs + if end > len(input) { + end = len(input) + } + n, err := encoder.Write(input[pos:end]) + testEqual(t, "Write(%q) gave error %v, want %v", input[pos:end], err, error(nil)) + testEqual(t, "Write(%q) gave length %v, want %v", input[pos:end], n, end-pos) + } + err := encoder.Close() + testEqual(t, "Close gave error %v, want %v", err, error(nil)) + testEqual(t, "Encoding/%d of %q = %q, want %q", bs, bigtest.decoded, bb.String(), bigtest.encoded) + } +} + +func TestDecode(t *testing.T) { + for _, p := range pairs { + for _, tt := range encodingTests { + encoded := tt.conv(p.encoded) + dbuf := make([]byte, tt.enc.DecodedLen(len(encoded))) + count, end, err := tt.enc.decode(dbuf, []byte(encoded)) + testEqual(t, "Decode(%q) = error %v, want %v", encoded, err, error(nil)) + testEqual(t, "Decode(%q) = length %v, want %v", encoded, count, len(p.decoded)) + if len(encoded) > 0 { + testEqual(t, "Decode(%q) = end %v, want %v", encoded, end, len(p.decoded)%3 != 0) + } + testEqual(t, "Decode(%q) = %q, want %q", encoded, string(dbuf[0:count]), p.decoded) + + dbuf, err = tt.enc.DecodeString(encoded) + testEqual(t, "DecodeString(%q) = error %v, want %v", encoded, err, error(nil)) + testEqual(t, "DecodeString(%q) = %q, want %q", string(dbuf), p.decoded) + } + } +} + +func TestDecoder(t *testing.T) { + for _, p := range pairs { + decoder := NewDecoder(StdEncoding, strings.NewReader(p.encoded)) + dbuf := make([]byte, StdEncoding.DecodedLen(len(p.encoded))) + count, err := decoder.Read(dbuf) + if err != nil && err != io.EOF { + t.Fatal("Read failed", err) + } + testEqual(t, "Read from %q = length %v, want %v", p.encoded, count, len(p.decoded)) + testEqual(t, "Decoding of %q = %q, want %q", p.encoded, string(dbuf[0:count]), p.decoded) + if err != io.EOF { + count, err = decoder.Read(dbuf) + } + testEqual(t, "Read from %q = %v, want %v", p.encoded, err, io.EOF) + } +} + +func TestDecoderBuffering(t *testing.T) { + for bs := 1; bs <= 12; bs++ { + decoder := NewDecoder(StdEncoding, strings.NewReader(bigtest.encoded)) + buf := make([]byte, len(bigtest.decoded)+12) + var total int + for total = 0; total < len(bigtest.decoded); { + n, err := decoder.Read(buf[total : total+bs]) + testEqual(t, "Read from %q at pos %d = %d, %v, want _, %v", bigtest.encoded, total, n, err, error(nil)) + total += n + } + testEqual(t, "Decoding/%d of %q = %q, want %q", bs, bigtest.encoded, string(buf[0:total]), bigtest.decoded) + } +} + +func TestDecodeCorrupt(t *testing.T) { + testCases := []struct { + input string + offset int // -1 means no corruption. + }{ + {"", -1}, + {"!!!!", 0}, + {"====", 0}, + {"x===", 1}, + {"=AAA", 0}, + {"A=AA", 1}, + {"AA=A", 2}, + {"AA==A", 4}, + {"AAA=AAAA", 4}, + {"AAAAA", 4}, + {"AAAAAA", 4}, + {"A=", 1}, + {"A==", 1}, + {"AA=", 3}, + {"AA==", -1}, + {"AAA=", -1}, + {"AAAA", -1}, + {"AAAAAA=", 7}, + {"YWJjZA=====", 8}, + } + for _, tc := range testCases { + dbuf := make([]byte, StdEncoding.DecodedLen(len(tc.input))) + _, err := StdEncoding.Decode(dbuf, []byte(tc.input)) + if tc.offset == -1 { + if err != nil { + t.Error("Decoder wrongly detected coruption in", tc.input) + } + continue + } + switch err := err.(type) { + case CorruptInputError: + testEqual(t, "Corruption in %q at offset %v, want %v", tc.input, int(err), tc.offset) + default: + t.Error("Decoder failed to detect corruption in", tc) + } + } +} + +func TestBig(t *testing.T) { + n := 3*1000 + 1 + raw := make([]byte, n) + const alpha = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" + for i := 0; i < n; i++ { + raw[i] = alpha[i%len(alpha)] + } + encoded := new(bytes.Buffer) + w := NewEncoder(StdEncoding, encoded) + nn, err := w.Write(raw) + if nn != n || err != nil { + t.Fatalf("Encoder.Write(raw) = %d, %v want %d, nil", nn, err, n) + } + err = w.Close() + if err != nil { + t.Fatalf("Encoder.Close() = %v want nil", err) + } + decoded, err := ioutil.ReadAll(NewDecoder(StdEncoding, encoded)) + if err != nil { + t.Fatalf("ioutil.ReadAll(NewDecoder(...)): %v", err) + } + + if !bytes.Equal(raw, decoded) { + var i int + for i = 0; i < len(decoded) && i < len(raw); i++ { + if decoded[i] != raw[i] { + break + } + } + t.Errorf("Decode(Encode(%d-byte string)) failed at offset %d", n, i) + } +} + +func TestNewLineCharacters(t *testing.T) { + // Each of these should decode to the string "sure", without errors. + const expected = "sure" + examples := []string{ + "c3VyZQ==", + "c3VyZQ==\r", + "c3VyZQ==\n", + "c3VyZQ==\r\n", + "c3VyZ\r\nQ==", + "c3V\ryZ\nQ==", + "c3V\nyZ\rQ==", + "c3VyZ\nQ==", + "c3VyZQ\n==", + "c3VyZQ=\n=", + "c3VyZQ=\r\n\r\n=", + } + for _, e := range examples { + buf, err := StdEncoding.DecodeString(e) + if err != nil { + t.Errorf("Decode(%q) failed: %v", e, err) + continue + } + if s := string(buf); s != expected { + t.Errorf("Decode(%q) = %q, want %q", e, s, expected) + } + } +} + +type nextRead struct { + n int // bytes to return + err error // error to return +} + +// faultInjectReader returns data from source, rate-limited +// and with the errors as written to nextc. +type faultInjectReader struct { + source string + nextc <-chan nextRead +} + +func (r *faultInjectReader) Read(p []byte) (int, error) { + nr := <-r.nextc + if len(p) > nr.n { + p = p[:nr.n] + } + n := copy(p, r.source) + r.source = r.source[n:] + return n, nr.err +} + +// tests that we don't ignore errors from our underlying reader +func TestDecoderIssue3577(t *testing.T) { + next := make(chan nextRead, 10) + wantErr := errors.New("my error") + next <- nextRead{5, nil} + next <- nextRead{10, wantErr} + next <- nextRead{0, wantErr} + d := NewDecoder(StdEncoding, &faultInjectReader{ + source: "VHdhcyBicmlsbGlnLCBhbmQgdGhlIHNsaXRoeSB0b3Zlcw==", // twas brillig... + nextc: next, + }) + errc := make(chan error) + go func() { + _, err := ioutil.ReadAll(d) + errc <- err + }() + select { + case err := <-errc: + if err != wantErr { + t.Errorf("got error %v; want %v", err, wantErr) + } + case <-time.After(5 * time.Second): + t.Errorf("timeout; Decoder blocked without returning an error") + } +} + +func TestDecoderIssue4779(t *testing.T) { + encoded := `CP/EAT8AAAEF +AQEBAQEBAAAAAAAAAAMAAQIEBQYHCAkKCwEAAQUBAQEBAQEAAAAAAAAAAQACAwQFBgcICQoLEAAB +BAEDAgQCBQcGCAUDDDMBAAIRAwQhEjEFQVFhEyJxgTIGFJGhsUIjJBVSwWIzNHKC0UMHJZJT8OHx +Y3M1FqKygyZEk1RkRcKjdDYX0lXiZfKzhMPTdePzRieUpIW0lcTU5PSltcXV5fVWZnaGlqa2xtbm +9jdHV2d3h5ent8fX5/cRAAICAQIEBAMEBQYHBwYFNQEAAhEDITESBEFRYXEiEwUygZEUobFCI8FS +0fAzJGLhcoKSQ1MVY3M08SUGFqKygwcmNcLSRJNUoxdkRVU2dGXi8rOEw9N14/NGlKSFtJXE1OT0 +pbXF1eX1VmZ2hpamtsbW5vYnN0dXZ3eHl6e3x//aAAwDAQACEQMRAD8A9VSSSSUpJJJJSkkkJ+Tj +1kiy1jCJJDnAcCTykpKkuQ6p/jN6FgmxlNduXawwAzaGH+V6jn/R/wCt71zdn+N/qL3kVYFNYB4N +ji6PDVjWpKp9TSXnvTf8bFNjg3qOEa2n6VlLpj/rT/pf567DpX1i6L1hs9Py67X8mqdtg/rUWbbf ++gkp0kkkklKSSSSUpJJJJT//0PVUkkklKVLq3WMDpGI7KzrNjADtYNXvI/Mqr/Pd/q9W3vaxjnvM +NaCXE9gNSvGPrf8AWS3qmba5jjsJhoB0DAf0NDf6sevf+/lf8Hj0JJATfWT6/dV6oXU1uOLQeKKn +EQP+Hubtfe/+R7Mf/g7f5xcocp++Z11JMCJPgFBxOg7/AOuqDx8I/ikpkXkmSdU8mJIJA/O8EMAy +j+mSARB/17pKVXYWHXjsj7yIex0PadzXMO1zT5KHoNA3HT8ietoGhgjsfA+CSnvvqh/jJtqsrwOv +2b6NGNzXfTYexzJ+nU7/ALkf4P8Awv6P9KvTQQ4AgyDqCF85Pho3CTB7eHwXoH+LT65uZbX9X+o2 +bqbPb06551Y4 +` + encodedShort := strings.Replace(encoded, "\n", "", -1) + + dec := NewDecoder(StdEncoding, strings.NewReader(encoded)) + res1, err := ioutil.ReadAll(dec) + if err != nil { + t.Errorf("ReadAll failed: %v", err) + } + + dec = NewDecoder(StdEncoding, strings.NewReader(encodedShort)) + var res2 []byte + res2, err = ioutil.ReadAll(dec) + if err != nil { + t.Errorf("ReadAll failed: %v", err) + } + + if !bytes.Equal(res1, res2) { + t.Error("Decoded results not equal") + } +} + +func TestDecoderIssue7733(t *testing.T) { + s, err := StdEncoding.DecodeString("YWJjZA=====") + want := CorruptInputError(8) + if !reflect.DeepEqual(want, err) { + t.Errorf("Error = %v; want CorruptInputError(8)", err) + } + if string(s) != "abcd" { + t.Errorf("DecodeString = %q; want abcd", s) + } +} + +func BenchmarkEncodeToString(b *testing.B) { + data := make([]byte, 8192) + b.SetBytes(int64(len(data))) + for i := 0; i < b.N; i++ { + StdEncoding.EncodeToString(data) + } +} + +func BenchmarkDecodeString(b *testing.B) { + data := StdEncoding.EncodeToString(make([]byte, 8192)) + b.SetBytes(int64(len(data))) + for i := 0; i < b.N; i++ { + StdEncoding.DecodeString(data) + } +} diff --git a/src/encoding/base64/example_test.go b/src/encoding/base64/example_test.go new file mode 100644 index 0000000000000000000000000000000000000000..d18b856a0faace90d09939e93b6fcca3b91f6a9e --- /dev/null +++ b/src/encoding/base64/example_test.go @@ -0,0 +1,45 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Keep in sync with ../base32/example_test.go. + +package base64_test + +import ( + "encoding/base64" + "fmt" + "os" +) + +func ExampleEncoding_EncodeToString() { + data := []byte("any + old & data") + str := base64.StdEncoding.EncodeToString(data) + fmt.Println(str) + // Output: + // YW55ICsgb2xkICYgZGF0YQ== +} + +func ExampleEncoding_DecodeString() { + str := "c29tZSBkYXRhIHdpdGggACBhbmQg77u/" + data, err := base64.StdEncoding.DecodeString(str) + if err != nil { + fmt.Println("error:", err) + return + } + fmt.Printf("%q\n", data) + // Output: + // "some data with \x00 and \ufeff" +} + +func ExampleNewEncoder() { + input := []byte("foo\x00bar") + encoder := base64.NewEncoder(base64.StdEncoding, os.Stdout) + encoder.Write(input) + // Must close the encoder when finished to flush any partial blocks. + // If you comment out the following line, the last partial block "r" + // won't be encoded. + encoder.Close() + // Output: + // Zm9vAGJhcg== +} diff --git a/src/encoding/binary/binary.go b/src/encoding/binary/binary.go new file mode 100644 index 0000000000000000000000000000000000000000..2bbe07c02ff3153886c76f8756ca9c83a3bfbfe0 --- /dev/null +++ b/src/encoding/binary/binary.go @@ -0,0 +1,618 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package binary implements simple translation between numbers and byte +// sequences and encoding and decoding of varints. +// +// Numbers are translated by reading and writing fixed-size values. +// A fixed-size value is either a fixed-size arithmetic +// type (int8, uint8, int16, float32, complex64, ...) +// or an array or struct containing only fixed-size values. +// +// The varint functions encode and decode single integer values using +// a variable-length encoding; smaller values require fewer bytes. +// For a specification, see +// https://developers.google.com/protocol-buffers/docs/encoding. +// +// This package favors simplicity over efficiency. Clients that require +// high-performance serialization, especially for large data structures, +// should look at more advanced solutions such as the encoding/gob +// package or protocol buffers. +package binary + +import ( + "errors" + "io" + "math" + "reflect" +) + +// A ByteOrder specifies how to convert byte sequences into +// 16-, 32-, or 64-bit unsigned integers. +type ByteOrder interface { + Uint16([]byte) uint16 + Uint32([]byte) uint32 + Uint64([]byte) uint64 + PutUint16([]byte, uint16) + PutUint32([]byte, uint32) + PutUint64([]byte, uint64) + String() string +} + +// LittleEndian is the little-endian implementation of ByteOrder. +var LittleEndian littleEndian + +// BigEndian is the big-endian implementation of ByteOrder. +var BigEndian bigEndian + +type littleEndian struct{} + +func (littleEndian) Uint16(b []byte) uint16 { return uint16(b[0]) | uint16(b[1])<<8 } + +func (littleEndian) PutUint16(b []byte, v uint16) { + b[0] = byte(v) + b[1] = byte(v >> 8) +} + +func (littleEndian) Uint32(b []byte) uint32 { + return uint32(b[0]) | uint32(b[1])<<8 | uint32(b[2])<<16 | uint32(b[3])<<24 +} + +func (littleEndian) PutUint32(b []byte, v uint32) { + b[0] = byte(v) + b[1] = byte(v >> 8) + b[2] = byte(v >> 16) + b[3] = byte(v >> 24) +} + +func (littleEndian) Uint64(b []byte) uint64 { + return uint64(b[0]) | uint64(b[1])<<8 | uint64(b[2])<<16 | uint64(b[3])<<24 | + uint64(b[4])<<32 | uint64(b[5])<<40 | uint64(b[6])<<48 | uint64(b[7])<<56 +} + +func (littleEndian) PutUint64(b []byte, v uint64) { + b[0] = byte(v) + b[1] = byte(v >> 8) + b[2] = byte(v >> 16) + b[3] = byte(v >> 24) + b[4] = byte(v >> 32) + b[5] = byte(v >> 40) + b[6] = byte(v >> 48) + b[7] = byte(v >> 56) +} + +func (littleEndian) String() string { return "LittleEndian" } + +func (littleEndian) GoString() string { return "binary.LittleEndian" } + +type bigEndian struct{} + +func (bigEndian) Uint16(b []byte) uint16 { return uint16(b[1]) | uint16(b[0])<<8 } + +func (bigEndian) PutUint16(b []byte, v uint16) { + b[0] = byte(v >> 8) + b[1] = byte(v) +} + +func (bigEndian) Uint32(b []byte) uint32 { + return uint32(b[3]) | uint32(b[2])<<8 | uint32(b[1])<<16 | uint32(b[0])<<24 +} + +func (bigEndian) PutUint32(b []byte, v uint32) { + b[0] = byte(v >> 24) + b[1] = byte(v >> 16) + b[2] = byte(v >> 8) + b[3] = byte(v) +} + +func (bigEndian) Uint64(b []byte) uint64 { + return uint64(b[7]) | uint64(b[6])<<8 | uint64(b[5])<<16 | uint64(b[4])<<24 | + uint64(b[3])<<32 | uint64(b[2])<<40 | uint64(b[1])<<48 | uint64(b[0])<<56 +} + +func (bigEndian) PutUint64(b []byte, v uint64) { + b[0] = byte(v >> 56) + b[1] = byte(v >> 48) + b[2] = byte(v >> 40) + b[3] = byte(v >> 32) + b[4] = byte(v >> 24) + b[5] = byte(v >> 16) + b[6] = byte(v >> 8) + b[7] = byte(v) +} + +func (bigEndian) String() string { return "BigEndian" } + +func (bigEndian) GoString() string { return "binary.BigEndian" } + +// Read reads structured binary data from r into data. +// Data must be a pointer to a fixed-size value or a slice +// of fixed-size values. +// Bytes read from r are decoded using the specified byte order +// and written to successive fields of the data. +// When reading into structs, the field data for fields with +// blank (_) field names is skipped; i.e., blank field names +// may be used for padding. +// When reading into a struct, all non-blank fields must be exported. +func Read(r io.Reader, order ByteOrder, data interface{}) error { + // Fast path for basic types and slices. + if n := intDataSize(data); n != 0 { + var b [8]byte + var bs []byte + if n > len(b) { + bs = make([]byte, n) + } else { + bs = b[:n] + } + if _, err := io.ReadFull(r, bs); err != nil { + return err + } + switch data := data.(type) { + case *int8: + *data = int8(b[0]) + case *uint8: + *data = b[0] + case *int16: + *data = int16(order.Uint16(bs)) + case *uint16: + *data = order.Uint16(bs) + case *int32: + *data = int32(order.Uint32(bs)) + case *uint32: + *data = order.Uint32(bs) + case *int64: + *data = int64(order.Uint64(bs)) + case *uint64: + *data = order.Uint64(bs) + case []int8: + for i, x := range bs { // Easier to loop over the input for 8-bit values. + data[i] = int8(x) + } + case []uint8: + copy(data, bs) + case []int16: + for i := range data { + data[i] = int16(order.Uint16(bs[2*i:])) + } + case []uint16: + for i := range data { + data[i] = order.Uint16(bs[2*i:]) + } + case []int32: + for i := range data { + data[i] = int32(order.Uint32(bs[4*i:])) + } + case []uint32: + for i := range data { + data[i] = order.Uint32(bs[4*i:]) + } + case []int64: + for i := range data { + data[i] = int64(order.Uint64(bs[8*i:])) + } + case []uint64: + for i := range data { + data[i] = order.Uint64(bs[8*i:]) + } + } + return nil + } + + // Fallback to reflect-based decoding. + v := reflect.ValueOf(data) + size := -1 + switch v.Kind() { + case reflect.Ptr: + v = v.Elem() + size = dataSize(v) + case reflect.Slice: + size = dataSize(v) + } + if size < 0 { + return errors.New("binary.Read: invalid type " + reflect.TypeOf(data).String()) + } + d := &decoder{order: order, buf: make([]byte, size)} + if _, err := io.ReadFull(r, d.buf); err != nil { + return err + } + d.value(v) + return nil +} + +// Write writes the binary representation of data into w. +// Data must be a fixed-size value or a slice of fixed-size +// values, or a pointer to such data. +// Bytes written to w are encoded using the specified byte order +// and read from successive fields of the data. +// When writing structs, zero values are written for fields +// with blank (_) field names. +func Write(w io.Writer, order ByteOrder, data interface{}) error { + // Fast path for basic types and slices. + if n := intDataSize(data); n != 0 { + var b [8]byte + var bs []byte + if n > len(b) { + bs = make([]byte, n) + } else { + bs = b[:n] + } + switch v := data.(type) { + case *int8: + b[0] = byte(*v) + case int8: + b[0] = byte(v) + case []int8: + for i, x := range v { + bs[i] = byte(x) + } + case *uint8: + b[0] = *v + case uint8: + b[0] = byte(v) + case []uint8: + bs = v + case *int16: + order.PutUint16(bs, uint16(*v)) + case int16: + order.PutUint16(bs, uint16(v)) + case []int16: + for i, x := range v { + order.PutUint16(bs[2*i:], uint16(x)) + } + case *uint16: + order.PutUint16(bs, *v) + case uint16: + order.PutUint16(bs, v) + case []uint16: + for i, x := range v { + order.PutUint16(bs[2*i:], x) + } + case *int32: + order.PutUint32(bs, uint32(*v)) + case int32: + order.PutUint32(bs, uint32(v)) + case []int32: + for i, x := range v { + order.PutUint32(bs[4*i:], uint32(x)) + } + case *uint32: + order.PutUint32(bs, *v) + case uint32: + order.PutUint32(bs, v) + case []uint32: + for i, x := range v { + order.PutUint32(bs[4*i:], x) + } + case *int64: + order.PutUint64(bs, uint64(*v)) + case int64: + order.PutUint64(bs, uint64(v)) + case []int64: + for i, x := range v { + order.PutUint64(bs[8*i:], uint64(x)) + } + case *uint64: + order.PutUint64(bs, *v) + case uint64: + order.PutUint64(bs, v) + case []uint64: + for i, x := range v { + order.PutUint64(bs[8*i:], x) + } + } + _, err := w.Write(bs) + return err + } + + // Fallback to reflect-based encoding. + v := reflect.Indirect(reflect.ValueOf(data)) + size := dataSize(v) + if size < 0 { + return errors.New("binary.Write: invalid type " + reflect.TypeOf(data).String()) + } + buf := make([]byte, size) + e := &encoder{order: order, buf: buf} + e.value(v) + _, err := w.Write(buf) + return err +} + +// Size returns how many bytes Write would generate to encode the value v, which +// must be a fixed-size value or a slice of fixed-size values, or a pointer to such data. +// If v is neither of these, Size returns -1. +func Size(v interface{}) int { + return dataSize(reflect.Indirect(reflect.ValueOf(v))) +} + +// dataSize returns the number of bytes the actual data represented by v occupies in memory. +// For compound structures, it sums the sizes of the elements. Thus, for instance, for a slice +// it returns the length of the slice times the element size and does not count the memory +// occupied by the header. If the type of v is not acceptable, dataSize returns -1. +func dataSize(v reflect.Value) int { + if v.Kind() == reflect.Slice { + if s := sizeof(v.Type().Elem()); s >= 0 { + return s * v.Len() + } + return -1 + } + return sizeof(v.Type()) +} + +// sizeof returns the size >= 0 of variables for the given type or -1 if the type is not acceptable. +func sizeof(t reflect.Type) int { + switch t.Kind() { + case reflect.Array: + if s := sizeof(t.Elem()); s >= 0 { + return s * t.Len() + } + + case reflect.Struct: + sum := 0 + for i, n := 0, t.NumField(); i < n; i++ { + s := sizeof(t.Field(i).Type) + if s < 0 { + return -1 + } + sum += s + } + return sum + + case reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, + reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, + reflect.Float32, reflect.Float64, reflect.Complex64, reflect.Complex128: + return int(t.Size()) + } + + return -1 +} + +type coder struct { + order ByteOrder + buf []byte +} + +type decoder coder +type encoder coder + +func (d *decoder) uint8() uint8 { + x := d.buf[0] + d.buf = d.buf[1:] + return x +} + +func (e *encoder) uint8(x uint8) { + e.buf[0] = x + e.buf = e.buf[1:] +} + +func (d *decoder) uint16() uint16 { + x := d.order.Uint16(d.buf[0:2]) + d.buf = d.buf[2:] + return x +} + +func (e *encoder) uint16(x uint16) { + e.order.PutUint16(e.buf[0:2], x) + e.buf = e.buf[2:] +} + +func (d *decoder) uint32() uint32 { + x := d.order.Uint32(d.buf[0:4]) + d.buf = d.buf[4:] + return x +} + +func (e *encoder) uint32(x uint32) { + e.order.PutUint32(e.buf[0:4], x) + e.buf = e.buf[4:] +} + +func (d *decoder) uint64() uint64 { + x := d.order.Uint64(d.buf[0:8]) + d.buf = d.buf[8:] + return x +} + +func (e *encoder) uint64(x uint64) { + e.order.PutUint64(e.buf[0:8], x) + e.buf = e.buf[8:] +} + +func (d *decoder) int8() int8 { return int8(d.uint8()) } + +func (e *encoder) int8(x int8) { e.uint8(uint8(x)) } + +func (d *decoder) int16() int16 { return int16(d.uint16()) } + +func (e *encoder) int16(x int16) { e.uint16(uint16(x)) } + +func (d *decoder) int32() int32 { return int32(d.uint32()) } + +func (e *encoder) int32(x int32) { e.uint32(uint32(x)) } + +func (d *decoder) int64() int64 { return int64(d.uint64()) } + +func (e *encoder) int64(x int64) { e.uint64(uint64(x)) } + +func (d *decoder) value(v reflect.Value) { + switch v.Kind() { + case reflect.Array: + l := v.Len() + for i := 0; i < l; i++ { + d.value(v.Index(i)) + } + + case reflect.Struct: + t := v.Type() + l := v.NumField() + for i := 0; i < l; i++ { + // Note: Calling v.CanSet() below is an optimization. + // It would be sufficient to check the field name, + // but creating the StructField info for each field is + // costly (run "go test -bench=ReadStruct" and compare + // results when making changes to this code). + if v := v.Field(i); v.CanSet() || t.Field(i).Name != "_" { + d.value(v) + } else { + d.skip(v) + } + } + + case reflect.Slice: + l := v.Len() + for i := 0; i < l; i++ { + d.value(v.Index(i)) + } + + case reflect.Int8: + v.SetInt(int64(d.int8())) + case reflect.Int16: + v.SetInt(int64(d.int16())) + case reflect.Int32: + v.SetInt(int64(d.int32())) + case reflect.Int64: + v.SetInt(d.int64()) + + case reflect.Uint8: + v.SetUint(uint64(d.uint8())) + case reflect.Uint16: + v.SetUint(uint64(d.uint16())) + case reflect.Uint32: + v.SetUint(uint64(d.uint32())) + case reflect.Uint64: + v.SetUint(d.uint64()) + + case reflect.Float32: + v.SetFloat(float64(math.Float32frombits(d.uint32()))) + case reflect.Float64: + v.SetFloat(math.Float64frombits(d.uint64())) + + case reflect.Complex64: + v.SetComplex(complex( + float64(math.Float32frombits(d.uint32())), + float64(math.Float32frombits(d.uint32())), + )) + case reflect.Complex128: + v.SetComplex(complex( + math.Float64frombits(d.uint64()), + math.Float64frombits(d.uint64()), + )) + } +} + +func (e *encoder) value(v reflect.Value) { + switch v.Kind() { + case reflect.Array: + l := v.Len() + for i := 0; i < l; i++ { + e.value(v.Index(i)) + } + + case reflect.Struct: + t := v.Type() + l := v.NumField() + for i := 0; i < l; i++ { + // see comment for corresponding code in decoder.value() + if v := v.Field(i); v.CanSet() || t.Field(i).Name != "_" { + e.value(v) + } else { + e.skip(v) + } + } + + case reflect.Slice: + l := v.Len() + for i := 0; i < l; i++ { + e.value(v.Index(i)) + } + + case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: + switch v.Type().Kind() { + case reflect.Int8: + e.int8(int8(v.Int())) + case reflect.Int16: + e.int16(int16(v.Int())) + case reflect.Int32: + e.int32(int32(v.Int())) + case reflect.Int64: + e.int64(v.Int()) + } + + case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: + switch v.Type().Kind() { + case reflect.Uint8: + e.uint8(uint8(v.Uint())) + case reflect.Uint16: + e.uint16(uint16(v.Uint())) + case reflect.Uint32: + e.uint32(uint32(v.Uint())) + case reflect.Uint64: + e.uint64(v.Uint()) + } + + case reflect.Float32, reflect.Float64: + switch v.Type().Kind() { + case reflect.Float32: + e.uint32(math.Float32bits(float32(v.Float()))) + case reflect.Float64: + e.uint64(math.Float64bits(v.Float())) + } + + case reflect.Complex64, reflect.Complex128: + switch v.Type().Kind() { + case reflect.Complex64: + x := v.Complex() + e.uint32(math.Float32bits(float32(real(x)))) + e.uint32(math.Float32bits(float32(imag(x)))) + case reflect.Complex128: + x := v.Complex() + e.uint64(math.Float64bits(real(x))) + e.uint64(math.Float64bits(imag(x))) + } + } +} + +func (d *decoder) skip(v reflect.Value) { + d.buf = d.buf[dataSize(v):] +} + +func (e *encoder) skip(v reflect.Value) { + n := dataSize(v) + for i := range e.buf[0:n] { + e.buf[i] = 0 + } + e.buf = e.buf[n:] +} + +// intDataSize returns the size of the data required to represent the data when encoded. +// It returns zero if the type cannot be implemented by the fast path in Read or Write. +func intDataSize(data interface{}) int { + switch data := data.(type) { + case int8, uint8, *int8, *uint8: + return 1 + case []int8: + return len(data) + case []uint8: + return len(data) + case int16, uint16, *int16, *uint16: + return 2 + case []int16: + return 2 * len(data) + case []uint16: + return 2 * len(data) + case int32, uint32, *int32, *uint32: + return 4 + case []int32: + return 4 * len(data) + case []uint32: + return 4 * len(data) + case int64, uint64, *int64, *uint64: + return 8 + case []int64: + return 8 * len(data) + case []uint64: + return 8 * len(data) + } + return 0 +} diff --git a/src/encoding/binary/binary_test.go b/src/encoding/binary/binary_test.go new file mode 100644 index 0000000000000000000000000000000000000000..8ee595fa476aabb677c87b08a065aec30b90af8c --- /dev/null +++ b/src/encoding/binary/binary_test.go @@ -0,0 +1,416 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package binary + +import ( + "bytes" + "io" + "math" + "reflect" + "strings" + "testing" +) + +type Struct struct { + Int8 int8 + Int16 int16 + Int32 int32 + Int64 int64 + Uint8 uint8 + Uint16 uint16 + Uint32 uint32 + Uint64 uint64 + Float32 float32 + Float64 float64 + Complex64 complex64 + Complex128 complex128 + Array [4]uint8 +} + +type T struct { + Int int + Uint uint + Uintptr uintptr + Array [4]int +} + +var s = Struct{ + 0x01, + 0x0203, + 0x04050607, + 0x08090a0b0c0d0e0f, + 0x10, + 0x1112, + 0x13141516, + 0x1718191a1b1c1d1e, + + math.Float32frombits(0x1f202122), + math.Float64frombits(0x232425262728292a), + complex( + math.Float32frombits(0x2b2c2d2e), + math.Float32frombits(0x2f303132), + ), + complex( + math.Float64frombits(0x333435363738393a), + math.Float64frombits(0x3b3c3d3e3f404142), + ), + + [4]uint8{0x43, 0x44, 0x45, 0x46}, +} + +var big = []byte{ + 1, + 2, 3, + 4, 5, 6, 7, + 8, 9, 10, 11, 12, 13, 14, 15, + 16, + 17, 18, + 19, 20, 21, 22, + 23, 24, 25, 26, 27, 28, 29, 30, + + 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, + 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, + + 67, 68, 69, 70, +} + +var little = []byte{ + 1, + 3, 2, + 7, 6, 5, 4, + 15, 14, 13, 12, 11, 10, 9, 8, + 16, + 18, 17, + 22, 21, 20, 19, + 30, 29, 28, 27, 26, 25, 24, 23, + + 34, 33, 32, 31, + 42, 41, 40, 39, 38, 37, 36, 35, + 46, 45, 44, 43, 50, 49, 48, 47, + 58, 57, 56, 55, 54, 53, 52, 51, 66, 65, 64, 63, 62, 61, 60, 59, + + 67, 68, 69, 70, +} + +var src = []byte{1, 2, 3, 4, 5, 6, 7, 8} +var res = []int32{0x01020304, 0x05060708} + +func checkResult(t *testing.T, dir string, order ByteOrder, err error, have, want interface{}) { + if err != nil { + t.Errorf("%v %v: %v", dir, order, err) + return + } + if !reflect.DeepEqual(have, want) { + t.Errorf("%v %v:\n\thave %+v\n\twant %+v", dir, order, have, want) + } +} + +func testRead(t *testing.T, order ByteOrder, b []byte, s1 interface{}) { + var s2 Struct + err := Read(bytes.NewReader(b), order, &s2) + checkResult(t, "Read", order, err, s2, s1) +} + +func testWrite(t *testing.T, order ByteOrder, b []byte, s1 interface{}) { + buf := new(bytes.Buffer) + err := Write(buf, order, s1) + checkResult(t, "Write", order, err, buf.Bytes(), b) +} + +func TestLittleEndianRead(t *testing.T) { testRead(t, LittleEndian, little, s) } +func TestLittleEndianWrite(t *testing.T) { testWrite(t, LittleEndian, little, s) } +func TestLittleEndianPtrWrite(t *testing.T) { testWrite(t, LittleEndian, little, &s) } + +func TestBigEndianRead(t *testing.T) { testRead(t, BigEndian, big, s) } +func TestBigEndianWrite(t *testing.T) { testWrite(t, BigEndian, big, s) } +func TestBigEndianPtrWrite(t *testing.T) { testWrite(t, BigEndian, big, &s) } + +func TestReadSlice(t *testing.T) { + slice := make([]int32, 2) + err := Read(bytes.NewReader(src), BigEndian, slice) + checkResult(t, "ReadSlice", BigEndian, err, slice, res) +} + +func TestWriteSlice(t *testing.T) { + buf := new(bytes.Buffer) + err := Write(buf, BigEndian, res) + checkResult(t, "WriteSlice", BigEndian, err, buf.Bytes(), src) +} + +// Addresses of arrays are easier to manipulate with reflection than are slices. +var intArrays = []interface{}{ + &[100]int8{}, + &[100]int16{}, + &[100]int32{}, + &[100]int64{}, + &[100]uint8{}, + &[100]uint16{}, + &[100]uint32{}, + &[100]uint64{}, +} + +func TestSliceRoundTrip(t *testing.T) { + buf := new(bytes.Buffer) + for _, array := range intArrays { + src := reflect.ValueOf(array).Elem() + unsigned := false + switch src.Index(0).Kind() { + case reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64: + unsigned = true + } + for i := 0; i < src.Len(); i++ { + if unsigned { + src.Index(i).SetUint(uint64(i * 0x07654321)) + } else { + src.Index(i).SetInt(int64(i * 0x07654321)) + } + } + buf.Reset() + srcSlice := src.Slice(0, src.Len()) + err := Write(buf, BigEndian, srcSlice.Interface()) + if err != nil { + t.Fatal(err) + } + dst := reflect.New(src.Type()).Elem() + dstSlice := dst.Slice(0, dst.Len()) + err = Read(buf, BigEndian, dstSlice.Interface()) + if err != nil { + t.Fatal(err) + } + if !reflect.DeepEqual(src.Interface(), dst.Interface()) { + t.Fatal(src) + } + } +} + +func TestWriteT(t *testing.T) { + buf := new(bytes.Buffer) + ts := T{} + if err := Write(buf, BigEndian, ts); err == nil { + t.Errorf("WriteT: have err == nil, want non-nil") + } + + tv := reflect.Indirect(reflect.ValueOf(ts)) + for i, n := 0, tv.NumField(); i < n; i++ { + typ := tv.Field(i).Type().String() + if typ == "[4]int" { + typ = "int" // the problem is int, not the [4] + } + if err := Write(buf, BigEndian, tv.Field(i).Interface()); err == nil { + t.Errorf("WriteT.%v: have err == nil, want non-nil", tv.Field(i).Type()) + } else if !strings.Contains(err.Error(), typ) { + t.Errorf("WriteT: have err == %q, want it to mention %s", err, typ) + } + } +} + +type BlankFields struct { + A uint32 + _ int32 + B float64 + _ [4]int16 + C byte + _ [7]byte + _ struct { + f [8]float32 + } +} + +type BlankFieldsProbe struct { + A uint32 + P0 int32 + B float64 + P1 [4]int16 + C byte + P2 [7]byte + P3 struct { + F [8]float32 + } +} + +func TestBlankFields(t *testing.T) { + buf := new(bytes.Buffer) + b1 := BlankFields{A: 1234567890, B: 2.718281828, C: 42} + if err := Write(buf, LittleEndian, &b1); err != nil { + t.Error(err) + } + + // zero values must have been written for blank fields + var p BlankFieldsProbe + if err := Read(buf, LittleEndian, &p); err != nil { + t.Error(err) + } + + // quick test: only check first value of slices + if p.P0 != 0 || p.P1[0] != 0 || p.P2[0] != 0 || p.P3.F[0] != 0 { + t.Errorf("non-zero values for originally blank fields: %#v", p) + } + + // write p and see if we can probe only some fields + if err := Write(buf, LittleEndian, &p); err != nil { + t.Error(err) + } + + // read should ignore blank fields in b2 + var b2 BlankFields + if err := Read(buf, LittleEndian, &b2); err != nil { + t.Error(err) + } + if b1.A != b2.A || b1.B != b2.B || b1.C != b2.C { + t.Errorf("%#v != %#v", b1, b2) + } +} + +// An attempt to read into a struct with an unexported field will +// panic. This is probably not the best choice, but at this point +// anything else would be an API change. + +type Unexported struct { + a int32 +} + +func TestUnexportedRead(t *testing.T) { + var buf bytes.Buffer + u1 := Unexported{a: 1} + if err := Write(&buf, LittleEndian, &u1); err != nil { + t.Fatal(err) + } + + defer func() { + if recover() == nil { + t.Fatal("did not panic") + } + }() + var u2 Unexported + Read(&buf, LittleEndian, &u2) +} + +func TestReadErrorMsg(t *testing.T) { + var buf bytes.Buffer + read := func(data interface{}) { + err := Read(&buf, LittleEndian, data) + want := "binary.Read: invalid type " + reflect.TypeOf(data).String() + if err == nil { + t.Errorf("%T: got no error; want %q", data, want) + return + } + if got := err.Error(); got != want { + t.Errorf("%T: got %q; want %q", data, got, want) + } + } + read(0) + s := new(struct{}) + read(&s) + p := &s + read(&p) +} + +type byteSliceReader struct { + remain []byte +} + +func (br *byteSliceReader) Read(p []byte) (int, error) { + n := copy(p, br.remain) + br.remain = br.remain[n:] + return n, nil +} + +func BenchmarkReadSlice1000Int32s(b *testing.B) { + bsr := &byteSliceReader{} + slice := make([]int32, 1000) + buf := make([]byte, len(slice)*4) + b.SetBytes(int64(len(buf))) + b.ResetTimer() + for i := 0; i < b.N; i++ { + bsr.remain = buf + Read(bsr, BigEndian, slice) + } +} + +func BenchmarkReadStruct(b *testing.B) { + bsr := &byteSliceReader{} + var buf bytes.Buffer + Write(&buf, BigEndian, &s) + b.SetBytes(int64(dataSize(reflect.ValueOf(s)))) + t := s + b.ResetTimer() + for i := 0; i < b.N; i++ { + bsr.remain = buf.Bytes() + Read(bsr, BigEndian, &t) + } + b.StopTimer() + if !reflect.DeepEqual(s, t) { + b.Fatal("no match") + } +} + +func BenchmarkReadInts(b *testing.B) { + var ls Struct + bsr := &byteSliceReader{} + var r io.Reader = bsr + b.SetBytes(2 * (1 + 2 + 4 + 8)) + b.ResetTimer() + for i := 0; i < b.N; i++ { + bsr.remain = big + Read(r, BigEndian, &ls.Int8) + Read(r, BigEndian, &ls.Int16) + Read(r, BigEndian, &ls.Int32) + Read(r, BigEndian, &ls.Int64) + Read(r, BigEndian, &ls.Uint8) + Read(r, BigEndian, &ls.Uint16) + Read(r, BigEndian, &ls.Uint32) + Read(r, BigEndian, &ls.Uint64) + } + + want := s + want.Float32 = 0 + want.Float64 = 0 + want.Complex64 = 0 + want.Complex128 = 0 + for i := range want.Array { + want.Array[i] = 0 + } + b.StopTimer() + if !reflect.DeepEqual(ls, want) { + panic("no match") + } +} + +func BenchmarkWriteInts(b *testing.B) { + buf := new(bytes.Buffer) + var w io.Writer = buf + b.SetBytes(2 * (1 + 2 + 4 + 8)) + b.ResetTimer() + for i := 0; i < b.N; i++ { + buf.Reset() + Write(w, BigEndian, s.Int8) + Write(w, BigEndian, s.Int16) + Write(w, BigEndian, s.Int32) + Write(w, BigEndian, s.Int64) + Write(w, BigEndian, s.Uint8) + Write(w, BigEndian, s.Uint16) + Write(w, BigEndian, s.Uint32) + Write(w, BigEndian, s.Uint64) + } + b.StopTimer() + if !bytes.Equal(buf.Bytes(), big[:30]) { + b.Fatalf("first half doesn't match: %x %x", buf.Bytes(), big[:30]) + } +} + +func BenchmarkWriteSlice1000Int32s(b *testing.B) { + slice := make([]int32, 1000) + buf := new(bytes.Buffer) + var w io.Writer = buf + b.SetBytes(4 * 1000) + b.ResetTimer() + for i := 0; i < b.N; i++ { + buf.Reset() + Write(w, BigEndian, slice) + } + b.StopTimer() +} diff --git a/src/encoding/binary/example_test.go b/src/encoding/binary/example_test.go new file mode 100644 index 0000000000000000000000000000000000000000..067cf553beb967463f1545f983bfc7fd4824080c --- /dev/null +++ b/src/encoding/binary/example_test.go @@ -0,0 +1,52 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package binary_test + +import ( + "bytes" + "encoding/binary" + "fmt" + "math" +) + +func ExampleWrite() { + buf := new(bytes.Buffer) + var pi float64 = math.Pi + err := binary.Write(buf, binary.LittleEndian, pi) + if err != nil { + fmt.Println("binary.Write failed:", err) + } + fmt.Printf("% x", buf.Bytes()) + // Output: 18 2d 44 54 fb 21 09 40 +} + +func ExampleWrite_multi() { + buf := new(bytes.Buffer) + var data = []interface{}{ + uint16(61374), + int8(-54), + uint8(254), + } + for _, v := range data { + err := binary.Write(buf, binary.LittleEndian, v) + if err != nil { + fmt.Println("binary.Write failed:", err) + } + } + fmt.Printf("%x", buf.Bytes()) + // Output: beefcafe +} + +func ExampleRead() { + var pi float64 + b := []byte{0x18, 0x2d, 0x44, 0x54, 0xfb, 0x21, 0x09, 0x40} + buf := bytes.NewReader(b) + err := binary.Read(buf, binary.LittleEndian, &pi) + if err != nil { + fmt.Println("binary.Read failed:", err) + } + fmt.Print(pi) + // Output: 3.141592653589793 +} diff --git a/src/encoding/binary/varint.go b/src/encoding/binary/varint.go new file mode 100644 index 0000000000000000000000000000000000000000..3a2dfa3c74e2139199fa3922521d8ca783c7594c --- /dev/null +++ b/src/encoding/binary/varint.go @@ -0,0 +1,133 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package binary + +// This file implements "varint" encoding of 64-bit integers. +// The encoding is: +// - unsigned integers are serialized 7 bits at a time, starting with the +// least significant bits +// - the most significant bit (msb) in each output byte indicates if there +// is a continuation byte (msb = 1) +// - signed integers are mapped to unsigned integers using "zig-zag" +// encoding: Positive values x are written as 2*x + 0, negative values +// are written as 2*(^x) + 1; that is, negative numbers are complemented +// and whether to complement is encoded in bit 0. +// +// Design note: +// At most 10 bytes are needed for 64-bit values. The encoding could +// be more dense: a full 64-bit value needs an extra byte just to hold bit 63. +// Instead, the msb of the previous byte could be used to hold bit 63 since we +// know there can't be more than 64 bits. This is a trivial improvement and +// would reduce the maximum encoding length to 9 bytes. However, it breaks the +// invariant that the msb is always the "continuation bit" and thus makes the +// format incompatible with a varint encoding for larger numbers (say 128-bit). + +import ( + "errors" + "io" +) + +// MaxVarintLenN is the maximum length of a varint-encoded N-bit integer. +const ( + MaxVarintLen16 = 3 + MaxVarintLen32 = 5 + MaxVarintLen64 = 10 +) + +// PutUvarint encodes a uint64 into buf and returns the number of bytes written. +// If the buffer is too small, PutUvarint will panic. +func PutUvarint(buf []byte, x uint64) int { + i := 0 + for x >= 0x80 { + buf[i] = byte(x) | 0x80 + x >>= 7 + i++ + } + buf[i] = byte(x) + return i + 1 +} + +// Uvarint decodes a uint64 from buf and returns that value and the +// number of bytes read (> 0). If an error occurred, the value is 0 +// and the number of bytes n is <= 0 meaning: +// +// n == 0: buf too small +// n < 0: value larger than 64 bits (overflow) +// and -n is the number of bytes read +// +func Uvarint(buf []byte) (uint64, int) { + var x uint64 + var s uint + for i, b := range buf { + if b < 0x80 { + if i > 9 || i == 9 && b > 1 { + return 0, -(i + 1) // overflow + } + return x | uint64(b)< 0). If an error occurred, the value is 0 +// and the number of bytes n is <= 0 with the following meaning: +// +// n == 0: buf too small +// n < 0: value larger than 64 bits (overflow) +// and -n is the number of bytes read +// +func Varint(buf []byte) (int64, int) { + ux, n := Uvarint(buf) // ok to continue in presence of error + x := int64(ux >> 1) + if ux&1 != 0 { + x = ^x + } + return x, n +} + +var overflow = errors.New("binary: varint overflows a 64-bit integer") + +// ReadUvarint reads an encoded unsigned integer from r and returns it as a uint64. +func ReadUvarint(r io.ByteReader) (uint64, error) { + var x uint64 + var s uint + for i := 0; ; i++ { + b, err := r.ReadByte() + if err != nil { + return x, err + } + if b < 0x80 { + if i > 9 || i == 9 && b > 1 { + return x, overflow + } + return x | uint64(b)<> 1) + if ux&1 != 0 { + x = ^x + } + return x, err +} diff --git a/src/encoding/binary/varint_test.go b/src/encoding/binary/varint_test.go new file mode 100644 index 0000000000000000000000000000000000000000..ca411ecbd65e8180d2bfcb0c819a561328d66f06 --- /dev/null +++ b/src/encoding/binary/varint_test.go @@ -0,0 +1,168 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package binary + +import ( + "bytes" + "io" + "testing" +) + +func testConstant(t *testing.T, w uint, max int) { + buf := make([]byte, MaxVarintLen64) + n := PutUvarint(buf, 1< 0 { + if len(record) != r.FieldsPerRecord { + r.column = 0 // report at start of record + return record, r.error(ErrFieldCount) + } + } else if r.FieldsPerRecord == 0 { + r.FieldsPerRecord = len(record) + } + return record, nil +} + +// ReadAll reads all the remaining records from r. +// Each record is a slice of fields. +// A successful call returns err == nil, not err == EOF. Because ReadAll is +// defined to read until EOF, it does not treat end of file as an error to be +// reported. +func (r *Reader) ReadAll() (records [][]string, err error) { + for { + record, err := r.Read() + if err == io.EOF { + return records, nil + } + if err != nil { + return nil, err + } + records = append(records, record) + } +} + +// readRune reads one rune from r, folding \r\n to \n and keeping track +// of how far into the line we have read. r.column will point to the start +// of this rune, not the end of this rune. +func (r *Reader) readRune() (rune, error) { + r1, _, err := r.r.ReadRune() + + // Handle \r\n here. We make the simplifying assumption that + // anytime \r is followed by \n that it can be folded to \n. + // We will not detect files which contain both \r\n and bare \n. + if r1 == '\r' { + r1, _, err = r.r.ReadRune() + if err == nil { + if r1 != '\n' { + r.r.UnreadRune() + r1 = '\r' + } + } + } + r.column++ + return r1, err +} + +// skip reads runes up to and including the rune delim or until error. +func (r *Reader) skip(delim rune) error { + for { + r1, err := r.readRune() + if err != nil { + return err + } + if r1 == delim { + return nil + } + } +} + +// parseRecord reads and parses a single csv record from r. +func (r *Reader) parseRecord() (fields []string, err error) { + // Each record starts on a new line. We increment our line + // number (lines start at 1, not 0) and set column to -1 + // so as we increment in readRune it points to the character we read. + r.line++ + r.column = -1 + + // Peek at the first rune. If it is an error we are done. + // If we support comments and it is the comment character + // then skip to the end of line. + + r1, _, err := r.r.ReadRune() + if err != nil { + return nil, err + } + + if r.Comment != 0 && r1 == r.Comment { + return nil, r.skip('\n') + } + r.r.UnreadRune() + + // At this point we have at least one field. + for { + haveField, delim, err := r.parseField() + if haveField { + // If FieldsPerRecord is greater then 0 we can assume the final + // length of fields to be equal to FieldsPerRecord. + if r.FieldsPerRecord > 0 && fields == nil { + fields = make([]string, 0, r.FieldsPerRecord) + } + fields = append(fields, r.field.String()) + } + if delim == '\n' || err == io.EOF { + return fields, err + } else if err != nil { + return nil, err + } + } +} + +// parseField parses the next field in the record. The read field is +// located in r.field. Delim is the first character not part of the field +// (r.Comma or '\n'). +func (r *Reader) parseField() (haveField bool, delim rune, err error) { + r.field.Reset() + + r1, err := r.readRune() + for err == nil && r.TrimLeadingSpace && r1 != '\n' && unicode.IsSpace(r1) { + r1, err = r.readRune() + } + + if err == io.EOF && r.column != 0 { + return true, 0, err + } + if err != nil { + return false, 0, err + } + + switch r1 { + case r.Comma: + // will check below + + case '\n': + // We are a trailing empty field or a blank line + if r.column == 0 { + return false, r1, nil + } + return true, r1, nil + + case '"': + // quoted field + Quoted: + for { + r1, err = r.readRune() + if err != nil { + if err == io.EOF { + if r.LazyQuotes { + return true, 0, err + } + return false, 0, r.error(ErrQuote) + } + return false, 0, err + } + switch r1 { + case '"': + r1, err = r.readRune() + if err != nil || r1 == r.Comma { + break Quoted + } + if r1 == '\n' { + return true, r1, nil + } + if r1 != '"' { + if !r.LazyQuotes { + r.column-- + return false, 0, r.error(ErrQuote) + } + // accept the bare quote + r.field.WriteRune('"') + } + case '\n': + r.line++ + r.column = -1 + } + r.field.WriteRune(r1) + } + + default: + // unquoted field + for { + r.field.WriteRune(r1) + r1, err = r.readRune() + if err != nil || r1 == r.Comma { + break + } + if r1 == '\n' { + return true, r1, nil + } + if !r.LazyQuotes && r1 == '"' { + return false, 0, r.error(ErrBareQuote) + } + } + } + + if err != nil { + if err == io.EOF { + return true, 0, err + } + return false, 0, err + } + + return true, r1, nil +} diff --git a/src/encoding/csv/reader_test.go b/src/encoding/csv/reader_test.go new file mode 100644 index 0000000000000000000000000000000000000000..be1002d034a1768c8b5e47ee225e01f0222f3142 --- /dev/null +++ b/src/encoding/csv/reader_test.go @@ -0,0 +1,315 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package csv + +import ( + "reflect" + "strings" + "testing" +) + +var readTests = []struct { + Name string + Input string + Output [][]string + UseFieldsPerRecord bool // false (default) means FieldsPerRecord is -1 + + // These fields are copied into the Reader + Comma rune + Comment rune + FieldsPerRecord int + LazyQuotes bool + TrailingComma bool + TrimLeadingSpace bool + + Error string + Line int // Expected error line if != 0 + Column int // Expected error column if line != 0 +}{ + { + Name: "Simple", + Input: "a,b,c\n", + Output: [][]string{{"a", "b", "c"}}, + }, + { + Name: "CRLF", + Input: "a,b\r\nc,d\r\n", + Output: [][]string{{"a", "b"}, {"c", "d"}}, + }, + { + Name: "BareCR", + Input: "a,b\rc,d\r\n", + Output: [][]string{{"a", "b\rc", "d"}}, + }, + { + Name: "RFC4180test", + UseFieldsPerRecord: true, + Input: `#field1,field2,field3 +"aaa","bb +b","ccc" +"a,a","b""bb","ccc" +zzz,yyy,xxx +`, + Output: [][]string{ + {"#field1", "field2", "field3"}, + {"aaa", "bb\nb", "ccc"}, + {"a,a", `b"bb`, "ccc"}, + {"zzz", "yyy", "xxx"}, + }, + }, + { + Name: "NoEOLTest", + Input: "a,b,c", + Output: [][]string{{"a", "b", "c"}}, + }, + { + Name: "Semicolon", + Comma: ';', + Input: "a;b;c\n", + Output: [][]string{{"a", "b", "c"}}, + }, + { + Name: "MultiLine", + Input: `"two +line","one line","three +line +field"`, + Output: [][]string{{"two\nline", "one line", "three\nline\nfield"}}, + }, + { + Name: "BlankLine", + Input: "a,b,c\n\nd,e,f\n\n", + Output: [][]string{ + {"a", "b", "c"}, + {"d", "e", "f"}, + }, + }, + { + Name: "BlankLineFieldCount", + Input: "a,b,c\n\nd,e,f\n\n", + UseFieldsPerRecord: true, + Output: [][]string{ + {"a", "b", "c"}, + {"d", "e", "f"}, + }, + }, + { + Name: "TrimSpace", + Input: " a, b, c\n", + TrimLeadingSpace: true, + Output: [][]string{{"a", "b", "c"}}, + }, + { + Name: "LeadingSpace", + Input: " a, b, c\n", + Output: [][]string{{" a", " b", " c"}}, + }, + { + Name: "Comment", + Comment: '#', + Input: "#1,2,3\na,b,c\n#comment", + Output: [][]string{{"a", "b", "c"}}, + }, + { + Name: "NoComment", + Input: "#1,2,3\na,b,c", + Output: [][]string{{"#1", "2", "3"}, {"a", "b", "c"}}, + }, + { + Name: "LazyQuotes", + LazyQuotes: true, + Input: `a "word","1"2",a","b`, + Output: [][]string{{`a "word"`, `1"2`, `a"`, `b`}}, + }, + { + Name: "BareQuotes", + LazyQuotes: true, + Input: `a "word","1"2",a"`, + Output: [][]string{{`a "word"`, `1"2`, `a"`}}, + }, + { + Name: "BareDoubleQuotes", + LazyQuotes: true, + Input: `a""b,c`, + Output: [][]string{{`a""b`, `c`}}, + }, + { + Name: "BadDoubleQuotes", + Input: `a""b,c`, + Error: `bare " in non-quoted-field`, Line: 1, Column: 1, + }, + { + Name: "TrimQuote", + Input: ` "a"," b",c`, + TrimLeadingSpace: true, + Output: [][]string{{"a", " b", "c"}}, + }, + { + Name: "BadBareQuote", + Input: `a "word","b"`, + Error: `bare " in non-quoted-field`, Line: 1, Column: 2, + }, + { + Name: "BadTrailingQuote", + Input: `"a word",b"`, + Error: `bare " in non-quoted-field`, Line: 1, Column: 10, + }, + { + Name: "ExtraneousQuote", + Input: `"a "word","b"`, + Error: `extraneous " in field`, Line: 1, Column: 3, + }, + { + Name: "BadFieldCount", + UseFieldsPerRecord: true, + Input: "a,b,c\nd,e", + Error: "wrong number of fields", Line: 2, + }, + { + Name: "BadFieldCount1", + UseFieldsPerRecord: true, + FieldsPerRecord: 2, + Input: `a,b,c`, + Error: "wrong number of fields", Line: 1, + }, + { + Name: "FieldCount", + Input: "a,b,c\nd,e", + Output: [][]string{{"a", "b", "c"}, {"d", "e"}}, + }, + { + Name: "TrailingCommaEOF", + Input: "a,b,c,", + Output: [][]string{{"a", "b", "c", ""}}, + }, + { + Name: "TrailingCommaEOL", + Input: "a,b,c,\n", + Output: [][]string{{"a", "b", "c", ""}}, + }, + { + Name: "TrailingCommaSpaceEOF", + TrimLeadingSpace: true, + Input: "a,b,c, ", + Output: [][]string{{"a", "b", "c", ""}}, + }, + { + Name: "TrailingCommaSpaceEOL", + TrimLeadingSpace: true, + Input: "a,b,c, \n", + Output: [][]string{{"a", "b", "c", ""}}, + }, + { + Name: "TrailingCommaLine3", + TrimLeadingSpace: true, + Input: "a,b,c\nd,e,f\ng,hi,", + Output: [][]string{{"a", "b", "c"}, {"d", "e", "f"}, {"g", "hi", ""}}, + }, + { + Name: "NotTrailingComma3", + Input: "a,b,c, \n", + Output: [][]string{{"a", "b", "c", " "}}, + }, + { + Name: "CommaFieldTest", + TrailingComma: true, + Input: `x,y,z,w +x,y,z, +x,y,, +x,,, +,,, +"x","y","z","w" +"x","y","z","" +"x","y","","" +"x","","","" +"","","","" +`, + Output: [][]string{ + {"x", "y", "z", "w"}, + {"x", "y", "z", ""}, + {"x", "y", "", ""}, + {"x", "", "", ""}, + {"", "", "", ""}, + {"x", "y", "z", "w"}, + {"x", "y", "z", ""}, + {"x", "y", "", ""}, + {"x", "", "", ""}, + {"", "", "", ""}, + }, + }, + { + Name: "TrailingCommaIneffective1", + TrailingComma: true, + TrimLeadingSpace: true, + Input: "a,b,\nc,d,e", + Output: [][]string{ + {"a", "b", ""}, + {"c", "d", "e"}, + }, + }, + { + Name: "TrailingCommaIneffective2", + TrailingComma: false, + TrimLeadingSpace: true, + Input: "a,b,\nc,d,e", + Output: [][]string{ + {"a", "b", ""}, + {"c", "d", "e"}, + }, + }, +} + +func TestRead(t *testing.T) { + for _, tt := range readTests { + r := NewReader(strings.NewReader(tt.Input)) + r.Comment = tt.Comment + if tt.UseFieldsPerRecord { + r.FieldsPerRecord = tt.FieldsPerRecord + } else { + r.FieldsPerRecord = -1 + } + r.LazyQuotes = tt.LazyQuotes + r.TrailingComma = tt.TrailingComma + r.TrimLeadingSpace = tt.TrimLeadingSpace + if tt.Comma != 0 { + r.Comma = tt.Comma + } + out, err := r.ReadAll() + perr, _ := err.(*ParseError) + if tt.Error != "" { + if err == nil || !strings.Contains(err.Error(), tt.Error) { + t.Errorf("%s: error %v, want error %q", tt.Name, err, tt.Error) + } else if tt.Line != 0 && (tt.Line != perr.Line || tt.Column != perr.Column) { + t.Errorf("%s: error at %d:%d expected %d:%d", tt.Name, perr.Line, perr.Column, tt.Line, tt.Column) + } + } else if err != nil { + t.Errorf("%s: unexpected error %v", tt.Name, err) + } else if !reflect.DeepEqual(out, tt.Output) { + t.Errorf("%s: out=%q want %q", tt.Name, out, tt.Output) + } + } +} + +func BenchmarkRead(b *testing.B) { + data := `x,y,z,w +x,y,z, +x,y,, +x,,, +,,, +"x","y","z","w" +"x","y","z","" +"x","y","","" +"x","","","" +"","","","" +` + + for i := 0; i < b.N; i++ { + _, err := NewReader(strings.NewReader(data)).ReadAll() + + if err != nil { + b.Fatalf("could not read data: %s", err) + } + } +} diff --git a/src/encoding/csv/writer.go b/src/encoding/csv/writer.go new file mode 100644 index 0000000000000000000000000000000000000000..353d91f238f80fa49dbb3fbebe37b28633f35fc0 --- /dev/null +++ b/src/encoding/csv/writer.go @@ -0,0 +1,139 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package csv + +import ( + "bufio" + "io" + "strings" + "unicode" + "unicode/utf8" +) + +// A Writer writes records to a CSV encoded file. +// +// As returned by NewWriter, a Writer writes records terminated by a +// newline and uses ',' as the field delimiter. The exported fields can be +// changed to customize the details before the first call to Write or WriteAll. +// +// Comma is the field delimiter. +// +// If UseCRLF is true, the Writer ends each record with \r\n instead of \n. +type Writer struct { + Comma rune // Field delimiter (set to ',' by NewWriter) + UseCRLF bool // True to use \r\n as the line terminator + w *bufio.Writer +} + +// NewWriter returns a new Writer that writes to w. +func NewWriter(w io.Writer) *Writer { + return &Writer{ + Comma: ',', + w: bufio.NewWriter(w), + } +} + +// Writer writes a single CSV record to w along with any necessary quoting. +// A record is a slice of strings with each string being one field. +func (w *Writer) Write(record []string) (err error) { + for n, field := range record { + if n > 0 { + if _, err = w.w.WriteRune(w.Comma); err != nil { + return + } + } + + // If we don't have to have a quoted field then just + // write out the field and continue to the next field. + if !w.fieldNeedsQuotes(field) { + if _, err = w.w.WriteString(field); err != nil { + return + } + continue + } + if err = w.w.WriteByte('"'); err != nil { + return + } + + for _, r1 := range field { + switch r1 { + case '"': + _, err = w.w.WriteString(`""`) + case '\r': + if !w.UseCRLF { + err = w.w.WriteByte('\r') + } + case '\n': + if w.UseCRLF { + _, err = w.w.WriteString("\r\n") + } else { + err = w.w.WriteByte('\n') + } + default: + _, err = w.w.WriteRune(r1) + } + if err != nil { + return + } + } + + if err = w.w.WriteByte('"'); err != nil { + return + } + } + if w.UseCRLF { + _, err = w.w.WriteString("\r\n") + } else { + err = w.w.WriteByte('\n') + } + return +} + +// Flush writes any buffered data to the underlying io.Writer. +// To check if an error occurred during the Flush, call Error. +func (w *Writer) Flush() { + w.w.Flush() +} + +// Error reports any error that has occurred during a previous Write or Flush. +func (w *Writer) Error() error { + _, err := w.w.Write(nil) + return err +} + +// WriteAll writes multiple CSV records to w using Write and then calls Flush. +func (w *Writer) WriteAll(records [][]string) (err error) { + for _, record := range records { + err = w.Write(record) + if err != nil { + return err + } + } + return w.w.Flush() +} + +// fieldNeedsQuotes reports whether our field must be enclosed in quotes. +// Fields with a Comma, fields with a quote or newline, and +// fields which start with a space must be enclosed in quotes. +// We used to quote empty strings, but we do not anymore (as of Go 1.4). +// The two representations should be equivalent, but Postgres distinguishes +// quoted vs non-quoted empty string during database imports, and it has +// an option to force the quoted behavior for non-quoted CSV but it has +// no option to force the non-quoted behavior for quoted CSV, making +// CSV with quoted empty strings strictly less useful. +// Not quoting the empty string also makes this package match the behavior +// of Microsoft Excel and Google Drive. +// For Postgres, quote the data terminating string `\.`. +func (w *Writer) fieldNeedsQuotes(field string) bool { + if field == "" { + return false + } + if field == `\.` || strings.IndexRune(field, w.Comma) >= 0 || strings.IndexAny(field, "\"\r\n") >= 0 { + return true + } + + r1, _ := utf8.DecodeRuneInString(field) + return unicode.IsSpace(r1) +} diff --git a/src/encoding/csv/writer_test.go b/src/encoding/csv/writer_test.go new file mode 100644 index 0000000000000000000000000000000000000000..8ddca0abe0c13f09e13bc4a30718d09d17829541 --- /dev/null +++ b/src/encoding/csv/writer_test.go @@ -0,0 +1,85 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package csv + +import ( + "bytes" + "errors" + "testing" +) + +var writeTests = []struct { + Input [][]string + Output string + UseCRLF bool +}{ + {Input: [][]string{{"abc"}}, Output: "abc\n"}, + {Input: [][]string{{"abc"}}, Output: "abc\r\n", UseCRLF: true}, + {Input: [][]string{{`"abc"`}}, Output: `"""abc"""` + "\n"}, + {Input: [][]string{{`a"b`}}, Output: `"a""b"` + "\n"}, + {Input: [][]string{{`"a"b"`}}, Output: `"""a""b"""` + "\n"}, + {Input: [][]string{{" abc"}}, Output: `" abc"` + "\n"}, + {Input: [][]string{{"abc,def"}}, Output: `"abc,def"` + "\n"}, + {Input: [][]string{{"abc", "def"}}, Output: "abc,def\n"}, + {Input: [][]string{{"abc"}, {"def"}}, Output: "abc\ndef\n"}, + {Input: [][]string{{"abc\ndef"}}, Output: "\"abc\ndef\"\n"}, + {Input: [][]string{{"abc\ndef"}}, Output: "\"abc\r\ndef\"\r\n", UseCRLF: true}, + {Input: [][]string{{"abc\rdef"}}, Output: "\"abcdef\"\r\n", UseCRLF: true}, + {Input: [][]string{{"abc\rdef"}}, Output: "\"abc\rdef\"\n", UseCRLF: false}, + {Input: [][]string{{""}}, Output: "\n"}, + {Input: [][]string{{"", ""}}, Output: ",\n"}, + {Input: [][]string{{"", "", ""}}, Output: ",,\n"}, + {Input: [][]string{{"", "", "a"}}, Output: ",,a\n"}, + {Input: [][]string{{"", "a", ""}}, Output: ",a,\n"}, + {Input: [][]string{{"", "a", "a"}}, Output: ",a,a\n"}, + {Input: [][]string{{"a", "", ""}}, Output: "a,,\n"}, + {Input: [][]string{{"a", "", "a"}}, Output: "a,,a\n"}, + {Input: [][]string{{"a", "a", ""}}, Output: "a,a,\n"}, + {Input: [][]string{{"a", "a", "a"}}, Output: "a,a,a\n"}, + {Input: [][]string{{`\.`}}, Output: "\"\\.\"\n"}, +} + +func TestWrite(t *testing.T) { + for n, tt := range writeTests { + b := &bytes.Buffer{} + f := NewWriter(b) + f.UseCRLF = tt.UseCRLF + err := f.WriteAll(tt.Input) + if err != nil { + t.Errorf("Unexpected error: %s\n", err) + } + out := b.String() + if out != tt.Output { + t.Errorf("#%d: out=%q want %q", n, out, tt.Output) + } + } +} + +type errorWriter struct{} + +func (e errorWriter) Write(b []byte) (int, error) { + return 0, errors.New("Test") +} + +func TestError(t *testing.T) { + b := &bytes.Buffer{} + f := NewWriter(b) + f.Write([]string{"abc"}) + f.Flush() + err := f.Error() + + if err != nil { + t.Errorf("Unexpected error: %s\n", err) + } + + f = NewWriter(errorWriter{}) + f.Write([]string{"abc"}) + f.Flush() + err = f.Error() + + if err == nil { + t.Error("Error should not be nil") + } +} diff --git a/src/encoding/encoding.go b/src/encoding/encoding.go new file mode 100644 index 0000000000000000000000000000000000000000..6d218071b7ae4f9c54293c4c161b836128b39e69 --- /dev/null +++ b/src/encoding/encoding.go @@ -0,0 +1,48 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package encoding defines interfaces shared by other packages that +// convert data to and from byte-level and textual representations. +// Packages that check for these interfaces include encoding/gob, +// encoding/json, and encoding/xml. As a result, implementing an +// interface once can make a type useful in multiple encodings. +// Standard types that implement these interfaces include time.Time and net.IP. +// The interfaces come in pairs that produce and consume encoded data. +package encoding + +// BinaryMarshaler is the interface implemented by an object that can +// marshal itself into a binary form. +// +// MarshalBinary encodes the receiver into a binary form and returns the result. +type BinaryMarshaler interface { + MarshalBinary() (data []byte, err error) +} + +// BinaryUnmarshaler is the interface implemented by an object that can +// unmarshal a binary representation of itself. +// +// UnmarshalBinary must be able to decode the form generated by MarshalBinary. +// UnmarshalBinary must copy the data if it wishes to retain the data +// after returning. +type BinaryUnmarshaler interface { + UnmarshalBinary(data []byte) error +} + +// TextMarshaler is the interface implemented by an object that can +// marshal itself into a textual form. +// +// MarshalText encodes the receiver into UTF-8-encoded text and returns the result. +type TextMarshaler interface { + MarshalText() (text []byte, err error) +} + +// TextUnmarshaler is the interface implemented by an object that can +// unmarshal a textual representation of itself. +// +// UnmarshalText must be able to decode the form generated by MarshalText. +// UnmarshalText must copy the text if it wishes to retain the text +// after returning. +type TextUnmarshaler interface { + UnmarshalText(text []byte) error +} diff --git a/src/encoding/gob/codec_test.go b/src/encoding/gob/codec_test.go new file mode 100644 index 0000000000000000000000000000000000000000..c2583bfee337d18fbe4971dbbff005419805b5c8 --- /dev/null +++ b/src/encoding/gob/codec_test.go @@ -0,0 +1,1494 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package gob + +import ( + "bytes" + "errors" + "flag" + "math" + "math/rand" + "reflect" + "strings" + "testing" + "time" +) + +var doFuzzTests = flag.Bool("gob.fuzz", false, "run the fuzz tests, which are large and very slow") + +// Guarantee encoding format by comparing some encodings to hand-written values +type EncodeT struct { + x uint64 + b []byte +} + +var encodeT = []EncodeT{ + {0x00, []byte{0x00}}, + {0x0F, []byte{0x0F}}, + {0xFF, []byte{0xFF, 0xFF}}, + {0xFFFF, []byte{0xFE, 0xFF, 0xFF}}, + {0xFFFFFF, []byte{0xFD, 0xFF, 0xFF, 0xFF}}, + {0xFFFFFFFF, []byte{0xFC, 0xFF, 0xFF, 0xFF, 0xFF}}, + {0xFFFFFFFFFF, []byte{0xFB, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}}, + {0xFFFFFFFFFFFF, []byte{0xFA, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}}, + {0xFFFFFFFFFFFFFF, []byte{0xF9, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}}, + {0xFFFFFFFFFFFFFFFF, []byte{0xF8, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}}, + {0x1111, []byte{0xFE, 0x11, 0x11}}, + {0x1111111111111111, []byte{0xF8, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11}}, + {0x8888888888888888, []byte{0xF8, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88}}, + {1 << 63, []byte{0xF8, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, +} + +// testError is meant to be used as a deferred function to turn a panic(gobError) into a +// plain test.Error call. +func testError(t *testing.T) { + if e := recover(); e != nil { + t.Error(e.(gobError).err) // Will re-panic if not one of our errors, such as a runtime error. + } + return +} + +func newDecBuffer(data []byte) *decBuffer { + return &decBuffer{ + data: data, + } +} + +// Test basic encode/decode routines for unsigned integers +func TestUintCodec(t *testing.T) { + defer testError(t) + b := new(encBuffer) + encState := newEncoderState(b) + for _, tt := range encodeT { + b.Reset() + encState.encodeUint(tt.x) + if !bytes.Equal(tt.b, b.Bytes()) { + t.Errorf("encodeUint: %#x encode: expected % x got % x", tt.x, tt.b, b.Bytes()) + } + } + for u := uint64(0); ; u = (u + 1) * 7 { + b.Reset() + encState.encodeUint(u) + decState := newDecodeState(newDecBuffer(b.Bytes())) + v := decState.decodeUint() + if u != v { + t.Errorf("Encode/Decode: sent %#x received %#x", u, v) + } + if u&(1<<63) != 0 { + break + } + } +} + +func verifyInt(i int64, t *testing.T) { + defer testError(t) + var b = new(encBuffer) + encState := newEncoderState(b) + encState.encodeInt(i) + decState := newDecodeState(newDecBuffer(b.Bytes())) + decState.buf = make([]byte, 8) + j := decState.decodeInt() + if i != j { + t.Errorf("Encode/Decode: sent %#x received %#x", uint64(i), uint64(j)) + } +} + +// Test basic encode/decode routines for signed integers +func TestIntCodec(t *testing.T) { + for u := uint64(0); ; u = (u + 1) * 7 { + // Do positive and negative values + i := int64(u) + verifyInt(i, t) + verifyInt(-i, t) + verifyInt(^i, t) + if u&(1<<63) != 0 { + break + } + } + verifyInt(-1<<63, t) // a tricky case +} + +// The result of encoding a true boolean with field number 7 +var boolResult = []byte{0x07, 0x01} + +// The result of encoding a number 17 with field number 7 +var signedResult = []byte{0x07, 2 * 17} +var unsignedResult = []byte{0x07, 17} +var floatResult = []byte{0x07, 0xFE, 0x31, 0x40} + +// The result of encoding a number 17+19i with field number 7 +var complexResult = []byte{0x07, 0xFE, 0x31, 0x40, 0xFE, 0x33, 0x40} + +// The result of encoding "hello" with field number 7 +var bytesResult = []byte{0x07, 0x05, 'h', 'e', 'l', 'l', 'o'} + +func newDecodeState(buf *decBuffer) *decoderState { + d := new(decoderState) + d.b = buf + d.buf = make([]byte, uint64Size) + return d +} + +func newEncoderState(b *encBuffer) *encoderState { + b.Reset() + state := &encoderState{enc: nil, b: b} + state.fieldnum = -1 + return state +} + +// Test instruction execution for encoding. +// Do not run the machine yet; instead do individual instructions crafted by hand. +func TestScalarEncInstructions(t *testing.T) { + var b = new(encBuffer) + + // bool + { + var data bool = true + instr := &encInstr{encBool, 6, nil, 0} + state := newEncoderState(b) + instr.op(instr, state, reflect.ValueOf(data)) + if !bytes.Equal(boolResult, b.Bytes()) { + t.Errorf("bool enc instructions: expected % x got % x", boolResult, b.Bytes()) + } + } + + // int + { + b.Reset() + var data int = 17 + instr := &encInstr{encInt, 6, nil, 0} + state := newEncoderState(b) + instr.op(instr, state, reflect.ValueOf(data)) + if !bytes.Equal(signedResult, b.Bytes()) { + t.Errorf("int enc instructions: expected % x got % x", signedResult, b.Bytes()) + } + } + + // uint + { + b.Reset() + var data uint = 17 + instr := &encInstr{encUint, 6, nil, 0} + state := newEncoderState(b) + instr.op(instr, state, reflect.ValueOf(data)) + if !bytes.Equal(unsignedResult, b.Bytes()) { + t.Errorf("uint enc instructions: expected % x got % x", unsignedResult, b.Bytes()) + } + } + + // int8 + { + b.Reset() + var data int8 = 17 + instr := &encInstr{encInt, 6, nil, 0} + state := newEncoderState(b) + instr.op(instr, state, reflect.ValueOf(data)) + if !bytes.Equal(signedResult, b.Bytes()) { + t.Errorf("int8 enc instructions: expected % x got % x", signedResult, b.Bytes()) + } + } + + // uint8 + { + b.Reset() + var data uint8 = 17 + instr := &encInstr{encUint, 6, nil, 0} + state := newEncoderState(b) + instr.op(instr, state, reflect.ValueOf(data)) + if !bytes.Equal(unsignedResult, b.Bytes()) { + t.Errorf("uint8 enc instructions: expected % x got % x", unsignedResult, b.Bytes()) + } + } + + // int16 + { + b.Reset() + var data int16 = 17 + instr := &encInstr{encInt, 6, nil, 0} + state := newEncoderState(b) + instr.op(instr, state, reflect.ValueOf(data)) + if !bytes.Equal(signedResult, b.Bytes()) { + t.Errorf("int16 enc instructions: expected % x got % x", signedResult, b.Bytes()) + } + } + + // uint16 + { + b.Reset() + var data uint16 = 17 + instr := &encInstr{encUint, 6, nil, 0} + state := newEncoderState(b) + instr.op(instr, state, reflect.ValueOf(data)) + if !bytes.Equal(unsignedResult, b.Bytes()) { + t.Errorf("uint16 enc instructions: expected % x got % x", unsignedResult, b.Bytes()) + } + } + + // int32 + { + b.Reset() + var data int32 = 17 + instr := &encInstr{encInt, 6, nil, 0} + state := newEncoderState(b) + instr.op(instr, state, reflect.ValueOf(data)) + if !bytes.Equal(signedResult, b.Bytes()) { + t.Errorf("int32 enc instructions: expected % x got % x", signedResult, b.Bytes()) + } + } + + // uint32 + { + b.Reset() + var data uint32 = 17 + instr := &encInstr{encUint, 6, nil, 0} + state := newEncoderState(b) + instr.op(instr, state, reflect.ValueOf(data)) + if !bytes.Equal(unsignedResult, b.Bytes()) { + t.Errorf("uint32 enc instructions: expected % x got % x", unsignedResult, b.Bytes()) + } + } + + // int64 + { + b.Reset() + var data int64 = 17 + instr := &encInstr{encInt, 6, nil, 0} + state := newEncoderState(b) + instr.op(instr, state, reflect.ValueOf(data)) + if !bytes.Equal(signedResult, b.Bytes()) { + t.Errorf("int64 enc instructions: expected % x got % x", signedResult, b.Bytes()) + } + } + + // uint64 + { + b.Reset() + var data uint64 = 17 + instr := &encInstr{encUint, 6, nil, 0} + state := newEncoderState(b) + instr.op(instr, state, reflect.ValueOf(data)) + if !bytes.Equal(unsignedResult, b.Bytes()) { + t.Errorf("uint64 enc instructions: expected % x got % x", unsignedResult, b.Bytes()) + } + } + + // float32 + { + b.Reset() + var data float32 = 17 + instr := &encInstr{encFloat, 6, nil, 0} + state := newEncoderState(b) + instr.op(instr, state, reflect.ValueOf(data)) + if !bytes.Equal(floatResult, b.Bytes()) { + t.Errorf("float32 enc instructions: expected % x got % x", floatResult, b.Bytes()) + } + } + + // float64 + { + b.Reset() + var data float64 = 17 + instr := &encInstr{encFloat, 6, nil, 0} + state := newEncoderState(b) + instr.op(instr, state, reflect.ValueOf(data)) + if !bytes.Equal(floatResult, b.Bytes()) { + t.Errorf("float64 enc instructions: expected % x got % x", floatResult, b.Bytes()) + } + } + + // bytes == []uint8 + { + b.Reset() + data := []byte("hello") + instr := &encInstr{encUint8Array, 6, nil, 0} + state := newEncoderState(b) + instr.op(instr, state, reflect.ValueOf(data)) + if !bytes.Equal(bytesResult, b.Bytes()) { + t.Errorf("bytes enc instructions: expected % x got % x", bytesResult, b.Bytes()) + } + } + + // string + { + b.Reset() + var data string = "hello" + instr := &encInstr{encString, 6, nil, 0} + state := newEncoderState(b) + instr.op(instr, state, reflect.ValueOf(data)) + if !bytes.Equal(bytesResult, b.Bytes()) { + t.Errorf("string enc instructions: expected % x got % x", bytesResult, b.Bytes()) + } + } +} + +func execDec(typ string, instr *decInstr, state *decoderState, t *testing.T, value reflect.Value) { + defer testError(t) + v := int(state.decodeUint()) + if v+state.fieldnum != 6 { + t.Fatalf("decoding field number %d, got %d", 6, v+state.fieldnum) + } + instr.op(instr, state, value.Elem()) + state.fieldnum = 6 +} + +func newDecodeStateFromData(data []byte) *decoderState { + b := newDecBuffer(data) + state := newDecodeState(b) + state.fieldnum = -1 + return state +} + +// Test instruction execution for decoding. +// Do not run the machine yet; instead do individual instructions crafted by hand. +func TestScalarDecInstructions(t *testing.T) { + ovfl := errors.New("overflow") + + // bool + { + var data bool + instr := &decInstr{decBool, 6, nil, ovfl} + state := newDecodeStateFromData(boolResult) + execDec("bool", instr, state, t, reflect.ValueOf(&data)) + if data != true { + t.Errorf("bool a = %v not true", data) + } + } + // int + { + var data int + instr := &decInstr{decOpTable[reflect.Int], 6, nil, ovfl} + state := newDecodeStateFromData(signedResult) + execDec("int", instr, state, t, reflect.ValueOf(&data)) + if data != 17 { + t.Errorf("int a = %v not 17", data) + } + } + + // uint + { + var data uint + instr := &decInstr{decOpTable[reflect.Uint], 6, nil, ovfl} + state := newDecodeStateFromData(unsignedResult) + execDec("uint", instr, state, t, reflect.ValueOf(&data)) + if data != 17 { + t.Errorf("uint a = %v not 17", data) + } + } + + // int8 + { + var data int8 + instr := &decInstr{decInt8, 6, nil, ovfl} + state := newDecodeStateFromData(signedResult) + execDec("int8", instr, state, t, reflect.ValueOf(&data)) + if data != 17 { + t.Errorf("int8 a = %v not 17", data) + } + } + + // uint8 + { + var data uint8 + instr := &decInstr{decUint8, 6, nil, ovfl} + state := newDecodeStateFromData(unsignedResult) + execDec("uint8", instr, state, t, reflect.ValueOf(&data)) + if data != 17 { + t.Errorf("uint8 a = %v not 17", data) + } + } + + // int16 + { + var data int16 + instr := &decInstr{decInt16, 6, nil, ovfl} + state := newDecodeStateFromData(signedResult) + execDec("int16", instr, state, t, reflect.ValueOf(&data)) + if data != 17 { + t.Errorf("int16 a = %v not 17", data) + } + } + + // uint16 + { + var data uint16 + instr := &decInstr{decUint16, 6, nil, ovfl} + state := newDecodeStateFromData(unsignedResult) + execDec("uint16", instr, state, t, reflect.ValueOf(&data)) + if data != 17 { + t.Errorf("uint16 a = %v not 17", data) + } + } + + // int32 + { + var data int32 + instr := &decInstr{decInt32, 6, nil, ovfl} + state := newDecodeStateFromData(signedResult) + execDec("int32", instr, state, t, reflect.ValueOf(&data)) + if data != 17 { + t.Errorf("int32 a = %v not 17", data) + } + } + + // uint32 + { + var data uint32 + instr := &decInstr{decUint32, 6, nil, ovfl} + state := newDecodeStateFromData(unsignedResult) + execDec("uint32", instr, state, t, reflect.ValueOf(&data)) + if data != 17 { + t.Errorf("uint32 a = %v not 17", data) + } + } + + // uintptr + { + var data uintptr + instr := &decInstr{decOpTable[reflect.Uintptr], 6, nil, ovfl} + state := newDecodeStateFromData(unsignedResult) + execDec("uintptr", instr, state, t, reflect.ValueOf(&data)) + if data != 17 { + t.Errorf("uintptr a = %v not 17", data) + } + } + + // int64 + { + var data int64 + instr := &decInstr{decInt64, 6, nil, ovfl} + state := newDecodeStateFromData(signedResult) + execDec("int64", instr, state, t, reflect.ValueOf(&data)) + if data != 17 { + t.Errorf("int64 a = %v not 17", data) + } + } + + // uint64 + { + var data uint64 + instr := &decInstr{decUint64, 6, nil, ovfl} + state := newDecodeStateFromData(unsignedResult) + execDec("uint64", instr, state, t, reflect.ValueOf(&data)) + if data != 17 { + t.Errorf("uint64 a = %v not 17", data) + } + } + + // float32 + { + var data float32 + instr := &decInstr{decFloat32, 6, nil, ovfl} + state := newDecodeStateFromData(floatResult) + execDec("float32", instr, state, t, reflect.ValueOf(&data)) + if data != 17 { + t.Errorf("float32 a = %v not 17", data) + } + } + + // float64 + { + var data float64 + instr := &decInstr{decFloat64, 6, nil, ovfl} + state := newDecodeStateFromData(floatResult) + execDec("float64", instr, state, t, reflect.ValueOf(&data)) + if data != 17 { + t.Errorf("float64 a = %v not 17", data) + } + } + + // complex64 + { + var data complex64 + instr := &decInstr{decOpTable[reflect.Complex64], 6, nil, ovfl} + state := newDecodeStateFromData(complexResult) + execDec("complex", instr, state, t, reflect.ValueOf(&data)) + if data != 17+19i { + t.Errorf("complex a = %v not 17+19i", data) + } + } + + // complex128 + { + var data complex128 + instr := &decInstr{decOpTable[reflect.Complex128], 6, nil, ovfl} + state := newDecodeStateFromData(complexResult) + execDec("complex", instr, state, t, reflect.ValueOf(&data)) + if data != 17+19i { + t.Errorf("complex a = %v not 17+19i", data) + } + } + + // bytes == []uint8 + { + var data []byte + instr := &decInstr{decUint8Slice, 6, nil, ovfl} + state := newDecodeStateFromData(bytesResult) + execDec("bytes", instr, state, t, reflect.ValueOf(&data)) + if string(data) != "hello" { + t.Errorf(`bytes a = %q not "hello"`, string(data)) + } + } + + // string + { + var data string + instr := &decInstr{decString, 6, nil, ovfl} + state := newDecodeStateFromData(bytesResult) + execDec("bytes", instr, state, t, reflect.ValueOf(&data)) + if data != "hello" { + t.Errorf(`bytes a = %q not "hello"`, data) + } + } +} + +func TestEndToEnd(t *testing.T) { + type T2 struct { + T string + } + s1 := "string1" + s2 := "string2" + type T1 struct { + A, B, C int + M map[string]*float64 + EmptyMap map[string]int // to check that we receive a non-nil map. + N *[3]float64 + Strs *[2]string + Int64s *[]int64 + RI complex64 + S string + Y []byte + T *T2 + } + pi := 3.14159 + e := 2.71828 + t1 := &T1{ + A: 17, + B: 18, + C: -5, + M: map[string]*float64{"pi": &pi, "e": &e}, + EmptyMap: make(map[string]int), + N: &[3]float64{1.5, 2.5, 3.5}, + Strs: &[2]string{s1, s2}, + Int64s: &[]int64{77, 89, 123412342134}, + RI: 17 - 23i, + S: "Now is the time", + Y: []byte("hello, sailor"), + T: &T2{"this is T2"}, + } + b := new(bytes.Buffer) + err := NewEncoder(b).Encode(t1) + if err != nil { + t.Error("encode:", err) + } + var _t1 T1 + err = NewDecoder(b).Decode(&_t1) + if err != nil { + t.Fatal("decode:", err) + } + if !reflect.DeepEqual(t1, &_t1) { + t.Errorf("encode expected %v got %v", *t1, _t1) + } + // Be absolutely sure the received map is non-nil. + if t1.EmptyMap == nil { + t.Errorf("nil map sent") + } + if _t1.EmptyMap == nil { + t.Errorf("nil map received") + } +} + +func TestOverflow(t *testing.T) { + type inputT struct { + Maxi int64 + Mini int64 + Maxu uint64 + Maxf float64 + Minf float64 + Maxc complex128 + Minc complex128 + } + var it inputT + var err error + b := new(bytes.Buffer) + enc := NewEncoder(b) + dec := NewDecoder(b) + + // int8 + b.Reset() + it = inputT{ + Maxi: math.MaxInt8 + 1, + } + type outi8 struct { + Maxi int8 + Mini int8 + } + var o1 outi8 + enc.Encode(it) + err = dec.Decode(&o1) + if err == nil || err.Error() != `value for "Maxi" out of range` { + t.Error("wrong overflow error for int8:", err) + } + it = inputT{ + Mini: math.MinInt8 - 1, + } + b.Reset() + enc.Encode(it) + err = dec.Decode(&o1) + if err == nil || err.Error() != `value for "Mini" out of range` { + t.Error("wrong underflow error for int8:", err) + } + + // int16 + b.Reset() + it = inputT{ + Maxi: math.MaxInt16 + 1, + } + type outi16 struct { + Maxi int16 + Mini int16 + } + var o2 outi16 + enc.Encode(it) + err = dec.Decode(&o2) + if err == nil || err.Error() != `value for "Maxi" out of range` { + t.Error("wrong overflow error for int16:", err) + } + it = inputT{ + Mini: math.MinInt16 - 1, + } + b.Reset() + enc.Encode(it) + err = dec.Decode(&o2) + if err == nil || err.Error() != `value for "Mini" out of range` { + t.Error("wrong underflow error for int16:", err) + } + + // int32 + b.Reset() + it = inputT{ + Maxi: math.MaxInt32 + 1, + } + type outi32 struct { + Maxi int32 + Mini int32 + } + var o3 outi32 + enc.Encode(it) + err = dec.Decode(&o3) + if err == nil || err.Error() != `value for "Maxi" out of range` { + t.Error("wrong overflow error for int32:", err) + } + it = inputT{ + Mini: math.MinInt32 - 1, + } + b.Reset() + enc.Encode(it) + err = dec.Decode(&o3) + if err == nil || err.Error() != `value for "Mini" out of range` { + t.Error("wrong underflow error for int32:", err) + } + + // uint8 + b.Reset() + it = inputT{ + Maxu: math.MaxUint8 + 1, + } + type outu8 struct { + Maxu uint8 + } + var o4 outu8 + enc.Encode(it) + err = dec.Decode(&o4) + if err == nil || err.Error() != `value for "Maxu" out of range` { + t.Error("wrong overflow error for uint8:", err) + } + + // uint16 + b.Reset() + it = inputT{ + Maxu: math.MaxUint16 + 1, + } + type outu16 struct { + Maxu uint16 + } + var o5 outu16 + enc.Encode(it) + err = dec.Decode(&o5) + if err == nil || err.Error() != `value for "Maxu" out of range` { + t.Error("wrong overflow error for uint16:", err) + } + + // uint32 + b.Reset() + it = inputT{ + Maxu: math.MaxUint32 + 1, + } + type outu32 struct { + Maxu uint32 + } + var o6 outu32 + enc.Encode(it) + err = dec.Decode(&o6) + if err == nil || err.Error() != `value for "Maxu" out of range` { + t.Error("wrong overflow error for uint32:", err) + } + + // float32 + b.Reset() + it = inputT{ + Maxf: math.MaxFloat32 * 2, + } + type outf32 struct { + Maxf float32 + Minf float32 + } + var o7 outf32 + enc.Encode(it) + err = dec.Decode(&o7) + if err == nil || err.Error() != `value for "Maxf" out of range` { + t.Error("wrong overflow error for float32:", err) + } + + // complex64 + b.Reset() + it = inputT{ + Maxc: complex(math.MaxFloat32*2, math.MaxFloat32*2), + } + type outc64 struct { + Maxc complex64 + Minc complex64 + } + var o8 outc64 + enc.Encode(it) + err = dec.Decode(&o8) + if err == nil || err.Error() != `value for "Maxc" out of range` { + t.Error("wrong overflow error for complex64:", err) + } +} + +func TestNesting(t *testing.T) { + type RT struct { + A string + Next *RT + } + rt := new(RT) + rt.A = "level1" + rt.Next = new(RT) + rt.Next.A = "level2" + b := new(bytes.Buffer) + NewEncoder(b).Encode(rt) + var drt RT + dec := NewDecoder(b) + err := dec.Decode(&drt) + if err != nil { + t.Fatal("decoder error:", err) + } + if drt.A != rt.A { + t.Errorf("nesting: encode expected %v got %v", *rt, drt) + } + if drt.Next == nil { + t.Errorf("nesting: recursion failed") + } + if drt.Next.A != rt.Next.A { + t.Errorf("nesting: encode expected %v got %v", *rt.Next, *drt.Next) + } +} + +// These three structures have the same data with different indirections +type T0 struct { + A int + B int + C int + D int +} +type T1 struct { + A int + B *int + C **int + D ***int +} +type T2 struct { + A ***int + B **int + C *int + D int +} + +func TestAutoIndirection(t *testing.T) { + // First transfer t1 into t0 + var t1 T1 + t1.A = 17 + t1.B = new(int) + *t1.B = 177 + t1.C = new(*int) + *t1.C = new(int) + **t1.C = 1777 + t1.D = new(**int) + *t1.D = new(*int) + **t1.D = new(int) + ***t1.D = 17777 + b := new(bytes.Buffer) + enc := NewEncoder(b) + enc.Encode(t1) + dec := NewDecoder(b) + var t0 T0 + dec.Decode(&t0) + if t0.A != 17 || t0.B != 177 || t0.C != 1777 || t0.D != 17777 { + t.Errorf("t1->t0: expected {17 177 1777 17777}; got %v", t0) + } + + // Now transfer t2 into t0 + var t2 T2 + t2.D = 17777 + t2.C = new(int) + *t2.C = 1777 + t2.B = new(*int) + *t2.B = new(int) + **t2.B = 177 + t2.A = new(**int) + *t2.A = new(*int) + **t2.A = new(int) + ***t2.A = 17 + b.Reset() + enc.Encode(t2) + t0 = T0{} + dec.Decode(&t0) + if t0.A != 17 || t0.B != 177 || t0.C != 1777 || t0.D != 17777 { + t.Errorf("t2->t0 expected {17 177 1777 17777}; got %v", t0) + } + + // Now transfer t0 into t1 + t0 = T0{17, 177, 1777, 17777} + b.Reset() + enc.Encode(t0) + t1 = T1{} + dec.Decode(&t1) + if t1.A != 17 || *t1.B != 177 || **t1.C != 1777 || ***t1.D != 17777 { + t.Errorf("t0->t1 expected {17 177 1777 17777}; got {%d %d %d %d}", t1.A, *t1.B, **t1.C, ***t1.D) + } + + // Now transfer t0 into t2 + b.Reset() + enc.Encode(t0) + t2 = T2{} + dec.Decode(&t2) + if ***t2.A != 17 || **t2.B != 177 || *t2.C != 1777 || t2.D != 17777 { + t.Errorf("t0->t2 expected {17 177 1777 17777}; got {%d %d %d %d}", ***t2.A, **t2.B, *t2.C, t2.D) + } + + // Now do t2 again but without pre-allocated pointers. + b.Reset() + enc.Encode(t0) + ***t2.A = 0 + **t2.B = 0 + *t2.C = 0 + t2.D = 0 + dec.Decode(&t2) + if ***t2.A != 17 || **t2.B != 177 || *t2.C != 1777 || t2.D != 17777 { + t.Errorf("t0->t2 expected {17 177 1777 17777}; got {%d %d %d %d}", ***t2.A, **t2.B, *t2.C, t2.D) + } +} + +type RT0 struct { + A int + B string + C float64 +} +type RT1 struct { + C float64 + B string + A int + NotSet string +} + +func TestReorderedFields(t *testing.T) { + var rt0 RT0 + rt0.A = 17 + rt0.B = "hello" + rt0.C = 3.14159 + b := new(bytes.Buffer) + NewEncoder(b).Encode(rt0) + dec := NewDecoder(b) + var rt1 RT1 + // Wire type is RT0, local type is RT1. + err := dec.Decode(&rt1) + if err != nil { + t.Fatal("decode error:", err) + } + if rt0.A != rt1.A || rt0.B != rt1.B || rt0.C != rt1.C { + t.Errorf("rt1->rt0: expected %v; got %v", rt0, rt1) + } +} + +// Like an RT0 but with fields we'll ignore on the decode side. +type IT0 struct { + A int64 + B string + Ignore_d []int + Ignore_e [3]float64 + Ignore_f bool + Ignore_g string + Ignore_h []byte + Ignore_i *RT1 + Ignore_m map[string]int + C float64 +} + +func TestIgnoredFields(t *testing.T) { + var it0 IT0 + it0.A = 17 + it0.B = "hello" + it0.C = 3.14159 + it0.Ignore_d = []int{1, 2, 3} + it0.Ignore_e[0] = 1.0 + it0.Ignore_e[1] = 2.0 + it0.Ignore_e[2] = 3.0 + it0.Ignore_f = true + it0.Ignore_g = "pay no attention" + it0.Ignore_h = []byte("to the curtain") + it0.Ignore_i = &RT1{3.1, "hi", 7, "hello"} + it0.Ignore_m = map[string]int{"one": 1, "two": 2} + + b := new(bytes.Buffer) + NewEncoder(b).Encode(it0) + dec := NewDecoder(b) + var rt1 RT1 + // Wire type is IT0, local type is RT1. + err := dec.Decode(&rt1) + if err != nil { + t.Error("error: ", err) + } + if int(it0.A) != rt1.A || it0.B != rt1.B || it0.C != rt1.C { + t.Errorf("rt0->rt1: expected %v; got %v", it0, rt1) + } +} + +func TestBadRecursiveType(t *testing.T) { + type Rec ***Rec + var rec Rec + b := new(bytes.Buffer) + err := NewEncoder(b).Encode(&rec) + if err == nil { + t.Error("expected error; got none") + } else if strings.Index(err.Error(), "recursive") < 0 { + t.Error("expected recursive type error; got", err) + } + // Can't test decode easily because we can't encode one, so we can't pass one to a Decoder. +} + +type Indirect struct { + A ***[3]int + S ***[]int + M ****map[string]int +} + +type Direct struct { + A [3]int + S []int + M map[string]int +} + +func TestIndirectSliceMapArray(t *testing.T) { + // Marshal indirect, unmarshal to direct. + i := new(Indirect) + i.A = new(**[3]int) + *i.A = new(*[3]int) + **i.A = new([3]int) + ***i.A = [3]int{1, 2, 3} + i.S = new(**[]int) + *i.S = new(*[]int) + **i.S = new([]int) + ***i.S = []int{4, 5, 6} + i.M = new(***map[string]int) + *i.M = new(**map[string]int) + **i.M = new(*map[string]int) + ***i.M = new(map[string]int) + ****i.M = map[string]int{"one": 1, "two": 2, "three": 3} + b := new(bytes.Buffer) + NewEncoder(b).Encode(i) + dec := NewDecoder(b) + var d Direct + err := dec.Decode(&d) + if err != nil { + t.Error("error: ", err) + } + if len(d.A) != 3 || d.A[0] != 1 || d.A[1] != 2 || d.A[2] != 3 { + t.Errorf("indirect to direct: d.A is %v not %v", d.A, ***i.A) + } + if len(d.S) != 3 || d.S[0] != 4 || d.S[1] != 5 || d.S[2] != 6 { + t.Errorf("indirect to direct: d.S is %v not %v", d.S, ***i.S) + } + if len(d.M) != 3 || d.M["one"] != 1 || d.M["two"] != 2 || d.M["three"] != 3 { + t.Errorf("indirect to direct: d.M is %v not %v", d.M, ***i.M) + } + // Marshal direct, unmarshal to indirect. + d.A = [3]int{11, 22, 33} + d.S = []int{44, 55, 66} + d.M = map[string]int{"four": 4, "five": 5, "six": 6} + i = new(Indirect) + b.Reset() + NewEncoder(b).Encode(d) + dec = NewDecoder(b) + err = dec.Decode(&i) + if err != nil { + t.Fatal("error: ", err) + } + if len(***i.A) != 3 || (***i.A)[0] != 11 || (***i.A)[1] != 22 || (***i.A)[2] != 33 { + t.Errorf("direct to indirect: ***i.A is %v not %v", ***i.A, d.A) + } + if len(***i.S) != 3 || (***i.S)[0] != 44 || (***i.S)[1] != 55 || (***i.S)[2] != 66 { + t.Errorf("direct to indirect: ***i.S is %v not %v", ***i.S, ***i.S) + } + if len(****i.M) != 3 || (****i.M)["four"] != 4 || (****i.M)["five"] != 5 || (****i.M)["six"] != 6 { + t.Errorf("direct to indirect: ****i.M is %v not %v", ****i.M, d.M) + } +} + +// An interface with several implementations +type Squarer interface { + Square() int +} + +type Int int + +func (i Int) Square() int { + return int(i * i) +} + +type Float float64 + +func (f Float) Square() int { + return int(f * f) +} + +type Vector []int + +func (v Vector) Square() int { + sum := 0 + for _, x := range v { + sum += x * x + } + return sum +} + +type Point struct { + X, Y int +} + +func (p Point) Square() int { + return p.X*p.X + p.Y*p.Y +} + +// A struct with interfaces in it. +type InterfaceItem struct { + I int + Sq1, Sq2, Sq3 Squarer + F float64 + Sq []Squarer +} + +// The same struct without interfaces +type NoInterfaceItem struct { + I int + F float64 +} + +func TestInterface(t *testing.T) { + iVal := Int(3) + fVal := Float(5) + // Sending a Vector will require that the receiver define a type in the middle of + // receiving the value for item2. + vVal := Vector{1, 2, 3} + b := new(bytes.Buffer) + item1 := &InterfaceItem{1, iVal, fVal, vVal, 11.5, []Squarer{iVal, fVal, nil, vVal}} + // Register the types. + Register(Int(0)) + Register(Float(0)) + Register(Vector{}) + err := NewEncoder(b).Encode(item1) + if err != nil { + t.Error("expected no encode error; got", err) + } + + item2 := InterfaceItem{} + err = NewDecoder(b).Decode(&item2) + if err != nil { + t.Fatal("decode:", err) + } + if item2.I != item1.I { + t.Error("normal int did not decode correctly") + } + if item2.Sq1 == nil || item2.Sq1.Square() != iVal.Square() { + t.Error("Int did not decode correctly") + } + if item2.Sq2 == nil || item2.Sq2.Square() != fVal.Square() { + t.Error("Float did not decode correctly") + } + if item2.Sq3 == nil || item2.Sq3.Square() != vVal.Square() { + t.Error("Vector did not decode correctly") + } + if item2.F != item1.F { + t.Error("normal float did not decode correctly") + } + // Now check that we received a slice of Squarers correctly, including a nil element + if len(item1.Sq) != len(item2.Sq) { + t.Fatalf("[]Squarer length wrong: got %d; expected %d", len(item2.Sq), len(item1.Sq)) + } + for i, v1 := range item1.Sq { + v2 := item2.Sq[i] + if v1 == nil || v2 == nil { + if v1 != nil || v2 != nil { + t.Errorf("item %d inconsistent nils", i) + } + } else if v1.Square() != v2.Square() { + t.Errorf("item %d inconsistent values: %v %v", i, v1, v2) + } + } +} + +// A struct with all basic types, stored in interfaces. +type BasicInterfaceItem struct { + Int, Int8, Int16, Int32, Int64 interface{} + Uint, Uint8, Uint16, Uint32, Uint64 interface{} + Float32, Float64 interface{} + Complex64, Complex128 interface{} + Bool interface{} + String interface{} + Bytes interface{} +} + +func TestInterfaceBasic(t *testing.T) { + b := new(bytes.Buffer) + item1 := &BasicInterfaceItem{ + int(1), int8(1), int16(1), int32(1), int64(1), + uint(1), uint8(1), uint16(1), uint32(1), uint64(1), + float32(1), 1.0, + complex64(1i), complex128(1i), + true, + "hello", + []byte("sailor"), + } + err := NewEncoder(b).Encode(item1) + if err != nil { + t.Error("expected no encode error; got", err) + } + + item2 := &BasicInterfaceItem{} + err = NewDecoder(b).Decode(&item2) + if err != nil { + t.Fatal("decode:", err) + } + if !reflect.DeepEqual(item1, item2) { + t.Errorf("encode expected %v got %v", item1, item2) + } + // Hand check a couple for correct types. + if v, ok := item2.Bool.(bool); !ok || !v { + t.Error("boolean should be true") + } + if v, ok := item2.String.(string); !ok || v != item1.String.(string) { + t.Errorf("string should be %v is %v", item1.String, v) + } +} + +type String string + +type PtrInterfaceItem struct { + Str1 interface{} // basic + Str2 interface{} // derived +} + +// We'll send pointers; should receive values. +// Also check that we can register T but send *T. +func TestInterfacePointer(t *testing.T) { + b := new(bytes.Buffer) + str1 := "howdy" + str2 := String("kiddo") + item1 := &PtrInterfaceItem{ + &str1, + &str2, + } + // Register the type. + Register(str2) + err := NewEncoder(b).Encode(item1) + if err != nil { + t.Error("expected no encode error; got", err) + } + + item2 := &PtrInterfaceItem{} + err = NewDecoder(b).Decode(&item2) + if err != nil { + t.Fatal("decode:", err) + } + // Hand test for correct types and values. + if v, ok := item2.Str1.(string); !ok || v != str1 { + t.Errorf("basic string failed: %q should be %q", v, str1) + } + if v, ok := item2.Str2.(String); !ok || v != str2 { + t.Errorf("derived type String failed: %q should be %q", v, str2) + } +} + +func TestIgnoreInterface(t *testing.T) { + iVal := Int(3) + fVal := Float(5) + // Sending a Point will require that the receiver define a type in the middle of + // receiving the value for item2. + pVal := Point{2, 3} + b := new(bytes.Buffer) + item1 := &InterfaceItem{1, iVal, fVal, pVal, 11.5, nil} + // Register the types. + Register(Int(0)) + Register(Float(0)) + Register(Point{}) + err := NewEncoder(b).Encode(item1) + if err != nil { + t.Error("expected no encode error; got", err) + } + + item2 := NoInterfaceItem{} + err = NewDecoder(b).Decode(&item2) + if err != nil { + t.Fatal("decode:", err) + } + if item2.I != item1.I { + t.Error("normal int did not decode correctly") + } + if item2.F != item2.F { + t.Error("normal float did not decode correctly") + } +} + +type U struct { + A int + B string + c float64 + D uint +} + +func TestUnexportedFields(t *testing.T) { + var u0 U + u0.A = 17 + u0.B = "hello" + u0.c = 3.14159 + u0.D = 23 + b := new(bytes.Buffer) + NewEncoder(b).Encode(u0) + dec := NewDecoder(b) + var u1 U + u1.c = 1234. + err := dec.Decode(&u1) + if err != nil { + t.Fatal("decode error:", err) + } + if u0.A != u0.A || u0.B != u1.B || u0.D != u1.D { + t.Errorf("u1->u0: expected %v; got %v", u0, u1) + } + if u1.c != 1234. { + t.Error("u1.c modified") + } +} + +var singletons = []interface{}{ + true, + 7, + 3.2, + "hello", + [3]int{11, 22, 33}, + []float32{0.5, 0.25, 0.125}, + map[string]int{"one": 1, "two": 2}, +} + +func TestDebugSingleton(t *testing.T) { + if debugFunc == nil { + return + } + b := new(bytes.Buffer) + // Accumulate a number of values and print them out all at once. + for _, x := range singletons { + err := NewEncoder(b).Encode(x) + if err != nil { + t.Fatal("encode:", err) + } + } + debugFunc(b) +} + +// A type that won't be defined in the gob until we send it in an interface value. +type OnTheFly struct { + A int +} + +type DT struct { + // X OnTheFly + A int + B string + C float64 + I interface{} + J interface{} + I_nil interface{} + M map[string]int + T [3]int + S []string +} + +func newDT() DT { + var dt DT + dt.A = 17 + dt.B = "hello" + dt.C = 3.14159 + dt.I = 271828 + dt.J = OnTheFly{3} + dt.I_nil = nil + dt.M = map[string]int{"one": 1, "two": 2} + dt.T = [3]int{11, 22, 33} + dt.S = []string{"hi", "joe"} + return dt +} + +func TestDebugStruct(t *testing.T) { + if debugFunc == nil { + return + } + Register(OnTheFly{}) + dt := newDT() + b := new(bytes.Buffer) + err := NewEncoder(b).Encode(dt) + if err != nil { + t.Fatal("encode:", err) + } + debugBuffer := bytes.NewBuffer(b.Bytes()) + dt2 := &DT{} + err = NewDecoder(b).Decode(&dt2) + if err != nil { + t.Error("decode:", err) + } + debugFunc(debugBuffer) +} + +func encFuzzDec(rng *rand.Rand, in interface{}) error { + buf := new(bytes.Buffer) + enc := NewEncoder(buf) + if err := enc.Encode(&in); err != nil { + return err + } + + b := buf.Bytes() + for i, bi := range b { + if rng.Intn(10) < 3 { + b[i] = bi + uint8(rng.Intn(256)) + } + } + + dec := NewDecoder(buf) + var e interface{} + if err := dec.Decode(&e); err != nil { + return err + } + return nil +} + +// This does some "fuzz testing" by attempting to decode a sequence of random bytes. +func TestFuzz(t *testing.T) { + if !*doFuzzTests { + t.Logf("disabled; run with -gob.fuzz to enable") + return + } + + // all possible inputs + input := []interface{}{ + new(int), + new(float32), + new(float64), + new(complex128), + &ByteStruct{255}, + &ArrayStruct{}, + &StringStruct{"hello"}, + &GobTest1{0, &StringStruct{"hello"}}, + } + testFuzz(t, time.Now().UnixNano(), 100, input...) +} + +func TestFuzzRegressions(t *testing.T) { + if !*doFuzzTests { + t.Logf("disabled; run with -gob.fuzz to enable") + return + } + + // An instance triggering a type name of length ~102 GB. + testFuzz(t, 1328492090837718000, 100, new(float32)) + // An instance triggering a type name of 1.6 GB. + // Note: can take several minutes to run. + testFuzz(t, 1330522872628565000, 100, new(int)) +} + +func testFuzz(t *testing.T, seed int64, n int, input ...interface{}) { + for _, e := range input { + t.Logf("seed=%d n=%d e=%T", seed, n, e) + rng := rand.New(rand.NewSource(seed)) + for i := 0; i < n; i++ { + encFuzzDec(rng, e) + } + } +} + +// TestFuzzOneByte tries to decode corrupted input sequences +// and checks that no panic occurs. +func TestFuzzOneByte(t *testing.T) { + buf := new(bytes.Buffer) + Register(OnTheFly{}) + dt := newDT() + if err := NewEncoder(buf).Encode(dt); err != nil { + t.Fatal(err) + } + s := buf.String() + + indices := make([]int, 0, len(s)) + for i := 0; i < len(s); i++ { + switch i { + case 14, 167, 231, 265: // a slice length, corruptions are not handled yet. + continue + } + indices = append(indices, i) + } + if testing.Short() { + indices = []int{1, 111, 178} // known fixed panics + } + for _, i := range indices { + for j := 0; j < 256; j += 3 { + b := []byte(s) + b[i] ^= byte(j) + var e DT + func() { + defer func() { + if p := recover(); p != nil { + t.Errorf("crash for b[%d] ^= 0x%x", i, j) + panic(p) + } + }() + err := NewDecoder(bytes.NewReader(b)).Decode(&e) + _ = err + }() + } + } +} + +// Don't crash, just give error with invalid type id. +// Issue 9649. +func TestErrorInvalidTypeId(t *testing.T) { + data := []byte{0x01, 0x00, 0x01, 0x00} + d := NewDecoder(bytes.NewReader(data)) + // When running d.Decode(&foo) the first time the decoder stops + // after []byte{0x01, 0x00} and reports an errBadType. Running + // d.Decode(&foo) again on exactly the same input sequence should + // give another errBadType, but instead caused a panic because + // decoderMap wasn't cleaned up properly after the first error. + for i := 0; i < 2; i++ { + var foo struct{} + err := d.Decode(&foo) + if err != errBadType { + t.Fatal("decode: expected %s, got %s", errBadType, err) + } + } +} diff --git a/src/encoding/gob/debug.go b/src/encoding/gob/debug.go new file mode 100644 index 0000000000000000000000000000000000000000..536bbdb5ac6a5397330a21d3c5e5743e826e3ad4 --- /dev/null +++ b/src/encoding/gob/debug.go @@ -0,0 +1,705 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Delete the next line to include in the gob package. +// +build ignore + +package gob + +// This file is not normally included in the gob package. Used only for debugging the package itself. +// Except for reading uints, it is an implementation of a reader that is independent of +// the one implemented by Decoder. +// To enable the Debug function, delete the +build ignore line above and do +// go install + +import ( + "bytes" + "fmt" + "io" + "os" + "strings" + "sync" +) + +var dumpBytes = false // If true, print the remaining bytes in the input buffer at each item. + +// Init installs the debugging facility. If this file is not compiled in the +// package, the tests in codec_test.go are no-ops. +func init() { + debugFunc = Debug +} + +var ( + blanks = bytes.Repeat([]byte{' '}, 3*10) + empty = []byte(": \n") + tabs = strings.Repeat("\t", 100) +) + +// tab indents itself when printed. +type tab int + +func (t tab) String() string { + n := int(t) + if n > len(tabs) { + n = len(tabs) + } + return tabs[0:n] +} + +func (t tab) print() { + fmt.Fprint(os.Stderr, t) +} + +// A peekReader wraps an io.Reader, allowing one to peek ahead to see +// what's coming without stealing the data from the client of the Reader. +type peekReader struct { + r io.Reader + data []byte // read-ahead data +} + +// newPeekReader returns a peekReader that wraps r. +func newPeekReader(r io.Reader) *peekReader { + return &peekReader{r: r} +} + +// Read is the usual method. It will first take data that has been read ahead. +func (p *peekReader) Read(b []byte) (n int, err error) { + if len(p.data) == 0 { + return p.r.Read(b) + } + // Satisfy what's possible from the read-ahead data. + n = copy(b, p.data) + // Move data down to beginning of slice, to avoid endless growth + copy(p.data, p.data[n:]) + p.data = p.data[:len(p.data)-n] + return +} + +// peek returns as many bytes as possible from the unread +// portion of the stream, up to the length of b. +func (p *peekReader) peek(b []byte) (n int, err error) { + if len(p.data) > 0 { + n = copy(b, p.data) + if n == len(b) { + return + } + b = b[n:] + } + if len(b) == 0 { + return + } + m, e := io.ReadFull(p.r, b) + if m > 0 { + p.data = append(p.data, b[:m]...) + } + n += m + if e == io.ErrUnexpectedEOF { + // That means m > 0 but we reached EOF. If we got data + // we won't complain about not being able to peek enough. + if n > 0 { + e = nil + } else { + e = io.EOF + } + } + return n, e +} + +type debugger struct { + mutex sync.Mutex + remain int // the number of bytes known to remain in the input + remainingKnown bool // the value of 'remain' is valid + r *peekReader + wireType map[typeId]*wireType + tmp []byte // scratch space for decoding uints. +} + +// dump prints the next nBytes of the input. +// It arranges to print the output aligned from call to +// call, to make it easy to see what has been consumed. +func (deb *debugger) dump(format string, args ...interface{}) { + if !dumpBytes { + return + } + fmt.Fprintf(os.Stderr, format+" ", args...) + if !deb.remainingKnown { + return + } + if deb.remain < 0 { + fmt.Fprintf(os.Stderr, "remaining byte count is negative! %d\n", deb.remain) + return + } + data := make([]byte, deb.remain) + n, _ := deb.r.peek(data) + if n == 0 { + os.Stderr.Write(empty) + return + } + b := new(bytes.Buffer) + fmt.Fprintf(b, "[%d]{\n", deb.remain) + // Blanks until first byte + lineLength := 0 + if n := len(data); n%10 != 0 { + lineLength = 10 - n%10 + fmt.Fprintf(b, "\t%s", blanks[:lineLength*3]) + } + // 10 bytes per line + for len(data) > 0 { + if lineLength == 0 { + fmt.Fprint(b, "\t") + } + m := 10 - lineLength + lineLength = 0 + if m > len(data) { + m = len(data) + } + fmt.Fprintf(b, "% x\n", data[:m]) + data = data[m:] + } + fmt.Fprint(b, "}\n") + os.Stderr.Write(b.Bytes()) +} + +// Debug prints a human-readable representation of the gob data read from r. +// It is a no-op unless debugging was enabled when the package was built. +func Debug(r io.Reader) { + err := debug(r) + if err != nil { + fmt.Fprintf(os.Stderr, "gob debug: %s\n", err) + } +} + +// debug implements Debug, but catches panics and returns +// them as errors to be printed by Debug. +func debug(r io.Reader) (err error) { + defer catchError(&err) + fmt.Fprintln(os.Stderr, "Start of debugging") + deb := &debugger{ + r: newPeekReader(r), + wireType: make(map[typeId]*wireType), + tmp: make([]byte, 16), + } + if b, ok := r.(*bytes.Buffer); ok { + deb.remain = b.Len() + deb.remainingKnown = true + } + deb.gobStream() + return +} + +// note that we've consumed some bytes +func (deb *debugger) consumed(n int) { + if deb.remainingKnown { + deb.remain -= n + } +} + +// int64 decodes and returns the next integer, which must be present. +// Don't call this if you could be at EOF. +func (deb *debugger) int64() int64 { + return toInt(deb.uint64()) +} + +// uint64 returns and decodes the next unsigned integer, which must be present. +// Don't call this if you could be at EOF. +// TODO: handle errors better. +func (deb *debugger) uint64() uint64 { + n, w, err := decodeUintReader(deb.r, deb.tmp) + if err != nil { + errorf("debug: read error: %s", err) + } + deb.consumed(w) + return n +} + +// GobStream: +// DelimitedMessage* (until EOF) +func (deb *debugger) gobStream() { + // Make sure we're single-threaded through here. + deb.mutex.Lock() + defer deb.mutex.Unlock() + + for deb.delimitedMessage(0) { + } +} + +// DelimitedMessage: +// uint(lengthOfMessage) Message +func (deb *debugger) delimitedMessage(indent tab) bool { + for { + n := deb.loadBlock(true) + if n < 0 { + return false + } + deb.dump("Delimited message of length %d", n) + deb.message(indent) + } + return true +} + +// loadBlock preps us to read a message +// of the length specified next in the input. It returns +// the length of the block. The argument tells whether +// an EOF is acceptable now. If it is and one is found, +// the return value is negative. +func (deb *debugger) loadBlock(eofOK bool) int { + n64, w, err := decodeUintReader(deb.r, deb.tmp) // deb.uint64 will error at EOF + if err != nil { + if eofOK && err == io.EOF { + return -1 + } + errorf("debug: unexpected error: %s", err) + } + deb.consumed(w) + n := int(n64) + if n < 0 { + errorf("huge value for message length: %d", n64) + } + return int(n) +} + +// Message: +// TypeSequence TypedValue +// TypeSequence +// (TypeDefinition DelimitedTypeDefinition*)? +// DelimitedTypeDefinition: +// uint(lengthOfTypeDefinition) TypeDefinition +// TypedValue: +// int(typeId) Value +func (deb *debugger) message(indent tab) bool { + for { + // Convert the uint64 to a signed integer typeId + uid := deb.int64() + id := typeId(uid) + deb.dump("type id=%d", id) + if id < 0 { + deb.typeDefinition(indent, -id) + n := deb.loadBlock(false) + deb.dump("Message of length %d", n) + continue + } else { + deb.value(indent, id) + break + } + } + return true +} + +// Helper methods to make it easy to scan a type descriptor. + +// common returns the CommonType at the input point. +func (deb *debugger) common() CommonType { + fieldNum := -1 + name := "" + id := typeId(0) + for { + delta := deb.delta(-1) + if delta == 0 { + break + } + fieldNum += delta + switch fieldNum { + case 0: + name = deb.string() + case 1: + // Id typeId + id = deb.typeId() + default: + errorf("corrupted CommonType, delta is %d fieldNum is %d", delta, fieldNum) + } + } + return CommonType{name, id} +} + +// uint returns the unsigned int at the input point, as a uint (not uint64). +func (deb *debugger) uint() uint { + return uint(deb.uint64()) +} + +// int returns the signed int at the input point, as an int (not int64). +func (deb *debugger) int() int { + return int(deb.int64()) +} + +// typeId returns the type id at the input point. +func (deb *debugger) typeId() typeId { + return typeId(deb.int64()) +} + +// string returns the string at the input point. +func (deb *debugger) string() string { + x := int(deb.uint64()) + b := make([]byte, x) + nb, _ := deb.r.Read(b) + if nb != x { + errorf("corrupted type") + } + deb.consumed(nb) + return string(b) +} + +// delta returns the field delta at the input point. The expect argument, +// if non-negative, identifies what the value should be. +func (deb *debugger) delta(expect int) int { + delta := int(deb.uint64()) + if delta < 0 || (expect >= 0 && delta != expect) { + errorf("decode: corrupted type: delta %d expected %d", delta, expect) + } + return delta +} + +// TypeDefinition: +// [int(-typeId) (already read)] encodingOfWireType +func (deb *debugger) typeDefinition(indent tab, id typeId) { + deb.dump("type definition for id %d", id) + // Encoding is of a wireType. Decode the structure as usual + fieldNum := -1 + wire := new(wireType) + // A wireType defines a single field. + delta := deb.delta(-1) + fieldNum += delta + switch fieldNum { + case 0: // array type, one field of {{Common}, elem, length} + // Field number 0 is CommonType + deb.delta(1) + com := deb.common() + // Field number 1 is type Id of elem + deb.delta(1) + id := deb.typeId() + // Field number 3 is length + deb.delta(1) + length := deb.int() + wire.ArrayT = &arrayType{com, id, length} + + case 1: // slice type, one field of {{Common}, elem} + // Field number 0 is CommonType + deb.delta(1) + com := deb.common() + // Field number 1 is type Id of elem + deb.delta(1) + id := deb.typeId() + wire.SliceT = &sliceType{com, id} + + case 2: // struct type, one field of {{Common}, []fieldType} + // Field number 0 is CommonType + deb.delta(1) + com := deb.common() + // Field number 1 is slice of FieldType + deb.delta(1) + numField := int(deb.uint()) + field := make([]*fieldType, numField) + for i := 0; i < numField; i++ { + field[i] = new(fieldType) + deb.delta(1) // field 0 of fieldType: name + field[i].Name = deb.string() + deb.delta(1) // field 1 of fieldType: id + field[i].Id = deb.typeId() + deb.delta(0) // end of fieldType + } + wire.StructT = &structType{com, field} + + case 3: // map type, one field of {{Common}, key, elem} + // Field number 0 is CommonType + deb.delta(1) + com := deb.common() + // Field number 1 is type Id of key + deb.delta(1) + keyId := deb.typeId() + // Field number 2 is type Id of elem + deb.delta(1) + elemId := deb.typeId() + wire.MapT = &mapType{com, keyId, elemId} + case 4: // GobEncoder type, one field of {{Common}} + // Field number 0 is CommonType + deb.delta(1) + com := deb.common() + wire.GobEncoderT = &gobEncoderType{com} + case 5: // BinaryMarshaler type, one field of {{Common}} + // Field number 0 is CommonType + deb.delta(1) + com := deb.common() + wire.BinaryMarshalerT = &gobEncoderType{com} + case 6: // TextMarshaler type, one field of {{Common}} + // Field number 0 is CommonType + deb.delta(1) + com := deb.common() + wire.TextMarshalerT = &gobEncoderType{com} + default: + errorf("bad field in type %d", fieldNum) + } + deb.printWireType(indent, wire) + deb.delta(0) // end inner type (arrayType, etc.) + deb.delta(0) // end wireType + // Remember we've seen this type. + deb.wireType[id] = wire +} + +// Value: +// SingletonValue | StructValue +func (deb *debugger) value(indent tab, id typeId) { + wire, ok := deb.wireType[id] + if ok && wire.StructT != nil { + deb.structValue(indent, id) + } else { + deb.singletonValue(indent, id) + } +} + +// SingletonValue: +// uint(0) FieldValue +func (deb *debugger) singletonValue(indent tab, id typeId) { + deb.dump("Singleton value") + // is it a builtin type? + wire := deb.wireType[id] + _, ok := builtinIdToType[id] + if !ok && wire == nil { + errorf("type id %d not defined", id) + } + m := deb.uint64() + if m != 0 { + errorf("expected zero; got %d", m) + } + deb.fieldValue(indent, id) +} + +// InterfaceValue: +// NilInterfaceValue | NonNilInterfaceValue +func (deb *debugger) interfaceValue(indent tab) { + deb.dump("Start of interface value") + if nameLen := deb.uint64(); nameLen == 0 { + deb.nilInterfaceValue(indent) + } else { + deb.nonNilInterfaceValue(indent, int(nameLen)) + } +} + +// NilInterfaceValue: +// uint(0) [already read] +func (deb *debugger) nilInterfaceValue(indent tab) int { + fmt.Fprintf(os.Stderr, "%snil interface\n", indent) + return 0 +} + +// NonNilInterfaceValue: +// ConcreteTypeName TypeSequence InterfaceContents +// ConcreteTypeName: +// uint(lengthOfName) [already read=n] name +// InterfaceContents: +// int(concreteTypeId) DelimitedValue +// DelimitedValue: +// uint(length) Value +func (deb *debugger) nonNilInterfaceValue(indent tab, nameLen int) { + // ConcreteTypeName + b := make([]byte, nameLen) + deb.r.Read(b) // TODO: CHECK THESE READS!! + deb.consumed(nameLen) + name := string(b) + + for { + id := deb.typeId() + if id < 0 { + deb.typeDefinition(indent, -id) + n := deb.loadBlock(false) + deb.dump("Nested message of length %d", n) + } else { + // DelimitedValue + x := deb.uint64() // in case we want to ignore the value; we don't. + fmt.Fprintf(os.Stderr, "%sinterface value, type %q id=%d; valueLength %d\n", indent, name, id, x) + deb.value(indent, id) + break + } + } +} + +// printCommonType prints a common type; used by printWireType. +func (deb *debugger) printCommonType(indent tab, kind string, common *CommonType) { + indent.print() + fmt.Fprintf(os.Stderr, "%s %q id=%d\n", kind, common.Name, common.Id) +} + +// printWireType prints the contents of a wireType. +func (deb *debugger) printWireType(indent tab, wire *wireType) { + fmt.Fprintf(os.Stderr, "%stype definition {\n", indent) + indent++ + switch { + case wire.ArrayT != nil: + deb.printCommonType(indent, "array", &wire.ArrayT.CommonType) + fmt.Fprintf(os.Stderr, "%slen %d\n", indent+1, wire.ArrayT.Len) + fmt.Fprintf(os.Stderr, "%selemid %d\n", indent+1, wire.ArrayT.Elem) + case wire.MapT != nil: + deb.printCommonType(indent, "map", &wire.MapT.CommonType) + fmt.Fprintf(os.Stderr, "%skey id=%d\n", indent+1, wire.MapT.Key) + fmt.Fprintf(os.Stderr, "%selem id=%d\n", indent+1, wire.MapT.Elem) + case wire.SliceT != nil: + deb.printCommonType(indent, "slice", &wire.SliceT.CommonType) + fmt.Fprintf(os.Stderr, "%selem id=%d\n", indent+1, wire.SliceT.Elem) + case wire.StructT != nil: + deb.printCommonType(indent, "struct", &wire.StructT.CommonType) + for i, field := range wire.StructT.Field { + fmt.Fprintf(os.Stderr, "%sfield %d:\t%s\tid=%d\n", indent+1, i, field.Name, field.Id) + } + case wire.GobEncoderT != nil: + deb.printCommonType(indent, "GobEncoder", &wire.GobEncoderT.CommonType) + } + indent-- + fmt.Fprintf(os.Stderr, "%s}\n", indent) +} + +// fieldValue prints a value of any type, such as a struct field. +// FieldValue: +// builtinValue | ArrayValue | MapValue | SliceValue | StructValue | InterfaceValue +func (deb *debugger) fieldValue(indent tab, id typeId) { + _, ok := builtinIdToType[id] + if ok { + if id == tInterface { + deb.interfaceValue(indent) + } else { + deb.printBuiltin(indent, id) + } + return + } + wire, ok := deb.wireType[id] + if !ok { + errorf("type id %d not defined", id) + } + switch { + case wire.ArrayT != nil: + deb.arrayValue(indent, wire) + case wire.MapT != nil: + deb.mapValue(indent, wire) + case wire.SliceT != nil: + deb.sliceValue(indent, wire) + case wire.StructT != nil: + deb.structValue(indent, id) + case wire.GobEncoderT != nil: + deb.gobEncoderValue(indent, id) + default: + panic("bad wire type for field") + } +} + +// printBuiltin prints a value not of a fundamental type, that is, +// one whose type is known to gobs at bootstrap time. +func (deb *debugger) printBuiltin(indent tab, id typeId) { + switch id { + case tBool: + x := deb.int64() + if x == 0 { + fmt.Fprintf(os.Stderr, "%sfalse\n", indent) + } else { + fmt.Fprintf(os.Stderr, "%strue\n", indent) + } + case tInt: + x := deb.int64() + fmt.Fprintf(os.Stderr, "%s%d\n", indent, x) + case tUint: + x := deb.int64() + fmt.Fprintf(os.Stderr, "%s%d\n", indent, x) + case tFloat: + x := deb.uint64() + fmt.Fprintf(os.Stderr, "%s%g\n", indent, float64FromBits(x)) + case tComplex: + r := deb.uint64() + i := deb.uint64() + fmt.Fprintf(os.Stderr, "%s%g+%gi\n", indent, float64FromBits(r), float64FromBits(i)) + case tBytes: + x := int(deb.uint64()) + b := make([]byte, x) + deb.r.Read(b) + deb.consumed(x) + fmt.Fprintf(os.Stderr, "%s{% x}=%q\n", indent, b, b) + case tString: + x := int(deb.uint64()) + b := make([]byte, x) + deb.r.Read(b) + deb.consumed(x) + fmt.Fprintf(os.Stderr, "%s%q\n", indent, b) + default: + panic("unknown builtin") + } +} + +// ArrayValue: +// uint(n) FieldValue*n +func (deb *debugger) arrayValue(indent tab, wire *wireType) { + elemId := wire.ArrayT.Elem + u := deb.uint64() + length := int(u) + for i := 0; i < length; i++ { + deb.fieldValue(indent, elemId) + } + if length != wire.ArrayT.Len { + fmt.Fprintf(os.Stderr, "%s(wrong length for array: %d should be %d)\n", indent, length, wire.ArrayT.Len) + } +} + +// MapValue: +// uint(n) (FieldValue FieldValue)*n [n (key, value) pairs] +func (deb *debugger) mapValue(indent tab, wire *wireType) { + keyId := wire.MapT.Key + elemId := wire.MapT.Elem + u := deb.uint64() + length := int(u) + for i := 0; i < length; i++ { + deb.fieldValue(indent+1, keyId) + deb.fieldValue(indent+1, elemId) + } +} + +// SliceValue: +// uint(n) (n FieldValue) +func (deb *debugger) sliceValue(indent tab, wire *wireType) { + elemId := wire.SliceT.Elem + u := deb.uint64() + length := int(u) + deb.dump("Start of slice of length %d", length) + + for i := 0; i < length; i++ { + deb.fieldValue(indent, elemId) + } +} + +// StructValue: +// (uint(fieldDelta) FieldValue)* +func (deb *debugger) structValue(indent tab, id typeId) { + deb.dump("Start of struct value of %q id=%d\n<<\n", id.name(), id) + fmt.Fprintf(os.Stderr, "%s%s struct {\n", indent, id.name()) + wire, ok := deb.wireType[id] + if !ok { + errorf("type id %d not defined", id) + } + strct := wire.StructT + fieldNum := -1 + indent++ + for { + delta := deb.uint64() + if delta == 0 { // struct terminator is zero delta fieldnum + break + } + fieldNum += int(delta) + if fieldNum < 0 || fieldNum >= len(strct.Field) { + deb.dump("field number out of range: prevField=%d delta=%d", fieldNum-int(delta), delta) + break + } + fmt.Fprintf(os.Stderr, "%sfield %d:\t%s\n", indent, fieldNum, wire.StructT.Field[fieldNum].Name) + deb.fieldValue(indent+1, strct.Field[fieldNum].Id) + } + indent-- + fmt.Fprintf(os.Stderr, "%s} // end %s struct\n", indent, id.name()) + deb.dump(">> End of struct value of type %d %q", id, id.name()) +} + +// GobEncoderValue: +// uint(n) byte*n +func (deb *debugger) gobEncoderValue(indent tab, id typeId) { + len := deb.uint64() + deb.dump("GobEncoder value of %q id=%d, length %d\n", id.name(), id, len) + fmt.Fprintf(os.Stderr, "%s%s (implements GobEncoder)\n", indent, id.name()) + data := make([]byte, len) + _, err := deb.r.Read(data) + if err != nil { + errorf("gobEncoder data read: %s", err) + } + fmt.Fprintf(os.Stderr, "%s[% .2x]\n", indent+1, data) +} diff --git a/src/encoding/gob/dec_helpers.go b/src/encoding/gob/dec_helpers.go new file mode 100644 index 0000000000000000000000000000000000000000..a1b67661d8f5f1f959ee358a8192d0c0ef712301 --- /dev/null +++ b/src/encoding/gob/dec_helpers.go @@ -0,0 +1,468 @@ +// Created by decgen --output dec_helpers.go; DO NOT EDIT + +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package gob + +import ( + "math" + "reflect" +) + +var decArrayHelper = map[reflect.Kind]decHelper{ + reflect.Bool: decBoolArray, + reflect.Complex64: decComplex64Array, + reflect.Complex128: decComplex128Array, + reflect.Float32: decFloat32Array, + reflect.Float64: decFloat64Array, + reflect.Int: decIntArray, + reflect.Int16: decInt16Array, + reflect.Int32: decInt32Array, + reflect.Int64: decInt64Array, + reflect.Int8: decInt8Array, + reflect.String: decStringArray, + reflect.Uint: decUintArray, + reflect.Uint16: decUint16Array, + reflect.Uint32: decUint32Array, + reflect.Uint64: decUint64Array, + reflect.Uintptr: decUintptrArray, +} + +var decSliceHelper = map[reflect.Kind]decHelper{ + reflect.Bool: decBoolSlice, + reflect.Complex64: decComplex64Slice, + reflect.Complex128: decComplex128Slice, + reflect.Float32: decFloat32Slice, + reflect.Float64: decFloat64Slice, + reflect.Int: decIntSlice, + reflect.Int16: decInt16Slice, + reflect.Int32: decInt32Slice, + reflect.Int64: decInt64Slice, + reflect.Int8: decInt8Slice, + reflect.String: decStringSlice, + reflect.Uint: decUintSlice, + reflect.Uint16: decUint16Slice, + reflect.Uint32: decUint32Slice, + reflect.Uint64: decUint64Slice, + reflect.Uintptr: decUintptrSlice, +} + +func decBoolArray(state *decoderState, v reflect.Value, length int, ovfl error) bool { + // Can only slice if it is addressable. + if !v.CanAddr() { + return false + } + return decBoolSlice(state, v.Slice(0, v.Len()), length, ovfl) +} + +func decBoolSlice(state *decoderState, v reflect.Value, length int, ovfl error) bool { + slice, ok := v.Interface().([]bool) + if !ok { + // It is kind bool but not type bool. TODO: We can handle this unsafely. + return false + } + for i := 0; i < length; i++ { + if state.b.Len() == 0 { + errorf("decoding bool array or slice: length exceeds input size (%d elements)", length) + } + slice[i] = state.decodeUint() != 0 + } + return true +} + +func decComplex64Array(state *decoderState, v reflect.Value, length int, ovfl error) bool { + // Can only slice if it is addressable. + if !v.CanAddr() { + return false + } + return decComplex64Slice(state, v.Slice(0, v.Len()), length, ovfl) +} + +func decComplex64Slice(state *decoderState, v reflect.Value, length int, ovfl error) bool { + slice, ok := v.Interface().([]complex64) + if !ok { + // It is kind complex64 but not type complex64. TODO: We can handle this unsafely. + return false + } + for i := 0; i < length; i++ { + if state.b.Len() == 0 { + errorf("decoding complex64 array or slice: length exceeds input size (%d elements)", length) + } + real := float32FromBits(state.decodeUint(), ovfl) + imag := float32FromBits(state.decodeUint(), ovfl) + slice[i] = complex(float32(real), float32(imag)) + } + return true +} + +func decComplex128Array(state *decoderState, v reflect.Value, length int, ovfl error) bool { + // Can only slice if it is addressable. + if !v.CanAddr() { + return false + } + return decComplex128Slice(state, v.Slice(0, v.Len()), length, ovfl) +} + +func decComplex128Slice(state *decoderState, v reflect.Value, length int, ovfl error) bool { + slice, ok := v.Interface().([]complex128) + if !ok { + // It is kind complex128 but not type complex128. TODO: We can handle this unsafely. + return false + } + for i := 0; i < length; i++ { + if state.b.Len() == 0 { + errorf("decoding complex128 array or slice: length exceeds input size (%d elements)", length) + } + real := float64FromBits(state.decodeUint()) + imag := float64FromBits(state.decodeUint()) + slice[i] = complex(real, imag) + } + return true +} + +func decFloat32Array(state *decoderState, v reflect.Value, length int, ovfl error) bool { + // Can only slice if it is addressable. + if !v.CanAddr() { + return false + } + return decFloat32Slice(state, v.Slice(0, v.Len()), length, ovfl) +} + +func decFloat32Slice(state *decoderState, v reflect.Value, length int, ovfl error) bool { + slice, ok := v.Interface().([]float32) + if !ok { + // It is kind float32 but not type float32. TODO: We can handle this unsafely. + return false + } + for i := 0; i < length; i++ { + if state.b.Len() == 0 { + errorf("decoding float32 array or slice: length exceeds input size (%d elements)", length) + } + slice[i] = float32(float32FromBits(state.decodeUint(), ovfl)) + } + return true +} + +func decFloat64Array(state *decoderState, v reflect.Value, length int, ovfl error) bool { + // Can only slice if it is addressable. + if !v.CanAddr() { + return false + } + return decFloat64Slice(state, v.Slice(0, v.Len()), length, ovfl) +} + +func decFloat64Slice(state *decoderState, v reflect.Value, length int, ovfl error) bool { + slice, ok := v.Interface().([]float64) + if !ok { + // It is kind float64 but not type float64. TODO: We can handle this unsafely. + return false + } + for i := 0; i < length; i++ { + if state.b.Len() == 0 { + errorf("decoding float64 array or slice: length exceeds input size (%d elements)", length) + } + slice[i] = float64FromBits(state.decodeUint()) + } + return true +} + +func decIntArray(state *decoderState, v reflect.Value, length int, ovfl error) bool { + // Can only slice if it is addressable. + if !v.CanAddr() { + return false + } + return decIntSlice(state, v.Slice(0, v.Len()), length, ovfl) +} + +func decIntSlice(state *decoderState, v reflect.Value, length int, ovfl error) bool { + slice, ok := v.Interface().([]int) + if !ok { + // It is kind int but not type int. TODO: We can handle this unsafely. + return false + } + for i := 0; i < length; i++ { + if state.b.Len() == 0 { + errorf("decoding int array or slice: length exceeds input size (%d elements)", length) + } + x := state.decodeInt() + // MinInt and MaxInt + if x < ^int64(^uint(0)>>1) || int64(^uint(0)>>1) < x { + error_(ovfl) + } + slice[i] = int(x) + } + return true +} + +func decInt16Array(state *decoderState, v reflect.Value, length int, ovfl error) bool { + // Can only slice if it is addressable. + if !v.CanAddr() { + return false + } + return decInt16Slice(state, v.Slice(0, v.Len()), length, ovfl) +} + +func decInt16Slice(state *decoderState, v reflect.Value, length int, ovfl error) bool { + slice, ok := v.Interface().([]int16) + if !ok { + // It is kind int16 but not type int16. TODO: We can handle this unsafely. + return false + } + for i := 0; i < length; i++ { + if state.b.Len() == 0 { + errorf("decoding int16 array or slice: length exceeds input size (%d elements)", length) + } + x := state.decodeInt() + if x < math.MinInt16 || math.MaxInt16 < x { + error_(ovfl) + } + slice[i] = int16(x) + } + return true +} + +func decInt32Array(state *decoderState, v reflect.Value, length int, ovfl error) bool { + // Can only slice if it is addressable. + if !v.CanAddr() { + return false + } + return decInt32Slice(state, v.Slice(0, v.Len()), length, ovfl) +} + +func decInt32Slice(state *decoderState, v reflect.Value, length int, ovfl error) bool { + slice, ok := v.Interface().([]int32) + if !ok { + // It is kind int32 but not type int32. TODO: We can handle this unsafely. + return false + } + for i := 0; i < length; i++ { + if state.b.Len() == 0 { + errorf("decoding int32 array or slice: length exceeds input size (%d elements)", length) + } + x := state.decodeInt() + if x < math.MinInt32 || math.MaxInt32 < x { + error_(ovfl) + } + slice[i] = int32(x) + } + return true +} + +func decInt64Array(state *decoderState, v reflect.Value, length int, ovfl error) bool { + // Can only slice if it is addressable. + if !v.CanAddr() { + return false + } + return decInt64Slice(state, v.Slice(0, v.Len()), length, ovfl) +} + +func decInt64Slice(state *decoderState, v reflect.Value, length int, ovfl error) bool { + slice, ok := v.Interface().([]int64) + if !ok { + // It is kind int64 but not type int64. TODO: We can handle this unsafely. + return false + } + for i := 0; i < length; i++ { + if state.b.Len() == 0 { + errorf("decoding int64 array or slice: length exceeds input size (%d elements)", length) + } + slice[i] = state.decodeInt() + } + return true +} + +func decInt8Array(state *decoderState, v reflect.Value, length int, ovfl error) bool { + // Can only slice if it is addressable. + if !v.CanAddr() { + return false + } + return decInt8Slice(state, v.Slice(0, v.Len()), length, ovfl) +} + +func decInt8Slice(state *decoderState, v reflect.Value, length int, ovfl error) bool { + slice, ok := v.Interface().([]int8) + if !ok { + // It is kind int8 but not type int8. TODO: We can handle this unsafely. + return false + } + for i := 0; i < length; i++ { + if state.b.Len() == 0 { + errorf("decoding int8 array or slice: length exceeds input size (%d elements)", length) + } + x := state.decodeInt() + if x < math.MinInt8 || math.MaxInt8 < x { + error_(ovfl) + } + slice[i] = int8(x) + } + return true +} + +func decStringArray(state *decoderState, v reflect.Value, length int, ovfl error) bool { + // Can only slice if it is addressable. + if !v.CanAddr() { + return false + } + return decStringSlice(state, v.Slice(0, v.Len()), length, ovfl) +} + +func decStringSlice(state *decoderState, v reflect.Value, length int, ovfl error) bool { + slice, ok := v.Interface().([]string) + if !ok { + // It is kind string but not type string. TODO: We can handle this unsafely. + return false + } + for i := 0; i < length; i++ { + if state.b.Len() == 0 { + errorf("decoding string array or slice: length exceeds input size (%d elements)", length) + } + u := state.decodeUint() + n := int(u) + if n < 0 || uint64(n) != u || n > state.b.Len() { + errorf("length of string exceeds input size (%d bytes)", u) + } + if n > state.b.Len() { + errorf("string data too long for buffer: %d", n) + } + // Read the data. + data := make([]byte, n) + if _, err := state.b.Read(data); err != nil { + errorf("error decoding string: %s", err) + } + slice[i] = string(data) + } + return true +} + +func decUintArray(state *decoderState, v reflect.Value, length int, ovfl error) bool { + // Can only slice if it is addressable. + if !v.CanAddr() { + return false + } + return decUintSlice(state, v.Slice(0, v.Len()), length, ovfl) +} + +func decUintSlice(state *decoderState, v reflect.Value, length int, ovfl error) bool { + slice, ok := v.Interface().([]uint) + if !ok { + // It is kind uint but not type uint. TODO: We can handle this unsafely. + return false + } + for i := 0; i < length; i++ { + if state.b.Len() == 0 { + errorf("decoding uint array or slice: length exceeds input size (%d elements)", length) + } + x := state.decodeUint() + /*TODO if math.MaxUint32 < x { + error_(ovfl) + }*/ + slice[i] = uint(x) + } + return true +} + +func decUint16Array(state *decoderState, v reflect.Value, length int, ovfl error) bool { + // Can only slice if it is addressable. + if !v.CanAddr() { + return false + } + return decUint16Slice(state, v.Slice(0, v.Len()), length, ovfl) +} + +func decUint16Slice(state *decoderState, v reflect.Value, length int, ovfl error) bool { + slice, ok := v.Interface().([]uint16) + if !ok { + // It is kind uint16 but not type uint16. TODO: We can handle this unsafely. + return false + } + for i := 0; i < length; i++ { + if state.b.Len() == 0 { + errorf("decoding uint16 array or slice: length exceeds input size (%d elements)", length) + } + x := state.decodeUint() + if math.MaxUint16 < x { + error_(ovfl) + } + slice[i] = uint16(x) + } + return true +} + +func decUint32Array(state *decoderState, v reflect.Value, length int, ovfl error) bool { + // Can only slice if it is addressable. + if !v.CanAddr() { + return false + } + return decUint32Slice(state, v.Slice(0, v.Len()), length, ovfl) +} + +func decUint32Slice(state *decoderState, v reflect.Value, length int, ovfl error) bool { + slice, ok := v.Interface().([]uint32) + if !ok { + // It is kind uint32 but not type uint32. TODO: We can handle this unsafely. + return false + } + for i := 0; i < length; i++ { + if state.b.Len() == 0 { + errorf("decoding uint32 array or slice: length exceeds input size (%d elements)", length) + } + x := state.decodeUint() + if math.MaxUint32 < x { + error_(ovfl) + } + slice[i] = uint32(x) + } + return true +} + +func decUint64Array(state *decoderState, v reflect.Value, length int, ovfl error) bool { + // Can only slice if it is addressable. + if !v.CanAddr() { + return false + } + return decUint64Slice(state, v.Slice(0, v.Len()), length, ovfl) +} + +func decUint64Slice(state *decoderState, v reflect.Value, length int, ovfl error) bool { + slice, ok := v.Interface().([]uint64) + if !ok { + // It is kind uint64 but not type uint64. TODO: We can handle this unsafely. + return false + } + for i := 0; i < length; i++ { + if state.b.Len() == 0 { + errorf("decoding uint64 array or slice: length exceeds input size (%d elements)", length) + } + slice[i] = state.decodeUint() + } + return true +} + +func decUintptrArray(state *decoderState, v reflect.Value, length int, ovfl error) bool { + // Can only slice if it is addressable. + if !v.CanAddr() { + return false + } + return decUintptrSlice(state, v.Slice(0, v.Len()), length, ovfl) +} + +func decUintptrSlice(state *decoderState, v reflect.Value, length int, ovfl error) bool { + slice, ok := v.Interface().([]uintptr) + if !ok { + // It is kind uintptr but not type uintptr. TODO: We can handle this unsafely. + return false + } + for i := 0; i < length; i++ { + if state.b.Len() == 0 { + errorf("decoding uintptr array or slice: length exceeds input size (%d elements)", length) + } + x := state.decodeUint() + if uint64(^uintptr(0)) < x { + error_(ovfl) + } + slice[i] = uintptr(x) + } + return true +} diff --git a/src/encoding/gob/decgen.go b/src/encoding/gob/decgen.go new file mode 100644 index 0000000000000000000000000000000000000000..da41a899ed01ca8d57f7827648b0ae376719f20b --- /dev/null +++ b/src/encoding/gob/decgen.go @@ -0,0 +1,240 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build ignore + +// encgen writes the helper functions for encoding. Intended to be +// used with go generate; see the invocation in encode.go. + +// TODO: We could do more by being unsafe. Add a -unsafe flag? + +package main + +import ( + "bytes" + "flag" + "fmt" + "go/format" + "log" + "os" +) + +var output = flag.String("output", "dec_helpers.go", "file name to write") + +type Type struct { + lower string + upper string + decoder string +} + +var types = []Type{ + { + "bool", + "Bool", + `slice[i] = state.decodeUint() != 0`, + }, + { + "complex64", + "Complex64", + `real := float32FromBits(state.decodeUint(), ovfl) + imag := float32FromBits(state.decodeUint(), ovfl) + slice[i] = complex(float32(real), float32(imag))`, + }, + { + "complex128", + "Complex128", + `real := float64FromBits(state.decodeUint()) + imag := float64FromBits(state.decodeUint()) + slice[i] = complex(real, imag)`, + }, + { + "float32", + "Float32", + `slice[i] = float32(float32FromBits(state.decodeUint(), ovfl))`, + }, + { + "float64", + "Float64", + `slice[i] = float64FromBits(state.decodeUint())`, + }, + { + "int", + "Int", + `x := state.decodeInt() + // MinInt and MaxInt + if x < ^int64(^uint(0)>>1) || int64(^uint(0)>>1) < x { + error_(ovfl) + } + slice[i] = int(x)`, + }, + { + "int16", + "Int16", + `x := state.decodeInt() + if x < math.MinInt16 || math.MaxInt16 < x { + error_(ovfl) + } + slice[i] = int16(x)`, + }, + { + "int32", + "Int32", + `x := state.decodeInt() + if x < math.MinInt32 || math.MaxInt32 < x { + error_(ovfl) + } + slice[i] = int32(x)`, + }, + { + "int64", + "Int64", + `slice[i] = state.decodeInt()`, + }, + { + "int8", + "Int8", + `x := state.decodeInt() + if x < math.MinInt8 || math.MaxInt8 < x { + error_(ovfl) + } + slice[i] = int8(x)`, + }, + { + "string", + "String", + `u := state.decodeUint() + n := int(u) + if n < 0 || uint64(n) != u || n > state.b.Len() { + errorf("length of string exceeds input size (%d bytes)", u) + } + if n > state.b.Len() { + errorf("string data too long for buffer: %d", n) + } + // Read the data. + data := make([]byte, n) + if _, err := state.b.Read(data); err != nil { + errorf("error decoding string: %s", err) + } + slice[i] = string(data)`, + }, + { + "uint", + "Uint", + `x := state.decodeUint() + /*TODO if math.MaxUint32 < x { + error_(ovfl) + }*/ + slice[i] = uint(x)`, + }, + { + "uint16", + "Uint16", + `x := state.decodeUint() + if math.MaxUint16 < x { + error_(ovfl) + } + slice[i] = uint16(x)`, + }, + { + "uint32", + "Uint32", + `x := state.decodeUint() + if math.MaxUint32 < x { + error_(ovfl) + } + slice[i] = uint32(x)`, + }, + { + "uint64", + "Uint64", + `slice[i] = state.decodeUint()`, + }, + { + "uintptr", + "Uintptr", + `x := state.decodeUint() + if uint64(^uintptr(0)) < x { + error_(ovfl) + } + slice[i] = uintptr(x)`, + }, + // uint8 Handled separately. +} + +func main() { + log.SetFlags(0) + log.SetPrefix("decgen: ") + flag.Parse() + if flag.NArg() != 0 { + log.Fatal("usage: decgen [--output filename]") + } + var b bytes.Buffer + fmt.Fprintf(&b, "// Created by decgen --output %s; DO NOT EDIT\n", *output) + fmt.Fprint(&b, header) + printMaps(&b, "Array") + fmt.Fprint(&b, "\n") + printMaps(&b, "Slice") + for _, t := range types { + fmt.Fprintf(&b, arrayHelper, t.lower, t.upper) + fmt.Fprintf(&b, sliceHelper, t.lower, t.upper, t.decoder) + } + source, err := format.Source(b.Bytes()) + if err != nil { + log.Fatal("source format error:", err) + } + fd, err := os.Create(*output) + _, err = fd.Write(source) + if err != nil { + log.Fatal(err) + } +} + +func printMaps(b *bytes.Buffer, upperClass string) { + fmt.Fprintf(b, "var dec%sHelper = map[reflect.Kind]decHelper{\n", upperClass) + for _, t := range types { + fmt.Fprintf(b, "reflect.%s: dec%s%s,\n", t.upper, t.upper, upperClass) + } + fmt.Fprintf(b, "}\n") +} + +const header = ` +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package gob + +import ( + "math" + "reflect" +) + +` + +const arrayHelper = ` +func dec%[2]sArray(state *decoderState, v reflect.Value, length int, ovfl error) bool { + // Can only slice if it is addressable. + if !v.CanAddr() { + return false + } + return dec%[2]sSlice(state, v.Slice(0, v.Len()), length, ovfl) +} +` + +const sliceHelper = ` +func dec%[2]sSlice(state *decoderState, v reflect.Value, length int, ovfl error) bool { + slice, ok := v.Interface().([]%[1]s) + if !ok { + // It is kind %[1]s but not type %[1]s. TODO: We can handle this unsafely. + return false + } + for i := 0; i < length; i++ { + if state.b.Len() == 0 { + errorf("decoding %[1]s array or slice: length exceeds input size (%%d elements)", length) + } + %[3]s + } + return true +} +` diff --git a/src/encoding/gob/decode.go b/src/encoding/gob/decode.go new file mode 100644 index 0000000000000000000000000000000000000000..e913f15c545a240cc0760cd681fcc10af9664653 --- /dev/null +++ b/src/encoding/gob/decode.go @@ -0,0 +1,1248 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:generate go run decgen.go -output dec_helpers.go + +package gob + +import ( + "encoding" + "errors" + "io" + "math" + "reflect" +) + +var ( + errBadUint = errors.New("gob: encoded unsigned integer out of range") + errBadType = errors.New("gob: unknown type id or corrupted data") + errRange = errors.New("gob: bad data: field numbers out of bounds") +) + +type decHelper func(state *decoderState, v reflect.Value, length int, ovfl error) bool + +// decoderState is the execution state of an instance of the decoder. A new state +// is created for nested objects. +type decoderState struct { + dec *Decoder + // The buffer is stored with an extra indirection because it may be replaced + // if we load a type during decode (when reading an interface value). + b *decBuffer + fieldnum int // the last field number read. + buf []byte + next *decoderState // for free list +} + +// decBuffer is an extremely simple, fast implementation of a read-only byte buffer. +// It is initialized by calling Size and then copying the data into the slice returned by Bytes(). +type decBuffer struct { + data []byte + offset int // Read offset. +} + +func (d *decBuffer) Read(p []byte) (int, error) { + n := copy(p, d.data[d.offset:]) + if n == 0 && len(p) != 0 { + return 0, io.EOF + } + d.offset += n + return n, nil +} + +func (d *decBuffer) Drop(n int) { + if n > d.Len() { + panic("drop") + } + d.offset += n +} + +// Size grows the buffer to exactly n bytes, so d.Bytes() will +// return a slice of length n. Existing data is first discarded. +func (d *decBuffer) Size(n int) { + d.Reset() + if cap(d.data) < n { + d.data = make([]byte, n) + } else { + d.data = d.data[0:n] + } +} + +func (d *decBuffer) ReadByte() (byte, error) { + if d.offset >= len(d.data) { + return 0, io.EOF + } + c := d.data[d.offset] + d.offset++ + return c, nil +} + +func (d *decBuffer) Len() int { + return len(d.data) - d.offset +} + +func (d *decBuffer) Bytes() []byte { + return d.data[d.offset:] +} + +func (d *decBuffer) Reset() { + d.data = d.data[0:0] + d.offset = 0 +} + +// We pass the bytes.Buffer separately for easier testing of the infrastructure +// without requiring a full Decoder. +func (dec *Decoder) newDecoderState(buf *decBuffer) *decoderState { + d := dec.freeList + if d == nil { + d = new(decoderState) + d.dec = dec + d.buf = make([]byte, uint64Size) + } else { + dec.freeList = d.next + } + d.b = buf + return d +} + +func (dec *Decoder) freeDecoderState(d *decoderState) { + d.next = dec.freeList + dec.freeList = d +} + +func overflow(name string) error { + return errors.New(`value for "` + name + `" out of range`) +} + +// decodeUintReader reads an encoded unsigned integer from an io.Reader. +// Used only by the Decoder to read the message length. +func decodeUintReader(r io.Reader, buf []byte) (x uint64, width int, err error) { + width = 1 + n, err := io.ReadFull(r, buf[0:width]) + if n == 0 { + return + } + b := buf[0] + if b <= 0x7f { + return uint64(b), width, nil + } + n = -int(int8(b)) + if n > uint64Size { + err = errBadUint + return + } + width, err = io.ReadFull(r, buf[0:n]) + if err != nil { + if err == io.EOF { + err = io.ErrUnexpectedEOF + } + return + } + // Could check that the high byte is zero but it's not worth it. + for _, b := range buf[0:width] { + x = x<<8 | uint64(b) + } + width++ // +1 for length byte + return +} + +// decodeUint reads an encoded unsigned integer from state.r. +// Does not check for overflow. +func (state *decoderState) decodeUint() (x uint64) { + b, err := state.b.ReadByte() + if err != nil { + error_(err) + } + if b <= 0x7f { + return uint64(b) + } + n := -int(int8(b)) + if n > uint64Size { + error_(errBadUint) + } + width, err := state.b.Read(state.buf[0:n]) + if err != nil { + error_(err) + } + // Don't need to check error; it's safe to loop regardless. + // Could check that the high byte is zero but it's not worth it. + for _, b := range state.buf[0:width] { + x = x<<8 | uint64(b) + } + return x +} + +// decodeInt reads an encoded signed integer from state.r. +// Does not check for overflow. +func (state *decoderState) decodeInt() int64 { + x := state.decodeUint() + if x&1 != 0 { + return ^int64(x >> 1) + } + return int64(x >> 1) +} + +// getLength decodes the next uint and makes sure it is a possible +// size for a data item that follows, which means it must fit in a +// non-negative int and fit in the buffer. +func (state *decoderState) getLength() (int, bool) { + n := int(state.decodeUint()) + if n < 0 || state.b.Len() < n || tooBig <= n { + return 0, false + } + return n, true +} + +// decOp is the signature of a decoding operator for a given type. +type decOp func(i *decInstr, state *decoderState, v reflect.Value) + +// The 'instructions' of the decoding machine +type decInstr struct { + op decOp + field int // field number of the wire type + index []int // field access indices for destination type + ovfl error // error message for overflow/underflow (for arrays, of the elements) +} + +// ignoreUint discards a uint value with no destination. +func ignoreUint(i *decInstr, state *decoderState, v reflect.Value) { + state.decodeUint() +} + +// ignoreTwoUints discards a uint value with no destination. It's used to skip +// complex values. +func ignoreTwoUints(i *decInstr, state *decoderState, v reflect.Value) { + state.decodeUint() + state.decodeUint() +} + +// Since the encoder writes no zeros, if we arrive at a decoder we have +// a value to extract and store. The field number has already been read +// (it's how we knew to call this decoder). +// Each decoder is responsible for handling any indirections associated +// with the data structure. If any pointer so reached is nil, allocation must +// be done. + +// decAlloc takes a value and returns a settable value that can +// be assigned to. If the value is a pointer, decAlloc guarantees it points to storage. +// The callers to the individual decoders are expected to have used decAlloc. +// The individual decoders don't need to it. +func decAlloc(v reflect.Value) reflect.Value { + for v.Kind() == reflect.Ptr { + if v.IsNil() { + v.Set(reflect.New(v.Type().Elem())) + } + v = v.Elem() + } + return v +} + +// decBool decodes a uint and stores it as a boolean in value. +func decBool(i *decInstr, state *decoderState, value reflect.Value) { + value.SetBool(state.decodeUint() != 0) +} + +// decInt8 decodes an integer and stores it as an int8 in value. +func decInt8(i *decInstr, state *decoderState, value reflect.Value) { + v := state.decodeInt() + if v < math.MinInt8 || math.MaxInt8 < v { + error_(i.ovfl) + } + value.SetInt(v) +} + +// decUint8 decodes an unsigned integer and stores it as a uint8 in value. +func decUint8(i *decInstr, state *decoderState, value reflect.Value) { + v := state.decodeUint() + if math.MaxUint8 < v { + error_(i.ovfl) + } + value.SetUint(v) +} + +// decInt16 decodes an integer and stores it as an int16 in value. +func decInt16(i *decInstr, state *decoderState, value reflect.Value) { + v := state.decodeInt() + if v < math.MinInt16 || math.MaxInt16 < v { + error_(i.ovfl) + } + value.SetInt(v) +} + +// decUint16 decodes an unsigned integer and stores it as a uint16 in value. +func decUint16(i *decInstr, state *decoderState, value reflect.Value) { + v := state.decodeUint() + if math.MaxUint16 < v { + error_(i.ovfl) + } + value.SetUint(v) +} + +// decInt32 decodes an integer and stores it as an int32 in value. +func decInt32(i *decInstr, state *decoderState, value reflect.Value) { + v := state.decodeInt() + if v < math.MinInt32 || math.MaxInt32 < v { + error_(i.ovfl) + } + value.SetInt(v) +} + +// decUint32 decodes an unsigned integer and stores it as a uint32 in value. +func decUint32(i *decInstr, state *decoderState, value reflect.Value) { + v := state.decodeUint() + if math.MaxUint32 < v { + error_(i.ovfl) + } + value.SetUint(v) +} + +// decInt64 decodes an integer and stores it as an int64 in value. +func decInt64(i *decInstr, state *decoderState, value reflect.Value) { + v := state.decodeInt() + value.SetInt(v) +} + +// decUint64 decodes an unsigned integer and stores it as a uint64 in value. +func decUint64(i *decInstr, state *decoderState, value reflect.Value) { + v := state.decodeUint() + value.SetUint(v) +} + +// Floating-point numbers are transmitted as uint64s holding the bits +// of the underlying representation. They are sent byte-reversed, with +// the exponent end coming out first, so integer floating point numbers +// (for example) transmit more compactly. This routine does the +// unswizzling. +func float64FromBits(u uint64) float64 { + var v uint64 + for i := 0; i < 8; i++ { + v <<= 8 + v |= u & 0xFF + u >>= 8 + } + return math.Float64frombits(v) +} + +// float32FromBits decodes an unsigned integer, treats it as a 32-bit floating-point +// number, and returns it. It's a helper function for float32 and complex64. +// It returns a float64 because that's what reflection needs, but its return +// value is known to be accurately representable in a float32. +func float32FromBits(u uint64, ovfl error) float64 { + v := float64FromBits(u) + av := v + if av < 0 { + av = -av + } + // +Inf is OK in both 32- and 64-bit floats. Underflow is always OK. + if math.MaxFloat32 < av && av <= math.MaxFloat64 { + error_(ovfl) + } + return v +} + +// decFloat32 decodes an unsigned integer, treats it as a 32-bit floating-point +// number, and stores it in value. +func decFloat32(i *decInstr, state *decoderState, value reflect.Value) { + value.SetFloat(float32FromBits(state.decodeUint(), i.ovfl)) +} + +// decFloat64 decodes an unsigned integer, treats it as a 64-bit floating-point +// number, and stores it in value. +func decFloat64(i *decInstr, state *decoderState, value reflect.Value) { + value.SetFloat(float64FromBits(state.decodeUint())) +} + +// decComplex64 decodes a pair of unsigned integers, treats them as a +// pair of floating point numbers, and stores them as a complex64 in value. +// The real part comes first. +func decComplex64(i *decInstr, state *decoderState, value reflect.Value) { + real := float32FromBits(state.decodeUint(), i.ovfl) + imag := float32FromBits(state.decodeUint(), i.ovfl) + value.SetComplex(complex(real, imag)) +} + +// decComplex128 decodes a pair of unsigned integers, treats them as a +// pair of floating point numbers, and stores them as a complex128 in value. +// The real part comes first. +func decComplex128(i *decInstr, state *decoderState, value reflect.Value) { + real := float64FromBits(state.decodeUint()) + imag := float64FromBits(state.decodeUint()) + value.SetComplex(complex(real, imag)) +} + +// decUint8Slice decodes a byte slice and stores in value a slice header +// describing the data. +// uint8 slices are encoded as an unsigned count followed by the raw bytes. +func decUint8Slice(i *decInstr, state *decoderState, value reflect.Value) { + n, ok := state.getLength() + if !ok { + errorf("bad %s slice length: %d", value.Type(), n) + } + if value.Cap() < n { + value.Set(reflect.MakeSlice(value.Type(), n, n)) + } else { + value.Set(value.Slice(0, n)) + } + if _, err := state.b.Read(value.Bytes()); err != nil { + errorf("error decoding []byte: %s", err) + } +} + +// decString decodes byte array and stores in value a string header +// describing the data. +// Strings are encoded as an unsigned count followed by the raw bytes. +func decString(i *decInstr, state *decoderState, value reflect.Value) { + n, ok := state.getLength() + if !ok { + errorf("bad %s slice length: %d", value.Type(), n) + } + // Read the data. + data := make([]byte, n) + if _, err := state.b.Read(data); err != nil { + errorf("error decoding string: %s", err) + } + value.SetString(string(data)) +} + +// ignoreUint8Array skips over the data for a byte slice value with no destination. +func ignoreUint8Array(i *decInstr, state *decoderState, value reflect.Value) { + n, ok := state.getLength() + if !ok { + errorf("slice length too large") + } + b := make([]byte, n) + state.b.Read(b) +} + +// Execution engine + +// The encoder engine is an array of instructions indexed by field number of the incoming +// decoder. It is executed with random access according to field number. +type decEngine struct { + instr []decInstr + numInstr int // the number of active instructions +} + +// decodeSingle decodes a top-level value that is not a struct and stores it in value. +// Such values are preceded by a zero, making them have the memory layout of a +// struct field (although with an illegal field number). +func (dec *Decoder) decodeSingle(engine *decEngine, ut *userTypeInfo, value reflect.Value) { + state := dec.newDecoderState(&dec.buf) + defer dec.freeDecoderState(state) + state.fieldnum = singletonField + if state.decodeUint() != 0 { + errorf("decode: corrupted data: non-zero delta for singleton") + } + instr := &engine.instr[singletonField] + instr.op(instr, state, value) +} + +// decodeStruct decodes a top-level struct and stores it in value. +// Indir is for the value, not the type. At the time of the call it may +// differ from ut.indir, which was computed when the engine was built. +// This state cannot arise for decodeSingle, which is called directly +// from the user's value, not from the innards of an engine. +func (dec *Decoder) decodeStruct(engine *decEngine, ut *userTypeInfo, value reflect.Value) { + state := dec.newDecoderState(&dec.buf) + defer dec.freeDecoderState(state) + state.fieldnum = -1 + for state.b.Len() > 0 { + delta := int(state.decodeUint()) + if delta < 0 { + errorf("decode: corrupted data: negative delta") + } + if delta == 0 { // struct terminator is zero delta fieldnum + break + } + fieldnum := state.fieldnum + delta + if fieldnum >= len(engine.instr) { + error_(errRange) + break + } + instr := &engine.instr[fieldnum] + var field reflect.Value + if instr.index != nil { + // Otherwise the field is unknown to us and instr.op is an ignore op. + field = value.FieldByIndex(instr.index) + if field.Kind() == reflect.Ptr { + field = decAlloc(field) + } + } + instr.op(instr, state, field) + state.fieldnum = fieldnum + } +} + +var noValue reflect.Value + +// ignoreStruct discards the data for a struct with no destination. +func (dec *Decoder) ignoreStruct(engine *decEngine) { + state := dec.newDecoderState(&dec.buf) + defer dec.freeDecoderState(state) + state.fieldnum = -1 + for state.b.Len() > 0 { + delta := int(state.decodeUint()) + if delta < 0 { + errorf("ignore decode: corrupted data: negative delta") + } + if delta == 0 { // struct terminator is zero delta fieldnum + break + } + fieldnum := state.fieldnum + delta + if fieldnum >= len(engine.instr) { + error_(errRange) + } + instr := &engine.instr[fieldnum] + instr.op(instr, state, noValue) + state.fieldnum = fieldnum + } +} + +// ignoreSingle discards the data for a top-level non-struct value with no +// destination. It's used when calling Decode with a nil value. +func (dec *Decoder) ignoreSingle(engine *decEngine) { + state := dec.newDecoderState(&dec.buf) + defer dec.freeDecoderState(state) + state.fieldnum = singletonField + delta := int(state.decodeUint()) + if delta != 0 { + errorf("decode: corrupted data: non-zero delta for singleton") + } + instr := &engine.instr[singletonField] + instr.op(instr, state, noValue) +} + +// decodeArrayHelper does the work for decoding arrays and slices. +func (dec *Decoder) decodeArrayHelper(state *decoderState, value reflect.Value, elemOp decOp, length int, ovfl error, helper decHelper) { + if helper != nil && helper(state, value, length, ovfl) { + return + } + instr := &decInstr{elemOp, 0, nil, ovfl} + isPtr := value.Type().Elem().Kind() == reflect.Ptr + for i := 0; i < length; i++ { + if state.b.Len() == 0 { + errorf("decoding array or slice: length exceeds input size (%d elements)", length) + } + v := value.Index(i) + if isPtr { + v = decAlloc(v) + } + elemOp(instr, state, v) + } +} + +// decodeArray decodes an array and stores it in value. +// The length is an unsigned integer preceding the elements. Even though the length is redundant +// (it's part of the type), it's a useful check and is included in the encoding. +func (dec *Decoder) decodeArray(atyp reflect.Type, state *decoderState, value reflect.Value, elemOp decOp, length int, ovfl error, helper decHelper) { + if n := state.decodeUint(); n != uint64(length) { + errorf("length mismatch in decodeArray") + } + dec.decodeArrayHelper(state, value, elemOp, length, ovfl, helper) +} + +// decodeIntoValue is a helper for map decoding. +func decodeIntoValue(state *decoderState, op decOp, isPtr bool, value reflect.Value, ovfl error) reflect.Value { + instr := &decInstr{op, 0, nil, ovfl} + v := value + if isPtr { + v = decAlloc(value) + } + op(instr, state, v) + return value +} + +// decodeMap decodes a map and stores it in value. +// Maps are encoded as a length followed by key:value pairs. +// Because the internals of maps are not visible to us, we must +// use reflection rather than pointer magic. +func (dec *Decoder) decodeMap(mtyp reflect.Type, state *decoderState, value reflect.Value, keyOp, elemOp decOp, ovfl error) { + if value.IsNil() { + // Allocate map. + value.Set(reflect.MakeMap(mtyp)) + } + n := int(state.decodeUint()) + keyIsPtr := mtyp.Key().Kind() == reflect.Ptr + elemIsPtr := mtyp.Elem().Kind() == reflect.Ptr + for i := 0; i < n; i++ { + key := decodeIntoValue(state, keyOp, keyIsPtr, allocValue(mtyp.Key()), ovfl) + elem := decodeIntoValue(state, elemOp, elemIsPtr, allocValue(mtyp.Elem()), ovfl) + value.SetMapIndex(key, elem) + } +} + +// ignoreArrayHelper does the work for discarding arrays and slices. +func (dec *Decoder) ignoreArrayHelper(state *decoderState, elemOp decOp, length int) { + instr := &decInstr{elemOp, 0, nil, errors.New("no error")} + for i := 0; i < length; i++ { + if state.b.Len() == 0 { + errorf("decoding array or slice: length exceeds input size (%d elements)", length) + } + elemOp(instr, state, noValue) + } +} + +// ignoreArray discards the data for an array value with no destination. +func (dec *Decoder) ignoreArray(state *decoderState, elemOp decOp, length int) { + if n := state.decodeUint(); n != uint64(length) { + errorf("length mismatch in ignoreArray") + } + dec.ignoreArrayHelper(state, elemOp, length) +} + +// ignoreMap discards the data for a map value with no destination. +func (dec *Decoder) ignoreMap(state *decoderState, keyOp, elemOp decOp) { + n := int(state.decodeUint()) + keyInstr := &decInstr{keyOp, 0, nil, errors.New("no error")} + elemInstr := &decInstr{elemOp, 0, nil, errors.New("no error")} + for i := 0; i < n; i++ { + keyOp(keyInstr, state, noValue) + elemOp(elemInstr, state, noValue) + } +} + +// decodeSlice decodes a slice and stores it in value. +// Slices are encoded as an unsigned length followed by the elements. +func (dec *Decoder) decodeSlice(state *decoderState, value reflect.Value, elemOp decOp, ovfl error, helper decHelper) { + u := state.decodeUint() + typ := value.Type() + size := uint64(typ.Elem().Size()) + nBytes := u * size + n := int(u) + // Take care with overflow in this calculation. + if n < 0 || uint64(n) != u || nBytes > tooBig || (size > 0 && nBytes/size != u) { + // We don't check n against buffer length here because if it's a slice + // of interfaces, there will be buffer reloads. + errorf("%s slice too big: %d elements of %d bytes", typ.Elem(), u, size) + } + if value.Cap() < n { + value.Set(reflect.MakeSlice(typ, n, n)) + } else { + value.Set(value.Slice(0, n)) + } + dec.decodeArrayHelper(state, value, elemOp, n, ovfl, helper) +} + +// ignoreSlice skips over the data for a slice value with no destination. +func (dec *Decoder) ignoreSlice(state *decoderState, elemOp decOp) { + dec.ignoreArrayHelper(state, elemOp, int(state.decodeUint())) +} + +// decodeInterface decodes an interface value and stores it in value. +// Interfaces are encoded as the name of a concrete type followed by a value. +// If the name is empty, the value is nil and no value is sent. +func (dec *Decoder) decodeInterface(ityp reflect.Type, state *decoderState, value reflect.Value) { + // Read the name of the concrete type. + nr := state.decodeUint() + if nr < 0 || nr > 1<<31 { // zero is permissible for anonymous types + errorf("invalid type name length %d", nr) + } + if nr > uint64(state.b.Len()) { + errorf("invalid type name length %d: exceeds input size", nr) + } + b := make([]byte, nr) + state.b.Read(b) + name := string(b) + // Allocate the destination interface value. + if name == "" { + // Copy the nil interface value to the target. + value.Set(reflect.Zero(value.Type())) + return + } + if len(name) > 1024 { + errorf("name too long (%d bytes): %.20q...", len(name), name) + } + // The concrete type must be registered. + registerLock.RLock() + typ, ok := nameToConcreteType[name] + registerLock.RUnlock() + if !ok { + errorf("name not registered for interface: %q", name) + } + // Read the type id of the concrete value. + concreteId := dec.decodeTypeSequence(true) + if concreteId < 0 { + error_(dec.err) + } + // Byte count of value is next; we don't care what it is (it's there + // in case we want to ignore the value by skipping it completely). + state.decodeUint() + // Read the concrete value. + v := allocValue(typ) + dec.decodeValue(concreteId, v) + if dec.err != nil { + error_(dec.err) + } + // Assign the concrete value to the interface. + // Tread carefully; it might not satisfy the interface. + if !typ.AssignableTo(ityp) { + errorf("%s is not assignable to type %s", typ, ityp) + } + // Copy the interface value to the target. + value.Set(v) +} + +// ignoreInterface discards the data for an interface value with no destination. +func (dec *Decoder) ignoreInterface(state *decoderState) { + // Read the name of the concrete type. + n, ok := state.getLength() + if !ok { + errorf("bad interface encoding: name too large for buffer") + } + b := make([]byte, n) + _, err := state.b.Read(b) + if err != nil { + error_(err) + } + id := dec.decodeTypeSequence(true) + if id < 0 { + error_(dec.err) + } + // At this point, the decoder buffer contains a delimited value. Just toss it. + n, ok = state.getLength() + if !ok { + errorf("bad interface encoding: data length too large for buffer") + } + state.b.Drop(n) +} + +// decodeGobDecoder decodes something implementing the GobDecoder interface. +// The data is encoded as a byte slice. +func (dec *Decoder) decodeGobDecoder(ut *userTypeInfo, state *decoderState, value reflect.Value) { + // Read the bytes for the value. + n, ok := state.getLength() + if !ok { + errorf("GobDecoder: length too large for buffer") + } + b := make([]byte, n) + _, err := state.b.Read(b) + if err != nil { + error_(err) + } + // We know it's one of these. + switch ut.externalDec { + case xGob: + err = value.Interface().(GobDecoder).GobDecode(b) + case xBinary: + err = value.Interface().(encoding.BinaryUnmarshaler).UnmarshalBinary(b) + case xText: + err = value.Interface().(encoding.TextUnmarshaler).UnmarshalText(b) + } + if err != nil { + error_(err) + } +} + +// ignoreGobDecoder discards the data for a GobDecoder value with no destination. +func (dec *Decoder) ignoreGobDecoder(state *decoderState) { + // Read the bytes for the value. + n, ok := state.getLength() + if !ok { + errorf("GobDecoder: length too large for buffer") + } + b := make([]byte, n) + _, err := state.b.Read(b) + if err != nil { + error_(err) + } +} + +// Index by Go types. +var decOpTable = [...]decOp{ + reflect.Bool: decBool, + reflect.Int8: decInt8, + reflect.Int16: decInt16, + reflect.Int32: decInt32, + reflect.Int64: decInt64, + reflect.Uint8: decUint8, + reflect.Uint16: decUint16, + reflect.Uint32: decUint32, + reflect.Uint64: decUint64, + reflect.Float32: decFloat32, + reflect.Float64: decFloat64, + reflect.Complex64: decComplex64, + reflect.Complex128: decComplex128, + reflect.String: decString, +} + +// Indexed by gob types. tComplex will be added during type.init(). +var decIgnoreOpMap = map[typeId]decOp{ + tBool: ignoreUint, + tInt: ignoreUint, + tUint: ignoreUint, + tFloat: ignoreUint, + tBytes: ignoreUint8Array, + tString: ignoreUint8Array, + tComplex: ignoreTwoUints, +} + +// decOpFor returns the decoding op for the base type under rt and +// the indirection count to reach it. +func (dec *Decoder) decOpFor(wireId typeId, rt reflect.Type, name string, inProgress map[reflect.Type]*decOp) *decOp { + ut := userType(rt) + // If the type implements GobEncoder, we handle it without further processing. + if ut.externalDec != 0 { + return dec.gobDecodeOpFor(ut) + } + + // If this type is already in progress, it's a recursive type (e.g. map[string]*T). + // Return the pointer to the op we're already building. + if opPtr := inProgress[rt]; opPtr != nil { + return opPtr + } + typ := ut.base + var op decOp + k := typ.Kind() + if int(k) < len(decOpTable) { + op = decOpTable[k] + } + if op == nil { + inProgress[rt] = &op + // Special cases + switch t := typ; t.Kind() { + case reflect.Array: + name = "element of " + name + elemId := dec.wireType[wireId].ArrayT.Elem + elemOp := dec.decOpFor(elemId, t.Elem(), name, inProgress) + ovfl := overflow(name) + helper := decArrayHelper[t.Elem().Kind()] + op = func(i *decInstr, state *decoderState, value reflect.Value) { + state.dec.decodeArray(t, state, value, *elemOp, t.Len(), ovfl, helper) + } + + case reflect.Map: + keyId := dec.wireType[wireId].MapT.Key + elemId := dec.wireType[wireId].MapT.Elem + keyOp := dec.decOpFor(keyId, t.Key(), "key of "+name, inProgress) + elemOp := dec.decOpFor(elemId, t.Elem(), "element of "+name, inProgress) + ovfl := overflow(name) + op = func(i *decInstr, state *decoderState, value reflect.Value) { + state.dec.decodeMap(t, state, value, *keyOp, *elemOp, ovfl) + } + + case reflect.Slice: + name = "element of " + name + if t.Elem().Kind() == reflect.Uint8 { + op = decUint8Slice + break + } + var elemId typeId + if tt, ok := builtinIdToType[wireId]; ok { + elemId = tt.(*sliceType).Elem + } else { + elemId = dec.wireType[wireId].SliceT.Elem + } + elemOp := dec.decOpFor(elemId, t.Elem(), name, inProgress) + ovfl := overflow(name) + helper := decSliceHelper[t.Elem().Kind()] + op = func(i *decInstr, state *decoderState, value reflect.Value) { + state.dec.decodeSlice(state, value, *elemOp, ovfl, helper) + } + + case reflect.Struct: + // Generate a closure that calls out to the engine for the nested type. + ut := userType(typ) + enginePtr, err := dec.getDecEnginePtr(wireId, ut) + if err != nil { + error_(err) + } + op = func(i *decInstr, state *decoderState, value reflect.Value) { + // indirect through enginePtr to delay evaluation for recursive structs. + dec.decodeStruct(*enginePtr, ut, value) + } + case reflect.Interface: + op = func(i *decInstr, state *decoderState, value reflect.Value) { + state.dec.decodeInterface(t, state, value) + } + } + } + if op == nil { + errorf("decode can't handle type %s", rt) + } + return &op +} + +// decIgnoreOpFor returns the decoding op for a field that has no destination. +func (dec *Decoder) decIgnoreOpFor(wireId typeId, inProgress map[typeId]*decOp) *decOp { + // If this type is already in progress, it's a recursive type (e.g. map[string]*T). + // Return the pointer to the op we're already building. + if opPtr := inProgress[wireId]; opPtr != nil { + return opPtr + } + op, ok := decIgnoreOpMap[wireId] + if !ok { + inProgress[wireId] = &op + if wireId == tInterface { + // Special case because it's a method: the ignored item might + // define types and we need to record their state in the decoder. + op = func(i *decInstr, state *decoderState, value reflect.Value) { + state.dec.ignoreInterface(state) + } + return &op + } + // Special cases + wire := dec.wireType[wireId] + switch { + case wire == nil: + errorf("bad data: undefined type %s", wireId.string()) + case wire.ArrayT != nil: + elemId := wire.ArrayT.Elem + elemOp := dec.decIgnoreOpFor(elemId, inProgress) + op = func(i *decInstr, state *decoderState, value reflect.Value) { + state.dec.ignoreArray(state, *elemOp, wire.ArrayT.Len) + } + + case wire.MapT != nil: + keyId := dec.wireType[wireId].MapT.Key + elemId := dec.wireType[wireId].MapT.Elem + keyOp := dec.decIgnoreOpFor(keyId, inProgress) + elemOp := dec.decIgnoreOpFor(elemId, inProgress) + op = func(i *decInstr, state *decoderState, value reflect.Value) { + state.dec.ignoreMap(state, *keyOp, *elemOp) + } + + case wire.SliceT != nil: + elemId := wire.SliceT.Elem + elemOp := dec.decIgnoreOpFor(elemId, inProgress) + op = func(i *decInstr, state *decoderState, value reflect.Value) { + state.dec.ignoreSlice(state, *elemOp) + } + + case wire.StructT != nil: + // Generate a closure that calls out to the engine for the nested type. + enginePtr, err := dec.getIgnoreEnginePtr(wireId) + if err != nil { + error_(err) + } + op = func(i *decInstr, state *decoderState, value reflect.Value) { + // indirect through enginePtr to delay evaluation for recursive structs + state.dec.ignoreStruct(*enginePtr) + } + + case wire.GobEncoderT != nil, wire.BinaryMarshalerT != nil, wire.TextMarshalerT != nil: + op = func(i *decInstr, state *decoderState, value reflect.Value) { + state.dec.ignoreGobDecoder(state) + } + } + } + if op == nil { + errorf("bad data: ignore can't handle type %s", wireId.string()) + } + return &op +} + +// gobDecodeOpFor returns the op for a type that is known to implement +// GobDecoder. +func (dec *Decoder) gobDecodeOpFor(ut *userTypeInfo) *decOp { + rcvrType := ut.user + if ut.decIndir == -1 { + rcvrType = reflect.PtrTo(rcvrType) + } else if ut.decIndir > 0 { + for i := int8(0); i < ut.decIndir; i++ { + rcvrType = rcvrType.Elem() + } + } + var op decOp + op = func(i *decInstr, state *decoderState, value reflect.Value) { + // We now have the base type. We need its address if the receiver is a pointer. + if value.Kind() != reflect.Ptr && rcvrType.Kind() == reflect.Ptr { + value = value.Addr() + } + state.dec.decodeGobDecoder(ut, state, value) + } + return &op +} + +// compatibleType asks: Are these two gob Types compatible? +// Answers the question for basic types, arrays, maps and slices, plus +// GobEncoder/Decoder pairs. +// Structs are considered ok; fields will be checked later. +func (dec *Decoder) compatibleType(fr reflect.Type, fw typeId, inProgress map[reflect.Type]typeId) bool { + if rhs, ok := inProgress[fr]; ok { + return rhs == fw + } + inProgress[fr] = fw + ut := userType(fr) + wire, ok := dec.wireType[fw] + // If wire was encoded with an encoding method, fr must have that method. + // And if not, it must not. + // At most one of the booleans in ut is set. + // We could possibly relax this constraint in the future in order to + // choose the decoding method using the data in the wireType. + // The parentheses look odd but are correct. + if (ut.externalDec == xGob) != (ok && wire.GobEncoderT != nil) || + (ut.externalDec == xBinary) != (ok && wire.BinaryMarshalerT != nil) || + (ut.externalDec == xText) != (ok && wire.TextMarshalerT != nil) { + return false + } + if ut.externalDec != 0 { // This test trumps all others. + return true + } + switch t := ut.base; t.Kind() { + default: + // chan, etc: cannot handle. + return false + case reflect.Bool: + return fw == tBool + case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: + return fw == tInt + case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: + return fw == tUint + case reflect.Float32, reflect.Float64: + return fw == tFloat + case reflect.Complex64, reflect.Complex128: + return fw == tComplex + case reflect.String: + return fw == tString + case reflect.Interface: + return fw == tInterface + case reflect.Array: + if !ok || wire.ArrayT == nil { + return false + } + array := wire.ArrayT + return t.Len() == array.Len && dec.compatibleType(t.Elem(), array.Elem, inProgress) + case reflect.Map: + if !ok || wire.MapT == nil { + return false + } + MapType := wire.MapT + return dec.compatibleType(t.Key(), MapType.Key, inProgress) && dec.compatibleType(t.Elem(), MapType.Elem, inProgress) + case reflect.Slice: + // Is it an array of bytes? + if t.Elem().Kind() == reflect.Uint8 { + return fw == tBytes + } + // Extract and compare element types. + var sw *sliceType + if tt, ok := builtinIdToType[fw]; ok { + sw, _ = tt.(*sliceType) + } else if wire != nil { + sw = wire.SliceT + } + elem := userType(t.Elem()).base + return sw != nil && dec.compatibleType(elem, sw.Elem, inProgress) + case reflect.Struct: + return true + } +} + +// typeString returns a human-readable description of the type identified by remoteId. +func (dec *Decoder) typeString(remoteId typeId) string { + if t := idToType[remoteId]; t != nil { + // globally known type. + return t.string() + } + return dec.wireType[remoteId].string() +} + +// compileSingle compiles the decoder engine for a non-struct top-level value, including +// GobDecoders. +func (dec *Decoder) compileSingle(remoteId typeId, ut *userTypeInfo) (engine *decEngine, err error) { + rt := ut.user + engine = new(decEngine) + engine.instr = make([]decInstr, 1) // one item + name := rt.String() // best we can do + if !dec.compatibleType(rt, remoteId, make(map[reflect.Type]typeId)) { + remoteType := dec.typeString(remoteId) + // Common confusing case: local interface type, remote concrete type. + if ut.base.Kind() == reflect.Interface && remoteId != tInterface { + return nil, errors.New("gob: local interface type " + name + " can only be decoded from remote interface type; received concrete type " + remoteType) + } + return nil, errors.New("gob: decoding into local type " + name + ", received remote type " + remoteType) + } + op := dec.decOpFor(remoteId, rt, name, make(map[reflect.Type]*decOp)) + ovfl := errors.New(`value for "` + name + `" out of range`) + engine.instr[singletonField] = decInstr{*op, singletonField, nil, ovfl} + engine.numInstr = 1 + return +} + +// compileIgnoreSingle compiles the decoder engine for a non-struct top-level value that will be discarded. +func (dec *Decoder) compileIgnoreSingle(remoteId typeId) (engine *decEngine, err error) { + engine = new(decEngine) + engine.instr = make([]decInstr, 1) // one item + op := dec.decIgnoreOpFor(remoteId, make(map[typeId]*decOp)) + ovfl := overflow(dec.typeString(remoteId)) + engine.instr[0] = decInstr{*op, 0, nil, ovfl} + engine.numInstr = 1 + return +} + +// compileDec compiles the decoder engine for a value. If the value is not a struct, +// it calls out to compileSingle. +func (dec *Decoder) compileDec(remoteId typeId, ut *userTypeInfo) (engine *decEngine, err error) { + defer catchError(&err) + rt := ut.base + srt := rt + if srt.Kind() != reflect.Struct || ut.externalDec != 0 { + return dec.compileSingle(remoteId, ut) + } + var wireStruct *structType + // Builtin types can come from global pool; the rest must be defined by the decoder. + // Also we know we're decoding a struct now, so the client must have sent one. + if t, ok := builtinIdToType[remoteId]; ok { + wireStruct, _ = t.(*structType) + } else { + wire := dec.wireType[remoteId] + if wire == nil { + error_(errBadType) + } + wireStruct = wire.StructT + } + if wireStruct == nil { + errorf("type mismatch in decoder: want struct type %s; got non-struct", rt) + } + engine = new(decEngine) + engine.instr = make([]decInstr, len(wireStruct.Field)) + seen := make(map[reflect.Type]*decOp) + // Loop over the fields of the wire type. + for fieldnum := 0; fieldnum < len(wireStruct.Field); fieldnum++ { + wireField := wireStruct.Field[fieldnum] + if wireField.Name == "" { + errorf("empty name for remote field of type %s", wireStruct.Name) + } + ovfl := overflow(wireField.Name) + // Find the field of the local type with the same name. + localField, present := srt.FieldByName(wireField.Name) + // TODO(r): anonymous names + if !present || !isExported(wireField.Name) { + op := dec.decIgnoreOpFor(wireField.Id, make(map[typeId]*decOp)) + engine.instr[fieldnum] = decInstr{*op, fieldnum, nil, ovfl} + continue + } + if !dec.compatibleType(localField.Type, wireField.Id, make(map[reflect.Type]typeId)) { + errorf("wrong type (%s) for received field %s.%s", localField.Type, wireStruct.Name, wireField.Name) + } + op := dec.decOpFor(wireField.Id, localField.Type, localField.Name, seen) + engine.instr[fieldnum] = decInstr{*op, fieldnum, localField.Index, ovfl} + engine.numInstr++ + } + return +} + +// getDecEnginePtr returns the engine for the specified type. +func (dec *Decoder) getDecEnginePtr(remoteId typeId, ut *userTypeInfo) (enginePtr **decEngine, err error) { + rt := ut.user + decoderMap, ok := dec.decoderCache[rt] + if !ok { + decoderMap = make(map[typeId]**decEngine) + dec.decoderCache[rt] = decoderMap + } + if enginePtr, ok = decoderMap[remoteId]; !ok { + // To handle recursive types, mark this engine as underway before compiling. + enginePtr = new(*decEngine) + decoderMap[remoteId] = enginePtr + *enginePtr, err = dec.compileDec(remoteId, ut) + if err != nil { + delete(decoderMap, remoteId) + } + } + return +} + +// emptyStruct is the type we compile into when ignoring a struct value. +type emptyStruct struct{} + +var emptyStructType = reflect.TypeOf(emptyStruct{}) + +// getIgnoreEnginePtr returns the engine for the specified type when the value is to be discarded. +func (dec *Decoder) getIgnoreEnginePtr(wireId typeId) (enginePtr **decEngine, err error) { + var ok bool + if enginePtr, ok = dec.ignorerCache[wireId]; !ok { + // To handle recursive types, mark this engine as underway before compiling. + enginePtr = new(*decEngine) + dec.ignorerCache[wireId] = enginePtr + wire := dec.wireType[wireId] + if wire != nil && wire.StructT != nil { + *enginePtr, err = dec.compileDec(wireId, userType(emptyStructType)) + } else { + *enginePtr, err = dec.compileIgnoreSingle(wireId) + } + if err != nil { + delete(dec.ignorerCache, wireId) + } + } + return +} + +// decodeValue decodes the data stream representing a value and stores it in value. +func (dec *Decoder) decodeValue(wireId typeId, value reflect.Value) { + defer catchError(&dec.err) + // If the value is nil, it means we should just ignore this item. + if !value.IsValid() { + dec.decodeIgnoredValue(wireId) + return + } + // Dereference down to the underlying type. + ut := userType(value.Type()) + base := ut.base + var enginePtr **decEngine + enginePtr, dec.err = dec.getDecEnginePtr(wireId, ut) + if dec.err != nil { + return + } + value = decAlloc(value) + engine := *enginePtr + if st := base; st.Kind() == reflect.Struct && ut.externalDec == 0 { + wt := dec.wireType[wireId] + if engine.numInstr == 0 && st.NumField() > 0 && + wt != nil && len(wt.StructT.Field) > 0 { + name := base.Name() + errorf("type mismatch: no fields matched compiling decoder for %s", name) + } + dec.decodeStruct(engine, ut, value) + } else { + dec.decodeSingle(engine, ut, value) + } +} + +// decodeIgnoredValue decodes the data stream representing a value of the specified type and discards it. +func (dec *Decoder) decodeIgnoredValue(wireId typeId) { + var enginePtr **decEngine + enginePtr, dec.err = dec.getIgnoreEnginePtr(wireId) + if dec.err != nil { + return + } + wire := dec.wireType[wireId] + if wire != nil && wire.StructT != nil { + dec.ignoreStruct(*enginePtr) + } else { + dec.ignoreSingle(*enginePtr) + } +} + +func init() { + var iop, uop decOp + switch reflect.TypeOf(int(0)).Bits() { + case 32: + iop = decInt32 + uop = decUint32 + case 64: + iop = decInt64 + uop = decUint64 + default: + panic("gob: unknown size of int/uint") + } + decOpTable[reflect.Int] = iop + decOpTable[reflect.Uint] = uop + + // Finally uintptr + switch reflect.TypeOf(uintptr(0)).Bits() { + case 32: + uop = decUint32 + case 64: + uop = decUint64 + default: + panic("gob: unknown size of uintptr") + } + decOpTable[reflect.Uintptr] = uop +} + +// Gob depends on being able to take the address +// of zeroed Values it creates, so use this wrapper instead +// of the standard reflect.Zero. +// Each call allocates once. +func allocValue(t reflect.Type) reflect.Value { + return reflect.New(t).Elem() +} diff --git a/src/encoding/gob/decoder.go b/src/encoding/gob/decoder.go new file mode 100644 index 0000000000000000000000000000000000000000..c453e9ba397d3c568d05116a5d4398be1d555bcb --- /dev/null +++ b/src/encoding/gob/decoder.go @@ -0,0 +1,218 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package gob + +import ( + "bufio" + "errors" + "io" + "reflect" + "sync" +) + +// tooBig provides a sanity check for sizes; used in several places. +// Upper limit of 1GB, allowing room to grow a little without overflow. +// TODO: make this adjustable? +const tooBig = 1 << 30 + +// A Decoder manages the receipt of type and data information read from the +// remote side of a connection. +type Decoder struct { + mutex sync.Mutex // each item must be received atomically + r io.Reader // source of the data + buf decBuffer // buffer for more efficient i/o from r + wireType map[typeId]*wireType // map from remote ID to local description + decoderCache map[reflect.Type]map[typeId]**decEngine // cache of compiled engines + ignorerCache map[typeId]**decEngine // ditto for ignored objects + freeList *decoderState // list of free decoderStates; avoids reallocation + countBuf []byte // used for decoding integers while parsing messages + err error +} + +// NewDecoder returns a new decoder that reads from the io.Reader. +// If r does not also implement io.ByteReader, it will be wrapped in a +// bufio.Reader. +func NewDecoder(r io.Reader) *Decoder { + dec := new(Decoder) + // We use the ability to read bytes as a plausible surrogate for buffering. + if _, ok := r.(io.ByteReader); !ok { + r = bufio.NewReader(r) + } + dec.r = r + dec.wireType = make(map[typeId]*wireType) + dec.decoderCache = make(map[reflect.Type]map[typeId]**decEngine) + dec.ignorerCache = make(map[typeId]**decEngine) + dec.countBuf = make([]byte, 9) // counts may be uint64s (unlikely!), require 9 bytes + + return dec +} + +// recvType loads the definition of a type. +func (dec *Decoder) recvType(id typeId) { + // Have we already seen this type? That's an error + if id < firstUserId || dec.wireType[id] != nil { + dec.err = errors.New("gob: duplicate type received") + return + } + + // Type: + wire := new(wireType) + dec.decodeValue(tWireType, reflect.ValueOf(wire)) + if dec.err != nil { + return + } + // Remember we've seen this type. + dec.wireType[id] = wire +} + +var errBadCount = errors.New("invalid message length") + +// recvMessage reads the next count-delimited item from the input. It is the converse +// of Encoder.writeMessage. It returns false on EOF or other error reading the message. +func (dec *Decoder) recvMessage() bool { + // Read a count. + nbytes, _, err := decodeUintReader(dec.r, dec.countBuf) + if err != nil { + dec.err = err + return false + } + if nbytes >= tooBig { + dec.err = errBadCount + return false + } + dec.readMessage(int(nbytes)) + return dec.err == nil +} + +// readMessage reads the next nbytes bytes from the input. +func (dec *Decoder) readMessage(nbytes int) { + if dec.buf.Len() != 0 { + // The buffer should always be empty now. + panic("non-empty decoder buffer") + } + // Read the data + dec.buf.Size(nbytes) + _, dec.err = io.ReadFull(dec.r, dec.buf.Bytes()) + if dec.err != nil { + if dec.err == io.EOF { + dec.err = io.ErrUnexpectedEOF + } + } +} + +// toInt turns an encoded uint64 into an int, according to the marshaling rules. +func toInt(x uint64) int64 { + i := int64(x >> 1) + if x&1 != 0 { + i = ^i + } + return i +} + +func (dec *Decoder) nextInt() int64 { + n, _, err := decodeUintReader(&dec.buf, dec.countBuf) + if err != nil { + dec.err = err + } + return toInt(n) +} + +func (dec *Decoder) nextUint() uint64 { + n, _, err := decodeUintReader(&dec.buf, dec.countBuf) + if err != nil { + dec.err = err + } + return n +} + +// decodeTypeSequence parses: +// TypeSequence +// (TypeDefinition DelimitedTypeDefinition*)? +// and returns the type id of the next value. It returns -1 at +// EOF. Upon return, the remainder of dec.buf is the value to be +// decoded. If this is an interface value, it can be ignored by +// resetting that buffer. +func (dec *Decoder) decodeTypeSequence(isInterface bool) typeId { + for dec.err == nil { + if dec.buf.Len() == 0 { + if !dec.recvMessage() { + break + } + } + // Receive a type id. + id := typeId(dec.nextInt()) + if id >= 0 { + // Value follows. + return id + } + // Type definition for (-id) follows. + dec.recvType(-id) + // When decoding an interface, after a type there may be a + // DelimitedValue still in the buffer. Skip its count. + // (Alternatively, the buffer is empty and the byte count + // will be absorbed by recvMessage.) + if dec.buf.Len() > 0 { + if !isInterface { + dec.err = errors.New("extra data in buffer") + break + } + dec.nextUint() + } + } + return -1 +} + +// Decode reads the next value from the input stream and stores +// it in the data represented by the empty interface value. +// If e is nil, the value will be discarded. Otherwise, +// the value underlying e must be a pointer to the +// correct type for the next data item received. +// If the input is at EOF, Decode returns io.EOF and +// does not modify e. +func (dec *Decoder) Decode(e interface{}) error { + if e == nil { + return dec.DecodeValue(reflect.Value{}) + } + value := reflect.ValueOf(e) + // If e represents a value as opposed to a pointer, the answer won't + // get back to the caller. Make sure it's a pointer. + if value.Type().Kind() != reflect.Ptr { + dec.err = errors.New("gob: attempt to decode into a non-pointer") + return dec.err + } + return dec.DecodeValue(value) +} + +// DecodeValue reads the next value from the input stream. +// If v is the zero reflect.Value (v.Kind() == Invalid), DecodeValue discards the value. +// Otherwise, it stores the value into v. In that case, v must represent +// a non-nil pointer to data or be an assignable reflect.Value (v.CanSet()) +// If the input is at EOF, DecodeValue returns io.EOF and +// does not modify v. +func (dec *Decoder) DecodeValue(v reflect.Value) error { + if v.IsValid() { + if v.Kind() == reflect.Ptr && !v.IsNil() { + // That's okay, we'll store through the pointer. + } else if !v.CanSet() { + return errors.New("gob: DecodeValue of unassignable value") + } + } + // Make sure we're single-threaded through here. + dec.mutex.Lock() + defer dec.mutex.Unlock() + + dec.buf.Reset() // In case data lingers from previous invocation. + dec.err = nil + id := dec.decodeTypeSequence(false) + if dec.err == nil { + dec.decodeValue(id, v) + } + return dec.err +} + +// If debug.go is compiled into the program , debugFunc prints a human-readable +// representation of the gob data read from r by calling that file's Debug function. +// Otherwise it is nil. +var debugFunc func(io.Reader) diff --git a/src/encoding/gob/doc.go b/src/encoding/gob/doc.go new file mode 100644 index 0000000000000000000000000000000000000000..4d3d0076fbc570a32ef7cdb83ae7d12b15a3bc5f --- /dev/null +++ b/src/encoding/gob/doc.go @@ -0,0 +1,386 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +/* +Package gob manages streams of gobs - binary values exchanged between an +Encoder (transmitter) and a Decoder (receiver). A typical use is transporting +arguments and results of remote procedure calls (RPCs) such as those provided by +package "net/rpc". + +The implementation compiles a custom codec for each data type in the stream and +is most efficient when a single Encoder is used to transmit a stream of values, +amortizing the cost of compilation. + +Basics + +A stream of gobs is self-describing. Each data item in the stream is preceded by +a specification of its type, expressed in terms of a small set of predefined +types. Pointers are not transmitted, but the things they point to are +transmitted; that is, the values are flattened. Recursive types work fine, but +recursive values (data with cycles) are problematic. This may change. + +To use gobs, create an Encoder and present it with a series of data items as +values or addresses that can be dereferenced to values. The Encoder makes sure +all type information is sent before it is needed. At the receive side, a +Decoder retrieves values from the encoded stream and unpacks them into local +variables. + +Types and Values + +The source and destination values/types need not correspond exactly. For structs, +fields (identified by name) that are in the source but absent from the receiving +variable will be ignored. Fields that are in the receiving variable but missing +from the transmitted type or value will be ignored in the destination. If a field +with the same name is present in both, their types must be compatible. Both the +receiver and transmitter will do all necessary indirection and dereferencing to +convert between gobs and actual Go values. For instance, a gob type that is +schematically, + + struct { A, B int } + +can be sent from or received into any of these Go types: + + struct { A, B int } // the same + *struct { A, B int } // extra indirection of the struct + struct { *A, **B int } // extra indirection of the fields + struct { A, B int64 } // different concrete value type; see below + +It may also be received into any of these: + + struct { A, B int } // the same + struct { B, A int } // ordering doesn't matter; matching is by name + struct { A, B, C int } // extra field (C) ignored + struct { B int } // missing field (A) ignored; data will be dropped + struct { B, C int } // missing field (A) ignored; extra field (C) ignored. + +Attempting to receive into these types will draw a decode error: + + struct { A int; B uint } // change of signedness for B + struct { A int; B float } // change of type for B + struct { } // no field names in common + struct { C, D int } // no field names in common + +Integers are transmitted two ways: arbitrary precision signed integers or +arbitrary precision unsigned integers. There is no int8, int16 etc. +discrimination in the gob format; there are only signed and unsigned integers. As +described below, the transmitter sends the value in a variable-length encoding; +the receiver accepts the value and stores it in the destination variable. +Floating-point numbers are always sent using IEEE-754 64-bit precision (see +below). + +Signed integers may be received into any signed integer variable: int, int16, etc.; +unsigned integers may be received into any unsigned integer variable; and floating +point values may be received into any floating point variable. However, +the destination variable must be able to represent the value or the decode +operation will fail. + +Structs, arrays and slices are also supported. Structs encode and decode only +exported fields. Strings and arrays of bytes are supported with a special, +efficient representation (see below). When a slice is decoded, if the existing +slice has capacity the slice will be extended in place; if not, a new array is +allocated. Regardless, the length of the resulting slice reports the number of +elements decoded. + +Functions and channels will not be sent in a gob. Attempting to encode such a value +at the top level will fail. A struct field of chan or func type is treated exactly +like an unexported field and is ignored. + +Gob can encode a value of any type implementing the GobEncoder or +encoding.BinaryMarshaler interfaces by calling the corresponding method, +in that order of preference. + +Gob can decode a value of any type implementing the GobDecoder or +encoding.BinaryUnmarshaler interfaces by calling the corresponding method, +again in that order of preference. + +Encoding Details + +This section documents the encoding, details that are not important for most +users. Details are presented bottom-up. + +An unsigned integer is sent one of two ways. If it is less than 128, it is sent +as a byte with that value. Otherwise it is sent as a minimal-length big-endian +(high byte first) byte stream holding the value, preceded by one byte holding the +byte count, negated. Thus 0 is transmitted as (00), 7 is transmitted as (07) and +256 is transmitted as (FE 01 00). + +A boolean is encoded within an unsigned integer: 0 for false, 1 for true. + +A signed integer, i, is encoded within an unsigned integer, u. Within u, bits 1 +upward contain the value; bit 0 says whether they should be complemented upon +receipt. The encode algorithm looks like this: + + var u uint + if i < 0 { + u = (^uint(i) << 1) | 1 // complement i, bit 0 is 1 + } else { + u = (uint(i) << 1) // do not complement i, bit 0 is 0 + } + encodeUnsigned(u) + +The low bit is therefore analogous to a sign bit, but making it the complement bit +instead guarantees that the largest negative integer is not a special case. For +example, -129=^128=(^256>>1) encodes as (FE 01 01). + +Floating-point numbers are always sent as a representation of a float64 value. +That value is converted to a uint64 using math.Float64bits. The uint64 is then +byte-reversed and sent as a regular unsigned integer. The byte-reversal means the +exponent and high-precision part of the mantissa go first. Since the low bits are +often zero, this can save encoding bytes. For instance, 17.0 is encoded in only +three bytes (FE 31 40). + +Strings and slices of bytes are sent as an unsigned count followed by that many +uninterpreted bytes of the value. + +All other slices and arrays are sent as an unsigned count followed by that many +elements using the standard gob encoding for their type, recursively. + +Maps are sent as an unsigned count followed by that many key, element +pairs. Empty but non-nil maps are sent, so if the receiver has not allocated +one already, one will always be allocated on receipt unless the transmitted map +is nil and not at the top level. + +Structs are sent as a sequence of (field number, field value) pairs. The field +value is sent using the standard gob encoding for its type, recursively. If a +field has the zero value for its type, it is omitted from the transmission. The +field number is defined by the type of the encoded struct: the first field of the +encoded type is field 0, the second is field 1, etc. When encoding a value, the +field numbers are delta encoded for efficiency and the fields are always sent in +order of increasing field number; the deltas are therefore unsigned. The +initialization for the delta encoding sets the field number to -1, so an unsigned +integer field 0 with value 7 is transmitted as unsigned delta = 1, unsigned value += 7 or (01 07). Finally, after all the fields have been sent a terminating mark +denotes the end of the struct. That mark is a delta=0 value, which has +representation (00). + +Interface types are not checked for compatibility; all interface types are +treated, for transmission, as members of a single "interface" type, analogous to +int or []byte - in effect they're all treated as interface{}. Interface values +are transmitted as a string identifying the concrete type being sent (a name +that must be pre-defined by calling Register), followed by a byte count of the +length of the following data (so the value can be skipped if it cannot be +stored), followed by the usual encoding of concrete (dynamic) value stored in +the interface value. (A nil interface value is identified by the empty string +and transmits no value.) Upon receipt, the decoder verifies that the unpacked +concrete item satisfies the interface of the receiving variable. + +The representation of types is described below. When a type is defined on a given +connection between an Encoder and Decoder, it is assigned a signed integer type +id. When Encoder.Encode(v) is called, it makes sure there is an id assigned for +the type of v and all its elements and then it sends the pair (typeid, encoded-v) +where typeid is the type id of the encoded type of v and encoded-v is the gob +encoding of the value v. + +To define a type, the encoder chooses an unused, positive type id and sends the +pair (-type id, encoded-type) where encoded-type is the gob encoding of a wireType +description, constructed from these types: + + type wireType struct { + ArrayT *ArrayType + SliceT *SliceType + StructT *StructType + MapT *MapType + } + type arrayType struct { + CommonType + Elem typeId + Len int + } + type CommonType struct { + Name string // the name of the struct type + Id int // the id of the type, repeated so it's inside the type + } + type sliceType struct { + CommonType + Elem typeId + } + type structType struct { + CommonType + Field []*fieldType // the fields of the struct. + } + type fieldType struct { + Name string // the name of the field. + Id int // the type id of the field, which must be already defined + } + type mapType struct { + CommonType + Key typeId + Elem typeId + } + +If there are nested type ids, the types for all inner type ids must be defined +before the top-level type id is used to describe an encoded-v. + +For simplicity in setup, the connection is defined to understand these types a +priori, as well as the basic gob types int, uint, etc. Their ids are: + + bool 1 + int 2 + uint 3 + float 4 + []byte 5 + string 6 + complex 7 + interface 8 + // gap for reserved ids. + WireType 16 + ArrayType 17 + CommonType 18 + SliceType 19 + StructType 20 + FieldType 21 + // 22 is slice of fieldType. + MapType 23 + +Finally, each message created by a call to Encode is preceded by an encoded +unsigned integer count of the number of bytes remaining in the message. After +the initial type name, interface values are wrapped the same way; in effect, the +interface value acts like a recursive invocation of Encode. + +In summary, a gob stream looks like + + (byteCount (-type id, encoding of a wireType)* (type id, encoding of a value))* + +where * signifies zero or more repetitions and the type id of a value must +be predefined or be defined before the value in the stream. + +See "Gobs of data" for a design discussion of the gob wire format: +https://blog.golang.org/gobs-of-data +*/ +package gob + +/* +Grammar: + +Tokens starting with a lower case letter are terminals; int(n) +and uint(n) represent the signed/unsigned encodings of the value n. + +GobStream: + DelimitedMessage* +DelimitedMessage: + uint(lengthOfMessage) Message +Message: + TypeSequence TypedValue +TypeSequence + (TypeDefinition DelimitedTypeDefinition*)? +DelimitedTypeDefinition: + uint(lengthOfTypeDefinition) TypeDefinition +TypedValue: + int(typeId) Value +TypeDefinition: + int(-typeId) encodingOfWireType +Value: + SingletonValue | StructValue +SingletonValue: + uint(0) FieldValue +FieldValue: + builtinValue | ArrayValue | MapValue | SliceValue | StructValue | InterfaceValue +InterfaceValue: + NilInterfaceValue | NonNilInterfaceValue +NilInterfaceValue: + uint(0) +NonNilInterfaceValue: + ConcreteTypeName TypeSequence InterfaceContents +ConcreteTypeName: + uint(lengthOfName) [already read=n] name +InterfaceContents: + int(concreteTypeId) DelimitedValue +DelimitedValue: + uint(length) Value +ArrayValue: + uint(n) FieldValue*n [n elements] +MapValue: + uint(n) (FieldValue FieldValue)*n [n (key, value) pairs] +SliceValue: + uint(n) FieldValue*n [n elements] +StructValue: + (uint(fieldDelta) FieldValue)* +*/ + +/* +For implementers and the curious, here is an encoded example. Given + type Point struct {X, Y int} +and the value + p := Point{22, 33} +the bytes transmitted that encode p will be: + 1f ff 81 03 01 01 05 50 6f 69 6e 74 01 ff 82 00 + 01 02 01 01 58 01 04 00 01 01 59 01 04 00 00 00 + 07 ff 82 01 2c 01 42 00 +They are determined as follows. + +Since this is the first transmission of type Point, the type descriptor +for Point itself must be sent before the value. This is the first type +we've sent on this Encoder, so it has type id 65 (0 through 64 are +reserved). + + 1f // This item (a type descriptor) is 31 bytes long. + ff 81 // The negative of the id for the type we're defining, -65. + // This is one byte (indicated by FF = -1) followed by + // ^-65<<1 | 1. The low 1 bit signals to complement the + // rest upon receipt. + + // Now we send a type descriptor, which is itself a struct (wireType). + // The type of wireType itself is known (it's built in, as is the type of + // all its components), so we just need to send a *value* of type wireType + // that represents type "Point". + // Here starts the encoding of that value. + // Set the field number implicitly to -1; this is done at the beginning + // of every struct, including nested structs. + 03 // Add 3 to field number; now 2 (wireType.structType; this is a struct). + // structType starts with an embedded CommonType, which appears + // as a regular structure here too. + 01 // add 1 to field number (now 0); start of embedded CommonType. + 01 // add 1 to field number (now 0, the name of the type) + 05 // string is (unsigned) 5 bytes long + 50 6f 69 6e 74 // wireType.structType.CommonType.name = "Point" + 01 // add 1 to field number (now 1, the id of the type) + ff 82 // wireType.structType.CommonType._id = 65 + 00 // end of embedded wiretype.structType.CommonType struct + 01 // add 1 to field number (now 1, the field array in wireType.structType) + 02 // There are two fields in the type (len(structType.field)) + 01 // Start of first field structure; add 1 to get field number 0: field[0].name + 01 // 1 byte + 58 // structType.field[0].name = "X" + 01 // Add 1 to get field number 1: field[0].id + 04 // structType.field[0].typeId is 2 (signed int). + 00 // End of structType.field[0]; start structType.field[1]; set field number to -1. + 01 // Add 1 to get field number 0: field[1].name + 01 // 1 byte + 59 // structType.field[1].name = "Y" + 01 // Add 1 to get field number 1: field[1].id + 04 // struct.Type.field[1].typeId is 2 (signed int). + 00 // End of structType.field[1]; end of structType.field. + 00 // end of wireType.structType structure + 00 // end of wireType structure + +Now we can send the Point value. Again the field number resets to -1: + + 07 // this value is 7 bytes long + ff 82 // the type number, 65 (1 byte (-FF) followed by 65<<1) + 01 // add one to field number, yielding field 0 + 2c // encoding of signed "22" (0x22 = 44 = 22<<1); Point.x = 22 + 01 // add one to field number, yielding field 1 + 42 // encoding of signed "33" (0x42 = 66 = 33<<1); Point.y = 33 + 00 // end of structure + +The type encoding is long and fairly intricate but we send it only once. +If p is transmitted a second time, the type is already known so the +output will be just: + + 07 ff 82 01 2c 01 42 00 + +A single non-struct value at top level is transmitted like a field with +delta tag 0. For instance, a signed integer with value 3 presented as +the argument to Encode will emit: + + 03 04 00 06 + +Which represents: + + 03 // this value is 3 bytes long + 04 // the type number, 2, represents an integer + 00 // tag delta 0 + 06 // value 3 + +*/ diff --git a/src/encoding/gob/dump.go b/src/encoding/gob/dump.go new file mode 100644 index 0000000000000000000000000000000000000000..17238c98df0d3bdf04a1084c1edd129a656f8e84 --- /dev/null +++ b/src/encoding/gob/dump.go @@ -0,0 +1,29 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build ignore + +package main + +// Need to compile package gob with debug.go to build this program. +// See comments in debug.go for how to do this. + +import ( + "encoding/gob" + "fmt" + "os" +) + +func main() { + var err error + file := os.Stdin + if len(os.Args) > 1 { + file, err = os.Open(os.Args[1]) + if err != nil { + fmt.Fprintf(os.Stderr, "dump: %s\n", err) + os.Exit(1) + } + } + gob.Debug(file) +} diff --git a/src/encoding/gob/enc_helpers.go b/src/encoding/gob/enc_helpers.go new file mode 100644 index 0000000000000000000000000000000000000000..804e539d84d386f5b7d3854c8c7eee2954977950 --- /dev/null +++ b/src/encoding/gob/enc_helpers.go @@ -0,0 +1,414 @@ +// Created by encgen --output enc_helpers.go; DO NOT EDIT + +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package gob + +import ( + "reflect" +) + +var encArrayHelper = map[reflect.Kind]encHelper{ + reflect.Bool: encBoolArray, + reflect.Complex64: encComplex64Array, + reflect.Complex128: encComplex128Array, + reflect.Float32: encFloat32Array, + reflect.Float64: encFloat64Array, + reflect.Int: encIntArray, + reflect.Int16: encInt16Array, + reflect.Int32: encInt32Array, + reflect.Int64: encInt64Array, + reflect.Int8: encInt8Array, + reflect.String: encStringArray, + reflect.Uint: encUintArray, + reflect.Uint16: encUint16Array, + reflect.Uint32: encUint32Array, + reflect.Uint64: encUint64Array, + reflect.Uintptr: encUintptrArray, +} + +var encSliceHelper = map[reflect.Kind]encHelper{ + reflect.Bool: encBoolSlice, + reflect.Complex64: encComplex64Slice, + reflect.Complex128: encComplex128Slice, + reflect.Float32: encFloat32Slice, + reflect.Float64: encFloat64Slice, + reflect.Int: encIntSlice, + reflect.Int16: encInt16Slice, + reflect.Int32: encInt32Slice, + reflect.Int64: encInt64Slice, + reflect.Int8: encInt8Slice, + reflect.String: encStringSlice, + reflect.Uint: encUintSlice, + reflect.Uint16: encUint16Slice, + reflect.Uint32: encUint32Slice, + reflect.Uint64: encUint64Slice, + reflect.Uintptr: encUintptrSlice, +} + +func encBoolArray(state *encoderState, v reflect.Value) bool { + // Can only slice if it is addressable. + if !v.CanAddr() { + return false + } + return encBoolSlice(state, v.Slice(0, v.Len())) +} + +func encBoolSlice(state *encoderState, v reflect.Value) bool { + slice, ok := v.Interface().([]bool) + if !ok { + // It is kind bool but not type bool. TODO: We can handle this unsafely. + return false + } + for _, x := range slice { + if x != false || state.sendZero { + if x { + state.encodeUint(1) + } else { + state.encodeUint(0) + } + } + } + return true +} + +func encComplex64Array(state *encoderState, v reflect.Value) bool { + // Can only slice if it is addressable. + if !v.CanAddr() { + return false + } + return encComplex64Slice(state, v.Slice(0, v.Len())) +} + +func encComplex64Slice(state *encoderState, v reflect.Value) bool { + slice, ok := v.Interface().([]complex64) + if !ok { + // It is kind complex64 but not type complex64. TODO: We can handle this unsafely. + return false + } + for _, x := range slice { + if x != 0+0i || state.sendZero { + rpart := floatBits(float64(real(x))) + ipart := floatBits(float64(imag(x))) + state.encodeUint(rpart) + state.encodeUint(ipart) + } + } + return true +} + +func encComplex128Array(state *encoderState, v reflect.Value) bool { + // Can only slice if it is addressable. + if !v.CanAddr() { + return false + } + return encComplex128Slice(state, v.Slice(0, v.Len())) +} + +func encComplex128Slice(state *encoderState, v reflect.Value) bool { + slice, ok := v.Interface().([]complex128) + if !ok { + // It is kind complex128 but not type complex128. TODO: We can handle this unsafely. + return false + } + for _, x := range slice { + if x != 0+0i || state.sendZero { + rpart := floatBits(real(x)) + ipart := floatBits(imag(x)) + state.encodeUint(rpart) + state.encodeUint(ipart) + } + } + return true +} + +func encFloat32Array(state *encoderState, v reflect.Value) bool { + // Can only slice if it is addressable. + if !v.CanAddr() { + return false + } + return encFloat32Slice(state, v.Slice(0, v.Len())) +} + +func encFloat32Slice(state *encoderState, v reflect.Value) bool { + slice, ok := v.Interface().([]float32) + if !ok { + // It is kind float32 but not type float32. TODO: We can handle this unsafely. + return false + } + for _, x := range slice { + if x != 0 || state.sendZero { + bits := floatBits(float64(x)) + state.encodeUint(bits) + } + } + return true +} + +func encFloat64Array(state *encoderState, v reflect.Value) bool { + // Can only slice if it is addressable. + if !v.CanAddr() { + return false + } + return encFloat64Slice(state, v.Slice(0, v.Len())) +} + +func encFloat64Slice(state *encoderState, v reflect.Value) bool { + slice, ok := v.Interface().([]float64) + if !ok { + // It is kind float64 but not type float64. TODO: We can handle this unsafely. + return false + } + for _, x := range slice { + if x != 0 || state.sendZero { + bits := floatBits(x) + state.encodeUint(bits) + } + } + return true +} + +func encIntArray(state *encoderState, v reflect.Value) bool { + // Can only slice if it is addressable. + if !v.CanAddr() { + return false + } + return encIntSlice(state, v.Slice(0, v.Len())) +} + +func encIntSlice(state *encoderState, v reflect.Value) bool { + slice, ok := v.Interface().([]int) + if !ok { + // It is kind int but not type int. TODO: We can handle this unsafely. + return false + } + for _, x := range slice { + if x != 0 || state.sendZero { + state.encodeInt(int64(x)) + } + } + return true +} + +func encInt16Array(state *encoderState, v reflect.Value) bool { + // Can only slice if it is addressable. + if !v.CanAddr() { + return false + } + return encInt16Slice(state, v.Slice(0, v.Len())) +} + +func encInt16Slice(state *encoderState, v reflect.Value) bool { + slice, ok := v.Interface().([]int16) + if !ok { + // It is kind int16 but not type int16. TODO: We can handle this unsafely. + return false + } + for _, x := range slice { + if x != 0 || state.sendZero { + state.encodeInt(int64(x)) + } + } + return true +} + +func encInt32Array(state *encoderState, v reflect.Value) bool { + // Can only slice if it is addressable. + if !v.CanAddr() { + return false + } + return encInt32Slice(state, v.Slice(0, v.Len())) +} + +func encInt32Slice(state *encoderState, v reflect.Value) bool { + slice, ok := v.Interface().([]int32) + if !ok { + // It is kind int32 but not type int32. TODO: We can handle this unsafely. + return false + } + for _, x := range slice { + if x != 0 || state.sendZero { + state.encodeInt(int64(x)) + } + } + return true +} + +func encInt64Array(state *encoderState, v reflect.Value) bool { + // Can only slice if it is addressable. + if !v.CanAddr() { + return false + } + return encInt64Slice(state, v.Slice(0, v.Len())) +} + +func encInt64Slice(state *encoderState, v reflect.Value) bool { + slice, ok := v.Interface().([]int64) + if !ok { + // It is kind int64 but not type int64. TODO: We can handle this unsafely. + return false + } + for _, x := range slice { + if x != 0 || state.sendZero { + state.encodeInt(x) + } + } + return true +} + +func encInt8Array(state *encoderState, v reflect.Value) bool { + // Can only slice if it is addressable. + if !v.CanAddr() { + return false + } + return encInt8Slice(state, v.Slice(0, v.Len())) +} + +func encInt8Slice(state *encoderState, v reflect.Value) bool { + slice, ok := v.Interface().([]int8) + if !ok { + // It is kind int8 but not type int8. TODO: We can handle this unsafely. + return false + } + for _, x := range slice { + if x != 0 || state.sendZero { + state.encodeInt(int64(x)) + } + } + return true +} + +func encStringArray(state *encoderState, v reflect.Value) bool { + // Can only slice if it is addressable. + if !v.CanAddr() { + return false + } + return encStringSlice(state, v.Slice(0, v.Len())) +} + +func encStringSlice(state *encoderState, v reflect.Value) bool { + slice, ok := v.Interface().([]string) + if !ok { + // It is kind string but not type string. TODO: We can handle this unsafely. + return false + } + for _, x := range slice { + if x != "" || state.sendZero { + state.encodeUint(uint64(len(x))) + state.b.WriteString(x) + } + } + return true +} + +func encUintArray(state *encoderState, v reflect.Value) bool { + // Can only slice if it is addressable. + if !v.CanAddr() { + return false + } + return encUintSlice(state, v.Slice(0, v.Len())) +} + +func encUintSlice(state *encoderState, v reflect.Value) bool { + slice, ok := v.Interface().([]uint) + if !ok { + // It is kind uint but not type uint. TODO: We can handle this unsafely. + return false + } + for _, x := range slice { + if x != 0 || state.sendZero { + state.encodeUint(uint64(x)) + } + } + return true +} + +func encUint16Array(state *encoderState, v reflect.Value) bool { + // Can only slice if it is addressable. + if !v.CanAddr() { + return false + } + return encUint16Slice(state, v.Slice(0, v.Len())) +} + +func encUint16Slice(state *encoderState, v reflect.Value) bool { + slice, ok := v.Interface().([]uint16) + if !ok { + // It is kind uint16 but not type uint16. TODO: We can handle this unsafely. + return false + } + for _, x := range slice { + if x != 0 || state.sendZero { + state.encodeUint(uint64(x)) + } + } + return true +} + +func encUint32Array(state *encoderState, v reflect.Value) bool { + // Can only slice if it is addressable. + if !v.CanAddr() { + return false + } + return encUint32Slice(state, v.Slice(0, v.Len())) +} + +func encUint32Slice(state *encoderState, v reflect.Value) bool { + slice, ok := v.Interface().([]uint32) + if !ok { + // It is kind uint32 but not type uint32. TODO: We can handle this unsafely. + return false + } + for _, x := range slice { + if x != 0 || state.sendZero { + state.encodeUint(uint64(x)) + } + } + return true +} + +func encUint64Array(state *encoderState, v reflect.Value) bool { + // Can only slice if it is addressable. + if !v.CanAddr() { + return false + } + return encUint64Slice(state, v.Slice(0, v.Len())) +} + +func encUint64Slice(state *encoderState, v reflect.Value) bool { + slice, ok := v.Interface().([]uint64) + if !ok { + // It is kind uint64 but not type uint64. TODO: We can handle this unsafely. + return false + } + for _, x := range slice { + if x != 0 || state.sendZero { + state.encodeUint(x) + } + } + return true +} + +func encUintptrArray(state *encoderState, v reflect.Value) bool { + // Can only slice if it is addressable. + if !v.CanAddr() { + return false + } + return encUintptrSlice(state, v.Slice(0, v.Len())) +} + +func encUintptrSlice(state *encoderState, v reflect.Value) bool { + slice, ok := v.Interface().([]uintptr) + if !ok { + // It is kind uintptr but not type uintptr. TODO: We can handle this unsafely. + return false + } + for _, x := range slice { + if x != 0 || state.sendZero { + state.encodeUint(uint64(x)) + } + } + return true +} diff --git a/src/encoding/gob/encgen.go b/src/encoding/gob/encgen.go new file mode 100644 index 0000000000000000000000000000000000000000..efdd9282921da612c2d43afc45bb79f0742fcc42 --- /dev/null +++ b/src/encoding/gob/encgen.go @@ -0,0 +1,218 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build ignore + +// encgen writes the helper functions for encoding. Intended to be +// used with go generate; see the invocation in encode.go. + +// TODO: We could do more by being unsafe. Add a -unsafe flag? + +package main + +import ( + "bytes" + "flag" + "fmt" + "go/format" + "log" + "os" +) + +var output = flag.String("output", "enc_helpers.go", "file name to write") + +type Type struct { + lower string + upper string + zero string + encoder string +} + +var types = []Type{ + { + "bool", + "Bool", + "false", + `if x { + state.encodeUint(1) + } else { + state.encodeUint(0) + }`, + }, + { + "complex64", + "Complex64", + "0+0i", + `rpart := floatBits(float64(real(x))) + ipart := floatBits(float64(imag(x))) + state.encodeUint(rpart) + state.encodeUint(ipart)`, + }, + { + "complex128", + "Complex128", + "0+0i", + `rpart := floatBits(real(x)) + ipart := floatBits(imag(x)) + state.encodeUint(rpart) + state.encodeUint(ipart)`, + }, + { + "float32", + "Float32", + "0", + `bits := floatBits(float64(x)) + state.encodeUint(bits)`, + }, + { + "float64", + "Float64", + "0", + `bits := floatBits(x) + state.encodeUint(bits)`, + }, + { + "int", + "Int", + "0", + `state.encodeInt(int64(x))`, + }, + { + "int16", + "Int16", + "0", + `state.encodeInt(int64(x))`, + }, + { + "int32", + "Int32", + "0", + `state.encodeInt(int64(x))`, + }, + { + "int64", + "Int64", + "0", + `state.encodeInt(x)`, + }, + { + "int8", + "Int8", + "0", + `state.encodeInt(int64(x))`, + }, + { + "string", + "String", + `""`, + `state.encodeUint(uint64(len(x))) + state.b.WriteString(x)`, + }, + { + "uint", + "Uint", + "0", + `state.encodeUint(uint64(x))`, + }, + { + "uint16", + "Uint16", + "0", + `state.encodeUint(uint64(x))`, + }, + { + "uint32", + "Uint32", + "0", + `state.encodeUint(uint64(x))`, + }, + { + "uint64", + "Uint64", + "0", + `state.encodeUint(x)`, + }, + { + "uintptr", + "Uintptr", + "0", + `state.encodeUint(uint64(x))`, + }, + // uint8 Handled separately. +} + +func main() { + log.SetFlags(0) + log.SetPrefix("encgen: ") + flag.Parse() + if flag.NArg() != 0 { + log.Fatal("usage: encgen [--output filename]") + } + var b bytes.Buffer + fmt.Fprintf(&b, "// Created by encgen --output %s; DO NOT EDIT\n", *output) + fmt.Fprint(&b, header) + printMaps(&b, "Array") + fmt.Fprint(&b, "\n") + printMaps(&b, "Slice") + for _, t := range types { + fmt.Fprintf(&b, arrayHelper, t.lower, t.upper) + fmt.Fprintf(&b, sliceHelper, t.lower, t.upper, t.zero, t.encoder) + } + source, err := format.Source(b.Bytes()) + if err != nil { + log.Fatal("source format error:", err) + } + fd, err := os.Create(*output) + _, err = fd.Write(source) + if err != nil { + log.Fatal(err) + } +} + +func printMaps(b *bytes.Buffer, upperClass string) { + fmt.Fprintf(b, "var enc%sHelper = map[reflect.Kind]encHelper{\n", upperClass) + for _, t := range types { + fmt.Fprintf(b, "reflect.%s: enc%s%s,\n", t.upper, t.upper, upperClass) + } + fmt.Fprintf(b, "}\n") +} + +const header = ` +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package gob + +import ( + "reflect" +) + +` + +const arrayHelper = ` +func enc%[2]sArray(state *encoderState, v reflect.Value) bool { + // Can only slice if it is addressable. + if !v.CanAddr() { + return false + } + return enc%[2]sSlice(state, v.Slice(0, v.Len())) +} +` + +const sliceHelper = ` +func enc%[2]sSlice(state *encoderState, v reflect.Value) bool { + slice, ok := v.Interface().([]%[1]s) + if !ok { + // It is kind %[1]s but not type %[1]s. TODO: We can handle this unsafely. + return false + } + for _, x := range slice { + if x != %[3]s || state.sendZero { + %[4]s + } + } + return true +} +` diff --git a/src/encoding/gob/encode.go b/src/encoding/gob/encode.go new file mode 100644 index 0000000000000000000000000000000000000000..f66279f14134b505825c803f15483e89816493e9 --- /dev/null +++ b/src/encoding/gob/encode.go @@ -0,0 +1,696 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:generate go run encgen.go -output enc_helpers.go + +package gob + +import ( + "encoding" + "math" + "reflect" +) + +const uint64Size = 8 + +type encHelper func(state *encoderState, v reflect.Value) bool + +// encoderState is the global execution state of an instance of the encoder. +// Field numbers are delta encoded and always increase. The field +// number is initialized to -1 so 0 comes out as delta(1). A delta of +// 0 terminates the structure. +type encoderState struct { + enc *Encoder + b *encBuffer + sendZero bool // encoding an array element or map key/value pair; send zero values + fieldnum int // the last field number written. + buf [1 + uint64Size]byte // buffer used by the encoder; here to avoid allocation. + next *encoderState // for free list +} + +// encBuffer is an extremely simple, fast implementation of a write-only byte buffer. +// It never returns a non-nil error, but Write returns an error value so it matches io.Writer. +type encBuffer struct { + data []byte + scratch [64]byte +} + +func (e *encBuffer) WriteByte(c byte) { + e.data = append(e.data, c) +} + +func (e *encBuffer) Write(p []byte) (int, error) { + e.data = append(e.data, p...) + return len(p), nil +} + +func (e *encBuffer) WriteString(s string) { + e.data = append(e.data, s...) +} + +func (e *encBuffer) Len() int { + return len(e.data) +} + +func (e *encBuffer) Bytes() []byte { + return e.data +} + +func (e *encBuffer) Reset() { + e.data = e.data[0:0] +} + +func (enc *Encoder) newEncoderState(b *encBuffer) *encoderState { + e := enc.freeList + if e == nil { + e = new(encoderState) + e.enc = enc + } else { + enc.freeList = e.next + } + e.sendZero = false + e.fieldnum = 0 + e.b = b + if len(b.data) == 0 { + b.data = b.scratch[0:0] + } + return e +} + +func (enc *Encoder) freeEncoderState(e *encoderState) { + e.next = enc.freeList + enc.freeList = e +} + +// Unsigned integers have a two-state encoding. If the number is less +// than 128 (0 through 0x7F), its value is written directly. +// Otherwise the value is written in big-endian byte order preceded +// by the byte length, negated. + +// encodeUint writes an encoded unsigned integer to state.b. +func (state *encoderState) encodeUint(x uint64) { + if x <= 0x7F { + state.b.WriteByte(uint8(x)) + return + } + i := uint64Size + for x > 0 { + state.buf[i] = uint8(x) + x >>= 8 + i-- + } + state.buf[i] = uint8(i - uint64Size) // = loop count, negated + state.b.Write(state.buf[i : uint64Size+1]) +} + +// encodeInt writes an encoded signed integer to state.w. +// The low bit of the encoding says whether to bit complement the (other bits of the) +// uint to recover the int. +func (state *encoderState) encodeInt(i int64) { + var x uint64 + if i < 0 { + x = uint64(^i<<1) | 1 + } else { + x = uint64(i << 1) + } + state.encodeUint(uint64(x)) +} + +// encOp is the signature of an encoding operator for a given type. +type encOp func(i *encInstr, state *encoderState, v reflect.Value) + +// The 'instructions' of the encoding machine +type encInstr struct { + op encOp + field int // field number in input + index []int // struct index + indir int // how many pointer indirections to reach the value in the struct +} + +// update emits a field number and updates the state to record its value for delta encoding. +// If the instruction pointer is nil, it does nothing +func (state *encoderState) update(instr *encInstr) { + if instr != nil { + state.encodeUint(uint64(instr.field - state.fieldnum)) + state.fieldnum = instr.field + } +} + +// Each encoder for a composite is responsible for handling any +// indirections associated with the elements of the data structure. +// If any pointer so reached is nil, no bytes are written. If the +// data item is zero, no bytes are written. Single values - ints, +// strings etc. - are indirected before calling their encoders. +// Otherwise, the output (for a scalar) is the field number, as an +// encoded integer, followed by the field data in its appropriate +// format. + +// encIndirect dereferences pv indir times and returns the result. +func encIndirect(pv reflect.Value, indir int) reflect.Value { + for ; indir > 0; indir-- { + if pv.IsNil() { + break + } + pv = pv.Elem() + } + return pv +} + +// encBool encodes the bool referenced by v as an unsigned 0 or 1. +func encBool(i *encInstr, state *encoderState, v reflect.Value) { + b := v.Bool() + if b || state.sendZero { + state.update(i) + if b { + state.encodeUint(1) + } else { + state.encodeUint(0) + } + } +} + +// encInt encodes the signed integer (int int8 int16 int32 int64) referenced by v. +func encInt(i *encInstr, state *encoderState, v reflect.Value) { + value := v.Int() + if value != 0 || state.sendZero { + state.update(i) + state.encodeInt(value) + } +} + +// encUint encodes the unsigned integer (uint uint8 uint16 uint32 uint64 uintptr) referenced by v. +func encUint(i *encInstr, state *encoderState, v reflect.Value) { + value := v.Uint() + if value != 0 || state.sendZero { + state.update(i) + state.encodeUint(value) + } +} + +// floatBits returns a uint64 holding the bits of a floating-point number. +// Floating-point numbers are transmitted as uint64s holding the bits +// of the underlying representation. They are sent byte-reversed, with +// the exponent end coming out first, so integer floating point numbers +// (for example) transmit more compactly. This routine does the +// swizzling. +func floatBits(f float64) uint64 { + u := math.Float64bits(f) + var v uint64 + for i := 0; i < 8; i++ { + v <<= 8 + v |= u & 0xFF + u >>= 8 + } + return v +} + +// encFloat encodes the floating point value (float32 float64) referenced by v. +func encFloat(i *encInstr, state *encoderState, v reflect.Value) { + f := v.Float() + if f != 0 || state.sendZero { + bits := floatBits(f) + state.update(i) + state.encodeUint(bits) + } +} + +// encComplex encodes the complex value (complex64 complex128) referenced by v. +// Complex numbers are just a pair of floating-point numbers, real part first. +func encComplex(i *encInstr, state *encoderState, v reflect.Value) { + c := v.Complex() + if c != 0+0i || state.sendZero { + rpart := floatBits(real(c)) + ipart := floatBits(imag(c)) + state.update(i) + state.encodeUint(rpart) + state.encodeUint(ipart) + } +} + +// encUint8Array encodes the byte array referenced by v. +// Byte arrays are encoded as an unsigned count followed by the raw bytes. +func encUint8Array(i *encInstr, state *encoderState, v reflect.Value) { + b := v.Bytes() + if len(b) > 0 || state.sendZero { + state.update(i) + state.encodeUint(uint64(len(b))) + state.b.Write(b) + } +} + +// encString encodes the string referenced by v. +// Strings are encoded as an unsigned count followed by the raw bytes. +func encString(i *encInstr, state *encoderState, v reflect.Value) { + s := v.String() + if len(s) > 0 || state.sendZero { + state.update(i) + state.encodeUint(uint64(len(s))) + state.b.WriteString(s) + } +} + +// encStructTerminator encodes the end of an encoded struct +// as delta field number of 0. +func encStructTerminator(i *encInstr, state *encoderState, v reflect.Value) { + state.encodeUint(0) +} + +// Execution engine + +// encEngine an array of instructions indexed by field number of the encoding +// data, typically a struct. It is executed top to bottom, walking the struct. +type encEngine struct { + instr []encInstr +} + +const singletonField = 0 + +// valid reports whether the value is valid and a non-nil pointer. +// (Slices, maps, and chans take care of themselves.) +func valid(v reflect.Value) bool { + switch v.Kind() { + case reflect.Invalid: + return false + case reflect.Ptr: + return !v.IsNil() + } + return true +} + +// encodeSingle encodes a single top-level non-struct value. +func (enc *Encoder) encodeSingle(b *encBuffer, engine *encEngine, value reflect.Value) { + state := enc.newEncoderState(b) + defer enc.freeEncoderState(state) + state.fieldnum = singletonField + // There is no surrounding struct to frame the transmission, so we must + // generate data even if the item is zero. To do this, set sendZero. + state.sendZero = true + instr := &engine.instr[singletonField] + if instr.indir > 0 { + value = encIndirect(value, instr.indir) + } + if valid(value) { + instr.op(instr, state, value) + } +} + +// encodeStruct encodes a single struct value. +func (enc *Encoder) encodeStruct(b *encBuffer, engine *encEngine, value reflect.Value) { + if !valid(value) { + return + } + state := enc.newEncoderState(b) + defer enc.freeEncoderState(state) + state.fieldnum = -1 + for i := 0; i < len(engine.instr); i++ { + instr := &engine.instr[i] + if i >= value.NumField() { + // encStructTerminator + instr.op(instr, state, reflect.Value{}) + break + } + field := value.FieldByIndex(instr.index) + if instr.indir > 0 { + field = encIndirect(field, instr.indir) + // TODO: Is field guaranteed valid? If so we could avoid this check. + if !valid(field) { + continue + } + } + instr.op(instr, state, field) + } +} + +// encodeArray encodes an array. +func (enc *Encoder) encodeArray(b *encBuffer, value reflect.Value, op encOp, elemIndir int, length int, helper encHelper) { + state := enc.newEncoderState(b) + defer enc.freeEncoderState(state) + state.fieldnum = -1 + state.sendZero = true + state.encodeUint(uint64(length)) + if helper != nil && helper(state, value) { + return + } + for i := 0; i < length; i++ { + elem := value.Index(i) + if elemIndir > 0 { + elem = encIndirect(elem, elemIndir) + // TODO: Is elem guaranteed valid? If so we could avoid this check. + if !valid(elem) { + errorf("encodeArray: nil element") + } + } + op(nil, state, elem) + } +} + +// encodeReflectValue is a helper for maps. It encodes the value v. +func encodeReflectValue(state *encoderState, v reflect.Value, op encOp, indir int) { + for i := 0; i < indir && v.IsValid(); i++ { + v = reflect.Indirect(v) + } + if !v.IsValid() { + errorf("encodeReflectValue: nil element") + } + op(nil, state, v) +} + +// encodeMap encodes a map as unsigned count followed by key:value pairs. +func (enc *Encoder) encodeMap(b *encBuffer, mv reflect.Value, keyOp, elemOp encOp, keyIndir, elemIndir int) { + state := enc.newEncoderState(b) + state.fieldnum = -1 + state.sendZero = true + keys := mv.MapKeys() + state.encodeUint(uint64(len(keys))) + for _, key := range keys { + encodeReflectValue(state, key, keyOp, keyIndir) + encodeReflectValue(state, mv.MapIndex(key), elemOp, elemIndir) + } + enc.freeEncoderState(state) +} + +// encodeInterface encodes the interface value iv. +// To send an interface, we send a string identifying the concrete type, followed +// by the type identifier (which might require defining that type right now), followed +// by the concrete value. A nil value gets sent as the empty string for the name, +// followed by no value. +func (enc *Encoder) encodeInterface(b *encBuffer, iv reflect.Value) { + // Gobs can encode nil interface values but not typed interface + // values holding nil pointers, since nil pointers point to no value. + elem := iv.Elem() + if elem.Kind() == reflect.Ptr && elem.IsNil() { + errorf("gob: cannot encode nil pointer of type %s inside interface", iv.Elem().Type()) + } + state := enc.newEncoderState(b) + state.fieldnum = -1 + state.sendZero = true + if iv.IsNil() { + state.encodeUint(0) + return + } + + ut := userType(iv.Elem().Type()) + registerLock.RLock() + name, ok := concreteTypeToName[ut.base] + registerLock.RUnlock() + if !ok { + errorf("type not registered for interface: %s", ut.base) + } + // Send the name. + state.encodeUint(uint64(len(name))) + state.b.WriteString(name) + // Define the type id if necessary. + enc.sendTypeDescriptor(enc.writer(), state, ut) + // Send the type id. + enc.sendTypeId(state, ut) + // Encode the value into a new buffer. Any nested type definitions + // should be written to b, before the encoded value. + enc.pushWriter(b) + data := new(encBuffer) + data.Write(spaceForLength) + enc.encode(data, elem, ut) + if enc.err != nil { + error_(enc.err) + } + enc.popWriter() + enc.writeMessage(b, data) + if enc.err != nil { + error_(enc.err) + } + enc.freeEncoderState(state) +} + +// isZero reports whether the value is the zero of its type. +func isZero(val reflect.Value) bool { + switch val.Kind() { + case reflect.Array: + for i := 0; i < val.Len(); i++ { + if !isZero(val.Index(i)) { + return false + } + } + return true + case reflect.Map, reflect.Slice, reflect.String: + return val.Len() == 0 + case reflect.Bool: + return !val.Bool() + case reflect.Complex64, reflect.Complex128: + return val.Complex() == 0 + case reflect.Chan, reflect.Func, reflect.Interface, reflect.Ptr: + return val.IsNil() + case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: + return val.Int() == 0 + case reflect.Float32, reflect.Float64: + return val.Float() == 0 + case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: + return val.Uint() == 0 + case reflect.Struct: + for i := 0; i < val.NumField(); i++ { + if !isZero(val.Field(i)) { + return false + } + } + return true + } + panic("unknown type in isZero " + val.Type().String()) +} + +// encGobEncoder encodes a value that implements the GobEncoder interface. +// The data is sent as a byte array. +func (enc *Encoder) encodeGobEncoder(b *encBuffer, ut *userTypeInfo, v reflect.Value) { + // TODO: should we catch panics from the called method? + + var data []byte + var err error + // We know it's one of these. + switch ut.externalEnc { + case xGob: + data, err = v.Interface().(GobEncoder).GobEncode() + case xBinary: + data, err = v.Interface().(encoding.BinaryMarshaler).MarshalBinary() + case xText: + data, err = v.Interface().(encoding.TextMarshaler).MarshalText() + } + if err != nil { + error_(err) + } + state := enc.newEncoderState(b) + state.fieldnum = -1 + state.encodeUint(uint64(len(data))) + state.b.Write(data) + enc.freeEncoderState(state) +} + +var encOpTable = [...]encOp{ + reflect.Bool: encBool, + reflect.Int: encInt, + reflect.Int8: encInt, + reflect.Int16: encInt, + reflect.Int32: encInt, + reflect.Int64: encInt, + reflect.Uint: encUint, + reflect.Uint8: encUint, + reflect.Uint16: encUint, + reflect.Uint32: encUint, + reflect.Uint64: encUint, + reflect.Uintptr: encUint, + reflect.Float32: encFloat, + reflect.Float64: encFloat, + reflect.Complex64: encComplex, + reflect.Complex128: encComplex, + reflect.String: encString, +} + +// encOpFor returns (a pointer to) the encoding op for the base type under rt and +// the indirection count to reach it. +func encOpFor(rt reflect.Type, inProgress map[reflect.Type]*encOp, building map[*typeInfo]bool) (*encOp, int) { + ut := userType(rt) + // If the type implements GobEncoder, we handle it without further processing. + if ut.externalEnc != 0 { + return gobEncodeOpFor(ut) + } + // If this type is already in progress, it's a recursive type (e.g. map[string]*T). + // Return the pointer to the op we're already building. + if opPtr := inProgress[rt]; opPtr != nil { + return opPtr, ut.indir + } + typ := ut.base + indir := ut.indir + k := typ.Kind() + var op encOp + if int(k) < len(encOpTable) { + op = encOpTable[k] + } + if op == nil { + inProgress[rt] = &op + // Special cases + switch t := typ; t.Kind() { + case reflect.Slice: + if t.Elem().Kind() == reflect.Uint8 { + op = encUint8Array + break + } + // Slices have a header; we decode it to find the underlying array. + elemOp, elemIndir := encOpFor(t.Elem(), inProgress, building) + helper := encSliceHelper[t.Elem().Kind()] + op = func(i *encInstr, state *encoderState, slice reflect.Value) { + if !state.sendZero && slice.Len() == 0 { + return + } + state.update(i) + state.enc.encodeArray(state.b, slice, *elemOp, elemIndir, slice.Len(), helper) + } + case reflect.Array: + // True arrays have size in the type. + elemOp, elemIndir := encOpFor(t.Elem(), inProgress, building) + helper := encArrayHelper[t.Elem().Kind()] + op = func(i *encInstr, state *encoderState, array reflect.Value) { + state.update(i) + state.enc.encodeArray(state.b, array, *elemOp, elemIndir, array.Len(), helper) + } + case reflect.Map: + keyOp, keyIndir := encOpFor(t.Key(), inProgress, building) + elemOp, elemIndir := encOpFor(t.Elem(), inProgress, building) + op = func(i *encInstr, state *encoderState, mv reflect.Value) { + // We send zero-length (but non-nil) maps because the + // receiver might want to use the map. (Maps don't use append.) + if !state.sendZero && mv.IsNil() { + return + } + state.update(i) + state.enc.encodeMap(state.b, mv, *keyOp, *elemOp, keyIndir, elemIndir) + } + case reflect.Struct: + // Generate a closure that calls out to the engine for the nested type. + getEncEngine(userType(typ), building) + info := mustGetTypeInfo(typ) + op = func(i *encInstr, state *encoderState, sv reflect.Value) { + state.update(i) + // indirect through info to delay evaluation for recursive structs + enc := info.encoder.Load().(*encEngine) + state.enc.encodeStruct(state.b, enc, sv) + } + case reflect.Interface: + op = func(i *encInstr, state *encoderState, iv reflect.Value) { + if !state.sendZero && (!iv.IsValid() || iv.IsNil()) { + return + } + state.update(i) + state.enc.encodeInterface(state.b, iv) + } + } + } + if op == nil { + errorf("can't happen: encode type %s", rt) + } + return &op, indir +} + +// gobEncodeOpFor returns the op for a type that is known to implement GobEncoder. +func gobEncodeOpFor(ut *userTypeInfo) (*encOp, int) { + rt := ut.user + if ut.encIndir == -1 { + rt = reflect.PtrTo(rt) + } else if ut.encIndir > 0 { + for i := int8(0); i < ut.encIndir; i++ { + rt = rt.Elem() + } + } + var op encOp + op = func(i *encInstr, state *encoderState, v reflect.Value) { + if ut.encIndir == -1 { + // Need to climb up one level to turn value into pointer. + if !v.CanAddr() { + errorf("unaddressable value of type %s", rt) + } + v = v.Addr() + } + if !state.sendZero && isZero(v) { + return + } + state.update(i) + state.enc.encodeGobEncoder(state.b, ut, v) + } + return &op, int(ut.encIndir) // encIndir: op will get called with p == address of receiver. +} + +// compileEnc returns the engine to compile the type. +func compileEnc(ut *userTypeInfo, building map[*typeInfo]bool) *encEngine { + srt := ut.base + engine := new(encEngine) + seen := make(map[reflect.Type]*encOp) + rt := ut.base + if ut.externalEnc != 0 { + rt = ut.user + } + if ut.externalEnc == 0 && srt.Kind() == reflect.Struct { + for fieldNum, wireFieldNum := 0, 0; fieldNum < srt.NumField(); fieldNum++ { + f := srt.Field(fieldNum) + if !isSent(&f) { + continue + } + op, indir := encOpFor(f.Type, seen, building) + engine.instr = append(engine.instr, encInstr{*op, wireFieldNum, f.Index, indir}) + wireFieldNum++ + } + if srt.NumField() > 0 && len(engine.instr) == 0 { + errorf("type %s has no exported fields", rt) + } + engine.instr = append(engine.instr, encInstr{encStructTerminator, 0, nil, 0}) + } else { + engine.instr = make([]encInstr, 1) + op, indir := encOpFor(rt, seen, building) + engine.instr[0] = encInstr{*op, singletonField, nil, indir} + } + return engine +} + +// getEncEngine returns the engine to compile the type. +func getEncEngine(ut *userTypeInfo, building map[*typeInfo]bool) *encEngine { + info, err := getTypeInfo(ut) + if err != nil { + error_(err) + } + enc, ok := info.encoder.Load().(*encEngine) + if !ok { + enc = buildEncEngine(info, ut, building) + } + return enc +} + +func buildEncEngine(info *typeInfo, ut *userTypeInfo, building map[*typeInfo]bool) *encEngine { + // Check for recursive types. + if building != nil && building[info] { + return nil + } + info.encInit.Lock() + defer info.encInit.Unlock() + enc, ok := info.encoder.Load().(*encEngine) + if !ok { + if building == nil { + building = make(map[*typeInfo]bool) + } + building[info] = true + enc = compileEnc(ut, building) + info.encoder.Store(enc) + } + return enc +} + +func (enc *Encoder) encode(b *encBuffer, value reflect.Value, ut *userTypeInfo) { + defer catchError(&enc.err) + engine := getEncEngine(ut, nil) + indir := ut.indir + if ut.externalEnc != 0 { + indir = int(ut.encIndir) + } + for i := 0; i < indir; i++ { + value = reflect.Indirect(value) + } + if ut.externalEnc == 0 && value.Type().Kind() == reflect.Struct { + enc.encodeStruct(b, engine, value) + } else { + enc.encodeSingle(b, engine, value) + } +} diff --git a/src/encoding/gob/encoder.go b/src/encoding/gob/encoder.go new file mode 100644 index 0000000000000000000000000000000000000000..62d0f42e81ae3fc8f7bbdd692bfc31427803a68d --- /dev/null +++ b/src/encoding/gob/encoder.go @@ -0,0 +1,254 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package gob + +import ( + "errors" + "io" + "reflect" + "sync" +) + +// An Encoder manages the transmission of type and data information to the +// other side of a connection. +type Encoder struct { + mutex sync.Mutex // each item must be sent atomically + w []io.Writer // where to send the data + sent map[reflect.Type]typeId // which types we've already sent + countState *encoderState // stage for writing counts + freeList *encoderState // list of free encoderStates; avoids reallocation + byteBuf encBuffer // buffer for top-level encoderState + err error +} + +// Before we encode a message, we reserve space at the head of the +// buffer in which to encode its length. This means we can use the +// buffer to assemble the message without another allocation. +const maxLength = 9 // Maximum size of an encoded length. +var spaceForLength = make([]byte, maxLength) + +// NewEncoder returns a new encoder that will transmit on the io.Writer. +func NewEncoder(w io.Writer) *Encoder { + enc := new(Encoder) + enc.w = []io.Writer{w} + enc.sent = make(map[reflect.Type]typeId) + enc.countState = enc.newEncoderState(new(encBuffer)) + return enc +} + +// writer() returns the innermost writer the encoder is using +func (enc *Encoder) writer() io.Writer { + return enc.w[len(enc.w)-1] +} + +// pushWriter adds a writer to the encoder. +func (enc *Encoder) pushWriter(w io.Writer) { + enc.w = append(enc.w, w) +} + +// popWriter pops the innermost writer. +func (enc *Encoder) popWriter() { + enc.w = enc.w[0 : len(enc.w)-1] +} + +func (enc *Encoder) setError(err error) { + if enc.err == nil { // remember the first. + enc.err = err + } +} + +// writeMessage sends the data item preceded by a unsigned count of its length. +func (enc *Encoder) writeMessage(w io.Writer, b *encBuffer) { + // Space has been reserved for the length at the head of the message. + // This is a little dirty: we grab the slice from the bytes.Buffer and massage + // it by hand. + message := b.Bytes() + messageLen := len(message) - maxLength + // Length cannot be bigger than the decoder can handle. + if messageLen >= tooBig { + enc.setError(errors.New("gob: encoder: message too big")) + return + } + // Encode the length. + enc.countState.b.Reset() + enc.countState.encodeUint(uint64(messageLen)) + // Copy the length to be a prefix of the message. + offset := maxLength - enc.countState.b.Len() + copy(message[offset:], enc.countState.b.Bytes()) + // Write the data. + _, err := w.Write(message[offset:]) + // Drain the buffer and restore the space at the front for the count of the next message. + b.Reset() + b.Write(spaceForLength) + if err != nil { + enc.setError(err) + } +} + +// sendActualType sends the requested type, without further investigation, unless +// it's been sent before. +func (enc *Encoder) sendActualType(w io.Writer, state *encoderState, ut *userTypeInfo, actual reflect.Type) (sent bool) { + if _, alreadySent := enc.sent[actual]; alreadySent { + return false + } + info, err := getTypeInfo(ut) + if err != nil { + enc.setError(err) + return + } + // Send the pair (-id, type) + // Id: + state.encodeInt(-int64(info.id)) + // Type: + enc.encode(state.b, reflect.ValueOf(info.wire), wireTypeUserInfo) + enc.writeMessage(w, state.b) + if enc.err != nil { + return + } + + // Remember we've sent this type, both what the user gave us and the base type. + enc.sent[ut.base] = info.id + if ut.user != ut.base { + enc.sent[ut.user] = info.id + } + // Now send the inner types + switch st := actual; st.Kind() { + case reflect.Struct: + for i := 0; i < st.NumField(); i++ { + if isExported(st.Field(i).Name) { + enc.sendType(w, state, st.Field(i).Type) + } + } + case reflect.Array, reflect.Slice: + enc.sendType(w, state, st.Elem()) + case reflect.Map: + enc.sendType(w, state, st.Key()) + enc.sendType(w, state, st.Elem()) + } + return true +} + +// sendType sends the type info to the other side, if necessary. +func (enc *Encoder) sendType(w io.Writer, state *encoderState, origt reflect.Type) (sent bool) { + ut := userType(origt) + if ut.externalEnc != 0 { + // The rules are different: regardless of the underlying type's representation, + // we need to tell the other side that the base type is a GobEncoder. + return enc.sendActualType(w, state, ut, ut.base) + } + + // It's a concrete value, so drill down to the base type. + switch rt := ut.base; rt.Kind() { + default: + // Basic types and interfaces do not need to be described. + return + case reflect.Slice: + // If it's []uint8, don't send; it's considered basic. + if rt.Elem().Kind() == reflect.Uint8 { + return + } + // Otherwise we do send. + break + case reflect.Array: + // arrays must be sent so we know their lengths and element types. + break + case reflect.Map: + // maps must be sent so we know their lengths and key/value types. + break + case reflect.Struct: + // structs must be sent so we know their fields. + break + case reflect.Chan, reflect.Func: + // If we get here, it's a field of a struct; ignore it. + return + } + + return enc.sendActualType(w, state, ut, ut.base) +} + +// Encode transmits the data item represented by the empty interface value, +// guaranteeing that all necessary type information has been transmitted first. +func (enc *Encoder) Encode(e interface{}) error { + return enc.EncodeValue(reflect.ValueOf(e)) +} + +// sendTypeDescriptor makes sure the remote side knows about this type. +// It will send a descriptor if this is the first time the type has been +// sent. +func (enc *Encoder) sendTypeDescriptor(w io.Writer, state *encoderState, ut *userTypeInfo) { + // Make sure the type is known to the other side. + // First, have we already sent this type? + rt := ut.base + if ut.externalEnc != 0 { + rt = ut.user + } + if _, alreadySent := enc.sent[rt]; !alreadySent { + // No, so send it. + sent := enc.sendType(w, state, rt) + if enc.err != nil { + return + } + // If the type info has still not been transmitted, it means we have + // a singleton basic type (int, []byte etc.) at top level. We don't + // need to send the type info but we do need to update enc.sent. + if !sent { + info, err := getTypeInfo(ut) + if err != nil { + enc.setError(err) + return + } + enc.sent[rt] = info.id + } + } +} + +// sendTypeId sends the id, which must have already been defined. +func (enc *Encoder) sendTypeId(state *encoderState, ut *userTypeInfo) { + // Identify the type of this top-level value. + state.encodeInt(int64(enc.sent[ut.base])) +} + +// EncodeValue transmits the data item represented by the reflection value, +// guaranteeing that all necessary type information has been transmitted first. +func (enc *Encoder) EncodeValue(value reflect.Value) error { + // Gobs contain values. They cannot represent nil pointers, which + // have no value to encode. + if value.Kind() == reflect.Ptr && value.IsNil() { + panic("gob: cannot encode nil pointer of type " + value.Type().String()) + } + + // Make sure we're single-threaded through here, so multiple + // goroutines can share an encoder. + enc.mutex.Lock() + defer enc.mutex.Unlock() + + // Remove any nested writers remaining due to previous errors. + enc.w = enc.w[0:1] + + ut, err := validUserType(value.Type()) + if err != nil { + return err + } + + enc.err = nil + enc.byteBuf.Reset() + enc.byteBuf.Write(spaceForLength) + state := enc.newEncoderState(&enc.byteBuf) + + enc.sendTypeDescriptor(enc.writer(), state, ut) + enc.sendTypeId(state, ut) + if enc.err != nil { + return enc.err + } + + // Encode the object. + enc.encode(state.b, value, ut) + if enc.err == nil { + enc.writeMessage(enc.writer(), state.b) + } + + enc.freeEncoderState(state) + return enc.err +} diff --git a/src/encoding/gob/encoder_test.go b/src/encoding/gob/encoder_test.go new file mode 100644 index 0000000000000000000000000000000000000000..dc657348223ce005dc3055ea9d68da918a3697fc --- /dev/null +++ b/src/encoding/gob/encoder_test.go @@ -0,0 +1,1020 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package gob + +import ( + "bytes" + "encoding/hex" + "fmt" + "reflect" + "strings" + "testing" +) + +// Test basic operations in a safe manner. +func TestBasicEncoderDecoder(t *testing.T) { + var values = []interface{}{ + true, + int(123), + int8(123), + int16(-12345), + int32(123456), + int64(-1234567), + uint(123), + uint8(123), + uint16(12345), + uint32(123456), + uint64(1234567), + uintptr(12345678), + float32(1.2345), + float64(1.2345678), + complex64(1.2345 + 2.3456i), + complex128(1.2345678 + 2.3456789i), + []byte("hello"), + string("hello"), + } + for _, value := range values { + b := new(bytes.Buffer) + enc := NewEncoder(b) + err := enc.Encode(value) + if err != nil { + t.Error("encoder fail:", err) + } + dec := NewDecoder(b) + result := reflect.New(reflect.TypeOf(value)) + err = dec.Decode(result.Interface()) + if err != nil { + t.Fatalf("error decoding %T: %v:", reflect.TypeOf(value), err) + } + if !reflect.DeepEqual(value, result.Elem().Interface()) { + t.Fatalf("%T: expected %v got %v", value, value, result.Elem().Interface()) + } + } +} + +type ET0 struct { + A int + B string +} + +type ET2 struct { + X string +} + +type ET1 struct { + A int + Et2 *ET2 + Next *ET1 +} + +// Like ET1 but with a different name for a field +type ET3 struct { + A int + Et2 *ET2 + DifferentNext *ET1 +} + +// Like ET1 but with a different type for a field +type ET4 struct { + A int + Et2 float64 + Next int +} + +func TestEncoderDecoder(t *testing.T) { + b := new(bytes.Buffer) + enc := NewEncoder(b) + et0 := new(ET0) + et0.A = 7 + et0.B = "gobs of fun" + err := enc.Encode(et0) + if err != nil { + t.Error("encoder fail:", err) + } + //fmt.Printf("% x %q\n", b, b) + //Debug(b) + dec := NewDecoder(b) + newEt0 := new(ET0) + err = dec.Decode(newEt0) + if err != nil { + t.Fatal("error decoding ET0:", err) + } + + if !reflect.DeepEqual(et0, newEt0) { + t.Fatalf("invalid data for et0: expected %+v; got %+v", *et0, *newEt0) + } + if b.Len() != 0 { + t.Error("not at eof;", b.Len(), "bytes left") + } + // t.FailNow() + + b = new(bytes.Buffer) + enc = NewEncoder(b) + et1 := new(ET1) + et1.A = 7 + et1.Et2 = new(ET2) + err = enc.Encode(et1) + if err != nil { + t.Error("encoder fail:", err) + } + dec = NewDecoder(b) + newEt1 := new(ET1) + err = dec.Decode(newEt1) + if err != nil { + t.Fatal("error decoding ET1:", err) + } + + if !reflect.DeepEqual(et1, newEt1) { + t.Fatalf("invalid data for et1: expected %+v; got %+v", *et1, *newEt1) + } + if b.Len() != 0 { + t.Error("not at eof;", b.Len(), "bytes left") + } + + enc.Encode(et1) + newEt1 = new(ET1) + err = dec.Decode(newEt1) + if err != nil { + t.Fatal("round 2: error decoding ET1:", err) + } + if !reflect.DeepEqual(et1, newEt1) { + t.Fatalf("round 2: invalid data for et1: expected %+v; got %+v", *et1, *newEt1) + } + if b.Len() != 0 { + t.Error("round 2: not at eof;", b.Len(), "bytes left") + } + + // Now test with a running encoder/decoder pair that we recognize a type mismatch. + err = enc.Encode(et1) + if err != nil { + t.Error("round 3: encoder fail:", err) + } + newEt2 := new(ET2) + err = dec.Decode(newEt2) + if err == nil { + t.Fatal("round 3: expected `bad type' error decoding ET2") + } +} + +// Run one value through the encoder/decoder, but use the wrong type. +// Input is always an ET1; we compare it to whatever is under 'e'. +func badTypeCheck(e interface{}, shouldFail bool, msg string, t *testing.T) { + b := new(bytes.Buffer) + enc := NewEncoder(b) + et1 := new(ET1) + et1.A = 7 + et1.Et2 = new(ET2) + err := enc.Encode(et1) + if err != nil { + t.Error("encoder fail:", err) + } + dec := NewDecoder(b) + err = dec.Decode(e) + if shouldFail && err == nil { + t.Error("expected error for", msg) + } + if !shouldFail && err != nil { + t.Error("unexpected error for", msg, err) + } +} + +// Test that we recognize a bad type the first time. +func TestWrongTypeDecoder(t *testing.T) { + badTypeCheck(new(ET2), true, "no fields in common", t) + badTypeCheck(new(ET3), false, "different name of field", t) + badTypeCheck(new(ET4), true, "different type of field", t) +} + +// Types not supported at top level by the Encoder. +var unsupportedValues = []interface{}{ + make(chan int), + func(a int) bool { return true }, +} + +func TestUnsupported(t *testing.T) { + var b bytes.Buffer + enc := NewEncoder(&b) + for _, v := range unsupportedValues { + err := enc.Encode(v) + if err == nil { + t.Errorf("expected error for %T; got none", v) + } + } +} + +func encAndDec(in, out interface{}) error { + b := new(bytes.Buffer) + enc := NewEncoder(b) + err := enc.Encode(in) + if err != nil { + return err + } + dec := NewDecoder(b) + err = dec.Decode(out) + if err != nil { + return err + } + return nil +} + +func TestTypeToPtrType(t *testing.T) { + // Encode a T, decode a *T + type Type0 struct { + A int + } + t0 := Type0{7} + t0p := new(Type0) + if err := encAndDec(t0, t0p); err != nil { + t.Error(err) + } +} + +func TestPtrTypeToType(t *testing.T) { + // Encode a *T, decode a T + type Type1 struct { + A uint + } + t1p := &Type1{17} + var t1 Type1 + if err := encAndDec(t1, t1p); err != nil { + t.Error(err) + } +} + +func TestTypeToPtrPtrPtrPtrType(t *testing.T) { + type Type2 struct { + A ****float64 + } + t2 := Type2{} + t2.A = new(***float64) + *t2.A = new(**float64) + **t2.A = new(*float64) + ***t2.A = new(float64) + ****t2.A = 27.4 + t2pppp := new(***Type2) + if err := encAndDec(t2, t2pppp); err != nil { + t.Fatal(err) + } + if ****(****t2pppp).A != ****t2.A { + t.Errorf("wrong value after decode: %g not %g", ****(****t2pppp).A, ****t2.A) + } +} + +func TestSlice(t *testing.T) { + type Type3 struct { + A []string + } + t3p := &Type3{[]string{"hello", "world"}} + var t3 Type3 + if err := encAndDec(t3, t3p); err != nil { + t.Error(err) + } +} + +func TestValueError(t *testing.T) { + // Encode a *T, decode a T + type Type4 struct { + A int + } + t4p := &Type4{3} + var t4 Type4 // note: not a pointer. + if err := encAndDec(t4p, t4); err == nil || strings.Index(err.Error(), "pointer") < 0 { + t.Error("expected error about pointer; got", err) + } +} + +func TestArray(t *testing.T) { + type Type5 struct { + A [3]string + B [3]byte + } + type Type6 struct { + A [2]string // can't hold t5.a + } + t5 := Type5{[3]string{"hello", ",", "world"}, [3]byte{1, 2, 3}} + var t5p Type5 + if err := encAndDec(t5, &t5p); err != nil { + t.Error(err) + } + var t6 Type6 + if err := encAndDec(t5, &t6); err == nil { + t.Error("should fail with mismatched array sizes") + } +} + +func TestRecursiveMapType(t *testing.T) { + type recursiveMap map[string]recursiveMap + r1 := recursiveMap{"A": recursiveMap{"B": nil, "C": nil}, "D": nil} + r2 := make(recursiveMap) + if err := encAndDec(r1, &r2); err != nil { + t.Error(err) + } +} + +func TestRecursiveSliceType(t *testing.T) { + type recursiveSlice []recursiveSlice + r1 := recursiveSlice{0: recursiveSlice{0: nil}, 1: nil} + r2 := make(recursiveSlice, 0) + if err := encAndDec(r1, &r2); err != nil { + t.Error(err) + } +} + +// Regression test for bug: must send zero values inside arrays +func TestDefaultsInArray(t *testing.T) { + type Type7 struct { + B []bool + I []int + S []string + F []float64 + } + t7 := Type7{ + []bool{false, false, true}, + []int{0, 0, 1}, + []string{"hi", "", "there"}, + []float64{0, 0, 1}, + } + var t7p Type7 + if err := encAndDec(t7, &t7p); err != nil { + t.Error(err) + } +} + +var testInt int +var testFloat32 float32 +var testString string +var testSlice []string +var testMap map[string]int +var testArray [7]int + +type SingleTest struct { + in interface{} + out interface{} + err string +} + +var singleTests = []SingleTest{ + {17, &testInt, ""}, + {float32(17.5), &testFloat32, ""}, + {"bike shed", &testString, ""}, + {[]string{"bike", "shed", "paint", "color"}, &testSlice, ""}, + {map[string]int{"seven": 7, "twelve": 12}, &testMap, ""}, + {[7]int{4, 55, 0, 0, 0, 0, 0}, &testArray, ""}, // case that once triggered a bug + {[7]int{4, 55, 1, 44, 22, 66, 1234}, &testArray, ""}, + + // Decode errors + {172, &testFloat32, "type"}, +} + +func TestSingletons(t *testing.T) { + b := new(bytes.Buffer) + enc := NewEncoder(b) + dec := NewDecoder(b) + for _, test := range singleTests { + b.Reset() + err := enc.Encode(test.in) + if err != nil { + t.Errorf("error encoding %v: %s", test.in, err) + continue + } + err = dec.Decode(test.out) + switch { + case err != nil && test.err == "": + t.Errorf("error decoding %v: %s", test.in, err) + continue + case err == nil && test.err != "": + t.Errorf("expected error decoding %v: %s", test.in, test.err) + continue + case err != nil && test.err != "": + if strings.Index(err.Error(), test.err) < 0 { + t.Errorf("wrong error decoding %v: wanted %s, got %v", test.in, test.err, err) + } + continue + } + // Get rid of the pointer in the rhs + val := reflect.ValueOf(test.out).Elem().Interface() + if !reflect.DeepEqual(test.in, val) { + t.Errorf("decoding singleton: expected %v got %v", test.in, val) + } + } +} + +func TestStructNonStruct(t *testing.T) { + type Struct struct { + A string + } + type NonStruct string + s := Struct{"hello"} + var sp Struct + if err := encAndDec(s, &sp); err != nil { + t.Error(err) + } + var ns NonStruct + if err := encAndDec(s, &ns); err == nil { + t.Error("should get error for struct/non-struct") + } else if strings.Index(err.Error(), "type") < 0 { + t.Error("for struct/non-struct expected type error; got", err) + } + // Now try the other way + var nsp NonStruct + if err := encAndDec(ns, &nsp); err != nil { + t.Error(err) + } + if err := encAndDec(ns, &s); err == nil { + t.Error("should get error for non-struct/struct") + } else if strings.Index(err.Error(), "type") < 0 { + t.Error("for non-struct/struct expected type error; got", err) + } +} + +type interfaceIndirectTestI interface { + F() bool +} + +type interfaceIndirectTestT struct{} + +func (this *interfaceIndirectTestT) F() bool { + return true +} + +// A version of a bug reported on golang-nuts. Also tests top-level +// slice of interfaces. The issue was registering *T caused T to be +// stored as the concrete type. +func TestInterfaceIndirect(t *testing.T) { + Register(&interfaceIndirectTestT{}) + b := new(bytes.Buffer) + w := []interfaceIndirectTestI{&interfaceIndirectTestT{}} + err := NewEncoder(b).Encode(w) + if err != nil { + t.Fatal("encode error:", err) + } + + var r []interfaceIndirectTestI + err = NewDecoder(b).Decode(&r) + if err != nil { + t.Fatal("decode error:", err) + } +} + +// Now follow various tests that decode into things that can't represent the +// encoded value, all of which should be legal. + +// Also, when the ignored object contains an interface value, it may define +// types. Make sure that skipping the value still defines the types by using +// the encoder/decoder pair to send a value afterwards. If an interface +// is sent, its type in the test is always NewType0, so this checks that the +// encoder and decoder don't skew with respect to type definitions. + +type Struct0 struct { + I interface{} +} + +type NewType0 struct { + S string +} + +type ignoreTest struct { + in, out interface{} +} + +var ignoreTests = []ignoreTest{ + // Decode normal struct into an empty struct + {&struct{ A int }{23}, &struct{}{}}, + // Decode normal struct into a nil. + {&struct{ A int }{23}, nil}, + // Decode singleton string into a nil. + {"hello, world", nil}, + // Decode singleton slice into a nil. + {[]int{1, 2, 3, 4}, nil}, + // Decode struct containing an interface into a nil. + {&Struct0{&NewType0{"value0"}}, nil}, + // Decode singleton slice of interfaces into a nil. + {[]interface{}{"hi", &NewType0{"value1"}, 23}, nil}, +} + +func TestDecodeIntoNothing(t *testing.T) { + Register(new(NewType0)) + for i, test := range ignoreTests { + b := new(bytes.Buffer) + enc := NewEncoder(b) + err := enc.Encode(test.in) + if err != nil { + t.Errorf("%d: encode error %s:", i, err) + continue + } + dec := NewDecoder(b) + err = dec.Decode(test.out) + if err != nil { + t.Errorf("%d: decode error: %s", i, err) + continue + } + // Now see if the encoder and decoder are in a consistent state. + str := fmt.Sprintf("Value %d", i) + err = enc.Encode(&NewType0{str}) + if err != nil { + t.Fatalf("%d: NewType0 encode error: %s", i, err) + } + ns := new(NewType0) + err = dec.Decode(ns) + if err != nil { + t.Fatalf("%d: NewType0 decode error: %s", i, err) + } + if ns.S != str { + t.Fatalf("%d: expected %q got %q", i, str, ns.S) + } + } +} + +func TestIgnoreRecursiveType(t *testing.T) { + // It's hard to build a self-contained test for this because + // we can't build compatible types in one package with + // different items so something is ignored. Here is + // some data that represents, according to debug.go: + // type definition { + // slice "recursiveSlice" id=106 + // elem id=106 + // } + data := []byte{ + 0x1d, 0xff, 0xd3, 0x02, 0x01, 0x01, 0x0e, 0x72, + 0x65, 0x63, 0x75, 0x72, 0x73, 0x69, 0x76, 0x65, + 0x53, 0x6c, 0x69, 0x63, 0x65, 0x01, 0xff, 0xd4, + 0x00, 0x01, 0xff, 0xd4, 0x00, 0x00, 0x07, 0xff, + 0xd4, 0x00, 0x02, 0x01, 0x00, 0x00, + } + dec := NewDecoder(bytes.NewReader(data)) + // Issue 10415: This caused infinite recursion. + err := dec.Decode(nil) + if err != nil { + t.Fatal(err) + } +} + +// Another bug from golang-nuts, involving nested interfaces. +type Bug0Outer struct { + Bug0Field interface{} +} + +type Bug0Inner struct { + A int +} + +func TestNestedInterfaces(t *testing.T) { + var buf bytes.Buffer + e := NewEncoder(&buf) + d := NewDecoder(&buf) + Register(new(Bug0Outer)) + Register(new(Bug0Inner)) + f := &Bug0Outer{&Bug0Outer{&Bug0Inner{7}}} + var v interface{} = f + err := e.Encode(&v) + if err != nil { + t.Fatal("Encode:", err) + } + err = d.Decode(&v) + if err != nil { + t.Fatal("Decode:", err) + } + // Make sure it decoded correctly. + outer1, ok := v.(*Bug0Outer) + if !ok { + t.Fatalf("v not Bug0Outer: %T", v) + } + outer2, ok := outer1.Bug0Field.(*Bug0Outer) + if !ok { + t.Fatalf("v.Bug0Field not Bug0Outer: %T", outer1.Bug0Field) + } + inner, ok := outer2.Bug0Field.(*Bug0Inner) + if !ok { + t.Fatalf("v.Bug0Field.Bug0Field not Bug0Inner: %T", outer2.Bug0Field) + } + if inner.A != 7 { + t.Fatalf("final value %d; expected %d", inner.A, 7) + } +} + +// The bugs keep coming. We forgot to send map subtypes before the map. + +type Bug1Elem struct { + Name string + Id int +} + +type Bug1StructMap map[string]Bug1Elem + +func bug1EncDec(in Bug1StructMap, out *Bug1StructMap) error { + return nil +} + +func TestMapBug1(t *testing.T) { + in := make(Bug1StructMap) + in["val1"] = Bug1Elem{"elem1", 1} + in["val2"] = Bug1Elem{"elem2", 2} + + b := new(bytes.Buffer) + enc := NewEncoder(b) + err := enc.Encode(in) + if err != nil { + t.Fatal("encode:", err) + } + dec := NewDecoder(b) + out := make(Bug1StructMap) + err = dec.Decode(&out) + if err != nil { + t.Fatal("decode:", err) + } + if !reflect.DeepEqual(in, out) { + t.Errorf("mismatch: %v %v", in, out) + } +} + +func TestGobMapInterfaceEncode(t *testing.T) { + m := map[string]interface{}{ + "up": uintptr(0), + "i0": []int{-1}, + "i1": []int8{-1}, + "i2": []int16{-1}, + "i3": []int32{-1}, + "i4": []int64{-1}, + "u0": []uint{1}, + "u1": []uint8{1}, + "u2": []uint16{1}, + "u3": []uint32{1}, + "u4": []uint64{1}, + "f0": []float32{1}, + "f1": []float64{1}, + "c0": []complex64{complex(2, -2)}, + "c1": []complex128{complex(2, float64(-2))}, + "us": []uintptr{0}, + "bo": []bool{false}, + "st": []string{"s"}, + } + enc := NewEncoder(new(bytes.Buffer)) + err := enc.Encode(m) + if err != nil { + t.Errorf("encode map: %s", err) + } +} + +func TestSliceReusesMemory(t *testing.T) { + buf := new(bytes.Buffer) + // Bytes + { + x := []byte("abcd") + enc := NewEncoder(buf) + err := enc.Encode(x) + if err != nil { + t.Errorf("bytes: encode: %s", err) + } + // Decode into y, which is big enough. + y := []byte("ABCDE") + addr := &y[0] + dec := NewDecoder(buf) + err = dec.Decode(&y) + if err != nil { + t.Fatal("bytes: decode:", err) + } + if !bytes.Equal(x, y) { + t.Errorf("bytes: expected %q got %q\n", x, y) + } + if addr != &y[0] { + t.Errorf("bytes: unnecessary reallocation") + } + } + // general slice + { + x := []rune("abcd") + enc := NewEncoder(buf) + err := enc.Encode(x) + if err != nil { + t.Errorf("ints: encode: %s", err) + } + // Decode into y, which is big enough. + y := []rune("ABCDE") + addr := &y[0] + dec := NewDecoder(buf) + err = dec.Decode(&y) + if err != nil { + t.Fatal("ints: decode:", err) + } + if !reflect.DeepEqual(x, y) { + t.Errorf("ints: expected %q got %q\n", x, y) + } + if addr != &y[0] { + t.Errorf("ints: unnecessary reallocation") + } + } +} + +// Used to crash: negative count in recvMessage. +func TestBadCount(t *testing.T) { + b := []byte{0xfb, 0xa5, 0x82, 0x2f, 0xca, 0x1} + if err := NewDecoder(bytes.NewReader(b)).Decode(nil); err == nil { + t.Error("expected error from bad count") + } else if err.Error() != errBadCount.Error() { + t.Error("expected bad count error; got", err) + } +} + +// Verify that sequential Decoders built on a single input will +// succeed if the input implements ReadByte and there is no +// type information in the stream. +func TestSequentialDecoder(t *testing.T) { + b := new(bytes.Buffer) + enc := NewEncoder(b) + const count = 10 + for i := 0; i < count; i++ { + s := fmt.Sprintf("%d", i) + if err := enc.Encode(s); err != nil { + t.Error("encoder fail:", err) + } + } + for i := 0; i < count; i++ { + dec := NewDecoder(b) + var s string + if err := dec.Decode(&s); err != nil { + t.Fatal("decoder fail:", err) + } + if s != fmt.Sprintf("%d", i) { + t.Fatalf("decode expected %d got %s", i, s) + } + } +} + +// Should be able to have unrepresentable fields (chan, func, *chan etc.); we just ignore them. +type Bug2 struct { + A int + C chan int + CP *chan int + F func() + FPP **func() +} + +func TestChanFuncIgnored(t *testing.T) { + c := make(chan int) + f := func() {} + fp := &f + b0 := Bug2{23, c, &c, f, &fp} + var buf bytes.Buffer + enc := NewEncoder(&buf) + if err := enc.Encode(b0); err != nil { + t.Fatal("error encoding:", err) + } + var b1 Bug2 + err := NewDecoder(&buf).Decode(&b1) + if err != nil { + t.Fatal("decode:", err) + } + if b1.A != b0.A { + t.Fatalf("got %d want %d", b1.A, b0.A) + } + if b1.C != nil || b1.CP != nil || b1.F != nil || b1.FPP != nil { + t.Fatal("unexpected value for chan or func") + } +} + +func TestSliceIncompatibility(t *testing.T) { + var in = []byte{1, 2, 3} + var out []int + if err := encAndDec(in, &out); err == nil { + t.Error("expected compatibility error") + } +} + +// Mutually recursive slices of structs caused problems. +type Bug3 struct { + Num int + Children []*Bug3 +} + +func TestGobPtrSlices(t *testing.T) { + in := []*Bug3{ + {1, nil}, + {2, nil}, + } + b := new(bytes.Buffer) + err := NewEncoder(b).Encode(&in) + if err != nil { + t.Fatal("encode:", err) + } + + var out []*Bug3 + err = NewDecoder(b).Decode(&out) + if err != nil { + t.Fatal("decode:", err) + } + if !reflect.DeepEqual(in, out) { + t.Fatalf("got %v; wanted %v", out, in) + } +} + +// getDecEnginePtr cached engine for ut.base instead of ut.user so we passed +// a *map and then tried to reuse its engine to decode the inner map. +func TestPtrToMapOfMap(t *testing.T) { + Register(make(map[string]interface{})) + subdata := make(map[string]interface{}) + subdata["bar"] = "baz" + data := make(map[string]interface{}) + data["foo"] = subdata + + b := new(bytes.Buffer) + err := NewEncoder(b).Encode(data) + if err != nil { + t.Fatal("encode:", err) + } + var newData map[string]interface{} + err = NewDecoder(b).Decode(&newData) + if err != nil { + t.Fatal("decode:", err) + } + if !reflect.DeepEqual(data, newData) { + t.Fatalf("expected %v got %v", data, newData) + } +} + +// A top-level nil pointer generates a panic with a helpful string-valued message. +func TestTopLevelNilPointer(t *testing.T) { + errMsg := topLevelNilPanic(t) + if errMsg == "" { + t.Fatal("top-level nil pointer did not panic") + } + if !strings.Contains(errMsg, "nil pointer") { + t.Fatal("expected nil pointer error, got:", errMsg) + } +} + +func topLevelNilPanic(t *testing.T) (panicErr string) { + defer func() { + e := recover() + if err, ok := e.(string); ok { + panicErr = err + } + }() + var ip *int + buf := new(bytes.Buffer) + if err := NewEncoder(buf).Encode(ip); err != nil { + t.Fatal("error in encode:", err) + } + return +} + +func TestNilPointerInsideInterface(t *testing.T) { + var ip *int + si := struct { + I interface{} + }{ + I: ip, + } + buf := new(bytes.Buffer) + err := NewEncoder(buf).Encode(si) + if err == nil { + t.Fatal("expected error, got none") + } + errMsg := err.Error() + if !strings.Contains(errMsg, "nil pointer") || !strings.Contains(errMsg, "interface") { + t.Fatal("expected error about nil pointer and interface, got:", errMsg) + } +} + +type Bug4Public struct { + Name string + Secret Bug4Secret +} + +type Bug4Secret struct { + a int // error: no exported fields. +} + +// Test that a failed compilation doesn't leave around an executable encoder. +// Issue 3273. +func TestMutipleEncodingsOfBadType(t *testing.T) { + x := Bug4Public{ + Name: "name", + Secret: Bug4Secret{1}, + } + buf := new(bytes.Buffer) + enc := NewEncoder(buf) + err := enc.Encode(x) + if err == nil { + t.Fatal("first encoding: expected error") + } + buf.Reset() + enc = NewEncoder(buf) + err = enc.Encode(x) + if err == nil { + t.Fatal("second encoding: expected error") + } + if !strings.Contains(err.Error(), "no exported fields") { + t.Errorf("expected error about no exported fields; got %v", err) + } +} + +// There was an error check comparing the length of the input with the +// length of the slice being decoded. It was wrong because the next +// thing in the input might be a type definition, which would lead to +// an incorrect length check. This test reproduces the corner case. + +type Z struct { +} + +func Test29ElementSlice(t *testing.T) { + Register(Z{}) + src := make([]interface{}, 100) // Size needs to be bigger than size of type definition. + for i := range src { + src[i] = Z{} + } + buf := new(bytes.Buffer) + err := NewEncoder(buf).Encode(src) + if err != nil { + t.Fatalf("encode: %v", err) + return + } + + var dst []interface{} + err = NewDecoder(buf).Decode(&dst) + if err != nil { + t.Errorf("decode: %v", err) + return + } +} + +// Don't crash, just give error when allocating a huge slice. +// Issue 8084. +func TestErrorForHugeSlice(t *testing.T) { + // Encode an int slice. + buf := new(bytes.Buffer) + slice := []int{1, 1, 1, 1, 1, 1, 1, 1, 1, 1} + err := NewEncoder(buf).Encode(slice) + if err != nil { + t.Fatal("encode:", err) + } + // Reach into the buffer and smash the count to make the encoded slice very long. + buf.Bytes()[buf.Len()-len(slice)-1] = 0xfa + // Decode and see error. + err = NewDecoder(buf).Decode(&slice) + if err == nil { + t.Fatal("decode: no error") + } + if !strings.Contains(err.Error(), "slice too big") { + t.Fatalf("decode: expected slice too big error, got %s", err.Error()) + } +} + +type badDataTest struct { + input string // The input encoded as a hex string. + error string // A substring of the error that should result. + data interface{} // What to decode into. +} + +var badDataTests = []badDataTest{ + {"", "EOF", nil}, + {"7F6869", "unexpected EOF", nil}, + {"036e6f77206973207468652074696d6520666f7220616c6c20676f6f64206d656e", "unknown type id", new(ET2)}, + {"0424666f6f", "field numbers out of bounds", new(ET2)}, // Issue 6323. + {"05100028557b02027f8302", "interface encoding", nil}, // Issue 10270. + // Issue 10273. + {"130a00fb5dad0bf8ff020263e70002fa28020202a89859", "slice length too large", nil}, + {"0f1000fb285d003316020735ff023a65c5", "interface encoding", nil}, + {"03fffb0616fffc00f902ff02ff03bf005d02885802a311a8120228022c028ee7", "GobDecoder", nil}, + // Issue 10491. + {"10fe010f020102fe01100001fe010e000016fe010d030102fe010e00010101015801fe01100000000bfe011000f85555555555555555", "length exceeds input size", nil}, +} + +// TestBadData tests that various problems caused by malformed input +// are caught as errors and do not cause panics. +func TestBadData(t *testing.T) { + for i, test := range badDataTests { + data, err := hex.DecodeString(test.input) + if err != nil { + t.Fatalf("#%d: hex error: %s", i, err) + } + d := NewDecoder(bytes.NewReader(data)) + err = d.Decode(test.data) + if err == nil { + t.Errorf("decode: no error") + continue + } + if !strings.Contains(err.Error(), test.error) { + t.Errorf("#%d: decode: expected %q error, got %s", i, test.error, err.Error()) + } + } +} + +// TestHugeWriteFails tests that enormous messages trigger an error. +func TestHugeWriteFails(t *testing.T) { + if testing.Short() { + // Requires allocating a monster, so don't do this from all.bash. + t.Skip("skipping huge allocation in short mode") + } + huge := make([]byte, tooBig) + huge[0] = 7 // Make sure it's not all zeros. + buf := new(bytes.Buffer) + err := NewEncoder(buf).Encode(huge) + if err == nil { + t.Fatalf("expected error for huge slice") + } + if !strings.Contains(err.Error(), "message too big") { + t.Fatalf("expected 'too big' error; got %s\n", err.Error()) + } +} diff --git a/src/encoding/gob/error.go b/src/encoding/gob/error.go new file mode 100644 index 0000000000000000000000000000000000000000..92cc0c615e3bd94bd286700ac510705c5b1cac2a --- /dev/null +++ b/src/encoding/gob/error.go @@ -0,0 +1,43 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package gob + +import "fmt" + +// Errors in decoding and encoding are handled using panic and recover. +// Panics caused by user error (that is, everything except run-time panics +// such as "index out of bounds" errors) do not leave the file that caused +// them, but are instead turned into plain error returns. Encoding and +// decoding functions and methods that do not return an error either use +// panic to report an error or are guaranteed error-free. + +// A gobError is used to distinguish errors (panics) generated in this package. +type gobError struct { + err error +} + +// errorf is like error_ but takes Printf-style arguments to construct an error. +// It always prefixes the message with "gob: ". +func errorf(format string, args ...interface{}) { + error_(fmt.Errorf("gob: "+format, args...)) +} + +// error wraps the argument error and uses it as the argument to panic. +func error_(err error) { + panic(gobError{err}) +} + +// catchError is meant to be used as a deferred function to turn a panic(gobError) into a +// plain error. It overwrites the error return of the function that deferred its call. +func catchError(err *error) { + if e := recover(); e != nil { + ge, ok := e.(gobError) + if !ok { + panic(e) + } + *err = ge.err + } + return +} diff --git a/src/encoding/gob/example_encdec_test.go b/src/encoding/gob/example_encdec_test.go new file mode 100644 index 0000000000000000000000000000000000000000..e45ad4ccfb985c7dc09d4b2e000b371cd50752c7 --- /dev/null +++ b/src/encoding/gob/example_encdec_test.go @@ -0,0 +1,61 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package gob_test + +import ( + "bytes" + "encoding/gob" + "fmt" + "log" +) + +// The Vector type has unexported fields, which the package cannot access. +// We therefore write a BinaryMarshal/BinaryUnmarshal method pair to allow us +// to send and receive the type with the gob package. These interfaces are +// defined in the "encoding" package. +// We could equivalently use the locally defined GobEncode/GobDecoder +// interfaces. +type Vector struct { + x, y, z int +} + +func (v Vector) MarshalBinary() ([]byte, error) { + // A simple encoding: plain text. + var b bytes.Buffer + fmt.Fprintln(&b, v.x, v.y, v.z) + return b.Bytes(), nil +} + +// UnmarshalBinary modifies the receiver so it must take a pointer receiver. +func (v *Vector) UnmarshalBinary(data []byte) error { + // A simple encoding: plain text. + b := bytes.NewBuffer(data) + _, err := fmt.Fscanln(b, &v.x, &v.y, &v.z) + return err +} + +// This example transmits a value that implements the custom encoding and decoding methods. +func Example_encodeDecode() { + var network bytes.Buffer // Stand-in for the network. + + // Create an encoder and send a value. + enc := gob.NewEncoder(&network) + err := enc.Encode(Vector{3, 4, 5}) + if err != nil { + log.Fatal("encode:", err) + } + + // Create a decoder and receive a value. + dec := gob.NewDecoder(&network) + var v Vector + err = dec.Decode(&v) + if err != nil { + log.Fatal("decode:", err) + } + fmt.Println(v) + + // Output: + // {3 4 5} +} diff --git a/src/encoding/gob/example_interface_test.go b/src/encoding/gob/example_interface_test.go new file mode 100644 index 0000000000000000000000000000000000000000..4681e6307b2d8aa5c4c55520342f51faa382f514 --- /dev/null +++ b/src/encoding/gob/example_interface_test.go @@ -0,0 +1,81 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package gob_test + +import ( + "bytes" + "encoding/gob" + "fmt" + "log" + "math" +) + +type Point struct { + X, Y int +} + +func (p Point) Hypotenuse() float64 { + return math.Hypot(float64(p.X), float64(p.Y)) +} + +type Pythagoras interface { + Hypotenuse() float64 +} + +// This example shows how to encode an interface value. The key +// distinction from regular types is to register the concrete type that +// implements the interface. +func Example_interface() { + var network bytes.Buffer // Stand-in for the network. + + // We must register the concrete type for the encoder and decoder (which would + // normally be on a separate machine from the encoder). On each end, this tells the + // engine which concrete type is being sent that implements the interface. + gob.Register(Point{}) + + // Create an encoder and send some values. + enc := gob.NewEncoder(&network) + for i := 1; i <= 3; i++ { + interfaceEncode(enc, Point{3 * i, 4 * i}) + } + + // Create a decoder and receive some values. + dec := gob.NewDecoder(&network) + for i := 1; i <= 3; i++ { + result := interfaceDecode(dec) + fmt.Println(result.Hypotenuse()) + } + + // Output: + // 5 + // 10 + // 15 +} + +// interfaceEncode encodes the interface value into the encoder. +func interfaceEncode(enc *gob.Encoder, p Pythagoras) { + // The encode will fail unless the concrete type has been + // registered. We registered it in the calling function. + + // Pass pointer to interface so Encode sees (and hence sends) a value of + // interface type. If we passed p directly it would see the concrete type instead. + // See the blog post, "The Laws of Reflection" for background. + err := enc.Encode(&p) + if err != nil { + log.Fatal("encode:", err) + } +} + +// interfaceDecode decodes the next interface value from the stream and returns it. +func interfaceDecode(dec *gob.Decoder) Pythagoras { + // The decode will fail unless the concrete type on the wire has been + // registered. We registered it in the calling function. + var p Pythagoras + err := dec.Decode(&p) + if err != nil { + log.Fatal("decode:", err) + } + return p +} diff --git a/src/encoding/gob/example_test.go b/src/encoding/gob/example_test.go new file mode 100644 index 0000000000000000000000000000000000000000..020352ceeeba0c1c1b152651c36f67a6cc48d5af --- /dev/null +++ b/src/encoding/gob/example_test.go @@ -0,0 +1,60 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package gob_test + +import ( + "bytes" + "encoding/gob" + "fmt" + "log" +) + +type P struct { + X, Y, Z int + Name string +} + +type Q struct { + X, Y *int32 + Name string +} + +// This example shows the basic usage of the package: Create an encoder, +// transmit some values, receive them with a decoder. +func Example_basic() { + // Initialize the encoder and decoder. Normally enc and dec would be + // bound to network connections and the encoder and decoder would + // run in different processes. + var network bytes.Buffer // Stand-in for a network connection + enc := gob.NewEncoder(&network) // Will write to network. + dec := gob.NewDecoder(&network) // Will read from network. + + // Encode (send) some values. + err := enc.Encode(P{3, 4, 5, "Pythagoras"}) + if err != nil { + log.Fatal("encode error:", err) + } + err = enc.Encode(P{1782, 1841, 1922, "Treehouse"}) + if err != nil { + log.Fatal("encode error:", err) + } + + // Decode (receive) and print the values. + var q Q + err = dec.Decode(&q) + if err != nil { + log.Fatal("decode error 1:", err) + } + fmt.Printf("%q: {%d, %d}\n", q.Name, *q.X, *q.Y) + err = dec.Decode(&q) + if err != nil { + log.Fatal("decode error 2:", err) + } + fmt.Printf("%q: {%d, %d}\n", q.Name, *q.X, *q.Y) + + // Output: + // "Pythagoras": {3, 4} + // "Treehouse": {1782, 1841} +} diff --git a/src/encoding/gob/gobencdec_test.go b/src/encoding/gob/gobencdec_test.go new file mode 100644 index 0000000000000000000000000000000000000000..eb76b481d198365e1552dd3b76ef76fa5bebacc0 --- /dev/null +++ b/src/encoding/gob/gobencdec_test.go @@ -0,0 +1,798 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// This file contains tests of the GobEncoder/GobDecoder support. + +package gob + +import ( + "bytes" + "errors" + "fmt" + "io" + "net" + "strings" + "testing" + "time" +) + +// Types that implement the GobEncoder/Decoder interfaces. + +type ByteStruct struct { + a byte // not an exported field +} + +type StringStruct struct { + s string // not an exported field +} + +type ArrayStruct struct { + a [8192]byte // not an exported field +} + +type Gobber int + +type ValueGobber string // encodes with a value, decodes with a pointer. + +type BinaryGobber int + +type BinaryValueGobber string + +type TextGobber int + +type TextValueGobber string + +// The relevant methods + +func (g *ByteStruct) GobEncode() ([]byte, error) { + b := make([]byte, 3) + b[0] = g.a + b[1] = g.a + 1 + b[2] = g.a + 2 + return b, nil +} + +func (g *ByteStruct) GobDecode(data []byte) error { + if g == nil { + return errors.New("NIL RECEIVER") + } + // Expect N sequential-valued bytes. + if len(data) == 0 { + return io.EOF + } + g.a = data[0] + for i, c := range data { + if c != g.a+byte(i) { + return errors.New("invalid data sequence") + } + } + return nil +} + +func (g *StringStruct) GobEncode() ([]byte, error) { + return []byte(g.s), nil +} + +func (g *StringStruct) GobDecode(data []byte) error { + // Expect N sequential-valued bytes. + if len(data) == 0 { + return io.EOF + } + a := data[0] + for i, c := range data { + if c != a+byte(i) { + return errors.New("invalid data sequence") + } + } + g.s = string(data) + return nil +} + +func (a *ArrayStruct) GobEncode() ([]byte, error) { + return a.a[:], nil +} + +func (a *ArrayStruct) GobDecode(data []byte) error { + if len(data) != len(a.a) { + return errors.New("wrong length in array decode") + } + copy(a.a[:], data) + return nil +} + +func (g *Gobber) GobEncode() ([]byte, error) { + return []byte(fmt.Sprintf("VALUE=%d", *g)), nil +} + +func (g *Gobber) GobDecode(data []byte) error { + _, err := fmt.Sscanf(string(data), "VALUE=%d", (*int)(g)) + return err +} + +func (g *BinaryGobber) MarshalBinary() ([]byte, error) { + return []byte(fmt.Sprintf("VALUE=%d", *g)), nil +} + +func (g *BinaryGobber) UnmarshalBinary(data []byte) error { + _, err := fmt.Sscanf(string(data), "VALUE=%d", (*int)(g)) + return err +} + +func (g *TextGobber) MarshalText() ([]byte, error) { + return []byte(fmt.Sprintf("VALUE=%d", *g)), nil +} + +func (g *TextGobber) UnmarshalText(data []byte) error { + _, err := fmt.Sscanf(string(data), "VALUE=%d", (*int)(g)) + return err +} + +func (v ValueGobber) GobEncode() ([]byte, error) { + return []byte(fmt.Sprintf("VALUE=%s", v)), nil +} + +func (v *ValueGobber) GobDecode(data []byte) error { + _, err := fmt.Sscanf(string(data), "VALUE=%s", (*string)(v)) + return err +} + +func (v BinaryValueGobber) MarshalBinary() ([]byte, error) { + return []byte(fmt.Sprintf("VALUE=%s", v)), nil +} + +func (v *BinaryValueGobber) UnmarshalBinary(data []byte) error { + _, err := fmt.Sscanf(string(data), "VALUE=%s", (*string)(v)) + return err +} + +func (v TextValueGobber) MarshalText() ([]byte, error) { + return []byte(fmt.Sprintf("VALUE=%s", v)), nil +} + +func (v *TextValueGobber) UnmarshalText(data []byte) error { + _, err := fmt.Sscanf(string(data), "VALUE=%s", (*string)(v)) + return err +} + +// Structs that include GobEncodable fields. + +type GobTest0 struct { + X int // guarantee we have something in common with GobTest* + G *ByteStruct +} + +type GobTest1 struct { + X int // guarantee we have something in common with GobTest* + G *StringStruct +} + +type GobTest2 struct { + X int // guarantee we have something in common with GobTest* + G string // not a GobEncoder - should give us errors +} + +type GobTest3 struct { + X int // guarantee we have something in common with GobTest* + G *Gobber + B *BinaryGobber + T *TextGobber +} + +type GobTest4 struct { + X int // guarantee we have something in common with GobTest* + V ValueGobber + BV BinaryValueGobber + TV TextValueGobber +} + +type GobTest5 struct { + X int // guarantee we have something in common with GobTest* + V *ValueGobber + BV *BinaryValueGobber + TV *TextValueGobber +} + +type GobTest6 struct { + X int // guarantee we have something in common with GobTest* + V ValueGobber + W *ValueGobber + BV BinaryValueGobber + BW *BinaryValueGobber + TV TextValueGobber + TW *TextValueGobber +} + +type GobTest7 struct { + X int // guarantee we have something in common with GobTest* + V *ValueGobber + W ValueGobber + BV *BinaryValueGobber + BW BinaryValueGobber + TV *TextValueGobber + TW TextValueGobber +} + +type GobTestIgnoreEncoder struct { + X int // guarantee we have something in common with GobTest* +} + +type GobTestValueEncDec struct { + X int // guarantee we have something in common with GobTest* + G StringStruct // not a pointer. +} + +type GobTestIndirectEncDec struct { + X int // guarantee we have something in common with GobTest* + G ***StringStruct // indirections to the receiver. +} + +type GobTestArrayEncDec struct { + X int // guarantee we have something in common with GobTest* + A ArrayStruct // not a pointer. +} + +type GobTestIndirectArrayEncDec struct { + X int // guarantee we have something in common with GobTest* + A ***ArrayStruct // indirections to a large receiver. +} + +func TestGobEncoderField(t *testing.T) { + b := new(bytes.Buffer) + // First a field that's a structure. + enc := NewEncoder(b) + err := enc.Encode(GobTest0{17, &ByteStruct{'A'}}) + if err != nil { + t.Fatal("encode error:", err) + } + dec := NewDecoder(b) + x := new(GobTest0) + err = dec.Decode(x) + if err != nil { + t.Fatal("decode error:", err) + } + if x.G.a != 'A' { + t.Errorf("expected 'A' got %c", x.G.a) + } + // Now a field that's not a structure. + b.Reset() + gobber := Gobber(23) + bgobber := BinaryGobber(24) + tgobber := TextGobber(25) + err = enc.Encode(GobTest3{17, &gobber, &bgobber, &tgobber}) + if err != nil { + t.Fatal("encode error:", err) + } + y := new(GobTest3) + err = dec.Decode(y) + if err != nil { + t.Fatal("decode error:", err) + } + if *y.G != 23 || *y.B != 24 || *y.T != 25 { + t.Errorf("expected '23 got %d", *y.G) + } +} + +// Even though the field is a value, we can still take its address +// and should be able to call the methods. +func TestGobEncoderValueField(t *testing.T) { + b := new(bytes.Buffer) + // First a field that's a structure. + enc := NewEncoder(b) + err := enc.Encode(&GobTestValueEncDec{17, StringStruct{"HIJKL"}}) + if err != nil { + t.Fatal("encode error:", err) + } + dec := NewDecoder(b) + x := new(GobTestValueEncDec) + err = dec.Decode(x) + if err != nil { + t.Fatal("decode error:", err) + } + if x.G.s != "HIJKL" { + t.Errorf("expected `HIJKL` got %s", x.G.s) + } +} + +// GobEncode/Decode should work even if the value is +// more indirect than the receiver. +func TestGobEncoderIndirectField(t *testing.T) { + b := new(bytes.Buffer) + // First a field that's a structure. + enc := NewEncoder(b) + s := &StringStruct{"HIJKL"} + sp := &s + err := enc.Encode(GobTestIndirectEncDec{17, &sp}) + if err != nil { + t.Fatal("encode error:", err) + } + dec := NewDecoder(b) + x := new(GobTestIndirectEncDec) + err = dec.Decode(x) + if err != nil { + t.Fatal("decode error:", err) + } + if (***x.G).s != "HIJKL" { + t.Errorf("expected `HIJKL` got %s", (***x.G).s) + } +} + +// Test with a large field with methods. +func TestGobEncoderArrayField(t *testing.T) { + b := new(bytes.Buffer) + enc := NewEncoder(b) + var a GobTestArrayEncDec + a.X = 17 + for i := range a.A.a { + a.A.a[i] = byte(i) + } + err := enc.Encode(&a) + if err != nil { + t.Fatal("encode error:", err) + } + dec := NewDecoder(b) + x := new(GobTestArrayEncDec) + err = dec.Decode(x) + if err != nil { + t.Fatal("decode error:", err) + } + for i, v := range x.A.a { + if v != byte(i) { + t.Errorf("expected %x got %x", byte(i), v) + break + } + } +} + +// Test an indirection to a large field with methods. +func TestGobEncoderIndirectArrayField(t *testing.T) { + b := new(bytes.Buffer) + enc := NewEncoder(b) + var a GobTestIndirectArrayEncDec + a.X = 17 + var array ArrayStruct + ap := &array + app := &ap + a.A = &app + for i := range array.a { + array.a[i] = byte(i) + } + err := enc.Encode(a) + if err != nil { + t.Fatal("encode error:", err) + } + dec := NewDecoder(b) + x := new(GobTestIndirectArrayEncDec) + err = dec.Decode(x) + if err != nil { + t.Fatal("decode error:", err) + } + for i, v := range (***x.A).a { + if v != byte(i) { + t.Errorf("expected %x got %x", byte(i), v) + break + } + } +} + +// As long as the fields have the same name and implement the +// interface, we can cross-connect them. Not sure it's useful +// and may even be bad but it works and it's hard to prevent +// without exposing the contents of the object, which would +// defeat the purpose. +func TestGobEncoderFieldsOfDifferentType(t *testing.T) { + // first, string in field to byte in field + b := new(bytes.Buffer) + enc := NewEncoder(b) + err := enc.Encode(GobTest1{17, &StringStruct{"ABC"}}) + if err != nil { + t.Fatal("encode error:", err) + } + dec := NewDecoder(b) + x := new(GobTest0) + err = dec.Decode(x) + if err != nil { + t.Fatal("decode error:", err) + } + if x.G.a != 'A' { + t.Errorf("expected 'A' got %c", x.G.a) + } + // now the other direction, byte in field to string in field + b.Reset() + err = enc.Encode(GobTest0{17, &ByteStruct{'X'}}) + if err != nil { + t.Fatal("encode error:", err) + } + y := new(GobTest1) + err = dec.Decode(y) + if err != nil { + t.Fatal("decode error:", err) + } + if y.G.s != "XYZ" { + t.Fatalf("expected `XYZ` got %q", y.G.s) + } +} + +// Test that we can encode a value and decode into a pointer. +func TestGobEncoderValueEncoder(t *testing.T) { + // first, string in field to byte in field + b := new(bytes.Buffer) + enc := NewEncoder(b) + err := enc.Encode(GobTest4{17, ValueGobber("hello"), BinaryValueGobber("Καλημέρα"), TextValueGobber("こんにちは")}) + if err != nil { + t.Fatal("encode error:", err) + } + dec := NewDecoder(b) + x := new(GobTest5) + err = dec.Decode(x) + if err != nil { + t.Fatal("decode error:", err) + } + if *x.V != "hello" || *x.BV != "Καλημέρα" || *x.TV != "こんにちは" { + t.Errorf("expected `hello` got %s", *x.V) + } +} + +// Test that we can use a value then a pointer type of a GobEncoder +// in the same encoded value. Bug 4647. +func TestGobEncoderValueThenPointer(t *testing.T) { + v := ValueGobber("forty-two") + w := ValueGobber("six-by-nine") + bv := BinaryValueGobber("1nanocentury") + bw := BinaryValueGobber("πseconds") + tv := TextValueGobber("gravitationalacceleration") + tw := TextValueGobber("π²ft/s²") + + // this was a bug: encoding a GobEncoder by value before a GobEncoder + // pointer would cause duplicate type definitions to be sent. + + b := new(bytes.Buffer) + enc := NewEncoder(b) + if err := enc.Encode(GobTest6{42, v, &w, bv, &bw, tv, &tw}); err != nil { + t.Fatal("encode error:", err) + } + dec := NewDecoder(b) + x := new(GobTest6) + if err := dec.Decode(x); err != nil { + t.Fatal("decode error:", err) + } + + if got, want := x.V, v; got != want { + t.Errorf("v = %q, want %q", got, want) + } + if got, want := x.W, w; got == nil { + t.Errorf("w = nil, want %q", want) + } else if *got != want { + t.Errorf("w = %q, want %q", *got, want) + } + + if got, want := x.BV, bv; got != want { + t.Errorf("bv = %q, want %q", got, want) + } + if got, want := x.BW, bw; got == nil { + t.Errorf("bw = nil, want %q", want) + } else if *got != want { + t.Errorf("bw = %q, want %q", *got, want) + } + + if got, want := x.TV, tv; got != want { + t.Errorf("tv = %q, want %q", got, want) + } + if got, want := x.TW, tw; got == nil { + t.Errorf("tw = nil, want %q", want) + } else if *got != want { + t.Errorf("tw = %q, want %q", *got, want) + } +} + +// Test that we can use a pointer then a value type of a GobEncoder +// in the same encoded value. +func TestGobEncoderPointerThenValue(t *testing.T) { + v := ValueGobber("forty-two") + w := ValueGobber("six-by-nine") + bv := BinaryValueGobber("1nanocentury") + bw := BinaryValueGobber("πseconds") + tv := TextValueGobber("gravitationalacceleration") + tw := TextValueGobber("π²ft/s²") + + b := new(bytes.Buffer) + enc := NewEncoder(b) + if err := enc.Encode(GobTest7{42, &v, w, &bv, bw, &tv, tw}); err != nil { + t.Fatal("encode error:", err) + } + dec := NewDecoder(b) + x := new(GobTest7) + if err := dec.Decode(x); err != nil { + t.Fatal("decode error:", err) + } + + if got, want := x.V, v; got == nil { + t.Errorf("v = nil, want %q", want) + } else if *got != want { + t.Errorf("v = %q, want %q", *got, want) + } + if got, want := x.W, w; got != want { + t.Errorf("w = %q, want %q", got, want) + } + + if got, want := x.BV, bv; got == nil { + t.Errorf("bv = nil, want %q", want) + } else if *got != want { + t.Errorf("bv = %q, want %q", *got, want) + } + if got, want := x.BW, bw; got != want { + t.Errorf("bw = %q, want %q", got, want) + } + + if got, want := x.TV, tv; got == nil { + t.Errorf("tv = nil, want %q", want) + } else if *got != want { + t.Errorf("tv = %q, want %q", *got, want) + } + if got, want := x.TW, tw; got != want { + t.Errorf("tw = %q, want %q", got, want) + } +} + +func TestGobEncoderFieldTypeError(t *testing.T) { + // GobEncoder to non-decoder: error + b := new(bytes.Buffer) + enc := NewEncoder(b) + err := enc.Encode(GobTest1{17, &StringStruct{"ABC"}}) + if err != nil { + t.Fatal("encode error:", err) + } + dec := NewDecoder(b) + x := &GobTest2{} + err = dec.Decode(x) + if err == nil { + t.Fatal("expected decode error for mismatched fields (encoder to non-decoder)") + } + if strings.Index(err.Error(), "type") < 0 { + t.Fatal("expected type error; got", err) + } + // Non-encoder to GobDecoder: error + b.Reset() + err = enc.Encode(GobTest2{17, "ABC"}) + if err != nil { + t.Fatal("encode error:", err) + } + y := &GobTest1{} + err = dec.Decode(y) + if err == nil { + t.Fatal("expected decode error for mismatched fields (non-encoder to decoder)") + } + if strings.Index(err.Error(), "type") < 0 { + t.Fatal("expected type error; got", err) + } +} + +// Even though ByteStruct is a struct, it's treated as a singleton at the top level. +func TestGobEncoderStructSingleton(t *testing.T) { + b := new(bytes.Buffer) + enc := NewEncoder(b) + err := enc.Encode(&ByteStruct{'A'}) + if err != nil { + t.Fatal("encode error:", err) + } + dec := NewDecoder(b) + x := new(ByteStruct) + err = dec.Decode(x) + if err != nil { + t.Fatal("decode error:", err) + } + if x.a != 'A' { + t.Errorf("expected 'A' got %c", x.a) + } +} + +func TestGobEncoderNonStructSingleton(t *testing.T) { + b := new(bytes.Buffer) + enc := NewEncoder(b) + var g Gobber = 1234 + err := enc.Encode(&g) + if err != nil { + t.Fatal("encode error:", err) + } + dec := NewDecoder(b) + var x Gobber + err = dec.Decode(&x) + if err != nil { + t.Fatal("decode error:", err) + } + if x != 1234 { + t.Errorf("expected 1234 got %d", x) + } +} + +func TestGobEncoderIgnoreStructField(t *testing.T) { + b := new(bytes.Buffer) + // First a field that's a structure. + enc := NewEncoder(b) + err := enc.Encode(GobTest0{17, &ByteStruct{'A'}}) + if err != nil { + t.Fatal("encode error:", err) + } + dec := NewDecoder(b) + x := new(GobTestIgnoreEncoder) + err = dec.Decode(x) + if err != nil { + t.Fatal("decode error:", err) + } + if x.X != 17 { + t.Errorf("expected 17 got %c", x.X) + } +} + +func TestGobEncoderIgnoreNonStructField(t *testing.T) { + b := new(bytes.Buffer) + // First a field that's a structure. + enc := NewEncoder(b) + gobber := Gobber(23) + bgobber := BinaryGobber(24) + tgobber := TextGobber(25) + err := enc.Encode(GobTest3{17, &gobber, &bgobber, &tgobber}) + if err != nil { + t.Fatal("encode error:", err) + } + dec := NewDecoder(b) + x := new(GobTestIgnoreEncoder) + err = dec.Decode(x) + if err != nil { + t.Fatal("decode error:", err) + } + if x.X != 17 { + t.Errorf("expected 17 got %c", x.X) + } +} + +func TestGobEncoderIgnoreNilEncoder(t *testing.T) { + b := new(bytes.Buffer) + // First a field that's a structure. + enc := NewEncoder(b) + err := enc.Encode(GobTest0{X: 18}) // G is nil + if err != nil { + t.Fatal("encode error:", err) + } + dec := NewDecoder(b) + x := new(GobTest0) + err = dec.Decode(x) + if err != nil { + t.Fatal("decode error:", err) + } + if x.X != 18 { + t.Errorf("expected x.X = 18, got %v", x.X) + } + if x.G != nil { + t.Errorf("expected x.G = nil, got %v", x.G) + } +} + +type gobDecoderBug0 struct { + foo, bar string +} + +func (br *gobDecoderBug0) String() string { + return br.foo + "-" + br.bar +} + +func (br *gobDecoderBug0) GobEncode() ([]byte, error) { + return []byte(br.String()), nil +} + +func (br *gobDecoderBug0) GobDecode(b []byte) error { + br.foo = "foo" + br.bar = "bar" + return nil +} + +// This was a bug: the receiver has a different indirection level +// than the variable. +func TestGobEncoderExtraIndirect(t *testing.T) { + gdb := &gobDecoderBug0{"foo", "bar"} + buf := new(bytes.Buffer) + e := NewEncoder(buf) + if err := e.Encode(gdb); err != nil { + t.Fatalf("encode: %v", err) + } + d := NewDecoder(buf) + var got *gobDecoderBug0 + if err := d.Decode(&got); err != nil { + t.Fatalf("decode: %v", err) + } + if got.foo != gdb.foo || got.bar != gdb.bar { + t.Errorf("got = %q, want %q", got, gdb) + } +} + +// Another bug: this caused a crash with the new Go1 Time type. +// We throw in a gob-encoding array, to test another case of isZero, +// and a struct containing an nil interface, to test a third. +type isZeroBug struct { + T time.Time + S string + I int + A isZeroBugArray + F isZeroBugInterface +} + +type isZeroBugArray [2]uint8 + +// Receiver is value, not pointer, to test isZero of array. +func (a isZeroBugArray) GobEncode() (b []byte, e error) { + b = append(b, a[:]...) + return b, nil +} + +func (a *isZeroBugArray) GobDecode(data []byte) error { + if len(data) != len(a) { + return io.EOF + } + a[0] = data[0] + a[1] = data[1] + return nil +} + +type isZeroBugInterface struct { + I interface{} +} + +func (i isZeroBugInterface) GobEncode() (b []byte, e error) { + return []byte{}, nil +} + +func (i *isZeroBugInterface) GobDecode(data []byte) error { + return nil +} + +func TestGobEncodeIsZero(t *testing.T) { + x := isZeroBug{time.Now(), "hello", -55, isZeroBugArray{1, 2}, isZeroBugInterface{}} + b := new(bytes.Buffer) + enc := NewEncoder(b) + err := enc.Encode(x) + if err != nil { + t.Fatal("encode:", err) + } + var y isZeroBug + dec := NewDecoder(b) + err = dec.Decode(&y) + if err != nil { + t.Fatal("decode:", err) + } + if x != y { + t.Fatalf("%v != %v", x, y) + } +} + +func TestGobEncodePtrError(t *testing.T) { + var err error + b := new(bytes.Buffer) + enc := NewEncoder(b) + err = enc.Encode(&err) + if err != nil { + t.Fatal("encode:", err) + } + dec := NewDecoder(b) + err2 := fmt.Errorf("foo") + err = dec.Decode(&err2) + if err != nil { + t.Fatal("decode:", err) + } + if err2 != nil { + t.Fatalf("expected nil, got %v", err2) + } +} + +func TestNetIP(t *testing.T) { + // Encoding of net.IP{1,2,3,4} in Go 1.1. + enc := []byte{0x07, 0x0a, 0x00, 0x04, 0x01, 0x02, 0x03, 0x04} + + var ip net.IP + err := NewDecoder(bytes.NewReader(enc)).Decode(&ip) + if err != nil { + t.Fatalf("decode: %v", err) + } + if ip.String() != "1.2.3.4" { + t.Errorf("decoded to %v, want 1.2.3.4", ip.String()) + } +} diff --git a/src/encoding/gob/timing_test.go b/src/encoding/gob/timing_test.go new file mode 100644 index 0000000000000000000000000000000000000000..940e5ad4126a7f025de32624d62eede74759548b --- /dev/null +++ b/src/encoding/gob/timing_test.go @@ -0,0 +1,325 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package gob + +import ( + "bytes" + "io" + "os" + "runtime" + "testing" +) + +type Bench struct { + A int + B float64 + C string + D []byte +} + +func benchmarkEndToEnd(b *testing.B, ctor func() interface{}, pipe func() (r io.Reader, w io.Writer, err error)) { + b.RunParallel(func(pb *testing.PB) { + r, w, err := pipe() + if err != nil { + b.Fatal("can't get pipe:", err) + } + v := ctor() + enc := NewEncoder(w) + dec := NewDecoder(r) + for pb.Next() { + if err := enc.Encode(v); err != nil { + b.Fatal("encode error:", err) + } + if err := dec.Decode(v); err != nil { + b.Fatal("decode error:", err) + } + } + }) +} + +func BenchmarkEndToEndPipe(b *testing.B) { + benchmarkEndToEnd(b, func() interface{} { + return &Bench{7, 3.2, "now is the time", bytes.Repeat([]byte("for all good men"), 100)} + }, func() (r io.Reader, w io.Writer, err error) { + r, w, err = os.Pipe() + return + }) +} + +func BenchmarkEndToEndByteBuffer(b *testing.B) { + benchmarkEndToEnd(b, func() interface{} { + return &Bench{7, 3.2, "now is the time", bytes.Repeat([]byte("for all good men"), 100)} + }, func() (r io.Reader, w io.Writer, err error) { + var buf bytes.Buffer + return &buf, &buf, nil + }) +} + +func BenchmarkEndToEndSliceByteBuffer(b *testing.B) { + benchmarkEndToEnd(b, func() interface{} { + v := &Bench{7, 3.2, "now is the time", nil} + Register(v) + arr := make([]interface{}, 100) + for i := range arr { + arr[i] = v + } + return &arr + }, func() (r io.Reader, w io.Writer, err error) { + var buf bytes.Buffer + return &buf, &buf, nil + }) +} + +func TestCountEncodeMallocs(t *testing.T) { + if testing.Short() { + t.Skip("skipping malloc count in short mode") + } + if runtime.GOMAXPROCS(0) > 1 { + t.Skip("skipping; GOMAXPROCS>1") + } + + const N = 1000 + + var buf bytes.Buffer + enc := NewEncoder(&buf) + bench := &Bench{7, 3.2, "now is the time", []byte("for all good men")} + + allocs := testing.AllocsPerRun(N, func() { + err := enc.Encode(bench) + if err != nil { + t.Fatal("encode:", err) + } + }) + if allocs != 0 { + t.Fatalf("mallocs per encode of type Bench: %v; wanted 0\n", allocs) + } +} + +func TestCountDecodeMallocs(t *testing.T) { + if testing.Short() { + t.Skip("skipping malloc count in short mode") + } + if runtime.GOMAXPROCS(0) > 1 { + t.Skip("skipping; GOMAXPROCS>1") + } + + const N = 1000 + + var buf bytes.Buffer + enc := NewEncoder(&buf) + bench := &Bench{7, 3.2, "now is the time", []byte("for all good men")} + + // Fill the buffer with enough to decode + testing.AllocsPerRun(N, func() { + err := enc.Encode(bench) + if err != nil { + t.Fatal("encode:", err) + } + }) + + dec := NewDecoder(&buf) + allocs := testing.AllocsPerRun(N, func() { + *bench = Bench{} + err := dec.Decode(&bench) + if err != nil { + t.Fatal("decode:", err) + } + }) + if allocs != 4 { + t.Fatalf("mallocs per decode of type Bench: %v; wanted 4\n", allocs) + } +} + +func BenchmarkEncodeComplex128Slice(b *testing.B) { + var buf bytes.Buffer + enc := NewEncoder(&buf) + a := make([]complex128, 1000) + for i := range a { + a[i] = 1.2 + 3.4i + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + buf.Reset() + err := enc.Encode(a) + if err != nil { + b.Fatal(err) + } + } +} + +func BenchmarkEncodeFloat64Slice(b *testing.B) { + var buf bytes.Buffer + enc := NewEncoder(&buf) + a := make([]float64, 1000) + for i := range a { + a[i] = 1.23e4 + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + buf.Reset() + err := enc.Encode(a) + if err != nil { + b.Fatal(err) + } + } +} + +func BenchmarkEncodeInt32Slice(b *testing.B) { + var buf bytes.Buffer + enc := NewEncoder(&buf) + a := make([]int32, 1000) + for i := range a { + a[i] = 1234 + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + buf.Reset() + err := enc.Encode(a) + if err != nil { + b.Fatal(err) + } + } +} + +func BenchmarkEncodeStringSlice(b *testing.B) { + var buf bytes.Buffer + enc := NewEncoder(&buf) + a := make([]string, 1000) + for i := range a { + a[i] = "now is the time" + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + buf.Reset() + err := enc.Encode(a) + if err != nil { + b.Fatal(err) + } + } +} + +// benchmarkBuf is a read buffer we can reset +type benchmarkBuf struct { + offset int + data []byte +} + +func (b *benchmarkBuf) Read(p []byte) (n int, err error) { + n = copy(p, b.data[b.offset:]) + if n == 0 { + return 0, io.EOF + } + b.offset += n + return +} + +func (b *benchmarkBuf) ReadByte() (c byte, err error) { + if b.offset >= len(b.data) { + return 0, io.EOF + } + c = b.data[b.offset] + b.offset++ + return +} + +func (b *benchmarkBuf) reset() { + b.offset = 0 +} + +func BenchmarkDecodeComplex128Slice(b *testing.B) { + var buf bytes.Buffer + enc := NewEncoder(&buf) + a := make([]complex128, 1000) + for i := range a { + a[i] = 1.2 + 3.4i + } + err := enc.Encode(a) + if err != nil { + b.Fatal(err) + } + x := make([]complex128, 1000) + bbuf := benchmarkBuf{data: buf.Bytes()} + b.ResetTimer() + for i := 0; i < b.N; i++ { + bbuf.reset() + dec := NewDecoder(&bbuf) + err := dec.Decode(&x) + if err != nil { + b.Fatal(i, err) + } + } +} + +func BenchmarkDecodeFloat64Slice(b *testing.B) { + var buf bytes.Buffer + enc := NewEncoder(&buf) + a := make([]float64, 1000) + for i := range a { + a[i] = 1.23e4 + } + err := enc.Encode(a) + if err != nil { + b.Fatal(err) + } + x := make([]float64, 1000) + bbuf := benchmarkBuf{data: buf.Bytes()} + b.ResetTimer() + for i := 0; i < b.N; i++ { + bbuf.reset() + dec := NewDecoder(&bbuf) + err := dec.Decode(&x) + if err != nil { + b.Fatal(i, err) + } + } +} + +func BenchmarkDecodeInt32Slice(b *testing.B) { + var buf bytes.Buffer + enc := NewEncoder(&buf) + a := make([]int32, 1000) + for i := range a { + a[i] = 1234 + } + err := enc.Encode(a) + if err != nil { + b.Fatal(err) + } + x := make([]int32, 1000) + bbuf := benchmarkBuf{data: buf.Bytes()} + b.ResetTimer() + for i := 0; i < b.N; i++ { + bbuf.reset() + dec := NewDecoder(&bbuf) + err := dec.Decode(&x) + if err != nil { + b.Fatal(i, err) + } + } +} + +func BenchmarkDecodeStringSlice(b *testing.B) { + var buf bytes.Buffer + enc := NewEncoder(&buf) + a := make([]string, 1000) + for i := range a { + a[i] = "now is the time" + } + err := enc.Encode(a) + if err != nil { + b.Fatal(err) + } + x := make([]string, 1000) + bbuf := benchmarkBuf{data: buf.Bytes()} + b.ResetTimer() + for i := 0; i < b.N; i++ { + bbuf.reset() + dec := NewDecoder(&bbuf) + err := dec.Decode(&x) + if err != nil { + b.Fatal(i, err) + } + } +} diff --git a/src/encoding/gob/type.go b/src/encoding/gob/type.go new file mode 100644 index 0000000000000000000000000000000000000000..a49b71a8676786c67aa38dbae07c8ddbdbd86ec6 --- /dev/null +++ b/src/encoding/gob/type.go @@ -0,0 +1,923 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package gob + +import ( + "encoding" + "errors" + "fmt" + "os" + "reflect" + "sync" + "sync/atomic" + "unicode" + "unicode/utf8" +) + +// userTypeInfo stores the information associated with a type the user has handed +// to the package. It's computed once and stored in a map keyed by reflection +// type. +type userTypeInfo struct { + user reflect.Type // the type the user handed us + base reflect.Type // the base type after all indirections + indir int // number of indirections to reach the base type + externalEnc int // xGob, xBinary, or xText + externalDec int // xGob, xBinary or xText + encIndir int8 // number of indirections to reach the receiver type; may be negative + decIndir int8 // number of indirections to reach the receiver type; may be negative +} + +// externalEncoding bits +const ( + xGob = 1 + iota // GobEncoder or GobDecoder + xBinary // encoding.BinaryMarshaler or encoding.BinaryUnmarshaler + xText // encoding.TextMarshaler or encoding.TextUnmarshaler +) + +var ( + // Protected by an RWMutex because we read it a lot and write + // it only when we see a new type, typically when compiling. + userTypeLock sync.RWMutex + userTypeCache = make(map[reflect.Type]*userTypeInfo) +) + +// validType returns, and saves, the information associated with user-provided type rt. +// If the user type is not valid, err will be non-nil. To be used when the error handler +// is not set up. +func validUserType(rt reflect.Type) (ut *userTypeInfo, err error) { + userTypeLock.RLock() + ut = userTypeCache[rt] + userTypeLock.RUnlock() + if ut != nil { + return + } + // Now set the value under the write lock. + userTypeLock.Lock() + defer userTypeLock.Unlock() + if ut = userTypeCache[rt]; ut != nil { + // Lost the race; not a problem. + return + } + ut = new(userTypeInfo) + ut.base = rt + ut.user = rt + // A type that is just a cycle of pointers (such as type T *T) cannot + // be represented in gobs, which need some concrete data. We use a + // cycle detection algorithm from Knuth, Vol 2, Section 3.1, Ex 6, + // pp 539-540. As we step through indirections, run another type at + // half speed. If they meet up, there's a cycle. + slowpoke := ut.base // walks half as fast as ut.base + for { + pt := ut.base + if pt.Kind() != reflect.Ptr { + break + } + ut.base = pt.Elem() + if ut.base == slowpoke { // ut.base lapped slowpoke + // recursive pointer type. + return nil, errors.New("can't represent recursive pointer type " + ut.base.String()) + } + if ut.indir%2 == 0 { + slowpoke = slowpoke.Elem() + } + ut.indir++ + } + + if ok, indir := implementsInterface(ut.user, gobEncoderInterfaceType); ok { + ut.externalEnc, ut.encIndir = xGob, indir + } else if ok, indir := implementsInterface(ut.user, binaryMarshalerInterfaceType); ok { + ut.externalEnc, ut.encIndir = xBinary, indir + } + + // NOTE(rsc): Would like to allow MarshalText here, but results in incompatibility + // with older encodings for net.IP. See golang.org/issue/6760. + // } else if ok, indir := implementsInterface(ut.user, textMarshalerInterfaceType); ok { + // ut.externalEnc, ut.encIndir = xText, indir + // } + + if ok, indir := implementsInterface(ut.user, gobDecoderInterfaceType); ok { + ut.externalDec, ut.decIndir = xGob, indir + } else if ok, indir := implementsInterface(ut.user, binaryUnmarshalerInterfaceType); ok { + ut.externalDec, ut.decIndir = xBinary, indir + } + + // See note above. + // } else if ok, indir := implementsInterface(ut.user, textUnmarshalerInterfaceType); ok { + // ut.externalDec, ut.decIndir = xText, indir + // } + + userTypeCache[rt] = ut + return +} + +var ( + gobEncoderInterfaceType = reflect.TypeOf((*GobEncoder)(nil)).Elem() + gobDecoderInterfaceType = reflect.TypeOf((*GobDecoder)(nil)).Elem() + binaryMarshalerInterfaceType = reflect.TypeOf((*encoding.BinaryMarshaler)(nil)).Elem() + binaryUnmarshalerInterfaceType = reflect.TypeOf((*encoding.BinaryUnmarshaler)(nil)).Elem() + textMarshalerInterfaceType = reflect.TypeOf((*encoding.TextMarshaler)(nil)).Elem() + textUnmarshalerInterfaceType = reflect.TypeOf((*encoding.TextUnmarshaler)(nil)).Elem() +) + +// implementsInterface reports whether the type implements the +// gobEncoder/gobDecoder interface. +// It also returns the number of indirections required to get to the +// implementation. +func implementsInterface(typ, gobEncDecType reflect.Type) (success bool, indir int8) { + if typ == nil { + return + } + rt := typ + // The type might be a pointer and we need to keep + // dereferencing to the base type until we find an implementation. + for { + if rt.Implements(gobEncDecType) { + return true, indir + } + if p := rt; p.Kind() == reflect.Ptr { + indir++ + if indir > 100 { // insane number of indirections + return false, 0 + } + rt = p.Elem() + continue + } + break + } + // No luck yet, but if this is a base type (non-pointer), the pointer might satisfy. + if typ.Kind() != reflect.Ptr { + // Not a pointer, but does the pointer work? + if reflect.PtrTo(typ).Implements(gobEncDecType) { + return true, -1 + } + } + return false, 0 +} + +// userType returns, and saves, the information associated with user-provided type rt. +// If the user type is not valid, it calls error. +func userType(rt reflect.Type) *userTypeInfo { + ut, err := validUserType(rt) + if err != nil { + error_(err) + } + return ut +} + +// A typeId represents a gob Type as an integer that can be passed on the wire. +// Internally, typeIds are used as keys to a map to recover the underlying type info. +type typeId int32 + +var nextId typeId // incremented for each new type we build +var typeLock sync.Mutex // set while building a type +const firstUserId = 64 // lowest id number granted to user + +type gobType interface { + id() typeId + setId(id typeId) + name() string + string() string // not public; only for debugging + safeString(seen map[typeId]bool) string +} + +var types = make(map[reflect.Type]gobType) +var idToType = make(map[typeId]gobType) +var builtinIdToType map[typeId]gobType // set in init() after builtins are established + +func setTypeId(typ gobType) { + // When building recursive types, someone may get there before us. + if typ.id() != 0 { + return + } + nextId++ + typ.setId(nextId) + idToType[nextId] = typ +} + +func (t typeId) gobType() gobType { + if t == 0 { + return nil + } + return idToType[t] +} + +// string returns the string representation of the type associated with the typeId. +func (t typeId) string() string { + if t.gobType() == nil { + return "" + } + return t.gobType().string() +} + +// Name returns the name of the type associated with the typeId. +func (t typeId) name() string { + if t.gobType() == nil { + return "" + } + return t.gobType().name() +} + +// CommonType holds elements of all types. +// It is a historical artifact, kept for binary compatibility and exported +// only for the benefit of the package's encoding of type descriptors. It is +// not intended for direct use by clients. +type CommonType struct { + Name string + Id typeId +} + +func (t *CommonType) id() typeId { return t.Id } + +func (t *CommonType) setId(id typeId) { t.Id = id } + +func (t *CommonType) string() string { return t.Name } + +func (t *CommonType) safeString(seen map[typeId]bool) string { + return t.Name +} + +func (t *CommonType) name() string { return t.Name } + +// Create and check predefined types +// The string for tBytes is "bytes" not "[]byte" to signify its specialness. + +var ( + // Primordial types, needed during initialization. + // Always passed as pointers so the interface{} type + // goes through without losing its interfaceness. + tBool = bootstrapType("bool", (*bool)(nil), 1) + tInt = bootstrapType("int", (*int)(nil), 2) + tUint = bootstrapType("uint", (*uint)(nil), 3) + tFloat = bootstrapType("float", (*float64)(nil), 4) + tBytes = bootstrapType("bytes", (*[]byte)(nil), 5) + tString = bootstrapType("string", (*string)(nil), 6) + tComplex = bootstrapType("complex", (*complex128)(nil), 7) + tInterface = bootstrapType("interface", (*interface{})(nil), 8) + // Reserve some Ids for compatible expansion + tReserved7 = bootstrapType("_reserved1", (*struct{ r7 int })(nil), 9) + tReserved6 = bootstrapType("_reserved1", (*struct{ r6 int })(nil), 10) + tReserved5 = bootstrapType("_reserved1", (*struct{ r5 int })(nil), 11) + tReserved4 = bootstrapType("_reserved1", (*struct{ r4 int })(nil), 12) + tReserved3 = bootstrapType("_reserved1", (*struct{ r3 int })(nil), 13) + tReserved2 = bootstrapType("_reserved1", (*struct{ r2 int })(nil), 14) + tReserved1 = bootstrapType("_reserved1", (*struct{ r1 int })(nil), 15) +) + +// Predefined because it's needed by the Decoder +var tWireType = mustGetTypeInfo(reflect.TypeOf(wireType{})).id +var wireTypeUserInfo *userTypeInfo // userTypeInfo of (*wireType) + +func init() { + // Some magic numbers to make sure there are no surprises. + checkId(16, tWireType) + checkId(17, mustGetTypeInfo(reflect.TypeOf(arrayType{})).id) + checkId(18, mustGetTypeInfo(reflect.TypeOf(CommonType{})).id) + checkId(19, mustGetTypeInfo(reflect.TypeOf(sliceType{})).id) + checkId(20, mustGetTypeInfo(reflect.TypeOf(structType{})).id) + checkId(21, mustGetTypeInfo(reflect.TypeOf(fieldType{})).id) + checkId(23, mustGetTypeInfo(reflect.TypeOf(mapType{})).id) + + builtinIdToType = make(map[typeId]gobType) + for k, v := range idToType { + builtinIdToType[k] = v + } + + // Move the id space upwards to allow for growth in the predefined world + // without breaking existing files. + if nextId > firstUserId { + panic(fmt.Sprintln("nextId too large:", nextId)) + } + nextId = firstUserId + registerBasics() + wireTypeUserInfo = userType(reflect.TypeOf((*wireType)(nil))) +} + +// Array type +type arrayType struct { + CommonType + Elem typeId + Len int +} + +func newArrayType(name string) *arrayType { + a := &arrayType{CommonType{Name: name}, 0, 0} + return a +} + +func (a *arrayType) init(elem gobType, len int) { + // Set our type id before evaluating the element's, in case it's our own. + setTypeId(a) + a.Elem = elem.id() + a.Len = len +} + +func (a *arrayType) safeString(seen map[typeId]bool) string { + if seen[a.Id] { + return a.Name + } + seen[a.Id] = true + return fmt.Sprintf("[%d]%s", a.Len, a.Elem.gobType().safeString(seen)) +} + +func (a *arrayType) string() string { return a.safeString(make(map[typeId]bool)) } + +// GobEncoder type (something that implements the GobEncoder interface) +type gobEncoderType struct { + CommonType +} + +func newGobEncoderType(name string) *gobEncoderType { + g := &gobEncoderType{CommonType{Name: name}} + setTypeId(g) + return g +} + +func (g *gobEncoderType) safeString(seen map[typeId]bool) string { + return g.Name +} + +func (g *gobEncoderType) string() string { return g.Name } + +// Map type +type mapType struct { + CommonType + Key typeId + Elem typeId +} + +func newMapType(name string) *mapType { + m := &mapType{CommonType{Name: name}, 0, 0} + return m +} + +func (m *mapType) init(key, elem gobType) { + // Set our type id before evaluating the element's, in case it's our own. + setTypeId(m) + m.Key = key.id() + m.Elem = elem.id() +} + +func (m *mapType) safeString(seen map[typeId]bool) string { + if seen[m.Id] { + return m.Name + } + seen[m.Id] = true + key := m.Key.gobType().safeString(seen) + elem := m.Elem.gobType().safeString(seen) + return fmt.Sprintf("map[%s]%s", key, elem) +} + +func (m *mapType) string() string { return m.safeString(make(map[typeId]bool)) } + +// Slice type +type sliceType struct { + CommonType + Elem typeId +} + +func newSliceType(name string) *sliceType { + s := &sliceType{CommonType{Name: name}, 0} + return s +} + +func (s *sliceType) init(elem gobType) { + // Set our type id before evaluating the element's, in case it's our own. + setTypeId(s) + // See the comments about ids in newTypeObject. Only slices and + // structs have mutual recursion. + if elem.id() == 0 { + setTypeId(elem) + } + s.Elem = elem.id() +} + +func (s *sliceType) safeString(seen map[typeId]bool) string { + if seen[s.Id] { + return s.Name + } + seen[s.Id] = true + return fmt.Sprintf("[]%s", s.Elem.gobType().safeString(seen)) +} + +func (s *sliceType) string() string { return s.safeString(make(map[typeId]bool)) } + +// Struct type +type fieldType struct { + Name string + Id typeId +} + +type structType struct { + CommonType + Field []*fieldType +} + +func (s *structType) safeString(seen map[typeId]bool) string { + if s == nil { + return "" + } + if _, ok := seen[s.Id]; ok { + return s.Name + } + seen[s.Id] = true + str := s.Name + " = struct { " + for _, f := range s.Field { + str += fmt.Sprintf("%s %s; ", f.Name, f.Id.gobType().safeString(seen)) + } + str += "}" + return str +} + +func (s *structType) string() string { return s.safeString(make(map[typeId]bool)) } + +func newStructType(name string) *structType { + s := &structType{CommonType{Name: name}, nil} + // For historical reasons we set the id here rather than init. + // See the comment in newTypeObject for details. + setTypeId(s) + return s +} + +// newTypeObject allocates a gobType for the reflection type rt. +// Unless ut represents a GobEncoder, rt should be the base type +// of ut. +// This is only called from the encoding side. The decoding side +// works through typeIds and userTypeInfos alone. +func newTypeObject(name string, ut *userTypeInfo, rt reflect.Type) (gobType, error) { + // Does this type implement GobEncoder? + if ut.externalEnc != 0 { + return newGobEncoderType(name), nil + } + var err error + var type0, type1 gobType + defer func() { + if err != nil { + delete(types, rt) + } + }() + // Install the top-level type before the subtypes (e.g. struct before + // fields) so recursive types can be constructed safely. + switch t := rt; t.Kind() { + // All basic types are easy: they are predefined. + case reflect.Bool: + return tBool.gobType(), nil + + case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: + return tInt.gobType(), nil + + case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: + return tUint.gobType(), nil + + case reflect.Float32, reflect.Float64: + return tFloat.gobType(), nil + + case reflect.Complex64, reflect.Complex128: + return tComplex.gobType(), nil + + case reflect.String: + return tString.gobType(), nil + + case reflect.Interface: + return tInterface.gobType(), nil + + case reflect.Array: + at := newArrayType(name) + types[rt] = at + type0, err = getBaseType("", t.Elem()) + if err != nil { + return nil, err + } + // Historical aside: + // For arrays, maps, and slices, we set the type id after the elements + // are constructed. This is to retain the order of type id allocation after + // a fix made to handle recursive types, which changed the order in + // which types are built. Delaying the setting in this way preserves + // type ids while allowing recursive types to be described. Structs, + // done below, were already handling recursion correctly so they + // assign the top-level id before those of the field. + at.init(type0, t.Len()) + return at, nil + + case reflect.Map: + mt := newMapType(name) + types[rt] = mt + type0, err = getBaseType("", t.Key()) + if err != nil { + return nil, err + } + type1, err = getBaseType("", t.Elem()) + if err != nil { + return nil, err + } + mt.init(type0, type1) + return mt, nil + + case reflect.Slice: + // []byte == []uint8 is a special case + if t.Elem().Kind() == reflect.Uint8 { + return tBytes.gobType(), nil + } + st := newSliceType(name) + types[rt] = st + type0, err = getBaseType(t.Elem().Name(), t.Elem()) + if err != nil { + return nil, err + } + st.init(type0) + return st, nil + + case reflect.Struct: + st := newStructType(name) + types[rt] = st + idToType[st.id()] = st + for i := 0; i < t.NumField(); i++ { + f := t.Field(i) + if !isSent(&f) { + continue + } + typ := userType(f.Type).base + tname := typ.Name() + if tname == "" { + t := userType(f.Type).base + tname = t.String() + } + gt, err := getBaseType(tname, f.Type) + if err != nil { + return nil, err + } + // Some mutually recursive types can cause us to be here while + // still defining the element. Fix the element type id here. + // We could do this more neatly by setting the id at the start of + // building every type, but that would break binary compatibility. + if gt.id() == 0 { + setTypeId(gt) + } + st.Field = append(st.Field, &fieldType{f.Name, gt.id()}) + } + return st, nil + + default: + return nil, errors.New("gob NewTypeObject can't handle type: " + rt.String()) + } +} + +// isExported reports whether this is an exported - upper case - name. +func isExported(name string) bool { + rune, _ := utf8.DecodeRuneInString(name) + return unicode.IsUpper(rune) +} + +// isSent reports whether this struct field is to be transmitted. +// It will be transmitted only if it is exported and not a chan or func field +// or pointer to chan or func. +func isSent(field *reflect.StructField) bool { + if !isExported(field.Name) { + return false + } + // If the field is a chan or func or pointer thereto, don't send it. + // That is, treat it like an unexported field. + typ := field.Type + for typ.Kind() == reflect.Ptr { + typ = typ.Elem() + } + if typ.Kind() == reflect.Chan || typ.Kind() == reflect.Func { + return false + } + return true +} + +// getBaseType returns the Gob type describing the given reflect.Type's base type. +// typeLock must be held. +func getBaseType(name string, rt reflect.Type) (gobType, error) { + ut := userType(rt) + return getType(name, ut, ut.base) +} + +// getType returns the Gob type describing the given reflect.Type. +// Should be called only when handling GobEncoders/Decoders, +// which may be pointers. All other types are handled through the +// base type, never a pointer. +// typeLock must be held. +func getType(name string, ut *userTypeInfo, rt reflect.Type) (gobType, error) { + typ, present := types[rt] + if present { + return typ, nil + } + typ, err := newTypeObject(name, ut, rt) + if err == nil { + types[rt] = typ + } + return typ, err +} + +func checkId(want, got typeId) { + if want != got { + fmt.Fprintf(os.Stderr, "checkId: %d should be %d\n", int(got), int(want)) + panic("bootstrap type wrong id: " + got.name() + " " + got.string() + " not " + want.string()) + } +} + +// used for building the basic types; called only from init(). the incoming +// interface always refers to a pointer. +func bootstrapType(name string, e interface{}, expect typeId) typeId { + rt := reflect.TypeOf(e).Elem() + _, present := types[rt] + if present { + panic("bootstrap type already present: " + name + ", " + rt.String()) + } + typ := &CommonType{Name: name} + types[rt] = typ + setTypeId(typ) + checkId(expect, nextId) + userType(rt) // might as well cache it now + return nextId +} + +// Representation of the information we send and receive about this type. +// Each value we send is preceded by its type definition: an encoded int. +// However, the very first time we send the value, we first send the pair +// (-id, wireType). +// For bootstrapping purposes, we assume that the recipient knows how +// to decode a wireType; it is exactly the wireType struct here, interpreted +// using the gob rules for sending a structure, except that we assume the +// ids for wireType and structType etc. are known. The relevant pieces +// are built in encode.go's init() function. +// To maintain binary compatibility, if you extend this type, always put +// the new fields last. +type wireType struct { + ArrayT *arrayType + SliceT *sliceType + StructT *structType + MapT *mapType + GobEncoderT *gobEncoderType + BinaryMarshalerT *gobEncoderType + TextMarshalerT *gobEncoderType +} + +func (w *wireType) string() string { + const unknown = "unknown type" + if w == nil { + return unknown + } + switch { + case w.ArrayT != nil: + return w.ArrayT.Name + case w.SliceT != nil: + return w.SliceT.Name + case w.StructT != nil: + return w.StructT.Name + case w.MapT != nil: + return w.MapT.Name + case w.GobEncoderT != nil: + return w.GobEncoderT.Name + case w.BinaryMarshalerT != nil: + return w.BinaryMarshalerT.Name + case w.TextMarshalerT != nil: + return w.TextMarshalerT.Name + } + return unknown +} + +type typeInfo struct { + id typeId + encInit sync.Mutex // protects creation of encoder + encoder atomic.Value // *encEngine + wire *wireType +} + +// typeInfoMap is an atomic pointer to map[reflect.Type]*typeInfo. +// It's updated copy-on-write. Readers just do an atomic load +// to get the current version of the map. Writers make a full copy of +// the map and atomically update the pointer to point to the new map. +// Under heavy read contention, this is significantly faster than a map +// protected by a mutex. +var typeInfoMap atomic.Value + +func lookupTypeInfo(rt reflect.Type) *typeInfo { + m, _ := typeInfoMap.Load().(map[reflect.Type]*typeInfo) + return m[rt] +} + +func getTypeInfo(ut *userTypeInfo) (*typeInfo, error) { + rt := ut.base + if ut.externalEnc != 0 { + // We want the user type, not the base type. + rt = ut.user + } + if info := lookupTypeInfo(rt); info != nil { + return info, nil + } + return buildTypeInfo(ut, rt) +} + +// buildTypeInfo constructs the type information for the type +// and stores it in the type info map. +func buildTypeInfo(ut *userTypeInfo, rt reflect.Type) (*typeInfo, error) { + typeLock.Lock() + defer typeLock.Unlock() + + if info := lookupTypeInfo(rt); info != nil { + return info, nil + } + + gt, err := getBaseType(rt.Name(), rt) + if err != nil { + return nil, err + } + info := &typeInfo{id: gt.id()} + + if ut.externalEnc != 0 { + userType, err := getType(rt.Name(), ut, rt) + if err != nil { + return nil, err + } + gt := userType.id().gobType().(*gobEncoderType) + switch ut.externalEnc { + case xGob: + info.wire = &wireType{GobEncoderT: gt} + case xBinary: + info.wire = &wireType{BinaryMarshalerT: gt} + case xText: + info.wire = &wireType{TextMarshalerT: gt} + } + rt = ut.user + } else { + t := info.id.gobType() + switch typ := rt; typ.Kind() { + case reflect.Array: + info.wire = &wireType{ArrayT: t.(*arrayType)} + case reflect.Map: + info.wire = &wireType{MapT: t.(*mapType)} + case reflect.Slice: + // []byte == []uint8 is a special case handled separately + if typ.Elem().Kind() != reflect.Uint8 { + info.wire = &wireType{SliceT: t.(*sliceType)} + } + case reflect.Struct: + info.wire = &wireType{StructT: t.(*structType)} + } + } + + // Create new map with old contents plus new entry. + newm := make(map[reflect.Type]*typeInfo) + m, _ := typeInfoMap.Load().(map[reflect.Type]*typeInfo) + for k, v := range m { + newm[k] = v + } + newm[rt] = info + typeInfoMap.Store(newm) + return info, nil +} + +// Called only when a panic is acceptable and unexpected. +func mustGetTypeInfo(rt reflect.Type) *typeInfo { + t, err := getTypeInfo(userType(rt)) + if err != nil { + panic("getTypeInfo: " + err.Error()) + } + return t +} + +// GobEncoder is the interface describing data that provides its own +// representation for encoding values for transmission to a GobDecoder. +// A type that implements GobEncoder and GobDecoder has complete +// control over the representation of its data and may therefore +// contain things such as private fields, channels, and functions, +// which are not usually transmissible in gob streams. +// +// Note: Since gobs can be stored permanently, It is good design +// to guarantee the encoding used by a GobEncoder is stable as the +// software evolves. For instance, it might make sense for GobEncode +// to include a version number in the encoding. +type GobEncoder interface { + // GobEncode returns a byte slice representing the encoding of the + // receiver for transmission to a GobDecoder, usually of the same + // concrete type. + GobEncode() ([]byte, error) +} + +// GobDecoder is the interface describing data that provides its own +// routine for decoding transmitted values sent by a GobEncoder. +type GobDecoder interface { + // GobDecode overwrites the receiver, which must be a pointer, + // with the value represented by the byte slice, which was written + // by GobEncode, usually for the same concrete type. + GobDecode([]byte) error +} + +var ( + registerLock sync.RWMutex + nameToConcreteType = make(map[string]reflect.Type) + concreteTypeToName = make(map[reflect.Type]string) +) + +// RegisterName is like Register but uses the provided name rather than the +// type's default. +func RegisterName(name string, value interface{}) { + if name == "" { + // reserved for nil + panic("attempt to register empty name") + } + registerLock.Lock() + defer registerLock.Unlock() + ut := userType(reflect.TypeOf(value)) + // Check for incompatible duplicates. The name must refer to the + // same user type, and vice versa. + if t, ok := nameToConcreteType[name]; ok && t != ut.user { + panic(fmt.Sprintf("gob: registering duplicate types for %q: %s != %s", name, t, ut.user)) + } + if n, ok := concreteTypeToName[ut.base]; ok && n != name { + panic(fmt.Sprintf("gob: registering duplicate names for %s: %q != %q", ut.user, n, name)) + } + // Store the name and type provided by the user.... + nameToConcreteType[name] = reflect.TypeOf(value) + // but the flattened type in the type table, since that's what decode needs. + concreteTypeToName[ut.base] = name +} + +// Register records a type, identified by a value for that type, under its +// internal type name. That name will identify the concrete type of a value +// sent or received as an interface variable. Only types that will be +// transferred as implementations of interface values need to be registered. +// Expecting to be used only during initialization, it panics if the mapping +// between types and names is not a bijection. +func Register(value interface{}) { + // Default to printed representation for unnamed types + rt := reflect.TypeOf(value) + name := rt.String() + + // But for named types (or pointers to them), qualify with import path (but see inner comment). + // Dereference one pointer looking for a named type. + star := "" + if rt.Name() == "" { + if pt := rt; pt.Kind() == reflect.Ptr { + star = "*" + // NOTE: The following line should be rt = pt.Elem() to implement + // what the comment above claims, but fixing it would break compatibility + // with existing gobs. + // + // Given package p imported as "full/p" with these definitions: + // package p + // type T1 struct { ... } + // this table shows the intended and actual strings used by gob to + // name the types: + // + // Type Correct string Actual string + // + // T1 full/p.T1 full/p.T1 + // *T1 *full/p.T1 *p.T1 + // + // The missing full path cannot be fixed without breaking existing gob decoders. + rt = pt + } + } + if rt.Name() != "" { + if rt.PkgPath() == "" { + name = star + rt.Name() + } else { + name = star + rt.PkgPath() + "." + rt.Name() + } + } + + RegisterName(name, value) +} + +func registerBasics() { + Register(int(0)) + Register(int8(0)) + Register(int16(0)) + Register(int32(0)) + Register(int64(0)) + Register(uint(0)) + Register(uint8(0)) + Register(uint16(0)) + Register(uint32(0)) + Register(uint64(0)) + Register(float32(0)) + Register(float64(0)) + Register(complex64(0i)) + Register(complex128(0i)) + Register(uintptr(0)) + Register(false) + Register("") + Register([]byte(nil)) + Register([]int(nil)) + Register([]int8(nil)) + Register([]int16(nil)) + Register([]int32(nil)) + Register([]int64(nil)) + Register([]uint(nil)) + Register([]uint8(nil)) + Register([]uint16(nil)) + Register([]uint32(nil)) + Register([]uint64(nil)) + Register([]float32(nil)) + Register([]float64(nil)) + Register([]complex64(nil)) + Register([]complex128(nil)) + Register([]uintptr(nil)) + Register([]bool(nil)) + Register([]string(nil)) +} diff --git a/src/encoding/gob/type_test.go b/src/encoding/gob/type_test.go new file mode 100644 index 0000000000000000000000000000000000000000..e230d22d4315584702e5f89ace19f6ee8088b547 --- /dev/null +++ b/src/encoding/gob/type_test.go @@ -0,0 +1,222 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package gob + +import ( + "bytes" + "reflect" + "testing" +) + +type typeT struct { + id typeId + str string +} + +var basicTypes = []typeT{ + {tBool, "bool"}, + {tInt, "int"}, + {tUint, "uint"}, + {tFloat, "float"}, + {tBytes, "bytes"}, + {tString, "string"}, +} + +func getTypeUnlocked(name string, rt reflect.Type) gobType { + typeLock.Lock() + defer typeLock.Unlock() + t, err := getBaseType(name, rt) + if err != nil { + panic("getTypeUnlocked: " + err.Error()) + } + return t +} + +// Sanity checks +func TestBasic(t *testing.T) { + for _, tt := range basicTypes { + if tt.id.string() != tt.str { + t.Errorf("checkType: expected %q got %s", tt.str, tt.id.string()) + } + if tt.id == 0 { + t.Errorf("id for %q is zero", tt.str) + } + } +} + +// Reregister some basic types to check registration is idempotent. +func TestReregistration(t *testing.T) { + newtyp := getTypeUnlocked("int", reflect.TypeOf(int(0))) + if newtyp != tInt.gobType() { + t.Errorf("reregistration of %s got new type", newtyp.string()) + } + newtyp = getTypeUnlocked("uint", reflect.TypeOf(uint(0))) + if newtyp != tUint.gobType() { + t.Errorf("reregistration of %s got new type", newtyp.string()) + } + newtyp = getTypeUnlocked("string", reflect.TypeOf("hello")) + if newtyp != tString.gobType() { + t.Errorf("reregistration of %s got new type", newtyp.string()) + } +} + +func TestArrayType(t *testing.T) { + var a3 [3]int + a3int := getTypeUnlocked("foo", reflect.TypeOf(a3)) + newa3int := getTypeUnlocked("bar", reflect.TypeOf(a3)) + if a3int != newa3int { + t.Errorf("second registration of [3]int creates new type") + } + var a4 [4]int + a4int := getTypeUnlocked("goo", reflect.TypeOf(a4)) + if a3int == a4int { + t.Errorf("registration of [3]int creates same type as [4]int") + } + var b3 [3]bool + a3bool := getTypeUnlocked("", reflect.TypeOf(b3)) + if a3int == a3bool { + t.Errorf("registration of [3]bool creates same type as [3]int") + } + str := a3bool.string() + expected := "[3]bool" + if str != expected { + t.Errorf("array printed as %q; expected %q", str, expected) + } +} + +func TestSliceType(t *testing.T) { + var s []int + sint := getTypeUnlocked("slice", reflect.TypeOf(s)) + var news []int + newsint := getTypeUnlocked("slice1", reflect.TypeOf(news)) + if sint != newsint { + t.Errorf("second registration of []int creates new type") + } + var b []bool + sbool := getTypeUnlocked("", reflect.TypeOf(b)) + if sbool == sint { + t.Errorf("registration of []bool creates same type as []int") + } + str := sbool.string() + expected := "[]bool" + if str != expected { + t.Errorf("slice printed as %q; expected %q", str, expected) + } +} + +func TestMapType(t *testing.T) { + var m map[string]int + mapStringInt := getTypeUnlocked("map", reflect.TypeOf(m)) + var newm map[string]int + newMapStringInt := getTypeUnlocked("map1", reflect.TypeOf(newm)) + if mapStringInt != newMapStringInt { + t.Errorf("second registration of map[string]int creates new type") + } + var b map[string]bool + mapStringBool := getTypeUnlocked("", reflect.TypeOf(b)) + if mapStringBool == mapStringInt { + t.Errorf("registration of map[string]bool creates same type as map[string]int") + } + str := mapStringBool.string() + expected := "map[string]bool" + if str != expected { + t.Errorf("map printed as %q; expected %q", str, expected) + } +} + +type Bar struct { + X string +} + +// This structure has pointers and refers to itself, making it a good test case. +type Foo struct { + A int + B int32 // will become int + C string + D []byte + E *float64 // will become float64 + F ****float64 // will become float64 + G *Bar + H *Bar // should not interpolate the definition of Bar again + I *Foo // will not explode +} + +func TestStructType(t *testing.T) { + sstruct := getTypeUnlocked("Foo", reflect.TypeOf(Foo{})) + str := sstruct.string() + // If we can print it correctly, we built it correctly. + expected := "Foo = struct { A int; B int; C string; D bytes; E float; F float; G Bar = struct { X string; }; H Bar; I Foo; }" + if str != expected { + t.Errorf("struct printed as %q; expected %q", str, expected) + } +} + +// Should be OK to register the same type multiple times, as long as they're +// at the same level of indirection. +func TestRegistration(t *testing.T) { + type T struct{ a int } + Register(new(T)) + Register(new(T)) +} + +type N1 struct{} +type N2 struct{} + +// See comment in type.go/Register. +func TestRegistrationNaming(t *testing.T) { + testCases := []struct { + t interface{} + name string + }{ + {&N1{}, "*gob.N1"}, + {N2{}, "encoding/gob.N2"}, + } + + for _, tc := range testCases { + Register(tc.t) + + tct := reflect.TypeOf(tc.t) + registerLock.RLock() + ct := nameToConcreteType[tc.name] + registerLock.RUnlock() + if ct != tct { + t.Errorf("nameToConcreteType[%q] = %v, want %v", tc.name, ct, tct) + } + // concreteTypeToName is keyed off the base type. + if tct.Kind() == reflect.Ptr { + tct = tct.Elem() + } + if n := concreteTypeToName[tct]; n != tc.name { + t.Errorf("concreteTypeToName[%v] got %v, want %v", tct, n, tc.name) + } + } +} + +func TestStressParallel(t *testing.T) { + type T2 struct{ A int } + c := make(chan bool) + const N = 10 + for i := 0; i < N; i++ { + go func() { + p := new(T2) + Register(p) + b := new(bytes.Buffer) + enc := NewEncoder(b) + err := enc.Encode(p) + if err != nil { + t.Error("encoder fail:", err) + } + dec := NewDecoder(b) + err = dec.Decode(p) + if err != nil { + t.Error("decoder fail:", err) + } + c <- true + }() + } + for i := 0; i < N; i++ { + <-c + } +} diff --git a/src/encoding/hex/hex.go b/src/encoding/hex/hex.go new file mode 100644 index 0000000000000000000000000000000000000000..d1fc7024a97fa24c0ea8b096dfb5a7d144550848 --- /dev/null +++ b/src/encoding/hex/hex.go @@ -0,0 +1,216 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package hex implements hexadecimal encoding and decoding. +package hex + +import ( + "bytes" + "errors" + "fmt" + "io" +) + +const hextable = "0123456789abcdef" + +// EncodedLen returns the length of an encoding of n source bytes. +func EncodedLen(n int) int { return n * 2 } + +// Encode encodes src into EncodedLen(len(src)) +// bytes of dst. As a convenience, it returns the number +// of bytes written to dst, but this value is always EncodedLen(len(src)). +// Encode implements hexadecimal encoding. +func Encode(dst, src []byte) int { + for i, v := range src { + dst[i*2] = hextable[v>>4] + dst[i*2+1] = hextable[v&0x0f] + } + + return len(src) * 2 +} + +// ErrLength results from decoding an odd length slice. +var ErrLength = errors.New("encoding/hex: odd length hex string") + +// InvalidByteError values describe errors resulting from an invalid byte in a hex string. +type InvalidByteError byte + +func (e InvalidByteError) Error() string { + return fmt.Sprintf("encoding/hex: invalid byte: %#U", rune(e)) +} + +func DecodedLen(x int) int { return x / 2 } + +// Decode decodes src into DecodedLen(len(src)) bytes, returning the actual +// number of bytes written to dst. +// +// If Decode encounters invalid input, it returns an error describing the failure. +func Decode(dst, src []byte) (int, error) { + if len(src)%2 == 1 { + return 0, ErrLength + } + + for i := 0; i < len(src)/2; i++ { + a, ok := fromHexChar(src[i*2]) + if !ok { + return 0, InvalidByteError(src[i*2]) + } + b, ok := fromHexChar(src[i*2+1]) + if !ok { + return 0, InvalidByteError(src[i*2+1]) + } + dst[i] = (a << 4) | b + } + + return len(src) / 2, nil +} + +// fromHexChar converts a hex character into its value and a success flag. +func fromHexChar(c byte) (byte, bool) { + switch { + case '0' <= c && c <= '9': + return c - '0', true + case 'a' <= c && c <= 'f': + return c - 'a' + 10, true + case 'A' <= c && c <= 'F': + return c - 'A' + 10, true + } + + return 0, false +} + +// EncodeToString returns the hexadecimal encoding of src. +func EncodeToString(src []byte) string { + dst := make([]byte, EncodedLen(len(src))) + Encode(dst, src) + return string(dst) +} + +// DecodeString returns the bytes represented by the hexadecimal string s. +func DecodeString(s string) ([]byte, error) { + src := []byte(s) + dst := make([]byte, DecodedLen(len(src))) + _, err := Decode(dst, src) + if err != nil { + return nil, err + } + return dst, nil +} + +// Dump returns a string that contains a hex dump of the given data. The format +// of the hex dump matches the output of `hexdump -C` on the command line. +func Dump(data []byte) string { + var buf bytes.Buffer + dumper := Dumper(&buf) + dumper.Write(data) + dumper.Close() + return string(buf.Bytes()) +} + +// Dumper returns a WriteCloser that writes a hex dump of all written data to +// w. The format of the dump matches the output of `hexdump -C` on the command +// line. +func Dumper(w io.Writer) io.WriteCloser { + return &dumper{w: w} +} + +type dumper struct { + w io.Writer + rightChars [18]byte + buf [14]byte + used int // number of bytes in the current line + n uint // number of bytes, total +} + +func toChar(b byte) byte { + if b < 32 || b > 126 { + return '.' + } + return b +} + +func (h *dumper) Write(data []byte) (n int, err error) { + // Output lines look like: + // 00000010 2e 2f 30 31 32 33 34 35 36 37 38 39 3a 3b 3c 3d |./0123456789:;<=| + // ^ offset ^ extra space ^ ASCII of line. + for i := range data { + if h.used == 0 { + // At the beginning of a line we print the current + // offset in hex. + h.buf[0] = byte(h.n >> 24) + h.buf[1] = byte(h.n >> 16) + h.buf[2] = byte(h.n >> 8) + h.buf[3] = byte(h.n) + Encode(h.buf[4:], h.buf[:4]) + h.buf[12] = ' ' + h.buf[13] = ' ' + _, err = h.w.Write(h.buf[4:]) + if err != nil { + return + } + } + Encode(h.buf[:], data[i:i+1]) + h.buf[2] = ' ' + l := 3 + if h.used == 7 { + // There's an additional space after the 8th byte. + h.buf[3] = ' ' + l = 4 + } else if h.used == 15 { + // At the end of the line there's an extra space and + // the bar for the right column. + h.buf[3] = ' ' + h.buf[4] = '|' + l = 5 + } + _, err = h.w.Write(h.buf[:l]) + if err != nil { + return + } + n++ + h.rightChars[h.used] = toChar(data[i]) + h.used++ + h.n++ + if h.used == 16 { + h.rightChars[16] = '|' + h.rightChars[17] = '\n' + _, err = h.w.Write(h.rightChars[:]) + if err != nil { + return + } + h.used = 0 + } + } + return +} + +func (h *dumper) Close() (err error) { + // See the comments in Write() for the details of this format. + if h.used == 0 { + return + } + h.buf[0] = ' ' + h.buf[1] = ' ' + h.buf[2] = ' ' + h.buf[3] = ' ' + h.buf[4] = '|' + nBytes := h.used + for h.used < 16 { + l := 3 + if h.used == 7 { + l = 4 + } else if h.used == 15 { + l = 5 + } + _, err = h.w.Write(h.buf[:l]) + if err != nil { + return + } + h.used++ + } + h.rightChars[nBytes] = '|' + h.rightChars[nBytes+1] = '\n' + _, err = h.w.Write(h.rightChars[:nBytes+2]) + return +} diff --git a/src/encoding/hex/hex_test.go b/src/encoding/hex/hex_test.go new file mode 100644 index 0000000000000000000000000000000000000000..b969636cd5e6a330df08f03964f06df2fb1024db --- /dev/null +++ b/src/encoding/hex/hex_test.go @@ -0,0 +1,153 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package hex + +import ( + "bytes" + "testing" +) + +type encDecTest struct { + enc string + dec []byte +} + +var encDecTests = []encDecTest{ + {"", []byte{}}, + {"0001020304050607", []byte{0, 1, 2, 3, 4, 5, 6, 7}}, + {"08090a0b0c0d0e0f", []byte{8, 9, 10, 11, 12, 13, 14, 15}}, + {"f0f1f2f3f4f5f6f7", []byte{0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7}}, + {"f8f9fafbfcfdfeff", []byte{0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff}}, + {"67", []byte{'g'}}, + {"e3a1", []byte{0xe3, 0xa1}}, +} + +func TestEncode(t *testing.T) { + for i, test := range encDecTests { + dst := make([]byte, EncodedLen(len(test.dec))) + n := Encode(dst, test.dec) + if n != len(dst) { + t.Errorf("#%d: bad return value: got: %d want: %d", i, n, len(dst)) + } + if string(dst) != test.enc { + t.Errorf("#%d: got: %#v want: %#v", i, dst, test.enc) + } + } +} + +func TestDecode(t *testing.T) { + // Case for decoding uppercase hex characters, since + // Encode always uses lowercase. + decTests := append(encDecTests, encDecTest{"F8F9FAFBFCFDFEFF", []byte{0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff}}) + for i, test := range decTests { + dst := make([]byte, DecodedLen(len(test.enc))) + n, err := Decode(dst, []byte(test.enc)) + if err != nil { + t.Errorf("#%d: bad return value: got:%d want:%d", i, n, len(dst)) + } else if !bytes.Equal(dst, test.dec) { + t.Errorf("#%d: got: %#v want: %#v", i, dst, test.dec) + } + } +} + +func TestEncodeToString(t *testing.T) { + for i, test := range encDecTests { + s := EncodeToString(test.dec) + if s != test.enc { + t.Errorf("#%d got:%s want:%s", i, s, test.enc) + } + } +} + +func TestDecodeString(t *testing.T) { + for i, test := range encDecTests { + dst, err := DecodeString(test.enc) + if err != nil { + t.Errorf("#%d: unexpected err value: %s", i, err) + continue + } + if !bytes.Equal(dst, test.dec) { + t.Errorf("#%d: got: %#v want: #%v", i, dst, test.dec) + } + } +} + +type errTest struct { + in string + err string +} + +var errTests = []errTest{ + {"0", "encoding/hex: odd length hex string"}, + {"0g", "encoding/hex: invalid byte: U+0067 'g'"}, + {"00gg", "encoding/hex: invalid byte: U+0067 'g'"}, + {"0\x01", "encoding/hex: invalid byte: U+0001"}, +} + +func TestInvalidErr(t *testing.T) { + for i, test := range errTests { + dst := make([]byte, DecodedLen(len(test.in))) + _, err := Decode(dst, []byte(test.in)) + if err == nil { + t.Errorf("#%d: expected error; got none", i) + } else if err.Error() != test.err { + t.Errorf("#%d: got: %v want: %v", i, err, test.err) + } + } +} + +func TestInvalidStringErr(t *testing.T) { + for i, test := range errTests { + _, err := DecodeString(test.in) + if err == nil { + t.Errorf("#%d: expected error; got none", i) + } else if err.Error() != test.err { + t.Errorf("#%d: got: %v want: %v", i, err, test.err) + } + } +} + +func TestDumper(t *testing.T) { + var in [40]byte + for i := range in { + in[i] = byte(i + 30) + } + + for stride := 1; stride < len(in); stride++ { + var out bytes.Buffer + dumper := Dumper(&out) + done := 0 + for done < len(in) { + todo := done + stride + if todo > len(in) { + todo = len(in) + } + dumper.Write(in[done:todo]) + done = todo + } + + dumper.Close() + if !bytes.Equal(out.Bytes(), expectedHexDump) { + t.Errorf("stride: %d failed. got:\n%s\nwant:\n%s", stride, out.Bytes(), expectedHexDump) + } + } +} + +func TestDump(t *testing.T) { + var in [40]byte + for i := range in { + in[i] = byte(i + 30) + } + + out := []byte(Dump(in[:])) + if !bytes.Equal(out, expectedHexDump) { + t.Errorf("got:\n%s\nwant:\n%s", out, expectedHexDump) + } +} + +var expectedHexDump = []byte(`00000000 1e 1f 20 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d |.. !"#$%&'()*+,-| +00000010 2e 2f 30 31 32 33 34 35 36 37 38 39 3a 3b 3c 3d |./0123456789:;<=| +00000020 3e 3f 40 41 42 43 44 45 |>?@ABCDE| +`) diff --git a/src/encoding/json/bench_test.go b/src/encoding/json/bench_test.go new file mode 100644 index 0000000000000000000000000000000000000000..ed89d1156eda8ef31a9ce243974acf1e987e1159 --- /dev/null +++ b/src/encoding/json/bench_test.go @@ -0,0 +1,223 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Large data benchmark. +// The JSON data is a summary of agl's changes in the +// go, webkit, and chromium open source projects. +// We benchmark converting between the JSON form +// and in-memory data structures. + +package json + +import ( + "bytes" + "compress/gzip" + "io/ioutil" + "os" + "strings" + "testing" +) + +type codeResponse struct { + Tree *codeNode `json:"tree"` + Username string `json:"username"` +} + +type codeNode struct { + Name string `json:"name"` + Kids []*codeNode `json:"kids"` + CLWeight float64 `json:"cl_weight"` + Touches int `json:"touches"` + MinT int64 `json:"min_t"` + MaxT int64 `json:"max_t"` + MeanT int64 `json:"mean_t"` +} + +var codeJSON []byte +var codeStruct codeResponse + +func codeInit() { + f, err := os.Open("testdata/code.json.gz") + if err != nil { + panic(err) + } + defer f.Close() + gz, err := gzip.NewReader(f) + if err != nil { + panic(err) + } + data, err := ioutil.ReadAll(gz) + if err != nil { + panic(err) + } + + codeJSON = data + + if err := Unmarshal(codeJSON, &codeStruct); err != nil { + panic("unmarshal code.json: " + err.Error()) + } + + if data, err = Marshal(&codeStruct); err != nil { + panic("marshal code.json: " + err.Error()) + } + + if !bytes.Equal(data, codeJSON) { + println("different lengths", len(data), len(codeJSON)) + for i := 0; i < len(data) && i < len(codeJSON); i++ { + if data[i] != codeJSON[i] { + println("re-marshal: changed at byte", i) + println("orig: ", string(codeJSON[i-10:i+10])) + println("new: ", string(data[i-10:i+10])) + break + } + } + panic("re-marshal code.json: different result") + } +} + +func BenchmarkCodeEncoder(b *testing.B) { + if codeJSON == nil { + b.StopTimer() + codeInit() + b.StartTimer() + } + enc := NewEncoder(ioutil.Discard) + for i := 0; i < b.N; i++ { + if err := enc.Encode(&codeStruct); err != nil { + b.Fatal("Encode:", err) + } + } + b.SetBytes(int64(len(codeJSON))) +} + +func BenchmarkCodeMarshal(b *testing.B) { + if codeJSON == nil { + b.StopTimer() + codeInit() + b.StartTimer() + } + for i := 0; i < b.N; i++ { + if _, err := Marshal(&codeStruct); err != nil { + b.Fatal("Marshal:", err) + } + } + b.SetBytes(int64(len(codeJSON))) +} + +func BenchmarkCodeDecoder(b *testing.B) { + if codeJSON == nil { + b.StopTimer() + codeInit() + b.StartTimer() + } + var buf bytes.Buffer + dec := NewDecoder(&buf) + var r codeResponse + for i := 0; i < b.N; i++ { + buf.Write(codeJSON) + // hide EOF + buf.WriteByte('\n') + buf.WriteByte('\n') + buf.WriteByte('\n') + if err := dec.Decode(&r); err != nil { + b.Fatal("Decode:", err) + } + } + b.SetBytes(int64(len(codeJSON))) +} + +func BenchmarkDecoderStream(b *testing.B) { + b.StopTimer() + var buf bytes.Buffer + dec := NewDecoder(&buf) + buf.WriteString(`"` + strings.Repeat("x", 1000000) + `"` + "\n\n\n") + var x interface{} + if err := dec.Decode(&x); err != nil { + b.Fatal("Decode:", err) + } + ones := strings.Repeat(" 1\n", 300000) + "\n\n\n" + b.StartTimer() + for i := 0; i < b.N; i++ { + if i%300000 == 0 { + buf.WriteString(ones) + } + x = nil + if err := dec.Decode(&x); err != nil || x != 1.0 { + b.Fatalf("Decode: %v after %d", err, i) + } + } +} + +func BenchmarkCodeUnmarshal(b *testing.B) { + if codeJSON == nil { + b.StopTimer() + codeInit() + b.StartTimer() + } + for i := 0; i < b.N; i++ { + var r codeResponse + if err := Unmarshal(codeJSON, &r); err != nil { + b.Fatal("Unmmarshal:", err) + } + } + b.SetBytes(int64(len(codeJSON))) +} + +func BenchmarkCodeUnmarshalReuse(b *testing.B) { + if codeJSON == nil { + b.StopTimer() + codeInit() + b.StartTimer() + } + var r codeResponse + for i := 0; i < b.N; i++ { + if err := Unmarshal(codeJSON, &r); err != nil { + b.Fatal("Unmmarshal:", err) + } + } +} + +func BenchmarkUnmarshalString(b *testing.B) { + data := []byte(`"hello, world"`) + var s string + + for i := 0; i < b.N; i++ { + if err := Unmarshal(data, &s); err != nil { + b.Fatal("Unmarshal:", err) + } + } +} + +func BenchmarkUnmarshalFloat64(b *testing.B) { + var f float64 + data := []byte(`3.14`) + + for i := 0; i < b.N; i++ { + if err := Unmarshal(data, &f); err != nil { + b.Fatal("Unmarshal:", err) + } + } +} + +func BenchmarkUnmarshalInt64(b *testing.B) { + var x int64 + data := []byte(`3`) + + for i := 0; i < b.N; i++ { + if err := Unmarshal(data, &x); err != nil { + b.Fatal("Unmarshal:", err) + } + } +} + +func BenchmarkIssue10335(b *testing.B) { + b.ReportAllocs() + var s struct{} + j := []byte(`{"a":{ }}`) + for n := 0; n < b.N; n++ { + if err := Unmarshal(j, &s); err != nil { + b.Fatal(err) + } + } +} diff --git a/src/encoding/json/decode.go b/src/encoding/json/decode.go new file mode 100644 index 0000000000000000000000000000000000000000..530e8521dc5e6eccecfd0cde8926edada7d793fe --- /dev/null +++ b/src/encoding/json/decode.go @@ -0,0 +1,1093 @@ +// Copyright 2010 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Represents JSON data structure using native Go types: booleans, floats, +// strings, arrays, and maps. + +package json + +import ( + "bytes" + "encoding" + "encoding/base64" + "errors" + "fmt" + "reflect" + "runtime" + "strconv" + "unicode" + "unicode/utf16" + "unicode/utf8" +) + +// Unmarshal parses the JSON-encoded data and stores the result +// in the value pointed to by v. +// +// Unmarshal uses the inverse of the encodings that +// Marshal uses, allocating maps, slices, and pointers as necessary, +// with the following additional rules: +// +// To unmarshal JSON into a pointer, Unmarshal first handles the case of +// the JSON being the JSON literal null. In that case, Unmarshal sets +// the pointer to nil. Otherwise, Unmarshal unmarshals the JSON into +// the value pointed at by the pointer. If the pointer is nil, Unmarshal +// allocates a new value for it to point to. +// +// To unmarshal JSON into a struct, Unmarshal matches incoming object +// keys to the keys used by Marshal (either the struct field name or its tag), +// preferring an exact match but also accepting a case-insensitive match. +// +// To unmarshal JSON into an interface value, +// Unmarshal stores one of these in the interface value: +// +// bool, for JSON booleans +// float64, for JSON numbers +// string, for JSON strings +// []interface{}, for JSON arrays +// map[string]interface{}, for JSON objects +// nil for JSON null +// +// To unmarshal a JSON array into a slice, Unmarshal resets the slice to nil +// and then appends each element to the slice. +// +// To unmarshal a JSON object into a map, Unmarshal replaces the map +// with an empty map and then adds key-value pairs from the object to +// the map. +// +// If a JSON value is not appropriate for a given target type, +// or if a JSON number overflows the target type, Unmarshal +// skips that field and completes the unmarshalling as best it can. +// If no more serious errors are encountered, Unmarshal returns +// an UnmarshalTypeError describing the earliest such error. +// +// The JSON null value unmarshals into an interface, map, pointer, or slice +// by setting that Go value to nil. Because null is often used in JSON to mean +// ``not present,'' unmarshaling a JSON null into any other Go type has no effect +// on the value and produces no error. +// +// When unmarshaling quoted strings, invalid UTF-8 or +// invalid UTF-16 surrogate pairs are not treated as an error. +// Instead, they are replaced by the Unicode replacement +// character U+FFFD. +// +func Unmarshal(data []byte, v interface{}) error { + // Check for well-formedness. + // Avoids filling out half a data structure + // before discovering a JSON syntax error. + var d decodeState + err := checkValid(data, &d.scan) + if err != nil { + return err + } + + d.init(data) + return d.unmarshal(v) +} + +// Unmarshaler is the interface implemented by objects +// that can unmarshal a JSON description of themselves. +// The input can be assumed to be a valid encoding of +// a JSON value. UnmarshalJSON must copy the JSON data +// if it wishes to retain the data after returning. +type Unmarshaler interface { + UnmarshalJSON([]byte) error +} + +// An UnmarshalTypeError describes a JSON value that was +// not appropriate for a value of a specific Go type. +type UnmarshalTypeError struct { + Value string // description of JSON value - "bool", "array", "number -5" + Type reflect.Type // type of Go value it could not be assigned to + Offset int64 // error occurred after reading Offset bytes +} + +func (e *UnmarshalTypeError) Error() string { + return "json: cannot unmarshal " + e.Value + " into Go value of type " + e.Type.String() +} + +// An UnmarshalFieldError describes a JSON object key that +// led to an unexported (and therefore unwritable) struct field. +// (No longer used; kept for compatibility.) +type UnmarshalFieldError struct { + Key string + Type reflect.Type + Field reflect.StructField +} + +func (e *UnmarshalFieldError) Error() string { + return "json: cannot unmarshal object key " + strconv.Quote(e.Key) + " into unexported field " + e.Field.Name + " of type " + e.Type.String() +} + +// An InvalidUnmarshalError describes an invalid argument passed to Unmarshal. +// (The argument to Unmarshal must be a non-nil pointer.) +type InvalidUnmarshalError struct { + Type reflect.Type +} + +func (e *InvalidUnmarshalError) Error() string { + if e.Type == nil { + return "json: Unmarshal(nil)" + } + + if e.Type.Kind() != reflect.Ptr { + return "json: Unmarshal(non-pointer " + e.Type.String() + ")" + } + return "json: Unmarshal(nil " + e.Type.String() + ")" +} + +func (d *decodeState) unmarshal(v interface{}) (err error) { + defer func() { + if r := recover(); r != nil { + if _, ok := r.(runtime.Error); ok { + panic(r) + } + err = r.(error) + } + }() + + rv := reflect.ValueOf(v) + if rv.Kind() != reflect.Ptr || rv.IsNil() { + return &InvalidUnmarshalError{reflect.TypeOf(v)} + } + + d.scan.reset() + // We decode rv not rv.Elem because the Unmarshaler interface + // test must be applied at the top level of the value. + d.value(rv) + return d.savedError +} + +// A Number represents a JSON number literal. +type Number string + +// String returns the literal text of the number. +func (n Number) String() string { return string(n) } + +// Float64 returns the number as a float64. +func (n Number) Float64() (float64, error) { + return strconv.ParseFloat(string(n), 64) +} + +// Int64 returns the number as an int64. +func (n Number) Int64() (int64, error) { + return strconv.ParseInt(string(n), 10, 64) +} + +// decodeState represents the state while decoding a JSON value. +type decodeState struct { + data []byte + off int // read offset in data + scan scanner + nextscan scanner // for calls to nextValue + savedError error + useNumber bool +} + +// errPhase is used for errors that should not happen unless +// there is a bug in the JSON decoder or something is editing +// the data slice while the decoder executes. +var errPhase = errors.New("JSON decoder out of sync - data changing underfoot?") + +func (d *decodeState) init(data []byte) *decodeState { + d.data = data + d.off = 0 + d.savedError = nil + return d +} + +// error aborts the decoding by panicking with err. +func (d *decodeState) error(err error) { + panic(err) +} + +// saveError saves the first err it is called with, +// for reporting at the end of the unmarshal. +func (d *decodeState) saveError(err error) { + if d.savedError == nil { + d.savedError = err + } +} + +// next cuts off and returns the next full JSON value in d.data[d.off:]. +// The next value is known to be an object or array, not a literal. +func (d *decodeState) next() []byte { + c := d.data[d.off] + item, rest, err := nextValue(d.data[d.off:], &d.nextscan) + if err != nil { + d.error(err) + } + d.off = len(d.data) - len(rest) + + // Our scanner has seen the opening brace/bracket + // and thinks we're still in the middle of the object. + // invent a closing brace/bracket to get it out. + if c == '{' { + d.scan.step(&d.scan, '}') + } else { + d.scan.step(&d.scan, ']') + } + + return item +} + +// scanWhile processes bytes in d.data[d.off:] until it +// receives a scan code not equal to op. +// It updates d.off and returns the new scan code. +func (d *decodeState) scanWhile(op int) int { + var newOp int + for { + if d.off >= len(d.data) { + newOp = d.scan.eof() + d.off = len(d.data) + 1 // mark processed EOF with len+1 + } else { + c := int(d.data[d.off]) + d.off++ + newOp = d.scan.step(&d.scan, c) + } + if newOp != op { + break + } + } + return newOp +} + +// value decodes a JSON value from d.data[d.off:] into the value. +// it updates d.off to point past the decoded value. +func (d *decodeState) value(v reflect.Value) { + if !v.IsValid() { + _, rest, err := nextValue(d.data[d.off:], &d.nextscan) + if err != nil { + d.error(err) + } + d.off = len(d.data) - len(rest) + + // d.scan thinks we're still at the beginning of the item. + // Feed in an empty string - the shortest, simplest value - + // so that it knows we got to the end of the value. + if d.scan.redo { + // rewind. + d.scan.redo = false + d.scan.step = stateBeginValue + } + d.scan.step(&d.scan, '"') + d.scan.step(&d.scan, '"') + + n := len(d.scan.parseState) + if n > 0 && d.scan.parseState[n-1] == parseObjectKey { + // d.scan thinks we just read an object key; finish the object + d.scan.step(&d.scan, ':') + d.scan.step(&d.scan, '"') + d.scan.step(&d.scan, '"') + d.scan.step(&d.scan, '}') + } + + return + } + + switch op := d.scanWhile(scanSkipSpace); op { + default: + d.error(errPhase) + + case scanBeginArray: + d.array(v) + + case scanBeginObject: + d.object(v) + + case scanBeginLiteral: + d.literal(v) + } +} + +type unquotedValue struct{} + +// valueQuoted is like value but decodes a +// quoted string literal or literal null into an interface value. +// If it finds anything other than a quoted string literal or null, +// valueQuoted returns unquotedValue{}. +func (d *decodeState) valueQuoted() interface{} { + switch op := d.scanWhile(scanSkipSpace); op { + default: + d.error(errPhase) + + case scanBeginArray: + d.array(reflect.Value{}) + + case scanBeginObject: + d.object(reflect.Value{}) + + case scanBeginLiteral: + switch v := d.literalInterface().(type) { + case nil, string: + return v + } + } + return unquotedValue{} +} + +// indirect walks down v allocating pointers as needed, +// until it gets to a non-pointer. +// if it encounters an Unmarshaler, indirect stops and returns that. +// if decodingNull is true, indirect stops at the last pointer so it can be set to nil. +func (d *decodeState) indirect(v reflect.Value, decodingNull bool) (Unmarshaler, encoding.TextUnmarshaler, reflect.Value) { + // If v is a named type and is addressable, + // start with its address, so that if the type has pointer methods, + // we find them. + if v.Kind() != reflect.Ptr && v.Type().Name() != "" && v.CanAddr() { + v = v.Addr() + } + for { + // Load value from interface, but only if the result will be + // usefully addressable. + if v.Kind() == reflect.Interface && !v.IsNil() { + e := v.Elem() + if e.Kind() == reflect.Ptr && !e.IsNil() && (!decodingNull || e.Elem().Kind() == reflect.Ptr) { + v = e + continue + } + } + + if v.Kind() != reflect.Ptr { + break + } + + if v.Elem().Kind() != reflect.Ptr && decodingNull && v.CanSet() { + break + } + if v.IsNil() { + v.Set(reflect.New(v.Type().Elem())) + } + if v.Type().NumMethod() > 0 { + if u, ok := v.Interface().(Unmarshaler); ok { + return u, nil, reflect.Value{} + } + if u, ok := v.Interface().(encoding.TextUnmarshaler); ok { + return nil, u, reflect.Value{} + } + } + v = v.Elem() + } + return nil, nil, v +} + +// array consumes an array from d.data[d.off-1:], decoding into the value v. +// the first byte of the array ('[') has been read already. +func (d *decodeState) array(v reflect.Value) { + // Check for unmarshaler. + u, ut, pv := d.indirect(v, false) + if u != nil { + d.off-- + err := u.UnmarshalJSON(d.next()) + if err != nil { + d.error(err) + } + return + } + if ut != nil { + d.saveError(&UnmarshalTypeError{"array", v.Type(), int64(d.off)}) + d.off-- + d.next() + return + } + + v = pv + + // Check type of target. + switch v.Kind() { + case reflect.Interface: + if v.NumMethod() == 0 { + // Decoding into nil interface? Switch to non-reflect code. + v.Set(reflect.ValueOf(d.arrayInterface())) + return + } + // Otherwise it's invalid. + fallthrough + default: + d.saveError(&UnmarshalTypeError{"array", v.Type(), int64(d.off)}) + d.off-- + d.next() + return + case reflect.Array: + case reflect.Slice: + break + } + + i := 0 + for { + // Look ahead for ] - can only happen on first iteration. + op := d.scanWhile(scanSkipSpace) + if op == scanEndArray { + break + } + + // Back up so d.value can have the byte we just read. + d.off-- + d.scan.undo(op) + + // Get element of array, growing if necessary. + if v.Kind() == reflect.Slice { + // Grow slice if necessary + if i >= v.Cap() { + newcap := v.Cap() + v.Cap()/2 + if newcap < 4 { + newcap = 4 + } + newv := reflect.MakeSlice(v.Type(), v.Len(), newcap) + reflect.Copy(newv, v) + v.Set(newv) + } + if i >= v.Len() { + v.SetLen(i + 1) + } + } + + if i < v.Len() { + // Decode into element. + d.value(v.Index(i)) + } else { + // Ran out of fixed array: skip. + d.value(reflect.Value{}) + } + i++ + + // Next token must be , or ]. + op = d.scanWhile(scanSkipSpace) + if op == scanEndArray { + break + } + if op != scanArrayValue { + d.error(errPhase) + } + } + + if i < v.Len() { + if v.Kind() == reflect.Array { + // Array. Zero the rest. + z := reflect.Zero(v.Type().Elem()) + for ; i < v.Len(); i++ { + v.Index(i).Set(z) + } + } else { + v.SetLen(i) + } + } + if i == 0 && v.Kind() == reflect.Slice { + v.Set(reflect.MakeSlice(v.Type(), 0, 0)) + } +} + +var nullLiteral = []byte("null") + +// object consumes an object from d.data[d.off-1:], decoding into the value v. +// the first byte ('{') of the object has been read already. +func (d *decodeState) object(v reflect.Value) { + // Check for unmarshaler. + u, ut, pv := d.indirect(v, false) + if u != nil { + d.off-- + err := u.UnmarshalJSON(d.next()) + if err != nil { + d.error(err) + } + return + } + if ut != nil { + d.saveError(&UnmarshalTypeError{"object", v.Type(), int64(d.off)}) + d.off-- + d.next() // skip over { } in input + return + } + v = pv + + // Decoding into nil interface? Switch to non-reflect code. + if v.Kind() == reflect.Interface && v.NumMethod() == 0 { + v.Set(reflect.ValueOf(d.objectInterface())) + return + } + + // Check type of target: struct or map[string]T + switch v.Kind() { + case reflect.Map: + // map must have string kind + t := v.Type() + if t.Key().Kind() != reflect.String { + d.saveError(&UnmarshalTypeError{"object", v.Type(), int64(d.off)}) + d.off-- + d.next() // skip over { } in input + return + } + if v.IsNil() { + v.Set(reflect.MakeMap(t)) + } + case reflect.Struct: + + default: + d.saveError(&UnmarshalTypeError{"object", v.Type(), int64(d.off)}) + d.off-- + d.next() // skip over { } in input + return + } + + var mapElem reflect.Value + + for { + // Read opening " of string key or closing }. + op := d.scanWhile(scanSkipSpace) + if op == scanEndObject { + // closing } - can only happen on first iteration. + break + } + if op != scanBeginLiteral { + d.error(errPhase) + } + + // Read key. + start := d.off - 1 + op = d.scanWhile(scanContinue) + item := d.data[start : d.off-1] + key, ok := unquoteBytes(item) + if !ok { + d.error(errPhase) + } + + // Figure out field corresponding to key. + var subv reflect.Value + destring := false // whether the value is wrapped in a string to be decoded first + + if v.Kind() == reflect.Map { + elemType := v.Type().Elem() + if !mapElem.IsValid() { + mapElem = reflect.New(elemType).Elem() + } else { + mapElem.Set(reflect.Zero(elemType)) + } + subv = mapElem + } else { + var f *field + fields := cachedTypeFields(v.Type()) + for i := range fields { + ff := &fields[i] + if bytes.Equal(ff.nameBytes, key) { + f = ff + break + } + if f == nil && ff.equalFold(ff.nameBytes, key) { + f = ff + } + } + if f != nil { + subv = v + destring = f.quoted + for _, i := range f.index { + if subv.Kind() == reflect.Ptr { + if subv.IsNil() { + subv.Set(reflect.New(subv.Type().Elem())) + } + subv = subv.Elem() + } + subv = subv.Field(i) + } + } + } + + // Read : before value. + if op == scanSkipSpace { + op = d.scanWhile(scanSkipSpace) + } + if op != scanObjectKey { + d.error(errPhase) + } + + // Read value. + if destring { + switch qv := d.valueQuoted().(type) { + case nil: + d.literalStore(nullLiteral, subv, false) + case string: + d.literalStore([]byte(qv), subv, true) + default: + d.saveError(fmt.Errorf("json: invalid use of ,string struct tag, trying to unmarshal unquoted value into %v", subv.Type())) + } + } else { + d.value(subv) + } + + // Write value back to map; + // if using struct, subv points into struct already. + if v.Kind() == reflect.Map { + kv := reflect.ValueOf(key).Convert(v.Type().Key()) + v.SetMapIndex(kv, subv) + } + + // Next token must be , or }. + op = d.scanWhile(scanSkipSpace) + if op == scanEndObject { + break + } + if op != scanObjectValue { + d.error(errPhase) + } + } +} + +// literal consumes a literal from d.data[d.off-1:], decoding into the value v. +// The first byte of the literal has been read already +// (that's how the caller knows it's a literal). +func (d *decodeState) literal(v reflect.Value) { + // All bytes inside literal return scanContinue op code. + start := d.off - 1 + op := d.scanWhile(scanContinue) + + // Scan read one byte too far; back up. + d.off-- + d.scan.undo(op) + + d.literalStore(d.data[start:d.off], v, false) +} + +// convertNumber converts the number literal s to a float64 or a Number +// depending on the setting of d.useNumber. +func (d *decodeState) convertNumber(s string) (interface{}, error) { + if d.useNumber { + return Number(s), nil + } + f, err := strconv.ParseFloat(s, 64) + if err != nil { + return nil, &UnmarshalTypeError{"number " + s, reflect.TypeOf(0.0), int64(d.off)} + } + return f, nil +} + +var numberType = reflect.TypeOf(Number("")) + +// literalStore decodes a literal stored in item into v. +// +// fromQuoted indicates whether this literal came from unwrapping a +// string from the ",string" struct tag option. this is used only to +// produce more helpful error messages. +func (d *decodeState) literalStore(item []byte, v reflect.Value, fromQuoted bool) { + // Check for unmarshaler. + if len(item) == 0 { + //Empty string given + d.saveError(fmt.Errorf("json: invalid use of ,string struct tag, trying to unmarshal %q into %v", item, v.Type())) + return + } + wantptr := item[0] == 'n' // null + u, ut, pv := d.indirect(v, wantptr) + if u != nil { + err := u.UnmarshalJSON(item) + if err != nil { + d.error(err) + } + return + } + if ut != nil { + if item[0] != '"' { + if fromQuoted { + d.saveError(fmt.Errorf("json: invalid use of ,string struct tag, trying to unmarshal %q into %v", item, v.Type())) + } else { + d.saveError(&UnmarshalTypeError{"string", v.Type(), int64(d.off)}) + } + return + } + s, ok := unquoteBytes(item) + if !ok { + if fromQuoted { + d.error(fmt.Errorf("json: invalid use of ,string struct tag, trying to unmarshal %q into %v", item, v.Type())) + } else { + d.error(errPhase) + } + } + err := ut.UnmarshalText(s) + if err != nil { + d.error(err) + } + return + } + + v = pv + + switch c := item[0]; c { + case 'n': // null + switch v.Kind() { + case reflect.Interface, reflect.Ptr, reflect.Map, reflect.Slice: + v.Set(reflect.Zero(v.Type())) + // otherwise, ignore null for primitives/string + } + case 't', 'f': // true, false + value := c == 't' + switch v.Kind() { + default: + if fromQuoted { + d.saveError(fmt.Errorf("json: invalid use of ,string struct tag, trying to unmarshal %q into %v", item, v.Type())) + } else { + d.saveError(&UnmarshalTypeError{"bool", v.Type(), int64(d.off)}) + } + case reflect.Bool: + v.SetBool(value) + case reflect.Interface: + if v.NumMethod() == 0 { + v.Set(reflect.ValueOf(value)) + } else { + d.saveError(&UnmarshalTypeError{"bool", v.Type(), int64(d.off)}) + } + } + + case '"': // string + s, ok := unquoteBytes(item) + if !ok { + if fromQuoted { + d.error(fmt.Errorf("json: invalid use of ,string struct tag, trying to unmarshal %q into %v", item, v.Type())) + } else { + d.error(errPhase) + } + } + switch v.Kind() { + default: + d.saveError(&UnmarshalTypeError{"string", v.Type(), int64(d.off)}) + case reflect.Slice: + if v.Type().Elem().Kind() != reflect.Uint8 { + d.saveError(&UnmarshalTypeError{"string", v.Type(), int64(d.off)}) + break + } + b := make([]byte, base64.StdEncoding.DecodedLen(len(s))) + n, err := base64.StdEncoding.Decode(b, s) + if err != nil { + d.saveError(err) + break + } + v.Set(reflect.ValueOf(b[0:n])) + case reflect.String: + v.SetString(string(s)) + case reflect.Interface: + if v.NumMethod() == 0 { + v.Set(reflect.ValueOf(string(s))) + } else { + d.saveError(&UnmarshalTypeError{"string", v.Type(), int64(d.off)}) + } + } + + default: // number + if c != '-' && (c < '0' || c > '9') { + if fromQuoted { + d.error(fmt.Errorf("json: invalid use of ,string struct tag, trying to unmarshal %q into %v", item, v.Type())) + } else { + d.error(errPhase) + } + } + s := string(item) + switch v.Kind() { + default: + if v.Kind() == reflect.String && v.Type() == numberType { + v.SetString(s) + break + } + if fromQuoted { + d.error(fmt.Errorf("json: invalid use of ,string struct tag, trying to unmarshal %q into %v", item, v.Type())) + } else { + d.error(&UnmarshalTypeError{"number", v.Type(), int64(d.off)}) + } + case reflect.Interface: + n, err := d.convertNumber(s) + if err != nil { + d.saveError(err) + break + } + if v.NumMethod() != 0 { + d.saveError(&UnmarshalTypeError{"number", v.Type(), int64(d.off)}) + break + } + v.Set(reflect.ValueOf(n)) + + case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: + n, err := strconv.ParseInt(s, 10, 64) + if err != nil || v.OverflowInt(n) { + d.saveError(&UnmarshalTypeError{"number " + s, v.Type(), int64(d.off)}) + break + } + v.SetInt(n) + + case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: + n, err := strconv.ParseUint(s, 10, 64) + if err != nil || v.OverflowUint(n) { + d.saveError(&UnmarshalTypeError{"number " + s, v.Type(), int64(d.off)}) + break + } + v.SetUint(n) + + case reflect.Float32, reflect.Float64: + n, err := strconv.ParseFloat(s, v.Type().Bits()) + if err != nil || v.OverflowFloat(n) { + d.saveError(&UnmarshalTypeError{"number " + s, v.Type(), int64(d.off)}) + break + } + v.SetFloat(n) + } + } +} + +// The xxxInterface routines build up a value to be stored +// in an empty interface. They are not strictly necessary, +// but they avoid the weight of reflection in this common case. + +// valueInterface is like value but returns interface{} +func (d *decodeState) valueInterface() interface{} { + switch d.scanWhile(scanSkipSpace) { + default: + d.error(errPhase) + panic("unreachable") + case scanBeginArray: + return d.arrayInterface() + case scanBeginObject: + return d.objectInterface() + case scanBeginLiteral: + return d.literalInterface() + } +} + +// arrayInterface is like array but returns []interface{}. +func (d *decodeState) arrayInterface() []interface{} { + var v = make([]interface{}, 0) + for { + // Look ahead for ] - can only happen on first iteration. + op := d.scanWhile(scanSkipSpace) + if op == scanEndArray { + break + } + + // Back up so d.value can have the byte we just read. + d.off-- + d.scan.undo(op) + + v = append(v, d.valueInterface()) + + // Next token must be , or ]. + op = d.scanWhile(scanSkipSpace) + if op == scanEndArray { + break + } + if op != scanArrayValue { + d.error(errPhase) + } + } + return v +} + +// objectInterface is like object but returns map[string]interface{}. +func (d *decodeState) objectInterface() map[string]interface{} { + m := make(map[string]interface{}) + for { + // Read opening " of string key or closing }. + op := d.scanWhile(scanSkipSpace) + if op == scanEndObject { + // closing } - can only happen on first iteration. + break + } + if op != scanBeginLiteral { + d.error(errPhase) + } + + // Read string key. + start := d.off - 1 + op = d.scanWhile(scanContinue) + item := d.data[start : d.off-1] + key, ok := unquote(item) + if !ok { + d.error(errPhase) + } + + // Read : before value. + if op == scanSkipSpace { + op = d.scanWhile(scanSkipSpace) + } + if op != scanObjectKey { + d.error(errPhase) + } + + // Read value. + m[key] = d.valueInterface() + + // Next token must be , or }. + op = d.scanWhile(scanSkipSpace) + if op == scanEndObject { + break + } + if op != scanObjectValue { + d.error(errPhase) + } + } + return m +} + +// literalInterface is like literal but returns an interface value. +func (d *decodeState) literalInterface() interface{} { + // All bytes inside literal return scanContinue op code. + start := d.off - 1 + op := d.scanWhile(scanContinue) + + // Scan read one byte too far; back up. + d.off-- + d.scan.undo(op) + item := d.data[start:d.off] + + switch c := item[0]; c { + case 'n': // null + return nil + + case 't', 'f': // true, false + return c == 't' + + case '"': // string + s, ok := unquote(item) + if !ok { + d.error(errPhase) + } + return s + + default: // number + if c != '-' && (c < '0' || c > '9') { + d.error(errPhase) + } + n, err := d.convertNumber(string(item)) + if err != nil { + d.saveError(err) + } + return n + } +} + +// getu4 decodes \uXXXX from the beginning of s, returning the hex value, +// or it returns -1. +func getu4(s []byte) rune { + if len(s) < 6 || s[0] != '\\' || s[1] != 'u' { + return -1 + } + r, err := strconv.ParseUint(string(s[2:6]), 16, 64) + if err != nil { + return -1 + } + return rune(r) +} + +// unquote converts a quoted JSON string literal s into an actual string t. +// The rules are different than for Go, so cannot use strconv.Unquote. +func unquote(s []byte) (t string, ok bool) { + s, ok = unquoteBytes(s) + t = string(s) + return +} + +func unquoteBytes(s []byte) (t []byte, ok bool) { + if len(s) < 2 || s[0] != '"' || s[len(s)-1] != '"' { + return + } + s = s[1 : len(s)-1] + + // Check for unusual characters. If there are none, + // then no unquoting is needed, so return a slice of the + // original bytes. + r := 0 + for r < len(s) { + c := s[r] + if c == '\\' || c == '"' || c < ' ' { + break + } + if c < utf8.RuneSelf { + r++ + continue + } + rr, size := utf8.DecodeRune(s[r:]) + if rr == utf8.RuneError && size == 1 { + break + } + r += size + } + if r == len(s) { + return s, true + } + + b := make([]byte, len(s)+2*utf8.UTFMax) + w := copy(b, s[0:r]) + for r < len(s) { + // Out of room? Can only happen if s is full of + // malformed UTF-8 and we're replacing each + // byte with RuneError. + if w >= len(b)-2*utf8.UTFMax { + nb := make([]byte, (len(b)+utf8.UTFMax)*2) + copy(nb, b[0:w]) + b = nb + } + switch c := s[r]; { + case c == '\\': + r++ + if r >= len(s) { + return + } + switch s[r] { + default: + return + case '"', '\\', '/', '\'': + b[w] = s[r] + r++ + w++ + case 'b': + b[w] = '\b' + r++ + w++ + case 'f': + b[w] = '\f' + r++ + w++ + case 'n': + b[w] = '\n' + r++ + w++ + case 'r': + b[w] = '\r' + r++ + w++ + case 't': + b[w] = '\t' + r++ + w++ + case 'u': + r-- + rr := getu4(s[r:]) + if rr < 0 { + return + } + r += 6 + if utf16.IsSurrogate(rr) { + rr1 := getu4(s[r:]) + if dec := utf16.DecodeRune(rr, rr1); dec != unicode.ReplacementChar { + // A valid pair; consume. + r += 6 + w += utf8.EncodeRune(b[w:], dec) + break + } + // Invalid surrogate; fall back to replacement rune. + rr = unicode.ReplacementChar + } + w += utf8.EncodeRune(b[w:], rr) + } + + // Quote, control characters are invalid. + case c == '"', c < ' ': + return + + // ASCII + case c < utf8.RuneSelf: + b[w] = c + r++ + w++ + + // Coerce to well-formed UTF-8. + default: + rr, size := utf8.DecodeRune(s[r:]) + r += size + w += utf8.EncodeRune(b[w:], rr) + } + } + return b[0:w], true +} diff --git a/src/encoding/json/decode_test.go b/src/encoding/json/decode_test.go new file mode 100644 index 0000000000000000000000000000000000000000..8aa158f08cdade6f9fe7f2d3caa91382bb646a1a --- /dev/null +++ b/src/encoding/json/decode_test.go @@ -0,0 +1,1453 @@ +// Copyright 2010 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package json + +import ( + "bytes" + "encoding" + "fmt" + "image" + "net" + "reflect" + "strings" + "testing" + "time" +) + +type T struct { + X string + Y int + Z int `json:"-"` +} + +type U struct { + Alphabet string `json:"alpha"` +} + +type V struct { + F1 interface{} + F2 int32 + F3 Number +} + +// ifaceNumAsFloat64/ifaceNumAsNumber are used to test unmarshaling with and +// without UseNumber +var ifaceNumAsFloat64 = map[string]interface{}{ + "k1": float64(1), + "k2": "s", + "k3": []interface{}{float64(1), float64(2.0), float64(3e-3)}, + "k4": map[string]interface{}{"kk1": "s", "kk2": float64(2)}, +} + +var ifaceNumAsNumber = map[string]interface{}{ + "k1": Number("1"), + "k2": "s", + "k3": []interface{}{Number("1"), Number("2.0"), Number("3e-3")}, + "k4": map[string]interface{}{"kk1": "s", "kk2": Number("2")}, +} + +type tx struct { + x int +} + +// A type that can unmarshal itself. + +type unmarshaler struct { + T bool +} + +func (u *unmarshaler) UnmarshalJSON(b []byte) error { + *u = unmarshaler{true} // All we need to see that UnmarshalJSON is called. + return nil +} + +type ustruct struct { + M unmarshaler +} + +type unmarshalerText struct { + T bool +} + +// needed for re-marshaling tests +func (u *unmarshalerText) MarshalText() ([]byte, error) { + return []byte(""), nil +} + +func (u *unmarshalerText) UnmarshalText(b []byte) error { + *u = unmarshalerText{true} // All we need to see that UnmarshalText is called. + return nil +} + +var _ encoding.TextUnmarshaler = (*unmarshalerText)(nil) + +type ustructText struct { + M unmarshalerText +} + +var ( + um0, um1 unmarshaler // target2 of unmarshaling + ump = &um1 + umtrue = unmarshaler{true} + umslice = []unmarshaler{{true}} + umslicep = new([]unmarshaler) + umstruct = ustruct{unmarshaler{true}} + + um0T, um1T unmarshalerText // target2 of unmarshaling + umpT = &um1T + umtrueT = unmarshalerText{true} + umsliceT = []unmarshalerText{{true}} + umslicepT = new([]unmarshalerText) + umstructT = ustructText{unmarshalerText{true}} +) + +// Test data structures for anonymous fields. + +type Point struct { + Z int +} + +type Top struct { + Level0 int + Embed0 + *Embed0a + *Embed0b `json:"e,omitempty"` // treated as named + Embed0c `json:"-"` // ignored + Loop + Embed0p // has Point with X, Y, used + Embed0q // has Point with Z, used +} + +type Embed0 struct { + Level1a int // overridden by Embed0a's Level1a with json tag + Level1b int // used because Embed0a's Level1b is renamed + Level1c int // used because Embed0a's Level1c is ignored + Level1d int // annihilated by Embed0a's Level1d + Level1e int `json:"x"` // annihilated by Embed0a.Level1e +} + +type Embed0a struct { + Level1a int `json:"Level1a,omitempty"` + Level1b int `json:"LEVEL1B,omitempty"` + Level1c int `json:"-"` + Level1d int // annihilated by Embed0's Level1d + Level1f int `json:"x"` // annihilated by Embed0's Level1e +} + +type Embed0b Embed0 + +type Embed0c Embed0 + +type Embed0p struct { + image.Point +} + +type Embed0q struct { + Point +} + +type Loop struct { + Loop1 int `json:",omitempty"` + Loop2 int `json:",omitempty"` + *Loop +} + +// From reflect test: +// The X in S6 and S7 annihilate, but they also block the X in S8.S9. +type S5 struct { + S6 + S7 + S8 +} + +type S6 struct { + X int +} + +type S7 S6 + +type S8 struct { + S9 +} + +type S9 struct { + X int + Y int +} + +// From reflect test: +// The X in S11.S6 and S12.S6 annihilate, but they also block the X in S13.S8.S9. +type S10 struct { + S11 + S12 + S13 +} + +type S11 struct { + S6 +} + +type S12 struct { + S6 +} + +type S13 struct { + S8 +} + +type unmarshalTest struct { + in string + ptr interface{} + out interface{} + err error + useNumber bool +} + +type Ambig struct { + // Given "hello", the first match should win. + First int `json:"HELLO"` + Second int `json:"Hello"` +} + +type XYZ struct { + X interface{} + Y interface{} + Z interface{} +} + +func sliceAddr(x []int) *[]int { return &x } +func mapAddr(x map[string]int) *map[string]int { return &x } + +var unmarshalTests = []unmarshalTest{ + // basic types + {in: `true`, ptr: new(bool), out: true}, + {in: `1`, ptr: new(int), out: 1}, + {in: `1.2`, ptr: new(float64), out: 1.2}, + {in: `-5`, ptr: new(int16), out: int16(-5)}, + {in: `2`, ptr: new(Number), out: Number("2"), useNumber: true}, + {in: `2`, ptr: new(Number), out: Number("2")}, + {in: `2`, ptr: new(interface{}), out: float64(2.0)}, + {in: `2`, ptr: new(interface{}), out: Number("2"), useNumber: true}, + {in: `"a\u1234"`, ptr: new(string), out: "a\u1234"}, + {in: `"http:\/\/"`, ptr: new(string), out: "http://"}, + {in: `"g-clef: \uD834\uDD1E"`, ptr: new(string), out: "g-clef: \U0001D11E"}, + {in: `"invalid: \uD834x\uDD1E"`, ptr: new(string), out: "invalid: \uFFFDx\uFFFD"}, + {in: "null", ptr: new(interface{}), out: nil}, + {in: `{"X": [1,2,3], "Y": 4}`, ptr: new(T), out: T{Y: 4}, err: &UnmarshalTypeError{"array", reflect.TypeOf(""), 7}}, + {in: `{"x": 1}`, ptr: new(tx), out: tx{}}, + {in: `{"F1":1,"F2":2,"F3":3}`, ptr: new(V), out: V{F1: float64(1), F2: int32(2), F3: Number("3")}}, + {in: `{"F1":1,"F2":2,"F3":3}`, ptr: new(V), out: V{F1: Number("1"), F2: int32(2), F3: Number("3")}, useNumber: true}, + {in: `{"k1":1,"k2":"s","k3":[1,2.0,3e-3],"k4":{"kk1":"s","kk2":2}}`, ptr: new(interface{}), out: ifaceNumAsFloat64}, + {in: `{"k1":1,"k2":"s","k3":[1,2.0,3e-3],"k4":{"kk1":"s","kk2":2}}`, ptr: new(interface{}), out: ifaceNumAsNumber, useNumber: true}, + + // raw values with whitespace + {in: "\n true ", ptr: new(bool), out: true}, + {in: "\t 1 ", ptr: new(int), out: 1}, + {in: "\r 1.2 ", ptr: new(float64), out: 1.2}, + {in: "\t -5 \n", ptr: new(int16), out: int16(-5)}, + {in: "\t \"a\\u1234\" \n", ptr: new(string), out: "a\u1234"}, + + // Z has a "-" tag. + {in: `{"Y": 1, "Z": 2}`, ptr: new(T), out: T{Y: 1}}, + + {in: `{"alpha": "abc", "alphabet": "xyz"}`, ptr: new(U), out: U{Alphabet: "abc"}}, + {in: `{"alpha": "abc"}`, ptr: new(U), out: U{Alphabet: "abc"}}, + {in: `{"alphabet": "xyz"}`, ptr: new(U), out: U{}}, + + // syntax errors + {in: `{"X": "foo", "Y"}`, err: &SyntaxError{"invalid character '}' after object key", 17}}, + {in: `[1, 2, 3+]`, err: &SyntaxError{"invalid character '+' after array element", 9}}, + {in: `{"X":12x}`, err: &SyntaxError{"invalid character 'x' after object key:value pair", 8}, useNumber: true}, + + // raw value errors + {in: "\x01 42", err: &SyntaxError{"invalid character '\\x01' looking for beginning of value", 1}}, + {in: " 42 \x01", err: &SyntaxError{"invalid character '\\x01' after top-level value", 5}}, + {in: "\x01 true", err: &SyntaxError{"invalid character '\\x01' looking for beginning of value", 1}}, + {in: " false \x01", err: &SyntaxError{"invalid character '\\x01' after top-level value", 8}}, + {in: "\x01 1.2", err: &SyntaxError{"invalid character '\\x01' looking for beginning of value", 1}}, + {in: " 3.4 \x01", err: &SyntaxError{"invalid character '\\x01' after top-level value", 6}}, + {in: "\x01 \"string\"", err: &SyntaxError{"invalid character '\\x01' looking for beginning of value", 1}}, + {in: " \"string\" \x01", err: &SyntaxError{"invalid character '\\x01' after top-level value", 11}}, + + // array tests + {in: `[1, 2, 3]`, ptr: new([3]int), out: [3]int{1, 2, 3}}, + {in: `[1, 2, 3]`, ptr: new([1]int), out: [1]int{1}}, + {in: `[1, 2, 3]`, ptr: new([5]int), out: [5]int{1, 2, 3, 0, 0}}, + + // empty array to interface test + {in: `[]`, ptr: new([]interface{}), out: []interface{}{}}, + {in: `null`, ptr: new([]interface{}), out: []interface{}(nil)}, + {in: `{"T":[]}`, ptr: new(map[string]interface{}), out: map[string]interface{}{"T": []interface{}{}}}, + {in: `{"T":null}`, ptr: new(map[string]interface{}), out: map[string]interface{}{"T": interface{}(nil)}}, + + // composite tests + {in: allValueIndent, ptr: new(All), out: allValue}, + {in: allValueCompact, ptr: new(All), out: allValue}, + {in: allValueIndent, ptr: new(*All), out: &allValue}, + {in: allValueCompact, ptr: new(*All), out: &allValue}, + {in: pallValueIndent, ptr: new(All), out: pallValue}, + {in: pallValueCompact, ptr: new(All), out: pallValue}, + {in: pallValueIndent, ptr: new(*All), out: &pallValue}, + {in: pallValueCompact, ptr: new(*All), out: &pallValue}, + + // unmarshal interface test + {in: `{"T":false}`, ptr: &um0, out: umtrue}, // use "false" so test will fail if custom unmarshaler is not called + {in: `{"T":false}`, ptr: &ump, out: &umtrue}, + {in: `[{"T":false}]`, ptr: &umslice, out: umslice}, + {in: `[{"T":false}]`, ptr: &umslicep, out: &umslice}, + {in: `{"M":{"T":false}}`, ptr: &umstruct, out: umstruct}, + + // UnmarshalText interface test + {in: `"X"`, ptr: &um0T, out: umtrueT}, // use "false" so test will fail if custom unmarshaler is not called + {in: `"X"`, ptr: &umpT, out: &umtrueT}, + {in: `["X"]`, ptr: &umsliceT, out: umsliceT}, + {in: `["X"]`, ptr: &umslicepT, out: &umsliceT}, + {in: `{"M":"X"}`, ptr: &umstructT, out: umstructT}, + + // Overwriting of data. + // This is different from package xml, but it's what we've always done. + // Now documented and tested. + {in: `[2]`, ptr: sliceAddr([]int{1}), out: []int{2}}, + {in: `{"key": 2}`, ptr: mapAddr(map[string]int{"old": 0, "key": 1}), out: map[string]int{"key": 2}}, + + { + in: `{ + "Level0": 1, + "Level1b": 2, + "Level1c": 3, + "x": 4, + "Level1a": 5, + "LEVEL1B": 6, + "e": { + "Level1a": 8, + "Level1b": 9, + "Level1c": 10, + "Level1d": 11, + "x": 12 + }, + "Loop1": 13, + "Loop2": 14, + "X": 15, + "Y": 16, + "Z": 17 + }`, + ptr: new(Top), + out: Top{ + Level0: 1, + Embed0: Embed0{ + Level1b: 2, + Level1c: 3, + }, + Embed0a: &Embed0a{ + Level1a: 5, + Level1b: 6, + }, + Embed0b: &Embed0b{ + Level1a: 8, + Level1b: 9, + Level1c: 10, + Level1d: 11, + Level1e: 12, + }, + Loop: Loop{ + Loop1: 13, + Loop2: 14, + }, + Embed0p: Embed0p{ + Point: image.Point{X: 15, Y: 16}, + }, + Embed0q: Embed0q{ + Point: Point{Z: 17}, + }, + }, + }, + { + in: `{"hello": 1}`, + ptr: new(Ambig), + out: Ambig{First: 1}, + }, + + { + in: `{"X": 1,"Y":2}`, + ptr: new(S5), + out: S5{S8: S8{S9: S9{Y: 2}}}, + }, + { + in: `{"X": 1,"Y":2}`, + ptr: new(S10), + out: S10{S13: S13{S8: S8{S9: S9{Y: 2}}}}, + }, + + // invalid UTF-8 is coerced to valid UTF-8. + { + in: "\"hello\xffworld\"", + ptr: new(string), + out: "hello\ufffdworld", + }, + { + in: "\"hello\xc2\xc2world\"", + ptr: new(string), + out: "hello\ufffd\ufffdworld", + }, + { + in: "\"hello\xc2\xffworld\"", + ptr: new(string), + out: "hello\ufffd\ufffdworld", + }, + { + in: "\"hello\\ud800world\"", + ptr: new(string), + out: "hello\ufffdworld", + }, + { + in: "\"hello\\ud800\\ud800world\"", + ptr: new(string), + out: "hello\ufffd\ufffdworld", + }, + { + in: "\"hello\\ud800\\ud800world\"", + ptr: new(string), + out: "hello\ufffd\ufffdworld", + }, + { + in: "\"hello\xed\xa0\x80\xed\xb0\x80world\"", + ptr: new(string), + out: "hello\ufffd\ufffd\ufffd\ufffd\ufffd\ufffdworld", + }, + + // issue 8305 + { + in: `{"2009-11-10T23:00:00Z": "hello world"}`, + ptr: &map[time.Time]string{}, + err: &UnmarshalTypeError{"object", reflect.TypeOf(map[time.Time]string{}), 1}, + }, +} + +func TestMarshal(t *testing.T) { + b, err := Marshal(allValue) + if err != nil { + t.Fatalf("Marshal allValue: %v", err) + } + if string(b) != allValueCompact { + t.Errorf("Marshal allValueCompact") + diff(t, b, []byte(allValueCompact)) + return + } + + b, err = Marshal(pallValue) + if err != nil { + t.Fatalf("Marshal pallValue: %v", err) + } + if string(b) != pallValueCompact { + t.Errorf("Marshal pallValueCompact") + diff(t, b, []byte(pallValueCompact)) + return + } +} + +var badUTF8 = []struct { + in, out string +}{ + {"hello\xffworld", `"hello\ufffdworld"`}, + {"", `""`}, + {"\xff", `"\ufffd"`}, + {"\xff\xff", `"\ufffd\ufffd"`}, + {"a\xffb", `"a\ufffdb"`}, + {"\xe6\x97\xa5\xe6\x9c\xac\xff\xaa\x9e", `"日本\ufffd\ufffd\ufffd"`}, +} + +func TestMarshalBadUTF8(t *testing.T) { + for _, tt := range badUTF8 { + b, err := Marshal(tt.in) + if string(b) != tt.out || err != nil { + t.Errorf("Marshal(%q) = %#q, %v, want %#q, nil", tt.in, b, err, tt.out) + } + } +} + +func TestMarshalNumberZeroVal(t *testing.T) { + var n Number + out, err := Marshal(n) + if err != nil { + t.Fatal(err) + } + outStr := string(out) + if outStr != "0" { + t.Fatalf("Invalid zero val for Number: %q", outStr) + } +} + +func TestMarshalEmbeds(t *testing.T) { + top := &Top{ + Level0: 1, + Embed0: Embed0{ + Level1b: 2, + Level1c: 3, + }, + Embed0a: &Embed0a{ + Level1a: 5, + Level1b: 6, + }, + Embed0b: &Embed0b{ + Level1a: 8, + Level1b: 9, + Level1c: 10, + Level1d: 11, + Level1e: 12, + }, + Loop: Loop{ + Loop1: 13, + Loop2: 14, + }, + Embed0p: Embed0p{ + Point: image.Point{X: 15, Y: 16}, + }, + Embed0q: Embed0q{ + Point: Point{Z: 17}, + }, + } + b, err := Marshal(top) + if err != nil { + t.Fatal(err) + } + want := "{\"Level0\":1,\"Level1b\":2,\"Level1c\":3,\"Level1a\":5,\"LEVEL1B\":6,\"e\":{\"Level1a\":8,\"Level1b\":9,\"Level1c\":10,\"Level1d\":11,\"x\":12},\"Loop1\":13,\"Loop2\":14,\"X\":15,\"Y\":16,\"Z\":17}" + if string(b) != want { + t.Errorf("Wrong marshal result.\n got: %q\nwant: %q", b, want) + } +} + +func TestUnmarshal(t *testing.T) { + for i, tt := range unmarshalTests { + var scan scanner + in := []byte(tt.in) + if err := checkValid(in, &scan); err != nil { + if !reflect.DeepEqual(err, tt.err) { + t.Errorf("#%d: checkValid: %#v", i, err) + continue + } + } + if tt.ptr == nil { + continue + } + + // v = new(right-type) + v := reflect.New(reflect.TypeOf(tt.ptr).Elem()) + dec := NewDecoder(bytes.NewReader(in)) + if tt.useNumber { + dec.UseNumber() + } + if err := dec.Decode(v.Interface()); !reflect.DeepEqual(err, tt.err) { + t.Errorf("#%d: %v, want %v", i, err, tt.err) + continue + } else if err != nil { + continue + } + if !reflect.DeepEqual(v.Elem().Interface(), tt.out) { + t.Errorf("#%d: mismatch\nhave: %#+v\nwant: %#+v", i, v.Elem().Interface(), tt.out) + data, _ := Marshal(v.Elem().Interface()) + println(string(data)) + data, _ = Marshal(tt.out) + println(string(data)) + continue + } + + // Check round trip. + if tt.err == nil { + enc, err := Marshal(v.Interface()) + if err != nil { + t.Errorf("#%d: error re-marshaling: %v", i, err) + continue + } + vv := reflect.New(reflect.TypeOf(tt.ptr).Elem()) + dec = NewDecoder(bytes.NewReader(enc)) + if tt.useNumber { + dec.UseNumber() + } + if err := dec.Decode(vv.Interface()); err != nil { + t.Errorf("#%d: error re-unmarshaling %#q: %v", i, enc, err) + continue + } + if !reflect.DeepEqual(v.Elem().Interface(), vv.Elem().Interface()) { + t.Errorf("#%d: mismatch\nhave: %#+v\nwant: %#+v", i, v.Elem().Interface(), vv.Elem().Interface()) + t.Errorf(" In: %q", strings.Map(noSpace, string(in))) + t.Errorf("Marshal: %q", strings.Map(noSpace, string(enc))) + continue + } + } + } +} + +func TestUnmarshalMarshal(t *testing.T) { + initBig() + var v interface{} + if err := Unmarshal(jsonBig, &v); err != nil { + t.Fatalf("Unmarshal: %v", err) + } + b, err := Marshal(v) + if err != nil { + t.Fatalf("Marshal: %v", err) + } + if !bytes.Equal(jsonBig, b) { + t.Errorf("Marshal jsonBig") + diff(t, b, jsonBig) + return + } +} + +var numberTests = []struct { + in string + i int64 + intErr string + f float64 + floatErr string +}{ + {in: "-1.23e1", intErr: "strconv.ParseInt: parsing \"-1.23e1\": invalid syntax", f: -1.23e1}, + {in: "-12", i: -12, f: -12.0}, + {in: "1e1000", intErr: "strconv.ParseInt: parsing \"1e1000\": invalid syntax", floatErr: "strconv.ParseFloat: parsing \"1e1000\": value out of range"}, +} + +// Independent of Decode, basic coverage of the accessors in Number +func TestNumberAccessors(t *testing.T) { + for _, tt := range numberTests { + n := Number(tt.in) + if s := n.String(); s != tt.in { + t.Errorf("Number(%q).String() is %q", tt.in, s) + } + if i, err := n.Int64(); err == nil && tt.intErr == "" && i != tt.i { + t.Errorf("Number(%q).Int64() is %d", tt.in, i) + } else if (err == nil && tt.intErr != "") || (err != nil && err.Error() != tt.intErr) { + t.Errorf("Number(%q).Int64() wanted error %q but got: %v", tt.in, tt.intErr, err) + } + if f, err := n.Float64(); err == nil && tt.floatErr == "" && f != tt.f { + t.Errorf("Number(%q).Float64() is %g", tt.in, f) + } else if (err == nil && tt.floatErr != "") || (err != nil && err.Error() != tt.floatErr) { + t.Errorf("Number(%q).Float64() wanted error %q but got: %v", tt.in, tt.floatErr, err) + } + } +} + +func TestLargeByteSlice(t *testing.T) { + s0 := make([]byte, 2000) + for i := range s0 { + s0[i] = byte(i) + } + b, err := Marshal(s0) + if err != nil { + t.Fatalf("Marshal: %v", err) + } + var s1 []byte + if err := Unmarshal(b, &s1); err != nil { + t.Fatalf("Unmarshal: %v", err) + } + if !bytes.Equal(s0, s1) { + t.Errorf("Marshal large byte slice") + diff(t, s0, s1) + } +} + +type Xint struct { + X int +} + +func TestUnmarshalInterface(t *testing.T) { + var xint Xint + var i interface{} = &xint + if err := Unmarshal([]byte(`{"X":1}`), &i); err != nil { + t.Fatalf("Unmarshal: %v", err) + } + if xint.X != 1 { + t.Fatalf("Did not write to xint") + } +} + +func TestUnmarshalPtrPtr(t *testing.T) { + var xint Xint + pxint := &xint + if err := Unmarshal([]byte(`{"X":1}`), &pxint); err != nil { + t.Fatalf("Unmarshal: %v", err) + } + if xint.X != 1 { + t.Fatalf("Did not write to xint") + } +} + +func TestEscape(t *testing.T) { + const input = `"foobar"` + " [\u2028 \u2029]" + const expected = `"\"foobar\"\u003chtml\u003e [\u2028 \u2029]"` + b, err := Marshal(input) + if err != nil { + t.Fatalf("Marshal error: %v", err) + } + if s := string(b); s != expected { + t.Errorf("Encoding of [%s]:\n got [%s]\nwant [%s]", input, s, expected) + } +} + +// WrongString is a struct that's misusing the ,string modifier. +type WrongString struct { + Message string `json:"result,string"` +} + +type wrongStringTest struct { + in, err string +} + +var wrongStringTests = []wrongStringTest{ + {`{"result":"x"}`, `json: invalid use of ,string struct tag, trying to unmarshal "x" into string`}, + {`{"result":"foo"}`, `json: invalid use of ,string struct tag, trying to unmarshal "foo" into string`}, + {`{"result":"123"}`, `json: invalid use of ,string struct tag, trying to unmarshal "123" into string`}, + {`{"result":123}`, `json: invalid use of ,string struct tag, trying to unmarshal unquoted value into string`}, +} + +// If people misuse the ,string modifier, the error message should be +// helpful, telling the user that they're doing it wrong. +func TestErrorMessageFromMisusedString(t *testing.T) { + for n, tt := range wrongStringTests { + r := strings.NewReader(tt.in) + var s WrongString + err := NewDecoder(r).Decode(&s) + got := fmt.Sprintf("%v", err) + if got != tt.err { + t.Errorf("%d. got err = %q, want %q", n, got, tt.err) + } + } +} + +func noSpace(c rune) rune { + if isSpace(c) { + return -1 + } + return c +} + +type All struct { + Bool bool + Int int + Int8 int8 + Int16 int16 + Int32 int32 + Int64 int64 + Uint uint + Uint8 uint8 + Uint16 uint16 + Uint32 uint32 + Uint64 uint64 + Uintptr uintptr + Float32 float32 + Float64 float64 + + Foo string `json:"bar"` + Foo2 string `json:"bar2,dummyopt"` + + IntStr int64 `json:",string"` + + PBool *bool + PInt *int + PInt8 *int8 + PInt16 *int16 + PInt32 *int32 + PInt64 *int64 + PUint *uint + PUint8 *uint8 + PUint16 *uint16 + PUint32 *uint32 + PUint64 *uint64 + PUintptr *uintptr + PFloat32 *float32 + PFloat64 *float64 + + String string + PString *string + + Map map[string]Small + MapP map[string]*Small + PMap *map[string]Small + PMapP *map[string]*Small + + EmptyMap map[string]Small + NilMap map[string]Small + + Slice []Small + SliceP []*Small + PSlice *[]Small + PSliceP *[]*Small + + EmptySlice []Small + NilSlice []Small + + StringSlice []string + ByteSlice []byte + + Small Small + PSmall *Small + PPSmall **Small + + Interface interface{} + PInterface *interface{} + + unexported int +} + +type Small struct { + Tag string +} + +var allValue = All{ + Bool: true, + Int: 2, + Int8: 3, + Int16: 4, + Int32: 5, + Int64: 6, + Uint: 7, + Uint8: 8, + Uint16: 9, + Uint32: 10, + Uint64: 11, + Uintptr: 12, + Float32: 14.1, + Float64: 15.1, + Foo: "foo", + Foo2: "foo2", + IntStr: 42, + String: "16", + Map: map[string]Small{ + "17": {Tag: "tag17"}, + "18": {Tag: "tag18"}, + }, + MapP: map[string]*Small{ + "19": {Tag: "tag19"}, + "20": nil, + }, + EmptyMap: map[string]Small{}, + Slice: []Small{{Tag: "tag20"}, {Tag: "tag21"}}, + SliceP: []*Small{{Tag: "tag22"}, nil, {Tag: "tag23"}}, + EmptySlice: []Small{}, + StringSlice: []string{"str24", "str25", "str26"}, + ByteSlice: []byte{27, 28, 29}, + Small: Small{Tag: "tag30"}, + PSmall: &Small{Tag: "tag31"}, + Interface: 5.2, +} + +var pallValue = All{ + PBool: &allValue.Bool, + PInt: &allValue.Int, + PInt8: &allValue.Int8, + PInt16: &allValue.Int16, + PInt32: &allValue.Int32, + PInt64: &allValue.Int64, + PUint: &allValue.Uint, + PUint8: &allValue.Uint8, + PUint16: &allValue.Uint16, + PUint32: &allValue.Uint32, + PUint64: &allValue.Uint64, + PUintptr: &allValue.Uintptr, + PFloat32: &allValue.Float32, + PFloat64: &allValue.Float64, + PString: &allValue.String, + PMap: &allValue.Map, + PMapP: &allValue.MapP, + PSlice: &allValue.Slice, + PSliceP: &allValue.SliceP, + PPSmall: &allValue.PSmall, + PInterface: &allValue.Interface, +} + +var allValueIndent = `{ + "Bool": true, + "Int": 2, + "Int8": 3, + "Int16": 4, + "Int32": 5, + "Int64": 6, + "Uint": 7, + "Uint8": 8, + "Uint16": 9, + "Uint32": 10, + "Uint64": 11, + "Uintptr": 12, + "Float32": 14.1, + "Float64": 15.1, + "bar": "foo", + "bar2": "foo2", + "IntStr": "42", + "PBool": null, + "PInt": null, + "PInt8": null, + "PInt16": null, + "PInt32": null, + "PInt64": null, + "PUint": null, + "PUint8": null, + "PUint16": null, + "PUint32": null, + "PUint64": null, + "PUintptr": null, + "PFloat32": null, + "PFloat64": null, + "String": "16", + "PString": null, + "Map": { + "17": { + "Tag": "tag17" + }, + "18": { + "Tag": "tag18" + } + }, + "MapP": { + "19": { + "Tag": "tag19" + }, + "20": null + }, + "PMap": null, + "PMapP": null, + "EmptyMap": {}, + "NilMap": null, + "Slice": [ + { + "Tag": "tag20" + }, + { + "Tag": "tag21" + } + ], + "SliceP": [ + { + "Tag": "tag22" + }, + null, + { + "Tag": "tag23" + } + ], + "PSlice": null, + "PSliceP": null, + "EmptySlice": [], + "NilSlice": null, + "StringSlice": [ + "str24", + "str25", + "str26" + ], + "ByteSlice": "Gxwd", + "Small": { + "Tag": "tag30" + }, + "PSmall": { + "Tag": "tag31" + }, + "PPSmall": null, + "Interface": 5.2, + "PInterface": null +}` + +var allValueCompact = strings.Map(noSpace, allValueIndent) + +var pallValueIndent = `{ + "Bool": false, + "Int": 0, + "Int8": 0, + "Int16": 0, + "Int32": 0, + "Int64": 0, + "Uint": 0, + "Uint8": 0, + "Uint16": 0, + "Uint32": 0, + "Uint64": 0, + "Uintptr": 0, + "Float32": 0, + "Float64": 0, + "bar": "", + "bar2": "", + "IntStr": "0", + "PBool": true, + "PInt": 2, + "PInt8": 3, + "PInt16": 4, + "PInt32": 5, + "PInt64": 6, + "PUint": 7, + "PUint8": 8, + "PUint16": 9, + "PUint32": 10, + "PUint64": 11, + "PUintptr": 12, + "PFloat32": 14.1, + "PFloat64": 15.1, + "String": "", + "PString": "16", + "Map": null, + "MapP": null, + "PMap": { + "17": { + "Tag": "tag17" + }, + "18": { + "Tag": "tag18" + } + }, + "PMapP": { + "19": { + "Tag": "tag19" + }, + "20": null + }, + "EmptyMap": null, + "NilMap": null, + "Slice": null, + "SliceP": null, + "PSlice": [ + { + "Tag": "tag20" + }, + { + "Tag": "tag21" + } + ], + "PSliceP": [ + { + "Tag": "tag22" + }, + null, + { + "Tag": "tag23" + } + ], + "EmptySlice": null, + "NilSlice": null, + "StringSlice": null, + "ByteSlice": null, + "Small": { + "Tag": "" + }, + "PSmall": null, + "PPSmall": { + "Tag": "tag31" + }, + "Interface": null, + "PInterface": 5.2 +}` + +var pallValueCompact = strings.Map(noSpace, pallValueIndent) + +func TestRefUnmarshal(t *testing.T) { + type S struct { + // Ref is defined in encode_test.go. + R0 Ref + R1 *Ref + R2 RefText + R3 *RefText + } + want := S{ + R0: 12, + R1: new(Ref), + R2: 13, + R3: new(RefText), + } + *want.R1 = 12 + *want.R3 = 13 + + var got S + if err := Unmarshal([]byte(`{"R0":"ref","R1":"ref","R2":"ref","R3":"ref"}`), &got); err != nil { + t.Fatalf("Unmarshal: %v", err) + } + if !reflect.DeepEqual(got, want) { + t.Errorf("got %+v, want %+v", got, want) + } +} + +// Test that the empty string doesn't panic decoding when ,string is specified +// Issue 3450 +func TestEmptyString(t *testing.T) { + type T2 struct { + Number1 int `json:",string"` + Number2 int `json:",string"` + } + data := `{"Number1":"1", "Number2":""}` + dec := NewDecoder(strings.NewReader(data)) + var t2 T2 + err := dec.Decode(&t2) + if err == nil { + t.Fatal("Decode: did not return error") + } + if t2.Number1 != 1 { + t.Fatal("Decode: did not set Number1") + } +} + +// Test that a null for ,string is not replaced with the previous quoted string (issue 7046). +// It should also not be an error (issue 2540, issue 8587). +func TestNullString(t *testing.T) { + type T struct { + A int `json:",string"` + B int `json:",string"` + C *int `json:",string"` + } + data := []byte(`{"A": "1", "B": null, "C": null}`) + var s T + s.B = 1 + s.C = new(int) + *s.C = 2 + err := Unmarshal(data, &s) + if err != nil { + t.Fatalf("Unmarshal: %v", err) + } + if s.B != 1 || s.C != nil { + t.Fatalf("after Unmarshal, s.B=%d, s.C=%p, want 1, nil", s.B, s.C) + } +} + +func intp(x int) *int { + p := new(int) + *p = x + return p +} + +func intpp(x *int) **int { + pp := new(*int) + *pp = x + return pp +} + +var interfaceSetTests = []struct { + pre interface{} + json string + post interface{} +}{ + {"foo", `"bar"`, "bar"}, + {"foo", `2`, 2.0}, + {"foo", `true`, true}, + {"foo", `null`, nil}, + + {nil, `null`, nil}, + {new(int), `null`, nil}, + {(*int)(nil), `null`, nil}, + {new(*int), `null`, new(*int)}, + {(**int)(nil), `null`, nil}, + {intp(1), `null`, nil}, + {intpp(nil), `null`, intpp(nil)}, + {intpp(intp(1)), `null`, intpp(nil)}, +} + +func TestInterfaceSet(t *testing.T) { + for _, tt := range interfaceSetTests { + b := struct{ X interface{} }{tt.pre} + blob := `{"X":` + tt.json + `}` + if err := Unmarshal([]byte(blob), &b); err != nil { + t.Errorf("Unmarshal %#q: %v", blob, err) + continue + } + if !reflect.DeepEqual(b.X, tt.post) { + t.Errorf("Unmarshal %#q into %#v: X=%#v, want %#v", blob, tt.pre, b.X, tt.post) + } + } +} + +// JSON null values should be ignored for primitives and string values instead of resulting in an error. +// Issue 2540 +func TestUnmarshalNulls(t *testing.T) { + jsonData := []byte(`{ + "Bool" : null, + "Int" : null, + "Int8" : null, + "Int16" : null, + "Int32" : null, + "Int64" : null, + "Uint" : null, + "Uint8" : null, + "Uint16" : null, + "Uint32" : null, + "Uint64" : null, + "Float32" : null, + "Float64" : null, + "String" : null}`) + + nulls := All{ + Bool: true, + Int: 2, + Int8: 3, + Int16: 4, + Int32: 5, + Int64: 6, + Uint: 7, + Uint8: 8, + Uint16: 9, + Uint32: 10, + Uint64: 11, + Float32: 12.1, + Float64: 13.1, + String: "14"} + + err := Unmarshal(jsonData, &nulls) + if err != nil { + t.Errorf("Unmarshal of null values failed: %v", err) + } + if !nulls.Bool || nulls.Int != 2 || nulls.Int8 != 3 || nulls.Int16 != 4 || nulls.Int32 != 5 || nulls.Int64 != 6 || + nulls.Uint != 7 || nulls.Uint8 != 8 || nulls.Uint16 != 9 || nulls.Uint32 != 10 || nulls.Uint64 != 11 || + nulls.Float32 != 12.1 || nulls.Float64 != 13.1 || nulls.String != "14" { + + t.Errorf("Unmarshal of null values affected primitives") + } +} + +func TestStringKind(t *testing.T) { + type stringKind string + + var m1, m2 map[stringKind]int + m1 = map[stringKind]int{ + "foo": 42, + } + + data, err := Marshal(m1) + if err != nil { + t.Errorf("Unexpected error marshalling: %v", err) + } + + err = Unmarshal(data, &m2) + if err != nil { + t.Errorf("Unexpected error unmarshalling: %v", err) + } + + if !reflect.DeepEqual(m1, m2) { + t.Error("Items should be equal after encoding and then decoding") + } +} + +// Custom types with []byte as underlying type could not be marshalled +// and then unmarshalled. +// Issue 8962. +func TestByteKind(t *testing.T) { + type byteKind []byte + + a := byteKind("hello") + + data, err := Marshal(a) + if err != nil { + t.Error(err) + } + var b byteKind + err = Unmarshal(data, &b) + if err != nil { + t.Fatal(err) + } + if !reflect.DeepEqual(a, b) { + t.Errorf("expected %v == %v", a, b) + } +} + +var decodeTypeErrorTests = []struct { + dest interface{} + src string +}{ + {new(string), `{"user": "name"}`}, // issue 4628. + {new(error), `{}`}, // issue 4222 + {new(error), `[]`}, + {new(error), `""`}, + {new(error), `123`}, + {new(error), `true`}, +} + +func TestUnmarshalTypeError(t *testing.T) { + for _, item := range decodeTypeErrorTests { + err := Unmarshal([]byte(item.src), item.dest) + if _, ok := err.(*UnmarshalTypeError); !ok { + t.Errorf("expected type error for Unmarshal(%q, type %T): got %T", + item.src, item.dest, err) + } + } +} + +var unmarshalSyntaxTests = []string{ + "tru", + "fals", + "nul", + "123e", + `"hello`, + `[1,2,3`, + `{"key":1`, + `{"key":1,`, +} + +func TestUnmarshalSyntax(t *testing.T) { + var x interface{} + for _, src := range unmarshalSyntaxTests { + err := Unmarshal([]byte(src), &x) + if _, ok := err.(*SyntaxError); !ok { + t.Errorf("expected syntax error for Unmarshal(%q): got %T", src, err) + } + } +} + +// Test handling of unexported fields that should be ignored. +// Issue 4660 +type unexportedFields struct { + Name string + m map[string]interface{} `json:"-"` + m2 map[string]interface{} `json:"abcd"` +} + +func TestUnmarshalUnexported(t *testing.T) { + input := `{"Name": "Bob", "m": {"x": 123}, "m2": {"y": 456}, "abcd": {"z": 789}}` + want := &unexportedFields{Name: "Bob"} + + out := &unexportedFields{} + err := Unmarshal([]byte(input), out) + if err != nil { + t.Errorf("got error %v, expected nil", err) + } + if !reflect.DeepEqual(out, want) { + t.Errorf("got %q, want %q", out, want) + } +} + +// Time3339 is a time.Time which encodes to and from JSON +// as an RFC 3339 time in UTC. +type Time3339 time.Time + +func (t *Time3339) UnmarshalJSON(b []byte) error { + if len(b) < 2 || b[0] != '"' || b[len(b)-1] != '"' { + return fmt.Errorf("types: failed to unmarshal non-string value %q as an RFC 3339 time", b) + } + tm, err := time.Parse(time.RFC3339, string(b[1:len(b)-1])) + if err != nil { + return err + } + *t = Time3339(tm) + return nil +} + +func TestUnmarshalJSONLiteralError(t *testing.T) { + var t3 Time3339 + err := Unmarshal([]byte(`"0000-00-00T00:00:00Z"`), &t3) + if err == nil { + t.Fatalf("expected error; got time %v", time.Time(t3)) + } + if !strings.Contains(err.Error(), "range") { + t.Errorf("got err = %v; want out of range error", err) + } +} + +// Test that extra object elements in an array do not result in a +// "data changing underfoot" error. +// Issue 3717 +func TestSkipArrayObjects(t *testing.T) { + json := `[{}]` + var dest [0]interface{} + + err := Unmarshal([]byte(json), &dest) + if err != nil { + t.Errorf("got error %q, want nil", err) + } +} + +// Test semantics of pre-filled struct fields and pre-filled map fields. +// Issue 4900. +func TestPrefilled(t *testing.T) { + ptrToMap := func(m map[string]interface{}) *map[string]interface{} { return &m } + + // Values here change, cannot reuse table across runs. + var prefillTests = []struct { + in string + ptr interface{} + out interface{} + }{ + { + in: `{"X": 1, "Y": 2}`, + ptr: &XYZ{X: float32(3), Y: int16(4), Z: 1.5}, + out: &XYZ{X: float64(1), Y: float64(2), Z: 1.5}, + }, + { + in: `{"X": 1, "Y": 2}`, + ptr: ptrToMap(map[string]interface{}{"X": float32(3), "Y": int16(4), "Z": 1.5}), + out: ptrToMap(map[string]interface{}{"X": float64(1), "Y": float64(2), "Z": 1.5}), + }, + } + + for _, tt := range prefillTests { + ptrstr := fmt.Sprintf("%v", tt.ptr) + err := Unmarshal([]byte(tt.in), tt.ptr) // tt.ptr edited here + if err != nil { + t.Errorf("Unmarshal: %v", err) + } + if !reflect.DeepEqual(tt.ptr, tt.out) { + t.Errorf("Unmarshal(%#q, %s): have %v, want %v", tt.in, ptrstr, tt.ptr, tt.out) + } + } +} + +var invalidUnmarshalTests = []struct { + v interface{} + want string +}{ + {nil, "json: Unmarshal(nil)"}, + {struct{}{}, "json: Unmarshal(non-pointer struct {})"}, + {(*int)(nil), "json: Unmarshal(nil *int)"}, +} + +func TestInvalidUnmarshal(t *testing.T) { + buf := []byte(`{"a":"1"}`) + for _, tt := range invalidUnmarshalTests { + err := Unmarshal(buf, tt.v) + if err == nil { + t.Errorf("Unmarshal expecting error, got nil") + continue + } + if got := err.Error(); got != tt.want { + t.Errorf("Unmarshal = %q; want %q", got, tt.want) + } + } +} + +var invalidUnmarshalTextTests = []struct { + v interface{} + want string +}{ + {nil, "json: Unmarshal(nil)"}, + {struct{}{}, "json: Unmarshal(non-pointer struct {})"}, + {(*int)(nil), "json: Unmarshal(nil *int)"}, + {new(net.IP), "json: cannot unmarshal string into Go value of type *net.IP"}, +} + +func TestInvalidUnmarshalText(t *testing.T) { + buf := []byte(`123`) + for _, tt := range invalidUnmarshalTextTests { + err := Unmarshal(buf, tt.v) + if err == nil { + t.Errorf("Unmarshal expecting error, got nil") + continue + } + if got := err.Error(); got != tt.want { + t.Errorf("Unmarshal = %q; want %q", got, tt.want) + } + } +} + +// Test that string option is ignored for invalid types. +// Issue 9812. +func TestInvalidStringOption(t *testing.T) { + num := 0 + item := struct { + T time.Time `json:",string"` + M map[string]string `json:",string"` + S []string `json:",string"` + A [1]string `json:",string"` + I interface{} `json:",string"` + P *int `json:",string"` + }{M: make(map[string]string), S: make([]string, 0), I: num, P: &num} + + data, err := Marshal(item) + if err != nil { + t.Fatalf("Marshal: %v", err) + } + + err = Unmarshal(data, &item) + if err != nil { + t.Fatalf("Unmarshal: %v", err) + } +} diff --git a/src/encoding/json/encode.go b/src/encoding/json/encode.go new file mode 100644 index 0000000000000000000000000000000000000000..90782deb70be7aedbcc837d5427a201bb7ff35da --- /dev/null +++ b/src/encoding/json/encode.go @@ -0,0 +1,1194 @@ +// Copyright 2010 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package json implements encoding and decoding of JSON objects as defined in +// RFC 4627. The mapping between JSON objects and Go values is described +// in the documentation for the Marshal and Unmarshal functions. +// +// See "JSON and Go" for an introduction to this package: +// https://golang.org/doc/articles/json_and_go.html +package json + +import ( + "bytes" + "encoding" + "encoding/base64" + "math" + "reflect" + "runtime" + "sort" + "strconv" + "strings" + "sync" + "unicode" + "unicode/utf8" +) + +// Marshal returns the JSON encoding of v. +// +// Marshal traverses the value v recursively. +// If an encountered value implements the Marshaler interface +// and is not a nil pointer, Marshal calls its MarshalJSON method +// to produce JSON. The nil pointer exception is not strictly necessary +// but mimics a similar, necessary exception in the behavior of +// UnmarshalJSON. +// +// Otherwise, Marshal uses the following type-dependent default encodings: +// +// Boolean values encode as JSON booleans. +// +// Floating point, integer, and Number values encode as JSON numbers. +// +// String values encode as JSON strings coerced to valid UTF-8, +// replacing invalid bytes with the Unicode replacement rune. +// The angle brackets "<" and ">" are escaped to "\u003c" and "\u003e" +// to keep some browsers from misinterpreting JSON output as HTML. +// Ampersand "&" is also escaped to "\u0026" for the same reason. +// +// Array and slice values encode as JSON arrays, except that +// []byte encodes as a base64-encoded string, and a nil slice +// encodes as the null JSON object. +// +// Struct values encode as JSON objects. Each exported struct field +// becomes a member of the object unless +// - the field's tag is "-", or +// - the field is empty and its tag specifies the "omitempty" option. +// The empty values are false, 0, any +// nil pointer or interface value, and any array, slice, map, or string of +// length zero. The object's default key string is the struct field name +// but can be specified in the struct field's tag value. The "json" key in +// the struct field's tag value is the key name, followed by an optional comma +// and options. Examples: +// +// // Field is ignored by this package. +// Field int `json:"-"` +// +// // Field appears in JSON as key "myName". +// Field int `json:"myName"` +// +// // Field appears in JSON as key "myName" and +// // the field is omitted from the object if its value is empty, +// // as defined above. +// Field int `json:"myName,omitempty"` +// +// // Field appears in JSON as key "Field" (the default), but +// // the field is skipped if empty. +// // Note the leading comma. +// Field int `json:",omitempty"` +// +// The "string" option signals that a field is stored as JSON inside a +// JSON-encoded string. It applies only to fields of string, floating point, +// integer, or boolean types. This extra level of encoding is sometimes used +// when communicating with JavaScript programs: +// +// Int64String int64 `json:",string"` +// +// The key name will be used if it's a non-empty string consisting of +// only Unicode letters, digits, dollar signs, percent signs, hyphens, +// underscores and slashes. +// +// Anonymous struct fields are usually marshaled as if their inner exported fields +// were fields in the outer struct, subject to the usual Go visibility rules amended +// as described in the next paragraph. +// An anonymous struct field with a name given in its JSON tag is treated as +// having that name, rather than being anonymous. +// An anonymous struct field of interface type is treated the same as having +// that type as its name, rather than being anonymous. +// +// The Go visibility rules for struct fields are amended for JSON when +// deciding which field to marshal or unmarshal. If there are +// multiple fields at the same level, and that level is the least +// nested (and would therefore be the nesting level selected by the +// usual Go rules), the following extra rules apply: +// +// 1) Of those fields, if any are JSON-tagged, only tagged fields are considered, +// even if there are multiple untagged fields that would otherwise conflict. +// 2) If there is exactly one field (tagged or not according to the first rule), that is selected. +// 3) Otherwise there are multiple fields, and all are ignored; no error occurs. +// +// Handling of anonymous struct fields is new in Go 1.1. +// Prior to Go 1.1, anonymous struct fields were ignored. To force ignoring of +// an anonymous struct field in both current and earlier versions, give the field +// a JSON tag of "-". +// +// Map values encode as JSON objects. +// The map's key type must be string; the map keys are used as JSON object +// keys, subject to the UTF-8 coercion described for string values above. +// +// Pointer values encode as the value pointed to. +// A nil pointer encodes as the null JSON object. +// +// Interface values encode as the value contained in the interface. +// A nil interface value encodes as the null JSON object. +// +// Channel, complex, and function values cannot be encoded in JSON. +// Attempting to encode such a value causes Marshal to return +// an UnsupportedTypeError. +// +// JSON cannot represent cyclic data structures and Marshal does not +// handle them. Passing cyclic structures to Marshal will result in +// an infinite recursion. +// +func Marshal(v interface{}) ([]byte, error) { + e := &encodeState{} + err := e.marshal(v) + if err != nil { + return nil, err + } + return e.Bytes(), nil +} + +// MarshalIndent is like Marshal but applies Indent to format the output. +func MarshalIndent(v interface{}, prefix, indent string) ([]byte, error) { + b, err := Marshal(v) + if err != nil { + return nil, err + } + var buf bytes.Buffer + err = Indent(&buf, b, prefix, indent) + if err != nil { + return nil, err + } + return buf.Bytes(), nil +} + +// HTMLEscape appends to dst the JSON-encoded src with <, >, &, U+2028 and U+2029 +// characters inside string literals changed to \u003c, \u003e, \u0026, \u2028, \u2029 +// so that the JSON will be safe to embed inside HTML `, + []string{ + `"\u003cb\u003e \"foo%\" O'Reilly \u0026bar;"`, + `"a[href =~ \"//example.com\"]#foo"`, + `"Hello, \u003cb\u003eWorld\u003c/b\u003e \u0026amp;tc!"`, + `" dir=\"ltr\""`, + // Not escaped. + `c && alert("Hello, World!");`, + // Escape sequence not over-escaped. + `"Hello, World & O'Reilly\x21"`, + `"greeting=H%69\u0026addressee=(World)"`, + }, + }, + { + `